From 126161352d924fcc389da09fdd149f9aaddfb08f Mon Sep 17 00:00:00 2001 From: Aymen LAOUINI Date: Wed, 18 Jun 2025 17:26:00 +0300 Subject: [PATCH 0001/3334] [nrf fromtree] tests: kernel: gen_isr_table: Add ISR offset definitions for nrf9280 - Correct test by adding ISR offset definitions for nrf9280 ppr and flrp. Signed-off-by: Aymen LAOUINI (cherry picked from commit 07d9f151e71f3960ab1ea0dd81afd86775d522dc) --- tests/arch/common/gen_isr_table/src/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/arch/common/gen_isr_table/src/main.c b/tests/arch/common/gen_isr_table/src/main.c index e716f0ddf4b6..ed764e05b4bf 100644 --- a/tests/arch/common/gen_isr_table/src/main.c +++ b/tests/arch/common/gen_isr_table/src/main.c @@ -42,6 +42,11 @@ extern const uintptr_t _irq_vector_table[]; #define ISR3_OFFSET 15 #define ISR5_OFFSET 16 #define TRIG_CHECK_SIZE 17 +#elif defined(CONFIG_SOC_NRF9280_CPUPPR) +#define ISR1_OFFSET 14 +#define ISR3_OFFSET 15 +#define ISR5_OFFSET 16 +#define TRIG_CHECK_SIZE 17 #else #error "Target not supported" #endif From 2b0ac9d9861fd94253c6d933cf9d308b9827b0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 30 Jun 2025 08:03:06 +0200 Subject: [PATCH 0002/3334] [nrf fromlist] dts: bindings: serial: nrf-uarte: Add timer property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Timer property indicates which TIMER instance should be used for byte counting. If timer property is present then given instance is using TIMER to count received bytes. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit f976924e71021620a08475c5f2002d88209d9ace) --- dts/bindings/serial/nordic,nrf-uarte.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dts/bindings/serial/nordic,nrf-uarte.yaml b/dts/bindings/serial/nordic,nrf-uarte.yaml index 4e9ccb0dd400..c8eb2bbc758d 100644 --- a/dts/bindings/serial/nordic,nrf-uarte.yaml +++ b/dts/bindings/serial/nordic,nrf-uarte.yaml @@ -24,3 +24,11 @@ properties: type: boolean description: | UARTE allows usage of cross domain pins with constant latency mode required. + + timer: + type: phandle + description: | + Timer instance used to count received bytes. Due to issues with frame timeout + feature it is required to reliably receive data in cases where flow control + is not used and new byte can appear on the line when frame timeout expires + but before it is handled. From 0285066a86af150212952ce55f18e00fc1f3e2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 7 Jul 2025 12:02:24 +0200 Subject: [PATCH 0003/3334] [nrf fromlist] tests: drivers: uart: async_dual: Add progress report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add reporting about the test progress. Test lasts few seconds and progress report helps to see if test stuck or how it is progressing. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit ed0b0724be11a81a88f1c5b9c0b02774563f3115) --- tests/drivers/uart/uart_async_dual/src/main.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index 37ce73120acb..d14e0f88a11e 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -365,6 +365,26 @@ static void config_baudrate(uint32_t rate) } } +static void report_progress(uint32_t start) +{ + static const uint32_t inc = CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT / 20; + static uint32_t next; + static uint32_t progress; + + if ((k_uptime_get_32() - start < inc) && progress) { + /* Reset state. */ + next = inc; + progress = 0; + } + + if (k_uptime_get_32() > (start + next)) { + progress += 5; + TC_PRINT("\r%d%%", progress); + next += inc; + } +} + + /* Test is running following scenario. Transmitter is sending packets which * has 1 byte header with length followed by the payload. Transmitter can send * packets in two modes: bulk where data is send in chunks without gaps between @@ -380,6 +400,7 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) { int err; uint32_t load = 0; + uint32_t start = k_uptime_get_32(); config_baudrate(baudrate); @@ -420,8 +441,10 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) while (tx_data.cont || rx_data.cont) { fill_tx(&tx_data); k_msleep(1); + report_progress(start); try_tx(tx_dev, false); } + TC_PRINT("\n"); if (IS_ENABLED(CONFIG_CPU_LOAD)) { load = cpu_load_get(true); @@ -653,6 +676,7 @@ static void hci_like_rx(void) uint8_t len; bool cont; bool explicit_pm = IS_ENABLED(CONFIG_PM_RUNTIME_IN_TEST); + uint32_t start = k_uptime_get_32(); while (1) { if (explicit_pm) { @@ -704,7 +728,9 @@ static void hci_like_rx(void) PM_CHECK(rx_dev, tx_dev, false); check_payload(rx_data.buf, len); + report_progress(start); } + TC_PRINT("\n"); } #define HCI_LIKE_TX_STACK_SIZE 2048 From 1b2584c476e710cce12596d7380a6e227c062782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 7 Jul 2025 12:02:46 +0200 Subject: [PATCH 0004/3334] [nrf fromlist] tests: drivers: uart: async_dual: Extend testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend test with a mode where HWFC is off and receiver is providing buffers on time. In that case receiver should be able to continuously receive data without losing any byte (even without HWFC). Additionally, TX data is chopped to verify that receiver does not loose bytes when new TX data collides with detected RX timeout. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 4b000e7b087e435d28f45a3736e9036c51b13138) --- tests/drivers/uart/uart_async_dual/Kconfig | 8 + tests/drivers/uart/uart_async_dual/src/main.c | 218 ++++++++++++++---- .../uart/uart_async_dual/testcase.yaml | 15 ++ 3 files changed, 191 insertions(+), 50 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/Kconfig b/tests/drivers/uart/uart_async_dual/Kconfig index 6e80ec3a7957..f0087aa48e3b 100644 --- a/tests/drivers/uart/uart_async_dual/Kconfig +++ b/tests/drivers/uart/uart_async_dual/Kconfig @@ -16,5 +16,13 @@ config PM_RUNTIME_IN_TEST select PM_DEVICE select PM_DEVICE_RUNTIME +config TEST_CHOPPED_TX + bool "Test chopped TX data" + default y + help + When enabled then test cases that transmits TX packets in random chunks are + performed. Some driver implementation do not support case when new TX data + collides with handling of the RX timeout. + # Include Zephyr's Kconfig source "Kconfig" diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index d14e0f88a11e..c2ad5d8a0a0c 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -28,9 +28,10 @@ LOG_MODULE_REGISTER(test); #endif #define TX_TIMEOUT 100000 -#define RX_TIMEOUT 2000 +#define RX_TIMEOUT_BYTES 50 #define MAX_PACKET_LEN 128 +#define MIN_PACKET_LEN 10 struct dut_data { const struct device *dev; @@ -100,6 +101,7 @@ static const struct device *tx_dev; enum test_tx_mode { TX_BULK, TX_PACKETS, + TX_CHOPPED, }; struct test_tx_data { @@ -111,6 +113,8 @@ struct test_tx_data { volatile bool cont; volatile enum test_tx_mode mode; struct k_sem sem; + uint32_t idx; + uint32_t rx_timeout; }; enum test_rx_state { @@ -121,17 +125,21 @@ enum test_rx_state { enum test_rx_mode { RX_CONT, RX_DIS, + RX_ALL, }; struct test_rx_data { uint8_t hdr[1]; uint8_t buf[256]; uint32_t rx_cnt; + uint32_t payload_idx; enum test_rx_state state; enum test_rx_mode mode; volatile bool cont; bool buf_req; struct k_sem sem; + uint32_t timeout; + uint32_t buf_idx; }; static struct test_tx_data tx_data; @@ -143,8 +151,8 @@ static void fill_tx(struct test_tx_data *data) uint32_t len; int err; - if (data->mode == TX_PACKETS) { - err = k_sem_take(&data->sem, K_MSEC(100)); + if (data->mode != TX_BULK) { + err = k_sem_take(&data->sem, K_MSEC(200)); if (err < 0 && !data->cont) { return; } @@ -153,9 +161,10 @@ static void fill_tx(struct test_tx_data *data) uint8_t len = sys_rand8_get(); len = len % MAX_PACKET_LEN; - len = MAX(2, len); + len = MAX(MIN_PACKET_LEN, len); data->packet_len = len; + data->idx = 0; for (int i = 0; i < len; i++) { data->buf[i] = len - i; } @@ -163,12 +172,11 @@ static void fill_tx(struct test_tx_data *data) return; } - while ((len = ring_buf_put_claim(&data->rbuf, &buf, 255)) > 1) { + while ((len = ring_buf_put_claim(&data->rbuf, &buf, 255)) > 0) { uint8_t r = (sys_rand8_get() % MAX_PACKET_LEN) % len; - uint8_t packet_len = MAX(r, 2); - uint8_t rem = len - packet_len; + uint8_t packet_len = MAX(r, MIN_PACKET_LEN); - packet_len = (rem < 3) ? len : packet_len; + packet_len = (len <= MIN_PACKET_LEN) ? len : packet_len; buf[0] = packet_len; for (int i = 1; i < packet_len; i++) { buf[i] = packet_len - i; @@ -189,7 +197,7 @@ static void try_tx(const struct device *dev, bool irq) return; } - if ((tx_data.mode == TX_PACKETS) && (tx_data.packet_len > 0)) { + if (tx_data.mode == TX_PACKETS) { uint8_t len = tx_data.packet_len; tx_data.packet_len = 0; @@ -199,19 +207,50 @@ static void try_tx(const struct device *dev, bool irq) err, irq, tx_data.cont); return; } - zassert_true(tx_data.mode == TX_BULK); - if (!atomic_cas(&tx_data.busy, 0, 1)) { + if (tx_data.mode == TX_BULK) { + if (!atomic_cas(&tx_data.busy, 0, 1)) { + return; + } + + len = ring_buf_get_claim(&tx_data.rbuf, &buf, 255); + if (len > 0) { + err = uart_tx(dev, buf, len, TX_TIMEOUT); + zassert_equal(err, 0, + "Unexpected err:%d irq:%d cont:%d\n", + err, irq, tx_data.cont); + } else { + tx_data.busy = 0; + } return; } - len = ring_buf_get_claim(&tx_data.rbuf, &buf, 255); - if (len > 0) { - err = uart_tx(dev, buf, len, TX_TIMEOUT); - zassert_equal(err, 0, - "Unexpected err:%d irq:%d cont:%d\n", - err, irq, tx_data.cont); + zassert_true(tx_data.mode == TX_CHOPPED); + + uint32_t rem = tx_data.packet_len - tx_data.idx; + + if (tx_data.packet_len > 12) { + len = sys_rand8_get() % (tx_data.packet_len / 4); + } else { + len = 0; } + len = MAX(3, len); + len = MIN(rem, len); + + buf = &tx_data.buf[tx_data.idx]; + tx_data.idx += len; + + err = uart_tx(dev, buf, len, TX_TIMEOUT); + zassert_equal(err, 0, + "Unexpected err:%d irq:%d cont:%d\n", + err, irq, tx_data.cont); +} + +static void tx_backoff(uint32_t rx_timeout) +{ + uint32_t delay = (rx_timeout / 2) + (sys_rand32_get() % rx_timeout); + + k_busy_wait(delay); } static void on_tx_done(const struct device *dev, struct uart_event *evt) @@ -221,6 +260,17 @@ static void on_tx_done(const struct device *dev, struct uart_event *evt) return; } + if (tx_data.mode == TX_CHOPPED) { + if (tx_data.idx == tx_data.packet_len) { + k_sem_give(&tx_data.sem); + } else { + + tx_backoff(tx_data.rx_timeout); + try_tx(dev, true); + } + return; + } + /* Finish previous data chunk and start new if any pending. */ ring_buf_get_finish(&tx_data.rbuf, evt->data.tx.len); atomic_set(&tx_data.busy, 0); @@ -239,7 +289,16 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) rx_data.rx_cnt += evt->data.rx.len; if (evt->data.rx.buf == rx_data.hdr) { + if (rx_data.hdr[0] == 1) { + /* single byte packet. */ + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); + return; + } + + zassert_equal(rx_data.payload_idx, 0); rx_data.state = RX_PAYLOAD; + rx_data.payload_idx = rx_data.hdr[0] - 1; if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { size_t l = rx_data.hdr[0] - 1; @@ -248,16 +307,19 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) err = uart_rx_buf_rsp(dev, rx_data.buf, rx_data.hdr[0] - 1); } } else { - /* Payload received */ - rx_data.state = RX_HDR; - zassert_equal(len, rx_data.hdr[0] - 1); - for (int i = 0; i < len; i++) { - bool ok = evt->data.rx.buf[off + i] == (uint8_t)(len - i); + bool ok; + + if ((rx_data.mode == RX_ALL) && (rx_data.payload_idx == 0)) { + rx_data.payload_idx = evt->data.rx.buf[off + i]; + ok = true; + } else { + ok = evt->data.rx.buf[off + i] == (uint8_t)rx_data.payload_idx; + } if (!ok) { LOG_ERR("Unexpected data at %d, exp:%02x got:%02x", - i, len - i, evt->data.rx.buf[off + i]); + i, rx_data.payload_idx, evt->data.rx.buf[off + i]); } zassert_true(ok, "Unexpected data at %d, exp:%02x got:%02x", @@ -270,21 +332,52 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) */ return; } - } - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + rx_data.payload_idx--; + if (rx_data.payload_idx == 0) { + if (rx_data.mode != RX_ALL) { + zassert_equal(i + 1, len, "len:%d i:%d", len, i); + } + rx_data.state = RX_HDR; + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); + } + } } } } +static void on_rx_buf_req(const struct device *dev) +{ + if (rx_data.mode != RX_ALL) { + rx_data.buf_req = true; + return; + } + + size_t len = sizeof(rx_data.buf) / 2; + uint8_t *buf = &rx_data.buf[len * rx_data.buf_idx]; + + rx_data.buf_idx = (rx_data.buf_idx + 1) & 0x1; + uart_rx_buf_rsp(dev, buf, len); +} + static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *user_data) { ARG_UNUSED(evt); struct test_rx_data *data = user_data; int err; - uint8_t *buf = (data->state == RX_HDR) ? data->hdr : data->buf; - uint32_t len = (data->state == RX_HDR) ? 1 : (data->hdr[0] - 1); + uint8_t *buf; + uint32_t len; + + if (data->mode == RX_ALL) { + buf = data->buf; + len = sizeof(data->buf) / 2; + } else { + buf = (data->state == RX_HDR) ? data->hdr : data->buf; + len = (data->state == RX_HDR) ? 1 : (data->hdr[0] - 1); + data->buf_idx = 1; + } data->buf_req = false; @@ -294,7 +387,7 @@ static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *us zassert_true(len > 0); - err = uart_rx_enable(dev, buf, len, RX_TIMEOUT); + err = uart_rx_enable(dev, buf, len, data->timeout); zassert_equal(err, 0, "Unexpected err:%d", err); } @@ -330,8 +423,8 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void zassert_true(dev == rx_dev); break; case UART_RX_BUF_REQUEST: - rx_data.buf_req = true; zassert_true(dev == rx_dev); + on_rx_buf_req(dev); break; case UART_RX_DISABLED: zassert_true(dev == rx_dev); @@ -346,7 +439,7 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void } } -static void config_baudrate(uint32_t rate) +static void config_baudrate(uint32_t rate, bool hwfc) { struct uart_config config; int err; @@ -354,6 +447,7 @@ static void config_baudrate(uint32_t rate) err = uart_config_get(rx_dev, &config); zassert_equal(err, 0, "Unexpected err:%d", err); + config.flow_ctrl = hwfc ? UART_CFG_FLOW_CTRL_RTS_CTS : UART_CFG_FLOW_CTRL_NONE; config.baudrate = rate; err = uart_configure(rx_dev, &config); @@ -396,13 +490,14 @@ static void report_progress(uint32_t start) * * Test has busy simulator running if it is enabled in the configuration. */ -static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) +static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, + enum test_rx_mode rx_mode, bool hwfc) { int err; uint32_t load = 0; uint32_t start = k_uptime_get_32(); - config_baudrate(baudrate); + config_baudrate(baudrate, hwfc); if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { uint32_t active_avg = (baudrate == 1000000) ? 5 : 30; @@ -414,13 +509,15 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) memset(&tx_data, 0, sizeof(tx_data)); memset(&rx_data, 0, sizeof(rx_data)); tx_data.cont = true; - tx_data.mode = tx_packets ? TX_PACKETS : TX_BULK; - k_sem_init(&tx_data.sem, tx_packets ? 1 : 0, 1); + tx_data.mode = tx_mode; + k_sem_init(&tx_data.sem, (tx_mode != TX_BULK) ? 1 : 0, 1); + rx_data.timeout = (RX_TIMEOUT_BYTES * 1000000 * 10) / baudrate; + tx_data.rx_timeout = rx_data.timeout; rx_data.cont = true; rx_data.rx_cnt = 0; rx_data.state = RX_HDR; - rx_data.mode = cont ? RX_CONT : RX_DIS; + rx_data.mode = rx_mode; ring_buf_init(&tx_data.rbuf, sizeof(tx_data.buf), tx_data.buf); @@ -459,62 +556,82 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) /* Flush all TX data that may be already started. */ k_msleep(10); - (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), RX_TIMEOUT); + (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); k_msleep(10); (void)uart_rx_disable(rx_dev); k_msleep(10); TC_PRINT("Received %d bytes for %d ms, CPU load:%d.%d\n", rx_data.rx_cnt, CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT, load / 10, load % 10); - zassert_true(rx_data.rx_cnt > 1000, "Unexected RX cnt: %d", rx_data.rx_cnt); + zassert_true(rx_data.rx_cnt > 1000, "Unexpected RX cnt: %d", rx_data.rx_cnt); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_dis_hwfc) { /* TX in bulk mode, RX in DIS mode, 115k2 */ - var_packet_hwfc(115200, false, false); + var_packet(115200, TX_BULK, RX_DIS, true); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_cont_hwfc) { /* TX in bulk mode, RX in CONT mode, 115k2 */ - var_packet_hwfc(115200, false, true); + var_packet(115200, TX_BULK, RX_CONT, true); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_dis_hwfc_1m) { /* TX in bulk mode, RX in DIS mode, 1M */ - var_packet_hwfc(1000000, false, false); + var_packet(1000000, TX_BULK, RX_DIS, true); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_cont_hwfc_1m) { /* TX in bulk mode, RX in CONT mode, 1M */ - var_packet_hwfc(1000000, false, true); + var_packet(1000000, TX_BULK, RX_CONT, true); } ZTEST(uart_async_dual, test_var_packets_dis_hwfc) { /* TX in packet mode, RX in DIS mode, 115k2 */ - var_packet_hwfc(115200, true, false); + var_packet(115200, TX_PACKETS, RX_DIS, true); } ZTEST(uart_async_dual, test_var_packets_cont_hwfc) { /* TX in packet mode, RX in CONT mode, 115k2 */ - var_packet_hwfc(115200, true, true); + var_packet(115200, TX_PACKETS, RX_CONT, true); } ZTEST(uart_async_dual, test_var_packets_dis_hwfc_1m) { /* TX in packet mode, RX in DIS mode, 1M */ - var_packet_hwfc(1000000, true, false); + var_packet(1000000, TX_PACKETS, RX_DIS, true); } ZTEST(uart_async_dual, test_var_packets_cont_hwfc_1m) { /* TX in packet mode, RX in CONT mode, 1M */ - var_packet_hwfc(1000000, true, true); + var_packet(1000000, TX_PACKETS, RX_CONT, true); +} + +ZTEST(uart_async_dual, test_var_packets_chopped_all) +{ + if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { + ztest_test_skip(); + } + + /* TX in chopped mode, RX in receive ALL mode, 115k2 */ + var_packet(115200, TX_CHOPPED, RX_ALL, false); +} + +ZTEST(uart_async_dual, test_var_packets_chopped_all_1m) +{ + if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { + ztest_test_skip(); + } + + /* TX in chopped mode, RX in receive ALL mode, 1M */ + var_packet(1000000, TX_CHOPPED, RX_ALL, false); } static void hci_like_callback(const struct device *dev, struct uart_event *evt, void *user_data) @@ -563,7 +680,7 @@ static bool rx(uint8_t *buf, size_t len) { int err; - err = uart_rx_enable(rx_dev, buf, len, RX_TIMEOUT); + err = uart_rx_enable(rx_dev, buf, len, rx_data.timeout); zassert_equal(err, 0, "Unexpected err:%d", err); err = k_sem_take(&rx_data.sem, K_MSEC(100)); @@ -751,7 +868,7 @@ static void hci_like_test(uint32_t baudrate) int err; uint32_t load = 0; - config_baudrate(baudrate); + config_baudrate(baudrate, true); if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { uint32_t active_avg = (baudrate == 1000000) ? 10 : 50; @@ -765,6 +882,7 @@ static void hci_like_test(uint32_t baudrate) tx_data.cnt = 0; tx_data.cont = true; rx_data.cont = true; + rx_data.timeout = (RX_TIMEOUT_BYTES * 1000000 * 10) / baudrate; k_sem_init(&tx_data.sem, 1, 1); k_sem_init(&rx_data.sem, 0, 1); @@ -802,7 +920,7 @@ static void hci_like_test(uint32_t baudrate) k_msleep(10); PM_CHECK(tx_dev, rx_dev, false); - (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), RX_TIMEOUT); + (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); k_msleep(1); (void)uart_rx_disable(rx_dev); diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index 1a2d811bbfe9..1722d5e5e7d1 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -73,3 +73,18 @@ tests: - nrf52_bsim extra_configs: - CONFIG_PM_RUNTIME_IN_TEST=y + drivers.uart.async_dual.no_tx_chopped: + harness: ztest + harness_config: + fixture: uart_loopback + depends_on: gpio + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad + - nrf54h20dk/nrf54h20/cpuppr + - nrf9160dk/nrf9160 + - nrf52_bsim + extra_configs: + - CONFIG_TEST_CHOPPED_TX=n + - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER=n From 07f39d03f36324750b9f338ceaf402adf515b29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 30 Jun 2025 08:08:26 +0200 Subject: [PATCH 0005/3334] [nrf fromlist] tests: drivers: uart: async_dual: Update configuration for nrf54l MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add timer property to the uart device under test. Add zephyr,pm-device-runtime-auto to the uart device under test. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit f2bbea0dbcdb86943eaba15bfc62cefc83933e6c) --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index a1e29cbf0ffc..d8995e369711 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -42,6 +42,7 @@ dut: &uart21 { pinctrl-1 = <&uart21_sleep_alt>; pinctrl-names = "default", "sleep"; current-speed = <115200>; + timer = <&timer21>; }; dut2: &uart00 { diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 93ad73f3b373..224399ccaa95 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -38,6 +38,10 @@ }; }; +&timer21 { + status = "reserved"; +}; + dut: &uart21 { status = "okay"; current-speed = <115200>; @@ -45,6 +49,8 @@ dut: &uart21 { pinctrl-1 = <&uart21_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; + timer = <&timer21>; + zephyr,pm-device-runtime-auto; }; dut_aux: &uart22 { @@ -54,6 +60,7 @@ dut_aux: &uart22 { pinctrl-1 = <&uart22_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; + zephyr,pm-device-runtime-auto; }; &timer20 { From 80e400c6ffd64281e48baa666b6fd86a6e843944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 4 Jul 2025 13:02:21 +0200 Subject: [PATCH 0006/3334] [nrf fromlist] tests: drivers: uart: async_dual: Extend nrf54h20dk configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add workaround timer to instances that are used for reception in the test. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 0ddadd3b8b5eae24dd88423ea4d64a776a83bc54) --- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 22 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 12 ++++++++++ 2 files changed, 34 insertions(+) diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi index e651cf5399ed..1ca0775f629e 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -60,6 +60,16 @@ }; }; +&timer134 { + status = "reserved"; +}; + +&dppic135 { + owned-channels = <0>; + source-channels = <0>; + status = "okay"; +}; + dut: &uart134 { status = "okay"; current-speed = <115200>; @@ -67,6 +77,7 @@ dut: &uart134 { pinctrl-1 = <&uart134_alt_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; + timer = <&timer134>; zephyr,pm-device-runtime-auto; }; @@ -80,12 +91,23 @@ dut_aux: &uart137 { zephyr,pm-device-runtime-auto; }; +&dppic120 { + owned-channels = <0>; + source-channels = <0>; + status = "okay"; +}; + +&timer120 { + status = "reserved"; +}; + dut2: &uart120 { pinctrl-0 = <&uart120_default_alt>; pinctrl-1 = <&uart120_sleep_alt>; pinctrl-names = "default", "sleep"; current-speed = <115200>; hw-flow-control; + timer = <&timer120>; zephyr,pm-device-runtime-auto; }; diff --git a/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index fcdc838a54e4..65a2c52016e6 100644 --- a/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -9,3 +9,15 @@ status = "reserved"; interrupt-parent = <&cpuppr_clic>; }; + +&timer134 { + interrupt-parent = <&cpuppr_clic>; +}; + +&dppic135 { + child-owned-channels = <0>; +}; + +&uart136 { + current-speed = <1000000>; +}; From 90d6461fde529941e2794291bc82c64948366f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 11 Jul 2025 12:46:55 +0200 Subject: [PATCH 0007/3334] [nrf fromlist] tests: drivers: uart: async_dual: Optimize test data handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stress test is executed on CPUs with slow clock (16MHz). Handling of test data in UART_RX_RDY event is optimized to reduce time spent in the interrupt context. Since payload is always a decrementing sequence, fixed array is used to compare memory which allows to use standard memcmp instead of byte by byte comparison. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit b208c44a913b9a012b75ecfa67e958c40c3ffd66) --- tests/drivers/uart/uart_async_dual/src/main.c | 152 +++++++++++------- 1 file changed, 94 insertions(+), 58 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index c2ad5d8a0a0c..160d8c761040 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -61,6 +61,25 @@ ZTEST_DMEM struct dut_data duts[] = { #endif }; +/* Array that contains potential payload. It is used to memcmp against incoming packets. */ +static const uint8_t test_buf[256] = { + 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, + 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, + 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, + 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, + 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, + 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, + 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, + 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, + 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, + 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, + 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, + 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, + 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, + 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, + 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, + 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; + static void pm_check(const struct device *dev, const struct device *second_dev, bool exp_on, int line) { @@ -128,6 +147,8 @@ enum test_rx_mode { RX_ALL, }; +typedef bool (*test_on_rx_rdy_t)(const struct device *dev, uint8_t *buf, size_t len); + struct test_rx_data { uint8_t hdr[1]; uint8_t buf[256]; @@ -140,6 +161,7 @@ struct test_rx_data { struct k_sem sem; uint32_t timeout; uint32_t buf_idx; + test_on_rx_rdy_t on_rx_rdy; }; static struct test_tx_data tx_data; @@ -277,75 +299,86 @@ static void on_tx_done(const struct device *dev, struct uart_event *evt) try_tx(dev, true); } -static void on_rx_rdy(const struct device *dev, struct uart_event *evt) +static bool on_rx_rdy_rx_all(const struct device *dev, uint8_t *buf, size_t len) { - uint32_t len = evt->data.rx.len; - uint32_t off = evt->data.rx.offset; - int err; + bool ok; - if (!rx_data.cont) { - return; + if (rx_data.payload_idx == 0) { + rx_data.payload_idx = buf[0] - 1; + buf++; + len--; } - rx_data.rx_cnt += evt->data.rx.len; - if (evt->data.rx.buf == rx_data.hdr) { - if (rx_data.hdr[0] == 1) { - /* single byte packet. */ - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); - return; + ok = memcmp(buf, &test_buf[256 - rx_data.payload_idx], len) == 0; + rx_data.payload_idx -= len; + + return ok; +} + +static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len); + +static bool on_rx_rdy_payload(const struct device *dev, uint8_t *buf, size_t len) +{ + bool ok; + int err; + + ok = memcmp(buf, &test_buf[255 - rx_data.payload_idx], len) == 0; + if (!ok) { + for (int i = 0; i < len; i++) { + if (buf[i] != test_buf[255 - rx_data.payload_idx + i]) { + zassert_true(false, "Byte %d expected: %02x got: %02x", + i, buf[i], test_buf[255 - rx_data.payload_idx + i]); + } } + rx_data.cont = false; + tx_data.cont = false; + zassert_true(ok); + return false; + } - zassert_equal(rx_data.payload_idx, 0); - rx_data.state = RX_PAYLOAD; - rx_data.payload_idx = rx_data.hdr[0] - 1; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - size_t l = rx_data.hdr[0] - 1; + rx_data.payload_idx -= len; - zassert_true(l > 0); + if (rx_data.payload_idx == 0) { + rx_data.state = RX_HDR; + rx_data.on_rx_rdy = on_rx_rdy_hdr; + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.buf, rx_data.hdr[0] - 1); + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); } - } else { - for (int i = 0; i < len; i++) { - bool ok; + } - if ((rx_data.mode == RX_ALL) && (rx_data.payload_idx == 0)) { - rx_data.payload_idx = evt->data.rx.buf[off + i]; - ok = true; - } else { - ok = evt->data.rx.buf[off + i] == (uint8_t)rx_data.payload_idx; - } + return true; +} - if (!ok) { - LOG_ERR("Unexpected data at %d, exp:%02x got:%02x", - i, rx_data.payload_idx, evt->data.rx.buf[off + i]); - } +static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) +{ + int err; - zassert_true(ok, "Unexpected data at %d, exp:%02x got:%02x", - i, len - i, evt->data.rx.buf[off + i]); - if (!ok) { - rx_data.cont = false; - tx_data.cont = false; - /* Avoid flood of errors as we are in the interrupt and ztest - * cannot abort from here. - */ - return; - } - rx_data.payload_idx--; - if (rx_data.payload_idx == 0) { - if (rx_data.mode != RX_ALL) { - zassert_equal(i + 1, len, "len:%d i:%d", len, i); - } - rx_data.state = RX_HDR; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); - } - } + zassert_equal(buf, rx_data.hdr); + zassert_equal(len, 1); + if (rx_data.hdr[0] == 1) { + /* single byte packet. */ + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); } + return true; } + + zassert_equal(rx_data.payload_idx, 0); + rx_data.on_rx_rdy = on_rx_rdy_payload; + rx_data.payload_idx = rx_data.hdr[0] - 1; + rx_data.state = RX_PAYLOAD; + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + size_t l = rx_data.hdr[0] - 1; + + zassert_true(l > 0); + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.buf, buf[0] - 1); + } + + return true; } static void on_rx_buf_req(const struct device *dev) @@ -385,7 +418,6 @@ static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *us return; } - zassert_true(len > 0); err = uart_rx_enable(dev, buf, len, data->timeout); zassert_equal(err, 0, "Unexpected err:%d", err); @@ -417,7 +449,11 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void break; case UART_RX_RDY: zassert_true(dev == rx_dev); - on_rx_rdy(dev, evt); + if (rx_data.cont) { + rx_data.on_rx_rdy(dev, &evt->data.rx.buf[evt->data.rx.offset], + evt->data.rx.len); + rx_data.rx_cnt += evt->data.rx.len; + } break; case UART_RX_BUF_RELEASED: zassert_true(dev == rx_dev); @@ -516,7 +552,7 @@ static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, tx_data.rx_timeout = rx_data.timeout; rx_data.cont = true; rx_data.rx_cnt = 0; - rx_data.state = RX_HDR; + rx_data.on_rx_rdy = rx_mode == RX_ALL ? on_rx_rdy_rx_all : on_rx_rdy_hdr; rx_data.mode = rx_mode; ring_buf_init(&tx_data.rbuf, sizeof(tx_data.buf), tx_data.buf); From f2141e4d869398da6aefdc7a7506c1e21ca79f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 15 Jul 2025 10:13:10 +0200 Subject: [PATCH 0008/3334] [nrf fromlist] drivers: serial: nrfx_uarte: Prepare code for extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rearrange code to prepare for upcoming extension that adds special receive mode. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit f06affcb6428e2ad68131531f42be2a786235d20) --- drivers/serial/uart_nrfx_uarte.c | 133 +++++++++++++++++-------------- 1 file changed, 72 insertions(+), 61 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index a5436eb0ec62..5196b21a082b 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -870,6 +870,78 @@ static void tx_start(const struct device *dev, const uint8_t *buf, size_t len) static void rx_timeout(struct k_timer *timer); static void tx_timeout(struct k_timer *timer); +static void user_callback(const struct device *dev, struct uart_event *evt) +{ + struct uarte_nrfx_data *data = dev->data; + + if (data->async->user_callback) { + data->async->user_callback(dev, evt, data->async->user_data); + } +} + +static void rx_buf_release(const struct device *dev, uint8_t *buf) +{ + struct uart_event evt = { + .type = UART_RX_BUF_RELEASED, + .data.rx_buf.buf = buf, + }; + + user_callback(dev, &evt); +} + +static void notify_rx_disable(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uart_event evt = { + .type = UART_RX_DISABLED, + }; + + if (LOW_POWER_ENABLED(cfg)) { + uint32_t key = irq_lock(); + + uarte_disable_locked(dev, UARTE_FLAG_LOW_POWER_RX); + irq_unlock(key); + } + + user_callback(dev, (struct uart_event *)&evt); + + /* runtime PM is put after the callback. In case uart is re-enabled from that + * callback we avoid suspending/resuming the device. + */ + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put_async(dev, K_NO_WAIT); + } +} + +static int uarte_nrfx_rx_disable(const struct device *dev) +{ + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + int key; + + if (async_rx->buf == NULL) { + return -EFAULT; + } + + k_timer_stop(&async_rx->timer); + + key = irq_lock(); + + if (async_rx->next_buf != NULL) { + nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + } + + async_rx->enabled = false; + async_rx->discard_fifo = true; + + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + irq_unlock(key); + + return 0; +} + #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -1068,15 +1140,6 @@ static int uarte_nrfx_tx_abort(const struct device *dev) return 0; } -static void user_callback(const struct device *dev, struct uart_event *evt) -{ - struct uarte_nrfx_data *data = dev->data; - - if (data->async->user_callback) { - data->async->user_callback(dev, evt, data->async->user_data); - } -} - static void notify_uart_rx_rdy(const struct device *dev, size_t len) { struct uarte_nrfx_data *data = dev->data; @@ -1090,29 +1153,6 @@ static void notify_uart_rx_rdy(const struct device *dev, size_t len) user_callback(dev, &evt); } -static void rx_buf_release(const struct device *dev, uint8_t *buf) -{ - struct uart_event evt = { - .type = UART_RX_BUF_RELEASED, - .data.rx_buf.buf = buf, - }; - - user_callback(dev, &evt); -} - -static void notify_rx_disable(const struct device *dev) -{ - struct uart_event evt = { - .type = UART_RX_DISABLED, - }; - - user_callback(dev, (struct uart_event *)&evt); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put_async(dev, K_NO_WAIT); - } -} - #ifdef UARTE_HAS_FRAME_TIMEOUT static uint32_t us_to_bauds(uint32_t baudrate, int32_t timeout) { @@ -1339,35 +1379,6 @@ static int uarte_nrfx_callback_set(const struct device *dev, return 0; } -static int uarte_nrfx_rx_disable(const struct device *dev) -{ - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - int key; - - if (async_rx->buf == NULL) { - return -EFAULT; - } - - k_timer_stop(&async_rx->timer); - - key = irq_lock(); - - if (async_rx->next_buf != NULL) { - nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - } - - async_rx->enabled = false; - async_rx->discard_fifo = true; - - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - irq_unlock(key); - - return 0; -} - static void tx_timeout(struct k_timer *timer) { const struct device *dev = k_timer_user_data_get(timer); From f94a2b57372be17b8dcefc8ad12ad12965241867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 30 Jun 2025 07:48:03 +0200 Subject: [PATCH 0009/3334] [nrf fromlist] drivers: serial: nrfx_uarte: Add mode with TIMER byte counting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add mode to be used on UARTE with frame timeout which is using a bounce buffers and TIMER to count bytes. This mode shall be used to reliably receive data without HWFC as frame timeout approach is not 100% reliable because it can loose or corrupt a byte when new byte arrives after frame timeout is detected but before it is fully handled. This mode is similar to the one enabled with CONFIG_UART_x_NRF_HW_ASYNC but additional bounce buffers are used and UARTE is receiving data to internal buffers and copies data to the user buffer. Legacy apporach cannot be used because in new SoC DMA attempts to copy data in words so when byte is received it stays in the DMA internal buffer until 4 bytes are received or end of transfer happens then internal DMA buffer is flushed. Upstream PR #: 92767 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 0ac3e720c4ba47d198b329997e4930dcd33e47e2) --- drivers/serial/Kconfig.nrfx | 26 + drivers/serial/Kconfig.nrfx_uart_instance | 7 + drivers/serial/uart_nrfx_uarte.c | 1026 +++++++++++++++++++-- 3 files changed, 971 insertions(+), 88 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 647e8cbb2e6f..a39f882f644a 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -79,6 +79,32 @@ config UART_ASYNC_TX_CACHE_SIZE in RAM, because EasyDMA in UARTE peripherals can only transfer data from RAM. +config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + bool "Use TIMER to count RX bytes" + depends on UART_ASYNC_API + depends on UART_NRFX_UARTE_LEGACY_SHIM + depends on !ARCH_POSIX # Mode not supported on BSIM target + select NRFX_GPPI + +config UART_NRFX_UARTE_BOUNCE_BUF_LEN + int "RX bounce buffer size" + depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + default 256 + range 64 1024 + help + Buffer is used when workaround with bounce buffers is applied + +config UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY + int "RX bounce buffer swap latency (in microseconds)" + depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + default 300 + help + Option decides how long before current bounce buffer is filled driver + attempts to swap the buffer. It must be long enough to ensure that + space following the buffer is not overwritten. Too high value results + in more frequent buffer swaps so it impacts performance. Setting should + take into account potential interrupt handling latency. + config UART_NRFX_UARTE_DIRECT_ISR bool "Use direct ISR" diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index b1a68d691c45..82ffaa10fcb9 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -18,6 +18,13 @@ config UART_$(nrfx_uart_num)_ASYNC help This option enables UART Asynchronous API support on port $(nrfx_uart_num). +config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER + bool + depends on $(dt_nodelabel_has_prop,uart$(nrfx_uart_num),timer) + depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) + default y + imply UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + config UART_$(nrfx_uart_num)_ENHANCED_POLL_OUT bool "Efficient poll out on port $(nrfx_uart_num)" depends on !$(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),endtx-stoptx-supported) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 5196b21a082b..00489e7d8856 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -188,6 +188,16 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); /* Size of hardware fifo in RX path. */ #define UARTE_HW_RX_FIFO_SIZE 5 +/* TIMER CC channels for counting bytes with TIMER. */ +/* Channel used for capturing current counter value. */ +#define UARTE_TIMER_CAPTURE_CH 0 +/* Channel used to get compare event when number of received bytes reaches user buffer size. */ +#define UARTE_TIMER_USR_CNT_CH 1 +/* Channel used to get compare event when bounce buffer need to be switched. */ +#define UARTE_TIMER_BUF_SWITCH_CH 2 +/* Magic byte that is used to fill the buffer. */ +#define UARTE_MAGIC_BYTE 0xAA + #ifdef UARTE_ANY_ASYNC struct uarte_async_tx { @@ -201,6 +211,30 @@ struct uarte_async_tx { bool pending; }; +/* Structure with data for Count Bytes With Timer receiver mode (cbwt). */ +struct uarte_async_rx_cbwt { + uint8_t *curr_bounce_buf; + uint8_t *anomaly_byte_addr; + uint32_t usr_rd_off; + uint32_t usr_wr_off; + uint32_t bounce_off; + uint32_t bounce_limit; + uint32_t last_cnt; + uint32_t cc_usr; + uint32_t cc_swap; +#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE + size_t bounce_buf_swap_len; +#endif +#ifdef UARTE_ANY_CACHE + uint8_t *anomaly_byte_dst; + uint8_t anomaly_byte; +#endif + uint8_t bounce_idx; + uint8_t ppi_ch; + bool in_irq; + bool discard_fifo; +}; + struct uarte_async_rx { struct k_timer timer; #ifdef CONFIG_HAS_NORDIC_DMM @@ -212,8 +246,9 @@ struct uarte_async_rx { size_t offset; uint8_t *next_buf; size_t next_buf_len; -#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX -#if !defined(UARTE_HAS_FRAME_TIMEOUT) +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) uint32_t idle_cnt; #endif k_timeout_t timeout; @@ -286,6 +321,10 @@ struct uarte_nrfx_data { #define UARTE_FLAG_POLL_OUT BIT(3) /* Flag indicating that a workaround for not working frame timeout is active. */ #define UARTE_FLAG_FTIMEOUT_WATCH BIT(4) +/* Flag indicating that UART_RX_BUF_REQUEST event need to be called from the interrupt context. */ +#define UARTE_FLAG_RX_BUF_REQ BIT(5) +/* Flag indicating that CC value in TIMER was set too late. */ +#define UARTE_FLAG_LATE_CC BIT(6) /* If enabled then ENDTX is PPI'ed to TXSTOP */ #define UARTE_CFG_FLAG_PPI_ENDTX BIT(0) @@ -304,6 +343,12 @@ struct uarte_nrfx_data { /* Indicates that workaround for spurious RXTO during restart shall be applied. */ #define UARTE_CFG_FLAG_SPURIOUS_RXTO BIT(3) +/* Indicates that UARTE/TIMER interrupt priority differs from system clock (GRTC/RTC). */ +#define UARTE_CFG_FLAG_VAR_IRQ BIT(4) + +/* Indicates that instance needs special handling of BAUDRATE register. */ +#define UARTE_CFG_FLAG_VOLATILE_BAUDRATE BIT(5) + /* Formula for getting the baudrate settings is following: * 2^12 * (2^20 / (f_PCLK / desired_baudrate)) where f_PCLK is a frequency that * drives the UARTE. @@ -340,6 +385,14 @@ struct uarte_nrfx_data { (baudrate) == 921600 ? NRF_UARTE_BAUDRATE_921600 : \ (baudrate) == 1000000 ? NRF_UARTE_BAUDRATE_1000000 : 0) +#define UARTE_MIN_BUF_SWAP_LEN 10 + +#define UARTE_US_TO_BYTES(baudrate) \ + DIV_ROUND_UP((CONFIG_UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY * baudrate), 10000000) + +#define UARTE_BUF_SWAP_LEN(bounce_buf_len, baudrate) \ + ((bounce_buf_len) - MAX(UARTE_MIN_BUF_SWAP_LEN, UARTE_US_TO_BYTES(baudrate))) + #define LOW_POWER_ENABLED(_config) \ (IS_ENABLED(UARTE_ANY_LOW_POWER) && \ !IS_ENABLED(CONFIG_PM_DEVICE) && \ @@ -386,6 +439,15 @@ struct uarte_nrfx_config { #endif /* CONFIG_UART_USE_RUNTIME_CONFIGURE */ #ifdef UARTE_ANY_ASYNC +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + NRF_TIMER_Type * timer_regs; + IRQn_Type timer_irqn; + IRQn_Type uarte_irqn; + uint8_t *bounce_buf[2]; + size_t bounce_buf_len; + size_t bounce_buf_swap_len; + struct uarte_async_rx_cbwt *cbwt_data; +#endif nrfx_timer_t timer; uint8_t *tx_cache; uint8_t *rx_flush_buf; @@ -405,6 +467,12 @@ struct uarte_nrfx_config { (IS_ENABLED(UARTE_ANY_HW_ASYNC) ? \ (config->flags & UARTE_CFG_FLAG_HW_BYTE_COUNTING) : false) +/* Determine if instance is using an approach with counting bytes with TIMER (cbwt). */ +#define IS_CBWT(dev) \ + COND_CODE_1(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ + ((((const struct uarte_nrfx_config *)dev->config)->cbwt_data != NULL)), \ + (false)) + static inline NRF_UARTE_Type *get_uarte_instance(const struct device *dev) { const struct uarte_nrfx_config *config = dev->config; @@ -596,10 +664,23 @@ static int baudrate_set(const struct device *dev, uint32_t baudrate) return -EINVAL; } +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + struct uarte_async_rx_cbwt *cbwt_data = config->cbwt_data; + + cbwt_data->bounce_buf_swap_len = UARTE_BUF_SWAP_LEN(config->bounce_buf_len, + baudrate); + } +#endif + #ifdef UARTE_BAUDRATE_RETENTION_WORKAROUND - struct uarte_nrfx_data *data = dev->data; + if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { + struct uarte_nrfx_data *data = dev->data; - data->nrf_baudrate = nrf_baudrate; + data->nrf_baudrate = nrf_baudrate; + } else { + nrf_uarte_baudrate_set(get_uarte_instance(dev), nrf_baudrate); + } #else nrf_uarte_baudrate_set(get_uarte_instance(dev), nrf_baudrate); #endif @@ -787,9 +868,11 @@ static void uarte_periph_enable(const struct device *dev) #endif #if UARTE_BAUDRATE_RETENTION_WORKAROUND - nrf_uarte_baudrate_set(uarte, - COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, - (data->nrf_baudrate), (config->nrf_baudrate))); + if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { + nrf_uarte_baudrate_set(uarte, + COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, + (data->nrf_baudrate), (config->nrf_baudrate))); + } #endif #ifdef UARTE_ANY_ASYNC @@ -889,13 +972,17 @@ static void rx_buf_release(const struct device *dev, uint8_t *buf) user_callback(dev, &evt); } -static void notify_rx_disable(const struct device *dev) +static void rx_disable_finalize(const struct device *dev) { const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; struct uart_event evt = { .type = UART_RX_DISABLED, }; + async_rx->enabled = false; + if (LOW_POWER_ENABLED(cfg)) { uint32_t key = irq_lock(); @@ -913,28 +1000,42 @@ static void notify_rx_disable(const struct device *dev) } } -static int uarte_nrfx_rx_disable(const struct device *dev) +static int rx_disable(const struct device *dev, bool api) { struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); int key; - if (async_rx->buf == NULL) { - return -EFAULT; - } - k_timer_stop(&async_rx->timer); key = irq_lock(); +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + if (cbwt_data) { + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_BUF_SWITCH_CH)); + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); + nrf_timer_int_disable(cfg->timer_regs, + nrf_timer_compare_int_get(UARTE_TIMER_BUF_SWITCH_CH) | + nrf_timer_compare_int_get(UARTE_TIMER_USR_CNT_CH)); + nrf_uarte_shorts_disable(cfg->uarte_regs, NRF_UARTE_SHORT_ENDRX_STARTRX); + } +#endif + if (async_rx->next_buf != NULL) { nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); } async_rx->enabled = false; - async_rx->discard_fifo = true; + if (api) { + async_rx->discard_fifo = true; + } nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); irq_unlock(key); @@ -942,6 +1043,18 @@ static int uarte_nrfx_rx_disable(const struct device *dev) return 0; } +static int uarte_nrfx_rx_disable(const struct device *dev) +{ + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + + if (async_rx->buf == NULL) { + return -EFAULT; + } + + return rx_disable(dev, true); +} + #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -966,10 +1079,10 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) if (ret != NRFX_SUCCESS) { LOG_ERR("Timer already initialized"); return -EINVAL; - } else { - nrfx_timer_clear(&cfg->timer); } + nrfx_timer_clear(&cfg->timer); + ret = nrfx_gppi_channel_alloc(&data->async->rx.cnt.ppi); if (ret != NRFX_SUCCESS) { LOG_ERR("Failed to allocate PPI Channel"); @@ -987,6 +1100,653 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) } #endif /* !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) */ +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + +static uint32_t get_byte_cnt(NRF_TIMER_Type *timer) +{ + nrf_timer_task_trigger(timer, nrf_timer_capture_task_get(UARTE_TIMER_CAPTURE_CH)); + + nrf_barrier_w(); + + return nrf_timer_cc_get(timer, UARTE_TIMER_CAPTURE_CH); +} + +static void rx_buf_req(const struct device *dev) +{ + struct uart_event evt = { + .type = UART_RX_BUF_REQUEST, + }; + + user_callback(dev, &evt); +} + +static bool notify_rx_rdy(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + size_t len = cbwt_data->usr_wr_off - cbwt_data->usr_rd_off; + + if (len == 0) { + return async_rx->buf != NULL; + } + + struct uart_event evt = { + .type = UART_RX_RDY, + .data.rx.buf = async_rx->buf, + .data.rx.len = len, + .data.rx.offset = cbwt_data->usr_rd_off + }; + user_callback(dev, &evt); + cbwt_data->usr_rd_off += len; + + if (cbwt_data->usr_rd_off == async_rx->buf_len) { + rx_buf_release(dev, async_rx->buf); + async_rx->buf = async_rx->next_buf; + async_rx->buf_len = async_rx->next_buf_len; + async_rx->next_buf_len = 0; + async_rx->next_buf = 0; + cbwt_data->usr_rd_off = 0; + cbwt_data->usr_wr_off = 0; + + if (async_rx->buf_len == 0) { + return false; + } + + /* Set past value to ensure that event will not expire after clearing but + * before setting the new value. + */ + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, cbwt_data->cc_usr - 1); + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); + cbwt_data->cc_usr += async_rx->buf_len; + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, cbwt_data->cc_usr); + + /* Check if CC is already in the past. In that case trigger CC handling.*/ + if (cbwt_data->cc_usr <= get_byte_cnt(cfg->timer_regs)) { + atomic_or(&data->flags, UARTE_FLAG_LATE_CC); + NRFX_IRQ_PENDING_SET(cfg->timer_irqn); + } else { + atomic_and(&data->flags, ~UARTE_FLAG_LATE_CC); + } + } + + return true; +} + +static void anomaly_byte_handle(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint8_t curr_byte, anomaly_byte; + uint32_t diff; + + if (cbwt_data->anomaly_byte_addr == NULL) { + return; + } + + diff = cfg->uarte_regs->DMA.RX.PTR - (uint32_t)cbwt_data->curr_bounce_buf; + /* Anomaly can be checked only if more than 1 byte is received to the current buffer. */ + if (diff < 2) { + return; + } + + if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + sys_cache_data_invd_range(cbwt_data->curr_bounce_buf, 1); + sys_cache_data_invd_range(cbwt_data->anomaly_byte_addr, 1); + } + + curr_byte = cbwt_data->curr_bounce_buf[0]; + anomaly_byte = *cbwt_data->anomaly_byte_addr; + if ((curr_byte == UARTE_MAGIC_BYTE) && (anomaly_byte != UARTE_MAGIC_BYTE)) { +#ifdef UARTE_ANY_CACHE + if (cfg->flags & UARTE_CFG_FLAG_CACHEABLE) { + /* We cannot write directly to curr_bounce_buf as it is written by + * DMA and with cache operations data may be overwritten. Copying + * need to be postponed to the moment when user buffer is filled. + */ + cbwt_data->anomaly_byte = anomaly_byte; + cbwt_data->anomaly_byte_dst = &cbwt_data->curr_bounce_buf[0]; + } else { + cbwt_data->curr_bounce_buf[0] = anomaly_byte; + } +#else + cbwt_data->curr_bounce_buf[0] = anomaly_byte; +#endif + } + + cbwt_data->anomaly_byte_addr = NULL; +} + +static uint32_t fill_usr_buf(const struct device *dev, uint32_t len) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + uint8_t *buf = cfg->bounce_buf[cbwt_data->bounce_idx]; + uint32_t usr_rem = async_rx->buf_len - cbwt_data->usr_wr_off; + uint32_t bounce_rem = cbwt_data->bounce_limit - cbwt_data->bounce_off; + uint32_t cpy_len = MIN(bounce_rem, MIN(usr_rem, len)); + + __ASSERT(cpy_len + cbwt_data->bounce_off <= cfg->bounce_buf_len, + "Exceeding the buffer cpy_len:%d off:%d limit:%d", + cpy_len, cbwt_data->bounce_off, cbwt_data->bounce_limit); + + if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + sys_cache_data_invd_range(&buf[cbwt_data->bounce_off], cpy_len); + } + + memcpy(&async_rx->buf[cbwt_data->usr_wr_off], &buf[cbwt_data->bounce_off], cpy_len); +#ifdef UARTE_ANY_CACHE + if ((buf == cbwt_data->anomaly_byte_dst) && (cbwt_data->bounce_off == 0)) { + async_rx->buf[cbwt_data->usr_wr_off] = cbwt_data->anomaly_byte; + cbwt_data->anomaly_byte_dst = NULL; + } +#endif + cbwt_data->bounce_off += cpy_len; + cbwt_data->usr_wr_off += cpy_len; + cbwt_data->last_cnt += cpy_len; + if (cbwt_data->bounce_off == cbwt_data->bounce_limit) { + /* Bounce buffer drained */ + cbwt_data->bounce_idx = cbwt_data->bounce_idx == 0 ? 1 : 0; + cbwt_data->bounce_off = 0; + cbwt_data->bounce_limit = cfg->bounce_buf_len; + } + + return cpy_len; +} + +static bool update_usr_buf(const struct device *dev, uint32_t len, bool notify_any, bool buf_req) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + anomaly_byte_handle(dev); + + do { + uint32_t cpy_len = len ? fill_usr_buf(dev, len) : 0; + bool usr_buf_full = cbwt_data->usr_wr_off == async_rx->buf_len; + + len -= cpy_len; + if (((len == 0) && notify_any) || usr_buf_full) { + if (!notify_rx_rdy(dev)) { + return false; + } + + if (usr_buf_full && buf_req) { + rx_buf_req(dev); + } + } + } while (len > 0); + + return true; +} + +static void prepare_bounce_buf(const struct device *dev, uint8_t *buf, + size_t swap_len, size_t len) +{ + const struct uarte_nrfx_config *cfg = dev->config; + + buf[0] = UARTE_MAGIC_BYTE; + for (size_t i = swap_len; i < len; i++) { + buf[i] = UARTE_MAGIC_BYTE; + } + + if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + sys_cache_data_flush_range(buf, 1); + sys_cache_data_flush_range(&buf[swap_len], len); + } +} + +/* This function is responsible for swapping the bounce buffer and it is the most + * tricky part of the solution. Receiver is continuously working and we want to + * change DMA pointer on the fly. DMA is also incrementing that pointer so there are + * moments in the reception when updating the pointer will result in different behavior. + * + * There are two main cases that need to be handled: + * 1. PTR is updated and there was no byte boundary (in the middle of a byte or there is + * no byte on the line). It is a safe spot. + * + * The most common and simplest case. PTR is update but since + * DMA already started the reception of the previous byte it means that next byte will + * be stored in the previous PTR and bytes following that byte will be stored to the + * new bounce buffer + * + * 2. Updating the pointer collided with byte boundary. + * + * RXDRDY and RXSTARTED events are used to detect if collision occurred. + * There are few scenarios that may happen and the driver must detect which one occurred. + * Detection is done by reading back the PTR register. Following cases are considered: + * + * - PTR did not change. It means that it was written after byte boundary. It is the same + * case as if PTR was updated in the safe spot. + * + * - PTR is updated by 1. There is an anomaly and it is unclear where next byte will be + * copied. PTR state indicates that it should be copied to the beginning of the new + * bounce buffer but it might be copied to the previous bounce buffer. Both locations + * are written with a magic byte (0xAA) and later on it is checked which location has + * changed and if byte was written to the previous bounce buffer it is copied to the + * start of the new bounce buffer. + * + * - PTR is not updated with the new bounce buffer location. DMA is incrementing PTR content + * and it is possible that SW writes new value between read and modify and DMA may + * overwrite value written by the driver. In that case reception continuous to the + * previous bounce buffer and swap procedure need to be repeated. + */ +static int bounce_buf_swap(const struct device *dev, uint8_t *prev_bounce_buf) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t prev_buf_cnt, new_cnt, cnt, ptr; + uint32_t prev_buf_inc = 1; + int key; + + key = irq_lock(); + /* Clear events that indicates byte boundary and set PTR. If events are set + * after PTR is set then we know that setting PTR collided with byte boundary. + */ + nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED); + nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); + cfg->uarte_regs->DMA.RX.PTR = (uint32_t)cbwt_data->curr_bounce_buf; + cnt = get_byte_cnt(cfg->timer_regs); + + if (!nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY) && + !nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED)) { + /* RXDRDY did not happen when PTR was set. Safest case. PTR was updated + * correctly. Last byte will be received to the previous buffer. + */ + new_cnt = 0; + prev_buf_cnt = cnt - cbwt_data->last_cnt; + goto no_collision; + } + + /* Setting PTR collided with byte boundary we need to detect what happened. */ + while (!nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED)) { + } + + /* Read pointer when there is no new byte coming. */ + do { + cnt = get_byte_cnt(cfg->timer_regs); + ptr = cfg->uarte_regs->DMA.RX.PTR; + } while (cnt != get_byte_cnt(cfg->timer_regs)); + + new_cnt = ptr - (uint32_t)cbwt_data->curr_bounce_buf; + prev_buf_cnt = cnt - cbwt_data->last_cnt; + + if (new_cnt == 0) { + /* New PTR is not incremented. It was written after LIST post ENDRX + * incrementation. + */ + } else if (new_cnt == 1) { + /* new_cnt == 1. New PTR incremented. It's possible that data is already + * copied to that new location or it is written to the tail of the previous + * bounce buffer. We try to detect what happens. + */ + prev_buf_inc = 0; + cbwt_data->anomaly_byte_addr = + &prev_bounce_buf[cbwt_data->bounce_off + prev_buf_cnt]; + } else if (new_cnt <= cfg->bounce_buf_len) { + prev_buf_inc = 0; + prev_buf_cnt = cnt - cbwt_data->last_cnt - (new_cnt - 1); + } else { + /* New PTR value is not set. Re-set PTR is needed. Transfer continues to + * previous buffer whole buffer swapping need to be repeat. + */ + irq_unlock(key); + return -EAGAIN; + } + +no_collision: + cbwt_data->bounce_limit = cbwt_data->bounce_off + prev_buf_cnt + prev_buf_inc; + __ASSERT(cbwt_data->bounce_limit < cfg->bounce_buf_len, + "Too high limit (%d, max:%d), increase latency", + cbwt_data->bounce_limit, cfg->bounce_buf_len); + irq_unlock(key); + + return prev_buf_cnt; +} + +static size_t get_swap_len(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; +#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + return cbwt_data->bounce_buf_swap_len; +#else + return cfg->bounce_buf_swap_len; +#endif +} + +static void bounce_buf_switch(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + int new_data = cbwt_data->cc_swap - cbwt_data->last_cnt; + uint8_t *prev_bounce_buf = cbwt_data->curr_bounce_buf; + int prev_cnt; + + /* Fill user buffer with all pending data. */ + if (!update_usr_buf(dev, new_data < 0 ? 0 : new_data, false, true)) { + rx_disable(dev, false); + return; + } + + cbwt_data->curr_bounce_buf = (cbwt_data->curr_bounce_buf == cfg->bounce_buf[0]) ? + cfg->bounce_buf[1] : cfg->bounce_buf[0]; + prepare_bounce_buf(dev, cbwt_data->curr_bounce_buf, get_swap_len(dev), + cfg->bounce_buf_len); + + /* Swapping may need retry. */ + while ((prev_cnt = bounce_buf_swap(dev, prev_bounce_buf)) < 0) { + } + + /* Update user buffer with data that was received during swapping. */ + if (update_usr_buf(dev, prev_cnt, false, true)) { + /* Set compare event for next moment when bounce buffers need to be swapped. */ + cbwt_data->cc_swap += get_swap_len(dev); + __ASSERT(cbwt_data->cc_swap > get_byte_cnt(cfg->timer_regs), + "Setting CC too late next:%d cnt:%d", + cbwt_data->cc_swap, get_byte_cnt(cfg->timer_regs)); + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH, cbwt_data->cc_swap); + } else { + /* Stop RX. */ + rx_disable(dev, false); + } +} + +static void usr_buf_complete(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t rem = async_rx->buf_len - cbwt_data->usr_wr_off; + + __ASSERT_NO_MSG(rem <= (get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt)); + + if (!update_usr_buf(dev, rem, true, true)) { + /* Stop RX if there is no next buffer. */ + rx_disable(dev, false); + } +} + +static void notify_new_data(const struct device *dev, bool buf_req) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t cnt = get_byte_cnt(cfg->timer_regs); + uint32_t new_data = cnt - cbwt_data->last_cnt; + + (void)update_usr_buf(dev, new_data, true, buf_req); +} + +static void cbwt_rx_timeout(struct k_timer *timer) +{ + const struct device *dev = k_timer_user_data_get(timer); + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + struct uarte_async_rx *async_rx = &data->async->rx; + + if (nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY)) { + nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); + async_rx->idle_cnt = 0; + } else { + async_rx->idle_cnt++; + if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { + if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { + if (cbwt_data->in_irq) { + /* TIMER or UARTE interrupt preempted. Lets try again + * later. + */ + k_timer_start(timer, async_rx->timeout, K_NO_WAIT); + return; + } + irq_disable(cfg->uarte_irqn); + irq_disable(cfg->timer_irqn); + } + + nrf_uarte_int_enable(cfg->uarte_regs, NRF_UARTE_INT_RXDRDY_MASK); + notify_new_data(dev, true); + + if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { + irq_enable(cfg->uarte_irqn); + irq_enable(cfg->timer_irqn); + } + return; + } + } + + k_timer_start(timer, async_rx->timeout, K_NO_WAIT); +} + +static void cbwt_rx_flush_handle(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t rem_data = get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt; + uint32_t bbuf_rem_data = cbwt_data->bounce_limit - cbwt_data->bounce_off; + uint32_t amount; + uint8_t *dst; + + nrf_uarte_rx_buffer_set(uarte, cfg->rx_flush_buf, UARTE_HW_RX_FIFO_SIZE); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_FLUSHRX); + while (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) { + /* empty */ + } + + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); + if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED)) { + /* FIFO is empty. */ + return; + } + + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + amount = nrf_uarte_rx_amount_get(uarte); + + if (rem_data <= bbuf_rem_data) { + /* instead of -1 it should be -amount but RXDRDY event is not generated + * for bytes following first that goes to FIFO they are generated during flushing. + */ + dst = &cfg->bounce_buf[cbwt_data->bounce_idx][cbwt_data->bounce_off + rem_data - 1]; + } else { + /* See comment in if clause. */ + dst = &cbwt_data->curr_bounce_buf[rem_data - bbuf_rem_data - 1]; + } + + if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + sys_cache_data_invd_range(cfg->rx_flush_buf, amount); + sys_cache_data_invd_range(dst, amount); + } + + memcpy(dst, cfg->rx_flush_buf, amount); +} + +static void cbwt_rxto_isr(const struct device *dev, bool do_flush) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + + if (async_rx->buf) { + notify_new_data(dev, false); + } + + if (async_rx->buf) { + rx_buf_release(dev, async_rx->buf); + async_rx->buf = NULL; + } + + if (async_rx->next_buf) { + rx_buf_release(dev, async_rx->next_buf); + async_rx->next_buf = NULL; + } + + if (do_flush) { + cbwt_rx_flush_handle(dev); + } + + if (async_rx->discard_fifo) { + cbwt_data->discard_fifo = async_rx->discard_fifo; + async_rx->discard_fifo = false; + } + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_STOP); + rx_disable_finalize(dev); +} + +static bool timer_ch_evt_check_clear(NRF_TIMER_Type *timer, uint32_t ch) +{ + nrf_timer_event_t evt = nrf_timer_compare_event_get(ch); + + if (nrf_timer_event_check(timer, evt)) { + nrf_timer_event_clear(timer, evt); + return true; + } + + return false; +} + +static void timer_isr(const void *arg) +{ + const struct device *dev = arg; + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + static const uint32_t flags_to_check = UARTE_FLAG_RX_BUF_REQ | + UARTE_FLAG_TRIG_RXTO | + UARTE_FLAG_LATE_CC; + uint32_t flags = atomic_and(&data->flags, ~flags_to_check); + + cbwt_data->in_irq = true; + + if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH) || + (flags & UARTE_FLAG_LATE_CC)) { + usr_buf_complete(dev); + } + + /* Must be after user buf complet CC handling. */ + if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH)) { + bounce_buf_switch(dev); + } + + if (flags & UARTE_FLAG_RX_BUF_REQ) { + rx_buf_req(dev); + } + + if (flags & UARTE_FLAG_TRIG_RXTO) { + cbwt_rxto_isr(dev, false); + } + + cbwt_data->in_irq = false; +} + +static void cbwt_rx_enable(const struct device *dev, bool with_timeout) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + uint32_t rem_data; + uint32_t len = async_rx->buf_len; + uint32_t rx_int_mask = NRF_UARTE_INT_RXTO_MASK | + (with_timeout ? NRF_UARTE_INT_RXDRDY_MASK : 0); + + if (cbwt_data->discard_fifo) { + rem_data = 0; + cbwt_data->discard_fifo = false; + } else { + rem_data = get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt; + } + + cbwt_data->usr_rd_off = 0; + cbwt_data->usr_wr_off = 0; + + if (rem_data >= len) { + atomic_or(&data->flags, UARTE_FLAG_TRIG_RXTO); + NRFX_IRQ_PENDING_SET(cfg->timer_irqn); + return; + } else if (rem_data) { + (void)update_usr_buf(dev, rem_data, false, true); + len -= rem_data; + } + + prepare_bounce_buf(dev, cfg->bounce_buf[0], get_swap_len(dev), cfg->bounce_buf_len); + + cbwt_data->last_cnt = 0; + cbwt_data->bounce_off = 0; + cbwt_data->bounce_idx = 0; + cbwt_data->curr_bounce_buf = cfg->bounce_buf[0]; + cbwt_data->bounce_limit = cfg->bounce_buf_len; + /* Enable ArrayList. */ + nrf_uarte_shorts_enable(cfg->uarte_regs, NRF_UARTE_SHORT_ENDRX_STARTRX); + nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); + nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); + nrf_uarte_rx_buffer_set(cfg->uarte_regs, cbwt_data->curr_bounce_buf, 1); + + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_BUF_SWITCH_CH)); + nrf_timer_event_clear(cfg->timer_regs, + nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); + nrf_timer_int_enable(cfg->timer_regs, + nrf_timer_compare_int_get(UARTE_TIMER_BUF_SWITCH_CH) | + nrf_timer_compare_int_get(UARTE_TIMER_USR_CNT_CH)); + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_CLEAR); + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_START); + cbwt_data->cc_usr = len; + cbwt_data->cc_swap = get_swap_len(dev); + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH, get_swap_len(dev)); + nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, len); + + atomic_or(&data->flags, UARTE_FLAG_RX_BUF_REQ); + nrf_uarte_task_trigger(cfg->uarte_regs, NRF_UARTE_TASK_STARTRX); + NRFX_IRQ_PENDING_SET(cfg->timer_irqn); +} + +static int cbwt_uarte_async_init(const struct device *dev) +{ + /* As this approach does not use nrfx_timer driver but only HAL special setup + * function is used. + */ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + static const uint32_t rx_int_mask = NRF_UARTE_INT_ERROR_MASK | + NRF_UARTE_INT_RXTO_MASK; + uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); + uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT); + nrfx_err_t ret; + + nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER); + nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32); + + ret = nrfx_gppi_channel_alloc(&cbwt_data->ppi_ch); + if (ret != NRFX_SUCCESS) { + return -ENOMEM; + } + + nrfx_gppi_channel_endpoints_setup(cbwt_data->ppi_ch, evt, tsk); + nrfx_gppi_channels_enable(BIT(cbwt_data->ppi_ch)); + +#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE + cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; +#endif + + /* Enable EasyDMA LIST feature (it is exposed in SPIM but not in UARTE). */ + *(volatile uint32_t *)((uint32_t)cfg->uarte_regs + 0x714) = 1; + nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); + + return 0; +} +#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER */ + static int uarte_async_init(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; @@ -999,6 +1759,17 @@ static int uarte_async_init(const struct device *dev) ((IS_ENABLED(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && !IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) ? NRF_UARTE_INT_RXDRDY_MASK : 0); + k_timer_init(&data->async->rx.timer, rx_timeout, NULL); + k_timer_user_data_set(&data->async->rx.timer, (void *)dev); + k_timer_init(&data->async->tx.timer, tx_timeout, NULL); + k_timer_user_data_set(&data->async->tx.timer, (void *)dev); + +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + return cbwt_uarte_async_init(dev); + } +#endif + #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) int ret = uarte_nrfx_rx_counting_init(dev); @@ -1009,11 +1780,6 @@ static int uarte_async_init(const struct device *dev) nrf_uarte_int_enable(uarte, rx_int_mask); - k_timer_init(&data->async->rx.timer, rx_timeout, NULL); - k_timer_user_data_set(&data->async->rx.timer, (void *)dev); - k_timer_init(&data->async->tx.timer, tx_timeout, NULL); - k_timer_user_data_set(&data->async->tx.timer, (void *)dev); - return 0; } @@ -1162,6 +1928,7 @@ static uint32_t us_to_bauds(uint32_t baudrate, int32_t timeout) } #endif + static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, size_t len, int32_t timeout) @@ -1171,6 +1938,11 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, const struct uarte_nrfx_config *cfg = dev->config; NRF_UARTE_Type *uarte = get_uarte_instance(dev); +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + bool with_timeout = timeout != SYS_FOREVER_US; +#endif + if (cfg->disable_rx) { __ASSERT(false, "TX only UARTE instance"); return -ENOTSUP; @@ -1185,35 +1957,45 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } #ifdef CONFIG_HAS_NORDIC_DMM - uint8_t *dma_buf; - int ret = 0; + if (!IS_CBWT(dev)) { + void *dma_buf; + int ret = 0; - ret = dmm_buffer_in_prepare(cfg->mem_reg, buf, len, (void **)&dma_buf); - if (ret < 0) { - return ret; - } + ret = dmm_buffer_in_prepare(cfg->mem_reg, buf, len, &dma_buf); + if (ret < 0) { + return ret; + } - async_rx->usr_buf = buf; - buf = dma_buf; + async_rx->usr_buf = buf; + buf = dma_buf; + } #endif -#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + #ifdef UARTE_HAS_FRAME_TIMEOUT - if (timeout != SYS_FOREVER_US) { + if (!IS_CBWT(dev) && with_timeout) { uint32_t baudrate = COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, - (data->uart_config.baudrate), (cfg->baudrate)); - - async_rx->timeout = K_USEC(timeout); + (data->uart_config.baudrate), (cfg->baudrate)); nrf_uarte_frame_timeout_set(uarte, us_to_bauds(baudrate, timeout)); nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_FRAME_TIMEOUT_STOPRX); + } +#endif +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + async_rx->idle_cnt = 0; +#endif + + if (with_timeout) { + if (!IS_CBWT(dev) && IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) { + async_rx->timeout = K_USEC(timeout); + } else { + async_rx->timeout = with_timeout ? + K_USEC(timeout / RX_TIMEOUT_DIV) : K_NO_WAIT; + } } else { async_rx->timeout = K_NO_WAIT; } -#else - async_rx->timeout = (timeout == SYS_FOREVER_US) ? - K_NO_WAIT : K_USEC(timeout / RX_TIMEOUT_DIV); - async_rx->idle_cnt = 0; -#endif /* UARTE_HAS_FRAME_TIMEOUT */ #else async_rx->timeout_us = timeout; async_rx->timeout_slab = timeout / RX_TIMEOUT_DIV; @@ -1241,8 +2023,20 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } } pm_device_runtime_get(dev); + } else if (LOW_POWER_ENABLED(cfg)) { + unsigned int key = irq_lock(); + + uarte_enable_locked(dev, UARTE_FLAG_LOW_POWER_RX); + irq_unlock(key); } +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + cbwt_rx_enable(dev, with_timeout); + return 0; + } +#endif + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) || LOW_POWER_ENABLED(cfg)) { if (async_rx->flush_cnt) { int cpy_len = MIN(len, async_rx->flush_cnt); @@ -1279,7 +2073,7 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, return 0; } else { #ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX - if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { + if (with_timeout) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); @@ -1304,13 +2098,6 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, async_rx->enabled = true; - if (LOW_POWER_ENABLED(cfg)) { - unsigned int key = irq_lock(); - - uarte_enable_locked(dev, UARTE_FLAG_LOW_POWER_RX); - irq_unlock(key); - } - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); return 0; @@ -1329,29 +2116,33 @@ static int uarte_nrfx_rx_buf_rsp(const struct device *dev, uint8_t *buf, err = -EACCES; } else if (async_rx->next_buf == NULL) { #ifdef CONFIG_HAS_NORDIC_DMM - uint8_t *dma_buf; - const struct uarte_nrfx_config *config = dev->config; + if (!IS_CBWT(dev)) { + uint8_t *dma_buf; + const struct uarte_nrfx_config *config = dev->config; - err = dmm_buffer_in_prepare(config->mem_reg, buf, len, (void **)&dma_buf); - if (err < 0) { - return err; + err = dmm_buffer_in_prepare(config->mem_reg, buf, len, (void **)&dma_buf); + if (err < 0) { + return err; + } + async_rx->next_usr_buf = buf; + buf = dma_buf; } - async_rx->next_usr_buf = buf; - buf = dma_buf; #endif async_rx->next_buf = buf; async_rx->next_buf_len = len; - nrf_uarte_rx_buffer_set(uarte, buf, len); - /* If buffer is shorter than RX FIFO then there is a risk that due - * to interrupt handling latency ENDRX event is not handled on time - * and due to ENDRX_STARTRX short data will start to be overwritten. - * In that case short is not enabled and ENDRX event handler will - * manually start RX for that buffer. Thanks to RX FIFO there is - * 5 byte time for doing that. If interrupt latency is higher and - * there is no HWFC in both cases data will be lost or corrupted. - */ - if (len >= UARTE_HW_RX_FIFO_SIZE) { - nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + if (!IS_CBWT(dev)) { + nrf_uarte_rx_buffer_set(uarte, buf, len); + /* If buffer is shorter than RX FIFO then there is a risk that due + * to interrupt handling latency ENDRX event is not handled on time + * and due to ENDRX_STARTRX short data will start to be overwritten. + * In that case short is not enabled and ENDRX event handler will + * manually start RX for that buffer. Thanks to RX FIFO there is + * 5 byte time for doing that. If interrupt latency is higher and + * there is no HWFC in both cases data will be lost or corrupted. + */ + if (len >= UARTE_HW_RX_FIFO_SIZE) { + nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + } } err = 0; } else { @@ -1401,6 +2192,13 @@ static void rx_timeout(struct k_timer *timer) NRF_UARTE_Type *uarte = get_uarte_instance(dev); #ifdef UARTE_HAS_FRAME_TIMEOUT +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + cbwt_rx_timeout(timer); + return; + } +#endif + struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; bool rxdrdy = nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY); @@ -1547,7 +2345,7 @@ static void error_isr(const struct device *dev) nrf_uarte_errorsrc_clear(uarte, err); user_callback(dev, &evt); - (void) uarte_nrfx_rx_disable(dev); + (void)rx_disable(dev, false); } static void rxstarted_isr(const struct device *dev) @@ -1766,7 +2564,6 @@ static void rxto_isr(const struct device *dev) * In the second case, additionally, data from the UARTE internal RX * FIFO need to be discarded. */ - async_rx->enabled = false; if (async_rx->discard_fifo) { async_rx->discard_fifo = false; #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) @@ -1794,15 +2591,7 @@ static void rxto_isr(const struct device *dev) #endif nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); #endif - - if (LOW_POWER_ENABLED(config)) { - uint32_t key = irq_lock(); - - uarte_disable_locked(dev, UARTE_FLAG_LOW_POWER_RX); - irq_unlock(key); - } - - notify_rx_disable(dev); + rx_disable_finalize(dev); } static void txstopped_isr(const struct device *dev) @@ -1892,10 +2681,12 @@ static void txstopped_isr(const struct device *dev) static void rxdrdy_isr(const struct device *dev) { -#if !defined(UARTE_HAS_FRAME_TIMEOUT) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) struct uarte_nrfx_data *data = dev->data; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + NRF_UARTE_Type *uarte = get_uarte_instance(dev); data->async->rx.idle_cnt = 0; @@ -1927,8 +2718,9 @@ static void uarte_nrfx_isr_async(const void *arg) struct uarte_async_rx *async_rx = &data->async->rx; uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); - if (!(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) - && event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { + if ((IS_CBWT(dev) || + !(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT))) && + event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { rxdrdy_isr(dev); } @@ -1956,6 +2748,12 @@ static void uarte_nrfx_isr_async(const void *arg) rxstarted_isr(dev); } +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev) && + event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask)) { + cbwt_rxto_isr(dev, true); + } else +#endif /* RXTO must be handled after ENDRX which should notify the buffer. * Skip if ENDRX is set when RXTO is set. It means that * ENDRX occurred after check for ENDRX in isr which may happen when @@ -1980,7 +2778,8 @@ static void uarte_nrfx_isr_async(const void *arg) txstopped_isr(dev); } - if (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO) { + if (!IS_CBWT(dev) && + (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO)) { #ifdef CONFIG_HAS_NORDIC_DMM int ret; @@ -1995,7 +2794,7 @@ static void uarte_nrfx_isr_async(const void *arg) rx_buf_release(dev, async_rx->buf); async_rx->buf_len = 0; async_rx->buf = NULL; - notify_rx_disable(dev); + rx_disable_finalize(dev); } } @@ -2609,6 +3408,44 @@ static int uarte_instance_deinit(const struct device *dev) return pm_device_driver_deinit(dev, uarte_nrfx_pm_action); } +#define UARTE_TIMER_REG(idx) (NRF_TIMER_Type *)DT_REG_ADDR(DT_PHANDLE(UARTE(idx), timer)) + +#define UARTE_TIMER_IRQN(idx) DT_IRQN(DT_PHANDLE(UARTE(idx), timer)) + +#define UARTE_TIMER_IRQ_PRIO(idx) DT_IRQ(DT_PHANDLE(UARTE(idx), timer), priority) + +#define UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx) \ + IF_ENABLED(UARTE_HAS_PROP(idx, timer), \ + (.timer_regs = UARTE_TIMER_REG(idx), \ + .timer_irqn = UARTE_TIMER_IRQN(idx), \ + .uarte_irqn = DT_IRQN(UARTE(idx)), \ + .bounce_buf = { \ + uart##idx##_bounce_buf, \ + &uart##idx##_bounce_buf[sizeof(uart##idx##_bounce_buf) / 2] \ + }, \ + .bounce_buf_len = sizeof(uart##idx##_bounce_buf) / 2, \ + .bounce_buf_swap_len = UARTE_BUF_SWAP_LEN(sizeof(uart##idx##_bounce_buf) / 2,\ + UARTE_US_TO_BYTES(UARTE_PROP(idx, current_speed))), \ + .cbwt_data = &uart##idx##_bounce_data,)) + +#define UARTE_COUNT_BYTES_WITH_TIMER_VALIDATE_CONFIG(idx) \ + __ASSERT_NO_MSG(UARTE_TIMER_IRQ_PRIO(idx) == DT_IRQ(UARTE(idx), priority)) + +#define UARTE_TIMER_IRQ_CONNECT(idx, func) \ + IF_ENABLED(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ + UARTE_HAS_PROP(idx, timer)), \ + (UARTE_COUNT_BYTES_WITH_TIMER_VALIDATE_CONFIG(idx); \ + IRQ_CONNECT(UARTE_TIMER_IRQN(idx), UARTE_TIMER_IRQ_PRIO(idx), func, \ + DEVICE_DT_GET(UARTE(idx)), 0); \ + irq_enable(UARTE_TIMER_IRQN(idx));)) + +/* Macro sets flag to indicate that uart use different interrupt priority than the system clock. */ +#define UARTE_HAS_VAR_PRIO(idx) \ + COND_CODE_1(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ + UARTE_HAS_PROP(idx, timer)), \ + ((DT_IRQ(UARTE(idx), priority) != DT_IRQ(DT_NODELABEL(grtc), priority)) ? \ + UARTE_CFG_FLAG_VAR_IRQ : 0), (0)) + #define UARTE_GET_ISR(idx) \ COND_CODE_1(CONFIG_UART_##idx##_ASYNC, (uarte_nrfx_isr_async), (uarte_nrfx_isr_int)) @@ -2624,16 +3461,18 @@ static int uarte_instance_deinit(const struct device *dev) )) /* Depending on configuration standard or direct IRQ is connected. */ -#define UARTE_IRQ_CONNECT(idx, irqn, prio) \ - COND_CODE_1(CONFIG_UART_NRFX_UARTE_NO_IRQ, (), \ - (COND_CODE_1(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, \ - (IRQ_DIRECT_CONNECT(irqn, prio, uarte_##idx##_direct_isr, 0)), \ - (IRQ_CONNECT(irqn, prio, UARTE_GET_ISR(idx), DEVICE_DT_GET(UARTE(idx)), 0))))) +#define UARTE_IRQ_CONNECT(idx, irqn, prio) \ + COND_CODE_1(CONFIG_UART_NRFX_UARTE_NO_IRQ, (), \ + (COND_CODE_1(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, \ + (IRQ_DIRECT_CONNECT(irqn, prio, uarte_##idx##_direct_isr, 0)), \ + (IRQ_CONNECT(irqn, prio, UARTE_GET_ISR(idx), \ + DEVICE_DT_GET(UARTE(idx)), 0))))) #define UARTE_IRQ_CONFIGURE(idx) \ do { \ UARTE_IRQ_CONNECT(idx, DT_IRQN(UARTE(idx)), DT_IRQ(UARTE(idx), priority)); \ irq_enable(DT_IRQN(UARTE(idx))); \ + UARTE_TIMER_IRQ_CONNECT(idx, timer_isr) \ } while (false) /* Low power mode is used when disable_rx is not defined or in async mode if @@ -2740,6 +3579,12 @@ static int uarte_instance_deinit(const struct device *dev) UARTE_INT_DRIVEN(idx); \ PINCTRL_DT_DEFINE(UARTE(idx)); \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, ( \ + IF_ENABLED(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ + UARTE_HAS_PROP(idx, timer)), \ + (static uint8_t uart##idx##_bounce_buf[CONFIG_UART_NRFX_UARTE_BOUNCE_BUF_LEN] \ + DMM_MEMORY_SECTION(UARTE(idx)); \ + static struct uarte_async_rx_cbwt uart##idx##_bounce_data; \ + )) \ static uint8_t \ uarte##idx##_tx_cache[CONFIG_UART_ASYNC_TX_CACHE_SIZE] \ DMM_MEMORY_SECTION(UARTE(idx)); \ @@ -2781,6 +3626,10 @@ static int uarte_instance_deinit(const struct device *dev) (IS_ENABLED(CONFIG_UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND) && \ INSTANCE_IS_HIGH_SPEED(_, /*empty*/, idx, _) ? \ UARTE_CFG_FLAG_SPURIOUS_RXTO : 0) | \ + ((IS_ENABLED(UARTE_BAUDRATE_RETENTION_WORKAROUND) && \ + UARTE_IS_CACHEABLE(idx)) ? \ + UARTE_CFG_FLAG_VOLATILE_BAUDRATE : 0) | \ + UARTE_HAS_VAR_PRIO(idx) | \ USE_LOW_POWER(idx), \ UARTE_DISABLE_RX_INIT(UARTE(idx)), \ .poll_out_byte = &uarte##idx##_poll_out_byte, \ @@ -2788,6 +3637,8 @@ static int uarte_instance_deinit(const struct device *dev) IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ (.tx_cache = uarte##idx##_tx_cache, \ .rx_flush_buf = uarte##idx##_flush_buf,)) \ + IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ + (UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx))) \ IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ (.timer = NRFX_TIMER_INSTANCE( \ CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ @@ -2840,5 +3691,4 @@ static int uarte_instance_deinit(const struct device *dev) #define COND_UART_NRF_UARTE_DEVICE(unused, prefix, i, _) \ IF_ENABLED(CONFIG_HAS_HW_NRF_UARTE##prefix##i, (UART_NRF_UARTE_DEVICE(prefix##i);)) - UARTE_FOR_EACH_INSTANCE(COND_UART_NRF_UARTE_DEVICE, (), ()) From 5581970d59246579056e3f927e05ea5152da04fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Thu, 31 Jul 2025 13:09:12 +0200 Subject: [PATCH 0010/3334] [nrf fromlist] tests: boards: nrf: qdec: Fix test for multiple instances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed pin configuration for nRF54L15 (QDECs can use only port 1) - Changed the way the test handles testing multiple instances to make it possible to output quadrature signal to one QDEC instance at a time. Upstream PR #: 93927 Signed-off-by: Michał Bainczyk (cherry picked from commit 21eab19151e895ac1cf376f2e1e3bd6ee143ef0d) --- .../boards/bl54l15_dvk_nrf54l15_common.dtsi | 14 +- .../boards/bl54l15u_dvk_nrf54l15_common.dtsi | 14 +- .../qdec/boards/nrf52840dk_nrf52840.overlay | 8 + .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 14 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 25 +- .../boards/nrf54l15dk_nrf54l15_common.dtsi | 45 +-- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 14 +- .../qdec/dts/bindings/test-qdec-loopback.yaml | 20 ++ tests/boards/nrf/qdec/src/main.c | 313 ++++++++---------- 9 files changed, 238 insertions(+), 229 deletions(-) create mode 100644 tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml diff --git a/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi index 4db67a49a5e0..19ca5e83647f 100644 --- a/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi @@ -5,12 +5,6 @@ */ / { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - encoder-emulate { compatible = "gpio-leds"; @@ -22,6 +16,14 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi index 4db67a49a5e0..19ca5e83647f 100644 --- a/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi @@ -5,12 +5,6 @@ */ / { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - encoder-emulate { compatible = "gpio-leds"; @@ -22,6 +16,14 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay index 9ee3749b4ff8..0c098f238bd0 100644 --- a/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay @@ -21,6 +21,14 @@ gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec0>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay index 22f5307a760a..04872e1de5c7 100644 --- a/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,12 +4,6 @@ */ / { - aliases { - qdec0 = &qdec1; - qenca = &phase_a; - qencb = &phase_b; - }; - encoder-emulate { compatible = "gpio-leds"; phase_a: phase_a { @@ -21,6 +15,14 @@ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec1>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 78f3aa09ace4..7e43c70dac0f 100644 --- a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -11,21 +11,12 @@ */ / { - aliases { - qdec0 = &qdec130; - qdec1 = &qdec131; - qenca = &phase_a; - qencb = &phase_b; - qenca1 = &phase_a1; - qencb1 = &phase_b1; - }; - encoder-emulate { compatible = "gpio-leds"; - phase_a: phase_a { + phase_a0: phase_a0 { gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; }; - phase_b: phase_b { + phase_b0: phase_b0 { gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; }; phase_a1: phase_a1 { @@ -35,6 +26,18 @@ gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec130>; + qenc-emul-gpios = <&phase_a0 &phase_b0>; + }; + loopback1 { + qdec = <&qdec131>; + qenc-emul-gpios = <&phase_a1 &phase_b1>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi index 06a490d1da08..f27294146527 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi @@ -4,35 +4,38 @@ */ /* Required loopbacks - * P1.8 <-> P1.9 - * P1.10 >-> P1.11 - * P2.8 <-> P2.9 - * P2.10 <-> P1.14 + * P1.8 <-> P1.9 + * P1.10 <-> P1.11 + * P1.12 <-> P1.13 + * P1.14 <-> P2.10 */ / { - aliases { - qdec0 = &qdec20; - qdec1 = &qdec21; - qenca = &phase_a; - qencb = &phase_b; - qenca1 = &phase_a1; - qencb1 = &phase_b1; - }; - encoder-emulate { compatible = "gpio-leds"; - phase_a: phase_a { + phase_a0: phase_a0 { gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; - phase_b: phase_b { + phase_b0: phase_b0 { gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; phase_a1: phase_a1 { - gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; }; phase_b1: phase_b1 { - gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; + }; + }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a0 &phase_b0>; + }; + loopback1 { + qdec = <&qdec21>; + qenc-emul-gpios = <&phase_a1 &phase_b1>; }; }; }; @@ -55,15 +58,15 @@ qdec_21_pinctrl: qdec_21_pinctrl { group1 { - psels = , - ; + psels = , + ; }; }; qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; diff --git a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi index 84e7b1dbc30f..6f8f3a184312 100644 --- a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -11,12 +11,6 @@ */ / { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - encoder-emulate { compatible = "gpio-leds"; phase_a: phase_a { @@ -26,6 +20,14 @@ gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; }; }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a &phase_b>; + }; + }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml b/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml new file mode 100644 index 000000000000..e03b2ff3bc32 --- /dev/null +++ b/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml @@ -0,0 +1,20 @@ +description: | + Binding describing loopbacks required to run tests/boards/nrf/qdec test in Zephyr. + +compatible: "test-qdec-loopbacks" + +child-binding: + description: | + Binding describing a single loopback pair consisting of a QDEC device and two "gpio-leds" pins + working as a quadrature encoder for the test. + properties: + qdec: + type: phandle + required: true + description: Node of the QDEC device used to capture quadrature signal in the loopback. + qenc-emul-gpios: + type: phandles + required: true + description: | + Children nodes of "gpio-leds" compatible used to generate quadrature signal. The first + phandles outputs phase A signal, the second one outputs phase B signal. diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 7df97be2a432..9d138d325fb5 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -11,27 +11,40 @@ #include #include -static K_SEM_DEFINE(sem, 0, 1); -static const struct gpio_dt_spec phase_a = GPIO_DT_SPEC_GET(DT_ALIAS(qenca), gpios); -static const struct gpio_dt_spec phase_b = GPIO_DT_SPEC_GET(DT_ALIAS(qencb), gpios); -static const struct device *const qdec_dev = DEVICE_DT_GET(DT_ALIAS(qdec0)); -static const uint32_t qdec_config_step = DT_PROP(DT_ALIAS(qdec0), steps); - -/* Disable testing second QDEC instance - * until the issue with multiple - * QDEC instances support is resolved +/** + * Structure grouping gpio pins used for QENC emulation connected with a QDEC device + * with a loopback. */ -#if DT_NODE_EXISTS(DT_ALIAS(qdecX)) -#define SECOND_QDEC_INSTANCE - -static const struct gpio_dt_spec phase_a1 = GPIO_DT_SPEC_GET(DT_ALIAS(qenca1), gpios); -static const struct gpio_dt_spec phase_b1 = GPIO_DT_SPEC_GET(DT_ALIAS(qencb1), gpios); -static const struct device *const qdec_1_dev = DEVICE_DT_GET(DT_ALIAS(qdec1)); -static const uint32_t qdec_1_config_step = DT_PROP(DT_ALIAS(qdec1), steps); -#endif +struct qdec_qenc_loopback { + struct gpio_dt_spec qenc_phase_a; + struct gpio_dt_spec qenc_phase_b; + + const struct device *qdec; + uint32_t qdec_config_step; +}; + +static K_SEM_DEFINE(sem, 0, 1); + +#define GET_QDEC_QENC_LOOPBACK(x) \ + { \ + .qenc_phase_a = GPIO_DT_SPEC_GET(DT_PHANDLE_BY_IDX(x, qenc_emul_gpios, 0), gpios), \ + .qenc_phase_b = GPIO_DT_SPEC_GET(DT_PHANDLE_BY_IDX(x, qenc_emul_gpios, 1), gpios), \ + .qdec = DEVICE_DT_GET(DT_PHANDLE(x, qdec)), \ + .qdec_config_step = DT_PROP_BY_PHANDLE(x, qdec, steps) \ + } + + +struct qdec_qenc_loopback loopbacks[] = { + DT_FOREACH_CHILD_SEP(DT_NODELABEL(qdec_loopbacks), GET_QDEC_QENC_LOOPBACK, (,)) +}; + +#define TESTED_QDEC_COUNT ARRAY_SIZE(loopbacks) + static struct sensor_trigger qdec_trigger = {.type = SENSOR_TRIG_DATA_READY, .chan = SENSOR_CHAN_ROTATION}; + static bool toggle_a = true; +static struct qdec_qenc_loopback *loopback_currently_under_test; static void qdec_trigger_handler(const struct device *dev, const struct sensor_trigger *trigger) { @@ -48,15 +61,9 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t static void qenc_emulate_work_handler(struct k_work *work) { if (toggle_a) { - gpio_pin_toggle_dt(&phase_a); -#if defined(SECOND_QDEC_INSTANCE) - gpio_pin_toggle_dt(&phase_a1); -#endif + gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_a); } else { - gpio_pin_toggle_dt(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - gpio_pin_toggle_dt(&phase_b1); -#endif + gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_b); } toggle_a = !toggle_a; } @@ -89,52 +96,46 @@ static void qenc_emulate_setup_pin(const struct gpio_dt_spec *gpio_dt) zassert_true(rc == 0, "%s: pin configure failed: %d", gpio_dt->port->name, rc); } -static void qenc_emulate_start(k_timeout_t period, bool forward) +static void qenc_emulate_start(struct qdec_qenc_loopback *loopback, k_timeout_t period, + bool forward) { - qenc_emulate_reset_pin(&phase_a); - qenc_emulate_reset_pin(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - qenc_emulate_reset_pin(&phase_a1); - qenc_emulate_reset_pin(&phase_b1); -#endif + qenc_emulate_reset_pin(&loopback->qenc_phase_a); + qenc_emulate_reset_pin(&loopback->qenc_phase_b); toggle_a = !forward; - + loopback_currently_under_test = loopback; k_timer_start(&qenc_emulate_timer, period, period); } static void qenc_emulate_stop(void) { - k_timer_stop(&qenc_emulate_timer); - - qenc_emulate_reset_pin(&phase_a); - qenc_emulate_reset_pin(&phase_b); -#if defined(SECOND_QDEC_INSTANCE) - qenc_emulate_reset_pin(&phase_a1); - qenc_emulate_reset_pin(&phase_b1); -#endif + if (loopback_currently_under_test) { + k_timer_stop(&qenc_emulate_timer); + qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_a); + qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_b); + } } -static void qenc_emulate_verify_reading(const struct device *const dev, int emulator_period_ms, - int emulation_duration_ms, bool forward, bool overflow_expected, - const uint32_t config_step) +static void qenc_emulate_verify_reading(struct qdec_qenc_loopback *loopback, + int emulator_period_ms, int emulation_duration_ms, bool forward, + bool overflow_expected) { int rc; struct sensor_value val = {0}; int32_t expected_steps = emulation_duration_ms / emulator_period_ms; - int32_t expected_reading = 360 * expected_steps / config_step; - int32_t delta = expected_reading / 5; + int32_t expected_reading = 360 * expected_steps / loopback->qdec_config_step; + int32_t delta = expected_reading / 4; if (!forward) { expected_reading *= -1; } - qenc_emulate_start(K_MSEC(emulator_period_ms), forward); + qenc_emulate_start(loopback, K_MSEC(emulator_period_ms), forward); /* wait for some readings */ k_msleep(emulation_duration_ms); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(loopback->qdec); if (!overflow_expected) { zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); @@ -142,7 +143,7 @@ static void qenc_emulate_verify_reading(const struct device *const dev, int emul zassert_true(rc == -EOVERFLOW, "Failed to detect overflow"); } - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); TC_PRINT("Expected reading: %d, actual value: %d, delta: %d\n", @@ -157,31 +158,31 @@ static void qenc_emulate_verify_reading(const struct device *const dev, int emul /* wait and get readings to clear state */ k_msleep(100); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(loopback->qdec); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); } -static void sensor_trigger_set_and_disable(const struct device *const dev) +static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } k_sem_give(&sem); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ALL; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* emulation working, handler should be called */ rc = k_sem_take(&sem, K_MSEC(200)); @@ -193,7 +194,7 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) rc = k_sem_take(&sem, K_MSEC(200)); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } /* there should be no triggers now*/ @@ -201,21 +202,21 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } /* register empty trigger - disable trigger */ - rc = sensor_trigger_set(dev, &qdec_trigger, NULL); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, NULL); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* emulation working, but handler not set, thus should not be called */ rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } } @@ -227,49 +228,50 @@ static void sensor_trigger_set_and_disable(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_trigger_set_and_disable) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_and_disable(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_and_disable(qdec_1_dev); -#endif - + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_trigger_set_and_disable(&loopbacks[i]); + } } -static void sensor_trigger_set_test(const struct device *const dev) +static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* emulation working now */ rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == 0, "qdec handler should be triggered (%d)", rc); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(loopback->qdec); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); TC_PRINT("QDEC reading: %d\n", val.val1); zassert_true(val.val1 != 0, "No readings from QDEC"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } + + qenc_emulate_stop(); + /* emulation not working, but there may be old trigger which needs to be cleaned up */ + rc = k_sem_take(&sem, K_MSEC(200)); } /** @@ -280,39 +282,37 @@ static void sensor_trigger_set_test(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_trigger_set) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_test(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_trigger_set_test(&loopbacks[i]); + } } -static void sensor_trigger_set_negative(const struct device *const dev) +static void sensor_trigger_set_negative(struct qdec_qenc_loopback *loopback) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); qdec_trigger.type = SENSOR_TRIG_MAX; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid trigger type"); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_MAX; - rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid channel"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } } @@ -324,12 +324,10 @@ static void sensor_trigger_set_negative(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_trigger_set_negative) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_trigger_set_negative(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_trigger_set_negative(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_trigger_set_negative(&loopbacks[i]); + } } /** @@ -340,37 +338,22 @@ ZTEST(qdec_sensor, test_sensor_trigger_set_negative) */ ZTEST(qdec_sensor, test_qdec_readings) { - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(qdec_dev); + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_get(loopbacks[i].qdec); + } + + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + qenc_emulate_verify_reading(&loopbacks[i], 10, 100, true, false); + qenc_emulate_verify_reading(&loopbacks[i], 2, 500, true, false); + qenc_emulate_verify_reading(&loopbacks[i], 10, 200, false, false); + qenc_emulate_verify_reading(&loopbacks[i], 1, 1000, false, true); + qenc_emulate_verify_reading(&loopbacks[i], 1, 1000, true, true); + + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put(loopbacks[i].qdec); + } } - - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - qenc_emulate_verify_reading(qdec_dev, 10, 100, true, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 2, 500, true, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 10, 200, false, false, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 1, 1000, false, true, qdec_config_step); - qenc_emulate_verify_reading(qdec_dev, 1, 1000, true, true, qdec_config_step); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(qdec_dev); - } - -#if defined(SECOND_QDEC_INSTANCE) - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(qdec_1_dev); - } - - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - qenc_emulate_verify_reading(qdec_1_dev, 10, 100, true, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 2, 500, true, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 10, 200, false, false, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, false, true, qdec_1_config_step); - qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, true, true, qdec_1_config_step); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(qdec_1_dev); - } -#endif } static void sensor_channel_get_empty(const struct device *const dev) @@ -419,40 +402,38 @@ static void sensor_channel_get_empty(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_channel_get_empty) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_empty(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_empty(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_channel_get_empty(loopbacks[i].qdec); + } } -static void sensor_channel_get_test(const struct device *const dev) +static void sensor_channel_get_test(struct qdec_qenc_loopback *loopback) { int rc; struct sensor_value val_first = {0}; struct sensor_value val_second = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(qdec_dev); + pm_device_runtime_get(loopback->qdec); } - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(qdec_dev); + rc = sensor_sample_fetch(loopback->qdec); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val_first); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val_first); zassert_true(rc == 0, "Failed to get sample (%d)", rc); zassert_true(val_first.val1 != 0, "No readings from QDEC"); /* wait for more readings*/ k_msleep(200); - rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val_second); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val_second); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); zassert_true(val_second.val1 != 0, "No readings from QDEC"); @@ -470,7 +451,7 @@ static void sensor_channel_get_test(const struct device *const dev) val_second.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(qdec_dev); + pm_device_runtime_put(loopback->qdec); } } @@ -482,38 +463,36 @@ static void sensor_channel_get_test(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_channel_get) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_test(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_channel_get_test(&loopbacks[i]); + } } -static void sensor_channel_get_negative(const struct device *const dev) +static void sensor_channel_get_negative(struct qdec_qenc_loopback *loopback) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); + pm_device_runtime_get(loopback->qdec); } - qenc_emulate_start(K_MSEC(10), true); + qenc_emulate_start(loopback, K_MSEC(10), true); /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(dev); + rc = sensor_sample_fetch(loopback->qdec); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(dev, SENSOR_CHAN_MAX, &val); + rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_MAX, &val); zassert_true(rc < 0, "Should failed to get sample (%d)", rc); zassert_true(val.val1 == 0, "Some readings from QDEC: %d", val.val1); zassert_true(val.val2 == 0, "Some readings from QDEC: %d", val.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(dev); + pm_device_runtime_put(loopback->qdec); } } @@ -525,12 +504,10 @@ static void sensor_channel_get_negative(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_channel_get_negative) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_channel_get_negative(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_channel_get_negative(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_channel_get_negative(&loopbacks[i]); + } } static void sensor_sample_fetch_test(const struct device *const dev) @@ -563,32 +540,22 @@ static void sensor_sample_fetch_test(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_sample_fetch) { - TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); - sensor_sample_fetch_test(qdec_dev); -#if defined(SECOND_QDEC_INSTANCE) - TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); - sensor_sample_fetch_test(qdec_1_dev); -#endif + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); + sensor_sample_fetch_test(loopbacks[i].qdec); + } } static void *setup(void) { - int rc; - - rc = device_is_ready(qdec_dev); - zassert_true(rc, "QDEC device not ready: %d", rc); + for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { + int rc = device_is_ready(loopbacks[i].qdec); - qenc_emulate_setup_pin(&phase_a); - qenc_emulate_setup_pin(&phase_b); - -#if defined(SECOND_QDEC_INSTANCE) - rc = device_is_ready(qdec_1_dev); - zassert_true(rc, "QDEC 1 device not ready: %d", rc); - - qenc_emulate_setup_pin(&phase_a1); - qenc_emulate_setup_pin(&phase_b1); -#endif + zassert_true(rc, "QDEC index %d not ready: %d", i, rc); + qenc_emulate_setup_pin(&loopbacks[i].qenc_phase_a); + qenc_emulate_setup_pin(&loopbacks[i].qenc_phase_b); + } return NULL; } From 1b88077f0b4adc5927f533a469bc04c30f62a166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Wed, 13 Aug 2025 10:33:25 +0200 Subject: [PATCH 0011/3334] [nrf fromlist] tests: boards: nrf: qdec: Fix test for nRF54L15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added additional cleanups between tests, which fixed the issue of a failing testcase on nRF54L15. Upstream PR #: 93927 Signed-off-by: Michał Bainczyk (cherry picked from commit 6d1a259f74109a9767e458dbe548d6b576d60c98) --- tests/boards/nrf/qdec/src/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 9d138d325fb5..6bc867f8aa9c 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -60,6 +60,11 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t static void qenc_emulate_work_handler(struct k_work *work) { + /* Check if emulation has been stopped after submitting this work item. */ + if (loopback_currently_under_test == NULL) { + return; + } + if (toggle_a) { gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_a); } else { @@ -113,6 +118,8 @@ static void qenc_emulate_stop(void) k_timer_stop(&qenc_emulate_timer); qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_a); qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_b); + + loopback_currently_under_test = NULL; } } @@ -218,6 +225,9 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { pm_device_runtime_put(loopback->qdec); } + + qenc_emulate_stop(); + k_sem_reset(&sem); } /** @@ -270,8 +280,7 @@ static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) } qenc_emulate_stop(); - /* emulation not working, but there may be old trigger which needs to be cleaned up */ - rc = k_sem_take(&sem, K_MSEC(200)); + k_sem_reset(&sem); } /** @@ -571,6 +580,7 @@ static void after(void *fixture) ARG_UNUSED(fixture); qenc_emulate_stop(); + k_sem_reset(&sem); } ZTEST_SUITE(qdec_sensor, NULL, setup, before, after, NULL); From 7200b234870a54735b783bc3fb5970145fb5a31b Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Mon, 11 Aug 2025 12:08:09 +0200 Subject: [PATCH 0012/3334] [nrf fromlist] tests: zms: Minor improvements Upstream PR #: 94330 * Explicitly skip tests that depend on CONFIG_ZMS_LOOKUP_CACHE. * In `testcase.yaml`, use `extra_configs` instead of `extra_args` for setting Kconfigs. Signed-off-by: Grzegorz Swiderski (cherry picked from commit ca5f823297dd68c52df8478383b98dbe5ca84570) --- tests/subsys/fs/zms/src/main.c | 9 ++++++++- tests/subsys/fs/zms/testcase.yaml | 9 +++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/subsys/fs/zms/src/main.c b/tests/subsys/fs/zms/src/main.c index a69a2b009537..15cdf217c04e 100644 --- a/tests/subsys/fs/zms/src/main.c +++ b/tests/subsys/fs/zms/src/main.c @@ -752,6 +752,8 @@ ZTEST_F(zms, test_zms_cache_init) num = num_matching_cache_entries(ate_addr, false, &fixture->fs); zassert_equal(num, 1, "invalid cache entry after restart"); +#else + ztest_test_skip(); #endif } @@ -780,6 +782,8 @@ ZTEST_F(zms, test_zms_cache_collission) zassert_equal(err, sizeof(data), "zms_read call failure: %d", err); zassert_equal(data, id, "incorrect data read"); } +#else + ztest_test_skip(); #endif } @@ -829,6 +833,8 @@ ZTEST_F(zms, test_zms_cache_gc) num = num_matching_cache_entries(2ULL << ADDR_SECT_SHIFT, true, &fixture->fs); zassert_equal(num, 2, "invalid cache content after gc"); +#else + ztest_test_skip(); #endif } @@ -886,7 +892,8 @@ ZTEST_F(zms, test_zms_cache_hash_quality) TC_PRINT("Cache occupancy: %u\n", (unsigned int)num); zassert_between_inclusive(num, MIN_CACHE_OCCUPANCY, CONFIG_ZMS_LOOKUP_CACHE_SIZE, "too low cache occupancy - poor hash quality"); - +#else + ztest_test_skip(); #endif } diff --git a/tests/subsys/fs/zms/testcase.yaml b/tests/subsys/fs/zms/testcase.yaml index bdee4529f2af..4949e1be0c6b 100644 --- a/tests/subsys/fs/zms/testcase.yaml +++ b/tests/subsys/fs/zms/testcase.yaml @@ -8,20 +8,21 @@ tests: extra_args: DTC_OVERLAY_FILE=boards/qemu_x86_ev_0x00.overlay platform_allow: qemu_x86 filesystem.zms.sim.no_erase: - extra_args: CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n + extra_configs: + - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n platform_allow: qemu_x86 filesystem.zms.sim.corrupt_close: - extra_args: + extra_configs: - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=y - CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y platform_allow: qemu_x86 filesystem.zms.cache: - extra_args: + extra_configs: - CONFIG_ZMS_LOOKUP_CACHE=y - CONFIG_ZMS_LOOKUP_CACHE_SIZE=64 platform_allow: native_sim filesystem.zms.data_crc: - extra_args: + extra_configs: - CONFIG_ZMS_DATA_CRC=y platform_allow: - native_sim From 51c49770273e47bcd4d723136d22ae14ffeff625 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Mon, 11 Aug 2025 12:08:09 +0200 Subject: [PATCH 0013/3334] [nrf fromlist] zms: Initial support for 64 bit IDs Upstream PR #: 94330 Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t` is added, so that the maximum ID width can be controlled using Kconfig. The current ATE structure is already large enough that it is possible to reserve 64 bits for IDs without increasing its total size (128 bits). This makes the feature a natural, low footprint alternative to Settings, for cases where the supported key namespace must be larger than 32 bit but not arbitrarily large. The ATE format does have to be altered to accommodate larger IDs, but the default "32 bit" format is left as is. Now, the `struct zms_ate` describes one of two supported formats, selected by an `#if` condition. In the future, it may be possible to support multiple ATE formats at runtime, in which case the structure can be turned into a union. In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved into a union, because they are found to be mutually exclusive. With the old format, the same fields are in different locations, but one of them always gets filled with a dummy value, depending on the given ATE type. To cover both cases, a `memset` is used, which should be optimized away by the compiler when appropriate. The only limitation is that the new ATE format has no room for data CRC, but an alternative integrity check can be implemented by the caller. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 6ca5a61cd45f95467f4283c2bd379c5acfc143ea) --- include/zephyr/fs/zms.h | 21 ++++++-- subsys/fs/zms/Kconfig | 11 ++++ subsys/fs/zms/zms.c | 108 +++++++++++++++++++++++++++------------ subsys/fs/zms/zms_priv.h | 35 ++++++++++++- 4 files changed, 135 insertions(+), 40 deletions(-) diff --git a/include/zephyr/fs/zms.h b/include/zephyr/fs/zms.h index 41ba053c93c0..cdaa323e3da9 100644 --- a/include/zephyr/fs/zms.h +++ b/include/zephyr/fs/zms.h @@ -77,6 +77,17 @@ struct zms_fs { * @{ */ +/** + * @brief ID type used in the ZMS API. + * + * @note The width of this type depends on @kconfig{CONFIG_ZMS_ID_64BIT}. + */ +#if CONFIG_ZMS_ID_64BIT +typedef uint64_t zms_id_t; +#else +typedef uint32_t zms_id_t; +#endif + /** * @brief Mount a ZMS file system onto the device specified in `fs`. * @@ -128,7 +139,7 @@ int zms_clear(struct zms_fs *fs); * @retval -EINVAL if `fs` is NULL or `len` is invalid. * @retval -ENOSPC if no space is left on the device. */ -ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len); +ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len); /** * @brief Delete an entry from the file system @@ -142,7 +153,7 @@ ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len); * @retval -EIO if there is a memory read/write error. * @retval -EINVAL if `fs` is NULL. */ -int zms_delete(struct zms_fs *fs, uint32_t id); +int zms_delete(struct zms_fs *fs, zms_id_t id); /** * @brief Read an entry from the file system. @@ -161,7 +172,7 @@ int zms_delete(struct zms_fs *fs, uint32_t id); * @retval -ENOENT if there is no entry with the given `id`. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len); +ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len); /** * @brief Read a history entry from the file system. @@ -182,7 +193,7 @@ ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len); * @retval -ENOENT if there is no entry with the given `id` and history counter. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt); +ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt); /** * @brief Gets the length of the data that is stored in an entry with a given `id` @@ -198,7 +209,7 @@ ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, ui * @retval -ENOENT if there is no entry with the given id. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id); +ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id); /** * @brief Calculate the available free space in the file system. diff --git a/subsys/fs/zms/Kconfig b/subsys/fs/zms/Kconfig index 9266fada236a..f20310a87620 100644 --- a/subsys/fs/zms/Kconfig +++ b/subsys/fs/zms/Kconfig @@ -16,6 +16,15 @@ config ZMS if ZMS +config ZMS_ID_64BIT + bool "64 bit ZMS IDs" + help + When this option is true, the `zms_id_t` values passed to ZMS APIs will be 64 bit, + as opposed to the default 32 bit. + This option will also change the format of allocation table entries (ATEs) in memory + to accommodate larger IDs. Currently, this will make ZMS unable to mount an existing + file system if it has been initialized with a different ATE format. + config ZMS_LOOKUP_CACHE bool "ZMS lookup cache" help @@ -34,6 +43,7 @@ config ZMS_LOOKUP_CACHE_SIZE config ZMS_DATA_CRC bool "ZMS data CRC" + depends on !ZMS_ID_64BIT config ZMS_CUSTOMIZE_BLOCK_SIZE bool "Customize the size of the buffer used internally for reads and writes" @@ -54,6 +64,7 @@ config ZMS_CUSTOM_BLOCK_SIZE config ZMS_LOOKUP_CACHE_FOR_SETTINGS bool "ZMS Storage lookup cache optimized for settings" depends on ZMS_LOOKUP_CACHE && SETTINGS_ZMS + depends on !ZMS_ID_64BIT help Enable usage of lookup cache based on hashes to get, the best ZMS performance, provided that the ZMS is used only for the purpose of providing the settings diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index b4b11aa6923e..d3bc9275479d 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -29,10 +29,8 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at #ifdef CONFIG_ZMS_LOOKUP_CACHE -static inline size_t zms_lookup_cache_pos(uint32_t id) +static inline size_t zms_lookup_cache_pos(zms_id_t id) { - uint32_t hash = id; - #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS /* * 1. Settings subsystem is storing the name ID and the linked list node ID @@ -52,14 +50,27 @@ static inline size_t zms_lookup_cache_pos(uint32_t id) uint32_t key_value_bit; uint32_t key_value_hash; uint32_t key_value_ll; + uint32_t hash; key_value_bit = (id >> LOG2(ZMS_DATA_ID_OFFSET)) & 1; key_value_hash = (id & ZMS_HASH_MASK) >> (CONFIG_SETTINGS_ZMS_MAX_COLLISIONS_BITS + 1); key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; + +#elif defined(CONFIG_ZMS_ID_64BIT) + /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ + uint64_t hash = id; + + hash ^= hash >> 32; + hash *= 0x42ab4abe4c475039ULL; + hash ^= hash >> 31; + hash *= 0xfa90c4424c537791ULL; + hash ^= hash >> 32; #else /* 32-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ + uint32_t hash = id; + hash ^= hash >> 16; hash *= 0x7feb352dU; hash ^= hash >> 15; @@ -239,7 +250,7 @@ static int zms_flash_ate_wrt(struct zms_fs *fs, const struct zms_ate *entry) goto end; } #ifdef CONFIG_ZMS_LOOKUP_CACHE - /* 0xFFFFFFFF is a special-purpose identifier. Exclude it from the cache */ + /* ZMS_HEAD_ID is a special-purpose identifier. Exclude it from the cache */ if (entry->id != ZMS_HEAD_ID) { fs->lookup_cache[zms_lookup_cache_pos(entry->id)] = fs->ate_wra; } @@ -487,7 +498,7 @@ static bool zms_close_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) /* zms_empty_ate_valid validates an sector empty ate. * A valid sector empty ate should be: * - a valid ate - * - with len = 0xffff and id = 0xffffffff + * - with len = 0xffff and id = ZMS_HEAD_ID * return true if valid, false otherwise */ static bool zms_empty_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) @@ -500,7 +511,7 @@ static bool zms_empty_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) * Valid gc_done_ate: * - valid ate * - len = 0 - * - id = 0xffffffff + * - id = ZMS_HEAD_ID * return true if valid, false otherwise */ static bool zms_gc_done_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) @@ -509,6 +520,18 @@ static bool zms_gc_done_ate_valid(struct zms_fs *fs, const struct zms_ate *entry (entry->id == ZMS_HEAD_ID)); } +/* zms_sector_closed checks whether the current sector is closed, which would imply + * that the empty ATE and close ATE are both valid and have matching cycle counters + * + * return true if closed, false otherwise + */ +static bool zms_sector_closed(struct zms_fs *fs, struct zms_ate *empty_ate, + struct zms_ate *close_ate) +{ + return (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && + (empty_ate->cycle_cnt == close_ate->cycle_cnt)); +} + /* Read empty and close ATE of the sector where belongs address "addr" and * validates that the sector is closed. * retval: 0 if sector is not close @@ -526,8 +549,7 @@ static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct z return rc; } - if (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && - (empty_ate->cycle_cnt == close_ate->cycle_cnt)) { + if (zms_sector_closed(fs, empty_ate, close_ate)) { /* Closed sector validated */ return 1; } @@ -536,7 +558,7 @@ static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct z } /* store an entry in flash */ -static int zms_flash_write_entry(struct zms_fs *fs, uint32_t id, const void *data, size_t len) +static int zms_flash_write_entry(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) { int rc; struct zms_ate entry; @@ -549,13 +571,13 @@ static int zms_flash_write_entry(struct zms_fs *fs, uint32_t id, const void *dat entry.cycle_cnt = fs->sector_cycle; if (len > ZMS_DATA_IN_ATE_SIZE) { - /* only compute CRC if len is greater than 8 bytes */ - if (IS_ENABLED(CONFIG_ZMS_DATA_CRC)) { - entry.data_crc = crc32_ieee(data, len); - } +#ifdef CONFIG_ZMS_DATA_CRC + /* only compute CRC if data is to be stored outside of entry */ + entry.data_crc = crc32_ieee(data, len); +#endif entry.offset = (uint32_t)SECTOR_OFFSET(fs->data_wra); } else if ((len > 0) && (len <= ZMS_DATA_IN_ATE_SIZE)) { - /* Copy data into entry for small data ( < 8B) */ + /* Copy data into entry for small data (at most ZMS_DATA_IN_ATE_SIZE bytes) */ memcpy(&entry.data, data, len); } @@ -688,10 +710,12 @@ static int zms_sector_close(struct zms_fs *fs) struct zms_ate close_ate; struct zms_ate garbage_ate; + /* Initialize all members to 0xff */ + memset(&close_ate, 0xff, sizeof(struct zms_ate)); + close_ate.id = ZMS_HEAD_ID; close_ate.len = 0U; close_ate.offset = (uint32_t)SECTOR_OFFSET(fs->ate_wra + fs->ate_size); - close_ate.metadata = 0xffffffff; close_ate.cycle_cnt = fs->sector_cycle; /* When we close the sector, we must write all non used ATE with @@ -740,11 +764,13 @@ static int zms_add_gc_done_ate(struct zms_fs *fs) { struct zms_ate gc_done_ate; + /* Initialize all members to 0xff */ + memset(&gc_done_ate, 0xff, sizeof(struct zms_ate)); + LOG_DBG("Adding gc done ate at %llx", fs->ate_wra); gc_done_ate.id = ZMS_HEAD_ID; gc_done_ate.len = 0U; gc_done_ate.offset = (uint32_t)SECTOR_OFFSET(fs->data_wra); - gc_done_ate.metadata = 0xffffffff; gc_done_ate.cycle_cnt = fs->sector_cycle; zms_ate_crc8_update(&gc_done_ate); @@ -793,14 +819,17 @@ static int zms_add_empty_ate(struct zms_fs *fs, uint64_t addr) int rc = 0; uint64_t previous_ate_wra; + /* Initialize all members to 0 */ + memset(&empty_ate, 0, sizeof(struct zms_ate)); + addr &= ADDR_SECT_MASK; LOG_DBG("Adding empty ate at %llx", (uint64_t)(addr + fs->sector_size - fs->ate_size)); empty_ate.id = ZMS_HEAD_ID; empty_ate.len = 0xffff; - empty_ate.offset = 0U; - empty_ate.metadata = - FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | ZMS_DEFAULT_VERSION; + empty_ate.metadata = FIELD_PREP(ZMS_VERSION_MASK, ZMS_DEFAULT_VERSION) | + FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | + FIELD_PREP(ZMS_ATE_FORMAT_MASK, ZMS_DEFAULT_ATE_FORMAT); rc = zms_get_sector_cycle(fs, addr, &cycle_cnt); if (rc == -ENOENT) { @@ -893,7 +922,7 @@ static int zms_get_sector_header(struct zms_fs *fs, uint64_t addr, struct zms_at * @retval 1 valid ATE with same ID found * @retval < 0 An error happened */ -static int zms_find_ate_with_id(struct zms_fs *fs, uint32_t id, uint64_t start_addr, +static int zms_find_ate_with_id(struct zms_fs *fs, zms_id_t id, uint64_t start_addr, uint64_t end_addr, struct zms_ate *ate, uint64_t *ate_addr) { int rc; @@ -1044,10 +1073,10 @@ static int zms_gc(struct zms_fs *fs) */ if (wlk_prev_addr == gc_prev_addr) { /* copy needed */ - LOG_DBG("Moving %d, len %d", gc_ate.id, gc_ate.len); + LOG_DBG("Moving %lld, len %d", (long long)gc_ate.id, gc_ate.len); if (gc_ate.len > ZMS_DATA_IN_ATE_SIZE) { - /* Copy Data only when len > 8 + /* Copy Data only when len > ZMS_DATA_IN_ATE_SIZE * Otherwise, Data is already inside ATE */ data_addr = (gc_prev_addr & ADDR_SECT_MASK); @@ -1156,16 +1185,28 @@ static int zms_init(struct zms_fs *fs) for (i = 0; i < fs->sector_count; i++) { addr = zms_close_ate_addr(fs, ((uint64_t)i << ADDR_SECT_SHIFT)); - /* verify if the sector is closed */ - sec_closed = zms_validate_closed_sector(fs, addr, &empty_ate, &close_ate); - if (sec_closed < 0) { - rc = sec_closed; + /* read the header ATEs */ + rc = zms_get_sector_header(fs, addr, &empty_ate, &close_ate); + if (rc) { goto end; } /* update cycle count */ fs->sector_cycle = empty_ate.cycle_cnt; - if (sec_closed == 1) { + /* Check the ATE format indicator so that we know how to validate ATEs. + * The metadata field has the same offset and size in all ATE formats + * (the same is guaranteed for crc8 and cycle_cnt). + * Currently, ZMS can only recognize one of its supported ATE formats + * (the one chosen at build time), so their indicators are defined for + * the possibility of a future extension. + * If this indicator is unknown, then consider the header ATEs invalid, + * because we might not be dealing with ZMS contents at all. + */ + if (ZMS_GET_ATE_FORMAT(empty_ate.metadata) != ZMS_DEFAULT_ATE_FORMAT) { + continue; + } + + if (zms_sector_closed(fs, &empty_ate, &close_ate)) { /* closed sector */ closed_sectors++; /* Let's verify that this is a ZMS storage system */ @@ -1223,7 +1264,8 @@ static int zms_init(struct zms_fs *fs) goto end; } - if (zms_empty_ate_valid(fs, &empty_ate)) { + if ((ZMS_GET_ATE_FORMAT(empty_ate.metadata) == ZMS_DEFAULT_ATE_FORMAT) && + zms_empty_ate_valid(fs, &empty_ate)) { /* Empty ATE is valid, let's verify that this is a ZMS storage system */ if (ZMS_GET_MAGIC_NUMBER(empty_ate.metadata) == ZMS_MAGIC_NUMBER) { zms_magic_exist = true; @@ -1468,7 +1510,7 @@ int zms_mount(struct zms_fs *fs) return 0; } -ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len) +ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) { int rc; size_t data_size; @@ -1613,12 +1655,12 @@ ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len) return rc; } -int zms_delete(struct zms_fs *fs, uint32_t id) +int zms_delete(struct zms_fs *fs, zms_id_t id) { return zms_write(fs, id, NULL, 0); } -ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt) +ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt) { int rc; int prev_found = 0; @@ -1719,7 +1761,7 @@ ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, ui return rc; } -ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len) +ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len) { int rc; @@ -1732,7 +1774,7 @@ ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len) return MIN(rc, len); } -ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id) +ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id) { int rc; diff --git a/subsys/fs/zms/zms_priv.h b/subsys/fs/zms/zms_priv.h index 84f77296f4f3..44cfb2f3d280 100644 --- a/subsys/fs/zms/zms_priv.h +++ b/subsys/fs/zms/zms_priv.h @@ -28,7 +28,6 @@ #endif #define ZMS_LOOKUP_CACHE_NO_ADDR GENMASK64(63, 0) -#define ZMS_HEAD_ID GENMASK(31, 0) #define ZMS_VERSION_MASK GENMASK(7, 0) #define ZMS_GET_VERSION(x) FIELD_GET(ZMS_VERSION_MASK, x) @@ -36,14 +35,28 @@ #define ZMS_MAGIC_NUMBER 0x42 /* murmur3a hash of "ZMS" (MSB) */ #define ZMS_MAGIC_NUMBER_MASK GENMASK(15, 8) #define ZMS_GET_MAGIC_NUMBER(x) FIELD_GET(ZMS_MAGIC_NUMBER_MASK, x) +#define ZMS_ATE_FORMAT_MASK GENMASK(19, 16) +#define ZMS_GET_ATE_FORMAT(x) FIELD_GET(ZMS_ATE_FORMAT_MASK, x) #define ZMS_MIN_ATE_NUM 5 #define ZMS_INVALID_SECTOR_NUM -1 -#define ZMS_DATA_IN_ATE_SIZE 8 + +#define ZMS_ATE_FORMAT_ID_32BIT 0 +#define ZMS_ATE_FORMAT_ID_64BIT 1 + +#if !defined(CONFIG_ZMS_ID_64BIT) +#define ZMS_DEFAULT_ATE_FORMAT ZMS_ATE_FORMAT_ID_32BIT +#define ZMS_HEAD_ID GENMASK(31, 0) +#else +#define ZMS_DEFAULT_ATE_FORMAT ZMS_ATE_FORMAT_ID_64BIT +#define ZMS_HEAD_ID GENMASK64(63, 0) +#endif /* CONFIG_ZMS_ID_64BIT */ /** * @ingroup zms_data_structures * ZMS Allocation Table Entry (ATE) structure + * + * @note This structure depends on @kconfig{CONFIG_ZMS_ID_64BIT}. */ struct zms_ate { /** crc8 check of the entry */ @@ -52,6 +65,8 @@ struct zms_ate { uint8_t cycle_cnt; /** data len within sector */ uint16_t len; + +#if ZMS_DEFAULT_ATE_FORMAT == ZMS_ATE_FORMAT_ID_32BIT /** data id */ uint32_t id; union { @@ -75,6 +90,22 @@ struct zms_ate { }; }; }; + +#elif ZMS_DEFAULT_ATE_FORMAT == ZMS_ATE_FORMAT_ID_64BIT + /** data id */ + uint64_t id; + union { + /** data field used to store small sized data */ + uint8_t data[4]; + /** data offset within sector */ + uint32_t offset; + /** Used to store metadata information such as storage version. */ + uint32_t metadata; + }; +#endif /* ZMS_DEFAULT_ATE_FORMAT */ + } __packed; +#define ZMS_DATA_IN_ATE_SIZE SIZEOF_FIELD(struct zms_ate, data) + #endif /* __ZMS_PRIV_H_ */ From ab5b191f2e972d8586ee41023cb3877332800270 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Mon, 11 Aug 2025 12:08:09 +0200 Subject: [PATCH 0014/3334] [nrf fromlist] tests: zms: Add test coverage for ZMS_ID_64BIT Upstream PR #: 94330 * Update the "corrupt ATE" tests to work with the new ATE format. * Add a basic test to verify support to 64 bit ZMS IDs. * Add a `testcase.yaml` entry to cover the above points and also run lookup cache tests to evaluate the 64 bit hash function. Signed-off-by: Grzegorz Swiderski (cherry picked from commit aa0a2af2f549182d9f845185663ef9af32cc0b80) --- tests/subsys/fs/zms/src/main.c | 56 +++++++++++++++++++++++++++---- tests/subsys/fs/zms/testcase.yaml | 6 ++++ 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/tests/subsys/fs/zms/src/main.c b/tests/subsys/fs/zms/src/main.c index 15cdf217c04e..80e2d9f9c072 100644 --- a/tests/subsys/fs/zms/src/main.c +++ b/tests/subsys/fs/zms/src/main.c @@ -578,17 +578,19 @@ ZTEST_F(zms, test_zms_gc_corrupt_close_ate) int err; Z_TEST_SKIP_IFNDEF(CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES); - close_ate.id = 0xffffffff; + memset(&close_ate, 0xff, sizeof(struct zms_ate)); + close_ate.id = ZMS_HEAD_ID; close_ate.offset = fixture->fs.sector_size - sizeof(struct zms_ate) * 5; close_ate.len = 0; - close_ate.metadata = 0xffffffff; close_ate.cycle_cnt = 1; close_ate.crc8 = 0xff; /* Incorrect crc8 */ - empty_ate.id = 0xffffffff; - empty_ate.offset = 0; + memset(&empty_ate, 0, sizeof(struct zms_ate)); + empty_ate.id = ZMS_HEAD_ID; empty_ate.len = 0xffff; - empty_ate.metadata = 0x4201; + empty_ate.metadata = FIELD_PREP(ZMS_VERSION_MASK, ZMS_DEFAULT_VERSION) | + FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | + FIELD_PREP(ZMS_ATE_FORMAT_MASK, ZMS_DEFAULT_ATE_FORMAT); empty_ate.cycle_cnt = 1; empty_ate.crc8 = crc8_ccitt(0xff, (uint8_t *)&empty_ate + SIZEOF_FIELD(struct zms_ate, crc8), @@ -649,7 +651,7 @@ ZTEST_F(zms, test_zms_gc_corrupt_ate) struct zms_ate close_ate; int err; - close_ate.id = 0xffffffff; + close_ate.id = ZMS_HEAD_ID; close_ate.offset = fixture->fs.sector_size / 2; close_ate.len = 0; close_ate.crc8 = @@ -955,3 +957,45 @@ ZTEST_F(zms, test_zms_input_validation) err = zms_delete(&fixture->fs, 0); zassert_true(err == -EACCES, "zms_delete call before mount fs failure: %d", err); } + +/* + * Test 64 bit ZMS ID support. + */ +ZTEST_F(zms, test_zms_id_64bit) +{ + int err; + ssize_t len; + uint64_t data; + uint64_t filling_id = 0xdeadbeefULL; + + Z_TEST_SKIP_IFNDEF(CONFIG_ZMS_ID_64BIT); + + err = zms_mount(&fixture->fs); + zassert_true(err == 0, "zms_mount call failure: %d", err); + + /* Fill the first sector with writes of different IDs */ + + while (fixture->fs.data_wra + sizeof(data) + sizeof(struct zms_ate) <= + fixture->fs.ate_wra) { + data = filling_id; + len = zms_write(&fixture->fs, (zms_id_t)filling_id, &data, sizeof(data)); + zassert_true(len == sizeof(data), "zms_write failed: %d", len); + + /* Choose the next ID so that its lower 32 bits stay invariant. + * The purpose is to test that ZMS doesn't mistakenly cast the + * 64 bit ID to a 32 bit one somewhere. + */ + filling_id += BIT64(32); + } + + /* Read back the written entries and check that they're all unique */ + + for (uint64_t id = 0xdeadbeefULL; id < filling_id; id += BIT64(32)) { + len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 0); + zassert_true(len == sizeof(data), "zms_read_hist unexpected failure: %d", len); + zassert_equal(data, id, "read unexpected data: %llx instead of %llx", data, id); + + len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 1); + zassert_true(len == -ENOENT, "zms_read_hist unexpected failure: %d", len); + } +} diff --git a/tests/subsys/fs/zms/testcase.yaml b/tests/subsys/fs/zms/testcase.yaml index 4949e1be0c6b..14cb7e9c36a2 100644 --- a/tests/subsys/fs/zms/testcase.yaml +++ b/tests/subsys/fs/zms/testcase.yaml @@ -27,3 +27,9 @@ tests: platform_allow: - native_sim - qemu_x86 + filesystem.zms.id_64bit: + extra_configs: + - CONFIG_ZMS_ID_64BIT=y + - CONFIG_ZMS_LOOKUP_CACHE=y + - CONFIG_ZMS_LOOKUP_CACHE_SIZE=64 + platform_allow: qemu_x86 From 30f26bcb40949e7d8ad1dce4ec008cfadbb6e845 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 28 Aug 2025 15:12:39 +0300 Subject: [PATCH 0015/3334] [nrf fromlist] manifest: tf-m-tests: bring in fix for TF-M 2.2.0 Fixup to the TF-M 2.2.0 update. Signed-off-by: Tomi Fontanilles Upstream PR #: 94729 Signed-off-by: Tomi Fontanilles (cherry picked from commit 9293b230c28d41b072990e2962448ee4de105675) --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 04bdd669a921..57ad7affdd1c 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -35,7 +35,7 @@ manifest: groups: - optional - name: tf-m-tests - revision: a286347e6a5dd37a9a5e960450ffc0260d63fb27 + revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 path: modules/tee/tf-m/tf-m-tests remote: upstream groups: From 5efb3056747b32780daf7d3a459d74be28442cc4 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 10 Sep 2025 09:14:29 +0100 Subject: [PATCH 0016/3334] [nrf fromlist] scripts: requirements: Add python-dotenv This is needed for any Kconfig processing Upstream PR #: 95771 Signed-off-by: Jamie McCrae (cherry picked from commit daf7f1fbdcf4494025eef353a7675069c7dd54e6) --- scripts/requirements-actions.in | 1 + scripts/requirements-actions.txt | 4 ++++ scripts/requirements-build-test.txt | 2 ++ scripts/requirements-compliance.txt | 1 + 4 files changed, 8 insertions(+) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 997afed38712..6baf9dc9e3f4 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -22,6 +22,7 @@ pykwalify pylint>=3 pyserial pytest +python-dotenv python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" pyyaml diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 8c28b2d22f77..21505203bfa6 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -880,6 +880,10 @@ python-debian==1.0.1 \ --hash=sha256:3ada9b83a3d671b58081782c0969cffa0102f6ce433fbbc7cf21275b8b5cc771 \ --hash=sha256:8f137c230c1d9279c2ac892b35915068b2aca090c9fd3da5671ff87af32af12c # via reuse +python-dotenv==1.1.1 \ + --hash=sha256:31f23644fe2602f88ff55e1f5c79ba497e01224ee7737937930c448e4d0e24dc \ + --hash=sha256:a8a6399716257f45be6a007360200409fce5cda2661e3dec71d23dc15f6189ab + # via -r requirements-actions.in python-magic==0.4.27 ; sys_platform != 'win32' \ --hash=sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b \ --hash=sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3 diff --git a/scripts/requirements-build-test.txt b/scripts/requirements-build-test.txt index 2ce1227e3e70..e6264b11ea5e 100644 --- a/scripts/requirements-build-test.txt +++ b/scripts/requirements-build-test.txt @@ -19,3 +19,5 @@ mypy # used for JUnit XML parsing in CTest harness junitparser>=3.0.0 + +python-dotenv diff --git a/scripts/requirements-compliance.txt b/scripts/requirements-compliance.txt index 3c3841cf33ed..6d90ac4b2587 100644 --- a/scripts/requirements-compliance.txt +++ b/scripts/requirements-compliance.txt @@ -8,6 +8,7 @@ junitparser>=4.0.1 lxml>=5.3.0 pykwalify pylint>=3 +python-dotenv python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" ruff==0.11.11 From b7c545c96c691b039641be3349b96ba1e2eedda7 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 10 Sep 2025 09:08:10 +0100 Subject: [PATCH 0017/3334] [nrf fromlist] kconfig: Load Kconfig env file better Loads this file in a better way that means samples and modules should not have to source the file before referencing Kconfig module path variables Upstream PR #: 95771 Signed-off-by: Jamie McCrae (cherry picked from commit 007d0da22f526d0387f1d39152909b036285e69d) --- Kconfig.zephyr | 1 - cmake/modules/kconfig.cmake | 5 ++++- doc/_extensions/zephyr/kconfig/__init__.py | 6 ++++-- scripts/ci/check_compliance.py | 8 ++++++-- scripts/zephyr_module.py | 18 +++++++++++++++--- share/sysbuild/Kconfig | 2 -- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index d8df86add4d3..d758a03baff4 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -6,7 +6,6 @@ # SPDX-License-Identifier: Apache-2.0 source "Kconfig.constants" -source "$(KCONFIG_ENV_FILE)" osource "$(APPLICATION_SOURCE_DIR)/VERSION" diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index de87abfdc1d3..60667eb6444b 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -132,10 +132,13 @@ endif() # APP_DIR: Path to the main image (sysbuild) or synonym for APPLICATION_SOURCE_DIR (non-sysbuild) zephyr_get(APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR) +# Load the module Kconfig file into CMake +include("${KCONFIG_BINARY_DIR}/kconfig_module_dirs.cmake") + set(COMMON_KCONFIG_ENV_SETTINGS PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} - KCONFIG_ENV_FILE=${KCONFIG_BINARY_DIR}/kconfig_module_dirs.env srctree=${ZEPHYR_BASE} + ${kconfig_env_dirs} KERNELVERSION=${KERNELVERSION} APPVERSION=${APP_VERSION_STRING} APP_VERSION_EXTENDED_STRING=${APP_VERSION_EXTENDED_STRING} diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index cda7430d7ab8..704415eac101 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -44,6 +44,7 @@ from typing import Any from docutils import nodes +from dotenv import load_dotenv from sphinx.addnodes import pending_xref from sphinx.application import Sphinx from sphinx.builders import Builder @@ -81,7 +82,8 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d sysbuild_kconfig = "" for module in modules: kconfig_module_dirs += zephyr_module.process_kconfig_module_dir(module.project, - module.meta) + module.meta, + False) kconfig += zephyr_module.process_kconfig(module.project, module.meta) sysbuild_kconfig += zephyr_module.process_sysbuildkconfig(module.project, module.meta) @@ -155,7 +157,7 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d os.environ["BOARD"] = "boards" os.environ["KCONFIG_BOARD_DIR"] = str(Path(td) / "boards") - os.environ["KCONFIG_ENV_FILE"] = str(Path(td) / "kconfig_module_dirs.env") + load_dotenv(str(Path(td) / "kconfig_module_dirs.env")) # Sysbuild runs first os.environ["CONFIG_"] = "SB_CONFIG_" diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index a600004aae7a..540744d7e122 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -23,6 +23,8 @@ import unidiff import yaml +from dotenv import load_dotenv + from yamllint import config, linter from junitparser import TestCase, TestSuite, JUnitXml, Skipped, Error, Failure @@ -700,14 +702,14 @@ def parse_kconfig(self): os.environ["KCONFIG_BINARY_DIR"] = kconfiglib_dir os.environ['DEVICETREE_CONF'] = "dummy" os.environ['TOOLCHAIN_HAS_NEWLIB'] = "y" - os.environ['KCONFIG_ENV_FILE'] = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") + kconfig_env_file = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") # Older name for DEVICETREE_CONF, for compatibility with older Zephyr # versions that don't have the renaming os.environ["GENERATED_DTS_BOARD_CONF"] = "dummy" # For multi repo support - self.get_modules(os.environ['KCONFIG_ENV_FILE'], + self.get_modules(kconfig_env_file, os.path.join(kconfiglib_dir, "Kconfig.modules"), os.path.join(kconfiglib_dir, "Kconfig.sysbuild.modules"), os.path.join(kconfiglib_dir, "settings_file.txt")) @@ -721,6 +723,8 @@ def parse_kconfig(self): # symbols within Kconfig files os.environ["KCONFIG_WARN_UNDEF"] = "y" + load_dotenv(kconfig_env_file) + try: # Note this will both print warnings to stderr _and_ return # them: so some warnings might get printed diff --git a/scripts/zephyr_module.py b/scripts/zephyr_module.py index c214f51704c8..6606af52ba0f 100755 --- a/scripts/zephyr_module.py +++ b/scripts/zephyr_module.py @@ -386,10 +386,13 @@ def kconfig_snippet(meta, path, kconfig_file=None, blobs=False, taint_blobs=Fals return '\n'.join(snippet) -def process_kconfig_module_dir(module, meta): +def process_kconfig_module_dir(module, meta, cmake_output): module_path = PurePath(module) name_sanitized = meta['name-sanitized'] - return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' + + if cmake_output is False: + return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' + return f'list(APPEND kconfig_env_dirs ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()})\n' def process_kconfig(module, meta): @@ -870,6 +873,7 @@ def main(): args = parser.parse_args() kconfig_module_dirs = "" + kconfig_module_dirs_cmake = "set(kconfig_env_dirs)\n" kconfig = "" cmake = "" sysbuild_kconfig = "" @@ -882,7 +886,8 @@ def main(): args.modules, args.extra_modules) for module in modules: - kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta) + kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta, False) + kconfig_module_dirs_cmake += process_kconfig_module_dir(module.project, module.meta, True) kconfig += process_kconfig(module.project, module.meta) cmake += process_cmake(module.project, module.meta) sysbuild_kconfig += process_sysbuildkconfig( @@ -894,13 +899,20 @@ def main(): if args.kconfig_out or args.sysbuild_kconfig_out: if args.kconfig_out: kconfig_module_dirs_out = PurePath(args.kconfig_out).parent / 'kconfig_module_dirs.env' + kconfig_module_dirs_cmake_out = PurePath(args.kconfig_out).parent / \ + 'kconfig_module_dirs.cmake' elif args.sysbuild_kconfig_out: kconfig_module_dirs_out = PurePath(args.sysbuild_kconfig_out).parent / \ 'kconfig_module_dirs.env' + kconfig_module_dirs_cmake_out = PurePath(args.sysbuild_kconfig_out).parent / \ + 'kconfig_module_dirs.cmake' with open(kconfig_module_dirs_out, 'w', encoding="utf-8") as fp: fp.write(kconfig_module_dirs) + with open(kconfig_module_dirs_cmake_out, 'w', encoding="utf-8") as fp: + fp.write(kconfig_module_dirs_cmake) + if args.kconfig_out: with open(args.kconfig_out, 'w', encoding="utf-8") as fp: fp.write(kconfig) diff --git a/share/sysbuild/Kconfig b/share/sysbuild/Kconfig index 1a9f36ac7779..b9cec010dd9d 100644 --- a/share/sysbuild/Kconfig +++ b/share/sysbuild/Kconfig @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 -source "$(KCONFIG_ENV_FILE)" - config BOARD string default "$(BOARD)" From e2e8824c04b0a4bb842e5593e3fc350311fadc1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 19 May 2025 15:42:20 +0200 Subject: [PATCH 0018/3334] [nrf fromlist] tests: drivers: timer: nrf_grtc_timer: Add stress test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add stress test that randomly starts and aborts multiple timers from various contexts. Test checks if timers do not expire prematurely. Upstream PR #: 87944 Signed-off-by: Krzysztof Chruściński (cherry picked from commit aa291d0a247e525c54c9d36cfbd1574b7d8e2789) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 17 ++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 32 +++ .../nrf54l15dk_nrf54l15_cpuflpr.overlay | 32 +++ tests/drivers/timer/nrf_grtc_timer/prj.conf | 6 + tests/drivers/timer/nrf_grtc_timer/src/main.c | 247 ++++++++++++++++++ .../timer/nrf_grtc_timer/testcase.yaml | 37 +-- 6 files changed, 355 insertions(+), 16 deletions(-) create mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay create mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 04580b71480b..7ae959267039 100644 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -2,4 +2,21 @@ &grtc { /delete-property/ child-owned-channels; + interrupts = <109 2>; +}; + +test_timer: &timer131 { + status = "okay"; + interrupts = <419 1>; +}; + +&timer130 { + status = "okay"; + prescaler = <0>; +}; + +/ { + chosen { + zephyr,cpu-load-counter = &timer130; + }; }; diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..7bcede529b0e --- /dev/null +++ b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&grtc { + interrupts = <228 2>; +}; + +test_timer: &timer21 { + status = "okay"; + interrupts = <203 1>; +}; + +&timer20 { + status = "okay"; + interrupts = <202 0>; +}; + +&timer00 { + status = "okay"; + prescaler = <0>; +}; + +/ { + chosen { + zephyr,cpu-load-counter = &timer00; + }; + + busy-sim { + compatible = "vnd,busy-sim"; + status = "okay"; + counter = <&timer20>; + }; +}; diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay new file mode 100644 index 000000000000..cfa72ed02736 --- /dev/null +++ b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +&grtc { + /*interrupts = <226 2>;*/ +}; + +test_timer: &timer21 { + status = "okay"; + /*interrupts = <203 2>;*/ +}; + +&timer20 { + status = "okay"; + interrupts = <202 0>; +}; + +&timer00 { + status = "okay"; + prescaler = <0>; +}; + +/ { + chosen { + zephyr,cpu-load-counter = &timer00; + }; + + busy-sim { + compatible = "vnd,busy-sim"; + status = "okay"; + counter = <&timer20>; + }; +}; diff --git a/tests/drivers/timer/nrf_grtc_timer/prj.conf b/tests/drivers/timer/nrf_grtc_timer/prj.conf index dea03477519d..93926f090b7e 100644 --- a/tests/drivers/timer/nrf_grtc_timer/prj.conf +++ b/tests/drivers/timer/nrf_grtc_timer/prj.conf @@ -1,2 +1,8 @@ CONFIG_ZTEST=y CONFIG_NRF_GRTC_TIMER=y +CONFIG_COUNTER=y +CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_XOSHIRO_RANDOM_GENERATOR=y +CONFIG_LOG_PRINTK=y +CONFIG_CPU_LOAD=y +CONFIG_CPU_LOAD_USE_COUNTER=y diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index cede54f026f1..e411eba83a0b 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -5,7 +5,15 @@ */ #include #include +#include +#include +#include +#include +#include +#include +#include #include +LOG_MODULE_REGISTER(test, 1); #define GRTC_SLEW_TICKS 10 #define NUMBER_OF_TRIES 2000 @@ -153,4 +161,243 @@ ZTEST(nrf_grtc_timer, test_timer_abort_in_compare_mode) z_nrf_grtc_timer_chan_free(channel); } +enum test_timer_state { + TIMER_IDLE, + TIMER_PREPARE, + TIMER_ACTIVE +}; + +enum test_ctx { + TEST_HIGH_PRI, + TEST_TIMER_CB, + TEST_THREAD +}; + +struct test_grtc_timer { + struct k_timer timer; + uint32_t ticks; + uint32_t expire; + uint32_t start_cnt; + uint32_t expire_cnt; + uint32_t abort_cnt; + uint32_t exp_expire; + int max_late; + int min_late; + int avg_late; + uint32_t early_cnt; + enum test_timer_state state; +}; + +static atomic_t test_active_cnt; +static struct test_grtc_timer timers[8]; +static uint32_t test_end; +static k_tid_t test_tid; +static volatile bool test_run; +static uint32_t ctx_cnt[3]; +static const char *const ctx_name[] = { "HIGH PRIO ISR", "TIMER CALLBACK", "THREAD" }; + +static bool stress_test_action(int ctx, int id) +{ + struct test_grtc_timer *timer = &timers[id]; + + ctx_cnt[ctx]++; + if (timer->state == TIMER_ACTIVE) { + /* Aborting soon to expire timers from higher interrupt priority may lead + * to test failures. + */ + if (ctx == 0 && (k_timer_remaining_get(&timer->timer) < 5)) { + return true; + } + + if (timer->abort_cnt < timer->expire_cnt / 2) { + bool any_active; + + timer->state = TIMER_PREPARE; + k_timer_stop(&timer->timer); + timer->abort_cnt++; + any_active = atomic_dec(&test_active_cnt) > 1; + timer->state = TIMER_IDLE; + + return any_active; + } + } else if (timer->state == TIMER_IDLE) { + int ticks = 10 + (sys_rand32_get() & 0x3F); + k_timeout_t t = K_TICKS(ticks); + + timer->state = TIMER_PREPARE; + timer->exp_expire = k_ticks_to_cyc_floor32(sys_clock_tick_get_32() + ticks); + timer->ticks = ticks; + k_timer_start(&timer->timer, t, K_NO_WAIT); + atomic_inc(&test_active_cnt); + timer->start_cnt++; + timer->state = TIMER_ACTIVE; + } + + return true; +} + +static void stress_test_actions(int ctx) +{ + uint32_t r = sys_rand32_get(); + int action_cnt = Z_MAX(r & 0x3, 1); + int tmr_id = (r >> 8) % ARRAY_SIZE(timers); + + /* Occasionally wake thread context from which timer actions are also executed. */ + if ((((r >> 2) & 0x3) == 0) || test_active_cnt < 2) { + LOG_DBG("ctx:%d thread wakeup", ctx); + k_wakeup(test_tid); + } + + for (int i = 0; i < action_cnt; i++) { + if (stress_test_action(ctx, tmr_id) == false) { + stress_test_action(ctx, tmr_id); + } + } +} + +static void timer_cb(struct k_timer *timer) +{ + struct test_grtc_timer *test_timer = CONTAINER_OF(timer, struct test_grtc_timer, timer); + uint32_t now = k_cycle_get_32(); + int diff = now - test_timer->exp_expire; + + atomic_dec(&test_active_cnt); + zassert_true(diff >= 0); + test_timer->max_late = MAX(diff, test_timer->max_late); + test_timer->min_late = MIN(diff, test_timer->min_late); + + if (test_timer->expire_cnt == 0) { + test_timer->avg_late = diff; + } else { + test_timer->avg_late = (test_timer->avg_late * test_timer->expire_cnt + diff) / + (test_timer->expire_cnt + 1); + } + + test_timer->expire_cnt++; + test_timer->state = TIMER_IDLE; + + if (test_run) { + stress_test_actions(TEST_TIMER_CB); + } +} + +static void counter_set(const struct device *dev, struct counter_alarm_cfg *cfg) +{ + int err; + uint32_t us = 150 + (sys_rand32_get() & 0x3F); + + cfg->ticks = counter_us_to_ticks(dev, us); + err = counter_set_channel_alarm(dev, 0, cfg); + zassert_equal(err, 0); +} + +static void counter_cb(const struct device *dev, uint8_t chan_id, uint32_t ticks, void *user_data) +{ + struct counter_alarm_cfg *config = user_data; + + if (test_run) { + stress_test_actions(TEST_HIGH_PRI); + counter_set(dev, config); + } +} + +static void report_progress(uint32_t start, uint32_t end) +{ + static uint32_t next_report; + static uint32_t step; + static uint32_t progress; + + if (next_report == 0) { + step = (end - start) / 10; + next_report = start + step; + } + + if (k_uptime_get_32() > next_report) { + next_report += step; + progress += 10; + printk("%d%%\r", progress); + } +} + +static void grtc_stress_test(bool busy_sim_en) +{ + static struct counter_alarm_cfg alarm_cfg; +#if DT_NODE_EXISTS(DT_NODELABEL(test_timer)) && DT_NODE_HAS_STATUS(DT_NODELABEL(test_timer), okay) + const struct device *const counter_dev = DEVICE_DT_GET(DT_NODELABEL(test_timer)); +#else + const struct device *const counter_dev = NULL; +#endif + uint32_t test_ms = 5000; + uint32_t test_start = k_uptime_get_32(); + uint32_t load; + + test_end = k_cycle_get_32() + k_ms_to_cyc_floor32(test_ms); + test_tid = k_current_get(); + + for (size_t i = 0; i < ARRAY_SIZE(timers); i++) { + k_timer_init(&timers[i].timer, timer_cb, NULL); + } + + if (IS_ENABLED(CONFIG_CPU_LOAD)) { + (void)cpu_load_get(true); + } + + if (counter_dev) { + counter_start(counter_dev); + } + + alarm_cfg.callback = counter_cb; + alarm_cfg.user_data = &alarm_cfg; + test_run = true; + + if (counter_dev) { + counter_set(counter_dev, &alarm_cfg); + } + + if (busy_sim_en) { + busy_sim_start(500, 200, 1000, 400, NULL); + } + + LOG_DBG("Starting test, will end at %d", test_end); + while (k_cycle_get_32() < test_end) { + report_progress(test_start, test_start + test_ms); + stress_test_actions(TEST_THREAD); + k_sleep(K_MSEC(test_ms)); + } + + load = IS_ENABLED(CONFIG_CPU_LOAD) ? cpu_load_get(true) : 0; + + test_run = false; + k_msleep(50); + + for (size_t i = 0; i < ARRAY_SIZE(timers); i++) { + zassert_equal(timers[i].state, TIMER_IDLE, "Unexpected timer %d state:%d", + i, timers[i].state); + TC_PRINT("Timer%d (%p)\r\n\tstart_cnt:%d abort_cnt:%d expire_cnt:%d\n", + i, &timers[i], timers[i].start_cnt, timers[i].abort_cnt, + timers[i].expire_cnt); + TC_PRINT("\tavarage late:%d ticks, max late:%d, min late:%d early:%d\n", + timers[i].avg_late, timers[i].max_late, timers[i].min_late, + timers[i].early_cnt); + } + + for (size_t i = 0; i < ARRAY_SIZE(ctx_cnt); i++) { + TC_PRINT("Context: %s executed %d times\n", ctx_name[i], ctx_cnt[i]); + } + TC_PRINT("CPU load during test:%d.%d\n", load / 10, load % 10); + + if (busy_sim_en) { + busy_sim_stop(); + } + + if (counter_dev) { + counter_stop(counter_dev); + } +} + +ZTEST(nrf_grtc_timer, test_stress) +{ + grtc_stress_test(false); +} + ZTEST_SUITE(nrf_grtc_timer, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index 6f4486de913c..140d9b222599 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -1,17 +1,22 @@ +common: + tags: + - drivers + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad + - nrf54h20dk/nrf54h20/cpuppr + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l15bsim/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuflpr + - ophelia4ev/nrf54l15/cpuapp + - ophelia4ev/nrf54l15/cpuflpr + integration_platforms: + - nrf54lm20dk/nrf54lm20a/cpuapp + timeout: 30 tests: - drivers.timer.nrf_grtc_timer: - tags: drivers - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr - - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuflpr - - nrf54l15bsim/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - - ophelia4ev/nrf54l15/cpuapp - - ophelia4ev/nrf54l15/cpuflpr - integration_platforms: - - nrf54lm20dk/nrf54lm20a/cpuapp - timeout: 30 + drivers.timer.nrf_grtc_timer: {} + drivers.timer.nrf_grtc_timer.no_assert: + extra_configs: + - CONFIG_ASSERT=n From 69358d4fc1eb7d548bb45d77351321e4aefee09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Fri, 29 Aug 2025 15:15:34 +0200 Subject: [PATCH 0019/3334] [nrf fromlist] tests: drivers: timer: nrf_grtc_timer: wait for coverage dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If test is to be run in coverage mode, wait for output to dump at the end of a failing testcase. Upstream PR #: 95162 Signed-off-by: Michał Stasiak (cherry picked from commit 3a4da33a15ab7cf58136ed1b89b6668f5a8f2ee1) --- tests/drivers/timer/nrf_grtc_timer/src/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index e411eba83a0b..bcb57519f3b4 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -393,6 +393,13 @@ static void grtc_stress_test(bool busy_sim_en) if (counter_dev) { counter_stop(counter_dev); } + +#ifdef CONFIG_COVERAGE + /* Wait a few seconds before exit, giving the test the + * opportunity to dump some output before coverage data gets emitted + */ + k_sleep(K_MSEC(5000)); +#endif } ZTEST(nrf_grtc_timer, test_stress) From 69a3093a3040cbae127c78a4721226c5c2f6e8b3 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Thu, 11 Sep 2025 09:16:02 +0200 Subject: [PATCH 0020/3334] [nrf fromtree] dts: nrf54h20: Add zephyr,pm-device-runtime-auto; to uart instances The uart driver for nRF54h20 doesn't call pm_device_runtime_enable(). During an uart driver init `pm_device_driver_init()` return early, because the `pm_device_is_powered()` returns `false`. Power domains, where uarts are instantiated, are disabled: `pm->domain->pm_base->state` is not equal to `PM_DEVICE_STATE_ACTIVE`. At the end of the day, an uart instance is left disabled. This is a workaround to make the uart usable when CONFIG_PM, CONFIG_PM_DEVICE and CONFIG_PM_DEVICE_RUNTIME are enabled. Signed-off-by: Piotr Pryga (cherry picked from commit eaede77351a75cca14acafc470eae6beb03d5852) --- dts/vendor/nordic/nrf54h20.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index b6bf93238b49..70dd5809ba0b 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -733,6 +733,7 @@ power-domains = <&gdpwr_fast_active_1>; endtx-stoptx-supported; frame-timeout-supported; + zephyr,pm-device-runtime-auto; }; spi121: spi@8e7000 { @@ -1141,6 +1142,7 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; + zephyr,pm-device-runtime-auto; }; i2c131: i2c@9a6000 { @@ -1276,6 +1278,7 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; + zephyr,pm-device-runtime-auto; }; i2c133: i2c@9b6000 { @@ -1322,6 +1325,7 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; + zephyr,pm-device-runtime-auto; }; dppic135: dppic@9c1000 { @@ -1410,6 +1414,7 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; + zephyr,pm-device-runtime-auto; }; i2c135: i2c@9c6000 { @@ -1456,6 +1461,7 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; + zephyr,pm-device-runtime-auto; }; dppic136: dppic@9d1000 { @@ -1591,6 +1597,7 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; + zephyr,pm-device-runtime-auto; }; tdm130: tdm@992000 { From 3fb675414a29edceaa3d7f672df23c1d1fb9f740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Fri, 12 Sep 2025 14:31:11 +0200 Subject: [PATCH 0021/3334] [nrf fromlist] manifest: update hal_nordic revision to integrate MDK 8.72.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New hal_nordic revision contains MDK 8.72.3 with changes for nRF54LV10A EngA SoC. Upstream PR #: 95907 Signed-off-by: Michał Stasiak (cherry picked from commit f52792e546abd93e3f55d86a8895dd1c71ae7a95) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index bcef02412e50..d0e76dbc5760 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 54f33f10a0b826174fb145f155afa61ce5a44b93 + revision: d0cef2363e572679deba0e796ef6c77f1188bb04 path: modules/hal/nordic groups: - hal From aae81ddfaa2a7a76c9ecd9541673a6c6329c6cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pelikan?= Date: Mon, 8 Sep 2025 12:45:10 +0200 Subject: [PATCH 0022/3334] [nrf fromtree] tests: kernel: sleep: Adjustments for NRF54H20 PPR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adjusting the max shortest ticks value for slow PPR core. Signed-off-by: Paweł Pelikan (cherry picked from commit 1192dbf24ad410e39652698e32f86d94c369d8de) --- tests/kernel/sleep/src/usleep.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/kernel/sleep/src/usleep.c b/tests/kernel/sleep/src/usleep.c index 8a234a27a199..a7c212e59b96 100644 --- a/tests/kernel/sleep/src/usleep.c +++ b/tests/kernel/sleep/src/usleep.c @@ -42,6 +42,11 @@ * loaded to its comparator. */ #define MAXIMUM_SHORTEST_TICKS 2 +#elif defined(CONFIG_SOC_NRF54H20_CPUPPR) && (CONFIG_SYS_CLOCK_TICKS_PER_SEC > 16384) +/* Similar for nRF54H20 cpuppr (RISC-V core), it has a slow CPU clock + * compared to other cores, causing the increased overhead. + */ +#define MAXIMUM_SHORTEST_TICKS 4 #else #define MAXIMUM_SHORTEST_TICKS 1 #endif From fbb5f210badc7b4bc4902c83d362778683054ba4 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Fri, 12 Sep 2025 12:18:52 +0200 Subject: [PATCH 0023/3334] [nrf fromtree] lib: os: clock: Fix possibly unitialized variable warning When building with high optimization level, the compiler thinks duration may be used initialized and warns as much. Let's initialize this variable always to ensure it does not happen and with it pacify the compiler. Signed-off-by: Alberto Escolar Piedras (cherry picked from commit 1d6da40624af7d53e4510b00adbbb48318b79465) --- lib/os/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/os/clock.c b/lib/os/clock.c index 0d5813f49fef..2b9968b2eeb4 100644 --- a/lib/os/clock.c +++ b/lib/os/clock.c @@ -158,7 +158,7 @@ int z_impl_sys_clock_nanosleep(int clock_id, int flags, const struct timespec *r { k_timepoint_t end; k_timeout_t timeout; - struct timespec duration; + struct timespec duration = {0, 0}; const bool update_rmtp = rmtp != NULL; const bool abstime = (flags & SYS_TIMER_ABSTIME) != 0; From eb3d6f1faa564cc214a88f22f1f6b14c5f103882 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Wed, 10 Sep 2025 13:05:10 +0200 Subject: [PATCH 0024/3334] [nrf fromtree] net: websocket: Allow using PSA APIs to calculate SHA1 The websocket used mbedtls functions to calculate the SHA1 needed. Update the code to use PSA crypto calls instead when the configuration CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT is enabled. This can be useful for applications which use TF-M since it only provides PSA crypto APIs. Also check the error code from the mbedtls_sha1 call since it can fail and it was not checked before. Signed-off-by: Georgios Vasilakis (cherry picked from commit 53b2802fff679a9666e006ffcf1b8ac034f228f5) --- subsys/net/lib/websocket/websocket.c | 45 ++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/subsys/net/lib/websocket/websocket.c b/subsys/net/lib/websocket/websocket.c index 2efb16bfac89..d682fd4b5dc2 100644 --- a/subsys/net/lib/websocket/websocket.c +++ b/subsys/net/lib/websocket/websocket.c @@ -34,7 +34,12 @@ LOG_MODULE_REGISTER(net_websocket, CONFIG_NET_WEBSOCKET_LOG_LEVEL); #include #include #include + +#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT +#include +#else #include +#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT */ #include "net_private.h" #include "sockets_internal.h" @@ -253,6 +258,10 @@ int websocket_connect(int sock, struct websocket_request *wreq, "Sec-WebSocket-Version: 13\r\n", NULL }; +#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT + psa_status_t psa_status; + size_t hash_length; +#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT */ fd = -1; @@ -280,8 +289,23 @@ int websocket_connect(int sock, struct websocket_request *wreq, ctx->http_cb = wreq->http_cb; ctx->is_client = 1; - mbedtls_sha1((const unsigned char *)&rnd_value, sizeof(rnd_value), - sec_accept_key); +#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT + psa_status = psa_hash_compute(PSA_ALG_SHA_1, (const uint8_t *)&rnd_value, sizeof(rnd_value), + sec_accept_key, sizeof(sec_accept_key), &hash_length); + if (psa_status != PSA_SUCCESS) { + NET_DBG("[%p] Cannot calculate sha1 (%d)", ctx, psa_status); + ret = -EPROTO; + goto out; + } +#else + ret = mbedtls_sha1((const unsigned char *)&rnd_value, sizeof(rnd_value), sec_accept_key); + if (ret != 0) { + NET_DBG("[%p] Cannot calculate sha1 (%d)", ctx, ret); + ret = -EPROTO; + goto out; + } +#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT */ + ret = base64_encode(sec_ws_key + sizeof("Sec-Websocket-Key: ") - 1, sizeof(sec_ws_key) - @@ -344,7 +368,22 @@ int websocket_connect(int sock, struct websocket_request *wreq, strncpy(key_accept + key_len, WS_MAGIC, olen); /* This SHA-1 value is then checked when we receive the response */ - mbedtls_sha1(key_accept, olen + key_len, sec_accept_key); +#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT + psa_status = psa_hash_compute(PSA_ALG_SHA_1, (const uint8_t *)key_accept, olen + key_len, + sec_accept_key, sizeof(sec_accept_key), &hash_length); + if (psa_status != PSA_SUCCESS) { + NET_DBG("[%p] Cannot calculate sha1 (%d)", ctx, psa_status); + ret = -EPROTO; + goto out; + } +#else + ret = mbedtls_sha1(key_accept, olen + key_len, sec_accept_key); + if (ret != 0) { + NET_DBG("[%p] Cannot calculate sha1 (%d)", ctx, ret); + ret = -EPROTO; + goto out; + } +#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT */ ret = http_client_req(sock, &req, timeout, ctx); if (ret < 0) { From cc061607c4c100e224cf6ae1e5da5bbab69f9ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Wed, 10 Sep 2025 13:41:12 +0200 Subject: [PATCH 0025/3334] [nrf fromtree] soc: nordic: uicr: Fix dependency issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although not reproducible locally, it has been observed in CI that the uicr image will not always be the last image to be run. To ensure it is the last image to be run we have it depend on the 'image' image when defined. The uicr image is generated based on all other images in the build and must therefore run last. Signed-off-by: Sebastian Bøe (cherry picked from commit 32c67762568c1aeb4484c2abf621f3f11f0ccf78) --- soc/nordic/common/uicr/sysbuild.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/soc/nordic/common/uicr/sysbuild.cmake b/soc/nordic/common/uicr/sysbuild.cmake index 167ac7c64a2d..9cafd261036d 100644 --- a/soc/nordic/common/uicr/sysbuild.cmake +++ b/soc/nordic/common/uicr/sysbuild.cmake @@ -8,4 +8,8 @@ ExternalZephyrProject_Add( # Ensure UICR is configured and built after the default image so EDT/ELFs exist. sysbuild_add_dependencies(CONFIGURE uicr ${DEFAULT_IMAGE}) + add_dependencies(uicr ${DEFAULT_IMAGE}) +if(DEFINED image) + add_dependencies(uicr ${image}) +endif() From 89948709e8fd6f0a05c41762d4c886efd03f4f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Laso=C5=84czyk?= Date: Tue, 16 Sep 2025 11:37:56 +0200 Subject: [PATCH 0026/3334] [nrf fromtree] drivers: audio: Fix nrfx_pdm compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes drv_data structure handling in various configuration. Signed-off-by: Karol Lasończyk (cherry picked from commit afff286f74f0de99246b1797af846db21e6678ce) --- drivers/audio/dmic_nrfx_pdm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index f0162fc5ef8b..c2c80a7414c1 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -668,11 +668,12 @@ static int dmic_nrfx_pdm_read(const struct device *dev, static void init_clock_manager(const struct device *dev) { - struct dmic_nrfx_pdm_drv_data *drv_data = dev->data; #if DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) + struct dmic_nrfx_pdm_drv_data *drv_data = dev->data; drv_data->audiopll_dev = DEVICE_DT_GET(NODE_AUDIO_AUXPLL); #elif CONFIG_CLOCK_CONTROL_NRF clock_control_subsys_t subsys; + struct dmic_nrfx_pdm_drv_data *drv_data = dev->data; #if NRF_CLOCK_HAS_HFCLKAUDIO const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; From c56cab3f095cd00643751966ff8e2a210a0b64a5 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Tue, 9 Sep 2025 15:29:25 +0200 Subject: [PATCH 0027/3334] [nrf fromlist] soc: nordic: nrf54h: generate PERIPHCONF entries based on devicetree Upstream PR #: 95915 Add build system support for populating the PERIPHCONF (global domain peripheral configuration), based on nodes and properties found in the devicetree. This should make it so all samples and tests that were broken by the move to IronSide SE now function correctly without workarounds or manual steps. When enabled, a new python script called gen_periphconf_entries.py is run when building. The script iterates over nodes and properties in the devicetree and generates a C file called periphconf_entries_generated.c in the build directory, which is added as a source file. The C file uses the macros from uicr.h to configure the global domain according to the devicetree. The PERIPHCONF entry generation is enabled by default when building for nrf54h20dk/nrf54h20/cpuapp and nrf54h20dk/nrf54h20/cpurad. It will also be used on nrf9280 soon, therefore it is placed in the common uicr directory. This new feature does the same job as nrf-regtool did when building for nrf54h20 before, and is compatible by the bindings that were used by nrf-regtool. Signed-off-by: Jonathan Nilsen (cherry picked from commit e3ae9fabfca2ea01718ef852ae45410026d4f646) --- soc/nordic/common/uicr/CMakeLists.txt | 16 + soc/nordic/common/uicr/Kconfig | 9 + .../common/uicr/gen_periphconf_entries.py | 658 ++++++++ soc/nordic/common/uicr/gen_uicr.py | 33 + soc/nordic/common/uicr/periphconf/__init__.py | 6 + soc/nordic/common/uicr/periphconf/builder.py | 1460 +++++++++++++++++ 6 files changed, 2182 insertions(+) create mode 100644 soc/nordic/common/uicr/gen_periphconf_entries.py create mode 100644 soc/nordic/common/uicr/periphconf/__init__.py create mode 100644 soc/nordic/common/uicr/periphconf/builder.py diff --git a/soc/nordic/common/uicr/CMakeLists.txt b/soc/nordic/common/uicr/CMakeLists.txt index 1ec3a35c5665..9d5deec52d57 100644 --- a/soc/nordic/common/uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/CMakeLists.txt @@ -4,3 +4,19 @@ if(CONFIG_NRF_PERIPHCONF_SECTION) zephyr_linker_sources(SECTIONS uicr.ld) endif() + +if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) + set(periphconf_entries_c_file ${PROJECT_BINARY_DIR}/periphconf_entries_generated.c) + execute_process( + COMMAND + ${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE} + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/gen_periphconf_entries.py + --soc ${CONFIG_SOC} + --in-edt-pickle ${EDT_PICKLE} + --out-periphconf-source ${periphconf_entries_c_file} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMAND_ERROR_IS_FATAL ANY + ) + zephyr_sources(${periphconf_entries_c_file}) + message(STATUS "Generated ${periphconf_entries_c_file} from ${EDT_PICKLE}") +endif() diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index 3c4c6c8219b6..73b5e5cf2d1c 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -9,3 +9,12 @@ config NRF_PERIPHCONF_SECTION help Include static global domain peripheral initialization values from the build in a dedicated section in the devnull region. + +config NRF_PERIPHCONF_GENERATE_ENTRIES + bool "Generate PERIPHCONF entries source file" + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + depends on NRF_PERIPHCONF_SECTION + depends on NRF_PLATFORM_HALTIUM + help + Generate a C file containing PERIPHCONF entries based on the + device configuration in the devicetree. diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py new file mode 100644 index 000000000000..e70e56acc1f3 --- /dev/null +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -0,0 +1,658 @@ +""" +Copyright (c) 2025 Nordic Semiconductor ASA +SPDX-License-Identifier: Apache-2.0 +""" + +from __future__ import annotations + +import argparse +import enum +import os +import pickle +import sys +from pathlib import Path +from typing import Any + +try: + ZEPHYR_BASE = Path(os.environ["ZEPHYR_BASE"]).resolve() +except KeyError: + sys.exit("Set the environment variable 'ZEPHYR_BASE' to point to the zephyr root directory") + +# Add packages that are located in zephyr itself to the python path so we can import them below +sys.path.insert(0, str(ZEPHYR_BASE / "scripts/dts/python-devicetree/src")) +sys.path.insert(0, str(ZEPHYR_BASE / "soc/nordic/common/uicr")) + +from periphconf.builder import ( + Ctrlsel, + FixedPPIMap, + GpiosProp, + Node, + NrfCompChannel, + NrfFun, + NrfPsel, + NrfSaadcChannel, + PeriphconfBuilder, + ProcessorId, + SocLookupTables, + dt_processor_id, +) + +# These peripherals are special cases that don't fit the general rules we use to generate +# PERIPHCONF entries based on the devicetree. +NODELABEL_TO_KWARGS = { + # Channel links on this node do not result in PPIB connections, because the *-links properties + # are ambiguous. Instead, the PPIB connections are configured by the DPPICs connected to this. + "dppic130": {"add_ppib_channel_links": False}, + # The interrupts for this node are not managed in IRQMAP. + "canpll": {"has_irq_mapping": False}, +} + + +def get_additional_node_kwargs(node: Node) -> dict[str, Any]: + additional_kwargs = {} + for label in node.labels: + additional_kwargs.update(NODELABEL_TO_KWARGS.get(label, {})) + return additional_kwargs + + +class Soc(enum.Enum): + """Names of SoCs supported by this script""" + + NRF54H20 = "nrf54h20" + NRF9280 = "nrf9280" + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser( + allow_abbrev=False, + description=( + "Generate a C source file containing entries for the PERIPHCONF blob based on the " + "device configuration in devicetree." + ), + ) + parser.add_argument( + "-v", + "--verbose", + default=0, + action="count", + help="Print verbose output such as debug information.", + ) + parser.add_argument( + "--soc", + required=True, + choices=[soc.value for soc in Soc], + help=( + "SoC to generate PERIPHCONF macros for. " + "Used to look up soc specific hardware information" + ), + ) + parser.add_argument( + "--in-edt-pickle", + type=argparse.FileType("rb"), + required=True, + help="Path to the pickled edtlib.EDT object with devicetree contents.", + ) + parser.add_argument( + "--out-periphconf-source", + type=argparse.FileType("w", encoding="utf-8"), + required=True, + help="Path to write the generated PERIPHCONF C source file to.", + ) + return parser.parse_args() + + +def main() -> None: + args = parse_args() + dt = pickle.load(args.in_edt_pickle) + processor = dt_processor_id(dt) + lookup_tables = lookup_tables_get(Soc(args.soc)) + builder = PeriphconfBuilder(dt, lookup_tables) + + # Application local peripherals + if processor == ProcessorId.APPLICATION: + for node in dt.label2node["cpuapp_peripherals"].children.values(): + builder.add_local_peripheral_cfg(node, **get_additional_node_kwargs(node)) + + # Radio local peripherals + if processor == ProcessorId.RADIOCORE: + for node in dt.label2node["cpurad_peripherals"].children.values(): + builder.add_local_peripheral_cfg(node, **get_additional_node_kwargs(node)) + + # Global domain peripherals + for node in dt.label2node["global_peripherals"].children.values(): + builder.add_global_peripheral_cfg(node, **get_additional_node_kwargs(node)) + + # Add pins referenced by 'gpios' properties on non-peripheral nodes, for example + # buttons and leds. We only add SPU configurations for these and not CTRLSEL, + # to avoid false CTRLSEL conflicts for things like PWM leds. + for node in dt.nodes: + builder.add_gpio_spu_permissions(node) + + script_name = Path(__file__).resolve().relative_to(ZEPHYR_BASE) + generated_by = f"Generated by {script_name}" + + generated_source = builder.build_generated_source(generated_by) + args.out_periphconf_source.write(generated_source) + + +def lookup_tables_get(soc: Soc) -> SocLookupTables: + if soc == Soc.NRF54H20: + ctrlsel_lookup = { + # CAN120 + 0x5F8D_8000: { + # P2 + NrfPsel(fun=NrfFun.CAN_TX, port=2, pin=9): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.CAN_RX, port=2, pin=8): Ctrlsel.CAN_PWM_I3C, + # P9 + NrfPsel(fun=NrfFun.CAN_TX, port=9, pin=5): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.CAN_RX, port=9, pin=4): Ctrlsel.CAN, + }, + # PWM120 + 0x5F8E_4000: { + # P2 + NrfPsel(fun=NrfFun.PWM_OUT0, port=2, pin=4): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT1, port=2, pin=5): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT2, port=2, pin=6): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT3, port=2, pin=7): Ctrlsel.CAN_PWM_I3C, + # P6 + NrfPsel(fun=NrfFun.PWM_OUT0, port=6, pin=6): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT1, port=6, pin=7): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT2, port=6, pin=8): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT3, port=6, pin=9): Ctrlsel.CAN_PWM_I3C, + # P7 + NrfPsel(fun=NrfFun.PWM_OUT0, port=7, pin=0): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT1, port=7, pin=1): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT2, port=7, pin=6): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT3, port=7, pin=7): Ctrlsel.CAN_PWM_I3C, + }, + # PWM130 + 0x5F9A_4000: { + # P9 + NrfPsel(fun=NrfFun.PWM_OUT0, port=9, pin=2): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT1, port=9, pin=3): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT2, port=9, pin=4): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT3, port=9, pin=5): Ctrlsel.CAN_PWM_I3C, + }, + # SPIM130/SPIS130/TWIM130/TWIS130/UARTE130 + 0x5F9A_5000: { + # SPIM mappings + NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=9, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=4): Ctrlsel.SERIAL0, + # SPIS mappings + NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_MOSI, port=9, pin=2): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_CSN, port=9, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_SCK, port=9, pin=4): Ctrlsel.SERIAL0, + # TWIM mappings + NrfPsel(fun=NrfFun.TWIM_SDA, port=9, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.TWIM_SCL, port=9, pin=4): Ctrlsel.SERIAL0, + # TWIS mappings + NrfPsel(fun=NrfFun.TWIS_SDA, port=9, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.TWIS_SCL, port=9, pin=4): Ctrlsel.SERIAL0, + # UARTÈ mappings + NrfPsel(fun=NrfFun.UART_TX, port=9, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RX, port=9, pin=4): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.UART_CTS, port=9, pin=2): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RTS, port=9, pin=3): Ctrlsel.SERIAL0, + }, + # SPIM131/SPIS131/TWIM131/TWIS131/UARTE131 + 0x5F9A_6000: { + # SPIM mappings + NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.CAN_TDM_SERIAL2, + GpiosProp(name="cs-gpios", port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, + # SPIS mappings + NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.SPIS_MOSI, port=9, pin=2): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.SPIS_CSN, port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.SPIS_SCK, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, + # TWIM mappings + NrfPsel(fun=NrfFun.TWIM_SDA, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TWIM_SCL, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, + # TWIS mappings + NrfPsel(fun=NrfFun.TWIS_SDA, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TWIS_SCL, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, + # UARTÈ mappings + NrfPsel(fun=NrfFun.UART_TX, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.UART_RX, port=9, pin=1): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_CTS, port=9, pin=2): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.UART_RTS, port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + }, + # VPR121 (FLPR) + 0x5F8D_4000: { + # P1 + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=8): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=9): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=10): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=11): Ctrlsel.VPR_GRC, + # P2 + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=0): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=1): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=2): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=3): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=4): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=5): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=6): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=7): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=8): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=9): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=10): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=11): Ctrlsel.VPR_GRC, + # P6 + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=0): Ctrlsel.VPR_GRC, + # (pin 1-2 are not connected with VIO) + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=3): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=4): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=5): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=6): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=7): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=8): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=9): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=10): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=11): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=12): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=6, pin=13): Ctrlsel.VPR_GRC, + # P7 + NrfPsel(fun=NrfFun.IGNORE, port=7, pin=0): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=7, pin=1): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=7, pin=2): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=7, pin=3): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=7, pin=4): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=7, pin=5): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=7, pin=6): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=7, pin=7): Ctrlsel.VPR_GRC, + # P9 + NrfPsel(fun=NrfFun.IGNORE, port=9, pin=0): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=9, pin=1): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=9, pin=2): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=9, pin=3): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=9, pin=4): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=9, pin=5): Ctrlsel.VPR_GRC, + }, + # SPIS120 + 0x5F8E_5000: { + NrfPsel(fun=NrfFun.SPIS_MISO, port=6, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_MOSI, port=6, pin=4): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_CSN, port=6, pin=9): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_SCK, port=6, pin=0): Ctrlsel.SERIAL0, + }, + # SPIM120/UARTE120 + 0x5F8E_6000: { + # SPIM P6 mappings + NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=8): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=6, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=1): Ctrlsel.SERIAL0, + # SPIM P7 mappings + NrfPsel(fun=NrfFun.SPIM_MOSI, port=7, pin=7): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=7, pin=6): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=7, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=7, pin=3): Ctrlsel.SERIAL0, + # SPIM P2 mappings + NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=6): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=5): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=2, pin=7): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=3): Ctrlsel.SERIAL0, + # UARTÈ P6 mappings + NrfPsel(fun=NrfFun.UART_TX, port=6, pin=8): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_CTS, port=6, pin=7): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RX, port=6, pin=6): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RTS, port=6, pin=5): Ctrlsel.SERIAL0, + # UARTÈ P7 mappings + NrfPsel(fun=NrfFun.UART_TX, port=7, pin=7): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_CTS, port=7, pin=6): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RX, port=7, pin=4): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RTS, port=7, pin=5): Ctrlsel.SERIAL0, + # UARTÈ P2 mappings + NrfPsel(fun=NrfFun.UART_TX, port=2, pin=6): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_CTS, port=2, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RX, port=2, pin=4): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RTS, port=2, pin=7): Ctrlsel.SERIAL0, + }, + # SPIM121 + 0x5F8E_7000: { + # SPIM P6 mappings + NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=13): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=12): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=6, pin=10): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=2): Ctrlsel.SERIAL0, + # SPIM P7 mappings + NrfPsel(fun=NrfFun.SPIM_MOSI, port=7, pin=1): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.SPIS_MISO, port=7, pin=1): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.SPIM_MISO, port=7, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.SPIS_MOSI, port=7, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, + GpiosProp(name="cs-gpios", port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.SPIS_CSN, port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.SPIM_SCK, port=7, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.SPIS_SCK, port=7, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, + # SPIM P2 mappings + NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=11): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=10): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=2, pin=8): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=2): Ctrlsel.SERIAL0, + }, + # EXMIF + 0x5F09_5000: { + NrfPsel(fun=NrfFun.EXMIF_CK, port=6, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_RWDS, port=6, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_CS0, port=6, pin=3): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_DQ7, port=6, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_DQ1, port=6, pin=5): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_DQ6, port=6, pin=6): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_DQ0, port=6, pin=7): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_DQ5, port=6, pin=8): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_DQ3, port=6, pin=9): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_DQ2, port=6, pin=10): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_DQ4, port=6, pin=11): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.EXMIF_CS1, port=6, pin=13): Ctrlsel.EXMIF_RADIO_SERIAL1, + }, + # VPR130 (PPR) + 0x5F90_8000: { + # P0 + NrfPsel(fun=NrfFun.IGNORE, port=0, pin=4): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=0, pin=5): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=0, pin=6): Ctrlsel.VPR_GRC, + NrfPsel(fun=NrfFun.IGNORE, port=0, pin=7): Ctrlsel.VPR_GRC, + }, + # TDM130 + 0x5F99_2000: { + # TDM P1 mappings + NrfPsel(fun=NrfFun.TDM_MCK, port=1, pin=2): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SCK_M, port=1, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SCK_S, port=1, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SDOUT, port=1, pin=4): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SDIN, port=1, pin=5): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=1, pin=6): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=1, pin=6): Ctrlsel.CAN_TDM_SERIAL2, + # TDM P2 mappings + NrfPsel(fun=NrfFun.TDM_MCK, port=2, pin=0): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SCK_M, port=2, pin=1): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SCK_S, port=2, pin=1): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SDOUT, port=2, pin=9): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SDIN, port=2, pin=10): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=2, pin=11): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=2, pin=11): Ctrlsel.CAN_TDM_SERIAL2, + }, + # TDM131 + 0x5F99_7000: { + # TDM P1 mappings + NrfPsel(fun=NrfFun.TDM_MCK, port=1, pin=0): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SCK_M, port=1, pin=1): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SCK_S, port=1, pin=1): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SDOUT, port=1, pin=9): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SDIN, port=1, pin=10): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=1, pin=11): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=1, pin=11): Ctrlsel.CAN_TDM_SERIAL2, + # TDM P2 mappings + NrfPsel(fun=NrfFun.TDM_MCK, port=2, pin=2): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SCK_M, port=2, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SCK_S, port=2, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SDOUT, port=2, pin=4): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_SDIN, port=2, pin=6): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=2, pin=7): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=2, pin=7): Ctrlsel.CAN_TDM_SERIAL2, + }, + # GPIOTE0 (RAD) + 0x5302_7000: { + # P1 + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=4): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=5): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=6): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=7): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=8): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=9): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=10): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=1, pin=11): Ctrlsel.CAN, + # P2 + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=0): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=1): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=2): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=3): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=4): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=5): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=6): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=7): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=8): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=9): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=10): Ctrlsel.CAN, + NrfPsel(fun=NrfFun.IGNORE, port=2, pin=11): Ctrlsel.CAN, + }, + } + elif soc == Soc.NRF9280: + ctrlsel_lookup = { + # PWM120 + 0x5F8E_4000: { + # P2 + NrfPsel(fun=NrfFun.PWM_OUT0, port=2, pin=0): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT1, port=2, pin=1): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT2, port=2, pin=2): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT3, port=2, pin=3): Ctrlsel.CAN_PWM_I3C, + # P6 + NrfPsel(fun=NrfFun.PWM_OUT0, port=6, pin=0): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT0, port=6, pin=6): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT1, port=6, pin=1): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT1, port=6, pin=7): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT2, port=6, pin=2): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT2, port=6, pin=8): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT3, port=6, pin=3): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT3, port=6, pin=9): Ctrlsel.CAN_PWM_I3C, + }, + # SPIM120/UARTE120 + 0x5F8E_6000: { + # SPIM P2 mappings + GpiosProp(name="cs-gpios", port=2, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=4): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=0): Ctrlsel.SERIAL0, + # SPIM P6 mappings + GpiosProp(name="cs-gpios", port=6, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=8): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=1): Ctrlsel.SERIAL0, + # UARTE P2 mappings + NrfPsel(fun=NrfFun.UART_CTS, port=2, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RTS, port=2, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RX, port=2, pin=2): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_TX, port=2, pin=4): Ctrlsel.SERIAL0, + # UARTE P6 mappings + NrfPsel(fun=NrfFun.UART_CTS, port=6, pin=7): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RTS, port=6, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RX, port=6, pin=6): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_TX, port=6, pin=8): Ctrlsel.SERIAL0, + }, + # SPIM121 + 0x5F8E_7000: { + # P2 + GpiosProp(name="cs-gpios", port=2, pin=6): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=8): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=9): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=1): Ctrlsel.SERIAL0, + # P6 + GpiosProp(name="cs-gpios", port=6, pin=10): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=12): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=13): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=2): Ctrlsel.SERIAL0, + }, + # PWM130 + 0x5F9A_4000: { + NrfPsel(fun=NrfFun.PWM_OUT0, port=9, pin=2): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT1, port=9, pin=3): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT2, port=9, pin=4): Ctrlsel.CAN_PWM_I3C, + NrfPsel(fun=NrfFun.PWM_OUT3, port=9, pin=5): Ctrlsel.CAN_PWM_I3C, + }, + # SPIM130/SPIS130/TWIM130/TWIS130/UARTE130 + 0x5F9A_5000: { + # SPIM mappings + GpiosProp(name="cs-gpios", port=9, pin=1): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=0): Ctrlsel.SERIAL0, + # SPIS mappings + NrfPsel(fun=NrfFun.SPIS_CSN, port=9, pin=1): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_MOSI, port=9, pin=2): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIS_SCK, port=9, pin=0): Ctrlsel.SERIAL0, + # TWIM mappings + NrfPsel(fun=NrfFun.TWIM_SCL, port=9, pin=0): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.TWIM_SDA, port=9, pin=3): Ctrlsel.SERIAL0, + # UARTE mappings + NrfPsel(fun=NrfFun.UART_CTS, port=9, pin=2): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RTS, port=9, pin=1): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RX, port=9, pin=4): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_TX, port=9, pin=3): Ctrlsel.SERIAL0, + }, + } + else: + raise NotImplementedError(f"No CTRLSEL table exists for soc {soc}") + + # Entries below this are common to all supported socs at the time of writing. + + adc_channel_pin_lookup = { + # SAADC + 0x5F98_2000: { + NrfSaadcChannel.AIN0: (1, 0), + NrfSaadcChannel.AIN1: (1, 1), + NrfSaadcChannel.AIN2: (1, 2), + NrfSaadcChannel.AIN3: (1, 3), + NrfSaadcChannel.AIN4: (1, 4), + NrfSaadcChannel.AIN5: (1, 5), + NrfSaadcChannel.AIN6: (1, 6), + NrfSaadcChannel.AIN7: (1, 7), + NrfSaadcChannel.AIN8: (9, 0), + NrfSaadcChannel.AIN9: (9, 1), + NrfSaadcChannel.AIN10: (9, 2), + NrfSaadcChannel.AIN11: (9, 3), + NrfSaadcChannel.AIN12: (9, 4), + NrfSaadcChannel.AIN13: (9, 5), + } + } + comp_channel_pin_lookup = { + # COMP/LPCOMP + 0x5F98_3000: { + NrfCompChannel.AIN0: (1, 0), + NrfCompChannel.AIN1: (1, 1), + NrfCompChannel.AIN2: (1, 2), + NrfCompChannel.AIN3: (1, 3), + NrfCompChannel.AIN4: (1, 4), + NrfCompChannel.AIN5: (1, 5), + NrfCompChannel.AIN6: (1, 6), + NrfCompChannel.AIN7: (1, 7), + NrfCompChannel.AIN8: (9, 0), + NrfCompChannel.AIN9: (9, 1), + } + } + spu_instances = [ + ("SPU110", 0x5F08_0000), + ("SPU111", 0x5F09_0000), + ("SPU120", 0x5F8C_0000), + ("SPU121", 0x5F8D_0000), + ("SPU122", 0x5F8E_0000), + ("SPU130", 0x5F90_0000), + ("SPU131", 0x5F92_0000), + ("SPU132", 0x5F98_0000), + ("SPU133", 0x5F99_0000), + ("SPU134", 0x5F9A_0000), + ("SPU135", 0x5F9B_0000), + ("SPU136", 0x5F9C_0000), + ("SPU137", 0x5F9D_0000), + ] + dppics = { + "DPPIC120": 0x5F8E_1000, + "DPPIC130": 0x5F92_2000, + "DPPIC131": 0x5F98_1000, + "DPPIC132": 0x5F99_1000, + "DPPIC133": 0x5F9A_1000, + "DPPIC134": 0x5F9B_1000, + "DPPIC135": 0x5F9C_1000, + "DPPIC136": 0x5F9D_1000, + } + ppib_instances = [ + ("PPIB110", 0x5F09_8000), + ("PPIB120", 0x5F8E_E000), + ("PPIB121", 0x5F8E_F000), + ("PPIB130", 0x5F92_5000), + ("PPIB131", 0x5F92_6000), + ("PPIB132", 0x5F98_D000), + ("PPIB133", 0x5F99_D000), + ("PPIB134", 0x5F9A_D000), + ("PPIB135", 0x5F9B_D000), + ("PPIB136", 0x5F9C_D000), + ("PPIB137", 0x5F9D_D000), + ] + ppib_name_to_addr = dict(ppib_instances) + dppic_to_ppib_connections = { + dppics["DPPIC120"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB121"], + channel_map=range(0, 8), + ), + dppics["DPPIC131"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB132"], + channel_map=range(0, 8), + ), + dppics["DPPIC132"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB133"], + channel_map=range(0, 8), + ), + dppics["DPPIC133"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB134"], + channel_map=range(0, 8), + ), + dppics["DPPIC134"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB135"], + channel_map=range(0, 8), + ), + dppics["DPPIC135"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB136"], + channel_map=range(0, 8), + ), + dppics["DPPIC136"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB137"], + channel_map=range(0, 8), + ), + } + ppib_to_ppib_connections = { + ppib_name_to_addr["PPIB132"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB130"], + channel_map=range(0, 8), + ), + ppib_name_to_addr["PPIB133"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB130"], + channel_map=range(8, 16), + ), + ppib_name_to_addr["PPIB134"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB130"], + channel_map=range(16, 24), + ), + ppib_name_to_addr["PPIB135"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB130"], + channel_map=range(24, 32), + ), + ppib_name_to_addr["PPIB136"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB131"], + channel_map=range(0, 8), + ), + ppib_name_to_addr["PPIB137"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB131"], + channel_map=range(8, 16), + ), + ppib_name_to_addr["PPIB121"]: FixedPPIMap( + connected_to=ppib_name_to_addr["PPIB131"], + channel_map=range(16, 24), + ), + } + return SocLookupTables( + ctrlsel_lookup=ctrlsel_lookup, + adc_channel_pin_lookup=adc_channel_pin_lookup, + comp_channel_pin_lookup=comp_channel_pin_lookup, + dppic_to_ppib_connections=dppic_to_ppib_connections, + ppib_to_ppib_connections=ppib_to_ppib_connections, + spu_instances=spu_instances, + ppib_instances=ppib_instances, + ) + + +if __name__ == "__main__": + main() diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 78422e4312cd..ce69cd7e80a3 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -426,6 +426,7 @@ def main() -> None: def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes: combined_periphconf = [] + ipcmap_index = 0 for in_file in elf_files: elf = ELFFile(in_file) @@ -436,6 +437,7 @@ def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes conf_section_data = conf_section.data() num_entries = len(conf_section_data) // PERIPHCONF_ENTRY_SIZE periphconf = (PeriphconfEntry * num_entries).from_buffer_copy(conf_section_data) + ipcmap_index = adjust_ipcmap_entries(periphconf, offset_index=ipcmap_index) combined_periphconf.extend(periphconf) combined_periphconf.sort(key=lambda e: e.regptr) @@ -459,5 +461,36 @@ def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes return bytes(final_periphconf) +# This workaround is currently needed to avoid conflicts in IPCMAP whenever more than +# one image uses IPCMAP, because at the moment each image has no way of knowing which +# IPCMAP channel indices it should use for the configuration it generates locally. +# +# What the workaround does is adjust all IPCMAP entries found in the periphconf by the +# given index offset. +# +# The workaround assumes that IPCMAP entries are allocated sequentially starting from 0 +# in each image, it will probably not work for arbitrary IPCMAP entries. +def adjust_ipcmap_entries(periphconf: c.Array[PeriphconfEntry], offset_index: int) -> int: + max_ipcmap_index = offset_index + + for entry in sorted(periphconf, key=lambda e: e.regptr): + if IPCMAP_CHANNEL_START_ADDR <= entry.regptr < IPCMAP_CHANNEL_END_ADDR: + entry.regptr += offset_index * IPCMAP_CHANNEL_SIZE + entry_ipcmap_index = (entry.regptr - IPCMAP_CHANNEL_START_ADDR) // IPCMAP_CHANNEL_SIZE + max_ipcmap_index = max(max_ipcmap_index, entry_ipcmap_index) + + return max_ipcmap_index + 1 + + +# Size of each IPCMAP.CHANNEL[i] +IPCMAP_CHANNEL_SIZE = 8 +# Number of entries in IPCMAP.CHANNEL +IPCMAP_CHANNEL_COUNT = 16 +# Address of IPCMAP.CHANNEL[0] +IPCMAP_CHANNEL_START_ADDR = 0x5F92_3000 + 256 * 4 +# Address of IPCMAP.CHANNEL[channel count] + 1 +IPCMAP_CHANNEL_END_ADDR = IPCMAP_CHANNEL_START_ADDR + IPCMAP_CHANNEL_SIZE * IPCMAP_CHANNEL_COUNT + + if __name__ == "__main__": main() diff --git a/soc/nordic/common/uicr/periphconf/__init__.py b/soc/nordic/common/uicr/periphconf/__init__.py new file mode 100644 index 000000000000..fe8f6fbacece --- /dev/null +++ b/soc/nordic/common/uicr/periphconf/__init__.py @@ -0,0 +1,6 @@ +""" +Copyright (c) 2025 Nordic Semiconductor ASA +SPDX-License-Identifier: Apache-2.0 +""" + +# empty diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py new file mode 100644 index 000000000000..98c2bdfb0a0a --- /dev/null +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -0,0 +1,1460 @@ +""" +Copyright (c) 2025 Nordic Semiconductor ASA +SPDX-License-Identifier: Apache-2.0 +""" + +from __future__ import annotations + +import enum +import logging +import re +from collections.abc import Iterable, Iterator, Mapping +from dataclasses import dataclass +from functools import cached_property +from itertools import islice +from typing import ( + Any, + Literal, + NamedTuple, +) + +# edtlib classes used in this module. +# Defined this way as placeholders so type checking for these could be added later. +EDT = Any +Node = Any +PinCtrl = Any +Property = Any + +# Status values that indicate ownership either by the processor or a child processor +STATUS_OWNED = ("okay", "reserved") + +# Compatibles of global peripherals that should not be assigned to current core. +SKIP_SPU_PERIPH_PERM_COMPATS = { + "nordic,nrf-bellboard-tx", + "nordic,nrf-bellboard-rx", + "nordic,nrf-clic", + "nordic,nrf-dppic-global", + "nordic,nrf-gpio", + "nordic,nrf-gpiote", + "nordic,nrf-grtc", + "nordic,nrf-ipct-global", + "nordic,nrf-temp", + "nordic,nrf-vevif-task-tx", + "nordic,nrf-vevif-task-rx", +} + +# Compatibles of global peripherals that should be assigned to the current core but do not have DMA +NO_DMA_COMPATS = { + "nordic,nrf-auxpll", + "nordic,nrf-comp", + "nordic,nrf-egu", + "nordic,nrf-exmif", + "nordic,nrf-lpcomp", + "nordic,nrf-qdec", + "nordic,nrf-timer", + "nordic,nrf-rtc", + "nordic,nrf-wdt", + # VPRs have a PERM DMASEC setting, but PPR applications currently do not work as intended when + # setting it to secure. + "nordic,nrf-vpr-coprocessor", +} + + +class BuilderError(RuntimeError): + """Generic runtime error raised by the PeriphconfBuilder""" + + ... + + +class BadDevicetreeError(BuilderError): + """Error raised when the devicetree is misconfigured + or if assumptions about the devicetree are not met. + """ + + ... + + +def _init_logger() -> logging.Logger: + formatter = logging.Formatter("{message}", style="{") + handler = logging.StreamHandler() + handler.setFormatter(formatter) + + logger = logging.getLogger("periphconf") + logger.setLevel(logging.ERROR) + logger.addHandler(handler) + + return logger + + +# Logger for the script +log = _init_logger() + + +class PeriphconfBuilder: + def __init__( + self, + dt: EDT, + lookup_tables: SocLookupTables, + ) -> None: + """Builder class used to generate a PERIPHCONF C source file based on the devicetree. + + :param dt: Devicetree object. + :param lookup_tables: Lookup table object containing soc-specific information. + """ + + self._dt = dt + self._hw_tables = lookup_tables + self._processor_id = dt_processor_id(dt) + self._owner_id = self._processor_id.default_owner_id + + self._macros = [] + self._ipcmap_idx = 0 + self._generated_ipcmaps = set() + + self._nodelabel_lookup = { + dt_reg_addr(node): node.labels[0] for node in dt.nodes if node.regs and node.labels + } + + def build_generated_source(self, header_line: str | None = None) -> str: + """Generate a C source file containing all the macros generated through + calls to the API. + """ + source_lines = [] + + if header_line: + source_lines.extend([f"/* {header_line} */", ""]) + + source_lines.extend( + [ + "#include ", + "#include ", + "", + ] + ) + + for macro in sorted(self._macros): + source_lines.append(macro.c_render(self._nodelabel_lookup)) + + return "\n".join(source_lines) + + def add_local_peripheral_cfg( + self, + node_or_nodelabel: Node | str, + /, + ) -> None: + """Generate macros for populating PERIPHCONF based on the properties of a local domain + devicetree node. + + :param node_or_nodelabel: node or label of the node to process. + """ + self._add_peripheral_cfg(node_or_nodelabel, is_global=False, add_gpios=False) + + def add_global_peripheral_cfg( + self, + node_or_nodelabel: Node | str, + /, + *, + has_irq_mapping: bool = True, + add_ppib_channel_links: bool = True, + ) -> None: + """Generate macros for populating PERIPHCONF based on the properties of the given + devicetree node located in a global domain. + + :param node_or_nodelabel: node or label of the node to process. + :param has_irq_mapping: configure IRQMAP to map the peripheral IRQs to the processor the + devicetree belongs to, if interrupts are specified on the node. + :param add_ppib_channel_links: add PPIB connections based on the channel link properties of + the node. + """ + self._add_peripheral_cfg( + node_or_nodelabel, + is_global=True, + has_irq_mapping=has_irq_mapping, + add_ppib_channel_links=add_ppib_channel_links, + ) + + def _add_peripheral_cfg( + self, + node_or_nodelabel: Node | str, + is_global: bool = True, + has_irq_mapping: bool = True, + add_ppib_channel_links: bool = True, + add_gpios: bool = True, + ) -> None: + if isinstance(node_or_nodelabel, str): + node = self._dt.label2node[node_or_nodelabel] + else: + node = node_or_nodelabel + + if node.status not in STATUS_OWNED: + return + + if is_global: + has_skip_spu_periph_perm_compat = any( + compat in SKIP_SPU_PERIPH_PERM_COMPATS for compat in node.compats + ) + if not has_skip_spu_periph_perm_compat: + has_no_dma_compat = any(compat in NO_DMA_COMPATS for compat in node.compats) + self._add_global_peripheral_spu_permissions(node, has_dma=not has_no_dma_compat) + if has_irq_mapping: + self._add_global_peripheral_irq_mapping(node) + + if "nordic,nrf-gpiote" in node.compats: + self._add_nrf_gpiote_spu_permissions(node) + + if "nordic,nrf-dppic-global" in node.compats: + self._add_nrf_dppic_spu_permissions(node) + if add_ppib_channel_links: + self._add_nrf_dppic_ppib_links(node) + + if "nordic,nrf-ipct-global" in node.compats: + self._add_nrf_ipct_global_spu_permissions(node) + self._add_nrf_ipct_ipcmap_channel_links(node) + + if "nordic,nrf-grtc" in node.compats: + self._add_nrf_grtc_spu_permissions(node) + + if "nordic,nrf-saadc" in node.compats: + self._add_nrf_saadc_channel_pin_spu_permissions(node) + + if "nordic,nrf-comp" in node.compats or "nordic,nrf-lpcomp" in node.compats: + self._add_nrf_comp_lpcomp_channel_pin_spu_permissions(node) + + self._add_peripheral_pinctrls_spu_permissions_and_ctrlsel(node) + + if "nordic,nrf-ipct-local" in node.compats: + self._add_nrf_ipct_ipcmap_channel_links(node) + + if add_gpios: + self._add_peripheral_gpios_spu_permissions_and_ctrlsel(node) + + def add_gpio_spu_permissions(self, node_or_nodelabel: Node | str, /) -> None: + """Generate macros for populating SPU FEATURE.GPIO[n].PIN[m] registers based on + gpios properties on the given devicetree node. + + CTRLSEL is not set for these properties; it is assumed that the default CTRLSEL + value (GPIO) is the correct CTRLSEL for these pins. + + :param node_or_nodelabel: node or label of the node to process. + """ + if isinstance(node_or_nodelabel, str): + node = self._dt.label2node[node_or_nodelabel] + else: + node = node_or_nodelabel + + if node.status not in STATUS_OWNED: + return + + self._add_peripheral_gpios_spu_permissions_and_ctrlsel(node, skip_ctrlsel=True) + + def _add_global_peripheral_spu_permissions( + self, + node: Node, + has_dma: bool = True, + ) -> None: + """Adds an SPU PERIPH[n].PERM entry for the peripheral described by the node.""" + addr = dt_reg_addr(node) + secure = dt_node_is_secure(node) + if has_dma: + dma_secure = secure + else: + # If there is no DMA then the DMASEC field is not writable and reads as zero. + # Set to zero to avoid readback errors. + dma_secure = False + periph_label = node.labels[0] + + spu_address = get_spu_addr_for_periph(addr) + spu_name = self._hw_tables.spu_addr_to_name[spu_address] + parsed_addr = Address(addr) + periph_slave_index = parsed_addr.slave_index + + self._macros.append( + MacroCall( + "UICR_SPU_PERIPH_PERM_SET", + [ + Address(spu_address), + periph_slave_index, + secure, + dma_secure, + self._owner_id.c_enum, + ], + comment=f"{spu_name}: {periph_label} permissions", + ) + ) + + def _add_global_peripheral_irq_mapping(self, node: Node) -> None: + """Adds an IRQMAP[n].SINK entry for each interrupt on the + peripheral described by the node. + """ + periph_identifier = dt_node_identifier(node) + get_irqn_from_dt = bool(node.labels) + + for i, interrupt in enumerate(node.interrupts): + interrupt_processors = set() + interrupt_ctrl = interrupt.controller + + interrupt_processors.update(dt_node_processors_from_labels(interrupt_ctrl)) + + if not interrupt_processors: + interrupt_processors.update(dt_node_processors_from_labels(node)) + + if not interrupt_processors: + raise BuilderError( + f"No unique processor ID could be found based on interrupt controllers " + f"or nodelabels for peripheral node {node.path}" + ) + if len(interrupt_processors) > 1: + raise BuilderError( + f"Peripheral node {node.path} corresponds to multiple processors " + f"({interrupt_processors}), which is not supported." + ) + + irq_processor = next(iter(interrupt_processors)) + + if get_irqn_from_dt: + macro_irqn = f"DT_IRQN_BY_IDX(DT_NODELABEL({node.labels[0]}), {i})" + else: + macro_irqn = str(interrupt.data["irq"]) + + self._macros.append( + MacroCall( + "UICR_IRQMAP_IRQ_SINK_SET", + [ + macro_irqn, + irq_processor.c_enum, + ], + comment=f"{periph_identifier} IRQ => {irq_processor.name}", + ) + ) + + def _add_nrf_gpiote_spu_permissions(self, node: Node) -> None: + """Adds SPU FEATURE.GPIOTE[n].CH[m] entries for configured channels on the + GPIOTE peripheral described by the node. + """ + addr = dt_reg_addr(node) + instance_name = dt_node_identifier(node) + spu_address = get_spu_addr_for_periph(addr) + spu_name = self._hw_tables.spu_addr_to_name[spu_address] + + for num, secure in dt_split_channels_get(node): + self._macros.append( + MacroCall( + "UICR_SPU_FEATURE_GPIOTE_CH_SET", + [ + Address(spu_address), + 0, + num, + secure, + self._owner_id.c_enum, + ], + comment=f"{spu_name}: {instance_name} ch. {num} permissions", + ) + ) + + def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: + """Adds SPU FEATURE.DPPIC[n].CH[m] and SPU FEATURE.DPPIC[n].CHG[m] entries for + configured channels and channel groups on the DPPIC peripheral described by the node. + """ + addr = dt_reg_addr(node) + channels = dt_split_channels_get(node) + channel_groups = dt_split_channels_get( + node, + owned_name="owned-channel-groups", + nonsecure_name="nonsecure-channel-groups", + ) + + instance_name = dt_node_identifier(node) + spu_address = get_spu_addr_for_periph(addr) + spu_name = self._hw_tables.spu_addr_to_name[spu_address] + + for num, secure in channels: + self._macros.append( + MacroCall( + "UICR_SPU_FEATURE_DPPIC_CH_SET", + [ + Address(spu_address), + num, + secure, + self._owner_id.c_enum, + ], + comment=f"{spu_name}: {instance_name} ch. {num} permissions", + ) + ) + + for num, secure in channel_groups: + self._macros.append( + MacroCall( + "UICR_SPU_FEATURE_DPPIC_CHG_SET", + [ + Address(spu_address), + num, + secure, + self._owner_id.c_enum, + ], + comment=f"{spu_name}: {instance_name} ch. group {num} permissions", + ) + ) + + def _add_nrf_dppic_ppib_links(self, node: Node) -> None: + """Adds PPIB SUBSCRIBE_SEND[n] and PPIB PUBLISH_RECEIVE[n] entries for + configured "source" and "sink" channels on the DPPIC peripheral described by the node. + """ + addr = dt_reg_addr(node, secure=True) + source_channels = dt_array_prop(node, "source-channels", []) + sink_channels = dt_array_prop(node, "sink-channels", []) + + for num in source_channels: + self._link_dppi_channels(addr, num, direction="source") + + for num in sink_channels: + self._link_dppi_channels(addr, num, direction="sink") + + def _link_dppi_channels( + self, + dppic_addr: int, + channel_num: int, + direction: Literal["source"] | Literal["sink"], + ) -> None: + local_ppib_addr, local_ppib_ch_map = self._hw_tables.dppic_to_ppib_connections[dppic_addr] + local_ppib_ch = local_ppib_ch_map[channel_num] + + remote_ppib_addr, remote_ppib_ch_map = self._hw_tables.ppib_to_ppib_connections[ + local_ppib_addr + ] + remote_ppib_ch = remote_ppib_ch_map[local_ppib_ch] + + if direction == "source": + sub_ppib_addr, sub_ppib_ch = local_ppib_addr, local_ppib_ch + pub_ppib_addr, pub_ppib_ch = remote_ppib_addr, remote_ppib_ch + else: + sub_ppib_addr, sub_ppib_ch = remote_ppib_addr, remote_ppib_ch + pub_ppib_addr, pub_ppib_ch = local_ppib_addr, local_ppib_ch + + sub_ppib_name = self._hw_tables.ppib_addr_to_name[sub_ppib_addr] + pub_ppib_name = self._hw_tables.ppib_addr_to_name[pub_ppib_addr] + + self._macros.append( + MacroCall( + "UICR_PPIB_SUBSCRIBE_SEND_ENABLE", + [ + Address(sub_ppib_addr), + sub_ppib_ch, + ], + comment=( + f"SUB: {sub_ppib_name} ch. {sub_ppib_ch} => {pub_ppib_name} ch. {pub_ppib_ch}" + ), + ) + ) + self._macros.append( + MacroCall( + "UICR_PPIB_PUBLISH_RECEIVE_ENABLE", + [ + Address(pub_ppib_addr), + pub_ppib_ch, + ], + comment=( + f"PUB: {sub_ppib_name} ch. {sub_ppib_ch} => {pub_ppib_name} ch. {pub_ppib_ch}" + ), + ) + ) + + def _add_nrf_ipct_global_spu_permissions(self, node: Node) -> None: + """Adds SPU FEATURE.IPCT[n].CH[m] entries for configured channels + on the IPCT peripheral described by the node. + """ + addr = dt_reg_addr(node) + instance_name = dt_node_identifier(node) + spu_address = get_spu_addr_for_periph(addr) + spu_name = self._hw_tables.spu_addr_to_name[spu_address] + + for num, secure in dt_split_channels_get(node): + self._macros.append( + MacroCall( + "UICR_SPU_FEATURE_IPCT_CH_SET", + [ + Address(spu_address), + num, + secure, + self._owner_id.c_enum, + ], + comment=f"{spu_name}: {instance_name} ch. {num} permissions", + ) + ) + + def _add_nrf_ipct_ipcmap_channel_links(self, node: Node) -> None: + """Adds IPCMAP CHANNEL[n].SOURCE and CHANNEL[n].SINK entries for "sink" and "source" + channels on the IPCT peripheral described by the node. + """ + source_channel_links = dt_array_prop(node, "source-channel-links", []) + if len(source_channel_links) % 3 != 0: + raise BadDevicetreeError() + + sink_channel_links = dt_array_prop(node, "sink-channel-links", []) + if len(sink_channel_links) % 3 != 0: + raise BadDevicetreeError() + + node_domain_raw = dt_prop(node, "global-domain-id", None) + if node_domain_raw is None: + addr = dt_reg_addr(node) + try: + node_domain = Address(addr).domain + except ValueError as e: + raise BadDevicetreeError( + f"Failed to determine domain ID for address 0x{addr:08x} " + f"specified on node {node.path}" + ) from e + else: + node_domain = DomainId(node_domain_raw) + + for source_ch, sink_domain_raw, sink_ch in batched(source_channel_links, 3): + sink_domain = DomainId(sink_domain_raw) + self._link_ipct_channel(node_domain, source_ch, sink_domain, sink_ch) + + for sink_ch, source_domain_raw, source_ch in batched(sink_channel_links, 3): + source_domain = DomainId(source_domain_raw) + self._link_ipct_channel(source_domain, source_ch, node_domain, sink_ch) + + def _link_ipct_channel( + self, + source_domain: DomainId, + source_ch: int, + sink_domain: DomainId, + sink_ch: int, + ) -> None: + # Setting "source-channel-links" on one end and "sink-channel-links" on the other + # leads to duplicated entries without this check. + link_args = ( + source_domain.c_enum, + source_ch, + sink_domain.c_enum, + sink_ch, + ) + if link_args in self._generated_ipcmaps: + log.debug(f"Skip duplicate IPCMAP entry: {link_args}") + return + self._generated_ipcmaps.add(link_args) + + self._macros.append( + MacroCall( + "UICR_IPCMAP_CHANNEL_CFG", + [self._ipcmap_idx, *link_args], + comment=( + f"{source_domain.name} IPCT ch. {source_ch} => " + f"{sink_domain.name} IPCT ch. {sink_ch}" + ), + ) + ) + self._ipcmap_idx += 1 + + def _add_nrf_grtc_spu_permissions(self, node: Node) -> None: + """Adds SPU FEATURE.GRTC[n].CC[m] entries for configured channels + on the GRTC peripheral described by the node. + """ + grtc_addr = dt_reg_addr(node) + spu_address = get_spu_addr_for_periph(grtc_addr) + spu_name = self._hw_tables.spu_addr_to_name[spu_address] + + for num, secure in dt_split_channels_get(node): + self._macros.append( + MacroCall( + "UICR_SPU_FEATURE_GRTC_CC_SET", + [ + Address(spu_address), + num, + secure, + self._owner_id.c_enum, + ], + comment=f"{spu_name}: GRTC CC{num} permissions", + ) + ) + + def _add_peripheral_gpios_spu_permissions_and_ctrlsel( + self, + node: Node, + skip_ctrlsel: bool = False, + ) -> None: + """Adds SPU FEATURE.GPIO[n].PIN[m] and GPIO PIN_CNF[n] entries for + pins used in phandle-array properties called 'gpios' or ending in '-gpios' + found on the peripheral node. + """ + for name in node.props: + if not re.fullmatch(r"^(.+-)?gpios$", name): + continue + + if node.props[name].type != "phandle-array": + log.debug(f"skipping *-gpios prop {name} in {node.path} (not a phandle-array)") + continue + + for entry in dt_array_prop(node, name): + gpio_node = entry.controller + if "nordic,nrf-gpio" not in gpio_node.compats: + continue + + port = gpio_node.props["port"].val + num = entry.data["pin"] + secure = dt_node_is_secure(gpio_node) + if not skip_ctrlsel: + ctrlsel = self._hw_tables.lookup_ctrlsel_for_property( + node.props[name], (port, num) + ) + else: + ctrlsel = None + self._configure_gpio_pin(entry.controller, num, secure, ctrlsel) + + def _add_peripheral_pinctrls_spu_permissions_and_ctrlsel(self, node: Node) -> None: + """Adds SPU FEATURE.GPIO[n].PIN[m] and GPIO PIN_CNF[n] entries for + pins used in pinctrl properties referenced by the peripheral node. + """ + secure = dt_node_is_secure(node) + for pinctrl in node.pinctrls: + for config_node in pinctrl.conf_nodes: + for group_node in config_node.children.values(): + for i, psel_val in enumerate(dt_array_prop(group_node, "psels")): + psel = NrfPsel.from_raw(psel_val) + + if psel.is_disconnected(): + # Pin is unused and should be ignored + continue + + gpio_node = find_gpio_node_by_port( + node.edt, + psel.port, + err_suffix=f" (referenced by {group_node.path}:psels[{i}])", + ) + num = psel.pin + ctrlsel = self._hw_tables.lookup_ctrlsel_for_pinctrl(pinctrl, psel) + self._configure_gpio_pin(gpio_node, num, secure, ctrlsel) + + def _add_nrf_saadc_channel_pin_spu_permissions(self, node: Node) -> None: + """Adds SPU FEATURE.GPIO[n].PIN[m] and GPIO PIN_CNF[n] entries for + pins corresponding to the channel properties on the ADC peripheral node. + """ + saadc_addr = dt_reg_addr(node, secure=True) + if saadc_addr not in self._hw_tables.adc_channel_pin_lookup: + return + + channel_pins = self._hw_tables.adc_channel_pin_lookup[saadc_addr] + secure = dt_node_is_secure(node) + + for name, child in node.children.items(): + if not name.startswith("channel"): + continue + + for prop_name in ["zephyr,input-positive", "zephyr,input-negative"]: + prop_val = dt_prop(child, prop_name, None) + if prop_val in channel_pins: + port, num = channel_pins[prop_val] + gpio_node = find_gpio_node_by_port(node.edt, port) + self._configure_gpio_pin(gpio_node, num, secure, CTRLSEL_DEFAULT) + + def _add_nrf_comp_lpcomp_channel_pin_spu_permissions(self, node: Node) -> None: + """Adds SPU FEATURE.GPIO[n].PIN[m] and GPIO PIN_CNF[n] entries for + pins corresponding to the channel properties on the COMP/LPCOMP peripheral node. + """ + comp_addr = dt_reg_addr(node, secure=True) + if comp_addr not in self._hw_tables.comp_channel_pin_lookup: + return + + channel_pins = self._hw_tables.comp_channel_pin_lookup[comp_addr] + secure = dt_node_is_secure(node) + + for prop_name in ["psel", "extrefsel"]: + prop_val = dt_prop(node, prop_name, None) + if prop_val in channel_pins: + port, num = channel_pins[prop_val] + gpio_node = find_gpio_node_by_port(node.edt, port) + self._configure_gpio_pin(gpio_node, num, secure, CTRLSEL_DEFAULT) + + def _configure_gpio_pin( + self, + gpio_node: Node, + num: int, + secure: bool, + ctrlsel: int | None, + ) -> None: + gpio_addr = dt_reg_addr(gpio_node) + gpio_port = dt_prop(gpio_node, "port") + spu_address = get_spu_addr_for_periph(gpio_addr) + spu_name = self._hw_tables.spu_addr_to_name[spu_address] + + self._macros.append( + MacroCall( + "UICR_SPU_FEATURE_GPIO_PIN_SET", + [ + Address(spu_address), + gpio_port, + num, + secure, + self._owner_id.c_enum, + ], + comment=f"{spu_name}: P{gpio_port}.{num} permissions", + ) + ) + + if ctrlsel is not None: + ctrlsel_int = int(ctrlsel) + self._macros.append( + MacroCall( + "UICR_GPIO_PIN_CNF_CTRLSEL_SET", + [ + Address(gpio_addr), + num, + ctrlsel_int, + ], + comment=f"P{gpio_port}.{num} CTRLSEL = {ctrlsel_int}", + ) + ) + + +def find_gpio_node_by_port(dt: EDT, port: int, err_suffix: str = "") -> Node: + """Find the GPIO node in the devicetree with the given port.""" + for gpio_node in dt.compat2nodes["nordic,nrf-gpio"]: + if gpio_node.props["port"].val == port: + return gpio_node + raise BadDevicetreeError(f"Failed to find Nordic GPIO node with port {port}{err_suffix}") + + +@dataclass(order=True) +class MacroCall: + name: str + args: list + comment: str | None = None + + def c_render(self, nodelabel_lookup: dict[int, str]) -> str: + """Render the macro as C code""" + str_args = [] + for arg in self.args: + if isinstance(arg, Address): + if int(arg) in nodelabel_lookup: + str_args.append(c_dt_reg_addr_by_label(nodelabel_lookup[int(arg)])) + else: + str_args.append(c_hex_addr(int(arg))) + elif isinstance(arg, bool): + str_args.append(c_bool(arg)) + elif hasattr(arg, "c_enum"): + str_args.append(arg.c_enum) + else: + str_args.append(str(arg)) + + comment = f"/* {self.comment} */\n" if self.comment else "" + return f"{comment}{self.name}({', '.join(str_args)});" + + +def c_hex_addr(address: int) -> str: + """Format address as a C 32-bit hex literal.""" + return f"0x{address:08x}UL" + + +def c_bool(value: bool) -> str: + """Format value as a C bool literal.""" + return "true" if value else "false" + + +def c_dt_reg_addr_by_label(nodelabel: str) -> str: + """Format a peripheral address using devicetree macros to get the address based on node label""" + return f"DT_REG_ADDR(DT_NODELABEL({nodelabel}))" + + +# Equivalent to itertools.batched(), using the recipe provided in the docs. +def batched(iterable: Iterable, n: int, *, strict: bool = False) -> Iterator: + if n < 1: + raise ValueError("n must be at least one") + iterator = iter(iterable) + while batch := tuple(islice(iterator, n)): + if strict and len(batch) != n: + raise ValueError("batched(): incomplete batch") + yield batch + + +# Sentinel used to represent no provided default value in the functions below +class NoDefault: ... + + +NO_DEFAULT = NoDefault + + +def dt_reg_addr( + node: Node, + index: int = 0, + secure: bool = False, + default: int | type[NoDefault] = NO_DEFAULT, +) -> int: + """Get a register address and property identifier for a node.""" + try: + addr = node.regs[index].addr + except IndexError: + if isinstance(default, int): + addr = default + else: + raise + if secure: + return int(Address(addr).as_secure()) + return addr + + +def dt_reg_size(node: Node, index: int = 0) -> int: + """Get a register size and property identifier for a node.""" + return node.regs[index].size + + +def dt_prop(node: Node, name: str, default: Any = NO_DEFAULT) -> Any: + """Get the property value and identfier of a property. + Optionally returns a default value. + """ + try: + prop = node.props[name] + except KeyError: + if default != NO_DEFAULT: + return default + raise + + return prop.val + + +def dt_node_identifier(node: Node, default_to_path: bool = True) -> str: + """Get a string that identifies the node. + Returns the first nodelabel if it exists, otherwise defaults to the node path. + If default_to_path is False, exits with an error instead of defaulting. + """ + if node.labels: + return node.labels[0] + elif default_to_path: + return node.path + raise BuilderError(f"Expected a nodelabel on {node}, but the node has no label") + + +def dt_array_prop( + node: Node, + name: str, + default: list[Any] | type[NO_DEFAULT] = NO_DEFAULT, +) -> list[Any]: + """Get the member values and identifiers of an array property. + Optionally returns a default value. + """ + try: + prop = node.props[name] + except KeyError: + if not isinstance(default, type): + return list(default) + raise + + return list(prop.val) + + +def dt_node_processors_from_labels(node: Node) -> list[ProcessorId]: + """Deduce a processor ID from a list of devicetree nodelabels.""" + substring_processor = {cpu.zephyr_name: cpu for cpu in ProcessorId.__members__.values()} + processors = set() + for substring, processor_id in substring_processor.items(): + if any(substring in label for label in node.labels): + processors.add(processor_id) + return list(processors) + + +def dt_split_channels_get( + node: Node, + owned_name: str = "owned-channels", + nonsecure_name: str = "nonsecure-channels", +) -> list[tuple[int, bool]]: + """Parse 'split channels' properties.""" + owned = [] + owned.extend(dt_array_prop(node, owned_name, default=[])) + owned.extend(dt_array_prop(node, f"child-{owned_name}", default=[])) + + sec_lookup = {} + if nonsecure_name in node.props: + nonsecure = dt_array_prop(node, nonsecure_name) + sec_lookup.update(dict.fromkeys(nonsecure, False)) + + default_sec = dt_node_is_secure(node) + channels = [] + for ch in owned: + sec = sec_lookup.setdefault(ch, default_sec) + channels.append((ch, sec)) + + return channels + + +def dt_node_is_secure(node: Node) -> bool: + if node.bus_node is not None and node.bus_node.regs: + addr = dt_reg_addr(node.bus_node) + elif node.regs: + addr = dt_reg_addr(node) + else: + raise ValueError( + f"Failed to determine security of {node.path} " + "from the address of its bus node or itself" + ) + return Address(addr).security + + +def dt_processor_id(devicetree: EDT) -> ProcessorId: + """Get processor information from a domain's devicetree.""" + cpus = [ + node + for node in devicetree.get_node("/cpus").children.values() + if node.name.startswith("cpu@") + ] + if len(cpus) != 1: + raise RuntimeError( + f"Expected exactly 1 'cpu' node, but devicetree contained {len(cpus)} nodes" + ) + + try: + return ProcessorId(cpus[0].regs[0].addr) + except Exception as e: + raise RuntimeError( + f"Devicetree 'cpu' node has invalid Processor ID {cpus[0].regs[0].addr}" + ) from e + + +@dataclass(frozen=True) +class NrfPsel: + """Decoded NRF_PSEL values.""" + + fun: NrfFun + port: int + pin: int + + @classmethod + def from_raw(cls, psel_value: int) -> NrfPsel: + """Decode a raw NRF_PSEL encoded int value to its individual parts.""" + port, pin = divmod(psel_value & (~NRF_PSEL_FUN_MASK), NRF_PSEL_GPIO_PIN_COUNT) + fun = (psel_value & NRF_PSEL_FUN_MASK) >> NRF_PSEL_FUN_POS + return NrfPsel(fun=NrfFun(fun), port=port, pin=pin) + + def is_disconnected(self) -> bool: + """True if the value represents a disconnected pin""" + return (self.port * NRF_PSEL_GPIO_PIN_COUNT + self.pin) == NRF_PSEL_PIN_MASK + + +# # Bit position of the function bits in the pinctrl pin value encoded from NRF_PSEL() +NRF_PSEL_FUN_POS = 24 +# # Mask for the function bits in the pinctrl pin value encoded from NRF_PSEL() +NRF_PSEL_FUN_MASK = 0xFF << NRF_PSEL_FUN_POS +# Number of pins per port used in NRF_PSEL() +NRF_PSEL_GPIO_PIN_COUNT = 32 +# Mask for the port, pin bits in the pinctrl pin value encoded from NRF_PSEL() +NRF_PSEL_PIN_MASK = 0x1FF + + +@dataclass(frozen=True) +class GpiosProp: + """CTRLSEL lookup table entry for special *-gpios properties used in some peripheral + bindings, which are in some cases used instead of pinctrl. + """ + + name: str + port: int + pin: int + + +@enum.unique +class Ctrlsel(int, enum.Enum): + """ + Enumeration of GPIO.PIN_CNF[n].CTRLSEL values. + The list here may not be exhaustive. + """ + + GPIO = 0 + VPR_GRC = 1 + CAN_PWM_I3C = 2 + SERIAL0 = 3 + EXMIF_RADIO_SERIAL1 = 4 + CAN_TDM_SERIAL2 = 5 + CAN = 6 + TND = 7 + + +# Default CTRLSEL value indicating that CTRLSEL should not be used +CTRLSEL_DEFAULT = Ctrlsel.GPIO + + +class NrfFun(int, enum.Enum): + """Pin functions used with pinctrl, see include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h + Only the functions relevant for CTRLSEL deduction have been included. + """ + + UART_TX = 0 + UART_RX = 1 + UART_RTS = 2 + UART_CTS = 3 + SPIM_SCK = 4 + SPIM_MOSI = 5 + SPIM_MISO = 6 + SPIS_SCK = 7 + SPIS_MOSI = 8 + SPIS_MISO = 9 + SPIS_CSN = 10 + TWIM_SCL = 11 + TWIM_SDA = 12 + PWM_OUT0 = 22 + PWM_OUT1 = 23 + PWM_OUT2 = 24 + PWM_OUT3 = 25 + EXMIF_CK = 35 + EXMIF_DQ0 = 36 + EXMIF_DQ1 = 37 + EXMIF_DQ2 = 38 + EXMIF_DQ3 = 39 + EXMIF_DQ4 = 40 + EXMIF_DQ5 = 41 + EXMIF_DQ6 = 42 + EXMIF_DQ7 = 43 + EXMIF_CS0 = 44 + EXMIF_CS1 = 45 + CAN_TX = 46 + CAN_RX = 47 + TWIS_SCL = 48 + TWIS_SDA = 49 + EXMIF_RWDS = 50 + GRTC_CLKOUT_FAST = 55 + GRTC_CLKOUT_32K = 56 + TDM_SCK_M = 71 + TDM_SCK_S = 72 + TDM_FSYNC_M = 73 + TDM_FSYNC_S = 74 + TDM_SDIN = 75 + TDM_SDOUT = 76 + TDM_MCK = 77 + + # Value used to ignore the function field and only check (port, pin) + IGNORE = -1 + # Fallback for unknown NrfFun values, assumes that pin CTRLSEL should be set to GPIO + ASSUMED_GPIO = -2 + + @classmethod + def _missing_(cls, value: Any) -> NrfFun: + return cls.ASSUMED_GPIO + + +class NrfSaadcChannel(int, enum.Enum): + """Identifiers representing SAADC channels. + See include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h. + """ + + AIN0 = 1 + AIN1 = 2 + AIN2 = 3 + AIN3 = 4 + AIN4 = 5 + AIN5 = 6 + AIN6 = 7 + AIN7 = 8 + AIN8 = 9 + AIN9 = 10 + AIN10 = 11 + AIN11 = 12 + AIN12 = 13 + AIN13 = 14 + + +class NrfCompChannel(str, enum.Enum): + """Identifiers representing COMP/LPCOMP channels. + See dts/bindings/comparator/nordic,nrf-comp.yaml. + """ + + AIN0 = "AIN0" + AIN1 = "AIN1" + AIN2 = "AIN2" + AIN3 = "AIN3" + AIN4 = "AIN4" + AIN5 = "AIN5" + AIN6 = "AIN6" + AIN7 = "AIN7" + AIN8 = "AIN8" + AIN9 = "AIN9" + + +class FixedPPIMap(NamedTuple): + """A DPPIC-PPIB or PPIB-PPIB channel mapping. + These connections are fixed in the hardware. + """ + + connected_to: int + channel_map: range + + +@dataclass +class SocLookupTables: + """Container for various hardware info needed to generate PERIPHCONF.""" + + ctrlsel_lookup: dict[int, dict[NrfPsel | GpiosProp, Ctrlsel]] + adc_channel_pin_lookup: dict[int, dict[NrfSaadcChannel, tuple[int, int]]] + comp_channel_pin_lookup: dict[int, dict[NrfCompChannel, tuple[int, int]]] + dppic_to_ppib_connections: dict[int, FixedPPIMap] + ppib_to_ppib_connections: dict[int, FixedPPIMap] + spu_instances: list[tuple[str, int]] + ppib_instances: list[tuple[str, int]] + + @cached_property + def spu_addr_to_name(self) -> Mapping[int, str]: + return {addr: name for name, addr in self.spu_instances} + + @cached_property + def ppib_addr_to_name(self) -> Mapping[int, str]: + return {addr: name for name, addr in self.ppib_instances} + + def lookup_ctrlsel_for_property(self, prop: Property, psel: tuple[int, int]) -> Ctrlsel | None: + """Find the appopriate CTRLSEL value for a given gpios property.""" + if not prop.node.regs: + # Only nodes with registers can be looked up + return None + + periph_addr = dt_reg_addr(prop.node, secure=True) + gpios_prop = GpiosProp(name=prop.name, port=psel[0], pin=psel[1]) + return self._lookup_ctrlsel(periph_addr, gpios_prop) + + def lookup_ctrlsel_for_pinctrl(self, prop: PinCtrl, psel: NrfPsel) -> Ctrlsel | None: + """Find the appopriate CTRLSEL value for a given pinctrl.""" + if psel.fun == NrfFun.ASSUMED_GPIO: + # We map unsupported values to GPIO CTRLSEL + return CTRLSEL_DEFAULT + + periph_addr = dt_reg_addr(prop.node, secure=True) + return self._lookup_ctrlsel(periph_addr, psel) + + def _lookup_ctrlsel( + self, + periph_addr: int, + prop_or_psel: NrfPsel | GpiosProp, + ) -> Ctrlsel | None: + ctrlsel = None + + if periph_addr in self.ctrlsel_lookup: + ident_lut = self.ctrlsel_lookup[periph_addr] + if prop_or_psel in ident_lut: + ctrlsel = ident_lut[prop_or_psel] + elif isinstance(prop_or_psel, NrfPsel): + # Check if this entry is enumerated with "ignored" function + sub_entry_no_fun = NrfPsel( + fun=NrfFun.IGNORE, port=prop_or_psel.port, pin=prop_or_psel.pin + ) + ctrlsel = ident_lut.get(sub_entry_no_fun, None) + + log.debug(f"periph_addr=0x{periph_addr:09_x}, {prop_or_psel=} -> {ctrlsel=}") + + return ctrlsel + + +def get_spu_addr_for_periph(periph_addr: int) -> int: + """Get the address of the SPU instance governing the permissions for the peripheral + at the given address. + """ + address = Address(periph_addr) + + # The common rule is that the SPU instance sits at the start of the address space for + # the bus of the peripheral. + address.security = True + address.slave_index = 0 + address.address_space = 0 + + # However, some buses are special due to having > 16 slaves and need special handling. + address.bus = SPU_ADDRESS_BUS_REMAPPING.get(address.bus, address.bus) + + return int(address) + + +SPU_ADDRESS_BUS_REMAPPING = { + # Both of these bus IDs represent APB32 and should use the same SPU instance with bus ID 146. + 147: 146, +} + + +@enum.unique +class DomainId(enum.IntEnum): + """Domain IDs.""" + + RESERVED = 0 + SECURE = 1 + APPLICATION = 2 + RADIOCORE = 3 + CELLCORE = 4 + GLOBALFAST = 12 + GLOBALSLOW = 13 + GLOBAL_ = 14 + GLOBAL = 15 + + @property + def c_enum(self) -> str: + return f"NRF_DOMAIN_{self.name.upper()}" + + +@enum.unique +class OwnerId(enum.IntEnum): + """Owner IDs.""" + + NONE = 0 + SECURE = 1 + APPLICATION = 2 + RADIOCORE = 3 + CELL = 4 + SYSCTRL = 8 + + @property + def c_enum(self) -> str: + return f"NRF_OWNER_{self.name.upper()}" + + +@enum.unique +class ProcessorId(enum.IntEnum): + """Processor IDs.""" + + SECURE = 1 + APPLICATION = 2 + RADIOCORE = 3 + CELLCORE = 4 + SYSCTRL = 12 + PPR = 13 + FLPR = 14 + + @property + def zephyr_name(self) -> str: + """Name used in zephyr to denote the processor with this ID.""" + match self: + case ProcessorId.SECURE: + return "cpusec" + case ProcessorId.APPLICATION: + return "cpuapp" + case ProcessorId.RADIOCORE: + return "cpurad" + case ProcessorId.CELLCORE: + return "cpucell" + case ProcessorId.SYSCTRL: + return "cpusys" + case ProcessorId.PPR: + return "cpuppr" + case ProcessorId.FLPR: + return "cpuflpr" + + @property + def default_owner_id(self) -> OwnerId: + """Default owner ID associated with this ID (the ID used by accesses from the processor).""" + match self: + case ProcessorId.SECURE: + return OwnerId.SECURE + case ProcessorId.APPLICATION: + return OwnerId.APPLICATION + case ProcessorId.RADIOCORE: + return OwnerId.RADIOCORE + case ProcessorId.CELLCORE: + return OwnerId.CELL + case ProcessorId.SYSCTRL: + return OwnerId.SYSCTRL + case ProcessorId.PPR: + return OwnerId.APPLICATION + case ProcessorId.FLPR: + return OwnerId.APPLICATION + + @property + def c_enum(self) -> str: + return f"NRF_PROCESSOR_{self.name.upper()}" + + +@enum.unique +class AddressRegion(enum.IntEnum): + """Address regions, defined by Address Format of the data sheet.""" + + PROGRAM = 0 + DATA = 1 + PERIPHERAL = 2 + EXT_XIP = 3 + EXT_XIP_ENCRYPTED = 4 + STM = 5 + CPU = 7 + + @classmethod + def from_address(cls, address: int) -> AddressRegion: + """Get the address region of an address.""" + return Address(address).region + + +# Regions that have domain ID and security fields +HAS_DOMAIN_SECURITY = [ + AddressRegion.PROGRAM, + AddressRegion.DATA, + AddressRegion.PERIPHERAL, + AddressRegion.STM, +] + +# Regions that have the peripheral address format +HAS_PERIPH_BITS = [ + AddressRegion.PERIPHERAL, + AddressRegion.STM, +] + + +class Address: + """Helper for working with addresses.""" + + def __init__(self, value: int | Address = 0) -> None: + self._val = int(value) + + def __repr__(self) -> str: + if self.region in HAS_DOMAIN_SECURITY: + domain_sec_str = ( + f", domain={self.domain.name} ({int(self.domain)}), security={self.security}" + ) + else: + domain_sec_str = "" + + if self.region in HAS_PERIPH_BITS: + periph_bits_str = ( + f", bus={self.bus} (0b{self.bus:09_b}), " + f"slave_index={self.slave_index} (0b{self.slave_index:09_b})" + ) + else: + periph_bits_str = "" + + field_str = ( + f"region={self.region.name} ({int(self.region)}){domain_sec_str}{periph_bits_str}, " + f"address_space=0x{self.address_space:_x}" + ) + + return f"{type(self).__name__}({field_str})" + + def __str__(self) -> str: + return repr(self) + + def as_secure(self) -> Address: + addr = Address(self) + addr.security = True + return addr + + @property + def region(self) -> AddressRegion: + """Address region.""" + return AddressRegion(get_field(self._val, ADDRESS_REGION_POS, ADDRESS_REGION_MASK)) + + @region.setter + def region(self, new: int) -> None: + self._val = update_field(self._val, new, ADDRESS_REGION_POS, ADDRESS_REGION_MASK) + + @property + def security(self) -> bool: + """Address security (only present in some regions).""" + self._check_has_security() + return bool(get_field(self._val, ADDRESS_SECURITY_POS, ADDRESS_SECURITY_MASK)) + + @security.setter + def security(self, new: bool) -> None: + self._check_has_security() + self._val = update_field(self._val, int(new), ADDRESS_SECURITY_POS, ADDRESS_SECURITY_MASK) + + def _check_has_security(self) -> None: + self._check_region_has_field(HAS_DOMAIN_SECURITY, "security bit") + + @property + def domain(self) -> DomainId: + """Address domain ID (only present in some regions).""" + self._check_has_domain_id() + return DomainId(get_field(self._val, ADDRESS_DOMAIN_POS, ADDRESS_DOMAIN_MASK)) + + @domain.setter + def domain(self, new: DomainId | int) -> None: + self._check_has_domain_id() + self._val = update_field(self._val, new, ADDRESS_DOMAIN_POS, ADDRESS_DOMAIN_MASK) + + def _check_has_domain_id(self) -> None: + self._check_region_has_field(HAS_DOMAIN_SECURITY, "domain ID") + + @property + def bus(self) -> int: + """Bus ID (only present in some regions).""" + self._check_has_bus() + return get_field(self._val, ADDRESS_BUS_POS, ADDRESS_BUS_MASK) + + @bus.setter + def bus(self, new: int) -> None: + self._check_has_bus() + self._val = update_field(self._val, new, ADDRESS_BUS_POS, ADDRESS_BUS_MASK) + + def _check_has_bus(self) -> None: + self._check_region_has_field(HAS_PERIPH_BITS, "Peripheral/APB bus number") + + @property + def slave_index(self) -> int: + """Slave index (only present in some regions).""" + self._check_has_slave_index() + return get_field(self._val, ADDRESS_SLAVE_POS, ADDRESS_SLAVE_MASK) + + @slave_index.setter + def slave_index(self, new: int) -> None: + self._check_has_slave_index() + self._val = update_field(self._val, new, ADDRESS_SLAVE_POS, ADDRESS_SLAVE_MASK) + + def _check_has_slave_index(self) -> None: + self._check_region_has_field(HAS_PERIPH_BITS, "Peripheral/APB slave index") + + @property + def address_space(self) -> int: + """Internal address space address (semantics depend on the region).""" + match self.region: + case AddressRegion.PROGRAM | AddressRegion.DATA: + return get_field(self._val, ADDRESS_SPACE_POS, ADDRESS_PROGRAM_DATA_SPACE_MASK) + case AddressRegion.PERIPHERAL | AddressRegion.STM: + return get_field(self._val, ADDRESS_SPACE_POS, ADDRESS_PERIPHERAL_SPACE_MASK) + case _: + return get_field(self._val, ADDRESS_SPACE_POS, ADDRESS_DEFAULT_SPACE_MASK) + + @address_space.setter + def address_space(self, new: int) -> None: + match self.region: + case AddressRegion.PROGRAM | AddressRegion.DATA: + self._val = update_field( + self._val, new, ADDRESS_SPACE_POS, ADDRESS_PROGRAM_DATA_SPACE_MASK + ) + case AddressRegion.PERIPHERAL | AddressRegion.STM: + self._val = update_field( + self._val, new, ADDRESS_SPACE_POS, ADDRESS_PERIPHERAL_SPACE_MASK + ) + case _: + self._val = update_field( + self._val, new, ADDRESS_SPACE_POS, ADDRESS_DEFAULT_SPACE_MASK + ) + + def _check_region_has_field(self, valid_regions: list[AddressRegion], field_name: str) -> None: + if self.region not in valid_regions: + raise ValueError(f"{field_name} is not defined for address region {self.region.name}") + + def __eq__(self, other) -> bool: + return int(self) == int(other) + + def __lt__(self, other: Address | int) -> bool: + return int(self) < int(other) + + def __int__(self) -> int: + return self._val + + +ADDRESS_REGION_POS = 29 +ADDRESS_REGION_MASK = 0x7 << ADDRESS_REGION_POS +ADDRESS_SECURITY_POS = 28 +ADDRESS_SECURITY_MASK = 0x1 << ADDRESS_SECURITY_POS +ADDRESS_DOMAIN_POS = 24 +ADDRESS_DOMAIN_MASK = 0xF << ADDRESS_DOMAIN_POS +ADDRESS_BUS_POS = 16 +ADDRESS_BUS_MASK = 0xFF << ADDRESS_BUS_POS +ADDRESS_SLAVE_POS = 12 +ADDRESS_SLAVE_MASK = 0xF << ADDRESS_SLAVE_POS +ADDRESS_PERIPHID_POS = 12 +ADDRESS_PERIPHID_MASK = 0x7FF << ADDRESS_PERIPHID_POS +ADDRESS_SPACE_POS = 0 +ADDRESS_PROGRAM_DATA_SPACE_MASK = 0xFF_FFFF +ADDRESS_PERIPHERAL_SPACE_MASK = 0xFFF +ADDRESS_DEFAULT_SPACE_MASK = 0x1FFF_FFFF + + +def peripheral_id_get(periph_address: int) -> int: + """Get the peripheral ID of a peripheral address.""" + return get_field(periph_address, ADDRESS_PERIPHID_POS, ADDRESS_PERIPHID_MASK) + + +def get_field(value: int, field_pos: int, field_mask: int) -> int: + """Get the value of a field in a bitfield.""" + return (value & field_mask) >> field_pos + + +def update_field(value: int, field_new: int, field_pos: int, field_mask: int) -> int: + """Update a field in a bitfield.""" + return (value & ~field_mask) | ((field_new << field_pos) & field_mask) From eeed71d2c6344820bd51d362d628175dc6af12f5 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Tue, 16 Sep 2025 16:25:22 +0200 Subject: [PATCH 0028/3334] [nrf fromlist] soc: nordic: uicr: print cmake warning when used without sysbuild Upstream PR #: 95915 Because generation and programming of UICR + PERIPHCONF artifacts depend on the 'uicr' image which in turn must be included by Sysbuild, many if not most nrf54h20 applications will need to be built using Sysbuild to function as intended. To make this known to the user, print a CMake warning whenever CONFIG_NRF_PERIPHCONF_SECTION=y but Sysbuild is not being used. Signed-off-by: Jonathan Nilsen (cherry picked from commit d792280a1c8639ac103ce0dd094f8d5dd4e5377d) --- soc/nordic/common/uicr/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/soc/nordic/common/uicr/CMakeLists.txt b/soc/nordic/common/uicr/CMakeLists.txt index 9d5deec52d57..d350d8d3f586 100644 --- a/soc/nordic/common/uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/CMakeLists.txt @@ -20,3 +20,11 @@ if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) zephyr_sources(${periphconf_entries_c_file}) message(STATUS "Generated ${periphconf_entries_c_file} from ${EDT_PICKLE}") endif() + +if(CONFIG_NRF_PERIPHCONF_SECTION AND NOT SYSBUILD) + message(WARNING "CONFIG_NRF_PERIPHCONF_SECTION is enabled, but Sysbuild is not being used. " + "The global peripheral configuration will not be applied unless artifacts " + "are generated manually/externally. To enable automatic generation, build with " + "Sysbuild and ensure that SB_CONFIG_NRF_HALTIUM_GENERATE_UICR=y." + ) +endif() From 8cbb39f9841963559873c09c9c408abbbb6f83f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Thu, 18 Sep 2025 15:46:09 +0200 Subject: [PATCH 0029/3334] [nrf fromlist] drivers: ieee802154: nrf5: Add temporary API migration code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The transmit functions will return an error code, instead of a boolean value. To prepare for this, the API calls are temporarily implemented in two variants, for old and new API declarations. The presence of new API will be detected by the use of NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE macro, which will be unconditionally defined by a newer nrf-802154 driver. Upstream PR #: 96219 Signed-off-by: Rafał Kuźnia (cherry picked from commit b8905458990e76a5f72cfc6f21d4ae9d5576150d) --- drivers/ieee802154/ieee802154_nrf5.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index aa67a1f99e15..e099b2f33a97 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -499,7 +499,13 @@ static bool nrf5_tx_immediate(struct net_pkt *pkt, uint8_t *payload, bool cca) }, }; +#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE + nrf_802154_tx_error_t result = nrf_802154_transmit_raw(payload, &metadata); + + return result == NRF_802154_TX_ERROR_NONE; +#else return nrf_802154_transmit_raw(payload, &metadata); +#endif } #if NRF_802154_CSMA_CA_ENABLED @@ -516,7 +522,13 @@ static bool nrf5_tx_csma_ca(struct net_pkt *pkt, uint8_t *payload) }, }; +#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE + nrf_802154_tx_error_t result = nrf_802154_transmit_csma_ca_raw(payload, &metadata); + + return result == NRF_802154_TX_ERROR_NONE; +#else return nrf_802154_transmit_csma_ca_raw(payload, &metadata); +#endif } #endif @@ -573,7 +585,13 @@ static bool nrf5_tx_at(struct nrf5_802154_data *nrf5_radio, struct net_pkt *pkt, uint64_t tx_at = nrf_802154_timestamp_phr_to_shr_convert( net_pkt_timestamp_ns(pkt) / NSEC_PER_USEC); +#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE + nrf_802154_tx_error_t result = nrf_802154_transmit_raw_at(payload, tx_at, &metadata); + + return result == NRF_802154_TX_ERROR_NONE; +#else return nrf_802154_transmit_raw_at(payload, tx_at, &metadata); +#endif } #endif /* CONFIG_NET_PKT_TXTIME */ From 07ef691a1b0b5e02b3f716069490737d6203b804 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Tue, 23 Sep 2025 11:51:01 +0200 Subject: [PATCH 0030/3334] [nrf fromlist] drivers: i2c: nrfx_twis: fix missing SoC header include In case of nRF TWIS i2c shim, SoC header include is needed for memory region property presence checker macro. Upstream PR #: 96413 Signed-off-by: Nikodem Kastelik (cherry picked from commit 9d15425c577ccc4e261fe68e29b8273ce5d468bf) --- drivers/i2c/i2c_nrfx_twis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c_nrfx_twis.c b/drivers/i2c/i2c_nrfx_twis.c index be55c851f3a7..0fd9b667d23c 100644 --- a/drivers/i2c/i2c_nrfx_twis.c +++ b/drivers/i2c/i2c_nrfx_twis.c @@ -10,7 +10,7 @@ #include #include #include - +#include #include #include From 228a166e001d4255ca24c8098f2c87fd54623e7e Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 17 Sep 2025 14:53:07 +0200 Subject: [PATCH 0031/3334] [nrf fromtree] tests: net: tcp: Add test for FIN,ACK received after final data Add a test case for a scenario where the final data sent by one peer is acknowledged in the FIN,ACK response from the other peer. Verify that the acknowledgment is handled correctly, and a consecutive sequence number sent by the TCP stack in such case is set correctly. This complements the other existing test for FIN packet handling, which verified that data received in a FIN packet is handled correctly. With those tests in place it should be safer to update any logic related to FIN packet handling. Signed-off-by: Robert Lubos (cherry picked from commit 99b435788e66bdb520964468505ef1f881d06e5b) --- tests/net/tcp/src/main.c | 205 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) diff --git a/tests/net/tcp/src/main.c b/tests/net/tcp/src/main.c index 2c0cfcd9ef2c..db57b70a40ef 100644 --- a/tests/net/tcp/src/main.c +++ b/tests/net/tcp/src/main.c @@ -116,6 +116,7 @@ static enum test_case_no { TEST_CLIENT_FIN_ACK_WITH_DATA = 18, TEST_CLIENT_SEQ_VALIDATION = 19, TEST_SERVER_ACK_VALIDATION = 20, + TEST_SERVER_FIN_ACK_AFTER_DATA = 21, } test_case_no; static enum test_state t_state; @@ -142,6 +143,7 @@ static void handle_syn_invalid_ack(sa_family_t af, struct tcphdr *th); static void handle_client_fin_ack_with_data_test(sa_family_t af, struct tcphdr *th); static void handle_client_seq_validation_test(sa_family_t af, struct tcphdr *th); static void handle_server_ack_validation_test(struct net_pkt *pkt); +static void handle_server_fin_ack_after_data_test(sa_family_t af, struct tcphdr *th); static void verify_flags(struct tcphdr *th, uint8_t flags, const char *fun, int line) @@ -494,6 +496,9 @@ static int tester_send(const struct device *dev, struct net_pkt *pkt) case TEST_SERVER_ACK_VALIDATION: handle_server_ack_validation_test(pkt); break; + case TEST_SERVER_FIN_ACK_AFTER_DATA: + handle_server_fin_ack_after_data_test(net_pkt_family(pkt), &th); + break; default: zassert_true(false, "Undefined test case"); } @@ -3002,4 +3007,204 @@ ZTEST(net_tcp, test_server_ack_validation) net_context_put(accepted_ctx); } +#define TEST_FIN_ACK_AFTER_DATA_REQ "request" +#define TEST_FIN_ACK_AFTER_DATA_RSP "test data response" + +/* In this test we check that FIN,ACK packet acknowledging latest data is + * handled correctly by the TCP stack. + */ +static void handle_server_fin_ack_after_data_test(sa_family_t af, struct tcphdr *th) +{ + struct net_pkt *reply = NULL; + + zassert_false(th == NULL && t_state != T_SYN, + "NULL pkt only expected in T_SYN state"); + + switch (t_state) { + case T_SYN: + reply = prepare_syn_packet(af, htons(MY_PORT), htons(PEER_PORT)); + seq++; + t_state = T_SYN_ACK; + break; + case T_SYN_ACK: + test_verify_flags(th, SYN | ACK); + zassert_equal(ntohl(th->th_ack), seq, + "Unexpected ACK in T_SYN_ACK, got %d, expected %d", + ntohl(th->th_ack), seq); + device_initial_seq = ntohl(th->th_seq); + ack = ntohl(th->th_seq) + 1U; + t_state = T_DATA_ACK; + + /* Dummy "request" packet */ + reply = prepare_data_packet(af, htons(MY_PORT), htons(PEER_PORT), + TEST_FIN_ACK_AFTER_DATA_REQ, + sizeof(TEST_FIN_ACK_AFTER_DATA_REQ) - 1); + seq += sizeof(TEST_FIN_ACK_AFTER_DATA_REQ) - 1; + break; + case T_DATA_ACK: + test_verify_flags(th, ACK); + t_state = T_DATA; + zassert_equal(ntohl(th->th_seq), ack, + "Unexpected SEQ in T_DATA_ACK, got %d, expected %d", + get_rel_seq(th), ack); + zassert_equal(ntohl(th->th_ack), seq, + "Unexpected ACK in T_DATA_ACK, got %d, expected %d", + ntohl(th->th_ack), seq); + break; + case T_DATA: + test_verify_flags(th, PSH | ACK); + zassert_equal(ntohl(th->th_seq), ack, + "Unexpected SEQ in T_DATA, got %d, expected %d", + get_rel_seq(th), ack); + zassert_equal(ntohl(th->th_ack), seq, + "Unexpected ACK in T_DATA, got %d, expected %d", + ntohl(th->th_ack), seq); + ack += sizeof(TEST_FIN_ACK_AFTER_DATA_RSP) - 1; + t_state = T_FIN_ACK; + + reply = prepare_fin_ack_packet(af, htons(MY_PORT), htons(PEER_PORT)); + seq++; + break; + case T_FIN_ACK: + test_verify_flags(th, FIN | ACK); + zassert_equal(ntohl(th->th_seq), ack, + "Unexpected SEQ in T_FIN_ACK, got %d, expected %d", + get_rel_seq(th), ack); + zassert_equal(ntohl(th->th_ack), seq, + "Unexpected ACK in T_FIN_ACK, got %d, expected %d", + ntohl(th->th_ack), seq); + + ack++; + t_state = T_CLOSING; + + reply = prepare_ack_packet(af, htons(MY_PORT), htons(PEER_PORT)); + seq++; + break; + case T_CLOSING: + zassert_true(false, "Should not receive anything after final ACK"); + break; + default: + zassert_true(false, "%s unexpected state", __func__); + return; + } + + if (reply != NULL) { + zassert_ok(net_recv_data(net_iface, reply), "%s failed", __func__); + } +} + +/* Receive callback to be installed in the accept handler */ +static void test_fin_ack_after_data_recv_cb(struct net_context *context, + struct net_pkt *pkt, + union net_ip_header *ip_hdr, + union net_proto_header *proto_hdr, + int status, + void *user_data) +{ + zassert_ok(status, "failed to recv the data"); + + if (pkt != NULL) { + uint8_t buf[sizeof(TEST_FIN_ACK_AFTER_DATA_REQ)] = { 0 }; + int data_len = net_pkt_remaining_data(pkt); + + zassert_equal(data_len, sizeof(TEST_FIN_ACK_AFTER_DATA_REQ) - 1, + "Invalid packet length, %d", data_len); + zassert_ok(net_pkt_read(pkt, buf, data_len)); + zassert_mem_equal(buf, TEST_FIN_ACK_AFTER_DATA_REQ, data_len); + + net_pkt_unref(pkt); + } + + test_sem_give(); +} + +static void test_fin_ack_after_data_accept_cb(struct net_context *ctx, + struct sockaddr *addr, + socklen_t addrlen, + int status, + void *user_data) +{ + int ret; + + zassert_ok(status, "failed to accept the conn"); + + /* set callback on newly created context */ + accepted_ctx = ctx; + ret = net_context_recv(ctx, test_fin_ack_after_data_recv_cb, + K_NO_WAIT, NULL); + zassert_ok(ret, "Failed to recv data from peer"); + + /* Ref the context on the app behalf. */ + net_context_ref(ctx); +} + +/* Verify that the TCP stack replies with a valid FIN,ACK after the peer + * acknowledges the latest data in the FIN packet. + * Test case scenario IPv4 + * send SYN, + * expect SYN ACK, + * send ACK with Data, + * expect ACK, + * expect Data, + * send FIN,ACK + * expect FIN,ACK + * send ACK + * any failures cause test case to fail. + */ +ZTEST(net_tcp, test_server_fin_ack_after_data) +{ + struct net_context *ctx; + int ret; + + test_case_no = TEST_SERVER_FIN_ACK_AFTER_DATA; + + t_state = T_SYN; + seq = ack = 0; + + ret = net_context_get(AF_INET, SOCK_STREAM, IPPROTO_TCP, &ctx); + zassert_ok(ret, "Failed to get net_context"); + + net_context_ref(ctx); + + ret = net_context_bind(ctx, (struct sockaddr *)&my_addr_s, + sizeof(struct sockaddr_in)); + zassert_ok(ret, "Failed to bind net_context"); + + /* Put context into listening mode and install accept cb */ + ret = net_context_listen(ctx, 1); + zassert_ok(ret, "Failed to listen on net_context"); + + ret = net_context_accept(ctx, test_fin_ack_after_data_accept_cb, + K_NO_WAIT, NULL); + zassert_ok(ret, "Failed to set accept on net_context"); + + /* Trigger the peer to send SYN */ + handle_server_fin_ack_after_data_test(AF_INET, NULL); + + /* test_fin_ack_after_data_recv_cb will release the semaphore after + * dummy request is read. + */ + test_sem_take(K_MSEC(100), __LINE__); + + /* Send dummy "response" */ + ret = net_context_send(accepted_ctx, TEST_FIN_ACK_AFTER_DATA_RSP, + sizeof(TEST_FIN_ACK_AFTER_DATA_RSP) - 1, NULL, + K_NO_WAIT, NULL); + zassert_equal(ret, sizeof(TEST_FIN_ACK_AFTER_DATA_RSP) - 1, + "Failed to send data to peer %d", ret); + + /* test_fin_ack_after_data_recv_cb will release the semaphore after + * the connection is marked closed. + */ + test_sem_take(K_MSEC(100), __LINE__); + + net_context_put(ctx); + net_context_put(accepted_ctx); + + /* Connection is in TIME_WAIT state, context will be released + * after K_MSEC(CONFIG_NET_TCP_TIME_WAIT_DELAY), so wait for it. + */ + k_sleep(K_MSEC(CONFIG_NET_TCP_TIME_WAIT_DELAY)); +} + ZTEST_SUITE(net_tcp, NULL, presetup, NULL, NULL, NULL); From 3ea99eb6c6c5c56d4bce22afaf9a9efad6b5eb92 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 17 Sep 2025 16:10:28 +0200 Subject: [PATCH 0032/3334] [nrf fromtree] net: tcp: Fix ACK processing when FIN packet is received In case FIN packed also acknowledged most recently sent data, not all ack-related TCP context variables were updated, resulting in invalid SEQ number values sent in consecutive packets. Fix this by refactoring the FIN handling in TCP_ESTABLISHED state. Instead of having a separate block strictly for FIN packet processing, let the packet be processed by common code responsible for regular data/ack processing. This should be less error-prone for any future modifications or not-yet-discovered issues. Only after the common processing of data/ack is done, we check whether FIN flag was present in the packet, and mark the connection for closing. Signed-off-by: Robert Lubos (cherry picked from commit 178150590cfada9eab9336c1119558759d614ac6) --- subsys/net/ip/tcp.c | 76 ++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/subsys/net/ip/tcp.c b/subsys/net/ip/tcp.c index 270675fe27fd..f86e782ac9f5 100644 --- a/subsys/net/ip/tcp.c +++ b/subsys/net/ip/tcp.c @@ -2719,7 +2719,7 @@ static void tcp_queue_recv_data(struct tcp *conn, struct net_pkt *pkt, } static enum net_verdict tcp_data_received(struct tcp *conn, struct net_pkt *pkt, - size_t *len, bool psh) + size_t *len, bool psh, bool fin) { enum net_verdict ret; @@ -2732,6 +2732,13 @@ static enum net_verdict tcp_data_received(struct tcp *conn, struct net_pkt *pkt, net_stats_update_tcp_seg_recv(conn->iface); conn_ack(conn, *len); + /* In case FIN was received, don't send ACK just yet, FIN,ACK will be + * sent instead. + */ + if (fin) { + return ret; + } + /* Delay ACK response in case of small window or missing PSH, * as described in RFC 813. */ @@ -3143,37 +3150,8 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) } break; - case TCP_ESTABLISHED: - /* full-close */ - if (FL(&fl, &, FIN, th_seq(th) == conn->ack)) { - if (len) { - verdict = tcp_data_get(conn, pkt, &len); - if (verdict == NET_OK) { - /* net_pkt owned by the recv fifo now */ - pkt = NULL; - } - } else { - verdict = NET_OK; - } - - conn_ack(conn, + len + 1); - keep_alive_timer_stop(conn); - - if (net_tcp_seq_cmp(th_ack(th), conn->seq) > 0) { - uint32_t len_acked = th_ack(th) - conn->seq; - - conn_seq(conn, + len_acked); - } - - tcp_out(conn, FIN | ACK); - conn_seq(conn, + 1); - tcp_setup_retransmission(conn); - - tcp_setup_last_ack_timer(conn); - next = TCP_LAST_ACK; - - break; - } + case TCP_ESTABLISHED: { + bool fin = FL(&fl, &, FIN, th_seq(th) == conn->ack); /* Whatever we've received, we know that peer is alive, so reset * the keepalive timer. @@ -3279,11 +3257,21 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) /* We are closing the connection, send a FIN to peer */ if (conn->in_close && conn->send_data_total == 0) { - next = TCP_FIN_WAIT_1; - - k_work_reschedule_for_queue(&tcp_work_q, - &conn->fin_timer, - FIN_TIMEOUT); + if (fin) { + /* If FIN was also present in the processed + * packet, acknowledge that and jump directly + * to TCP_LAST_ACK. + */ + conn_ack(conn, + 1); + next = TCP_LAST_ACK; + tcp_setup_last_ack_timer(conn); + } else { + /* Otherwise, wait for FIN in TCP_FIN_WAIT_1 */ + next = TCP_FIN_WAIT_1; + k_work_reschedule_for_queue(&tcp_work_q, + &conn->fin_timer, + FIN_TIMEOUT); + } tcp_out(conn, FIN | ACK); conn_seq(conn, + 1); @@ -3314,7 +3302,7 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) data_recv: psh = FL(&fl, &, PSH); - verdict = tcp_data_received(conn, pkt, &len, psh); + verdict = tcp_data_received(conn, pkt, &len, psh, fin); if (verdict == NET_OK) { /* net_pkt owned by the recv fifo now */ pkt = NULL; @@ -3358,7 +3346,19 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) k_sem_give(&conn->tx_sem); } + /* Finally, after all Data/ACK processing, check for FIN flag. */ + if (fin) { + keep_alive_timer_stop(conn); + conn_ack(conn, + 1); + tcp_out(conn, FIN | ACK); + conn_seq(conn, + 1); + tcp_setup_retransmission(conn); + tcp_setup_last_ack_timer(conn); + next = TCP_LAST_ACK; + } + break; + } case TCP_CLOSE_WAIT: /* Half-close is not supported, so do nothing here */ break; From dc96fd7014822b33830f14ba3a3bf2eac71a15e4 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 18 Sep 2025 14:04:29 +0200 Subject: [PATCH 0033/3334] [nrf fromtree] net: mdns_responder: Align with dns_unpack_query() change dns_unpack_query() no longer prepends the unpacked query with extra dot, therefore mDNS responder needs to be aligned with this change when parsing result and preparing response. Signed-off-by: Robert Lubos (cherry picked from commit 9e5922952aef97f5575b126005b319021689314f) --- subsys/net/lib/dns/mdns_responder.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/subsys/net/lib/dns/mdns_responder.c b/subsys/net/lib/dns/mdns_responder.c index a867cd079a13..e60ab9b70029 100644 --- a/subsys/net/lib/dns/mdns_responder.c +++ b/subsys/net/lib/dns/mdns_responder.c @@ -274,23 +274,19 @@ static void setup_dns_hdr(uint8_t *buf, uint16_t answers) static void add_answer(struct net_buf *query, enum dns_rr_type qtype, uint32_t ttl, uint16_t addr_len, uint8_t *addr) { - char *dot = query->data + DNS_MSG_HEADER_SIZE; - char *prev = NULL; + char *dot = query->data + DNS_MSG_HEADER_SIZE + 1; + char *prev = query->data + DNS_MSG_HEADER_SIZE; uint16_t offset; - while ((dot = strchr(dot, '.'))) { - if (!prev) { - prev = dot++; - continue; - } + /* For the length of the first label. */ + query->len += 1; + while ((dot = strchr(dot, '.')) != NULL) { *prev = dot - prev - 1; prev = dot++; } - if (prev) { - *prev = strlen(prev) - 1; - } + *prev = strlen(prev + 1); /* terminator byte (0x00) */ query->len += 1; @@ -322,14 +318,15 @@ static int create_answer(int sock, /* Prepare the response into the query buffer: move the name * query buffer has to get enough free space: dns_hdr + answer */ - if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + + if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + 1 + DNS_QTYPE_LEN + DNS_QCLASS_LEN + DNS_TTL_LEN + DNS_RDLENGTH_LEN + addr_len)) { return -ENOBUFS; } - memmove(query->data + DNS_MSG_HEADER_SIZE, query->data, query->len); + /* +1 for the initial label length */ + memmove(query->data + DNS_MSG_HEADER_SIZE + 1, query->data, query->len); setup_dns_hdr(query->data, 1); @@ -641,7 +638,7 @@ static int dns_read(int sock, } /* Handle only .local queries */ - lquery = strrchr(result->data + 1, '.'); + lquery = strrchr(result->data, '.'); if (!lquery || memcmp(lquery, (const void *){ ".local" }, 7)) { continue; } @@ -654,9 +651,9 @@ static int dns_read(int sock, * We skip the first dot, and make sure there is dot after * matching hostname. */ - if (!strncasecmp(hostname, result->data + 1, hostname_len) && - (result->len - 1) >= hostname_len && - &(result->data + 1)[hostname_len] == lquery) { + if (!strncasecmp(hostname, result->data, hostname_len) && + (result->len) >= hostname_len && + &result->data[hostname_len] == lquery) { NET_DBG("%s %s %s to our hostname %s%s", "mDNS", family == AF_INET ? "IPv4" : "IPv6", "query", hostname, ".local"); From 2df4854efd730ed5adff6d3e6471b0964e193b88 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 18 Sep 2025 15:26:06 +0200 Subject: [PATCH 0034/3334] [nrf fromtree] net: llmnr_responder: Align with dns_unpack_query() change dns_unpack_query() no longer prepends the unpacked query with extra dot, therefore LLMNR responder needs to be aligned with this change when parsing result and preparing response. Signed-off-by: Robert Lubos (cherry picked from commit fda82471dbf1281c857c17672bf9bbe53242d23d) --- subsys/net/lib/dns/llmnr_responder.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/subsys/net/lib/dns/llmnr_responder.c b/subsys/net/lib/dns/llmnr_responder.c index c8b1500b1b01..7dfa682f53d6 100644 --- a/subsys/net/lib/dns/llmnr_responder.c +++ b/subsys/net/lib/dns/llmnr_responder.c @@ -192,23 +192,19 @@ static void setup_dns_hdr(uint8_t *buf, uint16_t answers, uint16_t dns_id) static void add_question(struct net_buf *query, enum dns_rr_type qtype) { - char *dot = query->data + DNS_MSG_HEADER_SIZE; - char *prev = NULL; + char *dot = query->data + DNS_MSG_HEADER_SIZE + 1; + char *prev = query->data + DNS_MSG_HEADER_SIZE; uint16_t offset; - while ((dot = strchr(dot, '.'))) { - if (!prev) { - prev = dot++; - continue; - } + /* For the length of the first label. */ + query->len += 1; + while ((dot = strchr(dot, '.')) != NULL) { *prev = dot - prev - 1; prev = dot++; } - if (prev) { - *prev = strlen(prev) - 1; - } + *prev = strlen(prev + 1); offset = DNS_MSG_HEADER_SIZE + query->len + 1; UNALIGNED_PUT(htons(qtype), (uint16_t *)(query->data+offset)); @@ -245,14 +241,15 @@ static int create_answer(enum dns_rr_type qtype, /* Prepare the response into the query buffer: move the name * query buffer has to get enough free space: dns_hdr + query + answer */ - if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + + if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + 1 + (DNS_QTYPE_LEN + DNS_QCLASS_LEN) * 2 + DNS_TTL_LEN + DNS_RDLENGTH_LEN + addr_len + query->len)) { return -ENOBUFS; } - memmove(query->data + DNS_MSG_HEADER_SIZE, query->data, query->len); + /* +1 for the initial label length */ + memmove(query->data + DNS_MSG_HEADER_SIZE + 1, query->data, query->len); setup_dns_hdr(query->data, 1, dns_id); @@ -488,8 +485,8 @@ static int dns_read(int sock, result->data, ret); /* If the query matches to our hostname, then send reply */ - if (!strncasecmp(hostname, result->data + 1, hostname_len) && - (result->len - 1) >= hostname_len) { + if (!strncasecmp(hostname, result->data, hostname_len) && + (result->len) >= hostname_len) { NET_DBG("%s query to our hostname %s", "LLMNR", hostname); ret = send_response(sock, src_addr, addrlen, result, qtype, From a8505576178c946dcb7e45fd1f8ab3ceec3b4b3d Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 18 Sep 2025 15:32:15 +0200 Subject: [PATCH 0035/3334] [nrf fromtree] tests: net: socket: getaddrinfo: Align with dns_unpack_query() change Not sure why didn't this cause the test to fail, but just for completeness, align this test suite with dns_unpack_query() change as well. Signed-off-by: Robert Lubos (cherry picked from commit c8858445372512b2e8861875448ce43640f76beb) --- tests/net/socket/getaddrinfo/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/net/socket/getaddrinfo/src/main.c b/tests/net/socket/getaddrinfo/src/main.c index c412cce87f41..25be0205ea87 100644 --- a/tests/net/socket/getaddrinfo/src/main.c +++ b/tests/net/socket/getaddrinfo/src/main.c @@ -96,7 +96,7 @@ static bool check_dns_query(uint8_t *buf, int buf_len) /* In this test we are just checking if the query came to us in correct * form, we are not creating a DNS server implementation here. */ - if (strncmp(result->data + 1, QUERY_HOST, + if (strncmp(result->data, QUERY_HOST, sizeof(QUERY_HOST) - 1)) { net_buf_unref(result); return false; From e31af5a58009d1ec35511a787f90c205938b99ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 22 Sep 2025 16:05:13 +0200 Subject: [PATCH 0036/3334] [nrf fromlist] drivers: sensor: qdec_nrfx: add conditional PM ISR safety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requesting/releasing QDEC device may be ISR safe, but it cannot be reliably known whether managing its power domain is. Is is then assumed that if power domains are used, device is no longer ISR safe. This macro let's us check if we will be requesting/releasing power domains and determines PM device ISR safety value. Upstream PR #: 96402 Signed-off-by: Michał Stasiak (cherry picked from commit e282b635858d19b43e8fd55ff723e1a78d512df3) --- drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c index 9ecfb5c122da..0d5eb5ab8cc2 100644 --- a/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c +++ b/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c @@ -272,6 +272,26 @@ static int qdec_nrfx_init(const struct device *dev) #define QDEC(idx) DT_NODELABEL(qdec##idx) #define QDEC_PROP(idx, prop) DT_PROP(QDEC(idx), prop) +/* Macro determines PM actions interrupt safety level. + * + * Requesting/releasing QDEC device may be ISR safe, but it cannot be reliably known whether + * managing its power domain is. It is then assumed that if power domains are used, device is + * no longer ISR safe. This macro let's us check if we will be requesting/releasing + * power domains and determines PM device ISR safety value. + */ +#define QDEC_PM_ISR_SAFE(idx) \ + COND_CODE_1( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND( \ + DT_NODE_HAS_PROP(QDEC(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(QDEC(idx), power_domains)) \ + ) \ + ), \ + (0), \ + (PM_DEVICE_ISR_SAFE) \ + ) + #define SENSOR_NRFX_QDEC_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QDEC(idx)); \ BUILD_ASSERT(QDEC_PROP(idx, steps) > 0, \ @@ -301,7 +321,7 @@ static int qdec_nrfx_init(const struct device *dev) .enable_pin = DT_PROP_OR(QDEC(idx), enable_pin, NRF_QDEC_PIN_NOT_CONNECTED), \ .steps = QDEC_PROP(idx, steps), \ }; \ - PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \ + PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, QDEC_PM_ISR_SAFE(idx)); \ SENSOR_DEVICE_DT_DEFINE(QDEC(idx), \ qdec_nrfx_init, \ PM_DEVICE_DT_GET(QDEC(idx)), \ From ada35d672f9ebb40d53e793dc349b81cc87cfa8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 22 Sep 2025 16:23:57 +0200 Subject: [PATCH 0037/3334] [nrf fromlist] drivers: spi: spi_nrfx_spis: add conditional PM ISR safety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requesting/releasing SPIM device may be ISR safe, but it cannot be reliably known whether managing its power domain is. Is is then assumed that if power domains are used, device is no longer ISR safe. This macro let's us check if we will be requesting/releasing power domains and determines PM device ISR safety value. Upstream PR #: 96402 Signed-off-by: Michał Stasiak (cherry picked from commit c6ef6c013f9a04ba90bc7790dad9dbe92e925515) --- drivers/spi/spi_nrfx_spis.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index 64c9a6f14c45..aa59d9abc9b2 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -551,6 +551,32 @@ static int spi_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, spi_nrfx_pm_action); } +/* Macro determines PM actions interrupt safety level. + * + * Requesting/releasing SPIS device may be ISR safe, but it cannot be reliably known whether + * managing its power domain is. It is then assumed that if power domains are used, device is + * no longer ISR safe. This macro let's us check if we will be requesting/releasing + * power domains and determines PM device ISR safety value. + * + * Additionally, fast SPIS devices are not ISR safe. + */ +#define SPIS_PM_ISR_SAFE(idx) \ + COND_CODE_1( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND( \ + DT_NODE_HAS_PROP(SPIS(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(SPIS(idx), power_domains)) \ + ) \ + ), \ + (0), \ + (COND_CODE_1( \ + SPIS_IS_FAST(idx), \ + (0), \ + (PM_DEVICE_ISR_SAFE) \ + )) \ + ) + #define SPI_NRFX_SPIS_DEFINE(idx) \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ static void irq_connect##idx(void) \ @@ -597,8 +623,7 @@ static int spi_nrfx_init(const struct device *dev) !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ "WAKE line must be configured as active high"); \ PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, \ - COND_CODE_1(SPIS_IS_FAST(idx), (0), \ - (PM_DEVICE_ISR_SAFE))); \ + SPIS_PM_ISR_SAFE(idx)); \ SPI_DEVICE_DT_DEFINE(SPIS(idx), \ spi_nrfx_init, \ PM_DEVICE_DT_GET(SPIS(idx)), \ From e894f6bbb6a21e80607cd3705778354abdda99df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 22 Sep 2025 16:28:49 +0200 Subject: [PATCH 0038/3334] [nrf fromlist] drivers: i2c: i2c_nrfx_twim: add conditional PM ISR safety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requesting/releasing TWIM device may be ISR safe, but it cannot be reliably known whether managing its power domain is. Is is then assumed that if power domains are used, device is no longer ISR safe. This macro let's us check if we will be requesting/releasing power domains and determines PM device ISR safety value. Upstream PR #: 96402 Signed-off-by: Michał Stasiak (cherry picked from commit 5b0d71f3017e8a8f73cb2e4048ad2eb52e15bdf6) --- drivers/i2c/i2c_nrfx_twim.c | 2 +- drivers/i2c/i2c_nrfx_twim_common.h | 20 ++++++++++++++++++++ drivers/i2c/i2c_nrfx_twim_rtio.c | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index e3c307231ab1..bc26bf841124 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -285,7 +285,7 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { DT_PROP(I2C(idx), easydma_maxcnt_bits)), \ }; \ PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \ - PM_DEVICE_ISR_SAFE); \ + I2C_PM_ISR_SAFE(idx)); \ I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \ i2c_nrfx_twim_init, \ i2c_nrfx_twim_deinit, \ diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index 3c5c82311bae..d476ba3f05ff 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -31,6 +31,26 @@ extern "C" { #define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ I2C_BITRATE_STANDARD)) +/* Macro determines PM actions interrupt safety level. + * + * Requesting/releasing TWIM device may be ISR safe, but it cannot be reliably known whether + * managing its power domain is. It is then assumed that if power domains are used, device is + * no longer ISR safe. This macro let's us check if we will be requesting/releasing + * power domains and determines PM device ISR safety value. + */ +#define I2C_PM_ISR_SAFE(idx) \ + COND_CODE_1( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND( \ + DT_NODE_HAS_PROP(I2C(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(I2C(idx), power_domains)) \ + ) \ + ), \ + (0), \ + (PM_DEVICE_ISR_SAFE) \ + ) + struct i2c_nrfx_twim_common_config { nrfx_twim_t twim; nrfx_twim_config_t twim_config; diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 0ddf5ffdd777..7326deaafb03 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -287,7 +287,7 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) }, \ .ctx = &_i2c##idx##_twim_rtio, \ }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \ + PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ From f0f4572cc889df85ec0bfc78da9b6a132214a50e Mon Sep 17 00:00:00 2001 From: Tommi Kangas Date: Mon, 22 Sep 2025 12:50:00 +0300 Subject: [PATCH 0039/3334] [nrf fromtree] boards: nrf9280pdk: Add missing overlays for rev. 0.2.0 Added missing cpuapp/iron and cpuppr/xip overlays for rev. 0.2.0. Signed-off-by: Tommi Kangas (cherry picked from commit 9d10d67bcb15a70e3db91893aec2585399ca2dc0) --- .../nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay | 7 +++++++ .../nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay create mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay new file mode 100644 index 000000000000..f2d986e6cb06 --- /dev/null +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay new file mode 100644 index 000000000000..f2d986e6cb06 --- /dev/null +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" From b34a242a9273d01ec2138a8b301ef05f862cc71a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 19 Sep 2025 08:32:00 +0100 Subject: [PATCH 0040/3334] [nrf fromlist] cmake: Use temp. for edt pickle CMake output This potentially fixes an issues whereby when sysbuild projects import dts configuration from images and images are reconfigured, that sysbuild will needlessly rerun even if the output has not changed by using a temporary output file and then only updating the actual file if the contents have changed Upstream PR #: 96259 Signed-off-by: Jamie McCrae (cherry picked from commit 524b50c394d05ad2ac759ee588ded4371f037867) --- cmake/modules/extensions.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake index 55ce61fffc6a..5aacb8690da0 100644 --- a/cmake/modules/extensions.cmake +++ b/cmake/modules/extensions.cmake @@ -4705,6 +4705,7 @@ function(zephyr_dt_import) zephyr_check_arguments_required_all(${CMAKE_CURRENT_FUNCTION} arg ${req_single_args}) set(gen_dts_cmake_script ${ZEPHYR_BASE}/scripts/dts/gen_dts_cmake.py) + set(gen_dts_cmake_temp ${arg_EDT_PICKLE_FILE}.cmake.new) set(gen_dts_cmake_output ${arg_EDT_PICKLE_FILE}.cmake) if((${arg_EDT_PICKLE_FILE} IS_NEWER_THAN ${gen_dts_cmake_output}) OR @@ -4713,11 +4714,13 @@ function(zephyr_dt_import) execute_process( COMMAND ${PYTHON_EXECUTABLE} ${gen_dts_cmake_script} --edt-pickle ${arg_EDT_PICKLE_FILE} - --cmake-out ${gen_dts_cmake_output} + --cmake-out ${gen_dts_cmake_temp} WORKING_DIRECTORY ${PROJECT_BINARY_DIR} RESULT_VARIABLE ret COMMAND_ERROR_IS_FATAL ANY ) + + file(COPY_FILE ${gen_dts_cmake_temp} ${gen_dts_cmake_output} ONLY_IF_DIFFERENT) endif() set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${gen_dts_cmake_script}) From 78aa98967aefa2451850d57f4e66d8da86b66941 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 4 Sep 2025 10:39:25 +0100 Subject: [PATCH 0041/3334] [nrf fromtree] boards: nordic: nrf54lm20dk: Add aliases for MCUboot button/LED Adds aliases so that these can be used by MCUboot Signed-off-by: Jamie McCrae (cherry picked from commit b6e09135cb6675e876992f117257b46d20e3e4a5) --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index d6184705899d..c6943b5a1028 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -21,6 +21,11 @@ zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; + + aliases { + mcuboot-button0 = &button0; + mcuboot-led0 = &led0; + }; }; &cpuapp_sram { From 326936b9365c7fae14912fb6b3f26a33867e7240 Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Wed, 10 Sep 2025 11:09:58 +0200 Subject: [PATCH 0042/3334] [nrf fromtree] drivers: flash: nrf_rram: add support for RRAM throttling Some applications need to throttle RRAM writes to handle peak current management. Add CONFIG_NRF_RRAM_THROTTLING_DATA_BLOCK which defines the maximum chunk length that can be written at once. Add CONFIG_NRF_RRAM_THROTTLING_DELAY which configures the sleep delay in microseconds after each write. Signed-off-by: Riadh Ghaddab (cherry picked from commit a4f5d9fb31e68a3361d44665a551bce863dc5840) --- drivers/flash/Kconfig.nrf_rram | 23 +++++++++++++++++++++++ drivers/flash/soc_flash_nrf_rram.c | 21 +++++++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/drivers/flash/Kconfig.nrf_rram b/drivers/flash/Kconfig.nrf_rram index 3dea687a0f80..b40bb16968bf 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -56,8 +56,15 @@ config SOC_FLASH_NRF_RADIO_SYNC_NONE bool "none" help disable synchronization between flash memory driver and radio. + endchoice +config SOC_FLASH_NRF_THROTTLING + bool "Nordic nRFx throttling for flash write operations" + help + Enable throttling for flash write operations to avoid overloading the + flash memory controller. + config SOC_FLASH_NRF_TIMEOUT_MULTIPLIER int "Multiplier for flash operation timeouts [x0.1]" depends on !SOC_FLASH_NRF_RADIO_SYNC_NONE @@ -81,4 +88,20 @@ config NRF_RRAM_REGION_SIZE_UNIT help Base unit for the size of RRAMC's region protection. +config NRF_RRAM_THROTTLING_DELAY + int "Delay between flash write operations" + depends on SOC_FLASH_NRF_THROTTLING + default 2000 + help + This is the delay (in microseconds) between consecutive flash write + operations when throttling is enabled. + +config NRF_RRAM_THROTTLING_DATA_BLOCK + int "Number of Data blocks for each flash write operations" + depends on SOC_FLASH_NRF_THROTTLING + default 16 + help + This is the number of data blocks (in number of 128-bit words) for flash write + operations when throttling is enabled. + endif # SOC_FLASH_NRF_RRAM diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index d26a15cf7236..9f0e24dc33d5 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -159,11 +159,24 @@ static void rram_write(off_t addr, const void *data, size_t len) nrf_rramc_config_set(NRF_RRAMC, &config); #endif - if (data) { - memcpy((void *)addr, data, len); - } else { - memset((void *)addr, ERASE_VALUE, len); + size_t chunk_len = len; + +#ifdef CONFIG_SOC_FLASH_NRF_THROTTLING + while (len > 0) { + chunk_len = MIN(len, CONFIG_NRF_RRAM_THROTTLING_DATA_BLOCK * WRITE_LINE_SIZE); +#endif /* CONFIG_SOC_FLASH_NRF_THROTTLING */ + if (data) { + memcpy((void *)addr, data, chunk_len); + } else { + memset((void *)addr, ERASE_VALUE, chunk_len); + } +#ifdef CONFIG_SOC_FLASH_NRF_THROTTLING + addr += chunk_len; + data = (const uint8_t *)data + chunk_len; + len -= chunk_len; + k_usleep(CONFIG_NRF_RRAM_THROTTLING_DELAY); } +#endif /* CONFIG_SOC_FLASH_NRF_THROTTLING */ barrier_dmem_fence_full(); /* Barrier following our last write. */ From 7e0ca2034b5123e631a30fdf2b077858c4a30f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 18 Sep 2025 12:45:59 +0200 Subject: [PATCH 0043/3334] [nrf fromtree] drivers: mspi_dw: Add option to offload handling of FIFOs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provide a Kconfig option that allows offloading handling of the SSI FIFOs, which the driver normally executes in the interrupt handler, to the system workqueue. Signed-off-by: Andrzej Głąbek (cherry picked from commit 30c4130b2437993c9f644f6616d0eacb37e96d08) --- drivers/mspi/Kconfig.dw | 9 ++++ drivers/mspi/mspi_dw.c | 100 ++++++++++++++++++++++++++++++++-------- 2 files changed, 91 insertions(+), 18 deletions(-) diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index 06d2e09c8af1..cff148c138c6 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -12,6 +12,15 @@ config MSPI_DW if MSPI_DW +config MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE + bool "Handle FIFO in system workqueue" + help + When the driver does not use DMA for transferring data to/from the + SSI FIFOs, handling of those may take a significant amount of time. + It may be destructive for some applications if that time is spent + in the interrupt context. This option allows offloading the job to + the system workqueue. + config MSPI_DW_TXD_DIV int "Designware SSI TX Drive edge divisor" default 4 diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 66f257839aa4..f1195314c6c2 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -71,6 +71,12 @@ struct mspi_dw_data { /* For locking of controller configuration. */ struct k_sem cfg_lock; struct mspi_xfer xfer; + +#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) + struct k_work fifo_work; + const struct device *dev; + uint32_t imr; +#endif }; struct mspi_dw_config { @@ -111,7 +117,7 @@ DEFINE_MM_REG_RD_WR(rxftlr, 0x1c) DEFINE_MM_REG_RD(txflr, 0x20) DEFINE_MM_REG_RD(rxflr, 0x24) DEFINE_MM_REG_RD(sr, 0x28) -DEFINE_MM_REG_WR(imr, 0x2c) +DEFINE_MM_REG_RD_WR(imr, 0x2c) DEFINE_MM_REG_RD(isr, 0x30) DEFINE_MM_REG_RD(risr, 0x34) DEFINE_MM_REG_RD_WR(dr, 0x60) @@ -218,6 +224,8 @@ static bool tx_dummy_bytes(const struct device *dev) write_dr(dev, dummy_val); } while (--dummy_bytes); + dev_data->dummy_bytes = 0; + /* Set the TX start level to 0, so that the transmission will be * started now if it hasn't been yet. The threshold value is also * set to 0 here, but it doesn't really matter, as the interrupt @@ -280,7 +288,18 @@ static bool read_rx_fifo(const struct device *dev, return false; } -static void mspi_dw_isr(const struct device *dev) +static inline void set_imr(const struct device *dev, uint32_t imr) +{ +#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) + struct mspi_dw_data *dev_data = dev->data; + + dev_data->imr = imr; +#else + write_imr(dev, imr); +#endif +} + +static void handle_fifos(const struct device *dev) { struct mspi_dw_data *dev_data = dev->data; const struct mspi_xfer_packet *packet = @@ -302,42 +321,82 @@ static void mspi_dw_isr(const struct device *dev) finished = true; } } else { - uint32_t int_status = read_isr(dev); + for (;;) { + /* Use RISR, not ISR, because when this function is + * executed through the system workqueue, all interrupts + * are masked (IMR is 0). + */ + uint32_t int_status = read_risr(dev); - do { - if (int_status & ISR_RXFIS_BIT) { + if (int_status & RISR_RXFIR_BIT) { if (read_rx_fifo(dev, packet)) { finished = true; break; } - if (read_risr(dev) & RISR_RXOIR_BIT) { + if (int_status & RISR_RXOIR_BIT) { finished = true; break; } - int_status = read_isr(dev); + /* Refresh interrupt status, as during reading + * from the RX FIFO, the TX FIFO status might + * have changed. + */ + int_status = read_risr(dev); } - if (int_status & ISR_TXEIS_BIT) { - if (tx_dummy_bytes(dev)) { - /* All the required dummy bytes were - * written to the FIFO; disable the TXE - * interrupt, as it's no longer needed. - */ - write_imr(dev, IMR_RXFIM_BIT); - } + if (dev_data->dummy_bytes == 0 || + !(int_status & RISR_TXEIR_BIT)) { + break; + } - int_status = read_isr(dev); + if (tx_dummy_bytes(dev)) { + /* All the required dummy bytes were written + * to the FIFO; disable the TXE interrupt, + * as it's no longer needed. + */ + set_imr(dev, IMR_RXFIM_BIT); } - } while (int_status != 0); + } } if (finished) { - write_imr(dev, 0); + set_imr(dev, 0); k_sem_give(&dev_data->finished); } +} + +#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) +static void fifo_work_handler(struct k_work *work) +{ + struct mspi_dw_data *dev_data = + CONTAINER_OF(work, struct mspi_dw_data, fifo_work); + const struct device *dev = dev_data->dev; + + handle_fifos(dev); + + write_imr(dev, dev_data->imr); +} +#endif + +static void mspi_dw_isr(const struct device *dev) +{ +#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) + struct mspi_dw_data *dev_data = dev->data; + int rc; + + dev_data->imr = read_imr(dev); + write_imr(dev, 0); + + rc = k_work_submit(&dev_data->fifo_work); + if (rc < 0) { + LOG_ERR("k_work_submit failed: %d\n", rc); + } +#else + handle_fifos(dev); +#endif vendor_specific_irq_clear(dev); } @@ -1426,6 +1485,11 @@ static int dev_init(const struct device *dev) k_sem_init(&dev_data->cfg_lock, 1, 1); k_sem_init(&dev_data->ctx_lock, 1, 1); +#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) + dev_data->dev = dev; + k_work_init(&dev_data->fifo_work, fifo_work_handler); +#endif + for (ce_gpio = dev_config->ce_gpios; ce_gpio < &dev_config->ce_gpios[dev_config->ce_gpios_len]; ce_gpio++) { From d02df6285076303e3c6616cf17eab55a03c7b427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 24 Sep 2025 09:36:30 +0200 Subject: [PATCH 0044/3334] [nrf fromtree] tests: mspi: flash: Add scenario for new mspi_dw option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add test scenario for a Kconfig option that was recently added to the mspi_dw driver. Testing it requires performing some transfers on the MSPI bus with some device, hence flash chip test used. Signed-off-by: Andrzej Głąbek (cherry picked from commit b624a0757de441f3d687c6c8ed988e77703a80c1) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 23 ++++++++++++++++++ tests/drivers/mspi/flash/testcase.yaml | 24 +++++++++++-------- 2 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..6e0d84e07cdb --- /dev/null +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + mspi0 = &exmif; + }; +}; + +&gpio6 { + status = "okay"; +}; + +&exmif { + status = "okay"; +}; + +&mx25uw63 { + status = "okay"; +}; diff --git a/tests/drivers/mspi/flash/testcase.yaml b/tests/drivers/mspi/flash/testcase.yaml index 72755fd2aa43..dba610a40235 100644 --- a/tests/drivers/mspi/flash/testcase.yaml +++ b/tests/drivers/mspi/flash/testcase.yaml @@ -1,16 +1,18 @@ # Copyright (c) 2024 Ambiq Micro Inc. # SPDX-License-Identifier: Apache-2.0 +common: + tags: + - drivers + - mspi + - flash + harness: ztest + tests: drivers.mspi.flash: - tags: - - drivers - - mspi - - flash filter: dt_compat_enabled("zephyr,mspi-emul-flash") or dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("jedec,mspi-nor") or dt_compat_enabled("mspi-atxp032") or dt_compat_enabled("mspi-is25xX0xx") - harness: ztest platform_allow: - native_sim - apollo3p_evb @@ -20,15 +22,17 @@ tests: - apollo3p_evb - apollo510_evb drivers.mspi.flash.xip_read: - tags: - - drivers - - mspi - - flash filter: dt_compat_enabled("mspi-is25xX0xx") - harness: ztest platform_allow: - apollo510_evb integration_platforms: - apollo510_evb extra_configs: - CONFIG_FLASH_MSPI_XIP_READ=y + drivers.mspi.flash.mspi_dw_system_workqueue: + filter: dt_alias_exists("mspi0") and dt_compat_enabled("jedec,mspi-nor") + and CONFIG_MSPI_DW + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_configs: + - CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE=y From 701ae1edd94bc43ac0846ebc6d7351aecb3d3d4d Mon Sep 17 00:00:00 2001 From: Nicolae Dicu Date: Wed, 17 Sep 2025 14:44:03 +0300 Subject: [PATCH 0045/3334] [nrf fromtree] scripts: requirements: Use gitlint-core for loose requirements Gitlint-core has loose requirements and not conflicting with scancode-toolkit v32.4.1 (click==8.1.3 vs click>=8.2.0). Signed-off-by: Nicolae Dicu (cherry picked from commit 67b4063a207ab87c28851513246b28433ef101ed) --- scripts/requirements-actions.in | 2 +- scripts/requirements-actions.txt | 6 +----- scripts/requirements-compliance.txt | 2 +- scripts/requirements-extras.txt | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 6baf9dc9e3f4..cc170f59d779 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -6,7 +6,7 @@ clang-format>=15.0.0 elasticsearch<9 exceptiongroup>=1.0.0rc8 gcovr==6.0 -gitlint>=0.19.1 +gitlint-core>=0.19.1 gitpython>=3.1.41 ijson intelhex diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 21505203bfa6..32173378473d 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -345,14 +345,10 @@ gitdb==4.0.12 \ --hash=sha256:5ef71f855d191a3326fcfbc0d5da835f26b13fbcba60c32c21091c349ffdb571 \ --hash=sha256:67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf # via gitpython -gitlint==0.19.1 \ - --hash=sha256:26bb085959148d99fbbc178b4e56fda6c3edd7646b7c2a24d8ee1f8e036ed85d \ - --hash=sha256:b5b70fb894e80849b69abbb65ee7dbb3520fc3511f202a6e6b6ddf1a71ee8f61 - # via -r requirements-actions.in gitlint-core==0.19.1 \ --hash=sha256:7bf977b03ff581624a9e03f65ebb8502cc12dfaa3e92d23e8b2b54bbdaa29992 \ --hash=sha256:f41effd1dcbc06ffbfc56b6888cce72241796f517b46bd9fd4ab1b145056988c - # via gitlint + # via -r requirements-actions.in gitpython==3.1.44 \ --hash=sha256:9e0e10cda9bed1ee64bc9a6de50e7e38a9c9943241cd7f585f6df3ed28011110 \ --hash=sha256:c87e30b26253bf5418b01b0660f818967f3c503193838337fe5e573331249269 diff --git a/scripts/requirements-compliance.txt b/scripts/requirements-compliance.txt index 6d90ac4b2587..dcb8baae0f97 100644 --- a/scripts/requirements-compliance.txt +++ b/scripts/requirements-compliance.txt @@ -3,7 +3,7 @@ # used by ci/check_compliance # zephyr-keep-sorted-start clang-format>=15.0.0 -gitlint +gitlint-core junitparser>=4.0.1 lxml>=5.3.0 pykwalify diff --git a/scripts/requirements-extras.txt b/scripts/requirements-extras.txt index 59f2eb3ff986..b7a93427d725 100644 --- a/scripts/requirements-extras.txt +++ b/scripts/requirements-extras.txt @@ -10,7 +10,7 @@ gitpython>=3.1.41 plotly # helper for developers - check git commit messages -gitlint +gitlint-core # helper for developers junit2html From b0443875a7e46b27f7b7b0f4d4434ba9808dfd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Tue, 16 Sep 2025 21:31:41 +0200 Subject: [PATCH 0046/3334] [nrf fromtree] tests: ram_context_for_isr: pick an available IRQ for Nuvoton platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NPCX7, NPCX9, and NPCK3 platforms have their (NUM_IRQS-1) IRQ taken, so set CONFIG_TEST_IRQ_NUM to a different available IRQ. Signed-off-by: Benjamin Cabé (cherry picked from commit f8e183c3db91fdff831fea0e2a6d7df650806100) --- tests/application_development/ram_context_for_isr/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/application_development/ram_context_for_isr/Kconfig b/tests/application_development/ram_context_for_isr/Kconfig index 30f2e20a3d12..7bd3688470f6 100644 --- a/tests/application_development/ram_context_for_isr/Kconfig +++ b/tests/application_development/ram_context_for_isr/Kconfig @@ -10,6 +10,7 @@ config TEST_IRQ_NUM default 14 if GIC default 22 if SOC_SERIES_DA1469X default 18 if SOC_SERIES_STM32C0X + default 1 if (SOC_SERIES_NPCX9 || SOC_SERIES_NPCX7 || SOC_SERIES_NPCK3) default 0 help IRQ number to use for testing purposes. This should be an @@ -20,6 +21,7 @@ config TEST_IRQ_NUM - GIC platforms: 14 (available test SGI - Software Generated Interrupt) - DA1469X series: 22 (available test IRQ) - STM32C0X series: 18 (available test IRQ) + - NPCX9, NPCX7, NPCK3 series: 1 (unused IRQ not mapped to MIWU groups) - Other platforms: 0 (magic config value to select the last IRQ: NUM_IRQS - 1) config TEST_IRQ_PRIO From 954a65035c22916937a6e2d7a832b7fbb55f6bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Tue, 16 Sep 2025 23:22:12 +0200 Subject: [PATCH 0047/3334] [nrf fromtree] tests: ram_context_for_isr: pick an available IRQ for nxp_k32l2b3 soc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (NUM_IRQS-1) IRQ is taken on this soc, so set CONFIG_TEST_IRQ_NUM to a different available IRQ to avoid test failure. Signed-off-by: Benjamin Cabé (cherry picked from commit 6610b8c8b2c10701ee87da28d3ffbe1b2e4d132c) --- tests/application_development/ram_context_for_isr/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/application_development/ram_context_for_isr/Kconfig b/tests/application_development/ram_context_for_isr/Kconfig index 7bd3688470f6..61b3a4224949 100644 --- a/tests/application_development/ram_context_for_isr/Kconfig +++ b/tests/application_development/ram_context_for_isr/Kconfig @@ -11,6 +11,7 @@ config TEST_IRQ_NUM default 22 if SOC_SERIES_DA1469X default 18 if SOC_SERIES_STM32C0X default 1 if (SOC_SERIES_NPCX9 || SOC_SERIES_NPCX7 || SOC_SERIES_NPCK3) + default 29 if SOC_K32L2B31A default 0 help IRQ number to use for testing purposes. This should be an @@ -22,6 +23,7 @@ config TEST_IRQ_NUM - DA1469X series: 22 (available test IRQ) - STM32C0X series: 18 (available test IRQ) - NPCX9, NPCX7, NPCK3 series: 1 (unused IRQ not mapped to MIWU groups) + - K32L2B31A: 29 (available test IRQ) - Other platforms: 0 (magic config value to select the last IRQ: NUM_IRQS - 1) config TEST_IRQ_PRIO From a4a7b2ed718e58c7c46fb9679375a99d5c0e2588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 25 Sep 2025 08:01:11 +0200 Subject: [PATCH 0048/3334] [nrf fromlist] tests: ram_context_for_isr: pick IRQ number for nRF54L MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picked IRQ number available on all platforms. Upstream PR #: 96531 Signed-off-by: Michał Stasiak (cherry picked from commit 28a66c4596248370f2e47b7ac8ec097ca6a0170f) --- tests/application_development/ram_context_for_isr/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/application_development/ram_context_for_isr/Kconfig b/tests/application_development/ram_context_for_isr/Kconfig index 61b3a4224949..b4031538b4b9 100644 --- a/tests/application_development/ram_context_for_isr/Kconfig +++ b/tests/application_development/ram_context_for_isr/Kconfig @@ -12,6 +12,7 @@ config TEST_IRQ_NUM default 18 if SOC_SERIES_STM32C0X default 1 if (SOC_SERIES_NPCX9 || SOC_SERIES_NPCX7 || SOC_SERIES_NPCK3) default 29 if SOC_K32L2B31A + default 28 if SOC_SERIES_NRF54LX default 0 help IRQ number to use for testing purposes. This should be an From 93d5531ae8b9dff4b7b469d9f0e2d17458826bb3 Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Tue, 23 Sep 2025 14:51:49 +0200 Subject: [PATCH 0049/3334] [nrf fromtree] soc: nordic: common: uicr: Add GRTC fast clkout Add the mapping for the GRTC_CLKOUT_FAST pinctrl mapping to the periphconf generation. This allows clocking out the 16MHz clock with a user selectable divider. Signed-off-by: Karsten Koenig (cherry picked from commit 19f709910fe53fcff64fb36fd02c0a56f6042365) --- soc/nordic/common/uicr/gen_periphconf_entries.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index e70e56acc1f3..92f5f1d24559 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -395,6 +395,12 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=2, pin=7): Ctrlsel.CAN_TDM_SERIAL2, NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=2, pin=7): Ctrlsel.CAN_TDM_SERIAL2, }, + # GRTC + 0x5F99_C000: { + NrfPsel(fun=NrfFun.GRTC_CLKOUT_FAST, port=1, pin=8): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.GRTC_CLKOUT_FAST, port=2, pin=5): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.GRTC_CLKOUT_FAST, port=9, pin=0): Ctrlsel.SERIAL0, + }, # GPIOTE0 (RAD) 0x5302_7000: { # P1 From 21ac1dd9a5582255ac736b54116e9d978614e729 Mon Sep 17 00:00:00 2001 From: Rafal Dyla Date: Thu, 24 Apr 2025 10:50:14 +0200 Subject: [PATCH 0050/3334] [nrf fromtree] arch: riscv: Support for Direct ISRs for RISCV targets Added missing features and configuration to support Direct ISRs Signed-off-by: Rafal Dyla (cherry picked from commit 3cf2627d850b78a3970e0ec7a1ba3b3769b71047) --- arch/riscv/core/irq_manage.c | 17 +++++++++++++++++ drivers/timer/nrf_grtc_timer.c | 15 +++++++++++++++ include/zephyr/arch/riscv/irq.h | 9 +++++++++ 3 files changed, 41 insertions(+) diff --git a/arch/riscv/core/irq_manage.c b/arch/riscv/core/irq_manage.c index 8ba7b615b422..3d18ec59dba3 100644 --- a/arch/riscv/core/irq_manage.c +++ b/arch/riscv/core/irq_manage.c @@ -10,6 +10,7 @@ #include #include #include +#include #ifdef CONFIG_RISCV_HAS_PLIC #include @@ -75,3 +76,19 @@ int arch_irq_disconnect_dynamic(unsigned int irq, unsigned int priority, } #endif /* CONFIG_SHARED_INTERRUPTS */ #endif /* CONFIG_DYNAMIC_INTERRUPTS */ + +#ifdef CONFIG_PM +void arch_isr_direct_pm(void) +{ + unsigned int key; + + key = irq_lock(); + + if (_kernel.idle) { + _kernel.idle = 0; + pm_system_resume(); + } + + irq_unlock(key); +} +#endif diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 4e1223635085..df59b9f6d4b6 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -459,12 +459,27 @@ uint32_t sys_clock_elapsed(void) return (uint32_t)(counter_sub(counter(), last_count) / CYC_PER_TICK); } +#if !defined(CONFIG_GEN_SW_ISR_TABLE) +ISR_DIRECT_DECLARE(nrfx_grtc_direct_irq_handler) +{ + nrfx_grtc_irq_handler(); + ISR_DIRECT_PM(); + return 1; +} +#endif + static int sys_clock_driver_init(void) { nrfx_err_t err_code; +#if defined(CONFIG_GEN_SW_ISR_TABLE) IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr, nrfx_grtc_irq_handler, 0); +#else + IRQ_DIRECT_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), + nrfx_grtc_direct_irq_handler, 0); + irq_enable(DT_IRQN(GRTC_NODE)); +#endif #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && NRF_GRTC_HAS_CLKSEL #if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC) diff --git a/include/zephyr/arch/riscv/irq.h b/include/zephyr/arch/riscv/irq.h index 8408912716a7..c3c4baff3518 100644 --- a/include/zephyr/arch/riscv/irq.h +++ b/include/zephyr/arch/riscv/irq.h @@ -83,6 +83,15 @@ extern void z_riscv_irq_vector_set(unsigned int irq); z_riscv_irq_vector_set(irq_p); \ } +#ifdef CONFIG_PM +extern void arch_isr_direct_pm(void); +#define ARCH_ISR_DIRECT_PM() arch_isr_direct_pm() +#else +#define ARCH_ISR_DIRECT_PM() \ + do { \ + } while (false) +#endif + #define ARCH_ISR_DIRECT_HEADER() arch_isr_direct_header() #define ARCH_ISR_DIRECT_FOOTER(swap) arch_isr_direct_footer(swap) From 1c671c3ab203d1f7ae9f51121763025115cf564a Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Wed, 24 Sep 2025 08:39:30 +0200 Subject: [PATCH 0051/3334] [nrf fromtree] drivers: i2c: Extend i2c testing on nrf54h20 PPR Enable all possible i2c tests on CPUPPR Signed-off-by: Bartosz Miller (cherry picked from commit b60633b3a6189a83902209f679ff666f95fded0b) --- .../boards/nrf54h20dk_nrf54h20_cpuppr.conf | 4 + .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 69 +++++++++++++ samples/drivers/i2c/rtio_loopback/sample.yaml | 1 + .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 15 +++ .../sysbuild/vpr_launcher/prj.conf | 3 + .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 70 +++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 15 +++ .../sysbuild/vpr_launcher/prj.conf | 3 + tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml | 1 + .../boards/nrf54h20dk_nrf54h20_cpuppr.conf | 5 + .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 97 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 15 +++ .../sysbuild/vpr_launcher/prj.conf | 3 + .../drivers/i2c/i2c_target_api/testcase.yaml | 1 + 14 files changed, 302 insertions(+) create mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf create mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay create mode 100644 samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay create mode 100644 samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/prj.conf create mode 100644 tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54h20dk_nrf54h20_cpuppr.overlay create mode 100644 tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay create mode 100644 tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/prj.conf create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay create mode 100644 tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay create mode 100644 tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/prj.conf diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf new file mode 100644 index 000000000000..7dfef7da2839 --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..f31ea5090df8 --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P2.8 and P2.9 + * SCL = P1.2 and P1.3 + */ + +/ { + aliases { + i2c-controller = &i2c130; + i2c-controller-target = &i2c131; + }; +}; + +&pinctrl { + i2c130_default: i2c130_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c130_sleep: i2c130_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c131_default: i2c131_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c131_sleep: i2c131_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c130 { + clock-frequency = ; + pinctrl-0 = <&i2c130_default>; + pinctrl-1 = <&i2c130_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; +}; + +&i2c131 { + compatible = "nordic,nrf-twis"; + clock-frequency = ; + pinctrl-0 = <&i2c131_default>; + pinctrl-1 = <&i2c131_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; +}; diff --git a/samples/drivers/i2c/rtio_loopback/sample.yaml b/samples/drivers/i2c/rtio_loopback/sample.yaml index a356a2697fdd..dadfe1fff98e 100644 --- a/samples/drivers/i2c/rtio_loopback/sample.yaml +++ b/samples/drivers/i2c/rtio_loopback/sample.yaml @@ -15,6 +15,7 @@ tests: - b_u585i_iot02a - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nucleo_f401re diff --git a/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..69aedabd69dc --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c130 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; + +&i2c131 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; diff --git a/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/prj.conf b/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/prj.conf new file mode 100644 index 000000000000..d6c8f934808e --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/prj.conf @@ -0,0 +1,3 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# nothing here diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..1d4259cacc11 --- /dev/null +++ b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P2.8 and P2.9 + * SCL = P1.2 and P1.3 + */ + +/ { + aliases { + i2c-controller = &i2c130; + i2c-controller-target = &i2c131; + }; +}; + +&pinctrl { + i2c130_default: i2c130_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c130_sleep: i2c130_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c131_default: i2c131_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c131_sleep: i2c131_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c130 { + compatible = "nordic,nrf-twim"; + clock-frequency = ; + pinctrl-0 = <&i2c130_default>; + pinctrl-1 = <&i2c130_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; +}; + +&i2c131 { + compatible = "nordic,nrf-twis"; + clock-frequency = ; + pinctrl-0 = <&i2c131_default>; + pinctrl-1 = <&i2c131_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; +}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..69aedabd69dc --- /dev/null +++ b/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c130 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; + +&i2c131 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/prj.conf b/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/prj.conf new file mode 100644 index 000000000000..d6c8f934808e --- /dev/null +++ b/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/prj.conf @@ -0,0 +1,3 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# nothing here diff --git a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml index e35dd49dbb76..4fa30bae7e84 100644 --- a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml +++ b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml @@ -12,6 +12,7 @@ tests: platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf new file mode 100644 index 000000000000..baa00bdf40f7 --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 +CONFIG_GPIO=y diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..0138f287de8e --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P2.8 and P2.9 + * SCL = P1.2 and P1.3 + */ + +/ { + zephyr,user { + sda0-gpios = <&gpio2 8 0>; + scl0-gpios = <&gpio1 2 0>; + sda1-gpios = <&gpio2 9 0>; + scl1-gpios = <&gpio1 3 0>; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&pinctrl { + i2c130_default: i2c130_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c130_sleep: i2c130_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c131_default: i2c131_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c131_sleep: i2c131_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c130 { + clock-frequency = ; + pinctrl-0 = <&i2c130_default>; + pinctrl-1 = <&i2c130_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; + + eeprom1: eeprom@56 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x56>; + address-width = <8>; + size = <256>; + }; +}; + +&i2c131 { + compatible = "nordic,nrf-twis"; + clock-frequency = ; + pinctrl-0 = <&i2c131_default>; + pinctrl-1 = <&i2c131_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; + + eeprom0: eeprom@54 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x54>; + address-width = <8>; + size = <256>; + }; +}; + +&gpiote130 { + status = "okay"; +}; diff --git a/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..69aedabd69dc --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i2c130 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; + +&i2c131 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; diff --git a/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/prj.conf b/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/prj.conf new file mode 100644 index 000000000000..d6c8f934808e --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/prj.conf @@ -0,0 +1,3 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# nothing here diff --git a/tests/drivers/i2c/i2c_target_api/testcase.yaml b/tests/drivers/i2c/i2c_target_api/testcase.yaml index 13ef2bb16c4c..35207c6ab91b 100644 --- a/tests/drivers/i2c/i2c_target_api/testcase.yaml +++ b/tests/drivers/i2c/i2c_target_api/testcase.yaml @@ -65,6 +65,7 @@ tests: - max32690evkit/max32690/m4 - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From 2289e0459f6ec5f63b259ed78aa814c054b4216d Mon Sep 17 00:00:00 2001 From: Matthias Hauser Date: Fri, 12 Sep 2025 09:51:06 +0200 Subject: [PATCH 0052/3334] [nrf fromtree] boards: we: update WE ophelia4 board definition add support for gpregret1, nfct Signed-off-by: Matthias Hauser Signed-off-by: Matthias Hauser (cherry picked from commit 17e1429589b259b6d4e0e09b0f136022959dfa9a) --- boards/we/ophelia4ev/Kconfig.defconfig | 3 ++ .../ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts | 29 ++++++++++++++++--- .../ophelia4ev_nrf54l15_cpuapp_defconfig | 3 -- .../ophelia4ev_nrf54l15_cpuflpr.yaml | 1 - 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/boards/we/ophelia4ev/Kconfig.defconfig b/boards/we/ophelia4ev/Kconfig.defconfig index ae367b374d7e..94e5d7e9e0c5 100644 --- a/boards/we/ophelia4ev/Kconfig.defconfig +++ b/boards/we/ophelia4ev/Kconfig.defconfig @@ -1,6 +1,9 @@ # Copyright (c) 2025 Würth Elektronik eiSos GmbH & Co. KG # SPDX-License-Identifier: Apache-2.0 +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + if BOARD_OPHELIA4EV_NRF54L15_CPUAPP config ROM_START_OFFSET diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts index 2380fcd5b8d3..9acc3e1fff90 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts @@ -15,14 +15,20 @@ chosen { zephyr,console = &uart20; zephyr,shell-uart = &uart20; - zephyr,code-partition = &slot0_partition; - zephyr,flash = &cpuapp_rram; - zephyr,sram = &cpuapp_sram; 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; + zephyr,boot-mode = &boot_mode0; + zephyr,code-partition = &slot0_partition; + zephyr,sram = &cpuapp_sram; + }; + + aliases { + mcuboot-button0 = &button0; + mcuboot-led0 = &led0; }; }; @@ -32,7 +38,7 @@ &lfxo { load-capacitors = "internal"; - load-capacitance-femtofarad = <15500>; + load-capacitance-femtofarad = <17000>; }; &hfxo { @@ -63,6 +69,10 @@ status = "okay"; }; +&nfct { + status = "okay"; +}; + &gpio0 { status = "okay"; }; @@ -99,6 +109,16 @@ status = "okay"; }; +&gpregret1 { + status = "okay"; + + boot_mode0: boot_mode@0 { + compatible = "zephyr,retention"; + status = "okay"; + reg = <0x0 0x1>; + }; +}; + &spi00 { status = "okay"; @@ -126,6 +146,7 @@ has-dpd; t-enter-dpd = <10000>; t-exit-dpd = <35000>; + reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; }; }; diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp_defconfig b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp_defconfig index 80a40b5a79d9..f880aa57105c 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp_defconfig +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp_defconfig @@ -14,8 +14,5 @@ CONFIG_GPIO=y # Enable MPU CONFIG_ARM_MPU=y -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - # Use internal LFCLK CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.yaml b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.yaml index a302cf4a192d..6e1264242d64 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.yaml +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.yaml @@ -15,4 +15,3 @@ supported: - gpio - i2c - spi - - watchdog From fd2b5dc0483585cb0959593c34b4ee6e8d3400a3 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 22 Sep 2025 11:43:16 +0100 Subject: [PATCH 0053/3334] [nrf fromtree] soc: nordic: nrf54l: Set ROM_START_OFFSET instead of by each board Sets the default of this Kconfig for the SoC itself as a default, rather than each board setting it, which minimises the change Signed-off-by: Jamie McCrae (cherry picked from commit 69ce66d4913397f185cc2b1b713cde6e5bb2dcff) --- boards/ezurio/bl54l15_dvk/Kconfig.defconfig | 7 ------- boards/ezurio/bl54l15u_dvk/Kconfig.defconfig | 7 ------- boards/nordic/nrf54l15dk/Kconfig.defconfig | 9 --------- boards/nordic/nrf54lm20dk/Kconfig.defconfig | 3 --- boards/panasonic/panb611evb/Kconfig.defconfig | 7 ------- boards/raytac/an54l15q_db/Kconfig.defconfig | 7 ------- boards/seeed/xiao_nrf54l15/Kconfig.defconfig | 3 --- boards/we/ophelia4ev/Kconfig.defconfig | 7 ------- soc/nordic/nrf54l/Kconfig.defconfig | 3 +++ 9 files changed, 3 insertions(+), 50 deletions(-) diff --git a/boards/ezurio/bl54l15_dvk/Kconfig.defconfig b/boards/ezurio/bl54l15_dvk/Kconfig.defconfig index 78ec8fa7116a..2ff8fe6e3027 100644 --- a/boards/ezurio/bl54l15_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl54l15_dvk/Kconfig.defconfig @@ -6,13 +6,6 @@ DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_BL54L15_DVK_NRF54L10_CPUAPP || BOARD_BL54L15_DVK_NRF54L15_CPUAPP - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_BL54L15_DVK_NRF54L10_CPUAPP || BOARD_BL54L15_DVK_NRF54L15_CPUAPP - if BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS config HAS_BT_CTLR diff --git a/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig b/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig index bb4934e7fd36..1e706cb66dd2 100644 --- a/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig @@ -6,13 +6,6 @@ DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_BL54L15U_DVK_NRF54L15_CPUAPP - if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS config HAS_BT_CTLR diff --git a/boards/nordic/nrf54l15dk/Kconfig.defconfig b/boards/nordic/nrf54l15dk/Kconfig.defconfig index 49e38070a01a..f57b30c2c42d 100644 --- a/boards/nordic/nrf54l15dk/Kconfig.defconfig +++ b/boards/nordic/nrf54l15dk/Kconfig.defconfig @@ -4,15 +4,6 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION -if BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ - BOARD_NRF54L15DK_NRF54L15_CPUAPP - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ - # BOARD_NRF54L15DK_NRF54L15_CPUAPP - if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS config BOARD_NRF54L15DK diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig index 1f0a706ae6ca..67410cd4d653 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54lm20dk/Kconfig.defconfig @@ -6,7 +6,4 @@ if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP diff --git a/boards/panasonic/panb611evb/Kconfig.defconfig b/boards/panasonic/panb611evb/Kconfig.defconfig index 6ad6d9426dbf..1b469232537f 100644 --- a/boards/panasonic/panb611evb/Kconfig.defconfig +++ b/boards/panasonic/panb611evb/Kconfig.defconfig @@ -5,13 +5,6 @@ DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_PANB611EVB_NRF54L15_CPUAPP - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_PANB611EVB_NRF54L15_CPUAPP - if BOARD_PANB611EVB_NRF54L15_CPUAPP_NS config HAS_BT_CTLR diff --git a/boards/raytac/an54l15q_db/Kconfig.defconfig b/boards/raytac/an54l15q_db/Kconfig.defconfig index 72616407eb7b..0d903ea091d0 100644 --- a/boards/raytac/an54l15q_db/Kconfig.defconfig +++ b/boards/raytac/an54l15q_db/Kconfig.defconfig @@ -6,13 +6,6 @@ DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_RAYTAC_AN54L15Q_DB_NRF54L15_CPUAPP - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_RAYTAC_AN54L15Q_DB_NRF54L15_CPUAPP - if BOARD_RAYTAC_AN54L15Q_DB_NRF54L15_CPUAPP_NS config HAS_BT_CTLR diff --git a/boards/seeed/xiao_nrf54l15/Kconfig.defconfig b/boards/seeed/xiao_nrf54l15/Kconfig.defconfig index dd9a6feb90e6..9dae62ca0403 100644 --- a/boards/seeed/xiao_nrf54l15/Kconfig.defconfig +++ b/boards/seeed/xiao_nrf54l15/Kconfig.defconfig @@ -5,7 +5,4 @@ if BOARD_XIAO_NRF54L15_NRF54L15_CPUAPP config HAS_BT_CTLR default BT -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - endif # BOARD_XIAO_NRF54L15_NRF54L15_CPUAPP diff --git a/boards/we/ophelia4ev/Kconfig.defconfig b/boards/we/ophelia4ev/Kconfig.defconfig index 94e5d7e9e0c5..2c11dd05e163 100644 --- a/boards/we/ophelia4ev/Kconfig.defconfig +++ b/boards/we/ophelia4ev/Kconfig.defconfig @@ -3,10 +3,3 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION - -if BOARD_OPHELIA4EV_NRF54L15_CPUAPP - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_OPHELIA4EV_NRF54L15_CPUAPP diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index 9e84d3bc09f7..929d13655c54 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -32,6 +32,9 @@ choice NULL_POINTER_EXCEPTION_DETECTION default NULL_POINTER_EXCEPTION_DETECTION_NONE endchoice +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + endif # ARM if RISCV From 94d3990cb26c68522b0d7a51f1f501883ec134d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 16 Sep 2025 11:48:03 +0200 Subject: [PATCH 0054/3334] [nrf fromtree] manifest: update hal_nordic to pull nrf-802154 changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the hal_nordic to bring the latest changes of the nrf-802154 component. Signed-off-by: Rafał Kuźnia (cherry picked from commit 9bc99401b41a379f11b8296dcc0e15fbdfa50ecd) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index d0e76dbc5760..0011534d31da 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: d0cef2363e572679deba0e796ef6c77f1188bb04 + revision: 57d9fc59c9ea86465b5cd26f0fe2b9dcc520768b path: modules/hal/nordic groups: - hal From 88f85b4c70a038edcbb625923ddaa17a8b2da20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 16 Sep 2025 12:03:22 +0200 Subject: [PATCH 0055/3334] [nrf fromtree] modules: hal_nordic: nrf_802154: Add new Kconfig options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The NRF_802154_ENCRYPTION was split into two additional Kconfigs that control separate functionalities: * NRF_802154_IE_WRITER - to enable Information Element writer * NRF_802154_SECURITY_WRITER - to enable frame counter writer Signed-off-by: Rafał Kuźnia (cherry picked from commit 65fae0a050f35c705ffd8b1f393287df87ec155a) --- modules/hal_nordic/Kconfig | 14 ++++++++++++++ modules/hal_nordic/nrf_802154/CMakeLists.txt | 14 +++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/hal_nordic/Kconfig b/modules/hal_nordic/Kconfig index b8b659374752..7be30750627d 100644 --- a/modules/hal_nordic/Kconfig +++ b/modules/hal_nordic/Kconfig @@ -203,6 +203,20 @@ config NRF_802154_PENDING_EXTENDED_ADDRESSES config NRF_802154_ENCRYPTION bool "nRF 802.15.4 AES-CCM* authentication & encryption" depends on !CRYPTO_NRF_ECB + select NRF_802154_IE_WRITER + select NRF_802154_SECURITY_WRITER + help + Enable module for encryption and authentication of outgoing frames and Acks. + +config NRF_802154_IE_WRITER + bool "Information element writer" + help + Enable data injection for some Information Element types. + +config NRF_802154_SECURITY_WRITER + bool "Security frame counter writer" + help + Enable injection of security frame counter. config NRF_802154_SECURITY_KEY_STORAGE_SIZE int "nRF 802.15.4 security key storage size" diff --git a/modules/hal_nordic/nrf_802154/CMakeLists.txt b/modules/hal_nordic/nrf_802154/CMakeLists.txt index 957019ff1e67..1f504242cb22 100644 --- a/modules/hal_nordic/nrf_802154/CMakeLists.txt +++ b/modules/hal_nordic/nrf_802154/CMakeLists.txt @@ -70,12 +70,20 @@ endif() if (CONFIG_NRF_802154_ENCRYPTION) target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_ENCRYPTION_ENABLED=1) - target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_SECURITY_WRITER_ENABLED=1) - target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_IE_WRITER_ENABLED=1) else () target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_ENCRYPTION_ENABLED=0) - target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_SECURITY_WRITER_ENABLED=0) +endif () + +if (CONFIG_NRF_802154_IE_WRITER) + target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_IE_WRITER_ENABLED=1) +else () target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_IE_WRITER_ENABLED=0) +endif () + +if (CONFIG_NRF_802154_SECURITY_WRITER) + target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_SECURITY_WRITER_ENABLED=1) +else () + target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_SECURITY_WRITER_ENABLED=0) endif() if (NOT CONFIG_IEEE802154_NRF5 AND NOT CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT AND CONFIG_NRF_802154_SL_OPENSOURCE) From 6d39d65fb94db85f4dc559c88db91df10032d70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Thu, 25 Sep 2025 12:48:07 +0200 Subject: [PATCH 0056/3334] [nrf fromtree] manifest: update hal_nordic to pull nrf-802154 changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the hal_nordic to bring the latest changes of the nrf-802154 component. Signed-off-by: Rafał Kuźnia (cherry picked from commit a25abc3358d69cb2c4f825996aaa0729ea5c97f9) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 0011534d31da..f411f6fbd642 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 57d9fc59c9ea86465b5cd26f0fe2b9dcc520768b + revision: e3bf121f1ba72fb1090ef67d19a702b0d77b9f93 path: modules/hal/nordic groups: - hal From c5c9074792135caff3c672987fe1bfbc8fc93747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Thu, 25 Sep 2025 12:49:16 +0200 Subject: [PATCH 0057/3334] [nrf fromtree] drivers: ieee802154: nrf5: Remove temporary API migration code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new nrf-802154 now has the updated API signatures. The migration code is no longer needed. Signed-off-by: Rafał Kuźnia (cherry picked from commit 3d631650508aa41e2b47e2341be7a7d30f67bbfb) --- drivers/ieee802154/ieee802154_nrf5.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index e099b2f33a97..60f45edb9c79 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -499,13 +499,9 @@ static bool nrf5_tx_immediate(struct net_pkt *pkt, uint8_t *payload, bool cca) }, }; -#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE nrf_802154_tx_error_t result = nrf_802154_transmit_raw(payload, &metadata); return result == NRF_802154_TX_ERROR_NONE; -#else - return nrf_802154_transmit_raw(payload, &metadata); -#endif } #if NRF_802154_CSMA_CA_ENABLED @@ -522,13 +518,9 @@ static bool nrf5_tx_csma_ca(struct net_pkt *pkt, uint8_t *payload) }, }; -#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE nrf_802154_tx_error_t result = nrf_802154_transmit_csma_ca_raw(payload, &metadata); return result == NRF_802154_TX_ERROR_NONE; -#else - return nrf_802154_transmit_csma_ca_raw(payload, &metadata); -#endif } #endif @@ -585,13 +577,9 @@ static bool nrf5_tx_at(struct nrf5_802154_data *nrf5_radio, struct net_pkt *pkt, uint64_t tx_at = nrf_802154_timestamp_phr_to_shr_convert( net_pkt_timestamp_ns(pkt) / NSEC_PER_USEC); -#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE nrf_802154_tx_error_t result = nrf_802154_transmit_raw_at(payload, tx_at, &metadata); return result == NRF_802154_TX_ERROR_NONE; -#else - return nrf_802154_transmit_raw_at(payload, tx_at, &metadata); -#endif } #endif /* CONFIG_NET_PKT_TXTIME */ From 5fda247a13f5693ba5b88a94e0685853e15d2970 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Fri, 26 Sep 2025 13:02:19 +0100 Subject: [PATCH 0058/3334] [nrf fromtree] manifest: Update hal_nordic to pull latest mdk 8.72.4 Update hal_nordic to pull mdk 8.72.4 with mdk changes for nRF7120. Signed-off-by: Robert Robinson (cherry picked from commit 617da7a744c2f5407a608c2dc368b38a75a53dd5) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f411f6fbd642..4df2b937a46d 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: e3bf121f1ba72fb1090ef67d19a702b0d77b9f93 + revision: 979a58d0829108b57f10e90b6c3fc35ab6206e4b path: modules/hal/nordic groups: - hal From ec9d5a4e0cd3abe2fc61f9fa3a2214b21ff2a11c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 14 Jul 2025 13:20:35 +0100 Subject: [PATCH 0059/3334] [nrf fromlist] dts: vendor: nordic: Add missing reg parameters Adds missing reg parameters to DTS nodes Upstream PR #: 96698 Signed-off-by: Jamie McCrae (cherry picked from commit 93546b44b70e719b026ad7ba9decba63b222b011) --- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 2 ++ dts/vendor/nordic/nrf54lm20a.dtsi | 1 + 2 files changed, 3 insertions(+) diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index aa259713d2fd..4d15eebe8d02 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -101,11 +101,13 @@ #ifdef USE_NON_SECURE_ADDRESS_MAP global_peripherals: peripheral@40000000 { + reg = <0x40000000 0x10000000>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x40000000 0x10000000>; #else global_peripherals: peripheral@50000000 { + reg = <0x50000000 0x10000000>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x50000000 0x10000000>; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 0601771d496a..ae17be2c8d42 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -118,6 +118,7 @@ }; global_peripherals: peripheral@50000000 { + reg = <0x50000000 0x10000000>; ranges = <0x0 0x50000000 0x10000000>; #address-cells = <1>; #size-cells = <1>; From f2dd3bf75034542651f9a5b878d4db4a80d05648 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 14 Jul 2025 13:21:55 +0100 Subject: [PATCH 0060/3334] [nrf fromlist] boards: nordic: nrf54l15dk: Fix cpuflpr SRAM address Fixes the address of this peripheral Upstream PR #: 96698 Signed-off-by: Jamie McCrae (cherry picked from commit 79683bf14a627e5201922c4f9d9cb28df6fba49a) --- .../nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts index 2bc4ba292bed..eae0b605eb4b 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts @@ -8,6 +8,8 @@ #include #include "nrf54l15dk_common.dtsi" +/delete-node/ &cpuflpr_sram; + / { model = "Nordic nRF54L15 DK nRF54L15 FLPR MCU"; compatible = "nordic,nrf54l15dk_nrf54l15-cpuflpr"; @@ -19,13 +21,16 @@ 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_sram: memory@20028000 { + compatible = "mmio-sram"; + /* Size must be increased due to booting from SRAM */ + reg = <0x20028000 DT_SIZE_K(96)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20028000 0x18000>; + status = "okay"; + }; }; &cpuflpr_rram { From e063ccd9d4730d03f9d3e2a7efd8ccf2ab153252 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 14 Jul 2025 14:10:28 +0100 Subject: [PATCH 0061/3334] [nrf fromlist] dts: arm: nordic: Remove superfluous compatible strings Removes compatible strings that were not defined and are not needed Upstream PR #: 96698 Signed-off-by: Jamie McCrae (cherry picked from commit ac2972168a7f65abf5e8c0861d026e1e22e2cf12) --- dts/arm/nordic/nrf51822_qfaa.dtsi | 3 +-- dts/arm/nordic/nrf51822_qfab.dtsi | 3 +-- dts/arm/nordic/nrf51822_qfac.dtsi | 3 +-- dts/arm/nordic/nrf52805_caaa.dtsi | 3 +-- dts/arm/nordic/nrf52810_qfaa.dtsi | 3 +-- dts/arm/nordic/nrf52811_qfaa.dtsi | 3 +-- dts/arm/nordic/nrf52820_qdaa.dtsi | 3 +-- dts/arm/nordic/nrf52832_ciaa.dtsi | 3 +-- dts/arm/nordic/nrf52832_qfaa.dtsi | 3 +-- dts/arm/nordic/nrf52832_qfab.dtsi | 3 +-- dts/arm/nordic/nrf52833_qdaa.dtsi | 3 +-- dts/arm/nordic/nrf52833_qiaa.dtsi | 3 +-- dts/arm/nordic/nrf52840_qfaa.dtsi | 3 +-- dts/arm/nordic/nrf52840_qiaa.dtsi | 3 +-- dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi | 3 +-- dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi | 3 +-- dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi | 3 +-- dts/arm/nordic/nrf9131_laca.dtsi | 3 +-- dts/arm/nordic/nrf9131ns_laca.dtsi | 3 +-- dts/arm/nordic/nrf9151_laca.dtsi | 3 +-- dts/arm/nordic/nrf9151ns_laca.dtsi | 3 +-- dts/arm/nordic/nrf9160_sica.dtsi | 3 +-- dts/arm/nordic/nrf9160ns_sica.dtsi | 3 +-- dts/arm/nordic/nrf9161_laca.dtsi | 3 +-- dts/arm/nordic/nrf9161ns_laca.dtsi | 3 +-- 25 files changed, 25 insertions(+), 50 deletions(-) diff --git a/dts/arm/nordic/nrf51822_qfaa.dtsi b/dts/arm/nordic/nrf51822_qfaa.dtsi index 07fc5dd1cce9..2aeec68fd852 100644 --- a/dts/arm/nordic/nrf51822_qfaa.dtsi +++ b/dts/arm/nordic/nrf51822_qfaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf51822-qfaa", "nordic,nrf51822", - "nordic,nrf51", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf51822_qfab.dtsi b/dts/arm/nordic/nrf51822_qfab.dtsi index 7fb4364d0379..6f6818ac4607 100644 --- a/dts/arm/nordic/nrf51822_qfab.dtsi +++ b/dts/arm/nordic/nrf51822_qfab.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf51822-qfab", "nordic,nrf51822", - "nordic,nrf51", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf51822_qfac.dtsi b/dts/arm/nordic/nrf51822_qfac.dtsi index 59a2ed265e67..eae879189c0c 100644 --- a/dts/arm/nordic/nrf51822_qfac.dtsi +++ b/dts/arm/nordic/nrf51822_qfac.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf51822-qfac", "nordic,nrf51822", - "nordic,nrf51", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52805_caaa.dtsi b/dts/arm/nordic/nrf52805_caaa.dtsi index b7d24861893a..285d21440599 100644 --- a/dts/arm/nordic/nrf52805_caaa.dtsi +++ b/dts/arm/nordic/nrf52805_caaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52805-caaa", "nordic,nrf52805", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52810_qfaa.dtsi b/dts/arm/nordic/nrf52810_qfaa.dtsi index 98fbd9a09369..bbc76ab75971 100644 --- a/dts/arm/nordic/nrf52810_qfaa.dtsi +++ b/dts/arm/nordic/nrf52810_qfaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52810-qfaa", "nordic,nrf52810", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52811_qfaa.dtsi b/dts/arm/nordic/nrf52811_qfaa.dtsi index 3bb1556eadb7..17b387919dc8 100644 --- a/dts/arm/nordic/nrf52811_qfaa.dtsi +++ b/dts/arm/nordic/nrf52811_qfaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52811-qfaa", "nordic,nrf52811", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52820_qdaa.dtsi b/dts/arm/nordic/nrf52820_qdaa.dtsi index c1d4a5a95f5a..a683ddcd2e61 100644 --- a/dts/arm/nordic/nrf52820_qdaa.dtsi +++ b/dts/arm/nordic/nrf52820_qdaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52820-qdaa", "nordic,nrf52820", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52832_ciaa.dtsi b/dts/arm/nordic/nrf52832_ciaa.dtsi index 88f16574bbb9..81bed18daf27 100644 --- a/dts/arm/nordic/nrf52832_ciaa.dtsi +++ b/dts/arm/nordic/nrf52832_ciaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52832-ciaa", "nordic,nrf52832", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52832_qfaa.dtsi b/dts/arm/nordic/nrf52832_qfaa.dtsi index 2943de6d1155..81bed18daf27 100644 --- a/dts/arm/nordic/nrf52832_qfaa.dtsi +++ b/dts/arm/nordic/nrf52832_qfaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52832-qfaa", "nordic,nrf52832", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52832_qfab.dtsi b/dts/arm/nordic/nrf52832_qfab.dtsi index fe1605394e72..faecc765efdf 100644 --- a/dts/arm/nordic/nrf52832_qfab.dtsi +++ b/dts/arm/nordic/nrf52832_qfab.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52832-qfab", "nordic,nrf52832", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52833_qdaa.dtsi b/dts/arm/nordic/nrf52833_qdaa.dtsi index 7f9be6f22550..64462d29269b 100644 --- a/dts/arm/nordic/nrf52833_qdaa.dtsi +++ b/dts/arm/nordic/nrf52833_qdaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52833-qdaa", "nordic,nrf52833", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52833_qiaa.dtsi b/dts/arm/nordic/nrf52833_qiaa.dtsi index 68eabb08bcf7..6ab9a4f1e6eb 100644 --- a/dts/arm/nordic/nrf52833_qiaa.dtsi +++ b/dts/arm/nordic/nrf52833_qiaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf52833-qiaa", "nordic,nrf52833", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52840_qfaa.dtsi b/dts/arm/nordic/nrf52840_qfaa.dtsi index 8c927eb5c0a6..85acf5ab4685 100644 --- a/dts/arm/nordic/nrf52840_qfaa.dtsi +++ b/dts/arm/nordic/nrf52840_qfaa.dtsi @@ -17,8 +17,7 @@ / { soc { - compatible = "nordic,nrf52840-qfaa", "nordic,nrf52840", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52840_qiaa.dtsi b/dts/arm/nordic/nrf52840_qiaa.dtsi index 657222447193..7986ab41fd6a 100644 --- a/dts/arm/nordic/nrf52840_qiaa.dtsi +++ b/dts/arm/nordic/nrf52840_qiaa.dtsi @@ -26,7 +26,6 @@ / { soc { - compatible = "nordic,nrf52840-qiaa", "nordic,nrf52840", - "nordic,nrf52", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi index a543ffe906b1..76a2af386623 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf5340-cpuapp-qkaa", "nordic,nrf5340-cpuapp", - "nordic,nrf53", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi index 80d5706232f6..37d6a605556e 100644 --- a/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf5340-cpuapp-qkaa", "nordic,nrf5340-cpuapp", - "nordic,nrf53", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi index 19eb682ddfc6..e9948125ba89 100644 --- a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi @@ -21,7 +21,6 @@ / { soc { - compatible = "nordic,nrf5340-cpunet-qkaa", "nordic,nrf5340-cpunet", - "nordic,nrf53", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9131_laca.dtsi b/dts/arm/nordic/nrf9131_laca.dtsi index f32f0c825ad1..77fe73c22af6 100644 --- a/dts/arm/nordic/nrf9131_laca.dtsi +++ b/dts/arm/nordic/nrf9131_laca.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf9131-laca", "nordic,nrf9120", - "nordic,nrf91", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9131ns_laca.dtsi b/dts/arm/nordic/nrf9131ns_laca.dtsi index 3b6208f45e91..6ab80a842a33 100644 --- a/dts/arm/nordic/nrf9131ns_laca.dtsi +++ b/dts/arm/nordic/nrf9131ns_laca.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf9131-laca", "nordic,nrf9120", - "nordic,nrf91", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9151_laca.dtsi b/dts/arm/nordic/nrf9151_laca.dtsi index 9ed202740170..77fe73c22af6 100644 --- a/dts/arm/nordic/nrf9151_laca.dtsi +++ b/dts/arm/nordic/nrf9151_laca.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf9151-laca", "nordic,nrf9120", - "nordic,nrf91", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9151ns_laca.dtsi b/dts/arm/nordic/nrf9151ns_laca.dtsi index ac31c6e19c60..6ab80a842a33 100644 --- a/dts/arm/nordic/nrf9151ns_laca.dtsi +++ b/dts/arm/nordic/nrf9151ns_laca.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf9151-laca", "nordic,nrf9120", - "nordic,nrf91", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9160_sica.dtsi b/dts/arm/nordic/nrf9160_sica.dtsi index 15096534016d..6bbe048277c1 100644 --- a/dts/arm/nordic/nrf9160_sica.dtsi +++ b/dts/arm/nordic/nrf9160_sica.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf9160-sica", "nordic,nrf9160", - "nordic,nrf91", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9160ns_sica.dtsi b/dts/arm/nordic/nrf9160ns_sica.dtsi index c6adbaa7ca2f..12ec1fcbc8e0 100644 --- a/dts/arm/nordic/nrf9160ns_sica.dtsi +++ b/dts/arm/nordic/nrf9160ns_sica.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf9160-sica", "nordic,nrf9160", - "nordic,nrf91", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9161_laca.dtsi b/dts/arm/nordic/nrf9161_laca.dtsi index e94ab99166a0..77fe73c22af6 100644 --- a/dts/arm/nordic/nrf9161_laca.dtsi +++ b/dts/arm/nordic/nrf9161_laca.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf9161-laca", "nordic,nrf9120", - "nordic,nrf91", "simple-bus"; + compatible = "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9161ns_laca.dtsi b/dts/arm/nordic/nrf9161ns_laca.dtsi index 4449c3565b32..6ab80a842a33 100644 --- a/dts/arm/nordic/nrf9161ns_laca.dtsi +++ b/dts/arm/nordic/nrf9161ns_laca.dtsi @@ -17,7 +17,6 @@ / { soc { - compatible = "nordic,nrf9161-laca", "nordic,nrf9120", - "nordic,nrf91", "simple-bus"; + compatible = "simple-bus"; }; }; From e87c1bc6163a3a1449d7b75c0be627858b9e04f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 26 Sep 2025 15:09:59 +0200 Subject: [PATCH 0062/3334] [nrf fromtree] samples: drivers: spi_bitbang: Enable sample on nrf54h20 PPR core MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the sample on nrf54h20dk/nrf54h20/cpuppr. Signed-off-by: Sebastian Głąb (cherry picked from commit 745fd00517fb6a34dfc595bb7636111a1694e4c0) --- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 32 +++++++++++++++++++ samples/drivers/spi_bitbang/sample.yaml | 1 + 2 files changed, 33 insertions(+) create mode 100644 samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuppr.overlay diff --git a/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..d3083d6cbd94 --- /dev/null +++ b/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Test requires loopback between P0.06 and P0.07. + * No other driver on SPI_CLK and SPI_CS. + */ + +/ { + spibb0: spibb0 { + compatible = "zephyr,spi-bitbang"; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + clk-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpiote130 { + status = "okay"; + owned-channels = <7>; +}; diff --git a/samples/drivers/spi_bitbang/sample.yaml b/samples/drivers/spi_bitbang/sample.yaml index c90f02313f2b..e3265ce2fdb6 100644 --- a/samples/drivers/spi_bitbang/sample.yaml +++ b/samples/drivers/spi_bitbang/sample.yaml @@ -9,6 +9,7 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: From 79b00e519c938672cd76431f38c74b1a9d5cefe1 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 4 Sep 2025 13:37:02 +0200 Subject: [PATCH 0063/3334] [nrf fromtree] mgmt: Allow to block confirming non-acive slots In Direct XIP with revert, it should be possible to block confirmation of the non-active slot, so only a bootable binaries are marked as valid. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit c1baf2f7636918fa26fe234fa042e576ba4aafcc) --- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 14 +++++++++++++ .../mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 20 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index 0915d70e8706..dd4c1a3e61cd 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -117,6 +117,20 @@ config MCUMGR_GRP_IMG_REJECT_DIRECT_XIP_MISMATCHED_SLOT The base address can be set, to an image binary header, with imgtool, using the --rom-fixed command line option. +config MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT + bool "Allow to confirm non-active slots of any image" + depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT || \ + MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT || \ + MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH || \ + MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE || \ + MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET + default y + help + Allows to confirm non-active slot of any image. + Normally it should not be allowed to confirm any slots via MCUmgr + commands, to prevent confirming something that is broken and was not + verified to boot correctly. + config MCUMGR_GRP_IMG_FRUGAL_LIST bool "Omit zero, empty or false values from status list" help diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index fb15c15b6e9e..cc465fbea740 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -680,6 +680,17 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) } #endif + /* The rules above apply only to the inactive image. + * To effectively prevent confirming something that might not have been + * verified to actually be bootable, a new policy was introduced, + * that applies to both active and inactive images. + */ +#ifndef MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT + if (confirm && slot != active_slot) { + return IMG_MGMT_ERR_IMAGE_CONFIRMATION_DENIED; + } +#endif + /* Setting test to active slot is not allowed. */ if (!confirm && slot == active_slot) { return IMG_MGMT_ERR_IMAGE_SETTING_TEST_TO_ACTIVE_DENIED; @@ -728,8 +739,9 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) #else int img_mgmt_set_next_boot_slot(int slot, bool confirm) { + int image = img_mgmt_slot_to_image(slot); + int active_slot = img_mgmt_active_slot(image); int active_image = img_mgmt_active_image(); - int active_slot = img_mgmt_active_slot(active_image); LOG_DBG("(%d, %s)", slot, confirm ? "confirm" : "test"); LOG_DBG("aimg = %d, aslot = %d, slot = %d", @@ -739,6 +751,12 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) return IMG_MGMT_ERR_IMAGE_SETTING_TEST_TO_ACTIVE_DENIED; } +#ifndef MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT + if (slot != active_slot && confirm) { + return IMG_MGMT_ERR_IMAGE_CONFIRMATION_DENIED; + } +#endif + return img_mgmt_set_next_boot_slot_common(slot, active_slot, confirm); } #endif From 8262c7e0714a55be14b6816b979c7ffbd0ac0dc3 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Fri, 26 Sep 2025 12:34:31 +0200 Subject: [PATCH 0064/3334] [nrf fromtree] mgmt: Add missing CONFIG_ prefixes Fix the incorrect usage of Kconfig symbols and revert back the default behavior to allow for non-active slot confirmation. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 2e0d9ed2cf79be86bd0ffe522932b0062436eda4) --- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index cc465fbea740..dbb496fb3b33 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -685,7 +685,7 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) * verified to actually be bootable, a new policy was introduced, * that applies to both active and inactive images. */ -#ifndef MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT +#ifndef CONFIG_MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT if (confirm && slot != active_slot) { return IMG_MGMT_ERR_IMAGE_CONFIRMATION_DENIED; } @@ -751,7 +751,7 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) return IMG_MGMT_ERR_IMAGE_SETTING_TEST_TO_ACTIVE_DENIED; } -#ifndef MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT +#ifndef CONFIG_MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT if (slot != active_slot && confirm) { return IMG_MGMT_ERR_IMAGE_CONFIRMATION_DENIED; } From ff727a5f5781d5725da115d48663093761551e8b Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Mon, 29 Sep 2025 14:22:14 +0200 Subject: [PATCH 0065/3334] [nrf fromtree] mcumgr: Enable permanent updates in overwrite mode It is essential for the overwrite mode to allow confirming the secondary slot to provide the permanent update. This types of updates is the only mode in which the application may be upgraded. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit cbcf81e3a49547f9102fffddd0c4d0f63816c265) --- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index dd4c1a3e61cd..25979180e2c9 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -118,18 +118,22 @@ config MCUMGR_GRP_IMG_REJECT_DIRECT_XIP_MISMATCHED_SLOT using the --rom-fixed command line option. config MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT - bool "Allow to confirm non-active slots of any image" + bool "Allow to confirm non-active slots of any image" if !MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT || \ MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT || \ MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH || \ MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE || \ - MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET + MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET || \ + MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY default y help Allows to confirm non-active slot of any image. Normally it should not be allowed to confirm any slots via MCUmgr commands, to prevent confirming something that is broken and was not verified to boot correctly. + Option always enabled in the overwrite mode, because the permanent + update, that uses the confirm flag, is the intended way to provide + updates. config MCUMGR_GRP_IMG_FRUGAL_LIST bool "Omit zero, empty or false values from status list" From dc062c260f250aaa37ec1423da4bcb69dbaa874b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 1 Oct 2025 14:08:39 +0200 Subject: [PATCH 0066/3334] [nrf fromlist] drivers: pinctrl: nrf: use HAL defines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced MDK symbols with defines from HAL. Upstream PR #: 96855 Signed-off-by: Michał Stasiak (cherry picked from commit 648bf8dd54c53734ba05a3eda2e6557ba8218cac) --- drivers/pinctrl/pinctrl_nrf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index bbcaea06435f..1dfb6cb7c720 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -15,7 +15,7 @@ BUILD_ASSERT(((NRF_PULL_NONE == NRF_GPIO_PIN_NOPULL) && (NRF_PULL_UP == NRF_GPIO_PIN_PULLUP)), "nRF pinctrl pull settings do not match HAL values"); -#if defined(GPIO_PIN_CNF_DRIVE_E0E1) || defined(GPIO_PIN_CNF_DRIVE0_E0) +#if NRF_GPIO_HAS_DRIVE_EXTRA #define NRF_DRIVE_COUNT (NRF_DRIVE_E0E1 + 1) #else #define NRF_DRIVE_COUNT (NRF_DRIVE_H0D1 + 1) @@ -29,7 +29,7 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = { [NRF_DRIVE_D0H1] = NRF_GPIO_PIN_D0H1, [NRF_DRIVE_S0D1] = NRF_GPIO_PIN_S0D1, [NRF_DRIVE_H0D1] = NRF_GPIO_PIN_H0D1, -#if defined(GPIO_PIN_CNF_DRIVE_E0E1) || defined(GPIO_PIN_CNF_DRIVE0_E0) +#if NRF_GPIO_HAS_DRIVE_EXTRA [NRF_DRIVE_E0E1] = NRF_GPIO_PIN_E0E1, #endif }; @@ -486,7 +486,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, #endif /* defined(NRF_PSEL_TDM) */ #if defined(NRF_GRTC_CLKOUT_FAST) case NRF_FUN_GRTC_CLKOUT_FAST: -#if NRF_GPIO_HAS_SEL && defined(GPIO_PIN_CNF_CTRLSEL_GRTC) +#if NRF_GPIO_HAS_SEL && NRF_GPIO_HAS_CTRLSEL_GRTC nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_GRTC); #endif dir = NRF_GPIO_PIN_DIR_OUTPUT; @@ -495,7 +495,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, #endif /* defined(NRF_GRTC_CLKOUT_FAST) */ #if defined(NRF_GRTC_CLKOUT_SLOW) case NRF_FUN_GRTC_CLKOUT_32K: -#if NRF_GPIO_HAS_SEL && defined(GPIO_PIN_CNF_CTRLSEL_GRTC) +#if NRF_GPIO_HAS_SEL && NRF_GPIO_HAS_CTRLSEL_GRTC nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_GRTC); #endif dir = NRF_GPIO_PIN_DIR_OUTPUT; From 2ee3f42a321194f1743ea7227544ab2c5d6e2f92 Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Fri, 1 Aug 2025 09:33:58 +0200 Subject: [PATCH 0067/3334] [nrf fromtree] tests: drivers: flash: Test newly introduced MSPI driver features These features are: - soft reset - 4B addressing (SPI mode) - supply gpios Signed-off-by: Bartosz Miller (cherry picked from commit bee81df035cc61c208c0dc4ea09f5979e8166c55) --- .../common/boards/mx25uw63_low_freq.overlay | 10 +++ .../mx25uw63_single_io_4B_addr_sreset.overlay | 64 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 11 ++++ tests/drivers/flash/common/src/main.c | 17 +++++ tests/drivers/flash/common/testcase.yaml | 10 +++ 5 files changed, 112 insertions(+) create mode 100644 tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay create mode 100644 tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay diff --git a/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay new file mode 100644 index 000000000000..950005eaf5c2 --- /dev/null +++ b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&mx25uw63 { + status = "okay"; + mspi-max-frequency = ; +}; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay new file mode 100644 index 000000000000..587d68546561 --- /dev/null +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + + /delete-node/ exmif_default; + /delete-node/ exmif_sleep; + + exmif_default: exmif_default { + group1 { + psels = , + , + , + , + , + , + , + , + , + ; + nordic,drive-mode = ; + }; + }; + + exmif_sleep: exmif_sleep { + group1 { + low-power-enable; + psels = , + , + , + , + , + , + , + , + , + ; + }; + }; + +}; + +&gpio6 { + status = "okay"; +}; + +&exmif { + status = "okay"; + pinctrl-0 = <&exmif_default>; + pinctrl-1 = <&exmif_sleep>; + pinctrl-names = "default", "sleep"; + ce-gpios = <&gpio6 3 GPIO_ACTIVE_LOW>; +}; + +&mx25uw63 { + status = "okay"; + mspi-max-frequency = ; + mspi-io-mode = "MSPI_IO_MODE_SINGLE"; + use-4byte-addressing; + initial-soft-reset; +}; diff --git a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 22c24c32f6d8..5272bb8fdde3 100644 --- a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,6 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ +/ { + zephyr,user { + test-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio0 { + status = "okay"; +}; + &gpio6 { status = "okay"; zephyr,pm-device-runtime-auto; @@ -16,4 +26,5 @@ &mx25uw63 { status = "okay"; + supply-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; }; diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index 337876a9e8d7..b629c39ebc51 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -9,6 +9,7 @@ #include #include #include +#include #if defined(CONFIG_NORDIC_QSPI_NOR) #define TEST_AREA_DEV_NODE DT_INST(0, nordic_qspi_nor) @@ -327,6 +328,22 @@ ZTEST(flash_driver, test_flash_erase) zassert_not_equal(expected[0], erase_value, "These values shall be different"); } +ZTEST(flash_driver, test_supply_gpios_control) +{ + if (!DT_NODE_HAS_PROP(TEST_AREA_DEV_NODE, supply_gpios)) { + ztest_test_skip(); + } + +#if DT_NODE_HAS_PROP(DT_PATH(zephyr_user), test_gpios) + const struct gpio_dt_spec test_gpio = + GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), test_gpios); + zassert_true(gpio_is_ready_dt(&test_gpio), "Test GPIO is not ready\n"); + zassert_ok(gpio_pin_configure_dt(&test_gpio, GPIO_INPUT | GPIO_PULL_DOWN), + "Failed to configure test pin\n"); + zassert_equal(gpio_pin_get(test_gpio.port, test_gpio.pin), 1, "Supply GPIO is not set\n"); +#endif +} + struct test_cb_data_type { uint32_t page_counter; /* used to count how many pages was iterated */ uint32_t exit_page; /* terminate iteration when this page is reached */ diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 34123ffde77f..6f59f3799c5a 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -182,3 +182,13 @@ tests: extra_args: - DTC_OVERLAY_FILE="./boards/${BOARD}_qspi_nor.overlay" - CONF_FILE="./prj.conf ./boards/${BOARD}_qspi_nor.conf" + drivers.flash.common.mspi_single_io.4B_addr_soft_reset: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_single_io_4B_addr_sreset.overlay + drivers.flash.common.mspi_low_frequency: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_low_freq.overlay From ed6f047a646e148a4f7fc0a6efa1c609acabaa5f Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 25 Sep 2025 15:54:42 +0200 Subject: [PATCH 0068/3334] [nrf fromtree] boards: Add secondary_app_partition alias Add secondary_app_partition aliases. Those aliases can be used to configure the code partition for the second copy of the FW in the Direct XIP update scenarios. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit e3c5bdfa02fcc36e4832c79275d5c0ecf4330058) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 4 +++- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index ba22403a9acd..e587bc8b4d99 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -18,7 +18,7 @@ chosen { zephyr,console = &uart136; - zephyr,code-partition = &slot0_partition; + zephyr,code-partition = &cpuapp_slot0_partition; zephyr,flash = &mram1x; zephyr,sram = &cpuapp_data; zephyr,shell-uart = &uart136; @@ -187,6 +187,8 @@ slot0_partition: &cpuapp_slot0_partition { label = "image-0"; }; +secondary_app_partition: &cpuapp_slot1_partition {}; + slot1_partition: &cpuapp_slot1_partition { label = "image-1"; }; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 5473d9a7405a..487df83f3bbf 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -85,6 +85,8 @@ slot0_partition: &cpurad_slot0_partition { label = "image-0"; }; +secondary_app_partition: &cpurad_slot1_partition {}; + slot1_partition: &cpurad_slot1_partition { label = "image-1"; }; From 3572b3590d27dc99b022ca2cf6650dfe661074ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Thu, 25 Sep 2025 14:31:31 +0200 Subject: [PATCH 0069/3334] [nrf fromtree] tests: drivers: spi: spi_loopback: Run test on nrf54h20 PPR XIP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The spi_loopback test requires more RAM than is avilable on nrf54h20dk/nrf54h20/cpuppr target. Meanwhile, test fits in Execute In Place (XIP) variant of the PPR target. Switch spi_loopback test to nrf54h20 PPR XIP target. Signed-off-by: Sebastian Głąb (cherry picked from commit 6d76a71fa2590259dfbc68f9ec0e21438e2fb92e) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 11 ----------- .../boards/nrf54h20dk_nrf54h20_cpuppr.conf | 1 - .../boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf | 2 ++ ...overlay => nrf54h20dk_nrf54h20_cpuppr_xip.overlay} | 2 +- 4 files changed, 3 insertions(+), 13 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf create mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf rename tests/drivers/spi/spi_loopback/boards/{nrf54h20dk_nrf54h20_cpuppr.overlay => nrf54h20dk_nrf54h20_cpuppr_xip.overlay} (66%) diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 17c2909717f2..aa5dc30239ce 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -7,15 +7,4 @@ &spi130 { memory-regions = <&cpuapp_dma_region>; - zephyr,pm-device-runtime-auto; - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = ; - }; - fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = ; - }; }; diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf deleted file mode 100644 index af7d7e938e0f..000000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_LARGE_BUFFER_SIZE=1024 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf new file mode 100644 index 000000000000..250de8d4487a --- /dev/null +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf @@ -0,0 +1,2 @@ +CONFIG_SPI_LARGE_BUFFER_SIZE=1024 +CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay similarity index 66% rename from tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay rename to tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay index cea31612851b..76ebe3410375 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ From 00f71047ce5b0de51a2ec1fc6fcf002d745beef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 26 Sep 2025 12:00:21 +0200 Subject: [PATCH 0070/3334] [nrf fromtree] tests: drivers: spi: spi_error_cases: Extend platform_allow list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Radio core and PPR core on nrf54h20 DK to platform_allow list. Required overlays are already present. Signed-off-by: Sebastian Głąb (cherry picked from commit bc2c95c8f0d2bd9381316e9fc40c9ad430043842) --- tests/drivers/spi/spi_error_cases/testcase.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/drivers/spi/spi_error_cases/testcase.yaml b/tests/drivers/spi/spi_error_cases/testcase.yaml index 9ad509baddb0..eb3f4c78c580 100644 --- a/tests/drivers/spi/spi_error_cases/testcase.yaml +++ b/tests/drivers/spi/spi_error_cases/testcase.yaml @@ -11,8 +11,10 @@ tests: drivers.spi.spi_error_cases: platform_allow: - nrf52840dk/nrf52840 - - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr + - nrf54h20dk/nrf54h20/cpurad + - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 5ac35ccd7e72b3532a049a2d15424b7c1a788bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 26 Sep 2025 13:33:14 +0200 Subject: [PATCH 0071/3334] [nrf fromtree] boards: nordic: nrf54h20dk: Add SPI to supported features on PPR XIP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable Twister tests that depend on SPI feature on nrf54h20dk/nrf54h20/cpuppr/xip target. Signed-off-by: Sebastian Głąb (cherry picked from commit ba8b36c8a1c22e60c38287ae855e9fb15ed088a9) --- .../nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml index 7198a379a9c9..58c6473538d9 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml @@ -12,3 +12,4 @@ ram: 62 flash: 64 supported: - gpio + - spi From 69a06afb081131f32311a2ea2ecb8fc0be9e9a25 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Tue, 30 Sep 2025 12:51:06 +0200 Subject: [PATCH 0072/3334] [nrf fromtree] boards: nordic: nrf54h20dk: fix flashing for xip variants Make sure operations are groupped when using ppr/xip and flpr/xip. Signed-off-by: Piotr Kosycarz (cherry picked from commit e3a3fca7facfbfa1adddfc779ccc46481150c689) --- boards/nordic/nrf54h20dk/board.yml | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/boards/nordic/nrf54h20dk/board.yml b/boards/nordic/nrf54h20dk/board.yml index 2d3d40c20e0b..1a505729f99c 100644 --- a/boards/nordic/nrf54h20dk/board.yml +++ b/boards/nordic/nrf54h20dk/board.yml @@ -14,3 +14,43 @@ board: default: "0.9.0" revisions: - name: "0.9.0" +runners: + run_once: + '--recover': + - runners: + - nrfutil + run: first + groups: + - boards: + - nrf54h20dk@0.9.0/nrf54h20/cpuapp + - nrf54h20dk@0.9.0/nrf54h20/cpurad + - nrf54h20dk@0.9.0/nrf54h20/cpuppr + - nrf54h20dk@0.9.0/nrf54h20/cpuppr/xip + - nrf54h20dk@0.9.0/nrf54h20/cpuflpr + - nrf54h20dk@0.9.0/nrf54h20/cpuflpr/xip + '--erase': + - runners: + - jlink + - nrfutil + run: first + groups: + - boards: + - nrf54h20dk@0.9.0/nrf54h20/cpuapp + - nrf54h20dk@0.9.0/nrf54h20/cpurad + - nrf54h20dk@0.9.0/nrf54h20/cpuppr + - nrf54h20dk@0.9.0/nrf54h20/cpuppr/xip + - nrf54h20dk@0.9.0/nrf54h20/cpuflpr + - nrf54h20dk@0.9.0/nrf54h20/cpuflpr/xip + '--reset': + - runners: + - jlink + - nrfutil + run: last + groups: + - boards: + - nrf54h20dk@0.9.0/nrf54h20/cpuapp + - nrf54h20dk@0.9.0/nrf54h20/cpurad + - nrf54h20dk@0.9.0/nrf54h20/cpuppr + - nrf54h20dk@0.9.0/nrf54h20/cpuppr/xip + - nrf54h20dk@0.9.0/nrf54h20/cpuflpr + - nrf54h20dk@0.9.0/nrf54h20/cpuflpr/xip From d761a46e0fc856ba1a501ec6ce5d5ade651d6de7 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 8 Sep 2025 14:41:23 +0200 Subject: [PATCH 0073/3334] [nrf fromtree] drivers: power_domain: nrfs_gdpwr: depend on multithreading The NRFS GDPWR device driver requires NRFS which requires multithreading. Add dependency to Kconfig for the device driver to exclude it when building for single threaded apps like mcuboot. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 9a6dba9bd633e0e7a7e0c6f02e84650d89ac73c3) --- drivers/power_domain/Kconfig.nrfs_gdpwr | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/power_domain/Kconfig.nrfs_gdpwr b/drivers/power_domain/Kconfig.nrfs_gdpwr index bf9abd59aedb..c5f05d88a7ee 100644 --- a/drivers/power_domain/Kconfig.nrfs_gdpwr +++ b/drivers/power_domain/Kconfig.nrfs_gdpwr @@ -4,6 +4,7 @@ config POWER_DOMAIN_NRFS_GDPWR bool "NRFS Global Domain Power Request driver" depends on DT_HAS_NORDIC_NRFS_GDPWR_ENABLED + depends on MULTITHREADING select NRFS select NRFS_GDPWR_SERVICE_ENABLED default y From b01b8f6124a90ea8d6887db7803c87c49e1566c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 24 Sep 2025 10:33:34 +0200 Subject: [PATCH 0074/3334] [nrf fromtree] drivers: mspi_dw: Add support for CONFIG_MULTITHREADING=n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add possibility to use the driver in configurations with disabled multithreading. It may be useful in bootloaders, for example. Signed-off-by: Andrzej Głąbek (cherry picked from commit c8e3bfac1c47ea193731e51b458365f77dc321f3) --- drivers/mspi/mspi_dw.c | 62 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index f1195314c6c2..f2ad49759e07 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -65,11 +65,16 @@ struct mspi_dw_data { bool standard_spi; bool suspended; +#if defined(CONFIG_MULTITHREADING) struct k_sem finished; /* For synchronization of API calls made from different contexts. */ struct k_sem ctx_lock; /* For locking of controller configuration. */ struct k_sem cfg_lock; +#else + volatile bool finished; + bool cfg_lock; +#endif struct mspi_xfer xfer; #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) @@ -364,7 +369,11 @@ static void handle_fifos(const struct device *dev) if (finished) { set_imr(dev, 0); +#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->finished); +#else + dev_data->finished = true; +#endif } } @@ -816,8 +825,17 @@ static int api_dev_config(const struct device *dev, int rc; if (dev_id != dev_data->dev_id) { +#if defined(CONFIG_MULTITHREADING) rc = k_sem_take(&dev_data->cfg_lock, K_MSEC(CONFIG_MSPI_COMPLETION_TIMEOUT_TOLERANCE)); +#else + if (dev_data->cfg_lock) { + rc = -1; + } else { + dev_data->cfg_lock = true; + rc = 0; + } +#endif if (rc < 0) { LOG_ERR("Failed to switch controller to device"); return -EBUSY; @@ -831,15 +849,23 @@ static int api_dev_config(const struct device *dev, return 0; } +#if defined(CONFIG_MULTITHREADING) (void)k_sem_take(&dev_data->ctx_lock, K_FOREVER); +#endif rc = _api_dev_config(dev, param_mask, cfg); +#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->ctx_lock); +#endif if (rc < 0) { dev_data->dev_id = NULL; +#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->cfg_lock); +#else + dev_data->cfg_lock = false; +#endif } return rc; @@ -851,12 +877,17 @@ static int api_get_channel_status(const struct device *dev, uint8_t ch) struct mspi_dw_data *dev_data = dev->data; +#if defined(CONFIG_MULTITHREADING) (void)k_sem_take(&dev_data->ctx_lock, K_FOREVER); +#endif dev_data->dev_id = NULL; +#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->cfg_lock); - k_sem_give(&dev_data->ctx_lock); +#else + dev_data->cfg_lock = false; +#endif return 0; } @@ -1119,7 +1150,17 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) /* Write SER to start transfer */ write_ser(dev, BIT(dev_data->dev_id->dev_idx)); +#if defined(CONFIG_MULTITHREADING) rc = k_sem_take(&dev_data->finished, timeout); +#else + if (!WAIT_FOR(dev_data->finished, + dev_data->xfer.timeout * USEC_PER_MSEC, + NULL)) { + rc = -ETIMEDOUT; + } + + dev_data->finished = false; +#endif if (read_risr(dev) & RISR_RXOIR_BIT) { LOG_ERR("RX FIFO overflow occurred"); rc = -EIO; @@ -1232,7 +1273,9 @@ static int api_transceive(const struct device *dev, return rc; } +#if defined(CONFIG_MULTITHREADING) (void)k_sem_take(&dev_data->ctx_lock, K_FOREVER); +#endif if (dev_data->suspended) { rc = -EFAULT; @@ -1240,7 +1283,9 @@ static int api_transceive(const struct device *dev, rc = _api_transceive(dev, req); } +#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->ctx_lock); +#endif rc2 = pm_device_runtime_put(dev); if (rc2 < 0) { @@ -1391,7 +1436,9 @@ static int api_xip_config(const struct device *dev, return rc; } +#if defined(CONFIG_MULTITHREADING) (void)k_sem_take(&dev_data->ctx_lock, K_FOREVER); +#endif if (dev_data->suspended) { rc = -EFAULT; @@ -1399,7 +1446,9 @@ static int api_xip_config(const struct device *dev, rc = _api_xip_config(dev, dev_id, cfg); } +#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->ctx_lock); +#endif rc2 = pm_device_runtime_put(dev); if (rc2 < 0) { @@ -1450,8 +1499,12 @@ static int dev_pm_action_cb(const struct device *dev, return rc; } #endif +#if defined(CONFIG_MULTITHREADING) if (xip_enabled || k_sem_take(&dev_data->ctx_lock, K_NO_WAIT) != 0) { +#else + if (xip_enabled) { +#endif LOG_ERR("Controller in use, cannot be suspended"); return -EBUSY; } @@ -1460,7 +1513,9 @@ static int dev_pm_action_cb(const struct device *dev, vendor_specific_suspend(dev); +#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->ctx_lock); +#endif return 0; } @@ -1470,7 +1525,6 @@ static int dev_pm_action_cb(const struct device *dev, static int dev_init(const struct device *dev) { - struct mspi_dw_data *dev_data = dev->data; const struct mspi_dw_config *dev_config = dev->config; const struct gpio_dt_spec *ce_gpio; int rc; @@ -1481,9 +1535,13 @@ static int dev_init(const struct device *dev) dev_config->irq_config(); +#if defined(CONFIG_MULTITHREADING) + struct mspi_dw_data *dev_data = dev->data; + k_sem_init(&dev_data->finished, 0, 1); k_sem_init(&dev_data->cfg_lock, 1, 1); k_sem_init(&dev_data->ctx_lock, 1, 1); +#endif #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) dev_data->dev = dev; From 4ac833b3d121021b8fe00d7c4429f83f9691c29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 24 Sep 2025 10:37:10 +0200 Subject: [PATCH 0075/3334] [nrf fromtree] drivers: flash_mspi_nor: Add support for CONFIG_MULTITHREADING=n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add possibility to use the driver in configurations with disabled multithreading. It may be useful in bootloaders, for example. Signed-off-by: Andrzej Głąbek (cherry picked from commit 828bde8213edef44bb1304044a52dad7240c7397) --- drivers/flash/flash_mspi_nor.c | 12 +++++++++++- drivers/flash/flash_mspi_nor.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index a634b3d9118b..03430401de0c 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -237,7 +237,9 @@ static int acquire(const struct device *dev) struct flash_mspi_nor_data *dev_data = dev->data; int rc; +#if defined(CONFIG_MULTITHREADING) k_sem_take(&dev_data->acquired, K_FOREVER); +#endif rc = pm_device_runtime_get(dev_config->bus); if (rc < 0) { @@ -269,21 +271,27 @@ static int acquire(const struct device *dev) (void)pm_device_runtime_put(dev_config->bus); } +#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->acquired); +#endif + return rc; } static void release(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; - struct flash_mspi_nor_data *dev_data = dev->data; /* This releases the MSPI controller. */ (void)mspi_get_channel_status(dev_config->bus, 0); (void)pm_device_runtime_put(dev_config->bus); +#if defined(CONFIG_MULTITHREADING) + struct flash_mspi_nor_data *dev_data = dev->data; + k_sem_give(&dev_data->acquired); +#endif } static inline uint32_t dev_flash_size(const struct device *dev) @@ -1215,7 +1223,9 @@ static int drv_init(const struct device *dev) } } +#if defined(CONFIG_MULTITHREADING) k_sem_init(&dev_data->acquired, 1, K_SEM_MAX_LIMIT); +#endif return pm_device_driver_init(dev, dev_pm_action_cb); } diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 480bccce4729..86c824cf4856 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -104,7 +104,9 @@ struct flash_mspi_nor_config { }; struct flash_mspi_nor_data { +#if defined(CONFIG_MULTITHREADING) struct k_sem acquired; +#endif struct mspi_xfer_packet packet; struct mspi_xfer xfer; struct jesd216_erase_type erase_types[JESD216_NUM_ERASE_TYPES]; From 9ba6595f2ddb0fc19872cfba747409e54d9a3974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 24 Sep 2025 09:36:30 +0200 Subject: [PATCH 0076/3334] [nrf fromtree] tests: mspi: flash: Add scenario for non-multithreading flash_mspi_nor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add test scenario for the flash_mspi_nor driver used in a configuration with disable multithreading. Signed-off-by: Andrzej Głąbek (cherry picked from commit 804508f775bd35603e5a5ac4c5243d24535fe7a0) --- tests/drivers/mspi/flash/testcase.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/drivers/mspi/flash/testcase.yaml b/tests/drivers/mspi/flash/testcase.yaml index dba610a40235..ae1db5d4d6d2 100644 --- a/tests/drivers/mspi/flash/testcase.yaml +++ b/tests/drivers/mspi/flash/testcase.yaml @@ -36,3 +36,9 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_configs: - CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE=y + drivers.mspi.flash.mspi_nor_no_multithreading: + filter: dt_alias_exists("mspi0") and CONFIG_FLASH_MSPI_NOR + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_configs: + - CONFIG_MULTITHREADING=n From ccc65921c1ea461da98a1ee5da2f7f9675f49071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 26 Sep 2025 14:17:46 +0200 Subject: [PATCH 0077/3334] [nrf fromtree] drivers: mspi_dw: Fix race condition in RX interrupt handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactor a bit the RX FIFO handling to prevent RX transfers performed in Single IO mode from getting stuck when they are suspended due to the empty TX FIFO and cannot be resumed because there is no further interrupt in which the TX FIFO could be filled properly with dummy bytes above its transfer start level. Signed-off-by: Andrzej Głąbek (cherry picked from commit f0f5f8cdef74c79e2f28048dd842a05a1241e5af) --- drivers/mspi/mspi_dw.c | 48 ++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index f2ad49759e07..f7be2e33c9e5 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -250,9 +250,12 @@ static bool read_rx_fifo(const struct device *dev, uint8_t *buf_pos = dev_data->buf_pos; const uint8_t *buf_end = &packet->data_buf[packet->num_bytes]; uint8_t bytes_per_frame_exp = dev_data->bytes_per_frame_exp; - /* See `room` in tx_data(). */ - uint32_t in_fifo = 1; uint32_t remaining_frames; + uint32_t in_fifo = FIELD_GET(RXFLR_RXTFL_MASK, read_rxflr(dev)); + + if (in_fifo == 0) { + return false; + } do { uint32_t data = read_dr(dev); @@ -327,28 +330,37 @@ static void handle_fifos(const struct device *dev) } } else { for (;;) { + /* Always read everything from the RX FIFO, regardless + * of the interrupt status. + * tx_dummy_bytes() subtracts the number of items that + * are present in the RX FIFO from the number of dummy + * bytes it is allowed to send, so it can potentially + * not fill the TX FIFO above its transfer start level + * in some iteration of this loop. If in such case the + * interrupt handler exited without emptying the RX FIFO + * (seeing the RXFIS flag not set due to not enough + * items in the RX FIFO), this could lead to a situation + * in which a transfer stopped temporarily (after the TX + * FIFO got empty) is not resumed (since the TX FIFO is + * not filled above its transfer start level), so no + * further dummy bytes are transmitted and the RX FIFO + * has no chance to get new entries, hence no further + * interrupts are generated and the transfer gets stuck. + */ + if (read_rx_fifo(dev, packet)) { + finished = true; + break; + } + /* Use RISR, not ISR, because when this function is * executed through the system workqueue, all interrupts * are masked (IMR is 0). */ uint32_t int_status = read_risr(dev); - if (int_status & RISR_RXFIR_BIT) { - if (read_rx_fifo(dev, packet)) { - finished = true; - break; - } - - if (int_status & RISR_RXOIR_BIT) { - finished = true; - break; - } - - /* Refresh interrupt status, as during reading - * from the RX FIFO, the TX FIFO status might - * have changed. - */ - int_status = read_risr(dev); + if (int_status & RISR_RXOIR_BIT) { + finished = true; + break; } if (dev_data->dummy_bytes == 0 || From 0a8c9ce6a9ebbe422a5967c60148c979ab26dea5 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Wed, 1 Oct 2025 11:05:43 +0200 Subject: [PATCH 0078/3334] [nrf fromtree] scripts: compliance: Add basic cmake style checks It is very common to see a comment stating that the "No Space Before Opening Brackets" style guide is not followed. To avoid putting this burdon on reviewers, let the compliance check catch this instead. Checking for tab indentation was also very simple, so also added this. Running this check on all files finds many violations: - Space before opening brackets: 141 violations - Tab indentation: 420 violations Fixing these will not be done as part of this PR. Adding the check will prevent us from adding new violations. Signed-off-by: Rubin Gerritsen (cherry picked from commit e9abaf435ba93c31112bba32861ec8c0a22b9574) --- scripts/ci/check_compliance.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 540744d7e122..9ea01ed3b610 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1659,6 +1659,34 @@ def filter_py(root, fnames): mime=True) == "text/x-python")] +class CMakeStyle(ComplianceTest): + """ + Checks cmake style added/modified files + """ + name = "CMakeStyle" + doc = "See https://docs.zephyrproject.org/latest/contribute/style/cmake.html for more details." + + def run(self): + # Loop through added/modified files + for fname in get_files(filter="d"): + if fname.endswith(".cmake") or fname == "CMakeLists.txt": + self.check_style(fname) + + def check_style(self, fname): + SPACE_BEFORE_OPEN_BRACKETS_CHECK = re.compile(r"^\s*if\s+\(") + TAB_INDENTATION_CHECK = re.compile(r"^\t+") + + with open(fname, encoding="utf-8") as f: + for line_num, line in enumerate(f.readlines(), start=1): + if TAB_INDENTATION_CHECK.match(line): + self.fmtd_failure("error", "CMakeStyle", fname, line_num, + "Use spaces instead of tabs for indentation") + + if SPACE_BEFORE_OPEN_BRACKETS_CHECK.match(line): + self.fmtd_failure("error", "CMakeStyle", fname, line_num, + "Remove space before '(' in if() statements") + + class Identity(ComplianceTest): """ Checks if Emails of author and signed-off messages are consistent. From 03d989c8508743fa006d05f84a0a82f46b5b3940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Wed, 1 Oct 2025 11:56:36 -0500 Subject: [PATCH 0079/3334] [nrf fromtree] scripts: dts: fix CMake DT API helper for compatible properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our build system DT API has a dt_comp_path() function used to look up paths of nodes with a given compatible. This relies on the generated edt.pickle.cmake file in the build directory to look inside the concrete devicetree for the current application build. The script gen_dts_cmake.py is responsible for generating edt.pickle.cmake. It currently generates the data needed by dt_comp_path() by looking inside each edtlib.Node object's "props" attribute. This attribute in turn is fed by the "properties:" key in the node's YAML binding. This leads to an edge case which is breaking the dt_comp_path() API. In most cases, we don't notice this edge case because base.yaml, which is included by nearly all bindings, has a definition for "compatible" in its "properties:" map. However, bindings are not required to include base.yaml, and bindings do not have to explicitliy define a "compatible" entry in their "properties:". An example of a binding that does neither is fixed-partitions.yaml: it only has #address-cells and #size-cells in its "properties:". Nonetheless, "compatible:" is always a valid property name because it's defined in the DT spec, and we should make the CMake API robustly detect all nodes with a given compatible, regardless of whether that node's binding explicitly defines it or not. To make this happen, rely on the edtlib.Node.compats attribute instead of edtlib.Node.props. The compats attribute is always defined even if the node's YAML binding doesn't have an explicit entry for "compatible". Signed-off-by: Martí Bolívar Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 0907a05baf062e0029f37e4601ad6715d1a2cf1a) --- scripts/dts/gen_dts_cmake.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/dts/gen_dts_cmake.py b/scripts/dts/gen_dts_cmake.py index 5dd4a8779d32..a8a2c3df611f 100755 --- a/scripts/dts/gen_dts_cmake.py +++ b/scripts/dts/gen_dts_cmake.py @@ -134,10 +134,8 @@ def main(): cmake_prop = f'DT_PROP|{node.path}|{item}' cmake_props.append(f'"{cmake_prop}" "{escape(cmake_value)}"') - if item == 'compatible': - # compatibles is always an array - for comp in node.props[item].val: - compatible2paths[comp].append(node.path) + for comp in node.compats: + compatible2paths[comp].append(node.path) if node.regs is not None: cmake_props.append(f'"DT_REG|{node.path}|NUM" "{len(node.regs)}"') From deb247470c1534a460d543ebe9f42230ff49dcd5 Mon Sep 17 00:00:00 2001 From: Jiafei Pan Date: Tue, 16 Sep 2025 19:03:32 +0800 Subject: [PATCH 0080/3334] [nrf fromtree] requirements: update spsdk version Update spsdk version to fix dependency confliction with other software. Signed-off-by: Jiafei Pan (cherry picked from commit 77b000faaa2cf1bf7a92acbe7dde66ee2eae5dae) --- scripts/requirements-extras.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/requirements-extras.txt b/scripts/requirements-extras.txt index b7a93427d725..2d7a51cf29ab 100644 --- a/scripts/requirements-extras.txt +++ b/scripts/requirements-extras.txt @@ -19,7 +19,7 @@ junit2html lpc_checksum # used by NXP platform to generate/flash firmware images -spsdk == 2.6.0 +spsdk >= 3.0.0 # used by scripts/build/gen_cfb_font_header.py - helper script for user Pillow>=10.3.0 From 63534249c4e791a170f4da1b455b220ef03d6cdd Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Tue, 30 Sep 2025 18:44:09 +0200 Subject: [PATCH 0081/3334] [nrf fromlist] drivers: timer: nrf_grtc: Move GRTC initialization to early init GRTC is used by the logger, so it must be initialized as early as possible. On the other hand, clock requests are allowed once the clock control API has been initialized. This PR introduces a two-stage GRTC initialization to meet these requirements. Upstream PR #: 96837 Signed-off-by: Adam Kondraciuk (cherry picked from commit 95c38eb6342e1b63bda7f1052f56c37a6a4de6d5) --- drivers/timer/nrf_grtc_timer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index df59b9f6d4b6..75278e104bd2 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -517,6 +517,11 @@ static int sys_clock_driver_init(void) system_timeout_set_relative(CYC_PER_TICK); } + return 0; +} + +static int grtc_post_init(void) +{ #if defined(CONFIG_CLOCK_CONTROL_NRF) static const enum nrf_lfclk_start_mode mode = IS_ENABLED(CONFIG_SYSTEM_CLOCK_NO_WAIT) @@ -590,5 +595,6 @@ int nrf_grtc_timer_clock_driver_init(void) return sys_clock_driver_init(); } #else -SYS_INIT(sys_clock_driver_init, PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); +SYS_INIT(sys_clock_driver_init, EARLY, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); +SYS_INIT(grtc_post_init, PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); #endif From 5ef9afa4a3a9c970b22ad4928fc2d8fdf39ce104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 1 Sep 2025 15:57:55 +0200 Subject: [PATCH 0082/3334] [nrf fromtree] tests: boards: nrf: dmm: Add timing measurements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add timing measurement to the test to allow DMM profiling. Signed-off-by: Krzysztof Chruściński (cherry picked from commit f06e05097f1b2b0f92a20630b93fc504c6ec7e6f) --- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 10 ++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 10 ++ tests/boards/nrf/dmm/prj.conf | 4 + tests/boards/nrf/dmm/src/main.c | 153 ++++++++++++++++-- 4 files changed, 162 insertions(+), 15 deletions(-) diff --git a/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay index 3e0b1b4d5356..48a4e8adc264 100644 --- a/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + / { aliases { dut-cache = &spi1; @@ -52,3 +58,7 @@ pinctrl-1 = <&spi3_sleep_alt>; pinctrl-names = "default", "sleep"; }; + +cycle_timer: &timer1 { + status = "okay"; +}; diff --git a/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index e3924657b86e..2507dd83dfe3 100644 --- a/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + / { aliases { dut-cache = &spi120; @@ -58,3 +64,7 @@ pinctrl-names = "default", "sleep"; memory-regions = <&dma_fast_region>; }; + +cycle_timer: &timer120 { + status = "okay"; +}; diff --git a/tests/boards/nrf/dmm/prj.conf b/tests/boards/nrf/dmm/prj.conf index 9467c2926896..0b99d72b0c32 100644 --- a/tests/boards/nrf/dmm/prj.conf +++ b/tests/boards/nrf/dmm/prj.conf @@ -1 +1,5 @@ CONFIG_ZTEST=y +CONFIG_ASSERT=n +CONFIG_SPIN_VALIDATE=n +CONFIG_TEST_EXTRA_STACK_SIZE=512 +CONFIG_COUNTER=y diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 214a90697525..06f4ace0e608 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -9,9 +9,12 @@ #include #include #include +#include #include +#define IS_ALIGNED64(x) IS_ALIGNED(x, sizeof(uint64_t)) + #define DUT_CACHE DT_ALIAS(dut_cache) #define DUT_NOCACHE DT_ALIAS(dut_nocache) @@ -57,13 +60,49 @@ static const struct dmm_test_region dmm_test_regions[DMM_TEST_REGION_COUNT] = { .size = DMM_TEST_GET_REG_SIZE(DUT_NOCACHE) }, }; +static const struct device *counter = DEVICE_DT_GET(DT_NODELABEL(cycle_timer)); +static uint32_t t_delta; + +static uint32_t ts_get(void) +{ + uint32_t t; + + (void)counter_get_value(counter, &t); + return t; +} + +static uint32_t ts_from_get(uint32_t from) +{ + return ts_get() - from; +} + +static uint32_t cyc_to_us(uint32_t cyc) +{ + return counter_ticks_to_us(counter, cyc); +} + +static uint32_t cyc_to_rem_ns(uint32_t cyc) +{ + uint32_t us = counter_ticks_to_us(counter, cyc); + uint32_t ns; + + cyc = cyc - counter_us_to_ticks(counter, (uint64_t)us); + ns = counter_ticks_to_us(counter, 1000 * cyc); + + return ns; +} static void *test_setup(void) { static struct dmm_fixture fixture; + uint32_t t; + counter_start(counter); + t = ts_get(); + t_delta = ts_get() - t; memcpy(fixture.regions, dmm_test_regions, sizeof(dmm_test_regions)); fixture.fill_value = 0x1; + return &fixture; } @@ -79,13 +118,25 @@ 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, + bool is_cached, bool print_report) { void *buf; int retval; + uint32_t t; + bool aligned; memset(data, (*fill_value)++, size); + t = ts_get(); retval = dmm_buffer_out_prepare(dtr->mem_reg, data, size, &buf); + t = ts_from_get(t); + aligned = IS_ALIGNED64(data) && IS_ALIGNED64(buf) && IS_ALIGNED64(size); + + if (print_report) { + TC_PRINT("%saligned buffer out prepare size:%d buf:%p took %d.%dus (%d cycles)\n", + aligned ? "" : "not ", size, buf, cyc_to_us(t), cyc_to_rem_ns(t), t); + } + zassert_ok(retval); if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { zassert_true(IS_ALIGNED(buf, CONFIG_DCACHE_LINE_SIZE)); @@ -104,21 +155,37 @@ static void dmm_check_output_buffer(struct dmm_test_region *dtr, uint32_t *fill_ sys_cache_data_invd_range(buf, size); zassert_mem_equal(buf, data, size); + t = ts_get(); retval = dmm_buffer_out_release(dtr->mem_reg, buf); + t = ts_from_get(t); + if (print_report) { + TC_PRINT("buffer out release buf:%p size:%d took %d.%dus (%d cycles)\n", + buf, size, cyc_to_us(t), cyc_to_rem_ns(t), t); + } 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 *data, size_t size, bool was_prealloc, + bool is_cached, bool print_report) { void *buf; int retval; + uint32_t t; uint8_t intermediate_buf[128]; + bool aligned; - zassert_true(size < sizeof(intermediate_buf)); + zassert_true(size <= sizeof(intermediate_buf)); + t = ts_get(); retval = dmm_buffer_in_prepare(dtr->mem_reg, data, size, &buf); + t = ts_from_get(t); + aligned = IS_ALIGNED64(data) && IS_ALIGNED64(buf) && IS_ALIGNED64(size); zassert_ok(retval); + if (print_report) { + TC_PRINT("%saligned buffer in prepare buf:%p size:%d took %d.%dus (%d cycles)\n", + aligned ? "" : "not ", buf, size, cyc_to_us(t), cyc_to_rem_ns(t), t); + } if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { zassert_true(IS_ALIGNED(buf, CONFIG_DCACHE_LINE_SIZE)); } @@ -144,7 +211,13 @@ static void dmm_check_input_buffer(struct dmm_test_region *dtr, uint32_t *fill_v memset(buf, (*fill_value)++, size); } + t = ts_get(); retval = dmm_buffer_in_release(dtr->mem_reg, data, size, buf); + t = ts_from_get(t); + if (print_report) { + TC_PRINT("buffer in release buf:%p size:%d took %d.%dus (%d cycles)\n", + buf, size, cyc_to_us(t), cyc_to_rem_ns(t), t); + } zassert_ok(retval); zassert_mem_equal(data, intermediate_buf, size); @@ -152,10 +225,14 @@ static void dmm_check_input_buffer(struct dmm_test_region *dtr, uint32_t *fill_v ZTEST_USER_F(dmm, test_check_dev_cache_in_allocate) { - uint8_t user_data[16]; + uint8_t user_data[128] __aligned(sizeof(uint64_t)); dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, true); + user_data, 16, false, true, false); + dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, + user_data, 16, false, true, true); + dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, + user_data, sizeof(user_data), false, true, true); } ZTEST_USER_F(dmm, test_check_dev_cache_in_preallocate) @@ -163,15 +240,30 @@ 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); + user_data, sizeof(user_data), true, true, true); } ZTEST_USER_F(dmm, test_check_dev_cache_out_allocate) { - uint8_t user_data[16]; + uint8_t user_data[129] __aligned(sizeof(uint64_t)); + + /* First run to get code into ICACHE so that following runs has consistent timing. */ + dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, + user_data, 16, false, true, false); + /* Aligned user buffer. */ + dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, + user_data, 16, false, true, true); + /* Unaligned user buffer. */ dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, true); + &user_data[1], 16, false, true, true); + + /* Aligned user buffer. */ + dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, + user_data, sizeof(user_data) - 1, false, true, true); + /* Unaligned user buffer. */ + dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, + &user_data[1], sizeof(user_data) - 1, false, true, true); } ZTEST_USER_F(dmm, test_check_dev_cache_out_preallocate) @@ -179,15 +271,31 @@ 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, true, true); } ZTEST_USER_F(dmm, test_check_dev_nocache_in_allocate) { - uint8_t user_data[16]; + uint8_t user_data[129] __aligned(sizeof(uint64_t)); + + dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, + user_data, 16, false, false, false); + + /* Aligned user buffer. */ + dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, + user_data, 16, false, false, true); + + /* Unaligned user buffer. */ + dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, + &user_data[1], 16, false, false, true); + /* Aligned user buffer. */ dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, false); + user_data, sizeof(user_data) - 1, false, false, true); + + /* Unaligned user buffer. */ + dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, + &user_data[1], sizeof(user_data) - 1, false, false, true); } ZTEST_USER_F(dmm, test_check_dev_nocache_in_preallocate) @@ -195,15 +303,30 @@ 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); + user_data, sizeof(user_data), true, false, true); } ZTEST_USER_F(dmm, test_check_dev_nocache_out_allocate) { - uint8_t user_data[16]; + uint8_t user_data[129] __aligned(sizeof(uint64_t)); + /* First run to get code into ICACHE so that following results are consistent. */ + dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, + user_data, 16, false, false, false); + + /* Aligned user buffer. */ + dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, + user_data, 16, false, false, true); + /* Unaligned user buffer. */ + dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, + &user_data[1], 16, false, false, true); + + /* Aligned user buffer. */ + dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, + user_data, sizeof(user_data) - 1, false, false, true); + /* Unaligned user buffer. */ dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, false); + &user_data[1], sizeof(user_data) - 1, false, false, true); } ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) @@ -211,7 +334,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, false, true); } ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); From 6ec5bc6c31d98fa5019e52fa2b100d894d3de499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 2 Sep 2025 07:57:29 +0200 Subject: [PATCH 0083/3334] [nrf fromtree] soc: nordic: common: dmm: Optimize memcpy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Default memcpy used in zephyr is not optimized and performs simple byte by byte copying. Using double word or word access can significantly reduce copying time especially for RAM3 (slow peripheral RAM). Signed-off-by: Krzysztof Chruściński (cherry picked from commit ff3e0180adcf65ce62d365167c8cf7c5144fe692) --- soc/nordic/common/dmm.c | 25 +++++++++++++++++++++++-- soc/nordic/common/dmm.h | 4 ++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index 0b4e42f8c6de..78b43e7a4b98 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -136,6 +136,27 @@ static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) k_spin_unlock(&dh->lock, key); } +static void dmm_memcpy(void *dst, const void *src, size_t len) +{ +#define IS_ALIGNED32(x) IS_ALIGNED(x, sizeof(uint32_t)) +#define IS_ALIGNED64(x) IS_ALIGNED(x, sizeof(uint64_t)) + if (IS_ALIGNED64(len) && IS_ALIGNED64(dst) && IS_ALIGNED64(src)) { + for (uint32_t i = 0; i < len / sizeof(uint64_t); i++) { + ((uint64_t *)dst)[i] = ((uint64_t *)src)[i]; + } + return; + } + + if (IS_ALIGNED32(len) && IS_ALIGNED32(dst) && IS_ALIGNED32(src)) { + for (uint32_t i = 0; i < len / sizeof(uint32_t); i++) { + ((uint32_t *)dst)[i] = ((uint32_t *)src)[i]; + } + return; + } + + memcpy(dst, src, len); +} + int dmm_buffer_out_prepare(void *region, void const *user_buffer, size_t user_length, void **buffer_out) { @@ -172,7 +193,7 @@ int dmm_buffer_out_prepare(void *region, void const *user_buffer, size_t user_le return -ENOMEM; } /* - copy user buffer contents into allocated buffer */ - memcpy(*buffer_out, user_buffer, user_length); + dmm_memcpy(*buffer_out, user_buffer, user_length); } /* Check if device memory region is cacheable @@ -281,7 +302,7 @@ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, v * If no, copy allocated buffer to the user buffer */ if (buffer_in != user_buffer) { - memcpy(user_buffer, buffer_in, user_length); + dmm_memcpy(user_buffer, buffer_in, user_length); } /* If yes, no action is needed */ diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index 34b517c92dfc..ca627fbd55f4 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -35,12 +35,12 @@ extern "C" { * Cache line alignment is required if region is cacheable and data cache is enabled. */ #define DMM_REG_ALIGN_SIZE(node_id) \ - (DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint8_t)) + (DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint32_t)) #else #define DMM_IS_REG_CACHEABLE(node_id) 0 -#define DMM_REG_ALIGN_SIZE(node_id) (sizeof(uint8_t)) +#define DMM_REG_ALIGN_SIZE(node_id) (sizeof(uint32_t)) #endif /* CONFIG_DCACHE */ From fb1f6b0dc1103bf6789b95542dae9d9aa1e5c90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 2 Sep 2025 07:57:53 +0200 Subject: [PATCH 0084/3334] [nrf fromtree] soc: nordic: common: dmm: Optimize by using a micro heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add micro heap implementation which is using one or more 32 bit masks to allocate quickly blocks. It is significantly better than using sys_heap. Difference is especially big on RAM3 heap because heap control data is in RAM3 space so operations there were extremely slowly (15 us to allocate a buffer). Simplified implementation of the heap requires DMM API change as release functions need to know the length of the allocated buffer as simple heap requires that (buffer address is enough for the standard heap). Signed-off-by: Krzysztof Chruściński (cherry picked from commit decdb30b05fdfcae677f5f98872b84afbb80fdb9) --- soc/nordic/common/Kconfig | 14 ++++ soc/nordic/common/dmm.c | 164 +++++++++++++++++++++++++++++++++----- 2 files changed, 157 insertions(+), 21 deletions(-) diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index 782d9452b677..b3a8f13089db 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -48,5 +48,19 @@ source "subsys/logging/Kconfig.template.log_config" endif # MRAM_LATENCY +if HAS_NORDIC_DMM + +config DMM_HEAP_CHUNKS + int "Number of chunks in the DMM heap" + default 32 + help + DMM is using a simplified heap which is using 32 bit mask to allocate + required buffer which consists of contiguous chunks. If there are many + small buffers used with DMM it is possible that allocation will fail. + Number of chunks is a trade-off between performance and granularity. + Must be multiply of 32. + +endif # HAS_NORDIC_DMM + rsource "vpr/Kconfig" rsource "uicr/Kconfig" diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index 78b43e7a4b98..411b8be14a75 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include "dmm.h" @@ -26,6 +26,9 @@ .dt_align = DMM_REG_ALIGN_SIZE(node_id), \ .dt_allc = &_BUILD_LINKER_END_VAR(node_id)}, +#define HEAP_NUM_WORDS (CONFIG_DMM_HEAP_CHUNKS / 32) +BUILD_ASSERT(IS_ALIGNED(CONFIG_DMM_HEAP_CHUNKS, 32)); + /* 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. @@ -42,9 +45,13 @@ struct dmm_region { }; struct dmm_heap { - struct sys_heap heap; + uint32_t mask[HEAP_NUM_WORDS]; + atomic_t tail_mask[HEAP_NUM_WORDS]; + uintptr_t ptr; + uintptr_t ptr_end; + size_t blk_size; const struct dmm_region *region; - struct k_spinlock lock; + sys_bitarray_t bitarray; }; static const struct dmm_region dmm_regions[] = { @@ -55,7 +62,6 @@ 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; @@ -103,37 +109,144 @@ static bool is_user_buffer_correctly_preallocated(void const *user_buffer, size_ return false; } -static size_t dmm_heap_start_get(struct dmm_heap *dh) +/* Function updates the tail bits mask after the allocation. Tail bits are all bits + * except the head. Tail bits mask together with a known index of the start of + * chunk (because freeing has a buffer address) allows to determine the size of the + * buffer (how many chunks were included. Because tail_mask is updated after allocation + * we can safely modify bits that represents allocated buffer, we only need to use + * atomic operation on the mask since mask may be modified (but different bits). + */ +static void tail_mask_set(atomic_t *tail_mask, size_t num_bits, size_t off) { - return ROUND_UP(dh->region->dt_allc, dh->region->dt_align); + size_t tail_bits = num_bits - 1; + size_t tail_off = off + 1; + + if (tail_bits == 0) { + return; + } + + if (HEAP_NUM_WORDS == 1) { + atomic_or(tail_mask, BIT_MASK(tail_bits) << tail_off); + return; + } + + /* If bit mask exceeds a single word then tail may spill to the adjacent word. */ + size_t idx = tail_off / 32; + + tail_off = tail_off - 32 * idx; + if ((tail_off + tail_bits) <= 32) { + /* Tail mask fits in a single word. */ + atomic_or(&tail_mask[idx], BIT_MASK(tail_bits) << tail_off); + return; + } + + /* Tail spilled. Remainder is set in the next word. Since number of tail_masks + * match number of words in bitarray we don't need to check if we are exceeding + * the array boundary. + */ + atomic_or(&tail_mask[idx], BIT_MASK(32 - tail_off) << tail_off); + + + size_t rem_tail = tail_bits - (32 - tail_off); + atomic_t *mask = &tail_mask[idx + 1]; + + while (rem_tail >= 32) { + atomic_or(mask, UINT32_MAX); + mask++; + rem_tail -= 32; + } + atomic_or(mask, BIT_MASK(rem_tail)); } -static size_t dmm_heap_size_get(struct dmm_heap *dh) +/* Function determines how many chunks were used for the allocated buffer. It is + * determined from tail bits mask and index of the starting chunk (%p off). + * Function is called before bits are freed in the bitarray so we can safely modify + * bits that belong to that buffer. + * + * @param tail_mask Pointer to tail_mask array. + * @param off Index of the start of the buffer. + * + * @return Number of chunks that forms the buffer that will be freed. + */ +static uint32_t num_bits_get(atomic_t *tail_mask, size_t off) { - return (dh->region->dt_size - (dmm_heap_start_get(dh) - dh->region->dt_addr)); + uint32_t mask; + uint32_t num_bits; + + if (HEAP_NUM_WORDS == 1) { + mask = (*tail_mask | BIT(off)) >> off; + num_bits = (~mask == 0) ? 32 : __builtin_ctz(~mask); + if (num_bits > 1) { + mask = BIT_MASK(num_bits - 1) << (off + 1); + atomic_and(tail_mask, ~mask); + } + + return num_bits; + } + + /* In multiword bit array we need to check if tail is spilling over to the next word. */ + size_t idx = off / 32; + size_t w_off = off - 32 * idx; + atomic_t *t_mask = &tail_mask[idx]; + + mask = (*t_mask | BIT(w_off)) >> w_off; + num_bits = (~mask == 0) ? 32 : __builtin_ctz(~mask); + if (num_bits == 1) { + return num_bits; + } + + mask = BIT_MASK(num_bits - 1) << (w_off + 1); + atomic_and(t_mask, ~mask); + if (((w_off + num_bits) == 32) && (idx < (HEAP_NUM_WORDS - 1))) { + size_t tmp_bits; + + /* If we are at the end of the one mask we need to check the beginning of the + * next one as there might be remaining part of the tail. + */ + do { + t_mask++; + tmp_bits = (*t_mask == UINT32_MAX) ? 32 : __builtin_ctz(~(*t_mask)); + mask = (tmp_bits == 32) ? UINT32_MAX : BIT_MASK(tmp_bits); + atomic_and(t_mask, ~mask); + num_bits += tmp_bits; + } while ((tmp_bits == 32) && (t_mask != &tail_mask[HEAP_NUM_WORDS - 1])); + } + + return num_bits; } static void *dmm_buffer_alloc(struct dmm_heap *dh, size_t length) { - void *ret; - k_spinlock_key_t key; + size_t num_bits, off; + int rv; + + if (dh->ptr == 0) { + /* Not initialized. */ + return NULL; + } length = ROUND_UP(length, dh->region->dt_align); + num_bits = DIV_ROUND_UP(length, dh->blk_size); + + rv = sys_bitarray_alloc(&dh->bitarray, num_bits, &off); + if (rv < 0) { + return NULL; + } - key = k_spin_lock(&dh->lock); - ret = sys_heap_aligned_alloc(&dh->heap, dh->region->dt_align, length); - k_spin_unlock(&dh->lock, key); + tail_mask_set(dh->tail_mask, num_bits, off); - return ret; + return (void *)(dh->ptr + dh->blk_size * off); } static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) { - k_spinlock_key_t key; + size_t offset = ((uintptr_t)buffer - dh->ptr) / dh->blk_size; + size_t num_bits = num_bits_get(dh->tail_mask, offset); + int rv; - key = k_spin_lock(&dh->lock); - sys_heap_free(&dh->heap, buffer); - k_spin_unlock(&dh->lock, key); + rv = sys_bitarray_free(&dh->bitarray, num_bits, offset); + (void)rv; + __ASSERT_NO_MSG(rv == 0); } static void dmm_memcpy(void *dst, const void *src, size_t len) @@ -222,7 +335,7 @@ int dmm_buffer_out_release(void *region, void *buffer_out) /* 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 (is_buffer_within_region(addr, 0, dh->ptr, dh->ptr_end)) { /* If yes, free the buffer */ dmm_buffer_free(dh, buffer_out); } @@ -309,7 +422,7 @@ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, v /* 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 (is_buffer_within_region(addr, user_length, dh->ptr, dh->ptr_end)) { /* If yes, free the buffer */ dmm_buffer_free(dh, buffer_in); } @@ -321,11 +434,20 @@ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, v int dmm_init(void) { struct dmm_heap *dh; + int blk_cnt; + int heap_space; 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)); + dh->ptr = ROUND_UP(dh->region->dt_allc, dh->region->dt_align); + heap_space = dh->region->dt_size - (dh->ptr - dh->region->dt_addr); + dh->blk_size = ROUND_UP(heap_space / (32 * HEAP_NUM_WORDS), dh->region->dt_align); + blk_cnt = heap_space / dh->blk_size; + dh->ptr_end = dh->ptr + blk_cnt * dh->blk_size; + dh->bitarray.num_bits = blk_cnt; + dh->bitarray.num_bundles = HEAP_NUM_WORDS; + dh->bitarray.bundles = dh->mask; } return 0; From 3e669e315b2f76972e684a2f18a71885d0b432b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 1 Sep 2025 15:58:37 +0200 Subject: [PATCH 0085/3334] [nrf fromtree] tests: boards: nrf: dmm: Align test to changes in DMM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align to API changes. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 8cc4da31ca72507ccada7414f58ed6f5af4c6f8f) --- tests/boards/nrf/dmm/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 06f4ace0e608..6cfeb1372ec2 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -28,7 +28,7 @@ #if CONFIG_DCACHE BUILD_ASSERT(DMM_ALIGN_SIZE(DUT_CACHE) == CONFIG_DCACHE_LINE_SIZE); -BUILD_ASSERT(DMM_ALIGN_SIZE(DUT_NOCACHE) == 1); +BUILD_ASSERT(DMM_ALIGN_SIZE(DUT_NOCACHE) == sizeof(uint32_t)); #endif struct dmm_test_region { From 4294147e26f94c2c5c6c58fda5bda1cbb2da25f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 9 Sep 2025 21:45:42 +0200 Subject: [PATCH 0086/3334] [nrf fromtree] soc: nordic: common: dmm: Add optional usage stats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for getting usage statistics for DMM. Signed-off-by: Krzysztof Chruściński (cherry picked from commit d10ee98ee8294b72128fdef781fd98922c2e8250) --- soc/nordic/common/Kconfig | 3 +++ soc/nordic/common/dmm.c | 45 +++++++++++++++++++++++++++++++++++++++ soc/nordic/common/dmm.h | 27 +++++++++++++++++++++++ 3 files changed, 75 insertions(+) diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index b3a8f13089db..e1fcd713c77c 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -60,6 +60,9 @@ config DMM_HEAP_CHUNKS Number of chunks is a trade-off between performance and granularity. Must be multiply of 32. +config DMM_STATS + bool "Usage statistics" + endif # HAS_NORDIC_DMM rsource "vpr/Kconfig" diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index 411b8be14a75..e832a1f27b80 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -52,6 +52,11 @@ struct dmm_heap { size_t blk_size; const struct dmm_region *region; sys_bitarray_t bitarray; +#ifdef CONFIG_DMM_STATS + atomic_t curr_use; + uint32_t max_use; + struct k_spinlock lock; +#endif }; static const struct dmm_region dmm_regions[] = { @@ -235,6 +240,15 @@ static void *dmm_buffer_alloc(struct dmm_heap *dh, size_t length) tail_mask_set(dh->tail_mask, num_bits, off); +#ifdef CONFIG_DMM_STATS + k_spinlock_key_t key; + + key = k_spin_lock(&dh->lock); + dh->curr_use += num_bits; + dh->max_use = MAX(dh->max_use, dh->curr_use); + k_spin_unlock(&dh->lock, key); +#endif + return (void *)(dh->ptr + dh->blk_size * off); } @@ -244,6 +258,9 @@ static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) size_t num_bits = num_bits_get(dh->tail_mask, offset); int rv; +#ifdef CONFIG_DMM_STATS + atomic_sub(&dh->curr_use, num_bits); +#endif rv = sys_bitarray_free(&dh->bitarray, num_bits, offset); (void)rv; __ASSERT_NO_MSG(rv == 0); @@ -431,6 +448,34 @@ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, v return 0; } +int dmm_stats_get(void *region, uintptr_t *start_addr, uint32_t *curr_use, uint32_t *max_use) +{ +#ifdef CONFIG_DMM_STATS + struct dmm_heap *dh; + + dh = dmm_heap_find(region); + if (dh == NULL) { + return -EINVAL; + } + + if (start_addr) { + *start_addr = dh->ptr; + } + + if (curr_use) { + *curr_use = (100 * dh->curr_use) / dh->bitarray.num_bits; + } + + if (max_use) { + *max_use = (100 * dh->max_use) / dh->bitarray.num_bits; + } + + return 0; +#else + return -ENOTSUP; +#endif +} + int dmm_init(void) { struct dmm_heap *dh; diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index ca627fbd55f4..09486289aa60 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -163,6 +163,22 @@ 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 Get statistics. + * + * Must be enabled with CONFIG_DMM_STATS. + * + * @param[in] region DMM memory region. + * @param[out] start_addr Location where starting address of the memory region is set. Can be null. + * @param[out] curr_use Location where current use in percent is written. Can be null. + * @param[out] max_use Location where maximum use in percent is written. Can be null. + * + * @retval 0 on success. + * @retval -EINVAL Invalid region. + * @retval -ENOTSUP Feature is disabled. + */ +int dmm_stats_get(void *region, uintptr_t *start_addr, uint32_t *curr_use, uint32_t *max_use); + /** * @brief Initialize DMM. * @@ -210,6 +226,17 @@ static ALWAYS_INLINE int dmm_buffer_in_release(void *region, void *user_buffer, return 0; } +static ALWAYS_INLINE int dmm_stats_get(void *region, uintptr_t *start_addr, + uint32_t *curr_use, uint32_t *max_use) +{ + ARG_UNUSED(region); + ARG_UNUSED(start_addr); + ARG_UNUSED(curr_use); + ARG_UNUSED(max_use); + + return 0; +} + static ALWAYS_INLINE int dmm_init(void) { return 0; From 2b669605aa89d4233fde1eef1bdfdba127e5299e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 9 Sep 2025 21:47:07 +0200 Subject: [PATCH 0087/3334] [nrf fromtree] tests: boards: nrf: dmm: Extend test coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extended test to check usage stats and longer buffer alloc. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 3d3104207ca7219c2489182c9b5617b7ebe341c1) --- tests/boards/nrf/dmm/src/main.c | 46 ++++++++++++++++++++++++++++++ tests/boards/nrf/dmm/testcase.yaml | 5 ++++ 2 files changed, 51 insertions(+) diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 6cfeb1372ec2..f4073d82e9b2 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -337,6 +337,52 @@ ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) user_data, sizeof(user_data), true, false, true); } +ZTEST_USER_F(dmm, test_check_multiple_alloc_and_free) +{ + int retval; + uint8_t buf[256]; + uint8_t buf2[32]; + void *dmm_buf; + void *dmm_buf2; + void *mem_reg = fixture->regions[DMM_TEST_REGION_NOCACHE].mem_reg; + uintptr_t start_address; + uint32_t curr_use, max_use; + + if (IS_ENABLED(CONFIG_DMM_STATS)) { + retval = dmm_stats_get(mem_reg, &start_address, &curr_use, &max_use); + zassert_ok(retval); + } + + memset(buf, 0, sizeof(buf)); + memset(buf2, 0, sizeof(buf2)); + + retval = dmm_buffer_out_prepare(mem_reg, (void *)buf, sizeof(buf), &dmm_buf); + zassert_ok(retval); + zassert_true(dmm_buf != NULL); + + retval = dmm_buffer_out_prepare(mem_reg, (void *)buf2, sizeof(buf2), &dmm_buf2); + zassert_ok(retval); + zassert_true(dmm_buf2 != NULL); + + retval = dmm_buffer_out_release(mem_reg, dmm_buf2); + zassert_ok(retval); + zassert_true(dmm_buf != NULL); + + retval = dmm_buffer_out_release(mem_reg, dmm_buf); + zassert_ok(retval); + zassert_true(dmm_buf != NULL); + + if (IS_ENABLED(CONFIG_DMM_STATS)) { + uint32_t curr_use2; + + retval = dmm_stats_get(mem_reg, &start_address, &curr_use2, &max_use); + zassert_ok(retval); + zassert_equal(curr_use, curr_use2); + TC_PRINT("Stats start_address:%p current use:%d%% max use:%d%%\n", + (void *)start_address, curr_use2, max_use); + } +} + ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); int dmm_test_prepare(void) diff --git a/tests/boards/nrf/dmm/testcase.yaml b/tests/boards/nrf/dmm/testcase.yaml index b5f41f281a5b..140454add34e 100644 --- a/tests/boards/nrf/dmm/testcase.yaml +++ b/tests/boards/nrf/dmm/testcase.yaml @@ -16,3 +16,8 @@ tests: - CONFIG_DCACHE=n platform_allow: - nrf54h20dk/nrf54h20/cpuapp + boards.nrf.dmm.stats: + extra_configs: + - CONFIG_DMM_STATS=y + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp From 46682fcc47a2f6f42b9e161c10e33b065a6ebb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 22 Sep 2025 15:25:07 +0200 Subject: [PATCH 0088/3334] [nrf fromtree] tests: boards: nrf: dmm: Add stress test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add stress test which validates that allocator is thread safe and has no memory leaks. Signed-off-by: Krzysztof Chruściński (cherry picked from commit c02f904a574ac3f2c988d20d138c4627f48f3d24) --- tests/boards/nrf/dmm/prj.conf | 1 + tests/boards/nrf/dmm/src/main.c | 178 +++++++++++++++++++++++++++++ tests/boards/nrf/dmm/testcase.yaml | 6 + 3 files changed, 185 insertions(+) diff --git a/tests/boards/nrf/dmm/prj.conf b/tests/boards/nrf/dmm/prj.conf index 0b99d72b0c32..c05afbb6ad35 100644 --- a/tests/boards/nrf/dmm/prj.conf +++ b/tests/boards/nrf/dmm/prj.conf @@ -1,4 +1,5 @@ CONFIG_ZTEST=y +CONFIG_ZTRESS=y CONFIG_ASSERT=n CONFIG_SPIN_VALIDATE=n CONFIG_TEST_EXTRA_STACK_SIZE=512 diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index f4073d82e9b2..27d239d5cf20 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include @@ -383,6 +385,182 @@ ZTEST_USER_F(dmm, test_check_multiple_alloc_and_free) } } +struct dmm_stress_data { + void *mem_reg; + void *alloc_ptr[32]; + uint8_t alloc_token[32]; + size_t alloc_len[32]; + atomic_t alloc_mask; + atomic_t busy_mask; + atomic_t fails; + atomic_t cnt; + bool cached; +}; + +static void stress_free_op(struct dmm_stress_data *data, int prio, int id) +{ + /* buffer is allocated. */ + uint8_t token = data->alloc_token[id]; + size_t len = data->alloc_len[id]; + uint8_t *ptr = data->alloc_ptr[id]; + int rv; + + for (int j = 0; j < len; j++) { + uint8_t exp_val = (uint8_t)(token + j); + + if (ptr[j] != exp_val) { + for (int k = 0; k < len; k++) { + printk("%02x ", ptr[k]); + } + } + zassert_equal(ptr[j], exp_val, "At %d got:%d exp:%d, len:%d id:%d, alloc_cnt:%d", + j, ptr[j], exp_val, len, id, (uint32_t)data->cnt); + } + + rv = dmm_buffer_in_release(data->mem_reg, ptr, len, ptr); + zassert_ok(rv); + /* Indicate that buffer is released. */ + atomic_and(&data->alloc_mask, ~BIT(id)); +} + +static bool stress_alloc_op(struct dmm_stress_data *data, int prio, int id) +{ + uint32_t r32 = sys_rand32_get(); + size_t len = r32 % 512; + uint8_t *ptr = data->alloc_ptr[id]; + int rv; + + /* Rarely allocate bigger buffer. */ + if ((r32 & 0x7) == 0) { + len += 512; + } + + rv = dmm_buffer_in_prepare(data->mem_reg, &r32/*dummy*/, len, (void **)&ptr); + if (rv < 0) { + atomic_inc(&data->fails); + return true; + } + + uint8_t token = r32 >> 24; + + data->alloc_ptr[id] = ptr; + data->alloc_len[id] = len; + data->alloc_token[id] = token; + for (int j = 0; j < len; j++) { + ptr[j] = (uint8_t)(j + token); + } + if (data->cached) { + sys_cache_data_flush_range(ptr, len); + } + atomic_inc(&data->cnt); + return false; +} + +bool stress_func(void *user_data, uint32_t cnt, bool last, int prio) +{ + struct dmm_stress_data *data = user_data; + uint32_t r = sys_rand32_get(); + int rpt = r & 0x3; + + r >>= 2; + + for (int i = 0; i < rpt + 1; i++) { + int id = r % 32; + int key; + bool free_op; + bool clear_bit; + + key = irq_lock(); + if ((data->busy_mask & BIT(id)) == 0) { + data->busy_mask |= BIT(id); + if (data->alloc_mask & BIT(id)) { + free_op = true; + } else { + data->alloc_mask |= BIT(id); + free_op = false; + } + } else { + irq_unlock(key); + continue; + } + + irq_unlock(key); + r >>= 5; + + if (free_op) { + stress_free_op(data, prio, id); + clear_bit = true; + } else { + clear_bit = stress_alloc_op(data, prio, id); + } + + key = irq_lock(); + data->busy_mask &= ~BIT(id); + if (clear_bit) { + data->alloc_mask &= ~BIT(id); + } + irq_unlock(key); + } + + return true; +} + +static void free_all(struct dmm_stress_data *data) +{ + while (data->alloc_mask) { + int id = 31 - __builtin_clz(data->alloc_mask); + + stress_free_op(data, 0, id); + data->alloc_mask &= ~BIT(id); + } +} + +static void stress_allocator(void *mem_reg, bool cached) +{ + uint32_t timeout = 3000; + struct dmm_stress_data ctx; + int rv; + uint32_t curr_use; + + memset(&ctx, 0, sizeof(ctx)); + ctx.mem_reg = mem_reg; + ctx.cached = cached; + + if (IS_ENABLED(CONFIG_DMM_STATS)) { + rv = dmm_stats_get(ctx.mem_reg, NULL, &curr_use, NULL); + zassert_ok(rv); + } + + ztress_set_timeout(K_MSEC(timeout)); + + ZTRESS_EXECUTE(ZTRESS_THREAD(stress_func, &ctx, INT32_MAX, INT32_MAX, Z_TIMEOUT_TICKS(4)), + ZTRESS_THREAD(stress_func, &ctx, INT32_MAX, INT32_MAX, Z_TIMEOUT_TICKS(4)), + ZTRESS_THREAD(stress_func, &ctx, INT32_MAX, INT32_MAX, Z_TIMEOUT_TICKS(4))); + + free_all(&ctx); + TC_PRINT("Executed %d allocation operation. Failed to allocate %d times.\n", + (uint32_t)ctx.cnt, (uint32_t)ctx.fails); + + if (IS_ENABLED(CONFIG_DMM_STATS)) { + uint32_t curr_use2; + + rv = dmm_stats_get(ctx.mem_reg, NULL, &curr_use2, NULL); + zassert_ok(rv); + zassert_equal(curr_use, curr_use2, "Unexpected usage got:%d exp:%d", + curr_use2, curr_use); + } +} + +ZTEST_F(dmm, test_stress_allocator_nocache) +{ + stress_allocator(fixture->regions[DMM_TEST_REGION_NOCACHE].mem_reg, false); +} + +ZTEST_F(dmm, test_stress_allocator_cache) +{ + stress_allocator(fixture->regions[DMM_TEST_REGION_CACHE].mem_reg, true); +} + ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); int dmm_test_prepare(void) diff --git a/tests/boards/nrf/dmm/testcase.yaml b/tests/boards/nrf/dmm/testcase.yaml index 140454add34e..7fc991d4824c 100644 --- a/tests/boards/nrf/dmm/testcase.yaml +++ b/tests/boards/nrf/dmm/testcase.yaml @@ -21,3 +21,9 @@ tests: - CONFIG_DMM_STATS=y platform_allow: - nrf54h20dk/nrf54h20/cpuapp + boards.nrf.dmm.more_chunks: + extra_configs: + - CONFIG_DMM_STATS=y + - CONFIG_DMM_HEAP_CHUNKS=96 + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp From 853ce9833bd2b694cb09d2d2077348741cf76b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 1 Oct 2025 09:56:55 +0200 Subject: [PATCH 0089/3334] [nrf fromlist] tests: boards: nrf: dmm: Skip stress test for empty memory region MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skip stress test if null memory region. That's the case if DMM is disabled. Upstream PR #: 96831 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 8bbc75283f647428fe8c5ac9f762bf98e8748559) --- tests/boards/nrf/dmm/src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 27d239d5cf20..58b7e891c795 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -522,6 +522,10 @@ static void stress_allocator(void *mem_reg, bool cached) int rv; uint32_t curr_use; + if (mem_reg == NULL) { + ztest_test_skip(); + } + memset(&ctx, 0, sizeof(ctx)); ctx.mem_reg = mem_reg; ctx.cached = cached; From 5e15ebc78368d551bff9087db2e0dedca4fdd934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 1 Oct 2025 07:47:44 +0200 Subject: [PATCH 0090/3334] [nrf fromlist] soc: nordic: common: dmm: Fix allocation algorithm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were some corner cases and stress test could fail. Reworking tail bits handling to make the stress test pass. Upstream PR #: 96831 Signed-off-by: Krzysztof Chruściński (cherry picked from commit 452da84594bee4d72b7c9aa51ae4814e79819de9) --- soc/nordic/common/dmm.c | 91 +++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 57 deletions(-) diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index e832a1f27b80..ac22f8ee430a 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -135,32 +135,19 @@ static void tail_mask_set(atomic_t *tail_mask, size_t num_bits, size_t off) return; } - /* If bit mask exceeds a single word then tail may spill to the adjacent word. */ size_t idx = tail_off / 32; + atomic_t *t_mask = &tail_mask[idx]; - tail_off = tail_off - 32 * idx; - if ((tail_off + tail_bits) <= 32) { - /* Tail mask fits in a single word. */ - atomic_or(&tail_mask[idx], BIT_MASK(tail_bits) << tail_off); - return; - } - - /* Tail spilled. Remainder is set in the next word. Since number of tail_masks - * match number of words in bitarray we don't need to check if we are exceeding - * the array boundary. - */ - atomic_or(&tail_mask[idx], BIT_MASK(32 - tail_off) << tail_off); - - - size_t rem_tail = tail_bits - (32 - tail_off); - atomic_t *mask = &tail_mask[idx + 1]; + tail_off = tail_off % 32; + while (tail_bits > 0) { + uint32_t bits = MIN(32 - tail_off, tail_bits); + uint32_t mask = (bits == 32) ? UINT32_MAX : (BIT_MASK(bits) << tail_off); - while (rem_tail >= 32) { - atomic_or(mask, UINT32_MAX); - mask++; - rem_tail -= 32; + atomic_or(t_mask, mask); + t_mask++; + tail_off = 0; + tail_bits -= bits; } - atomic_or(mask, BIT_MASK(rem_tail)); } /* Function determines how many chunks were used for the allocated buffer. It is @@ -175,47 +162,37 @@ static void tail_mask_set(atomic_t *tail_mask, size_t num_bits, size_t off) */ static uint32_t num_bits_get(atomic_t *tail_mask, size_t off) { - uint32_t mask; - uint32_t num_bits; + uint32_t num_bits = 1; + size_t tail_off = off + 1; + size_t idx = tail_off / 32; + atomic_t *t_mask = &tail_mask[idx]; - if (HEAP_NUM_WORDS == 1) { - mask = (*tail_mask | BIT(off)) >> off; - num_bits = (~mask == 0) ? 32 : __builtin_ctz(~mask); - if (num_bits > 1) { - mask = BIT_MASK(num_bits - 1) << (off + 1); - atomic_and(tail_mask, ~mask); - } + tail_off = tail_off % 32; + do { + uint32_t mask = (uint32_t)*t_mask >> tail_off; - return num_bits; - } + if (mask == UINT32_MAX) { + num_bits += 32; + atomic_set(t_mask, 0); + } else { + uint32_t bits = __builtin_ctz(~mask); - /* In multiword bit array we need to check if tail is spilling over to the next word. */ - size_t idx = off / 32; - size_t w_off = off - 32 * idx; - atomic_t *t_mask = &tail_mask[idx]; + if (bits == 0) { + break; + } - mask = (*t_mask | BIT(w_off)) >> w_off; - num_bits = (~mask == 0) ? 32 : __builtin_ctz(~mask); - if (num_bits == 1) { - return num_bits; - } + num_bits += bits; + atomic_and(t_mask, ~(BIT_MASK(bits) << tail_off)); - mask = BIT_MASK(num_bits - 1) << (w_off + 1); - atomic_and(t_mask, ~mask); - if (((w_off + num_bits) == 32) && (idx < (HEAP_NUM_WORDS - 1))) { - size_t tmp_bits; + if (bits + tail_off < 32) { + break; + } - /* If we are at the end of the one mask we need to check the beginning of the - * next one as there might be remaining part of the tail. - */ - do { - t_mask++; - tmp_bits = (*t_mask == UINT32_MAX) ? 32 : __builtin_ctz(~(*t_mask)); - mask = (tmp_bits == 32) ? UINT32_MAX : BIT_MASK(tmp_bits); - atomic_and(t_mask, ~mask); - num_bits += tmp_bits; - } while ((tmp_bits == 32) && (t_mask != &tail_mask[HEAP_NUM_WORDS - 1])); - } + tail_off = 0; + } + + t_mask++; + } while ((HEAP_NUM_WORDS > 1) && (t_mask != &tail_mask[HEAP_NUM_WORDS])); return num_bits; } From 262d3e43c26d859b0cfbb8961cb436f3f503255d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 26 Sep 2025 15:08:36 +0200 Subject: [PATCH 0091/3334] [nrf fromtree] dts: arm: nrf54h20_cpurad: disable unsuppported s2ram state The s2ram power state is a "suspend-to-ram" state which is not supported by the radio core, so delete it from the overlay. Signed-off-by: Bjarki Arge Andreasen Signed-off-by: Adam Kondraciuk (cherry picked from commit 91c8c07179d386bbb6ed6af2531f61de77ac773d) --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 279bc7581112..f7f7464f91c2 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -21,6 +21,7 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &cpuapp_ram0; /delete-node/ &cpuppr; /delete-node/ &cpuflpr; +/delete-node/ &s2ram; / { soc { From 9f3067646ac8ea7ec76862d8c4d80290610cdd50 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Fri, 19 Sep 2025 12:53:18 +0200 Subject: [PATCH 0092/3334] [nrf fromtree] Bluetooth: Mesh: Decouple blob_io_flash erase from flash config This adds a Kconfig dependency on FLASH_PAGE_LAYOUT when using flash with explicit erase, removing all code dependencies on flash configuration from the erasure logic. This module already requires FLASH_PAGE_LAYOUT to be set when using it with flash with explicit erase, as a silent requirement. The current code does not work without this option enabled except for the case where a BLOB has a size which is a multiple of the page size (since, without it, trying to erase flash space for the final block, which is of variable size, will fail). Also cleans up the code a bit. Signed-off-by: Ludvig Jordet (cherry picked from commit 294a2cd9dbc06b4cc8f0d61bbae0b217914c7d72) --- subsys/bluetooth/mesh/Kconfig | 1 + subsys/bluetooth/mesh/blob_io_flash.c | 65 ++++++++++++++------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 2c03c4e9ea3f..c6a25260612f 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1058,6 +1058,7 @@ config BT_MESH_BLOB_IO_FLASH_WITH_ERASE bool "BLOB flash support for devices with erase" default y if FLASH_HAS_EXPLICIT_ERASE depends on FLASH_HAS_EXPLICIT_ERASE + depends on FLASH_PAGE_LAYOUT help Enable path supporting devices with erase. This option appears only if there are devices requiring erase, before write, in the system diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index 8d989a6feca5..293f08feecdc 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -56,42 +56,38 @@ static void io_close(const struct bt_mesh_blob_io *io, flash_area_close(flash->area); } +/* Erasure code not needed if no flash in the system requires explicit erase */ +#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE static inline int erase_device_block(const struct flash_area *fa, off_t start, size_t size) { - /* If there are no devices requiring erase, then there is nothing to do */ - if (IS_ENABLED(CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE)) { - const struct device *fdev = flash_area_get_device(fa); - - if (!fdev) { - return -ENODEV; - } - - /* We have a mix of devices in system */ - if (IS_ENABLED(CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE)) { - const struct flash_parameters *fparam = flash_get_parameters(fdev); - - /* If device has no erase requirement then do nothing */ - if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { - return 0; - } - } - - if (IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT)) { - struct flash_pages_info page; - int err; - - err = flash_get_page_info_by_offs(fdev, start, &page); - if (err) { - return err; - } - - size = page.size * DIV_ROUND_UP(size, page.size); - start = page.start_offset; - } - return flash_area_erase(fa, start, size); + const struct device *fdev = flash_area_get_device(fa); + struct flash_pages_info page; + int err; + + if (!fdev) { + return -ENODEV; } - return 0; +#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE + /* We have a mix of devices in system */ + const struct flash_parameters *fparam = flash_get_parameters(fdev); + + /* If device has no erase requirement then do nothing */ + if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { + return 0; + } +#endif /* CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE */ + + err = flash_get_page_info_by_offs(fdev, start, &page); + if (err) { + return err; + } + + /* Align to page boundary. */ + size = page.size * DIV_ROUND_UP(size, page.size); + start = page.start_offset; + + return flash_area_erase(fa, start, size); } static int block_start(const struct bt_mesh_blob_io *io, @@ -106,6 +102,7 @@ static int block_start(const struct bt_mesh_blob_io *io, return erase_device_block(flash->area, flash->offset + block->offset, block->size); } +#endif /* CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE */ static int rd_chunk(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, @@ -165,7 +162,11 @@ int bt_mesh_blob_io_flash_init(struct bt_mesh_blob_io_flash *flash, flash->offset = offset; flash->io.open = io_open; flash->io.close = io_close; +#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE flash->io.block_start = block_start; +#else + flash->io.block_start = NULL; +#endif flash->io.block_end = NULL; flash->io.rd = rd_chunk; flash->io.wr = wr_chunk; From 466221ac7f44a7ad199b8c959e41e1f71db885c4 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Fri, 19 Sep 2025 13:10:02 +0200 Subject: [PATCH 0093/3334] [nrf fromtree] Bluetooth: Mesh: make blob_io_flash support smaller blocks Only erase a page when starting the first block on that page. This fixes a bug where, if the block size is smaller than the page size, the entire page would be erased upon start of each block when writing, meaning only the final block on each page would be retained. This works because blocks are always received in order. Signed-off-by: Ludvig Jordet (cherry picked from commit 99190cb08fdbe5222409d4f4f81b294a7725f8dd) --- subsys/bluetooth/mesh/blob_io_flash.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index 293f08feecdc..f4856723d7a1 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -83,9 +83,13 @@ static inline int erase_device_block(const struct flash_area *fa, off_t start, s return err; } + if (start != page.start_offset) { + /* Only need to erase when starting the first block on the page. */ + return 0; + } + /* Align to page boundary. */ size = page.size * DIV_ROUND_UP(size, page.size); - start = page.start_offset; return flash_area_erase(fa, start, size); } From af3a68be8c7c883d334de5b869f285a2081a75dd Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Fri, 19 Sep 2025 13:13:02 +0200 Subject: [PATCH 0094/3334] [nrf fromtree] Bluetooth: Mesh: decouple blob_io_flash from internal flash This fully decouples blob_io_flash from specific flash device details, by not reading the write block size from a hard-coded device tree node, instead pulling this from the actual flash device used. The block write routine has been updated to be more generic and fix a few bugs: * The write buffer is now sized based on a KConfig option instead of basing it off the device tree - this makes the module usable with any flash device, not just the internal memory. The configured value is checked during initialization, to ensure that the configured size will fit the write block size required by the device passed to the init function. * The erase value used to fill the buffer when using a device with explicit erase is now pulled from the flash parameters instead of being hard-coded to `0xff`. * An additional write block sized piece of buffer is allocated - the previous buffer sizing with rounding up only worked if `BLOB_RX_CHUNK_SIZE % WRITE_BLOCK_SIZE` was 0 or 1 (which coincidentally worked in all testing because the chunk size defaults to 161, and for internal flash w/write block size of 4, `161 % 4 == 1`). * The choice of whether to just write the chunk as-is or to write-block align it is now based on the erase cap pulled from the flash parameters, instead of checking the type of memory in the SOC. This means the module dos _not_ currently support the case where memory has to be written write-block aligned, but the memory does _not_ use explicit erase. It uses a trick of filling the write buffer with the erase value to avoid overwriting existing chunks, which will not work in this case. This trick is required to support random ordered chunks while still writing write-block aligned. * The code has been cleaned up a bit in general. Signed-off-by: Ludvig Jordet (cherry picked from commit db207b04a8f13cf9f93d34cf26b18b0a9ec2dac5) --- subsys/bluetooth/mesh/Kconfig | 11 +++++ subsys/bluetooth/mesh/blob_io_flash.c | 63 ++++++++++++++++++++------- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index c6a25260612f..dc0eb71841d7 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1065,6 +1065,17 @@ config BT_MESH_BLOB_IO_FLASH_WITH_ERASE and may be disabled to reduce code size in case when no operations are intended on such type of devices. +if BT_MESH_BLOB_IO_FLASH_WITH_ERASE + +config BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX + int "Maximum supported write block size" + default 4 + help + The BLOB IO Flash module will support flash devices with explicit erase + using a write block size of at most this value. + +endif # BT_MESH_BLOB_IO_FLASH_WITH_ERASE + endif # BT_MESH_BLOB_IO_FLASH config BT_MESH_DFU_SRV diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index f4856723d7a1..95554dd2f55b 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -12,13 +12,17 @@ #include "net.h" #include "transport.h" -#define WRITE_BLOCK_SIZE DT_PROP(DT_INST(0, soc_nv_flash), write_block_size) +#define LOG_LEVEL CONFIG_BT_MESH_MODEL_LOG_LEVEL +#include +LOG_MODULE_REGISTER(bt_mesh_blob_io_flash); #define FLASH_IO(_io) CONTAINER_OF(_io, struct bt_mesh_blob_io_flash, io) static int test_flash_area(uint8_t area_id) { + const struct flash_parameters *fparam; const struct flash_area *area; + const struct device *fdev; uint8_t align; int err; @@ -28,9 +32,19 @@ static int test_flash_area(uint8_t area_id) } align = flash_area_align(area); + fdev = flash_area_get_device(area); + fparam = flash_get_parameters(fdev); + flash_area_close(area); - if (align > WRITE_BLOCK_SIZE) { + if (!fdev) { + return -ENODEV; + } + + if ((flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT) && + CONFIG_BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX % align) { + LOG_ERR("CONFIG_BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX must be set to a\n" + "multiple of the write block size for the flash deviced used."); return -EINVAL; } @@ -126,30 +140,49 @@ static int wr_chunk(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_chunk *chunk) { struct bt_mesh_blob_io_flash *flash = FLASH_IO(io); + const struct device *fdev = flash_area_get_device(flash->area); - if (IS_ENABLED(CONFIG_SOC_FLASH_NRF_RRAM)) { + if (!fdev) { + return -ENODEV; + } + + const struct flash_parameters *fparam = flash_get_parameters(fdev); + + /* + * If device has no erase requirement then write directly. + * This is required since trick with padding using the erase value will + * not work in this case. + */ + if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { return flash_area_write(flash->area, flash->offset + block->offset + chunk->offset, chunk->data, chunk->size); } - uint8_t buf[ROUND_UP(BLOB_RX_CHUNK_SIZE, WRITE_BLOCK_SIZE)]; + /* + * Allocate one additional write block for the case where a chunk will need + * an extra write block on both sides to fit. + */ + uint8_t buf[ROUND_UP(BLOB_RX_CHUNK_SIZE, CONFIG_BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX) + + CONFIG_BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX]; + uint32_t write_block_size = flash_area_align(flash->area); off_t area_offset = flash->offset + block->offset + chunk->offset; - int i = 0; - - /* Write block align the chunk data */ - memset(&buf[i], 0xff, area_offset % WRITE_BLOCK_SIZE); - i += area_offset % WRITE_BLOCK_SIZE; + int start_pad = area_offset % write_block_size; - memcpy(&buf[i], chunk->data, chunk->size); - i += chunk->size; + /* + * Fill buffer with erase value, to make sure only the part of the + * buffer with chunk data will overwrite flash. + * (Because chunks can arrive in random order, this is required unless + * the entire block is cached in RAM). + */ + memset(buf, fparam->erase_value, sizeof(buf)); - memset(&buf[i], 0xff, ROUND_UP(i, WRITE_BLOCK_SIZE) - i); - i = ROUND_UP(i, WRITE_BLOCK_SIZE); + memcpy(&buf[start_pad], chunk->data, chunk->size); return flash_area_write(flash->area, - ROUND_DOWN(area_offset, WRITE_BLOCK_SIZE), - buf, i); + ROUND_DOWN(area_offset, write_block_size), + buf, + ROUND_UP(start_pad + chunk->size, write_block_size)); } int bt_mesh_blob_io_flash_init(struct bt_mesh_blob_io_flash *flash, From da3588e6d2dc200e1a56d267139aa809e048d318 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Fri, 19 Sep 2025 13:22:59 +0200 Subject: [PATCH 0095/3334] [nrf fromtree] Bluetooth: Mesh: Deprecate blob_io_flash erase cap options The only reason to keep these would be to enable conditional compilation of some parts of the code. However, we can't see enough benefit in doing this, particularly since the flash driver itself will conditionally handle certain paths depending on erase caps, so the options are deprecated to reduce complexity. Signed-off-by: Ludvig Jordet (cherry picked from commit 8720ab73905da9e99c392b85ac0dfcc9babdda42) --- subsys/bluetooth/mesh/Kconfig | 27 ++++++++++----------------- subsys/bluetooth/mesh/blob_io_flash.c | 10 ---------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index dc0eb71841d7..02845ab743c5 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1038,6 +1038,7 @@ config BT_MESH_BLOB_IO_FLASH default y depends on BT_MESH_BLOB_SRV || BT_MESH_BLOB_CLI depends on FLASH_MAP + depends on FLASH_PAGE_LAYOUT help Enable the BLOB flash stream for reading and writing BLOBs directly to and from flash. @@ -1045,36 +1046,28 @@ config BT_MESH_BLOB_IO_FLASH if BT_MESH_BLOB_IO_FLASH config BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE - bool "BLOB flash support for devices without erase" - default y if FLASH_HAS_NO_EXPLICIT_ERASE + bool "BLOB flash support for devices without erase [DEPRECATED]" + default n depends on FLASH_HAS_NO_EXPLICIT_ERASE + select DEPRECATED help - Enable path supporting devices without erase. This option appears only - if there are devices without explicit erase requirements in the system - and may be disabled to reduce code size in case when no operations - are intended on such type of devices. + This option is deprecated and is no longer used by the BLOB IO Flash module. config BT_MESH_BLOB_IO_FLASH_WITH_ERASE - bool "BLOB flash support for devices with erase" - default y if FLASH_HAS_EXPLICIT_ERASE + bool "BLOB flash support for devices with erase [DEPRECATED]" + default n depends on FLASH_HAS_EXPLICIT_ERASE depends on FLASH_PAGE_LAYOUT + select DEPRECATED help - Enable path supporting devices with erase. This option appears only - if there are devices requiring erase, before write, in the system - and may be disabled to reduce code size in case when no operations - are intended on such type of devices. - -if BT_MESH_BLOB_IO_FLASH_WITH_ERASE + This option is deprecated and is no longer used by the BLOB IO Flash module. config BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX int "Maximum supported write block size" default 4 help The BLOB IO Flash module will support flash devices with explicit erase - using a write block size of at most this value. - -endif # BT_MESH_BLOB_IO_FLASH_WITH_ERASE + when this value is set to a multiple of the device write block size. endif # BT_MESH_BLOB_IO_FLASH diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index 95554dd2f55b..792c53d4a0a6 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -70,8 +70,6 @@ static void io_close(const struct bt_mesh_blob_io *io, flash_area_close(flash->area); } -/* Erasure code not needed if no flash in the system requires explicit erase */ -#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE static inline int erase_device_block(const struct flash_area *fa, off_t start, size_t size) { const struct device *fdev = flash_area_get_device(fa); @@ -82,15 +80,12 @@ static inline int erase_device_block(const struct flash_area *fa, off_t start, s return -ENODEV; } -#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE - /* We have a mix of devices in system */ const struct flash_parameters *fparam = flash_get_parameters(fdev); /* If device has no erase requirement then do nothing */ if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { return 0; } -#endif /* CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE */ err = flash_get_page_info_by_offs(fdev, start, &page); if (err) { @@ -120,7 +115,6 @@ static int block_start(const struct bt_mesh_blob_io *io, return erase_device_block(flash->area, flash->offset + block->offset, block->size); } -#endif /* CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE */ static int rd_chunk(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, @@ -199,11 +193,7 @@ int bt_mesh_blob_io_flash_init(struct bt_mesh_blob_io_flash *flash, flash->offset = offset; flash->io.open = io_open; flash->io.close = io_close; -#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE flash->io.block_start = block_start; -#else - flash->io.block_start = NULL; -#endif flash->io.block_end = NULL; flash->io.rd = rd_chunk; flash->io.wr = wr_chunk; From e5079bb3123140c02a84f20c30507d9e7360a390 Mon Sep 17 00:00:00 2001 From: Artur Hadasz Date: Thu, 2 Oct 2025 15:57:56 +0200 Subject: [PATCH 0096/3334] [nrf fromtree] tests: boot: Fix bootloader.mcuboot boot loop for nrf platforms The swapped_app image, added via ExternalZephyrProject_Add, wasn't receiving the swap method configuration from sysbuild. If trying to build the test with a different configuration that SWAP_USING_OFFSET (for example SWAP_USING_MOVE) this resulted in a boot loop due to configuration mismatch between swapped_image and mcuboot. This fix ensures proper configuration propagation and prevents similar mismatches in future scenarios. Signed-off-by: Artur Hadasz (cherry picked from commit 7c1721de03bfbfe102817de415076d998a3516aa) --- tests/boot/test_mcuboot/sysbuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/boot/test_mcuboot/sysbuild.cmake b/tests/boot/test_mcuboot/sysbuild.cmake index dc5165114b58..920d07933917 100644 --- a/tests/boot/test_mcuboot/sysbuild.cmake +++ b/tests/boot/test_mcuboot/sysbuild.cmake @@ -14,6 +14,12 @@ ExternalZephyrProject_Add( SOURCE_DIR ${APP_DIR}/swapped_app ) +# This section ensures that sysbuild-related configurations, such as the MCUBOOT swap type, +# are passed down to the swapped_app image. +set_target_properties(swapped_app PROPERTIES + IMAGE_CONF_SCRIPT ${ZEPHYR_BASE}/share/sysbuild/image_configurations/MAIN_image_default.cmake +) + # Add the swapped app to the list of images to flash # Ensure the flashing order of images is as follows: # - mcuboot From 96f15ca90e4b260943d012a1a6b5bf3bf093559d Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Mon, 15 Sep 2025 11:22:28 +0200 Subject: [PATCH 0097/3334] [nrf noup] boards: Align board DTS with upstream. This alignment cannot be done through nrf fromlist commit, since it was introduced in the tree-wide commit: 2d22884f52a01236d404fb2e6910d3683f680af6 Once tried to pull all changes to merge it cleanly, the chain ended up in the doc/releases/migration-guide-4.3.rst file, which would bring nearly all of the changes from the Zephyr 4.3 release, making a small PR with just 4 white characters a Zephyr upmerge PR. Feel free to drop this commit during the next Zephyr upmerge. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit efb385c0bb2017698aafa73392a97a8cb68b964b) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index e587bc8b4d99..f0e04ecfb51e 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -339,8 +339,8 @@ zephyr_udc0: &usbhs { /* Trim this RAM block for making room on all run-time common S2RAM cpu context. */ &cpuapp_ram0 { - reg = <0x22000000 (DT_SIZE_K(32)-32)>; - ranges = <0x0 0x22000000 (0x8000-0x20)>; + reg = <0x22000000 (DT_SIZE_K(32) - 32)>; + ranges = <0x0 0x22000000 (0x8000 - 0x20)>; }; / { From 2aee95730b7d5eb72aee37c8d978527e20cb3588 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Wed, 16 Jul 2025 09:37:23 +0200 Subject: [PATCH 0098/3334] [nrf fromtree] soc: nordic: nrf54h: Implement idle with cache retained state Add new idle state with cache retention enabled. Signed-off-by: Adam Kondraciuk (cherry picked from commit 6f7a1834d52bc6a860d92a2777692ea5de582f50) --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 13 +++-- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 17 +++++++ dts/vendor/nordic/nrf54h20.dtsi | 12 +++-- soc/nordic/nrf54h/CMakeLists.txt | 5 ++ .../nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 3 ++ .../nrf54h/Kconfig.defconfig.nrf54h20_cpurad | 3 ++ soc/nordic/nrf54h/power.c | 50 +++++++++++++++---- soc/nordic/nrf54h/soc.c | 42 +++++++++------- soc/nordic/nrf54h/soc.h | 7 +++ 9 files changed, 116 insertions(+), 36 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index f0e04ecfb51e..a3be7ecaca94 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -337,14 +337,21 @@ zephyr_udc0: &usbhs { status = "okay"; }; -/* Trim this RAM block for making room on all run-time common S2RAM cpu context. */ +/* Trim this RAM block for power management related features. */ &cpuapp_ram0 { - reg = <0x22000000 (DT_SIZE_K(32) - 32)>; - ranges = <0x0 0x22000000 (0x8000 - 0x20)>; + reg = <0x22000000 (DT_SIZE_K(32) - 256)>; + ranges = <0x0 0x22000000 (0x8000 - 0x100)>; }; / { soc { + /* cache control functions - must be executed from local SRAM */ + pm_ramfunc: cpuapp_s2ram@22007f00 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x22007f00 192>; + zephyr,memory-region = "PMLocalRamfunc"; + }; + /* run-time common S2RAM cpu context RAM */ pm_s2ram: cpuapp_s2ram@22007fe0 { compatible = "zephyr,memory-region", "mmio-sram"; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 487df83f3bbf..fd5ad106117b 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -118,3 +118,20 @@ slot1_partition: &cpurad_slot1_partition { zephyr_udc0: &usbhs { status = "disabled"; }; + +/* Trim this RAM block for power management related features. */ +&cpurad_ram0 { + reg = <0x23000000 (DT_SIZE_K(192) - 192)>; + ranges = <0x0 0x23000000 (0x30000 - 0xC0)>; +}; + +/ { + soc { + /* cache control functions - must be executed from RAM */ + pm_ramfunc: cpurad_s2ram@2302ff40 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2302ff80 192>; + zephyr,memory-region = "PMLocalRamfunc"; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 70dd5809ba0b..b3a960e740b9 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -31,7 +31,7 @@ device_type = "cpu"; clocks = <&cpuapp_hsfll>; clock-frequency = ; - cpu-power-states = <&idle_cache_disabled &s2ram>; + cpu-power-states = <&idle_cache_retained &idle_cache_disabled &s2ram>; }; cpurad: cpu@3 { @@ -40,7 +40,7 @@ device_type = "cpu"; clocks = <&cpurad_hsfll>; clock-frequency = ; - cpu-power-states = <&idle_cache_disabled>; + cpu-power-states = <&idle_cache_retained &idle_cache_disabled>; }; cpuppr: cpu@d { @@ -130,7 +130,13 @@ power-states { // substate-id = <0>; is reserved for "idle", cache powered on - // substate-id = <1>; is reserved for "idle-cache-retained" + idle_cache_retained: idle_cache_retained { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-idle"; + substate-id = <1>; + min-residency-us = <700>; + exit-latency-us = <5>; + }; idle_cache_disabled: idle_cache_disabled { compatible = "zephyr,power-state"; power-state-name = "suspend-to-idle"; diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 94e38e62f2b1..a4db05c9e643 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -5,6 +5,11 @@ if(CONFIG_ARM) zephyr_library_sources(soc.c) if(CONFIG_PM OR CONFIG_POWEROFF) zephyr_library_sources(power.c) + zephyr_code_relocate( + FILES power.c + FILTER ".*\\.cache_retain_and_sleep" + LOCATION PMLocalRamfunc_TEXT + ) endif() endif() diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index 0cdc22760405..f2e0343d6350 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -14,4 +14,7 @@ config SHELL_BACKEND_SERIAL config POWER_DOMAIN default y +config CODE_DATA_RELOCATION + default y if PM || POWEROFF + endif # SOC_NRF54H20_CPUAPP diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad index b3f5216c8f9f..31687c2a5443 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad @@ -14,4 +14,7 @@ config PM config POWER_DOMAIN default y +config CODE_DATA_RELOCATION + default y if PM || POWEROFF + endif # SOC_NRF54H20_CPURAD diff --git a/soc/nordic/nrf54h/power.c b/soc/nordic/nrf54h/power.c index e1263be0d0e5..3a23a6050605 100644 --- a/soc/nordic/nrf54h/power.c +++ b/soc/nordic/nrf54h/power.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -87,18 +88,43 @@ void nrf_poweroff(void) CODE_UNREACHABLE; } -static void s2idle_enter(uint8_t substate_id) +static __attribute__((__used__, noinline)) void cache_retain_and_sleep(void) { + nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_SAVE); + nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_SAVE); + while (nrf_cache_busy_check(NRF_DCACHE) || + nrf_cache_busy_check(NRF_ICACHE)) { + + } + + __set_BASEPRI(0); + __ISB(); + __DSB(); + __WFI(); + + nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_RESTORE); + nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_RESTORE); + while (nrf_cache_busy_check(NRF_DCACHE) || + nrf_cache_busy_check(NRF_ICACHE)) { + + } +} + +void s2idle_enter(uint8_t substate_id) +{ +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) + soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_MAIN); +#endif switch (substate_id) { case 0: /* Substate for idle with cache powered on - not implemented yet. */ break; - case 1: /* Substate for idle with cache retained - not implemented yet. */ - break; + case 1: /* Substate for idle with cache retained. */ + soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); + nrf_soc_memconf_retain_set(true); + cache_retain_and_sleep(); + return; case 2: /* Substate for idle with cache disabled. */ -#if !defined(CONFIG_SOC_NRF54H20_CPURAD) - soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_MAIN); -#endif common_suspend(); break; default: /* Unknown substate. */ @@ -117,17 +143,19 @@ static void s2idle_exit(uint8_t substate_id) case 0: /* Substate for idle with cache powered on - not implemented yet. */ break; - case 1: /* Substate for idle with cache retained - not implemented yet. */ + case 1: /* Substate for idle with cache retained. */ + nrf_soc_memconf_retain_set(false); break; case 2: /* Substate for idle with cache disabled. */ nrf_power_up_cache(); - common_resume(); -#if !defined(CONFIG_SOC_NRF54H20_CPURAD) - soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_MAIN); -#endif + break; default: /* Unknown substate. */ return; } + common_resume(); +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) + soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_MAIN); +#endif } #if defined(CONFIG_PM_S2RAM) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 01cacf48f62f..1206e6767aa2 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -60,6 +60,26 @@ sys_snode_t soc_node; ADDRESS_DOMAIN_Msk | \ ADDRESS_BUS_Msk))) +void nrf_soc_memconf_retain_set(bool enable) +{ + uint32_t ret_mask = BIT(RAMBLOCK_RET_BIT_ICACHE) | BIT(RAMBLOCK_RET_BIT_DCACHE); + + nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, ret_mask, enable); + nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 1, ret_mask, enable); + +#if defined(RAMBLOCK_RET2_MASK) + ret_mask = 0; +#if defined(RAMBLOCK_RET2_BIT_ICACHE) + ret_mask |= BIT(RAMBLOCK_RET2_BIT_ICACHE); +#endif +#if defined(RAMBLOCK_RET2_BIT_DCACHE) + ret_mask |= BIT(RAMBLOCK_RET2_BIT_DCACHE); +#endif + nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, ret_mask, enable); + nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 1, ret_mask, enable); +#endif /* defined(RAMBLOCK_RET2_MASK) */ +} + static void power_domain_init(void) { /* @@ -75,28 +95,12 @@ static void power_domain_init(void) soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); nrf_lrcconf_poweron_force_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_MAIN, false); - - nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET_BIT_ICACHE, false); - nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET_BIT_DCACHE, false); - nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET_BIT_ICACHE, false); - nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET_BIT_DCACHE, false); -#if defined(RAMBLOCK_RET2_BIT_ICACHE) - nrf_memconf_ramblock_ret2_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET2_BIT_ICACHE, false); - nrf_memconf_ramblock_ret2_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET2_BIT_ICACHE, false); -#endif -#if defined(RAMBLOCK_RET2_BIT_DCACHE) - nrf_memconf_ramblock_ret2_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET2_BIT_DCACHE, false); - nrf_memconf_ramblock_ret2_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET2_BIT_DCACHE, false); -#endif + nrf_soc_memconf_retain_set(false); nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET_MASK, true); nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET_MASK, true); #if defined(RAMBLOCK_RET2_MASK) - /* - * TODO: Use nrf_memconf_ramblock_ret2_mask_enable_set() function - * when will be provided by HAL. - */ - NRF_MEMCONF->POWER[0].RET2 = RAMBLOCK_RET2_MASK; - NRF_MEMCONF->POWER[1].RET2 = RAMBLOCK_RET2_MASK; + nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET2_MASK, true); + nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET2_MASK, true); #endif } diff --git a/soc/nordic/nrf54h/soc.h b/soc/nordic/nrf54h/soc.h index 566c07a8c2cb..69c22e52bd16 100644 --- a/soc/nordic/nrf54h/soc.h +++ b/soc/nordic/nrf54h/soc.h @@ -36,4 +36,11 @@ #define RAMBLOCK_RET2_BIT_DCACHE MEMCONF_POWER_RET2_MEM7_Pos #endif +/** + * @brief Enable or disable the retention for cache RAM blocks. + * + * @param enable True if the retention is to be enabled, false otherwise. + */ +void nrf_soc_memconf_retain_set(bool enable); + #endif /* SOC_ARM_NORDIC_NRF_NRF54H_SOC_H_ */ From cc5f16968849d89b7b0343a9ee7bfceb6d55cc8f Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Tue, 16 Sep 2025 11:31:37 +0200 Subject: [PATCH 0099/3334] [nrf fromlist] boards: Define pm_s2ram_stack for nRF54H20 Add the definition of pm_s2ram_stack memory region for nRF54H20. Upstream PR #: 95914 Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 605041b22bf07cb3aee99a9e08efe9a464716b95) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index a3be7ecaca94..06e208e248a2 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -352,6 +352,13 @@ zephyr_udc0: &usbhs { zephyr,memory-region = "PMLocalRamfunc"; }; + /* temporary stack for S2RAM resume logic */ + pm_s2ram_stack: cpuapp_s2ram_stack@22007fd0 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x22007fd0 16>; + zephyr,memory-region = "pm_s2ram_stack"; + }; + /* run-time common S2RAM cpu context RAM */ pm_s2ram: cpuapp_s2ram@22007fe0 { compatible = "zephyr,memory-region", "mmio-sram"; From 8cf0404c5023efbfe877edc8e25c0adc212a1bc7 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Wed, 1 Oct 2025 16:27:50 +0200 Subject: [PATCH 0100/3334] [nrf fromlist] soc: nordic: nrf54h: Disable code relocation for MCUBOOT MCUBOOT requires LTO to be enabled, while using code relocation forces switching it off. When `__ramfunc` is used, LTO can also be used. Then the `cache_retain_and_sleep` function will work correctly, but slightly slower. Upstream PR #: 97094 Signed-off-by: Adam Kondraciuk (cherry picked from commit 23f56e05b481d0a7e674d299735388f574272bfa) --- soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 2 +- soc/nordic/nrf54h/power.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index f2e0343d6350..674b5433c147 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -15,6 +15,6 @@ config POWER_DOMAIN default y config CODE_DATA_RELOCATION - default y if PM || POWEROFF + default y if (PM || POWEROFF) && !MCUBOOT endif # SOC_NRF54H20_CPUAPP diff --git a/soc/nordic/nrf54h/power.c b/soc/nordic/nrf54h/power.c index 3a23a6050605..c72cb6e834e5 100644 --- a/soc/nordic/nrf54h/power.c +++ b/soc/nordic/nrf54h/power.c @@ -88,7 +88,12 @@ void nrf_poweroff(void) CODE_UNREACHABLE; } -static __attribute__((__used__, noinline)) void cache_retain_and_sleep(void) +#if CONFIG_MCUBOOT +static __ramfunc +#else +static __attribute__((__used__, noinline)) +#endif +void cache_retain_and_sleep(void) { nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_SAVE); nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_SAVE); From d2c4a88902da1582a2b8c75dd5f8a5fa5273d201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 6 Oct 2025 09:08:59 +0200 Subject: [PATCH 0101/3334] [nrf fromtree] tests: drivers: uart: uart_async_api: Enable test on nrf54h20 PPR XIP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay and config file required to run the uart_async_api test on nrf54h20dk/nrf54h20/cpuppr/xip platform. Signed-off-by: Sebastian Głąb (cherry picked from commit e0a9a16a259c27e7cb7b25ae941d37f03ab5d807) --- .../uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf | 3 +++ .../boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf new file mode 100644 index 000000000000..47f481017118 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf @@ -0,0 +1,3 @@ +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay new file mode 100644 index 000000000000..f65b4dd3b0ba --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +#include "nrf54h20dk_nrf54h20_common.dtsi" From c5abbea4f0140057215fe9799ea8e21c8a55c04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Laso=C5=84czyk?= Date: Tue, 5 Aug 2025 09:23:22 +0200 Subject: [PATCH 0102/3334] [nrf fromlist] tests: mbox: Add support for nRF54LM20A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend test coverage with new test. Upstream PR #: 94110 Signed-off-by: Karol Lasończyk (cherry picked from commit afb7e743a05fb3147a253e3bbd44ee6e10663369) --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 23 +++++++++++++++++++ .../drivers/mbox/mbox_error_cases/sample.yaml | 2 ++ .../drivers/mbox/mbox_error_cases/src/main.c | 3 ++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..334ba0fa5b42 --- /dev/null +++ b/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,23 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + mbox-consumer { + compatible = "vnd,mbox-consumer"; + mboxes = <&cpuapp_vevif_tx 21>, <&cpuapp_vevif_tx 32>, + <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_rx 32>; + mbox-names = "remote_valid", "remote_incorrect", + "local_valid", "local_incorrect"; + + }; +}; + +&cpuapp_vevif_rx { + status = "okay"; +}; + +&cpuapp_vevif_tx { + status = "okay"; +}; diff --git a/tests/drivers/mbox/mbox_error_cases/sample.yaml b/tests/drivers/mbox/mbox_error_cases/sample.yaml index 2746a1c29044..a285478b4235 100644 --- a/tests/drivers/mbox/mbox_error_cases/sample.yaml +++ b/tests/drivers/mbox/mbox_error_cases/sample.yaml @@ -17,8 +17,10 @@ tests: tests.drivers.mbox_error_cases.nrf54l: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_args: SNIPPET=nordic-flpr diff --git a/tests/drivers/mbox/mbox_error_cases/src/main.c b/tests/drivers/mbox/mbox_error_cases/src/main.c index 54a4a628ec23..377ab6b8be43 100644 --- a/tests/drivers/mbox/mbox_error_cases/src/main.c +++ b/tests/drivers/mbox/mbox_error_cases/src/main.c @@ -11,7 +11,8 @@ int dummy_value; #if defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || \ - defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) + defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) || \ + defined(CONFIG_SOC_NRF54LM20A) #define EXPECTED_MTU_VALUE (0) #define DATA_TRANSFER_MODE_SUPPORTED (0) #define REMOTE_BUSY_SUPPORTED (0) From 2d07f22566945a84254eca09b0f6953555193e3a Mon Sep 17 00:00:00 2001 From: Aleksander Wasaznik Date: Mon, 6 Oct 2025 16:02:41 +0200 Subject: [PATCH 0103/3334] [nrf fromlist] Bluetooth: Host: Invoke tx callbacks when channel is deleted When bt_l2cap_send_pdu() succeeds, it transfers buffer ownership to the stack, which must eventually invoke the provided callback. This contract is honored in all paths where transmission becomes impossible: - Normal transmission: callback invoked with err=0 after HCI Number of Completed Packets event (tx_notify_process) - Send errors (after tx allocated): callback invoked with err=-ESHUTDOWN via conn_tx_destroy - Send errors (before tx allocated): callback invoked with the specific error code in send_buf error_return path - Connection disconnect: callbacks invoked with err=-ESHUTDOWN via process_unack_tx -> conn_tx_destroy for all PDUs in tx_pending However, when a channel is deleted (l2cap_chan_del), PDUs remaining in the tx_queue are dropped without invoking their callbacks, violating the ownership contract. Fix this by extracting and invoking any non-NULL callbacks from the closure stored in buf->user_data before releasing the buffers. The callback is invoked with err=-ESHUTDOWN, making this path analogous to process_unack_tx: both drain queues of unsent PDUs when transmission becomes impossible due to external events (channel deletion vs connection disconnect). The only difference is the buffer lifecycle stage - in l2cap_chan_del, PDUs are still in tx_queue (closure in buf->user_data), while in process_unack_tx, they've progressed to tx_pending (callback in bt_conn_tx struct). Note: conn_tx_destroy() cannot be used here because no bt_conn_tx struct has been allocated yet - the closure is still in buf->user_data. Upstream PR #: 97056 Signed-off-by: Aleksander Wasaznik (cherry picked from commit 5d3ab35b88fe0d1136ee384745b24661a18cb3b2) --- subsys/bluetooth/host/l2cap.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index f65827fac1be..c4e37f74b5ae 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -273,6 +273,21 @@ static void l2cap_chan_del(struct bt_l2cap_chan *chan) * `l2cap_chan_destroy()` as it is not called for fixed channels. */ while ((buf = k_fifo_get(&le_chan->tx_queue, K_NO_WAIT))) { + bt_conn_tx_cb_t cb = closure_cb(buf->user_data); + + if (cb) { + void *user_data = closure_data(buf->user_data); + + /* When bt_l2cap_send_pdu() succeeds, the stack takes ownership + * and must invoke the callback eventually. Since these PDUs will + * never be transmitted, invoke the callback now with an error. + * Note: We cannot use conn_tx_destroy() here because no bt_conn_tx + * struct has been allocated yet - the closure is still in the + * buf->user_data. + */ + cb(chan->conn, user_data, -ESHUTDOWN); + } + net_buf_unref(buf); } From a8c9070e4892ad19f028849e7abe16576ee0746c Mon Sep 17 00:00:00 2001 From: Bartlomiej Buczek Date: Wed, 8 Oct 2025 09:02:06 +0200 Subject: [PATCH 0104/3334] [nrf fromlist] boards: nordic: nrf54h20: Add adc to supported features Enable twister tests execution on nrf54h20dk/nrf54h20/cpuppr target. Upstream PR #: 97165 Signed-off-by: Bartlomiej Buczek (cherry picked from commit 17417aa75e663b4c91ffe00b60c9339a629c5e9e) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml index 60f22350504d..87fe8c68ba91 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml @@ -11,6 +11,7 @@ sysbuild: true ram: 62 flash: 62 supported: + - adc - counter - gpio - i2c From 926b74cef26e63f2e8c9061599c924f2295dfd20 Mon Sep 17 00:00:00 2001 From: Bartlomiej Buczek Date: Tue, 7 Oct 2025 13:45:54 +0200 Subject: [PATCH 0105/3334] [nrf fromlist] tests: drivers: adc: Enable tests for nrf54h20 PPR. Fill in necessary config files with test data. Upstream PR #: 97109 Signed-off-by: Bartlomiej Buczek (cherry picked from commit a9b806184a31b3dfdd79d36701d78f5eb34902da) --- tests/drivers/adc/adc_accuracy_test/testcase.yaml | 1 + .../boards/nrf54h20dk_nrf54h20_common.dtsi | 11 +++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 8 ++------ .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 11 +++++++++++ tests/drivers/adc/adc_error_cases/testcase.yaml | 1 + 5 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_common.dtsi create mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr.overlay diff --git a/tests/drivers/adc/adc_accuracy_test/testcase.yaml b/tests/drivers/adc/adc_accuracy_test/testcase.yaml index 03f122f9cdaa..1f2f7c0fcfeb 100644 --- a/tests/drivers/adc/adc_accuracy_test/testcase.yaml +++ b/tests/drivers/adc/adc_accuracy_test/testcase.yaml @@ -22,6 +22,7 @@ tests: - frdm_mcxc444 - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_common.dtsi new file mode 100644 index 000000000000..bb3597397b96 --- /dev/null +++ b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -0,0 +1,11 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 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 index 18e74f72ee26..efc3d8f64b45 100644 --- a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,11 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Nordic Semiconductor ASA */ -/ { - aliases { - adc = &adc; - }; -}; +#include "nrf54h20dk_nrf54h20_common.dtsi" diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..bcd359c3aa23 --- /dev/null +++ b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,11 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +#include "nrf54h20dk_nrf54h20_common.dtsi" + +&adc { + status = "okay"; +}; diff --git a/tests/drivers/adc/adc_error_cases/testcase.yaml b/tests/drivers/adc/adc_error_cases/testcase.yaml index 57513c78e156..739efb735632 100644 --- a/tests/drivers/adc/adc_error_cases/testcase.yaml +++ b/tests/drivers/adc/adc_error_cases/testcase.yaml @@ -11,6 +11,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - ophelia4ev/nrf54l15/cpuapp - xg24_rb4187c - xg27_dk2602a From 2ff960e88efceef4339d89105dead18e3cc57e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Tue, 7 Oct 2025 13:29:54 +0200 Subject: [PATCH 0106/3334] [nrf fromlist] drivers: nrf: Add missing SoC header includes to adc and i2s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing SoC header include required by memory region assertion to adc_nrfx_saadc and i2s_nrf_tdm shims. Upstream PR #: 97104 Signed-off-by: Michał Bainczyk (cherry picked from commit 2c39832fa1d1a876367a1cc3976252b2452a599e) --- drivers/adc/adc_nrfx_saadc.c | 1 + drivers/i2s/i2s_nrf_tdm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 06035e2c3c5d..b92b5ccfe6b3 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -13,6 +13,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(adc_nrfx_saadc, CONFIG_ADC_LOG_LEVEL); diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index 45e5b3d18049..fc823ce5055a 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -16,6 +16,7 @@ #include #include #include +#include #include LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); From 1a22fa1433d5035aae439c89b0f9935bc1a6b436 Mon Sep 17 00:00:00 2001 From: Bartlomiej Buczek Date: Tue, 7 Oct 2025 14:19:48 +0200 Subject: [PATCH 0107/3334] [nrf fromlist] samples: drivers: adc: Enable samples for nrf54h20 PPR. Fill in necessary config files with platforms data. Upstream PR #: 97110 Signed-off-by: Bartlomiej Buczek (cherry picked from commit f75ebf1d5b2a8ce3e3e1bfc02b16c492fe7b1417) --- samples/drivers/adc/adc_dt/sample.yaml | 1 + .../boards/nrf54h20dk_nrf54h20_common.dtsi | 50 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 45 +---------------- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 11 ++++ samples/drivers/adc/adc_sequence/sample.yaml | 2 + .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 11 ++++ .../sysbuild/vpr_launcher/prj.conf | 1 + 7 files changed, 77 insertions(+), 44 deletions(-) create mode 100644 samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_common.dtsi create mode 100644 samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuppr.overlay create mode 100644 samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay create mode 100644 samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/prj.conf diff --git a/samples/drivers/adc/adc_dt/sample.yaml b/samples/drivers/adc/adc_dt/sample.yaml index b6eaa02cf14a..d6842d47f988 100644 --- a/samples/drivers/adc/adc_dt/sample.yaml +++ b/samples/drivers/adc/adc_dt/sample.yaml @@ -16,6 +16,7 @@ tests: - nrf51dk/nrf51822 - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_common.dtsi b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_common.dtsi new file mode 100644 index 000000000000..291faa0440de --- /dev/null +++ b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -0,0 +1,50 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +/ { + aliases { + adc0 = &adc; + }; +}; + +&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 = ; /* P1.01 */ + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.02 */ + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P9.01 */ + zephyr,vref-mv = <3686>; /* 3.6V * 1024 */ + }; + + channel@7 { + reg = <7>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.03 */ + zephyr,input-negative = ; /* P1.07 */ + }; +}; diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index d4f9e8db7c2b..658b19b0ae5d 100644 --- a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,47 +4,4 @@ * Copyright (c) 2024 Nordic Semiconductor ASA */ -/ { - aliases { - adc0 = &adc; - }; -}; - -&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 = ; /* P1.01 */ - }; - - channel@1 { - reg = <1>; - zephyr,gain = "ADC_GAIN_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.02 */ - }; - - channel@2 { - reg = <2>; - zephyr,gain = "ADC_GAIN_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P9.01 */ - zephyr,vref-mv = <3686>; /* 3.6V * 1024 */ - }; - - channel@7 { - reg = <7>; - zephyr,gain = "ADC_GAIN_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.03 */ - zephyr,input-negative = ; /* P1.07 */ - }; -}; +#include "nrf54h20dk_nrf54h20_common.dtsi" diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..bcd359c3aa23 --- /dev/null +++ b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,11 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +#include "nrf54h20dk_nrf54h20_common.dtsi" + +&adc { + status = "okay"; +}; diff --git a/samples/drivers/adc/adc_sequence/sample.yaml b/samples/drivers/adc/adc_sequence/sample.yaml index d176e2593d4b..6927bcdf88d9 100644 --- a/samples/drivers/adc/adc_sequence/sample.yaml +++ b/samples/drivers/adc/adc_sequence/sample.yaml @@ -19,6 +19,7 @@ tests: - cy8cproto_062_4343w - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -32,6 +33,7 @@ tests: sample.drivers.adc.adc_sequence.8bit: platform_allow: - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: diff --git a/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..2570d64e2eb3 --- /dev/null +++ b/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include "../../../boards/nrf54h20dk_nrf54h20_common.dtsi" + +&adc { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; diff --git a/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/prj.conf b/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/prj.conf new file mode 100644 index 000000000000..b2a4ba591044 --- /dev/null +++ b/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/prj.conf @@ -0,0 +1 @@ +# nothing here From 5ee906f48bb0363a3dfe4c122f40db1690df6ef2 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Thu, 2 Oct 2025 16:43:27 +0200 Subject: [PATCH 0108/3334] [nrf fromtree] arch/arm: introduce the pre-stack/RAM init hook Introduce hook for customize reset.S code even before stack is initialized or RAM is accessed. Hook can be enabled using CONFIG_SOC_EARLY_RESET_HOOK=y. Hook implementation is by soc_early_reset_hook() function which should be provided by custom code. Signed-off-by: Andrzej Puzdrowski (cherry picked from commit 418eed0f90781a0d6d70f4e79c0006ce3955823f) --- arch/arm/core/cortex_m/reset.S | 8 ++++++++ include/zephyr/platform/hooks.h | 13 +++++++++++++ kernel/Kconfig.init | 22 ++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/arch/arm/core/cortex_m/reset.S b/arch/arm/core/cortex_m/reset.S index b09391aaf0b5..85002c275f7c 100644 --- a/arch/arm/core/cortex_m/reset.S +++ b/arch/arm/core/cortex_m/reset.S @@ -35,6 +35,10 @@ GTEXT(z_arm_init_arch_hw_at_boot) #if defined(CONFIG_PM_S2RAM) GTEXT(arch_pm_s2ram_resume) #endif +#if defined(CONFIG_SOC_EARLY_RESET_HOOK) +GTEXT(soc_early_reset_hook) +#endif + /* * PACBTI Mask for CONTROL register: @@ -100,6 +104,10 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start) #endif /* CONFIG_INIT_ARCH_HW_AT_BOOT */ +#if defined(CONFIG_SOC_EARLY_RESET_HOOK) + /* Call custom code that executes before any stack is set up or RAM memory is accessed */ + bl soc_early_reset_hook +#endif #if defined(CONFIG_PM_S2RAM) /* * Temporarily set MSP to interrupt stack so that arch_pm_s2ram_resume can diff --git a/include/zephyr/platform/hooks.h b/include/zephyr/platform/hooks.h index 9989f640d65e..12defd10ab84 100644 --- a/include/zephyr/platform/hooks.h +++ b/include/zephyr/platform/hooks.h @@ -19,6 +19,19 @@ * directly from application code but may be freely used within the OS. */ +#ifdef CONFIG_SOC_EARLY_RESET_HOOK +/** + * @brief SoC hook executed before data RAM initialization, at the beginning + * of the reset vector. + * + * This hook is implemented by the SoC and can be used to perform any + * SoC-specific initialization. Refer to :kconfig:option:`SOC_EARLY_RESET_HOOK` + * and relevant architecture zephyr-rtos startup implementation for more details. + */ +void soc_early_reset_hook(void); +#else +#define soc_early_reset_hook() do { } while (0) +#endif /** * @brief SoC hook executed at the beginning of the reset vector. diff --git a/kernel/Kconfig.init b/kernel/Kconfig.init index 495381638fb0..c752fa5a0e43 100644 --- a/kernel/Kconfig.init +++ b/kernel/Kconfig.init @@ -6,6 +6,28 @@ menu "SoC and Board Hooks" +config SOC_EARLY_RESET_HOOK + bool "Run SoC-specific early reset hook" + help + Run a SoC-specific hook early in the reset/startup code (__start). + A custom hook soc_early_reset_hook() will be executed at the beginning + of the architecture-specific startup code, after hardware has been + configured (as required by CONFIG_INIT_ARCH_HW_AT_BOOT) but before + architecture's own resume logic. + + Returning from this hook is not mandatory: it can be used to implement + special logic to resume execution in some scenarios (for example, when + a bootloader is used). + + The stack pointer register should be considered as not initialized upon + call to this hook. In particular, this means that the hook is NOT allowed + to "push" any data using this stack pointer value. However, the hook may + use an implementation-specific area as stack if desired; in such case, + the original value of the stack pointer needs not to be "restored" before + returning control to the hook's caller. + + Additional constraints may be imposed on the hook by the architecture. + config SOC_RESET_HOOK bool "Run early SoC reset hook" help From c3f522872fe9e8b21c446f839ab5454cd3a9ae4b Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Wed, 17 Sep 2025 12:30:33 +0200 Subject: [PATCH 0109/3334] [nrf fromtree] tests: drivers: flash: common: require external_flash fixture Add "external_flash" fixture to the no_explicit_erase testcase in order to run twister only on boards with such HW setup. Other runnable test cases has it already. Signed-off-by: Piotr Kosycarz (cherry picked from commit 23188321bce592dcbb6be5a513510ddc36d470d6) --- tests/drivers/flash/common/testcase.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 6f59f3799c5a..d441d3c8f7bf 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -60,7 +60,8 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - ophelia4ev/nrf54l15/cpuapp + harness_config: + fixture: external_flash drivers.flash.common.nrf54lm20a: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp From a028ccb9b587a8d18dc8dfe5e4790e36200ae07d Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Mon, 6 Oct 2025 10:13:04 +0200 Subject: [PATCH 0110/3334] [nrf fromtree] tests: drivers: flash: Fix fixture assignment for the supply-gpios test Supply-gpios feature test [nrf54h20] requires gpio_loopback fixture. Signed-off-by: Bartosz Miller (cherry picked from commit 424459d5d7cbba0f6c5e7160bd73be034ab18539) --- tests/drivers/flash/common/testcase.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index d441d3c8f7bf..c2a4da0a705c 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -59,9 +59,13 @@ tests: - nrf54l15dk/nrf54l05/cpuapp - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54h20dk/nrf54h20/cpuapp harness_config: fixture: external_flash + drivers.flash.common.no_explicit_erase.nrf54h: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + harness_config: + fixture: gpio_loopback drivers.flash.common.nrf54lm20a: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp @@ -193,3 +197,5 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_low_freq.overlay + harness_config: + fixture: gpio_loopback From d9475479482372e4451e3b98f92b0f6d6be76f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Thu, 25 Sep 2025 08:32:14 +0200 Subject: [PATCH 0111/3334] [nrf fromlist] drivers: timer: nrf_grtc_timer: use a function for cc enable check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of checking register values directly, use a function from nrfx that does this. Upstream PR #: 96538 Signed-off-by: Michał Bainczyk (cherry picked from commit 60524d97884a137634038931c024b873800e08fc) --- drivers/timer/nrf_grtc_timer.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 75278e104bd2..b0593e3bd135 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -335,18 +335,13 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan) int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) { - /* TODO: The implementation should probably go to nrfx_grtc and this - * should be just a wrapper for some nrfx_grtc_syscounter_capture_read. - */ - uint64_t capt_time; nrfx_err_t result; IS_CHANNEL_ALLOWED_ASSERT(chan); - /* TODO: Use `nrfy_grtc_sys_counter_enable_check` when available (NRFX-2480) */ - if (NRF_GRTC->CC[chan].CCEN == GRTC_CC_CCEN_ACTIVE_Enable) { - /* If the channel is enabled (.CCEN), it means that there was no capture + if (nrfx_grtc_sys_counter_cc_enable_check(chan)) { + /* If the channel is enabled, it means that there was no capture * triggering event. */ return -EBUSY; From 43994db7bbe789b6400ac813d918b72254edbc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Thu, 4 Sep 2025 14:17:51 +0200 Subject: [PATCH 0112/3334] [nrf fromlist] drivers: flashdisk: fix value returned from disk_flash_access_write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the value returned from disk_flash_access_write to return the return code instead of a hardcoded zero. Upstream PR #: 95468 Signed-off-by: Michał Bainczyk (cherry picked from commit 67d649dbbb8f49dfcdbea40ea438e713afbda531) --- drivers/disk/flashdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index 1ac3d15ba62f..37606f541390 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -424,7 +424,7 @@ static int disk_flash_access_write(struct disk_info *disk, const uint8_t *buff, end: k_mutex_unlock(&ctx->lock); - return 0; + return rc; } static int disk_flash_access_ioctl(struct disk_info *disk, uint8_t cmd, void *buff) From 2f7818c3a3662ff5b9d99d9a2e4c3fd5b64a885d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Fri, 19 Sep 2025 11:44:19 +0200 Subject: [PATCH 0113/3334] [nrf fromtree] soc: nordic: uicr: Add support for SECURESTORAGE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add UICR.SECURESTORAGE configuration based on device tree partitions. Validates partition layout and populates size fields in 1KB units. Handles missing partitions gracefully. Signed-off-by: Sebastian Bøe (cherry picked from commit 38a0f713a683dc6fa9d9444511d7bde243c3ee05) --- scripts/ci/check_compliance.py | 1 + soc/nordic/common/uicr/gen_uicr.py | 198 +++++++++++++++++- .../common/uicr/gen_uicr/CMakeLists.txt | 46 ++++ soc/nordic/common/uicr/gen_uicr/Kconfig | 22 ++ 4 files changed, 266 insertions(+), 1 deletion(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 9ea01ed3b610..92b0640450ee 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1270,6 +1270,7 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_SECURESTORAGE", # Used in specialized build tool, not part of main Kconfig "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "IAR_BUFFERED_WRITE", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index ce69cd7e80a3..b4594d2e2722 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -8,7 +8,8 @@ import argparse import ctypes as c import sys -from itertools import groupby +from itertools import groupby, pairwise +from typing import NamedTuple from elftools.elf.elffile import ELFFile from intelhex import IntelHex @@ -29,6 +30,14 @@ class ScriptError(RuntimeError): ... +class PartitionInfo(NamedTuple): + """Information about a partition for secure storage validation.""" + + address: int + size: int + name: str + + class PeriphconfEntry(c.LittleEndianStructure): _pack_ = 1 _fields_ = [ @@ -198,6 +207,105 @@ class Uicr(c.LittleEndianStructure): ] +def validate_secure_storage_partitions(args: argparse.Namespace) -> None: + """ + Validate that secure storage partitions are laid out correctly. + + Args: + args: Parsed command line arguments containing partition information + + Raises: + ScriptError: If validation fails + """ + # Expected order: cpuapp_crypto_partition, cpurad_crypto_partition, + # cpuapp_its_partition, cpurad_its_partition + partitions = [ + PartitionInfo( + args.cpuapp_crypto_address, args.cpuapp_crypto_size, "cpuapp_crypto_partition" + ), + PartitionInfo( + args.cpurad_crypto_address, args.cpurad_crypto_size, "cpurad_crypto_partition" + ), + PartitionInfo(args.cpuapp_its_address, args.cpuapp_its_size, "cpuapp_its_partition"), + PartitionInfo(args.cpurad_its_address, args.cpurad_its_size, "cpurad_its_partition"), + ] + + # Filter out zero-sized partitions (missing partitions) + present_partitions = [p for p in partitions if p.size > 0] + + # Require at least one subpartition to be present + if not present_partitions: + raise ScriptError( + "At least one secure storage subpartition must be defined. " + "Define one or more of: cpuapp_crypto_partition, cpurad_crypto_partition, " + "cpuapp_its_partition, cpurad_its_partition" + ) + + # Check 4KB alignment for secure storage start address + if args.securestorage_address % 4096 != 0: + raise ScriptError( + f"Secure storage address {args.securestorage_address:#x} must be aligned to 4KB " + f"(4096 bytes)" + ) + + # Check 4KB alignment for secure storage size + if args.securestorage_size % 4096 != 0: + raise ScriptError( + f"Secure storage size {args.securestorage_size} bytes must be aligned to 4KB " + f"(4096 bytes)" + ) + + # Check that the first present partition starts at the secure storage address + first_partition = present_partitions[0] + if first_partition.address != args.securestorage_address: + raise ScriptError( + f"First partition {first_partition.name} starts at {first_partition.address:#x}, " + f"but must start at secure storage address {args.securestorage_address:#x}" + ) + + # Check that all present partitions have sizes that are multiples of 1KB + for partition in present_partitions: + if partition.size % 1024 != 0: + raise ScriptError( + f"Partition {partition.name} has size {partition.size} bytes, but must be " + f"a multiple of 1024 bytes (1KB)" + ) + + # Check that partitions are in correct order and don't overlap + for curr_partition, next_partition in pairwise(present_partitions): + # Check order - partitions should be in ascending address order + if curr_partition.address >= next_partition.address: + raise ScriptError( + f"Partition {curr_partition.name} (starts at {curr_partition.address:#x}) " + f"must come before {next_partition.name} (starts at {next_partition.address:#x})" + ) + + # Check for overlap + curr_end = curr_partition.address + curr_partition.size + if curr_end > next_partition.address: + raise ScriptError( + f"Partition {curr_partition.name} (ends at {curr_end:#x}) overlaps with " + f"{next_partition.name} (starts at {next_partition.address:#x})" + ) + + # Check for gaps (should be no gaps between consecutive partitions) + if curr_end < next_partition.address: + gap = next_partition.address - curr_end + raise ScriptError( + f"Gap of {gap} bytes between {curr_partition.name} (ends at {curr_end:#x}) and " + f"{next_partition.name} (starts at {next_partition.address:#x})" + ) + + # Check that combined subpartition sizes equal secure_storage_partition size + total_subpartition_size = sum(p.size for p in present_partitions) + if total_subpartition_size != args.securestorage_size: + raise ScriptError( + f"Combined size of subpartitions ({total_subpartition_size} bytes) does not match " + f"secure_storage_partition size ({args.securestorage_size} bytes). " + f"The definition is not coherent." + ) + + def main() -> None: parser = argparse.ArgumentParser( allow_abbrev=False, @@ -255,6 +363,71 @@ def main() -> None: type=lambda s: int(s, 0), help="Absolute flash address of the UICR region (decimal or 0x-prefixed hex)", ) + parser.add_argument( + "--securestorage", + action="store_true", + help="Enable secure storage support in UICR", + ) + parser.add_argument( + "--securestorage-address", + default=None, + type=lambda s: int(s, 0), + help="Absolute flash address of the secure storage partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--securestorage-size", + default=None, + type=lambda s: int(s, 0), + help="Size in bytes of the secure storage partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpuapp-crypto-address", + default=0, + type=lambda s: int(s, 0), + help="Absolute flash address of cpuapp_crypto_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpuapp-crypto-size", + default=0, + type=lambda s: int(s, 0), + help="Size in bytes of cpuapp_crypto_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpurad-crypto-address", + default=0, + type=lambda s: int(s, 0), + help="Absolute flash address of cpurad_crypto_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpurad-crypto-size", + default=0, + type=lambda s: int(s, 0), + help="Size in bytes of cpurad_crypto_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpuapp-its-address", + default=0, + type=lambda s: int(s, 0), + help="Absolute flash address of cpuapp_its_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpuapp-its-size", + default=0, + type=lambda s: int(s, 0), + help="Size in bytes of cpuapp_its_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpurad-its-address", + default=0, + type=lambda s: int(s, 0), + help="Absolute flash address of cpurad_its_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpurad-its-size", + default=0, + type=lambda s: int(s, 0), + help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", + ) parser.add_argument( "--secondary", action="store_true", @@ -327,12 +500,35 @@ def main() -> None: "--out-secondary-periphconf-hex is used" ) + # Validate secure storage argument dependencies + if args.securestorage: + if args.securestorage_address is None: + raise ScriptError( + "--securestorage-address is required when --securestorage is used" + ) + if args.securestorage_size is None: + raise ScriptError("--securestorage-size is required when --securestorage is used") + + # Validate partition layout + validate_secure_storage_partitions(args) + init_values = DISABLED_VALUE.to_bytes(4, "little") * (c.sizeof(Uicr) // 4) uicr = Uicr.from_buffer_copy(init_values) uicr.VERSION.MAJOR = UICR_FORMAT_VERSION_MAJOR uicr.VERSION.MINOR = UICR_FORMAT_VERSION_MINOR + # Handle secure storage configuration + if args.securestorage: + uicr.SECURESTORAGE.ENABLE = ENABLED_VALUE + uicr.SECURESTORAGE.ADDRESS = args.securestorage_address + + # Set partition sizes in 1KB units + uicr.SECURESTORAGE.CRYPTO.APPLICATIONSIZE1KB = args.cpuapp_crypto_size // 1024 + uicr.SECURESTORAGE.CRYPTO.RADIOCORESIZE1KB = args.cpurad_crypto_size // 1024 + uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 + uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 + # Process periphconf data first and configure UICR completely before creating hex objects periphconf_hex = IntelHex() secondary_periphconf_hex = IntelHex() diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 1163ff8e21f9..28c6e6749094 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -44,6 +44,25 @@ function(compute_partition_address_and_size partition_nodelabel output_address_v set(${output_size_var} ${partition_size} PARENT_SCOPE) endfunction() +# Function to compute optional partition address and size from devicetree +# If partition doesn't exist, sets both address and size to 0 +function(compute_optional_partition_address_and_size partition_nodelabel output_address_var output_size_var) + # Initialize with default values + set(${output_address_var} 0 PARENT_SCOPE) + set(${output_size_var} 0 PARENT_SCOPE) + + # Check if partition exists + dt_nodelabel(partition_path NODELABEL ${partition_nodelabel} QUIET) + if(partition_path) + # Call nested function with different variable names to avoid naming conflicts + compute_partition_address_and_size(${partition_nodelabel} temp_addr temp_size) + + # Copy the results to the output variables in parent scope + set(${output_address_var} ${temp_addr} PARENT_SCOPE) + set(${output_size_var} ${temp_size} PARENT_SCOPE) + endif() +endfunction() + # Use CMAKE_VERBOSE_MAKEFILE to silence an unused-variable warning. if(CMAKE_VERBOSE_MAKEFILE) endif() @@ -60,6 +79,32 @@ set(secondary_periphconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/secondary_per dt_nodelabel(uicr_path NODELABEL "uicr" REQUIRED) dt_reg_addr(UICR_ADDRESS PATH ${uicr_path} REQUIRED) +# Handle secure storage configuration +set(securestorage_args) +if(CONFIG_GEN_UICR_SECURESTORAGE) + list(APPEND securestorage_args --securestorage) + + # Extract secure storage partition information (required) + compute_partition_address_and_size("secure_storage_partition" SECURE_STORAGE_ADDRESS SECURE_STORAGE_SIZE) + list(APPEND securestorage_args --securestorage-address ${SECURE_STORAGE_ADDRESS}) + list(APPEND securestorage_args --securestorage-size ${SECURE_STORAGE_SIZE}) + + # Extract individual partition information for validation (optional partitions) + compute_optional_partition_address_and_size("cpuapp_crypto_partition" CPUAPP_CRYPTO_ADDRESS CPUAPP_CRYPTO_SIZE) + compute_optional_partition_address_and_size("cpurad_crypto_partition" CPURAD_CRYPTO_ADDRESS CPURAD_CRYPTO_SIZE) + compute_optional_partition_address_and_size("cpuapp_its_partition" CPUAPP_ITS_ADDRESS CPUAPP_ITS_SIZE) + compute_optional_partition_address_and_size("cpurad_its_partition" CPURAD_ITS_ADDRESS CPURAD_ITS_SIZE) + + list(APPEND securestorage_args --cpuapp-crypto-address ${CPUAPP_CRYPTO_ADDRESS}) + list(APPEND securestorage_args --cpuapp-crypto-size ${CPUAPP_CRYPTO_SIZE}) + list(APPEND securestorage_args --cpurad-crypto-address ${CPURAD_CRYPTO_ADDRESS}) + list(APPEND securestorage_args --cpurad-crypto-size ${CPURAD_CRYPTO_SIZE}) + list(APPEND securestorage_args --cpuapp-its-address ${CPUAPP_ITS_ADDRESS}) + list(APPEND securestorage_args --cpuapp-its-size ${CPUAPP_ITS_SIZE}) + list(APPEND securestorage_args --cpurad-its-address ${CPURAD_ITS_ADDRESS}) + list(APPEND securestorage_args --cpurad-its-size ${CPURAD_ITS_SIZE}) +endif(CONFIG_GEN_UICR_SECURESTORAGE) + if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) # gen_uicr.py parses all zephyr.elf files. To find these files (which # have not been built yet) we scan sibling build directories for @@ -134,6 +179,7 @@ add_custom_command( --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} ${periphconf_args} + ${securestorage_args} ${secondary_args} DEPENDS ${periphconf_elfs} ${secondary_periphconf_elfs} WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 41d31db64647..17758597bc34 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -21,6 +21,28 @@ config GEN_UICR_SECONDARY_GENERATE_PERIPHCONF When enabled, the UICR generator will populate the secondary_periphconf_partition partition. +config GEN_UICR_SECURESTORAGE + bool "Enable UICR.SECURESTORAGE" + default y + depends on $(dt_nodelabel_enabled,secure_storage_partition) + help + When enabled, the UICR generator will configure the + secure storage region based on device tree partitions. + + The following device tree partitions are used: + - secure_storage_partition: Main secure storage partition (required) + - cpuapp_crypto_partition: Application processor crypto storage (optional) + - cpurad_crypto_partition: Radio core crypto storage (optional) + - cpuapp_its_partition: Application processor internal trusted storage (optional) + - cpurad_its_partition: Radio core internal trusted storage (optional) + + Requirements: + - The secure_storage_partition address and size must be aligned to 4KB + - All subpartitions must be multiples of 1KB and laid out contiguously + without gaps + - At least one subpartition must be defined + - Combined subpartition sizes must equal secure_storage_partition size + endmenu source "Kconfig.zephyr" From ff6ac9f133f76605b1a894e4c1129dd42afcfd7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Tue, 9 Sep 2025 13:27:39 +0200 Subject: [PATCH 0114/3334] [nrf fromtree] soc: nordic: uicr: Add support for uicr.SECONDARY.PROCESSOR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for uicr.SECONDARY.PROCESSOR. Signed-off-by: Sebastian Bøe (cherry picked from commit 9f45d2ccd787655efb62fd2a8afac4dd026d0a01) --- scripts/ci/check_compliance.py | 1 + soc/nordic/common/uicr/gen_uicr.py | 7 +++ .../common/uicr/gen_uicr/CMakeLists.txt | 1 + soc/nordic/common/uicr/gen_uicr/Kconfig | 48 ++++++++++++++----- 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 92b0640450ee..79b0777ca488 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1270,6 +1270,7 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_SECONDARY_PROCESSOR_VALUE", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECURESTORAGE", # Used in specialized build tool, not part of main Kconfig "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index b4594d2e2722..e074314a1abb 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -439,6 +439,12 @@ def main() -> None: type=lambda s: int(s, 0), help="Absolute flash address of the secondary firmware (decimal or 0x-prefixed hex)", ) + parser.add_argument( + "--secondary-processor", + default=0xBD2328A8, + type=lambda s: int(s, 0), + help="Processor to boot for the secondary firmware ", + ) parser.add_argument( "--secondary-periphconf-address", default=None, @@ -562,6 +568,7 @@ def main() -> None: if args.secondary: uicr.SECONDARY.ENABLE = ENABLED_VALUE uicr.SECONDARY.ADDRESS = args.secondary_address + uicr.SECONDARY.PROCESSOR = args.secondary_processor # Handle secondary periphconf if provided if args.out_secondary_periphconf_hex: diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 28c6e6749094..fe1b0e378cf7 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -154,6 +154,7 @@ if(CONFIG_GEN_UICR_SECONDARY) list(APPEND secondary_args --secondary-address ${SECONDARY_ADDRESS} + --secondary-processor ${CONFIG_GEN_UICR_SECONDARY_PROCESSOR_VALUE} ) if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 17758597bc34..1c49209592fe 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -10,17 +10,6 @@ config GEN_UICR_GENERATE_PERIPHCONF When enabled, the UICR generator will populate the periphconf_partition partition. -config GEN_UICR_SECONDARY - bool "Enable UICR.SECONDARY.ENABLE" - -config GEN_UICR_SECONDARY_GENERATE_PERIPHCONF - bool "Generate SECONDARY.PERIPHCONF hex alongside UICR" - default y - depends on GEN_UICR_SECONDARY - help - When enabled, the UICR generator will populate the - secondary_periphconf_partition partition. - config GEN_UICR_SECURESTORAGE bool "Enable UICR.SECURESTORAGE" default y @@ -43,6 +32,43 @@ config GEN_UICR_SECURESTORAGE - At least one subpartition must be defined - Combined subpartition sizes must equal secure_storage_partition size +config GEN_UICR_SECONDARY + bool "Enable UICR.SECONDARY.ENABLE" + +if GEN_UICR_SECONDARY + +config GEN_UICR_SECONDARY_GENERATE_PERIPHCONF + bool "Generate SECONDARY.PERIPHCONF hex alongside UICR" + default y + help + When enabled, the UICR generator will populate the + secondary_periphconf_partition partition. + +choice GEN_UICR_SECONDARY_PROCESSOR + prompt "Secondary processor selection" + default GEN_UICR_SECONDARY_PROCESSOR_APPLICATION + help + Processor to boot for the secondary firmware. + +config GEN_UICR_SECONDARY_PROCESSOR_APPLICATION + bool "APPLICATION processor" + help + Boot secondary firmware on the APPLICATION processor. + +config GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE + bool "RADIOCORE processor" + help + Boot secondary firmware on the RADIOCORE processor. + +endchoice + +config GEN_UICR_SECONDARY_PROCESSOR_VALUE + hex + default 0xBD2328A8 if GEN_UICR_SECONDARY_PROCESSOR_APPLICATION + default 0x1730C77F if GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE + +endif # GEN_UICR_SECONDARY + endmenu source "Kconfig.zephyr" From ad38f6ff83359d9b32f603904b11d20cef237815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Tue, 9 Sep 2025 13:46:07 +0200 Subject: [PATCH 0115/3334] [nrf fromtree] soc: nordic: uicr: Add support for uicr.PROTECTEDMEM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for PROTECTEDMEM. Signed-off-by: Sebastian Bøe (cherry picked from commit 7c9275c8914ab105d8d96ea4096bef4c4ef7d10e) --- scripts/ci/check_compliance.py | 2 ++ soc/nordic/common/uicr/gen_uicr.py | 22 +++++++++++++++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 8 +++++++ soc/nordic/common/uicr/gen_uicr/Kconfig | 14 ++++++++++++ 4 files changed, 46 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 79b0777ca488..eea833ce0849 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1268,6 +1268,8 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_SETTING_1", "FOO_SETTING_2", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_PROTECTEDMEM", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY_PROCESSOR_VALUE", # Used in specialized build tool, not part of main Kconfig diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index e074314a1abb..bea0ba2a2dfa 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -26,6 +26,8 @@ ENABLED_VALUE = 0xFFFF_FFFF DISABLED_VALUE = 0xBD23_28A8 +KB_4 = 4096 + class ScriptError(RuntimeError): ... @@ -428,6 +430,16 @@ def main() -> None: type=lambda s: int(s, 0), help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", ) + parser.add_argument( + "--protectedmem", + action="store_true", + help="Enable protected memory region in UICR", + ) + parser.add_argument( + "--protectedmem-size-bytes", + type=int, + help="Protected memory size in bytes (must be divisible by 4096)", + ) parser.add_argument( "--secondary", action="store_true", @@ -535,6 +547,16 @@ def main() -> None: uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 + # Handle protected memory configuration + if args.protectedmem: + if args.protectedmem_size_bytes % KB_4 != 0: + raise ScriptError( + f"Protected memory size ({args.protectedmem_size_bytes} bytes) " + f"must be divisible by {KB_4}" + ) + uicr.PROTECTEDMEM.ENABLE = ENABLED_VALUE + uicr.PROTECTEDMEM.SIZE4KB = args.protectedmem_size_bytes // KB_4 + # Process periphconf data first and configure UICR completely before creating hex objects periphconf_hex = IntelHex() secondary_periphconf_hex = IntelHex() diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index fe1b0e378cf7..9e37639a82cb 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -67,6 +67,7 @@ endfunction() if(CMAKE_VERBOSE_MAKEFILE) endif() +set(protectedmem_args) set(periphconf_args) set(periphconf_elfs) set(merged_hex_file ${APPLICATION_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.hex) @@ -105,6 +106,12 @@ if(CONFIG_GEN_UICR_SECURESTORAGE) list(APPEND securestorage_args --cpurad-its-size ${CPURAD_ITS_SIZE}) endif(CONFIG_GEN_UICR_SECURESTORAGE) +# Handle protected memory configuration +if(CONFIG_GEN_UICR_PROTECTEDMEM) + list(APPEND protectedmem_args --protectedmem) + list(APPEND protectedmem_args --protectedmem-size-bytes ${CONFIG_GEN_UICR_PROTECTEDMEM_SIZE_BYTES}) +endif() + if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) # gen_uicr.py parses all zephyr.elf files. To find these files (which # have not been built yet) we scan sibling build directories for @@ -181,6 +188,7 @@ add_custom_command( --out-uicr-hex ${uicr_hex_file} ${periphconf_args} ${securestorage_args} + ${protectedmem_args} ${secondary_args} DEPENDS ${periphconf_elfs} ${secondary_periphconf_elfs} WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 1c49209592fe..fe7413a9d0da 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -32,6 +32,20 @@ config GEN_UICR_SECURESTORAGE - At least one subpartition must be defined - Combined subpartition sizes must equal secure_storage_partition size +config GEN_UICR_PROTECTEDMEM + bool "Enable UICR.PROTECTEDMEM" + help + When enabled, the UICR generator will configure the + protected memory region. + +config GEN_UICR_PROTECTEDMEM_SIZE_BYTES + int "Protected memory size in bytes" + default 4096 + depends on GEN_UICR_PROTECTEDMEM + help + Size of the protected memory region in bytes. + This value must be divisible by 4096 (4 kiB). + config GEN_UICR_SECONDARY bool "Enable UICR.SECONDARY.ENABLE" From 8f89a479ac970736e6192a122a1d0c060b7d7360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Fri, 10 Oct 2025 16:35:28 +0200 Subject: [PATCH 0116/3334] [nrf fromlist] soc: nordic: uicr: Change how secondary images are detected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detect secondary images by checking a Kconfig value instead of a marker file. Upstream PR #: 97356 Signed-off-by: Sebastian Bøe (cherry picked from commit c62a6c7f29ce32a986a6abea0300fdf5c960bf30) --- soc/nordic/common/uicr/Kconfig | 7 +++++++ soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index 73b5e5cf2d1c..37bdd014b7d6 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -18,3 +18,10 @@ config NRF_PERIPHCONF_GENERATE_ENTRIES help Generate a C file containing PERIPHCONF entries based on the device configuration in the devicetree. + +config IS_IRONSIDE_SE_SECONDARY_IMAGE + bool "Ironside SE secondary image indicator (informative only, do not change)" + help + This Kconfig is set by sysbuild to indicate that this image is a + secondary firmware for Ironside SE. This is used by the UICR generation + system to determine which PERIPHCONF partition to use. diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 9e37639a82cb..b64b7c0399ac 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -23,11 +23,19 @@ project(uicr) function(parse_kconfig_value config_file config_name output_var) file(STRINGS ${config_file} config_lines ENCODING "UTF-8") foreach(line ${config_lines}) + # Match quoted strings like CONFIG_FOO="value" if("${line}" MATCHES "^${config_name}=\"(.*)\"$") set(${output_var} "${CMAKE_MATCH_1}" PARENT_SCOPE) return() endif() + # Match unquoted values like CONFIG_FOO=y or CONFIG_FOO=n + if("${line}" MATCHES "^${config_name}=(.*)$") + set(${output_var} "${CMAKE_MATCH_1}" PARENT_SCOPE) + return() + endif() endforeach() + # If not found, return empty (including "# CONFIG_FOO is not set" case) + set(${output_var} "" PARENT_SCOPE) endfunction() # Function to compute partition absolute address and size from devicetree @@ -131,8 +139,9 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) parse_kconfig_value(${_dir}/zephyr/.config CONFIG_KERNEL_BIN_NAME kernel_bin_name) set(kernel_elf_path ${_dir}/zephyr/${kernel_bin_name}.elf) - # Check if this is secondary firmware by looking for the marker file - if(EXISTS ${_dir}/is_secondary_firmware.txt) + # Check if this is secondary firmware by reading the Kconfig from .config + parse_kconfig_value(${_dir}/zephyr/.config CONFIG_IS_IRONSIDE_SE_SECONDARY_IMAGE is_secondary) + if(is_secondary STREQUAL "y") list(APPEND secondary_periphconf_elfs ${kernel_elf_path}) else() list(APPEND periphconf_elfs ${kernel_elf_path}) From 2a5a7733a3ecc3d54495de80387c6f105c2a089c Mon Sep 17 00:00:00 2001 From: Piotr Krzyzanowski Date: Mon, 6 Oct 2025 17:28:04 +0200 Subject: [PATCH 0117/3334] [nrf fromlist] tests: drivers: gpio: add nrf54h20dk_nrf54h20_cpuppr Enable GPIO tests on nRF54H20 CPUPPR. Upstream PR #: 97073 Signed-off-by: Piotr Krzyzanowski (cherry picked from commit d2334ac6880c36154e99c1bcf35b00e5f8e17bca) --- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 23 +++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 23 +++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 34 +++++++++++++++++++ tests/drivers/gpio/gpio_hogs/testcase.yaml | 1 + .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 23 +++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 samples/basic/blinky/boards/nrf54h20dk_nrf54h20_cpuppr.overlay create mode 100644 tests/drivers/gpio/gpio_get_direction/boards/nrf54h20dk_nrf54h20_cpuppr.overlay create mode 100644 tests/drivers/gpio/gpio_hogs/boards/nrf54h20dk_nrf54h20_cpuppr.overlay create mode 100644 tests/drivers/gpio/gpio_nrf/boards/nrf54h20dk_nrf54h20_cpuppr.overlay diff --git a/samples/basic/blinky/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/basic/blinky/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..cbc7b679be00 --- /dev/null +++ b/samples/basic/blinky/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/ { + aliases { + led0 = &led0; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + }; +}; + +&gpiote130 { + status = "okay"; +}; + +&gpio9 { + status = "okay"; +}; diff --git a/tests/drivers/gpio/gpio_get_direction/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/gpio/gpio_get_direction/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..cbc7b679be00 --- /dev/null +++ b/tests/drivers/gpio/gpio_get_direction/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/ { + aliases { + led0 = &led0; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + }; +}; + +&gpiote130 { + status = "okay"; +}; + +&gpio9 { + status = "okay"; +}; diff --git a/tests/drivers/gpio/gpio_hogs/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/gpio/gpio_hogs/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..3d0a4ccf5a6d --- /dev/null +++ b/tests/drivers/gpio/gpio_hogs/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/ { + zephyr,user { + output-high-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + output-low-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + input-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + }; +}; + +&gpio0 { + status = "okay"; + hog1 { + gpio-hog; + gpios = <3 GPIO_ACTIVE_LOW>; + output-high; + }; + + hog2 { + gpio-hog; + gpios = <4 GPIO_ACTIVE_HIGH>; + output-low; + }; + + hog3 { + gpio-hog; + gpios = <1 GPIO_ACTIVE_LOW>; + input; + }; +}; + +&gpiote130 { + status = "okay"; +}; diff --git a/tests/drivers/gpio/gpio_hogs/testcase.yaml b/tests/drivers/gpio/gpio_hogs/testcase.yaml index 3de068163b85..43b01894f5fb 100644 --- a/tests/drivers/gpio/gpio_hogs/testcase.yaml +++ b/tests/drivers/gpio/gpio_hogs/testcase.yaml @@ -11,6 +11,7 @@ tests: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuppr - nucleo_g474re - nrf52_bsim - nrf5340bsim/nrf5340/cpuapp diff --git a/tests/drivers/gpio/gpio_nrf/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/gpio/gpio_nrf/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..cbc7b679be00 --- /dev/null +++ b/tests/drivers/gpio/gpio_nrf/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/ { + aliases { + led0 = &led0; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + }; +}; + +&gpiote130 { + status = "okay"; +}; + +&gpio9 { + status = "okay"; +}; From 4ede28ebfd4acce4060afd74fed4bc070c0fb5f2 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Mon, 6 Oct 2025 17:14:14 +0200 Subject: [PATCH 0118/3334] [nrf fromtree] boards/nordic/nrf54h20dk: Add button/LED aliases Added aliases so that nrf54h20dk/nrf54h20/cpuapp can use MCUboot serial recovery. Signed-off-by: Andrzej Puzdrowski (cherry picked from commit 230b74dd9875be15260923184457e2f2103ae668) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 06e208e248a2..2c67c3d4e8c1 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -42,6 +42,8 @@ sw3 = &button3; ipc-to-cpusys = &cpuapp_cpusys_ipc; watchdog0 = &wdt010; + mcuboot-button0 = &button0; + mcuboot-led0 = &led0; }; buttons { From d284430202c21a59569f6938b28293a5de8263d7 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Tue, 7 Oct 2025 15:59:58 +0200 Subject: [PATCH 0119/3334] [nrf fromtree] samples/boards/nordic: align nrf54h20dk overlay /delete-property/ for newly added aliases which points to nodes already removed in that overlay. Upstream PR #: 97062 Signed-off-by: Andrzej Puzdrowski (cherry picked from commit 56843f8eb0e702b8274d1d89a50c68a33232487e) --- .../spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index ae3c8b6c81fc..8023020f2caa 100644 --- a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,6 +12,8 @@ /delete-property/ sw1; /delete-property/ sw2; /delete-property/ sw3; + /delete-property/ mcuboot-led0; + /delete-property/ mcuboot-button0; }; /delete-node/ buttons; }; From 1cfda09be90d3510f2a91fb5cb09dcc2a81c3fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Amundsen?= Date: Fri, 3 Oct 2025 13:08:43 +0200 Subject: [PATCH 0120/3334] [nrf fromtree] soc: ironside: add min and max values for update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The update will fail if the address is outside of this range. This failure might trigger a bad state where the device is non-trivial to recover. Signed-off-by: Håkon Amundsen (cherry picked from commit 9d5f94f90b05451986f7c37243ae0579e991d734) --- .../nordic/nrf_ironside/update/src/main.c | 3 +++ .../ironside/include/nrf_ironside/update.h | 18 ++++++++++++++++++ soc/nordic/ironside/update.c | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c index 29d058ca139c..ee8823217de2 100644 --- a/samples/boards/nordic/nrf_ironside/update/src/main.c +++ b/samples/boards/nordic/nrf_ironside/update/src/main.c @@ -10,6 +10,9 @@ LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); +BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS >= IRONSIDE_UPDATE_MIN_ADDRESS); +BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS <= IRONSIDE_UPDATE_MAX_ADDRESS); + int main(void) { int err; diff --git a/soc/nordic/ironside/include/nrf_ironside/update.h b/soc/nordic/ironside/include/nrf_ironside/update.h index b01b5df6dadb..6e520e4e680b 100644 --- a/soc/nordic/ironside/include/nrf_ironside/update.h +++ b/soc/nordic/ironside/include/nrf_ironside/update.h @@ -18,11 +18,27 @@ #define IRONSIDE_UPDATE_ERROR_NOT_PERMITTED (1) /** Failed to write the update metadata to SICR. */ #define IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED (2) +/** Update candidate is placed outside of valid range */ +#define IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS (3) /** * @} */ +/** Size of the update blob */ +#ifdef CONFIG_SOC_SERIES_NRF54HX +#define IRONSIDE_UPDATE_BLOB_SIZE (160 * 1024) +#elif CONFIG_SOC_SERIES_NRF92X +#define IRONSIDE_UPDATE_BLOB_SIZE (160 * 1024) +#else +#error "Missing update blob size" +#endif + +/** Min address used for storing the update candidate */ +#define IRONSIDE_UPDATE_MIN_ADDRESS (0x0e100000) +/** Max address used for storing the update candidate */ +#define IRONSIDE_UPDATE_MAX_ADDRESS (0x0e200000 - IRONSIDE_UPDATE_BLOB_SIZE) + /** Length of the update manifest in bytes */ #define IRONSIDE_UPDATE_MANIFEST_LENGTH (256) /** Length of the update public key in bytes. */ @@ -62,6 +78,8 @@ struct ironside_update_blob { * @param update Pointer to update blob * * @retval 0 on a successful request (although the update itself may still fail). + * @retval -IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS if the address of the update is outside of the + * accepted range. * @retval -IRONSIDE_UPDATE_ERROR_NOT_PERMITTED if missing access to the update candidate. * @retval -IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED if writing update parameters to SICR failed. * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). diff --git a/soc/nordic/ironside/update.c b/soc/nordic/ironside/update.c index a56407a3fa14..fabf6fb01049 100644 --- a/soc/nordic/ironside/update.c +++ b/soc/nordic/ironside/update.c @@ -11,6 +11,11 @@ int ironside_update(const struct ironside_update_blob *update) int err; struct ironside_call_buf *const buf = ironside_call_alloc(); + if ((uintptr_t)update < IRONSIDE_UPDATE_MIN_ADDRESS || + (uintptr_t)update > IRONSIDE_UPDATE_MAX_ADDRESS) { + return -IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS; + } + buf->id = IRONSIDE_CALL_ID_UPDATE_SERVICE_V0; buf->args[IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX] = (uintptr_t)update; From 6379df47cc0f91693aa8bd08f503676c56ff05a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Wed, 10 Sep 2025 16:04:38 +0200 Subject: [PATCH 0121/3334] [nrf fromtree] boards: nrf54h20dk: Add secure storage partitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the default memory map to include a `secure_storage_partition`, which is divided into at most four subpartitions. These will be used to configure UICR.SECURESTORAGE, if enabled. Signed-off-by: Sebastian Bøe (cherry picked from commit d5003d996b266c988757a8a324551e297af5b776) --- .../nrf54h20dk_nrf54h20-memory_map.dtsi | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index e14426c59fc8..eafaf69b3989 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -174,5 +174,34 @@ secondary_periphconf_partition: partition@1c0000 { reg = <0x1c0000 DT_SIZE_K(8)>; }; + + /* NB: A gap has been left here for future partitions */ + + /* 0x1fd000 was chosen for secure_storage_partition such that + * there is no more space after secure_storage_partition. + */ + secure_storage_partition: partition@1fd000 { + compatible = "fixed-subpartitions"; + reg = <0x1fd000 DT_SIZE_K(12)>; + ranges = <0x0 0x1fd000 0x3000>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_crypto_partition: partition@0 { + reg = <0x0 DT_SIZE_K(4)>; + }; + + cpurad_crypto_partition: partition@1000 { + reg = <0x1000 DT_SIZE_K(4)>; + }; + + cpuapp_its_partition: partition@2000 { + reg = <0x2000 DT_SIZE_K(2)>; + }; + + cpurad_its_partition: partition@2800 { + reg = <0x2800 DT_SIZE_K(2)>; + }; + }; }; }; From 37ebe97ebc956d3e20a38bd055f3a4d1252342f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 15 Sep 2025 10:58:08 +0200 Subject: [PATCH 0122/3334] [nrf fromtree] drivers: pinctrl_nrf: Add support for SPIM CSN pin function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Certain SPIM instances in nRF52/53/54L/54H Series provide hardware control of the CSN (chip select) line. Although the standard SPI drivers do not use this feature, it should be possible to configure this line through pinctrl in case some special driver needs this. Signed-off-by: Andrzej Głąbek (cherry picked from commit ca79733388c87664f064e709b50d13afab907411) --- drivers/pinctrl/pinctrl_nrf.c | 14 +++++++++++--- include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 1dfb6cb7c720..429ed761e614 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -46,11 +46,11 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = { #define NRF_PSEL_UART(reg, line) ((NRF_UARTE_Type *)reg)->PSEL.line #endif -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spi) || defined(CONFIG_NRFX_SPI) -#define NRF_PSEL_SPIM(reg, line) ((NRF_SPI_Type *)reg)->PSEL##line -#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spim) || defined(CONFIG_NRFX_SPIM) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spim) || defined(CONFIG_NRFX_SPIM) #include #define NRF_PSEL_SPIM(reg, line) ((NRF_SPIM_Type *)reg)->PSEL.line +#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spi) || defined(CONFIG_NRFX_SPI) +#define NRF_PSEL_SPIM(reg, line) ((NRF_SPI_Type *)reg)->PSEL##line #endif #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spis) || defined(CONFIG_NRFX_SPIS) @@ -265,6 +265,14 @@ 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; break; +#if defined(NRF_SPIM_HAS_HW_CSN) && NRF_SPIM_HAS_HW_CSN + case NRF_FUN_SPIM_CSN: + NRF_PSEL_SPIM(reg, CSN) = psel; + write = 1U; + dir = NRF_GPIO_PIN_DIR_OUTPUT; + input = NRF_GPIO_PIN_INPUT_DISCONNECT; + break; +#endif #endif /* defined(NRF_PSEL_SPIM) */ #if defined(NRF_PSEL_SPIS) case NRF_FUN_SPIS_SCK: diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 9de74061e8da..42b302193ed0 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -186,6 +186,8 @@ #define NRF_FUN_TDM_SDOUT 76U /** TDM MCK */ #define NRF_FUN_TDM_MCK 77U +/** SPI master CSN */ +#define NRF_FUN_SPIM_CSN 78U /** @} */ From cbe4cea2253d19daefece123f6fa670cf47dd572 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Thu, 2 Oct 2025 08:22:52 +0200 Subject: [PATCH 0123/3334] [nrf fromtree] soc: nordic: uicr: fix SPIM CSN CTRLSEL values Fix an incorrect interpretation of the chip select signal for the SPIM instances. If cs-gpios is used then the chip select pin is used as a GPIO, and should have CTRLSEL=0. Only when NRF_FUN_SPIM_CSN is used should CTRLSEL be configured to enable hardware control of the pin. Signed-off-by: Jonathan Nilsen (cherry picked from commit b28b570959c1c578f9079c5b0f10603554701992) --- .../common/uicr/gen_periphconf_entries.py | 27 +++++++++---------- soc/nordic/common/uicr/periphconf/builder.py | 1 + 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index 92f5f1d24559..4308df31449f 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -25,7 +25,6 @@ from periphconf.builder import ( Ctrlsel, FixedPPIMap, - GpiosProp, Node, NrfCompChannel, NrfFun, @@ -178,7 +177,7 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=9, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=9, pin=3): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=4): Ctrlsel.SERIAL0, # SPIS mappings NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=5): Ctrlsel.SERIAL0, @@ -202,7 +201,7 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.CAN_TDM_SERIAL2, - GpiosProp(name="cs-gpios", port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + NrfPsel(fun=NrfFun.SPIM_CSN, port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, # SPIS mappings NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, @@ -284,17 +283,17 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM P6 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=8): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=6, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=1): Ctrlsel.SERIAL0, # SPIM P7 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=7, pin=7): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=7, pin=6): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=7, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=7, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=7, pin=3): Ctrlsel.SERIAL0, # SPIM P2 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=6): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=5): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=2, pin=7): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=2, pin=7): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=3): Ctrlsel.SERIAL0, # UARTÈ P6 mappings NrfPsel(fun=NrfFun.UART_TX, port=6, pin=8): Ctrlsel.SERIAL0, @@ -317,21 +316,21 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM P6 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=13): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=12): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=6, pin=10): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=10): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=2): Ctrlsel.SERIAL0, # SPIM P7 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=7, pin=1): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIS_MISO, port=7, pin=1): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIM_MISO, port=7, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIS_MOSI, port=7, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, - GpiosProp(name="cs-gpios", port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, + NrfPsel(fun=NrfFun.SPIM_CSN, port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIS_CSN, port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIM_SCK, port=7, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIS_SCK, port=7, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, # SPIM P2 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=11): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=10): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=2, pin=8): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=2, pin=8): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=2): Ctrlsel.SERIAL0, }, # EXMIF @@ -449,12 +448,12 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM120/UARTE120 0x5F8E_6000: { # SPIM P2 mappings - GpiosProp(name="cs-gpios", port=2, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=2, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=3): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=4): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=0): Ctrlsel.SERIAL0, # SPIM P6 mappings - GpiosProp(name="cs-gpios", port=6, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=8): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=1): Ctrlsel.SERIAL0, @@ -472,12 +471,12 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM121 0x5F8E_7000: { # P2 - GpiosProp(name="cs-gpios", port=2, pin=6): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=2, pin=6): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=8): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=9): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=1): Ctrlsel.SERIAL0, # P6 - GpiosProp(name="cs-gpios", port=6, pin=10): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=10): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=12): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=13): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=2): Ctrlsel.SERIAL0, @@ -492,7 +491,7 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM130/SPIS130/TWIM130/TWIS130/UARTE130 0x5F9A_5000: { # SPIM mappings - GpiosProp(name="cs-gpios", port=9, pin=1): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_CSN, port=9, pin=1): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=3): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=0): Ctrlsel.SERIAL0, diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py index 98c2bdfb0a0a..1a343dee44a0 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -1017,6 +1017,7 @@ class NrfFun(int, enum.Enum): TDM_SDIN = 75 TDM_SDOUT = 76 TDM_MCK = 77 + SPIM_CSN = 78 # Value used to ignore the function field and only check (port, pin) IGNORE = -1 From d69be6e9a9f2d404f86861a8b913d5a13e7f6be3 Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Fri, 3 Oct 2025 13:51:17 +0200 Subject: [PATCH 0124/3334] [nrf fromtree] drivers: debug: Moved nrf_etr from misc Moved the nrf_etr driver from the drive/misc folder into the recently established driver/debug folder where it is a better fit. Moved the associated files such as bindings and headers accordingly as well. Signed-off-by: Karsten Koenig (cherry picked from commit d833556ee55b921a675dd239c3cc2330d3605669) --- doc/services/logging/cs_stm.rst | 4 +- drivers/debug/CMakeLists.txt | 1 + drivers/debug/Kconfig | 1 + .../coresight/Kconfig => debug/Kconfig.nrf} | 40 +++++----- .../nrf_etr.c => debug/debug_nrf_etr.c} | 74 ++++++++++--------- drivers/misc/CMakeLists.txt | 1 - drivers/misc/Kconfig | 1 - drivers/misc/coresight/CMakeLists.txt | 4 - .../{misc => debug}/nordic,nrf-tbm.yaml | 0 .../nrf_etr.h => debug/debug_nrf_etr.h} | 8 +- .../{misc/coresight => debug}/stmesp.h | 6 +- include/zephyr/logging/log_frontend_stmesp.h | 2 +- .../nordic/coresight_stm/pytest/test_stm.py | 2 +- .../nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 2 +- subsys/logging/frontends/Kconfig | 4 +- .../logging/frontends/log_frontend_stmesp.c | 13 ++-- 16 files changed, 81 insertions(+), 82 deletions(-) rename drivers/{misc/coresight/Kconfig => debug/Kconfig.nrf} (79%) rename drivers/{misc/coresight/nrf_etr.c => debug/debug_nrf_etr.c} (92%) delete mode 100644 drivers/misc/coresight/CMakeLists.txt rename dts/bindings/{misc => debug}/nordic,nrf-tbm.yaml (100%) rename include/zephyr/drivers/{misc/coresight/nrf_etr.h => debug/debug_nrf_etr.h} (52%) rename include/zephyr/drivers/{misc/coresight => debug}/stmesp.h (96%) diff --git a/doc/services/logging/cs_stm.rst b/doc/services/logging/cs_stm.rst index 75a371dfd24e..77b097d65161 100644 --- a/doc/services/logging/cs_stm.rst +++ b/doc/services/logging/cs_stm.rst @@ -119,7 +119,7 @@ When using logs, this method has the following advantages: 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`. +:zephyr_file:`drivers/debug/debug_nrf_etr.c`. Configuration ------------- @@ -175,7 +175,7 @@ in :zephyr_file:`subsys/logging/frontends/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 +located in :zephyr_file:`drivers/debug/debug_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 diff --git a/drivers/debug/CMakeLists.txt b/drivers/debug/CMakeLists.txt index 54ca9f71694e..8314379f8fa8 100644 --- a/drivers/debug/CMakeLists.txt +++ b/drivers/debug/CMakeLists.txt @@ -5,4 +5,5 @@ zephyr_library() # zephyr-keep-sorted-start zephyr_library_sources_ifdef(CONFIG_DEBUG_SILABS_PTI debug_silabs_pti.c) +zephyr_library_sources_ifdef(CONFIG_DEBUG_NRF_ETR debug_nrf_etr.c) # zephyr-keep-sorted-stop diff --git a/drivers/debug/Kconfig b/drivers/debug/Kconfig index 68c23fdf1243..b38c5206f3cb 100644 --- a/drivers/debug/Kconfig +++ b/drivers/debug/Kconfig @@ -15,6 +15,7 @@ config DEBUG_DRIVER_INIT_PRIORITY Debug drivers initialization priority. # zephyr-keep-sorted-start +source "drivers/debug/Kconfig.nrf" source "drivers/debug/Kconfig.silabs" # zephyr-keep-sorted-stop diff --git a/drivers/misc/coresight/Kconfig b/drivers/debug/Kconfig.nrf similarity index 79% rename from drivers/misc/coresight/Kconfig rename to drivers/debug/Kconfig.nrf index 997d0c23c0a5..da2721947e13 100644 --- a/drivers/misc/coresight/Kconfig +++ b/drivers/debug/Kconfig.nrf @@ -3,7 +3,7 @@ DT_COMPAT_NORDIC_NRF_TBM := nordic,nrf-tbm -config NRF_ETR +config DEBUG_NRF_ETR bool "Coresight ETR handler (with Nordic TBM)" depends on $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_TBM)) select NRFX_TBM @@ -14,9 +14,9 @@ config NRF_ETR data). Busyness is tracked using TBM (Trace Buffer Monitor) peripheral which is specific to Nordic Semiconductor SoCs. -if NRF_ETR +if DEBUG_NRF_ETR -config NRF_ETR_DECODE +config DEBUG_NRF_ETR_DECODE bool "Decode ETR content" default y if LOG_FRONTEND_STMESP_FSC select MIPI_STP_DECODER @@ -29,14 +29,14 @@ config NRF_ETR_DECODE 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 +config DEBUG_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 +config DEBUG_NRF_ETR_DEBUG bool "Debug mode" depends on !LOG_PRINTK select MIPI_STP_DECODER @@ -44,18 +44,18 @@ config NRF_ETR_DEBUG help In debug mode STPv2 decoded data is printed. -config NRF_ETR_STACK_SIZE +config DEBUG_NRF_ETR_STACK_SIZE int "ETR thread stack size" - default 2048 if NRF_ETR_DECODE || NRF_ETR_DEBUG + default 2048 if DEBUG_NRF_ETR_DECODE || DEBUG_NRF_ETR_DEBUG default 1024 -config NRF_ETR_BACKOFF +config DEBUG_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 +config DEBUG_NRF_ETR_FLUSH_TIMEOUT int "Backoff time during flushing (ms)" default 100 help @@ -63,10 +63,10 @@ config NRF_ETR_FLUSH_TIMEOUT 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 +config DEBUG_NRF_ETR_SYNC_PERIOD int "Period of custom synchronization frame" - default 0 if NRF_ETR_DECODE - default 0 if NRF_ETR_DEBUG + default 0 if DEBUG_NRF_ETR_DECODE + default 0 if DEBUG_NRF_ETR_DEBUG default 16 help To help find the synchronization when decoding the ETR content @@ -74,25 +74,25 @@ config NRF_ETR_SYNC_PERIOD sent on regular intervals. This frame is sent between Coresight formatter frames. Use 0 to disable. -config NRF_ETR_SHELL +config DEBUG_NRF_ETR_SHELL bool "Use shell" select UART_ASYNC_API select UART_ASYNC_RX_HELPER select SHELL_LOG_BACKEND_CUSTOM - depends on NRF_ETR_DECODE + depends on DEBUG_NRF_ETR_DECODE default y if SHELL help Enable shell with Coresight STM logging support. -if NRF_ETR_SHELL +if DEBUG_NRF_ETR_SHELL -config NRF_ETR_SHELL_PROMPT +config DEBUG_NRF_ETR_SHELL_PROMPT string "Displayed prompt name" default "uart:~$ " help Displayed prompt name for UART shell with Coresight STM logging. -config NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE +config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE int "Size of the RX buffer" default 16 help @@ -101,13 +101,13 @@ config NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE slow and may need to be increased if long messages are pasted directly to the shell prompt. -config NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT +config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT int "Number of RX buffers" default 4 range 2 64 help Number of RX buffers. -endif # NRF_ETR_SHELL +endif # DEBUG_NRF_ETR_SHELL -endif # NRF_ETR +endif # DEBUG_NRF_ETR diff --git a/drivers/misc/coresight/nrf_etr.c b/drivers/debug/debug_nrf_etr.c similarity index 92% rename from drivers/misc/coresight/nrf_etr.c rename to drivers/debug/debug_nrf_etr.c index bf1aecd6f5b4..da425716dbbe 100644 --- a/drivers/misc/coresight/nrf_etr.c +++ b/drivers/debug/debug_nrf_etr.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -29,15 +29,15 @@ 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)) + COND_CODE_1(CONFIG_DEBUG_NRF_ETR_DECODE, \ + (CONFIG_DEBUG_NRF_ETR_DECODE_DROP_PERIOD), (0)) #define MIN_DATA (2 * CORESIGHT_TRACE_FRAME_SIZE32) /* 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__))) +#define DBG(...) IF_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG, (printk(__VA_ARGS__))) /** @brief Macro for dumping debug data. * @@ -86,10 +86,10 @@ static const struct device *uart_dev = DEVICE_DT_GET(UART_NODE); static uint32_t frame_buf0[CORESIGHT_TRACE_FRAME_SIZE32] DMM_MEMORY_SECTION(UART_NODE); static uint32_t frame_buf1[CORESIGHT_TRACE_FRAME_SIZE32] DMM_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) ? +static uint32_t *frame_buf = IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) ? frame_buf_decode : frame_buf0; -K_KERNEL_STACK_DEFINE(etr_stack, CONFIG_NRF_ETR_STACK_SIZE); +K_KERNEL_STACK_DEFINE(etr_stack, CONFIG_DEBUG_NRF_ETR_STACK_SIZE); static struct k_thread etr_thread; BUILD_ASSERT((DT_REG_SIZE(ETR_BUFFER_NODE) % CONFIG_DCACHE_LINE_SIZE) == 0); @@ -134,9 +134,10 @@ static const char *const hw_evts[] = { "GD0 HS down", /* 31 Global domain high speed 0 down */ }; -#ifdef CONFIG_NRF_ETR_SHELL +#ifdef CONFIG_DEBUG_NRF_ETR_SHELL #define RX_BUF_SIZE \ - (CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE * CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT) + (CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE * \ + CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT) static void etr_timer_handler(struct k_timer *timer); K_TIMER_DEFINE(etr_timer, etr_timer_handler, NULL); @@ -278,7 +279,7 @@ static void message_process(union log_frontend_stmesp_demux_packet packet) */ static void sync_loss(void) { - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { + if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { mipi_stp_decoder_sync_loss(); log_frontend_stmesp_demux_reset(); oosync_cnt++; @@ -292,7 +293,7 @@ static void sync_loss(void) */ static void on_resync(void) { - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { + if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { in_sync = true; } } @@ -365,7 +366,7 @@ static void decoder_cb(enum mipi_stp_decoder_ctrl_type type, decoder_cb_debug(type, data, ts, marked); - if (!IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { + if (!IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { return; } @@ -549,7 +550,7 @@ static void dump_frame(uint8_t *buf) static void process(void) { static const uint32_t *const etr_buf = (uint32_t *)(DT_REG_ADDR(ETR_BUFFER_NODE)); - static uint32_t sync_cnt; + static uint32_t sync_cnt = CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD; uint32_t pending; /* If function is called in panic mode then it may interrupt ongoing @@ -562,7 +563,7 @@ static void process(void) */ 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)) { + if (sync_cnt || (CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD == 0)) { sync_cnt--; sys_cache_data_invd_range((void *)&etr_buf[etr_rd_idx & wsize_mask], CORESIGHT_TRACE_FRAME_SIZE); @@ -572,11 +573,12 @@ static void process(void) rd_idx_inc(); __sync_synchronize(); } else { - sync_cnt = CONFIG_NRF_ETR_SYNC_PERIOD; + sync_cnt = CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD; memset(frame_buf, 0xff, CORESIGHT_TRACE_FRAME_SIZE); } - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { + if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || + IS_ENABLED(CONFIG_DEBUG_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 @@ -586,7 +588,7 @@ static void process(void) } process_frame((uint8_t *)frame_buf, pending); - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { + if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { process_messages(); } } else { @@ -612,7 +614,7 @@ static int decoder_init(void) } once = true; - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { + if (IS_ENABLED(CONFIG_DEBUG_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), @@ -635,12 +637,12 @@ static int decoder_init(void) return 0; } -void nrf_etr_flush(void) +void debug_nrf_etr_flush(void) { int cnt = 4; - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || - IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { + if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || + IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) { (void)decoder_init(); } @@ -658,13 +660,13 @@ void nrf_etr_flush(void) irq_unlock(k); } -#ifndef CONFIG_NRF_ETR_SHELL +#ifndef CONFIG_DEBUG_NRF_ETR_SHELL 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)) { + if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || + IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) { int err; err = decoder_init(); @@ -688,7 +690,7 @@ static void etr_thread_func(void *dummy1, void *dummy2, void *dummy3) } } - k_sleep(K_MSEC(CONFIG_NRF_ETR_BACKOFF)); + k_sleep(K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF)); } } #endif @@ -703,7 +705,7 @@ static void uart_event_handler(const struct device *dev, struct uart_event *evt, case UART_TX_DONE: k_sem_give(&uart_sem); break; -#ifdef CONFIG_NRF_ETR_SHELL +#ifdef CONFIG_DEBUG_NRF_ETR_SHELL case UART_RX_RDY: uart_async_rx_on_rdy(&async_rx, evt->data.rx.buf, evt->data.rx.len); shell_handler(SHELL_TRANSPORT_EVT_RX_RDY, shell_context); @@ -729,7 +731,7 @@ static void uart_event_handler(const struct device *dev, struct uart_event *evt, break; case UART_RX_DISABLED: break; -#endif /* CONFIG_NRF_ETR_SHELL */ +#endif /* CONFIG_DEBUG_NRF_ETR_SHELL */ default: __ASSERT_NO_MSG(0); } @@ -743,7 +745,7 @@ static void tbm_event_handler(nrf_tbm_event_t event) tbm_full = true; } -#ifdef CONFIG_NRF_ETR_SHELL +#ifdef CONFIG_DEBUG_NRF_ETR_SHELL k_poll_signal_raise(&etr_shell.ctx->signals[SHELL_SIGNAL_LOG_MSG], 0); #else k_wakeup(&etr_thread); @@ -767,14 +769,14 @@ int etr_process_init(void) nrfx_isr, nrfx_tbm_irq_handler, 0); irq_enable(DT_IRQN(DT_NODELABEL(tbm))); -#ifdef CONFIG_NRF_ETR_SHELL +#ifdef CONFIG_DEBUG_NRF_ETR_SHELL uint32_t level = CONFIG_LOG_MAX_LEVEL; static const struct shell_backend_config_flags cfg_flags = SHELL_DEFAULT_BACKEND_CONFIG_FLAGS; shell_init(&etr_shell, NULL, cfg_flags, true, level); - k_timer_start(&etr_timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT); - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { + k_timer_start(&etr_timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT); + if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) { err = decoder_init(); if (err < 0) { return err; @@ -791,14 +793,14 @@ int etr_process_init(void) SYS_INIT(etr_process_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); -#ifdef CONFIG_NRF_ETR_SHELL +#ifdef CONFIG_DEBUG_NRF_ETR_SHELL static void etr_timer_handler(struct k_timer *timer) { if (pending_data() >= MIN_DATA) { k_poll_signal_raise(&etr_shell.ctx->signals[SHELL_SIGNAL_LOG_MSG], 0); } else { - k_timer_start(timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT); + k_timer_start(timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT); } } @@ -807,7 +809,7 @@ bool z_shell_log_backend_process(const struct shell_log_backend *backend) ARG_UNUSED(backend); process(); - k_timer_start(&etr_timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT); + k_timer_start(&etr_timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT); return false; } @@ -901,7 +903,7 @@ static int etr_shell_init(const struct shell_transport *transport, const void *c static const struct uart_async_rx_config async_rx_config = { .buffer = rx_buf, .length = sizeof(rx_buf), - .buf_cnt = CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT, + .buf_cnt = CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT, }; shell_context = context; @@ -939,6 +941,6 @@ static struct shell_transport transport = { }; static uint8_t shell_out_buffer[CONFIG_SHELL_PRINTF_BUFF_SIZE]; -Z_SHELL_DEFINE(etr_shell, CONFIG_NRF_ETR_SHELL_PROMPT, &transport, shell_out_buffer, NULL, +Z_SHELL_DEFINE(etr_shell, CONFIG_DEBUG_NRF_ETR_SHELL_PROMPT, &transport, shell_out_buffer, NULL, SHELL_FLAG_OLF_CRLF); -#endif /* CONFIG_NRF_ETR_SHELL */ +#endif /* CONFIG_DEBUG_NRF_ETR_SHELL */ diff --git a/drivers/misc/CMakeLists.txt b/drivers/misc/CMakeLists.txt index 437bd124247a..8426090ab14e 100644 --- a/drivers/misc/CMakeLists.txt +++ b/drivers/misc/CMakeLists.txt @@ -15,5 +15,4 @@ add_subdirectory_ifdef(CONFIG_RENESAS_RX_EXTERNAL_INTERRUPT renesas_rx_external_ add_subdirectory_ifdef(CONFIG_NXP_RTXXX_DSP_CTRL nxp_rtxxx_dsp_ctrl) add_subdirectory_ifdef(CONFIG_STM32N6_AXISRAM stm32n6_axisram) -add_subdirectory(coresight) add_subdirectory(interconn) diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 6d4d5cfc16fe..0a3af14dc2c0 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -15,7 +15,6 @@ 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" source "drivers/misc/interconn/Kconfig" source "drivers/misc/renesas_ra_external_interrupt/Kconfig" source "drivers/misc/renesas_rx_external_interrupt/Kconfig" diff --git a/drivers/misc/coresight/CMakeLists.txt b/drivers/misc/coresight/CMakeLists.txt deleted file mode 100644 index 1ec34ca2f75a..000000000000 --- 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/dts/bindings/misc/nordic,nrf-tbm.yaml b/dts/bindings/debug/nordic,nrf-tbm.yaml similarity index 100% rename from dts/bindings/misc/nordic,nrf-tbm.yaml rename to dts/bindings/debug/nordic,nrf-tbm.yaml diff --git a/include/zephyr/drivers/misc/coresight/nrf_etr.h b/include/zephyr/drivers/debug/debug_nrf_etr.h similarity index 52% rename from include/zephyr/drivers/misc/coresight/nrf_etr.h rename to include/zephyr/drivers/debug/debug_nrf_etr.h index 062afa3b61aa..04805a7e2d1d 100644 --- a/include/zephyr/drivers/misc/coresight/nrf_etr.h +++ b/include/zephyr/drivers/debug/debug_nrf_etr.h @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_ -#define _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_ +#ifndef _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_ +#define _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_ #ifdef __cplusplus extern "C" { #endif /** @brief Flush data from the ETR buffer. */ -void nrf_etr_flush(void); +void debug_nrf_etr_flush(void); #ifdef __cplusplus } #endif -#endif /* _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_ */ +#endif /* _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_ */ diff --git a/include/zephyr/drivers/misc/coresight/stmesp.h b/include/zephyr/drivers/debug/stmesp.h similarity index 96% rename from include/zephyr/drivers/misc/coresight/stmesp.h rename to include/zephyr/drivers/debug/stmesp.h index ce0f64b52dde..d4b245857eb3 100644 --- a/include/zephyr/drivers/misc/coresight/stmesp.h +++ b/include/zephyr/drivers/debug/stmesp.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ -#define ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ +#ifndef ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_ +#define ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_ #include @@ -190,4 +190,4 @@ static inline int stmesp_get_port(uint32_t idx, STMESP_Type **port) * @} */ -#endif /* ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ */ +#endif /* ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_ */ diff --git a/include/zephyr/logging/log_frontend_stmesp.h b/include/zephyr/logging/log_frontend_stmesp.h index 38f33bf62f10..c30972319fa7 100644 --- a/include/zephyr/logging/log_frontend_stmesp.h +++ b/include/zephyr/logging/log_frontend_stmesp.h @@ -9,7 +9,7 @@ #include #include #ifdef CONFIG_LOG_FRONTEND_STMESP -#include +#include #endif #ifdef __cplusplus diff --git a/samples/boards/nordic/coresight_stm/pytest/test_stm.py b/samples/boards/nordic/coresight_stm/pytest/test_stm.py index 4af24fbfa3c9..6db0b5685759 100644 --- a/samples/boards/nordic/coresight_stm/pytest/test_stm.py +++ b/samples/boards/nordic/coresight_stm/pytest/test_stm.py @@ -20,7 +20,7 @@ SB_CONFIG_APP_CPUFLPR_RUN = None # See definition of stm_m_id[] and stm_m_name[] in -# https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/misc/coresight/nrf_etr.c +# https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/debug/debug_nrf_etr.c STM_M_ID = { "sec": 33, "app": 34, diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index 674b5433c147..86149e5bd0e0 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -9,7 +9,7 @@ config NUM_IRQS default 471 config SHELL_BACKEND_SERIAL - default n if NRF_ETR_SHELL + default n if DEBUG_NRF_ETR_SHELL config POWER_DOMAIN default y diff --git a/subsys/logging/frontends/Kconfig b/subsys/logging/frontends/Kconfig index 6e5602763574..8bad85c69814 100644 --- a/subsys/logging/frontends/Kconfig +++ b/subsys/logging/frontends/Kconfig @@ -46,7 +46,7 @@ config LOG_FRONTEND_STMESP_DICT config LOG_FRONTEND_STMESP_FSC bool "Send fully self-contained messages" - select LOG_MSG_APPEND_RO_STRING_LOC if !(NRF_ETR || \ + select LOG_MSG_APPEND_RO_STRING_LOC if !(DEBUG_NRF_ETR || \ SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) config LOG_FRONTEND_STMESP_FLUSH_COUNT @@ -70,7 +70,7 @@ config LOG_FRONTEND_STMESP_DICT_VER config LOG_FRONTEND_STMESP_TURBO_LOG bool "Optimize short_logs" select LOG_CUSTOM_HEADER - default y if (NRF_ETR || SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) \ + default y if (DEBUG_NRF_ETR || SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) \ && LOG_FRONTEND_STMESP_FSC help When enabled, then logging messages with 0 and 1 numeric argument are diff --git a/subsys/logging/frontends/log_frontend_stmesp.c b/subsys/logging/frontends/log_frontend_stmesp.c index 0ede3cb48906..7cdd16ffdd34 100644 --- a/subsys/logging/frontends/log_frontend_stmesp.c +++ b/subsys/logging/frontends/log_frontend_stmesp.c @@ -11,8 +11,8 @@ #include #include #include -#ifdef CONFIG_NRF_ETR -#include +#ifdef CONFIG_DEBUG_NRF_ETR +#include #endif /* Only 32 bit platforms supported. */ @@ -574,15 +574,16 @@ void log_frontend_simple_2(const void *source, uint32_t level, const char *fmt, void log_frontend_panic(void) { in_panic = true; -#ifdef CONFIG_NRF_ETR - nrf_etr_flush(); +#ifdef CONFIG_DEBUG_NRF_ETR + debug_nrf_etr_flush(); #endif } void log_frontend_init(void) { -#if defined(CONFIG_LOG_FRONTEND_STPESP_TURBO_SOURCE_PORT_ID) && !defined(CONFIG_NRF_ETR) && \ - !defined(CONFIG_LOG_MSG_APPEND_RO_STRING_LOC) +#if defined(CONFIG_LOG_FRONTEND_STPESP_TURBO_SOURCE_PORT_ID) \ + && !defined(CONFIG_DEBUG_NRF_ETR) \ + && !defined(CONFIG_LOG_MSG_APPEND_RO_STRING_LOC) /* Send location of section with constant source data. It is used by the * application core to retrieve source names of log messages coming from * coprocessors (FLPR and PPR). From 23b342295481943c2a5dfacbef512124a09e6d58 Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Wed, 27 Aug 2025 21:38:40 +0200 Subject: [PATCH 0125/3334] [nrf fromtree] drivers: pinctrl_nrf: Add coresight tpiu pins Pinctrl needs to set the needed drive and direction of the pins. Also this later allows automatically setting the clock bit for the traceclk pin. Signed-off-by: Karsten Koenig (cherry picked from commit 85363f9e53e566e32fc10030f05fa28aa5d1bee4) --- .../nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi | 11 +++++++++++ drivers/pinctrl/pinctrl_nrf.c | 11 +++++++++++ include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 12 +++++++++++- soc/nordic/common/uicr/gen_periphconf_entries.py | 8 ++++++++ soc/nordic/common/uicr/periphconf/builder.py | 8 ++++++++ 5 files changed, 49 insertions(+), 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi index f62df87dfe26..0e2ab313df9b 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi @@ -138,4 +138,15 @@ low-power-enable; }; }; + + /omit-if-no-ref/ tpiu_default: tpiu_default { + group1 { + psels = , + , + , + , + ; + nordic,drive-mode = ; + }; + }; }; diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 429ed761e614..ac9b17d27b39 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -557,6 +557,17 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* defined(NRF_PSEL_TWIS) */ +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_coresight_nrf) + /* Pin routing is controlled by secure domain, via UICR */ + case NRF_FUN_TPIU_CLOCK: + case NRF_FUN_TPIU_DATA0: + case NRF_FUN_TPIU_DATA1: + case NRF_FUN_TPIU_DATA2: + case NRF_FUN_TPIU_DATA3: + dir = NRF_GPIO_PIN_DIR_OUTPUT; + input = NRF_GPIO_PIN_INPUT_DISCONNECT; + break; +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_coresight_nrf) */ default: return -ENOTSUP; } diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 42b302193ed0..92e62a9a6bed 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -187,7 +187,17 @@ /** TDM MCK */ #define NRF_FUN_TDM_MCK 77U /** SPI master CSN */ -#define NRF_FUN_SPIM_CSN 78U +#define NRF_FUN_SPIM_CSN 78U +/** TPIU CLOCK */ +#define NRF_FUN_TPIU_CLOCK 79U +/** TPIU DATA0 */ +#define NRF_FUN_TPIU_DATA0 80U +/** TPIU DATA1 */ +#define NRF_FUN_TPIU_DATA1 81U +/** TPIU DATA2 */ +#define NRF_FUN_TPIU_DATA2 82U +/** TPIU DATA3 */ +#define NRF_FUN_TPIU_DATA3 83U /** @} */ diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index 4308df31449f..d3b79e43f149 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -425,6 +425,14 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: NrfPsel(fun=NrfFun.IGNORE, port=2, pin=10): Ctrlsel.CAN, NrfPsel(fun=NrfFun.IGNORE, port=2, pin=11): Ctrlsel.CAN, }, + # Coresight (TPIU) + 0xBF04_0000: { + NrfPsel(fun=NrfFun.TPIU_CLOCK, port=7, pin=3): Ctrlsel.TND, + NrfPsel(fun=NrfFun.TPIU_DATA0, port=7, pin=4): Ctrlsel.TND, + NrfPsel(fun=NrfFun.TPIU_DATA1, port=7, pin=5): Ctrlsel.TND, + NrfPsel(fun=NrfFun.TPIU_DATA2, port=7, pin=6): Ctrlsel.TND, + NrfPsel(fun=NrfFun.TPIU_DATA3, port=7, pin=7): Ctrlsel.TND, + }, } elif soc == Soc.NRF9280: ctrlsel_lookup = { diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py index 1a343dee44a0..b8387fd9a756 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -41,6 +41,9 @@ "nordic,nrf-temp", "nordic,nrf-vevif-task-tx", "nordic,nrf-vevif-task-rx", + # No retention in TDD so permissions can't be set outside of the TDD service + "nordic,coresight-nrf", + "nordic,nrf-tbm", } # Compatibles of global peripherals that should be assigned to the current core but do not have DMA @@ -1018,6 +1021,11 @@ class NrfFun(int, enum.Enum): TDM_SDOUT = 76 TDM_MCK = 77 SPIM_CSN = 78 + TPIU_CLOCK = 79 + TPIU_DATA0 = 80 + TPIU_DATA1 = 81 + TPIU_DATA2 = 82 + TPIU_DATA3 = 83 # Value used to ignore the function field and only check (port, pin) IGNORE = -1 From 6a9ecd8c5198e308248748e1b657c480b3a00130 Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Wed, 27 Aug 2025 21:41:39 +0200 Subject: [PATCH 0126/3334] [nrf fromtree] drivers: debub: coresight: Added coresight_nrf Added driver and bindings for the coresight nrf submodule. add integrated it for the nrf54h20. The coresight subsystem is a combination of ARM Coresight peripherals that get configured together to achieve a simplified configuration based on a desired operating mode. This also replaces the previous handling in the nrf54h20 soc.c which was powering the subsystem up but not configuring it. Signed-off-by: Karsten Koenig (cherry picked from commit 6066a427486d847260a43ca0424cf9bc8ad5daec) --- drivers/debug/CMakeLists.txt | 3 +- drivers/debug/Kconfig.nrf | 65 ++++ drivers/debug/coresight_arm.h | 208 +++++++++++++ drivers/debug/debug_coresight_nrf.c | 281 ++++++++++++++++++ drivers/debug/debug_nrf_etr.c | 13 +- dts/bindings/arm/nordic,nrf-tddconf.yaml | 44 --- dts/bindings/debug/nordic,coresight-nrf.yaml | 22 ++ dts/vendor/nordic/nrf54h20.dtsi | 79 ++++- .../zephyr/dt-bindings/misc/nordic-tddconf.h | 15 - .../common/uicr/gen_periphconf_entries.py | 4 + soc/nordic/nrf54h/Kconfig | 11 - soc/nordic/nrf54h/soc.c | 18 -- 12 files changed, 669 insertions(+), 94 deletions(-) create mode 100644 drivers/debug/coresight_arm.h create mode 100644 drivers/debug/debug_coresight_nrf.c delete mode 100644 dts/bindings/arm/nordic,nrf-tddconf.yaml create mode 100644 dts/bindings/debug/nordic,coresight-nrf.yaml delete mode 100644 include/zephyr/dt-bindings/misc/nordic-tddconf.h diff --git a/drivers/debug/CMakeLists.txt b/drivers/debug/CMakeLists.txt index 8314379f8fa8..29763be07ec1 100644 --- a/drivers/debug/CMakeLists.txt +++ b/drivers/debug/CMakeLists.txt @@ -4,6 +4,7 @@ zephyr_library() # zephyr-keep-sorted-start -zephyr_library_sources_ifdef(CONFIG_DEBUG_SILABS_PTI debug_silabs_pti.c) +zephyr_library_sources_ifdef(CONFIG_DEBUG_CORESIGHT_NRF debug_coresight_nrf.c) zephyr_library_sources_ifdef(CONFIG_DEBUG_NRF_ETR debug_nrf_etr.c) +zephyr_library_sources_ifdef(CONFIG_DEBUG_SILABS_PTI debug_silabs_pti.c) # zephyr-keep-sorted-stop diff --git a/drivers/debug/Kconfig.nrf b/drivers/debug/Kconfig.nrf index da2721947e13..030e9885a06d 100644 --- a/drivers/debug/Kconfig.nrf +++ b/drivers/debug/Kconfig.nrf @@ -111,3 +111,68 @@ config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT endif # DEBUG_NRF_ETR_SHELL endif # DEBUG_NRF_ETR + +menuconfig DEBUG_CORESIGHT_NRF + bool "Coresight Trace support" + default y + depends on DT_HAS_NORDIC_CORESIGHT_NRF_ENABLED + select PINCTRL + select NRF_IRONSIDE_TDD_SERVICE + help + Support CoreSight peripherals in Test and Debug Domain for ARM + CoreSight System Trace Macrocell (STM) trace support. + +if DEBUG_CORESIGHT_NRF + +config DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL + def_hex 0x40 + help + Global trace ID used by STM. + +config DEBUG_CORESIGHT_NRF_STM_SYNC_BYTE_COUNT + int "STM: Emit synhronization packet every N bytes" + range 0 4095 + default 512 + +config DEBUG_CORESIGHT_NRF_STM_HWEVENTS + bool "STM: Enable hardware events" + help + Enable the output of hardware events in STM. + +config DEBUG_CORESIGHT_NRF_TPIU_FFCR_TRIG + bool "TPIU: Use flush request trigger" + default y + help + Use CTI channel 1 for triggering flush request in TPIU. + +config DEBUG_CORESIGHT_NRF_TPIU_SYNC_FRAME_COUNT + int "TPIU: Emit synchronisation packet every N frames" + default 8 + +config DEBUG_CORESIGHT_NRF_TPIU_PORTSIZE + int "TPIU: Size of the current TPIU port in bits" + range 1 32 + default 4 + +config DEBUG_CORESIGHT_NRF_ATBFUNNEL_HOLD_TIME + int "ATBFUNNEL: Hold time for the transaction" + range 1 15 + default 4 + help + Number of transactions that are output on the funnel master port from the + same slave. + +config DEBUG_CORESIGHT_NRF_TSGEN_CLK_DIV + int + default 8 + help + Clock division factor for generating trace timestamps. The timestamp + counter should not be slower than 10% of the fastest processor clock + frequency in the system, therefore its clock speed is divided by + eight. + +module = DEBUG_CORESIGHT_NRF +module-str = CoreSight Trace +source "subsys/logging/Kconfig.template.log_config" + +endif # DEBUG_CORESIGHT_NRF diff --git a/drivers/debug/coresight_arm.h b/drivers/debug/coresight_arm.h new file mode 100644 index 000000000000..b0c5da3e92d0 --- /dev/null +++ b/drivers/debug/coresight_arm.h @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef CORESIGHT_ARM_H_ +#define CORESIGHT_ARM_H_ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file + * @brief Generic ARM CoreSight Hardware Abstraction Layer + * + * This HAL provides generic register definitions and utility functions for ARM CoreSight + * peripherals. Platform-specific drivers should provide base addresses and use these + * generic definitions for register access. + */ + +/* Common CoreSight unlock key as defined by ARM architecture */ +#define CORESIGHT_UNLOCK_KEY (0xC5ACCE55UL) + +/* CoreSight register offsets */ + +/* Common CoreSight peripheral register offsets (found at the end of all CoreSight peripherals) */ +#define CORESIGHT_CLAIMSET_OFFSET (0xFA0UL) /* Claim Tag Set Register */ +#define CORESIGHT_CLAIMCLR_OFFSET (0xFA4UL) /* Claim Tag Clear Register */ +#define CORESIGHT_LAR_OFFSET (0xFB0UL) /* Lock Access Register */ +#define CORESIGHT_LSR_OFFSET (0xFB4UL) /* Lock Status Register */ + +/* ATB Funnel register offsets */ +#define ATBFUNNEL_CTRLREG_OFFSET (0x000UL) /* Control Register */ + +/* ATB Replicator register offsets */ +#define ATBREPLICATOR_IDFILTER0_OFFSET (0x000UL) /* ID Filter Register 0 */ +#define ATBREPLICATOR_IDFILTER1_OFFSET (0x004UL) /* ID Filter Register 1 */ + +/* ETR (Embedded Trace Router/TMC-ETR) register offsets */ +#define ETR_RSZ_OFFSET (0x004UL) /* RAM Size Register */ +#define ETR_RWP_OFFSET (0x018UL) /* RAM Write Pointer Register */ +#define ETR_CTL_OFFSET (0x020UL) /* Control Register */ +#define ETR_MODE_OFFSET (0x028UL) /* Mode Register */ +#define ETR_DBALO_OFFSET (0x118UL) /* Data Buffer Address Low Register */ +#define ETR_DBAHI_OFFSET (0x11CUL) /* Data Buffer Address High Register */ +#define ETR_FFCR_OFFSET (0x304UL) /* Formatter and Flush Control Register */ + +/* STM (System Trace Macrocell) register offsets */ +#define STM_STMHEER_OFFSET (0xD00UL) /* Hardware Event Enable Register */ +#define STM_STMHEMCR_OFFSET (0xD64UL) /* Hardware Event Master Control Register */ +#define STM_STMSPER_OFFSET (0xE00UL) /* Stimulus Port Enable Register */ +#define STM_STMTCSR_OFFSET (0xE80UL) /* Trace Control and Status Register */ +#define STM_STMTSFREQR_OFFSET (0xE8CUL) /* Timestamp Frequency Register */ +#define STM_STMSYNCR_OFFSET (0xE90UL) /* Synchronization Control Register */ +#define STM_STMAUXCR_OFFSET (0xE94UL) /* Auxiliary Control Register */ + +/* TPIU (Trace Port Interface Unit) register offsets */ +#define TPIU_CSPSR_OFFSET (0x004UL) /* Current Parallel Port Size Register */ +#define TPIU_FFCR_OFFSET (0x304UL) /* Formatter and Flush Control Register */ +#define TPIU_FSCR_OFFSET (0x308UL) /* Formatter Synchronization Counter Register */ + +/* CTI (Cross Trigger Interface) register offsets */ +#define CTI_CTICONTROL_OFFSET (0x000UL) /* CTI Control Register */ +#define CTI_CTIOUTEN0_OFFSET (0x0A0UL) /* CTI Trigger Output Enable Register 0 */ +#define CTI_CTIGATE_OFFSET (0x140UL) /* CTI Channel Gate Enable Register */ + +/* TSGEN (Timestamp Generator) register offsets */ +#define TSGEN_CNTCR_OFFSET (0x000UL) /* Counter Control Register */ +#define TSGEN_CNTFID0_OFFSET (0x020UL) /* Counter Frequency ID Register 0 */ + +/* Lock Status Register (LSR) bit fields */ +#define CORESIGHT_LSR_LOCKED_Pos (1UL) +#define CORESIGHT_LSR_LOCKED_Msk (0x1UL << CORESIGHT_LSR_LOCKED_Pos) +#define CORESIGHT_LSR_PRESENT_Pos (0UL) +#define CORESIGHT_LSR_PRESENT_Msk (0x1UL << CORESIGHT_LSR_PRESENT_Pos) + +/* STM Trace Control and Status Register (STMTCSR) bit fields */ +#define STM_STMTCSR_EN_Pos (0UL) +#define STM_STMTCSR_EN_Msk (0x1UL << STM_STMTCSR_EN_Pos) +#define STM_STMTCSR_TSEN_Pos (1UL) +#define STM_STMTCSR_TSEN_Msk (0x1UL << STM_STMTCSR_TSEN_Pos) +#define STM_STMTCSR_TRACEID_Pos (16UL) +#define STM_STMTCSR_TRACEID_Msk (0x7FUL << STM_STMTCSR_TRACEID_Pos) + +/* STM Hardware Event Master Control Register (STMHEMCR) bit fields */ +#define STM_STMHEMCR_EN_Pos (0UL) +#define STM_STMHEMCR_EN_Msk (0x1UL << STM_STMHEMCR_EN_Pos) + +/* STM Auxiliary Control Register (STMAUXCR) bit fields */ +#define STM_STMAUXCR_FIFOAF_Pos (0UL) +#define STM_STMAUXCR_FIFOAF_Msk (0x1UL << STM_STMAUXCR_FIFOAF_Pos) + +/* CTI Control Register (CTICONTROL) bit fields */ +#define CTI_CTICONTROL_GLBEN_Pos (0UL) +#define CTI_CTICONTROL_GLBEN_Msk (0x1UL << CTI_CTICONTROL_GLBEN_Pos) + +/* TPIU Formatter and Flush Control Register (FFCR) bit fields */ +#define TPIU_FFCR_ENFCONT_Pos (1UL) +#define TPIU_FFCR_ENFCONT_Msk (0x1UL << TPIU_FFCR_ENFCONT_Pos) +#define TPIU_FFCR_FONFLIN_Pos (4UL) +#define TPIU_FFCR_FONFLIN_Msk (0x1UL << TPIU_FFCR_FONFLIN_Pos) +#define TPIU_FFCR_ENFTC_Pos (0UL) +#define TPIU_FFCR_ENFTC_Msk (0x1UL << TPIU_FFCR_ENFTC_Pos) + +/* ETR Mode Register bit fields */ +#define ETR_MODE_MODE_Pos (0UL) +#define ETR_MODE_MODE_Msk (0x3UL << ETR_MODE_MODE_Pos) +#define ETR_MODE_MODE_CIRCULARBUF (0UL) /* Circular Buffer mode */ +#define ETR_MODE_MODE_SWFIFO1 (1UL) /* Software FIFO mode */ +#define ETR_MODE_MODE_HWFIFO (2UL) /* Hardware FIFO mode */ +#define ETR_MODE_MODE_SWFIFO2 (3UL) /* Software FIFO mode */ + +/* ETR Control Register bit fields */ +#define ETR_CTL_TRACECAPTEN_Pos (0UL) +#define ETR_CTL_TRACECAPTEN_Msk (0x1UL << ETR_CTL_TRACECAPTEN_Pos) + +/* ETR Formatter and Flush Control Register (FFCR) bit fields */ +#define ETR_FFCR_ENFT_Pos (0UL) +#define ETR_FFCR_ENFT_Msk (0x1UL << ETR_FFCR_ENFT_Pos) +#define ETR_FFCR_ENTI_Pos (1UL) +#define ETR_FFCR_ENTI_Msk (0x1UL << ETR_FFCR_ENTI_Pos) + +/* ATB Funnel Control Register bit fields */ +#define ATBFUNNEL_CTRLREG_ENS0_Pos (0UL) +#define ATBFUNNEL_CTRLREG_ENS0_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS0_Pos) +#define ATBFUNNEL_CTRLREG_ENS1_Pos (1UL) +#define ATBFUNNEL_CTRLREG_ENS1_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS1_Pos) +#define ATBFUNNEL_CTRLREG_ENS2_Pos (2UL) +#define ATBFUNNEL_CTRLREG_ENS2_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS2_Pos) +#define ATBFUNNEL_CTRLREG_ENS3_Pos (3UL) +#define ATBFUNNEL_CTRLREG_ENS3_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS3_Pos) +#define ATBFUNNEL_CTRLREG_ENS4_Pos (4UL) +#define ATBFUNNEL_CTRLREG_ENS4_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS4_Pos) +#define ATBFUNNEL_CTRLREG_ENS5_Pos (5UL) +#define ATBFUNNEL_CTRLREG_ENS5_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS5_Pos) +#define ATBFUNNEL_CTRLREG_ENS6_Pos (6UL) +#define ATBFUNNEL_CTRLREG_ENS6_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS6_Pos) +#define ATBFUNNEL_CTRLREG_ENS7_Pos (7UL) +#define ATBFUNNEL_CTRLREG_ENS7_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS7_Pos) +#define ATBFUNNEL_CTRLREG_HT_Pos (8UL) +#define ATBFUNNEL_CTRLREG_HT_Msk (0xFUL << ATBFUNNEL_CTRLREG_HT_Pos) + +/* TSGEN Counter Control Register bit fields */ +#define TSGEN_CNTCR_EN_Pos (0UL) +#define TSGEN_CNTCR_EN_Msk (0x1UL << TSGEN_CNTCR_EN_Pos) + +/** + * @brief Check if a CoreSight peripheral is locked + * + * @param base_addr Base address of CoreSight peripheral + * @return true if peripheral is locked, false otherwise + */ +static inline bool coresight_is_locked(mem_addr_t base_addr) +{ + uint32_t lsr = *(volatile uint32_t *)(base_addr + CORESIGHT_LSR_OFFSET); + + return (lsr & CORESIGHT_LSR_LOCKED_Msk) != 0; +} + +/** + * @brief Unlock a CoreSight peripheral + * + * @param base_addr Base address of CoreSight peripheral + * @retval 0 on success + * @retval -EIO if unlock operation failed + */ +static inline int coresight_unlock(mem_addr_t base_addr) +{ + *(volatile uint32_t *)(base_addr + CORESIGHT_LAR_OFFSET) = CORESIGHT_UNLOCK_KEY; + + if (coresight_is_locked(base_addr)) { + return -EIO; + } + + return 0; +} + +/** + * @brief Lock a CoreSight peripheral + * + * @param base_addr Base address of CoreSight peripheral + * @retval 0 on success + * @retval -EIO if lock operation failed + */ +static inline int coresight_lock(mem_addr_t base_addr) +{ + /* Write any value other than unlock key to Lock Access Register to lock */ + *(volatile uint32_t *)(base_addr + CORESIGHT_LAR_OFFSET) = 0x00000000; + + if (!coresight_is_locked(base_addr)) { + return -EIO; + } + + return 0; +} + +#ifdef __cplusplus +} +#endif + +#endif /* CORESIGHT_ARM_H_ */ diff --git a/drivers/debug/debug_coresight_nrf.c b/drivers/debug/debug_coresight_nrf.c new file mode 100644 index 000000000000..7bc9bab68ee0 --- /dev/null +++ b/drivers/debug/debug_coresight_nrf.c @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include +#include + +#undef ETR_MODE_MODE_CIRCULARBUF + +#include "coresight_arm.h" + +#define DT_DRV_COMPAT nordic_coresight_nrf + +#include +LOG_MODULE_REGISTER(cs_trace, CONFIG_DEBUG_CORESIGHT_NRF_LOG_LEVEL); + +#define CTI_CH_TPIU_FLUSH_REQ_OFFSET (1) + +#define TS_CLOCKRATE \ + (DT_PROP(DT_NODELABEL(hsfll200), clock_frequency) / \ + CONFIG_DEBUG_CORESIGHT_NRF_TSGEN_CLK_DIV) + +#define ATBREPLICATOR_IDFILTER_FORWARD_STM \ + BIT(CONFIG_DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL >> 4) +#define ATBFUNNEL211_STM_ENS_MASK BIT(2) + +enum coresight_nrf_mode { + CORESIGHT_NRF_MODE_UNCONFIGURED, + CORESIGHT_NRF_MODE_STM_TPIU, + CORESIGHT_NRF_MODE_STM_ETR, +}; + +struct coresight_nrf_config { + enum coresight_nrf_mode mode; + const struct pinctrl_dev_config *pcfg; +}; + +static void nrf_tsgen_init(void) +{ + mem_addr_t tsgen = DT_REG_ADDR(DT_NODELABEL(tsgen)); + + coresight_unlock(tsgen); + + sys_write32(TS_CLOCKRATE, tsgen + TSGEN_CNTFID0_OFFSET); + sys_write32(TSGEN_CNTCR_EN_Msk, tsgen + TSGEN_CNTCR_OFFSET); + + coresight_lock(tsgen); + + LOG_INF("CoreSight Host TSGEN initialized with clockrate %u", TS_CLOCKRATE); +} + +static void nrf_cti_for_tpiu_init(void) +{ + mem_addr_t cti210 = DT_REG_ADDR(DT_NODELABEL(cti210)); + + coresight_unlock(cti210); + + /* Connect CTI channel to TPIU formatter flushin */ + sys_write32(BIT(CTI_CH_TPIU_FLUSH_REQ_OFFSET), cti210 + CTI_CTIOUTEN0_OFFSET); + sys_write32(BIT(CTI_CH_TPIU_FLUSH_REQ_OFFSET), cti210 + CTI_CTIGATE_OFFSET); + sys_write32(CTI_CTICONTROL_GLBEN_Msk, cti210 + CTI_CTICONTROL_OFFSET); + + coresight_lock(cti210); + + LOG_INF("CoreSight Host CTI initialized"); +} + +static void nrf_tpiu_init(void) +{ + mem_addr_t tpiu = DT_REG_ADDR(DT_NODELABEL(tpiu)); + + coresight_unlock(tpiu); + + sys_write32(BIT((CONFIG_DEBUG_CORESIGHT_NRF_TPIU_PORTSIZE - 1)), tpiu + TPIU_CSPSR_OFFSET); + + /* Continuous formatting */ + if (IS_ENABLED(CONFIG_DEBUG_CORESIGHT_NRF_TPIU_FFCR_TRIG)) { + sys_write32((TPIU_FFCR_ENFCONT_Msk | TPIU_FFCR_FONFLIN_Msk | TPIU_FFCR_ENFTC_Msk), + tpiu + TPIU_FFCR_OFFSET); + } else { + sys_write32((TPIU_FFCR_ENFCONT_Msk | TPIU_FFCR_ENFTC_Msk), tpiu + TPIU_FFCR_OFFSET); + } + + sys_write32(CONFIG_DEBUG_CORESIGHT_NRF_TPIU_SYNC_FRAME_COUNT, tpiu + TPIU_FSCR_OFFSET); + + coresight_lock(tpiu); + + LOG_INF("CoreSight Host TPIU initialized"); +} + +static void nrf_etr_init(uintptr_t buf, size_t buf_word_len) +{ + mem_addr_t etr = DT_REG_ADDR(DT_NODELABEL(etr)); + + coresight_unlock(etr); + + sys_write32(buf_word_len, etr + ETR_RSZ_OFFSET); + sys_write32(buf, etr + ETR_RWP_OFFSET); + sys_write32(buf, etr + ETR_DBALO_OFFSET); + sys_write32(0UL, etr + ETR_DBAHI_OFFSET); + sys_write32(ETR_FFCR_ENFT_Msk, etr + ETR_FFCR_OFFSET); + sys_write32(ETR_MODE_MODE_CIRCULARBUF, etr + ETR_MODE_OFFSET); + sys_write32(ETR_CTL_TRACECAPTEN_Msk, etr + ETR_CTL_OFFSET); + + coresight_lock(etr); + + LOG_INF("Coresight Host ETR initialized"); +} + +static void nrf_stm_init(void) +{ + mem_addr_t stm = DT_REG_ADDR(DT_NODELABEL(stm)); + + coresight_unlock(stm); + + sys_write32(1, stm + STM_STMAUXCR_OFFSET); + + sys_write32(TS_CLOCKRATE, stm + STM_STMTSFREQR_OFFSET); + + sys_write32((CONFIG_DEBUG_CORESIGHT_NRF_STM_SYNC_BYTE_COUNT & 0xFFF), + stm + STM_STMSYNCR_OFFSET); + + sys_write32(0xFFFFFFFF, stm + STM_STMSPER_OFFSET); + + if (IS_ENABLED(CONFIG_DEBUG_CORESIGHT_NRF_STM_HWEVENTS)) { + sys_write32(0xFFFFFFFF, stm + STM_STMHEER_OFFSET); + sys_write32((1 << STM_STMHEMCR_EN_Pos), stm + STM_STMHEMCR_OFFSET); + } + + sys_write32(((CONFIG_DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL & STM_STMTCSR_TRACEID_Msk) + << STM_STMTCSR_TRACEID_Pos) | + (1 << STM_STMTCSR_EN_Pos) | (1 << STM_STMTCSR_TSEN_Pos), + stm + STM_STMTCSR_OFFSET); + + coresight_lock(stm); + + LOG_INF("CoreSight STM initialized with clockrate %u", TS_CLOCKRATE); +} + +static void nrf_atbfunnel_init(mem_addr_t funnel_addr, uint32_t enable_set_mask) +{ + coresight_unlock(funnel_addr); + + uint32_t ctrlreg_old = sys_read32(funnel_addr + ATBFUNNEL_CTRLREG_OFFSET); + + const uint32_t funnel_hold_time = (((CONFIG_DEBUG_CORESIGHT_NRF_ATBFUNNEL_HOLD_TIME - 1) + << ATBFUNNEL_CTRLREG_HT_Pos) & + ATBFUNNEL_CTRLREG_HT_Msk); + + uint32_t ctrlreg_new = (ctrlreg_old & ~ATBFUNNEL_CTRLREG_HT_Msk) | funnel_hold_time | + (enable_set_mask & 0xFF); + + sys_write32(ctrlreg_new, funnel_addr + ATBFUNNEL_CTRLREG_OFFSET); + + coresight_lock(funnel_addr); +} + +static void nrf_atbreplicator_init(mem_addr_t replicator_addr, uint32_t filter, bool ch0_allow, + bool ch1_allow) +{ + coresight_unlock(replicator_addr); + + uint32_t ch0_current = sys_read32(replicator_addr + ATBREPLICATOR_IDFILTER0_OFFSET); + uint32_t ch1_current = sys_read32(replicator_addr + ATBREPLICATOR_IDFILTER1_OFFSET); + + if (ch0_allow) { + sys_write32(ch0_current & ~filter, + replicator_addr + ATBREPLICATOR_IDFILTER0_OFFSET); + } else { + sys_write32(ch0_current | filter, replicator_addr + ATBREPLICATOR_IDFILTER0_OFFSET); + } + + if (ch1_allow) { + sys_write32(ch1_current & ~filter, + replicator_addr + ATBREPLICATOR_IDFILTER1_OFFSET); + } else { + sys_write32(ch1_current | filter, replicator_addr + ATBREPLICATOR_IDFILTER1_OFFSET); + } + + coresight_lock(replicator_addr); +} + +static int coresight_nrf_init_stm_etr(uintptr_t buf, size_t buf_word_len) +{ + mem_addr_t atbfunnel211 = DT_REG_ADDR(DT_NODELABEL(atbfunnel211)); + mem_addr_t atbreplicator210 = DT_REG_ADDR(DT_NODELABEL(atbreplicator210)); + mem_addr_t atbreplicator213 = DT_REG_ADDR(DT_NODELABEL(atbreplicator213)); + + nrf_atbfunnel_init(atbfunnel211, ATBFUNNEL211_STM_ENS_MASK); + nrf_atbreplicator_init(atbreplicator210, ATBREPLICATOR_IDFILTER_FORWARD_STM, false, true); + nrf_atbreplicator_init(atbreplicator213, ATBREPLICATOR_IDFILTER_FORWARD_STM, false, true); + + nrf_tsgen_init(); + nrf_etr_init(buf, buf_word_len); + nrf_stm_init(); + + return 0; +} + +static int coresight_nrf_init_stm_tpiu(void) +{ + mem_addr_t atbfunnel211 = DT_REG_ADDR(DT_NODELABEL(atbfunnel211)); + mem_addr_t atbreplicator210 = DT_REG_ADDR(DT_NODELABEL(atbreplicator210)); + mem_addr_t atbreplicator213 = DT_REG_ADDR(DT_NODELABEL(atbreplicator213)); + + nrf_atbfunnel_init(atbfunnel211, ATBFUNNEL211_STM_ENS_MASK); + nrf_atbreplicator_init(atbreplicator210, ATBREPLICATOR_IDFILTER_FORWARD_STM, false, true); + nrf_atbreplicator_init(atbreplicator213, ATBREPLICATOR_IDFILTER_FORWARD_STM, true, false); + + nrf_tsgen_init(); + nrf_cti_for_tpiu_init(); + nrf_tpiu_init(); + nrf_stm_init(); + + return 0; +} + +static int coresight_nrf_init(const struct device *dev) +{ + int err; + struct coresight_nrf_config *cfg = (struct coresight_nrf_config *)dev->config; + + if (cfg->pcfg) { + err = pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_DEFAULT); + if (err) { + LOG_ERR("Failed to configure pins (%d)", err); + return err; + } + } + + err = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT); + if (err) { + LOG_ERR("Failed to configure TDD (%d)", err); + return err; + } + + switch (cfg->mode) { + case CORESIGHT_NRF_MODE_UNCONFIGURED: { + return 0; + } + case CORESIGHT_NRF_MODE_STM_TPIU: { + return coresight_nrf_init_stm_tpiu(); + } + case CORESIGHT_NRF_MODE_STM_ETR: { + uintptr_t etr_buffer = DT_REG_ADDR(DT_NODELABEL(etr_buffer)); + size_t buf_word_len = DT_REG_SIZE(DT_NODELABEL(etr_buffer)) / sizeof(uint32_t); + + return coresight_nrf_init_stm_etr(etr_buffer, buf_word_len); + } + default: { + LOG_ERR("Unsupported Coresight mode"); + return -ENOTSUP; + } + } + return 0; +} + +#define DEBUG_CORESIGHT_NRF_INIT_PRIORITY UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY) + +#define CORESIGHT_NRF_INST(inst) \ + COND_CODE_1(DT_INST_PINCTRL_HAS_IDX(inst, 0), \ + (PINCTRL_DT_INST_DEFINE(inst);), ()) \ + \ + static struct coresight_nrf_config coresight_nrf_cfg_##inst = { \ + .mode = _CONCAT(CORESIGHT_NRF_MODE_, \ + DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), mode)), \ + .pcfg = COND_CODE_1(DT_INST_PINCTRL_HAS_IDX(inst, 0), \ + (PINCTRL_DT_INST_DEV_CONFIG_GET(inst)), \ + (NULL)) }; \ + \ + DEVICE_DT_INST_DEFINE(inst, coresight_nrf_init, NULL, NULL, &coresight_nrf_cfg_##inst, \ + POST_KERNEL, DEBUG_CORESIGHT_NRF_INIT_PRIORITY, NULL); + +DT_INST_FOREACH_STATUS_OKAY(CORESIGHT_NRF_INST) diff --git a/drivers/debug/debug_nrf_etr.c b/drivers/debug/debug_nrf_etr.c index da425716dbbe..d536cd4a9f40 100644 --- a/drivers/debug/debug_nrf_etr.c +++ b/drivers/debug/debug_nrf_etr.c @@ -768,6 +768,7 @@ int etr_process_init(void) 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))); + nrfx_tbm_start(); #ifdef CONFIG_DEBUG_NRF_ETR_SHELL uint32_t level = CONFIG_LOG_MAX_LEVEL; @@ -791,7 +792,17 @@ int etr_process_init(void) return 0; } -SYS_INIT(etr_process_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +#define NRF_ETR_INIT_PRIORITY UTIL_INC(UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY)) + +SYS_INIT(etr_process_init, POST_KERNEL, NRF_ETR_INIT_PRIORITY); + +#if defined(CONFIG_NORDIC_VPR_LAUNCHER) && defined(CONFIG_LOG_FRONTEND_STMESP_FSC) +/* TDD/ETR must be up and running before VPR cores are started as they write to + * ETR some vital initial data that cannot be lost. + */ +BUILD_ASSERT(CONFIG_NORDIC_VPR_LAUNCHER_INIT_PRIORITY > NRF_ETR_INIT_PRIORITY); +#endif + #ifdef CONFIG_DEBUG_NRF_ETR_SHELL diff --git a/dts/bindings/arm/nordic,nrf-tddconf.yaml b/dts/bindings/arm/nordic,nrf-tddconf.yaml deleted file mode 100644 index 2273082c12f9..000000000000 --- a/dts/bindings/arm/nordic,nrf-tddconf.yaml +++ /dev/null @@ -1,44 +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: - etbsources: - type: int - description: | - Bitmask of enabled sources for the ETB sink. Valid values can be found in - dt-bindings/misc/nordic-tddconf.h - - tpiusources: - type: int - description: | - Bitmask of enabled sources for the TPIU sink. Valid values can be found in - dt-bindings/misc/nordic-tddconf.h - - etrsources: - type: int - description: | - Bitmask of enabled sources for the ETR sink. Valid values can be found in - dt-bindings/misc/nordic-tddconf.h - - portconfig: - type: int - default: 3 - description: TPIU clock divider - TDD HSFLL / 2^(2 + portconfig) - enum: - - 0 - - 1 - - 2 - - 3 - - etrbuffer: - description: phandle to the memory region used for the ETR buffer - type: phandle diff --git a/dts/bindings/debug/nordic,coresight-nrf.yaml b/dts/bindings/debug/nordic,coresight-nrf.yaml new file mode 100644 index 000000000000..fec4f37ce5a9 --- /dev/null +++ b/dts/bindings/debug/nordic,coresight-nrf.yaml @@ -0,0 +1,22 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic Coresight Subsystem (Trace Port Interface Unit) + +compatible: "nordic,coresight-nrf" + +include: [base.yaml, pinctrl-device.yaml, nordic-clockpin.yaml] + +properties: + reg: + required: true + + mode: + required: true + type: string + enum: + - "unconfigured" + - "stm-tpiu" + - "stm-etr" + description: > + Specifies which mode to configure the Coresight subsystem in. diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index b3a960e740b9..62ab535006bd 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -13,7 +13,6 @@ #include #include #include -#include /delete-node/ &sw_pwm; @@ -532,10 +531,82 @@ interrupts = <127 NRF_DEFAULT_IRQ_PRIORITY>; }; - tddconf: tddconf@1000 { - compatible = "nordic,nrf-tddconf"; - reg = <0x1000 0x10>; + hsfll200: clock@4000 { + compatible = "fixed-clock"; + reg = <0x4000 0x1000>; + #clock-cells = <0>; + status = "disabled"; + clock-frequency = ; + }; + + coresight: coresight@40000 { + compatible = "nordic,coresight-nrf"; + reg = <0x40000 0x11000>; status = "disabled"; + nordic,clockpin-enable = ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x40000 0x11000>; + + tsgen: tsgen@1000 { + reg = <0x1000 0x1000>; + }; + + stm: stm@2000 { + reg = <0x2000 0x1000>; + }; + + tpiu: tpiu@3000 { + reg = <0x3000 0x1000>; + }; + + etb: etb@4000 { + reg = <0x4000 0x1000>; + }; + + etr: etr@5000 { + reg = <0x5000 0x1000>; + }; + + cti210: cti@6000 { + reg = <0x6000 0x1000>; + }; + + cti211: cti@7000 { + reg = <0x7000 0x1000>; + }; + + atbreplicator210: atbreplicator@8000 { + reg = <0x8000 0x1000>; + }; + + atbreplicator211: atbreplicator@9000 { + reg = <0x9000 0x1000>; + }; + + atbreplicator212: atbreplicator@A000 { + reg = <0xA000 0x1000>; + }; + + atbreplicator213: atbreplicator@B000 { + reg = <0xB000 0x1000>; + }; + + atbfunnel210: atbfunnel@C000 { + reg = <0xC000 0x1000>; + }; + + atbfunnel211: atbfunnel@D000 { + reg = <0xD000 0x1000>; + }; + + atbfunnel212: atbfunnel@E000 { + reg = <0xE000 0x1000>; + }; + + atbfunnel213: atbfunnel@F000 { + reg = <0xF000 0x1000>; + }; }; }; diff --git a/include/zephyr/dt-bindings/misc/nordic-tddconf.h b/include/zephyr/dt-bindings/misc/nordic-tddconf.h deleted file mode 100644 index 44bc74e491c0..000000000000 --- a/include/zephyr/dt-bindings/misc/nordic-tddconf.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_TDDCONF_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_TDDCONF_H_ - -#define NRF_TDDCONF_SOURCE_STMMAINCORE BIT(0) -#define NRF_TDDCONF_SOURCE_ETMMAINCORE BIT(1) -#define NRF_TDDCONF_SOURCE_STMHWEVENTS BIT(2) -#define NRF_TDDCONF_SOURCE_STMPPR BIT(3) -#define NRF_TDDCONF_SOURCE_STMFLPR BIT(4) - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_TDDCONF_H_ */ diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index d3b79e43f149..9a273dab7a59 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -121,6 +121,10 @@ def main() -> None: for node in dt.label2node["global_peripherals"].children.values(): builder.add_global_peripheral_cfg(node, **get_additional_node_kwargs(node)) + # TDD (Trace and Debug Domain) peripherals - contains coresight/TPIU + for node in dt.label2node["tdd_peripherals"].children.values(): + builder.add_global_peripheral_cfg(node, **get_additional_node_kwargs(node)) + # Add pins referenced by 'gpios' properties on non-peripheral nodes, for example # buttons and leds. We only add SPU configurations for these and not CTRLSEL, # to avoid false CTRLSEL conflicts for things like PWM leds. diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index de88045d32fb..85d55ebf1aa8 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -66,17 +66,6 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_PM select HAS_POWEROFF -config SOC_NRF54H20_TDD_ENABLE - bool "Power and configure the trace and debug domain (TDD)" - depends on SOC_NRF54H20_CPUAPP - select NRF_IRONSIDE_TDD_SERVICE - select SOC_LATE_INIT_HOOK - help - This will at application boot time request that the trace and - debug domain (TDD) is powered up and configured. - This allows configuring the coresight peripherals from - the application domain. - config SOC_NRF54H20_CPURAD_ENABLE bool "Boot the nRF54H20 Radio core" default y if NRF_802154_SER_HOST || BT_HCI_HOST diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 1206e6767aa2..8493aa03bc34 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,14 +22,10 @@ #include #include #include -#include #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) #include #endif -#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE) -#include -#endif LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -183,20 +179,6 @@ void soc_early_init_hook(void) void soc_late_init_hook(void) { -#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE) - int err_tdd; - - err_tdd = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT); - __ASSERT(err_tdd == 0, "err_tdd was %d", err_tdd); - - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 3, GPIO_PIN_CNF_CTRLSEL_TND); - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 4, GPIO_PIN_CNF_CTRLSEL_TND); - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 5, GPIO_PIN_CNF_CTRLSEL_TND); - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 6, GPIO_PIN_CNF_CTRLSEL_TND); - UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 7, GPIO_PIN_CNF_CTRLSEL_TND); - -#endif - #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) int err_cpuconf; From 4ed4db53a5e588fbf5109de8a43cfdd781e88adc Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Wed, 27 Aug 2025 21:42:37 +0200 Subject: [PATCH 0127/3334] [nrf fromtree] snippets: nordic-log-stm: Updated for coresight Replaced the old tddconf with the full coresight driver that configures the coresight peripherals locally on the running core. Also fixed minor bug in the corresponding sample where messages were not shown for the radio core. Signed-off-by: Karsten Koenig (cherry picked from commit 02fb6fa1c8df4e1401430f1012f2e3eb37f991bb) --- samples/boards/nordic/coresight_stm/prj.conf | 1 + .../nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay | 7 ++----- .../nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay | 9 --------- snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf | 1 + snippets/nordic/nordic-log-stm-dict/snippet.yml | 3 --- .../nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay | 7 ++----- .../nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay | 9 --------- snippets/nordic/nordic-log-stm/log_stm.conf | 1 + snippets/nordic/nordic-log-stm/snippet.yml | 3 --- 9 files changed, 7 insertions(+), 34 deletions(-) delete mode 100644 snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay delete mode 100644 snippets/nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay diff --git a/samples/boards/nordic/coresight_stm/prj.conf b/samples/boards/nordic/coresight_stm/prj.conf index 1e935e973c76..9ee7cf8cc03a 100644 --- a/samples/boards/nordic/coresight_stm/prj.conf +++ b/samples/boards/nordic/coresight_stm/prj.conf @@ -1 +1,2 @@ CONFIG_LOG=y +CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y diff --git a/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay index fec548173648..962aa231b7a9 100644 --- a/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay +++ b/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay @@ -7,10 +7,7 @@ status = "okay"; }; -&tddconf { +&coresight { status = "okay"; - etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR | - NRF_TDDCONF_SOURCE_STMFLPR)>; - portconfig = <0>; - etrbuffer = <&etr_buffer>; + mode = "stm-etr"; }; diff --git a/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay b/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay deleted file mode 100644 index 5bdeddd3c07f..000000000000 --- a/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&tddconf { - status = "okay"; - etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>; -}; diff --git a/snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf b/snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf index 7384e36b92a2..0bd8b46d387e 100644 --- a/snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf +++ b/snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf @@ -3,3 +3,4 @@ CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG_FRONTEND=y CONFIG_LOG_FRONTEND_ONLY=y CONFIG_LOG_FRONTEND_STMESP=y +CONFIG_DEBUG_DRIVER=y diff --git a/snippets/nordic/nordic-log-stm-dict/snippet.yml b/snippets/nordic/nordic-log-stm-dict/snippet.yml index 6e4f1c6d23e1..a717d39399b5 100644 --- a/snippets/nordic/nordic-log-stm-dict/snippet.yml +++ b/snippets/nordic/nordic-log-stm-dict/snippet.yml @@ -5,6 +5,3 @@ boards: /.*/nrf54h20/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay - /.*/nrf54h20/cpurad/: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpurad.overlay diff --git a/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay index fec548173648..962aa231b7a9 100644 --- a/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay +++ b/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay @@ -7,10 +7,7 @@ status = "okay"; }; -&tddconf { +&coresight { status = "okay"; - etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR | - NRF_TDDCONF_SOURCE_STMFLPR)>; - portconfig = <0>; - etrbuffer = <&etr_buffer>; + mode = "stm-etr"; }; diff --git a/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay b/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay deleted file mode 100644 index 5bdeddd3c07f..000000000000 --- a/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&tddconf { - status = "okay"; - etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>; -}; diff --git a/snippets/nordic/nordic-log-stm/log_stm.conf b/snippets/nordic/nordic-log-stm/log_stm.conf index 1325c25b505f..46550a258cd1 100644 --- a/snippets/nordic/nordic-log-stm/log_stm.conf +++ b/snippets/nordic/nordic-log-stm/log_stm.conf @@ -4,3 +4,4 @@ CONFIG_LOG_FRONTEND=y CONFIG_LOG_FRONTEND_ONLY=y CONFIG_LOG_FRONTEND_STMESP=y CONFIG_LOG_FRONTEND_STMESP_FSC=y +CONFIG_DEBUG_DRIVER=y diff --git a/snippets/nordic/nordic-log-stm/snippet.yml b/snippets/nordic/nordic-log-stm/snippet.yml index 0a984a8312cc..918379360afc 100644 --- a/snippets/nordic/nordic-log-stm/snippet.yml +++ b/snippets/nordic/nordic-log-stm/snippet.yml @@ -5,6 +5,3 @@ boards: /.*/nrf54h20/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay - /.*/nrf54h20/cpurad/: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpurad.overlay From 1c80bbd5b7071976bdd31c933c252770977cd540 Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Wed, 27 Aug 2025 21:50:36 +0200 Subject: [PATCH 0128/3334] [nrf fromtree] drivers: misc: nordic_vpr_launcher: Init order Make sure the nordic_vpr_launcher gets started after the coresight driver if that is present. Signed-off-by: Karsten Koenig (cherry picked from commit 24353a89387d235d9b507a2a6949dca4cb38b82a) --- drivers/misc/nordic_vpr_launcher/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/nordic_vpr_launcher/Kconfig b/drivers/misc/nordic_vpr_launcher/Kconfig index d00bcc583f96..edd2a9ead753 100644 --- a/drivers/misc/nordic_vpr_launcher/Kconfig +++ b/drivers/misc/nordic_vpr_launcher/Kconfig @@ -18,6 +18,7 @@ source "subsys/logging/Kconfig.template.log_config" config NORDIC_VPR_LAUNCHER_INIT_PRIORITY int "Nordic VPR coprocessor launcher init priority" + default 44 if DT_HAS_NORDIC_CORESIGHT_NRF_ENABLED default 0 help The init priority of the VPR coprocessor launcher. From b119f0af5cb8ef38d93bba3be9710b7bf0275967 Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Thu, 28 Aug 2025 18:07:25 +0200 Subject: [PATCH 0129/3334] [nrf fromtree] snippets: nordic-log-stm-tpiu-dict: Added Added a new convience snippet to redirect logs to STM and then sink them to TPIU where they can be captured by a trace probe. Signed-off-by: Karsten Koenig (cherry picked from commit 0b5bb3c8c48b8cc823edd1c68b54f550978d6f0c) --- samples/boards/nordic/coresight_stm/sample.yaml | 7 +++++++ snippets/nordic/nordic-log-stm-tpiu-dict/README.rst | 11 +++++++++++ .../boards/nrf54h20_cpuapp.overlay | 11 +++++++++++ .../nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf | 6 ++++++ snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml | 7 +++++++ 5 files changed, 42 insertions(+) create mode 100644 snippets/nordic/nordic-log-stm-tpiu-dict/README.rst create mode 100644 snippets/nordic/nordic-log-stm-tpiu-dict/boards/nrf54h20_cpuapp.overlay create mode 100644 snippets/nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf create mode 100644 snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml diff --git a/samples/boards/nordic/coresight_stm/sample.yaml b/samples/boards/nordic/coresight_stm/sample.yaml index 000241d4d979..9ff835d8ffad 100644 --- a/samples/boards/nordic/coresight_stm/sample.yaml +++ b/samples/boards/nordic/coresight_stm/sample.yaml @@ -22,6 +22,13 @@ tests: - SB_CONFIG_APP_CPUPPR_RUN=y - SB_CONFIG_APP_CPUFLPR_RUN=y + sample.boards.nrf.coresight_stm.tpiu.dict: + required_snippets: + - nordic-log-stm-tpiu-dict + extra_args: + - SB_CONFIG_APP_CPUPPR_RUN=y + - SB_CONFIG_APP_CPUFLPR_RUN=y + sample.boards.nrf.coresight_stm: harness: pytest harness_config: diff --git a/snippets/nordic/nordic-log-stm-tpiu-dict/README.rst b/snippets/nordic/nordic-log-stm-tpiu-dict/README.rst new file mode 100644 index 000000000000..9dbf067671bf --- /dev/null +++ b/snippets/nordic/nordic-log-stm-tpiu-dict/README.rst @@ -0,0 +1,11 @@ +.. _nordic-log-stm-tpiu-dict: + +Nordic Dictionary-based STM to TPIU logging snippet (nordic-log-stm-tpiu-dict) +############################################################################## + +Overview +******** + +This snippet allows users to build Zephyr with the dictionary-based logging to +the Coresight STM stimulus ports. Data is written to the TPIU interface and can +be captured with nrfutil trace to translate into a human-readable format. diff --git a/snippets/nordic/nordic-log-stm-tpiu-dict/boards/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-log-stm-tpiu-dict/boards/nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..e6f14f46a6a4 --- /dev/null +++ b/snippets/nordic/nordic-log-stm-tpiu-dict/boards/nrf54h20_cpuapp.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +&coresight { + status = "okay"; + mode = "stm-tpiu"; + pinctrl-0 = <&tpiu_default>; + pinctrl-names = "default"; +}; diff --git a/snippets/nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf b/snippets/nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf new file mode 100644 index 000000000000..0bd8b46d387e --- /dev/null +++ b/snippets/nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf @@ -0,0 +1,6 @@ +CONFIG_LOG=y +CONFIG_TEST_LOGGING_DEFAULTS=n +CONFIG_LOG_FRONTEND=y +CONFIG_LOG_FRONTEND_ONLY=y +CONFIG_LOG_FRONTEND_STMESP=y +CONFIG_DEBUG_DRIVER=y diff --git a/snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml b/snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml new file mode 100644 index 000000000000..32cd36d377ea --- /dev/null +++ b/snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml @@ -0,0 +1,7 @@ +name: nordic-log-stm-tpiu-dict +append: + EXTRA_CONF_FILE: log_stm_dict.conf +boards: + /.*/nrf54h20/cpuapp/: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay From d6e2c6c7afde0f2c2c59f66aa613bfa3fe523523 Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Mon, 22 Sep 2025 14:27:36 +0200 Subject: [PATCH 0130/3334] [nrf fromtree] boards: nordic: nrf54h20dk: ETM in JLinkScript The JLinkScript originally configured more than needed which reduces readability, so stripped it down to the minimum. At the same time improved behavior under reset and added ETM to the radiocore JLinkScript. Signed-off-by: Karsten Koenig (cherry picked from commit a50dc9fb8a894fca284e1f2db1c4d5186f479d5c) --- .../support/nrf54h20_cpuapp.JLinkScript | 139 ++++++++-------- .../support/nrf54h20_cpurad.JLinkScript | 149 +++++++++++++++++- 2 files changed, 210 insertions(+), 78 deletions(-) diff --git a/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript index 9738ec77f437..d79c93417455 100644 --- a/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript +++ b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + __constant U32 _CPUCONF_ADDR = 0x52011000; __constant U32 _CPUCONF_CPUWAIT_OFFSET = 0x50C; @@ -5,32 +11,17 @@ __constant U32 _CPUCONF_CPUWAIT_OFFSET = 0x50C; __constant U32 _ATBFUNNEL211_ADDR = 0xBF04D000; __constant U32 _ATBFUNNEL212_ADDR = 0xBF04E000; __constant U32 _ATBFUNNEL_CTRLREG_OFFSET = 0x0; +__constant U32 _ATBFUNNEL_HOLDTIME_MASK = 0x700; __constant U32 _HOLDTIME_4 = 0x300; -__constant U32 _ENS0 = 0x1; -__constant U32 _ENS1 = 0x2; -__constant U32 _ENS2 = 0x4; +__constant U32 _ENS0 = 0x1; // Application Core +__constant U32 _ENS1 = 0x2; // Radio Core // ATBREPLICATOR __constant U32 _ATBREPLICATOR212_ADDR = 0xBF04A000; __constant U32 _ATBREPLICATOR213_ADDR = 0xBF04B000; __constant U32 _ATBREPLICATOR_IDFILTER0_OFFSET = 0x0; __constant U32 _ATBREPLICATOR_IDFILTER1_OFFSET = 0x4; -__constant U32 _ID_NONE = 0xFFFFFFFF; -__constant U32 _ID1x = 0xFFFFFFFD; - -// TSGEN -__constant U32 _TSGEN_ADDR = 0xBF041000; -__constant U32 _TSGEN_CNTCR_OFFSET = 0x0; -__constant U32 _TSGEN_CNTFID0_OFFSET = 0x20; -// Clock rate = TDD Freq. / 8 -__constant U32 _TS_CLOCKRATE = 40000000; - -// CTI -__constant U32 _CTI210_ADDR = 0xBF046000; -__constant U32 _CTICONTROL_OFFSET = 0x0; -__constant U32 _CTIOUTEN_OFFSET = 0xA0; -__constant U32 _CTIGATE_OFFSET = 0x140; -__constant U32 _TPIU_FLUSH_TRIG = 0x2; +__constant U32 _ATBREPLICATOR_IDFILTER_ETM = 0x2; // ETM has 0x10 TRACEID // TPIU __constant U32 _TPIU_ADDR = 0xBF043000; @@ -43,30 +34,10 @@ __constant U32 _ENFTC = 0x1; __constant U32 _TPIU_SYNC_FRAME_COUNT = 0x8; __constant U32 _CURRENTPORTSIZE_4 = 0x8; -// TDDCONF -__constant U32 _TDDCONF_ADDR = 0xBF001000; -__constant U32 _TRACEPORTSPEED_OFFSET = 0x408; -__constant U32 _SPEED80MHZ = 0x0; - // CoreSight general -__constant U32 _CORESIGHT_CLAIMSET_OFFSET = 0xFA0; -__constant U32 _CORESIGHT_CLAIMCLR_OFFSET = 0xFA4; __constant U32 _CORESIGHT_LAR_OFFSET = 0xFB0; __constant U32 _CORESIGHT_UNLOCK_KEY = 0xC5ACCE55; -// GPIO P7 -__constant U32 _P7_ADDR = 0x5F938E00; -__constant U32 _PIN_CNF3_OFFSET = 0x8C; -__constant U32 _PIN_CNF4_OFFSET = 0x90; -__constant U32 _PIN_CNF5_OFFSET = 0x94; -__constant U32 _PIN_CNF6_OFFSET = 0x98; -__constant U32 _PIN_CNF7_OFFSET = 0x9C; -__constant U32 _PIN_CNF_TPIU_CLOCK_VALUE = 0x80000503; -__constant U32 _PIN_CNF_TPIU_DATA_VALUE = 0x00000503; - -// Settings -__constant U32 _DEBUGGER_CLAIM_MASK = 0x2; - // Used to check if we have already set up tracing int _needCoresightSetup = 1; @@ -82,68 +53,59 @@ void _CSLock(U32 addr) JLINK_MEM_WriteU32(addr + _CORESIGHT_LAR_OFFSET, 0); } -// Set claim bits in the CoreSight peripheral to indicate to the firmware that it -// has been configured by the host debugger -void _CSClaim(U32 addr) -{ - JLINK_MEM_WriteU32(addr + _CORESIGHT_CLAIMSET_OFFSET, _DEBUGGER_CLAIM_MASK); -} - // Set up CoreSight and other necessary configuration so to enable ETM -> TPIU tracing. int _SetupETMTPIUTrace(void) { + U32 ctrlreg_old; + U32 ctrlreg_new; + U32 idfilter0_old; + U32 idfilter1_old; + U32 idfilter0_new; + U32 idfilter1_new; + // Set up ATB funnels/replicators to route ApplicationDomain ETM to TPIU + _CSUnlock(_ATBFUNNEL212_ADDR); - JLINK_MEM_WriteU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, _HOLDTIME_4 | _ENS0); - _CSClaim(_ATBFUNNEL212_ADDR); + ctrlreg_old = JLINK_MEM_ReadU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET); + ctrlreg_new = (ctrlreg_old & ~_ATBFUNNEL_HOLDTIME_MASK) | _HOLDTIME_4 | _ENS0; + JLINK_MEM_WriteU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, ctrlreg_new); _CSLock(_ATBFUNNEL212_ADDR); _CSUnlock(_ATBREPLICATOR212_ADDR); - JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, _ID_NONE); - JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, _ID1x); - _CSLock(_ATBREPLICATOR212_ADDR); - _CSClaim(_ATBREPLICATOR212_ADDR); + idfilter0_old = JLINK_MEM_ReadU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET); + idfilter1_old = JLINK_MEM_ReadU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET); + + idfilter0_new = idfilter0_old | _ATBREPLICATOR_IDFILTER_ETM; // SET for output 0 + idfilter1_new = idfilter1_old & ~_ATBREPLICATOR_IDFILTER_ETM; // CLEAR for output 1 + + JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, idfilter0_new); + JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, idfilter1_new); _CSLock(_ATBREPLICATOR212_ADDR); _CSUnlock(_ATBFUNNEL211_ADDR); - JLINK_MEM_WriteU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, _HOLDTIME_4 | _ENS0); - _CSClaim(_ATBFUNNEL211_ADDR); + ctrlreg_old = JLINK_MEM_ReadU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET); + ctrlreg_new = (ctrlreg_old & ~_ATBFUNNEL_HOLDTIME_MASK) | _HOLDTIME_4 | _ENS0; + JLINK_MEM_WriteU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, ctrlreg_new); _CSLock(_ATBFUNNEL211_ADDR); _CSUnlock(_ATBREPLICATOR213_ADDR); - JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, _ID1x); - JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, _ID_NONE); - _CSClaim(_ATBREPLICATOR213_ADDR); - _CSLock(_ATBREPLICATOR213_ADDR); + idfilter0_old = JLINK_MEM_ReadU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET); + idfilter1_old = JLINK_MEM_ReadU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET); - // Configure timestamp generator for the correct clock rate - JLINK_MEM_WriteU32(_TSGEN_ADDR + _TSGEN_CNTFID0_OFFSET, _TS_CLOCKRATE); - JLINK_MEM_WriteU32(_TSGEN_ADDR + _TSGEN_CNTCR_OFFSET, 1); - _CSClaim(_TSGEN_ADDR); + idfilter0_new = idfilter0_old & ~_ATBREPLICATOR_IDFILTER_ETM; // CLEAR for output 0 + idfilter1_new = idfilter1_old | _ATBREPLICATOR_IDFILTER_ETM; // SET for output 1 - // Configure CTI1 for TPIU formatter flushing - _CSUnlock(_CTI210_ADDR); - JLINK_MEM_WriteU32(_CTI210_ADDR + _CTIOUTEN_OFFSET, _TPIU_FLUSH_TRIG); - JLINK_MEM_WriteU32(_CTI210_ADDR + _CTIGATE_OFFSET, _TPIU_FLUSH_TRIG); - JLINK_MEM_WriteU32(_CTI210_ADDR + _CTICONTROL_OFFSET, 1); - _CSClaim(_CTI210_ADDR); - _CSLock(_CTI210_ADDR); + JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, idfilter0_new); + JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, idfilter1_new); + _CSLock(_ATBREPLICATOR213_ADDR); // Configure TPIU for port size 4, continuous formatting _CSUnlock(_TPIU_ADDR); JLINK_MEM_WriteU32(_TPIU_ADDR + _CURRENTPORTSIZE_OFFSET, _CURRENTPORTSIZE_4); JLINK_MEM_WriteU32(_TPIU_ADDR + _FFCR_OFFSET, _ENFCONT | _FONFLIN | _ENFTC); JLINK_MEM_WriteU32(_TPIU_ADDR + _FSCR_OFFSET, _TPIU_SYNC_FRAME_COUNT); - _CSClaim(_TPIU_ADDR); _CSLock(_TPIU_ADDR); - // Configure the trace pins - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF3_OFFSET, _PIN_CNF_TPIU_CLOCK_VALUE); - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF4_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF5_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF6_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); - JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF7_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); - return 0; } @@ -155,6 +117,19 @@ int ConfigTargetSettings(void) // Adjust trace sample delay to compensate for timing when using 320MHz JLINK_ExecCommand("TraceSampleAdjust TD = 1000"); + JLINK_ExecCommand("CORESIGHT_SetTPIUBaseAddr = 0xBF043000"); + + return 0; +} + +int StartTPIU(void) +{ + /* We sort this ourselves in _SetupETMTPIUTrace, don't let JLink touch it */ + return 0; +} + +int StopTPIU(void) +{ return 0; } @@ -169,6 +144,11 @@ int OnTraceStart(void) return 0; } +int AfterResetTarget(void) +{ + _needCoresightSetup = 1; + return 0; +} int SetupTarget(void) { @@ -179,3 +159,8 @@ int SetupTarget(void) return 0; } + +int InitEMU(void) { + JLINK_ExecCommand("EnableLowPowerHandlingMode"); + return 0; +} diff --git a/boards/nordic/nrf54h20dk/support/nrf54h20_cpurad.JLinkScript b/boards/nordic/nrf54h20dk/support/nrf54h20_cpurad.JLinkScript index e1861ae8c972..2ff7f6c160e3 100644 --- a/boards/nordic/nrf54h20dk/support/nrf54h20_cpurad.JLinkScript +++ b/boards/nordic/nrf54h20dk/support/nrf54h20_cpurad.JLinkScript @@ -1,11 +1,153 @@ -__constant U32 _CPUCONF_ADDR = 0x53011000; +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +__constant U32 _CPUCONF_ADDR = 0x52011000; __constant U32 _CPUCONF_CPUWAIT_OFFSET = 0x50C; +// ATBFUNNEL +__constant U32 _ATBFUNNEL211_ADDR = 0xBF04D000; +__constant U32 _ATBFUNNEL212_ADDR = 0xBF04E000; +__constant U32 _ATBFUNNEL_CTRLREG_OFFSET = 0x0; +__constant U32 _ATBFUNNEL_HOLDTIME_MASK = 0x700; +__constant U32 _HOLDTIME_4 = 0x300; +__constant U32 _ENS0 = 0x1; // Application Core +__constant U32 _ENS1 = 0x2; // Radio Core + +// ATBREPLICATOR +__constant U32 _ATBREPLICATOR212_ADDR = 0xBF04A000; +__constant U32 _ATBREPLICATOR213_ADDR = 0xBF04B000; +__constant U32 _ATBREPLICATOR_IDFILTER0_OFFSET = 0x0; +__constant U32 _ATBREPLICATOR_IDFILTER1_OFFSET = 0x4; +__constant U32 _ATBREPLICATOR_IDFILTER_ETM = 0x2; // ETM has 0x10 TRACEID + +// TPIU +__constant U32 _TPIU_ADDR = 0xBF043000; +__constant U32 _CURRENTPORTSIZE_OFFSET = 0x4; +__constant U32 _FFCR_OFFSET = 0x304; +__constant U32 _FSCR_OFFSET = 0x308; +__constant U32 _ENFCONT = 0x02; +__constant U32 _FONFLIN = 0x10; +__constant U32 _ENFTC = 0x1; +__constant U32 _TPIU_SYNC_FRAME_COUNT = 0x8; +__constant U32 _CURRENTPORTSIZE_4 = 0x8; + +// CoreSight general +__constant U32 _CORESIGHT_LAR_OFFSET = 0xFB0; +__constant U32 _CORESIGHT_UNLOCK_KEY = 0xC5ACCE55; + +// Used to check if we have already set up tracing +int _needCoresightSetup = 1; + +// Unlock a CoreSight peripheral +void _CSUnlock(U32 addr) +{ + JLINK_MEM_WriteU32(addr + _CORESIGHT_LAR_OFFSET, _CORESIGHT_UNLOCK_KEY); +} + +// Lock a CoreSight peripheral +void _CSLock(U32 addr) +{ + JLINK_MEM_WriteU32(addr + _CORESIGHT_LAR_OFFSET, 0); +} + +// Set up CoreSight and other necessary configuration so to enable ETM -> TPIU tracing. +int _SetupETMTPIUTrace(void) +{ + U32 ctrlreg_old; + U32 ctrlreg_new; + U32 idfilter0_old; + U32 idfilter1_old; + U32 idfilter0_new; + U32 idfilter1_new; + + // Set up ATB funnels/replicators to route ApplicationDomain ETM to TPIU + + _CSUnlock(_ATBFUNNEL212_ADDR); + ctrlreg_old = JLINK_MEM_ReadU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET); + ctrlreg_new = (ctrlreg_old & ~_ATBFUNNEL_HOLDTIME_MASK) | _HOLDTIME_4 | _ENS1; + JLINK_MEM_WriteU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, ctrlreg_new); + _CSLock(_ATBFUNNEL212_ADDR); + + _CSUnlock(_ATBREPLICATOR212_ADDR); + idfilter0_old = JLINK_MEM_ReadU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET); + idfilter1_old = JLINK_MEM_ReadU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET); + + idfilter0_new = idfilter0_old | _ATBREPLICATOR_IDFILTER_ETM; // SET for output 0 + idfilter1_new = idfilter1_old & ~_ATBREPLICATOR_IDFILTER_ETM; // CLEAR for output 1 + + JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, idfilter0_new); + JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, idfilter1_new); + _CSLock(_ATBREPLICATOR212_ADDR); + + _CSUnlock(_ATBFUNNEL211_ADDR); + ctrlreg_old = JLINK_MEM_ReadU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET); + ctrlreg_new = (ctrlreg_old & ~_ATBFUNNEL_HOLDTIME_MASK) | _HOLDTIME_4 | _ENS1; + JLINK_MEM_WriteU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, ctrlreg_new); + _CSLock(_ATBFUNNEL211_ADDR); + + _CSUnlock(_ATBREPLICATOR213_ADDR); + idfilter0_old = JLINK_MEM_ReadU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET); + idfilter1_old = JLINK_MEM_ReadU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET); + + idfilter0_new = idfilter0_old & ~_ATBREPLICATOR_IDFILTER_ETM; // CLEAR for output 0 + idfilter1_new = idfilter1_old | _ATBREPLICATOR_IDFILTER_ETM; // SET for output 1 + + JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, idfilter0_new); + JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, idfilter1_new); + _CSLock(_ATBREPLICATOR213_ADDR); + + // Configure TPIU for port size 4, continuous formatting + _CSUnlock(_TPIU_ADDR); + JLINK_MEM_WriteU32(_TPIU_ADDR + _CURRENTPORTSIZE_OFFSET, _CURRENTPORTSIZE_4); + JLINK_MEM_WriteU32(_TPIU_ADDR + _FFCR_OFFSET, _ENFCONT | _FONFLIN | _ENFTC); + JLINK_MEM_WriteU32(_TPIU_ADDR + _FSCR_OFFSET, _TPIU_SYNC_FRAME_COUNT); + _CSLock(_TPIU_ADDR); + + return 0; +} + int ConfigTargetSettings(void) { JLINK_ExecCommand("CORESIGHT_AddAP = Index=1 Type=AHB-AP"); CORESIGHT_IndexAHBAPToUse = 1; + // Adjust trace sample delay to compensate for timing when using 320MHz + JLINK_ExecCommand("TraceSampleAdjust TD = 1000"); + + JLINK_ExecCommand("CORESIGHT_SetTPIUBaseAddr = 0xBF043000"); + + return 0; +} + +int StartTPIU(void) +{ + /* We sort this ourselves in _SetupETMTPIUTrace, don't let JLink touch it */ + return 0; +} + +int StopTPIU(void) +{ + return 0; +} + + +int OnTraceStart(void) +{ + // Set up CoreSight if not already configured + if (_needCoresightSetup) { + _SetupETMTPIUTrace(); + _needCoresightSetup = 0; + } + + return 0; +} + +int AfterResetTarget(void) +{ + _needCoresightSetup = 1; return 0; } @@ -18,3 +160,8 @@ int SetupTarget(void) return 0; } + +int InitEMU(void) { + JLINK_ExecCommand("EnableLowPowerHandlingMode"); + return 0; +} From a9167115dd645215f3e811e8705ec51ab90171de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 8 Oct 2025 14:33:12 +0200 Subject: [PATCH 0131/3334] [nrf fromtree] tests: boards: nrf: coresight_stm: Align test to STM driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were recent changes to nrf54h20dk and STM driver. Align test accordingly: - add Kconfig that boots Radio core, - update expected timing results. Signed-off-by: Sebastian Głąb (cherry picked from commit 3d56c2f8f83b9d2d0072684601bfb11775067198) --- .../nordic/coresight_stm/pytest/test_stm.py | 38 +++++++++---------- tests/boards/nrf/coresight_stm/prj.conf | 1 + 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/samples/boards/nordic/coresight_stm/pytest/test_stm.py b/samples/boards/nordic/coresight_stm/pytest/test_stm.py index 6db0b5685759..993df0b55fb8 100644 --- a/samples/boards/nordic/coresight_stm/pytest/test_stm.py +++ b/samples/boards/nordic/coresight_stm/pytest/test_stm.py @@ -275,9 +275,9 @@ def test_STM_decoded(dut: DeviceAdapter): app_constraints = STMLimits( # all values in us - log_0_arg=1.8, - log_1_arg=2.1, - log_2_arg=2.0, + log_0_arg=0.6, + log_1_arg=0.6, + log_2_arg=2.1, log_3_arg=2.1, log_str=4.5, tracepoint=0.5, @@ -286,35 +286,35 @@ def test_STM_decoded(dut: DeviceAdapter): ) rad_constraints = STMLimits( # all values in us - log_0_arg=4.6, - log_1_arg=5.0, - log_2_arg=5.2, - log_3_arg=5.6, - log_str=6.3, + log_0_arg=5.6, + log_1_arg=5.8, + log_2_arg=6.1, + log_3_arg=6.4, + log_str=7.1, tracepoint=0.5, tracepoint_d32=0.5, tolerance=0.5, ) ppr_constraints = STMLimits( # all values in us - log_0_arg=25.7, - log_1_arg=27.1, - log_2_arg=27.3, - log_3_arg=30.4, - log_str=65.7, + log_0_arg=2.3, + log_1_arg=2.0, + log_2_arg=26.9, + log_3_arg=27.5, + log_str=68.3, tracepoint=0.55, tracepoint_d32=0.25, tolerance=0.5, ) flpr_constraints = STMLimits( # all values in us - log_0_arg=1.3, - log_1_arg=1.6, - log_2_arg=1.6, - log_3_arg=1.7, + log_0_arg=0.2, + log_1_arg=0.2, + log_2_arg=1.2, + log_3_arg=1.2, log_str=3.0, - tracepoint=0.5, - tracepoint_d32=0.5, + tracepoint=0.25, + tracepoint_d32=0.25, tolerance=0.5, ) diff --git a/tests/boards/nrf/coresight_stm/prj.conf b/tests/boards/nrf/coresight_stm/prj.conf index 1e935e973c76..9ee7cf8cc03a 100644 --- a/tests/boards/nrf/coresight_stm/prj.conf +++ b/tests/boards/nrf/coresight_stm/prj.conf @@ -1 +1,2 @@ CONFIG_LOG=y +CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y From e66b9557f7a3cb9004127910f7d6eb9201ea9fe6 Mon Sep 17 00:00:00 2001 From: Triveni Danda Date: Thu, 9 Oct 2025 16:20:19 +0530 Subject: [PATCH 0132/3334] [nrf fromtree] net: l2: wifi: Fix override certs directory for sysbuild Fix overriding the test certificates directory for enterprise mode when using sysbuild. The override already works as expected without sysbuild. Signed-off-by: Triveni Danda (cherry picked from commit 57a35d9cb487b5149625a759b08a3d03029caf9a) --- subsys/net/l2/wifi/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/net/l2/wifi/CMakeLists.txt b/subsys/net/l2/wifi/CMakeLists.txt index f91964d9d83a..c3f12fe132cf 100644 --- a/subsys/net/l2/wifi/CMakeLists.txt +++ b/subsys/net/l2/wifi/CMakeLists.txt @@ -28,6 +28,8 @@ if(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE AND CONFIG_NET_L2_WIFI_SHELL) # Wi-Fi Enterprise test certificates handling set(gen_inc_dir ${ZEPHYR_BINARY_DIR}/misc/generated) set(gen_dir ${gen_inc_dir}/wifi_enterprise_test_certs) + zephyr_get(WIFI_TEST_CERTS_DIR SYSBUILD GLOBAL) + message(DEBUG "WIFI_TEST_CERTS_DIR is set to ${WIFI_TEST_CERTS_DIR}") if(NOT DEFINED WIFI_TEST_CERTS_DIR) set(WIFI_TEST_CERTS_DIR ${ZEPHYR_BASE}/samples/net/wifi/test_certs/rsa3k) endif() From 0c83552cd6d012534d24a80c50bd86a22964d4aa Mon Sep 17 00:00:00 2001 From: Aymen LAOUINI Date: Tue, 30 Sep 2025 15:43:46 +0300 Subject: [PATCH 0133/3334] [nrf fromtree] soc: ironside: Add UUID to boot report - The UUID is the device unique identifier read from the OTP and made available in boot report to avoid the repetitive slow reads from OTP. Signed-off-by: Aymen LAOUINI (cherry picked from commit 4312c881f3f5b1350ad7b3a605aa0cf16a916eb3) --- soc/nordic/ironside/include/nrf_ironside/boot_report.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/soc/nordic/ironside/include/nrf_ironside/boot_report.h b/soc/nordic/ironside/include/nrf_ironside/boot_report.h index c4d31c9dbc59..8c602c00134c 100644 --- a/soc/nordic/ironside/include/nrf_ironside/boot_report.h +++ b/soc/nordic/ironside/include/nrf_ironside/boot_report.h @@ -116,6 +116,8 @@ #define IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) /** Length of the random data buffer in bytes. */ #define IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) +/** Length of the uuid buffer in bytes. */ +#define IRONSIDE_BOOT_REPORT_UUID_SIZE (16UL) /** @brief Initialization/boot status description contained in the boot report. */ struct ironside_boot_report_init_status { @@ -207,8 +209,10 @@ struct ironside_boot_report { struct ironside_boot_report_init_context init_context; /** CSPRNG data */ uint8_t random_data[IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE]; + /** Device Info data : 128-bit Universally Unique IDentifier (UUID) */ + uint8_t device_info_uuid[IRONSIDE_BOOT_REPORT_UUID_SIZE]; /** Reserved for Future Use */ - uint32_t rfu2[64]; + uint32_t rfu2[60]; }; /** From e5dddc093a9c2ade30bb9660a6febf02733fccc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 16 Oct 2025 10:22:43 +0200 Subject: [PATCH 0134/3334] [nrf fromlist] soc: nordic: nrf54h: uicr: Improve deps for uicr/zephyr/zephyr.hex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uicr/zephyr/zephyr.hex needs to be built after all other zephyr images. Instead of adding a dependency on uicr, we check the sysbuild_images property to find images. Also, we check it as late possible by using the cmake_language(DEFER DIRECTORY feature. Which will ensure that running this code will be one of the last things that the CMake sysbuild program does at Configure time. Upstream PR #: 97685 Signed-off-by: Sebastian Bøe (cherry picked from commit 53fe3820644a1a1198408dc327c2b44dbaf56541) --- soc/nordic/common/uicr/sysbuild.cmake | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/soc/nordic/common/uicr/sysbuild.cmake b/soc/nordic/common/uicr/sysbuild.cmake index 9cafd261036d..fb797b6b76ee 100644 --- a/soc/nordic/common/uicr/sysbuild.cmake +++ b/soc/nordic/common/uicr/sysbuild.cmake @@ -9,7 +9,23 @@ ExternalZephyrProject_Add( # Ensure UICR is configured and built after the default image so EDT/ELFs exist. sysbuild_add_dependencies(CONFIGURE uicr ${DEFAULT_IMAGE}) -add_dependencies(uicr ${DEFAULT_IMAGE}) -if(DEFINED image) - add_dependencies(uicr ${image}) -endif() +# Add build dependencies for all images whose ELF files may be used by gen_uicr. +# The gen_uicr/CMakeLists.txt scans all sibling build directories and adds their +# ELF files as file dependencies. However, we also need target dependencies to +# ensure those images are built before uicr attempts to use their ELF files. +# +# Use cmake_language(DEFER DIRECTORY) to ensure this runs after ALL images have +# been added to the sysbuild_images global property, even if some module adds +# images after the soc subdirectory is processed. We defer to the source root +# directory to ensure we're at the top-level scope where all subdirectories have +# completed processing. +function(uicr_add_image_dependencies) + get_property(all_images GLOBAL PROPERTY sysbuild_images) + foreach(img ${all_images}) + if(NOT img STREQUAL "uicr") + add_dependencies(uicr ${img}) + endif() + endforeach() +endfunction() + +cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL uicr_add_image_dependencies) From ec89c552276397b52eb60290a449864e9e87e50f Mon Sep 17 00:00:00 2001 From: Tommi Kangas Date: Tue, 30 Sep 2025 15:14:58 +0300 Subject: [PATCH 0135/3334] [nrf fromtree] boards: nrf9280pdk: Fix LED pins for rev. 0.2.0 with IronSide LED pins need to be set in the cpuapp/iron rev. 0.2.0 overlay. Signed-off-by: Tommi Kangas (cherry picked from commit f8f87c07520485735e1241b275fd105c1c935ce5) --- ...f9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay index f2d986e6cb06..4fa3f667eadd 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay @@ -5,3 +5,48 @@ */ #include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" + +/ { + aliases { + pwm-led0 = &pwm_led2; /* Alias for compatibility with samples that use pwm-led0 */ + }; + + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + + led1: led_1 { + gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + + led2: led_2 { + gpios = <&gpio9 2 GPIO_ACTIVE_HIGH>; + label = "Green LED 2"; + }; + + led3: led_3 { + gpios = <&gpio9 3 GPIO_ACTIVE_HIGH>; + label = "Green LED 3"; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + + /delete-node/ pwm_led_0; + + /* + * There is no valid hardware configuration to pass PWM signal on pins 0 and 1. + * First valid config is P9.2. This corresponds to LED 2. + * Signal on PWM130's channel 0 can be passed directly on GPIO Port 9 pin 2. + */ + pwm_led2: pwm_led_2 { + pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; +}; From 7627de877a810c1847b5c4da79ab62ac51b851d8 Mon Sep 17 00:00:00 2001 From: Tommi Kangas Date: Mon, 13 Oct 2025 14:40:34 +0300 Subject: [PATCH 0136/3334] [nrf fromtree] boards: nrf9280pdk: Add workaround for SoC1.1 data cache issue Added a workaround for nRF9280 SoC1.1 data cache related issue. Signed-off-by: Tommi Kangas (cherry picked from commit c01c4e9242df6cc43276c3bbc636e2775e45962d) --- .../nrf9280pdk_nrf9280-memory_map_iron.dtsi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi index aa95021d887c..d3aea1f979ae 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi @@ -16,16 +16,19 @@ / { reserved-memory { - cpuapp_cpusys_ipc_shm: memory@2f88f600 { - reg = <0x2f88f600 0x80>; + /* Workaround for a data cache related issue with SoC1.1, use secure addresses + * for cpuapp_cpusys_ipc_shm, cpusys_cpuapp_ipc_shm and cpusec_cpuapp_ipc_shm. + */ + cpuapp_cpusys_ipc_shm: memory@3f88f600 { + reg = <0x3f88f600 0x80>; }; - cpusys_cpuapp_ipc_shm: memory@2f88f680 { - reg = <0x2f88f680 0x80>; + cpusys_cpuapp_ipc_shm: memory@3f88f680 { + reg = <0x3f88f680 0x80>; }; - cpusec_cpuapp_ipc_shm: memory@2f88fb80 { - reg = <0x2f88fb80 0x80>; + cpusec_cpuapp_ipc_shm: memory@3f88fb80 { + reg = <0x3f88fb80 0x80>; }; cpuapp_ironside_se_event_report: memory@2f88fc00 { From 8acc899b51f87f6f3995db660f071d2b8bf0dd28 Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Tue, 14 Oct 2025 10:02:18 +0200 Subject: [PATCH 0137/3334] [nrf fromtree] tests: drivers: flash: Add missing fixtures for nrf54h All nrf54h flash tests require 'gpio_loopback' fixture Signed-off-by: Bartosz Miller (cherry picked from commit 4ad24ca8b9aea337594d6f43856a27df3909aa67) --- tests/drivers/flash/common/testcase.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index c2a4da0a705c..e5b0688deab3 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -177,6 +177,8 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_single_io.overlay + harness_config: + fixture: gpio_loopback drivers.flash.common.ra_qspi_nor: filter: CONFIG_FLASH_RENESAS_RA_QSPI and dt_compat_enabled("renesas,ra-qspi-nor") platform_allow: @@ -192,6 +194,8 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_single_io_4B_addr_sreset.overlay + harness_config: + fixture: gpio_loopback drivers.flash.common.mspi_low_frequency: platform_allow: - nrf54h20dk/nrf54h20/cpuapp From 25deef5205a3619f52b282e79761356a56c96f21 Mon Sep 17 00:00:00 2001 From: Bartlomiej Buczek Date: Mon, 13 Oct 2025 21:39:45 +0200 Subject: [PATCH 0138/3334] [nrf fromlist] test: drivers: flash: common: Add sfdp case for nrf54l15 tests. Add case for using flash with some parameters read with runtime sfdp instead of dt declarations. Upstream PR #: 97495 Signed-off-by: Bartlomiej Buczek (cherry picked from commit 8f74db8008cc0d34deeb13f34f427bbbaeef74d6) --- .../common/boards/nrf54l15dk_remove_dt_sfdp.overlay | 13 +++++++++++++ tests/drivers/flash/common/testcase.yaml | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/drivers/flash/common/boards/nrf54l15dk_remove_dt_sfdp.overlay diff --git a/tests/drivers/flash/common/boards/nrf54l15dk_remove_dt_sfdp.overlay b/tests/drivers/flash/common/boards/nrf54l15dk_remove_dt_sfdp.overlay new file mode 100644 index 000000000000..b6ffcf23c785 --- /dev/null +++ b/tests/drivers/flash/common/boards/nrf54l15dk_remove_dt_sfdp.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&mx25r64 { +/delete-property/ jedec-id; +/delete-property/ sfdp-bfp; +/delete-property/ has-dpd; +/delete-property/ t-enter-dpd; +/delete-property/ t-exit-dpd; +}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index e5b0688deab3..550c73ffb1d5 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -61,6 +61,17 @@ tests: - nrf54l15dk/nrf54l15/cpuapp harness_config: fixture: external_flash + drivers.flash.common.no_explicit_erase.sfdp_runtime: + platform_allow: + - nrf54l15dk/nrf54l05/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + harness_config: + fixture: external_flash + extra_configs: + - CONFIG_SPI_NOR_SFDP_RUNTIME=y + extra_args: + - DTC_OVERLAY_FILE=boards/nrf54l15dk_remove_dt_sfdp.overlay drivers.flash.common.no_explicit_erase.nrf54h: platform_allow: - nrf54h20dk/nrf54h20/cpuapp From a61d55df5af9e48836634381fd4048a999c9764f Mon Sep 17 00:00:00 2001 From: Bartlomiej Buczek Date: Mon, 13 Oct 2025 21:52:33 +0200 Subject: [PATCH 0139/3334] [nrf fromlist] samples: drivers: jesd216: add nrf54l15dk cases. Extend jesd216 sample with nrf54l15dk cases. These platforms have jesd216 compatible flash memories on board. Upstream PR #: 97495 Signed-off-by: Bartlomiej Buczek (cherry picked from commit 97ffc89b51b561355602f11dd9c91de5fc02a4a2) --- samples/drivers/jesd216/sample.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/drivers/jesd216/sample.yaml b/samples/drivers/jesd216/sample.yaml index a5b661c492ce..4fd0af6c9ca2 100644 --- a/samples/drivers/jesd216/sample.yaml +++ b/samples/drivers/jesd216/sample.yaml @@ -30,8 +30,11 @@ tests: platform_allow: nrf52840dk/nrf52840 integration_platforms: - nrf52840dk/nrf52840 - sample.drivers.jesd216.nrf54lm20: + sample.drivers.jesd216.nrf54l: platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l05/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp From 4e2fc60cc5049ca958376d57d271273a0291f932 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Wed, 1 Oct 2025 15:46:16 +0200 Subject: [PATCH 0140/3334] [nrf fromtree] devicetree: Fix MTD macro for subpartitions The DT_MTD_FROM_FIXED_SUBPARTITION must go one level more than the DT_MTD_FROM_FIXED_PARTITION counterpart. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit e4ecd4b290f98f5fde68f0ce6fea4a61a74ecf2d) --- include/zephyr/devicetree/fixed-partitions.h | 2 +- tests/lib/devicetree/api/src/main.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/zephyr/devicetree/fixed-partitions.h b/include/zephyr/devicetree/fixed-partitions.h index 14bb96bfc592..ad219ab7206f 100644 --- a/include/zephyr/devicetree/fixed-partitions.h +++ b/include/zephyr/devicetree/fixed-partitions.h @@ -160,7 +160,7 @@ extern "C" { */ #define DT_MTD_FROM_FIXED_SUBPARTITION(node_id) \ COND_CODE_1(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_SUBPARTITION(node_id)), \ - (DT_PARENT(DT_MEM_FROM_FIXED_SUBPARTITION(node_id))), (DT_GPARENT(node_id))) + (DT_PARENT(DT_MEM_FROM_FIXED_SUBPARTITION(node_id))), (DT_GPARENT(DT_PARENT(node_id)))) /** * @brief Get the absolute address of a fixed subpartition diff --git a/tests/lib/devicetree/api/src/main.c b/tests/lib/devicetree/api/src/main.c index 98189ebe582c..ab2c72750764 100644 --- a/tests/lib/devicetree/api/src/main.c +++ b/tests/lib/devicetree/api/src/main.c @@ -3312,6 +3312,9 @@ ZTEST(devicetree_api, test_fixed_subpartitions) zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION(TEST_SUBPARTITION_COMBINED))); zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_0))); zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_1))); + zassert_true(DT_SAME_NODE( + DT_MTD_FROM_FIXED_PARTITION(TEST_SUBPARTITION_COMBINED), + DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_1))); /* Test DT_FIXED_SUBPARTITION_ADDR. */ zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED), 0x20000100); From e879cb05220843e18908b21331d2146eb614738d Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 2 Oct 2025 11:17:50 +0200 Subject: [PATCH 0141/3334] [nrf fromtree] devicetree: Fix ADDRESS macro for non-nv-flash Currently the DT_FIXED_PARTITION_ADDR as well as DT_FIXED_SUBPARTITION_ADDR works only for partitions under the soc,nv-flash -compatible nodes. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 5c010ed9a31dc99ba5f955c989ee00136b89a921) --- include/zephyr/devicetree/fixed-partitions.h | 4 ++-- tests/lib/devicetree/api/src/main.c | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/zephyr/devicetree/fixed-partitions.h b/include/zephyr/devicetree/fixed-partitions.h index ad219ab7206f..ff44e07ef644 100644 --- a/include/zephyr/devicetree/fixed-partitions.h +++ b/include/zephyr/devicetree/fixed-partitions.h @@ -131,7 +131,7 @@ extern "C" { * node containing it. */ #define DT_FIXED_PARTITION_ADDR(node_id) \ - (DT_REG_ADDR(DT_MEM_FROM_FIXED_PARTITION(node_id)) + DT_REG_ADDR(node_id)) + (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(node_id))) /** * @brief Test if fixed-subpartitions compatible node exists @@ -207,7 +207,7 @@ extern "C" { * node containing it. */ #define DT_FIXED_SUBPARTITION_ADDR(node_id) \ - (DT_REG_ADDR(DT_MEM_FROM_FIXED_SUBPARTITION(node_id)) + DT_REG_ADDR(node_id)) + (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(DT_PARENT(node_id)))) /** * @} diff --git a/tests/lib/devicetree/api/src/main.c b/tests/lib/devicetree/api/src/main.c index ab2c72750764..6c154d6dd5e1 100644 --- a/tests/lib/devicetree/api/src/main.c +++ b/tests/lib/devicetree/api/src/main.c @@ -3271,13 +3271,7 @@ ZTEST(devicetree_api, test_fixed_partitions) /* Test DT_FIXED_PARTITION_ADDR. */ zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_0), 0x20000000); zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_1), 0x200000c0); - - /* DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2) expands to an invalid expression. - * Test this by way of string comparison. - */ - zassert_true(!strcmp(TO_STRING(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2)), - "(__REG_IDX_0_VAL_ADDRESSU + 458624U)")); - zassert_equal(DT_REG_ADDR(TEST_PARTITION_2), 458624); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2), 0x33291080); /* Test that all DT_FIXED_PARTITION_ID are defined and unique. */ #define FIXED_PARTITION_ID_COMMA(node_id) DT_FIXED_PARTITION_ID(node_id), From 47fb2200d27a3115468aeaf20ea44dd40dea81a5 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Tue, 30 Sep 2025 17:36:43 +0200 Subject: [PATCH 0142/3334] [nrf fromtree] storage: Allow to use subpartitions in flash_map Allow to use both partition and subpartition names when suing the flash_map API. That way it is possible to introduce a hierarchy within DTS in a backward compatible way. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 3ae8a4366785f8cedf794dbae1cb889ee4830ff3) --- include/zephyr/storage/flash_map.h | 60 ++++++++++++++++++-- subsys/storage/flash_map/flash_map_default.c | 13 +++-- 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index d8ba414abd3d..6ce33c859632 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -349,14 +349,17 @@ const char *flash_area_label(const struct flash_area *fa); uint8_t flash_area_erased_val(const struct flash_area *fa); /** - * Returns non-0 value if fixed-partition of given DTS node label exists. + * Returns non-0 value if fixed-partition or fixed-subpartition of given + * DTS node label exists. * * @param label DTS node label * * @return non-0 if fixed-partition node exists and is enabled; * 0 if node does not exist, is not enabled or is not fixed-partition. */ -#define FIXED_PARTITION_EXISTS(label) DT_FIXED_PARTITION_EXISTS(DT_NODELABEL(label)) +#define FIXED_PARTITION_EXISTS(label) \ + UTIL_OR(DT_FIXED_PARTITION_EXISTS(DT_NODELABEL(label)), \ + DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label))) /** * Get flash area ID from fixed-partition DTS node label @@ -368,7 +371,7 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); #define FIXED_PARTITION_ID(label) DT_FIXED_PARTITION_ID(DT_NODELABEL(label)) /** - * Get fixed-partition offset from DTS node label + * Get fixed-partition or fixed-subpartition offset from DTS node label * * @param label DTS node label of a partition * @@ -376,6 +379,30 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); */ #define FIXED_PARTITION_OFFSET(label) DT_REG_ADDR(DT_NODELABEL(label)) +/** + * Get fixed-partition or fixed-subpartition address from DTS node label + * + * @param label DTS node label of a partition or subpartition + * + * @return fixed-partition address, as defined for the partition in DTS. + */ +#define FIXED_PARTITION_ADDRESS(label) \ + (COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ + (DT_FIXED_SUBPARTITION_ADDR(DT_NODELABEL(label))), \ + (DT_FIXED_PARTITION_ADDR(DT_NODELABEL(label))))) + +/** + * Get fixed-partition or fixed-subpartition address from DTS node + * + * @param node DTS node of a partition + * + * @return fixed-partition address, as defined for the partition in DTS. + */ +#define FIXED_PARTITION_NODE_ADDRESS(node) \ + (COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(node), \ + (DT_FIXED_SUBPARTITION_ADDR(node)), \ + (DT_FIXED_PARTITION_ADDR(node)))) + /** * Get fixed-partition offset from DTS node * @@ -421,8 +448,10 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); * @return Pointer to a device. */ #define FIXED_PARTITION_DEVICE(label) \ - DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label))) - + DEVICE_DT_GET(COND_CODE_1( \ + DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ + (DT_MTD_FROM_FIXED_SUBPARTITION(DT_NODELABEL(label))), \ + (DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label))))) /** * Get device pointer for device the area/partition resides on * @@ -431,7 +460,10 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); * @return Pointer to a device. */ #define FIXED_PARTITION_NODE_DEVICE(node) \ - DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(node)) + DEVICE_DT_GET(COND_CODE_1( \ + DT_FIXED_SUBPARTITION_EXISTS(node), \ + (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ + (DT_MTD_FROM_FIXED_PARTITION(node)))) /** * Get pointer to flash_area object by partition label @@ -467,6 +499,22 @@ DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) #undef DECLARE_PARTITION #undef DECLARE_PARTITION_0 #undef FOR_EACH_PARTITION_TABLE + +#define FIXED_SUBPARTITION_1(node) FIXED_SUBPARTITION_0(DT_DEP_ORD(node)) +#define FIXED_SUBPARTITION_0(ord) \ + ((const struct flash_area *)&DT_CAT(global_fixed_subpartition_ORD_, ord)) + +#define DECLARE_SUBPARTITION(node) DECLARE_SUBPARTITION_0(DT_DEP_ORD(node)) +#define DECLARE_SUBPARTITION_0(ord) \ + extern const struct flash_area DT_CAT(global_fixed_subpartition_ORD_, ord); +#define FOR_EACH_SUBPARTITION_TABLE(table) DT_FOREACH_CHILD(table, DECLARE_SUBPARTITION) + +/* Generate declarations */ +DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) + +#undef DECLARE_SUBPARTITION +#undef DECLARE_SUBPARTITION_0 +#undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ #ifdef __cplusplus diff --git a/subsys/storage/flash_map/flash_map_default.c b/subsys/storage/flash_map/flash_map_default.c index c0514d28a12c..6b1edfbbaef5 100644 --- a/subsys/storage/flash_map/flash_map_default.c +++ b/subsys/storage/flash_map/flash_map_default.c @@ -40,6 +40,7 @@ */ const struct flash_area default_flash_map[] = { DT_FOREACH_STATUS_OKAY(fixed_partitions, FOREACH_PARTITION) + DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOREACH_PARTITION) }; const int flash_map_entries = ARRAY_SIZE(default_flash_map); @@ -63,11 +64,11 @@ const struct flash_area *flash_map = default_flash_map; #define FOR_EACH_PARTITION_TABLE(table) DT_FOREACH_CHILD(table, DEFINE_PARTITION) DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) -#define DEFINE_SUB_PARTITION(part) DEFINE_SUB_PARTITION_1(part, DT_DEP_ORD(part)) -#define DEFINE_SUB_PARTITION_1(part, ord) \ +#define DEFINE_SUBPARTITION(part) DEFINE_SUBPARTITION_1(part, DT_DEP_ORD(part)) +#define DEFINE_SUBPARTITION_1(part, ord) \ COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(DT_MTD_FROM_FIXED_SUBPARTITION(part)), \ - (DEFINE_SUB_PARTITION_0(part, ord)), ()) -#define DEFINE_SUB_PARTITION_0(part, ord) \ + (DEFINE_SUBPARTITION_0(part, ord)), ()) +#define DEFINE_SUBPARTITION_0(part, ord) \ const struct flash_area DT_CAT(global_fixed_subpartition_ORD_, ord) = { \ .fa_id = DT_FIXED_PARTITION_ID(part), \ .fa_off = DT_REG_ADDR(part), \ @@ -75,5 +76,5 @@ DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) .fa_size = DT_REG_SIZE(part), \ }; -#define FOR_EACH_SUB_PARTITION_TABLE(table) DT_FOREACH_CHILD(table, DEFINE_SUB_PARTITION) -DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUB_PARTITION_TABLE) +#define FOR_EACH_SUBPARTITION_TABLE(table) DT_FOREACH_CHILD(table, DEFINE_SUBPARTITION) +DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) From 8126a9b889bbb8a07dfbe742cd71c624595fb0a9 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Fri, 17 Oct 2025 13:16:18 +0200 Subject: [PATCH 0143/3334] [nrf fromlist] boards: nordic: nrf54h: fix pm_ramfunc region Fix region for PM ram function on radiocore. Upstream PR #: 97792 Signed-off-by: Adam Kondraciuk (cherry picked from commit f5610788e7be3f357b56700d2b797c83d026b025) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index fd5ad106117b..d5fea020431f 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -130,7 +130,7 @@ zephyr_udc0: &usbhs { /* cache control functions - must be executed from RAM */ pm_ramfunc: cpurad_s2ram@2302ff40 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2302ff80 192>; + reg = <0x2302ff40 192>; zephyr,memory-region = "PMLocalRamfunc"; }; }; From 47813359a087fbfa71f5b25d6c967ccc641c8747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 15 Oct 2025 08:15:02 +0200 Subject: [PATCH 0144/3334] [nrf fromtree] tests: boards: nrf: hwinfo: Add latest reset causes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reset cause API was expanded with two more reset causes. These are RESET_BOOTLOADER and RESET_FLASH. Add handling of RESET_BOOTLOADER and RESET_FLASH to reset_cause test. Signed-off-by: Sebastian Głąb (cherry picked from commit 9ff2c0ff9d48e1f91023fab3e1151955c7f85166) --- tests/boards/nrf/hwinfo/reset_cause/src/main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/boards/nrf/hwinfo/reset_cause/src/main.c b/tests/boards/nrf/hwinfo/reset_cause/src/main.c index 7df98bce9bc1..4e4e3a1c5d44 100644 --- a/tests/boards/nrf/hwinfo/reset_cause/src/main.c +++ b/tests/boards/nrf/hwinfo/reset_cause/src/main.c @@ -134,6 +134,16 @@ static void print_supported_reset_cause(void) } else { LOG_INF("14: no support for RESET_TEMPERATURE"); } + if (supported & RESET_BOOTLOADER) { + LOG_INF("15: RESET_BOOTLOADER is supported"); + } else { + LOG_INF("15: no support for RESET_BOOTLOADER"); + } + if (supported & RESET_FLASH) { + LOG_INF("16: RESET_FLASH is supported"); + } else { + LOG_INF("16: no support for RESET_FLASH"); + } } else if (ret == -ENOSYS) { LOG_INF("hwinfo_get_supported_reset_cause() is NOT supported"); supported = 0; @@ -197,6 +207,12 @@ static void print_current_reset_cause(uint32_t *cause) if (*cause & RESET_TEMPERATURE) { LOG_INF("14: reset due to RESET_TEMPERATURE"); } + if (*cause & RESET_BOOTLOADER) { + LOG_INF("15: reset due to RESET_BOOTLOADER"); + } + if (*cause & RESET_FLASH) { + LOG_INF("16: reset due to RESET_FLASH"); + } } else if (ret == -ENOSYS) { LOG_INF("hwinfo_get_reset_cause() is NOT supported"); *cause = 0; From 29396df89dbb54904ba9a79ca29dbf40d9fee11f Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 7 Oct 2025 11:15:32 +0200 Subject: [PATCH 0145/3334] [nrf fromtree] cmake: define linker argument for undefined symbol Specifying undefined symbol on linker invocation requests the linker to search and include the symbol. This ensures the symbol will be present in final output. Signed-off-by: Torsten Rasmussen (cherry picked from commit 428279ef412c095070b4c426661b33eb06eba7b2) --- arch/common/CMakeLists.txt | 3 +++ cmake/linker/arcmwdt/linker_flags.cmake | 2 ++ cmake/linker/armlink/linker_flags.cmake | 5 +++++ cmake/linker/iar/linker_flags.cmake | 1 + cmake/linker/ld/linker_flags.cmake | 2 ++ cmake/linker/xt-ld/linker_flags.cmake | 6 ++++-- 6 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 cmake/linker/armlink/linker_flags.cmake diff --git a/arch/common/CMakeLists.txt b/arch/common/CMakeLists.txt index d817afa3d7fe..a764235130ed 100644 --- a/arch/common/CMakeLists.txt +++ b/arch/common/CMakeLists.txt @@ -109,6 +109,9 @@ if (CONFIG_GEN_ISR_TABLES) add_dependencies(isr_tables zephyr_generated_headers) target_link_libraries(isr_tables zephyr_interface) zephyr_library_link_libraries(isr_tables) + + zephyr_link_libraries($_sw_isr_table) + zephyr_link_libraries($_irq_vector_table) endif() if(CONFIG_COVERAGE) diff --git a/cmake/linker/arcmwdt/linker_flags.cmake b/cmake/linker/arcmwdt/linker_flags.cmake index 32c6cb9dd660..e2984268d9db 100644 --- a/cmake/linker/arcmwdt/linker_flags.cmake +++ b/cmake/linker/arcmwdt/linker_flags.cmake @@ -41,6 +41,8 @@ check_set_linker_property(TARGET linker PROPERTY orphan_error ${LINKERFLAGPREFIX},--orphan-handling=error ) +check_set_linker_property(TARGET linker PROPERTY undefined ${LINKERFLAGPREFIX},-u) + set_property(TARGET linker PROPERTY partial_linking "-r") # Extra warnings options for twister run diff --git a/cmake/linker/armlink/linker_flags.cmake b/cmake/linker/armlink/linker_flags.cmake new file mode 100644 index 000000000000..207f83246a8f --- /dev/null +++ b/cmake/linker/armlink/linker_flags.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Nordic Semiconductor +# +# SPDX-License-Identifier: Apache-2.0 + +set_property(TARGET linker PROPERTY undefined --undefined=) diff --git a/cmake/linker/iar/linker_flags.cmake b/cmake/linker/iar/linker_flags.cmake index 12d44ca24cd2..cdfc3a8e9a5a 100644 --- a/cmake/linker/iar/linker_flags.cmake +++ b/cmake/linker/iar/linker_flags.cmake @@ -23,6 +23,7 @@ set_property(TARGET linker PROPERTY optimization_speed --entry_list_in_address_o set_property(TARGET linker PROPERTY optimization_size --entry_list_in_address_order) set_property(TARGET linker PROPERTY optimization_size_aggressive --entry_list_in_address_order) +set_linker_property(TARGET linker PROPERTY undefined "--keep=") string(APPEND CMAKE_C_LINK_FLAGS --no-wrap-diagnostics) diff --git a/cmake/linker/ld/linker_flags.cmake b/cmake/linker/ld/linker_flags.cmake index 885a1844cc5d..33e5cd59322d 100644 --- a/cmake/linker/ld/linker_flags.cmake +++ b/cmake/linker/ld/linker_flags.cmake @@ -22,6 +22,8 @@ check_set_linker_property(TARGET linker PROPERTY orphan_error ${LINKERFLAGPREFIX},--orphan-handling=error ) +set_property(TARGET linker PROPERTY undefined ${LINKERFLAGPREFIX},--undefined=) + check_set_linker_property(TARGET linker PROPERTY memusage "${LINKERFLAGPREFIX},--print-memory-usage") check_set_linker_property(TARGET linker PROPERTY sanitizer_undefined -fsanitize=undefined) diff --git a/cmake/linker/xt-ld/linker_flags.cmake b/cmake/linker/xt-ld/linker_flags.cmake index ab66461e4522..535d76ecf650 100644 --- a/cmake/linker/xt-ld/linker_flags.cmake +++ b/cmake/linker/xt-ld/linker_flags.cmake @@ -19,11 +19,11 @@ check_set_linker_property(TARGET linker PROPERTY baremetal ) check_set_linker_property(TARGET linker PROPERTY orphan_warning - ${LINKERFLAGPREFIX},--orphan-handling=warn + ${LINKERFLAGPREFIX},--orphan-handling=warn ) check_set_linker_property(TARGET linker PROPERTY orphan_error - ${LINKERFLAGPREFIX},--orphan-handling=error + ${LINKERFLAGPREFIX},--orphan-handling=error ) set_property(TARGET linker PROPERTY partial_linking "-r") @@ -34,3 +34,5 @@ check_set_linker_property(TARGET linker PROPERTY sort_alignment ${LINKERFLAGPREFIX},--sort-common=descending ${LINKERFLAGPREFIX},--sort-section=alignment ) + +set_property(TARGET linker PROPERTY undefined ${LINKERFLAGPREFIX},--undefined=) From 4b8157419b8a04ae7801370986d89c0086a03ca5 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 2 Oct 2025 16:55:47 +0200 Subject: [PATCH 0146/3334] [nrf fromtree] soc: Move to the app-specific partitions Use cpuapp_slot_partition instead of slot0_partition, so it is possible to add MCUboot header through --pad-header option. In such cases, the FLASH_LOAD_OFFSET does not point to the begining of the slot, but to the beginning of the executable area, thus the check for the active slot should use ranges instead of exact values. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 14af1654d1b4bbf537eabee4ae36789f7cc17c83) --- soc/nordic/nrf54h/soc.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 8493aa03bc34..e6ae033b0cd0 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -35,6 +35,12 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #define HSFLL_NODE DT_NODELABEL(cpurad_hsfll) #endif +#define FIXED_PARTITION_ADDRESS(label) \ + (DT_REG_ADDR(DT_NODELABEL(label)) + \ + DT_REG_ADDR(COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ + (DT_GPARENT(DT_PARENT(DT_NODELABEL(label)))), \ + (DT_GPARENT(DT_NODELABEL(label)))))) + #ifdef CONFIG_USE_DT_CODE_PARTITION #define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) #elif defined(CONFIG_FLASH_LOAD_OFFSET) @@ -42,7 +48,8 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #endif #define PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (DT_REG_ADDR(DT_NODELABEL(label)) == FLASH_LOAD_OFFSET) + (DT_REG_ADDR(DT_NODELABEL(label)) <= FLASH_LOAD_OFFSET && \ + DT_REG_ADDR(DT_NODELABEL(label)) + DT_REG_SIZE(DT_NODELABEL(label)) > FLASH_LOAD_OFFSET) sys_snode_t soc_node; @@ -191,22 +198,16 @@ void soc_late_init_hook(void) void *radiocore_address = NULL; #if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) - if (PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) { - radiocore_address = - (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot1_partition))) + - DT_REG_ADDR(DT_NODELABEL(cpurad_slot1_partition)) + - CONFIG_ROM_START_OFFSET); + if (PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition) + + CONFIG_ROM_START_OFFSET); } else { - radiocore_address = - (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) + - DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + - CONFIG_ROM_START_OFFSET); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + + CONFIG_ROM_START_OFFSET); } #else radiocore_address = - (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) + - DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + - CONFIG_ROM_START_OFFSET); + (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + CONFIG_ROM_START_OFFSET); #endif if (IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR) && From 6c67604fa7fd9e69463b2b2be36a9dc5052e03f4 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 2 Oct 2025 16:58:19 +0200 Subject: [PATCH 0147/3334] [nrf fromtree] dfu: Allow to use imgtool-based headers It is possible to add MCUboot header through --pad-header option. In such cases, the FLASH_LOAD_OFFSET does not point to the beginning of the slot, but to the beginning of the executable area, thus the check for the active slot should use ranges instead of exact values. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 32615695ad1b96670be8f2a38a8a9fd27e2d8ae5) --- subsys/dfu/img_util/flash_img.c | 5 +++-- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 5 +++-- tests/subsys/dfu/img_util/src/main.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index 83eb013c6612..24e95a8dc1a9 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -23,8 +23,9 @@ LOG_MODULE_REGISTER(flash_img, CONFIG_IMG_MANAGER_LOG_LEVEL); #include #endif -#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (FIXED_PARTITION_OFFSET(label) == CONFIG_FLASH_LOAD_OFFSET) +#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ + FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) #include #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && (CONFIG_TFM_MCUBOOT_IMAGE_NUMBER == 2) 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 7abcac8afad5..a2bf006b9474 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -48,8 +48,9 @@ to be able to figure out application running slot. #endif -#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (FIXED_PARTITION_OFFSET(label) == CONFIG_FLASH_LOAD_OFFSET) +#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ + FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) BUILD_ASSERT(sizeof(struct image_header) == IMAGE_HEADER_SIZE, "struct image_header not required size"); diff --git a/tests/subsys/dfu/img_util/src/main.c b/tests/subsys/dfu/img_util/src/main.c index dc7c46721267..33956be6251e 100644 --- a/tests/subsys/dfu/img_util/src/main.c +++ b/tests/subsys/dfu/img_util/src/main.c @@ -12,8 +12,9 @@ #define SLOT0_PARTITION slot0_partition #define SLOT1_PARTITION slot1_partition -#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (FIXED_PARTITION_OFFSET(label) == CONFIG_FLASH_LOAD_OFFSET) +#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ + FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) #if FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot0_partition) #define UPLOAD_PARTITION_ID FIXED_PARTITION_ID(SLOT1_PARTITION) From d96928774c5e3cab5cca6c8ce5ab62d04d893425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 13 Oct 2025 09:10:18 +0200 Subject: [PATCH 0148/3334] [nrf fromtree] dts: bindings: mspi-controller: Add "packet-data-limit" property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a property with which MSPI controllers can indicate their limits on the maximum amount of data they can transfer in one packet. Use the property for the SSI controller, for which the clock stretching feature requires the use of the NDF field of the CTRLR1 register, which is 16-bit wide, hence the data length limit is 64 kB. Signed-off-by: Andrzej Głąbek (cherry picked from commit b42a33d49f3a009f1bd2f8797b6f107276f01b34) --- dts/bindings/mspi/mspi-controller.yaml | 8 ++++++++ dts/bindings/mspi/snps,designware-ssi.yaml | 4 ++++ dts/vendor/nordic/nrf54h20.dtsi | 1 + dts/vendor/nordic/nrf9280.dtsi | 1 + 4 files changed, 14 insertions(+) diff --git a/dts/bindings/mspi/mspi-controller.yaml b/dts/bindings/mspi/mspi-controller.yaml index 0f574c12153e..6f22d0dc0bf2 100644 --- a/dts/bindings/mspi/mspi-controller.yaml +++ b/dts/bindings/mspi/mspi-controller.yaml @@ -92,3 +92,11 @@ properties: Regardless of whether the CE pin may need software control or MSPI controller has dedicated CE pin, this field should be defined to help manage multiple devices on the same MSPI controller. + + packet-data-limit: + type: int + description: | + Specifies the maximum length of data that the controller can transfer + in a single packet. Transceive requests made to the controller must be + split into multiple packets if a single one would exceed this value. + If not specified, no limit is imposed. diff --git a/dts/bindings/mspi/snps,designware-ssi.yaml b/dts/bindings/mspi/snps,designware-ssi.yaml index fb516cb78358..69a2947f9efb 100644 --- a/dts/bindings/mspi/snps,designware-ssi.yaml +++ b/dts/bindings/mspi/snps,designware-ssi.yaml @@ -14,6 +14,10 @@ properties: interrupts: required: true + packet-data-limit: + required: true + const: 65536 + aux-reg-enable: type: boolean description: | diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 62ab535006bd..ddbf255e936b 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -640,6 +640,7 @@ interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; power-domains = <&gdpwr_fast_active_0>; clock-frequency = ; + packet-data-limit = <65536>; fifo-depth = <32>; status = "disabled"; }; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index fb27488e9dc4..791cd7d4c663 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -384,6 +384,7 @@ reg-names = "wrapper", "core"; interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; clock-frequency = ; + packet-data-limit = <65536>; fifo-depth = <32>; status = "disabled"; }; From 0e2635ce9ce8f1842948011413166d59aeb9b4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 13 Oct 2025 09:21:48 +0200 Subject: [PATCH 0149/3334] [nrf fromtree] drivers: flash_mspi_nor: Take into account MSPI controller packet limit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use information provided in the dts node for the MSPI controller regarding maximum amount of data that can be transferred in one packet and split the requested transfers if necessary. Signed-off-by: Andrzej Głąbek (cherry picked from commit c3469a6764cbacc1705006581e67ce694ce09140) --- drivers/flash/flash_mspi_nor.c | 35 +++++++++++++++++++++++++++++----- drivers/flash/flash_mspi_nor.h | 1 + 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 03430401de0c..444509b695b5 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -336,6 +336,7 @@ static uint8_t get_rx_dummy(const struct device *dev) static int api_read(const struct device *dev, off_t addr, void *dest, size_t size) { + const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const uint32_t flash_size = dev_flash_size(dev); int rc; @@ -353,11 +354,26 @@ static int api_read(const struct device *dev, off_t addr, void *dest, return rc; } - set_up_xfer_with_addr(dev, MSPI_RX, addr); - dev_data->xfer.rx_dummy = get_rx_dummy(dev); - dev_data->packet.data_buf = dest; - dev_data->packet.num_bytes = size; - rc = perform_xfer(dev, dev_data->cmd_info.read_cmd, true); + while (size > 0) { + uint32_t to_read; + + if (dev_config->packet_data_limit && + dev_config->packet_data_limit < size) { + to_read = dev_config->packet_data_limit; + } else { + to_read = size; + } + + set_up_xfer_with_addr(dev, MSPI_RX, addr); + dev_data->xfer.rx_dummy = get_rx_dummy(dev); + dev_data->packet.data_buf = dest; + dev_data->packet.num_bytes = to_read; + rc = perform_xfer(dev, dev_data->cmd_info.read_cmd, true); + + addr += to_read; + dest = (uint8_t *)dest + to_read; + size -= to_read; + } release(dev); @@ -1294,13 +1310,22 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ #define INIT_PRIORITY UTIL_INC(CONFIG_MSPI_INIT_PRIORITY) #endif +#define PACKET_DATA_LIMIT(inst) \ + DT_PROP_OR(DT_INST_BUS(inst), packet_data_limit, 0) + #define FLASH_MSPI_NOR_INST(inst) \ + BUILD_ASSERT(!PACKET_DATA_LIMIT(inst) || \ + FLASH_PAGE_SIZE(inst) <= PACKET_DATA_LIMIT(inst), \ + "Page size for " DT_NODE_FULL_NAME(DT_DRV_INST(inst)) \ + " exceeds controller packet data limit"); \ SFDP_BUILD_ASSERTS(inst); \ PM_DEVICE_DT_INST_DEFINE(inst, dev_pm_action_cb); \ DEFAULT_ERASE_TYPES_DEFINE(inst); \ static struct flash_mspi_nor_data dev##inst##_data; \ static const struct flash_mspi_nor_config dev##inst##_config = { \ .bus = DEVICE_DT_GET(DT_INST_BUS(inst)), \ + .packet_data_limit = DT_PROP_OR(DT_INST_BUS(inst), \ + packet_data_limit, 0), \ .flash_size = FLASH_SIZE(inst), \ .page_size = FLASH_PAGE_SIZE(inst), \ .mspi_id = MSPI_DEVICE_ID_DT_INST(inst), \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 86c824cf4856..335af449b261 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -70,6 +70,7 @@ struct flash_mspi_nor_switch_info { struct flash_mspi_nor_config { const struct device *bus; + uint32_t packet_data_limit; uint32_t flash_size; uint16_t page_size; struct mspi_dev_id mspi_id; From ebb84d10514478a44aebbdab1f9506741923468a Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Thu, 9 Oct 2025 16:32:27 +0200 Subject: [PATCH 0150/3334] [nrf fromlist] tests: secure_storage: Exclude nRF54H20 targets Exclude the application and radio core targets for nRF54H20 since they use Ironside as their PSA storage provider. Upstream PR #: 96915 Signed-off-by: Georgios Vasilakis (cherry picked from commit 856d9e081ac325a00bc076b61c5133d1d82ba20b) --- tests/subsys/secure_storage/psa/crypto/testcase.yaml | 3 +++ tests/subsys/secure_storage/psa/its/testcase.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tests/subsys/secure_storage/psa/crypto/testcase.yaml b/tests/subsys/secure_storage/psa/crypto/testcase.yaml index 1482d23cb6c7..150177b8e3fc 100644 --- a/tests/subsys/secure_storage/psa/crypto/testcase.yaml +++ b/tests/subsys/secure_storage/psa/crypto/testcase.yaml @@ -1,6 +1,9 @@ common: tags: - psa.secure_storage + platform_exclude: + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad tests: secure_storage.psa.crypto.secure_storage: filter: CONFIG_SECURE_STORAGE and not CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index 75950a798143..6b244a065b65 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -4,6 +4,8 @@ common: - nrf54l15dk/nrf54l15/cpuapp platform_exclude: - qemu_cortex_m0 # settings subsystem initialization fails + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad timeout: 600 tags: - psa.secure_storage From 22f2f13bdbac902e57885fee66a64e1e0cca9b2d Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Tue, 23 Sep 2025 11:35:34 +0200 Subject: [PATCH 0151/3334] [nrf fromtree] modules: openthread: fix dependency for OPENTHREAD_CRYPTO_PSA The dependency should be PSA_CRYPTO_CLIENT and not MBEDTLS_PSA_CRYPTO_CLIENT because the former is more generic. TF-M can indeed provide PSA Crypto API, not only Mbed TLS. Signed-off-by: Valerio Setti (cherry picked from commit 46614ded36f099e0b5327c7df9967fdb75ada38b) --- modules/openthread/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openthread/Kconfig b/modules/openthread/Kconfig index 99a90633f13a..afbc479b4fdd 100644 --- a/modules/openthread/Kconfig +++ b/modules/openthread/Kconfig @@ -320,7 +320,7 @@ config OPENTHREAD_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE config OPENTHREAD_CRYPTO_PSA bool "ARM PSA crypto API" - depends on MBEDTLS_PSA_CRYPTO_CLIENT + depends on PSA_CRYPTO_CLIENT select OPENTHREAD_PLATFORM_KEY_REF if !OPENTHREAD_COPROCESSOR_RCP imply OPENTHREAD_PLATFORM_KEYS_EXPORTABLE_ENABLE help From fc2da8b2b1a5e2a7a6c2977e8448c1792fda26be Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Wed, 1 Oct 2025 00:51:44 +0200 Subject: [PATCH 0152/3334] [nrf fromtree] drivers: bluetooth: esp32: remove selection of MBEDTLS_PSA_CRYPTO_C The driver code only relies on legacy Mbed TLS crypto, not on PSA API, so enabling MBEDTLS_PSA_CRYPTO_C is not needed here. Signed-off-by: Valerio Setti (cherry picked from commit 76037cec36554184a4ca82ffef4d4ba3bc61666e) --- drivers/bluetooth/hci/Kconfig.esp32 | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/bluetooth/hci/Kconfig.esp32 b/drivers/bluetooth/hci/Kconfig.esp32 index 9f363ebc700f..501c5238db79 100644 --- a/drivers/bluetooth/hci/Kconfig.esp32 +++ b/drivers/bluetooth/hci/Kconfig.esp32 @@ -492,7 +492,6 @@ config ESP32_BT_LE_CRYPTO_STACK_MBEDTLS select MBEDTLS_ECP_DP_SECP256R1_ENABLED select MBEDTLS_ECDH_C select MBEDTLS_ENTROPY_C - select MBEDTLS_PSA_CRYPTO_C help Use mbedTLS library for BLE cryptographic operations. From c6f4831daf88f9b71d2b63bbd0eebccbf776595a Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Wed, 1 Oct 2025 00:58:16 +0200 Subject: [PATCH 0153/3334] [nrf fromtree] drivers: bluetooth: hci: do not select MBEDTLS_ENTROPY_C in BT_SILABS_EFR32 The driver only uses psa_generate_random() so ENTROPY_C is not required. Signed-off-by: Valerio Setti (cherry picked from commit 7b7b4fcde20c247279bcb51b64565ce4b37c2146) --- drivers/bluetooth/hci/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index f1d1939259dc..ba218d731609 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -160,7 +160,6 @@ config BT_SILABS_EFR32 select SOC_GECKO_USE_RAIL select MBEDTLS select MBEDTLS_PSA_CRYPTO_C - select MBEDTLS_ENTROPY_C select HAS_BT_CTLR select BT_CTLR_PHY_UPDATE_SUPPORT select BT_CTLR_PER_INIT_FEAT_XCHG_SUPPORT From 5ee2298ed3dc1006bf7e55c4245f1436334ba86d Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Tue, 23 Sep 2025 11:31:29 +0200 Subject: [PATCH 0154/3334] [nrf fromtree] modules: mbedtls: add new helper Kconfig symbol PSA_CRYPTO The goal of new Kconfig PSA_CRYPTO_PROVIDER is to automatically enable any of the PSA Crypto API provider available for the platform without having the user to manually pick the proper one. This provider can be either TF-M, if that's enabled in the build, or Mbed TLS otherwise. PSA_CRYPTO_PROVIDER simplifies also modules/subsystem Kconfigs removing blocks as: select MBEDTLS if !BUILD_WITH_TFM select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM Kconfig PSA_CRYPTO_PROVIDER_CUSTOM is also added to allow the end user to add a custom implementation of PSA Crypto API instead of TF-M or Mbed TLS ones. Signed-off-by: Valerio Setti (cherry picked from commit 1bc2db575f7eb88426f5c239877cbce9f6950ba7) --- drivers/bluetooth/hci/Kconfig | 3 +- modules/hostap/Kconfig | 2 +- modules/mbedtls/Kconfig.psa.logic | 33 +++++++++++++++++-- modules/uoscore-uedhoc/Kconfig | 4 +-- samples/net/sockets/http_server/Kconfig | 2 +- .../subsys/mgmt/updatehub/overlay-psa.conf | 3 +- subsys/bluetooth/crypto/Kconfig | 3 +- subsys/bluetooth/host/Kconfig | 6 ++-- subsys/jwt/Kconfig | 6 ++-- .../host/gatt/caching/psa_overlay.conf | 3 +- tests/bsim/bluetooth/ll/conn/psa_overlay.conf | 3 +- 11 files changed, 43 insertions(+), 25 deletions(-) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index ba218d731609..92f4d4fa3d71 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -158,8 +158,7 @@ config BT_SILABS_EFR32 depends on ZEPHYR_HAL_SILABS_MODULE_BLOBS || BUILD_ONLY_NO_BLOBS depends on !PM || SOC_GECKO_PM_BACKEND_PMGR select SOC_GECKO_USE_RAIL - select MBEDTLS - select MBEDTLS_PSA_CRYPTO_C + select PSA_CRYPTO select HAS_BT_CTLR select BT_CTLR_PHY_UPDATE_SUPPORT select BT_CTLR_PER_INIT_FEAT_XCHG_SUPPORT diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index aa6d5d8689f6..1aa21670bb71 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -204,7 +204,7 @@ endchoice config WIFI_NM_WPA_SUPPLICANT_CRYPTO_MBEDTLS_PSA bool "Crypto Platform Secure Architecture support for WiFi" - imply MBEDTLS_PSA_CRYPTO_C + select PSA_CRYPTO select MBEDTLS_USE_PSA_CRYPTO select PSA_WANT_ALG_ECDH select PSA_WANT_ALG_HMAC diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index dcea9e354052..972054e105b0 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -1,8 +1,37 @@ # Copyright (c) 2024 BayLibre SAS # SPDX-License-Identifier: Apache-2.0 -# This file extends Kconfig.psa (which is automatically generated) by adding -# some logic between PSA_WANT symbols. +config PSA_CRYPTO + bool "PSA Crypto API" + help + Enable a PSA Crypto API provider in the build. If TF-M is enabled then + it will be used for this scope, otherwise Mbed TLS will be used. + PSA_CRYPTO_PROVIDER_CUSTOM can be selected to use an out-of-tree + implementation. + +choice PSA_CRYPTO_PROVIDER + prompt "PSA Crypto API provider" + depends on PSA_CRYPTO + +config PSA_CRYPTO_PROVIDER_TFM + bool "Use TF-M" + depends on BUILD_WITH_TFM + select TFM_PARTITION_CRYPTO + +config PSA_CRYPTO_PROVIDER_MBEDTLS + bool "Use Mbed TLS" + depends on !BUILD_WITH_TFM + select MBEDTLS + select MBEDTLS_PSA_CRYPTO_C + +config PSA_CRYPTO_PROVIDER_CUSTOM + bool "Use an out-of-tree library" + depends on !BUILD_WITH_TFM + +endchoice # PSA_CRYPTO_PROVIDER + +# The following section extends Kconfig.psa.auto (which is automatically +# generated) by adding some logic between PSA_WANT symbols. config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC bool diff --git a/modules/uoscore-uedhoc/Kconfig b/modules/uoscore-uedhoc/Kconfig index 06eaecd7b210..766249553188 100644 --- a/modules/uoscore-uedhoc/Kconfig +++ b/modules/uoscore-uedhoc/Kconfig @@ -5,7 +5,6 @@ menuconfig UOSCORE bool "UOSCORE library" depends on ZCBOR depends on ZCBOR_CANONICAL - depends on MBEDTLS select UOSCORE_UEDHOC_CRYPTO_COMMON help @@ -22,7 +21,6 @@ menuconfig UEDHOC bool "UEDHOC library" depends on ZCBOR depends on ZCBOR_CANONICAL - depends on MBEDTLS select UOSCORE_UEDHOC_CRYPTO_COMMON help This option enables the UEDHOC library. @@ -38,7 +36,7 @@ if UOSCORE || UEDHOC config UOSCORE_UEDHOC_CRYPTO_COMMON bool - imply MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM + select PSA_CRYPTO select PSA_WANT_ALG_ECDH select PSA_WANT_ALG_ECDSA select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT diff --git a/samples/net/sockets/http_server/Kconfig b/samples/net/sockets/http_server/Kconfig index 2f607259dfaa..07d5b26e52d5 100644 --- a/samples/net/sockets/http_server/Kconfig +++ b/samples/net/sockets/http_server/Kconfig @@ -17,7 +17,7 @@ config NET_SAMPLE_HTTP_SERVER_SERVICE_PORT config NET_SAMPLE_HTTPS_SERVICE bool "Enable https service" depends on NET_SOCKETS_SOCKOPT_TLS || TLS_CREDENTIALS - imply MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM + select PSA_CRYPTO if NET_SAMPLE_HTTPS_SERVICE diff --git a/samples/subsys/mgmt/updatehub/overlay-psa.conf b/samples/subsys/mgmt/updatehub/overlay-psa.conf index 4b5dcfd9af67..8a70becc92d3 100644 --- a/samples/subsys/mgmt/updatehub/overlay-psa.conf +++ b/samples/subsys/mgmt/updatehub/overlay-psa.conf @@ -1,3 +1,2 @@ CONFIG_FLASH_AREA_CHECK_INTEGRITY_PSA=y -CONFIG_MBEDTLS=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_PSA_CRYPTO=y diff --git a/subsys/bluetooth/crypto/Kconfig b/subsys/bluetooth/crypto/Kconfig index 0856daf9d9a5..e9234e4157b3 100644 --- a/subsys/bluetooth/crypto/Kconfig +++ b/subsys/bluetooth/crypto/Kconfig @@ -3,8 +3,7 @@ config BT_CRYPTO bool - select MBEDTLS if !BUILD_WITH_TFM - select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM + select PSA_CRYPTO select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_CMAC select PSA_WANT_ALG_ECB_NO_PADDING diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 72deb4343dc4..e89ca2bce919 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -200,8 +200,7 @@ config BT_BUF_EVT_DISCARDABLE_COUNT config BT_HOST_CRYPTO bool "Use crypto functionality implemented in the Bluetooth host" default y if !BT_CTLR_CRYPTO - select MBEDTLS if !BUILD_WITH_TFM - select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM + select PSA_CRYPTO select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_ECB_NO_PADDING help @@ -1023,8 +1022,7 @@ endif # BT_DF config BT_ECC bool - select MBEDTLS if !BUILD_WITH_TFM - select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM + select PSA_CRYPTO select PSA_WANT_ALG_ECDH select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT diff --git a/subsys/jwt/Kconfig b/subsys/jwt/Kconfig index 052908a77754..c1cafcc829cf 100644 --- a/subsys/jwt/Kconfig +++ b/subsys/jwt/Kconfig @@ -28,8 +28,7 @@ config JWT_SIGN_RSA_LEGACY config JWT_SIGN_RSA_PSA bool "Use RSA signature (RS-256). Use PSA Crypto API." - select MBEDTLS if !BUILD_WITH_TFM - select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM + select PSA_CRYPTO select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT select PSA_WANT_ALG_RSA_PKCS1V15_SIGN @@ -37,8 +36,7 @@ config JWT_SIGN_RSA_PSA config JWT_SIGN_ECDSA_PSA bool "Use ECDSA signature (ES-256). Use PSA Crypto API." - select MBEDTLS if !BUILD_WITH_TFM - select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM + select PSA_CRYPTO select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT select PSA_WANT_ALG_ECDSA select PSA_WANT_ECC_SECP_R1_256 diff --git a/tests/bsim/bluetooth/host/gatt/caching/psa_overlay.conf b/tests/bsim/bluetooth/host/gatt/caching/psa_overlay.conf index b836ab2c23b2..bc7c220f62f6 100644 --- a/tests/bsim/bluetooth/host/gatt/caching/psa_overlay.conf +++ b/tests/bsim/bluetooth/host/gatt/caching/psa_overlay.conf @@ -1,3 +1,2 @@ -CONFIG_MBEDTLS=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_PSA_CRYPTO=y CONFIG_PSA_CRYPTO_ENABLE_ALL=y diff --git a/tests/bsim/bluetooth/ll/conn/psa_overlay.conf b/tests/bsim/bluetooth/ll/conn/psa_overlay.conf index b836ab2c23b2..bc7c220f62f6 100644 --- a/tests/bsim/bluetooth/ll/conn/psa_overlay.conf +++ b/tests/bsim/bluetooth/ll/conn/psa_overlay.conf @@ -1,3 +1,2 @@ -CONFIG_MBEDTLS=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_PSA_CRYPTO=y CONFIG_PSA_CRYPTO_ENABLE_ALL=y From fde8ab3bbd32097b6675a725f8e99837a85c9fb4 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 29 Sep 2025 09:06:40 +0200 Subject: [PATCH 0155/3334] [nrf fromtree] soc: nordic: nrf54h: increase default log stack size if CONFIG_PM=y The default log process thread stack size needs to be increased to account for the recursion into resuming power domains, which may happen within char_out for some backends like uart. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 804134f28c61e0d5dfabd6155de3e6764aae419f) --- soc/nordic/nrf54h/Kconfig.defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/soc/nordic/nrf54h/Kconfig.defconfig b/soc/nordic/nrf54h/Kconfig.defconfig index a1b7961f3007..3e4c61810984 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig +++ b/soc/nordic/nrf54h/Kconfig.defconfig @@ -40,6 +40,13 @@ if PM config PM_DEVICE default y +if LOG + +config LOG_PROCESS_THREAD_STACK_SIZE + default 1536 + +endif # LOG + endif # PM if PM_DEVICE From e3e4ef816feb419ab60f8e6e6cda867c2f2bf06d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 29 Sep 2025 11:46:50 +0200 Subject: [PATCH 0156/3334] [nrf fromtree] drivers: adc: nrfx_saadc: implement PM device runtime The NRFX SAADC device driver needs to implement PM DEVICE for it to work with power domains, which is required for some SoCs. Inline PM device runtime "self get/put" pm has been implemented for the normal sync read API. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 5fd26a6cb7412b3368a07aabbc675e85b2cb1f27) --- drivers/adc/adc_nrfx_saadc.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index b92b5ccfe6b3..2c56e79f4897 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include @@ -725,10 +727,19 @@ static int adc_nrfx_read(const struct device *dev, { int error; + error = pm_device_runtime_get(dev); + if (error) { + return error; + } + adc_context_lock(&m_data.ctx, false, NULL); error = start_read(dev, sequence); adc_context_release(&m_data.ctx, error); + if (pm_device_runtime_put(dev)) { + LOG_ERR("PM put failed"); + } + return error; } @@ -778,6 +789,13 @@ static void event_handler(const nrfx_saadc_evt_t *event) } } +static int saadc_pm_handler(const struct device *dev, enum pm_device_action action) +{ + ARG_UNUSED(dev); + ARG_UNUSED(action); + return 0; +} + static int init_saadc(const struct device *dev) { nrfx_err_t err; @@ -795,7 +813,7 @@ static int init_saadc(const struct device *dev) adc_context_unlock_unconditionally(&m_data.ctx); - return 0; + return pm_device_driver_init(dev, saadc_pm_handler); } static DEVICE_API(adc, adc_nrfx_driver_api) = { @@ -838,5 +856,7 @@ DT_FOREACH_CHILD(DT_DRV_INST(0), VALIDATE_CHANNEL_CONFIG) NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(0)); -DEVICE_DT_INST_DEFINE(0, init_saadc, NULL, NULL, NULL, POST_KERNEL, - CONFIG_ADC_INIT_PRIORITY, &adc_nrfx_driver_api); +PM_DEVICE_DT_INST_DEFINE(0, saadc_pm_handler); +DEVICE_DT_INST_DEFINE(0, init_saadc, PM_DEVICE_DT_INST_GET(0), NULL, + NULL, POST_KERNEL, CONFIG_ADC_INIT_PRIORITY, + &adc_nrfx_driver_api); From d70b3d746c596e3f9300ae9d6ca5f7612ca0c111 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 29 Sep 2025 11:51:05 +0200 Subject: [PATCH 0157/3334] [nrf fromtree] dts: vendor: nordic: nrf54h: move adc and comp to gdpwr_slow_main The ADC and COMP on the nrf54h20 both have all of their analog inputs routed to pads in different power domains than themselves, this means the device drivers for both of them need to request the pads to be resumed when active to allow any reading of the pads. To keep the drivers simple, we can rely on HW to keep the power domain the COMP and ADC are in powered, which happens automatically when the ADC or COMP is ENABLED. We can then place them on the power domain of their pads in the devicetree. This ensures the pads are powered and not retained while the devices are RESUMED. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit d6e940ef4a2e4465309fd187e2c88c3c02834054) --- dts/vendor/nordic/nrf54h20.dtsi | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index ddbf255e936b..5fcfec37c2c5 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -1060,7 +1060,13 @@ interrupts = <386 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; #io-channel-cells = <1>; - power-domains = <&gdpwr_slow_active>; + /* + * This device is actually in the gdpwr_slow_active domain, but + * all of its analog inputs are routed to pads in the + * gdpwr_slow_main. Request gdpwr_slow_main and rely on the + * device HW to force its own power domain on while ENABLED. + */ + power-domains = <&gdpwr_slow_main>; zephyr,pm-device-runtime-auto; }; @@ -1073,7 +1079,13 @@ reg = <0x983000 0x1000>; status = "disabled"; interrupts = <387 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_slow_active>; + /* + * This device is actually in the gdpwr_slow_active domain, but + * all of its analog inputs are routed to pads in the + * gdpwr_slow_main. Request gdpwr_slow_main and rely on the + * device HW to force its own power domain on while ENABLED. + */ + power-domains = <&gdpwr_slow_main>; }; temp: temperature-sensor@984000 { From 91910f7362107f9f981f1cd9974834018cbfbf27 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 25 Jul 2025 14:18:18 +0200 Subject: [PATCH 0158/3334] [nrf fromtree] pm: device: runtime: add PM_DEVICE_RUNTIME_DEFAULT_ENABLE Many SoCs which use PM_DEVICE_RUNTIME need every device in the system to have PM_DEVICE_RUNTIME enabled to function. Currently, this is only possible by adding zephyr,pm-device-runtime-auto; to every node in every devicetree which could potentially implement device power management. This is very error prone since its easy to miss a node, especially if users apply overlays, where users need to know and remember to apply or reapply this property. This commit adds a Kconfig, disabled by default, which automatically treats every device as if it had the zephyr,pm-device-runtime-auto property added to every node. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 34c51c5ab47bec2202f3c81c4f87824a6c539c2e) --- subsys/pm/Kconfig | 9 +++++++++ subsys/pm/device.c | 3 ++- subsys/pm/device_runtime.c | 9 +++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/subsys/pm/Kconfig b/subsys/pm/Kconfig index af0409de559a..d1d99ac02e3a 100644 --- a/subsys/pm/Kconfig +++ b/subsys/pm/Kconfig @@ -177,6 +177,15 @@ endif #PM_DEVICE_RUNTIME_USE_DEDICATED_WQ endchoice endif # PM_DEVICE_RUNTIME_ASYNC + +config PM_DEVICE_RUNTIME_DEFAULT_ENABLE + bool "PM device runtime enable by default" + help + Enable PM device runtime by default for all devices when they are + initialized. This option is identical to adding the devicetree + property zephyr,pm-device-runtime-auto to all nodes in the + devicetree. + endif # PM_DEVICE_RUNTIME config PM_DEVICE_SHELL diff --git a/subsys/pm/device.c b/subsys/pm/device.c index 2d7bb3176c36..c74eea661f05 100644 --- a/subsys/pm/device.c +++ b/subsys/pm/device.c @@ -388,7 +388,8 @@ int pm_device_driver_init(const struct device *dev, /* If device will have PM device runtime enabled */ if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) && - atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_AUTO)) { + (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME_DEFAULT_ENABLE) || + atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_AUTO))) { return 0; } diff --git a/subsys/pm/device_runtime.c b/subsys/pm/device_runtime.c index 490d7de49334..104d1fdb5955 100644 --- a/subsys/pm/device_runtime.c +++ b/subsys/pm/device_runtime.c @@ -401,10 +401,15 @@ int pm_device_runtime_auto_enable(const struct device *dev) { struct pm_device_base *pm = dev->pm_base; - /* No action needed if PM_DEVICE_FLAG_RUNTIME_AUTO is not enabled */ - if (!pm || !atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_AUTO)) { + if (!pm) { return 0; } + + if (!IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME_DEFAULT_ENABLE) && + !atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_AUTO)) { + return 0; + } + return pm_device_runtime_enable(dev); } From 182509a8601eef62971f36f28b06afc1ca99cf9b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 25 Jul 2025 14:24:58 +0200 Subject: [PATCH 0159/3334] [nrf fromtree] soc: nordic: enable CONFIG_PM_DEVICE_RUNTIME_DEFAULT_ENABLE for all Enable CONFIG_PM_DEVICE_RUNTIME_DEFAULT_ENABLE by default for all nordic SoCs if CONFIG_PM_DEVICE_RUNTIME is used. This will ensure consistent behavior across all nordic SoCs and remove the need for pasting the devicetree propert zephyr,pm-device-runtime-auto everywhere. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 61a9d6aa45868d65b4d24c257a2799a62fb9d32d) --- soc/nordic/common/Kconfig.defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/soc/nordic/common/Kconfig.defconfig b/soc/nordic/common/Kconfig.defconfig index 077a73ad24d9..846151dd11a8 100644 --- a/soc/nordic/common/Kconfig.defconfig +++ b/soc/nordic/common/Kconfig.defconfig @@ -6,3 +6,6 @@ if RISCV_CORE_NORDIC_VPR rsource "vpr/Kconfig.defconfig" endif # RISCV_CORE_NORDIC_VPR + +config PM_DEVICE_RUNTIME_DEFAULT_ENABLE + default y if PM_DEVICE_RUNTIME From 2bde7ed745dd97b6766595d7094f68d65cb90160 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 13 Oct 2025 10:39:49 +0200 Subject: [PATCH 0160/3334] [nrf fromlist] dts: vendor: nordic: nrf54h: remove power-domains from devices All devices used in their "normal"/intended configuration do not require management of the power domains, as the hardware itself will request them automatically. Thus by default, don't specify the power domains to avoid redundant resume/suspend cycles, which are slow and require threading (IPC) making devices not isr ok. Upstream PR #: 97452 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 776becbf86e2a15009b00afeb6dabdd0a154f81b) --- dts/vendor/nordic/nrf54h20.dtsi | 89 --------------------------------- 1 file changed, 89 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 5fcfec37c2c5..e98693d1be97 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -259,7 +259,6 @@ mram1x: mram@e000000 { compatible = "nordic,mram"; reg = <0xe000000 DT_SIZE_K(2048)>; - power-domains = <&gdpwr_fast_active_0>; erase-block-size = <4096>; write-block-size = <16>; }; @@ -622,7 +621,6 @@ reg = <0x86000 0x1000>, <0x2f700000 0x40000>; reg-names = "wrapper", "core"; interrupts = <134 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_fast_active_0>; num-in-eps = <8>; num-out-eps = <10>; ghwcfg1 = <0xaa555000>; @@ -638,7 +636,6 @@ reg = <0x95000 0x500 0x95500 0xb00>; reg-names = "wrapper", "core"; interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_fast_active_0>; clock-frequency = ; packet-data-limit = <65536>; fifo-depth = <32>; @@ -648,21 +645,18 @@ cpusec_bellboard: mailbox@99000 { reg = <0x99000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_fast_active_0>; #mbox-cells = <1>; }; cpuapp_bellboard: mailbox@9a000 { reg = <0x9a000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_fast_active_0>; #mbox-cells = <1>; }; cpurad_bellboard: mailbox@9b000 { reg = <0x9b000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_fast_active_0>; #mbox-cells = <1>; }; @@ -703,7 +697,6 @@ compatible = "nordic,nrf-vpr-coprocessor"; reg = <0x8d4000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_fast_active_1>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x8d4000 0x1000>; @@ -725,7 +718,6 @@ interrupts = <216 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&canpll>, <&hsfll120>; clock-names = "auxpll", "hsfll"; - power-domains = <&gdpwr_fast_active_1>; bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>; status = "disabled"; }; @@ -734,7 +726,6 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x8e1000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_fast_active_1>; }; timer120: timer@8e2000 { @@ -743,7 +734,6 @@ status = "disabled"; cc-num = <6>; interrupts = <226 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_fast_active_1>; max-bit-width = <32>; clocks = <&hsfll120>; prescaler = <0>; @@ -755,7 +745,6 @@ status = "disabled"; cc-num = <6>; interrupts = <227 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_fast_active_1>; max-bit-width = <32>; clocks = <&hsfll120>; prescaler = <0>; @@ -767,7 +756,6 @@ status = "disabled"; interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; - power-domains = <&gdpwr_fast_active_1>; #pwm-cells = <3>; idleout-supported; }; @@ -776,7 +764,6 @@ compatible = "nordic,nrf-spis"; reg = <0x8e5000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_fast_active_1>; easydma-maxcnt-bits = <15>; interrupts = <229 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; @@ -790,7 +777,6 @@ compatible = "nordic,nrf-spim"; reg = <0x8e6000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_fast_active_1>; easydma-maxcnt-bits = <15>; interrupts = <230 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; @@ -808,7 +794,6 @@ status = "disabled"; interrupts = <230 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; - power-domains = <&gdpwr_fast_active_1>; endtx-stoptx-supported; frame-timeout-supported; zephyr,pm-device-runtime-auto; @@ -821,7 +806,6 @@ easydma-maxcnt-bits = <15>; interrupts = <231 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; - power-domains = <&gdpwr_fast_active_1>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -837,7 +821,6 @@ #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x908000 0x1000>; - power-domains = <&gdpwr_slow_active>; cpuppr_vevif_tx: mailbox@0 { compatible = "nordic,nrf-vevif-task-tx"; @@ -853,7 +836,6 @@ compatible = "nordic,nrf-ipct-global"; reg = <0x921000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_main>; channels = <8>; global-domain-id = <13>; }; @@ -862,7 +844,6 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x922000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_main>; }; rtc130: rtc@928000 { @@ -872,7 +853,6 @@ cc-num = <4>; clock-frequency = <32768>; interrupts = <296 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_slow_main>; clocks = <&lfclk>; prescaler = <1>; }; @@ -884,7 +864,6 @@ cc-num = <4>; clock-frequency = <32768>; interrupts = <297 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_slow_main>; clocks = <&lfclk>; prescaler = <1>; }; @@ -895,7 +874,6 @@ status = "disabled"; interrupts = <299 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&lfclk>; - power-domains = <&gdpwr_slow_main>; }; wdt132: watchdog@92c000 { @@ -904,7 +882,6 @@ status = "disabled"; interrupts = <300 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&lfclk>; - power-domains = <&gdpwr_slow_main>; }; egu130: egu@92d000 { @@ -912,14 +889,12 @@ reg = <0x92d000 0x1000>; status = "disabled"; interrupts = <301 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_slow_main>; }; gpiote130: gpiote@934000 { compatible = "nordic,nrf-gpiote"; reg = <0x934000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_main>; instance = <130>; }; @@ -929,7 +904,6 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; - power-domains = <&gdpwr_slow_main>; gpiote-instance = <&gpiote130>; ngpios = <12>; port = <0>; @@ -937,7 +911,6 @@ gpio_pad_group0: pad-group { compatible = "nordic,nrf-gpio-pad-group"; - power-domains = <&gdpwr_slow_main>; retain-mask = <0xFFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -950,7 +923,6 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; - power-domains = <&gdpwr_slow_main>; gpiote-instance = <&gpiote130>; ngpios = <12>; port = <1>; @@ -958,7 +930,6 @@ gpio_pad_group1: pad-group { compatible = "nordic,nrf-gpio-pad-group"; - power-domains = <&gdpwr_slow_main>; retain-mask = <0xFFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -971,7 +942,6 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; - power-domains = <&gdpwr_slow_main>; gpiote-instance = <&gpiote130>; ngpios = <12>; port = <2>; @@ -979,7 +949,6 @@ gpio_pad_group2: pad-group { compatible = "nordic,nrf-gpio-pad-group"; - power-domains = <&gdpwr_slow_main>; retain-mask = <0xFFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -992,14 +961,12 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; - power-domains = <&gdpwr_slow_main>; ngpios = <14>; port = <6>; zephyr,pm-device-runtime-auto; gpio_pad_group6: pad-group { compatible = "nordic,nrf-gpio-pad-group"; - power-domains = <&gdpwr_fast_active_1>; retain-mask = <0x3FFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -1012,14 +979,12 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; - power-domains = <&gdpwr_slow_main>; ngpios = <8>; port = <7>; zephyr,pm-device-runtime-auto; gpio_pad_group7: pad-group { compatible = "nordic,nrf-gpio-pad-group"; - power-domains = <&gdpwr_fast_active_1>; retain-mask = <0xFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -1032,7 +997,6 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; - power-domains = <&gdpwr_slow_main>; gpiote-instance = <&gpiote130>; ngpios = <6>; port = <9>; @@ -1040,7 +1004,6 @@ gpio_pad_group9: pad-group { compatible = "nordic,nrf-gpio-pad-group"; - power-domains = <&gdpwr_slow_main>; retain-mask = <0x3F>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -1051,7 +1014,6 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x981000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_active>; }; adc: adc@982000 { @@ -1066,7 +1028,6 @@ * gdpwr_slow_main. Request gdpwr_slow_main and rely on the * device HW to force its own power domain on while ENABLED. */ - power-domains = <&gdpwr_slow_main>; zephyr,pm-device-runtime-auto; }; @@ -1085,7 +1046,6 @@ * gdpwr_slow_main. Request gdpwr_slow_main and rely on the * device HW to force its own power domain on while ENABLED. */ - power-domains = <&gdpwr_slow_main>; }; temp: temperature-sensor@984000 { @@ -1093,7 +1053,6 @@ reg = <0x984000 0x1000>; interrupts = <388 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; - power-domains = <&gdpwr_slow_active>; }; nfct: nfct@985000 { @@ -1101,14 +1060,12 @@ reg = <0x985000 0x1000>; status = "disabled"; interrupts = <389 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_slow_active>; }; dppic132: dppic@991000 { compatible = "nordic,nrf-dppic-global"; reg = <0x991000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_active>; }; pdm0: pdm@993000 { @@ -1117,7 +1074,6 @@ status = "disabled"; interrupts = <403 NRF_DEFAULT_IRQ_PRIORITY>; nordic,clockpin-enable = ; - power-domains = <&gdpwr_slow_active>; }; qdec130: qdec@994000 { @@ -1125,7 +1081,6 @@ reg = <0x994000 0x1000>; status = "disabled"; interrupts = <404 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_slow_active>; }; qdec131: qdec@995000 { @@ -1133,7 +1088,6 @@ reg = <0x995000 0x1000>; status = "disabled"; interrupts = <405 NRF_DEFAULT_IRQ_PRIORITY>; - power-domains = <&gdpwr_slow_active>; }; grtc: grtc@99c000 { @@ -1143,14 +1097,12 @@ cc-num = <16>; clocks = <&lfclk>, <&fll16m>; clock-names = "lfclock", "hfclock"; - power-domains = <&gdpwr_slow_active>; }; dppic133: dppic@9a1000 { compatible = "nordic,nrf-dppic-global"; reg = <0x9a1000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_active>; }; timer130: timer@9a2000 { @@ -1160,7 +1112,6 @@ cc-num = <6>; interrupts = <418 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1172,7 +1123,6 @@ cc-num = <6>; interrupts = <419 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1183,7 +1133,6 @@ status = "disabled"; interrupts = <420 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; #pwm-cells = <3>; idleout-supported; }; @@ -1194,7 +1143,6 @@ status = "disabled"; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1210,7 +1158,6 @@ easydma-maxcnt-bits = <15>; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1228,7 +1175,6 @@ status = "disabled"; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1241,7 +1187,6 @@ status = "disabled"; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1257,7 +1202,6 @@ easydma-maxcnt-bits = <15>; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1275,7 +1219,6 @@ status = "disabled"; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1286,7 +1229,6 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x9b1000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_active>; }; timer132: timer@9b2000 { @@ -1296,7 +1238,6 @@ cc-num = <6>; interrupts = <434 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1308,7 +1249,6 @@ cc-num = <6>; interrupts = <435 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1319,7 +1259,6 @@ status = "disabled"; interrupts = <436 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; #pwm-cells = <3>; idleout-supported; }; @@ -1330,7 +1269,6 @@ status = "disabled"; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1346,7 +1284,6 @@ easydma-maxcnt-bits = <15>; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1364,7 +1301,6 @@ status = "disabled"; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1377,7 +1313,6 @@ status = "disabled"; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1393,7 +1328,6 @@ easydma-maxcnt-bits = <15>; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1411,7 +1345,6 @@ status = "disabled"; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1422,7 +1355,6 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x9c1000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_active>; }; timer134: timer@9c2000 { @@ -1432,7 +1364,6 @@ cc-num = <6>; interrupts = <450 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1444,7 +1375,6 @@ cc-num = <6>; interrupts = <451 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1456,7 +1386,6 @@ interrupts = <452 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; #pwm-cells = <3>; - power-domains = <&gdpwr_slow_active>; idleout-supported; }; @@ -1466,7 +1395,6 @@ status = "disabled"; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1482,7 +1410,6 @@ easydma-maxcnt-bits = <15>; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1500,7 +1427,6 @@ status = "disabled"; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1513,7 +1439,6 @@ status = "disabled"; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1529,7 +1454,6 @@ easydma-maxcnt-bits = <15>; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1547,7 +1471,6 @@ status = "disabled"; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1558,7 +1481,6 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x9d1000 0x1000>; status = "disabled"; - power-domains = <&gdpwr_slow_active>; }; timer136: timer@9d2000 { @@ -1568,7 +1490,6 @@ cc-num = <6>; interrupts = <466 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1580,7 +1501,6 @@ cc-num = <6>; interrupts = <467 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1592,7 +1512,6 @@ interrupts = <468 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; #pwm-cells = <3>; - power-domains = <&gdpwr_slow_active>; idleout-supported; }; @@ -1602,7 +1521,6 @@ status = "disabled"; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1618,7 +1536,6 @@ easydma-maxcnt-bits = <15>; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1636,7 +1553,6 @@ status = "disabled"; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1649,7 +1565,6 @@ status = "disabled"; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1665,7 +1580,6 @@ easydma-maxcnt-bits = <15>; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1683,7 +1597,6 @@ status = "disabled"; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1699,7 +1612,6 @@ interrupts = <402 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = , ; }; @@ -1713,7 +1625,6 @@ interrupts = <407 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; clocks = <&fll16m>; - power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = , ; }; From 345a9f6fe5e466ac6537f83a3f1b5bc5df9c4f4b Mon Sep 17 00:00:00 2001 From: Kyle Micallef Bonnici Date: Sun, 7 Sep 2025 22:25:01 +0200 Subject: [PATCH 0161/3334] [nrf fromtree] devicetree: format files in dts/arm/nordic Applying dts-linter results for files in dts/arm/nordic Signed-off-by: Kyle Micallef Bonnici (cherry picked from commit 51d5135fd7875e3237966a08e54bffe5f6accd2a) --- dts/arm/nordic/nrf51822.dtsi | 1 - dts/arm/nordic/nrf52805.dtsi | 1 - dts/arm/nordic/nrf52810.dtsi | 2 +- dts/arm/nordic/nrf52811.dtsi | 3 +-- dts/arm/nordic/nrf52820.dtsi | 2 -- dts/arm/nordic/nrf52832.dtsi | 1 - dts/arm/nordic/nrf52833.dtsi | 1 - dts/arm/nordic/nrf52840.dtsi | 1 - dts/arm/nordic/nrf52840_qfaa.dtsi | 1 - dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi | 1 - dts/arm/nordic/nrf5340_cpunet.dtsi | 1 - dts/arm/nordic/nrf54h20_cpuapp.dtsi | 13 ++++++++++--- dts/arm/nordic/nrf54h20_cpurad.dtsi | 13 ++++++++++--- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +++- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 2 ++ dts/arm/nordic/nrf91.dtsi | 2 +- dts/arm/nordic/nrf91_peripherals.dtsi | 1 - dts/arm/nordic/nrf9280_cpuapp.dtsi | 6 ++++++ dts/arm/nordic/nrf9280_cpurad.dtsi | 6 ++++++ 19 files changed, 40 insertions(+), 22 deletions(-) diff --git a/dts/arm/nordic/nrf51822.dtsi b/dts/arm/nordic/nrf51822.dtsi index cbfef90faa5b..8f262909d61f 100644 --- a/dts/arm/nordic/nrf51822.dtsi +++ b/dts/arm/nordic/nrf51822.dtsi @@ -311,7 +311,6 @@ #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <1024>; diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 45a54f97b061..e940c7a2cdf2 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -320,7 +320,6 @@ #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 217758dd1614..c1e5f8763172 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -180,6 +180,7 @@ #io-channel-cells = <1>; zephyr,pm-device-runtime-auto; }; + timer0: timer@40008000 { compatible = "nordic,nrf-timer"; status = "disabled"; @@ -345,7 +346,6 @@ #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 670f569c0ace..33f6ac38747a 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -159,7 +159,7 @@ }; spi1: spi@40003000 { - /* cannot be used with i2c0 */ + /* cannot be used with i2c0 */ /* * This spi node can be SPI, SPIM, or SPIS, * for the user to pick: @@ -377,7 +377,6 @@ #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index 50c8d2ba07f0..1073b973c22a 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -9,7 +9,6 @@ #include / { - chosen { zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; @@ -389,7 +388,6 @@ #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index 7bd62c707545..09a651762db6 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -412,7 +412,6 @@ #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 8202ddc45431..87e6bccfb53d 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -434,7 +434,6 @@ #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index dab5f7620585..c0a2545f0137 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -421,7 +421,6 @@ #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52840_qfaa.dtsi b/dts/arm/nordic/nrf52840_qfaa.dtsi index 85acf5ab4685..6d549a45d1dd 100644 --- a/dts/arm/nordic/nrf52840_qfaa.dtsi +++ b/dts/arm/nordic/nrf52840_qfaa.dtsi @@ -19,7 +19,6 @@ soc { compatible = "simple-bus"; }; - }; /delete-node/ &usbd; diff --git a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi index 7021b7eedeb1..ea56b3206bcc 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi @@ -536,7 +536,6 @@ flash_controller: flash-controller@39000 { #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 4f9164767f1a..5010f801e0c0 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -309,7 +309,6 @@ #address-cells = <1>; #size-cells = <1>; - flash1: flash@1000000 { compatible = "soc-nv-flash"; erase-block-size = <2048>; diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index 9e790656e501..1e6eb128443d 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -7,12 +7,19 @@ #include cpu: &cpuapp {}; + systick: &cpuapp_systick {}; + nvic: &cpuapp_nvic {}; + cpuppr_vevif: &cpuppr_vevif_tx {}; + cpuflpr_vevif: &cpuflpr_vevif_tx {}; + cpusys_vevif: &cpusys_vevif_tx {}; + wdt010: &cpuapp_wdt010 {}; + wdt011: &cpuapp_wdt011 {}; /delete-node/ &cpuppr; @@ -60,15 +67,15 @@ wdt011: &cpuapp_wdt011 {}; interrupts = <109 NRF_DEFAULT_IRQ_PRIORITY>; }; -&fll16m { +&fll16m { status = "okay"; }; -&hsfll120 { +&hsfll120 { status = "okay"; }; -&lfclk { +&lfclk { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index f7f7464f91c2..378d27c3fd62 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -7,12 +7,19 @@ #include cpu: &cpurad {}; + systick: &cpurad_systick {}; + nvic: &cpurad_nvic {}; + cpuppr_vevif: &cpuppr_vevif_tx {}; + cpuflpr_vevif: &cpuflpr_vevif_tx {}; + cpusys_vevif: &cpusys_vevif_tx {}; + wdt010: &cpurad_wdt010 {}; + wdt011: &cpurad_wdt011 {}; /delete-node/ &cpuapp; @@ -101,15 +108,15 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&fll16m { +&fll16m { status = "okay"; }; -&hsfll120 { +&hsfll120 { status = "okay"; }; -&lfclk { +&lfclk { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 3f1fe655b6e5..ee8be4b8d765 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -5,7 +5,9 @@ */ cpu: &cpuapp {}; + systick: &cpuapp_systick {}; + nvic: &cpuapp_nvic {}; /delete-node/ &cpuflpr; @@ -72,7 +74,7 @@ nvic: &cpuapp_nvic {}; #else interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>, #endif - <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ + <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ }; &gpiote20 { diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index dc13fb40d6aa..d5aa024dd6d3 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -7,7 +7,9 @@ #include cpu: &cpuapp {}; + systick: &cpuapp_systick {}; + nvic: &cpuapp_nvic {}; /delete-node/ &cpuflpr; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 1747dcea74a9..2ef4b9bbab20 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -65,7 +65,7 @@ * so we give it the 'gpiote' label for use when building * code for this target. */ - gpiote: gpiote0: gpiote@5000d000 { + gpiote: gpiote0: gpiote@5000d000 { compatible = "nordic,nrf-gpiote"; reg = <0x5000d000 0x1000>; interrupts = <13 5>; diff --git a/dts/arm/nordic/nrf91_peripherals.dtsi b/dts/arm/nordic/nrf91_peripherals.dtsi index 476f8415853a..3e7e42472b9b 100644 --- a/dts/arm/nordic/nrf91_peripherals.dtsi +++ b/dts/arm/nordic/nrf91_peripherals.dtsi @@ -12,7 +12,6 @@ flash_controller: flash-controller@39000 { #address-cells = <1>; #size-cells = <1>; - flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf9280_cpuapp.dtsi b/dts/arm/nordic/nrf9280_cpuapp.dtsi index 29edae31051d..01716a656785 100644 --- a/dts/arm/nordic/nrf9280_cpuapp.dtsi +++ b/dts/arm/nordic/nrf9280_cpuapp.dtsi @@ -7,11 +7,17 @@ #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; diff --git a/dts/arm/nordic/nrf9280_cpurad.dtsi b/dts/arm/nordic/nrf9280_cpurad.dtsi index 265cd6239537..9a88533507f3 100644 --- a/dts/arm/nordic/nrf9280_cpurad.dtsi +++ b/dts/arm/nordic/nrf9280_cpurad.dtsi @@ -7,11 +7,17 @@ #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; From f36e76fac6278251b07d96dec0822f7148704715 Mon Sep 17 00:00:00 2001 From: Sai Santhosh Malae Date: Fri, 22 Aug 2025 15:07:22 +0530 Subject: [PATCH 0162/3334] [nrf fromtree] drivers: power_domain: siwx91x: Add power domain driver for siwx91x SoC 1. Added siwx91x power domain node in siwg917.dtsi 2. Updated UART device nodes to reference the newly added power domain. 3. Implemented power domain driver to manage power domain transitions for the SoC. Signed-off-by: Sai Santhosh Malae (cherry picked from commit 295431dad598dfdec8260dac6b22bd4919117360) --- drivers/power_domain/CMakeLists.txt | 1 + drivers/power_domain/Kconfig | 1 + drivers/power_domain/Kconfig.silabs_siwx91x | 16 +++++++ .../power_domain_silabs_siwx91x.c | 42 +++++++++++++++++++ dts/arm/silabs/siwg917.dtsi | 13 ++++++ .../silabs,siwx91x-power-domain.yaml | 5 +++ 6 files changed, 78 insertions(+) create mode 100644 drivers/power_domain/Kconfig.silabs_siwx91x create mode 100644 drivers/power_domain/power_domain_silabs_siwx91x.c create mode 100644 dts/bindings/power-domain/silabs,siwx91x-power-domain.yaml diff --git a/drivers/power_domain/CMakeLists.txt b/drivers/power_domain/CMakeLists.txt index 357efe6f4ab7..3b7ba378f9e3 100644 --- a/drivers/power_domain/CMakeLists.txt +++ b/drivers/power_domain/CMakeLists.txt @@ -11,3 +11,4 @@ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_GDPWR power_domain_nrfs_gd zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRF_GPIO_PAD_GROUP power_domain_nrf_gpio_pad_group.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SOC_PM_STATE power_domain_soc_state_change.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_TISCI power_domain_tisci.c) +zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SILABS_SIWX91X power_domain_silabs_siwx91x.c) diff --git a/drivers/power_domain/Kconfig b/drivers/power_domain/Kconfig index 7b336700dd6e..2c3592c773db 100644 --- a/drivers/power_domain/Kconfig +++ b/drivers/power_domain/Kconfig @@ -125,5 +125,6 @@ endif #POWER_DOMAIN_TISCI rsource "Kconfig.nrfs_gdpwr" rsource "Kconfig.nrf_gpio_pad_group" +rsource "Kconfig.silabs_siwx91x" endif diff --git a/drivers/power_domain/Kconfig.silabs_siwx91x b/drivers/power_domain/Kconfig.silabs_siwx91x new file mode 100644 index 000000000000..3fa95f335538 --- /dev/null +++ b/drivers/power_domain/Kconfig.silabs_siwx91x @@ -0,0 +1,16 @@ +# Copyright 2025 Silicon Laboratories Inc. +# SPDX-License-Identifier: Apache-2.0 + +config POWER_DOMAIN_SILABS_SIWX91X + bool "Silabs siwx91x power domain driver" + default y + select DEVICE_DEPS + depends on DT_HAS_SILABS_SIWX91X_POWER_DOMAIN_ENABLED + help + Driver for Silabs siwx91x power domain. + +config SIWX91X_POWER_DOMAIN_INIT_PRIORITY + int "Silabs siwx91x power domain init priority" + default 10 + help + Silabs siwx91x power domain initialization priority. diff --git a/drivers/power_domain/power_domain_silabs_siwx91x.c b/drivers/power_domain/power_domain_silabs_siwx91x.c new file mode 100644 index 000000000000..8350e8a25e15 --- /dev/null +++ b/drivers/power_domain/power_domain_silabs_siwx91x.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2025 Silicon Laboratories Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#define DT_DRV_COMPAT silabs_siwx91x_power_domain + +static int siwx91x_pd_pm_action(const struct device *dev, enum pm_device_action action) +{ + switch (action) { + case PM_DEVICE_ACTION_RESUME: + pm_device_children_action_run(dev, PM_DEVICE_ACTION_TURN_ON, NULL); + break; + case PM_DEVICE_ACTION_SUSPEND: + pm_device_children_action_run(dev, PM_DEVICE_ACTION_TURN_OFF, NULL); + break; + case PM_DEVICE_ACTION_TURN_ON: + break; + case PM_DEVICE_ACTION_TURN_OFF: + break; + default: + return -ENOTSUP; + } + + return 0; +} + +static int siwx91x_pd_init(const struct device *dev) +{ + return pm_device_driver_init(dev, siwx91x_pd_pm_action); +} + +#define SIWX91X_PD_INIT(inst) \ + PM_DEVICE_DT_INST_DEFINE(inst, siwx91x_pd_pm_action); \ + DEVICE_DT_INST_DEFINE(inst, siwx91x_pd_init, PM_DEVICE_DT_INST_GET(inst), NULL, NULL, \ + PRE_KERNEL_1, CONFIG_SIWX91X_POWER_DOMAIN_INIT_PRIORITY, NULL); + +DT_INST_FOREACH_STATUS_OKAY(SIWX91X_PD_INIT) diff --git a/dts/arm/silabs/siwg917.dtsi b/dts/arm/silabs/siwg917.dtsi index ceb79d35152c..9cc9f358f048 100644 --- a/dts/arm/silabs/siwg917.dtsi +++ b/dts/arm/silabs/siwg917.dtsi @@ -124,6 +124,13 @@ status = "disabled"; }; + siwx91x_soc_pd: siwx91x-soc-pd { + compatible = "silabs,siwx91x-power-domain"; + #power-domain-cells = <0>; + zephyr,pm-device-runtime-auto; + status = "okay"; + }; + ulpuart: uart@24041800 { compatible = "ns16550"; reg = <0x24041800 0x1000>; @@ -131,6 +138,8 @@ reg-shift = <2>; clocks = <&clock0 SIWX91X_CLK_ULP_UART>; current-speed = <115200>; + power-domains = <&siwx91x_soc_pd>; + zephyr,pm-device-runtime-auto; status = "disabled"; }; @@ -141,6 +150,8 @@ reg-shift = <2>; clocks = <&clock0 SIWX91X_CLK_UART0>; current-speed = <115200>; + power-domains = <&siwx91x_soc_pd>; + zephyr,pm-device-runtime-auto; status = "disabled"; }; @@ -151,6 +162,8 @@ reg-shift = <2>; clocks = <&clock0 SIWX91X_CLK_UART1>; current-speed = <115200>; + power-domains = <&siwx91x_soc_pd>; + zephyr,pm-device-runtime-auto; status = "disabled"; }; diff --git a/dts/bindings/power-domain/silabs,siwx91x-power-domain.yaml b/dts/bindings/power-domain/silabs,siwx91x-power-domain.yaml new file mode 100644 index 000000000000..cd0bafa8237e --- /dev/null +++ b/dts/bindings/power-domain/silabs,siwx91x-power-domain.yaml @@ -0,0 +1,5 @@ +description: Silabs siwx91x soc power domain + +compatible: "silabs,siwx91x-power-domain" + +include: power-domain.yaml From 6c2dcd4fb03e7d719ef3df4b538213ff0f4d9c3e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Wed, 30 Jul 2025 15:40:11 +0200 Subject: [PATCH 0163/3334] [nrf fromtree] drivers: power_domain: introduce nrfs_swext device driver Introduce nrfx_swext device driver for NRFS SWEXT power domain device. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 5db84c7cb799e1cf54a938cee499e8ec601f6dcd) --- drivers/power_domain/CMakeLists.txt | 1 + drivers/power_domain/Kconfig | 1 + drivers/power_domain/Kconfig.nrfs_swext | 9 + .../power_domain/power_domain_nrfs_swext.c | 200 ++++++++++++++++++ 4 files changed, 211 insertions(+) create mode 100644 drivers/power_domain/Kconfig.nrfs_swext create mode 100644 drivers/power_domain/power_domain_nrfs_swext.c diff --git a/drivers/power_domain/CMakeLists.txt b/drivers/power_domain/CMakeLists.txt index 3b7ba378f9e3..e4a7c7dbc28b 100644 --- a/drivers/power_domain/CMakeLists.txt +++ b/drivers/power_domain/CMakeLists.txt @@ -8,6 +8,7 @@ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_GPIO_MONITOR power_domain_gpio_ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_INTEL_ADSP power_domain_intel_adsp.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NXP_SCU power_domain_nxp_scu.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_GDPWR power_domain_nrfs_gdpwr.c) +zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_SWEXT power_domain_nrfs_swext.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRF_GPIO_PAD_GROUP power_domain_nrf_gpio_pad_group.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SOC_PM_STATE power_domain_soc_state_change.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_TISCI power_domain_tisci.c) diff --git a/drivers/power_domain/Kconfig b/drivers/power_domain/Kconfig index 2c3592c773db..ce6fb4d42db8 100644 --- a/drivers/power_domain/Kconfig +++ b/drivers/power_domain/Kconfig @@ -124,6 +124,7 @@ config SOC_POWER_DOMAIN_INIT endif #POWER_DOMAIN_TISCI rsource "Kconfig.nrfs_gdpwr" +rsource "Kconfig.nrfs_swext" rsource "Kconfig.nrf_gpio_pad_group" rsource "Kconfig.silabs_siwx91x" diff --git a/drivers/power_domain/Kconfig.nrfs_swext b/drivers/power_domain/Kconfig.nrfs_swext new file mode 100644 index 000000000000..1a2c5d2d895e --- /dev/null +++ b/drivers/power_domain/Kconfig.nrfs_swext @@ -0,0 +1,9 @@ +# Copyright 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config POWER_DOMAIN_NRFS_SWEXT + bool "NRFS SWEXT power domain driver" + depends on DT_HAS_NORDIC_NRFS_SWEXT_ENABLED + select NRFS + select NRFS_SWEXT_SERVICE_ENABLED + default y diff --git a/drivers/power_domain/power_domain_nrfs_swext.c b/drivers/power_domain/power_domain_nrfs_swext.c new file mode 100644 index 000000000000..900fe4f7a8e6 --- /dev/null +++ b/drivers/power_domain/power_domain_nrfs_swext.c @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#define DT_DRV_COMPAT nordic_nrfs_swext + +#include +#include +#include +#include + +#include +#include + +LOG_MODULE_REGISTER(nrfs_swext, CONFIG_POWER_DOMAIN_LOG_LEVEL); + +BUILD_ASSERT( + DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, + "multiple instances not supported" +); + +struct nrfs_swext_data { + struct k_sem evt_sem; + nrfs_swext_evt_type_t evt; +}; + +struct nrfs_swext_config { + uint16_t current_limit_ua; + bool enable_power_down_clamp; +}; + +static void nrfs_swext_driver_evt_handler(nrfs_swext_evt_t const *p_evt, void *context) +{ + struct nrfs_swext_data *dev_data = context; + + LOG_DBG("evt %u", (uint32_t)p_evt->type); + + if (p_evt->type == NRFS_SWEXT_EVT_OVERCURRENT) { + /* Overcurrent is an unrecoverable condition which requires hardware fix */ + LOG_ERR("overcurrent"); + k_panic(); + }; + + dev_data->evt = p_evt->type; + k_sem_give(&dev_data->evt_sem); +} + +static int nrfs_swext_driver_power_down(const struct device *dev) +{ + const struct nrfs_swext_config *dev_config = dev->config; + nrfs_err_t err; + swext_pd_clamp_t pd_clamp = dev_config->enable_power_down_clamp + ? SWEXT_PD_CLAMP_ENABLED + : SWEXT_PD_CLAMP_DISABLED; + + /* + * Power down request does not respond with an event. + * Set context to NULL, fire and forget. + */ + err = nrfs_swext_power_down(pd_clamp, NULL); + if (err != NRFS_SUCCESS) { + LOG_ERR("failed to request power down"); + return -ENODEV; + } + + return 0; +} + +static int nrfs_swext_driver_power_up(const struct device *dev) +{ + struct nrfs_swext_data *dev_data = dev->data; + const struct nrfs_swext_config *dev_config = dev->config; + nrfs_err_t err; + uint8_t load_current; + + load_current = nrfs_swext_load_current_to_raw(dev_config->current_limit_ua); + err = nrfs_swext_power_up(load_current, dev_data); + if (err != NRFS_SUCCESS) { + LOG_ERR("failed to request power up"); + return -ENODEV; + } + + (void)k_sem_take(&dev_data->evt_sem, K_FOREVER); + + if (dev_data->evt == NRFS_SWEXT_EVT_ENABLED) { + return 0; + } + + LOG_ERR("power up request rejected"); + return -EIO; +} + +#if IS_ENABLED(CONFIG_DEVICE_DEPS) && IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN) +static void nrfs_swext_driver_notify_children(const struct device *dev, + enum pm_device_action action) +{ + pm_device_children_action_run(dev, action, NULL); +} +#else +static void nrfs_swext_driver_notify_children(const struct device *dev, + enum pm_device_action action) +{ + ARG_UNUSED(dev); + ARG_UNUSED(action); +} +#endif + +static int nrfs_swext_driver_suspend(const struct device *dev) +{ + int ret; + + nrfs_swext_driver_notify_children(dev, PM_DEVICE_ACTION_TURN_OFF); + + ret = nrfs_swext_driver_power_down(dev); + if (ret) { + nrfs_swext_driver_notify_children(dev, PM_DEVICE_ACTION_TURN_ON); + } + + return ret; +} + +static int nrfs_swext_driver_resume(const struct device *dev) +{ + int ret; + + ret = nrfs_swext_driver_power_up(dev); + if (ret == 0) { + nrfs_swext_driver_notify_children(dev, PM_DEVICE_ACTION_TURN_ON); + } + + return ret; +} + +static int nrfs_swext_driver_pm_action(const struct device *dev, + enum pm_device_action action) +{ + int ret; + + switch (action) { + case PM_DEVICE_ACTION_SUSPEND: + ret = nrfs_swext_driver_suspend(dev); + break; + + case PM_DEVICE_ACTION_RESUME: + ret = nrfs_swext_driver_resume(dev); + break; + + default: + ret = -ENOTSUP; + break; + }; + + return ret; +} + +static int nrfs_swext_driver_init(const struct device *dev) +{ + struct nrfs_swext_data *dev_data = dev->data; + nrfs_err_t err; + + LOG_DBG("waiting for nrfs backend connected"); + err = nrfs_backend_wait_for_connection(K_FOREVER); + if (err != NRFS_SUCCESS) { + LOG_ERR("nrfs backend not connected"); + return -ENODEV; + } + + err = nrfs_swext_init(nrfs_swext_driver_evt_handler); + if (err != NRFS_SUCCESS) { + LOG_ERR("failed to init swext service"); + return -ENODEV; + } + + k_sem_init(&dev_data->evt_sem, 0, 1); + return pm_device_driver_init(dev, nrfs_swext_driver_pm_action); +} + +PM_DEVICE_DT_INST_DEFINE(0, nrfs_swext_driver_pm_action); + +BUILD_ASSERT(DT_INST_PROP(0, max_current_ua) <= UINT16_MAX); +BUILD_ASSERT(DT_INST_PROP(0, current_limit_ua) <= DT_INST_PROP(0, max_current_ua)); + +static struct nrfs_swext_data data0; +static const struct nrfs_swext_config config0 = { + .current_limit_ua = DT_INST_PROP(0, current_limit_ua), + .enable_power_down_clamp = DT_INST_PROP(0, power_down_clamp), +}; + +DEVICE_DT_INST_DEFINE( + 0, + nrfs_swext_driver_init, + PM_DEVICE_DT_INST_GET(0), + &data0, + &config0, + POST_KERNEL, + UTIL_INC(CONFIG_NRFS_BACKEND_IPC_SERVICE_INIT_PRIO), + NULL +); From 4f29999e683ea62b19c84c53cc8f3b6b9da2d116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 29 Sep 2025 12:12:21 +0200 Subject: [PATCH 0164/3334] [nrf fromtree] drivers: power_domain: nrf_gpio_pad_group: Fix DT macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DT_PROP_OR instead of DT_INST_PROP_OR was used and property from device tree was never used. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 767c21a2179e151db6af5922008313f540886c4a) --- drivers/power_domain/power_domain_nrf_gpio_pad_group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power_domain/power_domain_nrf_gpio_pad_group.c b/drivers/power_domain/power_domain_nrf_gpio_pad_group.c index 8b4119312c10..06b40d9d5840 100644 --- a/drivers/power_domain/power_domain_nrf_gpio_pad_group.c +++ b/drivers/power_domain/power_domain_nrf_gpio_pad_group.c @@ -63,7 +63,7 @@ static int nrf_port_retain_driver_init(const struct device *dev) #define NRF_GPIO_PAD_GROUP_DEFINE(inst) \ static const struct nrf_port_retain_config _CONCAT(config, inst) = { \ .regs = (NRF_GPIO_Type *)DT_REG_ADDR(DT_INST_PARENT(inst)), \ - .retain_mask = DT_PROP_OR(inst, retain_mask, UINT32_MAX), \ + .retain_mask = DT_INST_PROP_OR(inst, retain_mask, UINT32_MAX), \ }; \ \ PM_DEVICE_DT_INST_DEFINE(inst, nrf_port_retain_driver_pm_action); \ From ba2b8455a16e25cfebb6ec6df682d3b422926e54 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 13 Oct 2025 10:48:05 +0200 Subject: [PATCH 0165/3334] [nrf fromlist] dts: vendor: nordic: nrf54h: remove gpio-pad-groups The gpio pad groups are redundant if pin retention is handled per pin, and the quirky cross domain feature is managed by the application. Remove it entirely. Upstream PR #: 97452 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit efc49adba74d49d1d16d14d371e958bc1f6bcdb2) --- drivers/power_domain/CMakeLists.txt | 1 - drivers/power_domain/Kconfig | 1 - .../power_domain/Kconfig.nrf_gpio_pad_group | 7 -- .../power_domain_nrf_gpio_pad_group.c | 82 ------------------- dts/arm/nordic/nrf54h20_cpuapp.dtsi | 24 ------ dts/arm/nordic/nrf54h20_cpurad.dtsi | 24 ------ .../gpio/nordic,nrf-gpio-pad-group.yaml | 43 ---------- dts/vendor/nordic/nrf54h20.dtsi | 42 ---------- 8 files changed, 224 deletions(-) delete mode 100644 drivers/power_domain/Kconfig.nrf_gpio_pad_group delete mode 100644 drivers/power_domain/power_domain_nrf_gpio_pad_group.c delete mode 100644 dts/bindings/gpio/nordic,nrf-gpio-pad-group.yaml diff --git a/drivers/power_domain/CMakeLists.txt b/drivers/power_domain/CMakeLists.txt index e4a7c7dbc28b..2749a32d5d63 100644 --- a/drivers/power_domain/CMakeLists.txt +++ b/drivers/power_domain/CMakeLists.txt @@ -9,7 +9,6 @@ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_INTEL_ADSP power_domain_intel_a zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NXP_SCU power_domain_nxp_scu.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_GDPWR power_domain_nrfs_gdpwr.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_SWEXT power_domain_nrfs_swext.c) -zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRF_GPIO_PAD_GROUP power_domain_nrf_gpio_pad_group.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SOC_PM_STATE power_domain_soc_state_change.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_TISCI power_domain_tisci.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SILABS_SIWX91X power_domain_silabs_siwx91x.c) diff --git a/drivers/power_domain/Kconfig b/drivers/power_domain/Kconfig index ce6fb4d42db8..3de9185761c0 100644 --- a/drivers/power_domain/Kconfig +++ b/drivers/power_domain/Kconfig @@ -125,7 +125,6 @@ endif #POWER_DOMAIN_TISCI rsource "Kconfig.nrfs_gdpwr" rsource "Kconfig.nrfs_swext" -rsource "Kconfig.nrf_gpio_pad_group" rsource "Kconfig.silabs_siwx91x" endif diff --git a/drivers/power_domain/Kconfig.nrf_gpio_pad_group b/drivers/power_domain/Kconfig.nrf_gpio_pad_group deleted file mode 100644 index 1b36c0cc7e08..000000000000 --- a/drivers/power_domain/Kconfig.nrf_gpio_pad_group +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config POWER_DOMAIN_NRF_GPIO_PAD_GROUP - bool "NRFS Global Domain Power Request driver" - depends on DT_HAS_NORDIC_NRF_GPIO_PAD_GROUP_ENABLED - default y diff --git a/drivers/power_domain/power_domain_nrf_gpio_pad_group.c b/drivers/power_domain/power_domain_nrf_gpio_pad_group.c deleted file mode 100644 index 06b40d9d5840..000000000000 --- a/drivers/power_domain/power_domain_nrf_gpio_pad_group.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf_gpio_pad_group - -#include -#include -#include -#include - -#include - -LOG_MODULE_REGISTER(nrf_gpio_pad_group, CONFIG_POWER_DOMAIN_LOG_LEVEL); - -struct nrf_port_retain_config { - NRF_GPIO_Type *regs; - uint32_t retain_mask; -}; - -static void nrf_port_retain_driver_turn_off(const struct device *dev) -{ - const struct nrf_port_retain_config *dev_config = dev->config; - - LOG_DBG("%s pads 0x%08x retain %s", dev->name, dev_config->retain_mask, "enable"); - nrf_gpio_port_retain_enable(dev_config->regs, dev_config->retain_mask); -} - -static void nrf_port_retain_driver_turn_on(const struct device *dev) -{ - const struct nrf_port_retain_config *dev_config = dev->config; - - LOG_DBG("%s pads 0x%08x retain %s", dev->name, dev_config->retain_mask, "disable"); - nrf_gpio_port_retain_disable(dev_config->regs, dev_config->retain_mask); -} - -static int nrf_port_retain_driver_pm_action(const struct device *dev, - enum pm_device_action action) -{ - switch (action) { - case PM_DEVICE_ACTION_TURN_OFF: - nrf_port_retain_driver_turn_off(dev); - break; - - case PM_DEVICE_ACTION_TURN_ON: - nrf_port_retain_driver_turn_on(dev); - break; - - default: - break; - }; - - return 0; -} - -static int nrf_port_retain_driver_init(const struct device *dev) -{ - return pm_device_driver_init(dev, nrf_port_retain_driver_pm_action); -} - -#define NRF_GPIO_PAD_GROUP_DEFINE(inst) \ - static const struct nrf_port_retain_config _CONCAT(config, inst) = { \ - .regs = (NRF_GPIO_Type *)DT_REG_ADDR(DT_INST_PARENT(inst)), \ - .retain_mask = DT_INST_PROP_OR(inst, retain_mask, UINT32_MAX), \ - }; \ - \ - PM_DEVICE_DT_INST_DEFINE(inst, nrf_port_retain_driver_pm_action); \ - \ - DEVICE_DT_INST_DEFINE( \ - inst, \ - nrf_port_retain_driver_init, \ - PM_DEVICE_DT_INST_GET(inst), \ - NULL, \ - &_CONCAT(config, inst), \ - PRE_KERNEL_1, \ - UTIL_INC(CONFIG_GPIO_INIT_PRIORITY), \ - NULL \ - ); - -DT_INST_FOREACH_STATUS_OKAY(NRF_GPIO_PAD_GROUP_DEFINE) diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index 1e6eb128443d..f3b8e4f8c08c 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -102,27 +102,3 @@ wdt011: &cpuapp_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; - -&gpio_pad_group0 { - status = "okay"; -}; - -&gpio_pad_group1 { - status = "okay"; -}; - -&gpio_pad_group2 { - status = "okay"; -}; - -&gpio_pad_group6 { - status = "okay"; -}; - -&gpio_pad_group7 { - status = "okay"; -}; - -&gpio_pad_group9 { - status = "okay"; -}; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 378d27c3fd62..cc7b0a97b513 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -143,27 +143,3 @@ wdt011: &cpurad_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; - -&gpio_pad_group0 { - status = "okay"; -}; - -&gpio_pad_group1 { - status = "okay"; -}; - -&gpio_pad_group2 { - status = "okay"; -}; - -&gpio_pad_group6 { - status = "okay"; -}; - -&gpio_pad_group7 { - status = "okay"; -}; - -&gpio_pad_group9 { - status = "okay"; -}; diff --git a/dts/bindings/gpio/nordic,nrf-gpio-pad-group.yaml b/dts/bindings/gpio/nordic,nrf-gpio-pad-group.yaml deleted file mode 100644 index 104277addd35..000000000000 --- a/dts/bindings/gpio/nordic,nrf-gpio-pad-group.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic nRF GPIO pad group. - - The GPIO pad group describes the pads (package - pins of the SoC) the GPIO controller manages. - - The pads may be in a different power domain than - the GPIO controller, and may require enabling - retention to preserve the GPIO configuration if - the power domain is suspended. - - The GPIO pad group is a child node of the GPIO - controller which manages the pad group, named - pad-group. The pad group's nodelabel is named - gpio_pad_group. - - Example layout: - - gpio0: gpio@938000 { - compatible = "nordic,nrf-gpio"; - - ... - - gpio_pad_group0: pad-group { - compatible = "nordic,nrf-gpio-pad-group"; - power-domains = <&gdpwr_slow_main>; - retain-mask = <0xFFF>; - }; - }; - -compatible: "nordic,nrf-gpio-pad-group" - -include: base.yaml - -properties: - retain-mask: - type: int - description: | - Mask of pins which shall be retained if pad - group's power domain is powered off. diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index e98693d1be97..06a7fe4d2495 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -908,13 +908,6 @@ ngpios = <12>; port = <0>; zephyr,pm-device-runtime-auto; - - gpio_pad_group0: pad-group { - compatible = "nordic,nrf-gpio-pad-group"; - retain-mask = <0xFFF>; - zephyr,pm-device-runtime-auto; - status = "disabled"; - }; }; gpio1: gpio@938200 { @@ -927,13 +920,6 @@ ngpios = <12>; port = <1>; zephyr,pm-device-runtime-auto; - - gpio_pad_group1: pad-group { - compatible = "nordic,nrf-gpio-pad-group"; - retain-mask = <0xFFF>; - zephyr,pm-device-runtime-auto; - status = "disabled"; - }; }; gpio2: gpio@938400 { @@ -946,13 +932,6 @@ ngpios = <12>; port = <2>; zephyr,pm-device-runtime-auto; - - gpio_pad_group2: pad-group { - compatible = "nordic,nrf-gpio-pad-group"; - retain-mask = <0xFFF>; - zephyr,pm-device-runtime-auto; - status = "disabled"; - }; }; gpio6: gpio@938c00 { @@ -964,13 +943,6 @@ ngpios = <14>; port = <6>; zephyr,pm-device-runtime-auto; - - gpio_pad_group6: pad-group { - compatible = "nordic,nrf-gpio-pad-group"; - retain-mask = <0x3FFF>; - zephyr,pm-device-runtime-auto; - status = "disabled"; - }; }; gpio7: gpio@938e00 { @@ -982,13 +954,6 @@ ngpios = <8>; port = <7>; zephyr,pm-device-runtime-auto; - - gpio_pad_group7: pad-group { - compatible = "nordic,nrf-gpio-pad-group"; - retain-mask = <0xFF>; - zephyr,pm-device-runtime-auto; - status = "disabled"; - }; }; gpio9: gpio@939200 { @@ -1001,13 +966,6 @@ ngpios = <6>; port = <9>; zephyr,pm-device-runtime-auto; - - gpio_pad_group9: pad-group { - compatible = "nordic,nrf-gpio-pad-group"; - retain-mask = <0x3F>; - zephyr,pm-device-runtime-auto; - status = "disabled"; - }; }; dppic131: dppic@981000 { From 221141019a53b3687eb73ec31e44770b755f4458 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 13 Oct 2025 11:07:45 +0200 Subject: [PATCH 0166/3334] [nrf fromlist] drivers: pinctrl: nrf: simplify pin retention GPIO pad power domain management is not neccesary if the quirky cross domain feature is handled at the application level. Replace it with directly setting/clearing pin retention, as hardware will force power domains on automatically. Upstream PR #: 97452 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 2d087fba5465d1ab7c31e54f8d91e053621b9f79) --- drivers/pinctrl/pinctrl_nrf.c | 73 +++++------------------------------ 1 file changed, 10 insertions(+), 63 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index ac9b17d27b39..f960ce4d97a3 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -5,7 +5,6 @@ */ #include -#include #include #include @@ -111,75 +110,23 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = { #define NRF_PSEL_TDM(reg, line) ((NRF_TDM_Type *)reg)->PSEL.line #endif -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_pad_group) -#define GPIO_HAS_PAD_GROUP 1 -#else -#define GPIO_HAS_PAD_GROUP 0 -#endif - -#if GPIO_HAS_PAD_GROUP - -#define GPIO_PAD_GROUP_GET_OR_NULL(idx, _) \ - DEVICE_DT_GET_OR_NULL(DT_NODELABEL(_CONCAT(gpio_pad_group, idx))) - -static const struct device *const pad_groups[] = { - LISTIFY(10, GPIO_PAD_GROUP_GET_OR_NULL, (,)) -}; - -static atomic_t pad_group_masks[ARRAY_SIZE(pad_groups)]; - -static int pad_group_request_pin(uint16_t pin_number) -{ - uint8_t port_number = NRF_GET_PORT(pin_number); - uint8_t port_pin_number = NRF_GET_PORT_PIN(pin_number); - const struct device *pad_group = pad_groups[port_number]; - atomic_t *pad_group_mask = &pad_group_masks[port_number]; - - if (atomic_test_and_set_bit(pad_group_mask, port_pin_number)) { - /* already requested */ - return 0; - } - - if (pm_device_runtime_get(pad_group)) { - atomic_clear_bit(pad_group_mask, port_pin_number); - return -EIO; - } - - return 0; -} +#if NRF_GPIO_HAS_RETENTION_SETCLEAR -static int pad_group_release_pin(uint16_t pin_number) +static void port_pin_retain_set(uint16_t pin_number, bool enable) { - uint8_t port_number = NRF_GET_PORT(pin_number); - uint8_t port_pin_number = NRF_GET_PORT_PIN(pin_number); - const struct device *pad_group = pad_groups[port_number]; - atomic_t *pad_group_mask = &pad_group_masks[port_number]; - - if (!atomic_test_and_clear_bit(pad_group_mask, port_pin_number)) { - /* already released */ - return 0; - } - - if (pm_device_runtime_put(pad_group)) { - atomic_set_bit(pad_group_mask, port_pin_number); - return -EIO; + if (enable) { + nrf_gpio_pin_retain_enable(pin_number); + } else { + nrf_gpio_pin_retain_disable(pin_number); } - - return 0; } #else -static int pad_group_request_pin(uint16_t pin_number) +static void port_pin_retain_set(uint16_t pin_number, bool enable) { ARG_UNUSED(pin_number); - return 0; -} - -static int pad_group_release_pin(uint16_t pin_number) -{ - ARG_UNUSED(pin_number); - return 0; + ARG_UNUSED(enable); } #endif @@ -577,7 +524,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uint32_t pin = psel; /* enable pin */ - pad_group_request_pin(pin); + port_pin_retain_set(pin, false); if (write != NO_WRITE) { nrf_gpio_pin_write(pin, write); @@ -595,7 +542,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, if (NRF_GET_LP(pins[i]) == NRF_LP_ENABLE) { /* disable pin and pin clock */ - pad_group_release_pin(pin); + port_pin_retain_set(pin, true); port_pin_clock_set(pin, false); } else { /* configure pin clock */ From 30af3b334892439c2c4682ca148144f4aae2d27c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 13 Oct 2025 11:41:56 +0200 Subject: [PATCH 0167/3334] [nrf fromlist] drivers: gpio: remove pad group integration Replace the pad group integration with directly setting/clearing pin retention for output pins if required, since the pad group integration is redundant if the quirky cross domain feature is managed by the application. Upstream PR #: 97452 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit e354c7571de49edc2877ccdcd257539d470ebcc7) --- drivers/gpio/gpio_nrfx.c | 138 +++++++++++++-------------------------- 1 file changed, 46 insertions(+), 92 deletions(-) diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index 6ccb378e161d..fcf0b2f8d27c 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -12,16 +12,9 @@ #include #include #include -#include #include -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_pad_group) -#define GPIO_HAS_PAD_GROUP 1 -#else -#define GPIO_HAS_PAD_GROUP 0 -#endif - #define GPIOTE_PHANDLE(id) DT_INST_PHANDLE(id, gpiote_instance) #define GPIOTE_PROP(idx, prop) DT_PROP(GPIOTE(idx), prop) @@ -55,9 +48,6 @@ struct gpio_nrfx_cfg { uint32_t edge_sense; uint8_t port_num; nrfx_gpiote_t gpiote; -#if GPIO_HAS_PAD_GROUP - const struct device *pad_group; -#endif #if defined(GPIOTE_FEATURE_FLAG) uint32_t flags; #endif @@ -78,6 +68,34 @@ static bool has_gpiote(const struct gpio_nrfx_cfg *cfg) return cfg->gpiote.p_reg != NULL; } +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + +static void port_retain_set(const struct gpio_nrfx_cfg *cfg, uint32_t mask) +{ + nrf_gpio_port_retain_enable(cfg->port, mask); +} + +static void port_retain_clear(const struct gpio_nrfx_cfg *cfg, uint32_t mask) +{ + nrf_gpio_port_retain_disable(cfg->port, mask); +} + +#else + +static void port_retain_set(const struct gpio_nrfx_cfg *cfg, uint32_t mask) +{ + ARG_UNUSED(cfg); + ARG_UNUSED(mask); +} + +static void port_retain_clear(const struct gpio_nrfx_cfg *cfg, uint32_t mask) +{ + ARG_UNUSED(cfg); + ARG_UNUSED(mask); +} + +#endif + static nrf_gpio_pin_pull_t get_pull(gpio_flags_t flags) { if (flags & GPIO_PULL_UP) { @@ -100,7 +118,6 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, nrfx_gpiote_pin_t abs_pin = NRF_GPIO_PIN_MAP(cfg->port_num, pin); nrf_gpio_pin_pull_t pull = get_pull(flags); nrf_gpio_pin_drive_t drive; - int pm_ret; switch (flags & (NRF_GPIO_DRIVE_MSK | GPIO_OPEN_DRAIN)) { case NRF_GPIO_DRIVE_S0S1: @@ -131,10 +148,7 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, return -EINVAL; } - ret = pm_device_runtime_get(port); - if (ret < 0) { - return ret; - } + port_retain_clear(cfg, BIT(pin)); if (flags & GPIO_OUTPUT_INIT_HIGH) { nrf_gpio_port_out_set(cfg->port, BIT(pin)); @@ -196,6 +210,8 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, err = nrfx_gpiote_output_configure(&cfg->gpiote, abs_pin, &output_config, NULL); + + port_retain_set(cfg, BIT(pin)); } else { nrfx_gpiote_input_pin_config_t input_pin_config = { .p_pull_config = &pull, @@ -223,9 +239,7 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, } end: - pm_ret = pm_device_runtime_put(port); - - return (ret != 0) ? ret : pm_ret; + return ret; } #ifdef CONFIG_GPIO_GET_CONFIG @@ -315,49 +329,37 @@ static int gpio_nrfx_port_set_masked_raw(const struct device *port, gpio_port_value_t value) { NRF_GPIO_Type *reg = get_port_cfg(port)->port; - int ret; const uint32_t set_mask = value & mask; const uint32_t clear_mask = (~set_mask) & mask; - ret = pm_device_runtime_get(port); - if (ret < 0) { - return ret; - } - + port_retain_clear(get_port_cfg(port), mask); nrf_gpio_port_out_set(reg, set_mask); nrf_gpio_port_out_clear(reg, clear_mask); - return pm_device_runtime_put(port); + port_retain_set(get_port_cfg(port), mask); + return 0; } static int gpio_nrfx_port_set_bits_raw(const struct device *port, gpio_port_pins_t mask) { NRF_GPIO_Type *reg = get_port_cfg(port)->port; - int ret; - - ret = pm_device_runtime_get(port); - if (ret < 0) { - return ret; - } + port_retain_clear(get_port_cfg(port), mask); nrf_gpio_port_out_set(reg, mask); - return pm_device_runtime_put(port); + port_retain_set(get_port_cfg(port), mask); + return 0; } static int gpio_nrfx_port_clear_bits_raw(const struct device *port, gpio_port_pins_t mask) { NRF_GPIO_Type *reg = get_port_cfg(port)->port; - int ret; - - ret = pm_device_runtime_get(port); - if (ret < 0) { - return ret; - } + port_retain_clear(get_port_cfg(port), mask); nrf_gpio_port_out_clear(reg, mask); - return pm_device_runtime_put(port); + port_retain_set(get_port_cfg(port), mask); + return 0; } static int gpio_nrfx_port_toggle_bits(const struct device *port, @@ -367,16 +369,12 @@ static int gpio_nrfx_port_toggle_bits(const struct device *port, const uint32_t value = nrf_gpio_port_out_read(reg) ^ mask; const uint32_t set_mask = value & mask; const uint32_t clear_mask = (~value) & mask; - int ret; - - ret = pm_device_runtime_get(port); - if (ret < 0) { - return ret; - } + port_retain_clear(get_port_cfg(port), mask); nrf_gpio_port_out_set(reg, set_mask); nrf_gpio_port_out_clear(reg, clear_mask); - return pm_device_runtime_put(port); + port_retain_set(get_port_cfg(port), mask); + return 0; } #ifdef CONFIG_GPIO_NRFX_INTERRUPT @@ -580,47 +578,11 @@ static void nrfx_gpio_handler(nrfx_gpiote_pin_t abs_pin, IRQ_CONNECT(DT_IRQN(node_id), DT_IRQ(node_id, priority), nrfx_isr, \ NRFX_CONCAT(nrfx_gpiote_, DT_PROP(node_id, instance), _irq_handler), 0); -static int gpio_nrfx_pm_suspend(const struct device *port) +static int gpio_nrfx_pm_hook(const struct device *port, enum pm_device_action action) { -#if GPIO_HAS_PAD_GROUP - const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); - - return pm_device_runtime_put(cfg->pad_group); -#else ARG_UNUSED(port); + ARG_UNUSED(action); return 0; -#endif -} - -static int gpio_nrfx_pm_resume(const struct device *port) -{ -#if GPIO_HAS_PAD_GROUP - const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); - - return pm_device_runtime_get(cfg->pad_group); -#else - ARG_UNUSED(port); - return 0; -#endif -} - -static int gpio_nrfx_pm_hook(const struct device *port, enum pm_device_action action) -{ - int ret; - - switch (action) { - case PM_DEVICE_ACTION_SUSPEND: - ret = gpio_nrfx_pm_suspend(port); - break; - case PM_DEVICE_ACTION_RESUME: - ret = gpio_nrfx_pm_resume(port); - break; - default: - ret = -ENOTSUP; - break; - } - - return ret; } static int gpio_nrfx_init(const struct device *port) @@ -687,13 +649,6 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { "Please enable GPIOTE instance for used GPIO port!")), \ ()) -#if GPIO_HAS_PAD_GROUP -#define GPIO_NRF_PAD_GROUP_INIT(id) \ - .pad_group = DEVICE_DT_GET(DT_INST_CHILD(id, pad_group)), -#else -#define GPIO_NRF_PAD_GROUP_INIT(id) -#endif - #define GPIO_NRF_DEVICE(id) \ GPIOTE_CHECK(id); \ static const struct gpio_nrfx_cfg gpio_nrfx_p##id##_cfg = { \ @@ -705,7 +660,6 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { .port_num = DT_INST_PROP(id, port), \ .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ .gpiote = GPIOTE_INSTANCE(id), \ - GPIO_NRF_PAD_GROUP_INIT(id) \ IF_ENABLED(GPIOTE_FEATURE_FLAG, \ (.flags = \ (DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) ? \ From dcc72044c700709f9efb5dcba2a76c3a7d3a52a9 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 28 Aug 2025 12:04:57 +0200 Subject: [PATCH 0168/3334] [nrf fromtree] drivers comparator: nordic: Align drivers to changed analog input types External analog input types changed from `string` to `int`. Signed-off-by: Jakub Zymelka (cherry picked from commit e5ecbd2112d01bd0970ed6a3298fef9b95447ed2) --- drivers/comparator/comparator_nrf_comp.c | 131 +++++++++--------- drivers/comparator/comparator_nrf_lpcomp.c | 54 +++++--- include/zephyr/drivers/comparator/nrf_comp.h | 61 ++------ .../zephyr/drivers/comparator/nrf_lpcomp.h | 37 +---- 4 files changed, 108 insertions(+), 175 deletions(-) diff --git a/drivers/comparator/comparator_nrf_comp.c b/drivers/comparator/comparator_nrf_comp.c index 311a864303bf..6c5acdf5c080 100644 --- a/drivers/comparator/comparator_nrf_comp.c +++ b/drivers/comparator/comparator_nrf_comp.c @@ -19,8 +19,7 @@ #define SHIM_NRF_COMP_DT_INST_REFSEL_IS_AREF(inst) \ DT_INST_ENUM_HAS_VALUE(inst, refsel, aref) -#define SHIM_NRF_COMP_DT_INST_EXTREFSEL(inst) \ - _CONCAT(COMP_NRF_COMP_EXTREFSEL_, DT_INST_STRING_TOKEN(inst, extrefsel)) +#define SHIM_NRF_COMP_DT_INST_EXTREFSEL(inst) DT_INST_PROP(inst, extrefsel) #define SHIM_NRF_COMP_DT_INST_MAIN_MODE_IS_SE(inst) \ DT_INST_ENUM_HAS_VALUE(inst, main_mode, se) @@ -43,8 +42,7 @@ #define SHIM_NRF_COMP_DT_INST_ISOURCE(inst) \ _CONCAT(COMP_NRF_COMP_ISOURCE_, DT_INST_STRING_TOKEN(inst, isource)) -#define SHIM_NRF_COMP_DT_INST_PSEL(inst) \ - _CONCAT(COMP_NRF_COMP_PSEL_, DT_INST_STRING_TOKEN(inst, psel)) +#define SHIM_NRF_COMP_DT_INST_PSEL(inst) DT_INST_PROP(inst, psel) #if defined(COMP_HYST_HYST_Hyst40mV) #define NRF_COMP_HYST_ENABLED NRF_COMP_HYST_40MV @@ -73,35 +71,50 @@ BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_DOWN(0) < 64); BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_UP(0) < 64); #endif -#if NRF_COMP_HAS_AIN_AS_PIN -BUILD_ASSERT((COMP_NRF_COMP_PSEL_AIN0 == 0)); -BUILD_ASSERT((COMP_NRF_COMP_PSEL_AIN7 == 7)); -BUILD_ASSERT((COMP_NRF_COMP_EXTREFSEL_AIN0 == 0)); -BUILD_ASSERT((COMP_NRF_COMP_EXTREFSEL_AIN7 == 7)); +#if (NRF_COMP_HAS_AIN_AS_PIN) +BUILD_ASSERT(NRF_COMP_AIN0 == 0); +BUILD_ASSERT(NRF_COMP_AIN7 == 7); #else -#ifndef COMP_PSEL_PSEL_AnalogInput4 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_AIN4); +BUILD_ASSERT((NRF_COMP_AIN0 == NRF_COMP_INPUT_0) && + (NRF_COMP_AIN1 == NRF_COMP_INPUT_1) && + (NRF_COMP_AIN2 == NRF_COMP_INPUT_2) && + (NRF_COMP_AIN3 == NRF_COMP_INPUT_3) && +#if defined(COMP_PSEL_PSEL_AnalogInput4) + (NRF_COMP_AIN4 == NRF_COMP_INPUT_4) && #endif - -#ifndef COMP_PSEL_PSEL_AnalogInput5 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_AIN5); +#if defined(COMP_PSEL_PSEL_AnalogInput5) + (NRF_COMP_AIN5 == NRF_COMP_INPUT_5) && #endif - -#ifndef COMP_PSEL_PSEL_AnalogInput6 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_AIN6); +#if defined(COMP_PSEL_PSEL_AnalogInput6) + (NRF_COMP_AIN6 == NRF_COMP_INPUT_6) && #endif - -#ifndef COMP_PSEL_PSEL_AnalogInput7 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_AIN7); +#if defined(COMP_PSEL_PSEL_AnalogInput7) + (NRF_COMP_AIN7 == NRF_COMP_INPUT_7) && #endif + (NRF_COMP_AIN0 == NRF_COMP_EXT_REF_0) && + (NRF_COMP_AIN1 == NRF_COMP_EXT_REF_1) && + (NRF_COMP_AIN2 == NRF_COMP_EXT_REF_2) && + (NRF_COMP_AIN3 == NRF_COMP_EXT_REF_3) && +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference4) + (NRF_COMP_AIN4 == NRF_COMP_EXT_REF_4) && #endif - -#ifndef COMP_PSEL_PSEL_VddDiv2 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_VDD_DIV2); +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference5) + (NRF_COMP_AIN5 == NRF_COMP_EXT_REF_5) && #endif - -#ifndef COMP_PSEL_PSEL_VddhDiv5 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_VDDH_DIV5); +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference6) + (NRF_COMP_AIN6 == NRF_COMP_EXT_REF_6) && +#endif +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference7) + (NRF_COMP_AIN7 == NRF_COMP_EXT_REF_7) && +#endif +#if defined(COMP_PSEL_PSEL_VddDiv2) + (NRF_COMP_VDD_DIV2 == NRF_COMP_VDD_DIV2) && +#endif +#if defined(COMP_PSEL_PSEL_VddhDiv5) + (NRF_COMP_VDDH_DIV5 == NRF_COMP_VDDH_DIV5) && +#endif + 1, + "Definitions from nrf-comp.h do not match those from HAL"); #endif #ifndef COMP_MODE_SP_Normal @@ -122,24 +135,6 @@ BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_ISOURCE(0) != COMP_NRF_COMP_ISOURCE_10UA); #endif #endif -#if SHIM_NRF_COMP_DT_INST_REFSEL_IS_AREF(0) -#ifndef COMP_EXTREFSEL_EXTREFSEL_AnalogReference4 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_EXTREFSEL(0) != COMP_NRF_COMP_EXTREFSEL_AIN4); -#endif - -#ifndef COMP_EXTREFSEL_EXTREFSEL_AnalogReference5 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_EXTREFSEL(0) != COMP_NRF_COMP_EXTREFSEL_AIN5); -#endif - -#ifndef COMP_EXTREFSEL_EXTREFSEL_AnalogReference6 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_EXTREFSEL(0) != COMP_NRF_COMP_EXTREFSEL_AIN6); -#endif - -#ifndef COMP_EXTREFSEL_EXTREFSEL_AnalogReference7 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_EXTREFSEL(0) != COMP_NRF_COMP_EXTREFSEL_AIN7); -#endif -#endif - #if SHIM_NRF_COMP_DT_INST_MAIN_MODE_IS_SE(0) #ifndef COMP_REFSEL_REFSEL_Int1V8 BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_INT_1V8); @@ -246,69 +241,69 @@ static int shim_nrf_comp_pm_callback(const struct device *dev, enum pm_device_ac } #if (NRF_COMP_HAS_AIN_AS_PIN) -static int shim_nrf_comp_psel_to_nrf(enum comp_nrf_comp_psel shim, +static int shim_nrf_comp_psel_to_nrf(uint8_t shim, nrf_comp_input_t *nrf) { if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { return -EINVAL; } - *nrf = shim_nrf_comp_ain_map[(uint32_t)shim]; + *nrf = shim_nrf_comp_ain_map[shim]; return 0; } #else -static int shim_nrf_comp_psel_to_nrf(enum comp_nrf_comp_psel shim, +static int shim_nrf_comp_psel_to_nrf(uint8_t shim, nrf_comp_input_t *nrf) { switch (shim) { - case COMP_NRF_COMP_PSEL_AIN0: + case NRF_COMP_AIN0: *nrf = NRF_COMP_INPUT_0; break; - case COMP_NRF_COMP_PSEL_AIN1: + case NRF_COMP_AIN1: *nrf = NRF_COMP_INPUT_1; break; - case COMP_NRF_COMP_PSEL_AIN2: + case NRF_COMP_AIN2: *nrf = NRF_COMP_INPUT_2; break; - case COMP_NRF_COMP_PSEL_AIN3: + case NRF_COMP_AIN3: *nrf = NRF_COMP_INPUT_3; break; #if defined(COMP_PSEL_PSEL_AnalogInput4) - case COMP_NRF_COMP_PSEL_AIN4: + case NRF_COMP_AIN4: *nrf = NRF_COMP_INPUT_4; break; #endif #if defined(COMP_PSEL_PSEL_AnalogInput5) - case COMP_NRF_COMP_PSEL_AIN5: + case NRF_COMP_AIN5: *nrf = NRF_COMP_INPUT_5; break; #endif #if defined(COMP_PSEL_PSEL_AnalogInput6) - case COMP_NRF_COMP_PSEL_AIN6: + case NRF_COMP_AIN6: *nrf = NRF_COMP_INPUT_6; break; #endif #if defined(COMP_PSEL_PSEL_AnalogInput7) - case COMP_NRF_COMP_PSEL_AIN7: + case NRF_COMP_AIN7: *nrf = NRF_COMP_INPUT_7; break; #endif #if defined(COMP_PSEL_PSEL_VddDiv2) - case COMP_NRF_COMP_PSEL_VDD_DIV2: + case NRF_COMP_AIN_VDD_DIV2: *nrf = NRF_COMP_VDD_DIV2; break; #endif #if defined(COMP_PSEL_PSEL_VddhDiv5) - case COMP_NRF_COMP_PSEL_VDDH_DIV5: + case NRF_COMP_AIN_VDDH_DIV5: *nrf = NRF_COMP_VDDH_DIV5; break; #endif @@ -382,57 +377,57 @@ static int shim_nrf_comp_isource_to_nrf(enum comp_nrf_comp_isource shim, #endif #if (NRF_COMP_HAS_AIN_AS_PIN) -static int shim_nrf_comp_extrefsel_to_nrf(enum comp_nrf_comp_extrefsel shim, +static int shim_nrf_comp_extrefsel_to_nrf(uint8_t shim, nrf_comp_ext_ref_t *nrf) { if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { return -EINVAL; } - *nrf = shim_nrf_comp_ain_map[(uint32_t)shim]; + *nrf = shim_nrf_comp_ain_map[shim]; return 0; } #else -static int shim_nrf_comp_extrefsel_to_nrf(enum comp_nrf_comp_extrefsel shim, +static int shim_nrf_comp_extrefsel_to_nrf(uint8_t shim, nrf_comp_ext_ref_t *nrf) { switch (shim) { - case COMP_NRF_COMP_EXTREFSEL_AIN0: + case NRF_COMP_AIN0: *nrf = NRF_COMP_EXT_REF_0; break; - case COMP_NRF_COMP_EXTREFSEL_AIN1: + case NRF_COMP_AIN1: *nrf = NRF_COMP_EXT_REF_1; break; - case COMP_NRF_COMP_EXTREFSEL_AIN2: + case NRF_COMP_AIN2: *nrf = NRF_COMP_EXT_REF_2; break; - case COMP_NRF_COMP_EXTREFSEL_AIN3: + case NRF_COMP_AIN3: *nrf = NRF_COMP_EXT_REF_3; break; #if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference4) - case COMP_NRF_COMP_EXTREFSEL_AIN4: + case NRF_COMP_AIN4: *nrf = NRF_COMP_EXT_REF_4; break; #endif #if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference5) - case COMP_NRF_COMP_EXTREFSEL_AIN5: + case NRF_COMP_AIN5: *nrf = NRF_COMP_EXT_REF_5; break; #endif #if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference6) - case COMP_NRF_COMP_EXTREFSEL_AIN6: + case NRF_COMP_AIN6: *nrf = NRF_COMP_EXT_REF_6; break; #endif #if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference7) - case COMP_NRF_COMP_EXTREFSEL_AIN7: + case NRF_COMP_AIN7: *nrf = NRF_COMP_EXT_REF_7; break; #endif diff --git a/drivers/comparator/comparator_nrf_lpcomp.c b/drivers/comparator/comparator_nrf_lpcomp.c index 623c7adacd42..6faba2b8669c 100644 --- a/drivers/comparator/comparator_nrf_lpcomp.c +++ b/drivers/comparator/comparator_nrf_lpcomp.c @@ -21,14 +21,12 @@ #define SHIM_NRF_LPCOMP_DT_INST_REFSEL_IS_AREF(inst) \ DT_INST_ENUM_HAS_VALUE(inst, refsel, aref) -#define SHIM_NRF_LPCOMP_DT_INST_EXTREFSEL(inst) \ - _CONCAT(COMP_NRF_LPCOMP_EXTREFSEL_, DT_INST_STRING_TOKEN(inst, extrefsel)) +#define SHIM_NRF_LPCOMP_DT_INST_EXTREFSEL(inst) DT_INST_PROP(inst, extrefsel) #define SHIM_NRF_LPCOMP_DT_INST_ENABLE_HYST(inst) \ DT_INST_PROP(inst, enable_hyst) -#define SHIM_NRF_LPCOMP_DT_INST_PSEL(inst) \ - _CONCAT(COMP_NRF_LPCOMP_PSEL_, DT_INST_STRING_TOKEN(inst, psel)) +#define SHIM_NRF_LPCOMP_DT_INST_PSEL(inst) DT_INST_PROP(inst, psel) struct shim_nrf_lpcomp_data { nrfx_lpcomp_config_t config; @@ -40,10 +38,20 @@ struct shim_nrf_lpcomp_data { }; #if (NRF_LPCOMP_HAS_AIN_AS_PIN) -BUILD_ASSERT(COMP_NRF_LPCOMP_PSEL_AIN0 == 0); -BUILD_ASSERT(COMP_NRF_LPCOMP_PSEL_AIN7 == 7); -BUILD_ASSERT(COMP_NRF_LPCOMP_EXTREFSEL_AIN0 == 0); -BUILD_ASSERT(COMP_NRF_LPCOMP_EXTREFSEL_AIN1 == 1); +BUILD_ASSERT(NRF_COMP_AIN0 == 0); +BUILD_ASSERT(NRF_COMP_AIN7 == 7); +#else +BUILD_ASSERT((NRF_COMP_AIN0 == NRF_LPCOMP_INPUT_0) && + (NRF_COMP_AIN1 == NRF_LPCOMP_INPUT_1) && + (NRF_COMP_AIN2 == NRF_LPCOMP_INPUT_2) && + (NRF_COMP_AIN3 == NRF_LPCOMP_INPUT_3) && + (NRF_COMP_AIN4 == NRF_LPCOMP_INPUT_4) && + (NRF_COMP_AIN5 == NRF_LPCOMP_INPUT_5) && + (NRF_COMP_AIN6 == NRF_LPCOMP_INPUT_6) && + (NRF_COMP_AIN7 == NRF_LPCOMP_INPUT_7) && + (NRF_COMP_AIN0 == NRF_LPCOMP_EXT_REF_REF0) && + (NRF_COMP_AIN1 == NRF_LPCOMP_EXT_REF_REF1), + "Definitions from nrf-comp.h do not match those from HAL"); #endif #if (LPCOMP_REFSEL_RESOLUTION == 8) @@ -126,50 +134,50 @@ static int shim_nrf_lpcomp_pm_callback(const struct device *dev, enum pm_device_ } #if (NRF_LPCOMP_HAS_AIN_AS_PIN) -static int shim_nrf_lpcomp_psel_to_nrf(enum comp_nrf_lpcomp_psel shim, +static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, nrf_lpcomp_input_t *nrf) { if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { return -EINVAL; } - *nrf = shim_nrf_comp_ain_map[(uint32_t)shim]; + *nrf = shim_nrf_comp_ain_map[shim]; return 0; } #else -static int shim_nrf_lpcomp_psel_to_nrf(enum comp_nrf_lpcomp_psel shim, +static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, nrf_lpcomp_input_t *nrf) { switch (shim) { - case COMP_NRF_LPCOMP_PSEL_AIN0: + case NRF_COMP_AIN0: *nrf = NRF_LPCOMP_INPUT_0; break; - case COMP_NRF_LPCOMP_PSEL_AIN1: + case NRF_COMP_AIN1: *nrf = NRF_LPCOMP_INPUT_1; break; - case COMP_NRF_LPCOMP_PSEL_AIN2: + case NRF_COMP_AIN2: *nrf = NRF_LPCOMP_INPUT_2; break; - case COMP_NRF_LPCOMP_PSEL_AIN3: + case NRF_COMP_AIN3: *nrf = NRF_LPCOMP_INPUT_3; break; - case COMP_NRF_LPCOMP_PSEL_AIN4: + case NRF_COMP_AIN4: *nrf = NRF_LPCOMP_INPUT_4; break; - case COMP_NRF_LPCOMP_PSEL_AIN5: + case NRF_COMP_AIN5: *nrf = NRF_LPCOMP_INPUT_5; break; - case COMP_NRF_LPCOMP_PSEL_AIN6: + case NRF_COMP_AIN6: *nrf = NRF_LPCOMP_INPUT_6; break; - case COMP_NRF_LPCOMP_PSEL_AIN7: + case NRF_COMP_AIN7: *nrf = NRF_LPCOMP_INPUT_7; break; @@ -182,7 +190,7 @@ static int shim_nrf_lpcomp_psel_to_nrf(enum comp_nrf_lpcomp_psel shim, #endif #if (NRF_LPCOMP_HAS_AIN_AS_PIN) -static int shim_nrf_lpcomp_extrefsel_to_nrf(enum comp_nrf_lpcomp_extrefsel shim, +static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, nrf_lpcomp_ext_ref_t *nrf) { if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { @@ -193,15 +201,15 @@ static int shim_nrf_lpcomp_extrefsel_to_nrf(enum comp_nrf_lpcomp_extrefsel shim, return 0; } #else -static int shim_nrf_lpcomp_extrefsel_to_nrf(enum comp_nrf_lpcomp_extrefsel shim, +static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, nrf_lpcomp_ext_ref_t *nrf) { switch (shim) { - case COMP_NRF_LPCOMP_EXTREFSEL_AIN0: + case NRF_COMP_AIN0: *nrf = NRF_LPCOMP_EXT_REF_REF0; break; - case COMP_NRF_LPCOMP_EXTREFSEL_AIN1: + case NRF_COMP_AIN1: *nrf = NRF_LPCOMP_EXT_REF_REF1; break; diff --git a/include/zephyr/drivers/comparator/nrf_comp.h b/include/zephyr/drivers/comparator/nrf_comp.h index 59e1cbbb3ce9..09c870f9a33c 100644 --- a/include/zephyr/drivers/comparator/nrf_comp.h +++ b/include/zephyr/drivers/comparator/nrf_comp.h @@ -7,56 +7,13 @@ #ifndef ZEPHYR_INCLUDE_DRIVERS_COMP_NRF_COMP_H_ #define ZEPHYR_INCLUDE_DRIVERS_COMP_NRF_COMP_H_ +#include #include #ifdef __cplusplus extern "C" { #endif -/** Positive input selection */ -enum comp_nrf_comp_psel { - /** AIN0 external input */ - COMP_NRF_COMP_PSEL_AIN0, - /** AIN1 external input */ - COMP_NRF_COMP_PSEL_AIN1, - /** AIN2 external input */ - COMP_NRF_COMP_PSEL_AIN2, - /** AIN3 external input */ - COMP_NRF_COMP_PSEL_AIN3, - /** AIN4 external input */ - COMP_NRF_COMP_PSEL_AIN4, - /** AIN5 external input */ - COMP_NRF_COMP_PSEL_AIN5, - /** AIN6 external input */ - COMP_NRF_COMP_PSEL_AIN6, - /** AIN7 external input */ - COMP_NRF_COMP_PSEL_AIN7, - /** VDD / 2 */ - COMP_NRF_COMP_PSEL_VDD_DIV2, - /** VDDH / 5 */ - COMP_NRF_COMP_PSEL_VDDH_DIV5, -}; - -/** External reference selection */ -enum comp_nrf_comp_extrefsel { - /** AIN0 external input */ - COMP_NRF_COMP_EXTREFSEL_AIN0, - /** AIN1 external input */ - COMP_NRF_COMP_EXTREFSEL_AIN1, - /** AIN2 external input */ - COMP_NRF_COMP_EXTREFSEL_AIN2, - /** AIN3 external input */ - COMP_NRF_COMP_EXTREFSEL_AIN3, - /** AIN4 external input */ - COMP_NRF_COMP_EXTREFSEL_AIN4, - /** AIN5 external input */ - COMP_NRF_COMP_EXTREFSEL_AIN5, - /** AIN6 external input */ - COMP_NRF_COMP_EXTREFSEL_AIN6, - /** AIN7 external input */ - COMP_NRF_COMP_EXTREFSEL_AIN7, -}; - /** Reference selection */ enum comp_nrf_comp_refsel { /** Internal 1.2V reference */ @@ -103,14 +60,14 @@ enum comp_nrf_comp_isource { * @note Hysteresis up in volts = ((th_up + 1) / 64) * ref */ struct comp_nrf_comp_se_config { - /** Positive input selection */ - enum comp_nrf_comp_psel psel; + /** Positive input selection defined by the NRF_COMP_AIN defines */ + uint8_t psel; /** Speed mode selection */ enum comp_nrf_comp_sp_mode sp_mode; /** Current source configuration */ enum comp_nrf_comp_isource isource; - /** External reference selection */ - enum comp_nrf_comp_extrefsel extrefsel; + /** External reference input selection defined by the NRF_COMP_AIN defines */ + uint8_t extrefsel; /** Reference selection */ enum comp_nrf_comp_refsel refsel; /** Hysteresis down threshold configuration */ @@ -133,14 +90,14 @@ int comp_nrf_comp_configure_se(const struct device *dev, /** Differential mode configuration structure */ struct comp_nrf_comp_diff_config { - /** Positive input selection */ - enum comp_nrf_comp_psel psel; + /** Positive input selection defined by the NRF_COMP_AIN defines */ + uint8_t psel; /** Speed mode selection */ enum comp_nrf_comp_sp_mode sp_mode; /** Current source configuration */ enum comp_nrf_comp_isource isource; - /** Negative input selection */ - enum comp_nrf_comp_extrefsel extrefsel; + /** Negative input selection defined by the NRF_COMP_AIN defines */ + uint8_t extrefsel; /** Hysteresis configuration */ bool enable_hyst; }; diff --git a/include/zephyr/drivers/comparator/nrf_lpcomp.h b/include/zephyr/drivers/comparator/nrf_lpcomp.h index e1f2343a8de8..1cae4caae330 100644 --- a/include/zephyr/drivers/comparator/nrf_lpcomp.h +++ b/include/zephyr/drivers/comparator/nrf_lpcomp.h @@ -7,40 +7,13 @@ #ifndef ZEPHYR_INCLUDE_DRIVERS_COMP_NRF_LPCOMP_H_ #define ZEPHYR_INCLUDE_DRIVERS_COMP_NRF_LPCOMP_H_ +#include #include #ifdef __cplusplus extern "C" { #endif -/** Positive input selection */ -enum comp_nrf_lpcomp_psel { - /** AIN0 external input */ - COMP_NRF_LPCOMP_PSEL_AIN0, - /** AIN1 external input */ - COMP_NRF_LPCOMP_PSEL_AIN1, - /** AIN2 external input */ - COMP_NRF_LPCOMP_PSEL_AIN2, - /** AIN3 external input */ - COMP_NRF_LPCOMP_PSEL_AIN3, - /** AIN4 external input */ - COMP_NRF_LPCOMP_PSEL_AIN4, - /** AIN5 external input */ - COMP_NRF_LPCOMP_PSEL_AIN5, - /** AIN6 external input */ - COMP_NRF_LPCOMP_PSEL_AIN6, - /** AIN7 external input */ - COMP_NRF_LPCOMP_PSEL_AIN7, -}; - -/** External reference selection */ -enum comp_nrf_lpcomp_extrefsel { - /** AIN0 external input */ - COMP_NRF_LPCOMP_EXTREFSEL_AIN0, - /** AIN1 external input */ - COMP_NRF_LPCOMP_EXTREFSEL_AIN1, -}; - /** Reference selection */ enum comp_nrf_lpcomp_refsel { /** Use (VDD * (1/8)) as reference */ @@ -83,10 +56,10 @@ enum comp_nrf_lpcomp_refsel { * @note extrefsel is only used if refsel == COMP_NRF_LPCOMP_REFSEL_AREF */ struct comp_nrf_lpcomp_config { - /** Positive input selection */ - enum comp_nrf_lpcomp_psel psel; - /** External reference selection */ - enum comp_nrf_lpcomp_extrefsel extrefsel; + /** Positive input selection defined by the NRF_COMP_AIN defines */ + uint8_t psel; + /** External reference input selection defined by the NRF_COMP_AIN defines */ + uint8_t extrefsel; /** Reference selection */ enum comp_nrf_lpcomp_refsel refsel; /** Hysteresis configuration */ From 8d3892fc7359e5f60f6d6a287d320e0c858f9b24 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Tue, 14 Oct 2025 09:22:59 +0200 Subject: [PATCH 0169/3334] [nrf fromlist] drivers: nordic: support pin retention for AIN Devices which use AIN (COMP, LPCOMP, SAADC) don't use pinctrl to configure their pins, thus pinctrl can't manage pin retention like is done for other devices. Thus for now, add manually disabling pin retention to the drivers. In the future, we should probably use pinctrl for these inputs as well, at which point this commit can be reverted. Upstream PR #: 97452 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 9028c3899da2d53abca834dd1c6843a1d6aff567) --- drivers/adc/adc_nrfx_saadc.c | 11 +++++++++++ drivers/comparator/comparator_nrf_comp.c | 6 ++++++ drivers/comparator/comparator_nrf_lpcomp.c | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 2c56e79f4897..32be9825d243 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -16,6 +16,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(adc_nrfx_saadc, CONFIG_ADC_LOG_LEVEL); @@ -200,6 +201,10 @@ static int input_assign(nrf_saadc_input_t *pin_p, *pin_p = saadc_psels[channel_cfg->input_positive]; +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + nrf_gpio_pin_retain_disable(saadc_psels[channel_cfg->input_positive]); +#endif + if (channel_cfg->differential) { if (channel_cfg->input_negative > ARRAY_SIZE(saadc_psels) || (IS_ENABLED(CONFIG_NRF_PLATFORM_HALTIUM) && @@ -212,6 +217,12 @@ static int input_assign(nrf_saadc_input_t *pin_p, *pin_n = channel_cfg->input_negative == NRF_SAADC_GND ? NRF_SAADC_INPUT_DISABLED : saadc_psels[channel_cfg->input_negative]; + +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + if (channel_cfg->input_negative != NRF_SAADC_GND) { + nrf_gpio_pin_retain_disable(saadc_psels[channel_cfg->input_negative]); + } +#endif } else { *pin_n = NRF_SAADC_INPUT_DISABLED; } diff --git a/drivers/comparator/comparator_nrf_comp.c b/drivers/comparator/comparator_nrf_comp.c index 6c5acdf5c080..7178c51675d8 100644 --- a/drivers/comparator/comparator_nrf_comp.c +++ b/drivers/comparator/comparator_nrf_comp.c @@ -5,6 +5,7 @@ */ #include +#include #include #include @@ -249,6 +250,11 @@ static int shim_nrf_comp_psel_to_nrf(uint8_t shim, } *nrf = shim_nrf_comp_ain_map[shim]; + +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + nrf_gpio_pin_retain_disable(shim_nrf_comp_ain_map[shim]); +#endif + return 0; } #else diff --git a/drivers/comparator/comparator_nrf_lpcomp.c b/drivers/comparator/comparator_nrf_lpcomp.c index 6faba2b8669c..dbd58d342360 100644 --- a/drivers/comparator/comparator_nrf_lpcomp.c +++ b/drivers/comparator/comparator_nrf_lpcomp.c @@ -5,6 +5,7 @@ */ #include +#include #include #include @@ -142,6 +143,11 @@ static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, } *nrf = shim_nrf_comp_ain_map[shim]; + +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + nrf_gpio_pin_retain_disable(shim_nrf_comp_ain_map[shim]); +#endif + return 0; } #else From d9c72ef97d5059e8bd4a623adc516798bbb60fcc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Tue, 14 Oct 2025 14:37:17 +0200 Subject: [PATCH 0170/3334] [nrf fromlist] dts: drivers: nordic: nrf54h: Don't manage clocks from drivers Clocks are requested automatically by hardware on the nRF54H. Remove additional handling from device drivers, and disable the now unmanaged clocks in the devicetree. Updates: - can_nrf - counter_nrfx_timer - uart_nrfx_uarte - spi_nrfx_spim - spi_nrfx_spis Upstream PR #: 97452 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit c01ccc5d445348011a362116533b8c53319f2941) --- drivers/can/can_nrf.c | 28 +-- drivers/counter/counter_nrfx_timer.c | 64 +------ drivers/pwm/pwm_nrfx.c | 109 +----------- drivers/serial/Kconfig.nrfx | 7 - drivers/serial/uart_nrfx_uarte.c | 163 ++---------------- drivers/spi/spi_nrfx_spim.c | 108 +----------- drivers/spi/spi_nrfx_spis.c | 38 +--- dts/arm/nordic/nrf54h20_cpuapp.dtsi | 12 -- dts/arm/nordic/nrf54h20_cpurad.dtsi | 12 -- .../configs/cpuapp_hsfll.overlay | 4 + .../clock_control/configs/fll16m.overlay | 4 + .../configs/global_hsfll.overlay | 4 + .../clock_control/configs/lfclk.overlay | 4 + .../clock_control/configs/uart135.overlay | 4 + .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 21 +++ .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - 16 files changed, 65 insertions(+), 518 deletions(-) create mode 100644 tests/drivers/clock_control/nrf_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/drivers/can/can_nrf.c b/drivers/can/can_nrf.c index 8e19b5420356..38021d764b17 100644 --- a/drivers/can/can_nrf.c +++ b/drivers/can/can_nrf.c @@ -29,7 +29,6 @@ struct can_nrf_config { uint32_t mrba; uint32_t mram; const struct device *auxpll; - const struct device *hsfll; const struct pinctrl_dev_config *pcfg; void (*irq_configure)(void); uint16_t irq; @@ -133,40 +132,16 @@ static const struct can_mcan_ops can_mcan_nrf_ops = { .clear_mram = can_nrf_clear_mram, }; -static int configure_hsfll(const struct device *dev, bool on) -{ - const struct can_mcan_config *mcan_config = dev->config; - const struct can_nrf_config *config = mcan_config->custom; - struct nrf_clock_spec spec = { 0 }; - - /* If CAN is on, HSFLL frequency >= AUXPLL frequency */ - if (on) { - int ret; - - ret = clock_control_get_rate(config->auxpll, NULL, &spec.frequency); - if (ret < 0) { - return ret; - } - } - - return nrf_clock_control_request_sync(config->hsfll, &spec, K_FOREVER); -} - static int can_nrf_init(const struct device *dev) { const struct can_mcan_config *mcan_config = dev->config; const struct can_nrf_config *config = mcan_config->custom; int ret; - if (!device_is_ready(config->auxpll) || !device_is_ready(config->hsfll)) { + if (!device_is_ready(config->auxpll)) { return -ENODEV; } - ret = configure_hsfll(dev, true); - if (ret < 0) { - return ret; - } - ret = nrf_clock_control_request_sync(config->auxpll, NULL, K_FOREVER); if (ret < 0) { return ret; @@ -215,7 +190,6 @@ static int can_nrf_init(const struct device *dev) .mram = CAN_MCAN_DT_INST_MRAM_ADDR(n), \ .auxpll = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR_BY_NAME(n, auxpll)), \ .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n), \ - .hsfll = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR_BY_NAME(n, hsfll)), \ .irq = DT_INST_IRQN(n), \ .irq_configure = can_nrf_irq_configure##n, \ }; \ diff --git a/drivers/counter/counter_nrfx_timer.c b/drivers/counter/counter_nrfx_timer.c index 26fa49b1aeed..1a614b391c06 100644 --- a/drivers/counter/counter_nrfx_timer.c +++ b/drivers/counter/counter_nrfx_timer.c @@ -5,7 +5,6 @@ */ #include #include -#include #include #include #include @@ -35,21 +34,11 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, LOG_LEVEL); #define MAYBE_CONST_CONFIG const #endif -#if NRF_DT_INST_ANY_IS_FAST && CONFIG_CLOCK_CONTROL -#define COUNTER_IS_FAST(idx) NRF_DT_INST_IS_FAST(idx) -#define COUNTER_ANY_FAST -#else -#define COUNTER_IS_FAST(idx) 0 -#endif - struct counter_nrfx_data { counter_top_callback_t top_cb; void *top_user_data; uint32_t guard_period; atomic_t cc_int_pending; -#ifdef COUNTER_ANY_FAST - atomic_t active; -#endif }; struct counter_nrfx_ch_data { @@ -61,10 +50,6 @@ struct counter_nrfx_config { struct counter_config_info info; struct counter_nrfx_ch_data *ch_data; NRF_TIMER_Type *timer; -#ifdef COUNTER_ANY_FAST - const struct device *clk_dev; - struct nrf_clock_spec clk_spec; -#endif LOG_INSTANCE_PTR_DECLARE(log); }; @@ -78,18 +63,6 @@ static int start(const struct device *dev) { const struct counter_nrfx_config *config = dev->config; -#ifdef COUNTER_ANY_FAST - struct counter_nrfx_data *data = dev->data; - - if (config->clk_dev && atomic_cas(&data->active, 0, 1)) { - int err; - - err = nrf_clock_control_request_sync(config->clk_dev, &config->clk_spec, K_FOREVER); - if (err < 0) { - return err; - } - } -#endif nrf_timer_task_trigger(config->timer, NRF_TIMER_TASK_START); return 0; @@ -106,19 +79,6 @@ static int stop(const struct device *dev) nrf_timer_task_trigger(config->timer, NRF_TIMER_TASK_CLEAR); #endif -#ifdef COUNTER_ANY_FAST - struct counter_nrfx_data *data = dev->data; - - if (config->clk_dev && atomic_cas(&data->active, 1, 0)) { - int err; - - err = nrf_clock_control_release(config->clk_dev, &config->clk_spec); - if (err < 0) { - return err; - } - } -#endif - return 0; } @@ -459,20 +419,6 @@ static DEVICE_API(counter, counter_nrfx_driver_api) = { .set_guard_period = set_guard_period, }; -/* Get initialization level of an instance. Instances that requires clock control - * which is using nrfs (IPC) are initialized later. - */ -#define TIMER_INIT_LEVEL(idx) \ - COND_CODE_1(COUNTER_IS_FAST(idx), (POST_KERNEL), (PRE_KERNEL_1)) - -/* Get initialization priority of an instance. Instances that requires clock control - * which is using nrfs (IPC) are initialized later. - */ -#define TIMER_INIT_PRIO(idx) \ - COND_CODE_1(COUNTER_IS_FAST(idx), \ - (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ - (CONFIG_COUNTER_INIT_PRIORITY)) - /* * Device instantiation is done with node labels due to HAL API * requirements. In particular, TIMERx_MAX_SIZE values from HALs @@ -525,14 +471,6 @@ static DEVICE_API(counter, counter_nrfx_driver_api) = { }, \ .ch_data = counter##idx##_ch_data, \ .timer = (NRF_TIMER_Type *)DT_INST_REG_ADDR(idx), \ - IF_ENABLED(COUNTER_IS_FAST(idx), \ - (.clk_dev = DEVICE_DT_GET_OR_NULL(DT_CLOCKS_CTLR(DT_DRV_INST(idx))), \ - .clk_spec = { \ - .frequency = NRF_PERIPH_GET_FREQUENCY(DT_DRV_INST(idx)), \ - .accuracy = 0, \ - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, \ - }, \ - )) \ LOG_INSTANCE_PTR_INIT(log, LOG_MODULE_NAME, idx) \ }; \ DEVICE_DT_INST_DEFINE(idx, \ @@ -540,7 +478,7 @@ static DEVICE_API(counter, counter_nrfx_driver_api) = { NULL, \ &counter_##idx##_data, \ &nrfx_counter_##idx##_config.info, \ - TIMER_INIT_LEVEL(idx), TIMER_INIT_PRIO(idx), \ + PRE_KERNEL_1, CONFIG_COUNTER_INIT_PRIORITY, \ &counter_nrfx_driver_api); DT_INST_FOREACH_STATUS_OKAY(COUNTER_NRFX_TIMER_DEVICE) diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 8565fd1187ac..55a2b759b18b 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -13,7 +13,6 @@ #include #include #include -#include #include @@ -36,20 +35,6 @@ LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL); #define PWM(dev_idx) DT_NODELABEL(pwm##dev_idx) #define PWM_PROP(dev_idx, prop) DT_PROP(PWM(dev_idx), prop) #define PWM_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(PWM(idx), prop) -#define PWM_NRFX_IS_FAST(idx) NRF_DT_IS_FAST(PWM(idx)) - -#if NRF_DT_INST_ANY_IS_FAST -#define PWM_NRFX_FAST_PRESENT 1 -/* If fast instances are used then system managed device PM cannot be used because - * it may call PM actions from locked context and fast PWM PM actions can only be - * called in a thread context. - */ -BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); -#endif - -#if defined(PWM_NRFX_FAST_PRESENT) && CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL -#define PWM_NRFX_USE_CLOCK_CONTROL 1 -#endif #define PWM_NRFX_CH_POLARITY_MASK BIT(15) #define PWM_NRFX_CH_COMPARE_MASK BIT_MASK(15) @@ -65,10 +50,6 @@ struct pwm_nrfx_config { #ifdef CONFIG_DCACHE uint32_t mem_attr; #endif -#ifdef PWM_NRFX_USE_CLOCK_CONTROL - const struct device *clk_dev; - struct nrf_clock_spec clk_spec; -#endif }; struct pwm_nrfx_data { @@ -77,27 +58,12 @@ struct pwm_nrfx_data { uint8_t pwm_needed; uint8_t prescaler; bool stop_requested; -#ifdef PWM_NRFX_USE_CLOCK_CONTROL - bool clock_requested; -#endif }; /* Ensure the pwm_needed bit mask can accommodate all available channels. */ #if (NRF_PWM_CHANNEL_COUNT > 8) #error "Current implementation supports maximum 8 channels." #endif -#ifdef PWM_NRFX_FAST_PRESENT -static bool pwm_is_fast(const struct pwm_nrfx_config *config) -{ - return config->clock_freq > MHZ(16); -} -#else -static bool pwm_is_fast(const struct pwm_nrfx_config *config) -{ - return false; -} -#endif - static uint16_t *seq_values_ptr_get(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; @@ -178,21 +144,6 @@ static int stop_pwm(const struct device *dev) */ nrfx_pwm_stop(&config->pwm, false); -#if PWM_NRFX_USE_CLOCK_CONTROL - struct pwm_nrfx_data *data = dev->data; - - if (data->clock_requested) { - int ret = nrf_clock_control_release(config->clk_dev, &config->clk_spec); - - if (ret < 0) { - LOG_ERR("Global HSFLL release failed: %d", ret); - return ret; - } - - data->clock_requested = false; - } -#endif - return 0; } @@ -232,9 +183,8 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, /* Constantly active (duty 100%). */ /* This value is always greater than or equal to COUNTERTOP. */ compare_value = PWM_NRFX_CH_COMPARE_MASK; - needs_pwm = pwm_is_fast(config) || - (IS_ENABLED(NRF_PWM_HAS_IDLEOUT) && - IS_ENABLED(CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100)); + needs_pwm = IS_ENABLED(NRF_PWM_HAS_IDLEOUT) && + IS_ENABLED(CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100); } else { /* PWM generation needed. Check if the requested period matches * the one that is currently set, or the PWM peripheral can be @@ -290,22 +240,6 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, * registers and drives its outputs accordingly. */ if (data->pwm_needed == 0) { - if (pwm_is_fast(config)) { -#if PWM_NRFX_USE_CLOCK_CONTROL - if (data->clock_requested) { - int ret = nrf_clock_control_release(config->clk_dev, - &config->clk_spec); - - if (ret < 0) { - LOG_ERR("Global HSFLL release failed: %d", ret); - return ret; - } - - data->clock_requested = false; - } -#endif - return 0; - } int ret = stop_pwm(dev); if (ret < 0) { @@ -332,20 +266,6 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, * until another playback is requested (new values will be * loaded then) or the PWM peripheral is stopped. */ -#if PWM_NRFX_USE_CLOCK_CONTROL - if (config->clk_dev && !data->clock_requested) { - int ret = nrf_clock_control_request_sync(config->clk_dev, - &config->clk_spec, - K_FOREVER); - - if (ret < 0) { - LOG_ERR("Global HSFLL request failed: %d", ret); - return ret; - } - - data->clock_requested = true; - } -#endif nrfx_pwm_simple_playback(&config->pwm, &config->seq, 1, NRFX_PWM_FLAG_NO_EVT_FINISHED); } @@ -463,21 +383,6 @@ static int pwm_nrfx_init(const struct device *dev) COND_CODE_1(PWM_HAS_PROP(idx, memory_regions), \ (DT_PROP_OR(PWM_MEM_REGION(idx), zephyr_memory_attr, 0)), (0)) -/* Fast instances depend on the global HSFLL clock controller (as they need - * to request the highest frequency from it to operate correctly), so they - * must be initialized after that controller driver, hence the default PWM - * initialization priority may be too early for them. - */ -#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY) && \ - CONFIG_PWM_INIT_PRIORITY < CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY -#define PWM_INIT_PRIORITY(idx) \ - COND_CODE_1(PWM_NRFX_IS_FAST(idx), \ - (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ - (CONFIG_PWM_INIT_PRIORITY)) -#else -#define PWM_INIT_PRIORITY(idx) CONFIG_PWM_INIT_PRIORITY -#endif - #define PWM_NRFX_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ @@ -506,14 +411,6 @@ static int pwm_nrfx_init(const struct device *dev) (16ul * 1000ul * 1000ul)), \ IF_ENABLED(CONFIG_DCACHE, \ (.mem_attr = PWM_GET_MEM_ATTR(idx),)) \ - IF_ENABLED(PWM_NRFX_USE_CLOCK_CONTROL, \ - (.clk_dev = PWM_NRFX_IS_FAST(idx) \ - ? DEVICE_DT_GET(DT_CLOCKS_CTLR(PWM(idx))) \ - : NULL, \ - .clk_spec = { \ - .frequency = \ - NRF_PERIPH_GET_FREQUENCY(PWM(idx)), \ - },)) \ }; \ static int pwm_nrfx_init##idx(const struct device *dev) \ { \ @@ -526,7 +423,7 @@ static int pwm_nrfx_init(const struct device *dev) pwm_nrfx_init##idx, PM_DEVICE_DT_GET(PWM(idx)), \ &pwm_nrfx_##idx##_data, \ &pwm_nrfx_##idx##_config, \ - POST_KERNEL, PWM_INIT_PRIORITY(idx), \ + POST_KERNEL, CONFIG_PWM_INIT_PRIORITY, \ &pwm_nrfx_drv_api_funcs) #define COND_PWM_NRFX_DEVICE(unused, prefix, i, _) \ diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index a39f882f644a..722cc11da071 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -28,13 +28,6 @@ config UART_NRFX_UARTE imply NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG if !UART_NRFX_UARTE_LEGACY_SHIM imply NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG if !UART_NRFX_UARTE_LEGACY_SHIM -config UART_NRFX_UARTE_USE_CLOCK_CONTROL - def_bool y - depends on UART_NRFX_UARTE - depends on $(dt_nodelabel_enabled,uart120) - depends on !SOC_NRF54H20_CPUFLPR && !SOC_NRF54H20_CPUPPR - select CLOCK_CONTROL - config UART_NRFX_UARTE_NO_IRQ bool "Polling without interrupt" depends on UART_NRFX_UARTE diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 00489e7d8856..08cb236b918d 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -23,7 +23,6 @@ #include #include #include -#include LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); @@ -118,26 +117,6 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); #define UARTE_ANY_LOW_POWER 1 #endif -/* Only cores with access to GDFS can control clocks and power domains, so if a fast instance is - * used by other cores, treat the UART like a normal one. This presumes cores with access to GDFS - * have requested the clocks and power domains needed by the fast instance to be ACTIVE before - * other cores use the fast instance. - */ -#if CONFIG_NRFS_GDFS_SERVICE_ENABLED -#define INSTANCE_IS_FAST(unused, prefix, idx, _) \ - UTIL_AND( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_HAS_HW_NRF_UARTE##prefix##idx), \ - NRF_DT_IS_FAST(UARTE(idx)) \ - ), \ - IS_ENABLED(CONFIG_CLOCK_CONTROL) \ - ) - -#if UARTE_FOR_EACH_INSTANCE(INSTANCE_IS_FAST, (||), (0)) -#define UARTE_ANY_FAST 1 -#endif -#endif - #define INSTANCE_IS_HIGH_SPEED(unused, prefix, idx, _) \ COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(UARTE(prefix##idx)), \ ((NRF_PERIPH_GET_FREQUENCY(UARTE(prefix##idx)) > NRF_UARTE_BASE_FREQUENCY_16MHZ)), \ @@ -398,20 +377,6 @@ struct uarte_nrfx_data { !IS_ENABLED(CONFIG_PM_DEVICE) && \ (_config->flags & UARTE_CFG_FLAG_LOW_POWER)) -/** @brief Check if device has PM that works in ISR safe mode. - * - * Only fast UARTE instance does not work in that mode so check PM configuration - * flags only if there is any fast instance present. - * - * @retval true if device PM is ISR safe. - * @retval false if device PM is not ISR safe. - */ -#define IS_PM_ISR_SAFE(dev) \ - (!IS_ENABLED(UARTE_ANY_FAST) ||\ - COND_CODE_1(CONFIG_PM_DEVICE,\ - ((dev->pm_base->flags & BIT(PM_DEVICE_FLAG_ISR_SAFE))), \ - (0))) - /** * @brief Structure for UARTE configuration. */ @@ -423,10 +388,6 @@ struct uarte_nrfx_config { #ifdef CONFIG_HAS_NORDIC_DMM void *mem_reg; #endif -#ifdef UARTE_ANY_FAST - const struct device *clk_dev; - struct nrf_clock_spec clk_spec; -#endif #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE /* None-zero in case of high speed instances. Baudrate is adjusted by that ratio. */ uint32_t clock_freq; @@ -840,15 +801,6 @@ static void uarte_periph_enable(const struct device *dev) struct uarte_nrfx_data *data = dev->data; (void)data; -#ifdef UARTE_ANY_FAST - if (config->clk_dev) { - int err; - - err = nrf_clock_control_request_sync(config->clk_dev, &config->clk_spec, K_FOREVER); - (void)err; - __ASSERT_NO_MSG(err >= 0); - } -#endif (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); nrf_uarte_enable(uarte); @@ -1863,20 +1815,6 @@ static int uarte_nrfx_tx(const struct device *dev, const uint8_t *buf, } if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - if (!IS_PM_ISR_SAFE(dev) && k_is_in_isr()) { - /* If instance does not support PM from ISR device shall - * already be turned on. - */ - enum pm_device_state state; - int err; - - err = pm_device_state_get(dev, &state); - (void)err; - __ASSERT_NO_MSG(err == 0); - if (state != PM_DEVICE_STATE_ACTIVE) { - return -ENOTSUP; - } - } pm_device_runtime_get(dev); } @@ -2008,20 +1946,6 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, async_rx->next_buf_len = 0; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - if (!IS_PM_ISR_SAFE(dev) && k_is_in_isr()) { - /* If instance does not support PM from ISR device shall - * already be turned on. - */ - enum pm_device_state state; - int err; - - err = pm_device_state_get(dev, &state); - (void)err; - __ASSERT_NO_MSG(err == 0); - if (state != PM_DEVICE_STATE_ACTIVE) { - return -ENOTSUP; - } - } pm_device_runtime_get(dev); } else if (LOW_POWER_ENABLED(cfg)) { unsigned int key = irq_lock(); @@ -2085,7 +2009,7 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, nrf_uarte_rx_buffer_set(uarte, buf, len); - if (IS_ENABLED(UARTE_ANY_FAST) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + if (IS_ENABLED(CONFIG_HAS_HW_NRF_UARTE120) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { /* Spurious RXTO event was seen on fast instance (UARTE120) thus * RXTO interrupt is kept enabled only when RX is active. */ @@ -2580,7 +2504,7 @@ static void rxto_isr(const struct device *dev) #ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX NRF_UARTE_Type *uarte = get_uarte_instance(dev); - if (IS_ENABLED(UARTE_ANY_FAST) && (config->flags & UARTE_CFG_FLAG_CACHEABLE)) { + if (IS_ENABLED(CONFIG_HAS_HW_NRF_UARTE120) && (config->flags & UARTE_CFG_FLAG_CACHEABLE)) { /* Spurious RXTO event was seen on fast instance (UARTE120) thus * RXTO interrupt is kept enabled only when RX is active. */ @@ -2873,22 +2797,6 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c) } if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - if (!IS_PM_ISR_SAFE(dev) && k_is_in_isr()) { - /* If instance does not support PM from ISR device shall - * already be turned on. - */ - enum pm_device_state state; - int err; - - err = pm_device_state_get(dev, &state); - (void)err; - __ASSERT_NO_MSG(err == 0); - if (state != PM_DEVICE_STATE_ACTIVE) { - irq_unlock(key); - return; - } - } - if (!(data->flags & UARTE_FLAG_POLL_OUT)) { data->flags |= UARTE_FLAG_POLL_OUT; pm_device_runtime_get(dev); @@ -3214,15 +3122,6 @@ static void uarte_pm_suspend(const struct device *dev) struct uarte_nrfx_data *data = dev->data; (void)data; -#ifdef UARTE_ANY_FAST - if (cfg->clk_dev) { - int err; - - err = nrf_clock_control_release(cfg->clk_dev, &cfg->clk_spec); - (void)err; - __ASSERT_NO_MSG(err >= 0); - } -#endif #ifdef UARTE_ANY_ASYNC if (data->async) { @@ -3504,20 +3403,6 @@ static int uarte_instance_deinit(const struct device *dev) #define UARTE_GET_BAUDRATE(idx) \ UARTE_GET_BAUDRATE2(NRF_PERIPH_GET_FREQUENCY(UARTE(idx)), UARTE_PROP(idx, current_speed)) -/* Get initialization level of an instance. Instances that requires clock control - * which is using nrfs (IPC) are initialized later. - */ -#define UARTE_INIT_LEVEL(idx) \ - COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _), (POST_KERNEL), (PRE_KERNEL_1)) - -/* Get initialization priority of an instance. Instances that requires clock control - * which is using nrfs (IPC) are initialized later. - */ -#define UARTE_INIT_PRIO(idx) \ - COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _), \ - (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ - (CONFIG_SERIAL_INIT_PRIORITY)) - /* Macro for setting nRF specific configuration structures. */ #define UARTE_NRF_CONFIG(idx) { \ .hwfc = (UARTE_PROP(idx, hw_flow_control) == \ @@ -3545,33 +3430,24 @@ static int uarte_instance_deinit(const struct device *dev) : UART_CFG_FLOW_CTRL_NONE, \ } -#define UARTE_ON_MANAGED_POWER_DOMAIN(idx) \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND( \ - DT_NODE_HAS_PROP(UARTE(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(UARTE(idx), power_domains)) \ - ) \ - ) - /* Macro determines if PM actions are interrupt safe. * - * Requesting/releasing clocks or power domains is not necessarily ISR safe (we can't - * reliably know, its out of our control). UARTE_ON_MANAGED_POWER_DOMAIN() let's us check if we - * will be requesting/releasing power domains (and clocks for now since the only case where we - * need to request power domains happens to be the same criteria). - * - * Furthermore, non-asynchronous API if RX is disabled is not ISR safe. + * Non-asynchronous API if RX is disabled is not ISR safe. * * Macro must resolve to a literal 1 or 0. */ #define UARTE_PM_ISR_SAFE(idx) \ - COND_CODE_1(UARTE_ON_MANAGED_POWER_DOMAIN(idx), \ - (0), \ - (COND_CODE_1(CONFIG_UART_##idx##_ASYNC, \ - (PM_DEVICE_ISR_SAFE), \ - (COND_CODE_1(UARTE_PROP(idx, disable_rx), \ - (PM_DEVICE_ISR_SAFE), (0)))))) \ + COND_CODE_1( \ + CONFIG_UART_##idx##_ASYNC, \ + (PM_DEVICE_ISR_SAFE), \ + ( \ + COND_CODE_1( \ + UARTE_PROP(idx, disable_rx), \ + (PM_DEVICE_ISR_SAFE), \ + (0) \ + ) \ + ) \ + ) #define UART_NRF_UARTE_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(UARTE(idx)); \ @@ -3642,13 +3518,6 @@ static int uarte_instance_deinit(const struct device *dev) IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ (.timer = NRFX_TIMER_INSTANCE( \ CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ - IF_ENABLED(INSTANCE_IS_FAST(_, /*empty*/, idx, _), \ - (.clk_dev = DEVICE_DT_GET_OR_NULL(DT_CLOCKS_CTLR(UARTE(idx))), \ - .clk_spec = { \ - .frequency = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),\ - .accuracy = 0, \ - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT,\ - },)) \ IF_ENABLED(UARTE_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ (.cross_domain = true, \ .default_port = \ @@ -3673,8 +3542,8 @@ static int uarte_instance_deinit(const struct device *dev) PM_DEVICE_DT_GET(UARTE(idx)), \ &uarte_##idx##_data, \ &uarte_##idx##z_config, \ - UARTE_INIT_LEVEL(idx), \ - UARTE_INIT_PRIO(idx), \ + PRE_KERNEL_1, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_nrfx_uarte_driver_api) #define UARTE_INT_DRIVEN(idx) \ diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 447c0e54fba5..44451be58bc7 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -55,31 +54,6 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #define SPIM_FOR_EACH_INSTANCE(f, sep, off_code, ...) \ NRFX_FOREACH_PRESENT(SPIM, f, sep, off_code, __VA_ARGS__) -/* Only CPUAPP and CPURAD can control clocks and power domains, so if a fast instance is - * used by other cores, treat the SPIM like a normal one. This presumes the CPUAPP or CPURAD - * have requested the clocks and power domains needed by the fast instance to be ACTIVE before - * other cores use the fast instance. - */ -#if CONFIG_SOC_NRF54H20_CPUAPP || CONFIG_SOC_NRF54H20_CPURAD -#define INSTANCE_IS_FAST(unused, prefix, idx, _) \ - UTIL_AND( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_HAS_HW_NRF_SPIM##prefix##idx), \ - NRF_DT_IS_FAST(SPIM(idx)) \ - ), \ - IS_ENABLED(CONFIG_CLOCK_CONTROL) \ - ) - -#if SPIM_FOR_EACH_INSTANCE(INSTANCE_IS_FAST, (||), (0)) -#define SPIM_ANY_FAST 1 -/* If fast instances are used then system managed device PM cannot be used because - * it may call PM actions from locked context and fast SPIM PM actions can only be - * called from a thread context. - */ -BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); -#endif -#endif - #define SPIM_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIM(prefix##idx)), \ (SPIM_PROP(idx, cross_domain_pins_supported)), \ @@ -117,9 +91,6 @@ struct spi_nrfx_data { uint8_t ppi_ch; uint8_t gpiote_ch; #endif -#ifdef SPIM_ANY_FAST - bool clock_requested; -#endif }; struct spi_nrfx_config { @@ -134,10 +105,6 @@ struct spi_nrfx_config { #endif uint32_t wake_pin; nrfx_gpiote_t wake_gpiote; -#ifdef SPIM_ANY_FAST - const struct device *clk_dev; - struct nrf_clock_spec clk_spec; -#endif #if SPIM_CROSS_DOMAIN_SUPPORTED bool cross_domain; int8_t default_port; @@ -147,51 +114,6 @@ struct spi_nrfx_config { static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context); -static inline int request_clock(const struct device *dev) -{ -#ifdef SPIM_ANY_FAST - struct spi_nrfx_data *dev_data = dev->data; - const struct spi_nrfx_config *dev_config = dev->config; - int error; - - if (!dev_config->clk_dev) { - return 0; - } - - error = nrf_clock_control_request_sync( - dev_config->clk_dev, &dev_config->clk_spec, - K_MSEC(CONFIG_SPI_COMPLETION_TIMEOUT_TOLERANCE)); - if (error < 0) { - LOG_ERR("Failed to request clock: %d", error); - return error; - } - - dev_data->clock_requested = true; -#else - ARG_UNUSED(dev); -#endif - - return 0; -} - -static inline void release_clock(const struct device *dev) -{ -#ifdef SPIM_ANY_FAST - struct spi_nrfx_data *dev_data = dev->data; - const struct spi_nrfx_config *dev_config = dev->config; - - if (!dev_data->clock_requested) { - return; - } - - dev_data->clock_requested = false; - - nrf_clock_control_release(dev_config->clk_dev, &dev_config->clk_spec); -#else - ARG_UNUSED(dev); -#endif -} - #if SPIM_CROSS_DOMAIN_SUPPORTED static bool spim_has_cross_domain_connection(const struct spi_nrfx_config *config) { @@ -232,10 +154,6 @@ static inline void finalize_spi_transaction(const struct device *dev, bool deact nrfy_spim_disable(reg); } - if (!pm_device_runtime_is_enabled(dev)) { - release_clock(dev); - } - pm_device_runtime_put_async(dev, K_NO_WAIT); } @@ -640,10 +558,6 @@ static int transceive(const struct device *dev, error = configure(dev, spi_cfg); - if (error == 0 && !pm_device_runtime_is_enabled(dev)) { - error = request_clock(dev); - } - if (error == 0) { dev_data->busy = true; @@ -786,7 +700,7 @@ static int spim_resume(const struct device *dev) } #endif - return pm_device_runtime_is_enabled(dev) ? request_clock(dev) : 0; + return 0; } static void spim_suspend(const struct device *dev) @@ -799,10 +713,6 @@ static void spim_suspend(const struct device *dev) dev_data->initialized = false; } - if (pm_device_runtime_is_enabled(dev)) { - release_clock(dev); - } - spi_context_cs_put_all(&dev_data->ctx); #if SPIM_CROSS_DOMAIN_SUPPORTED @@ -905,14 +815,6 @@ static int spi_nrfx_deinit(const struct device *dev) ()) \ )) -/* Get initialization priority of an instance. Instances that requires clock control - * which is using nrfs (IPC) are initialized later. - */ -#define SPIM_INIT_PRIORITY(idx) \ - COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _), \ - (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ - (CONFIG_SPI_INIT_PRIORITY)) - #define SPI_NRFX_SPIM_DEFINE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ @@ -964,12 +866,6 @@ static int spi_nrfx_deinit(const struct device *dev) .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPIM(idx), wake_gpios, \ WAKE_PIN_NOT_USED), \ .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPIM(idx)), \ - IF_ENABLED(SPIM_ANY_FAST, \ - (.clk_dev = DEVICE_DT_GET_OR_NULL( \ - DT_CLOCKS_CTLR(SPIM(idx))), \ - .clk_spec = { \ - .frequency = NRF_CLOCK_CONTROL_FREQUENCY_MAX, \ - },)) \ IF_ENABLED(SPIM_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ (.cross_domain = true, \ .default_port = \ @@ -987,7 +883,7 @@ static int spi_nrfx_deinit(const struct device *dev) PM_DEVICE_DT_GET(SPIM(idx)), \ &spi_##idx##_data, \ &spi_##idx##z_config, \ - POST_KERNEL, SPIM_INIT_PRIORITY(idx), \ + POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \ &spi_nrfx_driver_api) #define COND_NRF_SPIM_DEVICE(unused, prefix, i, _) \ diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index aa59d9abc9b2..4d1a9070c1ac 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -20,14 +20,6 @@ LOG_MODULE_REGISTER(spi_nrfx_spis, CONFIG_SPI_LOG_LEVEL); #include "spi_context.h" -#if NRF_DT_INST_ANY_IS_FAST -/* If fast instances are used then system managed device PM cannot be used because - * it may call PM actions from locked context and fast SPIM PM actions can only be - * called from a thread context. - */ -BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); -#endif - /* * Current factors requiring use of DT_NODELABEL: * @@ -39,7 +31,6 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); #define SPIS(idx) DT_NODELABEL(SPIS_NODE(idx)) #define SPIS_PROP(idx, prop) DT_PROP(SPIS(idx), prop) #define SPIS_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIS(idx), prop) -#define SPIS_IS_FAST(idx) NRF_DT_IS_FAST(SPIS(idx)) #define SPIS_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIS(prefix##idx)), \ @@ -551,32 +542,6 @@ static int spi_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, spi_nrfx_pm_action); } -/* Macro determines PM actions interrupt safety level. - * - * Requesting/releasing SPIS device may be ISR safe, but it cannot be reliably known whether - * managing its power domain is. It is then assumed that if power domains are used, device is - * no longer ISR safe. This macro let's us check if we will be requesting/releasing - * power domains and determines PM device ISR safety value. - * - * Additionally, fast SPIS devices are not ISR safe. - */ -#define SPIS_PM_ISR_SAFE(idx) \ - COND_CODE_1( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND( \ - DT_NODE_HAS_PROP(SPIS(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(SPIS(idx), power_domains)) \ - ) \ - ), \ - (0), \ - (COND_CODE_1( \ - SPIS_IS_FAST(idx), \ - (0), \ - (PM_DEVICE_ISR_SAFE) \ - )) \ - ) - #define SPI_NRFX_SPIS_DEFINE(idx) \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ static void irq_connect##idx(void) \ @@ -622,8 +587,7 @@ static int spi_nrfx_init(const struct device *dev) BUILD_ASSERT(!DT_NODE_HAS_PROP(SPIS(idx), wake_gpios) || \ !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ "WAKE line must be configured as active high"); \ - PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, \ - SPIS_PM_ISR_SAFE(idx)); \ + PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, PM_DEVICE_ISR_SAFE);\ SPI_DEVICE_DT_DEFINE(SPIS(idx), \ spi_nrfx_init, \ PM_DEVICE_DT_GET(SPIS(idx)), \ diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index f3b8e4f8c08c..88ace7842aa3 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -67,18 +67,6 @@ wdt011: &cpuapp_wdt011 {}; interrupts = <109 NRF_DEFAULT_IRQ_PRIORITY>; }; -&fll16m { - status = "okay"; -}; - -&hsfll120 { - status = "okay"; -}; - -&lfclk { - status = "okay"; -}; - &gdpwr { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index cc7b0a97b513..b910e42789b0 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -108,18 +108,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&fll16m { - status = "okay"; -}; - -&hsfll120 { - status = "okay"; -}; - -&lfclk { - status = "okay"; -}; - &gdpwr { status = "okay"; }; diff --git a/samples/boards/nordic/clock_control/configs/cpuapp_hsfll.overlay b/samples/boards/nordic/clock_control/configs/cpuapp_hsfll.overlay index 0d46dfbda451..f2ab83533f48 100644 --- a/samples/boards/nordic/clock_control/configs/cpuapp_hsfll.overlay +++ b/samples/boards/nordic/clock_control/configs/cpuapp_hsfll.overlay @@ -9,3 +9,7 @@ sample-clock = &cpuapp_hsfll; }; }; + +&cpuapp_hsfll { + status = "okay"; +}; diff --git a/samples/boards/nordic/clock_control/configs/fll16m.overlay b/samples/boards/nordic/clock_control/configs/fll16m.overlay index e6484259ce4f..c4e24588f227 100644 --- a/samples/boards/nordic/clock_control/configs/fll16m.overlay +++ b/samples/boards/nordic/clock_control/configs/fll16m.overlay @@ -9,3 +9,7 @@ sample-clock = &fll16m; }; }; + +&fll16m { + status = "okay"; +}; diff --git a/samples/boards/nordic/clock_control/configs/global_hsfll.overlay b/samples/boards/nordic/clock_control/configs/global_hsfll.overlay index c7e67b9c4e85..ef14d521a589 100644 --- a/samples/boards/nordic/clock_control/configs/global_hsfll.overlay +++ b/samples/boards/nordic/clock_control/configs/global_hsfll.overlay @@ -9,3 +9,7 @@ sample-clock = &hsfll120; }; }; + +&hsfll120 { + status = "okay"; +}; diff --git a/samples/boards/nordic/clock_control/configs/lfclk.overlay b/samples/boards/nordic/clock_control/configs/lfclk.overlay index db48e5f7705d..4b601f56fd08 100644 --- a/samples/boards/nordic/clock_control/configs/lfclk.overlay +++ b/samples/boards/nordic/clock_control/configs/lfclk.overlay @@ -9,3 +9,7 @@ sample-clock = &lfclk; }; }; + +&lfclk { + status = "okay"; +}; diff --git a/samples/boards/nordic/clock_control/configs/uart135.overlay b/samples/boards/nordic/clock_control/configs/uart135.overlay index 547145fa91de..dfc32c3cd9f1 100644 --- a/samples/boards/nordic/clock_control/configs/uart135.overlay +++ b/samples/boards/nordic/clock_control/configs/uart135.overlay @@ -14,3 +14,7 @@ status = "okay"; memory-regions = <&cpuapp_dma_region>; }; + +&fll16m { + status = "okay"; +}; diff --git a/tests/drivers/clock_control/nrf_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/clock_control/nrf_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..20fe7b305261 --- /dev/null +++ b/tests/drivers/clock_control/nrf_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&fll16m { + status = "okay"; +}; + +&hsfll120 { + status = "okay"; +}; + +&lfclk { + status = "okay"; +}; + +&canpll { + status = "okay"; +}; diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 6dffc1fe4e19..74cc8d7691e1 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,3 +1,2 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y -CONFIG_CLOCK_CONTROL=y From 52dd64b8d7ad1c6e59d2e74ce467e47ecfcabcc7 Mon Sep 17 00:00:00 2001 From: Zhaoxiang Jin Date: Mon, 8 Sep 2025 23:03:42 +0800 Subject: [PATCH 0171/3334] [nrf fromtree] tests: drivers: comparator: Enable nxp cmp test Enable nxp cmp test. Signed-off-by: Zhaoxiang Jin (cherry picked from commit 78b4fed3915397931eb4736de35e1d05367f006d) --- .../comparator/nxp_cmp/frdm_mcxc242.dts | 18 +++++++++++++ .../build_all/comparator/testcase.yaml | 5 ++++ .../gpio_loopback/boards/frdm_mcxc242.overlay | 25 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.dts create mode 100644 tests/drivers/comparator/gpio_loopback/boards/frdm_mcxc242.overlay diff --git a/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.dts b/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.dts new file mode 100644 index 000000000000..93dc828c7a03 --- /dev/null +++ b/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.dts @@ -0,0 +1,18 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&cmp { + positive-mux-input = "IN0"; /* PTC6 */ + negative-mux-input = "IN7"; /* DAC */ + dac-vref-source = "VIN2"; + dac-value = <31>; + filter-count = <0x3>; + filter-period = <0xF>; + hysteresis-mode = "LEVEL2"; + enable-high-speed-mode; + invert-output; + enable-pin-out; +}; diff --git a/tests/drivers/build_all/comparator/testcase.yaml b/tests/drivers/build_all/comparator/testcase.yaml index 298dcc884107..1dda00155206 100644 --- a/tests/drivers/build_all/comparator/testcase.yaml +++ b/tests/drivers/build_all/comparator/testcase.yaml @@ -119,3 +119,8 @@ tests: - DTC_OVERLAY_FILE="mcux_acmp/mke15z7_mux_mux.dts" platform_allow: - frdm_ke15z + drivers.build_all.comparator.nxp_cmp.frdm_mcxc242: + extra_args: + - DTC_OVERLAY_FILE="nxp_cmp/frdm_mcxc242.dts" + platform_allow: + - frdm_mcxc242 diff --git a/tests/drivers/comparator/gpio_loopback/boards/frdm_mcxc242.overlay b/tests/drivers/comparator/gpio_loopback/boards/frdm_mcxc242.overlay new file mode 100644 index 000000000000..755db58ab40f --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/boards/frdm_mcxc242.overlay @@ -0,0 +1,25 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + aliases { + test-comp = &cmp; + }; + + zephyr,user { + /* PTC4 output connect to PTC6. */ + test-gpios = <&gpioc 4 GPIO_ACTIVE_HIGH>; + }; +}; + +&cmp { + positive-mux-input = "IN0"; /* PTC6, FRDM-MCXC242 J2-8 */ + negative-mux-input = "IN7"; /* DAC output => 1.65V */ + dac-vref-source = "VIN2"; + dac-value = <31>; +}; From d31f006719183b2d430fafc623341a03dc527c14 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 28 Aug 2025 13:26:21 +0200 Subject: [PATCH 0172/3334] [nrf fromtree] tests: comparator: nordic: Align boards overlays for changed input types Align samples and tests boards overlays for changed comparator input types. Signed-off-by: Jakub Zymelka (cherry picked from commit 6d7f42936943c6d8efdab5fafd57dcb340763f65) --- .../nrf54l15dk_nrf54l15_cpuapp_comparator.overlay | 4 +++- .../boards/bl54l15_dvk_nrf54l15_cpuapp.overlay | 6 ++++-- .../boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay | 6 ++++-- .../comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 6 ++++-- .../comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 6 ++++-- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 6 ++++-- tests/boards/nrf/comp/src/test.c | 14 ++++++-------- .../build_all/comparator/nrf_comp/diff.overlay | 6 ++++-- .../build_all/comparator/nrf_comp/se.overlay | 4 +++- .../build_all/comparator/nrf_comp/se_aref.overlay | 6 ++++-- .../comparator/nrf_lpcomp/ext_ref.overlay | 4 +++- .../comparator/nrf_lpcomp/int_ref.overlay | 6 ++++-- .../boards/bl54l15_dvk_nrf54l15_cpuapp.overlay | 4 +++- .../boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay | 4 +++- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 4 +++- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 +++- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 4 +++- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 4 +++- .../boards/bl54l15_dvk_nrf54l15_cpuapp.overlay | 4 +++- .../boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay | 4 +++- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 4 +++- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 +++- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 4 +++- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 4 +++- 24 files changed, 83 insertions(+), 39 deletions(-) diff --git a/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_comparator.overlay b/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_comparator.overlay index f0b39b456206..ce93cee141a1 100644 --- a/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_comparator.overlay +++ b/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_comparator.overlay @@ -1,6 +1,8 @@ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN4"; + psel = ; refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay index aaf1006300a5..c928e7eff243 100644 --- a/tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -5,6 +5,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + / { aliases { test-comp = ∁ @@ -30,9 +32,9 @@ &comp { status = "okay"; - psel = "AIN4"; + psel = ; refsel = "AREF"; - extrefsel = "AIN3"; + extrefsel = ; sp-mode = "NORMAL"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay index aaf1006300a5..c928e7eff243 100644 --- a/tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -5,6 +5,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + / { aliases { test-comp = ∁ @@ -30,9 +32,9 @@ &comp { status = "okay"; - psel = "AIN4"; + psel = ; refsel = "AREF"; - extrefsel = "AIN3"; + extrefsel = ; sp-mode = "NORMAL"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 4e9e898ea184..27008ba6760f 100644 --- a/tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + / { aliases { test-comp = ∁ @@ -25,9 +27,9 @@ &comp { status = "okay"; - psel = "AIN5"; + psel = ; refsel = "AREF"; - extrefsel = "AIN1"; + extrefsel = ; sp-mode = "HIGH"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index d6492e37c343..5695f7d90dcd 100644 --- a/tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + / { aliases { test-comp = ∁ @@ -29,9 +31,9 @@ &comp { status = "okay"; - psel = "AIN4"; + psel = ; refsel = "AREF"; - extrefsel = "AIN3"; + extrefsel = ; sp-mode = "NORMAL"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 45cefc0815bb..94087309aee9 100644 --- a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -5,6 +5,8 @@ * AIN4 (P1.06) tied to VDD */ +#include + / { aliases { test-comp = ∁ @@ -22,9 +24,9 @@ &comp { status = "okay"; - psel = "AIN4"; + psel = ; refsel = "AREF"; - extrefsel = "AIN3"; + extrefsel = ; sp-mode = "NORMAL"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/src/test.c b/tests/boards/nrf/comp/src/test.c index 1d1876e76faa..481760da5bd4 100644 --- a/tests/boards/nrf/comp/src/test.c +++ b/tests/boards/nrf/comp/src/test.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -13,14 +14,11 @@ static const struct device *test_dev = DEVICE_DT_GET(DT_ALIAS(test_comp)); static const struct gpio_dt_spec test_pin_1 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), first_gpios); static const struct gpio_dt_spec test_pin_2 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), second_gpios); -#define TEST_COMP_SE_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \ - CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX) -#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \ - CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX) -#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \ - CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX) -#define TEST_COMP_DIFF_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \ - CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX) +#define TEST_COMP_SE_PSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX) +#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX) +#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX) +#define TEST_COMP_DIFF_EXTREFSEL_AIN \ + _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX) struct comp_nrf_comp_se_config comp_se_config = { .psel = TEST_COMP_SE_PSEL_AIN, diff --git a/tests/drivers/build_all/comparator/nrf_comp/diff.overlay b/tests/drivers/build_all/comparator/nrf_comp/diff.overlay index 8b8e9a02c2b1..56b4249d3c53 100644 --- a/tests/drivers/build_all/comparator/nrf_comp/diff.overlay +++ b/tests/drivers/build_all/comparator/nrf_comp/diff.overlay @@ -4,10 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "DIFF"; - psel = "AIN0"; - extrefsel = "AIN1"; + psel = ; + extrefsel = ; sp-mode = "HIGH"; isource = "DISABLED"; status = "okay"; diff --git a/tests/drivers/build_all/comparator/nrf_comp/se.overlay b/tests/drivers/build_all/comparator/nrf_comp/se.overlay index e4eb56f61a92..67798ab4bcf1 100644 --- a/tests/drivers/build_all/comparator/nrf_comp/se.overlay +++ b/tests/drivers/build_all/comparator/nrf_comp/se.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "SE"; - psel = "AIN0"; + psel = ; refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <36>; diff --git a/tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay b/tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay index 0d36a3e40b40..04216a7ac10e 100644 --- a/tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay +++ b/tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay @@ -4,10 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "SE"; - psel = "AIN0"; - extrefsel = "AIN1"; + psel = ; + extrefsel = ; refsel = "AREF"; sp-mode = "HIGH"; th-up = <36>; diff --git a/tests/drivers/build_all/comparator/nrf_lpcomp/ext_ref.overlay b/tests/drivers/build_all/comparator/nrf_lpcomp/ext_ref.overlay index 95e44fbed3d6..0d990b2c3f88 100644 --- a/tests/drivers/build_all/comparator/nrf_lpcomp/ext_ref.overlay +++ b/tests/drivers/build_all/comparator/nrf_lpcomp/ext_ref.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN0"; + psel = ; refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/build_all/comparator/nrf_lpcomp/int_ref.overlay b/tests/drivers/build_all/comparator/nrf_lpcomp/int_ref.overlay index 7aadd8b3faee..a42ad2f13a16 100644 --- a/tests/drivers/build_all/comparator/nrf_lpcomp/int_ref.overlay +++ b/tests/drivers/build_all/comparator/nrf_lpcomp/int_ref.overlay @@ -4,10 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN0"; + psel = ; refsel = "AREF"; - extrefsel = "AIN1"; + extrefsel = ; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay index ddcf8d26cadd..84d3b9f57594 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -5,9 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "SE"; - psel = "AIN4"; /* P1.11 */ + psel = ; /* P1.11 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay index ddcf8d26cadd..84d3b9f57594 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -5,9 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "SE"; - psel = "AIN4"; /* P1.11 */ + psel = ; /* P1.11 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay index e11bdcd3173d..68fea53e2b45 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "SE"; - psel = "AIN0"; /* P0.04 */ + psel = ; /* P0.04 */ refsel = "VDD"; sp-mode = "HIGH"; th-up = <34>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index f90c2051255f..5923e3ab07c8 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "SE"; - psel = "AIN2"; /* P1.02 */ + psel = ; /* P1.02 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 3a7a8f0ef811..925417d48ab5 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "SE"; - psel = "AIN4"; /* P1.11 */ + psel = ; /* P1.11 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 2709df531950..623bfd9c45f3 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { main-mode = "SE"; - psel = "AIN1"; /* P1.31 */ + psel = ; /* P1.31 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay index 58e055a02406..e208b85b2ae9 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -5,9 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN4"; /* P1.11 */ + psel = ; /* P1.11 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay index 58e055a02406..e208b85b2ae9 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -5,9 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN4"; /* P1.11 */ + psel = ; /* P1.11 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay index d35a20dfc223..0c571fa21b8f 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN0"; /* P0.04 */ + psel = ; /* P0.04 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 349cd7051f99..66306268a117 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN2"; /* P1.02 */ + psel = ; /* P1.02 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index ebb652bdd871..e82d8b98521c 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN4"; /* P1.11 */ + psel = ; /* P1.11 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 0f51a9951a16..db097a9fd6fd 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,9 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + &comp { compatible = "nordic,nrf-lpcomp"; - psel = "AIN1"; /* P1.31 */ + psel = ; /* P1.31 */ refsel = "VDD_4_8"; status = "okay"; }; From 9b97e030fa729eb0ed434b373742c526bcbccfab Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 28 Aug 2025 12:02:22 +0200 Subject: [PATCH 0173/3334] [nrf fromtree] dts: bindings: comparator: nordic: Change inputs type to int Unify external analog inputs type to be consistent in COMP, LPCOMP and SAADC nordic drivers. Signed-off-by: Jakub Zymelka (cherry picked from commit d85bdb7ee913e1106709290e2ecb1da1693fb475) --- dts/bindings/comparator/nordic,nrf-comp.yaml | 32 ++++--------------- .../comparator/nordic,nrf-lpcomp.yaml | 20 +++--------- .../zephyr/dt-bindings/comparator/nrf-comp.h | 21 ++++++++++++ 3 files changed, 31 insertions(+), 42 deletions(-) create mode 100644 include/zephyr/dt-bindings/comparator/nrf-comp.h diff --git a/dts/bindings/comparator/nordic,nrf-comp.yaml b/dts/bindings/comparator/nordic,nrf-comp.yaml index e4f6838d2049..f1405a6de2c9 100644 --- a/dts/bindings/comparator/nordic,nrf-comp.yaml +++ b/dts/bindings/comparator/nordic,nrf-comp.yaml @@ -25,7 +25,7 @@ description: | &comp { status = "okay"; main-mode = "SE"; - psel = "AIN0"; + psel = ; refsel = "INT_1V2"; sp-mode = "NORMAL"; th-up = <36>; @@ -39,7 +39,7 @@ description: | &comp { ... refsel = "AREF"; - extrefsel = "AIN1"; + extrefsel = ; ... }; @@ -49,8 +49,8 @@ description: | &comp { status = "okay"; main-mode = "DIFF"; - psel = "AIN0"; - extrefsel = "AIN1"; + psel = ; + extrefsel = ; sp-mode = "NORMAL"; enable-hyst; isource = "DISABLED"; @@ -68,30 +68,10 @@ properties: - "DIFF" psel: - type: string - enum: - - "AIN0" - - "AIN1" - - "AIN2" - - "AIN3" - - "AIN4" - - "AIN5" - - "AIN6" - - "AIN7" - - "VDD_DIV2" - - "VDDH_DIV5" + type: int extrefsel: - type: string - enum: - - "AIN0" - - "AIN1" - - "AIN2" - - "AIN3" - - "AIN4" - - "AIN5" - - "AIN6" - - "AIN7" + type: int refsel: type: string diff --git a/dts/bindings/comparator/nordic,nrf-lpcomp.yaml b/dts/bindings/comparator/nordic,nrf-lpcomp.yaml index 64a30b330d8b..4995155ed76b 100644 --- a/dts/bindings/comparator/nordic,nrf-lpcomp.yaml +++ b/dts/bindings/comparator/nordic,nrf-lpcomp.yaml @@ -21,7 +21,7 @@ description: | &comp { status = "okay"; - psel = "AIN0"; + psel = ; refsel = "VDD_4_8"; enable-hyst; }; @@ -32,7 +32,7 @@ description: | &comp { ... refsel = "AREF"; - extrefsel = "AIN1"; + extrefsel = ; ... }; @@ -42,22 +42,10 @@ include: base.yaml properties: psel: - type: string - enum: - - "AIN0" - - "AIN1" - - "AIN2" - - "AIN3" - - "AIN4" - - "AIN5" - - "AIN6" - - "AIN7" + type: int extrefsel: - type: string - enum: - - "AIN0" - - "AIN1" + type: int refsel: type: string diff --git a/include/zephyr/dt-bindings/comparator/nrf-comp.h b/include/zephyr/dt-bindings/comparator/nrf-comp.h new file mode 100644 index 000000000000..1a5407554a15 --- /dev/null +++ b/include/zephyr/dt-bindings/comparator/nrf-comp.h @@ -0,0 +1,21 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ + +#define NRF_COMP_AIN0 0 /** AIN0 external input */ +#define NRF_COMP_AIN1 1 /** AIN1 external input */ +#define NRF_COMP_AIN2 2 /** AIN2 external input */ +#define NRF_COMP_AIN3 3 /** AIN3 external input */ +#define NRF_COMP_AIN4 4 /** AIN4 external input */ +#define NRF_COMP_AIN5 5 /** AIN5 external input */ +#define NRF_COMP_AIN6 6 /** AIN6 external input */ +#define NRF_COMP_AIN7 7 /** AIN7 external input */ +#define NRF_COMP_AIN_VDD_DIV2 8 /** VDD / 2 */ +#define NRF_COMP_AIN_VDDH_DIV5 9 /** VDDH / 5 */ + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ */ From dced9a7f1f592cac87847c8968f629cd5d7721e8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 20 Oct 2025 22:01:49 +0200 Subject: [PATCH 0174/3334] [nrf fromlist] tests: arch: arm: irq_vector_table: disable POWER_DOMAIN for nRF54H20 The nRF54H20s power domains use NRFS, which uses the irq vectors used for this test suite. Disable power domains to not conflict with the test suite. Upstream PR #: 97452 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 49926adb4b05085d0f1bb17c78374ddafaf6d535) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 4 ++++ .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf create mode 100644 tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..e12e413d9e5a --- /dev/null +++ b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2025 Nordic Semiconductor +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_POWER_DOMAIN=n diff --git a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..e12e413d9e5a --- /dev/null +++ b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2025 Nordic Semiconductor +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_POWER_DOMAIN=n From a9f0bdb9f6367f3d8214a5b0d8342302ce8c6fba Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 20 Oct 2025 22:22:28 +0200 Subject: [PATCH 0175/3334] [nrf fromlist] tests: drivers: spi_loopback: increase latency limit for nrf54h The nrf54h20 needs a slightly increased latency limit as the latency is around 650us at 8MHz, which is right above the current limit of 648us (CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12). Increase CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING to 15 to match cpuppr_xip and match the observed latency. Upstream PR #: 97452 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit fea9743c6530f89fbe510ffdf70042c279b36a23) --- .../spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 2 +- .../spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index ad922ab8d26f..725924348b53 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1 +1 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 +CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf index ad922ab8d26f..725924348b53 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -1 +1 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 +CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15 From 765d007f7a497d663d5dbd583bf6ee06a3de5086 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Wed, 30 Jul 2025 15:37:26 +0200 Subject: [PATCH 0176/3334] [nrf fromtree] dts: bindings: introduce nordic,nrfs-swext Introduce nordic NRFS SWEXT power domain bindings and add it to relevant SoC devicetree files. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit cf2e80d3734274c64e5b24573d4b16ed338c220d) --- .../power-domain/nordic,nrfs-swext.yaml | 26 +++++++++++++++++++ dts/vendor/nordic/nrf54h20.dtsi | 9 +++++++ 2 files changed, 35 insertions(+) create mode 100644 dts/bindings/power-domain/nordic,nrfs-swext.yaml diff --git a/dts/bindings/power-domain/nordic,nrfs-swext.yaml b/dts/bindings/power-domain/nordic,nrfs-swext.yaml new file mode 100644 index 000000000000..a504f4d97cdd --- /dev/null +++ b/dts/bindings/power-domain/nordic,nrfs-swext.yaml @@ -0,0 +1,26 @@ +# Copyright 2025 Nordic Semiconductor +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic NRFS SWEXT power domain + +compatible: "nordic,nrfs-swext" + +include: power-domain.yaml + +properties: + "#power-domain-cells": + const: 0 + + max-current-ua: + type: int + description: Maxmimum supported current in microamps. + required: true + + current-limit-ua: + type: int + description: Maxmimum allowed current in microamps. + required: true + + power-down-clamp: + type: boolean + description: Enable ground clamp on output when powered down. diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 06a7fe4d2495..e2ce4cfd9945 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -252,6 +252,15 @@ }; }; + swext: swext { + compatible = "nordic,nrfs-swext"; + status = "disabled"; + max-current-ua = <7500>; + current-limit-ua = <7500>; + zephyr,pm-device-runtime-auto; + #power-domain-cells = <0>; + }; + soc { #address-cells = <1>; #size-cells = <1>; From 3d5ca147ffdca3936590dd83ab960bce7a6ef244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 6 Oct 2025 15:36:10 +0200 Subject: [PATCH 0177/3334] [nrf fromtree] drivers: mspi_dw: Remove needless TXEIR check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit f0f5f8cdef74c79e2f28048dd842a05a1241e5af. There is no need to check if TXE interrupt flag is set before calling tx_dummy_bytes(), as the function can handle the case when it is called even though there is no room in the TX FIFO. On the other hand, the check may be actually harmful, as it may prevent adding more items to the TX FIFO while the SSI controller is waiting until the FIFO achieves its transfer start level. Remove the check then and exit the ISR loop when no dummy bytes could be written into the TX FIFO. Signed-off-by: Andrzej Głąbek (cherry picked from commit 7ff2be07f2091b971873776d2833902d39948411) --- drivers/mspi/mspi_dw.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index f7be2e33c9e5..518b5605785f 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -195,7 +195,7 @@ static void tx_data(const struct device *dev, dev_data->buf_pos = (uint8_t *)buf_pos; } -static bool tx_dummy_bytes(const struct device *dev) +static bool tx_dummy_bytes(const struct device *dev, bool *repeat) { struct mspi_dw_data *dev_data = dev->data; const struct mspi_dw_config *dev_config = dev->config; @@ -209,8 +209,17 @@ static bool tx_dummy_bytes(const struct device *dev) * FIFO to avoid overflowing it; `max_queued_dummy_bytes` accounts * that one byte that can be partially received, thus not included * in the value from the RXFLR register. + * This check also handles the case when the function is called but + * the TX FIFO is already filled up (fifo_room == 0). */ if (fifo_room <= rx_fifo_items) { + if (repeat) { + /* If no dummy bytes can be sent now, there is no point + * in repeating the loop that reads the RX FIFO. + */ + *repeat = false; + } + return false; } fifo_room -= rx_fifo_items; @@ -329,7 +338,9 @@ static void handle_fifos(const struct device *dev) finished = true; } } else { - for (;;) { + bool repeat = true; + + do { /* Always read everything from the RX FIFO, regardless * of the interrupt status. * tx_dummy_bytes() subtracts the number of items that @@ -363,19 +374,28 @@ static void handle_fifos(const struct device *dev) break; } - if (dev_data->dummy_bytes == 0 || - !(int_status & RISR_TXEIR_BIT)) { + /* If there are still some dummy bytes to transmit, + * always try to put some into the TX FIFO, no matter + * what's the TXE interrupt status - the TX FIFO may be + * filled above its threshold level (then its interrupt + * flag is not set), but below its transfer start level, + * so the controller may be waiting for more items to + * appear there. + */ + if (dev_data->dummy_bytes == 0) { break; } - if (tx_dummy_bytes(dev)) { + if (tx_dummy_bytes(dev, &repeat)) { /* All the required dummy bytes were written * to the FIFO; disable the TXE interrupt, * as it's no longer needed. */ set_imr(dev, IMR_RXFIM_BIT); } - } + + /* Repeat the loop only if any dummy bytes were sent. */ + } while (repeat); } if (finished) { @@ -1151,7 +1171,7 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) } /* Prefill TX FIFO with any data we can */ - if (dev_data->dummy_bytes && tx_dummy_bytes(dev)) { + if (dev_data->dummy_bytes && tx_dummy_bytes(dev, NULL)) { imr = IMR_RXFIM_BIT; } else if (packet->dir == MSPI_TX && packet->num_bytes) { tx_data(dev, packet); From 6333fa8efd71718fed5a340d3c6c1eae0f0aee8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 23 Oct 2025 13:01:14 +0200 Subject: [PATCH 0178/3334] [nrf fromtree] soc: nordic: uicr: Add support for UICR.WDTSTART MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for UICR.WDTSTART. UICR.WDTSTART configures the automatic start of a local watchdog timer before the application core is booted. This provides early system protection ensuring that the system can recover from early boot failures. Signed-off-by: Sebastian Bøe (cherry picked from commit af32ebd19868c7e8cff7e9f65e898a1d0771f653) --- scripts/ci/check_compliance.py | 18 ++-- soc/nordic/common/uicr/gen_uicr.py | 42 +++++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 16 ++++ soc/nordic/common/uicr/gen_uicr/Kconfig | 87 +++++++++++++++++++ 4 files changed, 157 insertions(+), 6 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index eea833ce0849..01d002e227a8 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1268,12 +1268,18 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_SETTING_1", "FOO_SETTING_2", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_PROTECTEDMEM", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_SECONDARY", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_SECONDARY_PROCESSOR_VALUE", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_SECURESTORAGE", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_PROTECTEDMEM", + "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", + "GEN_UICR_SECONDARY", + "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", + "GEN_UICR_SECONDARY_PROCESSOR_VALUE", + "GEN_UICR_SECONDARY_WDTSTART", + "GEN_UICR_SECONDARY_WDTSTART_CRV", + "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE", + "GEN_UICR_SECURESTORAGE", + "GEN_UICR_WDTSTART", + "GEN_UICR_WDTSTART_CRV", + "GEN_UICR_WDTSTART_INSTANCE_CODE", "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "IAR_BUFFERED_WRITE", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index bea0ba2a2dfa..da2938bf05c9 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -440,6 +440,36 @@ def main() -> None: type=int, help="Protected memory size in bytes (must be divisible by 4096)", ) + parser.add_argument( + "--wdtstart", + action="store_true", + help="Enable watchdog timer start in UICR", + ) + parser.add_argument( + "--wdtstart-instance-code", + type=lambda s: int(s, 0), + help="Watchdog timer instance code (0xBD2328A8 for WDT0, 0x1730C77F for WDT1)", + ) + parser.add_argument( + "--wdtstart-crv", + type=int, + help="Initial Counter Reload Value (CRV) for watchdog timer (minimum: 0xF)", + ) + parser.add_argument( + "--secondary-wdtstart", + action="store_true", + help="Enable watchdog timer start in UICR.SECONDARY", + ) + parser.add_argument( + "--secondary-wdtstart-instance-code", + type=lambda s: int(s, 0), + help="Secondary watchdog timer instance code (0xBD2328A8 for WDT0, 0x1730C77F for WDT1)", + ) + parser.add_argument( + "--secondary-wdtstart-crv", + type=int, + help="Secondary initial Counter Reload Value (CRV) for watchdog timer (minimum: 0xF)", + ) parser.add_argument( "--secondary", action="store_true", @@ -557,6 +587,12 @@ def main() -> None: uicr.PROTECTEDMEM.ENABLE = ENABLED_VALUE uicr.PROTECTEDMEM.SIZE4KB = args.protectedmem_size_bytes // KB_4 + # Handle WDTSTART configuration + if args.wdtstart: + uicr.WDTSTART.ENABLE = ENABLED_VALUE + uicr.WDTSTART.CRV = args.wdtstart_crv + uicr.WDTSTART.INSTANCE = args.wdtstart_instance_code + # Process periphconf data first and configure UICR completely before creating hex objects periphconf_hex = IntelHex() secondary_periphconf_hex = IntelHex() @@ -625,6 +661,12 @@ def main() -> None: uicr.SECONDARY.PERIPHCONF.MAXCOUNT = args.secondary_periphconf_size // 8 + # Handle secondary WDTSTART configuration + if args.secondary_wdtstart: + uicr.SECONDARY.WDTSTART.ENABLE = ENABLED_VALUE + uicr.SECONDARY.WDTSTART.CRV = args.secondary_wdtstart_crv + uicr.SECONDARY.WDTSTART.INSTANCE = args.secondary_wdtstart_instance_code + # Create UICR hex object with final UICR data uicr_hex = IntelHex() uicr_hex.frombytes(bytes(uicr), offset=args.uicr_address) diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index b64b7c0399ac..39737888023a 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -77,6 +77,7 @@ endif() set(protectedmem_args) set(periphconf_args) +set(wdtstart_args) set(periphconf_elfs) set(merged_hex_file ${APPLICATION_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.hex) set(secondary_periphconf_elfs) @@ -120,6 +121,13 @@ if(CONFIG_GEN_UICR_PROTECTEDMEM) list(APPEND protectedmem_args --protectedmem-size-bytes ${CONFIG_GEN_UICR_PROTECTEDMEM_SIZE_BYTES}) endif() +# Handle WDTSTART configuration +if(CONFIG_GEN_UICR_WDTSTART) + list(APPEND wdtstart_args --wdtstart) + list(APPEND wdtstart_args --wdtstart-instance-code ${CONFIG_GEN_UICR_WDTSTART_INSTANCE_CODE}) + list(APPEND wdtstart_args --wdtstart-crv ${CONFIG_GEN_UICR_WDTSTART_CRV}) +endif() + if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) # gen_uicr.py parses all zephyr.elf files. To find these files (which # have not been built yet) we scan sibling build directories for @@ -173,6 +181,13 @@ if(CONFIG_GEN_UICR_SECONDARY) --secondary-processor ${CONFIG_GEN_UICR_SECONDARY_PROCESSOR_VALUE} ) + # Handle secondary WDTSTART configuration + if(CONFIG_GEN_UICR_SECONDARY_WDTSTART) + list(APPEND secondary_args --secondary-wdtstart) + list(APPEND secondary_args --secondary-wdtstart-instance-code ${CONFIG_GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE}) + list(APPEND secondary_args --secondary-wdtstart-crv ${CONFIG_GEN_UICR_SECONDARY_WDTSTART_CRV}) + endif() + if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) # Compute SECONDARY_PERIPHCONF absolute address and size from this image's devicetree compute_partition_address_and_size("secondary_periphconf_partition" SECONDARY_PERIPHCONF_ADDRESS SECONDARY_PERIPHCONF_SIZE) @@ -195,6 +210,7 @@ add_custom_command( --uicr-address ${UICR_ADDRESS} --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} + ${wdtstart_args} ${periphconf_args} ${securestorage_args} ${protectedmem_args} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index fe7413a9d0da..74e24cafbee4 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -46,6 +46,93 @@ config GEN_UICR_PROTECTEDMEM_SIZE_BYTES Size of the protected memory region in bytes. This value must be divisible by 4096 (4 kiB). +config GEN_UICR_WDTSTART + bool "Enable UICR.WDTSTART" + help + When enabled, the UICR generator will configure an application + domain watchdog timer to start automatically before the + application core is booted. + +choice GEN_UICR_WDTSTART_INSTANCE + prompt "Watchdog timer instance" + depends on GEN_UICR_WDTSTART + default GEN_UICR_WDTSTART_INSTANCE_WDT0 + help + Select which watchdog timer instance to use. + +config GEN_UICR_WDTSTART_INSTANCE_WDT0 + bool "WDT0" + help + Use watchdog timer instance 0. + +config GEN_UICR_WDTSTART_INSTANCE_WDT1 + bool "WDT1" + help + Use watchdog timer instance 1. + +endchoice + +config GEN_UICR_WDTSTART_INSTANCE_CODE + hex + default 0xBD2328A8 if GEN_UICR_WDTSTART_INSTANCE_WDT0 + default 0x1730C77F if GEN_UICR_WDTSTART_INSTANCE_WDT1 + depends on GEN_UICR_WDTSTART + +config GEN_UICR_WDTSTART_CRV + int "Initial Counter Reload Value (CRV)" + default 65535 + range 15 4294967295 + depends on GEN_UICR_WDTSTART + help + Initial Counter Reload Value (CRV) for the watchdog timer. + This value determines the watchdog timeout period. + Must be at least 15 (0xF) to ensure proper watchdog operation. + Default value 65535 creates a 2-second timeout. + +config GEN_UICR_SECONDARY_WDTSTART + bool "Enable UICR.SECONDARY.WDTSTART" + depends on GEN_UICR_SECONDARY + help + When enabled, the UICR generator will configure the + watchdog timer to start automatically before the + secondary firmware is booted. + +choice GEN_UICR_SECONDARY_WDTSTART_INSTANCE + prompt "Secondary watchdog timer instance" + depends on GEN_UICR_SECONDARY_WDTSTART + default GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0 + help + Select which watchdog timer instance to use for secondary firmware. + +config GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0 + bool "WDT0" + help + Use watchdog timer instance 0 for secondary firmware. + +config GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT1 + bool "WDT1" + help + Use watchdog timer instance 1 for secondary firmware. + +endchoice + +config GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE + hex + default 0xBD2328A8 if GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0 + default 0x1730C77F if GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT1 + depends on GEN_UICR_SECONDARY_WDTSTART + +config GEN_UICR_SECONDARY_WDTSTART_CRV + int "Secondary initial Counter Reload Value (CRV)" + default 65535 + range 15 4294967295 + depends on GEN_UICR_SECONDARY_WDTSTART + help + Initial Counter Reload Value (CRV) for the secondary watchdog timer. + This value determines the watchdog timeout period. + Must be at least 15 (0xF) to ensure proper watchdog operation. + Default value 65535 creates a 2-second timeout. + config GEN_UICR_SECONDARY bool "Enable UICR.SECONDARY.ENABLE" From b607d4377d06fac29f1b63e445c57a238e32fc02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 23 Oct 2025 13:03:10 +0200 Subject: [PATCH 0179/3334] [nrf fromtree] soc: nordic: uicr: Add support for UICR.SECONDARY.TRIGGER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for UICR.SECONDARY.TRIGGER configuration, which enables automatic booting of secondary firmware based on specific reset reasons. This introduces Kconfig options for configuring: - UICR.SECONDARY.TRIGGER.ENABLE - Enable/disable automatic triggers - UICR.SECONDARY.TRIGGER.RESETREAS - Bitmask of reset reasons that trigger secondary firmware boot Individual Kconfig options are provided for each reset reason: - APPLICATIONWDT0/1 - Application core watchdog timeouts - APPLICATIONLOCKUP - Application core CPU lockup - RADIOCOREWDT0/1 - Radio core watchdog timeouts - RADIOCORELOCKUP - Radio core CPU lockup Signed-off-by: Sebastian Bøe (cherry picked from commit 9dc2b614d6bc21485ec90f812cf0d3512a16b23f) --- scripts/ci/check_compliance.py | 7 ++++ soc/nordic/common/uicr/gen_uicr.py | 19 +++++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 28 +++++++++++++ soc/nordic/common/uicr/gen_uicr/Kconfig | 42 +++++++++++++++++++ 4 files changed, 96 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 01d002e227a8..35778c02e1f0 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1273,6 +1273,13 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_SECONDARY", "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", "GEN_UICR_SECONDARY_PROCESSOR_VALUE", + "GEN_UICR_SECONDARY_TRIGGER", + "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP", + "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0", + "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1", + "GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP", + "GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0", + "GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1", "GEN_UICR_SECONDARY_WDTSTART", "GEN_UICR_SECONDARY_WDTSTART_CRV", "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index da2938bf05c9..36f4dc1d44c0 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -487,6 +487,20 @@ def main() -> None: type=lambda s: int(s, 0), help="Processor to boot for the secondary firmware ", ) + parser.add_argument( + "--secondary-trigger", + action="store_true", + help="Enable UICR.SECONDARY.TRIGGER for automatic secondary firmware boot on reset events", + ) + parser.add_argument( + "--secondary-trigger-resetreas", + default=0, + type=lambda s: int(s, 0), + help=( + "Bitmask of reset reasons that trigger secondary firmware boot " + "(decimal or 0x-prefixed hex)" + ), + ) parser.add_argument( "--secondary-periphconf-address", default=None, @@ -628,6 +642,11 @@ def main() -> None: uicr.SECONDARY.ADDRESS = args.secondary_address uicr.SECONDARY.PROCESSOR = args.secondary_processor + # Handle secondary TRIGGER configuration + if args.secondary_trigger: + uicr.SECONDARY.TRIGGER.ENABLE = ENABLED_VALUE + uicr.SECONDARY.TRIGGER.RESETREAS = args.secondary_trigger_resetreas + # Handle secondary periphconf if provided if args.out_secondary_periphconf_hex: secondary_periphconf_combined = extract_and_combine_periphconfs( diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 39737888023a..d5a71e0562f4 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -188,6 +188,34 @@ if(CONFIG_GEN_UICR_SECONDARY) list(APPEND secondary_args --secondary-wdtstart-crv ${CONFIG_GEN_UICR_SECONDARY_WDTSTART_CRV}) endif() + # Handle secondary TRIGGER configuration + if(CONFIG_GEN_UICR_SECONDARY_TRIGGER) + list(APPEND secondary_args --secondary-trigger) + + # Compute RESETREAS bitmask from individual trigger configs + set(resetreas_value 0) + if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0) + math(EXPR resetreas_value "${resetreas_value} + 0x001") + endif() + if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1) + math(EXPR resetreas_value "${resetreas_value} + 0x002") + endif() + if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP) + math(EXPR resetreas_value "${resetreas_value} + 0x008") + endif() + if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0) + math(EXPR resetreas_value "${resetreas_value} + 0x020") + endif() + if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1) + math(EXPR resetreas_value "${resetreas_value} + 0x040") + endif() + if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP) + math(EXPR resetreas_value "${resetreas_value} + 0x100") + endif() + + list(APPEND secondary_args --secondary-trigger-resetreas ${resetreas_value}) + endif() + if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) # Compute SECONDARY_PERIPHCONF absolute address and size from this image's devicetree compute_partition_address_and_size("secondary_periphconf_partition" SECONDARY_PERIPHCONF_ADDRESS SECONDARY_PERIPHCONF_SIZE) diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 74e24cafbee4..6d213a95887d 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -168,6 +168,48 @@ config GEN_UICR_SECONDARY_PROCESSOR_VALUE default 0xBD2328A8 if GEN_UICR_SECONDARY_PROCESSOR_APPLICATION default 0x1730C77F if GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE +config GEN_UICR_SECONDARY_TRIGGER + bool "Enable UICR.SECONDARY.TRIGGER" + help + When enabled, configures automatic triggers that cause IronSide SE + to boot the secondary firmware instead of the primary firmware based + on specific reset reasons. + +if GEN_UICR_SECONDARY_TRIGGER + +config GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0 + bool "Trigger on Application domain watchdog 0 reset" + help + Boot secondary firmware when Application domain watchdog 0 causes a reset. + +config GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1 + bool "Trigger on Application domain watchdog 1 reset" + help + Boot secondary firmware when Application domain watchdog 1 causes a reset. + +config GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP + bool "Trigger on Application domain CPU lockup reset" + help + Boot secondary firmware when Application domain CPU lockup causes a reset. + +config GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0 + bool "Trigger on Radio core watchdog 0 reset" + help + Boot secondary firmware when Radio core watchdog 0 causes a reset. + +config GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1 + bool "Trigger on Radio core watchdog 1 reset" + help + Boot secondary firmware when Radio core watchdog 1 causes a reset. + +config GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP + bool "Trigger on Radio core CPU lockup reset" + help + Boot secondary firmware when Radio core CPU lockup causes a reset. + + +endif # GEN_UICR_SECONDARY_TRIGGER + endif # GEN_UICR_SECONDARY endmenu From 914c52e08ada7bdf825ee487f5de04d67ec5a6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 23 Oct 2025 13:03:25 +0200 Subject: [PATCH 0180/3334] [nrf fromtree] soc: nordic: uicr: Add support for UICR.SECONDARY.PROTECTEDMEM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for UICR.SECONDARY.PROTECTEDMEM configuration, which enables configuration of the protected memory region for secondary firmware. This introduces Kconfig options for configuring: - GEN_UICR_SECONDARY_PROTECTEDMEM - Enable/disable protected memory for secondary firmware - GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES - Size of the protected memory region in bytes The implementation validates that the configured size is divisible by 4096 bytes (4 KiB) as required by the hardware, and converts it to 4 KiB units when writing to UICR.SECONDARY.PROTECTEDMEM.SIZE4KB. Signed-off-by: Sebastian Bøe (cherry picked from commit c3f6b8cb34b91ae336894006596107943974e0ae) --- scripts/ci/check_compliance.py | 2 ++ soc/nordic/common/uicr/gen_uicr.py | 15 +++++++++++++++ soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 5 +++++ soc/nordic/common/uicr/gen_uicr/Kconfig | 16 +++++++++++++++- 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 35778c02e1f0..f7d444a55565 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1273,6 +1273,8 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_SECONDARY", "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", "GEN_UICR_SECONDARY_PROCESSOR_VALUE", + "GEN_UICR_SECONDARY_PROTECTEDMEM", + "GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES", "GEN_UICR_SECONDARY_TRIGGER", "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP", "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 36f4dc1d44c0..0b47be4c5a4d 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -501,6 +501,12 @@ def main() -> None: "(decimal or 0x-prefixed hex)" ), ) + parser.add_argument( + "--secondary-protectedmem-size", + default=None, + type=lambda s: int(s, 0), + help="Size in bytes of the secondary protected memory region (decimal or 0x-prefixed hex)", + ) parser.add_argument( "--secondary-periphconf-address", default=None, @@ -647,6 +653,15 @@ def main() -> None: uicr.SECONDARY.TRIGGER.ENABLE = ENABLED_VALUE uicr.SECONDARY.TRIGGER.RESETREAS = args.secondary_trigger_resetreas + # Handle secondary PROTECTEDMEM configuration + if args.secondary_protectedmem_size: + uicr.SECONDARY.PROTECTEDMEM.ENABLE = ENABLED_VALUE + if args.secondary_protectedmem_size % 4096 != 0: + raise ScriptError( + f"args.secondary_protectedmem_size was {args.secondary_protectedmem_size}, " + f"but must be divisible by 4096" + ) + uicr.SECONDARY.PROTECTEDMEM.SIZE4KB = args.secondary_protectedmem_size // 4096 # Handle secondary periphconf if provided if args.out_secondary_periphconf_hex: secondary_periphconf_combined = extract_and_combine_periphconfs( diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index d5a71e0562f4..41ccdf454a33 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -216,6 +216,11 @@ if(CONFIG_GEN_UICR_SECONDARY) list(APPEND secondary_args --secondary-trigger-resetreas ${resetreas_value}) endif() + # Handle secondary PROTECTEDMEM configuration + if(CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM) + list(APPEND secondary_args --secondary-protectedmem-size ${CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES}) + endif() + if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) # Compute SECONDARY_PERIPHCONF absolute address and size from this image's devicetree compute_partition_address_and_size("secondary_periphconf_partition" SECONDARY_PERIPHCONF_ADDRESS SECONDARY_PERIPHCONF_SIZE) diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 6d213a95887d..df5616dc0442 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -207,9 +207,23 @@ config GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP help Boot secondary firmware when Radio core CPU lockup causes a reset. - endif # GEN_UICR_SECONDARY_TRIGGER +config GEN_UICR_SECONDARY_PROTECTEDMEM + bool "Enable UICR.SECONDARY.PROTECTEDMEM" + depends on GEN_UICR_SECONDARY + help + When enabled, the UICR generator will configure the + protected memory region for the secondary firmware. + +config GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES + int "Secondary protected memory size in bytes" + default 4096 + depends on GEN_UICR_SECONDARY_PROTECTEDMEM + help + Size of the secondary protected memory region in bytes. + This value must be divisible by 4096 (4 kiB). + endif # GEN_UICR_SECONDARY endmenu From 3ec66739f3f33993b8094b53112438b0a897275c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 23 Oct 2025 13:03:36 +0200 Subject: [PATCH 0181/3334] [nrf fromtree] soc: nordic: uicr: Add support for UICR.LOCK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for UICR.LOCK configuration, which locks the entire UICR configuration in NVR0 to prevent unauthorized modifications. This introduces a Kconfig option GEN_UICR_LOCK that enables locking of the UICR. Once locked, the UICR can only be modified by performing an ERASEALL operation. This is a critical security feature for production devices, typically enabled alongside UICR.APPROTECT, UICR.PROTECTEDMEM, and UICR.ERASEPROTECT to establish a complete device protection scheme. When enabled, the gen_uicr.py script sets UICR.LOCK to 0xFFFFFFFF, which configures the NVR0 page as read-only and enforces integrity checks on the UICR content. Signed-off-by: Sebastian Bøe (cherry picked from commit 1ffdf09c25dfb0082bdaccab5232823b73a15494) --- scripts/ci/check_compliance.py | 1 + soc/nordic/common/uicr/gen_uicr.py | 8 ++++++++ soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 7 +++++++ soc/nordic/common/uicr/gen_uicr/Kconfig | 11 +++++++++++ 4 files changed, 27 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index f7d444a55565..96fda75b3b3c 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1268,6 +1268,7 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_SETTING_1", "FOO_SETTING_2", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_LOCK", "GEN_UICR_PROTECTEDMEM", "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", "GEN_UICR_SECONDARY", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 0b47be4c5a4d..103dec53e82b 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -430,6 +430,11 @@ def main() -> None: type=lambda s: int(s, 0), help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", ) + parser.add_argument( + "--lock", + action="store_true", + help="Enable UICR.LOCK to prevent modifications without ERASEALL", + ) parser.add_argument( "--protectedmem", action="store_true", @@ -597,6 +602,9 @@ def main() -> None: uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 + # Handle LOCK configuration + if args.lock: + uicr.LOCK = ENABLED_VALUE # Handle protected memory configuration if args.protectedmem: if args.protectedmem_size_bytes % KB_4 != 0: diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 41ccdf454a33..8df980b0743b 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -75,6 +75,7 @@ endfunction() if(CMAKE_VERBOSE_MAKEFILE) endif() +set(lock_args) set(protectedmem_args) set(periphconf_args) set(wdtstart_args) @@ -115,6 +116,11 @@ if(CONFIG_GEN_UICR_SECURESTORAGE) list(APPEND securestorage_args --cpurad-its-size ${CPURAD_ITS_SIZE}) endif(CONFIG_GEN_UICR_SECURESTORAGE) +# Handle LOCK configuration +if(CONFIG_GEN_UICR_LOCK) + list(APPEND lock_args --lock) +endif() + # Handle protected memory configuration if(CONFIG_GEN_UICR_PROTECTEDMEM) list(APPEND protectedmem_args --protectedmem) @@ -243,6 +249,7 @@ add_custom_command( --uicr-address ${UICR_ADDRESS} --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} + ${lock_args} ${wdtstart_args} ${periphconf_args} ${securestorage_args} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index df5616dc0442..ef78927c8619 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -32,6 +32,17 @@ config GEN_UICR_SECURESTORAGE - At least one subpartition must be defined - Combined subpartition sizes must equal secure_storage_partition size +config GEN_UICR_LOCK + bool "Enable UICR.LOCK" + help + When enabled, locks the entire contents of the NVR0 page located in + MRAM10. This includes all values in both the UICR and the BICR (Board + Information Configuration Registers). Once locked, the UICR can only + be modified by performing an ERASEALL operation. + + This should be enabled only in production devices to prevent + unauthorized modification. + config GEN_UICR_PROTECTEDMEM bool "Enable UICR.PROTECTEDMEM" help From 868f02b0965929999bd9209eb44d3b238d29d550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 23 Oct 2025 13:03:47 +0200 Subject: [PATCH 0182/3334] [nrf fromtree] soc: nordic: uicr: Add support for UICR.ERASEPROTECT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for UICR.ERASEPROTECT configuration, which blocks ERASEALL operations to prevent bulk erasure of protected memory. This introduces a Kconfig option GEN_UICR_ERASEPROTECT that enables blocking of ERASEALL operations on NVR0, preserving UICR settings even if an attacker attempts a full-chip erase. This is a critical security feature for production devices. When enabled together with UICR.LOCK, it becomes impossible to modify the UICR in any way, establishing a permanent device protection scheme. Due to this irreversibility, it should only be enabled during the final stages of production. When enabled, the gen_uicr.py script sets UICR.ERASEPROTECT to 0xFFFFFFFF, which prevents the ERASEALL command from affecting the NVR0 page. Signed-off-by: Sebastian Bøe (cherry picked from commit e20352d80a02cbf1053932bfcd34489ba4a0f369) --- scripts/ci/check_compliance.py | 1 + soc/nordic/common/uicr/gen_uicr.py | 8 ++++++++ soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 7 +++++++ soc/nordic/common/uicr/gen_uicr/Kconfig | 12 ++++++++++++ 4 files changed, 28 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 96fda75b3b3c..73734026c7b6 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1267,6 +1267,7 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_LOG_LEVEL", "FOO_SETTING_1", "FOO_SETTING_2", + "GEN_UICR_ERASEPROTECT", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_LOCK", "GEN_UICR_PROTECTEDMEM", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 103dec53e82b..390d96042528 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -435,6 +435,11 @@ def main() -> None: action="store_true", help="Enable UICR.LOCK to prevent modifications without ERASEALL", ) + parser.add_argument( + "--eraseprotect", + action="store_true", + help="Enable UICR.ERASEPROTECT to block ERASEALL operations", + ) parser.add_argument( "--protectedmem", action="store_true", @@ -605,6 +610,9 @@ def main() -> None: # Handle LOCK configuration if args.lock: uicr.LOCK = ENABLED_VALUE + # Handle ERASEPROTECT configuration + if args.eraseprotect: + uicr.ERASEPROTECT = ENABLED_VALUE # Handle protected memory configuration if args.protectedmem: if args.protectedmem_size_bytes % KB_4 != 0: diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 8df980b0743b..0802d4f2f870 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -76,6 +76,7 @@ if(CMAKE_VERBOSE_MAKEFILE) endif() set(lock_args) +set(eraseprotect_args) set(protectedmem_args) set(periphconf_args) set(wdtstart_args) @@ -121,6 +122,11 @@ if(CONFIG_GEN_UICR_LOCK) list(APPEND lock_args --lock) endif() +# Handle ERASEPROTECT configuration +if(CONFIG_GEN_UICR_ERASEPROTECT) + list(APPEND eraseprotect_args --eraseprotect) +endif() + # Handle protected memory configuration if(CONFIG_GEN_UICR_PROTECTEDMEM) list(APPEND protectedmem_args --protectedmem) @@ -250,6 +256,7 @@ add_custom_command( --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} ${lock_args} + ${eraseprotect_args} ${wdtstart_args} ${periphconf_args} ${securestorage_args} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index ef78927c8619..39f304eb47cd 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -43,6 +43,18 @@ config GEN_UICR_LOCK This should be enabled only in production devices to prevent unauthorized modification. +config GEN_UICR_ERASEPROTECT + bool "Enable UICR.ERASEPROTECT" + depends on ! GEN_UICR_LOCK + help + When enabled, ERASEALL operations are blocked. + + This option is mutually exclusive with UICR.LOCK in Kconfig to prevent + accidental configuration where both are enabled simultaneously. If both + were enabled, the UICR would become impossible to modify in any way. + Note that gen_uicr.py can be used directly to create a configuration + with both enabled if needed. + config GEN_UICR_PROTECTEDMEM bool "Enable UICR.PROTECTEDMEM" help From d063f0bf70a4b5f12c1a7aa7d478be2b7b6afc9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 23 Oct 2025 13:04:02 +0200 Subject: [PATCH 0183/3334] [nrf fromtree] soc: nordic: uicr: Add support for UICR.APPROTECT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for UICR.APPROTECT configuration, which controls debugger and access-port permissions through the TAMPC peripheral. This introduces three Kconfig options that allow independent control over access port protection for different processor domains: - GEN_UICR_APPROTECT_APPLICATION_PROTECTED: Controls debug access to the application domain processor - GEN_UICR_APPROTECT_RADIOCORE_PROTECTED: Controls debug access to the radio core processor - GEN_UICR_APPROTECT_CORESIGHT_PROTECTED: Controls access to the CoreSight debug infrastructure When enabled, each option sets the corresponding UICR.APPROTECT register to PROTECTED (0xFFFFFFFF), which disables debug access for that domain. When disabled, the registers remain at their erased value (UNPROTECTED), allowing full debug access. This feature is critical for production devices where debug access must be restricted to prevent unauthorized access to sensitive code and data. Signed-off-by: Sebastian Bøe (cherry picked from commit 1438f8ae69f8869a7a99a241e50cb238b8174d11) --- scripts/ci/check_compliance.py | 3 +++ soc/nordic/common/uicr/gen_uicr.py | 26 +++++++++++++++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 15 +++++++++++ soc/nordic/common/uicr/gen_uicr/Kconfig | 24 +++++++++++++++++ 4 files changed, 68 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 73734026c7b6..e0f67ce8ac62 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1267,6 +1267,9 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_LOG_LEVEL", "FOO_SETTING_1", "FOO_SETTING_2", + "GEN_UICR_APPROTECT_APPLICATION_PROTECTED", + "GEN_UICR_APPROTECT_CORESIGHT_PROTECTED", + "GEN_UICR_APPROTECT_RADIOCORE_PROTECTED", "GEN_UICR_ERASEPROTECT", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_LOCK", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 390d96042528..036ee770e12c 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -25,6 +25,8 @@ # Common values for representing enabled/disabled in the UICR format. ENABLED_VALUE = 0xFFFF_FFFF DISABLED_VALUE = 0xBD23_28A8 +PROTECTED_VALUE = ENABLED_VALUE # UICR_PROTECTED = UICR_ENABLED per uicr_defs.h +UNPROTECTED_VALUE = DISABLED_VALUE # Unprotected uses the default erased value KB_4 = 4096 @@ -440,6 +442,21 @@ def main() -> None: action="store_true", help="Enable UICR.ERASEPROTECT to block ERASEALL operations", ) + parser.add_argument( + "--approtect-application-protected", + action="store_true", + help="Protect application domain access port (disable debug access)", + ) + parser.add_argument( + "--approtect-radiocore-protected", + action="store_true", + help="Protect radio core access port (disable debug access)", + ) + parser.add_argument( + "--approtect-coresight-protected", + action="store_true", + help="Protect CoreSight access port (disable debug access)", + ) parser.add_argument( "--protectedmem", action="store_true", @@ -613,6 +630,15 @@ def main() -> None: # Handle ERASEPROTECT configuration if args.eraseprotect: uicr.ERASEPROTECT = ENABLED_VALUE + # Handle APPROTECT configuration + if args.approtect_application_protected: + uicr.APPROTECT.APPLICATION = PROTECTED_VALUE + + if args.approtect_radiocore_protected: + uicr.APPROTECT.RADIOCORE = PROTECTED_VALUE + + if args.approtect_coresight_protected: + uicr.APPROTECT.CORESIGHT = PROTECTED_VALUE # Handle protected memory configuration if args.protectedmem: if args.protectedmem_size_bytes % KB_4 != 0: diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 0802d4f2f870..290cf16a0a6f 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -77,6 +77,7 @@ endif() set(lock_args) set(eraseprotect_args) +set(approtect_args) set(protectedmem_args) set(periphconf_args) set(wdtstart_args) @@ -127,6 +128,19 @@ if(CONFIG_GEN_UICR_ERASEPROTECT) list(APPEND eraseprotect_args --eraseprotect) endif() +# Handle APPROTECT configuration +if(CONFIG_GEN_UICR_APPROTECT_APPLICATION_PROTECTED) + list(APPEND approtect_args --approtect-application-protected) +endif() + +if(CONFIG_GEN_UICR_APPROTECT_RADIOCORE_PROTECTED) + list(APPEND approtect_args --approtect-radiocore-protected) +endif() + +if(CONFIG_GEN_UICR_APPROTECT_CORESIGHT_PROTECTED) + list(APPEND approtect_args --approtect-coresight-protected) +endif() + # Handle protected memory configuration if(CONFIG_GEN_UICR_PROTECTEDMEM) list(APPEND protectedmem_args --protectedmem) @@ -257,6 +271,7 @@ add_custom_command( --out-uicr-hex ${uicr_hex_file} ${lock_args} ${eraseprotect_args} + ${approtect_args} ${wdtstart_args} ${periphconf_args} ${securestorage_args} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 39f304eb47cd..7f25cc839dd6 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -55,6 +55,30 @@ config GEN_UICR_ERASEPROTECT Note that gen_uicr.py can be used directly to create a configuration with both enabled if needed. +menu "UICR.APPROTECT - Access Port Protection" + +config GEN_UICR_APPROTECT_APPLICATION_PROTECTED + bool "Protect application domain access port" + help + When enabled, disables debug access to the application domain processor, + preventing debugger connection to application memory, registers, and debug + features. When disabled, full debug access is enabled. + +config GEN_UICR_APPROTECT_RADIOCORE_PROTECTED + bool "Protect radio core access port" + help + When enabled, disables debug access to the radio core processor, + preventing debugger connection to radio core memory, registers, and debug + features. When disabled, full debug access is enabled. + +config GEN_UICR_APPROTECT_CORESIGHT_PROTECTED + bool "Disable CoreSight subsystem" + help + When enabled will disable the coresight subsystem, preventing + system level trace features. + +endmenu + config GEN_UICR_PROTECTEDMEM bool "Enable UICR.PROTECTEDMEM" help From a623ac2a835279583ec59281ed7b78641008eba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 23 Oct 2025 13:04:16 +0200 Subject: [PATCH 0184/3334] [nrf fromtree] soc: nordic: uicr: Add safety flag for permanent device transition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add --permit-permanently-transitioning-device-to-deployed safety flag to gen_uicr.py, required when enabling both UICR.LOCK and UICR.ERASEPROTECT together. This prevents accidental permanent locking of devices since this combination makes the configuration irreversible. Signed-off-by: Sebastian Bøe (cherry picked from commit 35b89abd6120036033a2591db67d1b7921a229e4) --- scripts/ci/check_compliance.py | 2 +- soc/nordic/common/uicr/gen_uicr.py | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index e0f67ce8ac62..7584fa801187 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1271,7 +1271,7 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_APPROTECT_CORESIGHT_PROTECTED", "GEN_UICR_APPROTECT_RADIOCORE_PROTECTED", "GEN_UICR_ERASEPROTECT", - "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_GENERATE_PERIPHCONF", "GEN_UICR_LOCK", "GEN_UICR_PROTECTEDMEM", "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 036ee770e12c..8dbbc7fe5ce9 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -432,6 +432,14 @@ def main() -> None: type=lambda s: int(s, 0), help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", ) + parser.add_argument( + "--permit-permanently-transitioning-device-to-deployed", + action="store_true", + help=( + "Safety flag required to enable both UICR.LOCK and UICR.ERASEPROTECT together. " + "Must be explicitly provided to acknowledge permanent device state changes." + ), + ) parser.add_argument( "--lock", action="store_true", @@ -624,10 +632,22 @@ def main() -> None: uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 - # Handle LOCK configuration + # Handle LOCK and ERASEPROTECT configuration + # Check if both are enabled together - this requires explicit acknowledgment + if ( + args.lock + and args.eraseprotect + and not args.permit_permanently_transitioning_device_to_deployed + ): + raise ScriptError( + "Enabling both --lock and --eraseprotect requires " + "--permit-permanently-transitioning-device-to-deployed to be specified. " + "This combination permanently locks the device configuration and prevents " + "ERASEALL." + ) + if args.lock: uicr.LOCK = ENABLED_VALUE - # Handle ERASEPROTECT configuration if args.eraseprotect: uicr.ERASEPROTECT = ENABLED_VALUE # Handle APPROTECT configuration From fad3004ea77f425161790de7a8563244c904fd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Mon, 20 Oct 2025 12:14:29 +0200 Subject: [PATCH 0185/3334] [nrf fromtree] scripts: ci: check_compliance: Add missing gen_uicr UNDEF's MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing gen_uicr UNDEF's. Signed-off-by: Sebastian Bøe (cherry picked from commit 8e59980f01463571ecb98510928ce31a0a93db84) --- scripts/ci/check_compliance.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 7584fa801187..8e3dc7347bb8 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1277,6 +1277,8 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", "GEN_UICR_SECONDARY", "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", + "GEN_UICR_SECONDARY_PROCESSOR_APPLICATION", + "GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE", "GEN_UICR_SECONDARY_PROCESSOR_VALUE", "GEN_UICR_SECONDARY_PROTECTEDMEM", "GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES", @@ -1290,10 +1292,14 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_SECONDARY_WDTSTART", "GEN_UICR_SECONDARY_WDTSTART_CRV", "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE", + "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0", + "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT1", "GEN_UICR_SECURESTORAGE", "GEN_UICR_WDTSTART", "GEN_UICR_WDTSTART_CRV", "GEN_UICR_WDTSTART_INSTANCE_CODE", + "GEN_UICR_WDTSTART_INSTANCE_WDT0", + "GEN_UICR_WDTSTART_INSTANCE_WDT1", "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "IAR_BUFFERED_WRITE", From 3861d81770e4a09b2e36045fe4193300ad23961b Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 21 Oct 2025 14:02:53 +0200 Subject: [PATCH 0186/3334] [nrf fromtree] scripts: runners: nrf: Generalize the use of --erase-mode for all ICs Until now, for historical reasons (see f42cef9c81379b116664731f3bb5449257b3a1af and 58e0e31c7e273b12ad4895a8d441b07c7c3e807e), the use of the --erase-mode command-line switch was reserved for the nRF54L family. But in fact this can be used (instead of --erase) for any of the Nordic ICs. This patch extends the usage of this switch regardless of family. Signed-off-by: Carles Cufi (cherry picked from commit 146fd2c88ec38655d61d8fa3fc879cb47a9fd33d) --- scripts/west_commands/runners/nrf_common.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index afa4665d8f47..e4c54732d59b 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -357,10 +357,13 @@ def program_hex(self): if not self.erase and regtool_generated_uicr: self.exec_op('erase', core=core, kind='uicr') else: + erase_mode = self._get_erase_mode(self.erase_mode) if self.erase: erase_arg = 'ERASE_ALL' + elif self.erase_mode: + erase_arg = erase_mode elif self.family == 'nrf54l': - erase_arg = self._get_erase_mode(self.erase_mode) or 'ERASE_NONE' + erase_arg = 'ERASE_NONE' else: erase_arg = 'ERASE_RANGES_TOUCHED_BY_FIRMWARE' @@ -479,10 +482,6 @@ def do_run(self, command, **kwargs): self.ensure_family() - if self.family != 'nrf54l' and self.erase_mode: - raise RuntimeError('Option --erase-mode can only be used with the ' - 'nRF54L family.') - self.ensure_output('hex') if IntelHex is None: raise RuntimeError('Python dependency intelhex was missing; ' From f846c3f63e74b85f834f15556c3c03d46da05045 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 21 Oct 2025 19:16:59 +0200 Subject: [PATCH 0187/3334] [nrf fromtree] scripts: runners: nrfutil: Add a new --dry-run parameter In order to allow for users to invoke "west flash" without actual hardware connected but still running the logic and pregeneration of commands, specifically the json file. Signed-off-by: Carles Cufi (cherry picked from commit 0679c0571246e6b0a4f746bff7187d0cc240da9a) --- scripts/west_commands/runners/nrf_common.py | 9 ++++--- scripts/west_commands/runners/nrfutil.py | 28 ++++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index e4c54732d59b..75ad66aed99f 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -53,7 +53,7 @@ class NrfBinaryRunner(ZephyrBinaryRunner): def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, erase_mode=None, ext_erase_mode=None, reset=True, - tool_opt=None, force=False, recover=False): + tool_opt=None, force=False, recover=False, dry_run=False): super().__init__(cfg) self.hex_ = cfg.hex_file # The old --nrf-family options takes upper-case family names @@ -67,6 +67,7 @@ def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, self.reset = bool(reset) self.force = force self.recover = bool(recover) + self.dry_run = bool(dry_run) self.tool_opt = [] if tool_opt is not None: @@ -118,7 +119,6 @@ def do_add_parser(cls, parser): choices=['none', 'ranges', 'all'], help='Select the type of erase operation for the ' 'external non-volatile memory') - parser.set_defaults(reset=True) @classmethod @@ -139,7 +139,10 @@ def ensure_snr(self): self.dev_id = [d.lstrip("0") for d in dev_id] return if not dev_id or "*" in dev_id: - dev_id = self.get_board_snr(dev_id or "*") + if not self.dry_run: + dev_id = self.get_board_snr(dev_id or "*") + else: + dev_id = "DEVICEID" # for a dry run self.dev_id = dev_id.lstrip("0") @abc.abstractmethod diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index 0490df29ca17..9deb32e06a02 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -5,6 +5,7 @@ '''Runner for flashing with nrfutil.''' import json +import shlex import subprocess import sys from pathlib import Path @@ -18,12 +19,12 @@ class NrfUtilBinaryRunner(NrfBinaryRunner): def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, erase_mode=None, ext_erase_mode=None, reset=True, tool_opt=None, - force=False, recover=False, - ext_mem_config_file=None): + force=False, recover=False, ext_mem_config_file=None, + dry_run=False): super().__init__(cfg, family, softreset, pinreset, dev_id, erase, erase_mode, ext_erase_mode, reset, tool_opt, force, - recover) + recover, dry_run) self.ext_mem_config_file = ext_mem_config_file @@ -55,7 +56,8 @@ def do_create(cls, cfg, args): ext_erase_mode=args.ext_erase_mode, reset=args.reset, tool_opt=args.tool_opt, force=args.force, recover=args.recover, - ext_mem_config_file=args.ext_mem_config_file) + ext_mem_config_file=args.ext_mem_config_file, + dry_run=args.dry_run) @classmethod def do_add_parser(cls, parser): @@ -63,15 +65,23 @@ def do_add_parser(cls, parser): parser.add_argument('--ext-mem-config-file', required=False, dest='ext_mem_config_file', help='path to an JSON file with external memory configuration') + parser.add_argument('--dry-run', required=False, + action='store_true', + help='''Generate all the commands without actually + executing them''') - def _exec(self, args): + def _exec(self, args, force=False): jout_all = [] cmd = ['nrfutil', '--json', 'device'] + args - self._log_cmd(cmd) - if _DRY_RUN: - return {} + escaped = ' '.join(shlex.quote(s) for s in cmd) + if _DRY_RUN or (self.dry_run): + self.logger.info(escaped) + if not force: + return {} + else: + self.logger.debug(escaped) with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p: for line in iter(p.stdout.readline, b''): @@ -148,7 +158,7 @@ def _append_batch(self, op, json_file): cmd += ['--core', op['core']] if op.get('core') else [] cmd += ['--x-family', f'{self.family}'] cmd += ['--x-append-batch', f'{json_file}'] - self._exec(cmd) + self._exec(cmd, force=True) def _exec_batch(self): # Use x-append-batch to get the JSON from nrfutil itself From 90d9ce1ec26f0d819de7d7f5e90ed98496cd8a5b Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Mon, 13 Oct 2025 15:14:35 +0200 Subject: [PATCH 0188/3334] [nrf fromtree] soc: nordic: instantiate NRF_PLATFORM_LUMOS kconfig Instantiate NRF_PLATFORM_LUMOS for all nrf lumos product, Add NRF_SKIP_CLOCK_CONFIG kconfig to be a general kconfig in nordic soc Kconfig, so that it can be used by other lumos product. Signed-off-by: Travis Lam (cherry picked from commit 0042c1d29986269b8cc23162e6b7690252821867) --- .../bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig | 2 +- .../bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig | 2 +- .../bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig | 2 +- .../nrf54l15dk_nrf54l10_cpuapp_ns_defconfig | 2 +- .../nrf54l15dk_nrf54l15_cpuapp_ns_defconfig | 2 +- .../panb611evb_nrf54l15_cpuapp_ns_defconfig | 2 +- ...ytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig | 2 +- modules/hal_nordic/nrfx/CMakeLists.txt | 2 +- soc/nordic/Kconfig | 16 ++++++++++++++++ soc/nordic/nrf54l/Kconfig | 7 +------ 10 files changed, 25 insertions(+), 14 deletions(-) diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig index dea04c45f20c..e62b6fe90745 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig @@ -34,4 +34,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig index dea04c45f20c..e62b6fe90745 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig @@ -34,4 +34,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig index dea04c45f20c..e62b6fe90745 100644 --- a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig @@ -34,4 +34,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig index d9f869918bfe..a0a4a0c63ac6 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig @@ -32,4 +32,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig index d9f869918bfe..a0a4a0c63ac6 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig @@ -32,4 +32,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuapp_ns_defconfig b/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuapp_ns_defconfig index 5f6e098f4528..e360981191e8 100644 --- a/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuapp_ns_defconfig +++ b/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuapp_ns_defconfig @@ -33,4 +33,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig index 866a03cd8687..0df2316b4502 100644 --- a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig +++ b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig @@ -34,4 +34,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index e944f06c805b..40ef9d08fd86 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -190,7 +190,7 @@ if(CONFIG_SOC_NRF54L_CPUAPP_COMMON) zephyr_compile_definitions("NRF_CONFIG_CPU_FREQ_MHZ=${clock_frequency_mhz}") endif() -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION) +zephyr_compile_definitions_ifdef(CONFIG_NRF_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_DISABLE_FICR_TRIMCNF NRF_DISABLE_FICR_TRIMCNF) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE NRF_SKIP_GLITCHDETECTOR_DISABLE) zephyr_compile_definitions_ifndef(CONFIG_SOC_NRF54L_ANOMALY_56_WORKAROUND NRF54L_CONFIGURATION_56_ENABLE=0) diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index d86e98e3dbc7..46efc8c2c744 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -197,6 +197,15 @@ config NRF_SECURE_APPROTECT_USER_HANDLING endchoice +config NRF_SKIP_CLOCK_CONFIG + bool + prompt "Skip clock frequency configuration" if TRUSTED_EXECUTION_SECURE + depends on NRF_PLATFORM_LUMOS + default y if TRUSTED_EXECUTION_NONSECURE + help + With this option, the CPU clock frequency is not set during system initialization. + The CPU runs with the default, hardware-selected frequency. + config NRF_TRACE_PORT bool "nRF TPIU" depends on !SOC_SERIES_NRF51X @@ -212,4 +221,11 @@ config NRF_PLATFORM_HALTIUM this option. This allows to easily enable common functionality on SoCs based on the Haltium platform. +config NRF_PLATFORM_LUMOS + bool + help + SoC series based on the Nordic nRF Lumos platform such as nRF54Lx + series. This allows to easily enable common functionality on + SoCs based on the Lumos platform. + endif # SOC_FAMILY_NORDIC_NRF diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 114c1dc6b5a6..b211d2417cd8 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -8,6 +8,7 @@ config SOC_SERIES_NRF54LX select HAS_NRFX select HAS_NORDIC_DRIVERS select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE + select NRF_PLATFORM_LUMOS config SOC_NRF54L_CPUAPP_COMMON bool @@ -55,12 +56,6 @@ config SOC_NRF54LM20A_ENGA_CPUFLPR if SOC_SERIES_NRF54LX -config SOC_NRF54LX_SKIP_CLOCK_CONFIG - bool "Skip clock frequency configuration in system initialization" - help - With this option, the CPU clock frequency is not set during system initialization. - The CPU runs with the default, hardware-selected frequency. - config SOC_NRF54LX_DISABLE_FICR_TRIMCNF bool "Disable trimming of the device" default y if TRUSTED_EXECUTION_NONSECURE From d19d96ca8ba5f9be2a17d138c504017b8b28e3e1 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Wed, 24 Sep 2025 17:31:28 +0200 Subject: [PATCH 0189/3334] [nrf fromtree] drivers: udc: cleanup depends in Kconfig.dwc2 Factor out UDC_DWC2 dependency. Signed-off-by: Johann Fischer (cherry picked from commit 0018e8d6008c2ab3a717c23ea789f03c2f5301df) --- drivers/usb/udc/Kconfig.dwc2 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/udc/Kconfig.dwc2 b/drivers/usb/udc/Kconfig.dwc2 index 1bb0e99fedde..3764aa7a4e2c 100644 --- a/drivers/usb/udc/Kconfig.dwc2 +++ b/drivers/usb/udc/Kconfig.dwc2 @@ -12,23 +12,22 @@ config UDC_DWC2 help DWC2 USB device controller driver. +if UDC_DWC2 + config UDC_DWC2_DMA bool "DWC2 USB DMA support" default y - depends on UDC_DWC2 help Enable Buffer DMA if DWC2 USB controller supports Internal DMA. config UDC_DWC2_HIBERNATION bool "DWC2 USB Hibernation support" default y - depends on UDC_DWC2 help Enable Hibernation if DWC2 USB controller supports hibernation. config UDC_DWC2_PTI bool "DWC2 USB Periodic Transfer Interrupt" - depends on UDC_DWC2 help Ignore frame number when scheduling isochronous endpoints. Use this when isochronous transfers should finish only after receiving token @@ -38,24 +37,23 @@ config UDC_DWC2_PTI config UDC_DWC2_STACK_SIZE int "UDC DWC2 driver internal thread stack size" - depends on UDC_DWC2 default 512 help DWC2 driver internal thread stack size. config UDC_DWC2_THREAD_PRIORITY int "UDC DWC2 driver thread priority" - depends on UDC_DWC2 default 8 help DWC2 driver thread priority. config UDC_DWC2_USBHS_VBUS_READY_TIMEOUT int "UDC DWC2 USBHS VBUS ready event timeout in ms" - depends on UDC_DWC2 depends on NRFS_HAS_VBUS_DETECTOR_SERVICE default 0 help UDC DWC2 USBHS VBUS ready event timeout. If the VBUS is not ready and the Nordic USBHS controller is used, the udc_enable() is blocked for this amount of time. Set it to zero to wait forever. + +endif # UDC_DWC2 From 6c8fb4a4439e6162f4a5b5cf535e67d0e4eda1a6 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Wed, 24 Sep 2025 18:44:46 +0200 Subject: [PATCH 0190/3334] [nrf fromtree] drivers: udc: allow to use timeout Kconfig option on nRF54LM20A SoC Kconfig option UDC_DWC2_USBHS_VBUS_READY_TIMEOUT depends on services exclusively available for nRF54H20, but the option can also be used for nRF54LM20A, where there are no service dependencies, and VREG can be accessed by the driver directly. Let depend the option on the SOC series, as the controller can be used by the different CPUs on the SOC. Signed-off-by: Johann Fischer (cherry picked from commit 4fe2c5bd5fe1d017783eb4b48ca752759a68ca02) --- drivers/usb/udc/Kconfig.dwc2 | 2 +- drivers/usb/udc/udc_dwc2_vendor_quirks.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/udc/Kconfig.dwc2 b/drivers/usb/udc/Kconfig.dwc2 index 3764aa7a4e2c..16350ef568d4 100644 --- a/drivers/usb/udc/Kconfig.dwc2 +++ b/drivers/usb/udc/Kconfig.dwc2 @@ -49,7 +49,7 @@ config UDC_DWC2_THREAD_PRIORITY config UDC_DWC2_USBHS_VBUS_READY_TIMEOUT int "UDC DWC2 USBHS VBUS ready event timeout in ms" - depends on NRFS_HAS_VBUS_DETECTOR_SERVICE + depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX default 0 help UDC DWC2 USBHS VBUS ready event timeout. If the VBUS is not ready diff --git a/drivers/usb/udc/udc_dwc2_vendor_quirks.h b/drivers/usb/udc/udc_dwc2_vendor_quirks.h index 330ff8d113f1..cd25f0ec9d33 100644 --- a/drivers/usb/udc/udc_dwc2_vendor_quirks.h +++ b/drivers/usb/udc/udc_dwc2_vendor_quirks.h @@ -381,6 +381,10 @@ static inline int usbhs_enable_core(const struct device *dev) k_timeout_t timeout = K_FOREVER; int err; + if (CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT) { + timeout = K_MSEC(CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT); + } + if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, K_NO_WAIT)) { LOG_WRN("VBUS is not ready, block udc_enable()"); if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, timeout)) { From 4d5d9775263deec09af3435871885ccf17ea90db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Tue, 30 Sep 2025 10:12:52 +0200 Subject: [PATCH 0191/3334] [nrf fromtree] drivers: usb: udc: Fix VBUS ready timeout dependency in Kconfig.dwc2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow up to commit 4fe2c5bd5fe1d017783eb4b48ca752759a68ca02. The UDC_DWC2_USBHS_VBUS_READY_TIMEOUT Kconfig option should be available also for nRF92 Series SoCs (as it was previously when it depended on NRFS_HAS_VBUS_DETECTOR_SERVICE), otherwise some builds will fail for such targets. Signed-off-by: Andrzej Głąbek (cherry picked from commit 6360c7f67ce3ff5173a15389e63c7b465557a1d2) --- drivers/usb/udc/Kconfig.dwc2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/udc/Kconfig.dwc2 b/drivers/usb/udc/Kconfig.dwc2 index 16350ef568d4..ff3b169e66a5 100644 --- a/drivers/usb/udc/Kconfig.dwc2 +++ b/drivers/usb/udc/Kconfig.dwc2 @@ -49,7 +49,7 @@ config UDC_DWC2_THREAD_PRIORITY config UDC_DWC2_USBHS_VBUS_READY_TIMEOUT int "UDC DWC2 USBHS VBUS ready event timeout in ms" - depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX + depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX || SOC_SERIES_NRF92X default 0 help UDC DWC2 USBHS VBUS ready event timeout. If the VBUS is not ready From 626cee133d613a4357d6ae009d48c486476ec2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 26 Sep 2025 13:07:17 +0200 Subject: [PATCH 0192/3334] [nrf fromtree] drivers: udc_dwc2: Fix memory leak on subsequent bus resets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not queue new buffer after bus reset if there is one already queued. This fixes memory leak on each bus reset if there are no SETUP transfers received between resets. Signed-off-by: Tomasz Moń (cherry picked from commit c18042047711dc090d6a1946ff158a54113b1965) --- drivers/usb/udc/udc_dwc2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 35fb78adecfa..f8b03c372147 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -434,6 +434,11 @@ static void dwc2_ensure_setup_ready(const struct device *dev) } else { struct udc_dwc2_data *const priv = udc_get_private(dev); + if (udc_ep_is_busy(udc_get_ep_cfg(dev, USB_CONTROL_EP_OUT))) { + /* There is already buffer queued */ + return; + } + /* Enable EP0 OUT only if there is no pending EP0 IN transfer * after which the stack has to enable EP0 OUT. */ From 0910452508168f16fda2eb7790f79aae9a0cd4c3 Mon Sep 17 00:00:00 2001 From: Sylvio Alves Date: Tue, 30 Sep 2025 12:14:56 -0300 Subject: [PATCH 0193/3334] [nrf fromtree] udc_dwc2: fix off-by-one in TX FIFO unset check Fix the check in dwc2_unset_dedicated_fifo() that wrongly included the current endpoint when testing for higher FIFOs. This caused false warnings and early returns. Use ~BIT_MASK(ep_idx + 1) to only test FIFOs above the current EP. Signed-off-by: Sylvio Alves (cherry picked from commit 7c1193c81373276d41ffb8293d113a6f33649cfc) --- drivers/usb/udc/udc_dwc2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index f8b03c372147..d279c1ce0284 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -1586,9 +1586,11 @@ static int dwc2_unset_dedicated_fifo(const struct device *dev, *diepctl &= ~USB_DWC2_DEPCTL_TXFNUM_MASK; if (priv->dynfifosizing) { - if (priv->txf_set & ~BIT_MASK(ep_idx)) { - LOG_WRN("Some of the FIFOs higher than %u are set, %lx", - ep_idx, priv->txf_set & ~BIT_MASK(ep_idx)); + uint16_t higher_mask = ~BIT_MASK(ep_idx + 1); + + if (priv->txf_set & higher_mask) { + LOG_WRN("Some of the FIFOs higher than %u are set, %x", + ep_idx, priv->txf_set & higher_mask); return 0; } From 0c47b6fcd991557ab2eb518d39b17622205de6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 22 Oct 2025 09:30:07 +0200 Subject: [PATCH 0194/3334] [nrf fromtree] drivers: udc_dwc2: Fix deactivate when hibernated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is possible for usbd_disable() to be called when the core is hibernated. When done so, the USB stack will attempt to deactivate all the endpoints. Because the core is hibernated, register reads are really undefined. This can lead to udc_dwc2_ep_deactivate() not calling udc_dwc2_ep_disable() which will leave struct udc_ep_config busy flag set. When endpoint 0x00 busy flag is left to true, the driver won't allocate buffer to receive SETUP data which is mandatory in Buffer DMA mode. This leads to essentially dead device after reconnect, because the device will not respond to any control transfers. Solve the issue by modifying backup register value instead of real one when endpoint is deactivated while core is hibernated. Signed-off-by: Tomasz Moń (cherry picked from commit 35620e20a91efb3284716698f2fa794d02ec6b97) --- drivers/usb/udc/udc_dwc2.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index d279c1ce0284..eb7368e1178f 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -1730,7 +1730,19 @@ static int udc_dwc2_ep_deactivate(const struct device *dev, mem_addr_t dxepctl_reg; uint32_t dxepctl; - dxepctl_reg = dwc2_get_dxepctl_reg(dev, cfg->addr); + if (priv->hibernated) { + /* If usbd_disable() is called when core is hibernated, modify + * backup registers instead of real ones. + */ + if (USB_EP_DIR_IS_OUT(cfg->addr)) { + dxepctl_reg = (mem_addr_t)&priv->backup.doepctl[ep_idx]; + } else { + dxepctl_reg = (mem_addr_t)&priv->backup.diepctl[ep_idx]; + } + } else { + dxepctl_reg = dwc2_get_dxepctl_reg(dev, cfg->addr); + } + dxepctl = sys_read32(dxepctl_reg); if (dxepctl & USB_DWC2_DEPCTL_USBACTEP) { From 308c9ffc4e0045cddcb4240f2c0ef234d36e2247 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Wed, 13 Aug 2025 22:47:25 +0200 Subject: [PATCH 0195/3334] [nrf fromtree] usb: device_next: fail on initialization if no HID device is registered Do not register the device when the class instance has already been initialised. Fail on initialization if no HID device is registered. Signed-off-by: Johann Fischer (cherry picked from commit c62575e7bf7a5152ed1ae2b1053658724d290462) --- subsys/usb/device_next/class/usbd_hid.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/subsys/usb/device_next/class/usbd_hid.c b/subsys/usb/device_next/class/usbd_hid.c index d978aea0d27c..212b409e9570 100644 --- a/subsys/usb/device_next/class/usbd_hid.c +++ b/subsys/usb/device_next/class/usbd_hid.c @@ -57,6 +57,7 @@ struct usbd_hid_descriptor { }; enum { + HID_DEV_CLASS_INITIALIZED, HID_DEV_CLASS_ENABLED, }; @@ -503,7 +504,14 @@ static int usbd_hid_init(struct usbd_class_data *const c_data) const struct device *dev = usbd_class_get_private(c_data); const struct hid_device_config *dcfg = dev->config; struct usbd_hid_descriptor *const desc = dcfg->desc; + struct hid_device_data *const ddata = dev->data; + + if (ddata->ops == NULL || ddata->rdesc == NULL || !ddata->rsize) { + LOG_ERR("HID device does not seem to be registered"); + return -EINVAL; + } + atomic_set_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED); LOG_DBG("HID class %s init", c_data->name); if (dcfg->if_desc_data != NULL && desc->if0.iInterface == 0) { @@ -519,6 +527,10 @@ static int usbd_hid_init(struct usbd_class_data *const c_data) static void usbd_hid_shutdown(struct usbd_class_data *const c_data) { + const struct device *dev = usbd_class_get_private(c_data); + struct hid_device_data *const ddata = dev->data; + + atomic_clear_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED); LOG_DBG("HID class %s shutdown", c_data->name); } @@ -628,7 +640,7 @@ static int hid_dev_register(const struct device *dev, struct hid_device_data *const ddata = dev->data; struct usbd_hid_descriptor *const desc = dcfg->desc; - if (atomic_test_bit(&ddata->state, HID_DEV_CLASS_ENABLED)) { + if (atomic_test_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED)) { return -EALREADY; } From a21b9a01210e5b6991a0dba581d8ccbce0ba444f Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Thu, 14 Aug 2025 22:49:30 +0200 Subject: [PATCH 0196/3334] [nrf fromtree] usb: device_next: hid: allow to set polling period at runtime Allow to set input or output report polling period at runtime. Signed-off-by: Johann Fischer (cherry picked from commit bca0ce087094948c7e59006cb1291f51462df9fa) --- include/zephyr/usb/class/usbd_hid.h | 32 +++++++++++ subsys/usb/device_next/class/Kconfig.hid | 5 ++ subsys/usb/device_next/class/usbd_hid.c | 54 +++++++++++++++++++ subsys/usb/device_next/class/usbd_hid_api.c | 22 ++++++++ .../usb/device_next/class/usbd_hid_internal.h | 2 + 5 files changed, 115 insertions(+) diff --git a/include/zephyr/usb/class/usbd_hid.h b/include/zephyr/usb/class/usbd_hid.h index 5539369d5b05..79b52dd8fd9d 100644 --- a/include/zephyr/usb/class/usbd_hid.h +++ b/include/zephyr/usb/class/usbd_hid.h @@ -212,6 +212,38 @@ int hid_device_register(const struct device *dev, int hid_device_submit_report(const struct device *dev, const uint16_t size, const uint8_t *const report); +/** + * @brief Set input report polling period + * + * Similar to devicetree property in-polling-period-us, but it allows setting + * different polling periods at runtime. + * + * @kconfig_dep{CONFIG_USBD_HID_SET_POLLING_PERIOD} + * + * @param[in] dev Pointer to HID device + * @param[in] period_us Polling period in microseconds + * + * @return 0 on success, negative errno code on failure. + * @retval -ENOTSUP If API is not enabled. + */ +int hid_device_set_in_polling(const struct device *dev, const unsigned int period_us); + +/** + * @brief Set output report polling period + * + * Similar to devicetree property out-polling-period-us, but it allows setting + * different polling periods at runtime. + * + * @kconfig_dep{CONFIG_USBD_HID_SET_POLLING_PERIOD} + * + * @param[in] dev Pointer to HID device + * @param[in] period_us Polling period in microseconds + * + * @return 0 on success, negative errno code on failure. + * @retval -ENOTSUP If API is not enabled. + */ +int hid_device_set_out_polling(const struct device *dev, const unsigned int period_us); + /** * @} */ diff --git a/subsys/usb/device_next/class/Kconfig.hid b/subsys/usb/device_next/class/Kconfig.hid index 8e3133a1dde8..a6f2980ec3ab 100644 --- a/subsys/usb/device_next/class/Kconfig.hid +++ b/subsys/usb/device_next/class/Kconfig.hid @@ -30,6 +30,11 @@ config USBD_HID_INIT_PRIORITY help HID device initialization priority +config USBD_HID_SET_POLLING_PERIOD + bool "Allow to set polling period at runtime" + help + Allow to set input or output report polling period at runtime. + module = USBD_HID module-str = usbd hid source "subsys/logging/Kconfig.template.log_config" diff --git a/subsys/usb/device_next/class/usbd_hid.c b/subsys/usb/device_next/class/usbd_hid.c index 212b409e9570..2ea3a08db763 100644 --- a/subsys/usb/device_next/class/usbd_hid.c +++ b/subsys/usb/device_next/class/usbd_hid.c @@ -632,6 +632,56 @@ static int hid_dev_submit_report(const struct device *dev, return 0; } +static inline int hid_dev_set_out_polling(const struct device *dev, + const unsigned int period_us) +{ + const struct hid_device_config *const dcfg = dev->config; + struct hid_device_data *const ddata = dev->data; + struct usbd_hid_descriptor *const desc = dcfg->desc; + + if (atomic_test_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED)) { + return -EBUSY; + } + + if (USBD_SUPPORTS_HIGH_SPEED) { + if (desc->hs_out_ep.bLength == 0) { + /* This device does not have output reports. */ + return -ENOTSUP; + } + + desc->hs_out_ep.bInterval = USB_HS_INT_EP_INTERVAL(period_us); + } + + if (desc->out_ep.bLength == 0) { + /* This device does not have output reports. */ + return -ENOTSUP; + } + + desc->out_ep.bInterval = USB_FS_INT_EP_INTERVAL(period_us); + + return 0; +} + +static inline int hid_dev_set_in_polling(const struct device *dev, + const unsigned int period_us) +{ + const struct hid_device_config *const dcfg = dev->config; + struct hid_device_data *const ddata = dev->data; + struct usbd_hid_descriptor *const desc = dcfg->desc; + + if (atomic_test_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED)) { + return -EBUSY; + } + + if (USBD_SUPPORTS_HIGH_SPEED) { + desc->hs_in_ep.bInterval = USB_HS_INT_EP_INTERVAL(period_us); + } + + desc->in_ep.bInterval = USB_FS_INT_EP_INTERVAL(period_us); + + return 0; +} + static int hid_dev_register(const struct device *dev, const uint8_t *const rdesc, const uint16_t rsize, const struct hid_device_ops *const ops) @@ -706,6 +756,10 @@ struct usbd_class_api usbd_hid_api = { static const struct hid_device_driver_api hid_device_api = { .submit_report = hid_dev_submit_report, .dev_register = hid_dev_register, +#if CONFIG_USBD_HID_SET_POLLING_PERIOD + .set_out_polling = hid_dev_set_out_polling, + .set_in_polling = hid_dev_set_in_polling, +#endif }; #include "usbd_hid_macros.h" diff --git a/subsys/usb/device_next/class/usbd_hid_api.c b/subsys/usb/device_next/class/usbd_hid_api.c index f2efa4e3cb1e..fd9f27a23ba9 100644 --- a/subsys/usb/device_next/class/usbd_hid_api.c +++ b/subsys/usb/device_next/class/usbd_hid_api.c @@ -34,6 +34,28 @@ int hid_device_register(const struct device *dev, return api->dev_register(dev, rdesc, rsize, ops); } +int hid_device_set_in_polling(const struct device *dev, const unsigned int period_us) +{ + const struct hid_device_driver_api *const api = dev->api; + + if (IS_ENABLED(CONFIG_USBD_HID_SET_POLLING_PERIOD)) { + return api->set_in_polling(dev, period_us); + } + + return -ENOTSUP; +} + +int hid_device_set_out_polling(const struct device *dev, const unsigned int period_us) +{ + const struct hid_device_driver_api *const api = dev->api; + + if (IS_ENABLED(CONFIG_USBD_HID_SET_POLLING_PERIOD)) { + return api->set_out_polling(dev, period_us); + } + + return -ENOTSUP; +} + /* Legacy HID API wrapper below */ struct legacy_wrapper { diff --git a/subsys/usb/device_next/class/usbd_hid_internal.h b/subsys/usb/device_next/class/usbd_hid_internal.h index d049b0c22a35..dcb747486279 100644 --- a/subsys/usb/device_next/class/usbd_hid_internal.h +++ b/subsys/usb/device_next/class/usbd_hid_internal.h @@ -20,4 +20,6 @@ struct hid_device_driver_api { int (*dev_register)(const struct device *dev, const uint8_t *const rdesc, const uint16_t rsize, const struct hid_device_ops *const ops); + int (*set_in_polling)(const struct device *dev, const unsigned int period_us); + int (*set_out_polling)(const struct device *dev, const unsigned int period_us); }; From 5467b653132bf6eae9f7151249ff2e64e8ead4bf Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Thu, 14 Aug 2025 22:54:30 +0200 Subject: [PATCH 0197/3334] [nrf fromtree] samples: usb: hid-keyboard: allow to set polling period at runtime Add an example of how to set the polling period at runtime. Signed-off-by: Johann Fischer (cherry picked from commit e295a387b963533d0047efa6c92cd6595697e197) --- samples/subsys/usb/hid-keyboard/sample.yaml | 2 ++ samples/subsys/usb/hid-keyboard/src/main.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/samples/subsys/usb/hid-keyboard/sample.yaml b/samples/subsys/usb/hid-keyboard/sample.yaml index f53ae514f97c..2998f84807d2 100644 --- a/samples/subsys/usb/hid-keyboard/sample.yaml +++ b/samples/subsys/usb/hid-keyboard/sample.yaml @@ -33,3 +33,5 @@ tests: sample.usbd.hid-keyboard.large-out-report: extra_args: - EXTRA_DTC_OVERLAY_FILE="large_out_report.overlay" + extra_configs: + - CONFIG_USBD_HID_SET_POLLING_PERIOD=y diff --git a/samples/subsys/usb/hid-keyboard/src/main.c b/samples/subsys/usb/hid-keyboard/src/main.c index 45580c95a845..39ce8836ff6a 100644 --- a/samples/subsys/usb/hid-keyboard/src/main.c +++ b/samples/subsys/usb/hid-keyboard/src/main.c @@ -206,6 +206,18 @@ int main(void) return ret; } + if (IS_ENABLED(CONFIG_USBD_HID_SET_POLLING_PERIOD)) { + ret = hid_device_set_in_polling(hid_dev, 1000); + if (ret) { + LOG_WRN("Failed to set IN report polling period, %d", ret); + } + + ret = hid_device_set_out_polling(hid_dev, 1000); + if (ret != 0 && ret != -ENOTSUP) { + LOG_WRN("Failed to set OUT report polling period, %d", ret); + } + } + sample_usbd = sample_usbd_init_device(msg_cb); if (sample_usbd == NULL) { LOG_ERR("Failed to initialize USB device"); From 6cdc189affd8463e2fafe28fdd628baf9820b9f3 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Mon, 22 Sep 2025 14:48:09 +0200 Subject: [PATCH 0198/3334] [nrf fromtree] Bluetooth: Controller: Fix inter-operability when BT_PHY_UPDATE=n Fix inter-operability, when BT_PHY_UPDATE=n the feature bits contained 2M and Coded PHY when Advertising Extensions where enabled, and Central devices did not progress with any data packet transfers when PHY_REQ was rejected as unknown PDU. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 15d3b57e903abe984e29e1920093592d8f211f60) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/include/ll_feat.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subsys/bluetooth/controller/include/ll_feat.h b/subsys/bluetooth/controller/include/ll_feat.h index 946441720769..9e5cd3144b7a 100644 --- a/subsys/bluetooth/controller/include/ll_feat.h +++ b/subsys/bluetooth/controller/include/ll_feat.h @@ -63,11 +63,11 @@ #define LL_FEAT_BIT_EXT_SCAN 0 #endif /* !CONFIG_BT_CTLR_EXT_SCAN_FP */ -#if defined(CONFIG_BT_CTLR_PHY_2M) +#if defined(CONFIG_BT_CTLR_PHY) && defined(CONFIG_BT_CTLR_PHY_2M) #define LL_FEAT_BIT_PHY_2M BIT64(BT_LE_FEAT_BIT_PHY_2M) -#else /* !CONFIG_BT_CTLR_PHY_2M */ +#else /* !CONFIG_BT_CTLR_PHY || !CONFIG_BT_CTLR_PHY_2M */ #define LL_FEAT_BIT_PHY_2M 0 -#endif /* !CONFIG_BT_CTLR_PHY_2M */ +#endif /* !CONFIG_BT_CTLR_PHY || !CONFIG_BT_CTLR_PHY_2M */ #if defined(CONFIG_BT_CTLR_SMI_TX) #if defined(CONFIG_BT_CTLR_SMI_TX_SETTING) @@ -86,11 +86,11 @@ #define LL_FEAT_BIT_SMI_RX 0 #endif /* !CONFIG_BT_CTLR_SMI_RX */ -#if defined(CONFIG_BT_CTLR_PHY_CODED) +#if defined(CONFIG_BT_CTLR_PHY) && defined(CONFIG_BT_CTLR_PHY_CODED) #define LL_FEAT_BIT_PHY_CODED BIT64(BT_LE_FEAT_BIT_PHY_CODED) -#else /* !CONFIG_BT_CTLR_PHY_CODED */ +#else /* !CONFIG_BT_CTLR_PHY || !CONFIG_BT_CTLR_PHY_CODED */ #define LL_FEAT_BIT_PHY_CODED 0 -#endif /* !CONFIG_BT_CTLR_PHY_CODED */ +#endif /* !CONFIG_BT_CTLR_PHY || !CONFIG_BT_CTLR_PHY_CODED */ #if defined(CONFIG_BT_CTLR_ADV_EXT) #define LL_FEAT_BIT_EXT_ADV BIT64(BT_LE_FEAT_BIT_EXT_ADV) From 39262b9a841a91e7f2a37022b2fba74ab3e4b56c Mon Sep 17 00:00:00 2001 From: Loic Domaigne Date: Thu, 25 Sep 2025 17:26:41 +0200 Subject: [PATCH 0199/3334] [nrf fromtree] Bluetooth: Controller: fix assertion check for ptc value Fix the issue reported by Coverity CID 487708. The LL_ASSERT was performed on lll->ptc, which is a 4-bit bitfield and therefore always succeeds. Instead, the computation (lll->nse - nse) should be checked to ensure it falls within the 4-bit value range before assigning it to lll->ptc. Signed-off-by: Loic Domaigne (cherry picked from commit bfbc6365acfe3346f3f248d2953ebf9e5f9fe21a) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/ull_sync_iso.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c index b3737c8fc4a0..65cd09f602fd 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c @@ -489,20 +489,22 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, lll->irc = PDU_BIG_INFO_IRC_GET(bi); if (lll->pto) { uint8_t nse; + uint8_t ptc; nse = lll->irc * lll->bn; /* 4 bits * 3 bits, total 7 bits */ if (nse >= lll->nse) { return; } - lll->ptc = lll->nse - nse; + ptc = lll->nse - nse; /* FIXME: Do not remember why ptc is 4 bits, it should be 5 bits as ptc is a * running buffer offset related to nse. * Fix ptc and ptc_curr definitions, until then we keep an assertion check * here. */ - LL_ASSERT(lll->ptc <= BIT_MASK(4)); + LL_ASSERT(ptc <= BIT_MASK(4)); + lll->ptc = ptc; } else { lll->ptc = 0U; } From f5c2c5cc6793dc41de0209088bbc2b762ba378f4 Mon Sep 17 00:00:00 2001 From: Ashirwad Paswan Date: Mon, 29 Sep 2025 13:16:22 +0530 Subject: [PATCH 0200/3334] [nrf fromtree] Bluetooth: Controller: Fix missing null pointer check Added a check for null pointer in ull_sync_iso.c file to avoid potential crashes. Fixes: #81997 Signed-off-by: Ashirwad Paswan (cherry picked from commit 21da2d056ddbb0627a17588b57aca92e2775c545) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/ull_sync_iso.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c index 65cd09f602fd..222191bde22c 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c @@ -586,6 +586,8 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, lll->window_size_event_us; /* Skip to first selected BIS subevent */ stream = ull_sync_iso_stream_get(lll->stream_handle[0]); + LL_ASSERT(stream); + if (lll->bis_spacing >= (lll->sub_interval * lll->nse)) { sync_iso_offset_us += (stream->bis_index - 1U) * lll->sub_interval * From 8f55652953dc21fcdb30db4f39ec143c8148a89b Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sun, 5 Oct 2025 12:58:05 +1000 Subject: [PATCH 0201/3334] [nrf fromtree] bluetooth: controller: ll_sw: nordic: constant latency req When `CONFIG_NRF_SYS_EVENT` is enabled, route constant latency requests through the reference counted API. Signed-off-by: Jordan Yates (cherry picked from commit 1f3ce818fc4bc07e3f5f51f6d47d71b4a5b6f0d3) Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/hal/nrf5/radio/radio.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 90a0945f5a19..0199326ed3ce 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 @@ -10,6 +10,7 @@ #include #include +#include #include #include "util/mem.h" @@ -221,7 +222,11 @@ void radio_reset(void) RADIO_TIMING_RU_Msk; #endif /* !CONFIG_BT_CTLR_TIFS_HW */ +#if defined(CONFIG_NRF_SYS_EVENT) + (void)nrf_sys_event_request_global_constlat(); +#else /* !CONFIG_NRF_SYS_EVENT */ NRF_POWER->TASKS_CONSTLAT = 1U; +#endif /* !CONFIG_NRF_SYS_EVENT */ #endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) @@ -1788,7 +1793,11 @@ void radio_tmr_stop(void) #endif /* !CONFIG_BT_CTLR_TIFS_HW */ #if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_NRF_SYS_EVENT) + (void)nrf_sys_event_release_global_constlat(); +#else /* !CONFIG_NRF_SYS_EVENT */ NRF_POWER->TASKS_LOWPWR = 1U; +#endif /* !CONFIG_NRF_SYS_EVENT */ #endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ } From d79ba9db5832568def13b8d9b4497dfdc541d72a Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 2 Oct 2025 15:36:40 +0200 Subject: [PATCH 0202/3334] [nrf fromtree] Bluetooth: Controller: Fix return types for ll_length ll_length_req_send and ll_length_default_set were defined to return a uint32_t, but only returned a uint8_t HCI error code and was the return value was always stored as such. Signed-off-by: Emil Gydesen (cherry picked from commit 4b9bc7d11b2e0414e3a11d0da0fb40795f7aed35) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/include/ll.h | 4 ++-- subsys/bluetooth/controller/ll_sw/ull_conn.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/controller/include/ll.h b/subsys/bluetooth/controller/include/ll.h index 378686064e15..9d08436da8c4 100644 --- a/subsys/bluetooth/controller/include/ll.h +++ b/subsys/bluetooth/controller/include/ll.h @@ -267,10 +267,10 @@ uint8_t ll_tx_pwr_lvl_set(uint8_t handle_type, uint16_t handle, uint8_t ll_apto_get(uint16_t handle, uint16_t *const apto); uint8_t ll_apto_set(uint16_t handle, uint16_t apto); -uint32_t ll_length_req_send(uint16_t handle, uint16_t tx_octets, uint16_t tx_time); +uint8_t ll_length_req_send(uint16_t handle, uint16_t tx_octets, uint16_t tx_time); void ll_length_default_get(uint16_t *const max_tx_octets, uint16_t *const max_tx_time); -uint32_t ll_length_default_set(uint16_t max_tx_octets, uint16_t max_tx_time); +uint8_t ll_length_default_set(uint16_t max_tx_octets, uint16_t max_tx_time); void ll_length_max_get(uint16_t *const max_tx_octets, uint16_t *const max_tx_time, uint16_t *const max_rx_octets, diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index b68eaea19589..e76b3e7147e9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -562,8 +562,7 @@ static bool ll_len_validate(uint16_t tx_octets, uint16_t tx_time) return true; } -uint32_t ll_length_req_send(uint16_t handle, uint16_t tx_octets, - uint16_t tx_time) +uint8_t ll_length_req_send(uint16_t handle, uint16_t tx_octets, uint16_t tx_time) { struct ll_conn *conn; @@ -601,7 +600,7 @@ void ll_length_default_get(uint16_t *max_tx_octets, uint16_t *max_tx_time) *max_tx_time = default_tx_time; } -uint32_t ll_length_default_set(uint16_t max_tx_octets, uint16_t max_tx_time) +uint8_t ll_length_default_set(uint16_t max_tx_octets, uint16_t max_tx_time) { if (IS_ENABLED(CONFIG_BT_CTLR_PARAM_CHECK) && !ll_len_validate(max_tx_octets, max_tx_time)) { From 0b19ef9debf1693cbd422680ba4df72a432b05c4 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 27 Sep 2025 16:25:06 +0200 Subject: [PATCH 0203/3334] [nrf fromtree] Bluetooth: Controller: Fix single switch timer use in ISO Sync Fix implementation of Broadcast ISO Synchronized Receiver using single switch timer to consider minimum compare value requirement. This fix reduces latencies to setup radio receptions and fixes an assertion in lll_sync_iso when radio_tmr_start_us() is checked for latencies. Relates to commit 5dfc58cff9c3 ("Bluetooth: Controller: Fix single switch timer minimum compare value"). Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 8eae0bfbd09e6b288baf446dfc1bcf2d0999d3aa) Signed-off-by: Vinayak Kariappa Chettimada --- .../ll_sw/nordic/lll/lll_sync_iso.c | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index 4f4dad90754f..2083d8d7780a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -1352,22 +1352,25 @@ static void isr_rx(void *param) hcto -= addr_us_get(lll->phy); hcto -= radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); - overhead_us = radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); - overhead_us += addr_us_get(lll->phy); - overhead_us += radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); + /* Overhead within EVENT_IFS_US to exclude from max. jitter */ + /* Required radio ready duration, settling time */ + overhead_us = radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); + /* If single timer used, then consider required max. latency */ + overhead_us += HAL_RADIO_ISR_LATENCY_MAX_US; + /* Add chain delay overhead */ + overhead_us += radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); + /* Add base clock jitter overhead */ overhead_us += (EVENT_CLOCK_JITTER_US << 1); - LL_ASSERT(EVENT_IFS_US > overhead_us); + /* Max. available clock jitter */ jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1; + /* Max. clock jitter per subevent */ jitter_max_us = (jitter_max_us * nse) / (lll->num_bis * lll->nse); - overhead_us = HAL_RADIO_TMR_START_DELAY_US; - if (jitter_max_us > overhead_us) { - jitter_max_us -= overhead_us; - } else { - jitter_max_us = 0U; - } + /* Min. clock jitter we shall use */ + jitter_max_us = MAX(jitter_max_us, (EVENT_CLOCK_JITTER_US << 1)); + /* Jitter for current subevent */ jitter_us = (EVENT_CLOCK_JITTER_US << 1) * nse; if (jitter_us > jitter_max_us) { jitter_us = jitter_max_us; From 4b3169c21c11359b0449c97377a50977cf1b1d8c Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 10 Sep 2025 19:40:32 +0200 Subject: [PATCH 0204/3334] [nrf fromtree] Bluetooth: Controller: Cosmetic changes to Link Layer interface Cosmetic changes to the Link Layer interface header file. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 7fd5dea9ccbbf8c5eed6b433e88d55428e41ecf7) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/include/ll.h | 149 ++++++++++-------- .../controller/include/ll_settings.h | 24 +-- 2 files changed, 101 insertions(+), 72 deletions(-) diff --git a/subsys/bluetooth/controller/include/ll.h b/subsys/bluetooth/controller/include/ll.h index 9d08436da8c4..f807842e6c34 100644 --- a/subsys/bluetooth/controller/include/ll.h +++ b/subsys/bluetooth/controller/include/ll.h @@ -1,63 +1,39 @@ /* - * Copyright (c) 2016-2021 Nordic Semiconductor ASA + * Copyright (c) 2016-2025 Nordic Semiconductor ASA * Copyright (c) 2016 Vinayak Kariappa Chettimada * * SPDX-License-Identifier: Apache-2.0 */ +#if defined(CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING) +#define LL_ADV_HANDLE_MAPPING +#else /* !CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING */ +#define LL_ADV_HANDLE_MAPPING static __attribute__((always_inline)) inline +#endif /* !CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING */ + +/* Initialization and Reset Interfaces */ int ll_init(struct k_sem *sem_rx); int ll_deinit(void); void ll_reset(void); +/* Features Interfaces */ uint8_t ll_set_host_feature(uint8_t bit_number, uint8_t bit_value); uint64_t ll_feat_get(void); +/* Device Address Interfaces */ uint8_t ll_addr_set(uint8_t addr_type, uint8_t const *const p_bdaddr); uint8_t *ll_addr_get(uint8_t addr_type); uint8_t *ll_addr_read(uint8_t addr_type, uint8_t *const bdaddr); -#if defined(CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING) -uint8_t ll_adv_set_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle); -uint8_t ll_adv_set_by_hci_handle_get_or_new(uint8_t hci_handle, - uint8_t *handle); -uint8_t ll_adv_set_hci_handle_get(uint8_t handle); -uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle); -uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, uint8_t *handle); -#else -static inline uint8_t ll_adv_set_by_hci_handle_get(uint8_t hci_handle, - uint8_t *handle) -{ - *handle = hci_handle; - return 0; -} - -static inline uint8_t ll_adv_set_by_hci_handle_get_or_new(uint8_t hci_handle, - uint8_t *handle) -{ - *handle = hci_handle; - return 0; -} - -static inline uint8_t ll_adv_set_hci_handle_get(uint8_t handle) -{ - return handle; -} - -static inline uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, - uint8_t *handle) -{ - *handle = hci_handle; - return 0; -} - -static inline uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, - uint8_t *handle) -{ - *handle = hci_handle; - return 0; -} -#endif +/* Advertising Handles Interfaces */ +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle); +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_by_hci_handle_get_or_new(uint8_t hci_handle, + uint8_t *handle); +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_hci_handle_get(uint8_t handle); +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle); +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, uint8_t *handle); +/* Advertising State Interfaces */ #if defined(CONFIG_BT_CTLR_ADV_EXT) uint8_t ll_adv_params_set(uint8_t handle, uint16_t evt_prop, uint32_t interval, uint8_t adv_type, uint8_t own_addr_type, @@ -78,6 +54,7 @@ uint8_t ll_adv_data_set(uint8_t len, uint8_t const *const p_data); uint8_t ll_adv_scan_rsp_set(uint8_t len, uint8_t const *const p_data); #endif /* !CONFIG_BT_CTLR_ADV_EXT */ +/* Extended Advertising State Interfaces */ uint8_t ll_adv_aux_random_addr_set(uint8_t handle, uint8_t const *const addr); uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, uint8_t len, uint8_t const *const data); @@ -87,12 +64,15 @@ uint16_t ll_adv_aux_max_data_length_get(void); uint8_t ll_adv_aux_set_count_get(void); uint8_t ll_adv_aux_set_remove(uint8_t handle); uint8_t ll_adv_aux_set_clear(void); + +/* Periodic Advertising State Interfaces */ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags); uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, uint8_t const *const data); uint8_t ll_adv_sync_enable(uint8_t handle, uint8_t enable); +/* Advertising Enable and Disable Interfaces */ #if defined(CONFIG_BT_CTLR_ADV_EXT) || defined(CONFIG_BT_HCI_MESH_EXT) #if defined(CONFIG_BT_HCI_MESH_EXT) uint8_t ll_adv_enable(uint8_t handle, uint8_t enable, @@ -108,6 +88,7 @@ uint8_t ll_adv_enable(uint8_t enable); uint8_t ll_adv_disable_all(void); +/* Broadcast ISO State Interfaces */ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_latency, uint8_t rtn, uint8_t phy, @@ -121,6 +102,7 @@ uint8_t ll_big_test_create(uint8_t big_handle, uint8_t adv_handle, uint8_t pto, uint8_t encryption, uint8_t *bcode); uint8_t ll_big_terminate(uint8_t big_handle, uint8_t reason); +/* Scanning State Interfaces */ uint8_t ll_scan_params_set(uint8_t type, uint16_t interval, uint16_t window, uint8_t own_addr_type, uint8_t filter_policy); #if defined(CONFIG_BT_CTLR_ADV_EXT) @@ -129,24 +111,30 @@ uint8_t ll_scan_enable(uint8_t enable, uint16_t duration, uint16_t period); uint8_t ll_scan_enable(uint8_t enable); #endif /* !CONFIG_BT_CTLR_ADV_EXT */ +/* Periodic Advertising Sync State Interfaces */ uint8_t ll_sync_create(uint8_t options, uint8_t sid, uint8_t adv_addr_type, uint8_t *adv_addr, uint16_t skip, uint16_t sync_timeout, uint8_t sync_cte_type); uint8_t ll_sync_create_cancel(void **rx); uint8_t ll_sync_terminate(uint16_t handle); uint8_t ll_sync_recv_enable(uint16_t handle, uint8_t enable); + +/* Periodic Advertising Sync Transfer Interfaces */ uint8_t ll_sync_transfer(uint16_t conn_handle, uint16_t service_data, uint16_t sync_handle); uint8_t ll_adv_sync_set_info_transfer(uint16_t conn_handle, uint16_t service_data, uint8_t adv_handle); uint8_t ll_past_param(uint16_t conn_handle, uint8_t mode, uint16_t skip, uint16_t timeout, uint8_t cte_type); uint8_t ll_default_past_param(uint8_t mode, uint16_t skip, uint16_t timeout, uint8_t cte_type); + +/* Broadcast ISO Sync Receiver State Interfaces */ uint8_t ll_big_sync_create(uint8_t big_handle, uint16_t sync_handle, uint8_t encryption, uint8_t *bcode, uint8_t mse, uint16_t sync_timeout, uint8_t num_bis, uint8_t *bis); uint8_t ll_big_sync_terminate(uint8_t big_handle, void **rx); +/* Connected ISO State Interfaces */ uint8_t ll_cig_parameters_open(uint8_t cig_id, uint32_t c_interval, uint32_t p_interval, uint8_t sca, uint8_t packing, uint8_t framing, @@ -172,6 +160,15 @@ uint8_t ll_cis_parameters_test_set(uint8_t cis_id, uint8_t nse, uint16_t c_pdu, uint16_t p_pdu, uint8_t c_phy, uint8_t p_phy, uint8_t c_bn, uint8_t p_bn); +uint8_t ll_cig_remove(uint8_t cig_id); +uint8_t ll_cis_create_check(uint16_t cis_handle, uint16_t acl_handle); +void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle); +uint8_t ll_cis_accept(uint16_t handle); +uint8_t ll_cis_reject(uint16_t handle, uint8_t reason); +uint8_t ll_conn_iso_accept_timeout_get(uint16_t *timeout); +uint8_t ll_conn_iso_accept_timeout_set(uint16_t timeout); + +/* ISO SDU data Interfaces */ /* Must be implemented by vendor if vendor-specific data path is supported */ uint8_t ll_configure_data_path(uint8_t data_path_dir, uint8_t data_path_id, @@ -200,24 +197,19 @@ uint8_t ll_iso_read_test_counters(uint16_t handle, uint32_t *received_cnt, uint32_t *missed_cnt, uint32_t *failed_cnt); -uint8_t ll_cig_remove(uint8_t cig_id); - -uint8_t ll_cis_create_check(uint16_t cis_handle, uint16_t acl_handle); -void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle); - -uint8_t ll_cis_accept(uint16_t handle); -uint8_t ll_cis_reject(uint16_t handle, uint8_t reason); - +/* Filter Accept List Interfaces */ uint8_t ll_fal_size_get(void); uint8_t ll_fal_clear(void); uint8_t ll_fal_add(bt_addr_le_t *addr); uint8_t ll_fal_remove(bt_addr_le_t *addr); +/* Privacy Accept List Interfaces */ uint8_t ll_pal_size_get(void); uint8_t ll_pal_clear(void); uint8_t ll_pal_add(const bt_addr_le_t *const addr, const uint8_t sid); uint8_t ll_pal_remove(const bt_addr_le_t *const addr, const uint8_t sid); +/* Private Resolvable Address Resolution Interfaces */ void ll_rl_id_addr_get(uint8_t rl_idx, uint8_t *id_addr_type, uint8_t *id_addr); uint8_t ll_rl_size_get(void); uint8_t ll_rl_clear(void); @@ -231,6 +223,7 @@ uint8_t ll_rl_enable(uint8_t enable); void ll_rl_timeout_set(uint16_t timeout); uint8_t ll_priv_mode_set(bt_addr_le_t *id_addr, uint8_t mode); +/* Connection State Interfaces */ #if defined(CONFIG_BT_CTLR_ADV_EXT) uint8_t ll_create_connection(uint16_t scan_interval, uint16_t scan_window, uint8_t filter_policy, uint8_t peer_addr_type, @@ -283,7 +276,7 @@ uint8_t ll_phy_req_send(uint16_t handle, uint8_t tx, uint8_t flags, uint8_t rx); uint8_t ll_set_min_used_chans(uint16_t handle, uint8_t const phys, uint8_t const min_used_chans); -/* Direction Finding */ +/* Direction Finding Interfaces */ /* Sets CTE transmission parameters for periodic advertising */ uint8_t ll_df_set_cl_cte_tx_params(uint8_t adv_handle, uint8_t cte_len, uint8_t cte_type, uint8_t cte_count, @@ -316,12 +309,21 @@ void ll_df_read_ant_inf(uint8_t *switch_sample_rates, uint8_t *max_switch_pattern_len, uint8_t *max_cte_len); -/* Downstream - Data */ +/* Path Loss Monitoring Interfaces */ +uint8_t ll_conn_set_path_loss_parameters(uint16_t handle, + uint8_t high_threshold, + uint8_t high_hysteresis, + uint8_t low_threshold, + uint8_t low_hysteresis, + uint16_t min_time_spent); +uint8_t ll_conn_set_path_loss_reporting(uint16_t handle, uint8_t enable); + +/* Downstream - ACL Data */ void *ll_tx_mem_acquire(void); void ll_tx_mem_release(void *node_tx); int ll_tx_mem_enqueue(uint16_t handle, void *node_tx); -/* Upstream - Num. Completes, Events and Data */ +/* Upstream - Num. Completes, Events, ACL and ISO Data */ uint8_t ll_rx_get(void **node_rx, uint16_t *handle); void ll_rx_dequeue(void); void ll_rx_mem_release(void **node_rx); @@ -333,9 +335,6 @@ void ll_iso_tx_mem_release(void *tx); int ll_iso_tx_mem_enqueue(uint16_t handle, void *tx, void *link); void ll_iso_link_tx_release(void *link); -uint8_t ll_conn_iso_accept_timeout_get(uint16_t *timeout); -uint8_t ll_conn_iso_accept_timeout_set(uint16_t timeout); - /* External co-operation */ void ll_timeslice_ticker_id_get(uint8_t * const instance_index, uint8_t * const ticker_id); @@ -344,11 +343,35 @@ void ll_coex_ticker_id_get(uint8_t * const instance_index, void ll_radio_state_abort(void); uint32_t ll_radio_state_is_idle(void); -uint8_t ll_conn_set_path_loss_parameters(uint16_t handle, - uint8_t high_threshold, - uint8_t high_hysteresis, - uint8_t low_threshold, - uint8_t low_hysteresis, - uint16_t min_time_spent); +/* Static inline functions */ +#if !defined(CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING) +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle) +{ + *handle = hci_handle; + return 0U; +} -uint8_t ll_conn_set_path_loss_reporting(uint16_t handle, uint8_t enable); +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_by_hci_handle_get_or_new(uint8_t hci_handle, + uint8_t *handle) +{ + *handle = hci_handle; + return 0U; +} + +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_hci_handle_get(uint8_t handle) +{ + return handle; +} + +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle) +{ + *handle = hci_handle; + return 0U; +} + +LL_ADV_HANDLE_MAPPING uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, uint8_t *handle) +{ + *handle = hci_handle; + return 0U; +} +#endif /* !CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING */ diff --git a/subsys/bluetooth/controller/include/ll_settings.h b/subsys/bluetooth/controller/include/ll_settings.h index c79a4fb1537b..df3835481f3e 100644 --- a/subsys/bluetooth/controller/include/ll_settings.h +++ b/subsys/bluetooth/controller/include/ll_settings.h @@ -1,25 +1,31 @@ /* + * Copyright (c) 2025 Nordic Semiconductor ASA * Copyright (c) 2019 Oticon A/S * * SPDX-License-Identifier: Apache-2.0 */ #if defined(CONFIG_BT_CTLR_VERSION_SETTINGS) +#define LL_VERSION_SETTINGS +#else /* !CONFIG_BT_CTLR_VERSION_SETTINGS */ +#define LL_VERSION_SETTINGS static __attribute__((always_inline)) inline +#endif /* !CONFIG_BT_CTLR_VERSION_SETTINGS */ -uint16_t ll_settings_company_id(void); -uint16_t ll_settings_subversion_number(void); +/* Version Interfaces */ +LL_VERSION_SETTINGS uint16_t ll_settings_company_id(void); +LL_VERSION_SETTINGS uint16_t ll_settings_subversion_number(void); -#else +/* Stable Modulation Index Interfaces */ +bool ll_settings_smi_tx(void); -static inline uint16_t ll_settings_company_id(void) +/* Static inline functions */ +#if !defined(CONFIG_BT_CTLR_VERSION_SETTINGS) +LL_VERSION_SETTINGS uint16_t ll_settings_company_id(void) { return CONFIG_BT_CTLR_COMPANY_ID; } -static inline uint16_t ll_settings_subversion_number(void) +LL_VERSION_SETTINGS uint16_t ll_settings_subversion_number(void) { return CONFIG_BT_CTLR_SUBVERSION_NUMBER; } - -#endif /* CONFIG_BT_CTLR_VERSION_SETTINGS */ - -bool ll_settings_smi_tx(void); +#endif /* !CONFIG_BT_CTLR_VERSION_SETTINGS */ From 22fc62f966c9a3306275c227a60ef7a01b2756b8 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sun, 5 Oct 2025 05:51:10 +0200 Subject: [PATCH 0205/3334] [nrf fromtree] Bluetooth: Controller: Use CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET Use CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET for nRF53 SoC conditional compilations. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 1fe79a65a25d00b5e0f78118f184aaa7b5395262) Signed-off-by: Vinayak Kariappa Chettimada --- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 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 0199326ed3ce..dbca89da1c58 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 @@ -317,7 +317,7 @@ void radio_tx_power_set(int8_t power) value = hal_radio_tx_power_value(power); NRF_RADIO->TXPOWER = value; -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) uint32_t value; /* NOTE: TXPOWER register only accepts upto 0dBm, hence use the HAL @@ -328,12 +328,12 @@ void radio_tx_power_set(int8_t power) NRF_RADIO->TXPOWER = value; hal_radio_tx_power_high_voltage_set(power); -#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ /* NOTE: valid value range is passed by Kconfig define. */ NRF_RADIO->TXPOWER = (uint32_t)power; -#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tx_power_max_set(void) @@ -351,25 +351,25 @@ int8_t radio_tx_power_min_get(void) int8_t radio_tx_power_max_get(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) return RADIO_TXPOWER_TXPOWER_Pos3dBm; -#else /* !CONFIG_SOC_COMPATIBLE_NRF53X */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET */ return (int8_t)hal_radio_tx_power_max_get(); -#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET */ } int8_t radio_tx_power_floor(int8_t power) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) /* NOTE: TXPOWER register only accepts upto 0dBm, +3dBm permitted by * use of high voltage being set for radio when TXPOWER register is set. */ if (power >= (int8_t)RADIO_TXPOWER_TXPOWER_Pos3dBm) { return RADIO_TXPOWER_TXPOWER_Pos3dBm; } -#endif /* CONFIG_SOC_COMPATIBLE_NRF53X */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET */ return (int8_t)hal_radio_tx_power_floor(power); } @@ -427,7 +427,7 @@ void radio_pkt_configure(uint8_t bits_len, uint8_t max_len, uint8_t flags) bits_s1 = RADIO_PKT_CONF_LENGTH_8BIT - bits_len; #elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) || \ - defined(CONFIG_SOC_COMPATIBLE_NRF53X) || \ + defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || \ defined(CONFIG_SOC_COMPATIBLE_NRF54LX) extra = 0U; @@ -525,7 +525,7 @@ uint32_t radio_rx_chain_delay_get(uint8_t phy, uint8_t flags) void radio_rx_enable(void) { #if !defined(CONFIG_BT_CTLR_TIFS_HW) -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* NOTE: Timer clear DPPI configuration is needed only for nRF53 * because of calls to radio_disable() and * radio_switch_complete_and_disable() inside a radio event call @@ -538,7 +538,7 @@ void radio_rx_enable(void) * radio event but when the radio event is done. */ hal_sw_switch_timer_clear_ppi_config(); -#endif /* CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_RXEN); @@ -547,7 +547,7 @@ void radio_rx_enable(void) void radio_tx_enable(void) { #if !defined(CONFIG_BT_CTLR_TIFS_HW) -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* NOTE: Timer clear DPPI configuration is needed only for nRF53 * because of calls to radio_disable() and * radio_switch_complete_and_disable() inside a radio event call @@ -560,7 +560,7 @@ void radio_tx_enable(void) * radio event but when the radio event is done. */ hal_sw_switch_timer_clear_ppi_config(); -#endif /* CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_TXEN); @@ -939,13 +939,13 @@ void sw_switch(uint8_t dir_curr, uint8_t dir_next, uint8_t phy_curr, uint8_t fla * time-stamp. */ hal_radio_end_time_capture_ppi_config(); -#if !defined(CONFIG_SOC_COMPATIBLE_NRF53X) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if !defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* The function is not called for nRF5340 single timer configuration because * HAL_SW_SWITCH_TIMER_CLEAR_PPI is equal to HAL_RADIO_END_TIME_CAPTURE_PPI, * so channel is already enabled. */ hal_radio_nrf_ppi_channels_enable(BIT(HAL_RADIO_END_TIME_CAPTURE_PPI)); -#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ sw_tifs_toggle += 1U; @@ -1360,38 +1360,38 @@ void radio_tmr_rx_status_reset(void) void radio_tmr_tx_enable(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ #if (HAL_RADIO_ENABLE_TX_ON_TICK_PPI == HAL_RADIO_ENABLE_RX_ON_TICK_PPI) hal_radio_enable_on_tick_ppi_config_and_enable(1U); #endif /* HAL_RADIO_ENABLE_TX_ON_TICK_PPI == HAL_RADIO_ENABLE_RX_ON_TICK_PPI */ -#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tmr_rx_enable(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ #if (HAL_RADIO_ENABLE_TX_ON_TICK_PPI == HAL_RADIO_ENABLE_RX_ON_TICK_PPI) hal_radio_enable_on_tick_ppi_config_and_enable(0U); #endif /* HAL_RADIO_ENABLE_TX_ON_TICK_PPI == HAL_RADIO_ENABLE_RX_ON_TICK_PPI */ -#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tmr_tx_disable(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) nrf_radio_subscribe_clear(NRF_RADIO, NRF_RADIO_TASK_TXEN); -#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ -#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tmr_rx_disable(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) nrf_radio_subscribe_clear(NRF_RADIO, NRF_RADIO_TASK_RXEN); -#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ -#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tmr_tifs_set(uint32_t tifs) @@ -1627,7 +1627,7 @@ uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t ticks_start) #if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER) last_pdu_end_us_init(latency_us); #endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* NOTE: Timer clear DPPI configuration is needed only for nRF53 * because of calls to radio_disable() and * radio_switch_complete_and_disable() inside a radio event call @@ -1640,7 +1640,7 @@ uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t ticks_start) * radio event but when the radio event is done. */ hal_sw_switch_timer_clear_ppi_config(); -#endif /* CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ return remainder_us; @@ -1657,7 +1657,7 @@ uint32_t radio_tmr_start_us(uint8_t trx, uint32_t start_us) */ start_us -= last_pdu_end_us; #endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* NOTE: Timer clear DPPI configuration is needed only for nRF53 * because of calls to radio_disable() and * radio_switch_complete_and_disable() inside a radio event call @@ -1670,7 +1670,7 @@ uint32_t radio_tmr_start_us(uint8_t trx, uint32_t start_us) * radio event but when the radio event is done. */ hal_sw_switch_timer_clear_ppi_config(); -#endif /* CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ /* start_us could be the current count in the timer */ @@ -1876,13 +1876,14 @@ void radio_tmr_end_capture(void) * hal_sw_switch_timer_clear_ppi_config() and sw_switch(). There is no need to * configure the channel again in this function. */ -#if (!defined(CONFIG_SOC_COMPATIBLE_NRF53X) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX)) || \ - ((defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX)) && \ +#if (!defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX)) || \ + ((defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || \ + defined(CONFIG_SOC_COMPATIBLE_NRF54LX)) && \ !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)) hal_radio_end_time_capture_ppi_config(); hal_radio_nrf_ppi_channels_enable(BIT(HAL_RADIO_END_TIME_CAPTURE_PPI)); -#endif /* (!CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX) || - * ((CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX) && +#endif /* (!CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX) || + * ((CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX) && * !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER) */ } From 68e687c348690ddaf33da3a07123c6e7067617c0 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 20 Sep 2025 06:30:37 +0200 Subject: [PATCH 0206/3334] [nrf fromtree] Bluetooth: Controller: Revert relaxed radio packet assignment deadline Reverts relaxed radio packet assignment deadline as it is too risky and can cause invalid bits be transmitted and/or cause MIC failures. Reverts commit 4dbfb22a7ea5 ("Bluetooth: Controller: Relax radio packet pointer assignment deadline"), and commit 230df7799342 ("Bluetooth: Controller: Relax radio packet pointer assignment deadline"). Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit a5e1f59686b98a0bf6379a24b2ff145e512e770e) Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/lll/lll_adv.c | 21 ++++++++-- .../controller/ll_sw/nordic/lll/lll_adv_aux.c | 28 ++++++++++++-- .../controller/ll_sw/nordic/lll/lll_adv_iso.c | 7 +++- .../ll_sw/nordic/lll/lll_adv_sync.c | 7 +++- .../ll_sw/nordic/lll/lll_central_iso.c | 38 ++++++++++++++++++- .../controller/ll_sw/nordic/lll/lll_conn.c | 30 +++++++++------ .../ll_sw/nordic/lll/lll_peripheral_iso.c | 35 ++++++++++++++++- .../controller/ll_sw/nordic/lll/lll_scan.c | 12 +++--- .../ll_sw/nordic/lll/lll_scan_aux.c | 21 ++++++++-- 9 files changed, 166 insertions(+), 33 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c index 96d93b2b855b..5d1d89712619 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c @@ -1182,7 +1182,12 @@ static void isr_tx(void *param) radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -1571,7 +1576,12 @@ static inline int isr_rx_pdu(struct lll_adv *lll, radio_pkt_tx_set(lll_adv_scan_rsp_curr_get(lll)); /* assert if radio packet ptr is not set and radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -1642,7 +1652,12 @@ static inline int isr_rx_pdu(struct lll_adv *lll, radio_disable(); /* assert if radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c index 731ca94ed508..c4ee5af14b1d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c @@ -488,7 +488,12 @@ static void isr_tx_chain(void *param) radio_pkt_tx_set(pdu); /* assert if radio packet ptr is not set and radio started rx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -602,7 +607,12 @@ static void isr_tx_rx(void *param) radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -809,7 +819,12 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, radio_pkt_tx_set(sr_pdu); /* assert if radio packet ptr is not set and radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -881,7 +896,12 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, radio_pkt_tx_set(pdu_tx); /* assert if radio packet ptr is not set and radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c index 0b9ff8d938c2..774a10da2b30 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c @@ -869,7 +869,12 @@ static void isr_tx_common(void *param, } /* assert if radio packet ptr is not set and radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c index e30b6d6b8d2a..7bcc0435fe53 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c @@ -401,7 +401,12 @@ static void isr_tx(void *param) radio_pkt_tx_set(pdu); /* assert if radio packet ptr is not set and radio started rx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c index 7ae759dd2bec..fc44233f1ee8 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c @@ -34,6 +34,7 @@ #include "lll_internal.h" #include "lll_tim_internal.h" +#include "lll_prof_internal.h" #include "ll_feat.h" @@ -466,6 +467,10 @@ static void isr_tx(void *param) struct node_rx_pdu *node_rx; uint32_t hcto; + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_latency_capture(); + } + /* Call to ensure packet/event timer accumulates the elapsed time * under single timer use. */ @@ -538,7 +543,12 @@ static void isr_tx(void *param) } /* assert if radio packet ptr is not set and radio started rx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } /* +/- 2us active clock jitter, +1 us PPI to timer start compensation */ hcto = radio_tmr_tifs_base_get() + cis_lll->tifs_us + @@ -705,6 +715,10 @@ static void isr_rx(void *param) uint8_t crc_ok; uint8_t cie; + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_latency_capture(); + } + /* Read radio status and events */ trx_done = radio_is_done(); if (trx_done) { @@ -975,6 +989,10 @@ static void isr_rx(void *param) isr_prepare_subevent(param); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_send(); + } + return; isr_rx_done: @@ -1131,6 +1149,13 @@ static void isr_prepare_subevent(void *param) radio_tmr_end_capture(); #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) + /* PA enable is overwriting packet end used in ISR profiling, hence + * back it up for later use. + */ + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_radio_end_backup(); + } + radio_gpio_pa_setup(); #if defined(CONFIG_BT_CTLR_PHY) @@ -1148,7 +1173,16 @@ static void isr_prepare_subevent(void *param) #endif /* !HAL_RADIO_GPIO_HAVE_PA_PIN */ /* assert if radio packet ptr is not set and radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } + + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_cputime_capture(); + } radio_isr_set(isr_tx, param); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c index 1527987c02d0..a528e06c939e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c @@ -311,9 +311,6 @@ void lll_conn_isr_rx(void *param) struct pdu_data *pdu_data_tx; struct node_rx_pdu *node_rx; struct node_tx *tx_release; -#if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) - uint32_t pa_lna_enable_us; -#endif /* HAL_RADIO_GPIO_HAVE_PA_PIN */ uint8_t is_rx_enqueue; struct lll_conn *lll; uint8_t rssi_ready; @@ -384,7 +381,12 @@ void lll_conn_isr_rx(void *param) radio_disable(); /* assert if radio started tx before being disabled */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", + __func__, lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } goto lll_conn_isr_rx_exit; } @@ -468,10 +470,13 @@ void lll_conn_isr_rx(void *param) } else if (!lll->role) { radio_disable(); - /* assert if radio packet ptr is not set and radio - * started tx. - */ - LL_ASSERT(!radio_is_ready()); + /* assert if radio started tx before being disabled */ + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", + __func__, lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } /* Restore state if last transmitted was empty PDU */ lll->empty = is_empty_pdu_tx_retry; @@ -507,6 +512,7 @@ void lll_conn_isr_rx(void *param) lll_conn_tx_pkt_set(lll, pdu_data_tx); #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) + uint32_t pa_lna_enable_us; #if defined(CONFIG_BT_CTLR_PROFILE_ISR) /* PA enable is overwriting packet end used in ISR profiling, hence @@ -529,10 +535,10 @@ void lll_conn_isr_rx(void *param) /* assert if radio packet ptr is not set and radio started tx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_address()); + LL_ASSERT(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_TX_DEFER) @@ -727,10 +733,10 @@ void lll_conn_isr_tx(void *param) /* assert if radio packet ptr is not set and radio started rx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_address()); + LL_ASSERT(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c index 5d23a12993bd..46e6aad63b7e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c @@ -34,6 +34,7 @@ #include "lll_internal.h" #include "lll_tim_internal.h" +#include "lll_prof_internal.h" #include "ll_feat.h" @@ -496,6 +497,10 @@ static void isr_rx(void *param) uint8_t crc_ok; uint8_t cie; + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_latency_capture(); + } + /* Read radio status and events */ trx_done = radio_is_done(); if (trx_done) { @@ -774,6 +779,13 @@ static void isr_rx(void *param) #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) uint32_t pa_lna_enable_us; + /* PA enable is overwriting packet end used in ISR profiling, hence + * back it up for later use. + */ + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_radio_end_backup(); + } + radio_gpio_pa_setup(); pa_lna_enable_us = radio_tmr_tifs_base_get() + cis_lll->tifs_us - @@ -788,7 +800,16 @@ static void isr_rx(void *param) #endif /* HAL_RADIO_GPIO_HAVE_PA_PIN */ /* assert if radio packet ptr is not set and radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } + + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_cputime_capture(); + } /* Schedule next subevent */ if (!cie && (se_curr < cis_lll->nse)) { @@ -865,6 +886,10 @@ static void isr_rx(void *param) start_us = radio_tmr_start_us(0U, subevent_us); LL_ASSERT(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ + + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_send(); + } } static void isr_tx(void *param) @@ -876,6 +901,10 @@ static void isr_tx(void *param) uint32_t start_us; uint32_t hcto; + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + lll_prof_latency_capture(); + } + /* Call to ensure packet/event timer accumulates the elapsed time * under single timer use. */ @@ -994,6 +1023,10 @@ static void isr_tx(void *param) radio_tmr_hcto_configure_abs(hcto); +#if defined(CONFIG_BT_CTLR_PROFILE_ISR) || defined(HAL_RADIO_GPIO_HAVE_PA_PIN) + radio_tmr_end_capture(); +#endif /* CONFIG_BT_CTLR_PROFILE_ISR || HAL_RADIO_GPIO_HAVE_PA_PIN */ + #if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) radio_gpio_lna_setup(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index 79f60677be7c..f1fab4b664de 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -792,10 +792,10 @@ static void isr_tx(void *param) /* assert if radio packet ptr is not set and radio started rx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_address()); + LL_ASSERT(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_PRIVACY) @@ -1217,10 +1217,10 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, /* assert if radio packet ptr is not set and radio started tx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_address()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1354,10 +1354,10 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, /* assert if radio packet ptr is not set and radio started tx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_address()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c index 1a8aeb536f0c..0478fbc80011 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c @@ -1051,7 +1051,12 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux, radio_pkt_tx_set(pdu_tx); /* assert if radio packet ptr is not set and radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -1201,7 +1206,12 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux, radio_pkt_tx_set(pdu_tx); /* assert if radio packet ptr is not set and radio started tx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -1407,7 +1417,12 @@ static void isr_tx(struct lll_scan_aux *lll_aux, void *pdu_rx, radio_pkt_rx_set(pdu_rx); /* assert if radio packet ptr is not set and radio started rx */ - LL_ASSERT(!radio_is_ready()); + if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { + LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + lll_prof_latency_get()); + } else { + LL_ASSERT(!radio_is_ready()); + } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); From 9c2eec4cc456ae1bc840d3812e02dd3f3a19ce6a Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 20 Sep 2025 06:30:37 +0200 Subject: [PATCH 0207/3334] [nrf fromtree] Bluetooth: Controller: nRF54L: Fix to improve decryption speed Fix to improve decryption speed. Decryption starts after payload reception, hence use fastest mode to decrypt PDUs. nRF54Lx only supports decryption after payload reception, this implementation was already there in the code. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 9b26e967caa34537df637663d834ff56672714bd) Signed-off-by: Vinayak Kariappa Chettimada --- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 77 ++++++++++++------- .../nordic/hal/nrf5/radio/radio_nrf5_dppi.h | 30 ++++---- 2 files changed, 65 insertions(+), 42 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 dbca89da1c58..218965d11bd0 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 @@ -2114,10 +2114,14 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ NRF_CCM->ENABLE = CCM_ENABLE_ENABLE_Disabled; NRF_CCM->ENABLE = CCM_ENABLE_ENABLE_Enabled; - mode = (CCM_MODE_MODE_Decryption << CCM_MODE_MODE_Pos) & + /* Select the CCM decryption mode for the SoC */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + /* NOTE: Use fast decryption as rx data is decrypt after payload is received, compared to + * decrypting in parallel with radio reception of address in nRF51/nRF52/nRF53. + */ + mode = (CCM_MODE_MODE_FastDecryption << CCM_MODE_MODE_Pos) & CCM_MODE_MODE_Msk; -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* Enable CCM Protocol Mode Bluetooth LE */ mode |= (CCM_MODE_PROTOCOL_Ble << CCM_MODE_PROTOCOL_Pos) & CCM_MODE_PROTOCOL_Msk; @@ -2126,21 +2130,30 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ mode |= (CCM_MODE_MACLEN_M4 << CCM_MODE_MACLEN_Pos) & CCM_MODE_MACLEN_Msk; -#elif !defined(CONFIG_SOC_SERIES_NRF51X) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) || defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) + mode = (CCM_MODE_MODE_Decryption << CCM_MODE_MODE_Pos) & + CCM_MODE_MODE_Msk; + /* Enable CCM support for 8-bit length field PDUs. */ mode |= (CCM_MODE_LENGTH_Extended << CCM_MODE_LENGTH_Pos) & CCM_MODE_LENGTH_Msk; -#endif /* !CONFIG_SOC_SERIES_NRF51X */ + +#elif defined(CONFIG_SOC_SERIES_NRF51X) + mode = (CCM_MODE_MODE_Decryption << CCM_MODE_MODE_Pos) & + CCM_MODE_MODE_Msk; + +#else +#error "H/w accelerated decryption unsupported." +#endif /* Select CCM data rate based on current PHY in use. */ switch (phy) { default: case PHY_1M: -#if !defined(CONFIG_SOC_SERIES_NRF51X) - mode |= (CCM_MODE_DATARATE_1Mbit << - CCM_MODE_DATARATE_Pos) & +#if !defined(CONFIG_SOC_SERIES_NRF51X) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + mode |= (CCM_MODE_DATARATE_1Mbit << CCM_MODE_DATARATE_Pos) & CCM_MODE_DATARATE_Msk; -#endif /* !CONFIG_SOC_SERIES_NRF51X */ +#endif /* !CONFIG_SOC_SERIES_NRF51X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ if (false) { @@ -2163,11 +2176,10 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ break; case PHY_2M: -#if !defined(CONFIG_SOC_SERIES_NRF51X) - mode |= (CCM_MODE_DATARATE_2Mbit << - CCM_MODE_DATARATE_Pos) & +#if !defined(CONFIG_SOC_SERIES_NRF51X) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + mode |= (CCM_MODE_DATARATE_2Mbit << CCM_MODE_DATARATE_Pos) & CCM_MODE_DATARATE_Msk; -#endif /* !CONFIG_SOC_SERIES_NRF51X */ +#endif /* !CONFIG_SOC_SERIES_NRF51X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ hal_trigger_crypt_ppi_config(); hal_radio_nrf_ppi_channels_enable(BIT(HAL_TRIGGER_CRYPT_PPI)); @@ -2177,9 +2189,10 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ #if defined(CONFIG_BT_CTLR_PHY_CODED) #if defined(CONFIG_HAS_HW_NRF_RADIO_BLE_CODED) case PHY_CODED: - mode |= (CCM_MODE_DATARATE_125Kbps << - CCM_MODE_DATARATE_Pos) & +#if !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + mode |= (CCM_MODE_DATARATE_125Kbps << CCM_MODE_DATARATE_Pos) & CCM_MODE_DATARATE_Msk; +#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ NRF_CCM->RATEOVERRIDE = (CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbps << @@ -2346,22 +2359,11 @@ static void *radio_ccm_ext_tx_pkt_set(struct ccm *cnf, uint8_t pdu_type, void *p NRF_CCM->ENABLE = CCM_ENABLE_ENABLE_Disabled; NRF_CCM->ENABLE = CCM_ENABLE_ENABLE_Enabled; + /* Select the CCM encryption mode for the SoC */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) mode = (CCM_MODE_MODE_Encryption << CCM_MODE_MODE_Pos) & CCM_MODE_MODE_Msk; -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) || \ - defined(CONFIG_SOC_COMPATIBLE_NRF53X) - /* Enable CCM support for 8-bit length field PDUs. */ - mode |= (CCM_MODE_LENGTH_Extended << CCM_MODE_LENGTH_Pos) & - CCM_MODE_LENGTH_Msk; - - /* NOTE: use fastest data rate as tx data needs to be prepared before - * radio Tx on any PHY. - */ - mode |= (CCM_MODE_DATARATE_2Mbit << CCM_MODE_DATARATE_Pos) & - CCM_MODE_DATARATE_Msk; - -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* Enable CCM Protocol Mode Bluetooth LE */ mode |= (CCM_MODE_PROTOCOL_Ble << CCM_MODE_PROTOCOL_Pos) & CCM_MODE_PROTOCOL_Msk; @@ -2375,6 +2377,27 @@ static void *radio_ccm_ext_tx_pkt_set(struct ccm *cnf, uint8_t pdu_type, void *p /* Enable CCM MAC Length 4 bytes */ mode |= (CCM_MODE_MACLEN_M4 << CCM_MODE_MACLEN_Pos) & CCM_MODE_MACLEN_Msk; + +#elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) || defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) + mode = (CCM_MODE_MODE_Encryption << CCM_MODE_MODE_Pos) & + CCM_MODE_MODE_Msk; + + /* Enable CCM support for 8-bit length field PDUs. */ + mode |= (CCM_MODE_LENGTH_Extended << CCM_MODE_LENGTH_Pos) & + CCM_MODE_LENGTH_Msk; + + /* NOTE: use fastest data rate as tx data needs to be prepared before + * radio Tx on any PHY. + */ + mode |= (CCM_MODE_DATARATE_2Mbit << CCM_MODE_DATARATE_Pos) & + CCM_MODE_DATARATE_Msk; + +#elif defined(CONFIG_SOC_SERIES_NRF51X) + mode = (CCM_MODE_MODE_Encryption << CCM_MODE_MODE_Pos) & + CCM_MODE_MODE_Msk; + +#else +#error "H/w accelerated encryption unsupported." #endif NRF_CCM->MODE = mode; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h index 11bb973994b4..3b68259c9bf6 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h @@ -106,17 +106,17 @@ static inline void hal_event_timer_start_ppi_config(void) nrf_grtc_publish_set(NRF_GRTC, HAL_CNTR_GRTC_EVENT_COMPARE_RADIO, HAL_EVENT_TIMER_START_PPI); - /* Enable same DPPI in Peripheral domain */ - nrf_dppi_channels_enable(NRF_DPPIC20, - BIT(HAL_EVENT_TIMER_START_PPI)); + /* Setup PPIB receive publish */ + nrf_ppib_publish_set(NRF_PPIB11, HAL_PPIB_RECEIVE_EVENT_TIMER_START_PPI, + HAL_EVENT_TIMER_START_PPI); /* Setup PPIB send subscribe */ nrf_ppib_subscribe_set(NRF_PPIB21, HAL_PPIB_SEND_EVENT_TIMER_START_PPI, HAL_EVENT_TIMER_START_PPI); - /* Setup PPIB receive publish */ - nrf_ppib_publish_set(NRF_PPIB11, HAL_PPIB_RECEIVE_EVENT_TIMER_START_PPI, - HAL_EVENT_TIMER_START_PPI); + /* Enable same DPPI in Peripheral domain */ + nrf_dppi_channels_enable(NRF_DPPIC20, + BIT(HAL_EVENT_TIMER_START_PPI)); #else /* !CONFIG_BT_CTLR_NRF_GRTC */ nrf_rtc_publish_set(NRF_RTC, NRF_RTC_EVENT_COMPARE_2, HAL_EVENT_TIMER_START_PPI); @@ -148,22 +148,22 @@ static inline void hal_radio_ready_time_capture_ppi_config(void) */ static inline void hal_trigger_crypt_ppi_config(void) { +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_PAYLOAD, HAL_TRIGGER_CRYPT_PPI); nrf_ccm_subscribe_set(NRF_CCM, NRF_CCM_TASK_START, HAL_TRIGGER_CRYPT_PPI); -#if !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS, HAL_TRIGGER_CRYPT_PPI); + /* Setup PPIB receive publish */ + nrf_ppib_publish_set(NRF_PPIB00, HAL_PPIB_RECEIVE_TRIGGER_CRYPT_PPI, HAL_TRIGGER_CRYPT_PPI); -#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ - nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_PAYLOAD, HAL_TRIGGER_CRYPT_PPI); + /* Setup PPIB send subscribe */ + nrf_ppib_subscribe_set(NRF_PPIB10, HAL_PPIB_SEND_TRIGGER_CRYPT_PPI, HAL_TRIGGER_CRYPT_PPI); /* Enable same DPPI in MCU domain */ nrf_dppi_channels_enable(NRF_DPPIC00, BIT(HAL_TRIGGER_CRYPT_PPI)); - /* Setup PPIB send subscribe */ - nrf_ppib_subscribe_set(NRF_PPIB10, HAL_PPIB_SEND_TRIGGER_CRYPT_PPI, HAL_TRIGGER_CRYPT_PPI); - - /* Setup PPIB receive publish */ - nrf_ppib_publish_set(NRF_PPIB00, HAL_PPIB_RECEIVE_TRIGGER_CRYPT_PPI, HAL_TRIGGER_CRYPT_PPI); +#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ + nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS, HAL_TRIGGER_CRYPT_PPI); + nrf_ccm_subscribe_set(NRF_CCM, NRF_CCM_TASK_START, HAL_TRIGGER_CRYPT_PPI); #endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ } From 901c7263fad9d5b3280f8b8e3b66a5262f709a1b Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 22 Oct 2025 21:31:27 +0200 Subject: [PATCH 0208/3334] [nrf fromtree] Bluetooth: Controller: nRF54L: Fix PPIB interface include cond compile Fix trivial PPIB interface include conditional compile. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 625f3052f59b5c9fb7f382e91f9d7860f3bb0774) Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h index f01f9859db4b..1b15f41c4080 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h @@ -40,6 +40,7 @@ #include #include "radio_nrf5340.h" #elif defined(CONFIG_SOC_SERIES_NRF54LX) +#include #include "radio_nrf54lx.h" #elif defined(CONFIG_BOARD_NRF52_BSIM) #include "radio_sim_nrf52.h" @@ -47,6 +48,7 @@ #include #include "radio_sim_nrf5340.h" #elif defined(CONFIG_BOARD_NRF54L15BSIM_NRF54L15_CPUAPP) +#include #include "radio_sim_nrf54l.h" #else #error "Unsupported SoC." @@ -54,7 +56,6 @@ #if defined(CONFIG_BT_CTLR_NRF_GRTC) #include -#include #else /* !CONFIG_BT_CTLR_NRF_GRTC */ #include #endif /* !CONFIG_BT_CTLR_NRF_GRTC */ From b2452412474bf3094809cdbf0148636000083362 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Mon, 26 May 2025 16:41:01 +0200 Subject: [PATCH 0209/3334] [nrf fromtree] Bluetooth: Controller: Introduce LL_ASSERT_DBG/ERR Introduce development and fatal assertion classification in the Controller implementation. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 796c0002f828bcb4911cd680650f1e102efaac0d) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/Kconfig | 12 + subsys/bluetooth/controller/hal/debug.h | 19 ++ subsys/bluetooth/controller/hci/hci.c | 44 ++-- subsys/bluetooth/controller/hci/hci_driver.c | 55 ++--- subsys/bluetooth/controller/ll_sw/isoal.c | 44 ++-- subsys/bluetooth/controller/ll_sw/lll_chan.c | 206 +++++++++--------- .../bluetooth/controller/ll_sw/lll_common.c | 2 +- .../controller/ll_sw/nordic/hal/nrf5/cntr.c | 2 +- .../controller/ll_sw/nordic/hal/nrf5/ecb.c | 2 +- .../controller/ll_sw/nordic/hal/nrf5/mayfly.c | 6 +- .../controller/ll_sw/nordic/hal/nrf5/ticker.c | 16 +- .../controller/ll_sw/nordic/lll/lll.c | 80 +++---- .../controller/ll_sw/nordic/lll/lll_adv.c | 42 ++-- .../controller/ll_sw/nordic/lll/lll_adv_aux.c | 40 ++-- .../controller/ll_sw/nordic/lll/lll_adv_iso.c | 28 +-- .../ll_sw/nordic/lll/lll_adv_sync.c | 20 +- .../controller/ll_sw/nordic/lll/lll_central.c | 8 +- .../ll_sw/nordic/lll/lll_central_iso.c | 46 ++-- .../controller/ll_sw/nordic/lll/lll_conn.c | 30 +-- .../controller/ll_sw/nordic/lll/lll_df.c | 2 +- .../ll_sw/nordic/lll/lll_peripheral.c | 8 +- .../ll_sw/nordic/lll/lll_peripheral_iso.c | 44 ++-- .../controller/ll_sw/nordic/lll/lll_scan.c | 44 ++-- .../ll_sw/nordic/lll/lll_scan_aux.c | 48 ++-- .../controller/ll_sw/nordic/lll/lll_sync.c | 30 +-- .../ll_sw/nordic/lll/lll_sync_iso.c | 56 ++--- .../controller/ll_sw/nordic/lll/lll_test.c | 8 +- subsys/bluetooth/controller/ll_sw/ull.c | 110 +++++----- subsys/bluetooth/controller/ll_sw/ull_adv.c | 86 ++++---- .../bluetooth/controller/ll_sw/ull_adv_aux.c | 59 ++--- .../bluetooth/controller/ll_sw/ull_adv_iso.c | 63 +++--- .../bluetooth/controller/ll_sw/ull_adv_sync.c | 45 ++-- .../bluetooth/controller/ll_sw/ull_central.c | 42 ++-- .../controller/ll_sw/ull_central_iso.c | 32 +-- subsys/bluetooth/controller/ll_sw/ull_conn.c | 90 ++++---- .../bluetooth/controller/ll_sw/ull_conn_iso.c | 90 ++++---- subsys/bluetooth/controller/ll_sw/ull_df.c | 6 +- .../bluetooth/controller/ll_sw/ull_filter.c | 34 +-- subsys/bluetooth/controller/ll_sw/ull_iso.c | 64 +++--- subsys/bluetooth/controller/ll_sw/ull_llcp.c | 18 +- .../bluetooth/controller/ll_sw/ull_llcp_cc.c | 24 +- .../controller/ll_sw/ull_llcp_chmu.c | 6 +- .../controller/ll_sw/ull_llcp_common.c | 44 ++-- .../controller/ll_sw/ull_llcp_conn_upd.c | 28 +-- .../bluetooth/controller/ll_sw/ull_llcp_enc.c | 26 +-- .../controller/ll_sw/ull_llcp_local.c | 14 +- .../controller/ll_sw/ull_llcp_past.c | 6 +- .../bluetooth/controller/ll_sw/ull_llcp_phy.c | 34 +-- .../controller/ll_sw/ull_llcp_remote.c | 22 +- .../controller/ll_sw/ull_peripheral.c | 24 +- .../controller/ll_sw/ull_peripheral_iso.c | 17 +- subsys/bluetooth/controller/ll_sw/ull_scan.c | 36 +-- .../bluetooth/controller/ll_sw/ull_scan_aux.c | 205 ++++++++--------- subsys/bluetooth/controller/ll_sw/ull_sched.c | 6 +- subsys/bluetooth/controller/ll_sw/ull_sync.c | 52 ++--- .../bluetooth/controller/ll_sw/ull_sync_iso.c | 51 ++--- subsys/bluetooth/controller/ticker/ticker.c | 10 +- tests/bluetooth/init/prj_ctlr.conf | 1 + tests/bluetooth/init/prj_ctlr_dbg.conf | 1 + 59 files changed, 1170 insertions(+), 1118 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 926fc060a89c..d6c7db02ea6e 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -1188,6 +1188,18 @@ rsource "Kconfig.df" rsource "Kconfig.ll_sw_split" rsource "Kconfig.dtm" +config BT_CTLR_ASSERT_DEBUG + bool "Development asserts" + default y + help + This option enables development asserts used for code coverage. + + The Controller will continue to function without memory leak or corruption with these + assertion checks disabled. Example, run-time mis-aligned memory access etc. which do + otherwise implicitly cause CPU fault during development testing. But these type of + asserted are essentially required for debugging, code and unit test coverage during + development cycle. + config BT_CTLR_ASSERT_HANDLER bool "Application Defined Assertion Handler" help diff --git a/subsys/bluetooth/controller/hal/debug.h b/subsys/bluetooth/controller/hal/debug.h index 653aa304b070..cb193a460971 100644 --- a/subsys/bluetooth/controller/hal/debug.h +++ b/subsys/bluetooth/controller/hal/debug.h @@ -27,6 +27,25 @@ void bt_ctlr_assert_handle(char *file, uint32_t line); BT_ASSERT_MSG(cond, fmt, ##__VA_ARGS__) #endif +/* Fatal asserts. + * The Controller will otherwise misbehave causing memory leak or system-wide memory corruptions due + * to uncontrolled DMA transfers etc. + * It is not safe to disable these assertion checks. + */ +#define LL_ASSERT_ERR(cond) LL_ASSERT(cond) + +/* Development asserts. + * The Controller will continue to function without memory leak or corruption with these assertion + * checks disabled. Example, run-time mis-aligned memory access etc. which do otherwise implicitly + * cause CPU fault during development testing. But these type of asserted are essentially required + * for debugging, code and unit test coverage during development cycle. + */ +#if defined(CONFIG_BT_CTLR_ASSERT_DEBUG) +#define LL_ASSERT_DBG(cond) LL_ASSERT(cond) +#else /* !CONFIG_BT_CTLR_ASSERT_DEBUG */ +#define LL_ASSERT_DBG(cond) ARG_UNUSED((cond)) +#endif /* !CONFIG_BT_CTLR_ASSERT_DEBUG */ + #if defined(CONFIG_BT_CTLR_ASSERT_VENDOR) #define LL_ASSERT_INFO1(cond, param) \ BT_ASSERT_VND(cond, param, 0) diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 683c4cadf919..eaf4667a1b85 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -3222,7 +3222,7 @@ static void le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_b phy_rx = lll->phy_rx; /* Make sure the report is generated for connection on PHY UNCODED */ - LL_ASSERT(phy_rx != PHY_CODED); + LL_ASSERT_DBG(phy_rx != PHY_CODED); #else phy_rx = PHY_1M; #endif /* CONFIG_BT_CTLR_PHY */ @@ -4412,7 +4412,7 @@ static void le_cis_request(struct pdu_data *pdu_data, * event. */ node = pdu_data; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_conn_iso_estab)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_conn_iso_estab)); req = node; if (!(ll_feat_get() & BIT64(BT_LE_FEAT_BIT_ISO_CHANNELS)) || @@ -4459,7 +4459,7 @@ static void le_cis_established(struct pdu_data *pdu_data, * event. */ node = pdu_data; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_conn_iso_estab)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_conn_iso_estab)); est = node; sep->status = est->status; @@ -4518,7 +4518,7 @@ static void le_per_adv_sync_transfer_received(struct pdu_data *pdu_data_rx, * event. */ node = pdu_data_rx; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_past_received)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_past_received)); se = node; sep->status = se->rx_sync.status; @@ -5520,7 +5520,7 @@ static void vs_le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct ne phy_rx = lll->phy_rx; /* Make sure the report is generated for connection on PHY UNCODED */ - LL_ASSERT(phy_rx != PHY_CODED); + LL_ASSERT_DBG(phy_rx != PHY_CODED); #else phy_rx = PHY_1M; #endif /* CONFIG_BT_CTLR_PHY */ @@ -6300,7 +6300,7 @@ int hci_iso_handle(struct net_buf *buf, struct net_buf **evt) /* Start Fragmentation */ /* FIXME: need to ensure ISO-AL returns proper isoal_status. - * Currently there are cases where ISO-AL calls LL_ASSERT. + * Currently there are cases where ISO-AL calls LL_ASSERT_ERR. */ isoal_status_t isoal_status = isoal_tx_sdu_fragment(stream->dp->source_hdl, &sdu_frag_tx); @@ -6554,7 +6554,7 @@ static inline void le_dir_adv_report(struct pdu_adv *adv, struct net_buf *buf, return; } - LL_ASSERT(adv->type == PDU_ADV_TYPE_DIRECT_IND); + LL_ASSERT_DBG(adv->type == PDU_ADV_TYPE_DIRECT_IND); #if CONFIG_BT_CTLR_DUP_FILTER_LEN > 0 if (dup_scan && @@ -6624,7 +6624,7 @@ static inline void le_mesh_scan_report(struct pdu_adv *adv, uint32_t instant; uint8_t chan; - LL_ASSERT(adv->type == PDU_ADV_TYPE_NONCONN_IND); + LL_ASSERT_DBG(adv->type == PDU_ADV_TYPE_NONCONN_IND); /* Filter based on currently active Scan Filter */ if (sf_curr < ARRAY_SIZE(scan_filters) && @@ -7093,7 +7093,7 @@ static void ext_adv_pdu_frag(uint8_t evt_type, uint8_t phy, uint8_t sec_phy, *data_len_total -= data_len_frag; *evt_buf = bt_buf_get_rx(BT_BUF_EVT, BUF_GET_TIMEOUT); - LL_ASSERT(*evt_buf); + LL_ASSERT_ERR(*evt_buf); net_buf_frag_add(buf, *evt_buf); @@ -7630,7 +7630,7 @@ static void le_ext_adv_report(struct pdu_data *pdu_data, * event. */ evt_buf = bt_buf_get_rx(BT_BUF_EVT, BUF_GET_TIMEOUT); - LL_ASSERT(evt_buf); + LL_ASSERT_ERR(evt_buf); net_buf_frag_add(buf, evt_buf); @@ -7726,7 +7726,7 @@ static void le_per_adv_sync_established(struct pdu_data *pdu_data, * event. */ node = pdu_data; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_sync)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_sync)); se = node; sep->status = se->status; @@ -8006,7 +8006,7 @@ static void le_per_adv_sync_report(struct pdu_data *pdu_data, data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_PARTIAL; evt_buf = bt_buf_get_rx(BT_BUF_EVT, BUF_GET_TIMEOUT); - LL_ASSERT(evt_buf); + LL_ASSERT_ERR(evt_buf); net_buf_frag_add(buf, evt_buf); @@ -8062,7 +8062,7 @@ static void le_per_adv_sync_report(struct pdu_data *pdu_data, */ if (!evt_buf) { evt_buf = bt_buf_get_rx(BT_BUF_EVT, BUF_GET_TIMEOUT); - LL_ASSERT(evt_buf); + LL_ASSERT_ERR(evt_buf); net_buf_frag_add(buf, evt_buf); } @@ -8147,7 +8147,7 @@ static void le_big_sync_established(struct pdu_data *pdu, * established event. */ node = pdu; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_sync_iso)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_sync_iso)); se = node; sep->status = se->status; @@ -8451,7 +8451,7 @@ static void le_conn_complete(struct pdu_data *pdu_data, uint16_t handle, * complete event. */ node = pdu_data; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_cc)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_cc)); cc = node; status = cc->status; @@ -8588,7 +8588,7 @@ static void le_conn_update_complete(struct pdu_data *pdu_data, uint16_t handle, * update complete event. */ node = pdu_data; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_cu)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_cu)); cu = node; sep->status = cu->status; @@ -8845,7 +8845,7 @@ static void encode_control(struct node_rx_pdu *node_rx, #elif defined(CONFIG_BT_CTLR_VS_SCAN_REQ_RX) le_vs_scan_req_received(pdu_data, node_rx, buf); #else - LL_ASSERT(0); + LL_ASSERT_DBG(0); #endif /* CONFIG_BT_CTLR_ADV_EXT */ break; #endif /* CONFIG_BT_CTLR_SCAN_REQ_NOTIFY */ @@ -8984,7 +8984,7 @@ static void encode_control(struct node_rx_pdu *node_rx, #endif /* CONFIG_BT_CTLR_USER_EVT_RANGE > 0 */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); return; } } @@ -9212,7 +9212,7 @@ static void encode_data_ctrl(struct node_rx_pdu *node_rx, break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); return; } } @@ -9243,20 +9243,20 @@ void hci_acl_encode(struct node_rx_pdu *node_rx, struct net_buf *buf) memcpy(data, pdu_data->lldata, pdu_data->len); #if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) if (hci_hbuf_total > 0) { - LL_ASSERT((hci_hbuf_sent - hci_hbuf_acked) < + LL_ASSERT_DBG((hci_hbuf_sent - hci_hbuf_acked) < hci_hbuf_total); hci_hbuf_sent++; /* Note: This requires linear handle values starting * from 0 */ - LL_ASSERT(handle < ARRAY_SIZE(hci_hbuf_pend)); + LL_ASSERT_DBG(handle < ARRAY_SIZE(hci_hbuf_pend)); hci_hbuf_pend[handle]++; } #endif /* CONFIG_BT_HCI_ACL_FLOW_CONTROL */ break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } diff --git a/subsys/bluetooth/controller/hci/hci_driver.c b/subsys/bluetooth/controller/hci/hci_driver.c index 8f3fd04d8e9e..43b2ad1ef656 100644 --- a/subsys/bluetooth/controller/hci/hci_driver.c +++ b/subsys/bluetooth/controller/hci/hci_driver.c @@ -91,21 +91,20 @@ isoal_status_t sink_sdu_alloc_hci(const struct isoal_sink *sink_ctx, const struct isoal_pdu_rx *valid_pdu, struct isoal_sdu_buffer *sdu_buffer) { + struct net_buf *buf; + ARG_UNUSED(sink_ctx); ARG_UNUSED(valid_pdu); /* TODO copy valid pdu into netbuf ? */ - struct net_buf *buf = bt_buf_get_rx(BT_BUF_ISO_IN, K_FOREVER); + buf = bt_buf_get_rx(BT_BUF_ISO_IN, K_FOREVER); + LL_ASSERT_ERR(buf); - if (buf) { - /* Increase reserved space for headers */ - net_buf_reset(buf); - net_buf_reserve(buf, BT_BUF_RESERVE + SDU_HCI_HDR_SIZE); - - sdu_buffer->dbuf = buf; - sdu_buffer->size = net_buf_tailroom(buf); - } else { - LL_ASSERT(0); - } + /* Increase reserved space for headers */ + net_buf_reset(buf); + net_buf_reserve(buf, BT_BUF_RESERVE + SDU_HCI_HDR_SIZE); + + sdu_buffer->dbuf = buf; + sdu_buffer->size = net_buf_tailroom(buf); return ISOAL_STATUS_OK; } @@ -212,11 +211,13 @@ isoal_status_t sink_sdu_write_hci(void *dbuf, const uint8_t *pdu_payload, const size_t consume_len) { + struct net_buf *buf; + ARG_UNUSED(sdu_written); - struct net_buf *buf = (struct net_buf *) dbuf; + buf = (struct net_buf *) dbuf; + LL_ASSERT_ERR(buf); - LL_ASSERT(buf); net_buf_add_mem(buf, pdu_payload, consume_len); return ISOAL_STATUS_OK; @@ -364,7 +365,7 @@ static void prio_recv_thread(void *p1, void *p2, void *p3) LOG_DBG("Num Complete: 0x%04x:%u", handle, num_cmplt); err = bt_recv_prio(dev, buf); - LL_ASSERT(err == 0); + LL_ASSERT_DBG(err == 0); k_yield(); #endif /* CONFIG_BT_CONN || CONFIG_BT_CTLR_ADV_ISO */ @@ -392,7 +393,7 @@ static void prio_recv_thread(void *p1, void *p2, void *p3) } err = bt_recv_prio(dev, buf); - LL_ASSERT(err == 0); + LL_ASSERT_DBG(err == 0); /* bt_recv_prio would not release normal evt * buf. @@ -470,7 +471,7 @@ static void node_rx_recv(const struct device *dev) #if defined(CONFIG_BT_CONN) || defined(CONFIG_BT_CTLR_ADV_ISO) struct net_buf *buf; - LL_ASSERT(node_rx == NULL); + LL_ASSERT_DBG(node_rx == NULL); buf = bt_buf_get_evt(BT_HCI_EVT_NUM_COMPLETED_PACKETS, false, K_FOREVER); @@ -482,7 +483,7 @@ static void node_rx_recv(const struct device *dev) k_yield(); #else /* !CONFIG_BT_CONN && !CONFIG_BT_CTLR_ADV_ISO */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); #endif /* !CONFIG_BT_CONN && !CONFIG_BT_CTLR_ADV_ISO */ num_cmplt = ll_rx_get((void *)&node_rx, &handle); @@ -589,7 +590,7 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx, isoal_rx_pdu_recombine(dp->sink_hdl, &pckt_meta); /* TODO handle err */ - LL_ASSERT(err == ISOAL_STATUS_OK); + LL_ASSERT_ERR(err == ISOAL_STATUS_OK); } } #endif /* CONFIG_BT_CTLR_CONN_ISO */ @@ -613,13 +614,13 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx, isoal_rx.pdu = (void *)node_rx->pdu; err = isoal_rx_pdu_recombine(stream->dp->sink_hdl, &isoal_rx); - LL_ASSERT(err == ISOAL_STATUS_OK || - err == ISOAL_STATUS_ERR_SDU_ALLOC); + LL_ASSERT_ERR(err == ISOAL_STATUS_OK || + err == ISOAL_STATUS_ERR_SDU_ALLOC); } #endif /* CONFIG_BT_CTLR_SYNC_ISO */ } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } node_rx->hdr.next = NULL; @@ -630,7 +631,7 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx, #endif /* CONFIG_BT_CTLR_SYNC_ISO || CONFIG_BT_CTLR_CONN_ISO */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -668,7 +669,7 @@ static inline struct net_buf *process_node(struct node_rx_pdu *node_rx) } break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -741,7 +742,7 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n) case HCI_CLASS_EVT_DISCARDABLE: case HCI_CLASS_EVT_REQUIRED: default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -823,7 +824,7 @@ static void recv_thread(void *p1, void *p2, void *p3) int err; err = k_poll(events, ARRAY_SIZE(events), K_FOREVER); - LL_ASSERT(err == 0 || err == -EINTR); + LL_ASSERT_ERR(err == 0 || err == -EINTR); if (false) { @@ -835,7 +836,7 @@ static void recv_thread(void *p1, void *p2, void *p3) #if !defined(CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE) } else if (events[EVENT_SEM].state == K_POLL_STATE_SEM_AVAILABLE) { err = k_sem_take(events[EVENT_SEM].sem, K_NO_WAIT); - LL_ASSERT(err == 0); + LL_ASSERT_DBG(err == 0); node_rx_recv(dev); #endif /* !CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE */ @@ -1047,7 +1048,7 @@ static int hci_driver_close(const struct device *dev) /* Resetting the LL stops all roles */ err = ll_deinit(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #if defined(CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE) /* Abort prio RX thread */ diff --git a/subsys/bluetooth/controller/ll_sw/isoal.c b/subsys/bluetooth/controller/ll_sw/isoal.c index 625edbbb63d7..9d2db83668d3 100644 --- a/subsys/bluetooth/controller/ll_sw/isoal.c +++ b/subsys/bluetooth/controller/ll_sw/isoal.c @@ -151,8 +151,8 @@ static bool isoal_get_time_diff(uint32_t time_before, uint32_t time_after, uint3 { bool valid = false; - LL_ASSERT(time_before <= ISOAL_TIME_WRAPPING_POINT_US); - LL_ASSERT(time_after <= ISOAL_TIME_WRAPPING_POINT_US); + LL_ASSERT_DBG(time_before <= ISOAL_TIME_WRAPPING_POINT_US); + LL_ASSERT_DBG(time_after <= ISOAL_TIME_WRAPPING_POINT_US); if (time_before > time_after) { if (time_before >= ISOAL_TIME_MID_POINT_US && @@ -225,13 +225,13 @@ static void isoal_sink_deallocate(isoal_sink_handle_t hdl) if (hdl < ARRAY_SIZE(isoal_global.sink_allocated)) { isoal_global.sink_allocated[hdl] = ISOAL_ALLOC_STATE_FREE; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } if (hdl < ARRAY_SIZE(isoal_global.sink_state)) { (void)memset(&isoal_global.sink_state[hdl], 0, sizeof(struct isoal_sink)); } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -350,7 +350,7 @@ isoal_status_t isoal_sink_create( session->sdu_sync_const = group_sync_delay; } } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } /* Remember the platform-specific callbacks */ @@ -378,7 +378,7 @@ void isoal_sink_enable(isoal_sink_handle_t hdl) /* Atomically enable */ isoal_global.sink_state[hdl].sdu_production.mode = ISOAL_PRODUCTION_MODE_ENABLED; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -392,7 +392,7 @@ void isoal_sink_disable(isoal_sink_handle_t hdl) /* Atomically disable */ isoal_global.sink_state[hdl].sdu_production.mode = ISOAL_PRODUCTION_MODE_DISABLED; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -441,7 +441,7 @@ static isoal_status_t isoal_rx_allocate_sdu(struct isoal_sink *sink, /* Nothing has been written into buffer yet */ sp->sdu_written = 0; sp->sdu_available = sdu->contents.size; - LL_ASSERT(sdu->contents.size > 0); + LL_ASSERT_ERR(sdu->contents.size > 0); /* Get seq number from session counter */ sdu->sn = session->sn; @@ -568,7 +568,7 @@ static isoal_status_t isoal_rx_buffered_emit_sdu(struct isoal_sink *sink, bool e #endif /* ISOAL_BUFFER_RX_SDUS_ENABLE */ } else { /* Unreachable */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } return err; @@ -653,7 +653,6 @@ static isoal_status_t isoal_rx_append_to_sdu(struct isoal_sink *sink, handle_error_case = (is_end_fragment && (packet_available == 0)); pdu_payload = pdu_meta->pdu->payload + offset; - LL_ASSERT(pdu_payload); /* While there is something left of the packet to consume */ err = ISOAL_STATUS_OK; @@ -880,7 +879,7 @@ static isoal_status_t isoal_rx_unframed_consume(struct isoal_sink *sink, /* Unsupported case */ err = ISOAL_STATUS_ERR_UNSPECIFIED; LOG_ERR("Invalid unframed LLID (%d)", llid); - LL_ASSERT(0); + LL_ASSERT_ERR(0); } break; @@ -1459,7 +1458,8 @@ static void isoal_source_deallocate(isoal_source_handle_t hdl) if (hdl < ARRAY_SIZE(isoal_global.source_state)) { source = &isoal_global.source_state[hdl]; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); + return; } @@ -1477,7 +1477,7 @@ static void isoal_source_deallocate(isoal_source_handle_t hdl) if (hdl < ARRAY_SIZE(isoal_global.source_allocated)) { isoal_global.source_allocated[hdl] = ISOAL_ALLOC_STATE_FREE; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } (void)memset(source, 0, sizeof(struct isoal_source)); @@ -1594,7 +1594,7 @@ void isoal_source_enable(isoal_source_handle_t hdl) /* Atomically enable */ isoal_global.source_state[hdl].pdu_production.mode = ISOAL_PRODUCTION_MODE_ENABLED; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -1608,7 +1608,7 @@ void isoal_source_disable(isoal_source_handle_t hdl) /* Atomically disable */ isoal_global.source_state[hdl].pdu_production.mode = ISOAL_PRODUCTION_MODE_DISABLED; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -1770,7 +1770,7 @@ static isoal_status_t isoal_tx_allocate_pdu(struct isoal_source *source, pp->pdu_written = 0; pp->pdu_available = available_len; pp->pdu_allocated = 1U; - LL_ASSERT(available_len > 0); + LL_ASSERT_ERR(available_len > 0); pp->pdu_cnt++; } @@ -1982,7 +1982,7 @@ static isoal_status_t isoal_tx_unframed_produce(isoal_source_handle_t source_hdl packet_available = tx_sdu->size; sdu_payload = tx_sdu->dbuf; - LL_ASSERT(sdu_payload); + LL_ASSERT_DBG(sdu_payload); zero_length_sdu = (packet_available == 0 && tx_sdu->sdu_state == BT_ISO_SINGLE); @@ -2468,12 +2468,12 @@ static uint16_t isoal_tx_framed_find_correct_tx_event(const struct isoal_source time_diff_valid = isoal_get_time_diff(time_stamp_selected, actual_grp_ref_point, &time_diff); - LL_ASSERT(time_diff_valid); - LL_ASSERT(time_diff > 0); + LL_ASSERT_DBG(time_diff_valid); + LL_ASSERT_DBG(time_diff > 0); /* Time difference must be less than the maximum possible * time-offset of 24-bits. */ - LL_ASSERT(time_diff <= 0x00FFFFFF); + LL_ASSERT_DBG(time_diff <= 0x00FFFFFF); } *payload_number = next_payload_number; @@ -2514,7 +2514,7 @@ static isoal_status_t isoal_tx_framed_produce(isoal_source_handle_t source_hdl, packet_available = tx_sdu->size; sdu_payload = tx_sdu->dbuf; - LL_ASSERT(sdu_payload); + LL_ASSERT_DBG(sdu_payload); zero_length_sdu = (packet_available == 0 && tx_sdu->sdu_state == BT_ISO_SINGLE); @@ -2791,7 +2791,7 @@ static isoal_status_t isoal_tx_framed_event_prepare_handle(isoal_source_handle_t } /* Not possible to recover if allocation or emit fails here*/ - LL_ASSERT(!(err || err_alloc)); + LL_ASSERT_ERR(!(err || err_alloc)); if (pp->payload_number < last_event_payload + 1ULL) { pp->payload_number = last_event_payload + 1ULL; diff --git a/subsys/bluetooth/controller/ll_sw/lll_chan.c b/subsys/bluetooth/controller/ll_sw/lll_chan.c index 213fce38a8f5..e45134144b64 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_chan.c +++ b/subsys/bluetooth/controller/ll_sw/lll_chan.c @@ -349,39 +349,39 @@ void lll_chan_sel_2_ut(void) /* Tests when ISO not supported */ /* Section 3.1 Sample Data 1 (37 used channels) */ m = lll_chan_sel_2(0U, chan_id, chan_map_1, chan_map_1_37_used); - LL_ASSERT(m == 25U); + LL_ASSERT_ERR(m == 25U); m = lll_chan_sel_2(1U, chan_id, chan_map_1, chan_map_1_37_used); - LL_ASSERT(m == 20U); + LL_ASSERT_ERR(m == 20U); m = lll_chan_sel_2(2U, chan_id, chan_map_1, chan_map_1_37_used); - LL_ASSERT(m == 6U); + LL_ASSERT_ERR(m == 6U); m = lll_chan_sel_2(3U, chan_id, chan_map_1, chan_map_1_37_used); - LL_ASSERT(m == 21U); + LL_ASSERT_ERR(m == 21U); /* Section 3.2 Sample Data 2 (9 used channels) */ m = lll_chan_sel_2(6U, chan_id, chan_map_2, chan_map_2_9_used); - LL_ASSERT(m == 23U); + LL_ASSERT_ERR(m == 23U); m = lll_chan_sel_2(7U, chan_id, chan_map_2, chan_map_2_9_used); - LL_ASSERT(m == 9U); + LL_ASSERT_ERR(m == 9U); m = lll_chan_sel_2(8U, chan_id, chan_map_2, chan_map_2_9_used); - LL_ASSERT(m == 34U); + LL_ASSERT_ERR(m == 34U); /* FIXME: Use Sample Data from Spec, if one is added. * Below is a random sample to cover implementation in this file. */ /* Section x.x Sample Data 3 (2 used channels) */ m = lll_chan_sel_2(11U, chan_id, chan_map_3, chan_map_3_2_used); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR(m == 1U); m = lll_chan_sel_2(12U, chan_id, chan_map_3, chan_map_3_2_used); - LL_ASSERT(m == 2U); + LL_ASSERT_ERR(m == 2U); m = lll_chan_sel_2(13U, chan_id, chan_map_3, chan_map_3_2_used); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR(m == 1U); #if defined(CONFIG_BT_CTLR_ISO) uint16_t prn_subevent_lu; @@ -393,164 +393,164 @@ void lll_chan_sel_2_ut(void) prn_s = 56857U ^ chan_id; prn_subevent_lu = prn_s; prn_subevent_se = chan_prn_subevent_se(chan_id, &prn_subevent_lu); - LL_ASSERT(prn_subevent_se == 11710U); + LL_ASSERT_ERR(prn_subevent_se == 11710U); /* BIS subevent 3, event counter 0 */ prn_subevent_se = chan_prn_subevent_se(chan_id, &prn_subevent_lu); - LL_ASSERT(prn_subevent_se == 16649U); + LL_ASSERT_ERR(prn_subevent_se == 16649U); /* BIS subevent 4, event counter 0 */ prn_subevent_se = chan_prn_subevent_se(chan_id, &prn_subevent_lu); - LL_ASSERT(prn_subevent_se == 38198U); + LL_ASSERT_ERR(prn_subevent_se == 38198U); /* Section 3.1 Sample Data 1 (37 used channels) */ /* BIS subevent 1, event counter 0 */ m = lll_chan_iso_event(0U, chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 56857U); - LL_ASSERT(m == 25U); - LL_ASSERT(remap_idx == 25U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 56857U); + LL_ASSERT_ERR(m == 25U); + LL_ASSERT_ERR(remap_idx == 25U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 1U); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR(remap_idx == 1U); + LL_ASSERT_ERR(m == 1U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 16U); - LL_ASSERT(m == 16U); + LL_ASSERT_ERR(remap_idx == 16U); + LL_ASSERT_ERR(m == 16U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 36U); - LL_ASSERT(m == 36U); + LL_ASSERT_ERR(remap_idx == 36U); + LL_ASSERT_ERR(m == 36U); /* BIS subevent 1, event counter 1 */ m = lll_chan_iso_event(1U, chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 1685U); - LL_ASSERT(m == 20U); - LL_ASSERT(remap_idx == 20U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 1685U); + LL_ASSERT_ERR(m == 20U); + LL_ASSERT_ERR(remap_idx == 20U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 36U); - LL_ASSERT(m == 36U); + LL_ASSERT_ERR(remap_idx == 36U); + LL_ASSERT_ERR(m == 36U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 12U); - LL_ASSERT(m == 12U); + LL_ASSERT_ERR(remap_idx == 12U); + LL_ASSERT_ERR(m == 12U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 34U); - LL_ASSERT(m == 34U); + LL_ASSERT_ERR(remap_idx == 34U); + LL_ASSERT_ERR(m == 34U); /* BIS subevent 1, event counter 2 */ m = lll_chan_iso_event(2U, chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 38301U); - LL_ASSERT(m == 6U); - LL_ASSERT(remap_idx == 6U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 38301U); + LL_ASSERT_ERR(m == 6U); + LL_ASSERT_ERR(remap_idx == 6U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 18U); - LL_ASSERT(m == 18U); + LL_ASSERT_ERR(remap_idx == 18U); + LL_ASSERT_ERR(m == 18U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 32U); - LL_ASSERT(m == 32U); + LL_ASSERT_ERR(remap_idx == 32U); + LL_ASSERT_ERR(m == 32U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 21U); - LL_ASSERT(m == 21U); + LL_ASSERT_ERR(remap_idx == 21U); + LL_ASSERT_ERR(m == 21U); /* BIS subevent 1, event counter 3 */ m = lll_chan_iso_event(3U, chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 27475U); - LL_ASSERT(m == 21U); - LL_ASSERT(remap_idx == 21U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 27475U); + LL_ASSERT_ERR(m == 21U); + LL_ASSERT_ERR(remap_idx == 21U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 4U); - LL_ASSERT(m == 4U); + LL_ASSERT_ERR(remap_idx == 4U); + LL_ASSERT_ERR(m == 4U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 22U); - LL_ASSERT(m == 22U); + LL_ASSERT_ERR(remap_idx == 22U); + LL_ASSERT_ERR(m == 22U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 8U); - LL_ASSERT(m == 8U); + LL_ASSERT_ERR(remap_idx == 8U); + LL_ASSERT_ERR(m == 8U); /* Section 3.2 Sample Data 2 (9 used channels) */ /* BIS subevent 1, event counter 6 */ m = lll_chan_iso_event(6U, chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 10975U); - LL_ASSERT(remap_idx == 4U); - LL_ASSERT(m == 23U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 10975U); + LL_ASSERT_ERR(remap_idx == 4U); + LL_ASSERT_ERR(m == 23U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 7U); - LL_ASSERT(m == 35U); + LL_ASSERT_ERR(remap_idx == 7U); + LL_ASSERT_ERR(m == 35U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 2U); - LL_ASSERT(m == 21U); + LL_ASSERT_ERR(remap_idx == 2U); + LL_ASSERT_ERR(m == 21U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 8U); - LL_ASSERT(m == 36U); + LL_ASSERT_ERR(remap_idx == 8U); + LL_ASSERT_ERR(m == 36U); /* BIS subevent 1, event counter 7 */ m = lll_chan_iso_event(7U, chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 5490U); - LL_ASSERT(remap_idx == 0U); - LL_ASSERT(m == 9U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 5490U); + LL_ASSERT_ERR(remap_idx == 0U); + LL_ASSERT_ERR(m == 9U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 3U); - LL_ASSERT(m == 22U); + LL_ASSERT_ERR(remap_idx == 3U); + LL_ASSERT_ERR(m == 22U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 8U); - LL_ASSERT(m == 36U); + LL_ASSERT_ERR(remap_idx == 8U); + LL_ASSERT_ERR(m == 36U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 5U); - LL_ASSERT(m == 33U); + LL_ASSERT_ERR(remap_idx == 5U); + LL_ASSERT_ERR(m == 33U); /* BIS subevent 1, event counter 8 */ m = lll_chan_iso_event(8U, chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 46970U); - LL_ASSERT(remap_idx == 6U); - LL_ASSERT(m == 34U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 46970U); + LL_ASSERT_ERR(remap_idx == 6U); + LL_ASSERT_ERR(m == 34U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 0U); - LL_ASSERT(m == 9U); + LL_ASSERT_ERR(remap_idx == 0U); + LL_ASSERT_ERR(m == 9U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 5U); - LL_ASSERT(m == 33U); + LL_ASSERT_ERR(remap_idx == 5U); + LL_ASSERT_ERR(m == 33U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 1U); - LL_ASSERT(m == 10U); + LL_ASSERT_ERR(remap_idx == 1U); + LL_ASSERT_ERR(m == 10U); /* FIXME: Use Sample Data from Spec, if one is added. * Below is a random sample to cover implementation in this file. @@ -558,66 +558,66 @@ void lll_chan_sel_2_ut(void) /* Section x.x Sample Data 3 (2 used channels) */ /* BIS subevent 1, event counter 11 */ m = lll_chan_iso_event(11U, chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 8628U); - LL_ASSERT(remap_idx == 0U); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 8628U); + LL_ASSERT_ERR(remap_idx == 0U); + LL_ASSERT_ERR(m == 1U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 1U); - LL_ASSERT(m == 2U); + LL_ASSERT_ERR(remap_idx == 1U); + LL_ASSERT_ERR(m == 2U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 0U); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR(remap_idx == 0U); + LL_ASSERT_ERR(m == 1U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 1U); - LL_ASSERT(m == 2U); + LL_ASSERT_ERR(remap_idx == 1U); + LL_ASSERT_ERR(m == 2U); /* BIS subevent 1, event counter 12 */ m = lll_chan_iso_event(12U, chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 34748U); - LL_ASSERT(remap_idx == 1U); - LL_ASSERT(m == 2U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 34748U); + LL_ASSERT_ERR(remap_idx == 1U); + LL_ASSERT_ERR(m == 2U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 0U); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR(remap_idx == 0U); + LL_ASSERT_ERR(m == 1U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 1U); - LL_ASSERT(m == 2U); + LL_ASSERT_ERR(remap_idx == 1U); + LL_ASSERT_ERR(m == 2U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 0U); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR(remap_idx == 0U); + LL_ASSERT_ERR(m == 1U); /* BIS subevent 1, event counter 13 */ m = lll_chan_iso_event(13U, chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT((prn_s ^ chan_id) == 22072U); - LL_ASSERT(remap_idx == 0U); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR((prn_s ^ chan_id) == 22072U); + LL_ASSERT_ERR(remap_idx == 0U); + LL_ASSERT_ERR(m == 1U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 1U); - LL_ASSERT(m == 2U); + LL_ASSERT_ERR(remap_idx == 1U); + LL_ASSERT_ERR(m == 2U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 0U); - LL_ASSERT(m == 1U); + LL_ASSERT_ERR(remap_idx == 0U); + LL_ASSERT_ERR(m == 1U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT(remap_idx == 1U); - LL_ASSERT(m == 2U); + LL_ASSERT_ERR(remap_idx == 1U); + LL_ASSERT_ERR(m == 2U); #endif /* CONFIG_BT_CTLR_ISO */ } diff --git a/subsys/bluetooth/controller/ll_sw/lll_common.c b/subsys/bluetooth/controller/ll_sw/lll_common.c index c6c561dbb76d..96861aa72010 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_common.c +++ b/subsys/bluetooth/controller/ll_sw/lll_common.c @@ -77,7 +77,7 @@ void lll_resume(void *param) next = param; err = lll_prepare_resolve(next->is_abort_cb, next->abort_cb, next->prepare_cb, &next->prepare_param, next->is_resume, 1U); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } #if defined(CONFIG_BT_CTLR_JIT_SCHEDULING) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cntr.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cntr.c index eb1116c987f7..ba6487b53534 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cntr.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cntr.c @@ -110,7 +110,7 @@ uint32_t cntr_start(void) uint32_t cntr_stop(void) { - LL_ASSERT(_refcount); + LL_ASSERT_ERR(_refcount); if (--_refcount) { return 1; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ecb.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ecb.c index 2398bdc44fd7..38b70c491d7d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ecb.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ecb.c @@ -225,7 +225,7 @@ static void isr_ecb(const void *arg) } else { - LL_ASSERT(false); + LL_ASSERT_DBG(false); } } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/mayfly.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/mayfly.c index 531cbd5b2412..73408b234544 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/mayfly.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/mayfly.c @@ -42,7 +42,7 @@ void mayfly_enable_cb(uint8_t caller_id, uint8_t callee_id, uint8_t enable) break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -62,7 +62,7 @@ uint32_t mayfly_is_enabled(uint8_t caller_id, uint8_t callee_id) return irq_is_enabled(HAL_SWI_JOB_IRQ); default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -120,7 +120,7 @@ void mayfly_pend(uint8_t caller_id, uint8_t callee_id) break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ticker.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ticker.c index 9ebafae2e9c4..e46ba7f6f62f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ticker.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ticker.c @@ -38,10 +38,10 @@ uint8_t hal_ticker_instance0_caller_id_get(uint8_t user_id) { uint8_t caller_id; - LL_ASSERT(user_id < sizeof(caller_id_lut)); + LL_ASSERT_DBG(user_id < sizeof(caller_id_lut)); caller_id = caller_id_lut[user_id]; - LL_ASSERT(caller_id != TICKER_CALL_ID_NONE); + LL_ASSERT_DBG(caller_id != TICKER_CALL_ID_NONE); return caller_id; } @@ -73,7 +73,7 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; @@ -96,7 +96,7 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; @@ -119,7 +119,7 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; @@ -157,7 +157,7 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; @@ -181,13 +181,13 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index b44847c05850..6a61c0c6605d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -461,7 +461,7 @@ void lll_disable(void *param) if (event.curr.abort_cb && event.curr.param) { event.curr.abort_cb(NULL, event.curr.param); } else { - LL_ASSERT(!param); + LL_ASSERT_ERR(!param); } } { @@ -519,12 +519,12 @@ int lll_done(void *param) /* Assert if param supplied without a pending prepare to cancel. */ next = ull_prepare_dequeue_get(); - LL_ASSERT(!param || next); + LL_ASSERT_ERR(!param || next); /* check if current LLL event is done */ if (!param) { /* Reset current event instance */ - LL_ASSERT(event.curr.abort_cb); + LL_ASSERT_ERR(event.curr.abort_cb); event.curr.abort_cb = NULL; param = event.curr.param; @@ -567,7 +567,7 @@ int lll_done(void *param) lll_done_score(param, result); extra = ull_event_done_extra_get(); - LL_ASSERT(extra); + LL_ASSERT_ERR(extra); /* Set result in done extra data - type was set by the role */ extra->result = result; @@ -575,7 +575,7 @@ int lll_done(void *param) /* Let ULL know about LLL event done */ evdone = ull_event_done(ull); - LL_ASSERT(evdone); + LL_ASSERT_ERR(evdone); return 0; } @@ -583,7 +583,7 @@ int lll_done(void *param) #if defined(CONFIG_BT_CTLR_LOW_LAT_ULL_DONE) void lll_done_ull_inc(void) { - LL_ASSERT(event.done.ull_count != event.done.lll_count); + LL_ASSERT_ERR(event.done.ull_count != event.done.lll_count); event.done.ull_count++; } #endif /* CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */ @@ -623,7 +623,7 @@ void lll_abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); lll_done(param); } @@ -681,7 +681,7 @@ void lll_chan_set(uint32_t chan) } else if (chan < 40) { radio_freq_chan_set(28 + ((chan - 11) * 2U)); } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } break; } @@ -805,7 +805,7 @@ void lll_isr_cleanup(void *param) radio_stop(); err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); lll_done(NULL); } @@ -822,7 +822,7 @@ void lll_isr_early_abort(void *param) } err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); lll_done(NULL); } @@ -900,7 +900,7 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, /* Store the next prepare for deferred call */ next = ull_prepare_enqueue(is_abort_cb, abort_cb, prepare_param, prepare_cb, is_resume); - LL_ASSERT(next); + LL_ASSERT_ERR(next); #if !defined(CONFIG_BT_CTLR_LOW_LAT) if (is_resume || prepare_param->defer) { @@ -918,8 +918,8 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, /* Start the preempt timeout */ ret = preempt_ticker_start(first, ready, next); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); #else /* CONFIG_BT_CTLR_LOW_LAT */ next = NULL; @@ -941,7 +941,7 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, /* check if resume requested by curr */ err = event.curr.is_abort_cb(NULL, event.curr.param, &resume_cb); - LL_ASSERT(err); + LL_ASSERT_DBG(err); if (err == -EAGAIN) { void *curr_param; @@ -954,9 +954,9 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, next = resume_enqueue(event.curr.is_abort_cb, event.curr.abort_cb, resume_cb, curr_param); - LL_ASSERT(next); + LL_ASSERT_ERR(next); } else { - LL_ASSERT(err == -ECANCELED); + LL_ASSERT_ERR(err == -ECANCELED); } } #endif /* CONFIG_BT_CTLR_LOW_LAT */ @@ -964,7 +964,7 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, return -EINPROGRESS; } - LL_ASSERT(!ready || &ready->prepare_param == prepare_param); + LL_ASSERT_ERR(!ready || &ready->prepare_param == prepare_param); event.curr.param = prepare_param->param; event.curr.is_abort_cb = is_abort_cb; @@ -996,8 +996,8 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, /* Start the preempt timeout */ ret = preempt_ticker_start(next, NULL, next); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); #endif /* !CONFIG_BT_CTLR_LOW_LAT */ return err; @@ -1012,7 +1012,7 @@ static int init_reset(void) static inline void done_inc(void) { event.done.lll_count++; - LL_ASSERT(event.done.lll_count != event.done.ull_count); + LL_ASSERT_ERR(event.done.lll_count != event.done.ull_count); } #endif /* CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */ @@ -1066,7 +1066,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(preempt_stop_req != preempt_stop_ack); + LL_ASSERT_ERR(preempt_stop_req != preempt_stop_ack); preempt_stop_ack = preempt_stop_req; /* We do not fail on status not being success because under scenarios @@ -1077,7 +1077,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) * safe to reset preempt_req and preempt_ack here. */ if (status == TICKER_STATUS_SUCCESS) { - LL_ASSERT(preempt_req != preempt_ack); + LL_ASSERT_ERR(preempt_req != preempt_ack); } preempt_req = preempt_ack; @@ -1086,18 +1086,18 @@ static void ticker_stop_op_cb(uint32_t status, void *param) static void ticker_start_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); /* Increase preempt requested count before acknowledging that the * ticker start operation for the preempt timeout has been handled. */ - LL_ASSERT(preempt_req == preempt_ack); + LL_ASSERT_ERR(preempt_req == preempt_ack); preempt_req++; /* Increase preempt start ack count, to acknowledge that the ticker * start operation has been handled. */ - LL_ASSERT(preempt_start_req != preempt_start_ack); + LL_ASSERT_ERR(preempt_start_req != preempt_start_ack); preempt_start_ack = preempt_start_req; } @@ -1141,8 +1141,8 @@ static uint32_t preempt_ticker_start(struct lll_event *first, /* Stop any scheduled preempt ticker */ ret = preempt_ticker_stop(); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); /* Schedule short preempt timeout */ first = next; @@ -1196,8 +1196,8 @@ static uint32_t preempt_ticker_stop(void) TICKER_USER_ID_LLL, TICKER_ID_LLL_PREEMPT, ticker_stop_op_cb, NULL); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); return ret; } @@ -1210,13 +1210,13 @@ static void preempt_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, static struct mayfly mfy = {0, 0, &link, NULL, preempt}; uint32_t ret; - LL_ASSERT(preempt_ack != preempt_req); + LL_ASSERT_ERR(preempt_ack != preempt_req); preempt_ack = preempt_req; mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void preempt(void *param) @@ -1287,8 +1287,8 @@ static void preempt(void *param) /* Start the preempt timeout for (short) ready event */ ret = preempt_ticker_start(ready, NULL, ready); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); return; } @@ -1322,7 +1322,7 @@ static void preempt(void *param) return; } - LL_ASSERT(ready->prepare_param.param == param); + LL_ASSERT_ERR(ready->prepare_param.param == param); } /* Check if current event want to continue */ @@ -1345,8 +1345,8 @@ static void preempt(void *param) /* Start the preempt timeout for next ready prepare */ ret = preempt_ticker_start(ready, NULL, ready); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } else { /* Let preemptor LLL know about the cancelled prepare */ @@ -1416,9 +1416,9 @@ static void preempt(void *param) /* Enqueue as resume event */ iter = resume_enqueue(is_abort_cb, abort_cb, resume_cb, curr_param); - LL_ASSERT(iter); + LL_ASSERT_ERR(iter); } else { - LL_ASSERT(err == -ECANCELED); + LL_ASSERT_ERR(err == -ECANCELED); } } #else /* CONFIG_BT_CTLR_LOW_LAT */ @@ -1432,8 +1432,8 @@ static void mfy_ticker_job_idle_get(void *param) ret = ticker_job_idle_get(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_LOW, ticker_op_job_disable, NULL); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } static void ticker_op_job_disable(uint32_t status, void *op_context) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c index 5d1d89712619..8c7837bf9805 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c @@ -435,12 +435,12 @@ struct pdu_adv *lll_adv_pdu_alloc_pdu_adv(void) } err = k_sem_take(&sem_pdu_free, PDU_FREE_TIMEOUT); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); k_sem_reset(&sem_pdu_free); p = MFIFO_DEQUEUE(pdu_free); - LL_ASSERT(p); + LL_ASSERT_ERR(p); #if defined(CONFIG_BT_CTLR_ADV_PDU_LINK) PDU_ADV_NEXT_PTR(p) = NULL; @@ -681,10 +681,10 @@ void lll_adv_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } bool lll_adv_scan_req_check(struct lll_adv *lll, struct pdu_adv *sr, @@ -836,7 +836,7 @@ static void *adv_extra_data_allocate(struct lll_adv_pdu *pdu, uint8_t last) extra_data = MFIFO_DEQUEUE_PEEK(extra_data_free); if (extra_data) { err = k_sem_take(&sem_extra_data_free, K_NO_WAIT); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); MFIFO_DEQUEUE(extra_data_free); pdu->extra_data[last] = extra_data; @@ -852,10 +852,10 @@ static void *adv_extra_data_allocate(struct lll_adv_pdu *pdu, uint8_t last) } err = k_sem_take(&sem_extra_data_free, PDU_FREE_TIMEOUT); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); extra_data = MFIFO_DEQUEUE(extra_data_free); - LL_ASSERT(extra_data); + LL_ASSERT_ERR(extra_data); pdu->extra_data[last] = (void *)extra_data; @@ -913,7 +913,7 @@ static void extra_data_free_sem_give(void) retval = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!retval); + LL_ASSERT_ERR(!retval); } #else /* !CONFIG_BT_CTLR_ZLI */ @@ -1062,7 +1062,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_A(1); @@ -1102,7 +1102,7 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) /* Retain HF clk */ err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); return -EAGAIN; #endif /* CONFIG_BT_PERIPHERAL */ @@ -1140,7 +1140,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); lll_done(param); } @@ -1178,7 +1178,7 @@ static void isr_tx(void *param) /* setup Rx buffer */ node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ @@ -1186,7 +1186,7 @@ static void isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1426,7 +1426,7 @@ static void isr_done(void *param) struct event_done_extra *extra; extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_ADV); - LL_ASSERT(extra); + LL_ASSERT_ERR(extra); } #endif /* CONFIG_BT_CTLR_ADV_EXT || CONFIG_BT_CTLR_JIT_SCHEDULING */ @@ -1464,7 +1464,7 @@ static void isr_abort_all(void *param) /* Abort any LLL prepare/resume enqueued in pipeline */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_LLL, 1U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } #endif /* CONFIG_BT_PERIPHERAL */ @@ -1475,7 +1475,7 @@ static struct pdu_adv *chan_prepare(struct lll_adv *lll) uint8_t upd; chan = find_lsb_set(lll->chan_map_curr); - LL_ASSERT(chan); + LL_ASSERT_DBG(chan); lll->chan_map_curr &= (lll->chan_map_curr - 1); @@ -1484,7 +1484,7 @@ static struct pdu_adv *chan_prepare(struct lll_adv *lll) /* FIXME: get latest only when primary PDU without Aux PDUs */ upd = 0U; pdu = lll_adv_data_latest_get(lll, &upd); - LL_ASSERT(pdu); + LL_ASSERT_DBG(pdu); radio_pkt_tx_set(pdu); @@ -1494,7 +1494,7 @@ static struct pdu_adv *chan_prepare(struct lll_adv *lll) struct pdu_adv *scan_pdu; scan_pdu = lll_adv_scan_rsp_latest_get(lll, &upd); - LL_ASSERT(scan_pdu); + LL_ASSERT_DBG(scan_pdu); #if defined(CONFIG_BT_CTLR_PRIVACY) if (upd) { @@ -1551,7 +1551,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, #endif /* CONFIG_BT_CTLR_PRIVACY */ node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu_rx = (void *)node_rx->pdu; pdu_adv = lll_adv_data_curr_get(lll); @@ -1580,7 +1580,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1656,7 +1656,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c index c4ee5af14b1d..f4b48cabab9c 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c @@ -104,10 +104,10 @@ void lll_adv_aux_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); err = lll_prepare(lll_is_abort_cb, lll_abort_cb, prepare_cb, 0, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } void lll_adv_aux_pback_prepare(void *param) @@ -143,7 +143,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* FIXME: get latest only when primary PDU without Aux PDUs */ upd = 0U; sec_pdu = lll_adv_aux_data_latest_get(lll, &upd); - LL_ASSERT(sec_pdu); + LL_ASSERT_DBG(sec_pdu); #if defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) struct ll_adv_aux_set *aux; @@ -163,14 +163,14 @@ static int prepare_cb(struct lll_prepare_param *p) /* Get reference to primary PDU */ pri_pdu = lll_adv_data_curr_get(lll_adv); - LL_ASSERT(pri_pdu->type == PDU_ADV_TYPE_EXT_IND); + LL_ASSERT_DBG(pri_pdu->type == PDU_ADV_TYPE_EXT_IND); /* Get reference to common extended header */ com_hdr = (void *)&pri_pdu->adv_ext_ind; /* Get reference to aux pointer structure */ err = aux_ptr_get(pri_pdu, &aux_ptr); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* Abort if no aux_ptr filled */ if (unlikely(!aux_ptr || !PDU_ADV_AUX_PTR_OFFSET_GET(aux_ptr))) { @@ -218,7 +218,7 @@ static int prepare_cb(struct lll_prepare_param *p) struct pdu_adv *scan_pdu; scan_pdu = lll_adv_scan_rsp_latest_get(lll_adv, &upd); - LL_ASSERT(scan_pdu); + LL_ASSERT_DBG(scan_pdu); radio_isr_set(isr_tx_rx, lll); radio_tmr_tifs_set(EVENT_IFS_US); @@ -340,7 +340,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_ADV_AUX_PDU_BACK2BACK */ ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_A(1); @@ -411,7 +411,7 @@ static void isr_early_abort(void *param) /* Generate auxiliary radio event done */ extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_ADV_AUX); - LL_ASSERT(extra); + LL_ASSERT_ERR(extra); radio_isr_set(isr_race, param); if (!radio_is_idle()) { @@ -419,7 +419,7 @@ static void isr_early_abort(void *param) } err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); lll_done(NULL); } @@ -434,7 +434,7 @@ static void isr_done(void *param) /* Generate auxiliary radio event done */ extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_ADV_AUX); - LL_ASSERT(extra); + LL_ASSERT_ERR(extra); /* Cleanup radio event and dispatch the done event */ lll_isr_cleanup(param); @@ -462,14 +462,14 @@ static void isr_tx_chain(void *param) /* Get reference to aux pointer structure */ err = aux_ptr_get(lll_aux->last_pdu, &aux_ptr); - LL_ASSERT(!err && aux_ptr); + LL_ASSERT_ERR(!err && aux_ptr); /* Use channel idx that was in aux_ptr */ lll_chan_set(aux_ptr->chan_idx); /* Get reference to the auxiliary chain PDU */ pdu = lll_adv_pdu_linked_next_get(lll_aux->last_pdu); - LL_ASSERT(pdu); + LL_ASSERT_DBG(pdu); /* Set the last used auxiliary PDU for transmission */ lll_aux->last_pdu = pdu; @@ -492,7 +492,7 @@ static void isr_tx_chain(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -557,7 +557,7 @@ static void aux_ptr_chan_idx_set(struct lll_adv_aux *lll, struct pdu_adv *pdu) /* Get reference to aux pointer structure */ err = aux_ptr_get(pdu, &aux_ptr); - LL_ASSERT(!err && aux_ptr); + LL_ASSERT_ERR(!err && aux_ptr); /* Calculate a new channel index */ aux = HDR_LLL2ULL(lll); @@ -603,7 +603,7 @@ static void isr_tx_rx(void *param) /* setup Rx buffer */ node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ @@ -611,7 +611,7 @@ static void isr_tx_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -764,12 +764,12 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, lll = lll_aux->adv; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu_rx = (void *)node_rx->pdu; pdu_adv = lll_adv_data_curr_get(lll); pdu_aux = lll_adv_aux_data_latest_get(lll_aux, &upd); - LL_ASSERT(pdu_aux); + LL_ASSERT_DBG(pdu_aux); hdr = &pdu_aux->adv_ext_ind.ext_hdr; @@ -823,7 +823,7 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -900,7 +900,7 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c index 774a10da2b30..cc26f729dfce 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c @@ -115,7 +115,7 @@ static void prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); p = param; @@ -135,7 +135,7 @@ static void create_prepare_bh(void *param) /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, lll_abort_cb, create_prepare_cb, 0U, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } static void prepare_bh(void *param) @@ -144,7 +144,7 @@ static void prepare_bh(void *param) /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, lll_abort_cb, prepare_cb, 0U, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } static int create_prepare_cb(struct lll_prepare_param *p) @@ -269,7 +269,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) stream_handle = lll->stream_handle[bis_idx]; handle = LL_BIS_ADV_HANDLE_FROM_IDX(stream_handle); stream = ull_adv_iso_lll_stream_get(stream_handle); - LL_ASSERT(stream); + LL_ASSERT_DBG(stream); do { link = memq_peek(stream->memq_tx.head, @@ -448,7 +448,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); /* Calculate ahead the next subevent channel index */ if (false) { @@ -470,7 +470,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_ADV_ISO_INTERLEAVED */ } else { - LL_ASSERT(false); + LL_ASSERT_DBG(false); } return 0; @@ -582,7 +582,7 @@ static void isr_tx_common(void *param, } else { bis = 0U; - LL_ASSERT(false); + LL_ASSERT_DBG(false); } if (!is_ctrl) { @@ -649,7 +649,7 @@ static void isr_tx_common(void *param, stream_handle = lll->stream_handle[bis_idx]; handle = LL_BIS_ADV_HANDLE_FROM_IDX(stream_handle); stream = ull_adv_iso_lll_stream_get(stream_handle); - LL_ASSERT(stream); + LL_ASSERT_DBG(stream); do { struct node_tx_iso *tx; @@ -727,7 +727,7 @@ static void isr_tx_common(void *param, /* FIXME: memq_peek_n function does not support indices > UINT8_MAX, * add assertion check to honor this limitation. */ - LL_ASSERT(payload_index <= UINT8_MAX); + LL_ASSERT_DBG(payload_index <= UINT8_MAX); } else { payload_index = lll->bn_curr - 1U; /* 3 bits */ } @@ -742,7 +742,7 @@ static void isr_tx_common(void *param, stream_handle = lll->stream_handle[lll->bis_curr - 1U]; stream = ull_adv_iso_lll_stream_get(stream_handle); - LL_ASSERT(stream); + LL_ASSERT_DBG(stream); link = memq_peek_n(stream->memq_tx.head, stream->memq_tx.tail, payload_index, (void **)&tx); @@ -873,7 +873,7 @@ static void isr_tx_common(void *param, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -922,7 +922,7 @@ static void isr_tx_common(void *param, #endif /* CONFIG_BT_CTLR_ADV_ISO_INTERLEAVED */ } else { - LL_ASSERT(false); + LL_ASSERT_DBG(false); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1038,7 +1038,7 @@ static void isr_done_term(void *param) lll_isr_status_reset(); lll = param; - LL_ASSERT(lll->ctrl_expire); + LL_ASSERT_DBG(lll->ctrl_expire); elapsed_event = lll->latency_event + 1U; if (lll->ctrl_expire > elapsed_event) { @@ -1075,7 +1075,7 @@ static void isr_done_term(void *param) * Advertising PDU. */ rx = ull_pdu_rx_alloc(); - LL_ASSERT(rx); + LL_ASSERT_ERR(rx); rx->hdr.type = NODE_RX_TYPE_BIG_CHM_COMPLETE; rx->rx_ftr.param = lll; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c index 7bcc0435fe53..be8b8aa03a41 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c @@ -86,11 +86,11 @@ void lll_adv_sync_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } static int init_reset(void) @@ -176,7 +176,7 @@ static int prepare_cb(struct lll_prepare_param *p) upd = 0U; pdu = lll_adv_sync_data_latest_get(lll, NULL, &upd); - LL_ASSERT(pdu); + LL_ASSERT_DBG(pdu); #if defined(CONFIG_BT_CTLR_DF_ADV_CTE_TX) lll_df_cte_tx_enable(lll, pdu, &cte_len_us); @@ -278,7 +278,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK */ ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_A(1); @@ -305,7 +305,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Accumulate the latency as event is aborted while being in pipeline */ lll = prepare_param->param; @@ -336,7 +336,7 @@ static void isr_done(void *param) * the thread context. */ rx = ull_pdu_rx_alloc(); - LL_ASSERT(rx); + LL_ASSERT_ERR(rx); rx->hdr.type = NODE_RX_TYPE_SYNC_CHM_COMPLETE; rx->rx_ftr.param = lll; @@ -370,14 +370,14 @@ static void isr_tx(void *param) /* Get reference to aux pointer structure */ err = aux_ptr_get(lll_sync->last_pdu, &aux_ptr); - LL_ASSERT(!err && aux_ptr); + LL_ASSERT_ERR(!err && aux_ptr); /* Use channel idx that was in aux_ptr */ lll_chan_set(aux_ptr->chan_idx); /* Get reference to the auxiliary chain PDU */ pdu = lll_adv_pdu_linked_next_get(lll_sync->last_pdu); - LL_ASSERT(pdu); + LL_ASSERT_DBG(pdu); /* Set the last used auxiliary PDU for transmission */ lll_sync->last_pdu = pdu; @@ -405,7 +405,7 @@ static void isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -514,7 +514,7 @@ static void aux_ptr_chan_idx_set(struct lll_adv_sync *lll, struct pdu_adv *pdu) /* Get reference to aux pointer structure */ err = aux_ptr_get(pdu, &aux_ptr); - LL_ASSERT(!err && aux_ptr); + LL_ASSERT_ERR(!err && aux_ptr); /* Calculate a new channel index */ chan_idx = lll_chan_sel_2(lll->data_chan_counter, lll->data_chan_id, diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central.c index 4f082b4957a4..fb170046a96f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central.c @@ -72,12 +72,12 @@ void lll_central_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_conn_central_is_abort_cb, lll_conn_abort_cb, prepare_cb, 0, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } static int init_reset(void) @@ -139,7 +139,7 @@ static int prepare_cb(struct lll_prepare_param *p) lll->data_chan_count); #else /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ data_chan_use = 0; - LL_ASSERT(0); + LL_ASSERT_DBG(0); #endif /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ } else { data_chan_use = lll_chan_sel_1(&lll->data_chan_use, @@ -266,7 +266,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif /* !CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_M(1); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c index fc44233f1ee8..3d02a092f33f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c @@ -97,11 +97,11 @@ void lll_central_iso_prepare(void *param) /* Initiate HF clock start up */ err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, abort_cb, prepare_cb, 0U, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } static int init_reset(void) @@ -143,7 +143,7 @@ static int prepare_cb(struct lll_prepare_param *p) cis_lll = ull_conn_iso_lll_stream_get_by_group(cig_lll, &cis_handle_curr); } while (cis_lll && !cis_lll->active); - LL_ASSERT(cis_lll); + LL_ASSERT_DBG(cis_lll); /* Unconditionally set the prepared flag. * This flag ensures current CIG event does not pick up a new CIS becoming active when the @@ -156,7 +156,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); /* Pick the event_count calculated in the ULL prepare */ cis_lll->event_count = cis_lll->event_count_prepare; @@ -395,7 +395,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Prepare is done */ ret = lll_prepare_done(cig_lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_M(1); @@ -435,7 +435,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); if (conn_lll->enc_rx) { radio_ccm_disable(); @@ -449,7 +449,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Get reference to CIG LLL context */ cig_lll = prepare_param->param; @@ -494,13 +494,13 @@ static void isr_tx(void *param) /* Acquire rx node for reception */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); #if defined(CONFIG_BT_CTLR_LE_ENC) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); #endif /* CONFIG_BT_CTLR_LE_ENC */ /* PHY */ @@ -547,7 +547,7 @@ static void isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } /* +/- 2us active clock jitter, +1 us PPI to timer start compensation */ @@ -608,12 +608,12 @@ static void isr_tx(void *param) (cis_lll->sub_interval * se_curr); start_us = radio_tmr_start_us(1U, subevent_us); - LL_ASSERT(start_us == (subevent_us + 1U)); + LL_ASSERT_ERR(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Get reference to ACL context */ evt_conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(evt_conn_lll != NULL); + LL_ASSERT_DBG(evt_conn_lll != NULL); /* Calculate the radio channel to use for next subevent */ data_chan_id = lll_chan_id(cis_lll->access_addr); @@ -652,7 +652,7 @@ static void isr_tx(void *param) subevent_us += next_cis_lll->offset - cis_offset_first; start_us = radio_tmr_start_us(1U, subevent_us); - LL_ASSERT(start_us == (subevent_us + 1U)); + LL_ASSERT_ERR(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Event counter value, 0-15 bit of cisEventCounter */ @@ -660,7 +660,7 @@ static void isr_tx(void *param) /* Get reference to ACL context */ next_conn_lll = ull_conn_lll_get(next_cis_lll->acl_handle); - LL_ASSERT(next_conn_lll != NULL); + LL_ASSERT_DBG(next_conn_lll != NULL); /* Calculate the radio channel to use for ISO event */ data_chan_id = lll_chan_id(next_cis_lll->access_addr); @@ -772,7 +772,7 @@ static void isr_rx(void *param) /* Get reference to received PDU */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu_rx = (void *)node_rx->pdu; /* Tx ACK */ @@ -805,7 +805,7 @@ static void isr_rx(void *param) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); /* If required, wait for CCM to finish */ @@ -813,7 +813,7 @@ static void isr_rx(void *param) uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT(done); + LL_ASSERT_ERR(done); if (!radio_ccm_mic_is_valid()) { /* Record MIC invalid */ @@ -894,7 +894,7 @@ static void isr_rx(void *param) /* Get reference to ACL context */ next_conn_lll = ull_conn_lll_get(next_cis_lll->acl_handle); - LL_ASSERT(next_conn_lll != NULL); + LL_ASSERT_DBG(next_conn_lll != NULL); /* Calculate CIS channel if not already calculated */ if (se_curr < cis_lll->nse) { @@ -912,7 +912,7 @@ static void isr_rx(void *param) subevent_us += next_cis_lll->offset - cis_offset_first; start_us = radio_tmr_start_us(1U, subevent_us); - LL_ASSERT(start_us == (subevent_us + 1U)); + LL_ASSERT_ERR(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Event counter value, 0-15 bit of cisEventCounter */ @@ -1075,7 +1075,7 @@ static void isr_prepare_subevent(void *param) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); #endif /* CONFIG_BT_CTLR_LE_ENC */ /* PHY */ @@ -1134,7 +1134,7 @@ static void isr_prepare_subevent(void *param) #if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER) start_us = radio_tmr_start_us(1U, subevent_us); - LL_ASSERT(start_us == (subevent_us + 1U)); + LL_ASSERT_ERR(start_us == (subevent_us + 1U)); #else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Compensate for the 1 us added by radio_tmr_start_us() */ @@ -1177,7 +1177,7 @@ static void isr_prepare_subevent(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1203,7 +1203,7 @@ static void isr_done(void *param) payload_count_flush_or_inc_on_close(cis_lll); e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); e->type = EVENT_DONE_EXTRA_TYPE_CIS; e->trx_performed_bitmask = trx_performed_bitmask; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c index a528e06c939e..76663641f80a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c @@ -189,7 +189,7 @@ int lll_conn_central_is_abort_cb(void *next, void *curr, return -EBUSY; } - LL_ASSERT(trx_busy_iteration < CENTRAL_TRX_BUSY_ITERATION_MAX); + LL_ASSERT_DBG(trx_busy_iteration < CENTRAL_TRX_BUSY_ITERATION_MAX); return -ECANCELED; } @@ -223,7 +223,7 @@ int lll_conn_peripheral_is_abort_cb(void *next, void *curr, return -EBUSY; } - LL_ASSERT(trx_busy_iteration < PERIPHERAL_TRX_BUSY_ITERATION_MAX); + LL_ASSERT_DBG(trx_busy_iteration < PERIPHERAL_TRX_BUSY_ITERATION_MAX); return -ECANCELED; } @@ -268,7 +268,7 @@ void lll_conn_abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Get reference to LLL connection context */ lll = prepare_param->param; @@ -290,7 +290,7 @@ void lll_conn_abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Extra done event, to check supervision timeout */ e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); e->type = EVENT_DONE_EXTRA_TYPE_CONN; e->trx_cnt = 0U; @@ -364,7 +364,7 @@ void lll_conn_isr_rx(void *param) lll = param; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu_data_rx = (void *)node_rx->pdu; @@ -385,7 +385,7 @@ void lll_conn_isr_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } goto lll_conn_isr_rx_exit; @@ -475,7 +475,7 @@ void lll_conn_isr_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } /* Restore state if last transmitted was empty PDU */ @@ -538,7 +538,7 @@ void lll_conn_isr_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_TX_DEFER) @@ -570,7 +570,7 @@ void lll_conn_isr_rx(void *param) is_ull_rx = 0U; if (tx_release) { - LL_ASSERT(lll->handle != 0xFFFF); + LL_ASSERT_DBG(lll->handle != 0xFFFF); ull_conn_lll_ack_enqueue(lll->handle, tx_release); @@ -736,12 +736,12 @@ void lll_conn_isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX) pdu_tx = get_last_tx_pdu(lll); - LL_ASSERT(pdu_tx); + LL_ASSERT_DBG(pdu_tx); if (pdu_tx->cp) { cte_len = CTE_LEN_US(pdu_tx->octet3.cte_info.time); @@ -836,7 +836,7 @@ void lll_conn_rx_pkt_set(struct lll_conn *lll) uint8_t phy; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); /* In case of ISR latencies, if packet pointer has not been set on time * then we do not want to check uninitialized length in rx buffer that @@ -1041,7 +1041,7 @@ static void isr_done(void *param) lll_isr_status_reset(); e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); e->type = EVENT_DONE_EXTRA_TYPE_CONN; e->trx_cnt = trx_cnt; @@ -1182,7 +1182,7 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, FORCE_MD_CNT_SET(); } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } if (IS_ENABLED(CONFIG_BT_CENTRAL) && !lll->role && @@ -1209,7 +1209,7 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT(done); + LL_ASSERT_ERR(done); bool mic_failure = !radio_ccm_mic_is_valid(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c index f4a12ef5e934..a9a575a32306 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c @@ -103,7 +103,7 @@ void lll_df_cte_tx_enable(struct lll_adv_sync *lll_sync, const struct pdu_adv *p const struct lll_df_adv_cfg *df_cfg; df_cfg = lll_adv_sync_extra_data_curr_get(lll_sync); - LL_ASSERT(df_cfg); + LL_ASSERT_DBG(df_cfg); lll_df_cte_tx_configure(df_cfg->cte_type, df_cfg->cte_length, df_cfg->ant_sw_len, df_cfg->ant_ids); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c index 8c3b83efd721..a25265400db8 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c @@ -73,7 +73,7 @@ void lll_periph_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); p = param; @@ -82,7 +82,7 @@ void lll_periph_prepare(void *param) /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_conn_peripheral_is_abort_cb, lll_conn_abort_cb, prepare_cb, 0U, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } static int init_reset(void) @@ -143,7 +143,7 @@ static int prepare_cb(struct lll_prepare_param *p) lll->data_chan_count); #else /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ data_chan_use = 0; - LL_ASSERT(0); + LL_ASSERT_DBG(0); #endif /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ } else { data_chan_use = lll_chan_sel_1(&lll->data_chan_use, @@ -355,7 +355,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_S(1); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c index 46e6aad63b7e..8178be1c7d26 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c @@ -100,7 +100,7 @@ void lll_peripheral_iso_prepare(void *param) /* Initiate HF clock start up */ err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); p = param; @@ -108,7 +108,7 @@ void lll_peripheral_iso_prepare(void *param) /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, abort_cb, prepare_cb, 0U, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } void lll_peripheral_iso_flush(uint16_t handle, struct lll_conn_iso_stream *lll) @@ -157,7 +157,7 @@ static int prepare_cb(struct lll_prepare_param *p) cis_lll = ull_conn_iso_lll_stream_sorted_get_by_group(cig_lll, &cis_handle_curr); } while (cis_lll && !cis_lll->active); - LL_ASSERT(cis_lll); + LL_ASSERT_DBG(cis_lll); /* Unconditionally set the prepared flag. * This flag ensures current CIG event does not pick up a new CIS becoming active when the @@ -170,7 +170,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); /* Pick the event_count calculated in the ULL prepare */ cis_lll->event_count = cis_lll->event_count_prepare; @@ -233,7 +233,7 @@ static int prepare_cb(struct lll_prepare_param *p) lll_chan_set(data_chan_use); node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); /* Encryption */ if (false) { @@ -410,7 +410,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Prepare is done */ ret = lll_prepare_done(cig_lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_S(1); @@ -451,7 +451,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); if (conn_lll->enc_rx) { radio_ccm_disable(); @@ -465,7 +465,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Get reference to CIG LLL context */ cig_lll = prepare_param->param; @@ -578,7 +578,7 @@ static void isr_rx(void *param) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); if (crc_ok) { struct node_rx_pdu *node_rx; @@ -586,7 +586,7 @@ static void isr_rx(void *param) /* Get reference to received PDU */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu_rx = (void *)node_rx->pdu; @@ -624,7 +624,7 @@ static void isr_rx(void *param) uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT(done); + LL_ASSERT_ERR(done); if (!radio_ccm_mic_is_valid()) { /* Record MIC invalid */ @@ -804,7 +804,7 @@ static void isr_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -884,7 +884,7 @@ static void isr_rx(void *param) #endif /* !CONFIG_BT_CTLR_PHY */ start_us = radio_tmr_start_us(0U, subevent_us); - LL_ASSERT(start_us == (subevent_us + 1U)); + LL_ASSERT_ERR(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -916,13 +916,13 @@ static void isr_tx(void *param) cis_lll = param; node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); #if defined(CONFIG_BT_CTLR_LE_ENC) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); #endif /* CONFIG_BT_CTLR_LE_ENC */ /* PHY */ @@ -999,7 +999,7 @@ static void isr_tx(void *param) #if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER) start_us = radio_tmr_start_us(0U, subevent_us); - LL_ASSERT(start_us == (subevent_us + 1U)); + LL_ASSERT_ERR(start_us == (subevent_us + 1U)); #else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Compensate for the 1 us added by radio_tmr_start_us() */ @@ -1091,7 +1091,7 @@ static void isr_prepare_subevent(void *param) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); /* Calculate the radio channel to use for next subevent */ @@ -1117,7 +1117,7 @@ static void isr_prepare_subevent_next_cis(void *param) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); /* Event counter value, 0-15 bit of cisEventCounter */ event_counter = cis_lll->event_count; @@ -1149,13 +1149,13 @@ static void isr_prepare_subevent_common(void *param) cis_lll = param; node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); #if defined(CONFIG_BT_CTLR_LE_ENC) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT(conn_lll != NULL); + LL_ASSERT_DBG(conn_lll != NULL); #endif /* CONFIG_BT_CTLR_LE_ENC */ /* PHY */ @@ -1236,7 +1236,7 @@ static void isr_prepare_subevent_common(void *param) } start_us = radio_tmr_start_us(0U, subevent_us); - LL_ASSERT(!trx_performed_bitmask || (start_us == (subevent_us + 1U))); + LL_ASSERT_ERR(!trx_performed_bitmask || (start_us == (subevent_us + 1U))); /* If no anchor point sync yet, continue to capture access address * timestamp. @@ -1297,7 +1297,7 @@ static void isr_done(void *param) payload_count_rx_flush_or_txrx_inc(cis_lll); e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); e->type = EVENT_DONE_EXTRA_TYPE_CIS; e->trx_performed_bitmask = trx_performed_bitmask; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index f1fab4b664de..7ae1f8bb6de2 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -125,10 +125,10 @@ void lll_scan_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } void lll_scan_isr_resume(void *param) @@ -391,7 +391,7 @@ static int common_prepare_cb(struct lll_prepare_param *p, bool is_resume) #endif /* !CONFIG_BT_CTLR_ADV_EXT */ node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_pkt_rx_set(node_rx->pdu); @@ -497,8 +497,8 @@ static int common_prepare_cb(struct lll_prepare_param *p, bool is_resume) ticks_at_event, lll->ticks_window, TICKER_NULL_PERIOD, TICKER_NULL_REMAINDER, TICKER_NULL_LAZY, TICKER_NULL_SLOT, ticker_stop_cb, lll, ticker_op_start_cb, (void *)__LINE__); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } #if defined(CONFIG_BT_CENTRAL) && defined(CONFIG_BT_CTLR_SCHED_ADVANCED) @@ -515,12 +515,12 @@ static int common_prepare_cb(struct lll_prepare_param *p, bool is_resume) retval = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, &mfy_after_cen_offset_get); - LL_ASSERT(!retval); + LL_ASSERT_ERR(!retval); } #endif /* CONFIG_BT_CENTRAL && CONFIG_BT_CTLR_SCHED_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_O(1); @@ -561,7 +561,7 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) /* Retain HF clock */ err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Yield to the pre-emptor, but be * resumed thereafter. @@ -629,7 +629,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); lll_done(param); } @@ -645,14 +645,14 @@ static void ticker_stop_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void ticker_op_start_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); } static void isr_rx(void *param) @@ -708,7 +708,7 @@ static void isr_rx(void *param) } node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu = (void *)node_rx->pdu; @@ -787,7 +787,7 @@ static void isr_tx(void *param) radio_switch_complete_and_disable(); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ @@ -795,7 +795,7 @@ static void isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_PRIVACY) @@ -865,7 +865,7 @@ static void isr_common_done(void *param) } node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_pkt_rx_set(node_rx->pdu); #if defined(CONFIG_BT_CTLR_PRIVACY) @@ -1006,7 +1006,7 @@ static void isr_abort(void *param) * detected in ULL. */ extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN); - LL_ASSERT(extra); + LL_ASSERT_ERR(extra); #endif /* CONFIG_BT_CTLR_ADV_EXT */ lll_isr_cleanup(param); @@ -1084,7 +1084,7 @@ static void isr_done_cleanup(void *param) * detected in ULL. */ extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN); - LL_ASSERT(extra); + LL_ASSERT_ERR(extra); } /* Prevent scan events in pipeline from being scheduled if duration has @@ -1103,7 +1103,7 @@ static void isr_done_cleanup(void *param) lll->is_aux_sched = 0U; node_rx2 = ull_pdu_rx_alloc(); - LL_ASSERT(node_rx2); + LL_ASSERT_ERR(node_rx2); node_rx2->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1126,7 +1126,7 @@ static void isr_done_cleanup(void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_LLL, 1U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } lll_isr_cleanup(param); @@ -1220,7 +1220,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1357,7 +1357,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1567,7 +1567,7 @@ static int isr_rx_scan_report(struct lll_scan *lll, uint8_t devmatch_ok, break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c index 0478fbc80011..6665dc7390e2 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c @@ -108,10 +108,10 @@ void lll_scan_aux_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } uint8_t lll_scan_aux_setup(struct pdu_adv *pdu, uint8_t pdu_phy, @@ -132,7 +132,7 @@ uint8_t lll_scan_aux_setup(struct pdu_adv *pdu, uint8_t pdu_phy, uint32_t pdu_us; uint8_t phy; - LL_ASSERT(pdu->type == PDU_ADV_TYPE_EXT_IND); + LL_ASSERT_DBG(pdu->type == PDU_ADV_TYPE_EXT_IND); /* Get reference to extended header */ pri_com_hdr = (void *)&pdu->adv_ext_ind; @@ -231,7 +231,7 @@ uint8_t lll_scan_aux_setup(struct pdu_adv *pdu, uint8_t pdu_phy, } node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); /* Store the lll context, aux_ptr and start of PDU in footer */ ftr = &(node_rx->rx_ftr); @@ -499,7 +499,7 @@ static int prepare_cb(struct lll_prepare_param *p) RADIO_PKT_CONF_PHY(lll_aux->phy)); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_pkt_rx_set(node_rx->pdu); @@ -616,12 +616,12 @@ static int prepare_cb(struct lll_prepare_param *p) ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, &mfy_after_cen_offset_get); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } #endif /* CONFIG_BT_CENTRAL && CONFIG_BT_CTLR_SCHED_ADVANCED */ ret = lll_prepare_done(lll_aux); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_O(1); @@ -640,7 +640,7 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) /* Auxiliary event shall not overlap as they are not periodically * scheduled. */ - LL_ASSERT(next != curr); + LL_ASSERT_DBG(next != curr); lll = ull_scan_lll_is_valid_get(next); if (lll) { @@ -674,10 +674,10 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX); - LL_ASSERT(e); + LL_ASSERT_ERR(e); #if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS) e->lll = param; @@ -711,7 +711,7 @@ static void isr_done(void *param) * generated thereafter by HCI as incomplete. */ node_rx = ull_pdu_rx_alloc(); - LL_ASSERT(node_rx); + LL_ASSERT_ERR(node_rx); node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -725,7 +725,7 @@ static void isr_done(void *param) struct event_done_extra *e; e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX); - LL_ASSERT(e); + LL_ASSERT_ERR(e); #if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS) e->lll = param; @@ -744,7 +744,7 @@ static void isr_done(void *param) mfy.param = scan_lll; ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_LLL, 1U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } lll_isr_cleanup(param); @@ -905,7 +905,7 @@ static void isr_rx(struct lll_scan *lll, struct lll_scan_aux *lll_aux, struct node_rx_pdu *node_rx2; node_rx2 = ull_pdu_rx_alloc(); - LL_ASSERT(node_rx2); + LL_ASSERT_ERR(node_rx2); node_rx2->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1055,7 +1055,7 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1210,7 +1210,7 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1421,7 +1421,7 @@ static void isr_tx(struct lll_scan_aux *lll_aux, void *pdu_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT_ERR(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1484,7 +1484,7 @@ static void isr_tx_scan_req_ull_schedule(void *param) struct node_rx_pdu *node_rx; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); isr_tx(param, node_rx->pdu, isr_rx_ull_schedule, param); } @@ -1498,7 +1498,7 @@ static void isr_tx_scan_req_lll_schedule(void *param) lll = node_rx_adv->rx_ftr.param; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); isr_tx(lll->lll_aux, node_rx->pdu, isr_rx_lll_schedule, param); } @@ -1509,7 +1509,7 @@ static void isr_tx_connect_req(void *param) struct node_rx_pdu *node_rx; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); isr_tx(param, (void *)node_rx->pdu, isr_rx_connect_rsp, param); } @@ -1559,7 +1559,7 @@ static void isr_rx_connect_rsp(void *param) * release it if failed to receive AUX_CONNECT_RSP PDU. */ rx = lll_aux->node_conn_rx; - LL_ASSERT(rx); + LL_ASSERT_DBG(rx); lll_aux->node_conn_rx = NULL; #if defined(CONFIG_BT_CTLR_PRIVACY) @@ -1577,7 +1577,7 @@ static void isr_rx_connect_rsp(void *param) pdu_tx = radio_pkt_scratch_get(); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu_rx = (void *)node_rx->pdu; trx_done = isr_rx_connect_rsp_check(lll, pdu_tx, pdu_rx, @@ -1660,7 +1660,7 @@ static void isr_rx_connect_rsp(void *param) /* Send message to flush Auxiliary PDU list */ node_rx = ull_pdu_rx_alloc(); - LL_ASSERT(node_rx); + LL_ASSERT_ERR(node_rx); node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1713,7 +1713,7 @@ static void isr_early_abort(void *param) struct event_done_extra *e; e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX); - LL_ASSERT(e); + LL_ASSERT_ERR(e); #if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS) e->lll = param; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index d549d914f591..fe5b9efdb989 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -101,11 +101,11 @@ void lll_sync_create_prepare(void *param) /* Request to start HF Clock */ err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(is_abort_cb, abort_cb, create_prepare_cb, 0, param); - LL_ASSERT(!err || err == -EINPROGRESS); + LL_ASSERT_ERR(!err || err == -EINPROGRESS); } void lll_sync_prepare(void *param) @@ -114,11 +114,11 @@ void lll_sync_prepare(void *param) /* Request to start HF Clock */ err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT(err == 0 || err == -EINPROGRESS); + LL_ASSERT_ERR(err == 0 || err == -EINPROGRESS); } void lll_sync_aux_prepare_cb(struct lll_sync *lll, @@ -137,7 +137,7 @@ void lll_sync_aux_prepare_cb(struct lll_sync *lll, RADIO_PKT_CONF_PHY(lll_aux->phy)); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_pkt_rx_set(node_rx->pdu); @@ -456,7 +456,7 @@ static int prepare_cb_common(struct lll_prepare_param *p, uint8_t chan_idx) lll_chan_set(chan_idx); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_pkt_rx_set(node_rx->pdu); @@ -510,7 +510,7 @@ static int prepare_cb_common(struct lll_prepare_param *p, uint8_t chan_idx) #endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_START_O(1); @@ -617,7 +617,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Get reference to LLL connection context */ lll = prepare_param->param; @@ -635,7 +635,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Extra done event, to check sync lost */ e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC; e->trx_cnt = 0U; @@ -745,7 +745,7 @@ static void isr_aux_setup(void *param) aux_start_us -= EVENT_JITTER_US; start_us = radio_tmr_start_us(0, aux_start_us); - LL_ASSERT(start_us == (aux_start_us + 1U)); + LL_ASSERT_ERR(start_us == (aux_start_us + 1U)); /* Setup header complete timeout */ hcto = start_us; @@ -951,7 +951,7 @@ static void isr_rx_adv_sync_estab(void *param) /* TODO: Combine the early exit with above if-then-else block */ #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - LL_ASSERT(!lll->node_cte_incomplete); + LL_ASSERT_DBG(!lll->node_cte_incomplete); #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ goto isr_rx_done; @@ -1137,7 +1137,7 @@ static void isr_rx_aux_chain(void *param) * generated thereafter by HCI as incomplete. */ node_rx = ull_pdu_rx_alloc(); - LL_ASSERT(node_rx); + LL_ASSERT_ERR(node_rx); node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1188,7 +1188,7 @@ static void isr_rx_done_cleanup(struct lll_sync *lll, uint8_t crc_ok, bool sync_ /* Calculate and place the drift information in done event */ e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC; e->trx_cnt = trx_cnt; @@ -1240,7 +1240,7 @@ static void isr_done(void *param) * generated thereafter by HCI as incomplete. */ node_rx = ull_pdu_rx_alloc(); - LL_ASSERT(node_rx); + LL_ASSERT_ERR(node_rx); node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1325,7 +1325,7 @@ static int iq_report_create_put(struct lll_sync *lll, uint8_t rssi_ready, uint8_ if (!lll->is_cte_incomplete && is_max_cte_reached(cfg->max_cte_count, cfg->cte_count)) { iq_report = ull_df_iq_report_alloc(); - LL_ASSERT(iq_report); + LL_ASSERT_ERR(iq_report); iq_report_create(lll, rssi_ready, packet_status, cfg->slot_durations, iq_report); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index 2083d8d7780a..d6931c9b7f59 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -101,11 +101,11 @@ void lll_sync_iso_create_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, create_prepare_cb, 0U, param); - LL_ASSERT(err == 0 || err == -EINPROGRESS); + LL_ASSERT_ERR(err == 0 || err == -EINPROGRESS); } void lll_sync_iso_prepare(void *param) @@ -113,10 +113,10 @@ void lll_sync_iso_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0U, param); - LL_ASSERT(err == 0 || err == -EINPROGRESS); + LL_ASSERT_ERR(err == 0 || err == -EINPROGRESS); } void lll_sync_iso_flush(uint8_t handle, struct lll_sync_iso *lll) @@ -288,7 +288,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_SYNC_ISO_INTERLEAVED */ } else { - LL_ASSERT(false); + LL_ASSERT_DBG(false); } } @@ -313,7 +313,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) * setting up radio for new PDU reception. */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); /* Encryption */ if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) && @@ -400,7 +400,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); /* Calculate ahead the next subevent channel index */ if (false) { @@ -422,7 +422,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_SYNC_ISO_INTERLEAVED */ } else { - LL_ASSERT(false); + LL_ASSERT_DBG(false); } return 0; @@ -468,7 +468,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Get reference to LLL connection context */ lll = prepare_param->param; @@ -486,7 +486,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Extra done event, to check sync lost */ e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC_ISO; e->estab_failed = 0U; @@ -531,7 +531,7 @@ static void isr_rx_estab(void *param) * for new PDU reception. */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); /* Get reference to received PDU and validate MIC for non-empty PDU */ pdu = (void *)node_rx->pdu; @@ -540,7 +540,7 @@ static void isr_rx_estab(void *param) uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT(done); + LL_ASSERT_ERR(done); mic_failure = !radio_ccm_mic_is_valid(); if (mic_failure) { @@ -555,7 +555,7 @@ static void isr_rx_estab(void *param) /* Calculate and place the drift information in done event */ e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC_ISO_ESTAB; e->estab_failed = lll->term_reason ? 1U : 0U; @@ -659,7 +659,7 @@ static void isr_rx(void *param) } else { se_offset_us = 0U; - LL_ASSERT(false); + LL_ASSERT_DBG(false); } radio_tmr_aa_save(radio_tmr_aa_get() - se_offset_us); @@ -702,7 +702,7 @@ static void isr_rx(void *param) } node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu = (void *)node_rx->pdu; @@ -753,7 +753,7 @@ static void isr_rx(void *param) uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT(done); + LL_ASSERT_ERR(done); mic_failure = !radio_ccm_mic_is_valid(); if (mic_failure) { @@ -850,7 +850,7 @@ static void isr_rx(void *param) * skip subevents as buffers at these high offset are unavailable. */ payload_offset = (lll->latency_event * lll->bn); - LL_ASSERT(payload_offset <= UINT8_MAX); + LL_ASSERT_ERR(payload_offset <= UINT8_MAX); /* Find the index of the (irc_curr)th bn = 1 Rx PDU * buffer. @@ -941,7 +941,7 @@ static void isr_rx(void *param) * these high offsets are unavailable. */ payload_offset = (lll->latency_event * lll->bn); - LL_ASSERT(payload_offset <= UINT8_MAX); + LL_ASSERT_ERR(payload_offset <= UINT8_MAX); /* Find the index of the (irc_curr)th bn = 1 Rx * PDU buffer. @@ -1062,7 +1062,7 @@ static void isr_rx(void *param) lll->bis_curr = sync_stream->bis_index; bis_idx = lll->bis_curr - 1U; } else { - LL_ASSERT(false); + LL_ASSERT_DBG(false); } } @@ -1261,7 +1261,7 @@ static void isr_rx(void *param) * available for setting up radio for new PDU reception. */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu = (void *)node_rx->pdu; } else { @@ -1288,7 +1288,7 @@ static void isr_rx(void *param) * available for setting up radio for new PDU reception. */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); pdu = (void *)node_rx->pdu; } else { @@ -1331,7 +1331,7 @@ static void isr_rx(void *param) nse = 0U; hcto = 0U; - LL_ASSERT(false); + LL_ASSERT_DBG(false); } if (trx_cnt) { @@ -1361,7 +1361,7 @@ static void isr_rx(void *param) overhead_us += radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); /* Add base clock jitter overhead */ overhead_us += (EVENT_CLOCK_JITTER_US << 1); - LL_ASSERT(EVENT_IFS_US > overhead_us); + LL_ASSERT_DBG(EVENT_IFS_US > overhead_us); /* Max. available clock jitter */ jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1; @@ -1376,13 +1376,13 @@ static void isr_rx(void *param) jitter_us = jitter_max_us; } - LL_ASSERT(hcto > jitter_us); + LL_ASSERT_DBG(hcto > jitter_us); hcto -= jitter_us; start_us = hcto; hcto = radio_tmr_start_us(0U, start_us); - LL_ASSERT(hcto == (start_us + 1U)); + LL_ASSERT_ERR(hcto == (start_us + 1U)); /* Add 8 us * subevents so far, as radio was setup to listen * 4 us early and subevents could have a 4 us drift each until @@ -1399,7 +1399,7 @@ static void isr_rx(void *param) start_us = hcto; hcto = radio_tmr_start_us(0U, start_us); - LL_ASSERT(hcto == (start_us + 1U)); + LL_ASSERT_ERR(hcto == (start_us + 1U)); hcto += ((EVENT_JITTER_US + EVENT_TICKER_RES_MARGIN_US + lll->window_widening_event_us) << 1) + @@ -1448,7 +1448,7 @@ static void isr_rx(void *param) #endif /* CONFIG_BT_CTLR_SYNC_ISO_INTERLEAVED */ } else { - LL_ASSERT(false); + LL_ASSERT_DBG(false); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1546,7 +1546,7 @@ static void isr_rx_done(void *param) } e = ull_event_done_extra_get(); - LL_ASSERT(e); + LL_ASSERT_ERR(e); /* Check if BIG terminate procedure received */ if (lll->term_reason) { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c index 9715b934e5e8..c724bd08e0bb 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c @@ -238,7 +238,7 @@ static void isr_rx(void *param) if (test_cte_len > 0) { /* Get free iq report node for next Rx operation. */ node_rx = ull_df_iq_report_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_df_iq_data_packet_set(node_rx->pdu, IQ_SAMPLE_TOTAL_CNT); } @@ -435,7 +435,7 @@ static uint8_t cte_rx_init(uint8_t expected_cte_len, uint8_t expected_cte_type, struct node_rx_iq_report *node_rx; node_rx = ull_df_iq_report_alloc_peek(1); - LL_ASSERT(node_rx); + LL_ASSERT_DBG(node_rx); radio_df_iq_data_packet_set(node_rx->pdu, IQ_SAMPLE_TOTAL_CNT); #else @@ -498,7 +498,7 @@ static uint8_t init(uint8_t chan, uint8_t phy, int8_t tx_power, /* Setup resources required by Radio */ err = lll_hfclock_on_wait(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Reset Radio h/w */ radio_reset(); @@ -744,7 +744,7 @@ uint8_t ll_test_end(uint16_t *num_rx) /* Release resources acquired for Radio */ err = lll_hfclock_off(); - LL_ASSERT(err >= 0); + LL_ASSERT_ERR(err >= 0); /* Stop coarse timer */ cntr_stop(); diff --git a/subsys/bluetooth/controller/ll_sw/ull.c b/subsys/bluetooth/controller/ll_sw/ull.c index bf15820ecd6d..4ff06e60fda9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull.c +++ b/subsys/bluetooth/controller/ll_sw/ull.c @@ -627,7 +627,7 @@ int ll_init(struct k_sem *sem_rx) hal_ticker_instance0_caller_id_get, hal_ticker_instance0_sched, hal_ticker_instance0_trigger_set); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* Initialize semaphore for ticker API blocking wait */ k_sem_init(&sem_ticker_api_cb, 0, 1); @@ -816,12 +816,12 @@ void ll_reset(void) #if defined(CONFIG_BT_CTLR_ADV_ISO) /* Reset adv iso sets */ err = ull_adv_iso_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CTLR_ADV_ISO */ /* Reset adv state */ err = ull_adv_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_BROADCASTER */ #if defined(CONFIG_BT_OBSERVER) @@ -829,43 +829,43 @@ void ll_reset(void) #if defined(CONFIG_BT_CTLR_SYNC_ISO) /* Reset sync iso sets */ err = ull_sync_iso_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CTLR_SYNC_ISO */ /* Reset periodic sync sets */ err = ull_sync_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */ /* Reset scan state */ err = ull_scan_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_OBSERVER */ #if defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) err = ull_peripheral_iso_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CTLR_PERIPHERAL_ISO */ #if defined(CONFIG_BT_CTLR_CENTRAL_ISO) err = ull_central_iso_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CTLR_CENTRAL_ISO */ #if defined(CONFIG_BT_CTLR_CONN_ISO) err = ull_conn_iso_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CTLR_CONN_ISO */ #if defined(CONFIG_BT_CTLR_ISO) err = ull_iso_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CTLR_ISO */ #if defined(CONFIG_BT_CONN) /* Reset conn role */ err = ull_conn_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); MFIFO_INIT(tx_ack); #endif /* CONFIG_BT_CONN */ @@ -912,7 +912,7 @@ void ll_reset(void) retval = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!retval); + LL_ASSERT_ERR(!retval); #if !defined(CONFIG_BT_CTLR_ZLI) /* LLL reset must complete before returning - wait for @@ -925,7 +925,7 @@ void ll_reset(void) #if defined(CONFIG_BT_BROADCASTER) /* Finalize after adv state LLL context reset */ err = ull_adv_reset_finalize(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_BROADCASTER */ /* Reset/End DTM Tx or Rx commands */ @@ -938,7 +938,7 @@ void ll_reset(void) /* Common to init and reset */ err = init_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #if defined(CONFIG_BT_CTLR_DF) /* Direction Finding has to be reset after ull init_reset call because @@ -946,7 +946,7 @@ void ll_reset(void) * in common ull init_reset. */ err = ull_df_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif #if defined(CONFIG_BT_CTLR_SET_HOST_FEATURE) @@ -1101,7 +1101,7 @@ void ll_rx_dequeue(void) link = memq_dequeue(memq_ll_rx.tail, &memq_ll_rx.head, (void **)&rx); - LL_ASSERT(link); + LL_ASSERT_DBG(link); ll_rx_link_release(link); @@ -1129,7 +1129,7 @@ void ll_rx_dequeue(void) while (rx_curr) { memq_link_t *link_free; - LL_ASSERT(loop); + LL_ASSERT_ERR(loop); loop--; link_free = rx_curr->hdr.link; @@ -1154,7 +1154,7 @@ void ll_rx_dequeue(void) struct lll_adv_aux *lll_aux; adv = ull_adv_set_get(rx->hdr.handle); - LL_ASSERT(adv); + LL_ASSERT_DBG(adv); lll_aux = adv->lll.aux; if (lll_aux) { @@ -1174,11 +1174,11 @@ void ll_rx_dequeue(void) break; } - LL_ASSERT(!lll_conn->link_tx_free); + LL_ASSERT_DBG(!lll_conn->link_tx_free); memq_link_t *memq_link = memq_deinit(&lll_conn->memq_tx.head, &lll_conn->memq_tx.tail); - LL_ASSERT(memq_link); + LL_ASSERT_DBG(memq_link); lll_conn->link_tx_free = memq_link; @@ -1223,13 +1223,13 @@ void ll_rx_dequeue(void) memq_link_t *memq_link; conn_lll = lll->conn; - LL_ASSERT(conn_lll); + LL_ASSERT_DBG(conn_lll); lll->conn = NULL; - LL_ASSERT(!conn_lll->link_tx_free); + LL_ASSERT_DBG(!conn_lll->link_tx_free); memq_link = memq_deinit(&conn_lll->memq_tx.head, &conn_lll->memq_tx.tail); - LL_ASSERT(memq_link); + LL_ASSERT_DBG(memq_link); conn_lll->link_tx_free = memq_link; conn = HDR_LLL2ULL(conn_lll); @@ -1294,7 +1294,7 @@ void ll_rx_dequeue(void) scan->is_enabled = 0U; #else /* !CONFIG_BT_CENTRAL */ } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); #endif /* !CONFIG_BT_CENTRAL */ } @@ -1416,11 +1416,11 @@ void ll_rx_dequeue(void) * code block. */ case NODE_RX_TYPE_NONE: - LL_ASSERT(rx->hdr.type != NODE_RX_TYPE_NONE); + LL_ASSERT_DBG(rx->hdr.type != NODE_RX_TYPE_NONE); break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -1432,11 +1432,11 @@ void ll_rx_dequeue(void) struct ll_scan_set *scan; adv = ull_adv_is_enabled_get(0); - LL_ASSERT(adv); + LL_ASSERT_DBG(adv); adv->is_enabled = 0U; scan = ull_scan_is_enabled_get(0); - LL_ASSERT(scan); + LL_ASSERT_DBG(scan); scan->is_enabled = 0U; @@ -1520,7 +1520,7 @@ void ll_rx_mem_release(void **node_rx) #endif /* CONFIG_BT_CENTRAL */ } else { - LL_ASSERT(!cc->status); + LL_ASSERT_DBG(!cc->status); } } @@ -1607,7 +1607,7 @@ void ll_rx_mem_release(void **node_rx) * code block. */ case NODE_RX_TYPE_NONE: - LL_ASSERT(rx_free->hdr.type != NODE_RX_TYPE_NONE); + LL_ASSERT_DBG(rx_free->hdr.type != NODE_RX_TYPE_NONE); ll_rx_link_quota_inc(); ll_rx_release(rx_free); break; @@ -1652,7 +1652,7 @@ void ll_rx_mem_release(void **node_rx) break; } else { - LL_ASSERT(status == BT_HCI_ERR_OP_CANCELLED_BY_HOST); + LL_ASSERT_DBG(status == BT_HCI_ERR_OP_CANCELLED_BY_HOST); /* Fall through and release sync context */ } @@ -1716,12 +1716,12 @@ void ll_rx_mem_release(void **node_rx) memq_link_t *link; conn = ll_conn_get(rx_free->hdr.handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); - LL_ASSERT(!conn->lll.link_tx_free); + LL_ASSERT_DBG(!conn->lll.link_tx_free); link = memq_deinit(&conn->lll.memq_tx.head, &conn->lll.memq_tx.tail); - LL_ASSERT(link); + LL_ASSERT_DBG(link); conn->lll.link_tx_free = link; ll_conn_release(conn); @@ -1735,7 +1735,7 @@ void ll_rx_mem_release(void **node_rx) case NODE_RX_TYPE_EVENT_DONE: default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -1747,7 +1747,7 @@ void ll_rx_mem_release(void **node_rx) static void ll_rx_link_quota_update(int8_t delta) { - LL_ASSERT(delta <= 0 || mem_link_rx.quota_pdu < RX_CNT); + LL_ASSERT_DBG(delta <= 0 || mem_link_rx.quota_pdu < RX_CNT); mem_link_rx.quota_pdu += delta; } @@ -1837,7 +1837,7 @@ void ll_tx_ack_put(uint16_t handle, struct node_tx *node_tx) uint8_t idx; idx = MFIFO_ENQUEUE_GET(tx_ack, (void **)&tx); - LL_ASSERT(tx); + LL_ASSERT_ERR(tx); tx->handle = handle; tx->node = node_tx; @@ -1868,7 +1868,7 @@ void ll_radio_state_abort(void) ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } uint32_t ll_radio_state_is_idle(void) @@ -2053,7 +2053,7 @@ int ull_disable(void *lll) mfy.param = lll; ret = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); err = k_sem_take(&sem, ULL_DISABLE_TIMEOUT); if (err != 0) { @@ -2195,7 +2195,7 @@ void ull_prepare_dequeue(uint8_t caller_id) /* Assert if we exceed iterations processing the prepare queue */ - LL_ASSERT(loop); + LL_ASSERT_ERR(loop); loop--; /* Let LLL invoke the `prepare` interface if radio not in active @@ -2210,7 +2210,7 @@ void ull_prepare_dequeue(uint8_t caller_id) mfy.param = next; ret = mayfly_enqueue(caller_id, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } MFIFO_DEQUEUE(prep); @@ -2391,14 +2391,14 @@ static inline int init_reset(void) /* Acquire a link to initialize ull rx memq */ link = mem_acquire(&mem_link_rx.free); - LL_ASSERT(link); + LL_ASSERT_DBG(link); /* Initialize ull rx memq */ MEMQ_INIT(ull_rx, link); /* Acquire a link to initialize ll rx memq */ link = mem_acquire(&mem_link_rx.free); - LL_ASSERT(link); + LL_ASSERT_DBG(link); /* Initialize ll rx memq */ MEMQ_INIT(ll_rx, link); @@ -2428,29 +2428,29 @@ static void perform_lll_reset(void *param) /* Reset LLL */ err = lll_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #if defined(CONFIG_BT_BROADCASTER) /* Reset adv state */ err = lll_adv_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_BROADCASTER */ #if defined(CONFIG_BT_OBSERVER) /* Reset scan state */ err = lll_scan_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_OBSERVER */ #if defined(CONFIG_BT_CONN) /* Reset conn role */ err = lll_conn_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_CTLR_DF) err = lll_df_reset(); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #endif /* CONFIG_BT_CTLR_DF */ #if !defined(CONFIG_BT_CTLR_ZLI) @@ -2611,7 +2611,7 @@ static void rx_demux(void *param) link = memq_peek(memq_ull_rx.head, memq_ull_rx.tail, (void **)&rx); if (link) { - LL_ASSERT(rx); + LL_ASSERT_DBG(rx); #if defined(CONFIG_BT_CONN) link_tx = ull_conn_ack_by_last_peek(rx->ack_last, &handle, &tx); @@ -2910,7 +2910,7 @@ static inline void rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx) (void)memq_dequeue(memq_ull_rx.tail, &memq_ull_rx.head, NULL); conn = ll_conn_get(rx->handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); if (ull_cp_cc_awaiting_established(conn)) { ull_cp_cc_established(conn, BT_HCI_ERR_SUCCESS); @@ -3021,7 +3021,7 @@ static inline void rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx) rx_demux_rx_proprietary(link, rx, memq_ull_rx.tail, &memq_ull_rx.head); #else - LL_ASSERT(0); + LL_ASSERT_DBG(0); #endif /* CONFIG_BT_CTLR_USER_EXT */ } break; @@ -3037,7 +3037,7 @@ static inline void rx_demux_event_done(memq_link_t *link, /* Decrement prepare reference if ULL will not resume */ ull_hdr = done->param; if (ull_hdr) { - LL_ASSERT(ull_ref_get(ull_hdr)); + LL_ASSERT_DBG(ull_ref_get(ull_hdr)); ull_ref_dec(ull_hdr); } else { /* No reference count decrement, event placed back as resume event in the pipeline. @@ -3127,14 +3127,14 @@ static inline void rx_demux_event_done(memq_link_t *link, break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } /* Release done */ done->extra.type = 0U; release = RXFIFO_RELEASE(done, link, done); - LL_ASSERT(release == done); + LL_ASSERT_DBG(release == done); #if defined(CONFIG_BT_CTLR_LOW_LAT_ULL_DONE) /* dequeue prepare pipeline */ @@ -3218,7 +3218,7 @@ void *ull_rxfifo_release(uint8_t s, uint8_t n, uint8_t f, uint8_t *l, uint8_t *m */ uint32_t ull_get_wrapped_time_us(uint32_t time_now_us, int32_t time_diff_us) { - LL_ASSERT(time_now_us <= ULL_TIME_WRAPPING_POINT_US); + LL_ASSERT_DBG(time_now_us <= ULL_TIME_WRAPPING_POINT_US); uint32_t result = ((uint64_t)time_now_us + ULL_TIME_SPAN_FULL_US + time_diff_us) % ((uint64_t)ULL_TIME_SPAN_FULL_US); diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv.c b/subsys/bluetooth/controller/ll_sw/ull_adv.c index 18f3f24b11db..f9f1ee78afe4 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv.c @@ -206,7 +206,7 @@ uint8_t ll_adv_set_hci_handle_get(uint8_t handle) struct ll_adv_set *adv; adv = ull_adv_set_get(handle); - LL_ASSERT(adv && adv->is_created); + LL_ASSERT_DBG(adv && adv->is_created); return adv->hci_handle; } @@ -442,8 +442,8 @@ uint8_t ll_adv_params_set(uint16_t interval, uint8_t adv_type, if (pdu->len == 0U) { adv->ad_data_backup.len = 0U; } else { - LL_ASSERT(pdu->len >= - offsetof(struct pdu_adv_adv_ind, data)); + LL_ASSERT_DBG(pdu->len >= + offsetof(struct pdu_adv_adv_ind, data)); adv->ad_data_backup.len = pdu->len - offsetof(struct pdu_adv_adv_ind, data); @@ -1970,9 +1970,9 @@ static uint32_t ticker_update_rand(struct ll_adv_set *adv, uint32_t ticks_delay_ ticks_adjust_minus, 0, 0, 0, 0, fp_op_func, adv); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY) || - (fp_op_func == NULL)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY) || + (fp_op_func == NULL)); return random_delay; } @@ -2090,7 +2090,7 @@ void ull_adv_done(struct node_rx_event_done *done) } handle = ull_adv_handle_get(adv); - LL_ASSERT(handle < BT_CTLR_ADV_SET); + LL_ASSERT_DBG(handle < BT_CTLR_ADV_SET); rx->hdr.type = NODE_RX_TYPE_EXT_ADV_TERMINATE; rx->hdr.handle = handle; @@ -2115,8 +2115,8 @@ void ull_adv_done(struct node_rx_event_done *done) ticker_stop_ext_op_cb, adv); } - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); #endif /* CONFIG_BT_CTLR_ADV_EXT */ } #endif /* CONFIG_BT_CTLR_ADV_EXT || CONFIG_BT_CTLR_JIT_SCHEDULING */ @@ -2369,7 +2369,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, (lazy != TICKER_LAZY_MUST_EXPIRE)) { /* Increment prepare reference count */ ref = ull_ref_inc(&adv->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); #if defined(CONFIG_BT_CTLR_ADV_EXT) && (CONFIG_BT_CTLR_ADV_AUX_SET > 0) && \ defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) @@ -2377,7 +2377,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint32_t ticks_to_expire; uint32_t other_remainder = 0U; - LL_ASSERT(context->other_expire_info); + LL_ASSERT_DBG(context->other_expire_info); /* Adjust ticks to expire based on remainder value */ ticks_to_expire = context->other_expire_info->ticks_to_expire; @@ -2405,7 +2405,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); #if defined(CONFIG_BT_CTLR_JIT_SCHEDULING) || \ (defined(CONFIG_BT_CTLR_ADV_EXT) && \ @@ -2496,7 +2496,7 @@ static void ticker_update_op_cb(uint32_t status, void *param) /* Reset update requested */ ticker_update_ack = ticker_update_req; -#if defined(CONFIG_BT_PERIPHERAL) && (defined(CONFIG_BT_ASSERT) || defined(CONFIG_ASSERT)) +#if defined(CONFIG_BT_PERIPHERAL) struct ll_adv_set *adv = param; struct pdu_adv *pdu = lll_adv_data_peek(&adv->lll); bool connectable = (pdu->type == PDU_ADV_TYPE_ADV_IND) || @@ -2508,13 +2508,13 @@ static void ticker_update_op_cb(uint32_t status, void *param) 0; #endif /* CONFIG_BT_PERIPHERAL && (CONFIG_BT_ASSERT || CONFIG_ASSERT) */ - LL_ASSERT(status == TICKER_STATUS_SUCCESS || - param == ull_disable_mark_get() || + LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || + (param == ull_disable_mark_get()) || #if defined(CONFIG_BT_PERIPHERAL) - /* if using connectable adv and lll.conn is 0 -> a connection is underway */ - (connectable && !adv->lll.conn) || + /* if using connectable adv and lll.conn is 0 -> a connection is underway */ + (connectable && !adv->lll.conn) || #endif /* CONFIG_BT_PERIPHERAL */ - 0); + 0); } #if defined(CONFIG_BT_PERIPHERAL) @@ -2527,13 +2527,13 @@ static void ticker_stop_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint32_t ret; handle = ull_adv_handle_get(adv); - LL_ASSERT(handle < BT_CTLR_ADV_SET); + LL_ASSERT_DBG(handle < BT_CTLR_ADV_SET); ret = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, TICKER_ID_ADV_BASE + handle, ticker_stop_op_cb, adv); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } static void ticker_stop_op_cb(uint32_t status, void *param) @@ -2560,7 +2560,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void adv_disable(void *param) @@ -2581,14 +2581,14 @@ static void adv_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } else { /* No pending LLL events */ disabled_cb(&adv->lll); @@ -2604,11 +2604,11 @@ static void disabled_cb(void *param) adv = ((struct lll_hdr *)param)->parent; - LL_ASSERT(adv->link_cc_free); + LL_ASSERT_DBG(adv->link_cc_free); link = adv->link_cc_free; adv->link_cc_free = NULL; - LL_ASSERT(adv->node_rx_cc_free); + LL_ASSERT_DBG(adv->node_rx_cc_free); rx = adv->node_rx_cc_free; adv->node_rx_cc_free = NULL; @@ -2628,7 +2628,7 @@ static void disabled_cb(void *param) ll_rx_put(link, rx); handle = ull_adv_handle_get(adv); - LL_ASSERT(handle < BT_CTLR_ADV_SET); + LL_ASSERT_DBG(handle < BT_CTLR_ADV_SET); rx = (void *)adv->lll.node_rx_adv_term; rx->hdr.type = NODE_RX_TYPE_EXT_ADV_TERMINATE; @@ -2649,9 +2649,9 @@ static void conn_release(struct ll_adv_set *adv) struct lll_conn *lll = adv->lll.conn; memq_link_t *link; - LL_ASSERT(!lll->link_tx_free); + LL_ASSERT_DBG(!lll->link_tx_free); link = memq_deinit(&lll->memq_tx.head, &lll->memq_tx.tail); - LL_ASSERT(link); + LL_ASSERT_DBG(link); lll->link_tx_free = link; ll_conn_release(lll->hdr.parent); @@ -2702,13 +2702,13 @@ static void ticker_stop_aux_op_cb(uint32_t status, void *param) static struct mayfly mfy = {0, 0, &link, NULL, aux_disable}; uint32_t ret; - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); /* Check if any pending LLL events that need to be aborted */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void aux_disable(void *param) @@ -2723,7 +2723,7 @@ static void aux_disable(void *param) aux = HDR_LLL2ULL(lll_aux); hdr = &aux->ull; if (ull_ref_get(hdr)) { - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = adv; hdr->disabled_cb = aux_disabled_cb; } else { @@ -2741,8 +2741,8 @@ static void aux_disabled_cb(void *param) TICKER_USER_ID_ULL_HIGH, (TICKER_ID_ADV_BASE + handle), ticker_stop_ext_op_cb, param); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } static void ticker_stop_ext_op_cb(uint32_t status, void *param) @@ -2762,7 +2762,7 @@ static void ticker_stop_ext_op_cb(uint32_t status, void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void ext_disable(void *param) @@ -2783,14 +2783,14 @@ static void ext_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = ext_disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } else { /* No pending LLL events */ ext_disabled_cb(&adv->lll); @@ -2852,7 +2852,7 @@ static inline uint8_t disable(uint8_t handle) #endif /* CONFIG_BT_PERIPHERAL */ mark = ull_disable_mark(adv); - LL_ASSERT(mark == adv); + LL_ASSERT_DBG(mark == adv); #if defined(CONFIG_BT_PERIPHERAL) if (adv->lll.is_hdcd) { @@ -2863,7 +2863,7 @@ static inline uint8_t disable(uint8_t handle) ret = ull_ticker_status_take(ret, &ret_cb); if (ret) { mark = ull_disable_unmark(adv); - LL_ASSERT(mark == adv); + LL_ASSERT_DBG(mark == adv); return BT_HCI_ERR_CMD_DISALLOWED; } @@ -2877,16 +2877,16 @@ static inline uint8_t disable(uint8_t handle) ret = ull_ticker_status_take(ret, &ret_cb); if (ret) { mark = ull_disable_unmark(adv); - LL_ASSERT(mark == adv); + LL_ASSERT_DBG(mark == adv); return BT_HCI_ERR_CMD_DISALLOWED; } err = ull_disable(&adv->lll); - LL_ASSERT(!err || (err == -EALREADY)); + LL_ASSERT_ERR(!err || (err == -EALREADY)); mark = ull_disable_unmark(adv); - LL_ASSERT(mark == adv); + LL_ASSERT_DBG(mark == adv); #if defined(CONFIG_BT_CTLR_ADV_EXT) && (CONFIG_BT_CTLR_ADV_AUX_SET > 0) struct lll_adv_aux *lll_aux = adv->lll.aux; @@ -3043,7 +3043,7 @@ static inline uint8_t *adv_pdu_adva_get(struct pdu_adv *pdu) /* All extended PDUs have AdvA at the same offset in common header */ if (pdu->type == PDU_ADV_TYPE_EXT_IND) { - LL_ASSERT(hdr_flags.adv_addr); + LL_ASSERT_DBG(hdr_flags.adv_addr); return &com_hdr->ext_hdr_adv_data[1]; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index d77c004069e0..8701f3f65fa9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -256,7 +256,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Get the reference to auxiliary PDU chain */ pdu_prev = lll_adv_aux_data_alloc(adv->lll.aux, &idx); - LL_ASSERT(idx == sec_idx); + LL_ASSERT_DBG(idx == sec_idx); /* Current auxiliary PDU */ pdu = pdu_prev; @@ -269,7 +269,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, pdu_parent = lll_adv_aux_data_alloc(adv->lll.aux, &idx); - LL_ASSERT(idx == sec_idx); + LL_ASSERT_DBG(idx == sec_idx); /* Remove/Release any previous chain PDU * allocations @@ -340,7 +340,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, 0U, hdr_data); ad_len_prev = hdr_data[ULL_ADV_HDR_DATA_LEN_OFFSET]; - LL_ASSERT(!err || (err == BT_HCI_ERR_PACKET_TOO_LONG)); + LL_ASSERT_DBG(!err || (err == BT_HCI_ERR_PACKET_TOO_LONG)); /* Check of max supported AD data len */ ad_len_total += ad_len_prev; @@ -363,8 +363,8 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, pdu_chain_prev = lll_adv_pdu_linked_next_get(pdu_prev); pdu_chain = lll_adv_pdu_linked_next_get(pdu); - LL_ASSERT((pdu_chain_prev && pdu_chain) || - (!pdu_chain_prev && !pdu_chain)); + LL_ASSERT_DBG((pdu_chain_prev && pdu_chain) || + (!pdu_chain_prev && !pdu_chain)); } while (pdu_chain_prev); /* No AD data overflow */ @@ -408,7 +408,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ULL_ADV_PDU_HDR_FIELD_AD_DATA_APPEND, 0U, hdr_data); - LL_ASSERT((!chain_err) || (chain_err == BT_HCI_ERR_PACKET_TOO_LONG)); + LL_ASSERT_DBG((!chain_err) || (chain_err == BT_HCI_ERR_PACKET_TOO_LONG)); /* FIXME: the code has become quite complex, an alternative and simpler * implementation would be to first fill an array with all data that @@ -456,7 +456,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, chain_err = ull_adv_aux_pdu_set_clear(adv, pdu_prev, pdu, chain_add_fields, 0U, hdr_data); - LL_ASSERT(chain_err == 0U); + LL_ASSERT_DBG(chain_err == 0U); /* * in the next PDU we still need to add ad_len_chain bytes of data * but we do not have overflow, since we already added @@ -495,7 +495,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); - LL_ASSERT(pdu_chain); + LL_ASSERT_ERR(pdu_chain); /* Populate the appended chain PDU */ pdu_chain->type = PDU_ADV_TYPE_AUX_CHAIN_IND; @@ -509,7 +509,8 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, hdr_chain = (void *)&com_hdr_chain->ext_hdr_adv_data[0]; dptr_chain = (void *)hdr_chain; - LL_ASSERT(dptr_chain); + LL_ASSERT_DBG(dptr_chain); + /* Flags */ *dptr_chain = 0U; @@ -781,7 +782,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, } /* Scannable advertising shall have aux context allocated */ - LL_ASSERT(lll->aux); + LL_ASSERT_DBG(lll->aux); /* Get reference to previous secondary channel PDU */ sec_pdu_prev = lll_adv_aux_data_peek(lll->aux); @@ -1046,7 +1047,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, err = ull_adv_aux_pdu_set_clear(adv, sr_pdu_prev, sr_pdu, hdr_add_fields, 0U, hdr_data); - LL_ASSERT(!err || (err == BT_HCI_ERR_PACKET_TOO_LONG)); + LL_ASSERT_DBG(!err || (err == BT_HCI_ERR_PACKET_TOO_LONG)); /* Get PDUs previous AD data length */ ad_len_prev = @@ -1073,8 +1074,8 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, pdu_chain_prev = lll_adv_pdu_linked_next_get(sr_pdu_prev); pdu_chain = lll_adv_pdu_linked_next_get(sr_pdu); - LL_ASSERT((pdu_chain_prev && pdu_chain) || - (!pdu_chain_prev && !pdu_chain)); + LL_ASSERT_DBG((pdu_chain_prev && pdu_chain) || + (!pdu_chain_prev && !pdu_chain)); } while (pdu_chain_prev); if (err == BT_HCI_ERR_PACKET_TOO_LONG) { @@ -1141,7 +1142,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); - LL_ASSERT(pdu_chain); + LL_ASSERT_ERR(pdu_chain); /* Populate the appended chain PDU */ pdu_chain->type = PDU_ADV_TYPE_AUX_CHAIN_IND; @@ -1528,8 +1529,8 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, lll = &adv->lll; /* Can't have both flags set here since both use 'hdr_data' param */ - LL_ASSERT(!(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADVA) || - !(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AD_DATA)); + LL_ASSERT_DBG(!(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADVA) || + !(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AD_DATA)); /* Get reference to previous primary PDU data */ pri_pdu_prev = lll_adv_data_peek(lll); @@ -1579,7 +1580,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (!lll_aux) { aux = ull_adv_aux_acquire(lll); if (!aux) { - LL_ASSERT(pri_pdu != pri_pdu_prev); + LL_ASSERT_DBG(pri_pdu != pri_pdu_prev); return BT_HCI_ERR_MEM_CAPACITY_EXCEEDED; } @@ -2566,7 +2567,7 @@ void ull_adv_sync_started_stopped(struct ll_adv_aux_set *aux) struct ll_adv_sync_set *sync; uint8_t aux_handle; - LL_ASSERT(lll_sync); + LL_ASSERT_DBG(lll_sync); sync = HDR_LLL2ULL(lll_sync); aux_handle = ull_adv_aux_handle_get(aux); @@ -2760,7 +2761,7 @@ void ull_adv_aux_offset_get(struct ll_adv_set *adv) mfy.param = adv; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } #endif /* !CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ @@ -2886,7 +2887,7 @@ void ull_adv_aux_chain_pdu_duplicate(struct pdu_adv *pdu_prev, if (!pdu_chain) { /* Get a new chain PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); - LL_ASSERT(pdu_chain); + LL_ASSERT_ERR(pdu_chain); /* Copy previous chain PDU into new chain PDU */ (void)memcpy(pdu_chain, pdu_chain_prev, @@ -3240,7 +3241,7 @@ static void mfy_aux_offset_get(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT(success); + LL_ASSERT_ERR(success); /* FIXME: If the reference ticks change then implement the * compensation by adding the difference to the @@ -3249,9 +3250,9 @@ static void mfy_aux_offset_get(void *param) * ticker expiry that update the ticks_current. * For now assert until the fix implementation is added. */ - LL_ASSERT((ticks_current == ticks_previous) || retry--); + LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); - LL_ASSERT(id != TICKER_NULL); + LL_ASSERT_ERR(id != TICKER_NULL); } while (id != ticker_id); /* Adjust ticks to expire based on remainder value */ @@ -3326,7 +3327,7 @@ static void mfy_aux_offset_get(void *param) ticks_elapsed = ticker_ticks_diff_get(ticks_now, ticks_current); ticks_to_start = HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_XTAL_US) - HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_PREEMPT_MIN_US); - LL_ASSERT(ticks_elapsed < ticks_to_start); + LL_ASSERT_ERR(ticks_elapsed < ticks_to_start); } static void ticker_op_cb(uint32_t status, void *param) @@ -3358,7 +3359,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&aux->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); #if defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) #if defined(CONFIG_BT_CTLR_ADV_PERIODIC) @@ -3374,7 +3375,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint32_t ticks_to_expire; uint32_t sync_remainder_us = 0U; - LL_ASSERT(context->other_expire_info); + LL_ASSERT_DBG(context->other_expire_info); /* Reduce a tick for negative remainder and return positive remainder * value. @@ -3418,7 +3419,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); #if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && !defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) struct ll_adv_set *adv; @@ -3441,8 +3442,8 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, #if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) static void ticker_update_op_cb(uint32_t status, void *param) { - LL_ASSERT(status == TICKER_STATUS_SUCCESS || - param == ull_disable_mark_get()); + LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || + (param == ull_disable_mark_get())); } #endif /* !CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_iso.c b/subsys/bluetooth/controller/ll_sw/ull_adv_iso.c index f8f7cb35d64a..775baf1c63e7 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_iso.c @@ -507,7 +507,7 @@ static uint8_t big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bi lll_adv_iso->max_sdu = max_sdu; res = util_saa_le32(lll_adv_iso->seed_access_addr, big_handle); - LL_ASSERT(!res); + LL_ASSERT_DBG(!res); (void)lll_csrand_get(lll_adv_iso->base_crc_init, sizeof(lll_adv_iso->base_crc_init)); @@ -604,11 +604,11 @@ static uint8_t big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bi /* Calculate GSK */ err = bt_crypto_h7(BIG1, bcode, igltk); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); err = bt_crypto_h6(igltk, BIG2, gltk); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); err = bt_crypto_h8(gltk, big_info->gskd, BIG3, gsk); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* Prepare the CCM parameters */ ccm_tx = &lll_adv_iso->ccm_tx; @@ -820,7 +820,7 @@ int ull_adv_iso_reset(void) } mark = ull_disable_mark(adv_iso); - LL_ASSERT(mark == adv_iso); + LL_ASSERT_DBG(mark == adv_iso); /* Stop event scheduling */ ret_cb = TICKER_STATUS_BUSY; @@ -830,20 +830,20 @@ int ull_adv_iso_reset(void) ret = ull_ticker_status_take(ret, &ret_cb); if (ret) { mark = ull_disable_unmark(adv_iso); - LL_ASSERT(mark == adv_iso); + LL_ASSERT_DBG(mark == adv_iso); /* Assert as there shall be a ticker instance active */ - LL_ASSERT(false); + LL_ASSERT_DBG(false); return BT_HCI_ERR_CMD_DISALLOWED; } /* Abort any events in LLL pipeline */ err = ull_disable(adv_iso_lll); - LL_ASSERT(!err || (err == -EALREADY)); + LL_ASSERT_ERR(!err || (err == -EALREADY)); mark = ull_disable_unmark(adv_iso); - LL_ASSERT(mark == adv_iso); + LL_ASSERT_DBG(mark == adv_iso); /* Reset associated streams */ while (adv_iso_lll->num_bis--) { @@ -970,7 +970,7 @@ void ull_adv_iso_offset_get(struct ll_adv_sync_set *sync) mfy.param = sync; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } #if defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) @@ -1071,8 +1071,8 @@ void ull_adv_iso_done_terminate(struct node_rx_event_done *done) ret = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, (TICKER_ID_ADV_ISO_BASE + lll->handle), ticker_stop_op_cb, adv_iso); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); /* Invalidate the handle */ lll->handle = LLL_ADV_HANDLE_INVALID; @@ -1115,10 +1115,10 @@ void ull_adv_iso_stream_release(struct ll_adv_iso_set *adv_iso) stream_handle = lll->stream_handle[lll->num_bis]; stream = ull_adv_iso_stream_get(stream_handle); - LL_ASSERT(!stream->link_tx_free); + LL_ASSERT_DBG(!stream->link_tx_free); link = memq_deinit(&stream->memq_tx.head, &stream->memq_tx.tail); - LL_ASSERT(link); + LL_ASSERT_DBG(link); stream->link_tx_free = link; dp = stream->dp; @@ -1220,7 +1220,7 @@ static uint8_t ptc_calc(const struct lll_adv_iso *lll, uint32_t event_spacing, * running buffer offset related to nse. Fix ptc and ptc_curr definitions, * until then lets have an assert check here. */ - LL_ASSERT(ptc <= BIT_MASK(4)); + LL_ASSERT_DBG(ptc <= BIT_MASK(4)); return ptc; } @@ -1378,11 +1378,11 @@ static void adv_iso_chm_complete_commit(struct lll_adv_iso *lll_iso) adv = HDR_LLL2ULL(lll_iso->adv); err = ull_adv_sync_pdu_alloc(adv, ULL_ADV_PDU_EXTRA_DATA_ALLOC_IF_EXIST, &pdu_prev, &pdu, NULL, NULL, &ter_idx); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* Copy content */ err = ull_adv_sync_duplicate(pdu_prev, pdu); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* Get the current ACAD */ acad = ull_adv_sync_get_acad(pdu, &acad_len); @@ -1390,7 +1390,7 @@ static void adv_iso_chm_complete_commit(struct lll_adv_iso *lll_iso) lll_sync = adv->lll.sync; /* Dev assert if ACAD empty */ - LL_ASSERT(acad_len); + LL_ASSERT_DBG(acad_len); /* Find the BIGInfo */ len = acad_len; @@ -1404,12 +1404,13 @@ static void adv_iso_chm_complete_commit(struct lll_adv_iso *lll_iso) ad_len += 1U; - LL_ASSERT(ad_len <= len); + LL_ASSERT_DBG(ad_len <= len); ad += ad_len; len -= ad_len; } while (len); - LL_ASSERT(len); + + LL_ASSERT_DBG(len); /* Get reference to BIGInfo */ bi = (void *)&ad[PDU_ADV_DATA_HEADER_DATA_OFFSET]; @@ -1474,11 +1475,11 @@ static void mfy_iso_offset_get(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT(success); + LL_ASSERT_ERR(success); - LL_ASSERT((ticks_current == ticks_previous) || retry--); + LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); - LL_ASSERT(id != TICKER_NULL); + LL_ASSERT_ERR(id != TICKER_NULL); } while (id != ticker_id); payload_count = lll_iso->payload_count + @@ -1593,7 +1594,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&adv_iso->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -1606,7 +1607,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy_lll_prepare); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); /* Calculate the BIG reference point of current BIG event */ remainder_us = remainder; @@ -1630,13 +1631,13 @@ static void ticker_stop_op_cb(uint32_t status, void *param) static struct mayfly mfy = {0U, 0U, &link, NULL, adv_iso_disable}; uint32_t ret; - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); /* Check if any pending LLL events that need to be aborted */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void adv_iso_disable(void *param) @@ -1657,14 +1658,14 @@ static void adv_iso_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } else { /* No pending LLL events */ disabled_cb(&adv_iso->lll); @@ -1680,7 +1681,7 @@ static void disabled_cb(void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void tx_lll_flush(void *param) @@ -1726,7 +1727,7 @@ static void tx_lll_flush(void *param) adv_iso = HDR_LLL2ULL(lll); rx = (void *)&adv_iso->node_rx_terminate; link = rx->hdr.link; - LL_ASSERT(link); + LL_ASSERT_DBG(link); rx->hdr.link = NULL; /* Enqueue the terminate towards ULL context */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c index 8c4d610b8874..ea1311c528e1 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c @@ -176,7 +176,7 @@ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags) lll_hdr_init(lll_sync, sync); err = util_aa_le32(lll_sync->access_addr); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); lll_sync->data_chan_id = lll_chan_id(lll_sync->access_addr); chm_last = lll_sync->chm_first; @@ -940,11 +940,11 @@ void ull_adv_sync_chm_complete(struct node_rx_pdu *rx) adv = HDR_LLL2ULL(lll_sync->adv); err = ull_adv_sync_pdu_alloc(adv, ULL_ADV_PDU_EXTRA_DATA_ALLOC_IF_EXIST, &pdu_prev, &pdu, NULL, NULL, &ter_idx); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); err = ull_adv_sync_remove_from_acad(lll_sync, pdu_prev, pdu, PDU_ADV_DATA_TYPE_CHANNEL_MAP_UPDATE_IND); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); lll_adv_sync_data_enqueue(lll_sync, ter_idx); } @@ -981,7 +981,7 @@ void ull_adv_sync_offset_get(struct ll_adv_set *adv) mfy.param = adv; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } #endif /* CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ @@ -1013,11 +1013,12 @@ void ull_adv_sync_pdu_init(struct pdu_adv *pdu, uint8_t ext_hdr_flags, *(uint8_t *)ext_hdr = ext_hdr_flags; dptr = ext_hdr->data; - LL_ASSERT(!(ext_hdr_flags & (ULL_ADV_PDU_HDR_FIELD_ADVA | ULL_ADV_PDU_HDR_FIELD_TARGETA | + LL_ASSERT_DBG(!(ext_hdr_flags & (ULL_ADV_PDU_HDR_FIELD_ADVA | + ULL_ADV_PDU_HDR_FIELD_TARGETA | #if !defined(CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT) - ULL_ADV_PDU_HDR_FIELD_ADI | + ULL_ADV_PDU_HDR_FIELD_ADI | #endif /* CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT */ - ULL_ADV_PDU_HDR_FIELD_SYNC_INFO))); + ULL_ADV_PDU_HDR_FIELD_SYNC_INFO))); #if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK) if (IS_ENABLED(CONFIG_BT_CTLR_DF_ADV_CTE_TX) && @@ -1174,8 +1175,8 @@ static void ull_adv_sync_add_to_header(struct pdu_adv *pdu, /* Push back any adv data - overflow will be returned via ad_overflow */ if (pdu->len > hdr->ext_hdr_len + 1U) { if (pdu->len > PDU_AC_EXT_PAYLOAD_SIZE_MAX - delta) { - LL_ASSERT(ad_overflow); - LL_ASSERT(overflow_len); + LL_ASSERT_DBG(ad_overflow); + LL_ASSERT_DBG(overflow_len); #if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) *overflow_len = delta - (PDU_AC_EXT_PAYLOAD_SIZE_MAX - pdu->len); memcpy(ad_overflow, @@ -1375,7 +1376,7 @@ static void ull_adv_sync_copy_pdu_header(struct pdu_adv *target_pdu, const uint8_t *source_dptr; uint8_t *target_dptr; - LL_ASSERT(target_pdu != source_pdu); + LL_ASSERT_DBG(target_pdu != source_pdu); /* Initialize PDU header */ target_pdu->type = source_pdu->type; @@ -1861,7 +1862,8 @@ static uint8_t ull_adv_sync_add_adi(struct lll_adv_sync *lll_sync, last_pdu = pdu; /* We should always have enough available overflow space to fit an ADI */ - LL_ASSERT(total_overflow_len + sizeof(struct pdu_adv_adi) <= sizeof(ad_overflow)); + LL_ASSERT_DBG((total_overflow_len + sizeof(struct pdu_adv_adi)) <= + sizeof(ad_overflow)); ull_adv_sync_add_to_header(pdu, &add_fields, &ad_overflow[total_overflow_len], &overflow_len); @@ -2054,7 +2056,7 @@ uint8_t ull_adv_sync_remove_from_acad(struct lll_adv_sync *lll_sync, ad_len += 1U; - LL_ASSERT(ad_len <= len); + LL_ASSERT_DBG(ad_len <= len); ad += ad_len; len -= ad_len; @@ -2180,7 +2182,8 @@ uint8_t ull_adv_sync_add_cteinfo(struct lll_adv_sync *lll_sync, last_pdu = pdu; /* We should always have enough available overflow space to fit CTEInfo */ - LL_ASSERT(total_overflow_len + sizeof(struct pdu_cte_info) <= sizeof(ad_overflow)); + LL_ASSERT_DBG((total_overflow_len + sizeof(struct pdu_cte_info)) <= + sizeof(ad_overflow)); ull_adv_sync_add_to_header(pdu, &add_fields, &ad_overflow[total_overflow_len], &overflow_len); @@ -2720,11 +2723,11 @@ static void mfy_sync_offset_get(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT(success); + LL_ASSERT_ERR(success); - LL_ASSERT((ticks_current == ticks_previous) || retry--); + LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); - LL_ASSERT(id != TICKER_NULL); + LL_ASSERT_ERR(id != TICKER_NULL); } while (id != ticker_id); /* Reduced a tick for negative remainder and return positive remainder @@ -2861,14 +2864,14 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&sync->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); #if defined(CONFIG_BT_CTLR_ADV_ISO) && \ defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) if (lll->iso) { struct lll_adv_iso *lll_iso = lll->iso; - LL_ASSERT(context->other_expire_info); + LL_ASSERT_DBG(context->other_expire_info); /* Check: No need for remainder in this case? */ lll_iso->ticks_sync_pdu_offset = context->other_expire_info->ticks_to_expire; @@ -2887,7 +2890,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); #if defined(CONFIG_BT_CTLR_ADV_ISO) && \ !defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) @@ -2903,7 +2906,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) static void ticker_update_op_cb(uint32_t status, void *param) { - LL_ASSERT(status == TICKER_STATUS_SUCCESS || - param == ull_disable_mark_get()); + LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || + (param == ull_disable_mark_get())); } #endif /* !CONFIG_BT_CTLR_ADV_ISO && CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_central.c b/subsys/bluetooth/controller/ll_sw/ull_central.c index 1771cda124bd..f4bc227cfdf5 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_central.c +++ b/subsys/bluetooth/controller/ll_sw/ull_central.c @@ -190,7 +190,7 @@ uint8_t ll_create_connection(uint16_t scan_interval, uint16_t scan_window, conn_lll = &conn->lll; err = util_aa_le32(conn_lll->access_addr); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); lll_csrand_get(conn_lll->crc_init, sizeof(conn_lll->crc_init)); @@ -519,7 +519,7 @@ uint8_t ll_connect_disable(void **rx) conn = HDR_LLL2ULL(conn_lll); node_rx = (void *)&conn->llcp_terminate.node_rx.rx; link = node_rx->hdr.link; - LL_ASSERT(link); + LL_ASSERT_DBG(link); /* free the memq link early, as caller could overwrite it */ ll_rx_link_release(link); @@ -603,7 +603,7 @@ int ull_central_reset(void) } } - LL_ASSERT(scan); + LL_ASSERT_DBG(scan); scan->is_enabled = 0U; scan->lll.conn = NULL; @@ -628,13 +628,13 @@ void ull_central_cleanup(struct node_rx_pdu *rx_free) */ scan = HDR_LLL2ULL(rx_free->rx_ftr.param); conn_lll = scan->lll.conn; - LL_ASSERT(conn_lll); + LL_ASSERT_DBG(conn_lll); scan->lll.conn = NULL; - LL_ASSERT(!conn_lll->link_tx_free); + LL_ASSERT_DBG(!conn_lll->link_tx_free); link = memq_deinit(&conn_lll->memq_tx.head, &conn_lll->memq_tx.tail); - LL_ASSERT(link); + LL_ASSERT_DBG(link); conn_lll->link_tx_free = link; conn = HDR_LLL2ULL(conn_lll); @@ -655,7 +655,7 @@ void ull_central_cleanup(struct node_rx_pdu *rx_free) ull_scan_is_enabled_get(SCAN_HANDLE_PHY_CODED); if (scan_coded && scan_coded != scan) { conn_lll = scan_coded->lll.conn; - LL_ASSERT(conn_lll); + LL_ASSERT_DBG(conn_lll); scan_coded->lll.conn = NULL; scan_coded->is_enabled = 0U; @@ -699,7 +699,7 @@ void ull_central_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, * complete event. */ node = pdu_tx; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_cc)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_cc)); /* Populate the fields required for connection complete event */ cc = node; @@ -831,8 +831,8 @@ void ull_central_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, TICKER_USER_ID_ULL_HIGH, ticker_id_scan, ticks_at_stop, ticker_op_stop_scan_cb, scan); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #if defined(CONFIG_BT_CTLR_ADV_EXT) && defined(CONFIG_BT_CTLR_PHY_CODED) /* Determine if coded PHY was also enabled, if so, reset the assigned @@ -853,8 +853,8 @@ void ull_central_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, ticker_id_scan, ticker_op_stop_scan_other_cb, scan_other); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } } #endif /* CONFIG_BT_CTLR_ADV_EXT && CONFIG_BT_CTLR_PHY_CODED */ @@ -880,8 +880,8 @@ void ull_central_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, (conn->ull.ticks_slot + ticks_slot_overhead), ull_central_ticker_cb, conn, ticker_op_cb, (void *)__LINE__); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) /* enable ticker job, irrespective of disabled in this function so @@ -944,7 +944,7 @@ void ull_central_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&conn->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* Increment event counter. * @@ -972,7 +972,7 @@ void ull_central_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ err = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!err); + LL_ASSERT_ERR(!err); /* De-mux remaining tx nodes from FIFO */ ull_conn_tx_demux(UINT8_MAX); @@ -1044,7 +1044,7 @@ static void ticker_op_stop_scan_other_cb(uint32_t status, void *param) ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } } #endif /* CONFIG_BT_CTLR_ADV_EXT && CONFIG_BT_CTLR_PHY_CODED */ @@ -1053,7 +1053,7 @@ static void ticker_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); } static inline void conn_release(struct ll_scan_set *scan) @@ -1064,16 +1064,16 @@ static inline void conn_release(struct ll_scan_set *scan) memq_link_t *link; lll = scan->lll.conn; - LL_ASSERT(!lll->link_tx_free); + LL_ASSERT_DBG(!lll->link_tx_free); link = memq_deinit(&lll->memq_tx.head, &lll->memq_tx.tail); - LL_ASSERT(link); + LL_ASSERT_DBG(link); lll->link_tx_free = link; conn = HDR_LLL2ULL(lll); cc = (void *)&conn->llcp_terminate.node_rx.rx; link = cc->hdr.link; - LL_ASSERT(link); + LL_ASSERT_DBG(link); ll_rx_link_release(link); diff --git a/subsys/bluetooth/controller/ll_sw/ull_central_iso.c b/subsys/bluetooth/controller/ll_sw/ull_central_iso.c index c2f86c263dff..d99896a975ba 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_central_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_central_iso.c @@ -355,7 +355,7 @@ uint8_t ll_cig_parameters_commit(uint8_t cig_id, uint16_t *handles) tx = cis->lll.tx.bn && cis->lll.tx.max_pdu; rx = cis->lll.rx.bn && cis->lll.rx.max_pdu; } else { - LL_ASSERT(cis->framed || iso_interval_us >= cig->c_sdu_interval); + LL_ASSERT_DBG(cis->framed || iso_interval_us >= cig->c_sdu_interval); tx = cig->c_sdu_interval && cis->c_max_sdu; rx = cig->p_sdu_interval && cis->p_max_sdu; @@ -463,7 +463,7 @@ uint8_t ll_cig_parameters_commit(uint8_t cig_id, uint16_t *handles) if (!cig->central.test) { #if defined(CONFIG_BT_CTLR_CONN_ISO_LOW_LATENCY_POLICY) /* TODO: Only implemented for sequential packing */ - LL_ASSERT(cig->central.packing == BT_ISO_PACKING_SEQUENTIAL); + LL_ASSERT_ERR(cig->central.packing == BT_ISO_PACKING_SEQUENTIAL); /* Use symmetric flush timeout */ cis->lll.tx.ft = DIV_ROUND_UP(total_time, iso_interval_us); @@ -494,7 +494,7 @@ uint8_t ll_cig_parameters_commit(uint8_t cig_id, uint16_t *handles) } #else - LL_ASSERT(0); + LL_ASSERT_ERR(0); #endif cis->lll.nse = DIV_ROUND_UP(se[i].total_count, cis->lll.tx.ft); } @@ -736,7 +736,7 @@ void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle) /* Create access address */ err = util_aa_le32(cis->lll.access_addr); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* Initialize stream states */ cis->established = 0; @@ -754,7 +754,7 @@ void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle) /* Initiate CIS Request Control Procedure */ if (ull_cp_cis_create(conn, cis) == BT_HCI_ERR_SUCCESS) { - LL_ASSERT(cis->group); + LL_ASSERT_DBG(cis->group); if (cis->group->state == CIG_STATE_CONFIGURABLE) { /* This CIG is now initiating an ISO connection */ @@ -859,7 +859,7 @@ uint8_t ull_central_iso_setup(uint16_t cis_handle, /* ACL connection of the new CIS */ conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); #if defined(CONFIG_BT_CTLR_JIT_SCHEDULING) uint16_t event_counter; @@ -980,10 +980,10 @@ int ull_central_iso_cis_offset_get(uint16_t cis_handle, struct ll_conn *conn; cis = ll_conn_iso_stream_get(cis_handle); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); /* `ull_conn_llcp()` (caller of this function) is called before `ull_ref_inc()` hence we do * not need to use `ull_conn_event_counter()`. @@ -1032,7 +1032,7 @@ static void cig_offset_get(struct ll_conn_iso_stream *cis) mfy.param = cis; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void mfy_cig_offset_get(void *param) @@ -1055,7 +1055,7 @@ static void mfy_cig_offset_get(void *param) */ err = ull_sched_conn_iso_free_offset_get(cig->ull.ticks_slot, &ticks_to_expire); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* Calculate the offset for the select CIS in the CIG */ offset_min_us = HAL_TICKER_TICKS_TO_US(ticks_to_expire) + @@ -1063,7 +1063,7 @@ static void mfy_cig_offset_get(void *param) offset_min_us += cig->sync_delay - cis->sync_delay; conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); /* Ensure the offset is not greater than the ACL interval, considering * the minimum CIS offset requirement. @@ -1088,7 +1088,7 @@ static void cis_offset_get(struct ll_conn_iso_stream *cis) mfy.param = cis; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void mfy_cis_offset_get(void *param) @@ -1161,11 +1161,11 @@ static void mfy_cis_offset_get(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT(success); + LL_ASSERT_ERR(success); - LL_ASSERT((ticks_current == ticks_previous) || retry--); + LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); - LL_ASSERT(id != TICKER_NULL); + LL_ASSERT_ERR(id != TICKER_NULL); } while (id != ticker_id); /* Reduced a tick for negative remainder and return positive remainder @@ -1175,7 +1175,7 @@ static void mfy_cis_offset_get(void *param) cig_remainder_us = remainder; conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); /* Add a tick for negative remainder and return positive remainder * value. diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index e76b3e7147e9..fb6e98915d7f 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -444,7 +444,7 @@ uint8_t ll_terminate_ind_send(uint16_t handle, uint8_t reason) } else if (cis->group->state == CIG_STATE_INITIATING) { conn = ll_connected_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); /* CIS is not yet established - try to cancel procedure */ if (ull_cp_cc_cancel(conn)) { @@ -452,7 +452,7 @@ uint8_t ll_terminate_ind_send(uint16_t handle, uint8_t reason) struct node_rx_pdu *node_terminate; node_terminate = ull_pdu_rx_alloc(); - LL_ASSERT(node_terminate); + LL_ASSERT_ERR(node_terminate); node_terminate->hdr.handle = handle; node_terminate->hdr.type = NODE_RX_TYPE_TERMINATE; @@ -900,7 +900,7 @@ void ull_conn_setup(memq_link_t *rx_link, struct node_rx_pdu *rx) /* Setup connection in ULL disabled callback, * pass the node rx as disabled callback parameter. */ - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = rx; hdr->disabled_cb = conn_setup_adv_scan_disabled_cb; @@ -976,7 +976,7 @@ void ull_conn_rx(memq_link_t *link, struct node_rx_pdu **rx) int ull_conn_llcp(struct ll_conn *conn, uint32_t ticks_at_expire, uint32_t remainder, uint16_t lazy) { - LL_ASSERT(conn->lll.handle != LLL_HANDLE_INVALID); + LL_ASSERT_DBG(conn->lll.handle != LLL_HANDLE_INVALID); conn->llcp.prep.ticks_at_expire = ticks_at_expire; conn->llcp.prep.remainder = remainder; @@ -1410,9 +1410,9 @@ void ull_conn_done(struct node_rx_event_done *done) lazy, force, ticker_update_conn_op_cb, conn_ll); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)conn_ll == ull_disable_mark_get())); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)conn_ll == ull_disable_mark_get())); } } @@ -1479,7 +1479,7 @@ void ull_conn_tx_lll_enqueue(struct ll_conn *conn, uint8_t count) } link = mem_acquire(&mem_link_tx.free); - LL_ASSERT(link); + LL_ASSERT_ERR(link); /* Enqueue towards LLL */ memq_enqueue(link, tx, &conn->lll.memq_tx.tail); @@ -1542,7 +1542,7 @@ void ull_conn_lll_ack_enqueue(uint16_t handle, struct node_tx *tx) uint8_t idx; idx = MFIFO_ENQUEUE_GET(conn_ack, (void **)&lll_tx); - LL_ASSERT(lll_tx); + LL_ASSERT_ERR(lll_tx); lll_tx->handle = handle; lll_tx->node = tx; @@ -1555,13 +1555,13 @@ void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx) struct pdu_data *pdu_tx; pdu_tx = (void *)tx->pdu; - LL_ASSERT(pdu_tx->len); + LL_ASSERT_DBG(pdu_tx->len); if (pdu_tx->ll_id == PDU_DATA_LLID_CTRL) { if (handle != LLL_HANDLE_INVALID) { struct ll_conn *conn = ll_conn_get(handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); ull_cp_tx_ack(conn, tx); } @@ -1571,7 +1571,7 @@ void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx) struct ll_conn *conn; /* Tx Node not re-used, ensure link->next is non-NULL */ - LL_ASSERT(link->next); + LL_ASSERT_DBG(link->next); /* Pass conn as-is to ull_cp_release_tx(), NULL check is done there */ conn = ll_connected_get(handle); @@ -1585,12 +1585,12 @@ void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx) return; } - LL_ASSERT(!link->next); + LL_ASSERT_DBG(!link->next); } else if (handle == LLL_HANDLE_INVALID) { pdu_tx->ll_id = PDU_DATA_LLID_RESV; } else { - LL_ASSERT(handle != LLL_HANDLE_INVALID); + LL_ASSERT_DBG(handle != LLL_HANDLE_INVALID); } ll_tx_ack_put(handle, tx); @@ -1784,29 +1784,33 @@ static void ticker_update_conn_op_cb(uint32_t status, void *param) * when disconnecting or connection update (race between ticker_update * and ticker_stop calls). */ - LL_ASSERT(status == TICKER_STATUS_SUCCESS || - param == ull_update_mark_get() || - param == ull_disable_mark_get()); + LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || + (param == ull_update_mark_get()) || + (param == ull_disable_mark_get())); } static void ticker_stop_conn_op_cb(uint32_t status, void *param) { void *p; - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); p = ull_update_mark(param); - LL_ASSERT(p == param); + if (p != param) { + LL_ASSERT_DBG(false); + } } static void ticker_start_conn_op_cb(uint32_t status, void *param) { void *p; - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); p = ull_update_unmark(param); - LL_ASSERT(p == param); + if (p != param) { + LL_ASSERT_DBG(false); + } } static void conn_setup_adv_scan_disabled_cb(void *param) @@ -1845,7 +1849,7 @@ static void conn_setup_adv_scan_disabled_cb(void *param) #endif /* CONFIG_BT_PERIPHERAL */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -1856,7 +1860,7 @@ static inline void disable(uint16_t handle) int err; conn = ll_conn_get(handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); err = ull_ticker_stop_with_mark(TICKER_ID_CONN_BASE + handle, conn, &conn->lll); @@ -1909,9 +1913,9 @@ static void conn_cleanup_finalize(struct ll_conn *conn) TICKER_USER_ID_ULL_HIGH, TICKER_ID_CONN_BASE + lll->handle, ticker_stop_op_cb, conn); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)conn == ull_disable_mark_get())); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)conn == ull_disable_mark_get())); /* Invalidate the connection context */ lll->handle = LLL_HANDLE_INVALID; @@ -1968,7 +1972,7 @@ static void tx_ull_flush(struct ll_conn *conn) memq_link_t *link; link = mem_acquire(&mem_link_tx.free); - LL_ASSERT(link); + LL_ASSERT_ERR(link); /* Enqueue towards LLL */ memq_enqueue(link, tx, &conn->lll.memq_tx.tail); @@ -1987,7 +1991,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) * when disconnecting (race with ticker_stop), say on HCI Reset. */ if (status != TICKER_STATUS_SUCCESS) { - LL_ASSERT(param == ull_disable_mark_get()); + LL_ASSERT_ERR(param == ull_disable_mark_get()); return; } @@ -1996,7 +2000,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void conn_disable(void *param) @@ -2017,14 +2021,14 @@ static void conn_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } else { /* No pending LLL events */ disabled_cb(&conn->lll); @@ -2040,7 +2044,7 @@ static void disabled_cb(void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void tx_lll_flush(void *param) @@ -2066,7 +2070,7 @@ static void tx_lll_flush(void *param) struct lll_tx *tx_buf; idx = MFIFO_ENQUEUE_GET(conn_ack, (void **)&tx_buf); - LL_ASSERT(tx_buf); + LL_ASSERT_ERR(tx_buf); tx_buf->handle = LLL_HANDLE_INVALID; tx_buf->node = tx; @@ -2086,7 +2090,7 @@ static void tx_lll_flush(void *param) * populated before this mayfly function was scheduled. */ rx = (void *)&conn->llcp_terminate.node_rx; - LL_ASSERT(rx->hdr.link); + LL_ASSERT_DBG(rx->hdr.link); link = rx->hdr.link; rx->hdr.link = NULL; @@ -2239,8 +2243,8 @@ static void ull_conn_update_ticker(struct ll_conn *conn, uint32_t ticker_status = ticker_stop_abs(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, ticker_id_conn, ticks_at_expire, ticker_stop_conn_op_cb, (void *)conn); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); ticker_status = ticker_start( TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, ticker_id_conn, ticks_at_expire, ticks_win_offset, HAL_TICKER_US_TO_TICKS(periodic_us), @@ -2260,8 +2264,8 @@ static void ull_conn_update_ticker(struct ll_conn *conn, ull_central_ticker_cb, #endif /* CONFIG_BT_PERIPHERAL && CONFIG_BT_CENTRAL */ conn, ticker_start_conn_op_cb, (void *)conn); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) /* enable ticker job, if disabled in this function */ @@ -2463,7 +2467,7 @@ void ull_conn_update_parameters(struct ll_conn *conn, uint8_t is_cu_proc, uint8_ #endif /*CONFIG_BT_CENTRAL */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -2825,7 +2829,7 @@ static uint32_t get_ticker_offset(uint8_t ticker_id, uint16_t *lazy) } } - LL_ASSERT(ret_cb == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(ret_cb == TICKER_STATUS_SUCCESS); /* Reduced a tick for negative remainder and return positive remainder * value. @@ -2867,7 +2871,7 @@ static void mfy_past_sender_offset_get(void *param) if (adv_sync_handle != BT_HCI_ADV_HANDLE_INVALID) { const struct ll_adv_sync_set *adv_sync = ull_adv_sync_get(adv_sync_handle); - LL_ASSERT(adv_sync); + LL_ASSERT_DBG(adv_sync); ticker_offset_us = get_ticker_offset(TICKER_ID_ADV_SYNC_BASE + adv_sync_handle, &lazy); @@ -2879,7 +2883,7 @@ static void mfy_past_sender_offset_get(void *param) uint32_t interval_us = sync->interval * PERIODIC_INT_UNIT_US; uint32_t window_widening_event_us; - LL_ASSERT(sync); + LL_ASSERT_DBG(sync); ticker_offset_us = get_ticker_offset(TICKER_ID_SCAN_SYNC_BASE + sync_handle, &lazy); @@ -2923,7 +2927,7 @@ void ull_conn_past_sender_offset_request(struct ll_conn *conn) mfy.param = conn; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_SENDER */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c index a28655218738..2ce0d8c3649b 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c @@ -460,7 +460,7 @@ void ull_conn_iso_done(struct node_rx_event_done *done) /* Check all CISes for supervison/establishment timeout */ for (cis_idx = 0; cis_idx < cig->lll.num_cis; cis_idx++) { cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); if (cis->lll.active && cis->lll.handle != LLL_HANDLE_INVALID) { /* CIS was setup and is now expected to be going */ @@ -485,7 +485,7 @@ void ull_conn_iso_done(struct node_rx_event_done *done) if (!cis->event_expire) { struct ll_conn *conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); cis->event_expire = RADIO_CONN_EVENTS( conn->supervision_timeout * 10U * 1000U, @@ -532,7 +532,7 @@ void ull_conn_iso_done(struct node_rx_event_done *done) struct ll_conn *conn; conn = ll_connected_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); ticker_status = ticker_update(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, @@ -543,9 +543,9 @@ void ull_conn_iso_done(struct node_rx_event_done *done) ticker_update_cig_op_cb, cig); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)conn == ull_disable_mark_get())); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)conn == ull_disable_mark_get())); } } @@ -569,8 +569,8 @@ void ull_conn_iso_cis_stop(struct ll_conn_iso_stream *cis, if (cis->teardown) { /* Teardown already started */ - LL_ASSERT(!cis->released_cb || !cis_released_cb || - (cis->released_cb == cis_released_cb)); + LL_ASSERT_ERR(!cis->released_cb || !cis_released_cb || + (cis->released_cb == cis_released_cb)); if (cis_released_cb) { cis->released_cb = cis_released_cb; @@ -600,15 +600,15 @@ void ull_conn_iso_cis_stop(struct ll_conn_iso_stream *cis, * continue CIS teardown from there. The disabled_cb cannot be * reserved for other use. */ - LL_ASSERT(!hdr->disabled_cb || - (hdr->disabled_cb == cis_disabled_cb)); + LL_ASSERT_ERR(!hdr->disabled_cb || + (hdr->disabled_cb == cis_disabled_cb)); hdr->disabled_param = mfy.param; hdr->disabled_cb = cis_disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } else { /* No pending LLL events */ @@ -707,7 +707,7 @@ void ull_conn_iso_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment CIS event counters */ for (int i = 0; i < cig->lll.num_cis; i++) { cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); /* New CIS may become available by creation prior to the CIG * event in which it has event_count == 0. Don't increment @@ -747,7 +747,7 @@ void ull_conn_iso_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&cig->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -767,7 +767,7 @@ void ull_conn_iso_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, mfy.fp = lll_peripheral_iso_prepare; #else /* !CONFIG_BT_CTLR_CENTRAL_ISO && !CONFIG_BT_CTLR_PERIPHERAL_ISO */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); return; #endif /* !CONFIG_BT_CTLR_CENTRAL_ISO && !CONFIG_BT_CTLR_PERIPHERAL_ISO */ @@ -791,7 +791,7 @@ void ull_conn_iso_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ err = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!err); + LL_ASSERT_ERR(!err); /* Handle ISO Transmit Test for this CIG */ ull_conn_iso_transmit_test_cig_interval(cig->lll.handle, ticks_at_expire); @@ -1022,9 +1022,9 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle, /* FIXME: Handle latency due to skipped ACL events around the * instant to start CIG */ - LL_ASSERT(instant_latency == 0U); + LL_ASSERT_ERR(instant_latency == 0U); } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); return; } @@ -1032,7 +1032,7 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle, /* Make sure we have time to service first subevent. TODO: Improve * by skipping interval(s) and incrementing event_count. */ - LL_ASSERT(cig_offset_us > 0); + LL_ASSERT_ERR(cig_offset_us > 0); ull_hdr_init(&cig->ull); @@ -1097,8 +1097,8 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle, TICKER_NULL_LAZY, ticks_slot, ull_conn_iso_ticker_cb, cig, ticker_start_op_cb, NULL); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); /* Set CIG and the first CIS state as active */ cig->state = CIG_STATE_ACTIVE; @@ -1114,7 +1114,7 @@ static void cis_lazy_fill(struct ll_conn_iso_stream *cis) mfy.param = cis; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void mfy_cis_lazy_fill(void *param) @@ -1177,11 +1177,11 @@ static void mfy_cis_lazy_fill(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT(success); + LL_ASSERT_ERR(success); - LL_ASSERT((ticks_current == ticks_previous) || retry--); + LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); - LL_ASSERT(id != TICKER_NULL); + LL_ASSERT_ERR(id != TICKER_NULL); } while (id != ticker_id); /* Set CIS active in already active CIG and any previous laziness in @@ -1203,7 +1203,7 @@ static void ticker_start_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); } static void ticker_update_cig_op_cb(uint32_t status, void *param) @@ -1212,9 +1212,9 @@ static void ticker_update_cig_op_cb(uint32_t status, void *param) * when disconnecting (race between ticker_update and ticker_stop * calls). TODO: Are the race-checks needed? */ - LL_ASSERT(status == TICKER_STATUS_SUCCESS || - param == ull_update_mark_get() || - param == ull_disable_mark_get()); + LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || + (param == ull_update_mark_get()) || + (param == ull_disable_mark_get())); } static void cis_disabled_cb(void *param) @@ -1241,7 +1241,7 @@ static void cis_disabled_cb(void *param) num_cis = cig->lll.num_cis; for (cis_idx = 0; cis_idx < num_cis; cis_idx++) { cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); if (!cis->lll.active && (cis->lll.flush != LLL_CIS_FLUSH_COMPLETE)) { /* CIS is not active and did not just complete LLL flush - skip it */ @@ -1257,7 +1257,7 @@ static void cis_disabled_cb(void *param) ll_iso_stream_released_cb_t cis_released_cb; conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); cis_released_cb = cis->released_cb; cis->released_cb = NULL; @@ -1285,7 +1285,7 @@ static void cis_disabled_cb(void *param) cis->lll.acl_handle = LLL_HANDLE_INVALID; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } /* CIS is no longer active */ @@ -1313,7 +1313,7 @@ static void cis_disabled_cb(void *param) * further enqueuing of TX nodes for terminating CIS. */ node_terminate = ull_pdu_rx_alloc(); - LL_ASSERT(node_terminate); + LL_ASSERT_ERR(node_terminate); node_terminate->hdr.handle = cis->lll.handle; node_terminate->hdr.type = NODE_RX_TYPE_TERMINATE; *((uint8_t *)node_terminate->pdu) = cis->terminate_reason; @@ -1321,7 +1321,7 @@ static void cis_disabled_cb(void *param) ll_rx_put_sched(node_terminate->hdr.link, node_terminate); } else { conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); /* CIS was not established - complete the procedure with error */ if (ull_cp_cc_awaiting_established(conn)) { @@ -1369,8 +1369,8 @@ static void cis_disabled_cb(void *param) ticker_stop_op_cb, cig); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } } @@ -1395,7 +1395,7 @@ static void cis_tx_lll_flush(void *param) memq_link_t *link; cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); lll = &cis->lll; @@ -1423,9 +1423,9 @@ static void cis_tx_lll_flush(void *param) (void **)&tx); } - LL_ASSERT(!lll->link_tx_free); + LL_ASSERT_DBG(!lll->link_tx_free); link = memq_deinit(&lll->memq_tx.head, &lll->memq_tx.tail); - LL_ASSERT(link); + LL_ASSERT_DBG(link); lll->link_tx_free = link; lll->flush = LLL_CIS_FLUSH_COMPLETE; @@ -1444,13 +1444,13 @@ static void ticker_stop_op_cb(uint32_t status, void *param) uint32_t ret; /* Assert if race between thread and ULL */ - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); /* Check if any pending LLL events that need to be aborted */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void cig_disable(void *param) @@ -1471,14 +1471,14 @@ static void cig_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = cig_disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } else { /* No pending LLL events */ cig_disabled_cb(&cig->lll); @@ -1527,7 +1527,7 @@ void ull_conn_iso_transmit_test_cig_interval(uint16_t handle, uint32_t ticks_at_ uint8_t tx_sdu_count; cig = ll_conn_iso_group_get(handle); - LL_ASSERT(cig); + LL_ASSERT_DBG(cig); handle_iter = UINT16_MAX; @@ -1540,7 +1540,7 @@ void ull_conn_iso_transmit_test_cig_interval(uint16_t handle, uint32_t ticks_at_ sdu_interval = cig->c_sdu_interval; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); return; } @@ -1550,7 +1550,7 @@ void ull_conn_iso_transmit_test_cig_interval(uint16_t handle, uint32_t ticks_at_ /* Handle ISO Transmit Test for all active CISes in the group */ for (uint8_t i = 0; i < cig->lll.num_cis; i++) { cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); if (!cis->hdr.test_mode.tx.enabled || cis->lll.handle == LLL_HANDLE_INVALID) { continue; diff --git a/subsys/bluetooth/controller/ll_sw/ull_df.c b/subsys/bluetooth/controller/ll_sw/ull_df.c index ba04dac16489..ac26c11cd725 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_df.c +++ b/subsys/bluetooth/controller/ll_sw/ull_df.c @@ -451,7 +451,7 @@ uint8_t ll_df_set_cl_iq_sampling_enable(uint16_t handle, #if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) /* When CTE is enabled there should be no iq report allocated */ - IF_SINGLE_ADV_SYNC_SET(LL_ASSERT(iq_report_alloc_count == 0)); + IF_SINGLE_ADV_SYNC_SET(LL_ASSERT_DBG(iq_report_alloc_count == 0)); #endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ /* Enable of already enabled CTE updates AoA configuration */ @@ -510,7 +510,7 @@ uint8_t ll_df_set_cl_iq_sampling_enable(uint16_t handle, * Periodic sync lost event also disables the CTE sampling. */ err = ull_sync_slot_update(sync, slot_plus_us, slot_minus_us); - LL_ASSERT(err == 0 || err == -ENOENT); + LL_ASSERT_DBG(err == 0 || err == -ENOENT); } return 0; @@ -580,7 +580,7 @@ void ull_df_iq_report_mem_release(struct node_rx_pdu *rx) void ull_iq_report_link_inc_quota(int8_t delta) { - LL_ASSERT(delta <= 0 || mem_link_iq_report_quota_pdu < (IQ_REPORT_CNT)); + LL_ASSERT_DBG(delta <= 0 || mem_link_iq_report_quota_pdu < (IQ_REPORT_CNT)); mem_link_iq_report_quota_pdu += delta; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_filter.c b/subsys/bluetooth/controller/ll_sw/ull_filter.c index bff2a0633674..8466e20731e9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_filter.c +++ b/subsys/bluetooth/controller/ll_sw/ull_filter.c @@ -277,8 +277,8 @@ uint8_t ll_fal_remove(bt_addr_le_t *addr) #if defined(CONFIG_BT_CTLR_PRIVACY) void ll_rl_id_addr_get(uint8_t rl_idx, uint8_t *id_addr_type, uint8_t *id_addr) { - LL_ASSERT(rl_idx < CONFIG_BT_CTLR_RL_SIZE); - LL_ASSERT(rl[rl_idx].taken); + LL_ASSERT_DBG(rl_idx < CONFIG_BT_CTLR_RL_SIZE); + LL_ASSERT_DBG(rl[rl_idx].taken); *id_addr_type = rl[rl_idx].id_addr_type; (void)memcpy(id_addr, rl[rl_idx].id_addr.val, BDADDR_SIZE); @@ -607,7 +607,7 @@ bool ull_filter_ull_pal_listed(const uint8_t rl_idx, uint8_t *const addr_type, return false; } - LL_ASSERT(rl[rl_idx].taken); + LL_ASSERT_DBG(rl[rl_idx].taken); if (rl[rl_idx].pal) { uint8_t pal_idx = rl[rl_idx].pal - 1; @@ -663,7 +663,7 @@ struct lll_filter *ull_filter_lll_get(bool filter) } return &rl_filter; #else - LL_ASSERT(filter); + LL_ASSERT_DBG(filter); return &fal_filter; #endif } @@ -752,7 +752,7 @@ void ull_filter_rpa_update(bool timeout) sys_memcpy_swap(irk, peer_irks[rl[i].pirk_idx], IRK_SIZE); err = bt_rpa_create(irk, &rl[i].peer_rpa); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); #if defined(CONFIG_BT_CTLR_SW_DEFERRED_PRIVACY) /* a new key was added, * invalidate the known/unknown peer RPA cache @@ -766,7 +766,7 @@ void ull_filter_rpa_update(bool timeout) bt_addr_t rpa; err = bt_rpa_create(rl[i].local_irk, &rpa); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* pointer read/write assumed to be atomic * so that if ISR fires the local_rpa pointer * will always point to a valid full RPA @@ -805,7 +805,7 @@ const uint8_t *ull_filter_adva_get(uint8_t rl_idx) { /* AdvA */ if (rl_idx < ARRAY_SIZE(rl) && rl[rl_idx].lirk) { - LL_ASSERT(rl[rl_idx].rpas_ready); + LL_ASSERT_DBG(rl[rl_idx].rpas_ready); return rl[rl_idx].local_rpa->val; } @@ -884,13 +884,13 @@ uint8_t ull_filter_lll_rl_idx(bool filter, uint8_t devmatch_id) uint8_t i; if (filter) { - LL_ASSERT(devmatch_id < ARRAY_SIZE(fal)); - LL_ASSERT(fal[devmatch_id].taken); + LL_ASSERT_DBG(devmatch_id < ARRAY_SIZE(fal)); + LL_ASSERT_DBG(fal[devmatch_id].taken); i = fal[devmatch_id].rl_idx; } else { - LL_ASSERT(devmatch_id < ARRAY_SIZE(rl)); + LL_ASSERT_DBG(devmatch_id < ARRAY_SIZE(rl)); i = devmatch_id; - LL_ASSERT(rl[i].taken); + LL_ASSERT_DBG(rl[i].taken); } return i; @@ -900,10 +900,10 @@ uint8_t ull_filter_lll_rl_irk_idx(uint8_t irkmatch_id) { uint8_t i; - LL_ASSERT(irkmatch_id < peer_irk_count); + LL_ASSERT_DBG(irkmatch_id < peer_irk_count); i = peer_irk_rl_ids[irkmatch_id]; - LL_ASSERT(i < CONFIG_BT_CTLR_RL_SIZE); - LL_ASSERT(rl[i].taken); + LL_ASSERT_DBG(i < CONFIG_BT_CTLR_RL_SIZE); + LL_ASSERT_DBG(rl[i].taken); return i; } @@ -914,7 +914,7 @@ bool ull_filter_lll_irk_in_fal(uint8_t rl_idx) return false; } - LL_ASSERT(rl[rl_idx].taken); + LL_ASSERT_DBG(rl[rl_idx].taken); return rl[rl_idx].fal; } @@ -938,8 +938,8 @@ bool ull_filter_lll_rl_idx_allowed(uint8_t irkmatch_ok, uint8_t rl_idx) return true; } - LL_ASSERT(rl_idx < CONFIG_BT_CTLR_RL_SIZE); - LL_ASSERT(rl[rl_idx].taken); + LL_ASSERT_DBG(rl_idx < CONFIG_BT_CTLR_RL_SIZE); + LL_ASSERT_DBG(rl[rl_idx].taken); return !rl[rl_idx].pirk || rl[rl_idx].dev; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_iso.c b/subsys/bluetooth/controller/ll_sw/ull_iso.c index 31a51a8bc145..c32aaced2076 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_iso.c @@ -662,7 +662,7 @@ static isoal_status_t ll_iso_test_sdu_alloc(const struct isoal_sink *sink_ctx, struct ll_conn_iso_stream *cis; cis = ll_iso_stream_connected_get(sink_ctx->session.handle); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); /* For unframed, SDU counter is the payload number */ cis->hdr.test_mode.rx.sdu_counter = @@ -675,7 +675,7 @@ static isoal_status_t ll_iso_test_sdu_alloc(const struct isoal_sink *sink_ctx, stream_handle = LL_BIS_SYNC_IDX_FROM_HANDLE(handle); sync_stream = ull_sync_iso_stream_get(stream_handle); - LL_ASSERT(sync_stream); + LL_ASSERT_DBG(sync_stream); sync_stream->test_mode->sdu_counter = (uint32_t)valid_pdu->meta->payload_number; @@ -709,7 +709,7 @@ static isoal_status_t ll_iso_test_sdu_emit(const struct isoal_sink * struct ll_conn_iso_stream *cis; cis = ll_iso_stream_connected_get(sink_ctx->session.handle); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); test_mode_rx = &cis->hdr.test_mode.rx; max_sdu = cis->c_max_sdu; @@ -721,7 +721,7 @@ static isoal_status_t ll_iso_test_sdu_emit(const struct isoal_sink * stream_handle = LL_BIS_SYNC_IDX_FROM_HANDLE(handle); sync_stream = ull_sync_iso_stream_get(stream_handle); - LL_ASSERT(sync_stream); + LL_ASSERT_DBG(sync_stream); sync_iso = ull_sync_iso_by_stream_get(stream_handle); @@ -790,7 +790,7 @@ static isoal_status_t ll_iso_test_sdu_emit(const struct isoal_sink * break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); return ISOAL_STATUS_ERR_SDU_EMIT; } break; @@ -1105,7 +1105,7 @@ void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire) uint8_t rand_8; cis = ll_iso_stream_connected_get(handle); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); if (!cis->hdr.test_mode.tx.enabled) { /* Transmit Test Mode not enabled */ @@ -1130,12 +1130,12 @@ void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire) break; case BT_HCI_ISO_TEST_MAX_SIZE_SDU: - LL_ASSERT(max_sdu > ISO_TEST_PACKET_COUNTER_SIZE); + LL_ASSERT_DBG(max_sdu > ISO_TEST_PACKET_COUNTER_SIZE); remaining_tx = max_sdu; break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); return; } @@ -1206,7 +1206,7 @@ void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire) /* Send to ISOAL */ err = isoal_tx_sdu_fragment(source_handle, &sdu); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); remaining_tx -= sdu.size; @@ -1222,7 +1222,7 @@ void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire) } else if (IS_ADV_ISO_HANDLE(handle)) { /* FIXME: Implement for broadcaster */ } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } #endif /* CONFIG_BT_CTLR_CONN_ISO */ @@ -1503,7 +1503,7 @@ void ull_iso_lll_ack_enqueue(uint16_t handle, struct node_tx_iso *node_tx) ll_tx_ack_put(handle, (void *)node_tx); ll_rx_sched(); } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -1538,7 +1538,7 @@ void ull_iso_lll_event_prepare(uint16_t handle, uint64_t event_count) isoal_tx_event_prepare(dp->source_hdl, event_count); } } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } #endif /* CONFIG_BT_CTLR_ADV_ISO || CONFIG_BT_CTLR_CONN_ISO */ @@ -1692,7 +1692,7 @@ static void iso_rx_demux(void *param) const isoal_status_t err = isoal_rx_pdu_recombine(dp->sink_hdl, &pckt_meta); - LL_ASSERT(err == ISOAL_STATUS_OK); /* TODO handle err */ + LL_ASSERT_ERR(err == ISOAL_STATUS_OK); /* TODO handle err */ } #endif /* CONFIG_BT_CTLR_CONN_ISO || CONFIG_BT_CTLR_SYNC_ISO */ @@ -1702,7 +1702,7 @@ static void iso_rx_demux(void *param) break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -1749,7 +1749,7 @@ void ll_iso_rx_dequeue(void) link = memq_dequeue(memq_ll_iso_rx.tail, &memq_ll_iso_rx.head, (void **)&rx); - LL_ASSERT(link); + LL_ASSERT_DBG(link); mem_release(link, &mem_link_iso_rx.free); @@ -1758,7 +1758,7 @@ void ll_iso_rx_dequeue(void) case NODE_RX_TYPE_ISO_PDU: break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -1825,7 +1825,7 @@ static isoal_status_t ll_iso_pdu_alloc(struct isoal_pdu_buffer *pdu_buffer) /* TODO: Report overflow to HCI and remove assert * data_buf_overflow(evt, BT_OVERFLOW_LINK_ISO) */ - LL_ASSERT(0); + LL_ASSERT_ERR(0); return ISOAL_STATUS_ERR_PDU_ALLOC; } @@ -1860,9 +1860,9 @@ static isoal_status_t ll_iso_pdu_write(struct isoal_pdu_buffer *pdu_buffer, ARG_UNUSED(pdu_offset); ARG_UNUSED(consume_len); - LL_ASSERT(pdu_buffer); - LL_ASSERT(pdu_buffer->pdu); - LL_ASSERT(sdu_payload); + LL_ASSERT_DBG(pdu_buffer); + LL_ASSERT_DBG(pdu_buffer->pdu); + LL_ASSERT_DBG(sdu_payload); if ((pdu_offset + consume_len) > pdu_buffer->size) { /* Exceeded PDU buffer */ @@ -1887,7 +1887,7 @@ static isoal_status_t ll_iso_pdu_emit(struct node_tx_iso *node_tx, memq_link_t *link; link = mem_acquire(&mem_link_iso_tx.free); - LL_ASSERT(link); + LL_ASSERT_ERR(link); if (ll_iso_tx_mem_enqueue(handle, node_tx, link)) { return ISOAL_STATUS_ERR_PDU_EMIT; @@ -1947,7 +1947,7 @@ static int init_reset(void) /* Acquire a link to initialize ull rx memq */ link = mem_acquire(&mem_link_iso_rx.free); - LL_ASSERT(link); + LL_ASSERT_DBG(link); #if defined(CONFIG_BT_CTLR_ISO_VENDOR_DATA_PATH) /* Initialize ull rx memq */ @@ -1956,7 +1956,7 @@ static int init_reset(void) /* Acquire a link to initialize ll_iso_rx memq */ link = mem_acquire(&mem_link_iso_rx.free); - LL_ASSERT(link); + LL_ASSERT_DBG(link); /* Initialize ll_iso_rx memq */ MEMQ_INIT(ll_iso_rx, link); @@ -2012,7 +2012,7 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, ticker_id = TICKER_ID_SCAN_SYNC_ISO_RESUME_BASE + group_handle; #endif /* CONFIG_BT_CTLR_SYNC_ISO */ } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } if (role == BT_HCI_ROLE_PERIPHERAL) { @@ -2031,7 +2031,7 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, cis = ll_conn_iso_stream_get(stream_handle); conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); phy = conn->lll.phy_rx; #endif /* CONFIG_BT_CTLR_CONN_ISO */ @@ -2045,7 +2045,7 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, phy = sync_iso->lll.phy; #endif /* CONFIG_BT_CTLR_SYNC_ISO */ } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); } resume_delay_us += @@ -2058,7 +2058,7 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, } resume_offset_us = (int32_t)(resume_timeout - resume_delay_us); - LL_ASSERT(resume_offset_us >= 0); + LL_ASSERT_DBG(resume_offset_us >= 0); /* Setup resume timeout as single-shot */ ret = ticker_start(TICKER_INSTANCE_ID_CTLR, @@ -2073,15 +2073,15 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, ticker_resume_cb, resume_event, ticker_resume_op_cb, NULL); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } static void ticker_resume_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); } static void ticker_resume_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, @@ -2094,7 +2094,7 @@ static void ticker_resume_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint32_t ret; ARG_UNUSED(ticks_drift); - LL_ASSERT(lazy == 0); + LL_ASSERT_DBG(lazy == 0); resume_event = param; @@ -2109,6 +2109,6 @@ static void ticker_resume_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } #endif /* CONFIG_BT_CTLR_CONN_ISO || CONFIG_BT_CTLR_SYNC_ISO */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp.c b/subsys/bluetooth/controller/ll_sw/ull_llcp.c index 0f9877ecc845..f23b7f388bc2 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp.c @@ -109,7 +109,7 @@ static struct proc_ctx *proc_ctx_acquire(struct llcp_mem_pool *owner) void llcp_proc_ctx_release(struct proc_ctx *ctx) { /* We need to have an owner otherwise the memory allocated would leak */ - LL_ASSERT(ctx->owner); + LL_ASSERT_DBG(ctx->owner); /* Release the memory back to the owner */ mem_release(ctx, &ctx->owner->free); @@ -297,7 +297,7 @@ void llcp_tx_resume_data(struct ll_conn *conn, enum llcp_tx_q_pause_data_mask re void llcp_rx_node_retain(struct proc_ctx *ctx) { - LL_ASSERT(ctx->node_ref.rx); + LL_ASSERT_DBG(ctx->node_ref.rx); /* Only retain if not already retained */ if (ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN) { @@ -311,7 +311,7 @@ void llcp_rx_node_retain(struct proc_ctx *ctx) void llcp_rx_node_release(struct proc_ctx *ctx) { - LL_ASSERT(ctx->node_ref.rx); + LL_ASSERT_DBG(ctx->node_ref.rx); /* Only release if retained */ if (ctx->node_ref.rx->hdr.type == NODE_RX_TYPE_RETAIN) { @@ -472,7 +472,7 @@ void ull_cp_release_tx(struct ll_conn *conn, struct node_tx *tx) { #if defined(LLCP_TX_CTRL_BUF_QUEUE_ENABLE) if (conn) { - LL_ASSERT(conn->llcp.tx_buffer_alloc > 0); + LL_ASSERT_DBG(conn->llcp.tx_buffer_alloc > 0); if (conn->llcp.tx_buffer_alloc > CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) { common_tx_buffer_alloc--; } @@ -511,7 +511,7 @@ int ull_cp_prt_elapse(struct ll_conn *conn, uint16_t elapsed_event, uint8_t *err struct proc_ctx *ctx; ctx = llcp_lr_peek(conn); - LL_ASSERT(ctx); + LL_ASSERT_DBG(ctx); if (ctx->proc == PROC_TERMINATE) { /* Active procedure is ACL Termination */ @@ -1026,7 +1026,7 @@ uint8_t ull_cp_conn_update(struct ll_conn *conn, uint16_t interval_min, uint16_t } #endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */ } else { - LL_ASSERT(0); /* Unknown procedure */ + LL_ASSERT_DBG(0); /* Unknown procedure */ } llcp_lr_enqueue(conn, ctx); @@ -1051,7 +1051,7 @@ uint8_t ull_cp_periodic_sync(struct ll_conn *conn, struct ll_sync_set *sync, uint8_t phy; /* Exactly one of the sync and adv_sync pointers should be non-null */ - LL_ASSERT((!adv_sync && sync) || (adv_sync && !sync)); + LL_ASSERT_DBG((!adv_sync && sync) || (adv_sync && !sync)); if (!feature_peer_periodic_sync_recv(conn)) { return BT_HCI_ERR_UNSUPP_REMOTE_FEATURE; @@ -1080,7 +1080,7 @@ uint8_t ull_cp_periodic_sync(struct ll_conn *conn, struct ll_sync_set *sync, rl_idx = ull_filter_rl_find(addr_type, sync->peer_id_addr, NULL); /* A resolved address must be present in the resolve list */ - LL_ASSERT(rl_idx < ll_rl_size_get()); + LL_ASSERT_DBG(rl_idx < ll_rl_size_get()); /* Generate RPAs if required */ ull_filter_rpa_update(false); @@ -1999,7 +1999,7 @@ void ull_cp_rx(struct ll_conn *conn, memq_link_t *link, struct node_rx_pdu *rx) */ /* Process PDU as a new remote request */ - LL_ASSERT(pdu_valid); + LL_ASSERT_DBG(pdu_valid); llcp_rr_new(conn, link, rx, true); } else { /* Local active procedure diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c index 6e12571d88c6..e70d6e664fc9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c @@ -65,7 +65,7 @@ static void cc_ntf_established(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate ntf node */ ntf = ctx->node_ref.rx; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); ctx->node_ref.rx = NULL; piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN); @@ -146,7 +146,7 @@ static void llcp_rp_cc_tx_rsp(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; conn_event_count = ctx->data.cis_create.conn_event_count; @@ -201,7 +201,7 @@ static void llcp_rp_cc_tx_reject(struct ll_conn *conn, struct proc_ctx *ctx, uin /* Allocate tx node */ tx = ctx->node_ref.tx; - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); ctx->node_ref.tx = NULL; pdu = (struct pdu_data *)tx->pdu; @@ -221,7 +221,7 @@ static void rp_cc_ntf_create(struct ll_conn *conn, struct proc_ctx *ctx) ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); ntf->hdr.type = NODE_RX_TYPE_CIS_REQUEST; ntf->hdr.handle = conn->lll.handle; @@ -490,7 +490,7 @@ static void rp_cc_state_wait_rx_cis_ind(struct ll_conn *conn, struct proc_ctx *c } /* If we get to here the CIG_ID referred in req/acquire has become void/invalid */ /* This cannot happen unless the universe has started to deflate */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); case RP_CC_EVT_REJECT: /* Handle CIS creation rejection */ break; @@ -656,7 +656,7 @@ static void rp_cc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -767,7 +767,7 @@ static void lp_cc_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -781,7 +781,7 @@ static void lp_cc_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) break; default: /* Unknown opcode */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -929,7 +929,7 @@ static void lp_cc_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t ev break; default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; @@ -971,7 +971,7 @@ static void cc_prepare_cis_ind(struct ll_conn *conn, struct proc_ctx *ctx) &ctx->data.cis_create.cis_offset_max, &ctx->data.cis_create.conn_event_count, ctx->data.cis_create.aa); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); ctx->state = LP_CC_STATE_WAIT_INSTANT; ctx->rx_opcode = PDU_DATA_LLCTRL_TYPE_UNUSED; @@ -1054,7 +1054,7 @@ static void lp_cc_st_wait_rx_cis_rsp_cancel(struct ll_conn *conn, struct proc_ct case LP_CC_EVT_CIS_RSP: /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -1177,7 +1177,7 @@ static void lp_cc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c index 04b51ce79947..772aba812d15 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c @@ -89,7 +89,7 @@ static void lp_chmu_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -180,7 +180,7 @@ static void lp_chmu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -293,7 +293,7 @@ static void rp_chmu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c index b0e28e124bdc..84098f1b149f 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c @@ -159,7 +159,7 @@ static void lp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -218,7 +218,7 @@ static void lp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -255,7 +255,7 @@ static void lp_comm_ntf_feature_exchange(struct ll_conn *conn, struct proc_ctx * break; default: /* Unexpected PDU, should not get through, so ASSERT */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -268,7 +268,7 @@ static void lp_comm_ntf_version_ind(struct ll_conn *conn, struct proc_ctx *ctx, break; default: /* Unexpected PDU, should not get through, so ASSERT */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -305,7 +305,7 @@ static void lp_comm_ntf_cte_req(struct ll_conn *conn, struct proc_ctx *ctx, stru break; default: /* Unexpected PDU, should not get through, so ASSERT */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -393,7 +393,7 @@ static void lp_comm_ntf(struct ll_conn *conn, struct proc_ctx *ctx) if (!ntf) { /* Allocate ntf node */ ntf = llcp_ntf_alloc(); - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); piggy_back = 0U; } @@ -424,7 +424,7 @@ static void lp_comm_ntf(struct ll_conn *conn, struct proc_ctx *ctx) break; #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -585,7 +585,7 @@ static void lp_comm_complete(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -716,7 +716,7 @@ static void lp_comm_send_req(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -819,7 +819,7 @@ static void lp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct break; case PDU_DATA_LLCTRL_TYPE_TERMINATE_IND: /* No response expected */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; #if defined(CONFIG_BT_CTLR_DATA_LENGTH) case PDU_DATA_LLCTRL_TYPE_LENGTH_RSP: @@ -844,7 +844,7 @@ static void lp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct break; default: /* Unknown opcode */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -889,7 +889,7 @@ static void lp_comm_st_wait_ntf_avail(struct ll_conn *conn, struct proc_ctx *ctx * out of the ones handled in ull_llcp_common should end up waiting for * non-piggy-back'ed NTF */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; @@ -919,7 +919,7 @@ static void lp_comm_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -1034,7 +1034,7 @@ static void rp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown opcode */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -1045,7 +1045,7 @@ static void rp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -1115,7 +1115,7 @@ static void rp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -1147,10 +1147,10 @@ static void rp_comm_ntf(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t gene /* Allocate ntf node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); /* This should be an 'old' RX node, so put/sched when done */ - LL_ASSERT(ntf->hdr.type == NODE_RX_TYPE_RETAIN); + LL_ASSERT_DBG(ntf->hdr.type == NODE_RX_TYPE_RETAIN); /* And release memory if no NTF to be generated */ ntf->hdr.type = NODE_RX_TYPE_RELEASE; @@ -1159,7 +1159,7 @@ static void rp_comm_ntf(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t gene ntf->hdr.type = NODE_RX_TYPE_DC_PDU; ntf->hdr.handle = conn->lll.handle; pdu = (struct pdu_data *)ntf->pdu; - LL_ASSERT(ctx->proc == PROC_DATA_LENGTH_UPDATE); + LL_ASSERT_DBG(ctx->proc == PROC_DATA_LENGTH_UPDATE); llcp_ntf_encode_length_change(conn, pdu); } @@ -1291,7 +1291,7 @@ static void rp_comm_send_rsp(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -1313,7 +1313,7 @@ static void rp_comm_st_postpone_terminate(struct ll_conn *conn, struct proc_ctx { switch (evt) { case RP_COMMON_EVT_RUN: - LL_ASSERT(ctx->proc == PROC_TERMINATE); + LL_ASSERT_DBG(ctx->proc == PROC_TERMINATE); /* Note: now we terminate, mimicking legacy LLCP behaviour * A check should be added to ensure that the ack of the terminate_ind was @@ -1415,7 +1415,7 @@ static void rp_comm_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c index 5fc5a261640f..d1a91c8d673d 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c @@ -260,7 +260,7 @@ static void cu_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate ntf node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN); @@ -300,7 +300,7 @@ static void lp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) if (!tx) { /* Allocate tx node if non pre-alloc'ed */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); } pdu = (struct pdu_data *)tx->pdu; @@ -323,7 +323,7 @@ static void lp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) #endif /* CONFIG_BT_CENTRAL */ default: /* Unknown opcode */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -408,7 +408,7 @@ static void lp_cu_send_conn_param_req(struct ll_conn *conn, struct proc_ctx *ctx #endif /* CONFIG_BT_PERIPHERAL */ default: /* Unknown role */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -491,7 +491,7 @@ static void lp_cu_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t ev #endif /* CONFIG_BT_CENTRAL */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; @@ -761,7 +761,7 @@ static void lp_cu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -815,7 +815,7 @@ static void rp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) if (!tx) { /* Allocate tx node if non pre-alloc'ed */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); } pdu = (struct pdu_data *)tx->pdu; @@ -841,7 +841,7 @@ static void rp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) break; default: /* Unknown opcode */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -869,7 +869,7 @@ static void rp_cu_conn_param_req_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate ntf node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN); @@ -903,7 +903,7 @@ static void rp_cu_send_conn_update_ind_finalize(struct ll_conn *conn, struct pro uint8_t evt, void *param) { /* Central role path, should not get here with !=NULL rx-node reference */ - LL_ASSERT(ctx->node_ref.rx == NULL); + LL_ASSERT_DBG(ctx->node_ref.rx == NULL); /* We pre-alloc NTF node */ ctx->node_ref.rx = llcp_ntf_alloc(); @@ -1015,7 +1015,7 @@ static void rp_cu_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t ev break; default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } break; @@ -1162,7 +1162,7 @@ static void rp_cu_state_wait_conn_param_req_reply_continue(struct ll_conn *conn, } } else { /* Unknown role */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } break; default: @@ -1313,7 +1313,7 @@ static void rp_cu_st_wait_rx_conn_update_ind(struct ll_conn *conn, struct proc_c break; default: /* Unknown role */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } default: /* Ignore other evts */ @@ -1382,7 +1382,7 @@ static void rp_cu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c index 392f37963ae0..13fae31f9e50 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c @@ -187,7 +187,7 @@ static struct node_tx *llcp_lp_enc_tx(struct ll_conn *conn, struct proc_ctx *ctx /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -206,7 +206,7 @@ static struct node_tx *llcp_lp_enc_tx(struct ll_conn *conn, struct proc_ctx *ctx llcp_pdu_encode_pause_enc_rsp(pdu); break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -228,7 +228,7 @@ static void lp_enc_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Piggy-back on RX node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); ntf->hdr.type = NODE_RX_TYPE_DC_PDU; ntf->hdr.handle = conn->lll.handle; @@ -244,7 +244,7 @@ static void lp_enc_ntf(struct ll_conn *conn, struct proc_ctx *ctx) ntf->hdr.type = NODE_RX_TYPE_ENC_REFRESH; } else { /* Should never happen */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } else { llcp_pdu_encode_reject_ind(pdu, ctx->data.enc.error); @@ -379,7 +379,7 @@ static inline uint8_t reject_error_code(struct pdu_data *pdu) #endif /* CONFIG_BT_CTLR_EXT_REJ_IND */ } else { /* Called with an invalid PDU */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); /* Keep compiler happy */ error = BT_HCI_ERR_UNSPECIFIED; @@ -639,7 +639,7 @@ static void lp_enc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8 break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -705,7 +705,7 @@ static struct node_tx *llcp_rp_enc_tx(struct ll_conn *conn, struct proc_ctx *ctx /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -732,7 +732,7 @@ static struct node_tx *llcp_rp_enc_tx(struct ll_conn *conn, struct proc_ctx *ctx } break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -755,7 +755,7 @@ static void rp_enc_ntf_ltk(struct ll_conn *conn, struct proc_ctx *ctx) /* Piggy-back on RX node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN); @@ -780,7 +780,7 @@ static void rp_enc_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Piggy-back on RX node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); ntf->hdr.type = NODE_RX_TYPE_DC_PDU; ntf->hdr.handle = conn->lll.handle; @@ -795,7 +795,7 @@ static void rp_enc_ntf(struct ll_conn *conn, struct proc_ctx *ctx) ntf->hdr.type = NODE_RX_TYPE_ENC_REFRESH; } else { /* Should never happen */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -884,7 +884,7 @@ static void rp_enc_send_reject_ind(struct ll_conn *conn, struct proc_ctx *ctx, u */ } else { /* Shouldn't happen */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } } @@ -1232,7 +1232,7 @@ static void rp_enc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8 break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c index 8c97bcdfb5f7..812d84955aa2 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c @@ -79,13 +79,13 @@ void llcp_lr_check_done(struct ll_conn *conn, struct proc_ctx *ctx) struct proc_ctx *ctx_header; ctx_header = llcp_lr_peek(conn); - LL_ASSERT(ctx_header == ctx); + LL_ASSERT_DBG(ctx_header == ctx); /* If we have a node rx it must not be marked RETAIN as * the memory referenced would leak */ - LL_ASSERT(ctx->node_ref.rx == NULL || - ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN); + LL_ASSERT_DBG(ctx->node_ref.rx == NULL || + ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN); lr_dequeue(conn); @@ -326,7 +326,7 @@ void llcp_lr_rx(struct ll_conn *conn, struct proc_ctx *ctx, memq_link_t *link, #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -475,7 +475,7 @@ static void lr_act_run(struct ll_conn *conn) #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_SENDER */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -487,7 +487,7 @@ static void lr_act_complete(struct ll_conn *conn) struct proc_ctx *ctx; ctx = llcp_lr_peek(conn); - LL_ASSERT(ctx != NULL); + LL_ASSERT_DBG(ctx != NULL); /* Stop procedure response timeout timer */ llcp_lr_prt_stop(conn); @@ -617,7 +617,7 @@ static void lr_execute_fsm(struct ll_conn *conn, uint8_t evt, void *param) break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_past.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_past.c index 8b8f88147e0f..53e16b9f52ad 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_past.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_past.c @@ -326,7 +326,7 @@ static void rp_past_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint #endif /* CONFIG_BT_CTLR_SW_DEFERRED_PRIVACY */ default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } @@ -400,7 +400,7 @@ static void lp_past_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -563,7 +563,7 @@ static void lp_past_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c index a9b48be2702f..9e8ebaf7a401 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c @@ -379,7 +379,7 @@ static void lp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo struct node_tx *tx; struct pdu_data *pdu; - LL_ASSERT(ctx->node_ref.tx); + LL_ASSERT_DBG(ctx->node_ref.tx); #if defined(CONFIG_BT_CTLR_DATA_LENGTH) if (!((ctx->tx_opcode == PDU_DATA_LLCTRL_TYPE_PHY_REQ) && @@ -390,7 +390,7 @@ static void lp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo return; } ctx->data.pu.ntf_dle_node = llcp_ntf_alloc(); - LL_ASSERT(ctx->data.pu.ntf_dle_node); + LL_ASSERT_DBG(ctx->data.pu.ntf_dle_node); } #endif /* CONFIG_BT_CTLR_DATA_LENGTH */ @@ -417,7 +417,7 @@ static void lp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo break; #endif /* CONFIG_BT_CENTRAL */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); } /* Enqueue LL Control PDU towards LLL */ @@ -435,10 +435,10 @@ static void pu_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Piggy-back on stored RX node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); if (ctx->data.pu.ntf_pu) { - LL_ASSERT(ntf->hdr.type == NODE_RX_TYPE_RETAIN); + LL_ASSERT_DBG(ntf->hdr.type == NODE_RX_TYPE_RETAIN); ntf->hdr.type = NODE_RX_TYPE_PHY_UPDATE; ntf->hdr.handle = conn->lll.handle; pdu = (struct node_rx_pu *)ntf->pdu; @@ -476,7 +476,7 @@ static void pu_dle_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Signal to release pre-allocated node in case there is no DLE ntf */ ntf->hdr.type = NODE_RX_TYPE_RELEASE; } else { - LL_ASSERT(ntf); + LL_ASSERT_DBG(ntf); ntf->hdr.type = NODE_RX_TYPE_DC_PDU; ntf->hdr.handle = conn->lll.handle; @@ -646,7 +646,7 @@ static void lp_pu_st_wait_tx_ack_phy_req(struct ll_conn *conn, struct proc_ctx * #endif /* CONFIG_BT_PERIPHERAL */ default: /* Unknown role */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } break; @@ -675,7 +675,7 @@ static void lp_pu_st_wait_tx_ack_phy_update_ind(struct ll_conn *conn, struct pro { switch (evt) { case LP_PU_EVT_ACK: - LL_ASSERT(conn->lll.role == BT_HCI_ROLE_CENTRAL); + LL_ASSERT_DBG(conn->lll.role == BT_HCI_ROLE_CENTRAL); if (ctx->data.pu.p_to_c_phy || ctx->data.pu.c_to_p_phy) { /* Either phys should change */ if (ctx->data.pu.c_to_p_phy) { @@ -711,7 +711,7 @@ static void lp_pu_st_wait_rx_phy_update_ind(struct ll_conn *conn, struct proc_ct { switch (evt) { case LP_PU_EVT_PHY_UPDATE_IND: - LL_ASSERT(conn->lll.role == BT_HCI_ROLE_PERIPHERAL); + LL_ASSERT_DBG(conn->lll.role == BT_HCI_ROLE_PERIPHERAL); llcp_rr_set_incompat(conn, INCOMPAT_RESERVED); llcp_pdu_decode_phy_update_ind(ctx, (struct pdu_data *)param); const uint8_t end_procedure = pu_check_update_ind(conn, ctx); @@ -867,7 +867,7 @@ static void lp_pu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ #endif /* CONFIG_BT_CTLR_DATA_LENGTH */ default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } @@ -930,7 +930,7 @@ static void rp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo struct node_tx *tx; struct pdu_data *pdu; - LL_ASSERT(ctx->node_ref.tx); + LL_ASSERT_DBG(ctx->node_ref.tx); #if defined(CONFIG_BT_CTLR_DATA_LENGTH) if (!llcp_ntf_alloc_is_available()) { @@ -940,7 +940,7 @@ static void rp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo } ctx->data.pu.ntf_dle_node = llcp_ntf_alloc(); - LL_ASSERT(ctx->data.pu.ntf_dle_node); + LL_ASSERT_DBG(ctx->data.pu.ntf_dle_node); #endif /* CONFIG_BT_CTLR_DATA_LENGTH */ tx = ctx->node_ref.tx; @@ -967,7 +967,7 @@ static void rp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo break; #endif /* CONFIG_BT_CENTRAL */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); } /* Enqueue LL Control PDU towards LLL */ @@ -1073,7 +1073,7 @@ static void rp_pu_st_wait_rx_phy_req(struct ll_conn *conn, struct proc_ctx *ctx, #endif /* CONFIG_BT_PERIPHERAL */ default: /* Unknown role */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } break; default: @@ -1105,7 +1105,7 @@ static void rp_pu_st_wait_tx_ack_phy(struct ll_conn *conn, struct proc_ctx *ctx, if (0) { #if defined(CONFIG_BT_PERIPHERAL) } else if (ctx->state == RP_PU_STATE_WAIT_TX_ACK_PHY_RSP) { - LL_ASSERT(conn->lll.role == BT_HCI_ROLE_PERIPHERAL); + LL_ASSERT_DBG(conn->lll.role == BT_HCI_ROLE_PERIPHERAL); /* When we act as peripheral apply timing restriction */ pu_set_timing_restrict( conn, pu_select_phy_timing_restrict(conn, ctx->data.pu.tx)); @@ -1114,7 +1114,7 @@ static void rp_pu_st_wait_tx_ack_phy(struct ll_conn *conn, struct proc_ctx *ctx, #endif /* CONFIG_BT_PERIPHERAL */ #if defined(CONFIG_BT_CENTRAL) } else if (ctx->state == RP_PU_STATE_WAIT_TX_ACK_PHY_UPDATE_IND) { - LL_ASSERT(conn->lll.role == BT_HCI_ROLE_CENTRAL); + LL_ASSERT_DBG(conn->lll.role == BT_HCI_ROLE_CENTRAL); if (ctx->data.pu.c_to_p_phy || ctx->data.pu.p_to_c_phy) { /* UPDATE_IND acked, so lets await instant */ if (ctx->data.pu.c_to_p_phy) { @@ -1289,7 +1289,7 @@ static void rp_pu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ #endif /* CONFIG_BT_CTLR_DATA_LENGTH */ default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c index 185cad7911d1..3a90a9d950ba 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c @@ -104,7 +104,7 @@ static bool proc_with_instant(struct proc_ctx *ctx) return 1U; default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -117,12 +117,12 @@ void llcp_rr_check_done(struct ll_conn *conn, struct proc_ctx *ctx) struct proc_ctx *ctx_header; ctx_header = llcp_rr_peek(conn); - LL_ASSERT(ctx_header == ctx); + LL_ASSERT_DBG(ctx_header == ctx); /* If we have a node rx it must not be marked RETAIN as * the memory referenced would leak */ - LL_ASSERT(ctx->node_ref.rx == NULL || + LL_ASSERT_DBG(ctx->node_ref.rx == NULL || ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN); rr_dequeue(conn); @@ -319,7 +319,7 @@ void llcp_rr_rx(struct ll_conn *conn, struct proc_ctx *ctx, memq_link_t *link, #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -459,7 +459,7 @@ static void rr_act_run(struct ll_conn *conn) #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER */ default: /* Unknown procedure */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); break; } @@ -475,7 +475,7 @@ static void rr_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT(tx); + LL_ASSERT_DBG(tx); pdu = (struct pdu_data *)tx->pdu; @@ -502,7 +502,7 @@ static void rr_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) llcp_pdu_encode_unknown_rsp(ctx, pdu); break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -515,7 +515,7 @@ static void rr_act_reject(struct ll_conn *conn) { struct proc_ctx *ctx = llcp_rr_peek(conn); - LL_ASSERT(ctx != NULL); + LL_ASSERT_DBG(ctx != NULL); if (llcp_rr_ispaused(conn) || !llcp_tx_alloc_peek(conn, ctx)) { rr_set_state(conn, RR_STATE_REJECT); @@ -531,7 +531,7 @@ static void rr_act_unsupported(struct ll_conn *conn) { struct proc_ctx *ctx = llcp_rr_peek(conn); - LL_ASSERT(ctx != NULL); + LL_ASSERT_DBG(ctx != NULL); if (llcp_rr_ispaused(conn) || !llcp_tx_alloc_peek(conn, ctx)) { rr_set_state(conn, RR_STATE_UNSUPPORTED); @@ -550,7 +550,7 @@ static void rr_act_complete(struct ll_conn *conn) rr_set_collision(conn, 0U); ctx = llcp_rr_peek(conn); - LL_ASSERT(ctx != NULL); + LL_ASSERT_DBG(ctx != NULL); /* Stop procedure response timeout timer */ llcp_rr_prt_stop(conn); @@ -777,7 +777,7 @@ static void rr_execute_fsm(struct ll_conn *conn, uint8_t evt, void *param) break; default: /* Unknown state */ - LL_ASSERT(0); + LL_ASSERT_DBG(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_peripheral.c b/subsys/bluetooth/controller/ll_sw/ull_peripheral.c index 8032b18e9950..aa6db211ed19 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_peripheral.c +++ b/subsys/bluetooth/controller/ll_sw/ull_peripheral.c @@ -250,7 +250,7 @@ void ull_periph_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, * complete event. */ node = pdu_adv; - LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_cc)); + LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_cc)); /* Populate the fields required for connection complete event */ cc = node; @@ -334,7 +334,7 @@ void ull_periph_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, link = rx->hdr.link; handle = ull_adv_handle_get(adv); - LL_ASSERT(handle < BT_CTLR_ADV_SET); + LL_ASSERT_DBG(handle < BT_CTLR_ADV_SET); rx->hdr.type = NODE_RX_TYPE_EXT_ADV_TERMINATE; rx->hdr.handle = handle; @@ -494,8 +494,8 @@ void ull_periph_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, ticks_slot_overhead), ull_periph_ticker_cb, conn, ticker_op_cb, (void *)__LINE__); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) /* enable ticker job, irrespective of disabled in this function so @@ -520,8 +520,8 @@ void ull_periph_latency_cancel(struct ll_conn *conn, uint16_t handle) 0, 0, 0, 0, 1, 0, ticker_update_latency_cancel_op_cb, (void *)conn); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } } @@ -578,7 +578,7 @@ void ull_periph_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&conn->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* Increment event counter */ conn->event_counter += (lazy + 1U); @@ -594,7 +594,7 @@ void ull_periph_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ err = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!err); + LL_ASSERT_ERR(!err); /* De-mux remaining tx nodes from FIFO */ ull_conn_tx_demux(UINT8_MAX); @@ -664,15 +664,15 @@ static void invalid_release(struct ull_hdr *hdr, struct lll_conn *lll, static void ticker_op_stop_adv_cb(uint32_t status, void *param) { - LL_ASSERT(status != TICKER_STATUS_FAILURE || - param == ull_disable_mark_get()); + LL_ASSERT_ERR((status != TICKER_STATUS_FAILURE) || + (param == ull_disable_mark_get())); } static void ticker_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); } static void ticker_update_latency_cancel_op_cb(uint32_t ticker_status, @@ -680,7 +680,7 @@ static void ticker_update_latency_cancel_op_cb(uint32_t ticker_status, { struct ll_conn *conn = param; - LL_ASSERT(ticker_status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(ticker_status == TICKER_STATUS_SUCCESS); conn->periph.latency_cancel = 0U; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c b/subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c index dd360c9f9eb8..21ff94e90bb6 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c @@ -158,7 +158,7 @@ void ull_peripheral_iso_release(uint16_t cis_handle) struct ll_conn_iso_group *cig; cis = ll_conn_iso_stream_get(cis_handle); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); cig = cis->group; @@ -318,7 +318,7 @@ uint8_t ull_peripheral_iso_setup(struct pdu_data_llctrl_cis_ind *ind, } conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT(conn != NULL); + LL_ASSERT_DBG(conn != NULL); cis_offset = sys_get_le24(ind->cis_offset); @@ -366,7 +366,7 @@ static void ticker_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); } void ull_peripheral_iso_update_ticker(struct ll_conn_iso_group *cig, @@ -378,8 +378,8 @@ void ull_peripheral_iso_update_ticker(struct ll_conn_iso_group *cig, uint8_t ticker_id_cig = TICKER_ID_CONN_ISO_BASE + ll_conn_iso_group_handle_get(cig); uint32_t ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, ticker_id_cig, ticker_op_cb, NULL); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); ticker_status = ticker_start(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, @@ -393,8 +393,8 @@ void ull_peripheral_iso_update_ticker(struct ll_conn_iso_group *cig, ull_conn_iso_ticker_cb, cig, ticker_op_cb, NULL); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } @@ -412,8 +412,9 @@ void ull_peripheral_iso_update_peer_sca(struct ll_conn *acl) if (!cig || !cig->lll.num_cis) { continue; } + cis = ll_conn_iso_stream_get_by_group(cig, NULL); - LL_ASSERT(cis); + LL_ASSERT_DBG(cis); uint16_t cis_handle = cis->lll.handle; diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan.c b/subsys/bluetooth/controller/ll_sw/ull_scan.c index 493c2330db0b..514072643e16 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan.c @@ -696,7 +696,7 @@ uint8_t ull_scan_disable(uint8_t handle, struct ll_scan_set *scan) * sync role. */ parent = aux->parent; - LL_ASSERT(!parent || (parent != aux_scan_lll)); + LL_ASSERT_DBG(!parent || (parent != aux_scan_lll)); } } #endif /* !CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */ @@ -727,7 +727,7 @@ void ull_scan_done(struct node_rx_event_done *done) lll->duration_reload = 0U; handle = ull_scan_handle_get(scan); - LL_ASSERT(handle < BT_CTLR_SCAN_SET); + LL_ASSERT_DBG(handle < BT_CTLR_SCAN_SET); #if defined(CONFIG_BT_CTLR_PHY_CODED) /* Prevent duplicate terminate event if ull_scan_done get called by @@ -751,8 +751,8 @@ void ull_scan_done(struct node_rx_event_done *done) (TICKER_ID_SCAN_BASE + handle), ticker_stop_ext_op_cb, scan); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } void ull_scan_term_dequeue(uint8_t handle) @@ -760,7 +760,7 @@ void ull_scan_term_dequeue(uint8_t handle) struct ll_scan_set *scan; scan = ull_scan_set_get(handle); - LL_ASSERT(scan); + LL_ASSERT_DBG(scan); scan->is_enabled = 0U; @@ -773,7 +773,7 @@ void ull_scan_term_dequeue(uint8_t handle) uint8_t err; err = disable(SCAN_HANDLE_PHY_CODED); - LL_ASSERT(!err); + LL_ASSERT_ERR(!err); } } else { struct ll_scan_set *scan_1m; @@ -783,7 +783,7 @@ void ull_scan_term_dequeue(uint8_t handle) uint8_t err; err = disable(SCAN_HANDLE_1M); - LL_ASSERT(!err); + LL_ASSERT_ERR(!err); } } #endif /* CONFIG_BT_CTLR_PHY_CODED */ @@ -924,7 +924,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&scan->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -937,7 +937,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); #if defined(CONFIG_BT_CTLR_ADV_EXT) if (lll->duration_expire) { @@ -955,7 +955,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, scan->duration_lazy - elapsed; handle = ull_scan_handle_get(scan); - LL_ASSERT(handle < BT_CTLR_SCAN_SET); + LL_ASSERT_DBG(handle < BT_CTLR_SCAN_SET); ret = ticker_update(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, @@ -963,8 +963,8 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, handle), 0, 0, 0, 0, duration_lazy, 0, NULL, NULL); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } lll->duration_expire = 0U; @@ -973,15 +973,15 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint8_t handle; handle = ull_scan_handle_get(scan); - LL_ASSERT(handle < BT_CTLR_SCAN_SET); + LL_ASSERT_DBG(handle < BT_CTLR_SCAN_SET); lll->duration_expire = lll->duration_reload; ret = ticker_update(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, (TICKER_ID_SCAN_BASE + handle), 0, 0, 0, 0, 1, 1, NULL, NULL); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } #endif /* CONFIG_BT_CTLR_ADV_EXT */ @@ -1105,7 +1105,7 @@ static void ticker_stop_ext_op_cb(uint32_t status, void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void ext_disable(void *param) @@ -1126,14 +1126,14 @@ static void ext_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = ext_disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } else { /* No pending LLL events */ ext_disabled_cb(&scan->lll); diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index 953575885bc5..012168b768d9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -215,7 +215,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) rx_incomplete = NULL; lll = ftr->param; - LL_ASSERT(!lll->lll_aux); + LL_ASSERT_DBG(!lll->lll_aux); scan = HDR_LLL2ULL(lll); sync = sync_create_get(scan); @@ -234,7 +234,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) rx_incomplete = NULL; lll = ftr->param; - LL_ASSERT(!lll->lll_aux); + LL_ASSERT_DBG(!lll->lll_aux); scan = HDR_LLL2ULL(lll); sync = sync_create_get(scan); @@ -259,7 +259,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) /* aux parent will be NULL for periodic sync */ lll = aux->parent; - LL_ASSERT(lll); + LL_ASSERT_DBG(lll); ticker_yield_handle = TICKER_ID_SCAN_AUX_BASE + aux_handle_get(aux); @@ -280,10 +280,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * is being received before we process the node here. */ lll_aux = ftr->lll_aux; - LL_ASSERT(lll_aux); + LL_ASSERT_DBG(lll_aux); aux = HDR_LLL2ULL(lll_aux); - LL_ASSERT(lll == aux->parent); + LL_ASSERT_DBG(lll == aux->parent); ticker_yield_handle = TICKER_NULL; @@ -301,10 +301,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * is being received before we process the node here. */ lll_aux = ftr->lll_aux; - LL_ASSERT(lll_aux); + LL_ASSERT_DBG(lll_aux); aux = HDR_LLL2ULL(lll_aux); - LL_ASSERT(sync_lll == aux->parent); + LL_ASSERT_DBG(sync_lll == aux->parent); ticker_yield_handle = TICKER_NULL; } @@ -340,7 +340,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) break; #endif /* CONFIG_BT_CTLR_PHY_CODED */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); + return; } @@ -375,7 +376,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * passed in the node rx footer field. */ sync_lll = ftr->param; - LL_ASSERT(!sync_lll->lll_aux); + LL_ASSERT_DBG(!sync_lll->lll_aux); ull_sync = HDR_LLL2ULL(sync_lll); rx->hdr.handle = ull_sync_handle_get(ull_sync); @@ -406,7 +407,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); + return; } @@ -601,7 +603,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } if (is_scan_req) { - LL_ASSERT(aux && aux->rx_last); + LL_ASSERT_DBG(aux && aux->rx_last); aux->rx_last->rx_ftr.extra = rx; aux->rx_last = rx; @@ -818,7 +820,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * scheduling, or receiving a chain then it will * reuse the aux context. */ - LL_ASSERT(!lll->lll_aux || (lll->lll_aux == lll_aux)); + LL_ASSERT_DBG(!lll->lll_aux || (lll->lll_aux == lll_aux)); /* Associate Scan context with the Aux context so that * it can continue reception in LLL scheduling. @@ -841,7 +843,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) /* Switching to ULL scheduling to receive auxiliary PDUs */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || lll) { - LL_ASSERT(scan); + LL_ASSERT_DBG(scan); /* Do not ULL schedule if scan disable requested */ if (unlikely(scan->is_stop)) { @@ -857,8 +859,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } else { struct ll_sync_set *sync_set; - LL_ASSERT(sync_lll && - (!sync_lll->lll_aux || sync_lll->lll_aux == lll_aux)); + LL_ASSERT_ERR(sync_lll && + (!sync_lll->lll_aux || sync_lll->lll_aux == lll_aux)); /* Do not ULL schedule if sync terminate requested */ sync_set = HDR_LLL2ULL(sync_lll); @@ -917,8 +919,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) ticks_aux_offset - ticks_slot_offset), NULL, NULL); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } aux_handle = aux_handle_get(aux); @@ -933,10 +935,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) (aux->ull.ticks_slot + ticks_slot_overhead), ticker_cb, aux, ticker_op_cb, aux); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((ticker_status == TICKER_STATUS_FAILURE) && - IS_ENABLED(CONFIG_BT_TICKER_LOW_LAT))); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((ticker_status == TICKER_STATUS_FAILURE) && + IS_ENABLED(CONFIG_BT_TICKER_LOW_LAT))); #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) /* enable ticker job, queued ticker operation will be handled @@ -960,7 +962,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * immediately since we are in sync context. */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || aux->rx_last) { - LL_ASSERT(scan); + LL_ASSERT_DBG(scan); /* If scan is being disabled, rx could already be * enqueued before coming here to ull_scan_aux_rx_flush. @@ -990,7 +992,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } else { const struct ll_sync_set *sync_set; - LL_ASSERT(sync_lll); + LL_ASSERT_DBG(sync_lll); ll_rx_put_sched(link, rx); @@ -1000,7 +1002,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } } - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); flush_safe(aux); @@ -1028,7 +1030,7 @@ void ull_scan_aux_done(struct node_rx_event_done *done) struct ll_sync_set *sync; sync = CONTAINER_OF(done->param, struct ll_sync_set, ull); - LL_ASSERT(ull_sync_is_valid_get(sync)); + LL_ASSERT_DBG(ull_sync_is_valid_get(sync)); /* Auxiliary context will be flushed by ull_scan_aux_stop() */ if (unlikely(sync->is_stop) || !sync->lll.lll_aux) { @@ -1036,16 +1038,16 @@ void ull_scan_aux_done(struct node_rx_event_done *done) } aux = HDR_LLL2ULL(sync->lll.lll_aux); - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); } else { struct ll_scan_set *scan; struct lll_scan *lll; lll = aux->parent; - LL_ASSERT(lll); + LL_ASSERT_DBG(lll); scan = HDR_LLL2ULL(lll); - LL_ASSERT(ull_scan_is_valid_get(scan)); + LL_ASSERT_DBG(ull_scan_is_valid_get(scan)); /* Auxiliary context will be flushed by ull_scan_aux_stop() */ if (unlikely(scan->is_stop)) { @@ -1086,7 +1088,7 @@ void *ull_scan_aux_lll_parent_get(struct lll_scan_aux *lll, struct lll_scan *lllscan; lllscan = aux->parent; - LL_ASSERT(lllscan); + LL_ASSERT_DBG(lllscan); scan = HDR_LLL2ULL(lllscan); *is_lll_scan = !!ull_scan_is_valid_get(scan); @@ -1196,7 +1198,8 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) rx->rx_ftr.extra = NULL; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); + lll_aux = NULL; } @@ -1208,7 +1211,7 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) aux = HDR_LLL2ULL(lll_aux); lll = aux->parent; - LL_ASSERT(lll); + LL_ASSERT_DBG(lll); scan = HDR_LLL2ULL(lll); scan = ull_scan_is_valid_get(scan); @@ -1222,12 +1225,13 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) sync = HDR_LLL2ULL(sync_lll); is_stop = sync->is_stop; } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); + return; } if (!is_stop) { - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); flush_safe(aux); @@ -1287,7 +1291,7 @@ int ull_scan_aux_stop(struct ll_scan_aux_set *aux) struct lll_scan *lll; lll = aux->parent; - LL_ASSERT(lll); + LL_ASSERT_DBG(lll); scan = HDR_LLL2ULL(lll); scan = ull_scan_is_valid_get(scan); @@ -1308,7 +1312,7 @@ int ull_scan_aux_stop(struct ll_scan_aux_set *aux) mfy.param = aux; ret = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); return 0; } @@ -1333,7 +1337,7 @@ static inline void aux_release(struct ll_scan_aux_set *aux) /* Clear the parent so that when scan is being disabled then this * auxiliary context shall not associate itself from being disable. */ - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); aux->parent = NULL; mem_release(aux, &scan_aux_free); @@ -1350,7 +1354,7 @@ static void done_disabled_cb(void *param) struct ll_scan_aux_set *aux; aux = param; - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); flush(aux); } @@ -1362,7 +1366,7 @@ static void flush_safe(void *param) uint8_t ref; aux = param; - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); /* ref == 0 * All PDUs were scheduled from LLL and there is no pending done @@ -1382,9 +1386,9 @@ static void flush_safe(void *param) * cannot overlap, i.e. ULL reference count * shall be less than 2. */ - LL_ASSERT(ref < 2U); + LL_ASSERT_DBG(ref < 2U); - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = aux; hdr->disabled_cb = done_disabled_cb; @@ -1406,7 +1410,7 @@ static void flush(void *param) * auxiliary channel PDUs. */ aux = param; - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); rx = aux->rx_head; if (rx) { @@ -1456,7 +1460,7 @@ static void aux_sync_partial(void *param) rx = aux->rx_head; aux->rx_head = NULL; - LL_ASSERT(rx); + LL_ASSERT_DBG(rx); rx->rx_ftr.aux_sched = 1U; ll_rx_put_sched(rx->hdr.link, rx); @@ -1468,7 +1472,7 @@ static void aux_sync_incomplete(void *param) struct ll_scan_aux_set *aux; aux = param; - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); /* ULL scheduling succeeded hence no backup node rx present, use the * extra node rx reserved for incomplete data status generation. @@ -1480,7 +1484,7 @@ static void aux_sync_incomplete(void *param) /* get reference to sync context */ lll = aux->parent; - LL_ASSERT(lll); + LL_ASSERT_DBG(lll); sync = HDR_LLL2ULL(lll); /* reset data len total */ @@ -1488,7 +1492,7 @@ static void aux_sync_incomplete(void *param) /* pick extra node rx stored in aux context */ rx = aux->rx_incomplete; - LL_ASSERT(rx); + LL_ASSERT_DBG(rx); aux->rx_incomplete = NULL; /* prepare sync report with failure */ @@ -1508,7 +1512,7 @@ static void aux_sync_incomplete(void *param) aux->rx_head = rx; } - LL_ASSERT(!ull_ref_get(&aux->ull)); + LL_ASSERT_DBG(!ull_ref_get(&aux->ull)); flush(aux); #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */ @@ -1529,7 +1533,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&aux->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -1542,7 +1546,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_PREPARE_O(1); } @@ -1560,7 +1564,7 @@ static void ticker_op_cb(uint32_t status, void *param) aux = param; sync_lll = aux->parent; - LL_ASSERT(sync_lll); + LL_ASSERT_DBG(sync_lll); sync = HDR_LLL2ULL(sync_lll); sync = ull_sync_is_valid_get(sync); @@ -1581,7 +1585,7 @@ static void ticker_op_cb(uint32_t status, void *param) struct ll_scan_aux_set *aux; aux = param; - LL_ASSERT(aux->parent); + LL_ASSERT_DBG(aux->parent); mfy.fp = flush_safe; } @@ -1591,7 +1595,7 @@ static void ticker_op_cb(uint32_t status, void *param) ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } #else /* CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */ @@ -1648,7 +1652,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) rx_incomplete = NULL; lll = ftr->param; - LL_ASSERT(!lll->lll_aux); + LL_ASSERT_DBG(!lll->lll_aux); scan = HDR_LLL2ULL(lll); sync = sync_create_get(scan); @@ -1664,7 +1668,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) rx_incomplete = NULL; lll = ftr->param; - LL_ASSERT(!lll->lll_aux); + LL_ASSERT_DBG(!lll->lll_aux); scan = HDR_LLL2ULL(lll); sync = sync_create_get(scan); @@ -1686,7 +1690,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) /* chain parent will be NULL for periodic sync */ lll = chain->parent; - LL_ASSERT(lll); + LL_ASSERT_DBG(lll); } else if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || ull_scan_is_valid_get(HDR_LLL2ULL(ftr->param))) { @@ -1700,10 +1704,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) lll = ftr->param; lll_aux = lll->lll_aux; - LL_ASSERT(lll_aux); + LL_ASSERT_DBG(lll_aux); chain = CONTAINER_OF(lll_aux, struct ll_scan_aux_chain, lll); - LL_ASSERT(lll == chain->parent); + LL_ASSERT_DBG(lll == chain->parent); } else { lll = NULL; @@ -1713,10 +1717,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) sync_lll = ftr->param; lll_aux = sync_lll->lll_aux; - LL_ASSERT(lll_aux); + LL_ASSERT_DBG(lll_aux); chain = CONTAINER_OF(lll_aux, struct ll_scan_aux_chain, lll); - LL_ASSERT(sync_lll == chain->parent); + LL_ASSERT_DBG(sync_lll == chain->parent); } if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || lll) { @@ -1750,7 +1754,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) break; #endif /* CONFIG_BT_CTLR_PHY_CODED */ default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); + return; } @@ -1785,7 +1790,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * passed in the node rx footer field. */ sync_lll = ftr->param; - LL_ASSERT(!sync_lll->lll_aux); + LL_ASSERT_DBG(!sync_lll->lll_aux); ull_sync = HDR_LLL2ULL(sync_lll); rx->hdr.handle = ull_sync_handle_get(ull_sync); @@ -1813,7 +1818,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } break; default: - LL_ASSERT(0); + LL_ASSERT_DBG(0); + return; } @@ -2009,7 +2015,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) PDU_ADV_AUX_PTR_PHY_GET(aux_ptr) == EXT_ADV_AUX_PHY_LE_CODED) || (aux_ptr->chan_idx >= CHM_USED_COUNT_MAX)) { if (is_scan_req) { - LL_ASSERT(chain && chain->rx_last); + LL_ASSERT_DBG(chain && chain->rx_last); chain->rx_last->rx_ftr.extra = rx; chain->rx_last = rx; @@ -2207,7 +2213,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) /* Switching to ULL scheduling to receive auxiliary PDUs */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || lll) { - LL_ASSERT(scan); + LL_ASSERT_DBG(scan); /* Do not ULL schedule if scan disable requested */ if (unlikely(scan->is_stop)) { @@ -2223,8 +2229,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } else { struct ll_sync_set *sync_set; - LL_ASSERT(sync_lll && - (!sync_lll->lll_aux || sync_lll->lll_aux == lll_aux)); + LL_ASSERT_ERR(sync_lll && + (!sync_lll->lll_aux || sync_lll->lll_aux == lll_aux)); /* Do not ULL schedule if sync terminate requested */ sync_set = HDR_LLL2ULL(sync_lll); @@ -2278,7 +2284,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * immediately since we are in sync context. */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || chain->rx_last) { - LL_ASSERT(scan); + LL_ASSERT_DBG(scan); /* rx could already be enqueued before coming here - * check if rx not the last in the list of received PDUs @@ -2291,12 +2297,12 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) chain->rx_last = rx; } } else { - LL_ASSERT(sync_lll); + LL_ASSERT_DBG(sync_lll); ll_rx_put_sched(link, rx); } - LL_ASSERT(chain->parent); + LL_ASSERT_DBG(chain->parent); flush_safe(chain); @@ -2318,7 +2324,7 @@ void ull_scan_aux_done(struct node_rx_event_done *done) /* Get reference to chain */ chain = CONTAINER_OF(done->extra.lll, struct ll_scan_aux_chain, lll); - LL_ASSERT(scan_aux_chain_is_valid_get(chain)); + LL_ASSERT_DBG(scan_aux_chain_is_valid_get(chain)); /* Remove chain from active list */ chain_remove_from_list(&scan_aux_set.active_chains, chain); @@ -2343,7 +2349,7 @@ void *ull_scan_aux_lll_parent_get(struct lll_scan_aux *lll, struct lll_scan *lllscan; lllscan = chain->parent; - LL_ASSERT(lllscan); + LL_ASSERT_DBG(lllscan); scan = HDR_LLL2ULL(lllscan); *is_lll_scan = !!ull_scan_is_valid_get(scan); @@ -2419,7 +2425,8 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) rx->rx_ftr.extra = NULL; } } else { - LL_ASSERT(0); + LL_ASSERT_DBG(0); + lll_aux = NULL; } @@ -2431,7 +2438,7 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) chain = CONTAINER_OF(lll_aux, struct ll_scan_aux_chain, lll); lll = chain->parent; - LL_ASSERT(lll); + LL_ASSERT_DBG(lll); scan = HDR_LLL2ULL(lll); scan = ull_scan_is_valid_get(scan); @@ -2447,7 +2454,7 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) } if (!is_stop) { - LL_ASSERT(chain->parent); + LL_ASSERT_DBG(chain->parent); /* Remove chain from active list and flush */ chain_remove_from_list(&scan_aux_set.active_chains, chain); @@ -2474,8 +2481,8 @@ static void scan_aux_stop_all_chains_for_parent(void *parent) /* Scheduled head is about to be removed - stop running ticker */ ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, TICKER_ID_SCAN_AUX, NULL, NULL); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); ticker_stopped = true; } @@ -2531,7 +2538,7 @@ static void scan_aux_stop_all_chains_for_parent(void *parent) mfy.param = &curr->lll; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } } else { prev = curr; @@ -2555,7 +2562,7 @@ int ull_scan_aux_stop(void *parent) /* Stop chains in ULL execution context */ mfy.param = parent; ret = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); /* Wait for chains to be stopped before returning */ (void)k_sem_take(&sem_scan_aux_stop, K_FOREVER); @@ -2587,7 +2594,7 @@ static inline void aux_chain_release(struct ll_scan_aux_chain *chain) /* Clear the parent so that when scan is being disabled then this * auxiliary context shall not associate itself from being disable. */ - LL_ASSERT(chain->parent); + LL_ASSERT_DBG(chain->parent); chain->parent = NULL; mem_release(chain, &scan_aux_free); @@ -2614,7 +2621,7 @@ static void flush_safe(void *param) struct ll_scan_aux_chain *chain; chain = param; - LL_ASSERT(chain->parent); + LL_ASSERT_DBG(chain->parent); if (chain_is_in_list(scan_aux_set.flushing_chains, chain)) { /* Chain already marked for flushing */ @@ -2646,7 +2653,7 @@ static void flush(struct ll_scan_aux_chain *chain) /* Debug check that parent was assigned when allocated for reception of * auxiliary channel PDUs. */ - LL_ASSERT(chain->parent); + LL_ASSERT_DBG(chain->parent); /* Chain is being flushed now - remove from flushing_chains if present */ chain_remove_from_list(&scan_aux_set.flushing_chains, chain); @@ -2702,7 +2709,7 @@ static void flush(struct ll_scan_aux_chain *chain) sync_lll = chain->parent; sync = HDR_LLL2ULL(sync_lll); - LL_ASSERT(sync->is_stop || sync_lll->lll_aux); + LL_ASSERT_DBG(sync->is_stop || sync_lll->lll_aux); sync_lll->lll_aux = NULL; } @@ -2716,16 +2723,16 @@ static void aux_sync_incomplete(struct ll_scan_aux_chain *chain) struct node_rx_pdu *rx; struct lll_sync *lll; - LL_ASSERT(chain->parent); + LL_ASSERT_DBG(chain->parent); /* get reference to sync context */ lll = chain->parent; - LL_ASSERT(lll); + LL_ASSERT_DBG(lll); sync = HDR_LLL2ULL(lll); /* pick extra node rx stored in sync context */ rx = sync->rx_incomplete; - LL_ASSERT(rx); + LL_ASSERT_DBG(rx); sync->rx_incomplete = NULL; /* prepare sync report with failure */ @@ -2810,16 +2817,16 @@ static void chain_start_ticker(struct ll_scan_aux_chain *chain, bool replace) (chain->ticker_ticks - ticks_slot_offset), NULL, NULL); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } #endif /* !CONFIG_BT_TICKER_SLOT_AGNOSTIC */ if (replace) { ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, TICKER_ID_SCAN_AUX, NULL, NULL); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } ticker_status = ticker_start(TICKER_INSTANCE_ID_CTLR, @@ -2834,13 +2841,13 @@ static void chain_start_ticker(struct ll_scan_aux_chain *chain, bool replace) ticks_slot_overhead), ticker_cb, chain, ticker_op_cb, chain); #if defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #else - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((ticker_status == TICKER_STATUS_FAILURE) && - IS_ENABLED(CONFIG_BT_TICKER_LOW_LAT))); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((ticker_status == TICKER_STATUS_FAILURE) && + IS_ENABLED(CONFIG_BT_TICKER_LOW_LAT))); #endif /* !CONFIG_BT_TICKER_SLOT_AGNOSTIC */ #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) @@ -2866,10 +2873,10 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&scan_aux_set.ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* The chain should always be the first in the sched_chains list */ - LL_ASSERT(scan_aux_set.sched_chains == chain); + LL_ASSERT_DBG(scan_aux_set.sched_chains == chain); /* Move chain to active list */ chain_remove_from_list(&scan_aux_set.sched_chains, chain); @@ -2886,7 +2893,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); if (scan_aux_set.sched_chains) { /* Start ticker for next chain */ @@ -2916,7 +2923,7 @@ static void ticker_start_failed(void *param) static void ticker_op_cb(uint32_t status, void *param) { #if defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); #else /* !CONFIG_BT_TICKER_SLOT_AGNOSTIC */ static memq_link_t link; static struct mayfly mfy = {0, 0, &link, NULL, ticker_start_failed}; @@ -2930,7 +2937,7 @@ static void ticker_op_cb(uint32_t status, void *param) ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 1, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); #endif /* !CONFIG_BT_TICKER_SLOT_AGNOSTIC */ } diff --git a/subsys/bluetooth/controller/ll_sw/ull_sched.c b/subsys/bluetooth/controller/ll_sw/ull_sched.c index 116ea101d133..5309e5c1f2a5 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sched.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sched.c @@ -465,12 +465,12 @@ static uint8_t after_match_slot_get(uint8_t user_id, uint32_t ticks_slot_abs, /* Using a local variable to address the Coverity rule: * Incorrect expression (ASSERT_SIDE_EFFECT) - * Argument "ret_cb" of LL_ASSERT() has a side effect + * Argument "ret_cb" of LL_ASSERT_ERR() has a side effect * because the variable is volatile. The containing function * might work differently in a non-debug build. */ success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT(success); + LL_ASSERT_ERR(success); /* There is a possibility that tickers expire while we * iterate through the active list of tickers, start over with @@ -478,7 +478,7 @@ static uint8_t after_match_slot_get(uint8_t user_id, uint32_t ticks_slot_abs, */ if ((ticker_id_prev != TICKER_NULL) && (*ticks_anchor != ticks_anchor_prev)) { - LL_ASSERT(retry); + LL_ASSERT_ERR(retry); retry--; ticker_id = ticker_id_prev = TICKER_NULL; diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index 0ce9658e8d24..183e8bc72bfb 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -425,8 +425,8 @@ void ull_sync_setup_from_sync_transfer(struct ll_conn *conn, uint16_t service_da (sync->ull.ticks_slot + ticks_slot_overhead), ticker_cb, sync, ticker_start_op_cb, (void *)__LINE__); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER */ @@ -490,7 +490,7 @@ uint8_t ll_sync_create_cancel(void **rx) if (sync->timeout_reload != 0U) { uint16_t sync_handle = ull_sync_handle_get(sync); - LL_ASSERT(sync_handle <= UINT8_MAX); + LL_ASSERT_DBG(sync_handle <= UINT8_MAX); /* Sync is not established yet, so stop sync ticker */ const int err = @@ -585,7 +585,7 @@ uint8_t ll_sync_terminate(uint16_t handle) } #if !defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS) - LL_ASSERT(!aux->parent); + LL_ASSERT_DBG(!aux->parent); #endif /* !CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */ } @@ -1153,8 +1153,8 @@ void ull_sync_setup(struct ll_scan_set *scan, uint8_t phy, (sync->ull.ticks_slot + ticks_slot_overhead), ticker_cb, sync, ticker_start_op_cb, (void *)__LINE__); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } void ull_sync_setup_reset(struct ll_sync_set *sync) @@ -1418,9 +1418,9 @@ void ull_sync_done(struct node_rx_event_done *done) ticks_drift_minus, 0, 0, lazy, force, ticker_update_op_cb, sync); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)sync == ull_disable_mark_get())); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)sync == ull_disable_mark_get())); } } } @@ -1435,7 +1435,7 @@ void ull_sync_chm_update(uint8_t sync_handle, uint8_t *acad, uint8_t acad_len) /* Get reference to LLL context */ sync = ull_sync_set_get(sync_handle); - LL_ASSERT(sync); + LL_ASSERT_DBG(sync); lll = &sync->lll; /* Ignore if already in progress */ @@ -1612,7 +1612,7 @@ static struct ll_sync_set *ull_sync_create(uint8_t sid, uint16_t timeout, uint16 /* Make sure that the node_rx_sync_establ hasn't got anything assigned. It is used to * mark when sync establishment is in progress. */ - LL_ASSERT(!sync->node_rx_sync_estab); + LL_ASSERT_DBG(!sync->node_rx_sync_estab); sync->node_rx_sync_estab = node_rx; /* Reporting initially enabled/disabled */ @@ -1659,7 +1659,7 @@ static struct ll_sync_set *ull_sync_create(uint8_t sid, uint16_t timeout, uint16 #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) ull_df_sync_cfg_init(&lll->df_cfg); - LL_ASSERT(!lll->node_cte_incomplete); + LL_ASSERT_DBG(!lll->node_cte_incomplete); #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ /* Initialise ULL and LLL headers */ @@ -1677,8 +1677,8 @@ static void sync_ticker_cleanup(struct ll_sync_set *sync, ticker_op_func stop_op /* Stop Periodic Sync Ticker */ ret = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, TICKER_ID_SCAN_SYNC_BASE + sync_handle, stop_op_cb, (void *)sync); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); /* Mark sync context not sync established */ sync->timeout_reload = 0U; @@ -1706,7 +1706,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&sync->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -1720,7 +1720,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy_lll_prepare); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_PREPARE_O(1); } @@ -1728,13 +1728,13 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, static void ticker_start_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); } static void ticker_update_op_cb(uint32_t status, void *param) { - LL_ASSERT(status == TICKER_STATUS_SUCCESS || - param == ull_disable_mark_get()); + LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || + (param == ull_disable_mark_get())); } static void ticker_stop_sync_expire_op_cb(uint32_t status, void *param) @@ -1743,13 +1743,13 @@ static void ticker_stop_sync_expire_op_cb(uint32_t status, void *param) static memq_link_t link; static struct mayfly mfy = {0, 0, &link, NULL, sync_expire}; - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); mfy.param = param; retval = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!retval); + LL_ASSERT_ERR(!retval); } static void sync_expire(void *param) @@ -1789,7 +1789,7 @@ static void ticker_stop_sync_lost_op_cb(uint32_t status, void *param) * sync lost scenario, do not generate the sync lost node rx from here */ if (status != TICKER_STATUS_SUCCESS) { - LL_ASSERT(param == ull_disable_mark_get()); + LL_ASSERT_DBG(param == ull_disable_mark_get()); return; } @@ -1798,7 +1798,7 @@ static void ticker_stop_sync_lost_op_cb(uint32_t status, void *param) retval = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT(!retval); + LL_ASSERT_ERR(!retval); } static void sync_lost(void *param) @@ -1900,8 +1900,8 @@ static struct pdu_cte_info *pdu_cte_info_get(struct pdu_adv *pdu) } /* Make sure there are no fields that are not allowed for AUX_SYNC_IND and AUX_CHAIN_IND */ - LL_ASSERT(!hdr->adv_addr); - LL_ASSERT(!hdr->tgt_addr); + LL_ASSERT_DBG(!hdr->adv_addr); + LL_ASSERT_DBG(!hdr->tgt_addr); return (struct pdu_cte_info *)hdr->data; } @@ -1956,7 +1956,7 @@ void ull_sync_transfer_received(struct ll_conn *conn, uint16_t service_data, conn_evt_current = ull_conn_event_counter(conn); /* LLCP should have ensured this holds */ - LL_ASSERT(sync_conn_event_count != conn_evt_current); + LL_ASSERT_DBG(sync_conn_event_count != conn_evt_current); ull_sync_setup_from_sync_transfer(conn, service_data, sync, si, conn_event_count - conn_evt_current, diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c index 222191bde22c..de741adfd6d5 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c @@ -203,9 +203,9 @@ uint8_t ll_big_sync_create(uint8_t big_handle, uint16_t sync_handle, /* Calculate GLTK */ err = bt_crypto_h7(BIG1, bcode, igltk); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); err = bt_crypto_h6(igltk, BIG2, sync_iso->gltk); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); lll->enc = 1U; } else { @@ -309,7 +309,8 @@ uint8_t ll_big_sync_terminate(uint8_t big_handle, void **rx) mfy.param = &sync_iso->lll; ret = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); + k_sem_take(&sem, K_FOREVER); sync_iso->flush_sem = NULL; @@ -390,7 +391,7 @@ void ull_sync_iso_stream_release(struct ll_sync_iso_set *sync_iso) stream_handle = lll->stream_handle[lll->stream_count]; stream = ull_sync_iso_stream_get(stream_handle); - LL_ASSERT(stream); + LL_ASSERT_DBG(stream); dp = stream->dp; if (dp) { @@ -503,7 +504,7 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, * Fix ptc and ptc_curr definitions, until then we keep an assertion check * here. */ - LL_ASSERT(ptc <= BIT_MASK(4)); + LL_ASSERT_DBG(ptc <= BIT_MASK(4)); lll->ptc = ptc; } else { lll->ptc = 0U; @@ -534,7 +535,7 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, /* Calculate GSK */ err = bt_crypto_h8(sync_iso->gltk, bi->gskd, BIG3, gsk); - LL_ASSERT(!err); + LL_ASSERT_DBG(!err); /* Prepare the CCM parameters */ ccm_rx = &lll->ccm_rx; @@ -586,7 +587,7 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, lll->window_size_event_us; /* Skip to first selected BIS subevent */ stream = ull_sync_iso_stream_get(lll->stream_handle[0]); - LL_ASSERT(stream); + LL_ASSERT_DBG(stream); if (lll->bis_spacing >= (lll->sub_interval * lll->nse)) { sync_iso_offset_us += (stream->bis_index - 1U) * @@ -709,8 +710,8 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, (sync_iso->ull.ticks_slot + ticks_slot_overhead), ticker_cb, sync_iso, ticker_start_op_cb, (void *)__LINE__); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } void ull_sync_iso_estab_done(struct node_rx_event_done *done) @@ -847,9 +848,9 @@ void ull_sync_iso_done(struct node_rx_event_done *done) lazy, force, ticker_update_op_cb, sync_iso); - LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)sync_iso == ull_disable_mark_get())); + LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)sync_iso == ull_disable_mark_get())); } } @@ -999,7 +1000,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&sync_iso->ull); - LL_ASSERT(ref); + LL_ASSERT_DBG(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -1012,7 +1013,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy_lll_prepare); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); DEBUG_RADIO_PREPARE_O(1); } @@ -1021,13 +1022,13 @@ static void ticker_start_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); } static void ticker_update_op_cb(uint32_t status, void *param) { - LL_ASSERT(status == TICKER_STATUS_SUCCESS || - param == ull_disable_mark_get()); + LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || + (param == ull_disable_mark_get())); } static void ticker_stop_op_cb(uint32_t status, void *param) @@ -1036,13 +1037,13 @@ static void ticker_stop_op_cb(uint32_t status, void *param) static struct mayfly mfy = {0U, 0U, &link, NULL, sync_iso_disable}; uint32_t ret; - LL_ASSERT(status == TICKER_STATUS_SUCCESS); + LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); /* Check if any pending LLL events that need to be aborted */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void sync_iso_disable(void *param) @@ -1063,14 +1064,14 @@ static void sync_iso_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT(!hdr->disabled_cb); + LL_ASSERT_ERR(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } else { /* No pending LLL events */ disabled_cb(&sync_iso->lll); @@ -1107,7 +1108,7 @@ static void disabled_cb(void *param) /* Generate BIG sync lost */ rx = (void *)&sync_iso->node_rx_lost; - LL_ASSERT(rx->hdr.link); + LL_ASSERT_DBG(rx->hdr.link); link = rx->hdr.link; rx->hdr.link = NULL; @@ -1117,7 +1118,7 @@ static void disabled_cb(void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy); - LL_ASSERT(!ret); + LL_ASSERT_ERR(!ret); } static void stop_ticker(struct ll_sync_iso_set *sync_iso, ticker_op_func fp_op_func) @@ -1137,6 +1138,6 @@ static void stop_ticker(struct ll_sync_iso_set *sync_iso, ticker_op_func fp_op_f sync_iso_handle_to_index(handle), fp_op_func, fp_op_func ? (void *)sync_iso : NULL); - LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } diff --git a/subsys/bluetooth/controller/ticker/ticker.c b/subsys/bluetooth/controller/ticker/ticker.c index 065e9981c5f0..567301756e29 100644 --- a/subsys/bluetooth/controller/ticker/ticker.c +++ b/subsys/bluetooth/controller/ticker/ticker.c @@ -1448,7 +1448,7 @@ void ticker_worker(void *param) timeout_func = ticker->ext_data->ext_timeout_func; expire_info = ticker->ext_data->other_expire_info; if (ticker->ext_data->expire_info_id != TICKER_NULL) { - LL_ASSERT(expire_info && !expire_info->outdated); + LL_ASSERT_DBG(expire_info && !expire_info->outdated); } ext_context.context = ticker->context; @@ -2327,7 +2327,7 @@ static inline uint32_t ticker_job_op_start(struct ticker_instance *instance, #if defined(CONFIG_BT_TICKER_LOW_LAT) /* Must expire is not supported in compatibility mode */ - LL_ASSERT(start->lazy < TICKER_LAZY_MUST_EXPIRE_KEEP); + LL_ASSERT_DBG(start->lazy < TICKER_LAZY_MUST_EXPIRE_KEEP); #else #if !defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) if (start->lazy != TICKER_LAZY_MUST_EXPIRE_KEEP) { @@ -2492,7 +2492,7 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) } /* Ensure that resched ticker is expired */ - LL_ASSERT(ticker_resched->ticks_to_expire == 0U); + LL_ASSERT_DBG(ticker_resched->ticks_to_expire == 0U); /* Use ticker's reserved time ticks_slot, else for unreserved * tickers use the reschedule margin as ticks_slot. @@ -2500,7 +2500,7 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) if (ticker_resched->ticks_slot) { ticks_slot = ticker_resched->ticks_slot; } else { - LL_ASSERT(TICKER_HAS_SLOT_WINDOW(ticker_resched)); + LL_ASSERT_DBG(TICKER_HAS_SLOT_WINDOW(ticker_resched)); ticks_slot = HAL_TICKER_RESCHEDULE_MARGIN; } @@ -3181,7 +3181,7 @@ ticker_job_compare_update(struct ticker_instance *instance, uint32_t ticks_elapsed; uint32_t ticks_diff; - LL_ASSERT(i); + LL_ASSERT_ERR(i); i--; cc = instance->ticks_current; diff --git a/tests/bluetooth/init/prj_ctlr.conf b/tests/bluetooth/init/prj_ctlr.conf index b311a76b1cde..c733ef4ad3fc 100644 --- a/tests/bluetooth/init/prj_ctlr.conf +++ b/tests/bluetooth/init/prj_ctlr.conf @@ -8,6 +8,7 @@ CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_BT_CLASSIC=n +CONFIG_BT_CTLR_ASSERT_DEBUG=n CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC_TICKER=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_ctlr_dbg.conf b/tests/bluetooth/init/prj_ctlr_dbg.conf index cc6f478b66b6..956c562c5aa0 100644 --- a/tests/bluetooth/init/prj_ctlr_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_dbg.conf @@ -31,6 +31,7 @@ CONFIG_BT_CTLR_SCAN_REQ_RSSI=y CONFIG_BT_CTLR_SCAN_INDICATION=y CONFIG_BT_CTLR_OPTIMIZE_FOR_SPEED=y CONFIG_BT_CTLR_PROFILE_ISR=y +CONFIG_BT_CTLR_ASSERT_DEBUG=y CONFIG_BT_CTLR_DEBUG_PINS=y CONFIG_BT_CTLR_TEST=y CONFIG_BT_HCI_VS=y From 5a5e7f1349e0b04dd9ea0591fed777a76f4afa8c Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 6 Sep 2025 06:40:25 +0200 Subject: [PATCH 0210/3334] [nrf fromtree] Bluetooth: Controller: Reduce assertion check code size Reduce Controller assertion check code size for ARM Cortex-M CPUs by using the undefined instruction exception. `arm-none-eabi-addr2line` commandline can be used to get the source file and line number. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 5db80f0d579b2a2064f0737474c00f902b5dd0d9) Signed-off-by: Vinayak Kariappa Chettimada --- doc/connectivity/bluetooth/api/hci.txt | 8 ++-- include/zephyr/bluetooth/hci_vs.h | 4 +- subsys/bluetooth/controller/Kconfig | 15 ++++++ .../bluetooth/controller/Kconfig.ll_sw_split | 2 + subsys/bluetooth/controller/hal/debug.h | 47 ++++++++++++++++--- subsys/bluetooth/controller/hci/hci.c | 1 + 6 files changed, 65 insertions(+), 12 deletions(-) diff --git a/doc/connectivity/bluetooth/api/hci.txt b/doc/connectivity/bluetooth/api/hci.txt index 2ad17bfae5eb..a23b24e6ad0e 100644 --- a/doc/connectivity/bluetooth/api/hci.txt +++ b/doc/connectivity/bluetooth/api/hci.txt @@ -1085,14 +1085,13 @@ represents. | Event | Event Code | Event Parameters | +-------------------------------+------------+-------------------------------+ | Fatal_Error | 0xFF | Subevent_Code, | -| | | Error_Data_Type, | | | | Error_Data | +-------------------------------+------------+-------------------------------+ -The Error_Data_Type provides an information about what is the Error_Data size -and content. +The Subevent_Code provides an information about what is the Error_Data size and +content. - Error_Data_Type: Size: 1 Octet + Subevent_Code: Size: 1 Octet +--------------------+--------------------------------------+ | Value | Parameter Description | +--------------------+--------------------------------------+ @@ -1157,6 +1156,7 @@ Zephyr Fatal Error event may be generated by k_sys_fatal_error_handler. | a4 | 4 octets | General purpose register | | ip | 4 octets | Instruction pointer register | | lr | 4 octets | Link register | + | pc | 4 octets | Program counter register | | xpsr | 4 octets | Program status register | +--------------------+--------------------------------------------+ diff --git a/include/zephyr/bluetooth/hci_vs.h b/include/zephyr/bluetooth/hci_vs.h index 1170c41474a2..3943696c195b 100644 --- a/include/zephyr/bluetooth/hci_vs.h +++ b/include/zephyr/bluetooth/hci_vs.h @@ -222,8 +222,6 @@ struct bt_hci_evt_vs { uint8_t subevent; } __packed; -#define BT_HCI_EVT_VS_FATAL_ERROR 0x02 - #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_STACK_FRAME 0x01 #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_CTRL_ASSERT 0x02 #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_TRACE 0x03 @@ -234,8 +232,10 @@ struct bt_hci_vs_fata_error_cpu_data_cortex_m { uint32_t a4; uint32_t ip; uint32_t lr; + uint32_t pc; uint32_t xpsr; } __packed; + #define BT_HCI_EVT_VS_ERROR_CPU_TYPE_CORTEX_M 0x01 struct bt_hci_vs_fatal_error_stack_frame { uint32_t reason; diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index d6c7db02ea6e..7fd3c46fe35a 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -1188,6 +1188,9 @@ rsource "Kconfig.df" rsource "Kconfig.ll_sw_split" rsource "Kconfig.dtm" +config BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE_SUPPORT + bool + config BT_CTLR_ASSERT_DEBUG bool "Development asserts" default y @@ -1209,6 +1212,18 @@ config BT_CTLR_ASSERT_HANDLER and will be invoked whenever the controller code encounters an unrecoverable error. +config BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE + bool "Assertions optimized for code size" + depends on BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE_SUPPORT + default y + help + Optimize Controller assertion check for code size. + + Example, reduces assertion check code size for ARM Cortex-M CPUs by using the undefined + instruction exception. + `arm-none-eabi-addr2line` commandline can be used to get the source file and line number + from the program counter value. + config BT_CTLR_VS_SCAN_REQ_RX bool "Use scan request reporting" depends on BT_HCI_VS && !BT_CTLR_ADV_EXT diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 950e9bc7e58b..e862034c2550 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -70,6 +70,8 @@ config BT_LLL_VENDOR_NORDIC select BT_TICKER_PREFER_START_BEFORE_STOP if BT_TICKER_SLOT_AGNOSTIC + select BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE_SUPPORT if CPU_CORTEX_M + default y help Use Nordic Lower Link Layer implementation. diff --git a/subsys/bluetooth/controller/hal/debug.h b/subsys/bluetooth/controller/hal/debug.h index cb193a460971..98e827534fe7 100644 --- a/subsys/bluetooth/controller/hal/debug.h +++ b/subsys/bluetooth/controller/hal/debug.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Nordic Semiconductor ASA + * Copyright (c) 2016-2025 Nordic Semiconductor ASA * Copyright (c) 2016 Vinayak Kariappa Chettimada * * SPDX-License-Identifier: Apache-2.0 @@ -7,25 +7,60 @@ #include "common/assert.h" -#ifdef CONFIG_BT_CTLR_ASSERT_HANDLER +#if defined(CONFIG_BT_CTLR_ASSERT_HANDLER) void bt_ctlr_assert_handle(char *file, uint32_t line); + +#if defined(CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE) +BUILD_ASSERT(IS_ENABLED(CONFIG_CPU_CORTEX_M)); +/* Generate assertion as undefined instruction exception. + */ +#define LL_ASSERT(x) \ + do { \ + if (unlikely(!(x))) { \ + __asm__ inline volatile (".inst 0xde00\n"); \ + } \ + } while (0) + +#else /* !CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE */ +/* Generate assertion with file name and line number. + * NOTE: Variable code size increase per assertion check, depends on full file name path string + * length. + */ #define LL_ASSERT(cond) \ - if (!(cond)) { \ + if (unlikely(!(cond))) { \ BT_ASSERT_PRINT(cond); \ bt_ctlr_assert_handle(__FILE__, __LINE__); \ } +#endif /* !CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE */ + #define LL_ASSERT_MSG(cond, fmt, ...) \ - if (!(cond)) { \ + if (unlikely(!(cond))) { \ BT_ASSERT_PRINT(cond); \ BT_ASSERT_PRINT_MSG(fmt, ##__VA_ARGS__); \ bt_ctlr_assert_handle(__FILE__, __LINE__); \ } -#else + +#else /* !CONFIG_BT_CTLR_ASSERT_HANDLER */ + +#if defined(CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE) +BUILD_ASSERT(IS_ENABLED(CONFIG_CPU_CORTEX_M)); +/* Generate assertion as undefined instruction exception. + */ +#define LL_ASSERT(x) \ + do { \ + if (unlikely(!(x))) { \ + __asm__ inline volatile (".inst 0xde00\n"); \ + } \ + } while (0) + +#else /* !CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE */ #define LL_ASSERT(cond) \ BT_ASSERT(cond) +#endif /* !CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE */ + #define LL_ASSERT_MSG(cond, fmt, ...) \ BT_ASSERT_MSG(cond, fmt, ##__VA_ARGS__) -#endif +#endif /* !CONFIG_BT_CTLR_ASSERT_HANDLER */ /* Fatal asserts. * The Controller will otherwise misbehave causing memory leak or system-wide memory corruptions due diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index eaf4667a1b85..0e8a41260ccb 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -5284,6 +5284,7 @@ static void vs_err_fatal_cpu_data_fill(bt_hci_vs_fatal_error_cpu_data *cpu_data, cpu_data->a4 = sys_cpu_to_le32(esf->basic.a4); cpu_data->ip = sys_cpu_to_le32(esf->basic.ip); cpu_data->lr = sys_cpu_to_le32(esf->basic.lr); + cpu_data->pc = sys_cpu_to_le32(esf->basic.pc); cpu_data->xpsr = sys_cpu_to_le32(esf->basic.xpsr); } #endif /* CONFIG_CPU_CORTEX_M */ From 4e43e216124881251a21dc25bd48546ba18840d8 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 9 Sep 2025 13:31:44 +0200 Subject: [PATCH 0211/3334] [nrf fromtree] samples: Bluetooth: hci_ipc: Enable HCI vendor-specific h/w error event Enable HCI vendor-specific h/w error event generation in samples and tests. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 29cf367568d7c6f43d87b249fe6f7bb8e4341e17) Signed-off-by: Vinayak Kariappa Chettimada --- doc/releases/migration-guide-4.3.rst | 5 +- include/zephyr/bluetooth/hci_vs.h | 2 +- .../nrf5340_cpunet_bis-bt_ll_sw_split.conf | 3 +- ...nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf | 2 + .../nrf5340_cpunet_cis-bt_ll_sw_split.conf | 3 +- .../nrf5340_cpunet_df-bt_ll_sw_split.conf | 3 +- .../nrf5340_cpunet_iso-bt_ll_sw_split.conf | 3 +- ...0_cpunet_iso_broadcast-bt_ll_sw_split.conf | 2 + ...340_cpunet_iso_central-bt_ll_sw_split.conf | 2 + ..._cpunet_iso_peripheral-bt_ll_sw_split.conf | 2 + ...340_cpunet_iso_receive-bt_ll_sw_split.conf | 2 + samples/bluetooth/hci_ipc/src/main.c | 4 ++ .../hci_uart/overlay-all-bt_ll_sw_split.conf | 3 +- subsys/bluetooth/controller/hci/hci.c | 57 ++++++++++--------- 14 files changed, 60 insertions(+), 33 deletions(-) diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index e2e6c21b57d7..83dc5e771201 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -91,10 +91,13 @@ Bluetooth Bluetooth Controller ==================== -* The following Kconfig option have been renamed: +* The following have been renamed: * :kconfig:option:`CONFIG_BT_CTRL_ADV_ADI_IN_SCAN_RSP` to :kconfig:option:`CONFIG_BT_CTLR_ADV_ADI_IN_SCAN_RSP` + * :c:struct:`bt_hci_vs_fata_error_cpu_data_cortex_m` to + :c:struct:`bt_hci_vs_fatal_error_cpu_data_cortex_m` and now contains the program counter + value. .. zephyr-keep-sorted-start re(^\w) diff --git a/include/zephyr/bluetooth/hci_vs.h b/include/zephyr/bluetooth/hci_vs.h index 3943696c195b..904bcbdb2d5d 100644 --- a/include/zephyr/bluetooth/hci_vs.h +++ b/include/zephyr/bluetooth/hci_vs.h @@ -225,7 +225,7 @@ struct bt_hci_evt_vs { #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_STACK_FRAME 0x01 #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_CTRL_ASSERT 0x02 #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_TRACE 0x03 -struct bt_hci_vs_fata_error_cpu_data_cortex_m { +struct bt_hci_vs_fatal_error_cpu_data_cortex_m { uint32_t a1; uint32_t a2; uint32_t a3; diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf index 9e3225621842..2827eeeeab23 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf @@ -44,8 +44,9 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y CONFIG_BT_CTLR_DTM_HCI=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf index 89ba46ff357a..1ba04dc5dd5b 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf @@ -12,6 +12,8 @@ CONFIG_BT_MAX_CONN=16 # Controller CONFIG_BT_LL_SW_SPLIT=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y # Disable unused Bluetooth features CONFIG_BT_CTLR_DUP_FILTER_LEN=0 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf index 740de0cc83eb..1f652ddbeb58 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf @@ -43,8 +43,9 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y CONFIG_BT_CTLR_DTM_HCI=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf index 663751c16e65..7a6f8544986b 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf @@ -29,8 +29,9 @@ CONFIG_BT_MAX_CONN=2 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y CONFIG_BT_CTLR_DTM_HCI=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf index 710530568acb..6016318536bc 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf @@ -53,8 +53,9 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y CONFIG_BT_CTLR_DTM_HCI=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf index c63928dd27ca..015a0e102f71 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf @@ -30,6 +30,8 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # ISO Broadcast Controller CONFIG_BT_LL_SW_SPLIT=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y CONFIG_BT_CTLR_ADV_PERIODIC=y CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191 CONFIG_BT_CTLR_ADV_ISO=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf index 55e680990eed..6f84bc3d7cfe 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf @@ -40,6 +40,8 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf index 0031111ede82..3629ee8c9176 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf @@ -40,6 +40,8 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf index c0922ba9f932..1b2e85e7a604 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf @@ -22,6 +22,8 @@ CONFIG_BT_PERIPHERAL=n # ISO Receive Controller CONFIG_BT_LL_SW_SPLIT=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y CONFIG_BT_CTLR_SYNC_PERIODIC=y CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 CONFIG_BT_CTLR_SYNC_ISO=y diff --git a/samples/bluetooth/hci_ipc/src/main.c b/samples/bluetooth/hci_ipc/src/main.c index 3641d5d98968..1dd941b58bd9 100644 --- a/samples/bluetooth/hci_ipc/src/main.c +++ b/samples/bluetooth/hci_ipc/src/main.c @@ -307,7 +307,10 @@ void bt_ctlr_assert_handle(char *file, uint32_t line) LOG_PANIC(); while (true) { + k_cpu_idle(); }; + + CODE_UNREACHABLE; } #endif /* CONFIG_BT_CTLR_ASSERT_HANDLER */ @@ -338,6 +341,7 @@ void k_sys_fatal_error_handler(unsigned int reason, const struct arch_esf *esf) LOG_PANIC(); while (true) { + k_cpu_idle(); }; CODE_UNREACHABLE; diff --git a/samples/bluetooth/hci_uart/overlay-all-bt_ll_sw_split.conf b/samples/bluetooth/hci_uart/overlay-all-bt_ll_sw_split.conf index 05fbeb7be780..e5b65559919c 100644 --- a/samples/bluetooth/hci_uart/overlay-all-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_uart/overlay-all-bt_ll_sw_split.conf @@ -28,8 +28,9 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y CONFIG_BT_CTLR_DTM_HCI=y +CONFIG_BT_CTLR_ASSERT_HANDLER=y +CONFIG_BT_HCI_VS_FATAL_ERROR=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 0e8a41260ccb..81856d7c428d 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -5273,9 +5273,9 @@ NET_BUF_POOL_FIXED_DEFINE(vs_err_tx_pool, 1, BT_BUF_EVT_RX_SIZE, 0, NULL); * the alias is defined here. */ #if defined(CONFIG_CPU_CORTEX_M) -typedef struct bt_hci_vs_fata_error_cpu_data_cortex_m bt_hci_vs_fatal_error_cpu_data; +static struct net_buf *vs_err_evt_create(uint8_t subevt, uint8_t len); -static void vs_err_fatal_cpu_data_fill(bt_hci_vs_fatal_error_cpu_data *cpu_data, +static void vs_err_fatal_cpu_data_fill(struct bt_hci_vs_fatal_error_cpu_data_cortex_m *cpu_data, const struct arch_esf *esf) { cpu_data->a1 = sys_cpu_to_le32(esf->basic.a1); @@ -5287,7 +5287,35 @@ static void vs_err_fatal_cpu_data_fill(bt_hci_vs_fatal_error_cpu_data *cpu_data, cpu_data->pc = sys_cpu_to_le32(esf->basic.pc); cpu_data->xpsr = sys_cpu_to_le32(esf->basic.xpsr); } -#endif /* CONFIG_CPU_CORTEX_M */ + +struct net_buf *hci_vs_err_stack_frame(unsigned int reason, const struct arch_esf *esf) +{ + /* Prepare vendor specific HCI Fatal Error event */ + struct bt_hci_vs_fatal_error_stack_frame *sf; + struct bt_hci_vs_fatal_error_cpu_data_cortex_m *cpu_data; + struct net_buf *buf; + + buf = vs_err_evt_create(BT_HCI_EVT_VS_ERROR_DATA_TYPE_STACK_FRAME, + sizeof(*sf) + sizeof(*cpu_data)); + if (buf != NULL) { + sf = net_buf_add(buf, (sizeof(*sf) + sizeof(*cpu_data))); + sf->reason = sys_cpu_to_le32(reason); + sf->cpu_type = BT_HCI_EVT_VS_ERROR_CPU_TYPE_CORTEX_M; + + vs_err_fatal_cpu_data_fill((void *)sf->cpu_data, esf); + } else { + LOG_WRN("Can't create HCI Fatal Error event"); + } + + return buf; +} + +#else /* !CONFIG_CPU_CORTEX_M */ +struct net_buf *hci_vs_err_stack_frame(unsigned int reason, const struct arch_esf *esf) +{ + return NULL; +} +#endif /* !CONFIG_CPU_CORTEX_M */ static struct net_buf *vs_err_evt_create(uint8_t subevt, uint8_t len) { @@ -5311,29 +5339,6 @@ static struct net_buf *vs_err_evt_create(uint8_t subevt, uint8_t len) return buf; } -struct net_buf *hci_vs_err_stack_frame(unsigned int reason, const struct arch_esf *esf) -{ - /* Prepare vendor specific HCI Fatal Error event */ - struct bt_hci_vs_fatal_error_stack_frame *sf; - bt_hci_vs_fatal_error_cpu_data *cpu_data; - struct net_buf *buf; - - buf = vs_err_evt_create(BT_HCI_EVT_VS_ERROR_DATA_TYPE_STACK_FRAME, - sizeof(*sf) + sizeof(*cpu_data)); - if (buf != NULL) { - sf = net_buf_add(buf, (sizeof(*sf) + sizeof(*cpu_data))); - sf->reason = sys_cpu_to_le32(reason); - sf->cpu_type = BT_HCI_EVT_VS_ERROR_CPU_TYPE_CORTEX_M; - - vs_err_fatal_cpu_data_fill( - (bt_hci_vs_fatal_error_cpu_data *)sf->cpu_data, esf); - } else { - LOG_ERR("Can't create HCI Fatal Error event"); - } - - return buf; -} - static struct net_buf *hci_vs_err_trace_create(uint8_t data_type, const char *file_path, uint32_t line, uint64_t pc) From ec0b45602e7edbc4d93040c8e469f3d19d9043cd Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 18 Oct 2025 07:00:43 +0200 Subject: [PATCH 0212/3334] [nrf fromtree] Bluetooth: Controller: Add code comments related to short prepare Add code comments explaining the handling of short prepare that can be enqueued out of order and present in use of FIFO for prepare pipeline. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit d737e285e57bae84057160a5ee94b7c566b9705e) Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/lll/lll.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 6a61c0c6605d..d5903805e571 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -852,16 +852,41 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, ticks_at_preempt_next = ready->prepare_param.ticks_at_expire; diff = ticker_ticks_diff_get(ticks_at_preempt_min, ticks_at_preempt_next); + /* If the enqueued prepare is a resume or current ready prepare is shorter, then we + * should pick current ready prepare for setting up the prepare timeout. + */ if (is_resume || ((diff & BIT(HAL_TICKER_CNTR_MSBIT)) == 0U)) { ticks_at_preempt_min = ticks_at_preempt_next; if (&ready->prepare_param != prepare_param) { + /* There is a shorter prepare in the pipeline */ ready_short = ready; + } else { + /* It is the same prepare in the pipeline being enqueued. + * This can happen executing `lll_done()`. + * Hence, we should ignore it being the `first` that setup the + * preempt timeout and also it has already setup the preempt + * timeout, refer to `preempt_ticker_start()` for details. + * + * We also set the `ready` to NULL as it is the same ready, the one + * being enqueued. This help short circuit a related assertion check + * later in this function. + */ + ready = NULL; } } else { ready = NULL; idx_backup = UINT8_MAX; } + /* Loop and find any short prepare present out-of-order in the prepare pipeline. + * + * NOTE: This loop is O(n), where n is number of items in prepare pipeline present + * before a short prepare was enqueued in to the FIFO. + * Use of ordered linked list implementation has show improved lower latencies + * and less CPU use. + * TODO: Replace use of FIFO for prepare pipeline with ordered linked list + * implementation. + */ do { struct lll_event *ready_next; From 8fa4b61ea0c14bca2727ad62cc6d64e23d419884 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Mon, 2 Jun 2025 08:47:12 +0530 Subject: [PATCH 0213/3334] [nrf fromtree] Bluetooth: Controller: nRF54Lx: Add Controller Privacy Support Add Controller Privacy support for nRF54Lx by porting to use NRF_AAR00 h/w peripheral. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 6d79d52118d2bdff67ab7f8216f1d2e6e88a3338) Signed-off-by: Vinayak Kariappa Chettimada --- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 110 ++++++++++++++++++ .../nordic/hal/nrf5/radio/radio_nrf54lx.h | 3 + .../nordic/hal/nrf5/radio/radio_nrf5_dppi.h | 11 ++ .../nrf5/radio/radio_nrf5_dppi_resources.h | 12 +- .../nordic/hal/nrf5/radio/radio_sim_nrf54l.h | 3 + 5 files changed, 136 insertions(+), 3 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 218965d11bd0..7056f020bc28 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 @@ -2562,7 +2562,48 @@ void radio_ccm_disable(void) #endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */ #if defined(CONFIG_BT_CTLR_PRIVACY) +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +struct aar_job_ptr { + void *ptr; + struct { + uint32_t length:24; + uint32_t attribute:8; + } __packed; +} __packed; + +#define AAR_JOB_PTR_ATTRIBUTE_HASH 11U +#define AAR_JOB_PTR_ATTRIBUTE_PRAND 12U +#define AAR_JOB_PTR_ATTRIBUTE_IRK 13U +#define AAR_JOB_PTR_ATTRIBUTE_INDEX 11U + +#define AAR_JOB_OUT_MAX_RESOLVED 1U + +#define AAR_IRK_SIZE 16U + +#define RADIO_PACKET_PTR_TO_PDU_OFFSET 3U + +#define BDADDR_HASH_OFFSET 0U +#define BDADDR_HASH_SIZE 3U +#define BDADDR_PRND_OFFSET 3U +#define BDADDR_PRND_SIZE 3U + +/* AAR HAL global memory referenced by the h/w peripheral and its DMA */ +static struct { + /* Index of the IRK match in the AAR job list, on successful resolution */ + uint32_t status; + + /* Input AAR job list; list of Hash, Prand, IRKs and a terminating empty job entry */ + struct aar_job_ptr in[CONFIG_BT_CTLR_RL_SIZE + 3]; + + /* Output AAR job list of one entry */ + struct aar_job_ptr out[AAR_JOB_OUT_MAX_RESOLVED]; + + /* NOTE: Refer to the AAR section in the SoC product specification for details */ +} aar_job; + +#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ static uint8_t MALIGN(4) _aar_scratch[3]; +#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ void radio_ar_configure(uint32_t nirk, void *irk, uint8_t flags) { @@ -2599,10 +2640,57 @@ void radio_ar_configure(uint32_t nirk, void *irk, uint8_t flags) NRF_AAR->ENABLE = (AAR_ENABLE_ENABLE_Enabled << AAR_ENABLE_ENABLE_Pos) & AAR_ENABLE_ENABLE_Msk; + +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + /* Input, Resolvable Address Hash offset in the legacy or extended advertising PDU. + * Radio packet pointer offset by 3 compared to legacy AAR in nRF51/52/53 SoCs that took + * Radio packet pointer value. + */ + aar_job.in[0].ptr = (uint8_t *)addrptr + RADIO_PACKET_PTR_TO_PDU_OFFSET + + BDADDR_HASH_OFFSET; + aar_job.in[0].length = BDADDR_HASH_SIZE; + aar_job.in[0].attribute = AAR_JOB_PTR_ATTRIBUTE_HASH; + + /* Input, Resolvable Address Random offset in the legacy or extended advertising PDU. + * Radio packet pointer offset by 3 compared to legacy AAR in nRF51/52/53 SoCs that took + * Radio packet pointer, plus offset of the 24-bit random in the legacy or extended + * advertising PDU after the 24-bit Hash in the Resolvable Address. + */ + aar_job.in[1].ptr = (uint8_t *)addrptr + RADIO_PACKET_PTR_TO_PDU_OFFSET + + BDADDR_PRND_OFFSET; + aar_job.in[1].length = BDADDR_PRND_SIZE; + aar_job.in[1].attribute = AAR_JOB_PTR_ATTRIBUTE_PRAND; + + /* Input, list of IRKs used for resolution */ + for (uint32_t i = 0; i < nirk; i++) { + aar_job.in[2U + i].ptr = (void *)(((uint8_t *)irk) + (AAR_IRK_SIZE * i)); + aar_job.in[2U + i].length = AAR_IRK_SIZE; + aar_job.in[2U + i].attribute = AAR_JOB_PTR_ATTRIBUTE_IRK; + } + + /* A terminating empty job entry */ + aar_job.in[2U + nirk].ptr = 0U; + aar_job.in[2U + nirk].length = 0U; + aar_job.in[2U + nirk].attribute = 0U; + + /* Reset match index to invalid value ( >= CONFIG_BT_CTLR_RL_SIZE ) */ + aar_job.status = UINT32_MAX; + + /* Output, single job entry that populates the `status` value with match index */ + aar_job.out[0].ptr = &aar_job.status; + aar_job.out[0].length = sizeof(aar_job.status); + aar_job.out[0].attribute = AAR_JOB_PTR_ATTRIBUTE_INDEX; + + NRF_AAR->IN.PTR = (uint32_t)&aar_job.in[0]; + NRF_AAR->OUT.PTR = (uint32_t)&aar_job.out[0]; + NRF_AAR->MAXRESOLVED = AAR_JOB_OUT_MAX_RESOLVED; + +#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ NRF_AAR->NIRK = nirk; NRF_AAR->IRKPTR = (uint32_t)irk; NRF_AAR->ADDRPTR = addrptr; NRF_AAR->SCRATCHPTR = (uint32_t)&_aar_scratch[0]; +#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ nrf_aar_event_clear(NRF_AAR, NRF_AAR_EVENT_END); nrf_aar_event_clear(NRF_AAR, NRF_AAR_EVENT_RESOLVED); @@ -2617,7 +2705,11 @@ void radio_ar_configure(uint32_t nirk, void *irk, uint8_t flags) uint32_t radio_ar_match_get(void) { +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + return aar_job.status; +#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ return NRF_AAR->STATUS; +#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_ar_status_reset(void) @@ -2660,7 +2752,25 @@ uint8_t radio_ar_resolve(const uint8_t *addr) NRF_AAR->ENABLE = (AAR_ENABLE_ENABLE_Enabled << AAR_ENABLE_ENABLE_Pos) & AAR_ENABLE_ENABLE_Msk; +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + /* Input, Resolvable Address Hash offset in the supplied address buffer */ + aar_job.in[0].ptr = (void *)&addr[BDADDR_HASH_OFFSET]; + + /* Input, Resolvable Address Prand offset in the supplied address buffer */ + aar_job.in[1].ptr = (void *)&addr[BDADDR_PRND_OFFSET]; + + /* Reset match index to invalid value ( >= CONFIG_BT_CTLR_RL_SIZE ) */ + aar_job.status = UINT32_MAX; + + /* NOTE: Other `aar_job` structure members are initialized in `radio_ar_configure()` */ + + NRF_AAR->IN.PTR = (uint32_t)&aar_job.in[0]; + NRF_AAR->OUT.PTR = (uint32_t)&aar_job.out[0]; + NRF_AAR->MAXRESOLVED = AAR_JOB_OUT_MAX_RESOLVED; + +#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ NRF_AAR->ADDRPTR = (uint32_t)addr - 3; +#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ nrf_aar_event_clear(NRF_AAR, NRF_AAR_EVENT_END); nrf_aar_event_clear(NRF_AAR, NRF_AAR_EVENT_RESOLVED); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h index 047e3ea24878..3a8206d79764 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h @@ -398,6 +398,9 @@ #define CCM_MODE_DATARATE_500Kbps CCM_MODE_DATARATE_500Kbit #define CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbps CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbit +/* HAL abstraction of AAR h/w */ +#define NRF_AAR NRF_AAR00 + static inline void hal_radio_reset(void) { /* TODO: Add any required setup for each radio event diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h index 3b68259c9bf6..1085f72f0b98 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h @@ -226,6 +226,17 @@ static inline void hal_trigger_aar_ppi_config(void) { nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_BCMATCH, HAL_TRIGGER_AAR_PPI); nrf_aar_subscribe_set(NRF_AAR, NRF_AAR_TASK_START, HAL_TRIGGER_AAR_PPI); + +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + /* Enable same DPPI in MCU domain */ + nrf_dppi_channels_enable(NRF_DPPIC00, BIT(HAL_TRIGGER_AAR_PPI)); + + /* Setup PPIB send subscribe */ + nrf_ppib_subscribe_set(NRF_PPIB10, HAL_PPIB_SEND_TRIGGER_AAR_PPI, HAL_TRIGGER_AAR_PPI); + + /* Setup PPIB receive publish */ + nrf_ppib_publish_set(NRF_PPIB00, HAL_PPIB_RECEIVE_TRIGGER_AAR_PPI, HAL_TRIGGER_AAR_PPI); +#endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ } #endif /* CONFIG_BT_CTLR_PRIVACY */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_resources.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_resources.h index 3c9a9e6949b3..3a49b97e7b26 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_resources.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_resources.h @@ -60,19 +60,25 @@ */ #if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) #define HAL_TRIGGER_CRYPT_PPI 7 -#else /* CONFIG_SOC_COMPATIBLE_NRF54LX */ -#define HAL_TRIGGER_CRYPT_PPI HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI -#endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ #define HAL_PPIB_SEND_TRIGGER_CRYPT_PPI \ _CONCAT(NRF_PPIB_TASK_SEND_, HAL_TRIGGER_CRYPT_PPI) #define HAL_PPIB_RECEIVE_TRIGGER_CRYPT_PPI \ _CONCAT(NRF_PPIB_EVENT_RECEIVE_, HAL_TRIGGER_CRYPT_PPI) +#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#define HAL_TRIGGER_CRYPT_PPI HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI +#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ /******************************************************************************* * Trigger automatic address resolution on Bit counter match: * wire the RADIO EVENTS_BCMATCH event to the AAR TASKS_START task. */ #define HAL_TRIGGER_AAR_PPI 6 +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define HAL_PPIB_SEND_TRIGGER_AAR_PPI \ + _CONCAT(NRF_PPIB_TASK_SEND_, HAL_TRIGGER_AAR_PPI) +#define HAL_PPIB_RECEIVE_TRIGGER_AAR_PPI \ + _CONCAT(NRF_PPIB_EVENT_RECEIVE_, HAL_TRIGGER_AAR_PPI) +#endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ #if defined(CONFIG_BT_CTLR_PHY_CODED) && \ defined(CONFIG_HAS_HW_NRF_RADIO_BLE_CODED) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_sim_nrf54l.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_sim_nrf54l.h index 324f2c8edb3f..8987031db5f1 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_sim_nrf54l.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_sim_nrf54l.h @@ -392,6 +392,9 @@ #define CCM_MODE_DATARATE_500Kbps CCM_MODE_DATARATE_500Kbit #define CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbps CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbit +/* HAL abstraction of AAR h/w */ +#define NRF_AAR NRF_AAR00 + static inline void hal_radio_reset(void) { /* TODO: Add any required setup for each radio event From 0d61391f2775a384a22c62992fe86fa0156bd5de Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 3 Jun 2025 05:15:27 +0200 Subject: [PATCH 0214/3334] [nrf fromtree] tests: bsim: Bluetooth: Conditionally compile Controller Privacy Conditionally compile Controller Privacy testing and enable advertising test for nRF54L15bsim. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 7a1e7c9fbaa061a9150210a2870b59ee151ff6bf) Signed-off-by: Vinayak Kariappa Chettimada --- .../compile.nrf54l15bsim_nrf54l15_cpuapp.sh | 3 + tests/bsim/bluetooth/ll/advx/src/main.c | 90 ++++++++++++------- .../ll/advx/tests_scripts/basic_advx.sh | 4 +- .../basic_advx_scan_aux_use_chains.sh | 4 +- .../basic_advx_ticker_expire_info.sh | 4 +- .../tests.nrf54l15bsim_nrf54l15_cpuapp.txt | 1 + 6 files changed, 68 insertions(+), 38 deletions(-) diff --git a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh index 9db8bbcf8d25..75b006af80a2 100755 --- a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh +++ b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh @@ -13,6 +13,9 @@ export BOARD="${BOARD:-nrf54l15bsim/nrf54l15/cpuapp}" source ${ZEPHYR_BASE}/tests/bsim/compile.source +app=tests/bsim/bluetooth/ll/advx compile +app=tests/bsim/bluetooth/ll/advx conf_overlay=overlay-ticker_expire_info.conf compile +app=tests/bsim/bluetooth/ll/advx conf_overlay=overlay-scan_aux_use_chains.conf compile app=tests/bsim/bluetooth/ll/throughput compile app=tests/bsim/bluetooth/ll/throughput conf_overlay=overlay-no_phy_update.conf compile app=tests/bsim/bluetooth/ll/multiple_id compile diff --git a/tests/bsim/bluetooth/ll/advx/src/main.c b/tests/bsim/bluetooth/ll/advx/src/main.c index cd9f0a4cd503..ac9d99976c55 100644 --- a/tests/bsim/bluetooth/ll/advx/src/main.c +++ b/tests/bsim/bluetooth/ll/advx/src/main.c @@ -29,7 +29,11 @@ #define EVT_PROP_TXP BIT(6) #define ADV_INTERVAL 0x20 /* 20 ms advertising interval */ #define ADV_WAIT_MS 10 /* 10 ms wait loop */ +#if defined(CONFIG_BT_CTLR_PRIVACY) +#define OWN_ADDR_TYPE BT_HCI_OWN_ADDR_RPA_OR_RANDOM +#else /* !CONFIG_BT_CTLR_PRIVACY */ #define OWN_ADDR_TYPE BT_HCI_OWN_ADDR_RANDOM +#endif /* !CONFIG_BT_CTLR_PRIVACY */ #define PEER_ADDR_TYPE BT_HCI_OWN_ADDR_RANDOM #define PEER_ADDR peer_addr #define ADV_CHAN_MAP 0x07 @@ -675,28 +679,32 @@ static void test_advx_main(void) k_sleep(K_MSEC(1000)); - printk("Add to resolving list..."); - bt_addr_le_t peer_id_addr = { - .type = BT_ADDR_LE_RANDOM, - .a = { - .val = {0xc6, 0xc7, 0xc8, 0xc9, 0xc1, 0xcb} - } - }; - uint8_t pirk[16] = {0x00, }; - uint8_t lirk[16] = {0x01, }; + if (IS_ENABLED(CONFIG_BT_CTLR_PRIVACY)) { + printk("Add to resolving list..."); + bt_addr_le_t peer_id_addr = { + .type = BT_ADDR_LE_RANDOM, + .a = { + .val = {0xc6, 0xc7, 0xc8, 0xc9, 0xc1, 0xcb} + } + }; + uint8_t pirk[16] = {0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA, + 0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA}; + uint8_t lirk[16] = {0x12, 0x21, 0x12, 0x21, 0x12, 0x21, 0x12, 0x21, + 0x12, 0x21, 0x12, 0x21, 0x12, 0x21, 0x12, 0x21}; - err = ll_rl_add(&peer_id_addr, pirk, lirk); - if (err) { - goto exit; - } - printk("success.\n"); + err = ll_rl_add(&peer_id_addr, pirk, lirk); + if (err) { + goto exit; + } + printk("success.\n"); - printk("Enable resolving list..."); - err = ll_rl_enable(BT_HCI_ADDR_RES_ENABLE); - if (err) { - goto exit; + printk("Enable resolving list..."); + err = ll_rl_enable(BT_HCI_ADDR_RES_ENABLE); + if (err) { + goto exit; + } + printk("success.\n"); } - printk("success.\n"); printk("Enabling extended..."); err = ll_adv_enable(handle, 1, 0, 0); @@ -1716,28 +1724,46 @@ static void test_scanx_main(void) } printk("done.\n"); - printk("Add to resolving list..."); bt_addr_le_t peer_id_addr = { .type = BT_ADDR_LE_RANDOM, .a = { .val = {0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5} } }; - uint8_t pirk[16] = {0x01, }; - uint8_t lirk[16] = {0x00, }; - err = ll_rl_add(&peer_id_addr, pirk, lirk); - if (err) { - goto exit; - } - printk("success.\n"); + if (IS_ENABLED(CONFIG_BT_CTLR_PRIVACY)) { + printk("Add to resolving list..."); + bt_addr_le_t some_id_addr = { + .type = BT_ADDR_LE_RANDOM, + .a = { + .val = {0x78, 0x87, 0x78, 0x87, 0x78, 0x87} + } + }; + uint8_t pirk[16] = {0x12, 0x21, 0x12, 0x21, 0x12, 0x21, 0x12, 0x21, + 0x12, 0x21, 0x12, 0x21, 0x12, 0x21, 0x12, 0x21}; + uint8_t lirk[16] = {0xCD, 0xDC, 0xCD, 0xDC, 0xCD, 0xDC, 0xCD, 0xDC, + 0xCD, 0xDC, 0xCD, 0xDC, 0xCD, 0xDC, 0xCD, 0xDC}; + + /* some_id_addr with swapped peer IRK and local IRK */ + err = ll_rl_add(&some_id_addr, lirk, pirk); + if (err) { + goto exit; + } - printk("Enable resolving list..."); - err = ll_rl_enable(BT_HCI_ADDR_RES_ENABLE); - if (err) { - goto exit; + /* peer_id_addr with correct peer IRK and local IRK */ + err = ll_rl_add(&peer_id_addr, pirk, lirk); + if (err) { + goto exit; + } + printk("success.\n"); + + printk("Enable resolving list..."); + err = ll_rl_enable(BT_HCI_ADDR_RES_ENABLE); + if (err) { + goto exit; + } + printk("success.\n"); } - printk("success.\n"); printk("Add device to periodic advertising list..."); err = bt_le_per_adv_list_add(&peer_id_addr, per_sid); diff --git a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx.sh b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx.sh index 540611f69a37..02add45e85eb 100755 --- a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx.sh +++ b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx.sh @@ -13,10 +13,10 @@ EXECUTE_TIMEOUT=120 cd ${BSIM_OUT_PATH}/bin Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=advx + -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=0 -testid=advx Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf\ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scanx + -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=1 -testid=scanx Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ -D=2 -sim_length=60e6 $@ diff --git a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_scan_aux_use_chains.sh b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_scan_aux_use_chains.sh index 0e26ae907de3..0331788a6309 100755 --- a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_scan_aux_use_chains.sh +++ b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_scan_aux_use_chains.sh @@ -13,10 +13,10 @@ EXECUTE_TIMEOUT=120 cd ${BSIM_OUT_PATH}/bin Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf_overlay-scan_aux_use_chains_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=advx + -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=0 -testid=advx Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf_overlay-scan_aux_use_chains_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scanx + -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=1 -testid=scanx Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ -D=2 -sim_length=60e6 $@ diff --git a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_ticker_expire_info.sh b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_ticker_expire_info.sh index cabee84f0157..655732639171 100755 --- a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_ticker_expire_info.sh +++ b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_ticker_expire_info.sh @@ -13,10 +13,10 @@ EXECUTE_TIMEOUT=120 cd ${BSIM_OUT_PATH}/bin Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf_overlay-ticker_expire_info_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=advx + -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=0 -testid=advx Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf_overlay-ticker_expire_info_conf \ - -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scanx + -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=1 -testid=scanx Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ -D=2 -sim_length=60e6 $@ diff --git a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt index d5dee727d5e9..4b94f5ee29f0 100644 --- a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt +++ b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt @@ -1,5 +1,6 @@ # Search paths(s) for tests which will be run in the nrf54l15 app core # This file is used in CI to select which tests are run +tests/bsim/bluetooth/ll/advx/ tests/bsim/bluetooth/ll/throughput/ tests/bsim/bluetooth/ll/multiple_id/ tests/bsim/bluetooth/ll/bis/tests_scripts/broadcast_iso_interleaved.sh From dc8a0df3a08973c340037c3b3d7cee4cdec4b5b8 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Mon, 2 Jun 2025 08:47:12 +0530 Subject: [PATCH 0215/3334] [nrf fromtree] Bluetooth: Controller: nRF54Lx: Enable Controller Privacy Support Enable Controller Privacy support for nRF54Lx as default. Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 4428c1a8683e2376286ea3b9d78cba4c2190797d) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/Kconfig.ll_sw_split | 3 +-- tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh | 2 ++ tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index e862034c2550..b6774d63c7c6 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -22,8 +22,7 @@ config BT_LLL_VENDOR_NORDIC !BT_CTLR_DATA_LENGTH_CLEAR && \ !BT_CTLR_PHY_2M_NRF select BT_CTLR_PRIVACY_SUPPORT if BT_CTLR_CRYPTO_SUPPORT && \ - !SOC_SERIES_NRF51X && \ - !SOC_COMPATIBLE_NRF54LX + !SOC_SERIES_NRF51X select BT_CTLR_CONN_PARAM_REQ_SUPPORT select BT_CTLR_EXT_REJ_IND_SUPPORT select BT_CTLR_PER_INIT_FEAT_XCHG_SUPPORT diff --git a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh index 75b006af80a2..ee428e1a97ce 100755 --- a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh +++ b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh @@ -16,6 +16,8 @@ source ${ZEPHYR_BASE}/tests/bsim/compile.source app=tests/bsim/bluetooth/ll/advx compile app=tests/bsim/bluetooth/ll/advx conf_overlay=overlay-ticker_expire_info.conf compile app=tests/bsim/bluetooth/ll/advx conf_overlay=overlay-scan_aux_use_chains.conf compile +app=tests/bsim/bluetooth/ll/conn conf_file=prj_split.conf compile +app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_privacy.conf compile app=tests/bsim/bluetooth/ll/throughput compile app=tests/bsim/bluetooth/ll/throughput conf_overlay=overlay-no_phy_update.conf compile app=tests/bsim/bluetooth/ll/multiple_id compile diff --git a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt index 4b94f5ee29f0..d289755e9fb3 100644 --- a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt +++ b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt @@ -1,6 +1,8 @@ # Search paths(s) for tests which will be run in the nrf54l15 app core # This file is used in CI to select which tests are run tests/bsim/bluetooth/ll/advx/ +tests/bsim/bluetooth/ll/conn/tests_scripts/basic_conn_encrypted_split.sh +tests/bsim/bluetooth/ll/conn/tests_scripts/basic_conn_encrypted_split_privacy.sh tests/bsim/bluetooth/ll/throughput/ tests/bsim/bluetooth/ll/multiple_id/ tests/bsim/bluetooth/ll/bis/tests_scripts/broadcast_iso_interleaved.sh From 9949a4f086a55731ef3ad86e45eb0799ae23fb40 Mon Sep 17 00:00:00 2001 From: Lars Segerlund Date: Wed, 22 Oct 2025 11:31:27 +0200 Subject: [PATCH 0216/3334] [nrf fromtree] Bluetooth: Controller: Handle overlapping CIG and ACL If the CIG and ACL overlap each other when the CIS is starting zephyr will assert on negative time, so fit this special case. Signed-off-by: Lars Segerlund (cherry picked from commit fc813d9556a4e354256981f3e43aa3d3325f37b6) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/ull_conn_iso.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c index 2ce0d8c3649b..30dcb8419ad7 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c @@ -979,6 +979,17 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle, lost_cig_events = 1U; cis_offset = cis->offset + iso_interval_us - acl_latency_us; } + /* Correct the cis_offset to next CIG event, if the ACL and CIG overlaps. + * ACL radio event at the instant was skipped and a relative CIS offset at + * the current ACL event has been calculated. But the current ACL event + * is partially overlapping with the other of CISes (not yet established) in + * the CIG event. Hence, lets establish the CIS at the next ISO interval so + * as to have a positive CIG event offset. + */ + if (cis_offset < (cig->sync_delay - cis->sync_delay)) { + cis_offset += iso_interval_us; + lost_cig_events++; + } cis->lll.event_count_prepare += lost_cig_events; From 0b1cbe3981444d0dde039353a19550b1f72af84c Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 21 Oct 2025 22:14:18 +0200 Subject: [PATCH 0217/3334] [nrf fromtree] Bluetooth: Controller: Fix use-after-release in lll_scan/lll_scan_aux Fix use-after-release in lll_scan/lll_scan_aux when using mayfly_enqueue to defer execution of the offset calculation using ull_sched_mfy_after_cen_offset_get(). Apply suggestion from @Copilot Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 533ef581573a84098e45fd5d0f8cf3c90df9abe9) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/lll_scan.h | 8 ++++++++ .../controller/ll_sw/nordic/lll/lll_scan.c | 16 +++++++++++----- .../controller/ll_sw/nordic/lll/lll_scan_aux.c | 13 ++++++++++--- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/lll_scan.h b/subsys/bluetooth/controller/ll_sw/lll_scan.h index db0f08a182e1..b9633f899383 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_scan.h +++ b/subsys/bluetooth/controller/ll_sw/lll_scan.h @@ -17,6 +17,14 @@ struct lll_scan { uint8_t adv_addr[BDADDR_SIZE]; uint32_t conn_win_offset_us; uint16_t conn_timeout; + +#if defined(CONFIG_BT_CTLR_SCHED_ADVANCED) + /* Stores prepare parameters for deferred mayfly execution. + * This prevents use-after-release issues by ensuring the parameters + * remain valid until execution. + */ + struct lll_prepare_param prepare_param; +#endif /* CONFIG_BT_CTLR_SCHED_ADVANCED */ #endif /* CONFIG_BT_CENTRAL */ uint8_t state:1; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index 7ae1f8bb6de2..5cfa63b3bcf5 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -509,13 +509,19 @@ static int common_prepare_cb(struct lll_prepare_param *p, bool is_resume) static memq_link_t link; static struct mayfly mfy_after_cen_offset_get = { 0U, 0U, &link, NULL, ull_sched_mfy_after_cen_offset_get}; - uint32_t retval; + struct lll_prepare_param *prepare_param; - mfy_after_cen_offset_get.param = p; + /* Copy the required values to calculate the offsets */ + prepare_param = &lll->prepare_param; + prepare_param->ticks_at_expire = p->ticks_at_expire; + prepare_param->remainder = p->remainder; + prepare_param->param = lll; - retval = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, - &mfy_after_cen_offset_get); - LL_ASSERT_ERR(!retval); + mfy_after_cen_offset_get.param = prepare_param; + + ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, + &mfy_after_cen_offset_get); + LL_ASSERT_ERR(!ret); } #endif /* CONFIG_BT_CENTRAL && CONFIG_BT_CTLR_SCHED_ADVANCED */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c index 6665dc7390e2..8606a7913609 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c @@ -607,12 +607,19 @@ static int prepare_cb(struct lll_prepare_param *p) static memq_link_t link; static struct mayfly mfy_after_cen_offset_get = { 0U, 0U, &link, NULL, ull_sched_mfy_after_cen_offset_get}; + struct lll_prepare_param *prepare_param; - /* NOTE: LLL scan instance passed, as done when + /* Copy the required values to calculate the offsets + * + * NOTE: LLL scan instance passed, as done when * establishing legacy connections. */ - p->param = lll; - mfy_after_cen_offset_get.param = p; + prepare_param = &lll->prepare_param; + prepare_param->ticks_at_expire = p->ticks_at_expire; + prepare_param->remainder = p->remainder; + prepare_param->param = lll; + + mfy_after_cen_offset_get.param = prepare_param; ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, &mfy_after_cen_offset_get); From 14bab27db4822d198707908c654584c94fdb6f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Thu, 7 Aug 2025 12:50:50 +0200 Subject: [PATCH 0218/3334] [nrf fromtree] boards: nordic: Add initial support for nRF54LM20A/ns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add board files for nRF54LM20A/ns. Update existing nRF54LM20A board files to support this. Signed-off-by: Dag Erik Gjørvad (cherry picked from commit de402cb465e96a879816f613bbf686c747088026) --- boards/nordic/nrf54lm20dk/Kconfig | 28 ++++++++ boards/nordic/nrf54lm20dk/Kconfig.defconfig | 9 +++ boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk | 2 +- boards/nordic/nrf54lm20dk/board.cmake | 8 +++ boards/nordic/nrf54lm20dk/board.yml | 5 ++ .../nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 38 ----------- .../nrf54lm20dk_nrf54lm20a_cpuapp.dts | 1 + .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts | 68 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml | 22 ++++++ ...nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig | 45 ++++++++++++ dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 4 ++ dts/vendor/nordic/nrf54lm20a.dtsi | 25 +++++++ .../nordic/nrf54lm20a_ns_partition.dtsi | 62 +++++++++++++++++ dts/vendor/nordic/nrf54lm20a_partition.dtsi | 37 ++++++++++ modules/trusted-firmware-m/Kconfig.tfm | 1 + .../nordic/nrf54lm20a_cpuapp/CMakeLists.txt | 23 +++++++ .../nordic/nrf54lm20a_cpuapp/config.cmake | 9 +++ .../nordic/nrf54lm20a_cpuapp/cpuarch.cmake | 9 +++ .../nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake | 10 +++ samples/drivers/watchdog/sample.yaml | 1 + .../tfm_integration/config_build/sample.yaml | 1 + samples/tfm_integration/tfm_ipc/sample.yaml | 1 + tests/drivers/adc/adc_api/testcase.yaml | 1 + .../watchdog/wdt_basic_api/testcase.yaml | 1 + tests/subsys/settings/its/testcase.yaml | 1 + 25 files changed, 373 insertions(+), 39 deletions(-) create mode 100644 boards/nordic/nrf54lm20dk/Kconfig create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig create mode 100644 dts/vendor/nordic/nrf54lm20a_ns_partition.dtsi create mode 100644 dts/vendor/nordic/nrf54lm20a_partition.dtsi create mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/CMakeLists.txt create mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/config.cmake create mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/cpuarch.cmake create mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake diff --git a/boards/nordic/nrf54lm20dk/Kconfig b/boards/nordic/nrf54lm20dk/Kconfig new file mode 100644 index 000000000000..0b1905a0d8ef --- /dev/null +++ b/boards/nordic/nrf54lm20dk/Kconfig @@ -0,0 +1,28 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig index 67410cd4d653..c77e844b822c 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54lm20dk/Kconfig.defconfig @@ -7,3 +7,12 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP + +if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y + +endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS diff --git a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk index 83b3842211f3..b311fd9ae87e 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk +++ b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk @@ -2,5 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF54LM20DK - select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP + select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS select SOC_NRF54LM20A_ENGA_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake index e487ecfb476f..6aaf6196d572 100644 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ b/boards/nordic/nrf54lm20dk/board.cmake @@ -7,5 +7,13 @@ elseif(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR) board_runner_args(jlink "--speed=4000") endif() +if(CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) +endif() + include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nordic/nrf54lm20dk/board.yml b/boards/nordic/nrf54lm20dk/board.yml index 2930f9d3dfbd..86decbf7c7cd 100644 --- a/boards/nordic/nrf54lm20dk/board.yml +++ b/boards/nordic/nrf54lm20dk/board.yml @@ -5,6 +5,8 @@ board: socs: - name: nrf54lm20a variants: + - name: ns + cpucluster: cpuapp - name: xip cpucluster: cpuflpr runners: @@ -17,6 +19,7 @@ runners: groups: - boards: - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr/xip '--erase': @@ -28,6 +31,7 @@ runners: groups: - boards: - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr/xip '--reset': @@ -39,5 +43,6 @@ runners: groups: - boards: - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr/xip diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index c6943b5a1028..39fda7c4c88e 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -58,44 +58,6 @@ status = "okay"; }; -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(449)>; - }; - - slot0_ns_partition: partition@80400 { - label = "image-0-nonsecure"; - reg = <0x80400 DT_SIZE_K(449)>; - }; - - slot1_partition: partition@f0800 { - label = "image-1"; - reg = <0xf0800 DT_SIZE_K(449)>; - }; - - slot1_ns_partition: partition@160c00 { - label = "image-1-nonsecure"; - reg = <0x160c00 DT_SIZE_K(449)>; - }; - - storage_partition: partition@1d1000 { - label = "storage"; - reg = <0x1d1000 DT_SIZE_K(36)>; - }; - }; -}; - &uart20 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index 6dd2c5b2e850..2e79bbb98215 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -7,6 +7,7 @@ /dts-v1/; #include "nrf54lm20a_cpuapp_common.dtsi" +#include / { compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp"; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts new file mode 100644 index 000000000000..04cb9d04a60c --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#define USE_NON_SECURE_ADDRESS_MAP 1 + +#include "nrf54lm20a_cpuapp_common.dtsi" + +/ { + compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp-ns"; + model = "Nordic nRF54LM20 DK nRF54LM20A Application MCU Non-Secure"; + + chosen { + zephyr,code-partition = &slot0_ns_partition; + zephyr,sram = &sram0_ns; + zephyr,entropy = &psa_rng; + }; + + /delete-node/ rng; + + psa_rng: psa-rng { + status = "okay"; + }; +}; + +/ { + /* + * Default SRAM planning when building for nRF54LM20A with ARM TrustZone-M support + * - Lowest 208 kB SRAM allocated to Secure image (sram0_s). + * - Upper 208 kB SRAM allocated to Non-Secure image (sram0_ns). + * + * nRF54LM20A has 512 kB of volatile memory (SRAM), but 96kB is allocated for the FLPR MCU. + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + sram0_s: image_s@20000000 { + /* Secure image memory */ + reg = <0x20000000 DT_SIZE_K(208)>; + }; + + sram0_ns: image_ns@20034000 { + /* Non-Secure image memory */ + reg = <0x20034000 DT_SIZE_K(208)>; + }; + }; +}; + +&bt_hci_controller { + status = "disabled"; +}; + +&uart30 { + /* Disable so that TF-M can use this UART */ + status = "disabled"; +}; + +/* Include default memory partition configuration file */ +#include diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml new file mode 100644 index 000000000000..3f10201892fb --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml @@ -0,0 +1,22 @@ +identifier: nrf54lm20dk/nrf54lm20a/cpuapp/ns +name: nRF54lm20-DK-nRF54lm20a-Application-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +ram: 208 +flash: 1356 +supported: + - adc + - counter + - dmic + - gpio + - i2c + - i2s + - pwm + - spi + - usbd + - watchdog +vendor: nordic +sysbuild: true diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig new file mode 100644 index 000000000000..d360ef89bac4 --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig @@ -0,0 +1,45 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# Use devicetree code partition for TF-M +CONFIG_USE_DT_CODE_PARTITION=y + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +# Don't enable the cache in the non-secure image as it is a +# secure-only peripheral on 54l +CONFIG_CACHE_MANAGEMENT=n +CONFIG_EXTERNAL_CACHE=n + +# Start SYSCOUNTER on driver init +CONFIG_NRF_GRTC_START_SYSCOUNTER=y + +# Disable TFM BL2 since it is not supported +CONFIG_TFM_BL2=n +# Support for silence logging is not supported at the moment +# Tracked by: NCSDK-31930 +CONFIG_TFM_LOG_LEVEL_SILENCE=n + +# The oscillators are configured as secure and cannot be configured +# from the non secure application directly. This needs to be set +# otherwise nrfx will try to configure them, resulting in a bus +# fault. +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index d5aa024dd6d3..dff01d80d7fe 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -66,7 +66,11 @@ nvic: &cpuapp_nvic {}; }; &grtc { +#ifdef USE_NON_SECURE_ADDRESS_MAP + interrupts = <227 NRF_DEFAULT_IRQ_PRIORITY>, +#else interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>, +#endif <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ }; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index ae17be2c8d42..ff000d01143e 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -96,10 +96,14 @@ #nordic,ficr-cells = <1>; }; +#ifdef USE_NON_SECURE_ADDRESS_MAP + /* intentionally empty because UICR is hardware fixed to Secure */ +#else uicr: uicr@ffd000 { compatible = "nordic,nrf-uicr"; reg = <0xffd000 0x1000>; }; +#endif cpuapp_sram: memory@20000000 { compatible = "mmio-sram"; @@ -117,11 +121,19 @@ ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; }; +#ifdef USE_NON_SECURE_ADDRESS_MAP + global_peripherals: peripheral@40000000 { + reg = <0x40000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x40000000 0x10000000>; +#else global_peripherals: peripheral@50000000 { reg = <0x50000000 0x10000000>; ranges = <0x0 0x50000000 0x10000000>; #address-cells = <1>; #size-cells = <1>; +#endif dppic00: dppic@42000 { compatible = "nordic,nrf-dppic"; @@ -748,12 +760,16 @@ interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; }; +#ifdef USE_NON_SECURE_ADDRESS_MAP + /* intentionally empty because WDT30 is hardware fixed to Secure */ +#else wdt30: watchdog@108000 { compatible = "nordic,nrf-wdt"; reg = <0x108000 0x620>; interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; }; +#endif wdt31: watchdog@109000 { compatible = "nordic,nrf-wdt"; @@ -852,6 +868,15 @@ }; }; + nrf_mpc: memory@50041000 { + compatible = "nordic,nrf-mpc"; + reg = <0x50041000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + override-num = <5>; + override-granularity = <4096>; + }; + cpuapp_ppb: cpuapp-ppb-bus { #address-cells = <1>; #size-cells = <1>; diff --git a/dts/vendor/nordic/nrf54lm20a_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_ns_partition.dtsi new file mode 100644 index 000000000000..954dd8290453 --- /dev/null +++ b/dts/vendor/nordic/nrf54lm20a_ns_partition.dtsi @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&cpuapp_rram { + /* + * Default NVM layout on NRF54LM20A Application MCU without BL2: + * This layout matches (by necessity) that in the TF-M repository: + * + * 0x0000_0000 Secure image primary (512 KB) + * 0x0008_0000 Protected Storage Area (16 KB) + * 0x0008_4000 Internal Trusted Storage Area (16 KB) + * 0x0008_8000 OTP / NV counters area (8 KB) + * 0x0008_A000 Non-secure image primary (1356 KB) + * 0x001D_DD00 Non-secure storage, used when built with NRF_NS_STORAGE=ON, + * otherwise unused (32 KB) + */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54LM20A has 2036 kB of non-volatile memory (RRAM) but the last + * 96 kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8A000 { + label = "image-0-nonsecure"; + reg = <0x0008A000 DT_SIZE_K(1356)>; + }; + + storage_partition: partition@1DD000 { + label = "storage"; + reg = <0x001DD000 DT_SIZE_K(32)>; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54lm20a_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_partition.dtsi new file mode 100644 index 000000000000..049f87139d91 --- /dev/null +++ b/dts/vendor/nordic/nrf54lm20a_partition.dtsi @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54LM20A has 2036 kB of non-volatile memory (RRAM) but the last + * 96 kB are reserved for the FLPR MCU, so we have ~1940 kB available. + */ + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(922)>; + }; + + slot1_partition: partition@f6800 { + label = "image-1"; + reg = <0xf6800 DT_SIZE_K(922)>; + }; + + storage_partition: partition@1dd000 { + label = "storage"; + reg = <0x1dd000 DT_SIZE_K(32)>; + }; + }; +}; diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 55e08ee45e4a..36a734ad8b3e 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -28,6 +28,7 @@ config TFM_BOARD default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l15_cpuapp" if SOC_NRF54L15_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP + default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp" if SOC_NRF54LM20A_ENGA_CPUAPP help The board name used for building TFM. Building with TFM requires that TFM has been ported to the given board/SoC. diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/CMakeLists.txt b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/CMakeLists.txt new file mode 100644 index 000000000000..c926ace19c8f --- /dev/null +++ b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright (c) 2025, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set(NRF_BOARD_SELECTED True) + +add_subdirectory(${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/common/nrf54lm20a nrf54lm20a) + +add_subdirectory(.. common) + +install(FILES ${CMAKE_CURRENT_LIST_DIR}/ns/cpuarch_ns.cmake + DESTINATION ${INSTALL_PLATFORM_NS_DIR} + RENAME cpuarch.cmake) + +install(FILES config.cmake + DESTINATION ${INSTALL_PLATFORM_NS_DIR}) + +install(DIRECTORY ${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/nrf54lm20dk_nrf54lm20a_cpuapp/tests + + DESTINATION ${INSTALL_PLATFORM_NS_DIR} +) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/config.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/config.cmake new file mode 100644 index 000000000000..4b1e3ab5e97c --- /dev/null +++ b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/config.cmake @@ -0,0 +1,9 @@ +# +# Copyright (c) 2025, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set(NRF_SOC_VARIANT nrf54lm20a CACHE STRING "nRF SoC Variant") + +include(${PLATFORM_PATH}/common/nrf54lm20a/config.cmake) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/cpuarch.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/cpuarch.cmake new file mode 100644 index 000000000000..1766b89f9964 --- /dev/null +++ b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/cpuarch.cmake @@ -0,0 +1,9 @@ +# +# Copyright (c) 2025, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set(PLATFORM_PATH platform/ext/target/nordic_nrf) + +include(${PLATFORM_PATH}/common/nrf54lm20a/cpuarch.cmake) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake new file mode 100644 index 000000000000..cec0a5536dd3 --- /dev/null +++ b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake @@ -0,0 +1,10 @@ +# +# Copyright (c) 2025, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set(PLATFORM_DIR ${CMAKE_CURRENT_LIST_DIR}) +set(PLATFORM_PATH ${CMAKE_CURRENT_LIST_DIR}) + +include(${CMAKE_CURRENT_LIST_DIR}/common/nrf54lm20a/cpuarch.cmake) diff --git a/samples/drivers/watchdog/sample.yaml b/samples/drivers/watchdog/sample.yaml index a1069108fb05..8cf1d7db91a5 100644 --- a/samples/drivers/watchdog/sample.yaml +++ b/samples/drivers/watchdog/sample.yaml @@ -26,6 +26,7 @@ tests: - panb611evb/nrf54l15/cpuapp/ns - panb611evb/nrf54l15/cpuflpr - panb611evb/nrf54l15/cpuflpr/xip + - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns diff --git a/samples/tfm_integration/config_build/sample.yaml b/samples/tfm_integration/config_build/sample.yaml index 3c46c148f7ba..55c4e2348081 100644 --- a/samples/tfm_integration/config_build/sample.yaml +++ b/samples/tfm_integration/config_build/sample.yaml @@ -10,6 +10,7 @@ common: - nrf9160dk/nrf9160/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns + - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl5340_dvk/nrf5340/cpuapp/ns integration_platforms: - nrf5340dk/nrf5340/cpuapp/ns diff --git a/samples/tfm_integration/tfm_ipc/sample.yaml b/samples/tfm_integration/tfm_ipc/sample.yaml index 390efa24fb7e..154d91b23f31 100644 --- a/samples/tfm_integration/tfm_ipc/sample.yaml +++ b/samples/tfm_integration/tfm_ipc/sample.yaml @@ -35,6 +35,7 @@ tests: - mps2/an521/cpu0/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns + - nrf54lm20dk/nrf54lm20a/cpuapp/ns extra_configs: - CONFIG_TFM_BL2=n harness: console diff --git a/tests/drivers/adc/adc_api/testcase.yaml b/tests/drivers/adc/adc_api/testcase.yaml index cd90f5356a51..3aa5e089b830 100644 --- a/tests/drivers/adc/adc_api/testcase.yaml +++ b/tests/drivers/adc/adc_api/testcase.yaml @@ -13,6 +13,7 @@ tests: - panb611evb/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns + - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns - bl54l15u_dvk/nrf54l15/cpuapp/ns diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml index 01b8e6d833a8..6efd3fa94e91 100644 --- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml +++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml @@ -28,6 +28,7 @@ tests: - mimxrt700_evk/mimxrt798s/cm33_cpu1 - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns + - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns - bl54l15u_dvk/nrf54l15/cpuapp/ns diff --git a/tests/subsys/settings/its/testcase.yaml b/tests/subsys/settings/its/testcase.yaml index de11f1ef7264..c63019e63457 100644 --- a/tests/subsys/settings/its/testcase.yaml +++ b/tests/subsys/settings/its/testcase.yaml @@ -10,5 +10,6 @@ tests: - max32657evkit/max32657/ns - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns + - nrf54lm20dk/nrf54lm20a/cpuapp/ns platform_exclude: - lpcxpresso55s69/lpc55s69/cpu0/ns From 08559d6a10502e9239cddeb0b0bec5ddef126a04 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 15 Sep 2025 20:21:35 +0530 Subject: [PATCH 0219/3334] [nrf fromtree] drivers: wifi: nrf7002: Add support for multiple virtual interfaces (VIFs) Description: The nRF7002 firmware supports two virtual interfaces (VIFs) that can operate in different modes (e.g., AP and STA). However, the existing Zephyr driver only utilizes a single VIF, preventing full multi-interface support. This commit extends the nRF7002 driver to support multiple VIFs by making the following modifications: * The driver already contains an array of vif_ctx_zep, but only the first item was being used. Now, a second Ethernet device is registered using vif_ctx_zep[1], enabling multi-VIF operation. * Introduced vif_ctx_cnt to keep track of active interfaces and manage their state effectively. * Ensured that FMAC (Firmware MAC) is initialized only once, avoiding redundant initializations when multiple VIFs are present. * The UMAC control commands previously did not associate responses with the issuing VIF. A queue is now introduced to track the originating VIF for each command and correctly route the response event to the corresponding interface. Signed-off-by: Hanan Arshad Signed-off-by: Chaitanya Tata (cherry picked from commit 1c6a00bd5dcf3e590a2982f49962918ad3bfc923) --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 9 +++++++++ drivers/wifi/nrf_wifi/src/fmac_main.c | 27 +++++++++++++++++++++++++ drivers/wifi/nrf_wifi/src/net_if.c | 3 +-- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 5 ++++- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 9b37c302872b..29f8c86250a3 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -108,6 +108,15 @@ config NRF70_AP_MODE depends on WIFI_NM_WPA_SUPPLICANT_AP default y if WIFI_USAGE_MODE_AP || WIFI_USAGE_MODE_STA_AP +config NRF70_ENABLE_DUAL_VIF + bool "Dual virtual Wi-Fi interfaces" + default y if WIFI_NM_MAX_MANAGED_INTERFACES = 2 + depends on (WIFI_NRF7002 || WIFI_NRF7001) && NET_L2_ETHERNET + help + Enable support for two virtual Wi-Fi interfaces (VIFs). + When enabled, the driver can operate two VIFs simultaneously, + allowing use cases such as one interface in AP mode and another in STA mode. + config NRF70_P2P_MODE bool "P2P support in driver" diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 125ffd7a9a10..5932ec4f026f 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -743,9 +743,21 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) struct nrf_wifi_data_config_params data_config = { 0 }; struct rx_buf_pool_params rx_buf_pools[MAX_NUM_OF_RX_QUEUES]; struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = dev->data; + static unsigned char fixed_vif_cnt; + if (fixed_vif_cnt >= MAX_NUM_VIFS) { + LOG_ERR("%s: Max number of VIFs reached", __func__); + return -ENOMEM; + } + + /* Setup the linkage between the FMAC and the VIF contexts */ vif_ctx_zep->rpu_ctx_zep = &rpu_drv_priv_zep.rpu_ctx_zep; + if (fixed_vif_cnt++ > 0) { + /* FMAC is already initialized for VIF-0 */ + return 0; + } + #ifdef CONFIG_NRF70_DATA_TX data_config.aggregation = aggregation; data_config.wmm = IS_ENABLED(CONFIG_NRF_WIFI_FEAT_WMM); @@ -979,6 +991,21 @@ ETH_NET_DEVICE_DT_INST_DEFINE(0, CONFIG_WIFI_INIT_PRIORITY, /* prio */ &wifi_offload_ops, /* api */ CONFIG_NRF_WIFI_IFACE_MTU); /*mtu */ +#ifdef CONFIG_NRF70_ENABLE_DUAL_VIF +/* Register second interface */ +ETH_NET_DEVICE_DT_INST_DEFINE(1, + nrf_wifi_drv_main_zep, /* init_fn */ + NULL, /* pm_action_cb */ + &rpu_drv_priv_zep.rpu_ctx_zep.vif_ctx_zep[1], /* data */ +#ifdef CONFIG_NRF70_STA_MODE + &wpa_supp_ops, /* cfg */ +#else /* CONFIG_NRF70_STA_MODE */ + NULL, /* cfg */ +#endif /* !CONFIG_NRF70_STA_MODE */ + CONFIG_WIFI_INIT_PRIORITY, /* prio */ + &wifi_offload_ops, /* api */ + CONFIG_NRF_WIFI_IFACE_MTU); /*mtu */ +#endif /* NRF70_ENABLE_DUAL_VIF */ #else DEVICE_DT_INST_DEFINE(0, nrf_wifi_drv_main_zep, /* init_fn */ diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 4830d63c9d15..d1fc9195dbb2 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -824,8 +824,7 @@ int nrf_wifi_if_start_zep(const struct device *dev) } k_mutex_init(&vif_ctx_zep->vif_lock); - rpu_ctx_zep->vif_ctx_zep[vif_ctx_zep->vif_idx].if_type = - add_vif_info.iftype; + vif_ctx_zep->if_type = add_vif_info.iftype; /* Check if user has provided a valid MAC address, if not * fetch it from OTP. diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 9f1fff535454..88ea9f9215b4 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -447,7 +447,10 @@ void *nrf_wifi_wpa_supp_dev_init(void *supp_drv_if_ctx, const char *iface_name, struct zep_wpa_supp_dev_callbk_fns *supp_callbk_fns) { struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - const struct device *device = DEVICE_DT_GET(DT_CHOSEN(zephyr_wifi)); + /* Get device for each interface */ + int if_idx = net_if_get_by_name(iface_name); + struct net_if *iface = net_if_get_by_index(if_idx); + const struct device *device = net_if_get_device(iface); if (!device) { LOG_ERR("%s: Interface %s not found", __func__, iface_name); From cfc627cdecf0857091efd8c420e5579ee6d0cb41 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 15 Sep 2025 20:21:41 +0530 Subject: [PATCH 0220/3334] [nrf fromtree] drivers: nrf_wifi: Fix scan crash for 2nd VIF Move the VIF initialization to top to do it for both VIFs, this fixes a crash when scanning on the 2nd VIF. Signed-off-by: Chaitanya Tata (cherry picked from commit 386dcbe72c03eef92cd1d71a024f67354a47dbc2) --- drivers/wifi/nrf_wifi/src/fmac_main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 5932ec4f026f..d0fa7cfba410 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -752,6 +752,14 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) /* Setup the linkage between the FMAC and the VIF contexts */ vif_ctx_zep->rpu_ctx_zep = &rpu_drv_priv_zep.rpu_ctx_zep; +#ifndef CONFIG_NRF70_RADIO_TEST + k_work_init_delayable(&vif_ctx_zep->scan_timeout_work, + nrf_wifi_scan_timeout_work); + k_work_init(&vif_ctx_zep->disp_scan_res_work, + nrf_wifi_disp_scan_res_work_handler); + + vif_ctx_zep->bss_max_idle_period = USHRT_MAX; +#endif /* !CONFIG_NRF70_RADIO_TEST */ if (fixed_vif_cnt++ > 0) { /* FMAC is already initialized for VIF-0 */ @@ -835,7 +843,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) rpu_drv_priv_zep.fmac_priv = nrf_wifi_rt_fmac_init(); #endif /* CONFIG_NRF70_RADIO_TEST */ - if (rpu_drv_priv_zep.fmac_priv == NULL) { LOG_ERR("%s: nrf_wifi_fmac_init failed", __func__); @@ -864,17 +871,10 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) LOG_ERR("%s: nrf_wifi_fmac_dev_add_zep failed", __func__); goto fmac_deinit; } -#else - k_work_init_delayable(&vif_ctx_zep->scan_timeout_work, - nrf_wifi_scan_timeout_work); - k_work_init(&vif_ctx_zep->disp_scan_res_work, - nrf_wifi_disp_scan_res_work_handler); #endif /* CONFIG_NRF70_RADIO_TEST */ k_mutex_init(&rpu_drv_priv_zep.rpu_ctx_zep.rpu_lock); -#ifndef CONFIG_NRF70_RADIO_TEST - vif_ctx_zep->bss_max_idle_period = USHRT_MAX; -#endif /* !CONFIG_NRF70_RADIO_TEST */ + return 0; #ifdef CONFIG_NRF70_RADIO_TEST fmac_deinit: From eaabc3f5820052c53a752c65627c6c1cc10d13c7 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 29 Sep 2025 20:51:17 +0530 Subject: [PATCH 0221/3334] [nrf fromtree] drivers: nrf_wifi: Implement vendor stats Populate the vendor stats with nRF70 FW statistics, this is handy in debugging. Signed-off-by: Chaitanya Tata (cherry picked from commit fdd7100933811dce620108cb2e21dac78b82d542) --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 9 ++++ drivers/wifi/nrf_wifi/src/net_if.c | 73 +++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 7a863d8b614a..48d3791961e3 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -36,6 +36,11 @@ #define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING +/* Calculate compile-time maximum for vendor stats */ +#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR +#define MAX_VENDOR_STATS ((sizeof(struct rpu_sys_fw_stats) / sizeof(uint32_t)) + 1) +#endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ + #ifndef CONFIG_NRF70_OFFLOADED_RAW_TX #ifndef CONFIG_NRF70_RADIO_TEST struct nrf_wifi_vif_ctx_zep { @@ -61,6 +66,10 @@ struct nrf_wifi_vif_ctx_zep { bool set_if_event_received; int set_if_status; #ifdef CONFIG_NET_STATISTICS_ETHERNET +#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR + struct net_stats_eth_vendor eth_stats_vendor_data[MAX_VENDOR_STATS]; + char vendor_key_strings[MAX_VENDOR_STATS][16]; +#endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ struct net_stats_eth eth_stats; #endif /* CONFIG_NET_STATISTICS_ETHERNET */ #if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index d1fc9195dbb2..0662c6c80d09 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -1213,6 +1213,16 @@ int nrf_wifi_if_set_config_zep(const struct device *dev, struct net_stats_eth *nrf_wifi_eth_stats_get(const struct device *dev) { struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; +#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR + struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + struct rpu_sys_op_stats stats; + enum nrf_wifi_status status; + size_t fw_stats_size; + size_t num_uint32; + const uint8_t *fw_stats_bytes; + size_t i; + int vendor_idx = 0; +#endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ if (!dev) { LOG_ERR("%s Device not found", __func__); @@ -1225,6 +1235,69 @@ struct net_stats_eth *nrf_wifi_eth_stats_get(const struct device *dev) goto out; } +#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR + rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + if (!rpu_ctx_zep || !rpu_ctx_zep->rpu_ctx) { + LOG_ERR("%s: rpu_ctx_zep or rpu_ctx is NULL", __func__); + goto out; + } + + memset(&stats, 0, sizeof(stats)); + status = nrf_wifi_sys_fmac_stats_get(rpu_ctx_zep->rpu_ctx, + RPU_STATS_TYPE_ALL, + &stats); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: Failed to get RPU stats", __func__); + goto ret; + } + + /* Treat stats.fw as a blob and divide into uint32_t chunks */ + fw_stats_size = sizeof(stats.fw); + num_uint32 = fw_stats_size / sizeof(uint32_t); + fw_stats_bytes = (const uint8_t *)&stats.fw; + + vendor_idx = 0; + + for (i = 0; i < num_uint32 && vendor_idx < MAX_VENDOR_STATS - 1; i++) { + uint32_t val; + const char **key_ptr; + uint32_t *val_ptr; + + /* Extract uint32_t value from blob */ + memcpy(&val, fw_stats_bytes + i * sizeof(uint32_t), sizeof(uint32_t)); + + /* Create key name */ + snprintk(vif_ctx_zep->vendor_key_strings[vendor_idx], 16, "fw_%zu", i); + + /* Assign key */ + key_ptr = (const char **) + &vif_ctx_zep->eth_stats_vendor_data[vendor_idx].key; + *key_ptr = vif_ctx_zep->vendor_key_strings[vendor_idx]; + + /* Assign value */ + val_ptr = (uint32_t *) + &vif_ctx_zep->eth_stats_vendor_data[vendor_idx].value; + *val_ptr = val; + + vendor_idx++; + } + + /* Null terminator entry */ + { + const char **key_ptr = (const char **) + &vif_ctx_zep->eth_stats_vendor_data[vendor_idx].key; + uint32_t *val_ptr = (uint32_t *) + &vif_ctx_zep->eth_stats_vendor_data[vendor_idx].value; + + *key_ptr = NULL; + *val_ptr = 0; + } + + /* Point to the static vendor data */ + vif_ctx_zep->eth_stats.vendor = vif_ctx_zep->eth_stats_vendor_data; + +ret: +#endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ return &vif_ctx_zep->eth_stats; out: return NULL; From 265a8688beaaf4093dd95e4d7cf42708b0895f6b Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 20 Aug 2025 01:45:18 +0530 Subject: [PATCH 0222/3334] [nrf fromtree] drivers: nrf_wifi: Fix NRF71 build NRF71 doesn't have direct memory access, so, disabled the rpu stats memory variant. Signed-off-by: Chaitanya Tata (cherry picked from commit 8c5a5ae1990eab14c53bbdee45af7c7ca0d6c49e) --- drivers/wifi/nrf_wifi/src/wifi_util.c | 7 +++++++ drivers/wifi/nrf_wifi/src/wifi_util.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index 57bda1f4ff4f..4a8309434794 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -14,8 +14,10 @@ #include "fmac_main.h" #include "wifi_util.h" +#ifndef CONFIG_NRF71_ON_IPC #include "rpu_lmac_phy_stats.h" #include "rpu_umac_stats.h" +#endif extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; struct nrf_wifi_ctx_zep *ctx = &rpu_drv_priv_zep.rpu_ctx_zep; @@ -973,6 +975,7 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, } #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ +#ifndef CONFIG_NRF71_ON_IPC static int nrf_wifi_dump_stats(const struct shell *sh, struct nrf_wifi_hal_dev_ctx *hal_dev_ctx, const char *name, @@ -1010,6 +1013,7 @@ static int nrf_wifi_dump_stats(const struct shell *sh, return ret; } + static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh, size_t argc, const char *argv[]) @@ -1095,6 +1099,7 @@ static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh, k_mutex_unlock(&ctx->rpu_lock); return ret; } +#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_STATIC_SUBCMD_SET_CREATE( nrf70_util, @@ -1199,6 +1204,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 1, 0), #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ +#ifndef CONFIG_NRF71_ON_IPC SHELL_CMD_ARG(rpu_stats_mem, NULL, "Display RPU stats by reading from memory " @@ -1206,6 +1212,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_util_dump_rpu_stats_mem, 1, 1), +#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_SUBCMD_SET_END); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.h b/drivers/wifi/nrf_wifi/src/wifi_util.h index 303d5feac99f..a2490a1df24c 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.h +++ b/drivers/wifi/nrf_wifi/src/wifi_util.h @@ -14,7 +14,11 @@ #include #include #include +#ifdef CONFIG_NRF71_ON_IPC +#include +#else #include +#endif #include #include From a2c19edbc910fa14bfbc7599c3455b9742de6bf0 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 23 Sep 2025 21:49:41 +0530 Subject: [PATCH 0223/3334] [nrf fromtree] drivers: nrf_wifi: Use new nRF71 interface files nRF70 and nRF71 now use different interface files, fix the build. Signed-off-by: Chaitanya Tata (cherry picked from commit 91c0e15720776e60bf6e474dc3877523b0e4d33e) --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 1 + drivers/wifi/nrf_wifi/inc/fmac_main.h | 5 ++++- drivers/wifi/nrf_wifi/src/debug_shell.c | 4 ++++ drivers/wifi/nrf_wifi/src/fmac_main.c | 17 +++++++++++------ drivers/wifi/nrf_wifi/src/fw_load.c | 8 +++++++- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 3 ++- drivers/wifi/nrf_wifi/src/wifi_util.c | 4 ++++ 7 files changed, 33 insertions(+), 9 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 29f8c86250a3..df4414a316e0 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -174,6 +174,7 @@ config NRF_WIFI_LOW_POWER config NRF70_TCP_IP_CHECKSUM_OFFLOAD bool "TCP/IP checksum offload" + depends on !NRF71_ON_IPC default y config NRF70_REG_DOMAIN diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 48d3791961e3..799beff1fbaf 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -31,8 +31,11 @@ #else #include #endif /* !CONFIG_NRF70_RADIO_TEST */ - +#ifdef CONFIG_NRF71_ON_IPC +#include +#else #include +#endif /* CONFIG_NRF71_ON_IPC */ #define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING diff --git a/drivers/wifi/nrf_wifi/src/debug_shell.c b/drivers/wifi/nrf_wifi/src/debug_shell.c index 70fb77d6ed0d..b6ac79bf7724 100644 --- a/drivers/wifi/nrf_wifi/src/debug_shell.c +++ b/drivers/wifi/nrf_wifi/src/debug_shell.c @@ -9,7 +9,11 @@ */ #include #include +#ifdef NRF71_ON_IPC +#include +#else #include "host_rpu_umac_if.h" +#endif #include "fmac_main.h" extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index d0fa7cfba410..764cab93193e 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -69,9 +69,10 @@ BUILD_ASSERT(CONFIG_NRF70_MAX_TX_AGGREGATION <= 15, "Max TX aggregation is 15"); BUILD_ASSERT(CONFIG_NRF70_RX_NUM_BUFS >= 1, "At least one RX buffer is required"); +#ifndef CONFIG_NRF71_ON_IPC BUILD_ASSERT(RPU_PKTRAM_SIZE - TOTAL_RX_SIZE >= TOTAL_TX_SIZE, "Packet RAM overflow: not enough memory for TX"); - +#endif /* CONFIG_NRF71_ON_IPC */ BUILD_ASSERT(CONFIG_NRF70_TX_MAX_DATA_SIZE >= MAX_TX_FRAME_SIZE, "TX buffer size must be at least as big as the MTU and headroom"); @@ -503,12 +504,9 @@ void reg_change_callbk_fn(void *vif_ctx, } #endif /* !CONFIG_NRF70_RADIO_TEST */ -#ifdef CONFIG_NRF71_ON_IPC -#define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(wifi), label) * 4 -#else +#ifndef CONFIG_NRF71_ON_IPC /* DTS uses 1dBm as the unit for TX power, while the RPU uses 0.25dBm */ #define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(nrf70), label) * 4 -#endif /* CONFIG_NRF71_ON_IPC */ void configure_tx_pwr_settings(struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params, struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params) @@ -587,6 +585,7 @@ void configure_board_dep_params(struct nrf_wifi_board_params *board_params) board_params->pcb_loss_5g_band3 = CONFIG_NRF70_PCB_LOSS_5G_BAND3; #endif /* CONFIG_NRF70_2_4G_ONLY */ } +#endif /* CONFIG_NRF71_ON_IPC */ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep) { @@ -606,7 +605,6 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv struct nrf_wifi_tx_pwr_ctrl_params tx_pwr_ctrl_params; struct nrf_wifi_tx_pwr_ceil_params tx_pwr_ceil_params; struct nrf_wifi_board_params board_params; - unsigned int fw_ver = 0; #if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \ @@ -654,10 +652,12 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv NRF_WIFI_UMAC_VER_MIN(fw_ver), NRF_WIFI_UMAC_VER_EXTRA(fw_ver)); +#ifndef CONFIG_NRF71_ON_IPC configure_tx_pwr_settings(&tx_pwr_ctrl_params, &tx_pwr_ceil_params); configure_board_dep_params(&board_params); +#endif /* CONFIG_NRF71_ON_IPC */ #if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \ defined(CONFIG_NRF70_SYSTEM_MODE) @@ -853,9 +853,14 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) struct nrf_wifi_sys_fmac_priv *sys_fpriv = NULL; sys_fpriv = wifi_fmac_priv(rpu_drv_priv_zep.fmac_priv); +#ifdef CONFIG_NRF71_ON_IPC + /* TODO: Revisit this */ + sys_fpriv->max_ampdu_len_per_token = 8192; +#else sys_fpriv->max_ampdu_len_per_token = (RPU_PKTRAM_SIZE - (CONFIG_NRF70_RX_NUM_BUFS * CONFIG_NRF70_RX_MAX_DATA_SIZE)) / CONFIG_NRF70_MAX_TX_TOKENS; +#endif /* CONFIG_NRF71_ON_IPC */ /* Align to 4-byte */ sys_fpriv->max_ampdu_len_per_token &= ~0x3; diff --git a/drivers/wifi/nrf_wifi/src/fw_load.c b/drivers/wifi/nrf_wifi/src/fw_load.c index f09643a585a8..cce5a98372fc 100644 --- a/drivers/wifi/nrf_wifi/src/fw_load.c +++ b/drivers/wifi/nrf_wifi/src/fw_load.c @@ -17,13 +17,17 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include +#ifndef CONFIG_NRF71_ON_IPC static const char fw_patch[] = { #include }; +#endif /* CONFIG_NRF71_ON_IPC */ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + +#ifndef CONFIG_NRF71_ON_IPC struct nrf_wifi_fmac_fw_info fw_info = { 0 }; status = nrf_wifi_fmac_fw_parse(rpu_ctx, fw_patch, sizeof(fw_patch), &fw_info); @@ -31,13 +35,15 @@ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) LOG_ERR("%s: nrf_wifi_fmac_fw_parse failed", __func__); return status; } -#ifndef CONFIG_NRF71_ON_IPC + /* Load the FW patches to the RPU */ status = nrf_wifi_fmac_fw_load(rpu_ctx, &fw_info); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_fmac_fw_load failed", __func__); } +#else + status = NRF_WIFI_STATUS_SUCCESS; #endif /* !CONFIG_NRF71_ON_IPC */ return status; } diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index e48ae31734a7..6bb31241b295 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -564,8 +564,9 @@ int nrf_wifi_set_twt(const struct device *dev, twt_info.dialog_token = twt_params->dialog_token; twt_info.twt_wake_ahead_duration = twt_params->setup.twt_wake_ahead_duration; +#ifndef CONFIG_NRF71_ON_IPC twt_info.twt_req_timeout = CONFIG_NRF_WIFI_TWT_SETUP_TIMEOUT_MS; - +#endif /* CONFIG_NRF71_ON_IPC */ status = nrf_wifi_sys_fmac_twt_setup(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &twt_info); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index 4a8309434794..50c9e947229b 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -8,7 +8,11 @@ * @brief NRF Wi-Fi util shell module */ #include +#ifdef NRF71_ON_IPC +#include +#else #include "host_rpu_umac_if.h" +#endif #include "common/fmac_util.h" #include "system/fmac_api.h" #include "fmac_main.h" From 75a6012fdba8966f7cc588cf3eb13c312638bf26 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 13 Oct 2025 22:13:38 +0530 Subject: [PATCH 0224/3334] [nrf fromtree] drivers: nrf_wifi: Rejig band config nRF71 supports tri-band, so, to cater both nRF70 and nRF71, rejig the configuration and add a helper to convert from Kconfig to the interface structs. Signed-off-by: Chaitanya Tata (cherry picked from commit 9a13407e3edc59ddf414d90b1e1c4d79fbfb4388) --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 31 +++++++++---------- .../nrf_wifi/off_raw_tx/src/off_raw_tx_api.c | 22 ++++++++++++- drivers/wifi/nrf_wifi/src/fmac_main.c | 22 ++++++++++++- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index df4414a316e0..2021d25580ae 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -665,28 +665,27 @@ config WIFI_NRF70_SCAN_TIMEOUT_S int "Scan timeout in seconds" default 30 -menu "nRF Wi-Fi operation band(s)" - visible if !NRF70_2_4G_ONLY +choice NRF_WIFI_OP_BAND + prompt "nRF Wi-Fi operation bands" + default NRF_WIFI_2G_BAND if NRF70_2_4G_ONLY + default NRF_WIFI_ALL_BAND + +config NRF_WIFI_ALL_BAND + bool "Set operation band to all supported bands" config NRF_WIFI_2G_BAND bool "Set operation band to 2.4GHz" - default y if NRF70_2_4G_ONLY config NRF_WIFI_5G_BAND bool "Set operation band to 5GHz" - depends on !NRF70_2_4G_ONLY - -config NRF_WIFI_OP_BAND - int "Options to set operation band" - default 1 if NRF_WIFI_2G_BAND - default 2 if NRF_WIFI_5G_BAND - default 3 - help - Set this option to select frequency band - 1 - 2.4GHz - 2 - 5GHz - 3 - All ( 2.4GHz and 5GHz ) -endmenu +if NRF71_ON_IPC +config NRF_WIFI_6G_BAND + bool "Set operation band to 6GHz" + +config NRF_WIFI_DUAL_BAND + bool "Set operation band to 2.4GHz and 5GHz" +endif # NRF71_ON_IPC +endchoice config NRF_WIFI_IFACE_MTU int "MTU for Wi-Fi interface" diff --git a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c index 17825511787b..1e53f70c111f 100644 --- a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c +++ b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c @@ -128,6 +128,25 @@ static int bytes_from_str(uint8_t *buf, int buf_len, const char *src) } #endif /* CONFIG_WIFI_FIXED_MAC_ADDRESS_ENABLED */ +static enum op_band get_nrf_wifi_op_band(void) +{ + if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { + return BAND_24G; + } +#ifdef CONFIG_NRF71_ON_IPC + if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { + return BAND_5G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { + return BAND_6G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { + return BAND_DUAL; + } +#endif /* CONFIG_NRF71_ON_IPC */ + return BAND_ALL; +} + int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; @@ -138,6 +157,7 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) struct nrf_wifi_board_params board_params; unsigned int fw_ver = 0; k_spinlock_key_t key; + enum op_band op_band = get_nrf_wifi_op_band(); /* The OSAL layer needs to be initialized before any other initialization * so that other layers (like FW IF,HW IF etc) have access to OS ops @@ -202,7 +222,7 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) HW_SLEEP_ENABLE, #endif /* CONFIG_NRF_WIFI_LOW_POWER */ NRF_WIFI_DEF_PHY_CALIB, - CONFIG_NRF_WIFI_OP_BAND, + op_band, IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING), &ctrl_params, &ceil_params, diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 764cab93193e..47ca53d5a61c 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -587,12 +587,32 @@ void configure_board_dep_params(struct nrf_wifi_board_params *board_params) } #endif /* CONFIG_NRF71_ON_IPC */ +static enum op_band get_nrf_wifi_op_band(void) +{ + if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { + return BAND_24G; + } +#ifdef CONFIG_NRF71_ON_IPC + if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { + return BAND_5G; + } + + if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { + return BAND_6G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { + return BAND_DUAL; + } +#endif /* CONFIG_NRF71_ON_IPC */ + return BAND_ALL; +} + enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; void *rpu_ctx = NULL; - enum op_band op_band = CONFIG_NRF_WIFI_OP_BAND; + enum op_band op_band = get_nrf_wifi_op_band(); #ifdef CONFIG_NRF_WIFI_LOW_POWER int sleep_type = -1; From 4a43336e5508d3f55eb3425421ea453b9534118d Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 16 Sep 2025 00:53:05 +0530 Subject: [PATCH 0225/3334] [nrf fromtree] manifest: nrf_wifi: Pull fix for max VIF check Fixes second interface bring up failure. Signed-off-by: Chaitanya Tata (cherry picked from commit e68f50d8416e03c6afabf79ee2f7d8e0b999a38a) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4df2b937a46d..b84f3e46eb9e 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 5fffeab6496932abb10f9dae53ed3686967aa050 + revision: acb24fe26f479df9dba3c4bd97ea653ad3086ee7 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From 99a8a860f5df1f9c5f28102c3042b3ffe7027cad Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 20 Oct 2025 20:29:22 +0530 Subject: [PATCH 0226/3334] [nrf fromtree] ipc: icmsg: Increase default stack size For nRF71 Wi-Fi a higher stack size is needed. Signed-off-by: Chaitanya Tata (cherry picked from commit 05899583fdcd1d2a10e0ef3ca619fe5c57367041) --- subsys/ipc/ipc_service/lib/Kconfig.icmsg | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/ipc/ipc_service/lib/Kconfig.icmsg b/subsys/ipc/ipc_service/lib/Kconfig.icmsg index 6bbc79d4fa2a..fa84c399ffb5 100644 --- a/subsys/ipc/ipc_service/lib/Kconfig.icmsg +++ b/subsys/ipc/ipc_service/lib/Kconfig.icmsg @@ -43,6 +43,7 @@ if IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE config IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE int "Size of RX work queue stack" + default 5400 if NRF71_ON_IPC default 1280 help Size of stack used by work queue RX thread. This work queue is From 3fc4245a064690741ba29d036818c5080568be57 Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Mon, 20 Oct 2025 16:25:16 +0200 Subject: [PATCH 0227/3334] [nrf fromtree] tests: drivers: flash: Add test with buffer size over the bus packet limit Applicable to flash devices with MSPI controller Signed-off-by: Bartosz Miller (cherry picked from commit a8bf08bf4e2f43ab915ae35b0a4e7418f7f978a8) --- .../common/boards/mx25uw63_low_freq.overlay | 1 + .../common/boards/mx25uw63_single_io.overlay | 1 + .../mx25uw63_single_io_4B_addr_sreset.overlay | 2 +- tests/drivers/flash/common/src/main.c | 38 +++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay index 950005eaf5c2..8dacdb15ff55 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay @@ -7,4 +7,5 @@ &mx25uw63 { status = "okay"; mspi-max-frequency = ; + transfer-timeout = <500>; }; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay index 062020aea353..ac06662e9526 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay @@ -58,4 +58,5 @@ status = "okay"; mspi-max-frequency = ; mspi-io-mode = "MSPI_IO_MODE_SINGLE"; + transfer-timeout = <500>; }; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay index 587d68546561..09af484cc212 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay @@ -40,7 +40,6 @@ ; }; }; - }; &gpio6 { @@ -61,4 +60,5 @@ mspi-io-mode = "MSPI_IO_MODE_SINGLE"; use-4byte-addressing; initial-soft-reset; + transfer-timeout = <500>; }; diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index b629c39ebc51..df484f825e89 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -65,6 +65,11 @@ #error There is no flash device enabled or it is missing Kconfig options #endif +#if DT_NODE_HAS_PROP(DT_BUS(TEST_AREA_DEV_NODE), packet_data_limit) +#define CONTROLLER_PACKET_DATA_LIMIT DT_PROP(DT_BUS(TEST_AREA_DEV_NODE), packet_data_limit) +#define BUFFER_SIZE_OVER_PACKET_LIMIT CONTROLLER_PACKET_DATA_LIMIT + 1 +#endif + static const struct device *const flash_dev = TEST_AREA_DEVICE; static struct flash_pages_info page_info; static uint8_t __aligned(4) expected[EXPECTED_SIZE]; @@ -328,6 +333,39 @@ ZTEST(flash_driver, test_flash_erase) zassert_not_equal(expected[0], erase_value, "These values shall be different"); } +ZTEST(flash_driver, test_flash_write_read_over_the_packet_limit) +{ + +#if !defined(CONTROLLER_PACKET_DATA_LIMIT) + TC_PRINT("Given bus controller does not have 'packet_data_limit' property\n"); + ztest_test_skip(); +#else + int rc; + const uint8_t pattern = 0xA1; + static uint8_t large_data_buf[BUFFER_SIZE_OVER_PACKET_LIMIT]; + + /* Flatten area corresponding to the size of two packets */ + rc = flash_flatten(flash_dev, page_info.start_offset, 2 * CONTROLLER_PACKET_DATA_LIMIT); + zassert_equal(rc, 0, "Flash flatten failed: %d", rc); + + /* Fill flash area with buffer size over the configured packet limit */ + rc = flash_fill(flash_dev, pattern, page_info.start_offset, BUFFER_SIZE_OVER_PACKET_LIMIT); + zassert_equal(rc, 0, "Flash fill failed"); + + /* Read flash area with buffer size over the MSPI packet limit */ + rc = flash_read(flash_dev, page_info.start_offset, large_data_buf, + BUFFER_SIZE_OVER_PACKET_LIMIT); + zassert_equal(rc, 0, "Flash read failed"); + + /* Compare read data to the pre-defined pattern */ + for (int i = 0; i < BUFFER_SIZE_OVER_PACKET_LIMIT; i++) { + zassert_equal(large_data_buf[i], pattern, + "large_data_buf[%u]=%x read, does not match written pattern %x", i, + large_data_buf[i], pattern); + } +#endif +} + ZTEST(flash_driver, test_supply_gpios_control) { if (!DT_NODE_HAS_PROP(TEST_AREA_DEV_NODE, supply_gpios)) { From 58e60e8ae5142c8d4e66ff247542418906e1debb Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Tue, 28 Oct 2025 18:20:13 +0100 Subject: [PATCH 0228/3334] [nrf fromtree] mgmt: Handle slot version equality If slots have equal version, but a secondary slot is the active one, the next boot will switch to the primary slot. Expose this through SMP commands by marking the primary slot as pending. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 1b50f08ee9500dbdd428b093dba5dfc1f2568d6a) --- .../mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 40 ++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index dbb496fb3b33..0ebb722c2a90 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -127,21 +127,30 @@ img_mgmt_state_flags(int query_slot) int image = query_slot / 2; /* We support max 2 images for now */ int active_slot = img_mgmt_active_slot(image); - /* In case when MCUboot is configured for DirectXIP slot may only be - * active or pending. Slot is marked pending only when version in that slot - * is higher than version of active slot. + /* In case when MCUboot is configured for FW loader/updater mode, slots + * can be either active or non-active. There is no concept of pending + * or confirmed slots. + * + * In case when MCUboot is configured for DirectXIP slot may only be + * active or pending. + * Slot is marked as pending when: + * - version in that slot is higher than version of active slot. + * - versions are equal but slot number is lower than the active slot. */ if (image == img_mgmt_active_image() && query_slot == active_slot) { flags = IMG_MGMT_STATE_F_ACTIVE; +#ifdef CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP } else { struct image_version sver; struct image_version aver; int rcs = img_mgmt_read_info(query_slot, &sver, NULL, NULL); int rca = img_mgmt_read_info(active_slot, &aver, NULL, NULL); - if (rcs == 0 && rca == 0 && img_mgmt_vercmp(&aver, &sver) < 0) { + if (rcs == 0 && rca == 0 && ((img_mgmt_vercmp(&aver, &sver) < 0) || + ((img_mgmt_vercmp(&aver, &sver) == 0) && (active_slot > query_slot)))) { flags = IMG_MGMT_STATE_F_PENDING | IMG_MGMT_STATE_F_PERMANENT; } +#endif /* CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP */ } return flags; @@ -285,18 +294,37 @@ int img_mgmt_get_next_boot_slot(int image, enum img_mgmt_next_boot_type *type) if (active_slot_state == DIRECT_XIP_BOOT_ONCE) { lt = NEXT_BOOT_TYPE_TEST; } - } else if (img_mgmt_vercmp(&aver, &over) < 0) { + } else if ((img_mgmt_vercmp(&aver, &over) < 0) || + ((img_mgmt_vercmp(&aver, &over) == 0) && (active_slot > other_slot))) { + /* Check if MCUboot will select the non-active slot during the next boot. + * The logic is as follows: + * - If both slots are valid, a slot with higher version is preferred. + * - If both slots are valid and the versions are equal, a slot with lower number + * is preferred. + */ if (other_slot_state == DIRECT_XIP_BOOT_FOREVER) { return_slot = other_slot; } else if (other_slot_state == DIRECT_XIP_BOOT_ONCE) { lt = NEXT_BOOT_TYPE_TEST; return_slot = other_slot; } + } else { + /* There is neither a preference nor a necessity to boot the other slot. + * The active slot will be used again. + */ } out: #else - if (rcs == 0 && rca == 0 && img_mgmt_vercmp(&aver, &over) < 0) { + if (rcs == 0 && rca == 0 && + ((img_mgmt_vercmp(&aver, &over) < 0) || + ((img_mgmt_vercmp(&aver, &over) == 0) && (active_slot > other_slot)))) { + /* Check if MCUboot will select the non-active slot during the next boot. + * The logic is as follows: + * - If both slots are valid, a slot with higher version is preferred. + * - If both slots are valid and the versions are equal, a slot with lower number + * is preferred. + */ return_slot = other_slot; } #endif /* defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) */ From 20a2e381a1144ed37377eb4dda9bcc1a072a314b Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Wed, 15 Oct 2025 18:15:25 +0100 Subject: [PATCH 0229/3334] [nrf fromtree] dts: nordic: Add nrf-qspi-v2 binding The nrf-qspi-v2 peripheral is similar to EXMIF on nrf54h20 but supports DMA and slave-mode. The wrapper around the SSI IP is also different with DMA features. Signed-off-by: David Jewsbury (cherry picked from commit 72dd539cbacd344fc6fdb79d82b9c8378dbe2aca) --- dts/bindings/mspi/nordic,nrf-qspi-v2.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 dts/bindings/mspi/nordic,nrf-qspi-v2.yaml diff --git a/dts/bindings/mspi/nordic,nrf-qspi-v2.yaml b/dts/bindings/mspi/nordic,nrf-qspi-v2.yaml new file mode 100644 index 000000000000..5ad8a6fd2452 --- /dev/null +++ b/dts/bindings/mspi/nordic,nrf-qspi-v2.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic QSPI v2 Interface using SSI IP + +compatible: "nordic,nrf-qspi-v2" + +include: snps,designware-ssi.yaml From a8e2937fa7bd5b4fe8ea8b80fea3cb75c7c879d0 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Wed, 13 Aug 2025 16:48:39 +0100 Subject: [PATCH 0230/3334] [nrf fromtree] drivers: pinctrl: nrf: add support for MSPI Support for new MSPI peripheral where there is no PSEL so pins are setup through CTRLSEL. Signed-off-by: David Jewsbury (cherry picked from commit ac94ca7894df365aa8bbfa4c640932bd8ba26cf2) --- drivers/pinctrl/pinctrl_nrf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index f960ce4d97a3..a9902d33f801 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -486,6 +486,19 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_DISCONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) */ +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) + /* No PSEL for QSPI_V2, pins only controlled by CTRLSEL */ + case NRF_FUN_QSPI_SCK: + case NRF_FUN_QSPI_CSN: + case NRF_FUN_QSPI_IO0: + case NRF_FUN_QSPI_IO1: + case NRF_FUN_QSPI_IO2: + case NRF_FUN_QSPI_IO3: + nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_QSPI); + dir = NRF_GPIO_PIN_DIR_OUTPUT; + input = NRF_GPIO_PIN_INPUT_CONNECT; + break; +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) */ #if defined(NRF_PSEL_TWIS) case NRF_FUN_TWIS_SCL: NRF_PSEL_TWIS(reg, SCL) = psel; From fb161c891a348d2c442c9c12fab041cdbf9ec9d8 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 4 Sep 2025 11:36:45 +0100 Subject: [PATCH 0231/3334] [nrf fromtree] drivers: mspi: Add timeout callback to MSPI API This is a new callback option that drivers can use for when a request or xfer has timed out. E.g if an Async RX request never received anything, this callback can be used so a user can clean up their application. Signed-off-by: David Jewsbury (cherry picked from commit a322957f59e5a7bd33a129e6203ad6446d6e6813) --- doc/hardware/peripherals/mspi.rst | 10 ++++++---- include/zephyr/drivers/mspi.h | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/hardware/peripherals/mspi.rst b/doc/hardware/peripherals/mspi.rst index 176c9bf5ede3..1f01857f32cc 100644 --- a/doc/hardware/peripherals/mspi.rst +++ b/doc/hardware/peripherals/mspi.rst @@ -100,10 +100,12 @@ whether to support scatter IO and callback management. The controller can determ which user callback to trigger based on :c:enum:`mspi_bus_event_cb_mask` upon completion of each async/sync transfer if the callback had been registered using :c:func:`mspi_register_callback`. Or not to trigger any callback at all with -:c:enum:`MSPI_BUS_NO_CB` even if the callbacks are already registered. -In which case that a controller supports hardware command queue, user could take full -advantage of the hardware performance if scatter IO and callback management are supported -by the driver implementation. +:c:enum:`MSPI_BUS_NO_CB` even if the callbacks are already registered. If the implemented +driver support it, the API supports :c:enum:`MSPI_BUS_XFER_COMPLETE_CB` to signal when a +transfer finishes and :c:enum:`MSPI_BUS_TIMEOUT_CB` to signal when a transfer or request +has timed-out. In which case that a controller supports hardware command queue, user could +take full advantage of the hardware performance if scatter IO and callback management are +supported by the driver implementation. Device Tree =========== diff --git a/include/zephyr/drivers/mspi.h b/include/zephyr/drivers/mspi.h index c486f48a8ddf..b30627efad78 100644 --- a/include/zephyr/drivers/mspi.h +++ b/include/zephyr/drivers/mspi.h @@ -126,6 +126,8 @@ enum mspi_bus_event { MSPI_BUS_RESET = 0, MSPI_BUS_ERROR = 1, MSPI_BUS_XFER_COMPLETE = 2, + /** @brief When a request or xfer has timed out */ + MSPI_BUS_TIMEOUT = 3, MSPI_BUS_EVENT_MAX, }; @@ -139,6 +141,7 @@ enum mspi_bus_event_cb_mask { MSPI_BUS_RESET_CB = BIT(0), MSPI_BUS_ERROR_CB = BIT(1), MSPI_BUS_XFER_COMPLETE_CB = BIT(2), + MSPI_BUS_TIMEOUT_CB = BIT(3), }; /** From 5312fd6b6f06020c5b1e73ae845c5d67cb4f2a7b Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Tue, 26 Aug 2025 17:15:11 +0100 Subject: [PATCH 0232/3334] [nrf fromtree] dts: mspi: Align op-mode binding with mspi.h enum enum mspi_op_mode in mspi.h has different syntax to this binding. Aligning these will allow for cleaner code in the implmented drivers. Signed-off-by: David Jewsbury (cherry picked from commit 032ca4c894d9239ae7c2753ea4edc75c8e84ea3d) --- dts/bindings/mspi/mspi-controller.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dts/bindings/mspi/mspi-controller.yaml b/dts/bindings/mspi/mspi-controller.yaml index 6f22d0dc0bf2..dd7c99e34ece 100644 --- a/dts/bindings/mspi/mspi-controller.yaml +++ b/dts/bindings/mspi/mspi-controller.yaml @@ -22,8 +22,8 @@ properties: op-mode: type: string enum: - - "MSPI_CONTROLLER" - - "MSPI_PERIPHERAL" + - "MSPI_OP_MODE_CONTROLLER" + - "MSPI_OP_MODE_PERIPHERAL" description: | Indicate MSPI controller or peripheral mode of the controller. The controller driver may use this during initialization. From f7a4516f23fddbd24ebdac9cb95230818f3d3332 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 9 Oct 2025 16:45:00 +0200 Subject: [PATCH 0233/3334] [nrf fromtree] drivers: mspi_dw: Add support for asynchronous transfers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handling of asynchronous transfers uses the system workqueue, hence they are not available when multithreading is disabled. Also add missing dependency on multithreading in the MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE Kconfig option. Signed-off-by: David Jewsbury Signed-off-by: Andrzej Głąbek (cherry picked from commit 2f1ee737b362ea697834ddf8f8a11ccb50e4659d) --- drivers/mspi/Kconfig.dw | 1 + drivers/mspi/mspi_dw.c | 238 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 219 insertions(+), 20 deletions(-) diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index cff148c138c6..485ea6c1a420 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -14,6 +14,7 @@ if MSPI_DW config MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE bool "Handle FIFO in system workqueue" + depends on MULTITHREADING help When the driver does not use DMA for transferring data to/from the SSI FIFOs, handling of those may take a significant amount of time. diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 518b5605785f..e8c9a817095d 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -66,20 +66,29 @@ struct mspi_dw_data { bool suspended; #if defined(CONFIG_MULTITHREADING) + const struct device *dev; + struct k_sem finished; /* For synchronization of API calls made from different contexts. */ struct k_sem ctx_lock; /* For locking of controller configuration. */ struct k_sem cfg_lock; + + struct k_timer async_timer; + struct k_work async_timeout_work; + struct k_work async_packet_work; + + mspi_callback_handler_t cbs[MSPI_BUS_EVENT_MAX]; + struct mspi_callback_context *cb_ctxs[MSPI_BUS_EVENT_MAX]; #else volatile bool finished; bool cfg_lock; #endif + struct mspi_xfer xfer; #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) struct k_work fifo_work; - const struct device *dev; uint32_t imr; #endif }; @@ -141,6 +150,100 @@ DEFINE_MM_REG_WR(xip_write_ctrl, 0x148) #include "mspi_dw_vendor_specific.h" +static int start_next_packet(const struct device *dev); +static int finalize_packet(const struct device *dev, int rc); +static int finalize_transceive(const struct device *dev, int rc); + +#if defined(CONFIG_MULTITHREADING) +/* Common function to setup callback context and call user callback */ +static void call_user_callback_with_context(const struct device *dev, + enum mspi_bus_event evt_type, + uint32_t packet_idx, + int status) +{ + struct mspi_dw_data *dev_data = dev->data; + const struct mspi_xfer_packet *packet = + &dev_data->xfer.packets[packet_idx]; + struct mspi_callback_context *cb_ctx = dev_data->cb_ctxs[evt_type]; + + if (!(packet->cb_mask & BIT(evt_type)) || + !dev_data->cbs[evt_type]) { + return; + } + + LOG_DBG("Calling user function with evt_type: %u", evt_type); + + cb_ctx->mspi_evt.evt_type = evt_type; + cb_ctx->mspi_evt.evt_data.controller = dev; + cb_ctx->mspi_evt.evt_data.dev_id = dev_data->dev_id; + cb_ctx->mspi_evt.evt_data.packet = packet; + cb_ctx->mspi_evt.evt_data.packet_idx = packet_idx; + cb_ctx->mspi_evt.evt_data.status = status; + + dev_data->cbs[evt_type](cb_ctx); +} + +static void async_timeout_timer_handler(struct k_timer *timer) +{ + struct mspi_dw_data *dev_data = + CONTAINER_OF(timer, struct mspi_dw_data, async_timer); + + /* Submit work to handle timeout in proper context */ + k_work_submit(&dev_data->async_timeout_work); +} + +static void async_timeout_work_handler(struct k_work *work) +{ + struct mspi_dw_data *dev_data = + CONTAINER_OF(work, struct mspi_dw_data, async_timeout_work); + const struct device *dev = dev_data->dev; + int rc; + + LOG_ERR("Async transfer timed out"); + + rc = finalize_packet(dev, -ETIMEDOUT); + rc = finalize_transceive(dev, rc); + + /* Call user callback with timeout error (outside of any locks) */ + call_user_callback_with_context(dev, MSPI_BUS_TIMEOUT, + dev_data->packets_done, rc); +} + +static void async_packet_work_handler(struct k_work *work) +{ + struct mspi_dw_data *dev_data = + CONTAINER_OF(work, struct mspi_dw_data, async_packet_work); + const struct device *dev = dev_data->dev; + uint32_t packet_idx = dev_data->packets_done; + int rc; + + LOG_DBG("Processing async work in thread context"); + + rc = finalize_packet(dev, 0); + if (rc >= 0) { + ++dev_data->packets_done; + if (dev_data->packets_done < dev_data->xfer.num_packet) { + LOG_DBG("Starting next packet (%d/%d)", + dev_data->packets_done + 1, + dev_data->xfer.num_packet); + + rc = start_next_packet(dev); + if (rc >= 0) { + return; + } + + ++packet_idx; + } + } + + rc = finalize_transceive(dev, rc); + call_user_callback_with_context(dev, + rc < 0 ? MSPI_BUS_ERROR + : MSPI_BUS_XFER_COMPLETE, + packet_idx, rc); +} +#endif /* defined(CONFIG_MULTITHREADING) */ + static void tx_data(const struct device *dev, const struct mspi_xfer_packet *packet) { @@ -316,6 +419,22 @@ static inline void set_imr(const struct device *dev, uint32_t imr) #endif } +static void handle_end_of_packet(struct mspi_dw_data *dev_data) + +{ +#if defined(CONFIG_MULTITHREADING) + if (dev_data->xfer.async) { + k_timer_stop(&dev_data->async_timer); + + k_work_submit(&dev_data->async_packet_work); + } else { + k_sem_give(&dev_data->finished); + } +#else + dev_data->finished = true; +#endif +} + static void handle_fifos(const struct device *dev) { struct mspi_dw_data *dev_data = dev->data; @@ -401,11 +520,8 @@ static void handle_fifos(const struct device *dev) if (finished) { set_imr(dev, 0); -#if defined(CONFIG_MULTITHREADING) - k_sem_give(&dev_data->finished); -#else - dev_data->finished = true; -#endif + handle_end_of_packet(dev_data); + } } @@ -874,6 +990,10 @@ static int api_dev_config(const struct device *dev, } dev_data->dev_id = dev_id; + +#if defined(CONFIG_MULTITHREADING) + memset(dev_data->cbs, 0, sizeof(dev_data->cbs)); +#endif } if (param_mask == MSPI_DEVICE_CONFIG_NONE && @@ -935,7 +1055,7 @@ static void tx_control_field(const struct device *dev, } while (shift); } -static int start_next_packet(const struct device *dev, k_timeout_t timeout) +static int start_next_packet(const struct device *dev) { const struct mspi_dw_config *dev_config = dev->config; struct mspi_dw_data *dev_data = dev->data; @@ -1177,13 +1297,26 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) tx_data(dev, packet); } - /* Enable interrupts now and wait until the packet is done. */ + /* Enable interrupts now */ write_imr(dev, imr); /* Write SER to start transfer */ write_ser(dev, BIT(dev_data->dev_id->dev_idx)); #if defined(CONFIG_MULTITHREADING) + k_timeout_t timeout = K_MSEC(dev_data->xfer.timeout); + + /* For async transfer, start the timeout timer and exit. */ + if (dev_data->xfer.async) { + k_timer_start(&dev_data->async_timer, timeout, K_NO_WAIT); + + return 0; + } + + /* For sync transfer, wait until the packet is finished. */ rc = k_sem_take(&dev_data->finished, timeout); + if (rc < 0) { + rc = -ETIMEDOUT; + } #else if (!WAIT_FOR(dev_data->finished, dev_data->xfer.timeout * USEC_PER_MSEC, @@ -1193,12 +1326,22 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) dev_data->finished = false; #endif + + return finalize_packet(dev, rc); +} + +static int finalize_packet(const struct device *dev, int rc) +{ + struct mspi_dw_data *dev_data = dev->data; + bool xip_enabled = COND_CODE_1(CONFIG_MSPI_XIP, + (dev_data->xip_enabled != 0), + (false)); + if (read_risr(dev) & RISR_RXOIR_BIT) { LOG_ERR("RX FIFO overflow occurred"); rc = -EIO; - } else if (rc < 0) { + } else if (rc == -ETIMEDOUT) { LOG_ERR("Transfer timed out"); - rc = -ETIMEDOUT; } /* Disable the controller. This will immediately halt the transfer @@ -1207,10 +1350,10 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) if (xip_enabled) { /* If XIP is enabled, the controller must be kept enabled, * so disable it only momentarily if there's a need to halt - * a transfer that has timeout out. + * a transfer that ended up with an error. */ - if (rc == -ETIMEDOUT) { - key = irq_lock(); + if (rc < 0) { + unsigned int key = irq_lock(); write_ssienr(dev, 0); write_ssienr(dev, SSIENR_SSIC_EN_BIT); @@ -1220,13 +1363,14 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) } else { write_ssienr(dev, 0); } + /* Clear SER */ write_ser(dev, 0); if (dev_data->dev_id->ce.port) { int rc2; - /* Do not use `rc` to not overwrite potential timeout error. */ + /* Do not use `rc` to not overwrite potential packet error. */ rc2 = gpio_pin_set_dt(&dev_data->dev_id->ce, 0); if (rc2 < 0) { LOG_ERR("Failed to deactivate CE line (%d)", rc2); @@ -1269,10 +1413,18 @@ static int _api_transceive(const struct device *dev, dev_data->xfer = *req; + /* For async, only the first packet is started here, next ones, if any, + * are started by ISR. + */ + if (req->async) { + dev_data->packets_done = 0; + return start_next_packet(dev); + } + for (dev_data->packets_done = 0; dev_data->packets_done < dev_data->xfer.num_packet; dev_data->packets_done++) { - rc = start_next_packet(dev, K_MSEC(dev_data->xfer.timeout)); + rc = start_next_packet(dev); if (rc < 0) { return rc; } @@ -1286,16 +1438,15 @@ static int api_transceive(const struct device *dev, const struct mspi_xfer *req) { struct mspi_dw_data *dev_data = dev->data; - int rc, rc2; + int rc; if (dev_id != dev_data->dev_id) { LOG_ERR("Controller is not configured for this device"); return -EINVAL; } - /* TODO: add support for asynchronous transfers */ - if (req->async) { - LOG_ERR("Asynchronous transfers are not supported"); + if (req->async && !IS_ENABLED(CONFIG_MULTITHREADING)) { + LOG_ERR("Asynchronous transfers require multithreading"); return -ENOTSUP; } @@ -1315,7 +1466,20 @@ static int api_transceive(const struct device *dev, rc = _api_transceive(dev, req); } + if (req->async && rc >= 0) { + return rc; + } + + return finalize_transceive(dev, rc); +} + +static int finalize_transceive(const struct device *dev, int rc) +{ + int rc2; + #if defined(CONFIG_MULTITHREADING) + struct mspi_dw_data *dev_data = dev->data; + k_sem_give(&dev_data->ctx_lock); #endif @@ -1328,6 +1492,33 @@ static int api_transceive(const struct device *dev, return rc; } +#if defined(CONFIG_MULTITHREADING) +static int api_register_callback(const struct device *dev, + const struct mspi_dev_id *dev_id, + const enum mspi_bus_event evt_type, + mspi_callback_handler_t cb, + struct mspi_callback_context *ctx) +{ + struct mspi_dw_data *dev_data = dev->data; + + if (dev_id != dev_data->dev_id) { + LOG_ERR("Controller is not configured for this device"); + return -EINVAL; + } + + if (evt_type != MSPI_BUS_ERROR && + evt_type != MSPI_BUS_XFER_COMPLETE && + evt_type != MSPI_BUS_TIMEOUT) { + LOG_ERR("Callback type %d not supported", evt_type); + return -ENOTSUP; + } + + dev_data->cbs[evt_type] = cb; + dev_data->cb_ctxs[evt_type] = ctx; + return 0; +} +#endif /* defined(CONFIG_MULTITHREADING) */ + #if defined(CONFIG_MSPI_TIMING) static int api_timing_config(const struct device *dev, const struct mspi_dev_id *dev_id, @@ -1570,13 +1761,17 @@ static int dev_init(const struct device *dev) #if defined(CONFIG_MULTITHREADING) struct mspi_dw_data *dev_data = dev->data; + dev_data->dev = dev; k_sem_init(&dev_data->finished, 0, 1); k_sem_init(&dev_data->cfg_lock, 1, 1); k_sem_init(&dev_data->ctx_lock, 1, 1); + + k_timer_init(&dev_data->async_timer, async_timeout_timer_handler, NULL); + k_work_init(&dev_data->async_timeout_work, async_timeout_work_handler); + k_work_init(&dev_data->async_packet_work, async_packet_work_handler); #endif #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) - dev_data->dev = dev; k_work_init(&dev_data->fifo_work, fifo_work_handler); #endif @@ -1616,6 +1811,9 @@ static DEVICE_API(mspi, drv_api) = { .dev_config = api_dev_config, .get_channel_status = api_get_channel_status, .transceive = api_transceive, +#if defined(CONFIG_MULTITHREADING) + .register_callback = api_register_callback, +#endif #if defined(CONFIG_MSPI_TIMING) .timing_config = api_timing_config, #endif From 53e5501b345d31534d2ef00eaa63b3de2b54efe2 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Mon, 13 Oct 2025 11:50:55 +0100 Subject: [PATCH 0234/3334] [nrf fromtree] drivers: mspi_dw: Add support for slave mode MSPI slave mode is selected through devicetree using the op-mode property. Mode selected by SSIISMST bit in the CTRLR0 register. EXMIF can only be Master (controller). Signed-off-by: David Jewsbury (cherry picked from commit a18fd950045dc6e1fe415710fd4392ead30e46da) --- drivers/mspi/mspi_dw.c | 8 ++++++-- drivers/mspi/mspi_dw.h | 1 + dts/bindings/mspi/nordic,nrf-exmif.yaml | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index e8c9a817095d..cefcb5e59568 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -114,6 +114,7 @@ struct mspi_dw_config { uint8_t rx_fifo_threshold; DECLARE_REG_ACCESS(); bool sw_multi_periph; + enum mspi_op_mode op_mode; }; /* Register access helpers. */ @@ -1748,6 +1749,7 @@ static int dev_pm_action_cb(const struct device *dev, static int dev_init(const struct device *dev) { + struct mspi_dw_data *dev_data = dev->data; const struct mspi_dw_config *dev_config = dev->config; const struct gpio_dt_spec *ce_gpio; int rc; @@ -1756,11 +1758,12 @@ static int dev_init(const struct device *dev) vendor_specific_init(dev); + dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_SSI_IS_MST_BIT, + dev_config->op_mode == MSPI_OP_MODE_CONTROLLER); + dev_config->irq_config(); #if defined(CONFIG_MULTITHREADING) - struct mspi_dw_data *dev_data = dev->data; - dev_data->dev = dev; k_sem_init(&dev_data->finished, 0, 1); k_sem_init(&dev_data->cfg_lock, 1, 1); @@ -1885,6 +1888,7 @@ static DEVICE_API(mspi, drv_api) = { DEFINE_REG_ACCESS(inst) \ .sw_multi_periph = \ DT_INST_PROP(inst, software_multiperipheral), \ + .op_mode = DT_INST_STRING_TOKEN(inst, op_mode), \ }; \ DEVICE_DT_INST_DEFINE(inst, \ dev_init, PM_DEVICE_DT_INST_GET(inst), \ diff --git a/drivers/mspi/mspi_dw.h b/drivers/mspi/mspi_dw.h index 28e4bed016e7..894bee40d6c4 100644 --- a/drivers/mspi/mspi_dw.h +++ b/drivers/mspi/mspi_dw.h @@ -19,6 +19,7 @@ */ /* CTRLR0 - Control Register 0 */ +#define CTRLR0_SSI_IS_MST_BIT BIT(31) #define CTRLR0_SPI_FRF_MASK COND_CODE_1(SSI_VERSION_2, GENMASK(22, 21), GENMASK(23, 22)) #define CTRLR0_SPI_FRF_STANDARD 0UL #define CTRLR0_SPI_FRF_DUAL 1UL diff --git a/dts/bindings/mspi/nordic,nrf-exmif.yaml b/dts/bindings/mspi/nordic,nrf-exmif.yaml index 294254aa60ef..4e46e5d6b142 100644 --- a/dts/bindings/mspi/nordic,nrf-exmif.yaml +++ b/dts/bindings/mspi/nordic,nrf-exmif.yaml @@ -6,3 +6,7 @@ description: Nordic External Memory Interface (EXMIF) compatible: "nordic,nrf-exmif" include: snps,designware-ssi.yaml + +properties: + op-mode: + default: "MSPI_OP_MODE_CONTROLLER" From b79b24cbbe7e23966dea34f4f9a0e43566599d3b Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Tue, 14 Oct 2025 11:05:37 +0100 Subject: [PATCH 0235/3334] [nrf fromtree] drivers: mspi: mspi_dw: Add DMA support Initial DMA support. DMA supports implementation of SSI IP but using vendor specific DMA in the wrapper. The setup of the DMA is done in mspi_dw_vendor_specific.h. Signed-off-by: David Jewsbury (cherry picked from commit d9677bbd7b54c22aa6fbaa75c67478f22e42b33f) --- doc/hardware/peripherals/mspi.rst | 1 + drivers/mspi/Kconfig | 6 + drivers/mspi/Kconfig.dw | 1 - drivers/mspi/mspi_dw.c | 227 +++++++++++++------ drivers/mspi/mspi_dw.h | 16 ++ drivers/mspi/mspi_dw_vendor_specific.h | 247 ++++++++++++++++++++- dts/bindings/mspi/snps,designware-ssi.yaml | 17 ++ 7 files changed, 439 insertions(+), 76 deletions(-) diff --git a/doc/hardware/peripherals/mspi.rst b/doc/hardware/peripherals/mspi.rst index 1f01857f32cc..b9139f1ed1a8 100644 --- a/doc/hardware/peripherals/mspi.rst +++ b/doc/hardware/peripherals/mspi.rst @@ -194,6 +194,7 @@ Related configuration options: * :kconfig:option:`CONFIG_MSPI_TIMING` * :kconfig:option:`CONFIG_MSPI_INIT_PRIORITY` * :kconfig:option:`CONFIG_MSPI_COMPLETION_TIMEOUT_TOLERANCE` +* :kconfig:option:`CONFIG_MSPI_DMA` API Reference ************* diff --git a/drivers/mspi/Kconfig b/drivers/mspi/Kconfig index 269d8d16f04a..a6442c1f70fe 100644 --- a/drivers/mspi/Kconfig +++ b/drivers/mspi/Kconfig @@ -55,6 +55,12 @@ config MSPI_TIMING Enables mspi_timing_config calls in device drivers for those controllers that need this to proper function at high frequencies. +config MSPI_DMA + bool "DMA support" + help + Enables DMA capabilities, depending on the driver and hardware it + runs on. + module = MSPI module-str = mspi source "subsys/logging/Kconfig.template.log_config" diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index 485ea6c1a420..71302a801fdb 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -7,7 +7,6 @@ config MSPI_DW default y depends on DT_HAS_SNPS_DESIGNWARE_SSI_ENABLED select PINCTRL if $(dt_compat_any_has_prop,$(DT_COMPAT_SNPS_DESIGNWARE_SSI),pinctrl-0) - imply MSPI_XIP imply MSPI_TIMING if MSPI_DW diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index cefcb5e59568..d4700a99261a 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -95,6 +95,7 @@ struct mspi_dw_data { struct mspi_dw_config { DEVICE_MMIO_ROM; + void *wrapper_regs; void (*irq_config)(void); uint32_t clock_frequency; #if defined(CONFIG_PINCTRL) @@ -112,6 +113,11 @@ struct mspi_dw_config { uint8_t max_queued_dummy_bytes; uint8_t tx_fifo_threshold; uint8_t rx_fifo_threshold; +#ifdef CONFIG_MSPI_DMA + uint8_t dma_tx_data_level; + uint8_t dma_rx_data_level; +#endif + void *vendor_specific_data; DECLARE_REG_ACCESS(); bool sw_multi_periph; enum mspi_op_mode op_mode; @@ -139,6 +145,11 @@ DEFINE_MM_REG_RD_WR(dr, 0x60) DEFINE_MM_REG_WR(rx_sample_dly, 0xf0) DEFINE_MM_REG_WR(spi_ctrlr0, 0xf4) DEFINE_MM_REG_WR(txd_drive_edge, 0xf8) +#if defined(CONFIG_MSPI_DMA) +DEFINE_MM_REG_WR(dmacr, 0x4C) +DEFINE_MM_REG_WR(dmatdlr, 0x50) +DEFINE_MM_REG_WR(dmardlr, 0x54) +#endif #if defined(CONFIG_MSPI_XIP) DEFINE_MM_REG_WR(xip_incr_inst, 0x100) @@ -541,6 +552,19 @@ static void fifo_work_handler(struct k_work *work) static void mspi_dw_isr(const struct device *dev) { +#if defined(CONFIG_MSPI_DMA) + struct mspi_dw_data *dev_data = dev->data; + + if (dev_data->xfer.xfer_mode == MSPI_DMA) { + if (vendor_specific_read_dma_irq(dev)) { + set_imr(dev, 0); + handle_end_of_packet(dev_data); + } + vendor_specific_irq_clear(dev); + return; + } +#endif + #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) struct mspi_dw_data *dev_data = dev->data; int rc; @@ -1067,7 +1091,7 @@ static int start_next_packet(const struct device *dev) (false)); unsigned int key; uint32_t packet_frames; - uint32_t imr; + uint32_t imr = 0; int rc = 0; if (packet->num_bytes == 0 && @@ -1115,6 +1139,18 @@ static int start_next_packet(const struct device *dev) return -EINVAL; } +#if defined(CONFIG_MSPI_DMA) + if (dev_data->xfer.xfer_mode == MSPI_DMA) { + /* Check if the packet buffer is accessible */ + if (packet->num_bytes > 0 && + !vendor_specific_dma_accessible_check(dev, packet->data_buf)) { + LOG_ERR("Buffer not DMA accessible: ptr=0x%lx, size=%u", + (uintptr_t)packet->data_buf, packet->num_bytes); + return -EINVAL; + } + } +#endif + if (packet->dir == MSPI_TX || packet->num_bytes == 0) { imr = IMR_TXEIM_BIT; dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_TMOD_MASK, @@ -1123,6 +1159,12 @@ static int start_next_packet(const struct device *dev) dev_data->xfer.tx_dummy); write_rxftlr(dev, 0); +#if defined(CONFIG_MSPI_DMA) + } else if (dev_data->xfer.xfer_mode == MSPI_DMA) { + dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_TMOD_MASK, CTRLR0_TMOD_RX); + dev_data->spi_ctrlr0 |= FIELD_PREP(SPI_CTRLR0_WAIT_CYCLES_MASK, + dev_data->xfer.rx_dummy); +#endif } else { uint32_t tmod; uint8_t rx_fifo_threshold; @@ -1211,95 +1253,124 @@ static int start_next_packet(const struct device *dev) irq_unlock(key); } - dev_data->buf_pos = packet->data_buf; - dev_data->buf_end = &packet->data_buf[packet->num_bytes]; - - /* Set the TX FIFO threshold and its transmit start level. */ - if (packet->num_bytes) { - /* If there is some data to send/receive, set the threshold to - * the value configured for the driver instance and the start - * level to the maximum possible value (it will be updated later - * in tx_fifo() or tx_dummy_bytes() when TX is to be finished). - * This helps avoid a situation when the TX FIFO becomes empty - * before the transfer is complete and the SSI core finishes the - * transaction and deactivates the CE line. This could occur - * right before the data phase in enhanced SPI modes, when the - * clock stretching feature does not work yet, or in Standard - * SPI mode, where the clock stretching is not available at all. - */ - uint8_t start_level = dev_data->dummy_bytes != 0 - ? dev_config->max_queued_dummy_bytes - 1 - : dev_config->tx_fifo_depth_minus_1; +#if defined(CONFIG_MSPI_DMA) + if (dev_data->xfer.xfer_mode == MSPI_DMA) { + /* For DMA mode, set start level based on transfer length to prevent underflow */ + uint32_t total_transfer_bytes = packet->num_bytes + dev_data->xfer.addr_length + + dev_data->xfer.cmd_length; + uint32_t transfer_frames = total_transfer_bytes >> dev_data->bytes_per_frame_exp; - write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, start_level) | - FIELD_PREP(TXFTLR_TFT_MASK, - dev_config->tx_fifo_threshold)); + /* Use minimum of transfer length or FIFO depth, but at least 1 */ + uint8_t dma_start_level = MIN(transfer_frames - 1, + dev_config->tx_fifo_depth_minus_1); + + dma_start_level = (dma_start_level > 0 ? dma_start_level : 1); + + /* Only TXFTHR needs to be set to the minimum number of frames */ + write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, dma_start_level)); + write_dmatdlr(dev, FIELD_PREP(DMATDLR_DMATDL_MASK, dev_config->dma_tx_data_level)); + write_dmardlr(dev, FIELD_PREP(DMARDLR_DMARDL_MASK, dev_config->dma_rx_data_level)); + write_dmacr(dev, DMACR_TDMAE_BIT | DMACR_RDMAE_BIT); + write_imr(dev, 0); + write_ssienr(dev, SSIENR_SSIC_EN_BIT); + + vendor_specific_start_dma_xfer(dev); } else { - uint32_t total_tx_entries = 0; +#endif + /* PIO mode */ + dev_data->buf_pos = packet->data_buf; + dev_data->buf_end = &packet->data_buf[packet->num_bytes]; + /* Set the TX FIFO threshold and its transmit start level. */ + if (packet->num_bytes) { + /* If there is some data to send/receive, set the threshold to + * the value configured for the driver instance and the start + * level to the maximum possible value (it will be updated later + * in tx_fifo() or tx_dummy_bytes() when TX is to be finished). + * This helps avoid a situation when the TX FIFO becomes empty + * before the transfer is complete and the SSI core finishes the + * transaction and deactivates the CE line. This could occur + * right before the data phase in enhanced SPI modes, when the + * clock stretching feature does not work yet, or in Standard + * SPI mode, where the clock stretching is not available at all. + */ + uint8_t start_level = dev_data->dummy_bytes != 0 + ? dev_config->max_queued_dummy_bytes - 1 + : dev_config->tx_fifo_depth_minus_1; - /* It the whole transfer is to contain only the command and/or - * address, set up the transfer to start right after entries - * for those appear in the TX FIFO, and the threshold to 0, - * so that the interrupt occurs when the TX FIFO gets emptied. - */ - if (dev_data->xfer.cmd_length) { - if (dev_data->standard_spi) { - total_tx_entries += dev_data->xfer.cmd_length; - } else { - total_tx_entries += 1; + write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, start_level) | + FIELD_PREP(TXFTLR_TFT_MASK, + dev_config->tx_fifo_threshold)); + + } else { + uint32_t total_tx_entries = 0; + + /* It the whole transfer is to contain only the command and/or + * address, set up the transfer to start right after entries + * for those appear in the TX FIFO, and the threshold to 0, + * so that the interrupt occurs when the TX FIFO gets emptied. + */ + if (dev_data->xfer.cmd_length) { + if (dev_data->standard_spi) { + total_tx_entries += dev_data->xfer.cmd_length; + } else { + total_tx_entries += 1; + } } - } - if (dev_data->xfer.addr_length) { - if (dev_data->standard_spi) { - total_tx_entries += dev_data->xfer.addr_length; - } else { - total_tx_entries += 1; + if (dev_data->xfer.addr_length) { + if (dev_data->standard_spi) { + total_tx_entries += dev_data->xfer.addr_length; + } else { + total_tx_entries += 1; + } } + + write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, + total_tx_entries - 1)); } - write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, - total_tx_entries - 1)); - } + /* Ensure that there will be no interrupt from the controller yet. */ + write_imr(dev, 0); + /* Enable the controller. This must be done before DR is written. */ + write_ssienr(dev, SSIENR_SSIC_EN_BIT); - /* Ensure that there will be no interrupt from the controller yet. */ - write_imr(dev, 0); - /* Enable the controller. This must be done before DR is written. */ - write_ssienr(dev, SSIENR_SSIC_EN_BIT); + /* Since the FIFO depth in SSI is always at least 8, it can be safely + * assumed that the command and address fields (max. 2 and 4 bytes, + * respectively) can be written here before the TX FIFO gets filled up. + */ + if (dev_data->standard_spi) { + if (dev_data->xfer.cmd_length) { + tx_control_field(dev, packet->cmd, + dev_data->xfer.cmd_length); + } - /* Since the FIFO depth in SSI is always at least 8, it can be safely - * assumed that the command and address fields (max. 2 and 4 bytes, - * respectively) can be written here before the TX FIFO gets filled up. - */ - if (dev_data->standard_spi) { - if (dev_data->xfer.cmd_length) { - tx_control_field(dev, packet->cmd, - dev_data->xfer.cmd_length); - } + if (dev_data->xfer.addr_length) { + tx_control_field(dev, packet->address, + dev_data->xfer.addr_length); + } + } else { + if (dev_data->xfer.cmd_length) { + write_dr(dev, packet->cmd); + } - if (dev_data->xfer.addr_length) { - tx_control_field(dev, packet->address, - dev_data->xfer.addr_length); - } - } else { - if (dev_data->xfer.cmd_length) { - write_dr(dev, packet->cmd); + if (dev_data->xfer.addr_length) { + write_dr(dev, packet->address); + } } - if (dev_data->xfer.addr_length) { - write_dr(dev, packet->address); + /* Prefill TX FIFO with any data we can */ + if (dev_data->dummy_bytes && tx_dummy_bytes(dev, NULL)) { + imr = IMR_RXFIM_BIT; + } else if (packet->dir == MSPI_TX && packet->num_bytes) { + tx_data(dev, packet); } - } - /* Prefill TX FIFO with any data we can */ - if (dev_data->dummy_bytes && tx_dummy_bytes(dev, NULL)) { - imr = IMR_RXFIM_BIT; - } else if (packet->dir == MSPI_TX && packet->num_bytes) { - tx_data(dev, packet); + /* Enable interrupts now and wait until the packet is done unless async. */ + write_imr(dev, imr); +#if defined(CONFIG_MSPI_DMA) } +#endif - /* Enable interrupts now */ - write_imr(dev, imr); /* Write SER to start transfer */ write_ser(dev, BIT(dev_data->dev_id->dev_idx)); @@ -1867,9 +1938,16 @@ static DEVICE_API(mspi, drv_api) = { DT_INST_PROP_OR(inst, rx_fifo_threshold, \ 1 * RX_FIFO_DEPTH(inst) / 8 - 1) +#define MSPI_DW_DMA_DATA_LEVELS(inst) \ + .dma_tx_data_level = \ + DT_INST_PROP_OR(inst, dma_transmit_data_level, 0), \ + .dma_rx_data_level = \ + DT_INST_PROP_OR(inst, dma_receive_data_level, 0) + #define MSPI_DW_INST(inst) \ PM_DEVICE_DT_INST_DEFINE(inst, dev_pm_action_cb); \ IF_ENABLED(CONFIG_PINCTRL, (PINCTRL_DT_INST_DEFINE(inst);)) \ + VENDOR_SPECIFIC_DATA_DEFINE(inst); \ static void irq_config##inst(void) \ { \ LISTIFY(DT_INST_NUM_IRQS(inst), \ @@ -1878,6 +1956,7 @@ static DEVICE_API(mspi, drv_api) = { static struct mspi_dw_data dev##inst##_data; \ static const struct mspi_dw_config dev##inst##_config = { \ MSPI_DW_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ + .wrapper_regs = (void *)DT_INST_REG_ADDR(inst), \ .irq_config = irq_config##inst, \ .clock_frequency = MSPI_DW_CLOCK_FREQUENCY(inst), \ IF_ENABLED(CONFIG_PINCTRL, \ @@ -1885,6 +1964,8 @@ static DEVICE_API(mspi, drv_api) = { IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, ce_gpios), \ (MSPI_DW_CE_GPIOS(inst),)) \ MSPI_DW_FIFO_PROPS(inst), \ + IF_ENABLED(CONFIG_MSPI_DMA, (MSPI_DW_DMA_DATA_LEVELS(inst),)) \ + .vendor_specific_data = VENDOR_SPECIFIC_DATA_GET(inst), \ DEFINE_REG_ACCESS(inst) \ .sw_multi_periph = \ DT_INST_PROP(inst, software_multiperipheral), \ diff --git a/drivers/mspi/mspi_dw.h b/drivers/mspi/mspi_dw.h index 894bee40d6c4..0d015ae3db03 100644 --- a/drivers/mspi/mspi_dw.h +++ b/drivers/mspi/mspi_dw.h @@ -173,6 +173,22 @@ #define XIP_WRITE_CTRL_FRF_QUAD 2UL #define XIP_WRITE_CTRL_FRF_OCTAL 3UL +/* DMACR - DMA Control Register */ +#define DMACR_ATW_MASK GENMASK(4, 3) +#define DMACR_ATW_1 0UL +#define DMACR_ATW_2 1UL +#define DMACR_ATW_4 2UL +#define DMACR_ATW_8 3UL +#define DMACR_IDMAE_BIT BIT(2) +#define DMACR_TDMAE_BIT BIT(1) +#define DMACR_RDMAE_BIT BIT(0) + +/* DMATDLR - DMA Transmit Data Level */ +#define DMATDLR_DMATDL_MASK GENMASK(3, 0) + +/* DMARDLR - DMA Receive Data Level */ +#define DMARDLR_DMARDL_MASK GENMASK(3, 0) + /* Register access helpers. */ #define USES_AUX_REG(inst) + DT_INST_PROP(inst, aux_reg_enable) #define AUX_REG_INSTANCES (0 DT_INST_FOREACH_STATUS_OKAY(USES_AUX_REG)) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index d32a53ac2939..0b1fcf1ca7e0 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -97,7 +97,221 @@ static inline int vendor_specific_xip_disable(const struct device *dev, } #endif /* defined(CONFIG_MSPI_XIP) */ -#else +#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) +#include + +static inline void vendor_specific_init(const struct device *dev) +{ + const struct mspi_dw_config *config = dev->config; + NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; + + preg->EVENTS_CORE = 0; + preg->EVENTS_DMA.DONE = 0; + + preg->INTENSET = BIT(QSPI_INTENSET_CORE_Pos) + | BIT(QSPI_INTENSET_DMADONE_Pos); +} + +static inline void vendor_specific_suspend(const struct device *dev) +{ + const struct mspi_dw_config *config = dev->config; + NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; + + preg->ENABLE = 0; +} + +static inline void vendor_specific_resume(const struct device *dev) +{ + const struct mspi_dw_config *config = dev->config; + NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; + + preg->ENABLE = 1; + +} + +static inline void vendor_specific_irq_clear(const struct device *dev) +{ + const struct mspi_dw_config *config = dev->config; + NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; + + preg->EVENTS_CORE = 0; + preg->EVENTS_DMA.DONE = 0; +} + +/* DMA support */ + +#define EVDMA_ATTR_LEN_Pos (0UL) +#define EVDMA_ATTR_LEN_Msk (0x00FFFFFFUL) + +#define EVDMA_ATTR_ATTR_Pos (24UL) +#define EVDMA_ATTR_ATTR_Msk (0x3FUL << EVDMA_ATTR_ATTR_Pos) + +#define EVDMA_ATTR_32AXI_Pos (30UL) +#define EVDMA_ATTR_32AXI_Msk (0x1UL << EVDMA_ATTR_32AXI_Pos) + +#define EVDMA_ATTR_EVENTS_Pos (31UL) +#define EVDMA_ATTR_EVENTS_Msk (0x1UL << EVDMA_ATTR_EVENTS_Pos) + +typedef enum { + EVDMA_BYTE_SWAP = 0, + EVDMA_JOBLIST = 1, + EVDMA_BUFFER_FILL = 2, + EVDMA_FIXED_ATTR = 3, + EVDMA_STATIC_ADDR = 4, + EVDMA_PLAIN_DATA_BUF_WR = 5, +} EVDMA_ATTR_Type; + +/* Setup EVDMA attribute with the following configuratrion */ +#define EVDMA_ATTRIBUTE (BIT(EVDMA_BYTE_SWAP) | BIT(EVDMA_JOBLIST) | \ + BIT(EVDMA_BUFFER_FILL) | BIT(EVDMA_FIXED_ATTR) | \ + BIT(EVDMA_STATIC_ADDR) | BIT(EVDMA_PLAIN_DATA_BUF_WR)) + +typedef struct { + uint8_t *addr; + uint32_t attr; +} EVDMA_JOB_Type; + +#define EVDMA_JOB(BUFFER, SIZE, ATTR) \ + (EVDMA_JOB_Type) { .addr = (uint8_t *)BUFFER, .attr = (ATTR << EVDMA_ATTR_ATTR_Pos | SIZE) } +#define EVDMA_NULL_JOB() \ + (EVDMA_JOB_Type) { .addr = (uint8_t *)0, .attr = 0 } +typedef struct { + EVDMA_JOB_Type *tx_job; + EVDMA_JOB_Type *rx_job; +} QSPI_TRANSFER_LIST_Type; + +/* Number of jobs needed for transmit trasaction */ +#define MAX_NUM_JOBS 5 + +/* Vendor-specific data structure for Nordic QSPI */ +typedef struct { + QSPI_TRANSFER_LIST_Type *transfer_list; + EVDMA_JOB_Type *joblist; +} nordic_qspi_vendor_data_t; + +/* Static allocation macros for vendor-specific data */ +#define VENDOR_SPECIFIC_DATA_DEFINE(inst) \ + static QSPI_TRANSFER_LIST_Type mspi_dw_##inst##_transfer_list; \ + static EVDMA_JOB_Type mspi_dw_##inst##_joblist[MAX_NUM_JOBS]; \ + static const nordic_qspi_vendor_data_t mspi_dw_##inst##_vendor_data = { \ + .transfer_list = &mspi_dw_##inst##_transfer_list, \ + .joblist = &mspi_dw_##inst##_joblist[0] \ + }; + +#define VENDOR_SPECIFIC_DATA_GET(inst) (void *)&mspi_dw_##inst##_vendor_data + +/* Temporarily hard-coded as not in MDK yet */ +#define QSPI_TMOD_OFFSET (0x490UL) +#define QSPI_TMOD_TX_AND_RX (0x0) +#define QSPI_TMOD_TX_ONLY (0x1) +#define QSPI_TMOD_RX_ONLY (0x2) +static inline void vendor_specific_start_dma_xfer(const struct device *dev) +{ + struct mspi_dw_data *dev_data = dev->data; + const struct mspi_dw_config *config = dev->config; + const struct mspi_xfer_packet *packet = + &dev_data->xfer.packets[dev_data->packets_done]; + NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; + + /* Use vendor-specific data from config - stores job and transfer lists */ + const nordic_qspi_vendor_data_t *vendor_data = (const nordic_qspi_vendor_data_t *) + config->vendor_specific_data; + + QSPI_TRANSFER_LIST_Type *transfer_list = vendor_data->transfer_list; + EVDMA_JOB_Type *joblist = vendor_data->joblist; + + int tmod = 0; + int job_idx = 0; + + /* Set up tx job pointer to the first job */ + transfer_list->tx_job = &joblist[0]; + + /* + * The Command and Address will always have a length of 4 from the DMA's + * perspective. QSPI peripheral will use length of data specified in core registers + */ + if (dev_data->xfer.cmd_length > 0) { + joblist[job_idx++] = EVDMA_JOB(&packet->cmd, 4, EVDMA_ATTRIBUTE); + } + if (dev_data->xfer.addr_length > 0) { + joblist[job_idx++] = EVDMA_JOB(&packet->address, 4, EVDMA_ATTRIBUTE); + } + + if (packet->dir == MSPI_TX) { + preg->CONFIG.RXTRANSFERLENGTH = 0; + + if (packet->num_bytes > 0) { + joblist[job_idx++] = EVDMA_JOB(packet->data_buf, packet->num_bytes, + EVDMA_ATTRIBUTE); + } + + /* Always terminate with null job */ + joblist[job_idx] = EVDMA_NULL_JOB(); + /* rx_job is always EVDMA_NULL_JOB() for transmit */ + transfer_list->rx_job = &joblist[job_idx]; + tmod = QSPI_TMOD_TX_ONLY; + } else { + preg->CONFIG.RXTRANSFERLENGTH = ((packet->num_bytes + dev_data->xfer.addr_length + + dev_data->xfer.cmd_length) >> + dev_data->bytes_per_frame_exp) - 1; + + /* If sending address or command while being configured as controller */ + if (job_idx > 0 && config->op_mode == MSPI_OP_MODE_CONTROLLER) { + tmod = QSPI_TMOD_TX_AND_RX; + + /* After command and address, setup RX job for data */ + joblist[job_idx++] = EVDMA_NULL_JOB(); + transfer_list->rx_job = &joblist[job_idx]; + joblist[job_idx++] = EVDMA_JOB(packet->data_buf, packet->num_bytes, + EVDMA_ATTRIBUTE); + joblist[job_idx] = EVDMA_NULL_JOB(); + } else { + /* Sending command or address while configured as target isn't supported */ + tmod = QSPI_TMOD_RX_ONLY; + + transfer_list->rx_job = &joblist[0]; + joblist[0] = EVDMA_JOB(packet->data_buf, packet->num_bytes, + EVDMA_ATTRIBUTE); + joblist[1] = EVDMA_NULL_JOB(); + transfer_list->tx_job = &joblist[1]; + } + } + + /* + * In slave mode, a tmod register in the wrapper also needs to be set. Currently + * the address not in MDK so this is a temporary fix. + */ + uintptr_t tmod_addr = (uintptr_t)preg + QSPI_TMOD_OFFSET; + + sys_write32(tmod, tmod_addr); + + preg->CONFIG.TXBURSTLENGTH = config->tx_fifo_depth_minus_1 + 1 + - config->dma_tx_data_level; + preg->CONFIG.RXBURSTLENGTH = config->dma_rx_data_level + 1; + preg->DMA.CONFIG.LISTPTR = (uint32_t)transfer_list; + + preg->TASKS_START = 1; +} + +static inline bool vendor_specific_dma_accessible_check(const struct device *dev, + const uint8_t *data_buf) +{ + const struct mspi_dw_config *config = dev->config; + NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; + + return nrf_dma_accessible_check(preg, data_buf); +} + +static inline bool vendor_specific_read_dma_irq(const struct device *dev) +{ + const struct mspi_dw_config *config = dev->config; + NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; + + return (bool) preg->EVENTS_DMA.DONE; +} + +#else /* Supply empty vendor specific macros for generic case */ + static inline void vendor_specific_init(const struct device *dev) { ARG_UNUSED(dev); @@ -134,4 +348,33 @@ static inline int vendor_specific_xip_disable(const struct device *dev, return 0; } -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) */ +#if defined(CONFIG_MSPI_DMA) +static inline void vendor_specific_start_dma_xfer(const struct device *dev) +{ + ARG_UNUSED(dev); +} + +static inline bool vendor_specific_dma_accessible_check(const struct device *dev, + const uint8_t *data_buf) { + ARG_UNUSED(dev); + ARG_UNUSED(data_buf); + + return true; +} +static inline bool vendor_specific_read_dma_irq(const struct device *dev) +{ + ARG_UNUSED(dev); + + return true; +} +#endif /* defined(CONFIG_MSPI_DMA) */ +#endif /* Empty vendor specific macros */ + +/* Empty macros for generic case - no vendor-specific data */ +#ifndef VENDOR_SPECIFIC_DATA_DEFINE +#define VENDOR_SPECIFIC_DATA_DEFINE(inst) +#endif + +#ifndef VENDOR_SPECIFIC_DATA_GET +#define VENDOR_SPECIFIC_DATA_GET(inst) (void *)NULL +#endif diff --git a/dts/bindings/mspi/snps,designware-ssi.yaml b/dts/bindings/mspi/snps,designware-ssi.yaml index 69a2947f9efb..7677325493b2 100644 --- a/dts/bindings/mspi/snps,designware-ssi.yaml +++ b/dts/bindings/mspi/snps,designware-ssi.yaml @@ -47,3 +47,20 @@ properties: description: | Number of entries in the RX FIFO above which the controller gets an RX interrupt. Maximum value is the RX FIFO depth - 1. + + dma-transmit-data-level: + type: int + description: | + When in DMA mode, the transmit data level field controls the level at which a DMA request + is made by the transmit logic. A request to transmit is generated when the number of + valid data entries in the transmit FIFO is equal to or below this field value. Lower values + mean less frequent DMA triggers with larger bursts. Higher values mean fewer, smaller bursts + (lower latency, higher overhead). Range: 0-15 + + dma-receive-data-level: + type: int + description: | + When in DMA mode, the receive data level field controls the level at which a DMA request + is made by the receive logic. A request to receive is generated when the number of + valid data entries in the receive FIFO is greater than this value. Lower values mean + more frequent DMA triggers and higher values mean larger less frequent bursts. Range: 0-15 From 154a7104459d65e49d452f15c8037282d2933ef3 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 23 Oct 2025 18:18:03 +0100 Subject: [PATCH 0236/3334] [nrf fromtree] drivers: mspi_dw: Edit core disable to after PM init There is a scenario where a Bus fault occurs as the power management isn't initialised yet and the core is attempted to be turned off via the ssienr register. This commit edits this so the core register is written to after the initialisation of the power management. Signed-off-by: David Jewsbury (cherry picked from commit 4bf6a756280be4d90edf96f1a4c088c4620be41d) --- drivers/mspi/mspi_dw.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index d4700a99261a..b52e0533e3a9 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -1864,9 +1864,6 @@ static int dev_init(const struct device *dev) } } - /* Make sure controller is disabled. */ - write_ssienr(dev, 0); - #if defined(CONFIG_PINCTRL) if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { rc = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); @@ -1877,7 +1874,15 @@ static int dev_init(const struct device *dev) } #endif - return pm_device_driver_init(dev, dev_pm_action_cb); + rc = pm_device_driver_init(dev, dev_pm_action_cb); + if (rc < 0) { + return rc; + } + + /* Make sure controller is disabled. */ + write_ssienr(dev, 0); + + return 0; } static DEVICE_API(mspi, drv_api) = { From d6275556f4e341c6c2023a57eee2365b69b94c14 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 23 Oct 2025 18:44:10 +0100 Subject: [PATCH 0237/3334] [nrf fromtree] drivers: mspi_dw: Add CONFIG_MSPI_DW_DDR Dual data rate isn't always supported so this config enables/disables the relevant code in the driver. Signed-off-by: David Jewsbury (cherry picked from commit 55af2824dc9ab25100f625c24d84cdbc489ecef4) --- drivers/mspi/Kconfig.dw | 9 +++++++++ drivers/mspi/mspi_dw.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index 71302a801fdb..e967671e4723 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -11,6 +11,13 @@ config MSPI_DW if MSPI_DW +config MSPI_DW_DDR + bool "Dual Data-Rate (DDR) capabilities" + default y + help + Dual data rate is supported by some devices and requires specific + registers to be enabled in the IP. + config MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE bool "Handle FIFO in system workqueue" depends on MULTITHREADING @@ -23,6 +30,7 @@ config MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE config MSPI_DW_TXD_DIV int "Designware SSI TX Drive edge divisor" + depends on MSPI_DW_DDR default 4 help Division factor to apply to calculated BAUDR value when writing it @@ -31,6 +39,7 @@ config MSPI_DW_TXD_DIV config MSPI_DW_TXD_MUL int "Designware SSI TX Drive edge multiplier" + depends on MSPI_DW_DDR default 1 help Multiplication factor to apply to calculated BAUDR value when writing diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index b52e0533e3a9..4f6616a91749 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -937,6 +937,7 @@ static int _api_dev_config(const struct device *dev, switch (cfg->data_rate) { case MSPI_DATA_RATE_SINGLE: break; +#if defined(CONFIG_MSPI_DW_DDR) case MSPI_DATA_RATE_DUAL: dev_data->spi_ctrlr0 |= SPI_CTRLR0_INST_DDR_EN_BIT; /* Also need to set DDR_EN bit */ @@ -944,6 +945,7 @@ static int _api_dev_config(const struct device *dev, case MSPI_DATA_RATE_S_D_D: dev_data->spi_ctrlr0 |= SPI_CTRLR0_SPI_DDR_EN_BIT; break; +#endif default: LOG_ERR("Data rate %d not supported", cfg->data_rate); @@ -1238,6 +1240,7 @@ static int start_next_packet(const struct device *dev) write_spi_ctrlr0(dev, dev_data->spi_ctrlr0); write_baudr(dev, dev_data->baudr); write_rx_sample_dly(dev, dev_data->rx_sample_dly); +#if defined(CONFIG_MSPI_DW_DDR) if (dev_data->spi_ctrlr0 & (SPI_CTRLR0_SPI_DDR_EN_BIT | SPI_CTRLR0_INST_DDR_EN_BIT)) { int txd = (CONFIG_MSPI_DW_TXD_MUL * dev_data->baudr) / @@ -1247,6 +1250,7 @@ static int start_next_packet(const struct device *dev) } else { write_txd_drive_edge(dev, 0); } +#endif if (xip_enabled) { write_ssienr(dev, SSIENR_SSIC_EN_BIT); From f832194f291c63cdb4b512f54d6c6bebb76e658f Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 18 Sep 2025 16:35:03 +1000 Subject: [PATCH 0238/3334] [nrf fromtree] modem: at_shell: extract user pipe handling Extract the user pipe setup and claim/release logic so that it can be re-used by other software modules, if the AT shell is not used. Ideally the chat instance would live within the `modem_at_user_pipe.c` and be handed out by `modem_at_user_pipe_claim`, but the current chat API doesn't make this possible. Signed-off-by: Jordan Yates (cherry picked from commit c0a2928f46e962e05504981e7e4dacaca9be4114) --- doc/releases/migration-guide-4.3.rst | 5 ++ drivers/modem/CMakeLists.txt | 1 + drivers/modem/Kconfig.at_shell | 24 +++-- drivers/modem/modem_at_shell.c | 126 ++++----------------------- drivers/modem/modem_at_user_pipe.c | 124 ++++++++++++++++++++++++++ include/zephyr/modem/at/user_pipe.h | 37 ++++++++ 6 files changed, 200 insertions(+), 117 deletions(-) create mode 100644 drivers/modem/modem_at_user_pipe.c create mode 100644 include/zephyr/modem/at/user_pipe.h diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index 83dc5e771201..97e913c765ed 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -153,6 +153,11 @@ Networking .. zephyr-keep-sorted-stop +Modem +***** + +* ``CONFIG_MODEM_AT_SHELL_USER_PIPE`` has been renamed to :kconfig:option:`CONFIG_MODEM_AT_USER_PIPE`. + Display ******* diff --git a/drivers/modem/CMakeLists.txt b/drivers/modem/CMakeLists.txt index 62b84bd79294..adc6614dc7fe 100644 --- a/drivers/modem/CMakeLists.txt +++ b/drivers/modem/CMakeLists.txt @@ -36,4 +36,5 @@ if (CONFIG_MODEM_SIM7080) endif() zephyr_library_sources_ifdef(CONFIG_MODEM_CELLULAR modem_cellular.c) +zephyr_library_sources_ifdef(CONFIG_MODEM_AT_USER_PIPE modem_at_user_pipe.c) zephyr_library_sources_ifdef(CONFIG_MODEM_AT_SHELL modem_at_shell.c) diff --git a/drivers/modem/Kconfig.at_shell b/drivers/modem/Kconfig.at_shell index b2f6f42e3936..3d399e2338ce 100644 --- a/drivers/modem/Kconfig.at_shell +++ b/drivers/modem/Kconfig.at_shell @@ -1,22 +1,30 @@ # Copyright (c) 2024 Trackunit Corporation # SPDX-License-Identifier: Apache-2.0 -config MODEM_AT_SHELL - bool "AT command shell based on modem modules" - select MODEM_MODULES +config MODEM_AT_USER_PIPE + bool "Modem AT command user pipe helpers" + depends on $(dt_alias_enabled,modem) select MODEM_CHAT select MODEM_PIPE select MODEM_PIPELINK + help + Utility functions for managing access to user pipes + for arbitrary AT commands + +config MODEM_AT_USER_PIPE_IDX + int "User pipe number to use" + depends on MODEM_AT_USER_PIPE + default 0 + +config MODEM_AT_SHELL + bool "AT command shell based on modem modules" + select MODEM_MODULES + select MODEM_AT_USER_PIPE depends on !MODEM_SHELL depends on !SHELL_WILDCARD - depends on $(dt_alias_enabled,modem) if MODEM_AT_SHELL -config MODEM_AT_SHELL_USER_PIPE - int "User pipe number to use" - default 0 - config MODEM_AT_SHELL_RESPONSE_TIMEOUT_S int "Timeout waiting for response to AT command in seconds" default 5 diff --git a/drivers/modem/modem_at_shell.c b/drivers/modem/modem_at_shell.c index 5d2820d7483e..7d1930b6b04b 100644 --- a/drivers/modem/modem_at_shell.c +++ b/drivers/modem/modem_at_shell.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -13,17 +14,6 @@ #include LOG_MODULE_REGISTER(modem_at_shell, CONFIG_MODEM_LOG_LEVEL); -#define AT_SHELL_MODEM_NODE DT_ALIAS(modem) -#define AT_SHELL_PIPELINK_NAME _CONCAT(user_pipe_, CONFIG_MODEM_AT_SHELL_USER_PIPE) - -#define AT_SHELL_STATE_ATTACHED_BIT 0 -#define AT_SHELL_STATE_SCRIPT_RUNNING_BIT 1 - -MODEM_PIPELINK_DT_DECLARE(AT_SHELL_MODEM_NODE, AT_SHELL_PIPELINK_NAME); - -static struct modem_pipelink *at_shell_pipelink = - MODEM_PIPELINK_DT_GET(AT_SHELL_MODEM_NODE, AT_SHELL_PIPELINK_NAME); - static struct modem_chat at_shell_chat; static uint8_t at_shell_chat_receive_buf[CONFIG_MODEM_AT_SHELL_CHAT_RECEIVE_BUF_SIZE]; static uint8_t *at_shell_chat_argv_buf[2]; @@ -32,10 +22,6 @@ static struct modem_chat_script_chat at_shell_script_chat[1]; static struct modem_chat_match at_shell_script_chat_matches[2]; static uint8_t at_shell_match_buf[CONFIG_MODEM_AT_SHELL_RESPONSE_MAX_SIZE]; static const struct shell *at_shell_active_shell; -static struct k_work at_shell_open_pipe_work; -static struct k_work at_shell_attach_chat_work; -static struct k_work at_shell_release_chat_work; -static atomic_t at_shell_state; static void at_shell_print_any_match(struct modem_chat *chat, char **argv, uint16_t argc, void *user_data) @@ -74,7 +60,7 @@ static void at_shell_script_callback(struct modem_chat *chat, enum modem_chat_script_result result, void *user_data) { - atomic_clear_bit(&at_shell_state, AT_SHELL_STATE_SCRIPT_RUNNING_BIT); + modem_at_user_pipe_release(); } MODEM_CHAT_SCRIPT_DEFINE( @@ -85,83 +71,6 @@ MODEM_CHAT_SCRIPT_DEFINE( CONFIG_MODEM_AT_SHELL_RESPONSE_TIMEOUT_S ); -static void at_shell_pipe_callback(struct modem_pipe *pipe, - enum modem_pipe_event event, - void *user_data) -{ - ARG_UNUSED(user_data); - - switch (event) { - case MODEM_PIPE_EVENT_OPENED: - LOG_INF("pipe opened"); - k_work_submit(&at_shell_attach_chat_work); - break; - - default: - break; - } -} - -void at_shell_pipelink_callback(struct modem_pipelink *link, - enum modem_pipelink_event event, - void *user_data) -{ - ARG_UNUSED(user_data); - - switch (event) { - case MODEM_PIPELINK_EVENT_CONNECTED: - LOG_INF("pipe connected"); - k_work_submit(&at_shell_open_pipe_work); - break; - - case MODEM_PIPELINK_EVENT_DISCONNECTED: - LOG_INF("pipe disconnected"); - k_work_submit(&at_shell_release_chat_work); - break; - - default: - break; - } -} - -static void at_shell_open_pipe_handler(struct k_work *work) -{ - ARG_UNUSED(work); - - LOG_INF("opening pipe"); - - modem_pipe_attach(modem_pipelink_get_pipe(at_shell_pipelink), - at_shell_pipe_callback, - NULL); - - modem_pipe_open_async(modem_pipelink_get_pipe(at_shell_pipelink)); -} - -static void at_shell_attach_chat_handler(struct k_work *work) -{ - ARG_UNUSED(work); - - modem_chat_attach(&at_shell_chat, modem_pipelink_get_pipe(at_shell_pipelink)); - atomic_set_bit(&at_shell_state, AT_SHELL_STATE_ATTACHED_BIT); - LOG_INF("chat attached"); -} - -static void at_shell_release_chat_handler(struct k_work *work) -{ - ARG_UNUSED(work); - - modem_chat_release(&at_shell_chat); - atomic_clear_bit(&at_shell_state, AT_SHELL_STATE_ATTACHED_BIT); - LOG_INF("chat released"); -} - -static void at_shell_init_work(void) -{ - k_work_init(&at_shell_open_pipe_work, at_shell_open_pipe_handler); - k_work_init(&at_shell_attach_chat_work, at_shell_attach_chat_handler); - k_work_init(&at_shell_release_chat_work, at_shell_release_chat_handler); -} - static void at_shell_init_chat(void) { const struct modem_chat_config at_shell_chat_config = { @@ -204,17 +113,11 @@ static void at_shell_init_script_chat(void) CONFIG_MODEM_AT_SHELL_RESPONSE_TIMEOUT_S); } -static void at_shell_init_pipelink(void) -{ - modem_pipelink_attach(at_shell_pipelink, at_shell_pipelink_callback, NULL); -} - static int at_shell_init(void) { - at_shell_init_work(); at_shell_init_chat(); at_shell_init_script_chat(); - at_shell_init_pipelink(); + modem_at_user_pipe_init(&at_shell_chat); return 0; } @@ -228,14 +131,19 @@ static int at_shell_cmd_handler(const struct shell *sh, size_t argc, char **argv return -EINVAL; } - if (!atomic_test_bit(&at_shell_state, AT_SHELL_STATE_ATTACHED_BIT)) { - shell_error(sh, "modem is not ready"); - return -EPERM; - } - - if (atomic_test_and_set_bit(&at_shell_state, AT_SHELL_STATE_SCRIPT_RUNNING_BIT)) { - shell_error(sh, "script is already running"); - return -EBUSY; + ret = modem_at_user_pipe_claim(); + if (ret < 0) { + switch (ret) { + case -EPERM: + shell_error(sh, "modem is not ready"); + break; + case -EBUSY: + shell_error(sh, "script is already running"); + break; + default: + shell_error(sh, "unknown"); + } + return ret; } strncpy(at_shell_request_buf, argv[1], sizeof(at_shell_request_buf) - 1); @@ -260,7 +168,7 @@ static int at_shell_cmd_handler(const struct shell *sh, size_t argc, char **argv ret = modem_chat_run_script_async(&at_shell_chat, &at_shell_script); if (ret < 0) { shell_error(sh, "failed to start script"); - atomic_clear_bit(&at_shell_state, AT_SHELL_STATE_SCRIPT_RUNNING_BIT); + modem_at_user_pipe_release(); } return ret; diff --git a/drivers/modem/modem_at_user_pipe.c b/drivers/modem/modem_at_user_pipe.c new file mode 100644 index 000000000000..6fb0046f0fef --- /dev/null +++ b/drivers/modem/modem_at_user_pipe.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2025 Embeint Holdings Pty Ltd + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#define AT_UTIL_MODEM_NODE DT_ALIAS(modem) +#define AT_UTIL_PIPELINK_NAME _CONCAT(user_pipe_, CONFIG_MODEM_AT_USER_PIPE_IDX) + +#define AT_UTIL_STATE_ATTACHED_BIT 0 +#define AT_UTIL_STATE_SCRIPT_RUNNING_BIT 1 + +MODEM_PIPELINK_DT_DECLARE(AT_UTIL_MODEM_NODE, AT_UTIL_PIPELINK_NAME); + +static struct modem_pipelink *at_util_pipelink = + MODEM_PIPELINK_DT_GET(AT_UTIL_MODEM_NODE, AT_UTIL_PIPELINK_NAME); + +static struct k_work at_util_open_pipe_work; +static struct k_work at_util_attach_chat_work; +static struct k_work at_util_release_chat_work; +static struct modem_chat *at_util_chat; +static atomic_t at_util_state; + +LOG_MODULE_REGISTER(modem_at_user_pipe, CONFIG_MODEM_LOG_LEVEL); + +static void at_util_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_event event, + void *user_data) +{ + ARG_UNUSED(user_data); + + switch (event) { + case MODEM_PIPE_EVENT_OPENED: + LOG_INF("pipe opened"); + k_work_submit(&at_util_attach_chat_work); + break; + + default: + break; + } +} + +void at_util_pipelink_callback(struct modem_pipelink *link, enum modem_pipelink_event event, + void *user_data) +{ + ARG_UNUSED(user_data); + + switch (event) { + case MODEM_PIPELINK_EVENT_CONNECTED: + LOG_INF("pipe connected"); + k_work_submit(&at_util_open_pipe_work); + break; + + case MODEM_PIPELINK_EVENT_DISCONNECTED: + LOG_INF("pipe disconnected"); + k_work_submit(&at_util_release_chat_work); + break; + + default: + break; + } +} + +static void at_util_open_pipe_handler(struct k_work *work) +{ + ARG_UNUSED(work); + + LOG_INF("opening pipe"); + + modem_pipe_attach(modem_pipelink_get_pipe(at_util_pipelink), at_util_pipe_callback, NULL); + + modem_pipe_open_async(modem_pipelink_get_pipe(at_util_pipelink)); +} + +static void at_util_attach_chat_handler(struct k_work *work) +{ + ARG_UNUSED(work); + + modem_chat_attach(at_util_chat, modem_pipelink_get_pipe(at_util_pipelink)); + atomic_set_bit(&at_util_state, AT_UTIL_STATE_ATTACHED_BIT); + LOG_INF("chat attached"); +} + +static void at_util_release_chat_handler(struct k_work *work) +{ + ARG_UNUSED(work); + + modem_chat_release(at_util_chat); + atomic_clear_bit(&at_util_state, AT_UTIL_STATE_ATTACHED_BIT); + LOG_INF("chat released"); +} + +void modem_at_user_pipe_init(struct modem_chat *chat) +{ + at_util_chat = chat; + /* Initialise workers and setup callbacks */ + k_work_init(&at_util_open_pipe_work, at_util_open_pipe_handler); + k_work_init(&at_util_attach_chat_work, at_util_attach_chat_handler); + k_work_init(&at_util_release_chat_work, at_util_release_chat_handler); + modem_pipelink_attach(at_util_pipelink, at_util_pipelink_callback, NULL); +} + +int modem_at_user_pipe_claim(void) +{ + if (!atomic_test_bit(&at_util_state, AT_UTIL_STATE_ATTACHED_BIT)) { + return -EPERM; + } + + if (atomic_test_and_set_bit(&at_util_state, AT_UTIL_STATE_SCRIPT_RUNNING_BIT)) { + return -EBUSY; + } + + return 0; +} + +void modem_at_user_pipe_release(void) +{ + atomic_clear_bit(&at_util_state, AT_UTIL_STATE_SCRIPT_RUNNING_BIT); +} diff --git a/include/zephyr/modem/at/user_pipe.h b/include/zephyr/modem/at/user_pipe.h new file mode 100644 index 000000000000..9732f5131111 --- /dev/null +++ b/include/zephyr/modem/at/user_pipe.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Embeint Holdings Pty Ltd + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_MODEM_AT_USER_PIPE_ +#define ZEPHYR_MODEM_AT_USER_PIPE_ + +#include + +/** + * @brief Initialise the AT command user pipe + * + * @param chat Chat instance that will be used with the user pipe + */ +void modem_at_user_pipe_init(struct modem_chat *chat); + +/** + * @brief Claim the AT command user pipe to run commands + * + * + * @retval 0 On success + * @retval -EPERM Modem is not ready + * @retval -EBUSY User pipe already claimed + */ +int modem_at_user_pipe_claim(void); + +/** + * @brief Release the AT command user pipe to other users + * + * Must be called after @ref modem_at_user_pipe_claim when pipe is no longer + * in use. + */ +void modem_at_user_pipe_release(void); + +#endif /* ZEPHYR_MODEM_AT_USER_PIPE_ */ From 04e697e8f360f5ba1c1002ce2a05f7e29540238a Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Wed, 24 Sep 2025 16:49:54 +0300 Subject: [PATCH 0239/3334] [nrf fromtree] modem: modem_cellular: Allow PPP interface to wake up the device Allow PPP device to wake up the underlying cellular modem. Signed-off-by: Seppo Takalo (cherry picked from commit b8541c53eeafd1dc9dd17d05c09db39a20bb200a) --- drivers/modem/modem_cellular.c | 26 ++++++++++++------------- include/zephyr/modem/ppp.h | 35 ++++++++++++++++++++++++++++++---- subsys/modem/Kconfig | 1 + subsys/modem/modem_ppp.c | 17 +++++++++++++++-- 4 files changed, 60 insertions(+), 19 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 3e7b3a30eff1..23c4795a3549 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -2905,7 +2905,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &modem_cellular_api); #define MODEM_CELLULAR_DEVICE_QUECTEL_BG9X(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -2925,7 +2925,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &quectel_bg9x_shutdown_chat_script) #define MODEM_CELLULAR_DEVICE_QUECTEL_EG25_G(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -2944,7 +2944,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &quectel_eg25_g_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_QUECTEL_EG800Q(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -2963,7 +2963,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &quectel_eg800q_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SIMCOM_SIM7080(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -2982,7 +2982,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &simcom_sim7080_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SIMCOM_A76XX(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3002,7 +3002,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &simcom_a76xx_shutdown_chat_script) #define MODEM_CELLULAR_DEVICE_U_BLOX_SARA_R4(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3021,7 +3021,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &u_blox_sara_r4_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_U_BLOX_SARA_R5(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3040,7 +3040,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &u_blox_sara_r5_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_U_BLOX_LARA_R6(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3060,7 +3060,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SWIR_HL7800(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3079,7 +3079,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &swir_hl7800_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_TELIT_ME910G1(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3098,7 +3098,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_TELIT_ME310G1(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3117,7 +3117,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &telit_me310g1_shutdown_chat_script) #define MODEM_CELLULAR_DEVICE_NORDIC_NRF91_SLM(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 1500); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 1500); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r\n", \ @@ -3134,7 +3134,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &nordic_nrf91_slm_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SQN_GM02S(inst) \ - MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ diff --git a/include/zephyr/modem/ppp.h b/include/zephyr/modem/ppp.h index 2b91e51a35c9..b3dbcfdeb7fb 100644 --- a/include/zephyr/modem/ppp.h +++ b/include/zephyr/modem/ppp.h @@ -123,6 +123,10 @@ struct modem_ppp { #endif }; +struct modem_ppp_config { + const struct device *dev; +}; + /** * @endcond */ @@ -172,13 +176,17 @@ int modem_ppp_init_internal(const struct device *dev); * network device instance, and binds the modem_ppp instance to the PPP L2 * instance. * + * If underlying cellular device is given, the PPP interface will manage the + * power state of the cellular device when starting and stopping the PPP. + * + * @param _dev Cellular device instance for power management or NULL if not used * @param _name Name of the statically defined modem_ppp instance * @param _init_iface Hook for the PPP L2 network interface init function * @param _prio Initialization priority of the PPP L2 net iface * @param _mtu Max size of net_pkt data sent and received on PPP L2 net iface * @param _buf_size Size of partial PPP frame transmit and receive buffers */ -#define MODEM_PPP_DEFINE(_name, _init_iface, _prio, _mtu, _buf_size) \ +#define MODEM_DEV_PPP_DEFINE(_dev, _name, _init_iface, _prio, _mtu, _buf_size) \ extern const struct ppp_api modem_ppp_ppp_api; \ \ static uint8_t _CONCAT(_name, _receive_buf)[_buf_size]; \ @@ -189,11 +197,30 @@ int modem_ppp_init_internal(const struct device *dev); .receive_buf = _CONCAT(_name, _receive_buf), \ .transmit_buf = _CONCAT(_name, _transmit_buf), \ .buf_size = _buf_size, \ + }; \ + static const struct modem_ppp_config _CONCAT(_name, _config) = { \ + .dev = _dev, \ }; \ \ - NET_DEVICE_INIT(_CONCAT(ppp_net_dev_, _name), "modem_ppp_" # _name, \ - modem_ppp_init_internal, NULL, &_name, NULL, _prio, &modem_ppp_ppp_api, \ - PPP_L2, NET_L2_GET_CTX_TYPE(PPP_L2), _mtu) + NET_DEVICE_INIT(_CONCAT(ppp_net_dev_, _name), "modem_ppp_" #_name, \ + modem_ppp_init_internal, NULL, &_name, &_CONCAT(_name, _config), _prio, \ + &modem_ppp_ppp_api, PPP_L2, NET_L2_GET_CTX_TYPE(PPP_L2), _mtu) + +/** + * @brief Define a modem PPP module for cellular device tree instance. + * + * @see MODEM_DEV_PPP_DEFINE + */ +#define MODEM_DT_INST_PPP_DEFINE(inst, _name, _init_iface, _prio, _mtu, _buf_size) \ + MODEM_DEV_PPP_DEFINE(DEVICE_DT_INST_GET(inst), _name, _init_iface, _prio, _mtu, _buf_size) + +/** + * @brief Define a modem PPP module without a device and bind it to a network interface. + * + * @see MODEM_DEV_PPP_DEFINE + */ +#define MODEM_PPP_DEFINE(_name, _init_iface, _prio, _mtu, _buf_size) \ + MODEM_DEV_PPP_DEFINE(NULL, _name, _init_iface, _prio, _mtu, _buf_size) /** * @} diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index b7c3f7ba9014..087b4d79be8c 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -71,6 +71,7 @@ config MODEM_PPP select MODEM_PIPE select RING_BUFFER select CRC + select PM_DEVICE_RUNTIME_ASYNC if PM_DEVICE_RUNTIME if MODEM_PPP diff --git a/subsys/modem/modem_ppp.c b/subsys/modem/modem_ppp.c index 537f198251f7..9e2e2b5d71b7 100644 --- a/subsys/modem/modem_ppp.c +++ b/subsys/modem/modem_ppp.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -445,12 +446,24 @@ static void modem_ppp_ppp_api_init(struct net_if *iface) static int modem_ppp_ppp_api_start(const struct device *dev) { - return 0; + const struct modem_ppp_config *config = (const struct modem_ppp_config *)dev->config; + + if (config == NULL || config->dev == NULL) { + return 0; + } + + return pm_device_runtime_get(config->dev); } static int modem_ppp_ppp_api_stop(const struct device *dev) { - return 0; + const struct modem_ppp_config *config = (const struct modem_ppp_config *)dev->config; + + if (config == NULL || config->dev == NULL) { + return 0; + } + + return pm_device_runtime_put_async(config->dev, K_NO_WAIT); } static int modem_ppp_ppp_api_send(const struct device *dev, struct net_pkt *pkt) From b39cff87dd671d34f69e4dda75324aed791362e8 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 26 Aug 2025 15:23:51 +0300 Subject: [PATCH 0240/3334] [nrf fromtree] modem: cmux: Clean debugging a bit Full CMUX frames are way too much to fill the debug log so disable those by default. Sometimes it is enough to see the CMD and response types, without hexdump. Added also debug messages for opening and closing events. Signed-off-by: Seppo Takalo (cherry picked from commit dac7a0fe06b4e4e3c53c9a19163699d6f5455001) --- subsys/modem/Kconfig | 6 ++++++ subsys/modem/modem_cmux.c | 23 ++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index 087b4d79be8c..9f6ce441b7d5 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -55,6 +55,12 @@ module = MODEM_CMUX module-str = modem_cmux source "subsys/logging/Kconfig.template.log_config" +config MODEM_CMUX_LOG_FRAMES + bool "Log CMUX frames" + depends on MODEM_CMUX_LOG_LEVEL_DBG + help + Enable logging of CMUX frames. This can produce a lot of log data. + endif config MODEM_PIPE diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index d5547e03da28..3e7a001c82ca 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -101,6 +101,7 @@ static struct modem_cmux_command *modem_cmux_command_wrap(const uint8_t *data) return (struct modem_cmux_command *)data; } +#if CONFIG_MODEM_CMUX_LOG_FRAMES static const char *modem_cmux_frame_type_to_str(enum modem_cmux_frame_types frame_type) { switch (frame_type) { @@ -131,8 +132,14 @@ static void modem_cmux_log_frame(const struct modem_cmux_frame *frame, { LOG_DBG("%s ch:%u cr:%u pf:%u type:%s dlen:%u", action, frame->dlci_address, frame->cr, frame->pf, modem_cmux_frame_type_to_str(frame->type), frame->data_len); - LOG_HEXDUMP_DBG(frame->data, hexdump_len, "data:"); + if (hexdump_len > 0) { + LOG_HEXDUMP_DBG(frame->data, hexdump_len, "data:"); + } } +#else +#define modem_cmux_log_frame(frame, action, hexdump_len) \ + do { ARG_UNUSED(frame); ARG_UNUSED(action); ARG_UNUSED(hexdump_len); } while (0) +#endif /* CONFIG_MODEM_CMUX_LOG_FRAMES */ static void modem_cmux_log_transmit_frame(const struct modem_cmux_frame *frame) { @@ -225,14 +232,12 @@ static void modem_cmux_log_transmit_command(const struct modem_cmux_command *com { LOG_DBG("ea:%u,cr:%u,type:%s", command->type.ea, command->type.cr, modem_cmux_command_type_to_str(command->type.value)); - LOG_HEXDUMP_DBG(command->value, command->length.value, "data:"); } static void modem_cmux_log_received_command(const struct modem_cmux_command *command) { LOG_DBG("ea:%u,cr:%u,type:%s", command->type.ea, command->type.cr, modem_cmux_command_type_to_str(command->type.value)); - LOG_HEXDUMP_DBG(command->value, command->length.value, "data:"); } static void modem_cmux_raise_event(struct modem_cmux *cmux, enum modem_cmux_event event) @@ -438,6 +443,7 @@ static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux k_work_cancel_delayable(&cmux->disconnect_work); } + LOG_DBG("CMUX disconnected"); cmux->state = MODEM_CMUX_STATE_DISCONNECTED; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = false; @@ -455,6 +461,7 @@ static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) return; } + LOG_DBG("CMUX connected"); cmux->state = MODEM_CMUX_STATE_CONNECTED; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; @@ -534,6 +541,7 @@ static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) return; } + LOG_DBG("CMUX connection request received"); cmux->state = MODEM_CMUX_STATE_CONNECTED; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; @@ -561,7 +569,7 @@ static void modem_cmux_on_control_frame(struct modem_cmux *cmux) break; default: - LOG_WRN("Unknown %s frame type", "control"); + LOG_WRN("Unknown %s frame type %d", "control", cmux->frame.type); break; } } @@ -586,6 +594,7 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) { switch (dlci->state) { case MODEM_CMUX_DLCI_STATE_OPENING: + LOG_DBG("DLCI %u opened", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_OPEN; modem_pipe_notify_opened(&dlci->pipe); k_work_cancel_delayable(&dlci->open_work); @@ -595,6 +604,7 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) break; case MODEM_CMUX_DLCI_STATE_CLOSING: + LOG_DBG("DLCI %u closed", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_CLOSED; modem_pipe_notify_closed(&dlci->pipe); k_work_cancel_delayable(&dlci->close_work); @@ -637,6 +647,7 @@ static void modem_cmux_on_dlci_frame_sabm(struct modem_cmux_dlci *dlci) return; } + LOG_DBG("DLCI %u SABM request accepted, DLCI opened", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_OPEN; modem_pipe_notify_opened(&dlci->pipe); k_mutex_lock(&dlci->receive_rb_lock, K_FOREVER); @@ -655,6 +666,7 @@ static void modem_cmux_on_dlci_frame_disc(struct modem_cmux_dlci *dlci) return; } + LOG_DBG("DLCI %u disconnected", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_CLOSED; modem_pipe_notify_closed(&dlci->pipe); } @@ -690,7 +702,8 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) break; default: - LOG_WRN("Unknown %s frame type", "DLCI"); + LOG_WRN("Unknown %s frame type (%d, DLCI %d)", "DLCI", cmux->frame.type, + cmux->frame.dlci_address); break; } } From 15780164878ef21037e604353379280b31c72732 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Thu, 28 Aug 2025 16:15:46 +0300 Subject: [PATCH 0241/3334] [nrf fromtree] modem: cmux: Rework the drop handling Do not read extra byte when we decide to drop a frame. Instead go directly to MODEM_CMUX_RECEIVE_STATE_SOF, so the next flag character will start a new frame. Signed-off-by: Seppo Takalo (cherry picked from commit 0025751414ef69e906d445be7269fe0ed544173e) --- include/zephyr/modem/cmux.h | 1 - subsys/modem/modem_cmux.c | 26 +++++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 3332c40bd18e..10fe93132819 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -74,7 +74,6 @@ enum modem_cmux_receive_state { MODEM_CMUX_RECEIVE_STATE_LENGTH_CONT, MODEM_CMUX_RECEIVE_STATE_DATA, MODEM_CMUX_RECEIVE_STATE_FCS, - MODEM_CMUX_RECEIVE_STATE_DROP, MODEM_CMUX_RECEIVE_STATE_EOF, }; diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 3e7a001c82ca..563f6a0baed6 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -13,6 +13,7 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #include +#define MODEM_CMUX_SOF (0xF9) #define MODEM_CMUX_FCS_POLYNOMIAL (0xE0) #define MODEM_CMUX_FCS_INIT_VALUE (0xFF) #define MODEM_CMUX_EA (0x01) @@ -282,7 +283,7 @@ static uint16_t modem_cmux_transmit_frame(struct modem_cmux *cmux, data_len = MIN(data_len, CONFIG_MODEM_CMUX_MTU); /* SOF */ - buf[0] = 0xF9; + buf[0] = MODEM_CMUX_SOF; /* DLCI Address (Max 63) */ buf[1] = 0x01 | (frame->cr << 1) | (frame->dlci_address << 2); @@ -318,7 +319,7 @@ static uint16_t modem_cmux_transmit_frame(struct modem_cmux *cmux, /* FCS and EOF will be put on the same call */ buf[0] = fcs; - buf[1] = 0xF9; + buf[1] = MODEM_CMUX_SOF; ring_buf_put(&cmux->transmit_rb, buf, 2); k_work_schedule(&cmux->transmit_work, K_NO_WAIT); return data_len; @@ -744,7 +745,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by switch (cmux->receive_state) { case MODEM_CMUX_RECEIVE_STATE_SOF: - if (byte == 0xF9) { + if (byte == MODEM_CMUX_SOF) { cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_RESYNC; break; } @@ -756,7 +757,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by * Allow any number of consecutive flags (0xF9). * 0xF9 could also be a valid address field for DLCI 62. */ - if (byte == 0xF9) { + if (byte == MODEM_CMUX_SOF) { break; } @@ -813,7 +814,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by if (cmux->frame.data_len > CONFIG_MODEM_CMUX_MTU) { LOG_ERR("Too large frame"); - cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; + modem_cmux_drop_frame(cmux); break; } @@ -838,7 +839,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by if (cmux->frame.data_len > CONFIG_MODEM_CMUX_MTU) { LOG_ERR("Too large frame"); - cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; + modem_cmux_drop_frame(cmux); break; } @@ -846,7 +847,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by LOG_ERR("Indicated frame data length %u exceeds receive buffer size %u", cmux->frame.data_len, cmux->receive_buf_size); - cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; + modem_cmux_drop_frame(cmux); break; } @@ -873,7 +874,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by if (cmux->receive_buf_len > cmux->receive_buf_size) { LOG_WRN("Receive buffer overrun (%u > %u)", cmux->receive_buf_len, cmux->receive_buf_size); - cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; + modem_cmux_drop_frame(cmux); break; } @@ -890,21 +891,16 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by if (fcs != byte) { LOG_WRN("Frame FCS error"); - /* Drop frame */ - cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; + modem_cmux_drop_frame(cmux); break; } cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_EOF; break; - case MODEM_CMUX_RECEIVE_STATE_DROP: - modem_cmux_drop_frame(cmux); - break; - case MODEM_CMUX_RECEIVE_STATE_EOF: /* Validate byte is EOF */ - if (byte != 0xF9) { + if (byte != MODEM_CMUX_SOF) { /* Unexpected byte */ modem_cmux_drop_frame(cmux); break; From 88c99a5a16c5230acfda3cc460c77f2e92bc787d Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 2 Oct 2025 14:52:25 +1000 Subject: [PATCH 0242/3334] [nrf fromtree] modem: cmux: auto calculate work buffer sizes Automatically size the CMUX work buffers based on `CONFIG_MODEM_CMUX_MTU`. This eliminates a Kconfig variable that would otherwise need to manually be kept in sync. The option to extend the size of these buffers is still provided through `CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA`. Signed-off-by: Jordan Yates (cherry picked from commit f047a412e068ffb403a464e24f47509e057acdae) --- doc/releases/migration-guide-4.3.rst | 2 ++ drivers/modem/modem_cellular.c | 8 ++++---- include/zephyr/modem/cmux.h | 6 +++++- subsys/modem/Kconfig | 12 +++++------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index 97e913c765ed..a3aec0898c8e 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -157,6 +157,8 @@ Modem ***** * ``CONFIG_MODEM_AT_SHELL_USER_PIPE`` has been renamed to :kconfig:option:`CONFIG_MODEM_AT_USER_PIPE`. +* ``CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE`` has been updated to :kconfig:option:`CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA`, + which only takes the number of extra bytes desired over the default of (:kconfig:option:`CONFIG_MODEM_CMUX_MTU` + 7). Display ******* diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 23c4795a3549..277ae390fae4 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -110,8 +110,8 @@ struct modem_cellular_data { /* CMUX */ struct modem_cmux cmux; - uint8_t cmux_receive_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; - uint8_t cmux_transmit_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t cmux_receive_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t cmux_transmit_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; struct modem_cmux_dlci dlci1; struct modem_cmux_dlci dlci2; @@ -119,9 +119,9 @@ struct modem_cellular_data { struct modem_pipe *dlci2_pipe; /* Points to dlci2_pipe or NULL. Used for shutdown script if not NULL */ struct modem_pipe *cmd_pipe; - uint8_t dlci1_receive_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t dlci1_receive_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; /* DLCI 2 is only used for chat scripts. */ - uint8_t dlci2_receive_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t dlci2_receive_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; /* Modem chat */ struct modem_chat chat; diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 10fe93132819..913f4187d729 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -57,6 +57,10 @@ typedef void (*modem_cmux_callback)(struct modem_cmux *cmux, enum modem_cmux_eve * @cond INTERNAL_HIDDEN */ +/* Total size of the CMUX work buffers */ +#define MODEM_CMUX_WORK_BUFFER_SIZE (CONFIG_MODEM_CMUX_MTU + 7 + \ + CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA) + enum modem_cmux_state { MODEM_CMUX_STATE_DISCONNECTED = 0, MODEM_CMUX_STATE_CONNECTING, @@ -152,7 +156,7 @@ struct modem_cmux { uint16_t receive_buf_size; uint16_t receive_buf_len; - uint8_t work_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t work_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; /* Transmit buffer */ struct ring_buf transmit_rb; diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index 9f6ce441b7d5..34114cd3893b 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -42,14 +42,12 @@ config MODEM_CMUX_MTU Maximum Transmission Unit (MTU) size for the CMUX module. Linux ldattach defaults to 127 bytes, 3GPP TS 27.010 to 31. -config MODEM_CMUX_WORK_BUFFER_SIZE - int "CMUX module work buffer size in bytes" - range 23 1507 - default 134 if MODEM_CMUX_DEFAULT_MTU_127 - default 38 +config MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA + int "CMUX module extra work buffer size in bytes" + default 0 help - Size of the work buffer used by the CMUX module. - Recommended size is MODEM_CMUX_MTU + 7 (CMUX header size). + Extra bytes to add to the work buffers used by the CMUX module. + The default size of these buffers is MODEM_CMUX_MTU + 7 (CMUX header size). module = MODEM_CMUX module-str = modem_cmux From 46ef539f59552451ccee09572753d9653ed7ae4c Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Wed, 24 Sep 2025 16:44:18 +0300 Subject: [PATCH 0243/3334] [nrf fromtree] drivers: modem: cellular: nRF91: Remove periodic chat script Remove periodic chat script as the AT+CEREG=1 notifications are already enabled. Signed-off-by: Seppo Takalo (cherry picked from commit 5fa605af172a18985d7d9ab6636d9c9db45b2a7c) --- drivers/modem/modem_cellular.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 277ae390fae4..c0cc43a5dafa 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -2773,12 +2773,8 @@ MODEM_CHAT_SCRIPT_CMDS_DEFINE(nordic_nrf91_slm_dial_chat_script_cmds, MODEM_CHAT_SCRIPT_DEFINE(nordic_nrf91_slm_dial_chat_script, nordic_nrf91_slm_dial_chat_script_cmds, dial_abort_matches, modem_cellular_chat_callback_handler, 10); -MODEM_CHAT_SCRIPT_CMDS_DEFINE(nordic_nrf91_slm_periodic_chat_script_cmds, - MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG?", ok_match)); +MODEM_CHAT_SCRIPT_EMPTY_DEFINE(nordic_nrf91_slm_periodic_chat_script); -MODEM_CHAT_SCRIPT_DEFINE(nordic_nrf91_slm_periodic_chat_script, - nordic_nrf91_slm_periodic_chat_script_cmds, abort_matches, - modem_cellular_chat_callback_handler, 4); #endif #if DT_HAS_COMPAT_STATUS_OKAY(sqn_gm02s) @@ -3131,7 +3127,8 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, NULL, \ &nordic_nrf91_slm_init_chat_script, \ &nordic_nrf91_slm_dial_chat_script, \ - &nordic_nrf91_slm_periodic_chat_script, NULL) + &nordic_nrf91_slm_periodic_chat_script, \ + NULL) #define MODEM_CELLULAR_DEVICE_SQN_GM02S(inst) \ MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ From f89762bf8f09e117ff7eb842504a4f83cdb6530a Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 26 Aug 2025 16:31:46 +0300 Subject: [PATCH 0244/3334] [nrf fromtree] modem: cmux: Implement DM and NSC responses Implement following responses from 3GPP TS 27.010: 5.4.6.3.8 Non Supported Command Response (NSC) 5.3.3 Disconnected Mode (DM) response Close DLC when receiving DM response. Signed-off-by: Seppo Takalo (cherry picked from commit 9de7d617096c7518ae085bb3af384aae42847fae) --- subsys/modem/modem_cmux.c | 79 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 6 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 563f6a0baed6..93665525ac7b 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -336,6 +336,7 @@ static bool modem_cmux_transmit_cmd_frame(struct modem_cmux *cmux, if (space < MODEM_CMUX_CMD_FRAME_SIZE_MAX) { k_mutex_unlock(&cmux->transmit_rb_lock); + LOG_WRN("CMD buffer overflow"); return false; } @@ -473,6 +474,41 @@ static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) k_event_post(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); } +static void modem_cmux_respond_unsupported_cmd(struct modem_cmux *cmux) +{ + struct modem_cmux_frame frame = cmux->frame; + struct modem_cmux_command *cmd; + + if (modem_cmux_wrap_command(&cmd, frame.data, frame.data_len) < 0) { + LOG_WRN("Invalid command"); + return; + } + + struct { + /* 3GPP TS 27.010: 5.4.6.3.8 Non Supported Command Response (NSC) */ + struct modem_cmux_command nsc; + struct modem_cmux_command_type value; + } nsc_cmd = { + .nsc = { + .type = { + .ea = 1, + .cr = 0, + .value = MODEM_CMUX_COMMAND_NSC, + }, + .length = { + .ea = 1, + .value = 1, + }, + }, + .value = cmd->type, + }; + + frame.data = (uint8_t *)&nsc_cmd; + frame.data_len = sizeof(nsc_cmd); + + modem_cmux_transmit_cmd_frame(cmux, &frame); +} + static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) { struct modem_cmux_command *command; @@ -509,6 +545,7 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) default: LOG_DBG("Unknown control command"); + modem_cmux_respond_unsupported_cmd(cmux); break; } } @@ -532,6 +569,26 @@ static void modem_cmux_connect_response_transmit(struct modem_cmux *cmux) modem_cmux_transmit_cmd_frame(cmux, &frame); } +static void modem_cmux_dm_response_transmit(struct modem_cmux *cmux) +{ + if (cmux == NULL) { + return; + } + + /* 3GPP TS 27.010: 5.3.3 Disconnected Mode (DM) response */ + struct modem_cmux_frame frame = { + .dlci_address = cmux->frame.dlci_address, + .cr = cmux->frame.cr, + .pf = 1, + .type = MODEM_CMUX_FRAME_TYPE_DM, + .data = NULL, + .data_len = 0, + }; + + LOG_DBG("Send DM response"); + modem_cmux_transmit_cmd_frame(cmux, &frame); +} + static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) { modem_cmux_connect_response_transmit(cmux); @@ -591,6 +648,13 @@ static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux) return NULL; } +static void modem_cmux_on_dlci_frame_dm(struct modem_cmux_dlci *dlci) +{ + dlci->state = MODEM_CMUX_DLCI_STATE_CLOSED; + modem_pipe_notify_closed(&dlci->pipe); + k_work_cancel_delayable(&dlci->close_work); +} + static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) { switch (dlci->state) { @@ -606,9 +670,7 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) case MODEM_CMUX_DLCI_STATE_CLOSING: LOG_DBG("DLCI %u closed", dlci->dlci_address); - dlci->state = MODEM_CMUX_DLCI_STATE_CLOSED; - modem_pipe_notify_closed(&dlci->pipe); - k_work_cancel_delayable(&dlci->close_work); + modem_cmux_on_dlci_frame_dm(dlci); break; default: @@ -617,6 +679,8 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) } } + + static void modem_cmux_on_dlci_frame_uih(struct modem_cmux_dlci *dlci) { struct modem_cmux *cmux = dlci->cmux; @@ -663,7 +727,7 @@ static void modem_cmux_on_dlci_frame_disc(struct modem_cmux_dlci *dlci) modem_cmux_connect_response_transmit(cmux); if (dlci->state != MODEM_CMUX_DLCI_STATE_OPEN) { - LOG_DBG("Unexpected Disc frame"); + modem_cmux_dm_response_transmit(cmux); return; } @@ -680,8 +744,9 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) dlci = modem_cmux_find_dlci(cmux); if (dlci == NULL) { - LOG_WRN("Ignoring frame intended for unconfigured DLCI %u.", + LOG_WRN("Frame intended for unconfigured DLCI %u.", cmux->frame.dlci_address); + modem_cmux_dm_response_transmit(cmux); return; } @@ -701,7 +766,9 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) case MODEM_CMUX_FRAME_TYPE_DISC: modem_cmux_on_dlci_frame_disc(dlci); break; - + case MODEM_CMUX_FRAME_TYPE_DM: + modem_cmux_on_dlci_frame_dm(dlci); + break; default: LOG_WRN("Unknown %s frame type (%d, DLCI %d)", "DLCI", cmux->frame.type, cmux->frame.dlci_address); From bdb2bd440ee95ff45ae6fd98147de3032eacb516 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Fri, 10 Oct 2025 10:35:12 +0300 Subject: [PATCH 0245/3334] [nrf fromtree] modem: cmux: Define macros for header size Define CMUX_HEADER_SIZE macro that is 6 or 7 bytes depending on MTU. Remove the previous CMUX_FRAME_SIZE_MAX that was a bit misleading as it meant only the header size without data and was fixed to 7 bytes. Redefine new macros CMUX_FRAME_SIZE_MAX and CMUX_FRAME_SIZE_MIN which are actually frame sizes with data included. Signed-off-by: Seppo Takalo (cherry picked from commit 9d93594de99fa921086e32ad04041af1b328e873) --- include/zephyr/modem/cmux.h | 9 ++++++++- subsys/modem/modem_cmux.c | 28 +++++++++++++++------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 913f4187d729..fd9481fee035 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -57,8 +57,15 @@ typedef void (*modem_cmux_callback)(struct modem_cmux *cmux, enum modem_cmux_eve * @cond INTERNAL_HIDDEN */ +#if CONFIG_MODEM_CMUX_MTU > 127 +#define MODEM_CMUX_HEADER_SIZE 7 +#else +#define MODEM_CMUX_HEADER_SIZE 6 +#endif + + /* Total size of the CMUX work buffers */ -#define MODEM_CMUX_WORK_BUFFER_SIZE (CONFIG_MODEM_CMUX_MTU + 7 + \ +#define MODEM_CMUX_WORK_BUFFER_SIZE (CONFIG_MODEM_CMUX_MTU + MODEM_CMUX_HEADER_SIZE + \ CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA) enum modem_cmux_state { diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 93665525ac7b..fb0f14a84807 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -19,14 +19,18 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #define MODEM_CMUX_EA (0x01) #define MODEM_CMUX_CR (0x02) #define MODEM_CMUX_PF (0x10) -#define MODEM_CMUX_FRAME_SIZE_MAX (0x07) -#define MODEM_CMUX_DATA_SIZE_MIN (0x08) -#define MODEM_CMUX_DATA_FRAME_SIZE_MIN (MODEM_CMUX_FRAME_SIZE_MAX + \ - MODEM_CMUX_DATA_SIZE_MIN) +#define MODEM_CMUX_DATA_SIZE_MIN 8 +#define MODEM_CMUX_DATA_FRAME_SIZE_MIN (MODEM_CMUX_HEADER_SIZE + MODEM_CMUX_DATA_SIZE_MIN) +#define MODEM_CMUX_DATA_FRAME_SIZE_MAX (MODEM_CMUX_HEADER_SIZE + CONFIG_MODEM_CMUX_MTU) -#define MODEM_CMUX_CMD_DATA_SIZE_MAX (0x08) -#define MODEM_CMUX_CMD_FRAME_SIZE_MAX (MODEM_CMUX_FRAME_SIZE_MAX + \ - MODEM_CMUX_CMD_DATA_SIZE_MAX) +/* Biggest supported Multiplexer control commands in UIH frame + * Modem Status Command (MSC) - 5 bytes when Break is included. + * + * PN would be 10 bytes, but that is not implemented + */ +#define MODEM_CMUX_CMD_DATA_SIZE_MAX 5 +#define MODEM_CMUX_CMD_FRAME_SIZE_MAX (MODEM_CMUX_HEADER_SIZE + \ + MODEM_CMUX_CMD_DATA_SIZE_MAX) #define MODEM_CMUX_T1_TIMEOUT (K_MSEC(330)) #define MODEM_CMUX_T2_TIMEOUT (K_MSEC(660)) @@ -272,13 +276,13 @@ static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_eve static uint16_t modem_cmux_transmit_frame(struct modem_cmux *cmux, const struct modem_cmux_frame *frame) { - uint8_t buf[MODEM_CMUX_FRAME_SIZE_MAX]; + uint8_t buf[MODEM_CMUX_HEADER_SIZE]; uint8_t fcs; uint16_t space; uint16_t data_len; uint16_t buf_idx; - space = ring_buf_space_get(&cmux->transmit_rb) - MODEM_CMUX_FRAME_SIZE_MAX; + space = ring_buf_space_get(&cmux->transmit_rb) - MODEM_CMUX_HEADER_SIZE; data_len = MIN(space, frame->data_len); data_len = MIN(data_len, CONFIG_MODEM_CMUX_MTU); @@ -1328,11 +1332,9 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co __ASSERT_NO_MSG(cmux != NULL); __ASSERT_NO_MSG(config != NULL); __ASSERT_NO_MSG(config->receive_buf != NULL); - __ASSERT_NO_MSG(config->receive_buf_size >= - (CONFIG_MODEM_CMUX_MTU + MODEM_CMUX_FRAME_SIZE_MAX)); + __ASSERT_NO_MSG(config->receive_buf_size >= MODEM_CMUX_DATA_FRAME_SIZE_MAX); __ASSERT_NO_MSG(config->transmit_buf != NULL); - __ASSERT_NO_MSG(config->transmit_buf_size >= - (CONFIG_MODEM_CMUX_MTU + MODEM_CMUX_FRAME_SIZE_MAX)); + __ASSERT_NO_MSG(config->transmit_buf_size >= MODEM_CMUX_DATA_FRAME_SIZE_MAX); memset(cmux, 0x00, sizeof(*cmux)); cmux->callback = config->callback; From b8ee41bc8d646d3d05135a15b690cca8e15e6981 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 26 Aug 2025 09:45:31 +0300 Subject: [PATCH 0246/3334] [nrf fromtree] modem: cmux: Handle C/R bit from address field The C/R bit in the address field should be handled as explained in 5.2.1.2 in the spec (3GPP TS 127.010). To detect if the frame is a command or a response, we need to know who was the initiator of the CMUX channel. > Initiator is the station that take the initiative to initialize > the multiplexer (i.e. sends the SABM command at DLCI 0 ) See the table from given section of the specification. Also, on UIH frames 5.4.3.1 says > The frames sent by the initiating station have the C/R bit set to 1 > and those sent by the responding station have the C/R bit set to 0. NOTE: This is different than a C/R bit in the Type field. Signed-off-by: Seppo Takalo (cherry picked from commit b1942ced1a9a94b52c0cd241943972b058d2c5d0) --- include/zephyr/modem/cmux.h | 5 ++-- subsys/modem/modem_cmux.c | 32 ++++++++++++++++++------ tests/subsys/modem/modem_cmux/src/main.c | 18 +++++++++++++ 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index fd9481fee035..17b63bdf66af 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -149,10 +149,11 @@ struct modem_cmux { /* State */ enum modem_cmux_state state; - bool flow_control_on; + bool flow_control_on : 1; + bool initiator : 1; /* Work lock */ - bool attached; + bool attached : 1; struct k_spinlock work_lock; /* Receive state*/ diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index fb0f14a84807..f304985717ac 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -463,12 +463,13 @@ static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) { if (cmux->state != MODEM_CMUX_STATE_CONNECTING) { - LOG_DBG("Unexpected UA frame"); + LOG_DBG("Unexpected UA frame in state %d", cmux->state); return; } LOG_DBG("CMUX connected"); cmux->state = MODEM_CMUX_STATE_CONNECTED; + cmux->initiator = true; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); @@ -595,8 +596,6 @@ static void modem_cmux_dm_response_transmit(struct modem_cmux *cmux) static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) { - modem_cmux_connect_response_transmit(cmux); - if ((cmux->state == MODEM_CMUX_STATE_CONNECTED) || (cmux->state == MODEM_CMUX_STATE_DISCONNECTING)) { LOG_DBG("Connect request not accepted"); @@ -604,7 +603,9 @@ static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) } LOG_DBG("CMUX connection request received"); + cmux->initiator = false; cmux->state = MODEM_CMUX_STATE_CONNECTED; + modem_cmux_connect_response_transmit(cmux); k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); @@ -617,6 +618,11 @@ static void modem_cmux_on_control_frame(struct modem_cmux *cmux) { modem_cmux_log_received_frame(&cmux->frame); + if (cmux->state == MODEM_CMUX_STATE_CONNECTED && cmux->frame.cr == cmux->initiator) { + LOG_DBG("Received a response frame, dropping"); + return; + } + switch (cmux->frame.type) { case MODEM_CMUX_FRAME_TYPE_UA: modem_cmux_on_control_frame_ua(cmux); @@ -661,6 +667,12 @@ static void modem_cmux_on_dlci_frame_dm(struct modem_cmux_dlci *dlci) static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) { + /* Drop invalid UA frames */ + if (dlci->cmux->frame.cr != dlci->cmux->initiator) { + LOG_DBG("Received a response frame, dropping"); + return; + } + switch (dlci->state) { case MODEM_CMUX_DLCI_STATE_OPENING: LOG_DBG("DLCI %u opened", dlci->dlci_address); @@ -746,6 +758,11 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) modem_cmux_log_received_frame(&cmux->frame); + if (cmux->state != MODEM_CMUX_STATE_CONNECTED) { + LOG_DBG("Unexpected DLCI frame in state %d", cmux->state); + return; + } + dlci = modem_cmux_find_dlci(cmux); if (dlci == NULL) { LOG_WRN("Frame intended for unconfigured DLCI %u.", @@ -1087,6 +1104,7 @@ static void modem_cmux_connect_handler(struct k_work *item) cmux = CONTAINER_OF(dwork, struct modem_cmux, connect_work); cmux->state = MODEM_CMUX_STATE_CONNECTING; + cmux->initiator = true; static const struct modem_cmux_frame frame = { .dlci_address = 0, @@ -1119,7 +1137,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) struct modem_cmux_frame frame = { .dlci_address = 0, - .cr = true, + .cr = cmux->initiator, .pf = false, .type = MODEM_CMUX_FRAME_TYPE_UIH, .data = data, @@ -1198,7 +1216,7 @@ static int modem_cmux_dlci_pipe_api_transmit(void *data, const uint8_t *buf, siz struct modem_cmux_frame frame = { .dlci_address = dlci->dlci_address, - .cr = true, + .cr = cmux->initiator, .pf = false, .type = MODEM_CMUX_FRAME_TYPE_UIH, .data = buf, @@ -1273,7 +1291,7 @@ static void modem_cmux_dlci_open_handler(struct k_work *item) struct modem_cmux_frame frame = { .dlci_address = dlci->dlci_address, - .cr = true, + .cr = dlci->cmux->initiator, .pf = true, .type = MODEM_CMUX_FRAME_TYPE_SABM, .data = NULL, @@ -1302,7 +1320,7 @@ static void modem_cmux_dlci_close_handler(struct k_work *item) struct modem_cmux_frame frame = { .dlci_address = dlci->dlci_address, - .cr = true, + .cr = dlci->cmux->initiator, .pf = true, .type = MODEM_CMUX_FRAME_TYPE_DISC, .data = NULL, diff --git a/tests/subsys/modem/modem_cmux/src/main.c b/tests/subsys/modem/modem_cmux/src/main.c index b1adce37cc46..30c055bc8e74 100644 --- a/tests/subsys/modem/modem_cmux/src/main.c +++ b/tests/subsys/modem/modem_cmux/src/main.c @@ -886,4 +886,22 @@ ZTEST(modem_cmux, test_modem_cmux_split_large_data) "Incorrect number of bytes transmitted %d", ret); } +ZTEST(modem_cmux, test_modem_cmux_invalid_cr) +{ + uint32_t events; + + /* We are initiator, so any CMD with CR set should be dropped */ + modem_backend_mock_put(&bus_mock, cmux_frame_control_cld_cmd, + sizeof(cmux_frame_control_cld_cmd)); + + modem_backend_mock_put(&bus_mock, cmux_frame_control_sabm_cmd, + sizeof(cmux_frame_control_sabm_cmd)); + + events = k_event_wait_all(&cmux_event, + (MODEM_CMUX_EVENT_CONNECTED | MODEM_CMUX_EVENT_DISCONNECTED), + false, K_MSEC(100)); + + zassert_false(events, "Wrong CMD should have been ignored"); +} + ZTEST_SUITE(modem_cmux, NULL, test_modem_cmux_setup, test_modem_cmux_before, NULL, NULL); From bb88fa56bafe5bf87cb02916dad1aa49277e9ce0 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sat, 4 Oct 2025 13:52:25 +1000 Subject: [PATCH 0247/3334] [nrf fromtree] modem: modem_ppp: optimise frame wrapping Optimise the PPP frame wrapping process by performing all work inside a single function into a contiguous buffer, instead of operating on the ring buffer one byte at a time. On a nRF54L15 (M33 @ 128 MHz) before the change: ``` Wrapping 1062 byte packet: ~4.1 ms Wrapping 1355 byte packet: ~5.0 ms ``` After the change: ``` Wrapping 1026 byte packet: ~2.4 ms Wrapping 1341 byte packet: ~3.1 ms ``` Signed-off-by: Jordan Yates (cherry picked from commit 9f1e166abd02e6e8f547b06687bdebdf058439e5) --- include/zephyr/modem/ppp.h | 21 +-- subsys/modem/modem_ppp.c | 282 ++++++++++++++++++------------------- 2 files changed, 137 insertions(+), 166 deletions(-) diff --git a/include/zephyr/modem/ppp.h b/include/zephyr/modem/ppp.h index b3dbcfdeb7fb..69b35897e2d2 100644 --- a/include/zephyr/modem/ppp.h +++ b/include/zephyr/modem/ppp.h @@ -50,27 +50,10 @@ enum modem_ppp_receive_state { }; enum modem_ppp_transmit_state { - /* Idle */ MODEM_PPP_TRANSMIT_STATE_IDLE = 0, - /* Writing header */ MODEM_PPP_TRANSMIT_STATE_SOF, - MODEM_PPP_TRANSMIT_STATE_HDR_FF, - MODEM_PPP_TRANSMIT_STATE_HDR_7D, - MODEM_PPP_TRANSMIT_STATE_HDR_23, - /* Writing protocol */ - MODEM_PPP_TRANSMIT_STATE_PROTOCOL_HIGH, - MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_HIGH, - MODEM_PPP_TRANSMIT_STATE_PROTOCOL_LOW, - MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_LOW, - /* Writing data */ + MODEM_PPP_TRANSMIT_STATE_PROTOCOL, MODEM_PPP_TRANSMIT_STATE_DATA, - MODEM_PPP_TRANSMIT_STATE_ESCAPING_DATA, - /* Writing FCS */ - MODEM_PPP_TRANSMIT_STATE_FCS_LOW, - MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_LOW, - MODEM_PPP_TRANSMIT_STATE_FCS_HIGH, - MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_HIGH, - /* Writing end of frame */ MODEM_PPP_TRANSMIT_STATE_EOF, }; @@ -100,8 +83,6 @@ struct modem_ppp { /* Packet being sent */ enum modem_ppp_transmit_state transmit_state; struct net_pkt *tx_pkt; - uint8_t tx_pkt_escaped; - uint16_t tx_pkt_protocol; uint16_t tx_pkt_fcs; /* Ring buffer used for transmitting partial PPP frame */ diff --git a/subsys/modem/modem_ppp.c b/subsys/modem/modem_ppp.c index 9e2e2b5d71b7..cd13d4ac8b1a 100644 --- a/subsys/modem/modem_ppp.c +++ b/subsys/modem/modem_ppp.c @@ -49,148 +49,134 @@ static uint16_t modem_ppp_ppp_protocol(struct net_pkt *pkt) return 0; } -static uint8_t modem_ppp_wrap_net_pkt_byte(struct modem_ppp *ppp) +static bool modem_ppp_needs_escape(uint8_t byte) { - uint8_t byte; - - switch (ppp->transmit_state) { - case MODEM_PPP_TRANSMIT_STATE_IDLE: - LOG_WRN("Invalid transmit state"); - return 0; - - /* Writing header */ - case MODEM_PPP_TRANSMIT_STATE_SOF: - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_HDR_FF; - return MODEM_PPP_CODE_DELIMITER; - - case MODEM_PPP_TRANSMIT_STATE_HDR_FF: - net_pkt_cursor_init(ppp->tx_pkt); - ppp->tx_pkt_fcs = modem_ppp_fcs_init(0xFF); - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_HDR_7D; - return 0xFF; - - case MODEM_PPP_TRANSMIT_STATE_HDR_7D: - ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, 0x03); - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_HDR_23; - return MODEM_PPP_CODE_ESCAPE; - - case MODEM_PPP_TRANSMIT_STATE_HDR_23: - if (net_pkt_is_ppp(ppp->tx_pkt) == true) { - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; - } else { - ppp->tx_pkt_protocol = modem_ppp_ppp_protocol(ppp->tx_pkt); - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_PROTOCOL_HIGH; - } - - return 0x23; - - /* Writing protocol */ - case MODEM_PPP_TRANSMIT_STATE_PROTOCOL_HIGH: - byte = (ppp->tx_pkt_protocol >> 8) & 0xFF; - ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, byte); - - if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || - (byte < MODEM_PPP_VALUE_ESCAPE)) { - ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_HIGH; - return MODEM_PPP_CODE_ESCAPE; - } - - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_PROTOCOL_LOW; - return byte; - - case MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_HIGH: - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_PROTOCOL_LOW; - return ppp->tx_pkt_escaped; - - case MODEM_PPP_TRANSMIT_STATE_PROTOCOL_LOW: - byte = ppp->tx_pkt_protocol & 0xFF; - ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, byte); - - if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || - (byte < MODEM_PPP_VALUE_ESCAPE)) { - ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_LOW; - return MODEM_PPP_CODE_ESCAPE; - } - - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; - return byte; - - case MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_LOW: - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; - return ppp->tx_pkt_escaped; - - /* Writing data */ - case MODEM_PPP_TRANSMIT_STATE_DATA: - (void)net_pkt_read_u8(ppp->tx_pkt, &byte); - ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, byte); - - if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || - (byte < MODEM_PPP_VALUE_ESCAPE)) { - ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_DATA; - return MODEM_PPP_CODE_ESCAPE; - } + return (byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || + (byte < MODEM_PPP_VALUE_ESCAPE); +} - if (net_pkt_remaining_data(ppp->tx_pkt) == 0) { - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_FCS_LOW; - } +static uint32_t modem_ppp_wrap(struct modem_ppp *ppp, uint8_t *buffer, uint32_t available) +{ + uint32_t offset = 0; + uint32_t remaining; + uint16_t protocol; + uint8_t upper; + uint8_t lower; + uint8_t byte; - return byte; + while (offset < available) { + remaining = available - offset; - case MODEM_PPP_TRANSMIT_STATE_ESCAPING_DATA: - if (net_pkt_remaining_data(ppp->tx_pkt) == 0) { - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_FCS_LOW; - } else { + switch (ppp->transmit_state) { + case MODEM_PPP_TRANSMIT_STATE_SOF: + if (remaining < 4) { + /* Insufficient space for constant header prefix */ + goto end; + } + /* Init cursor for later phases */ + net_pkt_cursor_init(ppp->tx_pkt); + /* 3 byte common header */ + buffer[offset++] = MODEM_PPP_CODE_DELIMITER; + buffer[offset++] = 0xFF; + buffer[offset++] = MODEM_PPP_CODE_ESCAPE; + buffer[offset++] = 0x23; + /* Initialise the FCS. + * This value is always the same at this point, so use the constant value. + * Equivelent to: + * ppp->tx_pkt_fcs = modem_ppp_fcs_init(0xFF); + * ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, 0x03); + */ + ARG_UNUSED(modem_ppp_fcs_init); + ppp->tx_pkt_fcs = 0x3DE3; + /* Next state */ + if (net_pkt_is_ppp(ppp->tx_pkt)) { + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; + } else { + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_PROTOCOL; + } + break; + case MODEM_PPP_TRANSMIT_STATE_PROTOCOL: + /* If both protocol bytes need escaping, it could be 4 bytes */ + if (remaining < 4) { + /* Insufficient space for protocol bytes */ + goto end; + } + /* Extract protocol bytes */ + protocol = modem_ppp_ppp_protocol(ppp->tx_pkt); + upper = (protocol >> 8) & 0xFF; + lower = (protocol >> 0) & 0xFF; + /* FCS is computed without the escape/modification */ + ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, upper); + ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, lower); + /* Push protocol bytes (with required escaping) */ + if (modem_ppp_needs_escape(upper)) { + buffer[offset++] = MODEM_PPP_CODE_ESCAPE; + upper ^= MODEM_PPP_VALUE_ESCAPE; + } + buffer[offset++] = upper; + if (modem_ppp_needs_escape(lower)) { + buffer[offset++] = MODEM_PPP_CODE_ESCAPE; + lower ^= MODEM_PPP_VALUE_ESCAPE; + } + buffer[offset++] = lower; + /* Next state */ ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; + break; + case MODEM_PPP_TRANSMIT_STATE_DATA: + /* Push all data bytes into the buffer */ + while (net_pkt_remaining_data(ppp->tx_pkt) > 0) { + /* Space available, taking into account possible escapes */ + if (remaining < 2) { + goto end; + } + /* Pull next byte we're sending */ + (void)net_pkt_read_u8(ppp->tx_pkt, &byte); + /* FCS is computed without the escape/modification */ + ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, byte); + /* Push encoded bytes into buffer */ + if (modem_ppp_needs_escape(byte)) { + buffer[offset++] = MODEM_PPP_CODE_ESCAPE; + byte ^= MODEM_PPP_VALUE_ESCAPE; + remaining--; + } + buffer[offset++] = byte; + remaining--; + } + /* Data phase finished */ + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_EOF; + break; + case MODEM_PPP_TRANSMIT_STATE_EOF: + /* If both FCS bytes need escaping, it could be 5 bytes */ + if (remaining < 5) { + /* Insufficient space for protocol bytes */ + goto end; + } + /* Push FCS (order is [lower, upper] unlike the protocol) */ + ppp->tx_pkt_fcs = modem_ppp_fcs_final(ppp->tx_pkt_fcs); + lower = (ppp->tx_pkt_fcs >> 0) & 0xFF; + upper = (ppp->tx_pkt_fcs >> 8) & 0xFF; + if (modem_ppp_needs_escape(lower)) { + buffer[offset++] = MODEM_PPP_CODE_ESCAPE; + lower ^= MODEM_PPP_VALUE_ESCAPE; + } + buffer[offset++] = lower; + if (modem_ppp_needs_escape(upper)) { + buffer[offset++] = MODEM_PPP_CODE_ESCAPE; + upper ^= MODEM_PPP_VALUE_ESCAPE; + } + buffer[offset++] = upper; + buffer[offset++] = MODEM_PPP_CODE_DELIMITER; + + /* Packet has finished */ + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_IDLE; + goto end; + default: + LOG_DBG("Invalid transmit state (%d)", ppp->transmit_state); + goto end; } - - return ppp->tx_pkt_escaped; - - /* Writing FCS */ - case MODEM_PPP_TRANSMIT_STATE_FCS_LOW: - ppp->tx_pkt_fcs = modem_ppp_fcs_final(ppp->tx_pkt_fcs); - byte = ppp->tx_pkt_fcs & 0xFF; - - if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || - (byte < MODEM_PPP_VALUE_ESCAPE)) { - ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_LOW; - return MODEM_PPP_CODE_ESCAPE; - } - - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_FCS_HIGH; - return byte; - - case MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_LOW: - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_FCS_HIGH; - return ppp->tx_pkt_escaped; - - case MODEM_PPP_TRANSMIT_STATE_FCS_HIGH: - byte = (ppp->tx_pkt_fcs >> 8) & 0xFF; - - if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || - (byte < MODEM_PPP_VALUE_ESCAPE)) { - ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_HIGH; - return MODEM_PPP_CODE_ESCAPE; - } - - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_EOF; - return byte; - - case MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_HIGH: - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_EOF; - return ppp->tx_pkt_escaped; - - /* Writing end of frame */ - case MODEM_PPP_TRANSMIT_STATE_EOF: - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_IDLE; - return MODEM_PPP_CODE_DELIMITER; } - - return 0; +end: + return offset; } static bool modem_ppp_is_byte_expected(uint8_t byte, uint8_t expected_byte) @@ -357,32 +343,36 @@ static void modem_ppp_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_eve static void modem_ppp_send_handler(struct k_work *item) { struct modem_ppp *ppp = CONTAINER_OF(item, struct modem_ppp, send_work); - uint8_t byte; uint8_t *reserved; uint32_t reserved_size; + uint32_t pushed; int ret; if (ppp->tx_pkt == NULL) { ppp->tx_pkt = k_fifo_get(&ppp->tx_pkt_fifo, K_NO_WAIT); } + if (ring_buf_is_empty(&ppp->transmit_rb)) { + /* Reset to initial state to maximise contiguous claim */ + ring_buf_reset(&ppp->transmit_rb); + } + if (ppp->tx_pkt != NULL) { /* Initialize wrap */ if (ppp->transmit_state == MODEM_PPP_TRANSMIT_STATE_IDLE) { ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_SOF; } - /* Fill transmit ring buffer */ - while (ring_buf_space_get(&ppp->transmit_rb) > 0) { - byte = modem_ppp_wrap_net_pkt_byte(ppp); - - ring_buf_put(&ppp->transmit_rb, &byte, 1); + /* Claim as much space as possible */ + reserved_size = ring_buf_put_claim(&ppp->transmit_rb, &reserved, UINT32_MAX); + /* Push wrapped data into claimed buffer */ + pushed = modem_ppp_wrap(ppp, reserved, reserved_size); + /* Limit claimed data to what was actually pushed */ + ring_buf_put_finish(&ppp->transmit_rb, pushed); - if (ppp->transmit_state == MODEM_PPP_TRANSMIT_STATE_IDLE) { - net_pkt_unref(ppp->tx_pkt); - ppp->tx_pkt = k_fifo_get(&ppp->tx_pkt_fifo, K_NO_WAIT); - break; - } + if (ppp->transmit_state == MODEM_PPP_TRANSMIT_STATE_IDLE) { + net_pkt_unref(ppp->tx_pkt); + ppp->tx_pkt = k_fifo_get(&ppp->tx_pkt_fifo, K_NO_WAIT); } } From daf81b401b2a3d44a61f2f0b9e5c29c341e479a2 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Fri, 10 Oct 2025 10:35:37 +0300 Subject: [PATCH 0248/3334] [nrf fromtree] modem: cmux: Combine state and event Refactor internal event bits to use state enum values and define set_state() and wait_state() so we don't need two set of variables to maintain. Signed-off-by: Seppo Takalo (cherry picked from commit 2cfd92410ead8af098ca8f772990f59a4675a999) --- subsys/modem/modem_cmux.c | 53 +++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index f304985717ac..4573c1b8bdc5 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -101,6 +101,22 @@ static int modem_cmux_wrap_command(struct modem_cmux_command **command, const ui return 0; } +static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) +{ + cmux->state = state; + k_event_set(&cmux->event, BIT(state)); +} + +static bool wait_state(struct modem_cmux *cmux, enum modem_cmux_state state, k_timeout_t timeout) +{ + return k_event_wait(&cmux->event, BIT(state), false, timeout) == BIT(state); +} + +static bool is_connected(struct modem_cmux *cmux) +{ + return cmux->state == MODEM_CMUX_STATE_CONNECTED; +} + static struct modem_cmux_command *modem_cmux_command_wrap(const uint8_t *data) { return (struct modem_cmux_command *)data; @@ -450,14 +466,12 @@ static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux } LOG_DBG("CMUX disconnected"); - cmux->state = MODEM_CMUX_STATE_DISCONNECTED; + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = false; k_mutex_unlock(&cmux->transmit_rb_lock); modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); - k_event_clear(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); - k_event_post(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); } static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) @@ -468,15 +482,13 @@ static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) } LOG_DBG("CMUX connected"); - cmux->state = MODEM_CMUX_STATE_CONNECTED; + set_state(cmux, MODEM_CMUX_STATE_CONNECTED); cmux->initiator = true; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); k_work_cancel_delayable(&cmux->connect_work); modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_CONNECTED); - k_event_clear(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); - k_event_post(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); } static void modem_cmux_respond_unsupported_cmd(struct modem_cmux *cmux) @@ -604,21 +616,19 @@ static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) LOG_DBG("CMUX connection request received"); cmux->initiator = false; - cmux->state = MODEM_CMUX_STATE_CONNECTED; + set_state(cmux, MODEM_CMUX_STATE_CONNECTED); modem_cmux_connect_response_transmit(cmux); k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_CONNECTED); - k_event_clear(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); - k_event_post(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); } static void modem_cmux_on_control_frame(struct modem_cmux *cmux) { modem_cmux_log_received_frame(&cmux->frame); - if (cmux->state == MODEM_CMUX_STATE_CONNECTED && cmux->frame.cr == cmux->initiator) { + if (is_connected(cmux) && cmux->frame.cr == cmux->initiator) { LOG_DBG("Received a response frame, dropping"); return; } @@ -1103,7 +1113,7 @@ static void modem_cmux_connect_handler(struct k_work *item) dwork = k_work_delayable_from_work(item); cmux = CONTAINER_OF(dwork, struct modem_cmux, connect_work); - cmux->state = MODEM_CMUX_STATE_CONNECTING; + set_state(cmux, MODEM_CMUX_STATE_CONNECTING); cmux->initiator = true; static const struct modem_cmux_frame frame = { @@ -1126,7 +1136,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) struct modem_cmux_command *command; uint8_t data[2]; - cmux->state = MODEM_CMUX_STATE_DISCONNECTING; + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTING); command = modem_cmux_command_wrap(data); command->type.ea = 1; @@ -1360,7 +1370,6 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co cmux->receive_buf = config->receive_buf; cmux->receive_buf_size = config->receive_buf_size; sys_slist_init(&cmux->dlcis); - cmux->state = MODEM_CMUX_STATE_DISCONNECTED; ring_buf_init(&cmux->transmit_rb, config->transmit_buf_size, config->transmit_buf); k_mutex_init(&cmux->transmit_rb_lock); k_work_init_delayable(&cmux->receive_work, modem_cmux_receive_handler); @@ -1368,8 +1377,7 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co k_work_init_delayable(&cmux->connect_work, modem_cmux_connect_handler); k_work_init_delayable(&cmux->disconnect_work, modem_cmux_disconnect_handler); k_event_init(&cmux->event); - k_event_clear(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); - k_event_post(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); #if CONFIG_MODEM_STATS modem_cmux_init_buf_stats(cmux); @@ -1431,8 +1439,7 @@ int modem_cmux_connect(struct modem_cmux *cmux) return ret; } - if (k_event_wait(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT, false, - MODEM_CMUX_T2_TIMEOUT) == 0) { + if (!wait_state(cmux, MODEM_CMUX_STATE_CONNECTED, MODEM_CMUX_T2_TIMEOUT)) { return -EAGAIN; } @@ -1443,7 +1450,7 @@ int modem_cmux_connect_async(struct modem_cmux *cmux) { int ret = 0; - if (k_event_test(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT)) { + if (cmux->state != MODEM_CMUX_STATE_DISCONNECTED) { return -EALREADY; } @@ -1470,8 +1477,7 @@ int modem_cmux_disconnect(struct modem_cmux *cmux) return ret; } - if (k_event_wait(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT, false, - MODEM_CMUX_T2_TIMEOUT) == 0) { + if (!wait_state(cmux, MODEM_CMUX_STATE_DISCONNECTED, MODEM_CMUX_T2_TIMEOUT)) { return -EAGAIN; } @@ -1482,7 +1488,7 @@ int modem_cmux_disconnect_async(struct modem_cmux *cmux) { int ret = 0; - if (k_event_test(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT)) { + if (cmux->state == MODEM_CMUX_STATE_DISCONNECTED) { return -EALREADY; } @@ -1529,7 +1535,6 @@ void modem_cmux_release(struct modem_cmux *cmux) /* Unreference pipe */ cmux->pipe = NULL; - /* Reset events */ - k_event_clear(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); - k_event_post(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); + /* Reset state */ + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); } From 4e650ccf2b4336db9a5d2ba64a37d0eedfa99602 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 14 Oct 2025 21:04:25 +0000 Subject: [PATCH 0249/3334] [nrf fromtree] modem: cmux: Handle CLD response Instead of dropping all responses, handle the CLD. Signed-off-by: Seppo Takalo (cherry picked from commit 822a501828b48a89fa5da4149f8a85901206a2d6) --- subsys/modem/modem_cmux.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 4573c1b8bdc5..e668052ffb5d 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -543,6 +543,19 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) modem_cmux_log_received_command(command); + if (!command->type.cr) { + LOG_DBG("Received response command"); + switch (command->type.value) { + case MODEM_CMUX_COMMAND_CLD: + modem_cmux_on_cld_command(cmux, command); + break; + default: + /* Responses to other commands are ignored */ + break; + } + return; + } + switch (command->type.value) { case MODEM_CMUX_COMMAND_CLD: modem_cmux_on_cld_command(cmux, command); @@ -629,8 +642,7 @@ static void modem_cmux_on_control_frame(struct modem_cmux *cmux) modem_cmux_log_received_frame(&cmux->frame); if (is_connected(cmux) && cmux->frame.cr == cmux->initiator) { - LOG_DBG("Received a response frame, dropping"); - return; + LOG_DBG("Received a response frame"); } switch (cmux->frame.type) { From b979d4d3e85660b7bd34fe3224e3f986366f4e60 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Thu, 25 Sep 2025 17:03:05 +0300 Subject: [PATCH 0250/3334] [nrf fromtree] modem: cmux: Send disconnect event only after responding to CLD If we immediately send disconnected event when CLD is received, we might close the UART pipe before the response is actually send. Also, shutdown_handler should not retry indefinitely. Signed-off-by: Seppo Takalo (cherry picked from commit a9bc72a22a79b80e644792c8149cc67894b24ecb) --- subsys/modem/modem_cmux.c | 31 +++++++++++++------ tests/subsys/modem/modem_cmux_pair/src/main.c | 8 +++-- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index e668052ffb5d..914f3348f401 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -449,6 +449,17 @@ static void modem_cmux_on_fcoff_command(struct modem_cmux *cmux) modem_cmux_acknowledge_received_frame(cmux); } +static void disconnect(struct modem_cmux *cmux) +{ + LOG_DBG("CMUX disconnected"); + k_work_cancel_delayable(&cmux->disconnect_work); + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); + k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); + cmux->flow_control_on = false; + k_mutex_unlock(&cmux->transmit_rb_lock); + modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); +} + static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux_command *command) { if (command->type.cr) { @@ -462,16 +473,11 @@ static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux } if (cmux->state == MODEM_CMUX_STATE_DISCONNECTING) { - k_work_cancel_delayable(&cmux->disconnect_work); + disconnect(cmux); + } else { + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTING); + k_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); } - - LOG_DBG("CMUX disconnected"); - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); - k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); - cmux->flow_control_on = false; - k_mutex_unlock(&cmux->transmit_rb_lock); - - modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); } static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) @@ -1148,7 +1154,12 @@ static void modem_cmux_disconnect_handler(struct k_work *item) struct modem_cmux_command *command; uint8_t data[2]; - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTING); + if (cmux->state == MODEM_CMUX_STATE_DISCONNECTING) { + disconnect(cmux); + } else { + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTING); + k_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); + } command = modem_cmux_command_wrap(data); command->type.ea = 1; diff --git a/tests/subsys/modem/modem_cmux_pair/src/main.c b/tests/subsys/modem/modem_cmux_pair/src/main.c index 5cc8fed4b458..1988e9d73319 100644 --- a/tests/subsys/modem/modem_cmux_pair/src/main.c +++ b/tests/subsys/modem/modem_cmux_pair/src/main.c @@ -507,9 +507,10 @@ ZTEST(modem_cmux_pair, test_modem_cmux_disconnect_connect) modem_backend_mock_reset(&bus_mock_dte); zassert_true(modem_cmux_disconnect_async(&cmux_dte) == 0, "Failed to disconnect CMUX"); - k_msleep(100); + events = k_event_wait_all(&cmux_event_dte, (EVENT_CMUX_DISCONNECTED), false, K_MSEC(660)); + zassert_true((events & EVENT_CMUX_DISCONNECTED), "Failed to disconnect CMUX"); - events = k_event_wait_all(&cmux_event_dte, (EVENT_CMUX_DISCONNECTED), false, K_MSEC(100)); + events = k_event_wait_all(&cmux_event_dce, (EVENT_CMUX_DISCONNECTED), false, K_MSEC(660)); zassert_true((events & EVENT_CMUX_DISCONNECTED), "Failed to disconnect CMUX"); /* Reconnect CMUX */ @@ -554,6 +555,9 @@ ZTEST(modem_cmux_pair, test_modem_cmux_disconnect_connect_sync) zassert_true(modem_cmux_disconnect(&cmux_dte) == 0, "Failed to disconnect CMUX"); zassert_true(modem_cmux_disconnect(&cmux_dte) == -EALREADY, "Should already be disconnected"); + + events = k_event_wait_all(&cmux_event_dce, (EVENT_CMUX_DISCONNECTED), false, K_MSEC(660)); + zassert_true((events & EVENT_CMUX_DISCONNECTED), "Failed to disconnect CMUX"); zassert_true(modem_cmux_disconnect(&cmux_dce) == -EALREADY, "Should already be disconnected"); From d502d6b0bab038512b8ce6444234fef8a99e6dfb Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Thu, 25 Sep 2025 16:57:27 +0300 Subject: [PATCH 0251/3334] [nrf fromtree] drivers: modem: cellular: Close down CMUX before shut down Properly close down the CMUX channel before shutting down the modem. The CMUX Close-Down command should indicate the remote end to clean up, even if we don't have shutdown script or power-key GPIO. Signed-off-by: Seppo Takalo (cherry picked from commit 72701683be80073c40b6ecd6afbf7039fb2bc6c0) --- drivers/modem/modem_cellular.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index c0cc43a5dafa..64e3614b51eb 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -83,6 +83,7 @@ enum modem_cellular_event { MODEM_CELLULAR_EVENT_SCRIPT_SUCCESS, MODEM_CELLULAR_EVENT_SCRIPT_FAILED, MODEM_CELLULAR_EVENT_CMUX_CONNECTED, + MODEM_CELLULAR_EVENT_CMUX_DISCONNECTED, MODEM_CELLULAR_EVENT_DLCI1_OPENED, MODEM_CELLULAR_EVENT_DLCI2_OPENED, MODEM_CELLULAR_EVENT_TIMEOUT, @@ -257,6 +258,8 @@ static const char *modem_cellular_event_str(enum modem_cellular_event event) return "script failed"; case MODEM_CELLULAR_EVENT_CMUX_CONNECTED: return "cmux connected"; + case MODEM_CELLULAR_EVENT_CMUX_DISCONNECTED: + return "cmux disconnected"; case MODEM_CELLULAR_EVENT_DLCI1_OPENED: return "dlci1 opened"; case MODEM_CELLULAR_EVENT_DLCI2_OPENED: @@ -1377,6 +1380,7 @@ static int modem_cellular_on_dormant_state_leave(struct modem_cellular_data *dat static int modem_cellular_on_init_power_off_state_enter(struct modem_cellular_data *data) { + modem_cmux_disconnect_async(&data->cmux); modem_cellular_start_timer(data, K_MSEC(2000)); return 0; } @@ -1388,6 +1392,9 @@ static void modem_cellular_init_power_off_event_handler(struct modem_cellular_da (const struct modem_cellular_config *)data->dev->config; switch (evt) { + case MODEM_CELLULAR_EVENT_CMUX_DISCONNECTED: + modem_cellular_stop_timer(data); + __fallthrough; case MODEM_CELLULAR_EVENT_TIMEOUT: /* Shutdown script can only be used if cmd_pipe is available, i.e. we are not in * some intermediary state without a pipe for commands available @@ -1775,7 +1782,9 @@ static void modem_cellular_cmux_handler(struct modem_cmux *cmux, enum modem_cmux case MODEM_CMUX_EVENT_CONNECTED: modem_cellular_delegate_event(data, MODEM_CELLULAR_EVENT_CMUX_CONNECTED); break; - + case MODEM_CMUX_EVENT_DISCONNECTED: + modem_cellular_delegate_event(data, MODEM_CELLULAR_EVENT_CMUX_DISCONNECTED); + break; default: break; } From e4a845f502bf21cc80e046b7503ae13887611abc Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 26 Aug 2025 15:19:54 +0300 Subject: [PATCH 0252/3334] [nrf fromtree] modem: cmux: Implement Modem Status Command Implement Modem Status Command(MSC) and a per DLC flow control by using it. Send flow control signals when our input buffer don't fit full frame anymore. Stop TX if we have received from controls on MSC. Signed-off-by: Seppo Takalo (cherry picked from commit 1f996d07b8047bbd20c1c519f60beb076fb80216) --- include/zephyr/modem/cmux.h | 4 + subsys/modem/modem_cmux.c | 194 ++++++++++++++++++- tests/subsys/modem/mock/modem_backend_mock.c | 18 +- tests/subsys/modem/mock/modem_backend_mock.h | 5 + tests/subsys/modem/modem_cmux/src/main.c | 61 ++++-- 5 files changed, 260 insertions(+), 22 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 17b63bdf66af..bf349980e2c9 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -120,6 +120,10 @@ struct modem_cmux_dlci { #if CONFIG_MODEM_STATS struct modem_stats_buffer receive_buf_stats; #endif + /* Flow control */ + bool flow_control : 1; + bool rx_full : 1; + bool msc_sent : 1; }; struct modem_cmux_frame { diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 914f3348f401..b311ab7865d9 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -81,6 +81,29 @@ struct modem_cmux_command { uint8_t value[]; }; +struct modem_cmux_msc_signals { + uint8_t ea: 1; /**< Last octet, always 1 */ + uint8_t fc: 1; /**< Flow Control */ + uint8_t rtc: 1; /**< Ready to Communicate */ + uint8_t rtr: 1; /**< Ready to Transmit */ + uint8_t res_0: 2; /**< Reserved, set to zero */ + uint8_t ic: 1; /**< Incoming call indicator */ + uint8_t dv: 1; /**< Data Valid */ +}; +struct modem_cmux_msc_addr { + uint8_t ea: 1; /**< Last octet, always 1 */ + uint8_t pad_one: 1; /**< Set to 1 */ + uint8_t dlci_address: 6; /**< DLCI channel address */ +}; + +struct modem_cmux_command_msc { + struct modem_cmux_command command; + uint8_t value[2]; +}; + +static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address); +static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux); + static int modem_cmux_wrap_command(struct modem_cmux_command **command, const uint8_t *data, uint16_t data_len) { @@ -122,6 +145,53 @@ static struct modem_cmux_command *modem_cmux_command_wrap(const uint8_t *data) return (struct modem_cmux_command *)data; } +static struct modem_cmux_msc_signals modem_cmux_msc_signals_decode(const uint8_t byte) +{ + struct modem_cmux_msc_signals signals; + + /* 3GPP TS 27.010 MSC signals octet: + * |0 |1 |2 |3 |4 |5 |6 |7 | + * |EA |FC|RTC|RTR|0 |0 |IC|DV| + */ + signals.ea = (byte & BIT(0)) ? 1 : 0; + signals.fc = (byte & BIT(1)) ? 1 : 0; + signals.rtc = (byte & BIT(2)) ? 1 : 0; + signals.rtr = (byte & BIT(3)) ? 1 : 0; + signals.ic = (byte & BIT(6)) ? 1 : 0; + signals.dv = (byte & BIT(7)) ? 1 : 0; + + return signals; +} + +static uint8_t modem_cmux_msc_signals_encode(const struct modem_cmux_msc_signals signals) +{ + return (signals.ea ? BIT(0) : 0) | (signals.fc ? BIT(1) : 0) | + (signals.rtc ? BIT(2) : 0) | (signals.rtr ? BIT(3) : 0) | + (signals.ic ? BIT(6) : 0) | (signals.dv ? BIT(7) : 0); +} + +static struct modem_cmux_msc_addr modem_cmux_msc_addr_decode(const uint8_t byte) +{ + struct modem_cmux_msc_addr addr; + + /* 3GPP TS 27.010 MSC address octet: + * |0 |1 |2 |3 |4 |5 |6 |7 | + * |EA |1 | DLCI | + */ + addr.ea = (byte & BIT(0)) ? 1 : 0; + addr.pad_one = 1; + addr.dlci_address = (byte >> 2) & 0x3F; + + return addr; +} + +static uint8_t modem_cmux_msc_addr_encode(const struct modem_cmux_msc_addr a) +{ + return (a.ea ? BIT(0) : 0) | BIT(1) | + ((a.dlci_address & 0x3F) << 2); +} + + #if CONFIG_MODEM_CMUX_LOG_FRAMES static const char *modem_cmux_frame_type_to_str(enum modem_cmux_frame_types frame_type) { @@ -426,10 +496,92 @@ static void modem_cmux_acknowledge_received_frame(struct modem_cmux *cmux) } } +static void modem_cmux_send_msc(struct modem_cmux *cmux, struct modem_cmux_dlci *dlci) +{ + if (cmux == NULL || dlci == NULL) { + return; + } + + struct modem_cmux_msc_addr addr = { + .ea = 1, + .pad_one = 1, + .dlci_address = dlci->dlci_address, + }; + struct modem_cmux_msc_signals signals = { + .ea = 1, + .fc = dlci->rx_full ? 1 : 0, + .rtc = dlci->state == MODEM_CMUX_DLCI_STATE_OPEN ? 1 : 0, + .rtr = dlci->state == MODEM_CMUX_DLCI_STATE_OPEN ? 1 : 0, + .dv = 1, + }; + struct modem_cmux_command_msc cmd = { + .command = { + .type = { + .ea = 1, + .cr = 1, + .value = MODEM_CMUX_COMMAND_MSC, + }, + .length = { + .ea = 1, + .value = sizeof(cmd.value), + }, + }, + .value[0] = modem_cmux_msc_addr_encode(addr), + .value[1] = modem_cmux_msc_signals_encode(signals), + }; + + struct modem_cmux_frame frame = { + .dlci_address = 0, + .cr = cmux->initiator, + .pf = false, + .type = MODEM_CMUX_FRAME_TYPE_UIH, + .data = (void *)&cmd, + .data_len = sizeof(cmd), + }; + + LOG_DBG("Sending MSC command for DLCI %u, FC:%d RTR: %d DV: %d", addr.dlci_address, + signals.fc, signals.rtr, signals.dv); + modem_cmux_transmit_cmd_frame(cmux, &frame); +} + static void modem_cmux_on_msc_command(struct modem_cmux *cmux, struct modem_cmux_command *command) { - if (command->type.cr) { - modem_cmux_acknowledge_received_frame(cmux); + if (!command->type.cr) { + return; + } + + modem_cmux_acknowledge_received_frame(cmux); + + uint8_t len = command->length.value; + + if (len != 2 && len != 3) { + LOG_WRN("Unexpected MSC command length %d", (int)len); + return; + } + + struct modem_cmux_msc_addr msc = modem_cmux_msc_addr_decode(command->value[0]); + struct modem_cmux_msc_signals signals = modem_cmux_msc_signals_decode(command->value[1]); + struct modem_cmux_dlci *dlci = modem_cmux_find_dlci(cmux, msc.dlci_address); + + if (dlci) { + LOG_DBG("MSC command received for DLCI %u", msc.dlci_address); + bool fc_signal = signals.fc || !signals.rtr; + + if (fc_signal != dlci->flow_control) { + if (fc_signal) { + dlci->flow_control = true; + LOG_DBG("DLCI %u flow control ON", dlci->dlci_address); + } else { + dlci->flow_control = false; + LOG_DBG("DLCI %u flow control OFF", dlci->dlci_address); + modem_pipe_notify_transmit_idle(&dlci->pipe); + } + } + /* As we have received MSC, send also our MSC */ + if (!dlci->msc_sent && dlci->state == MODEM_CMUX_DLCI_STATE_OPEN) { + dlci->msc_sent = true; + modem_cmux_send_msc(cmux, dlci); + } } } @@ -439,6 +591,7 @@ static void modem_cmux_on_fcon_command(struct modem_cmux *cmux) cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); modem_cmux_acknowledge_received_frame(cmux); + modem_cmux_dlci_notify_transmit_idle(cmux); } static void modem_cmux_on_fcoff_command(struct modem_cmux *cmux) @@ -670,7 +823,7 @@ static void modem_cmux_on_control_frame(struct modem_cmux *cmux) } } -static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux) +static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address) { sys_snode_t *node; struct modem_cmux_dlci *dlci; @@ -678,7 +831,7 @@ static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux) SYS_SLIST_FOR_EACH_NODE(&cmux->dlcis, node) { dlci = (struct modem_cmux_dlci *)node; - if (dlci->dlci_address == cmux->frame.dlci_address) { + if (dlci->dlci_address == dlci_address) { return dlci; } } @@ -710,6 +863,12 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) k_mutex_lock(&dlci->receive_rb_lock, K_FOREVER); ring_buf_reset(&dlci->receive_rb); k_mutex_unlock(&dlci->receive_rb_lock); + if (dlci->cmux->initiator) { + modem_cmux_send_msc(dlci->cmux, dlci); + dlci->msc_sent = true; + } else { + dlci->msc_sent = false; + } break; case MODEM_CMUX_DLCI_STATE_CLOSING: @@ -742,6 +901,12 @@ static void modem_cmux_on_dlci_frame_uih(struct modem_cmux_dlci *dlci) LOG_WRN("DLCI %u receive buffer overrun (dropped %u out of %u bytes)", dlci->dlci_address, cmux->frame.data_len - written, cmux->frame.data_len); } + if (written < cmux->frame.data_len || + ring_buf_space_get(&dlci->receive_rb) < MODEM_CMUX_DATA_FRAME_SIZE_MAX) { + LOG_WRN("DLCI %u receive buffer is full", dlci->dlci_address); + dlci->rx_full = true; + modem_cmux_send_msc(cmux, dlci); + } modem_pipe_notify_receive_ready(&dlci->pipe); } @@ -758,6 +923,7 @@ static void modem_cmux_on_dlci_frame_sabm(struct modem_cmux_dlci *dlci) LOG_DBG("DLCI %u SABM request accepted, DLCI opened", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_OPEN; + dlci->msc_sent = false; modem_pipe_notify_opened(&dlci->pipe); k_mutex_lock(&dlci->receive_rb_lock, K_FOREVER); ring_buf_reset(&dlci->receive_rb); @@ -791,7 +957,7 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) return; } - dlci = modem_cmux_find_dlci(cmux); + dlci = modem_cmux_find_dlci(cmux, cmux->frame.dlci_address); if (dlci == NULL) { LOG_WRN("Frame intended for unconfigured DLCI %u.", cmux->frame.dlci_address); @@ -1066,7 +1232,9 @@ static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) SYS_SLIST_FOR_EACH_NODE(&cmux->dlcis, node) { dlci = (struct modem_cmux_dlci *)node; - modem_pipe_notify_transmit_idle(&dlci->pipe); + if (!dlci->flow_control) { + modem_pipe_notify_transmit_idle(&dlci->pipe); + } } } @@ -1241,6 +1409,10 @@ static int modem_cmux_dlci_pipe_api_transmit(void *data, const uint8_t *buf, siz struct modem_cmux *cmux = dlci->cmux; int ret = 0; + if (dlci->flow_control) { + return 0; + } + K_SPINLOCK(&cmux->work_lock) { if (!cmux->attached) { ret = -EPERM; @@ -1275,6 +1447,15 @@ static int modem_cmux_dlci_pipe_api_receive(void *data, uint8_t *buf, size_t siz ret = ring_buf_get(&dlci->receive_rb, buf, size); k_mutex_unlock(&dlci->receive_rb_lock); + + /* Release FC if set */ + if (dlci->rx_full && + ring_buf_space_get(&dlci->receive_rb) >= MODEM_CMUX_DATA_FRAME_SIZE_MAX) { + LOG_DBG("DLCI %u receive buffer is no longer full", dlci->dlci_address); + dlci->rx_full = false; + modem_cmux_send_msc(dlci->cmux, dlci); + } + return ret; } @@ -1321,6 +1502,7 @@ static void modem_cmux_dlci_open_handler(struct k_work *item) dlci = CONTAINER_OF(dwork, struct modem_cmux_dlci, open_work); dlci->state = MODEM_CMUX_DLCI_STATE_OPENING; + dlci->msc_sent = false; struct modem_cmux_frame frame = { .dlci_address = dlci->dlci_address, diff --git a/tests/subsys/modem/mock/modem_backend_mock.c b/tests/subsys/modem/mock/modem_backend_mock.c index 5b7b47c0eb49..49ea1927076b 100644 --- a/tests/subsys/modem/mock/modem_backend_mock.c +++ b/tests/subsys/modem/mock/modem_backend_mock.c @@ -52,12 +52,15 @@ static int modem_backend_mock_transmit(void *data, const uint8_t *buf, size_t si return ret; } - ret = ring_buf_put(&mock->tx_rb, buf, size); if (modem_backend_mock_update(mock, buf, size)) { + /* Skip ringbuffer if transaction consumes bytes */ + ret = size; modem_backend_mock_put(mock, mock->transaction->put, mock->transaction->put_size); - mock->transaction = NULL; + modem_backend_mock_prime(mock, mock->transaction->next); + } else { + ret = ring_buf_put(&mock->tx_rb, buf, size); } k_work_submit(&mock->transmit_idle_work); @@ -137,6 +140,10 @@ int modem_backend_mock_get(struct modem_backend_mock *mock, uint8_t *buf, size_t void modem_backend_mock_put(struct modem_backend_mock *mock, const uint8_t *buf, size_t size) { + if (size == 0) { + return; + } + __ASSERT(ring_buf_put(&mock->rx_rb, buf, size) == size, "Mock buffer capacity exceeded"); @@ -155,3 +162,10 @@ void modem_backend_mock_bridge(struct modem_backend_mock *mock_a, struct modem_b mock_a->bridge = mock_b; mock_b->bridge = mock_a; } + +void modem_backend_mock_wait_for_transaction(struct modem_backend_mock *mock) +{ + while (mock->transaction) { + k_msleep(1); + } +} diff --git a/tests/subsys/modem/mock/modem_backend_mock.h b/tests/subsys/modem/mock/modem_backend_mock.h index 56a5b585cb12..34b79aca552f 100644 --- a/tests/subsys/modem/mock/modem_backend_mock.h +++ b/tests/subsys/modem/mock/modem_backend_mock.h @@ -19,6 +19,9 @@ struct modem_backend_mock_transaction { /* Data which will be put in response to get data */ const uint8_t *put; size_t put_size; + + /* Next transaction in chain */ + const struct modem_backend_mock_transaction *next; }; struct modem_backend_mock { @@ -62,4 +65,6 @@ void modem_backend_mock_prime(struct modem_backend_mock *mock, void modem_backend_mock_bridge(struct modem_backend_mock *mock_a, struct modem_backend_mock *mock_b); +void modem_backend_mock_wait_for_transaction(struct modem_backend_mock *mock); + #endif /* ZEPHYR_DRIVERS_MODEM_MODEM_PIPE_MOCK */ diff --git a/tests/subsys/modem/modem_cmux/src/main.c b/tests/subsys/modem/modem_cmux/src/main.c index 30c055bc8e74..67833baabe76 100644 --- a/tests/subsys/modem/modem_cmux/src/main.c +++ b/tests/subsys/modem/modem_cmux/src/main.c @@ -117,17 +117,19 @@ static uint8_t cmux_frame_control_cld_ack[] = {0xF9, 0x03, 0xEF, 0x05, 0xC1, 0x0 static uint8_t cmux_frame_dlci1_sabm_cmd[] = {0xF9, 0x07, 0x3F, 0x01, 0xDE, 0xF9}; static uint8_t cmux_frame_dlci1_sabm_ack[] = {0xF9, 0x07, 0x73, 0x01, 0x15, 0xF9}; static uint8_t cmux_frame_dlci1_disc_cmd[] = {0xF9, 0x07, 0x53, 0x01, 0x3F, 0xF9}; +static uint8_t cmux_frame_dlci1_msc_cmd[] = {0xF9, 0x03, 0xEF, 0x09, 0xE3, + 0x05, 0x07, 0x8D, 0xFB, 0xF9}; static uint8_t cmux_frame_dlci1_ua_ack[] = {0xF9, 0x07, 0x73, 0x01, 0x15, 0xF9}; static uint8_t cmux_frame_dlci2_sabm_cmd[] = {0xF9, 0x0B, 0x3F, 0x01, 0x59, 0xF9}; static uint8_t cmux_frame_dlci2_sabm_ack[] = {0xF9, 0x0B, 0x73, 0x01, 0x92, 0xF9}; static uint8_t cmux_frame_dlci2_disc_cmd[] = {0xF9, 0x0B, 0x53, 0x01, 0xB8, 0xF9}; +static uint8_t cmux_frame_dlci2_msc_cmd[] = {0xF9, 0x03, 0xEF, 0x09, 0xE3, + 0x05, 0x0B, 0x8D, 0xFB, 0xF9}; static uint8_t cmux_frame_dlci2_ua_ack[] = {0xF9, 0x0B, 0x73, 0x01, 0x92, 0xF9}; -static uint8_t cmux_frame_control_msc_cmd[] = {0xF9, 0x01, 0xFF, 0x0B, 0xE3, - 0x07, 0x0B, 0x09, 0x01, 0x6C, 0xF9}; - -static uint8_t cmux_frame_control_msc_ack[] = {0xF9, 0x01, 0xFF, 0x0B, 0xE1, - 0x07, 0x0B, 0x09, 0x01, 0x6C, 0xF9}; - +static uint8_t cmux_frame_control_msc_cmd[] = {0xF9, 0x01, 0xEF, 0x09, 0xE3, + 0x05, 0x07, 0x01, 0x9A, 0xF9}; +static uint8_t cmux_frame_control_msc_ack[] = {0xF9, 0x01, 0xEF, 0x09, 0xE1, + 0x05, 0x07, 0x01, 0x9A, 0xF9}; static uint8_t cmux_frame_control_fcon_cmd[] = {0xF9, 0x01, 0xFF, 0x05, 0xA3, 0x01, 0x86, 0xF9}; static uint8_t cmux_frame_control_fcon_ack[] = {0xF9, 0x01, 0xFF, 0x05, 0xA1, 0x01, 0x86, 0xF9}; static uint8_t cmux_frame_control_fcoff_cmd[] = {0xF9, 0x01, 0xFF, 0x05, 0x63, 0x01, 0x86, 0xF9}; @@ -227,19 +229,31 @@ const static struct modem_backend_mock_transaction transaction_dlci2_disc = { .put_size = sizeof(cmux_frame_dlci2_ua_ack) }; +const static struct modem_backend_mock_transaction transaction_dlci1_msc = { + .get = cmux_frame_dlci1_msc_cmd, + .get_size = sizeof(cmux_frame_dlci1_msc_cmd), + .put = NULL, + .put_size = 0}; + +const static struct modem_backend_mock_transaction transaction_dlci2_msc = { + .get = cmux_frame_dlci2_msc_cmd, + .get_size = sizeof(cmux_frame_dlci2_msc_cmd), + .put = NULL, + .put_size = 0}; + const static struct modem_backend_mock_transaction transaction_dlci1_sabm = { .get = cmux_frame_dlci1_sabm_cmd, .get_size = sizeof(cmux_frame_dlci1_sabm_cmd), .put = cmux_frame_dlci1_ua_ack, - .put_size = sizeof(cmux_frame_dlci1_ua_ack) -}; + .put_size = sizeof(cmux_frame_dlci1_ua_ack), + .next = &transaction_dlci1_msc}; const static struct modem_backend_mock_transaction transaction_dlci2_sabm = { .get = cmux_frame_dlci2_sabm_cmd, .get_size = sizeof(cmux_frame_dlci2_sabm_cmd), .put = cmux_frame_dlci2_ua_ack, - .put_size = sizeof(cmux_frame_dlci2_ua_ack) -}; + .put_size = sizeof(cmux_frame_dlci2_ua_ack), + .next = &transaction_dlci2_msc}; static void test_modem_cmux_callback(struct modem_cmux *cmux, enum modem_cmux_event event, void *user_data) @@ -317,6 +331,9 @@ static void *test_modem_cmux_setup(void) events = k_event_wait(&cmux_event, EVENT_CMUX_DLCI2_OPEN, false, K_MSEC(100)); __ASSERT_NO_MSG((events & EVENT_CMUX_DLCI2_OPEN)); + /* Consume the MSC command sent after DLCI opening */ + modem_backend_mock_wait_for_transaction(&bus_mock); + return NULL; } @@ -603,8 +620,8 @@ ZTEST(modem_cmux, test_modem_cmux_dlci1_close_open) zassert_true((events & EVENT_CMUX_DLCI1_OPEN), "DLCI1 not opened as expected"); - /* Wait for potential T1 timeout */ - k_msleep(500); + modem_backend_mock_prime(&bus_mock, &transaction_dlci1_msc); + modem_backend_mock_wait_for_transaction(&bus_mock); ret = modem_backend_mock_get(&bus_mock, buffer1, sizeof(buffer1)); zassert_true(ret == 0, "Received unexpected data"); @@ -705,6 +722,9 @@ ZTEST(modem_cmux, test_modem_cmux_disconnect_connect) zassert_true((events & EVENT_CMUX_DLCI1_OPEN), "DLCI1 not opened as expected"); + modem_backend_mock_prime(&bus_mock, &transaction_dlci1_msc); + modem_backend_mock_wait_for_transaction(&bus_mock); + /* Wait for potential T1 timeout */ k_msleep(500); @@ -730,8 +750,10 @@ ZTEST(modem_cmux, test_modem_cmux_disconnect_connect) events = k_event_wait_all(&cmux_event, (EVENT_CMUX_DLCI2_OPEN), false, K_MSEC(100)); - zassert_true((events & EVENT_CMUX_DLCI2_OPEN), - "DLCI1 not opened as expected"); + zassert_true((events & EVENT_CMUX_DLCI2_OPEN), "DLCI2 not opened as expected"); + + modem_backend_mock_prime(&bus_mock, &transaction_dlci2_msc); + modem_backend_mock_wait_for_transaction(&bus_mock); /* Wait for potential T1 timeout */ k_msleep(500); @@ -746,6 +768,10 @@ ZTEST(modem_cmux, test_modem_cmux_disconnect_connect_sync) zassert_true(modem_pipe_close(dlci1_pipe, K_SECONDS(10)) == 0, "Failed to close DLCI1"); modem_backend_mock_prime(&bus_mock, &transaction_dlci2_disc); zassert_true(modem_pipe_close(dlci2_pipe, K_SECONDS(10)) == 0, "Failed to close DLCI2"); + + /* Clear any pending data before CLD transaction */ + modem_backend_mock_reset(&bus_mock); + modem_backend_mock_prime(&bus_mock, &transaction_control_cld); zassert_true(modem_cmux_disconnect(&cmux) == 0, "Failed to disconnect CMUX"); zassert_true(modem_cmux_disconnect(&cmux) == -EALREADY, @@ -759,9 +785,11 @@ ZTEST(modem_cmux, test_modem_cmux_disconnect_connect_sync) modem_backend_mock_prime(&bus_mock, &transaction_dlci1_sabm); zassert_true(modem_pipe_open(dlci1_pipe, K_SECONDS(10)) == 0, "Failed to open DLCI1 pipe"); + modem_backend_mock_wait_for_transaction(&bus_mock); modem_backend_mock_prime(&bus_mock, &transaction_dlci2_sabm); zassert_true(modem_pipe_open(dlci2_pipe, K_SECONDS(10)) == 0, "Failed to open DLCI2 pipe"); + modem_backend_mock_wait_for_transaction(&bus_mock); } ZTEST(modem_cmux, test_modem_cmux_dlci_close_open_sync) @@ -773,9 +801,11 @@ ZTEST(modem_cmux, test_modem_cmux_dlci_close_open_sync) modem_backend_mock_prime(&bus_mock, &transaction_dlci1_sabm); zassert_true(modem_pipe_open(dlci1_pipe, K_SECONDS(10)) == 0, "Failed to open DLCI1 pipe"); + modem_backend_mock_wait_for_transaction(&bus_mock); modem_backend_mock_prime(&bus_mock, &transaction_dlci2_sabm); zassert_true(modem_pipe_open(dlci2_pipe, K_SECONDS(10)) == 0, "Failed to open DLCI2 pipe"); + modem_backend_mock_wait_for_transaction(&bus_mock); } ZTEST(modem_cmux, test_modem_cmux_prevent_work_while_released) @@ -820,10 +850,13 @@ ZTEST(modem_cmux, test_modem_cmux_prevent_work_while_released) zassert_ok(modem_cmux_attach(&cmux, bus_mock_pipe)); modem_backend_mock_prime(&bus_mock, &transaction_control_sabm); zassert_ok(modem_cmux_connect(&cmux)); + modem_backend_mock_wait_for_transaction(&bus_mock); modem_backend_mock_prime(&bus_mock, &transaction_dlci1_sabm); zassert_ok(modem_pipe_open(dlci1_pipe, K_SECONDS(10))); + modem_backend_mock_wait_for_transaction(&bus_mock); modem_backend_mock_prime(&bus_mock, &transaction_dlci2_sabm); zassert_ok(modem_pipe_open(dlci2_pipe, K_SECONDS(10))); + modem_backend_mock_wait_for_transaction(&bus_mock); } ZTEST(modem_cmux, test_modem_drop_frames_with_invalid_length) From 828ad64831cbaa3da85cc0154e8ccfdc28171c64 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Wed, 24 Sep 2025 13:31:38 +0300 Subject: [PATCH 0253/3334] [nrf fromtree] drivers: modem: Extract common dts bindings Extract common DTS bindings to zephyr,cellular-modem-device.yaml as these are referred in the modem_cellular.c in the MODEM_CELLULAR_DEFINE_INSTANCE() macro. Signed-off-by: Seppo Takalo (cherry picked from commit 4040a1e2b2a65c17164b3d09d847e85591e97fe5) --- dts/bindings/modem/nordic,nrf91-slm.yaml | 6 +----- dts/bindings/modem/quectel,bg95.yaml | 2 +- dts/bindings/modem/quectel,bg9x.yaml | 5 +---- dts/bindings/modem/quectel,eg25-g.yaml | 2 +- dts/bindings/modem/quectel,eg800q.yaml | 2 +- dts/bindings/modem/simcom,a76xx.yaml | 2 +- dts/bindings/modem/simcom,sim7080.yaml | 2 +- dts/bindings/modem/sqn,gm02s.yaml | 5 +---- dts/bindings/modem/swir,hl7800.yaml | 2 +- dts/bindings/modem/telit,me310g1.yaml | 2 +- dts/bindings/modem/telit,me910g1.yaml | 2 +- dts/bindings/modem/u-blox,lara-r6.yaml | 5 +---- dts/bindings/modem/u-blox,sara-r4.yaml | 5 +---- dts/bindings/modem/u-blox,sara-r5.yaml | 9 +-------- dts/bindings/modem/wnc,m14a2a.yaml | 2 +- .../modem/zephyr,cellular-modem-device.yaml | 19 +++++++++++++++++++ 16 files changed, 34 insertions(+), 38 deletions(-) create mode 100644 dts/bindings/modem/zephyr,cellular-modem-device.yaml diff --git a/dts/bindings/modem/nordic,nrf91-slm.yaml b/dts/bindings/modem/nordic,nrf91-slm.yaml index 3f06696197d2..11bf39018696 100644 --- a/dts/bindings/modem/nordic,nrf91-slm.yaml +++ b/dts/bindings/modem/nordic,nrf91-slm.yaml @@ -2,8 +2,4 @@ description: Nordic nRF91 series running the Serial LTE Modem application compatible: "nordic,nrf91-slm" -include: uart-device.yaml - -properties: - mdm-power-gpios: - type: phandle-array +include: zephyr,cellular-modem-device.yaml diff --git a/dts/bindings/modem/quectel,bg95.yaml b/dts/bindings/modem/quectel,bg95.yaml index 9b1f6c734be4..940cd41ea27e 100644 --- a/dts/bindings/modem/quectel,bg95.yaml +++ b/dts/bindings/modem/quectel,bg95.yaml @@ -5,7 +5,7 @@ description: Quectel BG95 modem compatible: "quectel,bg95" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/quectel,bg9x.yaml b/dts/bindings/modem/quectel,bg9x.yaml index 836df0ba36e5..41f32d0d4c26 100644 --- a/dts/bindings/modem/quectel,bg9x.yaml +++ b/dts/bindings/modem/quectel,bg9x.yaml @@ -5,16 +5,13 @@ description: quectel BG9x modem compatible: "quectel,bg9x" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: type: phandle-array required: true - mdm-reset-gpios: - type: phandle-array - mdm-dtr-gpios: type: phandle-array diff --git a/dts/bindings/modem/quectel,eg25-g.yaml b/dts/bindings/modem/quectel,eg25-g.yaml index 45284ddf174b..2e688e587dea 100644 --- a/dts/bindings/modem/quectel,eg25-g.yaml +++ b/dts/bindings/modem/quectel,eg25-g.yaml @@ -2,7 +2,7 @@ description: Quectel EG25-G modem compatible: "quectel,eg25-g" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-reset-gpios: diff --git a/dts/bindings/modem/quectel,eg800q.yaml b/dts/bindings/modem/quectel,eg800q.yaml index 80c591b90350..6b86456bcc91 100644 --- a/dts/bindings/modem/quectel,eg800q.yaml +++ b/dts/bindings/modem/quectel,eg800q.yaml @@ -2,7 +2,7 @@ description: Quectel EG800Q modem compatible: "quectel,eg800q" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/simcom,a76xx.yaml b/dts/bindings/modem/simcom,a76xx.yaml index 586b356de474..428977b42a13 100644 --- a/dts/bindings/modem/simcom,a76xx.yaml +++ b/dts/bindings/modem/simcom,a76xx.yaml @@ -5,7 +5,7 @@ description: Simcom A76XX modem compatible: "simcom,a76xx" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/simcom,sim7080.yaml b/dts/bindings/modem/simcom,sim7080.yaml index 952ce6b514b6..deb5a0ec4dd6 100644 --- a/dts/bindings/modem/simcom,sim7080.yaml +++ b/dts/bindings/modem/simcom,sim7080.yaml @@ -5,7 +5,7 @@ description: Simcom Sim7080 modem compatible: "simcom,sim7080" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/sqn,gm02s.yaml b/dts/bindings/modem/sqn,gm02s.yaml index 584fc878e18d..4875f6dcc471 100644 --- a/dts/bindings/modem/sqn,gm02s.yaml +++ b/dts/bindings/modem/sqn,gm02s.yaml @@ -5,12 +5,9 @@ description: Sequans Monarch 2 GM02S Modem compatible: "sqn,gm02s" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-reset-gpios: type: phandle-array required: true - - mdm-wake-gpios: - type: phandle-array diff --git a/dts/bindings/modem/swir,hl7800.yaml b/dts/bindings/modem/swir,hl7800.yaml index b937031455ff..3daf4b383d38 100644 --- a/dts/bindings/modem/swir,hl7800.yaml +++ b/dts/bindings/modem/swir,hl7800.yaml @@ -8,7 +8,7 @@ description: Sierra Wireless HL7800 Modem compatible: "swir,hl7800" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-wake-gpios: diff --git a/dts/bindings/modem/telit,me310g1.yaml b/dts/bindings/modem/telit,me310g1.yaml index 2ee36fce5958..ff354dcc2951 100644 --- a/dts/bindings/modem/telit,me310g1.yaml +++ b/dts/bindings/modem/telit,me310g1.yaml @@ -2,7 +2,7 @@ description: Telit ME310G1 Modem compatible: "telit,me310g1" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/telit,me910g1.yaml b/dts/bindings/modem/telit,me910g1.yaml index 2599b6cd237d..5ffa10af0347 100644 --- a/dts/bindings/modem/telit,me910g1.yaml +++ b/dts/bindings/modem/telit,me910g1.yaml @@ -5,7 +5,7 @@ description: Telit ME910G1 Modem compatible: "telit,me910g1" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/u-blox,lara-r6.yaml b/dts/bindings/modem/u-blox,lara-r6.yaml index 89e02d86dba1..12c802391e6b 100644 --- a/dts/bindings/modem/u-blox,lara-r6.yaml +++ b/dts/bindings/modem/u-blox,lara-r6.yaml @@ -5,12 +5,9 @@ description: u-blox LARA-R6 modem compatible: "u-blox,lara-r6" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: type: phandle-array required: true - - mdm-reset-gpios: - type: phandle-array diff --git a/dts/bindings/modem/u-blox,sara-r4.yaml b/dts/bindings/modem/u-blox,sara-r4.yaml index f24bc57e0a74..c9ec63dc7381 100644 --- a/dts/bindings/modem/u-blox,sara-r4.yaml +++ b/dts/bindings/modem/u-blox,sara-r4.yaml @@ -5,15 +5,12 @@ description: u-blox SARA-R4 modem compatible: "u-blox,sara-r4" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-power-gpios: type: phandle-array required: true - mdm-reset-gpios: - type: phandle-array - mdm-vint-gpios: type: phandle-array diff --git a/dts/bindings/modem/u-blox,sara-r5.yaml b/dts/bindings/modem/u-blox,sara-r5.yaml index af6c3318fd07..40e846fd4eae 100644 --- a/dts/bindings/modem/u-blox,sara-r5.yaml +++ b/dts/bindings/modem/u-blox,sara-r5.yaml @@ -5,11 +5,4 @@ description: u-blox SARA-R5 modem compatible: "u-blox,sara-r5" -include: uart-device.yaml - -properties: - mdm-power-gpios: - type: phandle-array - - mdm-reset-gpios: - type: phandle-array +include: zephyr,cellular-modem-device.yaml diff --git a/dts/bindings/modem/wnc,m14a2a.yaml b/dts/bindings/modem/wnc,m14a2a.yaml index db00b6fbeb64..71f9d2775938 100644 --- a/dts/bindings/modem/wnc,m14a2a.yaml +++ b/dts/bindings/modem/wnc,m14a2a.yaml @@ -5,7 +5,7 @@ description: WNC-M14A2A LTE-M modem compatible: "wnc,m14a2a" -include: uart-device.yaml +include: zephyr,cellular-modem-device.yaml properties: mdm-boot-mode-sel-gpios: diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml new file mode 100644 index 000000000000..bff39d7f9f61 --- /dev/null +++ b/dts/bindings/modem/zephyr,cellular-modem-device.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Common properties for Zephyr cellular modems + +include: uart-device.yaml + +properties: + mdm-power-gpios: + type: phandle-array + description: GPIO for modem power control + + mdm-reset-gpios: + type: phandle-array + description: GPIO for modem reset + + mdm-wake-gpios: + type: phandle-array + description: GPIO for modem wake From 8cbcadb5405d3657ed75ff8bb6a9492f7cbbbca9 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 16 Sep 2025 14:58:27 +0200 Subject: [PATCH 0254/3334] [nrf fromtree] doc: release-notes-4.3: Mention the backlog support for listen() Add a note that the backlog parameter of the listen() function is now respected and the backlog support has been implemented for the TCP server. Signed-off-by: Robert Lubos (cherry picked from commit 77c348a9de34986998f062e3a0955a1bf3732e6c) --- doc/releases/release-notes-4.3.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index 6dfc304b3ef5..43b217ae205c 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -171,6 +171,13 @@ New APIs and options * :kconfig:option:`CONFIG_HAWKBIT_REBOOT_NONE` +* Networking + + * Sockets + + * :c:func:`zsock_listen` now implements the ``backlog`` parameter support. The TCP server + socket will limit the number of pending incoming connections to that value. + * Power management * :c:func:`pm_device_driver_deinit` From ce9e6624fd62d16f8972aa57bbe9eed7218ea0f6 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 2 Oct 2025 20:33:36 +1000 Subject: [PATCH 0255/3334] [nrf fromtree] modem: optional dedicated workqueue Add the option to use a dedicated workqueue for the modem backend instead of the system workqueue. Signed-off-by: Jordan Yates (cherry picked from commit 761961fa28a536edfb72a1f60eba1078b4a5e3f3) --- doc/releases/release-notes-4.3.rst | 4 ++ subsys/modem/CMakeLists.txt | 1 + subsys/modem/Kconfig | 15 ++++++ .../modem/backends/modem_backend_uart_async.c | 11 +++-- .../backends/modem_backend_uart_async_hwfc.c | 13 ++--- .../modem/backends/modem_backend_uart_isr.c | 9 ++-- subsys/modem/modem_chat.c | 18 ++++--- subsys/modem/modem_cmux.c | 26 +++++----- subsys/modem/modem_ppp.c | 10 ++-- subsys/modem/modem_ubx.c | 4 +- subsys/modem/modem_workqueue.c | 39 +++++++++++++++ subsys/modem/modem_workqueue.h | 49 +++++++++++++++++++ 12 files changed, 159 insertions(+), 40 deletions(-) create mode 100644 subsys/modem/modem_workqueue.c create mode 100644 subsys/modem/modem_workqueue.h diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index 43b217ae205c..718e4ad3ba33 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -171,6 +171,10 @@ New APIs and options * :kconfig:option:`CONFIG_HAWKBIT_REBOOT_NONE` +* Modem + + * :kconfig:option:`CONFIG_MODEM_DEDICATED_WORKQUEUE` + * Networking * Sockets diff --git a/subsys/modem/CMakeLists.txt b/subsys/modem/CMakeLists.txt index c374bcab9cff..a1db3ab90361 100644 --- a/subsys/modem/CMakeLists.txt +++ b/subsys/modem/CMakeLists.txt @@ -5,6 +5,7 @@ if(CONFIG_MODEM_MODULES) zephyr_library() +zephyr_library_sources_ifdef(CONFIG_MODEM_DEDICATED_WORKQUEUE modem_workqueue.c) zephyr_library_sources_ifdef(CONFIG_MODEM_CHAT modem_chat.c) zephyr_library_sources_ifdef(CONFIG_MODEM_CMUX modem_cmux.c) zephyr_library_sources_ifdef(CONFIG_MODEM_PIPE modem_pipe.c) diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index 34114cd3893b..dfcb7ddae9a3 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -6,6 +6,21 @@ menuconfig MODEM_MODULES if MODEM_MODULES +config MODEM_DEDICATED_WORKQUEUE + bool "Use a dedicated workqueue for modem operations" + +if MODEM_DEDICATED_WORKQUEUE + +config MODEM_DEDICATED_WORKQUEUE_STACK_SIZE + int "Modem dedicated workqueue stack size" + default 1024 + +config MODEM_DEDICATED_WORKQUEUE_PRIORITY + int "Modem dedicated workqueue priority" + default SYSTEM_WORKQUEUE_PRIORITY + +endif # MODEM_DEDICATED_WORKQUEUE + config MODEM_CHAT bool "Modem chat module" select RING_BUFFER diff --git a/subsys/modem/backends/modem_backend_uart_async.c b/subsys/modem/backends/modem_backend_uart_async.c index d96f513d6061..9b5edc8965c5 100644 --- a/subsys/modem/backends/modem_backend_uart_async.c +++ b/subsys/modem/backends/modem_backend_uart_async.c @@ -5,6 +5,7 @@ */ #include "modem_backend_uart_async.h" +#include "../modem_workqueue.h" #include LOG_MODULE_REGISTER(modem_backend_uart_async, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -58,7 +59,7 @@ static void modem_backend_uart_async_event_handler(const struct device *dev, case UART_TX_DONE: atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_TRANSMITTING_BIT); - k_work_submit(&backend->transmit_idle_work); + modem_work_submit(&backend->transmit_idle_work); break; case UART_TX_ABORTED: @@ -67,7 +68,7 @@ static void modem_backend_uart_async_event_handler(const struct device *dev, } atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_TRANSMITTING_BIT); - k_work_submit(&backend->transmit_idle_work); + modem_work_submit(&backend->transmit_idle_work); break; @@ -127,7 +128,7 @@ static void modem_backend_uart_async_event_handler(const struct device *dev, } k_spin_unlock(&backend->async.receive_rb_lock, key); - k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); break; case UART_RX_DISABLED: @@ -144,7 +145,7 @@ static void modem_backend_uart_async_event_handler(const struct device *dev, } if (modem_backend_uart_async_is_uart_stopped(backend)) { - k_work_submit(&backend->async.common.rx_disabled_work); + modem_work_submit(&backend->async.common.rx_disabled_work); } } @@ -254,7 +255,7 @@ static int modem_backend_uart_async_receive(void *data, uint8_t *buf, size_t siz k_spin_unlock(&backend->async.receive_rb_lock, key); if (!empty) { - k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); } return (int)received; diff --git a/subsys/modem/backends/modem_backend_uart_async_hwfc.c b/subsys/modem/backends/modem_backend_uart_async_hwfc.c index 78855daa4eb3..61d307604e5c 100644 --- a/subsys/modem/backends/modem_backend_uart_async_hwfc.c +++ b/subsys/modem/backends/modem_backend_uart_async_hwfc.c @@ -5,6 +5,7 @@ */ #include "modem_backend_uart_async.h" +#include "../modem_workqueue.h" #include LOG_MODULE_REGISTER(modem_backend_uart_async_hwfc, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -136,7 +137,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev case UART_TX_DONE: atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_TRANSMIT_BIT); - k_work_submit(&backend->transmit_idle_work); + modem_work_submit(&backend->transmit_idle_work); break; case UART_TX_ABORTED: @@ -145,7 +146,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev } atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_TRANSMIT_BIT); - k_work_submit(&backend->transmit_idle_work); + modem_work_submit(&backend->transmit_idle_work); break; @@ -182,7 +183,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev rx_buf_unref(&backend->async, evt->data.rx.buf); break; } - k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); } break; @@ -191,7 +192,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT)) { if (!atomic_test_and_set_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_RECOVERY_BIT)) { - k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); LOG_DBG("RX recovery started"); } } @@ -206,7 +207,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev } if (modem_backend_uart_async_hwfc_is_uart_stopped(backend)) { - k_work_submit(&backend->async.common.rx_disabled_work); + modem_work_submit(&backend->async.common.rx_disabled_work); } } @@ -335,7 +336,7 @@ static int modem_backend_uart_async_hwfc_receive(void *data, uint8_t *buf, size_ if (backend->async.rx_event.len != 0 || k_msgq_num_used_get(&backend->async.rx_queue) != 0) { - k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); } modem_backend_uart_async_hwfc_rx_recovery(backend); diff --git a/subsys/modem/backends/modem_backend_uart_isr.c b/subsys/modem/backends/modem_backend_uart_isr.c index a9266cc86657..6c6c27c2db2e 100644 --- a/subsys/modem/backends/modem_backend_uart_isr.c +++ b/subsys/modem/backends/modem_backend_uart_isr.c @@ -5,6 +5,7 @@ */ #include "modem_backend_uart_isr.h" +#include "../modem_workqueue.h" #include LOG_MODULE_REGISTER(modem_backend_uart_isr, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -54,11 +55,11 @@ static void modem_backend_uart_isr_irq_handler_receive_ready(struct modem_backen * It temporarily disables the UART RX IRQ when swapping buffers * which can cause byte loss at higher baud rates. */ - k_work_schedule(&backend->receive_ready_work, - K_MSEC(CONFIG_MODEM_BACKEND_UART_ISR_RECEIVE_IDLE_TIMEOUT_MS)); + modem_work_schedule(&backend->receive_ready_work, + K_MSEC(CONFIG_MODEM_BACKEND_UART_ISR_RECEIVE_IDLE_TIMEOUT_MS)); } else { /* The buffer is getting full. Run the work item immediately to free up space. */ - k_work_reschedule(&backend->receive_ready_work, K_NO_WAIT); + modem_work_reschedule(&backend->receive_ready_work, K_NO_WAIT); } } @@ -70,7 +71,7 @@ static void modem_backend_uart_isr_irq_handler_transmit_ready(struct modem_backe if (ring_buf_is_empty(&backend->isr.transmit_rb) == true) { uart_irq_tx_disable(backend->uart); - k_work_submit(&backend->transmit_idle_work); + modem_work_submit(&backend->transmit_idle_work); return; } diff --git a/subsys/modem/modem_chat.c b/subsys/modem/modem_chat.c index 088a2bc038dc..001be1c7e707 100644 --- a/subsys/modem/modem_chat.c +++ b/subsys/modem/modem_chat.c @@ -15,6 +15,8 @@ LOG_MODULE_REGISTER(modem_chat, CONFIG_MODEM_MODULES_LOG_LEVEL); #include +#include "modem_workqueue.h" + const struct modem_chat_match modem_chat_any_match = MODEM_CHAT_MATCH("", "", NULL); const struct modem_chat_match modem_chat_empty_matches[0]; const struct modem_chat_script_chat modem_chat_empty_script_chats[0]; @@ -127,7 +129,7 @@ static void modem_chat_set_script_send_state(struct modem_chat *chat, static void modem_chat_script_send(struct modem_chat *chat) { modem_chat_set_script_send_state(chat, MODEM_CHAT_SCRIPT_SEND_STATE_REQUEST); - k_work_submit(&chat->script_send_work); + modem_work_submit(&chat->script_send_work); } static void modem_chat_script_set_response_matches(struct modem_chat *chat) @@ -178,7 +180,7 @@ static void modem_chat_script_chat_schedule_send_timeout(struct modem_chat *chat { uint16_t timeout = modem_chat_script_chat_get_send_timeout(chat); - k_work_schedule(&chat->script_send_timeout_work, K_MSEC(timeout)); + modem_work_schedule(&chat->script_send_timeout_work, K_MSEC(timeout)); } static void modem_chat_script_next(struct modem_chat *chat, bool initial) @@ -233,7 +235,7 @@ static void modem_chat_script_start(struct modem_chat *chat, const struct modem_ /* Start timeout work if script started */ if (chat->script != NULL) { - k_work_schedule(&chat->script_timeout_work, K_SECONDS(chat->script->timeout)); + modem_work_schedule(&chat->script_timeout_work, K_SECONDS(chat->script->timeout)); } } @@ -742,7 +744,7 @@ static void modem_chat_process_handler(struct k_work *item) /* Process data */ modem_chat_process_bytes(chat); - k_work_submit(&chat->receive_work); + modem_work_submit(&chat->receive_work); } static void modem_chat_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_event event, @@ -752,11 +754,11 @@ static void modem_chat_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_ev switch (event) { case MODEM_PIPE_EVENT_RECEIVE_READY: - k_work_submit(&chat->receive_work); + modem_work_submit(&chat->receive_work); break; case MODEM_PIPE_EVENT_TRANSMIT_IDLE: - k_work_submit(&chat->script_send_work); + modem_work_submit(&chat->script_send_work); break; default: @@ -880,7 +882,7 @@ int modem_chat_run_script_async(struct modem_chat *chat, const struct modem_chat k_sem_reset(&chat->script_stopped_sem); chat->pending_script = script; - k_work_submit(&chat->script_run_work); + modem_work_submit(&chat->script_run_work); return 0; } @@ -903,7 +905,7 @@ int modem_chat_run_script(struct modem_chat *chat, const struct modem_chat_scrip void modem_chat_script_abort(struct modem_chat *chat) { - k_work_submit(&chat->script_abort_work); + modem_work_submit(&chat->script_abort_work); } void modem_chat_release(struct modem_chat *chat) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index b311ab7865d9..fb0b04aa6469 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -13,6 +13,8 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #include +#include "modem_workqueue.h" + #define MODEM_CMUX_SOF (0xF9) #define MODEM_CMUX_FCS_POLYNOMIAL (0xE0) #define MODEM_CMUX_FCS_INIT_VALUE (0xFF) @@ -347,11 +349,11 @@ static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_eve switch (event) { case MODEM_PIPE_EVENT_RECEIVE_READY: - k_work_schedule(&cmux->receive_work, K_NO_WAIT); + modem_work_schedule(&cmux->receive_work, K_NO_WAIT); break; case MODEM_PIPE_EVENT_TRANSMIT_IDLE: - k_work_schedule(&cmux->transmit_work, K_NO_WAIT); + modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); break; default: @@ -411,7 +413,7 @@ static uint16_t modem_cmux_transmit_frame(struct modem_cmux *cmux, buf[0] = fcs; buf[1] = MODEM_CMUX_SOF; ring_buf_put(&cmux->transmit_rb, buf, 2); - k_work_schedule(&cmux->transmit_work, K_NO_WAIT); + modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); return data_len; } @@ -1222,7 +1224,7 @@ static void modem_cmux_receive_handler(struct k_work *item) } /* Reschedule received work */ - k_work_schedule(&cmux->receive_work, K_NO_WAIT); + modem_work_schedule(&cmux->receive_work, K_NO_WAIT); } static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) @@ -1312,7 +1314,7 @@ static void modem_cmux_connect_handler(struct k_work *item) }; modem_cmux_transmit_cmd_frame(cmux, &frame); - k_work_schedule(&cmux->connect_work, MODEM_CMUX_T1_TIMEOUT); + modem_work_schedule(&cmux->connect_work, MODEM_CMUX_T1_TIMEOUT); } static void modem_cmux_disconnect_handler(struct k_work *item) @@ -1347,7 +1349,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) /* Transmit close down command */ modem_cmux_transmit_cmd_frame(cmux, &frame); - k_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); + modem_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); } #if CONFIG_MODEM_STATS @@ -1397,7 +1399,7 @@ static int modem_cmux_dlci_pipe_api_open(void *data) K_SPINLOCK_BREAK; } - k_work_schedule(&dlci->open_work, K_NO_WAIT); + modem_work_schedule(&dlci->open_work, K_NO_WAIT); } return ret; @@ -1476,7 +1478,7 @@ static int modem_cmux_dlci_pipe_api_close(void *data) K_SPINLOCK_BREAK; } - k_work_schedule(&dlci->close_work, K_NO_WAIT); + modem_work_schedule(&dlci->close_work, K_NO_WAIT); } return ret; @@ -1514,7 +1516,7 @@ static void modem_cmux_dlci_open_handler(struct k_work *item) }; modem_cmux_transmit_cmd_frame(dlci->cmux, &frame); - k_work_schedule(&dlci->open_work, MODEM_CMUX_T1_TIMEOUT); + modem_work_schedule(&dlci->open_work, MODEM_CMUX_T1_TIMEOUT); } static void modem_cmux_dlci_close_handler(struct k_work *item) @@ -1543,7 +1545,7 @@ static void modem_cmux_dlci_close_handler(struct k_work *item) }; modem_cmux_transmit_cmd_frame(cmux, &frame); - k_work_schedule(&dlci->close_work, MODEM_CMUX_T1_TIMEOUT); + modem_work_schedule(&dlci->close_work, MODEM_CMUX_T1_TIMEOUT); } static void modem_cmux_dlci_pipes_release(struct modem_cmux *cmux) @@ -1666,7 +1668,7 @@ int modem_cmux_connect_async(struct modem_cmux *cmux) } if (k_work_delayable_is_pending(&cmux->connect_work) == false) { - k_work_schedule(&cmux->connect_work, K_NO_WAIT); + modem_work_schedule(&cmux->connect_work, K_NO_WAIT); } } @@ -1704,7 +1706,7 @@ int modem_cmux_disconnect_async(struct modem_cmux *cmux) } if (k_work_delayable_is_pending(&cmux->disconnect_work) == false) { - k_work_schedule(&cmux->disconnect_work, K_NO_WAIT); + modem_work_schedule(&cmux->disconnect_work, K_NO_WAIT); } } diff --git a/subsys/modem/modem_ppp.c b/subsys/modem/modem_ppp.c index cd13d4ac8b1a..09b62bdaa11e 100644 --- a/subsys/modem/modem_ppp.c +++ b/subsys/modem/modem_ppp.c @@ -10,6 +10,8 @@ #include #include +#include "modem_workqueue.h" + #include LOG_MODULE_REGISTER(modem_ppp, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -327,12 +329,12 @@ static void modem_ppp_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_eve switch (event) { case MODEM_PIPE_EVENT_RECEIVE_READY: - k_work_submit(&ppp->process_work); + modem_work_submit(&ppp->process_work); break; case MODEM_PIPE_EVENT_OPENED: case MODEM_PIPE_EVENT_TRANSMIT_IDLE: - k_work_submit(&ppp->send_work); + modem_work_submit(&ppp->send_work); break; default: @@ -415,7 +417,7 @@ static void modem_ppp_process_handler(struct k_work *item) modem_ppp_process_received_byte(ppp, ppp->receive_buf[i]); } - k_work_submit(&ppp->process_work); + modem_work_submit(&ppp->process_work); } static void modem_ppp_ppp_api_init(struct net_if *iface) @@ -478,7 +480,7 @@ static int modem_ppp_ppp_api_send(const struct device *dev, struct net_pkt *pkt) net_pkt_ref(pkt); k_fifo_put(&ppp->tx_pkt_fifo, pkt); - k_work_submit(&ppp->send_work); + modem_work_submit(&ppp->send_work); return 0; } diff --git a/subsys/modem/modem_ubx.c b/subsys/modem/modem_ubx.c index 22586b8444d0..89d968caf799 100644 --- a/subsys/modem/modem_ubx.c +++ b/subsys/modem/modem_ubx.c @@ -9,6 +9,8 @@ #include #include +#include "modem_workqueue.h" + #include LOG_MODULE_REGISTER(modem_ubx, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -19,7 +21,7 @@ static void modem_ubx_pipe_callback(struct modem_pipe *pipe, struct modem_ubx *ubx = (struct modem_ubx *)user_data; if (event == MODEM_PIPE_EVENT_RECEIVE_READY) { - k_work_submit(&ubx->process_work); + modem_work_submit(&ubx->process_work); } } diff --git a/subsys/modem/modem_workqueue.c b/subsys/modem/modem_workqueue.c new file mode 100644 index 000000000000..4fb5d716c5c7 --- /dev/null +++ b/subsys/modem/modem_workqueue.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2025 Embeint Pty Ltd + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include "modem_workqueue.h" + +static struct k_work_q modem_work_q; +static K_THREAD_STACK_DEFINE(modem_stack_area, CONFIG_MODEM_DEDICATED_WORKQUEUE_STACK_SIZE); + +int modem_work_submit(struct k_work *work) +{ + return k_work_submit_to_queue(&modem_work_q, work); +} + +int modem_work_schedule(struct k_work_delayable *dwork, k_timeout_t delay) +{ + return k_work_schedule_for_queue(&modem_work_q, dwork, delay); +} + +int modem_work_reschedule(struct k_work_delayable *dwork, k_timeout_t delay) +{ + return k_work_reschedule_for_queue(&modem_work_q, dwork, delay); +} + +static int modem_work_q_init(void) +{ + /* Boot the dedicated workqueue */ + k_work_queue_init(&modem_work_q); + k_work_queue_start(&modem_work_q, modem_stack_area, K_THREAD_STACK_SIZEOF(modem_stack_area), + CONFIG_MODEM_DEDICATED_WORKQUEUE_PRIORITY, NULL); + k_thread_name_set(k_work_queue_thread_get(&modem_work_q), "modem_workq"); + return 0; +} + +SYS_INIT(modem_work_q_init, POST_KERNEL, 0); diff --git a/subsys/modem/modem_workqueue.h b/subsys/modem/modem_workqueue.h new file mode 100644 index 000000000000..d906ed2e00f0 --- /dev/null +++ b/subsys/modem/modem_workqueue.h @@ -0,0 +1,49 @@ +/** @file + * @brief Modem workqueue header file. + */ + +/* + * Copyright (c) 2025 Embeint Pty Ltd + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_MODEM_WORKQUEUE_H_ +#define ZEPHYR_INCLUDE_MODEM_WORKQUEUE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef CONFIG_MODEM_DEDICATED_WORKQUEUE + +int modem_work_submit(struct k_work *work); +int modem_work_schedule(struct k_work_delayable *dwork, k_timeout_t delay); +int modem_work_reschedule(struct k_work_delayable *dwork, k_timeout_t delay); + +#else + +static inline int modem_work_submit(struct k_work *work) +{ + return k_work_submit(work); +} + +static inline int modem_work_schedule(struct k_work_delayable *dwork, k_timeout_t delay) +{ + return k_work_schedule(dwork, delay); +} + +static inline int modem_work_reschedule(struct k_work_delayable *dwork, k_timeout_t delay) +{ + return k_work_reschedule(dwork, delay); +} + +#endif /* CONFIG_MODEM_DEDICATED_WORKQUEUE */ + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_MODEM_WORKQUEUE_H_ */ From 66e2865edb8ecbf67d1651fdb916463454eb4d78 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 21 Oct 2025 16:55:43 +0300 Subject: [PATCH 0256/3334] [nrf fromlist] modem: cmux: Define encoding and decoding functions for commands Instead of relying non-standard compiler behavior, define encode and decode functions for all CMUX command structures. Final command is encoded into a shared buffer, because it is always copied directly to TX ringbuffer. Added also functions to validate commands. Upstream PR #: 98009 Signed-off-by: Seppo Takalo (cherry picked from commit 78d68c1f42ea657e5f3c3e23624e25fc2fc4a20e) --- subsys/modem/modem_cmux.c | 314 +++++++++++++++++------ tests/subsys/modem/modem_cmux/src/main.c | 19 ++ 2 files changed, 250 insertions(+), 83 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index fb0b04aa6469..3bebde19d462 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -30,7 +30,8 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); * * PN would be 10 bytes, but that is not implemented */ -#define MODEM_CMUX_CMD_DATA_SIZE_MAX 5 +#define MODEM_CMUX_CMD_DATA_SIZE_MAX 5 /* Max size of information field of UIH frame */ +#define MODEM_CMUX_CMD_HEADER_SIZE 2 /* command type + length */ #define MODEM_CMUX_CMD_FRAME_SIZE_MAX (MODEM_CMUX_HEADER_SIZE + \ MODEM_CMUX_CMD_DATA_SIZE_MAX) @@ -80,7 +81,7 @@ struct modem_cmux_command_length { struct modem_cmux_command { struct modem_cmux_command_type type; struct modem_cmux_command_length length; - uint8_t value[]; + uint8_t value[MODEM_CMUX_CMD_DATA_SIZE_MAX - 2]; /* Subtract type and length bytes */ }; struct modem_cmux_msc_signals { @@ -98,53 +99,182 @@ struct modem_cmux_msc_addr { uint8_t dlci_address: 6; /**< DLCI channel address */ }; -struct modem_cmux_command_msc { - struct modem_cmux_command command; - uint8_t value[2]; -}; - static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address); static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux); -static int modem_cmux_wrap_command(struct modem_cmux_command **command, const uint8_t *data, - uint16_t data_len) +static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) +{ + cmux->state = state; + k_event_set(&cmux->event, BIT(state)); +} + +static bool wait_state(struct modem_cmux *cmux, enum modem_cmux_state state, k_timeout_t timeout) +{ + return k_event_wait(&cmux->event, BIT(state), false, timeout) == BIT(state); +} + +static bool is_connected(struct modem_cmux *cmux) { - if ((data == NULL) || (data_len < 2)) { - return -EINVAL; + return cmux->state == MODEM_CMUX_STATE_CONNECTED; +} + +static bool modem_cmux_command_type_is_valid(const struct modem_cmux_command_type type) +{ + /* All commands are only 7 bits, so EA is always set */ + if (type.ea == 0) { + return false; + } + switch (type.value) { + case MODEM_CMUX_COMMAND_NSC: + case MODEM_CMUX_COMMAND_TEST: + case MODEM_CMUX_COMMAND_PSC: + case MODEM_CMUX_COMMAND_RLS: + case MODEM_CMUX_COMMAND_FCOFF: + case MODEM_CMUX_COMMAND_PN: + case MODEM_CMUX_COMMAND_RPN: + case MODEM_CMUX_COMMAND_FCON: + case MODEM_CMUX_COMMAND_CLD: + case MODEM_CMUX_COMMAND_SNC: + case MODEM_CMUX_COMMAND_MSC: + return true; + default: + return false; } +} - (*command) = (struct modem_cmux_command *)data; +static bool modem_cmux_command_length_is_valid(const struct modem_cmux_command_length length) +{ + /* All commands are shorter than 127 bytes, so EA is always set */ + if (length.ea == 0) { + return false; + } + if (length.value > (MODEM_CMUX_CMD_DATA_SIZE_MAX - MODEM_CMUX_CMD_HEADER_SIZE)) { + return false; + } + return true; +} - if (((*command)->length.ea == 0) || ((*command)->type.ea == 0)) { - return -EINVAL; +static bool modem_cmux_command_is_valid(const struct modem_cmux_command *command) +{ + if (!modem_cmux_command_type_is_valid(command->type)) { + return false; + } + if (!modem_cmux_command_length_is_valid(command->length)) { + return false; + } + /* Verify known value sizes as specified in 3GPP TS 27.010 + * section 5.4.6.3 Message Type and Actions + */ + switch (command->type.value) { + case MODEM_CMUX_COMMAND_PN: + return command->length.value == 8; + case MODEM_CMUX_COMMAND_TEST: + return (command->length.value > 0 && + command->length.value <= MODEM_CMUX_CMD_DATA_SIZE_MAX - 2); + case MODEM_CMUX_COMMAND_MSC: + return command->length.value == 2 || command->length.value == 3; + case MODEM_CMUX_COMMAND_NSC: + return command->length.value == 1; + case MODEM_CMUX_COMMAND_RPN: + return command->length.value == 1 || command->length.value == 8; + case MODEM_CMUX_COMMAND_RLS: + return command->length.value == 2; + case MODEM_CMUX_COMMAND_SNC: + return command->length.value == 1 || command->length.value == 3; + default: + return command->length.value == 0; } +} - if ((*command)->length.value != (data_len - 2)) { - return -EINVAL; +static struct modem_cmux_command_type modem_cmux_command_type_decode(const uint8_t byte) +{ + struct modem_cmux_command_type type = { + .ea = (byte & MODEM_CMUX_EA) ? 1 : 0, + .cr = (byte & MODEM_CMUX_CR) ? 1 : 0, + .value = (byte >> 2) & 0x3F, + }; + + if (type.ea == 0) { + return (struct modem_cmux_command_type){0}; } - return 0; + return type; } -static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) +static uint8_t modem_cmux_command_type_encode(const struct modem_cmux_command_type type) { - cmux->state = state; - k_event_set(&cmux->event, BIT(state)); + return (type.ea ? MODEM_CMUX_EA : 0) | + (type.cr ? MODEM_CMUX_CR : 0) | + ((type.value & 0x3F) << 2); } -static bool wait_state(struct modem_cmux *cmux, enum modem_cmux_state state, k_timeout_t timeout) +static struct modem_cmux_command_length modem_cmux_command_length_decode(const uint8_t byte) { - return k_event_wait(&cmux->event, BIT(state), false, timeout) == BIT(state); + struct modem_cmux_command_length length = { + .ea = (byte & MODEM_CMUX_EA) ? 1 : 0, + .value = (byte >> 1) & 0x7F, + }; + + if (length.ea == 0) { + return (struct modem_cmux_command_length){0}; + } + + return length; } -static bool is_connected(struct modem_cmux *cmux) +static uint8_t modem_cmux_command_length_encode(const struct modem_cmux_command_length length) { - return cmux->state == MODEM_CMUX_STATE_CONNECTED; + return (length.ea ? MODEM_CMUX_EA : 0) | + ((length.value & 0x7F) << 1); +} + +static struct modem_cmux_command modem_cmux_command_decode(const uint8_t *data, size_t len) +{ + if (len < 2) { + return (struct modem_cmux_command){0}; + } + + struct modem_cmux_command command = { + .type = modem_cmux_command_type_decode(data[0]), + .length = modem_cmux_command_length_decode(data[1]), + }; + + if (command.type.ea == 0 || command.length.ea == 0 || + command.length.value > MODEM_CMUX_CMD_DATA_SIZE_MAX || + (2 + command.length.value) > len) { + return (struct modem_cmux_command){0}; + } + + memcpy(&command.value[0], &data[2], command.length.value); + + return command; } -static struct modem_cmux_command *modem_cmux_command_wrap(const uint8_t *data) +/** + * @brief Encode command into a shared buffer + * + * Not a thread safe, so can only be used within a workqueue context and data + * must be copied out to a TX ringbuffer. + * + * @param command command to encode + * @param len encoded length of the command is written here + * @return pointer to encoded command buffer on success, NULL on failure + */ +static uint8_t *modem_cmux_command_encode(struct modem_cmux_command *command, uint16_t *len) { - return (struct modem_cmux_command *)data; + static uint8_t buf[MODEM_CMUX_CMD_DATA_SIZE_MAX]; + + __ASSERT_NO_MSG(len != NULL); + __ASSERT_NO_MSG(command != NULL); + __ASSERT_NO_MSG(modem_cmux_command_is_valid(command)); + + buf[0] = modem_cmux_command_type_encode(command->type); + buf[1] = modem_cmux_command_length_encode(command->length); + if (command->length.value > 0) { + memcpy(&buf[2], &command->value[0], command->length.value); + } + *len = 2 + command->length.value; + return buf; } static struct modem_cmux_msc_signals modem_cmux_msc_signals_decode(const uint8_t byte) @@ -421,7 +551,7 @@ static bool modem_cmux_transmit_cmd_frame(struct modem_cmux *cmux, const struct modem_cmux_frame *frame) { uint16_t space; - struct modem_cmux_command *command; + struct modem_cmux_command command; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); space = ring_buf_space_get(&cmux->transmit_rb); @@ -433,8 +563,9 @@ static bool modem_cmux_transmit_cmd_frame(struct modem_cmux *cmux, } modem_cmux_log_transmit_frame(frame); - if (modem_cmux_wrap_command(&command, frame->data, frame->data_len) == 0) { - modem_cmux_log_transmit_command(command); + command = modem_cmux_command_decode(frame->data, frame->data_len); + if (modem_cmux_command_is_valid(&command)) { + modem_cmux_log_transmit_command(&command); } modem_cmux_transmit_frame(cmux, frame); @@ -477,7 +608,7 @@ static int16_t modem_cmux_transmit_data_frame(struct modem_cmux *cmux, static void modem_cmux_acknowledge_received_frame(struct modem_cmux *cmux) { - struct modem_cmux_command *command; + struct modem_cmux_command_type command; struct modem_cmux_frame frame; uint8_t data[MODEM_CMUX_CMD_DATA_SIZE_MAX]; @@ -488,8 +619,9 @@ static void modem_cmux_acknowledge_received_frame(struct modem_cmux *cmux) memcpy(&frame, &cmux->frame, sizeof(cmux->frame)); memcpy(data, cmux->frame.data, cmux->frame.data_len); - modem_cmux_wrap_command(&command, data, cmux->frame.data_len); - command->type.cr = 0; + command = modem_cmux_command_type_decode(data[0]); + command.cr = 0; + data[0] = modem_cmux_command_type_encode(command); frame.data = data; frame.data_len = cmux->frame.data_len; @@ -516,29 +648,34 @@ static void modem_cmux_send_msc(struct modem_cmux *cmux, struct modem_cmux_dlci .rtr = dlci->state == MODEM_CMUX_DLCI_STATE_OPEN ? 1 : 0, .dv = 1, }; - struct modem_cmux_command_msc cmd = { - .command = { - .type = { - .ea = 1, - .cr = 1, - .value = MODEM_CMUX_COMMAND_MSC, - }, - .length = { - .ea = 1, - .value = sizeof(cmd.value), - }, + struct modem_cmux_command cmd = { + .type = { + .ea = 1, + .cr = 1, + .value = MODEM_CMUX_COMMAND_MSC, + }, + .length = { + .ea = 1, + .value = 2, }, .value[0] = modem_cmux_msc_addr_encode(addr), .value[1] = modem_cmux_msc_signals_encode(signals), }; + uint16_t len; + uint8_t *data = modem_cmux_command_encode(&cmd, &len); + + if (data == NULL) { + return; + } + struct modem_cmux_frame frame = { .dlci_address = 0, .cr = cmux->initiator, .pf = false, .type = MODEM_CMUX_FRAME_TYPE_UIH, - .data = (void *)&cmd, - .data_len = sizeof(cmd), + .data = data, + .data_len = len, }; LOG_DBG("Sending MSC command for DLCI %u, FC:%d RTR: %d DV: %d", addr.dlci_address, @@ -655,41 +792,44 @@ static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) static void modem_cmux_respond_unsupported_cmd(struct modem_cmux *cmux) { struct modem_cmux_frame frame = cmux->frame; - struct modem_cmux_command *cmd; + struct modem_cmux_command cmd = modem_cmux_command_decode(frame.data, frame.data_len); - if (modem_cmux_wrap_command(&cmd, frame.data, frame.data_len) < 0) { + if (!modem_cmux_command_is_valid(&cmd)) { LOG_WRN("Invalid command"); return; } - struct { - /* 3GPP TS 27.010: 5.4.6.3.8 Non Supported Command Response (NSC) */ - struct modem_cmux_command nsc; - struct modem_cmux_command_type value; - } nsc_cmd = { - .nsc = { - .type = { - .ea = 1, - .cr = 0, - .value = MODEM_CMUX_COMMAND_NSC, - }, - .length = { - .ea = 1, - .value = 1, - }, + + /* 3GPP TS 27.010: 5.4.6.3.8 Non Supported Command Response (NSC) */ + struct modem_cmux_command nsc_cmd = { + .type = { + .ea = 1, + .cr = 0, + .value = MODEM_CMUX_COMMAND_NSC, + }, + .length = { + .ea = 1, + .value = 1, }, - .value = cmd->type, + .value[0] = modem_cmux_command_type_encode(cmd.type), }; - frame.data = (uint8_t *)&nsc_cmd; - frame.data_len = sizeof(nsc_cmd); + uint16_t len; + uint8_t *data = modem_cmux_command_encode(&nsc_cmd, &len); + + if (data == NULL) { + return; + } + + frame.data = data; + frame.data_len = len; modem_cmux_transmit_cmd_frame(cmux, &frame); } static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) { - struct modem_cmux_command *command; + struct modem_cmux_command command; if ((cmux->state != MODEM_CMUX_STATE_CONNECTED) && (cmux->state != MODEM_CMUX_STATE_DISCONNECTING)) { @@ -697,18 +837,19 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) return; } - if (modem_cmux_wrap_command(&command, cmux->frame.data, cmux->frame.data_len) < 0) { + command = modem_cmux_command_decode(cmux->frame.data, cmux->frame.data_len); + if (!modem_cmux_command_is_valid(&command)) { LOG_WRN("Invalid command"); return; } - modem_cmux_log_received_command(command); + modem_cmux_log_received_command(&command); - if (!command->type.cr) { + if (!command.type.cr) { LOG_DBG("Received response command"); - switch (command->type.value) { + switch (command.type.value) { case MODEM_CMUX_COMMAND_CLD: - modem_cmux_on_cld_command(cmux, command); + modem_cmux_on_cld_command(cmux, &command); break; default: /* Responses to other commands are ignored */ @@ -717,13 +858,13 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) return; } - switch (command->type.value) { + switch (command.type.value) { case MODEM_CMUX_COMMAND_CLD: - modem_cmux_on_cld_command(cmux, command); + modem_cmux_on_cld_command(cmux, &command); break; case MODEM_CMUX_COMMAND_MSC: - modem_cmux_on_msc_command(cmux, command); + modem_cmux_on_msc_command(cmux, &command); break; case MODEM_CMUX_COMMAND_FCON: @@ -1321,8 +1462,6 @@ static void modem_cmux_disconnect_handler(struct k_work *item) { struct k_work_delayable *dwork = k_work_delayable_from_work(item); struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, disconnect_work); - struct modem_cmux_command *command; - uint8_t data[2]; if (cmux->state == MODEM_CMUX_STATE_DISCONNECTING) { disconnect(cmux); @@ -1331,12 +1470,21 @@ static void modem_cmux_disconnect_handler(struct k_work *item) k_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); } - command = modem_cmux_command_wrap(data); - command->type.ea = 1; - command->type.cr = 1; - command->type.value = MODEM_CMUX_COMMAND_CLD; - command->length.ea = 1; - command->length.value = 0; + struct modem_cmux_command command = { + .type.ea = 1, + .type.cr = 1, + .type.value = MODEM_CMUX_COMMAND_CLD, + .length.ea = 1, + .length.value = 0, + }; + + uint16_t len; + uint8_t *data = modem_cmux_command_encode(&command, &len); + + if (data == NULL) { + return; + } + struct modem_cmux_frame frame = { .dlci_address = 0, @@ -1344,7 +1492,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) .pf = false, .type = MODEM_CMUX_FRAME_TYPE_UIH, .data = data, - .data_len = sizeof(data), + .data_len = len, }; /* Transmit close down command */ diff --git a/tests/subsys/modem/modem_cmux/src/main.c b/tests/subsys/modem/modem_cmux/src/main.c index 67833baabe76..b40af7e0de89 100644 --- a/tests/subsys/modem/modem_cmux/src/main.c +++ b/tests/subsys/modem/modem_cmux/src/main.c @@ -937,4 +937,23 @@ ZTEST(modem_cmux, test_modem_cmux_invalid_cr) zassert_false(events, "Wrong CMD should have been ignored"); } +ZTEST(modem_cmux, test_modem_cmux_invalid_command) +{ + static uint8_t invalid_cmd[] = {0xF9, 0x03, 0xEF, 0x09, 0x00, + 0x00, 0x00, 0x00, 0xFB, 0xF9}; + uint32_t events; + + modem_backend_mock_put(&bus_mock, invalid_cmd, + sizeof(invalid_cmd)); + + events = k_event_wait_all(&cmux_event, + (MODEM_CMUX_EVENT_CONNECTED | MODEM_CMUX_EVENT_DISCONNECTED), + false, K_SECONDS(1)); + + zassert_false(events, "Wrong CMD should have been ignored"); + + /* Invalid command should not cause any response */ + zassert_equal(0, modem_backend_mock_get(&bus_mock, buffer1, sizeof(buffer1))); +} + ZTEST_SUITE(modem_cmux, NULL, test_modem_cmux_setup, test_modem_cmux_before, NULL, NULL); From 20f2a05812d6aa8d7eb84c95ec7c8ffa21e37f66 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Thu, 23 Oct 2025 16:39:48 +0300 Subject: [PATCH 0257/3334] [nrf fromlist] drivers: modem: Implement support for DTR signal DTR signal on UART extends the power saving by allowing host to indicate the remote end that the UART is not in active state. Upstream PR #: 98145 Signed-off-by: Seppo Takalo (cherry picked from commit 2d81801a851d21229020816f3029762a93b19083) --- drivers/modem/modem_cellular.c | 9 +++++++++ dts/bindings/modem/zephyr,cellular-modem-device.yaml | 8 ++++++++ include/zephyr/modem/backend/uart.h | 2 ++ subsys/modem/backends/modem_backend_uart.c | 1 + subsys/modem/backends/modem_backend_uart_async.c | 8 ++++++++ subsys/modem/backends/modem_backend_uart_async_hwfc.c | 8 ++++++++ 6 files changed, 36 insertions(+) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 64e3614b51eb..0079a07b10d6 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -185,6 +185,7 @@ struct modem_cellular_config { struct gpio_dt_spec power_gpio; struct gpio_dt_spec reset_gpio; struct gpio_dt_spec wake_gpio; + struct gpio_dt_spec dtr_gpio; uint16_t power_pulse_duration_ms; uint16_t reset_pulse_duration_ms; uint16_t startup_time_ms; @@ -2095,6 +2096,7 @@ static int modem_cellular_init(const struct device *dev) { struct modem_cellular_data *data = (struct modem_cellular_data *)dev->data; struct modem_cellular_config *config = (struct modem_cellular_config *)dev->config; + const struct gpio_dt_spec *dtr_gpio = NULL; data->dev = dev; @@ -2118,9 +2120,15 @@ static int modem_cellular_init(const struct device *dev) gpio_pin_configure_dt(&config->reset_gpio, GPIO_OUTPUT_ACTIVE); } + if (modem_cellular_gpio_is_enabled(&config->dtr_gpio)) { + gpio_pin_configure_dt(&config->dtr_gpio, GPIO_OUTPUT_INACTIVE); + dtr_gpio = &config->dtr_gpio; + } + { const struct modem_backend_uart_config uart_backend_config = { .uart = config->uart, + .dtr_gpio = dtr_gpio, .receive_buf = data->uart_backend_receive_buf, .receive_buf_size = ARRAY_SIZE(data->uart_backend_receive_buf), .transmit_buf = data->uart_backend_transmit_buf, @@ -2888,6 +2896,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, .power_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_power_gpios, {}), \ .reset_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_reset_gpios, {}), \ .wake_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_wake_gpios, {}), \ + .dtr_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_dtr_gpios, {}), \ .power_pulse_duration_ms = (power_ms), \ .reset_pulse_duration_ms = (reset_ms), \ .startup_time_ms = (startup_ms), \ diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml index bff39d7f9f61..66c7fd91d092 100644 --- a/dts/bindings/modem/zephyr,cellular-modem-device.yaml +++ b/dts/bindings/modem/zephyr,cellular-modem-device.yaml @@ -17,3 +17,11 @@ properties: mdm-wake-gpios: type: phandle-array description: GPIO for modem wake + + mdm-dtr-gpios: + type: phandle-array + description: | + GPIO for modem data terminal ready. + + Asserted (logical high) when UART is active and + deasserted (logical low) when UART is inactive, powered down or in low power mode. diff --git a/include/zephyr/modem/backend/uart.h b/include/zephyr/modem/backend/uart.h index 73054b792d8e..6407af8cf6af 100644 --- a/include/zephyr/modem/backend/uart.h +++ b/include/zephyr/modem/backend/uart.h @@ -68,6 +68,7 @@ struct modem_backend_uart_async { struct modem_backend_uart { const struct device *uart; + const struct gpio_dt_spec *dtr_gpio; struct modem_pipe pipe; struct k_work_delayable receive_ready_work; struct k_work transmit_idle_work; @@ -85,6 +86,7 @@ struct modem_backend_uart { struct modem_backend_uart_config { const struct device *uart; + const struct gpio_dt_spec *dtr_gpio; /* Address must be word-aligned when CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC is enabled. */ uint8_t *receive_buf; uint32_t receive_buf_size; diff --git a/subsys/modem/backends/modem_backend_uart.c b/subsys/modem/backends/modem_backend_uart.c index 82242a76c019..13a35406f182 100644 --- a/subsys/modem/backends/modem_backend_uart.c +++ b/subsys/modem/backends/modem_backend_uart.c @@ -39,6 +39,7 @@ struct modem_pipe *modem_backend_uart_init(struct modem_backend_uart *backend, memset(backend, 0x00, sizeof(*backend)); backend->uart = config->uart; + backend->dtr_gpio = config->dtr_gpio; k_work_init_delayable(&backend->receive_ready_work, modem_backend_uart_receive_ready_handler); k_work_init(&backend->transmit_idle_work, modem_backend_uart_transmit_idle_handler); diff --git a/subsys/modem/backends/modem_backend_uart_async.c b/subsys/modem/backends/modem_backend_uart_async.c index 9b5edc8965c5..1615120a4d5e 100644 --- a/subsys/modem/backends/modem_backend_uart_async.c +++ b/subsys/modem/backends/modem_backend_uart_async.c @@ -11,6 +11,7 @@ LOG_MODULE_REGISTER(modem_backend_uart_async, CONFIG_MODEM_MODULES_LOG_LEVEL); #include +#include #include enum { @@ -157,6 +158,10 @@ static int modem_backend_uart_async_open(void *data) atomic_clear(&backend->async.common.state); ring_buf_reset(&backend->async.receive_rb); + if (backend->dtr_gpio) { + gpio_pin_set_dt(backend->dtr_gpio, 1); + } + atomic_set_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_RX_BUF0_USED_BIT); atomic_set_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_RECEIVING_BIT); @@ -268,6 +273,9 @@ static int modem_backend_uart_async_close(void *data) atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); uart_tx_abort(backend->uart); uart_rx_disable(backend->uart); + if (backend->dtr_gpio) { + gpio_pin_set_dt(backend->dtr_gpio, 0); + } return 0; } diff --git a/subsys/modem/backends/modem_backend_uart_async_hwfc.c b/subsys/modem/backends/modem_backend_uart_async_hwfc.c index 61d307604e5c..3aaaad2e196c 100644 --- a/subsys/modem/backends/modem_backend_uart_async_hwfc.c +++ b/subsys/modem/backends/modem_backend_uart_async_hwfc.c @@ -11,6 +11,7 @@ LOG_MODULE_REGISTER(modem_backend_uart_async_hwfc, CONFIG_MODEM_MODULES_LOG_LEVEL); #include +#include #include struct rx_buf_t { @@ -221,6 +222,10 @@ static int modem_backend_uart_async_hwfc_open(void *data) return -ENOMEM; } + if (backend->dtr_gpio) { + gpio_pin_set_dt(backend->dtr_gpio, 1); + } + atomic_clear(&backend->async.common.state); atomic_set_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); @@ -357,6 +362,9 @@ static int modem_backend_uart_async_hwfc_close(void *data) uart_rx_disable(backend->uart); } + if (backend->dtr_gpio) { + gpio_pin_set_dt(backend->dtr_gpio, 0); + } return 0; } From 9e650b35e334a94c27711fbdfc912cb4c0fe0673 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 14 Oct 2025 21:04:46 +0000 Subject: [PATCH 0258/3334] [nrf fromlist] modem: cmux: Implement Power Saving Control message Signal powersaving mode for the remote end using PSC command. Wakes up the remote end from powersaving mode by sending flag characters. This method is defined in 3GPP TS 27.010. Sections 5.4.6.3.2 Power Saving Control (PSC) and 5.4.7 Power Control and Wake-up Mechanisms. Essentially it is one PSC command to indicate a sleep state, and then repeated flag characters to wake up the remote end or indicate that we have been woken up. Upstream PR #: 97362 Signed-off-by: Seppo Takalo (cherry picked from commit 55c463e9f989d1747b3f4449b35716ca0dc5fbdc) --- include/zephyr/modem/cmux.h | 5 ++ subsys/modem/Kconfig | 8 ++ subsys/modem/modem_cmux.c | 175 +++++++++++++++++++++++++++++++----- 3 files changed, 168 insertions(+), 20 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index bf349980e2c9..912edb1b79ef 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -72,6 +72,10 @@ enum modem_cmux_state { MODEM_CMUX_STATE_DISCONNECTED = 0, MODEM_CMUX_STATE_CONNECTING, MODEM_CMUX_STATE_CONNECTED, + MODEM_CMUX_STATE_ENTER_POWERSAVE, + MODEM_CMUX_STATE_POWERSAVE, + MODEM_CMUX_STATE_CONFIRM_POWERSAVE, + MODEM_CMUX_STATE_WAKEUP, MODEM_CMUX_STATE_DISCONNECTING, }; @@ -187,6 +191,7 @@ struct modem_cmux { /* Synchronize actions */ struct k_event event; + k_timepoint_t t3_timepoint; /* Statistics */ #if CONFIG_MODEM_STATS diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index dfcb7ddae9a3..8b4a411c26f6 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -64,6 +64,14 @@ config MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA Extra bytes to add to the work buffers used by the CMUX module. The default size of these buffers is MODEM_CMUX_MTU + 7 (CMUX header size). +config MODEM_CMUX_T3_TIMEOUT + int "CMUX T3 timeout in seconds" + range 1 255 + default 10 + help + Response Timer for wake-up procedure(T3). + Time in seconds before the link is considered dead. + module = MODEM_CMUX module-str = modem_cmux source "subsys/logging/Kconfig.template.log_config" diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 3bebde19d462..a491195b78e9 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -37,9 +37,7 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #define MODEM_CMUX_T1_TIMEOUT (K_MSEC(330)) #define MODEM_CMUX_T2_TIMEOUT (K_MSEC(660)) - -#define MODEM_CMUX_EVENT_CONNECTED_BIT (BIT(0)) -#define MODEM_CMUX_EVENT_DISCONNECTED_BIT (BIT(1)) +#define MODEM_CMUX_T3_TIMEOUT (K_SECONDS(CONFIG_MODEM_CMUX_T3_TIMEOUT)) enum modem_cmux_frame_types { MODEM_CMUX_FRAME_TYPE_RR = 0x01, @@ -101,6 +99,7 @@ struct modem_cmux_msc_addr { static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address); static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux); +static void modem_cmux_tx_bypass(struct modem_cmux *cmux, const uint8_t *data, size_t len); static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) { @@ -118,6 +117,22 @@ static bool is_connected(struct modem_cmux *cmux) return cmux->state == MODEM_CMUX_STATE_CONNECTED; } +static bool is_powersaving(struct modem_cmux *cmux) +{ + return cmux->state == MODEM_CMUX_STATE_POWERSAVE; +} + +static bool is_waking_up(struct modem_cmux *cmux) +{ + return cmux->state == MODEM_CMUX_STATE_WAKEUP; +} + +static bool is_transitioning_to_powersave(struct modem_cmux *cmux) +{ + return (cmux->state == MODEM_CMUX_STATE_ENTER_POWERSAVE || + cmux->state == MODEM_CMUX_STATE_CONFIRM_POWERSAVE); +} + static bool modem_cmux_command_type_is_valid(const struct modem_cmux_command_type type) { /* All commands are only 7 bits, so EA is always set */ @@ -581,7 +596,7 @@ static int16_t modem_cmux_transmit_data_frame(struct modem_cmux *cmux, k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); - if (cmux->flow_control_on == false) { + if (cmux->flow_control_on == false || is_transitioning_to_powersave(cmux)) { k_mutex_unlock(&cmux->transmit_rb_lock); return 0; } @@ -630,6 +645,34 @@ static void modem_cmux_acknowledge_received_frame(struct modem_cmux *cmux) } } +static void modem_cmux_send_psc(struct modem_cmux *cmux) +{ + uint16_t len; + uint8_t *data = modem_cmux_command_encode(&(struct modem_cmux_command){ + .type.ea = 1, + .type.cr = 1, + .type.value = MODEM_CMUX_COMMAND_PSC, + .length.ea = 1, + .length.value = 0, + }, &len); + + if (data == NULL) { + return; + } + + struct modem_cmux_frame frame = { + .dlci_address = 0, + .cr = cmux->initiator, + .pf = true, + .type = MODEM_CMUX_FRAME_TYPE_UIH, + .data = data, + .data_len = len, + }; + + LOG_DBG("Sending PSC command"); + modem_cmux_transmit_cmd_frame(cmux, &frame); +} + static void modem_cmux_send_msc(struct modem_cmux *cmux, struct modem_cmux_dlci *dlci) { if (cmux == NULL || dlci == NULL) { @@ -827,12 +870,28 @@ static void modem_cmux_respond_unsupported_cmd(struct modem_cmux *cmux) modem_cmux_transmit_cmd_frame(cmux, &frame); } +static void modem_cmux_on_psc_command(struct modem_cmux *cmux) +{ + LOG_DBG("Received power saving command"); + k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); + set_state(cmux, MODEM_CMUX_STATE_CONFIRM_POWERSAVE); + modem_cmux_acknowledge_received_frame(cmux); + k_mutex_unlock(&cmux->transmit_rb_lock); +} + +static void modem_cmux_on_psc_response(struct modem_cmux *cmux) +{ + LOG_DBG("Enter power saving"); + k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); + set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); + k_mutex_unlock(&cmux->transmit_rb_lock); +} + static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) { struct modem_cmux_command command; - if ((cmux->state != MODEM_CMUX_STATE_CONNECTED) && - (cmux->state != MODEM_CMUX_STATE_DISCONNECTING)) { + if (cmux->state < MODEM_CMUX_STATE_CONNECTED) { LOG_DBG("Unexpected UIH frame"); return; } @@ -851,6 +910,9 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) case MODEM_CMUX_COMMAND_CLD: modem_cmux_on_cld_command(cmux, &command); break; + case MODEM_CMUX_COMMAND_PSC: + modem_cmux_on_psc_response(cmux); + break; default: /* Responses to other commands are ignored */ break; @@ -875,6 +937,10 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) modem_cmux_on_fcoff_command(cmux); break; + case MODEM_CMUX_COMMAND_PSC: + modem_cmux_on_psc_command(cmux); + break; + default: LOG_DBG("Unknown control command"); modem_cmux_respond_unsupported_cmd(cmux); @@ -1140,6 +1206,11 @@ static void modem_cmux_on_frame(struct modem_cmux *cmux) modem_cmux_advertise_receive_buf_stats(cmux); #endif + if (is_powersaving(cmux) || is_waking_up(cmux)) { + set_state(cmux, MODEM_CMUX_STATE_CONNECTED); + LOG_DBG("Exit powersave on received frame"); + } + if (cmux->frame.dlci_address == 0) { modem_cmux_on_control_frame(cmux); } else { @@ -1170,8 +1241,10 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by switch (cmux->receive_state) { case MODEM_CMUX_RECEIVE_STATE_SOF: + cmux->frame_header_len = 0; if (byte == MODEM_CMUX_SOF) { cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_RESYNC; + cmux->frame_header_len++; break; } @@ -1183,6 +1256,20 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by * 0xF9 could also be a valid address field for DLCI 62. */ if (byte == MODEM_CMUX_SOF) { + /* Use "header_len" to count SOF bytes, only start transmitting + * flag bytes after receiving more than 3 flags. + * Don't reply flags if we are transitioning between modes or + * if T3 timer is still active (suppress residual flags). + */ + cmux->frame_header_len++; + if ((is_powersaving(cmux) || + (is_connected(cmux) && sys_timepoint_expired(cmux->t3_timepoint))) && + cmux->frame_header_len > 3) { + modem_cmux_tx_bypass(cmux, &(char){MODEM_CMUX_SOF}, 1); + } + if (is_waking_up(cmux)) { + k_work_reschedule(&cmux->transmit_work, K_NO_WAIT); + } break; } @@ -1351,21 +1438,15 @@ static void modem_cmux_receive_handler(struct k_work *item) int ret; /* Receive data from pipe */ - ret = modem_pipe_receive(cmux->pipe, cmux->work_buf, sizeof(cmux->work_buf)); - if (ret < 1) { - if (ret < 0) { - LOG_ERR("Pipe receiving error: %d", ret); + while ((ret = modem_pipe_receive(cmux->pipe, cmux->work_buf, sizeof(cmux->work_buf))) > 0) { + /* Process received data */ + for (int i = 0; i < ret; i++) { + modem_cmux_process_received_byte(cmux, cmux->work_buf[i]); } - return; } - - /* Process received data */ - for (int i = 0; i < ret; i++) { - modem_cmux_process_received_byte(cmux, cmux->work_buf[i]); + if (ret < 0) { + LOG_ERR("Pipe receiving error: %d", ret); } - - /* Reschedule received work */ - modem_work_schedule(&cmux->receive_work, K_NO_WAIT); } static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) @@ -1381,6 +1462,51 @@ static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) } } +/** Transmit bytes bypassing the CMUX buffers. + * Causes modem_cmux_transmit_handler() to be rescheduled as a result of TRANSMIT_IDLE event. + */ +static void modem_cmux_tx_bypass(struct modem_cmux *cmux, const uint8_t *data, size_t len) +{ + if (cmux == NULL) { + return; + } + + modem_pipe_transmit(cmux->pipe, data, len); +} + +static bool powersave_wait_wakeup(struct modem_cmux *cmux) +{ + static const uint8_t wakeup_pattern[] = {MODEM_CMUX_SOF, MODEM_CMUX_SOF, MODEM_CMUX_SOF, + MODEM_CMUX_SOF, MODEM_CMUX_SOF}; + int ret; + + if (is_powersaving(cmux)) { + LOG_DBG("Power saving mode, wake up first"); + set_state(cmux, MODEM_CMUX_STATE_WAKEUP); + cmux->t3_timepoint = sys_timepoint_calc(MODEM_CMUX_T3_TIMEOUT); + modem_cmux_tx_bypass(cmux, wakeup_pattern, sizeof(wakeup_pattern)); + return true; + } + + if (is_waking_up(cmux)) { + if (sys_timepoint_expired(cmux->t3_timepoint)) { + LOG_ERR("Wake up timed out, link dead"); + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); + modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); + return true; + } + if (cmux->receive_state != MODEM_CMUX_RECEIVE_STATE_RESYNC) { + /* Retry single flag, until remote wakes up */ + modem_cmux_tx_bypass(cmux, &(uint8_t){MODEM_CMUX_SOF}, 1); + return true; + } + set_state(cmux, MODEM_CMUX_STATE_CONNECTED); + LOG_DBG("Woke up from power saving mode"); + } + + return false; +} + static void modem_cmux_transmit_handler(struct k_work *item) { struct k_work_delayable *dwork = k_work_delayable_from_work(item); @@ -1403,6 +1529,11 @@ static void modem_cmux_transmit_handler(struct k_work *item) break; } + if (powersave_wait_wakeup(cmux)) { + k_mutex_unlock(&cmux->transmit_rb_lock); + return; + } + reserved_size = ring_buf_get_claim(&cmux->transmit_rb, &reserved, UINT32_MAX); ret = modem_pipe_transmit(cmux->pipe, reserved, reserved_size); @@ -1423,11 +1554,14 @@ static void modem_cmux_transmit_handler(struct k_work *item) } } - k_mutex_unlock(&cmux->transmit_rb_lock); - if (transmit_rb_empty) { + if (cmux->state == MODEM_CMUX_STATE_CONFIRM_POWERSAVE) { + set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); + LOG_DBG("Entered power saving mode"); + } modem_cmux_dlci_notify_transmit_idle(cmux); } + k_mutex_unlock(&cmux->transmit_rb_lock); } static void modem_cmux_connect_handler(struct k_work *item) @@ -1724,6 +1858,7 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co cmux->user_data = config->user_data; cmux->receive_buf = config->receive_buf; cmux->receive_buf_size = config->receive_buf_size; + cmux->t3_timepoint = sys_timepoint_calc(K_NO_WAIT); sys_slist_init(&cmux->dlcis); ring_buf_init(&cmux->transmit_rb, config->transmit_buf_size, config->transmit_buf); k_mutex_init(&cmux->transmit_rb_lock); From 6dcae640dfdc7d913f4f9f09a0de9dce79654ed6 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Fri, 10 Oct 2025 11:14:53 +0300 Subject: [PATCH 0259/3334] [nrf fromlist] drivers: modem: Implement runtime power management for CMUX CMUX driver can enable the support for idle-timer in devicetree and can be requested to shut down the pipe during sleep. Then UART backend put the actual device into sleep when pipe is closed. Waking up is requested by sending data to DLC pipe or by manually opening the uart_pipe. Modem may request similar wake-up by a RING interrupt which would open the same pipe. When UART is powered and pipe is not closed, CMUX wake-up procedure is automatic. Either end may initiate the wake-up. Upstream PR #: 97362 Signed-off-by: Seppo Takalo (cherry picked from commit f5b6222db45d89a0e926ea4fa0bd6fd8fb110d91) --- drivers/modem/modem_cellular.c | 31 +++--- .../modem/zephyr,cellular-modem-device.yaml | 19 ++++ include/zephyr/modem/cmux.h | 14 +++ .../modem/backends/modem_backend_uart_async.c | 13 +++ .../backends/modem_backend_uart_async_hwfc.c | 14 +++ subsys/modem/modem_cmux.c | 96 ++++++++++++++++++- 6 files changed, 171 insertions(+), 16 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 0079a07b10d6..5d381af2a821 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -191,6 +193,9 @@ struct modem_cellular_config { uint16_t startup_time_ms; uint16_t shutdown_time_ms; bool autostarts; + bool cmux_enable_runtime_power_save; + bool cmux_close_pipe_on_power_save; + k_timeout_t cmux_idle_timeout; const struct modem_chat_script *init_chat_script; const struct modem_chat_script *dial_chat_script; const struct modem_chat_script *periodic_chat_script; @@ -2102,7 +2107,6 @@ static int modem_cellular_init(const struct device *dev) k_mutex_init(&data->api_lock); k_work_init_delayable(&data->timeout_work, modem_cellular_timeout_handler); - k_work_init(&data->event_dispatch_work, modem_cellular_event_dispatch_handler); ring_buf_init(&data->event_rb, sizeof(data->event_buf), data->event_buf); @@ -2149,6 +2153,9 @@ static int modem_cellular_init(const struct device *dev) .receive_buf_size = ARRAY_SIZE(data->cmux_receive_buf), .transmit_buf = data->cmux_transmit_buf, .transmit_buf_size = ARRAY_SIZE(data->cmux_transmit_buf), + .enable_runtime_power_management = config->cmux_enable_runtime_power_save, + .close_pipe_on_power_save = config->cmux_close_pipe_on_power_save, + .idle_timeout = config->cmux_idle_timeout, }; modem_cmux_init(&data->cmux, &cmux_config); @@ -2886,11 +2893,8 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, /* Helper to define modem instance */ #define MODEM_CELLULAR_DEFINE_INSTANCE(inst, power_ms, reset_ms, startup_ms, shutdown_ms, start, \ - set_baudrate_script, \ - init_script, \ - dial_script, \ - periodic_script, \ - shutdown_script) \ + set_baudrate_script, init_script, dial_script, \ + periodic_script, shutdown_script) \ static const struct modem_cellular_config MODEM_CELLULAR_INST_NAME(config, inst) = { \ .uart = DEVICE_DT_GET(DT_INST_BUS(inst)), \ .power_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_power_gpios, {}), \ @@ -2899,14 +2903,19 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, .dtr_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_dtr_gpios, {}), \ .power_pulse_duration_ms = (power_ms), \ .reset_pulse_duration_ms = (reset_ms), \ - .startup_time_ms = (startup_ms), \ + .startup_time_ms = (startup_ms), \ .shutdown_time_ms = (shutdown_ms), \ .autostarts = DT_INST_PROP_OR(inst, autostarts, (start)), \ - .set_baudrate_chat_script = (set_baudrate_script), \ - .init_chat_script = (init_script), \ - .dial_chat_script = (dial_script), \ + .cmux_enable_runtime_power_save = \ + DT_INST_PROP_OR(inst, cmux_enable_runtime_power_save, 0), \ + .cmux_close_pipe_on_power_save = \ + DT_INST_PROP_OR(inst, cmux_close_pipe_on_power_save, 0), \ + .cmux_idle_timeout = K_MSEC(DT_INST_PROP_OR(inst, cmux_idle_timeout_ms, 0)), \ + .set_baudrate_chat_script = (set_baudrate_script), \ + .init_chat_script = (init_script), \ + .dial_chat_script = (dial_script), \ .periodic_chat_script = (periodic_script), \ - .shutdown_chat_script = (shutdown_script), \ + .shutdown_chat_script = (shutdown_script), \ .user_pipes = MODEM_CELLULAR_GET_USER_PIPES(inst), \ .user_pipes_size = ARRAY_SIZE(MODEM_CELLULAR_GET_USER_PIPES(inst)), \ }; \ diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml index 66c7fd91d092..c2d2e9e00a88 100644 --- a/dts/bindings/modem/zephyr,cellular-modem-device.yaml +++ b/dts/bindings/modem/zephyr,cellular-modem-device.yaml @@ -25,3 +25,22 @@ properties: Asserted (logical high) when UART is active and deasserted (logical low) when UART is inactive, powered down or in low power mode. + + cmux-enable-runtime-power-save: + type: boolean + description: | + Enable runtime power saving using CMUX PSC commands. + This requires modem to support CMUX and PSC commands while keeping the data + connection active. + + cmux-close-pipe-on-power-save: + type: boolean + description: | + Close the modem pipe when entering power save mode. + When runtime power management is enabled, this closes the UART. + This requires modem to support waking up the UART using RING signal. + + cmux-idle-timeout-ms: + type: int + description: Time in milliseconds after which CMUX will enter power save mode. + default: 10000 diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 912edb1b79ef..18bb6fff980d 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -159,6 +159,12 @@ struct modem_cmux { enum modem_cmux_state state; bool flow_control_on : 1; bool initiator : 1; + /** Enable runtime power management */ + bool enable_runtime_power_management; + /** Close pipe on power save */ + bool close_pipe_on_power_save; + /** Idle timeout for power save */ + k_timeout_t idle_timeout; /* Work lock */ bool attached : 1; @@ -188,10 +194,12 @@ struct modem_cmux { struct k_work_delayable transmit_work; struct k_work_delayable connect_work; struct k_work_delayable disconnect_work; + struct k_work_delayable runtime_pm_work; /* Synchronize actions */ struct k_event event; k_timepoint_t t3_timepoint; + k_timepoint_t idle_timepoint; /* Statistics */ #if CONFIG_MODEM_STATS @@ -220,6 +228,12 @@ struct modem_cmux_config { uint8_t *transmit_buf; /** Size of transmit buffer in bytes [149, ...] */ uint16_t transmit_buf_size; + /** Enable runtime power management */ + bool enable_runtime_power_management; + /** Close pipe on power save */ + bool close_pipe_on_power_save; + /** Idle timeout for power save */ + k_timeout_t idle_timeout; }; /** diff --git a/subsys/modem/backends/modem_backend_uart_async.c b/subsys/modem/backends/modem_backend_uart_async.c index 1615120a4d5e..0cfcff9e86ed 100644 --- a/subsys/modem/backends/modem_backend_uart_async.c +++ b/subsys/modem/backends/modem_backend_uart_async.c @@ -11,6 +11,7 @@ LOG_MODULE_REGISTER(modem_backend_uart_async, CONFIG_MODEM_MODULES_LOG_LEVEL); #include +#include #include #include @@ -158,6 +159,11 @@ static int modem_backend_uart_async_open(void *data) atomic_clear(&backend->async.common.state); ring_buf_reset(&backend->async.receive_rb); + ret = pm_device_runtime_get(backend->uart); + if (ret < 0) { + LOG_ERR("Failed to power on UART: %d", ret); + return ret; + } if (backend->dtr_gpio) { gpio_pin_set_dt(backend->dtr_gpio, 1); } @@ -269,6 +275,7 @@ static int modem_backend_uart_async_receive(void *data, uint8_t *buf, size_t siz static int modem_backend_uart_async_close(void *data) { struct modem_backend_uart *backend = (struct modem_backend_uart *)data; + int ret; atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); uart_tx_abort(backend->uart); @@ -276,6 +283,12 @@ static int modem_backend_uart_async_close(void *data) if (backend->dtr_gpio) { gpio_pin_set_dt(backend->dtr_gpio, 0); } + ret = pm_device_runtime_put_async(backend->uart, K_NO_WAIT); + if (ret < 0) { + LOG_ERR("Failed to power off UART: %d", ret); + return ret; + } + modem_pipe_notify_closed(&backend->pipe); return 0; } diff --git a/subsys/modem/backends/modem_backend_uart_async_hwfc.c b/subsys/modem/backends/modem_backend_uart_async_hwfc.c index 3aaaad2e196c..df69c40b6679 100644 --- a/subsys/modem/backends/modem_backend_uart_async_hwfc.c +++ b/subsys/modem/backends/modem_backend_uart_async_hwfc.c @@ -11,6 +11,7 @@ LOG_MODULE_REGISTER(modem_backend_uart_async_hwfc, CONFIG_MODEM_MODULES_LOG_LEVEL); #include +#include #include #include @@ -222,6 +223,11 @@ static int modem_backend_uart_async_hwfc_open(void *data) return -ENOMEM; } + ret = pm_device_runtime_get(backend->uart); + if (ret < 0) { + LOG_ERR("Failed to power on UART: %d", ret); + return ret; + } if (backend->dtr_gpio) { gpio_pin_set_dt(backend->dtr_gpio, 1); } @@ -352,6 +358,7 @@ static int modem_backend_uart_async_hwfc_receive(void *data, uint8_t *buf, size_ static int modem_backend_uart_async_hwfc_close(void *data) { struct modem_backend_uart *backend = (struct modem_backend_uart *)data; + int ret; atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); uart_tx_abort(backend->uart); @@ -365,6 +372,13 @@ static int modem_backend_uart_async_hwfc_close(void *data) if (backend->dtr_gpio) { gpio_pin_set_dt(backend->dtr_gpio, 0); } + ret = pm_device_runtime_put_async(backend->uart, K_NO_WAIT); + if (ret < 0) { + LOG_ERR("Failed to power off UART: %d", ret); + return ret; + } + modem_pipe_notify_closed(&backend->pipe); + return 0; } diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index a491195b78e9..94c249aaa938 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -10,6 +10,8 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #include #include #include +#include +#include #include @@ -100,6 +102,7 @@ struct modem_cmux_msc_addr { static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address); static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux); static void modem_cmux_tx_bypass(struct modem_cmux *cmux, const uint8_t *data, size_t len); +static void runtime_pm_keepalive(struct modem_cmux *cmux); static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) { @@ -497,10 +500,17 @@ static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_eve modem_work_schedule(&cmux->receive_work, K_NO_WAIT); break; + case MODEM_PIPE_EVENT_OPENED: + cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_SOF; + modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); + break; case MODEM_PIPE_EVENT_TRANSMIT_IDLE: + /* If we keep UART open in power-save, we should avoid waking up on RX idle */ + if (!cmux->close_pipe_on_power_save && is_powersaving(cmux)) { + break; + } modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); break; - default: break; } @@ -885,6 +895,10 @@ static void modem_cmux_on_psc_response(struct modem_cmux *cmux) k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); k_mutex_unlock(&cmux->transmit_rb_lock); + + if (cmux->close_pipe_on_power_save) { + modem_pipe_close_async(cmux->pipe); + } } static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) @@ -1437,6 +1451,8 @@ static void modem_cmux_receive_handler(struct k_work *item) struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, receive_work); int ret; + runtime_pm_keepalive(cmux); + /* Receive data from pipe */ while ((ret = modem_pipe_receive(cmux->pipe, cmux->work_buf, sizeof(cmux->work_buf))) > 0) { /* Process received data */ @@ -1462,6 +1478,46 @@ static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) } } +static void modem_cmux_runtime_pm_handler(struct k_work *item) +{ + struct k_work_delayable *dwork = k_work_delayable_from_work(item); + struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, runtime_pm_work); + + if (!cmux->enable_runtime_power_management) { + return; + } + + bool expired = sys_timepoint_expired(cmux->idle_timepoint); + + if (!expired) { + return; + } + + if (is_connected(cmux) && expired) { + LOG_DBG("Idle timeout, entering power saving mode"); + set_state(cmux, MODEM_CMUX_STATE_ENTER_POWERSAVE); + modem_cmux_send_psc(cmux); + k_work_reschedule(&cmux->runtime_pm_work, MODEM_CMUX_T3_TIMEOUT); + return; + } + if (cmux->state == MODEM_CMUX_STATE_ENTER_POWERSAVE) { + LOG_WRN("PSC timeout, not entering power saving mode"); + set_state(cmux, MODEM_CMUX_STATE_CONNECTED); + runtime_pm_keepalive(cmux); + return; + } +} + +static void runtime_pm_keepalive(struct modem_cmux *cmux) +{ + if (cmux == NULL || !cmux->enable_runtime_power_management) { + return; + } + + cmux->idle_timepoint = sys_timepoint_calc(cmux->idle_timeout); + k_work_reschedule(&cmux->runtime_pm_work, cmux->idle_timeout); +} + /** Transmit bytes bypassing the CMUX buffers. * Causes modem_cmux_transmit_handler() to be rescheduled as a result of TRANSMIT_IDLE event. */ @@ -1483,6 +1539,17 @@ static bool powersave_wait_wakeup(struct modem_cmux *cmux) if (is_powersaving(cmux)) { LOG_DBG("Power saving mode, wake up first"); set_state(cmux, MODEM_CMUX_STATE_WAKEUP); + + if (cmux->close_pipe_on_power_save) { + ret = modem_pipe_open(cmux->pipe, K_FOREVER); + if (ret < 0) { + LOG_ERR("Failed to open pipe for wake up (%d)", ret); + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); + modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); + return true; + } + } + cmux->t3_timepoint = sys_timepoint_calc(MODEM_CMUX_T3_TIMEOUT); modem_cmux_tx_bypass(cmux, wakeup_pattern, sizeof(wakeup_pattern)); return true; @@ -1522,18 +1589,22 @@ static void modem_cmux_transmit_handler(struct k_work *item) modem_cmux_advertise_transmit_buf_stats(cmux); #endif + if (!is_transitioning_to_powersave(cmux)) { + runtime_pm_keepalive(cmux); + } + while (true) { transmit_rb_empty = ring_buf_is_empty(&cmux->transmit_rb); - if (transmit_rb_empty) { - break; - } - if (powersave_wait_wakeup(cmux)) { k_mutex_unlock(&cmux->transmit_rb_lock); return; } + if (transmit_rb_empty) { + break; + } + reserved_size = ring_buf_get_claim(&cmux->transmit_rb, &reserved, UINT32_MAX); ret = modem_pipe_transmit(cmux->pipe, reserved, reserved_size); @@ -1558,6 +1629,9 @@ static void modem_cmux_transmit_handler(struct k_work *item) if (cmux->state == MODEM_CMUX_STATE_CONFIRM_POWERSAVE) { set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); LOG_DBG("Entered power saving mode"); + if (cmux->close_pipe_on_power_save) { + modem_pipe_close_async(cmux->pipe); + } } modem_cmux_dlci_notify_transmit_idle(cmux); } @@ -1693,6 +1767,13 @@ static int modem_cmux_dlci_pipe_api_transmit(void *data, const uint8_t *buf, siz struct modem_cmux *cmux = dlci->cmux; int ret = 0; + if (size == 0 || buf == NULL) { + /* Allow empty transmit request to wake up CMUX */ + runtime_pm_keepalive(cmux); + k_work_reschedule(&cmux->transmit_work, K_NO_WAIT); + return 0; + } + if (dlci->flow_control) { return 0; } @@ -1859,6 +1940,10 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co cmux->receive_buf = config->receive_buf; cmux->receive_buf_size = config->receive_buf_size; cmux->t3_timepoint = sys_timepoint_calc(K_NO_WAIT); + cmux->enable_runtime_power_management = config->enable_runtime_power_management; + cmux->close_pipe_on_power_save = config->close_pipe_on_power_save; + cmux->idle_timeout = + cmux->enable_runtime_power_management ? config->idle_timeout : K_FOREVER; sys_slist_init(&cmux->dlcis); ring_buf_init(&cmux->transmit_rb, config->transmit_buf_size, config->transmit_buf); k_mutex_init(&cmux->transmit_rb_lock); @@ -1866,6 +1951,7 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co k_work_init_delayable(&cmux->transmit_work, modem_cmux_transmit_handler); k_work_init_delayable(&cmux->connect_work, modem_cmux_connect_handler); k_work_init_delayable(&cmux->disconnect_work, modem_cmux_disconnect_handler); + k_work_init_delayable(&cmux->runtime_pm_work, modem_cmux_runtime_pm_handler); k_event_init(&cmux->event); set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); From 24e7ebfc51fe06eba3bb8cf4a708d06aeac8c7ab Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Thu, 9 Oct 2025 15:47:56 +0300 Subject: [PATCH 0260/3334] [nrf fromlist] drivers: modem: cellular: Use k_pipe instead of ringbuffer Ringbuffer is not safe in ISR but k_pipe without waiting is. So use pipe for events, so that possible GPIO callbacks from ISR content can post events. Upstream PR #: 97362 Signed-off-by: Seppo Takalo (cherry picked from commit efdf6dced1a1310715c740e7268cf5408dd44740) --- drivers/modem/modem_cellular.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 5d381af2a821..f42622840a2d 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -166,8 +166,7 @@ struct modem_cellular_data { /* Event dispatcher */ struct k_work event_dispatch_work; uint8_t event_buf[8]; - struct ring_buf event_rb; - struct k_mutex event_rb_lock; + struct k_pipe event_pipe; struct k_mutex api_lock; struct modem_cellular_event_cb cb; @@ -711,26 +710,18 @@ static void modem_cellular_event_dispatch_handler(struct k_work *item) struct modem_cellular_data *data = CONTAINER_OF(item, struct modem_cellular_data, event_dispatch_work); - uint8_t events[sizeof(data->event_buf)]; - uint8_t events_cnt; + enum modem_cellular_event event; + const size_t len = sizeof(event); - k_mutex_lock(&data->event_rb_lock, K_FOREVER); - - events_cnt = (uint8_t)ring_buf_get(&data->event_rb, events, sizeof(data->event_buf)); - - k_mutex_unlock(&data->event_rb_lock); - - for (uint8_t i = 0; i < events_cnt; i++) { - modem_cellular_event_handler(data, (enum modem_cellular_event)events[i]); + while (k_pipe_read(&data->event_pipe, (uint8_t *)&event, len, K_NO_WAIT) == len) { + modem_cellular_event_handler(data, (enum modem_cellular_event)event); } } static void modem_cellular_delegate_event(struct modem_cellular_data *data, enum modem_cellular_event evt) { - k_mutex_lock(&data->event_rb_lock, K_FOREVER); - ring_buf_put(&data->event_rb, (uint8_t *)&evt, 1); - k_mutex_unlock(&data->event_rb_lock); + k_pipe_write(&data->event_pipe, (const uint8_t *)&evt, sizeof(evt), K_NO_WAIT); k_work_submit(&data->event_dispatch_work); } @@ -2108,7 +2099,7 @@ static int modem_cellular_init(const struct device *dev) k_mutex_init(&data->api_lock); k_work_init_delayable(&data->timeout_work, modem_cellular_timeout_handler); k_work_init(&data->event_dispatch_work, modem_cellular_event_dispatch_handler); - ring_buf_init(&data->event_rb, sizeof(data->event_buf), data->event_buf); + k_pipe_init(&data->event_pipe, data->event_buf, sizeof(data->event_buf)); k_sem_init(&data->suspended_sem, 0, 1); From 0a818a937d02604c4512a459a9dfa21580f32f63 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Wed, 10 Sep 2025 16:17:12 +0300 Subject: [PATCH 0261/3334] [nrf fromlist] drivers: modem: Implement support for RING indicator Use ring indicator to wake up the CMUX device from sleep. Only used for runtime power management, but same event could be used for initiating idle -> connected as well. Upstream PR #: 97362 Signed-off-by: Seppo Takalo (cherry picked from commit e596d9dda22fbf95193402788a1e12c50c43696e) --- drivers/modem/modem_cellular.c | 59 ++++++++++++++++++- .../modem/zephyr,cellular-modem-device.yaml | 4 ++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index f42622840a2d..dfa2c719a8af 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -96,6 +96,7 @@ enum modem_cellular_event { MODEM_CELLULAR_EVENT_PPP_DEAD, MODEM_CELLULAR_EVENT_MODEM_READY, MODEM_CELLULAR_EVENT_APN_SET, + MODEM_CELLULAR_EVENT_RING, }; struct modem_cellular_event_cb { @@ -170,6 +171,9 @@ struct modem_cellular_data { struct k_mutex api_lock; struct modem_cellular_event_cb cb; + + /* Ring interrupt */ + struct gpio_callback ring_gpio_cb; }; struct modem_cellular_user_pipe { @@ -186,6 +190,7 @@ struct modem_cellular_config { struct gpio_dt_spec power_gpio; struct gpio_dt_spec reset_gpio; struct gpio_dt_spec wake_gpio; + struct gpio_dt_spec ring_gpio; struct gpio_dt_spec dtr_gpio; uint16_t power_pulse_duration_ms; uint16_t reset_pulse_duration_ms; @@ -285,6 +290,8 @@ static const char *modem_cellular_event_str(enum modem_cellular_event event) return "modem ready"; case MODEM_CELLULAR_EVENT_APN_SET: return "apn set"; + case MODEM_CELLULAR_EVENT_RING: + return "RING"; } return ""; @@ -1242,7 +1249,10 @@ static void modem_cellular_run_dial_script_event_handler(struct modem_cellular_d case MODEM_CELLULAR_EVENT_SUSPEND: modem_cellular_enter_state(data, MODEM_CELLULAR_STATE_INIT_POWER_OFF); break; - + case MODEM_CELLULAR_EVENT_RING: + LOG_INF("RING received!"); + modem_pipe_open_async(data->uart_pipe); + break; default: break; } @@ -1287,7 +1297,10 @@ static void modem_cellular_await_registered_event_handler(struct modem_cellular_ case MODEM_CELLULAR_EVENT_SUSPEND: modem_cellular_enter_state(data, MODEM_CELLULAR_STATE_INIT_POWER_OFF); break; - + case MODEM_CELLULAR_EVENT_RING: + LOG_INF("RING received!"); + modem_pipe_open_async(data->uart_pipe); + break; default: break; } @@ -1332,7 +1345,10 @@ static void modem_cellular_carrier_on_event_handler(struct modem_cellular_data * modem_ppp_release(data->ppp); modem_cellular_enter_state(data, MODEM_CELLULAR_STATE_INIT_POWER_OFF); break; - + case MODEM_CELLULAR_EVENT_RING: + LOG_INF("RING received!"); + modem_pipe_open_async(data->uart_pipe); + break; default: break; } @@ -2069,6 +2085,15 @@ static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint64_t } } +static void modem_cellular_ring_gpio_callback(const struct device *dev, struct gpio_callback *cb, + uint32_t pins) +{ + struct modem_cellular_data *data = + CONTAINER_OF(cb, struct modem_cellular_data, ring_gpio_cb); + + modem_cellular_delegate_event(data, MODEM_CELLULAR_EVENT_RING); +} + static void modem_cellular_init_apn(struct modem_cellular_data *data) { #ifdef CONFIG_MODEM_CELLULAR_APN @@ -2115,6 +2140,33 @@ static int modem_cellular_init(const struct device *dev) gpio_pin_configure_dt(&config->reset_gpio, GPIO_OUTPUT_ACTIVE); } + if (modem_cellular_gpio_is_enabled(&config->ring_gpio)) { + int ret; + + ret = gpio_pin_configure_dt(&config->ring_gpio, GPIO_INPUT); + if (ret < 0) { + LOG_ERR("Failed to configure ring GPIO (%d)", ret); + return ret; + } + + gpio_init_callback(&data->ring_gpio_cb, modem_cellular_ring_gpio_callback, + BIT(config->ring_gpio.pin)); + + ret = gpio_add_callback(config->ring_gpio.port, &data->ring_gpio_cb); + if (ret < 0) { + LOG_ERR("Failed to add ring GPIO callback (%d)", ret); + return ret; + } + + ret = gpio_pin_interrupt_configure_dt(&config->ring_gpio, GPIO_INT_EDGE_TO_ACTIVE); + if (ret < 0) { + LOG_ERR("Failed to configure ring GPIO interrupt (%d)", ret); + return ret; + } + + LOG_DBG("Ring GPIO interrupt configured"); + } + if (modem_cellular_gpio_is_enabled(&config->dtr_gpio)) { gpio_pin_configure_dt(&config->dtr_gpio, GPIO_OUTPUT_INACTIVE); dtr_gpio = &config->dtr_gpio; @@ -2891,6 +2943,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, .power_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_power_gpios, {}), \ .reset_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_reset_gpios, {}), \ .wake_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_wake_gpios, {}), \ + .ring_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_ring_gpios, {}), \ .dtr_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_dtr_gpios, {}), \ .power_pulse_duration_ms = (power_ms), \ .reset_pulse_duration_ms = (reset_ms), \ diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml index c2d2e9e00a88..d2ab0056841b 100644 --- a/dts/bindings/modem/zephyr,cellular-modem-device.yaml +++ b/dts/bindings/modem/zephyr,cellular-modem-device.yaml @@ -18,6 +18,10 @@ properties: type: phandle-array description: GPIO for modem wake + mdm-ring-gpios: + type: phandle-array + description: GPIO for modem ring indicator + mdm-dtr-gpios: type: phandle-array description: | From 0983122f394e78f68c76eaa66f7f263b332fa5ef Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Mon, 13 Oct 2025 12:00:33 +0300 Subject: [PATCH 0262/3334] [nrf fromlist] modem: pipe: Don't return EPERM on closed pipe When working on CMUX power saving, it is typical that we end up closing the pipe before the last RX_READY event is handled from workqueue, so we end up receiving -EPERM which is not really a fatal error. Pipes recover when they are re-opened. So drop this error and return zero instead, like modem_pipe_open() and close() does. Upstream PR #: 97362 Signed-off-by: Seppo Takalo (cherry picked from commit 752f9d63794801f2ea2e1bc1c2c4bf4e35c65e33) --- subsys/modem/modem_pipe.c | 4 ++-- tests/subsys/modem/modem_pipe/src/main.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/subsys/modem/modem_pipe.c b/subsys/modem/modem_pipe.c index bf642b3984dc..ef66b9085ea6 100644 --- a/subsys/modem/modem_pipe.c +++ b/subsys/modem/modem_pipe.c @@ -136,7 +136,7 @@ void modem_pipe_attach(struct modem_pipe *pipe, modem_pipe_api_callback callback int modem_pipe_transmit(struct modem_pipe *pipe, const uint8_t *buf, size_t size) { if (!pipe_test_events(pipe, PIPE_EVENT_OPENED_BIT)) { - return -EPERM; + return 0; } pipe_clear_events(pipe, PIPE_EVENT_TRANSMIT_IDLE_BIT); @@ -146,7 +146,7 @@ int modem_pipe_transmit(struct modem_pipe *pipe, const uint8_t *buf, size_t size int modem_pipe_receive(struct modem_pipe *pipe, uint8_t *buf, size_t size) { if (!pipe_test_events(pipe, PIPE_EVENT_OPENED_BIT)) { - return -EPERM; + return 0; } pipe_clear_events(pipe, PIPE_EVENT_RECEIVE_READY_BIT); diff --git a/tests/subsys/modem/modem_pipe/src/main.c b/tests/subsys/modem/modem_pipe/src/main.c index 3cb330550fd5..7889d111d1b9 100644 --- a/tests/subsys/modem/modem_pipe/src/main.c +++ b/tests/subsys/modem/modem_pipe/src/main.c @@ -327,6 +327,14 @@ static void test_pipe_notify_receive_ready(void) "Unexpected state %u", (uint32_t)atomic_get(&test_state)); } +static void test_pipe_receive_closed(void) +{ + /* Try to receive from a closed pipe - should return 0 */ + zassert_equal(modem_pipe_receive(test_pipe, test_buffer, test_buffer_size), 0, + "Reading from closed pipe should return 0"); + zassert_false(test_backend.receive_called, "receive should not be called on closed pipe"); +} + ZTEST(modem_pipe, test_async_open_close) { test_pipe_open(); @@ -397,5 +405,16 @@ ZTEST(modem_pipe, test_attach) test_pipe_attach_receive_not_ready_transmit_idle(); } +ZTEST(modem_pipe, test_receive_closed) +{ + test_pipe_open(); + test_reset(); + test_pipe_async_transmit(); + test_reset(); + test_pipe_close(); + /* Test reading from a closed pipe should return 0 */ + test_pipe_receive_closed(); +} + ZTEST_SUITE(modem_pipe, NULL, modem_backend_fake_setup, modem_backend_fake_before, modem_backend_fake_after, NULL); From 23b2c7aa2230a9b6c421b8ea6600f9fc33b6cd7b Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Mon, 13 Oct 2025 11:36:49 +0300 Subject: [PATCH 0263/3334] [nrf fromlist] modem: cmux: Add struct cmux_config into struct cmux Instead of copying all fields from cmux_config into run-time struct cmux, just have the configuration structure as a member. Upstream PR #: 97362 Signed-off-by: Seppo Takalo (cherry picked from commit be7aff9d1610b623dca478e5cc7c84d860966daa) --- include/zephyr/modem/cmux.h | 63 +++++++++++++++---------------------- subsys/modem/modem_cmux.c | 59 ++++++++++++++++------------------ 2 files changed, 52 insertions(+), 70 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 18bb6fff980d..0faa8d5d4b38 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -53,6 +53,30 @@ enum modem_cmux_event { typedef void (*modem_cmux_callback)(struct modem_cmux *cmux, enum modem_cmux_event event, void *user_data); +/** + * @brief Contains CMUX instance configuration data + */ +struct modem_cmux_config { + /** Invoked when event occurs */ + modem_cmux_callback callback; + /** Free to use pointer passed to event handler when invoked */ + void *user_data; + /** Receive buffer */ + uint8_t *receive_buf; + /** Size of receive buffer in bytes [127, ...] */ + uint16_t receive_buf_size; + /** Transmit buffer */ + uint8_t *transmit_buf; + /** Size of transmit buffer in bytes [149, ...] */ + uint16_t transmit_buf_size; + /** Enable runtime power management */ + bool enable_runtime_power_management; + /** Close pipe on power save */ + bool close_pipe_on_power_save; + /** Idle timeout for power save */ + k_timeout_t idle_timeout; +}; + /** * @cond INTERNAL_HIDDEN */ @@ -148,10 +172,6 @@ struct modem_cmux { /* Bus pipe */ struct modem_pipe *pipe; - /* Event handler */ - modem_cmux_callback callback; - void *user_data; - /* DLCI channel contexts */ sys_slist_t dlcis; @@ -159,12 +179,6 @@ struct modem_cmux { enum modem_cmux_state state; bool flow_control_on : 1; bool initiator : 1; - /** Enable runtime power management */ - bool enable_runtime_power_management; - /** Close pipe on power save */ - bool close_pipe_on_power_save; - /** Idle timeout for power save */ - k_timeout_t idle_timeout; /* Work lock */ bool attached : 1; @@ -172,10 +186,6 @@ struct modem_cmux { /* Receive state*/ enum modem_cmux_receive_state receive_state; - - /* Receive buffer */ - uint8_t *receive_buf; - uint16_t receive_buf_size; uint16_t receive_buf_len; uint8_t work_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; @@ -206,36 +216,13 @@ struct modem_cmux { struct modem_stats_buffer receive_buf_stats; struct modem_stats_buffer transmit_buf_stats; #endif + struct modem_cmux_config config; }; /** * @endcond */ -/** - * @brief Contains CMUX instance configuration data - */ -struct modem_cmux_config { - /** Invoked when event occurs */ - modem_cmux_callback callback; - /** Free to use pointer passed to event handler when invoked */ - void *user_data; - /** Receive buffer */ - uint8_t *receive_buf; - /** Size of receive buffer in bytes [127, ...] */ - uint16_t receive_buf_size; - /** Transmit buffer */ - uint8_t *transmit_buf; - /** Size of transmit buffer in bytes [149, ...] */ - uint16_t transmit_buf_size; - /** Enable runtime power management */ - bool enable_runtime_power_management; - /** Close pipe on power save */ - bool close_pipe_on_power_save; - /** Idle timeout for power save */ - k_timeout_t idle_timeout; -}; - /** * @brief Initialize CMUX instance * @param cmux CMUX instance diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 94c249aaa938..1edf3feaff41 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -400,7 +400,7 @@ static uint32_t modem_cmux_get_receive_buf_length(struct modem_cmux *cmux) static uint32_t modem_cmux_get_receive_buf_size(struct modem_cmux *cmux) { - return cmux->receive_buf_size; + return cmux->config.receive_buf_size; } static uint32_t modem_cmux_get_transmit_buf_length(struct modem_cmux *cmux) @@ -483,11 +483,11 @@ static void modem_cmux_log_received_command(const struct modem_cmux_command *com static void modem_cmux_raise_event(struct modem_cmux *cmux, enum modem_cmux_event event) { - if (cmux->callback == NULL) { + if (cmux->config.callback == NULL) { return; } - cmux->callback(cmux, event, cmux->user_data); + cmux->config.callback(cmux, event, cmux->config.user_data); } static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_event event, @@ -506,7 +506,7 @@ static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_eve break; case MODEM_PIPE_EVENT_TRANSMIT_IDLE: /* If we keep UART open in power-save, we should avoid waking up on RX idle */ - if (!cmux->close_pipe_on_power_save && is_powersaving(cmux)) { + if (!cmux->config.close_pipe_on_power_save && is_powersaving(cmux)) { break; } modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); @@ -896,7 +896,7 @@ static void modem_cmux_on_psc_response(struct modem_cmux *cmux) set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); k_mutex_unlock(&cmux->transmit_rb_lock); - if (cmux->close_pipe_on_power_save) { + if (cmux->config.close_pipe_on_power_save) { modem_pipe_close_async(cmux->pipe); } } @@ -1244,8 +1244,8 @@ static void modem_cmux_drop_frame(struct modem_cmux *cmux) #if defined(CONFIG_MODEM_CMUX_LOG_LEVEL_DBG) struct modem_cmux_frame *frame = &cmux->frame; - frame->data = cmux->receive_buf; - modem_cmux_log_frame(frame, "dropped", MIN(frame->data_len, cmux->receive_buf_size)); + frame->data = cmux->config.receive_buf; + modem_cmux_log_frame(frame, "dropped", MIN(frame->data_len, cmux->config.receive_buf_size)); #endif } @@ -1369,9 +1369,9 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by break; } - if (cmux->frame.data_len > cmux->receive_buf_size) { + if (cmux->frame.data_len > cmux->config.receive_buf_size) { LOG_ERR("Indicated frame data length %u exceeds receive buffer size %u", - cmux->frame.data_len, cmux->receive_buf_size); + cmux->frame.data_len, cmux->config.receive_buf_size); modem_cmux_drop_frame(cmux); break; @@ -1383,8 +1383,8 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by case MODEM_CMUX_RECEIVE_STATE_DATA: /* Copy byte to data */ - if (cmux->receive_buf_len < cmux->receive_buf_size) { - cmux->receive_buf[cmux->receive_buf_len] = byte; + if (cmux->receive_buf_len < cmux->config.receive_buf_size) { + cmux->config.receive_buf[cmux->receive_buf_len] = byte; } cmux->receive_buf_len++; @@ -1397,9 +1397,9 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by break; case MODEM_CMUX_RECEIVE_STATE_FCS: - if (cmux->receive_buf_len > cmux->receive_buf_size) { - LOG_WRN("Receive buffer overrun (%u > %u)", - cmux->receive_buf_len, cmux->receive_buf_size); + if (cmux->receive_buf_len > cmux->config.receive_buf_size) { + LOG_WRN("Receive buffer overrun (%u > %u)", cmux->receive_buf_len, + cmux->config.receive_buf_size); modem_cmux_drop_frame(cmux); break; } @@ -1433,7 +1433,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by } /* Process frame */ - cmux->frame.data = cmux->receive_buf; + cmux->frame.data = cmux->config.receive_buf; modem_cmux_on_frame(cmux); /* Await start of next frame */ @@ -1483,7 +1483,7 @@ static void modem_cmux_runtime_pm_handler(struct k_work *item) struct k_work_delayable *dwork = k_work_delayable_from_work(item); struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, runtime_pm_work); - if (!cmux->enable_runtime_power_management) { + if (!cmux->config.enable_runtime_power_management) { return; } @@ -1510,12 +1510,12 @@ static void modem_cmux_runtime_pm_handler(struct k_work *item) static void runtime_pm_keepalive(struct modem_cmux *cmux) { - if (cmux == NULL || !cmux->enable_runtime_power_management) { + if (cmux == NULL || !cmux->config.enable_runtime_power_management) { return; } - cmux->idle_timepoint = sys_timepoint_calc(cmux->idle_timeout); - k_work_reschedule(&cmux->runtime_pm_work, cmux->idle_timeout); + cmux->idle_timepoint = sys_timepoint_calc(cmux->config.idle_timeout); + k_work_reschedule(&cmux->runtime_pm_work, cmux->config.idle_timeout); } /** Transmit bytes bypassing the CMUX buffers. @@ -1540,7 +1540,7 @@ static bool powersave_wait_wakeup(struct modem_cmux *cmux) LOG_DBG("Power saving mode, wake up first"); set_state(cmux, MODEM_CMUX_STATE_WAKEUP); - if (cmux->close_pipe_on_power_save) { + if (cmux->config.close_pipe_on_power_save) { ret = modem_pipe_open(cmux->pipe, K_FOREVER); if (ret < 0) { LOG_ERR("Failed to open pipe for wake up (%d)", ret); @@ -1629,7 +1629,7 @@ static void modem_cmux_transmit_handler(struct k_work *item) if (cmux->state == MODEM_CMUX_STATE_CONFIRM_POWERSAVE) { set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); LOG_DBG("Entered power saving mode"); - if (cmux->close_pipe_on_power_save) { + if (cmux->config.close_pipe_on_power_save) { modem_pipe_close_async(cmux->pipe); } } @@ -1934,18 +1934,13 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co __ASSERT_NO_MSG(config->transmit_buf != NULL); __ASSERT_NO_MSG(config->transmit_buf_size >= MODEM_CMUX_DATA_FRAME_SIZE_MAX); - memset(cmux, 0x00, sizeof(*cmux)); - cmux->callback = config->callback; - cmux->user_data = config->user_data; - cmux->receive_buf = config->receive_buf; - cmux->receive_buf_size = config->receive_buf_size; - cmux->t3_timepoint = sys_timepoint_calc(K_NO_WAIT); - cmux->enable_runtime_power_management = config->enable_runtime_power_management; - cmux->close_pipe_on_power_save = config->close_pipe_on_power_save; - cmux->idle_timeout = - cmux->enable_runtime_power_management ? config->idle_timeout : K_FOREVER; + *cmux = (struct modem_cmux){ + .t3_timepoint = sys_timepoint_calc(K_NO_WAIT), + .config = *config, + }; sys_slist_init(&cmux->dlcis); - ring_buf_init(&cmux->transmit_rb, config->transmit_buf_size, config->transmit_buf); + ring_buf_init(&cmux->transmit_rb, cmux->config.transmit_buf_size, + cmux->config.transmit_buf); k_mutex_init(&cmux->transmit_rb_lock); k_work_init_delayable(&cmux->receive_work, modem_cmux_receive_handler); k_work_init_delayable(&cmux->transmit_work, modem_cmux_transmit_handler); From c9f7b705358d7b7fa68d8a1b354e5fc1baf238dd Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 16 Oct 2025 10:18:49 +0100 Subject: [PATCH 0264/3334] [nrf fromtree] drivers: clock_control: Add macros for AUXPLL output frequencies These represent the outputted frequencies of the AUXPLL of different settings set in the device tree set using dt-bindings in nrf-auxpll.h. This is added to remove the need for 'magic numbers' in drivers and tests. Signed-off-by: David Jewsbury (cherry picked from commit 077021070c139838771067142a7752b5c95eaf2b) --- .../drivers/clock_control/nrf_clock_control.h | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/zephyr/drivers/clock_control/nrf_clock_control.h b/include/zephyr/drivers/clock_control/nrf_clock_control.h index 37fc4a1f1a85..7fa4530a6a04 100644 --- a/include/zephyr/drivers/clock_control/nrf_clock_control.h +++ b/include/zephyr/drivers/clock_control/nrf_clock_control.h @@ -188,6 +188,29 @@ uint32_t z_nrf_clock_bt_ctlr_hf_get_startup_time_us(void); /* Specifies that default precision of the clock is sufficient. */ #define NRF_CLOCK_CONTROL_PRECISION_DEFAULT 0 +/* AUXPLL devicetree takes in raw register values, these are the actual frequencies outputted */ +#define CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_MIN_HZ 80000000 +#define CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_AUDIO_44K1_HZ 11289591 +#define CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_USB24M_HZ 24000000 +#define CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_AUDIO_48K_HZ 12287963 + +/* Internal helper macro to map DT property value to output frequency */ +#define _CLOCK_CONTROL_NRF_AUXPLL_MAP_FREQ(freq_val) \ + ((freq_val) == NRF_AUXPLL_FREQ_DIV_MIN ? \ + CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_MIN_HZ : \ + (freq_val) == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 ? \ + CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_AUDIO_44K1_HZ : \ + (freq_val) == NRF_AUXPLL_FREQ_DIV_USB24M ? \ + CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_USB24M_HZ : \ + (freq_val) == NRF_AUXPLL_FREQ_DIV_AUDIO_48K ? \ + CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_AUDIO_48K_HZ : 0) + +/* Public macro to get output frequency of AUXPLL */ +#define CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(node) \ + COND_CODE_1(DT_NODE_HAS_PROP(node, nordic_frequency), \ + (_CLOCK_CONTROL_NRF_AUXPLL_MAP_FREQ(DT_PROP(node, nordic_frequency))), \ + (0)) + struct nrf_clock_spec { uint32_t frequency; uint16_t accuracy : 15; From 5f7cb30e6ee73d694ab46ae2c15d4ef199f56bb6 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 16 Oct 2025 10:28:05 +0100 Subject: [PATCH 0265/3334] [nrf fromtree] drivers: audio: dmic_nrfx: Update AUXPLL control with frequency macros Frequencies being for AUXPLL were register assignments and not actual frequencies. Signed-off-by: David Jewsbury (cherry picked from commit eb605628ae0970b7aa80091954c8277794ba24b6) --- drivers/audio/dmic_nrfx_pdm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index c2c80a7414c1..a2d630f847a9 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -24,11 +24,15 @@ LOG_MODULE_REGISTER(dmic_nrfx_pdm, CONFIG_AUDIO_DMIC_LOG_LEVEL); #define DMIC_NRFX_CLOCK_FACTOR 8192 #define DMIC_NRFX_AUDIO_CLOCK_FREQ DT_PROP_OR(NODE_AUDIOPLL, frequency, 0) #elif DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) -#define DMIC_NRFX_AUDIO_CLOCK_FREQ DT_PROP(NODE_AUDIO_AUXPLL, nordic_frequency) -BUILD_ASSERT((DMIC_NRFX_AUDIO_CLOCK_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_48K) || - (DMIC_NRFX_AUDIO_CLOCK_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1), +#define AUXPLL_FREQUENCY_SETTING DT_PROP(NODE_AUDIO_AUXPLL, nordic_frequency) +BUILD_ASSERT((AUXPLL_FREQUENCY_SETTING == NRF_AUXPLL_FREQ_DIV_AUDIO_48K) || + (AUXPLL_FREQUENCY_SETTING == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1), "Unsupported Audio AUXPLL frequency selection for PDM"); + +#define DMIC_NRFX_AUDIO_CLOCK_FREQ CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(NODE_AUDIO_AUXPLL) + #define DMIC_NRFX_CLOCK_FREQ MHZ(32) + #else #define DMIC_NRFX_CLOCK_FREQ MHZ(32) #define DMIC_NRFX_CLOCK_FACTOR 4096 From 6038f47d230e632c89ad53a29ce4bc9ac6fc5ca1 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 16 Oct 2025 10:29:29 +0100 Subject: [PATCH 0266/3334] [nrf fromtree] tests: drivers: Update AUXPLL test to use frequency Macros Eliminate the need for magic numbers when setting AUXPLL_FREQ_OUT Signed-off-by: David Jewsbury (cherry picked from commit 9a3a954b3497303f0942650d7c65d7c7f7390bf4) --- .../clock_control/nrf_clock_control/src/main.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/drivers/clock_control/nrf_clock_control/src/main.c b/tests/drivers/clock_control/nrf_clock_control/src/main.c index 83fdc98ca193..3612373a867d 100644 --- a/tests/drivers/clock_control/nrf_clock_control/src/main.c +++ b/tests/drivers/clock_control/nrf_clock_control/src/main.c @@ -162,17 +162,10 @@ static const struct test_clk_context lfclk_test_clk_contexts[] = { #define AUXPLL_NODE DT_INST(0, AUXPLL_COMPAT) #define AUXPLL_FREQ DT_PROP(AUXPLL_NODE, nordic_frequency) -/* Gets selected AUXPLL DIV and selects the expected frequency */ -#if AUXPLL_FREQ == NRF_AUXPLL_FREQUENCY_DIV_MIN -#define AUXPLL_FREQ_OUT 80000000 -#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 -#define AUXPLL_FREQ_OUT 11289591 -#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_USB_24M -#define AUXPLL_FREQ_OUT 24000000 -#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_48K -#define AUXPLL_FREQ_OUT 12287963 -#else -/*No use case for NRF_AUXPLL_FREQ_DIV_MAX or others yet*/ + +/* Gets expected AUXPLL frequency */ +#define AUXPLL_FREQ_OUT CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(AUXPLL_NODE) +#if AUXPLL_FREQ_OUT == 0 #error "Unsupported AUXPLL frequency selection" #endif From 1432164b4e417f1e486f99259054b6526fbe22db Mon Sep 17 00:00:00 2001 From: Erdem Simsek Date: Thu, 16 Oct 2025 09:16:16 +0100 Subject: [PATCH 0267/3334] [nrf fromtree] drivers: i2s: Support audio auxpll in TDM driver Add support for audio_auxpll clock source as an alternative to audiopll in the i2s_nrf_tdm driver. This enables TDM functionality on platforms that use the auxiliary PLL for audio clocking. - Add audio_auxpll node detection and configuration - Update clock management to support both audiopll and audio_auxpll - Add build assertions for supported frequency configurations Signed-off-by: Erdem Simsek (cherry picked from commit 8338097b1d5008ec88982c42a7bd53223042b5eb) --- drivers/i2s/i2s_nrf_tdm.c | 48 +++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index fc823ce5055a..07c561b77503 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -47,11 +48,13 @@ LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(audiopll)) #define NODE_ACLK DT_NODELABEL(audiopll) #define ACLK_FREQUENCY DT_PROP_OR(NODE_ACLK, frequency, 0) - -static const struct device *audiopll = DEVICE_DT_GET(NODE_ACLK); -static const struct nrf_clock_spec aclk_spec = { - .frequency = ACLK_FREQUENCY, -}; +#elif DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(audio_auxpll)) +#define NODE_AUDIO_AUXPLL DT_NODELABEL(audio_auxpll) +#define ACLK_NORDIC_FREQUENCY DT_PROP(NODE_AUDIO_AUXPLL, nordic_frequency) +BUILD_ASSERT((ACLK_NORDIC_FREQUENCY == NRF_AUXPLL_FREQ_DIV_AUDIO_48K) || + (ACLK_NORDIC_FREQUENCY == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1), + "Unsupported Audio AUXPLL frequency selection for TDM"); +#define ACLK_FREQUENCY CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(NODE_AUDIO_AUXPLL) #elif DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(aclk)) #define NODE_ACLK DT_NODELABEL(aclk) #define ACLK_FREQUENCY DT_PROP_OR(NODE_ACLK, clock_frequency, 0) @@ -107,7 +110,10 @@ struct tdm_drv_cfg { }; struct tdm_drv_data { -#if CONFIG_CLOCK_CONTROL_NRF +#if CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL || DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) + const struct device *audiopll; + struct nrf_clock_spec aclk_spec; +#elif CONFIG_CLOCK_CONTROL_NRF struct onoff_manager *clk_mgr; #endif struct onoff_client clk_cli; @@ -132,8 +138,10 @@ static int audio_clock_request(struct tdm_drv_data *drv_data) { #if DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRF return onoff_request(drv_data->clk_mgr, &drv_data->clk_cli); -#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL - return nrf_clock_control_request(audiopll, &aclk_spec, &drv_data->clk_cli); +#elif (DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL) || \ + DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) + return nrf_clock_control_request(drv_data->audiopll, &drv_data->aclk_spec, + &drv_data->clk_cli); #else (void)drv_data; @@ -145,10 +153,9 @@ static int audio_clock_release(struct tdm_drv_data *drv_data) { #if DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRF return onoff_release(drv_data->clk_mgr); -#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL - (void)drv_data; - - return nrf_clock_control_release(audiopll, &aclk_spec); +#elif (DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL) || \ + DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) + return nrf_clock_control_release(drv_data->audiopll, &drv_data->aclk_spec); #else (void)drv_data; @@ -1120,6 +1127,16 @@ static void clock_manager_init(const struct device *dev) subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO; drv_data->clk_mgr = z_nrf_clock_control_get_onoff(subsys); __ASSERT_NO_MSG(drv_data->clk_mgr != NULL); +#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL + struct tdm_drv_data *drv_data = dev->data; + + drv_data->audiopll = DEVICE_DT_GET(NODE_ACLK); + drv_data->aclk_spec.frequency = ACLK_FREQUENCY; +#elif DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) + struct tdm_drv_data *drv_data = dev->data; + + drv_data->audiopll = DEVICE_DT_GET(NODE_AUDIO_AUXPLL); + drv_data->aclk_spec.frequency = ACLK_FREQUENCY; #else (void)dev; #endif @@ -1194,9 +1211,10 @@ static DEVICE_API(i2s, tdm_nrf_drv_api) = { clock_manager_init(dev); \ return 0; \ } \ - BUILD_ASSERT((TDM_SCK_CLK_SRC(idx) != ACLK && TDM_MCK_CLK_SRC(idx) != ACLK) || \ - DT_NODE_HAS_STATUS_OKAY(NODE_ACLK), \ - "Clock source ACLK requires the audiopll node."); \ + BUILD_ASSERT((TDM_SCK_CLK_SRC(idx) != ACLK && TDM_MCK_CLK_SRC(idx) != ACLK) || \ + (DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) || \ + DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL)), \ + "Clock source ACLK requires the audiopll/audio_auxpll node."); \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(TDM(idx)); \ DEVICE_DT_DEFINE(TDM(idx), tdm_nrf_init##idx, NULL, &tdm_nrf_data##idx, &tdm_nrf_cfg##idx, \ POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, &tdm_nrf_drv_api); From 3f1c7b4e946ccc8525a4cd16fb97e4ded02fc781 Mon Sep 17 00:00:00 2001 From: Erdem Simsek Date: Mon, 20 Oct 2025 17:41:28 +0100 Subject: [PATCH 0268/3334] [nrf fromtree] tests: drivers: Trigger drop event for proper clean-up Add I2S_TRIGGER_DROP call in the error test to ensure proper cleanup after stopping the I2S device. This validates that the drop trigger is properly handled in error conditions and resources are released. Signed-off-by: Erdem Simsek (cherry picked from commit aec9da060b93d8c9e039233cc75d695d0eb8d007) --- tests/drivers/i2s/i2s_api/src/test_i2s_errors.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/drivers/i2s/i2s_api/src/test_i2s_errors.c b/tests/drivers/i2s/i2s_api/src/test_i2s_errors.c index 477292d84c26..230a71e95d4d 100644 --- a/tests/drivers/i2s/i2s_api/src/test_i2s_errors.c +++ b/tests/drivers/i2s/i2s_api/src/test_i2s_errors.c @@ -76,6 +76,9 @@ ZTEST_USER(i2s_errors, test_i2s_config_attempt_in_wrong_state) err = i2s_trigger(dev_i2s, I2S_DIR_TX, I2S_TRIGGER_STOP); zassert_equal(err, 0, "I2S_TRIGGER_STOP unexpected error: %d", err); + err = i2s_trigger(dev_i2s, I2S_DIR_TX, I2S_TRIGGER_DROP); + zassert_equal(err, 0, "I2S_TRIGGER_DROP unexpected error: %d", err); + zassert_not_equal( config_err, 0, "I2S configuration should not be possible in states other than I2S_STATE_READY"); From 6cd23ef161192c2cb640e2f816c82e0f46e4925a Mon Sep 17 00:00:00 2001 From: Phuc Pham Date: Mon, 25 Aug 2025 17:57:15 +0700 Subject: [PATCH 0269/3334] [nrf fromtree] manifest: Update commit id for hal_renesas Update commit id for hal_renesas Signed-off-by: Phuc Pham Signed-off-by: Tien Nguyen (cherry picked from commit 62116a7e7435c070000f28a7392bc60519e7d66a) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index b84f3e46eb9e..e88a416ffaec 100644 --- a/west.yml +++ b/west.yml @@ -226,7 +226,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: 74c9186c0a01c53e320421bd0e8b85fc266f3260 + revision: 6ff5c0662bc9ad4a126be28eab0addcb2454fe69 groups: - hal - name: hal_rpi_pico From b4ff4d1796bcf0baa63d8e4218591a1e853d7ac3 Mon Sep 17 00:00:00 2001 From: Khoa Tran Date: Wed, 5 Mar 2025 12:35:06 +0700 Subject: [PATCH 0270/3334] [nrf fromtree] manifest: Update revision of hal_renesas Update revision of hal_renesas to get the FSP 6.1.0 migration Signed-off-by: Khoa Tran (cherry picked from commit 620738016e268b895ed3a9a04c0726aa7b0ec16f) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e88a416ffaec..66d2e1c00348 100644 --- a/west.yml +++ b/west.yml @@ -226,7 +226,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: 6ff5c0662bc9ad4a126be28eab0addcb2454fe69 + revision: f0b78440ba8f0b4a07cdd657031ac9ec1cc4c126 groups: - hal - name: hal_rpi_pico From 24e154744a018d2a09d8ffdafc7003e255f447fe Mon Sep 17 00:00:00 2001 From: Khoa Tran Date: Wed, 5 Mar 2025 12:35:06 +0700 Subject: [PATCH 0271/3334] [nrf fromtree] manifest: update revision of hal_renesas to latest Update revision of hal_renesas to get RA8T2 support Signed-off-by: Khoa Tran (cherry picked from commit ac941a398617ba4f031f5f19803fa689686bc78a) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 66d2e1c00348..19c87b1b4e77 100644 --- a/west.yml +++ b/west.yml @@ -226,7 +226,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: f0b78440ba8f0b4a07cdd657031ac9ec1cc4c126 + revision: d8ee5f18e95b9f4616a481be65e2c9ee0af1779f groups: - hal - name: hal_rpi_pico From 8e8b93ca47cc835697f196d556540ee0426e4d01 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Wed, 24 Sep 2025 14:24:05 +0000 Subject: [PATCH 0272/3334] [nrf fromtree] west.yml: update few modules to pickup min/max define guards Update the few modules to pick up some redefinition fixes. Signed-off-by: Fabio Baltieri (cherry picked from commit 056f3b07cedf547707878067f19edb5c04e4b7f1) --- west.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/west.yml b/west.yml index 19c87b1b4e77..e507c2f15991 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 979a58d0829108b57f10e90b6c3fc35ab6206e4b + revision: 2c0fd06a98bb9b89ac234b75b2c217742f0df1ba path: modules/hal/nordic groups: - hal @@ -226,7 +226,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: d8ee5f18e95b9f4616a481be65e2c9ee0af1779f + revision: 740a944351300664ea17fb7913f0036a5263f008 groups: - hal - name: hal_rpi_pico @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: acb24fe26f479df9dba3c4bd97ea653ad3086ee7 + revision: 53500666a59195b44e2e5a939c111effbf23db7b path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From 3ee3cb1b84c6568c4daf420e3762c1f36b44abdb Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Wed, 29 Oct 2025 12:01:28 +0000 Subject: [PATCH 0273/3334] [nrf fromtree] manifest: Update hal_nordic to pull file missing in mdk 8.72.4 release Update hal_nordic to pull file missing change from mdk 8.72.4 release Signed-off-by: Robert Robinson (cherry picked from commit 84dfdedc87df84caf1705d4aa1c13209b7016d9a) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e507c2f15991..f08cf11203a6 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 2c0fd06a98bb9b89ac234b75b2c217742f0df1ba + revision: 7858281d843468fe53c829995fb63f45a227387a path: modules/hal/nordic groups: - hal From 1914deeb2c206cf1ce35cb4b64a93371a4d5f3c8 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 30 Sep 2025 11:33:35 +0530 Subject: [PATCH 0274/3334] [nrf noup] manifest: nrf_wifi: Pull script to parse nRF70 FW stats blob A helper script is added to the nrf_wifi repo for parsing and dumping nRF70 FW stats blob. Note: "noup" to avoid churn by pulling min/max PR. Signed-off-by: Chaitanya Tata (cherry picked from commit 23ee39f92a3acdac07b99e41cb43771330892a89) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f08cf11203a6..01532b68b61a 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 53500666a59195b44e2e5a939c111effbf23db7b + revision: b822726084f55df19aa6660dc46cf602757e8645 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From 7f8c8762a56f3504ffea11d5eba2a72617666944 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 30 Sep 2025 20:56:48 +0530 Subject: [PATCH 0275/3334] [nrf fromtree] manifest: nrf_wifi: Pull nRF71 support Pull nRF71 OSAL support, full support is till TBD. Signed-off-by: Chaitanya Tata (cherry picked from commit 9f8bb3cda365a061d8713a8533d37e6db29f9522) (cherry picked from commit cdfeb62ee70a401c160fe4951fc9391bbc51be52) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 01532b68b61a..1bff38e1c7b8 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: b822726084f55df19aa6660dc46cf602757e8645 + revision: e269670cd17fb8ccc4b7004544276bc7d9578496 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From 702676c88d3bc3ac4c213fcba5d78a83a5fca0c0 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 4 Nov 2025 12:27:59 +0100 Subject: [PATCH 0276/3334] [nrf fromlist] Bluetooth: Controller: Add BT_HCI_VS_FATAL_ERROR_SUPPORT Add BT_HCI_VS_FATAL_ERROR_SUPPORT Kconfig to allow out-of-tree Controllers to control Zephyr HCI Vendor- Specific Fatal Error event support. Upstream PR #: 98840 Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 25f7b905665e488a00e66ed1335f1b46d87b53ef) --- subsys/bluetooth/common/Kconfig | 5 ++++- subsys/bluetooth/controller/Kconfig.ll_sw_split | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index f4fb9ab9bc75..ae95785f8ab3 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -230,9 +230,12 @@ config BT_HCI_VS Host and/or Controller. This enables Set Version Information, Supported Commands, Supported Features vendor commands. +config BT_HCI_VS_FATAL_ERROR_SUPPORT + bool + config BT_HCI_VS_FATAL_ERROR bool "Allow vendor specific HCI event Zephyr Fatal Error" - depends on BT_HCI_VS + depends on BT_HCI_VS && BT_HCI_VS_FATAL_ERROR_SUPPORT help Enable emitting HCI Vendor-Specific events for system and Controller errors that are unrecoverable. diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index b6774d63c7c6..744727eb11f3 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -17,6 +17,7 @@ config BT_LLL_VENDOR_NORDIC select EXPERIMENTAL if !ENTROPY_HAS_DRIVER select BT_HAS_HCI_VS + select BT_HCI_VS_FATAL_ERROR_SUPPORT select BT_CTLR_CRYPTO_SUPPORT select BT_CTLR_LE_ENC_SUPPORT if BT_CTLR_CRYPTO_SUPPORT && \ !BT_CTLR_DATA_LENGTH_CLEAR && \ From 44217a5e8182e1d52ddd554504881c2193596f2f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 19 Sep 2025 16:57:35 +0200 Subject: [PATCH 0277/3334] [nrf fromtree] pm: bind the PM_S2RAM kconfig option to devicetree Currently it is possible to have an enabled (status="okay") "suspend-to-ram" "zephyr,power-state" in the devicetree, CONFIG_PM=y, but CONFIG_PM_S2RAM=n This means the presence and state of the "suspend-to-ram" power state in the devicetree does not match the PM_S2RAM option, despite PM_S2RAM being dependent on the devicetree state. This commit makes the devicetree the "source of truth" for whether one or more s2ram power states shall be included and supported, by enabling PM_S2RAM if any s2ram power state with status "okay" is present in the devicetree. To disable the s2ram power state, like with any other state, disable it by setting its state to "disabled". The help of the now promptless PM_S2RAM config has been updated to reflect the new meaning. It previously held cortex-m specific implementation details, these have been removed as these details are already present in the file pointed to as well (arch/arm/core/cortex_m/pm_s2ram.c line 22) Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 4626f6b776f662702934ac85929edc35dce832b1) --- samples/boards/nordic/spis_wakeup/prj.conf | 1 - .../nordic/spis_wakeup/wakeup_trigger/prj.conf | 1 - .../boards/st/power_mgmt/suspend_to_ram/prj.conf | 1 - subsys/pm/Kconfig | 13 ++++++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/boards/nordic/spis_wakeup/prj.conf b/samples/boards/nordic/spis_wakeup/prj.conf index ca92fc6de6ae..c1cc933296f0 100644 --- a/samples/boards/nordic/spis_wakeup/prj.conf +++ b/samples/boards/nordic/spis_wakeup/prj.conf @@ -3,7 +3,6 @@ CONFIG_SPI_SLAVE=y CONFIG_GPIO=y CONFIG_PM=y -CONFIG_PM_S2RAM=y CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf index 1de6459a6083..9c30d5a98fd7 100644 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf @@ -3,7 +3,6 @@ CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500 CONFIG_GPIO=y CONFIG_PM=y -CONFIG_PM_S2RAM=y CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/samples/boards/st/power_mgmt/suspend_to_ram/prj.conf b/samples/boards/st/power_mgmt/suspend_to_ram/prj.conf index b9a1cf9305e4..1f23c5a27e2c 100644 --- a/samples/boards/st/power_mgmt/suspend_to_ram/prj.conf +++ b/samples/boards/st/power_mgmt/suspend_to_ram/prj.conf @@ -2,7 +2,6 @@ CONFIG_PM=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y CONFIG_PM_DEVICE_SYSTEM_MANAGED=y -CONFIG_PM_S2RAM=y CONFIG_ADC=y CONFIG_ENTROPY_GENERATOR=y CONFIG_SPI=y diff --git a/subsys/pm/Kconfig b/subsys/pm/Kconfig index d1d99ac02e3a..abd424a88009 100644 --- a/subsys/pm/Kconfig +++ b/subsys/pm/Kconfig @@ -33,14 +33,17 @@ config PM_STATS help Enable System Power Management Stats. +DT_POWER_STATE_COMPAT := zephyr,power-state + config PM_S2RAM - bool "Suspend-to-RAM (S2RAM)" + bool + default y depends on ARCH_HAS_SUSPEND_TO_RAM + depends on $(dt_compat_any_has_prop,$(DT_POWER_STATE_COMPAT),power-state-name,suspend-to-ram) help - This option enables suspend-to-RAM (S2RAM). - When enabled on Cortex-M, and a 'zephyr,memory-region' compatible node with nodelabel - 'pm_s2ram' is defined in DT, _cpu_context symbol (located in arch/arm/core/cortex_m/pm_s2ram.c) - is placed in linker section given by 'zephyr,memory-region' property of aforementioned node. + This option enables the SoC specific implementations of suspend-to-ram (S2RAM) + sleep states if PM is enabled and one or more suspend-to-ram sleep states are + enabled in the devicetree. config PM_S2RAM_CUSTOM_MARKING bool "Use custom marking functions" From ec40f54e613e48a4adaa8bd15b2666aa13a8c6c2 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 22 Sep 2025 07:28:21 +0200 Subject: [PATCH 0278/3334] [nrf fromtree] pm: refactor PM_S2RAM_CUSTOM_MARKING option to be promptless The config PM_S2RAM_CUSTOM_MARKING is not an optional config for a user to select, it is required by some soc implementations of S2RAM, in which case it must be selected by the soc. Refactor the configuration to be HAS_PM_S2RAM_CUSTOM_MARKING, and make the currently only soc which needs it select it. Then update samples which previously had to select this option for this soc. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 1767f131aac706f978eb93bd548b7e7419a0457d) --- arch/arm/core/cortex_m/pm_s2ram.c | 4 ++-- include/zephyr/arch/common/pm_s2ram.h | 8 ++++---- samples/boards/nordic/spis_wakeup/prj.conf | 1 - .../nordic/spis_wakeup/wakeup_trigger/prj.conf | 1 - soc/nordic/nrf54h/Kconfig | 2 ++ subsys/pm/Kconfig | 15 ++++++++------- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/arch/arm/core/cortex_m/pm_s2ram.c b/arch/arm/core/cortex_m/pm_s2ram.c index 81a4ae20a4f6..ce80c78a078a 100644 --- a/arch/arm/core/cortex_m/pm_s2ram.c +++ b/arch/arm/core/cortex_m/pm_s2ram.c @@ -28,7 +28,7 @@ __noinit #endif _cpu_context_t _cpu_context; -#ifndef CONFIG_PM_S2RAM_CUSTOM_MARKING +#ifndef CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING /** * S2RAM Marker */ @@ -50,4 +50,4 @@ bool pm_s2ram_mark_check_and_clear(void) return false; } -#endif /* CONFIG_PM_S2RAM_CUSTOM_MARKING */ +#endif /* CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING */ diff --git a/include/zephyr/arch/common/pm_s2ram.h b/include/zephyr/arch/common/pm_s2ram.h index 34c544c769b9..322cefe6ebb2 100644 --- a/include/zephyr/arch/common/pm_s2ram.h +++ b/include/zephyr/arch/common/pm_s2ram.h @@ -63,8 +63,8 @@ int arch_pm_s2ram_suspend(pm_s2ram_system_off_fn_t system_off); * Function is called when system state is stored to RAM, just before going to system * off. * - * Default implementation is setting a magic word in RAM. CONFIG_PM_S2RAM_CUSTOM_MARKING - * allows custom implementation. + * Default implementation is setting a magic word in RAM used if + * CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING is not set. */ void pm_s2ram_mark_set(void); @@ -74,8 +74,8 @@ void pm_s2ram_mark_set(void); * Function is used to determine if resuming after suspend-to-RAM shall be performed * or standard boot code shall be executed. * - * Default implementation is checking a magic word in RAM. CONFIG_PM_S2RAM_CUSTOM_MARKING - * allows custom implementation. + * Default implementation is checking a magic word in RAM used if + * CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING is not set. * * @retval true if marking is found which indicates resuming after suspend-to-RAM. * @retval false if marking is not found which indicates standard boot. diff --git a/samples/boards/nordic/spis_wakeup/prj.conf b/samples/boards/nordic/spis_wakeup/prj.conf index c1cc933296f0..e313ffeed82b 100644 --- a/samples/boards/nordic/spis_wakeup/prj.conf +++ b/samples/boards/nordic/spis_wakeup/prj.conf @@ -3,7 +3,6 @@ CONFIG_SPI_SLAVE=y CONFIG_GPIO=y CONFIG_PM=y -CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf index 9c30d5a98fd7..ad4577807f89 100644 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf @@ -3,7 +3,6 @@ CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500 CONFIG_GPIO=y CONFIG_PM=y -CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 85d55ebf1aa8..d5632943e19f 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -35,6 +35,7 @@ config SOC_NRF54H20_CPUAPP_COMMON select NRFS_HAS_TEMP_SERVICE select NRFS_HAS_VBUS_DETECTOR_SERVICE select HAS_PM + select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF config SOC_NRF54H20_CPUAPP @@ -64,6 +65,7 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_NORDIC_DMM select HAS_NORDIC_RAM_CTRL select HAS_PM + select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF config SOC_NRF54H20_CPURAD_ENABLE diff --git a/subsys/pm/Kconfig b/subsys/pm/Kconfig index abd424a88009..676f4ef229f5 100644 --- a/subsys/pm/Kconfig +++ b/subsys/pm/Kconfig @@ -10,6 +10,14 @@ config HAS_PM This option must be selected by SoCs that provide PM hooks, that is, calls to configure low-power states. +config HAS_PM_S2RAM_CUSTOM_MARKING + bool + depends on HAS_PM + help + By default a magic word in RAM is used to mark entering suspend-to-RAM. If this + option is selected, a custom implementation of functions which handle the marking + must be provided. + config PM bool "System Power Management" depends on SYS_CLOCK_EXISTS && HAS_PM @@ -45,13 +53,6 @@ config PM_S2RAM sleep states if PM is enabled and one or more suspend-to-ram sleep states are enabled in the devicetree. -config PM_S2RAM_CUSTOM_MARKING - bool "Use custom marking functions" - depends on PM_S2RAM - help - By default a magic word in RAM is used to mark entering suspend-to-RAM. Enabling - this option allows custom implementation of functions which handle the marking. - config PM_NEED_ALL_DEVICES_IDLE bool "System Low Power Mode Needs All Devices Idle" depends on PM_DEVICE && !SMP From ad01194b50b88c183b541c3908228657abe62bef Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Sun, 28 Sep 2025 19:43:33 +0200 Subject: [PATCH 0279/3334] [nrf fromtree] soc: nordic: nrf54h: s2ram: Support disabled MPU This commit adds support using pm_s2ram for 54H when the MPU is disabled. This is the case for the out of tree sample `sdk-nrf/samples/nrf54h/empty_app_core`. Without this commit the linker will fail to link `z_arm_mpu_init` and `z_arm_configure_static_mpu_regions`. Signed-off-by: Rubin Gerritsen (cherry picked from commit 05b77ece23e9104aee17e6c11dff544ad0ca8783) --- soc/nordic/nrf54h/pm_s2ram.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index 221293c5b82e..753acdda6832 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -76,7 +76,9 @@ typedef struct { struct backup { _nvic_context_t nvic_context; +#if defined(CONFIG_MPU) _mpu_context_t mpu_context; +#endif _scb_context_t scb_context; #if defined(CONFIG_FPU) && !defined(CONFIG_FPU_SHARING) _fpu_context_t fpu_context; @@ -88,6 +90,7 @@ static __noinit struct backup backup_data; extern void z_arm_configure_static_mpu_regions(void); extern int z_arm_mpu_init(void); +#if defined(CONFIG_MPU) /* MPU registers cannot be simply copied because content of RBARx RLARx registers * depends on region which is selected by RNR register. */ @@ -130,6 +133,7 @@ static void mpu_restore(_mpu_context_t *backup) MPU->RNR = rnr; MPU->CTRL = backup->CTRL; } +#endif /* defined(CONFIG_MPU) */ static void nvic_save(_nvic_context_t *backup) { @@ -231,7 +235,9 @@ int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) fpu_power_down(); #endif nvic_save(&backup_data.nvic_context); +#if defined(CONFIG_MPU) mpu_save(&backup_data.mpu_context); +#endif ret = arch_pm_s2ram_suspend(system_off); /* Cache and FPU are powered down so power up is needed even if s2ram failed. */ nrf_power_up_cache(); @@ -246,7 +252,9 @@ int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) return ret; } +#if defined(CONFIG_MPU) mpu_restore(&backup_data.mpu_context); +#endif nvic_restore(&backup_data.nvic_context); scb_restore(&backup_data.scb_context); From d545d3951ea44e5b13bd72fd2963895607b7ba94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 24 Oct 2025 13:09:10 +0200 Subject: [PATCH 0280/3334] [nrf fromtree] soc: nordic: nrf54h: Disable S2RAM on cpurad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On nrf54h20 only cpuapp supports s2ram low power cpu state. Signed-off-by: Sebastian Głąb (cherry picked from commit 6ec763474f6593ceafe70f79731247ede3721984) --- soc/nordic/nrf54h/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index d5632943e19f..ac25cff79150 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -65,7 +65,6 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_NORDIC_DMM select HAS_NORDIC_RAM_CTRL select HAS_PM - select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF config SOC_NRF54H20_CPURAD_ENABLE From f0657befe0c0a194fa00d0619cd60ca4c4914a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Fri, 24 Oct 2025 11:04:38 +0200 Subject: [PATCH 0281/3334] [nrf fromtree] drivers: mspi_dw: Use uint32_t for dummy_bytes field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the driver allows transfer lengths up to `UINT16_MAX + 1` bytes, and additionally the `dummy_bytes` field includes bytes sent to provide wait cycles on the bus, the type of this field must be `uint32_t`, otherwise it can be overflowed for RX transfers close to the maximum. Signed-off-by: Andrzej Głąbek (cherry picked from commit 70fe96122381eebf42342fad1f72089abe9aef5c) --- drivers/mspi/mspi_dw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 4f6616a91749..66bdf670c02d 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -59,7 +59,7 @@ struct mspi_dw_data { enum mspi_cpp_mode xip_cpp; #endif - uint16_t dummy_bytes; + uint32_t dummy_bytes; uint8_t bytes_to_discard; uint8_t bytes_per_frame_exp; bool standard_spi; @@ -317,7 +317,7 @@ static bool tx_dummy_bytes(const struct device *dev, bool *repeat) uint8_t fifo_room = dev_config->max_queued_dummy_bytes - FIELD_GET(TXFLR_TXTFL_MASK, read_txflr(dev)); uint8_t rx_fifo_items = FIELD_GET(RXFLR_RXTFL_MASK, read_rxflr(dev)); - uint16_t dummy_bytes = dev_data->dummy_bytes; + uint32_t dummy_bytes = dev_data->dummy_bytes; const uint8_t dummy_val = 0; /* Subtract the number of items that are already stored in the RX From 5d67dcaeb80dffd530a13d25e5ff7acabb4755d7 Mon Sep 17 00:00:00 2001 From: Marcin Jelinski Date: Mon, 7 Jul 2025 15:39:31 +0200 Subject: [PATCH 0282/3334] [nrf fromtree] modules: nordic: select correct timer for NFCT on nRF54L Set the appropriate default NFC timer for the nRF54L series SoCs. Ref: NCSDK-31244 Signed-off-by: Marcin Jelinski (cherry picked from commit 0a9f28fdef564333e4c536dabcce1a90949dce0c) --- modules/hal_nordic/nrfx/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 0b1882ba7a65..f92cefce480e 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -281,6 +281,7 @@ config NRFX_NFCT depends on $(dt_nodelabel_exists,nfct) select NRFX_TIMER4 if SOC_SERIES_NRF52X select NRFX_TIMER2 if SOC_SERIES_NRF53X + select NRFX_TIMER24 if SOC_SERIES_NRF54LX config NRFX_NVMC bool "NVMC driver" From ed17be7d4a3b9b9117337d4b9d3ccde66ea3c072 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Wed, 29 Oct 2025 13:21:17 +0100 Subject: [PATCH 0283/3334] [nrf fromtree] kernel: events: Depend on multithreading Kernel events depend on multithreading being enabled, and mixing them with a non-multithreaded build gives linker failures internal to events.c. To avoid this, make events depend on multithreading. ``` libkernel.a(events.c.obj): in function `k_event_post_internal': 175: undefined reference to `z_sched_waitq_walk' events.c:183: undefined reference to `z_sched_wake_thread' events.c:191: undefined reference to `z_reschedule' libkernel.a(events.c.obj): in function `k_sched_current_thread_query': kernel.h:216: undefined reference to `z_impl_k_sched_current_thread_query' libkernel.a(events.c.obj): in function `k_event_wait_internal': events.c:312: undefined reference to `z_pend_curr' ``` Signed-off-by: Carles Cufi Signed-off-by: Piotr Kosycarz (cherry picked from commit cd8e773b325722e5d7b67427f3ebb88bd971b2f5) --- kernel/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/Kconfig b/kernel/Kconfig index bb2c5bade905..3d33a7995ae0 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -734,6 +734,7 @@ config NUM_MBOX_ASYNC_MSGS config EVENTS bool "Event objects" + depends on MULTITHREADING help This option enables event objects. Threads may wait on event objects for specific events, but both threads and ISRs may deliver From 19c007047ddb10263f93bf382fc0920101be19fb Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Mon, 3 Nov 2025 15:58:40 +0200 Subject: [PATCH 0284/3334] [nrf fromlist] drivers: modem_cellular: Update nRF91 Serial Modem PPP script nRF91 Serial Modem application does not anymore start PPP automatically. Update initialization script to request it. Upstream PR #: 98788 Signed-off-by: Seppo Takalo (cherry picked from commit 14c590801cd5d1dc33ad59ace513fdc404d59e13) --- drivers/modem/modem_cellular.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index dfa2c719a8af..b99401fedca5 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -2816,6 +2816,7 @@ MODEM_CHAT_SCRIPT_DEFINE(telit_me310g1_shutdown_chat_script, #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf91_slm) MODEM_CHAT_SCRIPT_CMDS_DEFINE(nordic_nrf91_slm_init_chat_script_cmds, MODEM_CHAT_SCRIPT_CMD_RESP_MULT("AT", allow_match), + MODEM_CHAT_SCRIPT_CMD_RESP("AT+CFUN=4", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+CMEE=1", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG=1", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG?", ok_match), @@ -2833,7 +2834,7 @@ MODEM_CHAT_SCRIPT_DEFINE(nordic_nrf91_slm_init_chat_script, nordic_nrf91_slm_ini abort_matches, modem_cellular_chat_callback_handler, 10); MODEM_CHAT_SCRIPT_CMDS_DEFINE(nordic_nrf91_slm_dial_chat_script_cmds, - MODEM_CHAT_SCRIPT_CMD_RESP("AT+CFUN=4", ok_match), + MODEM_CHAT_SCRIPT_CMD_RESP("AT#XPPP=1", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+CFUN=1", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT#XCMUX=2", ok_match)); From 2efd2b50b707c930de030245d14d38cd4146561d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 12 Nov 2025 11:54:47 +0100 Subject: [PATCH 0285/3334] [nrf fromlist] dts: nrf54lm20a: align GPIOTE IRQn to non-secure build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use different GPIOTE interrupt number when building for cpuapp/ns. Upstream PR #: 99247 Signed-off-by: Michał Stasiak (cherry picked from commit d727dd702035c579aa46e0975aeeea530f344b2b) --- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index dff01d80d7fe..1798088d6f4a 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -75,11 +75,19 @@ nvic: &cpuapp_nvic {}; }; &gpiote20 { +#ifdef USE_NON_SECURE_ADDRESS_MAP + interrupts = <218 NRF_DEFAULT_IRQ_PRIORITY>; +#else interrupts = <219 NRF_DEFAULT_IRQ_PRIORITY>; +#endif }; &gpiote30 { +#ifdef USE_NON_SECURE_ADDRESS_MAP + interrupts = <268 NRF_DEFAULT_IRQ_PRIORITY>; +#else interrupts = <269 NRF_DEFAULT_IRQ_PRIORITY>; +#endif }; &dppic00 { From 6e92cee1f94e63917e45296dd80284dbbc0b6ac2 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Fri, 7 Nov 2025 14:26:46 +0200 Subject: [PATCH 0286/3334] [nrf fromlist] net: l2: ppp: Allow PPP to transtition ESTABLISH->DEAD When remote peer have closed the PPP link normally, the PPP stack on Zephyr side switches back to ESTABLISH phase to be ready for next handshake. When calling net_if_down() on the interface, it should not try to initiate LCP link termination, but instead go directly to DEAD phase. See https://datatracker.ietf.org/doc/html/rfc1661#section-3.2 Upstream PR #: 99078 Signed-off-by: Seppo Takalo (cherry picked from commit 79985b13f7b382530f13f89cc9d773a2c0443fe6) --- subsys/net/l2/ppp/fsm.c | 11 +++++++++++ subsys/net/l2/ppp/lcp.c | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/subsys/net/l2/ppp/fsm.c b/subsys/net/l2/ppp/fsm.c index 3dd280230883..e5ca056e1c03 100644 --- a/subsys/net/l2/ppp/fsm.c +++ b/subsys/net/l2/ppp/fsm.c @@ -53,6 +53,13 @@ struct net_if *ppp_fsm_iface(struct ppp_fsm *fsm) return ctx->iface; } +static bool ppp_fsm_is_dead(struct ppp_fsm *fsm) +{ + struct ppp_context *ctx = ppp_fsm_ctx(fsm); + + return ctx->phase == PPP_DEAD; +} + static void fsm_send_configure_req(struct ppp_fsm *fsm, bool retransmit) { struct net_pkt *pkt = NULL; @@ -246,6 +253,10 @@ void ppp_fsm_close(struct ppp_fsm *fsm, const uint8_t *reason) case PPP_STOPPING: ppp_change_state(fsm, PPP_CLOSING); + if (ppp_fsm_is_dead(fsm)) { + fsm->retransmits = 0; + k_work_reschedule(&fsm->timer, K_NO_WAIT); + } break; default: diff --git a/subsys/net/l2/ppp/lcp.c b/subsys/net/l2/ppp/lcp.c index a62a9e52541e..49b0b53ab7e7 100644 --- a/subsys/net/l2/ppp/lcp.c +++ b/subsys/net/l2/ppp/lcp.c @@ -163,7 +163,12 @@ static void lcp_open(struct ppp_context *ctx) static void lcp_close(struct ppp_context *ctx, const uint8_t *reason) { if (ctx->phase != PPP_DEAD) { - ppp_change_phase(ctx, PPP_TERMINATE); + if (ctx->phase == PPP_ESTABLISH) { + /* Link is not established yet, so we can go directly to DEAD */ + ppp_change_phase(ctx, PPP_DEAD); + } else { + ppp_change_phase(ctx, PPP_TERMINATE); + } } ppp_fsm_close(&ctx->lcp.fsm, reason); From f326f9d218e4e1c4a95cf29ad8f41c039b065c37 Mon Sep 17 00:00:00 2001 From: Piotr Krzyzanowski Date: Mon, 10 Nov 2025 21:19:15 +0100 Subject: [PATCH 0287/3334] [nrf fromlist] tests: drivers: i2c: i2c_nrfx_twim: add nrf54lm20a Add support for nrf54lm20a board in i2c_nrfx_twim tests Upstream PR #: 99178 Signed-off-by: Piotr Krzyzanowski (cherry picked from commit 787cf2da33c6640d5781d4a595420dba71fda877) --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 67 +++++++++++++++++++ tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml | 1 + 2 files changed, 68 insertions(+) create mode 100644 tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..1fc56cc63298 --- /dev/null +++ b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P1.13 and P1.14 + * SCL = P1.23 and P1.24 + */ + +/ { + aliases { + i2c-controller = &i2c21; + i2c-controller-target = &i2c22; + }; +}; + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default: i2c22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep: i2c22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c22_default>; + pinctrl-1 = <&i2c22_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; +}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml index 4fa30bae7e84..42d1d98f3af8 100644 --- a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml +++ b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml @@ -14,6 +14,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp From 3a090f59bef6347f61e585fbbe3437f4f8389a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 12 Nov 2025 11:01:42 +0100 Subject: [PATCH 0288/3334] [nrf fromlist] soc: nordic: nrf54l: make SoCs select specific symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As future nRF54L SoCs may differ in terms of content, general SOC_NRF54L_CPUAPP_COMMON symbol needs to cover less symbols. These will be selected by specific SoC based on support. Upstream PR #: 99239 Signed-off-by: Michał Stasiak (cherry picked from commit 170d5872f3aa80e42d387364beb2a5ac2b7efb6e) --- soc/nordic/nrf54l/Kconfig | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index b211d2417cd8..7c09a90cf83c 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -13,33 +13,48 @@ config SOC_SERIES_NRF54LX config SOC_NRF54L_CPUAPP_COMMON bool select ARM - select ARMV8_M_DSP select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT - 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 select HAS_NORDIC_RAM_CTRL - select HAS_SWO config SOC_NRF54L05_CPUAPP select SOC_NRF54L_CPUAPP_COMMON + select ARMV8_M_DSP + select CPU_HAS_ARM_MPU + select CPU_HAS_ARM_SAU + select CPU_HAS_FPU + select HAS_SWO config SOC_NRF54L10_CPUAPP select SOC_NRF54L_CPUAPP_COMMON + select ARMV8_M_DSP + select CPU_HAS_ARM_MPU + select CPU_HAS_ARM_SAU + select CPU_HAS_FPU + select HAS_SWO config SOC_NRF54L15_CPUAPP select SOC_NRF54L_CPUAPP_COMMON select SOC_COMPATIBLE_NRF54L15 select SOC_COMPATIBLE_NRF54L15_CPUAPP + select ARMV8_M_DSP + select CPU_HAS_ARM_MPU + select CPU_HAS_ARM_SAU + select CPU_HAS_FPU + select HAS_SWO config SOC_NRF54LM20A_ENGA_CPUAPP select SOC_NRF54L_CPUAPP_COMMON select SOC_COMPATIBLE_NRF54LM20A select SOC_COMPATIBLE_NRF54LM20A_CPUAPP + select ARMV8_M_DSP + select CPU_HAS_ARM_MPU + select CPU_HAS_ARM_SAU + select CPU_HAS_FPU + select HAS_SWO config SOC_NRF54L05_CPUFLPR select RISCV_CORE_NORDIC_VPR From b6ed07418dfc5e33fcb79e07a2a012f8fdfdbad8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Wed, 12 Nov 2025 15:23:00 +0100 Subject: [PATCH 0289/3334] [nrf fromlist] drivers: can: nrf: use CAN_DEVICE_DT_INST_DEFINE The can_nrf.c device driver used DEVICE_DT_INST_DEFINE instead of CAN_DEVICE_DT_INST_DEFINE, which means we are missing initialization of some CAN structures, namely STATS. Update driver to use CAN_DEVICE_DT_INST_DEFINE() Upstream PR #: 99259 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 6726e9b619e25b7a6b92a6f89c514949faf1fdec) --- drivers/can/can_nrf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/can/can_nrf.c b/drivers/can/can_nrf.c index 38021d764b17..fa287b301ed1 100644 --- a/drivers/can/can_nrf.c +++ b/drivers/can/can_nrf.c @@ -201,8 +201,8 @@ static int can_nrf_init(const struct device *dev) \ static struct can_mcan_data can_mcan_nrf_data##n = CAN_MCAN_DATA_INITIALIZER(NULL); \ \ - DEVICE_DT_INST_DEFINE(n, can_nrf_init, NULL, &can_mcan_nrf_data##n, \ - &can_mcan_nrf_config##n, POST_KERNEL, CONFIG_CAN_INIT_PRIORITY, \ - &can_nrf_api); + CAN_DEVICE_DT_INST_DEFINE(n, can_nrf_init, NULL, &can_mcan_nrf_data##n, \ + &can_mcan_nrf_config##n, POST_KERNEL, CONFIG_CAN_INIT_PRIORITY, \ + &can_nrf_api); DT_INST_FOREACH_STATUS_OKAY(CAN_NRF_DEFINE) From 5c4e2631a7a009c1ce1af91b8f796c2d987b120b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 10 Nov 2025 09:14:56 +0100 Subject: [PATCH 0290/3334] [nrf fromlist] drivers: timer: nrf_grtc: Decouple clock source from CLOCK_CONTROL The GRTC timer, typically used as sys clock on newer nordic chips, is currently tightly coupled to the CLOCK_CONTROL_NRF drivers though not being dependent on it. The GRTC and its device driver is independent from CLOCK_CONTROL, its clock requirements are managed by hardware, based on its clock source selection. This commit moves the clock source selection to the GRTC driver, and removes the hard coupling to the CLOCK_CONTROL drivers. To preserve backwards compatibility, if CLOCK_CONTROL_NRF_K32SRC_RC is selected, GRTC will default to LFLPRC. Upstream PR #: 99147 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit a87ca3f02e8d59b801a6ad594a61e463c3a71a4d) --- drivers/timer/Kconfig.nrf_grtc | 25 +++++++++++++++++++++++++ drivers/timer/nrf_grtc_timer.c | 5 +++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/drivers/timer/Kconfig.nrf_grtc b/drivers/timer/Kconfig.nrf_grtc index 082c15333dcb..24534ae3f95c 100644 --- a/drivers/timer/Kconfig.nrf_grtc +++ b/drivers/timer/Kconfig.nrf_grtc @@ -56,4 +56,29 @@ config NRF_GRTC_TIMER_AUTO_KEEP_ALIVE This feature prevents the SYSCOUNTER from sleeping when any core is in active state. +if NRF_GRTC_START_SYSCOUNTER + +choice NRF_GRTC_TIMER_SOURCE + prompt "nRF GRTC clock source" + # Default to LFLPRC if CLOCK_CONTROL_NRF_K32SRC_RC for backwards compatibility + default NRF_GRTC_TIMER_SOURCE_LFLPRC if CLOCK_CONTROL_NRF_K32SRC_RC + # Default to LFXO if present as this allows GRTC to run in SYSTEM OFF + default NRF_GRTC_TIMER_SOURCE_LFXO + # Default to SYSTEM_LFCLK if LFXO is not present + default NRF_GRTC_TIMER_SOURCE_SYSTEM_LFCLK + +config NRF_GRTC_TIMER_SOURCE_LFXO + bool "Use Low Frequency XO as clock source" + depends on $(dt_nodelabel_enabled,lfxo) + +config NRF_GRTC_TIMER_SOURCE_SYSTEM_LFCLK + bool "Use System Low Frequency clock as clock source" + +config NRF_GRTC_TIMER_SOURCE_LFLPRC + bool "Use Low Frequency Low Power RC as clock source" + +endchoice # NRF_GRTC_TIMER_SOURCE + +endif # NRF_GRTC_START_SYSCOUNTER + endif # NRF_GRTC_TIMER diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index b0593e3bd135..22aed43d8e47 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -477,13 +477,14 @@ static int sys_clock_driver_init(void) #endif #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && NRF_GRTC_HAS_CLKSEL -#if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC) +#if defined(CONFIG_NRF_GRTC_TIMER_SOURCE_LFLPRC) /* Switch to LFPRC as the low-frequency clock source. */ nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFLPRC); -#elif DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lfxo)) +#elif defined(CONFIG_NRF_GRTC_TIMER_SOURCE_LFXO) /* Switch to LFXO as the low-frequency clock source. */ nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFXO); #else + /* Use LFCLK as the low-frequency clock source. */ nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFCLK); #endif #endif From a8bc748c250b0f8479e883300fe6becfc1d6bfb3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 31 Oct 2025 17:39:30 +0100 Subject: [PATCH 0291/3334] [nrf fromlist] shell: backends: uart: implement pm_device_runtime The UART device used by the backend needs to be gotten before use, and put after. In limited cases, device drivers call pm_device_runtime_get() as part of the call to uart_rx_enable(), this is not the case for polling, nor interrupt driven API calls for most if not all drivers, nor is that expected. Implement pm_device_runtime calls in shell uart backend similar to the logging uart backend to support all uart drivers in all configurations. Upstream PR #: 98681 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 6b314f2dc110080b264e2afa892bae42f9fdf348) --- subsys/shell/backends/shell_uart.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/subsys/shell/backends/shell_uart.c b/subsys/shell/backends/shell_uart.c index 1d19ce19a318..a65c2fb16aef 100644 --- a/subsys/shell/backends/shell_uart.c +++ b/subsys/shell/backends/shell_uart.c @@ -13,6 +13,7 @@ #include #include #include +#include #define LOG_MODULE_NAME shell_uart LOG_MODULE_REGISTER(shell_uart); @@ -290,6 +291,7 @@ static int init(const struct shell_transport *transport, void *context) { struct shell_uart_common *common = (struct shell_uart_common *)transport->ctx; + int ret; common->dev = (const struct device *)config; common->handler = evt_handler; @@ -300,6 +302,11 @@ static int init(const struct shell_transport *transport, k_fifo_init(&common->smp.buf_ready); #endif + ret = pm_device_runtime_get(common->dev); + if (ret < 0) { + return ret; + } + if (IS_ENABLED(CONFIG_SHELL_BACKEND_SERIAL_API_ASYNC)) { async_init((struct shell_uart_async *)transport->ctx); } else if (IS_ENABLED(CONFIG_SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN)) { @@ -331,6 +338,8 @@ static void polling_uninit(struct shell_uart_polling *sh_uart) static int uninit(const struct shell_transport *transport) { + struct shell_uart_common *common = (struct shell_uart_common *)transport->ctx; + if (IS_ENABLED(CONFIG_SHELL_BACKEND_SERIAL_API_ASYNC)) { async_uninit((struct shell_uart_async *)transport->ctx); } else if (IS_ENABLED(CONFIG_SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN)) { @@ -339,7 +348,7 @@ static int uninit(const struct shell_transport *transport) polling_uninit((struct shell_uart_polling *)transport->ctx); } - return 0; + return pm_device_runtime_put(common->dev); } static int enable(const struct shell_transport *transport, bool blocking_tx) From 66ebe5c4bef1a9170d34517a7f416ba4c6de0e39 Mon Sep 17 00:00:00 2001 From: Ryan Erickson Date: Mon, 15 Sep 2025 15:09:55 -0500 Subject: [PATCH 0292/3334] [nrf fromtree] drivers: can: tcan4x5x: Add device PM support Add support for device runtime power management. Suspending the device will place it into sleep mode, its lowest power state. All config will be lost when suspending the device. Do not allow suspending the device if it is started or has RX filters registered. The application has to reconfigure the CAN device to resume expected operation. Signed-off-by: Ryan Erickson (cherry picked from commit 631dbd98b436c659fa6956a2cacd78a7f6817fc7) --- drivers/can/can_mcan.c | 35 +++++++ drivers/can/can_tcan4x5x.c | 208 +++++++++++++++++++++++++++++-------- 2 files changed, 197 insertions(+), 46 deletions(-) diff --git a/drivers/can/can_mcan.c b/drivers/can/can_mcan.c index 3f7d771e5f4a..a69a4b2398df 100644 --- a/drivers/can/can_mcan.c +++ b/drivers/can/can_mcan.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -322,10 +323,32 @@ int can_mcan_start(const struct device *dev) } data->common.started = true; + pm_device_busy_set(dev); return err; } +static bool can_mcan_rx_filters_exist(const struct device *dev) +{ + const struct can_mcan_config *config = dev->config; + const struct can_mcan_callbacks *cbs = config->callbacks; + int i; + + for (i = 0; i < cbs->num_std; i++) { + if (cbs->std[i].function != NULL) { + return true; + } + } + + for (i = 0; i < cbs->num_ext; i++) { + if (cbs->ext[i].function != NULL) { + return true; + } + } + + return false; +} + int can_mcan_stop(const struct device *dev) { const struct can_mcan_config *config = dev->config; @@ -368,6 +391,12 @@ int can_mcan_stop(const struct device *dev) } } + k_mutex_lock(&data->lock, K_FOREVER); + if (!can_mcan_rx_filters_exist(dev)) { + pm_device_busy_clear(dev); + } + k_mutex_unlock(&data->lock); + return 0; } @@ -1184,6 +1213,8 @@ int can_mcan_add_rx_filter(const struct device *dev, can_rx_callback_t callback, filter_id = can_mcan_add_rx_filter_std(dev, callback, user_data, filter); } + pm_device_busy_set(dev); + return filter_id; } @@ -1230,6 +1261,10 @@ void can_mcan_remove_rx_filter(const struct device *dev, int filter_id) } } + if (!can_mcan_rx_filters_exist(dev) && !data->common.started) { + pm_device_busy_clear(dev); + } + k_mutex_unlock(&data->lock); } diff --git a/drivers/can/can_tcan4x5x.c b/drivers/can/can_tcan4x5x.c index 2abd0467a5ee..31f61b7dd72d 100644 --- a/drivers/can/can_tcan4x5x.c +++ b/drivers/can/can_tcan4x5x.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include LOG_MODULE_REGISTER(can_tcan4x5x, CONFIG_CAN_LOG_LEVEL); @@ -100,6 +102,10 @@ LOG_MODULE_REGISTER(can_tcan4x5x, CONFIG_CAN_LOG_LEVEL); #define CAN_TCAN4X5X_MODE_CONFIG_SWE_DIS BIT(1) #define CAN_TCAN4X5X_MODE_CONFIG_TEST_MODE_CONFIG BIT(0) +#define CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP 0 +#define CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY 1 +#define CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL 2 + /* Timestamp Prescaler register */ #define CAN_TCAN4X5X_TIMESTAMP_PRESCALER 0x0804 #define CAN_TCAN4X5X_TIMESTAMP_PRESCALER_MASK GENMASK(7, 0) @@ -201,6 +207,9 @@ LOG_MODULE_REGISTER(can_tcan4x5x, CONFIG_CAN_LOG_LEVEL); /* TCAN4x5x timing requirements */ #define CAN_TCAN4X5X_T_MODE_STBY_NOM_US 70 +#define CAN_TCAN4X5X_T_MODE_NOM_SLP_US 200 +#define CAN_TCAN4X5X_T_MODE_NOM_STBY_US 200 +#define CAN_TCAN4X5X_T_MODE_SLP_STBY_US 200 #define CAN_TCAN4X5X_T_WAKE_US 50 #define CAN_TCAN4X5X_T_PULSE_WIDTH_US 30 #define CAN_TCAN4X5X_T_RESET_US 1000 @@ -551,6 +560,154 @@ static int tcan4x5x_reset(const struct device *dev) return 0; } +static int tcan4x5x_set_config_mode_sel(const struct device *dev, uint8_t mode, uint32_t *reg) +{ + int err; + uint8_t current_mode; + + switch (mode) { + case CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP: + case CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY: + case CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL: + break; + default: + LOG_ERR("invalid mode %u", mode); + return -EINVAL; + } + + err = tcan4x5x_read_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, reg); + if (err != 0) { + LOG_ERR("failed to read configuration register (err %d)", err); + return -EIO; + } + + current_mode = FIELD_GET(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL, *reg); + LOG_DBG("current mode %u, new mode %u", current_mode, mode); + + *reg &= ~(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL); + *reg |= FIELD_PREP(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL, mode); + + err = tcan4x5x_write_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, *reg); + if (err != 0) { + LOG_ERR("failed to write configuration register (err %d)", err); + return -EIO; + } + + if (current_mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY && + mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL) { + /* Wait for standby to normal mode switch */ + k_busy_wait(CAN_TCAN4X5X_T_MODE_STBY_NOM_US); + } else if (current_mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL && + mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP) { + /* Wait for normal to sleep mode switch */ + k_busy_wait(CAN_TCAN4X5X_T_MODE_NOM_SLP_US); + } else if (current_mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL && + mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY) { + /* Wait for normal to standby mode switch */ + k_busy_wait(CAN_TCAN4X5X_T_MODE_NOM_STBY_US); + } else if (current_mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP && + mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY) { + /* Wait for sleep to standby mode switch */ + k_busy_wait(CAN_TCAN4X5X_T_MODE_SLP_STBY_US); + } + + return 0; +} + +static int tcan4x5x_init_normal_mode(const struct device *dev) +{ + const struct can_mcan_config *mcan_config = dev->config; + const struct tcan4x5x_config *tcan_config = mcan_config->custom; + int err = 0; + uint32_t reg; + + /* Set TCAN4x5x mode normal */ + err = tcan4x5x_set_config_mode_sel(dev, CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL, ®); + if (err != 0) { + return -ENODEV; + } + + /* Configure the frequency reference */ + if (tcan_config->clk_freq == MHZ(20)) { + /* 20 MHz frequency reference */ + reg &= ~(CAN_TCAN4X5X_MODE_CONFIG_CLK_REF); + } else { + /* 40 MHz frequency reference */ + reg |= CAN_TCAN4X5X_MODE_CONFIG_CLK_REF; + } + + /* Set nWKRQ voltage to VIO */ + reg |= CAN_TCAN4X5X_MODE_CONFIG_NWKRQ_VOLTAGE; + + /* Write remaining configuration to the device */ + err = tcan4x5x_write_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, reg); + if (err != 0) { + LOG_ERR("failed to write configuration register (err %d)", err); + return -EIO; + } + + /* Configure Message RAM */ + err = can_mcan_configure_mram(dev, CAN_TCAN4X5X_MRAM_BASE, CAN_TCAN4X5X_MRAM_BASE); + if (err != 0) { + return -EIO; + } + + /* Initialize M_CAN */ + err = can_mcan_init(dev); + if (err != 0) { + LOG_ERR("failed to initialize mcan (err %d)", err); + return err; + } + + return err; +} + +#ifdef CONFIG_PM_DEVICE +static int tcan4x5x_pm_control(const struct device *dev, enum pm_device_action action) +{ + int err = 0; + uint32_t reg; + + switch (action) { + case PM_DEVICE_ACTION_SUSPEND: + if (pm_device_is_busy(dev)) { + LOG_DBG("Cannot suspend while device is busy"); + return -EBUSY; + } + + /* + * Enter sleep mode. + * NOTE: All RX filters are cleared when entering sleep mode. + * User must remove and re-add filters at the application layer. + */ + err = tcan4x5x_set_config_mode_sel(dev, CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP, + ®); + return err; + case PM_DEVICE_ACTION_RESUME: + /* Wake up the device */ +#if TCAN4X5X_WAKE_GPIO_SUPPORT + LOG_DBG("Waking up TCAN4x5x via WAKE GPIO"); + err = tcan4x5x_wake(dev); + if (err != 0) { + return err; + } +#else + LOG_DBG("Waking up TCAN4x5x via reset"); + err = tcan4x5x_reset(dev); + if (err != 0) { + return err; + } +#endif + /* Enter normal mode */ + return tcan4x5x_init_normal_mode(dev); + default: + break; + } + + return -ENOTSUP; +} +#endif /* CONFIG_PM_DEVICE */ + static int tcan4x5x_init(const struct device *dev) { const struct can_mcan_config *mcan_config = dev->config; @@ -558,7 +715,6 @@ static int tcan4x5x_init(const struct device *dev) struct can_mcan_data *mcan_data = dev->data; struct tcan4x5x_data *tcan_data = mcan_data->custom; k_tid_t tid; - uint32_t reg; int err; /* Initialize int_sem to 1 to ensure any pending IRQ is serviced */ @@ -671,48 +827,7 @@ static int tcan4x5x_init(const struct device *dev) FIELD_GET(GENMASK(15, 8), info[2]), FIELD_GET(GENMASK(7, 0), info[2])); #endif /* CONFIG_CAN_LOG_LEVEL >= LOG_LEVEL_DBG */ - /* Set TCAN4x5x mode normal */ - err = tcan4x5x_read_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, ®); - if (err != 0) { - LOG_ERR("failed to read configuration register (err %d)", err); - return -ENODEV; - } - - reg &= ~(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL); - reg |= FIELD_PREP(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL, 0x02); - reg |= CAN_TCAN4X5X_MODE_CONFIG_WAKE_CONFIG; - - if (tcan_config->clk_freq == MHZ(20)) { - /* 20 MHz frequency reference */ - reg &= ~(CAN_TCAN4X5X_MODE_CONFIG_CLK_REF); - } else { - /* 40 MHz frequency reference */ - reg |= CAN_TCAN4X5X_MODE_CONFIG_CLK_REF; - } - - err = tcan4x5x_write_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, reg); - if (err != 0) { - LOG_ERR("failed to write configuration register (err %d)", err); - return -ENODEV; - } - - /* Wait for standby to normal mode switch */ - k_busy_wait(CAN_TCAN4X5X_T_MODE_STBY_NOM_US); - - /* Configure Message RAM */ - err = can_mcan_configure_mram(dev, CAN_TCAN4X5X_MRAM_BASE, CAN_TCAN4X5X_MRAM_BASE); - if (err != 0) { - return -EIO; - } - - /* Initialize M_CAN */ - err = can_mcan_init(dev); - if (err != 0) { - LOG_ERR("failed to initialize mcan (err %d)", err); - return err; - } - - return 0; + return tcan4x5x_init_normal_mode(dev); } static DEVICE_API(can, tcan4x5x_driver_api) = { @@ -794,8 +909,9 @@ static const struct can_mcan_ops tcan4x5x_ops = { static struct can_mcan_data can_mcan_data_##inst = \ CAN_MCAN_DATA_INITIALIZER(&tcan4x5x_data_##inst); \ \ - CAN_DEVICE_DT_INST_DEFINE(inst, tcan4x5x_init, NULL, &can_mcan_data_##inst, \ - &can_mcan_config_##inst, POST_KERNEL, CONFIG_CAN_INIT_PRIORITY, \ - &tcan4x5x_driver_api); + PM_DEVICE_DT_INST_DEFINE(inst, tcan4x5x_pm_control); \ + CAN_DEVICE_DT_INST_DEFINE(inst, tcan4x5x_init, PM_DEVICE_DT_INST_GET(inst), \ + &can_mcan_data_##inst, &can_mcan_config_##inst, POST_KERNEL, \ + CONFIG_CAN_INIT_PRIORITY, &tcan4x5x_driver_api); DT_INST_FOREACH_STATUS_OKAY(TCAN4X5X_INIT) From ca171188af1fb548a9c8266326c9d819e4884082 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Tue, 21 Oct 2025 13:10:36 +0200 Subject: [PATCH 0293/3334] [nrf fromtree] drivers: nrf: remove handling of cross domain pins Remove the handling of cross domain pins from nrf drivers. To use cross domain in tests, force on constlat and disable power domains for the test. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 306c3d483e932479248e9e3f0141ddc9c507ff1b) --- drivers/serial/uart_nrfx_uarte.c | 84 ------------------ drivers/spi/spi_nrfx_spim.c | 85 ------------------- drivers/spi/spi_nrfx_spis.c | 84 ------------------ dts/bindings/spi/nordic,nrf-spi-common.yaml | 10 --- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 -- .../spi_controller_peripheral/testcase.yaml | 2 + .../uart/uart_elementary/testcase.yaml | 1 + 7 files changed, 3 insertions(+), 271 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 08cb236b918d..ffb090ca16f1 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -127,27 +127,6 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); */ #define UARTE_ANY_HIGH_SPEED (UARTE_FOR_EACH_INSTANCE(INSTANCE_IS_HIGH_SPEED, (||), (0))) -#define UARTE_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ - COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(UARTE(prefix##idx)), \ - (UARTE_PROP(idx, cross_domain_pins_supported)), \ - (0)) - -#if UARTE_FOR_EACH_INSTANCE(UARTE_PINS_CROSS_DOMAIN, (||), (0)) -#include -/* Certain UARTE instances support usage of cross domain pins in form of dedicated pins on - * a port different from the default one. - */ -#define UARTE_CROSS_DOMAIN_PINS_SUPPORTED 1 -#endif - -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) -#include -/* To use cross domain pins, constant latency mode needs to be applied, which is - * handled via nrf_sys_event requests. - */ -#define UARTE_CROSS_DOMAIN_PINS_HANDLE 1 -#endif - #ifdef UARTE_ANY_CACHE /* uart120 instance does not retain BAUDRATE register when ENABLE=0. When this instance * is used then baudrate must be set after enabling the peripheral and not before. @@ -415,10 +394,6 @@ struct uarte_nrfx_config { #endif uint8_t *poll_out_byte; uint8_t *poll_in_byte; -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED - bool cross_domain; - int8_t default_port; -#endif }; /* Using Macro instead of static inline function to handle NO_OPTIMIZATIONS case @@ -493,32 +468,6 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); } -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED -static bool uarte_has_cross_domain_connection(const struct uarte_nrfx_config *config) -{ - const struct pinctrl_dev_config *pcfg = config->pcfg; - const struct pinctrl_state *state; - int ret; - - ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); - if (ret < 0) { - LOG_ERR("Unable to read pin state"); - return false; - } - - for (uint8_t i = 0U; i < state->pin_cnt; i++) { - uint32_t pin = NRF_GET_PIN(state->pins[i]); - - if ((pin != NRF_PIN_DISCONNECTED) && - (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { - return true; - } - } - - return false; -} -#endif - #if defined(UARTE_ANY_NONE_ASYNC) && !defined(CONFIG_UART_NRFX_UARTE_NO_IRQ) /** * @brief Interrupt service routine. @@ -805,20 +754,6 @@ static void uarte_periph_enable(const struct device *dev) (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); nrf_uarte_enable(uarte); -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED - if (config->cross_domain && uarte_has_cross_domain_connection(config)) { -#if UARTE_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_request_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif - #if UARTE_BAUDRATE_RETENTION_WORKAROUND if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { nrf_uarte_baudrate_set(uarte, @@ -3175,20 +3110,6 @@ static void uarte_pm_suspend(const struct device *dev) wait_for_tx_stopped(dev); } -#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED - if (cfg->cross_domain && uarte_has_cross_domain_connection(cfg)) { -#if UARTE_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_release_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif - (void)pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP); nrf_uarte_disable(uarte); } @@ -3518,11 +3439,6 @@ static int uarte_instance_deinit(const struct device *dev) IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ (.timer = NRFX_TIMER_INSTANCE( \ CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ - IF_ENABLED(UARTE_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ - (.cross_domain = true, \ - .default_port = \ - DT_PROP_OR(DT_PHANDLE(UARTE(idx), \ - default_gpio_port), port, -1),)) \ }; \ UARTE_DIRECT_ISR_DECLARE(idx) \ static int uarte_##idx##_init(const struct device *dev) \ diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 44451be58bc7..390682260c81 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -54,28 +54,6 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #define SPIM_FOR_EACH_INSTANCE(f, sep, off_code, ...) \ NRFX_FOREACH_PRESENT(SPIM, f, sep, off_code, __VA_ARGS__) -#define SPIM_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ - COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIM(prefix##idx)), \ - (SPIM_PROP(idx, cross_domain_pins_supported)), \ - (0)) - -#if NRFX_FOREACH_PRESENT(SPIM, SPIM_PINS_CROSS_DOMAIN, (||), (0)) -#include -/* Certain SPIM instances support usage of cross domain pins in form of dedicated pins on - * a port different from the default one. - */ -#define SPIM_CROSS_DOMAIN_SUPPORTED 1 -#endif - -#if SPIM_CROSS_DOMAIN_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) -#include -/* To use cross domain pins, constant latency mode needs to be applied, which is - * handled via nrf_sys_event requests. - */ -#define SPIM_CROSS_DOMAIN_PINS_HANDLE 1 -#endif - - struct spi_nrfx_data { struct spi_context ctx; const struct device *dev; @@ -105,41 +83,11 @@ struct spi_nrfx_config { #endif uint32_t wake_pin; nrfx_gpiote_t wake_gpiote; -#if SPIM_CROSS_DOMAIN_SUPPORTED - bool cross_domain; - int8_t default_port; -#endif void *mem_reg; }; static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context); -#if SPIM_CROSS_DOMAIN_SUPPORTED -static bool spim_has_cross_domain_connection(const struct spi_nrfx_config *config) -{ - const struct pinctrl_dev_config *pcfg = config->pcfg; - const struct pinctrl_state *state; - int ret; - - ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); - if (ret < 0) { - LOG_ERR("Unable to read pin state"); - return false; - } - - for (uint8_t i = 0U; i < state->pin_cnt; i++) { - uint32_t pin = NRF_GET_PIN(state->pins[i]); - - if ((pin != NRF_PIN_DISCONNECTED) && - (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { - return true; - } - } - - return false; -} -#endif - static inline void finalize_spi_transaction(const struct device *dev, bool deactivate_cs) { struct spi_nrfx_data *dev_data = dev->data; @@ -686,20 +634,6 @@ static int spim_resume(const struct device *dev) return -EAGAIN; } -#if SPIM_CROSS_DOMAIN_SUPPORTED - if (dev_config->cross_domain && spim_has_cross_domain_connection(dev_config)) { -#if SPIM_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_request_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif - return 0; } @@ -715,20 +649,6 @@ static void spim_suspend(const struct device *dev) spi_context_cs_put_all(&dev_data->ctx); -#if SPIM_CROSS_DOMAIN_SUPPORTED - if (dev_config->cross_domain && spim_has_cross_domain_connection(dev_config)) { -#if SPIM_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_release_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif - (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -866,11 +786,6 @@ static int spi_nrfx_deinit(const struct device *dev) .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPIM(idx), wake_gpios, \ WAKE_PIN_NOT_USED), \ .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPIM(idx)), \ - IF_ENABLED(SPIM_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ - (.cross_domain = true, \ - .default_port = \ - DT_PROP_OR(DT_PHANDLE(SPIM(idx), \ - default_gpio_port), port, -1),)) \ .mem_reg = DMM_DEV_TO_REG(SPIM(idx)), \ }; \ BUILD_ASSERT(!SPIM_HAS_PROP(idx, wake_gpios) || \ diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index 4d1a9070c1ac..0861ed3c2f54 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -32,27 +32,6 @@ LOG_MODULE_REGISTER(spi_nrfx_spis, CONFIG_SPI_LOG_LEVEL); #define SPIS_PROP(idx, prop) DT_PROP(SPIS(idx), prop) #define SPIS_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIS(idx), prop) -#define SPIS_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ - COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIS(prefix##idx)), \ - (SPIS_PROP(idx, cross_domain_pins_supported)), \ - (0)) - -#if NRFX_FOREACH_PRESENT(SPIS, SPIS_PINS_CROSS_DOMAIN, (||), (0)) -#include -/* Certain SPIM instances support usage of cross domain pins in form of dedicated pins on - * a port different from the default one. - */ -#define SPIS_CROSS_DOMAIN_SUPPORTED 1 -#endif - -#if SPIS_CROSS_DOMAIN_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) -#include -/* To use cross domain pins, constant latency mode needs to be applied, which is - * handled via nrf_sys_event requests. - */ -#define SPIS_CROSS_DOMAIN_PINS_HANDLE 1 -#endif - struct spi_nrfx_data { struct spi_context ctx; const struct device *dev; @@ -72,38 +51,8 @@ struct spi_nrfx_config { const struct pinctrl_dev_config *pcfg; struct gpio_dt_spec wake_gpio; void *mem_reg; -#if SPIS_CROSS_DOMAIN_SUPPORTED - bool cross_domain; - int8_t default_port; -#endif }; -#if SPIS_CROSS_DOMAIN_SUPPORTED -static bool spis_has_cross_domain_connection(const struct spi_nrfx_config *config) -{ - const struct pinctrl_dev_config *pcfg = config->pcfg; - const struct pinctrl_state *state; - int ret; - - ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); - if (ret < 0) { - LOG_ERR("Unable to read pin state"); - return false; - } - - for (uint8_t i = 0U; i < state->pin_cnt; i++) { - uint32_t pin = NRF_GET_PIN(state->pins[i]); - - if ((pin != NRF_PIN_DISCONNECTED) && - (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { - return true; - } - } - - return false; -} -#endif - static inline nrf_spis_mode_t get_nrf_spis_mode(uint16_t operation) { if (SPI_MODE_GET(operation) & SPI_MODE_CPOL) { @@ -423,20 +372,6 @@ static void spi_nrfx_suspend(const struct device *dev) nrf_spis_disable(dev_config->spis.p_reg); } -#if SPIS_CROSS_DOMAIN_SUPPORTED - if (dev_config->cross_domain && spis_has_cross_domain_connection(dev_config)) { -#if SPIS_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_release_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif - (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -446,20 +381,6 @@ static void spi_nrfx_resume(const struct device *dev) (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); -#if SPIS_CROSS_DOMAIN_SUPPORTED - if (dev_config->cross_domain && spis_has_cross_domain_connection(dev_config)) { -#if SPIS_CROSS_DOMAIN_PINS_HANDLE - int err; - - err = nrf_sys_event_request_global_constlat(); - (void)err; - __ASSERT_NO_MSG(err >= 0); -#else - __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); -#endif - } -#endif - if (dev_config->wake_gpio.port == NULL) { nrf_spis_enable(dev_config->spis.p_reg); } @@ -578,11 +499,6 @@ static int spi_nrfx_init(const struct device *dev) .max_buf_len = BIT_MASK(SPIS_PROP(idx, easydma_maxcnt_bits)), \ .wake_gpio = GPIO_DT_SPEC_GET_OR(SPIS(idx), wake_gpios, {0}), \ .mem_reg = DMM_DEV_TO_REG(SPIS(idx)), \ - IF_ENABLED(SPIS_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ - (.cross_domain = true, \ - .default_port = \ - DT_PROP_OR(DT_PHANDLE(SPIS(idx), \ - default_gpio_port), port, -1),)) \ }; \ BUILD_ASSERT(!DT_NODE_HAS_PROP(SPIS(idx), wake_gpios) || \ !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ diff --git a/dts/bindings/spi/nordic,nrf-spi-common.yaml b/dts/bindings/spi/nordic,nrf-spi-common.yaml index e76d785b2f42..dc81950aed3d 100644 --- a/dts/bindings/spi/nordic,nrf-spi-common.yaml +++ b/dts/bindings/spi/nordic,nrf-spi-common.yaml @@ -61,13 +61,3 @@ properties: and SPI master again keeps the line in the low state Please note that the line must be configured and properly handled on both sides for the mechanism to work correctly. - - default-gpio-port: - type: phandle - description: | - SPI default GPIO port. - - cross-domain-pins-supported: - type: boolean - description: | - SPI allows usage of cross domain pins with constant latency mode required. diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 4d15eebe8d02..602a7de7f719 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -313,8 +313,6 @@ rx-delay-supported; rx-delay = <1>; status = "disabled"; - default-gpio-port = <&gpio1>; - cross-domain-pins-supported; }; uart20: uart@c6000 { @@ -324,8 +322,6 @@ status = "disabled"; endtx-stoptx-supported; frame-timeout-supported; - default-gpio-port = <&gpio1>; - cross-domain-pins-supported; }; i2c21: i2c@c7000 { @@ -356,8 +352,6 @@ rx-delay-supported; rx-delay = <1>; status = "disabled"; - default-gpio-port = <&gpio1>; - cross-domain-pins-supported; }; uart21: uart@c7000 { @@ -367,8 +361,6 @@ status = "disabled"; endtx-stoptx-supported; frame-timeout-supported; - default-gpio-port = <&gpio1>; - cross-domain-pins-supported; }; i2c22: i2c@c8000 { diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index a4581e54820d..f2c10b6c716d 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -109,6 +109,8 @@ tests: extra_configs: - CONFIG_TESTED_SPI_MODE=0 - CONFIG_NRF_SYS_EVENT=y + - CONFIG_SOC_NRF_FORCE_CONSTLAT=y + - CONFIG_POWER_DOMAIN=n extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay" platform_exclude: - nrf52840dk/nrf52840 diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index cd25f46c1415..b680e0f96428 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -100,3 +100,4 @@ tests: extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay" extra_configs: - CONFIG_NRF_SYS_EVENT=y + - CONFIG_SOC_NRF_FORCE_CONSTLAT=y From a816c20837801f125fb9928f8a25d54e1e3ebbf8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 14 Nov 2025 10:45:32 +0100 Subject: [PATCH 0294/3334] [nrf fromlist] drivers: clock_control nrf_lfclk: patch clock option order The clock options used within the driver are supposed to be ordered from lowest to highest power consumption, so the lowest/default option is the most power efficient. The order was reversed to make the init code of the lfclk a bit simpler, and this was accounted for in the clock option lookup function. However, the common nrf clock control request/release feature would request the lowest index, not the lowest clock option, so the lfclk would default to its highest power consumption mode. The clock option init and lookup has been refactored to be sorted from lowest to highest power consumption, and comments have been adjusted accordingly. Upstream PR #: 99382 Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 7c6f8550344b70d47aaac65f8875809dd651769d) --- .../clock_control/clock_control_nrf_lfclk.c | 104 +++++++++--------- 1 file changed, 55 insertions(+), 49 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf_lfclk.c b/drivers/clock_control/clock_control_nrf_lfclk.c index 9551fb4e6361..dbf7f66e2e25 100644 --- a/drivers/clock_control/clock_control_nrf_lfclk.c +++ b/drivers/clock_control/clock_control_nrf_lfclk.c @@ -25,38 +25,25 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, #define LFCLK_LFRC_STARTUP_TIME_US DT_INST_PROP(0, lfrc_startup_time_us) #define LFCLK_MAX_OPTS 4 -#define LFCLK_DEF_OPTS 2 #define NRFS_CLOCK_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_LFCLK_CLOCK_TIMEOUT_MS) #define BICR (NRF_BICR_Type *)DT_REG_ADDR(DT_NODELABEL(bicr)) -/* Clock options sorted from highest to lowest power consumption. - * - Clock synthesized from a high frequency clock +/* + * Clock options sorted from lowest to highest power consumption. If clock option + * is not available it is not included. + * - External sine or square wave + * - XTAL low precision + * - XTAL high precision * - Internal RC oscillator - * - External clock. These are inserted into the list at driver initialization. - * Set to one of the following: - * - XTAL. Low or High precision - * - External sine or square wave + * - Clock synthesized from a high frequency clock */ static struct clock_options { uint16_t accuracy : 15; uint16_t precision : 1; nrfs_clock_src_t src; -} clock_options[LFCLK_MAX_OPTS] = { - { - /* 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, - }, - { - .accuracy = LFCLK_LFRC_ACCURACY, - .precision = 0, - .src = NRFS_CLOCK_SRC_LFCLK_LFRC, - }, - /* Remaining options are populated on lfclk_init */ -}; +} clock_options[LFCLK_MAX_OPTS]; struct lfclk_dev_data { STRUCT_CLOCK_CONFIG(lfclk, ARRAY_SIZE(clock_options)) clk_cfg; @@ -161,7 +148,7 @@ static int lfclk_resolve_spec_to_idx(const struct device *dev, ? dev_data->max_accuracy : req_spec->accuracy; - for (int i = dev_data->clock_options_cnt - 1; i >= 0; --i) { + for (int i = 0; i < dev_data->clock_options_cnt; i++) { /* Iterate to a more power hungry and accurate clock source * If the requested accuracy is higher (lower ppm) than what * the clock source can provide. @@ -331,15 +318,17 @@ static int api_get_rate_lfclk(const struct device *dev, static int lfclk_init(const struct device *dev) { struct lfclk_dev_data *dev_data = dev->data; - nrf_bicr_lfosc_mode_t lfosc_mode; nrfs_err_t res; + int ret; + nrf_bicr_lfosc_mode_t lfosc_mode; + struct clock_options *clock_option; res = nrfs_clock_init(clock_evt_handler); if (res != NRFS_SUCCESS) { return -EIO; } - dev_data->clock_options_cnt = LFCLK_DEF_OPTS; + dev_data->clock_options_cnt = 0; lfosc_mode = nrf_bicr_lfosc_mode_get(BICR); @@ -347,8 +336,6 @@ static int lfclk_init(const struct device *dev) lfosc_mode == NRF_BICR_LFOSC_MODE_DISABLED) { dev_data->max_accuracy = LFCLK_HFXO_ACCURACY; } else { - int ret; - ret = lfosc_get_accuracy(&dev_data->max_accuracy); if (ret < 0) { LOG_ERR("LFOSC enabled with invalid accuracy"); @@ -357,34 +344,41 @@ static int lfclk_init(const struct device *dev) switch (lfosc_mode) { case NRF_BICR_LFOSC_MODE_CRYSTAL: - clock_options[LFCLK_MAX_OPTS - 1].accuracy = dev_data->max_accuracy; - clock_options[LFCLK_MAX_OPTS - 1].precision = 0; - clock_options[LFCLK_MAX_OPTS - 1].src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE; - - clock_options[LFCLK_MAX_OPTS - 2].accuracy = dev_data->max_accuracy; - clock_options[LFCLK_MAX_OPTS - 2].precision = 1; - clock_options[LFCLK_MAX_OPTS - 2].src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE_HP; - - dev_data->clock_options_cnt += 2; + clock_option = &clock_options[dev_data->clock_options_cnt]; + clock_option->accuracy = dev_data->max_accuracy; + clock_option->precision = 0; + clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE; + dev_data->clock_options_cnt++; + + clock_option = &clock_options[dev_data->clock_options_cnt]; + clock_option->accuracy = dev_data->max_accuracy; + clock_option->precision = 1; + clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE_HP; + dev_data->clock_options_cnt++; break; - case NRF_BICR_LFOSC_MODE_EXTSINE: - clock_options[LFCLK_MAX_OPTS - 1].accuracy = dev_data->max_accuracy; - clock_options[LFCLK_MAX_OPTS - 1].precision = 0; - clock_options[LFCLK_MAX_OPTS - 1].src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE; - clock_options[LFCLK_MAX_OPTS - 2].accuracy = dev_data->max_accuracy; - clock_options[LFCLK_MAX_OPTS - 2].precision = 1; - clock_options[LFCLK_MAX_OPTS - 2].src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE_HP; - - dev_data->clock_options_cnt += 2; + case NRF_BICR_LFOSC_MODE_EXTSINE: + clock_option = &clock_options[dev_data->clock_options_cnt]; + clock_option->accuracy = dev_data->max_accuracy; + clock_option->precision = 0; + clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE; + dev_data->clock_options_cnt++; + + clock_option = &clock_options[dev_data->clock_options_cnt]; + clock_option->accuracy = dev_data->max_accuracy; + clock_option->precision = 1; + clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE_HP; + dev_data->clock_options_cnt++; break; - case NRF_BICR_LFOSC_MODE_EXTSQUARE: - clock_options[LFCLK_MAX_OPTS - 2].accuracy = dev_data->max_accuracy; - clock_options[LFCLK_MAX_OPTS - 2].precision = 0; - clock_options[LFCLK_MAX_OPTS - 2].src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SQUARE; - dev_data->clock_options_cnt += 1; + case NRF_BICR_LFOSC_MODE_EXTSQUARE: + clock_option = &clock_options[dev_data->clock_options_cnt]; + clock_option->accuracy = dev_data->max_accuracy; + clock_option->precision = 0; + clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SQUARE; + dev_data->clock_options_cnt++; break; + default: LOG_ERR("Unexpected LFOSC mode"); return -EINVAL; @@ -398,6 +392,18 @@ static int lfclk_init(const struct device *dev) } } + clock_option = &clock_options[dev_data->clock_options_cnt]; + clock_option->accuracy = LFCLK_LFRC_ACCURACY; + clock_option->precision = 0; + clock_option->src = NRFS_CLOCK_SRC_LFCLK_LFRC; + dev_data->clock_options_cnt++; + + clock_option = &clock_options[dev_data->clock_options_cnt]; + clock_option->accuracy = LFCLK_HFXO_ACCURACY; + clock_option->precision = 1; + clock_option->src = NRFS_CLOCK_SRC_LFCLK_SYNTH; + dev_data->clock_options_cnt++; + dev_data->hfxo_startup_time_us = nrf_bicr_hfxo_startup_time_us_get(BICR); if (dev_data->hfxo_startup_time_us == NRF_BICR_HFXO_STARTUP_TIME_UNCONFIGURED) { LOG_ERR("BICR HFXO startup time invalid"); From 216971ec0259855f5f1fc2e47e820f855b72b611 Mon Sep 17 00:00:00 2001 From: Aymen LAOUINI Date: Fri, 3 Oct 2025 15:42:39 +0300 Subject: [PATCH 0295/3334] [nrf fromtree] soc: nordic: activate uicr generation and use correct dt reg check - Activate the UICR file generation and PeriphConf for nRF92 application. - Add condition in reg dt check file to use the correct uicr node name for nRF92X. - Generation of preriphconf entries filters on device names to match the first 5 characters to nrf92 or the 6 first characters to nrf54h, this information is also used to determine the device SOC_SERIES to be either SOC_SERIES_NRF54HX or SOC_SERIES_NRF92X allowing possible extension of usage. Still in case of an unknown device of a certain family it will use existing configuration while generating periphconf entries. Signed-off-by: Aymen LAOUINI (cherry picked from commit d9861d77ff5f03e0e12832363ba3fc6fd75ffd8e) --- soc/nordic/common/uicr/Kconfig | 4 +- soc/nordic/common/uicr/Kconfig.sysbuild | 2 +- .../common/uicr/gen_periphconf_entries.py | 48 +++++++++++++++++-- soc/nordic/validate_base_addresses.c | 2 +- 4 files changed, 48 insertions(+), 8 deletions(-) diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index 37bdd014b7d6..9f22fbbf7269 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -3,7 +3,7 @@ config NRF_PERIPHCONF_SECTION bool "Populate global peripheral initialization section" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP depends on LINKER_DEVNULL_SUPPORT imply LINKER_DEVNULL_MEMORY help @@ -12,7 +12,7 @@ config NRF_PERIPHCONF_SECTION config NRF_PERIPHCONF_GENERATE_ENTRIES bool "Generate PERIPHCONF entries source file" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP depends on NRF_PERIPHCONF_SECTION depends on NRF_PLATFORM_HALTIUM help diff --git a/soc/nordic/common/uicr/Kconfig.sysbuild b/soc/nordic/common/uicr/Kconfig.sysbuild index eb885beaaaf7..6a9341f90994 100644 --- a/soc/nordic/common/uicr/Kconfig.sysbuild +++ b/soc/nordic/common/uicr/Kconfig.sysbuild @@ -3,7 +3,7 @@ config NRF_HALTIUM_GENERATE_UICR bool "Generate UICR file" - depends on SOC_SERIES_NRF54HX + depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF92X default y help Generate UICR HEX file. diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index 9a273dab7a59..13df5e468ded 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -54,11 +54,51 @@ def get_additional_node_kwargs(node: Node) -> dict[str, Any]: return additional_kwargs +class Family(enum.Enum): + """Families of SoCs supported by this script""" + + SERIES_NRF54HX = "nrf54h" + SERIES_NRF92X = "nrf92" + SERIES_UNKNOWN = "unknown" + + @classmethod + def family(cls, soc): + if soc.startswith("nrf54h") and len(soc) == 8: + return cls.SERIES_NRF54HX + elif soc.startswith("nrf92") and len(soc) == 7: + return cls.SERIES_NRF92X + else: + return cls.SERIES_UNKNOWN + + class Soc(enum.Enum): """Names of SoCs supported by this script""" NRF54H20 = "nrf54h20" NRF9280 = "nrf9280" + UNKNOWN = "unknown" + + @classmethod + def soc(cls, soc): + if soc.startswith("nrf54h20") and len(soc) == 8: + return cls.NRF54H20 + elif soc.startswith("nrf9280") and len(soc) == 7: + return cls.NRF9280 + else: + return cls.UNKNOWN + + +def validate_soc_choice(soc): + """Helper for argparse to validate soc parameter type""" + + if (soc.startswith("nrf54h") and soc[6:].isdigit() and len(soc) == 8) or ( + soc.startswith("nrf92") and soc[5:].isdigit() and len(soc) == 7 + ): + return soc + else: + raise argparse.ArgumentTypeError( + f"Invalid soc '{soc}'. Must start with 'nrf54h' or 'nrf92' followed by 2 digits." + ) def parse_args() -> argparse.Namespace: @@ -78,8 +118,8 @@ def parse_args() -> argparse.Namespace: ) parser.add_argument( "--soc", + type=validate_soc_choice, required=True, - choices=[soc.value for soc in Soc], help=( "SoC to generate PERIPHCONF macros for. " "Used to look up soc specific hardware information" @@ -104,7 +144,7 @@ def main() -> None: args = parse_args() dt = pickle.load(args.in_edt_pickle) processor = dt_processor_id(dt) - lookup_tables = lookup_tables_get(Soc(args.soc)) + lookup_tables = lookup_tables_get(Soc.soc(args.soc), Family.family(args.soc)) builder = PeriphconfBuilder(dt, lookup_tables) # Application local peripherals @@ -138,7 +178,7 @@ def main() -> None: args.out_periphconf_source.write(generated_source) -def lookup_tables_get(soc: Soc) -> SocLookupTables: +def lookup_tables_get(soc: Soc, family: Family) -> SocLookupTables: if soc == Soc.NRF54H20: ctrlsel_lookup = { # CAN120 @@ -438,7 +478,7 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: NrfPsel(fun=NrfFun.TPIU_DATA3, port=7, pin=7): Ctrlsel.TND, }, } - elif soc == Soc.NRF9280: + elif family == Family.SERIES_NRF92X: ctrlsel_lookup = { # PWM120 0x5F8E_4000: { diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 4f17e32e5d5b..f8e5245b51cb 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -346,7 +346,7 @@ CHECK_DT_REG(uart134, NRF_UARTE134); CHECK_DT_REG(uart135, NRF_UARTE135); CHECK_DT_REG(uart136, NRF_UARTE136); CHECK_DT_REG(uart137, NRF_UARTE137); -#if !defined(CONFIG_SOC_SERIES_NRF54HX) +#if !defined(CONFIG_SOC_SERIES_NRF54HX) && !defined(CONFIG_SOC_SERIES_NRF92X) CHECK_DT_REG(uicr, NRF_UICR); #else CHECK_DT_REG(uicr, NRF_APPLICATION_UICR); From 8747da21a62dd632cfbffa90cbb83e88c96b0622 Mon Sep 17 00:00:00 2001 From: Aymen LAOUINI Date: Fri, 3 Oct 2025 15:41:31 +0300 Subject: [PATCH 0296/3334] [nrf fromtree] boards: nordic: add partitions to memory map for nRF9280 - nRF9280 memory_map_iron is missing periphconf_partition, added this partition to mram11 at address 0xe60a000. - Add secure_storage_partition at 0xe60c000 to memory map. This partition is devided in two: cpuapp_crypto_partition and cpuapp_its_partition, both are 4KB. Those partitions are used by gen_uicr.py script to generate the UICR file. Signed-off-by: Aymen LAOUINI (cherry picked from commit 8f0fbbe8aa8510ec02719b4c7b5c186fb82f3ca0) --- .../nrf9280pdk_nrf9280-memory_map.dtsi | 10 ++++++++ .../nrf9280pdk_nrf9280-memory_map_iron.dtsi | 23 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi index 0127998509e8..67c70f1d38b5 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi @@ -221,4 +221,14 @@ reg = <0x680000 DT_SIZE_K(24)>; }; }; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + periphconf_partition: partition@60a000 { + reg = <0x60a000 DT_SIZE_K(8)>; + }; + }; }; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi index d3aea1f979ae..fba2e0fb6c2d 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi @@ -78,5 +78,28 @@ storage_partition: partition@600000 { reg = <0x600000 DT_SIZE_K(40)>; }; + + periphconf_partition: partition@60a000 { + reg = <0x60a000 DT_SIZE_K(8)>; + }; + + /* 0x60c000 was chosen for secure_storage_partition such that + * it resides in the beginning of MRAM11 in storage partition. + */ + secure_storage_partition: partition@60c000 { + compatible = "fixed-subpartitions"; + reg = <0x60c000 DT_SIZE_K(8)>; + ranges = <0x0 0x60c000 0x2000>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_crypto_partition: partition@0 { + reg = <0x0 DT_SIZE_K(4)>; + }; + + cpuapp_its_partition: partition@1000 { + reg = <0x1000 DT_SIZE_K(4)>; + }; + }; }; }; From 1d3ba5fa3b32d3c3a04b214da2de440f22bb9d54 Mon Sep 17 00:00:00 2001 From: Aymen LAOUINI Date: Fri, 3 Oct 2025 15:42:07 +0300 Subject: [PATCH 0297/3334] [nrf fromtree] dts: nordic: update nrf9280 nodes in dtsi - Removed cpurad_uicr and cpuapp_uicr nodes and added uicr node at address 0xfff8000 for nRF9280. - Add bicr node defined in same node as uicr but at offset 800. - Add tdd_peripherals node. Signed-off-by: Aymen LAOUINI (cherry picked from commit ba420519af42516613ebb100343141699e8adbbb) --- dts/vendor/nordic/nrf9280.dtsi | 41 ++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 791cd7d4c663..7d887b9a2092 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -116,16 +116,17 @@ write-block-size = <16>; }; - cpuapp_uicr: uicr@fff8000 { - compatible = "nordic,nrf-uicr-v2"; - reg = <0xfff8000 DT_SIZE_K(2)>; - domain = <2>; - }; + uicr: uicr@fff8000 { + compatible = "nordic,nrf-uicr"; + reg = <0xfff8000 DT_SIZE_K(3)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0xfff8000 DT_SIZE_K(3)>; - cpurad_uicr: uicr@fffa000 { - compatible = "nordic,nrf-uicr-v2"; - reg = <0xfffa000 DT_SIZE_K(2)>; - domain = <3>; + bicr: bicr@800 { + compatible = "nordic,nrf-bicr"; + reg = <0x800 204>; + }; }; ficr: ficr@fffe000 { @@ -358,6 +359,28 @@ }; }; + tdd_peripherals: peripheral@bf000000 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xbf000000 0x1000000>; + ranges = <0x0 0xbf000000 0x1000000>; + + tbm: tbm@3000 { + compatible = "nordic,nrf-tbm"; + reg = <0x3000 0x408>; + status = "disabled"; + interrupts = <127 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + hsfll200: clock@4000 { + compatible = "fixed-clock"; + reg = <0x4000 0x1000>; + #clock-cells = <0>; + status = "disabled"; + clock-frequency = ; + }; + }; + global_peripherals: peripheral@5f000000 { #address-cells = <1>; #size-cells = <1>; From 5c4763df9143b9fc2f30951723386dfdacdff662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 31 Mar 2025 13:41:18 +0200 Subject: [PATCH 0298/3334] [nrf fromtree] drivers: timer: nrf_grtc_timer: Optimize to reduce register access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Speed up execution of the interrupt handler and sys_clock_set_timeout(). Sys_clock_set_timeout() can be called in two scenarios: from previous timeout expiration handler or freely. If the former case fast path can be used since CC value in the GRTC register just expired and it can be used as a reference for CCADD setting. This is only a single register write so it's much faster. In the latter a longer procedure is applied which also happens in two variants. If value which is set in CC is further in the future (e.g. K_FOREVER was set before) then CC can be safely overwritten with a new value without a risk of triggering unexpected COMPARE event. If value in CC is earlier than the new CC value (if earlier timeout was aborted) then there is a risk of COMPARE event happening while it is being overwritten. That case requires long and safer procedure of setting CC. Update hal_nordic with changes in the nrfx_grtc driver which are needed for nrf_grtc_timer changes. Signed-off-by: Krzysztof Chruściński (cherry picked from commit d6fb9384ebfbb46a3cb65213257a61651a76fd7c) --- drivers/timer/nrf_grtc_timer.c | 92 ++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 31 deletions(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 22aed43d8e47..a7d3d90ef196 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -49,10 +49,9 @@ #define COUNTER_SPAN (GRTC_SYSCOUNTERL_VALUE_Msk | ((uint64_t)GRTC_SYSCOUNTERH_VALUE_Msk << 32)) #define MAX_ABS_TICKS (COUNTER_SPAN / CYC_PER_TICK) -#define MAX_TICKS \ - (((COUNTER_SPAN / CYC_PER_TICK) > INT_MAX) ? INT_MAX : (COUNTER_SPAN / CYC_PER_TICK)) - -#define MAX_CYCLES (MAX_TICKS * CYC_PER_TICK) +/* To allow use of CCADD we need to limit max cycles to 31 bits. */ +#define MAX_REL_CYCLES BIT_MASK(31) +#define MAX_REL_TICKS (MAX_REL_CYCLES / CYC_PER_TICK) #if DT_NODE_HAS_STATUS_OKAY(LFCLK_NODE) #define LFCLK_FREQUENCY_HZ DT_PROP(LFCLK_NODE, clock_frequency) @@ -60,14 +59,21 @@ #define LFCLK_FREQUENCY_HZ CONFIG_CLOCK_CONTROL_NRF_K32SRC_FREQUENCY #endif +/* Threshold used to determine if there is a risk of unexpected GRTC COMPARE event coming + * from previous CC value. + */ +#define LATENCY_THR_TICKS 200 + #if defined(CONFIG_TEST) const int32_t z_sys_timer_irq_for_test = DT_IRQN(GRTC_NODE); #endif static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_context); -static struct k_spinlock lock; static uint64_t last_count; /* Time (SYSCOUNTER value) @last sys_clock_announce() */ +static uint64_t last_elapsed; +static uint64_t cc_value; /* Value that is expected to be in CC register. */ +static uint64_t expired_cc; /* Value that is expected to be in CC register. */ static atomic_t int_mask; static uint8_t ext_channels_allocated; static uint64_t grtc_start_value; @@ -151,16 +157,11 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte { ARG_UNUSED(id); ARG_UNUSED(p_context); - uint64_t dticks; - uint64_t now = counter(); - - if (unlikely(now < cc_val)) { - return; - } + uint32_t dticks; dticks = counter_sub(cc_val, last_count) / CYC_PER_TICK; - - last_count += dticks * CYC_PER_TICK; + last_count += (dticks * CYC_PER_TICK); + expired_cc = cc_val; if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { /* protection is not needed because we are in the GRTC interrupt @@ -169,6 +170,7 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte system_timeout_set_abs(last_count + CYC_PER_TICK); } + last_elapsed = 0; sys_clock_announce((int32_t)dticks); } @@ -367,6 +369,7 @@ uint64_t z_nrf_grtc_timer_startup_value_get(void) int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) { nrfx_err_t err_code; + static struct k_spinlock lock; static uint8_t systemoff_channel; uint64_t now = counter(); nrfx_grtc_sleep_config_t sleep_cfg; @@ -429,20 +432,12 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) uint32_t sys_clock_cycle_get_32(void) { - k_spinlock_key_t key = k_spin_lock(&lock); - uint32_t ret = (uint32_t)counter(); - - k_spin_unlock(&lock, key); - return ret; + return (uint32_t)counter(); } uint64_t sys_clock_cycle_get_64(void) { - k_spinlock_key_t key = k_spin_lock(&lock); - uint64_t ret = counter(); - - k_spin_unlock(&lock, key); - return ret; + return counter(); } uint32_t sys_clock_elapsed(void) @@ -451,7 +446,9 @@ uint32_t sys_clock_elapsed(void) return 0; } - return (uint32_t)(counter_sub(counter(), last_count) / CYC_PER_TICK); + last_elapsed = counter_sub(counter(), last_count); + + return (uint32_t)(last_elapsed / CYC_PER_TICK); } #if !defined(CONFIG_GEN_SW_ISR_TABLE) @@ -508,6 +505,10 @@ static int sys_clock_driver_init(void) last_count = (counter() / CYC_PER_TICK) * CYC_PER_TICK; grtc_start_value = last_count; + expired_cc = UINT64_MAX; + nrfx_grtc_channel_callback_set(system_clock_channel_data.channel, + sys_clock_timeout_handler, NULL); + int_mask = NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK; if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { system_timeout_set_relative(CYC_PER_TICK); @@ -571,18 +572,47 @@ void sys_clock_set_timeout(int32_t ticks, bool idle) return; } - ticks = (ticks == K_TICKS_FOREVER) ? MAX_TICKS : MIN(MAX_TICKS, MAX(ticks, 0)); + uint32_t ch = system_clock_channel_data.channel; - uint64_t delta_time = ticks * CYC_PER_TICK; + if ((cc_value == expired_cc) && (ticks <= MAX_REL_TICKS)) { + uint32_t cyc = ticks * CYC_PER_TICK; - uint64_t target_time = counter() + delta_time; + if (cyc == 0) { + /* GRTC will expire anyway since HW ensures that past value triggers an + * event but we need to ensure to always progress the cc_value as this + * if condition expects that cc_value will change after each call to + * set_timeout function. + */ + cyc = 1; + } - /* Rounded down target_time to the tick boundary - * (but not less than one tick after the last) + /* If it's the first timeout setting after previous expiration and timeout + * is short so fast method can be used which utilizes relative CC configuration. + */ + cc_value += cyc; + nrfx_grtc_syscounter_cc_rel_set(ch, cyc, NRFX_GRTC_CC_RELATIVE_COMPARE); + return; + } + + uint64_t cyc = (uint64_t)ticks * CYC_PER_TICK; + bool safe_setting = false; + uint64_t prev_cc_val = cc_value; + uint64_t now = last_count + last_elapsed; + + cc_value = now + cyc; + + /* In case of timeout abort it may happen that CC is being set to a value + * that later than previous CC. If previous CC value is not far in the + * future, there is a risk that COMPARE event will be triggered for that + * previous CC value. If there is such risk safe procedure must be applied + * which is more time consuming but ensures that there will be no spurious + * event. */ - target_time = MAX((target_time - last_count)/CYC_PER_TICK, 1)*CYC_PER_TICK + last_count; + if (prev_cc_val < cc_value) { + safe_setting = (int64_t)(prev_cc_val - now) < LATENCY_THR_TICKS; + } - system_timeout_set_abs(target_time); + nrfx_grtc_syscounter_cc_abs_set(ch, cc_value, safe_setting); } #if defined(CONFIG_NRF_GRTC_TIMER_APP_DEFINED_INIT) From a952d240e2d7a3f17e77d8b7722d70f0aacbbc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pelikan?= Date: Fri, 14 Nov 2025 14:47:48 +0100 Subject: [PATCH 0299/3334] [nrf fromtree] tests: kernel: timer: behavior: Adjustments for NRF54H20 PPR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adjusting CONFIG_SYS_CLOCK_TICKS_PER_SEC as core is to slow too run the test with the default system clock frequency. Signed-off-by: Paweł Pelikan (cherry picked from commit fddce23e03021bfb6cac6e259c58b64ecc6b5775) --- .../timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/kernel/timer/timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf diff --git a/tests/kernel/timer/timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/tests/kernel/timer/timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf new file mode 100644 index 000000000000..2e06babf30a7 --- /dev/null +++ b/tests/kernel/timer/timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf @@ -0,0 +1 @@ +CONFIG_SYS_CLOCK_TICKS_PER_SEC=3906 From 8d9cc646301032094a66825217f05a4f25976b39 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 26 Aug 2025 14:46:22 +0200 Subject: [PATCH 0300/3334] [nrf fromtree] bluetooth: host: move assigned numbers out of gap.h Move Bluetooth Assigned Numbers to own header file to separate them from core GAP functionality. Signed-off-by: Pavel Vasilyev (cherry picked from commit 8c0269e2cedc625e7910418d26f29ecb7acbba70) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/assigned_numbers.h | 735 ++++++++++++++++++++ include/zephyr/bluetooth/gap.h | 677 +----------------- 2 files changed, 736 insertions(+), 676 deletions(-) create mode 100644 include/zephyr/bluetooth/assigned_numbers.h diff --git a/include/zephyr/bluetooth/assigned_numbers.h b/include/zephyr/bluetooth/assigned_numbers.h new file mode 100644 index 000000000000..de978b3cb1de --- /dev/null +++ b/include/zephyr/bluetooth/assigned_numbers.h @@ -0,0 +1,735 @@ +/** @file + * @brief Bluetooth Assigned Numbers, codes and identifiers. + */ + +/* + * Copyright (c) 2015-2025 Intel Corporation + * Copyright (c) 2017-2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_ASSIGNED_NUMBERS_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_ASSIGNED_NUMBERS_H_ + +/** + * @brief Bluetooth Assigned Numbers, codes and identifiers. + * @defgroup bt_assigned_numbers Assigned Numbers. + * @since 1.0 + * @version 1.0.0 + * @ingroup bluetooth + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Core Specification Assigned Numbers + * @defgroup bt_assigned_numbers_core Core Specification Assigned Numbers + * @ingroup bt_assigned_numbers + * @{ + */ + +/** + * @name Appearance Numbers + * + * Last Modified on 2023-01-05 + * @{ + */ + +/** Generic Unknown */ +#define BT_APPEARANCE_UNKNOWN 0x0000 +/** Generic Phone */ +#define BT_APPEARANCE_GENERIC_PHONE 0x0040 +/** Generic Computer */ +#define BT_APPEARANCE_GENERIC_COMPUTER 0x0080 +/** Desktop Workstation */ +#define BT_APPEARANCE_COMPUTER_DESKTOP_WORKSTATION 0x0081 +/** Server-class Computer */ +#define BT_APPEARANCE_COMPUTER_SERVER_CLASS 0x0082 +/** Laptop */ +#define BT_APPEARANCE_COMPUTER_LAPTOP 0x0083 +/** Handheld PC/PDA (clamshell) */ +#define BT_APPEARANCE_COMPUTER_HANDHELD_PCPDA 0x0084 +/** Palm­size PC/PDA */ +#define BT_APPEARANCE_COMPUTER_PALMSIZE_PCPDA 0x0085 +/** Wearable computer (watch size) */ +#define BT_APPEARANCE_COMPUTER_WEARABLE_COMPUTER 0x0086 +/** Tablet */ +#define BT_APPEARANCE_COMPUTER_TABLET 0x0087 +/** Docking Station */ +#define BT_APPEARANCE_COMPUTER_DOCKING_STATION 0x0088 +/** All in One */ +#define BT_APPEARANCE_COMPUTER_ALL_IN_ONE 0x0089 +/** Blade Server */ +#define BT_APPEARANCE_COMPUTER_BLADE_SERVER 0x008A +/** Convertible */ +#define BT_APPEARANCE_COMPUTER_CONVERTIBLE 0x008B +/** Detachable */ +#define BT_APPEARANCE_COMPUTER_DETACHABLE 0x008C +/** IoT Gateway */ +#define BT_APPEARANCE_COMPUTER_IOT_GATEWAY 0x008D +/** Mini PC */ +#define BT_APPEARANCE_COMPUTER_MINI_PC 0x008E +/** Stick PC */ +#define BT_APPEARANCE_COMPUTER_STICK_PC 0x008F +/** Generic Watch */ +#define BT_APPEARANCE_GENERIC_WATCH 0x00C0 +/** Sports Watch */ +#define BT_APPEARANCE_SPORTS_WATCH 0x00C1 +/** Smartwatch */ +#define BT_APPEARANCE_SMARTWATCH 0x00C2 +/** Generic Clock */ +#define BT_APPEARANCE_GENERIC_CLOCK 0x0100 +/** Generic Display */ +#define BT_APPEARANCE_GENERIC_DISPLAY 0x0140 +/** Generic Remote Control */ +#define BT_APPEARANCE_GENERIC_REMOTE 0x0180 +/** Generic Eye-glasses */ +#define BT_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 +/** Generic Tag */ +#define BT_APPEARANCE_GENERIC_TAG 0x0200 +/** Generic Keyring */ +#define BT_APPEARANCE_GENERIC_KEYRING 0x0240 +/** Generic Media Player */ +#define BT_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 +/** Generic Barcode Scanner */ +#define BT_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 +/** Generic Thermometer */ +#define BT_APPEARANCE_GENERIC_THERMOMETER 0x0300 +/** Ear Thermometer */ +#define BT_APPEARANCE_THERMOMETER_EAR 0x0301 +/** Generic Heart Rate Sensor */ +#define BT_APPEARANCE_GENERIC_HEART_RATE 0x0340 +/** Heart Rate Belt */ +#define BT_APPEARANCE_HEART_RATE_BELT 0x0341 +/** Generic Blood Pressure */ +#define BT_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 +/** Arm Blood Pressure */ +#define BT_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 +/** Wrist Blood Pressure */ +#define BT_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 +/** Generic Human Interface Device */ +#define BT_APPEARANCE_GENERIC_HID 0x03C0 +/** Keyboard */ +#define BT_APPEARANCE_HID_KEYBOARD 0x03C1 +/** Mouse */ +#define BT_APPEARANCE_HID_MOUSE 0x03C2 +/** Joystick */ +#define BT_APPEARANCE_HID_JOYSTICK 0x03C3 +/** Gamepad */ +#define BT_APPEARANCE_HID_GAMEPAD 0x03C4 +/** Digitizer Tablet */ +#define BT_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 +/** Card Reader */ +#define BT_APPEARANCE_HID_CARD_READER 0x03C6 +/** Digital Pen */ +#define BT_APPEARANCE_HID_DIGITAL_PEN 0x03C7 +/** Barcode Scanner */ +#define BT_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 +/** Touchpad */ +#define BT_APPEARANCE_HID_TOUCHPAD 0x03C9 +/** Presentation Remote */ +#define BT_APPEARANCE_HID_PRESENTATION_REMOTE 0x03CA +/** Generic Glucose Meter */ +#define BT_APPEARANCE_GENERIC_GLUCOSE 0x0400 +/** Generic Running Walking Sensor */ +#define BT_APPEARANCE_GENERIC_WALKING 0x0440 +/** In-Shoe Running Walking Sensor */ +#define BT_APPEARANCE_WALKING_IN_SHOE 0x0441 +/** On-Shoe Running Walking Sensor */ +#define BT_APPEARANCE_WALKING_ON_SHOE 0x0442 +/** On-Hip Running Walking Sensor */ +#define BT_APPEARANCE_WALKING_ON_HIP 0x0443 +/** Generic Cycling */ +#define BT_APPEARANCE_GENERIC_CYCLING 0x0480 +/** Cycling Computer */ +#define BT_APPEARANCE_CYCLING_COMPUTER 0x0481 +/** Speed Sensor */ +#define BT_APPEARANCE_CYCLING_SPEED 0x0482 +/** Cadence Sensor */ +#define BT_APPEARANCE_CYCLING_CADENCE 0x0483 +/** Power Sensor */ +#define BT_APPEARANCE_CYCLING_POWER 0x0484 +/** Speed and Cadence Sensor */ +#define BT_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 +/** Generic Control Device */ +#define BT_APPEARANCE_GENERIC_CONTROL_DEVICE 0x04C0 +/** Switch */ +#define BT_APPEARANCE_CONTROL_SWITCH 0x04C1 +/** Multi-switch */ +#define BT_APPEARANCE_CONTROL_MULTI_SWITCH 0x04C2 +/** Button */ +#define BT_APPEARANCE_CONTROL_BUTTON 0x04C3 +/** Slider */ +#define BT_APPEARANCE_CONTROL_SLIDER 0x04C4 +/** Rotary Switch */ +#define BT_APPEARANCE_CONTROL_ROTARY_SWITCH 0x04C5 +/** Touch Panel */ +#define BT_APPEARANCE_CONTROL_TOUCH_PANEL 0x04C6 +/** Single Switch */ +#define BT_APPEARANCE_CONTROL_SINGLE_SWITCH 0x04C7 +/** Double Switch */ +#define BT_APPEARANCE_CONTROL_DOUBLE_SWITCH 0x04C8 +/** Triple Switch */ +#define BT_APPEARANCE_CONTROL_TRIPLE_SWITCH 0x04C9 +/** Battery Switch */ +#define BT_APPEARANCE_CONTROL_BATTERY_SWITCH 0x04CA +/** Energy Harvesting Switch */ +#define BT_APPEARANCE_CONTROL_ENERGY_HARVESTING_SWITCH 0x04CB +/** Push Button */ +#define BT_APPEARANCE_CONTROL_PUSH_BUTTON 0x04CC +/** Generic Network Device */ +#define BT_APPEARANCE_GENERIC_NETWORK_DEVICE 0x0500 +/** Access Point */ +#define BT_APPEARANCE_NETWORK_ACCESS_POINT 0x0501 +/** Mesh Device */ +#define BT_APPEARANCE_NETWORK_MESH_DEVICE 0x0502 +/** Mesh Network Proxy */ +#define BT_APPEARANCE_NETWORK_MESH_PROXY 0x0503 +/** Generic Sensor */ +#define BT_APPEARANCE_GENERIC_SENSOR 0x0540 +/** Motion Sensor */ +#define BT_APPEARANCE_SENSOR_MOTION 0x0541 +/** Air quality Sensor */ +#define BT_APPEARANCE_SENSOR_AIR_QUALITY 0x0542 +/** Temperature Sensor */ +#define BT_APPEARANCE_SENSOR_TEMPERATURE 0x0543 +/** Humidity Sensor */ +#define BT_APPEARANCE_SENSOR_HUMIDITY 0x0544 +/** Leak Sensor */ +#define BT_APPEARANCE_SENSOR_LEAK 0x0545 +/** Smoke Sensor */ +#define BT_APPEARANCE_SENSOR_SMOKE 0x0546 +/** Occupancy Sensor */ +#define BT_APPEARANCE_SENSOR_OCCUPANCY 0x0547 +/** Contact Sensor */ +#define BT_APPEARANCE_SENSOR_CONTACT 0x0548 +/** Carbon Monoxide Sensor */ +#define BT_APPEARANCE_SENSOR_CARBON_MONOXIDE 0x0549 +/** Carbon Dioxide Sensor */ +#define BT_APPEARANCE_SENSOR_CARBON_DIOXIDE 0x054A +/** Ambient Light Sensor */ +#define BT_APPEARANCE_SENSOR_AMBIENT_LIGHT 0x054B +/** Energy Sensor */ +#define BT_APPEARANCE_SENSOR_ENERGY 0x054C +/** Color Light Sensor */ +#define BT_APPEARANCE_SENSOR_COLOR_LIGHT 0x054D +/** Rain Sensor */ +#define BT_APPEARANCE_SENSOR_RAIN 0x054E +/** Fire Sensor */ +#define BT_APPEARANCE_SENSOR_FIRE 0x054F +/** Wind Sensor */ +#define BT_APPEARANCE_SENSOR_WIND 0x0550 +/** Proximity Sensor */ +#define BT_APPEARANCE_SENSOR_PROXIMITY 0x0551 +/** Multi-Sensor */ +#define BT_APPEARANCE_SENSOR_MULTI 0x0552 +/** Flush Mounted Sensor */ +#define BT_APPEARANCE_SENSOR_FLUSH_MOUNTED 0x0553 +/** Ceiling Mounted Sensor */ +#define BT_APPEARANCE_SENSOR_CEILING_MOUNTED 0x0554 +/** Wall Mounted Sensor */ +#define BT_APPEARANCE_SENSOR_WALL_MOUNTED 0x0555 +/** Multisensor */ +#define BT_APPEARANCE_MULTISENSOR 0x0556 +/** Energy Meter */ +#define BT_APPEARANCE_SENSOR_ENERGY_METER 0x0557 +/** Flame Detector */ +#define BT_APPEARANCE_SENSOR_FLAME_DETECTOR 0x0558 +/** Vehicle Tire Pressure Sensor */ +#define BT_APPEARANCE_SENSOR_VEHICLE_TIRE_PRESSURE 0x0559 +/** Generic Light Fixtures */ +#define BT_APPEARANCE_GENERIC_LIGHT_FIXTURES 0x0580 +/** Wall Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_WALL 0x0581 +/** Ceiling Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_CEILING 0x0582 +/** Floor Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_FLOOR 0x0583 +/** Cabinet Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_CABINET 0x0584 +/** Desk Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_DESK 0x0585 +/** Troffer Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_TROFFER 0x0586 +/** Pendant Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_PENDANT 0x0587 +/** In-ground Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_IN_GROUND 0x0588 +/** Flood Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_FLOOD 0x0589 +/** Underwater Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_UNDERWATER 0x058A +/** Bollard with Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_BOLLARD_WITH 0x058B +/** Pathway Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_PATHWAY 0x058C +/** Garden Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_GARDEN 0x058D +/** Pole-top Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_POLE_TOP 0x058E +/** Spotlight */ +#define BT_APPEARANCE_SPOT_LIGHT 0x058F +/** Linear Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_LINEAR 0x0590 +/** Street Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_STREET 0x0591 +/** Shelves Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_SHELVES 0x0592 +/** Bay Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_BAY 0x0593 +/** Emergency Exit Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_EMERGENCY_EXIT 0x0594 +/** Light Controller */ +#define BT_APPEARANCE_LIGHT_FIXTURES_CONTROLLER 0x0595 +/** Light Driver */ +#define BT_APPEARANCE_LIGHT_FIXTURES_DRIVER 0x0596 +/** Bulb */ +#define BT_APPEARANCE_LIGHT_FIXTURES_BULB 0x0597 +/** Low-bay Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_LOW_BAY 0x0598 +/** High-bay Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_HIGH_BAY 0x0599 +/** Generic Fan */ +#define BT_APPEARANCE_GENERIC_FAN 0x05C0 +/** Ceiling Fan */ +#define BT_APPEARANCE_FAN_CEILING 0x05C1 +/** Axial Fan */ +#define BT_APPEARANCE_FAN_AXIAL 0x05C2 +/** Exhaust Fan */ +#define BT_APPEARANCE_FAN_EXHAUST 0x05C3 +/** Pedestal Fan */ +#define BT_APPEARANCE_FAN_PEDESTAL 0x05C4 +/** Desk Fan */ +#define BT_APPEARANCE_FAN_DESK 0x05C5 +/** Wall Fan */ +#define BT_APPEARANCE_FAN_WALL 0x05C6 +/** Generic HVAC */ +#define BT_APPEARANCE_GENERIC_HVAC 0x0600 +/** Thermostat */ +#define BT_APPEARANCE_HVAC_THERMOSTAT 0x0601 +/** Humidifier */ +#define BT_APPEARANCE_HVAC_HUMIDIFIER 0x0602 +/** De-humidifier */ +#define BT_APPEARANCE_HVAC_DEHUMIDIFIER 0x0603 +/** Heater */ +#define BT_APPEARANCE_HVAC_HEATER 0x0604 +/** Radiator */ +#define BT_APPEARANCE_HVAC_RADIATOR 0x0605 +/** Boiler */ +#define BT_APPEARANCE_HVAC_BOILER 0x0606 +/** Heat Pump */ +#define BT_APPEARANCE_HVAC_HEAT_PUMP 0x0607 +/** Infrared Heater */ +#define BT_APPEARANCE_HVAC_INFRARED_HEATER 0x0608 +/** Radiant Panel Heater */ +#define BT_APPEARANCE_HVAC_RADIANT_PANEL_HEATER 0x0609 +/** Fan Heater */ +#define BT_APPEARANCE_HVAC_FAN_HEATER 0x060A +/** Air Curtain */ +#define BT_APPEARANCE_HVAC_AIR_CURTAIN 0x060B +/** Generic Air Conditioning */ +#define BT_APPEARANCE_GENERIC_AIR_CONDITIONING 0x0640 +/** Generic Humidifier */ +#define BT_APPEARANCE_GENERIC_HUMIDIFIER 0x0680 +/** Generic Heating */ +#define BT_APPEARANCE_GENERIC_HEATING 0x06C0 +/** Radiator */ +#define BT_APPEARANCE_HEATING_RADIATOR 0x06C1 +/** Boiler */ +#define BT_APPEARANCE_HEATING_BOILER 0x06C2 +/** Heat Pump */ +#define BT_APPEARANCE_HEATING_HEAT_PUMP 0x06C3 +/** Infrared Heater */ +#define BT_APPEARANCE_HEATING_INFRARED_HEATER 0x06C4 +/** Radiant Panel Heater */ +#define BT_APPEARANCE_HEATING_RADIANT_PANEL_HEATER 0x06C5 +/** Fan Heater */ +#define BT_APPEARANCE_HEATING_FAN_HEATER 0x06C6 +/** Air Curtain */ +#define BT_APPEARANCE_HEATING_AIR_CURTAIN 0x06C7 +/** Generic Access Control */ +#define BT_APPEARANCE_GENERIC_ACCESS_CONTROL 0x0700 +/** Access Door */ +#define BT_APPEARANCE_CONTROL_ACCESS_DOOR 0x0701 +/** Garage Door */ +#define BT_APPEARANCE_CONTROL_GARAGE_DOOR 0x0702 +/** Emergency Exit Door */ +#define BT_APPEARANCE_CONTROL_EMERGENCY_EXIT_DOOR 0x0703 +/** Access Lock */ +#define BT_APPEARANCE_CONTROL_ACCESS_LOCK 0x0704 +/** Elevator */ +#define BT_APPEARANCE_CONTROL_ELEVATOR 0x0705 +/** Window */ +#define BT_APPEARANCE_CONTROL_WINDOW 0x0706 +/** Entrance Gate */ +#define BT_APPEARANCE_CONTROL_ENTRANCE_GATE 0x0707 +/** Door Lock */ +#define BT_APPEARANCE_CONTROL_DOOR_LOCK 0x0708 +/** Locker */ +#define BT_APPEARANCE_CONTROL_LOCKER 0x0709 +/** Generic Motorized Device */ +#define BT_APPEARANCE_GENERIC_MOTORIZED_DEVICE 0x0740 +/** Motorized Gate */ +#define BT_APPEARANCE_MOTORIZED_GATE 0x0741 +/** Awning */ +#define BT_APPEARANCE_MOTORIZED_AWNING 0x0742 +/** Blinds or Shades */ +#define BT_APPEARANCE_MOTORIZED_BLINDS_OR_SHADES 0x0743 +/** Curtains */ +#define BT_APPEARANCE_MOTORIZED_CURTAINS 0x0744 +/** Screen */ +#define BT_APPEARANCE_MOTORIZED_SCREEN 0x0745 +/** Generic Power Device */ +#define BT_APPEARANCE_GENERIC_POWER_DEVICE 0x0780 +/** Power Outlet */ +#define BT_APPEARANCE_POWER_OUTLET 0x0781 +/** Power Strip */ +#define BT_APPEARANCE_POWER_STRIP 0x0782 +/** Plug */ +#define BT_APPEARANCE_POWER_PLUG 0x0783 +/** Power Supply */ +#define BT_APPEARANCE_POWER_SUPPLY 0x0784 +/** LED Driver */ +#define BT_APPEARANCE_POWER_LED_DRIVER 0x0785 +/** Fluorescent Lamp Gear */ +#define BT_APPEARANCE_POWER_FLUORESCENT_LAMP_GEAR 0x0786 +/** HID Lamp Gear */ +#define BT_APPEARANCE_POWER_HID_LAMP_GEAR 0x0787 +/** Charge Case */ +#define BT_APPEARANCE_POWER_CHARGE_CASE 0x0788 +/** Power Bank */ +#define BT_APPEARANCE_POWER_POWER_BANK 0x0789 +/** Generic Light Source */ +#define BT_APPEARANCE_GENERIC_LIGHT_SOURCE 0x07C0 +/** Incandescent Light Bulb */ +#define BT_APPEARANCE_LIGHT_SOURCE_INCANDESCENT_BULB 0x07C1 +/** LED Lamp */ +#define BT_APPEARANCE_LIGHT_SOURCE_LED_LAMP 0x07C2 +/** HID Lamp */ +#define BT_APPEARANCE_LIGHT_SOURCE_HID_LAMP 0x07C3 +/** Fluorescent Lamp */ +#define BT_APPEARANCE_LIGHT_SOURCE_FLUORESCENT_LAMP 0x07C4 +/** LED Array */ +#define BT_APPEARANCE_LIGHT_SOURCE_LED_ARRAY 0x07C5 +/** Multi-Color LED Array */ +#define BT_APPEARANCE_LIGHT_SOURCE_MULTICOLOR_LED_ARRAY 0x07C6 +/** Low voltage halogen */ +#define BT_APPEARANCE_LIGHT_SOURCE_LOW_VOLTAGE_HALOGEN 0x07C7 +/** Organic light emitting diode */ +#define BT_APPEARANCE_LIGHT_SOURCE_OLED 0x07C8 +/** Generic Window Covering */ +#define BT_APPEARANCE_GENERIC_WINDOW_COVERING 0x0800 +/** Window Shades */ +#define BT_APPEARANCE_WINDOW_SHADES 0x0801 +/** Window Blinds */ +#define BT_APPEARANCE_WINDOW_BLINDS 0x0802 +/** Window Awning */ +#define BT_APPEARANCE_WINDOW_AWNING 0x0803 +/** Window Curtain */ +#define BT_APPEARANCE_WINDOW_CURTAIN 0x0804 +/** Exterior Shutter */ +#define BT_APPEARANCE_WINDOW_EXTERIOR_SHUTTER 0x0805 +/** Exterior Screen */ +#define BT_APPEARANCE_WINDOW_EXTERIOR_SCREEN 0x0806 +/** Generic Audio Sink */ +#define BT_APPEARANCE_GENERIC_AUDIO_SINK 0x0840 +/** Standalone Speaker */ +#define BT_APPEARANCE_AUDIO_SINK_STANDALONE_SPEAKER 0x0841 +/** Soundbar */ +#define BT_APPEARANCE_AUDIO_SINK_SOUNDBAR 0x0842 +/** Bookshelf Speaker */ +#define BT_APPEARANCE_AUDIO_SINK_BOOKSHELF_SPEAKER 0x0843 +/** Standmounted Speaker */ +#define BT_APPEARANCE_AUDIO_SINK_STANDMOUNTED_SPEAKER 0x0844 +/** Speakerphone */ +#define BT_APPEARANCE_AUDIO_SINK_SPEAKERPHONE 0x0845 +/** Generic Audio Source */ +#define BT_APPEARANCE_GENERIC_AUDIO_SOURCE 0x0880 +/** Microphone */ +#define BT_APPEARANCE_AUDIO_SOURCE_MICROPHONE 0x0881 +/** Alarm */ +#define BT_APPEARANCE_AUDIO_SOURCE_ALARM 0x0882 +/** Bell */ +#define BT_APPEARANCE_AUDIO_SOURCE_BELL 0x0883 +/** Horn */ +#define BT_APPEARANCE_AUDIO_SOURCE_HORN 0x0884 +/** Broadcasting Device */ +#define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_DEVICE 0x0885 +/** Service Desk */ +#define BT_APPEARANCE_AUDIO_SOURCE_SERVICE_DESK 0x0886 +/** Kiosk */ +#define BT_APPEARANCE_AUDIO_SOURCE_KIOSK 0x0887 +/** Broadcasting Room */ +#define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_ROOM 0x0888 +/** Auditorium */ +#define BT_APPEARANCE_AUDIO_SOURCE_AUDITORIUM 0x0889 +/** Generic Motorized Vehicle */ +#define BT_APPEARANCE_GENERIC_MOTORIZED_VEHICLE 0x08C0 +/** Car */ +#define BT_APPEARANCE_VEHICLE_CAR 0x08C1 +/** Large Goods Vehicle */ +#define BT_APPEARANCE_VEHICLE_LARGE_GOODS 0x08C2 +/** 2-Wheeled Vehicle */ +#define BT_APPEARANCE_VEHICLE_TWO_WHEELED 0x08C3 +/** Motorbike */ +#define BT_APPEARANCE_VEHICLE_MOTORBIKE 0x08C4 +/** Scooter */ +#define BT_APPEARANCE_VEHICLE_SCOOTER 0x08C5 +/** Moped */ +#define BT_APPEARANCE_VEHICLE_MOPED 0x08C6 +/** 3-Wheeled Vehicle */ +#define BT_APPEARANCE_VEHICLE_THREE_WHEELED 0x08C7 +/** Light Vehicle */ +#define BT_APPEARANCE_VEHICLE_LIGHT 0x08C8 +/** Quad Bike */ +#define BT_APPEARANCE_VEHICLE_QUAD_BIKE 0x08C9 +/** Minibus */ +#define BT_APPEARANCE_VEHICLE_MINIBUS 0x08CA +/** Bus */ +#define BT_APPEARANCE_VEHICLE_BUS 0x08CB +/** Trolley */ +#define BT_APPEARANCE_VEHICLE_TROLLEY 0x08CC +/** Agricultural Vehicle */ +#define BT_APPEARANCE_VEHICLE_AGRICULTURAL 0x08CD +/** Camper/Caravan */ +#define BT_APPEARANCE_VEHICLE_CAMPER_OR_CARAVAN 0x08CE +/** Recreational Vehicle/Motor Home */ +#define BT_APPEARANCE_VEHICLE_RECREATIONAL 0x08CF +/** Generic Domestic Appliance */ +#define BT_APPEARANCE_GENERIC_DOMESTIC_APPLIANCE 0x0900 +/** Refrigerator */ +#define BT_APPEARANCE_APPLIANCE_REFRIGERATOR 0x0901 +/** Freezer */ +#define BT_APPEARANCE_APPLIANCE_FREEZER 0x0902 +/** Oven */ +#define BT_APPEARANCE_APPLIANCE_OVEN 0x0903 +/** Microwave */ +#define BT_APPEARANCE_APPLIANCE_MICROWAVE 0x0904 +/** Toaster */ +#define BT_APPEARANCE_APPLIANCE_TOASTER 0x0905 +/** Washing Machine */ +#define BT_APPEARANCE_APPLIANCE_WASHING_MACHINE 0x0906 +/** Dryer */ +#define BT_APPEARANCE_APPLIANCE_DRYER 0x0907 +/** Coffee maker */ +#define BT_APPEARANCE_APPLIANCE_COFFEE_MAKER 0x0908 +/** Clothes iron */ +#define BT_APPEARANCE_APPLIANCE_CLOTHES_IRON 0x0909 +/** Curling iron */ +#define BT_APPEARANCE_APPLIANCE_CURLING_IRON 0x090A +/** Hair dryer */ +#define BT_APPEARANCE_APPLIANCE_HAIR_DRYER 0x090B +/** Vacuum cleaner */ +#define BT_APPEARANCE_APPLIANCE_VACUUM_CLEANER 0x090C +/** Robotic vacuum cleaner */ +#define BT_APPEARANCE_APPLIANCE_ROBOTIC_VACUUM_CLEANER 0x090D +/** Rice cooker */ +#define BT_APPEARANCE_APPLIANCE_RICE_COOKER 0x090E +/** Clothes steamer */ +#define BT_APPEARANCE_APPLIANCE_CLOTHES_STEAMER 0x090F +/** Generic Wearable Audio Device */ +#define BT_APPEARANCE_GENERIC_WEARABLE_AUDIO_DEVICE 0x0940 +/** Earbud */ +#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_EARBUD 0x0941 +/** Headset */ +#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADSET 0x0942 +/** Headphones */ +#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADPHONES 0x0943 +/** Neck Band */ +#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_NECK_BAND 0x0944 +/** Generic Aircraft */ +#define BT_APPEARANCE_GENERIC_AIRCRAFT 0x0980 +/** Light Aircraft */ +#define BT_APPEARANCE_AIRCRAFT_LIGHT 0x0981 +/** Microlight */ +#define BT_APPEARANCE_AIRCRAFT_MICROLIGHT 0x0982 +/** Paraglider */ +#define BT_APPEARANCE_AIRCRAFT_PARAGLIDER 0x0983 +/** Large Passenger Aircraft */ +#define BT_APPEARANCE_AIRCRAFT_LARGE_PASSENGER 0x0984 +/** Generic AV Equipment */ +#define BT_APPEARANCE_GENERIC_AV_EQUIPMENT 0x09C0 +/** Amplifier */ +#define BT_APPEARANCE_AV_EQUIPMENT_AMPLIFIER 0x09C1 +/** Receiver */ +#define BT_APPEARANCE_AV_EQUIPMENT_RECEIVER 0x09C2 +/** Radio */ +#define BT_APPEARANCE_AV_EQUIPMENT_RADIO 0x09C3 +/** Tuner */ +#define BT_APPEARANCE_AV_EQUIPMENT_TUNER 0x09C4 +/** Turntable */ +#define BT_APPEARANCE_AV_EQUIPMENT_TURNTABLE 0x09C5 +/** CD Player */ +#define BT_APPEARANCE_AV_EQUIPMENT_CD_PLAYER 0x09C6 +/** DVD Player */ +#define BT_APPEARANCE_AV_EQUIPMENT_DVD_PLAYER 0x09C7 +/** Bluray Player */ +#define BT_APPEARANCE_AV_EQUIPMENT_BLURAY_PLAYER 0x09C8 +/** Optical Disc Player */ +#define BT_APPEARANCE_AV_EQUIPMENT_OPTICAL_DISC_PLAYER 0x09C9 +/** Set-Top Box */ +#define BT_APPEARANCE_AV_EQUIPMENT_SET_TOP_BOX 0x09CA +/** Generic Display Equipment */ +#define BT_APPEARANCE_GENERIC_DISPLAY_EQUIPMENT 0x0A00 +/** Television */ +#define BT_APPEARANCE_DISPLAY_EQUIPMENT_TELEVISION 0x0A01 +/** Monitor */ +#define BT_APPEARANCE_DISPLAY_EQUIPMENT_MONITOR 0x0A02 +/** Projector */ +#define BT_APPEARANCE_DISPLAY_EQUIPMENT_PROJECTOR 0x0A03 +/** Generic Hearing aid */ +#define BT_APPEARANCE_GENERIC_HEARING_AID 0x0A40 +/** In-ear hearing aid */ +#define BT_APPEARANCE_HEARING_AID_IN_EAR 0x0A41 +/** Behind-ear hearing aid */ +#define BT_APPEARANCE_HEARING_AID_BEHIND_EAR 0x0A42 +/** Cochlear Implant */ +#define BT_APPEARANCE_HEARING_AID_COCHLEAR_IMPLANT 0x0A43 +/** Generic Gaming */ +#define BT_APPEARANCE_GENERIC_GAMING 0x0A80 +/** Home Video Game Console */ +#define BT_APPEARANCE_HOME_VIDEO_GAME_CONSOLE 0x0A81 +/** Portable handheld console */ +#define BT_APPEARANCE_PORTABLE_HANDHELD_CONSOLE 0x0A82 +/** Generic Signage */ +#define BT_APPEARANCE_GENERIC_SIGNAGE 0x0AC0 +/** Digital Signage */ +#define BT_APPEARANCE_SIGNAGE_DIGITAL 0x0AC1 +/** Electronic Label */ +#define BT_APPEARANCE_SIGNAGE_ELECTRONIC_LABEL 0x0AC2 +/** Generic Pulse Oximeter */ +#define BT_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 +/** Fingertip Pulse Oximeter */ +#define BT_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 +/** Wrist Worn Pulse Oximeter */ +#define BT_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 +/** Generic Weight Scale */ +#define BT_APPEARANCE_GENERIC_WEIGHT_SCALE 0x0C80 +/** Generic Personal Mobility Device */ +#define BT_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 +/** Powered Wheelchair */ +#define BT_APPEARANCE_MOBILITY_POWERED_WHEELCHAIR 0x0CC1 +/** Mobility Scooter */ +#define BT_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 +/** Continuous Glucose Monitor */ +#define BT_APPEARANCE_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 +/** Generic Insulin Pump */ +#define BT_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 +/** Insulin Pump, durable pump */ +#define BT_APPEARANCE_INSULIN_PUMP_DURABLE 0x0D41 +/** Insulin Pump, patch pump */ +#define BT_APPEARANCE_INSULIN_PUMP_PATCH 0x0D44 +/** Insulin Pen */ +#define BT_APPEARANCE_INSULIN_PEN 0x0D48 +/** Generic Medication Delivery */ +#define BT_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 +/** Generic Spirometer */ +#define BT_APPEARANCE_GENERIC_SPIROMETER 0x0DC0 +/** Handheld Spirometer */ +#define BT_APPEARANCE_SPIROMETER_HANDHELD 0x0DC1 +/** Generic Outdoor Sports Activity */ +#define BT_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 +/** Location Display */ +#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 +/** Location and Navigation Display */ +#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 +/** Location Pod */ +#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 +/** Location and Navigation Pod */ +#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 + +/** @} */ /* end of @name Appearance Numbers */ + +/** + * @name Common Data Types + * @{ + */ +#define BT_DATA_FLAGS 0x01 /**< AD flags */ +#define BT_DATA_UUID16_SOME 0x02 /**< 16-bit UUID, more available */ +#define BT_DATA_UUID16_ALL 0x03 /**< 16-bit UUID, all listed */ +#define BT_DATA_UUID32_SOME 0x04 /**< 32-bit UUID, more available */ +#define BT_DATA_UUID32_ALL 0x05 /**< 32-bit UUID, all listed */ +#define BT_DATA_UUID128_SOME 0x06 /**< 128-bit UUID, more available */ +#define BT_DATA_UUID128_ALL 0x07 /**< 128-bit UUID, all listed */ +#define BT_DATA_NAME_SHORTENED 0x08 /**< Shortened name */ +#define BT_DATA_NAME_COMPLETE 0x09 /**< Complete name */ +#define BT_DATA_TX_POWER 0x0a /**< Tx Power */ +#define BT_DATA_DEVICE_CLASS 0x0d /**< Class of Device */ +#define BT_DATA_SIMPLE_PAIRING_HASH_C192 0x0e /**< Simple Pairing Hash C-192 */ +#define BT_DATA_SIMPLE_PAIRING_RAND_C192 0x0f /**< Simple Pairing Randomizer R-192 */ +#define BT_DATA_DEVICE_ID 0x10 /**< Device ID (Profile) */ +#define BT_DATA_SM_TK_VALUE 0x10 /**< Security Manager TK Value */ +#define BT_DATA_SM_OOB_FLAGS 0x11 /**< Security Manager OOB Flags */ +#define BT_DATA_PERIPHERAL_INT_RANGE 0x12 /**< Peripheral Connection Interval Range */ +#define BT_DATA_SOLICIT16 0x14 /**< Solicit UUIDs, 16-bit */ +#define BT_DATA_SOLICIT128 0x15 /**< Solicit UUIDs, 128-bit */ +#define BT_DATA_SVC_DATA16 0x16 /**< Service data, 16-bit UUID */ +#define BT_DATA_PUB_TARGET_ADDR 0x17 /**< Public Target Address */ +#define BT_DATA_RAND_TARGET_ADDR 0x18 /**< Random Target Address */ +#define BT_DATA_GAP_APPEARANCE 0x19 /**< GAP appearance */ +#define BT_DATA_ADV_INT 0x1a /**< Advertising Interval */ +#define BT_DATA_LE_BT_DEVICE_ADDRESS 0x1b /**< LE Bluetooth Device Address */ +#define BT_DATA_LE_ROLE 0x1c /**< LE Role */ +#define BT_DATA_SIMPLE_PAIRING_HASH 0x1d /**< Simple Pairing Hash C256 */ +#define BT_DATA_SIMPLE_PAIRING_RAND 0x1e /**< Simple Pairing Randomizer R256 */ +#define BT_DATA_SOLICIT32 0x1f /**< Solicit UUIDs, 32-bit */ +#define BT_DATA_SVC_DATA32 0x20 /**< Service data, 32-bit UUID */ +#define BT_DATA_SVC_DATA128 0x21 /**< Service data, 128-bit UUID */ +#define BT_DATA_LE_SC_CONFIRM_VALUE 0x22 /**< LE SC Confirmation Value */ +#define BT_DATA_LE_SC_RANDOM_VALUE 0x23 /**< LE SC Random Value */ +#define BT_DATA_URI 0x24 /**< URI */ +#define BT_DATA_INDOOR_POS 0x25 /**< Indoor Positioning */ +#define BT_DATA_TRANS_DISCOVER_DATA 0x26 /**< Transport Discovery Data */ +#define BT_DATA_LE_SUPPORTED_FEATURES 0x27 /**< LE Supported Features */ +#define BT_DATA_CHANNEL_MAP_UPDATE_IND 0x28 /**< Channel Map Update Indication */ +#define BT_DATA_MESH_PROV 0x29 /**< Mesh Provisioning PDU */ +#define BT_DATA_MESH_MESSAGE 0x2a /**< Mesh Networking PDU */ +#define BT_DATA_MESH_BEACON 0x2b /**< Mesh Beacon */ +#define BT_DATA_BIG_INFO 0x2c /**< BIGInfo */ +#define BT_DATA_BROADCAST_CODE 0x2d /**< Broadcast Code */ +#define BT_DATA_CSIS_RSI 0x2e /**< CSIS Random Set ID type */ +#define BT_DATA_ADV_INT_LONG 0x2f /**< Advertising Interval long */ +#define BT_DATA_BROADCAST_NAME 0x30 /**< Broadcast Name */ +#define BT_DATA_ENCRYPTED_AD_DATA 0x31 /**< Encrypted Advertising Data */ +#define BT_DATA_PAWR_TIMING_INFO 0x32 /**< Periodic Advertising Response Timing Info */ +#define BT_DATA_ESL 0x34 /**< Electronic Shelf Label Profile */ +#define BT_DATA_3D_INFO 0x3D /**< 3D Information Data */ + +#define BT_DATA_MANUFACTURER_DATA 0xff /**< Manufacturer Specific Data */ + +/** @} */ /* end of @name Common Data Types */ + +/** + * @name Flags data type values + * @{ + */ + +#define BT_LE_AD_LIMITED 0x01 /**< Limited Discoverable */ +#define BT_LE_AD_GENERAL 0x02 /**< General Discoverable */ +#define BT_LE_AD_NO_BREDR 0x04 /**< BR/EDR not supported */ + +/** @} */ /* end of @name Flags data type values */ +/** @} */ /* end of bt_assigned_numbers_core */ + +/** + * @name Company Identifiers (see Bluetooth Assigned Numbers) + * @{ + */ + +#define BT_COMP_ID_LF 0x05f1 /**< The Linux Foundation */ + +/** @} */ /* end of @name Company Identifiers */ + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_ASSIGNED_NUMBERS_H_ */ diff --git a/include/zephyr/bluetooth/gap.h b/include/zephyr/bluetooth/gap.h index a6ca5d0ebdc7..b446ad521d4c 100644 --- a/include/zephyr/bluetooth/gap.h +++ b/include/zephyr/bluetooth/gap.h @@ -11,6 +11,7 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_ +#include #include #include @@ -34,682 +35,6 @@ extern "C" { * @} */ -/** - * @name EIR/AD data type definitions - * @{ - */ -#define BT_DATA_FLAGS 0x01 /**< AD flags */ -#define BT_DATA_UUID16_SOME 0x02 /**< 16-bit UUID, more available */ -#define BT_DATA_UUID16_ALL 0x03 /**< 16-bit UUID, all listed */ -#define BT_DATA_UUID32_SOME 0x04 /**< 32-bit UUID, more available */ -#define BT_DATA_UUID32_ALL 0x05 /**< 32-bit UUID, all listed */ -#define BT_DATA_UUID128_SOME 0x06 /**< 128-bit UUID, more available */ -#define BT_DATA_UUID128_ALL 0x07 /**< 128-bit UUID, all listed */ -#define BT_DATA_NAME_SHORTENED 0x08 /**< Shortened name */ -#define BT_DATA_NAME_COMPLETE 0x09 /**< Complete name */ -#define BT_DATA_TX_POWER 0x0a /**< Tx Power */ -#define BT_DATA_DEVICE_CLASS 0x0d /**< Class of Device */ -#define BT_DATA_SIMPLE_PAIRING_HASH_C192 0x0e /**< Simple Pairing Hash C-192 */ -#define BT_DATA_SIMPLE_PAIRING_RAND_C192 0x0f /**< Simple Pairing Randomizer R-192 */ -#define BT_DATA_DEVICE_ID 0x10 /**< Device ID (Profile) */ -#define BT_DATA_SM_TK_VALUE 0x10 /**< Security Manager TK Value */ -#define BT_DATA_SM_OOB_FLAGS 0x11 /**< Security Manager OOB Flags */ -#define BT_DATA_PERIPHERAL_INT_RANGE 0x12 /**< Peripheral Connection Interval Range */ -#define BT_DATA_SOLICIT16 0x14 /**< Solicit UUIDs, 16-bit */ -#define BT_DATA_SOLICIT128 0x15 /**< Solicit UUIDs, 128-bit */ -#define BT_DATA_SVC_DATA16 0x16 /**< Service data, 16-bit UUID */ -#define BT_DATA_PUB_TARGET_ADDR 0x17 /**< Public Target Address */ -#define BT_DATA_RAND_TARGET_ADDR 0x18 /**< Random Target Address */ -#define BT_DATA_GAP_APPEARANCE 0x19 /**< GAP appearance */ -#define BT_DATA_ADV_INT 0x1a /**< Advertising Interval */ -#define BT_DATA_LE_BT_DEVICE_ADDRESS 0x1b /**< LE Bluetooth Device Address */ -#define BT_DATA_LE_ROLE 0x1c /**< LE Role */ -#define BT_DATA_SIMPLE_PAIRING_HASH 0x1d /**< Simple Pairing Hash C256 */ -#define BT_DATA_SIMPLE_PAIRING_RAND 0x1e /**< Simple Pairing Randomizer R256 */ -#define BT_DATA_SOLICIT32 0x1f /**< Solicit UUIDs, 32-bit */ -#define BT_DATA_SVC_DATA32 0x20 /**< Service data, 32-bit UUID */ -#define BT_DATA_SVC_DATA128 0x21 /**< Service data, 128-bit UUID */ -#define BT_DATA_LE_SC_CONFIRM_VALUE 0x22 /**< LE SC Confirmation Value */ -#define BT_DATA_LE_SC_RANDOM_VALUE 0x23 /**< LE SC Random Value */ -#define BT_DATA_URI 0x24 /**< URI */ -#define BT_DATA_INDOOR_POS 0x25 /**< Indoor Positioning */ -#define BT_DATA_TRANS_DISCOVER_DATA 0x26 /**< Transport Discovery Data */ -#define BT_DATA_LE_SUPPORTED_FEATURES 0x27 /**< LE Supported Features */ -#define BT_DATA_CHANNEL_MAP_UPDATE_IND 0x28 /**< Channel Map Update Indication */ -#define BT_DATA_MESH_PROV 0x29 /**< Mesh Provisioning PDU */ -#define BT_DATA_MESH_MESSAGE 0x2a /**< Mesh Networking PDU */ -#define BT_DATA_MESH_BEACON 0x2b /**< Mesh Beacon */ -#define BT_DATA_BIG_INFO 0x2c /**< BIGInfo */ -#define BT_DATA_BROADCAST_CODE 0x2d /**< Broadcast Code */ -#define BT_DATA_CSIS_RSI 0x2e /**< CSIS Random Set ID type */ -#define BT_DATA_ADV_INT_LONG 0x2f /**< Advertising Interval long */ -#define BT_DATA_BROADCAST_NAME 0x30 /**< Broadcast Name */ -#define BT_DATA_ENCRYPTED_AD_DATA 0x31 /**< Encrypted Advertising Data */ -#define BT_DATA_PAWR_TIMING_INFO 0x32 /**< Periodic Advertising Response Timing Info */ -#define BT_DATA_ESL 0x34 /**< Electronic Shelf Label Profile */ -#define BT_DATA_3D_INFO 0x3D /**< 3D Information Data */ - -#define BT_DATA_MANUFACTURER_DATA 0xff /**< Manufacturer Specific Data */ - -#define BT_LE_AD_LIMITED 0x01 /**< Limited Discoverable */ -#define BT_LE_AD_GENERAL 0x02 /**< General Discoverable */ -#define BT_LE_AD_NO_BREDR 0x04 /**< BR/EDR not supported */ -/** - * @} - */ - -/** - * @name Appearance Values - * - * Last Modified on 2023-01-05 - * @{ - */ -/** Generic Unknown */ -#define BT_APPEARANCE_UNKNOWN 0x0000 -/** Generic Phone */ -#define BT_APPEARANCE_GENERIC_PHONE 0x0040 -/** Generic Computer */ -#define BT_APPEARANCE_GENERIC_COMPUTER 0x0080 -/** Desktop Workstation */ -#define BT_APPEARANCE_COMPUTER_DESKTOP_WORKSTATION 0x0081 -/** Server-class Computer */ -#define BT_APPEARANCE_COMPUTER_SERVER_CLASS 0x0082 -/** Laptop */ -#define BT_APPEARANCE_COMPUTER_LAPTOP 0x0083 -/** Handheld PC/PDA (clamshell) */ -#define BT_APPEARANCE_COMPUTER_HANDHELD_PCPDA 0x0084 -/** Palm­size PC/PDA */ -#define BT_APPEARANCE_COMPUTER_PALMSIZE_PCPDA 0x0085 -/** Wearable computer (watch size) */ -#define BT_APPEARANCE_COMPUTER_WEARABLE_COMPUTER 0x0086 -/** Tablet */ -#define BT_APPEARANCE_COMPUTER_TABLET 0x0087 -/** Docking Station */ -#define BT_APPEARANCE_COMPUTER_DOCKING_STATION 0x0088 -/** All in One */ -#define BT_APPEARANCE_COMPUTER_ALL_IN_ONE 0x0089 -/** Blade Server */ -#define BT_APPEARANCE_COMPUTER_BLADE_SERVER 0x008A -/** Convertible */ -#define BT_APPEARANCE_COMPUTER_CONVERTIBLE 0x008B -/** Detachable */ -#define BT_APPEARANCE_COMPUTER_DETACHABLE 0x008C -/** IoT Gateway */ -#define BT_APPEARANCE_COMPUTER_IOT_GATEWAY 0x008D -/** Mini PC */ -#define BT_APPEARANCE_COMPUTER_MINI_PC 0x008E -/** Stick PC */ -#define BT_APPEARANCE_COMPUTER_STICK_PC 0x008F -/** Generic Watch */ -#define BT_APPEARANCE_GENERIC_WATCH 0x00C0 -/** Sports Watch */ -#define BT_APPEARANCE_SPORTS_WATCH 0x00C1 -/** Smartwatch */ -#define BT_APPEARANCE_SMARTWATCH 0x00C2 -/** Generic Clock */ -#define BT_APPEARANCE_GENERIC_CLOCK 0x0100 -/** Generic Display */ -#define BT_APPEARANCE_GENERIC_DISPLAY 0x0140 -/** Generic Remote Control */ -#define BT_APPEARANCE_GENERIC_REMOTE 0x0180 -/** Generic Eye-glasses */ -#define BT_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 -/** Generic Tag */ -#define BT_APPEARANCE_GENERIC_TAG 0x0200 -/** Generic Keyring */ -#define BT_APPEARANCE_GENERIC_KEYRING 0x0240 -/** Generic Media Player */ -#define BT_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 -/** Generic Barcode Scanner */ -#define BT_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 -/** Generic Thermometer */ -#define BT_APPEARANCE_GENERIC_THERMOMETER 0x0300 -/** Ear Thermometer */ -#define BT_APPEARANCE_THERMOMETER_EAR 0x0301 -/** Generic Heart Rate Sensor */ -#define BT_APPEARANCE_GENERIC_HEART_RATE 0x0340 -/** Heart Rate Belt */ -#define BT_APPEARANCE_HEART_RATE_BELT 0x0341 -/** Generic Blood Pressure */ -#define BT_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 -/** Arm Blood Pressure */ -#define BT_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 -/** Wrist Blood Pressure */ -#define BT_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 -/** Generic Human Interface Device */ -#define BT_APPEARANCE_GENERIC_HID 0x03C0 -/** Keyboard */ -#define BT_APPEARANCE_HID_KEYBOARD 0x03C1 -/** Mouse */ -#define BT_APPEARANCE_HID_MOUSE 0x03C2 -/** Joystick */ -#define BT_APPEARANCE_HID_JOYSTICK 0x03C3 -/** Gamepad */ -#define BT_APPEARANCE_HID_GAMEPAD 0x03C4 -/** Digitizer Tablet */ -#define BT_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 -/** Card Reader */ -#define BT_APPEARANCE_HID_CARD_READER 0x03C6 -/** Digital Pen */ -#define BT_APPEARANCE_HID_DIGITAL_PEN 0x03C7 -/** Barcode Scanner */ -#define BT_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 -/** Touchpad */ -#define BT_APPEARANCE_HID_TOUCHPAD 0x03C9 -/** Presentation Remote */ -#define BT_APPEARANCE_HID_PRESENTATION_REMOTE 0x03CA -/** Generic Glucose Meter */ -#define BT_APPEARANCE_GENERIC_GLUCOSE 0x0400 -/** Generic Running Walking Sensor */ -#define BT_APPEARANCE_GENERIC_WALKING 0x0440 -/** In-Shoe Running Walking Sensor */ -#define BT_APPEARANCE_WALKING_IN_SHOE 0x0441 -/** On-Shoe Running Walking Sensor */ -#define BT_APPEARANCE_WALKING_ON_SHOE 0x0442 -/** On-Hip Running Walking Sensor */ -#define BT_APPEARANCE_WALKING_ON_HIP 0x0443 -/** Generic Cycling */ -#define BT_APPEARANCE_GENERIC_CYCLING 0x0480 -/** Cycling Computer */ -#define BT_APPEARANCE_CYCLING_COMPUTER 0x0481 -/** Speed Sensor */ -#define BT_APPEARANCE_CYCLING_SPEED 0x0482 -/** Cadence Sensor */ -#define BT_APPEARANCE_CYCLING_CADENCE 0x0483 -/** Power Sensor */ -#define BT_APPEARANCE_CYCLING_POWER 0x0484 -/** Speed and Cadence Sensor */ -#define BT_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 -/** Generic Control Device */ -#define BT_APPEARANCE_GENERIC_CONTROL_DEVICE 0x04C0 -/** Switch */ -#define BT_APPEARANCE_CONTROL_SWITCH 0x04C1 -/** Multi-switch */ -#define BT_APPEARANCE_CONTROL_MULTI_SWITCH 0x04C2 -/** Button */ -#define BT_APPEARANCE_CONTROL_BUTTON 0x04C3 -/** Slider */ -#define BT_APPEARANCE_CONTROL_SLIDER 0x04C4 -/** Rotary Switch */ -#define BT_APPEARANCE_CONTROL_ROTARY_SWITCH 0x04C5 -/** Touch Panel */ -#define BT_APPEARANCE_CONTROL_TOUCH_PANEL 0x04C6 -/** Single Switch */ -#define BT_APPEARANCE_CONTROL_SINGLE_SWITCH 0x04C7 -/** Double Switch */ -#define BT_APPEARANCE_CONTROL_DOUBLE_SWITCH 0x04C8 -/** Triple Switch */ -#define BT_APPEARANCE_CONTROL_TRIPLE_SWITCH 0x04C9 -/** Battery Switch */ -#define BT_APPEARANCE_CONTROL_BATTERY_SWITCH 0x04CA -/** Energy Harvesting Switch */ -#define BT_APPEARANCE_CONTROL_ENERGY_HARVESTING_SWITCH 0x04CB -/** Push Button */ -#define BT_APPEARANCE_CONTROL_PUSH_BUTTON 0x04CC -/** Generic Network Device */ -#define BT_APPEARANCE_GENERIC_NETWORK_DEVICE 0x0500 -/** Access Point */ -#define BT_APPEARANCE_NETWORK_ACCESS_POINT 0x0501 -/** Mesh Device */ -#define BT_APPEARANCE_NETWORK_MESH_DEVICE 0x0502 -/** Mesh Network Proxy */ -#define BT_APPEARANCE_NETWORK_MESH_PROXY 0x0503 -/** Generic Sensor */ -#define BT_APPEARANCE_GENERIC_SENSOR 0x0540 -/** Motion Sensor */ -#define BT_APPEARANCE_SENSOR_MOTION 0x0541 -/** Air quality Sensor */ -#define BT_APPEARANCE_SENSOR_AIR_QUALITY 0x0542 -/** Temperature Sensor */ -#define BT_APPEARANCE_SENSOR_TEMPERATURE 0x0543 -/** Humidity Sensor */ -#define BT_APPEARANCE_SENSOR_HUMIDITY 0x0544 -/** Leak Sensor */ -#define BT_APPEARANCE_SENSOR_LEAK 0x0545 -/** Smoke Sensor */ -#define BT_APPEARANCE_SENSOR_SMOKE 0x0546 -/** Occupancy Sensor */ -#define BT_APPEARANCE_SENSOR_OCCUPANCY 0x0547 -/** Contact Sensor */ -#define BT_APPEARANCE_SENSOR_CONTACT 0x0548 -/** Carbon Monoxide Sensor */ -#define BT_APPEARANCE_SENSOR_CARBON_MONOXIDE 0x0549 -/** Carbon Dioxide Sensor */ -#define BT_APPEARANCE_SENSOR_CARBON_DIOXIDE 0x054A -/** Ambient Light Sensor */ -#define BT_APPEARANCE_SENSOR_AMBIENT_LIGHT 0x054B -/** Energy Sensor */ -#define BT_APPEARANCE_SENSOR_ENERGY 0x054C -/** Color Light Sensor */ -#define BT_APPEARANCE_SENSOR_COLOR_LIGHT 0x054D -/** Rain Sensor */ -#define BT_APPEARANCE_SENSOR_RAIN 0x054E -/** Fire Sensor */ -#define BT_APPEARANCE_SENSOR_FIRE 0x054F -/** Wind Sensor */ -#define BT_APPEARANCE_SENSOR_WIND 0x0550 -/** Proximity Sensor */ -#define BT_APPEARANCE_SENSOR_PROXIMITY 0x0551 -/** Multi-Sensor */ -#define BT_APPEARANCE_SENSOR_MULTI 0x0552 -/** Flush Mounted Sensor */ -#define BT_APPEARANCE_SENSOR_FLUSH_MOUNTED 0x0553 -/** Ceiling Mounted Sensor */ -#define BT_APPEARANCE_SENSOR_CEILING_MOUNTED 0x0554 -/** Wall Mounted Sensor */ -#define BT_APPEARANCE_SENSOR_WALL_MOUNTED 0x0555 -/** Multisensor */ -#define BT_APPEARANCE_MULTISENSOR 0x0556 -/** Energy Meter */ -#define BT_APPEARANCE_SENSOR_ENERGY_METER 0x0557 -/** Flame Detector */ -#define BT_APPEARANCE_SENSOR_FLAME_DETECTOR 0x0558 -/** Vehicle Tire Pressure Sensor */ -#define BT_APPEARANCE_SENSOR_VEHICLE_TIRE_PRESSURE 0x0559 -/** Generic Light Fixtures */ -#define BT_APPEARANCE_GENERIC_LIGHT_FIXTURES 0x0580 -/** Wall Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_WALL 0x0581 -/** Ceiling Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_CEILING 0x0582 -/** Floor Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_FLOOR 0x0583 -/** Cabinet Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_CABINET 0x0584 -/** Desk Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_DESK 0x0585 -/** Troffer Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_TROFFER 0x0586 -/** Pendant Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_PENDANT 0x0587 -/** In-ground Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_IN_GROUND 0x0588 -/** Flood Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_FLOOD 0x0589 -/** Underwater Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_UNDERWATER 0x058A -/** Bollard with Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_BOLLARD_WITH 0x058B -/** Pathway Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_PATHWAY 0x058C -/** Garden Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_GARDEN 0x058D -/** Pole-top Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_POLE_TOP 0x058E -/** Spotlight */ -#define BT_APPEARANCE_SPOT_LIGHT 0x058F -/** Linear Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_LINEAR 0x0590 -/** Street Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_STREET 0x0591 -/** Shelves Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_SHELVES 0x0592 -/** Bay Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_BAY 0x0593 -/** Emergency Exit Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_EMERGENCY_EXIT 0x0594 -/** Light Controller */ -#define BT_APPEARANCE_LIGHT_FIXTURES_CONTROLLER 0x0595 -/** Light Driver */ -#define BT_APPEARANCE_LIGHT_FIXTURES_DRIVER 0x0596 -/** Bulb */ -#define BT_APPEARANCE_LIGHT_FIXTURES_BULB 0x0597 -/** Low-bay Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_LOW_BAY 0x0598 -/** High-bay Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_HIGH_BAY 0x0599 -/** Generic Fan */ -#define BT_APPEARANCE_GENERIC_FAN 0x05C0 -/** Ceiling Fan */ -#define BT_APPEARANCE_FAN_CEILING 0x05C1 -/** Axial Fan */ -#define BT_APPEARANCE_FAN_AXIAL 0x05C2 -/** Exhaust Fan */ -#define BT_APPEARANCE_FAN_EXHAUST 0x05C3 -/** Pedestal Fan */ -#define BT_APPEARANCE_FAN_PEDESTAL 0x05C4 -/** Desk Fan */ -#define BT_APPEARANCE_FAN_DESK 0x05C5 -/** Wall Fan */ -#define BT_APPEARANCE_FAN_WALL 0x05C6 -/** Generic HVAC */ -#define BT_APPEARANCE_GENERIC_HVAC 0x0600 -/** Thermostat */ -#define BT_APPEARANCE_HVAC_THERMOSTAT 0x0601 -/** Humidifier */ -#define BT_APPEARANCE_HVAC_HUMIDIFIER 0x0602 -/** De-humidifier */ -#define BT_APPEARANCE_HVAC_DEHUMIDIFIER 0x0603 -/** Heater */ -#define BT_APPEARANCE_HVAC_HEATER 0x0604 -/** Radiator */ -#define BT_APPEARANCE_HVAC_RADIATOR 0x0605 -/** Boiler */ -#define BT_APPEARANCE_HVAC_BOILER 0x0606 -/** Heat Pump */ -#define BT_APPEARANCE_HVAC_HEAT_PUMP 0x0607 -/** Infrared Heater */ -#define BT_APPEARANCE_HVAC_INFRARED_HEATER 0x0608 -/** Radiant Panel Heater */ -#define BT_APPEARANCE_HVAC_RADIANT_PANEL_HEATER 0x0609 -/** Fan Heater */ -#define BT_APPEARANCE_HVAC_FAN_HEATER 0x060A -/** Air Curtain */ -#define BT_APPEARANCE_HVAC_AIR_CURTAIN 0x060B -/** Generic Air Conditioning */ -#define BT_APPEARANCE_GENERIC_AIR_CONDITIONING 0x0640 -/** Generic Humidifier */ -#define BT_APPEARANCE_GENERIC_HUMIDIFIER 0x0680 -/** Generic Heating */ -#define BT_APPEARANCE_GENERIC_HEATING 0x06C0 -/** Radiator */ -#define BT_APPEARANCE_HEATING_RADIATOR 0x06C1 -/** Boiler */ -#define BT_APPEARANCE_HEATING_BOILER 0x06C2 -/** Heat Pump */ -#define BT_APPEARANCE_HEATING_HEAT_PUMP 0x06C3 -/** Infrared Heater */ -#define BT_APPEARANCE_HEATING_INFRARED_HEATER 0x06C4 -/** Radiant Panel Heater */ -#define BT_APPEARANCE_HEATING_RADIANT_PANEL_HEATER 0x06C5 -/** Fan Heater */ -#define BT_APPEARANCE_HEATING_FAN_HEATER 0x06C6 -/** Air Curtain */ -#define BT_APPEARANCE_HEATING_AIR_CURTAIN 0x06C7 -/** Generic Access Control */ -#define BT_APPEARANCE_GENERIC_ACCESS_CONTROL 0x0700 -/** Access Door */ -#define BT_APPEARANCE_CONTROL_ACCESS_DOOR 0x0701 -/** Garage Door */ -#define BT_APPEARANCE_CONTROL_GARAGE_DOOR 0x0702 -/** Emergency Exit Door */ -#define BT_APPEARANCE_CONTROL_EMERGENCY_EXIT_DOOR 0x0703 -/** Access Lock */ -#define BT_APPEARANCE_CONTROL_ACCESS_LOCK 0x0704 -/** Elevator */ -#define BT_APPEARANCE_CONTROL_ELEVATOR 0x0705 -/** Window */ -#define BT_APPEARANCE_CONTROL_WINDOW 0x0706 -/** Entrance Gate */ -#define BT_APPEARANCE_CONTROL_ENTRANCE_GATE 0x0707 -/** Door Lock */ -#define BT_APPEARANCE_CONTROL_DOOR_LOCK 0x0708 -/** Locker */ -#define BT_APPEARANCE_CONTROL_LOCKER 0x0709 -/** Generic Motorized Device */ -#define BT_APPEARANCE_GENERIC_MOTORIZED_DEVICE 0x0740 -/** Motorized Gate */ -#define BT_APPEARANCE_MOTORIZED_GATE 0x0741 -/** Awning */ -#define BT_APPEARANCE_MOTORIZED_AWNING 0x0742 -/** Blinds or Shades */ -#define BT_APPEARANCE_MOTORIZED_BLINDS_OR_SHADES 0x0743 -/** Curtains */ -#define BT_APPEARANCE_MOTORIZED_CURTAINS 0x0744 -/** Screen */ -#define BT_APPEARANCE_MOTORIZED_SCREEN 0x0745 -/** Generic Power Device */ -#define BT_APPEARANCE_GENERIC_POWER_DEVICE 0x0780 -/** Power Outlet */ -#define BT_APPEARANCE_POWER_OUTLET 0x0781 -/** Power Strip */ -#define BT_APPEARANCE_POWER_STRIP 0x0782 -/** Plug */ -#define BT_APPEARANCE_POWER_PLUG 0x0783 -/** Power Supply */ -#define BT_APPEARANCE_POWER_SUPPLY 0x0784 -/** LED Driver */ -#define BT_APPEARANCE_POWER_LED_DRIVER 0x0785 -/** Fluorescent Lamp Gear */ -#define BT_APPEARANCE_POWER_FLUORESCENT_LAMP_GEAR 0x0786 -/** HID Lamp Gear */ -#define BT_APPEARANCE_POWER_HID_LAMP_GEAR 0x0787 -/** Charge Case */ -#define BT_APPEARANCE_POWER_CHARGE_CASE 0x0788 -/** Power Bank */ -#define BT_APPEARANCE_POWER_POWER_BANK 0x0789 -/** Generic Light Source */ -#define BT_APPEARANCE_GENERIC_LIGHT_SOURCE 0x07C0 -/** Incandescent Light Bulb */ -#define BT_APPEARANCE_LIGHT_SOURCE_INCANDESCENT_BULB 0x07C1 -/** LED Lamp */ -#define BT_APPEARANCE_LIGHT_SOURCE_LED_LAMP 0x07C2 -/** HID Lamp */ -#define BT_APPEARANCE_LIGHT_SOURCE_HID_LAMP 0x07C3 -/** Fluorescent Lamp */ -#define BT_APPEARANCE_LIGHT_SOURCE_FLUORESCENT_LAMP 0x07C4 -/** LED Array */ -#define BT_APPEARANCE_LIGHT_SOURCE_LED_ARRAY 0x07C5 -/** Multi-Color LED Array */ -#define BT_APPEARANCE_LIGHT_SOURCE_MULTICOLOR_LED_ARRAY 0x07C6 -/** Low voltage halogen */ -#define BT_APPEARANCE_LIGHT_SOURCE_LOW_VOLTAGE_HALOGEN 0x07C7 -/** Organic light emitting diode */ -#define BT_APPEARANCE_LIGHT_SOURCE_OLED 0x07C8 -/** Generic Window Covering */ -#define BT_APPEARANCE_GENERIC_WINDOW_COVERING 0x0800 -/** Window Shades */ -#define BT_APPEARANCE_WINDOW_SHADES 0x0801 -/** Window Blinds */ -#define BT_APPEARANCE_WINDOW_BLINDS 0x0802 -/** Window Awning */ -#define BT_APPEARANCE_WINDOW_AWNING 0x0803 -/** Window Curtain */ -#define BT_APPEARANCE_WINDOW_CURTAIN 0x0804 -/** Exterior Shutter */ -#define BT_APPEARANCE_WINDOW_EXTERIOR_SHUTTER 0x0805 -/** Exterior Screen */ -#define BT_APPEARANCE_WINDOW_EXTERIOR_SCREEN 0x0806 -/** Generic Audio Sink */ -#define BT_APPEARANCE_GENERIC_AUDIO_SINK 0x0840 -/** Standalone Speaker */ -#define BT_APPEARANCE_AUDIO_SINK_STANDALONE_SPEAKER 0x0841 -/** Soundbar */ -#define BT_APPEARANCE_AUDIO_SINK_SOUNDBAR 0x0842 -/** Bookshelf Speaker */ -#define BT_APPEARANCE_AUDIO_SINK_BOOKSHELF_SPEAKER 0x0843 -/** Standmounted Speaker */ -#define BT_APPEARANCE_AUDIO_SINK_STANDMOUNTED_SPEAKER 0x0844 -/** Speakerphone */ -#define BT_APPEARANCE_AUDIO_SINK_SPEAKERPHONE 0x0845 -/** Generic Audio Source */ -#define BT_APPEARANCE_GENERIC_AUDIO_SOURCE 0x0880 -/** Microphone */ -#define BT_APPEARANCE_AUDIO_SOURCE_MICROPHONE 0x0881 -/** Alarm */ -#define BT_APPEARANCE_AUDIO_SOURCE_ALARM 0x0882 -/** Bell */ -#define BT_APPEARANCE_AUDIO_SOURCE_BELL 0x0883 -/** Horn */ -#define BT_APPEARANCE_AUDIO_SOURCE_HORN 0x0884 -/** Broadcasting Device */ -#define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_DEVICE 0x0885 -/** Service Desk */ -#define BT_APPEARANCE_AUDIO_SOURCE_SERVICE_DESK 0x0886 -/** Kiosk */ -#define BT_APPEARANCE_AUDIO_SOURCE_KIOSK 0x0887 -/** Broadcasting Room */ -#define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_ROOM 0x0888 -/** Auditorium */ -#define BT_APPEARANCE_AUDIO_SOURCE_AUDITORIUM 0x0889 -/** Generic Motorized Vehicle */ -#define BT_APPEARANCE_GENERIC_MOTORIZED_VEHICLE 0x08C0 -/** Car */ -#define BT_APPEARANCE_VEHICLE_CAR 0x08C1 -/** Large Goods Vehicle */ -#define BT_APPEARANCE_VEHICLE_LARGE_GOODS 0x08C2 -/** 2-Wheeled Vehicle */ -#define BT_APPEARANCE_VEHICLE_TWO_WHEELED 0x08C3 -/** Motorbike */ -#define BT_APPEARANCE_VEHICLE_MOTORBIKE 0x08C4 -/** Scooter */ -#define BT_APPEARANCE_VEHICLE_SCOOTER 0x08C5 -/** Moped */ -#define BT_APPEARANCE_VEHICLE_MOPED 0x08C6 -/** 3-Wheeled Vehicle */ -#define BT_APPEARANCE_VEHICLE_THREE_WHEELED 0x08C7 -/** Light Vehicle */ -#define BT_APPEARANCE_VEHICLE_LIGHT 0x08C8 -/** Quad Bike */ -#define BT_APPEARANCE_VEHICLE_QUAD_BIKE 0x08C9 -/** Minibus */ -#define BT_APPEARANCE_VEHICLE_MINIBUS 0x08CA -/** Bus */ -#define BT_APPEARANCE_VEHICLE_BUS 0x08CB -/** Trolley */ -#define BT_APPEARANCE_VEHICLE_TROLLEY 0x08CC -/** Agricultural Vehicle */ -#define BT_APPEARANCE_VEHICLE_AGRICULTURAL 0x08CD -/** Camper/Caravan */ -#define BT_APPEARANCE_VEHICLE_CAMPER_OR_CARAVAN 0x08CE -/** Recreational Vehicle/Motor Home */ -#define BT_APPEARANCE_VEHICLE_RECREATIONAL 0x08CF -/** Generic Domestic Appliance */ -#define BT_APPEARANCE_GENERIC_DOMESTIC_APPLIANCE 0x0900 -/** Refrigerator */ -#define BT_APPEARANCE_APPLIANCE_REFRIGERATOR 0x0901 -/** Freezer */ -#define BT_APPEARANCE_APPLIANCE_FREEZER 0x0902 -/** Oven */ -#define BT_APPEARANCE_APPLIANCE_OVEN 0x0903 -/** Microwave */ -#define BT_APPEARANCE_APPLIANCE_MICROWAVE 0x0904 -/** Toaster */ -#define BT_APPEARANCE_APPLIANCE_TOASTER 0x0905 -/** Washing Machine */ -#define BT_APPEARANCE_APPLIANCE_WASHING_MACHINE 0x0906 -/** Dryer */ -#define BT_APPEARANCE_APPLIANCE_DRYER 0x0907 -/** Coffee maker */ -#define BT_APPEARANCE_APPLIANCE_COFFEE_MAKER 0x0908 -/** Clothes iron */ -#define BT_APPEARANCE_APPLIANCE_CLOTHES_IRON 0x0909 -/** Curling iron */ -#define BT_APPEARANCE_APPLIANCE_CURLING_IRON 0x090A -/** Hair dryer */ -#define BT_APPEARANCE_APPLIANCE_HAIR_DRYER 0x090B -/** Vacuum cleaner */ -#define BT_APPEARANCE_APPLIANCE_VACUUM_CLEANER 0x090C -/** Robotic vacuum cleaner */ -#define BT_APPEARANCE_APPLIANCE_ROBOTIC_VACUUM_CLEANER 0x090D -/** Rice cooker */ -#define BT_APPEARANCE_APPLIANCE_RICE_COOKER 0x090E -/** Clothes steamer */ -#define BT_APPEARANCE_APPLIANCE_CLOTHES_STEAMER 0x090F -/** Generic Wearable Audio Device */ -#define BT_APPEARANCE_GENERIC_WEARABLE_AUDIO_DEVICE 0x0940 -/** Earbud */ -#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_EARBUD 0x0941 -/** Headset */ -#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADSET 0x0942 -/** Headphones */ -#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADPHONES 0x0943 -/** Neck Band */ -#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_NECK_BAND 0x0944 -/** Generic Aircraft */ -#define BT_APPEARANCE_GENERIC_AIRCRAFT 0x0980 -/** Light Aircraft */ -#define BT_APPEARANCE_AIRCRAFT_LIGHT 0x0981 -/** Microlight */ -#define BT_APPEARANCE_AIRCRAFT_MICROLIGHT 0x0982 -/** Paraglider */ -#define BT_APPEARANCE_AIRCRAFT_PARAGLIDER 0x0983 -/** Large Passenger Aircraft */ -#define BT_APPEARANCE_AIRCRAFT_LARGE_PASSENGER 0x0984 -/** Generic AV Equipment */ -#define BT_APPEARANCE_GENERIC_AV_EQUIPMENT 0x09C0 -/** Amplifier */ -#define BT_APPEARANCE_AV_EQUIPMENT_AMPLIFIER 0x09C1 -/** Receiver */ -#define BT_APPEARANCE_AV_EQUIPMENT_RECEIVER 0x09C2 -/** Radio */ -#define BT_APPEARANCE_AV_EQUIPMENT_RADIO 0x09C3 -/** Tuner */ -#define BT_APPEARANCE_AV_EQUIPMENT_TUNER 0x09C4 -/** Turntable */ -#define BT_APPEARANCE_AV_EQUIPMENT_TURNTABLE 0x09C5 -/** CD Player */ -#define BT_APPEARANCE_AV_EQUIPMENT_CD_PLAYER 0x09C6 -/** DVD Player */ -#define BT_APPEARANCE_AV_EQUIPMENT_DVD_PLAYER 0x09C7 -/** Bluray Player */ -#define BT_APPEARANCE_AV_EQUIPMENT_BLURAY_PLAYER 0x09C8 -/** Optical Disc Player */ -#define BT_APPEARANCE_AV_EQUIPMENT_OPTICAL_DISC_PLAYER 0x09C9 -/** Set-Top Box */ -#define BT_APPEARANCE_AV_EQUIPMENT_SET_TOP_BOX 0x09CA -/** Generic Display Equipment */ -#define BT_APPEARANCE_GENERIC_DISPLAY_EQUIPMENT 0x0A00 -/** Television */ -#define BT_APPEARANCE_DISPLAY_EQUIPMENT_TELEVISION 0x0A01 -/** Monitor */ -#define BT_APPEARANCE_DISPLAY_EQUIPMENT_MONITOR 0x0A02 -/** Projector */ -#define BT_APPEARANCE_DISPLAY_EQUIPMENT_PROJECTOR 0x0A03 -/** Generic Hearing aid */ -#define BT_APPEARANCE_GENERIC_HEARING_AID 0x0A40 -/** In-ear hearing aid */ -#define BT_APPEARANCE_HEARING_AID_IN_EAR 0x0A41 -/** Behind-ear hearing aid */ -#define BT_APPEARANCE_HEARING_AID_BEHIND_EAR 0x0A42 -/** Cochlear Implant */ -#define BT_APPEARANCE_HEARING_AID_COCHLEAR_IMPLANT 0x0A43 -/** Generic Gaming */ -#define BT_APPEARANCE_GENERIC_GAMING 0x0A80 -/** Home Video Game Console */ -#define BT_APPEARANCE_HOME_VIDEO_GAME_CONSOLE 0x0A81 -/** Portable handheld console */ -#define BT_APPEARANCE_PORTABLE_HANDHELD_CONSOLE 0x0A82 -/** Generic Signage */ -#define BT_APPEARANCE_GENERIC_SIGNAGE 0x0AC0 -/** Digital Signage */ -#define BT_APPEARANCE_SIGNAGE_DIGITAL 0x0AC1 -/** Electronic Label */ -#define BT_APPEARANCE_SIGNAGE_ELECTRONIC_LABEL 0x0AC2 -/** Generic Pulse Oximeter */ -#define BT_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 -/** Fingertip Pulse Oximeter */ -#define BT_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 -/** Wrist Worn Pulse Oximeter */ -#define BT_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 -/** Generic Weight Scale */ -#define BT_APPEARANCE_GENERIC_WEIGHT_SCALE 0x0C80 -/** Generic Personal Mobility Device */ -#define BT_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 -/** Powered Wheelchair */ -#define BT_APPEARANCE_MOBILITY_POWERED_WHEELCHAIR 0x0CC1 -/** Mobility Scooter */ -#define BT_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 -/** Continuous Glucose Monitor */ -#define BT_APPEARANCE_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 -/** Generic Insulin Pump */ -#define BT_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 -/** Insulin Pump, durable pump */ -#define BT_APPEARANCE_INSULIN_PUMP_DURABLE 0x0D41 -/** Insulin Pump, patch pump */ -#define BT_APPEARANCE_INSULIN_PUMP_PATCH 0x0D44 -/** Insulin Pen */ -#define BT_APPEARANCE_INSULIN_PEN 0x0D48 -/** Generic Medication Delivery */ -#define BT_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 -/** Generic Spirometer */ -#define BT_APPEARANCE_GENERIC_SPIROMETER 0x0DC0 -/** Handheld Spirometer */ -#define BT_APPEARANCE_SPIROMETER_HANDHELD 0x0DC1 -/** Generic Outdoor Sports Activity */ -#define BT_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 -/** Location Display */ -#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 -/** Location and Navigation Display */ -#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 -/** Location Pod */ -#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 -/** Location and Navigation Pod */ -#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 -/** - * @} - */ - /** * @name Defined GAP timers * @{ From 16c192f90d2648e9a1ec8be9d84538593cf0c581 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Thu, 28 Aug 2025 08:34:27 +0200 Subject: [PATCH 0301/3334] [nrf fromtree] bluetooth: host: audio: move audio assigned numbers to dedicated header Move assigned number for audio from audio.h to assigned_numbers.h where all assigned numbers are located. Signed-off-by: Pavel Vasilyev (cherry picked from commit 690314040ee40286cbbb2b6fc030897c1e65cbbc) --- include/zephyr/bluetooth/assigned_numbers.h | 541 ++++++++++++++++++++ include/zephyr/bluetooth/audio/audio.h | 530 +------------------ 2 files changed, 542 insertions(+), 529 deletions(-) diff --git a/include/zephyr/bluetooth/assigned_numbers.h b/include/zephyr/bluetooth/assigned_numbers.h index de978b3cb1de..8cd5fc422c2d 100644 --- a/include/zephyr/bluetooth/assigned_numbers.h +++ b/include/zephyr/bluetooth/assigned_numbers.h @@ -21,6 +21,8 @@ * @{ */ +#include + #ifdef __cplusplus extern "C" { #endif @@ -715,6 +717,545 @@ extern "C" { /** @} */ /* end of @name Flags data type values */ /** @} */ /* end of bt_assigned_numbers_core */ +/** + * @brief Generic Audio Assigned Numbers + * @defgroup bt_assigned_numbers_audio Generic Audio Assigned Numbers + * @ingroup bt_assigned_numbers + * @{ + */ + +/** + * @brief Codec capability types + * + * Used to build and parse codec capabilities as specified in the PAC specification. + * Source is assigned numbers for Generic Audio, bluetooth.com. + */ +enum bt_audio_codec_cap_type { + /** Supported sampling frequencies */ + BT_AUDIO_CODEC_CAP_TYPE_FREQ = 0x01, + + /** Supported frame durations */ + BT_AUDIO_CODEC_CAP_TYPE_DURATION = 0x02, + + /** Supported audio channel counts */ + BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT = 0x03, + + /** Supported octets per codec frame */ + BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN = 0x04, + + /** Supported maximum codec frames per SDU */ + BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT = 0x05, +}; + +/** @brief Supported frequencies bitfield */ +enum bt_audio_codec_cap_freq { + /** 8 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_8KHZ = BIT(0), + + /** 11.025 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_11KHZ = BIT(1), + + /** 16 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_16KHZ = BIT(2), + + /** 22.05 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_22KHZ = BIT(3), + + /** 24 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_24KHZ = BIT(4), + + /** 32 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_32KHZ = BIT(5), + + /** 44.1 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_44KHZ = BIT(6), + + /** 48 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_48KHZ = BIT(7), + + /** 88.2 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_88KHZ = BIT(8), + + /** 96 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_96KHZ = BIT(9), + + /** 176.4 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_176KHZ = BIT(10), + + /** 192 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_192KHZ = BIT(11), + + /** 384 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_384KHZ = BIT(12), + + /** Any frequency capability */ + BT_AUDIO_CODEC_CAP_FREQ_ANY = + (BT_AUDIO_CODEC_CAP_FREQ_8KHZ | BT_AUDIO_CODEC_CAP_FREQ_11KHZ | + BT_AUDIO_CODEC_CAP_FREQ_16KHZ | BT_AUDIO_CODEC_CAP_FREQ_22KHZ | + BT_AUDIO_CODEC_CAP_FREQ_24KHZ | BT_AUDIO_CODEC_CAP_FREQ_32KHZ | + BT_AUDIO_CODEC_CAP_FREQ_44KHZ | BT_AUDIO_CODEC_CAP_FREQ_48KHZ | + BT_AUDIO_CODEC_CAP_FREQ_88KHZ | BT_AUDIO_CODEC_CAP_FREQ_96KHZ | + BT_AUDIO_CODEC_CAP_FREQ_176KHZ | BT_AUDIO_CODEC_CAP_FREQ_192KHZ | + BT_AUDIO_CODEC_CAP_FREQ_384KHZ), +}; + +/** @brief Supported frame durations bitfield */ +enum bt_audio_codec_cap_frame_dur { + /** 7.5 msec frame duration capability */ + BT_AUDIO_CODEC_CAP_DURATION_7_5 = BIT(0), + + /** 10 msec frame duration capability */ + BT_AUDIO_CODEC_CAP_DURATION_10 = BIT(1), + + /** Any frame duration capability */ + BT_AUDIO_CODEC_CAP_DURATION_ANY = + (BT_AUDIO_CODEC_CAP_DURATION_7_5 | BT_AUDIO_CODEC_CAP_DURATION_10), + + /** + * @brief 7.5 msec preferred frame duration capability. + * + * This shall only be set if @ref BT_AUDIO_CODEC_CAP_DURATION_7_5 is also set, and if @ref + * BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 is not set. + */ + BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 = BIT(4), + + /** + * @brief 10 msec preferred frame duration capability + * + * This shall only be set if @ref BT_AUDIO_CODEC_CAP_DURATION_10 is also set, and if @ref + * BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 is not set. + */ + BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 = BIT(5), +}; + +/** Supported audio capabilities channel count bitfield */ +enum bt_audio_codec_cap_chan_count { + /** Supporting 1 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 = BIT(0), + + /** Supporting 2 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 = BIT(1), + + /** Supporting 3 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 = BIT(2), + + /** Supporting 4 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 = BIT(3), + + /** Supporting 5 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 = BIT(4), + + /** Supporting 6 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 = BIT(5), + + /** Supporting 7 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 = BIT(6), + + /** Supporting 8 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_8 = BIT(7), + + /** Supporting all channels */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_ANY = + (BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 | + BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 | + BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 | + BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_8), +}; + +/** Minimum supported channel counts */ +#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN 1 +/** Maximum supported channel counts */ +#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX 8 + +/** The minimum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */ +#define BT_AUDIO_BROADCAST_NAME_LEN_MIN 4 +/** The maximum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */ +#define BT_AUDIO_BROADCAST_NAME_LEN_MAX 128 + +/** + * @brief Codec configuration types + * + * Used to build and parse codec configurations as specified in the ASCS and BAP specifications. + * Source is assigned numbers for Generic Audio, bluetooth.com. + */ +enum bt_audio_codec_cfg_type { + /** Sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ = 0x01, + + /** Frame duration */ + BT_AUDIO_CODEC_CFG_DURATION = 0x02, + + /** Audio channel allocation */ + BT_AUDIO_CODEC_CFG_CHAN_ALLOC = 0x03, + + /** Octets per codec frame */ + BT_AUDIO_CODEC_CFG_FRAME_LEN = 0x04, + + /** Codec frame blocks per SDU */ + BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU = 0x05, +}; + +/** Codec configuration sampling freqency */ +enum bt_audio_codec_cfg_freq { + /** 8 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_8KHZ = 0x01, + + /** 11.025 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_11KHZ = 0x02, + + /** 16 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_16KHZ = 0x03, + + /** 22.05 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_22KHZ = 0x04, + + /** 24 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_24KHZ = 0x05, + + /** 32 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_32KHZ = 0x06, + + /** 44.1 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_44KHZ = 0x07, + + /** 48 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_48KHZ = 0x08, + + /** 88.2 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_88KHZ = 0x09, + + /** 96 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_96KHZ = 0x0a, + + /** 176.4 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_176KHZ = 0x0b, + + /** 192 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_192KHZ = 0x0c, + + /** 384 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_384KHZ = 0x0d, +}; + +/** Codec configuration frame duration */ +enum bt_audio_codec_cfg_frame_dur { + /** 7.5 msec Frame Duration configuration */ + BT_AUDIO_CODEC_CFG_DURATION_7_5 = 0x00, + + /** 10 msec Frame Duration configuration */ + BT_AUDIO_CODEC_CFG_DURATION_10 = 0x01, +}; + +/** + * @brief Audio Context Type for Generic Audio + * + * These values are defined by the Generic Audio Assigned Numbers, bluetooth.com + */ +enum bt_audio_context { + /** No context type */ + BT_AUDIO_CONTEXT_TYPE_NONE = 0, + /** + * Identifies audio where the use case context does not match any other defined value, + * or where the context is unknown or cannot be determined. + */ + BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED = BIT(0), + /** + * Conversation between humans, for example, in telephony or video calls, including + * traditional cellular as well as VoIP and Push-to-Talk + */ + BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL = BIT(1), + /** Media, for example, music playback, radio, podcast or movie soundtrack, or tv audio */ + BT_AUDIO_CONTEXT_TYPE_MEDIA = BIT(2), + /** + * Audio associated with video gaming, for example gaming media; gaming effects; music + * and in-game voice chat between participants; or a mix of all the above + */ + BT_AUDIO_CONTEXT_TYPE_GAME = BIT(3), + /** Instructional audio, for example, in navigation, announcements, or user guidance */ + BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL = BIT(4), + /** Man-machine communication, for example, with voice recognition or virtual assistants */ + BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS = BIT(5), + /** + * Live audio, for example, from a microphone where audio is perceived both through a + * direct acoustic path and through an LE Audio Stream + */ + BT_AUDIO_CONTEXT_TYPE_LIVE = BIT(6), + /** + * Sound effects including keyboard and touch feedback; menu and user interface sounds; + * and other system sounds + */ + BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS = BIT(7), + /** + * Notification and reminder sounds; attention-seeking audio, for example, + * in beeps signaling the arrival of a message + */ + BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS = BIT(8), + /** + * Alerts the user to an incoming call, for example, an incoming telephony or video call, + * including traditional cellular as well as VoIP and Push-to-Talk + */ + BT_AUDIO_CONTEXT_TYPE_RINGTONE = BIT(9), + /** + * Alarms and timers; immediate alerts, for example, in a critical battery alarm, + * timer expiry or alarm clock, toaster, cooker, kettle, microwave, etc. + */ + BT_AUDIO_CONTEXT_TYPE_ALERTS = BIT(10), + /** Emergency alarm Emergency sounds, for example, fire alarms or other urgent alerts */ + BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM = BIT(11), +}; + +/** + * Any known context. + */ +#define BT_AUDIO_CONTEXT_TYPE_ANY (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | \ + BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \ + BT_AUDIO_CONTEXT_TYPE_MEDIA | \ + BT_AUDIO_CONTEXT_TYPE_GAME | \ + BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL | \ + BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS | \ + BT_AUDIO_CONTEXT_TYPE_LIVE | \ + BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS | \ + BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS | \ + BT_AUDIO_CONTEXT_TYPE_RINGTONE | \ + BT_AUDIO_CONTEXT_TYPE_ALERTS | \ + BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM) + +/** + * @brief Parental rating defined by the Generic Audio assigned numbers (bluetooth.com). + * + * The numbering scheme is aligned with Annex F of EN 300 707 v1.2.1 which + * defined parental rating for viewing. + */ +enum bt_audio_parental_rating { + /** No rating */ + BT_AUDIO_PARENTAL_RATING_NO_RATING = 0x00, + /** For all ages */ + BT_AUDIO_PARENTAL_RATING_AGE_ANY = 0x01, + /** Recommended for listeners of age 5 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_5_OR_ABOVE = 0x02, + /** Recommended for listeners of age 6 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_6_OR_ABOVE = 0x03, + /** Recommended for listeners of age 7 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_7_OR_ABOVE = 0x04, + /** Recommended for listeners of age 8 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_8_OR_ABOVE = 0x05, + /** Recommended for listeners of age 9 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_9_OR_ABOVE = 0x06, + /** Recommended for listeners of age 10 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_10_OR_ABOVE = 0x07, + /** Recommended for listeners of age 11 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_11_OR_ABOVE = 0x08, + /** Recommended for listeners of age 12 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_12_OR_ABOVE = 0x09, + /** Recommended for listeners of age 13 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_13_OR_ABOVE = 0x0A, + /** Recommended for listeners of age 14 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_14_OR_ABOVE = 0x0B, + /** Recommended for listeners of age 15 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_15_OR_ABOVE = 0x0C, + /** Recommended for listeners of age 16 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_16_OR_ABOVE = 0x0D, + /** Recommended for listeners of age 17 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_17_OR_ABOVE = 0x0E, + /** Recommended for listeners of age 18 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_18_OR_ABOVE = 0x0F +}; + +/** @brief Audio Active State defined by the Generic Audio assigned numbers (bluetooth.com). */ +enum bt_audio_active_state { + /** No audio data is being transmitted */ + BT_AUDIO_ACTIVE_STATE_DISABLED = 0x00, + /** Audio data is being transmitted */ + BT_AUDIO_ACTIVE_STATE_ENABLED = 0x01, +}; + +/** Assisted Listening Stream defined by the Generic Audio assigned numbers (bluetooth.com). */ +enum bt_audio_assisted_listening_stream { + /** Unspecified audio enhancement */ + BT_AUDIO_ASSISTED_LISTENING_STREAM_UNSPECIFIED = 0x00, +}; + +/** + * @brief Codec metadata type IDs + * + * Metadata types defined by the Generic Audio assigned numbers (bluetooth.com). + */ +enum bt_audio_metadata_type { + /** + * @brief Preferred audio context. + * + * Bitfield of preferred audio contexts. + * + * If 0, the context type is not a preferred use case for this codec + * configuration. + * + * See the BT_AUDIO_CONTEXT_* for valid values. + */ + BT_AUDIO_METADATA_TYPE_PREF_CONTEXT = 0x01, + + /** + * @brief Streaming audio context. + * + * Bitfield of streaming audio contexts. + * + * If 0, the context type is not a preferred use case for this codec + * configuration. + * + * See the BT_AUDIO_CONTEXT_* for valid values. + */ + BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT = 0x02, + + /** UTF-8 encoded title or summary of stream content */ + BT_AUDIO_METADATA_TYPE_PROGRAM_INFO = 0x03, + + /** + * @brief Language + * + * 3 octet lower case language code defined by ISO 639-3 + * Possible values can be found at https://iso639-3.sil.org/code_tables/639/data + */ + BT_AUDIO_METADATA_TYPE_LANG = 0x04, + + /** Array of 8-bit CCID values */ + BT_AUDIO_METADATA_TYPE_CCID_LIST = 0x05, + + /** + * @brief Parental rating + * + * See @ref bt_audio_parental_rating for valid values. + */ + BT_AUDIO_METADATA_TYPE_PARENTAL_RATING = 0x06, + + /** UTF-8 encoded URI for additional Program information */ + BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI = 0x07, + + /** + * @brief Audio active state + * + * See @ref bt_audio_active_state for valid values. + */ + BT_AUDIO_METADATA_TYPE_AUDIO_STATE = 0x08, + + /** Broadcast Audio Immediate Rendering flag */ + BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE = 0x09, + + /** + * @brief Assisted listening stream + * + * See @ref bt_audio_assisted_listening_stream for valid values. + */ + BT_AUDIO_METADATA_TYPE_ASSISTED_LISTENING_STREAM = 0x0A, + + /** UTF-8 encoded Broadcast name */ + BT_AUDIO_METADATA_TYPE_BROADCAST_NAME = 0x0B, + + /** Extended metadata */ + BT_AUDIO_METADATA_TYPE_EXTENDED = 0xFE, + + /** Vendor specific metadata */ + BT_AUDIO_METADATA_TYPE_VENDOR = 0xFF, +}; + +/** + * @brief Location values for BT Audio. + * + * These values are defined by the Generic Audio Assigned Numbers, bluetooth.com + */ +enum bt_audio_location { + /** Mono Audio (no specified Audio Location) */ + BT_AUDIO_LOCATION_MONO_AUDIO = 0, + /** Front Left */ + BT_AUDIO_LOCATION_FRONT_LEFT = BIT(0), + /** Front Right */ + BT_AUDIO_LOCATION_FRONT_RIGHT = BIT(1), + /** Front Center */ + BT_AUDIO_LOCATION_FRONT_CENTER = BIT(2), + /** Low Frequency Effects 1 */ + BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 = BIT(3), + /** Back Left */ + BT_AUDIO_LOCATION_BACK_LEFT = BIT(4), + /** Back Right */ + BT_AUDIO_LOCATION_BACK_RIGHT = BIT(5), + /** Front Left of Center */ + BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER = BIT(6), + /** Front Right of Center */ + BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER = BIT(7), + /** Back Center */ + BT_AUDIO_LOCATION_BACK_CENTER = BIT(8), + /** Low Frequency Effects 2 */ + BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 = BIT(9), + /** Side Left */ + BT_AUDIO_LOCATION_SIDE_LEFT = BIT(10), + /** Side Right */ + BT_AUDIO_LOCATION_SIDE_RIGHT = BIT(11), + /** Top Front Left */ + BT_AUDIO_LOCATION_TOP_FRONT_LEFT = BIT(12), + /** Top Front Right */ + BT_AUDIO_LOCATION_TOP_FRONT_RIGHT = BIT(13), + /** Top Front Center */ + BT_AUDIO_LOCATION_TOP_FRONT_CENTER = BIT(14), + /** Top Center */ + BT_AUDIO_LOCATION_TOP_CENTER = BIT(15), + /** Top Back Left */ + BT_AUDIO_LOCATION_TOP_BACK_LEFT = BIT(16), + /** Top Back Right */ + BT_AUDIO_LOCATION_TOP_BACK_RIGHT = BIT(17), + /** Top Side Left */ + BT_AUDIO_LOCATION_TOP_SIDE_LEFT = BIT(18), + /** Top Side Right */ + BT_AUDIO_LOCATION_TOP_SIDE_RIGHT = BIT(19), + /** Top Back Center */ + BT_AUDIO_LOCATION_TOP_BACK_CENTER = BIT(20), + /** Bottom Front Center */ + BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER = BIT(21), + /** Bottom Front Left */ + BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT = BIT(22), + /** Bottom Front Right */ + BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT = BIT(23), + /** Front Left Wide */ + BT_AUDIO_LOCATION_FRONT_LEFT_WIDE = BIT(24), + /** Front Right Wide */ + BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE = BIT(25), + /** Left Surround */ + BT_AUDIO_LOCATION_LEFT_SURROUND = BIT(26), + /** Right Surround */ + BT_AUDIO_LOCATION_RIGHT_SURROUND = BIT(27), +}; + +/** + * Any known location. + */ +#define BT_AUDIO_LOCATION_ANY (BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT | \ + BT_AUDIO_LOCATION_FRONT_CENTER | \ + BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 | \ + BT_AUDIO_LOCATION_BACK_LEFT | \ + BT_AUDIO_LOCATION_BACK_RIGHT | \ + BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER | \ + BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER | \ + BT_AUDIO_LOCATION_BACK_CENTER | \ + BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 | \ + BT_AUDIO_LOCATION_SIDE_LEFT | \ + BT_AUDIO_LOCATION_SIDE_RIGHT | \ + BT_AUDIO_LOCATION_TOP_FRONT_LEFT | \ + BT_AUDIO_LOCATION_TOP_FRONT_RIGHT | \ + BT_AUDIO_LOCATION_TOP_FRONT_CENTER | \ + BT_AUDIO_LOCATION_TOP_CENTER | \ + BT_AUDIO_LOCATION_TOP_BACK_LEFT | \ + BT_AUDIO_LOCATION_TOP_BACK_RIGHT | \ + BT_AUDIO_LOCATION_TOP_SIDE_LEFT | \ + BT_AUDIO_LOCATION_TOP_SIDE_RIGHT | \ + BT_AUDIO_LOCATION_TOP_BACK_CENTER | \ + BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER | \ + BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT | \ + BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT | \ + BT_AUDIO_LOCATION_FRONT_LEFT_WIDE | \ + BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE | \ + BT_AUDIO_LOCATION_LEFT_SURROUND | \ + BT_AUDIO_LOCATION_RIGHT_SURROUND) + +/** @} */ /* end of bt_assigned_numbers_audio */ + /** * @name Company Identifiers (see Bluetooth Assigned Numbers) * @{ diff --git a/include/zephyr/bluetooth/audio/audio.h b/include/zephyr/bluetooth/audio/audio.h index 230f2735e4d5..87eac9d4a203 100644 --- a/include/zephyr/bluetooth/audio/audio.h +++ b/include/zephyr/bluetooth/audio/audio.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -49,157 +50,10 @@ extern "C" { #define BT_AUDIO_PD_MAX 0xFFFFFFU /** Indicates that the unicast server does not have a preference for any retransmission number */ #define BT_AUDIO_RTN_PREF_NONE 0xFFU -/** The minimum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */ -#define BT_AUDIO_BROADCAST_NAME_LEN_MIN 4 -/** The maximum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */ -#define BT_AUDIO_BROADCAST_NAME_LEN_MAX 128 /** Size of the stream language value, e.g. "eng" */ #define BT_AUDIO_LANG_SIZE 3 -/** - * @brief Codec capability types - * - * Used to build and parse codec capabilities as specified in the PAC specification. - * Source is assigned numbers for Generic Audio, bluetooth.com. - */ -enum bt_audio_codec_cap_type { - /** Supported sampling frequencies */ - BT_AUDIO_CODEC_CAP_TYPE_FREQ = 0x01, - - /** Supported frame durations */ - BT_AUDIO_CODEC_CAP_TYPE_DURATION = 0x02, - - /** Supported audio channel counts */ - BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT = 0x03, - - /** Supported octets per codec frame */ - BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN = 0x04, - - /** Supported maximum codec frames per SDU */ - BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT = 0x05, -}; - -/** @brief Supported frequencies bitfield */ -enum bt_audio_codec_cap_freq { - /** 8 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_8KHZ = BIT(0), - - /** 11.025 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_11KHZ = BIT(1), - - /** 16 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_16KHZ = BIT(2), - - /** 22.05 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_22KHZ = BIT(3), - - /** 24 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_24KHZ = BIT(4), - - /** 32 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_32KHZ = BIT(5), - - /** 44.1 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_44KHZ = BIT(6), - - /** 48 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_48KHZ = BIT(7), - - /** 88.2 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_88KHZ = BIT(8), - - /** 96 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_96KHZ = BIT(9), - - /** 176.4 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_176KHZ = BIT(10), - - /** 192 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_192KHZ = BIT(11), - - /** 384 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_384KHZ = BIT(12), - - /** Any frequency capability */ - BT_AUDIO_CODEC_CAP_FREQ_ANY = - (BT_AUDIO_CODEC_CAP_FREQ_8KHZ | BT_AUDIO_CODEC_CAP_FREQ_11KHZ | - BT_AUDIO_CODEC_CAP_FREQ_16KHZ | BT_AUDIO_CODEC_CAP_FREQ_22KHZ | - BT_AUDIO_CODEC_CAP_FREQ_24KHZ | BT_AUDIO_CODEC_CAP_FREQ_32KHZ | - BT_AUDIO_CODEC_CAP_FREQ_44KHZ | BT_AUDIO_CODEC_CAP_FREQ_48KHZ | - BT_AUDIO_CODEC_CAP_FREQ_88KHZ | BT_AUDIO_CODEC_CAP_FREQ_96KHZ | - BT_AUDIO_CODEC_CAP_FREQ_176KHZ | BT_AUDIO_CODEC_CAP_FREQ_192KHZ | - BT_AUDIO_CODEC_CAP_FREQ_384KHZ), -}; - -/** @brief Supported frame durations bitfield */ -enum bt_audio_codec_cap_frame_dur { - /** 7.5 msec frame duration capability */ - BT_AUDIO_CODEC_CAP_DURATION_7_5 = BIT(0), - - /** 10 msec frame duration capability */ - BT_AUDIO_CODEC_CAP_DURATION_10 = BIT(1), - - /** Any frame duration capability */ - BT_AUDIO_CODEC_CAP_DURATION_ANY = - (BT_AUDIO_CODEC_CAP_DURATION_7_5 | BT_AUDIO_CODEC_CAP_DURATION_10), - - /** - * @brief 7.5 msec preferred frame duration capability. - * - * This shall only be set if @ref BT_AUDIO_CODEC_CAP_DURATION_7_5 is also set, and if @ref - * BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 is not set. - */ - BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 = BIT(4), - - /** - * @brief 10 msec preferred frame duration capability - * - * This shall only be set if @ref BT_AUDIO_CODEC_CAP_DURATION_10 is also set, and if @ref - * BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 is not set. - */ - BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 = BIT(5), -}; - -/** Supported audio capabilities channel count bitfield */ -enum bt_audio_codec_cap_chan_count { - /** Supporting 1 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 = BIT(0), - - /** Supporting 2 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 = BIT(1), - - /** Supporting 3 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 = BIT(2), - - /** Supporting 4 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 = BIT(3), - - /** Supporting 5 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 = BIT(4), - - /** Supporting 6 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 = BIT(5), - - /** Supporting 7 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 = BIT(6), - - /** Supporting 8 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_8 = BIT(7), - - /** Supporting all channels */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_ANY = - (BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 | - BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 | - BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 | - BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_8), -}; - -/** Minimum supported channel counts */ -#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN 1 -/** Maximum supported channel counts */ -#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX 8 - /** * @brief Channel count support capability * @@ -221,290 +75,6 @@ struct bt_audio_codec_octets_per_codec_frame { uint16_t max; }; -/** - * @brief Codec configuration types - * - * Used to build and parse codec configurations as specified in the ASCS and BAP specifications. - * Source is assigned numbers for Generic Audio, bluetooth.com. - */ -enum bt_audio_codec_cfg_type { - /** Sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ = 0x01, - - /** Frame duration */ - BT_AUDIO_CODEC_CFG_DURATION = 0x02, - - /** Audio channel allocation */ - BT_AUDIO_CODEC_CFG_CHAN_ALLOC = 0x03, - - /** Octets per codec frame */ - BT_AUDIO_CODEC_CFG_FRAME_LEN = 0x04, - - /** Codec frame blocks per SDU */ - BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU = 0x05, -}; - -/** Codec configuration sampling freqency */ -enum bt_audio_codec_cfg_freq { - /** 8 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_8KHZ = 0x01, - - /** 11.025 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_11KHZ = 0x02, - - /** 16 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_16KHZ = 0x03, - - /** 22.05 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_22KHZ = 0x04, - - /** 24 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_24KHZ = 0x05, - - /** 32 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_32KHZ = 0x06, - - /** 44.1 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_44KHZ = 0x07, - - /** 48 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_48KHZ = 0x08, - - /** 88.2 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_88KHZ = 0x09, - - /** 96 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_96KHZ = 0x0a, - - /** 176.4 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_176KHZ = 0x0b, - - /** 192 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_192KHZ = 0x0c, - - /** 384 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_384KHZ = 0x0d, -}; - -/** Codec configuration frame duration */ -enum bt_audio_codec_cfg_frame_dur { - /** 7.5 msec Frame Duration configuration */ - BT_AUDIO_CODEC_CFG_DURATION_7_5 = 0x00, - - /** 10 msec Frame Duration configuration */ - BT_AUDIO_CODEC_CFG_DURATION_10 = 0x01, -}; - -/** - * @brief Audio Context Type for Generic Audio - * - * These values are defined by the Generic Audio Assigned Numbers, bluetooth.com - */ -enum bt_audio_context { - /** No context type */ - BT_AUDIO_CONTEXT_TYPE_NONE = 0, - /** - * Identifies audio where the use case context does not match any other defined value, - * or where the context is unknown or cannot be determined. - */ - BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED = BIT(0), - /** - * Conversation between humans, for example, in telephony or video calls, including - * traditional cellular as well as VoIP and Push-to-Talk - */ - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL = BIT(1), - /** Media, for example, music playback, radio, podcast or movie soundtrack, or tv audio */ - BT_AUDIO_CONTEXT_TYPE_MEDIA = BIT(2), - /** - * Audio associated with video gaming, for example gaming media; gaming effects; music - * and in-game voice chat between participants; or a mix of all the above - */ - BT_AUDIO_CONTEXT_TYPE_GAME = BIT(3), - /** Instructional audio, for example, in navigation, announcements, or user guidance */ - BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL = BIT(4), - /** Man-machine communication, for example, with voice recognition or virtual assistants */ - BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS = BIT(5), - /** - * Live audio, for example, from a microphone where audio is perceived both through a - * direct acoustic path and through an LE Audio Stream - */ - BT_AUDIO_CONTEXT_TYPE_LIVE = BIT(6), - /** - * Sound effects including keyboard and touch feedback; menu and user interface sounds; - * and other system sounds - */ - BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS = BIT(7), - /** - * Notification and reminder sounds; attention-seeking audio, for example, - * in beeps signaling the arrival of a message - */ - BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS = BIT(8), - /** - * Alerts the user to an incoming call, for example, an incoming telephony or video call, - * including traditional cellular as well as VoIP and Push-to-Talk - */ - BT_AUDIO_CONTEXT_TYPE_RINGTONE = BIT(9), - /** - * Alarms and timers; immediate alerts, for example, in a critical battery alarm, - * timer expiry or alarm clock, toaster, cooker, kettle, microwave, etc. - */ - BT_AUDIO_CONTEXT_TYPE_ALERTS = BIT(10), - /** Emergency alarm Emergency sounds, for example, fire alarms or other urgent alerts */ - BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM = BIT(11), -}; - -/** - * Any known context. - */ -#define BT_AUDIO_CONTEXT_TYPE_ANY (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | \ - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \ - BT_AUDIO_CONTEXT_TYPE_MEDIA | \ - BT_AUDIO_CONTEXT_TYPE_GAME | \ - BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL | \ - BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS | \ - BT_AUDIO_CONTEXT_TYPE_LIVE | \ - BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS | \ - BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS | \ - BT_AUDIO_CONTEXT_TYPE_RINGTONE | \ - BT_AUDIO_CONTEXT_TYPE_ALERTS | \ - BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM) - -/** - * @brief Parental rating defined by the Generic Audio assigned numbers (bluetooth.com). - * - * The numbering scheme is aligned with Annex F of EN 300 707 v1.2.1 which - * defined parental rating for viewing. - */ -enum bt_audio_parental_rating { - /** No rating */ - BT_AUDIO_PARENTAL_RATING_NO_RATING = 0x00, - /** For all ages */ - BT_AUDIO_PARENTAL_RATING_AGE_ANY = 0x01, - /** Recommended for listeners of age 5 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_5_OR_ABOVE = 0x02, - /** Recommended for listeners of age 6 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_6_OR_ABOVE = 0x03, - /** Recommended for listeners of age 7 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_7_OR_ABOVE = 0x04, - /** Recommended for listeners of age 8 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_8_OR_ABOVE = 0x05, - /** Recommended for listeners of age 9 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_9_OR_ABOVE = 0x06, - /** Recommended for listeners of age 10 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_10_OR_ABOVE = 0x07, - /** Recommended for listeners of age 11 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_11_OR_ABOVE = 0x08, - /** Recommended for listeners of age 12 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_12_OR_ABOVE = 0x09, - /** Recommended for listeners of age 13 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_13_OR_ABOVE = 0x0A, - /** Recommended for listeners of age 14 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_14_OR_ABOVE = 0x0B, - /** Recommended for listeners of age 15 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_15_OR_ABOVE = 0x0C, - /** Recommended for listeners of age 16 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_16_OR_ABOVE = 0x0D, - /** Recommended for listeners of age 17 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_17_OR_ABOVE = 0x0E, - /** Recommended for listeners of age 18 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_18_OR_ABOVE = 0x0F -}; - -/** @brief Audio Active State defined by the Generic Audio assigned numbers (bluetooth.com). */ -enum bt_audio_active_state { - /** No audio data is being transmitted */ - BT_AUDIO_ACTIVE_STATE_DISABLED = 0x00, - /** Audio data is being transmitted */ - BT_AUDIO_ACTIVE_STATE_ENABLED = 0x01, -}; - -/** Assisted Listening Stream defined by the Generic Audio assigned numbers (bluetooth.com). */ -enum bt_audio_assisted_listening_stream { - /** Unspecified audio enhancement */ - BT_AUDIO_ASSISTED_LISTENING_STREAM_UNSPECIFIED = 0x00, -}; - -/** - * @brief Codec metadata type IDs - * - * Metadata types defined by the Generic Audio assigned numbers (bluetooth.com). - */ -enum bt_audio_metadata_type { - /** - * @brief Preferred audio context. - * - * Bitfield of preferred audio contexts. - * - * If 0, the context type is not a preferred use case for this codec - * configuration. - * - * See the BT_AUDIO_CONTEXT_* for valid values. - */ - BT_AUDIO_METADATA_TYPE_PREF_CONTEXT = 0x01, - - /** - * @brief Streaming audio context. - * - * Bitfield of streaming audio contexts. - * - * If 0, the context type is not a preferred use case for this codec - * configuration. - * - * See the BT_AUDIO_CONTEXT_* for valid values. - */ - BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT = 0x02, - - /** UTF-8 encoded title or summary of stream content */ - BT_AUDIO_METADATA_TYPE_PROGRAM_INFO = 0x03, - - /** - * @brief Language - * - * 3 octet lower case language code defined by ISO 639-3 - * Possible values can be found at https://iso639-3.sil.org/code_tables/639/data - */ - BT_AUDIO_METADATA_TYPE_LANG = 0x04, - - /** Array of 8-bit CCID values */ - BT_AUDIO_METADATA_TYPE_CCID_LIST = 0x05, - - /** - * @brief Parental rating - * - * See @ref bt_audio_parental_rating for valid values. - */ - BT_AUDIO_METADATA_TYPE_PARENTAL_RATING = 0x06, - - /** UTF-8 encoded URI for additional Program information */ - BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI = 0x07, - - /** - * @brief Audio active state - * - * See @ref bt_audio_active_state for valid values. - */ - BT_AUDIO_METADATA_TYPE_AUDIO_STATE = 0x08, - - /** Broadcast Audio Immediate Rendering flag */ - BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE = 0x09, - - /** - * @brief Assisted listening stream - * - * See @ref bt_audio_assisted_listening_stream for valid values. - */ - BT_AUDIO_METADATA_TYPE_ASSISTED_LISTENING_STREAM = 0x0A, - - /** UTF-8 encoded Broadcast name */ - BT_AUDIO_METADATA_TYPE_BROADCAST_NAME = 0x0B, - - /** Extended metadata */ - BT_AUDIO_METADATA_TYPE_EXTENDED = 0xFE, - - /** Vendor specific metadata */ - BT_AUDIO_METADATA_TYPE_VENDOR = 0xFF, -}; - /** * @brief Helper to check whether metadata type is known by the stack. * @@ -586,104 +156,6 @@ enum bt_audio_metadata_type { .meta = _meta, \ }) -/** - * @brief Location values for BT Audio. - * - * These values are defined by the Generic Audio Assigned Numbers, bluetooth.com - */ -enum bt_audio_location { - /** Mono Audio (no specified Audio Location) */ - BT_AUDIO_LOCATION_MONO_AUDIO = 0, - /** Front Left */ - BT_AUDIO_LOCATION_FRONT_LEFT = BIT(0), - /** Front Right */ - BT_AUDIO_LOCATION_FRONT_RIGHT = BIT(1), - /** Front Center */ - BT_AUDIO_LOCATION_FRONT_CENTER = BIT(2), - /** Low Frequency Effects 1 */ - BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 = BIT(3), - /** Back Left */ - BT_AUDIO_LOCATION_BACK_LEFT = BIT(4), - /** Back Right */ - BT_AUDIO_LOCATION_BACK_RIGHT = BIT(5), - /** Front Left of Center */ - BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER = BIT(6), - /** Front Right of Center */ - BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER = BIT(7), - /** Back Center */ - BT_AUDIO_LOCATION_BACK_CENTER = BIT(8), - /** Low Frequency Effects 2 */ - BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 = BIT(9), - /** Side Left */ - BT_AUDIO_LOCATION_SIDE_LEFT = BIT(10), - /** Side Right */ - BT_AUDIO_LOCATION_SIDE_RIGHT = BIT(11), - /** Top Front Left */ - BT_AUDIO_LOCATION_TOP_FRONT_LEFT = BIT(12), - /** Top Front Right */ - BT_AUDIO_LOCATION_TOP_FRONT_RIGHT = BIT(13), - /** Top Front Center */ - BT_AUDIO_LOCATION_TOP_FRONT_CENTER = BIT(14), - /** Top Center */ - BT_AUDIO_LOCATION_TOP_CENTER = BIT(15), - /** Top Back Left */ - BT_AUDIO_LOCATION_TOP_BACK_LEFT = BIT(16), - /** Top Back Right */ - BT_AUDIO_LOCATION_TOP_BACK_RIGHT = BIT(17), - /** Top Side Left */ - BT_AUDIO_LOCATION_TOP_SIDE_LEFT = BIT(18), - /** Top Side Right */ - BT_AUDIO_LOCATION_TOP_SIDE_RIGHT = BIT(19), - /** Top Back Center */ - BT_AUDIO_LOCATION_TOP_BACK_CENTER = BIT(20), - /** Bottom Front Center */ - BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER = BIT(21), - /** Bottom Front Left */ - BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT = BIT(22), - /** Bottom Front Right */ - BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT = BIT(23), - /** Front Left Wide */ - BT_AUDIO_LOCATION_FRONT_LEFT_WIDE = BIT(24), - /** Front Right Wide */ - BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE = BIT(25), - /** Left Surround */ - BT_AUDIO_LOCATION_LEFT_SURROUND = BIT(26), - /** Right Surround */ - BT_AUDIO_LOCATION_RIGHT_SURROUND = BIT(27), -}; - -/** - * Any known location. - */ -#define BT_AUDIO_LOCATION_ANY (BT_AUDIO_LOCATION_FRONT_LEFT | \ - BT_AUDIO_LOCATION_FRONT_RIGHT | \ - BT_AUDIO_LOCATION_FRONT_CENTER | \ - BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 | \ - BT_AUDIO_LOCATION_BACK_LEFT | \ - BT_AUDIO_LOCATION_BACK_RIGHT | \ - BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER | \ - BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER | \ - BT_AUDIO_LOCATION_BACK_CENTER | \ - BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 | \ - BT_AUDIO_LOCATION_SIDE_LEFT | \ - BT_AUDIO_LOCATION_SIDE_RIGHT | \ - BT_AUDIO_LOCATION_TOP_FRONT_LEFT | \ - BT_AUDIO_LOCATION_TOP_FRONT_RIGHT | \ - BT_AUDIO_LOCATION_TOP_FRONT_CENTER | \ - BT_AUDIO_LOCATION_TOP_CENTER | \ - BT_AUDIO_LOCATION_TOP_BACK_LEFT | \ - BT_AUDIO_LOCATION_TOP_BACK_RIGHT | \ - BT_AUDIO_LOCATION_TOP_SIDE_LEFT | \ - BT_AUDIO_LOCATION_TOP_SIDE_RIGHT | \ - BT_AUDIO_LOCATION_TOP_BACK_CENTER | \ - BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER | \ - BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT | \ - BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT | \ - BT_AUDIO_LOCATION_FRONT_LEFT_WIDE | \ - BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE | \ - BT_AUDIO_LOCATION_LEFT_SURROUND | \ - BT_AUDIO_LOCATION_RIGHT_SURROUND) - /** @brief Codec capability structure. */ struct bt_audio_codec_cap { /** Data path ID From 7e0d10c24a47fdb8bad78be4b10fa1d6266cb826 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Thu, 28 Aug 2025 11:42:39 +0200 Subject: [PATCH 0302/3334] [nrf fromtree] bluetooth: mesh: move mesh assigned numbers to dedicated header Move assigned number for mesh from mesh.h to assigned_numbers.h where all assigned numbers are located. Signed-off-by: Pavel Vasilyev (cherry picked from commit e88695add2acaaab24a8f518071846dadd5dba67) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/assigned_numbers.h | 197 ++++++++++++++++++++ include/zephyr/bluetooth/mesh/access.h | 189 +------------------ 2 files changed, 198 insertions(+), 188 deletions(-) diff --git a/include/zephyr/bluetooth/assigned_numbers.h b/include/zephyr/bluetooth/assigned_numbers.h index 8cd5fc422c2d..44c69d16a227 100644 --- a/include/zephyr/bluetooth/assigned_numbers.h +++ b/include/zephyr/bluetooth/assigned_numbers.h @@ -717,6 +717,203 @@ extern "C" { /** @} */ /* end of @name Flags data type values */ /** @} */ /* end of bt_assigned_numbers_core */ +/** + * @brief Bluetooth Mesh Assigned Numbers + * @defgroup bt_assigned_numbers_mesh Bluetooth Mesh Assigned Numbers + * @ingroup bt_assigned_numbers + * @{ + */ + +/** + * @name Foundation Models + * @{ + */ +/** Configuration Server */ +#define BT_MESH_MODEL_ID_CFG_SRV 0x0000 +/** Configuration Client */ +#define BT_MESH_MODEL_ID_CFG_CLI 0x0001 +/** Health Server */ +#define BT_MESH_MODEL_ID_HEALTH_SRV 0x0002 +/** Health Client */ +#define BT_MESH_MODEL_ID_HEALTH_CLI 0x0003 +/** Remote Provisioning Server */ +#define BT_MESH_MODEL_ID_REMOTE_PROV_SRV 0x0004 +/** Remote Provisioning Client */ +#define BT_MESH_MODEL_ID_REMOTE_PROV_CLI 0x0005 +/** Bridge Configuration Sever */ +#define BT_MESH_MODEL_ID_BRG_CFG_SRV 0x0008 +/** Bridge Configuration Client */ +#define BT_MESH_MODEL_ID_BRG_CFG_CLI 0x0009 +/** Private Beacon Server */ +#define BT_MESH_MODEL_ID_PRIV_BEACON_SRV 0x000a +/** Private Beacon Client */ +#define BT_MESH_MODEL_ID_PRIV_BEACON_CLI 0x000b +/** SAR Configuration Server */ +#define BT_MESH_MODEL_ID_SAR_CFG_SRV 0x000e +/** SAR Configuration Client */ +#define BT_MESH_MODEL_ID_SAR_CFG_CLI 0x000f +/** Opcodes Aggregator Server */ +#define BT_MESH_MODEL_ID_OP_AGG_SRV 0x0010 +/** Opcodes Aggregator Client */ +#define BT_MESH_MODEL_ID_OP_AGG_CLI 0x0011 +/** Large Composition Data Server */ +#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_SRV 0x0012 +/** Large Composition Data Client */ +#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_CLI 0x0013 +/** Solicitation PDU RPL Configuration Client */ +#define BT_MESH_MODEL_ID_SOL_PDU_RPL_SRV 0x0014 +/** Solicitation PDU RPL Configuration Server */ +#define BT_MESH_MODEL_ID_SOL_PDU_RPL_CLI 0x0015 +/** Private Proxy Server */ +#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_SRV 0x000c +/** Private Proxy Client */ +#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_CLI 0x000d +/** + * @} + */ + +/** + * @name Models from the Mesh Model Specification + * @{ + */ +/** Generic OnOff Server */ +#define BT_MESH_MODEL_ID_GEN_ONOFF_SRV 0x1000 +/** Generic OnOff Client */ +#define BT_MESH_MODEL_ID_GEN_ONOFF_CLI 0x1001 +/** Generic Level Server */ +#define BT_MESH_MODEL_ID_GEN_LEVEL_SRV 0x1002 +/** Generic Level Client */ +#define BT_MESH_MODEL_ID_GEN_LEVEL_CLI 0x1003 +/** Generic Default Transition Time Server */ +#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV 0x1004 +/** Generic Default Transition Time Client */ +#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_CLI 0x1005 +/** Generic Power OnOff Server */ +#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV 0x1006 +/** Generic Power OnOff Setup Server */ +#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV 0x1007 +/** Generic Power OnOff Client */ +#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI 0x1008 +/** Generic Power Level Server */ +#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV 0x1009 +/** Generic Power Level Setup Server */ +#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV 0x100a +/** Generic Power Level Client */ +#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI 0x100b +/** Generic Battery Server */ +#define BT_MESH_MODEL_ID_GEN_BATTERY_SRV 0x100c +/** Generic Battery Client */ +#define BT_MESH_MODEL_ID_GEN_BATTERY_CLI 0x100d +/** Generic Location Server */ +#define BT_MESH_MODEL_ID_GEN_LOCATION_SRV 0x100e +/** Generic Location Setup Server */ +#define BT_MESH_MODEL_ID_GEN_LOCATION_SETUPSRV 0x100f +/** Generic Location Client */ +#define BT_MESH_MODEL_ID_GEN_LOCATION_CLI 0x1010 +/** Generic Admin Property Server */ +#define BT_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV 0x1011 +/** Generic Manufacturer Property Server */ +#define BT_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV 0x1012 +/** Generic User Property Server */ +#define BT_MESH_MODEL_ID_GEN_USER_PROP_SRV 0x1013 +/** Generic Client Property Server */ +#define BT_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV 0x1014 +/** Generic Property Client */ +#define BT_MESH_MODEL_ID_GEN_PROP_CLI 0x1015 +/** Sensor Server */ +#define BT_MESH_MODEL_ID_SENSOR_SRV 0x1100 +/** Sensor Setup Server */ +#define BT_MESH_MODEL_ID_SENSOR_SETUP_SRV 0x1101 +/** Sensor Client */ +#define BT_MESH_MODEL_ID_SENSOR_CLI 0x1102 +/** Time Server */ +#define BT_MESH_MODEL_ID_TIME_SRV 0x1200 +/** Time Setup Server */ +#define BT_MESH_MODEL_ID_TIME_SETUP_SRV 0x1201 +/** Time Client */ +#define BT_MESH_MODEL_ID_TIME_CLI 0x1202 +/** Scene Server */ +#define BT_MESH_MODEL_ID_SCENE_SRV 0x1203 +/** Scene Setup Server */ +#define BT_MESH_MODEL_ID_SCENE_SETUP_SRV 0x1204 +/** Scene Client */ +#define BT_MESH_MODEL_ID_SCENE_CLI 0x1205 +/** Scheduler Server */ +#define BT_MESH_MODEL_ID_SCHEDULER_SRV 0x1206 +/** Scheduler Setup Server */ +#define BT_MESH_MODEL_ID_SCHEDULER_SETUP_SRV 0x1207 +/** Scheduler Client */ +#define BT_MESH_MODEL_ID_SCHEDULER_CLI 0x1208 +/** Light Lightness Server */ +#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV 0x1300 +/** Light Lightness Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV 0x1301 +/** Light Lightness Client */ +#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI 0x1302 +/** Light CTL Server */ +#define BT_MESH_MODEL_ID_LIGHT_CTL_SRV 0x1303 +/** Light CTL Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV 0x1304 +/** Light CTL Client */ +#define BT_MESH_MODEL_ID_LIGHT_CTL_CLI 0x1305 +/** Light CTL Temperature Server */ +#define BT_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV 0x1306 +/** Light HSL Server */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_SRV 0x1307 +/** Light HSL Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV 0x1308 +/** Light HSL Client */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_CLI 0x1309 +/** Light HSL Hue Server */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV 0x130a +/** Light HSL Saturation Server */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV 0x130b +/** Light xyL Server */ +#define BT_MESH_MODEL_ID_LIGHT_XYL_SRV 0x130c +/** Light xyL Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV 0x130d +/** Light xyL Client */ +#define BT_MESH_MODEL_ID_LIGHT_XYL_CLI 0x130e +/** Light LC Server */ +#define BT_MESH_MODEL_ID_LIGHT_LC_SRV 0x130f +/** Light LC Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_LC_SETUPSRV 0x1310 +/** Light LC Client */ +#define BT_MESH_MODEL_ID_LIGHT_LC_CLI 0x1311 +/** + * @} + */ + +/** + * @name Models from the Mesh Binary Large Object Transfer Model Specification + * @{ + */ +/** BLOB Transfer Server */ +#define BT_MESH_MODEL_ID_BLOB_SRV 0x1400 +/** BLOB Transfer Client */ +#define BT_MESH_MODEL_ID_BLOB_CLI 0x1401 +/** + * @} + */ + +/** + * @name Models from the Mesh Device Firmware Update Model Specification + * @{ + */ +/** Firmware Update Server */ +#define BT_MESH_MODEL_ID_DFU_SRV 0x1402 +/** Firmware Update Client */ +#define BT_MESH_MODEL_ID_DFU_CLI 0x1403 +/** Firmware Distribution Server */ +#define BT_MESH_MODEL_ID_DFD_SRV 0x1404 +/** Firmware Distribution Client */ +#define BT_MESH_MODEL_ID_DFD_CLI 0x1405 +/** + * @} + */ + +/** @} */ /* end of bt_assigned_numbers_mesh */ + /** * @brief Generic Audio Assigned Numbers * @defgroup bt_assigned_numbers_audio Generic Audio Assigned Numbers diff --git a/include/zephyr/bluetooth/mesh/access.h b/include/zephyr/bluetooth/mesh/access.h index 71aa89db0ef3..06ae4f6e9f6f 100644 --- a/include/zephyr/bluetooth/mesh/access.h +++ b/include/zephyr/bluetooth/mesh/access.h @@ -12,6 +12,7 @@ #include #include +#include #include /* Internal macros used to initialize array members */ @@ -171,194 +172,6 @@ struct bt_mesh_elem { const struct bt_mesh_model * const vnd_models; }; -/** - * @name Foundation Models - * @{ - */ -/** Configuration Server */ -#define BT_MESH_MODEL_ID_CFG_SRV 0x0000 -/** Configuration Client */ -#define BT_MESH_MODEL_ID_CFG_CLI 0x0001 -/** Health Server */ -#define BT_MESH_MODEL_ID_HEALTH_SRV 0x0002 -/** Health Client */ -#define BT_MESH_MODEL_ID_HEALTH_CLI 0x0003 -/** Remote Provisioning Server */ -#define BT_MESH_MODEL_ID_REMOTE_PROV_SRV 0x0004 -/** Remote Provisioning Client */ -#define BT_MESH_MODEL_ID_REMOTE_PROV_CLI 0x0005 -/** Bridge Configuration Sever */ -#define BT_MESH_MODEL_ID_BRG_CFG_SRV 0x0008 -/** Bridge Configuration Client */ -#define BT_MESH_MODEL_ID_BRG_CFG_CLI 0x0009 -/** Private Beacon Server */ -#define BT_MESH_MODEL_ID_PRIV_BEACON_SRV 0x000a -/** Private Beacon Client */ -#define BT_MESH_MODEL_ID_PRIV_BEACON_CLI 0x000b -/** SAR Configuration Server */ -#define BT_MESH_MODEL_ID_SAR_CFG_SRV 0x000e -/** SAR Configuration Client */ -#define BT_MESH_MODEL_ID_SAR_CFG_CLI 0x000f -/** Opcodes Aggregator Server */ -#define BT_MESH_MODEL_ID_OP_AGG_SRV 0x0010 -/** Opcodes Aggregator Client */ -#define BT_MESH_MODEL_ID_OP_AGG_CLI 0x0011 -/** Large Composition Data Server */ -#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_SRV 0x0012 -/** Large Composition Data Client */ -#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_CLI 0x0013 -/** Solicitation PDU RPL Configuration Client */ -#define BT_MESH_MODEL_ID_SOL_PDU_RPL_SRV 0x0014 -/** Solicitation PDU RPL Configuration Server */ -#define BT_MESH_MODEL_ID_SOL_PDU_RPL_CLI 0x0015 -/** Private Proxy Server */ -#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_SRV 0x000c -/** Private Proxy Client */ -#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_CLI 0x000d -/** - * @} - */ - -/** - * @name Models from the Mesh Model Specification - * @{ - */ -/** Generic OnOff Server */ -#define BT_MESH_MODEL_ID_GEN_ONOFF_SRV 0x1000 -/** Generic OnOff Client */ -#define BT_MESH_MODEL_ID_GEN_ONOFF_CLI 0x1001 -/** Generic Level Server */ -#define BT_MESH_MODEL_ID_GEN_LEVEL_SRV 0x1002 -/** Generic Level Client */ -#define BT_MESH_MODEL_ID_GEN_LEVEL_CLI 0x1003 -/** Generic Default Transition Time Server */ -#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV 0x1004 -/** Generic Default Transition Time Client */ -#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_CLI 0x1005 -/** Generic Power OnOff Server */ -#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV 0x1006 -/** Generic Power OnOff Setup Server */ -#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV 0x1007 -/** Generic Power OnOff Client */ -#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI 0x1008 -/** Generic Power Level Server */ -#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV 0x1009 -/** Generic Power Level Setup Server */ -#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV 0x100a -/** Generic Power Level Client */ -#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI 0x100b -/** Generic Battery Server */ -#define BT_MESH_MODEL_ID_GEN_BATTERY_SRV 0x100c -/** Generic Battery Client */ -#define BT_MESH_MODEL_ID_GEN_BATTERY_CLI 0x100d -/** Generic Location Server */ -#define BT_MESH_MODEL_ID_GEN_LOCATION_SRV 0x100e -/** Generic Location Setup Server */ -#define BT_MESH_MODEL_ID_GEN_LOCATION_SETUPSRV 0x100f -/** Generic Location Client */ -#define BT_MESH_MODEL_ID_GEN_LOCATION_CLI 0x1010 -/** Generic Admin Property Server */ -#define BT_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV 0x1011 -/** Generic Manufacturer Property Server */ -#define BT_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV 0x1012 -/** Generic User Property Server */ -#define BT_MESH_MODEL_ID_GEN_USER_PROP_SRV 0x1013 -/** Generic Client Property Server */ -#define BT_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV 0x1014 -/** Generic Property Client */ -#define BT_MESH_MODEL_ID_GEN_PROP_CLI 0x1015 -/** Sensor Server */ -#define BT_MESH_MODEL_ID_SENSOR_SRV 0x1100 -/** Sensor Setup Server */ -#define BT_MESH_MODEL_ID_SENSOR_SETUP_SRV 0x1101 -/** Sensor Client */ -#define BT_MESH_MODEL_ID_SENSOR_CLI 0x1102 -/** Time Server */ -#define BT_MESH_MODEL_ID_TIME_SRV 0x1200 -/** Time Setup Server */ -#define BT_MESH_MODEL_ID_TIME_SETUP_SRV 0x1201 -/** Time Client */ -#define BT_MESH_MODEL_ID_TIME_CLI 0x1202 -/** Scene Server */ -#define BT_MESH_MODEL_ID_SCENE_SRV 0x1203 -/** Scene Setup Server */ -#define BT_MESH_MODEL_ID_SCENE_SETUP_SRV 0x1204 -/** Scene Client */ -#define BT_MESH_MODEL_ID_SCENE_CLI 0x1205 -/** Scheduler Server */ -#define BT_MESH_MODEL_ID_SCHEDULER_SRV 0x1206 -/** Scheduler Setup Server */ -#define BT_MESH_MODEL_ID_SCHEDULER_SETUP_SRV 0x1207 -/** Scheduler Client */ -#define BT_MESH_MODEL_ID_SCHEDULER_CLI 0x1208 -/** Light Lightness Server */ -#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV 0x1300 -/** Light Lightness Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV 0x1301 -/** Light Lightness Client */ -#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI 0x1302 -/** Light CTL Server */ -#define BT_MESH_MODEL_ID_LIGHT_CTL_SRV 0x1303 -/** Light CTL Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV 0x1304 -/** Light CTL Client */ -#define BT_MESH_MODEL_ID_LIGHT_CTL_CLI 0x1305 -/** Light CTL Temperature Server */ -#define BT_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV 0x1306 -/** Light HSL Server */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_SRV 0x1307 -/** Light HSL Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV 0x1308 -/** Light HSL Client */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_CLI 0x1309 -/** Light HSL Hue Server */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV 0x130a -/** Light HSL Saturation Server */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV 0x130b -/** Light xyL Server */ -#define BT_MESH_MODEL_ID_LIGHT_XYL_SRV 0x130c -/** Light xyL Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV 0x130d -/** Light xyL Client */ -#define BT_MESH_MODEL_ID_LIGHT_XYL_CLI 0x130e -/** Light LC Server */ -#define BT_MESH_MODEL_ID_LIGHT_LC_SRV 0x130f -/** Light LC Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_LC_SETUPSRV 0x1310 -/** Light LC Client */ -#define BT_MESH_MODEL_ID_LIGHT_LC_CLI 0x1311 -/** - * @} - */ - -/** - * @name Models from the Mesh Binary Large Object Transfer Model Specification - * @{ - */ -/** BLOB Transfer Server */ -#define BT_MESH_MODEL_ID_BLOB_SRV 0x1400 -/** BLOB Transfer Client */ -#define BT_MESH_MODEL_ID_BLOB_CLI 0x1401 -/** - * @} - */ - -/** - * @name Models from the Mesh Device Firmware Update Model Specification - * @{ - */ -/** Firmware Update Server */ -#define BT_MESH_MODEL_ID_DFU_SRV 0x1402 -/** Firmware Update Client */ -#define BT_MESH_MODEL_ID_DFU_CLI 0x1403 -/** Firmware Distribution Server */ -#define BT_MESH_MODEL_ID_DFD_SRV 0x1404 -/** Firmware Distribution Client */ -#define BT_MESH_MODEL_ID_DFD_CLI 0x1405 -/** - * @} - */ - /** Model opcode handler. */ struct bt_mesh_model_op { /** OpCode encoded using the BT_MESH_MODEL_OP_* macros */ From 2f7b709ba93104c8f2aef14e3db13f4ef2e47268 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 16 Sep 2025 14:06:32 +0200 Subject: [PATCH 0303/3334] [nrf fromtree] bluetooth: host: move bt_gatt_authorization_cb_register to gatt.c This function logically belongs to gatt.c as it is GATT API. Signed-off-by: Pavel Vasilyev (cherry picked from commit 52862dc658ac257fe0af586f81dac5b379433bea) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/att.c | 63 +++------------------------ subsys/bluetooth/host/gatt.c | 51 ++++++++++++++++++++++ subsys/bluetooth/host/gatt_internal.h | 3 ++ 3 files changed, 59 insertions(+), 58 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 82d82526b5b0..e9e0add6fbfa 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -143,11 +143,6 @@ static uint16_t bt_att_mtu(struct bt_att_chan *chan) return MIN(chan->chan.rx.mtu, chan->chan.tx.mtu); } -/* Descriptor of application-specific authorization callbacks that are used - * with the CONFIG_BT_GATT_AUTHORIZATION_CUSTOM Kconfig enabled. - */ -static const struct bt_gatt_authorization_cb *authorization_cb; - /* ATT connection specific data */ struct bt_att { struct bt_conn *conn; @@ -1350,20 +1345,6 @@ struct read_type_data { typedef bool (*attr_read_cb)(struct net_buf *buf, ssize_t read, void *user_data); -static bool attr_read_authorize(struct bt_conn *conn, - const struct bt_gatt_attr *attr) -{ - if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { - return true; - } - - if (!authorization_cb || !authorization_cb->read_authorize) { - return true; - } - - return authorization_cb->read_authorize(conn, attr); -} - static bool attr_read_type_cb(struct net_buf *frag, ssize_t read, void *user_data) { @@ -1474,7 +1455,7 @@ static uint8_t read_type_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!attr_read_authorize(conn, attr)) { + if (!bt_gatt_attr_read_authorize(conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -1630,7 +1611,7 @@ static uint8_t read_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!attr_read_authorize(conn, attr)) { + if (!bt_gatt_attr_read_authorize(conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -1801,7 +1782,7 @@ static uint8_t read_vl_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!attr_read_authorize(conn, attr)) { + if (!bt_gatt_attr_read_authorize(conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -2050,20 +2031,6 @@ struct write_data { uint8_t err; }; -static bool attr_write_authorize(struct bt_conn *conn, - const struct bt_gatt_attr *attr) -{ - if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { - return true; - } - - if (!authorization_cb || !authorization_cb->write_authorize) { - return true; - } - - return authorization_cb->write_authorize(conn, attr); -} - static uint8_t write_cb(const struct bt_gatt_attr *attr, uint16_t handle, void *user_data) { @@ -2081,7 +2048,7 @@ static uint8_t write_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!attr_write_authorize(data->conn, attr)) { + if (!bt_gatt_attr_write_authorize(data->conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -2200,7 +2167,7 @@ static uint8_t prep_write_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!attr_write_authorize(data->conn, attr)) { + if (!bt_gatt_attr_write_authorize(data->conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -4169,23 +4136,3 @@ bool bt_att_chan_opt_valid(struct bt_conn *conn, enum bt_att_chan_opt chan_opt) return true; } - -int bt_gatt_authorization_cb_register(const struct bt_gatt_authorization_cb *cb) -{ - if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { - return -ENOSYS; - } - - if (!cb) { - authorization_cb = NULL; - return 0; - } - - if (authorization_cb) { - return -EALREADY; - } - - authorization_cb = cb; - - return 0; -} diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 0770d6a407bb..ea1dc73e158a 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -6590,3 +6590,54 @@ void bt_gatt_req_set_mtu(struct bt_att_req *req, uint16_t mtu) * request types if needed. */ } + +/* Descriptor of application-specific authorization callbacks that are used + * with the CONFIG_BT_GATT_AUTHORIZATION_CUSTOM Kconfig enabled. + */ +static const struct bt_gatt_authorization_cb *authorization_cb; + +bool bt_gatt_attr_read_authorize(struct bt_conn *conn, const struct bt_gatt_attr *attr) +{ + if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { + return true; + } + + if (!authorization_cb || !authorization_cb->read_authorize) { + return true; + } + + return authorization_cb->read_authorize(conn, attr); +} + +bool bt_gatt_attr_write_authorize(struct bt_conn *conn, const struct bt_gatt_attr *attr) +{ + if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { + return true; + } + + if (!authorization_cb || !authorization_cb->write_authorize) { + return true; + } + + return authorization_cb->write_authorize(conn, attr); +} + +int bt_gatt_authorization_cb_register(const struct bt_gatt_authorization_cb *cb) +{ + if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { + return -ENOSYS; + } + + if (!cb) { + authorization_cb = NULL; + return 0; + } + + if (authorization_cb) { + return -EALREADY; + } + + authorization_cb = cb; + + return 0; +} diff --git a/subsys/bluetooth/host/gatt_internal.h b/subsys/bluetooth/host/gatt_internal.h index 1dab30471af1..dbe3736cb0fc 100644 --- a/subsys/bluetooth/host/gatt_internal.h +++ b/subsys/bluetooth/host/gatt_internal.h @@ -68,3 +68,6 @@ struct bt_gatt_attr; /* Check attribute permission */ uint8_t bt_gatt_check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr, uint16_t mask); + +bool bt_gatt_attr_read_authorize(struct bt_conn *conn, const struct bt_gatt_attr *attr); +bool bt_gatt_attr_write_authorize(struct bt_conn *conn, const struct bt_gatt_attr *attr); From ca32df94650136011da39c4fdf998691602f9184 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Thu, 18 Sep 2025 11:07:56 +0200 Subject: [PATCH 0304/3334] [nrf fromtree] Bluetooth: SMP: Print extra state information on timeout This gives some extra information on what could be a reason for SMP timeout. Signed-off-by: Szymon Janc (cherry picked from commit 9354e064220310b691021bc69e4fff8b531b5020) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/smp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 4590f5d411a1..e5fa3f3614d0 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -2020,7 +2020,15 @@ static void smp_timeout(struct k_work *work) struct k_work_delayable *dwork = k_work_delayable_from_work(work); struct bt_smp *smp = CONTAINER_OF(dwork, struct bt_smp, work); - LOG_ERR("SMP Timeout"); + /* if number of flags or supported commands exceed capacity of one + * atomic variable following error log shall be extended + */ + BUILD_ASSERT(ATOMIC_BITMAP_SIZE(SMP_NUM_FLAGS) == 1); + BUILD_ASSERT(ATOMIC_BITMAP_SIZE(BT_SMP_NUM_CMDS) == 1); + + LOG_ERR("SMP Timeout (flags:0x%08x allowed_cmds:0x%08x)", + (unsigned int)atomic_get(&smp->flags[0]), + (unsigned int)atomic_get(&smp->allowed_cmds[0])); smp_pairing_complete(smp, BT_SMP_ERR_UNSPECIFIED); From 8ef8eefad8b3bc5f3b7e1602db4ed605f55fcc1e Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Mon, 5 May 2025 15:41:44 +0200 Subject: [PATCH 0305/3334] [nrf fromtree] Bluetooth: Host: Fix use of local variable as atomic target In bt_conn_unref(), a local variable is used as atomic target: atomic_val_t old = atomic_dec(&conn->ref); /* Prevent from accessing connection object */ bool deallocated = (atomic_get(&old) == 1); Using atomic_get() to access a non-shared local variable cannot prevent any data race on that variable, and only causes confusion. Moreover, this call to atomic_get() is incorrect: the API expects an atomic_t* argument (target), not an atomic_val_t* (value). This compiles and /works/ only because Zephyr defines both to be the same integer type, and thus: atomic_get(&old) == old. The equivalent C11 code, where _Atomic(T) and T are different types, wouldn't compile. Signed-off-by: Christophe Dufaza (cherry picked from commit 51f57da387f2635f98434377bf77fa9f7f7ad735) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/conn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index f3abf67d4fb6..9f3ea02f3f16 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1511,8 +1511,8 @@ void bt_conn_unref(struct bt_conn *conn) conn_handle = conn->handle; old = atomic_dec(&conn->ref); - /* Prevent from accessing connection object */ - deallocated = (atomic_get(&old) == 1); + /* Whether we removed the last reference. */ + deallocated = (old == 1); IF_ENABLED(CONFIG_BT_CONN_TX, (__ASSERT(!(deallocated && k_work_is_pending(&conn->tx_complete_work)), "tx_complete_work is pending when conn is deallocated"))); From f44b6bea3caa9b90458eba9412d3fbb448cbe53a Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Mon, 18 Aug 2025 13:34:02 +0200 Subject: [PATCH 0306/3334] [nrf fromtree] Bluetooth: Host: Fix possible inconsistent access to connection state An assertion in bt_conn_unref() accesses the connection's state after decrementing its reference count. This is not consistent since, if we removed the last reference, the Bluetooth Host stack may reuse the connection object before the assertion is checked. Instead, retrieve the connection property tested by the assertion before decrementing the counter, as we do for other properties. Simplify the code path by returning early when we did not remove the last reference. Remind that automatic advertiser resumption is deprecated. Signed-off-by: Christophe Dufaza (cherry picked from commit c3f175825e4977e8f36848c2c11cce9d66b16c1b) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/conn.c | 49 +++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 9f3ea02f3f16..c1a2940d0186 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1500,38 +1500,57 @@ void bt_conn_unref(struct bt_conn *conn) enum bt_conn_type conn_type; uint8_t conn_role; uint16_t conn_handle; + /* Used only if CONFIG_ASSERT and CONFIG_BT_CONN_TX. */ + __maybe_unused bool conn_tx_is_pending; __ASSERT(conn, "Invalid connection reference"); - /* Storing parameters of interest so we don't access the object - * after decrementing its ref-count + /* If we're removing the last reference, the connection object will be + * considered freed and possibly re-allocated by the Bluetooth Host stack + * as soon as we decrement the counter. + * To prevent inconsistencies when accessing the connection's state, + * we store its properties of interest before decrementing the ref-count, + * then unset the local pointer. */ conn_type = conn->type; conn_role = conn->role; conn_handle = conn->handle; - +#if CONFIG_BT_CONN_TX && CONFIG_ASSERT + conn_tx_is_pending = k_work_is_pending(&conn->tx_complete_work); +#endif old = atomic_dec(&conn->ref); - /* Whether we removed the last reference. */ - deallocated = (old == 1); - IF_ENABLED(CONFIG_BT_CONN_TX, - (__ASSERT(!(deallocated && k_work_is_pending(&conn->tx_complete_work)), - "tx_complete_work is pending when conn is deallocated"))); conn = NULL; LOG_DBG("handle %u ref %ld -> %ld", conn_handle, old, (old - 1)); __ASSERT(old > 0, "Conn reference counter is 0"); - /* Slot has been freed and can be taken. No guarantees are made on requests - * to claim connection object as only the first claim will be served. - */ - if (deallocated) { - k_sem_give(&pending_recycled_events); - k_work_submit(&recycled_work); + /* Whether we removed the last reference. */ + deallocated = (old == 1); + if (!deallocated) { + return; } + IF_ENABLED(CONFIG_BT_CONN_TX, + (__ASSERT(!conn_tx_is_pending, + "tx_complete_work is pending when conn is deallocated");)) + + /* Notify listeners that a slot has been freed and can be taken. + * No guarantees are made on requests to claim connection object + * as only the first claim will be served. + */ + k_sem_give(&pending_recycled_events); + k_work_submit(&recycled_work); + + /* Use the freed slot to automatically resume LE peripheral advertising. + * + * This behavior is deprecated: + * - 8cfad44: Bluetooth: Deprecate adv auto-resume + * - #72567: Bluetooth: Advertising resume functionality is broken + * - Migration guide to Zephyr v4.0.0, Automatic advertiser resumption is deprecated + */ if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && conn_type == BT_CONN_TYPE_LE && - conn_role == BT_CONN_ROLE_PERIPHERAL && deallocated) { + conn_role == BT_CONN_ROLE_PERIPHERAL) { bt_le_adv_resume(); } } From 597c94f79c92344f0a9254d94b66de41d5ab5534 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Mon, 5 May 2025 16:56:59 +0200 Subject: [PATCH 0307/3334] [nrf fromtree] Bluetooth: Host: Amend recycled() callback documentation The API documentation for the recycled() callback predates [1], and still warns users to "treat this callback as an ISR", although it now runs on the system workqueue thread, as does disconnected(). "Making Bluetooth API calls" to "re-start connectable advertising or scanning" should no longer be "strongly discouraged". On the contrary, we can emphasize that this is the right event to listen for to initiate operations that will try to re-allocate a freed connection object. Mention that BT_MAX_CONN configures the size of the connection pool. Refs: - [1] efb5d83: Bluetooth: Host: Defer `conn.recycled()` to the syswq Signed-off-by: Christophe Dufaza (cherry picked from commit 60797818d57756c74cd6cbd4d8de19f6e6d7034a) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/conn.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 6a4b7c238c89..51b8065fcdc2 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1891,12 +1891,13 @@ struct bt_conn_cb { * This callback notifies the application that it might be able to * allocate a connection object. No guarantee, first come, first serve. * - * Use this to e.g. re-start connectable advertising or scanning. + * The maximum number of simultaneous connections is configured + * by @kconfig{CONFIG_BT_MAX_CONN}. * - * Treat this callback as an ISR, as it originates from - * @ref bt_conn_unref which is used by the BT stack. Making - * Bluetooth API calls in this context is error-prone and strongly - * discouraged. + * This is the event to listen for to start a new connection or connectable advertiser, + * both when the intention is to start it after the system is completely + * finished with an earlier connection, and when the application wants to start + * a connection for any reason but failed and is waiting for the right time to retry. */ void (*recycled)(void); From 68f3e886d0771822f4c934fff385f10754daf791 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Tue, 5 Aug 2025 16:54:10 +0200 Subject: [PATCH 0308/3334] [nrf fromtree] Bluetooth: Host: Amend disconnected() callback documentation The API documentation for the disconnected() callback warns that the listener can't assume that the corresponding connection object has been freed and may me available to the application. The recommendations given to still start a new connection or connectable advertiser are outdated or misleading: - "start connectable advertising": the options that "will attempt to resume the advertiser under some conditions" are deprecated since Zephyr 4.0 (BT_LE_ADV_OPT_CONNECTABLE and related) - "using k_work_submit()": assuming everything will be fine when the work is actually processed is not reliable - "increase CONFIG_BT_MAX_CONN": setting BT_MAX_CONN to N+1 when planning N simultaneous connections is a work-around that users may have gotten used to (despite its footprint), but there is no longer any reason to advise it Stop documenting creating new connections or restarting advertising from the disconnected() callback and instead recommend relying on recycled() for these use cases. Signed-off-by: Christophe Dufaza (cherry picked from commit dca154df3e520ceb955c79a3ea8ca325f3fa82b6) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/conn.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 51b8065fcdc2..2f9b796e1ec1 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1877,9 +1877,8 @@ struct bt_conn_cb { * start either a connectable advertiser or create a new connection * this might fail because there are no free connection objects * available. - * To avoid this issue it is recommended to either start connectable - * advertise or create a new connection using @ref k_work_submit or - * increase @kconfig{CONFIG_BT_MAX_CONN}. + * To avoid this issue, it's recommended to rely instead on @ref bt_conn_cb.recycled + * which notifies the application when a connection object has actually been freed. * * @param conn Connection object. * @param reason BT_HCI_ERR_* reason for the disconnection. From 5908b65085abb05bffe11ed62c4ab743193355e5 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Mon, 12 May 2025 15:15:44 +0200 Subject: [PATCH 0309/3334] [nrf fromtree] Bluetooth: Host: Fix some MISRA c:M23_112 warnings Fix some "All if ... else if constructs shall be terminated with an else clause" (c:M23_112) issues reported by SonarQube. Signed-off-by: Christophe Dufaza (cherry picked from commit 69cab3f6a8ac07d548541b62c49c465143f972ca) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/conn.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index c1a2940d0186..c52ecc42fc1c 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2291,6 +2291,10 @@ static void deferred_work(struct k_work *work) err); } #endif + } else { + /* Neither the application nor the configuration + * set LE connection parameters. + */ } atomic_set_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_UPDATE); @@ -2393,6 +2397,8 @@ struct bt_conn *bt_conn_add_sco(const bt_addr_t *peer, int link_type) } else if (link_type == BT_HCI_ESCO) { sco_conn->sco.pkt_type = (bt_dev.br.esco_pkt_type & ~EDR_ESCO_PKT_MASK); + } else { + /* Ignoring unexpected link type BT_HCI_ACL. */ } return sco_conn; From d1f08acf6c97c254c754475d1d3f2208a042cb82 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 6 Feb 2025 09:44:50 +1000 Subject: [PATCH 0310/3334] [nrf fromtree] bluetooth: host: conn: handle `bt_le_create_conn_cancel` error Handle the `bt_le_create_conn_cancel` call in the deferred worker failing due to insufficient command buffers. Signed-off-by: Jordan Yates (cherry picked from commit c3221f04200a6d522d57300f377696b5053aa4b6) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/conn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index c52ecc42fc1c..fb31f879191e 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2251,7 +2251,10 @@ static void deferred_work(struct k_work *work) * auto connect flag if it was set, instead just cancel * connection directly */ - bt_le_create_conn_cancel(); + if (bt_le_create_conn_cancel() == -ENOBUFS) { + LOG_WRN("No buffers to cancel connection, retrying in 10 ms"); + k_work_reschedule(dwork, K_MSEC(10)); + } return; } From 2bfc30feb57919803052074ddbfe1dacfb59177e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Thu, 18 Sep 2025 11:39:49 +0200 Subject: [PATCH 0311/3334] [nrf fromtree] bluetooth: mesh: access: doxygen improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A few straightforward cleanups to existing documentation to improve coverage and properly hide internal macros. Signed-off-by: Benjamin Cabé (cherry picked from commit 7be280cee64cfce5d0e465d38046e8ffc053282d) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/mesh/access.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/zephyr/bluetooth/mesh/access.h b/include/zephyr/bluetooth/mesh/access.h index 06ae4f6e9f6f..c2dc4df4fdac 100644 --- a/include/zephyr/bluetooth/mesh/access.h +++ b/include/zephyr/bluetooth/mesh/access.h @@ -15,6 +15,10 @@ #include #include +/** + * @cond INTERNAL_HIDDEN + */ + /* Internal macros used to initialize array members */ #define BT_MESH_KEY_UNUSED_ELT_(IDX, _) BT_MESH_KEY_UNUSED #define BT_MESH_ADDR_UNASSIGNED_ELT_(IDX, _) BT_MESH_ADDR_UNASSIGNED @@ -31,6 +35,8 @@ #define BT_MESH_MODEL_UUIDS_UNASSIGNED() #endif +/** @endcond */ + #define BT_MESH_MODEL_RUNTIME_INIT(_user_data) \ .rt = &(struct bt_mesh_model_rt_ctx){ .user_data = (_user_data) }, @@ -199,8 +205,11 @@ struct bt_mesh_model_op { struct net_buf_simple *buf); }; +/** Macro for encoding a 1-byte opcode (used by Bluetooth SIG defined models). */ #define BT_MESH_MODEL_OP_1(b0) (b0) +/** Macro for encoding a 2-byte opcode (used by Bluetooth SIG defined models). */ #define BT_MESH_MODEL_OP_2(b0, b1) (((b0) << 8) | (b1)) +/** Macro for encoding a 3-byte opcode (vendor-specific message). */ #define BT_MESH_MODEL_OP_3(b0, cid) ((((b0) << 16) | 0xc00000) | (cid)) /** Macro for encoding exact message length for fixed-length messages. */ @@ -593,13 +602,13 @@ struct bt_mesh_model_pub { * BT_MESH_MODELS_METADATA_ENTRY macro. */ struct bt_mesh_models_metadata_entry { - /* Length of the metadata */ + /** Length of the metadata */ const uint16_t len; - /* ID of the metadata */ + /** ID of the metadata */ const uint16_t id; - /* Pointer to raw data */ + /** Pointer to raw data */ const void * const data; }; From a28e3f030ac23984dc114aeb79baafb3039d181e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Tue, 9 Sep 2025 09:59:08 +0200 Subject: [PATCH 0312/3334] [nrf fromtree] Bluetooth: Host: Add userdefined fixed l2cap chans MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for the user defining their own channels within the fixed L2CAP channel range. To make this possible, the `bt_l2cap_fixed_chan` struct and `BT_L2CAP_CHANNEL_DEFINE` macro needed to converted to public API. In the process of doing so, the `_destroy` parameter was removed from the `BT_L2CAP_CHANNEL_DEFINE` macro as it was never used (fixed channels will not be destroyed over the lifetime of the connection). `BT_L2CAP_CHANNEL_DEFINE` is renamed `BT_L2CAP_FIXED_CHANNEL_DEFINE` to avoid confusion The `bt_l2cap_chan_send` function is updated to be able to send data on fixed l2cap channels. Signed-off-by: Håvard Reierstad (cherry picked from commit ff17e601d0c1586fb4ac7d04bae26e2f17709297) Signed-off-by: Pavel Vasilyev --- doc/connectivity/bluetooth/api/l2cap.rst | 38 +++++++- include/zephyr/bluetooth/l2cap.h | 111 ++++++++++++++++++++--- subsys/bluetooth/host/att.c | 5 +- subsys/bluetooth/host/l2cap.c | 45 +++++++-- subsys/bluetooth/host/l2cap_internal.h | 19 ---- subsys/bluetooth/host/smp.c | 5 +- subsys/bluetooth/host/smp_null.c | 5 +- 7 files changed, 181 insertions(+), 47 deletions(-) diff --git a/doc/connectivity/bluetooth/api/l2cap.rst b/doc/connectivity/bluetooth/api/l2cap.rst index 581edda83485..157f9684be13 100644 --- a/doc/connectivity/bluetooth/api/l2cap.rst +++ b/doc/connectivity/bluetooth/api/l2cap.rst @@ -3,11 +3,45 @@ Logical Link Control and Adaptation Protocol (L2CAP) #################################################### -L2CAP layer enables connection-oriented channels which can be enable with the -configuration option: :kconfig:option:`CONFIG_BT_L2CAP_DYNAMIC_CHANNEL`. This channels +L2CAP layer enables connection-oriented channels which can be enabled with the +configuration option: :kconfig:option:`CONFIG_BT_L2CAP_DYNAMIC_CHANNEL`. These channels support segmentation and reassembly transparently, they also support credit based flow control making it suitable for data streams. +The user can also define fixed channels using the :c:macro:`BT_L2CAP_FIXED_CHANNEL_DEFINE` +macro. Fixed channels are initialized upon connection, and do not support segmentation. An example +of how to define a fixed channel is shown below. + +.. code-block:: c + + static struct bt_l2cap_chan fixed_chan[CONFIG_BT_MAX_CONN]; + + /* Callbacks are assumed to be defined prior. */ + static struct bt_l2cap_chan_ops ops = { + .recv = recv_cb, + .sent = sent_cb, + .connected = connected_cb, + .disconnected = disconnected_cb, + }; + + static int l2cap_fixed_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) + { + uint8_t conn_index = bt_conn_index(conn); + + *chan = &fixed_chan[conn_index]; + + **chan = (struct bt_l2cap_chan){ + .ops = &ops, + }; + + return 0; + } + + BT_L2CAP_FIXED_CHANNEL_DEFINE(fixed_channel) = { + .cid = 0x0010, + .accept = l2cap_fixed_accept, + }; + Channels instances are represented by the :c:struct:`bt_l2cap_chan` struct which contains the callbacks in the :c:struct:`bt_l2cap_chan_ops` struct to inform when the channel has been connected, disconnected or when the encryption has diff --git a/include/zephyr/bluetooth/l2cap.h b/include/zephyr/bluetooth/l2cap.h index 571b57e76ac9..0ffa85bc41c6 100644 --- a/include/zephyr/bluetooth/l2cap.h +++ b/include/zephyr/bluetooth/l2cap.h @@ -139,6 +139,27 @@ extern "C" { */ #define BT_L2CAP_ECRED_CHAN_MAX_PER_REQ 5 +/** + * @defgroup l2cap_cid L2CAP channel identifiers + * @ingroup bt_l2cap + * @{ + * + * @brief Standard L2CAP channel identifiers + */ + +/** @brief BR signaling channel */ +#define BT_L2CAP_CID_BR_SIG 0x0001 +/** @brief Attribute Protocol channel */ +#define BT_L2CAP_CID_ATT 0x0004 +/** @brief LE signaling channel */ +#define BT_L2CAP_CID_LE_SIG 0x0005 +/** @brief Security Manager Protocol channel */ +#define BT_L2CAP_CID_SMP 0x0006 +/** @brief BR Security Manager Protocol channel */ +#define BT_L2CAP_CID_BR_SMP 0x0007 + +/** @} */ + struct bt_l2cap_chan; /** @typedef bt_l2cap_chan_destroy_t @@ -290,6 +311,68 @@ struct bt_l2cap_le_chan { */ #define BT_L2CAP_LE_CHAN(_ch) CONTAINER_OF(_ch, struct bt_l2cap_le_chan, chan) +/** @brief Fixed L2CAP Channel structure. Should be defined using the + * @ref BT_L2CAP_FIXED_CHANNEL_DEFINE macro. + */ +struct bt_l2cap_fixed_chan { + /** @brief Channel Identifier (CID) + * + * @note Shall be in the range 0x0001 to 0x003F (Core 3.A.2.1 v6.0). The CIDs in this range + * are reserved by the stack, so the application needs to make sure that the CID is + * not already in use. Table 2.1 in Core 3.A.2.1 and @ref l2cap_cid shows the + * CIDs used by the stack. + */ + uint16_t cid; + + /** @brief Channel accept callback + * + * This callback needs to be provided by the application, and is invoked when a new + * connection has been established. If accepting the connection, the user is expected to + * allocate memory with suitable alignment for the type @ref bt_l2cap_chan for the channel, + * and update the channel reference @p chan to point to the allocated memory. The channel + * should be initialized by assigning the callbacks to the @ref bt_l2cap_chan_ops field + * as follows: + * @code + * static int accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) + * { + * // Allocation of fixed_chan and definition of the ops are assumed done prior. + * *chan = &fixed_chan; + * + * **chan = (struct bt_l2cap_chan){ + * .ops = &ops, + * }; + * + * return 0; + * } + * @endcode + * The allocated context needs to be valid for the lifetime of the channel, i. e. + * freeing of the memory can be done in the @ref bt_l2cap_chan_ops.released callback. + * + * @param conn The connection that has been established. + * @param chan L2CAP channel reference. + * + * @return 0 to accept the channel connection, negative error code otherwise. + */ + int (*accept)(struct bt_conn *conn, struct bt_l2cap_chan **chan); +}; + +/** + * @brief Register a fixed L2CAP channel. + * + * Define and register a fixed L2CAP channel of type @ref bt_l2cap_fixed_chan. + * + * @note Fixed L2CAP channels are according to the Core Specification (3.A.2.1 v6.0) reserved + * for the stack, but this allows the application to define their own, for instance if there + * are memory constraints and dynamic channels are not suitable. The application needs to + * make sure that the CID for the fixed channel is not already in use. + * + * @param _name Name of the fixed L2CAP channel. The channels are sorted lexicographically, and + * will be initialized in the same order. + */ +#define BT_L2CAP_FIXED_CHANNEL_DEFINE(_name) \ + static const STRUCT_SECTION_ITERABLE(bt_l2cap_fixed_chan, \ + _CONCAT(bt_l2cap_fixed_chan, _name)) + /** L2CAP Endpoint Link Mode. Basic mode. */ #define BT_L2CAP_BR_LINK_MODE_BASIC 0x00 /** L2CAP Endpoint Link Mode. Retransmission mode. */ @@ -910,23 +993,21 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan); /** @brief Send data to L2CAP channel * - * Send data from buffer to the channel. If credits are not available, buf will - * be queued and sent as and when credits are received from peer. - * Regarding to first input parameter, to get details see reference description - * to bt_l2cap_chan_connect() API above. + * Send data from buffer to the channel. For dynamic channels; if credits are + * not available, buf will be queued and sent as and when credits are received + * from peer. * * Network buffer fragments (ie `buf->frags`) are not supported. * - * When sending L2CAP data over an BR/EDR connection the application is sending - * L2CAP PDUs. The application is required to have reserved - * @ref BT_L2CAP_CHAN_SEND_RESERVE bytes in the buffer before sending. - * The application should use the BT_L2CAP_BUF_SIZE() helper to correctly - * size the buffers for the for the outgoing buffer pool. + * When sending L2CAP data over an BR/EDR connection or a fixed L2CAP channel, + * the application is sending L2CAP PDUs. The application is required to have + * reserved @ref BT_L2CAP_CHAN_SEND_RESERVE bytes in the buffer before sending. + * The application should use the BT_L2CAP_BUF_SIZE() helper to correctly size + * the buffers for the for the outgoing buffer pool. * - * When sending L2CAP data over an LE connection the application is sending - * L2CAP SDUs. The application shall reserve + * When sending L2CAP data over a dynamic L2CAP channel, the application is + * sending L2CAP SDUs. The application shall reserve * @ref BT_L2CAP_SDU_CHAN_SEND_RESERVE bytes in the buffer before sending. - * * The application can use the BT_L2CAP_SDU_BUF_SIZE() helper to correctly size * the buffer to account for the reserved headroom. * @@ -942,9 +1023,13 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan); * @note Buffer ownership is transferred to the stack in case of success, in * case of an error the caller retains the ownership of the buffer. * + * @param chan The channel to send the data to. See @ref bt_l2cap_chan_connect + * for more details. + * @param buf Buffer containing the data. + * * @return 0 in case of success or negative value in case of error. * @return -EINVAL if `buf` or `chan` is NULL. - * @return -EINVAL if `chan` is not either BR/EDR or LE credit-based. + * @return -EINVAL if `chan` is not either BR/EDR or LE 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. diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index e9e0add6fbfa..66833d1cfcc5 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -3489,7 +3489,10 @@ static int bt_att_accept(struct bt_conn *conn, struct bt_l2cap_chan **ch) * placed as the last one to ensure that SMP channel is properly initialized before bt_att_connected * tries to send security request. */ -BT_L2CAP_CHANNEL_DEFINE(z_att_fixed_chan, BT_L2CAP_CID_ATT, bt_att_accept, NULL); +BT_L2CAP_FIXED_CHANNEL_DEFINE(z_att_fixed_chan) = { + .cid = BT_L2CAP_CID_ATT, + .accept = bt_att_accept, +}; #if defined(CONFIG_BT_EATT) static k_timeout_t credit_based_connection_delay(struct bt_conn *conn) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index c4e37f74b5ae..6dcdfe04e541 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -50,6 +50,11 @@ LOG_MODULE_REGISTER(bt_l2cap, CONFIG_BT_L2CAP_LOG_LEVEL); #define L2CAP_LE_MAX_CREDITS (BT_BUF_ACL_RX_COUNT - 1) +#define L2CAP_LE_CID_FIXED_START 0x0001 +#define L2CAP_LE_CID_FIXED_END 0x003f +#define L2CAP_LE_CID_IS_FIXED(_cid) \ + (_cid >= L2CAP_LE_CID_FIXED_START && _cid <= L2CAP_LE_CID_FIXED_END) + #define L2CAP_LE_CID_DYN_START 0x0040 #define L2CAP_LE_CID_DYN_END 0x007f #define L2CAP_LE_CID_IS_DYN(_cid) \ @@ -425,6 +430,12 @@ void bt_l2cap_connected(struct bt_conn *conn) STRUCT_SECTION_FOREACH(bt_l2cap_fixed_chan, fchan) { struct bt_l2cap_le_chan *le_chan; + __ASSERT(L2CAP_LE_CID_IS_FIXED(fchan->cid), + "CID %u is not in the fixed channel range", fchan->cid); + + chan = bt_l2cap_le_lookup_tx_cid(conn, fchan->cid); + __ASSERT(chan == NULL, "Fixed channel with CID %u already exists", fchan->cid); + if (fchan->accept(conn, &chan) < 0) { continue; } @@ -437,7 +448,7 @@ void bt_l2cap_connected(struct bt_conn *conn) le_chan->rx.cid = fchan->cid; le_chan->tx.cid = fchan->cid; - if (!l2cap_chan_add(conn, chan, fchan->destroy)) { + if (!l2cap_chan_add(conn, chan, NULL)) { return; } @@ -2951,7 +2962,10 @@ static int l2cap_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) return -ENOMEM; } -BT_L2CAP_CHANNEL_DEFINE(le_fixed_chan, BT_L2CAP_CID_LE_SIG, l2cap_accept, NULL); +BT_L2CAP_FIXED_CHANNEL_DEFINE(le_fixed_chan) = { + .cid = BT_L2CAP_CID_LE_SIG, + .accept = l2cap_accept, +}; void bt_l2cap_init(void) { @@ -3409,6 +3423,16 @@ static int bt_l2cap_dyn_chan_send(struct bt_l2cap_le_chan *le_chan, struct net_b return 0; } +#endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ + +static void l2cap_fixed_chan_sent_cb(struct bt_conn *conn, void *user_data, int err) +{ + struct bt_l2cap_chan *chan = user_data; + + if (chan->ops->sent) { + chan->ops->sent(chan); + } +} int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf) { @@ -3436,20 +3460,21 @@ int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf) return bt_l2cap_br_chan_send_cb(chan, buf, NULL, NULL); } - /* Sending over static channels is not supported by this fn. Use - * `bt_l2cap_send_pdu()` instead. - */ - if (IS_ENABLED(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL)) { - struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); + struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); - __ASSERT_NO_MSG(le_chan); - __ASSERT_NO_MSG(L2CAP_LE_CID_IS_DYN(le_chan->tx.cid)); + __ASSERT_NO_MSG(le_chan); +#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) + if (L2CAP_LE_CID_IS_DYN(le_chan->tx.cid)) { return bt_l2cap_dyn_chan_send(le_chan, buf); } +#endif + + if (L2CAP_LE_CID_IS_FIXED(le_chan->tx.cid)) { + return bt_l2cap_send_pdu(le_chan, buf, l2cap_fixed_chan_sent_cb, (void *)chan); + } LOG_DBG("Invalid channel type (chan %p)", chan); return -EINVAL; } -#endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index 3f84b2b43d74..82d6d65434f9 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -26,12 +26,6 @@ enum l2cap_conn_list_action { BT_L2CAP_CHAN_DETACH, }; -#define BT_L2CAP_CID_BR_SIG 0x0001 -#define BT_L2CAP_CID_ATT 0x0004 -#define BT_L2CAP_CID_LE_SIG 0x0005 -#define BT_L2CAP_CID_SMP 0x0006 -#define BT_L2CAP_CID_BR_SMP 0x0007 - #define BT_L2CAP_PSM_RFCOMM 0x0003 struct bt_l2cap_hdr { @@ -164,19 +158,6 @@ struct bt_l2cap_ecred_reconf_rsp { uint16_t result; } __packed; -struct bt_l2cap_fixed_chan { - uint16_t cid; - int (*accept)(struct bt_conn *conn, struct bt_l2cap_chan **chan); - bt_l2cap_chan_destroy_t destroy; -}; - -#define BT_L2CAP_CHANNEL_DEFINE(_name, _cid, _accept, _destroy) \ - const STRUCT_SECTION_ITERABLE(bt_l2cap_fixed_chan, _name) = { \ - .cid = _cid, \ - .accept = _accept, \ - .destroy = _destroy, \ - } - /* Notify L2CAP channels of a new connection */ void bt_l2cap_connected(struct bt_conn *conn); diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index e5fa3f3614d0..702e6fc0d215 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -6354,7 +6354,10 @@ static int bt_smp_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) return -ENOMEM; } -BT_L2CAP_CHANNEL_DEFINE(smp_fixed_chan, BT_L2CAP_CID_SMP, bt_smp_accept, NULL); +BT_L2CAP_FIXED_CHANNEL_DEFINE(smp_fixed_chan) = { + .cid = BT_L2CAP_CID_SMP, + .accept = bt_smp_accept, +}; #if defined(CONFIG_BT_CLASSIC) BT_L2CAP_BR_CHANNEL_DEFINE(smp_br_fixed_chan, BT_L2CAP_CID_BR_SMP, bt_smp_br_accept); diff --git a/subsys/bluetooth/host/smp_null.c b/subsys/bluetooth/host/smp_null.c index 0ff20b4a16d6..92a6596860e0 100644 --- a/subsys/bluetooth/host/smp_null.c +++ b/subsys/bluetooth/host/smp_null.c @@ -102,7 +102,10 @@ static int bt_smp_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) return -ENOMEM; } -BT_L2CAP_CHANNEL_DEFINE(smp_fixed_chan, BT_L2CAP_CID_SMP, bt_smp_accept, NULL); +BT_L2CAP_FIXED_CHANNEL_DEFINE(smp_fixed_chan) = { + .cid = BT_L2CAP_CID_SMP, + .accept = bt_smp_accept, +}; int bt_smp_init(void) { From 993787643e98cc1360ff3cf2f84848c177eb5ac8 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Sat, 27 Sep 2025 12:04:16 +0200 Subject: [PATCH 0313/3334] [nrf fromtree] Bluetooth: Host: Add note about recycled for BT_LE_ADV_OPT_CONN When a connectable advertising set is stopped, the preallocated connection object is free by calling bt_conn_unref which triggers a call to the recycled callback. Signed-off-by: Emil Gydesen (cherry picked from commit 7d8315574f9724c478f2953e8dfeaaba6c705244) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/bluetooth.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 1656f1f56844..f9bc6c1724a3 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -756,6 +756,8 @@ enum bt_le_adv_opt { * * Starting connectable advertising preallocates a connection * object. If this fails, the API returns @c -ENOMEM. + * Stopping connectable advertising will free the connection object, + * and will trigger a call to @ref bt_conn_cb.recycled. * * The advertising set stops immediately after it creates a * connection. This happens automatically in the controller. From ba47629e78fdf805576cd42a38cf07fc5e1e0031 Mon Sep 17 00:00:00 2001 From: Ali Hozhabri Date: Mon, 12 May 2025 15:55:31 +0200 Subject: [PATCH 0314/3334] [nrf fromtree] drivers: bluetooth: hci: Introduce bt_spi_close to support bt_disable Introduce bt_spi_close function to support bt_disable implementation in applications. Signed-off-by: Ali Hozhabri (cherry picked from commit 9a440ec18f07b87af0351a252a744c6314d3df21) Signed-off-by: Pavel Vasilyev --- drivers/bluetooth/hci/hci_spi_st.c | 33 +++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci/hci_spi_st.c b/drivers/bluetooth/hci/hci_spi_st.c index 8f6bf72c0edb..5b0d8fc674af 100644 --- a/drivers/bluetooth/hci/hci_spi_st.c +++ b/drivers/bluetooth/hci/hci_spi_st.c @@ -515,7 +515,11 @@ static void bt_spi_rx_thread(void *p1, void *p2, void *p3) while (true) { /* Wait for interrupt pin to be active */ - k_sem_take(&sem_request, K_FOREVER); + ret = k_sem_take(&sem_request, K_FOREVER); + if (ret) { + LOG_DBG("Failed to take the semaphore. The RX thread exits."); + break; + } LOG_DBG(""); @@ -685,12 +689,39 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) return 0; } +static int bt_spi_close(const struct device *dev) +{ + struct bt_spi_data *hci = dev->data; + int ret; + + gpio_pin_interrupt_configure_dt(&irq_gpio, GPIO_INT_DISABLE); + + /* To exit the thread safely */ + k_sem_reset(&sem_request); + ret = k_thread_join(&spi_rx_thread_data, K_MSEC(100)); + if (ret) { + LOG_DBG("bt_spi_rx_thread is unable to exit"); + return ret; + } + + /* Reset the BLE controller */ + 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); + + hci->recv = NULL; + LOG_DBG("Bluetooth disabled"); + + return 0; +} + static DEVICE_API(bt_hci, drv) = { #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 */ .open = bt_spi_open, .send = bt_spi_send, + .close = bt_spi_close, }; static int bt_spi_init(const struct device *dev) From 42c1f03e74c1ac2d2ff7f2ab0cb7de35fd74caef Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 2 Oct 2025 13:52:13 +0200 Subject: [PATCH 0315/3334] [nrf fromtree] Bluetooth: Host: Remove bt_le_set_auto_conn Remove the deprecated function bt_le_set_auto_conn as it has been deprecated since 4.1. Signed-off-by: Emil Gydesen (cherry picked from commit 360880b7c7f397624ae8a4413d71ae261a370c39) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/conn.h | 17 ---------- subsys/bluetooth/host/conn.c | 59 --------------------------------- 2 files changed, 76 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 2f9b796e1ec1..67c3db64e92a 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1639,23 +1639,6 @@ int bt_conn_le_create_auto(const struct bt_conn_le_create_param *create_param, */ int bt_conn_create_auto_stop(void); -/** @brief Automatically connect to remote device if it's in range. - * - * This function enables/disables automatic connection initiation. - * Every time the device loses the connection with peer, this connection - * will be re-established if connectable advertisement from peer is received. - * - * @note Auto connect is disabled during explicit scanning. - * - * @param addr Remote Bluetooth address. - * @param param If non-NULL, auto connect is enabled with the given - * parameters. If NULL, auto connect is disabled. - * - * @return Zero on success or error code otherwise. - */ -__deprecated int bt_le_set_auto_conn(const bt_addr_le_t *addr, - const struct bt_le_conn_param *param); - /** @brief Set security level for a connection. * * This function enable security (encryption) for a connection. If the device diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index fb31f879191e..ad627bcdf175 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -3994,65 +3994,6 @@ int bt_conn_le_create_synced(const struct bt_le_ext_adv *adv, *ret_conn = conn; return 0; } - -#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST) -int bt_le_set_auto_conn(const bt_addr_le_t *addr, - const struct bt_le_conn_param *param) -{ - struct bt_conn *conn; - - if (!atomic_test_bit(bt_dev.flags, BT_DEV_READY)) { - return -EAGAIN; - } - - if (param && !bt_le_conn_params_valid(param)) { - return -EINVAL; - } - - if (!bt_id_scan_random_addr_check()) { - return -EINVAL; - } - - /* Only default identity is supported */ - conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, addr); - if (!conn) { - conn = bt_conn_add_le(BT_ID_DEFAULT, addr); - if (!conn) { - return -ENOMEM; - } - } - - if (param) { - bt_conn_set_param_le(conn, param); - - if (!atomic_test_and_set_bit(conn->flags, - BT_CONN_AUTO_CONNECT)) { - bt_conn_ref(conn); - } - } else { - if (atomic_test_and_clear_bit(conn->flags, - BT_CONN_AUTO_CONNECT)) { - bt_conn_unref(conn); - if (conn->state == BT_CONN_SCAN_BEFORE_INITIATING) { - bt_conn_set_state(conn, BT_CONN_DISCONNECTED); - } - } - } - - int err = 0; - if (conn->state == BT_CONN_DISCONNECTED && - atomic_test_bit(bt_dev.flags, BT_DEV_READY)) { - if (param) { - bt_conn_set_state(conn, BT_CONN_SCAN_BEFORE_INITIATING); - err = bt_le_scan_user_add(BT_LE_SCAN_USER_CONN); - } - } - - bt_conn_unref(conn); - - return err; -} -#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */ #endif /* CONFIG_BT_CENTRAL */ int bt_conn_le_conn_update(struct bt_conn *conn, From 7d82a3bf29342a9690cb3d73b8b9f81d81a6f772 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 2 Oct 2025 13:53:53 +0200 Subject: [PATCH 0316/3334] [nrf fromtree] doc: releases: Add note for bt_le_set_auto_conn Add note for removed function bt_le_set_auto_conn. Signed-off-by: Emil Gydesen (cherry picked from commit b3ef646160a207316591be87bde7dbf303fb3fee) Signed-off-by: Pavel Vasilyev --- doc/releases/release-notes-4.3.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index 718e4ad3ba33..dc5393b418dd 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -61,6 +61,7 @@ Removed APIs and options * The TinyCrypt library was removed as the upstream version is no longer maintained. PSA Crypto API is now the recommended cryptographic library for Zephyr. * The legacy pipe object API was removed. Use the new pipe API instead. +* ``bt_le_set_auto_conn`` Deprecated APIs and options =========================== From 52c0ff43b6b0a7a26963841b348723c6d2e47883 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 2 Oct 2025 13:13:04 +0200 Subject: [PATCH 0317/3334] [nrf fromtree] Bluetooth: Remove CONFIG_BT_BUF_ACL_RX_COUNT Remove the deprecated CONFIG_BT_BUF_ACL_RX_COUNT config as it has been deprecated since 4.1 Signed-off-by: Emil Gydesen (cherry picked from commit 6c870b071ab803728f4f48ba898de19b263b33e0) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/buf.h | 23 ++++++++--------------- subsys/bluetooth/common/Kconfig | 21 --------------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/include/zephyr/bluetooth/buf.h b/include/zephyr/bluetooth/buf.h index a4b59dcbaa92..534c75559183 100644 --- a/include/zephyr/bluetooth/buf.h +++ b/include/zephyr/bluetooth/buf.h @@ -144,27 +144,20 @@ static inline enum bt_buf_type bt_buf_type_from_h4(uint8_t h4_type, enum bt_buf_ #define BT_BUF_ACL_RX_COUNT_MAX 65535 #if defined(CONFIG_BT_CONN) && defined(CONFIG_BT_HCI_HOST) - /* The host needs more ACL buffers than maximum ACL links. This is because of - * the way we re-assemble ACL packets into L2CAP PDUs. - * - * We keep around the first buffer (that comes from the driver) to do - * re-assembly into, and if all links are re-assembling, there will be no buffer - * available for the HCI driver to allocate from. - * - * TODO: When CONFIG_BT_BUF_ACL_RX_COUNT is removed, - * remove the MAX and only keep the 1. - */ +/* The host needs more ACL buffers than maximum ACL links. This is because of + * the way we re-assemble ACL packets into L2CAP PDUs. + * + * We keep around the first buffer (that comes from the driver) to do + * re-assembly into, and if all links are re-assembling, there will be no buffer + * available for the HCI driver to allocate from. + */ #define BT_BUF_ACL_RX_COUNT_EXTRA CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA -#define BT_BUF_ACL_RX_COUNT (MAX(CONFIG_BT_BUF_ACL_RX_COUNT, 1) + BT_BUF_ACL_RX_COUNT_EXTRA) +#define BT_BUF_ACL_RX_COUNT (1 + BT_BUF_ACL_RX_COUNT_EXTRA) #else #define BT_BUF_ACL_RX_COUNT_EXTRA 0 #define BT_BUF_ACL_RX_COUNT 0 #endif /* CONFIG_BT_CONN && CONFIG_BT_HCI_HOST */ -#if defined(CONFIG_BT_BUF_ACL_RX_COUNT) && CONFIG_BT_BUF_ACL_RX_COUNT > 0 -#warning "CONFIG_BT_BUF_ACL_RX_COUNT is deprecated, see Zephyr 4.1 migration guide" -#endif /* CONFIG_BT_BUF_ACL_RX_COUNT && CONFIG_BT_BUF_ACL_RX_COUNT > 0 */ - BUILD_ASSERT(BT_BUF_ACL_RX_COUNT <= BT_BUF_ACL_RX_COUNT_MAX, "Maximum number of ACL RX buffer is 65535, reduce CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA"); diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index ae95785f8ab3..9ba9cb325855 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -102,27 +102,6 @@ config BT_BUF_ACL_RX_COUNT_EXTRA connection and uses one Rx buffer across all connections to receive a fragment from the Controller. -config BT_BUF_ACL_RX_COUNT - int "[DEPRECATED] Number of incoming ACL data buffers" - default 0 - range 0 256 - help - Number or incoming ACL data buffers sent from the Controller to the - Host. - In a combined Host and Controller build the buffers are shared and - therefore Controller to Host flow control is not needed. - - In a Host only build with Controller to Host flow control enabled - the Host will inform the Controller about the maximum number of - buffers by setting this value in the Host Buffer Size command. - - When Controller to Host flow control is not enabled the Controller - can assume that the Host has infinite amount of buffers. - - For both configurations, there is an additional requirement that is - enforced by a build-time check: BT_BUF_ACL_RX_COUNT needs to be at - least one greater than BT_MAX_CONN. - config BT_BUF_EVT_RX_SIZE int "Maximum supported HCI Event buffer length" default $(UINT8_MAX) if (BT_EXT_ADV && BT_OBSERVER) || BT_PER_ADV_SYNC || BT_DF_CONNECTION_CTE_RX || BT_CLASSIC || BT_CHANNEL_SOUNDING || BT_LE_EXTENDED_FEAT_SET From 3684f5c7c03973edc554b386022735327899d8ab Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 2 Oct 2025 13:50:29 +0200 Subject: [PATCH 0318/3334] [nrf fromtree] doc: releases: Add note about CONFIG_BT_BUF_ACL_RX_COUNT The deprecated Kconfig option has been removed. Signed-off-by: Emil Gydesen (cherry picked from commit 0a7d6bc1687c2ed1fa9333d36ae4349910f44a82) Signed-off-by: Pavel Vasilyev --- doc/releases/release-notes-4.3.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index dc5393b418dd..3e9b87db998e 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -62,6 +62,7 @@ Removed APIs and options PSA Crypto API is now the recommended cryptographic library for Zephyr. * The legacy pipe object API was removed. Use the new pipe API instead. * ``bt_le_set_auto_conn`` +* ``CONFIG_BT_BUF_ACL_RX_COUNT`` Deprecated APIs and options =========================== From b45bc9edc802a68097cf44561c79c9559b3a78f3 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Wed, 8 Oct 2025 11:07:26 +0200 Subject: [PATCH 0319/3334] [nrf fromtree] Bluetooth: Host: Change WRN->DBG for not connect for TX The bt_conn_tx_processor logged connections not in the connected state as LOG_WRN, but this is a case that is handled and could occur during regular behavior. For this reason the log statement was changed to LOG_DBG, as the developer/user does not need to worry about it. Also modifies the statement to log the conn->state for debugging purposes. Signed-off-by: Emil Gydesen (cherry picked from commit d4afa1989fda9c6919f97ecbbbe17a5c0a390032) Signed-off-by: Pavel Vasilyev --- 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 ad627bcdf175..15dd01fafeac 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1051,7 +1051,7 @@ void bt_conn_tx_processor(void) LOG_DBG("processing conn %p", conn); if (conn->state != BT_CONN_CONNECTED) { - LOG_WRN("conn %p: not connected", conn); + LOG_DBG("conn %p: not connected: state %d", conn, conn->state); goto raise_and_exit; } From c4cf398c69949d7c8136d9bab0e185ee7a1ad102 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Thu, 25 Sep 2025 21:39:56 +0200 Subject: [PATCH 0320/3334] [nrf fromtree] bluetooth: host: remove API for automatic advertising resumption Automatic advertising resumption is source of errors [1], and deprecated since Zephyr 4.0 [2]. Samples and tests no longer cover this feature. Deprecated public symbols include: - advertising options BT_LE_ADV_OPT_CONNECTABLE and BT_LE_ADV_OPT_ONE_TIME - advertising parameters BT_LE_ADV_CONN and BT_LE_ADV_CONN_ONE_TIME Withdrawing this API (options and parameters) makes the code paths to automatic advertiser resumption unreachable. [1] Bluetooth: Advertising resume functionality is broken #72567 [2] Bluetooth: Deprecate adv auto-resume #73395 Signed-off-by: Christophe Dufaza (cherry picked from commit 4850c0c52d94629d28a65b8b69045b75b33f1a71) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/bluetooth.h | 61 +--------------------------- 1 file changed, 2 insertions(+), 59 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index f9bc6c1724a3..a365698d063c 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -691,28 +691,6 @@ enum bt_le_adv_opt { /** Convenience value when no options are specified. */ BT_LE_ADV_OPT_NONE = 0, - /** - * @brief Advertise as connectable. - * - * @deprecated Use @ref BT_LE_ADV_OPT_CONN instead. - * - * Advertise as connectable. If not connectable then the type of - * advertising is determined by providing scan response data. - * The advertiser address is determined by the type of advertising - * and/or enabling privacy @kconfig{CONFIG_BT_PRIVACY}. - * - * Starting connectable advertising preallocates a connection - * object. If this fails, the API returns @c -ENOMEM. - * - * When an advertiser set results in a connection creation, the - * controller automatically disables that advertising set. - * - * If the advertising set was started with @ref bt_le_adv_start - * without @ref BT_LE_ADV_OPT_ONE_TIME, the host will attempt to - * resume the advertiser under some conditions. - */ - BT_LE_ADV_OPT_CONNECTABLE __deprecated = BIT(0), - /** * @internal * @@ -725,24 +703,6 @@ enum bt_le_adv_opt { */ _BT_LE_ADV_OPT_CONNECTABLE = BIT(0), - /** - * @brief Advertise one time. - * - * @deprecated Use @ref BT_LE_ADV_OPT_CONN instead. - * - * Don't try to resume connectable advertising after a connection. - * This option is only meaningful when used together with - * BT_LE_ADV_OPT_CONNECTABLE. If set the advertising will be stopped - * when @ref bt_le_adv_stop is called or when an incoming (peripheral) - * connection happens. If this option is not set the stack will - * take care of keeping advertising enabled even as connections - * occur. - * If Advertising directed or the advertiser was started with - * @ref bt_le_ext_adv_start then this behavior is the default behavior - * and this flag has no effect. - */ - BT_LE_ADV_OPT_ONE_TIME __deprecated = BIT(1), - /** * @internal * @@ -1165,17 +1125,6 @@ struct bt_le_per_adv_param { #define BT_LE_ADV_CONN_DIR(_peer) BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN, 0, 0, _peer) -/** - * @deprecated This is a convenience macro for @ref - * BT_LE_ADV_OPT_CONNECTABLE, which is deprecated. Please use - * @ref BT_LE_ADV_CONN_FAST_1 or @ref BT_LE_ADV_CONN_FAST_2 - * instead. - */ -#define BT_LE_ADV_CONN \ - BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, BT_GAP_ADV_FAST_INT_MIN_2, \ - BT_GAP_ADV_FAST_INT_MAX_2, NULL) \ - __DEPRECATED_MACRO - /** * @brief GAP recommended connectable advertising parameters user-initiated * @@ -1220,10 +1169,6 @@ struct bt_le_per_adv_param { * - Limited Discoverable Mode * - General Discoverable Mode * - * The advertising interval corresponds to what was offered as @ref BT_LE_ADV_CONN in Zephyr 3.6 and - * earlier, but unlike @ref BT_LE_ADV_CONN, the host does not automatically resume the advertiser - * after it results in a connection. - * * See Bluetooth Core Specification: * - 6.0 Vol 3, Part C, Appendix A "Timers and Constants", T_GAP(adv_fast_interval2) * - 6.0 Vol 3, Part C, Section 9.3.11 "Connection Establishment Timing parameters" @@ -1232,8 +1177,6 @@ struct bt_le_per_adv_param { BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN, BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, \ NULL) -#define BT_LE_ADV_CONN_ONE_TIME BT_LE_ADV_CONN_FAST_2 __DEPRECATED_MACRO - #define BT_LE_ADV_CONN_DIR_LOW_DUTY(_peer) \ BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN | BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY, \ BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, _peer) @@ -1669,7 +1612,7 @@ typedef void bt_le_scan_cb_t(const bt_addr_le_t *addr, int8_t rssi, * The periodic advertising parameters can only be set or updated on an * extended advertisement set which is neither scannable, connectable nor * anonymous (meaning, the advertising options @ref BT_LE_ADV_OPT_SCANNABLE, - * @ref BT_LE_ADV_OPT_CONNECTABLE and @ref BT_LE_ADV_OPT_ANONYMOUS cannot be set for @p adv). + * @ref BT_LE_ADV_OPT_CONN and @ref BT_LE_ADV_OPT_ANONYMOUS cannot be set for @p adv). * * @param adv Advertising set object. * @param param Advertising parameters. @@ -1685,7 +1628,7 @@ int bt_le_per_adv_set_param(struct bt_le_ext_adv *adv, * The periodic advertisement data can only be set or updated on an * extended advertisement set which is neither scannable, connectable nor * anonymous (meaning, the advertising options @ref BT_LE_ADV_OPT_SCANNABLE, - * @ref BT_LE_ADV_OPT_CONNECTABLE and @ref BT_LE_ADV_OPT_ANONYMOUS cannot be set for @p adv). + * @ref BT_LE_ADV_OPT_CONN and @ref BT_LE_ADV_OPT_ANONYMOUS cannot be set for @p adv). * * @param adv Advertising set object. * @param ad Advertising data. From b04ae4bfb71cd640c314b79516c5f1303428ed65 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Thu, 25 Sep 2025 23:46:41 +0200 Subject: [PATCH 0321/3334] [nrf fromtree] bluetooth: host: remove transitional option _BT_LE_ADV_OPT_CONNECTABLE Automatic advertiser resumption is deprecated since Zephyr 4.0 [1]. To maintain the behavior during the deprecation period, internal transitional symbols were introduced to replace the deprecated ones in the implementation: - _BT_LE_ADV_OPT_CONNECTABLE: same option bit as BT_LE_ADV_OPT_CONNECTABLE (deprecated) - _BT_LE_ADV_CONN_ONE_TIME: same option bit as BT_LE_ADV_CONN_ONE_TIME (deprecated) The only option for connectable advertising is now BT_LE_ADV_OPT_CONN, whose value is _BT_LE_ADV_OPT_CONNECTABLE|_BT_LE_ADV_OPT_ONE_TIME. We can substitute BT_LE_ADV_OPT_CONN for _BT_LE_ADV_OPT_CONNECTABLE when testing if an advertising set is connectable. Note: to fix a ClangFormat warning raised by check_compliance.py, this commit also includes a formatting change next to the lines actually edited (subsys/bluetooth/host/id.c:810). [1] Bluetooth: Deprecate adv auto-resume #73395 Signed-off-by: Christophe Dufaza (cherry picked from commit e24d3b92a3a2b016d932d075fad0b2d9e1922f22) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/bluetooth.h | 12 ------------ subsys/bluetooth/host/adv.c | 29 ++++++++++++---------------- subsys/bluetooth/host/id.c | 9 ++++----- 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index a365698d063c..0b27fd8ba137 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -691,18 +691,6 @@ enum bt_le_adv_opt { /** Convenience value when no options are specified. */ BT_LE_ADV_OPT_NONE = 0, - /** - * @internal - * - * Internal access to the deprecated value to maintain the - * implementation of the deprecated feature. - * - * At the end of the deprecation period, ABI will change so - * `BT_LE_ADV_OPT_CONN` is just `BIT(0)`, removing the need for this - * symbol. - */ - _BT_LE_ADV_OPT_CONNECTABLE = BIT(0), - /** * @internal * diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 749495bcb563..a5c923b95b22 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -368,9 +368,8 @@ static bool valid_adv_ext_param(const struct bt_le_adv_param *param) { if (IS_ENABLED(CONFIG_BT_EXT_ADV) && BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) { - if (param->peer && - !(param->options & BT_LE_ADV_OPT_EXT_ADV) && - !(param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { + if (param->peer && !(param->options & BT_LE_ADV_OPT_EXT_ADV) && + !(param->options & BT_LE_ADV_OPT_CONN)) { /* Cannot do directed non-connectable advertising * without extended advertising. */ @@ -410,7 +409,7 @@ static bool valid_adv_ext_param(const struct bt_le_adv_param *param) return false; } - if (!(param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { + if (!(param->options & BT_LE_ADV_OPT_CONN)) { /* * BT Core 4.2 [Vol 2, Part E, 7.8.5] * The Advertising_Interval_Min and Advertising_Interval_Max @@ -453,7 +452,7 @@ static bool valid_adv_param(const struct bt_le_adv_param *param) return false; } - if (param->peer && !(param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { + if (param->peer && !(param->options & BT_LE_ADV_OPT_CONN)) { return false; } @@ -940,7 +939,7 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, bt_addr_le_copy(&adv->target_addr, BT_ADDR_LE_ANY); } - if (param->options & _BT_LE_ADV_OPT_CONNECTABLE) { + if (param->options & BT_LE_ADV_OPT_CONN) { if (dir_adv) { if (param->options & BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY) { set_param.type = BT_HCI_ADV_DIRECT_IND_LOW_DUTY; @@ -979,8 +978,7 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, } } - if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && - (param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && (param->options & BT_LE_ADV_OPT_CONN)) { err = le_adv_start_add_conn(adv, &conn); if (err) { if (err == -ENOMEM && !dir_adv && @@ -1016,8 +1014,7 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, !dir_adv && !(param->options & _BT_LE_ADV_OPT_ONE_TIME)); - atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, - param->options & _BT_LE_ADV_OPT_CONNECTABLE); + atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable); @@ -1125,7 +1122,7 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, cp->scan_req_notify_enable = BT_HCI_LE_ADV_SCAN_REQ_ENABLE; } - if (param->options & _BT_LE_ADV_OPT_CONNECTABLE) { + if (param->options & BT_LE_ADV_OPT_CONN) { props |= BT_HCI_LE_ADV_PROP_CONN; if (!dir_adv && !(param->options & BT_LE_ADV_OPT_EXT_ADV)) { /* When using non-extended adv packets then undirected @@ -1183,8 +1180,7 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, /* Flag only used by bt_le_adv_start API. */ atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); - atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, - param->options & _BT_LE_ADV_OPT_CONNECTABLE); + atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable); @@ -1243,8 +1239,7 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } } - if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && - (param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && (param->options & BT_LE_ADV_OPT_CONN)) { err = le_adv_start_add_conn(adv, &conn); if (err) { if (err == -ENOMEM && !dir_adv && @@ -1398,7 +1393,7 @@ static uint32_t adv_get_options(const struct bt_le_ext_adv *adv) } if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { - options |= _BT_LE_ADV_OPT_CONNECTABLE; + options |= BT_LE_ADV_OPT_CONN; } if (atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { @@ -1578,7 +1573,7 @@ int bt_le_ext_adv_update_param(struct bt_le_ext_adv *adv, /* If params for per adv has been set, do not allow setting * connectable, scanable or use legacy adv */ - if (param->options & _BT_LE_ADV_OPT_CONNECTABLE || + if (param->options & BT_LE_ADV_OPT_CONN || param->options & BT_LE_ADV_OPT_SCANNABLE || !(param->options & BT_LE_ADV_OPT_EXT_ADV) || param->options & BT_LE_ADV_OPT_ANONYMOUS) { diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index a43aaef78f44..0ed84dff7331 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -803,12 +803,11 @@ bool bt_id_adv_random_addr_check(const struct bt_le_adv_param *param) * Explicitly stop it here. */ - if (!(param->options & _BT_LE_ADV_OPT_CONNECTABLE) && - (param->options & BT_LE_ADV_OPT_USE_IDENTITY)) { + if (!(param->options & BT_LE_ADV_OPT_CONN) && + (param->options & BT_LE_ADV_OPT_USE_IDENTITY)) { /* Attempt to set non-connectable NRPA */ return false; - } else if (bt_dev.id_addr[param->id].type == - BT_ADDR_LE_RANDOM && + } else if (bt_dev.id_addr[param->id].type == BT_ADDR_LE_RANDOM && param->id != BT_ID_DEFAULT) { /* Attempt to set connectable, or non-connectable with * identity different than scanner. @@ -1936,7 +1935,7 @@ int bt_id_set_adv_own_addr(struct bt_le_ext_adv *adv, uint32_t options, return 0; } - if (options & _BT_LE_ADV_OPT_CONNECTABLE) { + if (options & BT_LE_ADV_OPT_CONN) { if (dir_adv && (options & BT_LE_ADV_OPT_DIR_ADDR_RPA) && !BT_FEAT_LE_PRIVACY(bt_dev.le.features)) { return -ENOTSUP; From 03241df398d3d63130fc9378d0bb5a82112cd248 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Fri, 26 Sep 2025 00:37:16 +0200 Subject: [PATCH 0322/3334] [nrf fromtree] bluetooth: host: remove transitional option _BT_LE_ADV_OPT_ONE_TIME Automatic advertiser resumption is deprecated since Zephyr 4.0 [1]. To maintain the behavior during the deprecation period, internal transitional symbols were introduced to replace the deprecated ones in the implementation: - _BT_LE_ADV_OPT_CONNECTABLE: same option bit as BT_LE_ADV_OPT_CONNECTABLE (deprecated) - _BT_LE_ADV_CONN_ONE_TIME: same option bit as BT_LE_ADV_CONN_ONE_TIME (deprecated) The only option for connectable advertising is now BT_LE_ADV_OPT_CONN, whose value is _BT_LE_ADV_OPT_CONNECTABLE|_BT_LE_ADV_OPT_ONE_TIME. We can assume _BT_LE_ADV_CONN_ONE_TIME is true for connectable advertisers, and meaningless for non-connectable advertisers. [1] Bluetooth: Deprecate adv auto-resume #73395 Signed-off-by: Christophe Dufaza (cherry picked from commit 5762ff5b5860f279d7f6f1a79301d48f824bdb7c) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/bluetooth.h | 8 -------- subsys/bluetooth/host/adv.c | 22 ++-------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 0b27fd8ba137..8e738d21970d 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -691,14 +691,6 @@ enum bt_le_adv_opt { /** Convenience value when no options are specified. */ BT_LE_ADV_OPT_NONE = 0, - /** - * @internal - * - * Internal access to the deprecated value to maintain - * the implementation of the deprecated feature. - */ - _BT_LE_ADV_OPT_ONE_TIME = BIT(1), - /** * @brief Connectable advertising * diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index a5c923b95b22..6bf3e4ed9517 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -981,11 +981,6 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && (param->options & BT_LE_ADV_OPT_CONN)) { err = le_adv_start_add_conn(adv, &conn); if (err) { - if (err == -ENOMEM && !dir_adv && - !(param->options & _BT_LE_ADV_OPT_ONE_TIME)) { - goto set_adv_state; - } - return err; } } @@ -1010,9 +1005,7 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, bt_conn_unref(conn); } -set_adv_state: - atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, !dir_adv && - !(param->options & _BT_LE_ADV_OPT_ONE_TIME)); + atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); @@ -1242,11 +1235,6 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && (param->options & BT_LE_ADV_OPT_CONN)) { err = le_adv_start_add_conn(adv, &conn); if (err) { - if (err == -ENOMEM && !dir_adv && - !(param->options & _BT_LE_ADV_OPT_ONE_TIME)) { - goto set_adv_state; - } - return err; } } @@ -1271,10 +1259,8 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, bt_conn_unref(conn); } -set_adv_state: /* Flag always set to false by le_ext_adv_param_set */ - atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, !dir_adv && - !(param->options & _BT_LE_ADV_OPT_ONE_TIME)); + atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); return 0; } @@ -1388,10 +1374,6 @@ static uint32_t adv_get_options(const struct bt_le_ext_adv *adv) { uint32_t options = 0; - if (!atomic_test_bit(adv->flags, BT_ADV_PERSIST)) { - options |= _BT_LE_ADV_OPT_ONE_TIME; - } - if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { options |= BT_LE_ADV_OPT_CONN; } From 36ec1c58f8a166b48343b112c2940d89158c4ae6 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Sun, 28 Sep 2025 20:59:23 +0200 Subject: [PATCH 0323/3334] [nrf fromtree] bluetooth: host: do not use freed connection to resume advertising In bt_conn_unref(), if we remove the last reference to the connection, we notify listeners that a connection object has been freed and can be taken, then immediately reuse this freed slot to resume advertising. This behavior is source of errors, and automatic advertiser resumption is publicly deprecated since Zephyr 4.0 [1]. Options and parameters for this behavior have been removed. [1] Bluetooth: Deprecate adv auto-resume #73395 Signed-off-by: Christophe Dufaza (cherry picked from commit b3a4ff01098d63123b71ea82ac959da77e069219) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/conn.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 15dd01fafeac..6702073ce69f 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1497,8 +1497,6 @@ void bt_conn_unref(struct bt_conn *conn) { atomic_val_t old; bool deallocated; - enum bt_conn_type conn_type; - uint8_t conn_role; uint16_t conn_handle; /* Used only if CONFIG_ASSERT and CONFIG_BT_CONN_TX. */ __maybe_unused bool conn_tx_is_pending; @@ -1512,8 +1510,6 @@ void bt_conn_unref(struct bt_conn *conn) * we store its properties of interest before decrementing the ref-count, * then unset the local pointer. */ - conn_type = conn->type; - conn_role = conn->role; conn_handle = conn->handle; #if CONFIG_BT_CONN_TX && CONFIG_ASSERT conn_tx_is_pending = k_work_is_pending(&conn->tx_complete_work); @@ -1541,18 +1537,6 @@ void bt_conn_unref(struct bt_conn *conn) */ k_sem_give(&pending_recycled_events); k_work_submit(&recycled_work); - - /* Use the freed slot to automatically resume LE peripheral advertising. - * - * This behavior is deprecated: - * - 8cfad44: Bluetooth: Deprecate adv auto-resume - * - #72567: Bluetooth: Advertising resume functionality is broken - * - Migration guide to Zephyr v4.0.0, Automatic advertiser resumption is deprecated - */ - if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && conn_type == BT_CONN_TYPE_LE && - conn_role == BT_CONN_ROLE_PERIPHERAL) { - bt_le_adv_resume(); - } } uint8_t bt_conn_index(const struct bt_conn *conn) From c6c0e33ba2d3a2fac877490f4d3c594e8cb4b3fa Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Sun, 28 Sep 2025 21:43:45 +0200 Subject: [PATCH 0324/3334] [nrf fromtree] bluetooth: host: do not resume periodic connectable advertisers Automatic advertiser resumption is publicly deprecated since Zephyr 4.0 [1]. Options and parameters for this behavior have been removed. [1] Bluetooth: Deprecate adv auto-resume #73395 Signed-off-by: Christophe Dufaza (cherry picked from commit 731e581174b509cccce16ba62668694be5f174ac) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/hci_core.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 33306596b2ce..2ba274cd2275 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1497,15 +1497,6 @@ void bt_hci_le_enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt) bt_addr_copy(&conn->le.resp_addr.a, &evt->local_rpa); } - /* if the controller supports, lets advertise for another - * peripheral connection. - * check for connectable advertising state is sufficient as - * this is how this le connection complete for peripheral occurred. - */ - if (BT_LE_STATES_PER_CONN_ADV(bt_dev.le.states)) { - bt_le_adv_resume(); - } - if (IS_ENABLED(CONFIG_BT_EXT_ADV) && !BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) { struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy(); From f6f1ea3c5e1d61d55421dc45ce771ca2df518f3f Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Sun, 28 Sep 2025 22:57:21 +0200 Subject: [PATCH 0325/3334] [nrf fromtree] bluetooth: host: do not attempt to resume terminated advertising sets Automatic advertiser resumption is publicly deprecated since Zephyr 4.0 [1]. Options and parameters for this behavior have been removed. [1] Bluetooth: Deprecate adv auto-resume #73395 Signed-off-by: Christophe Dufaza (cherry picked from commit 9b5ad2f8df485a51e55789e949428fd8d679bec6) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/adv.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 6bf3e4ed9517..d76e6bb69e50 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -2249,13 +2249,7 @@ void bt_hci_le_adv_set_terminated(struct net_buf *buf) } if (adv == bt_dev.adv) { - if (atomic_test_bit(adv->flags, BT_ADV_PERSIST)) { -#if defined(CONFIG_BT_PERIPHERAL) - bt_le_adv_resume(); -#endif - } else { - bt_le_adv_delete_legacy(); - } + bt_le_adv_delete_legacy(); } } From ef041b051e3429a32b7098fc838a02d694f38e79 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Sun, 28 Sep 2025 23:50:05 +0200 Subject: [PATCH 0326/3334] [nrf fromtree] bluetooth: host: remove no longer used internal API bt_le_adv_resume() Automatic advertiser resumption is publicly deprecated since Zephyr 4.0 [1]. Options and parameters for this behavior have been removed, as well as all calls to bt_le_adv_resume(). Also remove adv_get_options() whose bt_le_adv_resume() is the only caller. [1] Bluetooth: Deprecate adv auto-resume #73395 Signed-off-by: Christophe Dufaza (cherry picked from commit a1dd571f11df3d7c973a3a63ef44e715a6945deb) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/adv.c | 83 ------------------------------------- subsys/bluetooth/host/adv.h | 2 - 2 files changed, 85 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index d76e6bb69e50..0b79ffc9d168 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1369,89 +1369,6 @@ int bt_le_adv_stop(void) return 0; } -#if defined(CONFIG_BT_PERIPHERAL) -static uint32_t adv_get_options(const struct bt_le_ext_adv *adv) -{ - uint32_t options = 0; - - if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { - options |= BT_LE_ADV_OPT_CONN; - } - - if (atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { - options |= BT_LE_ADV_OPT_USE_IDENTITY; - } - - return options; -} - -void bt_le_adv_resume(void) -{ - struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy(); - struct bt_conn *conn; - bool persist_paused = false; - int err; - - if (!adv) { - LOG_DBG("No valid legacy adv to resume"); - return; - } - - if (!(atomic_test_bit(adv->flags, BT_ADV_PERSIST) && - !atomic_test_bit(adv->flags, BT_ADV_ENABLED))) { - return; - } - - if (!atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { - return; - } - - err = le_adv_start_add_conn(adv, &conn); - if (err) { - LOG_ERR("Host cannot resume connectable advertising (%d)", err); - return; - } - - LOG_DBG("Resuming connectable advertising"); - - if (IS_ENABLED(CONFIG_BT_PRIVACY) && - !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { - bt_id_set_adv_private_addr(adv); - } else { - uint8_t own_addr_type; - bool dir_adv = adv_is_directed(adv); - uint32_t options = adv_get_options(adv); - - /* Always set the address. Don't assume it has not changed. */ - err = bt_id_set_adv_own_addr(adv, options, dir_adv, &own_addr_type); - if (err) { - LOG_ERR("Controller cannot resume connectable advertising (%d)", err); - return; - } - } - - err = bt_le_adv_set_enable(adv, true); - if (err) { - LOG_ERR("Controller cannot resume connectable advertising (%d)", err); - bt_conn_set_state(conn, BT_CONN_DISCONNECTED); - - /* Temporarily clear persist flag to avoid recursion in - * bt_conn_unref if the flag is still set. - */ - persist_paused = atomic_test_and_clear_bit(adv->flags, - BT_ADV_PERSIST); - } - - /* Since we don't give the application a reference to manage in - * this case, we need to release this reference here. - */ - bt_conn_unref(conn); - if (persist_paused) { - atomic_set_bit(adv->flags, BT_ADV_PERSIST); - } -} -#endif /* defined(CONFIG_BT_PERIPHERAL) */ - #if defined(CONFIG_BT_EXT_ADV) int bt_le_ext_adv_get_info(const struct bt_le_ext_adv *adv, struct bt_le_ext_adv_info *info) diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index 65ad51135ce0..6cc950fe8e7f 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -9,8 +9,6 @@ #include -void bt_le_adv_resume(void); - struct bt_le_ext_adv *bt_le_adv_lookup_legacy(void); void bt_le_adv_delete_legacy(void); From 7bd6ca378acd5fb89c93961a1ff9d53fe931cea2 Mon Sep 17 00:00:00 2001 From: Christophe Dufaza Date: Mon, 29 Sep 2025 00:18:35 +0200 Subject: [PATCH 0327/3334] [nrf fromtree] bluetooth: host: remove useless internal flag BT_ADV_PERSIST Automatic advertiser resumption is publicly deprecated since Zephyr 4.0 [1]. Options and parameters for this behavior have been removed, and the internal bit flag BT_ADV_PERSIST is now always false. The behavior it used to configure (to keep advertising after a connection has been established as long as there are connections available) has also been removed. [1] Bluetooth: Deprecate adv auto-resume #73395 Signed-off-by: Christophe Dufaza (cherry picked from commit 60c3de272264a1f9ce03ad681de8a8b0b7d4a317) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/adv.c | 15 --------------- subsys/bluetooth/host/hci_core.c | 5 +---- subsys/bluetooth/host/hci_core.h | 4 ---- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 0b79ffc9d168..bdf74f47aa84 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1005,8 +1005,6 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, bt_conn_unref(conn); } - atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); - atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable); @@ -1170,9 +1168,6 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, } } - /* Flag only used by bt_le_adv_start API. */ - atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); - atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable); @@ -1259,9 +1254,6 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, bt_conn_unref(conn); } - /* Flag always set to false by le_ext_adv_param_set */ - atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); - return 0; } @@ -1318,11 +1310,6 @@ int bt_le_adv_stop(void) (void)bt_le_lim_adv_cancel_timeout(adv); - /* Make sure advertising is not re-enabled later even if it's not - * currently enabled (i.e. BT_DEV_ADVERTISING is not set). - */ - atomic_clear_bit(adv->flags, BT_ADV_PERSIST); - if (!atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { /* Legacy advertiser exists, but is not currently advertising. * This happens when keep advertising behavior is active but @@ -1562,8 +1549,6 @@ int bt_le_ext_adv_stop(struct bt_le_ext_adv *adv) (void)bt_le_lim_adv_cancel_timeout(adv); - atomic_clear_bit(adv->flags, BT_ADV_PERSIST); - if (!atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { return 0; } diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 2ba274cd2275..274c202d800a 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1499,13 +1499,10 @@ void bt_hci_le_enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt) if (IS_ENABLED(CONFIG_BT_EXT_ADV) && !BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) { - struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy(); /* No advertising set terminated event, must be a * legacy advertiser set. */ - if (!atomic_test_bit(adv->flags, BT_ADV_PERSIST)) { - bt_le_adv_delete_legacy(); - } + bt_le_adv_delete_legacy(); } } diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 315db2d38884..3d1c87cb3c0b 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -140,10 +140,6 @@ enum { * the identity address instead. */ BT_ADV_USE_IDENTITY, - /* Advertiser has been configured to keep advertising after a connection - * has been established as long as there are connections available. - */ - BT_ADV_PERSIST, /* Advertiser has been temporarily disabled. */ BT_ADV_PAUSED, /* Periodic Advertising has been enabled in the controller. */ From 699429b4d78c61c769adea98b471609abefd298a Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Mon, 13 Oct 2025 09:58:00 +0200 Subject: [PATCH 0328/3334] [nrf fromtree] Bluetooth: Host: bt_iso_reset before bt_conn_cleanup_all Move the call to bt_iso_reset to before bt_conn_cleanup_all. The reason for this is that bt_conn_cleanup_all will disconnect all the ACL connections, which will put the CIS in a disconnecting state, without finalizing them. This means that if we get a num_completed_packet event between the call to bt_conn_cleanup_all and before the BT_HCI_OP_RESET request has been completed, we will trigger an assert in the hci_num_completed_packets function as the CIS still exists, but where we would already have cleaned up the pending TX without telling the controller. Moving the call to bt_iso_reset means that the CIS will have been fully terminated at this point, which will prevent the assert from happening. Since CIS depends on ACLs, this is also the logical order for resetting them. Signed-off-by: Emil Gydesen (cherry picked from commit 0ebe84cc5aed09d44303488859bda7a8535058e5) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/hci_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 274c202d800a..29a7f5d30ebf 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4650,6 +4650,10 @@ int bt_disable(void) bt_periodic_sync_disable(); #endif /* CONFIG_BT_PER_ADV_SYNC */ + if (IS_ENABLED(CONFIG_BT_ISO)) { + bt_iso_reset(); + } + #if defined(CONFIG_BT_CONN) if (IS_ENABLED(CONFIG_BT_SMP)) { bt_pub_key_hci_disrupted(); @@ -4704,10 +4708,6 @@ int bt_disable(void) /* 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(); - } - bt_monitor_send(BT_MONITOR_CLOSE_INDEX, NULL, 0); /* Clear BT_DEV_ENABLE here to prevent early bt_enable() calls, before disable is From c8843dc5627dd65ed91597fd5f0f8fc0bc1c23e2 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Mon, 13 Oct 2025 16:15:20 +0200 Subject: [PATCH 0329/3334] [nrf fromtree] Bluetooth: Mesh: Provisioner closes link on failed According to MshPrt 5.4.4, The Provisioner, upon receiving the Provisioning Failed PDU, shall assume that the provisioning failed and immediately disconnect the provisioning bearer. Signed-off-by: Ludvig Jordet (cherry picked from commit 1c6f98aaf2580c3162dac75162fa3dcd6a19d073) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/mesh/provisioner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/provisioner.c b/subsys/bluetooth/mesh/provisioner.c index b1df6431d068..353cde6b673a 100644 --- a/subsys/bluetooth/mesh/provisioner.c +++ b/subsys/bluetooth/mesh/provisioner.c @@ -685,7 +685,7 @@ static void prov_confirm(const uint8_t *data) static void prov_failed(const uint8_t *data) { LOG_WRN("Error: 0x%02x", data[0]); - reset_state(); + prov_link_close(PROV_BEARER_LINK_STATUS_FAIL); } static void local_input_complete(void) From a3da8729e24a060f2317e32484c8c6ff9fe855c8 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Tue, 14 Oct 2025 09:46:14 +0200 Subject: [PATCH 0330/3334] [nrf fromtree] Bluetooth: Mesh: Minor cleanup of prov link close on success Changes the link close upon success to use the `prov_link_close` helper function instead of doing it manually, as minor cleanup. Signed-off-by: Ludvig Jordet (cherry picked from commit f998357015c991cc11344d25b9147acc1502eeb9) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/mesh/provisioner.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/provisioner.c b/subsys/bluetooth/mesh/provisioner.c index 353cde6b673a..28372caf4554 100644 --- a/subsys/bluetooth/mesh/provisioner.c +++ b/subsys/bluetooth/mesh/provisioner.c @@ -577,10 +577,9 @@ static void prov_complete(const uint8_t *data) bt_hex(&provisionee.new_dev_key, 16), node->net_idx, node->num_elem, node->addr); - bt_mesh_prov_link.expect = PROV_NO_PDU; atomic_set_bit(bt_mesh_prov_link.flags, COMPLETE); - bt_mesh_prov_link.bearer->link_close(PROV_BEARER_LINK_STATUS_SUCCESS); + prov_link_close(PROV_BEARER_LINK_STATUS_SUCCESS); } static void prov_node_add(void) From 9bbab4ead9fc50171aaf0a5b7c3adf3d9707b9db Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Wed, 15 Oct 2025 12:49:57 +0200 Subject: [PATCH 0331/3334] [nrf fromtree] bluetooth: mesh: Fix build without settings under asan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Mesh is built without CONFIG_BT_SETTINGS and with CONFIG_ASAN (and CONFIG_NO_OPTIMIZATION), the call to bt_mesh_settings_set is not optimized out. Since settings.c isn’t compiled when CONFIG_BT_SETTINGS is disabled, the linker reports an undefined reference. Guard the call with !IS_ENABLED(CONFIG_BT_SETTINGS) so the call and the subsequent code is compiled out when settings are disabled. Signed-off-by: Pavel Vasilyev (cherry picked from commit a360ff7cc31333aaaf72a9bcaba2d4904bf2b782) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/mesh/app_keys.c | 4 ++++ subsys/bluetooth/mesh/brg_cfg.c | 4 ++++ subsys/bluetooth/mesh/cdb.c | 16 ++++++++++++++++ subsys/bluetooth/mesh/cfg.c | 4 ++++ subsys/bluetooth/mesh/heartbeat.c | 4 ++++ subsys/bluetooth/mesh/net.c | 16 ++++++++++++++++ subsys/bluetooth/mesh/rpl.c | 4 ++++ subsys/bluetooth/mesh/solicitation.c | 8 ++++++++ subsys/bluetooth/mesh/subnet.c | 4 ++++ subsys/bluetooth/mesh/va.c | 4 ++++ 10 files changed, 68 insertions(+) diff --git a/subsys/bluetooth/mesh/app_keys.c b/subsys/bluetooth/mesh/app_keys.c index 5afd887a8e80..f573add5a324 100644 --- a/subsys/bluetooth/mesh/app_keys.c +++ b/subsys/bluetooth/mesh/app_keys.c @@ -666,6 +666,10 @@ static int app_key_set(const char *name, size_t len_rd, uint16_t app_idx; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; diff --git a/subsys/bluetooth/mesh/brg_cfg.c b/subsys/bluetooth/mesh/brg_cfg.c index 58d1aada550d..d0bdaef7f05e 100644 --- a/subsys/bluetooth/mesh/brg_cfg.c +++ b/subsys/bluetooth/mesh/brg_cfg.c @@ -52,6 +52,10 @@ static int brg_en_set(const char *name, size_t len_rd, settings_read_cb read_cb, { int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (len_rd == 0) { brg_enabled = 0; LOG_DBG("Cleared bridge enable state"); diff --git a/subsys/bluetooth/mesh/cdb.c b/subsys/bluetooth/mesh/cdb.c index 310108d7b756..dc2725a7a327 100644 --- a/subsys/bluetooth/mesh/cdb.c +++ b/subsys/bluetooth/mesh/cdb.c @@ -180,6 +180,10 @@ static int cdb_net_set(const char *name, size_t len_rd, struct net_val net; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (len_rd == 0) { LOG_DBG("val (null)"); return 0; @@ -219,6 +223,10 @@ static int cdb_node_set(const char *name, size_t len_rd, uint16_t addr; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; @@ -281,6 +289,10 @@ static int cdb_subnet_set(const char *name, size_t len_rd, uint16_t net_idx; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; @@ -347,6 +359,10 @@ static int cdb_app_key_set(const char *name, size_t len_rd, uint16_t app_idx; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; diff --git a/subsys/bluetooth/mesh/cfg.c b/subsys/bluetooth/mesh/cfg.c index 155c2e616d55..e5563b95c3c1 100644 --- a/subsys/bluetooth/mesh/cfg.c +++ b/subsys/bluetooth/mesh/cfg.c @@ -429,6 +429,10 @@ static int cfg_set(const char *name, size_t len_rd, struct cfg_val cfg; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (len_rd == 0) { LOG_DBG("Cleared configuration state"); return 0; diff --git a/subsys/bluetooth/mesh/heartbeat.c b/subsys/bluetooth/mesh/heartbeat.c index 133c552620f5..0ad4828279c2 100644 --- a/subsys/bluetooth/mesh/heartbeat.c +++ b/subsys/bluetooth/mesh/heartbeat.c @@ -416,6 +416,10 @@ static int hb_pub_set(const char *name, size_t len_rd, struct hb_pub_val hb_val; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + err = bt_mesh_settings_set(read_cb, cb_arg, &hb_val, sizeof(hb_val)); if (err) { LOG_ERR("Failed to set \'hb_val\'"); diff --git a/subsys/bluetooth/mesh/net.c b/subsys/bluetooth/mesh/net.c index 276728bd9a45..b2e1cc695f94 100644 --- a/subsys/bluetooth/mesh/net.c +++ b/subsys/bluetooth/mesh/net.c @@ -1005,6 +1005,10 @@ static int net_set(const char *name, size_t len_rd, settings_read_cb read_cb, struct bt_mesh_key key; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (len_rd == 0) { LOG_DBG("val (null)"); @@ -1042,6 +1046,10 @@ static int iv_set(const char *name, size_t len_rd, settings_read_cb read_cb, struct iv_val iv; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (len_rd == 0) { LOG_DBG("IV deleted"); @@ -1074,6 +1082,10 @@ static int seq_set(const char *name, size_t len_rd, settings_read_cb read_cb, struct seq_val seq; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (len_rd == 0) { LOG_DBG("val (null)"); @@ -1113,6 +1125,10 @@ static int dev_key_cand_set(const char *name, size_t len_rd, settings_read_cb re int err; struct bt_mesh_key key; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (len_rd == 0) { LOG_DBG("val (null)"); diff --git a/subsys/bluetooth/mesh/rpl.c b/subsys/bluetooth/mesh/rpl.c index 581c94771c81..7c9317fcc94c 100644 --- a/subsys/bluetooth/mesh/rpl.c +++ b/subsys/bluetooth/mesh/rpl.c @@ -272,6 +272,10 @@ static int rpl_set(const char *name, size_t len_rd, int err; uint16_t src; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; diff --git a/subsys/bluetooth/mesh/solicitation.c b/subsys/bluetooth/mesh/solicitation.c index a2872daecb03..2d863dc57dc5 100644 --- a/subsys/bluetooth/mesh/solicitation.c +++ b/subsys/bluetooth/mesh/solicitation.c @@ -120,6 +120,10 @@ static int sseq_set(const char *name, size_t len_rd, { int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + err = bt_mesh_settings_set(read_cb, cb_arg, &sseq_out, sizeof(sseq_out)); if (err) { LOG_ERR("Failed to set \'sseq\'"); @@ -365,6 +369,10 @@ static int srpl_set(const char *name, size_t len_rd, } } + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + err = bt_mesh_settings_set(read_cb, cb_arg, &sseq, sizeof(sseq)); if (err) { LOG_ERR("Failed to set \'sseq\'"); diff --git a/subsys/bluetooth/mesh/subnet.c b/subsys/bluetooth/mesh/subnet.c index b17b9a497400..7f2943365976 100644 --- a/subsys/bluetooth/mesh/subnet.c +++ b/subsys/bluetooth/mesh/subnet.c @@ -971,6 +971,10 @@ static int net_key_set(const char *name, size_t len_rd, int err; uint16_t net_idx; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; diff --git a/subsys/bluetooth/mesh/va.c b/subsys/bluetooth/mesh/va.c index fb81f36251cf..0b83e93e1c8d 100644 --- a/subsys/bluetooth/mesh/va.c +++ b/subsys/bluetooth/mesh/va.c @@ -219,6 +219,10 @@ static int va_set(const char *name, size_t len_rd, uint16_t index; int err; + if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { + return 0; + } + if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; From c386832bef8326208c1d3b74e0a1ae661d6f39c1 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Wed, 15 Oct 2025 10:59:22 +0200 Subject: [PATCH 0332/3334] [nrf fromtree] Bluetooth: Mesh: Filter duplicates in brg subnets list This commit adds functionality to filter out duplicate entries in the Bridged Subnets List message. This is done by iterating through the part of the table we have already processed, to check if this is the first time we see a given key pair or not. Signed-off-by: Ludvig Jordet (cherry picked from commit cc8ac6bdee0bd58248ab877cce69475fa52ebc42) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/mesh/brg_cfg_srv.c | 64 +++++++++-------------------- 1 file changed, 19 insertions(+), 45 deletions(-) diff --git a/subsys/bluetooth/mesh/brg_cfg_srv.c b/subsys/bluetooth/mesh/brg_cfg_srv.c index d622ebf48a25..0d0bda534b66 100644 --- a/subsys/bluetooth/mesh/brg_cfg_srv.c +++ b/subsys/bluetooth/mesh/brg_cfg_srv.c @@ -145,60 +145,34 @@ static int bridged_subnets_get(const struct bt_mesh_model *model, struct bt_mesh net_buf_simple_add_le16(&msg, net_idx_filter); net_buf_simple_add_u8(&msg, start_id); - uint8_t cnt = 0; - uint16_t net_idx1, net_idx2; - for (int i = 0; i < rows; i++) { - net_idx1 = brg_tbl[i].net_idx1; - net_idx2 = brg_tbl[i].net_idx2; + uint16_t net_idx1 = brg_tbl[i].net_idx1; + uint16_t net_idx2 = brg_tbl[i].net_idx2; + bool is_first_instance; if (net_buf_simple_tailroom(&msg) < 3 + BT_MESH_MIC_SHORT) { break; } - switch (filter_net_idx.filter) { - /* Report pair of NetKeys from the table, starting from start_id. */ - case 0: - if (i >= start_id) { - key_idx_pack_pair(&msg, net_idx1, net_idx2); + is_first_instance = true; + for (int j = 0; j < i; j++) { + if (net_idx1 == brg_tbl[j].net_idx1 && net_idx2 == brg_tbl[j].net_idx2) { + is_first_instance = false; + break; } - break; - - /* Report pair of NetKeys in which (NetKeyIndex1) matches the net_idx */ - case 1: - if (net_idx1 == filter_net_idx.net_idx) { - if (cnt >= start_id) { - key_idx_pack_pair(&msg, net_idx1, net_idx2); - } - cnt++; - } - break; - - /* Report pair of NetKeys in which (NetKeyIndex2) matches the net_idx */ - case 2: - if (net_idx2 == filter_net_idx.net_idx) { - if (cnt >= start_id) { - key_idx_pack_pair(&msg, net_idx1, net_idx2); - } - cnt++; - } - break; + } - /* Report pair of NetKeys in which (NetKeyIndex1 or NetKeyIndex2) matches the - * net_idx - */ - case 3: - if (net_idx1 == filter_net_idx.net_idx || - net_idx2 == filter_net_idx.net_idx) { - if (cnt >= start_id) { - key_idx_pack_pair(&msg, net_idx1, net_idx2); - } - cnt++; + if (is_first_instance && + (filter_net_idx.filter == 0 || + (filter_net_idx.filter == 1 && net_idx1 == filter_net_idx.net_idx) || + (filter_net_idx.filter == 2 && net_idx2 == filter_net_idx.net_idx) || + (filter_net_idx.filter == 3 && (net_idx1 == filter_net_idx.net_idx || + net_idx2 == filter_net_idx.net_idx)))) { + if (start_id > 0) { + start_id--; + } else { + key_idx_pack_pair(&msg, net_idx1, net_idx2); } - break; - - default: - CODE_UNREACHABLE; } } From 2f15eba8803812a08fdf7f326a531c1f7abd3f61 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 20 Oct 2025 13:36:39 +0300 Subject: [PATCH 0333/3334] [nrf fromtree] Bluetooth: Host: Make use of common array helper macros There's a bunch of convenience macros in sys/util.h that are intended to help out with translating array indices and determining if an element is part of an array or not. Use those instead of custom code. Signed-off-by: Johan Hedberg (cherry picked from commit 0fd8af97fbeab36159c732ae09d33d987d635197) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/adv.c | 6 ++---- subsys/bluetooth/host/conn.c | 15 ++++++--------- subsys/bluetooth/host/scan.c | 7 +++---- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index bdf74f47aa84..6841f0646012 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -187,11 +187,9 @@ static struct bt_le_ext_adv adv_pool[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; #if defined(CONFIG_BT_EXT_ADV) uint8_t bt_le_ext_adv_get_index(struct bt_le_ext_adv *adv) { - ptrdiff_t index = adv - adv_pool; + __ASSERT(IS_ARRAY_ELEMENT(adv_pool, adv), "Invalid bt_adv pointer"); - __ASSERT(index >= 0 && index < ARRAY_SIZE(adv_pool), - "Invalid bt_adv pointer"); - return (uint8_t)index; + return (uint8_t)ARRAY_INDEX(adv_pool, adv); } static struct bt_le_ext_adv *adv_new(void) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 6702073ce69f..9c6bb386f6c1 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1546,23 +1546,20 @@ uint8_t bt_conn_index(const struct bt_conn *conn) switch (conn->type) { #if defined(CONFIG_BT_ISO) case BT_CONN_TYPE_ISO: - index = conn - iso_conns; - __ASSERT(index >= 0 && index < ARRAY_SIZE(iso_conns), - "Invalid bt_conn pointer"); + __ASSERT(IS_ARRAY_ELEMENT(iso_conns, conn), "Invalid bt_conn pointer"); + index = ARRAY_INDEX(iso_conns, conn); break; #endif #if defined(CONFIG_BT_CLASSIC) case BT_CONN_TYPE_SCO: - index = conn - sco_conns; - __ASSERT(index >= 0 && index < ARRAY_SIZE(sco_conns), - "Invalid bt_conn pointer"); + __ASSERT(IS_ARRAY_ELEMENT(sco_conns, conn), "Invalid bt_conn pointer"); + index = ARRAY_INDEX(sco_conns, conn); break; #endif default: #if defined(CONFIG_BT_CONN) - index = conn - acl_conns; - __ASSERT(index >= 0 && index < ARRAY_SIZE(acl_conns), - "Invalid bt_conn pointer"); + __ASSERT(IS_ARRAY_ELEMENT(acl_conns, conn), "Invalid bt_conn pointer"); + index = ARRAY_INDEX(acl_conns, conn); #else __ASSERT(false, "Invalid connection type %u", conn->type); #endif /* CONFIG_BT_CONN */ diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index b154729438a0..bffc5fd907f2 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -1841,11 +1841,10 @@ void bt_le_scan_cb_unregister(struct bt_le_scan_cb *cb) #if defined(CONFIG_BT_PER_ADV_SYNC) uint8_t bt_le_per_adv_sync_get_index(struct bt_le_per_adv_sync *per_adv_sync) { - ptrdiff_t index = per_adv_sync - per_adv_sync_pool; - - __ASSERT(index >= 0 && ARRAY_SIZE(per_adv_sync_pool) > index, + __ASSERT(IS_ARRAY_ELEMENT(per_adv_sync_pool, per_adv_sync), "Invalid per_adv_sync pointer"); - return (uint8_t)index; + + return (uint8_t)ARRAY_INDEX(per_adv_sync_pool, per_adv_sync); } struct bt_le_per_adv_sync *bt_le_per_adv_sync_lookup_index(uint8_t index) From 5ca99382d97dc15596e7a22ebe22380e0c193b4c Mon Sep 17 00:00:00 2001 From: Lingao Meng Date: Tue, 21 Oct 2025 16:29:10 +0800 Subject: [PATCH 0334/3334] [nrf fromtree] Bluetooth: Host: Fix unnecessary random address update The `bt_le_ext_adv_update_param` will set new random address when option not select `BT_LE_ADV_OPT_USE_IDENTITY`, But `bt_le_ext_adv_start` will also set random address again. This will be affect bluetooth mesh, after this change, will ensure address only change once for every advertising. Signed-off-by: Lingao Meng (cherry picked from commit f902f2ab0d24fab4a98536e422258522191132b7) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/adv.c | 9 +++++++-- subsys/bluetooth/host/hci_core.h | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 6841f0646012..77dc28345987 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1176,6 +1176,9 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, atomic_set_bit_to(adv->flags, BT_ADV_EXT_ADV, param->options & BT_LE_ADV_OPT_EXT_ADV); + atomic_set_bit_to(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED, + own_addr_type == BT_HCI_OWN_ADDR_RANDOM); + return 0; } @@ -1505,11 +1508,13 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { if (IS_ENABLED(CONFIG_BT_PRIVACY) && - !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { + !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && + !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) { bt_id_set_adv_private_addr(adv); } } else { - if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { + if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && + !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) { bt_id_set_adv_private_addr(adv); } } diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 3d1c87cb3c0b..e4a390af20aa 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -116,6 +116,10 @@ enum { BT_ADV_PARAMS_SET, /* Advertising data has been set in the controller. */ BT_ADV_DATA_SET, + /* Advertising random address has been updated in the controller before + * enabling advertising. + */ + BT_ADV_RANDOM_ADDR_UPDATED, /* Advertising random address pending to be set in the controller. */ BT_ADV_RANDOM_ADDR_PENDING, /* The private random address of the advertiser is valid for this cycle From 008c0fdfc893866172bfd5898cab5012347b6735 Mon Sep 17 00:00:00 2001 From: Lingao Meng Date: Thu, 23 Oct 2025 11:27:22 +0800 Subject: [PATCH 0335/3334] [nrf fromtree] Bluetooth: Host: Fix Periodic Advertising random address update update random address when periodic adv enabled. Signed-off-by: Lingao Meng (cherry picked from commit d59cd2e368bb4e3bea78fb3fe40c7866db67f74c) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/adv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 77dc28345987..ec339bd6f60c 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1509,12 +1509,14 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { if (IS_ENABLED(CONFIG_BT_PRIVACY) && !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) { + (atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || + !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) { bt_id_set_adv_private_addr(adv); } } else { if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) { + (atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || + !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) { bt_id_set_adv_private_addr(adv); } } From a983f57d53dd0b78fe06d61e99d3f608a87596f5 Mon Sep 17 00:00:00 2001 From: Lingao Meng Date: Thu, 23 Oct 2025 18:51:02 +0800 Subject: [PATCH 0336/3334] [nrf fromtree] tests: bluetooth: audio: fix bsim timing move extending advertising start after periodic adv. Signed-off-by: Lingao Meng (cherry picked from commit bed07a5ebfba4eb17e445032026ac01952c01829) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/adv.c | 8 ++++---- tests/bsim/bluetooth/audio/src/common.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index ec339bd6f60c..98d3fe15061d 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1509,14 +1509,14 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { if (IS_ENABLED(CONFIG_BT_PRIVACY) && !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - (atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || - !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) { + (!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED) || + atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED))) { bt_id_set_adv_private_addr(adv); } } else { if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - (atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || - !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) { + (!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED) || + atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED))) { bt_id_set_adv_private_addr(adv); } } diff --git a/tests/bsim/bluetooth/audio/src/common.c b/tests/bsim/bluetooth/audio/src/common.c index 29e8c5cc2379..d09bcacd3797 100644 --- a/tests/bsim/bluetooth/audio/src/common.c +++ b/tests/bsim/bluetooth/audio/src/common.c @@ -264,20 +264,20 @@ void start_broadcast_adv(struct bt_le_ext_adv *adv) return; } - if (info.ext_adv_state == BT_LE_EXT_ADV_STATE_DISABLED) { - /* Start extended advertising */ - err = bt_le_ext_adv_start(adv, BT_LE_EXT_ADV_START_DEFAULT); + if (info.per_adv_state == BT_LE_PER_ADV_STATE_DISABLED) { + /* Enable Periodic Advertising */ + err = bt_le_per_adv_start(adv); if (err != 0) { - FAIL("Failed to start extended advertising: %d\n", err); + FAIL("Failed to enable periodic advertising: %d\n", err); return; } } - if (info.per_adv_state == BT_LE_PER_ADV_STATE_DISABLED) { - /* Enable Periodic Advertising */ - err = bt_le_per_adv_start(adv); + if (info.ext_adv_state == BT_LE_EXT_ADV_STATE_DISABLED) { + /* Start extended advertising */ + err = bt_le_ext_adv_start(adv, BT_LE_EXT_ADV_START_DEFAULT); if (err != 0) { - FAIL("Failed to enable periodic advertising: %d\n", err); + FAIL("Failed to start extended advertising: %d\n", err); return; } } From 824beb359eb511b79e76aa0abfc9b2bba1e90285 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Thu, 23 Oct 2025 15:09:30 +0200 Subject: [PATCH 0337/3334] [nrf fromtree] bluetooth: mesh: adv_ext: Fix scheduling with multiple relay adv sets When multiple relay adv sets are used, the bt_mesh_adv_send function calls bt_mesh_adv_relay_ready which should distribute relayed advertisements across all relay adv sets. Until the submitted relay adv set work is started, the ADV_FLAG_ACTIVE is not set. Therefore, next call to bt_mesh_adv_send will try to re-submit the same relay adv set work, instead of picking up another relay set which is actually free and ready to send an advertisement. This commit adds a check that checks if the adv set work is already pending to be executed. And if so, schedule_send returns false to make bt_mesh_adv_relay_ready pick next relay adv set. This shouldn't brake advertising because once adv set is done transmitting advertisment, it will pick up a next one. The ADV_FLAG_PROXY check is added to do re-submit for adv set which was used for proxy advertisement since we need to prioritize mesh messages over proxy advertisements when those are running on the same adv set. Signed-off-by: Pavel Vasilyev (cherry picked from commit 1a4f113d144b4d929614c434fad2775c917cfd28) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/mesh/adv_ext.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index b056f74a5876..0ff0bc5e9fe7 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -391,6 +391,16 @@ static bool schedule_send(struct bt_mesh_ext_adv *ext_adv) if (!atomic_test_bit(ext_adv->flags, ADV_FLAG_PROXY)) { return false; } + } else if (k_work_is_pending(&ext_adv->work) && + !atomic_test_bit(ext_adv->flags, ADV_FLAG_PROXY)) { + /* This can happen if we try to schedule a send while a previous send is still + * pending in the work queue. There is nothing wrong with resubmitting the same + * work to the work queue, but in this case won't have a change to try a work from + * another advertising set which can be ready for sending. + * + * If, however, ADV_FLAG_PROXY is set, we want to stop the proxy advertising. + */ + return false; } bt_mesh_wq_submit(&ext_adv->work); From 13430117590222f30b58d697ffbc53183203c900 Mon Sep 17 00:00:00 2001 From: Guotao Zhang Date: Tue, 28 Oct 2025 13:05:51 +0100 Subject: [PATCH 0338/3334] [nrf fromtree] drivers: bluetooth: h4: Fix check for sufficient buffer size When alloc the evt buffer,such as the adv report, only compare the remaining data len, should aslo consider the hdr_len, because the hdr also copy to alloced buffer.if not consider the hdr, then hdr + remaining data may larger than alloced buffer, because the alloced buffer is not enough,then will assert when receive the remaining data. Signed-off-by: Guotao Zhang (cherry picked from commit ec970a635ea92a4307d30c122c2c89109f989055) Signed-off-by: Pavel Vasilyev --- drivers/bluetooth/hci/h4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci/h4.c b/drivers/bluetooth/hci/h4.c index cfea346a946c..21be2213fb87 100644 --- a/drivers/bluetooth/hci/h4.c +++ b/drivers/bluetooth/hci/h4.c @@ -338,7 +338,7 @@ static inline void read_payload(const struct device *dev) LOG_DBG("Allocated rx.buf %p", h4->rx.buf); buf_tailroom = net_buf_tailroom(h4->rx.buf); - if (buf_tailroom < h4->rx.remaining) { + if (buf_tailroom < (h4->rx.remaining + h4->rx.hdr_len)) { LOG_ERR("Not enough space in buffer %u/%zu", h4->rx.remaining, buf_tailroom); h4->rx.discard = h4->rx.remaining; From abd7a1ac72e4a21a2c882d0810ecc8001fead0aa Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 28 Oct 2025 14:19:13 +0100 Subject: [PATCH 0339/3334] [nrf fromtree] Bluetooth: Host: Fix crash on bt_disable() with limited advertising When limited advertising is enabled there is pending deleyable work for timing it out. If in such case struct bt_le_ext_adv is cleared by memset system will crash on next tick. Fix this by ensuring work is cancelled before clearing struct bt_le_ext_adv. Using bt_le_ext_adv_foreach() ensures that this will be correctly handled with and without extended advertising enabled. Signed-off-by: Szymon Janc (cherry picked from commit 973934c1e975ee7381c6599895f6dd7b610aee0a) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/adv.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 98d3fe15061d..e4ad43bea565 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -34,6 +34,7 @@ #include "hci_core.h" #include "id.h" #include "scan.h" +#include "adv.h" #define LOG_LEVEL CONFIG_BT_HCI_CORE_LOG_LEVEL LOG_MODULE_REGISTER(bt_adv); @@ -247,12 +248,15 @@ void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), #endif /* defined(CONFIG_BT_EXT_ADV) */ } -void bt_adv_reset_adv_pool(void) +static void clear_ext_adv_instance(struct bt_le_ext_adv *adv, void *data) { -#if defined(CONFIG_BT_EXT_ADV) - (void)memset(&adv_pool, 0, sizeof(adv_pool)); -#endif /* defined(CONFIG_BT_EXT_ADV) */ + bt_le_lim_adv_cancel_timeout(adv); + memset(adv, 0, sizeof(*adv)); +} +void bt_adv_reset_adv_pool(void) +{ + bt_le_ext_adv_foreach(clear_ext_adv_instance, NULL); (void)memset(&bt_dev.adv, 0, sizeof(bt_dev.adv)); } From fecbc5eb47a5d2d24e3b2f9e6ad7b8f11ab80dce Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 28 Oct 2025 09:50:51 +0100 Subject: [PATCH 0340/3334] [nrf fromtree] Bluetooth: Mesh: Fix invalid write in private beacon server There is no guarantess enum will be packed so passing uint8_t as node_id to bt_mesh_subnet_priv_node_id_get() could (and likely will) result in writing past stack variable. Signed-off-by: Szymon Janc (cherry picked from commit 4571485e16ccb4bf5821df09752179b16eecccc1) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/mesh/priv_beacon_srv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/mesh/priv_beacon_srv.c b/subsys/bluetooth/mesh/priv_beacon_srv.c index 8dd1ba3b1d8c..790ffe562835 100644 --- a/subsys/bluetooth/mesh/priv_beacon_srv.c +++ b/subsys/bluetooth/mesh/priv_beacon_srv.c @@ -151,13 +151,14 @@ static int handle_node_id_get(const struct bt_mesh_model *mod, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - uint8_t node_id, status; + enum bt_mesh_feat_state node_id; uint16_t net_idx; + uint8_t status; net_idx = net_buf_simple_pull_le16(buf) & 0xfff; - status = bt_mesh_subnet_priv_node_id_get(net_idx, (enum bt_mesh_feat_state *)&node_id); - node_id_status_rsp(mod, ctx, status, net_idx, node_id); + status = bt_mesh_subnet_priv_node_id_get(net_idx, &node_id); + node_id_status_rsp(mod, ctx, status, net_idx, (uint8_t)node_id); return 0; } From 346776f00643867b18831d8781ae6962f809573c Mon Sep 17 00:00:00 2001 From: Zhijie Zhong Date: Tue, 28 Oct 2025 21:08:10 +0800 Subject: [PATCH 0341/3334] [nrf fromtree] Bluetooth: Host: Fix handling of adv reports when scanning for connection In some cases, the host starts scanning internally for establishing connections (BT_LE_SCAN_USER_CONN), such as host-based resolving or auto-connection. In this situation, even if the application does not start explicit scan, the host still needs to handle the advertising reports to continue the connection process. Previously, both bt_hci_le_adv_report() and bt_hci_le_adv_ext_report() will break or discard all reports when explicit scan is not active. This causes the connection to stay in SCAN_BEFORE_INITIATING and never move forward. This patch adds checking of BT_LE_SCAN_USER_CONN to allow advertising reports to be processed during connection-purpose scanning. When the scan is started explicitly by application, the behavior remains the same, only small comments are updated to describe this behavior and keep the original code style unchanged. Signed-off-by: Zhijie Zhong (cherry picked from commit 87e351f8bcda1c49bab68f02124fcbb193ae9acd) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/scan.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index bffc5fd907f2..36aa492d611c 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -632,13 +632,14 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, struct bt_le_scan_cb *listener, *next; struct net_buf_simple_state state; bt_addr_le_t id_addr; + bool explicit_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN); + bool conn_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_CONN); LOG_DBG("%s event %u, len %u, rssi %d dBm", bt_addr_le_str(addr), info->adv_type, len, info->rssi); if (!IS_ENABLED(CONFIG_BT_PRIVACY) && !IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) && - atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN) && - (info->adv_props & BT_HCI_LE_ADV_PROP_DIRECT)) { + explicit_scan && (info->adv_props & BT_HCI_LE_ADV_PROP_DIRECT)) { LOG_DBG("Dropped direct adv report"); return; } @@ -652,6 +653,13 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, bt_lookup_id_addr(BT_ID_DEFAULT, addr)); } + /* For connection-purpose scanning, + * skip app callbacks but allow pending-conn check logic. + */ + if (!explicit_scan && conn_scan) { + goto check_pending_conn; + } + if (scan_dev_found_cb) { net_buf_simple_save(buf, &state); @@ -677,6 +685,7 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, /* Clear pointer to this stack frame before returning to calling function */ info->addr = NULL; +check_pending_conn: #if defined(CONFIG_BT_CENTRAL) check_pending_conn(&id_addr, addr, info->adv_props); #endif /* CONFIG_BT_CENTRAL */ @@ -805,6 +814,8 @@ static void create_ext_adv_info(struct bt_hci_evt_le_ext_advertising_info const void bt_hci_le_adv_ext_report(struct net_buf *buf) { uint8_t num_reports = net_buf_pull_u8(buf); + bool explicit_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN); + bool conn_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_CONN); LOG_DBG("Adv number of reports %u", num_reports); @@ -817,19 +828,23 @@ void bt_hci_le_adv_ext_report(struct net_buf *buf) bool more_to_come; bool is_new_advertiser; - if (!atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN)) { + if (!explicit_scan) { /* The application has not requested explicit scan, so it is not expecting * advertising reports. Discard, and reset the reassembler if not inactive * This is done in the loop as this flag can change between each iteration, * and it is not uncommon that scanning is disabled in the callback called - * from le_adv_recv + * from le_adv_recv. + * + * However, if scanning is running for connection purposes, + * the report shall still be processed to allow pending connections. */ - if (reassembling_advertiser.state != FRAG_ADV_INACTIVE) { reset_reassembling_advertiser(); } - break; + if (!conn_scan) { + break; + } } if (buf->len < sizeof(*evt)) { @@ -1669,18 +1684,23 @@ void bt_hci_le_adv_report(struct net_buf *buf) { uint8_t num_reports = net_buf_pull_u8(buf); struct bt_hci_evt_le_advertising_info *evt; + bool explicit_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN); + bool conn_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_CONN); LOG_DBG("Adv number of reports %u", num_reports); while (num_reports--) { struct bt_le_scan_recv_info adv_info; - if (!atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN)) { + if (!explicit_scan && !conn_scan) { /* The application has not requested explicit scan, so it is not expecting * advertising reports. Discard. * This is done in the loop as this flag can change between each iteration, * and it is not uncommon that scanning is disabled in the callback called - * from le_adv_recv + * from le_adv_recv. + * + * However, if scanning is running for connection purposes, + * the report shall still be processed to allow pending connections. */ break; From ceb6274848b13fb79f0101fd43c2bd208185392f Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 4 Nov 2025 17:49:20 +0200 Subject: [PATCH 0342/3334] [nrf fromtree] Bluetooth: Host: Fix build error with observer-only config When building an observer-only build the check_pending_conn label would result in CI warnings/errors due to this only being a C23 feature: scan.c:692:1: error: label at end of compound statement is a C23 extension Turns out the #ifdefs are completely unnecessary, and the code can simply take advantage of IS_ENABLED(), which should get rid of the warning. Signed-off-by: Johan Hedberg (cherry picked from commit 73b6f8bd4a4bde38c8678d750793d02ae3f43c14) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/scan.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index 36aa492d611c..8c5278f362c0 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -538,7 +538,6 @@ int bt_le_scan_user_remove(enum bt_le_scan_user flag) return scan_update(); } -#if defined(CONFIG_BT_CENTRAL) static void check_pending_conn(const bt_addr_le_t *id_addr, const bt_addr_le_t *addr, uint8_t adv_props) { @@ -593,7 +592,6 @@ static void check_pending_conn(const bt_addr_le_t *id_addr, LOG_WRN("Error while updating the scanner (%d)", err); } } -#endif /* CONFIG_BT_CENTRAL */ /* Convert Legacy adv report evt_type field to adv props */ static uint8_t get_adv_props_legacy(uint8_t evt_type) @@ -656,7 +654,7 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, /* For connection-purpose scanning, * skip app callbacks but allow pending-conn check logic. */ - if (!explicit_scan && conn_scan) { + if (IS_ENABLED(CONFIG_BT_CENTRAL) && !explicit_scan && conn_scan) { goto check_pending_conn; } @@ -686,9 +684,9 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, info->addr = NULL; check_pending_conn: -#if defined(CONFIG_BT_CENTRAL) - check_pending_conn(&id_addr, addr, info->adv_props); -#endif /* CONFIG_BT_CENTRAL */ + if (IS_ENABLED(CONFIG_BT_CENTRAL)) { + check_pending_conn(&id_addr, addr, info->adv_props); + } } #if defined(CONFIG_BT_EXT_ADV) From 0a4ed97ac924abf769cea19963c324401b6aca5e Mon Sep 17 00:00:00 2001 From: Aleksandar Stanoev Date: Thu, 6 Nov 2025 10:15:29 +0000 Subject: [PATCH 0343/3334] [nrf fromtree] Bluetooth: Decode Bluetooth 6.2 version number Bluetooth 6.2 has version number 0x10 and was released in November 2025. This commit ensures this version number is properly decoded. Signed-off-by: Aleksandar Stanoev (cherry picked from commit 9d06fca87ac197f0f238e7cbad4594e28d75ff6e) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/hci_types.h | 1 + subsys/bluetooth/host/hci_core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index cd6c716c1cbe..d520a2324266 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -913,6 +913,7 @@ struct bt_hci_rp_configure_data_path { #define BT_HCI_VERSION_5_4 13 #define BT_HCI_VERSION_6_0 14 #define BT_HCI_VERSION_6_1 15 +#define BT_HCI_VERSION_6_2 16 #define BT_HCI_OP_READ_LOCAL_VERSION_INFO BT_OP(BT_OGF_INFO, 0x0001) /* 0x1001 */ struct bt_hci_rp_read_local_version_info { diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 29a7f5d30ebf..d2a8d6d1202b 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3963,7 +3963,7 @@ const char *bt_hci_get_ver_str(uint8_t core_version) { const char * const str[] = { "1.0b", "1.1", "1.2", "2.0", "2.1", "3.0", "4.0", "4.1", "4.2", - "5.0", "5.1", "5.2", "5.3", "5.4", "6.0", "6.1" + "5.0", "5.1", "5.2", "5.3", "5.4", "6.0", "6.1", "6.2" }; if (core_version < ARRAY_SIZE(str)) { From 44fc0c5595de0d9297287b53eeaef5bb9227a777 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Wed, 5 Nov 2025 12:54:42 +0100 Subject: [PATCH 0344/3334] [nrf fromtree] bluetooth: mesh: Increase BT RX Stack Size for PB-GATT Increase BT RX Thread Stack Size which is needed for successfull provisioning over PB-GATT. Output from `kernel thread stacks` shell command: ``` BT RX WQ (real size 4096): unused 1408 usage 2688 / 4096 (65 %) ``` Fixes #98521 Signed-off-by: Pavel Vasilyev (cherry picked from commit bb006dc971556ffa6dc45263d92f4632f0b280dd) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/host/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index e89ca2bce919..41fce83a0048 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -111,6 +111,7 @@ config BT_RX_STACK_SIZE int "Size of the receiving thread stack" default 768 if BT_HCI_RAW default 3092 if BT_MESH_GATT_CLIENT + default 2800 if BT_MESH_PB_GATT default 2600 if BT_MESH default 2048 if BT_AUDIO default 1200 From 5e22fe189a52fa13c7ed9e92c0c1e87a0798a7bc Mon Sep 17 00:00:00 2001 From: Omkar Kulkarni Date: Wed, 1 Oct 2025 14:39:55 +0200 Subject: [PATCH 0345/3334] [nrf fromtree] Bluetooth: Mesh: Make net msg cache netkey aware Improve the network message cache to be aware of network keys to prevent false duplicate detection across different subnets. This ensures that messages with the same source address and sequence number but from different network keys are not incorrectly identified as duplicates, as it can happen in certain cases. See ES-26350. Signed-off-by: Omkar Kulkarni (cherry picked from commit 22e37982cb8b2c89f1e6b1e7f48dd7481c471a7d) Signed-off-by: Pavel Vasilyev --- subsys/bluetooth/mesh/net.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/mesh/net.c b/subsys/bluetooth/mesh/net.c index b2e1cc695f94..d791ba46f9ab 100644 --- a/subsys/bluetooth/mesh/net.c +++ b/subsys/bluetooth/mesh/net.c @@ -82,7 +82,8 @@ struct iv_val { static struct { uint32_t src : 15, /* MSb of source is always 0 */ - seq : 17; + seq : 17; + uint16_t net_idx; } msg_cache[CONFIG_BT_MESH_MSG_CACHE_SIZE]; static uint16_t msg_cache_next; @@ -145,20 +146,22 @@ static bool check_dup(struct net_buf_simple *data) return false; } -static bool msg_cache_match(struct net_buf_simple *pdu) +static bool msg_cache_match(struct net_buf_simple *pdu, uint16_t net_idx) { uint16_t i; for (i = msg_cache_next; i > 0U;) { if (msg_cache[--i].src == SRC(pdu->data) && - msg_cache[i].seq == (SEQ(pdu->data) & BIT_MASK(17))) { + msg_cache[i].seq == (SEQ(pdu->data) & BIT_MASK(17)) && + msg_cache[i].net_idx == net_idx) { return true; } } for (i = ARRAY_SIZE(msg_cache); i > msg_cache_next;) { if (msg_cache[--i].src == SRC(pdu->data) && - msg_cache[i].seq == (SEQ(pdu->data) & BIT_MASK(17))) { + msg_cache[i].seq == (SEQ(pdu->data) & BIT_MASK(17)) && + msg_cache[i].net_idx == net_idx) { return true; } } @@ -171,6 +174,7 @@ static void msg_cache_add(struct bt_mesh_net_rx *rx) msg_cache_next %= ARRAY_SIZE(msg_cache); msg_cache[msg_cache_next].src = rx->ctx.addr; msg_cache[msg_cache_next].seq = rx->seq; + msg_cache[msg_cache_next].net_idx = rx->sub->net_idx; msg_cache_next++; } @@ -653,15 +657,14 @@ static bool net_decrypt(struct bt_mesh_net_rx *rx, struct net_buf_simple *in, return false; } - if (rx->net_if == BT_MESH_NET_IF_ADV && msg_cache_match(out)) { + if (rx->net_if == BT_MESH_NET_IF_ADV && msg_cache_match(out, rx->sub->net_idx)) { LOG_DBG("Duplicate found in Network Message Cache"); return false; } LOG_DBG("src 0x%04x", rx->ctx.addr); - return bt_mesh_net_decrypt(&cred->enc, out, BT_MESH_NET_IVI_RX(rx), - proxy) == 0; + return bt_mesh_net_decrypt(&cred->enc, out, BT_MESH_NET_IVI_RX(rx), proxy) == 0; } /* Relaying from advertising to the advertising bearer should only happen From 884547b509d7e96e3e7673195c61847ce5a79c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Mon, 17 Nov 2025 12:26:09 +0100 Subject: [PATCH 0346/3334] [nrf fromtree] soc: nordic: uicr: Move GEN_UICR options into the main Zephyr tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I initially added the GEN_UICR options to the gen_uicr image's Kconfig tree only to not pollute the main tree. But there is a lot of useful help text in the GEN_UICR option's Kconfig file that I would like users to be able to read/reference from the docs. To not increase the complexity of the Kconfig doc generator, we add the GEN_UICR options to the main tree and have them all be disabled for builds other than the gen_uicr image. Being in the main tree has the added benefit of being recognzied by the compliance checker. Signed-off-by: Sebastian Bøe (cherry picked from commit 70f6cf7ea0c069b9bd5d0246c8883d6349d0a1ad) --- scripts/ci/check_compliance.py | 33 ------------------- soc/nordic/common/uicr/Kconfig | 11 +++++++ .../{gen_uicr/Kconfig => Kconfig.gen_uicr} | 21 ++++++------ soc/nordic/common/uicr/gen_uicr/prj.conf | 7 +++- 4 files changed, 27 insertions(+), 45 deletions(-) rename soc/nordic/common/uicr/{gen_uicr/Kconfig => Kconfig.gen_uicr} (96%) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 8e3dc7347bb8..64e0d8764fcb 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1267,39 +1267,6 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_LOG_LEVEL", "FOO_SETTING_1", "FOO_SETTING_2", - "GEN_UICR_APPROTECT_APPLICATION_PROTECTED", - "GEN_UICR_APPROTECT_CORESIGHT_PROTECTED", - "GEN_UICR_APPROTECT_RADIOCORE_PROTECTED", - "GEN_UICR_ERASEPROTECT", - "GEN_UICR_GENERATE_PERIPHCONF", - "GEN_UICR_LOCK", - "GEN_UICR_PROTECTEDMEM", - "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", - "GEN_UICR_SECONDARY", - "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", - "GEN_UICR_SECONDARY_PROCESSOR_APPLICATION", - "GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE", - "GEN_UICR_SECONDARY_PROCESSOR_VALUE", - "GEN_UICR_SECONDARY_PROTECTEDMEM", - "GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES", - "GEN_UICR_SECONDARY_TRIGGER", - "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP", - "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0", - "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1", - "GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP", - "GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0", - "GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1", - "GEN_UICR_SECONDARY_WDTSTART", - "GEN_UICR_SECONDARY_WDTSTART_CRV", - "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE", - "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0", - "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT1", - "GEN_UICR_SECURESTORAGE", - "GEN_UICR_WDTSTART", - "GEN_UICR_WDTSTART_CRV", - "GEN_UICR_WDTSTART_INSTANCE_CODE", - "GEN_UICR_WDTSTART_INSTANCE_WDT0", - "GEN_UICR_WDTSTART_INSTANCE_WDT1", "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "IAR_BUFFERED_WRITE", diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index 9f22fbbf7269..c3a69c3dbe0f 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -25,3 +25,14 @@ config IS_IRONSIDE_SE_SECONDARY_IMAGE This Kconfig is set by sysbuild to indicate that this image is a secondary firmware for Ironside SE. This is used by the UICR generation system to determine which PERIPHCONF partition to use. + +config IS_GEN_UICR_IMAGE + bool "UICR generator image indicator (informative only, do not change)" + help + This Kconfig is automatically set when building the gen_uicr image. + It indicates that this is the UICR generator utility image and enables + the UICR generator configuration options. + +# Source UICR generator options when building the gen_uicr image +# All options are disabled by default unless IS_GEN_UICR_IMAGE is set +rsource "Kconfig.gen_uicr" diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/Kconfig.gen_uicr similarity index 96% rename from soc/nordic/common/uicr/gen_uicr/Kconfig rename to soc/nordic/common/uicr/Kconfig.gen_uicr index 7f25cc839dd6..4ee6af87eaef 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig.gen_uicr @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 menu "UICR generator options" + depends on IS_GEN_UICR_IMAGE config GEN_UICR_GENERATE_PERIPHCONF bool "Generate PERIPHCONF hex alongside UICR" @@ -11,7 +12,7 @@ config GEN_UICR_GENERATE_PERIPHCONF periphconf_partition partition. config GEN_UICR_SECURESTORAGE - bool "Enable UICR.SECURESTORAGE" + bool "UICR.SECURESTORAGE" default y depends on $(dt_nodelabel_enabled,secure_storage_partition) help @@ -33,7 +34,7 @@ config GEN_UICR_SECURESTORAGE - Combined subpartition sizes must equal secure_storage_partition size config GEN_UICR_LOCK - bool "Enable UICR.LOCK" + bool "UICR.LOCK" help When enabled, locks the entire contents of the NVR0 page located in MRAM10. This includes all values in both the UICR and the BICR (Board @@ -44,7 +45,7 @@ config GEN_UICR_LOCK unauthorized modification. config GEN_UICR_ERASEPROTECT - bool "Enable UICR.ERASEPROTECT" + bool "UICR.ERASEPROTECT" depends on ! GEN_UICR_LOCK help When enabled, ERASEALL operations are blocked. @@ -80,7 +81,7 @@ config GEN_UICR_APPROTECT_CORESIGHT_PROTECTED endmenu config GEN_UICR_PROTECTEDMEM - bool "Enable UICR.PROTECTEDMEM" + bool "UICR.PROTECTEDMEM" help When enabled, the UICR generator will configure the protected memory region. @@ -94,7 +95,7 @@ config GEN_UICR_PROTECTEDMEM_SIZE_BYTES This value must be divisible by 4096 (4 kiB). config GEN_UICR_WDTSTART - bool "Enable UICR.WDTSTART" + bool "UICR.WDTSTART" help When enabled, the UICR generator will configure an application domain watchdog timer to start automatically before the @@ -137,7 +138,7 @@ config GEN_UICR_WDTSTART_CRV Default value 65535 creates a 2-second timeout. config GEN_UICR_SECONDARY_WDTSTART - bool "Enable UICR.SECONDARY.WDTSTART" + bool "UICR.SECONDARY.WDTSTART" depends on GEN_UICR_SECONDARY help When enabled, the UICR generator will configure the @@ -181,7 +182,7 @@ config GEN_UICR_SECONDARY_WDTSTART_CRV Default value 65535 creates a 2-second timeout. config GEN_UICR_SECONDARY - bool "Enable UICR.SECONDARY.ENABLE" + bool "UICR.SECONDARY.ENABLE" if GEN_UICR_SECONDARY @@ -216,7 +217,7 @@ config GEN_UICR_SECONDARY_PROCESSOR_VALUE default 0x1730C77F if GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE config GEN_UICR_SECONDARY_TRIGGER - bool "Enable UICR.SECONDARY.TRIGGER" + bool "UICR.SECONDARY.TRIGGER" help When enabled, configures automatic triggers that cause IronSide SE to boot the secondary firmware instead of the primary firmware based @@ -257,7 +258,7 @@ config GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP endif # GEN_UICR_SECONDARY_TRIGGER config GEN_UICR_SECONDARY_PROTECTEDMEM - bool "Enable UICR.SECONDARY.PROTECTEDMEM" + bool "UICR.SECONDARY.PROTECTEDMEM" depends on GEN_UICR_SECONDARY help When enabled, the UICR generator will configure the @@ -274,5 +275,3 @@ config GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES endif # GEN_UICR_SECONDARY endmenu - -source "Kconfig.zephyr" diff --git a/soc/nordic/common/uicr/gen_uicr/prj.conf b/soc/nordic/common/uicr/gen_uicr/prj.conf index b2a4ba591044..e967f3a8ee98 100644 --- a/soc/nordic/common/uicr/gen_uicr/prj.conf +++ b/soc/nordic/common/uicr/gen_uicr/prj.conf @@ -1 +1,6 @@ -# nothing here +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable UICR generator options - this is automatically set when building +# the gen_uicr image and enables the UICR generator configuration menu +CONFIG_IS_GEN_UICR_IMAGE=y From 6d6e2691e6f913a740b1767b2b15661079cbbf9d Mon Sep 17 00:00:00 2001 From: Josh DeWitt Date: Thu, 13 Nov 2025 10:14:33 -0600 Subject: [PATCH 0347/3334] [nrf fromtree] soc: nordic: Gate FLASH_0 MPU region on CONFIG_XIP Only include a flash MPU region if CONFIG_XIP is set, similar to arm/core/mpu/arm_mpu_regions.c. Signed-off-by: Josh DeWitt (cherry picked from commit 0dc2e0c38f18f2ea65d03ed493dba9b1f19e5c2f) --- soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c index a9e8b3de7a91..14b63a6481c9 100644 --- a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c +++ b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c @@ -22,10 +22,12 @@ #define SOFTPERIPH_SIZE DT_REG_SIZE(DT_NODELABEL(softperiph_ram)) static struct arm_mpu_region mpu_regions[] = { +#ifdef CONFIG_XIP MPU_REGION_ENTRY("FLASH_0", CONFIG_FLASH_BASE_ADDRESS, REGION_FLASH_ATTR(CONFIG_FLASH_BASE_ADDRESS, CONFIG_FLASH_SIZE * 1024)), +#endif MPU_REGION_ENTRY("SRAM_0", CONFIG_SRAM_BASE_ADDRESS, REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, From 0098e9e46962acedce266183f5437f66d08170c8 Mon Sep 17 00:00:00 2001 From: Utsav Munendra Date: Fri, 24 Oct 2025 09:57:12 -0700 Subject: [PATCH 0348/3334] [nrf fromtree] drivers: flash_mspi_nor: Simplify perform_xfer function Remove unnecessary function argument, makes later commits also simpler. Signed-off-by: Utsav Munendra (cherry picked from commit 41988ae62f44068a0dd1a64cfb74e300b15dad45) --- drivers/flash/flash_mspi_nor.c | 34 +++++++++++++-------------- drivers/flash/flash_mspi_nor_quirks.h | 8 +++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 444509b695b5..595e02281f60 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -26,8 +26,7 @@ LOG_MODULE_REGISTER(flash_mspi_nor, CONFIG_FLASH_LOG_LEVEL); #define NON_XIP_DEV_CFG_MASK (MSPI_DEVICE_CONFIG_ALL & ~XIP_DEV_CFG_MASK) static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir); -static int perform_xfer(const struct device *dev, - uint8_t cmd, bool mem_access); +static int perform_xfer(const struct device *dev, uint8_t cmd); static int cmd_rdsr(const struct device *dev, uint8_t op_code, uint8_t *sr); static int wait_until_ready(const struct device *dev, k_timeout_t poll_period); static int cmd_wren(const struct device *dev); @@ -77,12 +76,13 @@ static uint16_t get_extended_command(const struct device *dev, return ((uint16_t)cmd << 8) | cmd_extension; } -static int perform_xfer(const struct device *dev, - uint8_t cmd, bool mem_access) +static int perform_xfer(const struct device *dev, uint8_t cmd) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const struct mspi_dev_cfg *cfg = NULL; + bool mem_access = (cmd == dev_data->cmd_info.read_cmd || + cmd == dev_data->cmd_info.pp_cmd); int rc; if (dev_data->cmd_info.cmd_extension != CMD_EXTENSION_NONE && @@ -158,7 +158,7 @@ static int cmd_rdsr(const struct device *dev, uint8_t op_code, uint8_t *sr) } dev_data->packet.num_bytes = sizeof(uint8_t); dev_data->packet.data_buf = sr; - rc = perform_xfer(dev, op_code, false); + rc = perform_xfer(dev, op_code); if (rc < 0) { LOG_ERR("%s 0x%02x failed: %d", __func__, op_code, rc); return rc; @@ -194,7 +194,7 @@ static int cmd_wren(const struct device *dev) int rc; set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_WREN, false); + rc = perform_xfer(dev, SPI_NOR_CMD_WREN); if (rc < 0) { LOG_ERR("%s failed: %d", __func__, rc); return rc; @@ -217,7 +217,7 @@ static int cmd_wrsr(const struct device *dev, uint8_t op_code, set_up_xfer(dev, MSPI_TX); dev_data->packet.num_bytes = sr_cnt; dev_data->packet.data_buf = sr; - rc = perform_xfer(dev, op_code, false); + rc = perform_xfer(dev, op_code); if (rc < 0) { LOG_ERR("%s 0x%02x failed: %d", __func__, op_code, rc); return rc; @@ -368,7 +368,7 @@ static int api_read(const struct device *dev, off_t addr, void *dest, dev_data->xfer.rx_dummy = get_rx_dummy(dev); dev_data->packet.data_buf = dest; dev_data->packet.num_bytes = to_read; - rc = perform_xfer(dev, dev_data->cmd_info.read_cmd, true); + rc = perform_xfer(dev, dev_data->cmd_info.read_cmd); addr += to_read; dest = (uint8_t *)dest + to_read; @@ -419,7 +419,7 @@ static int api_write(const struct device *dev, off_t addr, const void *src, set_up_xfer_with_addr(dev, MSPI_TX, addr); dev_data->packet.data_buf = (uint8_t *)src; dev_data->packet.num_bytes = to_write; - rc = perform_xfer(dev, dev_data->cmd_info.pp_cmd, true); + rc = perform_xfer(dev, dev_data->cmd_info.pp_cmd); if (rc < 0) { LOG_ERR("Page program xfer failed: %d", rc); break; @@ -491,7 +491,7 @@ static int api_erase(const struct device *dev, off_t addr, size_t size) if (size == flash_size) { /* Chip erase. */ set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_CE, false); + rc = perform_xfer(dev, SPI_NOR_CMD_CE); size -= flash_size; } else { @@ -500,7 +500,7 @@ static int api_erase(const struct device *dev, off_t addr, size_t size) if (best_et != NULL) { set_up_xfer_with_addr(dev, MSPI_TX, addr); - rc = perform_xfer(dev, best_et->cmd, false); + rc = perform_xfer(dev, best_et->cmd); addr += BIT(best_et->exp); size -= BIT(best_et->exp); @@ -566,7 +566,7 @@ static int sfdp_read(const struct device *dev, off_t addr, void *dest, dev_data->packet.address = addr; dev_data->packet.data_buf = dest; dev_data->packet.num_bytes = size; - rc = perform_xfer(dev, JESD216_CMD_READ_SFDP, false); + rc = perform_xfer(dev, JESD216_CMD_READ_SFDP); if (rc < 0) { LOG_ERR("Read SFDP xfer failed: %d", rc); } @@ -587,7 +587,7 @@ static int read_jedec_id(const struct device *dev, uint8_t *id) } dev_data->packet.data_buf = id; dev_data->packet.num_bytes = JESD216_READ_ID_LEN; - rc = perform_xfer(dev, SPI_NOR_CMD_RDID, false); + rc = perform_xfer(dev, SPI_NOR_CMD_RDID); if (rc < 0) { LOG_ERR("Read JEDEC ID failed: %d", rc); } @@ -777,7 +777,7 @@ static int octal_enable_set(const struct device *dev, bool enable) dev_data->packet.address = 0x02; dev_data->packet.num_bytes = sizeof(uint8_t); dev_data->packet.data_buf = &status_reg; - rc = perform_xfer(dev, op_code, false); + rc = perform_xfer(dev, op_code); if (rc < 0) { LOG_ERR("cmd_rdsr 0x%02x failed: %d", op_code, rc); return rc; @@ -813,7 +813,7 @@ static int enter_4byte_addressing_mode(const struct device *dev) } set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, 0xB7, false); + rc = perform_xfer(dev, 0xB7); if (rc < 0) { LOG_ERR("Command 0xB7 failed: %d", rc); return rc; @@ -932,14 +932,14 @@ static int soft_reset_66_99(const struct device *dev) int rc; set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_RESET_EN, false); + rc = perform_xfer(dev, SPI_NOR_CMD_RESET_EN); if (rc < 0) { LOG_ERR("CMD_RESET_EN failed: %d", rc); return rc; } set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_RESET_MEM, false); + rc = perform_xfer(dev, SPI_NOR_CMD_RESET_MEM); if (rc < 0) { LOG_ERR("CMD_RESET_MEM failed: %d", rc); return rc; diff --git a/drivers/flash/flash_mspi_nor_quirks.h b/drivers/flash/flash_mspi_nor_quirks.h index d58fbea4ff9b..83480b4643a8 100644 --- a/drivers/flash/flash_mspi_nor_quirks.h +++ b/drivers/flash/flash_mspi_nor_quirks.h @@ -80,7 +80,7 @@ static inline int mxicy_mx25r_post_switch_mode(const struct device *dev) set_up_xfer(dev, MSPI_TX); dev_data->packet.data_buf = mxicy_mx25r_hp_payload; dev_data->packet.num_bytes = sizeof(mxicy_mx25r_hp_payload); - rc = perform_xfer(dev, SPI_NOR_CMD_WRSR, false); + rc = perform_xfer(dev, SPI_NOR_CMD_WRSR); if (rc < 0) { return rc; } @@ -101,7 +101,7 @@ static inline int mxicy_mx25r_post_switch_mode(const struct device *dev) set_up_xfer(dev, MSPI_RX); dev_data->packet.num_bytes = sizeof(config); dev_data->packet.data_buf = config; - rc = perform_xfer(dev, SPI_NOR_CMD_RDCR, false); + rc = perform_xfer(dev, SPI_NOR_CMD_RDCR); if (rc < 0) { return rc; } @@ -159,7 +159,7 @@ static inline int mxicy_mx25u_post_switch_mode(const struct device *dev) dev_data->packet.address = 0; dev_data->packet.data_buf = &opi_enable; dev_data->packet.num_bytes = sizeof(opi_enable); - return perform_xfer(dev, SPI_NOR_CMD_WR_CFGREG2, false); + return perform_xfer(dev, SPI_NOR_CMD_WR_CFGREG2); } static int mxicy_mx25u_pre_init(const struct device *dev) @@ -192,7 +192,7 @@ static int mxicy_mx25u_pre_init(const struct device *dev) dev_data->packet.address = 0x300; dev_data->packet.data_buf = &cfg_reg; dev_data->packet.num_bytes = sizeof(cfg_reg); - rc = perform_xfer(dev, SPI_NOR_CMD_RD_CFGREG2, false); + rc = perform_xfer(dev, SPI_NOR_CMD_RD_CFGREG2); if (rc < 0) { LOG_ERR("Failed to read Dummy Cycle from CFGREG2"); return rc; From 9e55d283518d1ccd98d5cbe7646bc4ff8bcdec82 Mon Sep 17 00:00:00 2001 From: Utsav Munendra Date: Fri, 24 Oct 2025 09:57:52 -0700 Subject: [PATCH 0349/3334] [nrf fromtree] drivers: flash_mspi_nor: Track last applied MSPI config Instead of just tracking in a bool whether the MSPI device is in Standard MSPI vs. QPI/OPI config, track the entire MSPI config which was last applied. This makes it easier later to track more than two configs to apply based on the next command to transceive. Signed-off-by: Utsav Munendra (cherry picked from commit 8bc4a92397de978d55bdc8ae27e34d731c50f7f4) --- drivers/flash/flash_mspi_nor.c | 18 ++++++++++++------ drivers/flash/flash_mspi_nor.h | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 595e02281f60..b53b50d3663f 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -124,14 +124,14 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) } } - if (cfg) { + if (cfg && cfg != dev_data->last_applied_cfg) { rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, MSPI_DEVICE_CONFIG_IO_MODE, cfg); if (rc < 0) { LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - + dev_data->last_applied_cfg = cfg; dev_data->in_target_io_mode = mem_access; } @@ -262,6 +262,7 @@ static int acquire(const struct device *dev) LOG_ERR("mspi_dev_config() failed: %d", rc); } else { if (dev_config->multiperipheral_bus) { + dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; dev_data->in_target_io_mode = true; } @@ -867,9 +868,14 @@ static int switch_to_target_io_mode(const struct device *dev) } } - return mspi_dev_config(dev_config->bus, &dev_config->mspi_id, + rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, NON_XIP_DEV_CFG_MASK, &dev_config->mspi_nor_cfg); + if (rc < 0) { + return rc; + } + dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; + return 0; } #if defined(WITH_SUPPLY_GPIO) @@ -965,7 +971,7 @@ static int soft_reset(const struct device *dev) LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - + dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; dev_data->in_target_io_mode = true; rc = soft_reset_66_99(dev); @@ -980,7 +986,7 @@ static int soft_reset(const struct device *dev) LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - + dev_data->last_applied_cfg = &dev_config->mspi_nor_init_cfg; dev_data->in_target_io_mode = false; } @@ -1010,7 +1016,7 @@ static int flash_chip_init(const struct device *dev) LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - + dev_data->last_applied_cfg = &dev_config->mspi_nor_init_cfg; dev_data->in_target_io_mode = false; #if defined(WITH_SUPPLY_GPIO) diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 335af449b261..f86c82fa7b70 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -114,6 +114,7 @@ struct flash_mspi_nor_data { struct flash_mspi_nor_cmd_info cmd_info; struct flash_mspi_nor_switch_info switch_info; bool in_target_io_mode; + const struct mspi_dev_cfg *last_applied_cfg; }; #ifdef __cplusplus From 0f56e0cb4206b28475382f5bb399fd8a441910ea Mon Sep 17 00:00:00 2001 From: Utsav Munendra Date: Wed, 29 Oct 2025 07:01:50 -0700 Subject: [PATCH 0350/3334] [nrf fromtree] drivers: flash_mspi_nor: Flash control commands to use their own configs Also in preparation for allowing control command frequency to be different from the read/write frequency and initialization frequency. Signed-off-by: Utsav Munendra (cherry picked from commit abd35f88a76eb5eb2ee86364d27e3dae9b631aee) --- drivers/flash/flash_mspi_nor.c | 49 +++++++++++++++------------------- drivers/flash/flash_mspi_nor.h | 3 ++- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index b53b50d3663f..965fd385251f 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -94,10 +94,14 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) dev_data->packet.cmd = cmd; } - if (dev_config->multi_io_cmd || - dev_config->mspi_nor_cfg.io_mode == MSPI_IO_MODE_SINGLE) { - /* If multiple IO lines are used in all the transfer phases - * or in none of them, there's no need to switch the IO mode. + if (!dev_data->chip_initialized || + dev_config->multi_io_cmd || + dev_config->mspi_nor_cfg.io_mode == MSPI_IO_MODE_SINGLE) { + /* Commands before chip is initialized manually apply a MSPI config + * which all flash chips support by JEDEC standard. Do not switch + * to device tree config yet. + * If multiple IO lines are used in all the transfer phases + * there's no need to switch the IO mode. */ } else if (mem_access) { /* For commands accessing the flash memory (read and program), @@ -107,26 +111,13 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) cfg = &dev_config->mspi_nor_cfg; } } else { - /* For all other commands, switch to Single IO mode if a given - * command needs the data or address phase and in the target IO - * mode multiple IO lines are used in these phases. - */ - if (dev_data->in_target_io_mode) { - if (dev_data->packet.num_bytes != 0 || - (dev_data->xfer.addr_length != 0 && - !dev_config->single_io_addr)) { - /* Only the IO mode is to be changed, so the - * initial configuration structure can be used - * for this operation. - */ - cfg = &dev_config->mspi_nor_init_cfg; - } - } + /* For all other commands, use control command config */ + cfg = &dev_config->mspi_control_cfg; } if (cfg && cfg != dev_data->last_applied_cfg) { rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - MSPI_DEVICE_CONFIG_IO_MODE, cfg); + MSPI_DEVICE_CONFIG_IO_MODE | MSPI_DEVICE_CONFIG_FREQUENCY, cfg); if (rc < 0) { LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; @@ -981,12 +972,12 @@ static int soft_reset(const struct device *dev) rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, MSPI_DEVICE_CONFIG_IO_MODE, - &dev_config->mspi_nor_init_cfg); + &dev_config->mspi_control_cfg); if (rc < 0) { LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->last_applied_cfg = &dev_config->mspi_nor_init_cfg; + dev_data->last_applied_cfg = &dev_config->mspi_control_cfg; dev_data->in_target_io_mode = false; } @@ -1003,20 +994,23 @@ static int flash_chip_init(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; + struct mspi_dev_cfg mspi_nor_init_cfg; uint8_t id[JESD216_READ_ID_LEN] = {0}; uint16_t dts_cmd = 0; uint32_t sfdp_signature; bool flash_reset = false; int rc; + /* Do initial checks at max 50MHz required to be supported by JEDEC */ + memcpy(&mspi_nor_init_cfg, &dev_config->mspi_control_cfg, sizeof(mspi_nor_init_cfg)); + mspi_nor_init_cfg.freq = MIN(dev_config->mspi_control_cfg.freq, MHZ(50)); rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, MSPI_DEVICE_CONFIG_ALL, - &dev_config->mspi_nor_init_cfg); + &mspi_nor_init_cfg); if (rc < 0) { LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->last_applied_cfg = &dev_config->mspi_nor_init_cfg; dev_data->in_target_io_mode = false; #if defined(WITH_SUPPLY_GPIO) @@ -1115,6 +1109,7 @@ static int flash_chip_init(const struct device *dev) LOG_ERR("Failed to switch to target io mode: %d", rc); return rc; } + dev_data->chip_initialized = true; dev_data->in_target_io_mode = true; @@ -1267,10 +1262,10 @@ static DEVICE_API(flash, drv_api) = { #endif }; -#define FLASH_INITIAL_CONFIG(inst) \ +#define FLASH_CONTROL_CMD_CONFIG(inst) \ { \ .ce_num = DT_INST_PROP_OR(inst, mspi_hardware_ce_num, 0), \ - .freq = MIN(DT_INST_PROP(inst, mspi_max_frequency), MHZ(50)), \ + .freq = DT_INST_PROP(inst, mspi_max_frequency), \ .io_mode = MSPI_IO_MODE_SINGLE, \ .data_rate = MSPI_DATA_RATE_SINGLE, \ .cpp = MSPI_CPP_MODE_0, \ @@ -1336,7 +1331,7 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ .page_size = FLASH_PAGE_SIZE(inst), \ .mspi_id = MSPI_DEVICE_ID_DT_INST(inst), \ .mspi_nor_cfg = MSPI_DEVICE_CONFIG_DT_INST(inst), \ - .mspi_nor_init_cfg = FLASH_INITIAL_CONFIG(inst), \ + .mspi_control_cfg = FLASH_CONTROL_CMD_CONFIG(inst), \ IF_ENABLED(CONFIG_MSPI_XIP, \ (.xip_cfg = MSPI_XIP_CONFIG_DT_INST(inst),)) \ IF_ENABLED(WITH_SUPPLY_GPIO, \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index f86c82fa7b70..a8c7bfaab547 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -75,7 +75,7 @@ struct flash_mspi_nor_config { uint16_t page_size; struct mspi_dev_id mspi_id; struct mspi_dev_cfg mspi_nor_cfg; - struct mspi_dev_cfg mspi_nor_init_cfg; + struct mspi_dev_cfg mspi_control_cfg; #if defined(CONFIG_MSPI_XIP) struct mspi_xip_cfg xip_cfg; #endif @@ -115,6 +115,7 @@ struct flash_mspi_nor_data { struct flash_mspi_nor_switch_info switch_info; bool in_target_io_mode; const struct mspi_dev_cfg *last_applied_cfg; + bool chip_initialized; }; #ifdef __cplusplus From e9414925f451a9ec9d4435e811c0cabefbb69f33 Mon Sep 17 00:00:00 2001 From: Utsav Munendra Date: Wed, 29 Oct 2025 07:01:50 -0700 Subject: [PATCH 0351/3334] [nrf fromtree] drivers: flash_mspi_nor: Remove bool tracking of target IO mode Remove the Boolean tracking of MSPI IO mode as we can now rely on tracking the entire dev config applied to the MSPI device, multiple of which will exist in later commits. Signed-off-by: Utsav Munendra (cherry picked from commit eae12761e1b4a5505e192e789feac110e3ddb288) --- drivers/flash/flash_mspi_nor.c | 25 +++++++++++++------------ drivers/flash/flash_mspi_nor.h | 1 - 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 965fd385251f..613ebfbab60c 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -35,6 +35,14 @@ static int cmd_wrsr(const struct device *dev, uint8_t op_code, #include "flash_mspi_nor_quirks.h" +static bool in_octal_io(const struct device *dev) +{ + struct flash_mspi_nor_data *dev_data = dev->data; + + return dev_data->last_applied_cfg && + dev_data->last_applied_cfg->io_mode == MSPI_IO_MODE_OCTAL; +} + static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir) { const struct flash_mspi_nor_config *dev_config = dev->config; @@ -86,7 +94,7 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) int rc; if (dev_data->cmd_info.cmd_extension != CMD_EXTENSION_NONE && - dev_data->in_target_io_mode) { + in_octal_io(dev)) { dev_data->xfer.cmd_length = 2; dev_data->packet.cmd = get_extended_command(dev, cmd); } else { @@ -107,7 +115,7 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) /* For commands accessing the flash memory (read and program), * ensure that the target IO mode is active. */ - if (!dev_data->in_target_io_mode) { + if (!in_octal_io(dev)) { cfg = &dev_config->mspi_nor_cfg; } } else { @@ -123,7 +131,6 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) return rc; } dev_data->last_applied_cfg = cfg; - dev_data->in_target_io_mode = mem_access; } rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, @@ -142,7 +149,7 @@ static int cmd_rdsr(const struct device *dev, uint8_t op_code, uint8_t *sr) int rc; set_up_xfer(dev, MSPI_RX); - if (dev_data->in_target_io_mode) { + if (in_octal_io(dev)) { dev_data->xfer.rx_dummy = dev_data->cmd_info.rdsr_dummy; dev_data->xfer.addr_length = dev_data->cmd_info.rdsr_addr_4 ? 4 : 0; @@ -254,7 +261,6 @@ static int acquire(const struct device *dev) } else { if (dev_config->multiperipheral_bus) { dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; - dev_data->in_target_io_mode = true; } return 0; @@ -546,7 +552,7 @@ static int sfdp_read(const struct device *dev, off_t addr, void *dest, int rc; set_up_xfer(dev, MSPI_RX); - if (dev_data->in_target_io_mode) { + if (in_octal_io(dev)) { dev_data->xfer.rx_dummy = dev_data->cmd_info.sfdp_dummy_20 ? 20 : 8; dev_data->xfer.addr_length = dev_data->cmd_info.sfdp_addr_4 @@ -572,7 +578,7 @@ static int read_jedec_id(const struct device *dev, uint8_t *id) int rc; set_up_xfer(dev, MSPI_RX); - if (dev_data->in_target_io_mode) { + if (in_octal_io(dev)) { dev_data->xfer.rx_dummy = dev_data->cmd_info.rdid_dummy; dev_data->xfer.addr_length = dev_data->cmd_info.rdid_addr_4 ? 4 : 0; @@ -963,7 +969,6 @@ static int soft_reset(const struct device *dev) return rc; } dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; - dev_data->in_target_io_mode = true; rc = soft_reset_66_99(dev); if (rc < 0) { @@ -978,7 +983,6 @@ static int soft_reset(const struct device *dev) return rc; } dev_data->last_applied_cfg = &dev_config->mspi_control_cfg; - dev_data->in_target_io_mode = false; } rc = soft_reset_66_99(dev); @@ -1011,7 +1015,6 @@ static int flash_chip_init(const struct device *dev) LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->in_target_io_mode = false; #if defined(WITH_SUPPLY_GPIO) if (dev_config->supply.port) { @@ -1111,8 +1114,6 @@ static int flash_chip_init(const struct device *dev) } dev_data->chip_initialized = true; - dev_data->in_target_io_mode = true; - if (IS_ENABLED(CONFIG_FLASH_MSPI_NOR_USE_SFDP)) { /* Read the SFDP signature to test if communication with * the flash chip can be successfully performed after switching diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index a8c7bfaab547..7d95588c4721 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -113,7 +113,6 @@ struct flash_mspi_nor_data { struct jesd216_erase_type erase_types[JESD216_NUM_ERASE_TYPES]; struct flash_mspi_nor_cmd_info cmd_info; struct flash_mspi_nor_switch_info switch_info; - bool in_target_io_mode; const struct mspi_dev_cfg *last_applied_cfg; bool chip_initialized; }; From 937c2be0e121e3a4cf96a44deebf3358aeececbb Mon Sep 17 00:00:00 2001 From: Utsav Munendra Date: Wed, 29 Oct 2025 07:01:50 -0700 Subject: [PATCH 0352/3334] [nrf fromtree] driver: flash_mspi_nor: Allow specific read/write IO modes and frequencies The driver currently provides no way to use Dual IO Read and Single IO for the rest of the commands currently, and would erroneously use Single IO PP command in Dual IO mode. This PR fixes and adds support for that. Signed-off-by: Utsav Munendra (cherry picked from commit c696414f8f1f0c8986fe4ba6ba750f09f8c9678d) --- drivers/flash/flash_mspi_nor.c | 94 ++++++++++++++++++++-------- drivers/flash/flash_mspi_nor.h | 8 +++ dts/bindings/mtd/jedec,mspi-nor.yaml | 56 +++++++++++++++++ 3 files changed, 132 insertions(+), 26 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 613ebfbab60c..405fd8800b36 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -43,6 +43,18 @@ static bool in_octal_io(const struct device *dev) dev_data->last_applied_cfg->io_mode == MSPI_IO_MODE_OCTAL; } +static bool is_quad_enable_needed(const struct mspi_dev_cfg *cfg) +{ + return cfg && (cfg->io_mode == MSPI_IO_MODE_QUAD_1_1_4 || + cfg->io_mode == MSPI_IO_MODE_QUAD_1_4_4); +} + +static bool is_octal_enable_needed(const struct mspi_dev_cfg *cfg) +{ + return cfg && (cfg->io_mode == MSPI_IO_MODE_OCTAL_1_1_8 || + cfg->io_mode == MSPI_IO_MODE_OCTAL_1_8_8); +} + static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir) { const struct flash_mspi_nor_config *dev_config = dev->config; @@ -89,8 +101,6 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const struct mspi_dev_cfg *cfg = NULL; - bool mem_access = (cmd == dev_data->cmd_info.read_cmd || - cmd == dev_data->cmd_info.pp_cmd); int rc; if (dev_data->cmd_info.cmd_extension != CMD_EXTENSION_NONE && @@ -102,25 +112,21 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) dev_data->packet.cmd = cmd; } - if (!dev_data->chip_initialized || - dev_config->multi_io_cmd || - dev_config->mspi_nor_cfg.io_mode == MSPI_IO_MODE_SINGLE) { - /* Commands before chip is initialized manually apply a MSPI config - * which all flash chips support by JEDEC standard. Do not switch - * to device tree config yet. - * If multiple IO lines are used in all the transfer phases - * there's no need to switch the IO mode. - */ - } else if (mem_access) { - /* For commands accessing the flash memory (read and program), - * ensure that the target IO mode is active. - */ - if (!in_octal_io(dev)) { - cfg = &dev_config->mspi_nor_cfg; + /* Commands before chip is initialized manually apply a MSPI config + * which all flash chips support by JEDEC standard. Do not switch + * to device tree config yet. + * If multiple IO lines are used in all the transfer phases + * there's no need to switch the IO mode. + */ + if (dev_data->chip_initialized && !dev_config->multi_io_cmd) { + if (cmd == dev_data->cmd_info.read_cmd) { + cfg = dev_data->read_cfg; + } else if (cmd == dev_data->cmd_info.pp_cmd) { + cfg = dev_data->write_cfg; + } else { + /* For all other commands, use control command config */ + cfg = &dev_config->mspi_control_cfg; } - } else { - /* For all other commands, use control command config */ - cfg = &dev_config->mspi_control_cfg; } if (cfg && cfg != dev_data->last_applied_cfg) { @@ -824,12 +830,11 @@ static int switch_to_target_io_mode(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; - enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode; int rc = 0; if (dev_data->switch_info.quad_enable_req != JESD216_DW15_QER_VAL_NONE) { - bool quad_needed = io_mode == MSPI_IO_MODE_QUAD_1_1_4 || - io_mode == MSPI_IO_MODE_QUAD_1_4_4; + bool quad_needed = is_quad_enable_needed(dev_data->read_cfg) || + is_quad_enable_needed(dev_data->write_cfg); rc = quad_enable_set(dev, quad_needed); if (rc < 0) { @@ -839,8 +844,8 @@ static int switch_to_target_io_mode(const struct device *dev) } if (dev_data->switch_info.octal_enable_req != OCTAL_ENABLE_REQ_NONE) { - bool octal_needed = io_mode == MSPI_IO_MODE_OCTAL_1_1_8 || - io_mode == MSPI_IO_MODE_OCTAL_1_8_8; + bool octal_needed = is_octal_enable_needed(dev_data->read_cfg) || + is_octal_enable_needed(dev_data->write_cfg); rc = octal_enable_set(dev, octal_needed); if (rc < 0) { @@ -1089,6 +1094,33 @@ static int flash_chip_init(const struct device *dev) } } + /* If read/write commands and frequency do not match the default + * MSPI device configuration, store new ones for those commands + * specifically. + */ + if (dev_config->read_io_mode == dev_config->mspi_nor_cfg.io_mode && + dev_config->read_freq == dev_config->mspi_nor_cfg.freq) { + dev_data->read_cfg = &dev_config->mspi_nor_cfg; + } else { + memcpy(&dev_data->mspi_dev_read_cfg, &dev_config->mspi_nor_cfg, + sizeof(dev_config->mspi_nor_cfg)); + dev_data->mspi_dev_read_cfg.io_mode = dev_config->read_io_mode; + dev_data->mspi_dev_read_cfg.freq = dev_config->read_freq; + dev_data->read_cfg = &dev_data->mspi_dev_read_cfg; + } + + if (dev_config->write_io_mode == dev_config->mspi_nor_cfg.io_mode && + dev_config->write_freq == dev_config->mspi_nor_cfg.freq) { + dev_data->write_cfg = &dev_config->mspi_nor_cfg; + } else { + memcpy(&dev_data->mspi_dev_write_cfg, &dev_config->mspi_nor_cfg, + sizeof(dev_config->mspi_nor_cfg)); + dev_data->mspi_dev_write_cfg.io_mode = dev_config->write_io_mode; + dev_data->mspi_dev_write_cfg.freq = dev_config->write_freq; + dev_data->write_cfg = &dev_data->mspi_dev_write_cfg; + } + + if (dev_config->jedec_id_specified) { rc = read_jedec_id(dev, id); if (rc < 0) { @@ -1263,10 +1295,12 @@ static DEVICE_API(flash, drv_api) = { #endif }; +#define FLASH_MSPI_MAX_FREQ(inst) DT_INST_PROP(inst, mspi_max_frequency) + #define FLASH_CONTROL_CMD_CONFIG(inst) \ { \ .ce_num = DT_INST_PROP_OR(inst, mspi_hardware_ce_num, 0), \ - .freq = DT_INST_PROP(inst, mspi_max_frequency), \ + .freq = FLASH_MSPI_MAX_FREQ(inst), \ .io_mode = MSPI_IO_MODE_SINGLE, \ .data_rate = MSPI_DATA_RATE_SINGLE, \ .cpp = MSPI_CPP_MODE_0, \ @@ -1350,6 +1384,14 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ .default_erase_types = DEFAULT_ERASE_TYPES(inst), \ .default_cmd_info = DEFAULT_CMD_INFO(inst), \ .default_switch_info = DEFAULT_SWITCH_INFO(inst), \ + .read_freq = DT_INST_PROP_OR(inst, read_frequency, \ + FLASH_MSPI_MAX_FREQ(inst)), \ + .read_io_mode = DT_INST_ENUM_IDX_OR(inst, read_io_mode, \ + DT_INST_ENUM_IDX(inst, mspi_io_mode)), \ + .write_freq = DT_INST_PROP_OR(inst, write_frequency, \ + FLASH_MSPI_MAX_FREQ(inst)), \ + .write_io_mode = DT_INST_ENUM_IDX_OR(inst, write_io_mode, \ + DT_INST_ENUM_IDX(inst, mspi_io_mode)), \ .jedec_id_specified = DT_INST_NODE_HAS_PROP(inst, jedec_id), \ .rx_dummy_specified = DT_INST_NODE_HAS_PROP(inst, rx_dummy), \ .multiperipheral_bus = DT_PROP(DT_INST_BUS(inst), \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 7d95588c4721..6252b838c0cd 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -96,6 +96,10 @@ struct flash_mspi_nor_config { const struct jesd216_erase_type *default_erase_types; struct flash_mspi_nor_cmd_info default_cmd_info; struct flash_mspi_nor_switch_info default_switch_info; + uint32_t read_freq; + enum mspi_io_mode read_io_mode; + uint32_t write_freq; + enum mspi_io_mode write_io_mode; bool jedec_id_specified : 1; bool rx_dummy_specified : 1; bool multiperipheral_bus : 1; @@ -115,6 +119,10 @@ struct flash_mspi_nor_data { struct flash_mspi_nor_switch_info switch_info; const struct mspi_dev_cfg *last_applied_cfg; bool chip_initialized; + const struct mspi_dev_cfg *read_cfg; + struct mspi_dev_cfg mspi_dev_read_cfg; + const struct mspi_dev_cfg *write_cfg; + struct mspi_dev_cfg mspi_dev_write_cfg; }; #ifdef __cplusplus diff --git a/dts/bindings/mtd/jedec,mspi-nor.yaml b/dts/bindings/mtd/jedec,mspi-nor.yaml index 348e11cd9833..e59fe117557e 100644 --- a/dts/bindings/mtd/jedec,mspi-nor.yaml +++ b/dts/bindings/mtd/jedec,mspi-nor.yaml @@ -21,6 +21,62 @@ include: - t-exit-dpd properties: + read-frequency: + type: int + description: | + Clock frequency of device to configure in Hz for read + command, when reads are desired to be in a different + frequency than the rest of the commands. + + read-io-mode: + type: string + enum: + - "MSPI_IO_MODE_SINGLE" + - "MSPI_IO_MODE_DUAL" + - "MSPI_IO_MODE_DUAL_1_1_2" + - "MSPI_IO_MODE_DUAL_1_2_2" + - "MSPI_IO_MODE_QUAD" + - "MSPI_IO_MODE_QUAD_1_1_4" + - "MSPI_IO_MODE_QUAD_1_4_4" + - "MSPI_IO_MODE_OCTAL" + - "MSPI_IO_MODE_OCTAL_1_1_8" + - "MSPI_IO_MODE_OCTAL_1_8_8" + - "MSPI_IO_MODE_HEX" + - "MSPI_IO_MODE_HEX_8_8_16" + - "MSPI_IO_MODE_HEX_8_16_16" + description: | + MSPI I/O mode setting for read command when desired to + be different from base device `mspi-io-mode` for the rest + of the commands. + + write-frequency: + type: int + description: | + Clock frequency of device to configure in Hz for write + command, when write are desired to be in a different + frequency than the rest of the commands. + + write-io-mode: + type: string + enum: + - "MSPI_IO_MODE_SINGLE" + - "MSPI_IO_MODE_DUAL" + - "MSPI_IO_MODE_DUAL_1_1_2" + - "MSPI_IO_MODE_DUAL_1_2_2" + - "MSPI_IO_MODE_QUAD" + - "MSPI_IO_MODE_QUAD_1_1_4" + - "MSPI_IO_MODE_QUAD_1_4_4" + - "MSPI_IO_MODE_OCTAL" + - "MSPI_IO_MODE_OCTAL_1_1_8" + - "MSPI_IO_MODE_OCTAL_1_8_8" + - "MSPI_IO_MODE_HEX" + - "MSPI_IO_MODE_HEX_8_8_16" + - "MSPI_IO_MODE_HEX_8_16_16" + description: | + MSPI I/O mode setting for write command when desired to + be different from base device `mspi-io-mode` for the rest + of the commands. + reset-gpios: type: phandle-array description: | From 6477c975e80278f8ad298a851763807499810968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 12 Sep 2025 12:45:26 +0200 Subject: [PATCH 0353/3334] [nrf fromtree] drivers: udc_dwc2: Control D+ pull-up on nRF54H20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable D+ pull-up on core disable to make sure that device does not indicate its presence to host before the stack is ready (software initializes controller and clears SftDiscon bit). Signed-off-by: Tomasz Moń (cherry picked from commit 0748b4e47d1f2888708b65d0a7ed5a2d10851b62) --- drivers/usb/udc/udc_dwc2_vendor_quirks.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/usb/udc/udc_dwc2_vendor_quirks.h b/drivers/usb/udc/udc_dwc2_vendor_quirks.h index cd25f0ec9d33..9b2d26b89008 100644 --- a/drivers/usb/udc/udc_dwc2_vendor_quirks.h +++ b/drivers/usb/udc/udc_dwc2_vendor_quirks.h @@ -213,10 +213,21 @@ static inline int usbhs_enable_core(const struct device *dev) return 0; } +static inline int usbhs_enable_pullup(const struct device *dev) +{ + /* Core is ready to handle connection, enable D+ pull-up */ + nrfs_usb_dplus_pullup_enable((void *)dev); + + return 0; +} + static inline int usbhs_disable_core(const struct device *dev) { NRF_USBHS_Type *wrapper = USBHS_DT_WRAPPER_REG_ADDR(0); + /* Disable D+ pull-up until next post enable quirk */ + nrfs_usb_dplus_pullup_disable((void *)dev); + /* Disable interrupts */ wrapper->INTENCLR = 1UL; @@ -299,6 +310,7 @@ static inline int usbhs_pre_hibernation_exit(const struct device *dev) const struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \ .init = usbhs_enable_nrfs_service, \ .pre_enable = usbhs_enable_core, \ + .post_enable = usbhs_enable_pullup, \ .disable = usbhs_disable_core, \ .shutdown = usbhs_disable_nrfs_service, \ .irq_clear = usbhs_irq_clear, \ From b92a74ec63d125b34666ce669d3580f02561c429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 25 Jun 2025 13:26:32 +0200 Subject: [PATCH 0354/3334] [nrf fromtree] samples: usb: uac2: Support High-Speed operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow the samples to work both at Full-Speed and High-Speed exposing the same capabilities at both speeds. Signed-off-by: Tomasz Moń (cherry picked from commit ff50dfb002ab9e780d57508b5bd4f6c187a88a97) --- .../usb/uac2_explicit_feedback/app.overlay | 1 + .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 4 - .../usb/uac2_explicit_feedback/src/feedback.h | 13 +- .../src/feedback_dummy.c | 28 ++- .../uac2_explicit_feedback/src/feedback_nrf.c | 166 +++++++++++++----- .../usb/uac2_explicit_feedback/src/main.c | 28 +-- .../usb/uac2_implicit_feedback/app.overlay | 1 + .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 4 - .../usb/uac2_implicit_feedback/src/feedback.h | 9 +- .../src/feedback_dummy.c | 4 +- .../uac2_implicit_feedback/src/feedback_nrf.c | 26 ++- .../usb/uac2_implicit_feedback/src/main.c | 51 ++++-- 12 files changed, 226 insertions(+), 109 deletions(-) diff --git a/samples/subsys/usb/uac2_explicit_feedback/app.overlay b/samples/subsys/usb/uac2_explicit_feedback/app.overlay index 3ff71797aa99..21119a79206d 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/app.overlay +++ b/samples/subsys/usb/uac2_explicit_feedback/app.overlay @@ -11,6 +11,7 @@ compatible = "zephyr,uac2"; status = "okay"; full-speed; + high-speed; audio-function = ; uac_aclk: aclk { diff --git a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 0e35fa1f491e..d7526fc6ec9a 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -2,7 +2,3 @@ CONFIG_NRFX_GPPI=y CONFIG_NRFX_TIMER131=y CONFIG_NRFX_GPIOTE130=y - -# Sample is Full-Speed only, prevent High-Speed enumeration -CONFIG_UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED=n -CONFIG_USBD_MAX_SPEED_FULL=y diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h b/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h index 7f5bf2027d8f..37c1dc975e58 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h @@ -9,15 +9,14 @@ #include -/* Nominal number of samples received on each SOF. This sample is currently - * supporting only 48 kHz sample rate. - */ -#define SAMPLES_PER_SOF 48 +/* This sample is currently supporting only 48 kHz sample rate. */ +#define SAMPLE_RATE 48000 struct feedback_ctx *feedback_init(void); -void feedback_reset_ctx(struct feedback_ctx *ctx); +void feedback_reset_ctx(struct feedback_ctx *ctx, bool microframes); void feedback_process(struct feedback_ctx *ctx); -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued); +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, + bool microframes); uint32_t feedback_value(struct feedback_ctx *ctx); - +#define SAMPLES_PER_SOF 48 #endif /* FEEDBACK_H_ */ diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c index 7e274ca2ed05..378a43e06ef4 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c @@ -5,15 +5,23 @@ */ #include +#include #include "feedback.h" #warning "No target specific feedback code, overruns/underruns will occur" -#define FEEDBACK_K 10 +#define FEEDBACK_FS_K 10 +#define FEEDBACK_FS_SHIFT 4 +#define FEEDBACK_HS_K 13 +#define FEEDBACK_HS_SHIFT 3 + +static struct feedback_ctx { + bool high_speed; +} fb_ctx; struct feedback_ctx *feedback_init(void) { - return NULL; + return &fb_ctx; } void feedback_process(struct feedback_ctx *ctx) @@ -21,19 +29,25 @@ void feedback_process(struct feedback_ctx *ctx) ARG_UNUSED(ctx); } -void feedback_reset_ctx(struct feedback_ctx *ctx) +void feedback_reset_ctx(struct feedback_ctx *ctx, bool microframes) { - ARG_UNUSED(ctx); + ctx->high_speed = microframes; } -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued) +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, + bool microframes) { - ARG_UNUSED(ctx); ARG_UNUSED(i2s_blocks_queued); + + ctx->high_speed = microframes; } uint32_t feedback_value(struct feedback_ctx *ctx) { /* Always request nominal number of samples */ - return SAMPLES_PER_SOF << FEEDBACK_K; + if (USBD_SUPPORTS_HIGH_SPEED && ctx->high_speed) { + return (SAMPLE_RATE / 8000) << (FEEDBACK_HS_K + FEEDBACK_HS_SHIFT); + } + + return (SAMPLE_RATE / 1000) << (FEEDBACK_FS_K + FEEDBACK_FS_SHIFT); } diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c index 62a7ad05ef9c..6ea9d2374d96 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c @@ -84,8 +84,14 @@ static const nrfx_timer_t feedback_timer_instance = * Full-Speed isochronous feedback is Q10.10 unsigned integer left-justified in * the 24-bits so it has Q10.14 format. This sample application puts zeroes to * the 4 least significant bits (does not use the bits for extra precision). + * + * High-Speed isochronous feedback is Q12.13 unsigned integer aligned in the + * 32-bits so the binary point is located between second and third byte so it + * has Q16.16 format. This sample applications puts zeroes to the 3 least + * significant bits (does not use the bits for extra precision). */ -#define FEEDBACK_K 10 +#define FEEDBACK_FS_K 10 +#define FEEDBACK_HS_K 13 #if defined(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER) #define FEEDBACK_P 1 #else @@ -93,11 +99,14 @@ static const nrfx_timer_t feedback_timer_instance = #endif #define FEEDBACK_FS_SHIFT 4 +#define FEEDBACK_HS_SHIFT 3 static struct feedback_ctx { uint32_t fb_value; int32_t rel_sof_offset; int32_t base_sof_offset; + uint32_t counts_per_sof; + bool high_speed; union { /* For edge counting */ struct { @@ -190,7 +199,7 @@ struct feedback_ctx *feedback_init(void) feedback_target_init(); - feedback_reset_ctx(&fb_ctx); + feedback_reset_ctx(&fb_ctx, false); if (IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)) { err = feedback_edge_counter_setup(); @@ -239,6 +248,24 @@ struct feedback_ctx *feedback_init(void) return &fb_ctx; } +static uint32_t nominal_feedback_value(struct feedback_ctx *ctx) +{ + if (ctx->high_speed) { + return (SAMPLE_RATE / 8000) << (FEEDBACK_HS_K + FEEDBACK_HS_SHIFT); + } + + return (SAMPLE_RATE / 1000) << (FEEDBACK_FS_K + FEEDBACK_FS_SHIFT); +} + +static uint32_t feedback_period(struct feedback_ctx *ctx) +{ + if (ctx->high_speed) { + return BIT(FEEDBACK_HS_K - FEEDBACK_P); + } + + return BIT(FEEDBACK_FS_K - FEEDBACK_P); +} + static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, uint32_t framestart_cc) { @@ -255,7 +282,7 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, * when regulated and therefore the relative clock frequency * discrepancies are essentially negligible. */ - clks_per_edge = sof_cc / (SAMPLES_PER_SOF << FEEDBACK_P); + clks_per_edge = sof_cc / ctx->counts_per_sof; sof_cc /= MAX(clks_per_edge, 1); framestart_cc /= MAX(clks_per_edge, 1); } @@ -263,8 +290,8 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, /* /2 because we treat the middle as a turning point from being * "too late" to "too early". */ - if (framestart_cc > (SAMPLES_PER_SOF << FEEDBACK_P)/2) { - sof_offset = framestart_cc - (SAMPLES_PER_SOF << FEEDBACK_P); + if (framestart_cc > ctx->counts_per_sof/2) { + sof_offset = framestart_cc - ctx->counts_per_sof; } else { sof_offset = framestart_cc; } @@ -279,17 +306,17 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, if (sof_offset >= 0) { abs_diff = sof_offset - ctx->rel_sof_offset; - base_change = -(SAMPLES_PER_SOF << FEEDBACK_P); + base_change = -ctx->counts_per_sof; } else { abs_diff = ctx->rel_sof_offset - sof_offset; - base_change = SAMPLES_PER_SOF << FEEDBACK_P; + base_change = ctx->counts_per_sof; } /* Adjust base offset only if the change happened through the * outer bound. The actual changes should be significantly lower * than the threshold here. */ - if (abs_diff > (SAMPLES_PER_SOF << FEEDBACK_P)/2) { + if (abs_diff > ctx->counts_per_sof/2) { ctx->base_sof_offset += base_change; } } @@ -297,8 +324,12 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, ctx->rel_sof_offset = sof_offset; } -static inline int32_t offset_to_correction(int32_t offset) +static inline int32_t offset_to_correction(struct feedback_ctx *ctx, int32_t offset) { + if (ctx->high_speed) { + return -(offset / BIT(FEEDBACK_P)) * BIT(FEEDBACK_HS_SHIFT); + } + return -(offset / BIT(FEEDBACK_P)) * BIT(FEEDBACK_FS_SHIFT); } @@ -320,39 +351,66 @@ static int32_t pi_update(struct feedback_ctx *ctx) int32_t error = SP - PV; /* - * With above normalization at Full-Speed, when data received during - * SOF n appears on I2S during SOF n+3, the Ziegler Nichols Ultimate - * Gain is around 1.15 and the oscillation period is around 90 SOF. - * (much nicer oscillations with 204.8 SOF period can be observed with - * gain 0.5 when the delay is not n+3, but n+33 - surprisingly the - * resulting PI coefficients after power of two rounding are the same). + * With above normalization, when data received during SOF n appears on + * I2S during SOF n+3, the Ziegler Nichols Ultimate Gain and oscillation + * periods are as follows: * - * Ziegler-Nichols rule with applied stability margin of 2 results in: - * Kc = 0.22 * Ku = 0.22 * 1.15 = 0.253 - * Ti = 0.83 * tu = 0.83 * 80 = 66.4 + * Full-Speed Linux: Ku = 1.34 tu=77 [FS SOFs] + * Full-Speed Mac OS: Ku = 0.173 tu=580 [FS SOFs] + * High-Speed Mac OS: Ku = 0.895 tu=4516 [HS SOFs] + * High-Speed Windows: Ku = 0.515 tu=819 [HS SOFs] * - * Converting the rules above to parallel PI gives: - * Kp = Kc = 0.253 - * Ki = Kc/Ti = 0.254/66.4 ~= 0.0038253 + * Linux and Mac OS oscillations were very neat, while Windows seems to + * be averaging feedback value and therefore it is hard to get steady + * oscillations without getting buffer uderrun. * - * Because we want fixed-point optimized non-tunable implementation, - * the parameters can be conveniently expressed with power of two: - * Kp ~= pow(2, -2) = 0.25 (divide by 4) - * Ki ~= pow(2, -8) = 0.0039 (divide by 256) + * Ziegler-Nichols rule with applied stability margin of 2 results in: + * [FS Linux] [FS Mac] [HS Mac] [HS Windows] + * Kc = 0.22 * Ku 0.2948 0.0381 0.1969 0.1133 + * Ti = 0.83 * tu 63.91 481.4 3748 647.9 * - * This can be implemented as: + * Converting the rules to work with following simple regulator: * ctx->integrator += error; - * return (error + (ctx->integrator / 64)) / 4; - * but unfortunately such regulator is pretty aggressive and keeps - * oscillating rather quickly around the setpoint (within +-1 sample). + * return (error + (ctx->integrator / Ti)) / invKc; + * + * gives following parameters: + * [FS Linux] [FS Mac] [HS Mac] [HS Windows] + * invKc = 1/Kc 3 26 5 8 + * Ti 64 482 3748 648 + * + * The respective regulators seem to give quarter-amplitude-damping on + * respective hosts, but tuning from one host can get into oscillations + * on another host. The regulation goal is to achieve a single set of + * parameters to be used with all hosts, the only parameter difference + * can be based on operating speed. + * + * After a number of tests with all the hosts, following parameters + * were determined to result in nice no-overshoot response: + * [Full-Speed] [High-Speed] + * invKc 128 128 + * Ti 2048 16384 + * + * The power-of-two parameters were arbitrarily chosen for rounding. + * The 16384 = 2048 * 8 can be considered as unifying integration time. + * + * While the no-overshoot is also present with invKc as low as 32, such + * regulator is pretty aggressive and keeps oscillating rather quickly + * around the setpoint (within +-1 sample). Lowering the controller gain + * (increasing invKc value) yields really good results (the outcome is + * similar to using I2S LRCLK edge counting directly). * - * Manually tweaking the constants so the regulator output is shifted - * down by 4 bits (i.e. change /64 to /2048 and /4 to /128) yields - * really good results (the outcome is similar, even slightly better, - * than using I2S LRCLK edge counting directly). + * The most challenging scenario is for the regulator to stabilize right + * after startup when I2S consumes data faster than nominal sample rate + * (48 kHz = 6 samples per SOF at High-Speed, 48 samples at Full-Speed) + * according to host (I2S consuming data slower slower than nominal + * sample rate is not problematic at all because buffer overrun does not + * stop I2S streaming). This regulator should be able to stabilize for + * any frequency that is within required USB SOF accuracy of 500 ppm, + * i.e. when nominal sample rate is 48 kHz the real sample rate can be + * anywhere in [47.976 kHz; 48.024 kHz] range. */ ctx->integrator += error; - return (error + (ctx->integrator / 2048)) / 128; + return (error + (ctx->integrator / (ctx->high_speed ? 16384 : 2048))) / 128; } void feedback_process(struct feedback_ctx *ctx) @@ -374,17 +432,21 @@ void feedback_process(struct feedback_ctx *ctx) ctx->fb_counter += sof_cc; ctx->fb_periods++; - if (ctx->fb_periods == BIT(FEEDBACK_K - FEEDBACK_P)) { + if (ctx->fb_periods == feedback_period(ctx)) { - /* fb_counter holds Q10.10 value, left-justify it */ - fb = ctx->fb_counter << FEEDBACK_FS_SHIFT; + if (ctx->high_speed) { + fb = ctx->fb_counter << FEEDBACK_HS_SHIFT; + } else { + /* fb_counter holds Q10.10 value, left-justify it */ + fb = ctx->fb_counter << FEEDBACK_FS_SHIFT; + } /* Align I2S FRAMESTART to USB SOF by adjusting reported * feedback value. This is endpoint specific correction * mentioned but not specified in USB 2.0 Specification. */ if (abs(offset) > BIT(FEEDBACK_P)) { - fb += offset_to_correction(offset); + fb += offset_to_correction(ctx, offset); } ctx->fb_value = fb; @@ -392,22 +454,25 @@ void feedback_process(struct feedback_ctx *ctx) ctx->fb_periods = 0; } } else { + const uint32_t zero_lsb_mask = ctx->high_speed ? 0x7 : 0xF; + /* Use PI controller to generate required feedback deviation * from nominal feedback value. */ - fb = SAMPLES_PER_SOF << (FEEDBACK_K + FEEDBACK_FS_SHIFT); + fb = nominal_feedback_value(ctx); /* Clear the additional LSB bits in feedback value, i.e. do not * use the optional extra resolution. */ - fb += pi_update(ctx) & ~0xF; + fb += pi_update(ctx) & ~zero_lsb_mask; ctx->fb_value = fb; } } -void feedback_reset_ctx(struct feedback_ctx *ctx) +void feedback_reset_ctx(struct feedback_ctx *ctx, bool microframes) { /* Reset feedback to nominal value */ - ctx->fb_value = SAMPLES_PER_SOF << (FEEDBACK_K + FEEDBACK_FS_SHIFT); + ctx->high_speed = microframes; + ctx->fb_value = nominal_feedback_value(ctx); if (IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)) { ctx->fb_counter = 0; ctx->fb_periods = 0; @@ -416,19 +481,28 @@ void feedback_reset_ctx(struct feedback_ctx *ctx) } } -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued) +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, + bool microframes) { + ctx->high_speed = microframes; + ctx->fb_value = nominal_feedback_value(ctx); + + if (microframes) { + ctx->counts_per_sof = (SAMPLE_RATE / 8000) << FEEDBACK_P; + } else { + ctx->counts_per_sof = (SAMPLE_RATE / 1000) << FEEDBACK_P; + } + /* I2S data was supposed to go out at SOF, but it is inevitably * delayed due to triggering I2S start by software. Set relative * SOF offset value in a way that ensures that values past "half * frame" are treated as "too late" instead of "too early" */ - ctx->rel_sof_offset = (SAMPLES_PER_SOF << FEEDBACK_P) / 2; + ctx->rel_sof_offset = ctx->counts_per_sof / 2; /* If there are more than 2 I2S blocks queued, use feedback regulator * to correct the situation. */ - ctx->base_sof_offset = (i2s_blocks_queued - 2) * - (SAMPLES_PER_SOF << FEEDBACK_P); + ctx->base_sof_offset = (i2s_blocks_queued - 2) * ctx->counts_per_sof; } uint32_t feedback_value(struct feedback_ctx *ctx) diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/main.c b/samples/subsys/usb/uac2_explicit_feedback/src/main.c index 3f4f596f35c2..40df3f5b8fc7 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/main.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/main.c @@ -20,14 +20,17 @@ LOG_MODULE_REGISTER(uac2_sample, LOG_LEVEL_INF); #define HEADPHONES_OUT_TERMINAL_ID UAC2_ENTITY_ID(DT_NODELABEL(out_terminal)) -#define SAMPLE_FREQUENCY (SAMPLES_PER_SOF * 1000) +#define FS_SAMPLES_PER_SOF 48 +#define HS_SAMPLES_PER_SOF 6 +#define MAX_SAMPLES_PER_SOF MAX(FS_SAMPLES_PER_SOF, HS_SAMPLES_PER_SOF) +#define SAMPLE_FREQUENCY (FS_SAMPLES_PER_SOF * 1000) #define SAMPLE_BIT_WIDTH 16 #define NUMBER_OF_CHANNELS 2 #define BYTES_PER_SAMPLE DIV_ROUND_UP(SAMPLE_BIT_WIDTH, 8) #define BYTES_PER_SLOT (BYTES_PER_SAMPLE * NUMBER_OF_CHANNELS) -#define MIN_BLOCK_SIZE ((SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT) -#define BLOCK_SIZE (SAMPLES_PER_SOF * BYTES_PER_SLOT) -#define MAX_BLOCK_SIZE ((SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT) +#define MIN_BLOCK_SIZE ((MAX_SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT) +#define BLOCK_SIZE (MAX_SAMPLES_PER_SOF * BYTES_PER_SLOT) +#define MAX_BLOCK_SIZE ((MAX_SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT) /* Absolute minimum is 5 buffers (1 actively consumed by I2S, 2nd queued as next * buffer, 3rd acquired by USB stack to receive data to, and 2 to handle SOF/I2S @@ -42,6 +45,7 @@ struct usb_i2s_ctx { const struct device *i2s_dev; bool terminal_enabled; bool i2s_started; + bool microframes; /* Number of blocks written, used to determine when to start I2S. * Overflows are not a problem becuse this variable is not necessary * after I2S is started. @@ -60,15 +64,15 @@ static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, * ignore the terminal variable. */ __ASSERT_NO_MSG(terminal == HEADPHONES_OUT_TERMINAL_ID); - /* This sample is for Full-Speed only devices. */ - __ASSERT_NO_MSG(microframes == false); + + ctx->microframes = microframes; ctx->terminal_enabled = enabled; if (ctx->i2s_started && !enabled) { i2s_trigger(ctx->i2s_dev, I2S_DIR_TX, I2S_TRIGGER_DROP); ctx->i2s_started = false; ctx->i2s_blocks_written = 0; - feedback_reset_ctx(ctx->fb); + feedback_reset_ctx(ctx->fb, ctx->microframes); } } @@ -114,7 +118,11 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, * either disable terminal (or the cable will be disconnected) * which will stop I2S. */ - size = BLOCK_SIZE; + if (USBD_SUPPORTS_HIGH_SPEED && ctx->microframes) { + size = HS_SAMPLES_PER_SOF * BYTES_PER_SLOT; + } else { + size = FS_SAMPLES_PER_SOF * BYTES_PER_SLOT; + } memset(buf, 0, size); } @@ -124,7 +132,7 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, if (ret < 0) { ctx->i2s_started = false; ctx->i2s_blocks_written = 0; - feedback_reset_ctx(ctx->fb); + feedback_reset_ctx(ctx->fb, ctx->microframes); /* Most likely underrun occurred, prepare I2S restart */ i2s_trigger(ctx->i2s_dev, I2S_DIR_TX, I2S_TRIGGER_PREPARE); @@ -236,7 +244,7 @@ static void uac2_sof(const struct device *dev, void *user_data) ctx->i2s_blocks_written >= 2) { i2s_trigger(ctx->i2s_dev, I2S_DIR_TX, I2S_TRIGGER_START); ctx->i2s_started = true; - feedback_start(ctx->fb, ctx->i2s_blocks_written); + feedback_start(ctx->fb, ctx->i2s_blocks_written, ctx->microframes); } } diff --git a/samples/subsys/usb/uac2_implicit_feedback/app.overlay b/samples/subsys/usb/uac2_implicit_feedback/app.overlay index 799d9e40d433..583b1f8ef7b3 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/app.overlay +++ b/samples/subsys/usb/uac2_implicit_feedback/app.overlay @@ -11,6 +11,7 @@ compatible = "zephyr,uac2"; status = "okay"; full-speed; + high-speed; audio-function = ; uac_aclk: aclk { diff --git a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 1b1edb40666c..c4e23e5d54fe 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,7 +1,3 @@ # Enable timer for asynchronous feedback CONFIG_NRFX_GPPI=y CONFIG_NRFX_TIMER131=y - -# Sample is Full-Speed only, prevent High-Speed enumeration -CONFIG_UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED=n -CONFIG_USBD_MAX_SPEED_FULL=y diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback.h b/samples/subsys/usb/uac2_implicit_feedback/src/feedback.h index 3fff2425d8b8..584bc0135c2c 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback.h +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback.h @@ -9,15 +9,14 @@ #include -/* Nominal number of samples received on each SOF. This sample is currently - * supporting only 48 kHz sample rate. - */ -#define SAMPLES_PER_SOF 48 +/* This sample is currently supporting only 48 kHz sample rate. */ +#define SAMPLE_RATE 48000 struct feedback_ctx *feedback_init(void); void feedback_reset_ctx(struct feedback_ctx *ctx); void feedback_process(struct feedback_ctx *ctx); -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued); +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, + bool microframes); /* Return offset between I2S block start and USB SOF in samples. * diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_dummy.c b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_dummy.c index 3b91deafe5c1..d28181033b94 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_dummy.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_dummy.c @@ -24,10 +24,12 @@ void feedback_reset_ctx(struct feedback_ctx *ctx) ARG_UNUSED(ctx); } -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued) +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, + bool microframes) { ARG_UNUSED(ctx); ARG_UNUSED(i2s_blocks_queued); + ARG_UNUSED(microframes); } int feedback_samples_offset(struct feedback_ctx *ctx) diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c index a7dfad370b87..9623f22e5662 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c @@ -68,11 +68,12 @@ static const nrfx_timer_t feedback_timer_instance = * SOF offset is around 0 when regulated and therefore the relative clock * frequency discrepancies are essentially negligible. */ -#define CLKS_PER_SAMPLE (16000000 / (SAMPLES_PER_SOF * 1000)) +#define CLKS_PER_SAMPLE (16000000 / (SAMPLE_RATE)) static struct feedback_ctx { int32_t rel_sof_offset; int32_t base_sof_offset; + unsigned int nominal; } fb_ctx; struct feedback_ctx *feedback_init(void) @@ -143,8 +144,8 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, /* /2 because we treat the middle as a turning point from being * "too late" to "too early". */ - if (framestart_cc > (SAMPLES_PER_SOF * CLKS_PER_SAMPLE)/2) { - sof_offset = framestart_cc - SAMPLES_PER_SOF * CLKS_PER_SAMPLE; + if (framestart_cc > (ctx->nominal * CLKS_PER_SAMPLE)/2) { + sof_offset = framestart_cc - ctx->nominal * CLKS_PER_SAMPLE; } else { sof_offset = framestart_cc; } @@ -159,17 +160,17 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, if (sof_offset >= 0) { abs_diff = sof_offset - ctx->rel_sof_offset; - base_change = -(SAMPLES_PER_SOF * CLKS_PER_SAMPLE); + base_change = -(ctx->nominal * CLKS_PER_SAMPLE); } else { abs_diff = ctx->rel_sof_offset - sof_offset; - base_change = SAMPLES_PER_SOF * CLKS_PER_SAMPLE; + base_change = ctx->nominal * CLKS_PER_SAMPLE; } /* Adjust base offset only if the change happened through the * outer bound. The actual changes should be significantly lower * than the threshold here. */ - if (abs_diff > (SAMPLES_PER_SOF * CLKS_PER_SAMPLE)/2) { + if (abs_diff > (ctx->nominal * CLKS_PER_SAMPLE)/2) { ctx->base_sof_offset += base_change; } } @@ -195,19 +196,26 @@ void feedback_reset_ctx(struct feedback_ctx *ctx) ARG_UNUSED(ctx); } -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued) +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, + bool microframes) { + if (microframes) { + ctx->nominal = SAMPLE_RATE / 8000; + } else { + ctx->nominal = SAMPLE_RATE / 1000; + } + /* I2S data was supposed to go out at SOF, but it is inevitably * delayed due to triggering I2S start by software. Set relative * SOF offset value in a way that ensures that values past "half * frame" are treated as "too late" instead of "too early" */ - ctx->rel_sof_offset = (SAMPLES_PER_SOF * CLKS_PER_SAMPLE) / 2; + ctx->rel_sof_offset = (ctx->nominal * CLKS_PER_SAMPLE) / 2; /* If there are more than 2 I2S TX blocks queued, use feedback regulator * to correct the situation. */ ctx->base_sof_offset = (i2s_blocks_queued - 2) * - (SAMPLES_PER_SOF * CLKS_PER_SAMPLE); + (ctx->nominal * CLKS_PER_SAMPLE); } int feedback_samples_offset(struct feedback_ctx *ctx) diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/main.c b/samples/subsys/usb/uac2_implicit_feedback/src/main.c index 12abdf4fe681..06334866e7a2 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/main.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/main.c @@ -21,15 +21,17 @@ LOG_MODULE_REGISTER(uac2_sample, LOG_LEVEL_INF); #define HEADPHONES_OUT_TERMINAL_ID UAC2_ENTITY_ID(DT_NODELABEL(out_terminal)) #define MICROPHONE_IN_TERMINAL_ID UAC2_ENTITY_ID(DT_NODELABEL(in_terminal)) -#define SAMPLES_PER_SOF 48 -#define SAMPLE_FREQUENCY (SAMPLES_PER_SOF * 1000) +#define FS_SAMPLES_PER_SOF 48 +#define HS_SAMPLES_PER_SOF 6 +#define MAX_SAMPLES_PER_SOF MAX(FS_SAMPLES_PER_SOF, HS_SAMPLES_PER_SOF) +#define SAMPLE_FREQUENCY (FS_SAMPLES_PER_SOF * 1000) #define SAMPLE_BIT_WIDTH 16 #define NUMBER_OF_CHANNELS 2 #define BYTES_PER_SAMPLE DIV_ROUND_UP(SAMPLE_BIT_WIDTH, 8) #define BYTES_PER_SLOT (BYTES_PER_SAMPLE * NUMBER_OF_CHANNELS) -#define MIN_BLOCK_SIZE ((SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT) -#define BLOCK_SIZE (SAMPLES_PER_SOF * BYTES_PER_SLOT) -#define MAX_BLOCK_SIZE ((SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT) +#define MIN_BLOCK_SIZE ((MAX_SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT) +#define BLOCK_SIZE (MAX_SAMPLES_PER_SOF * BYTES_PER_SLOT) +#define MAX_BLOCK_SIZE ((MAX_SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT) /* Absolute minimum is 5 TX buffers (1 actively consumed by I2S, 2nd queued as * next buffer, 3rd acquired by USB stack to receive data to, and 2 to handle @@ -49,6 +51,7 @@ struct usb_i2s_ctx { bool i2s_started; bool rx_started; bool usb_data_received; + bool microframes; /* Counter used to determine when to start I2S and then when to start * sending RX packets to host. Overflows are not a problem because this * variable is not necessary after both I2S and RX is started. @@ -70,8 +73,8 @@ struct usb_i2s_ctx { * Used to avoid overcompensation in feedback regulator. LSBs indicate * latest write size. */ - uint8_t plus_ones; - uint8_t minus_ones; + uint32_t plus_ones; + uint32_t minus_ones; }; static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, @@ -80,8 +83,7 @@ static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, { struct usb_i2s_ctx *ctx = user_data; - /* This sample is for Full-Speed only devices. */ - __ASSERT_NO_MSG(microframes == false); + ctx->microframes = microframes; if (terminal == HEADPHONES_OUT_TERMINAL_ID) { ctx->headphones_enabled = enabled; @@ -104,6 +106,15 @@ static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, } } +static int nominal_samples_per_sof(struct usb_i2s_ctx *ctx) +{ + if (USBD_SUPPORTS_HIGH_SPEED && ctx->microframes) { + return HS_SAMPLES_PER_SOF; + } + + return FS_SAMPLES_PER_SOF; +} + static void *uac2_get_recv_buf(const struct device *dev, uint8_t terminal, uint16_t size, void *user_data) { @@ -133,6 +144,7 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, void *buf, uint16_t size, void *user_data) { struct usb_i2s_ctx *ctx = user_data; + int nominal = nominal_samples_per_sof(ctx); int ret; ctx->usb_data_received = true; @@ -159,11 +171,11 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, * of samples sent. */ if (ctx->plus_ones & 1) { - size = (SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT; + size = (nominal + 1) * BYTES_PER_SLOT; } else if (ctx->minus_ones & 1) { - size = (SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT; + size = (nominal - 1) * BYTES_PER_SLOT; } else { - size = SAMPLES_PER_SOF * BYTES_PER_SLOT; + size = nominal * BYTES_PER_SLOT; } memset(buf, 0, size); } @@ -208,6 +220,7 @@ static void uac2_buf_release_cb(const struct device *dev, uint8_t terminal, /* Determine next number of samples to send, called at most once every SOF */ static int next_mic_num_samples(struct usb_i2s_ctx *ctx) { + int nominal = nominal_samples_per_sof(ctx); int offset = feedback_samples_offset(ctx->fb); /* The rolling buffers essentially handle controller dead time, i.e. @@ -217,12 +230,18 @@ static int next_mic_num_samples(struct usb_i2s_ctx *ctx) ctx->plus_ones <<= 1; ctx->minus_ones <<= 1; + /* At Full-Speed only remember last 8 frames */ + if (!USBD_SUPPORTS_HIGH_SPEED || !ctx->microframes) { + ctx->plus_ones &= 0x000000FF; + ctx->minus_ones &= 0x000000FF; + } + if ((offset < 0) && (POPCOUNT(ctx->plus_ones) < -offset)) { /* I2S buffer starts at least 1 sample before SOF, send nominal * + 1 samples to host in order to shift offset towards 0. */ ctx->plus_ones |= 1; - return SAMPLES_PER_SOF + 1; + return nominal + 1; } if ((offset > 0) && (POPCOUNT(ctx->minus_ones) < offset)) { @@ -230,11 +249,11 @@ static int next_mic_num_samples(struct usb_i2s_ctx *ctx) * - 1 samples to host in order to shift offset towards 0 */ ctx->minus_ones |= 1; - return SAMPLES_PER_SOF - 1; + return nominal - 1; } /* I2S is either spot on, or the offset is expected to correct soon */ - return SAMPLES_PER_SOF; + return nominal; } static void process_mic_data(const struct device *dev, struct usb_i2s_ctx *ctx) @@ -488,7 +507,7 @@ static void uac2_sof(const struct device *dev, void *user_data) ctx->i2s_counter >= 2) { i2s_trigger(ctx->i2s_dev, I2S_DIR_BOTH, I2S_TRIGGER_START); ctx->i2s_started = true; - feedback_start(ctx->fb, ctx->i2s_counter); + feedback_start(ctx->fb, ctx->i2s_counter, ctx->microframes); ctx->i2s_counter = 0; } From 1d99ca53ee5ad1eb8eedfb7f73208032943d08ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 21 Aug 2025 09:38:40 +0200 Subject: [PATCH 0355/3334] [nrf fromtree] samples: usb: uac2: explicit: Fix SOF offset integer conversion glitch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rework the formula used to convert timer CC values to SOF offset to eliminate a "division glitch" happening around SOF crossing, i.e. when the framestart shifts from being captured shortly before SOF to being captured shortly after SOF. When audio samples are consumed faster than nominal, i.e. when there is +1 samples every now and then, the reported SOF offset at High-Speed was going 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, "glitch" 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, ... With the fix the SOF offset goes as expected from 0 to -1, i.e. there is no jump from 0 to 7 around the SOF crossing and the reported SOF offset goes linearly (until it is correclty bumped from negative values back to positive values when +1 sample packet is transmitted on I2S). Signed-off-by: Tomasz Moń (cherry picked from commit 6bb4cb592a57a2adb891369b4171f9c171a6c526) --- .../usb/uac2_explicit_feedback/src/feedback_nrf.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c index 6ea9d2374d96..6b7ed239b268 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c @@ -272,7 +272,7 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, int sof_offset; if (!IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)) { - uint32_t clks_per_edge; + uint32_t nominator; /* Convert timer clock (independent from both Audio clock and * USB host SOF clock) to fake sample clock shifted by P values. @@ -282,18 +282,17 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, * when regulated and therefore the relative clock frequency * discrepancies are essentially negligible. */ - clks_per_edge = sof_cc / ctx->counts_per_sof; - sof_cc /= MAX(clks_per_edge, 1); - framestart_cc /= MAX(clks_per_edge, 1); + nominator = MIN(sof_cc, framestart_cc) * ctx->counts_per_sof; + sof_offset = nominator / MAX(sof_cc, 1); + } else { + sof_offset = framestart_cc; } /* /2 because we treat the middle as a turning point from being * "too late" to "too early". */ - if (framestart_cc > ctx->counts_per_sof/2) { - sof_offset = framestart_cc - ctx->counts_per_sof; - } else { - sof_offset = framestart_cc; + if (sof_offset > ctx->counts_per_sof/2) { + sof_offset -= ctx->counts_per_sof; } /* The heuristic above is not enough when the offset gets too large. From ee9de26a78a5b1a494b82ec062f8c3c17633c5ec Mon Sep 17 00:00:00 2001 From: Mark Wang Date: Fri, 17 Oct 2025 17:09:37 +0800 Subject: [PATCH 0356/3334] [nrf fromtree] usb: device_next: msc: do not copy SCSI data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Support only power-of-two disk sector sizes to enable significant throughput improvements: * SCSI data zero-copy * allow queuing multi-packet transfers Previously large SCSI buffers did not improve performance. With this change, larger SCSI buffer allows scheduling bigger USB transfers which reduces overhead. Co-authored-by: Tomasz Moń Signed-off-by: Tomasz Moń Signed-off-by: Mark Wang (cherry picked from commit 3c4b4e1ae22c01a1b4a12123db4e49038a8c78a6) --- subsys/usb/device_next/class/usbd_msc.c | 180 ++++++++++--------- subsys/usb/device_next/class/usbd_msc_scsi.c | 29 ++- subsys/usb/device_next/class/usbd_msc_scsi.h | 6 +- 3 files changed, 121 insertions(+), 94 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index 07d5d09347f6..6e6c75f671e9 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -60,11 +60,8 @@ struct CSW { /* Single instance is likely enough because it can support multiple LUNs */ #define MSC_NUM_INSTANCES CONFIG_USBD_MSC_INSTANCES_COUNT -/* Can be 64 if device is not High-Speed capable */ -#define MSC_BUF_SIZE USBD_MAX_BULK_MPS - UDC_BUF_POOL_DEFINE(msc_ep_pool, - MSC_NUM_INSTANCES * 2, MSC_BUF_SIZE, + MSC_NUM_INSTANCES * 2, USBD_MAX_BULK_MPS, sizeof(struct udc_buf_info), NULL); struct msc_event { @@ -121,9 +118,8 @@ struct msc_bot_ctx { struct scsi_ctx luns[CONFIG_USBD_MSC_LUNS_PER_INSTANCE]; struct CBW cbw; struct CSW csw; - uint8_t scsi_buf[CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]; + uint8_t *scsi_buf; uint32_t transferred_data; - size_t scsi_offset; size_t scsi_bytes; }; @@ -143,6 +139,53 @@ static struct net_buf *msc_buf_alloc(const uint8_t ep) return buf; } +static struct net_buf *msc_buf_alloc_data(const uint8_t ep, uint8_t *data, size_t len) +{ + struct net_buf *buf = NULL; + struct udc_buf_info *bi; + + buf = net_buf_alloc_with_data(&msc_ep_pool, data, len, K_NO_WAIT); + if (buf == NULL) { + return NULL; + } + + if (USB_EP_DIR_IS_OUT(ep)) { + /* Buffer is empty, USB stack will write data from host */ + buf->len = 0; + } + + bi = udc_get_buf_info(buf); + bi->ep = ep; + + return buf; +} + +static size_t msc_next_transfer_length(struct usbd_class_data *const c_data) +{ + struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); + struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); + struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; + size_t len = scsi_cmd_remaining_data_len(lun); + + len = MIN(CONFIG_USBD_MSC_SCSI_BUFFER_SIZE, len); + + /* Limit transfer to bulk endpoint wMaxPacketSize multiple */ + if (USBD_SUPPORTS_HIGH_SPEED && + usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { + len = ROUND_DOWN(len, 512); + } else { + /* Full-Speed */ + len = ROUND_DOWN(len, 64); + } + + /* Round down to sector size multiple */ + if (lun->sector_size) { + len = ROUND_DOWN(len, lun->sector_size); + } + + return len; +} + static uint8_t msc_get_bulk_in(struct usbd_class_data *const c_data) { struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); @@ -171,10 +214,11 @@ static uint8_t msc_get_bulk_out(struct usbd_class_data *const c_data) return desc->if0_out_ep.bEndpointAddress; } -static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data) +static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); struct net_buf *buf; + uint8_t *scsi_buf = ctx->scsi_buf; uint8_t ep; int ret; @@ -185,7 +229,13 @@ static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data) LOG_DBG("Queuing OUT"); ep = msc_get_bulk_out(c_data); - buf = msc_buf_alloc(ep); + + if (data) { + buf = msc_buf_alloc_data(ep, scsi_buf, msc_next_transfer_length(c_data)); + } else { + buf = msc_buf_alloc(ep); + } + /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. */ @@ -255,16 +305,24 @@ static void msc_process_read(struct msc_bot_ctx *ctx) struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; int bytes_queued = 0; struct net_buf *buf; + uint8_t *scsi_buf = ctx->scsi_buf; uint8_t ep; - size_t len; int ret; /* Fill SCSI Data IN buffer if there is no data available */ if (ctx->scsi_bytes == 0) { - ctx->scsi_bytes = scsi_read_data(lun, ctx->scsi_buf); - ctx->scsi_offset = 0; + size_t len = msc_next_transfer_length(ctx->class_node); + + bytes_queued = scsi_read_data(lun, scsi_buf, len); + } else { + bytes_queued = ctx->scsi_bytes; } + /* All data is submitted in one go. Any potential new data will + * have to be retrieved using scsi_read_data() on next call. + */ + ctx->scsi_bytes = 0; + if (atomic_test_and_set_bit(&ctx->bits, MSC_BULK_IN_QUEUED)) { __ASSERT_NO_MSG(false); LOG_ERR("IN already queued"); @@ -272,33 +330,12 @@ static void msc_process_read(struct msc_bot_ctx *ctx) } ep = msc_get_bulk_in(ctx->class_node); - buf = msc_buf_alloc(ep); + buf = msc_buf_alloc_data(ep, scsi_buf, bytes_queued); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. */ __ASSERT_NO_MSG(buf); - while (ctx->scsi_bytes - ctx->scsi_offset > 0) { - len = MIN(ctx->scsi_bytes - ctx->scsi_offset, - MSC_BUF_SIZE - bytes_queued); - if (len == 0) { - /* Either queued as much as possible or there is no more - * SCSI IN data available - */ - break; - } - - net_buf_add_mem(buf, &ctx->scsi_buf[ctx->scsi_offset], len); - bytes_queued += len; - ctx->scsi_offset += len; - - if (ctx->scsi_bytes == ctx->scsi_offset) { - /* SCSI buffer can be reused now */ - ctx->scsi_bytes = scsi_read_data(lun, ctx->scsi_buf); - ctx->scsi_offset = 0; - } - } - /* Either the net buf is full or there is no more SCSI data */ ctx->csw.dCSWDataResidue -= bytes_queued; ret = usbd_ep_enqueue(ctx->class_node, buf); @@ -319,7 +356,6 @@ static void msc_process_cbw(struct msc_bot_ctx *ctx) cb_len = scsi_usb_boot_cmd_len(ctx->cbw.CBWCB, ctx->cbw.bCBWCBLength); data_len = scsi_cmd(lun, ctx->cbw.CBWCB, cb_len, ctx->scsi_buf); ctx->scsi_bytes = data_len; - ctx->scsi_offset = 0; cmd_is_data_read = scsi_cmd_is_data_read(lun); cmd_is_data_write = scsi_cmd_is_data_write(lun); data_len += scsi_cmd_remaining_data_len(lun); @@ -399,46 +435,17 @@ static void msc_process_write(struct msc_bot_ctx *ctx, ctx->transferred_data += len; - while ((len > 0) && (scsi_cmd_remaining_data_len(lun) > 0)) { - /* Copy received data to the end of SCSI buffer */ - tmp = MIN(len, sizeof(ctx->scsi_buf) - ctx->scsi_bytes); - memcpy(&ctx->scsi_buf[ctx->scsi_bytes], buf, tmp); - ctx->scsi_bytes += tmp; - buf += tmp; - len -= tmp; - - /* Pass data to SCSI layer when either all transfer data bytes - * have been received or SCSI buffer is full. - */ - while ((ctx->scsi_bytes >= scsi_cmd_remaining_data_len(lun)) || - (ctx->scsi_bytes == sizeof(ctx->scsi_buf))) { - tmp = scsi_write_data(lun, ctx->scsi_buf, ctx->scsi_bytes); - __ASSERT(tmp <= ctx->scsi_bytes, - "Processed more data than requested"); - if (tmp == 0) { - LOG_WRN("SCSI handler didn't process %d bytes", - ctx->scsi_bytes); - ctx->scsi_bytes = 0; - } else { - LOG_DBG("SCSI processed %d out of %d bytes", - tmp, ctx->scsi_bytes); - } - - ctx->csw.dCSWDataResidue -= tmp; - if (scsi_cmd_remaining_data_len(lun) == 0) { - /* Abandon any leftover data */ - ctx->scsi_bytes = 0; - break; - } - - /* Move remaining data at the start of SCSI buffer. Note - * that the copied length here is zero (and thus no copy - * happens) when underlying sector size is equal to SCSI - * buffer size. - */ - memmove(ctx->scsi_buf, &ctx->scsi_buf[tmp], ctx->scsi_bytes - tmp); - ctx->scsi_bytes -= tmp; + if ((len > 0) && (scsi_cmd_remaining_data_len(lun) > 0)) { + /* Pass data to SCSI layer. */ + tmp = scsi_write_data(lun, buf, len); + __ASSERT(tmp <= len, "Processed more data than requested"); + if (tmp == 0) { + LOG_WRN("SCSI handler didn't process %d bytes", len); + } else { + LOG_DBG("SCSI processed %d out of %d bytes", tmp, len); } + + ctx->csw.dCSWDataResidue -= tmp; } if ((ctx->transferred_data >= ctx->cbw.dCBWDataTransferLength) || @@ -514,7 +521,7 @@ static void msc_handle_bulk_in(struct msc_bot_ctx *ctx, struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; ctx->transferred_data += len; - if (ctx->scsi_bytes == 0) { + if (msc_next_transfer_length(ctx->class_node) == 0) { if (ctx->csw.dCSWDataResidue > 0) { /* Case (5) Hi > Di * While we may have sent short packet, device @@ -623,9 +630,11 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) switch (ctx->state) { case MSC_BBB_EXPECT_CBW: + msc_queue_bulk_out_ep(evt.c_data, false); + break; case MSC_BBB_PROCESS_WRITE: /* Ensure we can accept next OUT packet */ - msc_queue_bulk_out_ep(evt.c_data); + msc_queue_bulk_out_ep(evt.c_data, true); break; default: break; @@ -645,7 +654,7 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) if (ctx->state == MSC_BBB_PROCESS_READ) { msc_process_read(ctx); } else if (ctx->state == MSC_BBB_PROCESS_WRITE) { - msc_queue_bulk_out_ep(evt.c_data); + msc_queue_bulk_out_ep(evt.c_data, true); } else if (ctx->state == MSC_BBB_SEND_CSW) { msc_send_csw(ctx); } @@ -864,14 +873,17 @@ struct usbd_class_api msc_bot_api = { .init = msc_bot_init, }; -#define DEFINE_MSC_BOT_CLASS_DATA(x, _) \ - static struct msc_bot_ctx msc_bot_ctx_##x = { \ - .desc = &msc_bot_desc_##x, \ - .fs_desc = msc_bot_fs_desc_##x, \ - .hs_desc = msc_bot_hs_desc_##x, \ - }; \ - \ - USBD_DEFINE_CLASS(msc_##x, &msc_bot_api, &msc_bot_ctx_##x, \ +#define DEFINE_MSC_BOT_CLASS_DATA(x, _) \ + UDC_STATIC_BUF_DEFINE(scsi_buf_##x, CONFIG_USBD_MSC_SCSI_BUFFER_SIZE); \ + \ + static struct msc_bot_ctx msc_bot_ctx_##x = { \ + .desc = &msc_bot_desc_##x, \ + .fs_desc = msc_bot_fs_desc_##x, \ + .hs_desc = msc_bot_hs_desc_##x, \ + .scsi_buf = scsi_buf_##x \ + }; \ + \ + USBD_DEFINE_CLASS(msc_##x, &msc_bot_api, &msc_bot_ctx_##x, \ &msc_bot_vregs); LISTIFY(MSC_NUM_INSTANCES, DEFINE_MSC_BOT_DESCRIPTOR, ()) diff --git a/subsys/usb/device_next/class/usbd_msc_scsi.c b/subsys/usb/device_next/class/usbd_msc_scsi.c index 82aa0f50e624..ad88b08af2a3 100644 --- a/subsys/usb/device_next/class/usbd_msc_scsi.c +++ b/subsys/usb/device_next/class/usbd_msc_scsi.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "usbd_msc_scsi.h" @@ -339,6 +340,24 @@ static int update_disk_info(struct scsi_ctx *const ctx) status = -EIO; } + if (!ctx->sector_size) { + status = -EIO; + } else if ((ctx->sector_size % USBD_MAX_BULK_MPS) && + (USBD_MAX_BULK_MPS % ctx->sector_size)) { + /* Zephyr MSC class implementation initially allowed any sector + * size, however doing so requires bouncing which significantly + * impedes throughput. To enable zero-copy and scheduling larger + * transfers, the implementation is now restricted to work only + * with power of two disk sizes. + * + * USB bulk wMaxPacketSize is 64 (Full-Speed), 512 (High-Speed) + * or 1024 (Super-Speed) and most common disk sector sizes are + * either 512 or 4096. Therefore the power of two limitation + * shouldn't have effect on any actual application. + */ + status = -EIO; + } + if (ctx->sector_size > CONFIG_USBD_MSC_SCSI_BUFFER_SIZE) { status = -ENOMEM; } @@ -707,12 +726,11 @@ validate_transfer_length(struct scsi_ctx *ctx, uint32_t lba, uint16_t length) return 0; } -static size_t fill_read_10(struct scsi_ctx *ctx, - uint8_t buf[static CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]) +static size_t fill_read_10(struct scsi_ctx *ctx, uint8_t *buf, size_t length) { uint32_t sectors; - sectors = MIN(CONFIG_USBD_MSC_SCSI_BUFFER_SIZE, ctx->remaining_data) / ctx->sector_size; + sectors = MIN(length, ctx->remaining_data) / ctx->sector_size; if (disk_access_read(ctx->disk, buf, ctx->lba, sectors) != 0) { /* Terminate transfer */ sectors = 0; @@ -897,15 +915,14 @@ size_t scsi_cmd_remaining_data_len(struct scsi_ctx *ctx) return ctx->remaining_data; } -size_t scsi_read_data(struct scsi_ctx *ctx, - uint8_t buf[static CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]) +size_t scsi_read_data(struct scsi_ctx *ctx, uint8_t *buf, size_t length) { size_t retrieved = 0; __ASSERT_NO_MSG(ctx->cmd_is_data_read); if ((ctx->remaining_data > 0) && ctx->read_cb) { - retrieved = ctx->read_cb(ctx, buf); + retrieved = ctx->read_cb(ctx, buf, length); } ctx->remaining_data -= retrieved; if (retrieved == 0) { diff --git a/subsys/usb/device_next/class/usbd_msc_scsi.h b/subsys/usb/device_next/class/usbd_msc_scsi.h index 338bb3d5f9bc..ef92899d477a 100644 --- a/subsys/usb/device_next/class/usbd_msc_scsi.h +++ b/subsys/usb/device_next/class/usbd_msc_scsi.h @@ -66,8 +66,7 @@ struct scsi_ctx { const char *vendor; const char *product; const char *revision; - size_t (*read_cb)(struct scsi_ctx *ctx, - uint8_t buf[static CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]); + size_t (*read_cb)(struct scsi_ctx *ctx, uint8_t *buf, size_t length); size_t (*write_cb)(struct scsi_ctx *ctx, const uint8_t *buf, size_t length); size_t remaining_data; uint32_t lba; @@ -92,8 +91,7 @@ size_t scsi_cmd(struct scsi_ctx *ctx, const uint8_t *cb, int len, bool scsi_cmd_is_data_read(struct scsi_ctx *ctx); bool scsi_cmd_is_data_write(struct scsi_ctx *ctx); size_t scsi_cmd_remaining_data_len(struct scsi_ctx *ctx); -size_t scsi_read_data(struct scsi_ctx *ctx, - uint8_t data_in_buf[static CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]); +size_t scsi_read_data(struct scsi_ctx *ctx, uint8_t *data_in_buf, size_t length); size_t scsi_write_data(struct scsi_ctx *ctx, const uint8_t *buf, size_t length); enum scsi_status_code scsi_cmd_get_status(struct scsi_ctx *ctx); From 520864916386062fa7c72c0be16e04b4fc5f26e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 7 Nov 2025 15:54:36 +0100 Subject: [PATCH 0357/3334] [nrf fromtree] tests: drivers: uart: uart_async_api: Fix test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drivers.uart.async_api filter is meet on nrf54l15 NS platform. However, overlay file is needed to configure uart peripheral. Add overlay required to pass uart_async_api test. Signed-off-by: Sebastian Głąb (cherry picked from commit eb41b8243c0ccb2669fccb822f3754c560fbfff7) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" From d45e116be8a44b634356177bb7c2c873948a4230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 09:19:37 +0100 Subject: [PATCH 0358/3334] [nrf fromtree] tests: drivers: clock_control: Enable tests on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable clock control tests on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 2e685e59d7551fe011402c2280fcd02ef860259e) --- .../clock_control/clock_control_api/testcase.yaml | 2 ++ .../clock_control/nrf_clock_calibration/testcase.yaml | 1 + .../clock_control/nrf_lf_clock_start/testcase.yaml | 9 +++++++++ tests/drivers/clock_control/onoff/testcase.yaml | 1 + 4 files changed, 13 insertions(+) diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index d3c2669641fc..3ea6f930f3dc 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -23,6 +23,7 @@ tests: - nrf52840dk/nrf52840 - nrf9160dk/nrf9160 - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -33,6 +34,7 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index 708e563900c2..39fec028a40b 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -9,6 +9,7 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index 17a783a48084..d789b0e52882 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -15,6 +15,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -32,6 +33,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -49,6 +51,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -65,6 +68,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -81,6 +85,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -97,6 +102,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -113,6 +119,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -129,6 +136,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -145,6 +153,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index 1f557c918ab8..4c50ba3c3ade 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -8,6 +8,7 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp From 046b19177101945ebedd862e555dc073c91ad6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 10:38:53 +0100 Subject: [PATCH 0359/3334] [nrf fromtree] tests: drivers: gpio: gpio_basic_api: Run test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable gpio_basic_api test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 26562e6b735c018d82fa90d9428c277804650a46) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ tests/drivers/gpio/gpio_basic_api/testcase.yaml | 1 + 2 files changed, 8 insertions(+) create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/gpio/gpio_basic_api/testcase.yaml b/tests/drivers/gpio/gpio_basic_api/testcase.yaml index 2acaf8d8f621..86431a3dbe5e 100644 --- a/tests/drivers/gpio/gpio_basic_api/testcase.yaml +++ b/tests/drivers/gpio/gpio_basic_api/testcase.yaml @@ -27,6 +27,7 @@ tests: drivers.gpio.nrf_sense_edge.nrf54l: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns extra_args: "EXTRA_DTC_OVERLAY_FILE=boards/nrf54l_sense_edge.overlay" drivers.gpio.mr_canhubk3_wkpu: From 8a2eff89107b3aeb1dbbdf9478f7d3a7a84fe4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 11:02:09 +0100 Subject: [PATCH 0360/3334] [nrf fromtree] tests: drivers: timer: nrf_grtc_timer: Run test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable nrf_grtc_timer test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 69fa00dc796aa3aebc00e74869c3979dbab80af7) --- tests/drivers/timer/nrf_grtc_timer/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index 140d9b222599..549234220ceb 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -6,6 +6,7 @@ common: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuflpr - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp From c929668f3e19242004581521c5c7d7789704115c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 11:18:57 +0100 Subject: [PATCH 0361/3334] [nrf fromtree] tests: drivers: i2s: Run I2S tests on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable I2S tests on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 539b5b523814cf4ab1018281d1f539293f745cec) --- .../i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ .../i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay create mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/i2s/i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" From 62b29a2bde6c1934f9f102ff6e33e396c3056a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 13:05:14 +0100 Subject: [PATCH 0362/3334] [nrf fromtree] boards: nordic: nrf54l15dk: Sort supported fetures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sort alphabetically supported features on - nrf54l15dk/nrf54l15/cpuapp, - nrf54l15dk/nrf54l15/cpuapp/ns, platforms. Signed-off-by: Sebastian Głąb (cherry picked from commit ef3a97acd7a93b62700867671582e5ba15b35e47) --- boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml | 2 +- boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml index e23a2a0073a9..6447d9d789bd 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml @@ -17,8 +17,8 @@ supported: - dmic - gpio - i2c + - i2s - pwm - retained_mem - spi - watchdog - - i2s diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml index 43bd7c8f2445..28b7a3c15db3 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml @@ -12,12 +12,11 @@ ram: 256 flash: 1524 supported: - adc + - counter - gpio - i2c + - i2s - spi - - counter - watchdog - - adc - - i2s vendor: nordic sysbuild: true From 821a72fea67174e3b0458eb1da4eecb102b94215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 13:48:41 +0100 Subject: [PATCH 0363/3334] [nrf fromtree] tests: drivers: pwm: Run test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable pwm_gpio_loopback test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 2a0b1d258dd21a42c3b5dd8e634a2a2bd509107e) --- .../nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml | 1 + 4 files changed, 10 insertions(+) create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml index 28b7a3c15db3..cff1b1970d39 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml @@ -16,6 +16,7 @@ supported: - gpio - i2c - i2s + - pwm - spi - watchdog vendor: nordic diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf new file mode 100644 index 000000000000..795414a504ab --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_SKIP_EDGE_NUM=4 diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml index 2959739d50be..448eccb5e3bb 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml @@ -20,6 +20,7 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From 20f1eb391fb278aef44fe774b9a2d7b0b0e1b4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 14:16:44 +0100 Subject: [PATCH 0364/3334] [nrf fromtree] tests: drivers: sensor: temp_sensor: Run test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable temp_senor test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 8a01e8d7555bd457f0f2ee778de656fad35592f1) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/drivers/sensor/temp_sensor/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/sensor/temp_sensor/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/sensor/temp_sensor/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/sensor/temp_sensor/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" From 42120aeeeed6c859e60f421cb1e0388272495886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 14:17:57 +0100 Subject: [PATCH 0365/3334] [nrf fromtree] tests: boards: nrf: qdec: Run test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable QDEC test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit e761ba19509fbc75dc7c94380f794298740d4286) --- .../qdec/boards/nrf54l15dk_nrf54l15_common.dtsi | 16 ++++++++++++++++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 5 ----- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 6 ++++++ .../boards/nrf54l15dk_nrf54l15_cpuflpr.overlay | 5 ----- tests/boards/nrf/qdec/testcase.yaml | 1 + 5 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi index f27294146527..2b9db5d36352 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi @@ -13,15 +13,19 @@ / { encoder-emulate { compatible = "gpio-leds"; + phase_a0: phase_a0 { gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; + phase_b0: phase_b0 { gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; + phase_a1: phase_a1 { gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; }; + phase_b1: phase_b1 { gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; }; @@ -29,10 +33,12 @@ qdec_loopbacks: loopbacks { compatible = "test-qdec-loopbacks"; + loopback0 { qdec = <&qdec20>; qenc-emul-gpios = <&phase_a0 &phase_b0>; }; + loopback1 { qdec = <&qdec21>; qenc-emul-gpios = <&phase_a1 &phase_b1>; @@ -99,3 +105,13 @@ led-pre = <500>; zephyr,pm-device-runtime-auto; }; + +/* To prevent enabling console receiver on cpuapp. */ +&uart20 { + disable-rx; +}; + +/* To prevent enabling console receiver on cpuflpr. */ +&uart30 { + disable-rx; +}; diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 65d42ec40869..68c360fe5eb8 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,8 +4,3 @@ */ #include "nrf54l15dk_nrf54l15_common.dtsi" - -/* To prevent enabling console receiver. */ -&uart20 { - disable-rx; -}; diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..6537ce98e293 --- /dev/null +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,6 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_common.dtsi" diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay index 76038a2fa012..68c360fe5eb8 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -4,8 +4,3 @@ */ #include "nrf54l15dk_nrf54l15_common.dtsi" - -/* To prevent enabling console receiver. */ -&uart30 { - disable-rx; -}; diff --git a/tests/boards/nrf/qdec/testcase.yaml b/tests/boards/nrf/qdec/testcase.yaml index 2908a68a6d14..e3eb262685ad 100644 --- a/tests/boards/nrf/qdec/testcase.yaml +++ b/tests/boards/nrf/qdec/testcase.yaml @@ -5,6 +5,7 @@ common: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr integration_platforms: From db649acc72a534717cf71958942a61569fac48d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 14:28:55 +0100 Subject: [PATCH 0366/3334] [nrf fromtree] tests: drivers: adc: Run test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable adc_api test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 4689b29e85860d3665ae6eabca5f855756129f42) --- .../adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ tests/drivers/adc/adc_api/testcase.yaml | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..43c28f0658e5 --- /dev/null +++ b/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/adc/adc_api/testcase.yaml b/tests/drivers/adc/adc_api/testcase.yaml index 3aa5e089b830..7b40b93431b9 100644 --- a/tests/drivers/adc/adc_api/testcase.yaml +++ b/tests/drivers/adc/adc_api/testcase.yaml @@ -11,7 +11,6 @@ tests: - nucleo_u031r8 - panb611evb/nrf54l15/cpuapp - panb611evb/nrf54l15/cpuapp/ns - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns From a2cb22d5e63614a2dac7fbdfdd462689c94b84eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 14:58:18 +0100 Subject: [PATCH 0367/3334] [nrf fromtree] tests: drivers: spi: Run spi_controller_peripheral on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable spi_controller_peripheral test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 399c0a928271f2b1d67e814318c32444c1888016) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ tests/drivers/spi/spi_controller_peripheral/testcase.yaml | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index f2c10b6c716d..030e2d52ddb9 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -12,6 +12,7 @@ common: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -81,6 +82,7 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -94,6 +96,7 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From 717be11e6a15ec39da71f126a23fea218c53b561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 12 Nov 2025 09:21:25 +0100 Subject: [PATCH 0368/3334] [nrf fromtree] tests: drivers: spi: spi_controller_peripheral: Fix DTS formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix DTS overlay file formatting as requested by the compliance check. Signed-off-by: Sebastian Głąb (cherry picked from commit 3a7afe31ed571251fe165c6d00ce8e08f20e1e18) --- .../spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay | 1 + .../boards/nrf54h20dk_nrf54h20_common.dtsi | 1 + .../boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay | 1 + .../boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay | 1 + 6 files changed, 6 insertions(+) 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 72bb74931860..db08930ddd9a 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay @@ -50,6 +50,7 @@ overrun-character = <0x00>; cs-gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; + dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; spi-max-frequency = ; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_common.dtsi index bad32ea4d1c9..6aeb34699d9f 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -60,6 +60,7 @@ overrun-character = <0x00>; cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; + dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay index 81b1303ede15..ee6a5e3c19eb 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay @@ -60,6 +60,7 @@ memory-regions = <&dma_fast_region>; cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; + dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay index be975607c1b5..ba00e866b60e 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay @@ -110,6 +110,7 @@ memory-regions = <&dma_fast_region>; cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; + dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 7915897066d8..cf83ac20a270 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -54,6 +54,7 @@ overrun-character = <0x00>; cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; + dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay index 7fd8d54d8db5..1c36704b5ba2 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay @@ -54,6 +54,7 @@ overrun-character = <0x00>; cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; + dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; From 6226fe112e47b34ebe96b25bb0e8400dc76fd115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 12 Nov 2025 09:28:09 +0100 Subject: [PATCH 0369/3334] [nrf fromtree] tests: drivers: spi: spi_controller_peripheral: Move test overlays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Overlay files that modify test configuration shall be stored in the main application directory. There is no board with f.e. '1mhz' name. Move test overlays from boards sub-direcotry to the main application directory. Signed-off-by: Sebastian Głąb (cherry picked from commit c359c4440ad85f10c38d012c6c2b8d0136ea9182) --- .../{boards => }/1m333333hz.overlay | 0 .../{boards => }/1mhz.overlay | 0 .../{boards => }/250khz.overlay | 0 .../{boards => }/2m666666hz.overlay | 0 .../{boards => }/2mhz.overlay | 0 .../{boards => }/4mhz.overlay | 0 .../{boards => }/500khz.overlay | 0 .../{boards => }/8mhz.overlay | 0 .../spi/spi_controller_peripheral/testcase.yaml | 16 ++++++++-------- 9 files changed, 8 insertions(+), 8 deletions(-) rename tests/drivers/spi/spi_controller_peripheral/{boards => }/1m333333hz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{boards => }/1mhz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{boards => }/250khz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{boards => }/2m666666hz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{boards => }/2mhz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{boards => }/4mhz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{boards => }/500khz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{boards => }/8mhz.overlay (100%) diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/1m333333hz.overlay b/tests/drivers/spi/spi_controller_peripheral/1m333333hz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/boards/1m333333hz.overlay rename to tests/drivers/spi/spi_controller_peripheral/1m333333hz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/1mhz.overlay b/tests/drivers/spi/spi_controller_peripheral/1mhz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/boards/1mhz.overlay rename to tests/drivers/spi/spi_controller_peripheral/1mhz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/250khz.overlay b/tests/drivers/spi/spi_controller_peripheral/250khz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/boards/250khz.overlay rename to tests/drivers/spi/spi_controller_peripheral/250khz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/2m666666hz.overlay b/tests/drivers/spi/spi_controller_peripheral/2m666666hz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/boards/2m666666hz.overlay rename to tests/drivers/spi/spi_controller_peripheral/2m666666hz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/2mhz.overlay b/tests/drivers/spi/spi_controller_peripheral/2mhz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/boards/2mhz.overlay rename to tests/drivers/spi/spi_controller_peripheral/2mhz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/4mhz.overlay b/tests/drivers/spi/spi_controller_peripheral/4mhz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/boards/4mhz.overlay rename to tests/drivers/spi/spi_controller_peripheral/4mhz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/500khz.overlay b/tests/drivers/spi/spi_controller_peripheral/500khz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/boards/500khz.overlay rename to tests/drivers/spi/spi_controller_peripheral/500khz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/8mhz.overlay b/tests/drivers/spi/spi_controller_peripheral/8mhz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/boards/8mhz.overlay rename to tests/drivers/spi/spi_controller_peripheral/8mhz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 030e2d52ddb9..3fa4cb16db6b 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -20,35 +20,35 @@ tests: drivers.spi.spi_mode0: extra_configs: - CONFIG_TESTED_SPI_MODE=0 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/250khz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="250khz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_mode1: extra_configs: - CONFIG_TESTED_SPI_MODE=1 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/500khz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="500khz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_mode2: extra_configs: - CONFIG_TESTED_SPI_MODE=2 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/1mhz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="1mhz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_mode3: extra_configs: - CONFIG_TESTED_SPI_MODE=3 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/2mhz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="2mhz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_1M333333Hz: extra_configs: - CONFIG_TESTED_SPI_MODE=0 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/1m333333hz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="1m333333hz.overlay" integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp @@ -56,7 +56,7 @@ tests: drivers.spi.spi_2M666666Hz: extra_configs: - CONFIG_TESTED_SPI_MODE=0 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/2m666666hz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="2m666666hz.overlay" integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp @@ -64,14 +64,14 @@ tests: drivers.spi.spi_4MHz: extra_configs: - CONFIG_TESTED_SPI_MODE=2 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/4mhz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="4mhz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_8MHz: extra_configs: - CONFIG_TESTED_SPI_MODE=1 - extra_args: EXTRA_DTC_OVERLAY_FILE="boards/8mhz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="8mhz.overlay" integration_platforms: - nrf52840dk/nrf52840 From 84621be509b0076ff9ae1979056cb85e4ac402b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 12 Nov 2025 10:56:59 +0100 Subject: [PATCH 0370/3334] [nrf fromtree] tests: drivers: counter: counter_basic_api: Fix test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add DTS overlay required to pass the test. Test filter is meet for nrf54l15 NS platform. However, test fails due to missing node configuration. Fix the counter test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 89723c18f96bc5d1d3cf81f87598a6c5374614c4) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..b34c0dadce5c --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_common.dtsi" From 429eaa3aca3d2b8cf76a9add093e98d983b42a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 12 Nov 2025 11:12:27 +0100 Subject: [PATCH 0371/3334] [nrf fromtree] tests: boards: nrf: i2c: i2c_slave: Fix DTS formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add reqired empty line as indicated by the compliance check. Add License header. Add information about GPIO loopbacks used by the test. Signed-off-by: Sebastian Głąb (cherry picked from commit 5501999078d0cd0d597e47f2a353bae189dc2d91) --- .../i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay | 12 ++++++++++++ .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 12 ++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 12 ++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 12 ++++++++++++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 12 ++++++++++++ 5 files changed, 60 insertions(+) diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay index cb4debaa7e3c..8f9f7135f7b2 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay @@ -1,3 +1,14 @@ +/* + * Copyright 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Two loopbacks are required: + * P1.01 - P1.02 + * P1.03 - P1.04 + */ + / { aliases { i2c-slave = &i2c1; @@ -44,6 +55,7 @@ dut_twim: &i2c0 { pinctrl-1 = <&i2c0_sleep_alt>; pinctrl-names = "default", "sleep"; clock-frequency = ; + sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay index 2ccac66dc723..c1f2a3b559ee 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -1,3 +1,14 @@ +/* + * Copyright 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Two loopbacks are required: + * P0.04 - P0.05 + * P0.06 - P0.07 + */ + / { aliases { i2c-slave = &i2c2; @@ -44,6 +55,7 @@ dut_twim: &i2c1 { pinctrl-1 = <&i2c1_sleep_alt>; pinctrl-names = "default", "sleep"; clock-frequency = ; + sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 444db89627d2..4f6894cf8585 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,3 +1,14 @@ +/* + * Copyright 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Two loopbacks are required: + * P2.08 - P2.09 + * P1.02 - P1.03 + */ + / { aliases { i2c-slave = &i2c131; @@ -48,6 +59,7 @@ dut_twim: &i2c130 { pinctrl-names = "default", "sleep"; clock-frequency = ; memory-regions = <&cpuapp_dma_region>; + sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.overlay index fbfb1e55772d..b42391719983 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -1,3 +1,14 @@ +/* + * Copyright 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Two loopbacks are required: + * P2.08 - P2.09 + * P1.02 - P1.03 + */ + / { aliases { i2c-slave = &i2c131; @@ -47,6 +58,7 @@ dut_twim: &i2c130 { pinctrl-1 = <&i2c130_sleep_alt>; pinctrl-names = "default", "sleep"; clock-frequency = ; + sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index feaec96977c7..aed3aca12dcb 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -1,3 +1,14 @@ +/* + * Copyright 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Two loopbacks are required: + * P1.08 - P1.09 + * P1.12 - P1.13 + */ + / { aliases { i2c-slave = &i2c22; @@ -47,6 +58,7 @@ dut_twim: &i2c21 { pinctrl-1 = <&i2c21_sleep_alt>; pinctrl-names = "default", "sleep"; clock-frequency = ; + sensor: sensor@54 { reg = <0x54>; }; From 6764387734081f50e613db93cc8312d33f3c7c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 12 Nov 2025 11:14:51 +0100 Subject: [PATCH 0372/3334] [nrf fromtree] tests: boards: nrf: i2c: i2c_slave: Run test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable i2c_slave test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 55f9d2c82c8c871dd8738332dcece5fee690b0e4) --- .../i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 + .../i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf new file mode 100644 index 000000000000..b01af3b36a7b --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index 02a2ee5f7518..32ac4fbfe9f3 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -15,6 +15,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -30,6 +31,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf52840dk/nrf52840 From bb1e2c3a97f908c7d3e566dbed08a19100b6f7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 12 Nov 2025 11:16:28 +0100 Subject: [PATCH 0373/3334] [nrf fromtree] tests: boards: nrf: i2c: i2c_slave: Move tests DTS files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move DTS overlay files that modify test configuration from boards sub-directory to the main application directory. There is no 'i2c_speed_fast' board. Signed-off-by: Sebastian Głąb (cherry picked from commit cfe1ffa5016c78ddd6eb98750254f5f61c0c6e40) --- .../nrf/i2c/i2c_slave/{boards => }/i2c_speed_fast.overlay | 0 .../i2c/i2c_slave/{boards => }/i2c_speed_fast_plus.overlay | 0 tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename tests/boards/nrf/i2c/i2c_slave/{boards => }/i2c_speed_fast.overlay (100%) rename tests/boards/nrf/i2c/i2c_slave/{boards => }/i2c_speed_fast_plus.overlay (100%) diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/i2c_speed_fast.overlay b/tests/boards/nrf/i2c/i2c_slave/i2c_speed_fast.overlay similarity index 100% rename from tests/boards/nrf/i2c/i2c_slave/boards/i2c_speed_fast.overlay rename to tests/boards/nrf/i2c/i2c_slave/i2c_speed_fast.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/i2c_speed_fast_plus.overlay b/tests/boards/nrf/i2c/i2c_slave/i2c_speed_fast_plus.overlay similarity index 100% rename from tests/boards/nrf/i2c/i2c_slave/boards/i2c_speed_fast_plus.overlay rename to tests/boards/nrf/i2c/i2c_slave/i2c_speed_fast_plus.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index 32ac4fbfe9f3..8e324bcaf563 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -41,7 +41,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - - EXTRA_DTC_OVERLAY_FILE="boards/i2c_speed_fast.overlay" + - EXTRA_DTC_OVERLAY_FILE="i2c_speed_fast.overlay" boards.nrf.i2c.i2c_slave.fast_plus: platform_allow: - nrf5340dk/nrf5340/cpuapp @@ -52,4 +52,4 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr extra_args: - - EXTRA_DTC_OVERLAY_FILE="boards/i2c_speed_fast_plus.overlay" + - EXTRA_DTC_OVERLAY_FILE="i2c_speed_fast_plus.overlay" From cefd7016eb655544b32fb9bddf314a571972c1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 12 Nov 2025 11:42:04 +0100 Subject: [PATCH 0374/3334] [nrf fromtree] tests: drivers: watchdog: wdt_basic_api: Run test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable wdt_basic_api test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 80a00b818d111ae6670c27846fcdc17f7c30e8b4) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ tests/drivers/watchdog/wdt_basic_api/testcase.yaml | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml index 6efd3fa94e91..8ed81c715f90 100644 --- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml +++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml @@ -26,7 +26,6 @@ tests: - panb611evb/nrf54l15/cpuflpr - panb611evb/nrf54l15/cpuflpr/xip - mimxrt700_evk/mimxrt798s/cm33_cpu1 - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns From 7ef48ee9fc0635b71dc6b67fdf49fb7c3ed1590d Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 21 Oct 2025 12:33:31 +0200 Subject: [PATCH 0375/3334] [nrf fromtree] tests: remove misuse of snippets Tests cases which needs to apply a single overlay file for testing should not use snippets. Cleanup the test case by reordering the snippet to be SoC specific and adjust overlay selection using FILE_SUFFIX. Signed-off-by: Torsten Rasmussen (cherry picked from commit bbfcaa2e1b9cce71336c8373758b976143a51065) --- .../bl54l15_dvk_nrf54l15_cpuapp.overlay | 19 ----------------- .../bl54l15u_dvk_nrf54l15_cpuapp.overlay | 19 ----------------- .../snippets/nrf_comp/snippet.yml | 21 ------------------- .../bl54l15_dvk_nrf54l15_cpuapp.overlay | 15 ------------- .../bl54l15u_dvk_nrf54l15_cpuapp.overlay | 15 ------------- .../snippets/nrf_lpcomp/snippet.yml | 21 ------------------- .../nrf5340_cpuapp_nrf_comp.overlay} | 0 .../nrf5340_cpuapp_nrf_lpcomp.overlay} | 0 .../nrf54h20_cpuapp_nrf_comp.overlay} | 0 .../nrf54h20_cpuapp_nrf_lpcomp.overlay} | 0 .../nrf54l15_cpuapp_nrf_comp.overlay} | 0 .../nrf54l15_cpuapp_nrf_lpcomp.overlay} | 0 .../nrf54lm20a_cpuapp_nrf_comp.overlay} | 0 .../nrf54lm20a_cpuapp_nrf_lpcomp.overlay} | 0 .../comparator/gpio_loopback/testcase.yaml | 6 ++---- 15 files changed, 2 insertions(+), 114 deletions(-) delete mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml delete mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml rename tests/drivers/comparator/gpio_loopback/{snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay => socs/nrf5340_cpuapp_nrf_comp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay => socs/nrf5340_cpuapp_nrf_lpcomp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay => socs/nrf54h20_cpuapp_nrf_comp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay => socs/nrf54h20_cpuapp_nrf_lpcomp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay => socs/nrf54l15_cpuapp_nrf_comp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay => socs/nrf54l15_cpuapp_nrf_lpcomp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay => socs/nrf54lm20a_cpuapp_nrf_comp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay => socs/nrf54lm20a_cpuapp_nrf_lpcomp.overlay} (100%) diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 84d3b9f57594..000000000000 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * Copyright (c) 2025 Ezurio LLC - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&comp { - main-mode = "SE"; - psel = ; /* P1.11 */ - refsel = "INT_1V2"; - sp-mode = "HIGH"; - th-up = <63>; - th-down = <59>; - isource = "DISABLED"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 84d3b9f57594..000000000000 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * Copyright (c) 2025 Ezurio LLC - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&comp { - main-mode = "SE"; - psel = ; /* P1.11 */ - refsel = "INT_1V2"; - sp-mode = "HIGH"; - th-up = <63>; - th-down = <59>; - isource = "DISABLED"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml deleted file mode 100644 index 9d876bfded03..000000000000 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -name: gpio_loopback_nrf_comp - -boards: - nrf5340dk/nrf5340/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay - nrf54h20dk/nrf54h20/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay - nrf54l15dk/nrf54l15/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay - nrf54lm20dk/nrf54lm20a/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay - ophelia4ev/nrf54l15/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e208b85b2ae9..000000000000 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * Copyright (c) 2025 Ezurio LLC - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&comp { - compatible = "nordic,nrf-lpcomp"; - psel = ; /* P1.11 */ - refsel = "VDD_4_8"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e208b85b2ae9..000000000000 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * Copyright (c) 2025 Ezurio LLC - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&comp { - compatible = "nordic,nrf-lpcomp"; - psel = ; /* P1.11 */ - refsel = "VDD_4_8"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml deleted file mode 100644 index c2a2005af4d3..000000000000 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -name: gpio_loopback_nrf_lpcomp - -boards: - nrf5340dk/nrf5340/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay - nrf54h20dk/nrf54h20/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay - nrf54l15dk/nrf54l15/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay - nrf54lm20dk/nrf54lm20a/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay - ophelia4ev/nrf54l15/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf5340_cpuapp_nrf_comp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay rename to tests/drivers/comparator/gpio_loopback/socs/nrf5340_cpuapp_nrf_comp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf5340_cpuapp_nrf_lpcomp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay rename to tests/drivers/comparator/gpio_loopback/socs/nrf5340_cpuapp_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54h20_cpuapp_nrf_comp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay rename to tests/drivers/comparator/gpio_loopback/socs/nrf54h20_cpuapp_nrf_comp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54h20_cpuapp_nrf_lpcomp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay rename to tests/drivers/comparator/gpio_loopback/socs/nrf54h20_cpuapp_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_nrf_comp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay rename to tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_nrf_comp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_nrf_lpcomp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay rename to tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20a_cpuapp_nrf_comp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay rename to tests/drivers/comparator/gpio_loopback/socs/nrf54lm20a_cpuapp_nrf_comp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20a_cpuapp_nrf_lpcomp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay rename to tests/drivers/comparator/gpio_loopback/socs/nrf54lm20a_cpuapp_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index dfebf3644756..d6ced33b76e5 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -19,8 +19,7 @@ tests: - frdm_ke15z drivers.comparator.gpio_loopback.nrf_comp: extra_args: - - SNIPPET_ROOT="." - - SNIPPET="gpio_loopback_nrf_comp" + - FILE_SUFFIX="nrf_comp" platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp @@ -29,8 +28,7 @@ tests: - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: extra_args: - - SNIPPET_ROOT="." - - SNIPPET="gpio_loopback_nrf_lpcomp" + - FILE_SUFFIX="nrf_lpcomp" platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp From 3529c7d9aa7136c0862d3732f2ccd030e13c9945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 10 Nov 2025 08:36:00 +0100 Subject: [PATCH 0376/3334] [nrf fromtree] tests: drivers: comparator: Enable test on nrf54l15 NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlays required to run the gpio_loopback test on nrf54l15dk/nrf54l15/cpuapp/ns platform. Signed-off-by: Sebastian Głąb (cherry picked from commit 07d45777628ffa846d386edf710a49868c844a55) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 +++++++ .../gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay | 7 +++++++ .../socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay | 7 +++++++ tests/drivers/comparator/gpio_loopback/testcase.yaml | 2 ++ 4 files changed, 23 insertions(+) create mode 100644 tests/drivers/comparator/gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/comparator/gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..f1d1d387c2e0 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay new file mode 100644 index 000000000000..c79dc80c8423 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15_cpuapp_nrf_comp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay new file mode 100644 index 000000000000..2b1e4b9009ca --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15_cpuapp_nrf_lpcomp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index d6ced33b76e5..706e2ac3757f 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -24,6 +24,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: @@ -33,5 +34,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From a30145237ba44a1e8659d80340f215074ef7c3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 7 Oct 2025 15:33:26 +0200 Subject: [PATCH 0377/3334] [nrf fromtree] samples: boards: nordic: spis_wakeup: Run sample on APP+PPR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend sample with possibility to use PPR core instead of Radio core. Signed-off-by: Sebastian Głąb (cherry picked from commit 87d15bb2bebf3addf609b9fbeb4f18ef5526ac6f) --- .../nordic/spis_wakeup/Kconfig.sysbuild | 22 ++++++ .../boards/nrf54h20dk_nrf54h20_common.dtsi | 61 +++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 59 +--------------- ...4h20dk_nrf54h20_cpuapp_with_cpuppr.overlay | 16 +++++ samples/boards/nordic/spis_wakeup/sample.yaml | 30 +++++--- .../boards/nordic/spis_wakeup/sysbuild.cmake | 4 +- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 68 +++++++++++++++++++ .../nrf54h20dk_nrf54h20_cpuppr_xip.conf | 1 + .../nrf54h20dk_nrf54h20_cpuppr_xip.overlay | 6 ++ .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 3 + .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 64 +---------------- .../spis_wakeup/wakeup_trigger/prj.conf | 3 - 12 files changed, 203 insertions(+), 134 deletions(-) create mode 100644 samples/boards/nordic/spis_wakeup/Kconfig.sysbuild create mode 100644 samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_common.dtsi create mode 100644 samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay create mode 100644 samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_common.dtsi create mode 100644 samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf create mode 100644 samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay create mode 100644 samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/boards/nordic/spis_wakeup/Kconfig.sysbuild b/samples/boards/nordic/spis_wakeup/Kconfig.sysbuild new file mode 100644 index 000000000000..caf02cc11919 --- /dev/null +++ b/samples/boards/nordic/spis_wakeup/Kconfig.sysbuild @@ -0,0 +1,22 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig" + +choice REMOTE_NRF54H20_CORE + prompt "Remote nRF54h20 core" + default REMOTE_NRF54H20_CPURAD_CORE + depends on SOC_NRF54H20_CPUAPP + +config REMOTE_NRF54H20_CPUPPR_CORE + bool "ppr core" + +config REMOTE_NRF54H20_CPURAD_CORE + bool "cpurad" + +endchoice + +config REMOTE_BOARD + string + default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPURAD_CORE + default "$(BOARD)/nrf54h20/cpuppr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUPPR_CORE diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_common.dtsi b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_common.dtsi new file mode 100644 index 000000000000..7ce17ba9bd1a --- /dev/null +++ b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + led = &led0; + spis = &spi130; + /delete-property/ sw0; + /delete-property/ sw1; + /delete-property/ sw2; + /delete-property/ sw3; + /delete-property/ mcuboot-led0; + /delete-property/ mcuboot-button0; + }; + /delete-node/ buttons; +}; + +&exmif { + status = "disabled"; +}; + +&gpiote130 { + status = "okay"; + owned-channels = <0>; +}; + +&pinctrl { + spi130_default_alt: spi130_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spi130_sleep_alt: spi130_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&spi130 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spi130_default_alt>; + pinctrl-1 = <&spi130_sleep_alt>; + pinctrl-names = "default", "sleep"; + wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + memory-regions = <&cpuapp_dma_region>; + /delete-property/ rx-delay-supported; + /delete-property/ rx-delay; +}; diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 8023020f2caa..75d90b40595a 100644 --- a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -3,66 +3,13 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nrf54h20dk_nrf54h20_common.dtsi" + +/* LED1 will be used by the cpurad core. */ / { aliases { - led = &led0; - spis = &spi130; /delete-property/ led1; - /delete-property/ sw0; - /delete-property/ sw1; - /delete-property/ sw2; - /delete-property/ sw3; - /delete-property/ mcuboot-led0; - /delete-property/ mcuboot-button0; }; - /delete-node/ buttons; }; /delete-node/ &led1; - -&exmif { - status = "disabled"; -}; - -&gpiote130 { - status = "okay"; - owned-channels = <0>; -}; - -&pinctrl { - spi130_default_alt: spi130_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi130_sleep_alt: spi130_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -&spi130 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi130_default_alt>; - pinctrl-1 = <&spi130_sleep_alt>; - pinctrl-names = "default", "sleep"; - wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; - memory-regions = <&cpuapp_dma_region>; - /delete-property/ rx-delay-supported; - /delete-property/ rx-delay; -}; - -&uart136 { - zephyr,pm-device-runtime-auto; -}; diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay new file mode 100644 index 000000000000..fc0f24ad71c0 --- /dev/null +++ b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54h20dk_nrf54h20_common.dtsi" + +&spi131 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; + +&uart135 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +}; diff --git a/samples/boards/nordic/spis_wakeup/sample.yaml b/samples/boards/nordic/spis_wakeup/sample.yaml index 7bc97eedcb99..a2dca27d3e82 100644 --- a/samples/boards/nordic/spis_wakeup/sample.yaml +++ b/samples/boards/nordic/spis_wakeup/sample.yaml @@ -1,22 +1,32 @@ common: sysbuild: true depends_on: spi + tags: + - spi + harness: console + harness_config: + fixture: spi_loopback + type: multi_line + ordered: true + regex: + - ".*SPIS: waiting for SPI transfer" + - ".*SPIS: woken up by" sample: name: SPI wakeup sample tests: sample.drivers.spis.wakeup: - tags: - - spi platform_allow: - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp - harness: console - harness_config: - fixture: spi_loopback - type: multi_line - ordered: true - regex: - - ".*SPIS: waiting for SPI transfer" - - ".*SPIS: woken up by" + sample.drivers.spis.wakeup.ppr: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + extra_args: + - SB_CONFIG_REMOTE_NRF54H20_CPUPPR_CORE=y + - spis_wakeup_CONFIG_SOC_NRF54H20_CPURAD_ENABLE=n + - spis_wakeup_SNIPPET=nordic-ppr-xip + - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay" diff --git a/samples/boards/nordic/spis_wakeup/sysbuild.cmake b/samples/boards/nordic/spis_wakeup/sysbuild.cmake index bbd350fbe637..becedfd6971f 100644 --- a/samples/boards/nordic/spis_wakeup/sysbuild.cmake +++ b/samples/boards/nordic/spis_wakeup/sysbuild.cmake @@ -3,12 +3,12 @@ # SPDX-License-Identifier: Apache-2.0 # -if(SB_CONFIG_SOC_NRF54H20) +if(SB_CONFIG_REMOTE_BOARD) # Add remote project ExternalZephyrProject_Add( APPLICATION wakeup_trigger SOURCE_DIR ${APP_DIR}/wakeup_trigger - BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpurad + BOARD ${SB_CONFIG_REMOTE_BOARD} BOARD_REVISION ${BOARD_REVISION} ) endif() diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_common.dtsi b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_common.dtsi new file mode 100644 index 000000000000..7ebf62fdae49 --- /dev/null +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + led = &led1; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + }; +}; + +&gpiote130 { + status = "okay"; + owned-channels = <1>; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio9 { + status = "okay"; +}; + +&pinctrl { + spi131_default_alt: spi131_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi131_sleep_alt: spi131_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +&spi131 { + compatible = "nordic,nrf-spim"; + status = "okay"; + pinctrl-0 = <&spi131_default_alt>; + pinctrl-1 = <&spi131_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + wake-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + + spim_dt: spi-device@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = ; + }; +}; diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf new file mode 100644 index 000000000000..7b0ca9cbcfa3 --- /dev/null +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf @@ -0,0 +1 @@ +CONFIG_ASSERT=n diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay new file mode 100644 index 000000000000..0e01ff40bb9e --- /dev/null +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54h20dk_nrf54h20_common.dtsi" diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..9eaa8724bb39 --- /dev/null +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,3 @@ +CONFIG_PM=y + +CONFIG_ASSERT=y diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.overlay index c54fb28742e9..846a44d165a3 100644 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -3,70 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -/ { - aliases { - led = &led1; - }; - - leds { - compatible = "gpio-leds"; - led1: led_1 { - gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - }; -}; - -&gpiote130 { - status = "okay"; - owned-channels = <1>; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio9 { - status = "okay"; -}; - -&pinctrl { - spi131_default_alt: spi131_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi131_sleep_alt: spi131_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; +#include "nrf54h20dk_nrf54h20_common.dtsi" &spi131 { - compatible = "nordic,nrf-spim"; - status = "okay"; - pinctrl-0 = <&spi131_default_alt>; - pinctrl-1 = <&spi131_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; - wake-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; - zephyr,pm-device-runtime-auto; memory-regions = <&cpurad_dma_region>; - spim_dt: spi-device@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -&uart135 { - zephyr,pm-device-runtime-auto; }; diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf index ad4577807f89..662d75582fea 100644 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf @@ -2,10 +2,7 @@ CONFIG_SPI=y CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500 CONFIG_GPIO=y -CONFIG_PM=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y -CONFIG_ASSERT=y - CONFIG_LOG=y From 41ee118d809c4e28685b6985ee82cf0b677234f8 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Thu, 13 Nov 2025 11:42:24 +0100 Subject: [PATCH 0378/3334] [nrf fromtree] drivers: timer: nrf_grtc_timer: Add system_clock_disable implementation Add implementation of `sys_clock_disable` function for GRTC timer. Signed-off-by: Adam Kondraciuk (cherry picked from commit dfff593b779232c88079733fad85122ea68c8922) --- drivers/timer/Kconfig.nrf_grtc | 1 + drivers/timer/nrf_grtc_timer.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/timer/Kconfig.nrf_grtc b/drivers/timer/Kconfig.nrf_grtc index 24534ae3f95c..ab230245ebfd 100644 --- a/drivers/timer/Kconfig.nrf_grtc +++ b/drivers/timer/Kconfig.nrf_grtc @@ -6,6 +6,7 @@ menuconfig NRF_GRTC_TIMER default y depends on DT_HAS_NORDIC_NRF_GRTC_ENABLED select TICKLESS_CAPABLE + select SYSTEM_TIMER_HAS_DISABLE_SUPPORT select TIMER_HAS_64BIT_CYCLE_COUNTER select NRFX_GRTC help diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index a7d3d90ef196..94ec7e3a240f 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -368,6 +368,10 @@ uint64_t z_nrf_grtc_timer_startup_value_get(void) #if defined(CONFIG_POWEROFF) && defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) { + if (!nrfx_grtc_init_check()) { + return -ENOTSUP; + } + nrfx_err_t err_code; static struct k_spinlock lock; static uint8_t systemoff_channel; @@ -460,6 +464,21 @@ ISR_DIRECT_DECLARE(nrfx_grtc_direct_irq_handler) } #endif +void sys_clock_disable(void) +{ + nrfx_grtc_uninit(); +#if defined(CONFIG_CLOCK_CONTROL_NRF) + int err; + struct onoff_manager *mgr = + z_nrf_clock_control_get_onoff((clock_control_subsys_t)CLOCK_CONTROL_NRF_TYPE_LFCLK); + + err = onoff_release(mgr); + __ASSERT_NO_MSG(err >= 0); + + nrfx_coredep_delay_us(1000); +#endif +} + static int sys_clock_driver_init(void) { nrfx_err_t err_code; From 2bcbae54d8b89d6fe160f795fdb075234f1f4e4b Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Thu, 13 Nov 2025 11:44:43 +0100 Subject: [PATCH 0379/3334] [nrf fromtree] samples: boards: nrf: system_off: Add sample with system clock disabled Extend the system off samples by adding an option to disable the system clock. When the system clock is disabled additional power savings can be observed. After using the `sys_clock_disable()` function, the GRTC is turned off making system time-related features unavailable. Signed-off-by: Adam Kondraciuk (cherry picked from commit 127ba8d494bc6922a34ff26a8e42c118283d5909) --- samples/boards/nordic/system_off/Kconfig | 5 +++ samples/boards/nordic/system_off/sample.yaml | 38 ++++++++++++++++++++ samples/boards/nordic/system_off/src/main.c | 8 +++++ 3 files changed, 51 insertions(+) diff --git a/samples/boards/nordic/system_off/Kconfig b/samples/boards/nordic/system_off/Kconfig index c7b4a9f85575..f5e5ce944acc 100644 --- a/samples/boards/nordic/system_off/Kconfig +++ b/samples/boards/nordic/system_off/Kconfig @@ -23,4 +23,9 @@ config LPCOMP_WAKEUP_ENABLE help Enable system off wakeup from analog comparator. +config SYS_CLOCK_DISABLE + bool "Power down system clock before system off" + help + System clock and GRTC will be switched off during system off. + source "Kconfig.zephyr" diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index b11f3439e7f6..ce9321a845b3 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -47,6 +47,44 @@ tests: - "Off count: 0" - "Active Ticks:" - "Entering system off; press sw0 to restart" + sample.boards.nrf.system_off.grtc_off: + platform_allow: + - nrf54l15dk/nrf54l05/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_configs: + - CONFIG_SYS_CLOCK_DISABLE=y + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "system off demo" + - "Retained data not supported" + - "System clock will be disabled" + - "Entering system off; press sw0 to restart" + sample.boards.nrf.system_off.retained_mem.grtc_off: + platform_allow: + - nrf54l15dk/nrf54l05/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_configs: + - CONFIG_APP_USE_RETAINED_MEM=y + - CONFIG_SYS_CLOCK_DISABLE=y + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "system off demo" + - "Retained data: valid" + - "Boot count: 1" + - "Off count: 0" + - "Active Ticks:" + - "System clock will be disabled" + - "Entering system off; press sw0 to restart" sample.boards.nrf.system_off.grtc_wakeup: platform_allow: - nrf54l15dk/nrf54l05/cpuapp diff --git a/samples/boards/nordic/system_off/src/main.c b/samples/boards/nordic/system_off/src/main.c index b4c2eeb2b1bb..020e88a5449e 100644 --- a/samples/boards/nordic/system_off/src/main.c +++ b/samples/boards/nordic/system_off/src/main.c @@ -17,6 +17,7 @@ #include #include #include +#include #define NON_WAKEUP_RESET_REASON (RESET_PIN | RESET_SOFTWARE | RESET_POR | RESET_DEBUG) @@ -97,11 +98,15 @@ int main(void) printf("Retained data not supported\n"); } +#if defined(CONFIG_SYS_CLOCK_DISABLE) + printf("System clock will be disabled\n"); +#endif #if defined(CONFIG_GRTC_WAKEUP_ENABLE) int err = z_nrf_grtc_wakeup_prepare(DEEP_SLEEP_TIME_S * USEC_PER_SEC); if (err < 0) { printk("Unable to prepare GRTC as a wake up source (err = %d).\n", err); + return 0; } else { printk("Entering system off; wait %u seconds to restart\n", DEEP_SLEEP_TIME_S); } @@ -141,6 +146,9 @@ int main(void) } hwinfo_clear_reset_cause(); +#if defined(CONFIG_SYS_CLOCK_DISABLE) + sys_clock_disable(); +#endif sys_poweroff(); return 0; From 764a90bc3fce93f3bcb3e06aae1ee2bd11348ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Tue, 28 Oct 2025 10:37:16 +0100 Subject: [PATCH 0380/3334] [nrf fromtree] drivers: flash: nrf_qspi_nor: Fix compilation with QER set to NONE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit d1abe40fb0af5d6219a0bcd824c4ea93ab90877a. Function `qspi_wait_while_writing()` (and also `qspi_rdsr()` that is called by it) is now always required for `qspi_erase()`, so it can no longer be under `#if !IS_EQUAL(INST_0_QER, JESD216_DW15_QER_VAL_NONE)`. Also definition of `dev_config` in `configure_chip()` needs to be moved, as for QER set to NONE, it is not used and causes a compilation warning. Add a test case that will ensure the driver can be built successfully with `quad-enable-requirements = "NONE"`. Signed-off-by: Andrzej Głąbek (cherry picked from commit 68fab5fd2ccd6d2dc326a1b1c414cc6db72325a5) --- drivers/flash/nrf_qspi_nor.c | 4 ++-- .../flash/common/boards/nrf52840dk_qer_none.overlay | 9 +++++++++ tests/drivers/flash/common/testcase.yaml | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/drivers/flash/common/boards/nrf52840dk_qer_none.overlay diff --git a/drivers/flash/nrf_qspi_nor.c b/drivers/flash/nrf_qspi_nor.c index e9eb5a17302b..110a2d27c7e9 100644 --- a/drivers/flash/nrf_qspi_nor.c +++ b/drivers/flash/nrf_qspi_nor.c @@ -481,7 +481,6 @@ static int qspi_send_cmd(const struct device *dev, const struct qspi_cmd *cmd, return qspi_get_zephyr_ret_code(res); } -#if !IS_EQUAL(INST_0_QER, JESD216_DW15_QER_VAL_NONE) /* RDSR. Negative value is error. */ static int qspi_rdsr(const struct device *dev, uint8_t sr_num) { @@ -525,6 +524,7 @@ static int qspi_wait_while_writing(const struct device *dev, k_timeout_t poll_pe return (rc < 0) ? rc : 0; } +#if !IS_EQUAL(INST_0_QER, JESD216_DW15_QER_VAL_NONE) static int qspi_wrsr(const struct device *dev, uint8_t sr_val, uint8_t sr_num) { int rc = 0; @@ -657,7 +657,6 @@ static int qspi_erase(const struct device *dev, uint32_t addr, uint32_t size) static int configure_chip(const struct device *dev) { - const struct qspi_nor_config *dev_config = dev->config; int rc = 0; /* Set QE to match transfer mode. If not using quad @@ -668,6 +667,7 @@ static int configure_chip(const struct device *dev) * S2B1v1/4/5/6. Other options require more logic. */ #if !IS_EQUAL(INST_0_QER, JESD216_DW15_QER_VAL_NONE) + const struct qspi_nor_config *dev_config = dev->config; nrf_qspi_prot_conf_t const *prot_if = &dev_config->nrfx_cfg.prot_if; bool qe_value = (prot_if->writeoc == NRF_QSPI_WRITEOC_PP4IO) || diff --git a/tests/drivers/flash/common/boards/nrf52840dk_qer_none.overlay b/tests/drivers/flash/common/boards/nrf52840dk_qer_none.overlay new file mode 100644 index 000000000000..190537bf8536 --- /dev/null +++ b/tests/drivers/flash/common/boards/nrf52840dk_qer_none.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2025, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&mx25r64 { + quad-enable-requirements = "NONE"; +}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 550c73ffb1d5..d4ac7537b54d 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -29,6 +29,13 @@ tests: - CONFIG_TEST_DRIVER_FLASH_SIZE=8388608 integration_platforms: - nrf52840dk/nrf52840 + drivers.flash.common.nrf_qspi_nor.qer_none: + build_only: true + platform_allow: nrf52840dk/nrf52840 + extra_args: + - DTC_OVERLAY_FILE=boards/nrf52840dk_qer_none.overlay + integration_platforms: + - nrf52840dk/nrf52840 drivers.flash.common.nrf_qspi_nor_4B_addr: platform_allow: nrf52840dk/nrf52840 extra_configs: From 4f7ae1cd853094a2cf33e800b2bb2662347c90b1 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 18 Nov 2025 12:34:06 +0100 Subject: [PATCH 0381/3334] [nrf fromlist] tests: bluetooth: tester: fix model rx handler Commit fixes the model rx handler. Model can receive maximum access payload. Test should be able fit maximum access payload and its own header for serial communication. Upstream PR #: 99576 Signed-off-by: Aleksandr Khromykh (cherry picked from commit 0985cced399a26c994a0736ba8c00dc852e22ec3) --- tests/bluetooth/tester/src/btp/btp_mesh.h | 2 +- tests/bluetooth/tester/src/btp_mesh.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/bluetooth/tester/src/btp/btp_mesh.h b/tests/bluetooth/tester/src/btp/btp_mesh.h index 353971261b43..78074e1001e0 100644 --- a/tests/bluetooth/tester/src/btp/btp_mesh.h +++ b/tests/bluetooth/tester/src/btp/btp_mesh.h @@ -1194,7 +1194,7 @@ struct btp_mesh_prov_node_added_ev { struct btp_mesh_model_recv_ev { uint16_t src; uint16_t dst; - uint8_t payload_len; + uint16_t payload_len; uint8_t payload[]; } __packed; diff --git a/tests/bluetooth/tester/src/btp_mesh.c b/tests/bluetooth/tester/src/btp_mesh.c index 11156f36c7ec..3a84e8226197 100644 --- a/tests/bluetooth/tester/src/btp_mesh.c +++ b/tests/bluetooth/tester/src/btp_mesh.c @@ -5332,12 +5332,12 @@ void net_recv_ev(uint8_t ttl, uint8_t ctl, uint16_t src, uint16_t dst, const voi void model_recv_ev(uint16_t src, uint16_t dst, const void *payload, size_t payload_len) { - NET_BUF_SIMPLE_DEFINE(buf, UINT8_MAX); + NET_BUF_SIMPLE_DEFINE(buf, BT_MESH_RX_SDU_MAX + sizeof(struct btp_mesh_model_recv_ev)); struct btp_mesh_model_recv_ev *ev; LOG_DBG("src 0x%04x dst 0x%04x payload_len %zu", src, dst, payload_len); - if (payload_len > net_buf_simple_tailroom(&buf)) { + if (payload_len + sizeof(*ev) > net_buf_simple_tailroom(&buf)) { LOG_ERR("Payload size exceeds buffer size"); return; } From 999c521d05e6e036ba3f119df7cce3370a2321b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Mon, 20 Oct 2025 09:26:18 +0200 Subject: [PATCH 0382/3334] [nrf fromtree] Bluetooth: Host: Add BT_APP_PASSKEY Kconfig option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the BT_APP_PASSKEY Kconfig, which allows the application to provide passkeys for pairing using the new `app_passkey()` callback. This is an alternative to BT_FIXED_PASSKEY, which will be deprecated in a later commit. Signed-off-by: Håvard Reierstad (cherry picked from commit 6c64054d6e18912e0c88ee90b421441ba0d9d236) Signed-off-by: alperen sener --- include/zephyr/bluetooth/conn.h | 31 +++++++++++++ subsys/bluetooth/host/Kconfig | 10 +++++ subsys/bluetooth/host/smp.c | 77 +++++++++++++++++++++++++-------- 3 files changed, 99 insertions(+), 19 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 67c3db64e92a..0ebfb89bf4bf 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -2464,6 +2464,13 @@ struct bt_conn_pairing_feat { }; #endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */ +/** + * Special passkey value that can be used to generate a random passkey when using the + * app_passkey callback from @ref bt_conn_auth_cb. + * + */ +#define BT_PASSKEY_RAND 0xffffffff + /** Authenticated pairing callback structure */ struct bt_conn_auth_cb { #if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT) @@ -2663,6 +2670,30 @@ struct bt_conn_auth_cb { */ void (*pincode_entry)(struct bt_conn *conn, bool highsec); #endif + +#if defined(CONFIG_BT_APP_PASSKEY) + /** @brief Allow the application to provide a passkey for pairing. + * + * If implemented, this callback allows the application to provide passkeys for pairing. + * The valid range of passkeys is 0 - 999999. The application shall return the passkey for + * pairing, or BT_PASSKEY_RAND to generate a random passkey. This callback is invoked only + * for the Passkey Entry method as defined in Core Specification Vol. 3, Part H. Which + * device in the pairing is showing the passkey depends on the IO capabilities of the + * device; see Table 2.8 of the Bluetooth Core Specification V6.0, Vol. 3, Part H for more + * details. For the purposes of this table, the device gains the "display" capability when + * this callback is non-NULL. This is irrespective of whether the callback returns a + * specified key or BT_PASSKEY_RAND. + * + * + * @note When using this callback, it is the responsibility of the application to use + * random and unique keys. + * + * @param conn Connection where pairing is currently active. + * @return Passkey for pairing, or BT_PASSKEY_RAND for the Host to generate a random + * passkey. + */ + uint32_t (*app_passkey)(struct bt_conn *conn); +#endif /* CONFIG_BT_APP_PASSKEY */ }; /** Authenticated pairing information callback structure */ diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 41fce83a0048..b45febe61869 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -689,6 +689,16 @@ config BT_FIXED_PASSKEY bt_passkey_set() API to set a fixed passkey. If set, the pairing_confirm() callback will be called for all incoming pairings. +config BT_APP_PASSKEY + bool "Allow the application to provide passkeys for pairing" + depends on !BT_FIXED_PASSKEY + help + With this option enabled, the application will be able to provide passkeys for pairing + using the app_passkey() callback. If the application does not provide a passkey, a + random passkey will be generated by the Host. + + WARNING: It is the responsibility of the application to use random and unique keys. + config BT_USE_DEBUG_KEYS bool "Security Manager Debug Mode" help diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 702e6fc0d215..b935c61d2a36 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -222,10 +222,10 @@ struct bt_smp { atomic_t bondable; }; -static unsigned int fixed_passkey = BT_PASSKEY_INVALID; +static unsigned int fixed_passkey = BT_PASSKEY_RAND; #define DISPLAY_FIXED(smp) (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && \ - fixed_passkey != BT_PASSKEY_INVALID && \ + fixed_passkey != BT_PASSKEY_RAND && \ (smp)->method == PASSKEY_DISPLAY) #if !defined(CONFIG_BT_SMP_SC_PAIR_ONLY) @@ -363,9 +363,21 @@ static uint8_t get_io_capa(struct bt_smp *smp) return BT_SMP_IO_DISPLAY_YESNO; } +#if defined(CONFIG_BT_APP_PASSKEY) + /* Implementation of the app_passkey cb implies that the application can "know" the passkey + * without actually having a display, thus earning the "display" capability. + */ + if (smp_auth_cb->app_passkey) { + if (smp_auth_cb->passkey_entry) { + return BT_SMP_IO_KEYBOARD_DISPLAY; + } + + return BT_SMP_IO_DISPLAY_ONLY; + } +#endif /* CONFIG_BT_APP_PASSKEY */ + if (smp_auth_cb->passkey_entry) { - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && - fixed_passkey != BT_PASSKEY_INVALID) { + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_RAND) { return BT_SMP_IO_KEYBOARD_DISPLAY; } else { return BT_SMP_IO_KEYBOARD_ONLY; @@ -377,8 +389,7 @@ static uint8_t get_io_capa(struct bt_smp *smp) } no_callbacks: - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && - fixed_passkey != BT_PASSKEY_INVALID) { + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_RAND) { return BT_SMP_IO_DISPLAY_ONLY; } else { return BT_SMP_IO_NO_INPUT_OUTPUT; @@ -2475,7 +2486,6 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) struct bt_conn *conn = smp->chan.chan.conn; const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_keys *keys; - uint32_t passkey; /* * Fail if we have keys that are stronger than keys that will be @@ -2503,11 +2513,25 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) } break; - case PASSKEY_DISPLAY: - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && - fixed_passkey != BT_PASSKEY_INVALID) { + case PASSKEY_DISPLAY: { + uint32_t passkey; + + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_RAND) { passkey = fixed_passkey; - } else { +#if defined(CONFIG_BT_APP_PASSKEY) + } else if (smp_auth_cb && smp_auth_cb->app_passkey) { + passkey = smp_auth_cb->app_passkey(conn); + + if (passkey != BT_PASSKEY_RAND && passkey > 999999) { + LOG_WRN("App-provided passkey is out of valid range: %u", passkey); + return BT_SMP_ERR_UNSPECIFIED; + } +#endif /* CONFIG_BT_APP_PASSKEY */ + } else { + passkey = BT_PASSKEY_RAND; + } + + if (passkey == BT_PASSKEY_RAND) { if (bt_rand(&passkey, sizeof(passkey))) { return BT_SMP_ERR_UNSPECIFIED; } @@ -2527,6 +2551,7 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) sys_put_le32(passkey, smp->tk); break; + } case PASSKEY_INPUT: atomic_set_bit(smp->flags, SMP_FLAG_USER); smp_auth_cb->passkey_entry(conn); @@ -4429,18 +4454,32 @@ __maybe_unused static uint8_t display_passkey(struct bt_smp *smp) { struct bt_conn *conn = smp->chan.chan.conn; const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); + uint32_t passkey = BT_PASSKEY_RAND; - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && - fixed_passkey != BT_PASSKEY_INVALID) { - smp->passkey = fixed_passkey; - } else { - if (bt_rand(&smp->passkey, sizeof(smp->passkey))) { + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_RAND) { + passkey = fixed_passkey; + } + +#if defined(CONFIG_BT_APP_PASSKEY) + if (smp_auth_cb && smp_auth_cb->app_passkey) { + passkey = smp_auth_cb->app_passkey(conn); + + if (passkey != BT_PASSKEY_RAND && passkey > 999999) { + LOG_WRN("App-provided passkey is out of valid range: %u", passkey); + return BT_SMP_ERR_UNSPECIFIED; + } + } +#endif /* CONFIG_BT_APP_PASSKEY */ + + if (passkey == BT_PASSKEY_RAND) { + if (bt_rand(&passkey, sizeof(passkey))) { return BT_SMP_ERR_UNSPECIFIED; } - smp->passkey %= 1000000; + passkey %= 1000000; } + smp->passkey = passkey; smp->passkey_round = 0U; if (smp_auth_cb && smp_auth_cb->passkey_display) { @@ -6172,8 +6211,8 @@ int bt_smp_auth_pairing_confirm(struct bt_conn *conn) #if defined(CONFIG_BT_FIXED_PASSKEY) int bt_passkey_set(unsigned int passkey) { - if (passkey == BT_PASSKEY_INVALID) { - fixed_passkey = BT_PASSKEY_INVALID; + if (passkey == BT_PASSKEY_INVALID || passkey == BT_PASSKEY_RAND) { + fixed_passkey = BT_PASSKEY_RAND; return 0; } From 209a01d590e9e0235c44cbdfa6cb4f99d9e77348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Mon, 20 Oct 2025 09:40:15 +0200 Subject: [PATCH 0383/3334] [nrf fromtree] Bluetooth: Host: Deprecate BT_FIXED_PASSKEY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The BT_FIXED_PASSKEY Kconfig option is being deprecated, and is replaced by BT_APP_PASSKEY. The reason for the deprecation is an upcoming errata, ES-24489, which mandates that a new passkey shall be generated for each pairing procedure. Signed-off-by: Håvard Reierstad (cherry picked from commit 82cfb5a056026beb67d5646bba6a69ca7fb40243) Signed-off-by: alperen sener --- doc/releases/migration-guide-4.3.rst | 9 +++++++++ include/zephyr/bluetooth/conn.h | 9 ++++++--- subsys/bluetooth/host/Kconfig | 4 +++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index a3aec0898c8e..53e6b64ab72d 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -123,6 +123,15 @@ Bluetooth HCI * The deprecated ``ipm`` value was removed from ``bt-hci-bus`` devicetree property. ``ipc`` should be used instead. +Bluetooth Host +============== + +* :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` has been deprecated. Instead, the application can + provide passkeys for pairing using the :c:member:`bt_conn_auth_cb.app_passkey` callback, which is + available when :kconfig:option:`CONFIG_BT_APP_PASSKEY` is enabled. The application can return the + passkey for pairing, or :c:macro:`BT_PASSKEY_RAND` for the Host to generate a random passkey + instead. + Ethernet ======== diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 0ebfb89bf4bf..881d0894ee11 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -2380,8 +2380,8 @@ int bt_le_oob_get_sc_data(struct bt_conn *conn, const struct bt_le_oob_sc_data **oobd_remote); /** - * Special passkey value that can be used to disable a previously - * set fixed passkey. + * DEPRECATED - use @ref BT_PASSKEY_RAND instead. Special passkey value that can be used to disable + * a previously set fixed passkey. */ #define BT_PASSKEY_INVALID 0xffffffff @@ -2393,12 +2393,15 @@ int bt_le_oob_get_sc_data(struct bt_conn *conn, * Sets a fixed passkey to be used for pairing. If set, the * pairing_confirm() callback will be called for all incoming pairings. * + * @deprecated Use @ref BT_PASSKEY_RAND and the app_passkey callback from @ref bt_conn_auth_cb + * instead. + * * @param passkey A valid passkey (0 - 999999) or BT_PASSKEY_INVALID * to disable a previously set fixed passkey. * * @return 0 on success or a negative error code on failure. */ -int bt_passkey_set(unsigned int passkey); +__deprecated int bt_passkey_set(unsigned int passkey); /** Info Structure for OOB pairing */ struct bt_conn_oob_info { diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index b45febe61869..862f71c3651c 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -683,8 +683,10 @@ config BT_SMP_USB_HCI_CTLR_WORKAROUND if the keys are distributed over an encrypted link. config BT_FIXED_PASSKEY - bool "Use a fixed passkey for pairing" + bool "Use a fixed passkey for pairing [DEPRECATED]" + select DEPRECATED help + This option is deprecated, use BT_APP_PASSKEY instead. With this option enabled, the application will be able to call the bt_passkey_set() API to set a fixed passkey. If set, the pairing_confirm() callback will be called for all incoming pairings. From 30bc2594c91763d184288a33dd84b7eb04609fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Mon, 20 Oct 2025 09:45:26 +0200 Subject: [PATCH 0384/3334] [nrf fromtree] Bluetooth: Host: shell: Don't use BT_FIXED_PASSKEY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the bt shell API to use the new Kconfig option BT_APP_PASSKEY instead of BT_FIXED_PASSKEY as this is being deprecated. Signed-off-by: Håvard Reierstad (cherry picked from commit b6252b57aa610d022e64767ce1162a2bcbc74e5f) Signed-off-by: alperen sener --- subsys/bluetooth/host/shell/bt.c | 53 ++++++++++++++++++++++---------- tests/bluetooth/shell/audio.conf | 2 +- tests/bluetooth/shell/log.conf | 2 +- tests/bluetooth/shell/prj.conf | 2 +- 4 files changed, 40 insertions(+), 19 deletions(-) diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index a09afe4e3e5c..816b6549853b 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -4421,6 +4421,15 @@ static void br_bond_deleted(const bt_addr_t *peer) } #endif /* CONFIG_BT_CLASSIC */ +#if defined(CONFIG_BT_APP_PASSKEY) +static uint32_t app_passkey = BT_PASSKEY_RAND; + +static uint32_t auth_app_passkey(struct bt_conn *conn) +{ + return app_passkey; +} +#endif /* CONFIG_BT_APP_PASSKEY */ + static struct bt_conn_auth_cb auth_cb_display = { .passkey_display = auth_passkey_display, #if defined(CONFIG_BT_PASSKEY_KEYPRESS) @@ -4437,6 +4446,9 @@ static struct bt_conn_auth_cb auth_cb_display = { #if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT) .pairing_accept = pairing_accept, #endif +#if defined(CONFIG_BT_APP_PASSKEY) + .app_passkey = auth_app_passkey, +#endif }; static struct bt_conn_auth_cb auth_cb_display_yes_no = { @@ -4445,6 +4457,9 @@ static struct bt_conn_auth_cb auth_cb_display_yes_no = { .passkey_confirm = auth_passkey_confirm, #if defined(CONFIG_BT_CLASSIC) .pincode_entry = auth_pincode_entry, +#endif +#if defined(CONFIG_BT_APP_PASSKEY) + .app_passkey = auth_app_passkey, #endif .oob_data_request = NULL, .cancel = auth_cancel, @@ -4460,6 +4475,9 @@ static struct bt_conn_auth_cb auth_cb_input = { .passkey_confirm = NULL, #if defined(CONFIG_BT_CLASSIC) .pincode_entry = auth_pincode_entry, +#endif +#if defined(CONFIG_BT_APP_PASSKEY) + .app_passkey = auth_app_passkey, #endif .oob_data_request = NULL, .cancel = auth_cancel, @@ -4472,6 +4490,9 @@ static struct bt_conn_auth_cb auth_cb_input = { static struct bt_conn_auth_cb auth_cb_confirm = { #if defined(CONFIG_BT_CLASSIC) .pincode_entry = auth_pincode_entry, +#endif +#if defined(CONFIG_BT_APP_PASSKEY) + .app_passkey = auth_app_passkey, #endif .oob_data_request = NULL, .cancel = auth_cancel, @@ -4487,6 +4508,9 @@ static struct bt_conn_auth_cb auth_cb_all = { .passkey_confirm = auth_passkey_confirm, #if defined(CONFIG_BT_CLASSIC) .pincode_entry = auth_pincode_entry, +#endif +#if defined(CONFIG_BT_APP_PASSKEY) + .app_passkey = auth_app_passkey, #endif .oob_data_request = auth_pairing_oob_data_request, .cancel = auth_cancel, @@ -4703,16 +4727,15 @@ static int cmd_fal_connect(const struct shell *sh, size_t argc, char *argv[]) #endif /* CONFIG_BT_CENTRAL */ #endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */ -#if defined(CONFIG_BT_FIXED_PASSKEY) -static int cmd_fixed_passkey(const struct shell *sh, - size_t argc, char *argv[]) +#if defined(CONFIG_BT_APP_PASSKEY) +static int cmd_app_passkey(const struct shell *sh, + size_t argc, char *argv[]) { - unsigned int passkey; - int err; + uint32_t passkey; if (argc < 2) { - bt_passkey_set(BT_PASSKEY_INVALID); - shell_print(sh, "Fixed passkey cleared"); + app_passkey = BT_PASSKEY_RAND; + shell_print(sh, "App passkey cleared"); return 0; } @@ -4722,14 +4745,12 @@ static int cmd_fixed_passkey(const struct shell *sh, return -ENOEXEC; } - err = bt_passkey_set(passkey); - if (err) { - shell_print(sh, "Setting fixed passkey failed (err %d)", err); - } + app_passkey = passkey; + shell_print(sh, "App passkey set to %06u", passkey); - return err; + return 0; } -#endif +#endif /* CONFIG_BT_APP_PASSKEY */ static int cmd_auth_passkey(const struct shell *sh, size_t argc, char *argv[]) @@ -5340,10 +5361,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds, cmd_fal_connect, 2, 3), #endif /* CONFIG_BT_CENTRAL */ #endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */ -#if defined(CONFIG_BT_FIXED_PASSKEY) - SHELL_CMD_ARG(fixed-passkey, NULL, "[passkey]", cmd_fixed_passkey, +#if defined(CONFIG_BT_APP_PASSKEY) + SHELL_CMD_ARG(app-passkey, NULL, "[passkey]", cmd_app_passkey, 1, 1), -#endif +#endif /* CONFIG_BT_APP_PASSKEY */ #endif /* CONFIG_BT_SMP || CONFIG_BT_CLASSIC) */ #endif /* CONFIG_BT_CONN */ diff --git a/tests/bluetooth/shell/audio.conf b/tests/bluetooth/shell/audio.conf index bae871f97cb2..45236a49afae 100644 --- a/tests/bluetooth/shell/audio.conf +++ b/tests/bluetooth/shell/audio.conf @@ -22,7 +22,7 @@ CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y CONFIG_BT_GATT_AUTO_UPDATE_MTU=y CONFIG_BT_L2CAP_ECRED=y CONFIG_BT_SIGNING=y -CONFIG_BT_FIXED_PASSKEY=y +CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=5 CONFIG_BT_SHELL=y CONFIG_BT_DEVICE_NAME="audio test shell" diff --git a/tests/bluetooth/shell/log.conf b/tests/bluetooth/shell/log.conf index 7a9aa9b8680f..2da43186e19f 100644 --- a/tests/bluetooth/shell/log.conf +++ b/tests/bluetooth/shell/log.conf @@ -9,7 +9,7 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y -CONFIG_BT_FIXED_PASSKEY=y +CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 510d0988262c..2c84d55bd69a 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -11,7 +11,7 @@ CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_PASSKEY_KEYPRESS=y CONFIG_BT_SIGNING=y -CONFIG_BT_FIXED_PASSKEY=y +CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y From 2a90ac7fa0b6a889f1d50b61fad851342347a715 Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Mon, 20 Oct 2025 10:18:38 +0200 Subject: [PATCH 0385/3334] [nrf fromtree] tests: bluetooth: Recycle ext_adv_sets when stopping adv - We want to reuse ext_advs when first stopped and restarted - This ensures SID is the same - Fixes CAP/CL/ADV/BV-03-C Signed-off-by: Alexander Svensen (cherry picked from commit 4896194be8d77cebde07ebaaf37a0540fb013ba4) --- tests/bluetooth/tester/src/btp/btp_gap.h | 1 + tests/bluetooth/tester/src/btp_gap.c | 42 +++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/tests/bluetooth/tester/src/btp/btp_gap.h b/tests/bluetooth/tester/src/btp/btp_gap.h index 924859c461c2..071c72f40b02 100644 --- a/tests/bluetooth/tester/src/btp/btp_gap.h +++ b/tests/bluetooth/tester/src/btp/btp_gap.h @@ -585,6 +585,7 @@ struct bt_le_adv_param; struct bt_data; struct bt_le_ext_adv *tester_gap_ext_adv_get(uint8_t ext_adv_idx); struct bt_le_per_adv_sync *tester_gap_padv_get(void); +int tester_gap_clear_adv_instance(struct bt_le_ext_adv *ext_adv); int tester_gap_create_adv_instance(struct bt_le_adv_param *param, uint8_t own_addr_type, const struct bt_data *ad, size_t ad_len, const struct bt_data *sd, size_t sd_len, diff --git a/tests/bluetooth/tester/src/btp_gap.c b/tests/bluetooth/tester/src/btp_gap.c index 1344933eec52..80b30467bd9d 100644 --- a/tests/bluetooth/tester/src/btp_gap.c +++ b/tests/bluetooth/tester/src/btp_gap.c @@ -600,6 +600,21 @@ static int tester_gap_ext_adv_idx_free_get(void) return -ENOMEM; } +static int tester_gap_ext_adv_idx_get(struct bt_le_ext_adv *ext_adv) +{ + if (!IS_ENABLED(CONFIG_BT_EXT_ADV)) { + return -ENOTSUP; + } + + for (int i = 0; i < ARRAY_SIZE(ext_adv_sets); i++) { + if (ext_adv_sets[i] == ext_adv) { + return i; + } + } + + return -EINVAL; +} + int tester_gap_start_ext_adv(struct bt_le_ext_adv *ext_adv) { if (!IS_ENABLED(CONFIG_BT_EXT_ADV)) { @@ -644,6 +659,8 @@ int tester_gap_stop_ext_adv(struct bt_le_ext_adv *ext_adv) return -EINVAL; } + tester_gap_clear_adv_instance(ext_adv); + atomic_clear_bit(¤t_settings, BTP_GAP_SETTINGS_ADVERTISING); return 0; @@ -750,6 +767,29 @@ static uint8_t set_bondable(const void *cmd, uint16_t cmd_len, return BTP_STATUS_SUCCESS; } +int tester_gap_clear_adv_instance(struct bt_le_ext_adv *ext_adv) +{ + if (!IS_ENABLED(CONFIG_BT_EXT_ADV)) { + return -ENOTSUP; + } + + if (ext_adv == NULL) { + LOG_ERR("Invalid ext_adv"); + return -EINVAL; + } + + int index = tester_gap_ext_adv_idx_get(ext_adv); + + if (index < 0) { + LOG_ERR("Failed to get ext_adv index"); + return -EINVAL; + } + + ext_adv_sets[index] = NULL; + + return 0; +} + int tester_gap_create_adv_instance(struct bt_le_adv_param *param, uint8_t own_addr_type, const struct bt_data *ad, size_t ad_len, const struct bt_data *sd, size_t sd_len, uint32_t *settings, @@ -973,7 +1013,7 @@ static uint8_t stop_advertising(const void *cmd, uint16_t cmd_len, if (IS_ENABLED(CONFIG_BT_EXT_ADV) && atomic_test_bit(¤t_settings, BTP_GAP_SETTINGS_EXTENDED_ADVERTISING)) { - err = bt_le_ext_adv_stop(gap_ext_adv); + err = tester_gap_stop_ext_adv(gap_ext_adv); } else { err = bt_le_adv_stop(); } From 0f8d17d13c1fba3a9af087db367aa27a51246fb3 Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Tue, 11 Nov 2025 13:26:35 +0100 Subject: [PATCH 0386/3334] [nrf fromtree] tests: bluetooth: tester: Add ASE ID when configuring codec - We want to add the ASE ID to a stream as early as possible to make sure the events coming from BTTester to Auto-PTS contains the correct information. - Previously the events that came before stream_configured would contain ASE ID 0, regardless of actual value. Signed-off-by: Alexander Svensen (cherry picked from commit c4ab06b9c4864f33e1d5225fc53610f03060e9bf) --- tests/bluetooth/tester/src/audio/btp_bap_unicast.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index e839a0ddb767..c06795e8267a 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -511,7 +511,6 @@ static void stream_configured_cb(struct bt_bap_stream *stream, u_stream->conn_id = bt_conn_index(stream->conn); u_conn = &connections[u_stream->conn_id]; - u_stream->ase_id = info.id; stream_state_changed(stream); } @@ -1272,6 +1271,12 @@ static int client_configure_codec(struct btp_bap_unicast_connection *u_conn, str memcpy(&stream->codec_cfg, codec_cfg, sizeof(*codec_cfg)); err = bt_bap_stream_config(conn, stream_unicast_to_bap(stream), ep, &stream->codec_cfg); + + if (err == 0) { + stream->ase_id = ase_id; + } else { + stream->in_use = false; + } } else { /* Reconfigure a stream */ memcpy(&stream->codec_cfg, codec_cfg, sizeof(*codec_cfg)); From bb1f28358003727afe10d6ffa20416ad9c7155c7 Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Tue, 28 Oct 2025 13:46:15 +0100 Subject: [PATCH 0387/3334] [nrf fromtree] tests: bluetooth: tester: Fix bis_sink_sync - Allows the tester to match on either ID or addr - Previously required that both needed to match, but Auto-PTS is sending the wrong address Signed-off-by: Alexander Svensen (cherry picked from commit fa7d9bf09cd14941bc06f1331230be7107fb9dc0) --- .../tester/src/audio/btp_bap_broadcast.c | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c index e26046d2b083..3733ab36440a 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c @@ -1162,6 +1162,8 @@ static int pa_sync_req_cb(struct bt_conn *conn, bt_addr_le_copy(&broadcaster->address, &recv_state->addr); } + broadcast_source_to_sync = broadcaster; + broadcaster->sink_recv_state = recv_state; btp_send_pas_sync_req_ev(conn, recv_state->src_id, recv_state->adv_sid, @@ -1380,20 +1382,6 @@ uint8_t btp_bap_broadcast_sink_sync(const void *cmd, uint16_t cmd_len, void *rsp LOG_DBG(""); - broadcaster = remote_broadcaster_find(&cp->address, broadcast_id); - if (broadcaster == NULL) { - broadcaster = remote_broadcaster_alloc(); - if (broadcaster == NULL) { - LOG_ERR("Failed to allocate broadcast source"); - return BTP_STATUS_FAILED; - } - - broadcaster->broadcast_id = broadcast_id; - bt_addr_le_copy(&broadcaster->address, &cp->address); - } - - broadcast_source_to_sync = broadcaster; - if (IS_ENABLED(CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER) && cp->past_avail) { /* The Broadcast Assistant supports PAST transfer, and it has found * a Broadcaster for us. Let's sync to the Broadcaster PA with the PAST. @@ -1421,7 +1409,22 @@ uint8_t btp_bap_broadcast_sink_sync(const void *cmd, uint16_t cmd_len, void *rsp create_params.sid = cp->advertiser_sid; create_params.skip = cp->skip; create_params.timeout = cp->sync_timeout; + err = tester_gap_padv_create_sync(&create_params); + + broadcaster = remote_broadcaster_find(&cp->address, broadcast_id); + if (broadcaster == NULL) { + broadcaster = remote_broadcaster_alloc(); + if (broadcaster == NULL) { + LOG_ERR("Failed to allocate broadcast source"); + return BTP_STATUS_FAILED; + } + + broadcaster->broadcast_id = broadcast_id; + bt_addr_le_copy(&broadcaster->address, &cp->address); + } + + broadcast_source_to_sync = broadcaster; } if (err != 0) { From e6f8ad98e78fa2436bad1dcb7365e58d6e89aeba Mon Sep 17 00:00:00 2001 From: Frode van der Meeren Date: Thu, 13 Nov 2025 15:02:55 +0100 Subject: [PATCH 0388/3334] [nrf fromtree] tests: bluetooth: tester: Fix CSIS/SR/SP/BV-07-C This particular test-case requires bttester to respond with an OOB procedure SIRK only error. To enable this response, the BTP command to set SIRK mode has been extended with a new selection. Signed-off-by: Frode van der Meeren (cherry picked from commit 03bfafe05e1d5ec716d9a15dced0e143dc9de6db) --- .../bluetooth/tester/src/audio/btp/btp_csis.h | 10 +++-- tests/bluetooth/tester/src/audio/btp_csis.c | 42 ++++++++++++------- tests/bsim/bluetooth/tester/src/bsim_btp.c | 2 +- 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp/btp_csis.h b/tests/bluetooth/tester/src/audio/btp/btp_csis.h index f007a6a938a2..0f1255301281 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_csis.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_csis.h @@ -12,6 +12,10 @@ #include /* CSIS commands */ +#define BTP_CSIS_SIRK_TYPE_PLAINTEXT 0x00 +#define BTP_CSIS_SIRK_TYPE_ENCRYPTED 0x01 +#define BTP_CSIS_SIRK_TYPE_OOB_ONLY 0x02 + #define BTP_CSIS_READ_SUPPORTED_COMMANDS 0x01 struct btp_csis_read_supported_commands_rp { uint8_t data[0]; @@ -33,7 +37,7 @@ struct btp_csis_get_member_rsi_rp { uint8_t rsi[BT_CSIP_RSI_SIZE]; } __packed; -#define BTP_CSIS_ENC_SIRK_TYPE 0x04 -struct btp_csis_sirk_type_cmd { - uint8_t encrypted; +#define BTP_CSIS_SET_SIRK_TYPE 0x04 +struct btp_csis_sirk_set_type_cmd { + uint8_t type; } __packed; diff --git a/tests/bluetooth/tester/src/audio/btp_csis.c b/tests/bluetooth/tester/src/audio/btp_csis.c index cd62adf6f5eb..c80242b4e7a6 100644 --- a/tests/bluetooth/tester/src/audio/btp_csis.c +++ b/tests/bluetooth/tester/src/audio/btp_csis.c @@ -24,7 +24,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL); #define BTP_STATUS_VAL(err) (err) ? BTP_STATUS_FAILED : BTP_STATUS_SUCCESS static struct bt_csip_set_member_svc_inst *csis_svc_inst; -static bool enc_sirk; +static uint8_t sirk_read_response; static uint8_t csis_supported_commands(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) @@ -65,13 +65,27 @@ static uint8_t csis_get_member_rsi(const void *cmd, uint16_t cmd_len, return BTP_STATUS_VAL(err); } -static uint8_t csis_sirk_type(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) +static uint8_t csis_set_sirk_type(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) { - const struct btp_csis_sirk_type_cmd *cp = cmd; - - enc_sirk = cp->encrypted != 0U; - - LOG_DBG("SIRK type: %s", enc_sirk ? "encrypted" : "plain text"); + const struct btp_csis_sirk_set_type_cmd *cp = cmd; + + switch (cp->type) { + case BTP_CSIS_SIRK_TYPE_PLAINTEXT: + LOG_DBG("SIRK type: plain text"); + sirk_read_response = BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT; + break; + case BTP_CSIS_SIRK_TYPE_ENCRYPTED: + LOG_DBG("SIRK type: encrypted"); + sirk_read_response = BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT_ENC; + break; + case BTP_CSIS_SIRK_TYPE_OOB_ONLY: + LOG_DBG("SIRK type: OOB procedure only"); + sirk_read_response = BT_CSIP_READ_SIRK_REQ_RSP_OOB_ONLY; + break; + default: + LOG_ERR("Unknown SIRK type: %u", cp->type); + return BTP_STATUS_FAILED; + } return BTP_STATUS_SUCCESS; } @@ -94,9 +108,9 @@ static const struct btp_handler csis_handlers[] = { .func = csis_get_member_rsi, }, { - .opcode = BTP_CSIS_ENC_SIRK_TYPE, - .expect_len = sizeof(struct btp_csis_sirk_type_cmd), - .func = csis_sirk_type, + .opcode = BTP_CSIS_SET_SIRK_TYPE, + .expect_len = sizeof(struct btp_csis_sirk_set_type_cmd), + .func = csis_set_sirk_type, }, }; @@ -108,11 +122,7 @@ static void lock_changed_cb(struct bt_conn *conn, struct bt_csip_set_member_svc_ static uint8_t sirk_read_cb(struct bt_conn *conn, struct bt_csip_set_member_svc_inst *svc_inst) { - if (enc_sirk) { - return BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT_ENC; - } else { - return BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT; - } + return sirk_read_response; } static struct bt_csip_set_member_cb csis_cb = { @@ -132,6 +142,8 @@ uint8_t tester_init_csis(void) }; int err = bt_csip_set_member_register(®ister_params, &csis_svc_inst); + sirk_read_response = BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT; + tester_register_command_handlers(BTP_SERVICE_ID_CSIS, csis_handlers, ARRAY_SIZE(csis_handlers)); diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.c b/tests/bsim/bluetooth/tester/src/bsim_btp.c index a5b2c7000dc8..d0516cfcaab5 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.c +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.c @@ -1236,7 +1236,7 @@ static bool is_valid_csis_packet_len(const struct btp_hdr *hdr, struct net_buf_s return buf_simple->len == 0U; case BTP_CSIS_GET_MEMBER_RSI: return buf_simple->len == sizeof(struct btp_csis_get_member_rsi_rp); - case BTP_CSIS_ENC_SIRK_TYPE: + case BTP_CSIS_SET_SIRK_TYPE: return buf_simple->len == 0U; /* No events */ From e557daae8da76c3e2f368506076b960556275c37 Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Thu, 30 Oct 2025 16:00:32 +0100 Subject: [PATCH 0389/3334] [nrf fromtree] Bluetooth: Audio: CSIS: Check all pending notifications - When a bonded device is reconnected, check flags for pending notifications for: - Lock - SIRK - Size Previously only lock was checked Signed-off-by: Alexander Svensen (cherry picked from commit fa8c244313c823d093ccaaf0a7d13aa75085c55a) --- subsys/bluetooth/audio/csip_set_member.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/audio/csip_set_member.c b/subsys/bluetooth/audio/csip_set_member.c index cfeb6ac6e45f..5656728f4e5d 100644 --- a/subsys/bluetooth/audio/csip_set_member.c +++ b/subsys/bluetooth/audio/csip_set_member.c @@ -520,8 +520,10 @@ static void csip_security_changed(struct bt_conn *conn, bt_security_t level, return; } - /* Check if client is set with FLAG_NOTIFY_LOCK */ - if (atomic_test_bit(client->flags, FLAG_NOTIFY_LOCK)) { + /* Check if client has pending notifications */ + if (atomic_test_bit(client->flags, FLAG_NOTIFY_LOCK) || + atomic_test_bit(client->flags, FLAG_NOTIFY_SIRK) || + atomic_test_bit(client->flags, FLAG_NOTIFY_SIZE)) { notify_work_reschedule(K_NO_WAIT); break; } From eafe31b0fb1371538167e262825b95eb9af7f840 Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Thu, 30 Oct 2025 16:03:16 +0100 Subject: [PATCH 0390/3334] [nrf fromtree] tests: bluetooth: tester: CSIS: Add more commands - Add command for setting the set size - Add command for setting the SIRK - Allows the following tests to pass: - CSIS/SR/CN/BV-01-C - CSIS/SR/CN/BV-02-C - CSIS/SR/CN/BV-03-C - CSIS/SR/CN/BV-04-C Signed-off-by: Alexander Svensen (cherry picked from commit 52f2686de67817f3ac5aa9ef16c89a0faf110d0b) --- tests/bluetooth/tester/overlay-le-audio.conf | 2 + .../bluetooth/tester/src/audio/btp/btp_csis.h | 11 +++++ tests/bluetooth/tester/src/audio/btp_csis.c | 42 +++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/tests/bluetooth/tester/overlay-le-audio.conf b/tests/bluetooth/tester/overlay-le-audio.conf index 30f609b9ace5..f6fb0e9c4094 100644 --- a/tests/bluetooth/tester/overlay-le-audio.conf +++ b/tests/bluetooth/tester/overlay-le-audio.conf @@ -130,6 +130,8 @@ CONFIG_BT_HAS_CLIENT=y # CSIS CONFIG_BT_CSIP_SET_MEMBER=y CONFIG_BT_CSIP_SET_MEMBER_ENC_SIRK_SUPPORT=y +CONFIG_BT_CSIP_SET_MEMBER_SIRK_NOTIFIABLE=y +CONFIG_BT_CSIP_SET_MEMBER_SIZE_NOTIFIABLE=y # CSIP CONFIG_BT_CSIP_SET_COORDINATOR=y diff --git a/tests/bluetooth/tester/src/audio/btp/btp_csis.h b/tests/bluetooth/tester/src/audio/btp/btp_csis.h index 0f1255301281..3f28e942414d 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_csis.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_csis.h @@ -41,3 +41,14 @@ struct btp_csis_get_member_rsi_rp { struct btp_csis_sirk_set_type_cmd { uint8_t type; } __packed; + +#define BTP_CSIS_SET_SIRK 0x05 +struct btp_csis_set_sirk_cmd { + uint8_t sirk[BT_CSIP_SIRK_SIZE]; +} __packed; + +#define BTP_CSIS_SET_SET_SIZE 0x06 +struct btp_csis_set_set_size_cmd { + uint8_t set_size; + uint8_t rank; +} __packed; diff --git a/tests/bluetooth/tester/src/audio/btp_csis.c b/tests/bluetooth/tester/src/audio/btp_csis.c index c80242b4e7a6..4e3662487684 100644 --- a/tests/bluetooth/tester/src/audio/btp_csis.c +++ b/tests/bluetooth/tester/src/audio/btp_csis.c @@ -90,6 +90,38 @@ static uint8_t csis_set_sirk_type(const void *cmd, uint16_t cmd_len, void *rsp, return BTP_STATUS_SUCCESS; } +static uint8_t csis_set_sirk(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) +{ + const struct btp_csis_set_sirk_cmd *cp = cmd; + int err = -ENOENT; + + LOG_DBG("Setting new SIRK"); + + if (csis_svc_inst != NULL) { + err = bt_csip_set_member_sirk(csis_svc_inst, cp->sirk); + } else { + LOG_DBG("No CSIS instance registered"); + } + + return BTP_STATUS_VAL(err); +} + +static uint8_t csis_set_set_size(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) +{ + const struct btp_csis_set_set_size_cmd *cp = cmd; + int err = -ENOENT; + + LOG_DBG("Setting new set size %u and rank %u", cp->set_size, cp->rank); + + if (csis_svc_inst != NULL) { + err = bt_csip_set_member_set_size_and_rank(csis_svc_inst, cp->set_size, cp->rank); + } else { + LOG_DBG("No CSIS instance registered"); + } + + return BTP_STATUS_VAL(err); +} + static const struct btp_handler csis_handlers[] = { { .opcode = BTP_CSIS_READ_SUPPORTED_COMMANDS, @@ -112,6 +144,16 @@ static const struct btp_handler csis_handlers[] = { .expect_len = sizeof(struct btp_csis_sirk_set_type_cmd), .func = csis_set_sirk_type, }, + { + .opcode = BTP_CSIS_SET_SIRK, + .expect_len = sizeof(struct btp_csis_set_sirk_cmd), + .func = csis_set_sirk, + }, + { + .opcode = BTP_CSIS_SET_SET_SIZE, + .expect_len = sizeof(struct btp_csis_set_set_size_cmd), + .func = csis_set_set_size, + }, }; static void lock_changed_cb(struct bt_conn *conn, struct bt_csip_set_member_svc_inst *svc_inst, From bbbeeebd131522ce06e4e37961906ae8154da1d1 Mon Sep 17 00:00:00 2001 From: Frode van der Meeren Date: Thu, 6 Nov 2025 17:55:04 +0100 Subject: [PATCH 0391/3334] [nrf fromtree] tests: bluetooth: tester: Fix VCS tests Zephyr automatically sets the persisted flag for VCS if the volume is changed after the service is registered. As some of these PTS tests require a set volume with the flag cleared, the initial volume needs to be set before registering VCS. Signed-off-by: Frode van der Meeren (cherry picked from commit 48f82d1e34621ed245037d23ce6077059a6a24fa) --- .../bluetooth/tester/src/audio/btp/btp_vcs.h | 9 +++ tests/bluetooth/tester/src/audio/btp_vcp.c | 72 +++++++++++++------ .../tester/src/audio/vcp_peripheral.c | 1 + tests/bsim/bluetooth/tester/src/bsim_btp.c | 2 + tests/bsim/bluetooth/tester/src/bsim_btp.h | 21 ++++++ 5 files changed, 84 insertions(+), 21 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp/btp_vcs.h b/tests/bluetooth/tester/src/audio/btp/btp_vcs.h index 6f31afe020c8..069b562c03d4 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_vcs.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_vcs.h @@ -8,6 +8,8 @@ #include +#define BTP_VCS_REGISTER_FLAG_MUTED BIT(0) + #define BTP_VCS_READ_SUPPORTED_COMMANDS 0x01 struct btp_vcs_read_supported_commands_rp { uint8_t data[0]; @@ -22,3 +24,10 @@ struct btp_vcs_set_vol_cmd { #define BTP_VCS_VOL_DOWN 0x04 #define BTP_VCS_MUTE 0x05 #define BTP_VCS_UNMUTE 0x06 + +#define BTP_VCS_REGISTER 0x07 +struct btp_vcs_register_cmd { + uint8_t step; + uint8_t flags; + uint8_t volume; +} __packed; diff --git a/tests/bluetooth/tester/src/audio/btp_vcp.c b/tests/bluetooth/tester/src/audio/btp_vcp.c index 9205181a0db9..ec78de2c0435 100644 --- a/tests/bluetooth/tester/src/audio/btp_vcp.c +++ b/tests/bluetooth/tester/src/audio/btp_vcp.c @@ -140,6 +140,43 @@ static uint8_t unmute(const void *cmd, uint16_t cmd_len, return BTP_STATUS_SUCCESS; } +static void set_register_params(uint8_t gain_mode, uint8_t step, + bool muted, uint8_t volume); + +static uint8_t register_vcs(const void *cmd, uint16_t cmd_len, + void *rsp, uint16_t *rsp_len) +{ + static bool vcs_registered_flag; + const struct btp_vcs_register_cmd *cp = cmd; + int err; + + LOG_DBG("Registering VCS"); + + if (vcs_registered_flag) { + return BTP_STATUS_FAILED; + } + + bool muted = (cp->flags & BTP_VCS_REGISTER_FLAG_MUTED) != 0; + + set_register_params(BT_AICS_MODE_MANUAL, cp->step, muted, cp->volume); + + err = bt_vcp_vol_rend_register(&vcp_register_param); + if (err != 0) { + return BTP_STATUS_FAILED; + } + + err = bt_vcp_vol_rend_included_get(&included); + if (err != 0) { + return BTP_STATUS_FAILED; + } + + aics_server_instance.aics_cnt = included.aics_cnt; + aics_server_instance.aics = included.aics; + vcs_registered_flag = true; + + return BTP_STATUS_SUCCESS; +} + static void vcs_state_cb(struct bt_conn *conn, int err, uint8_t volume, uint8_t mute) { LOG_DBG("VCP state cb err (%d)", err); @@ -187,6 +224,11 @@ static const struct btp_handler vcs_handlers[] = { .expect_len = 0, .func = unmute, }, + { + .opcode = BTP_VCS_REGISTER, + .expect_len = sizeof(struct btp_vcs_register_cmd), + .func = register_vcs, + }, }; /* Volume Offset Control Service */ @@ -463,7 +505,8 @@ struct bt_aics_cb aics_server_cb = { }; /* General profile handling */ -static void set_register_params(uint8_t gain_mode) +static void set_register_params(uint8_t gain_mode, uint8_t step, + bool muted, uint8_t volume) { char input_desc[CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT] [BT_AICS_MAX_INPUT_DESCRIPTION_SIZE]; @@ -495,31 +538,18 @@ static void set_register_params(uint8_t gain_mode) vcp_register_param.aics_param[i].cb = &aics_server_cb; } - vcp_register_param.step = 1; - vcp_register_param.mute = BT_VCP_STATE_UNMUTED; - vcp_register_param.volume = 100; + vcp_register_param.step = step; + if (muted) { + vcp_register_param.mute = BT_VCP_STATE_MUTED; + } else { + vcp_register_param.mute = BT_VCP_STATE_UNMUTED; + } + vcp_register_param.volume = volume; vcp_register_param.cb = &vcs_cb; } uint8_t tester_init_vcs(void) { - int err; - - set_register_params(BT_AICS_MODE_MANUAL); - - err = bt_vcp_vol_rend_register(&vcp_register_param); - if (err) { - return BTP_STATUS_FAILED; - } - - err = bt_vcp_vol_rend_included_get(&included); - if (err) { - return BTP_STATUS_FAILED; - } - - aics_server_instance.aics_cnt = included.aics_cnt; - aics_server_instance.aics = included.aics; - tester_register_command_handlers(BTP_SERVICE_ID_VCS, vcs_handlers, ARRAY_SIZE(vcs_handlers)); diff --git a/tests/bsim/bluetooth/tester/src/audio/vcp_peripheral.c b/tests/bsim/bluetooth/tester/src/audio/vcp_peripheral.c index 9fdfbcaf50ef..ef5a0efc2f1d 100644 --- a/tests/bsim/bluetooth/tester/src/audio/vcp_peripheral.c +++ b/tests/bsim/bluetooth/tester/src/audio/vcp_peripheral.c @@ -35,6 +35,7 @@ static void test_vcp_peripheral(void) bsim_btp_core_register(BTP_SERVICE_ID_AICS); bsim_btp_gap_set_discoverable(BTP_GAP_GENERAL_DISCOVERABLE); + bsim_btp_vcs_register(1U, 0U, 100U); bsim_btp_gap_start_advertising(0U, 0U, NULL, BT_HCI_OWN_ADDR_PUBLIC); bsim_btp_wait_for_gap_device_connected(&remote_addr); bt_addr_le_to_str(&remote_addr, addr_str, sizeof(addr_str)); diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.c b/tests/bsim/bluetooth/tester/src/bsim_btp.c index d0516cfcaab5..2e24514b6606 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.c +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.c @@ -873,6 +873,8 @@ static bool is_valid_vcs_packet_len(const struct btp_hdr *hdr, struct net_buf_si return buf_simple->len == 0U; case BTP_VCS_UNMUTE: return buf_simple->len == 0U; + case BTP_VCS_REGISTER: + return buf_simple->len == 0U; /* no events */ default: diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.h b/tests/bsim/bluetooth/tester/src/bsim_btp.h index 75198bf498eb..2480076bc069 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.h +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.h @@ -563,6 +563,27 @@ static inline void bsim_btp_wait_for_tmap_discovery_complete(void) net_buf_unref(buf); } +static inline void bsim_btp_vcs_register(uint8_t step, uint8_t flags, uint8_t vol) +{ + struct btp_vcs_register_cmd *cmd; + struct btp_hdr *cmd_hdr; + + NET_BUF_SIMPLE_DEFINE(cmd_buffer, BTP_MTU); + + cmd_hdr = net_buf_simple_add(&cmd_buffer, sizeof(*cmd_hdr)); + cmd_hdr->service = BTP_SERVICE_ID_VCS; + cmd_hdr->opcode = BTP_VCS_REGISTER; + cmd_hdr->index = BTP_INDEX; + cmd = net_buf_simple_add(&cmd_buffer, sizeof(*cmd)); + cmd->step = step; + cmd->flags = flags; + cmd->volume = vol; + + cmd_hdr->len = sys_cpu_to_le16(cmd_buffer.len - sizeof(*cmd_hdr)); + + bsim_btp_send_to_tester(cmd_buffer.data, cmd_buffer.len); +} + static inline void bsim_btp_vcp_discover(const bt_addr_le_t *address) { struct btp_vcp_discover_cmd *cmd; From 3c93492b22710c022038913732697aa5230b65ce Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Mon, 17 Nov 2025 16:02:17 +0100 Subject: [PATCH 0392/3334] [nrf fromtree] bluetooth: audio: scan_delegator: Fix validation - Fixes bug where bis_sync_requests were wrongfully validated. - Two BISes across subgroups should not have the same bits set - Remove use of internal->bis_syncs before it's updated in mod_src. Signed-off-by: Alexander Svensen (cherry picked from commit 78729f4ff0ce66392efb87315161f8e5677d3046) --- subsys/bluetooth/audio/bap_scan_delegator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index da07fab411c8..8c21b806900f 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -149,7 +149,7 @@ static bool bis_syncs_unique_or_no_pref(uint32_t requested_bis_syncs, return true; } - return (requested_bis_syncs & aggregated_bis_syncs) != 0U; + return (requested_bis_syncs & aggregated_bis_syncs) == 0U; } static bool valid_bis_sync_request(uint32_t requested_bis_syncs, uint32_t aggregated_bis_syncs) @@ -938,8 +938,7 @@ static int scan_delegator_mod_src(struct bt_conn *conn, bis_sync_change_requested = true; } - if (!valid_bis_sync_request(internal_state->requested_bis_sync[i], - aggregated_bis_syncs)) { + if (!valid_bis_sync_request(requested_bis_sync[i], aggregated_bis_syncs)) { LOG_DBG("Invalid BIS Sync request[%d]", i); ret = BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); goto unlock_return; From fd5b547f5014825b3c9e7b0d30990eb69ea94005 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 20 Nov 2025 10:02:42 +0100 Subject: [PATCH 0393/3334] [nrf fromtree] tests: Bluetooth: tester: Removed bad guard in btp_gap.h As per the Zephyr coding guidelines, functions declarations in header files should not be conditionally compiled. This fixes an issue with tester_gap_clear_adv_instance where btp_gap.c always expect it to be available. Signed-off-by: Emil Gydesen (cherry picked from commit 318067ec6c38ae156e09d2767c0905f08947aeb8) --- tests/bluetooth/tester/src/btp/btp_gap.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/bluetooth/tester/src/btp/btp_gap.h b/tests/bluetooth/tester/src/btp/btp_gap.h index 071c72f40b02..81c7ba723b6c 100644 --- a/tests/bluetooth/tester/src/btp/btp_gap.h +++ b/tests/bluetooth/tester/src/btp/btp_gap.h @@ -578,7 +578,6 @@ struct btp_gap_periodic_biginfo_ev { uint8_t encryption; } __packed; -#if defined(CONFIG_BT_EXT_ADV) struct bt_le_per_adv_param; struct bt_le_per_adv_sync_param; struct bt_le_adv_param; @@ -599,4 +598,3 @@ int tester_gap_padv_start(struct bt_le_ext_adv *ext_adv); int tester_gap_padv_stop(struct bt_le_ext_adv *ext_adv); int tester_gap_padv_create_sync(struct bt_le_per_adv_sync_param *create_params); int tester_gap_padv_stop_sync(void); -#endif /* defined(CONFIG_BT_EXT_ADV) */ From ac150d9b59b18248a198bb97efebaf7701fab650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Thu, 30 Oct 2025 00:03:10 +0100 Subject: [PATCH 0394/3334] [nrf fromtree] doc: releases: introduce release notes and migration guide docs for 4.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This introduces the release notes and migration guide for Zephyr 4.4.0 earlier so that people have a placeholder to start adding content as they line up pull requests for the 4.4 release. Signed-off-by: Benjamin Cabé (cherry picked from commit 2838fb8be5342b9bf72baf47dca33985632a1db3) Signed-off-by: Aleksandr Khromykh --- doc/releases/migration-guide-4.4.rst | 48 ++++++++++++ doc/releases/release-notes-4.4.rst | 108 +++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 doc/releases/migration-guide-4.4.rst create mode 100644 doc/releases/release-notes-4.4.rst diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst new file mode 100644 index 000000000000..b10c86e9f23b --- /dev/null +++ b/doc/releases/migration-guide-4.4.rst @@ -0,0 +1,48 @@ +:orphan: + +.. + See + https://docs.zephyrproject.org/latest/releases/index.html#migration-guides + for details of what is supposed to go into this document. + +.. _migration_4.4: + +Migration guide to Zephyr v4.4.0 (Working Draft) +################################################ + +This document describes the changes required when migrating your application from Zephyr v4.3.0 to +Zephyr v4.4.0. + +Any other changes (not directly related to migrating applications) can be found in +the :ref:`release notes`. + +.. contents:: + :local: + :depth: 2 + +Build System +************ + +Kernel +****** + +Boards +****** + +Device Drivers and Devicetree +***************************** + +Bluetooth +********* + +Networking +********** + +Other subsystems +**************** + +Modules +******* + +Architectures +************* diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst new file mode 100644 index 000000000000..57f3147e570d --- /dev/null +++ b/doc/releases/release-notes-4.4.rst @@ -0,0 +1,108 @@ +:orphan: + +.. + What goes here: removed/deprecated apis, new boards, new drivers, notable + features. If you feel like something new can be useful to a user, put it + under "Other Enhancements" in the first paragraph, if you feel like something + is worth mentioning in the project media (release blog post, release + livestream) put it under "Major enhancement". +.. + If you are describing a feature or functionality, consider adding it to the + actual project documentation rather than the release notes, so that the + information does not get lost in time. +.. + No list of bugfixes, minor changes, those are already in the git log, this is + not a changelog. +.. + Does the entry have a link that contains the details? Just add the link, if + you think it needs more details, put them in the content that shows up on the + link. +.. + Are you thinking about generating this? Don't put anything at all. +.. + Does the thing require the user to change their application? Put it on the + migration guide instead. (TODO: move the removed APIs section in the + migration guide) + +.. _zephyr_4.4: + +Zephyr 4.4.0 (Working Draft) +############################ + +We are pleased to announce the release of Zephyr version 4.4.0. + +Major enhancements with this release include: + +An overview of the changes required or recommended when migrating your application from Zephyr +v4.3.0 to Zephyr v4.4.0 can be found in the separate :ref:`migration guide`. + +The following sections provide detailed lists of changes by component. + +Security Vulnerability Related +****************************** + +API Changes +*********** + +.. + Only removed, deprecated and new APIs. Changes go in migration guide. + +Removed APIs and options +======================== + +Deprecated APIs and options +=========================== + +New APIs and options +==================== + +.. + Link to new APIs here, in a group if you think it's necessary, no need to get + fancy just list the link, that should contain the documentation. If you feel + like you need to add more details, add them in the API documentation code + instead. + +.. zephyr-keep-sorted-start re(^\* \w) + + +.. zephyr-keep-sorted-stop + +New Boards +********** + +.. + You may update this list as you contribute a new board during the release cycle, in order to make + it visible to people who might be looking at the working draft of the release notes. However, note + that this list will be recomputed at the time of the release, so you don't *have* to update it. + In any case, just link the board, further details go in the board description. + +New Shields +*********** + +.. + Same as above, this will also be recomputed at the time of the release. + +New Drivers +*********** + +.. + Same as above, this will also be recomputed at the time of the release. + Just link the driver, further details go in the binding description + +New Samples +*********** + +.. + Same as above, this will also be recomputed at the time of the release. + Just link the sample, further details go in the sample documentation itself. + + +Libraries / Subsystems +********************** + +Other notable changes +********************* + +.. + Any more descriptive subsystem or driver changes. Do you really want to write + a paragraph or is it enough to link to the api/driver/Kconfig/board page above? From 444980e1bf478cdcd2860e53f094044f18db4436 Mon Sep 17 00:00:00 2001 From: Utsav Munendra Date: Wed, 29 Oct 2025 07:05:03 -0700 Subject: [PATCH 0395/3334] [nrf fromtree] doc: release: Note changes to flash_mspi_nor Note that read, write and control commands can be configured separately via devicetree now. Signed-off-by: Utsav Munendra (cherry picked from commit 3b09b0960919e7d793738a54ba5f80db9e316f32) Signed-off-by: Aleksandr Khromykh --- doc/releases/release-notes-4.4.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 57f3147e570d..4cbcd6f9b217 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -64,6 +64,10 @@ New APIs and options .. zephyr-keep-sorted-start re(^\* \w) +* Flash + + * :dtcompatible:`jedec,mspi-nor` now allows MSPI configuration of read, write and + control commands separately via devicetree. .. zephyr-keep-sorted-stop From 2d624e2e81f10ef53bbd110c506bc523c777455e Mon Sep 17 00:00:00 2001 From: Sean Kyer Date: Fri, 5 Sep 2025 12:56:02 -0700 Subject: [PATCH 0396/3334] [nrf fromtree] bluetooth: ANS: Add Alert Notification Service Add alert notification service (ANS) to Bluetooth subsystem and accompanying sample. Signed-off-by: Sean Kyer (cherry picked from commit 05634c3d6c206ab65663b0538ba74f8b81083a53) Signed-off-by: Aleksandr Khromykh --- include/zephyr/bluetooth/services/ans.h | 136 +++++ .../bluetooth/peripheral_ans/CMakeLists.txt | 9 + samples/bluetooth/peripheral_ans/README.rst | 26 + samples/bluetooth/peripheral_ans/prj.conf | 9 + samples/bluetooth/peripheral_ans/sample.yaml | 15 + samples/bluetooth/peripheral_ans/src/main.c | 128 +++++ subsys/bluetooth/services/CMakeLists.txt | 1 + subsys/bluetooth/services/Kconfig | 2 + subsys/bluetooth/services/Kconfig.ans | 86 +++ subsys/bluetooth/services/ans.c | 489 ++++++++++++++++++ 10 files changed, 901 insertions(+) create mode 100644 include/zephyr/bluetooth/services/ans.h create mode 100644 samples/bluetooth/peripheral_ans/CMakeLists.txt create mode 100644 samples/bluetooth/peripheral_ans/README.rst create mode 100644 samples/bluetooth/peripheral_ans/prj.conf create mode 100644 samples/bluetooth/peripheral_ans/sample.yaml create mode 100644 samples/bluetooth/peripheral_ans/src/main.c create mode 100644 subsys/bluetooth/services/Kconfig.ans create mode 100644 subsys/bluetooth/services/ans.c diff --git a/include/zephyr/bluetooth/services/ans.h b/include/zephyr/bluetooth/services/ans.h new file mode 100644 index 000000000000..aec1ea7c2af2 --- /dev/null +++ b/include/zephyr/bluetooth/services/ans.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2025 Sean Kyer + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_ANS_H_ +#define ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_ANS_H_ + +/** + * @brief Alert Notification Service (ANS) + * @defgroup bt_ans Alert Notification Service (ANS) + * + * @since 4.4 + * @version 0.1.0 + * + * @ingroup bluetooth + * @{ + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Command not supported error code + */ +#define BT_ANS_ERR_CMD_NOT_SUP 0xa0 + +/** + * @brief ANS max text string size in octets + * + * This is the max string size in octets to be saved in a New Alert. Text longer than the max is + * truncated. + * + * section 3.165 of + * https://btprodspecificationrefs.blob.core.windows.net/gatt-specification-supplement/GATT_Specification_Supplement.pdf + * + */ +#define BT_ANS_MAX_TEXT_STR_SIZE 18 + +/** + * @brief ANS Category ID Enum + * + * Enumeration for whether the category is supported. + */ +enum bt_ans_cat { + BT_ANS_CAT_SIMPLE_ALERT, /**< Simple alerts (general notifications). */ + BT_ANS_CAT_EMAIL, /**< Email messages. */ + BT_ANS_CAT_NEWS, /**< News updates. */ + BT_ANS_CAT_CALL, /**< Incoming call alerts. */ + BT_ANS_CAT_MISSED_CALL, /**< Missed call alerts. */ + BT_ANS_CAT_SMS_MMS, /**< SMS/MMS text messages. */ + BT_ANS_CAT_VOICE_MAIL, /**< Voicemail notifications. */ + BT_ANS_CAT_SCHEDULE, /**< Calendar or schedule alerts. */ + BT_ANS_CAT_HIGH_PRI_ALERT, /**< High-priority alerts. */ + BT_ANS_CAT_INSTANT_MESSAGE, /**< Instant messaging alerts. */ + + /** @cond INTERNAL_HIDDEN */ + BT_ANS_CAT_NUM, /**< Marker for the number of categories. */ + /** @endcond */ + + /* 10–15 reserved for future use */ +}; + +/** + * @brief Set the support for a given new alert category + * + * @param mask The bitmask of supported categories + * + * @return 0 on success + * @return negative error codes on failure + */ +int bt_ans_set_new_alert_support_category(uint16_t mask); + +/** + * @brief Set the support for a given unread new alert category + * + * @param mask The bitmask of supported categories + * + * @return 0 on success + * @return negative error codes on failure + */ +int bt_ans_set_unread_support_category(uint16_t mask); + +/** + * @brief Send a new alert to remote devices + * + * The new alert is transmitted to the remote devices if notifications are enabled. Each category + * will save the latest call to this function in case an immediate replay is requested via the ANS + * control point. + * + * @note This function waits on a Mutex with @ref K_FOREVER to ensure atomic updates to notification + * structs. To avoid deadlocks, do not call this function in BT RX or System Workqueue threads. + * + * @param conn The connection object to send the alert to + * @param category The category the notification is for + * @param num_new Number of new alerts since last alert + * @param text Text brief of alert, null terminated + * + * @return 0 on success + * @return negative error codes on failure + */ +int bt_ans_notify_new_alert(struct bt_conn *conn, enum bt_ans_cat category, uint8_t num_new, + const char *text); + +/** + * @brief Set the total unread count for a given category + * + * The unread count is transmitted to the remote devices if notifications are enabled. Each category + * will save the latest call to this function in case an immediate replay is requested via the ANS + * control point. + * + * @note This function waits on a Mutex with @ref K_FOREVER to ensure atomic updates to notification + * structs. To avoid deadlocks, do not call this function in BT RX or System Workqueue threads. + * + * @param conn The connection object to send the alert to + * @param category The category the unread count is for + * @param unread Total number of unread alerts + * + * @return 0 on success + * @return negative error codes on failure + */ +int bt_ans_set_unread_count(struct bt_conn *conn, enum bt_ans_cat category, uint8_t unread); + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + +#endif /* ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_ANS_H_ */ diff --git a/samples/bluetooth/peripheral_ans/CMakeLists.txt b/samples/bluetooth/peripheral_ans/CMakeLists.txt new file mode 100644 index 000000000000..7bbc26196724 --- /dev/null +++ b/samples/bluetooth/peripheral_ans/CMakeLists.txt @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(peripheral_ans) + +target_sources(app PRIVATE + src/main.c +) diff --git a/samples/bluetooth/peripheral_ans/README.rst b/samples/bluetooth/peripheral_ans/README.rst new file mode 100644 index 000000000000..409de9716a3a --- /dev/null +++ b/samples/bluetooth/peripheral_ans/README.rst @@ -0,0 +1,26 @@ +.. zephyr:code-sample:: ble_peripheral_ans + :name: Peripheral ANS + :relevant-api: bluetooth + + Send notification using Alert Notification Service (ANS). + +Overview +******** + +This sample demonstrates the usage of ANS by acting as a peripheral periodically sending +notifications to the connected remote device. + +Requirements +************ + +* A board with Bluetooth LE support +* Smartphone with Bluetooth LE app (ADI Attach, nRF Connect, etc.) or dedicated Bluetooth LE sniffer + +Building and Running +******************** + +To start receiving alerts over the connection, refer to +`GATT Specification Supplement `_ +section 3.12 for byte array to enable/disable notifications and control the service. + +See :zephyr:code-sample-category:`bluetooth` samples for details. diff --git a/samples/bluetooth/peripheral_ans/prj.conf b/samples/bluetooth/peripheral_ans/prj.conf new file mode 100644 index 000000000000..3778ea08025b --- /dev/null +++ b/samples/bluetooth/peripheral_ans/prj.conf @@ -0,0 +1,9 @@ +CONFIG_LOG=y +CONFIG_UTF8=y +CONFIG_BT=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_HCI_ERR_TO_STR=y +CONFIG_BT_DEVICE_NAME="Zephyr Peripheral ANS Sample" +CONFIG_BT_ANS=y +CONFIG_BT_ANS_LOG_LEVEL_DBG=y +CONFIG_BT_ANS_NALRT_CAT_SIMPLE_ALERT=y diff --git a/samples/bluetooth/peripheral_ans/sample.yaml b/samples/bluetooth/peripheral_ans/sample.yaml new file mode 100644 index 000000000000..e8ceff732c48 --- /dev/null +++ b/samples/bluetooth/peripheral_ans/sample.yaml @@ -0,0 +1,15 @@ +sample: + name: Bluetooth Peripheral ANS + description: Demonstrates the Alert Notification Service (ANS) +tests: + sample.bluetooth.peripheral_ans: + harness: bluetooth + platform_allow: + - qemu_cortex_m3 + - qemu_x86 + - nrf52840dk/nrf52840 + integration_platforms: + - qemu_cortex_m3 + - qemu_x86 + - nrf52840dk/nrf52840 + tags: bluetooth diff --git a/samples/bluetooth/peripheral_ans/src/main.c b/samples/bluetooth/peripheral_ans/src/main.c new file mode 100644 index 000000000000..9e76ef612072 --- /dev/null +++ b/samples/bluetooth/peripheral_ans/src/main.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2025 Sean Kyer + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(peripheral_ans, CONFIG_LOG_DEFAULT_LEVEL); + +/* + * Sample loops forever, incrementing number of new and unread notifications. Number of new and + * unread notifications will overflow and loop back around. + */ +static uint8_t num_unread; +static uint8_t num_new; + +static const struct bt_data ad[] = { + BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), + BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(BT_UUID_ANS_VAL))}; + +static const struct bt_data sd[] = { + BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1), +}; + +static void connected(struct bt_conn *conn, uint8_t err) +{ + if (err != 0) { + LOG_ERR("Connection failed, err 0x%02x %s", err, bt_hci_err_to_str(err)); + return; + } + + LOG_INF("Connected"); +} + +static void disconnected(struct bt_conn *conn, uint8_t reason) +{ + LOG_INF("Disconnected, reason 0x%02x %s", reason, bt_hci_err_to_str(reason)); +} + +static void start_adv(void) +{ + int err; + + err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd)); + if (err != 0) { + LOG_ERR("Advertising failed to start (err %d)", err); + return; + } + + LOG_INF("Advertising successfully started"); +} + +BT_CONN_CB_DEFINE(conn_callbacks) = { + .connected = connected, + .disconnected = disconnected, + .recycled = start_adv, +}; + +int main(void) +{ + int ret; + + LOG_INF("Sample - Bluetooth Peripheral ANS"); + + ret = bt_enable(NULL); + if (ret != 0) { + LOG_ERR("Failed to enable bluetooth: %d", ret); + return ret; + } + + start_adv(); + + num_unread = 0; + num_new = 0; + + /* At runtime, enable support for given categories */ + uint16_t new_alert_mask = (1 << BT_ANS_CAT_SIMPLE_ALERT) | (1 << BT_ANS_CAT_HIGH_PRI_ALERT); + uint16_t unread_mask = 1 << BT_ANS_CAT_SIMPLE_ALERT; + + ret = bt_ans_set_new_alert_support_category(new_alert_mask); + if (ret != 0) { + LOG_ERR("Unable to set new alert support category mask! (err: %d)", ret); + } + + ret = bt_ans_set_unread_support_category(unread_mask); + if (ret != 0) { + LOG_ERR("Unable to set unread support category mask! (err: %d)", ret); + } + + while (true) { + static const char test_msg[] = "Test Alert!"; + static const char high_pri_msg[] = "Prio Alert!"; + + num_new++; + + ret = bt_ans_notify_new_alert(NULL, BT_ANS_CAT_SIMPLE_ALERT, num_new, test_msg); + if (ret != 0) { + LOG_ERR("Failed to push new alert! (err: %d)", ret); + } + k_sleep(K_SECONDS(1)); + + ret = bt_ans_notify_new_alert(NULL, BT_ANS_CAT_HIGH_PRI_ALERT, num_new, + high_pri_msg); + if (ret != 0) { + LOG_ERR("Failed to push new alert! (err: %d)", ret); + } + k_sleep(K_SECONDS(1)); + + ret = bt_ans_set_unread_count(NULL, BT_ANS_CAT_SIMPLE_ALERT, num_unread); + if (ret != 0) { + LOG_ERR("Failed to push new unread count! (err: %d)", ret); + } + + num_unread++; + + k_sleep(K_SECONDS(5)); + } + + return 0; +} diff --git a/subsys/bluetooth/services/CMakeLists.txt b/subsys/bluetooth/services/CMakeLists.txt index bb69916e301a..f17f683d7186 100644 --- a/subsys/bluetooth/services/CMakeLists.txt +++ b/subsys/bluetooth/services/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 +zephyr_sources_ifdef(CONFIG_BT_ANS ans.c) zephyr_sources_ifdef(CONFIG_BT_DIS dis.c) diff --git a/subsys/bluetooth/services/Kconfig b/subsys/bluetooth/services/Kconfig index a57d4998f380..cad7dc5a7258 100644 --- a/subsys/bluetooth/services/Kconfig +++ b/subsys/bluetooth/services/Kconfig @@ -6,6 +6,8 @@ menu "GATT Services" depends on BT_CONN +rsource "Kconfig.ans" + rsource "Kconfig.dis" rsource "Kconfig.cts" diff --git a/subsys/bluetooth/services/Kconfig.ans b/subsys/bluetooth/services/Kconfig.ans new file mode 100644 index 000000000000..e54adb0f76e5 --- /dev/null +++ b/subsys/bluetooth/services/Kconfig.ans @@ -0,0 +1,86 @@ +# Bluetooth GATT Alert Notification Service + +# Copyright (c) 2025 Sean Kyer +# +# SPDX-License-Identifier: Apache-2.0 + +menuconfig BT_ANS + bool "GATT Alert Notification Service [EXPERIMENTAL]" + depends on UTF8 + select EXPERIMENTAL + +if BT_ANS + +module = BT_ANS +module-str = Alert Notification Service (ANS) +source "subsys/logging/Kconfig.template.log_config" + +menu "New Alert Categories" + +config BT_ANS_NALRT_CAT_SIMPLE_ALERT + bool "Support Simple Alert" + +config BT_ANS_NALRT_CAT_EMAIL + bool "Support Email" + +config BT_ANS_NALRT_CAT_NEWS + bool "Support News" + +config BT_ANS_NALRT_CAT_CALL + bool "Support Call" + +config BT_ANS_NALRT_CAT_MISSED_CALL + bool "Support Missed Call" + +config BT_ANS_NALRT_CAT_SMS_MMS + bool "Support SMS/MMS" + +config BT_ANS_NALRT_CAT_VOICE_MAIL + bool "Support Voice Mail" + +config BT_ANS_NALRT_CAT_SCHEDULE + bool "Support Schedule" + +config BT_ANS_NALRT_CAT_HIGH_PRI_ALERT + bool "Support High Priority Alert" + +config BT_ANS_NALRT_CAT_INSTANT_MESSAGE + bool "Support Instant Message" + +endmenu + +menu "Unread Alert Categories" + +config BT_ANS_UNALRT_CAT_SIMPLE_ALERT + bool "Support Simple Alert" + +config BT_ANS_UNALRT_CAT_EMAIL + bool "Support Email" + +config BT_ANS_UNALRT_CAT_NEWS + bool "Support News" + +config BT_ANS_UNALRT_CAT_CALL + bool "Support Call" + +config BT_ANS_UNALRT_CAT_MISSED_CALL + bool "Support Missed Call" + +config BT_ANS_UNALRT_CAT_SMS_MMS + bool "Support SMS/MMS" + +config BT_ANS_UNALRT_CAT_VOICE_MAIL + bool "Support Voice Mail" + +config BT_ANS_UNALRT_CAT_SCHEDULE + bool "Support Schedule" + +config BT_ANS_UNALRT_CAT_HIGH_PRI_ALERT + bool "Support High Priority Alert" + +config BT_ANS_UNALRT_CAT_INSTANT_MESSAGE + bool "Support Instant Message" + +endmenu + +endif # BT_ANS diff --git a/subsys/bluetooth/services/ans.c b/subsys/bluetooth/services/ans.c new file mode 100644 index 000000000000..418c90bc1141 --- /dev/null +++ b/subsys/bluetooth/services/ans.c @@ -0,0 +1,489 @@ +/* + * Copyright (c) 2025 Sean Kyer + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * https://www.bluetooth.com/specifications/specs/alert-notification-service-1-0/ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(bt_ans, CONFIG_BT_ANS_LOG_LEVEL); + +/* + * This only enforces a necessary lower bound at build time. It does + * not guarantee that notification/transmit operations will never fail at + * runtime because other subsystems/services can hold outstanding ATT + * buffers concurrently. + */ +BUILD_ASSERT(CONFIG_BT_MAX_CONN <= CONFIG_BT_ATT_TX_COUNT, + "CONFIG_BT_ATT_TX_COUNT must be >= CONFIG_BT_MAX_CONN"); + +/* Build time ANS supported category bit mask */ +#define BT_ANS_NALRT_CAT_MASK \ + ((IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_SIMPLE_ALERT) << BT_ANS_CAT_SIMPLE_ALERT) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_EMAIL) << BT_ANS_CAT_EMAIL) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_NEWS) << BT_ANS_CAT_NEWS) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_CALL) << BT_ANS_CAT_CALL) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_MISSED_CALL) << BT_ANS_CAT_MISSED_CALL) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_SMS_MMS) << BT_ANS_CAT_SMS_MMS) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_VOICE_MAIL) << BT_ANS_CAT_VOICE_MAIL) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_SCHEDULE) << BT_ANS_CAT_SCHEDULE) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_HIGH_PRI_ALERT) << BT_ANS_CAT_HIGH_PRI_ALERT) | \ + (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_INSTANT_MESSAGE) << BT_ANS_CAT_INSTANT_MESSAGE)) + +/* Build time ANS supported category bit mask */ +#define BT_ANS_UNALRT_CAT_MASK \ + ((IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_SIMPLE_ALERT) << BT_ANS_CAT_SIMPLE_ALERT) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_EMAIL) << BT_ANS_CAT_EMAIL) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_NEWS) << BT_ANS_CAT_NEWS) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_CALL) << BT_ANS_CAT_CALL) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_MISSED_CALL) << BT_ANS_CAT_MISSED_CALL) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_SMS_MMS) << BT_ANS_CAT_SMS_MMS) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_VOICE_MAIL) << BT_ANS_CAT_VOICE_MAIL) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_SCHEDULE) << BT_ANS_CAT_SCHEDULE) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_HIGH_PRI_ALERT) << BT_ANS_CAT_HIGH_PRI_ALERT) | \ + (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_INSTANT_MESSAGE) << BT_ANS_CAT_INSTANT_MESSAGE)) + +/* As per spec, ensure at least one New Alert category is supported */ +BUILD_ASSERT(BT_ANS_NALRT_CAT_MASK != 0, + "At least one ANS New Alert category must be enabled in Kconfig"); + +static uint16_t alert_sup_cat_bit_mask = BT_ANS_NALRT_CAT_MASK; +static uint16_t unread_sup_cat_bit_mask = BT_ANS_UNALRT_CAT_MASK; + +/* Command ID definitions */ +#define BT_ANS_SEND_ALL_CATEGORY 0xFF +enum bt_ans_command_id { + BT_ANS_CTRL_ENABLE_NEW_ALERT, + BT_ANS_CTRL_ENABLE_UNREAD, + BT_ANS_CTRL_DISABLE_NEW_ALERT, + BT_ANS_CTRL_DISABLE_UNREAD, + BT_ANS_CTRL_NOTIFY_NEW_ALERT_IMMEDIATE, + BT_ANS_CTRL_NOTIFY_UNREAD_IMMEDIATE, +}; + +/* Struct definition for Alert Notification Control Point */ +struct alert_ctrl_p { + uint8_t cmd_id; + uint8_t category; +} __packed; + +/* Struct definition for New Alert */ +struct new_alert { + uint8_t category_id; + uint8_t num_new_alerts; + char text_string[BT_ANS_MAX_TEXT_STR_SIZE + 1]; +} __packed; + +/* Struct definition for Unread Alert */ +struct unread_alert_status { + uint8_t category_id; + uint8_t unread_count; +} __packed; + +/* Mutex for modifying database */ +K_MUTEX_DEFINE(new_alert_mutex); +K_MUTEX_DEFINE(unread_mutex); + +/* Saved messages database */ +static struct new_alert new_alerts[BT_ANS_CAT_NUM]; +static struct unread_alert_status unread_alerts[BT_ANS_CAT_NUM]; + +/* Initialize to 0, it is control point responsibility to enable once connected */ +static uint16_t alert_cat_enabled_map; +static uint16_t unread_cat_enabled_map; + +/* Supported New Alert Category */ +static ssize_t read_supp_new_alert_cat(struct bt_conn *conn, const struct bt_gatt_attr *attr, + void *buf, uint16_t len, uint16_t offset) +{ + LOG_DBG("Supported New Alert Category Read"); + + /* Return the bit mask of the supported categories */ + return bt_gatt_attr_read(conn, attr, buf, len, offset, &alert_sup_cat_bit_mask, + sizeof(alert_sup_cat_bit_mask)); +} + +/* New Alert Notifications */ +static void new_alert_ccc_cfg_changed(const struct bt_gatt_attr *attr, uint16_t value) +{ + ARG_UNUSED(attr); + + LOG_DBG("New Alert Notifications %s", value == BT_GATT_CCC_NOTIFY ? "enabled" : "disabled"); +} + +/* Supported Unread Alert Category*/ +static ssize_t read_supp_unread_alert_cat(struct bt_conn *conn, const struct bt_gatt_attr *attr, + void *buf, uint16_t len, uint16_t offset) +{ + LOG_DBG("Supported Unread Alert Category Read"); + + return bt_gatt_attr_read(conn, attr, buf, len, offset, &unread_sup_cat_bit_mask, + sizeof(unread_sup_cat_bit_mask)); +} + +/* Unread Alert Status Notifications */ +static void unread_alert_status_ccc_cfg_changed(const struct bt_gatt_attr *attr, uint16_t value) +{ + ARG_UNUSED(attr); + + LOG_DBG("Unread Alert Status Notifications %s", + value == BT_GATT_CCC_NOTIFY ? "enabled" : "disabled"); +} + +/* Alert Notification Control Point */ +static int transmit_new_alert(struct bt_conn *conn, enum bt_ans_cat category); +static int transmit_unread_alert(struct bt_conn *conn, enum bt_ans_cat category); +static ssize_t write_alert_notif_ctrl_point(struct bt_conn *conn, const struct bt_gatt_attr *attr, + const void *buf, uint16_t len, uint16_t offset, + uint8_t flags) +{ + int rc; + + LOG_DBG("Alert Control Point Written %u", len); + + if (len != sizeof(struct alert_ctrl_p)) { + LOG_DBG("Length of control packet is %u when expected %zu", len, + sizeof(struct alert_ctrl_p)); + return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); + } + + struct alert_ctrl_p command = *((const struct alert_ctrl_p *)buf); + + LOG_DBG("Command ID 0x%x", command.cmd_id); + LOG_DBG("Category 0x%x", command.category); + + if (command.category >= BT_ANS_CAT_NUM && command.category != BT_ANS_SEND_ALL_CATEGORY) { + LOG_DBG("Received control point request for category out of bounds: %d", + command.category); + return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); + } + + /* + * If category is BT_ANS_SEND_ALL_CATEGORY then only BT_ANS_CTRL_NOTIFY_NEW_ALERT_IMMEDIATE + * or BT_ANS_CTRL_NOTIFY_UNREAD_IMMEDIATE are valid command IDs + */ + if (command.category == BT_ANS_SEND_ALL_CATEGORY) { + switch (command.cmd_id) { + case BT_ANS_CTRL_NOTIFY_NEW_ALERT_IMMEDIATE: + rc = transmit_new_alert(conn, command.category); + return rc ? BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP) : len; + case BT_ANS_CTRL_NOTIFY_UNREAD_IMMEDIATE: + rc = transmit_unread_alert(conn, command.category); + return rc ? BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP) : len; + default: + return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); + } + } + + switch (command.cmd_id) { + case BT_ANS_CTRL_ENABLE_NEW_ALERT: + if ((alert_sup_cat_bit_mask & (1U << command.category)) == 0) { + LOG_DBG("Received control point request for unsupported category: " + "%d", + command.category); + return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); + } + alert_cat_enabled_map |= (1U << command.category); + break; + case BT_ANS_CTRL_ENABLE_UNREAD: + if ((unread_sup_cat_bit_mask & (1U << command.category)) == 0) { + LOG_DBG("Received control point request for unsupported category: " + "%d", + command.category); + return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); + } + unread_cat_enabled_map |= (1U << command.category); + break; + case BT_ANS_CTRL_DISABLE_NEW_ALERT: + if ((alert_sup_cat_bit_mask & (1U << command.category)) == 0) { + LOG_DBG("Received control point request for unsupported category: " + "%d", + command.category); + + return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); + } + alert_cat_enabled_map &= ~(1U << command.category); + break; + case BT_ANS_CTRL_DISABLE_UNREAD: + if ((unread_sup_cat_bit_mask & (1U << command.category)) == 0) { + LOG_DBG("Received control point request for unsupported category: " + "%d", + command.category); + return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); + } + unread_cat_enabled_map &= ~(1U << command.category); + break; + default: + return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); + } + + return len; +} + +static int ans_init(void) +{ + for (int i = 0; i < BT_ANS_CAT_NUM; i++) { + new_alerts[i].category_id = i; + unread_alerts[i].category_id = i; + } + + LOG_INF("ANS initialization complete"); + + return 0; +} + +/* Alert Notification Service Declaration */ +BT_GATT_SERVICE_DEFINE( + ans_svc, BT_GATT_PRIMARY_SERVICE(BT_UUID_ANS), + BT_GATT_CHARACTERISTIC(BT_UUID_GATT_SNALRTC, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, + read_supp_new_alert_cat, NULL, NULL), + BT_GATT_CHARACTERISTIC(BT_UUID_GATT_NALRT, BT_GATT_CHRC_NOTIFY, BT_GATT_PERM_NONE, NULL, + NULL, NULL), + BT_GATT_CCC(new_alert_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), + BT_GATT_CHARACTERISTIC(BT_UUID_GATT_SUALRTC, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, + read_supp_unread_alert_cat, NULL, NULL), + BT_GATT_CHARACTERISTIC(BT_UUID_GATT_UALRTS, BT_GATT_CHRC_NOTIFY, BT_GATT_PERM_NONE, NULL, + NULL, NULL), + BT_GATT_CCC(unread_alert_status_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), + BT_GATT_CHARACTERISTIC(BT_UUID_GATT_ALRTNCP, BT_GATT_CHRC_WRITE, BT_GATT_PERM_WRITE, NULL, + write_alert_notif_ctrl_point, NULL)); + +/* Helper to notify a single category */ +static int notify_new_alert_category(struct bt_conn *conn, uint8_t cat) +{ + int rc; + int ret; + + ret = k_mutex_lock(&new_alert_mutex, K_NO_WAIT); + if (ret != 0) { + LOG_ERR("Unable to lock mutex (err: %d)", ret); + return -EAGAIN; + } + + rc = bt_gatt_notify_uuid(conn, BT_UUID_GATT_NALRT, ans_svc.attrs, &new_alerts[cat], + sizeof(struct new_alert)); + + ret = k_mutex_unlock(&new_alert_mutex); + __ASSERT(ret == 0, "Unable to unlock mutex (err: %d)", ret); + + /* If the client is not connected, that is fine */ + if (rc != 0 && rc != -ENOTCONN) { + LOG_DBG("Error notifying New Alert category %d rc: %d", cat, rc); + return rc; + } + + return 0; +} + +/* Transmit New Alert */ +static int transmit_new_alert(struct bt_conn *conn, enum bt_ans_cat category) +{ + int rc; + + uint8_t cat_in = (uint8_t)category; + + /* Nothing to do if notify is disabled */ + if (conn != NULL && !bt_gatt_is_subscribed(conn, &ans_svc.attrs[3], BT_GATT_CCC_NOTIFY)) { + return 0; + } + + /* Special case: send all categories */ + if (cat_in == BT_ANS_SEND_ALL_CATEGORY) { + for (int i = 0; i < BT_ANS_CAT_NUM; i++) { + if (((alert_sup_cat_bit_mask & BIT(i)) != 0) && + ((alert_cat_enabled_map & BIT(i)) != 0)) { + rc = notify_new_alert_category(conn, i); + if (rc < 0) { + return rc; + } + } + } + return 0; + } + + /* Otherwise send just the requested category (if enabled) */ + if ((alert_cat_enabled_map & BIT(cat_in)) != 0) { + return notify_new_alert_category(conn, cat_in); + } + + return 0; +} + +/* Helper to notify a single unread alert category */ +static int notify_unread_alert_category(struct bt_conn *conn, uint8_t cat) +{ + int rc; + int ret; + + ret = k_mutex_lock(&unread_mutex, K_NO_WAIT); + if (ret != 0) { + LOG_ERR("Unable to lock mutex (err: %d)", ret); + return -EAGAIN; + } + + rc = bt_gatt_notify_uuid(conn, BT_UUID_GATT_UALRTS, ans_svc.attrs, &unread_alerts[cat], + sizeof(struct unread_alert_status)); + + ret = k_mutex_unlock(&unread_mutex); + __ASSERT(ret == 0, "Unable to unlock mutex (err: %d)", ret); + + /* If the client is not connected, that is fine */ + if (rc != 0 && rc != -ENOTCONN) { + LOG_DBG("Error notifying Unread Alert category %d rc: %d", cat, rc); + return rc; + } + + return 0; +} + +/* Transmit Unread Alert */ +static int transmit_unread_alert(struct bt_conn *conn, enum bt_ans_cat category) +{ + int rc; + + uint8_t cat_in = (uint8_t)category; + + /* Nothing to do if notify is disabled */ + if (conn != NULL && !bt_gatt_is_subscribed(conn, &ans_svc.attrs[6], BT_GATT_CCC_NOTIFY)) { + return 0; + } + + /* Special case: send all categories */ + if (cat_in == BT_ANS_SEND_ALL_CATEGORY) { + for (int i = 0; i < BT_ANS_CAT_NUM; i++) { + if ((unread_sup_cat_bit_mask & BIT(i)) && + (unread_cat_enabled_map & BIT(i))) { + rc = notify_unread_alert_category(conn, i); + if (rc < 0) { + return rc; + } + } + } + return 0; + } + + /* Otherwise send just the requested category (if enabled) */ + if ((unread_cat_enabled_map & BIT(cat_in)) != 0) { + return notify_unread_alert_category(conn, cat_in); + } + + return 0; +} + +int bt_ans_notify_new_alert(struct bt_conn *conn, enum bt_ans_cat category, uint8_t num_new, + const char *text) +{ + int ret; + + uint8_t cat_in = (uint8_t)category; + + /* Check if the category is supported */ + if ((alert_sup_cat_bit_mask & (1U << cat_in)) == 0) { + LOG_DBG("Category %d unsupported", cat_in); + return -EINVAL; + } + + /* Update the saved value */ + ret = k_mutex_lock(&new_alert_mutex, K_FOREVER); + __ASSERT(ret == 0, "Unable to lock mutex (err: %d)", ret); + new_alerts[cat_in].num_new_alerts = num_new; + utf8_lcpy(new_alerts[cat_in].text_string, text, sizeof(new_alerts[cat_in].text_string)); + ret = k_mutex_unlock(&new_alert_mutex); + __ASSERT(ret == 0, "Unable to unlock mutex (err: %d)", ret); + + return transmit_new_alert(conn, category); +} + +int bt_ans_set_unread_count(struct bt_conn *conn, enum bt_ans_cat category, uint8_t unread) +{ + int ret; + + uint8_t cat_in = (uint8_t)category; + + /* Check if the category is supported */ + if ((unread_sup_cat_bit_mask & (1U << cat_in)) == 0) { + LOG_DBG("Category %d unsupported", cat_in); + return -EINVAL; + } + + /* Update the saved value */ + ret = k_mutex_lock(&unread_mutex, K_FOREVER); + __ASSERT(ret == 0, "Unable to lock mutex (err: %d)", ret); + unread_alerts[cat_in].unread_count = unread; + ret = k_mutex_unlock(&unread_mutex); + __ASSERT(ret == 0, "Unable to unlock mutex (err: %d)", ret); + + return transmit_unread_alert(conn, category); +} + +/* Callback used by bt_conn_foreach() to detect an established connection. */ +static void ans_conn_check_cb(struct bt_conn *conn, void *data) +{ + int err; + bool *has_conn = data; + struct bt_conn_info info; + + err = bt_conn_get_info(conn, &info); + if (err == 0 && info.state == BT_CONN_STATE_CONNECTED) { + *has_conn = true; + } +} + +/* Used to check if an active connect exists, stopping modifications to supported features */ +static bool ans_check_conn_busy(void) +{ + bool has_conn = false; + + bt_conn_foreach(BT_CONN_TYPE_ALL, ans_conn_check_cb, &has_conn); + + if (has_conn) { + /* Cannot change support while connection exists */ + return true; + } + + return false; +} + +int bt_ans_set_new_alert_support_category(uint16_t mask) +{ + if (ans_check_conn_busy()) { + /* Cannot change support while connection exists */ + return -EBUSY; + } + + alert_sup_cat_bit_mask = mask; + + LOG_DBG("New Alert Support Bit Mask: %x", alert_sup_cat_bit_mask); + + return 0; +} + +int bt_ans_set_unread_support_category(uint16_t mask) +{ + if (ans_check_conn_busy()) { + /* Cannot change support while connection exists */ + return -EBUSY; + } + + unread_sup_cat_bit_mask = mask; + + LOG_DBG("Unread Support Bit Mask: %x", unread_sup_cat_bit_mask); + + return 0; +} + +SYS_INIT(ans_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); From a954a5383ee57bf90203d677a126c0de1b95a7eb Mon Sep 17 00:00:00 2001 From: Sean Kyer Date: Sat, 6 Sep 2025 13:15:01 -0700 Subject: [PATCH 0397/3334] [nrf fromtree] doc: release: Add Bluetooth ANS service to 4.4 release notes Add Alert Notification Service (ANS) and enabling Kconfig to 4.4 release notes. Signed-off-by: Sean Kyer (cherry picked from commit 830bc4f13a18844b5e5fae15414e939798071ef3) Signed-off-by: Aleksandr Khromykh --- doc/releases/release-notes-4.4.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 4cbcd6f9b217..f413980e39ad 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -64,6 +64,12 @@ New APIs and options .. zephyr-keep-sorted-start re(^\* \w) +* Bluetooth + + * Services + + * Introduced Alert Notification Service (ANS) :kconfig:option:`CONFIG_BT_ANS` + * Flash * :dtcompatible:`jedec,mspi-nor` now allows MSPI configuration of read, write and @@ -96,6 +102,8 @@ New Drivers New Samples *********** +* :zephyr:code-sample:`ble_peripheral_ans` + .. Same as above, this will also be recomputed at the time of the release. Just link the sample, further details go in the sample documentation itself. From 0adebce8bb8a4acf8a7c8dda0499dd7f47666f96 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 17 Nov 2025 14:47:44 +0100 Subject: [PATCH 0398/3334] [nrf fromtree] bluetooth: mesh: improve oob size checking Commit improves oob size checking to catch wrong size as early as possible and prevents zero size. Signed-off-by: Aleksandr Khromykh (cherry picked from commit 666950efffab36c8ff27e95c008db113945d698b) Signed-off-by: Aleksandr Khromykh --- subsys/bluetooth/mesh/prov.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/subsys/bluetooth/mesh/prov.c b/subsys/bluetooth/mesh/prov.c index d83485962a13..e8e3918bdabf 100644 --- a/subsys/bluetooth/mesh/prov.c +++ b/subsys/bluetooth/mesh/prov.c @@ -96,7 +96,7 @@ static int check_output_auth(bt_mesh_output_action_t output, uint8_t size) return -EINVAL; } - if (size > bt_mesh_prov->output_size) { + if (size > bt_mesh_prov->output_size || size == 0) { return -EINVAL; } @@ -113,7 +113,7 @@ static int check_input_auth(bt_mesh_input_action_t input, uint8_t size) return -EINVAL; } - if (size > bt_mesh_prov->input_size) { + if (size > bt_mesh_prov->input_size || size == 0) { return -EINVAL; } @@ -176,6 +176,8 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 uint8_t auth_size = bt_mesh_prov_auth_size_get(); int err; + size = MIN(size, PROV_IO_OOB_SIZE_MAX); + switch (method) { case AUTH_METHOD_NO_OOB: if (action || size) { @@ -195,6 +197,10 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 case AUTH_METHOD_OUTPUT: output = output_action(action); + err = check_output_auth(output, size); + if (err) { + return err; + } if (is_provisioner) { if (output == BT_MESH_DISPLAY_STRING) { @@ -208,10 +214,6 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 return bt_mesh_prov->input(input, size); } - err = check_output_auth(output, size); - if (err) { - return err; - } if (output == BT_MESH_DISPLAY_STRING) { char str[9]; @@ -227,13 +229,12 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 case AUTH_METHOD_INPUT: input = input_action(action); + err = check_input_auth(input, size); + if (err) { + return err; + } if (!is_provisioner) { - err = check_input_auth(input, size); - if (err) { - return err; - } - if (input == BT_MESH_ENTER_STRING) { atomic_set_bit(bt_mesh_prov_link.flags, WAIT_STRING); } else { From f1214e9819dc3b7d0d54f34b785bbb0fb33a2d3e Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 17 Nov 2025 15:13:11 +0100 Subject: [PATCH 0399/3334] [nrf fromtree] bluetooth: mesh: zeroing not used part of auth array Commit set zero to not used part of authentication array to prevent garbage from the previous provisioning using. Signed-off-by: Aleksandr Khromykh (cherry picked from commit 760d190723d0f40dac90e713a8a955b02cb1c3e7) Signed-off-by: Aleksandr Khromykh --- subsys/bluetooth/mesh/prov.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/mesh/prov.c b/subsys/bluetooth/mesh/prov.c index e8e3918bdabf..373fec3b4ac7 100644 --- a/subsys/bluetooth/mesh/prov.c +++ b/subsys/bluetooth/mesh/prov.c @@ -293,6 +293,7 @@ int bt_mesh_input_string(const char *str) } memcpy(bt_mesh_prov_link.auth, str, strlen(str)); + memset(bt_mesh_prov_link.auth + size, 0, sizeof(bt_mesh_prov_link.auth) - size); bt_mesh_prov_link.role->input_complete(); From 467bf7c0185dace5cb012bd059c896915ded690a Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 17 Nov 2025 15:16:09 +0100 Subject: [PATCH 0400/3334] [nrf fromtree] bluetooth: mesh: prevent getting wrong authentication size Commit moves SHA256 authentication size under SHA256 macro. Signed-off-by: Aleksandr Khromykh (cherry picked from commit 8b2e37f0e222ce72b065b603a7d81edfadef40e8) Signed-off-by: Aleksandr Khromykh --- subsys/bluetooth/mesh/prov.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/prov.h b/subsys/bluetooth/mesh/prov.h index 00bd85952e0e..c21ec395090c 100644 --- a/subsys/bluetooth/mesh/prov.h +++ b/subsys/bluetooth/mesh/prov.h @@ -164,10 +164,14 @@ static inline void bt_mesh_prov_buf_init(struct net_buf_simple *buf, uint8_t typ net_buf_simple_add_u8(buf, type); } - static inline uint8_t bt_mesh_prov_auth_size_get(void) { - return bt_mesh_prov_link.algorithm == BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM ? 16 : 32; + if (IS_ENABLED(CONFIG_BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM)) { + return bt_mesh_prov_link.algorithm == BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM ? 16 + : 32; + } else { + return 16; + } } static inline k_timeout_t bt_mesh_prov_protocol_timeout_get(void) From 74e1653a59a2b4489a8d282c2dd432793742f36f Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 17 Nov 2025 15:18:03 +0100 Subject: [PATCH 0401/3334] [nrf fromtree] bluetooth: mesh: adjust adv stack dependency and size Commit removes legacy dependancy on Host crypto. Additionally, it adapts advertiser stack size if provisioner feature has been enabled (tested with mesh_shell and thread analyzer). Signed-off-by: Aleksandr Khromykh (cherry picked from commit 6bf8409e3908a01661cd8dcaa1bd335b9242b0a2) Signed-off-by: Aleksandr Khromykh --- subsys/bluetooth/mesh/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 02845ab743c5..74a5ed11cac5 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -72,7 +72,8 @@ if BT_MESH_ADV_LEGACY config BT_MESH_ADV_STACK_SIZE int "Mesh advertiser thread stack size" - default 1024 if BT_HOST_CRYPTO + default 1800 if BT_MESH_PROVISIONER + default 1536 if BT_MESH_PROXY default 776 if BT_MESH_PRIV_BEACONS default 768 help @@ -142,8 +143,8 @@ if BT_MESH_WORKQ_MESH config BT_MESH_ADV_STACK_SIZE int "Mesh extended advertiser thread stack size" + default 2048 if BT_MESH_PROVISIONER default 1536 if BT_MESH_PROXY - default 1024 if BT_HOST_CRYPTO default 776 if BT_MESH_PRIV_BEACONS default 768 help From d558ffefc35213a30795b68e0b5cfcabb169b174 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 17 Nov 2025 15:20:05 +0100 Subject: [PATCH 0402/3334] [nrf fromtree] bluetooth: mesh: update max oob size till 32 bytes Commit updates maximum OOB authentication size from 8 bytes till 32 bytes according to specification errata ES-27446. Since previous OOB API does not allow to expose OOB values with such width the new API has been introduced. The previous API was deprecated and hidden under BT_MESH_PROV_OOB_API_LEGACY option and left for backward compatibility with existing code base. Signed-off-by: Aleksandr Khromykh (cherry picked from commit 613d228002ac134ab432d3d4f9280ef58c00bec4) Signed-off-by: Aleksandr Khromykh --- .../bluetooth/api/mesh/provisioning.rst | 2 +- doc/releases/release-notes-4.4.rst | 15 ++ include/zephyr/bluetooth/mesh/main.h | 45 +++- samples/bluetooth/mesh/src/main.c | 13 +- .../boards/nordic/mesh/onoff-app/src/main.c | 11 +- .../src/mesh/ble_mesh.c | 10 +- subsys/bluetooth/mesh/Kconfig | 12 ++ subsys/bluetooth/mesh/prov.c | 199 +++++++++++++----- subsys/bluetooth/mesh/prov.h | 6 +- subsys/bluetooth/mesh/provisioner.c | 6 +- subsys/bluetooth/mesh/shell/shell.c | 114 +++++++++- tests/bluetooth/tester/src/btp_mesh.c | 14 +- .../bsim/bluetooth/mesh/src/test_provision.c | 89 +++++--- 13 files changed, 428 insertions(+), 108 deletions(-) diff --git a/doc/connectivity/bluetooth/api/mesh/provisioning.rst b/doc/connectivity/bluetooth/api/mesh/provisioning.rst index 685c9dda455a..311904882078 100644 --- a/doc/connectivity/bluetooth/api/mesh/provisioning.rst +++ b/doc/connectivity/bluetooth/api/mesh/provisioning.rst @@ -144,7 +144,7 @@ sequence should be repeated after a delay of three seconds or more. When an Input OOB action is selected, the user should be prompted when the application receives the :c:member:`bt_mesh_prov.input` callback. The user response should be fed back to the Provisioning API through -:c:func:`bt_mesh_input_string` or :c:func:`bt_mesh_input_number`. If +:c:func:`bt_mesh_input_string` or :c:func:`bt_mesh_input_numeric`. If no user response is recorded within 60 seconds, the Provisioning process is aborted. diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index f413980e39ad..d6277acc7161 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -53,6 +53,15 @@ Removed APIs and options Deprecated APIs and options =========================== +* Bluetooth + + * Mesh + + * The function :c:func:`bt_mesh_input_number` was deprecated. Applications should use + :c:func:`bt_mesh_input_numeric` instead. + * The callback :c:member:`output_number` in :c:struct:`bt_mesh_prov` structure was deprecated. + Applications should use :c:member:`output_numeric` callback instead. + New APIs and options ==================== @@ -66,6 +75,12 @@ New APIs and options * Bluetooth + * Mesh + + * :c:func:`bt_mesh_input_numeric` to provide provisioning numeric input OOB value. + * :c:member:`output_numeric` callback in :c:struct:`bt_mesh_prov` structure to + output numeric values during provisioning. + * Services * Introduced Alert Notification Service (ANS) :kconfig:option:`CONFIG_BT_ANS` diff --git a/include/zephyr/bluetooth/mesh/main.h b/include/zephyr/bluetooth/mesh/main.h index dfcd1d0bd7c9..76283aa39c8f 100644 --- a/include/zephyr/bluetooth/mesh/main.h +++ b/include/zephyr/bluetooth/mesh/main.h @@ -173,6 +173,7 @@ struct bt_mesh_prov { */ void (*capabilities)(const struct bt_mesh_dev_capabilities *cap); +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY /** @brief Output of a number is requested. * * This callback notifies the application that it should @@ -183,7 +184,21 @@ struct bt_mesh_prov { * * @return Zero on success or negative error code otherwise */ - int (*output_number)(bt_mesh_output_action_t act, uint32_t num); + int (*output_number)(bt_mesh_output_action_t act, uint32_t num) __deprecated; +#else + /** @brief Output of a numeric value is requested. + * + * This callback notifies the application that it should + * output the given numeric value using the given action. + * + * @param act Action for outputting the numeric value. + * @param numeric memory with numeric value in the little endian format to be outputted. + * @param size size of the numeric value in bytes. + * + * @return Zero on success or negative error code otherwise + */ + int (*output_numeric)(bt_mesh_output_action_t act, uint8_t *numeric, size_t size); +#endif /** @brief Output of a string is requested. * @@ -202,7 +217,7 @@ struct bt_mesh_prov { * request input from the user using the given action. The * requested input will either be a string or a number, and * the application needs to consequently call the - * bt_mesh_input_string() or bt_mesh_input_number() functions + * bt_mesh_input_string() or bt_mesh_input_numeric() functions * once the data has been acquired from the user. * * @param act Action for inputting data. @@ -313,7 +328,7 @@ struct bt_mesh_rpr_node; /** @brief Provide provisioning input OOB string. * - * This is intended to be called after the bt_mesh_prov input callback + * This is intended to be called after the @ref bt_mesh_prov::input callback * has been called with BT_MESH_ENTER_STRING as the action. * * @param str String. @@ -322,16 +337,30 @@ struct bt_mesh_rpr_node; */ int bt_mesh_input_string(const char *str); +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY /** @brief Provide provisioning input OOB number. * - * This is intended to be called after the bt_mesh_prov input callback - * has been called with BT_MESH_ENTER_NUMBER as the action. + * This is intended to be called after the @ref bt_mesh_prov::input callback + * has been called with @ref BT_MESH_ENTER_NUMBER as the action. * * @param num Number. * * @return Zero on success or (negative) error code otherwise. */ -int bt_mesh_input_number(uint32_t num); +__deprecated int bt_mesh_input_number(uint32_t num); +#endif + +/** @brief Provide provisioning input OOB numeric value. + * + * This is intended to be called after the @ref bt_mesh_prov::input callback + * has been called with @ref BT_MESH_ENTER_NUMBER as the action. + * + * @param numeric Pointer to the numeric value in little endian. + * @param size Size of the numeric value in bytes (this is not OOB size). + * + * @return Zero on success or (negative) error code otherwise. + */ +int bt_mesh_input_numeric(uint8_t *numeric, size_t size); /** @brief Provide Device public key. * @@ -347,7 +376,7 @@ int bt_mesh_prov_remote_pub_key_set(const uint8_t public_key[64]); * * Instruct the unprovisioned device to use the specified Input OOB * authentication action. When using @ref BT_MESH_PUSH, @ref BT_MESH_TWIST or - * @ref BT_MESH_ENTER_NUMBER, the @ref bt_mesh_prov::output_number callback is + * @ref BT_MESH_ENTER_NUMBER, the @ref bt_mesh_prov::output_numeric callback is * called with a random number that has to be entered on the unprovisioned * device. * @@ -372,7 +401,7 @@ int bt_mesh_auth_method_set_input(bt_mesh_input_action_t action, uint8_t size); * * When using @ref BT_MESH_BLINK, @ref BT_MESH_BEEP, @ref BT_MESH_VIBRATE * or @ref BT_MESH_DISPLAY_NUMBER, and the application has to call - * @ref bt_mesh_input_number with the random number indicated by + * @ref bt_mesh_input_numeric with the random number indicated by * the unprovisioned device. * * When using @ref BT_MESH_DISPLAY_STRING, the application has to call diff --git a/samples/bluetooth/mesh/src/main.c b/samples/bluetooth/mesh/src/main.c index cec8159e292a..02decb8585e2 100644 --- a/samples/bluetooth/mesh/src/main.c +++ b/samples/bluetooth/mesh/src/main.c @@ -267,9 +267,16 @@ static const struct bt_mesh_comp comp = { }; /* Provisioning */ - -static int output_number(bt_mesh_output_action_t action, uint32_t number) +static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size) { + uint32_t number; + + if (size != sizeof(number)) { + printk("Wrong OOB size: %u\n", size); + return -EINVAL; + } + + number = sys_get_le32(numeric); printk("OOB Number: %u\n", number); board_output_number(action, number); @@ -293,7 +300,7 @@ static const struct bt_mesh_prov prov = { .uuid = dev_uuid, .output_size = 4, .output_actions = BT_MESH_DISPLAY_NUMBER, - .output_number = output_number, + .output_numeric = output_numeric, .complete = prov_complete, .reset = prov_reset, }; diff --git a/samples/boards/nordic/mesh/onoff-app/src/main.c b/samples/boards/nordic/mesh/onoff-app/src/main.c index 17b04c87fad6..a90c45fe7f09 100644 --- a/samples/boards/nordic/mesh/onoff-app/src/main.c +++ b/samples/boards/nordic/mesh/onoff-app/src/main.c @@ -47,6 +47,7 @@ #include #include #include +#include /* Model Operation Codes */ #define BT_MESH_MODEL_OP_GEN_ONOFF_GET BT_MESH_MODEL_OP_2(0x82, 0x01) @@ -366,9 +367,13 @@ static int gen_onoff_status(const struct bt_mesh_model *model, return 0; } -static int output_number(bt_mesh_output_action_t action, uint32_t number) +static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size) { - printk("OOB Number %06u\n", number); + uint64_t number = 0ull; + + sys_get_le(&number, numeric, size); + + printk("OOB Number %06" PRIu64 "\n", number); return 0; } @@ -525,7 +530,7 @@ static const struct bt_mesh_prov prov = { #if 1 .output_size = 6, .output_actions = (BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING), - .output_number = output_number, + .output_numeric = output_numeric, .output_string = output_string, #else .output_size = 0, diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c index 0234d8d971be..c55e0d0ab77e 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c @@ -10,9 +10,13 @@ #ifdef OOB_AUTH_ENABLE -static int output_number(bt_mesh_output_action_t action, uint32_t number) +static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size) { - printk("OOB Number: %u\n", number); + uint64_t number = 0ull; + + sys_get_le(&number, numeric, size); + + printk("OOB Number %06" PRIu64 "\n", number); return 0; } @@ -42,7 +46,7 @@ static const struct bt_mesh_prov prov = { .output_size = 6, .output_actions = BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING, - .output_number = output_number, + .output_numeric = output_numeric, .output_string = output_string, #endif diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 74a5ed11cac5..87382d67025b 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -361,6 +361,18 @@ config BT_MESH_OOB_AUTH_REQUIRED bool "OOB authentication mandates to use HMAC SHA256" depends on BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM +config BT_MESH_PROV_OOB_API_LEGACY + bool "Reduced maximum OOB authentication size support [DEPRECATED]" + select DEPRECATED + depends on BT_MESH_PROV + help + By default, the maximum OOB authentication size is 32 bytes. + Enable this option to use the legacy API which is only compatible with + specification v1.1 and earlier. This limits OOB authentication to 8 + bytes maximum. + This option is intended for backward compatibility. + Not recommended for new designs due to reduced security. + config BT_MESH_PROVISIONER bool "Provisioner support" depends on BT_MESH_CDB diff --git a/subsys/bluetooth/mesh/prov.c b/subsys/bluetooth/mesh/prov.c index 373fec3b4ac7..a5cd8a9fc927 100644 --- a/subsys/bluetooth/mesh/prov.c +++ b/subsys/bluetooth/mesh/prov.c @@ -28,6 +28,9 @@ #include LOG_MODULE_REGISTER(bt_mesh_prov); +/* 10 power 32 represents 14 bytes maximum in little-endian format */ +#define MAX_NUMERIC_OOB_BYTES 14 + struct bt_mesh_prov_link bt_mesh_prov_link; const struct bt_mesh_prov *bt_mesh_prov; @@ -122,57 +125,121 @@ static int check_input_auth(bt_mesh_input_action_t input, uint8_t size) static void get_auth_string(char *str, uint8_t size) { - uint64_t value; - - bt_rand(&value, sizeof(value)); - static const char characters[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - for (int i = 0; i < size; i++) { - /* pull base-36 digits: */ - int idx = value % 36; + bt_rand(str, size); - value = value / 36; - str[i] = characters[idx]; + for (int i = 0; i < size; i++) { + str[i] = characters[(uint8_t)str[i] % (uint8_t)36]; } - str[size] = '\0'; - memcpy(bt_mesh_prov_link.auth, str, size); memset(bt_mesh_prov_link.auth + size, 0, sizeof(bt_mesh_prov_link.auth) - size); } -static uint32_t get_auth_number(bt_mesh_output_action_t output, - bt_mesh_input_action_t input, uint8_t size) +/* Computes 10^n - 1 in little endian array */ +static void compute_pow10_minus1(uint8_t n, uint8_t *out, size_t *out_len) { - const uint32_t divider[PROV_IO_OOB_SIZE_MAX] = { 10, 100, 1000, 10000, - 100000, 1000000, 10000000, 100000000 }; - uint8_t auth_size = bt_mesh_prov_auth_size_get(); - uint32_t num = 0; + out[0] = 1; /* Start with value 1 at LSB */ + size_t len = 1; + + /* Compute 10^n */ + for (uint8_t i = 0; i < n; ++i) { + uint16_t carry = 0; + + for (size_t j = 0; j < len; ++j) { + uint16_t prod = out[j] * 10 + carry; - bt_rand(&num, sizeof(num)); + out[j] = prod & 0xFF; + carry = prod >> 8; + } - if (output == BT_MESH_BLINK || output == BT_MESH_BEEP || output == BT_MESH_VIBRATE || - input == BT_MESH_PUSH || input == BT_MESH_TWIST) { - /* According to MshPRTv1.1: 5.4.2.4, blink, beep vibrate, push and twist should be - * a random integer between 0 and 10^size, *exclusive*: - */ - num = (num % (divider[size - 1] - 1)) + 1; - } else { - num %= divider[size - 1]; + if (carry > 0 && len < MAX_NUMERIC_OOB_BYTES) { + out[len] = carry; + len++; + } } - sys_put_be32(num, &bt_mesh_prov_link.auth[auth_size - sizeof(num)]); - memset(bt_mesh_prov_link.auth, 0, auth_size - sizeof(num)); + /* Subtract 1 from the result (10^n - 1) */ + size_t j = 0; + + while (j < len) { + if (out[j] > 0) { + out[j] -= 1; + break; + } + out[j] = 0xFF; + j++; + } + + /* Adjust length if highest byte becomes 0 */ + while (len > 1 && out[len - 1] == 0) { + len--; + } + + *out_len = len; +} + +static void random_byte_shift(uint8_t max_inclusive, uint8_t *out) +{ + if (max_inclusive == 0) { + *out = 0; + return; + } - return num; + while (*out > max_inclusive) { + *out >>= 1; + } } -int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8_t size) +static void generate_random_below_pow10(uint8_t n, uint8_t *output, size_t *out_len) +{ + uint8_t max_val[MAX_NUMERIC_OOB_BYTES] = {0}; + size_t max_len = 0; + + compute_pow10_minus1(n, max_val, &max_len); + bt_rand(output, max_len); + + /* Generate random number less than max_val, starting from MSB in little-endian */ + for (int i = max_len - 1; i >= 0; --i) { + random_byte_shift(max_val[i], &output[i]); + if (output[i] < max_val[i]) { + break; + } + } + + /* Ensure the result is not all zero */ + int all_zero = 1; + + for (size_t i = 0; i < max_len; ++i) { + if (output[i] != 0) { + all_zero = 0; + break; + } + } + + if (all_zero) { + output[0] = 1; + } + + *out_len = max_len; +} + +static void get_auth_number(uint8_t *rand_bytes, size_t *size) +{ + uint8_t auth_size = bt_mesh_prov_auth_size_get(); + + generate_random_below_pow10(*size, rand_bytes, size); + sys_memcpy_swap(bt_mesh_prov_link.auth + (auth_size - *size), rand_bytes, *size); + memset(bt_mesh_prov_link.auth, 0, auth_size - *size); +} + +int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, size_t size) { bt_mesh_output_action_t output; bt_mesh_input_action_t input; + uint8_t rand_bytes[PROV_IO_OOB_SIZE_MAX + 1] = {0}; uint8_t auth_size = bt_mesh_prov_auth_size_get(); int err; @@ -214,18 +281,22 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 return bt_mesh_prov->input(input, size); } + atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); if (output == BT_MESH_DISPLAY_STRING) { - char str[9]; - - atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); - get_auth_string(str, size); - return bt_mesh_prov->output_string(str); + get_auth_string(rand_bytes, MIN(size, auth_size)); + return bt_mesh_prov->output_string(rand_bytes); } - atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); - return bt_mesh_prov->output_number(output, - get_auth_number(output, BT_MESH_NO_INPUT, size)); + get_auth_number(rand_bytes, &size); +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY + uint32_t output_num; + + memcpy(&output_num, rand_bytes, sizeof(output_num)); + return bt_mesh_prov->output_number(output, output_num); +#else + return bt_mesh_prov->output_numeric(output, rand_bytes, size); +#endif case AUTH_METHOD_INPUT: input = input_action(action); @@ -244,24 +315,30 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 return bt_mesh_prov->input(input, size); } - if (input == BT_MESH_ENTER_STRING) { - char str[9]; + atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); - atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); - get_auth_string(str, size); - return bt_mesh_prov->output_string(str); + if (input == BT_MESH_ENTER_STRING) { + get_auth_string(rand_bytes, MIN(size, auth_size)); + return bt_mesh_prov->output_string(rand_bytes); } - atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); + get_auth_number(rand_bytes, &size); output = BT_MESH_DISPLAY_NUMBER; - return bt_mesh_prov->output_number(output, - get_auth_number(BT_MESH_NO_OUTPUT, input, size)); +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY + uint32_t input_num; + + memcpy(&input_num, rand_bytes, sizeof(input_num)); + return bt_mesh_prov->output_number(output, input_num); +#else + return bt_mesh_prov->output_numeric(output, rand_bytes, size); +#endif default: return -EINVAL; } } +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY int bt_mesh_input_number(uint32_t num) { uint8_t auth_size = bt_mesh_prov_auth_size_get(); @@ -278,13 +355,37 @@ int bt_mesh_input_number(uint32_t num) return 0; } +#endif + +int bt_mesh_input_numeric(uint8_t *numeric, size_t size) +{ + uint8_t auth_size = bt_mesh_prov_auth_size_get(); + + LOG_HEXDUMP_DBG(numeric, size, ""); + + if (size > MAX_NUMERIC_OOB_BYTES) { + return -ENOTSUP; + } + + if (!atomic_test_and_clear_bit(bt_mesh_prov_link.flags, WAIT_NUMBER)) { + return -EINVAL; + } + + sys_memcpy_swap(bt_mesh_prov_link.auth + (auth_size - size), numeric, size); + memset(bt_mesh_prov_link.auth, 0, auth_size - size); + + bt_mesh_prov_link.role->input_complete(); + + return 0; +} int bt_mesh_input_string(const char *str) { + size_t size = strlen(str); + LOG_DBG("%s", str); - if (strlen(str) > PROV_IO_OOB_SIZE_MAX || - strlen(str) > bt_mesh_prov_link.oob_size) { + if (size > PROV_IO_OOB_SIZE_MAX || size > bt_mesh_prov_link.oob_size) { return -ENOTSUP; } @@ -292,7 +393,7 @@ int bt_mesh_input_string(const char *str) return -EINVAL; } - memcpy(bt_mesh_prov_link.auth, str, strlen(str)); + memcpy(bt_mesh_prov_link.auth, str, size); memset(bt_mesh_prov_link.auth + size, 0, sizeof(bt_mesh_prov_link.auth) - size); bt_mesh_prov_link.role->input_complete(); diff --git a/subsys/bluetooth/mesh/prov.h b/subsys/bluetooth/mesh/prov.h index c21ec395090c..499b1ca60359 100644 --- a/subsys/bluetooth/mesh/prov.h +++ b/subsys/bluetooth/mesh/prov.h @@ -68,7 +68,11 @@ #define PROV_ALG_P256 0x00 +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY #define PROV_IO_OOB_SIZE_MAX 8 /* in bytes */ +#else +#define PROV_IO_OOB_SIZE_MAX 32 /* in bytes */ +#endif #define PRIV_KEY_SIZE 32 #define PUB_KEY_SIZE PDU_LEN_PUB_KEY @@ -186,7 +190,7 @@ int bt_mesh_prov_reset_state(void); bool bt_mesh_prov_active(void); -int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8_t size); +int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, size_t size); int bt_mesh_pb_remote_open(struct bt_mesh_rpr_cli *cli, const struct bt_mesh_rpr_node *srv, const uint8_t uuid[16], diff --git a/subsys/bluetooth/mesh/provisioner.c b/subsys/bluetooth/mesh/provisioner.c index 28372caf4554..efc480b74ef3 100644 --- a/subsys/bluetooth/mesh/provisioner.c +++ b/subsys/bluetooth/mesh/provisioner.c @@ -172,8 +172,12 @@ static bool prov_check_method(struct bt_mesh_dev_capabilities *caps) return false; } } else { +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY if (!bt_mesh_prov->output_number) { - LOG_WRN("Not support output number"); +#else + if (!bt_mesh_prov->output_numeric) { +#endif + LOG_WRN("Not support output numeric"); return false; } } diff --git a/subsys/bluetooth/mesh/shell/shell.c b/subsys/bluetooth/mesh/shell/shell.c index 5475cc5d49b4..10138b164ad7 100644 --- a/subsys/bluetooth/mesh/shell/shell.c +++ b/subsys/bluetooth/mesh/shell/shell.c @@ -25,6 +25,7 @@ #include "mesh/foundation.h" #include "mesh/settings.h" #include "mesh/access.h" +#include "mesh/prov.h" #include "common/bt_shell_private.h" #include "utils.h" #include "dfu.h" @@ -399,18 +400,59 @@ static int cmd_proxy_solicit(const struct shell *sh, size_t argc, #endif /* CONFIG_BT_MESH_SHELL_GATT_PROXY */ #if defined(CONFIG_BT_MESH_SHELL_PROV) +static int ascii_decimal_to_le_bytes(const char *ascii_str, uint8_t *out, size_t *out_len) +{ + size_t len = 0; + + for (const char *p = ascii_str; *p; ++p) { + if (!isdigit((unsigned char)*p)) { + return -EINVAL; /* Invalid character */ + } + + uint16_t carry = *p - '0'; + + /* If this is the first digit and it's 0, we need at least one byte */ + if (len == 0) { + out[0] = carry; + len = 1; + continue; + } + + /* Multiply current result by 10 and add new digit */ + for (size_t i = 0; i < len; ++i) { + uint16_t value = out[i] * 10 + carry; + + out[i] = value & 0xFF; + carry = value >> 8; + } + + /* Handle overflow to next byte */ + if (carry != 0) { + if (len >= PROV_IO_OOB_SIZE_MAX) { + return -EOVERFLOW; /* Overflow */ + } + out[len++] = carry; + } + } + + *out_len = len; + return 0; +} + static int cmd_input_num(const struct shell *sh, size_t argc, char *argv[]) { int err = 0; - uint32_t val; + uint8_t result[PROV_IO_OOB_SIZE_MAX] = {0}; + size_t result_len; - val = shell_strtoul(argv[1], 10, &err); + err = ascii_decimal_to_le_bytes(argv[1], result, &result_len); if (err) { - shell_warn(sh, "Unable to parse input string argument"); + shell_warn(sh, err == -EINVAL ? "The input string symbol is not a digit" + : "Overflow in input string argument"); return err; } - err = bt_mesh_input_number(val); + err = bt_mesh_input_numeric(result, result_len); if (err) { shell_error(sh, "Numeric input failed (err %d)", err); } @@ -523,30 +565,76 @@ static void prov_reset(void) bt_shell_print("The local node has been reset and needs reprovisioning"); } -static int output_number(bt_mesh_output_action_t action, uint32_t number) +static void binary_to_ascii_digits(const uint8_t *in, size_t in_len, char *out_str) { + uint8_t temp[PROV_IO_OOB_SIZE_MAX]; + size_t digit_count = 0; + + __ASSERT(in_len <= sizeof(temp), "Output numeric exceeds maximum"); + memcpy(temp, in, in_len); + + while (in_len > 0) { + uint16_t remainder = 0; + + /* Divide the number in `temp` by 10, store quotient back in `temp` */ + for (ssize_t i = in_len - 1; i >= 0; --i) { + uint16_t acc = ((uint16_t)remainder << 8) | temp[i]; + + temp[i] = acc / 10; + remainder = acc % 10; + } + + /* Store ASCII digit */ + out_str[digit_count++] = '0' + remainder; + + /* Trim leading zeros */ + while (in_len > 0 && temp[in_len - 1] == 0) { + in_len--; + } + } + + /* Digits are in reverse order, reverse them to get correct string */ + sys_mem_swap(out_str, digit_count); + + /* Null-terminate the string */ + out_str[digit_count] = '\0'; +} + +static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t len) +{ + char oob_string[PROV_IO_OOB_SIZE_MAX + 1]; + + binary_to_ascii_digits(numeric, len, oob_string); + switch (action) { case BT_MESH_BLINK: - bt_shell_print("OOB blink Number: %u", number); + bt_shell_print("OOB blink Number: %s", oob_string); break; case BT_MESH_BEEP: - bt_shell_print("OOB beep Number: %u", number); + bt_shell_print("OOB beep Number: %s", oob_string); break; case BT_MESH_VIBRATE: - bt_shell_print("OOB vibrate Number: %u", number); + bt_shell_print("OOB vibrate Number: %s", oob_string); break; case BT_MESH_DISPLAY_NUMBER: - bt_shell_print("OOB display Number: %u", number); + bt_shell_print("OOB display Number: %s", oob_string); break; default: - bt_shell_error("Unknown Output action %u (number %u) requested!", - action, number); + bt_shell_error("Unknown Output action %u (number %s) requested!", action, + oob_string); return -EINVAL; } return 0; } +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY +static int output_number(bt_mesh_output_action_t action, uint32_t number) +{ + return output_numeric(action, (uint8_t *)&number, sizeof(number)); +} +#endif + static int output_string(const char *str) { bt_shell_print("OOB String: %s", str); @@ -602,7 +690,11 @@ struct bt_mesh_prov bt_mesh_shell_prov = { .output_size = 6, .output_actions = (BT_MESH_BLINK | BT_MESH_BEEP | BT_MESH_VIBRATE | BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING), +#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY .output_number = output_number, +#else + .output_numeric = output_numeric, +#endif .output_string = output_string, .input_size = 6, .input_actions = diff --git a/tests/bluetooth/tester/src/btp_mesh.c b/tests/bluetooth/tester/src/btp_mesh.c index 3a84e8226197..26ab447c8269 100644 --- a/tests/bluetooth/tester/src/btp_mesh.c +++ b/tests/bluetooth/tester/src/btp_mesh.c @@ -1175,9 +1175,17 @@ static void link_close(bt_mesh_prov_bearer_t bearer) tester_event(BTP_SERVICE_ID_MESH, BTP_MESH_EV_PROV_LINK_CLOSED, &ev, sizeof(ev)); } -static int output_number(bt_mesh_output_action_t action, uint32_t number) +static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size) { struct btp_mesh_out_number_action_ev ev; + uint32_t number; + + if (size > sizeof(number)) { + LOG_ERR("Unsupported size %zu", size); + return -EINVAL; + } + + number = sys_get_le32(numeric); LOG_DBG("action 0x%04x number 0x%08x", action, number); @@ -1297,7 +1305,7 @@ static struct bt_mesh_prov prov = { .uuid = dev_uuid, .static_val = static_auth, .static_val_len = sizeof(static_auth), - .output_number = output_number, + .output_numeric = output_numeric, .output_string = output_string, .input = input, .link_open = link_open, @@ -1505,7 +1513,7 @@ static uint8_t input_number(const void *cmd, uint16_t cmd_len, LOG_DBG("number 0x%04x", number); - err = bt_mesh_input_number(number); + err = bt_mesh_input_numeric((uint8_t *)&cp->number, sizeof(cp->number)); if (err) { return BTP_STATUS_FAILED; } diff --git a/tests/bsim/bluetooth/mesh/src/test_provision.c b/tests/bsim/bluetooth/mesh/src/test_provision.c index 321d168914fd..a93add213907 100644 --- a/tests/bsim/bluetooth/mesh/src/test_provision.c +++ b/tests/bsim/bluetooth/mesh/src/test_provision.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Lingao Meng + * Copyright (c) 2025 Nordic Semiconductor * * SPDX-License-Identifier: Apache-2.0 */ @@ -9,12 +10,11 @@ #include "mesh/access.h" #include "mesh/net.h" #include "mesh/crypto.h" +#include "mesh/prov.h" #include "argparse.h" #include #include -#include - #include #define LOG_MODULE_NAME mesh_prov @@ -65,15 +65,19 @@ static struct oob_auth_test_vector_s { {static_key1, sizeof(static_key1), 0, 0, 0, 0}, {static_key2, sizeof(static_key2), 0, 0, 0, 0}, {static_key3, sizeof(static_key3), 0, 0, 0, 0}, - {NULL, 0, 3, BT_MESH_BLINK, 0, 0}, + {NULL, 0, 1, BT_MESH_BLINK, 0, 0}, {NULL, 0, 5, BT_MESH_BEEP, 0, 0}, - {NULL, 0, 6, BT_MESH_VIBRATE, 0, 0}, - {NULL, 0, 7, BT_MESH_DISPLAY_NUMBER, 0, 0}, - {NULL, 0, 8, BT_MESH_DISPLAY_STRING, 0, 0}, - {NULL, 0, 0, 0, 4, BT_MESH_PUSH}, + {NULL, 0, 8, BT_MESH_VIBRATE, 0, 0}, + {NULL, 0, 15, BT_MESH_DISPLAY_NUMBER, 0, 0}, + {NULL, 0, 19, BT_MESH_DISPLAY_STRING, 0, 0}, + {NULL, 0, 32, BT_MESH_DISPLAY_NUMBER, 0, 0}, + {NULL, 0, 32, BT_MESH_DISPLAY_STRING, 0, 0}, + {NULL, 0, 0, 0, 1, BT_MESH_PUSH}, {NULL, 0, 0, 0, 5, BT_MESH_TWIST}, - {NULL, 0, 0, 0, 8, BT_MESH_ENTER_NUMBER}, - {NULL, 0, 0, 0, 7, BT_MESH_ENTER_STRING}, + {NULL, 0, 0, 0, 13, BT_MESH_ENTER_NUMBER}, + {NULL, 0, 0, 0, 27, BT_MESH_ENTER_STRING}, + {NULL, 0, 0, 0, 32, BT_MESH_ENTER_NUMBER}, + {NULL, 0, 0, 0, 32, BT_MESH_ENTER_STRING}, }; static ATOMIC_DEFINE(test_flags, TEST_FLAGS); @@ -414,25 +418,23 @@ static int input(bt_mesh_input_action_t act, uint8_t size) static void delayed_input(struct k_work *work) { - char oob_str[16]; - uint32_t oob_number; + uint8_t oob_data[PROV_IO_OOB_SIZE_MAX + 1] = {0}; int size = bs_bc_is_msg_received(*oob_channel_id); - if (size <= 0) { - FAIL("OOB data is not gotten"); - } + ASSERT_TRUE_MSG(size > 0, "OOB data is not gotten"); + ASSERT_TRUE_MSG(size <= PROV_IO_OOB_SIZE_MAX, "OOB data size %d exceeds max %d", + size, PROV_IO_OOB_SIZE_MAX); + + bs_bc_receive_msg(*oob_channel_id, oob_data, size); switch (gact) { case BT_MESH_PUSH: case BT_MESH_TWIST: case BT_MESH_ENTER_NUMBER: - ASSERT_TRUE(size == sizeof(uint32_t)); - bs_bc_receive_msg(*oob_channel_id, (uint8_t *)&oob_number, size); - ASSERT_OK(bt_mesh_input_number(oob_number)); + ASSERT_OK(bt_mesh_input_numeric(oob_data, size)); break; case BT_MESH_ENTER_STRING: - bs_bc_receive_msg(*oob_channel_id, (uint8_t *)oob_str, size); - ASSERT_OK(bt_mesh_input_string(oob_str)); + ASSERT_OK(bt_mesh_input_string((const char *)oob_data)); break; default: FAIL("Unknown input action %u (size %u) requested!", gact, gsize); @@ -444,7 +446,7 @@ static void prov_input_complete(void) LOG_INF("Input OOB data completed"); } -static int output_number(bt_mesh_output_action_t action, uint32_t number); +static int output_numeric(bt_mesh_output_action_t act, uint8_t *numeric, size_t size); static int output_string(const char *str); static void capabilities(const struct bt_mesh_dev_capabilities *cap); static struct bt_mesh_prov prov = { @@ -456,7 +458,7 @@ static struct bt_mesh_prov prov = { .link_close = prov_link_close, .reprovisioned = prov_reprovisioned, .node_added = prov_node_added, - .output_number = output_number, + .output_numeric = output_numeric, .output_string = output_string, .input = input, .input_complete = prov_input_complete, @@ -464,11 +466,48 @@ static struct bt_mesh_prov prov = { .reset = prov_reset, }; -static int output_number(bt_mesh_output_action_t action, uint32_t number) +static void binary_to_ascii_digits(const uint8_t *in, size_t in_len, char *out_str) +{ + uint8_t temp[PROV_IO_OOB_SIZE_MAX]; + size_t digit_count = 0; + + memcpy(temp, in, in_len); + + while (in_len > 0) { + uint16_t remainder = 0; + + /* Divide the number in `temp` by 10, store quotient back in `temp` */ + for (ssize_t i = in_len - 1; i >= 0; --i) { + uint16_t acc = ((uint16_t)remainder << 8) | temp[i]; + + temp[i] = acc / 10; + remainder = acc % 10; + } + + /* Store ASCII digit */ + out_str[digit_count++] = '0' + remainder; + + /* Trim leading zeros */ + while (in_len > 0 && temp[in_len - 1] == 0) { + in_len--; + } + } + + /* Digits are in reverse order, reverse them to get correct string */ + sys_mem_swap(out_str, digit_count); + + /* Null-terminate the string */ + out_str[digit_count] = '\0'; +} + +static int output_numeric(bt_mesh_output_action_t act, uint8_t *numeric, size_t size) { - LOG_INF("OOB Number: %u", number); + uint8_t numeric_ascii[PROV_IO_OOB_SIZE_MAX + 1]; + + binary_to_ascii_digits(numeric, size, numeric_ascii); + LOG_INF("OOB Number: %s", numeric_ascii); - bs_bc_send_msg(*oob_channel_id, (uint8_t *)&number, sizeof(uint32_t)); + bs_bc_send_msg(*oob_channel_id, numeric, size); return 0; } @@ -476,7 +515,7 @@ static int output_string(const char *str) { LOG_INF("OOB String: %s", str); - bs_bc_send_msg(*oob_channel_id, (uint8_t *)str, strlen(str) + 1); + bs_bc_send_msg(*oob_channel_id, (uint8_t *)str, strlen(str)); return 0; } From 0c00b1800accb3538c3fa7b8787044af9620c54f Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 26 Jan 2021 15:43:08 +0100 Subject: [PATCH 0403/3334] [nrf noup] ci: set `ZEPHYR__KCONFIG` for NCS modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit sets `ZEPHYR__KCONFIG` variable for each Kconfig file discovered in `nrf/modules//Kconfig`. This is not meant as a permanent solution; we should do more careful consideration on the optimal approach forward that will allow compliance_check.py to be used downstream with custom module_ext_roots, and at the same time keep current flexibility for module glue code handling intact. Adds a static path for the NRF Kconfig variable in the check compliance script, this is a temporary workaround due to supporting an external root for NCS that should be reworked to use package helper in future Signed-off-by: Torsten Rasmussen Signed-off-by: Martí Bolívar Signed-off-by: Carles Cufi Signed-off-by: Jamie McCrae (cherry picked from commit 514c3b8a5a8287554c46f1f70da993cab537f5f3) --- scripts/ci/check_compliance.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 64e0d8764fcb..842c0850447e 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -542,6 +542,13 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] + nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') + nrf_modules = [] + if os.path.exists(nrf_modules_dir): + nrf_modules = [name for name in os.listdir(nrf_modules_dir) if + os.path.exists(os.path.join(nrf_modules_dir, name, + 'Kconfig'))] + with open(modules_file, 'r') as fp_module_file: content = fp_module_file.read() @@ -551,8 +558,31 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se re.sub('[^a-zA-Z0-9]', '_', module).upper(), modules_dir / module / 'Kconfig' )) + for module in nrf_modules: + fp_module_file.write("ZEPHYR_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + nrf_modules_dir / module / 'Kconfig' + )) + fp_module_file.write("NCS_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + modules_dir / module / 'Kconfig' + )) + # Add NRF as static entry as workaround for ext Kconfig root support + fp_module_file.write("ZEPHYR_NRF_KCONFIG = {}\n".format( + nrf_modules_dir / '..' / 'Kconfig.nrf' + )) fp_module_file.write(content) + with open(sysbuild_modules_file, 'r') as fp_sysbuild_module_file: + content = fp_sysbuild_module_file.read() + + with open(sysbuild_modules_file, 'w') as fp_sysbuild_module_file: + # Add NRF as static entry as workaround for ext Kconfig root support + fp_sysbuild_module_file.write("SYSBUILD_NRF_KCONFIG = {}\n".format( + nrf_modules_dir / '..' / 'sysbuild' / 'Kconfig.sysbuild' + )) + fp_sysbuild_module_file.write(content) + def get_kconfig_dts(self, kconfig_dts_file, settings_file): """ Generate the Kconfig.dts using dts/bindings as the source. From 5a9b99de0317d7f59acb74c988e6a47ed86b815c Mon Sep 17 00:00:00 2001 From: Piotr Golyzniak Date: Mon, 1 Aug 2022 13:06:01 +0200 Subject: [PATCH 0404/3334] [nrf noup] ci: scripts: add quarantine file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add scripts/quarantine.yaml file, which will be used in CI. Signed-off-by: Piotr Golyzniak Signed-off-by: Andrzej Głąbek Signed-off-by: Maciej Perkowski Signed-off-by: Robert Lubos (cherry picked from commit b9f67325a5fe3794f1eadba95063b958496fc457) --- scripts/quarantine.yaml | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 scripts/quarantine.yaml diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml new file mode 100644 index 000000000000..20c4f9248ea9 --- /dev/null +++ b/scripts/quarantine.yaml @@ -0,0 +1,88 @@ +# The configurations resulting as a product of scenarios and platforms +# will be skipped if quarantine is used. More details here: +# https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine + +- scenarios: + - testing.ztest.busy_sim + - testing.ztest.busy_sim_nrf52840dk_pin + platforms: + - nrf52840dk_nrf52840 + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.unary_f64 + platforms: + - nrf5340dk_nrf5340_cpunet + - qemu_cortex_m3 + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_f16 + - libraries.cmsis_dsp.matrix.binary_f16.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_q15 + - libraries.cmsis_dsp.matrix.binary_q15.fpu + - libraries.cmsis_dsp.matrix.unary_f32 + - libraries.cmsis_dsp.matrix.unary_f32.fpu + - libraries.cmsis_dsp.matrix.unary_f64 + - libraries.cmsis_dsp.matrix.unary_f64.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Flash overflows" + +# libsdl2-dev package should be added into docker image +- scenarios: + - sample.boards.nrf.nrf_led_matrix + - sample.display.lvgl.gui + platforms: + - native_posix + comment: "libsdl2-dev package not available" + +- scenarios: + - sample.net.sockets.echo_server.usbnet + - sample.net.sockets.echo_server.usbnet_composite + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - sample.net.zperf.netusb_ecm + - sample.net.zperf.netusb_eem + - sample.net.zperf.netusb_rndis + platforms: + - nrf52833dk_nrf52833 + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - net.mqtt.tls + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - kernel.common.picolibc + - libraries.picolibc + - libraries.libc.picolibc.mem_alloc + - libraries.picolibc.sprintf_new + platforms: + - nrf52dk_nrf52832 + comment: "Ram overflows, also in the upstream" + +- scenarios: + - sample.psa_crypto + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Due to using sdk-zephyr manifest instead of nrf. Should be fixed after the change" From 2572bde23c16a9dd0eede529c6e24226d8930d9f Mon Sep 17 00:00:00 2001 From: Sebastian Wezel Date: Tue, 15 Mar 2022 13:12:25 +0100 Subject: [PATCH 0405/3334] [nrf noup] ci: add .github/test-spec.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file is used for NCS-specific testing configuration based on modifications to files in this repository. Signed-off-by: Alperen Sener Signed-off-by: Elisabeth Solheim Klakken Signed-off-by: Mariusz Poslinski Signed-off-by: Markus Swarowsky Signed-off-by: Robert Lubos Signed-off-by: Sebastian Wezel Signed-off-by: Tomasz Tyzenhauz Signed-off-by: Fredrik Ås Signed-off-by: Michał Szablowski Signed-off-by: Tony Le Signed-off-by: Krishna T Signed-off-by: Dawid Przybylo Signed-off-by: Rubin Gerritsen Signed-off-by: Jørgen Kvalvaag Signed-off-by: Magne Værnes Signed-off-by: Lang Xie Signed-off-by: Alexander Svensen Signed-off-by: Jan Gałda Signed-off-by: Vladislav Litvinov Signed-off-by: Guojun Wang Signed-off-by: Piotr Kosycarz Signed-off-by: Thomas Stilwell Signed-off-by: Krzysztof Szromek Signed-off-by: Grzegorz Chwierut Signed-off-by: Eduardo Montoya Signed-off-by: Pavel Vasilyev (cherry picked from commit 2984211aa6c8eeeeb42fb72b71f2e68f698c83d3) --- .github/test-spec.yml | 392 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 .github/test-spec.yml diff --git a/.github/test-spec.yml b/.github/test-spec.yml new file mode 100644 index 000000000000..6da6bdbaa87d --- /dev/null +++ b/.github/test-spec.yml @@ -0,0 +1,392 @@ +# This is the Jenkins ci variant of the .github/labler.yaml + +"CI-run-zephyr-twister": + - any: + - "!.github/**/*" + - "!doc/**/*" + - "!CODEOWNERS" + - "!LICENSE" + - "!**/*.rst" + - "!VERSION" + - "!submanifests/**/*" + - "!MAINTAINERS.yml" + - "!version.h.in" + - "!Jenkinsfile" + - "!**/*.md" + +"CI-iot-zephyr-lwm2m-test": + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "subsys/dfu/boot/**/*" + - "subsys/net/ip/**/*" + - "subsys/net/lib/http/**/*" + - "subsys/net/lib/lwm2m//**/*" + - "subsys/net/**/*" + +"CI-iot-samples-test": + - "boards/nordic/nrf9160dk/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/**/*" + - "subsys/net/lib/**/*" + +"CI-iot-libraries-test": + - "boards/nordic/nrf9160dk/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/socket_ncs.h" + - "subsys/testsuite/ztest/**/*" + +"CI-lwm2m-test": null +# Not necessary to run tests on changes to this repo. + +"CI-boot-test": + - "subsys/mgmt/mcumgr/**/*" + - "subsys/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/dfu/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "tests/boot/**/*" + - "tests/subsys/dfu/**/*" + - "tests/subsys/mgmt/mcumgr/**/*" + +"CI-tfm-test": + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf9160dk/**/*" + - "drivers/entropy/*" + - "dts/arm/nordic/nrf5340*" + - "dts/arm/nordic/nrf9160*" + - "modules/trusted-firmware-m/**/*" + - "samples/tfm_integration/**/*" + +"CI-ble-test": + - any: + - "drivers/bluetooth/**/*" + - any: + - "dts/arm/nordic/nrf5*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + - any: + - "include/zephyr/bluetooth/**/*" + - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/hci_ipc/**/*" + +"CI-ble-samples-test": + - any: + - "drivers/bluetooth/**/*" + - any: + - "dts/arm/nordic/nrf5*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + - any: + - "include/zephyr/bluetooth/**/*" + - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/**/*" + +"CI-mesh-test": + - "subsys/bluetooth/mesh/**/*" + - "include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh_demo/**/*" + - "samples/bluetooth/mesh_provisioner/**/*" + - "tests/bluetooth/mesh/**/*" + - "tests/bluetooth/mesh_shell/**/*" + +"CI-thingy91-test": + - "boards/nordic/nrf9160dk/**/*" + - "arch/x86/core/**/*" + - "arch/x86/include/**/*" + - "drivers/console/**/*" + - "drivers/ethernet/**/*" + - "drivers/flash/**/*" + - "drivers/hwinfo/**/*" + - "drivers/interrupt_controller/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/timer/**/*" + - "include/**/*" + - "kernel/**/*" + - "lib/libc/common/source/stdlib/**/*" + - "lib/libc/newlib/**/*" + - "lib/libc/picolibc/**/*" + - "lib/os/**/*" + - "lib/posix/**/*" + - "misc/**/*" + - "modules/mbedtls/**/*" + - "soc/x86/ia32/**/*" + - "subsys/fs/fcb/**/*" + - "subsys/logging/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/include/**/*" + - "subsys/settings/src/**/*" + - "subsys/stats/**/*" + - "subsys/storage/flash_map/**/*" + - "subsys/storage/stream/**/*" + - "subsys/tracing/**/*" + +"CI-desktop-test": + - "drivers/bluetooth/*" + - "subsys/bluetooth/*" + - "include/zephyr/bluetooth/*" + +"CI-crypto-test": + - "boards/nordic/nrf52840dk/**/*" + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf9160dk/**/*" + - "drivers/entropy/*" + - "drivers/serial/**/*" + - "dts/arm/nordic/nrf52840*" + - "dts/arm/nordic/nrf5340*" + - "dts/arm/nordic/nrf9160*" + - "include/drivers/serial/**/*" + - "modules/mbedtls/**/*" + +"CI-fem-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "dts/bindings/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/arch/**/*" + - "lib/libc/**/*" + - "lib/open-amp/**/*" + - "modules/hal_nordic/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "modules/trusted-firmware-m/**/*" + - "samples/net/sockets/echo_*/**/*" + - "share/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + - "subsys/bluetooth/shell/**/*" + - "subsys/ipc/**/*" + - "Kconfig" + - "CMakeLists.txt" + +"CI-rs-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "dts/bindings/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/arch/**/*" + - "lib/libc/**/*" + - "lib/open-amp/**/*" + - "modules/hal_nordic/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "modules/trusted-firmware-m/**/*" + - "samples/net/sockets/echo_*/**/*" + - "share/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + - "subsys/bluetooth/shell/**/*" + - "subsys/ipc/**/*" + - "Kconfig" + - "CMakeLists.txt" + +"CI-thread-test": + - "include/zephyr/net/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "samples/net/openthread/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-nfc-test": + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "drivers/flash/**/*" + - "drivers/mbox/**/*" + - "drivers/spi/**/*" + - "lib/crc/**/*" + - "modules/hal_nordic/**/*" + - "soc/nordic/**/*" + - "subsys/ipc/ipc_service/**/*" + - "subsys/fs/**/*" + - "subsys/mem_mgmt/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/**/*" + - "subsys/shell/**/*" + - "subsys/storage/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-matter-test": + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/settings/**/*" + - "subsys/net/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "drivers/net/**/*" + - "samples/bluetooth/hci_ipc/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + +"CI-find-my-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/**/*" + - "drivers/entropy/**/*" + - "drivers/flash/**/*" + - "drivers/usb/**/*" + - "drivers/regulator/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/fs/**/*" + - "subsys/ipc/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/**/*" + - "subsys/storage/**/*" + - "subsys/tracing/**/*" + - "subsys/usb/device/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-rpc-test": + - "subsys/ipc/ipc_service/**/*" + - "subsys/random/**/*" + - "soc/nordic/nrf53/**/*" + +"CI-modemshell-test": + - "include/net/**/*" + - "include/posix/**/*" + - "include/shell/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "subsys/shell/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-positioning-test": + - "include/net/**/*" + - "include/posix/**/*" + - "drivers/net/**/*" + - "drivers/wifi/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-cloud-test": + - "include/zephyr/dfu/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/posix/**/*" + - "include/zephyr/settings/**/*" + - "drivers/led/**/*" + - "drivers/net/**/*" + - "drivers/sensor/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "lib/posix/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-wifi": + - "subsys/net/l2/wifi/**/*" + - "subsys/net/l2/ethernet/**/*" + +"CI-audio-test": + - "boards/nordic/nrf5340_audio_dk/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/gpio/**/*" + - "drivers/i2c/**/*" + - "drivers/watchdog/**/*" + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/bluetooth/hci_ipc/**/*" + - "soc/nordic/**/*" + - "subsys/bluetooth/audio/**/*" + - "subsys/bluetooth/host/**/*" + - "subsys/dfu/**/*" + - "subsys/fs/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "subsys/sd/**/*" + - "subsys/storage/**/*" + - "subsys/task_wdt/**/*" + - "subsys/usb/**/*" + - "subsys/zbus/**/*" + +"CI-pmic-samples-test": + - "samples/shields/npm1300_ek/**/*" + - "boards/shields/npm1300_ek/**/*" + - "**/**npm1300**/**" + - "drivers/regulator/regulator_common.c" + - "drivers/regulator/regulator_shell.c" + - "drivers/gpio/gpio_shell.c" + - "drivers/sensor/sensor_shell.c" + +"CI-test-low-level": + - "arch/**/*" + - "boards/nordic/nrf54*/**/*" + - "drivers/**/*" + - "dts/**/*" + - "include/zephyr/**/*" + - "kernel/**/*" + - "modules/hal_nordic/**/*" + - "samples/basic/blinky_pwm/**/*" + - "samples/basic/fade_led/**/*" + - "samples/boards/nrf/**/*" + - "samples/boards/nordic/**/*" + - "samples/drivers/adc/**/*" + - "samples/drivers/jesd216/**/*" + - "samples/drivers/mbox/**/*" + - "samples/drivers/soc_flash_nrf/**/*" + - "samples/drivers/spi_flash/**/*" + - "samples/drivers/watchdog/**/*" + - "samples/hello_world/**/*" + - "samples/sensor/**/*" + - "samples/subsys/ipc/**/*" + - "samples/subsys/logging/**/*" + - "samples/subsys/settings/**/*" + - "samples/subsys/usb/cdc_acm/**/*" + - "samples/subsys/usb/mass/**/*" + - "samples/synchronization/**/*" + - "subsys/logging/**/*" + - "subsys/settings/**/*" + - "tests/arch/**/*" + - "tests/boards/nrf/**/*" + - "tests/boards/nordic/**/*" + - "tests/drivers/**/*" + - "tests/kernel/**/*" + +"CI-suit-dfu-test": + - "subsys/mgmt/mcumgr/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "subsys/bluetooth/**/*" + - "drivers/bluetooth/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/console/**/*" + - "drivers/gpio/**/*" + - "dts/common/nordic/*" + - "dts/arm/nordic/nrf54h*/**/*" + - "dts/riscv/nordic/nrf54h*/**/*" + - "boards/nordic/nrf54h*/**/*" + - "soc/nordic/nrf54h/**/*" + - "include/zephyr/**/*" + - "subsys/logging/**/*" + - "subsys/tracing/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/nrfutil.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" From e410638df3689a6362551472fbd776bf754af33f Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 1 Jun 2023 15:58:56 +0200 Subject: [PATCH 0406/3334] [nrf noup] tests: drivers: build_all: regulator: use old schema New Twister schema is not supported yet in sdk-zephyr, drop this patch once Twister is updated. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit aca4aa4300d651bb107897467b8d8f57f63efb39) --- tests/drivers/build_all/regulator/testcase.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/drivers/build_all/regulator/testcase.yaml b/tests/drivers/build_all/regulator/testcase.yaml index 30d494aca231..b662f0ac2050 100644 --- a/tests/drivers/build_all/regulator/testcase.yaml +++ b/tests/drivers/build_all/regulator/testcase.yaml @@ -3,9 +3,7 @@ tests: drivers.regulator.build: - tags: - - drivers - - regulator + tags: drivers regulator build_only: true platform_allow: - native_sim From 6fde6cdb57c8db387e3277d2dcd69c59ee576615 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 19 Jun 2023 12:19:05 +0200 Subject: [PATCH 0407/3334] [nrf noup] Revert "twister: Use natural sort when generating hardware map" This reverts commit c37deeb0c4602dc3eeb700a7dc3ed317283fff17. This is only a temporary change, until we align our CI. To be removed once natsort is avaialble in the NCS CI. Signed-off-by: Robert Lubos (cherry picked from commit ff472df6b01f3112348863cc54dbb7c806605b31) --- scripts/pylib/twister/twisterlib/hardwaremap.py | 2 +- scripts/requirements-run-test.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 74c384ab5d6e..6deca0ac4adf 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -386,7 +386,7 @@ def save(self, hwm_file): boot_ids = [] # use existing map - self.detected = natsorted(self.detected, key=lambda x: x.serial or '') + self.detected.sort(key=lambda x: x.serial or '') if os.path.exists(hwm_file): with open(hwm_file) as yaml_file: hwm = yaml.load(yaml_file, Loader=SafeLoader) diff --git a/scripts/requirements-run-test.txt b/scripts/requirements-run-test.txt index 6c3f3d93cf8d..4faa17b7b659 100644 --- a/scripts/requirements-run-test.txt +++ b/scripts/requirements-run-test.txt @@ -7,7 +7,6 @@ pyocd>=0.35.0 # used by twister for board/hardware map tabulate -natsort # used by mcuboot cbor>=1.0.0 From ae54dd0dd72cb3887de9542242c78eb8706848d5 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 3 Mar 2022 15:28:16 +0100 Subject: [PATCH 0408/3334] [nrf noup] doc: remove Kconfig search Kconfig search is handled in a separate docset in NCS, so remove the page. This is a long-term noup patch. Signed-off-by: Gerard Marull-Paretas Signed-off-by: Krishna T (cherry picked from commit 716c5e9b4a26bcd2b5fded110a94212188de75d0) --- MAINTAINERS.yml | 1 - doc/build/kconfig/setting.rst | 6 ++---- doc/develop/application/index.rst | 5 ++--- doc/kconfig.rst | 8 -------- 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 doc/kconfig.rst diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 0160330ac59f..aa0718740df8 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1147,7 +1147,6 @@ Documentation: - doc/images/Zephyr-Kite-in-tree.png - doc/index-tex.rst - doc/index.rst - - doc/kconfig.rst - doc/templates/sample.tmpl - doc/templates/board.tmpl - boards/index.rst diff --git a/doc/build/kconfig/setting.rst b/doc/build/kconfig/setting.rst index ad62d86eb3d4..6fe1feaed7d3 100644 --- a/doc/build/kconfig/setting.rst +++ b/doc/build/kconfig/setting.rst @@ -7,8 +7,7 @@ The :ref:`menuconfig and guiconfig interfaces ` can be used to test out configurations during application development. This page explains how to make settings permanent. -All Kconfig options can be searched in the :ref:`Kconfig search page -`. +All Kconfig options can be searched in the Kconfig search page. .. note:: @@ -115,8 +114,7 @@ Assignments in configuration files are only respected if the dependencies for the symbol are satisfied. A warning is printed otherwise. To figure out what the dependencies of a symbol are, use one of the :ref:`interactive configuration interfaces ` (you can jump directly to a symbol with -:kbd:`/`), or look up the symbol in the :ref:`Kconfig search page -`. +:kbd:`/`), or look up the symbol in the Kconfig search page. .. _initial-conf: diff --git a/doc/develop/application/index.rst b/doc/develop/application/index.rst index c28fa011f3cc..4f8b5f868a56 100644 --- a/doc/develop/application/index.rst +++ b/doc/develop/application/index.rst @@ -649,9 +649,8 @@ started. See :ref:`setting_configuration_values` for detailed documentation on setting Kconfig configuration values. The :ref:`initial-conf` section on the same page -explains how the initial configuration is derived. See :ref:`kconfig-search` -for a complete list of configuration options. -See :ref:`hardening` for security information related with Kconfig options. +explains how the initial configuration is derived. See :ref:`hardening` for +security information related with Kconfig options. The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration diff --git a/doc/kconfig.rst b/doc/kconfig.rst deleted file mode 100644 index 1123de2adbd9..000000000000 --- a/doc/kconfig.rst +++ /dev/null @@ -1,8 +0,0 @@ -:orphan: - -.. _kconfig-search: - -Kconfig Search -============== - -.. kconfig:search:: From 8dafdf6cf30f17668414d98af39a882cb5b36c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 13 Jan 2022 11:37:18 +0100 Subject: [PATCH 0409/3334] [nrf noup] modules: tf-m: use of PSA_HAS_XXXX_SUPPORT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This allows configurations enabled by PSA_WANTS_ALG_XXXX to be used to control which TF-M module is enabled -If the TF-M image doesn't support e.g. the MAC APIs, then the MAC interface is not enabled Note: This functionality requires that nrf_security is enabled ref: NCSDK-11689 Make TF-M crypto module depend on PSA_WANT_GENERATE_RANDOM, same as all other crypto modules, which have PSA_HAS to group all PSA features that require the module. This makes TF-M by default exclude the RNG module when not needed. Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Joakim Andersson (cherry picked from commit a0ff1f3329a75b9cb867a8d5326f85428f2775de) --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 1d70a2c44d29..02d3580c22f3 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -10,6 +10,7 @@ if TFM_PARTITION_CRYPTO config TFM_CRYPTO_RNG_MODULE_ENABLED bool "Random number generator crypto module" default y + depends on PSA_WANT_GENERATE_RANDOM && NRF_SECURITY help Enables the random number generator module within the crypto partition. Unset this option if 'psa_generate_random' is not used. @@ -17,6 +18,7 @@ config TFM_CRYPTO_RNG_MODULE_ENABLED config TFM_CRYPTO_KEY_MODULE_ENABLED bool "KEY crypto module" default y + depends on PSA_HAS_KEY_SUPPORT && NRF_SECURITY help Enables the KEY crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_management.c' @@ -25,6 +27,7 @@ config TFM_CRYPTO_KEY_MODULE_ENABLED config TFM_CRYPTO_AEAD_MODULE_ENABLED bool "AEAD crypto module" default y + depends on PSA_HAS_AEAD_SUPPORT && NRF_SECURITY help Enables the AEAD crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_aead.c' @@ -33,6 +36,7 @@ config TFM_CRYPTO_AEAD_MODULE_ENABLED config TFM_CRYPTO_MAC_MODULE_ENABLED bool "MAC crypto module" default y + depends on PSA_HAS_MAC_SUPPORT && NRF_SECURITY help Enables the MAC crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_mac.c' @@ -41,6 +45,7 @@ config TFM_CRYPTO_MAC_MODULE_ENABLED config TFM_CRYPTO_HASH_MODULE_ENABLED bool "HASH crypto module" default y + depends on PSA_HAS_HASH_SUPPORT && NRF_SECURITY help Enables the HASH crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_hash.c' @@ -49,6 +54,7 @@ config TFM_CRYPTO_HASH_MODULE_ENABLED config TFM_CRYPTO_CIPHER_MODULE_ENABLED bool "CIPHER crypto module" default y + depends on PSA_HAS_CIPHER_SUPPORT && NRF_SECURITY help Enables the CIPHER crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_cipher.c' @@ -57,6 +63,7 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED bool "ASYM ENCRYPT crypto module" default y + depends on PSA_HAS_ASYM_ENCRYPT_SUPPORT && NRF_SECURITY help Enables the ASYM ENCRYPT crypto module within the crypto partition. Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' @@ -65,6 +72,7 @@ config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED bool "ASYM SIGN crypto module" default y + depends on PSA_HAS_ASYM_SIGN_SUPPORT && NRF_SECURITY help Enables the ASYM SIGN crypto module within the crypto partition. Unset this option if the sign functionality provided by 'crypto_asymmetric.c' @@ -73,10 +81,12 @@ config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED bool "KEY DERIVATION crypto module" default y + depends on (PSA_HAS_KEY_DERIVATION || PSA_HAS_KEY_AGREEMENT) && NRF_SECURITY help Enables the KEY_DERIVATION crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_derivation.c' is not used. + Note that key agreement is under key derivation in the current implementation. endif # TFM_PARTITION_CRYPTO From 2416c4da0bcb676c42c42d68030a394a79ca1cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Sat, 29 Jan 2022 13:03:08 +0100 Subject: [PATCH 0410/3334] [nrf noup] modules: mbedtls: Allow MBEDTLS_BUILTIN to be deselected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Out-of-tree crypto subsystems need to deselect MBEDTLS_BUILTIN, but deselection is not supported. It is however supported to select a dependency in a ! expression. Signed-off-by: Sebastian Bøe (cherry picked from commit dc050eeef949980dad25776d5daeb670a0a80636) --- modules/mbedtls/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index bf165473f17f..f7bc6a609f1f 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -29,6 +29,7 @@ choice MBEDTLS_IMPLEMENTATION config MBEDTLS_BUILTIN bool "Use Zephyr in-tree mbedTLS version" + depends on ! DISABLE_MBEDTLS_BUILTIN help Link with mbedTLS sources included with Zephyr distribution. Included mbedTLS version is well integrated with and supported @@ -42,6 +43,11 @@ config MBEDTLS_LIBRARY endchoice +# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select +# DISABLE_MBEDTLS_BUILTIN. +config DISABLE_MBEDTLS_BUILTIN + bool + config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" help From bec38cb4ce8470154d09ad6fb7cac72b7ae4ca3a Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Mon, 12 Feb 2024 14:30:23 +0100 Subject: [PATCH 0411/3334] [nrf noup] modules: mbedtls: Add include folders We moved the header files in sdk-mbedtls from the library folder to the include/library folder. This was done to avoid issues when building MbedTLS with the nrf_security module and the Oberon PSA core. The Oberon PSA core provides a subset of these header files and since they are included with quotes we cannot have them in the same directory. This change make the needed adaptions in CMake for the applications that don't use nrf_security. Signed-off-by: Georgios Vasilakis Signed-off-by: Markus Swarowsky (cherry picked from commit 5be6dd73315cb8d04f7dd916c992ee3bfa73fd76) --- modules/mbedtls/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index 83a8cb674a5e..7e16f0de2514 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -40,6 +40,8 @@ zephyr_interface_library_named(mbedTLS) # Add regular includes target_include_directories(mbedTLS INTERFACE ${ZEPHYR_CURRENT_MODULE_DIR}/include + ${ZEPHYR_CURRENT_MODULE_DIR}/include/library + ${ZEPHYR_CURRENT_MODULE_DIR}/library configs include ) From 80eff8d743a831977cb4caab3a07b288362618a0 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 13 Jul 2023 13:42:10 +0000 Subject: [PATCH 0412/3334] [nrf noup] drivers/flashdisk: Add support for Partition Manager The commits adds support for generating flash disks from Partition Manager defined partitions. Signed-off-by: Dominik Ermel (cherry picked from commit fb017044d258fc23441928f367b33beeb82565c3) --- drivers/disk/flashdisk.c | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index 37606f541390..a2bb7d010365 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -469,6 +469,8 @@ static const struct disk_operations flash_disk_ops = { .ioctl = disk_flash_access_ioctl, }; +#ifndef USE_PARTITION_MANAGER +/* The non-Partition manager, DTS based generators below */ #define DT_DRV_COMPAT zephyr_flash_disk #define PARTITION_PHANDLE(n) DT_PHANDLE_BY_IDX(DT_DRV_INST(n), partition, 0) @@ -510,6 +512,82 @@ DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) "Devicetree node " DT_NODE_PATH(DT_DRV_INST(n)) \ " has cache size which is not a multiple of its sector size"); DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) +#else /* ifndef USE_PARTITION_MANAGER */ +/* Partition Manager based generators below */ + +/* Gets the PM_..._EXTRA_PARAM_##param value */ +#define PM_FLASH_DISK_ENTRY_EXTRA_PARAM(name, param) PM_##name##_EXTRA_PARAM_disk_##param + +/* Gets the PM_..._NAME value which is originally cased, as in yaml, partition name */ +#define PM_FLASH_DISK_ENTRY_PARTITION_NAME(name) PM_##name##_NAME + +/* Generates flashdiskN_cache variable name, where N is partition ID */ +#define PM_FLASH_DISK_CACHE_VARIABLE(n) UTIL_CAT(flashdisk, UTIL_CAT(FIXED_PARTITION_ID(n), _cache)) + +/* Generate cache buffers */ +#define CACHE_SIZE(n) (COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), (0), (1)) * \ + PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size)) +#define DEFINE_FLASHDISKS_CACHE(n) \ + static uint8_t __aligned(4) PM_FLASH_DISK_CACHE_VARIABLE(n)[CACHE_SIZE(n)]; + +PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) + +/* Generated single Flash Disk device data from Partition Manager partition. + * Partition is required to have type set to disk in partition definitions: + * type: disk + * and following extra params can be provided: + * extra_params: { + * name = "", + * cache_size = , + * sector_size = , + * read_only = + * } + * where: + * is mandatory device name that will be used by Disk Access and FAT FS to mount device; + * is cache r/w cache size, which is mandatory if read_only = 0 or not present, + * and should be multiple of ; + * is mandatory device sector size information, usually should be erase page size, + * for flash devices, for example 4096 bytes; + * read_only is optional, if not present then assumed false; can be 0(false) or 1(true). + */ +#define DEFINE_FLASHDISKS_DEVICE(n) \ +{ \ + .info = { \ + .ops = &flash_disk_ops, \ + .name = STRINGIFY(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, name)), \ + }, \ + .area_id = FIXED_PARTITION_ID(n), \ + .offset = FIXED_PARTITION_OFFSET(n), \ + .cache = PM_FLASH_DISK_CACHE_VARIABLE(n), \ + .cache_size = sizeof(PM_FLASH_DISK_CACHE_VARIABLE(n)), \ + .size = FIXED_PARTITION_SIZE(n), \ + .sector_size = PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size), \ +}, + +/* The bellow used PM_FOREACH_TYPE_disk is generated by Partition Manager foreach + * loop macro. The lower case _disk is type name for which the macro has been generated; + * partition entry can have multiple types set and foreach macro will be generated + * for every type found across partition definitions. + */ +static struct flashdisk_data flash_disks[] = { + PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE) +}; + +#define VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY(n) \ + COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), \ + (/* cache-size is not used for read-only disks */), \ + (BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) != 0, \ + "Flash disk partition " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n))\ + " must have non-zero cache-size");)) +PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) + +#define VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE(n) \ + BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) % \ + PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size) == 0, \ + "Devicetree node " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n)) \ + " has cache size which is not a multiple of its sector size"); +PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) +#endif /* USE_PARTITION_MANAGER */ static int disk_flash_init(void) { From ad57346bf7605728baf1c05c0f4525e43c81cc4f Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 23 Jun 2022 14:10:01 +0000 Subject: [PATCH 0413/3334] [nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit adds bootutil hook, for nrf5340, to allow it handling the non-accessible image-1/primary slot. Signed-off-by: Andrzej Głąbek Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Johann Fischer Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit 3903e0143b0ea8876ac0e4c40691a0f41de79865) --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 +++++ subsys/mgmt/mcumgr/Kconfig | 1 + .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 35 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 39d4a4ca8ce0..ad088eca0677 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -16,3 +16,11 @@ add_subdirectory(transport) add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) + +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 49bd17f46691..1c6a3a2a5162 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,6 +6,7 @@ menuconfig MCUMGR bool "mcumgr Support" depends on NET_BUF depends on ZCBOR + imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c new file mode 100644 index 000000000000..f1ac8a168e65 --- /dev/null +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "bootutil/bootutil_public.h" + +#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 +/* Sysbuild */ +#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER +#else +/* Legacy child/parent */ +#define NET_CORE_IMAGE 1 +#endif + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) +{ + if (image_index == NET_CORE_IMAGE) { + /* Pretend that primary slot of image 1 unpopulated */ + state->magic = BOOT_MAGIC_UNSET; + state->swap_type = BOOT_SWAP_TYPE_NONE; + state->image_num = image_index; + state->copy_done = BOOT_FLAG_UNSET; + state->image_ok = BOOT_FLAG_UNSET; + + /* Prevent bootutil from trying to obtain true info */ + return 0; + } + + return BOOT_HOOK_REGULAR; +} From 2919de8fa0bfd33d74b6e8ec762aa0f43055a8dc Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 16 Oct 2023 08:40:38 +0100 Subject: [PATCH 0414/3334] [nrf noup] samples: bluetooth: hci_pow_ctrl: Migrate child image config Migrates child image configuration for this sample over to sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit 5abb42e03682e4a02346b5f1b7eec151322fd5fe) --- samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf new file mode 100644 index 000000000000..e6749ae63990 --- /dev/null +++ b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf @@ -0,0 +1 @@ +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From b110ac811ea2cf695a72431aa14f8010f7fcf0c6 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 16 Oct 2023 08:41:27 +0100 Subject: [PATCH 0415/3334] [nrf noup] samples: mgmt: mcumgr smp_svr: Migrate child image config Migrates child image configuration for this sample over to sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit 55fe863e025f291e96a8f64a6ff4c8fd9b0be47b) --- .../subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf new file mode 100644 index 000000000000..98260877332f --- /dev/null +++ b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2022 Nordic Semiconductor +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_BT_MAX_CONN=2 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=502 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 From 9785674003ca9f90958e8895b5f9e70c21a6ec8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 1 Dec 2022 14:41:13 +0100 Subject: [PATCH 0416/3334] [nrf noup] samples&tests: Restore a few CONFIG_NEWLIB_LIBC_NANO=n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit 9dd570f8a2207a02c886480b0065cd5a0e3a2e94. Since in NCS, unlike in vanilla Zephyr, the nano variant of newlib is the default one, restore entries that disable the nano variant in one sample and one test that require the full newlib variant. This patch is supposed to be removed when picolibc becomes the default. Signed-off-by: Andrzej Głąbek Signed-off-by: Dominik Ermel (cherry picked from commit ae27bb6be606af5743363c62d69c54a05b3a7b68) --- tests/lib/newlib/heap_listener/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib/newlib/heap_listener/prj.conf b/tests/lib/newlib/heap_listener/prj.conf index e5a5dc6df4c1..7282777ff1ca 100644 --- a/tests/lib/newlib/heap_listener/prj.conf +++ b/tests/lib/newlib/heap_listener/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y +CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y From e99379d6a289797fe4361658f4a04e44b651d705 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 15 Dec 2023 07:57:14 +0000 Subject: [PATCH 0417/3334] [nrf noup] samples/tests: Disable PM for some sysbuild builds Disables partition manager when building some samples and tests which use sysbuild to prevent build issues Signed-off-by: Jamie McCrae (cherry picked from commit d51d9114eb3248b1f7ada55410e17f2430fa549e) --- samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf | 1 + samples/drivers/mbox/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf | 1 + samples/subsys/logging/multidomain/sysbuild.conf | 1 + tests/boot/mcuboot_recovery_retention/sysbuild.conf | 1 + tests/boot/test_mcuboot/sysbuild.conf | 1 + tests/drivers/flash/common/sysbuild.conf | 1 + tests/drivers/flash/negative_tests/sysbuild.conf | 1 + tests/subsys/fs/fcb/sysbuild.conf | 1 + tests/subsys/fs/littlefs/sysbuild.conf | 1 + 12 files changed, 12 insertions(+) create mode 100644 samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf create mode 100644 samples/drivers/mbox/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf create mode 100644 samples/subsys/logging/multidomain/sysbuild.conf create mode 100644 tests/drivers/flash/common/sysbuild.conf create mode 100644 tests/drivers/flash/negative_tests/sysbuild.conf create mode 100644 tests/subsys/fs/fcb/sysbuild.conf create mode 100644 tests/subsys/fs/littlefs/sysbuild.conf diff --git a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/drivers/mbox/sysbuild.conf b/samples/drivers/mbox/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/drivers/mbox/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/logging/multidomain/sysbuild.conf b/samples/subsys/logging/multidomain/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/logging/multidomain/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/mcuboot_recovery_retention/sysbuild.conf b/tests/boot/mcuboot_recovery_retention/sysbuild.conf index 47f00ff3cff8..3b5b3c963800 100644 --- a/tests/boot/mcuboot_recovery_retention/sysbuild.conf +++ b/tests/boot/mcuboot_recovery_retention/sysbuild.conf @@ -1 +1,2 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/test_mcuboot/sysbuild.conf b/tests/boot/test_mcuboot/sysbuild.conf index 47f00ff3cff8..3b5b3c963800 100644 --- a/tests/boot/test_mcuboot/sysbuild.conf +++ b/tests/boot/test_mcuboot/sysbuild.conf @@ -1 +1,2 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/drivers/flash/common/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/negative_tests/sysbuild.conf b/tests/drivers/flash/negative_tests/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/drivers/flash/negative_tests/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/fcb/sysbuild.conf b/tests/subsys/fs/fcb/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/subsys/fs/fcb/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/littlefs/sysbuild.conf b/tests/subsys/fs/littlefs/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/subsys/fs/littlefs/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n From 99f08ef8acdcea41299f1b91a6bb9221c1427a47 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Thu, 29 Feb 2024 13:38:48 +0100 Subject: [PATCH 0418/3334] [nrf noup] modules: tfm: Add Kconfig for CRYPTO_PAKE_MODULE_ENABLED Add a Kconfig for th TFM_CRYPTO_PAKE_MODULE_ENABLED to support the PAKE APIs. noup as the PAKE support including the PAKE module doesn't exist yet in upstream TF-M as they depend on mbed TLS support for it Ref: NCSDK-22416 Signed-off-by: Markus Swarowsky (cherry picked from commit 9a699364bdd016c8c785da5ebbe341c81e7472c3) --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 02d3580c22f3..9604319ca012 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -88,6 +88,17 @@ config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED is not used. Note that key agreement is under key derivation in the current implementation. +config TFM_CRYPTO_PAKE_MODULE_ENABLED + bool "PAKE crypto module" + default y + depends on PSA_HAS_PAKE_SUPPORT + depends on NRF_SECURITY + depends on PSA_CRYPTO_DRIVER_OBERON || PSA_CRYPTO_DRIVER_CRACEN + help + Enables the PAKE crypto module within the crypto partition. + Unset this option if the functionality provided by 'crypto_pake.c' + is not used. + endif # TFM_PARTITION_CRYPTO endif # BUILD_WITH_TFM From b106f44581674207cdc1c3352f04658ec6756199 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 7 Feb 2023 12:39:12 +0100 Subject: [PATCH 0419/3334] [nrf noup] Bluetooth: Mesh: zero randomization for friend's adv Friend's replies on LPN's polls do not assume randomization in advertiser. Zero randomization will help to optimize time when LPN keeps receiving window open and save power. Signed-off-by: Aleksandr Khromykh Signed-off-by: Olivier Lesage (cherry picked from commit 4a86215a7cdb119e8ee18f616af8fb6a7c58107a) --- subsys/bluetooth/mesh/Kconfig | 2 +- subsys/bluetooth/mesh/adv_ext.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 87382d67025b..351b18b88e9a 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1710,7 +1710,7 @@ config BT_MESH_LPN_INIT_POLL_TIMEOUT config BT_MESH_LPN_SCAN_LATENCY int "Latency for enabling scanning" range 0 50 - default 15 + default 2 help Latency in milliseconds that it takes to enable scanning. This is in practice how much time in advance before the Receive Window diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 0ff0bc5e9fe7..2382b01bd182 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -13,6 +13,9 @@ #include #include #include +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#endif #include "common/bt_str.h" @@ -149,6 +152,28 @@ static inline struct bt_mesh_ext_adv *gatt_adv_get(void) } } +static int set_adv_randomness(uint8_t handle, int rand_us) +{ +#if defined(CONFIG_BT_LL_SOFTDEVICE) + struct net_buf *buf; + sdc_hci_cmd_vs_set_adv_randomness_t *cmd_params; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (!buf) { + LOG_ERR("Could not allocate command buffer"); + return -ENOMEM; + } + + cmd_params = net_buf_add(buf, sizeof(*cmd_params)); + cmd_params->adv_handle = handle; + cmd_params->rand_us = rand_us; + + return bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_SET_ADV_RANDOMNESS, buf, NULL); +#else + return 0; +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ +} + static int adv_start(struct bt_mesh_ext_adv *ext_adv, const struct bt_le_adv_param *param, struct bt_le_ext_adv_start_param *start, @@ -552,6 +577,13 @@ int bt_mesh_adv_enable(void) if (err) { return err; } + + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { + err = set_adv_randomness(adv->instance->handle, 0); + if (err) { + LOG_ERR("Failed to set zero randomness: %d", err); + } + } } return 0; From 61a77f407e84b60ce59c46ea0bf77ceda8bfa977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Storr=C3=B8?= Date: Wed, 8 Mar 2023 12:17:09 +0100 Subject: [PATCH 0420/3334] [nrf noup] Bluetooth: Mesh: Fix adv randomness bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue where randomness can be removed for advertising sets that have to handle other adv types than the BT_MESH_FRIEND_ADV tag type. Signed-off-by: Anders Storrø Signed-off-by: Aleksandr Khromykh Signed-off-by: Dominik Ermel (cherry picked from commit 5012b87851726ecb8b23771122e69a52e45c273c) --- subsys/bluetooth/mesh/adv_ext.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 2382b01bd182..68a6c27beebf 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -578,8 +578,10 @@ int bt_mesh_adv_enable(void) return err; } - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { - err = set_adv_randomness(adv->instance->handle, 0); + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && + IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_FRIEND_SEPARATE) && + advs[i].tags == BT_MESH_ADV_TAG_BIT_FRIEND) { + err = set_adv_randomness(advs[i].instance->handle, 0); if (err) { LOG_ERR("Failed to set zero randomness: %d", err); } From aef36004d5a7bb90f0860caebe4d2b498c829950 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Thu, 28 Mar 2024 15:04:41 +0100 Subject: [PATCH 0421/3334] [nrf noup] dfu/boot/mcuboot: fix confirmation in case of USE_PARTITION_MANAGER Active partition ID need to be extracted basing on PARTITION_MANAGER products. ref.:NCSDK-26693 Signed-off-by: Andrzej Puzdrowski Signed-off-by: Jamie McCrae (cherry picked from commit 75d9248327f898f7b60ce309c42097d545fbf21a) --- subsys/dfu/boot/mcuboot.c | 47 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/subsys/dfu/boot/mcuboot.c b/subsys/dfu/boot/mcuboot.c index ad8ade044d41..70c746cf7ce1 100644 --- a/subsys/dfu/boot/mcuboot.c +++ b/subsys/dfu/boot/mcuboot.c @@ -58,8 +58,49 @@ enum IMAGE_INDEXES { IMAGE_INDEX_2 }; -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \ - defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) +#if USE_PARTITION_MANAGER +#include + +#if CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 +/* Sysbuild */ +#ifdef CONFIG_MCUBOOT +/* lib is part of MCUboot -> operate on the primary application slot */ +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#else +/* TODO: Add firmware loader support */ +/* lib is part of the app -> operate on active slot */ +#if defined(CONFIG_NCS_IS_VARIANT_IMAGE) +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif /* CONFIG_MCUBOOT */ +#else +/* Legacy child/parent */ +#if CONFIG_BUILD_WITH_TFM + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) +#else + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) +#endif + +#ifdef CONFIG_MCUBOOT + /* lib is part of MCUboot -> operate on the primary application slot */ + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#else + /* lib is part of the App -> operate on active slot */ +#if (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_PRIMARY_ADDRESS + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#elif (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_SECONDARY_ADDRESS + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID +#else + #error Missing partition definitions. +#endif +#endif /* CONFIG_MCUBOOT */ +#endif /* CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 */ + +#else + +#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) /* For RAM LOAD mode, the active image must be fetched from the bootloader */ #define ACTIVE_SLOT_FLASH_AREA_ID boot_fetch_active_slot() #define INVALID_SLOT_ID 255 @@ -68,6 +109,8 @@ enum IMAGE_INDEXES { #define ACTIVE_SLOT_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_code_partition)) #endif +#endif /* USE_PARTITION_MANAGER */ + /* * Raw (on-flash) representation of the v1 image header. */ From 5992ed018de716e4d2fb868c58901534a888802b Mon Sep 17 00:00:00 2001 From: Sigurd Hellesvik Date: Tue, 26 Mar 2024 16:35:05 +0100 Subject: [PATCH 0422/3334] [nrf noup] modules: mbedtls: Use help for DISABLE_MBEDTLS_BUILTIN info Using a comment to explain Kconfig options make them invisible to Kconfig search. Use help instead. Signed-off-by: Sigurd Hellesvik (cherry picked from commit 8dd6a9c5f0b5ded320b9c8adb67f6adb36cf70e0) --- modules/mbedtls/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index f7bc6a609f1f..aa8c479e89f7 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -43,10 +43,11 @@ config MBEDTLS_LIBRARY endchoice -# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select -# DISABLE_MBEDTLS_BUILTIN. config DISABLE_MBEDTLS_BUILTIN bool + help + Subsystems cannot deselect MBEDTLS_BUILTIN, but they can select + DISABLE_MBEDTLS_BUILTIN. config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" From 42834a97d953e02dbd4c87b89d55138499c0d415 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Wed, 27 Sep 2023 09:41:10 +0000 Subject: [PATCH 0423/3334] [nrf noup] test: schedule_api: Use Minimal C library There is no point to use PICOLIB here as it bloats the tests. Signed-off-by: Dominik Ermel (cherry picked from commit 3d15176b97cacaac6023894df77eeb716fde2525) --- tests/kernel/pipe/deprecated/pipe_api/prj.conf | 9 +++++++++ tests/kernel/sched/schedule_api/prj.conf | 1 + tests/kernel/sched/schedule_api/prj_multiq.conf | 1 + 3 files changed, 11 insertions(+) create mode 100644 tests/kernel/pipe/deprecated/pipe_api/prj.conf diff --git a/tests/kernel/pipe/deprecated/pipe_api/prj.conf b/tests/kernel/pipe/deprecated/pipe_api/prj.conf new file mode 100644 index 000000000000..df3270adfdf8 --- /dev/null +++ b/tests/kernel/pipe/deprecated/pipe_api/prj.conf @@ -0,0 +1,9 @@ +CONFIG_ZTEST=y +CONFIG_IRQ_OFFLOAD=y +CONFIG_TEST_USERSPACE=y +CONFIG_DYNAMIC_OBJECTS=y +CONFIG_MP_MAX_NUM_CPUS=1 +CONFIG_ZTEST_FATAL_HOOK=y +CONFIG_PIPES=y +CONFIG_DEPRECATION_TEST=y +CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj.conf b/tests/kernel/sched/schedule_api/prj.conf index a5ceef694331..8b649a3b7fca 100644 --- a/tests/kernel/sched/schedule_api/prj.conf +++ b/tests/kernel/sched/schedule_api/prj.conf @@ -7,3 +7,4 @@ CONFIG_MAX_THREAD_BYTES=6 CONFIG_TEST_USERSPACE=y CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y +CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index c8dd4bf786bc..84c9d80ac619 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -7,3 +7,4 @@ CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y CONFIG_NUM_COOP_PRIORITIES=30 CONFIG_NUM_PREEMPT_PRIORITIES=40 +CONFIG_MINIMAL_LIBC=y From d593127ffbd013894b1d5afc89bdb7f7fd9a2c07 Mon Sep 17 00:00:00 2001 From: Jan Tore Guggedal Date: Mon, 18 May 2020 20:50:13 +0200 Subject: [PATCH 0424/3334] [nrf noup] net: mqtt: Provide option to enable TLS session caching Provides an option to enable TLS session caching for an MQTT client's secure socket. Signed-off-by: Jan Tore Guggedal Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Johann Fischer (cherry picked from commit 968380d2ad7ae3e0aab22c3f58cd0e206daa9761) --- include/zephyr/net/mqtt.h | 3 +++ subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index b992714afd32..d63cc1316249 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -763,6 +763,9 @@ struct mqtt_sec_config { uint32_t alpn_protocol_name_count; #endif + /** Indicates the preference for enabling TLS session caching. */ + int session_cache; + /** Peer hostname for ceritificate verification. * May be NULL to skip hostname verification. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 2ff337eef343..68a101e6c846 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -109,6 +109,16 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } + if (tls_config->session_cache == TLS_SESSION_CACHE_ENABLED) { + ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, + TLS_SESSION_CACHE, + &tls_config->session_cache, + sizeof(tls_config->session_cache)); + if (ret < 0) { + goto error; + } + } + if (tls_config->cert_nocopy != TLS_CERT_NOCOPY_NONE) { ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, TLS_CERT_NOCOPY, &tls_config->cert_nocopy, From bc094738b4385dca505a5afe63d8152c348dd029 Mon Sep 17 00:00:00 2001 From: Mirko Covizzi Date: Thu, 10 Mar 2022 00:25:50 -0800 Subject: [PATCH 0425/3334] [nrf noup] net: mqtt: add native TLS support This commit adds an extra parameter in the configuration structure to configure native TLS support at runtime. Signed-off-by: Mirko Covizzi (cherry picked from commit 086e7014f834da9b7bc8f34999c68a1c4a0756bb) --- doc/connectivity/networking/api/mqtt.rst | 3 +++ include/zephyr/net/mqtt.h | 3 +++ subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/connectivity/networking/api/mqtt.rst b/doc/connectivity/networking/api/mqtt.rst index 2775d77315b8..c2fb612e1cc2 100644 --- a/doc/connectivity/networking/api/mqtt.rst +++ b/doc/connectivity/networking/api/mqtt.rst @@ -150,6 +150,7 @@ additional configuration information: tls_config->sec_tag_list = m_sec_tags; tls_config->sec_tag_count = ARRAY_SIZE(m_sec_tags); tls_config->hostname = MQTT_BROKER_HOSTNAME; + tls_config->set_native_tls = true; In this sample code, the ``m_sec_tags`` array holds a list of tags, referencing TLS credentials that the MQTT library should use for authentication. We do not specify @@ -162,6 +163,8 @@ Note, that TLS credentials referenced by the ``m_sec_tags`` array must be registered in the system first. For more information on how to do that, refer to :ref:`secure sockets documentation `. +Finally, ``set_native_tls`` can be optionally set to enable native TLS support instead of offloading TLS operations to the modem. + An example of how to use TLS with MQTT is also present in :zephyr:code-sample:`mqtt-publisher` sample application. diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index d63cc1316249..797f8f339d7f 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -773,6 +773,9 @@ struct mqtt_sec_config { /** Indicates the preference for copying certificates to the heap. */ int cert_nocopy; + + /** Set socket to native TLS */ + bool set_native_tls; }; /** @brief MQTT transport type. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 68a101e6c846..617dec4b4d26 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -22,10 +22,15 @@ int mqtt_client_tls_connect(struct mqtt_client *client) { const struct sockaddr *broker = client->broker; struct mqtt_sec_config *tls_config = &client->transport.tls.config; + int type = SOCK_STREAM; int ret; + if (tls_config->set_native_tls) { + type |= SOCK_NATIVE_TLS; + } + client->transport.tls.sock = zsock_socket(broker->sa_family, - SOCK_STREAM, IPPROTO_TLS_1_2); + type, IPPROTO_TLS_1_2); if (client->transport.tls.sock < 0) { return -errno; } From 1fc5b04e051f1702c7138cbe9739d86de08d9748 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Mon, 4 Dec 2023 15:27:08 +0100 Subject: [PATCH 0426/3334] [nrf noup] soc: arm: nRF53: Add SPU Flash/RAM alignment TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF53 Signed-off-by: Markus Swarowsky (cherry picked from commit 3215723c1db807ff79ab3daad09c81e64e57eafb) --- soc/nordic/nrf53/Kconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 7260d5c7d66d..e326322044ad 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -167,12 +167,26 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral +config NRF_SPU_FLASH_REGION_ALIGNMENT + hex + default 0x4000 + help + FLASH regions must be aligned to this value due to SPU HW + limitations. + config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 help RAM region size for the NRF_SPU peripheral +config NRF_SPU_RAM_REGION_ALIGNMENT + hex + default 0x2000 + help + RAM regions must be aligned to this value due to SPU HW + limitations. + config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" depends on NRF_SOC_SECURE_SUPPORTED From dcb4dc934d2171922c14d1c6417744c494baf297 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Mon, 4 Dec 2023 15:27:14 +0100 Subject: [PATCH 0427/3334] [nrf noup] soc: arm: nRF91: Add SPU Flash/RAM alignment TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF91 The nRF54L15 doesn't use the SPU for setting the security attributes for flash/RAM regions. In order to avoid having multiple Kconfigs with similar meaning renamed the alignment Kconfig option to something more generic in order to use the same symbol for all the TrustZone enabled devices. Ref: NCSDK-25023 Signed-off-by: Markus Swarowsky Signed-off-by: Georgios Vasilakis (cherry picked from commit ae5c8b84c976df506f0f21c4abd5379a9496fee6) --- soc/nordic/nrf53/Kconfig | 22 ++++++++++++++-------- soc/nordic/nrf91/Kconfig | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index e326322044ad..6e53dc277c65 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -167,12 +167,15 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_SPU_FLASH_REGION_ALIGNMENT +config NRF_TRUSTZONE_FLASH_REGION_SIZE hex - default 0x4000 + default NRF_SPU_FLASH_REGION_SIZE help - FLASH regions must be aligned to this value due to SPU HW - limitations. + Define the flash region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. config NRF_SPU_RAM_REGION_SIZE hex @@ -180,12 +183,15 @@ config NRF_SPU_RAM_REGION_SIZE help RAM region size for the NRF_SPU peripheral -config NRF_SPU_RAM_REGION_ALIGNMENT +config NRF_TRUSTZONE_RAM_REGION_SIZE hex - default 0x2000 + default NRF_SPU_RAM_REGION_SIZE help - RAM regions must be aligned to this value due to SPU HW - limitations. + Define the RAM region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" diff --git a/soc/nordic/nrf91/Kconfig b/soc/nordic/nrf91/Kconfig index ed38eff73a2d..9f55cdd77ed9 100644 --- a/soc/nordic/nrf91/Kconfig +++ b/soc/nordic/nrf91/Kconfig @@ -24,6 +24,16 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default NRF_SPU_FLASH_REGION_SIZE + help + Define the flash region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. + config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 @@ -34,4 +44,14 @@ config NRF_ENABLE_ICACHE bool "Instruction cache (I-Cache)" default y +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default NRF_SPU_RAM_REGION_SIZE + help + Define the RAM region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. + endif # SOC_SERIES_NRF91X From 01ff6eb18aee45d3d7857682f108f05cbab0afe4 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 14 Nov 2022 11:22:06 +0100 Subject: [PATCH 0428/3334] [nrf noup] boards: thingy53_nrf5340: Add common partition map Change introduces common static Partition Manager configuration. The tfm_nonsecure partition must be SPU region aligned. Ref: NCSDK-18033 Ref: NCSDK-19515 Signed-off-by: Marek Pieta Signed-off-by: Markus Swarowsky (cherry picked from commit 2c0983924caa07a59769730edb15177387c2b4a8) --- .../pm_static_thingy53_nrf5340_cpuapp.yml | 55 ++++++++++++++ .../pm_static_thingy53_nrf5340_cpuapp_ns.yml | 73 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml create mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..7a48d51ec334 --- /dev/null +++ b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml @@ -0,0 +1,55 @@ +app: + address: 0x10200 + region: flash_primary + size: 0xdfe00 +mcuboot: + address: 0x0 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + region: flash_primary + size: 0x200 +mcuboot_primary: + address: 0x10000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0xe0000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + orig_span: &id002 + - app + region: flash_primary + size: 0xdfe00 + span: *id002 +settings_storage: + address: 0xf0000 + region: flash_primary + size: 0x10000 +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x00000 + size: 0xe0000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xe0000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x120000 + size: 0x6e0000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml new file mode 100644 index 000000000000..70ffe6d9c124 --- /dev/null +++ b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml @@ -0,0 +1,73 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + region: flash_primary + size: 0x200 +tfm_secure: + address: 0x10000 + size: 0xc000 + span: [mcuboot_pad, tfm] +tfm_nonsecure: + address: 0x1c000 + size: 0xd4000 + span: [app] +tfm: + address: 0x10200 + region: flash_primary + size: 0xbe00 +app: + address: 0x1c000 + region: flash_primary + size: 0xd4000 +mcuboot_primary: + address: 0x10000 + orig_span: &id001 + - mcuboot_pad + - tfm + - app + region: flash_primary + size: 0xe0000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + orig_span: &id002 + - tfm + - app + region: flash_primary + size: 0xdfe00 + span: *id002 +nonsecure_storage: + address: 0xf0000 + size: 0x10000 + span: [settings_storage] +settings_storage: + address: 0xf0000 + region: flash_primary + size: 0x10000 +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x00000 + size: 0xe0000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xe0000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x120000 + size: 0x6e0000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary From 7a668858c52a1bedd8b635105982b21c1c477ca6 Mon Sep 17 00:00:00 2001 From: Mateusz Kapala Date: Thu, 2 Feb 2023 11:04:23 +0100 Subject: [PATCH 0429/3334] [nrf noup] boards: arm: thingy53: Disable USB CDC added by MCUBoot Enabling USB CDC by default in Thingy:53 board configuration caused that there were two instances of USB CDC in MCUBoot. Change disables one instance which was added automatically by NCS if MCUBoot bootloader was built as a child image. Jira: NCSDK-18596 Signed-off-by: Mateusz Kapala Signed-off-by: Johann Fischer (cherry picked from commit 2174182010daaba7e4b00f9972cf5b4d3abc1d0a) --- boards/nordic/thingy53/Kconfig.defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index c1139f0dca10..1aa0d7d082ec 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -84,6 +84,13 @@ endif # !TRUSTED_EXECUTION_SECURE source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" +# By default, a USB CDC ACM instance is already enabled in the board's DTS. +# It is not necessary for nRF Connect SDK to add another instance if MCUBoot +# bootloader is built as a child image. +config MCUBOOT_USB_SUPPORT + bool + default n + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From 223923a02a5759befedc3f6442ebafd8b57d60d7 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 28 Nov 2022 15:31:33 +0100 Subject: [PATCH 0430/3334] [nrf noup] boards: thingy53_nrf5340: Enable MCUboot by default Change enables MCUboot bootloader by default to allow programming samples and applications without external programmer (using MCUboot serial recovery). Change also enables network core to prevent build failures when building MCUboot with nRF53 multi image DFU. Jira: NCSDK-18263 Signed-off-by: Marek Pieta Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Johann Fischer Signed-off-by: Joakim Andersson (cherry picked from commit 6fdb620a5cc5609dfc40cc8657f95162e7c42b91) --- boards/nordic/thingy53/Kconfig.defconfig | 6 ++++++ boards/nordic/thingy53/thingy53_nrf5340_common.dtsi | 1 + 2 files changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 1aa0d7d082ec..badcb5c20e5d 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -8,6 +8,12 @@ config HW_STACK_PROTECTION if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS +config BOOTLOADER_MCUBOOT + default y if !MCUBOOT + +config BOARD_ENABLE_CPUNET + default y if !MCUBOOT + # Code Partition: # # For the secure version of the board the firmware is linked at the beginning diff --git a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi index fabd5d177a99..c8042b284755 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi +++ b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi @@ -13,6 +13,7 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; + nordic,pm-ext-flash = &mx25r64; }; buttons { From e3ec025a735de3f6fc67d84ce20168959cb6f3d1 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Fri, 19 Apr 2024 12:58:47 +0200 Subject: [PATCH 0431/3334] [nrf noup] samples: psa_crypto: Remove support for Nordic boards We have our own psa crypto samples to show how to used PSA crypto with NCS. This sample still uses CONFIG_MBEDTLS_BUILTIN which is not supported anymore, therefore removing the support for it in NCS. Ref: NCSDK-17944 Signed-off-by: Markus Swarowsky (cherry picked from commit c16c503ce1e37bd26446b4fd11d0cfe701707c14) --- samples/tfm_integration/psa_crypto/sample.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/tfm_integration/psa_crypto/sample.yaml b/samples/tfm_integration/psa_crypto/sample.yaml index ea9844730fc1..7d287985bf3c 100644 --- a/samples/tfm_integration/psa_crypto/sample.yaml +++ b/samples/tfm_integration/psa_crypto/sample.yaml @@ -16,8 +16,6 @@ tests: platform_allow: - mps2/an521/cpu0/ns - v2m_musca_s1/musca_s1/ns - - nrf5340dk/nrf5340/cpuapp/ns - - nrf9160dk/nrf9160/ns - stm32l562e_dk/stm32l562xx/ns - bl5340_dvk/nrf5340/cpuapp/ns - max32657evkit/max32657/ns From ce294a1bceb8f3852fa64b16e425b71928710ce5 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 9 May 2024 09:34:06 +0100 Subject: [PATCH 0432/3334] [nrf noup] boards: nordic: thingy53: Add sysbuild Kconfig file Adds a sysbuild Kconfig file which enables external flash when partition manager is enabled Signed-off-by: Jamie McCrae (cherry picked from commit 5b6d9b4294ab0a282042220d84a349d8c646c37b) --- boards/nordic/thingy53/Kconfig.sysbuild | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 boards/nordic/thingy53/Kconfig.sysbuild diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild new file mode 100644 index 000000000000..2110f226e6b1 --- /dev/null +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY + default y if BOOTLOADER_MCUBOOT From 3d69ff980c3c97218595c492ebf13feb2e95b739 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 14 May 2024 12:22:51 +0100 Subject: [PATCH 0433/3334] [nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir Uses sysbuild by default when building an application which resides in an allowed NCS-based directory when the sysbuild config key is not set. Do not use sysbuild if the mps2 board is being used to avoid problems with CI testing. Signed-off-by: Jamie McCrae (cherry picked from commit 6ccde75d66357c29fbef2f2c1fda3f5224fa96c9) --- scripts/west_commands/build.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index fb3894944cd8..a271e4075a5b 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -642,7 +642,12 @@ def _run_cmake(self, board, origin, cmake_opts): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', False) + config_sysbuild = config_getboolean('sysbuild', None) + + if config_sysbuild is None: + # If no option is set, then enable sysbuild globally + config_sysbuild = True + if self.args.sysbuild or (config_sysbuild and not self.args.no_sysbuild): cmake_opts.extend([f'-S{SYSBUILD_PROJ_DIR}', f'-DAPP_DIR:PATH={self.source_dir}']) From 69261560e778e70cc8b22648b158a011a7d10c9d Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 17 May 2024 10:15:33 +0100 Subject: [PATCH 0434/3334] [nrf noup] board: nordic: thingy53: Enable default images for sysbuild Enables MCUboot, empty network core and network core updates by default when building for the thingy53 Signed-off-by: Jamie McCrae (cherry picked from commit 304bf1eb36faa642f422f3366555a5c9f4cbc084) --- boards/nordic/thingy53/Kconfig.sysbuild | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index 2110f226e6b1..c03d191b3708 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -1,5 +1,22 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +config SECURE_BOOT_NETCORE + default y + +config NETCORE_APP_UPDATE + default y if SECURE_BOOT_NETCORE + +config NRF_DEFAULT_EMPTY + default y if SECURE_BOOT_NETCORE + +endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY default y if BOOTLOADER_MCUBOOT From e99b3428e85466a8034c52c4d67542e7b8e19fe0 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 1 Oct 2018 10:27:32 +0200 Subject: [PATCH 0435/3334] [nrf noup] include: net: add NCS extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add some socket options and address family extensions to Zephyr headers, which will be useful for nRF Connect SDK. Add secure socket options: * Add CID socket options to NCS specific options. * Add TLS/DTLS tls ciphersuite chosen socket option to NCS specific options. * Add TLS/DTLS connection save/load socket options to NCS specific options. * Add TLS/DTLS handshake status socket option to NCS specific options. * Add SO_KEEPOPEN socket option. * Add SO_RAI socket options. * Add SO_IPV6_DELAYED_ADDR_REFRESH socket option. * Add SO_SENDCB socket option. The "author" of this commit is a contact person; various people with s-o-b lines following here have contributed to the maintenance of this patch. Signed-off-by: Andreas Moltumyr Signed-off-by: Andrzej Głąbek Signed-off-by: Christopher Métrailler Signed-off-by: Emanuele Di Santo Signed-off-by: Glenn Ruben Bakke Signed-off-by: Håkon Alseth Signed-off-by: Ioannis Glaropoulos Signed-off-by: Jan Tore Guggedal Signed-off-by: Joakim Andersson Signed-off-by: Martí Bolívar Signed-off-by: Mirko Covizzi Signed-off-by: Petri Honkala Signed-off-by: Robert Lubos Signed-off-by: Tommi Mammela Signed-off-by: Trond Einar Snekvik Signed-off-by: Torsten Rasmussen Signed-off-by: Eivind Jølsgard Signed-off-by: Dominik Ermel Signed-off-by: Kacper Radoszewski (cherry picked from commit d76fd711710157d1e93e49134fac683951b16f6a) (cherry picked from commit 82e313ea28bc6196729b58d65f5e0f2473d01531) --- include/zephyr/net/socket.h | 1 + include/zephyr/net/socket_ncs.h | 207 ++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+) create mode 100644 include/zephyr/net/socket_ncs.h diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index 2eab2d964628..d5447b097e57 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #ifdef __cplusplus diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h new file mode 100644 index 000000000000..6a77d6c41f13 --- /dev/null +++ b/include/zephyr/net/socket_ncs.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ +#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ + +/** + * @file + * @brief NCS specific additions to the BSD sockets API definitions + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence + * when creating a new socket. Combine this flag with a socket type when + * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). + * If it's desired to create a native TLS socket, but still offload the + * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. + */ +#define SOCK_NATIVE 0x80000000 +#define SOCK_NATIVE_TLS 0x40000000 + +/** Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options. + */ +#define NET_SOCKET_NCS_BASE 1000 + +/* NCS specific TLS level socket options */ + +/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. + * The option accepts an integer, indicating the total handshake timeout, + * including retransmissions, in seconds. + * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. + */ +#define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) + +/** Socket option to save DTLS connection, specifically for nRF sockets. + */ +#define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) + +/** Socket option to load DTLS connection, specifically for nRF sockets. + */ +#define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) + +/** Socket option to get result of latest TLS/DTLS completed handshakes end status, + * specifically for nRF sockets. + * The option accepts an integer, indicating the setting. + * Accepted vaules for the option are: 0 and 1. + */ +#define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) + +/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ +#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */ +#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ +#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ + +/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */ +#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 +#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 + +/* NCS specific socket options */ + +/** sockopt: enable sending data as part of exceptional events */ +#define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) +/** sockopt: Keep socket open when its PDN connection is lost + * or the device is put into flight mode. + */ +#define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) +/** sockopt: bind to PDN */ +#define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) + +/** sockopt: Release assistance indication (RAI). + * The option accepts an integer, indicating the type of RAI. + * Accepted values for the option are: @ref RAI_NO_DATA, @ref RAI_LAST, @ref RAI_ONE_RESP, + * @ref RAI_ONGOING, @ref RAI_WAIT_MORE. + */ +#define SO_RAI (NET_SOCKET_NCS_BASE + 61) + +/** Release assistance indication (RAI). + * Indicate that the application does not intend to send more data. + * This applies immediately and lets the modem exit connected mode more + * quickly. + * + * @note This requires the socket to be connected. + */ +#define RAI_NO_DATA 1 +/** Release assistance indication (RAI). + * Indicate that the application does not intend to send more data + * after the next call to send() or sendto(). + * This lets the modem exit connected mode more quickly after sending the data. + */ +#define RAI_LAST 2 +/** Release assistance indication (RAI). + * Indicate that the application is expecting to receive just one data packet + * after the next call to send() or sendto(). + * This lets the modem exit connected mode more quickly after having received the data. + */ +#define RAI_ONE_RESP 3 +/** Release assistance indication (RAI). + * Indicate that the socket is in active use by a client application. + * This lets the modem stay in connected mode longer. + */ +#define RAI_ONGOING 4 +/** Release assistance indication (RAI). + * Indicate that the socket is in active use by a server application. + * This lets the modem stay in connected mode longer. + */ +#define RAI_WAIT_MORE 5 + +/** sockopt: set a callback to be called when a send request is acknowledged by the network and + * the data has been acknowledged by the peer, if required by the network protocol, or until the + * timeout, given by the SO_SNDTIMEO socket option, is reached. Valid timeout values are + * 1 to 600 seconds. + * This option takes a @ref socket_ncs_sendcb structure. + * + * @note The callback is executed in an interrupt context. + * Take care to offload any processing as appropriate. + * + * @note This is only supported by the following modem firmware: + * - mfw_nrf9151-ntn + * + * This socket option cannot be used along with the @ref MSG_WAITACK send flag. + */ +#define SO_SENDCB (NET_SOCKET_NCS_BASE + 63) + +/** Parameters returned in the @ref socket_ncs_sendcb_t callback. */ +struct socket_ncs_sendcb_params { + /** Socket handle. */ + int fd; + /** Status. Can be 0 on successful send or EAGAIN on timeout. */ + int status; + /** Number of bytes that was sent. */ + size_t bytes_sent; +}; + +/** Callback type in the @ref socket_ncs_sendcb structure. */ +typedef void (*socket_ncs_sendcb_t)(const struct socket_ncs_sendcb_params *params); + +/** Option value for the @ref SO_SENDCB socket option. */ +struct socket_ncs_sendcb { + /** Callback function. */ + socket_ncs_sendcb_t callback; +}; + +/* NCS specific IPPROTO_ALL level socket options */ + +/** IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. */ +#define IPPROTO_ALL 512 +/** sockopt: disable all replies to unexpected traffics */ +#define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) + +/* NCS specific IPPROTO_IP level socket options */ + +/** sockopt: enable IPv4 ICMP replies */ +#define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) + +/* NCS specific IPPROTO_IPV6 level socket options */ + +/** sockopt: enable IPv6 ICMP replies */ +#define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) + +/** sockopt: Delay IPv6 address refresh during power saving mode */ +#define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) + +/* NCS specific TCP level socket options */ + +/** sockopt: Configurable TCP server session timeout in minutes. + * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). + */ +#define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) + +/* NCS specific gettaddrinfo() flags */ + +/** Assume `service` contains a Packet Data Network (PDN) ID. + * When specified together with the AI_NUMERICSERV flag, + * `service` shall be formatted as follows: "port:pdn_id" + * where "port" is the port number and "pdn_id" is the PDN ID. + * Example: "8080:1", port 8080 PDN ID 1. + * Example: "42:0", port 42 PDN ID 0. + */ +#define AI_PDNSERV 0x1000 + +/* NCS specific send() and sendto() flags */ + +/** Request a blocking send operation until the request is acknowledged. + * When used in send() or sendto(), the request will not return until the + * send operation is completed by lower layers, or until the timeout, given by the SO_SNDTIMEO + * socket option, is reached. Valid timeout values are 1 to 600 seconds. + */ +#define MSG_WAITACK 0x200 + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ From 19efc58959be53320f4de816d0b74c1d49d80485 Mon Sep 17 00:00:00 2001 From: Sigvart Hovland Date: Fri, 3 May 2019 14:21:52 +0200 Subject: [PATCH 0436/3334] [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition Manager (PM) is a component of the nRF Connect SDK (NCS) which uses yaml files to resolve flash partition placement with a holistic view of the entire device, including each firmware image present on the flash device, and various subsystems, such as settings and NFFS. When this NCS extension is used, various source files which would use partition information from devicetree in "vanilla" zephyr instead use defines generated by PM instead. This commit removes support for HEX_FILES_TO_MERGE, as it conflicts with PM. The settings subsystem pm.yml defines a partition 'settings_storage'. The nffs subsystem pm.yml defines 'nffs_storage'. Leverage label translation to avoid patching partition names. Refer to the NCS documentation page for this feature for more details. This is a long-running out of tree patch which has been worked on by several people. The following sign-offs are in alphabetical order by first name. Signed-off-by: Andrzej Głąbek Signed-off-by: Andrzej Puzdrowski Signed-off-by: Håkon Øye Amundsen Signed-off-by: Ioannis Glaropoulos Signed-off-by: Joakim Andersson Signed-off-by: Johann Fischer Signed-off-by: Martí Bolívar Signed-off-by: Ole Sæther Signed-off-by: Robert Lubos Signed-off-by: Sebastian Bøe Signed-off-by: Sigvart Hovland Signed-off-by: Thomas Stenersen Signed-off-by: Torsten Rasmussen Signed-off-by: Øyvind Rønningstad Signed-off-by: Trond Einar Snekvik Signed-off-by: Gerard Marull-Paretas Signed-off-by: Tomasz Moń Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit 647d49255139d093398afa05da01e7d8f82dfa32) --- arch/arm/core/mpu/arm_mpu_regions.c | 13 +++++ cmake/linker/ld/target.cmake | 1 + cmake/linker/lld/target.cmake | 1 + cmake/modules/kernel.cmake | 4 ++ drivers/flash/soc_flash_nrf.c | 11 ++++ drivers/flash/soc_flash_nrf_rram.c | 11 ++++ .../arch/arm/cortex_m/scripts/linker.ld | 50 +++++++++++++++++++ include/zephyr/storage/flash_map.h | 6 +++ lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 18 ++++++- subsys/dfu/boot/mcuboot_shell.c | 40 +++++++++++++++ subsys/fs/littlefs_fs.c | 7 ++- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ++++++++++ 13 files changed, 187 insertions(+), 4 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 0bf7a219c27d..383fd573513c 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,6 +8,9 @@ #include #include +#if USE_PARTITION_MANAGER +#include +#endif static const struct arm_mpu_region mpu_regions[] = { #ifdef CONFIG_XIP @@ -24,6 +27,14 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -31,6 +42,8 @@ static const struct arm_mpu_region mpu_regions[] = { #else REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif + +#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index 592596576d11..ccf6a1903162 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,6 +80,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index 96df1c123796..fe8aad62c73d 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,6 +52,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index c6319611c8c3..5c8fa184b208 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -256,3 +256,7 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() + +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 9e1ba68319ff..574739082dc4 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,6 +37,11 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -166,6 +171,12 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index 9f0e24dc33d5..84c7e958f3cd 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,6 +54,11 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -292,6 +297,12 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index 688165d0698b..c8579f2a8023 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,6 +34,39 @@ #define ROMSTART_REGION ROMABLE_REGION #endif +#if USE_PARTITION_MANAGER + +#include + +#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ + +#define ROM_ADDR PM_ADDRESS +#define ROM_SIZE PM_SIZE + +#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) +#define RAM_SIZE CONFIG_PM_SRAM_SIZE +#else +#define RAM_SIZE PM_SRAM_SIZE +#endif +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -55,6 +88,23 @@ #define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 6ce33c859632..9dc6bd91438f 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -348,6 +348,10 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + /** * Returns non-0 value if fixed-partition or fixed-subpartition of given * DTS node label exists. @@ -517,6 +521,8 @@ DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) #undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index 0d97da3e340b..9a39ab8ad73b 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -81,7 +81,7 @@ config HEAP_LISTENER choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) + default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) && !PARTITION_MANAGER_ENABLED default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 2b01e152f009..2821ae8173ac 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,6 +25,20 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); +#if USE_PARTITION_MANAGER + +#include + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + +#define RAM_SIZE (KB((size_t) CONFIG_SRAM_SIZE)) +#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS + +#endif /* USE_PARTITION_MANAGER */ + #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -106,8 +120,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ - ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((RAM_SIZE - \ + ((size_t) HEAP_BASE - (size_t) RAM_ADDR)), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index be4e558713f1..e167bc1e39b8 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,6 +20,16 @@ #endif #endif +#if USE_PARTITION_MANAGER +#include + +#ifdef CONFIG_NCS_IS_VARIANT_IMAGE +#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif + struct area_desc { const char *name; unsigned int id; @@ -93,6 +103,35 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ +#if USE_PARTITION_MANAGER +#ifdef PM_MCUBOOT_ID + if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { + shell_error(sh, "Cannot erase boot partition"); + return -EACCES; + } +#endif + +#ifdef PM_APP_ID + if (id == PM_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef PM_MCUBOOT_PRIMARY_APP_ID + if (id == PM_MCUBOOT_PRIMARY_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef ACTIVE_IMAGE_ID + if (id == ACTIVE_IMAGE_ID) { + shell_error(sh, "Cannot erase active partitions"); + return -EACCES; + } +#endif +#else #if FIXED_PARTITION_EXISTS(boot_partition) if (id == FIXED_PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -105,6 +144,7 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } +#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index 7cf8aaa44c7b..5abbf95f949e 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1103,7 +1103,12 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ + .storage_dev = (void *) \ + COND_CODE_1(USE_PARTITION_MANAGER, \ + (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ + (FIXED_PARTITION_ID(littlefs_storage)), \ + (FIXED_PARTITION_ID(storage)))), \ + (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index a74e46b85207..9996e1d74d9b 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,8 +13,35 @@ extern "C" { #endif +#if CONFIG_PARTITION_MANAGER_ENABLED + +#include "pm_config.h" + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) +#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE +#else +/* The current image is a child image in a different domain than the image + * which defined the required values. To reach the values of the parent domain + * we use the 'PM__' variant of the define. + */ +#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ + +#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ + +#else + +#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) +#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) + +#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From 88523835cd867c28c27dfd933b19eb3e59b6b086 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Fri, 17 May 2024 14:10:51 +0200 Subject: [PATCH 0437/3334] [nrf noup] kernel: Disable boot banner if NCS_BOOT_BANNER is enabled Zephyr's boot banner should not be used if NCS boot banner is enabled. Signed-off-by: Robert Lubos (cherry picked from commit 2327549dddcadd9fbc67e1a1556f8cd3abbdcd93) --- kernel/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/Kconfig b/kernel/Kconfig index 3d33a7995ae0..d46026508ae6 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -457,6 +457,7 @@ config SKIP_BSS_CLEAR config BOOT_BANNER bool "Boot banner" default y + depends on !NCS_BOOT_BANNER select PRINTK select EARLY_CONSOLE help From 11670b5620de6d0b7496c70527032ac9331e8667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Fri, 31 May 2024 08:21:51 +0200 Subject: [PATCH 0438/3334] =?UTF-8?q?[nrf=20noup]=C2=A0Bluetooth:=20Mesh:?= =?UTF-8?q?=20remove=20legacy=20adv=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes explicit support for the legacy advertiser due to incompatibility with SDC. The legacy advertiser can be used (experimentally) with the Zephyr Link Layer enabled, but is not recommended. Signed-off-by: Håvard Reierstad (cherry picked from commit c5e400e6f08975864436765573339f85770132f0) --- subsys/bluetooth/mesh/Kconfig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 351b18b88e9a..38a39af2820d 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -59,12 +59,16 @@ choice BT_MESH_ADV menuconfig BT_MESH_ADV_LEGACY bool "Legacy advertising" + depends on BT_LL_SW_SPLIT help Use legacy advertising commands for mesh sending. Legacy - advertising is significantly slower than the extended advertising, but - is supported by all controllers. + advertising is significantly slower than the extended advertising. - WARNING: The legacy advertiser can occasionally do more message + WARNING: This feature is not supported in NCS. The legacy advertiser will not work + with SDC, as attempting to start an advertisement during the scanner duty cycle + will result in an error. The Zephyr Link Layer can be used experimentally as an + alternative. + The legacy advertiser can occasionally do more message retransmissions than requested because of limitations of HCI interface API. From dc6ba5504883223dffaa0a96f4b99a5b0f83a778 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 5 Jun 2024 13:37:34 +0100 Subject: [PATCH 0439/3334] [nrf noup] board: nordic: thingy53: Default to update only MCUboot type Changes the default MCUboot mode to update only for the thingy53, to align with previous bootloader builds Changes the thingy53 default configuration for sysbuild to enable using all RAM in the MCUboot image Signed-off-by: Jamie McCrae (cherry picked from commit ae6b1946db253cbe27ade7cc6c05183f17774adf) --- boards/nordic/thingy53/Kconfig.sysbuild | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index c03d191b3708..df489c1dd546 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -7,6 +7,10 @@ choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice +choice MCUBOOT_MODE + default MCUBOOT_MODE_OVERWRITE_ONLY +endchoice + config SECURE_BOOT_NETCORE default y @@ -16,6 +20,9 @@ config NETCORE_APP_UPDATE config NRF_DEFAULT_EMPTY default y if SECURE_BOOT_NETCORE +config MCUBOOT_USE_ALL_AVAILABLE_RAM + default y if BOARD_THINGY53_NRF5340_CPUAPP_NS && BOOTLOADER_MCUBOOT + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY From 166df2e6a793043ee6e275b8d526768944c7410b Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 12 Jun 2024 16:15:29 +0200 Subject: [PATCH 0440/3334] [nrf noup] samples: sysbuild: hello_world: support PM on nRF53 PM support is still required for nRF53/nRF54l15 in the context of NCS. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit d35eee4b7b5cf3bb320af52b1c1bc2a0e0c766fb) --- samples/sysbuild/hello_world/sysbuild.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index c7c2615c665a..8f8fc49dbff3 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -11,5 +11,17 @@ ExternalZephyrProject_Add( BOARD ${SB_CONFIG_REMOTE_BOARD} ) +if(SB_CONFIG_SOC_SERIES_NRF53X) + set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) + set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) + set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) + set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") +else(SB_CONFIG_SOC_SERIES_NRF54LX) + set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) + set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) + set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) + set(CPUFLPR_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") +endif() + add_dependencies(${DEFAULT_IMAGE} remote) sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote) From 726425bfc28f2408dcc66417939bb5e3e97ffca7 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Mon, 25 Sep 2023 16:41:15 +0200 Subject: [PATCH 0441/3334] [nrf noup] settings: nvs: use dedicated lookup cache hash function Introduce NVS_LOOKUP_CACHE_FOR_SETTINGS Kconfig option that enables a dedicated hash function for the NVS lookup cache that takes advantage of the NVS ID allocation scheme used by the NVS settings backend. As such, this option should only be used if an application uses NVS via the settings layer. Signed-off-by: Damian Krolik (cherry picked from commit 68a9eccac6042a3ef299d671ac16105a7b80c2b9) --- subsys/fs/nvs/Kconfig | 9 +++++++++ subsys/fs/nvs/nvs.c | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/subsys/fs/nvs/Kconfig b/subsys/fs/nvs/Kconfig index 48915c2f048e..21798932f521 100644 --- a/subsys/fs/nvs/Kconfig +++ b/subsys/fs/nvs/Kconfig @@ -29,6 +29,15 @@ config NVS_LOOKUP_CACHE_SIZE Number of entries in Non-volatile Storage lookup cache. It is recommended that it be a power of 2. +config NVS_LOOKUP_CACHE_FOR_SETTINGS + bool "Non-volatile Storage lookup cache optimized for settings" + depends on NVS_LOOKUP_CACHE + help + Use the lookup cache hash function that results in the least number of + collissions and, in turn, the best NVS performance provided that the NVS + is used as the settings backend only. This option should NOT be enabled + if the NVS is also written to directly, outside the settings layer. + config NVS_DATA_CRC bool "Non-volatile Storage CRC protection on the data" help diff --git a/subsys/fs/nvs/nvs.c b/subsys/fs/nvs/nvs.c index 8a710d570fb1..f36d5b76dd56 100644 --- a/subsys/fs/nvs/nvs.c +++ b/subsys/fs/nvs/nvs.c @@ -13,6 +13,11 @@ #include #include "nvs_priv.h" +#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS +#include +#include +#endif + #include LOG_MODULE_REGISTER(fs_nvs, CONFIG_NVS_LOG_LEVEL); @@ -21,6 +26,45 @@ static int nvs_ate_valid(struct nvs_fs *fs, const struct nvs_ate *entry); #ifdef CONFIG_NVS_LOOKUP_CACHE +#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS + +static inline size_t nvs_lookup_cache_pos(uint16_t id) +{ + /* + * 1. The NVS settings backend uses up to (NVS_NAME_ID_OFFSET - 1) NVS IDs to + store keys and equal number of NVS IDs to store values. + * 2. For each key-value pair, the value is stored at NVS ID greater by exactly + * NVS_NAME_ID_OFFSET than NVS ID that holds the key. + * 3. The backend tries to minimize the range of NVS IDs used to store keys. + * That is, NVS IDs are allocated sequentially, and freed NVS IDs are reused + * before allocating new ones. + * + * Therefore, to assure the least number of collisions in the lookup cache, + * the least significant bit of the hash indicates whether the given NVS ID + * represents a key or a value, and remaining bits of the hash are set to + * the ordinal number of the key-value pair. Consequently, the hash function + * provides the following mapping: + * + * 1st settings key => hash 0 + * 1st settings value => hash 1 + * 2nd settings key => hash 2 + * 2nd settings value => hash 3 + * ... + */ + BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAMECNT_ID), "NVS_NAMECNT_ID is not power of 2"); + BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAME_ID_OFFSET), "NVS_NAME_ID_OFFSET is not power of 2"); + + uint16_t key_value_bit; + uint16_t key_value_ord; + + key_value_bit = (id >> LOG2(NVS_NAME_ID_OFFSET)) & 1; + key_value_ord = id & (NVS_NAME_ID_OFFSET - 1); + + return ((key_value_ord << 1) | key_value_bit) % CONFIG_NVS_LOOKUP_CACHE_SIZE; +} + +#else /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ + static inline size_t nvs_lookup_cache_pos(uint16_t id) { uint16_t hash; @@ -36,6 +80,8 @@ static inline size_t nvs_lookup_cache_pos(uint16_t id) return hash % CONFIG_NVS_LOOKUP_CACHE_SIZE; } +#endif /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ + static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) { int rc; From d20c47b85b2ded6bb902954f18b4daded254dbe0 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Mon, 8 Jul 2024 10:08:10 +0200 Subject: [PATCH 0442/3334] [nrf noup] ci: Enable action-manifest-pr This action will automatically manage a PR to sdk-nrf once a PR to sdk-zephyr is created. This includes: - Creating an initial PR - Updating and (optionally) rebase it once the PR to sdk-nrf is merged. The action can be disabled by adding the string "manifest-pr-skip" to the title or body of the PR. This will simplify cherry-picking changes from upstream zephyr. Signed-off-by: Rubin Gerritsen (cherry picked from commit c8be59d0c1ac954d0318d67ac0c2559b33b2fa7c) --- .github/workflows/manifest-PR.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/manifest-PR.yml diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml new file mode 100644 index 000000000000..a871aa381ded --- /dev/null +++ b/.github/workflows/manifest-PR.yml @@ -0,0 +1,17 @@ +name: handle manifest PR +on: + pull_request_target: + types: [opened, synchronize, closed] + branches: + - main + + +jobs: + call-manifest-pr-action: + runs-on: ubuntu-latest + steps: + - name: handle manifest PR + uses: nrfconnect/action-manifest-pr@main + with: + token: ${{ secrets.NCS_GITHUB_TOKEN }} + manifest-pr-title-details: ${{ github.event.pull_request.title }} From ffd7e53f74c26648be3fa6320f8b3a544f010f94 Mon Sep 17 00:00:00 2001 From: Mateusz Michalek Date: Mon, 17 Jun 2024 14:57:09 +0200 Subject: [PATCH 0443/3334] [nrf noup] drivers: flash: kconfig: nrf_rram region resolution adjusting region resolution to match erase-block-size Signed-off-by: Mateusz Michalek (cherry picked from commit d8c4ba187461529b84a1a5a26984a2b372edd7ce) --- 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 b40bb16968bf..d8a5abf64b2e 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -77,14 +77,14 @@ config SOC_FLASH_NRF_TIMEOUT_MULTIPLIER config NRF_RRAM_REGION_ADDRESS_RESOLUTION hex - default 0x400 + default 0x1000 help RRAMC's region protection address resolution. Applies to region with configurable start address. config NRF_RRAM_REGION_SIZE_UNIT hex - default 0x400 + default 0x1000 help Base unit for the size of RRAMC's region protection. From f65b03997a63031a1393f7c4612aa099d2297d70 Mon Sep 17 00:00:00 2001 From: Sigurd Hellesvik Date: Fri, 23 Aug 2024 11:24:06 +0200 Subject: [PATCH 0444/3334] [nrf noup] board: nordic_ thingy53: Enable QSPI by default The Thingy:53 enabled MCUboot and external flash by default. Therefore, it should also enable drivers for its external flash by default. Signed-off-by: Sigurd Hellesvik (cherry picked from commit bdef61c8307093d8ef590bb6533c8d8dbd2d412c) --- boards/nordic/thingy53/Kconfig.defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index badcb5c20e5d..b7f33e89bf1b 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -97,6 +97,9 @@ config MCUBOOT_USB_SUPPORT bool default n +config NORDIC_QSPI_NOR + default y + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From f7c0fe841bc5c675f28daf3df5b774471b810fcf Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 26 Sep 2024 12:40:33 +0200 Subject: [PATCH 0445/3334] [nrf noup] samples: basic: blinky: add eGPIO tests configuration Add overlay for nrf54l15dk to enable eGPIO tests. Signed-off-by: Jakub Zymelka Signed-off-by: Marcin Szymczyk (cherry picked from commit f817be34d8ca3c390a7388da456a50e287b22b15) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay diff --git a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay new file mode 100644 index 000000000000..bd1ceb2f8945 --- /dev/null +++ b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&led0 { + gpios = <&hpf_gpio 9 GPIO_ACTIVE_HIGH>; +}; From 82cb1d57ad9bb855515f932534c6bd112d999919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 11 Sep 2024 10:17:28 +0200 Subject: [PATCH 0446/3334] [nrf noup] modules: mbedtls: Disable configurations in Kconfig.tls-generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit prevents legacy mbed TLS configurations from being in conflict with PSA Configurations while using nrf_security. -This [nrf noup] is reworked from an earlier cherry-pick of commit d8c96cfab37d3738dac933075780f6ca24593447, but has the following changes: - Endif's relevant that is using our pattern for masking configs duplicated or in conflict in nrf_security (by using if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)) is made clearer by adding a comment at their corresponding endif (# !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)) - Changes to zephyr_init.c for entropy_dev checking for CONFIG_NRF_CC3XX_PLATFORM is removed as the symbol entropy_dev doesn't exist in this file anymore ref: NCSDK-13503 Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 0a47507eb080ab772f851dea47e44893e4335b28) --- modules/mbedtls/Kconfig.mbedtls | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 4a71ec496142..df2422d4c1e5 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -7,6 +7,8 @@ menu "Mbed TLS configuration" depends on MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-mbedtls.h" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + menu "TLS" config MBEDTLS_TLS_VERSION_1_2 @@ -40,6 +42,8 @@ endif # MBEDTLS_TLS_VERSION_1_2 || MBEDTLS_TLS_VERSION_1_3 endmenu # TLS +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + menu "Ciphersuite configuration" comment "Supported key exchange modes" @@ -60,6 +64,8 @@ config MBEDTLS_GENPRIME_ENABLED endif # MBEDTLS_RSA_C +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_MD @@ -92,6 +98,8 @@ config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED bool "RSA-PSK based ciphersuite modes" depends on MBEDTLS_PKCS1_V15 || MBEDTLS_PKCS1_V21 +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -99,6 +107,8 @@ config MBEDTLS_PSK_MAX_LEN Max size of TLS pre-shared keys, in bytes. It has no effect if no PSK key exchange is used. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "RSA-only based ciphersuite modes" depends on MBEDTLS_MD @@ -236,8 +246,12 @@ config MBEDTLS_ECP_NIST_OPTIM endif +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Supported ciphers and cipher modes" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers and modes" select MBEDTLS_CIPHER_AES_ENABLED @@ -328,8 +342,12 @@ config MBEDTLS_CMAC bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers." depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Supported hash algorithms" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_HASH_ALL_ENABLED bool "All available MAC methods" select MBEDTLS_MD5 @@ -370,10 +388,14 @@ config MBEDTLS_SHA512 config MBEDTLS_POLY1305 bool "Poly1305 hash family" +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + endmenu comment "Random number generators" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CTR_DRBG_ENABLED bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED @@ -383,15 +405,21 @@ config MBEDTLS_HMAC_DRBG_ENABLED bool "HMAC_DRBG random generator" select MBEDTLS_MD +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Other configurations" config MBEDTLS_CIPHER bool "generic cipher layer." default y if PSA_WANT_ALG_CMAC +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_MD bool "generic message digest layer." +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ASN1_PARSE_C bool "Support for ASN1 parser functions" @@ -431,6 +459,8 @@ config MBEDTLS_HAVE_ASM of asymmetric cryptography, however this might have an impact on the code size. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ENTROPY_C bool "Mbed TLS entropy accumulator" depends on MBEDTLS_SHA256 || MBEDTLS_SHA384 || MBEDTLS_SHA512 @@ -439,6 +469,8 @@ config MBEDTLS_ENTROPY_C mostly used in conjunction with CTR_DRBG or HMAC_DRBG to create a deterministic random number generator. +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ENTROPY_POLL_ZEPHYR bool "Provide entropy data to Mbed TLS through entropy driver or random generator" default y From 61ce2d882c57bb597a46dc04ec73d24a99402760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Mon, 9 Sep 2024 14:55:05 +0200 Subject: [PATCH 0447/3334] [nrf noup] mbedtls: Enable PSA_WANT_GENERATE_RANDOM for PSA RNG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] because PSA_WANT_GENERATE_RANDOM is a Nordic configuration that is not found upstream. This was previously in commit 5cfe5750b622efff77427425bf61854a95ade9fb but has been split out Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit d76ed2156a33ac9555abb9c2ba353c5b982ad17a) --- drivers/entropy/Kconfig.psa_crypto | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/entropy/Kconfig.psa_crypto b/drivers/entropy/Kconfig.psa_crypto index d06001225b05..18514a071d1c 100644 --- a/drivers/entropy/Kconfig.psa_crypto +++ b/drivers/entropy/Kconfig.psa_crypto @@ -7,6 +7,7 @@ config ENTROPY_PSA_CRYPTO_RNG bool "PSA Crypto Random source Entropy driver" depends on DT_HAS_ZEPHYR_PSA_CRYPTO_RNG_ENABLED select ENTROPY_HAS_DRIVER + select PSA_WANT_GENERATE_RANDOM default y help Enable the PSA Crypto source Entropy driver. From f6c0e6227ff71f6a0dddfbd086f4d90306ceca39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:35:25 +0200 Subject: [PATCH 0448/3334] [nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit is a [nrf noup] because it removes configuration options for cryptographic algortihms available in Mbed TLS but which is not actively supported in nRF Connect SDK. The list of algorithms removed: - AES CFB - Cipher Feedback block cipher - AES OFB - Output Feedback block cipher - FFDH - RIPEMD160 - Aria - Camellia - DES The removal of these algorithms is based both on a wish to remove weaker cryptography and unsupported features in the products we have today. Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 7f3d02e9eac7962bb4f77040c507afd4325c9e15) --- modules/mbedtls/Kconfig.psa.auto | 61 ------------------------------- modules/mbedtls/Kconfig.psa.logic | 7 ---- 2 files changed, 68 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 08b1bbc02410..56a81dd6efda 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -36,10 +36,6 @@ config PSA_WANT_ALG_CMAC bool "PSA_WANT_ALG_CMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_CFB - bool "PSA_WANT_ALG_CFB" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_ALG_CHACHA20_POLY1305 bool "PSA_WANT_ALG_CHACHA20_POLY1305" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -60,10 +56,6 @@ config PSA_WANT_ALG_ECDH bool "PSA_WANT_ALG_ECDH" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_FFDH - bool "PSA_WANT_ALG_FFDH" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_ALG_ECDSA bool "PSA_WANT_ALG_ECDSA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -96,9 +88,6 @@ config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_OFB - bool "PSA_WANT_ALG_OFB" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -108,9 +97,6 @@ config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_RIPEMD160 - bool "PSA_WANT_ALG_RIPEMD160" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -228,26 +214,6 @@ config PSA_WANT_ECC_SECP_R1_521 bool "PSA_WANT_ECC_SECP_R1_521" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_DH_RFC7919_2048 - bool "PSA_WANT_DH_RFC7919_2048" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_3072 - bool "PSA_WANT_DH_RFC7919_3072" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_4096 - bool "PSA_WANT_DH_RFC7919_4096" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_6144 - bool "PSA_WANT_DH_RFC7919_6144" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_8192 - bool "PSA_WANT_DH_RFC7919_8192" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_DERIVE bool "PSA_WANT_KEY_TYPE_DERIVE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -268,30 +234,15 @@ config PSA_WANT_KEY_TYPE_AES bool "PSA_WANT_KEY_TYPE_AES" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_ARIA - bool "PSA_WANT_KEY_TYPE_ARIA" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_CAMELLIA - bool "PSA_WANT_KEY_TYPE_CAMELLIA" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DES - bool "PSA_WANT_KEY_TYPE_DES" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY - bool "PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_RAW_DATA bool "PSA_WANT_KEY_TYPE_RAW_DATA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -328,16 +279,4 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - endif # PSA_CRYPTO_CLIENT diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index 972054e105b0..9c3a55ea3191 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -47,10 +47,3 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC - bool - default y - depends on PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT || \ - PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT || \ - PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE From 7b3b6f1e251be8f3c0cbeef0418ef83f541f65af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:49:58 +0200 Subject: [PATCH 0449/3334] [nrf noup] mbedtls: Add dependency logic for PSA crypto configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] as this the upstream version of PSA crypto configs is generated by tooling, and there is no mechanisms to qualify that dependent configurations are enabled (by depends or select). -This adds dependency-mapping between configurations in the Kconfigs added for PSA crypto in upstream. -Selecting CHACHA20 key type if PSA_WANT_ALG_STREAM_CIPHER is enabled Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 986ba03091e540b5d64f7f5465a48d88c8a529e1) --- modules/mbedtls/Kconfig.psa.auto | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 56a81dd6efda..fa8cdbc7b536 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -71,6 +71,7 @@ config PSA_WANT_ALG_GCM config PSA_WANT_ALG_HKDF bool "PSA_WANT_ALG_HKDF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_HKDF_EXTRACT bool "PSA_WANT_ALG_HKDF_EXTRACT" if !MBEDTLS_PROMPTLESS @@ -92,11 +93,12 @@ config PSA_WANT_ALG_MD5 config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + depends on PSA_WANT_ALG_CMAC config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -153,18 +155,22 @@ config PSA_WANT_ALG_SHA3_512 config PSA_WANT_ALG_STREAM_CIPHER bool "PSA_WANT_ALG_STREAM_CIPHER" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + select PSA_WANT_KEY_TYPE_CHACHA20 config PSA_WANT_ALG_TLS12_PRF bool "PSA_WANT_ALG_TLS12_PRF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_PSK_TO_MS bool "PSA_WANT_ALG_TLS12_PSK_TO_MS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS bool "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_SHA_256 config PSA_WANT_ECC_BRAINPOOL_P_R1_256 bool "PSA_WANT_ECC_BRAINPOOL_P_R1_256" if !MBEDTLS_PROMPTLESS @@ -237,7 +243,8 @@ config PSA_WANT_KEY_TYPE_AES config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + depends on PSA_WANT_ALG_CHACHA20_POLY1305 || \ + PSA_WANT_ALG_STREAM_CIPHER config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS @@ -253,30 +260,37 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL endif # PSA_CRYPTO_CLIENT From c85ef306b1a58c9ed57b0ee3185b025401773df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:53:27 +0200 Subject: [PATCH 0450/3334] [nrf noup] mbedtls: Adding helptext warnings for weak crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit is a [nrf noup] because PSA crypto configs in upstream Zephyr doesn't have help-text in their configurations and we don't want to duplicate configurations to control the value -This adds warning for SHA-1 and MD5 usage Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 6a1fabd1938bfce76b859fba7040a6cbcf24041b) --- modules/mbedtls/Kconfig.psa.auto | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index fa8cdbc7b536..834252432b52 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -88,7 +88,9 @@ config PSA_WANT_ALG_HMAC config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + help + Warning: The MD5 hash is weak and deprecated and is only recommended + for use in legacy protocols. config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -119,6 +121,9 @@ config PSA_WANT_ALG_RSA_PSS config PSA_WANT_ALG_SHA_1 bool "PSA_WANT_ALG_SHA_1" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + help + Warning: The SHA-1 hash is weak and deprecated and is only recommended + for use in legacy protocols. config PSA_WANT_ALG_SHA_224 bool "PSA_WANT_ALG_SHA_224" if !MBEDTLS_PROMPTLESS From 2c73db0cf52ab4670770061de00485acca9af2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:56:48 +0200 Subject: [PATCH 0451/3334] [nrf noup] mbedtls: Adding missing configuration for RSA key type derive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] because the upstream Zephyr is generated using a script and is not committed as-is as source-code. The relevant responsible person for this feature has received information about the missing configuration and this will be resolved upstream in Mbed TLS and will propagate down to zephyr. Once this has happened, this [nrf noup] can be dropped. -Add missing PSA_WANT_KEY_TYPE_RSA_KEY_DERIVE Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit ea825d0870dde7f98ced0798a99827ccc011be03) --- modules/mbedtls/Kconfig.psa.auto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 834252432b52..b235c30380fb 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -298,4 +298,9 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE + bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + default y if PSA_CRYPTO_ENABLE_ALL + endif # PSA_CRYPTO_CLIENT From 2579412c828f02d1e40424e4698590c91d185f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 5 Sep 2024 15:05:43 +0200 Subject: [PATCH 0452/3334] [nrf noup] mbedtls: Don't select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC is internally resolved by Mbed TLS. It has been made promptless in a previous commit. Keeping this change separated since the Kconfig.psa is auto-generated and it would likely be a bit more complex to handle this in a single commit. Upstream maintainers have been notified about this mismatch in configurations. Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 006009543398a8acf347ae56feb7b4b4e32fb415) --- modules/mbedtls/Kconfig.mbedtls | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index df2422d4c1e5..b0077361908c 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -117,6 +117,7 @@ config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE if PSA_CRYPTO_CLIENT + select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE if PSA_CRYPTO_CLIENT config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED bool "DHE-RSA based ciphersuite modes" From 19fcc84b983e4d184492e3f4e97654acab089fec Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 7 May 2024 08:27:09 +0100 Subject: [PATCH 0453/3334] [nrf noup] kernel: banner: Make function weak Makes the boot banner function weak, this resolves an issue when building with llext enabled which uses different build options than a normal zephyr build Signed-off-by: Jamie McCrae (cherry picked from commit ce51dfa849174003ee646f97b3977f0fbbad54ed) --- kernel/banner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/banner.c b/kernel/banner.c index 5cadda0a5e98..a16784cb975c 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 2aa414a3ac39577a553c4ab2b7a0ded8558ab9a6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 20 Sep 2024 14:48:37 +0200 Subject: [PATCH 0454/3334] [nrf noup] lib: os: zvfs: Remove EXPERIMENTAL from ZVFS Although ZVFS is experimental, the warning is annoying the matter team. Therefore, remove the experimental selection. This may be reverted once upstream unselects experimental. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit d1d91126f5d593c7d3ce443e94be81fc3c200252) --- lib/os/zvfs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index a9c9518a1d5d..495d5c849685 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 4a986ba1947915c34d1127c823c529b6b52e2c0b Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 7 Oct 2024 15:36:43 +0200 Subject: [PATCH 0455/3334] [nrf noup] samples: net: Enable Wi-Fi driver in sysbuild builds Make sure Wi-Fi driver is enabled in networking samples supporting Wi-Fi when sysbuild is used. For shields we cannot automate this, as sysbuild doesn't recognize shields, so, Wi-Fi has to be explicitly enabled, this is done for twister in Wi-Fi sample. Signed-off-by: Robert Lubos Signed-off-by: Chaitanya Tata (cherry picked from commit 256095442e0d410b1829e3266cb94e4e12802f3e) --- samples/net/dns_resolve/Kconfig.sysbuild | 13 +++++++++++++ samples/net/ipv4_autoconf/Kconfig.sysbuild | 13 +++++++++++++ samples/net/lwm2m_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mdns_responder/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mqtt_publisher/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mqtt_sn_publisher/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/coap_server/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_async/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_server/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/http_get/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/sntp_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/syslog_net/Kconfig.sysbuild | 13 +++++++++++++ samples/net/telnet/Kconfig.sysbuild | 13 +++++++++++++ samples/net/wifi/Kconfig.sysbuild | 13 +++++++++++++ samples/net/wifi/shell/sample.yaml | 2 ++ 16 files changed, 197 insertions(+) create mode 100644 samples/net/dns_resolve/Kconfig.sysbuild create mode 100644 samples/net/ipv4_autoconf/Kconfig.sysbuild create mode 100644 samples/net/lwm2m_client/Kconfig.sysbuild create mode 100644 samples/net/mdns_responder/Kconfig.sysbuild create mode 100644 samples/net/mqtt_publisher/Kconfig.sysbuild create mode 100644 samples/net/mqtt_sn_publisher/Kconfig.sysbuild create mode 100644 samples/net/sockets/coap_server/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_async/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_client/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_server/Kconfig.sysbuild create mode 100644 samples/net/sockets/http_get/Kconfig.sysbuild create mode 100644 samples/net/sockets/sntp_client/Kconfig.sysbuild create mode 100644 samples/net/syslog_net/Kconfig.sysbuild create mode 100644 samples/net/telnet/Kconfig.sysbuild create mode 100644 samples/net/wifi/Kconfig.sysbuild diff --git a/samples/net/dns_resolve/Kconfig.sysbuild b/samples/net/dns_resolve/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/dns_resolve/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/ipv4_autoconf/Kconfig.sysbuild b/samples/net/ipv4_autoconf/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/ipv4_autoconf/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/lwm2m_client/Kconfig.sysbuild b/samples/net/lwm2m_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/lwm2m_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mdns_responder/Kconfig.sysbuild b/samples/net/mdns_responder/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mdns_responder/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_publisher/Kconfig.sysbuild b/samples/net/mqtt_publisher/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mqtt_publisher/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/coap_server/Kconfig.sysbuild b/samples/net/sockets/coap_server/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/coap_server/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_async/Kconfig.sysbuild b/samples/net/sockets/echo_async/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_async/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_client/Kconfig.sysbuild b/samples/net/sockets/echo_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_server/Kconfig.sysbuild b/samples/net/sockets/echo_server/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_server/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/http_get/Kconfig.sysbuild b/samples/net/sockets/http_get/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/http_get/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/sntp_client/Kconfig.sysbuild b/samples/net/sockets/sntp_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/sntp_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/syslog_net/Kconfig.sysbuild b/samples/net/syslog_net/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/syslog_net/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/telnet/Kconfig.sysbuild b/samples/net/telnet/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/telnet/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/Kconfig.sysbuild b/samples/net/wifi/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/wifi/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index 5f72e0686116..8543e6bfb38b 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -58,6 +58,7 @@ tests: - nrf7002dk/nrf5340/cpuapp/nrf7001 sample.net.wifi.nrf7002ek: extra_args: + - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002ek platform_allow: @@ -69,6 +70,7 @@ tests: sample.net.wifi.nrf7002eb: extra_args: - CONFIG_NRF70_UTIL=y + - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002eb platform_allow: From 0a26136810a384b6fd09339d4f2e72428eb0753e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 13:49:59 +0200 Subject: [PATCH 0456/3334] [nrf noup] mbedtls: Don't enable auto-generation of Mbed TLS files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - We don't use this mechanism in nRF Connect SDK Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 19d7a298e884afc9284ef55b60361f2fe1478784) --- tests/crypto/mbedtls/CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/crypto/mbedtls/CMakeLists.txt b/tests/crypto/mbedtls/CMakeLists.txt index 7ebdc9d76a9a..47670bead010 100644 --- a/tests/crypto/mbedtls/CMakeLists.txt +++ b/tests/crypto/mbedtls/CMakeLists.txt @@ -6,15 +6,5 @@ project(mbedtls) set(output_file ${PROJECT_BINARY_DIR}/mbedtls-check.timestamp) -add_custom_command( - COMMENT "Check Mbed TLS auto-generated files" - COMMAND - ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/modules/mbedtls/create_psa_files.py --check - OUTPUT - ${output_file} -) - -add_custom_target(check_mbedtls_auto_generated_files ALL DEPENDS ${output_file}) - FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) From b3b8a6d583656f514d3c8906bf29f5b26eb66842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 14:05:41 +0200 Subject: [PATCH 0457/3334] [nrf noup] net: tests: Add legacy crypto API support for big_http_download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -We handle legacy Crypto API support specially (favoring PSA crypto) the tests here require MD interface to build, which needs the config MBEDTLS_LEGACY_CRYPTO_C to be enable to get access to Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 0ebf737a1471a9955e8408882709f83eb12df80d) --- samples/net/sockets/big_http_download/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/net/sockets/big_http_download/prj.conf b/samples/net/sockets/big_http_download/prj.conf index a406f314dfb2..8677e7113e4b 100644 --- a/samples/net/sockets/big_http_download/prj.conf +++ b/samples/net/sockets/big_http_download/prj.conf @@ -3,6 +3,7 @@ CONFIG_REQUIRES_FULL_LIBC=y CONFIG_MBEDTLS=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_MD=y +CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y CONFIG_MAIN_STACK_SIZE=2536 # Networking config From d362d275f37ae7526714a3b715575a6870848acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 14:31:02 +0200 Subject: [PATCH 0458/3334] [nrf noup] net: tests: crypto: Adding legacy Crypto support ipv6 tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This adds crypto support for ipv6 tests by enabling CONFIG_MBEDTLS_LEGACY_CRYPTO_C Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit fb992dc4a1b1ed9c2b5cf37e0e3773190fa3d9a1) --- tests/net/ipv6/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index 9f9f21d59050..6a6be5dba36a 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -33,6 +33,7 @@ CONFIG_NET_IF_MAX_IPV6_COUNT=2 CONFIG_NET_IPV6_PE=y CONFIG_NET_IPV6_PE_FILTER_PREFIX_COUNT=2 CONFIG_NET_IPV6_PE_PREFER_PUBLIC_ADDRESSES=n +CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y # Increase the stack a bit for mps2/an385 CONFIG_NET_RX_STACK_SIZE=1700 From 2527560672fbbee00d6fcb7a4f8e78069293368b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayt=C3=BCrk=20D=C3=BCzen?= Date: Wed, 20 Nov 2024 13:06:23 +0100 Subject: [PATCH 0459/3334] [nrf noup] tests: bluetooth: tester: sysbuild configurable 53/54H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for sysbuild 54h20 building added nrf54h20 cpurad configuration to hci_ipc sample. Signed-off-by: Aytürk Düzen Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 8e1224f6248e5bcd82626d0f9a3aaf70e00a510b) --- .../nrf54h20_cpurad-bt_ll_softdevice.conf | 33 +++++++++++++++++++ tests/bluetooth/tester/Kconfig.sysbuild | 1 + tests/bluetooth/tester/sysbuild.cmake | 16 +++++++-- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf diff --git a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf new file mode 100644 index 000000000000..1f7748e5cd7d --- /dev/null +++ b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf @@ -0,0 +1,33 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_ISR_STACK_SIZE=1024 +CONFIG_IDLE_STACK_SIZE=256 +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 +CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y + +CONFIG_BT_BUF_EVT_RX_COUNT=16 +CONFIG_BT_BUF_EVT_RX_SIZE=255 +CONFIG_BT_BUF_ACL_RX_SIZE=255 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_BUF_CMD_TX_SIZE=255 + +# Host +CONFIG_BT_BROADCASTER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_PER_ADV=y +CONFIG_BT_PER_ADV_SYNC=y + +# Controller +CONFIG_BT_LL_SW_SPLIT=n +CONFIG_BT_LL_SOFTDEVICE=y +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/tests/bluetooth/tester/Kconfig.sysbuild b/tests/bluetooth/tester/Kconfig.sysbuild index 69e4d5a97fbe..e14a6e1aa8e0 100644 --- a/tests/bluetooth/tester/Kconfig.sysbuild +++ b/tests/bluetooth/tester/Kconfig.sysbuild @@ -5,6 +5,7 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string + default "nrf54h20dk/nrf54h20/cpurad" if "$(BOARD)" = "nrf54h20dk" default "nrf5340dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340dk" default "nrf5340_audio_dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340_audio_dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP" diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index a9ddf1279471..bcd564733c53 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) - # For builds in the nrf5340, we build the netcore image with the controller - set(NET_APP hci_ipc) set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP}) @@ -13,6 +11,20 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) BOARD ${SB_CONFIG_NET_CORE_BOARD} ) + if(SB_CONFIG_SOC_NRF5340_CPUAPP) + set(${NET_APP}_SNIPPET + "bt-ll-sw-split" + CACHE INTERNAL "" + ) + endif() + + if(SB_CONFIG_SOC_NRF54H20_CPUAPP) + set(${NET_APP}_CONF_FILE + ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf + CACHE INTERNAL "" + ) + endif() + set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" From cff0f47ccddabd30b041f88027047598ca39dea9 Mon Sep 17 00:00:00 2001 From: Ingar Kulbrandstad Date: Tue, 21 May 2024 13:59:58 +0200 Subject: [PATCH 0460/3334] [nrf noup] Bluetooth: Mesh: Disable processing of ext ADV packets Disable processing of extended ADV packets by mesh scanner. This is done to prevent loss of scan time due to reception of pointer packets while scanning for mesh packets. Signed-off-by: Ingar Kulbrandstad (cherry picked from commit 70c54b3250adfa1a55c65371d611e67ec444103e) --- subsys/bluetooth/mesh/Kconfig | 11 +++++++++++ subsys/bluetooth/mesh/adv_ext.c | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 38a39af2820d..069dbe218f5e 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -215,6 +215,17 @@ config BT_MESH_ADV_EXT_FRIEND_SEPARATE messages as close to the start of the ReceiveWindow as possible, thus reducing the scanning time on the Low Power node. +config BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS + bool "Reject or accept extended advertising packets" + depends on BT_LL_SOFTDEVICE + help + Configure the scanner and initiator to either reject or accept extended + advertising packets by the SoftDevice Controller. This is set to false + by default, to prevent loss of scan time when receiving a pointer packet + while scanning for Bluetooth Mesh packets. Set to true if extended + advertising packets are to be received by the SoftDevice Controller for + purposes other than Bluetooth Mesh. + endif # BT_MESH_ADV_EXT endchoice diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 68a6c27beebf..0cfaec39fdb7 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -529,6 +529,18 @@ void bt_mesh_adv_init(void) K_PRIO_COOP(MESH_WORKQ_PRIORITY), NULL); k_thread_name_set(&bt_mesh_workq.thread, "BT MESH WQ"); } + +#if defined(CONFIG_BT_LL_SOFTDEVICE) + const sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t cmd_params = { + .accept_ext_adv_packets = IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS), + }; + + int err = sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set(&cmd_params); + + if (err) { + LOG_ERR("Failed to set accept_ext_adv_packets: %d", err); + } +#endif } static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance) From 6468c47d8ff7eb39c96b7893f33978db1b90991c Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Mon, 16 Jan 2023 14:15:22 +0100 Subject: [PATCH 0461/3334] [nrf noup] dts: choose a crypto accelerator for entropy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a long-term noup patch because crypto driver support is NCS-only for both cryptocell and CRACEN. Set HAS_HW_NRF_CC3XX to be defined in NS build when cryptocell is accessed through the PSA API. We need to know which CC3XX features are available. Set PSA as the entropy source for 54L. PSA is the only NCS-supported interface to CRACEN. Signed-off-by: Georgios Vasilakis Signed-off-by: Joakim Andersson Signed-off-by: Dominik Ermel Signed-off-by: Sebastian Bøe Signed-off-by: Robert Lubos Signed-off-by: Rubin Gerritsen (cherry picked from commit a958627ee65d0536b78bbc4d9fe8473bc6daaecb) --- dts/arm/nordic/nrf52840.dtsi | 4 ++-- dts/arm/nordic/nrf5340_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf91.dtsi | 3 ++- soc/nordic/common/Kconfig.peripherals | 6 ++++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index c0a2545f0137..b04b31a640dc 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -8,7 +8,7 @@ / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -571,7 +571,7 @@ reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>; reg-names = "wrapper", "core"; interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index b9762248a5df..b4c077ea2bf4 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -34,7 +34,7 @@ }; chosen { - zephyr,entropy = &rng_hci; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -104,7 +104,7 @@ reg = <0x50844000 0x1000>, <0x50845000 0x1000>; reg-names = "wrapper", "core"; interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index ee8be4b8d765..fa269e71c37e 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -18,7 +18,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -34,7 +34,7 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 2ef4b9bbab20..31cbe7d9ea41 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -28,6 +28,7 @@ }; chosen { + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -51,7 +52,7 @@ reg = <0x50840000 0x1000>, <0x50841000 0x1000>; reg-names = "wrapper", "core"; interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; ctrlap: ctrlap@50006000 { diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index d7e489b446a5..fa7fd2a411aa 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -13,10 +13,12 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) || \ + ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91X) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \ + ($(dt_nodelabel_enabled,psa_rng) && SOC_NRF5340_CPUAPP) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM)) From db894542538d1c8afe8a8f5416c2f2472a9a5f79 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 21 Jun 2024 13:25:22 +0200 Subject: [PATCH 0462/3334] [nrf noup] soc: nrf54l: Add custom section for KMU Add a custom section in the linker which should always be placed in the top of RAM. This will be used by the KMU to push keys into it. Since when you provision a key into the KMU you need to set specific a memory location for the PUSH operation we need to keep this memory location static across images/dfus. The linker script inclusion which places the KMU reserved buffer on the top of RAM doesn't work for non-XIP builds. The Zephyr linker script will firstly load the code for an non-XIP build in RAM and then include this KMU related linker script which results in an unpredictable placement of the KMU reserved area and a failed build. In order to support non-XIP builds the linker file is not included and the a DTS reserved-memory entry should be used. To limit the scope, the DTS reserved memory region is currently only supported for non-XIP builds. This is a noup since the KMU is not supported upstream. Ref: NCSDK-25121 Signed-off-by: Georgios Vasilakis Signed-off-by: Robin Kastberg (cherry picked from commit 44394717ff162b2fe2f65ef763b3ba0b1b09f736) (cherry picked from commit 8feaa71acf41265c163c09a871833bd1bc3bc439) (cherry picked from commit e4fed30aa551c61e1f2890811198b6ac9064b59a) --- soc/nordic/nrf54l/CMakeLists.txt | 13 +++++++++++++ soc/nordic/nrf54l/kmu_push_area_section.ld | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 soc/nordic/nrf54l/kmu_push_area_section.ld diff --git a/soc/nordic/nrf54l/CMakeLists.txt b/soc/nordic/nrf54l/CMakeLists.txt index cebbda571b68..b220b9d2a7a2 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -6,3 +6,16 @@ zephyr_library_sources( ../validate_rram_partitions.c ) zephyr_include_directories(.) + +dt_nodelabel(kmu_push_area_node NODELABEL nrf_kmu_reserved_push_area) + +# We need a buffer in memory in a static location which can be used by +# the KMU peripheral. The KMU has a static destination address, we chose +# this address to be 0x20000000, which is the first address in the SRAM. +if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND NOT kmu_push_area_node) +# 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) + +zephyr_linker_section(NAME ".nrf_kmu_reserved_push_area" ADDRESS "${RAM_ADDR}" GROUP RAM_REGION NOINIT) +endif() diff --git a/soc/nordic/nrf54l/kmu_push_area_section.ld b/soc/nordic/nrf54l/kmu_push_area_section.ld new file mode 100644 index 000000000000..e8c8cd9f09ad --- /dev/null +++ b/soc/nordic/nrf54l/kmu_push_area_section.ld @@ -0,0 +1,19 @@ +# This section must be loaded first of all the +# custom sections because we want it to be placed +# at the top address of RAM. +SECTION_PROLOGUE(NRF_KMU_RESERVED_PUSH_SECTION,(NOLOAD) ,) +{ + __nrf_kmu_reserved_push_area = .; + *(.nrf_kmu_reserved_push_area) + __nrf_kmu_reserved_push_area_end = .; +} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) + +# It doesn't seem to be possible to enforce placing a section +# at a specific address in memory using the Zephyr SECTION macros. +# So this assert is necessary to avoid accidentatly moving this +# section to a different address. +ASSERT(__nrf_kmu_reserved_push_area == RAM_ADDR, "Error: \ + The section NRF_KMU_RESERVED_PUSH_SECTION needs to be \ + placed on the top RAM address but it is not, please edit \ + your linker scripts to make sure that it is placed on \ + the to RAM address.") From e404d8bae28549eb35fc207141e3037219213194 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 12 Dec 2024 07:58:06 +0000 Subject: [PATCH 0463/3334] [nrf noup] samples/tests: Add TF-M sysbuild config files Fixes some issues with samples/tests by adding configuration files to satisfy TF-M requirements Signed-off-by: Jamie McCrae (cherry picked from commit 9fec410b2e42217813da8a4f79870ad6e20e57a3) --- samples/subsys/usb/dfu/sysbuild.conf | 1 + tests/drivers/flash/common/sysbuild.conf | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 samples/subsys/usb/dfu/sysbuild.conf delete mode 100644 tests/drivers/flash/common/sysbuild.conf diff --git a/samples/subsys/usb/dfu/sysbuild.conf b/samples/subsys/usb/dfu/sysbuild.conf new file mode 100644 index 000000000000..47f00ff3cff8 --- /dev/null +++ b/samples/subsys/usb/dfu/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/drivers/flash/common/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n From 83ee44f5f9f464c472c150e59c889499744ff3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 10:48:30 +0100 Subject: [PATCH 0464/3334] [nrf noup] Revert "mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ac6d8342728c8a63f9fea965ce41610618aeed5a. Temporarily revert an upstream change that leads to a Kconfig dependency loop with MBEDTLS_CIPHER_AES_ENABLED. This is supposed to be replaced with a better fix later. Signed-off-by: Andrzej Głąbek (cherry picked from commit 9195b19d9233885bbaa9fb542d4de27517c62306) --- modules/mbedtls/Kconfig.mbedtls | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index b0077361908c..b4932b31635f 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -283,7 +283,6 @@ config MBEDTLS_SOME_CIPHER_ENABLED config MBEDTLS_CIPHER_AES_ENABLED bool "AES block cipher" - default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C if MBEDTLS_CIPHER_AES_ENABLED From 97662003001131768dffc7ec052ade4142ebbb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grochala?= Date: Fri, 31 Jan 2025 16:09:26 +0000 Subject: [PATCH 0465/3334] [nrf noup] bluetooth: Temporary Kconfig fix for BT RPC configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The BT_DRIVERS symbol default value 'y' used to depend on !BT_CTLR but now it is always on when BT is set. For BT_RPC the BT_DRIVERS symbol must not be enabled on the client side as no driver is used. The temporary solution is to set BT_DRIVERS to 'y' by default only when BT_HCI stack selection is enabled. It will be 'n' when BT_RPC_STACK is enabled. The fix should be fine as NCS uses either HCI or RPC stack. Signed-off-by: Michał Grochala (cherry picked from commit 3b4dafb8804dee63a4b668beade865d6003a2bf7) --- drivers/bluetooth/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index a1680af6583d..e64a33f663ce 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -12,7 +12,7 @@ menuconfig BT_DRIVERS bool "Bluetooth drivers" default y - depends on BT + depends on BT && BT_HCI if BT_DRIVERS From a21f2c7449457ad53ef9ed60f3a4783efe9cfca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Tue, 4 Feb 2025 14:55:58 +0100 Subject: [PATCH 0466/3334] [nrf noup] ble: Adding missing AES config for BT_CRYPTO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Adding imply MBEDTLS_CIPHER_AES_ENABLED if not TF-M build in BT_CRYPTO -Needed to set a specific symbol for MBEDTLS + MBEDTLS_BUILTIN to work on network core build. -This [nrf noup] can be removed once PSA crypto is fully supported in network core, or PSA crypto is not compiled in at all and is provided as a RPC-mechanism via the app-core Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 754de059b64b9d52628b8669e86c7acc17a96aa0) --- subsys/bluetooth/crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/crypto/Kconfig b/subsys/bluetooth/crypto/Kconfig index e9234e4157b3..0e382060278a 100644 --- a/subsys/bluetooth/crypto/Kconfig +++ b/subsys/bluetooth/crypto/Kconfig @@ -7,6 +7,7 @@ config BT_CRYPTO select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_CMAC select PSA_WANT_ALG_ECB_NO_PADDING + imply MBEDTLS_CIPHER_AES_ENABLED if !BUILD_WITH_TFM imply MBEDTLS_AES_ROM_TABLES if MBEDTLS_PSA_CRYPTO_C help This option enables the Bluetooth Cryptographic Toolbox. From fe3a3d0941063e3b4207b3593f5165ce12449474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 22 Oct 2024 08:55:47 +0200 Subject: [PATCH 0467/3334] [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added ncs-specific modules to nrfx_config_reserved_resources. The modules are: - mpsl - nrfe Signed-off-by: Rafał Kuźnia Signed-off-by: Nikodem Kastelik Co-authored-by: Krzysztof Chruściński Signed-off-by: Eivind Jølsgard Signed-off-by: Aleksandar Stanoev Signed-off-by: Piotr Pryga (cherry picked from commit ab1ca10757dfb90a6511123b7cc6b9f82b42505b) --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ++++++++++++++++++ 2 files changed, 949 insertions(+), 1 deletion(-) create mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index f92cefce480e..15ba5475436c 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -1308,6 +1308,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_reserved_resources.h" + default "nrfx_config_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h new file mode 100644 index 000000000000..ec8a9acaf7b5 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h @@ -0,0 +1,948 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ +#define NRFX_CONFIG_RESERVED_RESOURCES_H__ + +/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE130_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) + +/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE131_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) + +/** @brief Bitmask that defines EGU instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_EGUS_USED 0 + +/** @brief Bitmask that defines TIMER instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_TIMERS_USED 0 + +/* If the GRTC system timer driver is to be used, prepare definitions required + * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and + * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. + */ +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) +#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ + (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ + ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) +#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ + (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ + DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ + +/* + * The enabled Bluetooth controller subsystem is responsible for providing + * definitions of the BT_CTLR_USED_* symbols used below in a file named + * bt_ctlr_used_resources.h and for adding its location to global include + * paths so that the file can be included here for all Zephyr libraries that + * are to be built. + */ +#if defined(CONFIG_BT_LL_SW_SPLIT) +#include +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#endif +#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +/* Define auxiliary symbols needed for SDC device dispatch. */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRF52_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRF53_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRF54L_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF71X) +#define NRF71_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRF54H_SERIES +#endif +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_NRF_802154_RADIO_DRIVER) +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#include <../src/nrf_802154_peripherals_nrf52.h> +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#include <../src/nrf_802154_peripherals_nrf53.h> +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#include <../src/nrf_802154_peripherals_nrf54l.h> +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#include <../src/nrf_802154_peripherals_nrf54h.h> +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL +#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL +#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL +#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL +#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL +#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL +#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL +#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL +#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL +#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL +#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL +#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL +#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL +#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL +#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL +#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL +#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL +#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 +#endif + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_CHANNELS_USED \ + (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI0_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_GROUPS_USED \ + (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI0_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_CHANNELS_USED \ + (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI00_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_GROUPS_USED \ + (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI00_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_CHANNELS_USED \ + (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI10_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_GROUPS_USED \ + (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI10_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_CHANNELS_USED \ + (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI20_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_GROUPS_USED \ + (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI20_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_CHANNELS_USED \ + (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI30_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_GROUPS_USED \ + (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI30_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_CHANNELS_USED \ + (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI020_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_GROUPS_USED \ + (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI020_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_CHANNELS_USED \ + (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI030_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_GROUPS_USED \ + (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI030_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_CHANNELS_USED \ + (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI120_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_GROUPS_USED \ + (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI120_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_CHANNELS_USED \ + (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI130_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_GROUPS_USED \ + (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI130_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_CHANNELS_USED \ + (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI131_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_GROUPS_USED \ + (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI131_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_CHANNELS_USED \ + (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI132_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_GROUPS_USED \ + (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI132_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_CHANNELS_USED \ + (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI133_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_GROUPS_USED \ + (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI133_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_CHANNELS_USED \ + (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI134_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_GROUPS_USED \ + (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI134_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_CHANNELS_USED \ + (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI135_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_GROUPS_USED \ + (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI135_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_CHANNELS_USED \ + (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI136_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_GROUPS_USED \ + (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI136_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines PPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_CHANNELS_USED \ + (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) + +#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED +#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED + +/** @brief Bitmask that defines PPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_GROUPS_USED \ + (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ + NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) + +#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ + (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ + (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ + (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ + (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ + (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ + (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ + (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ + NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) + +#if defined(CONFIG_SOFTDEVICE) +#include +#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED +#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED +#else +#define NRFX_PPI_CHANNELS_USED_BY_SD 0 +#define NRFX_PPI_GROUPS_USED_BY_SD 0 +#endif + +#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ From c503c44c0604383f0b486cde3d92e128a343ee50 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 25 Feb 2025 10:35:24 +0100 Subject: [PATCH 0468/3334] [nrf noup] samples: bluetooth: mesh: Disable secure storage for real targets. Mesh currently works with trusted storage on real targets. Until secure storage is supported by default disable it. Signed-off-by: Aleksandr Khromykh (cherry picked from commit 779b99cd58249864a25dffed6f8397c2970d2fff) --- samples/bluetooth/mesh/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh/prj.conf | 2 +- samples/bluetooth/mesh_demo/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh_demo/prj.conf | 2 +- samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh_provisioner/prj.conf | 2 +- samples/boards/nordic/mesh/onoff-app/prj.conf | 2 +- .../nordic/mesh/onoff_level_lighting_vnd_app/prj.conf | 2 +- tests/bluetooth/mesh_shell/boards/qemu_x86.conf | 6 ++++++ tests/bluetooth/mesh_shell/prj.conf | 2 +- 10 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 samples/bluetooth/mesh/boards/qemu_x86.conf create mode 100644 samples/bluetooth/mesh_demo/boards/qemu_x86.conf create mode 100644 samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf create mode 100644 tests/bluetooth/mesh_shell/boards/qemu_x86.conf diff --git a/samples/bluetooth/mesh/boards/qemu_x86.conf b/samples/bluetooth/mesh/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh/prj.conf b/samples/bluetooth/mesh/prj.conf index 14b19316a866..cd7d6532b614 100644 --- a/samples/bluetooth/mesh/prj.conf +++ b/samples/bluetooth/mesh/prj.conf @@ -5,7 +5,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_HWINFO=y CONFIG_BT=y diff --git a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_demo/prj.conf b/samples/bluetooth/mesh_demo/prj.conf index bcb738ae5bd1..b7016b02c65b 100644 --- a/samples/bluetooth/mesh_demo/prj.conf +++ b/samples/bluetooth/mesh_demo/prj.conf @@ -31,7 +31,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y # Limit the number of key slots in PSA Crypto core to reduce # RAM footprint diff --git a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 10949c5480db..241767805164 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -45,7 +45,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y #CONFIG_BT_MESH_LOG_LEVEL_DBG=y #CONFIG_BT_MESH_SETTINGS_LOG_LEVEL_DBG=y diff --git a/samples/boards/nordic/mesh/onoff-app/prj.conf b/samples/boards/nordic/mesh/onoff-app/prj.conf index 0e67042b2653..0783579e795e 100644 --- a/samples/boards/nordic/mesh/onoff-app/prj.conf +++ b/samples/boards/nordic/mesh/onoff-app/prj.conf @@ -9,7 +9,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf index 3bb984208c70..96b5466b4a16 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf @@ -7,7 +7,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT_OBSERVER=y CONFIG_BT_BROADCASTER=y diff --git a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index 2af600295680..aab2745d359f 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT=y CONFIG_BT_OBSERVER=y From 87b955d64661b0e5a3b8637a6c87bc91f6329bb7 Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Fri, 28 Feb 2025 12:27:22 +0100 Subject: [PATCH 0469/3334] [nrf noup] samples: bluetooth: hci_ipc: increase main stack size for Cracen driver on nRF54H20 A larger stack is needed to accomodate the Cracen driver. Signed-off-by: Gordon Klaus (cherry picked from commit 6ae37337c9ddbcf12a64d0ba8c6f8309acc17b38) --- .../bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..296e68366389 --- /dev/null +++ b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,2 @@ +# Increase stack size for Cracen driver. +CONFIG_MAIN_STACK_SIZE=1024 From dd107c19620f0a70d83848bc3928d2eb8b9e6f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Tue, 17 Dec 2024 21:45:47 +0100 Subject: [PATCH 0470/3334] [nrf noup] drivers: spi_dw: Bring back custom EXMIF peripheral handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit brings back modifications from these reverted commits: - f68b2edaa2233cde29d955bc3d3b3dd75ff50334 - e606246f0fc3e9299cb5bdd3c1e34a091e5d85a1 slightly adjusted so that the EXMIF peripheral is still by default handled by the mspi_dw driver, and in cases where this driver cannot be used because something still does not work correctly, one can switch to the old solution based on the tweaked spi_dw driver. Signed-off-by: Andrzej Głąbek (cherry picked from commit f333d984ae6869b309d241ffc252ae20d5e2f319) --- drivers/pinctrl/pinctrl_nrf.c | 3 +- drivers/spi/spi_dw.c | 32 +++++++++++++++++++++- dts/bindings/spi/nordic,nrf-exmif-spi.yaml | 8 ++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 dts/bindings/spi/nordic,nrf-exmif-spi.yaml diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index a9902d33f801..b052e61eb803 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -468,7 +468,8 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) || \ + DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif_spi) /* Pin routing is controlled by secure domain, via UICR */ case NRF_FUN_EXMIF_CK: case NRF_FUN_EXMIF_DQ0: diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index bd10447e4429..6941bfdaaa77 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -41,6 +41,14 @@ LOG_MODULE_REGISTER(spi_dw); #include #endif +#ifdef CONFIG_HAS_NRFX +#include +#endif + +#ifdef CONFIG_SOC_NRF54H20_GPD +#include +#endif + static inline bool spi_dw_is_slave(struct spi_dw_data *spi) { return (IS_ENABLED(CONFIG_SPI_SLAVE) && @@ -258,6 +266,7 @@ static int spi_dw_configure(const struct device *dev, /* Baud rate and Slave select, for master only */ write_baudr(dev, SPI_DW_CLK_DIVIDER(info->clock_frequency, config->frequency)); + write_ser(dev, BIT(config->slave)); } if (spi_dw_is_slave(spi)) { @@ -512,6 +521,10 @@ void spi_dw_isr(const struct device *dev) uint32_t int_status; int error; +#ifdef CONFIG_HAS_NRFX + NRF_EXMIF->EVENTS_CORE = 0; +#endif + int_status = read_isr(dev); LOG_DBG("SPI %p int_status 0x%x - (tx: %d, rx: %d)", dev, int_status, @@ -560,6 +573,18 @@ int spi_dw_init(const struct device *dev) DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); +#ifdef CONFIG_HAS_NRFX + NRF_EXMIF->INTENSET = BIT(0); + NRF_EXMIF->TASKS_START = 1; + +#ifdef CONFIG_SOC_NRF54H20_GPD + err = nrf_gpd_request(NRF_GPD_FAST_ACTIVE1); + if (err < 0) { + return err; + } +#endif +#endif + info->config_func(); /* Masking interrupt and making sure controller is disabled */ @@ -584,6 +609,11 @@ int spi_dw_init(const struct device *dev) return 0; } +#define REG_ADDR(inst) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), nordic_nrf_exmif_spi), \ + (Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(core, DT_DRV_INST(inst))), \ + (DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)))) + #define SPI_CFG_IRQS_SINGLE_ERR_LINE(inst) \ IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, rx_avail, irq), \ DT_INST_IRQ_BY_NAME(inst, rx_avail, priority), \ @@ -656,7 +686,7 @@ COND_CODE_1(IS_EQ(DT_NUM_IRQS(DT_DRV_INST(inst)), 1), \ SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ }; \ static const struct spi_dw_config spi_dw_config_##inst = { \ - DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ + REG_ADDR(inst), \ .clock_frequency = COND_CODE_1( \ DT_NODE_HAS_PROP(DT_INST_PHANDLE(inst, clocks), clock_frequency), \ (DT_INST_PROP_BY_PHANDLE(inst, clocks, clock_frequency)), \ diff --git a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml new file mode 100644 index 000000000000..d988b4146878 --- /dev/null +++ b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic External Memory Interface (EXMIF) used in SPI mode only + +compatible: "nordic,nrf-exmif-spi" + +include: snps,designware-spi.yaml From 61fb90cffe6b7f097c4250adcc35ec2411d6514d Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 20 Nov 2020 14:44:03 +0100 Subject: [PATCH 0471/3334] [nrf noup] Bluetooth: update experimental for qualification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Kconfig options for qualification: - Remove experimental on qualified feature. - Add experimental on unqualified feature. - BT_L2CAP_ECRED is not marked as experimental upstream and we qualify it downstream. Signed-off-by: Joakim Andersson Signed-off-by: Trond Einar Snekvik Signed-off-by: Martí Bolívar Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Ingar Kulbrandstad Signed-off-by: Torsten Rasmussen Signed-off-by: Herman Berget Signed-off-by: Tomasz Moń Signed-off-by: Théo Battrel (cherry picked from commit 27ab3e250737cad1175ef40fd9bcddcc434dd309) --- subsys/bluetooth/controller/Kconfig | 4 +++- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 7fd3c46fe35a..98107940b949 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -138,10 +138,12 @@ config HAS_BT_CTLR bool config BT_LL_SW_SPLIT - bool "Software-based Bluetooth LE Link Layer" + bool "Software-based Bluetooth LE Link Layer [EXPERIMENTAL]" default y depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED select HAS_BT_CTLR + select EXPERIMENTAL + select ENTROPY_GENERATOR help Use Zephyr software Bluetooth LE Link Layer ULL LLL split implementation. diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index 2841e7d8a129..34e862378c5e 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -52,7 +52,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support" + bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From 21e5b2ba250adf950e9d1fbb8a982e75c3cd3e6f Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 21 Mar 2025 14:43:43 +0100 Subject: [PATCH 0472/3334] [nrf noup] tests: crypto: Set size for PSA slot noup since this option does not exist upstream. The Oberon PSA core has an option to manually set the buffer size of the PSA key slots in bytes. This option here: MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE This option has a default value of 16 since it directly affects the memory usage. The crypto tests use a secp256r1 key and thus since the public key for this key is 65 bytes long we need to set the option in the sample. Signed-off-by: Georgios Vasilakis (cherry picked from commit d537f6daddf9c4e699ff433ee748ee6d020e312a) --- tests/crypto/secp256r1/mbedtls.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/crypto/secp256r1/mbedtls.conf b/tests/crypto/secp256r1/mbedtls.conf index bbc2eb0e6563..c4ea620de55f 100644 --- a/tests/crypto/secp256r1/mbedtls.conf +++ b/tests/crypto/secp256r1/mbedtls.conf @@ -1,6 +1,7 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED=y +CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE=65 CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=2 From 941e975e39b65ae6eb9c0eca9354b73d18a16a3d Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Tue, 8 Apr 2025 17:56:00 +0200 Subject: [PATCH 0473/3334] [nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20 The PSA is a cryptographically secure random number generator. It will be enabled by default, eventually, For now, enable it manually. Signed-off-by: Gordon Klaus (cherry picked from commit ac5ae77bd6307a11c0b68201a1f7fdddfa435441) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 ++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 +++++++ tests/bluetooth/tester/sysbuild.cmake | 7 ---- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 40 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 13 ++++++ .../tester/sysbuild/hci_ipc/prj.conf | 23 +++++++++++ 6 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 5bb1c4d82846..51b0ef5fa8d4 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -22,3 +22,10 @@ CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_BTTESTER_LOG_LEVEL_DBG=y CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable PSA RNG +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index e6d4f675f57a..4f9de686b7e5 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,3 +12,17 @@ status = "okay"; hw-flow-control; }; + +// Enable PSA RNG +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; + + /delete-node/ prng; +}; diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index bcd564733c53..b640a7d04936 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -18,13 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) ) endif() - if(SB_CONFIG_SOC_NRF54H20_CPUAPP) - set(${NET_APP}_CONF_FILE - ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf - CACHE INTERNAL "" - ) - endif() - set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..b7d64a9e6a08 --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,40 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_ISR_STACK_SIZE=1024 +CONFIG_IDLE_STACK_SIZE=256 +CONFIG_MAIN_STACK_SIZE=1024 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 +CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y + +CONFIG_BT_BUF_EVT_RX_COUNT=16 +CONFIG_BT_BUF_EVT_RX_SIZE=255 +CONFIG_BT_BUF_ACL_RX_SIZE=255 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_BUF_CMD_TX_SIZE=255 + +# Host +CONFIG_BT_BROADCASTER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_PER_ADV=y +CONFIG_BT_PER_ADV_SYNC=y + +# Controller +CONFIG_BT_LL_SW_SPLIT=n +CONFIG_BT_LL_SOFTDEVICE=y +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 + +# Enable PSA RNG +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..e34567fe834a --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,13 @@ +// Enable PSA RNG +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; + + /delete-node/ prng; +}; diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf new file mode 100644 index 000000000000..08b1aed9e7f6 --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf @@ -0,0 +1,23 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_HEAP_MEM_POOL_SIZE=4096 + +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y +CONFIG_BT_MAX_CONN=16 + + +# Workaround: Unable to allocate command buffer when using K_NO_WAIT since +# Host number of completed commands does not follow normal flow control. +CONFIG_BT_BUF_CMD_TX_COUNT=10 + +# Enable and adjust the below value as necessary +# CONFIG_BT_BUF_EVT_RX_COUNT=16 +# CONFIG_BT_BUF_EVT_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_TX_SIZE=251 +# CONFIG_BT_BUF_CMD_TX_SIZE=255 From b40cd57e43af44bba3585aced15cda9370a1a660 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 30 Nov 2018 14:07:56 +0100 Subject: [PATCH 0474/3334] [nrf noup] ci: NCS-specific CI tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Necessary changes for NCS CI. - Add a Jenkinsfile - Add a commit-tags workflow: This enables sauce tag checking in sdk-zephyr - compliance.yml: Disable check for merge commits, since we have upmerges downstream. Also, since in the code we refer to Kconfig symbols that are defined in the sdk-nrf repository, the Kconfig checks ((SysBuild)Kconfig, (SysBuild)KconfigBasic and (SysBuild)KconfigBasicNoModules) will not pass so exclude them. Also, disable any maintainers-related checks - scripts/gitlint: Extend the max commit line lengths for Gitlint to account for sauce tags - Adapt to the changes in: https://github.com/nrfconnect/action-commit-tags/pull/4 Signed-off-by: Carles Cufi Signed-off-by: Dominik Ermel Signed-off-by: Martí Bolívar Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Krishna T Signed-off-by: Dominik Ermel (cherry picked from commit 8e2a74920f8915c700153a10fd592c0ca96420ec) --- .github/workflows/commit-tags.yml | 28 ++++++++++++++++++++++++++ .github/workflows/compliance.yml | 13 +++++------- Jenkinsfile | 5 +++++ scripts/gitlint/zephyr_commit_rules.py | 4 ++-- 4 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/commit-tags.yml create mode 100644 Jenkinsfile diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml new file mode 100644 index 000000000000..828f02971678 --- /dev/null +++ b/.github/workflows/commit-tags.yml @@ -0,0 +1,28 @@ +name: Commit tags + +on: + pull_request: + types: [synchronize, opened, reopened, edited, labeled, unlabeled, + milestoned, demilestoned, assigned, unassigned, ready_for_review, + review_requested] + +jobs: + commit_tags: + runs-on: ubuntu-22.04 + name: Run commit tags checks on patch series (PR) + steps: + - name: Update PATH for west + run: | + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Checkout the code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Run the commit tags + uses: nrfconnect/action-commit-tags@main + with: + target: . + upstream: zephyrproject-rtos/zephyr/main diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 9d19b5a69e65..0e39baa4732d 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -34,8 +34,8 @@ jobs: git config --global user.name "Your Name" git remote -v # Ensure there's no merge commits in the PR - [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ - (echo "::error ::Merge commits not allowed, rebase instead";false) + #[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ + #(echo "::error ::Merge commits not allowed, rebase instead";false) rm -fr ".git/rebase-apply" rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} @@ -72,12 +72,9 @@ jobs: git log --pretty=oneline | head -n 10 # Increase rename limit to allow for large PRs git config diff.renameLimit 10000 - excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat" - # The signed-off-by check for dependabot should be skipped - if [ "${{ github.actor }}" == "dependabot[bot]" ]; then - excludes="$excludes -e Identity" - fi - ./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}.. + ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic \ + -e Kconfig -e SysbuildKconfig -e KconfigBasicNoModules -e SysbuildKconfigBasicNoModules \ + -e ModulesMaintainers -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000000..3b9cf0022399 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,5 @@ +@Library("CI_LIB") _ + +def pipeline = new ncs.sdk_zephyr.Main() + +pipeline.run(JOB_NAME) diff --git a/scripts/gitlint/zephyr_commit_rules.py b/scripts/gitlint/zephyr_commit_rules.py index a2c9cd3cb7fe..ef317e22684c 100644 --- a/scripts/gitlint/zephyr_commit_rules.py +++ b/scripts/gitlint/zephyr_commit_rules.py @@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule): name = "title-max-length-no-revert" id = "UC5" target = CommitMessageTitle - options_spec = [IntOption('line-length', 75, "Max line length")] + options_spec = [IntOption('line-length', 120, "Max line length")] violation_message = "Commit title exceeds max length ({0}>{1})" def validate(self, line, _commit): @@ -103,7 +103,7 @@ class MaxLineLengthExceptions(LineRule): name = "max-line-length-with-exceptions" id = "UC4" target = CommitMessageBody - options_spec = [IntOption('line-length', 75, "Max line length")] + options_spec = [IntOption('line-length', 120, "Max line length")] violation_message = "Commit message body line exceeds max length ({0}>{1})" def validate(self, line, _commit): From 1b4e0ff6ab4bbf17cd8af3d22a662ab959e9b7dd Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 12 May 2025 08:47:55 +0100 Subject: [PATCH 0475/3334] [nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs Adds symbols used in NCS to the sysbuild Kconfig allow list Signed-off-by: Jamie McCrae (cherry picked from commit 3bfec9b6bca0c63e530becabc1142032524fe194) (cherry picked from commit 74cb5127fb2c2b7e356b6c83c51fee7a5e2b53cc) --- scripts/ci/check_compliance.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 842c0850447e..eded57d639f6 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1446,6 +1446,32 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop + + # NCS-specific allowlist + # zephyr-keep-sorted-start re(^\s+") + "APP_CPUNET_RUN", # Used by sample + "APP_DFU", # Used by sample + "BT_FAST_PAIR", # Legacy/removed, used in migration documentation + "COMP_DATA_LAYOUT_ARRAY", # Used by test + "COMP_DATA_LAYOUT_MULTIPLE", # Used by test + "COMP_DATA_LAYOUT_SINGLE", # Used by test + "DTM_NO_DFE", # Used by DTM application + "DTM_TRANSPORT_HCI", # Used by DTM application + "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation + "INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation + "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "ML_APP_REMOTE_BOARD", # Used by machine learning application + "MY_APP_IMAGE_ABC", # Used in documentation + "NETCORE_ABC", # Used in documentation + "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests + "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation + "SUIT_ENVELOPE_", # Used by jinja + "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation + "SUIT_MPI_", # Used by jinja + "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation + "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample + # zephyr-keep-sorted-stop } From 00f3f51c8ca6c1d8a51fd6f20f90c949071020c5 Mon Sep 17 00:00:00 2001 From: Robert Stypa Date: Wed, 18 Jun 2025 07:45:47 +0200 Subject: [PATCH 0476/3334] [nrf noup] ci: Update CI-boot-test patterns and remove SUIT labels Add boards/nordic/**/* to the CI-boot-test scope and remove SUIT labels. Signed-off-by: Robert Stypa (cherry picked from commit aa22106bd1ca6c8be630a91683ab1c0524d7d4ef) --- .github/test-spec.yml | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 6da6bdbaa87d..5337249f7dab 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,6 +39,7 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": + - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" @@ -364,29 +365,3 @@ - "tests/boards/nordic/**/*" - "tests/drivers/**/*" - "tests/kernel/**/*" - -"CI-suit-dfu-test": - - "subsys/mgmt/mcumgr/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "subsys/bluetooth/**/*" - - "drivers/bluetooth/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/console/**/*" - - "drivers/gpio/**/*" - - "dts/common/nordic/*" - - "dts/arm/nordic/nrf54h*/**/*" - - "dts/riscv/nordic/nrf54h*/**/*" - - "boards/nordic/nrf54h*/**/*" - - "soc/nordic/nrf54h/**/*" - - "include/zephyr/**/*" - - "subsys/logging/**/*" - - "subsys/tracing/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/nrfutil.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" From 1bf617dae64055105957d594f872d9f56f975cc0 Mon Sep 17 00:00:00 2001 From: Richa Pandey Date: Thu, 19 Jun 2025 11:07:37 +0200 Subject: [PATCH 0477/3334] [nrf noup] zephyr: doc: fix board page Fixed board page in zephyr. Signed-off-by: Richa Pandey (cherry picked from commit b93147c7494304f3f332f01934c3fec47e3f87d2) --- boards/index.rst | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/boards/index.rst b/boards/index.rst index 3cc92770cfeb..2ffe426fc24b 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -12,33 +12,8 @@ template available under :zephyr_file:`doc/templates/board.tmpl`. Shields are hardware add-ons that can be stacked on top of a board to add extra functionality. Refer to the :ref:`shield_porting_guide` for more information on how to port a shield. -.. admonition:: Search Tips - :class: dropdown - - * Use the form below to filter the list of supported boards and shields. If a field is left - empty, it will not be used in the filtering process. - - * Filtering by name and vendor is available for both boards and shields. The rest of the fields - apply only to boards. - - * A board/shield must meet **all** criteria selected across different fields. For example, if you - select both a vendor and an architecture, only boards that match both will be displayed. Within - a single field, selecting multiple options (such as two architectures) will show boards - matching **either** option. - - * The list of supported hardware features for each board is automatically generated using - information from the Devicetree. It may not be reflecting the full list of supported features - since some of them may not be enabled by default. - - * Can't find your exact board? Don't worry! If a similar board with the same or a closely related - MCU exists, you can use it as a :ref:`starting point ` for adding - support for your own board. - .. toctree:: :maxdepth: 2 :glob: - :hidden: */index - -.. zephyr:board-catalog:: From 4994883cb4f5b53f64c5909798a5dfd6ee79e376 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 10 Jun 2025 23:20:32 +0200 Subject: [PATCH 0478/3334] [nrf noup] bluetooth: host: Add support for bonding with same peer This commit adds a new Kconfig option by enabling which Host will keep bonding with the same Central instead of rejecting pairing. Brief implementation details: This implementation adds a new flag to bt_keys struct: BT_KEYS_ID_CONFLICT. The flag is set, when: - bonding with the same peer and conflict identified - when loading conflicting keys from persistent storage. When bonding and conflict is identified, the new keys aren't added to the Resolving List immediately. Instead, the old keys stay in the Resolving List. When start advertising, Host finds conflicting keys that are already added to the Resolving List and substitues them. If, however, there is another advertiser already started for the added keys, the new request is reject and advertising start function returns -EPERM. This is supported by Peripheral role only for now. Allow to use CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS Kconfig option even if CONFIG_BT_PRIVACY is disabled. This is because CONFIG_BT_PRIVACY configures privacy of local device will still allows to resolve peer address. During pairing, peer device may send its Identity Address and IRK which then can be used for address resolution. This doesn't require CONFIG_BT_PRIVACY be enabled. Signed-off-by: Pavel Vasilyev (cherry picked from commit 8e030eadc7edc6b92ea0812b4ba85943b361765c) (cherry picked from commit 72becd444df29326d03f7374c21f0e73e3641ac1) --- include/zephyr/bluetooth/bluetooth.h | 10 ++ subsys/bluetooth/host/Kconfig | 18 +++ subsys/bluetooth/host/adv.c | 52 +++++++ subsys/bluetooth/host/adv.h | 1 + subsys/bluetooth/host/hci_core.h | 23 ++- subsys/bluetooth/host/id.c | 219 ++++++++++++++++++++++++--- subsys/bluetooth/host/id.h | 23 +++ subsys/bluetooth/host/keys.c | 79 +++++++++- subsys/bluetooth/host/keys.h | 6 + subsys/bluetooth/host/smp.c | 18 ++- tests/bluetooth/host/id/mocks/adv.c | 1 + tests/bluetooth/host/id/mocks/adv.h | 4 +- tests/bluetooth/host/id/mocks/keys.c | 1 + tests/bluetooth/host/id/mocks/keys.h | 4 +- 14 files changed, 427 insertions(+), 32 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 8e738d21970d..0739733c9543 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1295,6 +1295,10 @@ struct bt_le_per_adv_param { * This error code is only guaranteed when using Zephyr * controller, for other controllers code returned in * this case may be -EIO. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_adv_start(const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, @@ -1422,6 +1426,12 @@ struct bt_le_ext_adv_start_param { * * @param adv Advertising set object. * @param param Advertise start parameters. + * + * @return Zero on success or (negative) error code otherwise. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, const struct bt_le_ext_adv_start_param *param); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 862f71c3651c..0d0bfd20a883 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -658,6 +658,24 @@ config BT_ID_UNPAIR_MATCHING_BONDS link-layer. The Host does not have control over this acknowledgment, and the order of distribution is fixed by the specification. +config BT_ID_AUTO_SWAP_MATCHING_BONDS + bool "Automatically swap conflicting entries in the Resolving List" + depends on !BT_ID_UNPAIR_MATCHING_BONDS + depends on BT_SMP && BT_PERIPHERAL && !BT_CENTRAL + help + If this option is enabled, the Host will not add a new bond with + the same peer address (or IRK) to the Resolving List if there is + already a bond with the same peer address (or IRK) on another local + identity. + + In case of Peripheral, the Host will swap the existing entry in the + Resolving List with the new one, so that the new bond will be used for + address resolution for the new local identity if the device starts + advertising with the new local identity. + + Important: this option is supported exclusively in the Peripheral + role. Excluding the Central role. + config BT_ID_ALLOW_UNAUTH_OVERWRITE bool "Allow unauthenticated pairing with same peer with other local identity" depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index e4ad43bea565..3a17a7192535 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -234,6 +234,25 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) #endif /* CONFIG_BT_BROADCASTER */ #endif /* defined(CONFIG_BT_EXT_ADV) */ +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id) +{ +#if defined(CONFIG_BT_EXT_ADV) + for (size_t i = 0; i < ARRAY_SIZE(adv_pool); i++) { + if (atomic_test_bit(adv_pool[i].flags, BT_ADV_CREATED) && + adv_pool[i].id == id) { + return &adv_pool[i]; + } + } +#else + if (atomic_test_bit(bt_dev.adv.flags, BT_ADV_CREATED) && bt_dev.adv.id == id) { + return &bt_dev.adv; + } +#endif + + return NULL; +} + + void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), void *data) { @@ -929,6 +948,14 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, adv->id = param->id; bt_dev.adv_conn_id = adv->id; + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = bt_id_set_adv_own_addr(adv, param->options, dir_adv, &set_param.own_addr_type); if (err) { @@ -1212,6 +1239,15 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } adv->id = param->id; + + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = le_ext_adv_param_set(adv, param, sd != NULL); if (err) { return err; @@ -1499,6 +1535,22 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, return -EALREADY; } + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + const bt_addr_le_t *peer; + + if (bt_addr_le_eq(&adv->target_addr, BT_ADDR_LE_ANY)) { + peer = NULL; + } else { + peer = &adv->target_addr; + } + + err = bt_id_resolving_list_check_and_update(adv->id, peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index 6cc950fe8e7f..a6f7007f64b4 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -23,3 +23,4 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable); int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv); void bt_adv_reset_adv_pool(void); +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index e4a390af20aa..e17277ba4da2 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -497,7 +497,28 @@ struct bt_keys; void bt_id_add(struct bt_keys *keys); void bt_id_del(struct bt_keys *keys); -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate); +/** @brief Find a conflict in the resolving list for a candidate IRK. + * + * @param candidate The candidate keys to check for conflicts. + * @param all If true, check all IRKs, otherwise check only added keys. + * + * @return The conflicting key if there is one, or NULL if no conflict was found. + */ +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool all); + +/** * @brief Find multiple conflicts in the resolving list for a candidate IRK. + * + * This function iterates over all keys (added and not added to the Resolving List). If there are + * multiple conflicts, this function will return true. Otherwise, it will return false. + * + * If @c firt_conflict is not NULL, it will be set to the first found conflict. + * + * @param candidate The candidate key to check for conflicts. + * @param first_conflict Pointer to store the first found conflict, if any. Can be NULL. + * + * @return True if there are multiple conflicts, otherwise it returns false. + */ +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict); int bt_setup_random_id_addr(void); int bt_setup_public_id_addr(void); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 0ed84dff7331..4c54460ab4df 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -941,9 +941,33 @@ void bt_id_pending_keys_update(void) } } +static bool keys_conflict_check(const struct bt_keys *candidate, const struct bt_keys *resident) +{ + bool addr_conflict; + bool irk_conflict; + + addr_conflict = bt_addr_le_eq(&candidate->addr, &resident->addr); + + /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ + irk_conflict = (!bt_irk_eq(&candidate->irk, &(struct bt_irk){}) && + bt_irk_eq(&candidate->irk, &resident->irk)); + + if (addr_conflict || irk_conflict) { + LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&candidate->addr), + bt_hex(candidate->irk.val, sizeof(candidate->irk.val))); + + return true; + } + + return false; +} + struct bt_id_conflict { struct bt_keys *candidate; struct bt_keys *found; + bool check_all_irk; }; /* The Controller Resolve List is constrained by 7.8.38 "LE Add Device To @@ -955,8 +979,6 @@ struct bt_id_conflict { static void find_rl_conflict(struct bt_keys *resident, void *user_data) { struct bt_id_conflict *conflict = user_data; - bool addr_conflict; - bool irk_conflict; __ASSERT_NO_MSG(conflict != NULL); __ASSERT_NO_MSG(conflict->candidate != NULL); @@ -969,32 +991,26 @@ static void find_rl_conflict(struct bt_keys *resident, void *user_data) } /* Test against committed bonds only. */ - if ((resident->state & BT_KEYS_ID_ADDED) == 0) { + if (!conflict->check_all_irk && (resident->state & BT_KEYS_ID_ADDED) == 0) { + /* If the resident bond is not committed, we cannot have a conflict. */ return; } - addr_conflict = bt_addr_le_eq(&conflict->candidate->addr, &resident->addr); - - /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ - irk_conflict = (!bt_irk_eq(&conflict->candidate->irk, &(struct bt_irk){}) && - bt_irk_eq(&conflict->candidate->irk, &resident->irk)); - - if (addr_conflict || irk_conflict) { - LOG_DBG("Resident : addr %s and IRK %s, id: %d", bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val)), resident->id); - LOG_DBG("Candidate: addr %s and IRK %s, id: %d", - bt_addr_le_str(&conflict->candidate->addr), - bt_hex(conflict->candidate->irk.val, sizeof(conflict->candidate->irk.val)), - conflict->candidate->id); + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + if (keys_conflict_check(conflict->candidate, resident)) { conflict->found = resident; } } -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_irk) { struct bt_id_conflict conflict = { .candidate = candidate, + .check_all_irk = check_all_irk, }; bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict, &conflict); @@ -1002,6 +1018,59 @@ struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) return conflict.found; } +struct bt_id_conflict_multiple { + struct bt_keys *candidate; + struct bt_keys *found; + bool found_multiple; +}; + +void find_rl_conflict_multiple(struct bt_keys *resident, void *user_data) +{ + struct bt_id_conflict_multiple *conflict = user_data; + + __ASSERT_NO_MSG(conflict != NULL); + __ASSERT_NO_MSG(conflict->candidate != NULL); + __ASSERT_NO_MSG(resident != NULL); + + if (conflict->found_multiple) { + /* If we already found enough conflicts, we can stop searching. */ + return; + } + + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + + if (keys_conflict_check(conflict->candidate, resident)) { + if (conflict->found) { + conflict->found_multiple = true; + + LOG_WRN("Found multiple conflicts for %s: addr %s and IRK %s", + bt_addr_le_str(&conflict->candidate->addr), + bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + } else { + conflict->found = resident; + } + } +} + +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict) +{ + struct bt_id_conflict_multiple conflict = { + .candidate = candidate, + }; + + bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict_multiple, &conflict); + + if (first_conflict != NULL) { + *first_conflict = conflict.found; + } + + return conflict.found_multiple; +} + void bt_id_add(struct bt_keys *keys) { CHECKIF(keys == NULL) { @@ -1264,6 +1333,122 @@ void bt_id_del(struct bt_keys *keys) bt_le_ext_adv_foreach(adv_unpause_enabled, NULL); } } + +static int conflict_check_and_replace(uint8_t id, struct bt_keys *keys) +{ + /* For the given key check if it has conflicts with other keys in the Resolving List + * (such keys have BT_KEYS_ID_ADDED state and BT_KEYS_ID_CONFLICT flag set). If it does, we + * need to remove the conflicting key from the Resolving List and add the new key. + * + * If the key is not in the Resolving List, we can add the new key right away. + * + * If advertiser for the conflicting key is enabled, we cannot remove the key from the + * Resolving List, so we return an error. + */ + + struct bt_keys *conflict; + const struct bt_le_ext_adv *adv; + + if (!(keys->flags & BT_KEYS_ID_CONFLICT)) { + LOG_DBG("Key has no conflicts for id %u addr %s", id, bt_addr_le_str(&keys->addr)); + return 0; + } + + if (keys->state & BT_KEYS_ID_ADDED) { + LOG_DBG("Key is already added to resolving list for id %u addr %s", id, + bt_addr_le_str(&keys->addr)); + return 0; + } + + /* bt_id_find_conflict returns only keys added to the Resolving List (state is + * BT_KEYS_ID_ADDED). If the key has conflict, but no keys were added (for example, if the + * last added key was removed after bt_unpair()), then this function will return NULL. Then, + * we don't need to remove a conflicting key from the Resolving List. Otherwise, we need to + * remove the conflicting key from the Resolving List before adding the new key. + */ + conflict = bt_id_find_conflict(keys, false); + if (conflict != NULL) { + __ASSERT_NO_MSG((conflict->flags & BT_KEYS_ID_CONFLICT) != 0); + + LOG_DBG("Found conflicting key with id %u addr %s", conflict->id, + bt_addr_le_str(&conflict->addr)); + + adv = bt_adv_lookup_by_id(conflict->id); + if (adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { + LOG_WRN("Cannot remove the conflicting key from the Resolving List while" + " advertising"); + return -EPERM; + } + + /* Drop BT_KEYS_ID_PENDING_DEL flag if we were about to delete the keys since we + * delete it here. + */ + conflict->state &= ~BT_KEYS_ID_PENDING_DEL; + bt_id_del(conflict); + } + + bt_id_add(keys); + + return 0; +} + +struct bt_id_resolve { + uint8_t id; + int err; +}; + +static void check_and_add_keys_for_id(struct bt_keys *keys, void *data) +{ + struct bt_id_resolve *resolve = data; + + if (resolve->err) { + /* Skipping other keys because we got error. */ + return; + } + + if (resolve->id != keys->id) { + /* We are only interested in keys for the given id */ + return; + } + + resolve->err = conflict_check_and_replace(resolve->id, keys); +} + +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer) +{ + int err; + + if (peer == NULL) { + struct bt_id_resolve resolve = { + .id = id, + }; + + LOG_DBG("Updating resolving list for id %u without peer address", id); + + bt_keys_foreach_type(BT_KEYS_IRK, check_and_add_keys_for_id, &resolve); + err = resolve.err; + } else { + struct bt_keys *keys; + + LOG_DBG("Updating resolving list for id %u addr %s", id, bt_addr_le_str(peer)); + + keys = bt_keys_get_addr(id, peer); + if (!keys) { + LOG_DBG("No keys found for id %u addr %s", id, bt_addr_le_str(peer)); + return -ENOENT; + } + + err = conflict_check_and_replace(id, keys); + } + + if (err) { + LOG_ERR("Failed to update resolving list for id %u addr %s (err %d)", id, + peer ? bt_addr_le_str(peer) : "NULL", err); + return err; + } + + return err; +} #endif /* defined(CONFIG_BT_SMP) */ void bt_id_get(bt_addr_le_t *addrs, size_t *count) diff --git a/subsys/bluetooth/host/id.h b/subsys/bluetooth/host/id.h index 8824d3bb496b..cd66784a5037 100644 --- a/subsys/bluetooth/host/id.h +++ b/subsys/bluetooth/host/id.h @@ -60,3 +60,26 @@ void bt_id_pending_keys_update(void); void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag); void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv); + +/** + * @brief Check and update the resolving list for a given identity. + * + * This function checks if the resolving list contains the keys for the given + * identity and peer address. If the keys are not present, it adds them to the + * resolving list. If the keys are present, it checks for conflicts with + * existing keys in the resolving list. If a conflict is found, it replaces + * the conflicting key with the new key. + * + * If the peer address is NULL, it updates the resolving list for all keys that belong to the given + * identity. + * + * If for any of the keys belonging to the given identity a conflict is found and the advertiser for + * that key is enabled, the function returns an error. + * + * @param id The identity ID to check and update. + * @param peer The peer address to check against the resolving list. + * + * @return 0 on success, or a negative error code on failure. + * @return -EPERM if a conflict is found and the advertiser for the conflicting key is enabled. + */ +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer); diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 1205494e856f..e2116f3bedeb 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -310,16 +310,57 @@ void bt_keys_add_type(struct bt_keys *keys, enum bt_keys_type type) keys->keys |= type; } +static void add_id_cb(struct k_work *work) +{ + bt_id_pending_keys_update(); +} + +static K_WORK_DEFINE(add_id_work, add_id_cb); + void bt_keys_clear(struct bt_keys *keys) { + struct bt_keys *conflict = NULL; + __ASSERT_NO_MSG(keys != NULL); LOG_DBG("%s (keys 0x%04x)", bt_addr_le_str(&keys->addr), keys->keys); + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + (keys->flags & BT_KEYS_ID_CONFLICT) != 0) { + /* We need to check how many conflicting keys left. If there is only one conflicting + * key left, we can remove the BT_KEYS_ID_CONFLICT flag from it so that Host don't + * need to check and update the Resolving List whenever this is needed. The key + * should be re-added to the Resolving List. + */ + bool found_multiple; + + found_multiple = bt_id_find_conflict_multiple(keys, &conflict); + if (conflict) { + if (found_multiple || (conflict->state & BT_KEYS_ID_ADDED) != 0) { + /* If we found multiple conflicting keys or the conflicting key + * is already added to the ID list, we don't need to clear the + * conflict flag for it and re-add it to the Resolving List. + */ + conflict = NULL; + } else { + /* Clear the conflict flag for the conflicting key */ + conflict->flags &= ~BT_KEYS_ID_CONFLICT; + } + } + } + if (keys->state & BT_KEYS_ID_ADDED) { bt_id_del(keys); } + if (conflict) { + /* Re-add the conflicting key to the Resolving List if it was the last conflicting + * key. + */ + bt_id_pending_keys_update_set(conflict, BT_KEYS_ID_PENDING_ADD); + k_work_submit(&add_id_work); + } + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { /* Delete stored keys from flash */ bt_settings_delete_keys(keys->id, &keys->addr); @@ -347,6 +388,28 @@ int bt_keys_store(struct bt_keys *keys) return 0; } +static void check_and_set_id_conflict_flag(struct bt_keys *keys) +{ + struct bt_keys *conflict; + + if (!IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + /* If auto-swap is not enabled, we don't need to check for conflicts */ + return; + } + + /* Use bt_id_find_conflict() to check if there are any conflicting keys for the given keys. + * If there is at least one, set the BT_KEYS_ID_CONFLICT flag for both the keys and the + * conflicting key. + */ + conflict = bt_id_find_conflict(keys, true); + if (conflict != NULL) { + LOG_DBG("Found conflicting key %p.", conflict); + + keys->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + } +} + static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { @@ -427,6 +490,8 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, memcpy(keys->storage_start, val, len); } + check_and_set_id_conflict_flag(keys); + LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { @@ -436,17 +501,17 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return 0; } -static void add_id_cb(struct k_work *work) -{ - bt_id_pending_keys_update(); -} - -static K_WORK_DEFINE(add_id_work, add_id_cb); - static void id_add(struct bt_keys *keys, void *user_data) { __ASSERT_NO_MSG(keys != NULL); + if (keys->flags & BT_KEYS_ID_CONFLICT) { + /* If the keys have the conflict flag set, we don't want to add them to the ID list, + * as this will cause issues with resolving list. + */ + return; + } + bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD); k_work_submit(&add_id_work); } diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index b53635ce2c56..185fd610e779 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -45,6 +45,12 @@ enum { /* Bit 2 and 3 might accidentally exist in old stored keys */ BT_KEYS_SC = BIT(4), BT_KEYS_OOB = BIT(5), + /** Indicates that the keys are in conflict with existing keys. + * + * This is used to indicate that the keys being added conflict with + * existing keys from different identity. + */ + BT_KEYS_ID_CONFLICT = BIT(6), }; struct bt_ltk { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index b935c61d2a36..1e28a4e0c84f 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -921,7 +921,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) bt_id_del(keys); } - conflict = bt_id_find_conflict(keys); + conflict = bt_id_find_conflict(keys, false); if (conflict != NULL) { int err; @@ -931,7 +931,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) __ASSERT_NO_MSG(!err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(keys)); + __ASSERT_NO_MSG(!bt_id_find_conflict(keys, false)); bt_id_add(keys); } @@ -4129,16 +4129,24 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) */ __ASSERT_NO_MSG(!(smp->remote_dist & BT_SMP_DIST_ID_KEY)); - conflict = bt_id_find_conflict(new_bond); + conflict = bt_id_find_conflict(new_bond, IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)); if (conflict) { LOG_DBG("New bond conflicts with a bond on id %d.", conflict->id); } - if (conflict && !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { + if (conflict && !IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { LOG_WRN("Refusing new pairing. The old bond must be unpaired first."); return BT_SMP_ERR_AUTH_REQUIREMENTS; } + if (conflict && IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + LOG_WRN("Conflict detected with %p. Don't add key to Resolve List.", conflict); + new_bond->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + return 0; + } + if (conflict && IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { bool trust_ok; int unpair_err; @@ -4155,7 +4163,7 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) __ASSERT_NO_MSG(!unpair_err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond)); + __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond, false)); bt_id_add(new_bond); return 0; } diff --git a/tests/bluetooth/host/id/mocks/adv.c b/tests/bluetooth/host/id/mocks/adv.c index 2c2d4f3f3c7a..a22123dea3da 100644 --- a/tests/bluetooth/host/id/mocks/adv.c +++ b/tests/bluetooth/host/id/mocks/adv.c @@ -15,3 +15,4 @@ DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv *, DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DEFINE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/adv.h b/tests/bluetooth/host/id/mocks/adv.h index bfb744001596..1602ddf47185 100644 --- a/tests/bluetooth/host/id/mocks/adv.h +++ b/tests/bluetooth/host/id/mocks/adv.h @@ -18,7 +18,8 @@ typedef void (*bt_le_ext_adv_foreach_cb)(struct bt_le_ext_adv *adv, void *data); FAKE(bt_le_adv_lookup_legacy) \ FAKE(bt_le_ext_adv_get_index) \ FAKE(bt_le_adv_set_enable_ext) \ - FAKE(bt_le_ext_adv_foreach) + FAKE(bt_le_ext_adv_foreach) \ + FAKE(bt_adv_lookup_by_id) DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable, struct bt_le_ext_adv *, bool); DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_le_adv_lookup_legacy); @@ -27,3 +28,4 @@ DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv * DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DECLARE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/keys.c b/tests/bluetooth/host/id/mocks/keys.c index f885ab875c0f..61f73569c469 100644 --- a/tests/bluetooth/host/id/mocks/keys.c +++ b/tests/bluetooth/host/id/mocks/keys.c @@ -10,3 +10,4 @@ DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DEFINE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); diff --git a/tests/bluetooth/host/id/mocks/keys.h b/tests/bluetooth/host/id/mocks/keys.h index b6901e315ab9..1912472b78de 100644 --- a/tests/bluetooth/host/id/mocks/keys.h +++ b/tests/bluetooth/host/id/mocks/keys.h @@ -15,7 +15,9 @@ typedef void (*bt_keys_foreach_type_cb)(struct bt_keys *keys, void *data); /* List of fakes used by this unit tester */ #define KEYS_FFF_FAKES_LIST(FAKE) \ FAKE(bt_keys_find_irk) \ - FAKE(bt_keys_foreach_type) + FAKE(bt_keys_foreach_type) \ + FAKE(bt_keys_get_addr) DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DECLARE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); From a16995681bbde172a64087d300229a4df6259bf6 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 12 Jun 2025 13:09:23 +0200 Subject: [PATCH 0479/3334] [nrf noup] boards: nrf54h20dk: Enable default images for sysbuild Enable the `empty_app_core` image when building for `cpurad`. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 998af3327bfd98f11a852c91eae632279c0b1001) --- boards/nordic/nrf54h20dk/Kconfig.sysbuild | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 boards/nordic/nrf54h20dk/Kconfig.sysbuild diff --git a/boards/nordic/nrf54h20dk/Kconfig.sysbuild b/boards/nordic/nrf54h20dk/Kconfig.sysbuild new file mode 100644 index 000000000000..29bd62b49927 --- /dev/null +++ b/boards/nordic/nrf54h20dk/Kconfig.sysbuild @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_NRF54H20DK_NRF54H20_CPURAD + +config NRF_DEFAULT_EMPTY + default y + +endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From 96c7186a4f653b250f461d162b01bcb3b615e534 Mon Sep 17 00:00:00 2001 From: Aleksandar Stanoev Date: Thu, 3 Jul 2025 15:37:01 +0100 Subject: [PATCH 0480/3334] [nrf noup] boards: xiao_ble: Add static partition manager configuration The xiao_ble boards ship with a bootloader requiring an app offset of 0x27000. The upstream board defines this via DT partitions, which will not be used if partition manager is enabled. Add a static partition configuration to allow binaries built for this board to work out-of-the-box in NCS, and match the behavior with sysbuild disabled. Signed-off-by: Aleksandar Stanoev (cherry picked from commit 1aff9e5a7abe47398728b6119d4c0d3f2775eb5e) --- boards/seeed/xiao_ble/pm_static.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 boards/seeed/xiao_ble/pm_static.yml diff --git a/boards/seeed/xiao_ble/pm_static.yml b/boards/seeed/xiao_ble/pm_static.yml new file mode 100644 index 000000000000..02915293177c --- /dev/null +++ b/boards/seeed/xiao_ble/pm_static.yml @@ -0,0 +1,18 @@ +# Mirror of partitions defined in nrf52840_partition_uf2_sdv7.dtsi +# Default flash layout for nrf52840 using UF2 and SoftDevice s140 v7 + +softdevice_reserved: + address: 0x00 + size: 0x27000 + +app: + address: 0x27000 + size: 0xC5000 + +settings_storage: + address: 0xEC000 + size: 0x8000 + +uf2_partition: + address: 0xF4000 + size: 0xC000 From 0c8ea11856bfe33fb443b2a18c2e156c7d93b288 Mon Sep 17 00:00:00 2001 From: Krzysztof Szromek Date: Fri, 18 Jul 2025 08:05:27 +0200 Subject: [PATCH 0481/3334] [nrf noup] ci: update test_spec label for E2E DFU tests Ref: NCSDK-34052 Signed-off-by: Krzysztof Szromek (cherry picked from commit c3f0f4698111647ac39e59ebcd5a8294db09460b) --- .github/test-spec.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5337249f7dab..76def875e0be 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -49,6 +49,33 @@ - "tests/subsys/dfu/**/*" - "tests/subsys/mgmt/mcumgr/**/*" +"CI-dfu-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/**/*" + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/spi/**/*" + - "dts/arm/nordic/nrf54h*" + - "dts/common/nordic/*" + - "dts/riscv/nordic/nrf54h*" + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/zephyr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" + - "scripts/west_commands/runners/nrfutil.py" + - "soc/nordic/nrf54h/**/*" + - "subsys/bluetooth/**/*" + - "subsys/dfu/**/*" + - "subsys/logging/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "subsys/tracing/**/*" + "CI-tfm-test": - "boards/nordic/nrf5340dk/**/*" - "boards/nordic/nrf9160dk/**/*" From 901f81ef30e11f809740f5e90840eaadcd1a1f60 Mon Sep 17 00:00:00 2001 From: Juha Ylinen Date: Fri, 19 Jan 2024 15:26:33 +0200 Subject: [PATCH 0482/3334] [nrf noup] samples: lwm2m_client: Add support for nRF91x Add support for nRF91x by providing overlay configuration file. Signed-off-by: Juha Ylinen Signed-off-by: Robert Lubos (cherry picked from commit 80070f512f8d961d419453cd063939c9a529b9b9) --- samples/net/lwm2m_client/overlay-nrf91x.conf | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 samples/net/lwm2m_client/overlay-nrf91x.conf diff --git a/samples/net/lwm2m_client/overlay-nrf91x.conf b/samples/net/lwm2m_client/overlay-nrf91x.conf new file mode 100644 index 000000000000..7b902178e078 --- /dev/null +++ b/samples/net/lwm2m_client/overlay-nrf91x.conf @@ -0,0 +1,53 @@ +# Configuration file for nRF91x +# This file is merged with prj.conf in the application folder, and options +# set here will take precedence if they are present in both files. + +# General +CONFIG_MAIN_STACK_SIZE=4096 + +CONFIG_NET_SOCKETS=y +CONFIG_NET_NATIVE=y +CONFIG_NET_SOCKETS_OFFLOAD=y + +CONFIG_NET_CONFIG_MY_IPV6_ADDR="" +CONFIG_NET_CONFIG_PEER_IPV6_ADDR="" +CONFIG_NET_CONFIG_MY_IPV4_ADDR="" +CONFIG_NET_CONFIG_MY_IPV4_GW="" + +CONFIG_NET_CONFIG_NEED_IPV6=n +CONFIG_NET_CONFIG_NEED_IPV4=n +CONFIG_NET_CONFIG_AUTO_INIT=n + +# Modem related configurations +CONFIG_NRF_MODEM_LIB_NET_IF=y +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_DOWN=n +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=n +CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y + +CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=n +CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=n + +# Disable Duplicate Address Detection (DAD) +# due to not being properly implemented for offloaded interfaces. +CONFIG_NET_IPV6_NBR_CACHE=n +CONFIG_NET_IPV6_MLD=n + +# Zephyr NET Connection Manager and Connectivity layer. +CONFIG_NET_CONNECTION_MANAGER=y +CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024 + +CONFIG_NET_SAMPLE_LWM2M_ID="nrf91x" +CONFIG_NET_SAMPLE_LWM2M_SERVER="coaps://leshan.eclipseprojects.io:5684" +CONFIG_LWM2M_DNS_SUPPORT=y + +## Enable DTLS support +CONFIG_LWM2M_DTLS_SUPPORT=y +CONFIG_LWM2M_TLS_SESSION_CACHING=y +CONFIG_LWM2M_DTLS_CID=y +CONFIG_TLS_CREDENTIALS=y + +## Crypto +CONFIG_OBERON_BACKEND=y +CONFIG_NORDIC_SECURITY_BACKEND=y +CONFIG_MBEDTLS_SHA256_C=y From e8250a96ea58026ef672b999a308745323bbc0c4 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Tue, 22 Apr 2025 14:34:11 +0200 Subject: [PATCH 0483/3334] [nrf noup] modules: hal_nordic: require nrf-regtool Same as commit 6ec9d10 but with the REQUIRED keyword on its own line to attempt to avoid a merge conflict when reverting/reapplying this patch. Signed-off-by: Jonathan Nilsen (cherry picked from commit 15d61b18b613dbad78cb3c1b643a9327c43b7af9) --- modules/hal_nordic/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index b6f352864123..e5b1ab60dfca 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -13,6 +13,7 @@ if(CONFIG_NRF_REGTOOL_GENERATE_UICR) endif() if(DEFINED nrf_regtool_components) find_package(nrf-regtool 9.2.0 + REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From 15aa9fd61e8e96d6254fed5e238f300fd5ee3f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 11:15:56 +0100 Subject: [PATCH 0484/3334] [nrf noup] boards: nordic: nrf7002dk: Bring back NS variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Non-secure variants for nRF7002 DK were removed from upstream in commit 10d49736cffa14d3798e615e70d58b3be8ee2cfc. Revert these changes downstream, so that the NS variants are still available. Signed-off-by: Andrzej Głąbek Signed-off-by: Johann Fischer (cherry picked from commit e7a14b39f27842948a7b084abdb068e5f922dc97) --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 +++ boards/nordic/nrf7002dk/Kconfig | 4 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 72 +++++++++++++++++++ boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 18 ++++- boards/nordic/nrf7002dk/board.yml | 4 ++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ++++++++++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 +++++ ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 24 +++++++ .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 +++++++++++ .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 +++++ .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 23 ++++++ 12 files changed, 273 insertions(+), 4 deletions(-) create mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt new file mode 100644 index 000000000000..db20255712bc --- /dev/null +++ b/boards/nordic/nrf7002dk/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND + CONFIG_BOARD_ENABLE_CPUNET) + zephyr_library() + zephyr_library_sources(nrf5340_cpunet_reset.c) +endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index fa6c8097ae32..d4b7030a65ab 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,7 +10,9 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS config BT_HCI_IPC default y if BT diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig index 48510d6e24f8..0d89a0089968 100644 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -9,3 +9,75 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION endif # BOARD_NRF7002DK + +if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +# By default, if we build for a Non-Secure version of the board, +# force building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +# Code Partition: +# +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# SRAM Partition: +# +# If the secure firmware is to be combined with a non-secure image +# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always +# be restricted to the secure image SRAM partition (sram-secure-partition). +# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram +# may be used by the image. +# +# For the non-secure version of the board, the firmware image SRAM is +# always restricted to the allocated non-secure SRAM partition. +# +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ + TRUSTED_EXECUTION_SECURE + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config SRAM_SIZE + default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) + +endif + +if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif + +endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 61b9e818f367..91f52ee6f08c 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,4 +4,6 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index f85bbc86f485..11a27910eebc 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,10 +1,24 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 4f41341e4423..39db5dcfa3a7 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,5 +5,9 @@ board: socs: - name: nrf5340 variants: + - name: ns + cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp + variants: + - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts new file mode 100644 index 000000000000..5ff28accf3fc --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7001@1 { + compatible = "nordic,nrf7001-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml new file mode 100644 index 000000000000..165759691260 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns +name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig new file mode 100644 index 000000000000..2c435653140a --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig @@ -0,0 +1,24 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts new file mode 100644 index 000000000000..0deb8ccc1bf5 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns_app; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7002@1 { + compatible = "nordic,nrf7002-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + #include "nrf70_common_5g.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml new file mode 100644 index 000000000000..ea43785b4559 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/ns +name: NRF7002-DK-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig new file mode 100644 index 000000000000..1886b926bfd5 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y From bf4371e95d59ea33d53f5419548c9b618baab547 Mon Sep 17 00:00:00 2001 From: Maximilian Deubel Date: Wed, 15 Nov 2023 12:55:40 +0100 Subject: [PATCH 0485/3334] [nrf noup] boards: arm: nrf9131ek: enable tfm This patch backports the nrf9131ek to a time before tfm was refactored. To be reverted when TF-M is updated. Signed-off-by: Maximilian Deubel (cherry picked from commit 84798b794386df86e82153fedeecb2e1b3105ef6) --- boards/nordic/nrf9131ek/Kconfig.defconfig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index e1d8de241c0a..1a30d006b4c6 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -8,3 +8,22 @@ config HW_STACK_PROTECTION config BOARD_NRF9131EK select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS + +if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF9131EK_NRF9131_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS From 6c4ef51aea7818ffa0ef30ff09c906e5dc87ae87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stine=20=C3=85kredalen?= Date: Mon, 4 Aug 2025 01:26:12 +0200 Subject: [PATCH 0486/3334] [nrf noup] samples: bluetooth: mesh: update stack sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increased stack sizes for mesh provisoner sample. Values are based of thread analysis, plus added margin. Signed-off-by: Stine Åkredalen (cherry picked from commit 7283923e0bf0027ea42515ba90d61c1941d17987) --- samples/bluetooth/mesh_provisioner/prj.conf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 241767805164..0e5f6490edee 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -1,6 +1,10 @@ #CONFIG_INIT_STACKS=y -CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 +# Stack sizes from thread analysis + 50% margin, rounded to nearest 100 +CONFIG_MAIN_STACK_SIZE=4400 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4800 +CONFIG_BT_MESH_SETTINGS_WORKQ_STACK_SIZE=1700 +CONFIG_BT_MESH_ADV_STACK_SIZE=4000 +CONFIG_BT_RX_STACK_SIZE=3300 # The Bluetooth API should not be used from a preemptive thread: CONFIG_MAIN_THREAD_PRIORITY=-2 From 89aeb8e9f617f67a975d1751b89cad6b5e433fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Wed, 6 Aug 2025 09:22:26 +0200 Subject: [PATCH 0487/3334] [nrf noup] soc: nordic: ironside: fix typo in Kconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This typo was fixed in upstream but not ported to NCS This creates conflicts when cherry picking. Signed-off-by: Łukasz Stępnicki (cherry picked from commit 308c990a00be0287ba8476e3b28b2a1141092090) --- soc/nordic/ironside/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index ce4878b7b182..32c6ef38165f 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -76,7 +76,7 @@ config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS range 0 255 default 50 help - Maximum attempts with 10us intervals before busy status will be reported. + Maximum timeout when waiting for DVFS oppoint change mutex lock. endif # NRF_IRONSIDE_DVFS_SERVICE From cf3f710cf383235fb5b398deb1639535a3107017 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Fri, 31 Jan 2025 14:47:05 +0200 Subject: [PATCH 0488/3334] [nrf noup] tests: secure_storage: fix test w/ ZMS backend on 54L15 noup because it's about partition manager. Fix the build of secure_storage.psa.its.secure_storage.store.zms on nrf54l15dk/nrf54l15/cpuapp by disabling partition manager, which is incompatible with the ZMS implementation of the ITS store module. Disabling it only for that test as it's not needed for the others and even makes the NS board targets fail if disabling PM. Signed-off-by: Tomi Fontanilles (cherry picked from commit 326b4113dcb6fcf715bc5bb2f90563ea3b86ef0c) --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index 6b244a065b65..c794ea1797e5 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -29,6 +29,7 @@ tests: - EXTRA_DTC_OVERLAY_FILE=zms.overlay - EXTRA_CONF_FILE=\ overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf + - SB_CONFIG_PARTITION_MANAGER=n secure_storage.psa.its.secure_storage.store.zms.64-bit_uids: platform_allow: *zms_platform_allow From bb410b1f8feda5b6f72e8f4216be28f87a9cf401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Mon, 18 Aug 2025 14:25:53 +0200 Subject: [PATCH 0489/3334] [nrf noup] tests: crypto: Add ENTROPY_GENERATOR in overlays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ENTROPY_GENERATOR=y in overlays for l series devices. This fixes an error where a trng source is not included in ncs. Signed-off-by: Dag Erik Gjørvad (cherry picked from commit 30a0877c0cb03a0d9e6ade7cb6823ab37341f96c) --- .../mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ++++++ 5 files changed, 30 insertions(+) create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y From 02ee30e22ffc3e061a4a9fbd16f6da19bda4c81b Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Tue, 3 Jun 2025 16:07:48 +0200 Subject: [PATCH 0490/3334] [nrf noup] zms: add lookup cache hash function for legacy ZMS ZMS legacy enabled by CONFIG_SETTINGS_ZMS_LEGACY uses a different lookup cache function that is optimized for Settings subsystem. Signed-off-by: Riadh Ghaddab (cherry picked from commit a64eff64ffb8b14336790585e9e92fccd042ac75) --- subsys/fs/zms/zms.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index d3bc9275479d..babf6d09b60f 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -13,8 +13,12 @@ #include #include "zms_priv.h" #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS +#ifdef CONFIG_SETTINGS_ZMS_LEGACY +#include +#else #include #endif +#endif #include LOG_MODULE_REGISTER(fs_zms, CONFIG_ZMS_LOG_LEVEL); @@ -32,6 +36,40 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at static inline size_t zms_lookup_cache_pos(zms_id_t id) { #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS +#ifdef CONFIG_SETTINGS_ZMS_LEGACY + /* + * 1. The ZMS settings backend uses up to (ZMS_NAME_ID_OFFSET - 1) ZMS IDs to + store keys and equal number of ZMS IDs to store values. + * 2. For each key-value pair, the value is stored at ZMS ID greater by exactly + * ZMS_NAME_ID_OFFSET than ZMS ID that holds the key. + * 3. The backend tries to minimize the range of ZMS IDs used to store keys. + * That is, ZMS IDs are allocated sequentially, and freed ZMS IDs are reused + * before allocating new ones. + * + * Therefore, to assure the least number of collisions in the lookup cache, + * the least significant bit of the hash indicates whether the given ZMS ID + * represents a key or a value, and remaining bits of the hash are set to + * the ordinal number of the key-value pair. Consequently, the hash function + * provides the following mapping: + * + * 1st settings key => hash 0 + * 1st settings value => hash 1 + * 2nd settings key => hash 2 + * 2nd settings value => hash 3 + * ... + */ + BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAMECNT_ID), "ZMS_NAMECNT_ID is not power of 2"); + BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAME_ID_OFFSET), "ZMS_NAME_ID_OFFSET is not power of 2"); + + uint32_t key_value_bit; + uint32_t key_value_ord; + uint32_t hash; + + key_value_bit = (id >> LOG2(ZMS_NAME_ID_OFFSET)) & 1; + key_value_ord = id & (ZMS_NAME_ID_OFFSET - 1); + + hash = ((key_value_ord << 1) | key_value_bit); +#else /* * 1. Settings subsystem is storing the name ID and the linked list node ID * with only one bit difference at BIT(0). @@ -57,6 +95,7 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; +#endif /* CONFIG_SETTINGS_ZMS_LEGACY */ #elif defined(CONFIG_ZMS_ID_64BIT) /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ From ea96b5cb7e2294b808d59f81a5103f25d101c288 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Thu, 28 Aug 2025 08:26:23 +0200 Subject: [PATCH 0491/3334] [nrf noup] soc: nrf54h: work around missing power domain handling This patch should be dropped as part of the next upmerge. The upcoming release of IronSide SE no longer disables RETAIN in all GPIO instances on boot, so the application must be able to handle the hardware default state of RETAIN being enabled. The GPIO retention is properly handled by changes that are currently only upstream and will be pulled in by the next upmerge. This patch exists a workaround to be able to integrate IronSide SE before the proper solution is pulled in. Signed-off-by: Jonathan Nilsen (cherry picked from commit 0d492618c3b5c138bce53d5f3773433ea0d57f86) --- soc/nordic/nrf54h/Kconfig | 5 +++++ soc/nordic/nrf54h/soc.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index ac25cff79150..94f9cb9749f4 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -95,6 +95,11 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT endif # SOC_NRF54H20_CPURAD_ENABLE +config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND + bool "Disable all GPIO pin retention on boot" + default y + depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index e6ae033b0cd0..c291767d0906 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -14,6 +14,7 @@ #include #endif +#include #include #include #include @@ -180,6 +181,17 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } + + /* This is a workaround for not yet having upstream patches for properly handling + * pin retention. It should be removed as part of the next upmerge. + */ + if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) { + NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST; + + for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) { + nrf_gpio_port_retain_set(gpio_regs[i], 0); + } + } } #if defined(CONFIG_SOC_LATE_INIT_HOOK) From ae076725d0a55ca8ce01f17feea2dd68e0ee8e2a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 2 Sep 2025 10:48:14 +0100 Subject: [PATCH 0492/3334] [nrf noup] doc: extensions: kconfig: Add SoC sysbuild Kconfigs Allows listing sysbuild Kconfigs for SoCs Signed-off-by: Jamie McCrae (cherry picked from commit 9c5067aaf4db5716bf67addaac4fc78cb2396fdb) --- doc/_extensions/zephyr/kconfig/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index 704415eac101..63459a61ade6 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -114,6 +114,9 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d for folder in soc_folders: f.write('source "' + (Path(folder) / 'Kconfig.soc').as_posix() + '"\n') + if "nordic" in folder: + f.write('osource "' + (Path(folder) / 'Kconfig.sysbuild').as_posix() + '"\n') + with open(Path(td) / "soc" / "Kconfig", "w") as f: for folder in soc_folders: f.write('osource "' + (Path(folder) / 'Kconfig').as_posix() + '"\n') From e6d20a77781cd52c546e053d0ae427ebf0669800 Mon Sep 17 00:00:00 2001 From: Kari Hamalainen Date: Fri, 12 Sep 2025 10:46:10 +0300 Subject: [PATCH 0493/3334] [nrf noup] ci: add reopen for manifest-pr action Previously reopening of PR did not reopen manifest PR. This commit will enable reopening of manifest PR in such case. Signed-off-by: Kari Hamalainen (cherry picked from commit b166b49de16188d53e44194d93dfa41deed59152) --- .github/workflows/manifest-PR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index a871aa381ded..473301146527 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -1,7 +1,7 @@ name: handle manifest PR on: pull_request_target: - types: [opened, synchronize, closed] + types: [opened, synchronize, closed, reopened] branches: - main From 52d649275f12b9b275acb742e514ce216cc48a5c Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 5 Sep 2025 18:09:52 +0200 Subject: [PATCH 0494/3334] [nrf noup] soc/nordic/nrf54h: Add extension to define custom s2ram implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Kconfig entries to allow compile own s2ram implementation. Signed-off-by: Karol Lasończyk Signed-off-by: Andrzej Puzdrowski (cherry picked from commit d2642ade7f1f57333d0d1727ad921596feb943cd) --- soc/nordic/nrf54h/CMakeLists.txt | 4 +++- soc/nordic/nrf54h/Kconfig | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index a4db05c9e643..25e4796a4169 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -13,7 +13,9 @@ if(CONFIG_ARM) endif() endif() -zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) +if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) + zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) +endif() zephyr_include_directories(.) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 94f9cb9749f4..f07a620ccdb3 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -100,6 +100,11 @@ config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND default y depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD +config SOC_NRF54H20_PM_S2RAM_OVERRIDE + bool "Override `pm_s2ram` implementation" + help + Override Nordic s2ram implementation. + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON From ae18200a608e1cfc048e58bde0e5e1da859cf63c Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 12:17:00 +0200 Subject: [PATCH 0495/3334] [nrf noup] dts: choose a psa-rng for entropy for 54lm20a Set PSA as the entropy source for nRF54lm20a target. PSA is the only NCS-supported interface to CRACEN. There is no other entropy source in 54lm20a than CRACEN. The commit also disables `rng` compatible with `nrf-cracen-ctrdrbg`, the nrfx based interface to CRACEN that is used in upstream Zephyr. Only one CRACEN interface may be enabled. Signed-off-by: Piotr Pryga (cherry picked from commit 9c4fe51898651888373c2fdf7d3abc461de6b733) --- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index fa269e71c37e..a480edb41fdc 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -28,7 +28,7 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index 1798088d6f4a..dea5d0cd9816 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -19,7 +19,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -30,11 +30,11 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; }; From 39166353a40830e5d1bf02cfa4d4c99040adbfc8 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 07:48:52 +0200 Subject: [PATCH 0496/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding as default The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. The SoftDevice Controller is a default BT controller in nRF Connect SDK context, therefore it should be enabled by default instead of open source link layer. The commit changes the default BT controller for nRF54lm20a SoC. Signed-off-by: Piotr Pryga (cherry picked from commit e66b6ccda98154350d336f93a67bdae096c7ce33) --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 ----- boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts | 4 ---- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 5 +++++ dts/vendor/nordic/nrf54lm20a.dtsi | 5 +++++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index 39fda7c4c88e..5b4599cc94e0 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -18,7 +18,6 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; - zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; @@ -98,10 +97,6 @@ status = "okay"; }; -&bt_hci_controller { - status = "okay"; -}; - &ieee802154 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index 2e79bbb98215..0496f3ca90cf 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -19,9 +19,5 @@ }; }; -&bt_hci_controller { - status = "okay"; -}; - /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index dea5d0cd9816..8c8d006e1a18 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -19,6 +19,7 @@ nvic: &cpuapp_nvic {}; / { chosen { + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -39,6 +40,10 @@ nvic: &cpuapp_nvic {}; }; }; +&bt_hci_sdc { + status = "okay"; +}; + &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index ff000d01143e..b4ddafac801b 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -290,6 +290,11 @@ /* Note: In the nRF Connect SDK the SoftDevice Controller * is added and set as the default Bluetooth Controller. */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From ed1c8ef56abc767d48b4e2901a948886f0b0b1b0 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 11 Sep 2025 16:07:03 +0530 Subject: [PATCH 0497/3334] [nrf noup] boards: nordic: nrf7002: Include required headers The definitions of slot partitions and sram partition has been moved. Include corresponding headers. Signed-off-by: Ravi Dondaputi (cherry picked from commit f77679a04180056ddd8c9c9366b0ddb84087f18a) --- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 0deb8ccc1bf5..9c06a17ad7bf 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -7,6 +7,8 @@ /dts-v1/; #include #include "nrf5340_cpuapp_common.dtsi" +#include "nordic/nrf5340_sram_partition.dtsi" +#include "nordic/nrf5340_cpuapp_ns_partition.dtsi" / { model = "Nordic NRF5340 DK NRF5340 Application"; From ba72a55d65c4e4de93ccd1a931b478ca96cc0f49 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 25 Sep 2025 09:44:35 +0100 Subject: [PATCH 0498/3334] [nrf noup] soc: nordic: nrf54l: Add ROM start offset PM override Adds an override to force this Kconfig to 0 when partition manager is enabled Signed-off-by: Jamie McCrae (cherry picked from commit 318b87179093864727c181d80c06565138a4d071) --- soc/nordic/nrf54l/Kconfig.defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index 929d13655c54..3274abc88b8a 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -33,6 +33,7 @@ choice NULL_POINTER_EXCEPTION_DETECTION endchoice config ROM_START_OFFSET + default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # ARM From e0c9e903ca64058c689d41d2ef917d7f0883d433 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 8 Jul 2025 13:59:15 +0100 Subject: [PATCH 0499/3334] [nrf noup] scripts: ci: check_compliance: Add undefined Kconfigs Adds undefined Kconfigs used in NCS to the allow list for Kconfig compliance checks Signed-off-by: Jamie McCrae (cherry picked from commit e8f5a03719caaa0fd625cdd53bac1a5b007aec3c) --- scripts/ci/check_compliance.py | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index eded57d639f6..9f00d69db1ef 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1376,6 +1376,81 @@ def check_no_undef_outside_kconfig(self, kconf): # documentation "ZTEST_FAIL_TEST_", # regex in tests/ztest/fail/CMakeLists.txt # zephyr-keep-sorted-stop + + # NCS-specific allow list + # zephyr-keep-sorted-start re(^\s+") + "APPLICATION", # Example documentation + "BAR", # Example documentation + "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation + "BT_ADV_PROV_", # Documentation + "BT_CTLR_TX_PWR_MINUS", # CHIP documentation + "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation + "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo + "CHANNEL", # NRF desktop + "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop + "CHANNEL_TRANSPORT_DISABLED", # NRF desktop + "CHANNEL_TRANSPORT_IDLE", # NRF desktop + "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop + "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop + "CHIP_DFU_OVER_BT_SMP", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module + "CHIP_MEMORY_PROFILING", # CHIP module + "CHIP_NUS", # CHIP module + "CHIP_NUS_FIXED_PASSKEY", # CHIP module + "CHIP_NUS_MAX_COMMANDS", # CHIP module + "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module + "CHIP_QSPI_NOR", # CHIP module + "CHIP_SPI_NOR", # CHIP module + "CHIP_WIFI", # CHIP module + "DESKTOP_DVFS_STATE_", # NRF desktop + "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop + "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module + "MEMFAULT_", # Documentation + "MEMFAULT_NCS", # Documentation + "MEMFAULT_NCS_", # Documentation + "MY_CUSTOM_CONFIG", # Example documentation + "MY_EXT_API_ENABLED", # Example documentation + "MY_EXT_API_REQUIRED", # Example documentation + "NCS_IS_VARIANT_IMAGE", # Build system defined symbol + "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot + "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot + "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol + "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation + "PM_PARTITION_SIZE", # Used in search link + "PM_PARTITION_SIZE_", # Used in documentation + "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template + "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template + "SOC_NRF54H20_CPUSEC", # Internal + "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal + "STATUS_", # NRF desktop + "STATUS_COUNT", # NRF desktop + "STATUS_DISCONNECTED", # NRF desktop + "STATUS_FETCH", # NRF desktop + "STATUS_GET_BOARD_NAME", # NRF desktop + "STATUS_GET_HWID", # NRF desktop + "STATUS_GET_MAX_MOD_ID", # NRF desktop + "STATUS_GET_PEER", # NRF desktop + "STATUS_GET_PEERS_CACHE", # NRF desktop + "STATUS_INDEX_PEERS", # NRF desktop + "STATUS_LIST", # NRF desktop + "STATUS_PENDING", # NRF desktop + "STATUS_POS", # NRF desktop + "STATUS_REJECT", # NRF desktop + "STATUS_SET", # NRF desktop + "STATUS_SUCCESS", # NRF desktop + "STATUS_TIMEOUT", # NRF desktop + "STATUS_WRITE_FAIL", # NRF desktop + # zephyr-keep-sorted-stop } From 02cb82717a2217cb35833ff1c1100f8c4e865e3c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 7 Jul 2025 09:02:08 +0100 Subject: [PATCH 0500/3334] [nrf noup] scripts: ci: check_compliance: Exclude some docs Adds the NCS release notes folder to the exclusion list for undefined Kconfigs so that old Kconfigs can be used e.g. for old release notes, and lwm2m carrier library changelog. Also adds a nrf7x page which details setup instructions for software on Linux Excludes bare metal release docs from the invalid Kconfig check as these will have old Kconfigs that have been removed Signed-off-by: Jamie McCrae (cherry picked from commit 1fe09df625206d83c43debb8651098dbac1641b0) (cherry picked from commit e9b0c496fb953bf5feb197330b73d13e8e909dfc) --- scripts/ci/check_compliance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 9f00d69db1ef..1b85d7408d88 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1180,6 +1180,10 @@ def check_no_undef_outside_kconfig(self, kconf): grep_stdout = git("grep", "--line-number", "-I", "--null", "--perl-regexp", regex, "--", ":!/doc/releases", ":!/doc/security/vulnerabilities.rst", + ":!/doc/nrf/releases_and_maturity", + ":!/doc/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.rst", + ":!/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst", + ":!/doc/nrf-bm/release_notes", cwd=GIT_TOP) # splitlines() supports various line terminators From d68235ee707134c90af942ec848fe91c49efedf9 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 5 Sep 2025 18:11:52 +0200 Subject: [PATCH 0501/3334] [nrf noup] soc/nordic/nrf54h/pm_s2ram: S2RAM resume hardening Added support for hardening decision on resume from S2RAM by MCUboot bootloader. Application sets additional variable to MCUBOOT_S2RAM_RESUME_MAGIC which allows the bootloader to doublecheck. Extended mcuboot_resume_s suture by slot_info field intended to be used by MCUboot for recognize proper boot slot in direct-xp mode. Signed-off-by: Andrzej Puzdrowski (cherry picked from commit 98bd8d2e46cb11c07bcaecc07729598537400b59) (cherry picked from commit 079a5d605b34b995bd002561943547ad9cf5f17d) --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 13 ++++++++++--- soc/nordic/nrf54h/pm_s2ram.c | 14 ++++++++++++++ soc/nordic/nrf54h/pm_s2ram.h | 7 +++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 2c67c3d4e8c1..715eedeb0e8a 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -355,14 +355,21 @@ zephyr_udc0: &usbhs { }; /* temporary stack for S2RAM resume logic */ - pm_s2ram_stack: cpuapp_s2ram_stack@22007fd0 { + pm_s2ram_stack: cpuapp_s2ram_stack@22007fc8 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fd0 16>; + reg = <0x22007fc8 16>; zephyr,memory-region = "pm_s2ram_stack"; }; + /* run-time common mcuboot S2RAM support section */ + mcuboot_s2ram: cpuapp_s2ram@22007fd8 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x22007fd8 8>; + zephyr,memory-region = "mcuboot_s2ram_context"; + }; + /* run-time common S2RAM cpu context RAM */ - pm_s2ram: cpuapp_s2ram@22007fe0 { + pm_s2ram: cpuapp_s2ram@22007fe0 { compatible = "zephyr,memory-region", "mmio-sram"; reg = <0x22007fe0 32>; zephyr,memory-region = "pm_s2ram_context"; diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index 753acdda6832..768233b2ac8b 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -223,10 +223,24 @@ static void fpu_restore(_fpu_context_t *backup) #endif /* !defined(CONFIG_FPU_SHARING) */ #endif /* defined(CONFIG_FPU) */ +#if DT_NODE_EXISTS(DT_NODELABEL(mcuboot_s2ram)) &&\ + DT_NODE_HAS_COMPAT(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region) +/* Linker section name is given by `zephyr,memory-region` property of + * `zephyr,memory-region` compatible DT node with nodelabel `mcuboot_s2ram`. + */ +__attribute__((section(DT_PROP(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region)))) +volatile struct mcuboot_resume_s _mcuboot_resume; + +#define SET_MCUBOOT_RESUME_MAGIC() _mcuboot_resume.magic = MCUBOOT_S2RAM_RESUME_MAGIC +#else +#define SET_MCUBOOT_RESUME_MAGIC() +#endif + int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) { int ret; + SET_MCUBOOT_RESUME_MAGIC(); scb_save(&backup_data.scb_context); #if defined(CONFIG_FPU) #if !defined(CONFIG_FPU_SHARING) diff --git a/soc/nordic/nrf54h/pm_s2ram.h b/soc/nordic/nrf54h/pm_s2ram.h index 565afad6ca10..01c098ea4310 100644 --- a/soc/nordic/nrf54h/pm_s2ram.h +++ b/soc/nordic/nrf54h/pm_s2ram.h @@ -10,6 +10,13 @@ #ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ #define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ +#define MCUBOOT_S2RAM_RESUME_MAGIC 0x75832419 + +struct mcuboot_resume_s { + uint32_t magic; /* magic value to identify valid structure */ + uint32_t slot_info; +}; + /** * @brief Save CPU state on suspend * From 64ec75ff36924adfe3399c25c0f7618fa23cbe16 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Fri, 14 Jun 2024 09:13:48 +0200 Subject: [PATCH 0502/3334] [nrf noup] bluetooth: att: Allow ATT sent callback after data TX is done By default, the BLE stack calls sent callback for ATT data when the data is passed to BLE controller for transmission. Enabling this Kconfig option delays calling the sent callback until data transmission is finished by BLE controller (the callback is delayed until receiving the Number of Completed Packets HCI Event). If the 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. Jira: NCSDK-27422 Jira: NCSDK-28624 Jira: NCSDK-35650 Signed-off-by: Marek Pieta (cherry picked from commit b99465266420e7b118b65bdce0e618555b861759) --- subsys/bluetooth/host/Kconfig.gatt | 14 ++++++++++++++ subsys/bluetooth/host/att.c | 17 ++++++++++++++++- subsys/bluetooth/host/conn.c | 27 ++++++++++++++++++++++----- subsys/bluetooth/host/l2cap.c | 10 ++++++++-- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index a04241a3e94f..3403e8d308b8 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -38,6 +38,20 @@ 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. + 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 66833d1cfcc5..c822de7ab4bc 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -323,6 +323,13 @@ static void att_disconnect(struct bt_att_chan *chan) } } +static void chan_sent_cb(struct bt_conn *conn, void *user_data, int err) +{ + struct net_buf *nb = user_data; + + net_buf_unref(nb); +} + /* In case of success the ownership of the buffer is transferred to the stack * which takes care of releasing it when it completes transmitting to the * controller. @@ -416,7 +423,15 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf) data->att_chan = chan; - err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); + if (IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX)) { + err = bt_l2cap_send_pdu(&chan->chan, buf, chan_sent_cb, net_buf_ref(buf)); + if (err) { + net_buf_unref(buf); + } + } else { + err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); + } + if (err) { if (err == -ENOBUFS) { LOG_ERR("Ran out of TX buffers or contexts."); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 9c6bb386f6c1..e706fd3fb934 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -711,12 +711,29 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - /* Check that buf->ref is 1 or 2. It would be 1 if this - * was the only reference (e.g. buf was removed - * from the conn tx_queue). It would be 2 if the - * tx_data_pull kept it on the tx_queue for segmentation. + /* If ATT sent callback is delayed until data transmission + * is done by BLE controller (CONFIG_BT_ATT_SENT_CB_AFTER_TX), + * the `chan_send` function from `att.c` introduces 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 (the reference is removed when the TX callback passed + * to `bt_l2cap_send_pdu` is called). + * + * send_buf function can be called multiple times, if buffer + * has to be fragmented over HCI. In that case, the callback + * is provided as an argument only for the last transmitted + * fragment. The `buf->ref == 1` (or 2) check is skipped + * because it's impossible to properly validate number of + * references for the sent fragments if buffers may have the + * additional reference. + * + * Otherwise, check that buf->ref is 1 or 2. It would be 1 + * if this was the only reference (e.g. buf was removed from + * the conn tx_queue). It would be 2 if the tx_data_pull + * kept it on the tx_queue for segmentation. */ - __ASSERT_NO_MSG((buf->ref == 1) || (buf->ref == 2)); + __ASSERT_NO_MSG(IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX) || (buf->ref == 1) || + (buf->ref == 2)); /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 6dcdfe04e541..882ba9a037b4 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -787,13 +787,19 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, return -ENOTCONN; } - if (pdu->ref != 1) { + /* If ATT sent callback is delayed until data transmission is done by BLE controller + * (CONFIG_BT_ATT_SENT_CB_AFTER_TX), the `chan_send` function from `att.c` introduces 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 (the reference is removed when + * the TX callback passed to `bt_l2cap_send_pdu` is called). + */ + if (pdu->ref > 1 + (cb ? 1 : 0)) { /* The host may alter the buf contents when fragmenting. Higher * layers cannot expect the buf contents to stay intact. Extra * refs suggests a silent data corruption would occur if not for * this error. */ - LOG_ERR("Expecting 1 ref, got %d", pdu->ref); + LOG_ERR("Expecting up to %d refs, got %d", cb ? 2 : 1, pdu->ref); return -EINVAL; } From 94b4cf09b6f3a4ae048b8a8318c9f00b0430fbd7 Mon Sep 17 00:00:00 2001 From: Kari Hamalainen Date: Mon, 13 Oct 2025 14:30:13 +0300 Subject: [PATCH 0503/3334] [nrf noup] ci: add default permissions Scanners report these as missing so lets add them. Signed-off-by: Kari Hamalainen (cherry picked from commit 37b9a01aa8037dc373465760ee3c64cba2179318) --- .github/workflows/commit-tags.yml | 5 ++++- .github/workflows/manifest-PR.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml index 828f02971678..61fc3a6c5bd3 100644 --- a/.github/workflows/commit-tags.yml +++ b/.github/workflows/commit-tags.yml @@ -6,6 +6,9 @@ on: milestoned, demilestoned, assigned, unassigned, ready_for_review, review_requested] +permissions: + contents: read + jobs: commit_tags: runs-on: ubuntu-22.04 @@ -16,7 +19,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 473301146527..0f3bd738a36c 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -5,6 +5,8 @@ on: branches: - main +permissions: + contents: read jobs: call-manifest-pr-action: From 41aa006934fc11442d82055cfde2284daca54489 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Mon, 25 Nov 2024 14:14:40 +0100 Subject: [PATCH 0504/3334] [nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure SDP MSPI pins to switch their control to VPR core Signed-off-by: Jakub Zymelka Signed-off-by: Andrzej Głąbek Signed-off-by: Magdalena Pastula Signed-off-by: Karsten Koenig (cherry picked from commit 0d3356ee5f46e4a9663c07564edabed4854732fc) --- drivers/pinctrl/pinctrl_nrf.c | 32 +++++++++++ .../zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 56 +++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index b052e61eb803..3ad358158a80 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -148,6 +148,18 @@ static void port_pin_clock_set(uint16_t pin_number, bool enable) #endif +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || \ + defined(CONFIG_MSPI_HPF) || \ + DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(nordic_nrf_vpr_coprocessor, pinctrl_0) +#if defined(CONFIG_SOC_SERIES_NRF54LX) +#define NRF_PSEL_SDP_MSPI(psel) \ + nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_VPR); +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +/* On nRF54H, pin routing is controlled by secure domain, via UICR. */ +#define NRF_PSEL_SDP_MSPI(psel) +#endif +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || ... */ + int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg) { @@ -529,6 +541,26 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_DISCONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_coresight_nrf) */ +#if defined(NRF_PSEL_SDP_MSPI) + case NRF_FUN_SDP_MSPI_CS0: + case NRF_FUN_SDP_MSPI_CS1: + case NRF_FUN_SDP_MSPI_CS2: + case NRF_FUN_SDP_MSPI_CS3: + case NRF_FUN_SDP_MSPI_CS4: + case NRF_FUN_SDP_MSPI_SCK: + case NRF_FUN_SDP_MSPI_DQ0: + case NRF_FUN_SDP_MSPI_DQ1: + case NRF_FUN_SDP_MSPI_DQ2: + case NRF_FUN_SDP_MSPI_DQ3: + case NRF_FUN_SDP_MSPI_DQ4: + case NRF_FUN_SDP_MSPI_DQ5: + case NRF_FUN_SDP_MSPI_DQ6: + case NRF_FUN_SDP_MSPI_DQ7: + NRF_PSEL_SDP_MSPI(psel); + dir = NRF_GPIO_PIN_DIR_OUTPUT; + input = NRF_GPIO_PIN_INPUT_CONNECT; + break; +#endif /* defined(NRF_PSEL_SDP_MSPI) */ default: return -ENOTSUP; } diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 92e62a9a6bed..4c7f1d3145dd 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -172,6 +172,62 @@ #define NRF_FUN_GRTC_CLKOUT_FAST 55U /** GRTC slow clock output */ #define NRF_FUN_GRTC_CLKOUT_32K 56U +/** SDP_MSPI clock pin */ +#define NRF_FUN_SDP_MSPI_SCK 57U +/** SDP_MSPI data pin 0 */ +#define NRF_FUN_SDP_MSPI_DQ0 58U +/** SDP_MSPI data pin 1 */ +#define NRF_FUN_SDP_MSPI_DQ1 59U +/** SDP_MSPI data pin 2 */ +#define NRF_FUN_SDP_MSPI_DQ2 60U +/** SDP_MSPI data pin 3 */ +#define NRF_FUN_SDP_MSPI_DQ3 61U +/** SDP_MSPI data pin 4 */ +#define NRF_FUN_SDP_MSPI_DQ4 62U +/** SDP_MSPI data pin 5 */ +#define NRF_FUN_SDP_MSPI_DQ5 63U +/** SDP_MSPI data pin 6 */ +#define NRF_FUN_SDP_MSPI_DQ6 64U +/** SDP_MSPI data pin 7 */ +#define NRF_FUN_SDP_MSPI_DQ7 65U +/** SDP_MSPI chip select 0 */ +#define NRF_FUN_SDP_MSPI_CS0 66U +/** SDP_MSPI chip select 1 */ +#define NRF_FUN_SDP_MSPI_CS1 67U +/** SDP_MSPI chip select 2 */ +#define NRF_FUN_SDP_MSPI_CS2 68U +/** SDP_MSPI chip select 3 */ +#define NRF_FUN_SDP_MSPI_CS3 69U +/** SDP_MSPI chip select 4 */ +#define NRF_FUN_SDP_MSPI_CS4 70U +/** High-Performance Framework MSPI clock pin */ +#define NRF_FUN_HPF_MSPI_SCK NRF_FUN_SDP_MSPI_SCK +/** High-Performance Framework MSPI data pin 0 */ +#define NRF_FUN_HPF_MSPI_DQ0 NRF_FUN_SDP_MSPI_DQ0 +/** High-Performance Framework MSPI data pin 1 */ +#define NRF_FUN_HPF_MSPI_DQ1 NRF_FUN_SDP_MSPI_DQ1 +/** High-Performance Framework MSPI data pin 2 */ +#define NRF_FUN_HPF_MSPI_DQ2 NRF_FUN_SDP_MSPI_DQ2 +/** High-Performance Framework MSPI data pin 3 */ +#define NRF_FUN_HPF_MSPI_DQ3 NRF_FUN_SDP_MSPI_DQ3 +/** High-Performance Framework MSPI data pin 4 */ +#define NRF_FUN_HPF_MSPI_DQ4 NRF_FUN_SDP_MSPI_DQ4 +/** High-Performance Framework MSPI data pin 5 */ +#define NRF_FUN_HPF_MSPI_DQ5 NRF_FUN_SDP_MSPI_DQ5 +/** High-Performance Framework MSPI data pin 6 */ +#define NRF_FUN_HPF_MSPI_DQ6 NRF_FUN_SDP_MSPI_DQ6 +/** High-Performance Framework MSPI data pin 7 */ +#define NRF_FUN_HPF_MSPI_DQ7 NRF_FUN_SDP_MSPI_DQ7 +/** High-Performance Framework MSPI chip select pin 0 */ +#define NRF_FUN_HPF_MSPI_CS0 NRF_FUN_SDP_MSPI_CS0 +/** High-Performance Framework MSPI chip select pin 1 */ +#define NRF_FUN_HPF_MSPI_CS1 NRF_FUN_SDP_MSPI_CS1 +/** High-Performance Framework MSPI chip select pin 2 */ +#define NRF_FUN_HPF_MSPI_CS2 NRF_FUN_SDP_MSPI_CS2 +/** High-Performance Framework MSPI chip select pin 3 */ +#define NRF_FUN_HPF_MSPI_CS3 NRF_FUN_SDP_MSPI_CS3 +/** High-Performance Framework MSPI chip select pin 4 */ +#define NRF_FUN_HPF_MSPI_CS4 NRF_FUN_SDP_MSPI_CS4 /** TDM SCK in master mode */ #define NRF_FUN_TDM_SCK_M 71U /** TDM SCK in slave mode */ From 552993e42de89af3f9fb9edf8a7697fdd864e0f1 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 25 Sep 2025 16:15:45 +0200 Subject: [PATCH 0505/3334] [nrf noup] boards: nordic: Skip offsets in merged slot In the merged slot approach, the memory reservation for the MCUboot header is done in CMake, as it is not obvious, which image includes the (merged) MCUboot header. This change will remove the unnecessary gap between images. Ref: NCSDK-35612 Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 077c91359e7b5b7d9ab18e8ad413d74432d4ffa9) --- boards/nordic/nrf54h20dk/Kconfig.defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 069ed7b6eba6..c11d3ef63e1f 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -13,6 +13,7 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET + default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT if !USE_DT_CODE_PARTITION @@ -39,6 +40,7 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET + default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From 26f650948186971ad8066d4126208cd6460cf9f2 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 6 Oct 2025 08:43:55 +0100 Subject: [PATCH 0506/3334] [nrf noup] scripts: ci: check_compliance: Check Kconfigs for enable Allows checking sdk-nrf for Kconfig prompts that start with "Enable" as these should not be allowed Signed-off-by: Jamie McCrae (cherry picked from commit 709df802af4ad3f19d3b9016ffc409dacd1c8e35) --- scripts/ci/check_compliance.py | 57 ++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 1b85d7408d88..16aacd4c6a80 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -505,6 +505,22 @@ class KconfigCheck(ComplianceTest): # Kconfig symbol prefix/namespace. CONFIG_ = "CONFIG_" + # If modules should be excluded from checks. + EXCLUDE_MODULES = False + + # This block list contains a list of upstream Zephyr modules that should not be checked + # DO NOT MERGE CHANGES TO THIS WITHOUT BUILD SYSTEM AND CODE OWNER APPROVAL! + external_module_name_block_list = ['canopennode', 'chre', 'cmsis', 'cmsis-dsp', 'cmsis-nn', + 'cmsis_6', 'edtt', 'fatfs', 'hal_st', 'hal_tdk', + 'hal_wurthelektronik', 'liblc3', 'libmetal', 'littlefs', + 'loramac-node', 'lvgl', 'lz4', 'mipi-sys-t', 'nanopb', + 'net-tools', 'nrf_hw_models', 'open-amp', 'percepio', + 'picolibc', 'segger', 'tf-m-tests', 'tinycrypt', + 'uoscore-uedhoc', 'zscilib'] + + # Holds a list or directories/files which should not be checked + blocked_module_dirs = [] + def run(self): kconf = self.parse_kconfig() @@ -542,13 +558,22 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] - nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') + nrf_modules_dir = (Path(ZEPHYR_BASE) / '..' / 'nrf' / 'modules').resolve() nrf_modules = [] + + for module in modules: + if module in self.external_module_name_block_list: + self.blocked_module_dirs.append(modules_dir / module / 'Kconfig') + if os.path.exists(nrf_modules_dir): nrf_modules = [name for name in os.listdir(nrf_modules_dir) if os.path.exists(os.path.join(nrf_modules_dir, name, 'Kconfig'))] + for module in nrf_modules: + if module in self.external_module_name_block_list: + self.blocked_module_dirs.append(nrf_modules_dir / module / 'Kconfig') + with open(modules_file, 'r') as fp_module_file: content = fp_module_file.read() @@ -567,6 +592,7 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se re.sub('[^a-zA-Z0-9]', '_', module).upper(), modules_dir / module / 'Kconfig' )) + # Add NRF as static entry as workaround for ext Kconfig root support fp_module_file.write("ZEPHYR_NRF_KCONFIG = {}\n".format( nrf_modules_dir / '..' / 'Kconfig.nrf' @@ -1052,9 +1078,32 @@ def check_no_enable_in_boolean_prompt(self, kconf): # Checks that boolean's prompt does not start with "Enable...". for node in kconf.node_iter(): - # skip Kconfig nodes not in-tree (will present an absolute path) + skip_node = False + + # skip Kconfig nodes not in-tree when set to (will present an absolute path) if os.path.isabs(node.filename): - continue + if self.EXCLUDE_MODULES is True: + continue + + normalised_file_name = Path(node.filename).resolve() + + for module_name in self.external_module_name_block_list: + # Workaround for being unable to use full_match() due to python version + if '/modules/' in str(normalised_file_name) and \ + ('/' + module_name + '/') in str(normalised_file_name): + skip_node = True + break + + if skip_node: + continue + + for blocked_dir in self.blocked_module_dirs: + if normalised_file_name.match(blocked_dir, case_sensitive=True): + skip_node = True + break + + if skip_node: + continue # 'kconfiglib' is global # pylint: disable=undefined-variable @@ -1480,6 +1529,7 @@ class KconfigBasicNoModulesCheck(KconfigBasicCheck): name = "KconfigBasicNoModules" path_hint = "" EMPTY_FILE_CONTENTS = "# Empty\n" + EXCLUDE_MODULES = True def get_modules(self, module_dirs_file, modules_file, sysbuild_modules_file, settings_file): with open(module_dirs_file, 'w') as fp_module_file: @@ -1572,6 +1622,7 @@ class SysbuildKconfigBasicNoModulesCheck(SysbuildKconfigCheck, KconfigBasicNoMod """ name = "SysbuildKconfigBasicNoModules" path_hint = "" + EXCLUDE_MODULES = True class Nits(ComplianceTest): From 87b051f5d2fb0d3e7839ae511f96ce073ae8f1e7 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Tue, 16 Jul 2024 14:43:30 +0200 Subject: [PATCH 0507/3334] [nrf noup] dts: Add Bluetooth Controller to nRF54H20 The nRF54H20 supports a Bluetooth controller. The HCI driver interface has changed upstream in https://github.com/zephyrproject-rtos/zephyr/pull/72323 so now we need to add it to device tree. Signed-off-by: Rubin Gerritsen (cherry picked from commit 7c8475ccddff3fd49f08503428e0f28c028630c9) --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 8 ++++++++ dts/vendor/nordic/nrf54h20.dtsi | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index b910e42789b0..eac16a3c14f3 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -31,6 +31,10 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &s2ram; / { + chosen { + zephyr,bt-hci = &bt_hci_controller; + }; + soc { compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; @@ -131,3 +135,7 @@ wdt011: &cpurad_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; + +&bt_hci_controller { + status = "okay"; +}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index e2ce4cfd9945..bac6e0c4fc8e 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -495,6 +495,14 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; + + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; }; ccm030: ccm@3a000 { From 2dcdc2cbe53ac468f10e75ce9f8b0954397e959e Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Thu, 5 Sep 2024 08:04:15 +0200 Subject: [PATCH 0508/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding as default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. It should therefore have its own device tree binding. This commit converts the SoftDevice Controller driver to use this new DTS binding instead of reusing the existing one. This commit updates or adds additional overlays for existing samples, applications and tests that were using the open source link layer. Signed-off-by: Rubin Gerritsen Signed-off-by: Kristoffer Rist Skøien Signed-off-by: Rafał Kuźnia (cherry picked from commit 3627b4c988b2ca7a17fbb884be93def1f46f52fa) --- dts/arm/nordic/nrf52805.dtsi | 11 +- dts/arm/nordic/nrf52810.dtsi | 11 +- dts/arm/nordic/nrf52811.dtsi | 11 +- dts/arm/nordic/nrf52820.dtsi | 11 +- dts/arm/nordic/nrf52832.dtsi | 11 +- dts/arm/nordic/nrf52833.dtsi | 11 +- dts/arm/nordic/nrf52840.dtsi | 11 +- dts/arm/nordic/nrf5340_cpunet.dtsi | 11 +- dts/arm/nordic/nrf54h20_cpurad.dtsi | 4 +- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +- dts/vendor/nordic/nrf54h20.dtsi | 7 +- dts/vendor/nordic/nrf54l20.dtsi | 852 ++++++++++++++++++ dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 +- .../bluetooth/bap_broadcast_sink/sample.yaml | 4 +- .../bap_broadcast_sink/sysbuild.cmake | 4 + .../bap_broadcast_source/sample.yaml | 4 +- .../bap_broadcast_source/sysbuild.cmake | 4 + .../bluetooth/bap_unicast_client/sample.yaml | 4 +- .../bap_unicast_client/sysbuild.cmake | 4 + .../bluetooth/bap_unicast_server/sample.yaml | 4 +- .../bap_unicast_server/sysbuild.cmake | 4 + samples/bluetooth/beacon/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sysbuild.cmake | 4 + samples/bluetooth/cap_initiator/sample.yaml | 4 +- .../bluetooth/cap_initiator/sysbuild.cmake | 4 + .../direction_finding_central/sample.yaml | 15 +- .../sample.yaml | 14 +- .../sample.yaml | 14 +- .../direction_finding_peripheral/sample.yaml | 15 +- samples/bluetooth/hci_ipc/sample.yaml | 34 +- samples/bluetooth/hci_uart/sample.yaml | 18 +- samples/bluetooth/hci_vs_scan_req/sample.yaml | 2 + samples/bluetooth/iso_central/sample.yaml | 6 +- .../pbp_public_broadcast_sink/sample.yaml | 4 +- .../pbp_public_broadcast_sink/sysbuild.cmake | 4 + .../pbp_public_broadcast_source/sample.yaml | 4 +- .../sysbuild.cmake | 4 + .../bt-ll-sw-split/bt-ll-sw-split.overlay | 4 + .../controller/ll_sw/nordic/lll/lll.c | 2 +- .../controller/ctrl_api/testcase.yaml | 2 + .../controller/ctrl_chmu/testcase.yaml | 2 + .../controller/ctrl_cis_create/testcase.yaml | 2 + .../ctrl_cis_terminate/testcase.yaml | 2 + .../controller/ctrl_collision/testcase.yaml | 2 + .../controller/ctrl_conn_update/testcase.yaml | 11 +- .../controller/ctrl_cte_req/testcase.yaml | 2 + .../ctrl_data_length_update/testcase.yaml | 10 +- .../controller/ctrl_encrypt/testcase.yaml | 2 + .../ctrl_feature_exchange/testcase.yaml | 2 + .../controller/ctrl_hci/testcase.yaml | 2 + .../controller/ctrl_invalid/testcase.yaml | 2 + .../controller/ctrl_le_ping/testcase.yaml | 2 + .../ctrl_min_used_chans/testcase.yaml | 2 + .../controller/ctrl_phy_update/testcase.yaml | 6 +- .../controller/ctrl_sca_update/testcase.yaml | 2 + .../controller/ctrl_sw_privacy/testcase.yaml | 2 + .../controller/ctrl_terminate/testcase.yaml | 2 + .../ctrl_tx_buffer_alloc/testcase.yaml | 22 +- .../controller/ctrl_tx_queue/testcase.yaml | 2 + .../controller/ctrl_unsupported/testcase.yaml | 6 +- .../controller/ctrl_user_ext/testcase.yaml | 2 + .../controller/ctrl_version/testcase.yaml | 2 + .../df/connection_cte_req/testcase.yaml | 2 + .../df/connection_cte_tx_params/testcase.yaml | 2 + .../connectionless_cte_chains/testcase.yaml | 2 + .../df/connectionless_cte_rx/testcase.yaml | 2 + .../df/connectionless_cte_tx/testcase.yaml | 2 + tests/bluetooth/init/testcase.yaml | 101 ++- 69 files changed, 1235 insertions(+), 122 deletions(-) create mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index e940c7a2cdf2..b686ddcabb02 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -106,12 +106,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index c1e5f8763172..7f4c1a7a5f5b 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -110,12 +110,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 33f6ac38747a..8431bb9c2ce6 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -122,12 +122,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index 1073b973c22a..85aab283bfd2 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -10,7 +10,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -123,12 +123,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK another Bluetooth controller - * is added and set as the default. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index 09a651762db6..776397ff14a5 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -110,12 +110,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 87e6bccfb53d..647f56c5aa42 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -124,12 +124,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index b04b31a640dc..9d7027744bef 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -112,12 +112,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 5010f801e0c0..e80399b5770a 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -9,7 +9,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -102,12 +102,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index eac16a3c14f3..2cde225beb01 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -32,7 +32,7 @@ wdt011: &cpurad_wdt011 {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; }; soc { @@ -136,6 +136,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index a480edb41fdc..f4c673b1f516 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -38,7 +38,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index bac6e0c4fc8e..5c445b9d5c75 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -496,9 +496,10 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi new file mode 100644 index 000000000000..bee70effa0e8 --- /dev/null +++ b/dts/vendor/nordic/nrf54l20.dtsi @@ -0,0 +1,852 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr"; + reg = <1>; + device_type = "cpu"; + riscv,isa = "rv32emc"; + nordic,bus-width = <64>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + pclk32m: pclk32m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + aclk: aclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; + + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(447)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 0x6fc00>; + }; + + cpuflpr_sram: memory@2006fc00 { + compatible = "mmio-sram"; + reg = <0x2006fc00 DT_SIZE_K(64)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2006fc00 0x10000>; + }; + + global_peripherals: peripheral@50000000 { + ranges = <0x0 0x50000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x143c>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + spi00: spi@4d000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart00: uart@4d000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + pdm20: pdm@d0000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd0000 0x1000>; + interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pdm21: pdm@d1000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd1000 0x1000>; + interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pwm20: pwm@d2000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd2000 0x1000>; + interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm21: pwm@d3000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd3000 0x1000>; + interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm22: pwm@d4000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd4000 0x1000>; + interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <16>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + tdm: tdm@e8000 { + compatible = "nordic,nrf-tdm"; + easydma-maxcnt-bits = <15>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xe8000 0x1000>; + interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + clocks = <&pclk32m>; + }; + + i2c23: i2c@ed000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi23: spi@ed000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart23: uart@ed000 { + compatible = "nordic,nrf-uarte"; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c24: i2c@ee000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi24: spi@ee000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart24: uart@ee000 { + compatible = "nordic,nrf-uarte"; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <5>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@51c { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x51c 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@520 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x520 0x1>; + status = "disabled"; + }; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1972)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + + cpuflpr_rram: rram@1ed000 { + compatible = "soc-nv-flash"; + reg = <0x1ed000 DT_SIZE_K(64)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 602a7de7f719..5a4854440b64 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -252,9 +252,11 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/samples/bluetooth/bap_broadcast_sink/sample.yaml b/samples/bluetooth/bap_broadcast_sink/sample.yaml index 5d06dee0bf89..148b8b641697 100644 --- a/samples/bluetooth/bap_broadcast_sink/sample.yaml +++ b/samples/bluetooth/bap_broadcast_sink/sample.yaml @@ -24,5 +24,7 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake index 2523aac8ea76..d5d260789ff7 100644 --- a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_broadcast_source/sample.yaml b/samples/bluetooth/bap_broadcast_source/sample.yaml index 5e5b01d942d0..5f745cd08950 100644 --- a/samples/bluetooth/bap_broadcast_source/sample.yaml +++ b/samples/bluetooth/bap_broadcast_source/sample.yaml @@ -36,5 +36,7 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake index 2523aac8ea76..d5d260789ff7 100644 --- a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_client/sample.yaml b/samples/bluetooth/bap_unicast_client/sample.yaml index 7283090b8781..44f32934ce99 100644 --- a/samples/bluetooth/bap_unicast_client/sample.yaml +++ b/samples/bluetooth/bap_unicast_client/sample.yaml @@ -22,5 +22,7 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_client/sysbuild.cmake b/samples/bluetooth/bap_unicast_client/sysbuild.cmake index 2523aac8ea76..d5d260789ff7 100644 --- a/samples/bluetooth/bap_unicast_client/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_client/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_server/sample.yaml b/samples/bluetooth/bap_unicast_server/sample.yaml index 068f752b626b..266ced73f66d 100644 --- a/samples/bluetooth/bap_unicast_server/sample.yaml +++ b/samples/bluetooth/bap_unicast_server/sample.yaml @@ -22,5 +22,7 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_server/sysbuild.cmake b/samples/bluetooth/bap_unicast_server/sysbuild.cmake index 2523aac8ea76..d5d260789ff7 100644 --- a/samples/bluetooth/bap_unicast_server/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_server/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index 23ffad73c796..00215341924f 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -20,7 +20,9 @@ tests: - ophelia4ev/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp sample.bluetooth.beacon-coex: - extra_args: CONF_FILE="prj-coex.conf" + extra_args: + - CONF_FILE="prj-coex.conf" + - SNIPPET="bt-ll-sw-split" harness: bluetooth platform_allow: - nrf52840dk/nrf52840 diff --git a/samples/bluetooth/cap_acceptor/sample.yaml b/samples/bluetooth/cap_acceptor/sample.yaml index 824e744eecaf..9061f44679fb 100644 --- a/samples/bluetooth/cap_acceptor/sample.yaml +++ b/samples/bluetooth/cap_acceptor/sample.yaml @@ -26,5 +26,7 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/cap_acceptor/sysbuild.cmake b/samples/bluetooth/cap_acceptor/sysbuild.cmake index 2523aac8ea76..d5d260789ff7 100644 --- a/samples/bluetooth/cap_acceptor/sysbuild.cmake +++ b/samples/bluetooth/cap_acceptor/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/cap_initiator/sample.yaml b/samples/bluetooth/cap_initiator/sample.yaml index b4f593c99129..e3e557f48301 100644 --- a/samples/bluetooth/cap_initiator/sample.yaml +++ b/samples/bluetooth/cap_initiator/sample.yaml @@ -26,5 +26,7 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/cap_initiator/sysbuild.cmake b/samples/bluetooth/cap_initiator/sysbuild.cmake index 2523aac8ea76..d5d260789ff7 100644 --- a/samples/bluetooth/cap_initiator/sysbuild.cmake +++ b/samples/bluetooth/cap_initiator/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index b7a118e6cdc8..ffdf634c6e3e 100644 --- a/samples/bluetooth/direction_finding_central/sample.yaml +++ b/samples/bluetooth/direction_finding_central/sample.yaml @@ -14,15 +14,24 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.central.aod: + sample.bluetooth.direction_finding.central.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aod.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aod.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding.central.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aod.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml index 8e6097de58ae..c500cc80dcec 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml @@ -12,14 +12,22 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless_rx.aod: + sample.bluetooth.direction_finding_connectionless_rx.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aod.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aod.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless_rx.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aod.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 78d21b2c95f5..2a4fa93d19d5 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -12,14 +12,22 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless.aoa: + sample.bluetooth.direction_finding_connectionless.aoa_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aoa.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless.aoa_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_peripheral/sample.yaml b/samples/bluetooth/direction_finding_peripheral/sample.yaml index f300cb415cc5..01f612ad08a0 100644 --- a/samples/bluetooth/direction_finding_peripheral/sample.yaml +++ b/samples/bluetooth/direction_finding_peripheral/sample.yaml @@ -14,15 +14,24 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.peripheral.aod: + sample.bluetooth.direction_finding.peripheral.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aoa.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding.peripheral.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/hci_ipc/sample.yaml b/samples/bluetooth/hci_ipc/sample.yaml index b758b2547688..3763478b6b33 100644 --- a/samples/bluetooth/hci_ipc/sample.yaml +++ b/samples/bluetooth/hci_ipc/sample.yaml @@ -15,7 +15,9 @@ tests: sample.bluetooth.hci_ipc.iso_broadcast.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -25,7 +27,9 @@ tests: sample.bluetooth.hci_ipc.iso_receive.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -35,7 +39,9 @@ tests: sample.bluetooth.hci_ipc.bis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -45,7 +51,9 @@ tests: sample.bluetooth.hci_ipc.iso_central.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -55,7 +63,9 @@ tests: sample.bluetooth.hci_ipc.iso_peripheral.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -65,7 +75,9 @@ tests: sample.bluetooth.hci_ipc.cis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -75,7 +87,9 @@ tests: sample.bluetooth.hci_ipc.iso.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -99,6 +113,7 @@ tests: extra_args: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet @@ -109,13 +124,16 @@ tests: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - CONFIG_BT_CTLR_PHY_CODED=n + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet sample.bluetooth.hci_ipc.mesh.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet diff --git a/samples/bluetooth/hci_uart/sample.yaml b/samples/bluetooth/hci_uart/sample.yaml index df2b40135c67..8555c65cf0df 100644 --- a/samples/bluetooth/hci_uart/sample.yaml +++ b/samples/bluetooth/hci_uart/sample.yaml @@ -24,7 +24,9 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -33,7 +35,9 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -44,7 +48,9 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -54,7 +60,9 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df.iq_report: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -88,6 +96,7 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth @@ -99,6 +108,7 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf54l15dk_nrf54l15_cpuapp_df.overlay + - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth diff --git a/samples/bluetooth/hci_vs_scan_req/sample.yaml b/samples/bluetooth/hci_vs_scan_req/sample.yaml index 245a83aa0d96..49526522d16e 100644 --- a/samples/bluetooth/hci_vs_scan_req/sample.yaml +++ b/samples/bluetooth/hci_vs_scan_req/sample.yaml @@ -9,4 +9,6 @@ tests: - nrf52dk/nrf52832 extra_configs: - CONFIG_BT_LL_SW_SPLIT=y + extra_args: + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/iso_central/sample.yaml b/samples/bluetooth/iso_central/sample.yaml index 3a7dedd404ae..57254ee809ab 100644 --- a/samples/bluetooth/iso_central/sample.yaml +++ b/samples/bluetooth/iso_central/sample.yaml @@ -11,11 +11,11 @@ tests: sample.bluetooth.iso_central.bt_ll_sw_split: harness: bluetooth platform_allow: - - qemu_cortex_m3 - - qemu_x86 - nrf52_bsim - nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml index d7c816ee5b76..901d40b00d4f 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml @@ -23,5 +23,7 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake index 2523aac8ea76..d5d260789ff7 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml index 80c907042119..1d2e31306e29 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml @@ -23,5 +23,7 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake index d3bf7be5b6c3..e0a7fd9d175d 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake @@ -18,6 +18,10 @@ if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay index 04bf83ef44d4..a57a0e82ba6e 100644 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay +++ b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay @@ -2,6 +2,10 @@ status = "okay"; }; +&bt_hci_sdc { + status = "disabled"; +}; + / { chosen { zephyr,bt-hci = &bt_hci_controller; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index d5903805e571..0bf5d1772f1e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -62,7 +62,7 @@ static struct { /* FIXME: This could probably use a chosen entropy device instead on relying on * the nodelabel being the same as for the old nrf rng. */ -static const struct device *const dev_entropy = DEVICE_DT_GET(DT_NODELABEL(rng)); +static const struct device *const dev_entropy = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy)); #endif /* CONFIG_ENTROPY_HAS_DRIVER */ static int init_reset(void); diff --git a/tests/bluetooth/controller/ctrl_api/testcase.yaml b/tests/bluetooth/controller/ctrl_api/testcase.yaml index 19bf6c9ab490..21f178bf9b2b 100644 --- a/tests/bluetooth/controller/ctrl_api/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_api/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_api.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml index f7e8068d60ec..9c3ee6264335 100644 --- a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_chmu.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml index 99612a89bc31..2371d7063eb7 100644 --- a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cis_create.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml index 956172a89b20..a98229ba45f3 100644 --- a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cis_terminate.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_collision/testcase.yaml b/tests/bluetooth/controller/ctrl_collision/testcase.yaml index 6086a9a4ebc8..daa8f3bc6c3d 100644 --- a/tests/bluetooth/controller/ctrl_collision/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_collision/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_collision.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml index 5b0bda4b9088..fc4ecb0b647d 100644 --- a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml @@ -7,11 +7,18 @@ common: tests: bluetooth.controller.ctrl_conn_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_conn_update.apm_test: type: unit - extra_args: CONF_FILE=prj_apm.conf + extra_args: + - CONF_FILE=prj_apm.conf + - SNIPPET="bt-ll-sw-split" + bluetooth.controller.ctrl_conn_update.no_param_req_test: type: unit - extra_args: CONF_FILE=prj_no_param_req.conf + extra_args: + - CONF_FILE=prj_no_param_req.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml index fd6ff51118d9..c6288aecc433 100644 --- a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cte_req.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml index 9778af435b4a..c7d1174e12bf 100644 --- a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml @@ -6,11 +6,17 @@ common: tests: bluetooth.controller.ctrl_data_length_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nocodedphy: type: unit - extra_args: CONF_FILE=prj_nocoded.conf + extra_args: + - CONF_FILE=prj_nocoded.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nophy: type: unit - extra_args: CONF_FILE=prj_nophy.conf + extra_args: + - CONF_FILE=prj_nophy.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml index d5bb2cb8b110..86dd5bfe4d30 100644 --- a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_encrypt.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml index 257542f36120..087e49575ff7 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_feature_exchange.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_hci/testcase.yaml b/tests/bluetooth/controller/ctrl_hci/testcase.yaml index d7f7ce7168d1..e0735bae6962 100644 --- a/tests/bluetooth/controller/ctrl_hci/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_hci/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_hci.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml index 2d1741931e37..cee54e6b09ed 100644 --- a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_invalid.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml index b6a77528f32d..54178905da17 100644 --- a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_le_ping.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml index 0991b0cdd43c..a9445cbf8c4d 100644 --- a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_min_used_chans.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml index 1d7da169f1d8..d5c49d587a8f 100644 --- a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml @@ -6,6 +6,10 @@ common: tests: bluetooth.controller.ctrl_phy_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_phy_update.test_reduced_buf: type: unit - extra_args: CONF_FILE=prj_rx_cnt.conf + extra_args: + - CONF_FILE=prj_rx_cnt.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml index cbf63aa1b575..cbc3c3faf720 100644 --- a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_sca_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml index 778606d69549..ac5dd6e957eb 100644 --- a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml @@ -4,3 +4,5 @@ common: tests: bluetooth.ctrl_sw_privacy.test: platform_allow: nrf52_bsim + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml index cbe639401ea3..6b1409e9653e 100644 --- a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_terminate.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml index 614eb7fe94c0..363986bd3d35 100644 --- a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml @@ -6,23 +6,35 @@ common: tests: bluetooth.controller.ctrl_tx_buffer_alloc.test_0_per_conn: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_1_per_conn: type: unit - extra_args: CONF_FILE=prj_1.conf + extra_args: + - CONF_FILE=prj_1.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_2_per_conn: type: unit - extra_args: CONF_FILE=prj_2.conf + extra_args: + - CONF_FILE=prj_2.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_3_per_conn: type: unit - extra_args: CONF_FILE=prj_3.conf + extra_args: + - CONF_FILE=prj_3.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_max_per_conn_alloc: type: unit - extra_args: CONF_FILE=prj_max.conf + extra_args: + - CONF_FILE=prj_max.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_max_common_alloc: type: unit - extra_args: CONF_FILE=prj_max_common.conf + extra_args: + - CONF_FILE=prj_max_common.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml index 295ad891a630..282b620b317a 100644 --- a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml @@ -5,3 +5,5 @@ common: tests: bluetooth.ctrl_tx_queue.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml index 28aba1a752a8..48b18af93536 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml @@ -6,7 +6,11 @@ common: tests: bluetooth.controller.ctrl_unsupported.default.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_unsupported.test: type: unit - extra_args: CONF_FILE=prj_unsupported.conf + extra_args: + - CONF_FILE=prj_unsupported.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml index af319a7a7191..be963df24a8a 100644 --- a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml @@ -4,3 +4,5 @@ common: tests: bluetooth.ctrl_user_ext.test: platform_allow: nrf52_bsim + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_version/testcase.yaml b/tests/bluetooth/controller/ctrl_version/testcase.yaml index 6badcbc72547..5df86b9bca9f 100644 --- a/tests/bluetooth/controller/ctrl_version/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_version/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_version.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_req/testcase.yaml b/tests/bluetooth/df/connection_cte_req/testcase.yaml index 768aba4a51f5..fbfe4b0d9a1a 100644 --- a/tests/bluetooth/df/connection_cte_req/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_req/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.conection_cte_req: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml index 38a23b0950e3..a9986c5b0e53 100644 --- a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.conection_cte_tx_params: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml index 6aa5bb0f0c1c..844a7bbb524e 100644 --- a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_chains: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml index f839b1910eb2..c8f08a908436 100644 --- a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_rx: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml index 77d651d0cbc2..491cc0e7e599 100644 --- a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_tx: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/init/testcase.yaml b/tests/bluetooth/init/testcase.yaml index dd44257e0128..a5cc40cd39e7 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -74,7 +74,9 @@ tests: extra_args: CONF_FILE=prj_9.conf platform_allow: qemu_cortex_m3 bluetooth.init.test_ctlr: - extra_args: CONF_FILE=prj_ctlr.conf + extra_args: + - CONF_FILE=prj_ctlr.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -86,7 +88,9 @@ tests: - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_4_0: - extra_args: CONF_FILE=prj_ctlr_4_0.conf + extra_args: + - CONF_FILE=prj_ctlr_4_0.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -95,7 +99,9 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_4_0_dbg: - extra_args: CONF_FILE=prj_ctlr_4_0_dbg.conf + extra_args: + - CONF_FILE=prj_ctlr_4_0_dbg.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -104,7 +110,9 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_tiny: - extra_args: CONF_FILE=prj_ctlr_tiny.conf + extra_args: + - CONF_FILE=prj_ctlr_tiny.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -116,6 +124,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -126,6 +135,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr_5_x_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -137,6 +147,7 @@ tests: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_CTLR_ADVANCED_FEATURES=y - CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf52840dk/nrf52840 @@ -146,13 +157,16 @@ tests: bluetooth.init.test_ctlr_ticker: extra_args: - CONF_FILE=prj_ctlr_ticker.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_broadcaster: - extra_args: CONF_FILE=prj_ctlr_broadcaster.conf + extra_args: + - CONF_FILE=prj_ctlr_broadcaster.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -161,7 +175,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral: - extra_args: CONF_FILE=prj_ctlr_peripheral.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -170,7 +186,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral_priv: - extra_args: CONF_FILE=prj_ctlr_peripheral_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -179,7 +197,9 @@ tests: integration_platforms: - nrf52840dk/nrf52840 bluetooth.init.test_ctlr_observer: - extra_args: CONF_FILE=prj_ctlr_observer.conf + extra_args: + - CONF_FILE=prj_ctlr_observer.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -188,7 +208,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_central: - extra_args: CONF_FILE=prj_ctlr_central.conf + extra_args: + - CONF_FILE=prj_ctlr_central.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -198,7 +220,9 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_central_priv: - extra_args: CONF_FILE=prj_ctlr_central_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_central_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -208,7 +232,9 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_broadcaster_ext: - extra_args: CONF_FILE=prj_ctlr_broadcaster_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_broadcaster_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -217,7 +243,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext: - extra_args: CONF_FILE=prj_ctlr_peripheral_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -226,7 +254,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext_priv: - extra_args: CONF_FILE=prj_ctlr_peripheral_ext_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_ext_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -235,7 +265,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_oberver_ext: - extra_args: CONF_FILE=prj_ctlr_observer_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_observer_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -244,7 +276,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext: - extra_args: CONF_FILE=prj_ctlr_central_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_central_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -253,7 +287,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext_priv: - extra_args: CONF_FILE=prj_ctlr_central_ext_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_central_ext_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -262,7 +298,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv: - extra_args: CONF_FILE=prj_ctlr_per_adv.conf + extra_args: + - CONF_FILE=prj_ctlr_per_adv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -271,7 +309,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv_no_adi: - extra_args: CONF_FILE=prj_ctlr_per_adv_no_adi.conf + extra_args: + - CONF_FILE=prj_ctlr_per_adv_no_adi.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -280,7 +320,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync: - extra_args: CONF_FILE=prj_ctlr_per_sync.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -289,7 +331,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_adi: - extra_args: CONF_FILE=prj_ctlr_per_sync_no_adi.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync_no_adi.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -298,7 +342,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_filter: - extra_args: CONF_FILE=prj_ctlr_per_sync_no_filter.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync_no_filter.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -307,7 +353,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_iso: - extra_args: CONF_FILE=prj_ctlr_peripheral_iso.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_iso.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -316,7 +364,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_iso: - extra_args: CONF_FILE=prj_ctlr_central_iso.conf + extra_args: + - CONF_FILE=prj_ctlr_central_iso.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -335,7 +385,9 @@ tests: - DTC_OVERLAY_FILE=h5.overlay platform_allow: qemu_cortex_m3 bluetooth.init.test_llcp: - extra_args: CONF_FILE=prj_llcp.conf + extra_args: + - CONF_FILE=prj_llcp.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -347,6 +399,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_RECV_WORKQ_BT=y + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 bluetooth.init.test_host_6_x: From 6aca382718d00391c234d2e4a5eed3886e7c7d7d Mon Sep 17 00:00:00 2001 From: alperen sener Date: Fri, 24 Oct 2025 15:25:55 +0200 Subject: [PATCH 0509/3334] [nrf noup] tests: bluetooth: tester: Remove deprecated configs Removing the deprecated kconfigs for nrf54h20 target. Signed-off-by: alperen sener (cherry picked from commit 37e2e04f4678268532d231896a8c5491a2d75de5) --- tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 51b0ef5fa8d4..0f16f6ea7b4c 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -26,6 +26,5 @@ CONFIG_UART_INTERRUPT_DRIVEN=y # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf index b7d64a9e6a08..24e3d84ecf96 100644 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -35,6 +35,5 @@ CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y From 8f80253e7ad61207e91412fad4f830cdc1e4288f Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Thu, 5 Sep 2024 10:41:36 +0200 Subject: [PATCH 0510/3334] [nrf noup] boards: nordic: Enable PSA RNG for nrf54h20 Noup since Ironside not available upstream and it is required for PSA RNG. This enables the PSA RNG as the default Zephyr entropy provider for the nrf54h20dk cpuapp and cpurad targets. Signed-off-by: Georgios Vasilakis Signed-off-by: Sergey Korotkov (cherry picked from commit b7a8e8371dcc3ba31c530174640c9001c29b34e7) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 6 ++++++ boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 715eedeb0e8a..e2d5b08cd300 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -27,6 +27,7 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; + zephyr,entropy = &psa_rng; }; aliases { @@ -109,6 +110,11 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_bellboard { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index d5fea020431f..4a8f5972227f 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -28,12 +28,18 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpurad_bellboard { From 0d220f23e4eb1c5e9e306879b0b42502b5c148be Mon Sep 17 00:00:00 2001 From: Sergey Korotkov Date: Fri, 31 Oct 2025 13:02:15 +0100 Subject: [PATCH 0511/3334] [nrf noup] boards: nordic: Enable PSA RNG for nrf9280 Noup since Ironside not available upstream and it is required for PSA RNG. This enables the PSA RNG as the default Zephyr entropy provider for the nrf9280pdk cpuapp and cpurad targets. Signed-off-by: Sergey Korotkov (cherry picked from commit c1c66b9cffad1fea2d0b9d4c028f33ebe438dc3f) --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 6 ++++++ boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 622fc04e96af..19dd5e208063 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -26,6 +26,7 @@ zephyr,shell-uart = &uart136; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { @@ -107,6 +108,11 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_ram0x_region { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index 5efa7dbd471c..91d967ea34aa 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -28,12 +28,18 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_cpurad_ram0x_region { From 2b643c4531d760220a27d9cebb1296b502afcc65 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Wed, 5 Nov 2025 14:16:33 +0100 Subject: [PATCH 0512/3334] [nrf noup] ci: Extend test spec for CI-ble-test We want to run CI when Nordic specific arch, soc, or board changes are done. Running CI on such changes would have prevented that https://github.com/nrfconnect/sdk-nrf/pull/25230 broke this CI plan. Signed-off-by: Rubin Gerritsen (cherry picked from commit 81edaae95618fa845f67957037fe22bc8b063a84) --- .github/test-spec.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 76def875e0be..5fdf9c0ca782 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -86,6 +86,8 @@ - "samples/tfm_integration/**/*" "CI-ble-test": + - any: + - "arch/arm/**/*" - any: - "drivers/bluetooth/**/*" - any: @@ -97,7 +99,12 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/hci_ipc/**/*" + - any: + - "boards/nordic/nrf5*" + - any: + - "soc/nordic/**/*" + - any: + - "subsys/pm/**/*" "CI-ble-samples-test": - any: From e471dafe200d726897d7573d76b4e91204130e9f Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 6 Nov 2025 12:51:08 +0100 Subject: [PATCH 0513/3334] [nrf noup] tests: drivers: mspi: flash: disable psa_rng Not needed for this test and prevents from building with CONFIG_MULTITHREADING=n. Changes for h20 rad are similar, but needed to test cases filtering working only. Signed-off-by: Piotr Kosycarz (cherry picked from commit 164b47d3094202c9ac5b756aa2648d2ce5822680) --- .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 ++++ .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 + .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 6e0d84e07cdb..2e6b6cf5eacc 100644 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -8,6 +8,10 @@ aliases { mspi0 = &exmif; }; + + psa_rng: psa-rng { + status = "disabled"; + }; }; &gpio6 { diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..a026df97a458 --- /dev/null +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +CONFIG_PM=n diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..09b4edc100a4 --- /dev/null +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,5 @@ +/ { + psa_rng: psa-rng { + status = "disabled"; + }; +}; From 6d5efe3b80df4e7caf632647841d8ea4cc25881e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 8 Apr 2025 10:16:33 +0100 Subject: [PATCH 0514/3334] [nrf noup] mgmt: mcumgr: Fix nRF5340 network core hook Fixes an issue whereby just enabling hooks would enable the nrf5340 network core hook despite lacking other requirements Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 39f9f799bedb38a8216312c72fc605581b85480f) --- subsys/mgmt/mcumgr/CMakeLists.txt | 13 +++++++------ subsys/mgmt/mcumgr/Kconfig | 2 +- subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 15 +++------------ subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 ++++++++ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index ad088eca0677..3bb21e16f798 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -17,10 +17,11 @@ add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) -if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +if(CONFIG_MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 1c6a3a2a5162..c45cb7f81d6b 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,7 @@ menuconfig MCUMGR bool "mcumgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) + imply BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP && MCUMGR_GRP_IMG && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c index f1ac8a168e65..b372ce4e4945 100644 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -8,19 +8,10 @@ #include #include "bootutil/bootutil_public.h" -#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 -/* Sysbuild */ -#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER -#else -/* Legacy child/parent */ -#define NET_CORE_IMAGE 1 -#endif - -int boot_read_swap_state_primary_slot_hook(int image_index, - struct boot_swap_state *state) +int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state) { - if (image_index == NET_CORE_IMAGE) { - /* Pretend that primary slot of image 1 unpopulated */ + if (image_index == CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER) { + /* Pretend that primary slot of the network core update image is unpopulated */ state->magic = BOOT_MAGIC_UNSET; state->swap_type = BOOT_SWAP_TYPE_NONE; state->image_num = image_index; diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index 25979180e2c9..e64f15abd2e6 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -237,6 +237,14 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS This will enable the slot info function hooks which can be used to add additional information to responses. +config MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK + bool "nRF5340 network core bootutil hook" + depends on SOC_NRF5340_CPUAPP && BOOT_IMAGE_ACCESS_HOOKS && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 + default y + help + This option will enable a bootutil hook that populates the network core update image + slot with dummy data to allow for uploading a firmware update to the network core. + module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" From efadad5f9c1cca4ccfb6903cca8897558f1b1e2e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Thu, 6 Nov 2025 20:37:33 +0100 Subject: [PATCH 0515/3334] [nrf noup] drivers: can: mcan: implement CAN_MODE_ONE_SHOT Implement CAN_MODE_ONE_SHOT in MCAN impementation. The implementation contains a workaround for a bug in the MCAN IP which prevents an IRQ from triggering. This is a noup as the workaround is too complicated and the feature is too niche to be accepted it upstream. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 03695ed17974fb0d6a0bae360d431fa4c984972f) --- drivers/can/Kconfig.mcan | 15 ++++ drivers/can/can_mcan.c | 114 +++++++++++++++++++++++++- include/zephyr/drivers/can/can_mcan.h | 1 + 3 files changed, 128 insertions(+), 2 deletions(-) diff --git a/drivers/can/Kconfig.mcan b/drivers/can/Kconfig.mcan index db09fc800c11..96c5f22446f6 100644 --- a/drivers/can/Kconfig.mcan +++ b/drivers/can/Kconfig.mcan @@ -7,3 +7,18 @@ config CAN_MCAN bool help Enable the Bosch M_CAN CAN IP module driver backend. + +if CAN_MCAN + +config CAN_MCAN_TXBCF_POLL_INTERVAL_MS + int "Polling interval in milliseconds of TXBCF register if DAR is enabled" + default 75 + help + When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, + is enabled, and a transmission fails, a bug in the MCAN IP prevents the + TCF (Transmission Cancellation Finalized) interrupt from triggering, + despite the correct bit being set in the TXBCF register. It is thus + necessary to poll TXBCF register to detect when a transmission failed if + DAR is enabled. + +endif # CAN_MCAN diff --git a/drivers/can/can_mcan.c b/drivers/can/can_mcan.c index a69a4b2398df..e82cac4f19ad 100644 --- a/drivers/can/can_mcan.c +++ b/drivers/can/can_mcan.c @@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(can_mcan, CONFIG_CAN_LOG_LEVEL); #define CAN_INIT_TIMEOUT_MS 100 +#define TXBCF_TIMER_TIMEOUT K_MSEC(CONFIG_CAN_MCAN_TXBCF_POLL_INTERVAL_MS) int can_mcan_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) { @@ -276,7 +277,7 @@ int can_mcan_get_capabilities(const struct device *dev, can_mode_t *cap) { ARG_UNUSED(dev); - *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; + *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; if (IS_ENABLED(CONFIG_CAN_MANUAL_RECOVERY_MODE)) { *cap |= CAN_MODE_MANUAL_RECOVERY; @@ -322,12 +323,78 @@ int can_mcan_start(const struct device *dev) return err; } + uint32_t cccr; + + err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); + if (err != 0) { + return err; + } + + if (cccr & CAN_MCAN_CCCR_DAR) { + /* + * When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, + * is enabled, and a transmission fails, a bug in the MCAN IP prevents the + * TCF (Transmission Cancellation Finalized) interrupt from triggering, + * despite the correct bit being set in the TXBCF register. It is thus + * necessary to poll TXBCF register to detect when a transmission failed if + * DAR is enabled. + */ + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + data->common.started = true; pm_device_busy_set(dev); return err; } +static int can_mcan_read_txbcf(const struct device *dev) +{ + const struct can_mcan_config *config = dev->config; + const struct can_mcan_callbacks *cbs = config->callbacks; + struct can_mcan_data *data = dev->data; + uint32_t txbcfs; + int err; + can_tx_callback_t tx_cb; + void *user_data; + + err = can_mcan_read_reg(dev, CAN_MCAN_TXBCF, &txbcfs); + if (err != 0) { + LOG_ERR("failed to read tx cancellation finished (err %d)", err); + return err; + } + + if (txbcfs == 0) { + return 0; + } + + for (size_t tx_idx = 0; tx_idx < cbs->num_tx; tx_idx++) { + if ((txbcfs & BIT(tx_idx)) == 0) { + continue; + } + + if (cbs->tx[tx_idx].function == NULL) { + continue; + } + + tx_cb = cbs->tx[tx_idx].function; + user_data = cbs->tx[tx_idx].user_data; + cbs->tx[tx_idx].function = NULL; + LOG_DBG("tx buffer cancellation finished (idx %u)", tx_idx); + k_sem_give(&data->tx_sem); + tx_cb(dev, -EIO, user_data); + } + + return 0; +} + +static void can_mcan_txbcf_timer_handler(struct k_timer *timer_id) +{ + const struct device *dev = k_timer_user_data_get(timer_id); + + can_mcan_read_txbcf(dev); +} + static bool can_mcan_rx_filters_exist(const struct device *dev) { const struct can_mcan_config *config = dev->config; @@ -362,6 +429,8 @@ int can_mcan_stop(const struct device *dev) return -EALREADY; } + k_timer_stop(&data->txbcf_timer); + /* CAN transmissions are automatically stopped when entering init mode */ err = can_mcan_enter_init_mode(dev, K_MSEC(CAN_INIT_TIMEOUT_MS)); if (err != 0) { @@ -402,7 +471,7 @@ int can_mcan_stop(const struct device *dev) int can_mcan_set_mode(const struct device *dev, can_mode_t mode) { - can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; + can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; struct can_mcan_data *data = dev->data; uint32_t cccr; uint32_t test; @@ -460,6 +529,13 @@ int can_mcan_set_mode(const struct device *dev, can_mode_t mode) } #endif /* CONFIG_CAN_FD_MODE */ + if ((mode & CAN_MODE_ONE_SHOT) != 0) { + /* Disable Automatic Retransmission */ + cccr |= CAN_MCAN_CCCR_DAR; + } else { + cccr &= ~CAN_MCAN_CCCR_DAR; + } + err = can_mcan_write_reg(dev, CAN_MCAN_CCCR, cccr); if (err != 0) { goto unlock; @@ -1053,6 +1129,21 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim } } + uint32_t cccr; + + err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); + if (err != 0) { + return err; + } + + if (cccr & CAN_MCAN_CCCR_DAR) { + /* + * TXBCR is cleared after TXBAR is set. Stop timer to ensure + * TXBCR is not read before TXBAR has been set. + */ + k_timer_stop(&data->txbcf_timer); + } + __ASSERT_NO_MSG(put_idx < cbs->num_tx); cbs->tx[put_idx].function = callback; cbs->tx[put_idx].user_data = user_data; @@ -1063,10 +1154,18 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim goto err_unlock; } + if (cccr & CAN_MCAN_CCCR_DAR) { + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + k_mutex_unlock(&data->tx_mtx); return 0; err_unlock: + if (cccr & CAN_MCAN_CCCR_DAR) { + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + k_mutex_unlock(&data->tx_mtx); k_sem_give(&data->tx_sem); @@ -1424,6 +1523,8 @@ int can_mcan_init(const struct device *dev) k_mutex_init(&data->lock); k_mutex_init(&data->tx_mtx); k_sem_init(&data->tx_sem, cbs->num_tx, cbs->num_tx); + k_timer_init(&data->txbcf_timer, can_mcan_txbcf_timer_handler, NULL); + k_timer_user_data_set(&data->txbcf_timer, (void *)dev); if (config->common.phy != NULL && !device_is_ready(config->common.phy)) { LOG_ERR("CAN transceiver not ready"); @@ -1565,5 +1666,14 @@ int can_mcan_init(const struct device *dev) return err; } + /* + * Interrupt on every TX buffer cancellation finished event. + */ + reg = CAN_MCAN_TXBCIE_CFIE; + err = can_mcan_write_reg(dev, CAN_MCAN_TXBCIE, reg); + if (err != 0) { + return err; + } + return can_mcan_clear_mram(dev, 0, config->mram_size); } diff --git a/include/zephyr/drivers/can/can_mcan.h b/include/zephyr/drivers/can/can_mcan.h index 25eeb437efba..28aa899371c8 100644 --- a/include/zephyr/drivers/can/can_mcan.h +++ b/include/zephyr/drivers/can/can_mcan.h @@ -1065,6 +1065,7 @@ struct can_mcan_data { struct k_mutex lock; struct k_sem tx_sem; struct k_mutex tx_mtx; + struct k_timer txbcf_timer; void *custom; } __aligned(4); From 8116dbcc6173ae9a1d6c526ec39f6c9b8c09de8d Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 12 Sep 2025 12:38:25 +0200 Subject: [PATCH 0516/3334] [nrf noup] tests: ram_context_for_isr: Disable KMU by default Disable the KMU by default for all the NRF54L and NRF71 devices for this test. With the current configuration this test is incompatible with the KMU because it changes the placement of the RAM in the linker files and this collides with the KMU logic. But it also does not need the KMU so there is no need to be there. This is a noup because the configuration (and KMU support) is only placed in ncs. Reverted and reapplied noup to maintain all changes in a single commit. The KMU dependency to reserve the top RAM address is planned to be done in dts (NCSDK-31980). Hopefully when this is done this noup can be removed. Signed-off-by: Georgios Vasilakis Signed-off-by: Robert Robinson (cherry picked from commit 0de5607892a0f68f3d1b7ca3572cb92ab01313c4) --- .../boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ++++++ .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ++++++ .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ++++++ .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ++++++ .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ++++++ .../boards/nrf7120pdk_nrf7120_cpuapp.conf | 6 ++++++ 6 files changed, 36 insertions(+) create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n From 7ce0b7556bf799b73249abe9057c62f98c7546c9 Mon Sep 17 00:00:00 2001 From: Zhijie Zhong Date: Wed, 29 Oct 2025 11:31:01 +0800 Subject: [PATCH 0517/3334] [nrf fromtree] bluetooth: host: Add bt_gatt_cb_unregister() to unregister GATT callbacks New API bt_gatt_cb_unregister, use _SAFE iteration for callback list. Signed-off-by: Zhijie Zhong (cherry picked from commit c222dcff8c35539d62a8a901b09ea4329877d023) --- doc/releases/release-notes-4.4.rst | 6 ++++++ include/zephyr/bluetooth/gatt.h | 11 +++++++++++ subsys/bluetooth/host/gatt.c | 17 +++++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index d6277acc7161..9622d9c5bd38 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -65,6 +65,12 @@ Deprecated APIs and options New APIs and options ==================== +* Bluetooth + + * Host + + * :c:func:`bt_gatt_cb_unregister` Added an API to unregister GATT callback handlers. + .. Link to new APIs here, in a group if you think it's necessary, no need to get fancy just list the link, that should contain the documentation. If you feel diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 17b125d602c5..8023e3a0d9ee 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -622,6 +622,17 @@ static inline const char *bt_gatt_err_to_str(int gatt_err) */ void bt_gatt_cb_register(struct bt_gatt_cb *cb); +/** @brief Unregister GATT callbacks. + * + * Unregister callbacks for monitoring the state of GATT. The callback + * struct should be one that was previously registered. + * + * @param cb Callback struct. + * + * @return 0 in case of success or negative value in case of error. + */ +int bt_gatt_cb_unregister(struct bt_gatt_cb *cb); + /** @brief Register GATT authorization callbacks. * * Register callbacks to perform application-specific authorization of GATT diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index ea1dc73e158a..4e8b7c78244c 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1628,6 +1628,19 @@ void bt_gatt_cb_register(struct bt_gatt_cb *cb) sys_slist_append(&callback_list, &cb->node); } +int bt_gatt_cb_unregister(struct bt_gatt_cb *cb) +{ + if (cb == NULL) { + return -EINVAL; + } + + if (!sys_slist_find_and_remove(&callback_list, &cb->node)) { + return -ENOENT; + } + + return 0; +} + #if defined(CONFIG_BT_GATT_DYNAMIC_DB) static void db_changed(void) { @@ -6023,9 +6036,9 @@ void bt_gatt_connected(struct bt_conn *conn) void bt_gatt_att_max_mtu_changed(struct bt_conn *conn, uint16_t tx, uint16_t rx) { - struct bt_gatt_cb *cb; + struct bt_gatt_cb *cb, *tmp; - SYS_SLIST_FOR_EACH_CONTAINER(&callback_list, cb, node) { + SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&callback_list, cb, tmp, node) { if (cb->att_mtu_updated) { cb->att_mtu_updated(conn, tx, rx); } From ba326ed79ee187960ef3cdf60c130d275f1fe1c3 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 11 Nov 2025 14:18:16 +0100 Subject: [PATCH 0518/3334] [nrf fromtree] bluetooth: host: Deprecate CONFIG_BT_SIGNING This commit deprecates: - the `CONFIG_BT_SIGNING` Kconfig option - `BT_GATT_CHRC_AUTH` property IOW, this commit deprecates the LE Security mode 2 support. Explanation: Erratum ES-26047 introduced in Bluetooth Core Specification v6.2 requires SingCounter to be persistently stored to prevent replay attacks. Currently, the Host doesn't store SignCounter, therefore the device is vulnerable to replay attacks after reboot. Additionally, the current implementation doesn't assume that SignCounter of a received message can be incremented by more than one and thus may not validate correct message. The Bluetooth Security and Privacy Best Practices Guide recommends to not using Data signing and recommends to use LE Security mode 1 levels 2, 3 or 4 instead. The Signed Write Without Response sub-procedure, which is the only user of Data signing, is optional (see Vol 3, Part G, Table 4.1). See also ES-18901. The aforementioned reasons make no sense to keep this feature. Signed-off-by: Pavel Vasilyev (cherry picked from commit b7b35b89edb571be60fce832cb61fdc293e3ca2a) --- doc/releases/migration-guide-4.4.rst | 6 ++++ include/zephyr/bluetooth/gatt.h | 4 ++- samples/bluetooth/direct_adv/prj.conf | 1 - samples/bluetooth/direct_adv/src/main.c | 23 +++++++------ samples/bluetooth/peripheral/prj.conf | 1 - samples/bluetooth/peripheral/src/main.c | 33 ------------------- .../bluetooth/peripheral_accept_list/prj.conf | 1 - .../peripheral_accept_list/src/main.c | 18 +++++----- subsys/bluetooth/host/Kconfig | 1 + subsys/bluetooth/host/shell/gatt.c | 4 --- tests/bluetooth/init/prj_10.conf | 1 - tests/bluetooth/init/prj_11.conf | 1 - tests/bluetooth/init/prj_12.conf | 1 - tests/bluetooth/init/prj_13.conf | 1 - tests/bluetooth/init/prj_14.conf | 1 - tests/bluetooth/init/prj_17.conf | 1 - tests/bluetooth/init/prj_20.conf | 1 - tests/bluetooth/init/prj_21.conf | 1 - tests/bluetooth/init/prj_7.conf | 1 - tests/bluetooth/init/prj_8.conf | 1 - tests/bluetooth/init/prj_9.conf | 1 - tests/bluetooth/init/prj_ctlr.conf | 1 - tests/bluetooth/init/prj_ctlr_4_0.conf | 1 - tests/bluetooth/init/prj_ctlr_4_0_dbg.conf | 1 - tests/bluetooth/init/prj_ctlr_5_x_dbg.conf | 1 - tests/bluetooth/init/prj_ctlr_dbg.conf | 1 - tests/bluetooth/init/prj_ctlr_ticker.conf | 1 - tests/bluetooth/init/prj_ctlr_tiny.conf | 1 - tests/bluetooth/init/prj_llcp.conf | 1 - tests/bluetooth/shell/audio.conf | 1 - tests/bluetooth/shell/log.conf | 1 - tests/bluetooth/shell/mesh.conf | 1 - tests/bluetooth/shell/prj.conf | 1 - tests/bluetooth/shell/prj_br.conf | 1 - tests/bluetooth/tester/prj.conf | 1 - tests/bluetooth/tester/src/btp/btp_gatt.h | 8 ----- tests/bluetooth/tester/src/btp_gatt.c | 33 ------------------- tests/bsim/bluetooth/ll/conn/prj_split.conf | 1 - .../bsim/bluetooth/ll/conn/prj_split_1ms.conf | 1 - .../bluetooth/ll/conn/prj_split_hci_uart.conf | 1 - .../bluetooth/ll/conn/prj_split_low_lat.conf | 1 - .../bluetooth/ll/conn/prj_split_privacy.conf | 1 - .../ll/conn/prj_split_single_timer.conf | 1 - .../bluetooth/ll/conn/prj_split_tx_defer.conf | 1 - .../edtt/gatt_test_app/src/gatt/service_f_1.c | 3 +- .../ll/edtt/tests_scripts/gatt.llcp.test_list | 8 ++--- tests/bsim/bluetooth/tester/src/bsim_btp.c | 2 -- 47 files changed, 36 insertions(+), 142 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index b10c86e9f23b..7966cd0f25e3 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -35,6 +35,12 @@ Device Drivers and Devicetree Bluetooth ********* +Bluetooth Host +============== + +* :kconfig:option:`CONFIG_BT_SIGNING` has been deprecated. +* :c:macro:`BT_GATT_CHRC_AUTH` has been deprecated. + Networking ********** diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 8023e3a0d9ee..353f8b248edd 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -462,9 +462,11 @@ struct bt_gatt_authorization_cb { /** * @brief Characteristic Authenticated Signed Writes property. * + * @deprecated This API is deprecated. + * * If set, permits signed writes to the Characteristic Value. */ -#define BT_GATT_CHRC_AUTH 0x40 +#define BT_GATT_CHRC_AUTH 0x40 __DEPRECATED_MACRO /** * @brief Characteristic Extended Properties property. * diff --git a/samples/bluetooth/direct_adv/prj.conf b/samples/bluetooth/direct_adv/prj.conf index 2af54670b51c..410ed9166302 100644 --- a/samples/bluetooth/direct_adv/prj.conf +++ b/samples/bluetooth/direct_adv/prj.conf @@ -4,7 +4,6 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT=y CONFIG_LOG=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DIS=y CONFIG_BT_ATT_PREPARE_COUNT=1 diff --git a/samples/bluetooth/direct_adv/src/main.c b/samples/bluetooth/direct_adv/src/main.c index 992c6e46059c..24c3a53940c1 100644 --- a/samples/bluetooth/direct_adv/src/main.c +++ b/samples/bluetooth/direct_adv/src/main.c @@ -32,26 +32,25 @@ static const struct bt_uuid_128 read_characteristic_uuid = BT_UUID_INIT_128( static const struct bt_uuid_128 write_characteristic_uuid = BT_UUID_INIT_128( BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef2)); -static int signed_value; +static int stored_value; static struct bt_le_adv_param adv_param; static bt_addr_le_t bond_addr; -static ssize_t read_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, - void *buf, uint16_t len, uint16_t offset) +static ssize_t read_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, + uint16_t len, uint16_t offset) { - int *value = &signed_value; + int *value = &stored_value; return bt_gatt_attr_read(conn, attr, buf, len, offset, value, - sizeof(signed_value)); + sizeof(stored_value)); } -static ssize_t write_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, - const void *buf, uint16_t len, uint16_t offset, - uint8_t flags) +static ssize_t write_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, + uint16_t len, uint16_t offset, uint8_t flags) { - int *value = &signed_value; + int *value = &stored_value; - if (offset + len > sizeof(signed_value)) { + if (offset + len > sizeof(stored_value)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET); } @@ -66,11 +65,11 @@ BT_GATT_SERVICE_DEFINE(primary_service, BT_GATT_CHARACTERISTIC(&read_characteristic_uuid.uuid, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, - read_signed, NULL, NULL), + read_cb, NULL, NULL), BT_GATT_CHARACTERISTIC(&write_characteristic_uuid.uuid, BT_GATT_CHRC_WRITE, BT_GATT_PERM_WRITE_ENCRYPT, - NULL, write_signed, NULL), + NULL, write_cb, NULL), ); static const struct bt_data ad[] = { diff --git a/samples/bluetooth/peripheral/prj.conf b/samples/bluetooth/peripheral/prj.conf index f788fa670aa3..493660afa339 100644 --- a/samples/bluetooth/peripheral/prj.conf +++ b/samples/bluetooth/peripheral/prj.conf @@ -4,7 +4,6 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT=y CONFIG_LOG=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DIS=y CONFIG_BT_ATT_PREPARE_COUNT=5 diff --git a/samples/bluetooth/peripheral/src/main.c b/samples/bluetooth/peripheral/src/main.c index db77691db613..3f15aee100af 100644 --- a/samples/bluetooth/peripheral/src/main.c +++ b/samples/bluetooth/peripheral/src/main.c @@ -130,35 +130,6 @@ static struct bt_gatt_cep vnd_long_cep = { .properties = BT_GATT_CEP_RELIABLE_WRITE, }; -static int signed_value; - -static ssize_t read_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, - void *buf, uint16_t len, uint16_t offset) -{ - const char *value = attr->user_data; - - return bt_gatt_attr_read(conn, attr, buf, len, offset, value, - sizeof(signed_value)); -} - -static ssize_t write_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, - const void *buf, uint16_t len, uint16_t offset, - uint8_t flags) -{ - uint8_t *value = attr->user_data; - - if (offset + len > sizeof(signed_value)) { - return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET); - } - - memcpy(value + offset, buf, len); - - return len; -} - -static const struct bt_uuid_128 vnd_signed_uuid = BT_UUID_INIT_128( - BT_UUID_128_ENCODE(0x13345678, 0x1234, 0x5678, 0x1334, 0x56789abcdef3)); - static const struct bt_uuid_128 vnd_write_cmd_uuid = BT_UUID_INIT_128( BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef4)); @@ -208,10 +179,6 @@ BT_GATT_SERVICE_DEFINE(vnd_svc, BT_GATT_PERM_PREPARE_WRITE, read_vnd, write_long_vnd, &vnd_long_value), BT_GATT_CEP(&vnd_long_cep), - BT_GATT_CHARACTERISTIC(&vnd_signed_uuid.uuid, BT_GATT_CHRC_READ | - BT_GATT_CHRC_WRITE | BT_GATT_CHRC_AUTH, - BT_GATT_PERM_READ | BT_GATT_PERM_WRITE, - read_signed, write_signed, &signed_value), BT_GATT_CHARACTERISTIC(&vnd_write_cmd_uuid.uuid, BT_GATT_CHRC_WRITE_WITHOUT_RESP, BT_GATT_PERM_WRITE, NULL, diff --git a/samples/bluetooth/peripheral_accept_list/prj.conf b/samples/bluetooth/peripheral_accept_list/prj.conf index 563ee758d2ec..a9a0e6ecedc8 100644 --- a/samples/bluetooth/peripheral_accept_list/prj.conf +++ b/samples/bluetooth/peripheral_accept_list/prj.conf @@ -4,7 +4,6 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT=y CONFIG_LOG=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DIS=y CONFIG_BT_ATT_PREPARE_COUNT=1 diff --git a/samples/bluetooth/peripheral_accept_list/src/main.c b/samples/bluetooth/peripheral_accept_list/src/main.c index e14ea8dd9977..fcb930bdca55 100644 --- a/samples/bluetooth/peripheral_accept_list/src/main.c +++ b/samples/bluetooth/peripheral_accept_list/src/main.c @@ -29,26 +29,26 @@ static const struct bt_uuid_128 read_characteristic_uuid = BT_UUID_INIT_128( static const struct bt_uuid_128 write_characteristic_uuid = BT_UUID_INIT_128( BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef2)); -static int signed_value; +static int stored_value; static struct bt_le_adv_param adv_param; static int bond_count; -static ssize_t read_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, +static ssize_t read_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset) { - int *value = &signed_value; + int *value = &stored_value; return bt_gatt_attr_read(conn, attr, buf, len, offset, value, - sizeof(signed_value)); + sizeof(stored_value)); } -static ssize_t write_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, +static ssize_t write_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags) { - int *value = &signed_value; + int *value = &stored_value; - if (offset + len > sizeof(signed_value)) { + if (offset + len > sizeof(stored_value)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET); } @@ -63,11 +63,11 @@ BT_GATT_SERVICE_DEFINE(primary_service, BT_GATT_CHARACTERISTIC(&read_characteristic_uuid.uuid, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, - read_signed, NULL, NULL), + read_cb, NULL, NULL), BT_GATT_CHARACTERISTIC(&write_characteristic_uuid.uuid, BT_GATT_CHRC_WRITE, BT_GATT_PERM_WRITE_ENCRYPT, - NULL, write_signed, NULL), + NULL, write_cb, NULL), ); static const struct bt_data ad[] = { diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 0d0bfd20a883..9eba33273066 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -562,6 +562,7 @@ config BT_RPA_SHARING config BT_SIGNING bool "Data signing support" + select DEPRECATED help This option enables data signing which is used for transferring authenticated data in an unencrypted connection. diff --git a/subsys/bluetooth/host/shell/gatt.c b/subsys/bluetooth/host/shell/gatt.c index 00dbd8dc8e26..013b878a6af3 100644 --- a/subsys/bluetooth/host/shell/gatt.c +++ b/subsys/bluetooth/host/shell/gatt.c @@ -172,10 +172,6 @@ static void print_chrc_props(uint8_t properties) bt_shell_print("[indicate]"); } - if (properties & BT_GATT_CHRC_AUTH) { - bt_shell_print("[auth]"); - } - if (properties & BT_GATT_CHRC_EXT_PROP) { bt_shell_print("[ext prop]"); } diff --git a/tests/bluetooth/init/prj_10.conf b/tests/bluetooth/init/prj_10.conf index 81503cadb9a1..a44edf5f7b64 100644 --- a/tests/bluetooth/init/prj_10.conf +++ b/tests/bluetooth/init/prj_10.conf @@ -2,7 +2,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_11.conf b/tests/bluetooth/init/prj_11.conf index a5492c5c1eb4..84510c4b8c86 100644 --- a/tests/bluetooth/init/prj_11.conf +++ b/tests/bluetooth/init/prj_11.conf @@ -2,7 +2,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_12.conf b/tests/bluetooth/init/prj_12.conf index 16fc86e8f823..3bf4b202d62e 100644 --- a/tests/bluetooth/init/prj_12.conf +++ b/tests/bluetooth/init/prj_12.conf @@ -1,7 +1,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_13.conf b/tests/bluetooth/init/prj_13.conf index aa8cc1220837..426b3d6aed5f 100644 --- a/tests/bluetooth/init/prj_13.conf +++ b/tests/bluetooth/init/prj_13.conf @@ -1,7 +1,6 @@ CONFIG_BT=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_14.conf b/tests/bluetooth/init/prj_14.conf index 93423f647420..2a8566b9b467 100644 --- a/tests/bluetooth/init/prj_14.conf +++ b/tests/bluetooth/init/prj_14.conf @@ -2,5 +2,4 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_17.conf b/tests/bluetooth/init/prj_17.conf index 5e504b9ead15..e179900c641b 100644 --- a/tests/bluetooth/init/prj_17.conf +++ b/tests/bluetooth/init/prj_17.conf @@ -2,7 +2,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_20.conf b/tests/bluetooth/init/prj_20.conf index 4b80a6b44271..80c0ad4657d4 100644 --- a/tests/bluetooth/init/prj_20.conf +++ b/tests/bluetooth/init/prj_20.conf @@ -2,7 +2,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_21.conf b/tests/bluetooth/init/prj_21.conf index 49c4c6eb452b..d796dcbdfc4a 100644 --- a/tests/bluetooth/init/prj_21.conf +++ b/tests/bluetooth/init/prj_21.conf @@ -2,7 +2,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_7.conf b/tests/bluetooth/init/prj_7.conf index 93423f647420..2a8566b9b467 100644 --- a/tests/bluetooth/init/prj_7.conf +++ b/tests/bluetooth/init/prj_7.conf @@ -2,5 +2,4 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_8.conf b/tests/bluetooth/init/prj_8.conf index 2fdd77730098..6dfcf4d7f59c 100644 --- a/tests/bluetooth/init/prj_8.conf +++ b/tests/bluetooth/init/prj_8.conf @@ -2,6 +2,5 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_9.conf b/tests/bluetooth/init/prj_9.conf index 2fdd77730098..6dfcf4d7f59c 100644 --- a/tests/bluetooth/init/prj_9.conf +++ b/tests/bluetooth/init/prj_9.conf @@ -2,6 +2,5 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_ctlr.conf b/tests/bluetooth/init/prj_ctlr.conf index c733ef4ad3fc..67a638b1e078 100644 --- a/tests/bluetooth/init/prj_ctlr.conf +++ b/tests/bluetooth/init/prj_ctlr.conf @@ -3,7 +3,6 @@ CONFIG_BT_HCI_ACL_FLOW_CONTROL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_4_0.conf b/tests/bluetooth/init/prj_ctlr_4_0.conf index 98dcaaa746c8..da51ab380e86 100644 --- a/tests/bluetooth/init/prj_ctlr_4_0.conf +++ b/tests/bluetooth/init/prj_ctlr_4_0.conf @@ -27,7 +27,6 @@ CONFIG_BT_HCI_VS=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_4_0_dbg.conf b/tests/bluetooth/init/prj_ctlr_4_0_dbg.conf index 476213c82731..bc4125363d60 100644 --- a/tests/bluetooth/init/prj_ctlr_4_0_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_4_0_dbg.conf @@ -31,7 +31,6 @@ CONFIG_BT_CTLR_VS_SCAN_REQ_RX=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf b/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf index 828b486b88fc..0793716a8674 100644 --- a/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf @@ -55,7 +55,6 @@ CONFIG_BT_ISO_SYNC_RECEIVER=y CONFIG_BT_ISO_CENTRAL=y CONFIG_BT_ISO_PERIPHERAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_ctlr_dbg.conf b/tests/bluetooth/init/prj_ctlr_dbg.conf index 956c562c5aa0..497d684c9e29 100644 --- a/tests/bluetooth/init/prj_ctlr_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_dbg.conf @@ -39,7 +39,6 @@ CONFIG_BT_HCI_MESH_EXT=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_ctlr_ticker.conf b/tests/bluetooth/init/prj_ctlr_ticker.conf index ac15e8662a6b..bf5f351c72a2 100644 --- a/tests/bluetooth/init/prj_ctlr_ticker.conf +++ b/tests/bluetooth/init/prj_ctlr_ticker.conf @@ -37,7 +37,6 @@ CONFIG_BT_HCI_MESH_EXT=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_ctlr_tiny.conf b/tests/bluetooth/init/prj_ctlr_tiny.conf index e3413d68e981..b625ea9918bb 100644 --- a/tests/bluetooth/init/prj_ctlr_tiny.conf +++ b/tests/bluetooth/init/prj_ctlr_tiny.conf @@ -31,7 +31,6 @@ CONFIG_BT_HCI_VS=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_llcp.conf b/tests/bluetooth/init/prj_llcp.conf index 2bbcfb83834a..2baa0f1e158e 100644 --- a/tests/bluetooth/init/prj_llcp.conf +++ b/tests/bluetooth/init/prj_llcp.conf @@ -3,7 +3,6 @@ CONFIG_BT_HCI_ACL_FLOW_CONTROL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/shell/audio.conf b/tests/bluetooth/shell/audio.conf index 45236a49afae..a7f19336e777 100644 --- a/tests/bluetooth/shell/audio.conf +++ b/tests/bluetooth/shell/audio.conf @@ -21,7 +21,6 @@ CONFIG_BT_GATT_DYNAMIC_DB=y CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y CONFIG_BT_GATT_AUTO_UPDATE_MTU=y CONFIG_BT_L2CAP_ECRED=y -CONFIG_BT_SIGNING=y CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=5 CONFIG_BT_SHELL=y diff --git a/tests/bluetooth/shell/log.conf b/tests/bluetooth/shell/log.conf index 2da43186e19f..7cb83fb87644 100644 --- a/tests/bluetooth/shell/log.conf +++ b/tests/bluetooth/shell/log.conf @@ -8,7 +8,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/shell/mesh.conf b/tests/bluetooth/shell/mesh.conf index 0336d417fb51..1e11b5ae75ca 100644 --- a/tests/bluetooth/shell/mesh.conf +++ b/tests/bluetooth/shell/mesh.conf @@ -9,7 +9,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 2c84d55bd69a..8a9fb1c0ee9e 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -10,7 +10,6 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_PASSKEY_KEYPRESS=y -CONFIG_BT_SIGNING=y CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/shell/prj_br.conf b/tests/bluetooth/shell/prj_br.conf index 3f27954ca230..e9afa4026a34 100644 --- a/tests/bluetooth/shell/prj_br.conf +++ b/tests/bluetooth/shell/prj_br.conf @@ -11,7 +11,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_HRS=y diff --git a/tests/bluetooth/tester/prj.conf b/tests/bluetooth/tester/prj.conf index 382ed5eb6cdc..901042287ce9 100644 --- a/tests/bluetooth/tester/prj.conf +++ b/tests/bluetooth/tester/prj.conf @@ -14,7 +14,6 @@ CONFIG_BT_SMP_MIN_ENC_KEY_SIZE=7 CONFIG_BT_SMP_ENFORCE_MITM=n CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y CONFIG_BT_SMP_APP_PAIRING_ACCEPT=y -CONFIG_BT_SIGNING=y CONFIG_BT_BONDABLE=y CONFIG_BT_ATT_PREPARE_COUNT=12 CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/tester/src/btp/btp_gatt.h b/tests/bluetooth/tester/src/btp/btp_gatt.h index e26b3767b6a9..1eef848aa30e 100644 --- a/tests/bluetooth/tester/src/btp/btp_gatt.h +++ b/tests/bluetooth/tester/src/btp/btp_gatt.h @@ -240,14 +240,6 @@ struct btp_gatt_write_without_rsp_cmd { uint8_t data[]; } __packed; -#define BTP_GATT_SIGNED_WRITE_WITHOUT_RSP 0x16 -struct btp_gatt_signed_write_without_rsp_cmd { - bt_addr_le_t address; - uint16_t handle; - uint16_t data_length; - uint8_t data[]; -} __packed; - #define BTP_GATT_WRITE 0x17 struct btp_gatt_write_cmd { bt_addr_le_t address; diff --git a/tests/bluetooth/tester/src/btp_gatt.c b/tests/bluetooth/tester/src/btp_gatt.c index e5f4b9584937..e487dd2884d1 100644 --- a/tests/bluetooth/tester/src/btp_gatt.c +++ b/tests/bluetooth/tester/src/btp_gatt.c @@ -1757,34 +1757,6 @@ static uint8_t write_without_rsp(const void *cmd, uint16_t cmd_len, return BTP_STATUS_SUCCESS; } -static uint8_t write_signed_without_rsp(const void *cmd, uint16_t cmd_len, - void *rsp, uint16_t *rsp_len) -{ - const struct btp_gatt_signed_write_without_rsp_cmd *cp = cmd; - struct bt_conn *conn; - - if (cmd_len < sizeof(*cp) || - cmd_len != sizeof(*cp) + sys_le16_to_cpu(cp->data_length)) { - return BTP_STATUS_FAILED; - } - - conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); - if (!conn) { - return BTP_STATUS_FAILED; - } - - if (bt_gatt_write_without_response(conn, sys_le16_to_cpu(cp->handle), - cp->data, - sys_le16_to_cpu(cp->data_length), - true) < 0) { - bt_conn_unref(conn); - return BTP_STATUS_FAILED; - } - - bt_conn_unref(conn); - return BTP_STATUS_SUCCESS; -} - static void write_rsp(struct bt_conn *conn, uint8_t err, struct bt_gatt_write_params *params) { @@ -2533,11 +2505,6 @@ static const struct btp_handler handlers[] = { .expect_len = BTP_HANDLER_LENGTH_VARIABLE, .func = write_without_rsp, }, - { - .opcode = BTP_GATT_SIGNED_WRITE_WITHOUT_RSP, - .expect_len = BTP_HANDLER_LENGTH_VARIABLE, - .func = write_signed_without_rsp, - }, { .opcode = BTP_GATT_WRITE, .expect_len = BTP_HANDLER_LENGTH_VARIABLE, diff --git a/tests/bsim/bluetooth/ll/conn/prj_split.conf b/tests/bsim/bluetooth/ll/conn/prj_split.conf index 94eae38bf62e..c888d586e4b3 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split.conf @@ -4,7 +4,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_1ms.conf b/tests/bsim/bluetooth/ll/conn/prj_split_1ms.conf index 58276bd991e6..def3752f0167 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_1ms.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_1ms.conf @@ -4,7 +4,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 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 f97b14c88a7b..0ef6b9fb783d 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_hci_uart.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_hci_uart.conf @@ -5,7 +5,6 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_SMP_SC_PAIR_ONLY=n -CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_low_lat.conf b/tests/bsim/bluetooth/ll/conn/prj_split_low_lat.conf index b00b6c74b934..b07055f8dba6 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_low_lat.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_low_lat.conf @@ -4,7 +4,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_privacy.conf b/tests/bsim/bluetooth/ll/conn/prj_split_privacy.conf index 1147e89ada69..02e83a4351f7 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_privacy.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_privacy.conf @@ -5,7 +5,6 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_SMP_SC_PAIR_ONLY=n -CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_single_timer.conf b/tests/bsim/bluetooth/ll/conn/prj_split_single_timer.conf index 9d446e0149f8..461b5e800958 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_single_timer.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_single_timer.conf @@ -4,7 +4,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_tx_defer.conf b/tests/bsim/bluetooth/ll/conn/prj_split_tx_defer.conf index 22dc32be4c42..147a8f7598bb 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_tx_defer.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_tx_defer.conf @@ -4,7 +4,6 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y -CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/service_f_1.c b/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/service_f_1.c index 374e639862af..04ea7f4b7c5d 100644 --- a/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/service_f_1.c +++ b/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/service_f_1.c @@ -1,5 +1,6 @@ /** * Copyright (c) 2019 Oticon A/S + * Copyright (c) 2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -381,7 +382,7 @@ static struct bt_gatt_attr service_f_1_attrs[] = { BT_GATT_PERM_READ, read_agg_format, NULL, &agg_format_value, 0xAF), BT_GATT_H_CHARACTERISTIC(BT_UUID_VALUE_V17, - BT_GATT_CHRC_READ | BT_GATT_CHRC_AUTH, + BT_GATT_CHRC_READ, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE, read_value_v17, NULL, &value_v17_value, 0xB0) }; diff --git a/tests/bsim/bluetooth/ll/edtt/tests_scripts/gatt.llcp.test_list b/tests/bsim/bluetooth/ll/edtt/tests_scripts/gatt.llcp.test_list index d606038298ce..d8ccaee301ef 100644 --- a/tests/bsim/bluetooth/ll/edtt/tests_scripts/gatt.llcp.test_list +++ b/tests/bsim/bluetooth/ll/edtt/tests_scripts/gatt.llcp.test_list @@ -8,8 +8,8 @@ GATT/SR/GAC/BV-01-C GATT/SR/GAD/BV-01-C GATT/SR/GAD/BV-02-C GATT/SR/GAD/BV-03-C -GATT/SR/GAD/BV-04-C -GATT/SR/GAD/BV-05-C +# GATT/SR/GAD/BV-04-C https://github.com/EDTTool/EDTT/issues/89 +# GATT/SR/GAD/BV-05-C https://github.com/EDTTool/EDTT/issues/89 GATT/SR/GAD/BV-06-C GATT/SR/GAR/BV-01-C GATT/SR/GAR/BI-01-C @@ -22,7 +22,7 @@ GATT/SR/GAR/BI-07-C GATT/SR/GAR/BI-09-C GATT/SR/GAR/BI-10-C #GATT/SR/GAR/BI-11-C https://github.com/EDTTool/EDTT/issues/82 -GATT/SR/GAR/BV-04-C +# GATT/SR/GAR/BV-04-C https://github.com/EDTTool/EDTT/issues/89 GATT/SR/GAR/BI-12-C GATT/SR/GAR/BI-13-C GATT/SR/GAR/BI-14-C @@ -64,7 +64,7 @@ GATT/SR/UNS/BI-02-C GATT/SR/GPA/BV-01-C GATT/SR/GPA/BV-02-C GATT/SR/GPA/BV-03-C -GATT/SR/GPA/BV-04-C +# GATT/SR/GPA/BV-04-C https://github.com/EDTTool/EDTT/issues/89 GATT/SR/GPA/BV-05-C GATT/SR/GPA/BV-06-C GATT/SR/GPA/BV-07-C diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.c b/tests/bsim/bluetooth/tester/src/bsim_btp.c index 2e24514b6606..19b196d1fe62 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.c +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.c @@ -410,8 +410,6 @@ static bool is_valid_gatt_packet_len(const struct btp_hdr *hdr, struct net_buf_s } case BTP_GATT_WRITE_WITHOUT_RSP: return buf_simple->len == 0U; - case BTP_GATT_SIGNED_WRITE_WITHOUT_RSP: - return buf_simple->len == 0U; case BTP_GATT_WRITE: return buf_simple->len == sizeof(struct btp_gatt_write_rp); case BTP_GATT_WRITE_LONG: From 5795561b0c43f152112133a447884f1166ed02e2 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 11 Nov 2025 14:32:46 +0100 Subject: [PATCH 0519/3334] [nrf fromtree] tests: bluetooth: init: Remove duplicate prj_.conf files Remove duplicated prj.conf file. prj_6, prj_7, prj_14 are identicall. Since prj_6.conf is unchanged, keeping it. prj_8, prj_9, prj_15 are identicall. Since prj_15.conf is unchanged, keeping it. Signed-off-by: Pavel Vasilyev (cherry picked from commit 66679c1886513e8e1c41da3e47ece2195a783ed8) --- tests/bluetooth/init/prj_14.conf | 5 ----- tests/bluetooth/init/prj_7.conf | 5 ----- tests/bluetooth/init/prj_8.conf | 6 ------ tests/bluetooth/init/prj_9.conf | 6 ------ tests/bluetooth/init/testcase.yaml | 12 ------------ 5 files changed, 34 deletions(-) delete mode 100644 tests/bluetooth/init/prj_14.conf delete mode 100644 tests/bluetooth/init/prj_7.conf delete mode 100644 tests/bluetooth/init/prj_8.conf delete mode 100644 tests/bluetooth/init/prj_9.conf diff --git a/tests/bluetooth/init/prj_14.conf b/tests/bluetooth/init/prj_14.conf deleted file mode 100644 index 2a8566b9b467..000000000000 --- a/tests/bluetooth/init/prj_14.conf +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_SMP=y -CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_7.conf b/tests/bluetooth/init/prj_7.conf deleted file mode 100644 index 2a8566b9b467..000000000000 --- a/tests/bluetooth/init/prj_7.conf +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_SMP=y -CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_8.conf b/tests/bluetooth/init/prj_8.conf deleted file mode 100644 index 6dfcf4d7f59c..000000000000 --- a/tests/bluetooth/init/prj_8.conf +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_SMP=y -CONFIG_BT_SMP_SC_ONLY=y -CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_9.conf b/tests/bluetooth/init/prj_9.conf deleted file mode 100644 index 6dfcf4d7f59c..000000000000 --- a/tests/bluetooth/init/prj_9.conf +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_SMP=y -CONFIG_BT_SMP_SC_ONLY=y -CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/testcase.yaml b/tests/bluetooth/init/testcase.yaml index a5cc40cd39e7..bbefd93265c1 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -22,9 +22,6 @@ tests: bluetooth.init.test_13: extra_args: CONF_FILE=prj_13.conf platform_allow: qemu_cortex_m3 - bluetooth.init.test_14: - extra_args: CONF_FILE=prj_14.conf - platform_allow: qemu_cortex_m3 bluetooth.init.test_15: extra_args: CONF_FILE=prj_15.conf platform_allow: qemu_cortex_m3 @@ -64,15 +61,6 @@ tests: bluetooth.init.test_6: extra_args: CONF_FILE=prj_6.conf platform_allow: qemu_cortex_m3 - bluetooth.init.test_7: - extra_args: CONF_FILE=prj_7.conf - platform_allow: qemu_cortex_m3 - bluetooth.init.test_8: - extra_args: CONF_FILE=prj_8.conf - platform_allow: qemu_cortex_m3 - bluetooth.init.test_9: - extra_args: CONF_FILE=prj_9.conf - platform_allow: qemu_cortex_m3 bluetooth.init.test_ctlr: extra_args: - CONF_FILE=prj_ctlr.conf From 5a4d8277eba38d0e04d28b9a0661f2b3025bd84e Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Wed, 12 Nov 2025 23:20:14 +0100 Subject: [PATCH 0520/3334] [nrf fromtree] tests: bluetooth: qualification: Remove data signing related ICS This commit removes data signing related ICS. Removed ICS: - SM 6/1: Signing Algorithm Generation - SM 6/2: Signing Algorithm Resolving - GATT 3/13: Signed Write Without Response - GATT 9/10: Signed Write Command - GATT 7/3: LE Security mode 2 - GAP 25/2: LE Security mode 2 - GAP 35/2: LE Security mode 2 - GAP 25/5: Connection data signing procedure - GAP 35/5: Connection data signing procedure - GAP 25/6: Authenticate signed data procedure - GAP 35/6: Authenticate signed data procedure - GAP 27b/8: Connection Signature Resolving Key (CSRK) - GAP 37b/8: Connection Signature Resolving Key (CSRK) The following tests are not supported any longer: - GAP/SEC/CSIGN/BI-01-C - GAP/SEC/CSIGN/BI-02-C - GAP/SEC/CSIGN/BI-03-C - GAP/SEC/CSIGN/BI-04-C - GAP/SEC/CSIGN/BV-01-C - GAP/SEC/CSIGN/BV-02-C - GATT/CL/GAW/BV-02-C - SM/CEN/SIGN/BV-01-C Signed-off-by: Pavel Vasilyev (cherry picked from commit 116d4ddb89e909ea7c61d914e206a89dba2a3b22) --- .../ICS_Zephyr_Bluetooth_Host.bqw | 19 ++----- .../ICS_Zephyr_Bluetooth_Host.pts | 50 +------------------ 2 files changed, 4 insertions(+), 65 deletions(-) diff --git a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw index 399f6eb0ed6b..1f0b30081209 100644 --- a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw +++ b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw @@ -1,8 +1,8 @@ - + - + @@ -54,7 +54,6 @@ GAP 31/10 GAP 32/1 GAP 32/2 - GAP 35/2 GAP 37/1 GAP 5/4 GAP 8a/1 @@ -84,7 +83,6 @@ GAP 21/5 GAP 23/2 GAP 25/1 - GAP 25/6 GAP 27/7 GAP 28/2 GAP 33/4 @@ -150,7 +148,6 @@ GAP 20A/19 GAP 30a/16 GAP 14a/10 - GAP 27b/8 GAP 27b/3 GAP 27b/6 GAP 25/11 @@ -217,7 +214,6 @@ GAP 33/5 GAP 34/3 GAP 35/3 - GAP 35/5 GAP 35/8 GAP 36/2 GAP 36/5 @@ -240,7 +236,6 @@ GAP 30a/6 GAP 27c/2 GAP 14a/6 - GAP 37b/8 GAP 25/14 GAP 14a/3 GAP 27c/3 @@ -252,14 +247,11 @@ GAP 20/5 GAP 20A/7 GAP 23/3 - GAP 25/2 - GAP 25/5 GAP 26/3 GAP 27/5 GAP 27a/1 GAP 27a/3 GAP 31/3 - GAP 35/6 GAP 37a/2 GAP 6/1 GAP 8a/11 @@ -369,7 +361,6 @@ GATT 9/7 GATT 10/8 GATT 3/30 - GATT 3/13 GATT 3/17 GATT 4/16 GATT 4/2 @@ -393,7 +384,6 @@ GATT 4/13 GATT 4/18 GATT 4/3 - GATT 7/3 GATT 4a/1 GATT 1/1 GATT 3/29 @@ -428,7 +418,6 @@ GATT 4/20 GATT 4/23 GATT 4/26 - GATT 9/10 GATT 3a/1 GATT 9/12 GATT 1a/1 @@ -448,12 +437,10 @@ SM 2/2 SM 5/1 SM 5/4 - SM 6/2 SM 1/1 SM 2/1 SM 4/1 SM 5/3 - SM 6/1 SM 7b/1 SM 4/3 SM 7b/3 @@ -3292,4 +3279,4 @@ - \ No newline at end of file + diff --git a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts index 6f31ef84404c..38a5a2dfa67c 100644 --- a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts +++ b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts @@ -1,6 +1,6 @@  - 347313 + 376799 Zephyr Host @@ -317,10 +317,6 @@ 14a
14 - - 37b
- 8 -
30a
16 @@ -381,10 +377,6 @@ 14a
10
- - 27b
- 8 -
27b
3 @@ -749,10 +741,6 @@ 25
10
- - 25
- 2 -
25
3 @@ -761,14 +749,6 @@ 25
4
- - 25
- 5 -
- - 25
- 6 -
25
7 @@ -969,14 +949,6 @@ 35
4
- - 35
- 5 -
- - 35
- 6 -
35
7 @@ -1311,10 +1283,6 @@ 2
3a
- - 9
- 10 -
10
6 @@ -1491,10 +1459,6 @@ 3
12
- - 3
- 13 -
3
14 @@ -1679,10 +1643,6 @@ 7
2
- - 7
- 3 -
7
4 @@ -1782,14 +1742,6 @@ 5
4
- - 6
- 1 -
- - 6
- 2 -
ATT From 3c491d7b7b30fa9538be85257d6589708f38847e Mon Sep 17 00:00:00 2001 From: Xiang Liu Date: Tue, 14 Oct 2025 10:49:53 +0800 Subject: [PATCH 0521/3334] [nrf fromtree] bluetooth: remove blocking operation in bt_conn_get_info bt_conn_get_info API is used to retrieve connection-related information. However, bt_conn_get_info sends the HCI command BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE to retrieve current key_size, causing excessive blocking time. Signed-off-by: Xiang Liu (cherry picked from commit 8e9fa6a2734314a433e6a0f8580cc90182ae0ab0) --- subsys/bluetooth/host/classic/br.c | 4 ++++ subsys/bluetooth/host/conn.c | 32 ++++-------------------------- subsys/bluetooth/host/hci_core.c | 13 +++++++++--- subsys/bluetooth/host/keys.h | 1 + 4 files changed, 19 insertions(+), 31 deletions(-) diff --git a/subsys/bluetooth/host/classic/br.c b/subsys/bluetooth/host/classic/br.c index 23a43a01959b..4e9902747381 100644 --- a/subsys/bluetooth/host/classic/br.c +++ b/subsys/bluetooth/host/classic/br.c @@ -143,6 +143,10 @@ static bool br_sufficient_key_size(struct bt_conn *conn) key_size = rp->key_size; net_buf_unref(rsp); + if (conn->br.link_key) { + conn->br.link_key->enc_key_size = key_size; + } + LOG_DBG("Encryption key size is %u", key_size); if (conn->sec_level == BT_SECURITY_L4) { diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index e706fd3fb934..2b2ce061bd92 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2507,35 +2507,11 @@ uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) return 0; } - if (IS_ENABLED(CONFIG_BT_CLASSIC) && - conn->type == BT_CONN_TYPE_BR) { - struct bt_hci_cp_read_encryption_key_size *cp; - struct bt_hci_rp_read_encryption_key_size *rp; - struct net_buf *buf; - struct net_buf *rsp; - uint8_t key_size; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - return 0; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->handle = sys_cpu_to_le16(conn->handle); - - if (bt_hci_cmd_send_sync(BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE, - buf, &rsp)) { - return 0; - } - - rp = (void *)rsp->data; - - key_size = rp->status ? 0 : rp->key_size; - - net_buf_unref(rsp); - - return key_size; +#if defined(CONFIG_BT_CLASSIC) + if (conn->type == BT_CONN_TYPE_BR) { + return conn->br.link_key ? conn->br.link_key->enc_key_size : 0; } +#endif /* CONFIG_BT_CLASSIC */ if (IS_ENABLED(CONFIG_BT_SMP)) { return conn->le.keys ? conn->le.keys->enc_size : 0; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index d2a8d6d1202b..ee16fea31064 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1077,9 +1077,16 @@ static void hci_disconn_complete(struct net_buf *buf) * If only for one connection session bond was set, clear keys * database row for this connection. */ - if (conn->type == BT_CONN_TYPE_BR && conn->br.link_key != NULL && - atomic_test_and_clear_bit(conn->flags, BT_CONN_BR_NOBOND)) { - bt_keys_link_key_clear(conn->br.link_key); + if (conn->type == BT_CONN_TYPE_BR && conn->br.link_key != NULL) { + /* + * If the connection link is paired but not bond, remove + * the link key upon disconnection. + */ + if (atomic_test_and_clear_bit(conn->flags, BT_CONN_BR_NOBOND)) { + bt_keys_link_key_clear(conn->br.link_key); + } + + conn->br.link_key->enc_key_size = 0; } #endif bt_conn_unref(conn); diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index 185fd610e779..90c0c92e9de0 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -223,6 +223,7 @@ enum { struct bt_keys_link_key { bt_addr_t addr; + uint8_t enc_key_size; uint8_t storage_start[0] __aligned(sizeof(void *)); uint8_t flags; uint8_t val[16]; From 617978c82c4bbf2420da3134fa6aadbb8e344037 Mon Sep 17 00:00:00 2001 From: Kai Cheng Date: Wed, 22 Oct 2025 21:26:25 +0800 Subject: [PATCH 0522/3334] [nrf fromtree] Bluetooth: Conn: add connection type helper functions Introduce dedicated helper functions for connection type checking: - bt_conn_is_br() for BR/EDR connections - bt_conn_is_le() for LE connections - bt_conn_is_iso() for ISO connections - bt_conn_is_sco() for SCO connections Replace direct conn->type comparisons with these new helper functions throughout the connection management code. This improves code readability, maintainability, and provides proper configuration checks for each connection type. Signed-off-by: Kai Cheng (cherry picked from commit 038523c63b0c2f615b180167fc171844b3e21b0b) --- subsys/bluetooth/host/conn.c | 144 ++++++++++++-------------- subsys/bluetooth/host/conn_internal.h | 35 ++++++- 2 files changed, 97 insertions(+), 82 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 2b2ce061bd92..d310ff1de5fe 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -217,7 +217,7 @@ int bt_conn_iso_init(void) struct k_sem *bt_conn_get_pkts(struct bt_conn *conn) { #if defined(CONFIG_BT_CLASSIC) - if (conn->type == BT_CONN_TYPE_BR || !bt_dev.le.acl_mtu) { + if (bt_conn_is_br(conn) || !bt_dev.le.acl_mtu) { return &bt_dev.br.pkts; } #endif /* CONFIG_BT_CLASSIC */ @@ -226,7 +226,7 @@ struct k_sem *bt_conn_get_pkts(struct bt_conn *conn) /* Use ISO pkts semaphore if LE Read Buffer Size command returned * dedicated ISO buffers. */ - if (conn->type == BT_CONN_TYPE_ISO) { + if (bt_conn_is_iso(conn)) { if (bt_dev.le.iso_mtu && bt_dev.le.iso_limit != 0) { return &bt_dev.le.iso_pkts; } @@ -470,7 +470,7 @@ static void bt_acl_recv(struct bt_conn *conn, struct net_buf *buf, return; } - if ((conn->type != BT_CONN_TYPE_BR) && (conn->rx->len > acl_total_len)) { + if (!bt_conn_is_br(conn) && (conn->rx->len > acl_total_len)) { LOG_ERR("ACL len mismatch (%u > %u)", conn->rx->len, acl_total_len); bt_conn_reset_rx_state(conn); return; @@ -481,7 +481,7 @@ static void bt_acl_recv(struct bt_conn *conn, struct net_buf *buf, conn->rx = NULL; LOG_DBG("Successfully parsed %u byte L2CAP packet", buf->len); - if (IS_ENABLED(CONFIG_BT_CLASSIC) && (conn->type == BT_CONN_TYPE_BR)) { + if (bt_conn_is_br(conn)) { bt_br_acl_recv(conn, buf, true); } else { bt_l2cap_recv(conn, buf, true); @@ -500,7 +500,7 @@ void bt_conn_recv(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) LOG_DBG("handle %u len %u flags %02x", conn->handle, buf->len, flags); - if (IS_ENABLED(CONFIG_BT_ISO_RX) && conn->type == BT_CONN_TYPE_ISO) { + if (IS_ENABLED(CONFIG_BT_ISO_RX) && bt_conn_is_iso(conn)) { bt_iso_recv(conn, buf, flags); return; } else if (IS_ENABLED(CONFIG_BT_CONN)) { @@ -618,13 +618,12 @@ static int send_iso(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) static inline uint16_t conn_mtu(struct bt_conn *conn) { #if defined(CONFIG_BT_CLASSIC) - if (conn->type == BT_CONN_TYPE_BR || - (conn->type != BT_CONN_TYPE_ISO && !bt_dev.le.acl_mtu)) { + if (bt_conn_is_br(conn) || (!bt_conn_is_iso(conn) && !bt_dev.le.acl_mtu)) { return bt_dev.br.mtu; } #endif /* CONFIG_BT_CLASSIC */ #if defined(CONFIG_BT_ISO) - if (conn->type == BT_CONN_TYPE_ISO) { + if (bt_conn_is_iso(conn)) { return bt_dev.le.iso_mtu; } #endif /* CONFIG_BT_ISO */ @@ -635,26 +634,14 @@ static inline uint16_t conn_mtu(struct bt_conn *conn) #endif /* CONFIG_BT_CONN */ } -static bool is_classic_conn(struct bt_conn *conn) -{ - 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; -} - -static bool is_le_conn(struct bt_conn *conn) -{ - return IS_ENABLED(CONFIG_BT_CONN) && conn->type == BT_CONN_TYPE_LE; + return IS_ENABLED(CONFIG_BT_ISO_TX) && bt_conn_is_iso(conn); } static bool is_acl_conn(struct bt_conn *conn) { - return is_le_conn(conn) || is_classic_conn(conn); + return bt_conn_is_le(conn) || bt_conn_is_br(conn); } static int send_buf(struct bt_conn *conn, struct net_buf *buf, @@ -1192,13 +1179,12 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) * bt_conn_add_le() and keep it until reaching DISCONNECTED * again. */ - if (conn->type != BT_CONN_TYPE_ISO) { + if (!bt_conn_is_iso(conn)) { bt_conn_ref(conn); } break; case BT_CONN_INITIATING: - if (IS_ENABLED(CONFIG_BT_CENTRAL) && - conn->type == BT_CONN_TYPE_LE) { + if (IS_ENABLED(CONFIG_BT_CENTRAL) && bt_conn_is_le(conn)) { k_work_cancel_delayable(&conn->deferred_work); } break; @@ -1209,7 +1195,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) /* Actions needed for entering the new state */ switch (conn->state) { case BT_CONN_CONNECTED: - if (conn->type == BT_CONN_TYPE_SCO) { + if (bt_conn_is_sco(conn)) { if (IS_ENABLED(CONFIG_BT_CLASSIC)) { bt_sco_connected(conn); } @@ -1217,8 +1203,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) } k_poll_signal_raise(&conn_change, 0); - if (IS_ENABLED(CONFIG_BT_ISO) && - conn->type == BT_CONN_TYPE_ISO) { + if (bt_conn_is_iso(conn)) { bt_iso_connected(conn); break; } @@ -1230,7 +1215,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) conn->role == BT_CONN_ROLE_PERIPHERAL) { #if defined(CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS) - if (conn->type == BT_CONN_TYPE_LE) { + if (bt_conn_is_le(conn)) { conn->le.conn_param_retry_countdown = CONFIG_BT_CONN_PARAM_RETRY_COUNT; } @@ -1244,7 +1229,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) break; case BT_CONN_DISCONNECTED: #if defined(CONFIG_BT_CONN) - if (conn->type == BT_CONN_TYPE_SCO) { + if (bt_conn_is_sco(conn)) { if (IS_ENABLED(CONFIG_BT_CLASSIC)) { bt_sco_disconnected(conn); } @@ -1341,15 +1326,14 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) case BT_CONN_ADV_DIR_CONNECTABLE: break; case BT_CONN_INITIATING: - if (conn->type == BT_CONN_TYPE_SCO) { + if (bt_conn_is_sco(conn)) { break; } /* * Timer is needed only for LE. For other link types controller * will handle connection timeout. */ - if (IS_ENABLED(CONFIG_BT_CENTRAL) && - conn->type == BT_CONN_TYPE_LE && + if (IS_ENABLED(CONFIG_BT_CENTRAL) && bt_conn_is_le(conn) && bt_dev.create_param.timeout != 0) { k_work_schedule(&conn->deferred_work, K_MSEC(10 * bt_dev.create_param.timeout)); @@ -1884,21 +1868,21 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason) } return 0; case BT_CONN_INITIATING: - if (conn->type == BT_CONN_TYPE_LE) { + if (bt_conn_is_le(conn)) { if (IS_ENABLED(CONFIG_BT_CENTRAL)) { k_work_cancel_delayable(&conn->deferred_work); return bt_le_create_conn_cancel(); } } #if defined(CONFIG_BT_ISO) - else if (conn->type == BT_CONN_TYPE_ISO) { + else if (bt_conn_is_iso(conn)) { return conn_disconnect(conn, reason); } #endif /* CONFIG_BT_ISO */ #if defined(CONFIG_BT_CLASSIC) - else if (conn->type == BT_CONN_TYPE_BR) { + else if (bt_conn_is_br(conn)) { return bt_hci_connect_br_cancel(conn); - } else if (conn->type == BT_CONN_TYPE_SCO) { + } else if (bt_conn_is_sco(conn)) { /* There is no HCI cmd to cancel SCO connecting from spec */ return -EPROTONOSUPPORT; } @@ -2179,7 +2163,7 @@ static void deferred_work(struct k_work *work) #if defined(CONFIG_BT_ISO_UNICAST) struct bt_conn *iso; - if (conn->type == BT_CONN_TYPE_ISO) { + if (bt_conn_is_iso(conn)) { /* bt_iso_disconnected is responsible for unref'ing the * connection pointer, as it is conditional on whether * the connection is a central or peripheral. @@ -2239,7 +2223,7 @@ static void deferred_work(struct k_work *work) return; } - if (conn->type != BT_CONN_TYPE_LE) { + if (!bt_conn_is_le(conn)) { return; } @@ -2323,7 +2307,7 @@ struct bt_conn *bt_conn_lookup_addr_sco(const bt_addr_t *peer) continue; } - if (conn->type != BT_CONN_TYPE_SCO) { + if (!bt_conn_is_sco(conn)) { bt_conn_unref(conn); continue; } @@ -2355,7 +2339,7 @@ struct bt_conn *bt_conn_lookup_addr_br(const bt_addr_t *peer) continue; } - if (conn->type != BT_CONN_TYPE_BR) { + if (!bt_conn_is_br(conn)) { bt_conn_unref(conn); continue; } @@ -2498,7 +2482,7 @@ int bt_conn_le_start_encryption(struct bt_conn *conn, uint8_t rand[8], #if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_CLASSIC) uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return 0; } @@ -2508,7 +2492,7 @@ uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) } #if defined(CONFIG_BT_CLASSIC) - if (conn->type == BT_CONN_TYPE_BR) { + if (bt_conn_is_br(conn)) { return conn->br.link_key ? conn->br.link_key->enc_key_size : 0; } #endif /* CONFIG_BT_CLASSIC */ @@ -2523,7 +2507,7 @@ uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) static void reset_pairing(struct bt_conn *conn) { #if defined(CONFIG_BT_CLASSIC) - if (conn->type == BT_CONN_TYPE_BR) { + if (bt_conn_is_br(conn)) { atomic_clear_bit(conn->flags, BT_CONN_BR_PAIRING); atomic_clear_bit(conn->flags, BT_CONN_BR_PAIRED); atomic_clear_bit(conn->flags, BT_CONN_BR_PAIRING_INITIATOR); @@ -2559,12 +2543,12 @@ void bt_conn_security_changed(struct bt_conn *conn, uint8_t hci_err, #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (!err && conn->sec_level >= BT_SECURITY_L2) { - if (conn->type == BT_CONN_TYPE_LE) { + if (bt_conn_is_le(conn)) { bt_keys_update_usage(conn->id, bt_conn_get_dst(conn)); } #if defined(CONFIG_BT_CLASSIC) - if (conn->type == BT_CONN_TYPE_BR) { + if (bt_conn_is_br(conn)) { bt_keys_link_key_update_usage(&conn->br.dst); } #endif /* CONFIG_BT_CLASSIC */ @@ -2575,7 +2559,7 @@ void bt_conn_security_changed(struct bt_conn *conn, uint8_t hci_err, static int start_security(struct bt_conn *conn) { - if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { + if (bt_conn_is_br(conn)) { return bt_ssp_start_security(conn); } @@ -2591,7 +2575,7 @@ int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec) bool force_pair; int err; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -2631,7 +2615,7 @@ int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec) bt_security_t bt_conn_get_security(const struct bt_conn *conn) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return BT_SECURITY_L0; } @@ -2749,7 +2733,7 @@ struct bt_conn *bt_conn_lookup_addr_le(uint8_t id, const bt_addr_le_t *peer) continue; } - if (conn->type != BT_CONN_TYPE_LE) { + if (!bt_conn_is_le(conn)) { bt_conn_unref(conn); continue; } @@ -2777,7 +2761,7 @@ struct bt_conn *bt_conn_lookup_state_le(uint8_t id, const bt_addr_le_t *peer, continue; } - if (conn->type != BT_CONN_TYPE_LE) { + if (!bt_conn_is_le(conn)) { bt_conn_unref(conn); continue; } @@ -2800,7 +2784,7 @@ struct bt_conn *bt_conn_lookup_state_le(uint8_t id, const bt_addr_le_t *peer, const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return NULL; } @@ -2915,7 +2899,7 @@ bool bt_conn_is_type(const struct bt_conn *conn, enum bt_conn_type type) int bt_conn_get_remote_info(const struct bt_conn *conn, struct bt_conn_remote_info *remote_info) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3010,7 +2994,7 @@ int bt_conn_le_enhanced_get_tx_power_level(struct bt_conn *conn, struct bt_hci_cp_le_read_tx_power_level *cp; struct net_buf *buf; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3048,7 +3032,7 @@ int bt_conn_le_get_remote_tx_power_level(struct bt_conn *conn, struct bt_hci_cp_le_read_tx_power_level *cp; struct net_buf *buf; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3076,7 +3060,7 @@ int bt_conn_le_set_tx_power_report_enable(struct bt_conn *conn, struct bt_hci_cp_le_set_tx_power_report_enable *cp; struct net_buf *buf; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3102,7 +3086,7 @@ int bt_conn_le_get_tx_power_level(struct bt_conn *conn, { int err; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3150,7 +3134,7 @@ int bt_conn_le_set_path_loss_mon_param(struct bt_conn *conn, struct bt_hci_cp_le_set_path_loss_reporting_parameters *cp; struct net_buf *buf; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3176,7 +3160,7 @@ int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool reporting_ena struct bt_hci_cp_le_set_path_loss_reporting_enable *cp; struct net_buf *buf; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3275,7 +3259,7 @@ int bt_conn_le_subrate_request(struct bt_conn *conn, struct bt_hci_cp_le_subrate_request *cp; struct net_buf *buf; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3324,7 +3308,7 @@ int bt_conn_le_read_all_remote_features(struct bt_conn *conn, uint8_t pages_requ struct bt_hci_cp_le_read_all_remote_features *cp; struct net_buf *buf; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3393,7 +3377,7 @@ int bt_conn_le_frame_space_update(struct bt_conn *conn, struct bt_hci_cp_le_frame_space_update *cp; struct net_buf *buf; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3535,7 +3519,7 @@ void bt_conn_notify_cs_subevent_result(struct bt_conn *conn, int bt_conn_le_param_update(struct bt_conn *conn, const struct bt_le_conn_param *param) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3569,7 +3553,7 @@ int bt_conn_le_param_update(struct bt_conn *conn, int bt_conn_le_data_len_update(struct bt_conn *conn, const struct bt_conn_le_data_len_param *param) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3589,7 +3573,7 @@ int bt_conn_le_phy_update(struct bt_conn *conn, { uint8_t phy_opts, all_phys; - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -4023,7 +4007,7 @@ int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb) #if defined(CONFIG_BT_SMP) int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -4037,7 +4021,7 @@ int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb * return -EINVAL; } - if (conn->type == BT_CONN_TYPE_LE) { + if (bt_conn_is_le(conn)) { return bt_smp_auth_cb_overlay(conn, cb); } @@ -4075,16 +4059,16 @@ int bt_conn_auth_info_cb_unregister(struct bt_conn_auth_info_cb *cb) int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { + if (IS_ENABLED(CONFIG_BT_SMP) && bt_conn_is_le(conn)) { return bt_smp_auth_passkey_entry(conn, passkey); } - if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { + if (bt_conn_is_br(conn)) { if (!bt_auth) { return -EINVAL; } @@ -4099,7 +4083,7 @@ int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) int bt_conn_auth_keypress_notify(struct bt_conn *conn, enum bt_conn_auth_keypress type) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { + if (!bt_conn_is_le(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -4115,16 +4099,16 @@ int bt_conn_auth_keypress_notify(struct bt_conn *conn, int bt_conn_auth_passkey_confirm(struct bt_conn *conn) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { + if (IS_ENABLED(CONFIG_BT_SMP) && bt_conn_is_le(conn)) { return bt_smp_auth_passkey_confirm(conn); } - if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { + if (bt_conn_is_br(conn)) { if (!bt_auth) { return -EINVAL; } @@ -4137,16 +4121,16 @@ int bt_conn_auth_passkey_confirm(struct bt_conn *conn) int bt_conn_auth_cancel(struct bt_conn *conn) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { + if (IS_ENABLED(CONFIG_BT_SMP) && bt_conn_is_le(conn)) { return bt_smp_auth_cancel(conn); } - if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { + if (bt_conn_is_br(conn)) { if (!bt_auth) { return -EINVAL; } @@ -4159,16 +4143,16 @@ int bt_conn_auth_cancel(struct bt_conn *conn) int bt_conn_auth_pairing_confirm(struct bt_conn *conn) { - if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { + if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { + if (IS_ENABLED(CONFIG_BT_SMP) && bt_conn_is_le(conn)) { return bt_smp_auth_pairing_confirm(conn); } - if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { + if (bt_conn_is_br(conn)) { if (!bt_auth) { return -EINVAL; } diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index c64ad277b4f8..f1e4a289a135 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -363,6 +363,38 @@ static inline void *closure_data(void *storage) return ((struct closure *)storage)->data; } +#if defined(CONFIG_BT_CLASSIC) +static inline bool bt_conn_is_br(const struct bt_conn *conn) +{ + return conn->type == BT_CONN_TYPE_BR; +} +#else +#define bt_conn_is_br(conn) (false) +#endif + +static inline bool bt_conn_is_le(const struct bt_conn *conn) +{ + return conn->type == BT_CONN_TYPE_LE; +} + +#if defined(CONFIG_BT_ISO) +static inline bool bt_conn_is_iso(const struct bt_conn *conn) +{ + return conn->type == BT_CONN_TYPE_ISO; +} +#else +#define bt_conn_is_iso(conn) (false) +#endif + +#if defined(CONFIG_BT_CLASSIC) +static inline bool bt_conn_is_sco(const struct bt_conn *conn) +{ + return conn->type == BT_CONN_TYPE_SCO; +} +#else +#define bt_conn_is_sco(conn) (false) +#endif + void bt_conn_tx_notify(struct bt_conn *conn, bool wait_for_completion); void bt_conn_reset_rx_state(struct bt_conn *conn); @@ -442,8 +474,7 @@ static inline bool bt_conn_is_handle_valid(struct bt_conn *conn) return true; case BT_CONN_INITIATING: /* ISO connection handle assigned at connect state */ - if (IS_ENABLED(CONFIG_BT_ISO) && - conn->type == BT_CONN_TYPE_ISO) { + if (bt_conn_is_iso(conn)) { return true; } __fallthrough; From dbc3c770da707115e58c7713144f3591074d6390 Mon Sep 17 00:00:00 2001 From: Timothy Keys Date: Mon, 13 Oct 2025 16:01:31 +0100 Subject: [PATCH 0523/3334] [nrf fromtree] bluetooth: host: Add Shorter Connection Intervals support This commit adds support for the Shorter Connection Intervals feature to the Bluetooth host. Signed-off-by: Timothy Keys (cherry picked from commit e2cd247ec4852328b94e1c8c917ca9d33e0cf72d) --- include/zephyr/bluetooth/conn.h | 269 +++++++++++++++++++++++++- include/zephyr/bluetooth/hci_types.h | 80 ++++++++ subsys/bluetooth/Kconfig | 11 +- subsys/bluetooth/controller/Kconfig | 14 ++ subsys/bluetooth/host/conn.c | 199 ++++++++++++++++++- subsys/bluetooth/host/conn_internal.h | 3 + subsys/bluetooth/host/hci_core.c | 85 +++++++- 7 files changed, 657 insertions(+), 4 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 881d0894ee11..7a2d5d9c1bad 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -252,6 +252,169 @@ struct bt_conn_le_subrate_changed { uint16_t supervision_timeout; }; +/** @brief Maximum Connection Interval Groups possible + * + * The practical maximum is 41 groups based on HCI event size constraints: + * (HCI event max size - cmd_complete overhead - response fields) / sizeof(group) + * (255 - 4 - 3) / 6 = 41 groups max + */ +#define BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS 41 + +/** @brief Minimum supported connection interval group + * + * Each group represents an arithmetic sequence of supported connection intervals: + * min, min + stride, min + 2 * stride, ..., min + n * stride (where min + n * stride <= max) + * + * Example: min = 10 (1250 us), max = 60 (7500 us), stride = 5 (625 us) + * -> Supported: 1250 us, 1875 us, 2500 us, ..., 6875 us, 7500 us + */ +struct bt_conn_le_min_conn_interval_group { + /** @brief Lower bound of group interval range + * + * Unit: 125 microseconds + * + * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US + */ + uint16_t min_125us; + /** @brief Upper bound of group interval range + * + * Unit: 125 microseconds + * + * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US + */ + uint16_t max_125us; + /** @brief Increment between consecutive supported intervals + * + * Unit: 125 microseconds + * + * Range: @ref BT_HCI_LE_SCI_STRIDE_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US + */ + uint16_t stride_125us; +}; + +/** Minimum supported connection interval information */ +struct bt_conn_le_min_conn_interval_info { + /** @brief Minimum supported connection interval + * + * Unit: microseconds + * + * Range: @ref BT_HCI_LE_MIN_SUPP_CONN_INT_MIN_US - @ref BT_HCI_LE_MIN_SUPP_CONN_INT_MAX_US + */ + uint16_t min_supported_conn_interval_us; + /** @brief Number of interval groups. + * + * Range: 0 - @ref BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS + * + * If zero, the controller only supports Rounded ConnInterval Values (RCV). + */ + uint8_t num_groups; + /** @brief Array of supported connection interval groups. + * + * Multiple groups allow representing non-contiguous or differently-strided ranges. + */ + struct bt_conn_le_min_conn_interval_group groups[BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS]; +}; + +/** Connection rate parameters for LE connections */ +struct bt_conn_le_conn_rate_param { + /** @brief Minimum connection interval + * + * Unit: 125 microseconds + * + * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US + */ + uint16_t interval_min_125us; + /** @brief Maximum connection interval + * + * Unit: 125 microseconds + * + * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US + */ + uint16_t interval_max_125us; + /** @brief Minimum subrate factor + * + * Range: @ref BT_HCI_LE_SUBRATE_FACTOR_MIN - @ref BT_HCI_LE_SUBRATE_FACTOR_MAX + */ + uint16_t subrate_min; + /** @brief Maximum subrate factor + * + * Range: @ref BT_HCI_LE_SUBRATE_FACTOR_MIN - @ref BT_HCI_LE_SUBRATE_FACTOR_MAX + */ + uint16_t subrate_max; + /** @brief Maximum Peripheral latency + * + * Unit: subrated connection intervals @ref bt_conn_le_conn_rate_changed.subrate_factor + * + * Range: @ref BT_HCI_LE_PERIPHERAL_LATENCY_MIN - @ref BT_HCI_LE_PERIPHERAL_LATENCY_MAX + */ + uint16_t max_latency; + /** @brief 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. + * + * Range: @ref BT_HCI_LE_CONTINUATION_NUM_MIN - @ref BT_HCI_LE_CONTINUATION_NUM_MAX + */ + uint16_t continuation_number; + /** @brief Connection Supervision timeout + * + * Unit: 10 milliseconds + * + * Range: @ref BT_HCI_LE_SUPERVISON_TIMEOUT_MIN - @ref BT_HCI_LE_SUPERVISON_TIMEOUT_MAX + */ + uint16_t supervision_timeout_10ms; + /** @brief Minimum length of connection event + * + * Unit: 125 microseconds + * + * Range: @ref BT_HCI_LE_SCI_CE_LEN_MIN_125US - @ref BT_HCI_LE_SCI_CE_LEN_MAX_125US + */ + uint16_t min_ce_len_125us; + /** @brief Maximum length of connection event + * + * Unit: 125 microseconds + * + * Range: @ref BT_HCI_LE_SCI_CE_LEN_MIN_125US - @ref BT_HCI_LE_SCI_CE_LEN_MAX_125US + */ + uint16_t max_ce_len_125us; +}; + +/** Updated connection rate parameters */ +struct bt_conn_le_conn_rate_changed { + /** Connection interval + * + * Unit: microseconds + * + * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_US + */ + uint32_t interval_us; + /** Connection subrate factor + * + * Range: @ref BT_HCI_LE_SUBRATE_FACTOR_MIN - @ref BT_HCI_LE_SUBRATE_FACTOR_MAX + */ + uint16_t subrate_factor; + /** Peripheral latency + * + * Unit: subrated connection intervals @ref bt_conn_le_conn_rate_changed.subrate_factor + * + * Range: @ref BT_HCI_LE_PERIPHERAL_LATENCY_MIN - @ref BT_HCI_LE_PERIPHERAL_LATENCY_MAX + */ + uint16_t peripheral_latency; + /** 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. + * + * Range: @ref BT_HCI_LE_CONTINUATION_NUM_MIN - @ref BT_HCI_LE_CONTINUATION_NUM_MAX + */ + uint16_t continuation_number; + /** Connection Supervision timeout + * + * Unit: 10 milliseconds + * + * Range: @ref BT_HCI_LE_SUPERVISON_TIMEOUT_MIN - @ref BT_HCI_LE_SUPERVISON_TIMEOUT_MAX + */ + uint16_t supervision_timeout_10ms; +}; + /** Read all remote features complete callback params */ struct bt_conn_le_read_all_remote_feat_complete { /** @brief HCI Status from LE Read All Remote Features Complete event. @@ -890,7 +1053,12 @@ struct bt_conn_le_info { const bt_addr_le_t *local; /** Remote device address used during connection setup. */ const bt_addr_le_t *remote; - uint16_t interval; /**< Connection interval */ + /** Connection interval in microseconds */ + uint32_t interval_us; +#if !defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) || defined(__DOXYGEN__) + /** Connection interval in units of 1.25 ms */ + uint16_t interval; +#endif /* !CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ uint16_t latency; /**< Connection peripheral latency */ uint16_t timeout; /**< Connection supervision timeout */ @@ -924,6 +1092,12 @@ struct bt_conn_le_info { */ #define BT_CONN_INTERVAL_TO_US(interval) ((interval) * 1250U) +/** @brief Convert shorter connection interval to microseconds + * + * Multiply by 125 to get microseconds. + */ +#define BT_CONN_SCI_INTERVAL_TO_US(interval) ((interval) * BT_HCI_LE_SCI_INTERVAL_UNIT_US) + /** BR/EDR Connection Info Structure */ struct bt_conn_br_info { const bt_addr_t *dst; /**< Destination (Remote) BR/EDR address */ @@ -1329,6 +1503,74 @@ int bt_conn_le_subrate_set_defaults(const struct bt_conn_le_subrate_param *param int bt_conn_le_subrate_request(struct bt_conn *conn, const struct bt_conn_le_subrate_param *params); +/** @brief Read Minimum Supported Connection Interval Groups. + * + * Read the minimum supported connection interval and supported interval + * groups from the local controller. This information describes what the + * local controller supports. + * + * @sa bt_conn_le_read_min_conn_interval if only + * @ref bt_conn_le_min_conn_interval_info.min_supported_conn_interval_us + * is needed. + * + * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} + * + * @param info Pointer to structure to receive the minimum connection interval + * information. + * + * @return Zero on success or (negative) error code on failure. + */ +int bt_conn_le_read_min_conn_interval_groups(struct bt_conn_le_min_conn_interval_info *info); + +/** @brief Read Minimum Supported Connection Interval. + * + * Read the minimum supported connection interval from the local controller. + * + * @sa bt_conn_le_read_min_conn_interval_groups if groups are needed. + * + * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} + * + * @param min_interval_us Pointer to variable to receive the minimum connection interval + * in microseconds. + * + * @return Zero on success or (negative) error code on failure. + */ +int bt_conn_le_read_min_conn_interval(uint16_t *min_interval_us); + +/** @brief Set Default Connection Rate Parameters. + * + * Set default connection rate parameters to be used for future connections. + * This command does not affect any existing connection. + * Parameters set for specific connection will always have precedence. + * + * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} + * + * @param params Connection rate parameters. + * + * @return Zero on success or (negative) error code on failure. + */ +int bt_conn_le_conn_rate_set_defaults(const struct bt_conn_le_conn_rate_param *params); + +/** @brief Request New Connection Rate Parameters. + * + * Request a change to the connection parameters of a connection. This includes + * Subrate parameters. This allows changing the connection interval to below the + * Baseline ConnInterval Values (BCV) and with finer granularity, if supported. + * + * Valid intervals of the local and peer controller should be known. + * See @ref bt_conn_le_read_min_conn_interval_groups + * + * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} + * + * @param conn @ref BT_CONN_TYPE_LE connection object. + * @param params Connection rate parameters. + * + * @return Zero on success or (negative) error code on failure. + * @return -EINVAL @p conn is not a valid @ref BT_CONN_TYPE_LE connection. + */ +int bt_conn_le_conn_rate_request(struct bt_conn *conn, + const struct bt_conn_le_conn_rate_param *params); + /** @brief Read remote feature pages. * * Request remote feature pages, from 0 up to pages_requested or the number @@ -2052,6 +2294,31 @@ struct bt_conn_cb { const struct bt_conn_le_subrate_changed *params); #endif /* CONFIG_BT_SUBRATING */ +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) || defined(__DOXYGEN__) + /** @brief LE Connection Rate Changed event. + * + * This callback notifies the application that the connection rate + * parameters (including both connection interval and subrating) + * of the connection may have changed. + * + * @param conn Connection object. + * @param status HCI Status from LE Connection Rate Change event. + * Possible Status codes: + * - Success (0x00) + * - Unknown Connection Identifier (0x02) + * - Command Disallowed (0x0C) + * - Unsupported Feature or Parameter Value (0x11) + * - Invalid HCI Command Parameters (0x12) + * - Unsupported Remote Feature (0x1A) + * - Unsupported LL Parameter Value (0x20) + * @param params New connection rate parameters. + * The connection rate parameters will be NULL + * if @p status is not @ref BT_HCI_ERR_SUCCESS. + */ + void (*conn_rate_changed)(struct bt_conn *conn, uint8_t status, + const struct bt_conn_le_conn_rate_changed *params); +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ + #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) /** @brief Read all remote features complete event. * diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index d520a2324266..98990919b680 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -209,6 +209,8 @@ struct bt_hci_cmd_hdr { #define BT_LE_FEAT_BIT_CHANNEL_SOUNDING_TONE_QUAL_IND 48 #define BT_LE_FEAT_BIT_EXTENDED_FEAT_SET 63 #define BT_LE_FEAT_BIT_FRAME_SPACE_UPDATE 65 +#define BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS 72 +#define BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS_HOST_SUPP 73 #define BT_LE_FEAT_TEST(feat, n) (feat[(n) >> 3] & \ BIT((n) & 7)) @@ -289,6 +291,10 @@ struct bt_hci_cmd_hdr { BT_LE_FEAT_BIT_EXTENDED_FEAT_SET) #define BT_FEAT_LE_FRAME_SPACE_UPDATE_SET(feat) BT_LE_FEAT_TEST(feat, \ BT_LE_FEAT_BIT_FRAME_SPACE_UPDATE) +#define BT_FEAT_LE_SHORTER_CONN_INTERVALS(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS) +#define BT_FEAT_LE_SHORTER_CONN_INTERVALS_HOST_SUPP(feat) BT_LE_FEAT_TEST(feat, \ + BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS_HOST_SUPP) #define BT_FEAT_LE_CIS(feat) (BT_FEAT_LE_CIS_CENTRAL(feat) | \ BT_FEAT_LE_CIS_PERIPHERAL(feat)) @@ -2854,6 +2860,66 @@ struct bt_hci_cp_le_frame_space_update { #define BT_HCI_OP_LE_FRAME_SPACE_UPDATE BT_OP(BT_OGF_LE, 0x009D) /* 0x209D */ +/** All limits according to BT Core spec 6.2 [Vol 4, Part E, 7.8.154]. */ +#define BT_HCI_LE_SCI_INTERVAL_MIN_125US (0x0003U) +#define BT_HCI_LE_SCI_INTERVAL_MAX_125US (0x7D00U) +#define BT_HCI_LE_SCI_INTERVAL_MIN_US (375U) +#define BT_HCI_LE_SCI_INTERVAL_MAX_US (4000000U) +#define BT_HCI_LE_SCI_INTERVAL_UNIT_US (125U) + +#define BT_HCI_LE_SCI_STRIDE_MIN_125US (0x0001U) + +#define BT_HCI_LE_MIN_SUPP_CONN_INT_MIN_US (375U) +#define BT_HCI_LE_MIN_SUPP_CONN_INT_MAX_US (7500U) + +#define BT_HCI_LE_SCI_CE_LEN_MIN_125US (0x0001U) +#define BT_HCI_LE_SCI_CE_LEN_MAX_125US (0x3E7FU) + +struct bt_hci_le_read_min_supported_conn_interval_group { + uint16_t group_min; + uint16_t group_max; + uint16_t group_stride; +} __packed; + +struct bt_hci_op_le_read_min_supported_conn_interval { + uint8_t status; + uint8_t min_supported_conn_interval; + uint8_t num_groups; + struct bt_hci_le_read_min_supported_conn_interval_group groups[]; +} __packed; + +#define BT_HCI_OP_LE_READ_MIN_SUPPORTED_CONN_INTERVAL \ + BT_OP(BT_OGF_LE, 0x00A3) /* 0x20A3 */ + +struct bt_hci_op_le_set_default_rate_parameters { + uint16_t conn_interval_min; + uint16_t conn_interval_max; + uint16_t subrate_min; + uint16_t subrate_max; + uint16_t max_latency; + uint16_t continuation_number; + uint16_t supervision_timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; + +#define BT_HCI_OP_LE_SET_DEFAULT_RATE_PARAMETERS BT_OP(BT_OGF_LE, 0x00A2) /* 0x20A2 */ + +struct bt_hci_op_le_connection_rate_request { + uint16_t handle; + uint16_t conn_interval_min; + uint16_t conn_interval_max; + uint16_t subrate_min; + uint16_t subrate_max; + uint16_t max_latency; + uint16_t continuation_number; + uint16_t supervision_timeout; + uint16_t min_ce_len; + uint16_t max_ce_len; +} __packed; + +#define BT_HCI_OP_LE_CONNECTION_RATE_REQUEST BT_OP(BT_OGF_LE, 0x00A1) /* 0x20A1 */ + /* Event definitions */ #define BT_HCI_EVT_UNKNOWN 0x00 @@ -3218,6 +3284,7 @@ struct bt_hci_evt_le_advertising_report { /** All limits according to BT Core Spec v5.4 [Vol 4, Part E]. */ #define BT_HCI_LE_INTERVAL_MIN 0x0006 #define BT_HCI_LE_INTERVAL_MAX 0x0c80 +#define BT_HCI_LE_PERIPHERAL_LATENCY_MIN (0x0000U) #define BT_HCI_LE_PERIPHERAL_LATENCY_MAX 0x01f3 #define BT_HCI_LE_SUPERVISON_TIMEOUT_MIN 0x000a #define BT_HCI_LE_SUPERVISON_TIMEOUT_MAX 0x0c80 @@ -3609,6 +3676,7 @@ struct bt_hci_evt_le_biginfo_adv_report { /** All limits according to BT Core Spec v5.4 [Vol 4, Part E]. */ #define BT_HCI_LE_SUBRATE_FACTOR_MIN 0x0001 #define BT_HCI_LE_SUBRATE_FACTOR_MAX 0x01f4 +#define BT_HCI_LE_CONTINUATION_NUM_MIN (0x0000U) #define BT_HCI_LE_CONTINUATION_NUM_MAX 0x01f3 #define BT_HCI_EVT_LE_SUBRATE_CHANGE 0x23 @@ -4053,6 +4121,17 @@ struct bt_hci_evt_le_frame_space_update_complete { uint16_t spacing_types; } __packed; +#define BT_HCI_EVT_LE_CONN_RATE_CHANGE 0x37 +struct bt_hci_evt_le_conn_rate_change { + uint8_t status; + uint16_t handle; + uint16_t conn_interval; + 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)) @@ -4155,6 +4234,7 @@ struct bt_hci_evt_le_frame_space_update_complete { #define BT_EVT_MASK_LE_CS_TEST_END_COMPLETE BT_EVT_BIT(50) #define BT_EVT_MASK_LE_FRAME_SPACE_UPDATE_COMPLETE BT_EVT_BIT(52) +#define BT_EVT_MASK_LE_CONN_RATE_CHANGE BT_EVT_BIT(54) /** HCI Error Codes, BT Core Spec v5.4 [Vol 1, Part F]. */ #define BT_HCI_ERR_SUCCESS 0x00 diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index 7e8fa5dca6ec..ec5d4fafcc88 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -117,7 +117,7 @@ config BT_CONN_TX config BT_LE_LOCAL_MINIMUM_REQUIRED_FEATURE_PAGE int - default 1 if BT_FRAME_SPACE_UPDATE + default 1 if BT_FRAME_SPACE_UPDATE || BT_SHORTER_CONNECTION_INTERVALS default 0 depends on BT_LE_EXTENDED_FEAT_SET help @@ -260,6 +260,15 @@ config BT_CHANNEL_SOUNDING_REASSEMBLY_BUFFER_CNT results. Each running CS procedure is allocated one buffer and the number of concurrent CS procedures is limited by this value. +config BT_SHORTER_CONNECTION_INTERVALS + bool "Shorter Connection Intervals" + depends on !HAS_BT_CTLR || BT_CTLR_SHORTER_CONNECTION_INTERVALS_SUPPORT + depends on BT_LE_EXTENDED_FEAT_SET + depends on BT_SUBRATING + help + Enable support for the Bluetooth 6.2 Shorter Connection Intervals + feature. + endif # BT_CONN config BT_ISO diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 98107940b949..0892bd97b7eb 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -133,6 +133,9 @@ config BT_CTLR_CHANNEL_SOUNDING_SUPPORT config BT_CTLR_EXTENDED_FEAT_SET_SUPPORT bool +config BT_CTLR_SHORTER_CONNECTION_INTERVALS_SUPPORT + bool + # Virtual option that all local LL implementations should select config HAS_BT_CTLR bool @@ -1186,6 +1189,17 @@ config BT_CTLR_EXTENDED_FEAT_SET Enable support for Bluetooth 6.0 LL Extended Feature Set in the Controller. +config BT_CTLR_SHORTER_CONNECTION_INTERVALS + bool "Shorter Connection Intervals" + depends on BT_CTLR_SHORTER_CONNECTION_INTERVALS_SUPPORT + depends on BT_CTLR_EXTENDED_FEAT_SET + depends on BT_CTLR_SUBRATING + select BT_CTLR_SET_HOST_FEATURE + default y if BT_SHORTER_CONNECTION_INTERVALS + help + Enable support for Bluetooth 6.2 Shorter Connection Intervals + in the controller. + rsource "Kconfig.df" rsource "Kconfig.ll_sw_split" rsource "Kconfig.dtm" diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index d310ff1de5fe..6eb8d307bf08 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2839,7 +2839,10 @@ int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info) info->le.local = &conn->le.resp_addr; info->le.remote = &conn->le.init_addr; } - info->le.interval = conn->le.interval; + info->le.interval_us = conn->le.interval_us; +#if !defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) + info->le.interval = conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US; +#endif info->le.latency = conn->le.latency; info->le.timeout = conn->le.timeout; #if defined(CONFIG_BT_USER_PHY_UPDATE) @@ -3197,6 +3200,24 @@ void bt_conn_notify_subrate_change(struct bt_conn *conn, } } +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) +void bt_conn_notify_conn_rate_change(struct bt_conn *conn, uint8_t status, + const struct bt_conn_le_conn_rate_changed *params) +{ + BT_CONN_CB_DYNAMIC_FOREACH(callback) { + if (callback->conn_rate_changed != NULL) { + callback->conn_rate_changed(conn, status, params); + } + } + + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + if (cb->conn_rate_changed != NULL) { + cb->conn_rate_changed(conn, status, params); + } + } +} +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ + 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] */ @@ -3285,6 +3306,182 @@ int bt_conn_le_subrate_request(struct bt_conn *conn, } #endif /* CONFIG_BT_SUBRATING */ +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) +int bt_conn_le_read_min_conn_interval_groups(struct bt_conn_le_min_conn_interval_info *info) +{ + struct net_buf *rsp; + struct bt_hci_op_le_read_min_supported_conn_interval *rp; + int err; + + if (info == NULL) { + return -EINVAL; + } + + err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_MIN_SUPPORTED_CONN_INTERVAL, NULL, + &rsp); + if (err != 0) { + return err; + } + + rp = (struct bt_hci_op_le_read_min_supported_conn_interval *)rsp->data; + + if (rp->num_groups > BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS) { + LOG_ERR("Too many groups: %d (max %d)", + rp->num_groups, BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS); + net_buf_unref(rsp); + return -ENOMEM; + } + + info->min_supported_conn_interval_us = + BT_CONN_SCI_INTERVAL_TO_US(rp->min_supported_conn_interval); + info->num_groups = rp->num_groups; + + /* Copy groups up to the number allocated by the application */ + for (uint8_t i = 0; i < rp->num_groups; i++) { + info->groups[i].min_125us = sys_le16_to_cpu(rp->groups[i].group_min); + info->groups[i].max_125us = sys_le16_to_cpu(rp->groups[i].group_max); + info->groups[i].stride_125us = sys_le16_to_cpu(rp->groups[i].group_stride); + } + + net_buf_unref(rsp); + return 0; +} + +int bt_conn_le_read_min_conn_interval(uint16_t *min_interval_us) +{ + int err; + struct net_buf *rsp; + struct bt_hci_op_le_read_min_supported_conn_interval *rp; + + if (min_interval_us == NULL) { + return -EINVAL; + } + + err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_MIN_SUPPORTED_CONN_INTERVAL, NULL, + &rsp); + if (err != 0) { + return err; + } + + rp = (struct bt_hci_op_le_read_min_supported_conn_interval *)rsp->data; + *min_interval_us = BT_CONN_SCI_INTERVAL_TO_US(rp->min_supported_conn_interval); + + net_buf_unref(rsp); + return 0; +} + +static bool le_conn_rate_common_params_valid(const struct bt_conn_le_conn_rate_param *param) +{ + /* All limits according to BT Core spec 6.2 [Vol 4, Part E, 7.8.154] */ + + if (!IN_RANGE(param->interval_min_125us, BT_HCI_LE_SCI_INTERVAL_MIN_125US, + BT_HCI_LE_SCI_INTERVAL_MAX_125US) || + !IN_RANGE(param->interval_max_125us, BT_HCI_LE_SCI_INTERVAL_MIN_125US, + BT_HCI_LE_SCI_INTERVAL_MAX_125US) || + param->interval_min_125us > param->interval_max_125us) { + return false; + } + + if (!IN_RANGE(param->subrate_min, BT_HCI_LE_SUBRATE_FACTOR_MIN, + BT_HCI_LE_SUBRATE_FACTOR_MAX) || + !IN_RANGE(param->subrate_max, BT_HCI_LE_SUBRATE_FACTOR_MIN, + BT_HCI_LE_SUBRATE_FACTOR_MAX) || + param->subrate_min > param->subrate_max) { + return false; + } + + if (!IN_RANGE(param->max_latency, 0, BT_HCI_LE_PERIPHERAL_LATENCY_MAX) || + param->subrate_max * (param->max_latency + 1) > 500) { + return false; + } + + if (!IN_RANGE(param->continuation_number, 0, BT_HCI_LE_CONTINUATION_NUM_MAX) || + param->continuation_number >= param->subrate_max) { + return false; + } + + if (!IN_RANGE(param->supervision_timeout_10ms, BT_HCI_LE_SUPERVISON_TIMEOUT_MIN, + BT_HCI_LE_SUPERVISON_TIMEOUT_MAX)) { + return false; + } + + if (!IN_RANGE(param->min_ce_len_125us, BT_HCI_LE_SCI_CE_LEN_MIN_125US, + BT_HCI_LE_SCI_CE_LEN_MAX_125US) || + !IN_RANGE(param->max_ce_len_125us, BT_HCI_LE_SCI_CE_LEN_MIN_125US, + BT_HCI_LE_SCI_CE_LEN_MAX_125US) || + param->max_ce_len_125us < param->min_ce_len_125us) { + return false; + } + + return true; +} + +#if defined(CONFIG_BT_CENTRAL) +int bt_conn_le_conn_rate_set_defaults(const struct bt_conn_le_conn_rate_param *params) +{ + struct bt_hci_op_le_set_default_rate_parameters *cp; + struct net_buf *buf; + + if (params == NULL || !le_conn_rate_common_params_valid(params)) { + return -EINVAL; + } + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (buf == NULL) { + return -ENOBUFS; + } + + cp = net_buf_add(buf, sizeof(*cp)); + cp->conn_interval_min = sys_cpu_to_le16(params->interval_min_125us); + cp->conn_interval_max = sys_cpu_to_le16(params->interval_max_125us); + 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_10ms); + cp->min_ce_len = sys_cpu_to_le16(params->min_ce_len_125us); + cp->max_ce_len = sys_cpu_to_le16(params->max_ce_len_125us); + + return bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_DEFAULT_RATE_PARAMETERS, buf, NULL); +} +#endif /* CONFIG_BT_CENTRAL */ + +int bt_conn_le_conn_rate_request(struct bt_conn *conn, + const struct bt_conn_le_conn_rate_param *params) +{ + struct bt_hci_op_le_connection_rate_request *cp; + struct net_buf *buf; + + if (!bt_conn_is_le(conn)) { + LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); + return -EINVAL; + } + + if (params == NULL || !le_conn_rate_common_params_valid(params)) { + return -EINVAL; + } + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (buf == NULL) { + return -ENOBUFS; + } + + cp = net_buf_add(buf, sizeof(*cp)); + cp->handle = sys_cpu_to_le16(conn->handle); + cp->conn_interval_min = sys_cpu_to_le16(params->interval_min_125us); + cp->conn_interval_max = sys_cpu_to_le16(params->interval_max_125us); + 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_10ms); + cp->min_ce_len = sys_cpu_to_le16(params->min_ce_len_125us); + cp->max_ce_len = sys_cpu_to_le16(params->max_ce_len_125us); + + return bt_hci_cmd_send_sync(BT_HCI_OP_LE_CONNECTION_RATE_REQUEST, buf, NULL); +} +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ + #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) void bt_conn_notify_read_all_remote_feat_complete(struct bt_conn *conn, struct bt_conn_le_read_all_remote_feat_complete *params) diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index f1e4a289a135..3a4e2847e84d 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -527,6 +527,9 @@ void bt_conn_notify_path_loss_threshold_report(struct bt_conn *conn, void bt_conn_notify_subrate_change(struct bt_conn *conn, struct bt_conn_le_subrate_changed params); +void bt_conn_notify_conn_rate_change(struct bt_conn *conn, uint8_t status, + const struct bt_conn_le_conn_rate_changed *params); + void bt_conn_notify_read_all_remote_feat_complete(struct bt_conn *conn, struct bt_conn_le_read_all_remote_feat_complete *params); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index ee16fea31064..b1586d56f930 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -2807,6 +2807,72 @@ void bt_hci_le_subrate_change_event(struct net_buf *buf) } #endif /* CONFIG_BT_SUBRATING */ +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) +void bt_hci_le_conn_rate_change_event(struct net_buf *buf) +{ + struct bt_hci_evt_le_conn_rate_change *evt; + struct bt_conn_le_conn_rate_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 == NULL) { + LOG_ERR("Unknown conn handle 0x%04X for connection rate event", + sys_le16_to_cpu(evt->handle)); + return; + } + + if (evt->status == BT_HCI_ERR_SUCCESS) { + conn->le.interval_us = + BT_CONN_SCI_INTERVAL_TO_US(sys_le16_to_cpu(evt->conn_interval)); + 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); + + if (!IS_ENABLED(CONFIG_BT_CONN_PARAM_ANY)) { + if (!IN_RANGE(conn->le.interval_us / BT_HCI_LE_SCI_INTERVAL_UNIT_US, + BT_HCI_LE_SCI_INTERVAL_MIN_125US, + BT_HCI_LE_SCI_INTERVAL_MAX_125US)) { + LOG_WRN("interval_us exceeds the valid range %u us", + conn->le.interval_us); + } + if (!IN_RANGE(conn->le.subrate.factor, BT_HCI_LE_SUBRATE_FACTOR_MIN, + BT_HCI_LE_SUBRATE_FACTOR_MAX)) { + LOG_WRN("subrate_factor exceeds the valid range %d", + conn->le.subrate.factor); + } + if (conn->le.latency > BT_HCI_LE_PERIPHERAL_LATENCY_MAX) { + LOG_WRN("peripheral_latency exceeds the valid range 0x%04x", + conn->le.latency); + } + if (conn->le.subrate.continuation_number > BT_HCI_LE_CONTINUATION_NUM_MAX) { + LOG_WRN("continuation_number exceeds the valid range %d", + conn->le.subrate.continuation_number); + } + if (!IN_RANGE(conn->le.timeout, BT_HCI_LE_SUPERVISON_TIMEOUT_MIN, + BT_HCI_LE_SUPERVISON_TIMEOUT_MAX)) { + LOG_WRN("supervision_timeout exceeds the valid range 0x%04x", + conn->le.timeout); + } + } + + params.interval_us = conn->le.interval_us; + params.subrate_factor = conn->le.subrate.factor; + params.continuation_number = conn->le.subrate.continuation_number; + params.peripheral_latency = conn->le.latency; + params.supervision_timeout_10ms = conn->le.timeout; + + bt_conn_notify_conn_rate_change(conn, evt->status, ¶ms); + } else { + bt_conn_notify_conn_rate_change(conn, evt->status, NULL); + } + + bt_conn_unref(conn); +} +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ + 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, @@ -2957,7 +3023,11 @@ static const struct event_handler meta_events[] = { #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 */ +#endif /* CONFIG_BT_SUBRATING */ +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) + EVENT_HANDLER(BT_HCI_EVT_LE_CONN_RATE_CHANGE, bt_hci_le_conn_rate_change_event, + sizeof(struct bt_hci_evt_le_conn_rate_change)), +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ #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)), @@ -3566,6 +3636,11 @@ static int le_set_event_mask(void) mask |= BT_EVT_MASK_LE_SUBRATE_CHANGE; } + if (IS_ENABLED(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) && + BT_FEAT_LE_SHORTER_CONN_INTERVALS(bt_dev.le.features)) { + mask |= BT_EVT_MASK_LE_CONN_RATE_CHANGE; + } + if (IS_ENABLED(CONFIG_BT_LE_EXTENDED_FEAT_SET) && BT_FEAT_LE_EXTENDED_FEAT_SET(bt_dev.le.features)) { mask |= BT_EVT_MASK_LE_READ_ALL_REMOTE_FEAT_COMPLETE; @@ -3880,6 +3955,14 @@ static int le_init(void) } } + if (IS_ENABLED(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) && + BT_FEAT_LE_SHORTER_CONN_INTERVALS(bt_dev.le.features)) { + err = le_set_host_feature(BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS_HOST_SUPP, 1); + if (err != 0) { + return err; + } + } + return le_set_event_mask(); } From 2df5bfb6e2543ff008a6da57cf2631e1aacee6c7 Mon Sep 17 00:00:00 2001 From: Timothy Keys Date: Thu, 16 Oct 2025 16:49:42 +0100 Subject: [PATCH 0524/3334] [nrf fromtree] bluetooth: host: Change uses of interval to interval_us Since Shorter Connection Intervals changes the unit that connection intervals can be represented in. It is necessary to change how they are stored and represented. This commit deprecates interval in favour of interval_us. Remove use of interval in internal bt_conn struct since it is no longer needed. Signed-off-by: Timothy Keys (cherry picked from commit c14dcaf1995ea9c70b4ce334e4c9765da09eb35d) --- doc/releases/migration-guide-4.4.rst | 3 +++ doc/releases/release-notes-4.4.rst | 6 ++++++ include/zephyr/bluetooth/conn.h | 16 +++++++++++++--- include/zephyr/bluetooth/hci_types.h | 2 ++ subsys/bluetooth/audio/ascs.c | 10 +++++----- subsys/bluetooth/audio/bap_broadcast_assistant.c | 4 ++-- subsys/bluetooth/audio/bap_scan_delegator.c | 2 +- subsys/bluetooth/audio/bap_unicast_client.c | 4 ++-- subsys/bluetooth/audio/tbs.c | 2 +- subsys/bluetooth/host/att.c | 2 +- subsys/bluetooth/host/conn.c | 16 ++++++++-------- subsys/bluetooth/host/conn_internal.h | 2 +- subsys/bluetooth/host/hci_core.c | 13 +++++++------ subsys/bluetooth/host/shell/bt.c | 15 ++++++++++----- tests/bluetooth/audio/ascs/src/main.c | 2 +- tests/bluetooth/audio/ascs/src/test_common.c | 2 +- tests/bluetooth/tester/src/btp_gap.c | 2 +- 17 files changed, 65 insertions(+), 38 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 7966cd0f25e3..554607e5f857 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -40,6 +40,9 @@ Bluetooth Host * :kconfig:option:`CONFIG_BT_SIGNING` has been deprecated. * :c:macro:`BT_GATT_CHRC_AUTH` has been deprecated. +* :c:member:`bt_conn_le_info.interval` has been deprecated. Use + :c:member:`bt_conn_le_info.interval_us` instead. Note that the units have changed: ``interval`` + was in units of 1.25 milliseconds, while ``interval_us`` is in microseconds. Networking ********** diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 9622d9c5bd38..79a2bbf802e2 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -62,6 +62,12 @@ Deprecated APIs and options * The callback :c:member:`output_number` in :c:struct:`bt_mesh_prov` structure was deprecated. Applications should use :c:member:`output_numeric` callback instead. + * Host + + * :c:member:`bt_conn_le_info.interval` has been deprecated. Use + :c:member:`bt_conn_le_info.interval_us` instead. Note that the units have changed: + ``interval`` was in units of 1.25 milliseconds, while ``interval_us`` is in microseconds. + New APIs and options ==================== diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 7a2d5d9c1bad..4472a2690445 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1056,9 +1056,19 @@ struct bt_conn_le_info { /** Connection interval in microseconds */ uint32_t interval_us; #if !defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) || defined(__DOXYGEN__) - /** Connection interval in units of 1.25 ms */ - uint16_t interval; + union { + /** @brief Connection interval in units of 1.25 ms + * + * @deprecated Use @ref bt_conn_le_info.interval_us instead + */ + __deprecated uint16_t interval; + /** @cond INTERNAL_HIDDEN */ + /** Workaround for setting deprecated @ref bt_conn_le_info.interval */ + uint16_t _interval; + /** @endcond */ + }; #endif /* !CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ + uint16_t latency; /**< Connection peripheral latency */ uint16_t timeout; /**< Connection supervision timeout */ @@ -1096,7 +1106,7 @@ struct bt_conn_le_info { * * Multiply by 125 to get microseconds. */ -#define BT_CONN_SCI_INTERVAL_TO_US(interval) ((interval) * BT_HCI_LE_SCI_INTERVAL_UNIT_US) +#define BT_CONN_SCI_INTERVAL_TO_US(_interval) ((_interval) * BT_HCI_LE_SCI_INTERVAL_UNIT_US) /** BR/EDR Connection Info Structure */ struct bt_conn_br_info { diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index 98990919b680..ebdbe5c926ce 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -3289,6 +3289,8 @@ struct bt_hci_evt_le_advertising_report { #define BT_HCI_LE_SUPERVISON_TIMEOUT_MIN 0x000a #define BT_HCI_LE_SUPERVISON_TIMEOUT_MAX 0x0c80 +#define BT_HCI_LE_INTERVAL_UNIT_US (1250U) + #define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE 0x03 struct bt_hci_evt_le_conn_update_complete { uint8_t status; diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 48ed34cfd570..b8123cc3fcf4 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -525,7 +525,7 @@ static void state_transition_work_handler(struct k_work *work) err = ase_state_notify(ase); if (err == -ENOMEM) { struct bt_conn_info info; - uint32_t retry_delay_ms; + uint32_t retry_delay_us; /* Revert back to old state */ ase->ep.state = old_state; @@ -533,14 +533,14 @@ static void state_transition_work_handler(struct k_work *work) err = bt_conn_get_info(ase->conn, &info); __ASSERT_NO_MSG(err == 0); - retry_delay_ms = BT_CONN_INTERVAL_TO_MS(info.le.interval); + retry_delay_us = info.le.interval_us; /* Reschedule the state transition */ - err = k_work_reschedule(d_work, K_MSEC(retry_delay_ms)); + err = k_work_reschedule(d_work, K_USEC(retry_delay_us)); if (err >= 0) { LOG_DBG("Out of buffers for ase state notification. " - "Will retry in %dms", - retry_delay_ms); + "Will retry in %dus", + retry_delay_us); return; } } diff --git a/subsys/bluetooth/audio/bap_broadcast_assistant.c b/subsys/bluetooth/audio/bap_broadcast_assistant.c index 77ead34fef68..76b80fb59d86 100644 --- a/subsys/bluetooth/audio/bap_broadcast_assistant.c +++ b/subsys/bluetooth/audio/bap_broadcast_assistant.c @@ -453,12 +453,12 @@ static void long_bap_read(struct bt_conn *conn, uint16_t handle) if (err != 0) { LOG_DBG("Failed to get conn info, use default interval"); - conn_info.le.interval = BT_GAP_INIT_CONN_INT_MIN; + conn_info.le.interval_us = BT_CONN_INTERVAL_TO_US(BT_GAP_INIT_CONN_INT_MIN); } /* Wait a connection interval to retry */ err = k_work_reschedule(&inst->bap_read_work, - K_USEC(BT_CONN_INTERVAL_TO_US(conn_info.le.interval))); + K_USEC(conn_info.le.interval_us)); if (err < 0) { LOG_DBG("Failed to reschedule read work: %d", err); bap_long_read_reset(inst); diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 8c21b806900f..1be1eec56a82 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -240,7 +240,7 @@ static void receive_state_notify_cb(struct bt_conn *conn, void *data) LOG_DBG("Could not notify receive state: %d", err); err = k_work_reschedule(&internal_state->notify_work, - K_USEC(BT_CONN_INTERVAL_TO_US(conn_info.le.interval))); + K_USEC(conn_info.le.interval_us)); __ASSERT(err >= 0, "Failed to reschedule work: %d", err); } } diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index 48c43f9faa8b..429431ada433 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -1767,12 +1767,12 @@ static void long_ase_read(struct bt_bap_unicast_client_ep *client_ep) if (err != 0) { LOG_DBG("Failed to get conn info, use default interval"); - conn_info.le.interval = BT_GAP_INIT_CONN_INT_MIN; + conn_info.le.interval_us = BT_CONN_INTERVAL_TO_US(BT_GAP_INIT_CONN_INT_MIN); } /* Wait a connection interval to retry */ err = k_work_reschedule(&client_ep->ase_read_work, - K_USEC(BT_CONN_INTERVAL_TO_US(conn_info.le.interval))); + K_USEC(conn_info.le.interval_us)); if (err < 0) { LOG_DBG("Failed to reschedule ASE long read work: %d", err); } diff --git a/subsys/bluetooth/audio/tbs.c b/subsys/bluetooth/audio/tbs.c index 7526c5327e0f..d7026c63dbe3 100644 --- a/subsys/bluetooth/audio/tbs.c +++ b/subsys/bluetooth/audio/tbs.c @@ -1005,7 +1005,7 @@ static void notify_handler_cb(struct bt_conn *conn, void *data) LOG_DBG("Notify failed (%d), retrying next connection interval", err); reschedule: err = k_work_reschedule(&inst->notify_work, - K_USEC(BT_CONN_INTERVAL_TO_US(info.le.interval))); + K_USEC(info.le.interval_us)); __ASSERT(err >= 0, "Failed to reschedule work: %d", err); } diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index c822de7ab4bc..644952f55257 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -3538,7 +3538,7 @@ static k_timeout_t credit_based_connection_delay(struct bt_conn *conn) * result in an overflow */ const uint32_t calculated_delay_us = - 2 * (conn->le.latency + 1) * BT_CONN_INTERVAL_TO_US(conn->le.interval); + 2 * (conn->le.latency + 1) * conn->le.interval_us; const uint32_t calculated_delay_ms = calculated_delay_us / USEC_PER_MSEC; return K_MSEC(MAX(100, calculated_delay_ms + rand_delay)); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 6eb8d307bf08..f7658646acb1 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1960,30 +1960,30 @@ void bt_conn_notify_remote_info(struct bt_conn *conn) void bt_conn_notify_le_param_updated(struct bt_conn *conn) { + uint16_t interval_1250us = conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US; + /* If new connection parameters meet requirement of pending * parameters don't send peripheral conn param request anymore on timeout */ if (atomic_test_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET) && - conn->le.interval >= conn->le.interval_min && - conn->le.interval <= conn->le.interval_max && + interval_1250us >= conn->le.interval_min && + interval_1250us <= conn->le.interval_max && conn->le.latency == conn->le.pending_latency && conn->le.timeout == conn->le.pending_timeout) { atomic_clear_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET); } - BT_CONN_CB_DYNAMIC_FOREACH(callback) { if (callback->le_param_updated) { - callback->le_param_updated(conn, conn->le.interval, + callback->le_param_updated(conn, interval_1250us, conn->le.latency, conn->le.timeout); } } STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->le_param_updated) { - cb->le_param_updated(conn, conn->le.interval, - conn->le.latency, - conn->le.timeout); + cb->le_param_updated(conn, interval_1250us, + conn->le.latency, conn->le.timeout); } } } @@ -2841,7 +2841,7 @@ int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info) } info->le.interval_us = conn->le.interval_us; #if !defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) - info->le.interval = conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US; + info->le._interval = conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US; #endif info->le.latency = conn->le.latency; info->le.timeout = conn->le.timeout; diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 3a4e2847e84d..32c2445cb0c1 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -107,7 +107,7 @@ struct bt_conn_le { bt_addr_le_t init_addr; bt_addr_le_t resp_addr; - uint16_t interval; + uint32_t interval_us; uint16_t interval_min; uint16_t interval_max; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index b1586d56f930..f02755ccf872 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1408,7 +1408,7 @@ static void update_conn(struct bt_conn *conn, const bt_addr_le_t *id_addr, { conn->handle = sys_le16_to_cpu(evt->handle); bt_addr_le_copy(&conn->le.dst, id_addr); - conn->le.interval = sys_le16_to_cpu(evt->interval); + conn->le.interval_us = sys_le16_to_cpu(evt->interval) * BT_HCI_LE_INTERVAL_UNIT_US; conn->le.latency = sys_le16_to_cpu(evt->latency); conn->le.timeout = sys_le16_to_cpu(evt->supv_timeout); conn->role = evt->role; @@ -2060,15 +2060,16 @@ static void le_conn_update_complete(struct net_buf *buf) bt_l2cap_update_conn_param(conn, ¶m); } else { if (!evt->status) { - conn->le.interval = sys_le16_to_cpu(evt->interval); + conn->le.interval_us = + sys_le16_to_cpu(evt->interval) * BT_HCI_LE_INTERVAL_UNIT_US; conn->le.latency = sys_le16_to_cpu(evt->latency); conn->le.timeout = sys_le16_to_cpu(evt->supv_timeout); if (!IS_ENABLED(CONFIG_BT_CONN_PARAM_ANY)) { - if (!IN_RANGE(conn->le.interval, BT_HCI_LE_INTERVAL_MIN, - BT_HCI_LE_INTERVAL_MAX)) { - LOG_WRN("interval exceeds the valid range 0x%04x", - conn->le.interval); + if (!IN_RANGE(conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US, + BT_HCI_LE_INTERVAL_MIN, BT_HCI_LE_INTERVAL_MAX)) { + LOG_WRN("interval exceeds the valid range %u us", + conn->le.interval_us); } if (conn->le.latency > BT_HCI_LE_PERIPHERAL_LATENCY_MAX) { LOG_WRN("latency exceeds the valid range 0x%04x", diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 816b6549853b..4395a3c62c26 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -3715,8 +3715,13 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) print_le_addr("Local on-air", info.le.local); shell_print(sh, "Interval: 0x%04x (%u us)", - info.le.interval, - BT_CONN_INTERVAL_TO_US(info.le.interval)); +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) + info.le.interval_us / BT_HCI_LE_SCI_INTERVAL_UNIT_US, +#else + info.le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US, +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ + info.le.interval_us); + shell_print(sh, "Latency: 0x%04x", info.le.latency); shell_print(sh, "Supervision timeout: 0x%04x (%d ms)", @@ -4138,9 +4143,9 @@ static void connection_info(struct bt_conn *conn, void *user_data) #endif case BT_CONN_TYPE_LE: bt_addr_le_to_str(info.le.dst, addr, sizeof(addr)); - bt_shell_print("%s#%u [LE][%s] %s: Interval %u latency %u timeout %u", selected, - info.id, role_str, addr, info.le.interval, info.le.latency, - info.le.timeout); + bt_shell_print("%s#%u [LE][%s] %s: Interval %u us, latency %u, timeout %u ms", + selected, info.id, role_str, addr, info.le.interval_us, + info.le.latency, info.le.timeout * 10); break; #if defined(CONFIG_BT_ISO) case BT_CONN_TYPE_ISO: diff --git a/tests/bluetooth/audio/ascs/src/main.c b/tests/bluetooth/audio/ascs/src/main.c index a326c7b1495f..4aca7cee1c11 100644 --- a/tests/bluetooth/audio/ascs/src/main.c +++ b/tests/bluetooth/audio/ascs/src/main.c @@ -667,7 +667,7 @@ ZTEST_F(ascs_test_suite, test_ase_state_notification_retry) zassert_equal(err, 0); /* Wait for ASE state notification retry */ - k_sleep(K_MSEC(BT_CONN_INTERVAL_TO_MS(info.le.interval))); + k_sleep(K_USEC(info.le.interval_us)); expect_bt_bap_stream_ops_configured_called_once(stream, EMPTY); } diff --git a/tests/bluetooth/audio/ascs/src/test_common.c b/tests/bluetooth/audio/ascs/src/test_common.c index b09677592f46..f97840fe40ac 100644 --- a/tests/bluetooth/audio/ascs/src/test_common.c +++ b/tests/bluetooth/audio/ascs/src/test_common.c @@ -77,7 +77,7 @@ void test_conn_init(struct bt_conn *conn) conn->info.security.level = BT_SECURITY_L2; conn->info.security.enc_key_size = BT_ENC_KEY_SIZE_MAX; conn->info.security.flags = BT_SECURITY_FLAG_OOB | BT_SECURITY_FLAG_SC; - conn->info.le.interval = BT_GAP_INIT_CONN_INT_MIN; + conn->info.le.interval_us = BT_GAP_INIT_CONN_INT_MIN * BT_HCI_LE_INTERVAL_UNIT_US; } const struct bt_gatt_attr *test_ase_control_point_get(void) diff --git a/tests/bluetooth/tester/src/btp_gap.c b/tests/bluetooth/tester/src/btp_gap.c index 80b30467bd9d..f3535d4acca7 100644 --- a/tests/bluetooth/tester/src/btp_gap.c +++ b/tests/bluetooth/tester/src/btp_gap.c @@ -134,7 +134,7 @@ static void le_connected(struct bt_conn *conn, uint8_t err) if (bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { bt_addr_le_copy(&ev.address, info.le.dst); - ev.interval = sys_cpu_to_le16(info.le.interval); + ev.interval = sys_cpu_to_le16(info.le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US); ev.latency = sys_cpu_to_le16(info.le.latency); ev.timeout = sys_cpu_to_le16(info.le.timeout); } else if (IS_ENABLED(CONFIG_BT_CLASSIC) && bt_conn_is_type(conn, BT_CONN_TYPE_BR)) { From 2be3dbcf59c574fa346543b274ddf266621f0b95 Mon Sep 17 00:00:00 2001 From: Timothy Keys Date: Wed, 15 Oct 2025 16:03:50 +0100 Subject: [PATCH 0525/3334] [nrf fromtree] bluetooth: host: shell: Add SCI shell commands This adds support for Shorter Connection Interval commands in the bt shell. Signed-off-by: Timothy Keys (cherry picked from commit 6bfa6fa9a825f2076ae9a070abb28e09556872ec) --- subsys/bluetooth/host/shell/bt.c | 182 ++++++++++++++++++++++++++-- tests/bluetooth/shell/testcase.yaml | 7 ++ 2 files changed, 178 insertions(+), 11 deletions(-) diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 4395a3c62c26..21302647bdf7 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -1009,7 +1009,30 @@ void subrate_changed(struct bt_conn *conn, bt_shell_print("Subrate change failed (HCI status 0x%02x)", params->status); } } -#endif + +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) +static void conn_rate_changed(struct bt_conn *conn, uint8_t status, + const struct bt_conn_le_conn_rate_changed *params) +{ + if (status == BT_HCI_ERR_SUCCESS) { + bt_shell_print("Connection rate parameters changed: " + "Connection Interval: %u us " + "Subrate Factor: %d " + "Peripheral latency: 0x%04x " + "Continuation Number: %d " + "Supervision timeout: 0x%04x (%d ms)", + params->interval_us, + params->subrate_factor, + params->peripheral_latency, + params->continuation_number, + params->supervision_timeout_10ms, + params->supervision_timeout_10ms * 10); + } else { + bt_shell_print("Connection rate change failed (HCI status 0x%02x)", status); + } +} +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ +#endif /* CONFIG_BT_SUBRATING */ #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) void read_all_remote_feat_complete(struct bt_conn *conn, @@ -1255,6 +1278,9 @@ BT_CONN_CB_DEFINE(conn_callbacks) = { #if defined(CONFIG_BT_SUBRATING) .subrate_changed = subrate_changed, #endif +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) + .conn_rate_changed = conn_rate_changed, +#endif #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) .read_all_remote_feat_complete = read_all_remote_feat_complete, #endif @@ -3361,7 +3387,130 @@ static int cmd_subrate_request(const struct shell *sh, size_t argc, char *argv[] return 0; } -#endif + +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) +static int cmd_read_min_conn_interval_groups(const struct shell *sh, size_t argc, char *argv[]) +{ + int err; + struct bt_conn_le_min_conn_interval_info info; + + err = bt_conn_le_read_min_conn_interval_groups(&info); + if (err != 0) { + shell_error(sh, "bt_conn_le_read_min_conn_interval_groups returned error %d", err); + return -ENOEXEC; + } + + shell_print(sh, "Minimum supported connection interval: %u us", + info.min_supported_conn_interval_us); + shell_print(sh, "Number of groups: %u", info.num_groups); + + for (uint8_t i = 0; i < info.num_groups; i++) { + shell_print( + sh, + " Group %u: min=0x%04x (%u us), max=0x%04x (%u us), stride=0x%04x (%u us)", + i, + info.groups[i].min_125us, + BT_CONN_SCI_INTERVAL_TO_US(info.groups[i].min_125us), + info.groups[i].max_125us, + BT_CONN_SCI_INTERVAL_TO_US(info.groups[i].max_125us), + info.groups[i].stride_125us, + BT_CONN_SCI_INTERVAL_TO_US(info.groups[i].stride_125us)); + } + + return 0; +} + +static int cmd_read_min_conn_interval(const struct shell *sh, size_t argc, char *argv[]) +{ + int err; + uint16_t min_interval_us; + + err = bt_conn_le_read_min_conn_interval(&min_interval_us); + if (err != 0) { + shell_error(sh, "bt_conn_le_read_min_conn_interval returned error %d", err); + return -ENOEXEC; + } + + shell_print(sh, "Minimum supported connection interval: %u us", min_interval_us); + return 0; +} + +static int cmd_conn_rate_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 != 0) { + shell_help(sh); + shell_error(sh, "Could not parse input number %zu", argn); + return SHELL_CMD_HELP_PRINTED; + } + } + + const struct bt_conn_le_conn_rate_param params = { + .interval_min_125us = shell_strtoul(argv[1], 10, &err), + .interval_max_125us = shell_strtoul(argv[2], 10, &err), + .subrate_min = shell_strtoul(argv[3], 10, &err), + .subrate_max = shell_strtoul(argv[4], 10, &err), + .max_latency = shell_strtoul(argv[5], 10, &err), + .continuation_number = shell_strtoul(argv[6], 10, &err), + .supervision_timeout_10ms = shell_strtoul(argv[7], 10, &err), + .min_ce_len_125us = shell_strtoul(argv[8], 10, &err), + .max_ce_len_125us = shell_strtoul(argv[9], 10, &err), + }; + + err = bt_conn_le_conn_rate_set_defaults(¶ms); + if (err != 0) { + shell_error(sh, "bt_conn_le_conn_rate_set_defaults returned error %d", err); + return -ENOEXEC; + } + + return 0; +} + +static int cmd_conn_rate_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 != 0) { + shell_help(sh); + shell_error(sh, "Could not parse input number %zu", argn); + return SHELL_CMD_HELP_PRINTED; + } + } + + const struct bt_conn_le_conn_rate_param params = { + .interval_min_125us = shell_strtoul(argv[1], 10, &err), + .interval_max_125us = shell_strtoul(argv[2], 10, &err), + .subrate_min = shell_strtoul(argv[3], 10, &err), + .subrate_max = shell_strtoul(argv[4], 10, &err), + .max_latency = shell_strtoul(argv[5], 10, &err), + .continuation_number = shell_strtoul(argv[6], 10, &err), + .supervision_timeout_10ms = shell_strtoul(argv[7], 10, &err), + .min_ce_len_125us = shell_strtoul(argv[8], 10, &err), + .max_ce_len_125us = shell_strtoul(argv[9], 10, &err), + }; + + err = bt_conn_le_conn_rate_request(default_conn, ¶ms); + if (err != 0) { + shell_error(sh, "bt_conn_le_conn_rate_request returned error %d", err); + return -ENOEXEC; + } + + return 0; +} +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ +#endif /* CONFIG_BT_SUBRATING */ #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) static int cmd_read_all_remote_features(const struct shell *sh, size_t argc, char *argv[]) @@ -3714,14 +3863,7 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) print_le_addr("Remote on-air", info.le.remote); print_le_addr("Local on-air", info.le.local); - shell_print(sh, "Interval: 0x%04x (%u us)", -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) - info.le.interval_us / BT_HCI_LE_SCI_INTERVAL_UNIT_US, -#else - info.le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US, -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ - info.le.interval_us); - + shell_print(sh, "Interval: %u us", info.le.interval_us); shell_print(sh, "Latency: 0x%04x", info.le.latency); shell_print(sh, "Supervision timeout: 0x%04x (%d ms)", @@ -5216,7 +5358,25 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds, " " " ", cmd_subrate_request, 6, 0), -#endif +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) + SHELL_CMD_ARG(read-min-conn-interval-groups, NULL, + "Read minimum supported connection interval and groups", + cmd_read_min_conn_interval_groups, 1, 0), + SHELL_CMD_ARG(read-min-conn-interval, NULL, + "Read minimum supported connection interval only", + cmd_read_min_conn_interval, 1, 0), + SHELL_CMD_ARG(conn-rate-set-defaults, NULL, + " " + " " + " ", + cmd_conn_rate_set_defaults, 10, 0), + SHELL_CMD_ARG(conn-rate-request, NULL, + " " + " " + " ", + cmd_conn_rate_request, 10, 0), +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ +#endif /* CONFIG_BT_SUBRATING */ #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) SHELL_CMD_ARG(read-all-remote-features, NULL, "", cmd_read_all_remote_features, 2, 0), diff --git a/tests/bluetooth/shell/testcase.yaml b/tests/bluetooth/shell/testcase.yaml index 399c939b0661..7cf350dabe81 100644 --- a/tests/bluetooth/shell/testcase.yaml +++ b/tests/bluetooth/shell/testcase.yaml @@ -46,6 +46,13 @@ tests: - CONFIG_BT_LE_EXTENDED_FEAT_SET=y - CONFIG_BT_LL_SW_SPLIT=n build_only: true + bluetooth.shell.shorter_connection_intervals: + extra_configs: + - CONFIG_BT_SHORTER_CONNECTION_INTERVALS=y + - CONFIG_BT_LE_EXTENDED_FEAT_SET=y + - CONFIG_BT_SUBRATING=y + - CONFIG_BT_LL_SW_SPLIT=n + build_only: true bluetooth.shell.channel_sounding: extra_configs: - CONFIG_BT_CHANNEL_SOUNDING=y From ca9ae7fc780e3d3ce61dd123441514b724b8d629 Mon Sep 17 00:00:00 2001 From: Aleksandar Stanoev Date: Wed, 19 Nov 2025 15:31:29 +0000 Subject: [PATCH 0526/3334] [nrf fromtree] bluetooth: host: Fix bt_conn reference leak in Frame Space Update Fix a missing unref of a bt_conn reference, leading to a ref count mismatch, and causing the following warning to be printed: bt_conn: Found valid connection ... in disconnected state. Signed-off-by: Aleksandar Stanoev (cherry picked from commit 1eea6adad2963a7c889281e7024cc0f01af7e842) --- subsys/bluetooth/host/hci_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index f02755ccf872..66ba610bee2b 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1856,6 +1856,8 @@ static void le_frame_space_update_complete(struct net_buf *buf) } bt_conn_notify_frame_space_update_complete(conn, ¶ms); + + bt_conn_unref(conn); } #endif /* CONFIG_BT_FRAME_SPACE_UPDATE */ From 044d5a0445fea6efc85c7f15617c3d57b18cd850 Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Wed, 5 Nov 2025 14:55:05 +0100 Subject: [PATCH 0527/3334] [nrf fromtree] tests: driver: flash: Increase the single I/O test transfer timeout Increase the allowed transfer timeout for the signel I/O test. Signed-off-by: Bartosz Miller (cherry picked from commit e638687af4fcc69e18af87fff3b7662db056741f) --- tests/drivers/flash/common/boards/mx25uw63_single_io.overlay | 2 +- .../common/boards/mx25uw63_single_io_4B_addr_sreset.overlay | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay index ac06662e9526..e74369f372b1 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay @@ -58,5 +58,5 @@ status = "okay"; mspi-max-frequency = ; mspi-io-mode = "MSPI_IO_MODE_SINGLE"; - transfer-timeout = <500>; + transfer-timeout = <1000>; }; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay index 09af484cc212..f2f74b269676 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay @@ -60,5 +60,5 @@ mspi-io-mode = "MSPI_IO_MODE_SINGLE"; use-4byte-addressing; initial-soft-reset; - transfer-timeout = <500>; + transfer-timeout = <1000>; }; From 3b0588e9fd9fec29fca3a85b8a840bc5ee4315bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 24 Nov 2025 09:33:05 +0100 Subject: [PATCH 0528/3334] [nrf fromlist] drivers: uart_nrfx_uarte: Fix runtime device PM for interrupt driven API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing getting/putting of the device when the RX interrupt is enabled/disabled. Also fix enabling and disabling of the TX interrupt so that the device is got/put only if the interrupt wasn't already enabled/disabled and device PM reference counting is done correctly. This fixes `console_getchar()` that would hang when used with `CONFIG_PM_DEVICE_RUNTIME=y`. Upstream PR #: 99888 Signed-off-by: Andrzej Głąbek --- drivers/serial/uart_nrfx_uarte.c | 38 +++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index ffb090ca16f1..a60a1ee97aa1 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2832,27 +2832,35 @@ static void uarte_nrfx_irq_tx_enable(const struct device *dev) { NRF_UARTE_Type *uarte = get_uarte_instance(dev); struct uarte_nrfx_data *data = dev->data; + bool already_enabled; - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(dev); - } + pm_device_runtime_get(dev); unsigned int key = irq_lock(); - data->int_driven->disable_tx_irq = false; - data->int_driven->tx_irq_enabled = true; - nrf_uarte_int_enable(uarte, NRF_UARTE_INT_TXSTOPPED_MASK); + already_enabled = data->int_driven->tx_irq_enabled; + if (!already_enabled) { + data->int_driven->disable_tx_irq = false; + data->int_driven->tx_irq_enabled = true; + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_TXSTOPPED_MASK); + } irq_unlock(key); + + if (already_enabled) { + pm_device_runtime_put(dev); + } } /** Interrupt driven transfer disabling function */ static void uarte_nrfx_irq_tx_disable(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; - /* TX IRQ will be disabled after current transmission is finished */ - data->int_driven->disable_tx_irq = true; - data->int_driven->tx_irq_enabled = false; + if (data->int_driven->tx_irq_enabled) { + /* TX IRQ will be disabled after current transmission is finished */ + data->int_driven->disable_tx_irq = true; + data->int_driven->tx_irq_enabled = false; + } } /** Interrupt driven transfer ready function */ @@ -2888,7 +2896,11 @@ static void uarte_nrfx_irq_rx_enable(const struct device *dev) { NRF_UARTE_Type *uarte = get_uarte_instance(dev); - nrf_uarte_int_enable(uarte, NRF_UARTE_INT_ENDRX_MASK); + if (!nrf_uarte_int_enable_check(uarte, NRF_UARTE_INT_ENDRX_MASK)) { + pm_device_runtime_get(dev); + + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_ENDRX_MASK); + } } /** Interrupt driven receiver disabling function */ @@ -2896,7 +2908,11 @@ static void uarte_nrfx_irq_rx_disable(const struct device *dev) { NRF_UARTE_Type *uarte = get_uarte_instance(dev); - nrf_uarte_int_disable(uarte, NRF_UARTE_INT_ENDRX_MASK); + if (nrf_uarte_int_enable_check(uarte, NRF_UARTE_INT_ENDRX_MASK)) { + pm_device_runtime_put_async(dev, K_NO_WAIT); + + nrf_uarte_int_disable(uarte, NRF_UARTE_INT_ENDRX_MASK); + } } /** Interrupt driven error enabling function */ From 8b5c61292d55ce9f5a319586206ee59b025465a3 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 28 Oct 2025 13:43:05 +0100 Subject: [PATCH 0529/3334] [nrf fromtree] scripts: runners: Generalize the --dry-run option Move the argparse.add_argument() call to the abstract base class and augment the RunnerCaps class with a dry_run parameter. Signed-off-by: Carles Cufi (cherry picked from commit 48e04817463f827609e694fb1472dc6af326d252) --- scripts/west_commands/runners/core.py | 7 +++++++ scripts/west_commands/runners/nrf_common.py | 4 ++-- scripts/west_commands/runners/nrfutil.py | 6 +----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/west_commands/runners/core.py b/scripts/west_commands/runners/core.py index 611848f671cd..0efd4c3fb163 100644 --- a/scripts/west_commands/runners/core.py +++ b/scripts/west_commands/runners/core.py @@ -318,6 +318,7 @@ class RunnerCaps: hide_load_files: bool = False rtt: bool = False # This capability exists separately from the rtt command # to allow other commands to use the rtt address + dry_run: bool = False def __post_init__(self): if self.mult_dev_ids and not self.dev_id: @@ -639,6 +640,10 @@ def add_parser(cls, parser): else: parser.add_argument('--rtt-address', help=argparse.SUPPRESS) + parser.add_argument('--dry-run', action='store_true', + help=('''Print all the commands without actually + executing them''' if caps.dry_run else argparse.SUPPRESS)) + # Runner-specific options. cls.do_add_parser(parser) @@ -685,6 +690,8 @@ def create(cls, cfg: RunnerConfig, _missing_cap(cls, '--file-type') if args.rtt_address and not caps.rtt: _missing_cap(cls, '--rtt-address') + if args.dry_run and not caps.dry_run: + _missing_cap(cls, '--dry-run') ret = cls.do_create(cfg, args) if args.erase: diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index 75ad66aed99f..5cdca1e6b3f6 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -75,10 +75,10 @@ def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, self.tool_opt += opts @classmethod - def _capabilities(cls, mult_dev_ids=False): + def _capabilities(cls, mult_dev_ids=False, dry_run=False): return RunnerCaps(commands={'flash'}, dev_id=True, mult_dev_ids=mult_dev_ids, erase=True, reset=True, - tool_opt=True) + tool_opt=True, dry_run=dry_run) @classmethod def _dev_id_help(cls) -> str: diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index 9deb32e06a02..f5be3ac8eb01 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -37,7 +37,7 @@ def name(cls): @classmethod def capabilities(cls): - return NrfBinaryRunner._capabilities(mult_dev_ids=True) + return NrfBinaryRunner._capabilities(mult_dev_ids=True, dry_run=True) @classmethod def dev_id_help(cls) -> str: @@ -65,10 +65,6 @@ def do_add_parser(cls, parser): parser.add_argument('--ext-mem-config-file', required=False, dest='ext_mem_config_file', help='path to an JSON file with external memory configuration') - parser.add_argument('--dry-run', required=False, - action='store_true', - help='''Generate all the commands without actually - executing them''') def _exec(self, args, force=False): jout_all = [] From c21478a922dd6af7f1f3651026297714d2ca21aa Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 28 Oct 2025 19:35:31 +0100 Subject: [PATCH 0530/3334] [nrf fromtree] scripts: runners: Enable reusing the core dry run logic In order to avoid duplication of logic in runners, allow subclasses of ZephyrBinaryRunner to set self.dry_run so that they can then reuse the logic in core.py to log instead of execute. Signed-off-by: Carles Cufi (cherry picked from commit ffe2028dcf6aa2ec5f58c4dc6ba084f1932529c9) --- scripts/west_commands/runners/core.py | 13 ++++++++----- scripts/west_commands/runners/nrfutil.py | 12 +++--------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/scripts/west_commands/runners/core.py b/scripts/west_commands/runners/core.py index 0efd4c3fb163..a47f76f1e9e0 100644 --- a/scripts/west_commands/runners/core.py +++ b/scripts/west_commands/runners/core.py @@ -493,6 +493,9 @@ def __init__(self, cfg: RunnerConfig): self.logger = logging.getLogger(f'runners.{self.name()}') '''logging.Logger for this instance.''' + self.dry_run = _DRY_RUN + '''log commands instead of executing them. Can be set by subclasses''' + @staticmethod def get_runners() -> list[type['ZephyrBinaryRunner']]: '''Get a list of all currently defined runner classes.''' @@ -867,7 +870,7 @@ def run_client(self, client, **kwargs): def _log_cmd(self, cmd: list[str]): escaped = ' '.join(shlex.quote(s) for s in cmd) - if not _DRY_RUN: + if not self.dry_run: self.logger.debug(escaped) else: self.logger.info(escaped) @@ -880,7 +883,7 @@ def call(self, cmd: list[str], **kwargs) -> int: using subprocess directly, to keep accurate debug logs. ''' self._log_cmd(cmd) - if _DRY_RUN: + if self.dry_run: return 0 return subprocess.call(cmd, **kwargs) @@ -892,7 +895,7 @@ def check_call(self, cmd: list[str], **kwargs): using subprocess directly, to keep accurate debug logs. ''' self._log_cmd(cmd) - if _DRY_RUN: + if self.dry_run: return subprocess.check_call(cmd, **kwargs) @@ -904,7 +907,7 @@ def check_output(self, cmd: list[str], **kwargs) -> bytes: using subprocess directly, to keep accurate debug logs. ''' self._log_cmd(cmd) - if _DRY_RUN: + if self.dry_run: return b'' return subprocess.check_output(cmd, **kwargs) @@ -925,7 +928,7 @@ def popen_ignore_int(self, cmd: list[str], **kwargs) -> subprocess.Popen: preexec = os.setsid # type: ignore self._log_cmd(cmd) - if _DRY_RUN: + if self.dry_run: return _DebugDummyPopen() # type: ignore return subprocess.Popen(cmd, creationflags=cflags, preexec_fn=preexec, **kwargs) diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index f5be3ac8eb01..5770cf86fae4 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -5,12 +5,10 @@ '''Runner for flashing with nrfutil.''' import json -import shlex import subprocess import sys from pathlib import Path -from runners.core import _DRY_RUN from runners.nrf_common import NrfBinaryRunner @@ -70,14 +68,10 @@ def _exec(self, args, force=False): jout_all = [] cmd = ['nrfutil', '--json', 'device'] + args + self._log_cmd(cmd) - escaped = ' '.join(shlex.quote(s) for s in cmd) - if _DRY_RUN or (self.dry_run): - self.logger.info(escaped) - if not force: - return {} - else: - self.logger.debug(escaped) + if self.dry_run and not force: + return {} with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p: for line in iter(p.stdout.readline, b''): From 9b0a06ea1e410aa33173e39f50315f9db7081e23 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 21 Nov 2025 10:29:04 +0100 Subject: [PATCH 0531/3334] [nrf fromtree] scripts: west: nrfutil: Use build dir to store generated json Until now the code was using the path to the .hex file to select the directory where the generated JSON file required for nrfutil would be generated. But this has a problem: if the .hex file in a sysbuild project is located in the tree as a precompiled binary, the runner would place a file in there and make the tree dirty. Instead use the build_dir folder which always corresponds (in both sysbuild and regular builds) to the current target build directory. Signed-off-by: Carles Cufi (cherry picked from commit d6f5aa925832800204d3e0fe0015a924de5323f6) --- scripts/west_commands/runners/nrfutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index 5770cf86fae4..051a686f5a1a 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -152,7 +152,7 @@ def _append_batch(self, op, json_file): def _exec_batch(self): # Use x-append-batch to get the JSON from nrfutil itself - json_file = Path(self.hex_).parent / 'generated_nrfutil_batch.json' + json_file = Path(self.cfg.build_dir) / 'zephyr' / 'generated_nrfutil_batch.json' json_file.unlink(missing_ok=True) for op in self._ops: self._append_batch(op, json_file) From 235a1903d7e777c9cc88a25135322dd290e50184 Mon Sep 17 00:00:00 2001 From: Hui Bai Date: Mon, 11 Aug 2025 10:27:15 +0800 Subject: [PATCH 0532/3334] [nrf fromtree] samples: net: wifi: Add TLSv1.3 support in wifi example Add TLSv1.3 support in wifi example for RW612 and IW610. Signed-off-by: Hui Bai (cherry picked from commit af9f889135ddb9ac4e9828531c189f83ac1cec9c) --- modules/hostap/CMakeLists.txt | 4 ++++ modules/hostap/Kconfig | 8 ++++++++ west.yml | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 5c750f545d2e..f3233bb2cfbb 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -572,6 +572,10 @@ zephyr_library_compile_definitions_ifdef(CONFIG_EAP_FAST EAP_FAST ) +zephyr_library_compile_definitions_ifdef(CONFIG_EAP_TLSV1_3 + EAP_TLSV1_3 +) + zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_EAPOL ${HOSTAP_SRC_BASE}/eapol_supp/eapol_supp_sm.c ${HOSTAP_SRC_BASE}/eap_peer/eap.c diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 1aa21670bb71..7799239a2840 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -299,6 +299,14 @@ config EAP_ALL select EAP_TTLS select EAP_MSCHAPV2 default y + +config EAP_TLSV1_3 + bool "EAP TLSv1.3 support" + select MBEDTLS_TLS_VERSION_1_3 + select MBEDTLS_TLS_SESSION_TICKETS + select MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED + select MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED + select MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED endif # WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE config WIFI_NM_WPA_SUPPLICANT_WPA3 diff --git a/west.yml b/west.yml index 1bff38e1c7b8..88b61440d420 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 5abcff1c0ecff65f0f81e0cc086b7f766e5101bf + revision: f707b19c1733ebe401a50450494e5ebdd2e71b5f - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 93e60488de31bdc85dba3f6fcffc54b775dc6485 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 15 Sep 2025 20:21:37 +0530 Subject: [PATCH 0533/3334] [nrf fromtree] manifest: hostap: Pull hostap changes required for multiple VIF This commit links the hostap PR required for the nrf7002 driver. west.yml is updated Signed-off-by: Hanan Arshad Signed-off-by: Chaitanya Tata (cherry picked from commit 58e7dba8bcb627909cc4236be923c5be698edc33) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 88b61440d420..4b5a35fc3ea5 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: f707b19c1733ebe401a50450494e5ebdd2e71b5f + revision: 0798bf0faff40919bd577f1c8f75a2f9baae6299 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From d8f071f29e9138a553983c340ce92748db786ca6 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 15 Sep 2025 20:21:38 +0530 Subject: [PATCH 0534/3334] [nrf fromtree] modules: hostap: Update WPA supplicant to use per-VIF control channel Update WPA supplicant functions to pass the control channel (socket) as a parameter instead of relying on a global socket. This change aligns with the PR 80 modifications in hostap repo and ensures that each Virtual Interface (VIF) uses its dedicated control channel for communication. Signed-off-by: Hanan Arshad Signed-off-by: Chaitanya Tata (cherry picked from commit 53a885a696e22bf0a78b727709ea401e42f045af) --- modules/hostap/src/supp_api.c | 38 +++++++++++++++++----------------- modules/hostap/src/supp_main.h | 2 -- modules/hostap/src/wpa_cli.c | 21 ++++++++++++++++++- 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 8ae45d6db2af..7f9993bed2dc 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -80,20 +80,19 @@ static void supp_shell_connect_status(struct k_work *work); static K_WORK_DELAYABLE_DEFINE(wpa_supp_status_work, supp_shell_connect_status); -#define wpa_cli_cmd_v(cmd, ...) ({ \ - bool status; \ - \ - if (zephyr_wpa_cli_cmd_v(cmd, ##__VA_ARGS__) < 0) { \ - wpa_printf(MSG_ERROR, \ - "Failed to execute wpa_cli command: %s", \ - cmd); \ - status = false; \ - } else { \ - status = true; \ - } \ - \ - status; \ -}) +#define wpa_cli_cmd_v(cmd, ...) \ + ({ \ + bool status; \ + \ + if (zephyr_wpa_cli_cmd_v(wpa_s->ctrl_conn, cmd, ##__VA_ARGS__) < 0) { \ + wpa_printf(MSG_ERROR, "Failed to execute wpa_cli command: %s", cmd); \ + status = false; \ + } else { \ + status = true; \ + } \ + \ + status; \ + }) static struct wpa_supplicant *get_wpa_s_handle(const struct device *dev) { @@ -626,7 +625,7 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, goto out; } - ret = z_wpa_ctrl_add_network(&resp); + ret = z_wpa_ctrl_add_network(wpa_s->ctrl_conn, &resp); if (ret) { wpa_printf(MSG_ERROR, "Failed to add network"); goto out; @@ -1365,7 +1364,7 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status status->channel = channel; if (ssid_len == 0) { - int _res = z_wpa_ctrl_status(&cli_status); + int _res = z_wpa_ctrl_status(wpa_s->ctrl_conn, &cli_status); if (_res < 0) { ssid_len = 0; @@ -1394,7 +1393,7 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status status->rssi = -WPA_INVALID_NOISE; if (status->iface_mode == WIFI_MODE_INFRA) { - ret = z_wpa_ctrl_signal_poll(&signal_poll); + ret = z_wpa_ctrl_signal_poll(wpa_s->ctrl_conn, &signal_poll); if (!ret) { status->rssi = signal_poll.rssi; status->current_phy_tx_rate = signal_poll.current_txrate; @@ -2007,7 +2006,7 @@ static int supplicant_wps_pin(const struct device *dev, struct wifi_wps_config_p } if (params->oper == WIFI_WPS_PIN_GET) { - if (zephyr_wpa_cli_cmd_resp(get_pin_cmd, params->pin)) { + if (zephyr_wpa_cli_cmd_resp(wpa_s->ctrl_conn, get_pin_cmd, params->pin)) { goto out; } } else if (params->oper == WIFI_WPS_PIN_SET) { @@ -2440,6 +2439,7 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa { int ret; char *cmd = NULL; + struct wpa_supplicant *wpa_s = get_wpa_s_handle(dev); if (params == NULL) { return -EINVAL; @@ -2458,7 +2458,7 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa } wpa_printf(MSG_DEBUG, "wpa_cli %s", cmd); - if (zephyr_wpa_cli_cmd_resp(cmd, params->resp)) { + if (zephyr_wpa_cli_cmd_resp(wpa_s->ctrl_conn, cmd, params->resp)) { os_free(cmd); return -ENOEXEC; } diff --git a/modules/hostap/src/supp_main.h b/modules/hostap/src/supp_main.h index 60ac642f9c79..2b2d5fc61112 100644 --- a/modules/hostap/src/supp_main.h +++ b/modules/hostap/src/supp_main.h @@ -58,8 +58,6 @@ struct wpa_supplicant *zephyr_get_handle_by_ifname(const char *ifname); struct hapd_interfaces *zephyr_get_default_hapd_context(void); #endif -struct wpa_supplicant *zephyr_get_handle_by_ifname(const char *ifname); - struct wpa_supplicant_event_msg { #ifdef CONFIG_WIFI_NM_HOSTAPD_AP int hostapd; diff --git a/modules/hostap/src/wpa_cli.c b/modules/hostap/src/wpa_cli.c index 406008da101a..0e1b41728b74 100644 --- a/modules/hostap/src/wpa_cli.c +++ b/modules/hostap/src/wpa_cli.c @@ -8,10 +8,17 @@ * @brief wpa_cli implementation for Zephyr OS */ +#include #include #include +#include #include + +#include "supp_main.h" + +#include "common.h" +#include "wpa_supplicant_i.h" #include "wpa_cli_zephyr.h" #ifdef CONFIG_WIFI_NM_HOSTAPD_AP #include "hostapd_cli_zephyr.h" @@ -21,8 +28,20 @@ static int cmd_wpa_cli(const struct shell *sh, size_t argc, const char *argv[]) { + struct net_if *iface = net_if_get_first_wifi(); + char if_name[CONFIG_NET_INTERFACE_NAME_LEN + 1]; + struct wpa_supplicant *wpa_s = NULL; + ARG_UNUSED(sh); + if (iface == NULL) { + shell_error(sh, "No Wifi interface found"); + return -ENOENT; + } + + net_if_get_name(iface, if_name, sizeof(if_name)); + wpa_s = zephyr_get_handle_by_ifname(if_name); + if (argc == 1) { shell_error(sh, "Missing argument"); return -EINVAL; @@ -32,7 +51,7 @@ static int cmd_wpa_cli(const struct shell *sh, argc++; /* Remove wpa_cli from the argument list */ - return zephyr_wpa_ctrl_zephyr_cmd(argc - 1, &argv[1]); + return zephyr_wpa_ctrl_zephyr_cmd(wpa_s->ctrl_conn, argc - 1, &argv[1]); } #ifdef CONFIG_WIFI_NM_HOSTAPD_AP From 394001496836c8293627e8780c4b199385c9f207 Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Thu, 25 Sep 2025 12:17:33 -0400 Subject: [PATCH 0535/3334] [nrf fromtree] manifest: update hostap module to correct time.h and signal.h paths Update the hostap module to use non-prefixed paths for the ISO C time.h and signal.h headers. Signed-off-by: Chris Friedt (cherry picked from commit 882ee961865734b3571eb1730b87ab532023b21b) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4b5a35fc3ea5..1ac6629e2e8f 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 0798bf0faff40919bd577f1c8f75a2f9baae6299 + revision: 61182a45fecafaa0f20e98ca7f862d26fbf65293 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 18a4e244df9eb85a12c71822ae0b4aab73441df7 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 5 Sep 2025 13:56:27 +0200 Subject: [PATCH 0536/3334] [nrf fromtree] manifest: update hostap revision for bgscan fix The hostap module is updated with a build fix fetched from upstream. Signed-off-by: Pieter De Gendt (cherry picked from commit 5a503644ba716e9fdecfd5b15502820d81887129) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 1ac6629e2e8f..42ef14c26e21 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 61182a45fecafaa0f20e98ca7f862d26fbf65293 + revision: 3ec675be30c25b56cc0e7dbd5bd931a87d32937e - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 988e3bd0c4bc27dff9b4a02c37252ca6c8d7e810 Mon Sep 17 00:00:00 2001 From: Maochen Wang Date: Mon, 20 Oct 2025 15:36:56 +0800 Subject: [PATCH 0537/3334] [nrf fromtree] manifest: update hostap to fix EAP-FAST connection issue DUT Failed to associate fast-gtc/fast-mscahpv2 enterprise network, there is error log shows 'EAP-FAST: Compound MAC did not match'. tls_connection_get_eap_fast_key() gets wrong key, currently using mbedtls_ssl_tls_prf to derive key, and it's not PSA API. Therefore, conn->expkey_keyblock_size can't be set as 0, the correct expkey_keyblock_size should contain keylen + mac_key_len + ivlen. Remove MBEDTLS_USE_PSA_CRYPTO to get keyblock_size correctly. Signed-off-by: Maochen Wang (cherry picked from commit dfd6efc972afd8d35db24be20aa9e1acc0d369c8) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 42ef14c26e21..82ac520eca10 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 3ec675be30c25b56cc0e7dbd5bd931a87d32937e + revision: ca77ec50a01a09b8bf149160308736b6b5741f12 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From f4d338c4005a561fee7b174f9c85086e9d95f9fb Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 22 Oct 2025 01:10:24 +0530 Subject: [PATCH 0538/3334] [nrf fromtree] manifest: hostap: Pull fix for SoftAP start Due to the recent nRF70 driver changes, the driver ops are removed from config, but few functions in hostap still depend on that, so, pull the fix for hostap driver ops. Signed-off-by: Chaitanya Tata (cherry picked from commit fa0d62393f9b3fc396565428e17f75b849aff86f) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 82ac520eca10..9aba75719c07 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: ca77ec50a01a09b8bf149160308736b6b5741f12 + revision: cf05f33f594de6b62840a3b0dd435f10467a2e4c - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From f484e15e4bb0c5c9bd4061f26989e1443a679b4a Mon Sep 17 00:00:00 2001 From: Triveni Danda Date: Fri, 24 Oct 2025 14:41:04 +0530 Subject: [PATCH 0539/3334] [nrf fromtree] manifest: hostap: Enable server certificate verification Enable hostname validation for server certificate verification. Signed-off-by: Triveni Danda (cherry picked from commit b708f3d04b3d89f79b3c90eb244859fab042024e) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 9aba75719c07..a00bfc9e1318 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: cf05f33f594de6b62840a3b0dd435f10467a2e4c + revision: 6086dea5ee7406e1eede7f2ca6dff1b00b0f04e2 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 9a2ff83f08d96df16e93d9258eaa4b25b2c9a4fc Mon Sep 17 00:00:00 2001 From: Triveni Danda Date: Wed, 29 Oct 2025 15:54:48 +0530 Subject: [PATCH 0540/3334] [nrf fromtree] net: l2: wifi: Handle domain match and suffix match parameters Add support to handle domain match and suffix match parameters for proper server certification validation. Signed-off-by: Triveni Danda (cherry picked from commit b4e2cd139bc86f9a853df6bee96832b87ffb972d) --- include/zephyr/net/wifi_mgmt.h | 10 ++++++++++ modules/hostap/src/supp_api.c | 16 ++++++++++++++++ subsys/net/l2/wifi/wifi_shell.c | 16 +++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index a9dbd74607ca..703f634209d2 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -716,6 +716,16 @@ struct wifi_connect_req_params { uint8_t ignore_broadcast_ssid; /** Parameter used for frequency band */ enum wifi_frequency_bandwidths bandwidth; + + /** Full domain name to verify in the server certificate */ + const uint8_t *server_cert_domain_exact; + /** Length of the server_cert_domain_exact string, maximum 128 bytes */ + uint8_t server_cert_domain_exact_len; + + /** Domain name suffix to verify in the server certificate */ + const uint8_t *server_cert_domain_suffix; + /** Length of the server_cert_domain_suffix string, maximum 64 bytes */ + uint8_t server_cert_domain_suffix_len; }; /** @brief Wi-Fi disconnect reason codes. To be overlaid on top of \ref wifi_status diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 7f9993bed2dc..c905fc4cfbcf 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -969,6 +969,22 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, goto out; } + if (params->server_cert_domain_exact_len > 0) { + if (!wpa_cli_cmd_v("set_network %d domain_match \"%s\"", + resp.network_id, + params->server_cert_domain_exact)) { + goto out; + } + } + + if (params->server_cert_domain_suffix_len > 0) { + if (!wpa_cli_cmd_v("set_network %d domain_suffix_match \"%s\"", + resp.network_id, + params->server_cert_domain_suffix)) { + goto out; + } + } + if (false == ((params->security == WIFI_SECURITY_TYPE_EAP_PEAP_MSCHAPV2 || params->security == WIFI_SECURITY_TYPE_EAP_TTLS_MSCHAPV2) && (!params->verify_peer_cert))) { diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 555358aff0a9..5a90d2ccf4c4 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -620,6 +620,8 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv {"ignore-broadcast-ssid", required_argument, 0, 'g'}, {"ieee-80211r", no_argument, 0, 'R'}, {"iface", required_argument, 0, 'i'}, + {"server-cert-domain-exact", required_argument, 0, 'e'}, + {"server-cert-domain-suffix", required_argument, 0, 'x'}, {"help", no_argument, 0, 'h'}, {0, 0, 0, 0}}; char *endptr; @@ -872,6 +874,16 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv case 'i': /* Unused, but parsing to avoid unknown option error */ break; + case 'e': + params->server_cert_domain_exact = state->optarg; + params->server_cert_domain_exact_len = + strlen(params->server_cert_domain_exact); + break; + case 'x': + params->server_cert_domain_suffix = state->optarg; + params->server_cert_domain_suffix_len = + strlen(params->server_cert_domain_suffix); + break; case 'h': return -ENOEXEC; default: @@ -3921,10 +3933,12 @@ SHELL_SUBCMD_ADD((wifi), connect, NULL, "[-P, --eap-pwd1]: Client Password.\n" "Default no password for eap user.\n" "[-R, --ieee-80211r]: Use IEEE80211R fast BSS transition connect." + "[-e, --server-cert-domain-exact]: Full domain names for server certificate match.\n" + "[-x, --server-cert-domain-suffix]: Domain name suffixes for server certificate match.\n" "[-h, --help]: Print out the help for the connect command.\n" "[-i, --iface=] : Interface index.\n", cmd_wifi_connect, - 2, 42); + 2, 46); SHELL_SUBCMD_ADD((wifi), disconnect, NULL, "Disconnect from the Wi-Fi AP.\n" From 17cb7cc9c694aeecfa4a65e41052969cd6cfc02b Mon Sep 17 00:00:00 2001 From: Triveni Danda Date: Thu, 6 Nov 2025 15:48:02 +0530 Subject: [PATCH 0541/3334] [nrf fromtree] doc: wifi: Add server certificate domain validation instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add instructions for verifying the authentication server’s certificate domain using exact domain match and domain suffix match options. Signed-off-by: Triveni Danda (cherry picked from commit 0186d123e89e6830b1b9cfd5bc1712b1222d2214) --- doc/connectivity/networking/api/wifi.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/connectivity/networking/api/wifi.rst b/doc/connectivity/networking/api/wifi.rst index 65cc7d9502d8..e0be44835443 100644 --- a/doc/connectivity/networking/api/wifi.rst +++ b/doc/connectivity/networking/api/wifi.rst @@ -120,6 +120,29 @@ To initiate a Wi-Fi connection using enterprise security, use one of the followi Server certificate is also provided in the same directory for testing purposes. Any AAA server can be used for testing purposes, for example, ``FreeRADIUS`` or ``hostapd``. +Server certificate domain name verification +------------------------------------------- + +The authentication server’s identity is verified by validating the domain name in the X.509 certificate received from the server, using the ``Common Name`` (CN) field. + +* Exact domain match — Verifies that the certificate’s CN exactly matches the specified domain. + +* Domain suffix match — Allows a certificate whose CN ends with the specified domain suffix. + +To initiate a Wi-Fi connection using enterprise security with server certificate validation, use one of the following commands, depending on the desired validation mode: + +* Exact domain match + + .. code-block:: console + + wifi connect -s -c -k 12 -K -e + +* Domain suffix match + + .. code-block:: console + + wifi connect -s -c -k 12 -K -x + Certificate requirements for EAP methods ---------------------------------------- From 5fb9d91bc21801dce0e9808d789197657fa3bd9e Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 16 Sep 2025 01:29:06 +0530 Subject: [PATCH 0542/3334] [nrf fromtree] modules: hostap: Use per-interface control connection For hostapd also use per-interface control connection like we do for supplicant. Signed-off-by: Chaitanya Tata (cherry picked from commit b29dddf07331a693b89581ee56f8d26bb14cd9f0) --- modules/hostap/src/hapd_api.c | 20 +++++++++++++++----- modules/hostap/src/hapd_api.h | 4 +++- modules/hostap/src/supp_api.c | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/modules/hostap/src/hapd_api.c b/modules/hostap/src/hapd_api.c index 97367d35c531..e9decd25b921 100644 --- a/modules/hostap/src/hapd_api.c +++ b/modules/hostap/src/hapd_api.c @@ -38,7 +38,7 @@ static struct wifi_enterprise_creds_params hapd_enterprise_creds; #define hostapd_cli_cmd_v(cmd, ...) ({ \ bool status; \ \ - if (zephyr_hostapd_cli_cmd_v(cmd, ##__VA_ARGS__) < 0) { \ + if (zephyr_hostapd_cli_cmd_v(iface->ctrl_conn, cmd, ##__VA_ARGS__) < 0) { \ wpa_printf(MSG_ERROR, \ "Failed to execute wpa_cli command: %s", \ cmd); \ @@ -365,12 +365,22 @@ int hostapd_add_enterprise_creds(const struct device *dev, } #endif -bool hostapd_ap_reg_domain(struct wifi_reg_domain *reg_domain) +bool hostapd_ap_reg_domain(const struct device *dev, + struct wifi_reg_domain *reg_domain) { - return hostapd_cli_cmd_v("set country_code %s", reg_domain->country_code); + struct hostapd_iface *iface; + + iface = get_hostapd_handle(dev); + if (iface == NULL) { + wpa_printf(MSG_ERROR, "Interface %s not found", dev->name); + return false; + } + + return hostapd_cli_cmd_v(iface->ctrl_conn, "set country_code %s", reg_domain->country_code); } -static int hapd_config_chan_center_seg0(struct wifi_connect_req_params *params) +static int hapd_config_chan_center_seg0(struct hostapd_iface *iface, + struct wifi_connect_req_params *params) { int ret = 0; uint8_t center_freq_seg0_idx = 0; @@ -472,7 +482,7 @@ int hapd_config_network(struct hostapd_iface *iface, goto out; } - ret = hapd_config_chan_center_seg0(params); + ret = hapd_config_chan_center_seg0(iface, params); if (ret) { goto out; } diff --git a/modules/hostap/src/hapd_api.h b/modules/hostap/src/hapd_api.h index cc6f1fe74010..3fa0e7963fcb 100644 --- a/modules/hostap/src/hapd_api.h +++ b/modules/hostap/src/hapd_api.h @@ -25,9 +25,11 @@ int hostapd_ap_config_params(const struct device *dev, struct wifi_ap_config_par * @brief Set Wi-Fi AP region domain * * @param reg_domain region domain parameters + * @param dev Wi-Fi device * @return true for OK; false for ERROR */ -bool hostapd_ap_reg_domain(struct wifi_reg_domain *reg_domain); +bool hostapd_ap_reg_domain(const struct device *dev, + struct wifi_reg_domain *reg_domain); #ifdef CONFIG_WIFI_NM_HOSTAPD_WPS /** Start AP WPS PBC/PIN diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index c905fc4cfbcf..1b3f19b4c1c1 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -1749,7 +1749,7 @@ int supplicant_reg_domain(const struct device *dev, } if (IS_ENABLED(CONFIG_WIFI_NM_HOSTAPD_AP)) { - if (!hostapd_ap_reg_domain(reg_domain)) { + if (!hostapd_ap_reg_domain(dev, reg_domain)) { goto out; } } From f316ea6f7080c448f423f68b44a0f6fe78d7f455 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 16 Sep 2025 00:56:27 +0530 Subject: [PATCH 0543/3334] [nrf fromtree] modules: hostap: Add interface arg to cli commands Now that we support multiple VIFs, need to add argument for the interface for any command. Signed-off-by: Chaitanya Tata (cherry picked from commit 3de9df0a5ab97ac9551037899159d046c8bbc7f6) --- modules/hostap/src/hapd_api.c | 2 +- modules/hostap/src/wpa_cli.c | 124 +++++++++++++++++++++++++++++----- 2 files changed, 108 insertions(+), 18 deletions(-) diff --git a/modules/hostap/src/hapd_api.c b/modules/hostap/src/hapd_api.c index e9decd25b921..7cdbc89eba86 100644 --- a/modules/hostap/src/hapd_api.c +++ b/modules/hostap/src/hapd_api.c @@ -376,7 +376,7 @@ bool hostapd_ap_reg_domain(const struct device *dev, return false; } - return hostapd_cli_cmd_v(iface->ctrl_conn, "set country_code %s", reg_domain->country_code); + return hostapd_cli_cmd_v("set country_code %s", reg_domain->country_code); } static int hapd_config_chan_center_seg0(struct hostapd_iface *iface, diff --git a/modules/hostap/src/wpa_cli.c b/modules/hostap/src/wpa_cli.c index 0e1b41728b74..27bcc6efc3bb 100644 --- a/modules/hostap/src/wpa_cli.c +++ b/modules/hostap/src/wpa_cli.c @@ -9,9 +9,11 @@ */ #include +#include #include #include #include +#include #include @@ -21,28 +23,64 @@ #include "wpa_supplicant_i.h" #include "wpa_cli_zephyr.h" #ifdef CONFIG_WIFI_NM_HOSTAPD_AP +#include "hostapd.h" +#include "hapd_main.h" #include "hostapd_cli_zephyr.h" #endif -static int cmd_wpa_cli(const struct shell *sh, - size_t argc, - const char *argv[]) +static int cmd_wpa_cli(const struct shell *sh, size_t argc, const char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = NULL; char if_name[CONFIG_NET_INTERFACE_NAME_LEN + 1]; struct wpa_supplicant *wpa_s = NULL; + size_t arg_offset = 1; + int idx = -1; + bool iface_found = false; + + if (argc > 2 && + ((strcmp(argv[1], "-i") == 0) || + (strncmp(argv[1], "-i", 2) == 0 && argv[1][2] != '\0'))) { + /* Handle both "-i 2" and "-i2" */ + if (strcmp(argv[1], "-i") == 0) { + idx = strtol(argv[2], NULL, 10); + arg_offset = 3; + } else { + idx = strtol(&argv[1][2], NULL, 10); + arg_offset = 2; + } + iface = net_if_get_by_index(idx); + if (!iface) { + shell_error(sh, "Interface index %d not found", idx); + return -ENODEV; + } + net_if_get_name(iface, if_name, sizeof(if_name)); + if_name[sizeof(if_name) - 1] = '\0'; + iface_found = true; + } else { + /* Default to first Wi-Fi interface */ + iface = net_if_get_first_wifi(); + if (!iface) { + shell_error(sh, "No Wi-Fi interface found"); + return -ENOENT; + } + net_if_get_name(iface, if_name, sizeof(if_name)); + if_name[sizeof(if_name) - 1] = '\0'; + arg_offset = 1; + iface_found = true; + } - ARG_UNUSED(sh); - - if (iface == NULL) { - shell_error(sh, "No Wifi interface found"); - return -ENOENT; + if (!iface_found) { + shell_error(sh, "No interface found"); + return -ENODEV; } - net_if_get_name(iface, if_name, sizeof(if_name)); wpa_s = zephyr_get_handle_by_ifname(if_name); + if (!wpa_s) { + shell_error(sh, "No wpa_supplicant context for interface '%s'", if_name); + return -ENODEV; + } - if (argc == 1) { + if (argc <= arg_offset) { shell_error(sh, "Missing argument"); return -EINVAL; } @@ -51,15 +89,65 @@ static int cmd_wpa_cli(const struct shell *sh, argc++; /* Remove wpa_cli from the argument list */ - return zephyr_wpa_ctrl_zephyr_cmd(wpa_s->ctrl_conn, argc - 1, &argv[1]); + return zephyr_wpa_ctrl_zephyr_cmd(wpa_s->ctrl_conn, argc - arg_offset, &argv[arg_offset]); } #ifdef CONFIG_WIFI_NM_HOSTAPD_AP static int cmd_hostapd_cli(const struct shell *sh, size_t argc, const char *argv[]) { - ARG_UNUSED(sh); + struct net_if *iface = NULL; + size_t arg_offset = 1; + struct hostapd_iface *hapd_iface; + int idx = -1; + bool iface_found = false; + char if_name[CONFIG_NET_INTERFACE_NAME_LEN + 1]; + int ret; + + if (argc > 2 && + ((strcmp(argv[1], "-i") == 0) || + (strncmp(argv[1], "-i", 2) == 0 && argv[1][2] != '\0'))) { + /* Handle both "-i 2" and "-i2" */ + if (strcmp(argv[1], "-i") == 0) { + idx = strtol(argv[2], NULL, 10); + arg_offset = 3; + } else { + idx = strtol(&argv[1][2], NULL, 10); + arg_offset = 2; + } + iface = net_if_get_by_index(idx); + if (!iface) { + shell_error(sh, "Interface index %d not found", idx); + return -ENODEV; + } + iface_found = true; + } else { + iface = net_if_get_first_wifi(); + if (!iface) { + shell_error(sh, "No Wi-Fi interface found"); + return -ENOENT; + } + arg_offset = 1; + iface_found = true; + } + + if (!iface_found) { + shell_error(sh, "No interface found"); + return -ENODEV; + } + + ret = net_if_get_name(iface, if_name, sizeof(if_name)); + if (!ret) { + shell_error(sh, "Cannot get interface name (%d)", ret); + return -ENODEV; + } + + hapd_iface = zephyr_get_hapd_handle_by_ifname(if_name); + if (!hapd_iface) { + shell_error(sh, "No hostapd context for interface '%s'", if_name); + return -ENODEV; + } - if (argc == 1) { + if (argc <= arg_offset) { shell_error(sh, "Missing argument"); return -EINVAL; } @@ -68,7 +156,8 @@ static int cmd_hostapd_cli(const struct shell *sh, size_t argc, const char *argv argc++; /* Remove hostapd_cli from the argument list */ - return zephyr_hostapd_ctrl_zephyr_cmd(argc - 1, &argv[1]); + return zephyr_hostapd_ctrl_zephyr_cmd(hapd_iface->ctrl_conn, argc - arg_offset, + &argv[arg_offset]); } #endif @@ -77,9 +166,10 @@ static int cmd_hostapd_cli(const struct shell *sh, size_t argc, const char *argv */ SHELL_CMD_REGISTER(wpa_cli, NULL, - "wpa_cli commands (only for internal use)", + "wpa_cli [-i idx] (only for internal use)", cmd_wpa_cli); #ifdef CONFIG_WIFI_NM_HOSTAPD_AP -SHELL_CMD_REGISTER(hostapd_cli, NULL, "hostapd_cli commands (only for internal use)", +SHELL_CMD_REGISTER(hostapd_cli, NULL, + "hostapd_cli [-i idx] (only for internal use)", cmd_hostapd_cli); #endif From 716d6a7b2ef73958d914d1f3377a95650689e71f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 26 Sep 2025 11:34:55 +0200 Subject: [PATCH 0544/3334] [nrf fromtree] nordic: nrf54h: bicr: allow for custom bicr.json in application Allow placing a custom bicr.json file in the application source folder which will be used instead of the default one in the boards folder. Also allows setting a custom name to use for the file so multiple files can be placed in either boards or app dirs and selected with Kconfig (prj.conf or .conf) The following will take precedence over the bicr.json file in the board folder: - /bicr.json - /bicr_foo.json + CONFIG_SOC_NRF54H20_BICR_NAME="bicr_foo.json" Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 034d3d3325fe2caf91f982a7d9de742f06aa2b79) --- soc/nordic/nrf54h/bicr/CMakeLists.txt | 8 +++++++- soc/nordic/nrf54h/bicr/Kconfig | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/bicr/CMakeLists.txt b/soc/nordic/nrf54h/bicr/CMakeLists.txt index a93e36abbd26..0f7cfb33dd1e 100644 --- a/soc/nordic/nrf54h/bicr/CMakeLists.txt +++ b/soc/nordic/nrf54h/bicr/CMakeLists.txt @@ -1,8 +1,14 @@ if(CONFIG_SOC_NRF54H20_GENERATE_BICR) - set(bicr_json_file ${BOARD_DIR}/bicr.json) + set(bicr_json_file ${BOARD_DIR}/${CONFIG_SOC_NRF54H20_BICR_NAME}) set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex) set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk/nrf54h20_application.svd) + set(app_bicr_json_file ${APPLICATION_SOURCE_DIR}/${CONFIG_SOC_NRF54H20_BICR_NAME}) + if(EXISTS ${app_bicr_json_file}) + set(bicr_json_file ${app_bicr_json_file}) + endif() + + message(STATUS "Found BICR: ${bicr_json_file}") if(EXISTS ${bicr_json_file}) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${bicr_json_file}) diff --git a/soc/nordic/nrf54h/bicr/Kconfig b/soc/nordic/nrf54h/bicr/Kconfig index a1ba7d2400c3..c6cc4d7c9d2d 100644 --- a/soc/nordic/nrf54h/bicr/Kconfig +++ b/soc/nordic/nrf54h/bicr/Kconfig @@ -8,3 +8,12 @@ config SOC_NRF54H20_GENERATE_BICR help This option generates a BICR file for the board being used. Board directory must contain a "bicr.json" file for this option to work. + +config SOC_NRF54H20_BICR_NAME + string "Name of nRF54H20 BICR file to use" + depends on SOC_NRF54H20_GENERATE_BICR + default "bicr.json" + help + The file will be searched for in application folder first, then + board folder if not found. The application can select a bicr by + setting CONFIG_SOC_NRF54H20_BICR_NAME="some_bicr.json" From 277afdc819c3e83c3c4ec79fb2952d7dc9ea212e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Tue, 25 Nov 2025 07:53:18 +0100 Subject: [PATCH 0545/3334] Revert "[nrf noup] bluetooth: host: Add support for bonding with same peer" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4994883cb4f5b53f64c5909798a5dfd6ee79e376. Signed-off-by: Håvard Reierstad --- include/zephyr/bluetooth/bluetooth.h | 10 -- subsys/bluetooth/host/Kconfig | 18 --- subsys/bluetooth/host/adv.c | 52 ------- subsys/bluetooth/host/adv.h | 1 - subsys/bluetooth/host/hci_core.h | 23 +-- subsys/bluetooth/host/id.c | 219 +++------------------------ subsys/bluetooth/host/id.h | 23 --- subsys/bluetooth/host/keys.c | 79 +--------- subsys/bluetooth/host/keys.h | 6 - subsys/bluetooth/host/smp.c | 18 +-- tests/bluetooth/host/id/mocks/adv.c | 1 - tests/bluetooth/host/id/mocks/adv.h | 4 +- tests/bluetooth/host/id/mocks/keys.c | 1 - tests/bluetooth/host/id/mocks/keys.h | 4 +- 14 files changed, 32 insertions(+), 427 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 0739733c9543..8e738d21970d 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1295,10 +1295,6 @@ struct bt_le_per_adv_param { * This error code is only guaranteed when using Zephyr * controller, for other controllers code returned in * this case may be -EIO. - * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and - * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable - * advertising is requested, and the given local identity has a conflicting - * key with another local identity for which advertising is already started. */ int bt_le_adv_start(const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, @@ -1426,12 +1422,6 @@ struct bt_le_ext_adv_start_param { * * @param adv Advertising set object. * @param param Advertise start parameters. - * - * @return Zero on success or (negative) error code otherwise. - * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and - * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable - * advertising is requested, and the given local identity has a conflicting - * key with another local identity for which advertising is already started. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, const struct bt_le_ext_adv_start_param *param); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 9eba33273066..8920d41d0e07 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -659,24 +659,6 @@ config BT_ID_UNPAIR_MATCHING_BONDS link-layer. The Host does not have control over this acknowledgment, and the order of distribution is fixed by the specification. -config BT_ID_AUTO_SWAP_MATCHING_BONDS - bool "Automatically swap conflicting entries in the Resolving List" - depends on !BT_ID_UNPAIR_MATCHING_BONDS - depends on BT_SMP && BT_PERIPHERAL && !BT_CENTRAL - help - If this option is enabled, the Host will not add a new bond with - the same peer address (or IRK) to the Resolving List if there is - already a bond with the same peer address (or IRK) on another local - identity. - - In case of Peripheral, the Host will swap the existing entry in the - Resolving List with the new one, so that the new bond will be used for - address resolution for the new local identity if the device starts - advertising with the new local identity. - - Important: this option is supported exclusively in the Peripheral - role. Excluding the Central role. - config BT_ID_ALLOW_UNAUTH_OVERWRITE bool "Allow unauthenticated pairing with same peer with other local identity" depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 3a17a7192535..e4ad43bea565 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -234,25 +234,6 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) #endif /* CONFIG_BT_BROADCASTER */ #endif /* defined(CONFIG_BT_EXT_ADV) */ -struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id) -{ -#if defined(CONFIG_BT_EXT_ADV) - for (size_t i = 0; i < ARRAY_SIZE(adv_pool); i++) { - if (atomic_test_bit(adv_pool[i].flags, BT_ADV_CREATED) && - adv_pool[i].id == id) { - return &adv_pool[i]; - } - } -#else - if (atomic_test_bit(bt_dev.adv.flags, BT_ADV_CREATED) && bt_dev.adv.id == id) { - return &bt_dev.adv; - } -#endif - - return NULL; -} - - void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), void *data) { @@ -948,14 +929,6 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, adv->id = param->id; bt_dev.adv_conn_id = adv->id; - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - err = bt_id_resolving_list_check_and_update(adv->id, param->peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - err = bt_id_set_adv_own_addr(adv, param->options, dir_adv, &set_param.own_addr_type); if (err) { @@ -1239,15 +1212,6 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } adv->id = param->id; - - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - err = bt_id_resolving_list_check_and_update(adv->id, param->peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - err = le_ext_adv_param_set(adv, param, sd != NULL); if (err) { return err; @@ -1535,22 +1499,6 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, return -EALREADY; } - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - const bt_addr_le_t *peer; - - if (bt_addr_le_eq(&adv->target_addr, BT_ADDR_LE_ANY)) { - peer = NULL; - } else { - peer = &adv->target_addr; - } - - err = bt_id_resolving_list_check_and_update(adv->id, peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index a6f7007f64b4..6cc950fe8e7f 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -23,4 +23,3 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable); int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv); void bt_adv_reset_adv_pool(void); -struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index e17277ba4da2..e4a390af20aa 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -497,28 +497,7 @@ struct bt_keys; void bt_id_add(struct bt_keys *keys); void bt_id_del(struct bt_keys *keys); -/** @brief Find a conflict in the resolving list for a candidate IRK. - * - * @param candidate The candidate keys to check for conflicts. - * @param all If true, check all IRKs, otherwise check only added keys. - * - * @return The conflicting key if there is one, or NULL if no conflict was found. - */ -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool all); - -/** * @brief Find multiple conflicts in the resolving list for a candidate IRK. - * - * This function iterates over all keys (added and not added to the Resolving List). If there are - * multiple conflicts, this function will return true. Otherwise, it will return false. - * - * If @c firt_conflict is not NULL, it will be set to the first found conflict. - * - * @param candidate The candidate key to check for conflicts. - * @param first_conflict Pointer to store the first found conflict, if any. Can be NULL. - * - * @return True if there are multiple conflicts, otherwise it returns false. - */ -bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict); +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate); int bt_setup_random_id_addr(void); int bt_setup_public_id_addr(void); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 4c54460ab4df..0ed84dff7331 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -941,33 +941,9 @@ void bt_id_pending_keys_update(void) } } -static bool keys_conflict_check(const struct bt_keys *candidate, const struct bt_keys *resident) -{ - bool addr_conflict; - bool irk_conflict; - - addr_conflict = bt_addr_le_eq(&candidate->addr, &resident->addr); - - /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ - irk_conflict = (!bt_irk_eq(&candidate->irk, &(struct bt_irk){}) && - bt_irk_eq(&candidate->irk, &resident->irk)); - - if (addr_conflict || irk_conflict) { - LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val))); - LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&candidate->addr), - bt_hex(candidate->irk.val, sizeof(candidate->irk.val))); - - return true; - } - - return false; -} - struct bt_id_conflict { struct bt_keys *candidate; struct bt_keys *found; - bool check_all_irk; }; /* The Controller Resolve List is constrained by 7.8.38 "LE Add Device To @@ -979,6 +955,8 @@ struct bt_id_conflict { static void find_rl_conflict(struct bt_keys *resident, void *user_data) { struct bt_id_conflict *conflict = user_data; + bool addr_conflict; + bool irk_conflict; __ASSERT_NO_MSG(conflict != NULL); __ASSERT_NO_MSG(conflict->candidate != NULL); @@ -991,26 +969,32 @@ static void find_rl_conflict(struct bt_keys *resident, void *user_data) } /* Test against committed bonds only. */ - if (!conflict->check_all_irk && (resident->state & BT_KEYS_ID_ADDED) == 0) { - /* If the resident bond is not committed, we cannot have a conflict. */ + if ((resident->state & BT_KEYS_ID_ADDED) == 0) { return; } - if (resident->id == conflict->candidate->id) { - /* If the IDs are the same, we cannot have a conflict. */ - return; - } + addr_conflict = bt_addr_le_eq(&conflict->candidate->addr, &resident->addr); + + /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ + irk_conflict = (!bt_irk_eq(&conflict->candidate->irk, &(struct bt_irk){}) && + bt_irk_eq(&conflict->candidate->irk, &resident->irk)); + + if (addr_conflict || irk_conflict) { + LOG_DBG("Resident : addr %s and IRK %s, id: %d", bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val)), resident->id); + LOG_DBG("Candidate: addr %s and IRK %s, id: %d", + bt_addr_le_str(&conflict->candidate->addr), + bt_hex(conflict->candidate->irk.val, sizeof(conflict->candidate->irk.val)), + conflict->candidate->id); - if (keys_conflict_check(conflict->candidate, resident)) { conflict->found = resident; } } -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_irk) +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) { struct bt_id_conflict conflict = { .candidate = candidate, - .check_all_irk = check_all_irk, }; bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict, &conflict); @@ -1018,59 +1002,6 @@ struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_ir return conflict.found; } -struct bt_id_conflict_multiple { - struct bt_keys *candidate; - struct bt_keys *found; - bool found_multiple; -}; - -void find_rl_conflict_multiple(struct bt_keys *resident, void *user_data) -{ - struct bt_id_conflict_multiple *conflict = user_data; - - __ASSERT_NO_MSG(conflict != NULL); - __ASSERT_NO_MSG(conflict->candidate != NULL); - __ASSERT_NO_MSG(resident != NULL); - - if (conflict->found_multiple) { - /* If we already found enough conflicts, we can stop searching. */ - return; - } - - if (resident->id == conflict->candidate->id) { - /* If the IDs are the same, we cannot have a conflict. */ - return; - } - - if (keys_conflict_check(conflict->candidate, resident)) { - if (conflict->found) { - conflict->found_multiple = true; - - LOG_WRN("Found multiple conflicts for %s: addr %s and IRK %s", - bt_addr_le_str(&conflict->candidate->addr), - bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val))); - } else { - conflict->found = resident; - } - } -} - -bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict) -{ - struct bt_id_conflict_multiple conflict = { - .candidate = candidate, - }; - - bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict_multiple, &conflict); - - if (first_conflict != NULL) { - *first_conflict = conflict.found; - } - - return conflict.found_multiple; -} - void bt_id_add(struct bt_keys *keys) { CHECKIF(keys == NULL) { @@ -1333,122 +1264,6 @@ void bt_id_del(struct bt_keys *keys) bt_le_ext_adv_foreach(adv_unpause_enabled, NULL); } } - -static int conflict_check_and_replace(uint8_t id, struct bt_keys *keys) -{ - /* For the given key check if it has conflicts with other keys in the Resolving List - * (such keys have BT_KEYS_ID_ADDED state and BT_KEYS_ID_CONFLICT flag set). If it does, we - * need to remove the conflicting key from the Resolving List and add the new key. - * - * If the key is not in the Resolving List, we can add the new key right away. - * - * If advertiser for the conflicting key is enabled, we cannot remove the key from the - * Resolving List, so we return an error. - */ - - struct bt_keys *conflict; - const struct bt_le_ext_adv *adv; - - if (!(keys->flags & BT_KEYS_ID_CONFLICT)) { - LOG_DBG("Key has no conflicts for id %u addr %s", id, bt_addr_le_str(&keys->addr)); - return 0; - } - - if (keys->state & BT_KEYS_ID_ADDED) { - LOG_DBG("Key is already added to resolving list for id %u addr %s", id, - bt_addr_le_str(&keys->addr)); - return 0; - } - - /* bt_id_find_conflict returns only keys added to the Resolving List (state is - * BT_KEYS_ID_ADDED). If the key has conflict, but no keys were added (for example, if the - * last added key was removed after bt_unpair()), then this function will return NULL. Then, - * we don't need to remove a conflicting key from the Resolving List. Otherwise, we need to - * remove the conflicting key from the Resolving List before adding the new key. - */ - conflict = bt_id_find_conflict(keys, false); - if (conflict != NULL) { - __ASSERT_NO_MSG((conflict->flags & BT_KEYS_ID_CONFLICT) != 0); - - LOG_DBG("Found conflicting key with id %u addr %s", conflict->id, - bt_addr_le_str(&conflict->addr)); - - adv = bt_adv_lookup_by_id(conflict->id); - if (adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { - LOG_WRN("Cannot remove the conflicting key from the Resolving List while" - " advertising"); - return -EPERM; - } - - /* Drop BT_KEYS_ID_PENDING_DEL flag if we were about to delete the keys since we - * delete it here. - */ - conflict->state &= ~BT_KEYS_ID_PENDING_DEL; - bt_id_del(conflict); - } - - bt_id_add(keys); - - return 0; -} - -struct bt_id_resolve { - uint8_t id; - int err; -}; - -static void check_and_add_keys_for_id(struct bt_keys *keys, void *data) -{ - struct bt_id_resolve *resolve = data; - - if (resolve->err) { - /* Skipping other keys because we got error. */ - return; - } - - if (resolve->id != keys->id) { - /* We are only interested in keys for the given id */ - return; - } - - resolve->err = conflict_check_and_replace(resolve->id, keys); -} - -int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer) -{ - int err; - - if (peer == NULL) { - struct bt_id_resolve resolve = { - .id = id, - }; - - LOG_DBG("Updating resolving list for id %u without peer address", id); - - bt_keys_foreach_type(BT_KEYS_IRK, check_and_add_keys_for_id, &resolve); - err = resolve.err; - } else { - struct bt_keys *keys; - - LOG_DBG("Updating resolving list for id %u addr %s", id, bt_addr_le_str(peer)); - - keys = bt_keys_get_addr(id, peer); - if (!keys) { - LOG_DBG("No keys found for id %u addr %s", id, bt_addr_le_str(peer)); - return -ENOENT; - } - - err = conflict_check_and_replace(id, keys); - } - - if (err) { - LOG_ERR("Failed to update resolving list for id %u addr %s (err %d)", id, - peer ? bt_addr_le_str(peer) : "NULL", err); - return err; - } - - return err; -} #endif /* defined(CONFIG_BT_SMP) */ void bt_id_get(bt_addr_le_t *addrs, size_t *count) diff --git a/subsys/bluetooth/host/id.h b/subsys/bluetooth/host/id.h index cd66784a5037..8824d3bb496b 100644 --- a/subsys/bluetooth/host/id.h +++ b/subsys/bluetooth/host/id.h @@ -60,26 +60,3 @@ void bt_id_pending_keys_update(void); void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag); void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv); - -/** - * @brief Check and update the resolving list for a given identity. - * - * This function checks if the resolving list contains the keys for the given - * identity and peer address. If the keys are not present, it adds them to the - * resolving list. If the keys are present, it checks for conflicts with - * existing keys in the resolving list. If a conflict is found, it replaces - * the conflicting key with the new key. - * - * If the peer address is NULL, it updates the resolving list for all keys that belong to the given - * identity. - * - * If for any of the keys belonging to the given identity a conflict is found and the advertiser for - * that key is enabled, the function returns an error. - * - * @param id The identity ID to check and update. - * @param peer The peer address to check against the resolving list. - * - * @return 0 on success, or a negative error code on failure. - * @return -EPERM if a conflict is found and the advertiser for the conflicting key is enabled. - */ -int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer); diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index e2116f3bedeb..1205494e856f 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -310,57 +310,16 @@ void bt_keys_add_type(struct bt_keys *keys, enum bt_keys_type type) keys->keys |= type; } -static void add_id_cb(struct k_work *work) -{ - bt_id_pending_keys_update(); -} - -static K_WORK_DEFINE(add_id_work, add_id_cb); - void bt_keys_clear(struct bt_keys *keys) { - struct bt_keys *conflict = NULL; - __ASSERT_NO_MSG(keys != NULL); LOG_DBG("%s (keys 0x%04x)", bt_addr_le_str(&keys->addr), keys->keys); - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && - (keys->flags & BT_KEYS_ID_CONFLICT) != 0) { - /* We need to check how many conflicting keys left. If there is only one conflicting - * key left, we can remove the BT_KEYS_ID_CONFLICT flag from it so that Host don't - * need to check and update the Resolving List whenever this is needed. The key - * should be re-added to the Resolving List. - */ - bool found_multiple; - - found_multiple = bt_id_find_conflict_multiple(keys, &conflict); - if (conflict) { - if (found_multiple || (conflict->state & BT_KEYS_ID_ADDED) != 0) { - /* If we found multiple conflicting keys or the conflicting key - * is already added to the ID list, we don't need to clear the - * conflict flag for it and re-add it to the Resolving List. - */ - conflict = NULL; - } else { - /* Clear the conflict flag for the conflicting key */ - conflict->flags &= ~BT_KEYS_ID_CONFLICT; - } - } - } - if (keys->state & BT_KEYS_ID_ADDED) { bt_id_del(keys); } - if (conflict) { - /* Re-add the conflicting key to the Resolving List if it was the last conflicting - * key. - */ - bt_id_pending_keys_update_set(conflict, BT_KEYS_ID_PENDING_ADD); - k_work_submit(&add_id_work); - } - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { /* Delete stored keys from flash */ bt_settings_delete_keys(keys->id, &keys->addr); @@ -388,28 +347,6 @@ int bt_keys_store(struct bt_keys *keys) return 0; } -static void check_and_set_id_conflict_flag(struct bt_keys *keys) -{ - struct bt_keys *conflict; - - if (!IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - /* If auto-swap is not enabled, we don't need to check for conflicts */ - return; - } - - /* Use bt_id_find_conflict() to check if there are any conflicting keys for the given keys. - * If there is at least one, set the BT_KEYS_ID_CONFLICT flag for both the keys and the - * conflicting key. - */ - conflict = bt_id_find_conflict(keys, true); - if (conflict != NULL) { - LOG_DBG("Found conflicting key %p.", conflict); - - keys->flags |= BT_KEYS_ID_CONFLICT; - conflict->flags |= BT_KEYS_ID_CONFLICT; - } -} - static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { @@ -490,8 +427,6 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, memcpy(keys->storage_start, val, len); } - check_and_set_id_conflict_flag(keys); - LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { @@ -501,17 +436,17 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return 0; } +static void add_id_cb(struct k_work *work) +{ + bt_id_pending_keys_update(); +} + +static K_WORK_DEFINE(add_id_work, add_id_cb); + static void id_add(struct bt_keys *keys, void *user_data) { __ASSERT_NO_MSG(keys != NULL); - if (keys->flags & BT_KEYS_ID_CONFLICT) { - /* If the keys have the conflict flag set, we don't want to add them to the ID list, - * as this will cause issues with resolving list. - */ - return; - } - bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD); k_work_submit(&add_id_work); } diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index 90c0c92e9de0..ab83aff8ebf0 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -45,12 +45,6 @@ enum { /* Bit 2 and 3 might accidentally exist in old stored keys */ BT_KEYS_SC = BIT(4), BT_KEYS_OOB = BIT(5), - /** Indicates that the keys are in conflict with existing keys. - * - * This is used to indicate that the keys being added conflict with - * existing keys from different identity. - */ - BT_KEYS_ID_CONFLICT = BIT(6), }; struct bt_ltk { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 1e28a4e0c84f..b935c61d2a36 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -921,7 +921,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) bt_id_del(keys); } - conflict = bt_id_find_conflict(keys, false); + conflict = bt_id_find_conflict(keys); if (conflict != NULL) { int err; @@ -931,7 +931,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) __ASSERT_NO_MSG(!err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(keys, false)); + __ASSERT_NO_MSG(!bt_id_find_conflict(keys)); bt_id_add(keys); } @@ -4129,24 +4129,16 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) */ __ASSERT_NO_MSG(!(smp->remote_dist & BT_SMP_DIST_ID_KEY)); - conflict = bt_id_find_conflict(new_bond, IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)); + conflict = bt_id_find_conflict(new_bond); if (conflict) { LOG_DBG("New bond conflicts with a bond on id %d.", conflict->id); } - if (conflict && !IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && - !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { + if (conflict && !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { LOG_WRN("Refusing new pairing. The old bond must be unpaired first."); return BT_SMP_ERR_AUTH_REQUIREMENTS; } - if (conflict && IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - LOG_WRN("Conflict detected with %p. Don't add key to Resolve List.", conflict); - new_bond->flags |= BT_KEYS_ID_CONFLICT; - conflict->flags |= BT_KEYS_ID_CONFLICT; - return 0; - } - if (conflict && IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { bool trust_ok; int unpair_err; @@ -4163,7 +4155,7 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) __ASSERT_NO_MSG(!unpair_err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond, false)); + __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond)); bt_id_add(new_bond); return 0; } diff --git a/tests/bluetooth/host/id/mocks/adv.c b/tests/bluetooth/host/id/mocks/adv.c index a22123dea3da..2c2d4f3f3c7a 100644 --- a/tests/bluetooth/host/id/mocks/adv.c +++ b/tests/bluetooth/host/id/mocks/adv.c @@ -15,4 +15,3 @@ DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv *, DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DEFINE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); -DEFINE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/adv.h b/tests/bluetooth/host/id/mocks/adv.h index 1602ddf47185..bfb744001596 100644 --- a/tests/bluetooth/host/id/mocks/adv.h +++ b/tests/bluetooth/host/id/mocks/adv.h @@ -18,8 +18,7 @@ typedef void (*bt_le_ext_adv_foreach_cb)(struct bt_le_ext_adv *adv, void *data); FAKE(bt_le_adv_lookup_legacy) \ FAKE(bt_le_ext_adv_get_index) \ FAKE(bt_le_adv_set_enable_ext) \ - FAKE(bt_le_ext_adv_foreach) \ - FAKE(bt_adv_lookup_by_id) + FAKE(bt_le_ext_adv_foreach) DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable, struct bt_le_ext_adv *, bool); DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_le_adv_lookup_legacy); @@ -28,4 +27,3 @@ DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv * DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DECLARE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); -DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/keys.c b/tests/bluetooth/host/id/mocks/keys.c index 61f73569c469..f885ab875c0f 100644 --- a/tests/bluetooth/host/id/mocks/keys.c +++ b/tests/bluetooth/host/id/mocks/keys.c @@ -10,4 +10,3 @@ DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DEFINE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); -DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); diff --git a/tests/bluetooth/host/id/mocks/keys.h b/tests/bluetooth/host/id/mocks/keys.h index 1912472b78de..b6901e315ab9 100644 --- a/tests/bluetooth/host/id/mocks/keys.h +++ b/tests/bluetooth/host/id/mocks/keys.h @@ -15,9 +15,7 @@ typedef void (*bt_keys_foreach_type_cb)(struct bt_keys *keys, void *data); /* List of fakes used by this unit tester */ #define KEYS_FFF_FAKES_LIST(FAKE) \ FAKE(bt_keys_find_irk) \ - FAKE(bt_keys_foreach_type) \ - FAKE(bt_keys_get_addr) + FAKE(bt_keys_foreach_type) DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DECLARE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); -DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); From ec3c2845820e9d3ed864a493c4afae5136020c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Tue, 18 Nov 2025 12:15:16 +0100 Subject: [PATCH 0546/3334] [nrf fromtree] Bluetooth: Host: Legacy passkey entry 6.2 update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As of Core v6.2, the passkey entry pairing method for legacy pairing does no longer grant authenticated MITM protection. This commit updates `smp.c` accordingly to not grant the authenticated states when using legacy passkey entry pairing. Adds a check to make sure that bonds that have been stored persistently adheres to these changes. Bonds that have been generated using the legacy passkey entry pairing method will thus be downgraded from authenticated to unauthenticated when restored from storage. Signed-off-by: Håvard Reierstad (cherry picked from commit 627b6e4dd72bf4481fa8ff7dfee8dbf38e5e934b) Signed-off-by: Håvard Reierstad --- doc/releases/migration-guide-4.4.rst | 4 ++++ subsys/bluetooth/host/keys.c | 12 ++++++++++++ subsys/bluetooth/host/smp.c | 25 +++++++++++++++++-------- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 554607e5f857..762082635b1c 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -43,6 +43,10 @@ Bluetooth Host * :c:member:`bt_conn_le_info.interval` has been deprecated. Use :c:member:`bt_conn_le_info.interval_us` instead. Note that the units have changed: ``interval`` was in units of 1.25 milliseconds, while ``interval_us`` is in microseconds. +* Legacy Bluetooth LE pairing using the passkey entry method no longer grants authenticated (MITM) + protection as of the Bluetooth Core Specification v6.2. Stored bonds that were generated using + this method will be downgraded to unauthenticated when loaded from persistent storage, resulting + in a lower security level. Networking ********** diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 1205494e856f..0ab157599408 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -427,6 +427,18 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, memcpy(keys->storage_start, val, len); } + /* As of Core v6.2, authenticated keys are only valid for OOB or LE SC pairing + * methods. This check ensures that keys are valid if a device is updated from a + * previous version that did not enforce this requirement. + */ + if ((keys->flags & BT_KEYS_AUTHENTICATED) && + !((keys->flags & BT_KEYS_OOB) || (keys->flags & BT_KEYS_SC))) { + LOG_WRN("The keys for %s are downgraded to unauthenticated as they no longer meet " + "authentication requirements", + bt_addr_le_str(&addr)); + keys->flags &= ~BT_KEYS_AUTHENTICATED; + } + LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index b935c61d2a36..94e38d766897 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -666,7 +666,9 @@ static bool update_keys_check(struct bt_smp *smp, struct bt_keys *keys) } if ((keys->flags & BT_KEYS_AUTHENTICATED) && - smp->method == JUST_WORKS) { + ((smp->method == JUST_WORKS) || + (!atomic_test_bit(smp->flags, SMP_FLAG_SC) && + (smp->method == PASSKEY_DISPLAY || smp->method == PASSKEY_INPUT)))) { return false; } @@ -2491,11 +2493,12 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) * Fail if we have keys that are stronger than keys that will be * distributed in new pairing. This is to avoid replacing authenticated * keys with unauthenticated ones. - */ + */ keys = bt_keys_find_addr(conn->id, &conn->le.dst); if (keys && (keys->flags & BT_KEYS_AUTHENTICATED) && - smp->method == JUST_WORKS) { - LOG_ERR("JustWorks failed, authenticated keys present"); + (smp->method == JUST_WORKS || smp->method == PASSKEY_DISPLAY || + smp->method == PASSKEY_INPUT)) { + LOG_ERR("Pairing failed, authenticated keys present"); return BT_SMP_ERR_UNSPECIFIED; } @@ -2983,7 +2986,9 @@ static uint8_t remote_sec_level_reachable(struct bt_smp *smp) } __fallthrough; case BT_SECURITY_L3: - if (smp->method == JUST_WORKS) { + if (smp->method == JUST_WORKS || + (!atomic_test_bit(smp->flags, SMP_FLAG_SC) && + (smp->method == PASSKEY_DISPLAY || smp->method == PASSKEY_INPUT))) { return BT_SMP_ERR_AUTH_REQUIREMENTS; } @@ -6319,12 +6324,16 @@ void bt_smp_update_keys(struct bt_conn *conn) case LE_SC_OOB: case LEGACY_OOB: conn->le.keys->flags |= BT_KEYS_OOB; - /* fallthrough */ + conn->le.keys->flags |= BT_KEYS_AUTHENTICATED; + break; case PASSKEY_DISPLAY: case PASSKEY_INPUT: case PASSKEY_CONFIRM: - conn->le.keys->flags |= BT_KEYS_AUTHENTICATED; - break; + if (atomic_test_bit(smp->flags, SMP_FLAG_SC)) { + conn->le.keys->flags |= BT_KEYS_AUTHENTICATED; + break; + } + /* fallthrough */ case JUST_WORKS: default: /* unauthenticated key, clear it */ From e4c1b245a2babc9e1792d9be86536f03f3fb7126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Thu, 20 Nov 2025 14:00:45 +0100 Subject: [PATCH 0547/3334] [nrf fromtree] Bluetooth: Host: Add legacy pairing test config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the `CONFIG_BT_SMP_LEGACY_PAIR_ONLY` Kconfig option to force devices to use legacy pairing. This has a dependency on `CONFIG_BT_TESTING` as it is only intended for testing purposes, and use of legacy pairing is discouraged. Signed-off-by: Håvard Reierstad (cherry picked from commit 6bb0e982ad5452101b7b7cd34d152fd60c59e74f) Signed-off-by: Håvard Reierstad --- subsys/bluetooth/host/Kconfig | 9 +++++++++ subsys/bluetooth/host/smp.c | 11 ++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 8920d41d0e07..7306cde7328f 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -1120,6 +1120,15 @@ config BT_CONN_DISABLE_SECURITY WARNING: This option enables anyone to snoop on-air traffic. Use of this feature in production is strongly discouraged. +config BT_SMP_LEGACY_PAIR_ONLY + bool "Force legacy pairing" + depends on BT_TESTING + depends on !(BT_SMP_SC_PAIR_ONLY || BT_SMP_SC_ONLY) + help + This option enforces legacy pairing. This is required for testing + legacy pairing between two Zephyr Bluetooth devices, as without this + option the devices will default to using Secure Connections pairing. + rsource "./classic/Kconfig" config BT_HCI_VS_EVT_USER diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 94e38d766897..1a5592d1d6c2 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -92,21 +92,21 @@ LOG_MODULE_REGISTER(bt_smp); #if defined(CONFIG_BT_CLASSIC) #define BT_SMP_AUTH_MASK_SC 0x2f -#if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) +#if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) || defined(CONFIG_BT_SMP_LEGACY_PAIR_ONLY) #define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_CT2) #else #define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_CT2 |\ BT_SMP_AUTH_SC) -#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ +#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY || CONFIG_BT_SMP_LEGACY_PAIR_ONLY */ #else #define BT_SMP_AUTH_MASK_SC 0x0f -#if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) +#if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) || defined(CONFIG_BT_SMP_LEGACY_PAIR_ONLY) #define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS) #else #define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_SC) -#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ +#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY || CONFIG_BT_SMP_LEGACY_PAIR_ONLY */ #endif /* CONFIG_BT_CLASSIC */ @@ -321,7 +321,8 @@ static struct { static bool le_sc_supported(void) { - if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY)) { + if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) || + IS_ENABLED(CONFIG_BT_SMP_LEGACY_PAIR_ONLY)) { return false; } From 71ebd2b14110f5d9fa3cd23873df0d25c276611b Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 10 Jun 2025 23:20:32 +0200 Subject: [PATCH 0548/3334] [nrf noup] bluetooth: host: Add support for bonding with same peer This commit adds a new Kconfig option by enabling which Host will keep bonding with the same Central instead of rejecting pairing. Brief implementation details: This implementation adds a new flag to bt_keys struct: BT_KEYS_ID_CONFLICT. The flag is set, when: - bonding with the same peer and conflict identified - when loading conflicting keys from persistent storage. When bonding and conflict is identified, the new keys aren't added to the Resolving List immediately. Instead, the old keys stay in the Resolving List. When start advertising, Host finds conflicting keys that are already added to the Resolving List and substitues them. If, however, there is another advertiser already started for the added keys, the new request is reject and advertising start function returns -EPERM. This is supported by Peripheral role only for now. Allow to use CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS Kconfig option even if CONFIG_BT_PRIVACY is disabled. This is because CONFIG_BT_PRIVACY configures privacy of local device will still allows to resolve peer address. During pairing, peer device may send its Identity Address and IRK which then can be used for address resolution. This doesn't require CONFIG_BT_PRIVACY be enabled. Signed-off-by: Pavel Vasilyev (cherry picked from commit 8e030eadc7edc6b92ea0812b4ba85943b361765c) (cherry picked from commit 72becd444df29326d03f7374c21f0e73e3641ac1) (cherry picked from commit 4994883cb4f5b53f64c5909798a5dfd6ee79e376) --- include/zephyr/bluetooth/bluetooth.h | 10 ++ subsys/bluetooth/host/Kconfig | 18 +++ subsys/bluetooth/host/adv.c | 52 +++++++ subsys/bluetooth/host/adv.h | 1 + subsys/bluetooth/host/hci_core.h | 23 ++- subsys/bluetooth/host/id.c | 219 ++++++++++++++++++++++++--- subsys/bluetooth/host/id.h | 23 +++ subsys/bluetooth/host/keys.c | 79 +++++++++- subsys/bluetooth/host/keys.h | 6 + subsys/bluetooth/host/smp.c | 18 ++- tests/bluetooth/host/id/mocks/adv.c | 1 + tests/bluetooth/host/id/mocks/adv.h | 4 +- tests/bluetooth/host/id/mocks/keys.c | 1 + tests/bluetooth/host/id/mocks/keys.h | 4 +- 14 files changed, 427 insertions(+), 32 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 8e738d21970d..0739733c9543 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1295,6 +1295,10 @@ struct bt_le_per_adv_param { * This error code is only guaranteed when using Zephyr * controller, for other controllers code returned in * this case may be -EIO. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_adv_start(const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, @@ -1422,6 +1426,12 @@ struct bt_le_ext_adv_start_param { * * @param adv Advertising set object. * @param param Advertise start parameters. + * + * @return Zero on success or (negative) error code otherwise. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, const struct bt_le_ext_adv_start_param *param); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 7306cde7328f..e4a381e9b05a 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -659,6 +659,24 @@ config BT_ID_UNPAIR_MATCHING_BONDS link-layer. The Host does not have control over this acknowledgment, and the order of distribution is fixed by the specification. +config BT_ID_AUTO_SWAP_MATCHING_BONDS + bool "Automatically swap conflicting entries in the Resolving List" + depends on !BT_ID_UNPAIR_MATCHING_BONDS + depends on BT_SMP && BT_PERIPHERAL && !BT_CENTRAL + help + If this option is enabled, the Host will not add a new bond with + the same peer address (or IRK) to the Resolving List if there is + already a bond with the same peer address (or IRK) on another local + identity. + + In case of Peripheral, the Host will swap the existing entry in the + Resolving List with the new one, so that the new bond will be used for + address resolution for the new local identity if the device starts + advertising with the new local identity. + + Important: this option is supported exclusively in the Peripheral + role. Excluding the Central role. + config BT_ID_ALLOW_UNAUTH_OVERWRITE bool "Allow unauthenticated pairing with same peer with other local identity" depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index e4ad43bea565..3a17a7192535 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -234,6 +234,25 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) #endif /* CONFIG_BT_BROADCASTER */ #endif /* defined(CONFIG_BT_EXT_ADV) */ +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id) +{ +#if defined(CONFIG_BT_EXT_ADV) + for (size_t i = 0; i < ARRAY_SIZE(adv_pool); i++) { + if (atomic_test_bit(adv_pool[i].flags, BT_ADV_CREATED) && + adv_pool[i].id == id) { + return &adv_pool[i]; + } + } +#else + if (atomic_test_bit(bt_dev.adv.flags, BT_ADV_CREATED) && bt_dev.adv.id == id) { + return &bt_dev.adv; + } +#endif + + return NULL; +} + + void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), void *data) { @@ -929,6 +948,14 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, adv->id = param->id; bt_dev.adv_conn_id = adv->id; + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = bt_id_set_adv_own_addr(adv, param->options, dir_adv, &set_param.own_addr_type); if (err) { @@ -1212,6 +1239,15 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } adv->id = param->id; + + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = le_ext_adv_param_set(adv, param, sd != NULL); if (err) { return err; @@ -1499,6 +1535,22 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, return -EALREADY; } + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + const bt_addr_le_t *peer; + + if (bt_addr_le_eq(&adv->target_addr, BT_ADDR_LE_ANY)) { + peer = NULL; + } else { + peer = &adv->target_addr; + } + + err = bt_id_resolving_list_check_and_update(adv->id, peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index 6cc950fe8e7f..a6f7007f64b4 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -23,3 +23,4 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable); int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv); void bt_adv_reset_adv_pool(void); +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index e4a390af20aa..e17277ba4da2 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -497,7 +497,28 @@ struct bt_keys; void bt_id_add(struct bt_keys *keys); void bt_id_del(struct bt_keys *keys); -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate); +/** @brief Find a conflict in the resolving list for a candidate IRK. + * + * @param candidate The candidate keys to check for conflicts. + * @param all If true, check all IRKs, otherwise check only added keys. + * + * @return The conflicting key if there is one, or NULL if no conflict was found. + */ +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool all); + +/** * @brief Find multiple conflicts in the resolving list for a candidate IRK. + * + * This function iterates over all keys (added and not added to the Resolving List). If there are + * multiple conflicts, this function will return true. Otherwise, it will return false. + * + * If @c firt_conflict is not NULL, it will be set to the first found conflict. + * + * @param candidate The candidate key to check for conflicts. + * @param first_conflict Pointer to store the first found conflict, if any. Can be NULL. + * + * @return True if there are multiple conflicts, otherwise it returns false. + */ +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict); int bt_setup_random_id_addr(void); int bt_setup_public_id_addr(void); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 0ed84dff7331..4c54460ab4df 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -941,9 +941,33 @@ void bt_id_pending_keys_update(void) } } +static bool keys_conflict_check(const struct bt_keys *candidate, const struct bt_keys *resident) +{ + bool addr_conflict; + bool irk_conflict; + + addr_conflict = bt_addr_le_eq(&candidate->addr, &resident->addr); + + /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ + irk_conflict = (!bt_irk_eq(&candidate->irk, &(struct bt_irk){}) && + bt_irk_eq(&candidate->irk, &resident->irk)); + + if (addr_conflict || irk_conflict) { + LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&candidate->addr), + bt_hex(candidate->irk.val, sizeof(candidate->irk.val))); + + return true; + } + + return false; +} + struct bt_id_conflict { struct bt_keys *candidate; struct bt_keys *found; + bool check_all_irk; }; /* The Controller Resolve List is constrained by 7.8.38 "LE Add Device To @@ -955,8 +979,6 @@ struct bt_id_conflict { static void find_rl_conflict(struct bt_keys *resident, void *user_data) { struct bt_id_conflict *conflict = user_data; - bool addr_conflict; - bool irk_conflict; __ASSERT_NO_MSG(conflict != NULL); __ASSERT_NO_MSG(conflict->candidate != NULL); @@ -969,32 +991,26 @@ static void find_rl_conflict(struct bt_keys *resident, void *user_data) } /* Test against committed bonds only. */ - if ((resident->state & BT_KEYS_ID_ADDED) == 0) { + if (!conflict->check_all_irk && (resident->state & BT_KEYS_ID_ADDED) == 0) { + /* If the resident bond is not committed, we cannot have a conflict. */ return; } - addr_conflict = bt_addr_le_eq(&conflict->candidate->addr, &resident->addr); - - /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ - irk_conflict = (!bt_irk_eq(&conflict->candidate->irk, &(struct bt_irk){}) && - bt_irk_eq(&conflict->candidate->irk, &resident->irk)); - - if (addr_conflict || irk_conflict) { - LOG_DBG("Resident : addr %s and IRK %s, id: %d", bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val)), resident->id); - LOG_DBG("Candidate: addr %s and IRK %s, id: %d", - bt_addr_le_str(&conflict->candidate->addr), - bt_hex(conflict->candidate->irk.val, sizeof(conflict->candidate->irk.val)), - conflict->candidate->id); + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + if (keys_conflict_check(conflict->candidate, resident)) { conflict->found = resident; } } -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_irk) { struct bt_id_conflict conflict = { .candidate = candidate, + .check_all_irk = check_all_irk, }; bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict, &conflict); @@ -1002,6 +1018,59 @@ struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) return conflict.found; } +struct bt_id_conflict_multiple { + struct bt_keys *candidate; + struct bt_keys *found; + bool found_multiple; +}; + +void find_rl_conflict_multiple(struct bt_keys *resident, void *user_data) +{ + struct bt_id_conflict_multiple *conflict = user_data; + + __ASSERT_NO_MSG(conflict != NULL); + __ASSERT_NO_MSG(conflict->candidate != NULL); + __ASSERT_NO_MSG(resident != NULL); + + if (conflict->found_multiple) { + /* If we already found enough conflicts, we can stop searching. */ + return; + } + + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + + if (keys_conflict_check(conflict->candidate, resident)) { + if (conflict->found) { + conflict->found_multiple = true; + + LOG_WRN("Found multiple conflicts for %s: addr %s and IRK %s", + bt_addr_le_str(&conflict->candidate->addr), + bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + } else { + conflict->found = resident; + } + } +} + +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict) +{ + struct bt_id_conflict_multiple conflict = { + .candidate = candidate, + }; + + bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict_multiple, &conflict); + + if (first_conflict != NULL) { + *first_conflict = conflict.found; + } + + return conflict.found_multiple; +} + void bt_id_add(struct bt_keys *keys) { CHECKIF(keys == NULL) { @@ -1264,6 +1333,122 @@ void bt_id_del(struct bt_keys *keys) bt_le_ext_adv_foreach(adv_unpause_enabled, NULL); } } + +static int conflict_check_and_replace(uint8_t id, struct bt_keys *keys) +{ + /* For the given key check if it has conflicts with other keys in the Resolving List + * (such keys have BT_KEYS_ID_ADDED state and BT_KEYS_ID_CONFLICT flag set). If it does, we + * need to remove the conflicting key from the Resolving List and add the new key. + * + * If the key is not in the Resolving List, we can add the new key right away. + * + * If advertiser for the conflicting key is enabled, we cannot remove the key from the + * Resolving List, so we return an error. + */ + + struct bt_keys *conflict; + const struct bt_le_ext_adv *adv; + + if (!(keys->flags & BT_KEYS_ID_CONFLICT)) { + LOG_DBG("Key has no conflicts for id %u addr %s", id, bt_addr_le_str(&keys->addr)); + return 0; + } + + if (keys->state & BT_KEYS_ID_ADDED) { + LOG_DBG("Key is already added to resolving list for id %u addr %s", id, + bt_addr_le_str(&keys->addr)); + return 0; + } + + /* bt_id_find_conflict returns only keys added to the Resolving List (state is + * BT_KEYS_ID_ADDED). If the key has conflict, but no keys were added (for example, if the + * last added key was removed after bt_unpair()), then this function will return NULL. Then, + * we don't need to remove a conflicting key from the Resolving List. Otherwise, we need to + * remove the conflicting key from the Resolving List before adding the new key. + */ + conflict = bt_id_find_conflict(keys, false); + if (conflict != NULL) { + __ASSERT_NO_MSG((conflict->flags & BT_KEYS_ID_CONFLICT) != 0); + + LOG_DBG("Found conflicting key with id %u addr %s", conflict->id, + bt_addr_le_str(&conflict->addr)); + + adv = bt_adv_lookup_by_id(conflict->id); + if (adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { + LOG_WRN("Cannot remove the conflicting key from the Resolving List while" + " advertising"); + return -EPERM; + } + + /* Drop BT_KEYS_ID_PENDING_DEL flag if we were about to delete the keys since we + * delete it here. + */ + conflict->state &= ~BT_KEYS_ID_PENDING_DEL; + bt_id_del(conflict); + } + + bt_id_add(keys); + + return 0; +} + +struct bt_id_resolve { + uint8_t id; + int err; +}; + +static void check_and_add_keys_for_id(struct bt_keys *keys, void *data) +{ + struct bt_id_resolve *resolve = data; + + if (resolve->err) { + /* Skipping other keys because we got error. */ + return; + } + + if (resolve->id != keys->id) { + /* We are only interested in keys for the given id */ + return; + } + + resolve->err = conflict_check_and_replace(resolve->id, keys); +} + +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer) +{ + int err; + + if (peer == NULL) { + struct bt_id_resolve resolve = { + .id = id, + }; + + LOG_DBG("Updating resolving list for id %u without peer address", id); + + bt_keys_foreach_type(BT_KEYS_IRK, check_and_add_keys_for_id, &resolve); + err = resolve.err; + } else { + struct bt_keys *keys; + + LOG_DBG("Updating resolving list for id %u addr %s", id, bt_addr_le_str(peer)); + + keys = bt_keys_get_addr(id, peer); + if (!keys) { + LOG_DBG("No keys found for id %u addr %s", id, bt_addr_le_str(peer)); + return -ENOENT; + } + + err = conflict_check_and_replace(id, keys); + } + + if (err) { + LOG_ERR("Failed to update resolving list for id %u addr %s (err %d)", id, + peer ? bt_addr_le_str(peer) : "NULL", err); + return err; + } + + return err; +} #endif /* defined(CONFIG_BT_SMP) */ void bt_id_get(bt_addr_le_t *addrs, size_t *count) diff --git a/subsys/bluetooth/host/id.h b/subsys/bluetooth/host/id.h index 8824d3bb496b..cd66784a5037 100644 --- a/subsys/bluetooth/host/id.h +++ b/subsys/bluetooth/host/id.h @@ -60,3 +60,26 @@ void bt_id_pending_keys_update(void); void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag); void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv); + +/** + * @brief Check and update the resolving list for a given identity. + * + * This function checks if the resolving list contains the keys for the given + * identity and peer address. If the keys are not present, it adds them to the + * resolving list. If the keys are present, it checks for conflicts with + * existing keys in the resolving list. If a conflict is found, it replaces + * the conflicting key with the new key. + * + * If the peer address is NULL, it updates the resolving list for all keys that belong to the given + * identity. + * + * If for any of the keys belonging to the given identity a conflict is found and the advertiser for + * that key is enabled, the function returns an error. + * + * @param id The identity ID to check and update. + * @param peer The peer address to check against the resolving list. + * + * @return 0 on success, or a negative error code on failure. + * @return -EPERM if a conflict is found and the advertiser for the conflicting key is enabled. + */ +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer); diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 0ab157599408..4707a2e0fe23 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -310,16 +310,57 @@ void bt_keys_add_type(struct bt_keys *keys, enum bt_keys_type type) keys->keys |= type; } +static void add_id_cb(struct k_work *work) +{ + bt_id_pending_keys_update(); +} + +static K_WORK_DEFINE(add_id_work, add_id_cb); + void bt_keys_clear(struct bt_keys *keys) { + struct bt_keys *conflict = NULL; + __ASSERT_NO_MSG(keys != NULL); LOG_DBG("%s (keys 0x%04x)", bt_addr_le_str(&keys->addr), keys->keys); + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + (keys->flags & BT_KEYS_ID_CONFLICT) != 0) { + /* We need to check how many conflicting keys left. If there is only one conflicting + * key left, we can remove the BT_KEYS_ID_CONFLICT flag from it so that Host don't + * need to check and update the Resolving List whenever this is needed. The key + * should be re-added to the Resolving List. + */ + bool found_multiple; + + found_multiple = bt_id_find_conflict_multiple(keys, &conflict); + if (conflict) { + if (found_multiple || (conflict->state & BT_KEYS_ID_ADDED) != 0) { + /* If we found multiple conflicting keys or the conflicting key + * is already added to the ID list, we don't need to clear the + * conflict flag for it and re-add it to the Resolving List. + */ + conflict = NULL; + } else { + /* Clear the conflict flag for the conflicting key */ + conflict->flags &= ~BT_KEYS_ID_CONFLICT; + } + } + } + if (keys->state & BT_KEYS_ID_ADDED) { bt_id_del(keys); } + if (conflict) { + /* Re-add the conflicting key to the Resolving List if it was the last conflicting + * key. + */ + bt_id_pending_keys_update_set(conflict, BT_KEYS_ID_PENDING_ADD); + k_work_submit(&add_id_work); + } + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { /* Delete stored keys from flash */ bt_settings_delete_keys(keys->id, &keys->addr); @@ -347,6 +388,28 @@ int bt_keys_store(struct bt_keys *keys) return 0; } +static void check_and_set_id_conflict_flag(struct bt_keys *keys) +{ + struct bt_keys *conflict; + + if (!IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + /* If auto-swap is not enabled, we don't need to check for conflicts */ + return; + } + + /* Use bt_id_find_conflict() to check if there are any conflicting keys for the given keys. + * If there is at least one, set the BT_KEYS_ID_CONFLICT flag for both the keys and the + * conflicting key. + */ + conflict = bt_id_find_conflict(keys, true); + if (conflict != NULL) { + LOG_DBG("Found conflicting key %p.", conflict); + + keys->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + } +} + static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { @@ -439,6 +502,8 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, keys->flags &= ~BT_KEYS_AUTHENTICATED; } + check_and_set_id_conflict_flag(keys); + LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { @@ -448,17 +513,17 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return 0; } -static void add_id_cb(struct k_work *work) -{ - bt_id_pending_keys_update(); -} - -static K_WORK_DEFINE(add_id_work, add_id_cb); - static void id_add(struct bt_keys *keys, void *user_data) { __ASSERT_NO_MSG(keys != NULL); + if (keys->flags & BT_KEYS_ID_CONFLICT) { + /* If the keys have the conflict flag set, we don't want to add them to the ID list, + * as this will cause issues with resolving list. + */ + return; + } + bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD); k_work_submit(&add_id_work); } diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index ab83aff8ebf0..90c0c92e9de0 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -45,6 +45,12 @@ enum { /* Bit 2 and 3 might accidentally exist in old stored keys */ BT_KEYS_SC = BIT(4), BT_KEYS_OOB = BIT(5), + /** Indicates that the keys are in conflict with existing keys. + * + * This is used to indicate that the keys being added conflict with + * existing keys from different identity. + */ + BT_KEYS_ID_CONFLICT = BIT(6), }; struct bt_ltk { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 1a5592d1d6c2..11fa7a4361f3 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -924,7 +924,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) bt_id_del(keys); } - conflict = bt_id_find_conflict(keys); + conflict = bt_id_find_conflict(keys, false); if (conflict != NULL) { int err; @@ -934,7 +934,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) __ASSERT_NO_MSG(!err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(keys)); + __ASSERT_NO_MSG(!bt_id_find_conflict(keys, false)); bt_id_add(keys); } @@ -4135,16 +4135,24 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) */ __ASSERT_NO_MSG(!(smp->remote_dist & BT_SMP_DIST_ID_KEY)); - conflict = bt_id_find_conflict(new_bond); + conflict = bt_id_find_conflict(new_bond, IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)); if (conflict) { LOG_DBG("New bond conflicts with a bond on id %d.", conflict->id); } - if (conflict && !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { + if (conflict && !IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { LOG_WRN("Refusing new pairing. The old bond must be unpaired first."); return BT_SMP_ERR_AUTH_REQUIREMENTS; } + if (conflict && IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + LOG_WRN("Conflict detected with %p. Don't add key to Resolve List.", conflict); + new_bond->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + return 0; + } + if (conflict && IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { bool trust_ok; int unpair_err; @@ -4161,7 +4169,7 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) __ASSERT_NO_MSG(!unpair_err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond)); + __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond, false)); bt_id_add(new_bond); return 0; } diff --git a/tests/bluetooth/host/id/mocks/adv.c b/tests/bluetooth/host/id/mocks/adv.c index 2c2d4f3f3c7a..a22123dea3da 100644 --- a/tests/bluetooth/host/id/mocks/adv.c +++ b/tests/bluetooth/host/id/mocks/adv.c @@ -15,3 +15,4 @@ DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv *, DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DEFINE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/adv.h b/tests/bluetooth/host/id/mocks/adv.h index bfb744001596..1602ddf47185 100644 --- a/tests/bluetooth/host/id/mocks/adv.h +++ b/tests/bluetooth/host/id/mocks/adv.h @@ -18,7 +18,8 @@ typedef void (*bt_le_ext_adv_foreach_cb)(struct bt_le_ext_adv *adv, void *data); FAKE(bt_le_adv_lookup_legacy) \ FAKE(bt_le_ext_adv_get_index) \ FAKE(bt_le_adv_set_enable_ext) \ - FAKE(bt_le_ext_adv_foreach) + FAKE(bt_le_ext_adv_foreach) \ + FAKE(bt_adv_lookup_by_id) DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable, struct bt_le_ext_adv *, bool); DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_le_adv_lookup_legacy); @@ -27,3 +28,4 @@ DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv * DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DECLARE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/keys.c b/tests/bluetooth/host/id/mocks/keys.c index f885ab875c0f..61f73569c469 100644 --- a/tests/bluetooth/host/id/mocks/keys.c +++ b/tests/bluetooth/host/id/mocks/keys.c @@ -10,3 +10,4 @@ DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DEFINE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); diff --git a/tests/bluetooth/host/id/mocks/keys.h b/tests/bluetooth/host/id/mocks/keys.h index b6901e315ab9..1912472b78de 100644 --- a/tests/bluetooth/host/id/mocks/keys.h +++ b/tests/bluetooth/host/id/mocks/keys.h @@ -15,7 +15,9 @@ typedef void (*bt_keys_foreach_type_cb)(struct bt_keys *keys, void *data); /* List of fakes used by this unit tester */ #define KEYS_FFF_FAKES_LIST(FAKE) \ FAKE(bt_keys_find_irk) \ - FAKE(bt_keys_foreach_type) + FAKE(bt_keys_foreach_type) \ + FAKE(bt_keys_get_addr) DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DECLARE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); From 2ee700271633c02b745c1baa712e8f59c1afcdff Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Wed, 3 Sep 2025 17:00:07 +0200 Subject: [PATCH 0549/3334] [nrf fromtree] Bluetooth: BAP: SD: Remove address lookups Remove lookups in the Scan Delegator that relates to the advertiser address. The reason for this, is that the address is not considered a unique value for receive states, since the address may change over time in the case of (N)RPAs. Instead we shall rely exclusively on the address type, the sid and the broadcast ID. The implementation of the Scan Delegator and Broadcast Sink has been updated to not use addresses for lookups anymore, and there has been a minor API modification to set the PA sync state as part of bt_bap_scan_delegator_add_src as the higher layers are better suited to handle the PA Sync state. Signed-off-by: Emil Gydesen (cherry picked from commit 64ea5334e491d7ee5db5c0d78fec051b91bab9d2) --- include/zephyr/bluetooth/audio/bap.h | 10 +- subsys/bluetooth/audio/bap_broadcast_sink.c | 69 ++++-- subsys/bluetooth/audio/bap_scan_delegator.c | 257 ++++++-------------- 3 files changed, 137 insertions(+), 199 deletions(-) diff --git a/include/zephyr/bluetooth/audio/bap.h b/include/zephyr/bluetooth/audio/bap.h index 27f42432e227..d480837c9713 100644 --- a/include/zephyr/bluetooth/audio/bap.h +++ b/include/zephyr/bluetooth/audio/bap.h @@ -2661,8 +2661,6 @@ int bt_bap_scan_delegator_unregister(void); * * @param src_id The source id used to identify the receive state. * @param pa_state The Periodic Advertising sync state to set. - * BT_BAP_PA_STATE_NOT_SYNCED and BT_BAP_PA_STATE_SYNCED is - * not necessary to provide, as they are handled internally. * * @return int Error value. 0 on success, errno on fail. */ @@ -2688,6 +2686,14 @@ struct bt_bap_scan_delegator_add_src_param { /** Advertiser SID */ uint8_t sid; + /** + * @brief Periodic Advertising sync state + * + * This will typically be either @ref BT_BAP_PA_STATE_NOT_SYNCED or + * @ref BT_BAP_PA_STATE_SYNCED. + */ + enum bt_bap_pa_state pa_state; + /** The broadcast isochronous group encryption state */ enum bt_bap_big_enc_state encrypt_state; diff --git a/subsys/bluetooth/audio/bap_broadcast_sink.c b/subsys/bluetooth/audio/bap_broadcast_sink.c index 82106a9dfae5..cfe02efd01e6 100644 --- a/subsys/bluetooth/audio/bap_broadcast_sink.c +++ b/subsys/bluetooth/audio/bap_broadcast_sink.c @@ -70,8 +70,8 @@ static struct bt_bap_scan_delegator_mod_src_param mod_src_param; static void broadcast_sink_cleanup(struct bt_bap_broadcast_sink *sink); -static bool find_recv_state_by_sink_cb(const struct bt_bap_scan_delegator_recv_state *recv_state, - void *user_data) +static bool find_recv_state_by_src_id_cb(const struct bt_bap_scan_delegator_recv_state *recv_state, + void *user_data) { const struct bt_bap_broadcast_sink *sink = user_data; @@ -83,26 +83,27 @@ static bool find_recv_state_by_sink_cb(const struct bt_bap_scan_delegator_recv_s return false; } -static bool find_recv_state_by_pa_sync_cb(const struct bt_bap_scan_delegator_recv_state *recv_state, - void *user_data) +static bool +find_recv_state_by_sink_fields_cb(const struct bt_bap_scan_delegator_recv_state *recv_state, + void *user_data) { - struct bt_le_per_adv_sync *sync = user_data; + const struct bt_bap_broadcast_sink *sink = user_data; struct bt_le_per_adv_sync_info sync_info; int err; - err = bt_le_per_adv_sync_get_info(sync, &sync_info); + err = bt_le_per_adv_sync_get_info(sink->pa_sync, &sync_info); if (err != 0) { LOG_DBG("Failed to get sync info: %d", err); return false; } - if (bt_addr_le_eq(&recv_state->addr, &sync_info.addr) && - recv_state->adv_sid == sync_info.sid) { - return true; - } - - return false; + /* BAP 6.5.4 states that the combined Source_Address_Type, Source_Adv_SID, and Broadcast_ID + * fields are what makes a receive state unique. + */ + return recv_state->addr.type == sync_info.addr.type && + recv_state->adv_sid == sync_info.sid && + recv_state->broadcast_id == sink->broadcast_id; }; static void update_recv_state_big_synced(const struct bt_bap_broadcast_sink *sink) @@ -110,7 +111,7 @@ static void update_recv_state_big_synced(const struct bt_bap_broadcast_sink *sin const struct bt_bap_scan_delegator_recv_state *recv_state; int err; - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_sink_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_src_id_cb, (void *)sink); if (recv_state == NULL) { LOG_WRN("Failed to find receive state for sink %p", sink); @@ -156,7 +157,7 @@ static void update_recv_state_big_cleared(const struct bt_bap_broadcast_sink *si bool sink_is_streaming = false; int err; - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_sink_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_src_id_cb, (void *)sink); if (recv_state == NULL) { /* This is likely due to the receive state being removed while we are BIG synced */ LOG_DBG("Could not find receive state for sink %p", sink); @@ -489,6 +490,8 @@ static void broadcast_sink_add_src(struct bt_bap_broadcast_sink *sink) bt_addr_le_copy(&add_src_param.addr, &sync_info.addr); add_src_param.sid = sync_info.sid; + /* When a broadcast sink is created we always assume the PA sync provided is synced */ + add_src_param.pa_state = BT_BAP_PA_STATE_SYNCED; add_src_param.broadcast_id = sink->broadcast_id; /* Will be updated when we receive the BASE */ add_src_param.encrypt_state = BT_BAP_BIG_ENC_STATE_NO_ENC; @@ -542,7 +545,7 @@ static void update_recv_state_base(const struct bt_bap_broadcast_sink *sink, const struct bt_bap_scan_delegator_recv_state *recv_state; int err; - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_sink_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_src_id_cb, (void *)sink); if (recv_state == NULL) { LOG_WRN("Failed to find receive state for sink %p", sink); @@ -745,12 +748,23 @@ static void pa_recv(struct bt_le_per_adv_sync *sync, bt_data_parse(buf, pa_decode_base, (void *)sink); } +static void pa_synced_cb(struct bt_le_per_adv_sync *sync, + struct bt_le_per_adv_sync_synced_info *info) +{ + struct bt_bap_broadcast_sink *sink = broadcast_sink_get_by_pa(sync); + + if (sink != NULL) { + bt_bap_scan_delegator_set_pa_state(sink->bass_src_id, BT_BAP_PA_STATE_SYNCED); + } +} + static void pa_term_cb(struct bt_le_per_adv_sync *sync, const struct bt_le_per_adv_sync_term_info *info) { struct bt_bap_broadcast_sink *sink = broadcast_sink_get_by_pa(sync); if (sink != NULL) { + bt_bap_scan_delegator_set_pa_state(sink->bass_src_id, BT_BAP_PA_STATE_NOT_SYNCED); sink->pa_sync = NULL; sink->base_size = 0U; } @@ -763,7 +777,7 @@ static void update_recv_state_encryption(const struct bt_bap_broadcast_sink *sin __ASSERT(sink->big == NULL, "Encryption state shall not be updated while synced"); - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_sink_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_src_id_cb, (void *)sink); if (recv_state == NULL) { LOG_WRN("Failed to find receive state for sink %p", sink); @@ -1073,8 +1087,8 @@ int bt_bap_broadcast_sink_create(struct bt_le_per_adv_sync *pa_sync, uint32_t br sink->broadcast_id = broadcast_id; sink->pa_sync = pa_sync; - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_pa_sync_cb, - (void *)pa_sync); + recv_state = + bt_bap_scan_delegator_find_state(find_recv_state_by_sink_fields_cb, (void *)sink); if (recv_state == NULL) { broadcast_sink_add_src(sink); } else { @@ -1088,8 +1102,26 @@ int bt_bap_broadcast_sink_create(struct bt_le_per_adv_sync *pa_sync, uint32_t br } sink->bass_src_id = recv_state->src_id; + if (recv_state->pa_sync_state != BT_BAP_PA_STATE_SYNCED) { + int err; + + /* When a broadcast sink is created we always assume the PA sync provided is + * synced + */ + err = bt_bap_scan_delegator_set_pa_state(sink->bass_src_id, + BT_BAP_PA_STATE_SYNCED); + if (err != 0) { + LOG_DBG("Failed to set PA state: %d", err); + + broadcast_sink_cleanup(sink); + + return err; + } + } + atomic_set_bit(sink->flags, BT_BAP_BROADCAST_SINK_FLAG_SRC_ID_VALID); } + atomic_set_bit(sink->flags, BT_BAP_BROADCAST_SINK_FLAG_INITIALIZED); *out_sink = sink; @@ -1416,6 +1448,7 @@ int bt_bap_broadcast_sink_delete(struct bt_bap_broadcast_sink *sink) static int broadcast_sink_init(void) { static struct bt_le_per_adv_sync_cb cb = { + .synced = pa_synced_cb, .recv = pa_recv, .biginfo = biginfo_recv, .term = pa_term_cb, diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 1be1eec56a82..6e3316c28443 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -65,7 +65,7 @@ struct bass_recv_state_internal { uint8_t index; struct bt_bap_scan_delegator_recv_state state; uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]; - struct bt_le_per_adv_sync *pa_sync; + /** Requested BIS sync bitfield for each subgroup */ uint32_t requested_bis_sync[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS]; @@ -85,7 +85,6 @@ struct bt_bap_scan_delegator_inst { enum scan_delegator_flag { SCAN_DELEGATOR_FLAG_REGISTERED_CONN_CB, SCAN_DELEGATOR_FLAG_REGISTERED_SCAN_DELIGATOR, - SCAN_DELEGATOR_FLAG_REGISTERED_PA_SYNC_CB, SCAN_DELEGATOR_FLAG_NUM, }; @@ -395,27 +394,43 @@ static struct bass_recv_state_internal *bass_lookup_src_id(uint8_t src_id) return NULL; } -static struct bass_recv_state_internal *bass_lookup_pa_sync(struct bt_le_per_adv_sync *sync) +/* BAP 6.5.4 states that the combined Source_Address_Type, Source_Adv_SID, and Broadcast_ID fields + * are what makes a receive state unique. + */ +static struct bass_recv_state_internal *bass_lookup_state(uint8_t addr_type, uint8_t adv_sid, + uint32_t broadcast_id) { - for (size_t i = 0; i < ARRAY_SIZE(scan_delegator.recv_states); i++) { - if (scan_delegator.recv_states[i].pa_sync == sync) { - return &scan_delegator.recv_states[i]; + struct bass_recv_state_internal *res = NULL; + + ARRAY_FOR_EACH_PTR(scan_delegator.recv_states, recv_state_internal) { + int err; + + if (!recv_state_internal->active) { + continue; } - } - return NULL; -} + err = k_mutex_lock(&recv_state_internal->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); + if (err != 0) { + LOG_DBG("Failed to lock mutex: %d", err); -static struct bass_recv_state_internal *bass_lookup_addr(const bt_addr_le_t *addr) -{ - for (size_t i = 0; i < ARRAY_SIZE(scan_delegator.recv_states); i++) { - if (bt_addr_le_eq(&scan_delegator.recv_states[i].state.addr, - addr)) { - return &scan_delegator.recv_states[i]; + return NULL; + } + + if (recv_state_internal->state.addr.type == addr_type && + recv_state_internal->state.adv_sid == adv_sid && + recv_state_internal->state.broadcast_id == broadcast_id) { + res = recv_state_internal; + } + + err = k_mutex_unlock(&recv_state_internal->mutex); + __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + + if (res != NULL) { + break; } } - return NULL; + return res; } static struct bass_recv_state_internal *get_free_recv_state(void) @@ -432,85 +447,6 @@ static struct bass_recv_state_internal *get_free_recv_state(void) return NULL; } -static void pa_synced(struct bt_le_per_adv_sync *sync, - struct bt_le_per_adv_sync_synced_info *info) -{ - struct bass_recv_state_internal *internal_state; - bool state_changed = false; - int err; - - LOG_DBG("Synced%s", info->conn ? " via PAST" : ""); - - internal_state = bass_lookup_addr(info->addr); - if (internal_state == NULL) { - LOG_DBG("BASS receive state not found"); - return; - } - - err = k_mutex_lock(&internal_state->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); - if (err != 0) { - LOG_DBG("Failed to lock mutex: %d", err); - return; - } - - internal_state->pa_sync = sync; - - if (internal_state->state.pa_sync_state != BT_BAP_PA_STATE_SYNCED) { - internal_state->state.pa_sync_state = BT_BAP_PA_STATE_SYNCED; - set_receive_state_changed(internal_state); - state_changed = true; - } - - err = k_mutex_unlock(&internal_state->mutex); - __ASSERT(err == 0, "Failed to unlock mutex: %d", err); - - if (state_changed) { - /* app callback */ - receive_state_updated(info->conn, internal_state); - } -} - -static void pa_terminated(struct bt_le_per_adv_sync *sync, - const struct bt_le_per_adv_sync_term_info *info) -{ - struct bass_recv_state_internal *internal_state = bass_lookup_pa_sync(sync); - bool state_changed = false; - int err; - - LOG_DBG("Terminated"); - if (internal_state == NULL) { - LOG_DBG("BASS receive state not found"); - return; - } - - err = k_mutex_lock(&internal_state->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); - if (err != 0) { - LOG_DBG("Failed to lock mutex: %d", err); - return; - } - - internal_state->pa_sync = NULL; - - if (internal_state->state.pa_sync_state != BT_BAP_PA_STATE_NOT_SYNCED) { - internal_state->state.pa_sync_state = BT_BAP_PA_STATE_NOT_SYNCED; - set_receive_state_changed(internal_state); - state_changed = true; - } - - err = k_mutex_unlock(&internal_state->mutex); - __ASSERT(err == 0, "Failed to unlock mutex: %d", err); - - if (state_changed) { - /* app callback */ - receive_state_updated(NULL, internal_state); - } -} - -static struct bt_le_per_adv_sync_cb pa_sync_cb = { - .synced = pa_synced, - .term = pa_terminated, -}; - static bool supports_past(struct bt_conn *conn, uint8_t pa_sync_val) { if (IS_ENABLED(CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER)) { @@ -580,35 +516,12 @@ static int pa_sync_term_request(struct bt_conn *conn, return err; } -/* BAP 6.5.4 states that the Broadcast Assistant shall not initiate the Add Source operation - * if the operation would result in duplicate values for the combined Source_Address_Type, - * Source_Adv_SID, and Broadcast_ID fields of any Broadcast Receive State characteristic exposed - * by the Scan Delegator. - */ -static bool bass_source_is_duplicate(uint32_t broadcast_id, uint8_t adv_sid, uint8_t addr_type) -{ - struct bass_recv_state_internal *state; - - for (size_t i = 0; i < ARRAY_SIZE(scan_delegator.recv_states); i++) { - state = &scan_delegator.recv_states[i]; - - if (state != NULL && state->state.broadcast_id == broadcast_id && - state->state.adv_sid == adv_sid && state->state.addr.type == addr_type) { - LOG_DBG("recv_state already exists at src_id=0x%02X", state->state.src_id); - - return true; - } - } - - return false; -} - static int scan_delegator_add_src(struct bt_conn *conn, struct net_buf_simple *buf) { struct bass_recv_state_internal *internal_state = NULL; struct bt_bap_scan_delegator_recv_state *state; - bt_addr_t *addr; + bt_addr_le_t *addr; uint8_t pa_sync; uint16_t pa_interval; uint32_t aggregated_bis_syncs = 0; @@ -617,6 +530,7 @@ static int scan_delegator_add_src(struct bt_conn *conn, uint16_t total_len; struct bt_bap_bass_cp_add_src *add_src; int ret = BT_GATT_ERR(BT_ATT_ERR_SUCCESS); + uint8_t adv_sid; int err; /* subtract 1 as the opcode has already been pulled */ @@ -653,6 +567,29 @@ static int scan_delegator_add_src(struct bt_conn *conn, return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); } + addr = net_buf_simple_pull_mem(buf, sizeof(*addr)); + if (addr->type > BT_ADDR_LE_RANDOM) { + LOG_DBG("Invalid address type %u", addr->type); + return BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); + } + + adv_sid = net_buf_simple_pull_u8(buf); + if (adv_sid > BT_GAP_SID_MAX) { + LOG_DBG("Invalid adv SID %u", adv_sid); + return BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); + } + + broadcast_id = net_buf_simple_pull_le24(buf); + + internal_state = bass_lookup_state(addr->type, adv_sid, broadcast_id); + if (internal_state != NULL) { + LOG_DBG("Adding addr type=0x%02X adv_sid=0x%02X and broadcast_id=0x%06X would " + "result in duplication", + addr->type, adv_sid, broadcast_id); + + return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); + } + internal_state = get_free_recv_state(); if (internal_state == NULL) { LOG_DBG("Could not get free receive state"); @@ -670,33 +607,8 @@ static int scan_delegator_add_src(struct bt_conn *conn, state = &internal_state->state; state->src_id = next_src_id(); - state->addr.type = net_buf_simple_pull_u8(buf); - if (state->addr.type > BT_ADDR_LE_RANDOM) { - LOG_DBG("Invalid address type %u", state->addr.type); - ret = BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); - goto unlock_return; - } - - addr = net_buf_simple_pull_mem(buf, sizeof(*addr)); - bt_addr_copy(&state->addr.a, addr); - - state->adv_sid = net_buf_simple_pull_u8(buf); - if (state->adv_sid > BT_GAP_SID_MAX) { - LOG_DBG("Invalid adv SID %u", state->adv_sid); - ret = BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); - goto unlock_return; - } - - broadcast_id = net_buf_simple_pull_le24(buf); - - if (bass_source_is_duplicate(broadcast_id, state->adv_sid, state->addr.type)) { - LOG_DBG("Adding broadcast_id=0x%06X, adv_sid=0x%02X, and addr.type=0x%02X would " - "result in duplication", state->broadcast_id, state->adv_sid, - state->addr.type); - ret = BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); - goto unlock_return; - } - + bt_addr_le_copy(&state->addr, addr); + state->adv_sid = adv_sid; state->broadcast_id = broadcast_id; pa_sync = net_buf_simple_pull_u8(buf); @@ -1205,7 +1117,6 @@ static int scan_delegator_rem_src(struct bt_conn *conn, internal_state->index, src_id); internal_state->active = false; - internal_state->pa_sync = NULL; (void)memset(&internal_state->state, 0, sizeof(internal_state->state)); (void)memset(internal_state->broadcast_code, 0, sizeof(internal_state->broadcast_code)); @@ -1454,18 +1365,6 @@ int bt_bap_scan_delegator_register(struct bt_bap_scan_delegator_cb *cb) #endif /* CONFIG_BT_BAP_SCAN_DELEGATOR_RECV_STATE_COUNT > 2 */ #endif /* CONFIG_BT_BAP_SCAN_DELEGATOR_RECV_STATE_COUNT > 1 */ - if (!atomic_test_and_set_bit(scan_delegator_flags, - SCAN_DELEGATOR_FLAG_REGISTERED_PA_SYNC_CB)) { - err = bt_le_per_adv_sync_cb_register(&pa_sync_cb); - if (err) { - atomic_clear_bit(scan_delegator_flags, - SCAN_DELEGATOR_FLAG_REGISTERED_PA_SYNC_CB); - atomic_clear_bit(scan_delegator_flags, - SCAN_DELEGATOR_FLAG_REGISTERED_SCAN_DELIGATOR); - return err; - } - } - for (size_t i = 0; i < ARRAY_SIZE(scan_delegator.recv_states); i++) { struct bass_recv_state_internal *internal_state = &scan_delegator.recv_states[i]; @@ -1652,6 +1551,12 @@ static bool valid_bt_bap_scan_delegator_add_src_param( return false; } + if (!IN_RANGE(param->pa_state, BT_BAP_PA_STATE_NOT_SYNCED, BT_BAP_PA_STATE_NO_PAST)) { + LOG_DBG("Invalid PA state: %d", param->pa_state); + + return false; + } + for (uint8_t i = 0U; i < param->num_subgroups; i++) { const struct bt_bap_bass_subgroup *subgroup = ¶m->subgroups[i]; @@ -1677,23 +1582,19 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par { struct bass_recv_state_internal *internal_state = NULL; struct bt_bap_scan_delegator_recv_state *state; - struct bt_le_per_adv_sync *pa_sync; int err; CHECKIF(!valid_bt_bap_scan_delegator_add_src_param(param)) { return -EINVAL; } - pa_sync = bt_le_per_adv_sync_lookup_addr(¶m->addr, param->sid); - - if (pa_sync != NULL) { - internal_state = bass_lookup_pa_sync(pa_sync); - if (internal_state != NULL) { - LOG_DBG("PA Sync already in a receive state with src_id %u", - internal_state->state.src_id); + internal_state = bass_lookup_state(param->addr.type, param->sid, param->broadcast_id); + if (internal_state != NULL) { + LOG_DBG("Adding addr.type=0x%02X adv_sid=0x%02X and broadcast_id=0x%06X would " + "result in duplication", + param->addr.type, param->sid, param->broadcast_id); - return -EALREADY; - } + return -EALREADY; } internal_state = get_free_recv_state(); @@ -1703,14 +1604,20 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par return -ENOMEM; } + err = k_mutex_lock(&internal_state->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); + if (err != 0) { + LOG_DBG("Failed to lock mutex: %d", err); + + return -EBUSY; + } + state = &internal_state->state; state->src_id = next_src_id(); bt_addr_le_copy(&state->addr, ¶m->addr); state->adv_sid = param->sid; state->broadcast_id = param->broadcast_id; - state->pa_sync_state = - pa_sync == NULL ? BT_BAP_PA_STATE_NOT_SYNCED : BT_BAP_PA_STATE_SYNCED; + state->pa_sync_state = param->pa_state; state->num_subgroups = param->num_subgroups; if (state->num_subgroups > 0U) { (void)memcpy(state->subgroups, param->subgroups, @@ -1719,15 +1626,7 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par (void)memset(state->subgroups, 0, sizeof(state->subgroups)); } - err = k_mutex_lock(&internal_state->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); - if (err != 0) { - LOG_DBG("Failed to lock mutex: %d", err); - - return -EBUSY; - } - internal_state->active = true; - internal_state->pa_sync = pa_sync; /* Set all requested_bis_sync to BT_BAP_BIS_SYNC_NO_PREF, as no * Broadcast Assistant has set any requests yet From 01b99f2f011b87e3cd5158cc257379484b3c63bf Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 4 Sep 2025 10:34:07 +0200 Subject: [PATCH 0550/3334] [nrf fromtree] tests: Bluetooth: BAP: SD: Update test to set PA sync state The Scan Delegator has been modified to not set the PA sync state automatically anymore, so the test needed to be updated. Signed-off-by: Emil Gydesen (cherry picked from commit 397c8ee54c43d0495859e8c403545525f60c71c3) --- .../audio/src/bap_scan_delegator_test.c | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c b/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c index c8f728fa96af..ca0e38ec600f 100644 --- a/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c +++ b/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c @@ -123,6 +123,7 @@ static void pa_timer_handler(struct k_work *work) if (state->recv_state != NULL) { enum bt_bap_pa_state pa_state; + int err; if (state->recv_state->pa_sync_state == BT_BAP_PA_STATE_INFO_REQ) { pa_state = BT_BAP_PA_STATE_NO_PAST; @@ -130,8 +131,11 @@ static void pa_timer_handler(struct k_work *work) pa_state = BT_BAP_PA_STATE_FAILED; } - bt_bap_scan_delegator_set_pa_state(state->recv_state->src_id, - pa_state); + err = bt_bap_scan_delegator_set_pa_state(state->recv_state->src_id, pa_state); + if (err != 0) { + FAIL("Could not set PA sync state: %d\n", err); + return; + } } FAIL("PA timeout\n"); @@ -286,7 +290,8 @@ static int pa_sync_req_cb(struct bt_conn *conn, err = bt_bap_scan_delegator_set_pa_state(state->recv_state->src_id, BT_BAP_PA_STATE_INFO_REQ); if (err != 0) { - printk("Failed to set INFO_REQ state: %d", err); + FAIL("Could not set PA sync state: %d\n", err); + return err; } } } else { @@ -426,6 +431,16 @@ static void pa_synced_cb(struct bt_le_per_adv_sync *sync, return; } + if (state->recv_state != NULL) { + int err; + + err = bt_bap_scan_delegator_set_pa_state(state->src_id, BT_BAP_PA_STATE_SYNCED); + if (err != 0) { + FAIL("Could not set PA sync state: %d\n", err); + return; + } + } + k_work_cancel_delayable(&state->pa_timer); SET_FLAG(flag_pa_synced); @@ -444,6 +459,16 @@ static void pa_term_cb(struct bt_le_per_adv_sync *sync, return; } + if (state->recv_state != NULL) { + int err; + + err = bt_bap_scan_delegator_set_pa_state(state->src_id, BT_BAP_PA_STATE_NOT_SYNCED); + if (err != 0) { + FAIL("Could not set PA sync state: %d\n", err); + return; + } + } + k_work_cancel_delayable(&state->pa_timer); SET_FLAG(flag_pa_terminated); @@ -541,6 +566,7 @@ static int add_source(struct sync_state *state) bt_addr_le_copy(¶m.addr, &sync_info.addr); param.sid = sync_info.sid; + param.pa_state = BT_BAP_PA_STATE_SYNCED; param.encrypt_state = BT_BAP_BIG_ENC_STATE_NO_ENC; param.broadcast_id = g_broadcast_id; param.num_subgroups = 1U; @@ -657,6 +683,8 @@ static int remove_source(struct sync_state *state) return err; } + state->recv_state = NULL; + WAIT_FOR_FLAG(flag_recv_state_updated); return 0; From 91d4f782001390efea9dfa842c50fdb41cb1d804 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 4 Sep 2025 10:35:10 +0200 Subject: [PATCH 0551/3334] [nrf fromtree] doc: migration guide: Add entry for recent change to BT BAP SD The Bluetooth BAP Scan Delegator had a minor behavioral change that may affect a small subset of devices. Signed-off-by: Emil Gydesen (cherry picked from commit 15abc32ca09f836ce167958019d5b4057c90b8d7) --- doc/releases/migration-guide-4.3.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index 53e6b64ab72d..e895207d03c3 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -114,6 +114,12 @@ Bluetooth Audio * Setting the BGS role for GMAP now requires also supporting and implementing the :kconfig:option:`CONFIG_BT_BAP_BROADCAST_ASSISTANT`. See the :zephyr:code-sample:`bluetooth_bap_broadcast_assistant` sample as a reference. +* The BAP Scan Delegator will no longer automatically update the PA sync state, and + :c:func:`bt_bap_scan_delegator_set_pa_state` must be used to update the state. If the + BAP Scan Delegator is used together with the BAP Broadcast Sink, then the PA state of the + receive state of a :c:struct:`bt_bap_broadcast_sink` will still be automatically updated when the + PA state changes. (:github:`95453``) + .. zephyr-keep-sorted-stop From b866b8b2fd9502e60af5dfa14e8365f0043077cc Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Wed, 19 Nov 2025 11:53:19 +0100 Subject: [PATCH 0552/3334] [nrf fromtree] bluetooth: audio: scan_delegator: Reject remove when PA synced - BASS mandates that a remove_source operation is not done if we are synced to PA or BIS. This PR fixes that - Update BabbleSim tests to reflect this behavior - Fixes BASS/SR/SPE/BI-05-C Signed-off-by: Alexander Svensen (cherry picked from commit 87997afeb2b881fefd871aaabc6637626d3304e4) --- subsys/bluetooth/audio/bap_scan_delegator.c | 61 +++++++++---------- .../audio/src/bap_broadcast_assistant_test.c | 43 ++++++------- .../audio/src/bap_scan_delegator_test.c | 58 +++++++++++++++--- 3 files changed, 102 insertions(+), 60 deletions(-) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 6e3316c28443..5e6f8384ef75 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -1051,7 +1051,6 @@ static int scan_delegator_rem_src(struct bt_conn *conn, { struct bass_recv_state_internal *internal_state; struct bt_bap_scan_delegator_recv_state *state; - bool bis_sync_was_requested = false; uint8_t src_id; int err; @@ -1078,38 +1077,40 @@ static int scan_delegator_rem_src(struct bt_conn *conn, state = &internal_state->state; - /* If conn == NULL then it's a local operation and we do not need to ask the application */ - if (conn != NULL) { - - if (scan_delegator_cbs != NULL && scan_delegator_cbs->remove_source != NULL) { - err = scan_delegator_cbs->remove_source(conn, src_id); - if (err != 0) { - LOG_DBG("Remove Source rejected with reason 0x%02x", err); - err = k_mutex_unlock(&internal_state->mutex); - __ASSERT(err == 0, "Failed to unlock mutex: %d", err); - return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); - } - } - - if (state->pa_sync_state == BT_BAP_PA_STATE_INFO_REQ || - state->pa_sync_state == BT_BAP_PA_STATE_SYNCED) { - /* Terminate PA sync */ - err = pa_sync_term_request(conn, &internal_state->state); - if (err != 0) { - LOG_DBG("PA sync term from %p was rejected with reason %d", - (void *)conn, err); - err = k_mutex_unlock(&internal_state->mutex); - __ASSERT(err == 0, "Failed to unlock mutex: %d", err); - return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); - } - } + if (state->pa_sync_state == BT_BAP_PA_STATE_SYNCED) { + LOG_DBG("Cannot remove source ID 0x%02x while PA is synced", state->src_id); + err = k_mutex_unlock(&internal_state->mutex); + __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + /* We shouldn't return a success here, but the Test Spec requires it at the moment, + * Errata to fix this: https://bluetooth.atlassian.net/browse/ES-28445 + */ + return BT_GATT_ERR(BT_ATT_ERR_SUCCESS); } for (uint8_t i = 0U; i < state->num_subgroups; i++) { if (internal_state->requested_bis_sync[i] != 0U && internal_state->state.subgroups[i].bis_sync != 0U) { - bis_sync_was_requested = true; - break; + LOG_DBG("Cannot remove source ID 0x%02x while BIS is synced", + state->src_id); + err = k_mutex_unlock(&internal_state->mutex); + __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + /* We shouldn't return a success here, but the Test Spec requires it at the + * moment, Errata to fix this: + * https://bluetooth.atlassian.net/browse/ES-28445 + */ + return BT_GATT_ERR(BT_ATT_ERR_SUCCESS); + } + } + + /* If conn == NULL then it's a local operation and we do not need to ask the application */ + if (conn != NULL && scan_delegator_cbs != NULL && + scan_delegator_cbs->remove_source != NULL) { + err = scan_delegator_cbs->remove_source(conn, src_id); + if (err != 0) { + LOG_DBG("Remove Source rejected with reason 0x%02x", err); + err = k_mutex_unlock(&internal_state->mutex); + __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); } } @@ -1128,10 +1129,6 @@ static int scan_delegator_rem_src(struct bt_conn *conn, err = k_mutex_unlock(&internal_state->mutex); __ASSERT(err == 0, "Failed to unlock mutex: %d", err); - if (bis_sync_was_requested) { - bis_sync_request_updated(conn, internal_state); - } - /* app callback */ receive_state_updated(conn, internal_state); diff --git a/tests/bsim/bluetooth/audio/src/bap_broadcast_assistant_test.c b/tests/bsim/bluetooth/audio/src/bap_broadcast_assistant_test.c index 5d7d3ab7db8e..e9a35e0773c2 100644 --- a/tests/bsim/bluetooth/audio/src/bap_broadcast_assistant_test.c +++ b/tests/bsim/bluetooth/audio/src/bap_broadcast_assistant_test.c @@ -502,7 +502,7 @@ static void test_bass_add_source(void) printk("Source added\n"); } -static void test_bass_mod_source(uint32_t bis_sync) +static void test_bass_mod_source(bool pa_sync, uint32_t bis_sync) { int err; struct bt_bap_broadcast_assistant_mod_src_param mod_src_param = { 0 }; @@ -515,7 +515,7 @@ static void test_bass_mod_source(uint32_t bis_sync) UNSET_FLAG(flag_recv_state_updated); mod_src_param.src_id = recv_state.src_id; mod_src_param.num_subgroups = 1; - mod_src_param.pa_sync = true; + mod_src_param.pa_sync = pa_sync; mod_src_param.subgroups = &subgroup; mod_src_param.pa_interval = g_broadcaster_info.interval; subgroup.bis_sync = bis_sync; @@ -542,14 +542,16 @@ static void test_bass_mod_source(uint32_t bis_sync) WAIT_FOR_AND_CLEAR_FLAG(flag_recv_state_updated); } - if (recv_state.pa_sync_state != BT_BAP_PA_STATE_SYNCED) { - FAIL("Unexpected PA sync state: %d\n", recv_state.pa_sync_state); - return; - } + if (pa_sync) { + if (recv_state.pa_sync_state != BT_BAP_PA_STATE_SYNCED) { + FAIL("Unexpected PA sync state: %d\n", recv_state.pa_sync_state); + return; + } - if (recv_state.encrypt_state != BT_BAP_BIG_ENC_STATE_NO_ENC) { - FAIL("Unexpected BIG encryption state: %d\n", recv_state.pa_sync_state); - return; + if (recv_state.encrypt_state != BT_BAP_BIG_ENC_STATE_NO_ENC) { + FAIL("Unexpected BIG encryption state: %d\n", recv_state.pa_sync_state); + return; + } } if (recv_state.num_subgroups != mod_src_param.num_subgroups) { @@ -563,19 +565,15 @@ static void test_bass_mod_source(uint32_t bis_sync) WAIT_FOR_AND_CLEAR_FLAG(flag_recv_state_updated); } - remote_bis_sync = recv_state.subgroups[0].bis_sync; - if (subgroup.bis_sync == 0) { - if (remote_bis_sync != 0U) { - FAIL("Unexpected BIS sync value: %u\n", remote_bis_sync); - return; - } - } else { + if (bis_sync != 0) { + remote_bis_sync = recv_state.subgroups[0].bis_sync; printk("Waiting for BIS sync\n"); if (remote_bis_sync == 0U && recv_state.encrypt_state == BT_BAP_BIG_ENC_STATE_NO_ENC) { - /* Wait for another notification, which will either request a broadcast code - * for encrypted broadcasts, or have the BIS sync values set + /* Wait for another notification, which will either request a + * broadcast code for encrypted broadcasts, or have the BIS sync + * values set */ printk("Waiting for another receive state update with BIS sync\n"); WAIT_FOR_AND_CLEAR_FLAG(flag_recv_state_updated); @@ -770,14 +768,15 @@ static void test_main_client_sync(void) test_bass_scan_stop(); test_bass_create_pa_sync(); test_bass_add_source(); - test_bass_mod_source(0); + test_bass_mod_source(true, 0); test_bass_mod_source_long_meta(); - test_bass_mod_source(BT_ISO_BIS_INDEX_BIT(1) | BT_ISO_BIS_INDEX_BIT(2)); + test_bass_mod_source(true, BT_ISO_BIS_INDEX_BIT(1) | BT_ISO_BIS_INDEX_BIT(2)); test_bass_broadcast_code(BROADCAST_CODE); printk("Waiting for receive state with BIS sync\n"); WAIT_FOR_FLAG(flag_recv_state_updated_with_bis_sync); + test_bass_mod_source(false, 0); test_bass_remove_source(); PASS("BAP Broadcast Assistant Client Sync Passed\n"); @@ -797,11 +796,12 @@ static void test_main_client_sync_incorrect_code(void) test_bass_scan_stop(); test_bass_create_pa_sync(); test_bass_add_source(); - test_bass_mod_source(BT_ISO_BIS_INDEX_BIT(1)); + test_bass_mod_source(true, BT_ISO_BIS_INDEX_BIT(1)); WAIT_FOR_FLAG(flag_broadcast_code_requested); test_bass_broadcast_code(INCORRECT_BROADCAST_CODE); WAIT_FOR_FLAG(flag_incorrect_broadcast_code); + test_bass_mod_source(false, 0); test_bass_remove_source(); PASS("BAP Broadcast Assistant Client Sync Passed\n"); @@ -825,6 +825,7 @@ static void test_main_server_sync_client_rem(void) WAIT_FOR_FLAG(flag_recv_state_updated_with_bis_sync); printk("Attempting to remove source for the first time\n"); + test_bass_mod_source(false, 0); test_bass_remove_source(); WAIT_FOR_FLAG(flag_remove_source_rejected); diff --git a/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c b/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c index ca0e38ec600f..b979464a39a5 100644 --- a/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c +++ b/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c @@ -213,6 +213,8 @@ static int pa_sync_term(struct sync_state *state) printk("Deleting PA sync\n"); + UNSET_FLAG(flag_pa_terminated); + err = bt_le_per_adv_sync_delete(state->pa_sync); if (err != 0) { FAIL("Could not delete per adv sync: %d\n", err); @@ -221,6 +223,8 @@ static int pa_sync_term(struct sync_state *state) state->pa_sync = NULL; } + WAIT_FOR_FLAG(flag_pa_terminated); + return err; } @@ -708,13 +712,48 @@ static void remove_all_sources(void) printk("[%zu]: Source removed with id %u\n", i, state->src_id); + } + } +} - printk("Terminating PA sync\n"); - err = pa_sync_term(state); - if (err) { - FAIL("[%zu]: PA sync term failed (err %d)\n", err); - return; - } +static void terminate_all_pa(void) +{ + for (size_t i = 0U; i < ARRAY_SIZE(sync_states); i++) { + int err; + struct sync_state *state = &sync_states[i]; + + if (state->pa_sync == NULL) { + continue; + } + + err = pa_sync_term(state); + if (err != 0) { + FAIL("[%zu]: PA sync term failed (err %d)\n", i, err); + return; + } + } +} + +static void set_bis_sync_state(struct sync_state *state, + uint32_t bis_sync_req[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS]) +{ + int err; + + err = bt_bap_scan_delegator_set_bis_sync_state(state->src_id, bis_sync_req); + if (err != 0) { + FAIL("Could not set BIS sync state: %d\n", err); + return; + } +} + +static void set_all_bis_sync_states(uint32_t bis_sync_req[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS]) +{ + for (size_t i = 0U; i < ARRAY_SIZE(sync_states); i++) { + struct sync_state *state = &sync_states[i]; + + if (state->recv_state != NULL) { + printk("[%zu]: Setting BIS sync state\n", i); + set_bis_sync_state(state, bis_sync_req); } } } @@ -914,7 +953,12 @@ static void test_main_server_sync_server_rem(void) /* Set the BIS sync state */ sync_all_broadcasts(); - /* Remote all sources, causing PA sync term request to trigger */ + uint32_t bis_sync_req[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS] = {0}; + + set_all_bis_sync_states(bis_sync_req); + terminate_all_pa(); + + /* Remove all sources, causing PA sync term request to trigger */ remove_all_sources(); /* Wait for PA sync to be terminated */ From b47a92d7718f67ec748985a6784de2184cb885cf Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 18 Nov 2025 23:04:44 +0100 Subject: [PATCH 0553/3334] [nrf fromtree] Bluetooth: BAP: Fix bad check for ASE state for CIS connect A CIS may be connected in either the QoS Configured state or the enabling state. The QoS Configured state is the earliest state it is allowed, due to it being the first state where the CIS_ID and ASE_ID are paired. The enabling state is the "last" state it is allowed, as if the ASE is in the streaming, disabling or releasing state we should not allow/expect a CIS connection to happen. Signed-off-by: Emil Gydesen (cherry picked from commit 4c54eef0d0f00c32d075a7498ad33d41b2764cb8) --- subsys/bluetooth/audio/bap_unicast_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index 429431ada433..d0d9001548dc 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -327,8 +327,8 @@ static void unicast_client_ep_iso_connected(struct bt_bap_ep *ep) ep->unicast_group->has_been_connected = true; } - if (ep->state != BT_BAP_EP_STATE_ENABLING) { - LOG_DBG("endpoint not in enabling state: %s", bt_bap_ep_state_str(ep->state)); + if (ep->state != BT_BAP_EP_STATE_QOS_CONFIGURED && ep->state != BT_BAP_EP_STATE_ENABLING) { + LOG_DBG("endpoint in invalid state: %s", bt_bap_ep_state_str(ep->state)); return; } From 92a5ca0fbdcc7ab14b2a10a80afe7f4ace09186a Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 18 Nov 2025 16:33:30 +0100 Subject: [PATCH 0554/3334] [nrf fromtree] tests: Bluetooth: Add ASCS CIS connection events Add support for the ASCS CIS connection state events. Signed-off-by: Emil Gydesen (cherry picked from commit 29f4f24019ac5463d539364cc7c65961e28d71c0) --- .../bluetooth/tester/src/audio/btp/btp_ascs.h | 15 +++++++ .../tester/src/audio/btp_bap_unicast.c | 44 +++++++++++++++++++ tests/bsim/bluetooth/tester/src/bsim_btp.c | 4 ++ 3 files changed, 63 insertions(+) diff --git a/tests/bluetooth/tester/src/audio/btp/btp_ascs.h b/tests/bluetooth/tester/src/audio/btp/btp_ascs.h index 50d3291f76e1..706e6cad1875 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_ascs.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_ascs.h @@ -117,5 +117,20 @@ struct btp_ascs_ase_state_changed_ev { uint8_t state; } __packed; +#define BTP_ASCS_EV_CIS_CONNECTED 0x83 +struct btp_ascs_cis_connected_ev { + bt_addr_le_t address; + uint8_t ase_id; + uint8_t cis_id; +} __packed; + +#define BTP_ASCS_EV_CIS_DISCONNECTED 0x84 +struct btp_ascs_cis_disconnected_ev { + bt_addr_le_t address; + uint8_t ase_id; + uint8_t cis_id; + uint8_t reason; +} __packed; + #define BTP_ASCS_STATUS_SUCCESS 0x00 #define BTP_ASCS_STATUS_FAILED 0x01 diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index c06795e8267a..f620c5e418e7 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -7,12 +7,15 @@ */ #include +#include #include +#include #include #include #include #include +#include #include #include #include @@ -168,6 +171,37 @@ static void btp_send_ascs_ase_state_changed_ev(struct bt_conn *conn, uint8_t ase tester_event(BTP_SERVICE_ID_ASCS, BTP_ASCS_EV_ASE_STATE_CHANGED, &ev, sizeof(ev)); } +static void btp_send_ascs_cis_connected_ev(const struct bt_bap_stream *stream) +{ + struct btp_bap_unicast_stream *u_stream; + struct btp_ascs_cis_connected_ev ev; + + u_stream = stream_bap_to_unicast(stream); + __ASSERT(u_stream != NULL, "Failed to get unicast_stream from %p", stream); + + bt_addr_le_copy(&ev.address, bt_conn_get_dst(stream->conn)); + ev.ase_id = u_stream->ase_id; + ev.cis_id = u_stream->cis_id; + + tester_event(BTP_SERVICE_ID_ASCS, BTP_ASCS_EV_CIS_CONNECTED, &ev, sizeof(ev)); +} + +static void btp_send_ascs_cis_disconnected_ev(const struct bt_bap_stream *stream, uint8_t reason) +{ + struct btp_bap_unicast_stream *u_stream; + struct btp_ascs_cis_disconnected_ev ev; + + u_stream = stream_bap_to_unicast(stream); + __ASSERT(u_stream != NULL, "Failed to get unicast_stream from %p", stream); + + bt_addr_le_copy(&ev.address, bt_conn_get_dst(stream->conn)); + ev.ase_id = u_stream->ase_id; + ev.cis_id = u_stream->cis_id; + ev.reason = reason; + + tester_event(BTP_SERVICE_ID_ASCS, BTP_ASCS_EV_CIS_DISCONNECTED, &ev, sizeof(ev)); +} + static void btp_send_ascs_operation_completed_ev(struct bt_conn *conn, uint8_t ase_id, uint8_t opcode, uint8_t status) { @@ -669,6 +703,15 @@ static void stream_connected_cb(struct bt_bap_stream *stream) BTP_ASCS_STATUS_SUCCESS); } } + + btp_send_ascs_cis_connected_ev(stream); +} + +static void stream_disconnected_cb(struct bt_bap_stream *stream, uint8_t reason) +{ + LOG_DBG("Disconnected stream %p: 0x%02X", stream, reason); + + btp_send_ascs_cis_disconnected_ev(stream, reason); } static void stream_stopped_cb(struct bt_bap_stream *stream, uint8_t reason) @@ -749,6 +792,7 @@ static struct bt_bap_stream_ops stream_ops = { .recv = stream_recv_cb, .sent = btp_bap_audio_stream_sent_cb, .connected = stream_connected_cb, + .disconnected = stream_disconnected_cb, }; struct btp_bap_unicast_stream *btp_bap_unicast_stream_alloc( diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.c b/tests/bsim/bluetooth/tester/src/bsim_btp.c index 19b196d1fe62..eaeaa427a70e 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.c +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.c @@ -1041,6 +1041,10 @@ static bool is_valid_ascs_packet_len(const struct btp_hdr *hdr, struct net_buf_s return buf_simple->len == 0U; case BTP_ASCS_EV_ASE_STATE_CHANGED: return buf_simple->len == sizeof(struct btp_ascs_ase_state_changed_ev); + case BTP_ASCS_EV_CIS_CONNECTED: + return buf_simple->len == sizeof(struct btp_ascs_cis_connected_ev); + case BTP_ASCS_EV_CIS_DISCONNECTED: + return buf_simple->len == sizeof(struct btp_ascs_cis_disconnected_ev); default: LOG_ERR("Unhandled opcode 0x%02X", hdr->opcode); return false; From cfb18edbddff949d671710028298231b20e92d3f Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 18 Nov 2025 22:58:02 +0100 Subject: [PATCH 0555/3334] [nrf fromtree] tests: Bluetooth: Tester: Allow connecting CIS in QoS state Add support for connecting the CIS in QoS state. To support this some checks were added to check the CIS state while entering the enabling state, as well as the ASE state when the CIS was connected to determine when to send the ASE start opcode. Signed-off-by: Emil Gydesen (cherry picked from commit b8e71e6098e48f5f2f95291825bcdc28f5b3c1e9) --- .../tester/src/audio/btp_bap_unicast.c | 59 +++++++++++++------ 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index f620c5e418e7..449ac8076cae 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include #include @@ -16,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -558,22 +560,41 @@ static void stream_qos_set_cb(struct bt_bap_stream *stream) static void stream_enabled_cb(struct bt_bap_stream *stream) { - struct bt_bap_ep_info info; - struct bt_conn_info conn_info; + const bool iso_connected = + stream->iso == NULL ? false : stream->iso->state == BT_ISO_STATE_CONNECTED; int err; LOG_DBG("Enabled stream %p", stream); - (void)bt_bap_ep_get_info(stream->ep, &info); - (void)bt_conn_get_info(stream->conn, &conn_info); - if (conn_info.role == BT_HCI_ROLE_PERIPHERAL && info.dir == BT_AUDIO_DIR_SINK) { - /* Automatically do the receiver start ready operation */ - /* TODO: This should ideally be done by the upper tester */ - err = bt_bap_stream_start(stream); - if (err != 0) { - LOG_DBG("Failed to start stream %p", stream); + if (iso_connected) { + struct bt_bap_ep_info ep_info; + struct bt_conn_info conn_info; - return; + err = bt_bap_ep_get_info(stream->ep, &ep_info); + __ASSERT(err == 0, "Failed to get ISO chan info: %d", err); + err = bt_conn_get_info(stream->conn, &conn_info); + __ASSERT(err == 0, "Failed to get ISO chan info: %d", err); + + /* If we are central and the endpoint is a source or if we are a peripheral and the + * endpoint is a sink, then we can start it, else the remote device needs to start + * the endpoint + */ + const bool start_stream = + (IS_ENABLED(CONFIG_BT_CENTRAL) && conn_info.role == BT_HCI_ROLE_CENTRAL && + ep_info.dir == BT_AUDIO_DIR_SOURCE) || + (IS_ENABLED(CONFIG_BT_PERIPHERAL) && + conn_info.role == BT_HCI_ROLE_PERIPHERAL && + ep_info.dir == BT_AUDIO_DIR_SINK); + + if (start_stream) { + /* Automatically do the receiver start ready operation */ + /* TODO: This should ideally be done by the upper tester */ + err = bt_bap_stream_start(stream); + if (err != 0) { + LOG_DBG("Failed to start stream %p", stream); + + return; + } } } @@ -688,12 +709,16 @@ static void stream_connected_cb(struct bt_bap_stream *stream) } if (ep_info.dir == BT_AUDIO_DIR_SOURCE) { - /* Automatically do the receiver start ready operation for source ASEs as - * the client - */ - err = bt_bap_stream_start(stream); - if (err != 0) { - LOG_ERR("Failed to start stream %p", stream); + if (ep_info.state == BT_BAP_EP_STATE_ENABLING) { + /* Automatically do the receiver start ready operation for source + * ASEs as the client when in the enabling state. + * The CIS may be connected in the QoS Configured state as well, in + * which case we should wait until we enter the enabling state. + */ + err = bt_bap_stream_start(stream); + if (err != 0) { + LOG_ERR("Failed to start stream %p", stream); + } } } else { struct btp_bap_unicast_stream *u_stream = stream_bap_to_unicast(stream); From eaa330e7b7a30c553e5448a4b06081543c973d6a Mon Sep 17 00:00:00 2001 From: Omkar Kulkarni Date: Mon, 24 Nov 2025 10:50:15 +0100 Subject: [PATCH 0556/3334] [nrf fromtree] bluetooth: audio: Update encrypt state value Fixes a bug where encrypt state value was not updated based on given parameters. Signed-off-by: Omkar Kulkarni (cherry picked from commit b6e5d03ff4f74b02df05f70cc5c355b721e8beb6) --- subsys/bluetooth/audio/bap_scan_delegator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 5e6f8384ef75..90520017209f 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -1615,6 +1615,7 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par state->adv_sid = param->sid; state->broadcast_id = param->broadcast_id; state->pa_sync_state = param->pa_state; + state->encrypt_state = param->encrypt_state; state->num_subgroups = param->num_subgroups; if (state->num_subgroups > 0U) { (void)memcpy(state->subgroups, param->subgroups, From dc05376c170fc2739a4881629caf49c40d485a9e Mon Sep 17 00:00:00 2001 From: Omkar Kulkarni Date: Thu, 20 Nov 2025 16:36:12 +0100 Subject: [PATCH 0557/3334] [nrf fromtree] tests: Bluetooth: Tester: Audio: Adds BRS This commit adds API to tester to allow exposing of Broadcast Receive State. Signed-off-by: Omkar Kulkarni (cherry picked from commit d8ed0f8e3de02642e6ccabbb144037688d107ad7) --- subsys/bluetooth/audio/bap_scan_delegator.c | 1 + .../bluetooth/tester/src/audio/btp/btp_bap.h | 14 ++++ tests/bluetooth/tester/src/audio/btp_bap.c | 5 ++ .../tester/src/audio/btp_bap_broadcast.c | 65 +++++++++++++++++++ .../tester/src/audio/btp_bap_broadcast.h | 2 + 5 files changed, 87 insertions(+) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 90520017209f..b672640c2b44 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -1617,6 +1617,7 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par state->pa_sync_state = param->pa_state; state->encrypt_state = param->encrypt_state; state->num_subgroups = param->num_subgroups; + if (state->num_subgroups > 0U) { (void)memcpy(state->subgroups, param->subgroups, sizeof(state->subgroups)); diff --git a/tests/bluetooth/tester/src/audio/btp/btp_bap.h b/tests/bluetooth/tester/src/audio/btp/btp_bap.h index 90544cdcbd0d..a9f045b02975 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_bap.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_bap.h @@ -202,6 +202,20 @@ struct btp_bap_broadcast_source_setup_v2_rp { uint32_t gap_settings; } __packed; +#define BTP_BAP_SCAN_DELEGATOR_ADD_SRC 0x1a +struct btp_bap_scan_delegator_add_src_cmd { + bt_addr_le_t broadcaster_address; + uint8_t advertiser_sid; + uint8_t broadcast_id[BT_AUDIO_BROADCAST_ID_SIZE]; + uint8_t pa_sync_state; + uint8_t big_encryption; + uint8_t num_subgroups; + uint8_t subgroups[]; +} __packed; +struct btp_bap_scan_delegator_add_src_rp { + uint8_t src_id; +} __packed; + /* BAP events */ #define BTP_BAP_EV_DISCOVERY_COMPLETED 0x80 struct btp_bap_discovery_completed_ev { diff --git a/tests/bluetooth/tester/src/audio/btp_bap.c b/tests/bluetooth/tester/src/audio/btp_bap.c index cf9baeec5c3f..c860d7341c6f 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap.c +++ b/tests/bluetooth/tester/src/audio/btp_bap.c @@ -474,6 +474,11 @@ static const struct btp_handler bap_handlers[] = { .expect_len = sizeof(struct btp_bap_send_past_cmd), .func = btp_bap_broadcast_assistant_send_past, }, + { + .opcode = BTP_BAP_SCAN_DELEGATOR_ADD_SRC, + .expect_len = BTP_HANDLER_LENGTH_VARIABLE, + .func = btp_bap_scan_delegator_add_src, + }, #endif /* CONFIG_BT_BAP_BROADCAST_SOURCE || CONFIG_BT_BAP_BROADCAST_SINK */ }; diff --git a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c index 3733ab36440a..d301fac6c31f 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c @@ -1833,6 +1833,71 @@ uint8_t btp_bap_broadcast_assistant_send_past(const void *cmd, uint16_t cmd_len, return BTP_STATUS_SUCCESS; } +uint8_t btp_bap_scan_delegator_add_src(const void *cmd, uint16_t cmd_len, void *rsp, + uint16_t *rsp_len) +{ + const struct btp_bap_scan_delegator_add_src_cmd *cp = cmd; + struct btp_bap_scan_delegator_add_src_rp *rp = rsp; + struct bt_bap_scan_delegator_add_src_param param = {0}; + struct net_buf_simple buf; + int err; + + if (cmd_len < sizeof(*cp)) { + return BTP_STATUS_FAILED; + } + + if (cp->num_subgroups > CONFIG_BT_BAP_BASS_MAX_SUBGROUPS) { + return BTP_STATUS_FAILED; + } + + if (cp->big_encryption > BT_BAP_BIG_ENC_STATE_BAD_CODE) { + return BTP_STATUS_FAILED; + } + + bt_addr_le_copy(¶m.addr, &cp->broadcaster_address); + param.sid = cp->advertiser_sid; + param.pa_state = (enum bt_bap_pa_state)cp->pa_sync_state; + param.encrypt_state = (enum bt_bap_big_enc_state)cp->big_encryption; + param.broadcast_id = sys_get_le24(cp->broadcast_id); + param.num_subgroups = cp->num_subgroups; + + net_buf_simple_init_with_data(&buf, (void *)cp->subgroups, cmd_len - sizeof(*cp)); + + for (uint8_t i = 0; i < param.num_subgroups; i++) { + struct bt_bap_bass_subgroup *subgroup = ¶m.subgroups[i]; + + /* If remaining data is less than the necessary subgroup fields, return failed */ + if (buf.len < sizeof(subgroup->bis_sync) + sizeof(subgroup->metadata_len)) { + return BTP_STATUS_FAILED; + } + + subgroup->bis_sync = net_buf_simple_pull_le32(&buf); + subgroup->metadata_len = net_buf_simple_pull_u8(&buf); + + if (subgroup->metadata_len > sizeof(subgroup->metadata) || + subgroup->metadata_len > buf.len) { + return BTP_STATUS_FAILED; + } + + memcpy(subgroup->metadata, net_buf_simple_pull_mem(&buf, subgroup->metadata_len), + subgroup->metadata_len); + } + + if (buf.len != 0U) { + return BTP_STATUS_FAILED; + } + + err = bt_bap_scan_delegator_add_src(¶m); + if (err < 0) { + return BTP_STATUS_VAL(err); + } + + rp->src_id = (uint8_t)err; + *rsp_len = sizeof(*rp); + + return BTP_STATUS_SUCCESS; +} + static bool broadcast_inited; int btp_bap_broadcast_init(void) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h index 3f4ef82b256c..a5fea384c45d 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h +++ b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h @@ -120,3 +120,5 @@ uint8_t btp_bap_broadcast_assistant_set_broadcast_code(const void *cmd, uint16_t void *rsp, uint16_t *rsp_len); uint8_t btp_bap_broadcast_assistant_send_past(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len); +uint8_t btp_bap_scan_delegator_add_src(const void *cmd, uint16_t cmd_len, + void *rsp, uint16_t *rsp_len); From d3ad2feac8318e3a36d6ffc9dd766ad0f259f72d Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 16 Sep 2025 13:08:22 +0100 Subject: [PATCH 0558/3334] [nrf fromtree] drivers: Fix some Kconfig bleeds Fixes instances of Kconfig options appearing for completely irrelevant builds Signed-off-by: Jamie McCrae (cherry picked from commit 8498c39e13845076668aaf42513c1904a969fbb6) --- drivers/adc/Kconfig.ad405x | 2 +- drivers/cache/Kconfig.nrf | 1 + drivers/cache/Kconfig.stm32 | 1 + drivers/timer/Kconfig.nrf_rtc | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/adc/Kconfig.ad405x b/drivers/adc/Kconfig.ad405x index 5abc89a8dd56..57298c82fa8c 100644 --- a/drivers/adc/Kconfig.ad405x +++ b/drivers/adc/Kconfig.ad405x @@ -13,6 +13,6 @@ config ADC_AD405X config AD405X_TRIGGER bool "AD405X interrupts" - default n + depends on ADC_AD405X help Enable interrupts for ADI AD405X. diff --git a/drivers/cache/Kconfig.nrf b/drivers/cache/Kconfig.nrf index c1cfc2c8c582..a308d14cc682 100644 --- a/drivers/cache/Kconfig.nrf +++ b/drivers/cache/Kconfig.nrf @@ -11,5 +11,6 @@ config CACHE_NRF_CACHE config CACHE_NRF_PATCH_LINEADDR bool "Patch lineaddr" default y if SOC_NRF54H20 + depends on DCACHE help Manually set 28th bit in the LINEADDR in Trustzone Secure build. diff --git a/drivers/cache/Kconfig.stm32 b/drivers/cache/Kconfig.stm32 index 6d468f98548d..3c97c614f67c 100644 --- a/drivers/cache/Kconfig.stm32 +++ b/drivers/cache/Kconfig.stm32 @@ -4,6 +4,7 @@ menuconfig CACHE_STM32 bool "STM32 cache driver" select CACHE_HAS_DRIVER + depends on SOC_FAMILY_STM32 depends on CACHE_MANAGEMENT help Enable support for the STM32 ICACHE / DCACHE peripheral present in some STM32 chips. diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index 82228d453caf..c596462a6e28 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -7,10 +7,10 @@ config NRF_RTC_TIMER bool "nRF Real Time Counter (NRF_RTC1) Timer" depends on CLOCK_CONTROL depends on SOC_COMPATIBLE_NRF + depends on !DT_HAS_NORDIC_NRF_RTC_ENABLED && !DT_HAS_NORDIC_NRF_GRTC_ENABLED select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT select NRFX_PPI if SOC_NRF52832 - depends on !$(dt_nodelabel_enabled,rtc1) help This module implements a kernel device driver for the nRF Real Time Counter NRF_RTC1 and provides the standard "system clock driver" From 208c846dffa54fc86e7304c7f66f871995c610c1 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Fri, 17 Oct 2025 19:02:24 +0200 Subject: [PATCH 0559/3334] [nrf fromtree] drivers timer nrf_rtc: Fix dependency 8498c39e13845076668aaf42513c1904a969fbb6 seems to have introduce an incorrect dependency which prevents the RTC timer from been built if any of the RTC's are enabled. It should only depend on the rtc1. Signed-off-by: Alberto Escolar Piedras (cherry picked from commit dd06e7ec72c0723ad9d78d9b11ee3a1702ef7b37) --- drivers/timer/Kconfig.nrf_rtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index c596462a6e28..1ddd473c01a0 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -7,7 +7,7 @@ config NRF_RTC_TIMER bool "nRF Real Time Counter (NRF_RTC1) Timer" depends on CLOCK_CONTROL depends on SOC_COMPATIBLE_NRF - depends on !DT_HAS_NORDIC_NRF_RTC_ENABLED && !DT_HAS_NORDIC_NRF_GRTC_ENABLED + depends on !$(dt_nodelabel_enabled,rtc1) && !DT_HAS_NORDIC_NRF_GRTC_ENABLED select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT select NRFX_PPI if SOC_NRF52832 From 97d1f6b0b478683a37c5e3b14cb589a1fb6ace5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 13 Oct 2025 10:34:32 +0200 Subject: [PATCH 0560/3334] [nrf fromtree] drivers: timer: nrf_rtc: Kconfig clean up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove redundant enabling of NRF_RTC_TIMER in SoC specific files and replace it with default y in the NRF_RTC_TIMER definition. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 182a6c62b140873c4ff284d13d6837fcf9029036) --- boards/native/nrf_bsim/Kconfig | 3 --- drivers/timer/Kconfig.nrf_rtc | 1 + soc/nordic/nrf51/Kconfig.defconfig | 4 ---- soc/nordic/nrf52/Kconfig.defconfig | 4 ---- soc/nordic/nrf53/Kconfig.defconfig | 4 ---- soc/nordic/nrf91/Kconfig.defconfig | 4 ---- 6 files changed, 1 insertion(+), 19 deletions(-) diff --git a/boards/native/nrf_bsim/Kconfig b/boards/native/nrf_bsim/Kconfig index 3596ccec0240..9df6cfd2243f 100644 --- a/boards/native/nrf_bsim/Kconfig +++ b/boards/native/nrf_bsim/Kconfig @@ -5,7 +5,6 @@ config BOARD_NRF52_BSIM bool select SOC_SERIES_BSIM_NRF52X select SOC_COMPATIBLE_NRF52833 - select NRF_RTC_TIMER select CLOCK_CONTROL help NRF52 simulation model @@ -16,7 +15,6 @@ config BOARD_NRF5340BSIM_NRF5340_CPUNET bool select SOC_SERIES_BSIM_NRF53X select SOC_COMPATIBLE_NRF5340_CPUNET - select NRF_RTC_TIMER select CLOCK_CONTROL help Simulated NRF53 Network core @@ -27,7 +25,6 @@ config BOARD_NRF5340BSIM_NRF5340_CPUAPP bool select SOC_SERIES_BSIM_NRF53X select SOC_COMPATIBLE_NRF5340_CPUAPP - select NRF_RTC_TIMER select CLOCK_CONTROL help Simulated NRF53 Application core diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index 1ddd473c01a0..c045f85f240c 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -11,6 +11,7 @@ config NRF_RTC_TIMER select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT select NRFX_PPI if SOC_NRF52832 + default y if SYS_CLOCK_EXISTS help This module implements a kernel device driver for the nRF Real Time Counter NRF_RTC1 and provides the standard "system clock driver" diff --git a/soc/nordic/nrf51/Kconfig.defconfig b/soc/nordic/nrf51/Kconfig.defconfig index 67f1eb86e39f..dad7aedf09c8 100644 --- a/soc/nordic/nrf51/Kconfig.defconfig +++ b/soc/nordic/nrf51/Kconfig.defconfig @@ -9,10 +9,6 @@ if SOC_SERIES_NRF51X config NUM_IRQS default 26 -# If the kernel has timer support, enable the timer -config NRF_RTC_TIMER - default y if SYS_CLOCK_EXISTS - config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_nodelabel_int_prop,rtc1,clock-frequency) diff --git a/soc/nordic/nrf52/Kconfig.defconfig b/soc/nordic/nrf52/Kconfig.defconfig index 7908f14561ef..a8220ea2f489 100644 --- a/soc/nordic/nrf52/Kconfig.defconfig +++ b/soc/nordic/nrf52/Kconfig.defconfig @@ -7,10 +7,6 @@ if SOC_SERIES_NRF52X rsource "Kconfig.defconfig.nrf52*" -# If the kernel has timer support, enable the timer -config NRF_RTC_TIMER - default y if SYS_CLOCK_EXISTS - config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_nodelabel_int_prop,rtc1,clock-frequency) diff --git a/soc/nordic/nrf53/Kconfig.defconfig b/soc/nordic/nrf53/Kconfig.defconfig index bd0b9cb6d27d..82974c027426 100644 --- a/soc/nordic/nrf53/Kconfig.defconfig +++ b/soc/nordic/nrf53/Kconfig.defconfig @@ -7,10 +7,6 @@ if SOC_SERIES_NRF53X rsource "Kconfig.defconfig.nrf53*" -# If the kernel has timer support, enable the timer -config NRF_RTC_TIMER - default y if SYS_CLOCK_EXISTS - config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_nodelabel_int_prop,rtc1,clock-frequency) diff --git a/soc/nordic/nrf91/Kconfig.defconfig b/soc/nordic/nrf91/Kconfig.defconfig index 81fce08e5dd4..bad2765c1b0c 100644 --- a/soc/nordic/nrf91/Kconfig.defconfig +++ b/soc/nordic/nrf91/Kconfig.defconfig @@ -7,10 +7,6 @@ if SOC_SERIES_NRF91X rsource "Kconfig.defconfig.nrf91*" -# If the kernel has timer support, enable the timer -config NRF_RTC_TIMER - default y if SYS_CLOCK_EXISTS - config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_nodelabel_int_prop,rtc1,clock-frequency) From 587ff49516a3d72bab7fe8c204ec45c8de3e6d59 Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Sat, 6 Sep 2025 16:01:19 -0400 Subject: [PATCH 0561/3334] [nrf fromtree] drivers: i2s: nrfx: Allow MCK bypass for proper LRCK and MCK Ratios nRF53 series SoCs have a dedicated configurable audio PLL and the ability to enable MCK bypass via a register value CONFIG.CLKCONFIG. This can enable higher MCK/LRCK ratios that some I2S peripherals require the host to generate. Allow an application developer to choose if they want to initially look for a bypass ratio and, if found, enable bypass in the NRFX driver. If not, the standard MCK calculation is conducted as normal. Signed-off-by: Sean O'Connor (cherry picked from commit 8115d9b453ecf694e42b285821cb9ba85409a4d6) --- drivers/i2s/Kconfig.nrfx | 8 +++++++ drivers/i2s/i2s_nrfx.c | 22 ++++++++++++++++++- .../echo/boards/nrf5340dk_nrf5340_cpuapp.conf | 7 ++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.conf diff --git a/drivers/i2s/Kconfig.nrfx b/drivers/i2s/Kconfig.nrfx index cc00ac1a9cc3..7337f9974c0f 100644 --- a/drivers/i2s/Kconfig.nrfx +++ b/drivers/i2s/Kconfig.nrfx @@ -21,6 +21,14 @@ config I2S_NRFX_TX_BLOCK_COUNT int "TX queue length" default 4 +config I2S_NRFX_ALLOW_MCK_BYPASS + bool "Allow MCK bypass if a ratio exists" + depends on SOC_SERIES_NRF53X + help + Search for a supported ratio directly from MCK and LRCK + and enable bypass if a ratio exists. If not, fallback to + the standard MCK selection mechanism. + endif # I2S_NRFX menuconfig I2S_NRF_TDM diff --git a/drivers/i2s/i2s_nrfx.c b/drivers/i2s/i2s_nrfx.c index 74f7046732f1..8c52fb42da30 100644 --- a/drivers/i2s/i2s_nrfx.c +++ b/drivers/i2s/i2s_nrfx.c @@ -95,6 +95,26 @@ static void find_suitable_clock(const struct i2s_nrfx_drv_cfg *drv_cfg, nrf_i2s_mck_t best_mck_cfg = 0; uint32_t best_mck = 0; +#if defined(CONFIG_I2S_NRFX_ALLOW_MCK_BYPASS) && NRF_I2S_HAS_CLKCONFIG + /* Check for bypass before calculating f_MCK */ + for (r = 0; r < ARRAY_SIZE(ratios); ++r) { + if (i2s_cfg->frame_clk_freq * ratios[r].ratio_val == src_freq) { + LOG_INF("MCK bypass calculated"); + best_r = r; + best_mck = src_freq; + best_diff = 0; + + /* Set CONFIG.MCKFREQ register to non-zero reset value to + * ensure peripheral functionality + */ + best_mck_cfg = NRF_I2S_MCK_32MDIV8; + + config->enable_bypass = true; + break; + } + } +#endif + for (r = 0; (best_diff != 0) && (r < ARRAY_SIZE(ratios)); ++r) { /* Only multiples of the frame width can be used as ratios. */ if ((ratios[r].ratio_val % bits_per_frame) != 0) { @@ -760,7 +780,7 @@ static int trigger_start(const struct device *dev) nrf_i2s_clk_configure(drv_cfg->i2s.p_reg, drv_cfg->clk_src == ACLK ? NRF_I2S_CLKSRC_ACLK : NRF_I2S_CLKSRC_PCLK32M, - false); + nrfx_cfg->enable_bypass); #endif /* If it is required to use certain HF clock, request it to be running diff --git a/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..df9df966798c --- /dev/null +++ b/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,7 @@ +# +# Copyright The Zephyr Project Contributors +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_I2S_NRFX_ALLOW_MCK_BYPASS=y From ec73f6e7bcfbaf72fc4b8f75c8c01ed7fec8ec2e Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Mon, 22 Sep 2025 08:00:26 -0400 Subject: [PATCH 0562/3334] [nrf fromtree] samples: i2s: echo: Enable nRF53 MCK output in I2S sample Enable the MCK output to a pin to allow for DAC and ADC clocking. Provides a MCK source to peripherals that can utilize an external clocking source for internal DSP processes, especially at higher MCK/LRCK ratios. Signed-off-by: Sean O'Connor (cherry picked from commit d1a7d1dde15820aca6a5222853d33c45427073ae) --- .../drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay index c68c24a56115..d34bfc4bf513 100644 --- a/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -22,7 +22,8 @@ i2s0_default_alt: i2s0_default_alt { group1 { - psels = , + psels = , + , , , ; From 21c44da12a6f7a8744d65e8237523bc375b1ab96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 17 Sep 2025 14:32:41 +0200 Subject: [PATCH 0563/3334] [nrf fromtree] samples: nordic: nrfx_prs: remove deprecated UARTE API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_uarte_rx is deprecated and will be soon removed. Replaced by new API. Signed-off-by: Michał Stasiak (cherry picked from commit 40f07a0532ed1ddabf33180eb2be0618bc19e832) --- samples/boards/nordic/nrfx_prs/src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/samples/boards/nordic/nrfx_prs/src/main.c b/samples/boards/nordic/nrfx_prs/src/main.c index 1b9411d2da43..e9e63e574d29 100644 --- a/samples/boards/nordic/nrfx_prs/src/main.c +++ b/samples/boards/nordic/nrfx_prs/src/main.c @@ -260,9 +260,15 @@ static bool uarte_transfer(const uint8_t *tx_data, size_t tx_data_len, { nrfx_err_t err; - err = nrfx_uarte_rx(&uarte, rx_buf, rx_buf_size); + err = nrfx_uarte_rx_buffer_set(&uarte, rx_buf, rx_buf_size); if (err != NRFX_SUCCESS) { - printk("nrfx_uarte_rx() failed: 0x%08x\n", err); + printk("nrfx_uarte_rx_buffer_set() failed: 0x%08x\n", err); + return false; + } + + err = nrfx_uarte_rx_enable(&uarte, NRFX_UARTE_RX_ENABLE_STOP_ON_END); + if (err != NRFX_SUCCESS) { + printk("nrfx_uarte_rx_enable() failed: 0x%08x\n", err); return false; } From b09e900646e464b339e19767fe000410058bc25d Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Thu, 27 Nov 2025 12:38:33 +0100 Subject: [PATCH 0564/3334] [nrf noup] boards: native: nrf_bsim: apply coding style This is a subset of upstream's commit: ccbc21bb32a873dd0480fd07c307acc2d51b1791 to prevent dependencies on other boards. Signed-off-by: Marcin Szymczyk --- boards/native/nrf_bsim/CMakeLists.txt | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/boards/native/nrf_bsim/CMakeLists.txt b/boards/native/nrf_bsim/CMakeLists.txt index 244133c1bd6a..a457bd3126d6 100644 --- a/boards/native/nrf_bsim/CMakeLists.txt +++ b/boards/native/nrf_bsim/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(BabbleSim) zephyr_library() if (CONFIG_BOARD_NRF54L15BSIM_NRF54L15_CPUFLPR) - message(FATAL_ERROR "Targeting the nrf54l15bsim/nrf54l15/cpuflpr core is not yet supported") + message(FATAL_ERROR "Targeting the nrf54l15bsim/nrf54l15/cpuflpr core is not yet supported") endif() # Due to the BLE controller assumption about enum size @@ -20,15 +20,15 @@ zephyr_compile_options( target_compile_options(native_simulator INTERFACE -fshort-enums) zephyr_library_sources( - irq_handler.c - cpu_wait.c - argparse.c - nsi_if.c - native_remap.c - soc/nrfx_coredep.c - common/bstests_entry.c - common/cmsis/cmsis.c - common/trace_hook.c + irq_handler.c + cpu_wait.c + argparse.c + nsi_if.c + native_remap.c + soc/nrfx_coredep.c + common/bstests_entry.c + common/cmsis/cmsis.c + common/trace_hook.c ) # Include sync_rtc from real SOC code if enabled @@ -37,18 +37,18 @@ zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC ) target_sources(native_simulator INTERFACE - common/bsim_args_runner.c - common/bsim_extra_cpu_if_stubs.c - common/phy_sync_ctrl.c - common/runner_hooks.c - common/posix_arch_if.c - common/trace_hook.c + common/bsim_args_runner.c + common/bsim_extra_cpu_if_stubs.c + common/phy_sync_ctrl.c + common/runner_hooks.c + common/posix_arch_if.c + common/trace_hook.c ) if (CONFIG_IPC_SERVICE AND CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUAPP) - zephyr_library_sources( - ipc_backend.c - ) + zephyr_library_sources( + ipc_backend.c + ) endif() zephyr_include_directories( @@ -70,17 +70,17 @@ zephyr_library_include_directories( set(libpath ${BSIM_OUT_PATH}/lib) set_property(TARGET native_simulator APPEND PROPERTY RUNNER_LINK_LIBRARIES - ${libpath}/libUtilv1.32.a - ${libpath}/libPhyComv1.32.a - ${libpath}/lib2G4PhyComv1.32.a - ${libpath}/libRandv2.32.a + ${libpath}/libUtilv1.32.a + ${libpath}/libPhyComv1.32.a + ${libpath}/lib2G4PhyComv1.32.a + ${libpath}/libRandv2.32.a ) target_compile_options(native_simulator INTERFACE "-DNSI_PRIMARY_MCU_N=${CONFIG_NATIVE_SIMULATOR_PRIMARY_MCU_INDEX}") add_subdirectory(${ZEPHYR_BASE}/boards/native/common/extra_args/ - ${CMAKE_CURRENT_BINARY_DIR}/extra_args + ${CMAKE_CURRENT_BINARY_DIR}/extra_args ) include(../common/natsim_config.cmake) From adb16c7762b7229b523aafa32b7ee2f397599226 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Thu, 27 Nov 2025 12:45:03 +0100 Subject: [PATCH 0565/3334] [nrf noup] scripts: ci: check_compliance: fix whitespace This is a subset of upstream's commit: f2af86471220b4d269d006ad44c9a2bfe19f62aa to prevent further dependencies. Signed-off-by: Marcin Szymczyk --- scripts/ci/check_compliance.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 16aacd4c6a80..912dbdad48e3 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1401,10 +1401,10 @@ def check_no_undef_outside_kconfig(self, kconf): "SECURITY_LOADPIN", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "SEL", "SHIFT", - "SINGLE_APPLICATION_SLOT", # Used in sysbuild for MCUboot configuration - "SINGLE_APPLICATION_SLOT_RAM_LOAD", # Used in sysbuild for MCUboot configuration - "SOC_SDKNG_UNSUPPORTED", # Used in modules/hal_nxp/mcux/CMakeLists.txt - "SOC_SERIES_", # Used as regex in scripts/utils/board_v1_to_v2.py + "SINGLE_APPLICATION_SLOT", # Used in sysbuild for MCUboot configuration + "SINGLE_APPLICATION_SLOT_RAM_LOAD", # Used in sysbuild for MCUboot configuration + "SOC_SDKNG_UNSUPPORTED", # Used in modules/hal_nxp/mcux/CMakeLists.txt + "SOC_SERIES_", # Used as regex in scripts/utils/board_v1_to_v2.py "SOC_WATCH", # Issue 13749 "SOME_BOOL", "SOME_INT", From 9f426c320d6f163ac60b4bd4c323413f032b8369 Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Fri, 21 Feb 2025 16:59:33 +0100 Subject: [PATCH 0566/3334] [nrf noup] modules: hal_nordic: cleanup nrfx_config nrf-squash! [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS - Remove temporary workaround for SDC in nrfx's reserved resources. - Modify NCS reserved resources to use upstream version with additions instead of creating new file - Align filename Signed-off-by: Marcin Szymczyk --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ------------------ .../nrfx/nrfx_reserved_resources_ncs.h | 217 ++++ 3 files changed, 218 insertions(+), 949 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h create mode 100644 modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 15ba5475436c..6065abbf86d6 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -1308,6 +1308,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_config_reserved_resources_ncs.h" + default "nrfx_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h deleted file mode 100644 index ec8a9acaf7b5..000000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h +++ /dev/null @@ -1,948 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ -#define NRFX_CONFIG_RESERVED_RESOURCES_H__ - -/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE130_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) - -/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE131_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) - -/** @brief Bitmask that defines EGU instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_EGUS_USED 0 - -/** @brief Bitmask that defines TIMER instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_TIMERS_USED 0 - -/* If the GRTC system timer driver is to be used, prepare definitions required - * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and - * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. - */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ - (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ - ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ - (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ - DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ - -/* - * The enabled Bluetooth controller subsystem is responsible for providing - * definitions of the BT_CTLR_USED_* symbols used below in a file named - * bt_ctlr_used_resources.h and for adding its location to global include - * paths so that the file can be included here for all Zephyr libraries that - * are to be built. - */ -#if defined(CONFIG_BT_LL_SW_SPLIT) -#include -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#endif -#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ - -#if defined(CONFIG_BT_LL_SOFTDEVICE) -/* Define auxiliary symbols needed for SDC device dispatch. */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRF52_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRF53_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRF54L_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF71X) -#define NRF71_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRF54H_SERIES -#endif -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) -#else -#error Unsupported chip family -#endif -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ - -#if defined(CONFIG_NRF_802154_RADIO_DRIVER) -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#include <../src/nrf_802154_peripherals_nrf52.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#include <../src/nrf_802154_peripherals_nrf53.h> -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#include <../src/nrf_802154_peripherals_nrf54l.h> -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#include <../src/nrf_802154_peripherals_nrf54h.h> -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ - -#if defined(CONFIG_MPSL) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ - (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif - -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL -#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL -#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL -#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL -#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL -#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL -#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL -#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL -#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL -#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL -#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL -#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL -#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL -#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL -#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL -#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL -#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL -#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 -#endif - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) - -BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_CHANNELS_USED \ - (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI0_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_GROUPS_USED \ - (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI0_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_CHANNELS_USED \ - (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI00_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_GROUPS_USED \ - (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI00_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_CHANNELS_USED \ - (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI10_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_GROUPS_USED \ - (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI10_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_CHANNELS_USED \ - (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI20_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_GROUPS_USED \ - (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI20_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_CHANNELS_USED \ - (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI30_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_GROUPS_USED \ - (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI30_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_CHANNELS_USED \ - (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI020_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_GROUPS_USED \ - (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI020_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_CHANNELS_USED \ - (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI030_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_GROUPS_USED \ - (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI030_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_CHANNELS_USED \ - (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI120_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_GROUPS_USED \ - (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI120_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_CHANNELS_USED \ - (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI130_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_GROUPS_USED \ - (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI130_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_CHANNELS_USED \ - (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI131_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_GROUPS_USED \ - (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI131_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_CHANNELS_USED \ - (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI132_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_GROUPS_USED \ - (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI132_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_CHANNELS_USED \ - (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI133_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_GROUPS_USED \ - (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI133_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_CHANNELS_USED \ - (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI134_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_GROUPS_USED \ - (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI134_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_CHANNELS_USED \ - (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI135_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_GROUPS_USED \ - (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI135_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_CHANNELS_USED \ - (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI136_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_GROUPS_USED \ - (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI136_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines PPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_CHANNELS_USED \ - (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) - -#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED -#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED - -/** @brief Bitmask that defines PPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_GROUPS_USED \ - (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) - -#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ - (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ - (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ - (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ - (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ - (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ - (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ - (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ - NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) - -#if defined(CONFIG_SOFTDEVICE) -#include -#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED -#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED -#else -#define NRFX_PPI_CHANNELS_USED_BY_SD 0 -#define NRFX_PPI_GROUPS_USED_BY_SD 0 -#endif - -#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h new file mode 100644 index 000000000000..2c1fe3640493 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_RESERVED_RESOURCES_NCS_H__ +#define NRFX_RESERVED_RESOURCES_NCS_H__ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#include "nrfx_reserved_resources.h" + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ +#endif /* NRFX_RESERVED_RESOURCES_NCS_H__ */ From c955bb5ea15584ffcd3c22d1347ceff352548954 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Wed, 19 Nov 2025 11:37:26 +0100 Subject: [PATCH 0567/3334] [nrf noup] dts: nordic: remove leftover file File no longer needed, can be removed. Signed-off-by: Jakub Zymelka --- dts/vendor/nordic/nrf54l20.dtsi | 852 -------------------------------- 1 file changed, 852 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi deleted file mode 100644 index bee70effa0e8..000000000000 --- a/dts/vendor/nordic/nrf54l20.dtsi +++ /dev/null @@ -1,852 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -/delete-node/ &sw_pwm; - -/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ -#define NRF_DOMAIN_ID_APPLICATION 0 -#define NRF_DOMAIN_ID_FLPR 1 - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@0 { - compatible = "arm,cortex-m33f"; - reg = <0>; - device_type = "cpu"; - clocks = <&hfpll>; - #address-cells = <1>; - #size-cells = <1>; - - itm: itm@e0000000 { - compatible = "arm,armv8m-itm"; - reg = <0xe0000000 0x1000>; - swo-ref-frequency = ; - }; - }; - - cpuflpr: cpu@1 { - compatible = "nordic,vpr"; - reg = <1>; - device_type = "cpu"; - riscv,isa = "rv32emc"; - nordic,bus-width = <64>; - }; - }; - - clocks { - pclk: pclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - pclk32m: pclk32m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfxo: lfxo { - compatible = "nordic,nrf54l-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf54l-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1650>; - }; - - hfpll: hfpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - aclk: aclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - ficr: ficr@ffc000 { - compatible = "nordic,nrf-ficr"; - reg = <0xffc000 0x1000>; - #nordic,ficr-cells = <1>; - }; - - uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; - reg = <0xffd000 0x1000>; - }; - - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(447)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 0x6fc00>; - }; - - cpuflpr_sram: memory@2006fc00 { - compatible = "mmio-sram"; - reg = <0x2006fc00 DT_SIZE_K(64)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2006fc00 0x10000>; - }; - - global_peripherals: peripheral@50000000 { - ranges = <0x0 0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - - dppic00: dppic@42000 { - compatible = "nordic,nrf-dppic"; - reg = <0x42000 0x808>; - status = "disabled"; - }; - - ppib00: ppib@44000 { - compatible = "nordic,nrf-ppib"; - reg = <0x44000 0x1000>; - status = "disabled"; - }; - - ppib01: ppib@45000 { - compatible = "nordic,nrf-ppib"; - reg = <0x45000 0x1000>; - status = "disabled"; - }; - - cpuflpr_vpr: vpr@4c000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x4c000 0x1000>; - ranges = <0x0 0x4c000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - status = "disabled"; - enable-secure; - - cpuflpr_clic: interrupt-controller@f0000000 { - compatible = "nordic,nrf-clic"; - reg = <0xf0000000 0x143c>; - interrupt-controller; - #interrupt-cells = <2>; - #address-cells = <1>; - status = "disabled"; - }; - }; - - spi00: spi@4d000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart00: uart@4d000 { - compatible = "nordic,nrf-uarte"; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - gpio2: gpio@50400 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x50400 0x300>; - #gpio-cells = <2>; - ngpios = <11>; - status = "disabled"; - port = <2>; - }; - - timer00: timer@55000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x55000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - prescaler = <0>; - }; - - dppic10: dppic@82000 { - compatible = "nordic,nrf-dppic"; - reg = <0x82000 0x808>; - status = "disabled"; - }; - - ppib10: ppib@83000 { - compatible = "nordic,nrf-ppib"; - reg = <0x83000 0x1000>; - status = "disabled"; - }; - - ppib11: ppib@84000 { - compatible = "nordic,nrf-ppib"; - reg = <0x84000 0x1000>; - status = "disabled"; - }; - - timer10: timer@85000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x85000 0x1000>; - cc-num = <8>; - max-bit-width = <32>; - interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - prescaler = <0>; - }; - - egu10: egu@87000 { - compatible = "nordic,nrf-egu"; - reg = <0x87000 0x1000>; - interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - radio: radio@8a000 { - compatible = "nordic,nrf-radio"; - reg = <0x8a000 0x1000>; - interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - dfe-supported; - ieee802154-supported; - ble-2mbps-supported; - ble-coded-phy-supported; - cs-supported; - - ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; - }; - - dppic20: dppic@c2000 { - compatible = "nordic,nrf-dppic"; - reg = <0xc2000 0x808>; - status = "disabled"; - }; - - ppib20: ppib@c3000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc3000 0x1000>; - status = "disabled"; - }; - - ppib21: ppib@c4000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc4000 0x1000>; - status = "disabled"; - }; - - ppib22: ppib@c5000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc5000 0x1000>; - status = "disabled"; - }; - - i2c20: i2c@c6000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi20: spi@c6000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart20: uart@c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c21: i2c@c7000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi21: spi@c7000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart21: uart@c7000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c22: i2c@c8000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi22: spi@c8000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart22: uart@c8000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - egu20: egu@c9000 { - compatible = "nordic,nrf-egu"; - reg = <0xc9000 0x1000>; - interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - timer20: timer@ca000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xca000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer21: timer@cb000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcb000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer22: timer@cc000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcc000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer23: timer@cd000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcd000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer24: timer@ce000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xce000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - pdm20: pdm@d0000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd0000 0x1000>; - interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pdm21: pdm@d1000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd1000 0x1000>; - interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pwm20: pwm@d2000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd2000 0x1000>; - interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm21: pwm@d3000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd3000 0x1000>; - interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm22: pwm@d4000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd4000 0x1000>; - interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - adc: adc@d5000 { - compatible = "nordic,nrf-saadc"; - reg = <0xd5000 0x1000>; - interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - zephyr,pm-device-runtime-auto; - }; - - nfct: nfct@d6000 { - compatible = "nordic,nrf-nfct"; - reg = <0xd6000 0x1000>; - interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - temp: temp@d7000 { - compatible = "nordic,nrf-temp"; - reg = <0xd7000 0x1000>; - interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio1: gpio@d8200 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8200 0x300>; - #gpio-cells = <2>; - ngpios = <16>; - status = "disabled"; - port = <1>; - gpiote-instance = <&gpiote20>; - }; - - gpiote20: gpiote@da000 { - compatible = "nordic,nrf-gpiote"; - reg = <0xda000 0x1000>; - status = "disabled"; - instance = <20>; - }; - - qdec20: qdec@e0000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe0000 0x1000>; - interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - qdec21: qdec@e1000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe1000 0x1000>; - interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - grtc: grtc@e2000 { - compatible = "nordic,nrf-grtc"; - reg = <0xe2000 0x1000>; - cc-num = <12>; - clocks = <&lfxo>, <&pclk>; - clock-names = "lfclock", "hfclock"; - status = "disabled"; - }; - - tdm: tdm@e8000 { - compatible = "nordic,nrf-tdm"; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xe8000 0x1000>; - interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - clocks = <&pclk32m>; - }; - - i2c23: i2c@ed000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi23: spi@ed000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart23: uart@ed000 { - compatible = "nordic,nrf-uarte"; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c24: i2c@ee000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi24: spi@ee000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart24: uart@ee000 { - compatible = "nordic,nrf-uarte"; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - dppic30: dppic@102000 { - compatible = "nordic,nrf-dppic"; - reg = <0x102000 0x808>; - status = "disabled"; - }; - - ppib30: ppib@103000 { - compatible = "nordic,nrf-ppib"; - reg = <0x103000 0x1000>; - status = "disabled"; - }; - - i2c30: i2c@104000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi30: spi@104000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart30: uart@104000 { - compatible = "nordic,nrf-uarte"; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - comp: comparator@106000 { - /* - * Use compatible "nordic,nrf-comp" to configure as COMP - * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP - */ - compatible = "nordic,nrf-comp"; - reg = <0x106000 0x1000>; - status = "disabled"; - interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - wdt30: watchdog@108000 { - compatible = "nordic,nrf-wdt"; - reg = <0x108000 0x620>; - interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - wdt31: watchdog@109000 { - compatible = "nordic,nrf-wdt"; - reg = <0x109000 0x620>; - interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio0: gpio@10a000 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x10a000 0x300>; - #gpio-cells = <2>; - ngpios = <5>; - status = "disabled"; - port = <0>; - gpiote-instance = <&gpiote30>; - }; - - gpiote30: gpiote@10c000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x10c000 0x1000>; - status = "disabled"; - instance = <30>; - }; - - clock: clock@10e000 { - compatible = "nordic,nrf-clock"; - reg = <0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@51c { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x51c 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@520 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x520 0x1>; - status = "disabled"; - }; - }; - - regulators: regulator@120000 { - compatible = "nordic,nrf54l-regulators"; - reg = <0x120000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - vregmain: regulator@120600 { - compatible = "nordic,nrf5x-regulator"; - reg = <0x120600 0x1>; - status = "disabled"; - regulator-name = "VREGMAIN"; - regulator-initial-mode = ; - }; - }; - }; - - rram_controller: rram-controller@5004e000 { - compatible = "nordic,rram-controller"; - reg = <0x5004e000 0x1000>; - interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(1972)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - - cpuflpr_rram: rram@1ed000 { - compatible = "soc-nv-flash"; - reg = <0x1ed000 DT_SIZE_K(64)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_nvic: interrupt-controller@e000e100 { - #address-cells = <1>; - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - }; - }; -}; From d8c5d09633195314cd075c0d107abe428f15ac4e Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Mon, 13 Oct 2025 13:24:33 +0200 Subject: [PATCH 0568/3334] [nrf fromtree] manifest: Update nRF hw models to latest Update the HW models module to: 26ed181181eed53e400db8f63fa83c566a05d971 Including the following: 26ed181 54L CLOCK: Fix: Handle clock being stopped before it is fully started b643b28 54L CLOCK: Account for relationship between PLLs and XO Signed-off-by: Alberto Escolar Piedras (cherry picked from commit 4ef316c72dbf9d228631f784c163c17260d6901f) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index a00bfc9e1318..f938869b8171 100644 --- a/west.yml +++ b/west.yml @@ -334,7 +334,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 40403f5f2805cca210d2a47c8717d89c4e816cda + revision: 26ed181181eed53e400db8f63fa83c566a05d971 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: e269670cd17fb8ccc4b7004544276bc7d9578496 From 8a44eee8188abfe4b8460275fc689a0320e162a2 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 30 Sep 2025 11:07:54 +0100 Subject: [PATCH 0569/3334] [nrf fromtree] west.yml: MCUboot synchronization from upstream Update Zephyr fork of MCUboot to revision: d5b0dcb9aaee397fc105ae2228e8030038c3d871 Brings following Zephyr relevant fixes: - d5b0dcb9 hooks: Use dedicated type for slot numbers - cf138a0f boot: zephyr: config: Introduce MCUBOOT_BOOT_MAX_ALIGN Kconfig symbol - 677f1602 boot: zephyr: boards: delete frdm_mcxa156 configuration - 3c8e5717 zephyr: nRF54L05 and L10 configuration with LTO enabled - 4ea993ce zephyr: Remove duplicate zephyr module line - 8d14eebf boot: bootutil: Fix upgrade only serial recovery slot info - 78f87cf3 boot: zephyr: boards config of the variant stm32 disco kit - cbd3310e boot: zephyr: get base addres from dts for flexspi devices - 425e22be boot/zephyr: fix compilation errors in logging. - ec26273f bootutil: fix null pointer dereference in logging. - 3eb23a5d zephyr: Kconfig to control MCUBOOT_USE_TLV_ALLOW_LIST - a13624f0 bootutil: Add MCUBOOT_USE_TLV_ALLOW_LIST - e375252c boot: Enable Encryption with PSA + ECDSA - 21ed226f boot: bootutil: Fix bootutil_find_key definition - 763be6a5 imgtool: Add sha512 to allowed configurations for ECDSA256P1 - 59d2f7a5 imgtool: Add support for VID and CID - 94ad4d44 boot: Add VID and CID checks Signed-off-by: Jamie McCrae (cherry picked from commit 3cd292af8c37e42634e73e2dcae04a9aa2e2152e) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f938869b8171..3a6ecf61d3e9 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: aa4fa2b6e17361dd3ce16a60883059778fd147a9 + revision: d5b0dcb9aaee397fc105ae2228e8030038c3d871 path: bootloader/mcuboot groups: - bootloader From 71fef903089ef858abac2496eb95e69770cde6e5 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 10 Oct 2025 11:53:01 +0100 Subject: [PATCH 0570/3334] [nrf fromtree] west.yml: MCUboot synchronization from upstream Update Zephyr fork of MCUboot to revision: 48b0f6da9af8d009eb8eafba023998a7d85320a1 Brings following Zephyr relevant fixes: - 48b0f6da imgtool: support producing images in test mode - 2b9f2a2f boot: zephyr: fix getting base address for certain boards - 028d80c3 bootutil: Move boot_enc_init in boot_swap_image - 15d43f20 zephyr: Deprecate MCUBOOT_VERIFY_IMG_ADDRESS - fd2c1428 zephyr: Added MCUBOOT_CHECK_HEADER_LOAD_ADDRESS Kconfig - 1035cc01 bootutil: Add MCUBOOT_CHECK_HEADER_LOAD_ADDRESS - 17a6ecd2 boot: bootutil: fix image_index definition - cc985298 boot: zephyr: Fix IO-based entrance method - 9ca08817 bootutil: Fix minor issues - 8a07053d bootutil: Fix log module registration - 5e1be19f boot: bootutil: write_sz fix - aed3fb95 docs: Add release note entry for MCUBOOT_BOOT_MAX_ALIGN Zephyr change Signed-off-by: Jamie McCrae (cherry picked from commit 6f41b3e2a2bd654989e98e7c0842c063f27c6da7) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 3a6ecf61d3e9..eb77d89c14d6 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: d5b0dcb9aaee397fc105ae2228e8030038c3d871 + revision: 48b0f6da9af8d009eb8eafba023998a7d85320a1 path: bootloader/mcuboot groups: - bootloader From b73862f688494edb7c865cb3239a70c05ba2cde2 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 16 Oct 2025 07:25:38 +0100 Subject: [PATCH 0571/3334] [nrf fromtree] west.yml: MCUboot synchronization from upstream Update Zephyr fork of MCUboot to revision: b192716c969ad358bb3a1db60c898212f3275c55 Brings following Zephyr relevant fixes: - b192716c Revert "loader: Allow to specify slot number in version" - 5b7bccf9 boot: bootutil: swap_offset: Fix not including unprotected TLVs - ee9efe01 bootutil: Replace boot_write_enc_key with boot_write_enc_keys - 80a39c64 bootutil: Replace literal slot indexes with identifiers Signed-off-by: Jamie McCrae (cherry picked from commit fbdc8b2d7bbf257804f22bd5b00673ab39e31065) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index eb77d89c14d6..fc29f7220831 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: 48b0f6da9af8d009eb8eafba023998a7d85320a1 + revision: b192716c969ad358bb3a1db60c898212f3275c55 path: bootloader/mcuboot groups: - bootloader From ecc1e391d4d94fbd8772446a1af811c7829f1079 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 24 Oct 2025 10:36:03 +0100 Subject: [PATCH 0572/3334] [nrf fromtree] west.yml: MCUboot synchronization from upstream Update Zephyr fork of MCUboot to revision: 96576b341ee19f1c3af6622256b0d4f3d408e1e3 Brings following Zephyr relevant fixes: - 96576b34 boot: zephyr: socs: stm32h7s7xx: Add support for ext_flash_app variant - 56538cf6 bootutil: Move update-independent code - fccd8905 loader: Move boot_get_max_app_size(..) API - 0248a023 bootutil: Move state-independent area APIs - f2d3f00a loader: Unify image check API. - dcc66e51 loader: Unify header_valid(..) API - 257265c8 loader: Optimize boot_check_header_erased(..) - 76e56e4f loader: Rename boot_version_cmp - 5311589b loader: Fix compile-time issues in loader.c - 606a1934 boot: zephyr: socs: add overlay & conf for stm32h573xx_ext_flash_app - 521fc0bf bootutil: Conditionally include mbedtls/ oid.h, asn1.h - 71b41e38 boot: zephyr: boards: remove nrf54h20dk overlay - 2fc1bd84 bootutil: Drop slot number and boot_state from most boot_enc functions - 1dd8ae60 boot: zephyr: rework stm32h750b_dk board overlay & conf Signed-off-by: Jamie McCrae (cherry picked from commit cd2079f23c191558f472bc00dfd294da67e14eed) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index fc29f7220831..cb93fab23d7d 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: b192716c969ad358bb3a1db60c898212f3275c55 + revision: 96576b341ee19f1c3af6622256b0d4f3d408e1e3 path: bootloader/mcuboot groups: - bootloader From 6c03cfe038ba037eedfedfe21d05753457d39731 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 5 Nov 2025 14:09:13 +0000 Subject: [PATCH 0573/3334] [nrf fromtree] west.yml: MCUboot synchronization from upstream Update Zephyr fork of MCUboot to revision: f3cc9476e233364031e9ab842290392f260fba82 Brings following Zephyr relevant fixes: - f3cc9476 updates for 2.3.0-rc1 release - 496f74f3 zephyr: Fix BOOT_DOWNGRADE_PREVENTION_CHOICE symbol - 6ab9afc6 boot_serial: Use boot_state_init where intent to initialize - e6fefac2 bootutil: Temporarly drop mem cleanup from boot_state_clear - 457be0cf bootutil: Fix some debug log format specifiers - f9ad3ee2 bootutil: Add API to lock HW counter - 6e602004 boot: bootutil: bootutil_area: Add debug for adjusted offset - 9d334f9b boot: bootutil: bootutil_area: Fix swap using offset min scramble - 76036133 boot: zephyr: Remove enable from beginning of prompts - d14ba22d bootutil: Fix encryption context de initialization in boot_state_clear - d8c4cc69 bootutil: Remove NULL state logic from boot_state_clear - 8ff6b678 bootutil: Use boot_state_init instead of boot_state_clear - dd4b01f4 boot_serial: Initialize state with boot_state_init - a312656b bootutil: Add boot_loader_state_init - e9255183 bootutil: Allow using psa_key_id_t in AES crypto context - 3af40a31 boot: zephyr: sysflash: Increase number of supported images - c27bb0f4 boot_serial: Use struct enc_data in decrypt_region_inplace - 0287fd4d boot_serial: Fix double boot_loader_state init - f846e9e9 boot: zephyr: Allow disabling default multiple RAM region file - 0ccce2f7 bootutil: In boot_swap_image add return check from boot_read_enc_key - 32b3c18b bootutil: Refactor boot_read_enc_key Signed-off-by: Jamie McCrae (cherry picked from commit 881584112f75da8876f62d6e908b12bbd189b1bb) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index cb93fab23d7d..88309aa8ec8a 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: 96576b341ee19f1c3af6622256b0d4f3d408e1e3 + revision: f3cc9476e233364031e9ab842290392f260fba82 path: bootloader/mcuboot groups: - bootloader From b2e99f13e92ce8d89a2701586e2b2c1f19de1d90 Mon Sep 17 00:00:00 2001 From: Sudan Landge Date: Thu, 9 Oct 2025 10:01:33 +0100 Subject: [PATCH 0574/3334] [nrf fromtree] manifest: update TF-M to fix MPS4 warnings Use TF-M that has cherry-picked commits from upstream to fix compiler warnings for MPS4. Signed-off-by: Sudan Landge (cherry picked from commit ddb0da152179d75dddddd3eded83850a171d2550) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 88309aa8ec8a..dcbde3f118e7 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 3e12b0cc27d828d7ec04c4ac62ad45a9a905573e + revision: 591f37f31a882208e7b1ddb8e053a4bdf72c68ed path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 519fe4d8d99df4373377f0ed3e2b453f2c6a0296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Thu, 9 Oct 2025 16:03:30 +0200 Subject: [PATCH 0575/3334] [nrf fromtree] manifest: Update commit id for trusted-firmware-m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update commit id for trusted-firmware-m to bring in support for nRF54LM20A/ns. Signed-off-by: Dag Erik Gjørvad (cherry picked from commit e151273543997b1d390ee8e660422c1e92bdf65d) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index dcbde3f118e7..202d9fa4e44a 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 591f37f31a882208e7b1ddb8e053a4bdf72c68ed + revision: 62ad723311da2cac938e2ae88bafe9e815b3b248 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 3866eb9fadf1d90bc7f1c1ea4ad4469274f3b684 Mon Sep 17 00:00:00 2001 From: Tim Pambor Date: Wed, 22 Oct 2025 10:01:49 +0200 Subject: [PATCH 0576/3334] [nrf fromtree] west.yml: Bump TF-M to include fixes for stm32h5 Bump TF-M to fix a linker error and address several warnings when compiling for STM32H5. Signed-off-by: Tim Pambor (cherry picked from commit 473d90ba6294aa7bda0a620f9327b768a88d29ab) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 202d9fa4e44a..2fdc2969a4be 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 62ad723311da2cac938e2ae88bafe9e815b3b248 + revision: 94691a2ed0d9a2802b3419eaa91958329c36871b path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 081d8659e84a25efdf5a049bcadc3b6d953d156c Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Fri, 22 Aug 2025 13:21:23 +0200 Subject: [PATCH 0577/3334] [nrf fromtree] west.yml: Bump TF-M to fix FOTA upgrade regression Update TF-M to include fixes restoring FOTA upgrade compatibility between Zephyr v3.7.1 and v4.3.0. This fix allow both forward and rollback upgrades. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit 9a455998a4ffae941f1023e32e1f29f7cb43449e) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 2fdc2969a4be..f05cbb3f260f 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 94691a2ed0d9a2802b3419eaa91958329c36871b + revision: d3341a660f2f33156e1a8bb8ea47ad83066defea path: modules/tee/tf-m/trusted-firmware-m groups: - tee From d3533471ccc2a5c3de94ebf63ef5856470550703 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Mon, 10 Nov 2025 15:20:13 +0100 Subject: [PATCH 0578/3334] [nrf fromtree] manifest: tf-m: align Mbed TLS header files to v3.6.5 Update manifest to align the copy of Mbed TLS header files which lives in the TF-M repository to what's in Mbed TLS release v3.6.5. Signed-off-by: Valerio Setti (cherry picked from commit e0fdb8792992c3b12f7bf13e629713fe80f7cf8b) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f05cbb3f260f..ec5d79378e19 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: d3341a660f2f33156e1a8bb8ea47ad83066defea + revision: 04aa7243e04946b5422b124bea9c0675ab6b120f path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 428ce9f27bc368f8023de98cdd494b060374962b Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Fri, 31 Oct 2025 16:21:51 +0100 Subject: [PATCH 0579/3334] [nrf fromtree] nordic: update and align to nrfx 4.0.1 New nrfx release contains major rework of nrfx drivers instantiation making it easier to integrate with dts nodes. Now, nrfx driver instances can no longer be `const` because they contain driver runtime state. Additionally, all nrfx drivers return `errno` error codes instead of deprecated `nrfx_err_t`. Signed-off-by: Nikodem Kastelik (cherry picked from commit ad1e5ac2538c13f855c0591d164b9b434b2fd129) --- boards/native/nrf_bsim/CMakeLists.txt | 9 + boards/native/nrf_bsim/common/cmsis/cmsis.h | 2 +- boards/native/nrf_bsim/gpiote_nrfx_bsim.c | 39 + boards/native/nrf_bsim/soc/soc_secure.h | 2 +- drivers/adc/adc_nrfx_adc.c | 6 +- drivers/adc/adc_nrfx_saadc.c | 283 ++--- drivers/audio/Kconfig.dmic_pdm_nrfx | 4 +- drivers/audio/dmic_nrfx_pdm.c | 397 ++----- drivers/clock_control/clock_control_nrf.c | 9 +- drivers/comparator/comparator_nrf_common.h | 53 - drivers/comparator/comparator_nrf_comp.c | 281 +---- drivers/comparator/comparator_nrf_lpcomp.c | 130 +-- drivers/counter/Kconfig.nrfx | 3 +- drivers/counter/counter_nrfx_rtc.c | 60 +- drivers/display/Kconfig.nrf_led_matrix | 2 +- drivers/display/display_nrf_led_matrix.c | 48 +- drivers/entropy/entropy_nrf_cracen.c | 14 +- drivers/flash/nrf_qspi_nor.c | 125 +-- drivers/flash/soc_flash_nrf.c | 5 +- drivers/flash/soc_flash_nrf_mramc.c | 8 +- drivers/gpio/gpio_nrfx.c | 134 ++- drivers/i2c/Kconfig.nrfx | 38 +- drivers/i2c/i2c_nrfx_twi.c | 87 +- drivers/i2c/i2c_nrfx_twi_common.c | 25 +- drivers/i2c/i2c_nrfx_twim.c | 199 ++-- drivers/i2c/i2c_nrfx_twim_common.c | 44 +- drivers/i2c/i2c_nrfx_twim_common.h | 17 +- drivers/i2c/i2c_nrfx_twim_rtio.c | 141 +-- drivers/i2c/i2c_nrfx_twis.c | 221 ++-- drivers/i2s/Kconfig.nrfx | 3 +- drivers/i2s/i2s_nrfx.c | 332 ++---- drivers/mspi/mspi_dw_vendor_specific.h | 2 +- drivers/pwm/Kconfig.nrfx | 13 +- drivers/pwm/pwm_nrf_sw.c | 69 +- drivers/pwm/pwm_nrfx.c | 210 ++-- drivers/sensor/nordic/qdec_nrfx/Kconfig | 7 +- drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c | 144 ++- drivers/serial/Kconfig.nrfx | 30 +- drivers/serial/uart_nrfx_uarte.c | 75 +- drivers/spi/Kconfig.nrfx | 64 +- drivers/spi/spi_nrfx_common.c | 14 +- drivers/spi/spi_nrfx_common.h | 16 +- drivers/spi/spi_nrfx_spi.c | 19 +- drivers/spi/spi_nrfx_spim.c | 292 ++---- drivers/spi/spi_nrfx_spis.c | 127 +-- drivers/timer/Kconfig.nrf_rtc | 2 +- drivers/timer/nrf_grtc_timer.c | 75 +- drivers/timer/nrf_rtc_timer.c | 15 +- .../nrf_usbd_common/nrf_usbd_common_errata.h | 1 - drivers/usb/udc/udc_dwc2_vendor_quirks.h | 2 +- drivers/watchdog/Kconfig.nrfx | 10 +- drivers/watchdog/wdt_nrfx.c | 147 +-- dts/arm/nordic/nrf52805.dtsi | 2 +- dts/arm/nordic/nrf52810.dtsi | 8 +- dts/arm/nordic/nrf52811.dtsi | 2 +- dts/arm/nordic/nrf52832.dtsi | 8 +- dts/arm/nordic/nrf52833.dtsi | 2 +- dts/arm/nordic/nrf52840.dtsi | 8 +- dts/arm/nordic/nrf5340_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuappns.dtsi | 2 +- dts/arm/nordic/nrf91.dtsi | 2 +- dts/arm/nordic/nrf91ns.dtsi | 2 +- dts/bindings/spi/nordic,nrf-spim.yaml | 7 - dts/vendor/nordic/nrf54h20.dtsi | 2 +- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 3 +- dts/vendor/nordic/nrf54lm20a.dtsi | 5 +- dts/vendor/nordic/nrf9280.dtsi | 2 +- include/zephyr/drivers/gpio/gpio_nrf.h | 27 + .../dt-bindings/adc/nrf-saadc-haltium.h | 19 - .../zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h | 15 - include/zephyr/dt-bindings/adc/nrf-saadc-v2.h | 14 - include/zephyr/dt-bindings/adc/nrf-saadc-v3.h | 14 - include/zephyr/dt-bindings/adc/nrf-saadc.h | 41 +- .../zephyr/dt-bindings/comparator/nrf-comp.h | 6 +- .../platform/nrf_802154_clock_zephyr.c | 2 +- modules/hal_nordic/nrfx/CMakeLists.txt | 49 +- modules/hal_nordic/nrfx/Kconfig | 968 +----------------- modules/hal_nordic/nrfx/Kconfig.logging | 12 - modules/hal_nordic/nrfx/nrfx_config.h | 84 +- modules/hal_nordic/nrfx/nrfx_glue.c | 40 +- modules/hal_nordic/nrfx/nrfx_kconfig.h | 585 +---------- modules/hal_nordic/nrfx/nrfx_log.h | 2 +- modules/nrf_wifi/bus/qspi_if.c | 93 +- .../nordic/include/tfm_read_ranges.h | 2 +- samples/boards/nordic/nrfx/src/main.c | 59 +- samples/boards/nordic/nrfx_prs/prj.conf | 4 +- samples/boards/nordic/nrfx_prs/src/main.c | 41 +- .../led_strip/boards/nrf52dk_nrf52832.conf | 3 - samples/net/zperf/src/nrf5340_cpu_boost.c | 1 - .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 2 +- .../uac2_explicit_feedback/src/feedback_nrf.c | 91 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 2 +- .../uac2_implicit_feedback/src/feedback_nrf.c | 47 +- scripts/ci/check_compliance.py | 1 + soc/nordic/CMakeLists.txt | 5 +- soc/nordic/Kconfig | 8 + soc/nordic/common/CMakeLists.txt | 5 + soc/nordic/common/Kconfig.peripherals | 339 ------ soc/nordic/common/gpiote_nrfx.c | 18 + soc/nordic/common/gpiote_nrfx.h | 22 + soc/nordic/common/gppi_init.c | 59 ++ soc/nordic/common/nrf_sys_event.c | 12 +- soc/nordic/common/soc_nrf_common.h | 16 +- soc/nordic/common/soc_secure.c | 2 - soc/nordic/common/soc_secure.h | 2 +- .../ironside/include/nrf_ironside/cpuconf.h | 2 +- soc/nordic/nrf51/soc.c | 2 +- soc/nordic/nrf52/CMakeLists.txt | 4 - soc/nordic/nrf52/Kconfig | 10 +- soc/nordic/nrf52/soc.c | 2 +- soc/nordic/nrf53/soc.c | 41 +- soc/nordic/nrf53/sync_rtc.c | 46 +- soc/nordic/nrf54h/bicr/CMakeLists.txt | 2 +- soc/nordic/nrf54h/soc.c | 2 +- soc/nordic/nrf54l/soc.c | 4 +- soc/nordic/nrf91/soc.c | 2 +- soc/nordic/nrf92/soc.c | 2 +- soc/nordic/validate_binding_headers.c | 2 +- subsys/bluetooth/audio/shell/bap_usb.c | 1 - .../ll_sw/nordic/hal/nrf5/radio/radio.c | 29 +- .../nordic/hal/nrf5/radio/radio_nrf52810.h | 2 +- .../nordic/hal/nrf5/radio/radio_nrf52832.h | 2 +- .../nordic/hal/nrf5/radio/radio_nrf52840.h | 2 +- .../hal/nrf5/radio/radio_nrf5_dppi_gpiote.h | 8 +- .../hal/nrf5/radio/radio_nrf5_ppi_gpiote.h | 8 +- .../boards/bl54l15_dvk_nrf54l15_cpuapp.conf | 5 - .../boards/bl54l15u_dvk_nrf54l15_cpuapp.conf | 5 - .../i2c_slave/boards/nrf52840dk_nrf52840.conf | 1 - .../boards/nrf5340dk_nrf5340_cpuapp.conf | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../boards/nrf54h20dk_nrf54h20_cpuppr.conf | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 - .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - tests/boards/nrf/i2c/i2c_slave/prj.conf | 1 + tests/boards/nrf/i2c/i2c_slave/src/main.c | 28 +- tests/drivers/timer/nrf_grtc_timer/src/main.c | 4 + .../uart/uart_mix_fifo_poll/testcase.yaml | 2 +- tests/drivers/uart/uart_pm/testcase.yaml | 4 +- .../boards/nrf52840dk_nrf52840_counter.conf | 1 - west.yml | 8 +- 143 files changed, 1811 insertions(+), 5255 deletions(-) create mode 100644 boards/native/nrf_bsim/gpiote_nrfx_bsim.c delete mode 100644 drivers/comparator/comparator_nrf_common.h create mode 100644 include/zephyr/drivers/gpio/gpio_nrf.h delete mode 100644 include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h delete mode 100644 include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h delete mode 100644 include/zephyr/dt-bindings/adc/nrf-saadc-v2.h delete mode 100644 include/zephyr/dt-bindings/adc/nrf-saadc-v3.h delete mode 100644 samples/drivers/led/led_strip/boards/nrf52dk_nrf52832.conf create mode 100644 soc/nordic/common/gpiote_nrfx.c create mode 100644 soc/nordic/common/gpiote_nrfx.h create mode 100644 soc/nordic/common/gppi_init.c delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/bl54l15_dvk_nrf54l15_cpuapp.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/bl54l15u_dvk_nrf54l15_cpuapp.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf diff --git a/boards/native/nrf_bsim/CMakeLists.txt b/boards/native/nrf_bsim/CMakeLists.txt index a457bd3126d6..f96acc58fe46 100644 --- a/boards/native/nrf_bsim/CMakeLists.txt +++ b/boards/native/nrf_bsim/CMakeLists.txt @@ -25,12 +25,21 @@ zephyr_library_sources( argparse.c nsi_if.c native_remap.c + gpiote_nrfx_bsim.c soc/nrfx_coredep.c common/bstests_entry.c common/cmsis/cmsis.c common/trace_hook.c ) +# Include GPIOTE nrfx from real SOC code +zephyr_library_sources(${ZEPHYR_BASE}/soc/nordic/common/gpiote_nrfx.c) + +# Include gppi_init from real SOC code if enabled +if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) + zephyr_library_sources(${ZEPHYR_BASE}/soc/nordic/common/gppi_init.c) +endif() + # Include sync_rtc from real SOC code if enabled zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC ${ZEPHYR_BASE}/soc/nordic/nrf53/sync_rtc.c diff --git a/boards/native/nrf_bsim/common/cmsis/cmsis.h b/boards/native/nrf_bsim/common/cmsis/cmsis.h index 2afc6e9ae50f..25a9fe4d6578 100644 --- a/boards/native/nrf_bsim/common/cmsis/cmsis.h +++ b/boards/native/nrf_bsim/common/cmsis/cmsis.h @@ -15,7 +15,7 @@ #include #include "cmsis_instr.h" #if defined(CONFIG_SOC_COMPATIBLE_NRF52833) -#include "nrf52833.h" +#include "mdk/nrf52833.h" #endif #ifdef __cplusplus diff --git a/boards/native/nrf_bsim/gpiote_nrfx_bsim.c b/boards/native/nrf_bsim/gpiote_nrfx_bsim.c new file mode 100644 index 000000000000..d595cc3d117b --- /dev/null +++ b/boards/native/nrf_bsim/gpiote_nrfx_bsim.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "gpiote_nrfx.h" + +#define GPIOTE_NRFX_INST_IDX(idx) DT_CAT3(NRFX_GPIOTE, idx, _INST_IDX) +#define GPIOTE_INST_IDX(node_id) GPIOTE_NRFX_INST_IDX(DT_PROP(node_id, instance)) +#define GPIOTE_INST_AND_COMMA(node_id) \ + [GPIOTE_INST_IDX(node_id)] = &GPIOTE_NRFX_INST_BY_NODE(node_id), + +/* Conversion of hardcoded DT addresses into the correct ones for simulation + * is done here rather than within `gpio` driver implementation because `gpio` driver + * operates on GPIO ports instances, which might or might not be associated + * with a GPIOTE instance. Additionally, single GPIOTE instance might be associated + * with multiple GPIO ports instances. This makes iterating over all enabled GPIOTE instances + * problematic in the `gpio` driver initialization function context. + */ +static int gpiote_bsim_init(void) +{ + nrfx_gpiote_t *gpiote_instances[] = { + DT_FOREACH_STATUS_OKAY(nordic_nrf_gpiote, GPIOTE_INST_AND_COMMA) + }; + + /* For simulated devices we need to convert the hardcoded DT address from the real + * peripheral into the correct one for simulation + */ + for (int inst = 0; inst < ARRAY_SIZE(gpiote_instances); inst++) { + gpiote_instances[inst]->p_reg = + nhw_convert_periph_base_addr(gpiote_instances[inst]->p_reg); + } + + return 0; +} + +SYS_INIT(gpiote_bsim_init, PRE_KERNEL_1, 0); diff --git a/boards/native/nrf_bsim/soc/soc_secure.h b/boards/native/nrf_bsim/soc/soc_secure.h index 06e9cc64993c..e2be9dc0603c 100644 --- a/boards/native/nrf_bsim/soc/soc_secure.h +++ b/boards/native/nrf_bsim/soc/soc_secure.h @@ -12,7 +12,7 @@ #include -#include +#include #include static inline void soc_secure_read_deviceid(uint32_t deviceid[2]) diff --git a/drivers/adc/adc_nrfx_adc.c b/drivers/adc/adc_nrfx_adc.c index 85b0940be515..ef5aed898964 100644 --- a/drivers/adc/adc_nrfx_adc.c +++ b/drivers/adc/adc_nrfx_adc.c @@ -265,12 +265,12 @@ static int init_adc(const struct device *dev) { const nrfx_adc_config_t config = NRFX_ADC_DEFAULT_CONFIG; - nrfx_err_t result = nrfx_adc_init(&config, event_handler); + int result = nrfx_adc_init(&config, event_handler); - if (result != NRFX_SUCCESS) { + if (result != 0) { LOG_ERR("Failed to initialize device: %s", dev->name); - return -EBUSY; + return result; } IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 32be9825d243..f54fd0a1aee8 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -6,9 +6,7 @@ #include "adc_context.h" #include -#include -#include -#include +#include #include #include #include @@ -22,91 +20,22 @@ LOG_MODULE_REGISTER(adc_nrfx_saadc, CONFIG_ADC_LOG_LEVEL); #define DT_DRV_COMPAT nordic_nrf_saadc -#if (NRF_SAADC_HAS_AIN_AS_PIN) - -#if defined(CONFIG_NRF_PLATFORM_HALTIUM) -static const uint32_t saadc_psels[NRF_SAADC_AIN13 + 1] = { - [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), - [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), - [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - [NRF_SAADC_AIN8] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 9), - [NRF_SAADC_AIN9] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 9), - [NRF_SAADC_AIN10] = NRF_PIN_PORT_TO_PIN_NUMBER(2U, 9), - [NRF_SAADC_AIN11] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 9), - [NRF_SAADC_AIN12] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 9), - [NRF_SAADC_AIN13] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 9), -}; -#elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15) -static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { - [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), - [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), - [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), - [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), - [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, - [NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD, - [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, -}; -#elif defined(NRF54LM20A_ENGA_XXAA) -static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { - [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), - [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), - [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1), - [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, - [NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD, - [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, -}; -#elif defined(NRF54LV10A_ENGA_XXAA) -static const uint32_t saadc_psels[NRF_SAADC_AIN7 + 1] = { - [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), - [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), - [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(10U, 1), - [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), - [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), -}; -#elif defined(NRF54LS05B_ENGA_XXAA) -static const uint32_t saadc_psels[NRF_SAADC_AIN3 + 1] = { - [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), -}; -#endif - -#else -BUILD_ASSERT((NRF_SAADC_AIN0 == NRF_SAADC_INPUT_AIN0) && - (NRF_SAADC_AIN1 == NRF_SAADC_INPUT_AIN1) && - (NRF_SAADC_AIN2 == NRF_SAADC_INPUT_AIN2) && - (NRF_SAADC_AIN3 == NRF_SAADC_INPUT_AIN3) && - (NRF_SAADC_AIN4 == NRF_SAADC_INPUT_AIN4) && - (NRF_SAADC_AIN5 == NRF_SAADC_INPUT_AIN5) && - (NRF_SAADC_AIN6 == NRF_SAADC_INPUT_AIN6) && - (NRF_SAADC_AIN7 == NRF_SAADC_INPUT_AIN7) && -#if defined(SAADC_CH_PSELP_PSELP_VDDHDIV5) - (NRF_SAADC_VDDHDIV5 == NRF_SAADC_INPUT_VDDHDIV5) && +BUILD_ASSERT((NRF_SAADC_AIN0 == NRFX_ANALOG_EXTERNAL_AIN0) && + (NRF_SAADC_AIN1 == NRFX_ANALOG_EXTERNAL_AIN1) && + (NRF_SAADC_AIN2 == NRFX_ANALOG_EXTERNAL_AIN2) && + (NRF_SAADC_AIN3 == NRFX_ANALOG_EXTERNAL_AIN3) && + (NRF_SAADC_AIN4 == NRFX_ANALOG_EXTERNAL_AIN4) && + (NRF_SAADC_AIN5 == NRFX_ANALOG_EXTERNAL_AIN5) && + (NRF_SAADC_AIN6 == NRFX_ANALOG_EXTERNAL_AIN6) && + (NRF_SAADC_AIN7 == NRFX_ANALOG_EXTERNAL_AIN7) && +#if NRF_SAADC_HAS_INPUT_VDDHDIV5 + (NRF_SAADC_VDDHDIV5 == NRFX_ANALOG_INTERNAL_VDDHDIV5) && #endif -#if defined(SAADC_CH_PSELP_PSELP_VDD) - (NRF_SAADC_VDD == NRF_SAADC_INPUT_VDD) && +#if NRF_SAADC_HAS_INPUT_VDD + (NRF_SAADC_VDD == NRFX_ANALOG_INTERNAL_VDD) && #endif 1, - "Definitions from nrf-adc.h do not match those from nrf_saadc.h"); -#endif + "Definitions from nrf-saadc.h do not match those from nrfx_analog_common.h"); struct driver_data { struct adc_context ctx; @@ -188,96 +117,46 @@ static int acq_time_set(nrf_saadc_channel_config_t *ch_cfg, uint16_t acquisition return 0; } -static int input_assign(nrf_saadc_input_t *pin_p, - nrf_saadc_input_t *pin_n, - const struct adc_channel_cfg *channel_cfg) -{ -#if (NRF_SAADC_HAS_AIN_AS_PIN) - if (channel_cfg->input_positive > ARRAY_SIZE(saadc_psels) || - channel_cfg->input_positive < NRF_SAADC_AIN0) { - LOG_ERR("Invalid analog positive input number: %d", channel_cfg->input_positive); - return -EINVAL; - } - - *pin_p = saadc_psels[channel_cfg->input_positive]; - -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - nrf_gpio_pin_retain_disable(saadc_psels[channel_cfg->input_positive]); -#endif - - if (channel_cfg->differential) { - if (channel_cfg->input_negative > ARRAY_SIZE(saadc_psels) || - (IS_ENABLED(CONFIG_NRF_PLATFORM_HALTIUM) && - (channel_cfg->input_positive > NRF_SAADC_AIN7) != - (channel_cfg->input_negative > NRF_SAADC_AIN7))) { - LOG_ERR("Invalid analog negative input number: %d", - channel_cfg->input_negative); - return -EINVAL; - } - *pin_n = channel_cfg->input_negative == NRF_SAADC_GND ? - NRF_SAADC_INPUT_DISABLED : - saadc_psels[channel_cfg->input_negative]; - -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - if (channel_cfg->input_negative != NRF_SAADC_GND) { - nrf_gpio_pin_retain_disable(saadc_psels[channel_cfg->input_negative]); - } -#endif - } else { - *pin_n = NRF_SAADC_INPUT_DISABLED; - } -#else - *pin_p = channel_cfg->input_positive; - *pin_n = (channel_cfg->differential && (channel_cfg->input_negative != NRF_SAADC_GND)) - ? channel_cfg->input_negative - : NRF_SAADC_INPUT_DISABLED; -#endif - LOG_DBG("ADC positive input: %d", *pin_p); - LOG_DBG("ADC negative input: %d", *pin_n); - - return 0; -} - static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) { #if NRF_SAADC_HAS_CH_GAIN switch (gain) { -#if defined(SAADC_CH_CONFIG_GAIN_Gain1_6) +#if NRF_SAADC_HAS_GAIN_1_6 case ADC_GAIN_1_6: ch_cfg->gain = NRF_SAADC_GAIN1_6; break; #endif -#if defined(SAADC_CH_CONFIG_GAIN_Gain1_5) +#if NRF_SAADC_HAS_GAIN_1_5 case ADC_GAIN_1_5: ch_cfg->gain = NRF_SAADC_GAIN1_5; break; #endif -#if defined(SAADC_CH_CONFIG_GAIN_Gain1_4) || defined(SAADC_CH_CONFIG_GAIN_Gain2_8) +#if NRF_SAADC_HAS_GAIN_1_4 case ADC_GAIN_1_4: ch_cfg->gain = NRF_SAADC_GAIN1_4; break; #endif -#if defined(SAADC_CH_CONFIG_GAIN_Gain2_7) +#if NRF_SAADC_HAS_GAIN_2_7 case ADC_GAIN_2_7: ch_cfg->gain = NRF_SAADC_GAIN2_7; break; #endif -#if defined(SAADC_CH_CONFIG_GAIN_Gain1_3) || defined(SAADC_CH_CONFIG_GAIN_Gain2_6) +#if NRF_SAADC_HAS_GAIN_1_3 case ADC_GAIN_1_3: ch_cfg->gain = NRF_SAADC_GAIN1_3; break; #endif -#if defined(SAADC_CH_CONFIG_GAIN_Gain2_5) +#if NRF_SAADC_HAS_GAIN_2_5 case ADC_GAIN_2_5: ch_cfg->gain = NRF_SAADC_GAIN2_5; break; #endif -#if defined(SAADC_CH_CONFIG_GAIN_Gain1_2) || defined(SAADC_CH_CONFIG_GAIN_Gain2_4) +#if NRF_SAADC_HAS_GAIN_1_2 case ADC_GAIN_1_2: ch_cfg->gain = NRF_SAADC_GAIN1_2; break; #endif -#if defined(SAADC_CH_CONFIG_GAIN_Gain2_3) +#if NRF_SAADC_HAS_GAIN_2_3 case ADC_GAIN_2_3: ch_cfg->gain = NRF_SAADC_GAIN2_3; break; @@ -288,7 +167,7 @@ static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) case ADC_GAIN_2: ch_cfg->gain = NRF_SAADC_GAIN2; break; -#if defined(SAADC_CH_CONFIG_GAIN_Gain4) +#if NRF_SAADC_HAS_GAIN_4 case ADC_GAIN_4: ch_cfg->gain = NRF_SAADC_GAIN4; break; @@ -296,7 +175,7 @@ static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) default: #else if (gain != ADC_GAIN_1) { -#endif /* defined(NRF_SAADC_HAS_CH_GAIN) */ +#endif /* NRF_SAADC_HAS_CH_GAIN */ LOG_ERR("Selected ADC gain is not valid"); return -EINVAL; } @@ -307,17 +186,17 @@ static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) static int reference_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_reference reference) { switch (reference) { -#if defined(SAADC_CH_CONFIG_REFSEL_Internal) +#if NRF_SAADC_HAS_REFERENCE_INTERNAL case ADC_REF_INTERNAL: ch_cfg->reference = NRF_SAADC_REFERENCE_INTERNAL; break; #endif -#if defined(SAADC_CH_CONFIG_REFSEL_VDD1_4) +#if NRF_SAADC_HAS_REFERENCE_VDD4 case ADC_REF_VDD_1_4: ch_cfg->reference = NRF_SAADC_REFERENCE_VDD4; break; #endif -#if defined(SAADC_CH_CONFIG_REFSEL_External) +#if NRF_SAADC_HAS_REFERENCE_EXTERNAL case ADC_REF_EXTERNAL0: ch_cfg->reference = NRF_SAADC_REFERENCE_EXTERNAL; break; @@ -347,6 +226,11 @@ static int adc_nrfx_channel_setup(const struct device *dev, #endif }, .channel_index = channel_cfg->channel_id, + .pin_p = channel_cfg->input_positive, + .pin_n = (channel_cfg->differential && + (channel_cfg->input_negative != NRF_SAADC_GND)) + ? channel_cfg->input_negative + : NRF_SAADC_AIN_DISABLED, }; if (channel_cfg->channel_id >= SAADC_CH_NUM) { @@ -356,11 +240,6 @@ static int adc_nrfx_channel_setup(const struct device *dev, ch_cfg = &cfg.channel_config; - err = input_assign(&cfg.pin_p, &cfg.pin_n, channel_cfg); - if (err != 0) { - return err; - } - err = gain_set(ch_cfg, channel_cfg->gain); if (err != 0) { return err; @@ -394,11 +273,11 @@ static int adc_nrfx_channel_setup(const struct device *dev, m_data.divide_single_ended_value &= ~BIT(channel_cfg->channel_id); } - nrfx_err_t ret = nrfx_saadc_channel_config(&cfg); + err = nrfx_saadc_channel_config(&cfg); - if (ret != NRFX_SUCCESS) { - LOG_ERR("Cannot configure channel %d: 0x%08x", channel_cfg->channel_id, ret); - return -EINVAL; + if (err != 0) { + LOG_ERR("Cannot configure channel %d: %d", channel_cfg->channel_id, err); + return err; } return 0; @@ -409,10 +288,10 @@ static void adc_context_start_sampling(struct adc_context *ctx) if (ctx->sequence.calibrate) { nrfx_saadc_offset_calibrate(event_handler); } else { - nrfx_err_t ret = nrfx_saadc_mode_trigger(); + int ret = nrfx_saadc_mode_trigger(); - if (ret != NRFX_SUCCESS) { - LOG_ERR("Cannot start sampling: 0x%08x", ret); + if (ret != 0) { + LOG_ERR("Cannot start sampling: %d", ret); adc_context_complete(ctx, -EIO); } } @@ -437,10 +316,9 @@ static void adc_context_update_buffer_pointer(struct adc_context *ctx, bool repe return; } - nrfx_err_t nrfx_err = - nrfx_saadc_buffer_set(samples_buffer, m_data.active_channel_cnt); - if (nrfx_err != NRFX_SUCCESS) { - LOG_ERR("Failed to set buffer: 0x%08x", nrfx_err); + error = nrfx_saadc_buffer_set(samples_buffer, m_data.active_channel_cnt); + if (error != 0) { + LOG_ERR("Failed to set buffer: %d", error); adc_context_complete(ctx, -EIO); } } @@ -451,10 +329,10 @@ static inline void adc_context_enable_timer(struct adc_context *ctx) if (!m_data.internal_timer_enabled) { k_timer_start(&m_data.timer, K_NO_WAIT, K_USEC(ctx->options.interval_us)); } else { - nrfx_err_t ret = nrfx_saadc_mode_trigger(); + int ret = nrfx_saadc_mode_trigger(); - if (ret != NRFX_SUCCESS) { - LOG_ERR("Cannot start sampling: 0x%08x", ret); + if (ret != 0) { + LOG_ERR("Cannot start sampling: %d", ret); adc_context_complete(&m_data.ctx, -EIO); } } @@ -624,7 +502,6 @@ static inline uint16_t interval_to_cc(uint16_t interval_us) static int start_read(const struct device *dev, const struct adc_sequence *sequence) { - nrfx_err_t nrfx_err; int error; uint32_t selected_channels = sequence->channels; nrf_saadc_resolution_t resolution; @@ -682,21 +559,21 @@ static int start_read(const struct device *dev, m_data.internal_timer_enabled = true; - nrfx_err = nrfx_saadc_advanced_mode_set(selected_channels, resolution, &adv_config, - event_handler); + error = nrfx_saadc_advanced_mode_set(selected_channels, resolution, &adv_config, + event_handler); } else { m_data.internal_timer_enabled = false; - nrfx_err = nrfx_saadc_simple_mode_set(selected_channels, resolution, oversampling, - event_handler); + error = nrfx_saadc_simple_mode_set(selected_channels, resolution, oversampling, + event_handler); } - if (nrfx_err != NRFX_SUCCESS) { - return -EINVAL; + if (error != 0) { + return error; } error = check_buffer_size(sequence, active_channel_cnt); - if (error) { + if (error != 0) { return error; } @@ -717,14 +594,13 @@ static int start_read(const struct device *dev, /* Buffer is filled in chunks, each chunk composed of number of samples equal to number * of active channels. Buffer pointer is advanced and reloaded after each chunk. */ - nrfx_err = nrfx_saadc_buffer_set( - samples_buffer, - (m_data.internal_timer_enabled - ? (1 + sequence->options->extra_samplings) - : active_channel_cnt)); - if (nrfx_err != NRFX_SUCCESS) { - LOG_ERR("Failed to set buffer: 0x%08x", nrfx_err); - return -EINVAL; + error = nrfx_saadc_buffer_set(samples_buffer, + (m_data.internal_timer_enabled + ? (1 + sequence->options->extra_samplings) + : active_channel_cnt)); + if (error != 0) { + LOG_ERR("Failed to set buffer: %d", error); + return error; } adc_context_start_read(&m_data.ctx, sequence); @@ -772,7 +648,7 @@ static int adc_nrfx_read_async(const struct device *dev, static void event_handler(const nrfx_saadc_evt_t *event) { - nrfx_err_t err; + int err; if (event->type == NRFX_SAADC_EVT_DONE) { dmm_buffer_in_release( @@ -791,8 +667,8 @@ static void event_handler(const nrfx_saadc_evt_t *event) adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); } else if (event->type == NRFX_SAADC_EVT_CALIBRATEDONE) { err = nrfx_saadc_mode_trigger(); - if (err != NRFX_SUCCESS) { - LOG_ERR("Cannot start sampling: 0x%08x", err); + if (err != 0) { + LOG_ERR("Cannot start sampling: %d", err); adc_context_complete(&m_data.ctx, -EIO); } } else if (event->type == NRFX_SAADC_EVT_FINISHED) { @@ -809,13 +685,13 @@ static int saadc_pm_handler(const struct device *dev, enum pm_device_action acti static int init_saadc(const struct device *dev) { - nrfx_err_t err; + int err; k_timer_init(&m_data.timer, external_timer_expired_handler, NULL); /* The priority value passed here is ignored (see nrfx_glue.h). */ err = nrfx_saadc_init(0); - if (err != NRFX_SUCCESS) { + if (err != 0) { LOG_ERR("Failed to initialize device: %s", dev->name); return -EIO; } @@ -833,38 +709,9 @@ static DEVICE_API(adc, adc_nrfx_driver_api) = { #ifdef CONFIG_ADC_ASYNC .read_async = adc_nrfx_read_async, #endif -#if defined(NRF54LV10A_ENGA_XXAA) - .ref_internal = 1300, -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - .ref_internal = 900, -#elif defined(CONFIG_NRF_PLATFORM_HALTIUM) - .ref_internal = 1024, -#else - .ref_internal = 600, -#endif + .ref_internal = NRFX_SAADC_REF_INTERNAL_VALUE, }; -#if defined(CONFIG_NRF_PLATFORM_HALTIUM) -/* AIN8-AIN14 inputs are on 3v3 GPIO port and they cannot be mixed with other - * analog inputs (from 1v8 ports) in differential mode. - */ -#define CH_IS_3V3(val) (val >= NRF_SAADC_AIN8) - -#define MIXED_3V3_1V8_INPUTS(node) \ - (DT_NODE_HAS_PROP(node, zephyr_input_negative) && \ - (CH_IS_3V3(DT_PROP_OR(node, zephyr_input_negative, 0)) != \ - CH_IS_3V3(DT_PROP_OR(node, zephyr_input_positive, 0)))) -#else -#define MIXED_3V3_1V8_INPUTS(node) false -#endif - -#define VALIDATE_CHANNEL_CONFIG(node) \ - BUILD_ASSERT(MIXED_3V3_1V8_INPUTS(node) == false, \ - "1v8 inputs cannot be mixed with 3v3 inputs"); - -/* Validate configuration of all channels. */ -DT_FOREACH_CHILD(DT_DRV_INST(0), VALIDATE_CHANNEL_CONFIG) - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(0)); PM_DEVICE_DT_INST_DEFINE(0, saadc_pm_handler); diff --git a/drivers/audio/Kconfig.dmic_pdm_nrfx b/drivers/audio/Kconfig.dmic_pdm_nrfx index 51a56bebb54d..9f45144effa9 100644 --- a/drivers/audio/Kconfig.dmic_pdm_nrfx +++ b/drivers/audio/Kconfig.dmic_pdm_nrfx @@ -5,9 +5,7 @@ config AUDIO_DMIC_NRFX_PDM bool "nRF PDM nrfx driver" default y depends on DT_HAS_NORDIC_NRF_PDM_ENABLED - select NRFX_PDM0 if HAS_HW_NRF_PDM0 - select NRFX_PDM20 if HAS_HW_NRF_PDM20 - select NRFX_PDM21 if HAS_HW_NRF_PDM21 + select NRFX_PDM select PINCTRL help Enable support for nrfx PDM driver for nRF MCU series. diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index a2d630f847a9..b3fc87404f82 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_nrf_pdm + #include #include #include @@ -21,7 +23,6 @@ LOG_MODULE_REGISTER(dmic_nrfx_pdm, CONFIG_AUDIO_DMIC_LOG_LEVEL); #if CONFIG_SOC_SERIES_NRF54HX #define DMIC_NRFX_CLOCK_FREQ MHZ(16) -#define DMIC_NRFX_CLOCK_FACTOR 8192 #define DMIC_NRFX_AUDIO_CLOCK_FREQ DT_PROP_OR(NODE_AUDIOPLL, frequency, 0) #elif DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) #define AUXPLL_FREQUENCY_SETTING DT_PROP(NODE_AUDIO_AUXPLL, nordic_frequency) @@ -35,13 +36,12 @@ BUILD_ASSERT((AUXPLL_FREQUENCY_SETTING == NRF_AUXPLL_FREQ_DIV_AUDIO_48K) || #else #define DMIC_NRFX_CLOCK_FREQ MHZ(32) -#define DMIC_NRFX_CLOCK_FACTOR 4096 #define DMIC_NRFX_AUDIO_CLOCK_FREQ DT_PROP_OR(DT_NODELABEL(aclk), clock_frequency, \ DT_PROP_OR(DT_NODELABEL(clock), hfclkaudio_frequency, 0)) #endif struct dmic_nrfx_pdm_drv_data { - const nrfx_pdm_t *pdm; + nrfx_pdm_t pdm; #if CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL || DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) const struct device *audiopll_dev; #elif CONFIG_CLOCK_CONTROL_NRF @@ -79,7 +79,7 @@ static void free_buffer(struct dmic_nrfx_pdm_drv_data *drv_data, void *buffer) static void stop_pdm(struct dmic_nrfx_pdm_drv_data *drv_data) { drv_data->stopping = true; - nrfx_pdm_stop(drv_data->pdm); + nrfx_pdm_stop(&drv_data->pdm); } static int request_clock(struct dmic_nrfx_pdm_drv_data *drv_data) @@ -120,7 +120,7 @@ static void event_handler(const struct device *dev, const nrfx_pdm_evt_t *evt) if (evt->buffer_requested) { void *buffer; - nrfx_err_t err; + int err; ret = k_mem_slab_alloc(drv_data->mem_slab, &mem_slab_buffer, K_NO_WAIT); if (ret < 0) { @@ -142,9 +142,9 @@ static void event_handler(const struct device *dev, const nrfx_pdm_evt_t *evt) stop_pdm(drv_data); return; } - err = nrfx_pdm_buffer_set(drv_data->pdm, buffer, drv_data->block_size / 2); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to set buffer: 0x%08x", err); + err = nrfx_pdm_buffer_set(&drv_data->pdm, buffer, drv_data->block_size / 2); + if (err != 0) { + LOG_ERR("Failed to set buffer: %d", err); stop = true; } } @@ -206,220 +206,6 @@ static void event_handler(const struct device *dev, const nrfx_pdm_evt_t *evt) } } -static bool is_in_freq_range(uint32_t freq, const struct dmic_cfg *pdm_cfg) -{ - return freq >= pdm_cfg->io.min_pdm_clk_freq && freq <= pdm_cfg->io.max_pdm_clk_freq; -} - -static bool is_better(uint32_t freq, - uint8_t ratio, - uint32_t req_rate, - uint32_t *best_diff, - uint32_t *best_rate, - uint32_t *best_freq) -{ - uint32_t act_rate = freq / ratio; - uint32_t diff = act_rate >= req_rate ? (act_rate - req_rate) - : (req_rate - act_rate); - - LOG_DBG("Freq %u, ratio %u, act_rate %u", freq, ratio, act_rate); - - if (diff < *best_diff) { - *best_diff = diff; - *best_rate = act_rate; - *best_freq = freq; - return true; - } - - return false; -} - -static bool check_pdm_frequencies(const struct dmic_nrfx_pdm_drv_cfg *drv_cfg, - nrfx_pdm_config_t *config, - const struct dmic_cfg *pdm_cfg, - uint8_t ratio, - uint32_t *best_diff, - uint32_t *best_rate, - uint32_t *best_freq) -{ - uint32_t req_rate = pdm_cfg->streams[0].pcm_rate; - bool better_found = false; - const uint32_t src_freq = - (NRF_PDM_HAS_SELECTABLE_CLOCK && drv_cfg->clk_src == ACLK) - ? DMIC_NRFX_AUDIO_CLOCK_FREQ - : DMIC_NRFX_CLOCK_FREQ; -#if NRF_PDM_HAS_PRESCALER - uint32_t req_freq = req_rate * ratio; - uint32_t prescaler = src_freq / req_freq; - uint32_t act_freq = src_freq / prescaler; - - if (is_in_freq_range(act_freq, pdm_cfg) && - is_better(act_freq, ratio, req_rate, best_diff, best_rate, best_freq)) { - config->prescaler = prescaler; - - better_found = true; - } - - /* Stop if an exact rate match is found. */ - if (*best_diff == 0) { - return true; - } - - /* Prescaler value is rounded down by default, - * thus value rounded up should be checked as well. - */ - prescaler += 1; - act_freq = src_freq / prescaler; - - if (is_in_freq_range(act_freq, pdm_cfg) && - is_better(act_freq, ratio, req_rate, best_diff, best_rate, best_freq)) { - config->prescaler = prescaler; - - better_found = true; - } -#else - if (IS_ENABLED(CONFIG_SOC_SERIES_NRF53X) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX)) { - uint32_t req_freq = req_rate * ratio; - /* As specified in the nRF5340 PS: - * - * PDMCLKCTRL = 4096 * floor(f_pdm * 1048576 / - * (f_source + f_pdm / 2)) - * f_actual = f_source / floor(1048576 * 4096 / PDMCLKCTRL) - */ - uint32_t clk_factor = (uint32_t)((req_freq * 1048576ULL) / - (src_freq + req_freq / 2)); - uint32_t act_freq = src_freq / (1048576 / clk_factor); - - if (is_in_freq_range(act_freq, pdm_cfg) && - is_better(act_freq, ratio, req_rate, best_diff, best_rate, best_freq)) { - config->clock_freq = clk_factor * DMIC_NRFX_CLOCK_FACTOR; - - better_found = true; - } - } else { /* -> !IS_ENABLED(CONFIG_SOC_SERIES_NRF53X)) */ - static const struct { - uint32_t freq_val; - nrf_pdm_freq_t freq_enum; - } freqs[] = { - { 1000000, NRF_PDM_FREQ_1000K }, - { 1032000, NRF_PDM_FREQ_1032K }, - { 1067000, NRF_PDM_FREQ_1067K }, -#if defined(PDM_PDMCLKCTRL_FREQ_1231K) - { 1231000, NRF_PDM_FREQ_1231K }, -#endif -#if defined(PDM_PDMCLKCTRL_FREQ_1280K) - { 1280000, NRF_PDM_FREQ_1280K }, -#endif -#if defined(PDM_PDMCLKCTRL_FREQ_1333K) - { 1333000, NRF_PDM_FREQ_1333K } -#endif - }; - - for (int i = 0; i < ARRAY_SIZE(freqs); ++i) { - uint32_t freq_val = freqs[i].freq_val; - - if (freq_val < pdm_cfg->io.min_pdm_clk_freq) { - continue; - } - if (freq_val > pdm_cfg->io.max_pdm_clk_freq) { - break; - } - - if (is_better(freq_val, ratio, req_rate, - best_diff, best_rate, best_freq)) { - config->clock_freq = freqs[i].freq_enum; - - /* Stop if an exact rate match is found. */ - if (*best_diff == 0) { - return true; - } - - better_found = true; - } - - /* Since frequencies are in ascending order, stop - * checking next ones for the current ratio after - * resulting PCM rate goes above the one requested. - */ - if ((freq_val / ratio) > req_rate) { - break; - } - } - } -#endif /* NRF_PDM_HAS_PRESCALER */ - - return better_found; -} - -/* Finds clock settings that give the PCM output rate closest to that requested, - * taking into account the hardware limitations. - */ -static bool find_suitable_clock(const struct dmic_nrfx_pdm_drv_cfg *drv_cfg, - nrfx_pdm_config_t *config, - const struct dmic_cfg *pdm_cfg) -{ - uint32_t best_diff = UINT32_MAX; - uint32_t best_rate; - uint32_t best_freq; - -#if NRF_PDM_HAS_RATIO_CONFIG - static const struct { - uint8_t ratio_val; - nrf_pdm_ratio_t ratio_enum; - } ratios[] = { -#if defined(PDM_RATIO_RATIO_Ratio32) - { 32, NRF_PDM_RATIO_32X }, -#endif -#if defined(PDM_RATIO_RATIO_Ratio48) - { 48, NRF_PDM_RATIO_48X }, -#endif -#if defined(PDM_RATIO_RATIO_Ratio50) - { 50, NRF_PDM_RATIO_50X }, -#endif - { 64, NRF_PDM_RATIO_64X }, - { 80, NRF_PDM_RATIO_80X }, -#if defined(PDM_RATIO_RATIO_Ratio96) - { 96, NRF_PDM_RATIO_96X }, -#endif -#if defined(PDM_RATIO_RATIO_Ratio100) - { 100, NRF_PDM_RATIO_100X }, -#endif -#if defined(PDM_RATIO_RATIO_Ratio128) - { 128, NRF_PDM_RATIO_128X } -#endif - }; - - for (int r = 0; best_diff != 0 && r < ARRAY_SIZE(ratios); ++r) { - uint8_t ratio = ratios[r].ratio_val; - - if (check_pdm_frequencies(drv_cfg, config, pdm_cfg, ratio, - &best_diff, &best_rate, &best_freq)) { - config->ratio = ratios[r].ratio_enum; - - /* Look no further if a configuration giving the exact - * PCM rate is found. - */ - if (best_diff == 0) { - break; - } - } - } -#else - uint8_t ratio = 64; - - (void)check_pdm_frequencies(drv_cfg, config, pdm_cfg, ratio, - &best_diff, &best_rate, &best_freq); -#endif - - if (best_diff == UINT32_MAX) { - return false; - } - - LOG_INF("PDM clock frequency: %u, actual PCM rate: %u", - best_freq, best_rate); - return true; -} - static int dmic_nrfx_pdm_configure(const struct device *dev, struct dmic_cfg *config) { @@ -429,7 +215,7 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, struct pcm_stream_cfg *stream = &config->streams[0]; uint32_t def_map, alt_map; nrfx_pdm_config_t nrfx_cfg; - nrfx_err_t err; + int err; if (drv_data->active) { LOG_ERR("Cannot configure device while it is active"); @@ -475,7 +261,7 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, /* If either rate or width is 0, the stream is to be disabled. */ if (stream->pcm_rate == 0 || stream->pcm_width == 0) { if (drv_data->configured) { - nrfx_pdm_uninit(drv_data->pdm); + nrfx_pdm_uninit(&drv_data->pdm); drv_data->configured = false; } @@ -503,19 +289,28 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, ? NRF_PDM_MCLKSRC_ACLK : NRF_PDM_MCLKSRC_PCLK32M; #endif - if (!find_suitable_clock(drv_cfg, &nrfx_cfg, config)) { + nrfx_pdm_output_t output_config = { + .base_clock_freq = (NRF_PDM_HAS_SELECTABLE_CLOCK && drv_cfg->clk_src == ACLK) + ? DMIC_NRFX_AUDIO_CLOCK_FREQ + : DMIC_NRFX_CLOCK_FREQ, + .sampling_rate = config->streams[0].pcm_rate, + .output_freq_min = config->io.min_pdm_clk_freq, + .output_freq_max = config->io.max_pdm_clk_freq + }; + + if (nrfx_pdm_prescalers_calc(&output_config, &nrfx_cfg.prescalers) != 0) { LOG_ERR("Cannot find suitable PDM clock configuration."); return -EINVAL; } if (drv_data->configured) { - nrfx_pdm_uninit(drv_data->pdm); + nrfx_pdm_uninit(&drv_data->pdm); drv_data->configured = false; } - err = nrfx_pdm_init(drv_data->pdm, &nrfx_cfg, drv_cfg->event_handler); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize PDM: 0x%08x", err); + err = nrfx_pdm_init(&drv_data->pdm, &nrfx_cfg, drv_cfg->event_handler); + if (err != 0) { + LOG_ERR("Failed to initialize PDM: %d", err); return -EIO; } @@ -536,15 +331,15 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, static int start_transfer(struct dmic_nrfx_pdm_drv_data *drv_data) { - nrfx_err_t err; + int err; int ret; - err = nrfx_pdm_start(drv_data->pdm); - if (err == NRFX_SUCCESS) { + err = nrfx_pdm_start(&drv_data->pdm); + if (err == 0) { return 0; } - LOG_ERR("Failed to start PDM: 0x%08x", err); + LOG_ERR("Failed to start PDM: %d", err); ret = -EIO; ret = release_clock(drv_data); @@ -621,7 +416,7 @@ static int dmic_nrfx_pdm_trigger(const struct device *dev, case DMIC_TRIGGER_STOP: if (drv_data->active) { drv_data->stopping = true; - nrfx_pdm_stop(drv_data->pdm); + nrfx_pdm_stop(&drv_data->pdm); } break; @@ -704,80 +499,60 @@ static const struct _dmic_ops dmic_ops = { .read = dmic_nrfx_pdm_read, }; -#define PDM(idx) DT_NODELABEL(pdm##idx) -#define PDM_CLK_SRC(idx) DT_STRING_TOKEN(PDM(idx), clock_source) - -#define PDM_NRFX_DEVICE(idx) \ - static void *rx_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ - static void *mem_slab_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ - static struct dmic_nrfx_pdm_drv_data dmic_nrfx_pdm_data##idx; \ - static const nrfx_pdm_t dmic_nrfx_pdm##idx = NRFX_PDM_INSTANCE(idx); \ - static int pdm_nrfx_init##idx(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(PDM(idx)), DT_IRQ(PDM(idx), priority), \ - nrfx_isr, nrfx_pdm_##idx##_irq_handler, 0); \ - const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; \ - int err = pinctrl_apply_state(drv_cfg->pcfg, \ - PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - dmic_nrfx_pdm_data##idx.pdm = &dmic_nrfx_pdm##idx; \ - k_msgq_init(&dmic_nrfx_pdm_data##idx.rx_queue, \ - (char *)rx_msgs##idx, sizeof(void *), \ - ARRAY_SIZE(rx_msgs##idx)); \ - k_msgq_init(&dmic_nrfx_pdm_data##idx.mem_slab_queue, \ - (char *)mem_slab_msgs##idx, sizeof(void *), \ - ARRAY_SIZE(mem_slab_msgs##idx)); \ - init_clock_manager(dev); \ - return 0; \ - } \ - static void event_handler##idx(const nrfx_pdm_evt_t *evt) \ - { \ - event_handler(DEVICE_DT_GET(PDM(idx)), evt); \ - } \ - PINCTRL_DT_DEFINE(PDM(idx)); \ - static const struct dmic_nrfx_pdm_drv_cfg dmic_nrfx_pdm_cfg##idx = { \ - .event_handler = event_handler##idx, \ - .nrfx_def_cfg = NRFX_PDM_DEFAULT_CONFIG(0, 0), \ - .nrfx_def_cfg.skip_gpio_cfg = true, \ - .nrfx_def_cfg.skip_psel_cfg = true, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PDM(idx)), \ - .clk_src = PDM_CLK_SRC(idx), \ - .mem_reg = DMM_DEV_TO_REG(PDM(idx)), \ - }; \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PDM(idx)); \ - BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ - NRF_PDM_HAS_SELECTABLE_CLOCK, \ - "Clock source ACLK is not available."); \ - BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ - DT_NODE_HAS_PROP(DT_NODELABEL(clock), \ - hfclkaudio_frequency) || \ - DT_NODE_HAS_PROP(DT_NODELABEL(aclk), \ - clock_frequency) || \ - DT_NODE_HAS_PROP(NODE_AUDIOPLL, \ - frequency) || \ - DT_NODE_HAS_PROP(NODE_AUDIO_AUXPLL, \ - nordic_frequency), \ - "Clock source ACLK requires one following defined frequency "\ - "properties: " \ - "hfclkaudio-frequency in the nordic,nrf-clock node, " \ - "clock-frequency in the aclk node, " \ - "frequency in the audiopll node, " \ - "nordic-frequency in the audio_auxpll node"); \ - DEVICE_DT_DEFINE(PDM(idx), pdm_nrfx_init##idx, NULL, \ - &dmic_nrfx_pdm_data##idx, &dmic_nrfx_pdm_cfg##idx, \ - POST_KERNEL, CONFIG_AUDIO_DMIC_INIT_PRIORITY, \ - &dmic_ops); - -#ifdef CONFIG_HAS_HW_NRF_PDM0 -PDM_NRFX_DEVICE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_PDM20 -PDM_NRFX_DEVICE(20); -#endif - -#ifdef CONFIG_HAS_HW_NRF_PDM21 -PDM_NRFX_DEVICE(21); -#endif +#define PDM_CLK_SRC(inst) DT_STRING_TOKEN(DT_DRV_INST(inst), clock_source) + +#define PDM_NRFX_DEVICE(inst) \ + static void *rx_msgs##inst[DT_INST_PROP(inst, queue_size)]; \ + static void *mem_slab_msgs##inst[DT_INST_PROP(inst, queue_size)]; \ + static struct dmic_nrfx_pdm_drv_data dmic_nrfx_pdm_data##inst = { \ + .pdm = NRFX_PDM_INSTANCE(DT_INST_REG_ADDR(inst)), \ + }; \ + static int pdm_nrfx_init##inst(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), nrfx_pdm_irq_handler, \ + &dmic_nrfx_pdm_data##inst.pdm, 0); \ + const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; \ + int err = pinctrl_apply_state(drv_cfg->pcfg, PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + k_msgq_init(&dmic_nrfx_pdm_data##inst.rx_queue, (char *)rx_msgs##inst, \ + sizeof(void *), ARRAY_SIZE(rx_msgs##inst)); \ + k_msgq_init(&dmic_nrfx_pdm_data##inst.mem_slab_queue, (char *)mem_slab_msgs##inst, \ + sizeof(void *), ARRAY_SIZE(mem_slab_msgs##inst)); \ + init_clock_manager(dev); \ + return 0; \ + } \ + static void event_handler##inst(const nrfx_pdm_evt_t *evt) \ + { \ + event_handler(DEVICE_DT_INST_GET(inst), evt); \ + } \ + PINCTRL_DT_INST_DEFINE(inst); \ + static const struct dmic_nrfx_pdm_drv_cfg dmic_nrfx_pdm_cfg##inst = { \ + .event_handler = event_handler##inst, \ + .nrfx_def_cfg = NRFX_PDM_DEFAULT_CONFIG(0, 0), \ + .nrfx_def_cfg.skip_gpio_cfg = true, \ + .nrfx_def_cfg.skip_psel_cfg = true, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ + .clk_src = PDM_CLK_SRC(inst), \ + .mem_reg = DMM_DEV_TO_REG(DT_DRV_INST(inst)), \ + }; \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ + BUILD_ASSERT(PDM_CLK_SRC(inst) != ACLK || NRF_PDM_HAS_SELECTABLE_CLOCK, \ + "Clock source ACLK is not available."); \ + BUILD_ASSERT(PDM_CLK_SRC(inst) != ACLK || \ + DT_NODE_HAS_PROP(DT_NODELABEL(clock), hfclkaudio_frequency) || \ + DT_NODE_HAS_PROP(DT_NODELABEL(aclk), clock_frequency) || \ + DT_NODE_HAS_PROP(NODE_AUDIOPLL, frequency) || \ + DT_NODE_HAS_PROP(NODE_AUDIO_AUXPLL, nordic_frequency), \ + "Clock source ACLK requires one following defined frequency " \ + "properties: " \ + "hfclkaudio-frequency in the nordic,nrf-clock node, " \ + "clock-frequency in the aclk node, " \ + "frequency in the audiopll node, " \ + "nordic-frequency in the audio_auxpll node"); \ + DEVICE_DT_INST_DEFINE(inst, pdm_nrfx_init##inst, NULL, &dmic_nrfx_pdm_data##inst, \ + &dmic_nrfx_pdm_cfg##inst, POST_KERNEL, \ + CONFIG_AUDIO_DMIC_INIT_PRIORITY, &dmic_ops); + +DT_INST_FOREACH_STATUS_OKAY(PDM_NRFX_DEVICE) diff --git a/drivers/clock_control/clock_control_nrf.c b/drivers/clock_control/clock_control_nrf.c index caa7aadff613..f42a673b7597 100644 --- a/drivers/clock_control/clock_control_nrf.c +++ b/drivers/clock_control/clock_control_nrf.c @@ -14,7 +14,6 @@ #include #include #include -#include LOG_MODULE_REGISTER(clock_control, CONFIG_CLOCK_CONTROL_LOG_LEVEL); @@ -317,7 +316,7 @@ static void hfclk_start(void) hf_start_tstamp = k_uptime_get(); } - nrfx_clock_hfclk_start(); + nrfx_clock_start(NRF_CLOCK_DOMAIN_HFCLK); } static void hfclk_stop(void) @@ -326,7 +325,7 @@ static void hfclk_stop(void) hf_stop_tstamp = k_uptime_get(); } - nrfx_clock_hfclk_stop(); + nrfx_clock_stop(NRF_CLOCK_DOMAIN_HFCLK); } #if NRF_CLOCK_HAS_HFCLK24M @@ -801,7 +800,6 @@ static void hfclkaudio_init(void) static int clk_init(const struct device *dev) { - nrfx_err_t nrfx_err; int err; static const struct onoff_transitions transitions = { .start = onoff_start, @@ -815,8 +813,7 @@ static int clk_init(const struct device *dev) IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), nrfx_isr, nrfx_power_clock_irq_handler, 0); - nrfx_err = nrfx_clock_init(clock_event_handler); - if (nrfx_err != NRFX_SUCCESS) { + if (nrfx_clock_init(clock_event_handler) != 0) { return -EIO; } diff --git a/drivers/comparator/comparator_nrf_common.h b/drivers/comparator/comparator_nrf_common.h deleted file mode 100644 index e86fc9f63692..000000000000 --- a/drivers/comparator/comparator_nrf_common.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_ -#define ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_ - -#include - -#if (NRF_COMP_HAS_AIN_AS_PIN || NRF_LPCOMP_HAS_AIN_AS_PIN) -static const uint32_t shim_nrf_comp_ain_map[] = { -#if defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280) - NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), -#elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15) - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), -#elif defined(NRF54LM20A_ENGA_XXAA) - NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), -#elif defined(NRF54LV10A_ENGA_XXAA) - NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(10U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), -#endif -}; -#endif - -#endif /* ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_ */ diff --git a/drivers/comparator/comparator_nrf_comp.c b/drivers/comparator/comparator_nrf_comp.c index 7178c51675d8..bab02e7b9204 100644 --- a/drivers/comparator/comparator_nrf_comp.c +++ b/drivers/comparator/comparator_nrf_comp.c @@ -10,7 +10,6 @@ #include #include #include -#include "comparator_nrf_common.h" #define DT_DRV_COMPAT nordic_nrf_comp @@ -45,20 +44,6 @@ #define SHIM_NRF_COMP_DT_INST_PSEL(inst) DT_INST_PROP(inst, psel) -#if defined(COMP_HYST_HYST_Hyst40mV) -#define NRF_COMP_HYST_ENABLED NRF_COMP_HYST_40MV -#elif defined(COMP_HYST_HYST_Hyst50mV) -#define NRF_COMP_HYST_ENABLED NRF_COMP_HYST_50MV -#endif - -#define NRF_COMP_HYST_DISABLED NRF_COMP_HYST_NO_HYST - -#if defined(NRF_COMP_HYST_ENABLED) -#define NRF_COMP_HAS_HYST 1 -#else -#define NRF_COMP_HAS_HYST 0 -#endif - struct shim_nrf_comp_data { uint32_t event_mask; bool started; @@ -72,84 +57,41 @@ BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_DOWN(0) < 64); BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_UP(0) < 64); #endif -#if (NRF_COMP_HAS_AIN_AS_PIN) -BUILD_ASSERT(NRF_COMP_AIN0 == 0); -BUILD_ASSERT(NRF_COMP_AIN7 == 7); -#else -BUILD_ASSERT((NRF_COMP_AIN0 == NRF_COMP_INPUT_0) && - (NRF_COMP_AIN1 == NRF_COMP_INPUT_1) && - (NRF_COMP_AIN2 == NRF_COMP_INPUT_2) && - (NRF_COMP_AIN3 == NRF_COMP_INPUT_3) && -#if defined(COMP_PSEL_PSEL_AnalogInput4) - (NRF_COMP_AIN4 == NRF_COMP_INPUT_4) && -#endif -#if defined(COMP_PSEL_PSEL_AnalogInput5) - (NRF_COMP_AIN5 == NRF_COMP_INPUT_5) && +BUILD_ASSERT((NRF_COMP_AIN0 == NRFX_ANALOG_EXTERNAL_AIN0) && + (NRF_COMP_AIN1 == NRFX_ANALOG_EXTERNAL_AIN1) && + (NRF_COMP_AIN2 == NRFX_ANALOG_EXTERNAL_AIN2) && + (NRF_COMP_AIN3 == NRFX_ANALOG_EXTERNAL_AIN3) && + (NRF_COMP_AIN4 == NRFX_ANALOG_EXTERNAL_AIN4) && + (NRF_COMP_AIN5 == NRFX_ANALOG_EXTERNAL_AIN5) && + (NRF_COMP_AIN6 == NRFX_ANALOG_EXTERNAL_AIN6) && + (NRF_COMP_AIN7 == NRFX_ANALOG_EXTERNAL_AIN7) && +#if NRF_COMP_HAS_VDDH_DIV5 + (NRF_COMP_AIN_VDDH_DIV5 == NRFX_ANALOG_INTERNAL_VDDHDIV5) && #endif -#if defined(COMP_PSEL_PSEL_AnalogInput6) - (NRF_COMP_AIN6 == NRF_COMP_INPUT_6) && -#endif -#if defined(COMP_PSEL_PSEL_AnalogInput7) - (NRF_COMP_AIN7 == NRF_COMP_INPUT_7) && -#endif - (NRF_COMP_AIN0 == NRF_COMP_EXT_REF_0) && - (NRF_COMP_AIN1 == NRF_COMP_EXT_REF_1) && - (NRF_COMP_AIN2 == NRF_COMP_EXT_REF_2) && - (NRF_COMP_AIN3 == NRF_COMP_EXT_REF_3) && -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference4) - (NRF_COMP_AIN4 == NRF_COMP_EXT_REF_4) && -#endif -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference5) - (NRF_COMP_AIN5 == NRF_COMP_EXT_REF_5) && -#endif -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference6) - (NRF_COMP_AIN6 == NRF_COMP_EXT_REF_6) && -#endif -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference7) - (NRF_COMP_AIN7 == NRF_COMP_EXT_REF_7) && -#endif -#if defined(COMP_PSEL_PSEL_VddDiv2) - (NRF_COMP_VDD_DIV2 == NRF_COMP_VDD_DIV2) && -#endif -#if defined(COMP_PSEL_PSEL_VddhDiv5) - (NRF_COMP_VDDH_DIV5 == NRF_COMP_VDDH_DIV5) && +#if NRF_COMP_HAS_VDD_DIV2 + (NRF_COMP_AIN_VDD_DIV2 == NRFX_ANALOG_INTERNAL_VDDDIV2) && #endif 1, - "Definitions from nrf-comp.h do not match those from HAL"); -#endif + "Definitions from nrf-comp.h do not match those from nrfx_analog_common.h"); -#ifndef COMP_MODE_SP_Normal +#if !NRF_COMP_HAS_SP_MODE_NORMAL BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_SP_MODE(0) != COMP_NRF_COMP_SP_MODE_NORMAL); #endif -#if NRF_COMP_HAS_ISOURCE -#ifndef COMP_ISOURCE_ISOURCE_Ien2uA5 -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_ISOURCE(0) != COMP_NRF_COMP_ISOURCE_2UA5); -#endif - -#ifndef COMP_ISOURCE_ISOURCE_Ien5uA -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_ISOURCE(0) != COMP_NRF_COMP_ISOURCE_5UA); -#endif - -#ifndef COMP_ISOURCE_ISOURCE_Ien10uA -BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_ISOURCE(0) != COMP_NRF_COMP_ISOURCE_10UA); -#endif -#endif - #if SHIM_NRF_COMP_DT_INST_MAIN_MODE_IS_SE(0) -#ifndef COMP_REFSEL_REFSEL_Int1V8 +#if !NRF_COMP_HAS_REF_INT_1V8 BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_INT_1V8); #endif -#ifndef COMP_REFSEL_REFSEL_Int2V4 +#if !NRF_COMP_HAS_REF_INT_2V4 BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_INT_2V4); #endif -#ifndef COMP_REFSEL_REFSEL_AVDDAO1V8 +#if !NRF_COMP_HAS_REF_AVDDAO1V8 BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_AVDDAO1V8); #endif -#ifndef COMP_REFSEL_REFSEL_VDD +#if !NRF_COMP_HAS_REF_VDD BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_VDD); #endif #endif @@ -241,87 +183,6 @@ static int shim_nrf_comp_pm_callback(const struct device *dev, enum pm_device_ac return 0; } -#if (NRF_COMP_HAS_AIN_AS_PIN) -static int shim_nrf_comp_psel_to_nrf(uint8_t shim, - nrf_comp_input_t *nrf) -{ - if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { - return -EINVAL; - } - - *nrf = shim_nrf_comp_ain_map[shim]; - -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - nrf_gpio_pin_retain_disable(shim_nrf_comp_ain_map[shim]); -#endif - - return 0; -} -#else -static int shim_nrf_comp_psel_to_nrf(uint8_t shim, - nrf_comp_input_t *nrf) -{ - switch (shim) { - case NRF_COMP_AIN0: - *nrf = NRF_COMP_INPUT_0; - break; - - case NRF_COMP_AIN1: - *nrf = NRF_COMP_INPUT_1; - break; - - case NRF_COMP_AIN2: - *nrf = NRF_COMP_INPUT_2; - break; - - case NRF_COMP_AIN3: - *nrf = NRF_COMP_INPUT_3; - break; - -#if defined(COMP_PSEL_PSEL_AnalogInput4) - case NRF_COMP_AIN4: - *nrf = NRF_COMP_INPUT_4; - break; -#endif - -#if defined(COMP_PSEL_PSEL_AnalogInput5) - case NRF_COMP_AIN5: - *nrf = NRF_COMP_INPUT_5; - break; -#endif - -#if defined(COMP_PSEL_PSEL_AnalogInput6) - case NRF_COMP_AIN6: - *nrf = NRF_COMP_INPUT_6; - break; -#endif - -#if defined(COMP_PSEL_PSEL_AnalogInput7) - case NRF_COMP_AIN7: - *nrf = NRF_COMP_INPUT_7; - break; -#endif - -#if defined(COMP_PSEL_PSEL_VddDiv2) - case NRF_COMP_AIN_VDD_DIV2: - *nrf = NRF_COMP_VDD_DIV2; - break; -#endif - -#if defined(COMP_PSEL_PSEL_VddhDiv5) - case NRF_COMP_AIN_VDDH_DIV5: - *nrf = NRF_COMP_VDDH_DIV5; - break; -#endif - - default: - return -EINVAL; - } - - return 0; -} -#endif - static int shim_nrf_comp_sp_mode_to_nrf(enum comp_nrf_comp_sp_mode shim, nrf_comp_sp_mode_t *nrf) { @@ -330,7 +191,7 @@ static int shim_nrf_comp_sp_mode_to_nrf(enum comp_nrf_comp_sp_mode shim, *nrf = NRF_COMP_SP_MODE_LOW; break; -#if defined(COMP_MODE_SP_Normal) +#if NRF_COMP_HAS_SP_MODE_NORMAL case COMP_NRF_COMP_SP_MODE_NORMAL: *nrf = NRF_COMP_SP_MODE_NORMAL; break; @@ -349,95 +210,21 @@ static int shim_nrf_comp_sp_mode_to_nrf(enum comp_nrf_comp_sp_mode shim, #if NRF_COMP_HAS_ISOURCE static int shim_nrf_comp_isource_to_nrf(enum comp_nrf_comp_isource shim, - nrf_isource_t *nrf) + nrf_comp_isource_t *nrf) { switch (shim) { case COMP_NRF_COMP_ISOURCE_DISABLED: *nrf = NRF_COMP_ISOURCE_OFF; break; - -#if defined(COMP_ISOURCE_ISOURCE_Ien2uA5) case COMP_NRF_COMP_ISOURCE_2UA5: *nrf = NRF_COMP_ISOURCE_IEN_2UA5; break; -#endif - -#if defined(COMP_ISOURCE_ISOURCE_Ien5uA) case COMP_NRF_COMP_ISOURCE_5UA: *nrf = NRF_COMP_ISOURCE_IEN_5UA; break; -#endif - -#if defined(COMP_ISOURCE_ISOURCE_Ien10uA) case COMP_NRF_COMP_ISOURCE_10UA: *nrf = NRF_COMP_ISOURCE_IEN_10UA; break; -#endif - - default: - return -EINVAL; - } - - return 0; -} -#endif - -#if (NRF_COMP_HAS_AIN_AS_PIN) -static int shim_nrf_comp_extrefsel_to_nrf(uint8_t shim, - nrf_comp_ext_ref_t *nrf) -{ - if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { - return -EINVAL; - } - - *nrf = shim_nrf_comp_ain_map[shim]; - return 0; -} -#else -static int shim_nrf_comp_extrefsel_to_nrf(uint8_t shim, - nrf_comp_ext_ref_t *nrf) -{ - switch (shim) { - case NRF_COMP_AIN0: - *nrf = NRF_COMP_EXT_REF_0; - break; - - case NRF_COMP_AIN1: - *nrf = NRF_COMP_EXT_REF_1; - break; - - case NRF_COMP_AIN2: - *nrf = NRF_COMP_EXT_REF_2; - break; - - case NRF_COMP_AIN3: - *nrf = NRF_COMP_EXT_REF_3; - break; - -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference4) - case NRF_COMP_AIN4: - *nrf = NRF_COMP_EXT_REF_4; - break; -#endif - -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference5) - case NRF_COMP_AIN5: - *nrf = NRF_COMP_EXT_REF_5; - break; -#endif - -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference6) - case NRF_COMP_AIN6: - *nrf = NRF_COMP_EXT_REF_6; - break; -#endif - -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference7) - case NRF_COMP_AIN7: - *nrf = NRF_COMP_EXT_REF_7; - break; -#endif - default: return -EINVAL; } @@ -454,25 +241,25 @@ static int shim_nrf_comp_refsel_to_nrf(enum comp_nrf_comp_refsel shim, *nrf = NRF_COMP_REF_INT_1V2; break; -#if defined(COMP_REFSEL_REFSEL_Int1V8) +#if NRF_COMP_HAS_REF_INT_1V8 case COMP_NRF_COMP_REFSEL_INT_1V8: *nrf = NRF_COMP_REF_INT_1V8; break; #endif -#if defined(COMP_REFSEL_REFSEL_Int2V4) +#if NRF_COMP_HAS_REF_INT_2V4 case COMP_NRF_COMP_REFSEL_INT_2V4: *nrf = NRF_COMP_REF_INT_2V4; break; #endif -#if defined(COMP_REFSEL_REFSEL_AVDDAO1V8) +#if NRF_COMP_HAS_REF_AVDDAO1V8 case COMP_NRF_COMP_REFSEL_AVDDAO1V8: *nrf = NRF_COMP_REF_AVDDAO1V8; break; #endif -#if defined(COMP_REFSEL_REFSEL_VDD) +#if NRF_COMP_HAS_REF_VDD case COMP_NRF_COMP_REFSEL_VDD: *nrf = NRF_COMP_REF_VDD; break; @@ -496,9 +283,8 @@ static int shim_nrf_comp_se_config_to_nrf(const struct comp_nrf_comp_se_config * return -EINVAL; } - if (shim_nrf_comp_extrefsel_to_nrf(shim->extrefsel, &nrf->ext_ref)) { - return -EINVAL; - } + nrf->ext_ref = (nrfx_analog_input_t)shim->extrefsel; + nrf->input = (nrfx_analog_input_t)shim->psel; nrf->main_mode = NRF_COMP_MAIN_MODE_SE; @@ -525,10 +311,6 @@ static int shim_nrf_comp_se_config_to_nrf(const struct comp_nrf_comp_se_config * } #endif - if (shim_nrf_comp_psel_to_nrf(shim->psel, &nrf->input)) { - return -EINVAL; - } - nrf->interrupt_priority = 0; return 0; } @@ -538,9 +320,8 @@ static int shim_nrf_comp_diff_config_to_nrf(const struct comp_nrf_comp_diff_conf { nrf->reference = NRF_COMP_REF_AREF; - if (shim_nrf_comp_extrefsel_to_nrf(shim->extrefsel, &nrf->ext_ref)) { - return -EINVAL; - } + nrf->ext_ref = (nrfx_analog_input_t)shim->extrefsel; + nrf->input = (nrfx_analog_input_t)shim->psel; nrf->main_mode = NRF_COMP_MAIN_MODE_DIFF; nrf->threshold.th_down = 0; @@ -572,10 +353,6 @@ static int shim_nrf_comp_diff_config_to_nrf(const struct comp_nrf_comp_diff_conf } #endif - if (shim_nrf_comp_psel_to_nrf(shim->psel, &nrf->input)) { - return -EINVAL; - } - nrf->interrupt_priority = 0; return 0; } @@ -723,7 +500,7 @@ static int shim_nrf_comp_init(const struct device *dev) (void)shim_nrf_comp_diff_config_to_nrf(&shim_nrf_comp_config0, &nrf); #endif - if (nrfx_comp_init(&nrf, shim_nrf_comp_event_handler) != NRFX_SUCCESS) { + if (nrfx_comp_init(&nrf, shim_nrf_comp_event_handler) != 0) { return -ENODEV; } diff --git a/drivers/comparator/comparator_nrf_lpcomp.c b/drivers/comparator/comparator_nrf_lpcomp.c index dbd58d342360..ec1d10c3dae9 100644 --- a/drivers/comparator/comparator_nrf_lpcomp.c +++ b/drivers/comparator/comparator_nrf_lpcomp.c @@ -10,7 +10,6 @@ #include #include #include -#include "comparator_nrf_common.h" #include @@ -38,22 +37,15 @@ struct shim_nrf_lpcomp_data { void *user_data; }; -#if (NRF_LPCOMP_HAS_AIN_AS_PIN) -BUILD_ASSERT(NRF_COMP_AIN0 == 0); -BUILD_ASSERT(NRF_COMP_AIN7 == 7); -#else -BUILD_ASSERT((NRF_COMP_AIN0 == NRF_LPCOMP_INPUT_0) && - (NRF_COMP_AIN1 == NRF_LPCOMP_INPUT_1) && - (NRF_COMP_AIN2 == NRF_LPCOMP_INPUT_2) && - (NRF_COMP_AIN3 == NRF_LPCOMP_INPUT_3) && - (NRF_COMP_AIN4 == NRF_LPCOMP_INPUT_4) && - (NRF_COMP_AIN5 == NRF_LPCOMP_INPUT_5) && - (NRF_COMP_AIN6 == NRF_LPCOMP_INPUT_6) && - (NRF_COMP_AIN7 == NRF_LPCOMP_INPUT_7) && - (NRF_COMP_AIN0 == NRF_LPCOMP_EXT_REF_REF0) && - (NRF_COMP_AIN1 == NRF_LPCOMP_EXT_REF_REF1), - "Definitions from nrf-comp.h do not match those from HAL"); -#endif +BUILD_ASSERT((NRF_COMP_AIN0 == NRFX_ANALOG_EXTERNAL_AIN0) && + (NRF_COMP_AIN1 == NRFX_ANALOG_EXTERNAL_AIN1) && + (NRF_COMP_AIN2 == NRFX_ANALOG_EXTERNAL_AIN2) && + (NRF_COMP_AIN3 == NRFX_ANALOG_EXTERNAL_AIN3) && + (NRF_COMP_AIN4 == NRFX_ANALOG_EXTERNAL_AIN4) && + (NRF_COMP_AIN5 == NRFX_ANALOG_EXTERNAL_AIN5) && + (NRF_COMP_AIN6 == NRFX_ANALOG_EXTERNAL_AIN6) && + (NRF_COMP_AIN7 == NRFX_ANALOG_EXTERNAL_AIN7), + "Definitions from nrf-comp.h do not match those from nrfx_analog_common.h"); #if (LPCOMP_REFSEL_RESOLUTION == 8) BUILD_ASSERT((SHIM_NRF_LPCOMP_DT_INST_REFSEL(0) < COMP_NRF_LPCOMP_REFSEL_VDD_1_16) || @@ -134,99 +126,6 @@ static int shim_nrf_lpcomp_pm_callback(const struct device *dev, enum pm_device_ return 0; } -#if (NRF_LPCOMP_HAS_AIN_AS_PIN) -static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, - nrf_lpcomp_input_t *nrf) -{ - if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { - return -EINVAL; - } - - *nrf = shim_nrf_comp_ain_map[shim]; - -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - nrf_gpio_pin_retain_disable(shim_nrf_comp_ain_map[shim]); -#endif - - return 0; -} -#else -static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, - nrf_lpcomp_input_t *nrf) -{ - switch (shim) { - case NRF_COMP_AIN0: - *nrf = NRF_LPCOMP_INPUT_0; - break; - - case NRF_COMP_AIN1: - *nrf = NRF_LPCOMP_INPUT_1; - break; - - case NRF_COMP_AIN2: - *nrf = NRF_LPCOMP_INPUT_2; - break; - - case NRF_COMP_AIN3: - *nrf = NRF_LPCOMP_INPUT_3; - break; - - case NRF_COMP_AIN4: - *nrf = NRF_LPCOMP_INPUT_4; - break; - - case NRF_COMP_AIN5: - *nrf = NRF_LPCOMP_INPUT_5; - break; - - case NRF_COMP_AIN6: - *nrf = NRF_LPCOMP_INPUT_6; - break; - - case NRF_COMP_AIN7: - *nrf = NRF_LPCOMP_INPUT_7; - break; - - default: - return -EINVAL; - } - - return 0; -} -#endif - -#if (NRF_LPCOMP_HAS_AIN_AS_PIN) -static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, - nrf_lpcomp_ext_ref_t *nrf) -{ - if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { - return -EINVAL; - } - - *nrf = shim_nrf_comp_ain_map[shim]; - return 0; -} -#else -static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, - nrf_lpcomp_ext_ref_t *nrf) -{ - switch (shim) { - case NRF_COMP_AIN0: - *nrf = NRF_LPCOMP_EXT_REF_REF0; - break; - - case NRF_COMP_AIN1: - *nrf = NRF_LPCOMP_EXT_REF_REF1; - break; - - default: - return -EINVAL; - } - - return 0; -} -#endif - static int shim_nrf_lpcomp_refsel_to_nrf(enum comp_nrf_lpcomp_refsel shim, nrf_lpcomp_ref_t *nrf) { @@ -311,9 +210,8 @@ static int shim_nrf_lpcomp_config_to_nrf(const struct comp_nrf_lpcomp_config *sh return -EINVAL; } - if (shim_nrf_lpcomp_extrefsel_to_nrf(shim->extrefsel, &nrf->ext_ref)) { - return -EINVAL; - } + nrf->ext_ref = (nrfx_analog_input_t)shim->extrefsel; + nrf->input = (nrfx_analog_input_t)shim->psel; #if NRF_LPCOMP_HAS_HYST if (shim->enable_hyst) { @@ -327,10 +225,6 @@ static int shim_nrf_lpcomp_config_to_nrf(const struct comp_nrf_lpcomp_config *sh } #endif - if (shim_nrf_lpcomp_psel_to_nrf(shim->psel, &nrf->input)) { - return -EINVAL; - } - return 0; } @@ -463,7 +357,7 @@ static int shim_nrf_lpcomp_init(const struct device *dev) &shim_nrf_lpcomp_data0.config); if (nrfx_lpcomp_init(&shim_nrf_lpcomp_data0.config, - shim_nrf_lpcomp_event_handler) != NRFX_SUCCESS) { + shim_nrf_lpcomp_event_handler) != 0) { return -ENODEV; } diff --git a/drivers/counter/Kconfig.nrfx b/drivers/counter/Kconfig.nrfx index ed02411de261..e50b75063135 100644 --- a/drivers/counter/Kconfig.nrfx +++ b/drivers/counter/Kconfig.nrfx @@ -22,8 +22,7 @@ config COUNTER_RTC_WITH_PPI_WRAP $(dt_nodelabel_bool_prop,rtc1,ppi-wrap) || \ $(dt_nodelabel_bool_prop,rtc2,ppi-wrap) depends on COUNTER_NRF_RTC - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC + select NRFX_GPPI # Internal flag which detects if fixed top feature is enabled for any instance config COUNTER_RTC_CUSTOM_TOP_SUPPORT diff --git a/drivers/counter/counter_nrfx_rtc.c b/drivers/counter/counter_nrfx_rtc.c index 735aa49a76f4..70f822591a13 100644 --- a/drivers/counter/counter_nrfx_rtc.c +++ b/drivers/counter/counter_nrfx_rtc.c @@ -11,11 +11,7 @@ #endif #include #include -#ifdef DPPI_PRESENT -#include -#else -#include -#endif +#include #define LOG_MODULE_NAME counter_rtc #include @@ -58,7 +54,7 @@ struct counter_nrfx_data { /* Store channel interrupt pending and CC adjusted flags. */ atomic_t ipend_adj; #if CONFIG_COUNTER_RTC_WITH_PPI_WRAP - uint8_t ppi_ch; + nrfx_gppi_handle_t ppi_handle; #endif }; @@ -379,41 +375,21 @@ static int ppi_setup(const struct device *dev, uint8_t chan) struct counter_nrfx_data *data = dev->data; NRF_RTC_Type *rtc = nrfx_config->rtc; nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(chan); - nrfx_err_t result; + uint32_t eep = nrf_rtc_event_address_get(rtc, evt); + uint32_t tep = nrfy_rtc_task_address_get(rtc, NRF_RTC_TASK_CLEAR); + int err; if (!nrfx_config->use_ppi) { return 0; } nrfy_rtc_event_enable(rtc, NRF_RTC_CHANNEL_INT_MASK(chan)); -#ifdef DPPI_PRESENT - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); - - result = nrfx_dppi_channel_alloc(&dppi, &data->ppi_ch); - if (result != NRFX_SUCCESS) { - ERR("Failed to allocate PPI channel."); - return -ENODEV; + err = nrfx_gppi_conn_alloc(eep, tep, &data->ppi_handle); + if (err < 0) { + return err; } - - nrfy_rtc_subscribe_set(rtc, NRF_RTC_TASK_CLEAR, data->ppi_ch); - nrfy_rtc_publish_set(rtc, evt, data->ppi_ch); - (void)nrfx_dppi_channel_enable(&dppi, data->ppi_ch); -#else /* DPPI_PRESENT */ - uint32_t evt_addr; - uint32_t task_addr; - - evt_addr = nrfy_rtc_event_address_get(rtc, evt); - task_addr = nrfy_rtc_task_address_get(rtc, NRF_RTC_TASK_CLEAR); - - result = nrfx_ppi_channel_alloc(&data->ppi_ch); - if (result != NRFX_SUCCESS) { - ERR("Failed to allocate PPI channel."); - return -ENODEV; - } - (void)nrfx_ppi_channel_assign(data->ppi_ch, evt_addr, task_addr); - (void)nrfx_ppi_channel_enable(data->ppi_ch); + nrfx_gppi_conn_enable(data->ppi_handle); #endif -#endif /* CONFIG_COUNTER_RTC_WITH_PPI_WRAP */ return 0; } @@ -422,25 +398,17 @@ static void ppi_free(const struct device *dev, uint8_t chan) #if CONFIG_COUNTER_RTC_WITH_PPI_WRAP const struct counter_nrfx_config *nrfx_config = dev->config; struct counter_nrfx_data *data = dev->data; - uint8_t ppi_ch = data->ppi_ch; NRF_RTC_Type *rtc = nrfx_config->rtc; + nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(chan); + uint32_t eep = nrf_rtc_event_address_get(rtc, evt); + uint32_t tep = nrfy_rtc_task_address_get(rtc, NRF_RTC_TASK_CLEAR); if (!nrfx_config->use_ppi) { return; } nrfy_rtc_event_disable(rtc, NRF_RTC_CHANNEL_INT_MASK(chan)); -#ifdef DPPI_PRESENT - nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(chan); - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); - - (void)nrfx_dppi_channel_disable(&dppi, ppi_ch); - nrfy_rtc_subscribe_clear(rtc, NRF_RTC_TASK_CLEAR); - nrfy_rtc_publish_clear(rtc, evt); - (void)nrfx_dppi_channel_free(&dppi, ppi_ch); -#else /* DPPI_PRESENT */ - (void)nrfx_ppi_channel_disable(ppi_ch); - (void)nrfx_ppi_channel_free(ppi_ch); -#endif + nrfx_gppi_conn_disable(data->ppi_handle); + nrfx_gppi_conn_free(eep, tep, data->ppi_handle); #endif } diff --git a/drivers/display/Kconfig.nrf_led_matrix b/drivers/display/Kconfig.nrf_led_matrix index 7e2a59120736..66bf11dd52ee 100644 --- a/drivers/display/Kconfig.nrf_led_matrix +++ b/drivers/display/Kconfig.nrf_led_matrix @@ -6,7 +6,7 @@ config DISPLAY_NRF_LED_MATRIX default y depends on DT_HAS_NORDIC_NRF_LED_MATRIX_ENABLED select NRFX_GPIOTE - select NRFX_PPI if HAS_HW_NRF_PPI + select NRFX_GPPI help Enable driver for a LED matrix with rows and columns driven by GPIOs. The driver allows setting one of 256 levels of brightness diff --git a/drivers/display/display_nrf_led_matrix.c b/drivers/display/display_nrf_led_matrix.c index 79ae6652807a..babd10eb0464 100644 --- a/drivers/display/display_nrf_led_matrix.c +++ b/drivers/display/display_nrf_led_matrix.c @@ -13,10 +13,8 @@ #include #endif #include -#ifdef PPI_PRESENT -#include -#endif -#include +#include +#include #include #include LOG_MODULE_REGISTER(nrf_led_matrix, CONFIG_DISPLAY_LOG_LEVEL); @@ -91,7 +89,7 @@ struct display_drv_config { #if USE_PWM NRF_PWM_Type *pwm; #else - nrfx_gpiote_t gpiote; + nrfx_gpiote_t *gpiote; #endif uint8_t rows[ROW_COUNT]; uint8_t cols[COL_COUNT]; @@ -327,7 +325,7 @@ static void prepare_pixel_pulse(const struct device *dev, /* First timer channel is used for timing the period of pulses. */ nrf_timer_cc_set(dev_config->timer, 1 + channel_idx, pulse); - dev_config->gpiote.p_reg->CONFIG[dev_data->gpiote_ch[channel_idx]] = gpiote_cfg; + dev_config->gpiote->p_reg->CONFIG[dev_data->gpiote_ch[channel_idx]] = gpiote_cfg; #endif /* USE_PWM */ } @@ -357,7 +355,7 @@ static void timer_irq_handler(void *arg) } #else for (int i = 0; i < GROUP_SIZE; ++i) { - dev_config->gpiote.p_reg->CONFIG[dev_data->gpiote_ch[i]] = 0; + dev_config->gpiote->p_reg->CONFIG[dev_data->gpiote_ch[i]] = 0; } #endif @@ -437,38 +435,37 @@ static int instance_init(const struct device *dev) nrf_pwm_loop_set(dev_config->pwm, 0); nrf_pwm_shorts_set(dev_config->pwm, NRF_PWM_SHORT_SEQEND0_STOP_MASK); #else - nrfx_err_t err; - nrf_ppi_channel_t ppi_ch; + nrfx_gppi_handle_t ppi_handle; + int rv; for (int i = 0; i < GROUP_SIZE; ++i) { uint8_t *gpiote_ch = &dev_data->gpiote_ch[i]; - err = nrfx_ppi_channel_alloc(&ppi_ch); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to allocate PPI channel."); + rv = nrfx_gpiote_channel_alloc(dev_config->gpiote, gpiote_ch); + if (rv != 0) { + LOG_ERR("Failed to allocate GPIOTE channel."); /* Do not bother with freeing resources allocated * so far. The application needs to be reconfigured * anyway. */ - return -ENOMEM; + return rv; } - err = nrfx_gpiote_channel_alloc(&dev_config->gpiote, gpiote_ch); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to allocate GPIOTE channel."); + rv = nrfx_gppi_conn_alloc( + nrf_timer_event_address_get(dev_config->timer, + nrf_timer_compare_event_get(1 + i)), + nrf_gpiote_event_address_get(dev_config->gpiote->p_reg, + nrf_gpiote_out_task_get(*gpiote_ch)), + &ppi_handle); + if (rv < 0) { + LOG_ERR("Failed to allocate PPI channel."); /* Do not bother with freeing resources allocated * so far. The application needs to be reconfigured * anyway. */ - return -ENOMEM; + return rv; } - - nrf_ppi_channel_endpoint_setup(NRF_PPI, ppi_ch, - nrf_timer_event_address_get(dev_config->timer, - nrf_timer_compare_event_get(1 + i)), - nrf_gpiote_event_address_get(dev_config->gpiote.p_reg, - nrf_gpiote_out_task_get(*gpiote_ch))); - nrf_ppi_channel_enable(NRF_PPI, ppi_ch); + nrfx_gppi_conn_enable(ppi_handle); } #endif /* USE_PWM */ @@ -542,8 +539,7 @@ static const struct display_drv_config instance_config = { #if USE_PWM .pwm = (NRF_PWM_Type *)DT_REG_ADDR(PWM_NODE), #else - .gpiote = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST_BY_IDX(MATRIX_NODE, col_gpios, 0)), + .gpiote = &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(MATRIX_NODE, col_gpios)), #endif .rows = { DT_FOREACH_PROP_ELEM(MATRIX_NODE, row_gpios, GET_PIN_INFO) }, .cols = { DT_FOREACH_PROP_ELEM(MATRIX_NODE, col_gpios, GET_PIN_INFO) }, diff --git a/drivers/entropy/entropy_nrf_cracen.c b/drivers/entropy/entropy_nrf_cracen.c index 8c34a06db61a..a4e3c25abbcd 100644 --- a/drivers/entropy/entropy_nrf_cracen.c +++ b/drivers/entropy/entropy_nrf_cracen.c @@ -23,12 +23,10 @@ static int nrf_cracen_get_entropy_isr(const struct device *dev, uint8_t *buf, ui irq_unlock(key); - if (likely(ret == NRFX_SUCCESS)) { + if (likely(ret == 0)) { return len; - } else if (ret == NRFX_ERROR_INVALID_PARAM) { - return -EINVAL; } else { - return -EAGAIN; + return ret; } } @@ -47,13 +45,7 @@ static int nrf_cracen_cracen_init(const struct device *dev) { (void)dev; - int ret = nrfx_cracen_ctr_drbg_init(); - - if (ret == NRFX_SUCCESS) { - return 0; - } else { - return -EIO; - } + return nrfx_cracen_ctr_drbg_init(); } static DEVICE_API(entropy, nrf_cracen_api_funcs) = { diff --git a/drivers/flash/nrf_qspi_nor.c b/drivers/flash/nrf_qspi_nor.c index 110a2d27c7e9..446216dd29ff 100644 --- a/drivers/flash/nrf_qspi_nor.c +++ b/drivers/flash/nrf_qspi_nor.c @@ -22,7 +22,6 @@ LOG_MODULE_REGISTER(qspi_nor, CONFIG_FLASH_LOG_LEVEL); #include "spi_nor.h" #include "jesd216.h" #include "flash_priv.h" -#include #include #include #include @@ -111,7 +110,7 @@ BUILD_ASSERT(INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 16), #define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1 #define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV1 /* If anomaly 159 is to be prevented, only /1 divider can be used. */ -#elif NRF53_ERRATA_159_ENABLE_WORKAROUND +#elif NRF_ERRATA_STATIC_CHECK(53, 159) #define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1 #define INST_0_SCK_CFG (DIV_ROUND_UP(NRF_QSPI_BASE_CLOCK_FREQ, \ INST_0_SCK_FREQUENCY) - 1) @@ -238,32 +237,6 @@ static int exit_dpd(const struct device *const dev); #define QSPI_IS_SECTOR_ALIGNED(_ofs) (((_ofs) & (QSPI_SECTOR_SIZE - 1U)) == 0) #define QSPI_IS_BLOCK_ALIGNED(_ofs) (((_ofs) & (QSPI_BLOCK_SIZE - 1U)) == 0) -/** - * @brief Converts NRFX return codes to the zephyr ones - */ -static inline int qspi_get_zephyr_ret_code(nrfx_err_t res) -{ - switch (res) { - case NRFX_SUCCESS: - return 0; - case NRFX_ERROR_INVALID_PARAM: - case NRFX_ERROR_INVALID_ADDR: - return -EINVAL; - case NRFX_ERROR_INVALID_STATE: - return -ECANCELED; -#if NRF53_ERRATA_159_ENABLE_WORKAROUND - case NRFX_ERROR_FORBIDDEN: - LOG_ERR("nRF5340 anomaly 159 conditions detected"); - LOG_ERR("Set the CPU clock to 64 MHz before starting QSPI operation"); - return -ECANCELED; -#endif - case NRFX_ERROR_BUSY: - case NRFX_ERROR_TIMEOUT: - default: - return -EBUSY; - } -} - static inline void qspi_lock(const struct device *dev) { #ifdef CONFIG_MULTITHREADING @@ -375,12 +348,11 @@ static void qspi_release(const struct device *dev) } } -static inline void qspi_wait_for_completion(const struct device *dev, - nrfx_err_t res) +static inline void qspi_wait_for_completion(const struct device *dev, int res) { struct qspi_nor_data *dev_data = dev->data; - if (res == NRFX_SUCCESS) { + if (res == 0) { #ifdef CONFIG_MULTITHREADING k_sem_take(&dev_data->sync, K_FOREVER); #else /* CONFIG_MULTITHREADING */ @@ -476,9 +448,7 @@ static int qspi_send_cmd(const struct device *dev, const struct qspi_cmd *cmd, .wren = wren, }; - int res = nrfx_qspi_cinstr_xfer(&cinstr_cfg, tx_buf, rx_buf); - - return qspi_get_zephyr_ret_code(res); + return nrfx_qspi_cinstr_xfer(&cinstr_cfg, tx_buf, rx_buf); } /* RDSR. Negative value is error. */ @@ -606,7 +576,7 @@ static int qspi_erase(const struct device *dev, uint32_t addr, uint32_t size) return rc; } while (size > 0) { - nrfx_err_t res = !NRFX_SUCCESS; + int res = -1; uint32_t adj = 0; if (size == params->size) { @@ -626,11 +596,11 @@ static int qspi_erase(const struct device *dev, uint32_t addr, uint32_t size) } else { /* minimal erase size is at least a sector size */ LOG_ERR("unsupported at 0x%lx size %zu", (long)addr, size); - res = NRFX_ERROR_INVALID_PARAM; + res = -EINVAL; } qspi_wait_for_completion(dev, res); - if (res == NRFX_SUCCESS) { + if (res == 0) { addr += adj; size -= adj; @@ -645,7 +615,7 @@ static int qspi_erase(const struct device *dev, uint32_t addr, uint32_t size) } } else { LOG_ERR("erase error at 0x%lx size %zu", (long)addr, size); - rc = qspi_get_zephyr_ret_code(res); + rc = res; break; } } @@ -780,24 +750,24 @@ static int qspi_sfdp_read(const struct device *dev, off_t offset, .io2_level = true, .io3_level = true, }; - nrfx_err_t res; + int res; qspi_acquire(dev); res = nrfx_qspi_lfm_start(&cinstr_cfg); - if (res != NRFX_SUCCESS) { + if (res != 0) { LOG_DBG("lfm_start: %x", res); goto out; } res = nrfx_qspi_lfm_xfer(addr_buf, NULL, sizeof(addr_buf), false); - if (res != NRFX_SUCCESS) { + if (res != 0) { LOG_DBG("lfm_xfer addr: %x", res); goto out; } res = nrfx_qspi_lfm_xfer(NULL, data, len, true); - if (res != NRFX_SUCCESS) { + if (res != 0) { LOG_DBG("lfm_xfer read: %x", res); goto out; } @@ -805,14 +775,14 @@ static int qspi_sfdp_read(const struct device *dev, off_t offset, out: qspi_release(dev); - return qspi_get_zephyr_ret_code(res); + return res; } #endif /* CONFIG_FLASH_JESD216_API */ -static inline nrfx_err_t read_non_aligned(const struct device *dev, - off_t addr, - void *dest, size_t size) +static inline int read_non_aligned(const struct device *dev, + off_t addr, + void *dest, size_t size) { uint8_t __aligned(WORD_SIZE) buf[WORD_SIZE * 2]; uint8_t *dptr = dest; @@ -839,14 +809,14 @@ static inline nrfx_err_t read_non_aligned(const struct device *dev, flash_suffix = size - flash_prefix - flash_middle; } - nrfx_err_t res = NRFX_SUCCESS; + int res = 0; /* read from aligned flash to aligned memory */ if (flash_middle != 0) { res = nrfx_qspi_read(dptr + dest_prefix, flash_middle, addr + flash_prefix); qspi_wait_for_completion(dev, res); - if (res != NRFX_SUCCESS) { + if (res != 0) { return res; } @@ -861,7 +831,7 @@ static inline nrfx_err_t read_non_aligned(const struct device *dev, res = nrfx_qspi_read(buf, WORD_SIZE, addr - (WORD_SIZE - flash_prefix)); qspi_wait_for_completion(dev, res); - if (res != NRFX_SUCCESS) { + if (res != 0) { return res; } memcpy(dptr, buf + WORD_SIZE - flash_prefix, flash_prefix); @@ -872,7 +842,7 @@ static inline nrfx_err_t read_non_aligned(const struct device *dev, res = nrfx_qspi_read(buf, WORD_SIZE * 2, addr + flash_prefix + flash_middle); qspi_wait_for_completion(dev, res); - if (res != NRFX_SUCCESS) { + if (res != 0) { return res; } memcpy(dptr + flash_prefix + flash_middle, buf, flash_suffix); @@ -885,7 +855,7 @@ static int qspi_nor_read(const struct device *dev, off_t addr, void *dest, size_t size) { const struct qspi_nor_config *params = dev->config; - nrfx_err_t res; + int res; if (!dest) { return -EINVAL; @@ -911,15 +881,15 @@ static int qspi_nor_read(const struct device *dev, off_t addr, void *dest, qspi_release(dev); - return qspi_get_zephyr_ret_code(res); + return res; } /* addr aligned, sptr not null, slen less than 4 */ -static inline nrfx_err_t write_sub_word(const struct device *dev, off_t addr, - const void *sptr, size_t slen) +static inline int write_sub_word(const struct device *dev, off_t addr, + const void *sptr, size_t slen) { uint8_t __aligned(4) buf[4]; - nrfx_err_t res; + int res; /* read out the whole word so that unchanged data can be * written back @@ -927,7 +897,7 @@ static inline nrfx_err_t write_sub_word(const struct device *dev, off_t addr, res = nrfx_qspi_read(buf, sizeof(buf), addr); qspi_wait_for_completion(dev, res); - if (res == NRFX_SUCCESS) { + if (res == 0) { memcpy(buf, sptr, slen); res = nrfx_qspi_write(buf, sizeof(buf), addr); qspi_wait_for_completion(dev, res); @@ -944,30 +914,30 @@ BUILD_ASSERT((CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE % 4) == 0, * * If not enabled return the error the peripheral would have produced. */ -static nrfx_err_t write_through_buffer(const struct device *dev, off_t addr, +static int write_through_buffer(const struct device *dev, off_t addr, const void *sptr, size_t slen) { - nrfx_err_t res = NRFX_SUCCESS; + int res = 0; if (CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE > 0) { uint8_t __aligned(4) buf[CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE]; const uint8_t *sp = sptr; - while ((slen > 0) && (res == NRFX_SUCCESS)) { + while ((slen > 0) && (res == 0)) { size_t len = MIN(slen, sizeof(buf)); memcpy(buf, sp, len); res = nrfx_qspi_write(buf, len, addr); qspi_wait_for_completion(dev, res); - if (res == NRFX_SUCCESS) { + if (res == 0) { slen -= len; sp += len; addr += len; } } } else { - res = NRFX_ERROR_INVALID_ADDR; + res = -EACCES; } return res; } @@ -1006,19 +976,15 @@ static int qspi_nor_write(const struct device *dev, off_t addr, rc = qspi_nor_write_protection_set(dev, false); if (rc == 0) { - nrfx_err_t res; - if (size < 4U) { - res = write_sub_word(dev, addr, src, size); + rc = write_sub_word(dev, addr, src, size); } else if (!nrfx_is_in_ram(src) || !nrfx_is_word_aligned(src)) { - res = write_through_buffer(dev, addr, src, size); + rc = write_through_buffer(dev, addr, src, size); } else { - res = nrfx_qspi_write(src, size, addr); - qspi_wait_for_completion(dev, res); + rc = nrfx_qspi_write(src, size, addr); + qspi_wait_for_completion(dev, rc); } - - rc = qspi_get_zephyr_ret_code(res); } rc2 = qspi_nor_write_protection_set(dev, true); @@ -1080,11 +1046,9 @@ static int qspi_init(const struct device *dev) { const struct qspi_nor_config *dev_config = dev->config; uint8_t id[SPI_NOR_MAX_ID_LEN]; - nrfx_err_t res; int rc; - res = nrfx_qspi_init(&dev_config->nrfx_cfg, qspi_handler, dev->data); - rc = qspi_get_zephyr_ret_code(res); + rc = nrfx_qspi_init(&dev_config->nrfx_cfg, qspi_handler, dev->data); if (rc < 0) { return rc; } @@ -1269,15 +1233,14 @@ static int exit_dpd(const struct device *const dev) .op_code = SPI_NOR_CMD_RDPD, }; uint32_t t_exit_dpd = DT_INST_PROP_OR(0, t_exit_dpd, 0); - nrfx_err_t res; int rc; nrf_qspi_pins_get(NRF_QSPI, &pins); nrf_qspi_pins_set(NRF_QSPI, &disconnected_pins); - res = nrfx_qspi_activate(true); + rc = nrfx_qspi_activate(true); nrf_qspi_pins_set(NRF_QSPI, &pins); - if (res != NRFX_SUCCESS) { + if (rc != 0) { return -EIO; } @@ -1301,11 +1264,10 @@ static int exit_dpd(const struct device *const dev) static int qspi_suspend(const struct device *dev) { const struct qspi_nor_config *dev_config = dev->config; - nrfx_err_t res; int rc; - res = nrfx_qspi_mem_busy_check(); - if (res != NRFX_SUCCESS) { + rc = nrfx_qspi_mem_busy_check(); + if (rc != 0) { return -EBUSY; } @@ -1322,7 +1284,6 @@ static int qspi_suspend(const struct device *dev) static int qspi_resume(const struct device *dev) { const struct qspi_nor_config *dev_config = dev->config; - nrfx_err_t res; int rc; rc = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); @@ -1330,9 +1291,9 @@ static int qspi_resume(const struct device *dev) return rc; } - res = nrfx_qspi_init(&dev_config->nrfx_cfg, qspi_handler, dev->data); - if (res != NRFX_SUCCESS) { - return -EIO; + rc = nrfx_qspi_init(&dev_config->nrfx_cfg, qspi_handler, dev->data); + if (rc < 0) { + return rc; } return exit_dpd(dev); diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 574739082dc4..dbbb1da7a985 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -15,7 +15,6 @@ #include #include #include -#include #include "soc_flash_nrf.h" @@ -121,7 +120,7 @@ static inline bool is_uicr_addr_valid(off_t addr, size_t len) #endif /* CONFIG_SOC_FLASH_NRF_UICR */ } -#if CONFIG_SOC_FLASH_NRF_UICR && IS_ENABLED(NRF91_ERRATA_7_ENABLE_WORKAROUND) +#if CONFIG_SOC_FLASH_NRF_UICR && NRF_ERRATA_STATIC_CHECK(91, 7) static inline void nrf91_errata_7_enter(void) { __disable_irq(); @@ -164,7 +163,7 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } -#if CONFIG_SOC_FLASH_NRF_UICR && IS_ENABLED(NRF91_ERRATA_7_ENABLE_WORKAROUND) +#if CONFIG_SOC_FLASH_NRF_UICR && NRF_ERRATA_STATIC_CHECK(91, 7) if (within_uicr) { nrf_buffer_read_91_uicr(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_mramc.c b/drivers/flash/soc_flash_nrf_mramc.c index 7e3a88af2b23..bfc0980816ba 100644 --- a/drivers/flash/soc_flash_nrf_mramc.c +++ b/drivers/flash/soc_flash_nrf_mramc.c @@ -186,11 +186,11 @@ static int mramc_sys_init(const struct device *dev) ARG_UNUSED(dev); nrfx_mramc_config_t config = NRFX_MRAMC_DEFAULT_CONFIG(); - nrfx_err_t err = nrfx_mramc_init(&config, NULL); + int ret = nrfx_mramc_init(&config, NULL); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize MRAMC: %d", err); - return -EIO; + if (ret != 0) { + LOG_ERR("Failed to initialize MRAMC: %d", ret); + return ret; } LOG_DBG("MRAMC initialized successfully"); return 0; diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index fcf0b2f8d27c..5661aeafe2f1 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -7,8 +7,10 @@ #define DT_DRV_COMPAT nordic_nrf_gpio #include +#include #include #include +#include #include #include #include @@ -45,9 +47,9 @@ struct gpio_nrfx_cfg { /* gpio_driver_config needs to be first */ struct gpio_driver_config common; NRF_GPIO_Type *port; + nrfx_gpiote_t *gpiote; uint32_t edge_sense; uint8_t port_num; - nrfx_gpiote_t gpiote; #if defined(GPIOTE_FEATURE_FLAG) uint32_t flags; #endif @@ -63,9 +65,16 @@ static inline const struct gpio_nrfx_cfg *get_port_cfg(const struct device *port return port->config; } +void *gpio_nrf_gpiote_by_port_get(const struct device *port) +{ + const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); + + return cfg->gpiote; +} + static bool has_gpiote(const struct gpio_nrfx_cfg *cfg) { - return cfg->gpiote.p_reg != NULL; + return cfg->gpiote != NULL; } #if NRF_GPIO_HAS_RETENTION_SETCLEAR @@ -111,7 +120,7 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, gpio_flags_t flags) { int ret = 0; - nrfx_err_t err = NRFX_SUCCESS; + int err = 0; uint8_t ch; bool free_ch = false; const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); @@ -173,13 +182,13 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, * to be freed when the pin is reconfigured or disconnected. */ if (IS_ENABLED(CONFIG_GPIO_NRFX_INTERRUPT)) { - err = nrfx_gpiote_channel_get(&cfg->gpiote, abs_pin, &ch); - free_ch = (err == NRFX_SUCCESS); + err = nrfx_gpiote_channel_get(cfg->gpiote, abs_pin, &ch); + free_ch = (err == 0); } if ((flags & (GPIO_INPUT | GPIO_OUTPUT)) == GPIO_DISCONNECTED) { /* Ignore the error code. The pin may not have been used. */ - (void)nrfx_gpiote_pin_uninit(&cfg->gpiote, abs_pin); + (void)nrfx_gpiote_pin_uninit(cfg->gpiote, abs_pin); } else { /* Remove previously configured trigger when pin is reconfigured. */ if (IS_ENABLED(CONFIG_GPIO_NRFX_INTERRUPT)) { @@ -190,11 +199,9 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, .p_trigger_config = &trigger_config, }; - err = nrfx_gpiote_input_configure(&cfg->gpiote, + err = nrfx_gpiote_input_configure(cfg->gpiote, abs_pin, &input_pin_config); - if (err != NRFX_SUCCESS) { - ret = -EINVAL; - + if (err < 0) { goto end; } } @@ -208,7 +215,7 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, .pull = pull, }; - err = nrfx_gpiote_output_configure(&cfg->gpiote, + err = nrfx_gpiote_output_configure(cfg->gpiote, abs_pin, &output_config, NULL); port_retain_set(cfg, BIT(pin)); @@ -217,12 +224,11 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, .p_pull_config = &pull, }; - err = nrfx_gpiote_input_configure(&cfg->gpiote, + err = nrfx_gpiote_input_configure(cfg->gpiote, abs_pin, &input_pin_config); } - if (err != NRFX_SUCCESS) { - ret = -EINVAL; + if (err < 0) { goto end; } } @@ -234,8 +240,8 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, goto end; } #endif - err = nrfx_gpiote_channel_free(&cfg->gpiote, ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); + err = nrfx_gpiote_channel_free(cfg->gpiote, ch); + __ASSERT_NO_MSG(err == 0); } end: @@ -391,7 +397,7 @@ static nrfx_gpiote_trigger_t get_trigger(enum gpio_int_mode mode, NRFX_GPIOTE_TRIGGER_LOTOHI; } -static nrfx_err_t chan_alloc(const struct gpio_nrfx_cfg *cfg, gpio_pin_t pin, uint8_t *ch) +static int chan_alloc(const struct gpio_nrfx_cfg *cfg, gpio_pin_t pin, uint8_t *ch) { #ifdef GPIOTE_FEATURE_FLAG if (cfg->flags & GPIOTE_FLAG_FIXED_CHAN) { @@ -401,25 +407,25 @@ static nrfx_err_t chan_alloc(const struct gpio_nrfx_cfg *cfg, gpio_pin_t pin, ui * - P1: channel => pin - 4, e.g. P1.4 => channel 0, P1.5 => channel 1 * - P2: channel => pin % 8, e.g. P2.0 => channel 0, P2.8 => channel 0 */ - nrfx_err_t err = NRFX_SUCCESS; + int err = 0; if (cfg->port_num == 1) { if (pin < 4) { - err = NRFX_ERROR_INVALID_PARAM; + err = -EINVAL; } else { *ch = pin - 4; } } else if (cfg->port_num == 2) { *ch = pin & 0x7; } else { - err = NRFX_ERROR_INVALID_PARAM; + err = -EINVAL; } return err; } #endif - return nrfx_gpiote_channel_alloc(&cfg->gpiote, ch); + return nrfx_gpiote_channel_alloc(cfg->gpiote, ch); } static int gpio_nrfx_pin_interrupt_configure(const struct device *port, @@ -429,7 +435,7 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, { const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); uint32_t abs_pin = NRF_GPIO_PIN_MAP(cfg->port_num, pin); - nrfx_err_t err; + int err; uint8_t ch; if (!has_gpiote(cfg)) { @@ -437,7 +443,7 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, } if (mode == GPIO_INT_MODE_DISABLED) { - nrfx_gpiote_trigger_disable(&cfg->gpiote, abs_pin); + nrfx_gpiote_trigger_disable(cfg->gpiote, abs_pin); return 0; } @@ -455,11 +461,11 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, if (!(BIT(pin) & cfg->edge_sense) && (mode == GPIO_INT_MODE_EDGE) && (nrf_gpio_pin_dir_get(abs_pin) == NRF_GPIO_PIN_DIR_INPUT)) { - err = nrfx_gpiote_channel_get(&cfg->gpiote, abs_pin, &ch); - if (err == NRFX_ERROR_INVALID_PARAM) { + err = nrfx_gpiote_channel_get(cfg->gpiote, abs_pin, &ch); + if (err == -EINVAL) { err = chan_alloc(cfg, pin, &ch); - if (err != NRFX_SUCCESS) { - return -ENOMEM; + if (err < 0) { + return err; } } @@ -473,19 +479,19 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, /* If edge mode with channel was previously used and we are changing to sense or * level triggered, we must free the channel. */ - err = nrfx_gpiote_channel_get(&cfg->gpiote, abs_pin, &ch); - if (err == NRFX_SUCCESS) { - err = nrfx_gpiote_channel_free(&cfg->gpiote, ch); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); + err = nrfx_gpiote_channel_get(cfg->gpiote, abs_pin, &ch); + if (err == 0) { + err = nrfx_gpiote_channel_free(cfg->gpiote, ch); + __ASSERT_NO_MSG(err == 0); } } - err = nrfx_gpiote_input_configure(&cfg->gpiote, abs_pin, &input_pin_config); - if (err != NRFX_SUCCESS) { - return -EINVAL; + err = nrfx_gpiote_input_configure(cfg->gpiote, abs_pin, &input_pin_config); + if (err < 0) { + return err; } - nrfx_gpiote_trigger_enable(&cfg->gpiote, abs_pin, true); + nrfx_gpiote_trigger_enable(cfg->gpiote, abs_pin, true); return 0; } @@ -574,9 +580,26 @@ static void nrfx_gpio_handler(nrfx_gpiote_pin_t abs_pin, } #endif /* CONFIG_GPIO_NRFX_INTERRUPT */ -#define GPIOTE_IRQ_HANDLER_CONNECT(node_id) \ - IRQ_CONNECT(DT_IRQN(node_id), DT_IRQ(node_id, priority), nrfx_isr, \ - NRFX_CONCAT(nrfx_gpiote_, DT_PROP(node_id, instance), _irq_handler), 0); +#ifdef CONFIG_GPIO_NRFX_INTERRUPT +/* Wrap nrfx IRQ handler to make native builds happy, as providing nrfx IRQ handler + * directly in IRQ_CONNECT causes complaints about mismatched types. + * Casting brings similar effect, however clashes with IRQ_CONNECT macro implementation + * for non-native builds. + */ +void gpio_nrfx_gpiote_irq_handler(void const *param) +{ + nrfx_gpiote_t *gpiote = (nrfx_gpiote_t *)param; + + nrfx_gpiote_irq_handler(gpiote); +} +#endif + +#define GPIOTE_IRQ_HANDLER_CONNECT(node_id) \ + IRQ_CONNECT(DT_IRQN(node_id), \ + DT_IRQ(node_id, priority), \ + gpio_nrfx_gpiote_irq_handler, \ + &GPIOTE_NRFX_INST_BY_NODE(node_id), \ + 0); static int gpio_nrfx_pm_hook(const struct device *port, enum pm_device_action action) { @@ -588,23 +611,23 @@ static int gpio_nrfx_pm_hook(const struct device *port, enum pm_device_action ac static int gpio_nrfx_init(const struct device *port) { const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); - nrfx_err_t err; + int err; if (!has_gpiote(cfg)) { goto pm_init; } - if (nrfx_gpiote_init_check(&cfg->gpiote)) { + if (nrfx_gpiote_init_check(cfg->gpiote)) { goto pm_init; } - err = nrfx_gpiote_init(&cfg->gpiote, 0 /*not used*/); - if (err != NRFX_SUCCESS) { + err = nrfx_gpiote_init(cfg->gpiote, 0 /*not used*/); + if (err != 0) { return -EIO; } #ifdef CONFIG_GPIO_NRFX_INTERRUPT - nrfx_gpiote_global_callback_set(&cfg->gpiote, nrfx_gpio_handler, NULL); + nrfx_gpiote_global_callback_set(cfg->gpiote, nrfx_gpio_handler, NULL); DT_FOREACH_STATUS_OKAY(nordic_nrf_gpiote, GPIOTE_IRQ_HANDLER_CONNECT); #endif /* CONFIG_GPIO_NRFX_INTERRUPT */ @@ -631,35 +654,36 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { #endif }; -#define GPIOTE_INST(id) DT_PROP(GPIOTE_PHANDLE(id), instance) - -#define GPIOTE_INSTANCE(id) \ - COND_CODE_1(DT_INST_NODE_HAS_PROP(id, gpiote_instance), \ - (NRFX_GPIOTE_INSTANCE(GPIOTE_INST(id))), \ - ({ .p_reg = NULL })) - /* Device instantiation is done with node labels because 'port_num' is * the peripheral number by SoC numbering. We therefore cannot use * DT_INST APIs here without wider changes. */ +#define HAS_GPIOTE(id) DT_INST_NODE_HAS_PROP(id, gpiote_instance) + #define GPIOTE_CHECK(id) \ - COND_CODE_1(DT_INST_NODE_HAS_PROP(id, gpiote_instance), \ - (BUILD_ASSERT(DT_NODE_HAS_STATUS_OKAY(GPIOTE_PHANDLE(id)), \ + COND_CODE_1(HAS_GPIOTE(id), \ + (BUILD_ASSERT(DT_NODE_HAS_STATUS_OKAY(GPIOTE_PHANDLE(id)), \ "Please enable GPIOTE instance for used GPIO port!")), \ ()) +#define GPIOTE_REF(id) \ + COND_CODE_1(HAS_GPIOTE(id), \ + (&GPIOTE_NRFX_INST_BY_NODE(GPIOTE_PHANDLE(id))), \ + (NULL)) + #define GPIO_NRF_DEVICE(id) \ GPIOTE_CHECK(id); \ + static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \ static const struct gpio_nrfx_cfg gpio_nrfx_p##id##_cfg = { \ .common = { \ .port_pin_mask = \ GPIO_PORT_PIN_MASK_FROM_DT_INST(id), \ }, \ .port = _CONCAT(NRF_P, DT_INST_PROP(id, port)), \ - .port_num = DT_INST_PROP(id, port), \ + .gpiote = GPIOTE_REF(id), \ .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ - .gpiote = GPIOTE_INSTANCE(id), \ + .port_num = DT_INST_PROP(id, port), \ IF_ENABLED(GPIOTE_FEATURE_FLAG, \ (.flags = \ (DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) ? \ @@ -669,8 +693,6 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { ) \ }; \ \ - static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \ - \ PM_DEVICE_DT_INST_DEFINE(id, gpio_nrfx_pm_hook); \ \ DEVICE_DT_INST_DEFINE(id, gpio_nrfx_init, \ diff --git a/drivers/i2c/Kconfig.nrfx b/drivers/i2c/Kconfig.nrfx index 54d533636747..c6a7dbeadcf7 100644 --- a/drivers/i2c/Kconfig.nrfx +++ b/drivers/i2c/Kconfig.nrfx @@ -23,25 +23,7 @@ config I2C_NRFX_TWI config I2C_NRFX_TWIM def_bool y depends on DT_HAS_NORDIC_NRF_TWIM_ENABLED - select NRFX_TWIM0 if HAS_HW_NRF_TWIM0 - select NRFX_TWIM1 if HAS_HW_NRF_TWIM1 - select NRFX_TWIM2 if HAS_HW_NRF_TWIM2 - select NRFX_TWIM3 if HAS_HW_NRF_TWIM3 - select NRFX_TWIM20 if HAS_HW_NRF_TWIM20 - select NRFX_TWIM21 if HAS_HW_NRF_TWIM21 - select NRFX_TWIM22 if HAS_HW_NRF_TWIM22 - select NRFX_TWIM23 if HAS_HW_NRF_TWIM23 - select NRFX_TWIM24 if HAS_HW_NRF_TWIM24 - select NRFX_TWIM30 if HAS_HW_NRF_TWIM30 - select NRFX_TWIM120 if HAS_HW_NRF_TWIM120 - select NRFX_TWIM130 if HAS_HW_NRF_TWIM130 - select NRFX_TWIM131 if HAS_HW_NRF_TWIM131 - select NRFX_TWIM132 if HAS_HW_NRF_TWIM132 - select NRFX_TWIM133 if HAS_HW_NRF_TWIM133 - select NRFX_TWIM134 if HAS_HW_NRF_TWIM134 - select NRFX_TWIM135 if HAS_HW_NRF_TWIM135 - select NRFX_TWIM136 if HAS_HW_NRF_TWIM136 - select NRFX_TWIM137 if HAS_HW_NRF_TWIM137 + select NRFX_TWIM config I2C_NRFX_TRANSFER_TIMEOUT int "Transfer timeout [ms]" @@ -56,23 +38,7 @@ config I2C_NRFX_TWIS depends on DT_HAS_NORDIC_NRF_TWIS_ENABLED depends on I2C_TARGET depends on I2C_TARGET_BUFFER_MODE - select NRFX_TWIS0 if HAS_HW_NRF_TWIS0 - select NRFX_TWIS1 if HAS_HW_NRF_TWIS1 - select NRFX_TWIS2 if HAS_HW_NRF_TWIS2 - select NRFX_TWIS3 if HAS_HW_NRF_TWIS3 - select NRFX_TWIS20 if HAS_HW_NRF_TWIS20 - select NRFX_TWIS21 if HAS_HW_NRF_TWIS21 - select NRFX_TWIS22 if HAS_HW_NRF_TWIS22 - select NRFX_TWIS23 if HAS_HW_NRF_TWIS23 - select NRFX_TWIS24 if HAS_HW_NRF_TWIS24 - select NRFX_TWIS30 if HAS_HW_NRF_TWIS30 - select NRFX_TWIS130 if HAS_HW_NRF_TWIS130 - select NRFX_TWIS131 if HAS_HW_NRF_TWIS131 - select NRFX_TWIS133 if HAS_HW_NRF_TWIS133 - select NRFX_TWIS134 if HAS_HW_NRF_TWIS134 - select NRFX_TWIS135 if HAS_HW_NRF_TWIS135 - select NRFX_TWIS136 if HAS_HW_NRF_TWIS136 - select NRFX_TWIS137 if HAS_HW_NRF_TWIS137 + select NRFX_TWIS if I2C_NRFX_TWIS diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c index c2c0a28d8756..a28ec6f08a05 100644 --- a/drivers/i2c/i2c_nrfx_twi.c +++ b/drivers/i2c/i2c_nrfx_twi.c @@ -27,7 +27,7 @@ struct i2c_nrfx_twi_data { uint32_t dev_config; struct k_sem transfer_sync; struct k_sem completion_sync; - volatile nrfx_err_t res; + volatile int res; }; /* Enforce dev_config matches the same offset as the common structure, @@ -109,16 +109,16 @@ static void event_handler(nrfx_twi_evt_t const *p_event, void *p_context) switch (p_event->type) { case NRFX_TWI_EVT_DONE: - dev_data->res = NRFX_SUCCESS; + dev_data->res = 0; break; case NRFX_TWI_EVT_ADDRESS_NACK: - dev_data->res = NRFX_ERROR_DRV_TWI_ERR_ANACK; + dev_data->res = -EIO; break; case NRFX_TWI_EVT_DATA_NACK: - dev_data->res = NRFX_ERROR_DRV_TWI_ERR_DNACK; + dev_data->res = -EAGAIN; break; default: - dev_data->res = NRFX_ERROR_INTERNAL; + dev_data->res = -ECANCELED; break; } @@ -131,49 +131,40 @@ static DEVICE_API(i2c, i2c_nrfx_twi_driver_api) = { .recover_bus = i2c_nrfx_twi_recover_bus, }; -#define I2C_NRFX_TWI_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(idx) != \ - I2C_NRFX_TWI_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static int twi_##idx##_init(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ - nrfx_isr, nrfx_twi_##idx##_irq_handler, 0); \ - const struct i2c_nrfx_twi_config *config = dev->config; \ - int err = pinctrl_apply_state(config->pcfg, \ - PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - return i2c_nrfx_twi_init(dev); \ - } \ - static struct i2c_nrfx_twi_data twi_##idx##_data = { \ - .transfer_sync = Z_SEM_INITIALIZER( \ - twi_##idx##_data.transfer_sync, 1, 1), \ - .completion_sync = Z_SEM_INITIALIZER( \ - twi_##idx##_data.completion_sync, 0, 1) \ - }; \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ - .twi = NRFX_TWI_INSTANCE(idx), \ - .config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ - }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \ - I2C_DEVICE_DT_DEFINE(I2C(idx), \ - twi_##idx##_init, \ - PM_DEVICE_DT_GET(I2C(idx)), \ - &twi_##idx##_data, \ - &twi_##idx##z_config, \ - POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twi_driver_api) +#define I2C_NRFX_TWI_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(I2C(idx)) != I2C_NRFX_TWI_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static int twi_##idx##_init(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ + nrfx_twi_##idx##_irq_handler, 0); \ + const struct i2c_nrfx_twi_config *config = dev->config; \ + int err = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + return i2c_nrfx_twi_init(dev); \ + } \ + static struct i2c_nrfx_twi_data twi_##idx##_data = { \ + .transfer_sync = Z_SEM_INITIALIZER(twi_##idx##_data.transfer_sync, 1, 1), \ + .completion_sync = Z_SEM_INITIALIZER(twi_##idx##_data.completion_sync, 0, 1)}; \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ + .twi = NRFX_TWI_INSTANCE(idx), \ + .config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(I2C(idx)), \ + }, \ + .event_handler = event_handler, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + }; \ + PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \ + I2C_DEVICE_DT_DEFINE(I2C(idx), twi_##idx##_init, PM_DEVICE_DT_GET(I2C(idx)), \ + &twi_##idx##_data, &twi_##idx##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twi_driver_api) #ifdef CONFIG_HAS_HW_NRF_TWI0 I2C_NRFX_TWI_DEVICE(0); diff --git a/drivers/i2c/i2c_nrfx_twi_common.c b/drivers/i2c/i2c_nrfx_twi_common.c index 0d8bda63425f..2d07863e3d73 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.c +++ b/drivers/i2c/i2c_nrfx_twi_common.c @@ -16,12 +16,12 @@ LOG_MODULE_DECLARE(i2c_nrfx_twi); int i2c_nrfx_twi_init(const struct device *dev) { const struct i2c_nrfx_twi_config *config = dev->config; - nrfx_err_t result = nrfx_twi_init(&config->twi, &config->config, - config->event_handler, (void *)dev); - if (result != NRFX_SUCCESS) { + int result = nrfx_twi_init(&config->twi, &config->config, + config->event_handler, (void *)dev); + if (result != 0) { LOG_ERR("Failed to initialize device: %s", dev->name); - return -EBUSY; + return result; } return 0; @@ -58,13 +58,11 @@ int i2c_nrfx_twi_recover_bus(const struct device *dev) const struct i2c_nrfx_twi_config *config = dev->config; uint32_t scl_pin; uint32_t sda_pin; - nrfx_err_t err; scl_pin = nrf_twi_scl_pin_get(config->twi.p_twi); sda_pin = nrf_twi_sda_pin_get(config->twi.p_twi); - err = nrfx_twi_bus_recover(scl_pin, sda_pin); - return (err == NRFX_SUCCESS ? 0 : -EBUSY); + return nrfx_twi_bus_recover(scl_pin, sda_pin); } int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, @@ -74,7 +72,6 @@ int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, const struct i2c_nrfx_twi_config *config = dev->config; int ret = 0; uint32_t xfer_flags = 0; - nrfx_err_t res; nrfx_twi_xfer_desc_t cur_xfer = { .p_primary_buf = buf, .primary_length = buf_len, @@ -110,17 +107,7 @@ int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, } if (!ret) { - res = nrfx_twi_xfer(&config->twi, &cur_xfer, xfer_flags); - switch (res) { - case NRFX_SUCCESS: - break; - case NRFX_ERROR_BUSY: - ret = -EBUSY; - break; - default: - ret = -EIO; - break; - } + ret = nrfx_twi_xfer(&config->twi, &cur_xfer, xfer_flags); } return ret; diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index bc26bf841124..8eee1949bdf4 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -29,9 +29,10 @@ LOG_MODULE_REGISTER(i2c_nrfx_twim, CONFIG_I2C_LOG_LEVEL); #endif struct i2c_nrfx_twim_data { + nrfx_twim_t twim; struct k_sem transfer_sync; struct k_sem completion_sync; - volatile nrfx_err_t res; + volatile int res; }; int i2c_nrfx_twim_exclusive_access_acquire(const struct device *dev, k_timeout_t timeout) @@ -81,7 +82,7 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, break; } - bool dma_accessible = nrf_dma_accessible_check(&dev_config->twim, msgs[i].buf); + bool dma_accessible = nrf_dma_accessible_check(&dev_data->twim, msgs[i].buf); /* This fragment needs to be merged with the next one if: * - it is not the last fragment @@ -162,7 +163,7 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, break; } - if (dev_data->res != NRFX_SUCCESS) { + if (dev_data->res < 0) { ret = -EIO; break; } @@ -191,23 +192,23 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, return ret; } -static void event_handler(nrfx_twim_evt_t const *p_event, void *p_context) +static void event_handler(nrfx_twim_event_t const *p_event, void *p_context) { const struct device *dev = p_context; struct i2c_nrfx_twim_data *dev_data = dev->data; switch (p_event->type) { case NRFX_TWIM_EVT_DONE: - dev_data->res = NRFX_SUCCESS; + dev_data->res = 0; break; case NRFX_TWIM_EVT_ADDRESS_NACK: - dev_data->res = NRFX_ERROR_DRV_TWI_ERR_ANACK; + dev_data->res = -EFAULT; break; case NRFX_TWIM_EVT_DATA_NACK: - dev_data->res = NRFX_ERROR_DRV_TWI_ERR_DNACK; + dev_data->res = -EAGAIN; break; default: - dev_data->res = NRFX_ERROR_INTERNAL; + dev_data->res = -EIO; break; } @@ -238,142 +239,66 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { .recover_bus = i2c_nrfx_twim_recover_bus, }; -#define CONCAT_BUF_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_concat_buf_size), \ - (DT_PROP(I2C(idx), zephyr_concat_buf_size)), (0)) -#define FLASH_BUF_MAX_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_flash_buf_max_size), \ - (DT_PROP(I2C(idx), zephyr_flash_buf_max_size)), (0)) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_twim) +#define DT_DRV_COMPAT nordic_nrf_twim +#endif + +#define CONCAT_BUF_SIZE(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_concat_buf_size), \ + (DT_INST_PROP(idx, zephyr_concat_buf_size)), (0)) +#define FLASH_BUF_MAX_SIZE(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_flash_buf_max_size), \ + (DT_INST_PROP(idx, zephyr_flash_buf_max_size)), (0)) -#define USES_MSG_BUF(idx) \ - COND_CODE_0(CONCAT_BUF_SIZE(idx), \ - (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), \ +#define USES_MSG_BUF(idx) \ + COND_CODE_0(CONCAT_BUF_SIZE(idx), \ + (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), \ (1)) #define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) -#define I2C_NRFX_TWIM_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(idx) != \ - I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ - nrfx_isr, nrfx_twim_##idx##_irq_handler, 0); \ - } \ +#define I2C_NRFX_TWIM_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static struct i2c_nrfx_twim_data twim_##idx##_data; \ + static struct i2c_nrfx_twim_common_config twim_##idx##z_config; \ + static void pre_init##idx(void) \ + { \ + twim_##idx##z_config.twim = &twim_##idx##_data.twim; \ + twim_##idx##_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \ + IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \ + &twim_##idx##_data.twim, 0); \ + } \ IF_ENABLED(USES_MSG_BUF(idx), \ (static uint8_t twim_##idx##_msg_buf[MSG_BUF_SIZE(idx)] \ - I2C_MEMORY_SECTION(idx);)) \ - static struct i2c_nrfx_twim_data twim_##idx##_data; \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static const \ - struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ - .twim = NRFX_TWIM_INSTANCE(idx), \ - .twim_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + I2C_MEMORY_SECTION(idx);)) \ + PINCTRL_DT_INST_DEFINE(idx); \ + static struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .pre_init = pre_init##idx, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ IF_ENABLED(USES_MSG_BUF(idx), \ - (.msg_buf = twim_##idx##_msg_buf,)) \ - .max_transfer_size = BIT_MASK( \ - DT_PROP(I2C(idx), easydma_maxcnt_bits)), \ - }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \ - I2C_PM_ISR_SAFE(idx)); \ - I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \ - i2c_nrfx_twim_init, \ - i2c_nrfx_twim_deinit, \ - PM_DEVICE_DT_GET(I2C(idx)), \ - &twim_##idx##_data, \ - &twim_##idx##z_config, \ - POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twim_driver_api) - -#define I2C_MEMORY_SECTION(idx) \ - COND_CODE_1(I2C_HAS_PROP(idx, memory_regions), \ + (.msg_buf = twim_##idx##_msg_buf,)) .max_transfer_size = \ + BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)), \ + }; \ + PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ + I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \ + PM_DEVICE_DT_INST_GET(idx), &twim_##idx##_data, \ + &twim_##idx##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api) + +#define I2C_MEMORY_SECTION(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions), \ (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ - DT_PHANDLE(I2C(idx), memory_regions)))))), \ + DT_PHANDLE(DT_DRV_INST(idx), memory_regions)))))), \ ()) -#ifdef CONFIG_HAS_HW_NRF_TWIM0 -I2C_NRFX_TWIM_DEVICE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM1 -I2C_NRFX_TWIM_DEVICE(1); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM2 -I2C_NRFX_TWIM_DEVICE(2); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM3 -I2C_NRFX_TWIM_DEVICE(3); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM20 -I2C_NRFX_TWIM_DEVICE(20); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM21 -I2C_NRFX_TWIM_DEVICE(21); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM22 -I2C_NRFX_TWIM_DEVICE(22); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM23 -I2C_NRFX_TWIM_DEVICE(23); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM24 -I2C_NRFX_TWIM_DEVICE(24); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM30 -I2C_NRFX_TWIM_DEVICE(30); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM120 -I2C_NRFX_TWIM_DEVICE(120); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM130 -I2C_NRFX_TWIM_DEVICE(130); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM131 -I2C_NRFX_TWIM_DEVICE(131); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM132 -I2C_NRFX_TWIM_DEVICE(132); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM133 -I2C_NRFX_TWIM_DEVICE(133); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM134 -I2C_NRFX_TWIM_DEVICE(134); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM135 -I2C_NRFX_TWIM_DEVICE(135); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM136 -I2C_NRFX_TWIM_DEVICE(136); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM137 -I2C_NRFX_TWIM_DEVICE(137); -#endif +DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWIM_DEVICE) diff --git a/drivers/i2c/i2c_nrfx_twim_common.c b/drivers/i2c/i2c_nrfx_twim_common.c index f7fd0d097b0a..7e8dda45c9af 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.c +++ b/drivers/i2c/i2c_nrfx_twim_common.c @@ -20,15 +20,15 @@ int i2c_nrfx_twim_recover_bus(const struct device *dev) enum pm_device_state state; uint32_t scl_pin; uint32_t sda_pin; - nrfx_err_t err; + int err; - scl_pin = nrf_twim_scl_pin_get(config->twim.p_twim); - sda_pin = nrf_twim_sda_pin_get(config->twim.p_twim); + scl_pin = nrf_twim_scl_pin_get(config->twim->p_twim); + sda_pin = nrf_twim_sda_pin_get(config->twim->p_twim); /* disable peripheral if active (required to release SCL/SDA lines) */ (void)pm_device_state_get(dev, &state); if (state == PM_DEVICE_STATE_ACTIVE) { - nrfx_twim_disable(&config->twim); + nrfx_twim_disable(config->twim); } err = nrfx_twim_bus_recover(scl_pin, sda_pin); @@ -36,10 +36,10 @@ int i2c_nrfx_twim_recover_bus(const struct device *dev) /* restore peripheral if it was active before */ if (state == PM_DEVICE_STATE_ACTIVE) { (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); - nrfx_twim_enable(&config->twim); + nrfx_twim_enable(config->twim); } - return (err == NRFX_SUCCESS ? 0 : -EBUSY); + return err; } int i2c_nrfx_twim_configure(const struct device *dev, uint32_t i2c_config) @@ -52,14 +52,14 @@ int i2c_nrfx_twim_configure(const struct device *dev, uint32_t i2c_config) switch (I2C_SPEED_GET(i2c_config)) { case I2C_SPEED_STANDARD: - nrf_twim_frequency_set(config->twim.p_twim, NRF_TWIM_FREQ_100K); + nrf_twim_frequency_set(config->twim->p_twim, NRF_TWIM_FREQ_100K); break; case I2C_SPEED_FAST: - nrf_twim_frequency_set(config->twim.p_twim, NRF_TWIM_FREQ_400K); + nrf_twim_frequency_set(config->twim->p_twim, NRF_TWIM_FREQ_400K); break; #if NRF_TWIM_HAS_1000_KHZ_FREQ case I2C_SPEED_FAST_PLUS: - nrf_twim_frequency_set(config->twim.p_twim, NRF_TWIM_FREQ_1000K); + nrf_twim_frequency_set(config->twim->p_twim, NRF_TWIM_FREQ_1000K); break; #endif default: @@ -80,8 +80,6 @@ int i2c_nrfx_twim_msg_transfer(const struct device *dev, uint8_t flags, uint8_t .p_primary_buf = buf, .primary_length = buf_len, }; - nrfx_err_t res; - int ret = 0; if (buf_len > config->max_transfer_size) { LOG_ERR("Trying to transfer more than the maximum size " @@ -90,16 +88,8 @@ int i2c_nrfx_twim_msg_transfer(const struct device *dev, uint8_t flags, uint8_t return -ENOSPC; } - res = nrfx_twim_xfer(&config->twim, &cur_xfer, - (flags & I2C_MSG_STOP) ? 0 : NRFX_TWIM_FLAG_TX_NO_STOP); - if (res != NRFX_SUCCESS) { - if (res == NRFX_ERROR_BUSY) { - ret = -EBUSY; - } else { - ret = -EIO; - } - } - return ret; + return nrfx_twim_xfer(config->twim, &cur_xfer, + (flags & I2C_MSG_STOP) ? 0 : NRFX_TWIM_FLAG_TX_NO_STOP); } void twim_nrfx_pm_resume(const struct device *dev) @@ -107,14 +97,14 @@ void twim_nrfx_pm_resume(const struct device *dev) const struct i2c_nrfx_twim_common_config *config = dev->config; (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); - nrfx_twim_enable(&config->twim); + nrfx_twim_enable(config->twim); } void twim_nrfx_pm_suspend(const struct device *dev) { const struct i2c_nrfx_twim_common_config *config = dev->config; - nrfx_twim_disable(&config->twim); + nrfx_twim_disable(config->twim); (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); } @@ -138,12 +128,12 @@ int i2c_nrfx_twim_common_init(const struct device *dev) { const struct i2c_nrfx_twim_common_config *config = dev->config; - config->irq_connect(); + config->pre_init(); (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); - if (nrfx_twim_init(&config->twim, &config->twim_config, config->event_handler, - (void *)dev) != NRFX_SUCCESS) { + if (nrfx_twim_init(config->twim, &config->twim_config, config->event_handler, (void *)dev) < + 0) { LOG_ERR("Failed to initialize device: %s", dev->name); return -EIO; } @@ -175,6 +165,6 @@ int i2c_nrfx_twim_common_deinit(const struct device *dev) #endif /* Uninit device hardware */ - nrfx_twim_uninit(&config->twim); + nrfx_twim_uninit(config->twim); return 0; } diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index d476ba3f05ff..c51932af5fd3 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -28,8 +28,8 @@ extern "C" { #define I2C(idx) DT_NODELABEL(i2c##idx) #define I2C_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(I2C(idx), prop) -#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ - I2C_BITRATE_STANDARD)) +#define I2C_FREQUENCY(node) \ + I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(node, clock_frequency, I2C_BITRATE_STANDARD)) /* Macro determines PM actions interrupt safety level. * @@ -38,13 +38,14 @@ extern "C" { * no longer ISR safe. This macro let's us check if we will be requesting/releasing * power domains and determines PM device ISR safety value. */ -#define I2C_PM_ISR_SAFE(idx) \ +#define I2C_PM_ISR_SAFE(idx) \ COND_CODE_1( \ UTIL_AND( \ IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ UTIL_AND( \ - DT_NODE_HAS_PROP(I2C(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(I2C(idx), power_domains)) \ + DT_NODE_HAS_PROP(DT_DRV_INST(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(DT_DRV_INST(idx), \ + power_domains)) \ ) \ ), \ (0), \ @@ -52,14 +53,14 @@ extern "C" { ) struct i2c_nrfx_twim_common_config { - nrfx_twim_t twim; nrfx_twim_config_t twim_config; - nrfx_twim_evt_handler_t event_handler; + nrfx_twim_event_handler_t event_handler; uint16_t msg_buf_size; - void (*irq_connect)(void); + void (*pre_init)(void); const struct pinctrl_dev_config *pcfg; uint8_t *msg_buf; uint16_t max_transfer_size; + nrfx_twim_t *twim; }; int i2c_nrfx_twim_common_init(const struct device *dev); diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 7326deaafb03..872c5859bd91 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -21,12 +21,15 @@ LOG_MODULE_REGISTER(i2c_nrfx_twim, CONFIG_I2C_LOG_LEVEL); +#define DT_DRV_COMPAT nordic_nrf_twim + struct i2c_nrfx_twim_rtio_config { struct i2c_nrfx_twim_common_config common; struct i2c_rtio *ctx; }; struct i2c_nrfx_twim_rtio_data { + nrfx_twim_t twim; uint8_t *user_rx_buf; uint16_t user_rx_buf_size; }; @@ -182,7 +185,7 @@ static void i2c_nrfx_twim_rtio_submit(const struct device *dev, struct rtio_iode } } -static void event_handler(nrfx_twim_evt_t const *p_event, void *p_context) +static void event_handler(nrfx_twim_event_t const *p_event, void *p_context) { const struct device *dev = p_context; const struct i2c_nrfx_twim_rtio_config *config = dev->config; @@ -217,21 +220,20 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) } #define CONCAT_BUF_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_concat_buf_size), \ - (DT_PROP(I2C(idx), zephyr_concat_buf_size)), (0)) + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_concat_buf_size), \ + (DT_INST_PROP(idx, zephyr_concat_buf_size)), (0)) #define FLASH_BUF_MAX_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_flash_buf_max_size), \ - (DT_PROP(I2C(idx), zephyr_flash_buf_max_size)), (0)) + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_flash_buf_max_size), \ + (DT_INST_PROP(idx, zephyr_flash_buf_max_size)), (0)) #define USES_MSG_BUF(idx) \ COND_CODE_0(CONCAT_BUF_SIZE(idx), (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), (1)) #define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) -#define MSG_BUF_HAS_MEMORY_REGIONS(idx) \ - DT_NODE_HAS_PROP(I2C(idx), memory_regions) +#define MSG_BUF_HAS_MEMORY_REGIONS(idx) DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions) -#define MSG_BUF_LINKER_REGION_NAME(idx) \ - LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(I2C(idx), memory_regions)) +#define MSG_BUF_LINKER_REGION_NAME(idx) \ + LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(DT_DRV_INST(idx), memory_regions)) #define MSG_BUF_ATTR_SECTION(idx) \ __attribute__((__section__(MSG_BUF_LINKER_REGION_NAME(idx)))) @@ -249,122 +251,53 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) #define MSG_BUF_DEFINE(idx) \ static uint8_t MSG_BUF_SYM(idx)[MSG_BUF_SIZE(idx)] MSG_BUF_ATTR(idx) -#define MAX_TRANSFER_SIZE(idx) \ - BIT_MASK(DT_PROP(I2C(idx), easydma_maxcnt_bits)) +#define MAX_TRANSFER_SIZE(idx) BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)) #define I2C_NRFX_TWIM_RTIO_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(idx) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ "Wrong I2C " #idx " frequency setting in dts"); \ - static void irq_connect##idx(void) \ + static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data = { \ + .twim = \ + { \ + .p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx), \ + }, \ + }; \ + static void pre_init##idx(void) \ { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ - nrfx_twim_##idx##_irq_handler, 0); \ + twim_##idx##z_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \ + IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \ + &twim_##idx##z_data.twim, 0); \ } \ IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ I2C_RTIO_DEFINE(_i2c##idx##_twim_rtio, \ DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data; \ + PINCTRL_DT_INST_DEFINE(idx); \ static const struct i2c_nrfx_twim_rtio_config twim_##idx##z_config = { \ .common = \ { \ - .twim = NRFX_TWIM_INSTANCE(idx), \ .twim_config = \ { \ .skip_gpio_cfg = true, \ .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ + .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ }, \ .event_handler = event_handler, \ .msg_buf_size = MSG_BUF_SIZE(idx), \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + .pre_init = pre_init##idx, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) \ .max_transfer_size = MAX_TRANSFER_SIZE(idx), \ + .twim = &twim_##idx##z_data.twim, \ }, \ .ctx = &_i2c##idx##_twim_rtio, \ }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ - I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ - PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ - &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twim_driver_api); - -#ifdef CONFIG_HAS_HW_NRF_TWIM0 -I2C_NRFX_TWIM_RTIO_DEVICE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM1 -I2C_NRFX_TWIM_RTIO_DEVICE(1); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM2 -I2C_NRFX_TWIM_RTIO_DEVICE(2); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM3 -I2C_NRFX_TWIM_RTIO_DEVICE(3); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM20 -I2C_NRFX_TWIM_RTIO_DEVICE(20); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM21 -I2C_NRFX_TWIM_RTIO_DEVICE(21); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM22 -I2C_NRFX_TWIM_RTIO_DEVICE(22); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM23 -I2C_NRFX_TWIM_RTIO_DEVICE(23); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM24 -I2C_NRFX_TWIM_RTIO_DEVICE(24); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM30 -I2C_NRFX_TWIM_RTIO_DEVICE(30); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM120 -I2C_NRFX_TWIM_RTIO_DEVICE(120); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM130 -I2C_NRFX_TWIM_RTIO_DEVICE(130); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM131 -I2C_NRFX_TWIM_RTIO_DEVICE(131); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM132 -I2C_NRFX_TWIM_RTIO_DEVICE(132); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM133 -I2C_NRFX_TWIM_RTIO_DEVICE(133); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM134 -I2C_NRFX_TWIM_RTIO_DEVICE(134); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM135 -I2C_NRFX_TWIM_RTIO_DEVICE(135); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM136 -I2C_NRFX_TWIM_RTIO_DEVICE(136); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIM137 -I2C_NRFX_TWIM_RTIO_DEVICE(137); -#endif + PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ + I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ + PM_DEVICE_DT_INST_GET(idx), &twim_##idx##z_data, \ + &twim_##idx##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api); + +DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWIM_RTIO_DEVICE) diff --git a/drivers/i2c/i2c_nrfx_twis.c b/drivers/i2c/i2c_nrfx_twis.c index 0fd9b667d23c..08f1e33bb601 100644 --- a/drivers/i2c/i2c_nrfx_twis.c +++ b/drivers/i2c/i2c_nrfx_twis.c @@ -16,26 +16,10 @@ #define DT_DRV_COMPAT nordic_nrf_twis -#define SHIM_NRF_TWIS_NODE(id) \ - DT_NODELABEL(_CONCAT(i2c, id)) +#define SHIM_NRF_TWIS_HAS_MEMORY_REGIONS(id) DT_NODE_HAS_PROP(DT_DRV_INST(id), memory_regions) -#define SHIM_NRF_TWIS_DEVICE_GET(id) \ - DEVICE_DT_GET(SHIM_NRF_TWIS_NODE(id)) - -#define SHIM_NRF_TWIS_IRQ_HANDLER(id) \ - _CONCAT_3(nrfx_twis_, id, _irq_handler) - -#define SHIM_NRF_TWIS_IRQN(id) \ - DT_IRQN(SHIM_NRF_TWIS_NODE(id)) - -#define SHIM_NRF_TWIS_IRQ_PRIO(id) \ - DT_IRQ(SHIM_NRF_TWIS_NODE(id), priority) - -#define SHIM_NRF_TWIS_HAS_MEMORY_REGIONS(id) \ - DT_NODE_HAS_PROP(SHIM_NRF_TWIS_NODE(id), memory_regions) - -#define SHIM_NRF_TWIS_LINKER_REGION_NAME(id) \ - LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(SHIM_NRF_TWIS_NODE(id), memory_regions)) +#define SHIM_NRF_TWIS_LINKER_REGION_NAME(id) \ + LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(DT_DRV_INST(id), memory_regions)) #define SHIM_NRF_TWIS_BUF_ATTR_SECTION(id) \ __attribute__((__section__(SHIM_NRF_TWIS_LINKER_REGION_NAME(id)))) @@ -53,14 +37,14 @@ LOG_MODULE_REGISTER(i2c_nrfx_twis, CONFIG_I2C_LOG_LEVEL); struct shim_nrf_twis_config { - nrfx_twis_t twis; - void (*irq_connect)(void); - void (*event_handler)(nrfx_twis_evt_t const *event); + void (*pre_init)(void); + void (*event_handler)(nrfx_twis_event_t const *event); const struct pinctrl_dev_config *pcfg; uint8_t *buf; }; struct shim_nrf_twis_data { + nrfx_twis_t twis; struct i2c_target_config *target_config; bool enabled; }; @@ -105,7 +89,7 @@ static void shim_nrf_twis_enable(const struct device *dev) } (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); - nrfx_twis_enable(&dev_config->twis); + nrfx_twis_enable(&dev_data->twis); dev_data->enabled = true; } @@ -119,7 +103,7 @@ static void shim_nrf_twis_disable(const struct device *dev) } dev_data->enabled = false; - nrfx_twis_disable(&dev_config->twis); + nrfx_twis_disable(&dev_data->twis); (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -129,10 +113,10 @@ static void shim_nrf_twis_handle_read_req(const struct device *dev) const struct shim_nrf_twis_config *dev_config = dev->config; struct i2c_target_config *target_config = dev_data->target_config; const struct i2c_target_callbacks *callbacks = target_config->callbacks; - const nrfx_twis_t *twis = &dev_config->twis; + nrfx_twis_t *twis = &dev_data->twis; uint8_t *buf; uint32_t buf_size; - nrfx_err_t err; + int err; if (callbacks->buf_read_requested(target_config, &buf, &buf_size)) { LOG_ERR("no buffer provided"); @@ -147,7 +131,7 @@ static void shim_nrf_twis_handle_read_req(const struct device *dev) memcpy(dev_config->buf, buf, buf_size); err = nrfx_twis_tx_prepare(twis, dev_config->buf, buf_size); - if (err != NRFX_SUCCESS) { + if (err < 0) { LOG_ERR("tx prepare failed"); return; } @@ -155,12 +139,13 @@ static void shim_nrf_twis_handle_read_req(const struct device *dev) static void shim_nrf_twis_handle_write_req(const struct device *dev) { + struct shim_nrf_twis_data *dev_data = dev->data; const struct shim_nrf_twis_config *dev_config = dev->config; - const nrfx_twis_t *twis = &dev_config->twis; - nrfx_err_t err; + nrfx_twis_t *twis = &dev_data->twis; + int err; err = nrfx_twis_rx_prepare(twis, dev_config->buf, SHIM_NRF_TWIS_BUF_SIZE); - if (err != NRFX_SUCCESS) { + if (err < 0) { LOG_ERR("rx prepare failed"); return; } @@ -172,13 +157,12 @@ static void shim_nrf_twis_handle_write_done(const struct device *dev) const struct shim_nrf_twis_config *dev_config = dev->config; struct i2c_target_config *target_config = dev_data->target_config; const struct i2c_target_callbacks *callbacks = target_config->callbacks; - const nrfx_twis_t *twis = &dev_config->twis; + nrfx_twis_t *twis = &dev_data->twis; callbacks->buf_write_received(target_config, dev_config->buf, nrfx_twis_rx_amount(twis)); } -static void shim_nrf_twis_event_handler(const struct device *dev, - nrfx_twis_evt_t const *event) +static void shim_nrf_twis_event_handler(const struct device *dev, nrfx_twis_event_t const *event) { switch (event->type) { case NRFX_TWIS_EVT_READ_REQ: @@ -223,9 +207,8 @@ static int shim_nrf_twis_target_register(const struct device *dev, struct i2c_target_config *target_config) { struct shim_nrf_twis_data *dev_data = dev->data; - const struct shim_nrf_twis_config *dev_config = dev->config; - const nrfx_twis_t *twis = &dev_config->twis; - nrfx_err_t err; + nrfx_twis_t *twis = &dev_data->twis; + int err; const nrfx_twis_config_t config = { .addr = { target_config->address, @@ -242,7 +225,7 @@ static int shim_nrf_twis_target_register(const struct device *dev, shim_nrf_twis_disable(dev); err = nrfx_twis_reconfigure(twis, &config); - if (err != NRFX_SUCCESS) { + if (err < 0) { return -ENODEV; } @@ -276,25 +259,25 @@ const struct i2c_driver_api shim_nrf_twis_api = { static int shim_nrf_twis_init(const struct device *dev) { + struct shim_nrf_twis_data *dev_data = dev->data; const struct shim_nrf_twis_config *dev_config = dev->config; - nrfx_err_t err; + int err; const nrfx_twis_config_t config = { .skip_gpio_cfg = true, .skip_psel_cfg = true, }; - err = nrfx_twis_init(&dev_config->twis, &config, dev_config->event_handler); - if (err != NRFX_SUCCESS) { + dev_config->pre_init(); + err = nrfx_twis_init(&dev_data->twis, &config, dev_config->event_handler); + if (err < 0) { return -ENODEV; } - dev_config->irq_connect(); return pm_device_driver_init(dev, shim_nrf_twis_pm_action_cb); } static int shim_nrf_twis_deinit(const struct device *dev) { - const struct shim_nrf_twis_config *dev_config = dev->config; struct shim_nrf_twis_data *dev_data = dev->data; if (dev_data->target_config != NULL) { @@ -317,127 +300,45 @@ static int shim_nrf_twis_deinit(const struct device *dev) #endif /* Uninit device hardware */ - nrfx_twis_uninit(&dev_config->twis); + nrfx_twis_uninit(&dev_data->twis); return 0; } #define SHIM_NRF_TWIS_NAME(id, name) \ _CONCAT_4(shim_nrf_twis_, name, _, id) -#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SHIM_NRF_TWIS_NODE(id)); \ - static void SHIM_NRF_TWIS_NAME(id, irq_connect)(void) \ - { \ - IRQ_CONNECT( \ - SHIM_NRF_TWIS_IRQN(id), \ - SHIM_NRF_TWIS_IRQ_PRIO(id), \ - nrfx_isr, \ - SHIM_NRF_TWIS_IRQ_HANDLER(id), \ - 0 \ - ); \ - } \ - \ - static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_evt_t const *event) \ - { \ - shim_nrf_twis_event_handler(SHIM_NRF_TWIS_DEVICE_GET(id), event); \ - } \ - \ - static struct shim_nrf_twis_data SHIM_NRF_TWIS_NAME(id, data); \ - \ - PINCTRL_DT_DEFINE(SHIM_NRF_TWIS_NODE(id)); \ - \ - static uint8_t SHIM_NRF_TWIS_NAME(id, buf) \ - [SHIM_NRF_TWIS_BUF_SIZE] SHIM_NRF_TWIS_BUF_ATTR(id); \ - \ - static const struct shim_nrf_twis_config SHIM_NRF_TWIS_NAME(id, config) = { \ - .twis = NRFX_TWIS_INSTANCE(id), \ - .irq_connect = SHIM_NRF_TWIS_NAME(id, irq_connect), \ - .event_handler = SHIM_NRF_TWIS_NAME(id, event_handler), \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SHIM_NRF_TWIS_NODE(id)), \ - .buf = SHIM_NRF_TWIS_NAME(id, buf), \ - }; \ - \ - PM_DEVICE_DT_DEFINE( \ - SHIM_NRF_TWIS_NODE(id), \ - shim_nrf_twis_pm_action_cb, \ - ); \ - \ - DEVICE_DT_DEINIT_DEFINE( \ - SHIM_NRF_TWIS_NODE(id), \ - shim_nrf_twis_init, \ - shim_nrf_twis_deinit, \ - PM_DEVICE_DT_GET(SHIM_NRF_TWIS_NODE(id)), \ - &SHIM_NRF_TWIS_NAME(id, data), \ - &SHIM_NRF_TWIS_NAME(id, config), \ - POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, \ - &shim_nrf_twis_api \ - ); - -#ifdef CONFIG_HAS_HW_NRF_TWIS0 -SHIM_NRF_TWIS_DEVICE_DEFINE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS1 -SHIM_NRF_TWIS_DEVICE_DEFINE(1); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS2 -SHIM_NRF_TWIS_DEVICE_DEFINE(2); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS3 -SHIM_NRF_TWIS_DEVICE_DEFINE(3); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS20 -SHIM_NRF_TWIS_DEVICE_DEFINE(20); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS21 -SHIM_NRF_TWIS_DEVICE_DEFINE(21); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS22 -SHIM_NRF_TWIS_DEVICE_DEFINE(22); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS23 -SHIM_NRF_TWIS_DEVICE_DEFINE(23); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS24 -SHIM_NRF_TWIS_DEVICE_DEFINE(24); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS30 -SHIM_NRF_TWIS_DEVICE_DEFINE(30); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS130 -SHIM_NRF_TWIS_DEVICE_DEFINE(130); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS131 -SHIM_NRF_TWIS_DEVICE_DEFINE(131); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS133 -SHIM_NRF_TWIS_DEVICE_DEFINE(133); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS134 -SHIM_NRF_TWIS_DEVICE_DEFINE(134); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS135 -SHIM_NRF_TWIS_DEVICE_DEFINE(135); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS136 -SHIM_NRF_TWIS_DEVICE_DEFINE(136); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWIS137 -SHIM_NRF_TWIS_DEVICE_DEFINE(137); -#endif +#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ + static struct shim_nrf_twis_data SHIM_NRF_TWIS_NAME(id, data); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(id)); \ + static void SHIM_NRF_TWIS_NAME(id, pre_init)(void) \ + { \ + SHIM_NRF_TWIS_NAME(id, data).twis.p_reg = (NRF_TWIS_Type *)DT_INST_REG_ADDR(id); \ + IRQ_CONNECT(DT_INST_IRQN(id), DT_INST_IRQ(id, priority), nrfx_twis_irq_handler, \ + &SHIM_NRF_TWIS_NAME(id, data).twis, 0); \ + } \ + \ + static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_event_t const *event) \ + { \ + shim_nrf_twis_event_handler(DEVICE_DT_INST_GET(id), event); \ + } \ + \ + PINCTRL_DT_INST_DEFINE(id); \ + \ + static uint8_t SHIM_NRF_TWIS_NAME(id, \ + buf)[SHIM_NRF_TWIS_BUF_SIZE] SHIM_NRF_TWIS_BUF_ATTR(id); \ + \ + static const struct shim_nrf_twis_config SHIM_NRF_TWIS_NAME(id, config) = { \ + .pre_init = SHIM_NRF_TWIS_NAME(id, pre_init), \ + .event_handler = SHIM_NRF_TWIS_NAME(id, event_handler), \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(id), \ + .buf = SHIM_NRF_TWIS_NAME(id, buf), \ + }; \ + \ + PM_DEVICE_DT_INST_DEFINE(id, shim_nrf_twis_pm_action_cb,); \ + \ + DEVICE_DT_INST_DEINIT_DEFINE(id, shim_nrf_twis_init, shim_nrf_twis_deinit, \ + PM_DEVICE_DT_INST_GET(id), &SHIM_NRF_TWIS_NAME(id, data), \ + &SHIM_NRF_TWIS_NAME(id, config), POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &shim_nrf_twis_api); + +DT_INST_FOREACH_STATUS_OKAY(SHIM_NRF_TWIS_DEVICE_DEFINE) diff --git a/drivers/i2s/Kconfig.nrfx b/drivers/i2s/Kconfig.nrfx index 7337f9974c0f..786de1ba68b8 100644 --- a/drivers/i2s/Kconfig.nrfx +++ b/drivers/i2s/Kconfig.nrfx @@ -5,8 +5,7 @@ menuconfig I2S_NRFX bool "nRF I2S nrfx driver" default y depends on DT_HAS_NORDIC_NRF_I2S_ENABLED - select NRFX_I2S0 if HAS_HW_NRF_I2S0 - select NRFX_I2S20 if HAS_HW_NRF_I2S20 + select NRFX_I2S select PINCTRL help Enable support for nrfx I2S driver for nRF MCU series. diff --git a/drivers/i2s/i2s_nrfx.c b/drivers/i2s/i2s_nrfx.c index 8c52fb42da30..11ad955cf3c8 100644 --- a/drivers/i2s/i2s_nrfx.c +++ b/drivers/i2s/i2s_nrfx.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_nrf_i2s + #include #include #include @@ -33,21 +35,20 @@ struct i2s_nrfx_drv_data { struct k_msgq tx_queue; struct stream_cfg rx; struct k_msgq rx_queue; - const nrfx_i2s_t *p_i2s; + nrfx_i2s_t i2s; const uint32_t *last_tx_buffer; enum i2s_state state; enum i2s_dir active_dir; bool stop; /* stop after the current (TX or RX) block */ bool discard_rx; /* discard further RX blocks */ volatile bool next_tx_buffer_needed; - bool tx_configured : 1; - bool rx_configured : 1; - bool request_clock : 1; + bool tx_configured: 1; + bool rx_configured: 1; + bool request_clock: 1; }; struct i2s_nrfx_drv_cfg { nrfx_i2s_data_handler_t data_handler; - nrfx_i2s_t i2s; nrfx_i2s_config_t nrfx_def_cfg; const struct pinctrl_dev_config *pcfg; enum clock_source { @@ -64,148 +65,26 @@ static void find_suitable_clock(const struct i2s_nrfx_drv_cfg *drv_cfg, nrfx_i2s_config_t *config, const struct i2s_config *i2s_cfg) { - static const struct { - uint16_t ratio_val; - nrf_i2s_ratio_t ratio_enum; - } ratios[] = { - { 32, NRF_I2S_RATIO_32X }, - { 48, NRF_I2S_RATIO_48X }, - { 64, NRF_I2S_RATIO_64X }, - { 96, NRF_I2S_RATIO_96X }, - { 128, NRF_I2S_RATIO_128X }, - { 192, NRF_I2S_RATIO_192X }, - { 256, NRF_I2S_RATIO_256X }, - { 384, NRF_I2S_RATIO_384X }, - { 512, NRF_I2S_RATIO_512X } - }; - const uint32_t src_freq = - (NRF_I2S_HAS_CLKCONFIG && drv_cfg->clk_src == ACLK) - /* The I2S_NRFX_DEVICE() macro contains build assertions that - * make sure that the ACLK clock source is only used when it is - * available and only with the "hfclkaudio-frequency" property - * defined, but the default value of 0 here needs to be used to - * prevent compilation errors when the property is not defined - * (this expression will be eventually optimized away then). - */ - ? DT_PROP_OR(DT_NODELABEL(clock), hfclkaudio_frequency, 0) - : 32*1000*1000UL; - uint32_t bits_per_frame = 2 * i2s_cfg->word_size; - uint32_t best_diff = UINT32_MAX; - uint8_t r, best_r = 0; - nrf_i2s_mck_t best_mck_cfg = 0; - uint32_t best_mck = 0; - -#if defined(CONFIG_I2S_NRFX_ALLOW_MCK_BYPASS) && NRF_I2S_HAS_CLKCONFIG - /* Check for bypass before calculating f_MCK */ - for (r = 0; r < ARRAY_SIZE(ratios); ++r) { - if (i2s_cfg->frame_clk_freq * ratios[r].ratio_val == src_freq) { - LOG_INF("MCK bypass calculated"); - best_r = r; - best_mck = src_freq; - best_diff = 0; - - /* Set CONFIG.MCKFREQ register to non-zero reset value to - * ensure peripheral functionality - */ - best_mck_cfg = NRF_I2S_MCK_32MDIV8; - - config->enable_bypass = true; - break; - } - } -#endif - - for (r = 0; (best_diff != 0) && (r < ARRAY_SIZE(ratios)); ++r) { - /* Only multiples of the frame width can be used as ratios. */ - if ((ratios[r].ratio_val % bits_per_frame) != 0) { - continue; - } - - if (IS_ENABLED(CONFIG_SOC_SERIES_NRF53X) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { - uint32_t requested_mck = - i2s_cfg->frame_clk_freq * ratios[r].ratio_val; - /* As specified in the nRF5340 PS: - * - * MCKFREQ = 4096 * floor(f_MCK * 1048576 / - * (f_source + f_MCK / 2)) - * f_actual = f_source / - * floor(1048576 * 4096 / MCKFREQ) + const nrfx_i2s_clk_params_t clk_params = { + .base_clock_freq = + (NRF_I2S_HAS_CLKCONFIG && drv_cfg->clk_src == ACLK) + /* The I2S_NRFX_DEVICE() macro contains build assertions that + * make sure that the ACLK clock source is only used when it is + * available and only with the "hfclkaudio-frequency" property + * defined, but the default value of 0 here needs to be used to + * prevent compilation errors when the property is not defined + * (this expression will be eventually optimized away then). */ - enum { MCKCONST = 1048576 }; - uint32_t mck_factor = - (uint32_t)(((uint64_t)requested_mck * MCKCONST) / - (src_freq + requested_mck / 2)); - - /* skip cases when mck_factor is too big for dividing */ - if (mck_factor > MCKCONST) { - continue; - } - uint32_t actual_mck = src_freq / (MCKCONST / mck_factor); - - uint32_t lrck_freq = actual_mck / ratios[r].ratio_val; - uint32_t diff = lrck_freq >= i2s_cfg->frame_clk_freq - ? (lrck_freq - i2s_cfg->frame_clk_freq) - : (i2s_cfg->frame_clk_freq - lrck_freq); - - if (diff < best_diff) { - best_mck_cfg = mck_factor * 4096; - best_mck = actual_mck; - best_r = r; - best_diff = diff; - } - } else { - static const struct { - uint8_t divider_val; - nrf_i2s_mck_t divider_enum; - } dividers[] = { - { 8, NRF_I2S_MCK_32MDIV8 }, - { 10, NRF_I2S_MCK_32MDIV10 }, - { 11, NRF_I2S_MCK_32MDIV11 }, - { 15, NRF_I2S_MCK_32MDIV15 }, - { 16, NRF_I2S_MCK_32MDIV16 }, - { 21, NRF_I2S_MCK_32MDIV21 }, - { 23, NRF_I2S_MCK_32MDIV23 }, - { 30, NRF_I2S_MCK_32MDIV30 }, - { 31, NRF_I2S_MCK_32MDIV31 }, - { 32, NRF_I2S_MCK_32MDIV32 }, - { 42, NRF_I2S_MCK_32MDIV42 }, - { 63, NRF_I2S_MCK_32MDIV63 }, - { 125, NRF_I2S_MCK_32MDIV125 } - }; - - for (uint8_t d = 0; (best_diff != 0) && (d < ARRAY_SIZE(dividers)); ++d) { - uint32_t mck_freq = - src_freq / dividers[d].divider_val; - uint32_t lrck_freq = - mck_freq / ratios[r].ratio_val; - uint32_t diff = - lrck_freq >= i2s_cfg->frame_clk_freq - ? (lrck_freq - i2s_cfg->frame_clk_freq) - : (i2s_cfg->frame_clk_freq - lrck_freq); - - if (diff < best_diff) { - best_mck_cfg = dividers[d].divider_enum; - best_mck = mck_freq; - best_r = r; - best_diff = diff; - } + ? DT_PROP_OR(DT_NODELABEL(clock), hfclkaudio_frequency, 0) + : 32*1000*1000UL, + .transfer_rate = i2s_cfg->frame_clk_freq, + .swidth = config->sample_width, + .allow_bypass = IS_ENABLED(CONFIG_I2S_NRFX_ALLOW_MCK_BYPASS), + }; - /* Since dividers are in ascending order, stop - * checking next ones for the current ratio - * after resulting LRCK frequency falls below - * the one requested. - */ - if (lrck_freq < i2s_cfg->frame_clk_freq) { - break; - } - } - } + if (nrfx_i2s_prescalers_calc(&clk_params, &config->prescalers) != 0) { + LOG_ERR("Failed to find suitable I2S clock configuration."); } - - config->mck_setup = best_mck_cfg; - config->ratio = ratios[best_r].ratio_enum; - LOG_INF("I2S MCK frequency: %u, actual PCM rate: %u", - best_mck, best_mck / ratios[best_r].ratio_val); } static bool get_next_tx_buffer(struct i2s_nrfx_drv_data *drv_data, @@ -256,7 +135,7 @@ static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data, if (drv_data->active_dir != I2S_DIR_TX) { /* -> RX active */ if (!get_next_rx_buffer(drv_data, next)) { drv_data->state = I2S_STATE_ERROR; - nrfx_i2s_stop(drv_data->p_i2s); + nrfx_i2s_stop(&drv_data->i2s); return false; } /* Set buffer size if there is no TX buffer (which effectively @@ -271,7 +150,7 @@ static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data, drv_data->last_tx_buffer = next->p_tx_buffer; LOG_DBG("Next buffers: %p/%p", next->p_tx_buffer, next->p_rx_buffer); - nrfx_i2s_next_buffers_set(drv_data->p_i2s, next); + nrfx_i2s_next_buffers_set(&drv_data->i2s, next); return true; } @@ -303,7 +182,7 @@ static void data_handler(const struct device *dev, } drv_data->last_tx_buffer = NULL; } - nrfx_i2s_uninit(drv_data->p_i2s); + nrfx_i2s_uninit(&drv_data->i2s); if (drv_data->request_clock) { (void)onoff_release(drv_data->clk_mgr); } @@ -320,7 +199,7 @@ static void data_handler(const struct device *dev, LOG_ERR("Next buffers not supplied on time"); drv_data->state = I2S_STATE_ERROR; } - nrfx_i2s_stop(drv_data->p_i2s); + nrfx_i2s_stop(&drv_data->i2s); return; } @@ -370,7 +249,7 @@ static void data_handler(const struct device *dev, } if (stop_transfer) { - nrfx_i2s_stop(drv_data->p_i2s); + nrfx_i2s_stop(&drv_data->i2s); } else if (status & NRFX_I2S_STATUS_NEXT_BUFFERS_NEEDED) { nrfx_i2s_buffers_t next = { 0 }; @@ -541,8 +420,7 @@ static int i2s_nrfx_configure(const struct device *dev, enum i2s_dir dir, * the MCK output is used), find a suitable clock configuration for it. */ if (nrfx_cfg.mode == NRF_I2S_MODE_MASTER || - (nrf_i2s_mck_pin_get(drv_cfg->i2s.p_reg) & I2S_PSEL_MCK_CONNECT_Msk) - == I2S_PSEL_MCK_CONNECT_Connected << I2S_PSEL_MCK_CONNECT_Pos) { + nrf_i2s_mck_pin_connected_check(drv_data->i2s.p_reg)) { find_suitable_clock(drv_cfg, &nrfx_cfg, i2s_cfg); /* Unless the PCLK32M source is used with the HFINT oscillator * (which is always available without any additional actions), @@ -551,7 +429,7 @@ static int i2s_nrfx_configure(const struct device *dev, enum i2s_dir dir, */ drv_data->request_clock = (drv_cfg->clk_src != PCLK32M); } else { - nrfx_cfg.mck_setup = NRF_I2S_MCK_DISABLED; + nrfx_cfg.prescalers.mck_setup = NRF_I2S_MCK_DISABLED; drv_data->request_clock = false; } @@ -700,7 +578,7 @@ static int start_transfer(struct i2s_nrfx_drv_data *drv_data) /* Failed to allocate next RX buffer */ ret = -ENOMEM; } else { - nrfx_err_t err; + int err; /* It is necessary to set buffer size here only for I2S_DIR_RX, * because only then the get_next_tx_buffer() call in the if @@ -713,16 +591,16 @@ static int start_transfer(struct i2s_nrfx_drv_data *drv_data) drv_data->last_tx_buffer = initial_buffers.p_tx_buffer; - err = nrfx_i2s_start(drv_data->p_i2s, &initial_buffers, 0); - if (err == NRFX_SUCCESS) { + err = nrfx_i2s_start(&drv_data->i2s, &initial_buffers, 0); + if (err == 0) { return 0; } - LOG_ERR("Failed to start I2S transfer: 0x%08x", err); + LOG_ERR("Failed to start I2S transfer: %d", err); ret = -EIO; } - nrfx_i2s_uninit(drv_data->p_i2s); + nrfx_i2s_uninit(&drv_data->i2s); if (drv_data->request_clock) { (void)onoff_release(drv_data->clk_mgr); } @@ -751,7 +629,7 @@ static void clock_started_callback(struct onoff_manager *mgr, * the actual transfer in such case. */ if (drv_data->state == I2S_STATE_READY) { - nrfx_i2s_uninit(drv_data->p_i2s); + nrfx_i2s_uninit(&drv_data->i2s); (void)onoff_release(drv_data->clk_mgr); } else { (void)start_transfer(drv_data); @@ -762,25 +640,25 @@ static int trigger_start(const struct device *dev) { struct i2s_nrfx_drv_data *drv_data = dev->data; const struct i2s_nrfx_drv_cfg *drv_cfg = dev->config; - nrfx_err_t err; + int err; int ret; const nrfx_i2s_config_t *nrfx_cfg = (drv_data->active_dir == I2S_DIR_TX) ? &drv_data->tx.nrfx_cfg : &drv_data->rx.nrfx_cfg; - err = nrfx_i2s_init(drv_data->p_i2s, nrfx_cfg, drv_cfg->data_handler); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize I2S: 0x%08x", err); + err = nrfx_i2s_init(&drv_data->i2s, nrfx_cfg, drv_cfg->data_handler); + if (err != 0) { + LOG_ERR("Failed to initialize I2S: %d", err); return -EIO; } drv_data->state = I2S_STATE_RUNNING; #if NRF_I2S_HAS_CLKCONFIG - nrf_i2s_clk_configure(drv_cfg->i2s.p_reg, + nrf_i2s_clk_configure(drv_data->i2s.p_reg, drv_cfg->clk_src == ACLK ? NRF_I2S_CLKSRC_ACLK : NRF_I2S_CLKSRC_PCLK32M, - nrfx_cfg->enable_bypass); + nrfx_cfg->prescalers.enable_bypass); #endif /* If it is required to use certain HF clock, request it to be running @@ -791,7 +669,7 @@ static int trigger_start(const struct device *dev) clock_started_callback); ret = onoff_request(drv_data->clk_mgr, &drv_data->clk_cli); if (ret < 0) { - nrfx_i2s_uninit(drv_data->p_i2s); + nrfx_i2s_uninit(&drv_data->i2s); drv_data->state = I2S_STATE_READY; LOG_ERR("Failed to request clock: %d", ret); @@ -898,7 +776,7 @@ static int i2s_nrfx_trigger(const struct device *dev, case I2S_TRIGGER_DROP: if (drv_data->state != I2S_STATE_READY) { drv_data->discard_rx = true; - nrfx_i2s_stop(drv_data->p_i2s); + nrfx_i2s_stop(&drv_data->i2s); } purge_queue(dev, dir); drv_data->state = I2S_STATE_READY; @@ -943,72 +821,56 @@ static DEVICE_API(i2s, i2s_nrf_drv_api) = { .trigger = i2s_nrfx_trigger, }; -#define I2S(idx) DT_NODELABEL(i2s##idx) -#define I2S_CLK_SRC(idx) DT_STRING_TOKEN(I2S(idx), clock_source) - -#define I2S_NRFX_DEVICE(idx) \ - static struct i2s_buf tx_msgs##idx[CONFIG_I2S_NRFX_TX_BLOCK_COUNT]; \ - static struct i2s_buf rx_msgs##idx[CONFIG_I2S_NRFX_RX_BLOCK_COUNT]; \ - static void data_handler##idx(nrfx_i2s_buffers_t const *p_released, \ - uint32_t status) \ - { \ - data_handler(DEVICE_DT_GET(I2S(idx)), p_released, status); \ - } \ - PINCTRL_DT_DEFINE(I2S(idx)); \ - static const struct i2s_nrfx_drv_cfg i2s_nrfx_cfg##idx = { \ - .data_handler = data_handler##idx, \ - .i2s = NRFX_I2S_INSTANCE(idx), \ - .nrfx_def_cfg = NRFX_I2S_DEFAULT_CONFIG( \ - NRF_I2S_PIN_NOT_CONNECTED, \ - NRF_I2S_PIN_NOT_CONNECTED, \ - NRF_I2S_PIN_NOT_CONNECTED, \ - NRF_I2S_PIN_NOT_CONNECTED, \ - NRF_I2S_PIN_NOT_CONNECTED), \ - .nrfx_def_cfg.skip_gpio_cfg = true, \ - .nrfx_def_cfg.skip_psel_cfg = true, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2S(idx)), \ - .clk_src = I2S_CLK_SRC(idx), \ - }; \ - static struct i2s_nrfx_drv_data i2s_nrfx_data##idx = { \ - .state = I2S_STATE_READY, \ - .p_i2s = &i2s_nrfx_cfg##idx.i2s \ - }; \ - static int i2s_nrfx_init##idx(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(I2S(idx)), DT_IRQ(I2S(idx), priority), \ - nrfx_isr, nrfx_i2s_##idx##_irq_handler, 0); \ - const struct i2s_nrfx_drv_cfg *drv_cfg = dev->config; \ - int err = pinctrl_apply_state(drv_cfg->pcfg, \ - PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - k_msgq_init(&i2s_nrfx_data##idx.tx_queue, \ - (char *)tx_msgs##idx, sizeof(struct i2s_buf), \ - ARRAY_SIZE(tx_msgs##idx)); \ - k_msgq_init(&i2s_nrfx_data##idx.rx_queue, \ - (char *)rx_msgs##idx, sizeof(struct i2s_buf), \ - ARRAY_SIZE(rx_msgs##idx)); \ - init_clock_manager(dev); \ - return 0; \ - } \ - BUILD_ASSERT(I2S_CLK_SRC(idx) != ACLK || \ - (NRF_I2S_HAS_CLKCONFIG && NRF_CLOCK_HAS_HFCLKAUDIO), \ - "Clock source ACLK is not available."); \ - BUILD_ASSERT(I2S_CLK_SRC(idx) != ACLK || \ - DT_NODE_HAS_PROP(DT_NODELABEL(clock), \ - hfclkaudio_frequency), \ - "Clock source ACLK requires the hfclkaudio-frequency " \ - "property to be defined in the nordic,nrf-clock node."); \ - DEVICE_DT_DEFINE(I2S(idx), i2s_nrfx_init##idx, NULL, \ - &i2s_nrfx_data##idx, &i2s_nrfx_cfg##idx, \ - POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, \ - &i2s_nrf_drv_api); - -#ifdef CONFIG_HAS_HW_NRF_I2S0 -I2S_NRFX_DEVICE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_I2S20 -I2S_NRFX_DEVICE(20); -#endif +#define I2S_CLK_SRC(inst) DT_STRING_TOKEN(DT_DRV_INST(inst), clock_source) + +#define I2S_NRFX_DEVICE(inst) \ + static struct i2s_buf tx_msgs##inst[CONFIG_I2S_NRFX_TX_BLOCK_COUNT]; \ + static struct i2s_buf rx_msgs##inst[CONFIG_I2S_NRFX_RX_BLOCK_COUNT]; \ + static void data_handler##inst(nrfx_i2s_buffers_t const *p_released, uint32_t status) \ + { \ + data_handler(DEVICE_DT_GET(DT_DRV_INST(inst)), p_released, status); \ + } \ + PINCTRL_DT_DEFINE(DT_DRV_INST(inst)); \ + static const struct i2s_nrfx_drv_cfg i2s_nrfx_cfg##inst = { \ + .data_handler = data_handler##inst, \ + .nrfx_def_cfg = NRFX_I2S_DEFAULT_CONFIG( \ + NRF_I2S_PIN_NOT_CONNECTED, NRF_I2S_PIN_NOT_CONNECTED, \ + NRF_I2S_PIN_NOT_CONNECTED, NRF_I2S_PIN_NOT_CONNECTED, \ + NRF_I2S_PIN_NOT_CONNECTED), \ + .nrfx_def_cfg.skip_gpio_cfg = true, \ + .nrfx_def_cfg.skip_psel_cfg = true, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(DT_DRV_INST(inst)), \ + .clk_src = I2S_CLK_SRC(inst), \ + }; \ + static struct i2s_nrfx_drv_data i2s_nrfx_data##inst = { \ + .state = I2S_STATE_READY, \ + .i2s = NRFX_I2S_INSTANCE(DT_INST_REG_ADDR(inst)), \ + }; \ + static int i2s_nrfx_init##inst(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), nrfx_i2s_irq_handler, \ + &i2s_nrfx_data##inst.i2s, 0); \ + const struct i2s_nrfx_drv_cfg *drv_cfg = dev->config; \ + int err = pinctrl_apply_state(drv_cfg->pcfg, PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + k_msgq_init(&i2s_nrfx_data##inst.tx_queue, (char *)tx_msgs##inst, \ + sizeof(struct i2s_buf), ARRAY_SIZE(tx_msgs##inst)); \ + k_msgq_init(&i2s_nrfx_data##inst.rx_queue, (char *)rx_msgs##inst, \ + sizeof(struct i2s_buf), ARRAY_SIZE(rx_msgs##inst)); \ + init_clock_manager(dev); \ + return 0; \ + } \ + BUILD_ASSERT(I2S_CLK_SRC(inst) != ACLK || \ + (NRF_I2S_HAS_CLKCONFIG && NRF_CLOCK_HAS_HFCLKAUDIO), \ + "Clock source ACLK is not available."); \ + BUILD_ASSERT(I2S_CLK_SRC(inst) != ACLK || \ + DT_NODE_HAS_PROP(DT_NODELABEL(clock), hfclkaudio_frequency), \ + "Clock source ACLK requires the hfclkaudio-frequency " \ + "property to be defined in the nordic,nrf-clock node."); \ + DEVICE_DT_INST_DEFINE(inst, i2s_nrfx_init##inst, NULL, &i2s_nrfx_data##inst, \ + &i2s_nrfx_cfg##inst, POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, \ + &i2s_nrf_drv_api); + +DT_INST_FOREACH_STATUS_OKAY(I2S_NRFX_DEVICE) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index 0b1fcf1ca7e0..6a76361ccf1c 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -12,7 +12,7 @@ #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) -#include +#include static inline void vendor_specific_init(const struct device *dev) { diff --git a/drivers/pwm/Kconfig.nrfx b/drivers/pwm/Kconfig.nrfx index d99b5aaf3ab8..7bb3881ffc42 100644 --- a/drivers/pwm/Kconfig.nrfx +++ b/drivers/pwm/Kconfig.nrfx @@ -5,18 +5,7 @@ config PWM_NRFX bool "nRF PWM nrfx driver" default y depends on DT_HAS_NORDIC_NRF_PWM_ENABLED - select NRFX_PWM0 if HAS_HW_NRF_PWM0 - select NRFX_PWM1 if HAS_HW_NRF_PWM1 - select NRFX_PWM2 if HAS_HW_NRF_PWM2 - select NRFX_PWM3 if HAS_HW_NRF_PWM3 - select NRFX_PWM20 if HAS_HW_NRF_PWM20 - select NRFX_PWM21 if HAS_HW_NRF_PWM21 - select NRFX_PWM22 if HAS_HW_NRF_PWM22 - select NRFX_PWM120 if HAS_HW_NRF_PWM120 - select NRFX_PWM130 if HAS_HW_NRF_PWM130 - select NRFX_PWM131 if HAS_HW_NRF_PWM131 - select NRFX_PWM132 if HAS_HW_NRF_PWM132 - select NRFX_PWM133 if HAS_HW_NRF_PWM133 + select NRFX_PWM select PINCTRL help Enable support for nrfx Hardware PWM driver for nRF52 MCU series. diff --git a/drivers/pwm/pwm_nrf_sw.c b/drivers/pwm/pwm_nrf_sw.c index e4cc7ecb42b9..37f3be925a3d 100644 --- a/drivers/pwm/pwm_nrf_sw.c +++ b/drivers/pwm/pwm_nrf_sw.c @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -62,7 +63,7 @@ struct pwm_config { NRF_RTC_Type *rtc; NRF_TIMER_Type *timer; }; - nrfx_gpiote_t gpiote[PWM_0_MAP_SIZE]; + nrfx_gpiote_t *gpiote[PWM_0_MAP_SIZE]; uint8_t psel_ch[PWM_0_MAP_SIZE]; uint8_t initially_inverted; uint8_t map_size; @@ -72,8 +73,9 @@ struct pwm_config { struct pwm_data { uint32_t period_cycles; uint32_t pulse_cycles[PWM_0_MAP_SIZE]; - uint8_t ppi_ch[PWM_0_MAP_SIZE][PPI_PER_CH]; + nrfx_gppi_handle_t ppi_h[PWM_0_MAP_SIZE][PPI_PER_CH]; uint8_t gpiote_ch[PWM_0_MAP_SIZE]; + uint32_t ppi_ch_mask[PWM_0_MAP_SIZE]; }; static inline NRF_RTC_Type *pwm_config_rtc(const struct pwm_config *config) @@ -126,11 +128,11 @@ static int pwm_nrf_sw_set_cycles(const struct device *dev, uint32_t channel, NRF_RTC_Type *rtc = pwm_config_rtc(config); NRF_GPIOTE_Type *gpiote; struct pwm_data *data = dev->data; - uint32_t ppi_mask; uint8_t active_level; uint8_t psel_ch; uint8_t gpiote_ch; - const uint8_t *ppi_chs; + const nrfx_gppi_handle_t *ppi_chs; + uint32_t src_d = nrfx_gppi_domain_id_get(USE_RTC ? (uint32_t)rtc : (uint32_t)timer); int ret; if (channel >= config->map_size) { @@ -163,18 +165,16 @@ static int pwm_nrf_sw_set_cycles(const struct device *dev, uint32_t channel, } } - gpiote = config->gpiote[channel].p_reg; + gpiote = config->gpiote[channel]->p_reg; psel_ch = config->psel_ch[channel]; gpiote_ch = data->gpiote_ch[channel]; - ppi_chs = data->ppi_ch[channel]; + ppi_chs = data->ppi_h[channel]; LOG_DBG("channel %u, period %u, pulse %u", channel, period_cycles, pulse_cycles); - /* clear PPI used */ - ppi_mask = BIT(ppi_chs[0]) | BIT(ppi_chs[1]) | - (PPI_PER_CH > 2 ? BIT(ppi_chs[2]) : 0); - nrfx_gppi_channels_disable(ppi_mask); + /* disable PPI used */ + nrfx_gppi_channels_disable(src_d, data->ppi_ch_mask[channel]); active_level = (flags & PWM_POLARITY_INVERTED) ? 0 : 1; @@ -278,12 +278,10 @@ static int pwm_nrf_sw_set_cycles(const struct device *dev, uint32_t channel, nrf_rtc_compare_event_get(0)); #if PPI_FORK_AVAILABLE - nrfx_gppi_fork_endpoint_setup(ppi_chs[1], - clear_task_address); + nrfx_gppi_ep_attach(clear_task_address, ppi_chs[1]); #else - nrfx_gppi_channel_endpoints_setup(ppi_chs[2], - period_end_event_address, - clear_task_address); + nrfx_gppi_ep_attach(period_end_event_address, ppi_chs[2]); + nrfx_gppi_ep_attach(clear_task_address, ppi_chs[2]); #endif } else { pulse_end_event_address = @@ -294,13 +292,13 @@ static int pwm_nrf_sw_set_cycles(const struct device *dev, uint32_t channel, nrf_timer_compare_event_get(0)); } - nrfx_gppi_channel_endpoints_setup(ppi_chs[0], - pulse_end_event_address, - pulse_end_task_address); - nrfx_gppi_channel_endpoints_setup(ppi_chs[1], - period_end_event_address, - period_end_task_address); - nrfx_gppi_channels_enable(ppi_mask); + nrfx_gppi_ep_attach(pulse_end_event_address, ppi_chs[0]); + nrfx_gppi_ep_attach(pulse_end_task_address, ppi_chs[0]); + + nrfx_gppi_ep_attach(period_end_event_address, ppi_chs[1]); + nrfx_gppi_ep_attach(period_end_task_address, ppi_chs[1]); + + nrfx_gppi_channels_enable(src_d, data->ppi_ch_mask[channel]); /* start timer, hence PWM */ if (USE_RTC) { @@ -351,28 +349,37 @@ static int pwm_nrf_sw_init(const struct device *dev) NRF_RTC_Type *rtc = pwm_config_rtc(config); for (uint32_t i = 0; i < config->map_size; i++) { - nrfx_err_t err; + uint32_t src_d = nrfx_gppi_domain_id_get(USE_RTC ? (uint32_t)rtc : (uint32_t)timer); + uint32_t dst_d = nrfx_gppi_domain_id_get((uint32_t)config->gpiote[i]->p_reg); + int rv; /* Allocate resources. */ for (uint32_t j = 0; j < PPI_PER_CH; j++) { - err = nrfx_gppi_channel_alloc(&data->ppi_ch[i][j]); - if (err != NRFX_SUCCESS) { + int ch; + + rv = nrfx_gppi_domain_conn_alloc(src_d, dst_d, &data->ppi_h[i][j]); + if (rv < 0) { /* Do not free allocated resource. It is a fatal condition, * system requires reconfiguration. */ LOG_ERR("Failed to allocate PPI channel"); - return -ENOMEM; + return rv; } + /* Enable connection but at the end disable channel on the source domain. */ + nrfx_gppi_conn_enable(data->ppi_h[i][j]); + ch = nrfx_gppi_domain_channel_get(data->ppi_h[i][j], src_d); + __ASSERT_NO_MSG(ch >= 0); + data->ppi_ch_mask[i] |= BIT(ch); } + nrfx_gppi_channels_disable(src_d, data->ppi_ch_mask[i]); - err = nrfx_gpiote_channel_alloc(&config->gpiote[i], - &data->gpiote_ch[i]); - if (err != NRFX_SUCCESS) { + rv = nrfx_gpiote_channel_alloc(config->gpiote[i], &data->gpiote_ch[i]); + if (rv < 0) { /* Do not free allocated resource. It is a fatal condition, * system requires reconfiguration. */ LOG_ERR("Failed to allocate GPIOTE channel"); - return -ENOMEM; + return rv; } /* Set initial state of the output pins. */ @@ -410,7 +417,7 @@ static int pwm_nrf_sw_init(const struct device *dev) ? BIT(_idx) : 0) | #define GPIOTE_AND_COMMA(_node_id, _prop, _idx) \ - NRFX_GPIOTE_INSTANCE(NRF_DT_GPIOTE_INST_BY_IDX(_node_id, _prop, _idx)), + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE_BY_IDX(_node_id, _prop, _idx)) static const struct pwm_config pwm_nrf_sw_0_config = { COND_CODE_1(USE_RTC, (.rtc), (.timer)) = GENERATOR_ADDR, diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 55a2b759b18b..2a97aa47dfdc 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -3,6 +3,9 @@ * * SPDX-License-Identifier: Apache-2.0 */ + +#define DT_DRV_COMPAT nordic_nrf_pwm + #include #include #include @@ -18,31 +21,12 @@ LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL); -/* NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED can be undefined or defined - * to 0 or 1, hence the use of #if IS_ENABLED(). - */ -#if IS_ENABLED(NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED) -#define ANOMALY_109_EGU_IRQ_CONNECT(idx) _EGU_IRQ_CONNECT(idx) -#define _EGU_IRQ_CONNECT(idx) \ - extern void nrfx_egu_##idx##_irq_handler(void); \ - IRQ_CONNECT(DT_IRQN(DT_NODELABEL(egu##idx)), \ - DT_IRQ(DT_NODELABEL(egu##idx), priority), \ - nrfx_isr, nrfx_egu_##idx##_irq_handler, 0) -#else -#define ANOMALY_109_EGU_IRQ_CONNECT(idx) -#endif - -#define PWM(dev_idx) DT_NODELABEL(pwm##dev_idx) -#define PWM_PROP(dev_idx, prop) DT_PROP(PWM(dev_idx), prop) -#define PWM_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(PWM(idx), prop) - #define PWM_NRFX_CH_POLARITY_MASK BIT(15) #define PWM_NRFX_CH_COMPARE_MASK BIT_MASK(15) #define PWM_NRFX_CH_VALUE(compare_value, inverted) \ (compare_value | (inverted ? 0 : PWM_NRFX_CH_POLARITY_MASK)) struct pwm_nrfx_config { - nrfx_pwm_t pwm; nrfx_pwm_config_t initial_config; nrf_pwm_sequence_t seq; const struct pinctrl_dev_config *pcfg; @@ -53,12 +37,49 @@ struct pwm_nrfx_config { }; struct pwm_nrfx_data { + nrfx_pwm_t pwm; uint32_t period_cycles; /* Bit mask indicating channels that need the PWM generation. */ uint8_t pwm_needed; uint8_t prescaler; bool stop_requested; }; + +#if NRF_ERRATA_STATIC_CHECK(52, 109) +/* Forward-declare pwm_nrfx__data structs to be able to access nrfx_pwm_t needed for the + * workaround. + */ +#define _PWM_DATA_STRUCT_NAME_GET(inst) pwm_nrfx_##inst##_data +#define _PWM_DATA_STRUCT_DECLARE(inst) static struct pwm_nrfx_data _PWM_DATA_STRUCT_NAME_GET(inst); +DT_INST_FOREACH_STATUS_OKAY(_PWM_DATA_STRUCT_DECLARE); + +/* Create an array of pointers to all active PWM instances to loop over them in an EGU interrupt + * handler. + */ +#define _PWM_DATA_STRUCT_PWM_PTR_COMMA_GET(inst) &_PWM_DATA_STRUCT_NAME_GET(inst).pwm, +static nrfx_pwm_t *pwm_instances[] = { + DT_INST_FOREACH_STATUS_OKAY(_PWM_DATA_STRUCT_PWM_PTR_COMMA_GET) +}; + +/* Define an interrupt handler for the EGU instance used by the workaround which calls + * nrfx_pwm_nrf52_anomaly_109_handler for all active PWM instances. + */ +void anomaly_109_egu_handler(void) +{ + for (int i = 0; i < ARRAY_SIZE(pwm_instances); i++) { + nrfx_pwm_nrf52_anomaly_109_handler(pwm_instances[i]); + } +} + +#define ANOMALY_109_EGU_IRQ_CONNECT(idx) _EGU_IRQ_CONNECT(idx) +#define _EGU_IRQ_CONNECT(idx) \ + IRQ_CONNECT(DT_IRQN(DT_NODELABEL(egu##idx)), \ + DT_IRQ(DT_NODELABEL(egu##idx), priority), \ + anomaly_109_egu_handler, 0, 0) +#else +#define ANOMALY_109_EGU_IRQ_CONNECT(idx) +#endif + /* Ensure the pwm_needed bit mask can accommodate all available channels. */ #if (NRF_PWM_CHANNEL_COUNT > 8) #error "Current implementation supports maximum 8 channels." @@ -71,9 +92,9 @@ static uint16_t *seq_values_ptr_get(const struct device *dev) return (uint16_t *)config->seq.values.p_raw; } -static void pwm_handler(nrfx_pwm_evt_type_t event_type, void *p_context) +static void pwm_handler(nrfx_pwm_event_type_t event, void *p_context) { - ARG_UNUSED(event_type); + ARG_UNUSED(event); ARG_UNUSED(p_context); } @@ -111,7 +132,7 @@ static bool pwm_period_check_and_set(const struct device *dev, data->period_cycles = period_cycles; data->prescaler = prescaler; - nrf_pwm_configure(config->pwm.p_reg, + nrf_pwm_configure(data->pwm.p_reg, data->prescaler, config->initial_config.count_mode, (uint16_t)countertop); @@ -126,10 +147,9 @@ static bool pwm_period_check_and_set(const struct device *dev, return false; } -static bool channel_psel_get(uint32_t channel, uint32_t *psel, - const struct pwm_nrfx_config *config) +static bool channel_psel_get(uint32_t channel, uint32_t *psel, struct pwm_nrfx_data *data) { - *psel = nrf_pwm_pin_get(config->pwm.p_reg, (uint8_t)channel); + *psel = nrf_pwm_pin_get(data->pwm.p_reg, (uint8_t)channel); return (((*psel & PWM_PSEL_OUT_CONNECT_Msk) >> PWM_PSEL_OUT_CONNECT_Pos) == PWM_PSEL_OUT_CONNECT_Connected); @@ -137,12 +157,12 @@ static bool channel_psel_get(uint32_t channel, uint32_t *psel, static int stop_pwm(const struct device *dev) { - const struct pwm_nrfx_config *config = dev->config; + struct pwm_nrfx_data *data = dev->data; /* Don't wait here for the peripheral to actually stop. Instead, - * ensure it is stopped before starting the next playback. - */ - nrfx_pwm_stop(&config->pwm, false); + * ensure it is stopped before starting the next playback. + */ + nrfx_pwm_stop(&data->pwm, false); return 0; } @@ -218,7 +238,7 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, if (!needs_pwm) { uint32_t psel; - if (channel_psel_get(channel, &psel, config)) { + if (channel_psel_get(channel, &psel, data)) { uint32_t out_level = (pulse_cycles == 0) ? 0 : 1; if (inverted) { @@ -257,7 +277,7 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, * and till that moment, it ignores any start requests, * so ensure here that it is stopped. */ - while (!nrfx_pwm_stopped_check(&config->pwm)) { + while (!nrfx_pwm_stopped_check(&data->pwm)) { } } @@ -266,7 +286,7 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, * until another playback is requested (new values will be * loaded then) or the PWM peripheral is stopped. */ - nrfx_pwm_simple_playback(&config->pwm, &config->seq, 1, + nrfx_pwm_simple_playback(&data->pwm, &config->seq, 1, NRFX_PWM_FLAG_NO_EVT_FINISHED); } @@ -291,6 +311,8 @@ static DEVICE_API(pwm, pwm_nrfx_drv_api_funcs) = { static int pwm_resume(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; + struct pwm_nrfx_data *data = dev->data; + uint8_t initially_inverted = 0; (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); @@ -298,7 +320,7 @@ static int pwm_resume(const struct device *dev) for (size_t i = 0; i < NRF_PWM_CHANNEL_COUNT; i++) { uint32_t psel; - if (channel_psel_get(i, &psel, config)) { + if (channel_psel_get(i, &psel, data)) { /* Mark channels as inverted according to what initial * state of their outputs has been set by pinctrl (high * idle state means that the channel is inverted). @@ -320,6 +342,7 @@ static int pwm_resume(const struct device *dev) static int pwm_suspend(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; + struct pwm_nrfx_data *data = dev->data; int ret = stop_pwm(dev); @@ -328,7 +351,7 @@ static int pwm_suspend(const struct device *dev) return ret; } - while (!nrfx_pwm_stopped_check(&config->pwm)) { + while (!nrfx_pwm_stopped_check(&data->pwm)) { } memset(dev->data, 0, sizeof(struct pwm_nrfx_data)); @@ -354,7 +377,9 @@ static int pwm_nrfx_pm_action(const struct device *dev, static int pwm_nrfx_init(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; - nrfx_err_t err; + struct pwm_nrfx_data *data = dev->data; + + int err; ANOMALY_109_EGU_IRQ_CONNECT(NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE); @@ -362,71 +387,70 @@ static int pwm_nrfx_init(const struct device *dev) (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); } - err = nrfx_pwm_init(&config->pwm, &config->initial_config, pwm_handler, dev->data); - if (err != NRFX_SUCCESS) { + err = nrfx_pwm_init(&data->pwm, &config->initial_config, pwm_handler, dev->data); + if (err < 0) { LOG_ERR("Failed to initialize device: %s", dev->name); - return -EBUSY; + return err; } return pm_device_driver_init(dev, pwm_nrfx_pm_action); } -#define PWM_MEM_REGION(idx) DT_PHANDLE(PWM(idx), memory_regions) +#define PWM_MEM_REGION(inst) DT_PHANDLE(DT_DRV_INST(inst), memory_regions) -#define PWM_MEMORY_SECTION(idx) \ - COND_CODE_1(PWM_HAS_PROP(idx, memory_regions), \ +#define PWM_MEMORY_SECTION(inst) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(inst), memory_regions), \ (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ - PWM_MEM_REGION(idx)))))), \ + PWM_MEM_REGION(inst)))))), \ ()) -#define PWM_GET_MEM_ATTR(idx) \ - COND_CODE_1(PWM_HAS_PROP(idx, memory_regions), \ - (DT_PROP_OR(PWM_MEM_REGION(idx), zephyr_memory_attr, 0)), (0)) - -#define PWM_NRFX_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ - static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \ - static uint16_t pwm_##idx##_seq_values[NRF_PWM_CHANNEL_COUNT] \ - PWM_MEMORY_SECTION(idx); \ - PINCTRL_DT_DEFINE(PWM(idx)); \ - static const struct pwm_nrfx_config pwm_nrfx_##idx##_config = { \ - .pwm = NRFX_PWM_INSTANCE(idx), \ - .initial_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .base_clock = NRF_PWM_CLK_1MHz, \ - .count_mode = (PWM_PROP(idx, center_aligned) \ - ? NRF_PWM_MODE_UP_AND_DOWN \ - : NRF_PWM_MODE_UP), \ - .top_value = 1000, \ - .load_mode = NRF_PWM_LOAD_INDIVIDUAL, \ - .step_mode = NRF_PWM_STEP_TRIGGERED, \ - }, \ - .seq.values.p_raw = pwm_##idx##_seq_values, \ - .seq.length = NRF_PWM_CHANNEL_COUNT, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PWM(idx)), \ - .clock_freq = COND_CODE_1(DT_CLOCKS_HAS_IDX(PWM(idx), 0), \ - (DT_PROP(DT_CLOCKS_CTLR(PWM(idx)), clock_frequency)), \ - (16ul * 1000ul * 1000ul)), \ - IF_ENABLED(CONFIG_DCACHE, \ - (.mem_attr = PWM_GET_MEM_ATTR(idx),)) \ - }; \ - static int pwm_nrfx_init##idx(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(PWM(idx)), DT_IRQ(PWM(idx), priority), \ - nrfx_isr, nrfx_pwm_##idx##_irq_handler, 0); \ - return pwm_nrfx_init(dev); \ - }; \ - PM_DEVICE_DT_DEFINE(PWM(idx), pwm_nrfx_pm_action); \ - DEVICE_DT_DEFINE(PWM(idx), \ - pwm_nrfx_init##idx, PM_DEVICE_DT_GET(PWM(idx)), \ - &pwm_nrfx_##idx##_data, \ - &pwm_nrfx_##idx##_config, \ - POST_KERNEL, CONFIG_PWM_INIT_PRIORITY, \ - &pwm_nrfx_drv_api_funcs) - -#define COND_PWM_NRFX_DEVICE(unused, prefix, i, _) \ - IF_ENABLED(CONFIG_HAS_HW_NRF_PWM##prefix##i, (PWM_NRFX_DEVICE(prefix##i);)) - -NRFX_FOREACH_PRESENT(PWM, COND_PWM_NRFX_DEVICE, (), (), _) +#define PWM_GET_MEM_ATTR(inst) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(inst), memory_regions), \ + (DT_PROP_OR(PWM_MEM_REGION(inst), zephyr_memory_attr, 0)), (0)) + +#define PWM_NRFX_DEFINE(inst) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ + static struct pwm_nrfx_data pwm_nrfx_##inst##_data = { \ + .pwm = NRFX_PWM_INSTANCE(DT_INST_REG_ADDR(inst)), \ + }; \ + static uint16_t pwm_##inst##_seq_values[NRF_PWM_CHANNEL_COUNT] \ + PWM_MEMORY_SECTION(inst); \ + PINCTRL_DT_INST_DEFINE(inst); \ + static const struct pwm_nrfx_config pwm_nrfx_##inst##_config = { \ + .initial_config = { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .base_clock = NRF_PWM_CLK_1MHz, \ + .count_mode = (DT_INST_PROP(inst, center_aligned) \ + ? NRF_PWM_MODE_UP_AND_DOWN \ + : NRF_PWM_MODE_UP), \ + .top_value = 1000, \ + .load_mode = NRF_PWM_LOAD_INDIVIDUAL, \ + .step_mode = NRF_PWM_STEP_TRIGGERED, \ + }, \ + .seq.values.p_raw = pwm_##inst##_seq_values, \ + .seq.length = NRF_PWM_CHANNEL_COUNT, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ + .clock_freq = COND_CODE_1(DT_INST_CLOCKS_HAS_IDX(inst, 0), \ + (DT_PROP(DT_INST_CLOCKS_CTLR(inst), clock_frequency)), \ + (16ul * 1000ul * 1000ul)), \ + IF_ENABLED(CONFIG_DCACHE, \ + (.mem_attr = PWM_GET_MEM_ATTR(inst),)) \ + }; \ + static int pwm_nrfx_init##inst(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ + nrfx_pwm_irq_handler, &pwm_nrfx_##inst##_data.pwm, 0); \ + return pwm_nrfx_init(dev); \ + }; \ + PM_DEVICE_DT_INST_DEFINE(inst, pwm_nrfx_pm_action); \ + DEVICE_DT_INST_DEINIT_DEFINE(inst, \ + pwm_nrfx_init##inst, NULL, \ + PM_DEVICE_DT_INST_GET(inst), \ + &pwm_nrfx_##inst##_data, \ + &pwm_nrfx_##inst##_config, \ + POST_KERNEL, CONFIG_PWM_INIT_PRIORITY, \ + &pwm_nrfx_drv_api_funcs) + +DT_INST_FOREACH_STATUS_OKAY(PWM_NRFX_DEFINE) diff --git a/drivers/sensor/nordic/qdec_nrfx/Kconfig b/drivers/sensor/nordic/qdec_nrfx/Kconfig index 71c3ab1d5b0d..a69c234caac9 100644 --- a/drivers/sensor/nordic/qdec_nrfx/Kconfig +++ b/drivers/sensor/nordic/qdec_nrfx/Kconfig @@ -5,12 +5,7 @@ config QDEC_NRFX bool "Nordic QDEC nrfx driver" default y depends on DT_HAS_NORDIC_NRF_QDEC_ENABLED - select NRFX_QDEC0 if HAS_HW_NRF_QDEC0 - select NRFX_QDEC1 if HAS_HW_NRF_QDEC1 - select NRFX_QDEC20 if HAS_HW_NRF_QDEC20 - select NRFX_QDEC21 if HAS_HW_NRF_QDEC21 - select NRFX_QDEC130 if HAS_HW_NRF_QDEC130 - select NRFX_QDEC131 if HAS_HW_NRF_QDEC131 + select NRFX_QDEC select PINCTRL help Enable support for nrfx QDEC driver for nRF MCU series. diff --git a/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c index 0d5eb5ab8cc2..378ce64f497a 100644 --- a/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c +++ b/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c @@ -43,6 +43,7 @@ BUILD_ASSERT(NRF_QDEC_SAMPLEPER_16384US == SAMPLEPER_16384US, "Different SAMPLEPER register values in devicetree binding and nRF HAL"); struct qdec_nrfx_data { + nrfx_qdec_t qdec; int32_t fetched_acc; int32_t acc; bool overflow; @@ -51,7 +52,6 @@ struct qdec_nrfx_data { }; struct qdec_nrfx_config { - nrfx_qdec_t qdec; nrfx_qdec_config_t config; void (*irq_connect)(void); const struct pinctrl_dev_config *pcfg; @@ -78,7 +78,6 @@ static void accumulate(struct qdec_nrfx_data *data, int32_t acc) static int qdec_nrfx_sample_fetch(const struct device *dev, enum sensor_channel chan) { - const struct qdec_nrfx_config *config = dev->config; struct qdec_nrfx_data *data = dev->data; int32_t acc; uint32_t accdbl; @@ -87,7 +86,7 @@ static int qdec_nrfx_sample_fetch(const struct device *dev, return -ENOTSUP; } - nrfx_qdec_accumulators_read(&config->qdec, &acc, &accdbl); + nrfx_qdec_accumulators_read(&data->qdec, &acc, &accdbl); accumulate(data, acc); @@ -212,8 +211,9 @@ static DEVICE_API(sensor, qdec_nrfx_driver_api) = { static void qdec_pm_suspend(const struct device *dev) { const struct qdec_nrfx_config *config = dev->config; + struct qdec_nrfx_data *dev_data = dev->data; - nrfx_qdec_disable(&config->qdec); + nrfx_qdec_disable(&dev_data->qdec); qdec_nrfx_gpio_ctrl(dev, false); (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); @@ -222,10 +222,11 @@ static void qdec_pm_suspend(const struct device *dev) static void qdec_pm_resume(const struct device *dev) { const struct qdec_nrfx_config *config = dev->config; + struct qdec_nrfx_data *dev_data = dev->data; (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); qdec_nrfx_gpio_ctrl(dev, true); - nrfx_qdec_enable(&config->qdec); + nrfx_qdec_enable(&dev_data->qdec); } static int qdec_nrfx_pm_action(const struct device *dev, enum pm_device_action action) @@ -251,13 +252,15 @@ static int qdec_nrfx_pm_action(const struct device *dev, enum pm_device_action a static int qdec_nrfx_init(const struct device *dev) { const struct qdec_nrfx_config *config = dev->config; - nrfx_err_t nerr; + struct qdec_nrfx_data *dev_data = dev->data; + int nerr; config->irq_connect(); - nerr = nrfx_qdec_init(&config->qdec, &config->config, qdec_nrfx_event_handler, (void *)dev); - if (nerr != NRFX_SUCCESS) { - return (nerr == NRFX_ERROR_INVALID_STATE) ? -EBUSY : -EFAULT; + nerr = nrfx_qdec_init(&dev_data->qdec, &config->config, qdec_nrfx_event_handler, + (void *)dev); + if (nerr != 0) { + return -EALREADY; } /* End up in suspend state. */ @@ -269,9 +272,6 @@ static int qdec_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, qdec_nrfx_pm_action); } -#define QDEC(idx) DT_NODELABEL(qdec##idx) -#define QDEC_PROP(idx, prop) DT_PROP(QDEC(idx), prop) - /* Macro determines PM actions interrupt safety level. * * Requesting/releasing QDEC device may be ISR safe, but it cannot be reliably known whether @@ -279,78 +279,56 @@ static int qdec_nrfx_init(const struct device *dev) * no longer ISR safe. This macro let's us check if we will be requesting/releasing * power domains and determines PM device ISR safety value. */ -#define QDEC_PM_ISR_SAFE(idx) \ - COND_CODE_1( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND( \ - DT_NODE_HAS_PROP(QDEC(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(QDEC(idx), power_domains)) \ - ) \ - ), \ - (0), \ - (PM_DEVICE_ISR_SAFE) \ +#define QDEC_PM_ISR_SAFE(inst) \ + COND_CODE_1( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND(DT_INST_NODE_HAS_PROP(inst, power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_INST_PHANDLE(inst, power_domains))) \ + ), \ + (0), \ + (PM_DEVICE_ISR_SAFE) \ ) -#define SENSOR_NRFX_QDEC_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QDEC(idx)); \ - BUILD_ASSERT(QDEC_PROP(idx, steps) > 0, \ - "Wrong QDEC"#idx" steps setting in dts. Only positive number valid"); \ - BUILD_ASSERT(QDEC_PROP(idx, steps) <= 2048, \ - "Wrong QDEC"#idx" steps setting in dts. Overflow possible"); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(QDEC(idx)), DT_IRQ(QDEC(idx), priority), \ - nrfx_isr, nrfx_qdec_##idx##_irq_handler, 0); \ - } \ - static struct qdec_nrfx_data qdec_##idx##_data; \ - PINCTRL_DT_DEFINE(QDEC(idx)); \ - static struct qdec_nrfx_config qdec_##idx##_config = { \ - .qdec = NRFX_QDEC_INSTANCE(idx), \ - .config = { \ - .reportper = NRF_QDEC_REPORTPER_40, \ - .sampleper = DT_STRING_TOKEN(QDEC(idx), nordic_period), \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .ledpre = QDEC_PROP(idx, led_pre), \ - .ledpol = NRF_QDEC_LEPOL_ACTIVE_HIGH, \ - .reportper_inten = true, \ - }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(QDEC(idx)), \ - .enable_pin = DT_PROP_OR(QDEC(idx), enable_pin, NRF_QDEC_PIN_NOT_CONNECTED), \ - .steps = QDEC_PROP(idx, steps), \ - }; \ - PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, QDEC_PM_ISR_SAFE(idx)); \ - SENSOR_DEVICE_DT_DEFINE(QDEC(idx), \ - qdec_nrfx_init, \ - PM_DEVICE_DT_GET(QDEC(idx)), \ - &qdec_##idx##_data, \ - &qdec_##idx##_config, \ - POST_KERNEL, \ - CONFIG_SENSOR_INIT_PRIORITY, \ +#define SENSOR_NRFX_QDEC_DEVICE(inst) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ + BUILD_ASSERT(DT_INST_PROP(inst, steps) > 0, \ + "Wrong QDEC"#inst" steps setting in dts. Only positive number valid"); \ + BUILD_ASSERT(DT_INST_PROP(inst, steps) <= 2048, \ + "Wrong QDEC"#inst" steps setting in dts. Overflow possible"); \ + static struct qdec_nrfx_data qdec_##inst##_data = { \ + .qdec = NRFX_QDEC_INSTANCE(DT_INST_REG_ADDR(inst)), \ + }; \ + static void irq_connect##inst(void) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ + nrfx_qdec_irq_handler, &qdec_##inst##_data.qdec, 0); \ + } \ + PINCTRL_DT_DEFINE(DT_DRV_INST(inst)); \ + static struct qdec_nrfx_config qdec_##inst##_config = { \ + .config = { \ + .reportper = NRF_QDEC_REPORTPER_40, \ + .sampleper = DT_STRING_TOKEN(DT_DRV_INST(inst), nordic_period), \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .ledpre = DT_INST_PROP(inst, led_pre), \ + .ledpol = NRF_QDEC_LEPOL_ACTIVE_HIGH, \ + .reportper_inten = true, \ + }, \ + .irq_connect = irq_connect##inst, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(DT_DRV_INST(inst)), \ + .enable_pin = DT_PROP_OR( \ + DT_DRV_INST(inst), enable_pin, NRF_QDEC_PIN_NOT_CONNECTED), \ + .steps = DT_INST_PROP(inst, steps), \ + }; \ + PM_DEVICE_DT_INST_DEFINE(inst, qdec_nrfx_pm_action, QDEC_PM_ISR_SAFE(inst)); \ + SENSOR_DEVICE_DT_DEFINE(DT_DRV_INST(inst), \ + qdec_nrfx_init, \ + PM_DEVICE_DT_INST_GET(inst), \ + &qdec_##inst##_data, \ + &qdec_##inst##_config, \ + POST_KERNEL, \ + CONFIG_SENSOR_INIT_PRIORITY, \ &qdec_nrfx_driver_api) -#ifdef CONFIG_HAS_HW_NRF_QDEC0 -SENSOR_NRFX_QDEC_DEVICE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_QDEC1 -SENSOR_NRFX_QDEC_DEVICE(1); -#endif - -#ifdef CONFIG_HAS_HW_NRF_QDEC20 -SENSOR_NRFX_QDEC_DEVICE(20); -#endif - -#ifdef CONFIG_HAS_HW_NRF_QDEC21 -SENSOR_NRFX_QDEC_DEVICE(21); -#endif - -#ifdef CONFIG_HAS_HW_NRF_QDEC130 -SENSOR_NRFX_QDEC_DEVICE(130); -#endif - -#ifdef CONFIG_HAS_HW_NRF_QDEC131 -SENSOR_NRFX_QDEC_DEVICE(131); -#endif +DT_INST_FOREACH_STATUS_OKAY(SENSOR_NRFX_QDEC_DEVICE) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 722cc11da071..8ce35b591634 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -206,37 +206,25 @@ nrfx_uart_num = 137 rsource "Kconfig.nrfx_uart_instance" endif -config NRFX_TIMER0 +config NRFX_TIMER default y depends on UART_0_NRF_HW_ASYNC_TIMER = 0 \ || UART_1_NRF_HW_ASYNC_TIMER = 0 \ || UART_2_NRF_HW_ASYNC_TIMER = 0 \ - || UART_3_NRF_HW_ASYNC_TIMER = 0 - -config NRFX_TIMER1 - default y - depends on UART_0_NRF_HW_ASYNC_TIMER = 1 \ + || UART_3_NRF_HW_ASYNC_TIMER = 0 \ + || UART_0_NRF_HW_ASYNC_TIMER = 1 \ || UART_1_NRF_HW_ASYNC_TIMER = 1 \ || UART_2_NRF_HW_ASYNC_TIMER = 1 \ - || UART_3_NRF_HW_ASYNC_TIMER = 1 - -config NRFX_TIMER2 - default y - depends on UART_0_NRF_HW_ASYNC_TIMER = 2 \ + || UART_3_NRF_HW_ASYNC_TIMER = 1 \ + || UART_0_NRF_HW_ASYNC_TIMER = 2 \ || UART_1_NRF_HW_ASYNC_TIMER = 2 \ || UART_2_NRF_HW_ASYNC_TIMER = 2 \ - || UART_3_NRF_HW_ASYNC_TIMER = 2 - -config NRFX_TIMER3 - default y - depends on UART_0_NRF_HW_ASYNC_TIMER = 3 \ + || UART_3_NRF_HW_ASYNC_TIMER = 2 \ + || UART_0_NRF_HW_ASYNC_TIMER = 3 \ || UART_1_NRF_HW_ASYNC_TIMER = 3 \ || UART_2_NRF_HW_ASYNC_TIMER = 3 \ - || UART_3_NRF_HW_ASYNC_TIMER = 3 - -config NRFX_TIMER4 - default y - depends on UART_0_NRF_HW_ASYNC_TIMER = 4 \ + || UART_3_NRF_HW_ASYNC_TIMER = 3 \ + || UART_0_NRF_HW_ASYNC_TIMER = 4 \ || UART_1_NRF_HW_ASYNC_TIMER = 4 \ || UART_2_NRF_HW_ASYNC_TIMER = 4 \ || UART_3_NRF_HW_ASYNC_TIMER = 4 diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index a60a1ee97aa1..7a32cb11e737 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -187,8 +187,8 @@ struct uarte_async_rx_cbwt { uint8_t *anomaly_byte_dst; uint8_t anomaly_byte; #endif + nrfx_gppi_handle_t ppi_h; uint8_t bounce_idx; - uint8_t ppi_ch; bool in_irq; bool discard_fifo; }; @@ -217,7 +217,7 @@ struct uarte_async_rx { int32_t timeout_slab; /* rx_timeout divided by RX_TIMEOUT_DIV */ int32_t timeout_left; /* Current time left until user callback */ union { - uint8_t ppi; + nrfx_gppi_handle_t ppi; uint32_t cnt; } cnt; /* Flag to ensure that RX timeout won't be executed during ENDRX ISR */ @@ -264,11 +264,12 @@ struct uarte_nrfx_data { #endif #ifdef UARTE_ANY_ASYNC struct uarte_async_cb *async; + nrfx_timer_t timer; #endif atomic_val_t poll_out_lock; atomic_t flags; #ifdef UARTE_ENHANCED_POLL_OUT - uint8_t ppi_ch_endtx; + nrfx_gppi_handle_t ppi_h_endtx; #endif }; @@ -388,7 +389,6 @@ struct uarte_nrfx_config { size_t bounce_buf_swap_len; struct uarte_async_rx_cbwt *cbwt_data; #endif - nrfx_timer_t timer; uint8_t *tx_cache; uint8_t *rx_flush_buf; #endif @@ -457,7 +457,7 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) #if defined(UARTE_ANY_ASYNC) && !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) if (data->async && HW_RX_COUNTING_ENABLED(config)) { - nrfx_timer_disable(&config->timer); + nrfx_timer_disable(&data->timer); /* Timer/counter value is reset when disabled. */ data->async->rx.total_byte_cnt = 0; data->async->rx.total_user_byte_cnt = 0; @@ -604,7 +604,7 @@ static int uarte_nrfx_configure(const struct device *dev, struct uarte_nrfx_data *data = dev->data; nrf_uarte_config_t uarte_cfg; -#if defined(UARTE_CONFIG_STOP_Msk) +#if NRF_UARTE_HAS_STOP_MODES switch (cfg->stop_bits) { case UART_CFG_STOP_BITS_1: uarte_cfg.stop = NRF_UARTE_STOP_ONE; @@ -636,7 +636,7 @@ static int uarte_nrfx_configure(const struct device *dev, return -ENOTSUP; } -#if defined(UARTE_CONFIG_PARITYTYPE_Msk) +#if NRF_UARTE_HAS_PARITY_TYPES uarte_cfg.paritytype = NRF_UARTE_PARITYTYPE_EVEN; #endif switch (cfg->parity) { @@ -646,7 +646,7 @@ static int uarte_nrfx_configure(const struct device *dev, case UART_CFG_PARITY_EVEN: uarte_cfg.parity = NRF_UARTE_PARITY_INCLUDED; break; -#if defined(UARTE_CONFIG_PARITYTYPE_Msk) +#if NRF_UARTE_HAS_PARITY_TYPES case UART_CFG_PARITY_ODD: uarte_cfg.parity = NRF_UARTE_PARITY_INCLUDED; uarte_cfg.paritytype = NRF_UARTE_PARITYTYPE_ODD; @@ -765,7 +765,7 @@ static void uarte_periph_enable(const struct device *dev) #ifdef UARTE_ANY_ASYNC if (data->async) { if (HW_RX_COUNTING_ENABLED(config)) { - const nrfx_timer_t *timer = &config->timer; + nrfx_timer_t *timer = &data->timer; nrfx_timer_enable(timer); @@ -954,31 +954,30 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) if (HW_RX_COUNTING_ENABLED(cfg)) { nrfx_timer_config_t tmr_config = NRFX_TIMER_DEFAULT_CONFIG( - NRF_TIMER_BASE_FREQUENCY_GET(cfg->timer.p_reg)); + NRF_TIMER_BASE_FREQUENCY_GET(data->timer.p_reg)); uint32_t evt_addr = nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_RXDRDY); - uint32_t tsk_addr = nrfx_timer_task_address_get(&cfg->timer, NRF_TIMER_TASK_COUNT); + uint32_t tsk_addr = nrfx_timer_task_address_get(&data->timer, NRF_TIMER_TASK_COUNT); tmr_config.mode = NRF_TIMER_MODE_COUNTER; tmr_config.bit_width = NRF_TIMER_BIT_WIDTH_32; - ret = nrfx_timer_init(&cfg->timer, + ret = nrfx_timer_init(&data->timer, &tmr_config, timer_handler); - if (ret != NRFX_SUCCESS) { + if (ret != 0) { LOG_ERR("Timer already initialized"); return -EINVAL; } - nrfx_timer_clear(&cfg->timer); + nrfx_timer_clear(&data->timer); - ret = nrfx_gppi_channel_alloc(&data->async->rx.cnt.ppi); - if (ret != NRFX_SUCCESS) { + ret = nrfx_gppi_conn_alloc(evt_addr, tsk_addr, &data->async->rx.cnt.ppi); + if (ret < 0) { LOG_ERR("Failed to allocate PPI Channel"); - nrfx_timer_uninit(&cfg->timer); - return -EINVAL; + nrfx_timer_uninit(&data->timer); + return ret; } - nrfx_gppi_channel_endpoints_setup(data->async->rx.cnt.ppi, evt_addr, tsk_addr); - nrfx_gppi_channels_enable(BIT(data->async->rx.cnt.ppi)); + nrfx_gppi_conn_enable(data->async->rx.cnt.ppi); } else { nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); } @@ -1609,18 +1608,17 @@ static int cbwt_uarte_async_init(const struct device *dev) NRF_UARTE_INT_RXTO_MASK; uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT); - nrfx_err_t ret; + int ret; nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER); nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32); - ret = nrfx_gppi_channel_alloc(&cbwt_data->ppi_ch); - if (ret != NRFX_SUCCESS) { - return -ENOMEM; + ret = nrfx_gppi_conn_alloc(evt, tsk, &cbwt_data->ppi_h); + if (ret < 0) { + return ret; } - nrfx_gppi_channel_endpoints_setup(cbwt_data->ppi_ch, evt, tsk); - nrfx_gppi_channels_enable(BIT(cbwt_data->ppi_ch)); + nrfx_gppi_conn_enable(cbwt_data->ppi_h); #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; @@ -2117,7 +2115,7 @@ static void rx_timeout(struct k_timer *timer) NRF_UARTE_INT_ENDRX_MASK); if (HW_RX_COUNTING_ENABLED(cfg)) { - read = nrfx_timer_capture(&cfg->timer, 0); + read = nrfx_timer_capture(&data->timer, 0); } else { read = async_rx->cnt.cnt; } @@ -3001,18 +2999,17 @@ static DEVICE_API(uart, uart_nrfx_uarte_driver_api) = { static int endtx_stoptx_ppi_init(NRF_UARTE_Type *uarte, struct uarte_nrfx_data *data) { - nrfx_err_t ret; + int ret; - ret = nrfx_gppi_channel_alloc(&data->ppi_ch_endtx); - if (ret != NRFX_SUCCESS) { + ret = nrfx_gppi_conn_alloc( + nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_ENDTX), + nrf_uarte_task_address_get(uarte, NRF_UARTE_TASK_STOPTX), &data->ppi_h_endtx); + if (ret < 0) { LOG_ERR("Failed to allocate PPI Channel"); - return -EIO; + return ret; } - nrfx_gppi_channel_endpoints_setup(data->ppi_ch_endtx, - nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_ENDTX), - nrf_uarte_task_address_get(uarte, NRF_UARTE_TASK_STOPTX)); - nrfx_gppi_channels_enable(BIT(data->ppi_ch_endtx)); + nrfx_gppi_conn_enable(data->ppi_h_endtx); return 0; } @@ -3092,7 +3089,7 @@ static void uarte_pm_suspend(const struct device *dev) #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) if (data->async && HW_RX_COUNTING_ENABLED(cfg)) { - nrfx_timer_disable(&cfg->timer); + nrfx_timer_disable(&data->timer); /* Timer/counter value is reset when disabled. */ data->async->rx.total_byte_cnt = 0; data->async->rx.total_user_byte_cnt = 0; @@ -3411,6 +3408,9 @@ static int uarte_instance_deinit(const struct device *dev) (.uart_config = UARTE_CONFIG(idx),)) \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ (.async = &uarte##idx##_async,)) \ + IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ + (.timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET( \ + CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER)),)) \ IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \ (.int_driven = &uarte##idx##_int_driven,)) \ }; \ @@ -3452,9 +3452,6 @@ static int uarte_instance_deinit(const struct device *dev) .rx_flush_buf = uarte##idx##_flush_buf,)) \ IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ (UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx))) \ - IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ - (.timer = NRFX_TIMER_INSTANCE( \ - CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ }; \ UARTE_DIRECT_ISR_DECLARE(idx) \ static int uarte_##idx##_init(const struct device *dev) \ diff --git a/drivers/spi/Kconfig.nrfx b/drivers/spi/Kconfig.nrfx index e609a6c4933c..990f044574ba 100644 --- a/drivers/spi/Kconfig.nrfx +++ b/drivers/spi/Kconfig.nrfx @@ -22,73 +22,13 @@ config SPI_NRFX_SPI config SPI_NRFX_SPIM def_bool y depends on DT_HAS_NORDIC_NRF_SPIM_ENABLED - select NRFX_SPIM0 if HAS_HW_NRF_SPIM0 - select NRFX_SPIM1 if HAS_HW_NRF_SPIM1 - select NRFX_SPIM2 if HAS_HW_NRF_SPIM2 - select NRFX_SPIM3 if HAS_HW_NRF_SPIM3 - select NRFX_SPIM4 if HAS_HW_NRF_SPIM4 - select NRFX_SPIM00 if HAS_HW_NRF_SPIM00 - select NRFX_SPIM01 if HAS_HW_NRF_SPIM01 - select NRFX_SPIM20 if HAS_HW_NRF_SPIM20 - select NRFX_SPIM21 if HAS_HW_NRF_SPIM21 - select NRFX_SPIM22 if HAS_HW_NRF_SPIM22 - select NRFX_SPIM23 if HAS_HW_NRF_SPIM23 - select NRFX_SPIM24 if HAS_HW_NRF_SPIM24 - select NRFX_SPIM30 if HAS_HW_NRF_SPIM30 - select NRFX_SPIM120 if HAS_HW_NRF_SPIM120 - select NRFX_SPIM121 if HAS_HW_NRF_SPIM121 - select NRFX_SPIM130 if HAS_HW_NRF_SPIM130 - select NRFX_SPIM131 if HAS_HW_NRF_SPIM131 - select NRFX_SPIM132 if HAS_HW_NRF_SPIM132 - select NRFX_SPIM133 if HAS_HW_NRF_SPIM133 - select NRFX_SPIM134 if HAS_HW_NRF_SPIM134 - select NRFX_SPIM135 if HAS_HW_NRF_SPIM135 - select NRFX_SPIM136 if HAS_HW_NRF_SPIM136 - select NRFX_SPIM137 if HAS_HW_NRF_SPIM137 + select NRFX_SPIM config SPI_NRFX_SPIS def_bool y depends on DT_HAS_NORDIC_NRF_SPIS_ENABLED select SPI_SLAVE - select NRFX_SPIS0 if HAS_HW_NRF_SPIS0 - select NRFX_SPIS1 if HAS_HW_NRF_SPIS1 - select NRFX_SPIS2 if HAS_HW_NRF_SPIS2 - select NRFX_SPIS3 if HAS_HW_NRF_SPIS3 - select NRFX_SPIS00 if HAS_HW_NRF_SPIS00 - select NRFX_SPIS01 if HAS_HW_NRF_SPIS01 - select NRFX_SPIS20 if HAS_HW_NRF_SPIS20 - select NRFX_SPIS21 if HAS_HW_NRF_SPIS21 - select NRFX_SPIS22 if HAS_HW_NRF_SPIS22 - select NRFX_SPIS23 if HAS_HW_NRF_SPIS23 - select NRFX_SPIS24 if HAS_HW_NRF_SPIS24 - select NRFX_SPIS30 if HAS_HW_NRF_SPIS30 - select NRFX_SPIS120 if HAS_HW_NRF_SPIS120 - select NRFX_SPIS130 if HAS_HW_NRF_SPIS130 - select NRFX_SPIS131 if HAS_HW_NRF_SPIS131 - select NRFX_SPIS132 if HAS_HW_NRF_SPIS132 - select NRFX_SPIS133 if HAS_HW_NRF_SPIS133 - select NRFX_SPIS134 if HAS_HW_NRF_SPIS134 - select NRFX_SPIS135 if HAS_HW_NRF_SPIS135 - select NRFX_SPIS136 if HAS_HW_NRF_SPIS136 - select NRFX_SPIS137 if HAS_HW_NRF_SPIS137 - -config SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 - depends on SOC_NRF52832 - select NRFX_PPI - bool "Allow enabling the SPIM driver despite PAN 58" - help - Allow enabling the nRF SPI Master with EasyDMA, despite - Product Anomaly Notice 58 (SPIM: An additional byte is - clocked out when RXD.MAXCNT == 1 and TXD.MAXCNT <= 1). - Without this override, the SPI Master is only available - without EasyDMA. Note that the 'SPIM' and 'SPIS' drivers - use EasyDMA, while the 'SPI' driver does not. - When used in conjunction with nRF SPIM Devicetree property - 'anomaly-58-workaround' a workaround can be enabled per SPIM - instance. If you are certain that transactions with - RXD.MAXCNT == 1 and TXD.MAXCNT <= 1 will NOT be executed - then nRF52832 PPI and GPIOTE resources can be saved by not - enabling 'anomaly-58-workaround' via the Devicetree. + select NRFX_SPIS config SPI_NRFX_RAM_BUFFER_SIZE int "Size of RAM buffers for SPIM peripherals" diff --git a/drivers/spi/spi_nrfx_common.c b/drivers/spi/spi_nrfx_common.c index 04a11c2367a9..17fd3f52ba33 100644 --- a/drivers/spi/spi_nrfx_common.c +++ b/drivers/spi/spi_nrfx_common.c @@ -7,7 +7,7 @@ #include "spi_nrfx_common.h" #include -int spi_nrfx_wake_init(const nrfx_gpiote_t *gpiote, uint32_t wake_pin) +int spi_nrfx_wake_init(nrfx_gpiote_t *gpiote, uint32_t wake_pin) { nrf_gpio_pin_pull_t pull_config = NRF_GPIO_PIN_PULLDOWN; uint8_t ch; @@ -20,23 +20,23 @@ int spi_nrfx_wake_init(const nrfx_gpiote_t *gpiote, uint32_t wake_pin) .p_trigger_config = &trigger_config, .p_handler_config = NULL, }; - nrfx_err_t res; + int res; res = nrfx_gpiote_channel_alloc(gpiote, &ch); - if (res != NRFX_SUCCESS) { - return -ENODEV; + if (res < 0) { + return res; } res = nrfx_gpiote_input_configure(gpiote, wake_pin, &input_config); - if (res != NRFX_SUCCESS) { + if (res < 0) { nrfx_gpiote_channel_free(gpiote, ch); - return -EIO; + return res; } return 0; } -int spi_nrfx_wake_request(const nrfx_gpiote_t *gpiote, uint32_t wake_pin) +int spi_nrfx_wake_request(nrfx_gpiote_t *gpiote, uint32_t wake_pin) { nrf_gpiote_event_t trigger_event = nrfx_gpiote_in_event_get(gpiote, wake_pin); uint32_t start_cycles; diff --git a/drivers/spi/spi_nrfx_common.h b/drivers/spi/spi_nrfx_common.h index 0cf17e2a0356..9a0894410783 100644 --- a/drivers/spi/spi_nrfx_common.h +++ b/drivers/spi/spi_nrfx_common.h @@ -9,16 +9,18 @@ #include #include +#include +#include #define WAKE_PIN_NOT_USED UINT32_MAX -#define WAKE_GPIOTE_INSTANCE(node_id) \ - COND_CODE_1(DT_NODE_HAS_PROP(node_id, wake_gpios), \ - (NRFX_GPIOTE_INSTANCE( \ - NRF_DT_GPIOTE_INST(node_id, wake_gpios))), \ - ({0})) +#define WAKE_GPIOTE_NODE(node_id) \ + COND_CODE_1(DT_NODE_HAS_PROP(node_id, wake_gpios), \ + (&GPIOTE_NRFX_INST_BY_NODE(DT_PHANDLE(DT_PHANDLE(node_id, wake_gpios), \ + gpiote_instance))), \ + (NULL)) -int spi_nrfx_wake_init(const nrfx_gpiote_t *gpiote, uint32_t wake_pin); -int spi_nrfx_wake_request(const nrfx_gpiote_t *gpiote, uint32_t wake_pin); +int spi_nrfx_wake_init(nrfx_gpiote_t *gpiote, uint32_t wake_pin); +int spi_nrfx_wake_request(nrfx_gpiote_t *gpiote, uint32_t wake_pin); #endif /* ZEPHYR_DRIVERS_SPI_NRFX_COMMON_H_ */ diff --git a/drivers/spi/spi_nrfx_spi.c b/drivers/spi/spi_nrfx_spi.c index 7608f3ab9487..10badb033d97 100644 --- a/drivers/spi/spi_nrfx_spi.c +++ b/drivers/spi/spi_nrfx_spi.c @@ -31,8 +31,8 @@ struct spi_nrfx_config { nrfx_spi_config_t def_config; void (*irq_connect)(void); const struct pinctrl_dev_config *pcfg; + nrfx_gpiote_t *wake_gpiote; uint32_t wake_pin; - nrfx_gpiote_t wake_gpiote; }; static void event_handler(const nrfx_spi_evt_t *p_event, void *p_context); @@ -91,7 +91,7 @@ static int configure(const struct device *dev, const struct spi_nrfx_config *dev_config = dev->config; struct spi_context *ctx = &dev_data->ctx; nrfx_spi_config_t config; - nrfx_err_t result; + int result; uint32_t sck_pin; if (dev_data->initialized && spi_context_configured(ctx, spi_cfg)) { @@ -149,8 +149,8 @@ static int configure(const struct device *dev, result = nrfx_spi_init(&dev_config->spi, &config, event_handler, dev_data); - if (result != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize nrfx driver: %08x", result); + if (result != 0) { + LOG_ERR("Failed to initialize nrfx driver: %d", result); return -EIO; } @@ -183,7 +183,6 @@ static void transfer_next_chunk(const struct device *dev) if (chunk_len > 0) { nrfx_spi_xfer_desc_t xfer; - nrfx_err_t result; dev_data->chunk_len = chunk_len; @@ -191,8 +190,8 @@ static void transfer_next_chunk(const struct device *dev) xfer.tx_length = spi_context_tx_buf_on(ctx) ? chunk_len : 0; xfer.p_rx_buffer = ctx->rx_buf; xfer.rx_length = spi_context_rx_buf_on(ctx) ? chunk_len : 0; - result = nrfx_spi_xfer(&dev_config->spi, &xfer, 0); - if (result == NRFX_SUCCESS) { + error = nrfx_spi_xfer(&dev_config->spi, &xfer, 0); + if (error == 0) { return; } @@ -241,7 +240,7 @@ static int transceive(const struct device *dev, dev_data->busy = true; if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { - error = spi_nrfx_wake_request(&dev_config->wake_gpiote, + error = spi_nrfx_wake_request(dev_config->wake_gpiote, dev_config->wake_pin); if (error == -ETIMEDOUT) { LOG_WRN("Waiting for WAKE acknowledgment timed out"); @@ -395,7 +394,7 @@ static int spi_nrfx_init(const struct device *dev) } if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { - err = spi_nrfx_wake_init(&dev_config->wake_gpiote, dev_config->wake_pin); + err = spi_nrfx_wake_init(dev_config->wake_gpiote, dev_config->wake_pin); if (err == -ENODEV) { LOG_ERR("Failed to allocate GPIOTE channel for WAKE"); return err; @@ -458,9 +457,9 @@ static int spi_nrfx_init(const struct device *dev) }, \ .irq_connect = irq_connect##idx, \ .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPI(idx)), \ + .wake_gpiote = WAKE_GPIOTE_NODE(SPI(idx)), \ .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPI(idx), wake_gpios, \ WAKE_PIN_NOT_USED), \ - .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPI(idx)), \ }; \ BUILD_ASSERT(!DT_NODE_HAS_PROP(SPI(idx), wake_gpios) || \ !(DT_GPIO_FLAGS(SPI(idx), wake_gpios) & GPIO_ACTIVE_LOW), \ diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 390682260c81..8a658f2ebb8c 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_nrf_spim + #include #include #include @@ -13,9 +15,6 @@ #include #include #include -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 -#include -#endif #ifdef CONFIG_SOC_NRF5340_CPUAPP #include #endif @@ -30,31 +29,12 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #include "spi_context.h" #include "spi_nrfx_common.h" -#if defined(CONFIG_SOC_NRF52832) && !defined(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58) -#error This driver is not available by default for nRF52832 because of Product Anomaly 58 \ - (SPIM: An additional byte is clocked out when RXD.MAXCNT == 1 and TXD.MAXCNT <= 1). \ - Use CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y to override this limitation. -#endif - #if (CONFIG_SPI_NRFX_RAM_BUFFER_SIZE > 0) #define SPI_BUFFER_IN_RAM 1 #endif -/* - * We use NODELABEL here because the nrfx API requires us to call - * functions which are named according to SoC peripheral instance - * being operated on. Since DT_INST() makes no guarantees about that, - * it won't work. - */ -#define SPIM(idx) DT_NODELABEL(spi##idx) -#define SPIM_PROP(idx, prop) DT_PROP(SPIM(idx), prop) -#define SPIM_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIM(idx), prop) - -/* Execute macro f(x) for all instances. */ -#define SPIM_FOR_EACH_INSTANCE(f, sep, off_code, ...) \ - NRFX_FOREACH_PRESENT(SPIM, f, sep, off_code, __VA_ARGS__) - struct spi_nrfx_data { + nrfx_spim_t spim; struct spi_context ctx; const struct device *dev; size_t chunk_len; @@ -64,35 +44,25 @@ struct spi_nrfx_data { uint8_t *tx_buffer; uint8_t *rx_buffer; #endif -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 - bool anomaly_58_workaround_active; - uint8_t ppi_ch; - uint8_t gpiote_ch; -#endif }; struct spi_nrfx_config { - nrfx_spim_t spim; uint32_t max_freq; nrfx_spim_config_t def_config; void (*irq_connect)(void); uint16_t max_chunk_len; const struct pinctrl_dev_config *pcfg; -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 - bool anomaly_58_workaround; -#endif + nrfx_gpiote_t *wake_gpiote; uint32_t wake_pin; - nrfx_gpiote_t wake_gpiote; void *mem_reg; }; -static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context); +static void event_handler(const nrfx_spim_event_t *p_event, void *p_context); static inline void finalize_spi_transaction(const struct device *dev, bool deactivate_cs) { struct spi_nrfx_data *dev_data = dev->data; - const struct spi_nrfx_config *dev_config = dev->config; - void *reg = dev_config->spim.p_reg; + void *reg = dev_data->spim.p_reg; if (deactivate_cs) { spi_context_cs_control(&dev_data->ctx, false); @@ -167,7 +137,7 @@ static int configure(const struct device *dev, struct spi_context *ctx = &dev_data->ctx; uint32_t max_freq = dev_config->max_freq; nrfx_spim_config_t config; - nrfx_err_t result; + int result; uint32_t sck_pin; if (dev_data->initialized && spi_context_configured(ctx, spi_cfg)) { @@ -225,22 +195,22 @@ static int configure(const struct device *dev, config.mode = get_nrf_spim_mode(spi_cfg->operation); config.bit_order = get_nrf_spim_bit_order(spi_cfg->operation); - sck_pin = nrfy_spim_sck_pin_get(dev_config->spim.p_reg); + sck_pin = nrfy_spim_sck_pin_get(dev_data->spim.p_reg); if (sck_pin != NRF_SPIM_PIN_NOT_CONNECTED) { nrfy_gpio_pin_write(sck_pin, spi_cfg->operation & SPI_MODE_CPOL ? 1 : 0); } if (dev_data->initialized) { - nrfx_spim_uninit(&dev_config->spim); + nrfx_spim_uninit(&dev_data->spim); dev_data->initialized = false; } - result = nrfx_spim_init(&dev_config->spim, &config, + result = nrfx_spim_init(&dev_data->spim, &config, event_handler, (void *)dev); - if (result != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize nrfx driver: %08x", result); - return -EIO; + if (result < 0) { + LOG_ERR("Failed to initialize nrfx driver: %d", result); + return result; } dev_data->initialized = true; @@ -250,89 +220,6 @@ static int configure(const struct device *dev, return 0; } -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 -static const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(0); - -/* - * Brief Workaround for transmitting 1 byte with SPIM. - * - * Derived from the setup_workaround_for_ftpan_58() function from - * the nRF52832 Rev 1 Errata v1.6 document anomaly 58 workaround. - * - * Warning Must not be used when transmitting multiple bytes. - * - * Warning After this workaround is used, the user must reset the PPI - * channel and the GPIOTE channel before attempting to transmit multiple - * bytes. - */ -static void anomaly_58_workaround_setup(const struct device *dev) -{ - struct spi_nrfx_data *dev_data = dev->data; - const struct spi_nrfx_config *dev_config = dev->config; - NRF_SPIM_Type *spim = dev_config->spim.p_reg; - uint32_t ppi_ch = dev_data->ppi_ch; - uint32_t gpiote_ch = dev_data->gpiote_ch; - uint32_t eep = (uint32_t)&gpiote.p_reg->EVENTS_IN[gpiote_ch]; - uint32_t tep = (uint32_t)&spim->TASKS_STOP; - - dev_data->anomaly_58_workaround_active = true; - - /* Create an event when SCK toggles */ - nrf_gpiote_event_configure(gpiote.p_reg, gpiote_ch, spim->PSEL.SCK, - GPIOTE_CONFIG_POLARITY_Toggle); - nrf_gpiote_event_enable(gpiote.p_reg, gpiote_ch); - - /* Stop the spim instance when SCK toggles */ - nrf_ppi_channel_endpoint_setup(NRF_PPI, ppi_ch, eep, tep); - nrf_ppi_channel_enable(NRF_PPI, ppi_ch); - - /* The spim instance cannot be stopped mid-byte, so it will finish - * transmitting the first byte and then stop. Effectively ensuring - * that only 1 byte is transmitted. - */ -} - -static void anomaly_58_workaround_clear(struct spi_nrfx_data *dev_data) -{ - uint32_t ppi_ch = dev_data->ppi_ch; - uint32_t gpiote_ch = dev_data->gpiote_ch; - - if (dev_data->anomaly_58_workaround_active) { - nrf_ppi_channel_disable(NRF_PPI, ppi_ch); - nrf_gpiote_task_disable(gpiote.p_reg, gpiote_ch); - - dev_data->anomaly_58_workaround_active = false; - } -} - -static int anomaly_58_workaround_init(const struct device *dev) -{ - struct spi_nrfx_data *dev_data = dev->data; - const struct spi_nrfx_config *dev_config = dev->config; - nrfx_err_t err_code; - - dev_data->anomaly_58_workaround_active = false; - - if (dev_config->anomaly_58_workaround) { - err_code = nrfx_ppi_channel_alloc(&dev_data->ppi_ch); - if (err_code != NRFX_SUCCESS) { - LOG_ERR("Failed to allocate PPI channel"); - return -ENODEV; - } - - err_code = nrfx_gpiote_channel_alloc(&gpiote, &dev_data->gpiote_ch); - if (err_code != NRFX_SUCCESS) { - LOG_ERR("Failed to allocate GPIOTE channel"); - return -ENODEV; - } - LOG_DBG("PAN 58 workaround enabled for %s: ppi %u, gpiote %u", - dev->name, dev_data->ppi_ch, dev_data->gpiote_ch); - } - - return 0; -} -#endif - static void finish_transaction(const struct device *dev, int error) { struct spi_nrfx_data *dev_data = dev->data; @@ -362,7 +249,6 @@ static void transfer_next_chunk(const struct device *dev) if (chunk_len > 0) { nrfx_spim_xfer_desc_t xfer; - nrfx_err_t result; const uint8_t *tx_buf = ctx->tx_buf; uint8_t *rx_buf = ctx->rx_buf; @@ -372,7 +258,7 @@ static void transfer_next_chunk(const struct device *dev) #ifdef SPI_BUFFER_IN_RAM if (spi_context_tx_buf_on(ctx) && - !nrf_dma_accessible_check(&dev_config->spim.p_reg, tx_buf)) { + !nrf_dma_accessible_check(&dev_data->spim.p_reg, tx_buf)) { if (chunk_len > CONFIG_SPI_NRFX_RAM_BUFFER_SIZE) { chunk_len = CONFIG_SPI_NRFX_RAM_BUFFER_SIZE; @@ -383,7 +269,7 @@ static void transfer_next_chunk(const struct device *dev) } if (spi_context_rx_buf_on(ctx) && - !nrf_dma_accessible_check(&dev_config->spim.p_reg, rx_buf)) { + !nrf_dma_accessible_check(&dev_data->spim.p_reg, rx_buf)) { if (chunk_len > CONFIG_SPI_NRFX_RAM_BUFFER_SIZE) { chunk_len = CONFIG_SPI_NRFX_RAM_BUFFER_SIZE; @@ -410,26 +296,9 @@ static void transfer_next_chunk(const struct device *dev) goto in_alloc_failed; } -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 - if (xfer.rx_length == 1 && xfer.tx_length <= 1) { - if (dev_config->anomaly_58_workaround) { - anomaly_58_workaround_setup(dev); - } else { - LOG_WRN("Transaction aborted since it would trigger " - "nRF52832 PAN 58"); - error = -EIO; - } - } -#endif + error = nrfx_spim_xfer(&dev_data->spim, &xfer, 0); if (error == 0) { - result = nrfx_spim_xfer(&dev_config->spim, &xfer, 0); - if (result == NRFX_SUCCESS) { - return; - } - error = -EIO; -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 - anomaly_58_workaround_clear(dev_data); -#endif + return; } /* On nrfx_spim_xfer() error */ @@ -443,7 +312,7 @@ static void transfer_next_chunk(const struct device *dev) finish_transaction(dev, error); } -static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context) +static void event_handler(const nrfx_spim_event_t *p_event, void *p_context) { const struct device *dev = p_context; struct spi_nrfx_data *dev_data = dev->data; @@ -458,10 +327,6 @@ static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context) return; } -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 - anomaly_58_workaround_clear(dev_data); -#endif - if (spi_context_tx_buf_on(&dev_data->ctx)) { dmm_buffer_out_release(dev_config->mem_reg, (void **)p_event->xfer_desc.p_tx_buffer); @@ -498,7 +363,7 @@ static int transceive(const struct device *dev, { struct spi_nrfx_data *dev_data = dev->data; const struct spi_nrfx_config *dev_config = dev->config; - void *reg = dev_config->spim.p_reg; + void *reg = dev_data->spim.p_reg; int error; pm_device_runtime_get(dev); @@ -510,7 +375,7 @@ static int transceive(const struct device *dev, dev_data->busy = true; if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { - error = spi_nrfx_wake_request(&dev_config->wake_gpiote, + error = spi_nrfx_wake_request(dev_config->wake_gpiote, dev_config->wake_pin); if (error == -ETIMEDOUT) { LOG_WRN("Waiting for WAKE acknowledgment timed out"); @@ -540,7 +405,7 @@ static int transceive(const struct device *dev, /* Abort the current transfer by deinitializing * the nrfx driver. */ - nrfx_spim_uninit(&dev_config->spim); + nrfx_spim_uninit(&dev_data->spim); dev_data->initialized = false; /* Make sure the transaction is finished (it may be @@ -555,9 +420,6 @@ static int transceive(const struct device *dev, #else dev_data->ctx.ready = 0; #endif /* CONFIG_MULTITHREADING */ -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 - anomaly_58_workaround_clear(dev_data); -#endif } else if (error) { finalize_spi_transaction(dev, true); } @@ -624,6 +486,7 @@ static int spim_resume(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; + (void)dev_data; (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); /* nrfx_spim_init() will be called at configuration before @@ -641,13 +504,15 @@ static void spim_suspend(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; + int err; if (dev_data->initialized) { - nrfx_spim_uninit(&dev_config->spim); + nrfx_spim_uninit(&dev_data->spim); dev_data->initialized = false; } - spi_context_cs_put_all(&dev_data->ctx); + err = spi_context_cs_put_all(&dev_data->ctx); + (void)err; (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -677,7 +542,7 @@ static int spi_nrfx_init(const struct device *dev) (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { - err = spi_nrfx_wake_init(&dev_config->wake_gpiote, dev_config->wake_pin); + err = spi_nrfx_wake_init(dev_config->wake_gpiote, dev_config->wake_pin); if (err == -ENODEV) { LOG_ERR("Failed to allocate GPIOTE channel for WAKE"); return err; @@ -697,12 +562,6 @@ static int spi_nrfx_init(const struct device *dev) spi_context_unlock_unconditionally(&dev_data->ctx); -#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 - err = anomaly_58_workaround_init(dev); - if (err < 0) { - return err; - } -#endif return pm_device_driver_init(dev, spim_nrfx_pm_action); } @@ -727,81 +586,74 @@ static int spi_nrfx_deinit(const struct device *dev) return 0; } -#define SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \ +#define SPI_NRFX_SPIM_EXTENDED_CONFIG(inst) \ IF_ENABLED(NRFX_SPIM_EXTENDED_ENABLED, \ (.dcx_pin = NRF_SPIM_PIN_NOT_CONNECTED, \ - COND_CODE_1(SPIM_PROP(idx, rx_delay_supported), \ - (.rx_delay = SPIM_PROP(idx, rx_delay),), \ + COND_CODE_1(DT_INST_PROP(inst, rx_delay_supported), \ + (.rx_delay = DT_INST_PROP(inst, rx_delay),), \ ()) \ )) -#define SPI_NRFX_SPIM_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(SPIM(idx)), DT_IRQ(SPIM(idx), priority), \ - nrfx_isr, nrfx_spim_##idx##_irq_handler, 0); \ - } \ +#define SPI_NRFX_SPIM_DEFINE(inst) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ IF_ENABLED(SPI_BUFFER_IN_RAM, \ - (static uint8_t spim_##idx##_tx_buffer \ + (static uint8_t spim_##inst##_tx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ - DMM_MEMORY_SECTION(SPIM(idx)); \ - static uint8_t spim_##idx##_rx_buffer \ + DMM_MEMORY_SECTION(DT_DRV_INST(inst)); \ + static uint8_t spim_##inst##_rx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ - DMM_MEMORY_SECTION(SPIM(idx));)) \ - static struct spi_nrfx_data spi_##idx##_data = { \ + DMM_MEMORY_SECTION(DT_DRV_INST(inst));)) \ + static struct spi_nrfx_data spi_##inst##_data = { \ + .spim = NRFX_SPIM_INSTANCE(DT_INST_REG_ADDR(inst)), \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ + (SPI_CONTEXT_INIT_LOCK(spi_##inst##_data, ctx),)) \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - SPI_CONTEXT_CS_GPIOS_INITIALIZE(SPIM(idx), ctx) \ + (SPI_CONTEXT_INIT_SYNC(spi_##inst##_data, ctx),)) \ + SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ IF_ENABLED(SPI_BUFFER_IN_RAM, \ - (.tx_buffer = spim_##idx##_tx_buffer, \ - .rx_buffer = spim_##idx##_rx_buffer,)) \ - .dev = DEVICE_DT_GET(SPIM(idx)), \ + (.tx_buffer = spim_##inst##_tx_buffer, \ + .rx_buffer = spim_##inst##_rx_buffer,)) \ + .dev = DEVICE_DT_GET(DT_DRV_INST(inst)), \ .busy = false, \ }; \ - PINCTRL_DT_DEFINE(SPIM(idx)); \ - static const struct spi_nrfx_config spi_##idx##z_config = { \ - .spim = { \ - .p_reg = (NRF_SPIM_Type *)DT_REG_ADDR(SPIM(idx)), \ - .drv_inst_idx = NRFX_SPIM##idx##_INST_IDX, \ - }, \ - .max_freq = SPIM_PROP(idx, max_frequency), \ + static void irq_connect##inst(void) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ + nrfx_spim_irq_handler, &spi_##inst##_data.spim, 0); \ + } \ + PINCTRL_DT_INST_DEFINE(inst); \ + static const struct spi_nrfx_config spi_##inst##z_config = { \ + .max_freq = DT_INST_PROP(inst, max_frequency), \ .def_config = { \ .skip_gpio_cfg = true, \ .skip_psel_cfg = true, \ .ss_pin = NRF_SPIM_PIN_NOT_CONNECTED, \ - .orc = SPIM_PROP(idx, overrun_character), \ - SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \ + .orc = DT_INST_PROP(inst, overrun_character), \ + SPI_NRFX_SPIM_EXTENDED_CONFIG(inst) \ }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIM(idx)), \ - .max_chunk_len = BIT_MASK(SPIM_PROP(idx, easydma_maxcnt_bits)),\ - COND_CODE_1(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58, \ - (.anomaly_58_workaround = \ - SPIM_PROP(idx, anomaly_58_workaround),), \ - ()) \ - .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPIM(idx), wake_gpios, \ + .irq_connect = irq_connect##inst, \ + .max_chunk_len = BIT_MASK( \ + DT_INST_PROP(inst, easydma_maxcnt_bits)), \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ + .wake_gpiote = WAKE_GPIOTE_NODE(DT_DRV_INST(inst)), \ + .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(DT_DRV_INST(inst), \ + wake_gpios, \ WAKE_PIN_NOT_USED), \ - .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPIM(idx)), \ - .mem_reg = DMM_DEV_TO_REG(SPIM(idx)), \ + .mem_reg = DMM_DEV_TO_REG(DT_DRV_INST(inst)), \ }; \ - BUILD_ASSERT(!SPIM_HAS_PROP(idx, wake_gpios) || \ - !(DT_GPIO_FLAGS(SPIM(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ + BUILD_ASSERT(!DT_INST_NODE_HAS_PROP(inst, wake_gpios) || \ + !(DT_GPIO_FLAGS(DT_DRV_INST(inst), wake_gpios) & \ + GPIO_ACTIVE_LOW), \ "WAKE line must be configured as active high"); \ - PM_DEVICE_DT_DEFINE(SPIM(idx), spim_nrfx_pm_action); \ - SPI_DEVICE_DT_DEINIT_DEFINE(SPIM(idx), \ + PM_DEVICE_DT_INST_DEFINE(inst, spim_nrfx_pm_action); \ + SPI_DEVICE_DT_INST_DEINIT_DEFINE(inst, \ spi_nrfx_init, \ spi_nrfx_deinit, \ - PM_DEVICE_DT_GET(SPIM(idx)), \ - &spi_##idx##_data, \ - &spi_##idx##z_config, \ + PM_DEVICE_DT_INST_GET(inst), \ + &spi_##inst##_data, \ + &spi_##inst##z_config, \ POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \ &spi_nrfx_driver_api) -#define COND_NRF_SPIM_DEVICE(unused, prefix, i, _) \ - IF_ENABLED(CONFIG_HAS_HW_NRF_SPIM##prefix##i, (SPI_NRFX_SPIM_DEFINE(prefix##i);)) - -SPIM_FOR_EACH_INSTANCE(COND_NRF_SPIM_DEVICE, (), (), _) +DT_INST_FOREACH_STATUS_OKAY(SPI_NRFX_SPIM_DEFINE) diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index 0861ed3c2f54..0ddabf62a4ae 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ + #define DT_DRV_COMPAT nordic_nrf_spis + #include #include #include @@ -20,19 +22,8 @@ LOG_MODULE_REGISTER(spi_nrfx_spis, CONFIG_SPI_LOG_LEVEL); #include "spi_context.h" -/* - * Current factors requiring use of DT_NODELABEL: - * - * - HAL design (requirement of drv_inst_idx in nrfx_spis_t) - * - Name-based HAL IRQ handlers, e.g. nrfx_spis_0_irq_handler - */ -#define SPIS_NODE(idx) \ - COND_CODE_1(DT_NODE_EXISTS(DT_NODELABEL(spis##idx)), (spis##idx), (spi##idx)) -#define SPIS(idx) DT_NODELABEL(SPIS_NODE(idx)) -#define SPIS_PROP(idx, prop) DT_PROP(SPIS(idx), prop) -#define SPIS_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIS(idx), prop) - struct spi_nrfx_data { + nrfx_spis_t spis; struct spi_context ctx; const struct device *dev; #ifdef CONFIG_MULTITHREADING @@ -44,7 +35,6 @@ struct spi_nrfx_data { }; struct spi_nrfx_config { - nrfx_spis_t spis; nrfx_spis_config_t config; void (*irq_connect)(void); uint16_t max_buf_len; @@ -82,7 +72,6 @@ static inline nrf_spis_bit_order_t get_nrf_spis_bit_order(uint16_t operation) static int configure(const struct device *dev, const struct spi_config *spi_cfg) { - const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; struct spi_context *ctx = &dev_data->ctx; @@ -124,7 +113,7 @@ static int configure(const struct device *dev, ctx->config = spi_cfg; - nrf_spis_configure(dev_config->spis.p_reg, + nrf_spis_configure(dev_data->spis.p_reg, get_nrf_spis_mode(spi_cfg->operation), get_nrf_spis_bit_order(spi_cfg->operation)); @@ -137,7 +126,6 @@ static int prepare_for_transfer(const struct device *dev, { const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; - nrfx_err_t result; uint8_t *dmm_tx_buf; uint8_t *dmm_rx_buf; int err; @@ -163,11 +151,10 @@ static int prepare_for_transfer(const struct device *dev, goto in_alloc_failed; } - result = nrfx_spis_buffers_set(&dev_config->spis, + err = nrfx_spis_buffers_set(&dev_data->spis, dmm_tx_buf, tx_buf_len, dmm_rx_buf, rx_buf_len); - if (result != NRFX_SUCCESS) { - err = -EIO; + if (err != 0) { goto buffers_set_failed; } @@ -255,7 +242,7 @@ static int transceive(const struct device *dev, if (dev_config->wake_gpio.port) { wait_for_wake(dev_data, dev_config); - nrf_spis_enable(dev_config->spis.p_reg); + nrf_spis_enable(dev_data->spis.p_reg); } error = prepare_for_transfer(dev, @@ -285,7 +272,7 @@ static int transceive(const struct device *dev, } if (dev_config->wake_gpio.port) { - nrf_spis_disable(dev_config->spis.p_reg); + nrf_spis_disable(dev_data->spis.p_reg); } } @@ -339,7 +326,7 @@ static DEVICE_API(spi, spi_nrfx_driver_api) = { .release = spi_nrfx_release, }; -static void event_handler(const nrfx_spis_evt_t *p_event, void *p_context) +static void event_handler(const nrfx_spis_event_t *p_event, void *p_context) { const struct device *dev = p_context; struct spi_nrfx_data *dev_data = dev->data; @@ -367,9 +354,10 @@ static void event_handler(const nrfx_spis_evt_t *p_event, void *p_context) static void spi_nrfx_suspend(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; + struct spi_nrfx_data *dev_data = dev->data; if (dev_config->wake_gpio.port == NULL) { - nrf_spis_disable(dev_config->spis.p_reg); + nrf_spis_disable(dev_data->spis.p_reg); } (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); @@ -378,11 +366,12 @@ static void spi_nrfx_suspend(const struct device *dev) static void spi_nrfx_resume(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; + struct spi_nrfx_data *dev_data = dev->data; (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); if (dev_config->wake_gpio.port == NULL) { - nrf_spis_enable(dev_config->spis.p_reg); + nrf_spis_enable(dev_data->spis.p_reg); } } @@ -408,18 +397,17 @@ static int spi_nrfx_init(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; - nrfx_err_t result; int err; /* This sets only default values of mode and bit order. The ones to be * actually used are set in configure() when a transfer is prepared. */ - result = nrfx_spis_init(&dev_config->spis, &dev_config->config, + err = nrfx_spis_init(&dev_data->spis, &dev_config->config, event_handler, (void *)dev); - if (result != NRFX_SUCCESS) { + if (err != 0) { LOG_ERR("Failed to initialize device: %s", dev->name); - return -EBUSY; + return err; } /* When the WAKE line is used, the SPIS peripheral is enabled @@ -430,7 +418,7 @@ static int spi_nrfx_init(const struct device *dev) * with the SPIS peripheral enabled, significantly reduces idle * power consumption. */ - nrf_spis_disable(dev_config->spis.p_reg); + nrf_spis_disable(dev_data->spis.p_reg); if (dev_config->wake_gpio.port) { if (!gpio_is_ready_dt(&dev_config->wake_gpio)) { @@ -463,59 +451,54 @@ static int spi_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, spi_nrfx_pm_action); } -#define SPI_NRFX_SPIS_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), \ - nrfx_isr, nrfx_spis_##idx##_irq_handler, 0); \ - } \ - static struct spi_nrfx_data spi_##idx##_data = { \ +#define SPI_NRFX_SPIS_DEFINE(inst) \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ + static struct spi_nrfx_data spi_##inst##_data = { \ + .spis = NRFX_SPIS_INSTANCE(DT_INST_REG_ADDR(inst)), \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ + (SPI_CONTEXT_INIT_LOCK(spi_##inst##_data, ctx),)) \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - .dev = DEVICE_DT_GET(SPIS(idx)), \ + (SPI_CONTEXT_INIT_SYNC(spi_##inst##_data, ctx),)) \ + .dev = DEVICE_DT_GET(DT_DRV_INST(inst)), \ IF_ENABLED(CONFIG_MULTITHREADING, \ (.wake_sem = Z_SEM_INITIALIZER( \ - spi_##idx##_data.wake_sem, 0, 1),)) \ + spi_##inst##_data.wake_sem, 0, 1),)) \ }; \ - PINCTRL_DT_DEFINE(SPIS(idx)); \ - static const struct spi_nrfx_config spi_##idx##z_config = { \ - .spis = { \ - .p_reg = (NRF_SPIS_Type *)DT_REG_ADDR(SPIS(idx)), \ - .drv_inst_idx = NRFX_SPIS##idx##_INST_IDX, \ - }, \ + static void irq_connect##inst(void) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ + nrfx_spis_irq_handler, &spi_##inst##_data.spis, 0); \ + } \ + PINCTRL_DT_INST_DEFINE(inst); \ + static const struct spi_nrfx_config spi_##inst##z_config = { \ .config = { \ .skip_gpio_cfg = true, \ .skip_psel_cfg = true, \ .mode = NRF_SPIS_MODE_0, \ .bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \ - .orc = SPIS_PROP(idx, overrun_character), \ - .def = SPIS_PROP(idx, def_char), \ + .orc = DT_INST_PROP(inst, overrun_character), \ + .def = DT_INST_PROP(inst, def_char), \ }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIS(idx)), \ - .max_buf_len = BIT_MASK(SPIS_PROP(idx, easydma_maxcnt_bits)), \ - .wake_gpio = GPIO_DT_SPEC_GET_OR(SPIS(idx), wake_gpios, {0}), \ - .mem_reg = DMM_DEV_TO_REG(SPIS(idx)), \ + .irq_connect = irq_connect##inst, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ + .max_buf_len = BIT_MASK(DT_INST_PROP(inst, \ + easydma_maxcnt_bits)), \ + .wake_gpio = GPIO_DT_SPEC_GET_OR(DT_DRV_INST(inst), \ + wake_gpios, {0}), \ + .mem_reg = DMM_DEV_TO_REG(DT_DRV_INST(inst)), \ }; \ - BUILD_ASSERT(!DT_NODE_HAS_PROP(SPIS(idx), wake_gpios) || \ - !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ + BUILD_ASSERT(!DT_INST_NODE_HAS_PROP(inst, wake_gpios) || \ + !(DT_GPIO_FLAGS(DT_DRV_INST(inst), wake_gpios) & \ + GPIO_ACTIVE_LOW), \ "WAKE line must be configured as active high"); \ - PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, PM_DEVICE_ISR_SAFE);\ - SPI_DEVICE_DT_DEFINE(SPIS(idx), \ - spi_nrfx_init, \ - PM_DEVICE_DT_GET(SPIS(idx)), \ - &spi_##idx##_data, \ - &spi_##idx##z_config, \ - POST_KERNEL, \ - CONFIG_SPI_INIT_PRIORITY, \ - &spi_nrfx_driver_api) - -/* Macro creates device instance if it is enabled in devicetree. */ -#define SPIS_DEVICE(periph, prefix, id, _) \ - IF_ENABLED(CONFIG_HAS_HW_NRF_SPIS##prefix##id, (SPI_NRFX_SPIS_DEFINE(prefix##id);)) - -/* Macro iterates over nrfx_spis instances enabled in the nrfx_config.h. */ -NRFX_FOREACH_ENABLED(SPIS, SPIS_DEVICE, (), (), _) + PM_DEVICE_DT_INST_DEFINE(inst, spi_nrfx_pm_action, PM_DEVICE_ISR_SAFE);\ + SPI_DEVICE_DT_INST_DEFINE(inst, \ + spi_nrfx_init, \ + PM_DEVICE_DT_INST_GET(inst), \ + &spi_##inst##_data, \ + &spi_##inst##z_config, \ + POST_KERNEL, \ + CONFIG_SPI_INIT_PRIORITY, \ + &spi_nrfx_driver_api) + +DT_INST_FOREACH_STATUS_OKAY(SPI_NRFX_SPIS_DEFINE) diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index c045f85f240c..5cfc368c52ac 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -10,7 +10,7 @@ config NRF_RTC_TIMER depends on !$(dt_nodelabel_enabled,rtc1) && !DT_HAS_NORDIC_NRF_GRTC_ENABLED select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT - select NRFX_PPI if SOC_NRF52832 + select NRFX_GPPI if SOC_NRF52832 default y if SYS_CLOCK_EXISTS help This module implements a kernel device driver for the nRF Real Time diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 94ec7e3a240f..faecda31b472 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -94,23 +94,12 @@ static inline uint64_t counter_sub(uint64_t a, uint64_t b) static inline uint64_t counter(void) { - uint64_t now; - nrfx_grtc_syscounter_get(&now); - return now; + return nrfx_grtc_syscounter_get(); } static inline int get_comparator(uint32_t chan, uint64_t *cc) { - nrfx_err_t result; - - result = nrfx_grtc_syscounter_cc_value_read(chan, cc); - if (result != NRFX_SUCCESS) { - if (result != NRFX_ERROR_INVALID_PARAM) { - return -EAGAIN; - } - return -EPERM; - } - return 0; + return nrfx_grtc_syscounter_cc_value_read(chan, cc); } /* @@ -177,14 +166,14 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte int32_t z_nrf_grtc_timer_chan_alloc(void) { uint8_t chan; - nrfx_err_t err_code; + int err_code; /* Prevent allocating all available channels - one must be left for system purposes. */ if (ext_channels_allocated >= EXT_CHAN_COUNT) { return -ENOMEM; } err_code = nrfx_grtc_channel_alloc(&chan); - if (err_code != NRFX_SUCCESS) { + if (err_code < 0) { return -ENOMEM; } ext_channels_allocated++; @@ -194,9 +183,9 @@ int32_t z_nrf_grtc_timer_chan_alloc(void) void z_nrf_grtc_timer_chan_free(int32_t chan) { IS_CHANNEL_ALLOWED_ASSERT(chan); - nrfx_err_t err_code = nrfx_grtc_channel_free(chan); + int err_code = nrfx_grtc_channel_free(chan); - if (err_code == NRFX_SUCCESS) { + if (err_code == 0) { ext_channels_allocated--; } } @@ -253,19 +242,13 @@ int z_nrf_grtc_timer_compare_read(int32_t chan, uint64_t *val) static int compare_set_nolocks(int32_t chan, uint64_t target_time, z_nrf_grtc_timer_compare_handler_t handler, void *user_data) { - nrfx_err_t result; - __ASSERT_NO_MSG(target_time < COUNTER_SPAN); nrfx_grtc_channel_t user_channel_data = { .handler = handler, .p_context = user_data, .channel = chan, }; - result = nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, target_time, true); - if (result != NRFX_SUCCESS) { - return -EPERM; - } - return 0; + return nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, target_time, true); } static int compare_set(int32_t chan, uint64_t target_time, @@ -318,7 +301,6 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan) .p_context = NULL, .channel = chan, }; - nrfx_err_t result; IS_CHANNEL_ALLOWED_ASSERT(chan); @@ -326,19 +308,12 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan) * (makes CCEN=1). COUNTER_SPAN is used so as not to fire an event unnecessarily * - it can be assumed that such a large value will never be reached. */ - result = nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, COUNTER_SPAN, false); - - if (result != NRFX_SUCCESS) { - return -EPERM; - } - - return 0; + return nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, COUNTER_SPAN, false); } int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) { - uint64_t capt_time; - nrfx_err_t result; + int result; IS_CHANNEL_ALLOWED_ASSERT(chan); @@ -348,16 +323,10 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) */ return -EBUSY; } - result = nrfx_grtc_syscounter_cc_value_read(chan, &capt_time); - if (result != NRFX_SUCCESS) { - return -EPERM; - } - - __ASSERT_NO_MSG(capt_time < COUNTER_SPAN); + result = nrfx_grtc_syscounter_cc_value_read(chan, captured_time); + __ASSERT_NO_MSG(*captured_time < COUNTER_SPAN); - *captured_time = capt_time; - - return 0; + return result; } uint64_t z_nrf_grtc_timer_startup_value_get(void) @@ -372,7 +341,7 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) return -ENOTSUP; } - nrfx_err_t err_code; + int err_code; static struct k_spinlock lock; static uint8_t systemoff_channel; uint64_t now = counter(); @@ -396,9 +365,9 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) k_spinlock_key_t key = k_spin_lock(&lock); err_code = nrfx_grtc_channel_alloc(&systemoff_channel); - if (err_code != NRFX_SUCCESS) { + if (err_code < 0) { k_spin_unlock(&lock, key); - return -ENOMEM; + return err_code; } (void)nrfx_grtc_syscounter_cc_int_disable(systemoff_channel); ret = compare_set(systemoff_channel, @@ -481,7 +450,7 @@ void sys_clock_disable(void) static int sys_clock_driver_init(void) { - nrfx_err_t err_code; + int err_code; #if defined(CONFIG_GEN_SW_ISR_TABLE) IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr, @@ -506,19 +475,19 @@ static int sys_clock_driver_init(void) #endif err_code = nrfx_grtc_init(0); - if (err_code != NRFX_SUCCESS) { - return -EPERM; + if (err_code < 0) { + return err_code; } #if defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) err_code = nrfx_grtc_syscounter_start(true, &system_clock_channel_data.channel); - if (err_code != NRFX_SUCCESS) { - return err_code == NRFX_ERROR_NO_MEM ? -ENOMEM : -EPERM; + if (err_code < 0) { + return err_code; } #else err_code = nrfx_grtc_channel_alloc(&system_clock_channel_data.channel); - if (err_code != NRFX_SUCCESS) { - return -ENOMEM; + if (err_code < 0) { + return err_code; } #endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index 3db1539f7efe..2abc183ad0b9 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -23,7 +23,7 @@ #define CUSTOM_COUNTER_BIT_WIDTH 1 #define WRAP_CH 0 #define SYS_CLOCK_CH 1 -#include "nrfx_ppi.h" +#include "helpers/nrfx_gppi.h" #else #define CUSTOM_COUNTER_BIT_WIDTH 0 #define SYS_CLOCK_CH 0 @@ -806,8 +806,8 @@ static int sys_clock_driver_init(void) alloc_mask &= ~BIT(WRAP_CH); nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(WRAP_CH); - nrfx_err_t result; - nrf_ppi_channel_t ch; + int result; + nrfx_gppi_handle_t handle; nrfy_rtc_event_enable(RTC, NRF_RTC_CHANNEL_INT_MASK(WRAP_CH)); nrfy_rtc_cc_set(RTC, WRAP_CH, COUNTER_MAX); @@ -817,12 +817,11 @@ static int sys_clock_driver_init(void) evt_addr = nrfy_rtc_event_address_get(RTC, evt); task_addr = nrfy_rtc_task_address_get(RTC, NRF_RTC_TASK_CLEAR); - result = nrfx_ppi_channel_alloc(&ch); - if (result != NRFX_SUCCESS) { - return -ENODEV; + result = nrfx_gppi_conn_alloc(evt_addr, task_addr, &handle); + if (result < 0) { + return result; } - (void)nrfx_ppi_channel_assign(ch, evt_addr, task_addr); - (void)nrfx_ppi_channel_enable(ch); + nrfx_gppi_conn_enable(handle); #endif return 0; } diff --git a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common_errata.h b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common_errata.h index 0ee23ccd2c56..338818d4999b 100644 --- a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common_errata.h +++ b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common_errata.h @@ -12,7 +12,6 @@ #define NRF_USBD_COMMON_ERRATA_H__ #include -#include #ifndef NRF_USBD_COMMON_ERRATA_ENABLE /** diff --git a/drivers/usb/udc/udc_dwc2_vendor_quirks.h b/drivers/usb/udc/udc_dwc2_vendor_quirks.h index 9b2d26b89008..a3be97a995f7 100644 --- a/drivers/usb/udc/udc_dwc2_vendor_quirks.h +++ b/drivers/usb/udc/udc_dwc2_vendor_quirks.h @@ -328,7 +328,7 @@ DT_INST_FOREACH_STATUS_OKAY(QUIRK_NRF_USBHS_DEFINE) #define USBHS_DT_WRAPPER_REG_ADDR(n) UINT_TO_POINTER(DT_INST_REG_ADDR_BY_NAME(n, wrapper)) -#include +#include #include #include #include diff --git a/drivers/watchdog/Kconfig.nrfx b/drivers/watchdog/Kconfig.nrfx index d4deeda225ca..fea7f1ee6365 100644 --- a/drivers/watchdog/Kconfig.nrfx +++ b/drivers/watchdog/Kconfig.nrfx @@ -7,15 +7,7 @@ config WDT_NRFX bool "nRF WDT nrfx driver" default y depends on DT_HAS_NORDIC_NRF_WDT_ENABLED - select NRFX_WDT0 if HAS_HW_NRF_WDT0 - select NRFX_WDT1 if HAS_HW_NRF_WDT1 - select NRFX_WDT30 if HAS_HW_NRF_WDT30 - select NRFX_WDT31 if HAS_HW_NRF_WDT31 - select NRFX_WDT010 if HAS_HW_NRF_WDT010 - select NRFX_WDT011 if HAS_HW_NRF_WDT011 - select NRFX_WDT130 if HAS_HW_NRF_WDT130 - select NRFX_WDT131 if HAS_HW_NRF_WDT131 - select NRFX_WDT132 if HAS_HW_NRF_WDT132 + select NRFX_WDT help Enable support for nrfx WDT driver for nRF MCU series. diff --git a/drivers/watchdog/wdt_nrfx.c b/drivers/watchdog/wdt_nrfx.c index 4459b7fac6d0..fa1d45907c69 100644 --- a/drivers/watchdog/wdt_nrfx.c +++ b/drivers/watchdog/wdt_nrfx.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define DT_DRV_COMPAT nordic_nrf_wdt + #include #include #include @@ -19,6 +21,7 @@ LOG_MODULE_REGISTER(wdt_nrfx); #endif struct wdt_nrfx_data { + nrfx_wdt_t wdt; wdt_callback_t m_callbacks[NRF_WDT_CHANNEL_NUMBER]; uint32_t m_timeout; uint8_t m_allocated_channels; @@ -28,15 +31,10 @@ struct wdt_nrfx_data { #endif }; -struct wdt_nrfx_config { - nrfx_wdt_t wdt; -}; - static int wdt_nrf_setup(const struct device *dev, uint8_t options) { - const struct wdt_nrfx_config *config = dev->config; struct wdt_nrfx_data *data = dev->data; - nrfx_err_t err_code; + int err_code; nrfx_wdt_config_t wdt_config = { .reload_value = data->m_timeout @@ -54,13 +52,13 @@ static int wdt_nrf_setup(const struct device *dev, uint8_t options) wdt_config.behaviour |= NRF_WDT_BEHAVIOUR_RUN_HALT_MASK; } - err_code = nrfx_wdt_reconfigure(&config->wdt, &wdt_config); + err_code = nrfx_wdt_reconfigure(&data->wdt, &wdt_config); - if (err_code != NRFX_SUCCESS) { - return -EBUSY; + if (err_code < 0) { + return err_code; } - nrfx_wdt_enable(&config->wdt); + nrfx_wdt_enable(&data->wdt); data->enabled = true; return 0; @@ -69,23 +67,22 @@ static int wdt_nrf_setup(const struct device *dev, uint8_t options) static int wdt_nrf_disable(const struct device *dev) { #if NRFX_WDT_HAS_STOP - const struct wdt_nrfx_config *config = dev->config; struct wdt_nrfx_data *data = dev->data; - nrfx_err_t err_code; + int err_code; int channel_id; - err_code = nrfx_wdt_stop(&config->wdt); + err_code = nrfx_wdt_stop(&data->wdt); - if (err_code != NRFX_SUCCESS) { + if (err_code < 0) { /* This can only happen if wdt_nrf_setup() is not called first. */ - return -EFAULT; + return err_code; } #if defined(WDT_NRFX_SYNC_STOP) k_sem_take(&data->sync_stop, K_FOREVER); #endif - nrfx_wdt_channels_free(&config->wdt); + nrfx_wdt_channels_free(&data->wdt); for (channel_id = 0; channel_id < data->m_allocated_channels; channel_id++) { data->m_callbacks[channel_id] = NULL; @@ -103,9 +100,8 @@ static int wdt_nrf_disable(const struct device *dev) static int wdt_nrf_install_timeout(const struct device *dev, const struct wdt_timeout_cfg *cfg) { - const struct wdt_nrfx_config *config = dev->config; struct wdt_nrfx_data *data = dev->data; - nrfx_err_t err_code; + int err_code; nrfx_wdt_channel_id channel_id; if (data->enabled) { @@ -125,10 +121,10 @@ static int wdt_nrf_install_timeout(const struct device *dev, * in all nRF chips can use reload values (determining * 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. + * in milliseconds, defined using NRF_WDT_RR_VALUE_MS symbol. + * Check if the provided value is within this range. */ - if ((cfg->window.max == 0U) || (cfg->window.max > 0x07CFFFFF)) { + if ((cfg->window.max == 0U) || (cfg->window.max > NRF_WDT_RR_VALUE_MS)) { return -EINVAL; } @@ -138,11 +134,11 @@ static int wdt_nrf_install_timeout(const struct device *dev, return -EINVAL; } - err_code = nrfx_wdt_channel_alloc(&config->wdt, + err_code = nrfx_wdt_channel_alloc(&data->wdt, &channel_id); - if (err_code == NRFX_ERROR_NO_MEM) { - return -ENOMEM; + if (err_code == -ENOMEM) { + return err_code; } if (cfg->callback != NULL) { @@ -155,7 +151,6 @@ static int wdt_nrf_install_timeout(const struct device *dev, static int wdt_nrf_feed(const struct device *dev, int channel_id) { - const struct wdt_nrfx_config *config = dev->config; struct wdt_nrfx_data *data = dev->data; if ((channel_id >= data->m_allocated_channels) || (channel_id < 0)) { @@ -166,7 +161,7 @@ static int wdt_nrf_feed(const struct device *dev, int channel_id) return -EAGAIN; } - nrfx_wdt_channel_feed(&config->wdt, + nrfx_wdt_channel_feed(&data->wdt, (nrfx_wdt_channel_id)channel_id); return 0; @@ -205,84 +200,46 @@ static void wdt_event_handler(const struct device *dev, nrf_wdt_event_t event_ty #define WDT(idx) DT_NODELABEL(wdt##idx) -#define WDT_NRFX_WDT_IRQ(idx) \ +#define WDT_NRFX_WDT_IRQ(inst) \ COND_CODE_1(CONFIG_WDT_NRFX_NO_IRQ, \ (), \ - (IRQ_CONNECT(DT_IRQN(WDT(idx)), DT_IRQ(WDT(idx), priority), \ - nrfx_isr, nrfx_wdt_##idx##_irq_handler, 0))) + (IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ + nrfx_wdt_irq_handler, &wdt_##inst##_data.wdt, 0))) -#define WDT_NRFX_WDT_DEVICE(idx) \ - static void wdt_##idx##_event_handler(nrf_wdt_event_t event_type, \ - uint32_t requests, \ - void *p_context) \ +#define WDT_NRFX_WDT_DEVICE(inst) \ + static void wdt_##inst##_event_handler(nrf_wdt_event_t event_type, \ + uint32_t requests, \ + void *p_context) \ { \ - wdt_event_handler(DEVICE_DT_GET(WDT(idx)), event_type, \ + wdt_event_handler(DEVICE_DT_INST_GET(inst), event_type, \ requests, p_context); \ } \ - static int wdt_##idx##_init(const struct device *dev) \ + static struct wdt_nrfx_data wdt_##inst##_data = { \ + .wdt = NRFX_WDT_INSTANCE(DT_INST_REG_ADDR(inst)), \ + IF_ENABLED(WDT_NRFX_SYNC_STOP, \ + (.sync_stop = Z_SEM_INITIALIZER( \ + wdt_##inst##_data.sync_stop, 0, 1),)) \ + }; \ + static int wdt_##inst##_init(const struct device *dev) \ { \ - const struct wdt_nrfx_config *config = dev->config; \ - nrfx_err_t err_code; \ - WDT_NRFX_WDT_IRQ(idx); \ - err_code = nrfx_wdt_init(&config->wdt, \ + int err_code; \ + struct wdt_nrfx_data *data = dev->data; \ + WDT_NRFX_WDT_IRQ(inst); \ + err_code = nrfx_wdt_init(&data->wdt, \ NULL, \ IS_ENABLED(CONFIG_WDT_NRFX_NO_IRQ) \ ? NULL \ - : wdt_##idx##_event_handler, \ + : wdt_##inst##_event_handler, \ NULL); \ - if (err_code != NRFX_SUCCESS) { \ - return -EBUSY; \ - } \ - return 0; \ + return err_code; \ } \ - static struct wdt_nrfx_data wdt_##idx##_data = { \ - IF_ENABLED(WDT_NRFX_SYNC_STOP, \ - (.sync_stop = Z_SEM_INITIALIZER( \ - wdt_##idx##_data.sync_stop, 0, 1),)) \ - }; \ - 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 -WDT_NRFX_WDT_DEVICE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_WDT1 -WDT_NRFX_WDT_DEVICE(1); -#endif - -#ifdef CONFIG_HAS_HW_NRF_WDT30 -WDT_NRFX_WDT_DEVICE(30); -#endif - -#ifdef CONFIG_HAS_HW_NRF_WDT31 -WDT_NRFX_WDT_DEVICE(31); -#endif - -#ifdef CONFIG_HAS_HW_NRF_WDT010 -WDT_NRFX_WDT_DEVICE(010); -#endif - -#ifdef CONFIG_HAS_HW_NRF_WDT011 -WDT_NRFX_WDT_DEVICE(011); -#endif - -#ifdef CONFIG_HAS_HW_NRF_WDT130 -WDT_NRFX_WDT_DEVICE(130); -#endif - -#ifdef CONFIG_HAS_HW_NRF_WDT131 -WDT_NRFX_WDT_DEVICE(131); -#endif - -#ifdef CONFIG_HAS_HW_NRF_WDT132 -WDT_NRFX_WDT_DEVICE(132); -#endif + DEVICE_DT_INST_DEFINE(inst, \ + wdt_##inst##_init, \ + NULL, \ + &wdt_##inst##_data, \ + NULL, \ + PRE_KERNEL_1, \ + CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + &wdt_nrfx_driver_api) + +DT_INST_FOREACH_STATUS_OKAY(WDT_NRFX_WDT_DEVICE) diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index b686ddcabb02..8a38d5ac8660 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 7f4c1a7a5f5b..4566823b7916 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -1,8 +1,12 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (c) 2018 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 8431bb9c2ce6..36c3ec6552b9 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index 776397ff14a5..9898bf6748c4 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -1,8 +1,12 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (c) 2017 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 647f56c5aa42..9cf295dd8266 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 9d7027744bef..f7e66497df5c 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -1,8 +1,12 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (c) 2017 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index b4c077ea2bf4..15d4f487f821 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include / { cpus { diff --git a/dts/arm/nordic/nrf5340_cpuappns.dtsi b/dts/arm/nordic/nrf5340_cpuappns.dtsi index 763e9ca7839b..25b2d870c111 100644 --- a/dts/arm/nordic/nrf5340_cpuappns.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns.dtsi @@ -8,7 +8,7 @@ #include #include -#include +#include / { cpus { diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 31cbe7d9ea41..6dfb42ec3365 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include / { cpus { diff --git a/dts/arm/nordic/nrf91ns.dtsi b/dts/arm/nordic/nrf91ns.dtsi index e44bbcde0a43..9ab22c6f7ca3 100644 --- a/dts/arm/nordic/nrf91ns.dtsi +++ b/dts/arm/nordic/nrf91ns.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include / { cpus { diff --git a/dts/bindings/spi/nordic,nrf-spim.yaml b/dts/bindings/spi/nordic,nrf-spim.yaml index 5e95de3e1e0d..673fcf288b2e 100644 --- a/dts/bindings/spi/nordic,nrf-spim.yaml +++ b/dts/bindings/spi/nordic,nrf-spim.yaml @@ -8,13 +8,6 @@ compatible: "nordic,nrf-spim" include: ["nordic,nrf-spi-common.yaml", "memory-region.yaml"] properties: - anomaly-58-workaround: - type: boolean - description: | - Enables the workaround for the nRF52832 SoC SPIM PAN 58 anomaly. - Must be used in conjunction with - CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y - rx-delay-supported: type: boolean description: | diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 5c445b9d5c75..5998f6da0a0e 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 5a4854440b64..6daf11f4addc 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include /delete-node/ &sw_pwm; @@ -106,6 +106,7 @@ #size-cells = <1>; ranges = <0x0 0x40000000 0x10000000>; #else + global_peripherals: peripheral@50000000 { reg = <0x50000000 0x10000000>; #address-cells = <1>; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index b4ddafac801b..d396e17e0cd6 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include /delete-node/ &sw_pwm; @@ -99,6 +99,7 @@ #ifdef USE_NON_SECURE_ADDRESS_MAP /* intentionally empty because UICR is hardware fixed to Secure */ #else + uicr: uicr@ffd000 { compatible = "nordic,nrf-uicr"; reg = <0xffd000 0x1000>; @@ -128,6 +129,7 @@ #size-cells = <1>; ranges = <0x0 0x40000000 0x10000000>; #else + global_peripherals: peripheral@50000000 { reg = <0x50000000 0x10000000>; ranges = <0x0 0x50000000 0x10000000>; @@ -768,6 +770,7 @@ #ifdef USE_NON_SECURE_ADDRESS_MAP /* intentionally empty because WDT30 is hardware fixed to Secure */ #else + wdt30: watchdog@108000 { compatible = "nordic,nrf-wdt"; reg = <0x108000 0x620>; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 7d887b9a2092..435e0db9d20d 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/zephyr/drivers/gpio/gpio_nrf.h b/include/zephyr/drivers/gpio/gpio_nrf.h new file mode 100644 index 000000000000..edb5e244fd62 --- /dev/null +++ b/include/zephyr/drivers/gpio/gpio_nrf.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_NRF_H +#define ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_NRF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** @brief Get pointer to GPIOTE driver instance + * associated with specified port device node. + * + * @param port Pointer to port device node. + * + * @return Pointer to GPIOTE driver instance. NULL if not found. + */ +void *gpio_nrf_gpiote_by_port_get(const struct device *port); + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_NRF_H */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h b/include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h deleted file mode 100644 index e05522975224..000000000000 --- a/include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_HALTIUM_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_HALTIUM_H_ - -#include - -#define NRF_SAADC_AIN8 9 -#define NRF_SAADC_AIN9 10 -#define NRF_SAADC_AIN10 11 -#define NRF_SAADC_AIN11 12 -#define NRF_SAADC_AIN12 13 -#define NRF_SAADC_AIN13 14 - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_HALTIUM_H_ */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h b/include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h deleted file mode 100644 index 19da4ff6020f..000000000000 --- a/include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_ - -#include - -#define NRF_SAADC_AVDD 10 -#define NRF_SAADC_DVDD 11 - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_ */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc-v2.h b/include/zephyr/dt-bindings/adc/nrf-saadc-v2.h deleted file mode 100644 index f5f72bec829e..000000000000 --- a/include/zephyr/dt-bindings/adc/nrf-saadc-v2.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_ - -#include - -#define NRF_SAADC_VDD 9 - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_ */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc-v3.h b/include/zephyr/dt-bindings/adc/nrf-saadc-v3.h deleted file mode 100644 index c51bab1a91ec..000000000000 --- a/include/zephyr/dt-bindings/adc/nrf-saadc-v3.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_ - -#include - -#define NRF_SAADC_VDDHDIV5 13 - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_ */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc.h b/include/zephyr/dt-bindings/adc/nrf-saadc.h index e5a86150cd43..21f9cf9fb2f1 100644 --- a/include/zephyr/dt-bindings/adc/nrf-saadc.h +++ b/include/zephyr/dt-bindings/adc/nrf-saadc.h @@ -7,6 +7,21 @@ #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ #define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ +#define NRF_SAADC_AIN0 0 +#define NRF_SAADC_AIN1 1 +#define NRF_SAADC_AIN2 2 +#define NRF_SAADC_AIN3 3 +#define NRF_SAADC_AIN4 4 +#define NRF_SAADC_AIN5 5 +#define NRF_SAADC_AIN6 6 +#define NRF_SAADC_AIN7 7 +#define NRF_SAADC_AIN8 8 +#define NRF_SAADC_AIN9 9 +#define NRF_SAADC_AIN10 10 +#define NRF_SAADC_AIN11 11 +#define NRF_SAADC_AIN12 12 +#define NRF_SAADC_AIN13 13 + /** * @brief Short ADC negative input to ground * @@ -30,14 +45,22 @@ * zephyr,input-positive = ; * @endcode */ -#define NRF_SAADC_GND 0 -#define NRF_SAADC_AIN0 1 -#define NRF_SAADC_AIN1 2 -#define NRF_SAADC_AIN2 3 -#define NRF_SAADC_AIN3 4 -#define NRF_SAADC_AIN4 5 -#define NRF_SAADC_AIN5 6 -#define NRF_SAADC_AIN6 7 -#define NRF_SAADC_AIN7 8 +#define NRF_SAADC_GND (NRF_SAADC_AIN_VDD_SHIM_OFFSET - 1) + +#define NRF_SAADC_AIN_VDD_SHIM_OFFSET 128 +#define NRF_SAADC_VDD (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 0) +#define NRF_SAADC_VDDDIV2 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 1) +#define NRF_SAADC_AVDD (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 2) +#define NRF_SAADC_DVDD (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 3) +#define NRF_SAADC_VDDHDIV5 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 4) +#define NRF_SAADC_VDDL (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 5) +#define NRF_SAADC_DECB (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 6) +#define NRF_SAADC_VSS (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 7) +#define NRF_SAADC_VDDAO3V0 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 8) +#define NRF_SAADC_VDDAO1V8 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 9) +#define NRF_SAADC_VDDAO0V8 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 10) +#define NRF_SAADC_VDDRF (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 11) +#define NRF_SAADC_VBAT (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 12) +#define NRF_SAADC_AIN_DISABLED 255 /* UINT8_MAX */ #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ */ diff --git a/include/zephyr/dt-bindings/comparator/nrf-comp.h b/include/zephyr/dt-bindings/comparator/nrf-comp.h index 1a5407554a15..13314bc963cb 100644 --- a/include/zephyr/dt-bindings/comparator/nrf-comp.h +++ b/include/zephyr/dt-bindings/comparator/nrf-comp.h @@ -15,7 +15,9 @@ #define NRF_COMP_AIN5 5 /** AIN5 external input */ #define NRF_COMP_AIN6 6 /** AIN6 external input */ #define NRF_COMP_AIN7 7 /** AIN7 external input */ -#define NRF_COMP_AIN_VDD_DIV2 8 /** VDD / 2 */ -#define NRF_COMP_AIN_VDDH_DIV5 9 /** VDDH / 5 */ + +#define NRF_COMP_AIN_VDD_SHIM_OFFSET 128 +#define NRF_COMP_AIN_VDD_DIV2 (NRF_COMP_AIN_VDD_SHIM_OFFSET + 1) +#define NRF_COMP_AIN_VDDH_DIV5 (NRF_COMP_AIN_VDD_SHIM_OFFSET + 4) #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ */ 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 1dcf724b0e52..8593ff7269b4 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 @@ -9,7 +9,7 @@ #include -#include +#include #include #include #include diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 40ef9d08fd86..8f6411a93b41 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -11,16 +11,30 @@ if(NOT DEFINED NRFX_DIR) set(NRFX_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/nrfx CACHE PATH "nrfx Directory") endif() +if(NOT DEFINED CONFIG_SOC_NORDIC_BSP_NAME) + message(FATAL_ERROR "CONFIG_SOC_NORDIC_BSP_NAME has to be defined.") +endif() + set(INC_DIR ${NRFX_DIR}/drivers/include) set(SRC_DIR ${NRFX_DIR}/drivers/src) -set(MDK_DIR ${NRFX_DIR}/mdk) set(HELPERS_DIR ${NRFX_DIR}/helpers) +if(DEFINED CONFIG_SOC_NORDIC_BSP_PATH_OVERRIDE) + set(BSP_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/${CONFIG_SOC_NORDIC_BSP_PATH_OVERRIDE}/${CONFIG_SOC_NORDIC_BSP_NAME}) +else() + set(BSP_DIR ${NRFX_DIR}/bsp/${CONFIG_SOC_NORDIC_BSP_NAME}) +endif() + +set(MDK_DIR ${BSP_DIR}/mdk) + zephyr_include_directories(${NRFX_DIR}) zephyr_include_directories(${INC_DIR}) -zephyr_include_directories(${MDK_DIR}) +zephyr_include_directories(${BSP_DIR}) +zephyr_include_directories(${BSP_DIR}/templates) zephyr_include_directories(.) +include(${BSP_DIR}/zephyr/nrfx.cmake OPTIONAL) + # Define MDK defines globally zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF51X NRF51) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF51822_QFAA NRF51422_XXAA) @@ -112,16 +126,27 @@ 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) zephyr_library_sources_ifdef(CONFIG_HAS_NORDIC_RAM_CTRL ${HELPERS_DIR}/nrfx_ram_ctrl.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI ${HELPERS_DIR}/nrfx_gppi_dppi.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI ${HELPERS_DIR}/nrfx_gppi_ppi.c) + +if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) + zephyr_library_sources_ifdef(CONFIG_HAS_HW_NRF_PPI ${HELPERS_DIR}/nrfx_gppi_ppi.c) + if(CONFIG_SOC_SERIES_NRF54LX OR CONFIG_HAS_HW_NRF_DPPIC) + zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi.c) + endif() + zephyr_library_sources_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LX ${BSP_DIR}/soc/interconnect/nrfx_gppi_lumos.c) +endif() zephyr_library_sources_ifdef(CONFIG_NRFX_PRS ${SRC_DIR}/prs/nrfx_prs.c) zephyr_library_sources_ifdef(CONFIG_NRFX_ADC ${SRC_DIR}/nrfx_adc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclk.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclkaudio.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclk192m.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_lfclk.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_xo.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_xo24m.c) zephyr_library_sources_ifdef(CONFIG_NRFX_COMP ${SRC_DIR}/nrfx_comp.c) zephyr_library_sources_ifdef(CONFIG_NRFX_CRACEN ${SRC_DIR}/nrfx_cracen.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_DPPI ${SRC_DIR}/nrfx_dppi.c) zephyr_library_sources_ifdef(CONFIG_NRFX_EGU ${SRC_DIR}/nrfx_egu.c) zephyr_library_sources_ifdef(CONFIG_NRFX_GPIOTE ${SRC_DIR}/nrfx_gpiote.c) zephyr_library_sources_ifdef(CONFIG_NRFX_GRTC ${SRC_DIR}/nrfx_grtc.c) @@ -133,8 +158,6 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_NFCT ${SRC_DIR}/nrfx_nfct.c) zephyr_library_sources_ifdef(CONFIG_NRFX_NVMC ${SRC_DIR}/nrfx_nvmc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PDM ${SRC_DIR}/nrfx_pdm.c) zephyr_library_sources_ifdef(CONFIG_NRFX_POWER ${SRC_DIR}/nrfx_power.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_PPI ${SRC_DIR}/nrfx_ppi.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_PPIB ${SRC_DIR}/nrfx_ppib.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PWM ${SRC_DIR}/nrfx_pwm.c) zephyr_library_sources_ifdef(CONFIG_NRFX_QDEC ${SRC_DIR}/nrfx_qdec.c) zephyr_library_sources_ifdef(CONFIG_NRFX_QSPI ${SRC_DIR}/nrfx_qspi.c) @@ -195,15 +218,9 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_DISABLE_FICR_TRIMCNF NRF_DIS zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE NRF_SKIP_GLITCHDETECTOR_DISABLE) zephyr_compile_definitions_ifndef(CONFIG_SOC_NRF54L_ANOMALY_56_WORKAROUND NRF54L_CONFIGURATION_56_ENABLE=0) -if(CONFIG_SOC_COMPATIBLE_NRF54LX AND CONFIG_NRFX_GPPI) - zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib_lumos.c) - zephyr_library_sources(${NRFX_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c) -endif() - -if(CONFIG_SOC_SERIES_NRF54HX AND CONFIG_NRFX_GPPI) - zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib.c) - zephyr_library_sources(${NRFX_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c) - zephyr_library_sources(${NRFX_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c) +if(CONFIG_SOC_SERIES_NRF54HX AND CONFIG_NRFX_GPPI_V1) + zephyr_library_sources(${HELPERS_DIR}/internal/nrfx_gppiv1_ipct.c) + zephyr_library_sources(${HELPERS_DIR}/internal/nrfx_gppiv1_shim.c) endif() # Get the SVD file for the current SoC diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 6065abbf86d6..ed61babb40b2 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -55,94 +55,11 @@ config NRFX_COMP config NRFX_CRACEN bool "CRACEN drivers" depends on SOC_COMPATIBLE_NRF54LX + select NRFX_CRACEN_BSIM_SUPPORT if SOC_SERIES_BSIM_NRFXX -config NRFX_DPPI +config NRFX_CRACEN_BSIM_SUPPORT bool -config NRFX_DPPI0 - bool "DPPI0 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic0) - select NRFX_DPPI - -config NRFX_DPPI00 - bool "DPPI00 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic00) - select NRFX_DPPI - -config NRFX_DPPI10 - bool "DPPI10 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic10) - select NRFX_DPPI - -config NRFX_DPPI20 - bool "DPPI20 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic20) - select NRFX_DPPI - -config NRFX_DPPI30 - bool "DPPI30 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic30) - select NRFX_DPPI - -config NRFX_DPPI020 - bool "DPPI020 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic020) - select NRFX_DPPI - -config NRFX_DPPI120 - bool "DPPI120 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic120) - select NRFX_DPPI - -config NRFX_DPPI130 - bool "DPPI130 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic130) - select NRFX_DPPI - -config NRFX_DPPI131 - bool "DPPI131 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic131) - select NRFX_DPPI - -config NRFX_DPPI132 - bool "DPPI132 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic132) - select NRFX_DPPI - -config NRFX_DPPI133 - bool "DPPI133 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic133) - select NRFX_DPPI - -config NRFX_DPPI134 - bool "DPPI134 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic134) - select NRFX_DPPI - -config NRFX_DPPI135 - bool "DPPI135 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic135) - select NRFX_DPPI - -config NRFX_DPPI136 - bool "DPPI136 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,dppic136) - select NRFX_DPPI - config NRFX_EGU bool @@ -247,22 +164,19 @@ config NRFX_GPPI Enable the nrfx_gppi utilities providing unified API for creating PPI connections across SoC families. +config NRFX_GPPI_V1 + bool "GPPI layer legacy" + depends on NRFX_GPPI + default y if SOC_SERIES_NRF54HX + help + When enabled then legacy version of Generic PPI layer is used. + config NRFX_GRTC bool "GRTC driver" depends on $(dt_nodelabel_exists,grtc) config NRFX_I2S - bool - -config NRFX_I2S0 - bool "I2S0 driver instance" - depends on $(dt_nodelabel_exists,i2s0) - select NRFX_I2S - -config NRFX_I2S20 - bool "I2S20 driver instance" - depends on $(dt_nodelabel_exists,i2s20) - select NRFX_I2S + bool "I2S driver" config NRFX_IPC bool "IPC driver" @@ -279,31 +193,14 @@ config NRFX_MRAMC config NRFX_NFCT bool "NFCT driver" depends on $(dt_nodelabel_exists,nfct) - select NRFX_TIMER4 if SOC_SERIES_NRF52X - select NRFX_TIMER2 if SOC_SERIES_NRF53X - select NRFX_TIMER24 if SOC_SERIES_NRF54LX + select NRFX_TIMER config NRFX_NVMC bool "NVMC driver" depends on $(dt_nodelabel_exists,flash_controller) config NRFX_PDM - bool - -config NRFX_PDM0 - bool "PDM0 driver instance" - depends on $(dt_nodelabel_exists,pdm0) - select NRFX_PDM - -config NRFX_PDM20 - bool "PDM20 driver instance" - depends on $(dt_nodelabel_exists,pdm20) - select NRFX_PDM - -config NRFX_PDM21 - bool "PDM21 driver instance" - depends on $(dt_nodelabel_exists,pdm21) - select NRFX_PDM + bool "PDM driver" config NRFX_POWER bool "POWER driver" @@ -312,157 +209,11 @@ config NRFX_POWER # internally the USBREG driver. select NRFX_USBREG if $(dt_nodelabel_exists,usbreg) -config NRFX_PPI - bool "PPI allocator" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppi) - -config NRFX_PPIB - bool - -config NRFX_PPIB00 - bool "PPIB00 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppib00) - select NRFX_PPIB - -config NRFX_PPIB01 - bool "PPIB01 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppib01) - select NRFX_PPIB - -config NRFX_PPIB10 - bool "PPIB10 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppib10) - select NRFX_PPIB - -config NRFX_PPIB11 - bool "PPIB11 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppib11) - select NRFX_PPIB - -config NRFX_PPIB20 - bool "PPIB20 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppib20) - select NRFX_PPIB - -config NRFX_PPIB21 - bool "PPIB21 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppib21) - select NRFX_PPIB - -config NRFX_PPIB22 - bool "PPIB22 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppib22) - select NRFX_PPIB - -config NRFX_PPIB30 - bool "PPIB30 driver instance" - default y if NRFX_GPPI - depends on $(dt_nodelabel_exists,ppib30) - select NRFX_PPIB - config NRFX_PWM - bool - -config NRFX_PWM0 - bool "PWM0 driver instance" - depends on $(dt_nodelabel_exists,pwm0) - select NRFX_PWM - -config NRFX_PWM1 - bool "PWM1 driver instance" - depends on $(dt_nodelabel_exists,pwm1) - select NRFX_PWM - -config NRFX_PWM2 - bool "PWM2 driver instance" - depends on $(dt_nodelabel_exists,pwm2) - select NRFX_PWM - -config NRFX_PWM3 - bool "PWM3 driver instance" - depends on $(dt_nodelabel_exists,pwm3) - select NRFX_PWM - -config NRFX_PWM20 - bool "PWM20 driver instance" - depends on $(dt_nodelabel_exists,pwm20) - select NRFX_PWM - -config NRFX_PWM21 - bool "PWM21 driver instance" - depends on $(dt_nodelabel_exists,pwm21) - select NRFX_PWM - -config NRFX_PWM22 - bool "PWM22 driver instance" - depends on $(dt_nodelabel_exists,pwm22) - select NRFX_PWM - -config NRFX_PWM120 - bool "PWM120 driver instance" - depends on $(dt_nodelabel_exists,pwm120) - select NRFX_PWM - -config NRFX_PWM130 - bool "PWM130 driver instance" - depends on $(dt_nodelabel_exists,pwm130) - select NRFX_PWM - -config NRFX_PWM131 - bool "PWM131 driver instance" - depends on $(dt_nodelabel_exists,pwm131) - select NRFX_PWM - -config NRFX_PWM132 - bool "PWM132 driver instance" - depends on $(dt_nodelabel_exists,pwm132) - select NRFX_PWM - -config NRFX_PWM133 - bool "PWM133 driver instance" - depends on $(dt_nodelabel_exists,pwm133) - select NRFX_PWM + bool "PWM driver" config NRFX_QDEC - bool - -config NRFX_QDEC0 - bool "QDEC0 driver instance" - depends on $(dt_nodelabel_exists,qdec0) - select NRFX_QDEC - -config NRFX_QDEC1 - bool "QDEC1 driver instance" - depends on $(dt_nodelabel_exists,qdec1) - select NRFX_QDEC - -config NRFX_QDEC20 - bool "QDEC20 driver instance" - depends on $(dt_nodelabel_exists,qdec20) - select NRFX_QDEC - -config NRFX_QDEC21 - bool "QDEC21 driver instance" - depends on $(dt_nodelabel_exists,qdec21) - select NRFX_QDEC - -config NRFX_QDEC130 - bool "QDEC130 driver instance" - depends on $(dt_nodelabel_exists,qdec130) - select NRFX_QDEC - -config NRFX_QDEC131 - bool "QDEC131 driver instance" - depends on $(dt_nodelabel_exists,qdec131) - select NRFX_QDEC + bool "QDEC driver" config NRFX_QSPI bool "QSPI driver" @@ -526,231 +277,17 @@ config NRFX_SPI2 depends on $(dt_nodelabel_exists,spi2) && SOC_SERIES_NRF52X select NRFX_SPI +DT_COMPAT_NORDIC_NRF_SPIM := nordic,nrf-spim + config NRFX_SPIM - bool + bool "SPIM driver" + depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_SPIM)) -config NRFX_SPIM0 - bool "SPIM0 driver instance" - depends on $(dt_nodelabel_exists,spi0) && !SOC_SERIES_NRF51X - select NRFX_SPIM - -config NRFX_SPIM1 - bool "SPIM1 driver instance" - depends on $(dt_nodelabel_exists,spi1) && !SOC_SERIES_NRF51X - select NRFX_SPIM - -config NRFX_SPIM2 - bool "SPIM2 driver instance" - depends on $(dt_nodelabel_exists,spi2) - select NRFX_SPIM - -config NRFX_SPIM3 - bool "SPIM3 driver instance" - depends on $(dt_nodelabel_exists,spi3) - select NRFX_SPIM - -config NRFX_SPIM4 - bool "SPIM4 driver instance" - depends on $(dt_nodelabel_exists,spi4) - select NRFX_SPIM - -config NRFX_SPIM00 - bool "SPIM00 driver instance" - depends on $(dt_nodelabel_exists,spi00) - select NRFX_SPIM - -config NRFX_SPIM01 - bool "SPIM01 driver instance" - depends on $(dt_nodelabel_exists,spi01) - select NRFX_SPIM - -config NRFX_SPIM20 - bool "SPIM20 driver instance" - depends on $(dt_nodelabel_exists,spi20) - select NRFX_SPIM - -config NRFX_SPIM21 - bool "SPIM21 driver instance" - depends on $(dt_nodelabel_exists,spi21) - select NRFX_SPIM - -config NRFX_SPIM22 - bool "SPIM22 driver instance" - depends on $(dt_nodelabel_exists,spi22) - select NRFX_SPIM - -config NRFX_SPIM23 - bool "SPIM23 driver instance" - depends on $(dt_nodelabel_exists,spi23) - select NRFX_SPIM - -config NRFX_SPIM24 - bool "SPIM24 driver instance" - depends on $(dt_nodelabel_exists,spi24) - select NRFX_SPIM - -config NRFX_SPIM30 - bool "SPIM30 driver instance" - depends on $(dt_nodelabel_exists,spi30) - select NRFX_SPIM - -config NRFX_SPIM120 - bool "SPIM120 driver instance" - depends on $(dt_nodelabel_exists,spi120) - select NRFX_SPIM - -config NRFX_SPIM121 - bool "SPIM121 driver instance" - depends on $(dt_nodelabel_exists,spi121) - select NRFX_SPIM - -config NRFX_SPIM130 - bool "SPIM130 driver instance" - depends on $(dt_nodelabel_exists,spi130) - select NRFX_SPIM - -config NRFX_SPIM131 - bool "SPIM131 driver instance" - depends on $(dt_nodelabel_exists,spi131) - select NRFX_SPIM - -config NRFX_SPIM132 - bool "SPIM132 driver instance" - depends on $(dt_nodelabel_exists,spi132) - select NRFX_SPIM - -config NRFX_SPIM133 - bool "SPIM133 driver instance" - depends on $(dt_nodelabel_exists,spi133) - select NRFX_SPIM - -config NRFX_SPIM134 - bool "SPIM134 driver instance" - depends on $(dt_nodelabel_exists,spi134) - select NRFX_SPIM - -config NRFX_SPIM135 - bool "SPIM135 driver instance" - depends on $(dt_nodelabel_exists,spi135) - select NRFX_SPIM - -config NRFX_SPIM136 - bool "SPIM136 driver instance" - depends on $(dt_nodelabel_exists,spi136) - select NRFX_SPIM - -config NRFX_SPIM137 - bool "SPIM137 driver instance" - depends on $(dt_nodelabel_exists,spi137) - select NRFX_SPIM +DT_COMPAT_NORDIC_NRF_SPIS := nordic,nrf-spis config NRFX_SPIS - bool - -config NRFX_SPIS0 - bool "SPIS0 driver instance" - depends on $(dt_nodelabel_exists,spi0) && !SOC_SERIES_NRF51X - select NRFX_SPIS - -config NRFX_SPIS1 - bool "SPIS1 driver instance" - depends on $(dt_nodelabel_exists,spi1) - select NRFX_SPIS - -config NRFX_SPIS2 - bool "SPIS2 driver instance" - depends on $(dt_nodelabel_exists,spi2) - select NRFX_SPIS - -config NRFX_SPIS3 - bool "SPIS3 driver instance" - depends on $(dt_nodelabel_exists,spi3) - select NRFX_SPIS - -config NRFX_SPIS00 - bool "SPIS00 driver instance" - depends on $(dt_nodelabel_exists,spi00) - select NRFX_SPIS - -config NRFX_SPIS01 - bool "SPIS01 driver instance" - depends on $(dt_nodelabel_exists,spi01) - select NRFX_SPIS - -config NRFX_SPIS20 - bool "SPIS20 driver instance" - depends on $(dt_nodelabel_exists,spi20) - select NRFX_SPIS - -config NRFX_SPIS21 - bool "SPIS21 driver instance" - depends on $(dt_nodelabel_exists,spi21) - select NRFX_SPIS - -config NRFX_SPIS22 - bool "SPIS22 driver instance" - depends on $(dt_nodelabel_exists,spi22) - select NRFX_SPIS - -config NRFX_SPIS23 - bool "SPIS23 driver instance" - depends on $(dt_nodelabel_exists,spi23) - select NRFX_SPIS - -config NRFX_SPIS24 - bool "SPIS24 driver instance" - depends on $(dt_nodelabel_exists,spi24) - select NRFX_SPIS - -config NRFX_SPIS30 - bool "SPIS30 driver instance" - depends on $(dt_nodelabel_exists,spi30) - select NRFX_SPIS - -config NRFX_SPIS120 - bool "SPIS120 driver instance" - depends on $(dt_nodelabel_exists,spis120) - select NRFX_SPIS - -config NRFX_SPIS130 - bool "SPIS130 driver instance" - depends on $(dt_nodelabel_exists,spi130) - select NRFX_SPIS - -config NRFX_SPIS131 - bool "SPIS131 driver instance" - depends on $(dt_nodelabel_exists,spi131) - select NRFX_SPIS - -config NRFX_SPIS132 - bool "SPIS132 driver instance" - depends on $(dt_nodelabel_exists,spi132) - select NRFX_SPIS - -config NRFX_SPIS133 - bool "SPIS133 driver instance" - depends on $(dt_nodelabel_exists,spi133) - select NRFX_SPIS - -config NRFX_SPIS134 - bool "SPIS134 driver instance" - depends on $(dt_nodelabel_exists,spi134) - select NRFX_SPIS - -config NRFX_SPIS135 - bool "SPIS135 driver instance" - depends on $(dt_nodelabel_exists,spi135) - select NRFX_SPIS - -config NRFX_SPIS136 - bool "SPIS136 driver instance" - depends on $(dt_nodelabel_exists,spi136) - select NRFX_SPIS - -config NRFX_SPIS137 - bool "SPIS137 driver instance" - depends on $(dt_nodelabel_exists,spi137) - select NRFX_SPIS + bool "SPIS driver" + depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_SPIS)) config NRFX_SYSTICK bool "SYSTICK driver" @@ -765,132 +302,7 @@ config NRFX_TEMP depends on $(dt_nodelabel_exists,temp) config NRFX_TIMER - bool - -config NRFX_TIMER0 - bool "TIMER0 driver instance" - depends on $(dt_nodelabel_exists,timer0) - select NRFX_TIMER - -config NRFX_TIMER1 - bool "TIMER1 driver instance" - depends on $(dt_nodelabel_exists,timer1) - select NRFX_TIMER - -config NRFX_TIMER2 - bool "TIMER2 driver instance" - depends on $(dt_nodelabel_exists,timer2) - select NRFX_TIMER - -config NRFX_TIMER3 - bool "TIMER3 driver instance" - depends on $(dt_nodelabel_exists,timer3) - select NRFX_TIMER - -config NRFX_TIMER4 - bool "TIMER4 driver instance" - depends on $(dt_nodelabel_exists,timer4) - select NRFX_TIMER - -config NRFX_TIMER00 - bool "TIMER00 driver instance" - depends on $(dt_nodelabel_exists,timer00) - select NRFX_TIMER - -config NRFX_TIMER10 - bool "TIMER10 driver instance" - depends on $(dt_nodelabel_exists,timer10) - select NRFX_TIMER - -config NRFX_TIMER20 - bool "TIMER20 driver instance" - depends on $(dt_nodelabel_exists,timer20) - select NRFX_TIMER - -config NRFX_TIMER21 - bool "TIMER21 driver instance" - depends on $(dt_nodelabel_exists,timer21) - select NRFX_TIMER - -config NRFX_TIMER22 - bool "TIMER22 driver instance" - depends on $(dt_nodelabel_exists,timer22) - select NRFX_TIMER - -config NRFX_TIMER23 - bool "TIMER23 driver instance" - depends on $(dt_nodelabel_exists,timer23) - select NRFX_TIMER - -config NRFX_TIMER24 - bool "TIMER24 driver instance" - depends on $(dt_nodelabel_exists,timer24) - select NRFX_TIMER - -config NRFX_TIMER020 - bool "TIMER020 driver instance" - depends on $(dt_nodelabel_exists,timer020) - select NRFX_TIMER - -config NRFX_TIMER021 - bool "TIMER021 driver instance" - depends on $(dt_nodelabel_exists,timer021) - select NRFX_TIMER - -config NRFX_TIMER022 - bool "TIMER022 driver instance" - depends on $(dt_nodelabel_exists,timer022) - select NRFX_TIMER - -config NRFX_TIMER120 - bool "TIMER120 driver instance" - depends on $(dt_nodelabel_exists,timer120) - select NRFX_TIMER - -config NRFX_TIMER121 - bool "TIMER121 driver instance" - depends on $(dt_nodelabel_exists,timer121) - select NRFX_TIMER - -config NRFX_TIMER130 - bool "TIMER130 driver instance" - depends on $(dt_nodelabel_exists,timer130) - select NRFX_TIMER - -config NRFX_TIMER131 - bool "TIMER131 driver instance" - depends on $(dt_nodelabel_exists,timer131) - select NRFX_TIMER - -config NRFX_TIMER132 - bool "TIMER132 driver instance" - depends on $(dt_nodelabel_exists,timer132) - select NRFX_TIMER - -config NRFX_TIMER133 - bool "TIMER133 driver instance" - depends on $(dt_nodelabel_exists,timer133) - select NRFX_TIMER - -config NRFX_TIMER134 - bool "TIMER134 driver instance" - depends on $(dt_nodelabel_exists,timer134) - select NRFX_TIMER - -config NRFX_TIMER135 - bool "TIMER135 driver instance" - depends on $(dt_nodelabel_exists,timer135) - select NRFX_TIMER - -config NRFX_TIMER136 - bool "TIMER136 driver instance" - depends on $(dt_nodelabel_exists,timer136) - select NRFX_TIMER - -config NRFX_TIMER137 - bool "TIMER137 driver instance" - depends on $(dt_nodelabel_exists,timer137) - select NRFX_TIMER + bool "TIMER driver" config NRFX_TWI bool @@ -906,195 +318,10 @@ config NRFX_TWI1 select NRFX_TWI config NRFX_TWIM - bool - -config NRFX_TWIM0 - bool "TWIM0 driver instance" - depends on $(dt_nodelabel_exists,i2c0) && !SOC_SERIES_NRF51X - select NRFX_TWIM - -config NRFX_TWIM1 - bool "TWIM1 driver instance" - depends on $(dt_nodelabel_exists,i2c1) && !SOC_SERIES_NRF51X - select NRFX_TWIM - -config NRFX_TWIM2 - bool "TWIM2 driver instance" - depends on $(dt_nodelabel_exists,i2c2) - select NRFX_TWIM - -config NRFX_TWIM3 - bool "TWIM3 driver instance" - depends on $(dt_nodelabel_exists,i2c3) - select NRFX_TWIM - -config NRFX_TWIM20 - bool "TWIM20 driver instance" - depends on $(dt_nodelabel_exists,i2c20) - select NRFX_TWIM - -config NRFX_TWIM21 - bool "TWIM21 driver instance" - depends on $(dt_nodelabel_exists,i2c21) - select NRFX_TWIM - -config NRFX_TWIM22 - bool "TWIM22 driver instance" - depends on $(dt_nodelabel_exists,i2c22) - select NRFX_TWIM - -config NRFX_TWIM23 - bool "TWIM23 driver instance" - depends on $(dt_nodelabel_exists,i2c23) - select NRFX_TWIM - -config NRFX_TWIM24 - bool "TWIM24 driver instance" - depends on $(dt_nodelabel_exists,i2c24) - select NRFX_TWIM - -config NRFX_TWIM30 - bool "TWIM30 driver instance" - depends on $(dt_nodelabel_exists,i2c30) - select NRFX_TWIM - -config NRFX_TWIM120 - bool "TWIM120 driver instance" - depends on $(dt_nodelabel_exists,i2c120) - select NRFX_TWIM - -config NRFX_TWIM130 - bool "TWIM130 driver instance" - depends on $(dt_nodelabel_exists,i2c130) - select NRFX_TWIM - -config NRFX_TWIM131 - bool "TWIM131 driver instance" - depends on $(dt_nodelabel_exists,i2c131) - select NRFX_TWIM - -config NRFX_TWIM132 - bool "TWIM132 driver instance" - depends on $(dt_nodelabel_exists,i2c132) - select NRFX_TWIM - -config NRFX_TWIM133 - bool "TWIM133 driver instance" - depends on $(dt_nodelabel_exists,i2c133) - select NRFX_TWIM - -config NRFX_TWIM134 - bool "TWIM134 driver instance" - depends on $(dt_nodelabel_exists,i2c134) - select NRFX_TWIM - -config NRFX_TWIM135 - bool "TWIM135 driver instance" - depends on $(dt_nodelabel_exists,i2c135) - select NRFX_TWIM - -config NRFX_TWIM136 - bool "TWIM136 driver instance" - depends on $(dt_nodelabel_exists,i2c136) - select NRFX_TWIM - -config NRFX_TWIM137 - bool "TWIM137 driver instance" - depends on $(dt_nodelabel_exists,i2c137) - select NRFX_TWIM + bool "NRFX driver for TWIM peripheral" config NRFX_TWIS - bool - -config NRFX_TWIS0 - bool "TWIS0 driver instance" - depends on $(dt_nodelabel_exists,i2c0) && !SOC_SERIES_NRF51X - select NRFX_TWIS - -config NRFX_TWIS1 - bool "TWIS1 driver instance" - depends on $(dt_nodelabel_exists,i2c1) && !SOC_SERIES_NRF51X - select NRFX_TWIS - -config NRFX_TWIS2 - bool "TWIS2 driver instance" - depends on $(dt_nodelabel_exists,i2c2) - select NRFX_TWIS - -config NRFX_TWIS3 - bool "TWIS3 driver instance" - depends on $(dt_nodelabel_exists,i2c3) - select NRFX_TWIS - -config NRFX_TWIS20 - bool "TWIS20 driver instance" - depends on $(dt_nodelabel_exists,i2c20) - select NRFX_TWIS - -config NRFX_TWIS21 - bool "TWIS21 driver instance" - depends on $(dt_nodelabel_exists,i2c21) - select NRFX_TWIS - -config NRFX_TWIS22 - bool "TWIS22 driver instance" - depends on $(dt_nodelabel_exists,i2c22) - select NRFX_TWIS - -config NRFX_TWIS23 - bool "TWIS23 driver instance" - depends on $(dt_nodelabel_exists,i2c23) - select NRFX_TWIS - -config NRFX_TWIS24 - bool "TWIS24 driver instance" - depends on $(dt_nodelabel_exists,i2c24) - select NRFX_TWIS - -config NRFX_TWIS30 - bool "TWIS30 driver instance" - depends on $(dt_nodelabel_exists,i2c30) - select NRFX_TWIS - -config NRFX_TWIS130 - bool "TWIS130 driver instance" - depends on $(dt_nodelabel_exists,i2c130) - select NRFX_TWIS - -config NRFX_TWIS131 - bool "TWIS131 driver instance" - depends on $(dt_nodelabel_exists,i2c131) - select NRFX_TWIS - -config NRFX_TWIS132 - bool "TWIS132 driver instance" - depends on $(dt_nodelabel_exists,i2c132) - select NRFX_TWIS - -config NRFX_TWIS133 - bool "TWIS133 driver instance" - depends on $(dt_nodelabel_exists,i2c133) - select NRFX_TWIS - -config NRFX_TWIS134 - bool "TWIS134 driver instance" - depends on $(dt_nodelabel_exists,i2c134) - select NRFX_TWIS - -config NRFX_TWIS135 - bool "TWIS135 driver instance" - depends on $(dt_nodelabel_exists,i2c135) - select NRFX_TWIS - -config NRFX_TWIS136 - bool "TWIS136 driver instance" - depends on $(dt_nodelabel_exists,i2c136) - select NRFX_TWIS - -config NRFX_TWIS137 - bool "TWIS137 driver instance" - depends on $(dt_nodelabel_exists,i2c137) - select NRFX_TWIS + bool "NRFX driver for TWIS peripheral" config NRFX_UART bool @@ -1105,107 +332,7 @@ config NRFX_UART0 select NRFX_UART config NRFX_UARTE - bool - -config NRFX_UARTE0 - bool "UARTE0 driver instance" - depends on $(dt_nodelabel_exists,uart0) - select NRFX_UARTE - -config NRFX_UARTE1 - bool "UARTE1 driver instance" - depends on $(dt_nodelabel_exists,uart1) - select NRFX_UARTE - -config NRFX_UARTE2 - bool "UARTE2 driver instance" - depends on $(dt_nodelabel_exists,uart2) - select NRFX_UARTE - -config NRFX_UARTE3 - bool "UARTE3 driver instance" - depends on $(dt_nodelabel_exists,uart3) - select NRFX_UARTE - -config NRFX_UARTE00 - bool "UARTE00 driver instance" - depends on $(dt_nodelabel_exists,uart00) - select NRFX_UARTE - -config NRFX_UARTE20 - bool "UARTE20 driver instance" - depends on $(dt_nodelabel_exists,uart20) - select NRFX_UARTE - -config NRFX_UARTE21 - bool "UARTE21 driver instance" - depends on $(dt_nodelabel_exists,uart21) - select NRFX_UARTE - -config NRFX_UARTE22 - bool "UARTE22 driver instance" - depends on $(dt_nodelabel_exists,uart22) - select NRFX_UARTE - -config NRFX_UARTE23 - bool "UARTE23 driver instance" - depends on $(dt_nodelabel_exists,uart23) - select NRFX_UARTE - -config NRFX_UARTE24 - bool "UARTE24 driver instance" - depends on $(dt_nodelabel_exists,uart24) - select NRFX_UARTE - -config NRFX_UARTE30 - bool "UARTE30 driver instance" - depends on $(dt_nodelabel_exists,uart30) - select NRFX_UARTE - -config NRFX_UARTE120 - bool "UARTE120 driver instance" - depends on $(dt_nodelabel_exists,uart120) - select NRFX_UARTE - -config NRFX_UARTE130 - bool "UARTE130 driver instance" - depends on $(dt_nodelabel_exists,uart130) - select NRFX_UARTE - -config NRFX_UARTE131 - bool "UARTE131 driver instance" - depends on $(dt_nodelabel_exists,uart131) - select NRFX_UARTE - -config NRFX_UARTE132 - bool "UARTE132 driver instance" - depends on $(dt_nodelabel_exists,uart132) - select NRFX_UARTE - -config NRFX_UARTE133 - bool "UARTE133 driver instance" - depends on $(dt_nodelabel_exists,uart133) - select NRFX_UARTE - -config NRFX_UARTE134 - bool "UARTE134 driver instance" - depends on $(dt_nodelabel_exists,uart134) - select NRFX_UARTE - -config NRFX_UARTE135 - bool "UARTE135 driver instance" - depends on $(dt_nodelabel_exists,uart135) - select NRFX_UARTE - -config NRFX_UARTE136 - bool "UARTE136 driver instance" - depends on $(dt_nodelabel_exists,uart136) - select NRFX_UARTE - -config NRFX_UARTE137 - bool "UARTE137 driver instance" - depends on $(dt_nodelabel_exists,uart137) - select NRFX_UARTE + bool "UARTE driver" config NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG bool "UARTE GPIO configuration support" @@ -1234,51 +361,6 @@ config NRFX_USBREG config NRFX_WDT bool -config NRFX_WDT0 - bool "WDT0 driver instance" - depends on $(dt_nodelabel_exists,wdt0) - select NRFX_WDT - -config NRFX_WDT1 - bool "WDT1 driver instance" - depends on $(dt_nodelabel_exists,wdt1) - select NRFX_WDT - -config NRFX_WDT30 - bool "WDT30 driver instance" - depends on $(dt_nodelabel_exists,wdt30) - select NRFX_WDT - -config NRFX_WDT31 - bool "WDT31 driver instance" - depends on $(dt_nodelabel_exists,wdt31) - select NRFX_WDT - -config NRFX_WDT010 - bool "WDT010 driver instance" - depends on $(dt_nodelabel_exists,wdt010) - select NRFX_WDT - -config NRFX_WDT011 - bool "WDT011 driver instance" - depends on $(dt_nodelabel_exists,wdt011) - select NRFX_WDT - -config NRFX_WDT130 - bool "WDT130 driver instance" - depends on $(dt_nodelabel_exists,wdt130) - select NRFX_WDT - -config NRFX_WDT131 - bool "WDT131 driver instance" - depends on $(dt_nodelabel_exists,wdt131) - select NRFX_WDT - -config NRFX_WDT132 - bool "WDT132 driver instance" - depends on $(dt_nodelabel_exists,wdt132) - select NRFX_WDT - menu "Peripheral Resource Sharing module" config NRFX_PRS diff --git a/modules/hal_nordic/nrfx/Kconfig.logging b/modules/hal_nordic/nrfx/Kconfig.logging index 322660f40d1a..871dc4382151 100644 --- a/modules/hal_nordic/nrfx/Kconfig.logging +++ b/modules/hal_nordic/nrfx/Kconfig.logging @@ -16,10 +16,6 @@ config NRFX_COMP_LOG bool "COMP driver logging" depends on NRFX_COMP -config NRFX_DPPI_LOG - bool "DPPI driver logging" - depends on NRFX_DPPI - config NRFX_EGU_LOG bool "EGU driver logging" depends on NRFX_EGU @@ -64,14 +60,6 @@ config NRFX_POWER_LOG bool "POWER driver logging" depends on NRFX_POWER -config NRFX_PPI_LOG - bool "PPI driver logging" - depends on NRFX_PPI - -config NRFX_PPIB_LOG - bool "PPIB driver logging" - depends on NRFX_PPIB - config NRFX_PRS_LOG bool "PRS driver logging" depends on NRFX_PRS diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index fac2341c1c55..f006240844e5 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -8,8 +8,8 @@ #define NRFX_CONFIG_H__ /* Define nrfx API version used in Zephyr. */ -#define NRFX_CONFIG_API_VER_MAJOR 3 -#define NRFX_CONFIG_API_VER_MINOR 12 +#define NRFX_CONFIG_API_VER_MAJOR 4 +#define NRFX_CONFIG_API_VER_MINOR 0 #define NRFX_CONFIG_API_VER_MICRO 0 /* Macros used in zephyr-specific config files. */ @@ -29,83 +29,5 @@ #endif /* Use defaults for undefined symbols. */ -#include -#if defined(NRF51) - #include -#elif defined(NRF52805_XXAA) - #include -#elif defined(NRF52810_XXAA) - #include -#elif defined(NRF52811_XXAA) - #include -#elif defined(NRF52820_XXAA) - #include -#elif defined(NRF52832_XXAA) || defined (NRF52832_XXAB) - #include -#elif defined(NRF52833_XXAA) - #include -#elif defined(NRF52840_XXAA) - #include -#elif defined(NRF5340_XXAA_APPLICATION) - #include -#elif defined(NRF5340_XXAA_NETWORK) - #include -#elif defined(NRF54H20_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54H20_XXAA) && defined(NRF_RADIOCORE) - #include -#elif defined(NRF54H20_XXAA) && defined(NRF_PPR) - #include -#elif defined(NRF54H20_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_RADIOCORE) - #include -#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_PPR) - #include -#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_RADIOCORE) - #include -#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_PPR) - #include -#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54L05_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54L05_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54L10_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54L10_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54L15_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54L15_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54LM20A_ENGA_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54LM20A_ENGA_XXAA) && defined(NRF_FLPR) - #include -#elif defined(NRF54LV10A_ENGA_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF54LV10A_ENGA_XXAA) && defined(NRF_FLPR) - #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 -#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_FLPR) - #include -#else - #include "nrfx_config_ext.h" -#endif - +#include "nrfx_templates_config.h" #endif // NRFX_CONFIG_H__ diff --git a/modules/hal_nordic/nrfx/nrfx_glue.c b/modules/hal_nordic/nrfx/nrfx_glue.c index 4e7fc94e11de..5c0dc4f91d98 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.c +++ b/modules/hal_nordic/nrfx/nrfx_glue.c @@ -6,11 +6,11 @@ #include #include -#include +#include void nrfx_isr(const void *irq_handler) { - ((nrfx_irq_handler_t)irq_handler)(); + ((nrfx_irq_handler_t)irq_handler)(NULL); } void nrfx_busy_wait(uint32_t usec_to_wait) @@ -22,26 +22,22 @@ void nrfx_busy_wait(uint32_t usec_to_wait) } } -char const *nrfx_error_string_get(nrfx_err_t code) +char const *nrfx_error_string_get(int code) { - #define NRFX_ERROR_STRING_CASE(code) case code: return #code - switch (code) { - NRFX_ERROR_STRING_CASE(NRFX_SUCCESS); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_INTERNAL); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_NO_MEM); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_NOT_SUPPORTED); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_PARAM); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_STATE); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_LENGTH); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_TIMEOUT); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_FORBIDDEN); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_NULL); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_ADDR); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_BUSY); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_ALREADY); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_OVERRUN); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_ANACK); - NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_DNACK); - default: return "unknown"; + switch (-code) { + case 0: return STRINGIFY(0); + case ECANCELED: return STRINGIFY(ECANCELED); + case ENOMEM: return STRINGIFY(ENOMEM); + case ENOTSUP: return STRINGIFY(ENOTSUP); + case EINVAL: return STRINGIFY(EINVAL); + case EINPROGRESS: return STRINGIFY(EINPROGRESS); + case E2BIG: return STRINGIFY(E2BIG); + case ETIMEDOUT: return STRINGIFY(ETIMEDOUT); + case EPERM: return STRINGIFY(EPERM); + case EFAULT: return STRINGIFY(EFAULT); + case EACCES: return STRINGIFY(EACCES); + case EBUSY: return STRINGIFY(EBUSY); + case EALREADY: return STRINGIFY(EALREADY); + default: return "unknown"; } } diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 4f0d594a2123..5118dd29944e 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -81,54 +81,8 @@ #ifdef CONFIG_NRFX_CRACEN #define NRFX_CRACEN_ENABLED 1 #endif - -#ifdef CONFIG_NRFX_DPPI -#define NRFX_DPPI_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI_LOG -#define NRFX_DPPI_CONFIG_LOG_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI0 -#define NRFX_DPPI0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI00 -#define NRFX_DPPI00_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI10 -#define NRFX_DPPI10_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI20 -#define NRFX_DPPI20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI30 -#define NRFX_DPPI30_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI020 -#define NRFX_DPPI020_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI120 -#define NRFX_DPPI120_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI130 -#define NRFX_DPPI130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI131 -#define NRFX_DPPI131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI132 -#define NRFX_DPPI132_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI133 -#define NRFX_DPPI133_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI134 -#define NRFX_DPPI134_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI135 -#define NRFX_DPPI135_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_DPPI136 -#define NRFX_DPPI136_ENABLED 1 +#ifdef CONFIG_NRFX_CRACEN_BSIM_SUPPORT +#define NRFX_CRACEN_BSIM_SUPPORT 1 #endif #ifdef CONFIG_NRFX_EGU @@ -224,12 +178,6 @@ #ifdef CONFIG_NRFX_I2S_LOG #define NRFX_I2S_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_I2S0 -#define NRFX_I2S0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_I2S20 -#define NRFX_I2S20_ENABLED 1 -#endif #ifdef CONFIG_NRFX_IPC #define NRFX_IPC_ENABLED 1 @@ -272,15 +220,6 @@ #ifdef CONFIG_NRFX_PDM_LOG #define NRFX_PDM_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_PDM0 -#define NRFX_PDM0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PDM20 -#define NRFX_PDM20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PDM21 -#define NRFX_PDM21_ENABLED 1 -#endif #ifdef CONFIG_NRFX_POWER #define NRFX_POWER_ENABLED 1 @@ -289,44 +228,6 @@ #define NRFX_POWER_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_PPI -#define NRFX_PPI_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPI_LOG -#define NRFX_PPI_CONFIG_LOG_ENABLED 1 -#endif - -#ifdef CONFIG_NRFX_PPIB -#define NRFX_PPIB_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB_LOG -#define NRFX_PPIB_CONFIG_LOG_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB00 -#define NRFX_PPIB00_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB01 -#define NRFX_PPIB01_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB10 -#define NRFX_PPIB10_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB11 -#define NRFX_PPIB11_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB20 -#define NRFX_PPIB20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB21 -#define NRFX_PPIB21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB22 -#define NRFX_PPIB22_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PPIB30 -#define NRFX_PPIB30_ENABLED 1 -#endif - #ifdef CONFIG_NRFX_PRS #define NRFX_PRS_ENABLED 1 #endif @@ -355,42 +256,6 @@ #ifdef CONFIG_NRFX_PWM_LOG #define NRFX_PWM_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_PWM0 -#define NRFX_PWM0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM1 -#define NRFX_PWM1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM2 -#define NRFX_PWM2_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM3 -#define NRFX_PWM3_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM20 -#define NRFX_PWM20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM21 -#define NRFX_PWM21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM22 -#define NRFX_PWM22_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM120 -#define NRFX_PWM120_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM130 -#define NRFX_PWM130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM131 -#define NRFX_PWM131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM132 -#define NRFX_PWM132_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PWM133 -#define NRFX_PWM133_ENABLED 1 -#endif #ifdef CONFIG_NRFX_QDEC #define NRFX_QDEC_ENABLED 1 @@ -398,24 +263,6 @@ #ifdef CONFIG_NRFX_QDEC_LOG #define NRFX_QDEC_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_QDEC0 -#define NRFX_QDEC0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_QDEC1 -#define NRFX_QDEC1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_QDEC20 -#define NRFX_QDEC20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_QDEC21 -#define NRFX_QDEC21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_QDEC130 -#define NRFX_QDEC130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_QDEC131 -#define NRFX_QDEC131_ENABLED 1 -#endif #ifdef CONFIG_NRFX_QSPI #define NRFX_QSPI_ENABLED 1 @@ -486,23 +333,11 @@ #ifdef CONFIG_NRFX_SPIM_LOG #define NRFX_SPIM_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_SPIM0 -#define NRFX_SPIM0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM1 -#define NRFX_SPIM1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM2 -#define NRFX_SPIM2_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM3 -#define NRFX_SPIM3_ENABLED 1 #ifdef CONFIG_NRF52_ANOMALY_198_WORKAROUND -#define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 1 -#endif +#define NRF52_ERRATA_198_ENABLE_WORKAROUND 1 #endif -#ifdef CONFIG_NRFX_SPIM4 -#define NRFX_SPIM4_ENABLED 1 +#ifdef CONFIG_NRF52_ANOMALY_58_WORKAROUND +#define NRF52_ERRATA_58_ENABLE_WORKAROUND 1 #endif #define NRFX_SPIM_DT_HAS_RX_DELAY(node) DT_PROP(node, rx_delay_supported) + @@ -513,130 +348,12 @@ #endif #endif -#ifdef CONFIG_NRFX_SPIM00 -#define NRFX_SPIM00_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM01 -#define NRFX_SPIM01_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM20 -#define NRFX_SPIM20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM21 -#define NRFX_SPIM21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM22 -#define NRFX_SPIM22_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM23 -#define NRFX_SPIM23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM24 -#define NRFX_SPIM24_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM30 -#define NRFX_SPIM30_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM120 -#define NRFX_SPIM120_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM121 -#define NRFX_SPIM121_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM130 -#define NRFX_SPIM130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM131 -#define NRFX_SPIM131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM132 -#define NRFX_SPIM132_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM133 -#define NRFX_SPIM133_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM134 -#define NRFX_SPIM134_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM135 -#define NRFX_SPIM135_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM136 -#define NRFX_SPIM136_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIM137 -#define NRFX_SPIM137_ENABLED 1 -#endif - #ifdef CONFIG_NRFX_SPIS #define NRFX_SPIS_ENABLED 1 #endif #ifdef CONFIG_NRFX_SPIS_LOG #define NRFX_SPIS_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_SPIS0 -#define NRFX_SPIS0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS1 -#define NRFX_SPIS1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS2 -#define NRFX_SPIS2_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS3 -#define NRFX_SPIS3_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS00 -#define NRFX_SPIS00_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS01 -#define NRFX_SPIS01_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS20 -#define NRFX_SPIS20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS21 -#define NRFX_SPIS21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS22 -#define NRFX_SPIS22_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS23 -#define NRFX_SPIS23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS24 -#define NRFX_SPIS24_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS30 -#define NRFX_SPIS30_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS120 -#define NRFX_SPIS120_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS130 -#define NRFX_SPIS130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS131 -#define NRFX_SPIS131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS132 -#define NRFX_SPIS132_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS133 -#define NRFX_SPIS133_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS134 -#define NRFX_SPIS134_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS135 -#define NRFX_SPIS135_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS136 -#define NRFX_SPIS136_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPIS137 -#define NRFX_SPIS137_ENABLED 1 -#endif #ifdef CONFIG_NRFX_SYSTICK #define NRFX_SYSTICK_ENABLED 1 @@ -659,84 +376,6 @@ #ifdef CONFIG_NRFX_TIMER #define NRFX_TIMER_ENABLED 1 #endif -#ifdef CONFIG_NRFX_TIMER_LOG -#define NRFX_TIMER_CONFIG_LOG_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER0 -#define NRFX_TIMER0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER1 -#define NRFX_TIMER1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER2 -#define NRFX_TIMER2_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER3 -#define NRFX_TIMER3_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER4 -#define NRFX_TIMER4_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER00 -#define NRFX_TIMER00_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER10 -#define NRFX_TIMER10_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER20 -#define NRFX_TIMER20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER21 -#define NRFX_TIMER21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER22 -#define NRFX_TIMER22_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER23 -#define NRFX_TIMER23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER24 -#define NRFX_TIMER24_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER020 -#define NRFX_TIMER020_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER021 -#define NRFX_TIMER021_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER022 -#define NRFX_TIMER022_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER120 -#define NRFX_TIMER120_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER121 -#define NRFX_TIMER121_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER130 -#define NRFX_TIMER130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER131 -#define NRFX_TIMER131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER132 -#define NRFX_TIMER132_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER133 -#define NRFX_TIMER133_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER134 -#define NRFX_TIMER134_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER135 -#define NRFX_TIMER135_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER136 -#define NRFX_TIMER136_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TIMER137 -#define NRFX_TIMER137_ENABLED 1 -#endif #ifdef CONFIG_NRFX_TWI #define NRFX_TWI_ENABLED 1 @@ -757,68 +396,11 @@ #ifdef CONFIG_NRFX_TWIM_LOG #define NRFX_TWIM_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_TWIM0 -#define NRFX_TWIM0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM1 -#define NRFX_TWIM1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM2 -#define NRFX_TWIM2_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM3 -#define NRFX_TWIM3_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM20 -#define NRFX_TWIM20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM21 -#define NRFX_TWIM21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM22 -#define NRFX_TWIM22_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM23 -#define NRFX_TWIM23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM24 -#define NRFX_TWIM24_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM30 -#define NRFX_TWIM30_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM120 -#define NRFX_TWIM120_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM130 -#define NRFX_TWIM130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM131 -#define NRFX_TWIM131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM132 -#define NRFX_TWIM132_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM133 -#define NRFX_TWIM133_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM134 -#define NRFX_TWIM134_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM135 -#define NRFX_TWIM135_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM136 -#define NRFX_TWIM136_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIM137 -#define NRFX_TWIM137_ENABLED 1 -#endif #ifdef CONFIG_NRF52_ANOMALY_219_WORKAROUND -#define NRFX_TWIM_NRF52_ANOMALY_219_WORKAROUND_ENABLED 1 +#define NRF52_ERRATA_219_ENABLE_WORKAROUND 1 #endif #ifdef CONFIG_SOC_NRF53_ANOMALY_47_WORKAROUND -#define NRFX_TWIM_NRF53_ANOMALY_47_WORKAROUND_ENABLED 1 +#define NRF53_ERRATA_47_ENABLE_WORKAROUND 1 #endif #ifdef CONFIG_NRFX_TWIS @@ -827,60 +409,6 @@ #ifdef CONFIG_NRFX_TWIS_LOG #define NRFX_TWIS_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_TWIS0 -#define NRFX_TWIS0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS1 -#define NRFX_TWIS1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS2 -#define NRFX_TWIS2_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS3 -#define NRFX_TWIS3_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS20 -#define NRFX_TWIS20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS21 -#define NRFX_TWIS21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS22 -#define NRFX_TWIS22_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS23 -#define NRFX_TWIS23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS24 -#define NRFX_TWIS24_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS30 -#define NRFX_TWIS30_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS130 -#define NRFX_TWIS130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS131 -#define NRFX_TWIS131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS132 -#define NRFX_TWIS132_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS133 -#define NRFX_TWIS133_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS134 -#define NRFX_TWIS134_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS135 -#define NRFX_TWIS135_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS136 -#define NRFX_TWIS136_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWIS137 -#define NRFX_TWIS137_ENABLED 1 -#endif #ifdef CONFIG_NRFX_UART #define NRFX_UART_ENABLED 1 @@ -898,66 +426,6 @@ #ifdef CONFIG_NRFX_UARTE_LOG #define NRFX_UARTE_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_UARTE0 -#define NRFX_UARTE0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE1 -#define NRFX_UARTE1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE2 -#define NRFX_UARTE2_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE3 -#define NRFX_UARTE3_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE00 -#define NRFX_UARTE00_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE20 -#define NRFX_UARTE20_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE21 -#define NRFX_UARTE21_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE22 -#define NRFX_UARTE22_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE23 -#define NRFX_UARTE23_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE24 -#define NRFX_UARTE24_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE30 -#define NRFX_UARTE30_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE120 -#define NRFX_UARTE120_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE130 -#define NRFX_UARTE130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE131 -#define NRFX_UARTE131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE132 -#define NRFX_UARTE132_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE133 -#define NRFX_UARTE133_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE134 -#define NRFX_UARTE134_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE135 -#define NRFX_UARTE135_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE136 -#define NRFX_UARTE136_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_UARTE137 -#define NRFX_UARTE137_ENABLED 1 -#endif #ifdef CONFIG_NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG #define NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG 1 #endif @@ -987,50 +455,13 @@ #ifdef CONFIG_NRFX_WDT_LOG #define NRFX_WDT_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_WDT0 -#define NRFX_WDT0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_WDT1 -#define NRFX_WDT1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_WDT30 -#define NRFX_WDT30_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_WDT31 -#define NRFX_WDT31_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_WDT010 -#define NRFX_WDT010_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_WDT011 -#define NRFX_WDT011_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_WDT130 -#define NRFX_WDT130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_WDT131 -#define NRFX_WDT131_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_WDT132 -#define NRFX_WDT132_ENABLED 1 -#endif #ifdef CONFIG_NRF52_ANOMALY_109_WORKAROUND -#define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 -#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 -#define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 -#define NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 +#define NRF52_ERRATA_109_ENABLE_WORKAROUND 1 #define NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE \ CONFIG_NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE #endif -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || \ - DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_local) -#ifndef NRFX_DPPI_ENABLED -#define NRFX_DPPI_ENABLED 1 -#endif -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || ... */ - /* If local or global DPPIC peripherals are used, provide the following macro * definitions required by the interconnect/ipct layer: * - NRFX_IPCTx_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) diff --git a/modules/hal_nordic/nrfx/nrfx_log.h b/modules/hal_nordic/nrfx/nrfx_log.h index 682388d7dd16..7af77e9396eb 100644 --- a/modules/hal_nordic/nrfx/nrfx_log.h +++ b/modules/hal_nordic/nrfx/nrfx_log.h @@ -126,7 +126,7 @@ LOG_MODULE_REGISTER(NRFX_MODULE_PREFIX, NRFX_MODULE_LOG_LEVEL); * @return String containing the textual representation of the error code. */ #define NRFX_LOG_ERROR_STRING_GET(error_code) nrfx_error_string_get(error_code) -extern char const *nrfx_error_string_get(nrfx_err_t code); +extern char const *nrfx_error_string_get(int code); /** @} */ diff --git a/modules/nrf_wifi/bus/qspi_if.c b/modules/nrf_wifi/bus/qspi_if.c index 8d3dc81e3476..9b42ed6f1eb0 100644 --- a/modules/nrf_wifi/bus/qspi_if.c +++ b/modules/nrf_wifi/bus/qspi_if.c @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -296,17 +295,17 @@ static inline int qspi_get_lines_read(uint8_t lines) return ret; } -nrfx_err_t _nrfx_qspi_read(void *p_rx_buffer, size_t rx_buffer_length, uint32_t src_address) +int _nrfx_qspi_read(void *p_rx_buffer, size_t rx_buffer_length, uint32_t src_address) { return nrfx_qspi_read(p_rx_buffer, rx_buffer_length, src_address); } -nrfx_err_t _nrfx_qspi_write(void const *p_tx_buffer, size_t tx_buffer_length, uint32_t dst_address) +int _nrfx_qspi_write(void const *p_tx_buffer, size_t tx_buffer_length, uint32_t dst_address) { return nrfx_qspi_write(p_tx_buffer, tx_buffer_length, dst_address); } -nrfx_err_t _nrfx_qspi_init(nrfx_qspi_config_t const *p_config, nrfx_qspi_handler_t handler, +int _nrfx_qspi_init(nrfx_qspi_config_t const *p_config, nrfx_qspi_handler_t handler, void *p_context) { NRF_QSPI_Type *p_reg = NRF_QSPI; @@ -319,7 +318,7 @@ nrfx_err_t _nrfx_qspi_init(nrfx_qspi_config_t const *p_config, nrfx_qspi_handler /* LOG_DBG("%04x : IFTIMING", p_reg->IFTIMING & qspi_cfg->RDC4IO); */ /* ACTIVATE task fails for slave bitfile so ignore it */ - return NRFX_SUCCESS; + return 0; } @@ -339,32 +338,6 @@ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QSPI_IF_BUS_NODE); IF_ENABLED(CONFIG_PINCTRL, (PINCTRL_DT_DEFINE(QSPI_IF_BUS_NODE))); -/** - * @brief Converts NRFX return codes to the zephyr ones - */ -static inline int qspi_get_zephyr_ret_code(nrfx_err_t res) -{ - switch (res) { - case NRFX_SUCCESS: - return 0; - case NRFX_ERROR_INVALID_PARAM: - case NRFX_ERROR_INVALID_ADDR: - return -EINVAL; - case NRFX_ERROR_INVALID_STATE: - return -ECANCELED; -#if NRF53_ERRATA_159_ENABLE_WORKAROUND - case NRFX_ERROR_FORBIDDEN: - LOG_ERR("nRF5340 anomaly 159 conditions detected"); - LOG_ERR("Set the CPU clock to 64 MHz before starting QSPI operation"); - return -ECANCELED; -#endif - case NRFX_ERROR_BUSY: - case NRFX_ERROR_TIMEOUT: - default: - return -EBUSY; - } -} - static inline struct qspi_nor_data *get_dev_data(const struct device *dev) { return dev->data; @@ -431,11 +404,11 @@ static inline void qspi_trans_unlock(const struct device *dev) #endif /* CONFIG_MULTITHREADING */ } -static inline void qspi_wait_for_completion(const struct device *dev, nrfx_err_t res) +static inline void qspi_wait_for_completion(const struct device *dev, int res) { struct qspi_nor_data *dev_data = get_dev_data(dev); - if (res == NRFX_SUCCESS) { + if (res == 0) { #ifdef CONFIG_MULTITHREADING k_sem_take(&dev_data->sync, K_FOREVER); #else /* CONFIG_MULTITHREADING */ @@ -469,7 +442,7 @@ static inline void _qspi_complete(struct qspi_nor_data *dev_data) qspi_complete(dev_data); } -static inline void _qspi_wait_for_completion(const struct device *dev, nrfx_err_t res) +static inline void _qspi_wait_for_completion(const struct device *dev, int res) { if (!qspi_cfg->easydma) { return; @@ -499,7 +472,6 @@ static bool qspi_initialized; static int qspi_device_init(const struct device *dev) { struct qspi_nor_data *dev_data = get_dev_data(dev); - nrfx_err_t res; int ret = 0; if (!IS_ENABLED(CONFIG_NRF70_QSPI_LOW_POWER)) { @@ -517,8 +489,7 @@ static int qspi_device_init(const struct device *dev) #endif if (!qspi_initialized) { - res = nrfx_qspi_init(&QSPIconfig, qspi_handler, dev_data); - ret = qspi_get_zephyr_ret_code(res); + ret = nrfx_qspi_init(&QSPIconfig, qspi_handler, dev_data); NRF_QSPI->IFTIMING |= qspi_cfg->RDC4IO; qspi_initialized = (ret == 0); } @@ -543,7 +514,7 @@ static void _qspi_device_uninit(const struct device *dev) #endif if (last) { - while (nrfx_qspi_mem_busy_check() != NRFX_SUCCESS) { + while (nrfx_qspi_mem_busy_check() != 0) { if (IS_ENABLED(CONFIG_MULTITHREADING)) { k_msleep(50); } else { @@ -632,7 +603,7 @@ static int qspi_send_cmd(const struct device *dev, const struct qspi_cmd *cmd, b int res = nrfx_qspi_cinstr_xfer(&cinstr_cfg, tx_buf, rx_buf); qspi_unlock(dev); - return qspi_get_zephyr_ret_code(res); + return res; } /* RDSR wrapper. Negative value is error. */ @@ -740,16 +711,13 @@ static int qspi_nrfx_configure(const struct device *dev) k_busy_wait(BASE_CLOCK_SWITCH_DELAY_US); #endif - nrfx_err_t res = _nrfx_qspi_init(&QSPIconfig, qspi_handler, dev_data); + int ret = _nrfx_qspi_init(&QSPIconfig, qspi_handler, dev_data); #if defined(CONFIG_SOC_SERIES_NRF53X) /* Restore the default /4 divider after the QSPI initialization. */ nrf_clock_hfclk192m_div_set(NRF_CLOCK, NRF_CLOCK_HFCLK_DIV_4); k_busy_wait(BASE_CLOCK_SWITCH_DELAY_US); #endif - - int ret = qspi_get_zephyr_ret_code(res); - if (ret == 0) { /* Set QE to match transfer mode. If not using quad * it's OK to leave QE set, but doing so prevents use @@ -806,7 +774,7 @@ static int qspi_nrfx_configure(const struct device *dev) return ret; } -static inline nrfx_err_t read_non_aligned(const struct device *dev, int addr, void *dest, +static inline int read_non_aligned(const struct device *dev, int addr, void *dest, size_t size) { uint8_t __aligned(WORD_SIZE) buf[WORD_SIZE * 2]; @@ -833,7 +801,7 @@ static inline nrfx_err_t read_non_aligned(const struct device *dev, int addr, vo flash_suffix = size - flash_prefix - flash_middle; } - nrfx_err_t res = NRFX_SUCCESS; + int res = 0; /* read from aligned flash to aligned memory */ if (flash_middle != 0) { @@ -841,7 +809,7 @@ static inline nrfx_err_t read_non_aligned(const struct device *dev, int addr, vo _qspi_wait_for_completion(dev, res); - if (res != NRFX_SUCCESS) { + if (res != 0) { return res; } @@ -857,7 +825,7 @@ static inline nrfx_err_t read_non_aligned(const struct device *dev, int addr, vo _qspi_wait_for_completion(dev, res); - if (res != NRFX_SUCCESS) { + if (res != 0) { return res; } @@ -870,7 +838,7 @@ static inline nrfx_err_t read_non_aligned(const struct device *dev, int addr, vo _qspi_wait_for_completion(dev, res); - if (res != NRFX_SUCCESS) { + if (res != 0) { return res; } @@ -891,31 +859,28 @@ static int qspi_nor_read(const struct device *dev, int addr, void *dest, size_t return 0; } - int rc = qspi_device_init(dev); + int ret = qspi_device_init(dev); - if (rc != 0) { + if (ret != 0) { goto out; } qspi_lock(dev); - nrfx_err_t res = read_non_aligned(dev, addr, dest, size); + ret = read_non_aligned(dev, addr, dest, size); qspi_unlock(dev); - - rc = qspi_get_zephyr_ret_code(res); - out: qspi_device_uninit(dev); - return rc; + return ret; } /* addr aligned, sptr not null, slen less than 4 */ -static inline nrfx_err_t write_sub_word(const struct device *dev, int addr, const void *sptr, +static inline int write_sub_word(const struct device *dev, int addr, const void *sptr, size_t slen) { uint8_t __aligned(4) buf[4]; - nrfx_err_t res; + int res; /* read out the whole word so that unchanged data can be * written back @@ -923,7 +888,7 @@ static inline nrfx_err_t write_sub_word(const struct device *dev, int addr, cons res = _nrfx_qspi_read(buf, sizeof(buf), addr); _qspi_wait_for_completion(dev, res); - if (res == NRFX_SUCCESS) { + if (res == 0) { memcpy(buf, sptr, slen); res = _nrfx_qspi_write(buf, sizeof(buf), addr); _qspi_wait_for_completion(dev, res); @@ -948,11 +913,9 @@ static int qspi_nor_write(const struct device *dev, int addr, const void *src, s return -EINVAL; } - nrfx_err_t res = NRFX_SUCCESS; - - int rc = qspi_device_init(dev); + int res = qspi_device_init(dev); - if (rc != 0) { + if (res != 0) { goto out; } @@ -970,11 +933,9 @@ static int qspi_nor_write(const struct device *dev, int addr, const void *src, s qspi_unlock(dev); qspi_trans_unlock(dev); - - rc = qspi_get_zephyr_ret_code(res); out: qspi_device_uninit(dev); - return rc; + return res; } /** @@ -1460,7 +1421,7 @@ int qspi_enable_encryption(uint8_t *key) memcpy(qspi_cfg->p_cfg.key, key, 16); err = nrfx_qspi_dma_encrypt(&qspi_cfg->p_cfg); - if (err != NRFX_SUCCESS) { + if (err != 0) { LOG_ERR("nrfx_qspi_dma_encrypt failed: %d", err); return -EIO; } diff --git a/modules/trusted-firmware-m/nordic/include/tfm_read_ranges.h b/modules/trusted-firmware-m/nordic/include/tfm_read_ranges.h index 43468c7fa319..0c1ba3459237 100644 --- a/modules/trusted-firmware-m/nordic/include/tfm_read_ranges.h +++ b/modules/trusted-firmware-m/nordic/include/tfm_read_ranges.h @@ -9,7 +9,7 @@ #include -#include +#include #ifdef NRF_FICR_S_BASE diff --git a/samples/boards/nordic/nrfx/src/main.c b/samples/boards/nordic/nrfx/src/main.c index 8b3819f2d8a1..bc0506cd2b5d 100644 --- a/samples/boards/nordic/nrfx/src/main.c +++ b/samples/boards/nordic/nrfx/src/main.c @@ -36,33 +36,33 @@ int main(void) { LOG_INF("nrfx_gpiote sample on %s", CONFIG_BOARD); - nrfx_err_t err; + int rv; uint8_t in_channel, out_channel; - uint8_t ppi_channel; - const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(GPIOTE_INST); + nrfx_gppi_handle_t ppi_handle; + static nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(NRF_GPIOTE_INST_GET(GPIOTE_INST)); /* Connect GPIOTE instance IRQ to irq handler */ - IRQ_CONNECT(DT_IRQN(GPIOTE_NODE), DT_IRQ(GPIOTE_NODE, priority), nrfx_isr, - NRFX_CONCAT(nrfx_gpiote_, GPIOTE_INST, _irq_handler), 0); + IRQ_CONNECT(DT_IRQN(GPIOTE_NODE), DT_IRQ(GPIOTE_NODE, priority), nrfx_gpiote_irq_handler, + &gpiote, 0); /* Initialize GPIOTE (the interrupt priority passed as the parameter * here is ignored, see nrfx_glue.h). */ - err = nrfx_gpiote_init(&gpiote, 0); - if (err != NRFX_SUCCESS) { - LOG_ERR("nrfx_gpiote_init error: 0x%08X", err); + rv = nrfx_gpiote_init(&gpiote, 0); + if (rv != 0) { + LOG_ERR("nrfx_gpiote_init error: %d", rv); return 0; } - err = nrfx_gpiote_channel_alloc(&gpiote, &in_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to allocate in_channel, error: 0x%08X", err); + rv = nrfx_gpiote_channel_alloc(&gpiote, &in_channel); + if (rv != 0) { + LOG_ERR("Failed to allocate in_channel, error: %d", rv); return 0; } - err = nrfx_gpiote_channel_alloc(&gpiote, &out_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("Failed to allocate out_channel, error: 0x%08X", err); + rv = nrfx_gpiote_channel_alloc(&gpiote, &out_channel); + if (rv != 0) { + LOG_ERR("Failed to allocate out_channel, error: %d", rv); return 0; } @@ -83,10 +83,10 @@ int main(void) .p_handler_config = &handler_config }; - err = nrfx_gpiote_input_configure(&gpiote, INPUT_PIN, &input_config); + rv = nrfx_gpiote_input_configure(&gpiote, INPUT_PIN, &input_config); - if (err != NRFX_SUCCESS) { - LOG_ERR("nrfx_gpiote_input_configure error: 0x%08X", err); + if (rv != 0) { + LOG_ERR("nrfx_gpiote_input_configure error: %d", rv); return 0; } @@ -103,11 +103,11 @@ int main(void) .polarity = NRF_GPIOTE_POLARITY_TOGGLE, .init_val = 1, }; - err = nrfx_gpiote_output_configure(&gpiote, OUTPUT_PIN, + rv = nrfx_gpiote_output_configure(&gpiote, OUTPUT_PIN, &output_config, &task_config); - if (err != NRFX_SUCCESS) { - LOG_ERR("nrfx_gpiote_output_configure error: 0x%08X", err); + if (rv != 0) { + LOG_ERR("nrfx_gpiote_output_configure error: %d", rv); return 0; } @@ -116,23 +116,20 @@ int main(void) LOG_INF("nrfx_gpiote initialized"); - /* Allocate a (D)PPI channel. */ - err = nrfx_gppi_channel_alloc(&ppi_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("nrfx_gppi_channel_alloc error: 0x%08X", err); - return 0; - } - /* Configure endpoints of the channel so that the input pin event is * connected with the output pin OUT task. This means that each time * the button is pressed, the LED pin will be toggled. */ - nrfx_gppi_channel_endpoints_setup(ppi_channel, - nrfx_gpiote_in_event_address_get(&gpiote, INPUT_PIN), - nrfx_gpiote_out_task_address_get(&gpiote, OUTPUT_PIN)); + rv = nrfx_gppi_conn_alloc(nrfx_gpiote_in_event_address_get(&gpiote, INPUT_PIN), + nrfx_gpiote_out_task_address_get(&gpiote, OUTPUT_PIN), + &ppi_handle); + if (rv < 0) { + LOG_ERR("nrfx_gppi_conn_alloc error: %d", rv); + return 0; + } /* Enable the channel. */ - nrfx_gppi_channels_enable(BIT(ppi_channel)); + nrfx_gppi_conn_enable(ppi_handle); LOG_INF("(D)PPI configured, leaving main()"); return 0; diff --git a/samples/boards/nordic/nrfx_prs/prj.conf b/samples/boards/nordic/nrfx_prs/prj.conf index 3c8ea985f56c..47dd7198fd9d 100644 --- a/samples/boards/nordic/nrfx_prs/prj.conf +++ b/samples/boards/nordic/nrfx_prs/prj.conf @@ -1,8 +1,8 @@ # This is needed for using SPIM2 and UARTE2 via nrfx drivers and for switching # between those peripherals, as they share the same ID and hence cannot be used # simultaneously. -CONFIG_NRFX_SPIM2=y -CONFIG_NRFX_UARTE2=y +CONFIG_NRFX_SPIM=y +CONFIG_NRFX_UARTE=y CONFIG_NRFX_PRS_BOX_2=y # This is needed for using another SPIM instance via the Zephyr SPI driver. diff --git a/samples/boards/nordic/nrfx_prs/src/main.c b/samples/boards/nordic/nrfx_prs/src/main.c index e9e63e574d29..65476003797e 100644 --- a/samples/boards/nordic/nrfx_prs/src/main.c +++ b/samples/boards/nordic/nrfx_prs/src/main.c @@ -28,12 +28,13 @@ */ #define SPI_DEV_NODE DT_NODELABEL(spi1) -static nrfx_spim_t spim = NRFX_SPIM_INSTANCE(2); -static nrfx_uarte_t uarte = NRFX_UARTE_INSTANCE(2); +static nrfx_spim_t spim = NRFX_SPIM_INSTANCE(NRF_SPIM2); +static nrfx_uarte_t uarte = NRFX_UARTE_INSTANCE(NRF_UARTE2); static bool spim_initialized; static bool uarte_initialized; static volatile size_t received; static K_SEM_DEFINE(transfer_finished, 0, 1); +void nrfx_prs_box_2_irq_handler(void); static enum { PERFORM_TRANSFER, @@ -111,7 +112,7 @@ static bool init_buttons(void) return true; } -static void spim_handler(const nrfx_spim_evt_t *p_event, void *p_context) +static void spim_handler(const nrfx_spim_event_t *p_event, void *p_context) { if (p_event->type == NRFX_SPIM_EVENT_DONE) { k_sem_give(&transfer_finished); @@ -121,7 +122,6 @@ static void spim_handler(const nrfx_spim_evt_t *p_event, void *p_context) static bool switch_to_spim(void) { int ret; - nrfx_err_t err; uint32_t sck_pin; PINCTRL_DT_DEFINE(SPIM_NODE); @@ -162,9 +162,9 @@ static bool switch_to_spim(void) nrfy_gpio_pin_write(sck_pin, (spim_config.mode <= NRF_SPIM_MODE_1) ? 0 : 1); } - err = nrfx_spim_init(&spim, &spim_config, spim_handler, NULL); - if (err != NRFX_SUCCESS) { - printk("nrfx_spim_init() failed: 0x%08x\n", err); + ret = nrfx_spim_init(&spim, &spim_config, spim_handler, NULL); + if (ret != 0) { + printk("nrfx_spim_init() failed: %d", ret); return false; } @@ -176,7 +176,7 @@ static bool switch_to_spim(void) static bool spim_transfer(const uint8_t *tx_data, size_t tx_data_len, uint8_t *rx_buf, size_t rx_buf_size) { - nrfx_err_t err; + int err; nrfx_spim_xfer_desc_t xfer_desc = { .p_tx_buffer = tx_data, .tx_length = tx_data_len, @@ -185,8 +185,8 @@ static bool spim_transfer(const uint8_t *tx_data, size_t tx_data_len, }; err = nrfx_spim_xfer(&spim, &xfer_desc, 0); - if (err != NRFX_SUCCESS) { - printk("nrfx_spim_xfer() failed: 0x%08x\n", err); + if (err != 0) { + printk("nrfx_spim_xfer() failed: %d\n", err); return false; } @@ -213,7 +213,6 @@ static void uarte_handler(const nrfx_uarte_event_t *p_event, void *p_context) static bool switch_to_uarte(void) { int ret; - nrfx_err_t err; PINCTRL_DT_DEFINE(UARTE_NODE); @@ -244,9 +243,9 @@ static bool switch_to_uarte(void) return ret; } - err = nrfx_uarte_init(&uarte, &uarte_config, uarte_handler); - if (err != NRFX_SUCCESS) { - printk("nrfx_uarte_init() failed: 0x%08x\n", err); + ret = nrfx_uarte_init(&uarte, &uarte_config, uarte_handler); + if (ret != 0) { + printk("nrfx_uarte_init() failed: %d\n", ret); return false; } @@ -258,23 +257,23 @@ static bool switch_to_uarte(void) static bool uarte_transfer(const uint8_t *tx_data, size_t tx_data_len, uint8_t *rx_buf, size_t rx_buf_size) { - nrfx_err_t err; + int err; err = nrfx_uarte_rx_buffer_set(&uarte, rx_buf, rx_buf_size); - if (err != NRFX_SUCCESS) { - printk("nrfx_uarte_rx_buffer_set() failed: 0x%08x\n", err); + if (err != 0) { + printk("nrfx_uarte_rx_buffer_set() failed: %d\n", err); return false; } err = nrfx_uarte_rx_enable(&uarte, NRFX_UARTE_RX_ENABLE_STOP_ON_END); - if (err != NRFX_SUCCESS) { - printk("nrfx_uarte_rx_enable() failed: 0x%08x\n", err); + if (err != 0) { + printk("nrfx_uarte_rx_enable() failed: %d\n", err); return false; } err = nrfx_uarte_tx(&uarte, tx_data, tx_data_len, 0); - if (err != NRFX_SUCCESS) { - printk("nrfx_uarte_tx() failed: 0x%08x\n", err); + if (err != 0) { + printk("nrfx_uarte_tx() failed: %d\n", err); return false; } diff --git a/samples/drivers/led/led_strip/boards/nrf52dk_nrf52832.conf b/samples/drivers/led/led_strip/boards/nrf52dk_nrf52832.conf deleted file mode 100644 index b20eefa4deab..000000000000 --- a/samples/drivers/led/led_strip/boards/nrf52dk_nrf52832.conf +++ /dev/null @@ -1,3 +0,0 @@ -# This driver only uses spi_write() with the SPIM instance it allocates, -# so PAN 58 doesn't matter, because the RX length is always 0. -CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y diff --git a/samples/net/zperf/src/nrf5340_cpu_boost.c b/samples/net/zperf/src/nrf5340_cpu_boost.c index 0eff58c32e37..f1704ebbf818 100644 --- a/samples/net/zperf/src/nrf5340_cpu_boost.c +++ b/samples/net/zperf/src/nrf5340_cpu_boost.c @@ -22,7 +22,6 @@ static int nrf53_cpu_boost(void) /* For optimal performance, the CPU frequency should be set to 128 MHz */ err = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); - err -= NRFX_ERROR_BASE_NUM; if (err != 0) { LOG_WRN("Failed to set 128 MHz: %d", err); } diff --git a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf index ce67033381a6..4c7c060177e0 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1,2 +1,2 @@ #Enable timer for asynchronous feedback -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y diff --git a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index d7526fc6ec9a..ce07cde36568 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,4 +1,4 @@ # Enable timer for asynchronous feedback CONFIG_NRFX_GPPI=y -CONFIG_NRFX_TIMER131=y +CONFIG_NRFX_TIMER=y CONFIG_NRFX_GPIOTE130=y diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c index 6b7ed239b268..711dd570d4de 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c @@ -8,8 +8,8 @@ #include #include "feedback.h" -#include #include +#include #include #include #include @@ -60,11 +60,10 @@ static inline void feedback_target_init(void) #error "Unsupported target" #endif -static const nrfx_gpiote_t gpiote = - NRFX_GPIOTE_INSTANCE(FEEDBACK_GPIOTE_INSTANCE_NUMBER); +#define FEEDBACK_GPIOTE_NODE DT_NODELABEL(UTIL_CAT(gpiote, FEEDBACK_GPIOTE_INSTANCE_NUMBER)) -static const nrfx_timer_t feedback_timer_instance = - NRFX_TIMER_INSTANCE(FEEDBACK_TIMER_INSTANCE_NUMBER); +static nrfx_timer_t feedback_timer_instance = + NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(FEEDBACK_TIMER_INSTANCE_NUMBER)); /* See 5.12.4.2 Feedback in Universal Serial Bus Specification Revision 2.0 for * more information about the feedback. There is a direct implementation of the @@ -118,11 +117,11 @@ static struct feedback_ctx { }; } fb_ctx; -static nrfx_err_t feedback_edge_counter_setup(void) +static int feedback_edge_counter_setup(void) { - nrfx_err_t err; uint8_t feedback_gpiote_channel; - uint8_t feedback_gppi_channel; + nrfx_gppi_handle_t feedback_gppi_handle; + nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(FEEDBACK_GPIOTE_NODE); nrfx_gpiote_trigger_config_t trigger_config = { .trigger = NRFX_GPIOTE_TRIGGER_TOGGLE, .p_in_channel = &feedback_gpiote_channel, @@ -132,14 +131,17 @@ static nrfx_err_t feedback_edge_counter_setup(void) .p_pull_config = &pull, .p_trigger_config = &trigger_config, }; + int err; + uint32_t eep = nrfx_gpiote_in_event_address_get(gpiote, FEEDBACK_PIN); + uint32_t tep = nrfx_timer_task_address_get(&feedback_timer_instance, NRF_TIMER_TASK_COUNT); - err = nrfx_gpiote_channel_alloc(&gpiote, &feedback_gpiote_channel); - if (err != NRFX_SUCCESS) { + err = nrfx_gpiote_channel_alloc(gpiote, &feedback_gpiote_channel); + if (err != 0) { return err; } - nrfx_gpiote_input_configure(&gpiote, FEEDBACK_PIN, &input_pin_config); - nrfx_gpiote_trigger_enable(&gpiote, FEEDBACK_PIN, false); + nrfx_gpiote_input_configure(gpiote, FEEDBACK_PIN, &input_pin_config); + nrfx_gpiote_trigger_enable(gpiote, FEEDBACK_PIN, false); /* Configure TIMER in COUNTER mode */ const nrfx_timer_config_t cfg = { @@ -151,30 +153,26 @@ static nrfx_err_t feedback_edge_counter_setup(void) }; err = nrfx_timer_init(&feedback_timer_instance, &cfg, NULL); - if (err != NRFX_SUCCESS) { + if (err != 0) { LOG_ERR("nrfx timer init error (sample clk feedback) - Return value: %d", err); return err; } /* Subscribe TIMER COUNT task to GPIOTE IN event */ - err = nrfx_gppi_channel_alloc(&feedback_gppi_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("gppi_channel_alloc failed with: %d\n", err); + err = nrfx_gppi_conn_alloc(eep, tep, &feedback_gppi_handle); + if (err < 0) { + LOG_ERR("gppi_conn_alloc failed with: %d\n", err); return err; } - nrfx_gppi_channel_endpoints_setup(feedback_gppi_channel, - nrfx_gpiote_in_event_address_get(&gpiote, FEEDBACK_PIN), - nrfx_timer_task_address_get(&feedback_timer_instance, NRF_TIMER_TASK_COUNT)); + nrfx_gppi_conn_enable(feedback_gppi_handle); - nrfx_gppi_channels_enable(BIT(feedback_gppi_channel)); - - return NRFX_SUCCESS; + return 0; } -static nrfx_err_t feedback_relative_timer_setup(void) +static int feedback_relative_timer_setup(void) { - nrfx_err_t err; + int err; const nrfx_timer_config_t cfg = { .frequency = NRFX_MHZ_TO_HZ(16UL), .mode = NRF_TIMER_MODE_TIMER, @@ -184,7 +182,7 @@ static nrfx_err_t feedback_relative_timer_setup(void) }; err = nrfx_timer_init(&feedback_timer_instance, &cfg, NULL); - if (err != NRFX_SUCCESS) { + if (err != 0) { LOG_ERR("nrfx timer init error (relative timer) - Return value: %d", err); } @@ -193,9 +191,13 @@ static nrfx_err_t feedback_relative_timer_setup(void) struct feedback_ctx *feedback_init(void) { - nrfx_err_t err; - uint8_t usbd_sof_gppi_channel; - uint8_t i2s_framestart_gppi_channel; + nrfx_gppi_handle_t usbd_sof_gppi_handle; + nrfx_gppi_handle_t i2s_framestart_gppi_handle; + int err; + uint32_t tsk1 = nrfx_timer_capture_task_address_get(&feedback_timer_instance, + FEEDBACK_TIMER_USBD_SOF_CAPTURE); + uint32_t tsk2 = nrfx_timer_capture_task_address_get(&feedback_timer_instance, + FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE); feedback_target_init(); @@ -207,40 +209,31 @@ struct feedback_ctx *feedback_init(void) err = feedback_relative_timer_setup(); } - if (err != NRFX_SUCCESS) { + if (err != 0) { return &fb_ctx; } /* Subscribe TIMER CAPTURE task to USBD SOF event */ - err = nrfx_gppi_channel_alloc(&usbd_sof_gppi_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("gppi_channel_alloc failed with: %d\n", err); + err = nrfx_gppi_conn_alloc(USB_SOF_EVENT_ADDRESS, tsk1, &usbd_sof_gppi_handle); + if (err < 0) { + LOG_ERR("gppi_conn_alloc failed with: %d\n", err); return &fb_ctx; } - nrfx_gppi_channel_endpoints_setup(usbd_sof_gppi_channel, - USB_SOF_EVENT_ADDRESS, - nrfx_timer_capture_task_address_get(&feedback_timer_instance, - FEEDBACK_TIMER_USBD_SOF_CAPTURE)); - nrfx_gppi_fork_endpoint_setup(usbd_sof_gppi_channel, - nrfx_timer_task_address_get(&feedback_timer_instance, - NRF_TIMER_TASK_CLEAR)); + nrfx_gppi_ep_attach(nrfx_timer_task_address_get(&feedback_timer_instance, + NRF_TIMER_TASK_CLEAR), + usbd_sof_gppi_handle); - nrfx_gppi_channels_enable(BIT(usbd_sof_gppi_channel)); + nrfx_gppi_conn_enable(usbd_sof_gppi_handle); /* Subscribe TIMER CAPTURE task to I2S FRAMESTART event */ - err = nrfx_gppi_channel_alloc(&i2s_framestart_gppi_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("gppi_channel_alloc failed with: %d\n", err); + err = nrfx_gppi_conn_alloc(I2S_FRAMESTART_EVENT_ADDRESS, tsk2, &i2s_framestart_gppi_handle); + if (err < 0) { + LOG_ERR("gppi_conn_alloc failed with: %d\n", err); return &fb_ctx; } - nrfx_gppi_channel_endpoints_setup(i2s_framestart_gppi_channel, - I2S_FRAMESTART_EVENT_ADDRESS, - nrfx_timer_capture_task_address_get(&feedback_timer_instance, - FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE)); - - nrfx_gppi_channels_enable(BIT(i2s_framestart_gppi_channel)); + nrfx_gppi_conn_enable(i2s_framestart_gppi_handle); /* Enable feedback timer */ nrfx_timer_enable(&feedback_timer_instance); diff --git a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf index ce67033381a6..4c7c060177e0 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1,2 +1,2 @@ #Enable timer for asynchronous feedback -CONFIG_NRFX_TIMER2=y +CONFIG_NRFX_TIMER=y diff --git a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index c4e23e5d54fe..3f9d5d61d283 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,3 +1,3 @@ # Enable timer for asynchronous feedback CONFIG_NRFX_GPPI=y -CONFIG_NRFX_TIMER131=y +CONFIG_NRFX_TIMER=y diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c index 9623f22e5662..c1c72dc07c41 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c @@ -7,8 +7,6 @@ #include #include #include "feedback.h" - -#include #include #include @@ -51,8 +49,8 @@ static inline void feedback_target_init(void) #error "Unsupported target" #endif -static const nrfx_timer_t feedback_timer_instance = - NRFX_TIMER_INSTANCE(FEEDBACK_TIMER_INSTANCE_NUMBER); +static nrfx_timer_t feedback_timer_instance = + NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(FEEDBACK_TIMER_INSTANCE_NUMBER)); /* While it might be possible to determine I2S FRAMESTART to USB SOF offset * entirely in software, the I2S API lacks appropriate timestamping. Therefore @@ -78,9 +76,9 @@ static struct feedback_ctx { struct feedback_ctx *feedback_init(void) { - nrfx_err_t err; - uint8_t usbd_sof_gppi_channel; - uint8_t i2s_framestart_gppi_channel; + int err; + nrfx_gppi_handle_t usbd_sof_gppi_handle; + nrfx_gppi_handle_t i2s_framestart_gppi_handle; const nrfx_timer_config_t cfg = { .frequency = NRFX_MHZ_TO_HZ(16UL), .mode = NRF_TIMER_MODE_TIMER, @@ -88,47 +86,40 @@ struct feedback_ctx *feedback_init(void) .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, .p_context = NULL, }; + uint32_t tsk1 = nrfx_timer_capture_task_address_get(&feedback_timer_instance, + FEEDBACK_TIMER_USBD_SOF_CAPTURE); + uint32_t tsk2 = nrfx_timer_task_address_get(&feedback_timer_instance, NRF_TIMER_TASK_CLEAR); + uint32_t tsk3 = nrfx_timer_capture_task_address_get(&feedback_timer_instance, + FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE); feedback_target_init(); feedback_reset_ctx(&fb_ctx); err = nrfx_timer_init(&feedback_timer_instance, &cfg, NULL); - if (err != NRFX_SUCCESS) { + if (err != 0) { LOG_ERR("nrfx timer init error - Return value: %d", err); return &fb_ctx; } /* Subscribe TIMER CAPTURE task to USBD SOF event */ - err = nrfx_gppi_channel_alloc(&usbd_sof_gppi_channel); - if (err != NRFX_SUCCESS) { + err = nrfx_gppi_conn_alloc(USB_SOF_EVENT_ADDRESS, tsk1, &usbd_sof_gppi_handle); + if (err < 0) { LOG_ERR("gppi_channel_alloc failed with: %d\n", err); return &fb_ctx; } - nrfx_gppi_channel_endpoints_setup(usbd_sof_gppi_channel, - USB_SOF_EVENT_ADDRESS, - nrfx_timer_capture_task_address_get(&feedback_timer_instance, - FEEDBACK_TIMER_USBD_SOF_CAPTURE)); - nrfx_gppi_fork_endpoint_setup(usbd_sof_gppi_channel, - nrfx_timer_task_address_get(&feedback_timer_instance, - NRF_TIMER_TASK_CLEAR)); - - nrfx_gppi_channels_enable(BIT(usbd_sof_gppi_channel)); + nrfx_gppi_ep_attach(tsk2, usbd_sof_gppi_handle); + nrfx_gppi_conn_enable(usbd_sof_gppi_handle); /* Subscribe TIMER CAPTURE task to I2S FRAMESTART event */ - err = nrfx_gppi_channel_alloc(&i2s_framestart_gppi_channel); - if (err != NRFX_SUCCESS) { - LOG_ERR("gppi_channel_alloc failed with: %d\n", err); + err = nrfx_gppi_conn_alloc(I2S_FRAMESTART_EVENT_ADDRESS, tsk3, &i2s_framestart_gppi_handle); + if (err < 0) { + LOG_ERR("gppi_conn_alloc failed with: %d\n", err); return &fb_ctx; } - nrfx_gppi_channel_endpoints_setup(i2s_framestart_gppi_channel, - I2S_FRAMESTART_EVENT_ADDRESS, - nrfx_timer_capture_task_address_get(&feedback_timer_instance, - FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE)); - - nrfx_gppi_channels_enable(BIT(i2s_framestart_gppi_channel)); + nrfx_gppi_conn_enable(i2s_framestart_gppi_handle); /* Enable feedback timer */ nrfx_timer_enable(&feedback_timer_instance); diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 912dbdad48e3..e3208e976942 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1403,6 +1403,7 @@ def check_no_undef_outside_kconfig(self, kconf): "SHIFT", "SINGLE_APPLICATION_SLOT", # Used in sysbuild for MCUboot configuration "SINGLE_APPLICATION_SLOT_RAM_LOAD", # Used in sysbuild for MCUboot configuration + "SOC_NORDIC_BSP_PATH_OVERRIDE", # Used in modules/hal_nordic/nrfx/CMakeLists.txt "SOC_SDKNG_UNSUPPORTED", # Used in modules/hal_nxp/mcux/CMakeLists.txt "SOC_SERIES_", # Used as regex in scripts/utils/board_v1_to_v2.py "SOC_WATCH", # Issue 13749 diff --git a/soc/nordic/CMakeLists.txt b/soc/nordic/CMakeLists.txt index 0c9e9184d6dc..f32466d38ee5 100644 --- a/soc/nordic/CMakeLists.txt +++ b/soc/nordic/CMakeLists.txt @@ -45,6 +45,9 @@ if(CONFIG_BUILD_WITH_TFM) ) endif() -add_subdirectory(${SOC_SERIES}) +if(CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable") + add_subdirectory(${SOC_SERIES}) +endif() + add_subdirectory(common) add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE ironside) diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 46efc8c2c744..df4bba2e1ce1 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -48,6 +48,14 @@ config SOC_FAMILY_NORDIC_NRF select SOC_RESET_HOOK select CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK if ARM +if SOC_COMPATIBLE_NRF + +config SOC_NORDIC_BSP_NAME + string + default "stable" + +endif # SOC_COMPATIBLE_NRF + if SOC_FAMILY_NORDIC_NRF rsource "common/Kconfig.peripherals" diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index 04f0c1a3219c..1b1c3760c9ae 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -31,6 +31,10 @@ if(CONFIG_HAS_NORDIC_DMM) zephyr_library_sources(dmm.c) endif() +if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) + zephyr_library_sources(gppi_init.c) +endif() + if(CONFIG_TFM_PARTITION_PLATFORM) zephyr_library_sources(soc_secure.c) zephyr_library_include_directories( @@ -40,3 +44,4 @@ endif() zephyr_library_sources_ifdef(CONFIG_NRF_SYS_EVENT nrf_sys_event.c) zephyr_library_sources_ifdef(CONFIG_MRAM_LATENCY mram_latency.c) +zephyr_library_sources(gpiote_nrfx.c) diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index fa7fd2a411aa..f15702fa291b 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -98,12 +98,6 @@ config HAS_HW_NRF_GPIOTE131 config HAS_HW_NRF_GRTC def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GRTC)) -config HAS_HW_NRF_I2S0 - def_bool $(dt_nodelabel_enabled_with_compat,i2s0,$(DT_COMPAT_NORDIC_NRF_I2S)) - -config HAS_HW_NRF_I2S20 - def_bool $(dt_nodelabel_enabled_with_compat,i2s20,$(DT_COMPAT_NORDIC_NRF_I2S)) - config HAS_HW_NRF_KMU def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_KMU)) @@ -129,75 +123,12 @@ config HAS_HW_NRF_NVMC_PE config HAS_HW_NRF_OSCILLATORS def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_OSCILLATORS)) -config HAS_HW_NRF_PDM0 - def_bool $(dt_nodelabel_enabled_with_compat,pdm0,$(DT_COMPAT_NORDIC_NRF_PDM)) - -config HAS_HW_NRF_PDM20 - def_bool $(dt_nodelabel_enabled_with_compat,pdm20,$(DT_COMPAT_NORDIC_NRF_PDM)) - -config HAS_HW_NRF_PDM21 - def_bool $(dt_nodelabel_enabled_with_compat,pdm21,$(DT_COMPAT_NORDIC_NRF_PDM)) - config HAS_HW_NRF_POWER def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_POWER)) config HAS_HW_NRF_PPI def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_PPI)) -config HAS_HW_NRF_PWM0 - def_bool $(dt_nodelabel_enabled_with_compat,pwm0,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM1 - def_bool $(dt_nodelabel_enabled_with_compat,pwm1,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM2 - def_bool $(dt_nodelabel_enabled_with_compat,pwm2,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM3 - def_bool $(dt_nodelabel_enabled_with_compat,pwm3,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM20 - def_bool $(dt_nodelabel_enabled_with_compat,pwm20,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM21 - def_bool $(dt_nodelabel_enabled_with_compat,pwm21,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM22 - def_bool $(dt_nodelabel_enabled_with_compat,pwm22,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM120 - def_bool $(dt_nodelabel_enabled_with_compat,pwm120,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM130 - def_bool $(dt_nodelabel_enabled_with_compat,pwm130,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM131 - def_bool $(dt_nodelabel_enabled_with_compat,pwm131,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM132 - def_bool $(dt_nodelabel_enabled_with_compat,pwm132,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_PWM133 - def_bool $(dt_nodelabel_enabled_with_compat,pwm133,$(DT_COMPAT_NORDIC_NRF_PWM)) - -config HAS_HW_NRF_QDEC0 - def_bool $(dt_nodelabel_enabled_with_compat,qdec0,$(DT_COMPAT_NORDIC_NRF_QDEC)) - -config HAS_HW_NRF_QDEC1 - def_bool $(dt_nodelabel_enabled_with_compat,qdec1,$(DT_COMPAT_NORDIC_NRF_QDEC)) - -config HAS_HW_NRF_QDEC20 - def_bool $(dt_nodelabel_enabled_with_compat,qdec20,$(DT_COMPAT_NORDIC_NRF_QDEC)) - -config HAS_HW_NRF_QDEC21 - def_bool $(dt_nodelabel_enabled_with_compat,qdec21,$(DT_COMPAT_NORDIC_NRF_QDEC)) - -config HAS_HW_NRF_QDEC130 - def_bool $(dt_nodelabel_enabled_with_compat,qdec130,$(DT_COMPAT_NORDIC_NRF_QDEC)) - -config HAS_HW_NRF_QDEC131 - def_bool $(dt_nodelabel_enabled_with_compat,qdec131,$(DT_COMPAT_NORDIC_NRF_QDEC)) - config HAS_HW_NRF_QSPI def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_QSPI)) @@ -255,138 +186,6 @@ config HAS_HW_NRF_SPI1 config HAS_HW_NRF_SPI2 def_bool $(dt_nodelabel_enabled_with_compat,spi2,$(DT_COMPAT_NORDIC_NRF_SPI)) -config HAS_HW_NRF_SPIM0 - def_bool $(dt_nodelabel_enabled_with_compat,spi0,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM1 - def_bool $(dt_nodelabel_enabled_with_compat,spi1,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM2 - def_bool $(dt_nodelabel_enabled_with_compat,spi2,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM3 - def_bool $(dt_nodelabel_enabled_with_compat,spi3,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM4 - def_bool $(dt_nodelabel_enabled_with_compat,spi4,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM00 - def_bool $(dt_nodelabel_enabled_with_compat,spi00,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM01 - def_bool $(dt_nodelabel_enabled_with_compat,spi01,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM20 - def_bool $(dt_nodelabel_enabled_with_compat,spi20,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM21 - def_bool $(dt_nodelabel_enabled_with_compat,spi21,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM22 - def_bool $(dt_nodelabel_enabled_with_compat,spi22,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM23 - def_bool $(dt_nodelabel_enabled_with_compat,spi23,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM24 - def_bool $(dt_nodelabel_enabled_with_compat,spi24,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM30 - def_bool $(dt_nodelabel_enabled_with_compat,spi30,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM120 - def_bool $(dt_nodelabel_enabled_with_compat,spi120,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM121 - def_bool $(dt_nodelabel_enabled_with_compat,spi121,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM130 - def_bool $(dt_nodelabel_enabled_with_compat,spi130,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM131 - def_bool $(dt_nodelabel_enabled_with_compat,spi131,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM132 - def_bool $(dt_nodelabel_enabled_with_compat,spi132,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM133 - def_bool $(dt_nodelabel_enabled_with_compat,spi133,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM134 - def_bool $(dt_nodelabel_enabled_with_compat,spi134,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM135 - def_bool $(dt_nodelabel_enabled_with_compat,spi135,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM136 - def_bool $(dt_nodelabel_enabled_with_compat,spi136,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIM137 - def_bool $(dt_nodelabel_enabled_with_compat,spi137,$(DT_COMPAT_NORDIC_NRF_SPIM)) - -config HAS_HW_NRF_SPIS0 - def_bool $(dt_nodelabel_enabled_with_compat,spi0,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS1 - def_bool $(dt_nodelabel_enabled_with_compat,spi1,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS2 - def_bool $(dt_nodelabel_enabled_with_compat,spi2,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS3 - def_bool $(dt_nodelabel_enabled_with_compat,spi3,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS00 - def_bool $(dt_nodelabel_enabled_with_compat,spi00,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS01 - def_bool $(dt_nodelabel_enabled_with_compat,spi01,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS20 - def_bool $(dt_nodelabel_enabled_with_compat,spi20,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS21 - def_bool $(dt_nodelabel_enabled_with_compat,spi21,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS22 - def_bool $(dt_nodelabel_enabled_with_compat,spi22,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS23 - def_bool $(dt_nodelabel_enabled_with_compat,spi23,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS24 - def_bool $(dt_nodelabel_enabled_with_compat,spi24,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS30 - def_bool $(dt_nodelabel_enabled_with_compat,spi30,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS120 - def_bool $(dt_nodelabel_enabled_with_compat,spis120,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS130 - def_bool $(dt_nodelabel_enabled_with_compat,spi130,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS131 - def_bool $(dt_nodelabel_enabled_with_compat,spi131,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS132 - def_bool $(dt_nodelabel_enabled_with_compat,spi132,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS133 - def_bool $(dt_nodelabel_enabled_with_compat,spi133,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS134 - def_bool $(dt_nodelabel_enabled_with_compat,spi134,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS135 - def_bool $(dt_nodelabel_enabled_with_compat,spi135,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS136 - def_bool $(dt_nodelabel_enabled_with_compat,spi136,$(DT_COMPAT_NORDIC_NRF_SPIS)) - -config HAS_HW_NRF_SPIS137 - def_bool $(dt_nodelabel_enabled_with_compat,spi137,$(DT_COMPAT_NORDIC_NRF_SPIS)) - config HAS_HW_NRF_SPU def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_SPU)) @@ -501,117 +300,6 @@ config HAS_HW_NRF_TWI0 config HAS_HW_NRF_TWI1 def_bool $(dt_nodelabel_enabled_with_compat,i2c1,$(DT_COMPAT_NORDIC_NRF_TWI)) -config HAS_HW_NRF_TWIM0 - def_bool $(dt_nodelabel_enabled_with_compat,i2c0,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM1 - def_bool $(dt_nodelabel_enabled_with_compat,i2c1,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM2 - def_bool $(dt_nodelabel_enabled_with_compat,i2c2,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM3 - def_bool $(dt_nodelabel_enabled_with_compat,i2c3,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM20 - def_bool $(dt_nodelabel_enabled_with_compat,i2c20,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM21 - def_bool $(dt_nodelabel_enabled_with_compat,i2c21,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM22 - def_bool $(dt_nodelabel_enabled_with_compat,i2c22,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM23 - def_bool $(dt_nodelabel_enabled_with_compat,i2c23,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM24 - def_bool $(dt_nodelabel_enabled_with_compat,i2c24,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM30 - def_bool $(dt_nodelabel_enabled_with_compat,i2c30,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM120 - def_bool $(dt_nodelabel_enabled_with_compat,i2c120,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM130 - def_bool $(dt_nodelabel_enabled_with_compat,i2c130,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM131 - def_bool $(dt_nodelabel_enabled_with_compat,i2c131,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM132 - def_bool $(dt_nodelabel_enabled_with_compat,i2c132,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM133 - def_bool $(dt_nodelabel_enabled_with_compat,i2c133,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM134 - def_bool $(dt_nodelabel_enabled_with_compat,i2c134,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM135 - def_bool $(dt_nodelabel_enabled_with_compat,i2c135,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM136 - def_bool $(dt_nodelabel_enabled_with_compat,i2c136,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIM137 - def_bool $(dt_nodelabel_enabled_with_compat,i2c137,$(DT_COMPAT_NORDIC_NRF_TWIM)) - -config HAS_HW_NRF_TWIS0 - def_bool $(dt_nodelabel_enabled_with_compat,i2c0,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS1 - def_bool $(dt_nodelabel_enabled_with_compat,i2c1,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS2 - def_bool $(dt_nodelabel_enabled_with_compat,i2c2,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS3 - def_bool $(dt_nodelabel_enabled_with_compat,i2c3,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS20 - def_bool $(dt_nodelabel_enabled_with_compat,i2c20,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS21 - def_bool $(dt_nodelabel_enabled_with_compat,i2c21,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS22 - def_bool $(dt_nodelabel_enabled_with_compat,i2c22,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS23 - def_bool $(dt_nodelabel_enabled_with_compat,i2c23,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS24 - def_bool $(dt_nodelabel_enabled_with_compat,i2c24,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS30 - def_bool $(dt_nodelabel_enabled_with_compat,i2c30,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS130 - def_bool $(dt_nodelabel_enabled_with_compat,i2c130,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS131 - def_bool $(dt_nodelabel_enabled_with_compat,i2c131,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS132 - def_bool $(dt_nodelabel_enabled_with_compat,i2c132,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS133 - def_bool $(dt_nodelabel_enabled_with_compat,i2c133,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS134 - def_bool $(dt_nodelabel_enabled_with_compat,i2c134,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS135 - def_bool $(dt_nodelabel_enabled_with_compat,i2c135,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS136 - def_bool $(dt_nodelabel_enabled_with_compat,i2c136,$(DT_COMPAT_NORDIC_NRF_TWIS)) - -config HAS_HW_NRF_TWIS137 - def_bool $(dt_nodelabel_enabled_with_compat,i2c137,$(DT_COMPAT_NORDIC_NRF_TWIS)) - config HAS_HW_NRF_UART0 def_bool $(dt_nodelabel_enabled_with_compat,uart0,$(DT_COMPAT_NORDIC_NRF_UART)) @@ -683,30 +371,3 @@ config HAS_HW_NRF_USBREG config HAS_HW_NRF_VMC def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_VMC)) - -config HAS_HW_NRF_WDT0 - def_bool $(dt_nodelabel_enabled_with_compat,wdt0,$(DT_COMPAT_NORDIC_NRF_WDT)) - -config HAS_HW_NRF_WDT1 - def_bool $(dt_nodelabel_enabled_with_compat,wdt1,$(DT_COMPAT_NORDIC_NRF_WDT)) - -config HAS_HW_NRF_WDT30 - def_bool $(dt_nodelabel_enabled_with_compat,wdt30,$(DT_COMPAT_NORDIC_NRF_WDT)) - -config HAS_HW_NRF_WDT31 - def_bool $(dt_nodelabel_enabled_with_compat,wdt31,$(DT_COMPAT_NORDIC_NRF_WDT)) - -config HAS_HW_NRF_WDT010 - def_bool $(dt_nodelabel_enabled_with_compat,wdt010,$(DT_COMPAT_NORDIC_NRF_WDT)) - -config HAS_HW_NRF_WDT011 - def_bool $(dt_nodelabel_enabled_with_compat,wdt011,$(DT_COMPAT_NORDIC_NRF_WDT)) - -config HAS_HW_NRF_WDT130 - def_bool $(dt_nodelabel_enabled_with_compat,wdt130,$(DT_COMPAT_NORDIC_NRF_WDT)) - -config HAS_HW_NRF_WDT131 - def_bool $(dt_nodelabel_enabled_with_compat,wdt131,$(DT_COMPAT_NORDIC_NRF_WDT)) - -config HAS_HW_NRF_WDT132 - def_bool $(dt_nodelabel_enabled_with_compat,wdt132,$(DT_COMPAT_NORDIC_NRF_WDT)) diff --git a/soc/nordic/common/gpiote_nrfx.c b/soc/nordic/common/gpiote_nrfx.c new file mode 100644 index 000000000000..c7ba20f4fa81 --- /dev/null +++ b/soc/nordic/common/gpiote_nrfx.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Keep peripheral addresses as in real HW so we can compare them with DT values */ +#define NRF_H_NO_BSIM_REDEFS + +#include +#include +#include "gpiote_nrfx.h" + +#define GPIOTE_NRFX_INST_DEF(instname, reg) \ + nrfx_gpiote_t instname = NRFX_GPIOTE_INSTANCE(reg); +#define GPIOTE_NRFX_INST_DEFINE(node_id) \ + GPIOTE_NRFX_INST_DEF(GPIOTE_NRFX_INST_BY_NODE(node_id), DT_REG_ADDR(node_id)) + +DT_FOREACH_STATUS_OKAY(nordic_nrf_gpiote, GPIOTE_NRFX_INST_DEFINE) diff --git a/soc/nordic/common/gpiote_nrfx.h b/soc/nordic/common/gpiote_nrfx.h new file mode 100644 index 000000000000..3c01f37d714e --- /dev/null +++ b/soc/nordic/common/gpiote_nrfx.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef SOC_NORDIC_COMMON_GPIOTE_NRFX_H_ +#define SOC_NORDIC_COMMON_GPIOTE_NRFX_H_ + +#include + +#define GPIOTE_NRFX_INST_BY_REG_CONCAT(reg) g_nrfx_gpiote##reg +#define GPIOTE_NRFX_INST_BY_REG(reg) GPIOTE_NRFX_INST_BY_REG_CONCAT(reg) +#define GPIOTE_NRFX_INST_BY_NODE(node) GPIOTE_NRFX_INST_BY_REG(DT_REG_ADDR(node)) + +#define GPIOTE_NRFX_INST_DECL(instname) \ + extern nrfx_gpiote_t instname; +#define GPIOTE_NRFX_INST_DECLARE(node_id) \ + GPIOTE_NRFX_INST_DECL(GPIOTE_NRFX_INST_BY_NODE(node_id)) + +DT_FOREACH_STATUS_OKAY(nordic_nrf_gpiote, GPIOTE_NRFX_INST_DECLARE) + +#endif /* SOC_NORDIC_COMMON_GPIOTE_NRFX_H_ */ diff --git a/soc/nordic/common/gppi_init.c b/soc/nordic/common/gppi_init.c new file mode 100644 index 000000000000..98915491041b --- /dev/null +++ b/soc/nordic/common/gppi_init.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include +#include +#if defined(NRFX_GPPI_MULTI_DOMAIN) && !defined(NRFX_GPPI_FIXED_CONNECTIONS) +#include +#endif + +static int gppi_init(void) +{ + static nrfx_gppi_t gppi_instance; + +#if defined(PPI_PRESENT) + gppi_instance.ch_mask = BIT_MASK(PPI_CH_NUM) & ~NRFX_PPI_CHANNELS_USED; + gppi_instance.group_mask = BIT_MASK(PPI_GROUP_NUM) & ~NRFX_PPI_GROUPS_USED; +#elif defined(DPPIC_PRESENT) && !defined(NRFX_GPPI_MULTI_DOMAIN) + uint32_t ch_mask = (DPPIC_CH_NUM == 32) ? UINT32_MAX : BIT_MASK(DPPIC_CH_NUM); + + gppi_instance.ch_mask = ch_mask & ~NRFX_DPPI_CHANNELS_USED; + gppi_instance.group_mask = BIT_MASK(DPPIC_GROUP_NUM) & ~NRFX_DPPI_GROUPS_USED; +#elif defined(NRFX_GPPI_MULTI_DOMAIN) && !defined(NRFX_GPPI_FIXED_CONNECTIONS) + gppi_instance.routes = nrfx_gppi_routes_get(); + gppi_instance.route_map = nrfx_gppi_route_map_get(); + gppi_instance.nodes = nrfx_gppi_nodes_get(); + + nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC00, + NRFX_BIT_MASK(DPPIC00_CH_NUM_SIZE) & ~NRFX_DPPI00_CHANNELS_USED); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC10, + NRFX_BIT_MASK(DPPIC10_CH_NUM_SIZE) & ~NRFX_DPPI10_CHANNELS_USED); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC20, + NRFX_BIT_MASK(DPPIC20_CH_NUM_SIZE) & ~NRFX_DPPI20_CHANNELS_USED); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC30, + NRFX_BIT_MASK(DPPIC30_CH_NUM_SIZE) & ~NRFX_DPPI30_CHANNELS_USED); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB00_10, NRFX_BIT_MASK(PPIB10_NTASKSEVENTS_SIZE)); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB11_21, NRFX_BIT_MASK(PPIB11_NTASKSEVENTS_SIZE)); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB01_20, NRFX_BIT_MASK(PPIB01_NTASKSEVENTS_SIZE)); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB22_30, NRFX_BIT_MASK(PPIB22_NTASKSEVENTS_SIZE)); + + nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC00, + NRFX_BIT_MASK(DPPIC00_GROUP_NUM_SIZE) & ~NRFX_DPPI00_GROUPS_USED); + nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC10, + NRFX_BIT_MASK(DPPIC10_GROUP_NUM_SIZE) & ~NRFX_DPPI10_GROUPS_USED); + nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC20, + NRFX_BIT_MASK(DPPIC20_GROUP_NUM_SIZE) & ~NRFX_DPPI20_GROUPS_USED); + nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC30, + NRFX_BIT_MASK(DPPIC30_GROUP_NUM_SIZE) & ~NRFX_DPPI30_GROUPS_USED); +#else +#error "Not supported" +#endif + nrfx_gppi_init(&gppi_instance); + return 0; +} + +#if defined(CONFIG_NRFX_GPPI) && !defined(CONFIG_NRFX_GPPI_V1) +SYS_INIT(gppi_init, PRE_KERNEL_1, 0); +#endif diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 47c02eadb961..76664fe5f245 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -76,20 +76,12 @@ int nrf_sys_event_release_global_constlat(void) int nrf_sys_event_request_global_constlat(void) { - nrfx_err_t err; - - err = nrfx_power_constlat_mode_request(); - - return (err == NRFX_SUCCESS || err == NRFX_ERROR_ALREADY) ? 0 : -EAGAIN; + return nrfx_power_constlat_mode_request(); } int nrf_sys_event_release_global_constlat(void) { - nrfx_err_t err; - - err = nrfx_power_constlat_mode_free(); - - return (err == NRFX_SUCCESS || err == NRFX_ERROR_BUSY) ? 0 : -EAGAIN; + return nrfx_power_constlat_mode_free(); } #endif diff --git a/soc/nordic/common/soc_nrf_common.h b/soc/nordic/common/soc_nrf_common.h index 12ac373fd6eb..c963b6512188 100644 --- a/soc/nordic/common/soc_nrf_common.h +++ b/soc/nordic/common/soc_nrf_common.h @@ -149,6 +149,18 @@ (NRF_DT_GPIOS_TO_PSEL(node_id, prop)), \ (default_value)) +/** + * @brief Convert a devicetree GPIO phandle+specifier to GPIOTE node. + */ +#define NRF_DT_GPIOTE_NODE_BY_IDX(node_id, prop, idx) \ + DT_PHANDLE(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx), gpiote_instance) + +/** + * @brief Equivalent to NRF_DT_GPIOTE_NODE_BY_IDX(node_id, prop, 0) + */ +#define NRF_DT_GPIOTE_NODE(node_id, prop) \ + NRF_DT_GPIOTE_NODE_BY_IDX(node_id, prop, 0) + /** * @brief Convert a devicetree GPIO phandle+specifier to GPIOTE instance number. * @@ -185,9 +197,7 @@ * NRF_DT_GPIOTE_INST_BY_IDX(DT_NODELABEL(foo), rx_gpios, 1) // = 20 */ #define NRF_DT_GPIOTE_INST_BY_IDX(node_id, prop, idx) \ - DT_PROP(DT_PHANDLE(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx), \ - gpiote_instance), \ - instance) + DT_PROP(NRF_DT_GPIOTE_NODE_BY_IDX(node_id, prop, idx), instance) /** * @brief Equivalent to NRF_DT_GPIOTE_INST_BY_IDX(node_id, prop, 0) diff --git a/soc/nordic/common/soc_secure.c b/soc/nordic/common/soc_secure.c index 64d647f220a9..3bb8fa9e24ed 100644 --- a/soc/nordic/common/soc_secure.c +++ b/soc/nordic/common/soc_secure.c @@ -7,8 +7,6 @@ #include #include -#include "nrf.h" - #include "tfm_platform_api.h" #include "tfm_ioctl_api.h" diff --git a/soc/nordic/common/soc_secure.h b/soc/nordic/common/soc_secure.h index e4b34a9bf646..84a673467b67 100644 --- a/soc/nordic/common/soc_secure.h +++ b/soc/nordic/common/soc_secure.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ #include -#include +#include #include #include diff --git a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h b/soc/nordic/ironside/include/nrf_ironside/cpuconf.h index b112396704a5..a0fabd8abbd2 100644 --- a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h +++ b/soc/nordic/ironside/include/nrf_ironside/cpuconf.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include /** diff --git a/soc/nordic/nrf51/soc.c b/soc/nordic/nrf51/soc.c index af14f6f3003a..481d1045b2a6 100644 --- a/soc/nordic/nrf51/soc.c +++ b/soc/nordic/nrf51/soc.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include #define LOG_LEVEL CONFIG_SOC_LOG_LEVEL diff --git a/soc/nordic/nrf52/CMakeLists.txt b/soc/nordic/nrf52/CMakeLists.txt index 6b01a1ffc778..49004f15a265 100644 --- a/soc/nordic/nrf52/CMakeLists.txt +++ b/soc/nordic/nrf52/CMakeLists.txt @@ -3,10 +3,6 @@ zephyr_library_sources(soc.c) zephyr_include_directories(.) -if(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 AND CONFIG_SPI_NRFX_SPIM) - message(WARNING "Both SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 and an NRF SPIM driver are enabled, therefore PAN 58 will apply if RXD.MAXCNT == 1 and TXD.MAXCNT <= 1") -endif() - if(CONFIG_SOC_NRF52832) if(NOT CONFIG_NRF52_ANOMALY_109_WORKAROUND) if (CONFIG_NRFX_SPIS OR CONFIG_NRFX_SPIM OR CONFIG_NRFX_TWIM OR CONFIG_NRFX_PWM) diff --git a/soc/nordic/nrf52/Kconfig b/soc/nordic/nrf52/Kconfig index 65d613a59cd1..ff29b6ac69de 100644 --- a/soc/nordic/nrf52/Kconfig +++ b/soc/nordic/nrf52/Kconfig @@ -92,11 +92,19 @@ config NRF52_ANOMALY_132_DELAY_US Additional drivers initialization increases initialization time and delay may be shortened. Workaround is disabled by setting delay to 0. +config NRF52_ANOMALY_58_WORKAROUND + bool "Anomaly 58 workaround" + default y + depends on SOC_NRF52832 + depends on NRFX_SPIM + help + This anomaly causes SPIM to clock out 2 bytes when 1 byte transfer was requested. + config NRF52_ANOMALY_198_WORKAROUND bool "Anomaly 198 workaround" default y depends on SOC_NRF52840 - depends on NRFX_SPIM3 + depends on $(dt_nodelabel_enabled_with_compat,spi3,$(DT_COMPAT_NORDIC_NRF_SPIM)) help This anomaly applies to IC revisions "Engineering B" up to "3", the most recent one. diff --git a/soc/nordic/nrf52/soc.c b/soc/nordic/nrf52/soc.c index 4bb3b8640e58..e34fcf6b083b 100644 --- a/soc/nordic/nrf52/soc.c +++ b/soc/nordic/nrf52/soc.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/soc/nordic/nrf53/soc.c b/soc/nordic/nrf53/soc.c index eb01872a71df..58730f86d8c4 100644 --- a/soc/nordic/nrf53/soc.c +++ b/soc/nordic/nrf53/soc.c @@ -16,9 +16,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -390,8 +390,8 @@ bool z_arm_on_enter_cpu_idle(void) /* RTC pretick - application core part. */ static int rtc_pretick_cpuapp_init(void) { - uint8_t ch; - nrfx_err_t err; + nrfx_gppi_handle_t handle; + int err; nrf_ipc_event_t ipc_event = nrf_ipc_receive_event_get(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET); nrf_ipc_task_t ipc_task = @@ -399,19 +399,16 @@ static int rtc_pretick_cpuapp_init(void) uint32_t task_ipc = nrf_ipc_task_address_get(NRF_IPC, ipc_task); uint32_t evt_ipc = nrf_ipc_event_address_get(NRF_IPC, ipc_event); - err = nrfx_gppi_channel_alloc(&ch); - if (err != NRFX_SUCCESS) { - return -ENOMEM; - } - nrf_ipc_receive_config_set(NRF_IPC, CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET, BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET)); nrf_ipc_send_config_set(NRF_IPC, CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET, BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET)); + err = nrfx_gppi_conn_alloc(evt_ipc, task_ipc, &handle); + if (err < 0) { + return err; + } - nrfx_gppi_task_endpoint_setup(ch, task_ipc); - nrfx_gppi_event_endpoint_setup(ch, evt_ipc); - nrfx_gppi_channels_enable(BIT(ch)); + nrfx_gppi_conn_enable(handle); return 0; } @@ -429,7 +426,7 @@ void rtc_pretick_rtc1_isr_hook(void) static int rtc_pretick_cpunet_init(void) { - uint8_t ppi_ch; + nrfx_gppi_handle_t ppi_handle; nrf_ipc_task_t ipc_task = nrf_ipc_send_task_get(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET); nrf_ipc_event_t ipc_event = @@ -439,6 +436,7 @@ static int rtc_pretick_cpunet_init(void) uint32_t task_wdt = nrf_wdt_task_address_get(NRF_WDT, NRF_WDT_TASK_START); uint32_t evt_cc = nrf_rtc_event_address_get(NRF_RTC1, NRF_RTC_CHANNEL_EVENT_ADDR(RTC1_PRETICK_CC_CHAN)); + int err; /* Configure Watchdog to allow stopping. */ nrf_wdt_behaviour_set(NRF_WDT, WDT_CONFIG_STOPEN_Msk | BIT(4)); @@ -451,17 +449,16 @@ static int rtc_pretick_cpunet_init(void) BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET)); /* Allocate PPI channel for RTC Compare event publishers that starts WDT. */ - nrfx_err_t err = nrfx_gppi_channel_alloc(&ppi_ch); - - if (err != NRFX_SUCCESS) { - return -ENOMEM; + err = nrfx_gppi_domain_conn_alloc(0, 0, &ppi_handle); + if (err < 0) { + return err; } - nrfx_gppi_event_endpoint_setup(ppi_ch, evt_cc); - nrfx_gppi_task_endpoint_setup(ppi_ch, task_ipc); - nrfx_gppi_event_endpoint_setup(ppi_ch, evt_ipc); - nrfx_gppi_task_endpoint_setup(ppi_ch, task_wdt); - nrfx_gppi_channels_enable(BIT(ppi_ch)); + nrfx_gppi_ep_attach(evt_cc, ppi_handle); + nrfx_gppi_ep_attach(task_ipc, ppi_handle); + nrfx_gppi_ep_attach(evt_ipc, ppi_handle); + nrfx_gppi_ep_attach(task_wdt, ppi_handle); + nrfx_gppi_conn_enable(ppi_handle); nrf_rtc_event_enable(NRF_RTC1, NRF_RTC_CHANNEL_INT_MASK(RTC1_PRETICK_CC_CHAN)); nrf_rtc_event_clear(NRF_RTC1, NRF_RTC_CHANNEL_EVENT_ADDR(RTC1_PRETICK_CC_CHAN)); diff --git a/soc/nordic/nrf53/sync_rtc.c b/soc/nordic/nrf53/sync_rtc.c index 724453583b35..3f50964d8a5f 100644 --- a/soc/nordic/nrf53/sync_rtc.c +++ b/soc/nordic/nrf53/sync_rtc.c @@ -3,7 +3,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#include #include #include #include @@ -27,7 +26,7 @@ static int32_t nrf53_sync_offset = -EBUSY; union rtc_sync_channels { uint32_t raw; struct { - uint8_t ppi; + nrfx_gppi_handle_t ppi; uint8_t rtc; uint8_t ipc_out; uint8_t ipc_in; @@ -74,14 +73,15 @@ union rtc_sync_channels { static void ppi_ipc_to_rtc(union rtc_sync_channels channels, bool setup) { nrf_ipc_event_t ipc_evt = nrf_ipc_receive_event_get(channels.ch.ipc_in); - uint32_t task_addr = z_nrf_rtc_timer_capture_task_address_get(channels.ch.rtc); + uint32_t eep = nrf_ipc_event_address_get(NRF_IPC, ipc_evt); + uint32_t tep = z_nrf_rtc_timer_capture_task_address_get(channels.ch.rtc); if (setup) { - nrfx_gppi_task_endpoint_setup(channels.ch.ppi, task_addr); - nrf_ipc_publish_set(NRF_IPC, ipc_evt, channels.ch.ppi); + nrfx_gppi_ep_attach(eep, channels.ch.ppi); + nrfx_gppi_ep_attach(tep, channels.ch.ppi); } else { - nrfx_gppi_task_endpoint_clear(channels.ch.ppi, task_addr); - nrf_ipc_publish_clear(NRF_IPC, ipc_evt); + nrfx_gppi_ep_clear(eep); + nrfx_gppi_ep_clear(tep); } } @@ -92,30 +92,25 @@ static void ppi_ipc_to_rtc(union rtc_sync_channels channels, bool setup) */ static void ppi_rtc_to_ipc(union rtc_sync_channels channels, bool setup) { - uint32_t evt_addr = z_nrf_rtc_timer_compare_evt_address_get(channels.ch.rtc); nrf_ipc_task_t ipc_task = nrf_ipc_send_task_get(channels.ch.ipc_out); + uint32_t eep = z_nrf_rtc_timer_compare_evt_address_get(channels.ch.rtc); + uint32_t tep = nrf_ipc_task_address_get(NRF_IPC, ipc_task); if (setup) { - nrf_ipc_subscribe_set(NRF_IPC, ipc_task, channels.ch.ppi); - nrfx_gppi_event_endpoint_setup(channels.ch.ppi, evt_addr); + nrfx_gppi_ep_attach(eep, channels.ch.ppi); + nrfx_gppi_ep_attach(tep, channels.ch.ppi); } else { - nrfx_gppi_event_endpoint_clear(channels.ch.ppi, evt_addr); - nrf_ipc_subscribe_clear(NRF_IPC, ipc_task); + nrfx_gppi_ep_clear(eep); + nrfx_gppi_ep_clear(tep); } } /* Free DPPI and RTC channels */ static void free_resources(union rtc_sync_channels channels) { - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); - nrfx_err_t err; - - nrfx_gppi_channels_disable(BIT(channels.ch.ppi)); - + nrfx_gppi_conn_disable(channels.ch.ppi); + nrfx_gppi_domain_conn_free(channels.ch.ppi); z_nrf_rtc_timer_chan_free(channels.ch.rtc); - - err = nrfx_dppi_channel_free(&dppi, channels.ch.ppi); - __ASSERT_NO_MSG(err == NRFX_SUCCESS); } int z_nrf_rtc_timer_nrf53net_offset_get(void) @@ -225,21 +220,18 @@ static int mbox_rx_init(void *user_data) /* Setup RTC synchronization. */ static int sync_rtc_setup(void) { - nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); - nrfx_err_t err; union rtc_sync_channels channels; int32_t sync_rtc_ch; int rv; - err = nrfx_dppi_channel_alloc(&dppi, &channels.ch.ppi); - if (err != NRFX_SUCCESS) { - rv = -ENODEV; + rv = nrfx_gppi_domain_conn_alloc(0, 0, &channels.ch.ppi); + if (rv < 0) { goto bail; } sync_rtc_ch = z_nrf_rtc_timer_chan_alloc(); if (sync_rtc_ch < 0) { - nrfx_dppi_channel_free(&dppi, channels.ch.ppi); + nrfx_gppi_domain_conn_free(channels.ch.ppi); rv = sync_rtc_ch; goto bail; } @@ -253,7 +245,7 @@ static int sync_rtc_setup(void) goto bail; } - nrfx_gppi_channels_enable(BIT(channels.ch.ppi)); + nrfx_gppi_conn_enable(channels.ch.ppi); if (IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP)) { ppi_ipc_to_rtc(channels, true); diff --git a/soc/nordic/nrf54h/bicr/CMakeLists.txt b/soc/nordic/nrf54h/bicr/CMakeLists.txt index 0f7cfb33dd1e..6e26c8196906 100644 --- a/soc/nordic/nrf54h/bicr/CMakeLists.txt +++ b/soc/nordic/nrf54h/bicr/CMakeLists.txt @@ -1,7 +1,7 @@ if(CONFIG_SOC_NRF54H20_GENERATE_BICR) set(bicr_json_file ${BOARD_DIR}/${CONFIG_SOC_NRF54H20_BICR_NAME}) set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex) - set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk/nrf54h20_application.svd) + set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/bsp/stable/mdk/nrf54h20_application.svd) set(app_bicr_json_file ${APPLICATION_SOURCE_DIR}/${CONFIG_SOC_NRF54H20_BICR_NAME}) if(EXISTS ${app_bicr_json_file}) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index c291767d0906..32357011d3f5 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/soc/nordic/nrf54l/soc.c b/soc/nordic/nrf54l/soc.c index 76225d70ab74..8a73f339dcb5 100644 --- a/soc/nordic/nrf54l/soc.c +++ b/soc/nordic/nrf54l/soc.c @@ -20,15 +20,13 @@ #include #include #include -#include -#include +#include #include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #if (defined(NRF_APPLICATION) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)) || \ !defined(__ZEPHYR__) -#include #include #include #include diff --git a/soc/nordic/nrf91/soc.c b/soc/nordic/nrf91/soc.c index 5eb6342e6909..fab80836286a 100644 --- a/soc/nordic/nrf91/soc.c +++ b/soc/nordic/nrf91/soc.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include diff --git a/soc/nordic/nrf92/soc.c b/soc/nordic/nrf92/soc.c index 3652b554711a..bb3fff687be1 100644 --- a/soc/nordic/nrf92/soc.c +++ b/soc/nordic/nrf92/soc.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); diff --git a/soc/nordic/validate_binding_headers.c b/soc/nordic/validate_binding_headers.c index 98ffffe86703..d917ccba8196 100644 --- a/soc/nordic/validate_binding_headers.c +++ b/soc/nordic/validate_binding_headers.c @@ -14,7 +14,7 @@ #include #include -#include +#include /** * Domain IDs. See: diff --git a/subsys/bluetooth/audio/shell/bap_usb.c b/subsys/bluetooth/audio/shell/bap_usb.c index 330cff1eb19b..07e846fe3623 100644 --- a/subsys/bluetooth/audio/shell/bap_usb.c +++ b/subsys/bluetooth/audio/shell/bap_usb.c @@ -738,7 +738,6 @@ int bap_usb_init(void) */ err = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); - err -= NRFX_ERROR_BASE_NUM; if (err != 0) { LOG_WRN("Failed to set 128 MHz: %d", err); } 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 7056f020bc28..03d7ce5cace1 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 @@ -12,6 +12,7 @@ #include #include +#include #include "util/mem.h" @@ -67,8 +68,8 @@ BUILD_ASSERT(!HAL_RADIO_GPIO_LNA_OFFSET_MISSING, #endif /* FEM_NODE */ #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) -static const nrfx_gpiote_t gpiote_palna = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP)); +static nrfx_gpiote_t * const gpiote_palna = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(FEM_NODE, HAL_RADIO_GPIO_PA_PROP)); static uint8_t gpiote_ch_palna; BUILD_ASSERT(NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP) == @@ -78,8 +79,8 @@ BUILD_ASSERT(NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP) == #endif #if defined(HAL_RADIO_FEM_IS_NRF21540) -static const nrfx_gpiote_t gpiote_pdn = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(FEM_NODE, pdn_gpios)); +static nrfx_gpiote_t * const gpiote_pdn = + &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(FEM_NODE, pdn_gpios)); static uint8_t gpiote_ch_pdn; #endif @@ -1940,13 +1941,13 @@ uint32_t radio_tmr_sample_get(void) int radio_gpio_pa_lna_init(void) { #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) - if (nrfx_gpiote_channel_alloc(&gpiote_palna, &gpiote_ch_palna) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote_palna, &gpiote_ch_palna) != NRFX_SUCCESS) { return -ENOMEM; } #endif #if defined(NRF_GPIO_PDN_PIN) - if (nrfx_gpiote_channel_alloc(&gpiote_pdn, &gpiote_ch_pdn) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote_pdn, &gpiote_ch_pdn) != NRFX_SUCCESS) { return -ENOMEM; } #endif @@ -1957,18 +1958,18 @@ int radio_gpio_pa_lna_init(void) void radio_gpio_pa_lna_deinit(void) { #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) - (void)nrfx_gpiote_channel_free(&gpiote_palna, gpiote_ch_palna); + (void)nrfx_gpiote_channel_free(gpiote_palna, gpiote_ch_palna); #endif #if defined(NRF_GPIO_PDN_PIN) - (void)nrfx_gpiote_channel_free(&gpiote_pdn, gpiote_ch_pdn); + (void)nrfx_gpiote_channel_free(gpiote_pdn, gpiote_ch_pdn); #endif } #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) void radio_gpio_pa_setup(void) { - gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = + gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | (NRF_GPIO_PA_PSEL << @@ -1988,7 +1989,7 @@ void radio_gpio_pa_setup(void) #if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) void radio_gpio_lna_setup(void) { - gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = + gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | (NRF_GPIO_LNA_PSEL << @@ -2008,7 +2009,7 @@ void radio_gpio_pdn_setup(void) { /* Note: the pdn-gpios property is optional. */ #if defined(NRF_GPIO_PDN) - gpiote_pdn.p_reg->CONFIG[gpiote_ch_pdn] = + gpiote_pdn->p_reg->CONFIG[gpiote_ch_pdn] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | (NRF_GPIO_PDN_PSEL << @@ -2062,12 +2063,12 @@ void radio_gpio_pa_lna_disable(void) BIT(HAL_DISABLE_PALNA_PPI) | BIT(HAL_ENABLE_FEM_PPI) | BIT(HAL_DISABLE_FEM_PPI)); - gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = 0; - gpiote_pdn.p_reg->CONFIG[gpiote_ch_pdn] = 0; + gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = 0; + gpiote_pdn->p_reg->CONFIG[gpiote_ch_pdn] = 0; #else hal_radio_nrf_ppi_channels_disable(BIT(HAL_ENABLE_PALNA_PPI) | BIT(HAL_DISABLE_PALNA_PPI)); - gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = 0; + gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = 0; #endif } #endif /* HAL_RADIO_GPIO_HAVE_PA_PIN || HAL_RADIO_GPIO_HAVE_LNA_PIN */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52810.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52810.h index 7b22249ec928..1545b292d9c9 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52810.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52810.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include /* Use the NRF_RTC instance for coarse radio event scheduling */ #define NRF_RTC NRF_RTC0 diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52832.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52832.h index 10e942cca1e9..7a5321e2ea4f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52832.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52832.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include /* Use the NRF_RTC instance for coarse radio event scheduling */ #define NRF_RTC NRF_RTC0 diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52840.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52840.h index 80ab0f9e2410..6c3ce7cf41f2 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52840.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52840.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include /* Use the NRF_RTC instance for coarse radio event scheduling */ #define NRF_RTC NRF_RTC0 diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h index 428bcb869687..4e3729ad7748 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h @@ -18,7 +18,7 @@ static inline void hal_palna_ppi_setup(void) nrf_gpiote_task_t task; task = nrf_gpiote_out_task_get(gpiote_ch_palna); - nrf_gpiote_subscribe_set(gpiote_palna.p_reg, task, HAL_DISABLE_PALNA_PPI); + nrf_gpiote_subscribe_set(gpiote_palna->p_reg, task, HAL_DISABLE_PALNA_PPI); #endif } #endif /* defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) */ @@ -44,14 +44,14 @@ static inline void hal_gpiote_tasks_setup(NRF_GPIOTE_Type *gpiote, static inline void hal_pa_ppi_setup(void) { - hal_gpiote_tasks_setup(gpiote_palna.p_reg, gpiote_ch_palna, + hal_gpiote_tasks_setup(gpiote_palna->p_reg, gpiote_ch_palna, IS_ENABLED(HAL_RADIO_GPIO_PA_POL_INV), HAL_ENABLE_PALNA_PPI, HAL_DISABLE_PALNA_PPI); } static inline void hal_lna_ppi_setup(void) { - hal_gpiote_tasks_setup(gpiote_palna.p_reg, gpiote_ch_palna, + hal_gpiote_tasks_setup(gpiote_palna->p_reg, gpiote_ch_palna, IS_ENABLED(HAL_RADIO_GPIO_LNA_POL_INV), HAL_ENABLE_PALNA_PPI, HAL_DISABLE_PALNA_PPI); } @@ -63,7 +63,7 @@ static inline void hal_fem_ppi_setup(void) nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_DISABLED, HAL_DISABLE_FEM_PPI); - hal_gpiote_tasks_setup(gpiote_pdn.p_reg, gpiote_ch_pdn, + hal_gpiote_tasks_setup(gpiote_pdn->p_reg, gpiote_ch_pdn, IS_ENABLED(HAL_RADIO_GPIO_NRF21540_PDN_POL_INV), HAL_ENABLE_FEM_PPI, HAL_DISABLE_FEM_PPI); } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h index 268bae5aef17..b3fecbef87b8 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h @@ -13,12 +13,12 @@ static inline void hal_palna_ppi_setup(void) NRF_PPI, HAL_ENABLE_PALNA_PPI, (uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[2]), - (uint32_t)&(gpiote_palna.p_reg->TASKS_OUT[gpiote_ch_palna])); + (uint32_t)&(gpiote_palna->p_reg->TASKS_OUT[gpiote_ch_palna])); nrf_ppi_channel_endpoint_setup( NRF_PPI, HAL_DISABLE_PALNA_PPI, (uint32_t)&(NRF_RADIO->EVENTS_DISABLED), - (uint32_t)&(gpiote_palna.p_reg->TASKS_OUT[gpiote_ch_palna])); + (uint32_t)&(gpiote_palna->p_reg->TASKS_OUT[gpiote_ch_palna])); } #endif /* defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) */ @@ -40,12 +40,12 @@ static inline void hal_fem_ppi_setup(void) NRF_PPI, HAL_ENABLE_FEM_PPI, (uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[3]), - (uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn])); + (uint32_t)&(gpiote_pdn->p_reg->TASKS_OUT[gpiote_ch_pdn])); nrf_ppi_channel_endpoint_setup( NRF_PPI, HAL_DISABLE_FEM_PPI, (uint32_t)&(NRF_RADIO->EVENTS_DISABLED), - (uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn])); + (uint32_t)&(gpiote_pdn->p_reg->TASKS_OUT[gpiote_ch_pdn])); } #endif /* HAL_RADIO_FEM_IS_NRF21540 */ diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15_dvk_nrf54l15_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15_dvk_nrf54l15_cpuapp.conf deleted file mode 100644 index eae536f36565..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15_dvk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright 2024 Nordic Semiconductor ASA -# Copyright 2025 Ezurio LLC -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15u_dvk_nrf54l15_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15u_dvk_nrf54l15_cpuapp.conf deleted file mode 100644 index eae536f36565..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15u_dvk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright 2024 Nordic Semiconductor ASA -# Copyright 2025 Ezurio LLC -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index e79ad7a81266..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS1=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index a7bedf1f04b1..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS2=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index 157e0a11f728..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS131=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.conf deleted file mode 100644 index 157e0a11f728..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS131=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index b01af3b36a7b..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index b01af3b36a7b..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index b01af3b36a7b..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/prj.conf b/tests/boards/nrf/i2c/i2c_slave/prj.conf index 4b19609ecfbd..e96142fe744f 100644 --- a/tests/boards/nrf/i2c/i2c_slave/prj.conf +++ b/tests/boards/nrf/i2c/i2c_slave/prj.conf @@ -1,2 +1,3 @@ CONFIG_I2C=y CONFIG_ZTEST=y +CONFIG_NRFX_TWIS=y diff --git a/tests/boards/nrf/i2c/i2c_slave/src/main.c b/tests/boards/nrf/i2c/i2c_slave/src/main.c index 78e6acec8805..dccc39762c30 100644 --- a/tests/boards/nrf/i2c/i2c_slave/src/main.c +++ b/tests/boards/nrf/i2c/i2c_slave/src/main.c @@ -17,24 +17,6 @@ #include -#if CONFIG_NRFX_TWIS1 -#define I2C_S_INSTANCE 1 -#elif CONFIG_NRFX_TWIS2 -#define I2C_S_INSTANCE 2 -#elif CONFIG_NRFX_TWIS20 -#define I2C_S_INSTANCE 20 -#elif CONFIG_NRFX_TWIS21 -#define I2C_S_INSTANCE 21 -#elif CONFIG_NRFX_TWIS22 -#define I2C_S_INSTANCE 22 -#elif CONFIG_NRFX_TWIS30 -#define I2C_S_INSTANCE 30 -#elif CONFIG_NRFX_TWIS131 -#define I2C_S_INSTANCE 131 -#else -#error "TWIS instance not enabled or not supported" -#endif - #define NODE_SENSOR DT_NODELABEL(sensor) #define NODE_TWIS DT_ALIAS(i2c_slave) @@ -46,7 +28,9 @@ #define TEST_DATA_SIZE 6 static const uint8_t msg[TEST_DATA_SIZE] = "Nordic"; -static const nrfx_twis_t twis = NRFX_TWIS_INSTANCE(I2C_S_INSTANCE); +static nrfx_twis_t twis = { + .p_reg = (NRF_TWIS_Type *)DT_REG_ADDR(NODE_TWIS) +}; static uint8_t i2c_slave_buffer[TEST_DATA_SIZE] TWIS_MEMORY_SECTION; static uint8_t i2c_master_buffer[TEST_DATA_SIZE]; @@ -57,7 +41,7 @@ struct i2c_api_twis_fixture { uint8_t *const slave_buffer; }; -void i2s_slave_handler(nrfx_twis_evt_t const *p_event) +void i2s_slave_handler(nrfx_twis_event_t const *p_event) { switch (p_event->type) { case NRFX_TWIS_EVT_READ_REQ: @@ -96,7 +80,7 @@ static void *test_setup(void) }; int ret; - zassert_equal(NRFX_SUCCESS, nrfx_twis_init(&twis, &config, i2s_slave_handler), + zassert_equal(0, nrfx_twis_init(&twis, &config, i2s_slave_handler), "TWIS initialization failed"); PINCTRL_DT_DEFINE(NODE_TWIS); @@ -104,7 +88,7 @@ static void *test_setup(void) zassert_ok(ret); IRQ_CONNECT(DT_IRQN(NODE_TWIS), DT_IRQ(NODE_TWIS, priority), - NRFX_TWIS_INST_HANDLER_GET(I2C_S_INSTANCE), NULL, 0); + nrfx_twis_irq_handler, &twis, 0); nrfx_twis_enable(&twis); diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index bcb57519f3b4..2acc99f61b75 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -355,7 +355,9 @@ static void grtc_stress_test(bool busy_sim_en) } if (busy_sim_en) { +#ifdef CONFIG_TEST_BUSY_SIM busy_sim_start(500, 200, 1000, 400, NULL); +#endif } LOG_DBG("Starting test, will end at %d", test_end); @@ -387,7 +389,9 @@ static void grtc_stress_test(bool busy_sim_en) TC_PRINT("CPU load during test:%d.%d\n", load / 10, load % 10); if (busy_sim_en) { +#ifdef CONFIG_TEST_BUSY_SIM busy_sim_stop(); +#endif } if (counter_dev) { diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index 0ba5944cca66..d481ed33adcf 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -79,7 +79,7 @@ tests: - CONFIG_UART_0_ENHANCED_POLL_OUT=y - CONFIG_UART_0_NRF_HW_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER2=y + - CONFIG_NRFX_TIMER=y platform_allow: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 008eae9d3d7f..38da5dca4800 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -78,7 +78,7 @@ tests: - CONFIG_UART_0_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER2=y + - CONFIG_NRFX_TIMER=y - CONFIG_UART_0_ENHANCED_POLL_OUT=n drivers.uart.pm.async.enhanced_poll: @@ -88,7 +88,7 @@ tests: - CONFIG_UART_0_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER2=y + - CONFIG_NRFX_TIMER=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y platform_exclude: - nrf54h20dk/nrf54h20/cpuapp diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf52840dk_nrf52840_counter.conf b/tests/drivers/watchdog/wdt_basic_api/boards/nrf52840dk_nrf52840_counter.conf index 35a9b2735c6e..6152c1fc8105 100644 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf52840dk_nrf52840_counter.conf +++ b/tests/drivers/watchdog/wdt_basic_api/boards/nrf52840dk_nrf52840_counter.conf @@ -1,4 +1,3 @@ # Disable hardware watchdog CONFIG_WDT_NRFX=n -CONFIG_NRFX_WDT0=n CONFIG_ZERO_LATENCY_IRQS=y diff --git a/west.yml b/west.yml index ec5d79378e19..4315510509bc 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 7858281d843468fe53c829995fb63f45a227387a + revision: 564e754139944286208f3eac122781cec4262392 path: modules/hal/nordic groups: - hal @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: f3cc9476e233364031e9ab842290392f260fba82 + revision: c11e845e2483917d7478ba1a7a3591a9f4e8d4a2 path: bootloader/mcuboot groups: - bootloader @@ -334,7 +334,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 26ed181181eed53e400db8f63fa83c566a05d971 + revision: 5eec7aca321735f5fc8e3e7c79e162f0e9810b16 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: e269670cd17fb8ccc4b7004544276bc7d9578496 @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 04aa7243e04946b5422b124bea9c0675ab6b120f + revision: c2f9edc77f72838e7d6f5f9c0b95e4318ddfced1 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From a275c8bb63cca39f7e29e9cad3439f9cb8f9cf06 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Mon, 14 Jul 2025 12:54:17 +0200 Subject: [PATCH 0580/3334] [nrf fromtree] usb: device_next: use slist to store completed transfer requests USBD_MAX_UDC_MSG configures the number of events coming from the UDC driver that the stack can keep. This can be filled very quickly if there would be multiple bus events for some reason, or function handlers of those events are blocked for long time. As a consequence, subsequent events could be dropped, and completed transfers not handled. To avoid it, we can store completed transfer requests in a slist and check it on every event. Signed-off-by: Johann Fischer (cherry picked from commit 5137439a47685e04b584eff973bc2090f48e7946) --- include/zephyr/usb/usbd.h | 4 ++ subsys/usb/device_next/usbd_core.c | 60 ++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/include/zephyr/usb/usbd.h b/include/zephyr/usb/usbd.h index d4afb34e7664..953182096580 100644 --- a/include/zephyr/usb/usbd.h +++ b/include/zephyr/usb/usbd.h @@ -287,6 +287,10 @@ struct usbd_context { const struct device *dev; /** Notification message recipient callback */ usbd_msg_cb_t msg_cb; + /** slist to keep endpoint events */ + sys_slist_t ep_events; + /** Endpoint event list spinlock */ + struct k_spinlock ep_event_lock; /** Middle layer runtime data */ struct usbd_ch9_data ch9_data; /** slist to manage descriptors like string, BOS */ diff --git a/subsys/usb/device_next/usbd_core.c b/subsys/usb/device_next/usbd_core.c index 9f24530fc2c2..a802d74028a2 100644 --- a/subsys/usb/device_next/usbd_core.c +++ b/subsys/usb/device_next/usbd_core.c @@ -34,29 +34,53 @@ K_MSGQ_DEFINE(usbd_msgq, sizeof(struct udc_event), static int usbd_event_carrier(const struct device *dev, const struct udc_event *const event) { + struct usbd_context *const uds_ctx = (void *)udc_get_event_ctx(dev); + k_spinlock_key_t key; + + if (event->type == UDC_EVT_EP_REQUEST) { + /* + * Always add completed transfer requests to the list, so they + * do not get lost. + */ + key = k_spin_lock(&uds_ctx->ep_event_lock); + sys_slist_append(&uds_ctx->ep_events, &event->buf->node); + k_spin_unlock(&uds_ctx->ep_event_lock, key); + } + return k_msgq_put(&usbd_msgq, event, K_NO_WAIT); } -static int event_handler_ep_request(struct usbd_context *const uds_ctx, - const struct udc_event *const event) +static void event_handler_ep_request(struct usbd_context *const uds_ctx) { struct udc_buf_info *bi; + k_spinlock_key_t key; + struct net_buf *buf; + sys_snode_t *node; int ret; - bi = udc_get_buf_info(event->buf); + while (!sys_slist_is_empty(&uds_ctx->ep_events)) { + key = k_spin_lock(&uds_ctx->ep_event_lock); + node = sys_slist_get(&uds_ctx->ep_events); + k_spin_unlock(&uds_ctx->ep_event_lock, key); - if (USB_EP_GET_IDX(bi->ep) == 0) { - ret = usbd_handle_ctrl_xfer(uds_ctx, event->buf, bi->err); - } else { - ret = usbd_class_handle_xfer(uds_ctx, event->buf, bi->err); - } + buf = SYS_SLIST_CONTAINER(node, buf, node); + if (buf == NULL) { + break; + } - if (ret) { - LOG_ERR("unrecoverable error %d, ep 0x%02x, buf %p", - ret, bi->ep, event->buf); - } + bi = udc_get_buf_info(buf); + if (USB_EP_GET_IDX(bi->ep) == 0) { + ret = usbd_handle_ctrl_xfer(uds_ctx, buf, bi->err); + } else { + ret = usbd_class_handle_xfer(uds_ctx, buf, bi->err); + } - return ret; + if (ret) { + LOG_ERR("Unrecoverable error %d, ep 0x%02x, buf %p", + ret, bi->ep, (void *)buf); + usbd_msg_pub_simple(uds_ctx, USBD_MSG_STACK_ERROR, ret); + } + } } static void usbd_class_bcast_event(struct usbd_context *const uds_ctx, @@ -138,6 +162,13 @@ static ALWAYS_INLINE void usbd_event_handler(struct usbd_context *const uds_ctx, { int err = 0; + /* Always check if there is a completed transfer request. */ + event_handler_ep_request(uds_ctx); + if (event->type == UDC_EVT_EP_REQUEST) { + /* It has already been handled and cannot be another event type. */ + return; + } + switch (event->type) { case UDC_EVT_VBUS_REMOVED: LOG_DBG("VBUS remove event"); @@ -167,9 +198,6 @@ static ALWAYS_INLINE void usbd_event_handler(struct usbd_context *const uds_ctx, err = event_handler_bus_reset(uds_ctx); usbd_msg_pub_simple(uds_ctx, USBD_MSG_RESET, 0); break; - case UDC_EVT_EP_REQUEST: - err = event_handler_ep_request(uds_ctx, event); - break; case UDC_EVT_ERROR: LOG_ERR("UDC error event"); usbd_msg_pub_simple(uds_ctx, USBD_MSG_UDC_ERROR, event->status); From ddef93b14cb967b214eb1a2e15cc9b8ed4f1d708 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Tue, 28 Oct 2025 08:51:10 +0100 Subject: [PATCH 0581/3334] [nrf fromtree] drivers: udc_dwc2: avoid register read on disabled controller The VBUS bounces when the USB connector is plugged in. This can lead to events VBUS removed and Suspended occurring in that order. With hibernation support enabled, hibernation request, as result of the suspend interrupt, will be delegated to the driver thread. Once the driver thread is scheduled to process hibernation request, the controller may be already disabled and controller/phy clocks be off. On nRF54LM20 this leads to CPU crash and a hang. To avoid this happening, cancel the possible hibernation request after interrupts are disabled. Although the thread could be still waked up because of USBSUSP interrupt raised and event posted, this is considered to be harmless, as there would be a second check in the thread whether the event is still valid or is cleared in between. Signed-off-by: Johann Fischer (cherry picked from commit 0d515e777fb082ad144625c2fb9d9001157ba7ff) --- drivers/usb/udc/udc_dwc2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index eb7368e1178f..769030670918 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -2328,6 +2328,7 @@ static int udc_dwc2_disable(const struct device *dev) } config->irq_disable_func(dev); + cancel_hibernation_request(priv); if (priv->hibernated) { dwc2_exit_hibernation(dev, false, true); From a5a08497515f17ef850dd6884e010f4ffc338483 Mon Sep 17 00:00:00 2001 From: Kacper Radoszewski Date: Thu, 27 Nov 2025 08:57:56 +0100 Subject: [PATCH 0582/3334] [nrf noup] include: net: add TLS_DTLS_FRAG_EXT to NCS extensions nrf-squash! [nrf noup] include: net: add NCS extensions The TLS_DTLS_FRAG_EXT socket option is used to enable and disable the DTLS fragmentation extension. Signed-off-by: Kacper Radoszewski --- include/zephyr/net/socket_ncs.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h index 6a77d6c41f13..7c8bae645f6c 100644 --- a/include/zephyr/net/socket_ncs.h +++ b/include/zephyr/net/socket_ncs.h @@ -69,6 +69,27 @@ extern "C" { #define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 #define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 +/** Socket option to enable the DTLS fragmentation extension. + * Accepted values for the option are: @ref DTLS_FRAG_EXT_DISABLED, + * @ref DTLS_FRAG_EXT_512_ENABLED, @ref DTLS_FRAG_EXT_1024_ENABLED. + */ +#define TLS_DTLS_FRAG_EXT (NET_SOCKET_NCS_BASE + 22) + +/** Disabled - The DTLS fragmentation extension is not included in the Client Hello. */ +#define DTLS_FRAG_EXT_DISABLED 0 +/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment + * size of 512 bytes. + * + * @note The user data size in send requests also becomes limited to a maximum of 512 bytes. + */ +#define DTLS_FRAG_EXT_512_ENABLED 1 +/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment + * size of 1024 bytes. + * + * @note The user data size in send requests also becomes limited to a maximum of 1024 bytes. + */ +#define DTLS_FRAG_EXT_1024_ENABLED 2 + /* NCS specific socket options */ /** sockopt: enable sending data as part of exceptional events */ From 95ad0eb429a1a17809e5a5594fd8160264233c6e Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 19 Nov 2025 11:36:53 +0530 Subject: [PATCH 0583/3334] [nrf fromlist] boards: shields: Add nRF7002 EB-II shield This is primarily intended for providing Wi-Fi capabilities for the nRF54L Series hosts using SPI. Upstream PR #: 100121 Signed-off-by: Chaitanya Tata --- boards/shields/nrf7002eb2/Kconfig.shield | 14 +++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 54 +++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 89 ++++++++++++++++++ boards/shields/nrf7002eb2/doc/index.rst | 72 ++++++++++++++ boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg | Bin 0 -> 49527 bytes boards/shields/nrf7002eb2/nrf7002eb2.overlay | 24 +++++ .../nrf7002eb2/nrf7002eb2_coex.overlay | 15 +++ .../shields/nrf7002eb2/nrf7002eb2_common.dtsi | 20 ++++ .../nrf7002eb2/nrf7002eb2_common_5g.dtsi | 12 +++ .../nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi | 25 +++++ .../nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi | 15 +++ .../nrf7002eb2/nrf7002eb2_nrf7000.overlay | 24 +++++ .../nrf7002eb2/nrf7002eb2_nrf7001.overlay | 23 +++++ boards/shields/nrf7002eb2/shield.yml | 26 +++++ 14 files changed, 413 insertions(+) create mode 100644 boards/shields/nrf7002eb2/Kconfig.shield create mode 100644 boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay create mode 100644 boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay create mode 100644 boards/shields/nrf7002eb2/doc/index.rst create mode 100644 boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay create mode 100644 boards/shields/nrf7002eb2/shield.yml diff --git a/boards/shields/nrf7002eb2/Kconfig.shield b/boards/shields/nrf7002eb2/Kconfig.shield new file mode 100644 index 000000000000..3a6309b39148 --- /dev/null +++ b/boards/shields/nrf7002eb2/Kconfig.shield @@ -0,0 +1,14 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_NRF7002EB2 + def_bool $(shields_list_contains,nrf7002eb2) + +config SHIELD_NRF7002EB2_NRF7001 + def_bool $(shields_list_contains,nrf7002eb2_nrf7001) + +config SHIELD_NRF7002EB2_NRF7000 + def_bool $(shields_list_contains,nrf7002eb2_nrf7000) + +config SHIELD_NRF7002EB2_COEX + def_bool $(shields_list_contains,nrf7002eb2_coex) diff --git a/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..912d806b5f47 --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../nrf7002eb2_gpio_pins_1.dtsi" + +/ { + chosen { + zephyr,wifi = &wlan0; + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,uart-mcumgr = &uart30; + zephyr,bt-mon-uart = &uart30; + zephyr,bt-c2h-uart = &uart30; + }; +}; + +&pinctrl { + spi22_default: spi22_default { + group1 { + psels = , + , + ; + bias-pull-down; + }; + }; + + spi22_sleep: spi22_sleep { + group1 { + psels = , + , + ; + bias-pull-down; + low-power-enable; + }; + }; +}; + +&spi22 { + cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..dcc759345bad --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../nrf7002eb2_gpio_pins_2.dtsi" + +/ { + chosen { + zephyr,wifi = &wlan0; + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,uart-mcumgr = &uart30; + zephyr,bt-mon-uart = &uart30; + zephyr,bt-c2h-uart = &uart30; + }; + + buttons { + /delete-node/ button_3; + }; + + aliases { + /delete-property/ sw3; + }; +}; + +&gpio3 { + status = "okay"; +}; + +&pinctrl { + spi22_default: spi22_default { + group1 { + psels = , + , + ; + bias-pull-down; + }; + }; + + spi22_sleep: spi22_sleep { + group1 { + psels = , + , + ; + bias-pull-down; + low-power-enable; + }; + }; + + uart30_default: uart30_default { + group1 { + psels = ; + }; + + group2 { + psels = ; + bias-pull-up; + }; + }; + + uart30_sleep: uart30_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&spi22 { + status = "okay"; + cs-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; +}; + +/* uart20 has pin conflicts with EB-II shield hence disabling that + * and enabling uart30 as console port. + */ +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/doc/index.rst b/boards/shields/nrf7002eb2/doc/index.rst new file mode 100644 index 000000000000..6fe033c21221 --- /dev/null +++ b/boards/shields/nrf7002eb2/doc/index.rst @@ -0,0 +1,72 @@ +.. _nrf7002eb2: + +nRF7002 EB II +############# + +Overview +******** + +The nRF7002 EB II is a versatile evaluation kit in the form of a thumbstick shield which connects to +compatible Nordic host boards using the Nordic edge-connector. + +The nRF7002 EB II unlocks low-power Wi-Fi 6 capabilities for your host device. It supports dual-band Wi-Fi +2.4GHz and 5GHz, and is based on the nRF7002 SoC. The shield also supports nRF7001 and nRF7000 SoCs +through variant overlays. +Seamlessly connect to Wi-Fi networks and leverage Wi-Fi-based locationing, enabling advanced +features such as SSID sniffing of local Wi-Fi hubs. + +.. figure:: nrf7002eb2.jpg + :alt: nRF7002 EB II + :align: center + + nRF7002 EB II + +Requirements +************ + +The nRF7002 EB II board is designed to fit straight into a Nordic edge-connector and uses SPI as the +communication interface. Any host board that supports the Nordic edge-connector can be used with +the nRF7002 EB II. + +Prerequisites +------------- + +The nRF70 driver requires firmware binary blobs for Wi-Fi operation. Run the command +below to retrieve those files. + +.. code-block:: console + + west update + west blobs fetch nrf_wifi + +Usage +***** + +The shield can be used in any application by setting ``--shield nrf7002eb2`` when invoking ``west build``. + +Shield Variants +*************** + +The nRF7002 EB II has several variants to support different nRF70 SoCs and features: + +- ``nrf7002eb2``: The default variant using the nRF7002 SoC. +- ``nrf7002eb2_nrf7001``: Variant using the nRF7001 SoC. +- ``nrf7002eb2_nrf7000``: Variant using the nRF7000 SoC. +- ``nrf7002eb2_coex``: Variant which includes the COEX pins. These pins are not routed to the + edge-connector on some boards, like earlier revisions of the Thingy53 than v1.0.0. + +SR Co-existence +*************** + +The nRF7002 EB II supports SR co-existence provided the host board supports it. The SR co-existence +pins are connected to the host board's GPIO pins. + +Two Kconfig options are available to enable SR co-existence: + +- :kconfig:option:`CONFIG_NRF70_SR_COEX`: Enables SR co-existence. +- :kconfig:option:`CONFIG_NRF70_SR_COEX_RF_SWITCH`: Control SR side RF switch. + +References +********** + +- `Developing with nRF7002 EB II `_ diff --git a/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg b/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..458093f1662041123b3afae0d83a1aa9e8564ec3 GIT binary patch literal 49527 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 z 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 bi4kLg0)r;$UqfF0JMo17SNgvAYwCXh^nayi literal 0 HcmV?d00001 diff --git a/boards/shields/nrf7002eb2/nrf7002eb2.overlay b/boards/shields/nrf7002eb2/nrf7002eb2.overlay new file mode 100644 index 000000000000..304814fa3040 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&wifi_spi { + status = "okay"; + + nrf70: nrf7002-spi@0 { + compatible = "nordic,nrf7002-spi"; + status = "okay"; + + /* Include common nRF70 overlays */ + #include "nrf7002eb2_common.dtsi" + #include "nrf7002eb2_common_5g.dtsi" + }; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay new file mode 100644 index 000000000000..36f352bc6a5e --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + nrf_radio_coex: coex { + compatible = "nordic,nrf7002-coex"; + status = "okay"; + status0-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + req-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + grant-gpios = <&gpio1 7 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; + }; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi new file mode 100644 index 000000000000..efe0703ac9dd --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include + +/* Common assignments for nRF70 EB-II shield */ +reg = <0>; +spi-max-frequency = ; + +/* Maximum TX power limits for 2.4 GHz */ +wifi-max-tx-pwr-2g-dsss = <21>; +wifi-max-tx-pwr-2g-mcs0 = <16>; +wifi-max-tx-pwr-2g-mcs7 = <16>; + +/* List of interfaces */ +wlan0: wlan0 { + compatible = "nordic,wlan"; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi new file mode 100644 index 000000000000..05a472a32bd5 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +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/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi new file mode 100644 index 000000000000..95ad1ed44221 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + nrf_radio_coex: coex { + compatible = "nordic,nrf7002-coex"; + status = "disabled"; + status0-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + req-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + grant-gpios = <&gpio1 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; + }; +}; + +&nrf70 { + iovdd-ctrl-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + bucken-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + host-irq-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi new file mode 100644 index 000000000000..dc59273a0314 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&nrf70 { + iovdd-ctrl-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + bucken-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + host-irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay new file mode 100644 index 000000000000..22b36e7b27fc --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&wifi_spi { + status = "okay"; + + nrf70: nrf7000-spi@0 { + compatible = "nordic,nrf7000-spi"; + status = "okay"; + + /* Include common nRF70 overlays */ + #include "nrf7002eb2_common.dtsi" + #include "nrf7002eb2_common_5g.dtsi" + }; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay new file mode 100644 index 000000000000..9a9243063a98 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&wifi_spi { + status = "okay"; + + nrf70: nrf7001-spi@0 { + compatible = "nordic,nrf7001-spi"; + status = "okay"; + + /* Include common nRF70 overlays */ + #include "nrf7002eb2_common.dtsi" + }; +}; diff --git a/boards/shields/nrf7002eb2/shield.yml b/boards/shields/nrf7002eb2/shield.yml new file mode 100644 index 000000000000..60349b0a3cb7 --- /dev/null +++ b/boards/shields/nrf7002eb2/shield.yml @@ -0,0 +1,26 @@ +# @Kconfig.shield + +shields: + - name: nrf7002eb2 + full_name: nRF7002 EB-II Shield + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_nrf7001 + full_name: nRF7002 EB-II Shield (nRF7001) + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_nrf7000 + full_name: nRF7002 EB-II Shield (nRF7000) + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_coex + full_name: nRF7002 EB-II Shield (SR Co-Existence) + vendor: nordic + supported_features: + - wifi From 7f2ac3ed2f35e631f830962341a2a2e21e29c47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Wed, 19 Nov 2025 09:59:40 +0100 Subject: [PATCH 0584/3334] [nrf fromtree] soc: nordic: ironside: Add counter service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add counter service. Signed-off-by: Sebastian Bøe (cherry picked from commit f324a1540f57c7ea229fb047c542de80c4149aea) --- soc/nordic/ironside/CMakeLists.txt | 1 + soc/nordic/ironside/Kconfig | 6 + soc/nordic/ironside/counter.c | 80 ++++++++++ .../ironside/include/nrf_ironside/counter.h | 143 ++++++++++++++++++ 4 files changed, 230 insertions(+) create mode 100644 soc/nordic/ironside/counter.c create mode 100644 soc/nordic/ironside/include/nrf_ironside/counter.h diff --git a/soc/nordic/ironside/CMakeLists.txt b/soc/nordic/ironside/CMakeLists.txt index ea7f68207a89..f1ae2114f2ec 100644 --- a/soc/nordic/ironside/CMakeLists.txt +++ b/soc/nordic/ironside/CMakeLists.txt @@ -10,3 +10,4 @@ zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOTMODE_SERVICE bootmode.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_TDD_SERVICE tdd.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_DVFS_SERVICE dvfs.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_COUNTER_SERVICE counter.c) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index 32c6ef38165f..ff1d01f99e81 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -69,6 +69,12 @@ config NRF_IRONSIDE_DVFS_SERVICE help Service used to handle DVFS operating point requests. +config NRF_IRONSIDE_COUNTER_SERVICE + bool "IronSide counter service" + select NRF_IRONSIDE_CALL + help + Service used to manage secure monotonic counters. + if NRF_IRONSIDE_DVFS_SERVICE config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS diff --git a/soc/nordic/ironside/counter.c b/soc/nordic/ironside/counter.c new file mode 100644 index 000000000000..b0c80ea1bd50 --- /dev/null +++ b/soc/nordic/ironside/counter.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +int ironside_counter_set(enum ironside_counter counter_id, uint32_t value) +{ + int err; + struct ironside_call_buf *const buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_COUNTER_SET_V1; + buf->args[IRONSIDE_COUNTER_SET_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; + buf->args[IRONSIDE_COUNTER_SET_SERVICE_VALUE_IDX] = value; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_COUNTER_SET_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} + +int ironside_counter_get(enum ironside_counter counter_id, uint32_t *value) +{ + int err; + struct ironside_call_buf *buf; + + if (value == NULL) { + return -IRONSIDE_COUNTER_ERROR_INVALID_PARAM; + } + + buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_COUNTER_GET_V1; + buf->args[IRONSIDE_COUNTER_GET_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_COUNTER_GET_SERVICE_RETCODE_IDX]; + if (err == 0) { + *value = buf->args[IRONSIDE_COUNTER_GET_SERVICE_VALUE_IDX]; + } + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} + +int ironside_counter_lock(enum ironside_counter counter_id) +{ + int err; + struct ironside_call_buf *const buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_COUNTER_LOCK_V1; + buf->args[IRONSIDE_COUNTER_LOCK_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_COUNTER_LOCK_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} diff --git a/soc/nordic/ironside/include/nrf_ironside/counter.h b/soc/nordic/ironside/include/nrf_ironside/counter.h new file mode 100644 index 000000000000..ca8f23fd264b --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/counter.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ + +#include +#include +#include + +/** + * @name Counter service error codes. + * @{ + */ + +/** Counter value is lower than current value (monotonic violation). */ +#define IRONSIDE_COUNTER_ERROR_TOO_LOW (1) +/** Invalid counter ID. */ +#define IRONSIDE_COUNTER_ERROR_INVALID_ID (2) +/** Counter is locked and cannot be modified. */ +#define IRONSIDE_COUNTER_ERROR_LOCKED (3) +/** Invalid parameter. */ +#define IRONSIDE_COUNTER_ERROR_INVALID_PARAM (4) +/** Storage operation failed. */ +#define IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE (5) + +/** + * @} + */ + +/** Maximum value for a counter */ +#define IRONSIDE_COUNTER_MAX_VALUE UINT32_MAX + +/** Number of counters */ +#define IRONSIDE_COUNTER_NUM 4 + +/** + * @brief Counter identifiers. + */ +enum ironside_counter { + IRONSIDE_COUNTER_0 = 0, + IRONSIDE_COUNTER_1, + IRONSIDE_COUNTER_2, + IRONSIDE_COUNTER_3 +}; + +/* IronSide call identifiers with implicit versions. */ +#define IRONSIDE_CALL_ID_COUNTER_SET_V1 6 +#define IRONSIDE_CALL_ID_COUNTER_GET_V1 7 +#define IRONSIDE_CALL_ID_COUNTER_LOCK_V1 8 + +enum { + IRONSIDE_COUNTER_SET_SERVICE_COUNTER_ID_IDX, + IRONSIDE_COUNTER_SET_SERVICE_VALUE_IDX, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_COUNTER_SET_NUM_ARGS +}; + +enum { + IRONSIDE_COUNTER_GET_SERVICE_COUNTER_ID_IDX, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_COUNTER_GET_NUM_ARGS +}; + +enum { + IRONSIDE_COUNTER_LOCK_SERVICE_COUNTER_ID_IDX, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_COUNTER_LOCK_NUM_ARGS +}; + +/* Index of the return code within the service buffer. */ +#define IRONSIDE_COUNTER_SET_SERVICE_RETCODE_IDX (0) +#define IRONSIDE_COUNTER_GET_SERVICE_RETCODE_IDX (0) +#define IRONSIDE_COUNTER_LOCK_SERVICE_RETCODE_IDX (0) + +/* Index of the value within the GET response buffer. */ +#define IRONSIDE_COUNTER_GET_SERVICE_VALUE_IDX (1) + +BUILD_ASSERT(IRONSIDE_COUNTER_SET_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); +BUILD_ASSERT(IRONSIDE_COUNTER_GET_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); +BUILD_ASSERT(IRONSIDE_COUNTER_LOCK_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); + +/** + * @brief Set a counter value. + * + * This sets the specified counter to the given value. The counter is monotonic, + * so the new value must be greater than or equal to the current value. + * If the counter is locked, the operation will fail. + * + * @note Counters are automatically initialized to 0 during the first boot in LCS ROT. + * The monotonic constraint applies to all subsequent writes. + * + * @param counter_id Counter identifier. + * @param value New counter value. + * + * @retval 0 on success. + * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. + * @retval -IRONSIDE_COUNTER_ERROR_TOO_LOW if value is lower than current value. + * @retval -IRONSIDE_COUNTER_ERROR_LOCKED if counter is locked. + * @retval -IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE if storage operation failed. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_counter_set(enum ironside_counter counter_id, uint32_t value); + +/** + * @brief Get a counter value. + * + * This retrieves the current value of the specified counter. + * + * @note Counters are automatically initialized to 0 during the first boot in LCS ROT, + * so this function will always succeed for valid counter IDs. + * + * @param counter_id Counter identifier. + * @param value Pointer to store the counter value. + * + * @retval 0 on success. + * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. + * @retval -IRONSIDE_COUNTER_ERROR_INVALID_PARAM if value is NULL. + * @retval -IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE if storage operation failed. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_counter_get(enum ironside_counter counter_id, uint32_t *value); + +/** + * @brief Lock a counter for the current boot. + * + * This locks the specified counter, preventing any further modifications until the next reboot. + * The lock state is not persistent and will be cleared on reboot. + * + * @note The intended use case is for a bootloader to lock a counter before transferring control + * to the next boot stage, preventing that image from modifying the counter value. + * + * @param counter_id Counter identifier. + * + * @retval 0 on success. + * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_counter_lock(enum ironside_counter counter_id); + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ */ From 3010f403fe083d3a0055de9740e2305b154862a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 27 Nov 2025 08:57:55 +0100 Subject: [PATCH 0585/3334] [nrf fromtree] soc: ironside: counter_service: 2 compilation errors fixed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2 compilation errors fixed in counter service. Signed-off-by: Sebastian Bøe (cherry picked from commit a053b971442d0cabddf4a8e70e8f16eeef0a7781) --- soc/nordic/ironside/counter.c | 1 + soc/nordic/ironside/include/nrf_ironside/counter.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/soc/nordic/ironside/counter.c b/soc/nordic/ironside/counter.c index b0c80ea1bd50..b4506621851d 100644 --- a/soc/nordic/ironside/counter.c +++ b/soc/nordic/ironside/counter.c @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include diff --git a/soc/nordic/ironside/include/nrf_ironside/counter.h b/soc/nordic/ironside/include/nrf_ironside/counter.h index ca8f23fd264b..37866c43a684 100644 --- a/soc/nordic/ironside/include/nrf_ironside/counter.h +++ b/soc/nordic/ironside/include/nrf_ironside/counter.h @@ -7,7 +7,7 @@ #define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ #include -#include +#include #include /** From 987aaa43680d12d4b6bfff15973da506c302cc3c Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Tue, 30 Sep 2025 10:48:18 +0200 Subject: [PATCH 0586/3334] [nrf noup] soc: nordic: Support TF-M for poweroff Enable going to system off when the TF-M API is available. This calls the relevant TF-M platform API to enter system off mode using TF-M. This is a noup because the TF-M service for system off is currently located in sdk-nrf only. This is meant to be a short lived commit, work is already ongoing to upstream an official TF-M system off solution that can be be added to upstream Zephyr. Signed-off-by: Georgios Vasilakis --- soc/nordic/common/poweroff.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/soc/nordic/common/poweroff.c b/soc/nordic/common/poweroff.c index ebce3aae77cd..f659d31997f2 100644 --- a/soc/nordic/common/poweroff.c +++ b/soc/nordic/common/poweroff.c @@ -7,7 +7,9 @@ #include #include -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) +#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) +#include "tfm_platform_api.h" +#elif defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) #include #elif defined(CONFIG_SOC_SERIES_NRF54HX) #include @@ -30,6 +32,10 @@ void z_sys_poweroff(void) { +#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) + tfm_platform_system_off(); +#else + #if defined(CONFIG_HAS_NORDIC_RAM_CTRL) uint8_t *ram_start; size_t ram_size; @@ -78,5 +84,7 @@ void z_sys_poweroff(void) nrf_regulators_system_off(NRF_REGULATORS); #endif +#endif /* CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE */ + CODE_UNREACHABLE; } From de60cd46e18ac2c064718ea086feb1c433cf1b7a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 21 Nov 2025 08:26:32 +0000 Subject: [PATCH 0587/3334] [nrf fromtree] mgmt: mcumgr: grp: img_mgmt: Fix detecting where a slot resides Fixes an issue introduced in commit 32615695ad1b96670be8f2a38a8a9fd27e2d8ae5 which wrongly did not check what the residing device was on before determining if a slot was part of a partition area Signed-off-by: Jamie McCrae (cherry picked from commit ae2b4a44dc0d675aa90d62b46a52d04374ba8419) --- subsys/dfu/img_util/flash_img.c | 8 +++++++- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 8 +++++++- tests/subsys/dfu/img_util/src/main.c | 7 +++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index 24e95a8dc1a9..152aaabe17ae 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -23,11 +24,16 @@ LOG_MODULE_REGISTER(flash_img, CONFIG_IMG_MANAGER_LOG_LEVEL); #include #endif +#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ + (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) + #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) -#include #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && (CONFIG_TFM_MCUBOOT_IMAGE_NUMBER == 2) #define UPLOAD_FLASH_AREA_LABEL slot1_ns_partition #else 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 a2bf006b9474..5e52a9fa5c15 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2021 mcumgr authors - * Copyright (c) 2022-2024 Nordic Semiconductor ASA + * Copyright (c) 2022-2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -48,7 +48,13 @@ to be able to figure out application running slot. #endif +#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ + (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) + #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) diff --git a/tests/subsys/dfu/img_util/src/main.c b/tests/subsys/dfu/img_util/src/main.c index 33956be6251e..013498f49bd3 100644 --- a/tests/subsys/dfu/img_util/src/main.c +++ b/tests/subsys/dfu/img_util/src/main.c @@ -6,13 +6,20 @@ */ #include +#include #include #include #define SLOT0_PARTITION slot0_partition #define SLOT1_PARTITION slot1_partition +#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ + (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) + #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) From 65706b4e87243c122888934837860683148b38bc Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Fri, 21 Nov 2025 12:05:44 +0100 Subject: [PATCH 0588/3334] [nrf fromlist] flash_map: Add a macro to fetch controller ID Add a macro that allows to get the node identifier of the flash controller the area/partition resides on. Upstream PR #: 99800 Signed-off-by: Tomasz Chyrowicz --- include/zephyr/storage/flash_map.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 9dc6bd91438f..558a0a0b7e72 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -19,7 +19,7 @@ * * @defgroup flash_area_api flash area Interface * @since 1.11 - * @version 1.0.0 + * @version 1.1.0 * @ingroup storage_apis * @{ */ @@ -469,6 +469,32 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ (DT_MTD_FROM_FIXED_PARTITION(node)))) +/** + * Get the node identifier of the flash controller the area/partition resides on + * + * @param label DTS node label of a partition + * + * @return Pointer to a device. + */ +#define FIXED_PARTITION_MTD(label) \ + COND_CODE_1( \ + DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ + (DT_MTD_FROM_FIXED_SUBPARTITION(DT_NODELABEL(label))), \ + (DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label)))) + +/** + * Get the node identifier of the flash controller the area/partition resides on + * + * @param node DTS node of a partition + * + * @return Pointer to a device. + */ +#define FIXED_PARTITION_NODE_MTD(node) \ + COND_CODE_1( \ + DT_FIXED_SUBPARTITION_EXISTS(node), \ + (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ + (DT_MTD_FROM_FIXED_PARTITION(node))) + /** * Get pointer to flash_area object by partition label * From 408dfb9c005a28da24a7d3da8920e900c3617aa2 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 20 Nov 2025 15:18:09 +0100 Subject: [PATCH 0589/3334] [nrf fromlist] soc: Use absolute address in active partition Use absolute addresses while determining a running application partition. Upstream PR #: 99800 Signed-off-by: Tomasz Chyrowicz --- soc/nordic/nrf54h/soc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 32357011d3f5..591b0d480acf 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -41,14 +41,20 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); DT_REG_ADDR(COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ (DT_GPARENT(DT_PARENT(DT_NODELABEL(label)))), \ (DT_GPARENT(DT_NODELABEL(label)))))) +#define FIXED_PARTITION_NODE_MTD(node) \ + COND_CODE_1( \ + DT_FIXED_SUBPARTITION_EXISTS(node), \ + (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ + (DT_MTD_FROM_FIXED_PARTITION(node))) #ifdef CONFIG_USE_DT_CODE_PARTITION #define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) #elif defined(CONFIG_FLASH_LOAD_OFFSET) #define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET #endif - -#define PARTITION_IS_RUNNING_APP_PARTITION(label) \ +#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_NODE_MTD(DT_NODELABEL(label))) && \ (DT_REG_ADDR(DT_NODELABEL(label)) <= FLASH_LOAD_OFFSET && \ DT_REG_ADDR(DT_NODELABEL(label)) + DT_REG_SIZE(DT_NODELABEL(label)) > FLASH_LOAD_OFFSET) @@ -210,7 +216,7 @@ void soc_late_init_hook(void) void *radiocore_address = NULL; #if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) - if (PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { + if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition) + CONFIG_ROM_START_OFFSET); } else { From aa5ffe9eea8a0c5f7a48b5a21afcb8a092f81492 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 20 Nov 2025 15:19:09 +0100 Subject: [PATCH 0590/3334] [nrf fromlist] img_util: Use absolute address in active partition Use absolute addresses while determining a running application partition. Upstream PR #: 99800 Signed-off-by: Tomasz Chyrowicz --- subsys/dfu/img_util/flash_img.c | 8 ++------ tests/subsys/dfu/img_util/src/main.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index 152aaabe17ae..d3c9749401b2 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -24,13 +24,9 @@ LOG_MODULE_REGISTER(flash_img, CONFIG_IMG_MANAGER_LOG_LEVEL); #include #endif -#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ - (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) - #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ + DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_MTD(label)) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) diff --git a/tests/subsys/dfu/img_util/src/main.c b/tests/subsys/dfu/img_util/src/main.c index 013498f49bd3..c0b5d96daeb1 100644 --- a/tests/subsys/dfu/img_util/src/main.c +++ b/tests/subsys/dfu/img_util/src/main.c @@ -13,13 +13,9 @@ #define SLOT0_PARTITION slot0_partition #define SLOT1_PARTITION slot1_partition -#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ - (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) - #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ + DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_MTD(label)) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) From 5c93c6e873379f1af335279648692611a6444379 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 20 Nov 2025 15:20:23 +0100 Subject: [PATCH 0591/3334] [nrf fromlist] img_mgmt: Use absolute address in active partition Use absolute addresses while determining a running application partition. Upstream PR #: 99800 Signed-off-by: Tomasz Chyrowicz --- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c index 5e52a9fa5c15..97fc430e374a 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -48,13 +48,9 @@ to be able to figure out application running slot. #endif -#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ - (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) - #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ + DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_MTD(label)) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) From 2b747b4cb707d6f83c3fecb9ddf4f4d1e66b8a9d Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Thu, 4 Sep 2025 11:33:06 +0200 Subject: [PATCH 0592/3334] [nrf fromtree] modules: hostap: Support bgscan Add configuration options for background scanning (bgscan) in wpa_supplicant. Signed-off-by: Pieter De Gendt (cherry picked from commit 93c4dbd2e0a58ddec27a2ca3beee53e97c62ea65) --- include/zephyr/net/wifi_mgmt.h | 43 ++++++++++++++++++++++ modules/hostap/CMakeLists.txt | 20 +++++++++++ modules/hostap/Kconfig | 30 ++++++++++++++++ modules/hostap/src/supp_api.c | 65 ++++++++++++++++++++++++++++++++++ modules/hostap/src/supp_api.h | 11 ++++++ modules/hostap/src/supp_main.c | 3 ++ subsys/net/l2/wifi/wifi_mgmt.c | 25 +++++++++++++ 7 files changed, 197 insertions(+) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 703f634209d2..817a4fcd6fb6 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -137,6 +137,8 @@ enum net_request_wifi_cmd { NET_REQUEST_WIFI_CMD_AP_WPS_CONFIG, /** Configure BSS maximum idle period */ NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD, + /** Configure background scanning */ + NET_REQUEST_WIFI_CMD_BGSCAN, /** @cond INTERNAL_HIDDEN */ NET_REQUEST_WIFI_CMD_MAX /** @endcond */ @@ -332,6 +334,11 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_NEIGHBOR_REP_COMPLETE); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD); +#define NET_REQUEST_WIFI_BGSCAN \ + (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_BGSCAN) + +NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BGSCAN); + /** @cond INTERNAL_HIDDEN */ enum { @@ -1403,6 +1410,32 @@ enum wifi_sap_iface_state { WIFI_SAP_IFACE_ENABLED }; +#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN) || defined(__DOXYGEN__) +/** @brief Wi-Fi background scan implementation */ +enum wifi_bgscan_type { + /** None, background scan is disabled */ + WIFI_BGSCAN_NONE = 0, + /** Simple, periodic scan based on signal strength */ + WIFI_BGSCAN_SIMPLE, + /** Learn channels used by the network (experimental) */ + WIFI_BGSCAN_LEARN, +}; + +/** @brief Wi-Fi background scan parameters */ +struct wifi_bgscan_params { + /** The type of background scanning */ + enum wifi_bgscan_type type; + /** Short scan interval in seconds */ + uint16_t short_interval; + /** Long scan interval in seconds */ + uint16_t long_interval; + /** Signal strength threshold in dBm */ + int8_t rssi_threshold; + /** Number of BSS Transition Management (BTM) queries */ + uint16_t btm_queries; +}; +#endif + /* Extended Capabilities */ enum wifi_ext_capab { WIFI_EXT_CAPAB_20_40_COEX = 0, @@ -1742,6 +1775,16 @@ struct wifi_mgmt_ops { */ int (*set_bss_max_idle_period)(const struct device *dev, unsigned short bss_max_idle_period); +#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN) || defined(__DOXYGEN__) + /** Configure background scanning + * + * @param dev Pointer to the device structure for the driver instance. + * @param params Background scanning configuration parameters + * + * @return 0 if ok, < 0 if error + */ + int (*set_bgscan)(const struct device *dev, struct wifi_bgscan_params *params); +#endif }; /** Wi-Fi management offload API */ diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index f3233bb2cfbb..106d31b8cca4 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -78,6 +78,16 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM CONFIG_WNM ) +zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN + CONFIG_BGSCAN +) +zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE + CONFIG_BGSCAN_SIMPLE +) +zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN + CONFIG_BGSCAN_LEARN +) + zephyr_library_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src ${HOSTAP_BASE}/ @@ -156,6 +166,16 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM ${WIFI_NM_WPA_SUPPLICANT_BASE}/wnm_sta.c ) +zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN + ${WIFI_NM_WPA_SUPPLICANT_BASE}/bgscan.c +) +zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE + ${WIFI_NM_WPA_SUPPLICANT_BASE}/bgscan_simple.c +) +zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN + ${WIFI_NM_WPA_SUPPLICANT_BASE}/bgscan_learn.c +) + zephyr_library_sources_ifdef(CONFIG_WPA_CLI src/wpa_cli.c ) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 7799239a2840..9eac239daa7d 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -451,6 +451,27 @@ config WIFI_NM_WPA_SUPPLICANT_SKIP_DHCP_ON_ROAMING needs to get new IP address after roaming to new AP. Disable this to keep DHCP after roaming. +config WIFI_NM_WPA_SUPPLICANT_BGSCAN + bool "Background scanning (for legacy roaming), recommended if 802.11r is not supported" + depends on WIFI_NM_WPA_SUPPLICANT_WNM + depends on !WIFI_NM_WPA_SUPPLICANT_ROAMING + +if WIFI_NM_WPA_SUPPLICANT_BGSCAN + +config WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE + bool "Simple background scanning" + default y + help + Periodic background scans based on signal strength. + +config WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN + bool "Learning" + help + Learn channels used by the network and try to avoid + background scans on other channels (experimental). + +endif # WIFI_NM_WPA_SUPPLICANT_BGSCAN + # Create hidden config options that are used in hostap. This way we do not need # to mark them as allowed for CI checks, and also someone else cannot use the # same name options. @@ -482,6 +503,15 @@ config NO_RANDOM_POOL config WNM bool +config BGSCAN + bool + +config BGSCAN_SIMPLE + bool + +config BGSCAN_LEARN + bool + config NO_WPA bool default y if WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 1b3f19b4c1c1..11c00de06b37 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -1916,6 +1916,71 @@ int supplicant_set_bss_max_idle_period(const struct device *dev, return wifi_mgmt_api->set_bss_max_idle_period(dev, bss_max_idle_period); } +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN +int supplicant_set_bgscan(const struct device *dev, struct wifi_bgscan_params *params) +{ + struct wpa_supplicant *wpa_s; + struct wpa_ssid *ssid; + int ret = -1; + + k_mutex_lock(&wpa_supplicant_mutex, K_FOREVER); + + wpa_s = get_wpa_s_handle(dev); + if (wpa_s == NULL) { + wpa_printf(MSG_ERROR, "Interface %s not found", dev->name); + goto out; + } + + ssid = wpa_s->current_ssid; + if (ssid == NULL) { + wpa_printf(MSG_ERROR, "SSID for %s not found", dev->name); + goto out; + } + + switch (params->type) { + case WIFI_BGSCAN_SIMPLE: + if (!IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE)) { + wpa_printf(MSG_ERROR, "Invalid bgscan type, enable " + "CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE"); + ret = -ENOTSUP; + goto out; + } + if (!wpa_cli_cmd_v("set_network %d bgscan \"simple:%d:%d:%d:%d\"", ssid->id, + params->short_interval, params->rssi_threshold, + params->long_interval, params->btm_queries)) { + goto out; + } + break; + case WIFI_BGSCAN_LEARN: + if (!IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN)) { + wpa_printf(MSG_ERROR, "Invalid bgscan type, enable " + "CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN"); + ret = -ENOTSUP; + goto out; + } + if (!wpa_cli_cmd_v("set_network %d bgscan \"learn:%d:%d:%d\"", ssid->id, + params->short_interval, params->rssi_threshold, + params->long_interval)) { + goto out; + } + break; + case WIFI_BGSCAN_NONE: + default: + if (!wpa_cli_cmd_v("set_network %d bgscan \"\"", ssid->id)) { + goto out; + } + break; + } + + ret = 0; + +out: + k_mutex_unlock(&wpa_supplicant_mutex); + + return ret; +} +#endif + #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM int supplicant_btm_query(const struct device *dev, uint8_t reason) { diff --git a/modules/hostap/src/supp_api.h b/modules/hostap/src/supp_api.h index 1ef63474f3fb..8ab49f177e70 100644 --- a/modules/hostap/src/supp_api.h +++ b/modules/hostap/src/supp_api.h @@ -321,6 +321,17 @@ int supplicant_wps_config(const struct device *dev, struct wifi_wps_config_param */ int supplicant_set_bss_max_idle_period(const struct device *dev, unsigned short bss_max_idle_period); + +#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN) || defined(__DOXYGEN__) +/** @ Set Wi-Fi background scanning parameters + * + * @param dev Wi-Fi interface handle to use + * @param params bgscan parameters + * @return 0 for OK; -1 for ERROR + */ +int supplicant_set_bgscan(const struct device *dev, struct wifi_bgscan_params *params); +#endif + #ifdef CONFIG_AP int set_ap_bandwidth(const struct device *dev, enum wifi_frequency_bandwidths bandwidth); diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index 74d195386b1f..d1f8c360cb50 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -85,6 +85,9 @@ static const struct wifi_mgmt_ops mgmt_ops = { .get_conn_params = supplicant_get_wifi_conn_params, .wps_config = supplicant_wps_config, .set_bss_max_idle_period = supplicant_set_bss_max_idle_period, +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN + .set_bgscan = supplicant_set_bgscan, +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN */ #ifdef CONFIG_AP .ap_enable = supplicant_ap_enable, .ap_disable = supplicant_ap_disable, diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index a962fe317664..6a97f8c0e61c 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -1449,6 +1449,31 @@ static int wifi_set_bss_max_idle_period(uint64_t mgmt_request, struct net_if *if NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD, wifi_set_bss_max_idle_period); +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN +static int wifi_set_bgscan(uint64_t mgmt_request, struct net_if *iface, void *data, size_t len) +{ + const struct device *dev = net_if_get_device(iface); + const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_api(iface); + struct wifi_bgscan_params *params = data; + + if (wifi_mgmt_api == NULL || wifi_mgmt_api->set_bgscan == NULL) { + return -ENOTSUP; + } + + if (!net_if_is_admin_up(iface)) { + return -ENETDOWN; + } + + if (data == NULL || len != sizeof(*params)) { + return -EINVAL; + } + + return wifi_mgmt_api->set_bgscan(dev, params); +} + +NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_BGSCAN, wifi_set_bgscan); +#endif + #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS void wifi_mgmt_raise_raw_scan_result_event(struct net_if *iface, struct wifi_raw_scan_result *raw_scan_result) From 669633bf5ca1947e5e308a63c75597aa3aac93f3 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Mon, 8 Sep 2025 16:40:55 +0200 Subject: [PATCH 0593/3334] [nrf fromtree] net: l2: wifi: shell: Add bgscan command Add a shell command to configure the background scanning. Signed-off-by: Pieter De Gendt (cherry picked from commit 1da7a115cc4ba34e48f36c56871fed37b21a81ba) --- subsys/net/l2/wifi/wifi_shell.c | 120 ++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 5a90d2ccf4c4..de4d7e9d03cd 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3567,6 +3567,113 @@ static int cmd_wifi_set_bss_max_idle_period(const struct shell *sh, size_t argc, return 0; } +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN +static int wifi_bgscan_args_to_params(const struct shell *sh, size_t argc, char *argv[], + struct wifi_bgscan_params *params) +{ + int err; + int opt; + int opt_index = 0; + struct getopt_state *state; + static const struct option long_options[] = { + {"type", required_argument, 0, 't'}, + {"short-interval", required_argument, 0, 's'}, + {"rss-threshold", required_argument, 0, 'r'}, + {"long-interval", required_argument, 0, 'l'}, + {"btm-queries", required_argument, 0, 'b'}, + {"iface", required_argument, 0, 'i'}, + {0, 0, 0, 0}}; + unsigned long uval; + long val; + + while ((opt = getopt_long(argc, argv, "t:s:r:l:b:i:", long_options, &opt_index)) != -1) { + state = getopt_state_get(); + switch (opt) { + case 't': + if (strcmp("simple", state->optarg) == 0) { + params->type = WIFI_BGSCAN_SIMPLE; + } else if (strcmp("learn", state->optarg) == 0) { + params->type = WIFI_BGSCAN_LEARN; + } else if (strcmp("none", state->optarg) == 0) { + params->type = WIFI_BGSCAN_NONE; + } else { + PR_ERROR("Invalid type %s\n", state->optarg); + shell_help(sh); + return SHELL_CMD_HELP_PRINTED; + } + break; + case 's': + uval = shell_strtoul(state->optarg, 10, &err); + if (err < 0) { + PR_ERROR("Invalid short interval %s\n", state->optarg); + return err; + } + params->short_interval = uval; + break; + case 'l': + uval = shell_strtoul(state->optarg, 10, &err); + if (err < 0) { + PR_ERROR("Invalid long interval %s\n", state->optarg); + return err; + } + params->long_interval = uval; + break; + case 'b': + uval = shell_strtoul(state->optarg, 10, &err); + if (err < 0) { + PR_ERROR("Invalid BTM queries %s\n", state->optarg); + return err; + } + params->btm_queries = uval; + break; + case 'r': + val = shell_strtol(state->optarg, 10, &err); + if (err < 0) { + PR_ERROR("Invalid RSSI threshold %s\n", state->optarg); + return err; + } + params->rssi_threshold = val; + break; + case 'i': + /* Unused, but parsing to avoid unknown option error */ + break; + default: + PR_ERROR("Invalid option %c\n", state->optopt); + shell_help(sh); + return SHELL_CMD_HELP_PRINTED; + } + } + + return 0; +} + +static int cmd_wifi_set_bgscan(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_bgscan_params bgscan_params = { + .type = WIFI_BGSCAN_NONE, + .short_interval = 30, + .long_interval = 300, + .rssi_threshold = 0, + .btm_queries = 0, + }; + int ret; + + if (wifi_bgscan_args_to_params(sh, argc, argv, &bgscan_params) != 0) { + return -ENOEXEC; + } + + ret = net_mgmt(NET_REQUEST_WIFI_BGSCAN, iface, &bgscan_params, + sizeof(struct wifi_bgscan_params)); + if (ret != 0) { + PR_WARNING("Setting background scanning parameters failed: %s\n", strerror(-ret)); + return -ENOEXEC; + } + + return 0; +} +#endif + static int wifi_config_args_to_params(const struct shell *sh, size_t argc, char *argv[], struct wifi_config_params *params) { @@ -4112,6 +4219,19 @@ SHELL_SUBCMD_ADD((wifi), bss_max_idle_period, NULL, cmd_wifi_set_bss_max_idle_period, 2, 2); +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN +SHELL_SUBCMD_ADD((wifi), bgscan, NULL, + "Configure background scanning.\n" + "<-t, --type simple/learn/none> : The scanning type, use none to disable.\n" + "[-s, --short-interval ] : Short scan interval (default: 30).\n" + "[-l, --long-interval ] : Long scan interval (default: 300).\n" + "[-r, --rssi-threshold ] : Signal strength threshold (default: disabled).\n" + "[-b, --btm-queries ] : BTM queries before scanning (default: disabled).\n" + "[-i, --iface=] : Interface index.\n", + cmd_wifi_set_bgscan, + 2, 6); +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN */ + SHELL_SUBCMD_ADD((wifi), config, NULL, "Configure STA parameters.\n" "-o, --okc=<0/1>: Opportunistic Key Caching. 0: disable, 1: enable\n" From fab8736d7804b1abe4395f3996813b5c1d06bd1f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 11 Nov 2025 15:07:11 +0530 Subject: [PATCH 0594/3334] [nrf fromtree] manifest: nrf_wifi: Pull modified API The API now takes type as input. Signed-off-by: Chaitanya Tata (cherry picked from commit a7e6d6f686d1488f0c1e5e75c848a92b49c0942a) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4315510509bc..18f08c9f368a 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 5eec7aca321735f5fc8e3e7c79e162f0e9810b16 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: e269670cd17fb8ccc4b7004544276bc7d9578496 + revision: a39e9b155830461c9d1cf587afb151b894369b91 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From c3357ce5a375d098b6e3f43b53d20e12d895c5ac Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 4 Nov 2025 09:46:39 +0000 Subject: [PATCH 0595/3334] [nrf fromtree] doc: releases: release-notes: 4.4: Add note on new settings Kconfigs Lists new Kconfigs added to settings allowing single settings to be saved to NVM without modifying their value Signed-off-by: Jamie McCrae (cherry picked from commit 24e05152065141a215f33095cd4dbfd68838f9f5) --- doc/releases/release-notes-4.4.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 79a2bbf802e2..9aa8719c7edc 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -102,6 +102,11 @@ New APIs and options * :dtcompatible:`jedec,mspi-nor` now allows MSPI configuration of read, write and control commands separately via devicetree. +* Settings + + * :kconfig:option:`CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION` + * :kconfig:option:`CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION_VALUE_SIZE` + .. zephyr-keep-sorted-stop New Boards From ef871940d16be308d0093932c7d315381b13b7d3 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 17 Nov 2025 01:08:42 +0530 Subject: [PATCH 0596/3334] [nrf fromtree] manifest: hostap: Pull fix for SAE Fix build failure in case a different SAE implementation is used (e.g., PSA). Signed-off-by: Chaitanya Tata (cherry picked from commit e797874fbbb15e7b1570bbfbfc826d5f4476a3b6) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 18f08c9f368a..639d34d1900b 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 6086dea5ee7406e1eede7f2ca6dff1b00b0f04e2 + revision: 51698b0f5fdac2778484f565d4591fcb1dd92bc4 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From a3f1199a2bc24e66ad19017030c24dd07beeae81 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Mon, 8 Sep 2025 18:42:08 +0530 Subject: [PATCH 0597/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Set SSID for P2P discovery Use `ssids` instead of `filter_ssids` to set the SSID in probe requests. `filter_ssids` are to filter scan results to include only the specified SSIDs. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 88ea9f9215b4..97c418700431 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -545,16 +545,16 @@ int nrf_wifi_wpa_supp_scan2(void *if_priv, struct wpa_driver_scan_params *params scan_info->scan_params.num_scan_channels = indx; } - if (params->filter_ssids) { - scan_info->scan_params.num_scan_ssids = params->num_filter_ssids; + if (params->num_ssids) { + scan_info->scan_params.num_scan_ssids = params->num_ssids; - for (indx = 0; indx < params->num_filter_ssids; indx++) { + for (indx = 0; indx < params->num_ssids; indx++) { memcpy(scan_info->scan_params.scan_ssids[indx].nrf_wifi_ssid, - params->filter_ssids[indx].ssid, - params->filter_ssids[indx].ssid_len); + params->ssids[indx].ssid, + params->ssids[indx].ssid_len); scan_info->scan_params.scan_ssids[indx].nrf_wifi_ssid_len = - params->filter_ssids[indx].ssid_len; + params->ssids[indx].ssid_len; } } From 35055ef3e155580b768adc7de7c3c0915a524722 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Tue, 14 Oct 2025 12:09:51 +0530 Subject: [PATCH 0598/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Set P2P capability In P2P mode, inform supplicant that the driver is P2P capable. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 97c418700431..0864a1a00fe3 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1798,6 +1798,9 @@ int nrf_wifi_supp_get_capa(void *if_priv, struct wpa_driver_capa *capa) if (IS_ENABLED(CONFIG_NRF70_AP_MODE)) { capa->flags |= WPA_DRIVER_FLAGS_AP; } + if (IS_ENABLED(CONFIG_NRF70_P2P_MODE)) { + capa->flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE; + } capa->enc |= WPA_DRIVER_CAPA_ENC_WEP40 | WPA_DRIVER_CAPA_ENC_WEP104 | From 66cf4a3c1047f0f4e322d4953e298a8ae3ea5bfd Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Thu, 9 Oct 2025 17:16:51 +0000 Subject: [PATCH 0599/3334] [nrf fromlist] net: wifi: Add Wi-Fi direct P2P discovery API support Add supplicant api and mgmt ops support for P2P discovery. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- include/zephyr/net/wifi_mgmt.h | 126 ++++++++++++++- modules/hostap/src/supp_api.c | 254 +++++++++++++++++++++++++++++++ modules/hostap/src/supp_api.h | 12 ++ modules/hostap/src/supp_events.c | 54 ++++++- modules/hostap/src/supp_events.h | 7 + modules/hostap/src/supp_main.c | 9 ++ subsys/net/l2/wifi/Kconfig | 9 ++ subsys/net/l2/wifi/wifi_mgmt.c | 29 ++++ 8 files changed, 497 insertions(+), 3 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 817a4fcd6fb6..ef0a6bac27cf 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -139,6 +139,8 @@ enum net_request_wifi_cmd { NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD, /** Configure background scanning */ NET_REQUEST_WIFI_CMD_BGSCAN, + /** Wi-Fi Direct (P2P) operations*/ + NET_REQUEST_WIFI_CMD_P2P_OPER, /** @cond INTERNAL_HIDDEN */ NET_REQUEST_WIFI_CMD_MAX /** @endcond */ @@ -339,6 +341,11 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BGSCAN); +#define NET_REQUEST_WIFI_P2P_OPER \ + (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_P2P_OPER) + +NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_P2P_OPER); + /** @cond INTERNAL_HIDDEN */ enum { @@ -359,7 +366,7 @@ enum { NET_EVENT_WIFI_CMD_AP_STA_CONNECTED_VAL, NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED_VAL, NET_EVENT_WIFI_CMD_SUPPLICANT_VAL, - + NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND_VAL, NET_EVENT_WIFI_CMD_MAX, }; @@ -406,6 +413,8 @@ enum net_event_wifi_cmd { NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED), /** Supplicant specific event */ NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SUPPLICANT), + /** P2P device found */ + NET_MGMT_CMD(NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND), }; /** Event emitted for Wi-Fi scan result */ @@ -468,6 +477,51 @@ enum net_event_wifi_cmd { #define NET_EVENT_WIFI_AP_STA_DISCONNECTED \ (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED) +/** Event emitted for P2P device found event */ +#define NET_EVENT_WIFI_P2P_DEVICE_FOUND \ + (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND) + +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +/** Maximum length for P2P device name */ +#define WIFI_P2P_DEVICE_NAME_MAX_LEN 32 +/** Size of P2P primary device type (8 bytes) */ +#define WIFI_P2P_PRI_DEV_TYPE_SIZE 8 +/** Maximum length for P2P primary device type string */ +#define WIFI_P2P_PRI_DEV_TYPE_STR_MAX_LEN 32 +/** Maximum length for P2P WPS configuration methods string */ +#define WIFI_P2P_CONFIG_METHODS_STR_MAX_LEN 16 +/** Maximum length for P2P manufacturer name */ +#define WIFI_P2P_MANUFACTURER_MAX_LEN 64 +/** Maximum length for P2P model name */ +#define WIFI_P2P_MODEL_NAME_MAX_LEN 32 + +/** @brief Wi-Fi P2P device info */ +struct wifi_p2p_device_info { + /** Device MAC address */ + uint8_t mac[WIFI_MAC_ADDR_LEN]; + /** Device name (max 32 chars + null terminator) */ + char device_name[WIFI_P2P_DEVICE_NAME_MAX_LEN + 1]; + /** Primary device type */ + uint8_t pri_dev_type[WIFI_P2P_PRI_DEV_TYPE_SIZE]; + /** Primary device type string */ + char pri_dev_type_str[WIFI_P2P_PRI_DEV_TYPE_STR_MAX_LEN]; + /** Signal strength (RSSI) */ + int8_t rssi; + /** WPS configuration methods supported */ + uint16_t config_methods; + /** WPS configuration methods string */ + char config_methods_str[WIFI_P2P_CONFIG_METHODS_STR_MAX_LEN]; + /** Device capability */ + uint8_t dev_capab; + /** Group capability */ + uint8_t group_capab; + /** Manufacturer (max 64 chars + null terminator) */ + char manufacturer[WIFI_P2P_MANUFACTURER_MAX_LEN + 1]; + /** Model name (max 32 chars + null terminator) */ + char model_name[WIFI_P2P_MODEL_NAME_MAX_LEN + 1]; +}; +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ + /** @brief Wi-Fi version */ struct wifi_version { /** Driver version */ @@ -1114,6 +1168,9 @@ union wifi_mgmt_events { #endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */ struct wifi_twt_params twt_params; struct wifi_ap_sta_info ap_sta_info; +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + struct wifi_p2p_device_info p2p_device_info; +#endif }; /** @endcond */ @@ -1397,6 +1454,51 @@ struct wifi_wps_config_params { char pin[WIFI_WPS_PIN_MAX_LEN + 1]; }; +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +/** Wi-Fi P2P operation */ +enum wifi_p2p_op { + /** P2P find/discovery */ + WIFI_P2P_FIND = 0, + /** P2P stop find/discovery */ + WIFI_P2P_STOP_FIND, + /** P2P query peer info use broadcast MAC (ff:ff:ff:ff:ff:ff) to list all peers, + * or specific MAC address to query a single peer + */ + WIFI_P2P_PEER, +}; + +/** Wi-Fi P2P discovery type */ +enum wifi_p2p_discovery_type { + /** Start with full scan, then only social channels */ + WIFI_P2P_FIND_START_WITH_FULL = 0, + /** Only social channels (1, 6, 11) */ + WIFI_P2P_FIND_ONLY_SOCIAL, + /** Progressive - scan through all channels one at a time */ + WIFI_P2P_FIND_PROGRESSIVE, +}; + +/** Maximum number of P2P peers that can be returned in a single query */ +#define WIFI_P2P_MAX_PEERS CONFIG_WIFI_P2P_MAX_PEERS + +/** Wi-Fi P2P parameters */ +struct wifi_p2p_params { + /** P2P operation */ + enum wifi_p2p_op oper; + /** Discovery type (for find operation) */ + enum wifi_p2p_discovery_type discovery_type; + /** Timeout in seconds (0 = no timeout, run until stopped) */ + uint16_t timeout; + /** Peer device address (for peer operation) */ + uint8_t peer_addr[WIFI_MAC_ADDR_LEN]; + /** Flag to list only discovered peers (for peers operation) */ + bool discovered_only; + /** Pointer to array for peer info results */ + struct wifi_p2p_device_info *peers; + /** Actual number of peers returned */ + uint16_t peer_count; +}; +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ + /** Wi-Fi AP status */ enum wifi_sap_iface_state { @@ -1785,6 +1887,17 @@ struct wifi_mgmt_ops { */ int (*set_bgscan)(const struct device *dev, struct wifi_bgscan_params *params); #endif +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + /** Wi-Fi Direct (P2P) operations for device discovery + * + * @param dev Pointer to the device structure for the driver instance. + * @param params P2P operation parameters including operation type, discovery settings, + * timeout values and peer information retrieval options + * + * @return 0 if ok, < 0 if error + */ + int (*p2p_oper)(const struct device *dev, struct wifi_p2p_params *params); +#endif }; /** Wi-Fi management offload API */ @@ -1916,6 +2029,17 @@ void wifi_mgmt_raise_ap_sta_connected_event(struct net_if *iface, void wifi_mgmt_raise_ap_sta_disconnected_event(struct net_if *iface, struct wifi_ap_sta_info *sta_info); +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +/** + * @brief Raise P2P device found event + * + * @param iface Network interface + * @param device_info P2P device information + */ +void wifi_mgmt_raise_p2p_device_found_event(struct net_if *iface, + struct wifi_p2p_device_info *peer_info); +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ + /** * @} */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 11c00de06b37..8555e91a1cf9 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -60,6 +60,14 @@ enum status_thread_state { static struct wifi_enterprise_creds_params enterprise_creds; #endif +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +#define P2P_CMD_BUF_SIZE 128 +#define P2P_RESP_BUF_SIZE 64 +#define P2P_PEER_INFO_SIZE 512 +#define P2P_ADDR_SIZE 32 +#define P2P_CMD_SIZE 64 +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ + K_MUTEX_DEFINE(wpa_supplicant_mutex); extern struct k_work_q *get_workq(void); @@ -2576,3 +2584,249 @@ int supplicant_config_params(const struct device *dev, struct wifi_config_params k_mutex_unlock(&wpa_supplicant_mutex); return ret; } + +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +static inline void extract_value(const char *src, char *dest, size_t dest_size) +{ + size_t i = 0; + + while (src[i] != '\0' && src[i] != '\n' && i < dest_size - 1) { + dest[i] = src[i]; + i++; + } + dest[i] = '\0'; +} + +static void parse_peer_info_line(const char *line, struct wifi_p2p_device_info *info) +{ + const char *pos; + + if (strncmp(line, "device_name=", 12) == 0) { + extract_value(line + 12, info->device_name, sizeof(info->device_name)); + } else if (strncmp(line, "pri_dev_type=", 13) == 0) { + extract_value(line + 13, info->pri_dev_type_str, sizeof(info->pri_dev_type_str)); + } else if (strncmp(line, "level=", 6) == 0) { + char *endptr; + long val; + + pos = line + 6; + val = strtol(pos, &endptr, 10); + if (endptr != pos && val >= INT8_MIN && val <= INT8_MAX) { + info->rssi = (int8_t)val; + } + } else if (strncmp(line, "config_methods=", 15) == 0) { + char *endptr; + long val; + + pos = line + 15; + extract_value(pos, info->config_methods_str, sizeof(info->config_methods_str)); + + if (pos[0] == '0' && (pos[1] == 'x' || pos[1] == 'X')) { + val = strtol(pos, &endptr, 16); + } else { + val = strtol(pos, &endptr, 10); + } + if (endptr != pos && val >= 0 && val <= UINT16_MAX) { + info->config_methods = (uint16_t)val; + } + } else if (strncmp(line, "manufacturer=", 13) == 0) { + extract_value(line + 13, info->manufacturer, sizeof(info->manufacturer)); + } else if (strncmp(line, "model_name=", 11) == 0) { + extract_value(line + 11, info->model_name, sizeof(info->model_name)); + } +} + +static void parse_peer_info_response(const char *resp, const uint8_t *mac, + struct wifi_p2p_device_info *info) +{ + const char *line = resp; + const char *next_line; + + memset(info, 0, sizeof(*info)); + + if (mac) { + memcpy(info->mac, mac, WIFI_MAC_ADDR_LEN); + } + + while (line && *line) { + if (*line == '\n') { + line++; + continue; + } + next_line = strchr(line, '\n'); + parse_peer_info_line(line, info); + if (next_line) { + line = next_line + 1; + } else { + break; + } + } +} + +int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params) +{ + struct wpa_supplicant *wpa_s = get_wpa_s_handle(dev); + char cmd_buf[P2P_CMD_BUF_SIZE]; + char resp_buf[P2P_RESP_BUF_SIZE]; + int ret = -1; + const char *discovery_type_str = ""; + + if (!wpa_s || !wpa_s->ctrl_conn) { + wpa_printf(MSG_ERROR, "wpa_supplicant control interface not initialized"); + return -ENOTSUP; + } + + switch (params->oper) { + case WIFI_P2P_FIND: + switch (params->discovery_type) { + case WIFI_P2P_FIND_ONLY_SOCIAL: + discovery_type_str = "type=social"; + break; + case WIFI_P2P_FIND_PROGRESSIVE: + discovery_type_str = "type=progressive"; + break; + case WIFI_P2P_FIND_START_WITH_FULL: + default: + discovery_type_str = ""; + break; + } + + if (params->timeout > 0) { + if (strlen(discovery_type_str) > 0) { + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_FIND %u %s", + params->timeout, discovery_type_str); + } else { + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_FIND %u", + params->timeout); + } + } else { + if (strlen(discovery_type_str) > 0) { + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_FIND %s", + discovery_type_str); + } else { + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_FIND"); + } + } + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); + if (ret < 0) { + wpa_printf(MSG_ERROR, "P2P_FIND command failed: %d", ret); + return -EIO; + } + ret = 0; + break; + + case WIFI_P2P_STOP_FIND: + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_STOP_FIND"); + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); + if (ret < 0) { + wpa_printf(MSG_ERROR, "P2P_STOP_FIND command failed: %d", ret); + return -EIO; + } + ret = 0; + break; + + case WIFI_P2P_PEER: { + char addr[P2P_ADDR_SIZE]; + char cmd[P2P_CMD_SIZE]; + char peer_info[P2P_PEER_INFO_SIZE]; + char *pos; + size_t len; + uint16_t peer_idx = 0; + uint8_t mac[WIFI_MAC_ADDR_LEN]; + struct net_eth_addr peer_mac; + bool query_all_peers; + + if (!params->peers) { + wpa_printf(MSG_ERROR, "Peer info array not provided"); + return -EINVAL; + } + + memcpy(&peer_mac, params->peer_addr, WIFI_MAC_ADDR_LEN); + query_all_peers = net_eth_is_addr_broadcast(&peer_mac); + + if (query_all_peers) { + os_strlcpy(cmd_buf, "P2P_PEER FIRST", sizeof(cmd_buf)); + + while (peer_idx < params->peer_count) { + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, + cmd_buf, resp_buf); + + if (ret < 0 || resp_buf[0] == '\0' || + os_strncmp(resp_buf, "FAIL", 4) == 0) { + if (peer_idx == 0) { + wpa_printf(MSG_DEBUG, "No P2P peers found"); + } + break; + } + + len = 0; + pos = resp_buf; + while (*pos != '\0' && *pos != '\n' && len < sizeof(addr) - 1) { + addr[len++] = *pos++; + } + addr[len] = '\0'; + + if (os_strncmp(addr, "00:00:00:00:00:00", 17) != 0 && + sscanf(addr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mac[0], &mac[1], &mac[2], + &mac[3], &mac[4], &mac[5]) == + WIFI_MAC_ADDR_LEN) { + + os_snprintf(cmd, sizeof(cmd), "P2P_PEER %s", addr); + ret = zephyr_wpa_cli_cmd_resp_noprint( + wpa_s->ctrl_conn, cmd, peer_info); + + if (ret >= 0 && + (!params->discovered_only || + os_strstr(peer_info, + "[PROBE_REQ_ONLY]") == NULL)) { + parse_peer_info_response(peer_info, + mac, + ¶ms->peers[peer_idx]); + peer_idx++; + } + } + os_snprintf(cmd_buf, sizeof(cmd_buf), "P2P_PEER NEXT-%s", addr); + } + params->peer_count = peer_idx; + } else { + char addr_str[18]; + + if (params->peer_count < 1) { + wpa_printf(MSG_ERROR, "Peer count must be at least 1"); + return -EINVAL; + } + + snprintk(addr_str, sizeof(addr_str), "%02x:%02x:%02x:%02x:%02x:%02x", + params->peer_addr[0], params->peer_addr[1], params->peer_addr[2], + params->peer_addr[3], params->peer_addr[4], params->peer_addr[5]); + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_PEER %s", addr_str); + + /* Use peer_info buffer for single peer query to avoid large resp_buf */ + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, + cmd_buf, peer_info); + if (ret < 0) { + wpa_printf(MSG_ERROR, "P2P_PEER command failed: %d", ret); + return -EIO; + } + if (os_strncmp(peer_info, "FAIL", 4) == 0) { + wpa_printf(MSG_ERROR, "Peer %s not found", addr_str); + return -ENODEV; + } + parse_peer_info_response(peer_info, params->peer_addr, + ¶ms->peers[0]); + params->peer_count = 1; + } + ret = 0; + break; + } + + default: + wpa_printf(MSG_ERROR, "Unknown P2P operation: %d", params->oper); + ret = -EINVAL; + break; + } + + return ret; +} +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ diff --git a/modules/hostap/src/supp_api.h b/modules/hostap/src/supp_api.h index 8ab49f177e70..692db61bf277 100644 --- a/modules/hostap/src/supp_api.h +++ b/modules/hostap/src/supp_api.h @@ -386,4 +386,16 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa * @return 0 for OK; -1 for ERROR */ int supplicant_config_params(const struct device *dev, struct wifi_config_params *params); + +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +/** + * @brief P2P operation + * + * @param dev Wi-Fi interface handle to use + * @param params P2P parameters + * @return 0 for OK; -1 for ERROR + */ +int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params); +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ + #endif /* ZEPHYR_SUPP_MGMT_H */ diff --git a/modules/hostap/src/supp_events.c b/modules/hostap/src/supp_events.c index c4175a416bea..ee6a05a568ec 100644 --- a/modules/hostap/src/supp_events.c +++ b/modules/hostap/src/supp_events.c @@ -43,6 +43,9 @@ static const struct wpa_supp_event_info { { "CTRL-EVENT-NETWORK-REMOVED", SUPPLICANT_EVENT_NETWORK_REMOVED }, { "CTRL-EVENT-DSCP-POLICY", SUPPLICANT_EVENT_DSCP_POLICY }, { "CTRL-EVENT-REGDOM-CHANGE", SUPPLICANT_EVENT_REGDOM_CHANGE }, +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + { "P2P-DEVICE-FOUND", SUPPLICANT_EVENT_P2P_DEVICE_FOUND }, +#endif }; static void copy_mac_addr(const unsigned int *src, uint8_t *dst) @@ -174,6 +177,43 @@ static int supplicant_process_status(struct supplicant_int_event_data *event_dat event_data->data_len = sizeof(data->bss_removed); copy_mac_addr(tmp_mac_addr, data->bss_removed.bssid); break; +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + case SUPPLICANT_EVENT_P2P_DEVICE_FOUND: + { + char *ptr, *name_start, *name_end; + unsigned int config_methods = 0; + + memset(&data->p2p_device_found, 0, sizeof(data->p2p_device_found)); + ret = sscanf(event_no_prefix, MACSTR, MACADDR2STR(tmp_mac_addr)); + if (ret > 0) { + copy_mac_addr(tmp_mac_addr, data->p2p_device_found.mac); + } + name_start = strstr(event_no_prefix, "name='"); + if (name_start) { + name_start += 6; + name_end = strchr(name_start, '\''); + if (name_end) { + size_t name_len = name_end - name_start; + + if (name_len >= sizeof(data->p2p_device_found.device_name)) { + name_len = sizeof(data->p2p_device_found.device_name) - 1; + } + memcpy(data->p2p_device_found.device_name, name_start, name_len); + data->p2p_device_found.device_name[name_len] = '\0'; + } + } + ptr = strstr(event_no_prefix, "config_methods="); + if (ptr) { + ret = sscanf(ptr, "config_methods=%x", &config_methods); + if (ret > 0) { + data->p2p_device_found.config_methods = config_methods; + } + } + event_data->data_len = sizeof(data->p2p_device_found); + ret = 1; + break; + } +#endif case SUPPLICANT_EVENT_TERMINATING: case SUPPLICANT_EVENT_SCAN_STARTED: case SUPPLICANT_EVENT_SCAN_RESULTS: @@ -386,8 +426,18 @@ int supplicant_send_wifi_mgmt_event(const char *ifname, enum net_event_wifi_cmd case NET_EVENT_WIFI_CMD_SUPPLICANT: event_data.data = &data; if (supplicant_process_status(&event_data, (char *)supplicant_status) > 0) { - net_mgmt_event_notify_with_info(NET_EVENT_SUPPLICANT_INT_EVENT, - iface, &event_data, sizeof(event_data)); +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + /* Handle P2P events directly */ + if (event_data.event == SUPPLICANT_EVENT_P2P_DEVICE_FOUND) { + wifi_mgmt_raise_p2p_device_found_event(iface, + &data.p2p_device_found); + } else { +#endif + net_mgmt_event_notify_with_info(NET_EVENT_SUPPLICANT_INT_EVENT, + iface, &event_data, sizeof(event_data)); +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + } +#endif } break; default: diff --git a/modules/hostap/src/supp_events.h b/modules/hostap/src/supp_events.h index 1c74af528492..6ff8812c2fb8 100644 --- a/modules/hostap/src/supp_events.h +++ b/modules/hostap/src/supp_events.h @@ -137,6 +137,10 @@ union supplicant_event_data { unsigned int id; } network_removed; +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + struct wifi_p2p_device_info p2p_device_found; +#endif + char supplicant_event_str[NM_WIFI_EVENT_STR_LEN]; }; @@ -158,6 +162,9 @@ enum supplicant_event_num { SUPPLICANT_EVENT_NETWORK_REMOVED, SUPPLICANT_EVENT_DSCP_POLICY, SUPPLICANT_EVENT_REGDOM_CHANGE, +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + SUPPLICANT_EVENT_P2P_DEVICE_FOUND, +#endif }; struct supplicant_int_event_data { diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index d1f8c360cb50..8afdba33b203 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -101,6 +101,9 @@ static const struct wifi_mgmt_ops mgmt_ops = { .enterprise_creds = supplicant_add_enterprise_creds, #endif .config_params = supplicant_config_params, +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + .p2p_oper = supplicant_p2p_oper, +#endif }; DEFINE_WIFI_NM_INSTANCE(wifi_supplicant, &mgmt_ops); @@ -245,6 +248,12 @@ static void zephyr_wpa_supplicant_msg(void *ctx, const char *txt, size_t len) supplicant_send_wifi_mgmt_event(wpa_s->ifname, NET_EVENT_WIFI_CMD_NEIGHBOR_REP_RECEIVED, (void *)txt, len); +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + } else if (strncmp(txt, "P2P-", 4) == 0) { + supplicant_send_wifi_mgmt_event(wpa_s->ifname, + NET_EVENT_WIFI_CMD_SUPPLICANT, + (void *)txt, len); +#endif } } diff --git a/subsys/net/l2/wifi/Kconfig b/subsys/net/l2/wifi/Kconfig index 63680dba9b30..eddfb7d4c30a 100644 --- a/subsys/net/l2/wifi/Kconfig +++ b/subsys/net/l2/wifi/Kconfig @@ -72,6 +72,15 @@ config WIFI_SHELL_MAX_AP_STA This option defines the maximum number of APs and STAs that can be managed in Wi-Fi shell. +config WIFI_P2P_MAX_PEERS + int "Maximum number of P2P peers that can be returned in a single query" + depends on WIFI_NM_WPA_SUPPLICANT_P2P + default 32 + range 1 256 + help + This option defines the maximum number of P2P peers that can be returned + in a single query operation. + config WIFI_NM bool "Wi-Fi Network manager support" help diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 6a97f8c0e61c..58d269e277be 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -1473,6 +1473,35 @@ static int wifi_set_bgscan(uint64_t mgmt_request, struct net_if *iface, void *da NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_BGSCAN, wifi_set_bgscan); #endif +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +static int wifi_p2p_oper(uint64_t mgmt_request, struct net_if *iface, + void *data, size_t len) +{ + const struct device *dev = net_if_get_device(iface); + const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_api(iface); + struct wifi_p2p_params *params = data; + + if (wifi_mgmt_api == NULL || wifi_mgmt_api->p2p_oper == NULL) { + return -ENOTSUP; + } + + if (!data || len != sizeof(*params)) { + return -EINVAL; + } + + return wifi_mgmt_api->p2p_oper(dev, params); +} + +NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_P2P_OPER, wifi_p2p_oper); + +void wifi_mgmt_raise_p2p_device_found_event(struct net_if *iface, + struct wifi_p2p_device_info *peer_info) +{ + net_mgmt_event_notify_with_info(NET_EVENT_WIFI_P2P_DEVICE_FOUND, + iface, peer_info, + sizeof(*peer_info)); +} +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS void wifi_mgmt_raise_raw_scan_result_event(struct net_if *iface, From 5806ffc2f8846201b21f164f8f325a7b93880a9d Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Wed, 29 Oct 2025 13:08:44 +0000 Subject: [PATCH 0600/3334] [nrf fromlist] net: wifi: Add Wi-Fi direct P2P discovery shell command support Add shell command support for P2P discovery. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- subsys/net/l2/wifi/wifi_shell.c | 234 +++++++++++++++++++++++++++++++- 1 file changed, 233 insertions(+), 1 deletion(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index de4d7e9d03cd..91e342f81bd0 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -46,7 +46,8 @@ LOG_MODULE_REGISTER(net_wifi_shell, LOG_LEVEL_INF); NET_EVENT_WIFI_AP_STA_CONNECTED |\ NET_EVENT_WIFI_AP_STA_DISCONNECTED|\ NET_EVENT_WIFI_SIGNAL_CHANGE |\ - NET_EVENT_WIFI_NEIGHBOR_REP_COMP) + NET_EVENT_WIFI_NEIGHBOR_REP_COMP |\ + NET_EVENT_WIFI_P2P_DEVICE_FOUND) #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS_ONLY #define WIFI_SHELL_SCAN_EVENTS ( \ @@ -519,6 +520,26 @@ static void handle_wifi_neighbor_rep_complete(struct net_mgmt_event_callback *cb } #endif +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +static void handle_wifi_p2p_device_found(struct net_mgmt_event_callback *cb) +{ + const struct wifi_p2p_device_info *peer_info = + (const struct wifi_p2p_device_info *)cb->info; + const struct shell *sh = context.sh; + + if (!peer_info || peer_info->device_name[0] == '\0') { + return; + } + + PR("Device Name: %-20s MAC Address: %02x:%02x:%02x:%02x:%02x:%02x " + "Config Methods: 0x%x\n", + peer_info->device_name, + peer_info->mac[0], peer_info->mac[1], peer_info->mac[2], + peer_info->mac[3], peer_info->mac[4], peer_info->mac[5], + peer_info->config_methods); +} +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ + static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, struct net_if *iface) { @@ -552,6 +573,11 @@ static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, handle_wifi_neighbor_rep_complete(cb, iface); break; #endif +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + case NET_EVENT_WIFI_P2P_DEVICE_FOUND: + handle_wifi_p2p_device_found(cb); + break; +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ default: break; } @@ -3528,6 +3554,180 @@ static int cmd_wifi_dpp_reconfig(const struct shell *sh, size_t argc, char *argv } #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */ + +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +static void print_peer_info(const struct shell *sh, int index, + const struct wifi_p2p_device_info *peer) +{ + uint8_t mac_string_buf[sizeof("xx:xx:xx:xx:xx:xx")]; + const char *device_name; + const char *device_type; + const char *config_methods; + + device_name = (peer->device_name[0] != '\0') ? + peer->device_name : ""; + device_type = (peer->pri_dev_type_str[0] != '\0') ? + peer->pri_dev_type_str : "-"; + config_methods = (peer->config_methods_str[0] != '\0') ? + peer->config_methods_str : "-"; + + PR("%-4d | %-32s | %-17s | %-4d | %-20s | %s\n", + index, + device_name, + net_sprint_ll_addr_buf(peer->mac, WIFI_MAC_ADDR_LEN, + mac_string_buf, + sizeof(mac_string_buf)), + peer->rssi, + device_type, + config_methods); +} + +static int cmd_wifi_p2p_peer(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_p2p_params params = {0}; + uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; + static struct wifi_p2p_device_info peers[WIFI_P2P_MAX_PEERS]; + int ret; + int max_peers = (argc < 2) ? WIFI_P2P_MAX_PEERS : 1; + + context.sh = sh; + + memset(peers, 0, sizeof(peers)); + + params.peers = peers; + params.oper = WIFI_P2P_PEER; + params.peer_count = max_peers; + + if (argc >= 2) { + if (sscanf(argv[1], "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mac_addr[0], &mac_addr[1], &mac_addr[2], + &mac_addr[3], &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { + PR_ERROR("Invalid MAC address format. Use: XX:XX:XX:XX:XX:XX\n"); + return -EINVAL; + } + memcpy(params.peer_addr, mac_addr, WIFI_MAC_ADDR_LEN); + params.peer_count = 1; + } else { + /* Use broadcast MAC to query all peers */ + memset(params.peer_addr, 0xFF, WIFI_MAC_ADDR_LEN); + } + + ret = net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params)); + if (ret) { + PR_WARNING("P2P peer info request failed\n"); + return -ENOEXEC; + } + + if (params.peer_count > 0) { + PR("\n%-4s | %-32s | %-17s | %-4s | %-20s | %s\n", + "Num", "Device Name", "MAC Address", "RSSI", "Device Type", "Config Methods"); + for (int i = 0; i < params.peer_count; i++) { + print_peer_info(sh, i + 1, &peers[i]); + } + } else { + if (argc >= 2) { + shell_print(sh, "No information available for peer %s", argv[1]); + } else { + shell_print(sh, "No P2P peers found"); + } + } + + return 0; +} + + +static int cmd_wifi_p2p_find(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_p2p_params params = {0}; + + context.sh = sh; + + params.oper = WIFI_P2P_FIND; + params.discovery_type = WIFI_P2P_FIND_START_WITH_FULL; + params.timeout = 10; /* Default 10 second timeout */ + + if (argc > 1) { + int opt; + int opt_index = 0; + struct sys_getopt_state *state; + static const struct sys_getopt_option long_options[] = { + {"timeout", sys_getopt_required_argument, 0, 't'}, + {"type", sys_getopt_required_argument, 0, 'T'}, + {"iface", sys_getopt_required_argument, 0, 'i'}, + {"help", sys_getopt_no_argument, 0, 'h'}, + {0, 0, 0, 0} + }; + long val; + + while ((opt = sys_getopt_long(argc, argv, "t:T:i:h", + long_options, &opt_index)) != -1) { + state = sys_getopt_state_get(); + switch (opt) { + case 't': + if (!parse_number(sh, &val, state->optarg, "timeout", 0, 65535)) { + return -EINVAL; + } + params.timeout = (uint16_t)val; + break; + case 'T': + if (!parse_number(sh, &val, state->optarg, "type", 0, 2)) { + return -EINVAL; + } + switch (val) { + case 0: + params.discovery_type = WIFI_P2P_FIND_ONLY_SOCIAL; + break; + case 1: + params.discovery_type = WIFI_P2P_FIND_PROGRESSIVE; + break; + case 2: + params.discovery_type = WIFI_P2P_FIND_START_WITH_FULL; + break; + default: + return -EINVAL; + } + break; + case 'i': + /* Unused, but parsing to avoid unknown option error */ + break; + case 'h': + shell_help(sh); + return -ENOEXEC; + default: + PR_ERROR("Invalid option %c\n", state->optopt); + return -EINVAL; + } + } + } + + if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { + PR_WARNING("P2P find request failed\n"); + return -ENOEXEC; + } + PR("P2P find started\n"); + return 0; +} + +static int cmd_wifi_p2p_stop_find(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_p2p_params params = {0}; + + context.sh = sh; + + params.oper = WIFI_P2P_STOP_FIND; + + if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { + PR_WARNING("P2P stop find request failed\n"); + return -ENOEXEC; + } + PR("P2P find stopped\n"); + return 0; +} +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ + static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); @@ -4232,6 +4432,38 @@ SHELL_SUBCMD_ADD((wifi), bgscan, NULL, 2, 6); #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN */ +#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P +SHELL_STATIC_SUBCMD_SET_CREATE( + wifi_cmd_p2p, + SHELL_CMD_ARG(find, NULL, + "Start P2P device discovery\n" + "[-t, --timeout=]: Discovery timeout\n" + "[-T, --type=<0|1|2>]: Discovery type\n" + " 0: Social channels only (1, 6, 11)\n" + " 1: Progressive scan (all channels)\n" + " 2: Full scan first, then social (default)\n" + "[-i, --iface=]: Interface index\n" + "[-h, --help]: Show help\n", + cmd_wifi_p2p_find, 1, 6), + SHELL_CMD_ARG(stop_find, NULL, + "Stop P2P device discovery\n" + "[-i, --iface=]: Interface index\n", + cmd_wifi_p2p_stop_find, 1, 2), + SHELL_CMD_ARG(peer, NULL, + "Show information about P2P peers\n" + "Usage: peer []\n" + ": Show detailed info for specific peer (format: XX:XX:XX:XX:XX:XX)\n" + "[-i, --iface=]: Interface index\n", + cmd_wifi_p2p_peer, 1, 3), + SHELL_SUBCMD_SET_END +); + +SHELL_SUBCMD_ADD((wifi), p2p, &wifi_cmd_p2p, + "Wi-Fi Direct (P2P) commands.", + NULL, + 0, 0); +#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ + SHELL_SUBCMD_ADD((wifi), config, NULL, "Configure STA parameters.\n" "-o, --okc=<0/1>: Opportunistic Key Caching. 0: disable, 1: enable\n" From 4d5da39ebc763281084f124da0f72b474f427f26 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Mon, 3 Nov 2025 12:48:53 +0000 Subject: [PATCH 0601/3334] [nrf fromlist] manifest: Update nrf_wifi revision Update nrf_wifi revision to include support for P2P feature. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 639d34d1900b..874653c839dd 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 5eec7aca321735f5fc8e3e7c79e162f0e9810b16 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: a39e9b155830461c9d1cf587afb151b894369b91 + revision: f0b6706cac522371e651f589d53d3026cc6f97dd path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From cb8c23c4b0a93bd6d01171b50fae316144dc891c Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 30 Oct 2025 19:48:21 +0530 Subject: [PATCH 0602/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Add RoC support Add ops for remain-on-channel and cancelling remain-on-channel. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/inc/wpa_supp_if.h | 8 ++ drivers/wifi/nrf_wifi/src/fmac_main.c | 4 + drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 141 ++++++++++++++++++++++++ 3 files changed, 153 insertions(+) diff --git a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h index c543644e3128..28aadae28ebd 100644 --- a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h +++ b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h @@ -123,8 +123,16 @@ int nrf_wifi_supp_get_conn_info(void *if_priv, struct wpa_conn_info *info); void nrf_wifi_supp_event_proc_get_conn_info(void *os_vif_ctx, struct nrf_wifi_umac_event_conn_info *info, unsigned int event_len); +void nrf_wifi_supp_event_remain_on_channel(void *os_vif_ctx, + struct nrf_wifi_event_remain_on_channel *info, + unsigned int event_len); +void nrf_wifi_supp_event_roc_cancel_complete(void *os_vif_ctx, + struct nrf_wifi_event_remain_on_channel *info, + unsigned int event_len); int nrf_wifi_supp_set_country(void *if_priv, const char *alpha2); int nrf_wifi_supp_get_country(void *if_priv, char *alpha2); +int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration); +int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv); #endif /* CONFIG_NRF70_STA_MODE */ #ifdef CONFIG_NRF70_AP_MODE diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 47ca53d5a61c..00ea3a873c85 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -843,6 +843,8 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) callbk_fns.event_get_wiphy = nrf_wifi_wpa_supp_event_get_wiphy; callbk_fns.mgmt_rx_callbk_fn = nrf_wifi_wpa_supp_event_mgmt_rx_callbk_fn; callbk_fns.get_conn_info_callbk_fn = nrf_wifi_supp_event_proc_get_conn_info; + callbk_fns.roc_callbk_fn = nrf_wifi_supp_event_remain_on_channel; + callbk_fns.roc_cancel_callbk_fn = nrf_wifi_supp_event_roc_cancel_complete; #endif /* CONFIG_NRF70_STA_MODE */ /* The OSAL layer needs to be initialized before any other initialization @@ -963,6 +965,8 @@ static const struct zep_wpa_supp_dev_ops wpa_supp_ops = { .get_conn_info = nrf_wifi_supp_get_conn_info, .set_country = nrf_wifi_supp_set_country, .get_country = nrf_wifi_supp_get_country, + .remain_on_channel = nrf_wifi_supp_remain_on_channel, + .cancel_remain_on_channel = nrf_wifi_supp_cancel_remain_on_channel, #ifdef CONFIG_NRF70_AP_MODE .init_ap = nrf_wifi_wpa_supp_init_ap, .start_ap = nrf_wifi_wpa_supp_start_ap, diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 0864a1a00fe3..3caf7f6af526 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1986,6 +1986,147 @@ void nrf_wifi_supp_event_proc_get_conn_info(void *if_priv, k_sem_give(&wait_for_event_sem); } +void nrf_wifi_supp_event_remain_on_channel(void *if_priv, + struct nrf_wifi_event_remain_on_channel *roc_complete, + unsigned int event_len) +{ + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; + + if (!if_priv) { + LOG_ERR("%s: Missing interface context", __func__); + return; + } + + vif_ctx_zep = if_priv; + + if (!roc_complete) { + LOG_ERR("%s: Missing ROC complete event data", __func__); + return; + } + + LOG_DBG("%s: ROC complete on freq %d, dur %d, vif_idx %d", + __func__, roc_complete->frequency, + roc_complete->dur, vif_ctx_zep->vif_idx); + + if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_complete) { + vif_ctx_zep->supp_callbk_fns.roc_complete(vif_ctx_zep->supp_drv_if_ctx, + roc_complete->frequency, + roc_complete->dur); + } +} + +void nrf_wifi_supp_event_roc_cancel_complete(void *if_priv, + struct nrf_wifi_event_remain_on_channel + *roc_cancel_complete, + unsigned int event_len) +{ + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; + + if (!if_priv) { + LOG_ERR("%s: Missing interface context", __func__); + return; + } + + vif_ctx_zep = if_priv; + + if (!roc_cancel_complete) { + LOG_ERR("%s: Missing ROC cancel complete event data", __func__); + return; + } + + LOG_DBG("%s: ROC cancel complete on freq %d, vif_idx %d", + __func__, roc_cancel_complete->frequency, + vif_ctx_zep->vif_idx); + + if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_cancel_complete) { + vif_ctx_zep->supp_callbk_fns.roc_cancel_complete(vif_ctx_zep->supp_drv_if_ctx, + roc_cancel_complete->frequency); + } +} + +int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, + unsigned int duration) +{ + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; +#ifdef NRF70_P2P_MODE + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; + struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + struct remain_on_channel_info roc_info; + + if (!if_priv) { + LOG_ERR("%s: Invalid params", __func__); + return -1; + } + + vif_ctx_zep = if_priv; + rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + if (!rpu_ctx_zep) { + LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); + return -1; + } + + k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); + if (!rpu_ctx_zep->rpu_ctx) { + LOG_DBG("%s: RPU context not initialized", __func__); + goto out; + } + + memset(&roc_info, 0, sizeof(roc_info)); + roc_info.nrf_wifi_freq_params.frequency = freq; + roc_info.nrf_wifi_freq_params.channel_width = NRF_WIFI_CHAN_WIDTH_20; + roc_info.nrf_wifi_freq_params.center_frequency1 = freq; + roc_info.nrf_wifi_freq_params.center_frequency2 = 0; + roc_info.nrf_wifi_freq_params.channel_type = NRF_WIFI_CHAN_HT20; + roc_info.dur = duration; + + status = nrf_wifi_sys_fmac_p2p_roc_start(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, + &roc_info); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: nrf_wifi_fmac_remain_on_channel failed", __func__); + goto out; + } +out: + k_mutex_unlock(&vif_ctx_zep->vif_lock); +#endif /* NRF70_P2P_MODE */ + return status; +} + +int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv) +{ + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; +#ifdef NRF70_P2P_MODE + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; + struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + + if (!if_priv) { + LOG_ERR("%s: Invalid params", __func__); + return -1; + } + + vif_ctx_zep = if_priv; + rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + if (!rpu_ctx_zep) { + LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); + return -1; + } + + k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); + if (!rpu_ctx_zep->rpu_ctx) { + LOG_DBG("%s: RPU context not initialized", __func__); + goto out; + } + + status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, 0); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: nrf_wifi_fmac_cancel_remain_on_channel failed", __func__); + goto out; + } +out: + k_mutex_unlock(&vif_ctx_zep->vif_lock); +#endif /* NRF70_P2P_MODE */ + return status; +} + #ifdef CONFIG_NRF70_AP_MODE static int nrf_wifi_vif_state_change(struct nrf_wifi_vif_ctx_zep *vif_ctx_zep, enum nrf_wifi_fmac_if_op_state state) From 0578e64ab22aeb3fe2b837996d1f38f61aa7b19d Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 30 Oct 2025 19:51:45 +0530 Subject: [PATCH 0603/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Allow off channel TX for probe responses For frames sent down by supplicant in station mode, inform RPU to allow off-channel transmission. This is needed for sending P2P probe responses. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 3caf7f6af526..a3f562ed138b 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1435,6 +1435,10 @@ int nrf_wifi_nl80211_send_mlme(void *if_priv, const u8 *data, goto out; } + if (vif_ctx_zep->if_type == NRF_WIFI_IFTYPE_STATION) { + offchanok = 1; + } + if (offchanok) { mgmt_tx_info->nrf_wifi_flags |= NRF_WIFI_CMD_FRAME_OFFCHANNEL_TX_OK; } From dfcf0e426d40e9ea573acded654ae266d60207af Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 30 Oct 2025 20:04:00 +0530 Subject: [PATCH 0604/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Register frame without match For frames like Probe Requests, there is no match criterion. Re-arrange the checks to support registering of frames without providing any matching info. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index a3f562ed138b..fabf2df96f87 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1702,7 +1702,7 @@ int nrf_wifi_supp_register_frame(void *if_priv, struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; struct nrf_wifi_umac_mgmt_frame_info frame_info; - if (!if_priv || !match || !match_len) { + if (!if_priv) { LOG_ERR("%s: Invalid parameters", __func__); return -1; } @@ -1723,8 +1723,14 @@ int nrf_wifi_supp_register_frame(void *if_priv, memset(&frame_info, 0, sizeof(frame_info)); frame_info.frame_type = type; - frame_info.frame_match.frame_match_len = match_len; - memcpy(frame_info.frame_match.frame_match, match, match_len); + if (match_len > 0) { + if (!match) { + LOG_ERR("%s: Invalid match parameters", __func__); + goto out; + } + frame_info.frame_match.frame_match_len = match_len; + memcpy(frame_info.frame_match.frame_match, match, match_len); + } status = nrf_wifi_sys_fmac_register_frame(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &frame_info); From fdb4ae6a8c2e5817e9fb93eef61f18a71588c312 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 30 Oct 2025 20:15:39 +0530 Subject: [PATCH 0605/3334] [nrf fromlist] modules: hostap: Define heap and stack for P2P support Increase required heap and stack size for P2P. More stack was required during WPS negotiation. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- modules/hostap/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 9eac239daa7d..ec8263d85a6b 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -46,6 +46,7 @@ config HEAP_MEM_POOL_ADD_SIZE_HOSTAP def_int 66560 if WIFI_NM_HOSTAPD_AP def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE + def_int 80000 if WIFI_NM_WPA_SUPPLICANT_P2P def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP # 30K is mandatory, but might need more for long duration use cases def_int 30000 @@ -54,6 +55,7 @@ endif # WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE int "Stack size for wpa_supplicant thread" + default 10000 if WIFI_NM_WPA_SUPPLICANT_P2P # TODO: Providing higher stack size for Enterprise mode to fix stack # overflow issues. Need to identify the cause for higher stack usage. default 8192 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE From 6ae88163db75d06a70460f0a654ad4c4f5a8c59f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 31 Oct 2025 04:07:05 +0530 Subject: [PATCH 0606/3334] [nrf fromlist] modules: hostap: Remove obsolete conditional We now support a single MbedTLS shim for hostap, so, this extra check is not needed, we can always use DH5 groups from Mbedtls. Upstream PR #: 97183 Signed-off-by: Chaitanya Tata --- modules/hostap/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 106d31b8cca4..dfa542233eef 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -385,14 +385,6 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS ${HOSTAP_SRC_BASE}/crypto/dh_groups.c ) -if(NOT CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT) -# dh_group5 is only needed if we are not using mbedtls, as mbedtls provides -# its own definition -zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS - ${HOSTAP_SRC_BASE}/crypto/dh_group5.c -) -endif() - zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P CONFIG_P2P CONFIG_GAS From bb791a6c6da5e80f0e94e2536bee901af537b70d Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Fri, 31 Oct 2025 07:30:40 +0000 Subject: [PATCH 0607/3334] [nrf fromlist] net: wifi: Add Wi-Fi direct P2P connect API support Add structures and API support for P2P connect. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- include/zephyr/net/wifi_mgmt.h | 26 +++++++++++ modules/hostap/src/supp_api.c | 81 ++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index ef0a6bac27cf..6cc7039ade66 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -1465,6 +1465,8 @@ enum wifi_p2p_op { * or specific MAC address to query a single peer */ WIFI_P2P_PEER, + /** P2P connect to peer */ + WIFI_P2P_CONNECT, }; /** Wi-Fi P2P discovery type */ @@ -1477,6 +1479,16 @@ enum wifi_p2p_discovery_type { WIFI_P2P_FIND_PROGRESSIVE, }; +/** Wi-Fi P2P connection method */ +enum wifi_p2p_connection_method { + /** Push Button Configuration */ + WIFI_P2P_METHOD_PBC = 0, + /** Display PIN (device displays PIN for peer to enter) */ + WIFI_P2P_METHOD_DISPLAY, + /** Keypad PIN (user enters PIN on device) */ + WIFI_P2P_METHOD_KEYPAD, +}; + /** Maximum number of P2P peers that can be returned in a single query */ #define WIFI_P2P_MAX_PEERS CONFIG_WIFI_P2P_MAX_PEERS @@ -1496,6 +1508,20 @@ struct wifi_p2p_params { struct wifi_p2p_device_info *peers; /** Actual number of peers returned */ uint16_t peer_count; + /** Connect specific parameters */ + struct { + /** Connection method */ + enum wifi_p2p_connection_method method; + /** PIN for display/keypad methods (8 digits) + * - For DISPLAY: Leave empty, PIN will be generated and returned + * - For KEYPAD: Provide the PIN to use for connection + */ + char pin[WIFI_WPS_PIN_MAX_LEN + 1]; + /** GO intent (0-15, higher values indicate higher willingness to be GO) */ + uint8_t go_intent; + /** Frequency in MHz (0 = not specified, use default) */ + unsigned int freq; + } connect; }; #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 8555e91a1cf9..8126b92274e1 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -2821,6 +2821,87 @@ int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params break; } + case WIFI_P2P_CONNECT: { + char addr_str[18]; + const char *method_str = ""; + char freq_str[32] = ""; + + if (!params) { + wpa_printf(MSG_ERROR, "P2P connect params are NULL"); + return -EINVAL; + } + + snprintk(addr_str, sizeof(addr_str), "%02x:%02x:%02x:%02x:%02x:%02x", + params->peer_addr[0], params->peer_addr[1], params->peer_addr[2], + params->peer_addr[3], params->peer_addr[4], params->peer_addr[5]); + + /* Add frequency parameter if specified */ + if (params->connect.freq > 0) { + snprintk(freq_str, sizeof(freq_str), " freq=%u", params->connect.freq); + } + + switch (params->connect.method) { + case WIFI_P2P_METHOD_PBC: + method_str = "pbc"; + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_CONNECT %s %s go_intent=%d%s", + addr_str, method_str, params->connect.go_intent, freq_str); + break; + case WIFI_P2P_METHOD_DISPLAY: + method_str = "pin"; + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_CONNECT %s %s go_intent=%d%s", + addr_str, method_str, params->connect.go_intent, freq_str); + break; + case WIFI_P2P_METHOD_KEYPAD: + method_str = "keypad"; + if (params->connect.pin[0] == '\0') { + wpa_printf(MSG_ERROR, "PIN required for keypad method"); + return -EINVAL; + } + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_CONNECT %s %s %s go_intent=%d%s", + addr_str, method_str, params->connect.pin, + params->connect.go_intent, freq_str); + break; + default: + wpa_printf(MSG_ERROR, "Unknown P2P connection method: %d", + params->connect.method); + return -EINVAL; + } + + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); + if (ret < 0) { + wpa_printf(MSG_ERROR, "P2P_CONNECT command failed: %d", ret); + return -EIO; + } + if (os_strncmp(resp_buf, "FAIL", 4) == 0) { + wpa_printf(MSG_ERROR, "P2P connect failed: %s", resp_buf); + return -ENODEV; + } + + /* For DISPLAY method, capture the generated PIN from response */ + if (params->connect.method == WIFI_P2P_METHOD_DISPLAY) { + size_t len = 0; + char *pos = resp_buf; + + while (*pos == ' ' || *pos == '\t' || *pos == '\n') { + pos++; + } + + while (*pos != '\0' && *pos != '\n' && *pos != ' ' && + len < WIFI_WPS_PIN_MAX_LEN) { + params->connect.pin[len++] = *pos++; + } + params->connect.pin[len] = '\0'; + + if (params->connect.pin[0] == '\0') { + wpa_printf(MSG_ERROR, "P2P connect: No PIN returned"); + return -ENODEV; + } + } + + ret = 0; + break; + } + default: wpa_printf(MSG_ERROR, "Unknown P2P operation: %d", params->oper); ret = -EINVAL; From 1a582c274b1538e11d609ca43fe41c2a822d4270 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Wed, 12 Nov 2025 09:53:18 +0000 Subject: [PATCH 0608/3334] [nrf fromlist] net: wifi: Add Wi-Fi direct P2P connect shell command support Add shell command support for P2P connect. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- subsys/net/l2/wifi/wifi_shell.c | 117 ++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 91e342f81bd0..b468212589ed 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3726,6 +3726,106 @@ static int cmd_wifi_p2p_stop_find(const struct shell *sh, size_t argc, char *arg PR("P2P find stopped\n"); return 0; } + +static int cmd_wifi_p2p_connect(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_p2p_params params = {0}; + uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; + const char *method_arg = NULL; + int opt; + int opt_index = 0; + struct sys_getopt_state *state; + static const struct sys_getopt_option long_options[] = { + {"go-intent", sys_getopt_required_argument, 0, 'g'}, + {"freq", sys_getopt_required_argument, 0, 'f'}, + {"iface", sys_getopt_required_argument, 0, 'i'}, + {"help", sys_getopt_no_argument, 0, 'h'}, + {0, 0, 0, 0} + }; + long val; + + context.sh = sh; + + if (argc < 3) { + PR_ERROR("Usage: wifi p2p connect [PIN] " + "[--go-intent=<0-15>] [--freq=]\n"); + return -EINVAL; + } + + /* Parse MAC address */ + if (sscanf(argv[1], "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mac_addr[0], &mac_addr[1], &mac_addr[2], + &mac_addr[3], &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { + PR_ERROR("Invalid MAC address format. Use: XX:XX:XX:XX:XX:XX\n"); + return -EINVAL; + } + memcpy(params.peer_addr, mac_addr, WIFI_MAC_ADDR_LEN); + + method_arg = argv[2]; + if (strcmp(method_arg, "pbc") == 0) { + params.connect.method = WIFI_P2P_METHOD_PBC; + } else if (strcmp(method_arg, "pin") == 0) { + if (argc > 3 && argv[3][0] != '-') { + params.connect.method = WIFI_P2P_METHOD_KEYPAD; + strncpy(params.connect.pin, argv[3], WIFI_WPS_PIN_MAX_LEN); + params.connect.pin[WIFI_WPS_PIN_MAX_LEN] = '\0'; + } else { + params.connect.method = WIFI_P2P_METHOD_DISPLAY; + params.connect.pin[0] = '\0'; + } + } else { + PR_ERROR("Invalid connection method. Use: pbc or pin\n"); + return -EINVAL; + } + + /* Set default GO intent */ + params.connect.go_intent = 0; + /* Set default frequency to 2462 MHz (channel 11, 2.4 GHz) */ + params.connect.freq = 2462; + + while ((opt = sys_getopt_long(argc, argv, "g:f:i:h", long_options, &opt_index)) != -1) { + state = sys_getopt_state_get(); + switch (opt) { + case 'g': + if (!parse_number(sh, &val, state->optarg, "go-intent", 0, 15)) { + return -EINVAL; + } + params.connect.go_intent = (uint8_t)val; + break; + case 'f': + if (!parse_number(sh, &val, state->optarg, "freq", 0, 6000)) { + return -EINVAL; + } + params.connect.freq = (unsigned int)val; + break; + case 'i': + /* Unused, but parsing to avoid unknown option error */ + break; + case 'h': + shell_help(sh); + return -ENOEXEC; + default: + PR_ERROR("Invalid option %c\n", state->optopt); + return -EINVAL; + } + } + + params.oper = WIFI_P2P_CONNECT; + + if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { + PR_WARNING("P2P connect request failed\n"); + return -ENOEXEC; + } + + /* Display the generated PIN for DISPLAY method */ + if (params.connect.method == WIFI_P2P_METHOD_DISPLAY && params.connect.pin[0] != '\0') { + PR("%s\n", params.connect.pin); + } else { + PR("P2P connection initiated\n"); + } + return 0; +} #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[]) @@ -4455,6 +4555,23 @@ SHELL_STATIC_SUBCMD_SET_CREATE( ": Show detailed info for specific peer (format: XX:XX:XX:XX:XX:XX)\n" "[-i, --iface=]: Interface index\n", cmd_wifi_p2p_peer, 1, 3), + SHELL_CMD_ARG(connect, NULL, + "Connect to a P2P peer\n" + "Usage: connect [PIN] [options]\n" + ": Peer device MAC address (format: XX:XX:XX:XX:XX:XX)\n" + ": Use Push Button Configuration\n" + ": Use PIN method\n" + " - Without PIN: Device displays generated PIN for peer to enter\n" + " - With PIN: Device uses provided PIN to connect\n" + "[PIN]: 8-digit PIN (optional, generates if omitted)\n" + "[-g, --go-intent=<0-15>]: GO intent (0=client, 15=GO, default: 0)\n" + "[-f, --freq=]: Frequency in MHz (default: 2462)\n" + "[-i, --iface=]: Interface index\n" + "[-h, --help]: Show help\n" + "Examples:\n" + " wifi p2p connect 9c:b1:50:e3:81:96 pin -g 0 (displays PIN)\n" + " wifi p2p connect 9c:b1:50:e3:81:96 pin 12345670 -g 0 (uses PIN)\n", + cmd_wifi_p2p_connect, 3, 5), SHELL_SUBCMD_SET_END ); From 0571e4875a64afcbdcb45eed2fa30d47792e472a Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Fri, 7 Nov 2025 08:33:54 +0000 Subject: [PATCH 0609/3334] [nrf fromlist] drivers: nrf_wifi: Add default value to p2p mode Kconfig The Kconfig NRF70_P2P_MODE should be enabled when WIFI_NM_WPA_SUPPLICANT_P2P is enabled. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 2021d25580ae..be0ea854b2e2 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -119,6 +119,7 @@ config NRF70_ENABLE_DUAL_VIF config NRF70_P2P_MODE bool "P2P support in driver" + default y if WIFI_NM_WPA_SUPPLICANT_P2P config NRF70_SYSTEM_WITH_RAW_MODES bool "nRF70 system mode with raw modes" From d8aae7024de29bf4430c8369413b09275e8478f0 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Wed, 12 Nov 2025 12:32:52 +0530 Subject: [PATCH 0610/3334] [nrf fromlist] modules: hostap: Add support for P2P GO mode ops Enable build time configs required for supporting P2P GO mode. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- modules/hostap/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index dfa542233eef..42ccd291fb10 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -383,6 +383,9 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS ${HOSTAP_SRC_BASE}/wps/wps_enrollee.c ${HOSTAP_SRC_BASE}/wps/wps_registrar.c ${HOSTAP_SRC_BASE}/crypto/dh_groups.c + ${HOSTAP_SRC_BASE}/eap_server/eap_server_wsc.c + ${HOSTAP_SRC_BASE}/eap_server/eap_server.c + ${HOSTAP_SRC_BASE}/eap_server/eap_server_methods.c ) zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P @@ -394,6 +397,7 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS CONFIG_WPS EAP_WSC + EAP_SERVER_WSC ) zephyr_library_sources_ifdef(CONFIG_WIFI_NM_HOSTAPD_WPS From f39dddd0880a7afc27a317671df41be23a553399 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Wed, 12 Nov 2025 13:00:08 +0530 Subject: [PATCH 0611/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Add per-peer authorized flag Add per-peer authorized parameter. Port authorization command from supplicant will set this flag and will be used by driver to allow or nor allow data traffic. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 3 --- drivers/wifi/nrf_wifi/src/net_if.c | 15 +++++++++-- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 32 ++++++++++++++++++------ drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 33 +++++++++++++++++++++++-- 4 files changed, 69 insertions(+), 14 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 799beff1fbaf..be8c9d763679 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -75,9 +75,6 @@ struct nrf_wifi_vif_ctx_zep { #endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ struct net_stats_eth eth_stats; #endif /* CONFIG_NET_STATISTICS_ETHERNET */ -#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) - bool authorized; -#endif #ifdef CONFIG_NRF70_STA_MODE unsigned int assoc_freq; enum nrf_wifi_fmac_if_carr_state if_carr_state; diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 0662c6c80d09..1e85c2e77626 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -25,6 +25,7 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include "util.h" #include "common/fmac_util.h" +#include "system/fmac_peer.h" #include "shim.h" #include "fmac_main.h" #include "wpa_supp_if.h" @@ -388,6 +389,8 @@ int nrf_wifi_if_send(const struct device *dev, struct rpu_host_stats *host_stats = NULL; void *nbuf = NULL; bool locked = false; + unsigned char *ra = NULL; + int peer_id = -1; if (!dev || !pkt) { LOG_ERR("%s: vif_ctx_zep is NULL", __func__); @@ -436,12 +439,20 @@ int nrf_wifi_if_send(const struct device *dev, nbuf); } else { #endif /* CONFIG_NRF70_RAW_DATA_TX */ + + ra = nrf_wifi_util_get_ra(sys_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx], nbuf); + peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, ra); + if (peer_id == -1) { + nrf_wifi_osal_log_dbg("%s: Invalid peer", + __func__); + goto out; + } + if ((vif_ctx_zep->if_carr_state != NRF_WIFI_FMAC_IF_CARR_STATE_ON) || - (!vif_ctx_zep->authorized && !is_eapol(pkt))) { + (!sys_dev_ctx->tx_config.peers[peer_id].authorized && !is_eapol(pkt))) { ret = -EPERM; goto drop; } - ret = nrf_wifi_fmac_start_xmit(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, nbuf); diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 6bb31241b295..4c98ef0d8aa0 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -18,6 +18,7 @@ #include "system/fmac_api.h" #include "system/fmac_tx.h" #include "common/fmac_util.h" +#include "common/fmac_structs_common.h" #include "fmac_main.h" #include "wifi_mgmt.h" @@ -757,6 +758,8 @@ int nrf_wifi_mode(const struct device *dev, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; + struct peers_info *peer = NULL; + int i = 0; int ret = -1; if (!dev || !mode) { @@ -798,10 +801,16 @@ int nrf_wifi_mode(const struct device *dev, goto out; } - if (vif_ctx_zep->authorized && (mode->mode == NRF_WIFI_MONITOR_MODE)) { - LOG_ERR("%s: Cannot set monitor mode when station is connected", - __func__); - goto out; + for (i = 0; i < MAX_PEERS; i++) { + peer = &sys_dev_ctx->tx_config.peers[i]; + if (peer->peer_id == -1) { + continue; + } + if (peer->authorized && (mode->mode == NRF_WIFI_MONITOR_MODE)) { + LOG_ERR("%s: Cannot set monitor mode when station is connected", + __func__); + goto out; + } } /** @@ -851,6 +860,8 @@ int nrf_wifi_channel(const struct device *dev, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; + struct peers_info *peer = NULL; + int i = 0; int ret = -1; if (!dev || !channel) { @@ -864,9 +875,16 @@ int nrf_wifi_channel(const struct device *dev, return ret; } - if (vif_ctx_zep->authorized) { - LOG_ERR("%s: Cannot change channel when in station connected mode", __func__); - return ret; + for (i = 0; i < MAX_PEERS; i++) { + peer = &sys_dev_ctx->tx_config.peers[i]; + if (peer->peer_id == -1) { + continue; + } + if (peer->authorized) { + LOG_ERR("%s: Cannot change channel when in station connected mode", + __func__); + return ret; + } } rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index fabf2df96f87..a15d66276c7a 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -17,6 +17,7 @@ #include "common/fmac_util.h" #include "wifi_mgmt.h" #include "wpa_supp_if.h" +#include LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); @@ -1103,7 +1104,9 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_umac_chg_sta_info chg_sta_info; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + int peer_id = -1; int ret = -1; if (!if_priv || !bssid) { @@ -1134,8 +1137,6 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) memcpy(chg_sta_info.mac_addr, bssid, ETH_ALEN); - vif_ctx_zep->authorized = authorized; - if (authorized) { /* BIT(NL80211_STA_FLAG_AUTHORIZED) */ chg_sta_info.sta_flags2.nrf_wifi_mask = 1 << 1; @@ -1153,6 +1154,19 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) goto out; } + sys_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); + + peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, chg_sta_info.mac_addr); + if (peer_id == -1) { + nrf_wifi_osal_log_err("%s: Invalid peer", + __func__); + goto out; + } + + if (chg_sta_info.sta_flags2.nrf_wifi_set & NRF_WIFI_STA_FLAG_AUTHORIZED) { + sys_dev_ctx->tx_config.peers[peer_id].authorized = true; + } + ret = 0; out: k_mutex_unlock(&vif_ctx_zep->vif_lock); @@ -2939,7 +2953,9 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_umac_chg_sta_info chg_sta = {0}; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + int peer_id = -1; int ret = -1; if (!if_priv || !addr) { @@ -2974,6 +2990,19 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, goto out; } + sys_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); + + peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, chg_sta.mac_addr); + if (peer_id == -1) { + nrf_wifi_osal_log_err("%s: Invalid peer", + __func__); + goto out; + } + + if (chg_sta.sta_flags2.nrf_wifi_set & NRF_WIFI_STA_FLAG_AUTHORIZED) { + sys_dev_ctx->tx_config.peers[peer_id].authorized = true; + } + ret = 0; out: From 56cb22713f6365998253a747891232eefdbf71f8 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Thu, 13 Nov 2025 09:09:07 +0000 Subject: [PATCH 0612/3334] [nrf fromlist] net: wifi: Add API support for P2P GO mode Add structures and API support for P2P Go mode. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- include/zephyr/net/wifi_mgmt.h | 50 ++++++++++++ modules/hostap/src/supp_api.c | 141 +++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 6cc7039ade66..389ab70d7e7e 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -1467,6 +1467,12 @@ enum wifi_p2p_op { WIFI_P2P_PEER, /** P2P connect to peer */ WIFI_P2P_CONNECT, + /** P2P group add */ + WIFI_P2P_GROUP_ADD, + /** P2P group remove */ + WIFI_P2P_GROUP_REMOVE, + /** P2P invite */ + WIFI_P2P_INVITE, }; /** Wi-Fi P2P discovery type */ @@ -1522,6 +1528,50 @@ struct wifi_p2p_params { /** Frequency in MHz (0 = not specified, use default) */ unsigned int freq; } connect; + /** Group add specific parameters */ + struct { + /** Frequency in MHz (0 = auto) */ + int freq; + /** Persistent group ID (-1 = not persistent) */ + int persistent; + /** Enable HT40 */ + bool ht40; + /** Enable VHT */ + bool vht; + /** Enable HE */ + bool he; + /** Enable EDMG */ + bool edmg; + /** GO BSSID (NULL = auto) */ + uint8_t go_bssid[WIFI_MAC_ADDR_LEN]; + /** GO BSSID length */ + uint8_t go_bssid_length; + } group_add; + /** Group remove specific parameters */ + struct { + /** Interface name (e.g., "wlan0") */ + char ifname[CONFIG_NET_INTERFACE_NAME_LEN + 1]; + } group_remove; + /** Invite specific parameters */ + struct { + /** Invite type: persistent or group */ + enum { + WIFI_P2P_INVITE_PERSISTENT = 0, + WIFI_P2P_INVITE_GROUP, + } type; + /** Persistent group ID (for persistent type) */ + int persistent_id; + /** Group interface name (for group type) */ + char group_ifname[CONFIG_NET_INTERFACE_NAME_LEN + 1]; + /** Peer MAC address */ + uint8_t peer_addr[WIFI_MAC_ADDR_LEN]; + /** Frequency in MHz (0 = auto) */ + int freq; + /** GO device address (for group type, NULL = auto) */ + uint8_t go_dev_addr[WIFI_MAC_ADDR_LEN]; + /** GO device address length */ + uint8_t go_dev_addr_length; + } invite; }; #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 8126b92274e1..2532a11f865e 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -2902,6 +2902,147 @@ int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params break; } + case WIFI_P2P_GROUP_ADD: { + int len = 0; + + if (!params) { + wpa_printf(MSG_ERROR, "P2P group add params are NULL"); + return -EINVAL; + } + + len = snprintk(cmd_buf, sizeof(cmd_buf), "P2P_GROUP_ADD"); + + if (params->group_add.freq > 0) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " freq=%d", + params->group_add.freq); + } + + if (params->group_add.persistent >= 0) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " persistent=%d", + params->group_add.persistent); + } + + if (params->group_add.ht40) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " ht40"); + } + + if (params->group_add.vht) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " vht"); + } + + if (params->group_add.he) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " he"); + } + + if (params->group_add.edmg) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " edmg"); + } + + if (params->group_add.go_bssid_length == WIFI_MAC_ADDR_LEN) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, + " go_bssid=%02x:%02x:%02x:%02x:%02x:%02x", + params->group_add.go_bssid[0], + params->group_add.go_bssid[1], + params->group_add.go_bssid[2], + params->group_add.go_bssid[3], + params->group_add.go_bssid[4], + params->group_add.go_bssid[5]); + } + + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); + if (ret < 0) { + wpa_printf(MSG_ERROR, "P2P_GROUP_ADD command failed: %d", ret); + return -EIO; + } + ret = 0; + break; + } + + case WIFI_P2P_GROUP_REMOVE: + if (!params) { + wpa_printf(MSG_ERROR, "P2P group remove params are NULL"); + return -EINVAL; + } + + if (params->group_remove.ifname[0] == '\0') { + wpa_printf(MSG_ERROR, "Interface name required for P2P_GROUP_REMOVE"); + return -EINVAL; + } + + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_GROUP_REMOVE %s", + params->group_remove.ifname); + + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); + if (ret < 0) { + wpa_printf(MSG_ERROR, "P2P_GROUP_REMOVE command failed: %d", ret); + return -EIO; + } + ret = 0; + break; + + case WIFI_P2P_INVITE: { + char addr_str[18]; + int len = 0; + + if (!params) { + wpa_printf(MSG_ERROR, "P2P invite params are NULL"); + return -EINVAL; + } + + snprintk(addr_str, sizeof(addr_str), "%02x:%02x:%02x:%02x:%02x:%02x", + params->invite.peer_addr[0], params->invite.peer_addr[1], + params->invite.peer_addr[2], params->invite.peer_addr[3], + params->invite.peer_addr[4], params->invite.peer_addr[5]); + + if (params->invite.type == WIFI_P2P_INVITE_PERSISTENT) { + if (params->invite.persistent_id < 0) { + wpa_printf(MSG_ERROR, "Persistent group ID required"); + return -EINVAL; + } + len = snprintk(cmd_buf, sizeof(cmd_buf), "P2P_INVITE persistent=%d peer=%s", + params->invite.persistent_id, addr_str); + + if (params->invite.freq > 0) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " freq=%d", + params->invite.freq); + } + } else if (params->invite.type == WIFI_P2P_INVITE_GROUP) { + if (params->invite.group_ifname[0] == '\0') { + wpa_printf(MSG_ERROR, "Group interface name required"); + return -EINVAL; + } + len = snprintk(cmd_buf, sizeof(cmd_buf), "P2P_INVITE group=%s peer=%s", + params->invite.group_ifname, addr_str); + + if (params->invite.freq > 0) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " freq=%d", + params->invite.freq); + } + + if (params->invite.go_dev_addr_length == WIFI_MAC_ADDR_LEN) { + len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, + " go_dev_addr=%02x:%02x:%02x:%02x:%02x:%02x", + params->invite.go_dev_addr[0], + params->invite.go_dev_addr[1], + params->invite.go_dev_addr[2], + params->invite.go_dev_addr[3], + params->invite.go_dev_addr[4], + params->invite.go_dev_addr[5]); + } + } else { + wpa_printf(MSG_ERROR, "Invalid invite type: %d", params->invite.type); + return -EINVAL; + } + + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); + if (ret < 0) { + wpa_printf(MSG_ERROR, "P2P_INVITE command failed: %d", ret); + return -EIO; + } + ret = 0; + break; + } + default: wpa_printf(MSG_ERROR, "Unknown P2P operation: %d", params->oper); ret = -EINVAL; From 3d0beda7f7c538e8e62bd714130aa4ebf6997175 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Thu, 13 Nov 2025 09:10:42 +0000 Subject: [PATCH 0613/3334] [nrf fromlist] net: wifi: Add Wi-Fi direct P2P GO mode shell command Add shell commands support for P2P GO mode. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- subsys/net/l2/wifi/wifi_shell.c | 279 ++++++++++++++++++++++++++++++++ 1 file changed, 279 insertions(+) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index b468212589ed..71ff72eff5dc 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3826,6 +3826,256 @@ static int cmd_wifi_p2p_connect(const struct shell *sh, size_t argc, char *argv[ } return 0; } + +static int cmd_wifi_p2p_group_add(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_p2p_params params = {0}; + int opt; + int opt_index = 0; + struct sys_getopt_state *state; + static const struct sys_getopt_option long_options[] = { + {"freq", sys_getopt_required_argument, 0, 'f'}, + {"persistent", sys_getopt_required_argument, 0, 'p'}, + {"ht40", sys_getopt_no_argument, 0, 'h'}, + {"vht", sys_getopt_no_argument, 0, 'v'}, + {"he", sys_getopt_no_argument, 0, 'H'}, + {"edmg", sys_getopt_no_argument, 0, 'e'}, + {"go-bssid", sys_getopt_required_argument, 0, 'b'}, + {"iface", sys_getopt_required_argument, 0, 'i'}, + {"help", sys_getopt_no_argument, 0, '?'}, + {0, 0, 0, 0} + }; + long val; + uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; + + context.sh = sh; + + params.oper = WIFI_P2P_GROUP_ADD; + params.group_add.freq = 0; + params.group_add.persistent = -1; + params.group_add.ht40 = false; + params.group_add.vht = false; + params.group_add.he = false; + params.group_add.edmg = false; + params.group_add.go_bssid_length = 0; + + while ((opt = sys_getopt_long(argc, argv, "f:p:hvHeb:i:?", long_options, + &opt_index)) != -1) { + state = sys_getopt_state_get(); + switch (opt) { + case 'f': + if (!parse_number(sh, &val, state->optarg, "freq", 0, 6000)) { + return -EINVAL; + } + params.group_add.freq = (int)val; + break; + case 'p': + if (!parse_number(sh, &val, state->optarg, "persistent", -1, 255)) { + return -EINVAL; + } + params.group_add.persistent = (int)val; + break; + case 'h': + params.group_add.ht40 = true; + break; + case 'v': + params.group_add.vht = true; + params.group_add.ht40 = true; + break; + case 'H': + params.group_add.he = true; + break; + case 'e': + params.group_add.edmg = true; + break; + case 'b': + if (sscanf(state->optarg, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mac_addr[0], &mac_addr[1], &mac_addr[2], &mac_addr[3], + &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { + PR_ERROR("Invalid GO BSSID format. Use: XX:XX:XX:XX:XX:XX\n"); + return -EINVAL; + } + memcpy(params.group_add.go_bssid, mac_addr, WIFI_MAC_ADDR_LEN); + params.group_add.go_bssid_length = WIFI_MAC_ADDR_LEN; + break; + case 'i': + /* Unused, but parsing to avoid unknown option error */ + break; + case '?': + shell_help(sh); + return -ENOEXEC; + default: + PR_ERROR("Invalid option %c\n", state->optopt); + return -EINVAL; + } + } + + if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { + PR_WARNING("P2P group add request failed\n"); + return -ENOEXEC; + } + PR("P2P group add initiated\n"); + return 0; +} + +static int cmd_wifi_p2p_group_remove(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_p2p_params params = {0}; + + context.sh = sh; + + if (argc < 2) { + PR_ERROR("Interface name required. Usage: wifi p2p group_remove \n"); + return -EINVAL; + } + + params.oper = WIFI_P2P_GROUP_REMOVE; + strncpy(params.group_remove.ifname, argv[1], + CONFIG_NET_INTERFACE_NAME_LEN); + params.group_remove.ifname[CONFIG_NET_INTERFACE_NAME_LEN] = '\0'; + + if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { + PR_WARNING("P2P group remove request failed\n"); + return -ENOEXEC; + } + PR("P2P group remove initiated\n"); + return 0; +} + +static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_p2p_params params = {0}; + uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; + int opt; + int opt_index = 0; + struct sys_getopt_state *state; + static const struct sys_getopt_option long_options[] = { + {"persistent", sys_getopt_required_argument, 0, 'p'}, + {"group", sys_getopt_required_argument, 0, 'g'}, + {"peer", sys_getopt_required_argument, 0, 'P'}, + {"freq", sys_getopt_required_argument, 0, 'f'}, + {"go-dev-addr", sys_getopt_required_argument, 0, 'd'}, + {"iface", sys_getopt_required_argument, 0, 'i'}, + {"help", sys_getopt_no_argument, 0, 'h'}, + {0, 0, 0, 0} + }; + long val; + + context.sh = sh; + + params.oper = WIFI_P2P_INVITE; + params.invite.type = WIFI_P2P_INVITE_PERSISTENT; + params.invite.persistent_id = -1; + params.invite.group_ifname[0] = '\0'; + params.invite.freq = 0; + params.invite.go_dev_addr_length = 0; + memset(params.invite.peer_addr, 0, WIFI_MAC_ADDR_LEN); + + if (argc < 2) { + PR_ERROR("Usage: wifi p2p invite --persistent= OR " + "wifi p2p invite --group= --peer= [options]\n"); + return -EINVAL; + } + + while ((opt = sys_getopt_long(argc, argv, "p:g:P:f:d:i:h", long_options, + &opt_index)) != -1) { + state = sys_getopt_state_get(); + switch (opt) { + case 'p': + if (!parse_number(sh, &val, state->optarg, "persistent", 0, 255)) { + return -EINVAL; + } + params.invite.type = WIFI_P2P_INVITE_PERSISTENT; + params.invite.persistent_id = (int)val; + break; + case 'g': + params.invite.type = WIFI_P2P_INVITE_GROUP; + strncpy(params.invite.group_ifname, state->optarg, + CONFIG_NET_INTERFACE_NAME_LEN); + params.invite.group_ifname[CONFIG_NET_INTERFACE_NAME_LEN] = '\0'; + break; + case 'P': + if (sscanf(state->optarg, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mac_addr[0], &mac_addr[1], &mac_addr[2], &mac_addr[3], + &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { + PR_ERROR("Invalid peer MAC address format\n"); + return -EINVAL; + } + memcpy(params.invite.peer_addr, mac_addr, WIFI_MAC_ADDR_LEN); + break; + case 'f': + if (!parse_number(sh, &val, state->optarg, "freq", 0, 6000)) { + return -EINVAL; + } + params.invite.freq = (int)val; + break; + case 'd': + if (sscanf(state->optarg, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mac_addr[0], &mac_addr[1], &mac_addr[2], &mac_addr[3], + &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { + PR_ERROR("Invalid GO device address format\n"); + return -EINVAL; + } + memcpy(params.invite.go_dev_addr, mac_addr, WIFI_MAC_ADDR_LEN); + params.invite.go_dev_addr_length = WIFI_MAC_ADDR_LEN; + break; + case 'i': + /* Unused, but parsing to avoid unknown option error */ + break; + case 'h': + shell_help(sh); + return -ENOEXEC; + default: + PR_ERROR("Invalid option %c\n", state->optopt); + return -EINVAL; + } + } + + state = sys_getopt_state_get(); + + if (params.invite.type == WIFI_P2P_INVITE_PERSISTENT && + params.invite.persistent_id >= 0 && + params.invite.peer_addr[0] == 0 && params.invite.peer_addr[1] == 0 && + argc > state->optind && argv[state->optind][0] != '-') { + if (sscanf(argv[state->optind], "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", + &mac_addr[0], &mac_addr[1], &mac_addr[2], &mac_addr[3], + &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { + PR_ERROR("Invalid peer MAC address format\n"); + return -EINVAL; + } + memcpy(params.invite.peer_addr, mac_addr, WIFI_MAC_ADDR_LEN); + } + + if (params.invite.type == WIFI_P2P_INVITE_PERSISTENT) { + if (params.invite.persistent_id < 0) { + PR_ERROR("Persistent group ID required. Use --persistent=\n"); + return -EINVAL; + } + if (params.invite.peer_addr[0] == 0 && params.invite.peer_addr[1] == 0) { + PR_ERROR("Peer MAC address required\n"); + return -EINVAL; + } + } else if (params.invite.type == WIFI_P2P_INVITE_GROUP) { + if (params.invite.group_ifname[0] == '\0') { + PR_ERROR("Group interface name required. Use --group=\n"); + return -EINVAL; + } + if (params.invite.peer_addr[0] == 0 && params.invite.peer_addr[1] == 0) { + PR_ERROR("Peer MAC address required. Use --peer=\n"); + return -EINVAL; + } + } + + if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { + PR_WARNING("P2P invite request failed\n"); + return -ENOEXEC; + } + PR("P2P invite initiated\n"); + return 0; +} #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[]) @@ -4572,6 +4822,35 @@ SHELL_STATIC_SUBCMD_SET_CREATE( " wifi p2p connect 9c:b1:50:e3:81:96 pin -g 0 (displays PIN)\n" " wifi p2p connect 9c:b1:50:e3:81:96 pin 12345670 -g 0 (uses PIN)\n", cmd_wifi_p2p_connect, 3, 5), + SHELL_CMD_ARG(group_add, NULL, + "Add a P2P group (start as GO)\n" + "Usage: group_add [options]\n" + "[-f, --freq=]: Frequency in MHz (0 = auto)\n" + "[-p, --persistent=]: Persistent group ID (-1 = not persistent)\n" + "[-h, --ht40]: Enable HT40\n" + "[-v, --vht]: Enable VHT (also enables HT40)\n" + "[-H, --he]: Enable HE\n" + "[-e, --edmg]: Enable EDMG\n" + "[-b, --go-bssid=]: GO BSSID (format: XX:XX:XX:XX:XX:XX)\n" + "[-i, --iface=]: Interface index\n", + cmd_wifi_p2p_group_add, 1, 10), + SHELL_CMD_ARG(group_remove, NULL, + "Remove a P2P group\n" + "Usage: group_remove \n" + ": Interface name (e.g., wlan0)\n" + "[-i, --iface=]: Interface index\n", + cmd_wifi_p2p_group_remove, 2, 3), + SHELL_CMD_ARG(invite, NULL, + "Invite a peer to a P2P group\n" + "Usage: invite --persistent= OR\n" + " invite --group= --peer= [options]\n" + "[-p, --persistent=]: Persistent group ID\n" + "[-g, --group=]: Group interface name\n" + "[-P, --peer=]: Peer MAC address (format: XX:XX:XX:XX:XX:XX)\n" + "[-f, --freq=]: Frequency in MHz (0 = auto)\n" + "[-d, --go-dev-addr=]: GO device address (for group type)\n" + "[-i, --iface=]: Interface index\n", + cmd_wifi_p2p_invite, 2, 8), SHELL_SUBCMD_SET_END ); From 01d16d61e978db274713d01362b019e65e4f25a6 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Mon, 17 Nov 2025 23:32:15 +0530 Subject: [PATCH 0614/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Add P2P powersave support Add ops to handle P2P powersave configuration. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/inc/wpa_supp_if.h | 1 + drivers/wifi/nrf_wifi/src/fmac_main.c | 1 + drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 45 +++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h index 28aadae28ebd..b4ec7545be49 100644 --- a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h +++ b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h @@ -133,6 +133,7 @@ int nrf_wifi_supp_set_country(void *if_priv, const char *alpha2); int nrf_wifi_supp_get_country(void *if_priv, char *alpha2); int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration); int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv); +int nrf_wifi_supp_set_p2p_powersave(void *if_priv, int legacy_ps, int opp_ps, int ctwindow); #endif /* CONFIG_NRF70_STA_MODE */ #ifdef CONFIG_NRF70_AP_MODE diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 00ea3a873c85..8aaac5c2b964 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -967,6 +967,7 @@ static const struct zep_wpa_supp_dev_ops wpa_supp_ops = { .get_country = nrf_wifi_supp_get_country, .remain_on_channel = nrf_wifi_supp_remain_on_channel, .cancel_remain_on_channel = nrf_wifi_supp_cancel_remain_on_channel, + .set_p2p_powersave = nrf_wifi_supp_set_p2p_powersave, #ifdef CONFIG_NRF70_AP_MODE .init_ap = nrf_wifi_wpa_supp_init_ap, .start_ap = nrf_wifi_wpa_supp_start_ap, diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index a15d66276c7a..1106f3c05808 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -2151,6 +2151,51 @@ int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv) return status; } +int nrf_wifi_supp_set_p2p_powersave(void *if_priv, int legacy_ps, int opp_ps, int ctwindow) +{ + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; +#ifdef NRF70_P2P_MODE + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; + struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + + if (!if_priv) { + LOG_ERR("%s: Invalid params", __func__); + return -1; + } + vif_ctx_zep = if_priv; + rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + if (!rpu_ctx_zep) { + LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); + return -1; + } + k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); + if (!rpu_ctx_zep->rpu_ctx) { + LOG_DBG("%s: RPU context not initialized", __func__); + goto out; + } + + if (legacy_ps == -1) { + status = 0; + goto out; + } + + if (legacy_ps != 0 && legacy_ps != 1) { + LOG_ERR("%s: Invalid legacy_ps value: %d", __func__, legacy_ps); + goto out; + } + + status = nrf_wifi_sys_fmac_set_power_save(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, + legacy_ps); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: nrf_wifi_fmac_set_p2p_powersave failed", __func__); + goto out; + } +out: + k_mutex_unlock(&vif_ctx_zep->vif_lock); +#endif /* NRF70_P2P_MODE */ + return status; +} + #ifdef CONFIG_NRF70_AP_MODE static int nrf_wifi_vif_state_change(struct nrf_wifi_vif_ctx_zep *vif_ctx_zep, enum nrf_wifi_fmac_if_op_state state) From 524641ca012091fa491e745a429a954b187d7e29 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Mon, 17 Nov 2025 23:33:01 +0530 Subject: [PATCH 0615/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Add cookie handling support Add cookie event callbacks to track RoC and cancel-RoC requests and its responses from firmware. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/inc/wpa_supp_if.h | 5 +++-- drivers/wifi/nrf_wifi/src/fmac_main.c | 5 +++++ drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 11 ++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h index b4ec7545be49..321705308d1a 100644 --- a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h +++ b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h @@ -131,8 +131,9 @@ void nrf_wifi_supp_event_roc_cancel_complete(void *os_vif_ctx, unsigned int event_len); int nrf_wifi_supp_set_country(void *if_priv, const char *alpha2); int nrf_wifi_supp_get_country(void *if_priv, char *alpha2); -int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration); -int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv); +int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, + unsigned int duration, u64 host_cookie); +int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv, u64 rpu_cookie); int nrf_wifi_supp_set_p2p_powersave(void *if_priv, int legacy_ps, int opp_ps, int ctwindow); #endif /* CONFIG_NRF70_STA_MODE */ diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 8aaac5c2b964..9e8ae2aafb93 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -452,6 +452,11 @@ void nrf_wifi_event_proc_cookie_rsp(void *vif_ctx, /* TODO: When supp_callbk_fns.mgmt_tx_status is implemented, add logic * here to use the cookie and host_cookie to map requests to responses. */ + if (vif_ctx_zep->supp_drv_if_ctx && + vif_ctx_zep->supp_callbk_fns.cookie_event) { + vif_ctx_zep->supp_callbk_fns.cookie_event(vif_ctx_zep->supp_drv_if_ctx, + cookie_rsp_event->host_cookie, cookie_rsp_event->cookie); + } } #endif /* CONFIG_NRF70_STA_MODE */ diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 1106f3c05808..0a9ab6c93998 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -2035,7 +2035,7 @@ void nrf_wifi_supp_event_remain_on_channel(void *if_priv, if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_complete) { vif_ctx_zep->supp_callbk_fns.roc_complete(vif_ctx_zep->supp_drv_if_ctx, roc_complete->frequency, - roc_complete->dur); + roc_complete->dur, roc_complete->cookie); } } @@ -2064,12 +2064,12 @@ void nrf_wifi_supp_event_roc_cancel_complete(void *if_priv, if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_cancel_complete) { vif_ctx_zep->supp_callbk_fns.roc_cancel_complete(vif_ctx_zep->supp_drv_if_ctx, - roc_cancel_complete->frequency); + roc_cancel_complete->frequency, roc_cancel_complete->cookie); } } int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, - unsigned int duration) + unsigned int duration, u64 host_cookie) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; #ifdef NRF70_P2P_MODE @@ -2102,6 +2102,7 @@ int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, roc_info.nrf_wifi_freq_params.center_frequency2 = 0; roc_info.nrf_wifi_freq_params.channel_type = NRF_WIFI_CHAN_HT20; roc_info.dur = duration; + roc_info.host_cookie = host_cookie; status = nrf_wifi_sys_fmac_p2p_roc_start(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &roc_info); @@ -2115,7 +2116,7 @@ int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, return status; } -int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv) +int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv, u64 cookie) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; #ifdef NRF70_P2P_MODE @@ -2140,7 +2141,7 @@ int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv) goto out; } - status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, 0); + status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, cookie); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_fmac_cancel_remain_on_channel failed", __func__); goto out; From 4263ac9d90f41815e6db96f7ef2f165df52b3c5b Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Mon, 17 Nov 2025 23:37:14 +0530 Subject: [PATCH 0616/3334] [nrf fromlist] manifest: hostap: Pull in P2P powersave support Add P2P power save and cookie handling support. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 874653c839dd..154371f993dc 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 51698b0f5fdac2778484f565d4591fcb1dd92bc4 + revision: 528eb2d95e35c7c9b187a15d2fb7f6e5bb983181 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 452b60c80ed8c8b2f130772c5fcfd3ec7a2e9d2f Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Tue, 18 Nov 2025 12:39:11 +0000 Subject: [PATCH 0617/3334] [nrf fromlist] net: wifi: Add API support for P2P power save Add API support for P2P power save. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- include/zephyr/net/wifi_mgmt.h | 4 ++++ modules/hostap/src/supp_api.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 389ab70d7e7e..434e27941965 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -1473,6 +1473,8 @@ enum wifi_p2p_op { WIFI_P2P_GROUP_REMOVE, /** P2P invite */ WIFI_P2P_INVITE, + /** P2P power save */ + WIFI_P2P_POWER_SAVE, }; /** Wi-Fi P2P discovery type */ @@ -1514,6 +1516,8 @@ struct wifi_p2p_params { struct wifi_p2p_device_info *peers; /** Actual number of peers returned */ uint16_t peer_count; + /** Power save enabled (for power save operation) */ + bool power_save; /** Connect specific parameters */ struct { /** Connection method */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 2532a11f865e..04c9b7d81e01 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -3043,6 +3043,20 @@ int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params break; } + case WIFI_P2P_POWER_SAVE: + snprintk(cmd_buf, sizeof(cmd_buf), "p2p_set ps %d", params->power_save ? 1 : 0); + ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); + if (ret < 0) { + wpa_printf(MSG_ERROR, "p2p_set ps command failed: %d", ret); + return -EIO; + } + if (os_strncmp(resp_buf, "FAIL", 4) == 0) { + wpa_printf(MSG_ERROR, "p2p_set ps command returned FAIL"); + return -EIO; + } + ret = 0; + break; + default: wpa_printf(MSG_ERROR, "Unknown P2P operation: %d", params->oper); ret = -EINVAL; From 9df8e63c054666af123e68d3a479f82d2da8a1b1 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Tue, 18 Nov 2025 12:40:59 +0000 Subject: [PATCH 0618/3334] [nrf fromlist] net: wifi: Add P2P power save shell command support Add shell command support for P2P power save. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- subsys/net/l2/wifi/wifi_shell.c | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 71ff72eff5dc..220b8bee7633 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -4076,6 +4076,40 @@ static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[] PR("P2P invite initiated\n"); return 0; } + +static int cmd_wifi_p2p_power_save(const struct shell *sh, size_t argc, char *argv[]) +{ + struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); + struct wifi_p2p_params params = {0}; + bool power_save_enable = false; + + context.sh = sh; + + if (argc < 2) { + PR_ERROR("Usage: wifi p2p power_save \n"); + return -EINVAL; + } + + if (strcmp(argv[1], "on") == 0) { + power_save_enable = true; + } else if (strcmp(argv[1], "off") == 0) { + power_save_enable = false; + } else { + PR_ERROR("Invalid argument. Use 'on' or 'off'\n"); + return -EINVAL; + } + + params.oper = WIFI_P2P_POWER_SAVE; + params.power_save = power_save_enable; + + if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { + PR_WARNING("P2P power save request failed\n"); + return -ENOEXEC; + } + + PR("P2P power save %s\n", power_save_enable ? "enabled" : "disabled"); + return 0; +} #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[]) @@ -4851,6 +4885,13 @@ SHELL_STATIC_SUBCMD_SET_CREATE( "[-d, --go-dev-addr=]: GO device address (for group type)\n" "[-i, --iface=]: Interface index\n", cmd_wifi_p2p_invite, 2, 8), + SHELL_CMD_ARG(power_save, NULL, + "Set P2P power save mode\n" + "Usage: power_save \n" + ": Enable P2P power save\n" + ": Disable P2P power save\n" + "[-i, --iface=]: Interface index\n", + cmd_wifi_p2p_power_save, 2, 3), SHELL_SUBCMD_SET_END ); From d0922ddbab87a45fea42d60895e92eefd074aabb Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Mon, 24 Nov 2025 19:26:58 +0530 Subject: [PATCH 0619/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Suppress 11b rates in P2P scan Add an identifier to P2P scan request. RPU can use this to differentiate it from regular scan requests and suppress 11b rates. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 0a9ab6c93998..26893f2214e2 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -559,6 +559,10 @@ int nrf_wifi_wpa_supp_scan2(void *if_priv, struct wpa_driver_scan_params *params } } + if (params->p2p_probe) { + scan_info->scan_params.no_cck = 1; + } + scan_info->scan_reason = SCAN_CONNECT; /* Copy extra_ies */ From 6f4fa1e7da65fefa4f2743e4aa87b38103229644 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 25 Nov 2025 03:56:28 +0530 Subject: [PATCH 0620/3334] [nrf noup] net: l2: wifi: Fix getopt handling gettopt now has its own namespace in upstream, but the full POSIX namespacing is not pulled to NCS and is deemed too risky, so, this is a "noup" patch to partially rever the gettop commit [1] and reinstate old behaviour for Wi-Fi shell. [1] - https://github.com/zephyrproject-rtos/zephyr/commit/22f9ef0a3386e02bdcd9779d0eb68a3008af5bc6 Signed-off-by: Chaitanya Tata --- subsys/net/l2/wifi/wifi_shell.c | 82 ++++++++++++++++----------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 220b8bee7633..f27fe5a6ffcd 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3651,19 +3651,19 @@ static int cmd_wifi_p2p_find(const struct shell *sh, size_t argc, char *argv[]) if (argc > 1) { int opt; int opt_index = 0; - struct sys_getopt_state *state; - static const struct sys_getopt_option long_options[] = { - {"timeout", sys_getopt_required_argument, 0, 't'}, - {"type", sys_getopt_required_argument, 0, 'T'}, - {"iface", sys_getopt_required_argument, 0, 'i'}, - {"help", sys_getopt_no_argument, 0, 'h'}, + struct getopt_state *state; + static const struct option long_options[] = { + {"timeout", required_argument, 0, 't'}, + {"type", required_argument, 0, 'T'}, + {"iface", required_argument, 0, 'i'}, + {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} }; long val; - while ((opt = sys_getopt_long(argc, argv, "t:T:i:h", + while ((opt = getopt_long(argc, argv, "t:T:i:h", long_options, &opt_index)) != -1) { - state = sys_getopt_state_get(); + state = getopt_state_get(); switch (opt) { case 't': if (!parse_number(sh, &val, state->optarg, "timeout", 0, 65535)) { @@ -3735,12 +3735,12 @@ static int cmd_wifi_p2p_connect(const struct shell *sh, size_t argc, char *argv[ const char *method_arg = NULL; int opt; int opt_index = 0; - struct sys_getopt_state *state; - static const struct sys_getopt_option long_options[] = { - {"go-intent", sys_getopt_required_argument, 0, 'g'}, - {"freq", sys_getopt_required_argument, 0, 'f'}, - {"iface", sys_getopt_required_argument, 0, 'i'}, - {"help", sys_getopt_no_argument, 0, 'h'}, + struct getopt_state *state; + static const struct option long_options[] = { + {"go-intent", required_argument, 0, 'g'}, + {"freq", required_argument, 0, 'f'}, + {"iface", required_argument, 0, 'i'}, + {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} }; long val; @@ -3784,8 +3784,8 @@ static int cmd_wifi_p2p_connect(const struct shell *sh, size_t argc, char *argv[ /* Set default frequency to 2462 MHz (channel 11, 2.4 GHz) */ params.connect.freq = 2462; - while ((opt = sys_getopt_long(argc, argv, "g:f:i:h", long_options, &opt_index)) != -1) { - state = sys_getopt_state_get(); + while ((opt = getopt_long(argc, argv, "g:f:i:h", long_options, &opt_index)) != -1) { + state = getopt_state_get(); switch (opt) { case 'g': if (!parse_number(sh, &val, state->optarg, "go-intent", 0, 15)) { @@ -3833,17 +3833,17 @@ static int cmd_wifi_p2p_group_add(const struct shell *sh, size_t argc, char *arg struct wifi_p2p_params params = {0}; int opt; int opt_index = 0; - struct sys_getopt_state *state; - static const struct sys_getopt_option long_options[] = { - {"freq", sys_getopt_required_argument, 0, 'f'}, - {"persistent", sys_getopt_required_argument, 0, 'p'}, - {"ht40", sys_getopt_no_argument, 0, 'h'}, - {"vht", sys_getopt_no_argument, 0, 'v'}, - {"he", sys_getopt_no_argument, 0, 'H'}, - {"edmg", sys_getopt_no_argument, 0, 'e'}, - {"go-bssid", sys_getopt_required_argument, 0, 'b'}, - {"iface", sys_getopt_required_argument, 0, 'i'}, - {"help", sys_getopt_no_argument, 0, '?'}, + struct getopt_state *state; + static const struct option long_options[] = { + {"freq", required_argument, 0, 'f'}, + {"persistent", required_argument, 0, 'p'}, + {"ht40", no_argument, 0, 'h'}, + {"vht", no_argument, 0, 'v'}, + {"he", no_argument, 0, 'H'}, + {"edmg", no_argument, 0, 'e'}, + {"go-bssid", required_argument, 0, 'b'}, + {"iface", required_argument, 0, 'i'}, + {"help", no_argument, 0, '?'}, {0, 0, 0, 0} }; long val; @@ -3860,9 +3860,9 @@ static int cmd_wifi_p2p_group_add(const struct shell *sh, size_t argc, char *arg params.group_add.edmg = false; params.group_add.go_bssid_length = 0; - while ((opt = sys_getopt_long(argc, argv, "f:p:hvHeb:i:?", long_options, + while ((opt = getopt_long(argc, argv, "f:p:hvHeb:i:?", long_options, &opt_index)) != -1) { - state = sys_getopt_state_get(); + state = getopt_state_get(); switch (opt) { case 'f': if (!parse_number(sh, &val, state->optarg, "freq", 0, 6000)) { @@ -3951,15 +3951,15 @@ static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[] uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; int opt; int opt_index = 0; - struct sys_getopt_state *state; - static const struct sys_getopt_option long_options[] = { - {"persistent", sys_getopt_required_argument, 0, 'p'}, - {"group", sys_getopt_required_argument, 0, 'g'}, - {"peer", sys_getopt_required_argument, 0, 'P'}, - {"freq", sys_getopt_required_argument, 0, 'f'}, - {"go-dev-addr", sys_getopt_required_argument, 0, 'd'}, - {"iface", sys_getopt_required_argument, 0, 'i'}, - {"help", sys_getopt_no_argument, 0, 'h'}, + struct getopt_state *state; + static const struct option long_options[] = { + {"persistent", required_argument, 0, 'p'}, + {"group", required_argument, 0, 'g'}, + {"peer", required_argument, 0, 'P'}, + {"freq", required_argument, 0, 'f'}, + {"go-dev-addr", required_argument, 0, 'd'}, + {"iface", required_argument, 0, 'i'}, + {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} }; long val; @@ -3980,9 +3980,9 @@ static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[] return -EINVAL; } - while ((opt = sys_getopt_long(argc, argv, "p:g:P:f:d:i:h", long_options, + while ((opt = getopt_long(argc, argv, "p:g:P:f:d:i:h", long_options, &opt_index)) != -1) { - state = sys_getopt_state_get(); + state = getopt_state_get(); switch (opt) { case 'p': if (!parse_number(sh, &val, state->optarg, "persistent", 0, 255)) { @@ -4034,7 +4034,7 @@ static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[] } } - state = sys_getopt_state_get(); + state = getopt_state_get(); if (params.invite.type == WIFI_P2P_INVITE_PERSISTENT && params.invite.persistent_id >= 0 && From 8c772e3d978dbcbf649c01cb135e01394927aec5 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 14 Nov 2025 08:36:22 +0100 Subject: [PATCH 0621/3334] [nrf fromtree] doc: releases: 4.4: Add NVMEM entry for flash device support Add an entry with Kconfig options for NVMEM on flash devices. Signed-off-by: Pieter De Gendt (cherry picked from commit 8439d0d9171fd96cd5122405ee9fa72ec2a95ad9) --- doc/releases/release-notes-4.4.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 9aa8719c7edc..a5e1e49dd9c3 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -102,6 +102,13 @@ New APIs and options * :dtcompatible:`jedec,mspi-nor` now allows MSPI configuration of read, write and control commands separately via devicetree. +* NVMEM + + * Flash device support + + * :kconfig:option:`CONFIG_NVMEM_FLASH` + * :kconfig:option:`CONFIG_NVMEM_FLASH_WRITE` + * Settings * :kconfig:option:`CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION` From 47a5d74b4b30312280a1a5a99085c6bad8e9f3e7 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Fri, 7 Nov 2025 09:08:30 +0000 Subject: [PATCH 0622/3334] [nrf fromlist] doc: networking: Add Wi-Fi P2P info Add Wi-Fi P2P mode build command and info. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- doc/connectivity/networking/api/wifi.rst | 14 ++++++++++++++ doc/releases/release-notes-4.4.rst | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/doc/connectivity/networking/api/wifi.rst b/doc/connectivity/networking/api/wifi.rst index e0be44835443..e50a1f9fc74b 100644 --- a/doc/connectivity/networking/api/wifi.rst +++ b/doc/connectivity/networking/api/wifi.rst @@ -10,6 +10,7 @@ The Wi-Fi management API is used to manage Wi-Fi networks. It supports below mod * IEEE802.11 Station (STA) * IEEE802.11 Access Point (AP) +* IEEE802.11 P2P (Wi-Fi Direct) Only personal mode security is supported with below types: @@ -215,6 +216,19 @@ The test certificates in ``samples/net/wifi/test_certs/rsa2k`` are generated usi .. note:: These certificates are for testing only and should not be used in production. +Wi-Fi P2P (Wi-Fi Direct) +************************ + +Wi-Fi P2P or Wi-Fi Direct enables devices to communicate directly with each other without requiring +a traditional access point. This feature is particularly useful for device-to-device communication +scenarios. + +To enable and build with Wi-Fi P2P support: + +.. code-block:: bash + + $ west build -p -b samples/net/wifi/shell -- -DCONFIG_WIFI_NM_WPA_SUPPLICANT_P2P=y + API Reference ************* diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index a5e1e49dd9c3..b74d1670107e 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -109,6 +109,12 @@ New APIs and options * :kconfig:option:`CONFIG_NVMEM_FLASH` * :kconfig:option:`CONFIG_NVMEM_FLASH_WRITE` +* Networking + + * Wi-Fi + + * Add support for Wi-Fi Direct (P2P) mode. + * Settings * :kconfig:option:`CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION` From 8321de52c5cb87435364638ad4e36fa562bb7c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 24 Oct 2025 10:22:18 +0200 Subject: [PATCH 0623/3334] [nrf fromtree] usb: device_next: msc: stall endpoints on enqueue error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When endpoint enqueue fails the device has no reliable means of recovery other than a reset. Implement 6.6.2 Internal Device Error handling on failed enqueue. Signed-off-by: Tomasz Moń (cherry picked from commit 78291d4fc2ed82f64a70d478417b285ec8ea8876) --- subsys/usb/device_next/class/usbd_msc.c | 56 +++++++++++++++---------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index 6e6c75f671e9..ee5784ae00ca 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -214,6 +214,31 @@ static uint8_t msc_get_bulk_out(struct usbd_class_data *const c_data) return desc->if0_out_ep.bEndpointAddress; } +static void msc_stall_bulk_out_ep(struct usbd_class_data *const c_data) +{ + uint8_t ep; + + ep = msc_get_bulk_out(c_data); + usbd_ep_set_halt(usbd_class_get_ctx(c_data), ep); +} + +static void msc_stall_bulk_in_ep(struct usbd_class_data *const c_data) +{ + uint8_t ep; + + ep = msc_get_bulk_in(c_data); + usbd_ep_set_halt(usbd_class_get_ctx(c_data), ep); +} + +static void msc_stall_and_wait_for_recovery(struct msc_bot_ctx *ctx) +{ + atomic_set_bit(&ctx->bits, MSC_BULK_IN_WEDGED); + atomic_set_bit(&ctx->bits, MSC_BULK_OUT_WEDGED); + msc_stall_bulk_in_ep(ctx->class_node); + msc_stall_bulk_out_ep(ctx->class_node); + ctx->state = MSC_BBB_WAIT_FOR_RESET_RECOVERY; +} + static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); @@ -246,25 +271,11 @@ static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool dat LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); atomic_clear_bit(&ctx->bits, MSC_BULK_OUT_QUEUED); + /* 6.6.2 Internal Device Error */ + msc_stall_and_wait_for_recovery(ctx); } } -static void msc_stall_bulk_out_ep(struct usbd_class_data *const c_data) -{ - uint8_t ep; - - ep = msc_get_bulk_out(c_data); - usbd_ep_set_halt(usbd_class_get_ctx(c_data), ep); -} - -static void msc_stall_bulk_in_ep(struct usbd_class_data *const c_data) -{ - uint8_t ep; - - ep = msc_get_bulk_in(c_data); - usbd_ep_set_halt(usbd_class_get_ctx(c_data), ep); -} - static void msc_reset_handler(struct usbd_class_data *c_data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); @@ -343,6 +354,8 @@ static void msc_process_read(struct msc_bot_ctx *ctx) LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); + /* 6.6.2 Internal Device Error */ + msc_stall_and_wait_for_recovery(ctx); } } @@ -500,11 +513,7 @@ static void msc_handle_bulk_out(struct msc_bot_ctx *ctx, } else { /* 6.6.1 CBW Not Valid */ LOG_INF("Invalid CBW"); - atomic_set_bit(&ctx->bits, MSC_BULK_IN_WEDGED); - atomic_set_bit(&ctx->bits, MSC_BULK_OUT_WEDGED); - msc_stall_bulk_in_ep(ctx->class_node); - msc_stall_bulk_out_ep(ctx->class_node); - ctx->state = MSC_BBB_WAIT_FOR_RESET_RECOVERY; + msc_stall_and_wait_for_recovery(ctx); } } else if (ctx->state == MSC_BBB_PROCESS_WRITE) { msc_process_write(ctx, buf, len); @@ -567,8 +576,11 @@ static void msc_send_csw(struct msc_bot_ctx *ctx) LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); + /* 6.6.2 Internal Device Error */ + msc_stall_and_wait_for_recovery(ctx); + } else { + ctx->state = MSC_BBB_WAIT_FOR_CSW_SENT; } - ctx->state = MSC_BBB_WAIT_FOR_CSW_SENT; } static void usbd_msc_handle_request(struct usbd_class_data *c_data, From 9ebaf6ba81a324d7d87718ac52e69a021c7d0663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Mon, 20 Oct 2025 10:04:49 +0200 Subject: [PATCH 0624/3334] [nrf fromtree] usb: device_next: msc: Implement double buffering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Double buffering make it possible to significantly increase the transfer rates by avoiding idle states. With two SCSI buffers, one buffer can be used by disk subsystem while the other is being used by UDC (ideally with DMA). Signed-off-by: Tomasz Moń (cherry picked from commit 1243aba8e5a9565e761923a8f51c9a7273b32b6b) --- subsys/usb/device_next/class/Kconfig.msc | 7 + subsys/usb/device_next/class/usbd_msc.c | 239 +++++++++++++++++------ 2 files changed, 186 insertions(+), 60 deletions(-) diff --git a/subsys/usb/device_next/class/Kconfig.msc b/subsys/usb/device_next/class/Kconfig.msc index d85d0561cbf4..d4ff01cf17b1 100644 --- a/subsys/usb/device_next/class/Kconfig.msc +++ b/subsys/usb/device_next/class/Kconfig.msc @@ -30,6 +30,13 @@ config USBD_MSC_SCSI_BUFFER_SIZE Buffer size must be able to hold at least one sector. All LUNs within single instance share the SCSI buffer. +config USBD_MSC_DOUBLE_BUFFERING + bool "SCSI double buffering" + default y + help + Allocate two SCSI buffers instead of one to increase throughput by + using one buffer by disk subsystem and one by USB at the same time. + module = USBD_MSC module-str = usbd msc default-count = 1 diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index ee5784ae00ca..79e81cc01382 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -60,9 +60,10 @@ struct CSW { /* Single instance is likely enough because it can support multiple LUNs */ #define MSC_NUM_INSTANCES CONFIG_USBD_MSC_INSTANCES_COUNT -UDC_BUF_POOL_DEFINE(msc_ep_pool, - MSC_NUM_INSTANCES * 2, USBD_MAX_BULK_MPS, - sizeof(struct udc_buf_info), NULL); +#define MSC_NUM_BUFFERS UTIL_INC(IS_ENABLED(CONFIG_USBD_MSC_DOUBLE_BUFFERING)) + +UDC_BUF_POOL_DEFINE(msc_ep_pool, MSC_NUM_INSTANCES * (1 + MSC_NUM_BUFFERS), + USBD_MAX_BULK_MPS, sizeof(struct udc_buf_info), NULL); struct msc_event { struct usbd_class_data *c_data; @@ -91,8 +92,6 @@ struct msc_bot_desc { enum { MSC_CLASS_ENABLED, - MSC_BULK_OUT_QUEUED, - MSC_BULK_IN_QUEUED, MSC_BULK_IN_WEDGED, MSC_BULK_OUT_WEDGED, }; @@ -112,13 +111,16 @@ struct msc_bot_ctx { struct msc_bot_desc *const desc; const struct usb_desc_header **const fs_desc; const struct usb_desc_header **const hs_desc; + uint8_t *scsi_bufs[MSC_NUM_BUFFERS]; atomic_t bits; enum msc_bot_state state; + uint8_t scsi_bufs_used; + uint8_t num_in_queued; + uint8_t num_out_queued; uint8_t registered_luns; struct scsi_ctx luns[CONFIG_USBD_MSC_LUNS_PER_INSTANCE]; struct CBW cbw; struct CSW csw; - uint8_t *scsi_buf; uint32_t transferred_data; size_t scsi_bytes; }; @@ -160,13 +162,34 @@ static struct net_buf *msc_buf_alloc_data(const uint8_t ep, uint8_t *data, size_ return buf; } -static size_t msc_next_transfer_length(struct usbd_class_data *const c_data) +static uint8_t *msc_alloc_scsi_buf(struct msc_bot_ctx *ctx) { - struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); - struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); - struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; - size_t len = scsi_cmd_remaining_data_len(lun); + for (int i = 0; i < MSC_NUM_BUFFERS; i++) { + if (!(ctx->scsi_bufs_used & BIT(i))) { + ctx->scsi_bufs_used |= BIT(i); + return ctx->scsi_bufs[i]; + } + } + + /* Code must not attempt to queue more than MSC_NUM_BUFFERS at once */ + __ASSERT(false, "MSC ran out of SCSI buffers"); + return NULL; +} + +void msc_free_scsi_buf(struct msc_bot_ctx *ctx, uint8_t *buf) +{ + for (int i = 0; i < MSC_NUM_BUFFERS; i++) { + if (buf == ctx->scsi_bufs[i]) { + ctx->scsi_bufs_used &= ~BIT(i); + return; + } + } +} +static size_t clamp_transfer_length(struct usbd_context *uds_ctx, + struct scsi_ctx *lun, + size_t len) +{ len = MIN(CONFIG_USBD_MSC_SCSI_BUFFER_SIZE, len); /* Limit transfer to bulk endpoint wMaxPacketSize multiple */ @@ -186,6 +209,39 @@ static size_t msc_next_transfer_length(struct usbd_class_data *const c_data) return len; } +static size_t msc_next_in_transfer_length(struct usbd_class_data *const c_data) +{ + struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); + struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); + struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; + size_t len = scsi_cmd_remaining_data_len(lun); + + return clamp_transfer_length(uds_ctx, lun, len); +} + +static size_t msc_next_out_transfer_length(struct usbd_class_data *const c_data) +{ + struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); + struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); + struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; + size_t remaining = scsi_cmd_remaining_data_len(lun); + size_t len = clamp_transfer_length(uds_ctx, lun, remaining); + + /* This function can only estimate one more transfer after the current + * one. Queueing more buffers is not supported. + */ + __ASSERT_NO_MSG(ctx->num_out_queued < 2); + + if (ctx->num_out_queued == 0) { + return len; + } + + /* MSC BOT specification requires host to send all the data it intends + * to send. Therefore it should be safe to use "remaining - len" here. + */ + return clamp_transfer_length(uds_ctx, lun, remaining - len); +} + static uint8_t msc_get_bulk_in(struct usbd_class_data *const c_data) { struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); @@ -239,27 +295,56 @@ static void msc_stall_and_wait_for_recovery(struct msc_bot_ctx *ctx) ctx->state = MSC_BBB_WAIT_FOR_RESET_RECOVERY; } -static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool data) +static void msc_queue_write(struct msc_bot_ctx *ctx) +{ + struct net_buf *buf; + uint8_t *scsi_buf; + uint8_t ep; + size_t len; + int ret; + + ep = msc_get_bulk_out(ctx->class_node); + + /* Ensure there are as many OUT transfers queued as possible */ + while ((ctx->num_out_queued < MSC_NUM_BUFFERS) && + (len = msc_next_out_transfer_length(ctx->class_node))) { + scsi_buf = msc_alloc_scsi_buf(ctx); + buf = msc_buf_alloc_data(ep, scsi_buf, len); + + /* The pool is large enough to support all allocations. Failing + * alloc indicates either a memory leak or logic error. + */ + __ASSERT_NO_MSG(buf); + + ret = usbd_ep_enqueue(ctx->class_node, buf); + if (ret) { + LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); + net_buf_unref(buf); + msc_free_scsi_buf(ctx, scsi_buf); + /* 6.6.2 Internal Device Error */ + msc_stall_and_wait_for_recovery(ctx); + return; + } + + ctx->num_out_queued++; + } +} + +static void msc_queue_cbw(struct usbd_class_data *const c_data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); struct net_buf *buf; - uint8_t *scsi_buf = ctx->scsi_buf; uint8_t ep; int ret; - if (atomic_test_and_set_bit(&ctx->bits, MSC_BULK_OUT_QUEUED)) { + if (ctx->num_out_queued) { /* Already queued */ return; } LOG_DBG("Queuing OUT"); ep = msc_get_bulk_out(c_data); - - if (data) { - buf = msc_buf_alloc_data(ep, scsi_buf, msc_next_transfer_length(c_data)); - } else { - buf = msc_buf_alloc(ep); - } + buf = msc_buf_alloc(ep); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. @@ -270,9 +355,10 @@ static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool dat if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); - atomic_clear_bit(&ctx->bits, MSC_BULK_OUT_QUEUED); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); + } else { + ctx->num_out_queued++; } } @@ -311,51 +397,58 @@ static bool is_cbw_meaningful(struct msc_bot_ctx *const ctx) return true; } -static void msc_process_read(struct msc_bot_ctx *ctx) +static void msc_queue_bulk_in_ep(struct msc_bot_ctx *ctx, uint8_t *data, int len) { - struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; - int bytes_queued = 0; struct net_buf *buf; - uint8_t *scsi_buf = ctx->scsi_buf; uint8_t ep; int ret; - /* Fill SCSI Data IN buffer if there is no data available */ - if (ctx->scsi_bytes == 0) { - size_t len = msc_next_transfer_length(ctx->class_node); - - bytes_queued = scsi_read_data(lun, scsi_buf, len); - } else { - bytes_queued = ctx->scsi_bytes; - } - - /* All data is submitted in one go. Any potential new data will - * have to be retrieved using scsi_read_data() on next call. - */ - ctx->scsi_bytes = 0; - - if (atomic_test_and_set_bit(&ctx->bits, MSC_BULK_IN_QUEUED)) { - __ASSERT_NO_MSG(false); - LOG_ERR("IN already queued"); - return; - } - ep = msc_get_bulk_in(ctx->class_node); - buf = msc_buf_alloc_data(ep, scsi_buf, bytes_queued); + buf = msc_buf_alloc_data(ep, data, len); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. */ __ASSERT_NO_MSG(buf); /* Either the net buf is full or there is no more SCSI data */ - ctx->csw.dCSWDataResidue -= bytes_queued; + ctx->csw.dCSWDataResidue -= len; ret = usbd_ep_enqueue(ctx->class_node, buf); if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); + msc_free_scsi_buf(ctx, data); net_buf_unref(buf); - atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); + } else { + ctx->num_in_queued++; + } +} + +static void msc_process_read(struct msc_bot_ctx *ctx) +{ + struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; + int bytes_queued = 0; + uint8_t *scsi_buf; + size_t len; + + /* Data can be already in scsi_buf0 only on first call after CBW */ + if (ctx->scsi_bytes) { + __ASSERT_NO_MSG(ctx->scsi_bufs_used == 0); + ctx->scsi_bufs_used = BIT(0); + msc_queue_bulk_in_ep(ctx, ctx->scsi_bufs[0], ctx->scsi_bytes); + /* All data is submitted in one go. Any potential new data will + * have to be retrieved using scsi_read_data() later. + */ + ctx->scsi_bytes = 0; + } + + /* Fill SCSI Data IN buffer if there is avaialble buffer and data */ + while ((ctx->num_in_queued < MSC_NUM_BUFFERS) && + (ctx->state == MSC_BBB_PROCESS_READ) && + (len = msc_next_in_transfer_length(ctx->class_node))) { + scsi_buf = msc_alloc_scsi_buf(ctx); + bytes_queued = scsi_read_data(lun, scsi_buf, len); + msc_queue_bulk_in_ep(ctx, scsi_buf, bytes_queued); } } @@ -366,8 +459,11 @@ static void msc_process_cbw(struct msc_bot_ctx *ctx) size_t data_len; int cb_len; + /* All SCSI buffers must be available */ + __ASSERT_NO_MSG(ctx->scsi_bufs_used == 0); + cb_len = scsi_usb_boot_cmd_len(ctx->cbw.CBWCB, ctx->cbw.bCBWCBLength); - data_len = scsi_cmd(lun, ctx->cbw.CBWCB, cb_len, ctx->scsi_buf); + data_len = scsi_cmd(lun, ctx->cbw.CBWCB, cb_len, ctx->scsi_bufs[0]); ctx->scsi_bytes = data_len; cmd_is_data_read = scsi_cmd_is_data_read(lun); cmd_is_data_write = scsi_cmd_is_data_write(lun); @@ -530,7 +626,7 @@ static void msc_handle_bulk_in(struct msc_bot_ctx *ctx, struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; ctx->transferred_data += len; - if (msc_next_transfer_length(ctx->class_node) == 0) { + if (msc_next_in_transfer_length(ctx->class_node) == 0) { if (ctx->csw.dCSWDataResidue > 0) { /* Case (5) Hi > Di * While we may have sent short packet, device @@ -555,7 +651,7 @@ static void msc_send_csw(struct msc_bot_ctx *ctx) uint8_t ep; int ret; - if (atomic_test_and_set_bit(&ctx->bits, MSC_BULK_IN_QUEUED)) { + if (ctx->num_in_queued) { __ASSERT_NO_MSG(false); LOG_ERR("IN already queued"); return; @@ -575,10 +671,10 @@ static void msc_send_csw(struct msc_bot_ctx *ctx) if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); - atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); } else { + ctx->num_in_queued++; ctx->state = MSC_BBB_WAIT_FOR_CSW_SENT; } } @@ -611,10 +707,17 @@ static void usbd_msc_handle_request(struct usbd_class_data *c_data, ep_request_error: if (bi->ep == msc_get_bulk_out(c_data)) { - atomic_clear_bit(&ctx->bits, MSC_BULK_OUT_QUEUED); + ctx->num_out_queued--; + if (buf->frags) { + ctx->num_out_queued--; + } } else if (bi->ep == msc_get_bulk_in(c_data)) { - atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); + ctx->num_in_queued--; + if (buf->frags) { + ctx->num_in_queued--; + } } + msc_free_scsi_buf(ctx, buf->__buf); usbd_ep_buf_free(uds_ctx, buf); } @@ -642,11 +745,14 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) switch (ctx->state) { case MSC_BBB_EXPECT_CBW: - msc_queue_bulk_out_ep(evt.c_data, false); + msc_queue_cbw(evt.c_data); break; case MSC_BBB_PROCESS_WRITE: /* Ensure we can accept next OUT packet */ - msc_queue_bulk_out_ep(evt.c_data, true); + msc_queue_write(ctx); + break; + case MSC_BBB_PROCESS_READ: + msc_process_read(ctx); break; default: break; @@ -655,7 +761,7 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) /* Skip (potentially) response generating code if there is * IN data already available for the host to pick up. */ - if (atomic_test_bit(&ctx->bits, MSC_BULK_IN_QUEUED)) { + if (ctx->num_in_queued) { continue; } @@ -666,7 +772,7 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) if (ctx->state == MSC_BBB_PROCESS_READ) { msc_process_read(ctx); } else if (ctx->state == MSC_BBB_PROCESS_WRITE) { - msc_queue_bulk_out_ep(evt.c_data, true); + msc_queue_write(ctx); } else if (ctx->state == MSC_BBB_SEND_CSW) { msc_send_csw(ctx); } @@ -885,14 +991,27 @@ struct usbd_class_api msc_bot_api = { .init = msc_bot_init, }; +#define BUF_NAME(x, i) scsi_buf##i##_##x + +#define DEFINE_SCSI_BUF(x, i) \ + UDC_STATIC_BUF_DEFINE(BUF_NAME(x, i), CONFIG_USBD_MSC_SCSI_BUFFER_SIZE); + +#define DEFINE_SCSI_BUFS(x) \ + DEFINE_SCSI_BUF(x, 0) \ + IF_ENABLED(CONFIG_USBD_MSC_DOUBLE_BUFFERING, (DEFINE_SCSI_BUF(x, 1))) + +#define NAME_SCSI_BUFS(x) \ + BUF_NAME(x, 0) \ + IF_ENABLED(CONFIG_USBD_MSC_DOUBLE_BUFFERING, (, BUF_NAME(x, 1))) + #define DEFINE_MSC_BOT_CLASS_DATA(x, _) \ - UDC_STATIC_BUF_DEFINE(scsi_buf_##x, CONFIG_USBD_MSC_SCSI_BUFFER_SIZE); \ + DEFINE_SCSI_BUFS(x) \ \ static struct msc_bot_ctx msc_bot_ctx_##x = { \ .desc = &msc_bot_desc_##x, \ .fs_desc = msc_bot_fs_desc_##x, \ .hs_desc = msc_bot_hs_desc_##x, \ - .scsi_buf = scsi_buf_##x \ + .scsi_bufs = { NAME_SCSI_BUFS(x) }, \ }; \ \ USBD_DEFINE_CLASS(msc_##x, &msc_bot_api, &msc_bot_ctx_##x, \ From 84577e178ed614b958ecc119ab9b56cc93932549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 24 Oct 2025 13:31:19 +0200 Subject: [PATCH 0625/3334] [nrf fromtree] usb: device_next: msc: Reduce memory usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSC BOT can work with just one buffer because buffer to receive CBW is never queued at the same time as CSW. SCSI buffer needs to be multiple of bulk endpoint wMaxPacketSize and therefore is suitable for handling both CBW and CSW. Take advantage of this to reduce memory usage. Signed-off-by: Tomasz Moń (cherry picked from commit 7e11bc58172e0ae5804220e7f6e07a9c292c07df) --- subsys/usb/device_next/class/usbd_msc.c | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index 79e81cc01382..c631376b61f6 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -62,8 +62,12 @@ struct CSW { #define MSC_NUM_BUFFERS UTIL_INC(IS_ENABLED(CONFIG_USBD_MSC_DOUBLE_BUFFERING)) +#if USBD_MAX_BULK_MPS > CONFIG_USBD_MSC_SCSI_BUFFER_SIZE +#error "SCSI buffer must be at least USB bulk endpoint wMaxPacketSize" +#endif + UDC_BUF_POOL_DEFINE(msc_ep_pool, MSC_NUM_INSTANCES * (1 + MSC_NUM_BUFFERS), - USBD_MAX_BULK_MPS, sizeof(struct udc_buf_info), NULL); + 0, sizeof(struct udc_buf_info), NULL); struct msc_event { struct usbd_class_data *c_data; @@ -125,22 +129,6 @@ struct msc_bot_ctx { size_t scsi_bytes; }; -static struct net_buf *msc_buf_alloc(const uint8_t ep) -{ - struct net_buf *buf = NULL; - struct udc_buf_info *bi; - - buf = net_buf_alloc(&msc_ep_pool, K_NO_WAIT); - if (!buf) { - return NULL; - } - - bi = udc_get_buf_info(buf); - bi->ep = ep; - - return buf; -} - static struct net_buf *msc_buf_alloc_data(const uint8_t ep, uint8_t *data, size_t len) { struct net_buf *buf = NULL; @@ -334,6 +322,7 @@ static void msc_queue_cbw(struct usbd_class_data *const c_data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); struct net_buf *buf; + uint8_t *scsi_buf; uint8_t ep; int ret; @@ -342,9 +331,13 @@ static void msc_queue_cbw(struct usbd_class_data *const c_data) return; } + __ASSERT(ctx->scsi_bufs_used == 0, + "CBW can only be queued when SCSI buffers are free"); + LOG_DBG("Queuing OUT"); ep = msc_get_bulk_out(c_data); - buf = msc_buf_alloc(ep); + scsi_buf = msc_alloc_scsi_buf(ctx); + buf = msc_buf_alloc_data(ep, scsi_buf, USBD_MAX_BULK_MPS); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. @@ -355,6 +348,7 @@ static void msc_queue_cbw(struct usbd_class_data *const c_data) if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); + msc_free_scsi_buf(ctx, scsi_buf); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); } else { @@ -648,6 +642,7 @@ static void msc_handle_bulk_in(struct msc_bot_ctx *ctx, static void msc_send_csw(struct msc_bot_ctx *ctx) { struct net_buf *buf; + uint8_t *scsi_buf; uint8_t ep; int ret; @@ -657,20 +652,25 @@ static void msc_send_csw(struct msc_bot_ctx *ctx) return; } + __ASSERT(ctx->scsi_bufs_used == 0, + "CSW can be sent only if SCSI buffers are free"); + /* Convert dCSWDataResidue to LE, other fields are already set */ ctx->csw.dCSWDataResidue = sys_cpu_to_le32(ctx->csw.dCSWDataResidue); ep = msc_get_bulk_in(ctx->class_node); - buf = msc_buf_alloc(ep); + scsi_buf = msc_alloc_scsi_buf(ctx); + memcpy(scsi_buf, &ctx->csw, sizeof(ctx->csw)); + buf = msc_buf_alloc_data(ep, scsi_buf, sizeof(ctx->csw)); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. */ __ASSERT_NO_MSG(buf); - net_buf_add_mem(buf, &ctx->csw, sizeof(ctx->csw)); ret = usbd_ep_enqueue(ctx->class_node, buf); if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); + msc_free_scsi_buf(ctx, scsi_buf); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); } else { From 0efb854a12786ea7f1dcf5487b2c256e911bc66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Mon, 24 Nov 2025 14:36:24 +0100 Subject: [PATCH 0626/3334] [nrf fromtree] usb: device_next: msc: Do not leak SCSI buffer on dequeue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Multiple submitted requests are getting merged to single cancelled net_buf on endpoint dequeue. While MSC class was correctly decrementing the usage counters, it was not freeing SCSI buffer pointed to by frags. Signed-off-by: Tomasz Moń (cherry picked from commit 152844a7e0f9edeb143cc8f865a23da7648968c0) --- subsys/usb/device_next/class/usbd_msc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index c631376b61f6..6aefb1aefb64 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -718,6 +718,9 @@ static void usbd_msc_handle_request(struct usbd_class_data *c_data, } } msc_free_scsi_buf(ctx, buf->__buf); + if (buf->frags) { + msc_free_scsi_buf(ctx, buf->frags->__buf); + } usbd_ep_buf_free(uds_ctx, buf); } From a3d02e2a892a335e88669921c306bba318ddd33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 20 Nov 2025 12:30:34 +0100 Subject: [PATCH 0627/3334] [nrf fromtree] drivers: usb: dwc2: Do cache operations on ownership change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Perform cache operations in thread context when the buffer ownership changes between USB stack and UDC driver. This offers clearly measurable throughput increase on Mass Storage when double buffering is enabled. When endpoint operations are not double buffered the difference is negligible. The positive side effect is reducing number of operations performed in interrupt context. Signed-off-by: Tomasz Moń (cherry picked from commit 614dd5738e703b87888e58cc3d7ee9854477db5b) --- drivers/usb/udc/udc_dwc2.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 769030670918..83ec8dd5f5ec 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -419,6 +419,11 @@ static int dwc2_ctrl_feed_dout(const struct device *dev, const size_t length) return -ENOMEM; } + if (dwc2_in_buffer_dma_mode(dev)) { + /* Get rid of all dirty cache lines */ + sys_cache_data_invd_range(buf->data, net_buf_tailroom(buf)); + } + udc_buf_put(ep_cfg, buf); atomic_set_bit(&priv->xfer_new, 16); k_event_post(&priv->drv_evt, BIT(DWC2_DRV_EVT_XFER)); @@ -589,8 +594,6 @@ static int dwc2_tx_fifo_write(const struct device *dev, sys_write32((uint32_t)buf->data, (mem_addr_t)&base->in_ep[ep_idx].diepdma); - - sys_cache_data_flush_range(buf->data, len); } diepctl = sys_read32(diepctl_reg); @@ -790,8 +793,6 @@ static void dwc2_prep_rx(const struct device *dev, struct net_buf *buf, sys_write32((uint32_t)data, (mem_addr_t)&base->out_ep[ep_idx].doepdma); - - sys_cache_data_invd_range(data, xfersize); } sys_write32(doepctl, doepctl_reg); @@ -968,6 +969,10 @@ static inline int dwc2_handle_evt_dout(const struct device *dev, return -ENODATA; } + if (dwc2_in_buffer_dma_mode(dev)) { + sys_cache_data_invd_range(buf->data, buf->len); + } + udc_ep_set_busy(cfg, false); if (cfg->addr == USB_CONTROL_EP_OUT) { @@ -1835,6 +1840,17 @@ static int udc_dwc2_ep_enqueue(const struct device *dev, struct udc_dwc2_data *const priv = udc_get_private(dev); LOG_DBG("%p enqueue %x %p", dev, cfg->addr, buf); + + if (dwc2_in_buffer_dma_mode(dev)) { + if (USB_EP_DIR_IS_IN(cfg->addr)) { + /* Write all dirty cache lines to memory */ + sys_cache_data_flush_range(buf->data, buf->len); + } else { + /* Get rid of all dirty cache lines */ + sys_cache_data_invd_range(buf->data, net_buf_tailroom(buf)); + } + } + udc_buf_put(cfg, buf); if (!cfg->stat.halted) { @@ -1861,6 +1877,13 @@ static int udc_dwc2_ep_dequeue(const struct device *dev, udc_dwc2_ep_disable(dev, cfg, false, true); buf = udc_buf_get_all(cfg); + + if (dwc2_in_buffer_dma_mode(dev) && USB_EP_DIR_IS_OUT(cfg->addr)) { + for (struct net_buf *iter = buf; iter; iter = iter->frags) { + sys_cache_data_invd_range(iter->data, iter->len); + } + } + if (buf) { udc_submit_ep_event(dev, buf, -ECONNABORTED); } @@ -2821,7 +2844,9 @@ static inline void dwc2_handle_out_xfercompl(const struct device *dev, } if (dwc2_in_buffer_dma_mode(dev) && bcnt) { - sys_cache_data_invd_range(net_buf_tail(buf), bcnt); + /* Update just the length, cache will be invalidated in thread + * context after transfer if finished or cancelled. + */ net_buf_add(buf, bcnt); } From 56fbb4f3c7bba12fb34a5cd111b4ea9f7ad52162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Tue, 25 Nov 2025 11:09:24 +0100 Subject: [PATCH 0628/3334] [nrf fromtree] drivers: udc_dwc2: Avoid endpoint disable timeouts on bus reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DWC2 core automatically clears USBActEP (for all endpoints other than endpoint 0) on bus reset. While core is deactivating the endpoint, it does not disarm it. On bus reset USB stack first calls ep_disable API and then ep_dequeue. This was leading to endpoint is not active warning followed by endpoint disable timeout. Disable timeout was effectively caused by waiting for EPDisbld interrupt on endpoint with disabled interrupts. Solve the issue by unconditionally disarming endpoint in ep_disable API handler. Remove the false warning because USBActEP cannot really be used for sanity checking as it is not only the driver that clears it. Signed-off-by: Tomasz Moń (cherry picked from commit 6f0a40090f91c84e57eb070fd65ab878e817bf2e) --- drivers/usb/udc/udc_dwc2.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 83ec8dd5f5ec..905698bcf977 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -1748,20 +1748,11 @@ static int udc_dwc2_ep_deactivate(const struct device *dev, dxepctl_reg = dwc2_get_dxepctl_reg(dev, cfg->addr); } - dxepctl = sys_read32(dxepctl_reg); - - if (dxepctl & USB_DWC2_DEPCTL_USBACTEP) { - LOG_DBG("Disable ep 0x%02x DxEPCTL%u %x", - cfg->addr, ep_idx, dxepctl); - - udc_dwc2_ep_disable(dev, cfg, false, true); + udc_dwc2_ep_disable(dev, cfg, false, true); - dxepctl = sys_read32(dxepctl_reg); - dxepctl &= ~USB_DWC2_DEPCTL_USBACTEP; - } else { - LOG_WRN("ep 0x%02x is not active DxEPCTL%u %x", - cfg->addr, ep_idx, dxepctl); - } + dxepctl = sys_read32(dxepctl_reg); + LOG_DBG("Disable ep 0x%02x DxEPCTL%u %x", cfg->addr, ep_idx, dxepctl); + dxepctl &= ~USB_DWC2_DEPCTL_USBACTEP; if (USB_EP_DIR_IS_IN(cfg->addr) && udc_mps_ep_size(cfg) != 0U && ep_idx != 0U) { From b85b50681663c0a89c6bd4e5749d1258727e8100 Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Fri, 5 Sep 2025 13:27:08 -0500 Subject: [PATCH 0629/3334] [nrf fromtree] pm: Extend pm notifier to be able to report substate I am surprised this notifier didn't already report the substate id, it seems important since different substate obviously are defined for a reason, they can be having a different effect on the system. Signed-off-by: Declan Snyder (cherry picked from commit ae1f13149fcd4c5d5c75784292c738e2e39e2645) --- include/zephyr/pm/pm.h | 37 +++++++++++++++++++++++++++---------- subsys/pm/pm.c | 22 ++++++++++++++++------ 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/include/zephyr/pm/pm.h b/include/zephyr/pm/pm.h index 443f5e37d8bd..096ca6942e6f 100644 --- a/include/zephyr/pm/pm.h +++ b/include/zephyr/pm/pm.h @@ -55,16 +55,33 @@ extern "C" { */ struct pm_notifier { sys_snode_t _node; - /** - * Application defined function for doing any target specific operations - * for power state entry. - */ - void (*state_entry)(enum pm_state state); - /** - * Application defined function for doing any target specific operations - * for power state exit. - */ - void (*state_exit)(enum pm_state state); + union { + struct { + /** + * Application defined function for doing any target specific operations + * for power state entry. + */ + void (*state_entry)(enum pm_state state); + /** + * Application defined function for doing any target specific operations + * for power state exit. + */ + void (*state_exit)(enum pm_state state); + }; + struct { + /** + * Application defined function for doing any target specific operations + * for power state entry. Reports the substate id additionally. + */ + void (*substate_entry)(enum pm_state state, uint8_t substate_id); + /** + * Application defined function for doing any target specific operations + * for power state exit. Reports the substate id additionally. + */ + void (*substate_exit)(enum pm_state state, uint8_t substate_id); + }; + }; + bool report_substate; /* 0 is for backwards compatibility that didn't report substates */ }; #if defined(CONFIG_PM) || defined(__DOXYGEN__) diff --git a/subsys/pm/pm.c b/subsys/pm/pm.c index 58448e1eba01..062c7bd623a0 100644 --- a/subsys/pm/pm.c +++ b/subsys/pm/pm.c @@ -47,19 +47,29 @@ static inline void pm_state_notify(bool entering_state) { struct pm_notifier *notifier; k_spinlock_key_t pm_notifier_key; - void (*callback)(enum pm_state state); + union { + void (*without_substate)(enum pm_state state); + void (*with_substate)(enum pm_state state, uint8_t substate_id); + } callback; pm_notifier_key = k_spin_lock(&pm_notifier_lock); SYS_SLIST_FOR_EACH_CONTAINER(&pm_notifiers, notifier, _node) { if (entering_state) { - callback = notifier->state_entry; + /* should be equivalent to also setting the "with substate" */ + callback.without_substate = notifier->state_entry; } else { - callback = notifier->state_exit; + /* should be equivalent to also setting the "with substate" */ + callback.without_substate = notifier->state_exit; } - if (callback) { - callback(z_cpus_pm_state[CPU_ID]->state); - } + if (callback.with_substate && notifier->report_substate) { + callback.with_substate(z_cpus_pm_state[CPU_ID]->state, + z_cpus_pm_state[CPU_ID]->substate_id); + } else if (callback.without_substate) { + callback.without_substate(z_cpus_pm_state[CPU_ID]->state); + } else { + /* intentionally empty */ + }; } k_spin_unlock(&pm_notifier_lock, pm_notifier_key); } From 5acf8dc1d967a6b8b6d2d1f1ad5f3e2950bfb976 Mon Sep 17 00:00:00 2001 From: Yongxu Wang Date: Thu, 4 Sep 2025 16:43:13 +0800 Subject: [PATCH 0630/3334] [nrf fromtree] pm: states: add enum-string conversion helpers Add two helper functions to convert power management states between enum and string: - pm_state_to_string() - pm_state_from_string() Signed-off-by: Yongxu Wang (cherry picked from commit 8767cec875f8d12fc6b85ec5b8ea8a7408de7d5b) --- include/zephyr/pm/state.h | 21 ++++++++++++++++++ subsys/pm/state.c | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/include/zephyr/pm/state.h b/include/zephyr/pm/state.h index ef191d87c143..91119efbb69e 100644 --- a/include/zephyr/pm/state.h +++ b/include/zephyr/pm/state.h @@ -9,6 +9,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -382,6 +383,26 @@ uint8_t pm_state_cpu_get_all(uint8_t cpu, const struct pm_state_info **states); * @return Pointer to the power state structure or NULL if state is not found. */ const struct pm_state_info *pm_state_get(uint8_t cpu, enum pm_state state, uint8_t substate_id); + +/** + * @brief Convert a pm_state enum value to its string representation. + * + * @param state Power state. + * + * @return A constant string representing the state. + */ +const char *pm_state_to_str(enum pm_state state); + + +/** + * @brief Parse a string and convert it to a pm_state enum value. + * + * @param name Input string (e.g., "suspend-to-ram"). + * @param out Pointer to store the parsed pm_state value. + * + * @return 0 on success, -EINVAL if the string is invalid or NULL. + */ +int pm_state_from_str(const char *name, enum pm_state *out); /** * @} */ diff --git a/subsys/pm/state.c b/subsys/pm/state.c index 477c462408d3..0ff8c4a4bc5f 100644 --- a/subsys/pm/state.c +++ b/subsys/pm/state.c @@ -107,3 +107,48 @@ const struct pm_state_info *pm_state_get(uint8_t cpu, enum pm_state state, uint8 return NULL; } + +const char *pm_state_to_str(enum pm_state state) +{ + switch (state) { + case PM_STATE_ACTIVE: + return "active"; + case PM_STATE_RUNTIME_IDLE: + return "runtime-idle"; + case PM_STATE_SUSPEND_TO_IDLE: + return "suspend-to-idle"; + case PM_STATE_STANDBY: + return "standby"; + case PM_STATE_SUSPEND_TO_RAM: + return "suspend-to-ram"; + case PM_STATE_SUSPEND_TO_DISK: + return "suspend-to-disk"; + case PM_STATE_SOFT_OFF: + return "soft-off"; + default: + return "UNKNOWN"; + } +} + +int pm_state_from_str(const char *name, enum pm_state *out) +{ + if (strcmp(name, "active") == 0) { + *out = PM_STATE_ACTIVE; + } else if (strcmp(name, "runtime-idle") == 0) { + *out = PM_STATE_RUNTIME_IDLE; + } else if (strcmp(name, "suspend-to-idle") == 0) { + *out = PM_STATE_SUSPEND_TO_IDLE; + } else if (strcmp(name, "standby") == 0) { + *out = PM_STATE_STANDBY; + } else if (strcmp(name, "suspend-to-ram") == 0) { + *out = PM_STATE_SUSPEND_TO_RAM; + } else if (strcmp(name, "suspend-to-disk") == 0) { + *out = PM_STATE_SUSPEND_TO_DISK; + } else if (strcmp(name, "soft-off") == 0) { + *out = PM_STATE_SOFT_OFF; + } else { + return -EINVAL; + } + + return 0; +} From a6e81844095b720efc6a2ebfb39c9c10b40bc8b3 Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Fri, 5 Sep 2025 13:28:37 -0500 Subject: [PATCH 0631/3334] [nrf fromtree] pm: Add constraint lists and APIs Some pieces of the system may have custom types of constraints that they define based on different effects and reasons than just the standard "zephyr,disabling-states". To avoid every single one of these component reinventing the wheel, make some common APIs to handle these type of custom constraint lists. Signed-off-by: Declan Snyder (cherry picked from commit a4225b1ee8b26bcb18067e272c55811a5af01465) --- include/zephyr/pm/policy.h | 30 ++++++++++ include/zephyr/pm/state.h | 81 ++++++++++++++++++++++++++- subsys/pm/policy/policy_device_lock.c | 10 ---- subsys/pm/policy/policy_state_lock.c | 16 ++++++ subsys/pm/state.c | 17 ++++++ 5 files changed, 143 insertions(+), 11 deletions(-) diff --git a/include/zephyr/pm/policy.h b/include/zephyr/pm/policy.h index eab33582b920..b38fa37f254b 100644 --- a/include/zephyr/pm/policy.h +++ b/include/zephyr/pm/policy.h @@ -125,6 +125,36 @@ void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id); */ void pm_policy_state_lock_put(enum pm_state state, uint8_t substate_id); +/** + * @brief Apply power state constraints by locking the specified states. + * + * This function locks all power states specified in the union of all constraints + * in the provided constraint list. Each constraint in the set contributes to + * determining which power states should be locked (not allowed), by increasing + * a reference count just as if pm_policy_state_lock_get was called on each constraints' + * states individually. + * + * @param constraints Pointer to the power state constraints set to apply. + * + * @see pm_policy_state_constraints_put() + */ +void pm_policy_state_constraints_get(struct pm_state_constraints *constraints); + +/** + * @brief Remove power state constraints by unlocking the specified states. + * + * This function unlocks all power states that were previously locked by a + * corresponding call to pm_policy_state_constraints_get() with the same + * constraint set. The function decreases the lock counter for each affected + * power state specified in the union of all constraints in the list, just as + * if pm_policy_state_put was called on all the constraints' states individually. + * + * @param constraints Pointer to the power state constraints set to remove. + * + * @see pm_policy_state_constraints_get() + */ +void pm_policy_state_constraints_put(struct pm_state_constraints *constraints); + /** * @brief Check if a power state lock is active (not allowed). * diff --git a/include/zephyr/pm/state.h b/include/zephyr/pm/state.h index 91119efbb69e..69d0cae8863a 100644 --- a/include/zephyr/pm/state.h +++ b/include/zephyr/pm/state.h @@ -168,7 +168,8 @@ struct pm_state_info { }; /** - * Power state information needed to lock a power state. + * Information needed to be able to reference a power state as a constraint + * on some device or system functions. */ struct pm_state_constraint { /** @@ -185,6 +186,16 @@ struct pm_state_constraint { uint8_t substate_id; }; +/** + * Collection of multiple power state constraints. + */ +struct pm_state_constraints { + /** Array of power state constraints */ + struct pm_state_constraint *list; + /** Number of constraints in the list */ + size_t count; +}; + /** @cond INTERNAL_HIDDEN */ /** @@ -359,6 +370,54 @@ struct pm_state_constraint { Z_PM_STATE_FROM_DT_CPU, (), node_id) \ } +/** + * @brief initialize a device pm constraint with information from devicetree. + * + * @param node_id Node identifier. + */ +#define PM_STATE_CONSTRAINT_INIT(node_id) \ + { \ + .state = PM_STATE_DT_INIT(node_id), \ + .substate_id = DT_PROP_OR(node_id, substate_id, 0), \ + } + +#define Z_PM_STATE_CONSTRAINT_REF(node_id, phandle, idx) \ + PM_STATE_CONSTRAINT_INIT(DT_PHANDLE_BY_IDX(node_id, phandle, idx)) + +#define Z_PM_STATE_CONSTRAINTS_LIST_NAME(node_id, phandles) \ + _CONCAT_4(node_id, _, phandles, _constraints) + +/** + * @brief Define a list of power state constraints from devicetree. + * + * This macro creates an array of pm_state_constraint structures initialized + * with power state information from the specified devicetree property. + * + * @param node_id Devicetree node identifier. + * @param prop Property name containing the list of power state phandles. + */ +#define PM_STATE_CONSTRAINTS_LIST_DEFINE(node_id, prop) \ + struct pm_state_constraint Z_PM_STATE_CONSTRAINTS_LIST_NAME(node_id, prop)[] = \ + { \ + DT_FOREACH_PROP_ELEM_SEP(node_id, prop, Z_PM_STATE_CONSTRAINT_REF, (,)) \ + } + +/** + * @brief Get power state constraints structure from devicetree. + * + * This macro creates a structure containing a pointer to the constraints list + * and the count of constraints, suitable for initializing a pm_state_constraints + * structure. Must be used after the PM_STATE_CONSTRAINTS_LIST_DEFINE call for the same + * @param prop to refer to the array of constraints. + * + * @param node_id Devicetree node identifier. + * @param prop Property name containing the list of power state phandles. + */ +#define PM_STATE_CONSTRAINTS_GET(node_id, prop) \ + { \ + .list = Z_PM_STATE_CONSTRAINTS_LIST_NAME(node_id, prop), \ + .count = DT_PROP_LEN(node_id, prop), \ + } #if defined(CONFIG_PM) || defined(__DOXYGEN__) /** @@ -403,6 +462,18 @@ const char *pm_state_to_str(enum pm_state state); * @return 0 on success, -EINVAL if the string is invalid or NULL. */ int pm_state_from_str(const char *name, enum pm_state *out); + +/** + * @brief Check if a power management constraint matches any in a set of constraints. + * + * @param constraints Pointer to the power state constraints structure. + * @param match The constraint to match against. + * + * @return true if the constraint matches, false otherwise. + */ +bool pm_state_in_constraints(const struct pm_state_constraints *constraints, + const struct pm_state_constraint match); + /** * @} */ @@ -428,6 +499,14 @@ static inline const struct pm_state_info *pm_state_get(uint8_t cpu, return NULL; } +static inline bool pm_state_in_constraints(struct pm_state_constraints *constraints, + struct pm_state_constraint match) +{ + ARG_UNUSED(constraints); + ARG_UNUSED(match); + + return false; +} #endif /* CONFIG_PM */ #ifdef __cplusplus diff --git a/subsys/pm/policy/policy_device_lock.c b/subsys/pm/policy/policy_device_lock.c index 290a1ff51597..0c70dd17a189 100644 --- a/subsys/pm/policy/policy_device_lock.c +++ b/subsys/pm/policy/policy_device_lock.c @@ -24,16 +24,6 @@ struct pm_state_device_constraint { */ #define PM_CONSTRAINTS_NAME(node_id) _CONCAT(__devicepmconstraints_, node_id) -/** - * @brief initialize a device pm constraint with information from devicetree. - * - * @param node_id Node identifier. - */ -#define PM_STATE_CONSTRAINT_INIT(node_id) \ - { \ - .state = PM_STATE_DT_INIT(node_id), \ - .substate_id = DT_PROP_OR(node_id, substate_id, 0), \ - } /** * @brief Helper macro to define a device pm constraints. diff --git a/subsys/pm/policy/policy_state_lock.c b/subsys/pm/policy/policy_state_lock.c index f69133dfe893..b4cc319339ba 100644 --- a/subsys/pm/policy/policy_state_lock.c +++ b/subsys/pm/policy/policy_state_lock.c @@ -65,6 +65,14 @@ void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id) #endif } +void pm_policy_state_constraints_get(struct pm_state_constraints *constraints) +{ + for (int i = 0; i < constraints->count; i++) { + pm_policy_state_lock_get(constraints->list[i].state, + constraints->list[i].substate_id); + } +} + void pm_policy_state_lock_put(enum pm_state state, uint8_t substate_id) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) @@ -84,6 +92,14 @@ void pm_policy_state_lock_put(enum pm_state state, uint8_t substate_id) #endif } +void pm_policy_state_constraints_put(struct pm_state_constraints *constraints) +{ + for (int i = 0; i < constraints->count; i++) { + pm_policy_state_lock_put(constraints->list[i].state, + constraints->list[i].substate_id); + } +} + bool pm_policy_state_lock_is_active(enum pm_state state, uint8_t substate_id) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) diff --git a/subsys/pm/state.c b/subsys/pm/state.c index 0ff8c4a4bc5f..3427d6684288 100644 --- a/subsys/pm/state.c +++ b/subsys/pm/state.c @@ -152,3 +152,20 @@ int pm_state_from_str(const char *name, enum pm_state *out) return 0; } + +bool pm_state_in_constraints(const struct pm_state_constraints *constraints, + const struct pm_state_constraint match) +{ + struct pm_state_constraint *constraints_list = constraints->list; + size_t num_constraints = constraints->count; + bool match_found = false; + + for (int i = 0; i < num_constraints; i++) { + enum pm_state state = constraints_list[i].state; + uint8_t substate = constraints_list[i].substate_id; + + match_found |= ((state == match.state) && (substate == match.substate_id)); + } + + return match_found; +} From b1f47bab0f62efa2fe58ff7077dc10f04046f5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 2 Oct 2025 11:56:56 +0200 Subject: [PATCH 0632/3334] [nrf fromtree] pm: policy: Add option to lock all power states MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add function for getting and putting a lock for all power states. It is much faster version of requesting 0 us latency with actual intention to disable all power states. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 336e89efd665f424d7385d3d0044cb8a54c26292) --- include/zephyr/pm/policy.h | 22 ++++++++++++++++++++++ subsys/pm/policy/policy_state_lock.c | 23 +++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/include/zephyr/pm/policy.h b/include/zephyr/pm/policy.h index b38fa37f254b..0be63d38f8ce 100644 --- a/include/zephyr/pm/policy.h +++ b/include/zephyr/pm/policy.h @@ -112,6 +112,7 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks); * * @see pm_policy_state_lock_put() */ + void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id); /** @@ -125,6 +126,18 @@ void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id); */ void pm_policy_state_lock_put(enum pm_state state, uint8_t substate_id); +/** + * @brief Request to lock all power states. + * + * Requests use a reference counter. + */ +void pm_policy_state_all_lock_get(void); + +/** + * @brief Release locking of all power states. + */ +void pm_policy_state_all_lock_put(void); + /** * @brief Apply power state constraints by locking the specified states. * @@ -274,6 +287,14 @@ static inline void pm_policy_state_lock_put(enum pm_state state, uint8_t substat ARG_UNUSED(substate_id); } +static inline void pm_policy_state_all_lock_get(void) +{ +} + +static inline void pm_policy_state_all_lock_put(void) +{ +} + static inline bool pm_policy_state_lock_is_active(enum pm_state state, uint8_t substate_id) { ARG_UNUSED(state); @@ -344,6 +365,7 @@ static inline void pm_policy_device_power_lock_put(const struct device *dev) { ARG_UNUSED(dev); } + #endif /* CONFIG_PM_POLICY_DEVICE_CONSTRAINTS */ #if defined(CONFIG_PM) || defined(CONFIG_PM_POLICY_LATENCY_STANDALONE) || defined(__DOXYGEN__) diff --git a/subsys/pm/policy/policy_state_lock.c b/subsys/pm/policy/policy_state_lock.c index b4cc319339ba..7ed8def652b0 100644 --- a/subsys/pm/policy/policy_state_lock.c +++ b/subsys/pm/policy/policy_state_lock.c @@ -43,10 +43,23 @@ static const struct { static atomic_t lock_cnt[ARRAY_SIZE(substates)]; static atomic_t latency_mask = BIT_MASK(ARRAY_SIZE(substates)); static atomic_t unlock_mask = BIT_MASK(ARRAY_SIZE(substates)); +static atomic_t global_lock_cnt; static struct k_spinlock lock; #endif +void pm_policy_state_all_lock_get(void) +{ + (void)atomic_inc(&global_lock_cnt); +} + +void pm_policy_state_all_lock_put(void) +{ + __ASSERT(global_lock_cnt > 0, "Unbalanced state lock get/put"); + (void)atomic_dec(&global_lock_cnt); +} + + void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) @@ -106,7 +119,8 @@ bool pm_policy_state_lock_is_active(enum pm_state state, uint8_t substate_id) for (size_t i = 0; i < ARRAY_SIZE(substates); i++) { if (substates[i].state == state && (substates[i].substate_id == substate_id || substate_id == PM_ALL_SUBSTATES)) { - return atomic_get(&lock_cnt[i]) != 0; + return (atomic_get(&global_lock_cnt) != 0) || + (atomic_get(&lock_cnt[i]) != 0); } } #endif @@ -117,6 +131,10 @@ bool pm_policy_state_lock_is_active(enum pm_state state, uint8_t substate_id) bool pm_policy_state_is_available(enum pm_state state, uint8_t substate_id) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) + if (atomic_get(&global_lock_cnt) != 0) { + return false; + } + for (size_t i = 0; i < ARRAY_SIZE(substates); i++) { if (substates[i].state == state && (substates[i].substate_id == substate_id || substate_id == PM_ALL_SUBSTATES)) { @@ -135,7 +153,8 @@ bool pm_policy_state_any_active(void) /* Check if there is any power state that is not locked and not disabled due * to latency requirements. */ - return atomic_get(&unlock_mask) & atomic_get(&latency_mask); + return (atomic_get(&global_lock_cnt) == 0) && + (atomic_get(&unlock_mask) & atomic_get(&latency_mask)); #endif return true; } From 034b7c87aab805c9df50c12c40733bae12ee7765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 2 Oct 2025 12:49:21 +0200 Subject: [PATCH 0633/3334] [nrf fromtree] tests: pm: policy_api: Add test for locking all PM states MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add test case that validates behavior of pm_policy_state_all_lock_get and pm_policy_state_all_lock_put. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 3595c9d0d46480e4aa76857073e07e5b29181fdc) --- include/zephyr/pm/policy.h | 2 -- subsys/pm/policy/policy_state_lock.c | 4 ++++ tests/subsys/pm/policy_api/src/main.c | 31 +++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/include/zephyr/pm/policy.h b/include/zephyr/pm/policy.h index 0be63d38f8ce..8175214e8774 100644 --- a/include/zephyr/pm/policy.h +++ b/include/zephyr/pm/policy.h @@ -112,7 +112,6 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks); * * @see pm_policy_state_lock_put() */ - void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id); /** @@ -365,7 +364,6 @@ static inline void pm_policy_device_power_lock_put(const struct device *dev) { ARG_UNUSED(dev); } - #endif /* CONFIG_PM_POLICY_DEVICE_CONSTRAINTS */ #if defined(CONFIG_PM) || defined(CONFIG_PM_POLICY_LATENCY_STANDALONE) || defined(__DOXYGEN__) diff --git a/subsys/pm/policy/policy_state_lock.c b/subsys/pm/policy/policy_state_lock.c index 7ed8def652b0..f8f5a7c41de6 100644 --- a/subsys/pm/policy/policy_state_lock.c +++ b/subsys/pm/policy/policy_state_lock.c @@ -50,13 +50,17 @@ static struct k_spinlock lock; void pm_policy_state_all_lock_get(void) { +#if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) (void)atomic_inc(&global_lock_cnt); +#endif } void pm_policy_state_all_lock_put(void) { +#if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) __ASSERT(global_lock_cnt > 0, "Unbalanced state lock get/put"); (void)atomic_dec(&global_lock_cnt); +#endif } diff --git a/tests/subsys/pm/policy_api/src/main.c b/tests/subsys/pm/policy_api/src/main.c index e336b756294d..9bd2e9fccc85 100644 --- a/tests/subsys/pm/policy_api/src/main.c +++ b/tests/subsys/pm/policy_api/src/main.c @@ -71,6 +71,37 @@ ZTEST(policy_api, test_pm_policy_next_state_default) zassert_equal(next->state, PM_STATE_SUSPEND_TO_RAM); } +ZTEST(policy_api, test_pm_policy_state_all_lock) +{ + /* initial state: PM_STATE_RUNTIME_IDLE allowed */ + zassert_false(pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); + zassert_true(pm_policy_state_is_available(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); + zassert_true(pm_policy_state_any_active()); + + /* Locking all states. */ + pm_policy_state_all_lock_get(); + pm_policy_state_all_lock_get(); + + /* States are locked. */ + zassert_true(pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); + zassert_false(pm_policy_state_is_available(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); + zassert_false(pm_policy_state_any_active()); + + pm_policy_state_all_lock_put(); + + /* States are still locked due to reference counter. */ + zassert_true(pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); + zassert_false(pm_policy_state_is_available(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); + zassert_false(pm_policy_state_any_active()); + + pm_policy_state_all_lock_put(); + + /* States are available again. */ + zassert_false(pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); + zassert_true(pm_policy_state_is_available(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); + zassert_true(pm_policy_state_any_active()); +} + /** * @brief Test the behavior of pm_policy_next_state() when * states are allowed/disallowed and CONFIG_PM_POLICY_DEFAULT=y. From d3409c65bf0bf3c207fea1d456041939126a5911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Wed, 26 Nov 2025 13:57:04 +0100 Subject: [PATCH 0634/3334] [nrf fromtree] soc: nordic: gen_uicr: Enable IS_GEN_UICR_IMAGE by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable IS_GEN_UICR_IMAGE by default for the gen_uicr image. A recent change accidentally made this default n, and broke a bunch of users. Signed-off-by: Sebastian Bøe (cherry picked from commit e0ad51e375d73961a24578e2187a4b9b547d69b7) --- soc/nordic/common/uicr/gen_uicr/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 soc/nordic/common/uicr/gen_uicr/Kconfig diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig new file mode 100644 index 000000000000..e453dbcdc7a3 --- /dev/null +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -0,0 +1,7 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config IS_GEN_UICR_IMAGE + default y + +source "Kconfig.zephyr" From dec54afb65b851f6962ad2149ac7d3e632918a90 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sun, 30 Nov 2025 21:17:35 +0530 Subject: [PATCH 0635/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Add per-peer authorized flag" This reverts commit f39dddd0880a7afc27a317671df41be23a553399. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 3 +++ drivers/wifi/nrf_wifi/src/net_if.c | 15 ++--------- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 32 ++++++------------------ drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 33 ++----------------------- 4 files changed, 14 insertions(+), 69 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index be8c9d763679..799beff1fbaf 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -75,6 +75,9 @@ struct nrf_wifi_vif_ctx_zep { #endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ struct net_stats_eth eth_stats; #endif /* CONFIG_NET_STATISTICS_ETHERNET */ +#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) + bool authorized; +#endif #ifdef CONFIG_NRF70_STA_MODE unsigned int assoc_freq; enum nrf_wifi_fmac_if_carr_state if_carr_state; diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 1e85c2e77626..0662c6c80d09 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -25,7 +25,6 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include "util.h" #include "common/fmac_util.h" -#include "system/fmac_peer.h" #include "shim.h" #include "fmac_main.h" #include "wpa_supp_if.h" @@ -389,8 +388,6 @@ int nrf_wifi_if_send(const struct device *dev, struct rpu_host_stats *host_stats = NULL; void *nbuf = NULL; bool locked = false; - unsigned char *ra = NULL; - int peer_id = -1; if (!dev || !pkt) { LOG_ERR("%s: vif_ctx_zep is NULL", __func__); @@ -439,20 +436,12 @@ int nrf_wifi_if_send(const struct device *dev, nbuf); } else { #endif /* CONFIG_NRF70_RAW_DATA_TX */ - - ra = nrf_wifi_util_get_ra(sys_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx], nbuf); - peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, ra); - if (peer_id == -1) { - nrf_wifi_osal_log_dbg("%s: Invalid peer", - __func__); - goto out; - } - if ((vif_ctx_zep->if_carr_state != NRF_WIFI_FMAC_IF_CARR_STATE_ON) || - (!sys_dev_ctx->tx_config.peers[peer_id].authorized && !is_eapol(pkt))) { + (!vif_ctx_zep->authorized && !is_eapol(pkt))) { ret = -EPERM; goto drop; } + ret = nrf_wifi_fmac_start_xmit(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, nbuf); diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 4c98ef0d8aa0..6bb31241b295 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -18,7 +18,6 @@ #include "system/fmac_api.h" #include "system/fmac_tx.h" #include "common/fmac_util.h" -#include "common/fmac_structs_common.h" #include "fmac_main.h" #include "wifi_mgmt.h" @@ -758,8 +757,6 @@ int nrf_wifi_mode(const struct device *dev, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; - struct peers_info *peer = NULL; - int i = 0; int ret = -1; if (!dev || !mode) { @@ -801,16 +798,10 @@ int nrf_wifi_mode(const struct device *dev, goto out; } - for (i = 0; i < MAX_PEERS; i++) { - peer = &sys_dev_ctx->tx_config.peers[i]; - if (peer->peer_id == -1) { - continue; - } - if (peer->authorized && (mode->mode == NRF_WIFI_MONITOR_MODE)) { - LOG_ERR("%s: Cannot set monitor mode when station is connected", - __func__); - goto out; - } + if (vif_ctx_zep->authorized && (mode->mode == NRF_WIFI_MONITOR_MODE)) { + LOG_ERR("%s: Cannot set monitor mode when station is connected", + __func__); + goto out; } /** @@ -860,8 +851,6 @@ int nrf_wifi_channel(const struct device *dev, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; - struct peers_info *peer = NULL; - int i = 0; int ret = -1; if (!dev || !channel) { @@ -875,16 +864,9 @@ int nrf_wifi_channel(const struct device *dev, return ret; } - for (i = 0; i < MAX_PEERS; i++) { - peer = &sys_dev_ctx->tx_config.peers[i]; - if (peer->peer_id == -1) { - continue; - } - if (peer->authorized) { - LOG_ERR("%s: Cannot change channel when in station connected mode", - __func__); - return ret; - } + if (vif_ctx_zep->authorized) { + LOG_ERR("%s: Cannot change channel when in station connected mode", __func__); + return ret; } rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 26893f2214e2..5885247f342e 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -17,7 +17,6 @@ #include "common/fmac_util.h" #include "wifi_mgmt.h" #include "wpa_supp_if.h" -#include LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); @@ -1108,9 +1107,7 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_umac_chg_sta_info chg_sta_info; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; - int peer_id = -1; int ret = -1; if (!if_priv || !bssid) { @@ -1141,6 +1138,8 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) memcpy(chg_sta_info.mac_addr, bssid, ETH_ALEN); + vif_ctx_zep->authorized = authorized; + if (authorized) { /* BIT(NL80211_STA_FLAG_AUTHORIZED) */ chg_sta_info.sta_flags2.nrf_wifi_mask = 1 << 1; @@ -1158,19 +1157,6 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) goto out; } - sys_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); - - peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, chg_sta_info.mac_addr); - if (peer_id == -1) { - nrf_wifi_osal_log_err("%s: Invalid peer", - __func__); - goto out; - } - - if (chg_sta_info.sta_flags2.nrf_wifi_set & NRF_WIFI_STA_FLAG_AUTHORIZED) { - sys_dev_ctx->tx_config.peers[peer_id].authorized = true; - } - ret = 0; out: k_mutex_unlock(&vif_ctx_zep->vif_lock); @@ -3003,9 +2989,7 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_umac_chg_sta_info chg_sta = {0}; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; - int peer_id = -1; int ret = -1; if (!if_priv || !addr) { @@ -3040,19 +3024,6 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, goto out; } - sys_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); - - peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, chg_sta.mac_addr); - if (peer_id == -1) { - nrf_wifi_osal_log_err("%s: Invalid peer", - __func__); - goto out; - } - - if (chg_sta.sta_flags2.nrf_wifi_set & NRF_WIFI_STA_FLAG_AUTHORIZED) { - sys_dev_ctx->tx_config.peers[peer_id].authorized = true; - } - ret = 0; out: From 82fdbd10e12f7325c8d8e70aada5f93b4d6421cb Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Wed, 12 Nov 2025 13:00:08 +0530 Subject: [PATCH 0636/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Add per-peer authorized flag Add per-peer authorized parameter. Port authorization command from supplicant will set this flag and will be used by driver to allow or nor allow data traffic. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 4 +- drivers/wifi/nrf_wifi/src/fmac_main.c | 55 +++++++++++++++++++++++++ drivers/wifi/nrf_wifi/src/net_if.c | 39 ++++++++++++++---- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 32 ++++++++++---- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 46 ++++++++++++++++++++- 5 files changed, 157 insertions(+), 19 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 799beff1fbaf..857205eeebbc 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -75,7 +75,7 @@ struct nrf_wifi_vif_ctx_zep { #endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ struct net_stats_eth eth_stats; #endif /* CONFIG_NET_STATISTICS_ETHERNET */ -#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) +#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_TX) bool authorized; #endif #ifdef CONFIG_NRF70_STA_MODE @@ -154,6 +154,8 @@ void configure_tx_pwr_settings(struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_p void configure_board_dep_params(struct nrf_wifi_board_params *board_params); void set_tx_pwr_ceil_default(struct nrf_wifi_tx_pwr_ceil_params *pwr_ceil_params); const char *nrf_wifi_get_drv_version(void); +char *nrf_wifi_sprint_ll_addr_buf(const uint8_t *ll, uint8_t ll_len, + char *buf, int buflen); enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep); enum nrf_wifi_status nrf_wifi_fmac_dev_rem_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep); struct nrf_wifi_vif_ctx_zep *nrf_wifi_get_vif_ctx(struct net_if *iface); diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 9e8ae2aafb93..ed6e425e98fe 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -114,6 +114,61 @@ static const unsigned int rx3_buf_sz = 1000; struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; static K_MUTEX_DEFINE(reg_lock); +/** + * @brief Format a link layer address to a string buffer. + * + * @param ll Pointer to the link layer address bytes. + * @param ll_len Length of the link layer address (typically 6 for MAC). + * @param buf Buffer to store the formatted string. + * @param buflen Size of the buffer. + * + * @return Pointer to the buffer on success, NULL on failure. + */ +char *nrf_wifi_sprint_ll_addr_buf(const uint8_t *ll, uint8_t ll_len, + char *buf, int buflen) +{ + uint8_t i, len, blen; + char *ptr = buf; + + if (ll == NULL) { + return ""; + } + + switch (ll_len) { + case 8: + len = 8U; + break; + case 6: + len = 6U; + break; + case 2: + len = 2U; + break; + default: + len = 6U; + break; + } + + for (i = 0U, blen = buflen; i < len && blen > 0; i++) { + uint8_t high = (ll[i] >> 4) & 0x0f; + uint8_t low = ll[i] & 0x0f; + + *ptr++ = (high < 10) ? (char)(high + '0') : + (char)(high - 10 + 'A'); + *ptr++ = (low < 10) ? (char)(low + '0') : + (char)(low - 10 + 'A'); + *ptr++ = ':'; + blen -= 3U; + } + + if (!(ptr - buf)) { + return NULL; + } + + *(ptr - 1) = '\0'; + return buf; +} + const char *nrf_wifi_get_drv_version(void) { return NRF70_DRIVER_VERSION; diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 0662c6c80d09..d4ce230ceeeb 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -25,14 +25,12 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include "util.h" #include "common/fmac_util.h" +#include "system/fmac_peer.h" #include "shim.h" #include "fmac_main.h" #include "wpa_supp_if.h" #include "net_if.h" -extern char *net_sprint_ll_addr_buf(const uint8_t *ll, uint8_t ll_len, - char *buf, int buflen); - #ifdef CONFIG_NRF70_STA_MODE static struct net_if_mcast_monitor mcast_monitor; #endif /* CONFIG_NRF70_STA_MODE */ @@ -388,6 +386,9 @@ int nrf_wifi_if_send(const struct device *dev, struct rpu_host_stats *host_stats = NULL; void *nbuf = NULL; bool locked = false; + unsigned char *ra = NULL; + int peer_id = -1; + bool authorized; if (!dev || !pkt) { LOG_ERR("%s: vif_ctx_zep is NULL", __func__); @@ -436,12 +437,30 @@ int nrf_wifi_if_send(const struct device *dev, nbuf); } else { #endif /* CONFIG_NRF70_RAW_DATA_TX */ + + ra = nrf_wifi_util_get_ra(sys_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx], nbuf); + peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, ra); + if (peer_id == -1) { + char ra_buf[18] = {0}; + + LOG_ERR("%s: Got packet for unknown PEER: %s", __func__, + nrf_wifi_sprint_ll_addr_buf(ra, 6, ra_buf, + sizeof(ra_buf))); + goto drop; + } + + /* VIF or per-peer depending on RA */ + if (peer_id == MAX_PEERS) { + authorized = vif_ctx_zep->authorized; + } else { + authorized = sys_dev_ctx->tx_config.peers[peer_id].authorized; + } + if ((vif_ctx_zep->if_carr_state != NRF_WIFI_FMAC_IF_CARR_STATE_ON) || - (!vif_ctx_zep->authorized && !is_eapol(pkt))) { + (!authorized && !is_eapol(pkt))) { ret = -EPERM; goto drop; } - ret = nrf_wifi_fmac_start_xmit(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, nbuf); @@ -484,7 +503,6 @@ static void ip_maddr_event_handler(struct net_if *iface, struct net_eth_addr mac_addr; struct nrf_wifi_umac_mcast_cfg *mcast_info = NULL; enum nrf_wifi_status status; - uint8_t mac_string_buf[sizeof("xx:xx:xx:xx:xx:xx")]; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; int ret; @@ -540,12 +558,15 @@ static void ip_maddr_event_handler(struct net_if *iface, vif_ctx_zep->vif_idx, mcast_info); if (status == NRF_WIFI_STATUS_FAIL) { + char mac_string_buf[sizeof("xx:xx:xx:xx:xx:xx")]; + LOG_ERR("%s: nrf_wifi_fmac_set_multicast failed for" " mac addr=%s", __func__, - net_sprint_ll_addr_buf(mac_addr.addr, - WIFI_MAC_ADDR_LEN, mac_string_buf, - sizeof(mac_string_buf))); + nrf_wifi_sprint_ll_addr_buf(mac_addr.addr, + WIFI_MAC_ADDR_LEN, + mac_string_buf, + sizeof(mac_string_buf))); } unlock: nrf_wifi_osal_mem_free(mcast_info); diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 6bb31241b295..4c98ef0d8aa0 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -18,6 +18,7 @@ #include "system/fmac_api.h" #include "system/fmac_tx.h" #include "common/fmac_util.h" +#include "common/fmac_structs_common.h" #include "fmac_main.h" #include "wifi_mgmt.h" @@ -757,6 +758,8 @@ int nrf_wifi_mode(const struct device *dev, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; + struct peers_info *peer = NULL; + int i = 0; int ret = -1; if (!dev || !mode) { @@ -798,10 +801,16 @@ int nrf_wifi_mode(const struct device *dev, goto out; } - if (vif_ctx_zep->authorized && (mode->mode == NRF_WIFI_MONITOR_MODE)) { - LOG_ERR("%s: Cannot set monitor mode when station is connected", - __func__); - goto out; + for (i = 0; i < MAX_PEERS; i++) { + peer = &sys_dev_ctx->tx_config.peers[i]; + if (peer->peer_id == -1) { + continue; + } + if (peer->authorized && (mode->mode == NRF_WIFI_MONITOR_MODE)) { + LOG_ERR("%s: Cannot set monitor mode when station is connected", + __func__); + goto out; + } } /** @@ -851,6 +860,8 @@ int nrf_wifi_channel(const struct device *dev, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; + struct peers_info *peer = NULL; + int i = 0; int ret = -1; if (!dev || !channel) { @@ -864,9 +875,16 @@ int nrf_wifi_channel(const struct device *dev, return ret; } - if (vif_ctx_zep->authorized) { - LOG_ERR("%s: Cannot change channel when in station connected mode", __func__); - return ret; + for (i = 0; i < MAX_PEERS; i++) { + peer = &sys_dev_ctx->tx_config.peers[i]; + if (peer->peer_id == -1) { + continue; + } + if (peer->authorized) { + LOG_ERR("%s: Cannot change channel when in station connected mode", + __func__); + return ret; + } } rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 5885247f342e..5a69676e47a1 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -17,6 +17,7 @@ #include "common/fmac_util.h" #include "wifi_mgmt.h" #include "wpa_supp_if.h" +#include LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); @@ -1107,6 +1108,7 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_umac_chg_sta_info chg_sta_info; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; int ret = -1; @@ -1128,6 +1130,12 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) goto out; } + sys_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); + if (!sys_dev_ctx) { + LOG_ERR("%s: sys_dev_ctx is NULL", __func__); + goto out; + } + if (vif_ctx_zep->if_op_state != NRF_WIFI_FMAC_IF_OP_STATE_UP) { LOG_DBG("%s: Interface not UP, ignoring", __func__); ret = 0; @@ -1139,7 +1147,6 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) memcpy(chg_sta_info.mac_addr, bssid, ETH_ALEN); vif_ctx_zep->authorized = authorized; - if (authorized) { /* BIT(NL80211_STA_FLAG_AUTHORIZED) */ chg_sta_info.sta_flags2.nrf_wifi_mask = 1 << 1; @@ -1157,6 +1164,10 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) goto out; } + if (vif_ctx_zep->if_type == NRF_WIFI_IFTYPE_STATION) { + sys_dev_ctx->tx_config.peers[0].authorized = authorized; + } + ret = 0; out: k_mutex_unlock(&vif_ctx_zep->vif_lock); @@ -2989,8 +3000,11 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_umac_chg_sta_info chg_sta = {0}; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + int peer_id = -1; int ret = -1; + char buf[18] = {0}; if (!if_priv || !addr) { LOG_ERR("%s: Invalid params", __func__); @@ -3012,18 +3026,46 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, memcpy(chg_sta.mac_addr, addr, sizeof(chg_sta.mac_addr)); + if (!net_eth_is_addr_valid((struct net_eth_addr *)&chg_sta.mac_addr)) { + LOG_ERR("%s: Invalid peer MAC address: %s", __func__, + nrf_wifi_sprint_ll_addr_buf(chg_sta.mac_addr, 6, buf, + sizeof(buf))); + goto out; + } + + peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, chg_sta.mac_addr); + if (peer_id == -1) { + LOG_ERR("%s: Unknown PEER: %s", __func__, + nrf_wifi_sprint_ll_addr_buf(chg_sta.mac_addr, 6, buf, + sizeof(buf))); + goto out; + } + + if (peer_id == MAX_PEERS) { + LOG_ERR("%s: Invalid PEER (group): %s", __func__, + nrf_wifi_sprint_ll_addr_buf(chg_sta.mac_addr, 6, buf, + sizeof(buf))); + goto out; + } + chg_sta.sta_flags2.nrf_wifi_mask = nrf_wifi_sta_flags_to_nrf(flags_or | ~flags_and); chg_sta.sta_flags2.nrf_wifi_set = nrf_wifi_sta_flags_to_nrf(flags_or); LOG_DBG("%s %x, %x", __func__, chg_sta.sta_flags2.nrf_wifi_set, chg_sta.sta_flags2.nrf_wifi_mask); - status = nrf_wifi_sys_fmac_chg_sta(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &chg_sta); + status = nrf_wifi_sys_fmac_chg_sta(rpu_ctx_zep->rpu_ctx, + vif_ctx_zep->vif_idx, &chg_sta); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_sys_fmac_chg_sta failed", __func__); goto out; } + sys_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); + + sys_dev_ctx->tx_config.peers[peer_id].authorized = + !!(chg_sta.sta_flags2.nrf_wifi_set & NRF_WIFI_STA_FLAG_AUTHORIZED); + ret = 0; out: From 18f5a4efee5c161c1508fd6baae1a98ebf7093d1 Mon Sep 17 00:00:00 2001 From: Triveni Danda Date: Fri, 28 Nov 2025 14:33:47 +0530 Subject: [PATCH 0637/3334] [nrf fromlist] drivers: wifi: nrf_wifi: Fix invalid pointer access Fix pointer dereferencing by accessing the pointer only after initialization, preventing fault exceptions. Upstream PR #: 97183 Signed-off-by: Triveni Danda --- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 4c98ef0d8aa0..1fae3d2cf2a4 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -875,18 +875,6 @@ int nrf_wifi_channel(const struct device *dev, return ret; } - for (i = 0; i < MAX_PEERS; i++) { - peer = &sys_dev_ctx->tx_config.peers[i]; - if (peer->peer_id == -1) { - continue; - } - if (peer->authorized) { - LOG_ERR("%s: Cannot change channel when in station connected mode", - __func__); - return ret; - } - } - rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; if (!rpu_ctx_zep) { LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); @@ -902,6 +890,18 @@ int nrf_wifi_channel(const struct device *dev, fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx); + for (i = 0; i < MAX_PEERS; i++) { + peer = &sys_dev_ctx->tx_config.peers[i]; + if (peer->peer_id == -1) { + continue; + } + if (peer->authorized) { + LOG_ERR("%s: Cannot change channel when in station connected mode", + __func__); + return ret; + } + } + if (channel->oper == WIFI_MGMT_SET) { /** * Send the driver vif_idx instead of upper layer sent if_index. From 18438c1fb5d064a272493f23056bde9016b8db7a Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sun, 30 Nov 2025 21:21:41 +0530 Subject: [PATCH 0638/3334] Revert "[nrf fromlist] manifest: Update nrf_wifi revision" This reverts commit 4d5da39ebc763281084f124da0f72b474f427f26. Signed-off-by: Chaitanya Tata --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 154371f993dc..daa021a445f4 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 5eec7aca321735f5fc8e3e7c79e162f0e9810b16 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: f0b6706cac522371e651f589d53d3026cc6f97dd + revision: a39e9b155830461c9d1cf587afb151b894369b91 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From 7bee8405d87f6830dd5d4fb2ffbc9de381085f14 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Mon, 3 Nov 2025 12:48:53 +0000 Subject: [PATCH 0639/3334] [nrf fromlist] manifest: Update nrf_wifi revision Update nrf_wifi revision to include support for P2P feature. Upstream PR #: 97183 Signed-off-by: Kapil Bhatt --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index daa021a445f4..50faba24d158 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 5eec7aca321735f5fc8e3e7c79e162f0e9810b16 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: a39e9b155830461c9d1cf587afb151b894369b91 + revision: 97c6751657187ab811e73c36cc4c47acb1783fff path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From c063db382bf6f0357d78ed7ca56d1006d83f1f96 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sun, 30 Nov 2025 21:27:34 +0530 Subject: [PATCH 0640/3334] [nrf fromlist] modules: hostap: Fix SoF in softap mode Due to recent changes, the stack usage is increased, fix the SoF. Upstream PR #: 97183 Signed-off-by: Chaitanya Tata --- modules/hostap/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index ec8263d85a6b..ff8327609d0b 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -60,7 +60,7 @@ config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE # overflow issues. Need to identify the cause for higher stack usage. default 8192 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE # This is needed to handle stack overflow issues on nRF Wi-Fi drivers. - default 5900 if WIFI_NM_WPA_SUPPLICANT_AP + default 6144 if WIFI_NM_WPA_SUPPLICANT_AP default 5800 config WIFI_NM_WPA_SUPPLICANT_WQ_STACK_SIZE From dd5d9933d549b9dd19ba51c0fe14fd7d55e9e7cc Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 1 Dec 2025 17:15:00 +0530 Subject: [PATCH 0641/3334] [nrf fromlist] drivers: nrf_wifi: Workaround for failing tests Test automation framework fails if there are any error prints, and we had seen issues with networking that sends packets to the driver before the assocation is up (either not checking dormant status or in a window where dormant status is being updated). Add a workaround to suppress the print till the issue root cause is fixed. Upstream PR #: 97183 Signed-off-by: Chaitanya Tata --- drivers/wifi/nrf_wifi/src/net_if.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index d4ce230ceeeb..af3186d9e428 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -441,11 +441,16 @@ int nrf_wifi_if_send(const struct device *dev, ra = nrf_wifi_util_get_ra(sys_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx], nbuf); peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, ra); if (peer_id == -1) { + /* TODO: Make this an error once we fix ping_work sending packets despite + * the interface being dormant + */ +#if CONFIG_WIFI_NRF70_LOG_LEVEL >= LOG_LEVEL_DBG char ra_buf[18] = {0}; - LOG_ERR("%s: Got packet for unknown PEER: %s", __func__, + LOG_DBG("%s: Got packet for unknown PEER: %s", __func__, nrf_wifi_sprint_ll_addr_buf(ra, 6, ra_buf, sizeof(ra_buf))); +#endif goto drop; } From 0783923a766da87024851b71030e1f70dd404b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 1 Dec 2025 13:21:29 +0100 Subject: [PATCH 0642/3334] [nrf fromlist] drivers: watchdog: wdt_nrfx: return expected error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to API docs, wdt_disable() should return EFAULT when called too early. Adjusted driver. Upstream PR #: 100302 Signed-off-by: Michał Stasiak --- drivers/watchdog/wdt_nrfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/wdt_nrfx.c b/drivers/watchdog/wdt_nrfx.c index fa1d45907c69..3881f9b55d0c 100644 --- a/drivers/watchdog/wdt_nrfx.c +++ b/drivers/watchdog/wdt_nrfx.c @@ -75,7 +75,7 @@ static int wdt_nrf_disable(const struct device *dev) if (err_code < 0) { /* This can only happen if wdt_nrf_setup() is not called first. */ - return err_code; + return -EFAULT; } #if defined(WDT_NRFX_SYNC_STOP) From 9cc2fcd8b3bbf72f1f95c9fda1e6f92569169d82 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Sat, 18 Oct 2025 14:02:49 +0100 Subject: [PATCH 0643/3334] [nrf fromtree] arch: riscv: core: vector_table: Fix local ISR generation Fixes local ISR generation so that devices actually boot, also allows enabling LTO for these builds (tested working on nrf54l15 flpr device) Signed-off-by: Jamie McCrae (cherry picked from commit 4023752a5c6eb70f3dd27bf310e8d9a9d9b3ed1f) --- arch/riscv/core/vector_table.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/core/vector_table.ld b/arch/riscv/core/vector_table.ld index 8509ff8eb87c..6a93082ed894 100644 --- a/arch/riscv/core/vector_table.ld +++ b/arch/riscv/core/vector_table.ld @@ -5,8 +5,8 @@ */ #if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) -INCLUDE isr_tables_vt.ld KEEP(*(.vectors.__start)) +INCLUDE isr_tables_vt.ld #else KEEP(*(.vectors.*)) #endif From b13f28165456210820b74cd2dc43d7066cc08a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Wed, 8 Oct 2025 13:41:16 +0200 Subject: [PATCH 0644/3334] [nrf fromtree] kernel: work: work timeout handler uninitialized variables fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit work and handler pointers are local and not initialized. Initialize them with NULL to avoid compiler error maybe-uninitialized. Signed-off-by: Łukasz Stępnicki (cherry picked from commit 6571f4e1bcf4b615a32b0483299017102c297997) --- kernel/work.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/work.c b/kernel/work.c index bcbb3b467166..301d138fac7c 100644 --- a/kernel/work.c +++ b/kernel/work.c @@ -606,8 +606,8 @@ bool k_work_cancel_sync(struct k_work *work, static void work_timeout_handler(struct _timeout *record) { struct k_work_q *queue = CONTAINER_OF(record, struct k_work_q, work_timeout_record); - struct k_work *work; - k_work_handler_t handler; + struct k_work *work = NULL; + k_work_handler_t handler = NULL; const char *name; const char *space = " "; From 4e2203637031c09adb1b9fdab0e08b8f7146ae1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Fri, 24 Oct 2025 13:33:13 +0200 Subject: [PATCH 0645/3334] [nrf fromtree] arch: riscv: core: vector_table alignement fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For RISCV vector table needs to be aligned depending on CONFIG_ARCH_IRQ_VECTOR_TABLE_ALIGN. This was missing when using LTO making issues when direct ISR were in use. Signed-off-by: Łukasz Stępnicki (cherry picked from commit a825e014d858eb2badd600da6f3163e413b6bf3f) --- arch/riscv/core/vector_table.ld | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/core/vector_table.ld b/arch/riscv/core/vector_table.ld index 6a93082ed894..5667b8935b8e 100644 --- a/arch/riscv/core/vector_table.ld +++ b/arch/riscv/core/vector_table.ld @@ -6,6 +6,7 @@ #if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) KEEP(*(.vectors.__start)) +. = ALIGN(CONFIG_ARCH_IRQ_VECTOR_TABLE_ALIGN); INCLUDE isr_tables_vt.ld #else KEEP(*(.vectors.*)) From 84698d898b1c89c782e38b69bb85916da27f0e2e Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Mon, 1 Dec 2025 10:15:21 +0100 Subject: [PATCH 0646/3334] [nrf fromlist] drivers: i2s: nrf_tdm: Add guards for buffers size TDM peripheral requires TXD.MAXCNT and RXD.MAXCNT registers to be: - multiple of 4 bytes - larger than 8 bytes Upstream PR #: 100288 Signed-off-by: Adam Kondraciuk --- drivers/i2s/i2s_nrf_tdm.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index 07c561b77503..2e9e94c07023 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -32,6 +32,11 @@ LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); */ #define NRFX_TDM_STATUS_TRANSFER_STOPPED BIT(1) +/* Due to hardware limitations, the TDM peripheral requires the rx/tx size + * to be greater than 8 bytes. + */ +#define NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED 8 + /* Maximum clock divider value. Corresponds to CKDIV2. */ #define NRFX_TDM_MAX_SCK_DIV_VALUE TDM_CONFIG_SCK_DIV_SCKDIV_Max #define NRFX_TDM_MAX_MCK_DIV_VALUE TDM_CONFIG_MCK_DIV_DIV_Max @@ -475,9 +480,11 @@ static int tdm_nrf_configure(const struct device *dev, enum i2s_dir dir, __ASSERT_NO_MSG(tdm_cfg->mem_slab != NULL && tdm_cfg->block_size != 0); - if ((tdm_cfg->block_size % sizeof(uint32_t)) != 0) { - LOG_ERR("This device can transfer only full 32-bit words"); - return -EINVAL; + if ((tdm_cfg->block_size % sizeof(uint32_t)) != 0 || + tdm_cfg->block_size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) { + LOG_ERR("This device can only transmit full 32-bit words greater than %u bytes.", + NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED); + return -EIO; } switch (tdm_cfg->word_size) { @@ -673,11 +680,18 @@ static int tdm_nrf_write(const struct device *dev, void *mem_block, size_t size) return -EIO; } - if (size > drv_data->tx.cfg.block_size || size < sizeof(uint32_t)) { + if (size > drv_data->tx.cfg.block_size) { LOG_ERR("This device can only write blocks up to %u bytes", drv_data->tx.cfg.block_size); return -EIO; } + + if ((size % sizeof(uint32_t)) != 0 || size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) { + LOG_ERR("This device can only write full 32-bit words greater than %u bytes.", + NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED); + return -EIO; + } + ret = dmm_buffer_out_prepare(drv_cfg->mem_reg, buf.mem_block, buf.size, (void **)&buf.dmm_buf); ret = k_msgq_put(&drv_data->tx_queue, &buf, SYS_TIMEOUT_MS(drv_data->tx.cfg.timeout)); From ace550c69dd6d6f37a428784dd2136e1c479edb8 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Mon, 1 Dec 2025 15:22:48 +0100 Subject: [PATCH 0647/3334] [nrf fromlist] drivers: pwm: nrf: fix nrfx instance being zeroed on suspend PWM driver clears its runtime state on each suspend event. However, since nrfx 4.0 integration nrfx driver instance is part of the runtime state structure, so clear action must be limited. Upstream PR #: 100309 Signed-off-by: Nikodem Kastelik --- drivers/pwm/pwm_nrfx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 2a97aa47dfdc..ef3c2c030ff8 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -354,7 +354,11 @@ static int pwm_suspend(const struct device *dev) while (!nrfx_pwm_stopped_check(&data->pwm)) { } - memset(dev->data, 0, sizeof(struct pwm_nrfx_data)); + /* Explicitly clear driver state that might be invalid after subsequent resume. */ + data->period_cycles = 0; + data->pwm_needed = 0; + data->prescaler = 0; + data->stop_requested = 0; (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); return 0; From 796b28fa4b098a276322b31eca3516fc190af37a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 2 Dec 2025 08:16:11 +0100 Subject: [PATCH 0648/3334] [nrf fromlist] soc: nordic: nrf_sys_event: handle errors correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrfx_power_constlat API returns negative value if the requested action has no effect, which is expected in cases of multiple requests/releases. Align nrf_sys_event to not treat it as an error. Upstream PR #: 100342 Signed-off-by: Michał Stasiak --- soc/nordic/common/nrf_sys_event.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 76664fe5f245..972487c528d9 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -76,12 +76,20 @@ int nrf_sys_event_release_global_constlat(void) int nrf_sys_event_request_global_constlat(void) { - return nrfx_power_constlat_mode_request(); + int err; + + err = nrfx_power_constlat_mode_request(); + + return (err == 0 || err == -EALREADY) ? 0 : -EAGAIN; } int nrf_sys_event_release_global_constlat(void) { - return nrfx_power_constlat_mode_free(); + int err; + + err = nrfx_power_constlat_mode_free(); + + return (err == 0 || err == -EBUSY) ? 0 : -EAGAIN; } #endif From 52a2bcec84504d5ace12641b90b1257e9a28ab19 Mon Sep 17 00:00:00 2001 From: alperen sener Date: Tue, 11 Nov 2025 16:32:10 +0100 Subject: [PATCH 0649/3334] [nrf fromtree] tests: bluetooth: tester: add support for wid 145 and 167 wid 145 requests handle of a UUID of a long characteristic. wid 167 requests to remove the characteristic by handle requested in wid 145. 2 new commands are added to support these wids: - BTP_GATT_GET_HANDLE_FROM_UUID to request handle of a certain UUID - BTP_GATT_REMOVE_HANDLE_FROM_DB to remove attribute by handle. Signed-off-by: alperen sener (cherry picked from commit 7ae81e6ad00fd5b9db53f3cef1483e3950e1203e) Signed-off-by: Pavel Vasilyev --- tests/bluetooth/tester/src/btp/btp_gatt.h | 15 +++++ tests/bluetooth/tester/src/btp_gatt.c | 76 +++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/tests/bluetooth/tester/src/btp/btp_gatt.h b/tests/bluetooth/tester/src/btp/btp_gatt.h index 1eef848aa30e..b31371948f5b 100644 --- a/tests/bluetooth/tester/src/btp/btp_gatt.h +++ b/tests/bluetooth/tester/src/btp/btp_gatt.h @@ -347,6 +347,21 @@ struct btp_gatt_cfg_notify_mult_cmd { uint16_t cnt; uint16_t attr_id[]; } __packed; + +#define BTP_GATT_GET_HANDLE_FROM_UUID 0x22 +struct btp_gatt_get_handle_from_uuid_cmd { + uint8_t uuid_length; + uint8_t uuid[]; +} __packed; +struct btp_gatt_get_handle_from_uuid_rp { + uint16_t handle; +} __packed; + +#define BTP_GATT_REMOVE_HANDLE_FROM_DB 0x23 +struct btp_gatt_remove_handle_from_db_cmd { + uint16_t handle; +} __packed; + /* GATT events */ #define BTP_GATT_EV_NOTIFICATION 0x80 struct btp_gatt_notification_ev { diff --git a/tests/bluetooth/tester/src/btp_gatt.c b/tests/bluetooth/tester/src/btp_gatt.c index e487dd2884d1..efd729751228 100644 --- a/tests/bluetooth/tester/src/btp_gatt.c +++ b/tests/bluetooth/tester/src/btp_gatt.c @@ -452,6 +452,7 @@ static int alloc_characteristic(struct add_characteristic *ch) chrc_data->uuid = attr_value->uuid; ch->char_id = attr_chrc->handle; + return 0; } @@ -2131,6 +2132,71 @@ static uint8_t notify_mult(const void *cmd, uint16_t cmd_len, } #endif /* CONFIG_BT_GATT_NOTIFY_MULTIPLE */ +static uint8_t get_handle_from_uuid(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) +{ + const struct btp_gatt_get_handle_from_uuid_cmd *cp = cmd; + struct btp_gatt_get_handle_from_uuid_rp *rp = rsp; + struct bt_uuid search_uuid; + + if (btp2bt_uuid(cp->uuid, cp->uuid_length, &search_uuid)) { + return BTP_STATUS_FAILED; + } + + __maybe_unused char uuid_str[BT_UUID_STR_LEN]; + + bt_uuid_to_str(&search_uuid, uuid_str, sizeof(uuid_str)); + + LOG_DBG("Searching handle for UUID %s", uuid_str); + + for (int i = 0; i < attr_count; i++) { + if (server_db[i].uuid != NULL && + bt_uuid_cmp(server_db[i].uuid, &search_uuid) == 0) { + rp->handle = sys_cpu_to_le16(server_db[i].handle); + *rsp_len = sizeof(*rp); + + return BTP_STATUS_SUCCESS; + } + } + + LOG_DBG("No handle found"); + return BTP_STATUS_FAILED; +} + +static uint8_t remove_by_handle_from_db(const void *cmd, uint16_t cmd_len, void *rsp, + uint16_t *rsp_len) +{ + const struct btp_gatt_remove_handle_from_db_cmd *cp = cmd; + uint16_t handle = sys_le16_to_cpu(cp->handle); + + /* Search for the service that contains the attribute with the given handle and unregister + * it. + */ + + for (int i = 0; i < svc_count; i++) { + for (int j = 0; j < server_svcs[i].attr_count; j++) { + if (server_svcs[i].attrs[j].handle == handle) { + int err; + + err = bt_gatt_service_unregister(&server_svcs[i]); + if (err < 0 && err != -ENOENT) { + LOG_ERR("Failed to unregister service [%d]: %d", i, err); + return BTP_STATUS_FAILED; + } + + if (err == -ENOENT) { + LOG_WRN("Service [%d] already unregistered", i); + } else { + LOG_DBG("Service [%d] unregistered", i); + } + + return BTP_STATUS_SUCCESS; + } + } + } + + return BTP_STATUS_FAILED; +} + struct get_attrs_foreach_data { struct net_buf_simple *buf; const struct bt_uuid *uuid; @@ -2557,6 +2623,16 @@ static const struct btp_handler handlers[] = { .expect_len = BTP_HANDLER_LENGTH_VARIABLE, .func = notify_mult, }, + { + .opcode = BTP_GATT_GET_HANDLE_FROM_UUID, + .expect_len = BTP_HANDLER_LENGTH_VARIABLE, + .func = get_handle_from_uuid, + }, + { + .opcode = BTP_GATT_REMOVE_HANDLE_FROM_DB, + .expect_len = sizeof(struct btp_gatt_remove_handle_from_db_cmd), + .func = remove_by_handle_from_db, + }, }; uint8_t tester_init_gatt(void) From 16d748b0c1da1df237c6e36e721033468a4d0303 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Mon, 1 Dec 2025 12:16:02 +0100 Subject: [PATCH 0650/3334] [nrf fromtree] bluetooth: host: Fix stale RPA usage after invalidation Add !BT_ADV_RPA_VALID check to force RPA regeneration when re-enabling an advertising set after RPA rotation occurred while disabled. The BT_ADV_RANDOM_ADDR_UPDATED flag was added to prevent unnecessary address regeneration (RPA/NRPA) between bt_le_ext_adv_param_set() and bt_le_ext_adv_start() calls. However, this revealed an issue: When RPA rotation (le_force_rpa_timeout) occurs while an advertiser is disabled, BT_ADV_RPA_VALID is cleared but the RPA is not regenerated. On subsequent bt_le_ext_adv_start() without a new param_set() call: - BT_ADV_RANDOM_ADDR_UPDATED is already cleared (from previous start) - Without BT_PER_ADV_ENABLED, no regeneration occurs - Stale RPA is used, violating privacy requirements Add !BT_ADV_RPA_VALID check for both connectable and non-connectable advertisers to ensure fresh RPA generation when the previous RPA was invalidated while the advertiser was disabled. Fixes regression introduced in #98117. Signed-off-by: Pavel Vasilyev (cherry picked from commit 6da559f56544aa2ed1c93071ffad203a523d432c) --- subsys/bluetooth/host/adv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 3a17a7192535..4c8ed649fa91 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1566,13 +1566,16 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, if (IS_ENABLED(CONFIG_BT_PRIVACY) && !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && (!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED) || - atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED))) { + atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || + !atomic_test_bit(adv->flags, BT_ADV_RPA_VALID))) { bt_id_set_adv_private_addr(adv); } } else { if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && (!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED) || - atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED))) { + atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || + (IS_ENABLED(CONFIG_BT_PRIVACY) && + !atomic_test_bit(adv->flags, BT_ADV_RPA_VALID)))) { bt_id_set_adv_private_addr(adv); } } From d2bc88b13d5e8f142cd2abed9e5bdec51c0a7336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 1 Dec 2025 12:09:25 +0100 Subject: [PATCH 0651/3334] [nrf fromlist] manifest: update hal_nordic to have nRF54l errata 55 fixed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Errata needs to apply in more cases. Upstream PR #: 100294 Signed-off-by: Michał Stasiak --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 50faba24d158..c8ba828de24a 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 564e754139944286208f3eac122781cec4262392 + revision: e891e1cda4db109c6816cc929dda4f6a18e3e1bc path: modules/hal/nordic groups: - hal From 2f27d12709a281d754f2dfe5f1bc3effa8030ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 12 Nov 2025 13:35:46 +0100 Subject: [PATCH 0652/3334] [nrf fromlist] dts: bindings: arm: add binding for Nordic TAMPC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added dts binding for Nordic Tamper Controller with property to configure SWD pins as GPIOs. Upstream PR #: 99295 Signed-off-by: Michał Stasiak --- dts/bindings/arm/nordic,nrf-tampc.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dts/bindings/arm/nordic,nrf-tampc.yaml diff --git a/dts/bindings/arm/nordic,nrf-tampc.yaml b/dts/bindings/arm/nordic,nrf-tampc.yaml new file mode 100644 index 000000000000..f0b07d7acd8b --- /dev/null +++ b/dts/bindings/arm/nordic,nrf-tampc.yaml @@ -0,0 +1,19 @@ +description: Nordic TAMPC (Tamper Controller) + +compatible: "nordic,nrf-tampc" + +include: base.yaml + +properties: + reg: + required: true + + swd-pins-as-gpios: + type: boolean + description: | + When enabled this property will configure pins dedicated to SWD + peripheral as regular GPIOs. + + SWD pins in nRF54LS05B: P1.29 and P1.30 + + This setting, once applied, can only be unset by device reset. From 361cc498f8a9b2978267940b37e63343863fbc83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 12 Nov 2025 13:40:23 +0100 Subject: [PATCH 0653/3334] [nrf fromlist] modules: hal_nordic: nrfx: allow SWD pins as GPIOs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added compile definition expected by nRF MDK that configures SWD pins as GPIOs. Upstream PR #: 99295 Signed-off-by: Michał Stasiak --- modules/hal_nordic/nrfx/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 8f6411a93b41..bc85b79fbe4e 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -204,6 +204,16 @@ if(DEFINED uicr_path) endif() endif() +dt_nodelabel(tampc_path NODELABEL "tampc") +if(DEFINED tampc_path) + dt_prop(swd_pins_as_gpios PATH ${tampc_path} PROPERTY "swd-pins-as-gpios") + if(${swd_pins_as_gpios}) + zephyr_library_compile_definitions( + NRF_CONFIG_SWD_PINS_AS_GPIOS + ) + endif() +endif() + if(CONFIG_SOC_NRF54L_CPUAPP_COMMON) # Ideally, hfpll should taken as a phandle from clocks property from cpu but it # seems that there is no such option in DT cmake functions. Assuming that nrf54l From f3cc078cbe9761282c83b5c6059fd66097ed62c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 12 Nov 2025 13:46:02 +0100 Subject: [PATCH 0654/3334] [nrf fromlist] modules: hal_nordic: nrfx: change symbol for pinreset GPIO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed symbol that configures GPIO as pinreset source, aligning to change in nRF MDK. Upstream PR #: 99295 Signed-off-by: Michał Stasiak --- modules/hal_nordic/nrfx/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index bc85b79fbe4e..0ebc92918a3a 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -200,7 +200,9 @@ if(DEFINED uicr_path) dt_prop(gpio_as_nreset PATH ${uicr_path} PROPERTY "gpio-as-nreset") if(${gpio_as_nreset}) - zephyr_library_compile_definitions(CONFIG_GPIO_AS_PINRESET) + zephyr_library_compile_definitions( + NRF_CONFIG_GPIO_AS_PINRESET + ) endif() endif() From ed09d97b549002e9534e23827b4e190ce6b1e40d Mon Sep 17 00:00:00 2001 From: Alexander Svensen Date: Thu, 27 Nov 2025 12:38:06 +0100 Subject: [PATCH 0655/3334] [nrf fromtree] tests: bluetooth: tester: Start stream from connected_cb - When we are a peripheral we want to be able to start a stream from the stream_connected_cb, given that we are in an enabling state and the stream is in the sink direction Signed-off-by: Alexander Svensen (cherry picked from commit f6cbd2f3a834c9f29d15ae0fb2f4abde6007e6ee) --- .../tester/src/audio/btp_bap_unicast.c | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index 449ac8076cae..c7c770ddca00 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -693,21 +693,21 @@ static void stream_started_cb(struct bt_bap_stream *stream) static void stream_connected_cb(struct bt_bap_stream *stream) { struct bt_conn_info conn_info; + struct bt_bap_ep_info ep_info; + int err; LOG_DBG("Connected stream %p", stream); - (void)bt_conn_get_info(stream->conn, &conn_info); - if (conn_info.role == BT_HCI_ROLE_CENTRAL) { - struct bt_bap_ep_info ep_info; - int err; + err = bt_bap_ep_get_info(stream->ep, &ep_info); + if (err != 0) { + LOG_ERR("Failed to get info: %d", err); - err = bt_bap_ep_get_info(stream->ep, &ep_info); - if (err != 0) { - LOG_ERR("Failed to get info: %d", err); + return; + } - return; - } + (void)bt_conn_get_info(stream->conn, &conn_info); + if (conn_info.role == BT_HCI_ROLE_CENTRAL) { if (ep_info.dir == BT_AUDIO_DIR_SOURCE) { if (ep_info.state == BT_BAP_EP_STATE_ENABLING) { /* Automatically do the receiver start ready operation for source @@ -727,6 +727,18 @@ static void stream_connected_cb(struct bt_bap_stream *stream) BT_ASCS_START_OP, BTP_ASCS_STATUS_SUCCESS); } + } else { + if (ep_info.dir == BT_AUDIO_DIR_SINK && ep_info.state == BT_BAP_EP_STATE_ENABLING) { + /* Automatically do the receiver start ready operation for sink + * ASEs as the server when in the enabling state. + * The CIS may be connected in the QoS Configured state as well, in + * which case we should wait until we enter the enabling state. + */ + err = bt_bap_stream_start(stream); + if (err != 0) { + LOG_ERR("Failed to start stream %p", stream); + } + } } btp_send_ascs_cis_connected_ev(stream); From fc695cbbf493d4a50e6d6c48fb0d87ebaebba998 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Tue, 2 Dec 2025 15:26:19 +0100 Subject: [PATCH 0656/3334] [nrf fromlist] modules: tf-m: Add syscall header dependency for TF-M Zephyr generates the system call headers using CMake custom targets and various scripts. Some platforms, like the Nordic onces, reuse some files located in Zephyr inside the TF-M build as well. Because of this the generated Zephyr headers needs to exist before TF-M starts the build process in order to succeed. This adds a dependency to make sure TF-M starts building after the Zephyr custom command which generates the system call headers is executed. Upstream PR #: 100367 Signed-off-by: Georgios Vasilakis --- modules/trusted-firmware-m/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 5e066130b262..0add755cdc67 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -420,6 +420,10 @@ if (CONFIG_BUILD_WITH_TFM) ${TFM_INTERFACE_LIB_DIR}/s_veneers.o ) + # Ensure that the generated syscall include headers of Zephyr are available to TF-M + # because some platforms might use the same source files for both builds. + add_dependencies(tfm ${SYSCALL_LIST_H_TARGET}) + # To ensure that generated include files are created before they are used. add_dependencies(zephyr_interface tfm) From 66cda9da197b27272cd50fbdb788620c70b05bd5 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 1 Dec 2025 09:28:21 +0100 Subject: [PATCH 0657/3334] [nrf fromlist] bluetooth: mesh: lpn shouldn't relay messages received over friendship Commit fixes the issue when lpn device relays broad- and group cast messages received over friendship queue. This is specification violation, see Table 3.13: Network layer Network PDU retransmission requirements. Also, it does not have sense since sending messages have already happened and lpn just consumes extra power to retransmit useless data. In general, lpn device will be more power efficient after this fix. Upstream PR #: 100285 Signed-off-by: Aleksandr Khromykh (cherry picked from commit b502dec131912d546de6e0e570bcb1aaf7c001e9) --- subsys/bluetooth/mesh/net.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/mesh/net.c b/subsys/bluetooth/mesh/net.c index d791ba46f9ab..f85f3e7a050c 100644 --- a/subsys/bluetooth/mesh/net.c +++ b/subsys/bluetooth/mesh/net.c @@ -924,10 +924,13 @@ void bt_mesh_net_recv(struct net_buf_simple *data, int8_t rssi, } /* Relay if this was a group/virtual address, or if the destination - * was neither a local element nor an LPN we're Friends for. + * was neither a local element nor an LPN we're Friends for, and + * device is not in Friendship as the Low Power node or the message is not encrypted using + * friendship security credentials. */ - if (!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) || - (!rx.local_match && !rx.friend_match)) { + if ((!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) || + (!rx.local_match && !rx.friend_match)) && + (!bt_mesh_lpn_established() || !rx.friend_cred)) { net_buf_simple_restore(&buf, &state); bt_mesh_net_relay(&buf, &rx, false); } From 0a6b10d81b424c927ab76fe2e5d3a7bccb4359ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stine=20=C3=85kredalen?= Date: Tue, 2 Dec 2025 15:31:20 +0100 Subject: [PATCH 0658/3334] [nrf fromlist] docs: Bluetooth: Mesh: Add Static OOB entropy requirement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates documentation for clarifying that for secure provisioning with the BTM_ECDH_P256_HMAC_SHA256_AES_CCM algorithm, the Static OOB value should contain more than 128 bits of entropy to provide adequate security against attacks. Upstream PR #: 100368 Signed-off-by: Stine Åkredalen (cherry picked from commit 3a6455e8185f4afd9a325c353915ea5998b02e91) --- doc/connectivity/bluetooth/api/mesh/provisioning.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/connectivity/bluetooth/api/mesh/provisioning.rst b/doc/connectivity/bluetooth/api/mesh/provisioning.rst index 311904882078..e595feaf529f 100644 --- a/doc/connectivity/bluetooth/api/mesh/provisioning.rst +++ b/doc/connectivity/bluetooth/api/mesh/provisioning.rst @@ -124,7 +124,9 @@ provisionee: * **Static OOB:** An authentication value is assigned to the device in production, which the provisioner can query in some application specific - way. + way. For secure provisioning with the BTM_ECDH_P256_HMAC_SHA256_AES_CCM + algorithm, the Static OOB value should contain more than 128 bits of entropy + to provide adequate security against attacks. * **Input OOB:** The user inputs the authentication value. The available input actions are listed in :c:enum:`bt_mesh_input_action_t`. * **Output OOB:** Show the user the authentication value. The available output From 2921353daef0b41c4074393a4a96c9bc9433082f Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Wed, 3 Dec 2025 10:41:44 +0100 Subject: [PATCH 0659/3334] Revert "[nrf fromlist] drivers: i2s: nrf_tdm: Add guards for buffers size" This reverts commit 84698d898b1c89c782e38b69bb85916da27f0e2e. Signed-off-by: Adam Kondraciuk --- drivers/i2s/i2s_nrf_tdm.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index 2e9e94c07023..07c561b77503 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -32,11 +32,6 @@ LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); */ #define NRFX_TDM_STATUS_TRANSFER_STOPPED BIT(1) -/* Due to hardware limitations, the TDM peripheral requires the rx/tx size - * to be greater than 8 bytes. - */ -#define NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED 8 - /* Maximum clock divider value. Corresponds to CKDIV2. */ #define NRFX_TDM_MAX_SCK_DIV_VALUE TDM_CONFIG_SCK_DIV_SCKDIV_Max #define NRFX_TDM_MAX_MCK_DIV_VALUE TDM_CONFIG_MCK_DIV_DIV_Max @@ -480,11 +475,9 @@ static int tdm_nrf_configure(const struct device *dev, enum i2s_dir dir, __ASSERT_NO_MSG(tdm_cfg->mem_slab != NULL && tdm_cfg->block_size != 0); - if ((tdm_cfg->block_size % sizeof(uint32_t)) != 0 || - tdm_cfg->block_size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) { - LOG_ERR("This device can only transmit full 32-bit words greater than %u bytes.", - NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED); - return -EIO; + if ((tdm_cfg->block_size % sizeof(uint32_t)) != 0) { + LOG_ERR("This device can transfer only full 32-bit words"); + return -EINVAL; } switch (tdm_cfg->word_size) { @@ -680,18 +673,11 @@ static int tdm_nrf_write(const struct device *dev, void *mem_block, size_t size) return -EIO; } - if (size > drv_data->tx.cfg.block_size) { + if (size > drv_data->tx.cfg.block_size || size < sizeof(uint32_t)) { LOG_ERR("This device can only write blocks up to %u bytes", drv_data->tx.cfg.block_size); return -EIO; } - - if ((size % sizeof(uint32_t)) != 0 || size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) { - LOG_ERR("This device can only write full 32-bit words greater than %u bytes.", - NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED); - return -EIO; - } - ret = dmm_buffer_out_prepare(drv_cfg->mem_reg, buf.mem_block, buf.size, (void **)&buf.dmm_buf); ret = k_msgq_put(&drv_data->tx_queue, &buf, SYS_TIMEOUT_MS(drv_data->tx.cfg.timeout)); From c717584f1a66d914fd87128b3e3c8dd952c8725c Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Mon, 1 Dec 2025 10:15:21 +0100 Subject: [PATCH 0660/3334] [nrf fromlist] drivers: i2s: nrf_tdm: Add guards for buffers size TDM peripheral requires TXD.MAXCNT and RXD.MAXCNT registers to be: - multiple of 4 bytes - larger than 8 bytes Upstream PR #: 100288 Signed-off-by: Adam Kondraciuk --- drivers/i2s/i2s_nrf_tdm.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index 07c561b77503..f1a691e0cefb 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -32,6 +32,11 @@ LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); */ #define NRFX_TDM_STATUS_TRANSFER_STOPPED BIT(1) +/* Due to hardware limitations, the TDM peripheral requires the rx/tx size + * to be greater than 8 bytes. + */ +#define NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED 8 + /* Maximum clock divider value. Corresponds to CKDIV2. */ #define NRFX_TDM_MAX_SCK_DIV_VALUE TDM_CONFIG_SCK_DIV_SCKDIV_Max #define NRFX_TDM_MAX_MCK_DIV_VALUE TDM_CONFIG_MCK_DIV_DIV_Max @@ -475,8 +480,10 @@ static int tdm_nrf_configure(const struct device *dev, enum i2s_dir dir, __ASSERT_NO_MSG(tdm_cfg->mem_slab != NULL && tdm_cfg->block_size != 0); - if ((tdm_cfg->block_size % sizeof(uint32_t)) != 0) { - LOG_ERR("This device can transfer only full 32-bit words"); + if ((tdm_cfg->block_size % sizeof(uint32_t)) != 0 || + tdm_cfg->block_size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) { + LOG_ERR("This device can only transmit full 32-bit words greater than %u bytes.", + NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED); return -EINVAL; } @@ -673,11 +680,18 @@ static int tdm_nrf_write(const struct device *dev, void *mem_block, size_t size) return -EIO; } - if (size > drv_data->tx.cfg.block_size || size < sizeof(uint32_t)) { + if (size > drv_data->tx.cfg.block_size) { LOG_ERR("This device can only write blocks up to %u bytes", drv_data->tx.cfg.block_size); return -EIO; } + + if ((size % sizeof(uint32_t)) != 0 || size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) { + LOG_ERR("This device can only write full 32-bit words greater than %u bytes.", + NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED); + return -EIO; + } + ret = dmm_buffer_out_prepare(drv_cfg->mem_reg, buf.mem_block, buf.size, (void **)&buf.dmm_buf); ret = k_msgq_put(&drv_data->tx_queue, &buf, SYS_TIMEOUT_MS(drv_data->tx.cfg.timeout)); From 8c2f434f8e6788e542283f98d9f175140f2017a5 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Mon, 1 Dec 2025 15:15:37 +0100 Subject: [PATCH 0661/3334] [nrf fromlist] bluetooth: buf: Fix callback protection for ISR context Fix assertion failure when buf_rx_freed_notify() is called from ISR by replacing k_sched_lock with atomic_ptr operations for callback pointer access. The scheduler lock is retained during callback execution in thread context to maintain backward compatibility, but is skipped in ISR context where it's not available. Updated documentation to clarify the behavior difference between thread and ISR contexts. Upstream PR #: 100308 Signed-off-by: Pavel Vasilyev (cherry picked from commit e530b153c4585835211c25d9173270d3ee467947) Signed-off-by: Pavel Vasilyev --- include/zephyr/bluetooth/buf.h | 13 ++++++++++--- subsys/bluetooth/host/buf.c | 26 ++++++++++++++++---------- subsys/bluetooth/host/iso.c | 12 ++++++++---- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/include/zephyr/bluetooth/buf.h b/include/zephyr/bluetooth/buf.h index 534c75559183..9e6553f067cc 100644 --- a/include/zephyr/bluetooth/buf.h +++ b/include/zephyr/bluetooth/buf.h @@ -196,15 +196,22 @@ struct net_buf *bt_buf_get_rx(enum bt_buf_type type, k_timeout_t timeout); * @ref bt_buf_get_rx function. However, this callback is called from the context of the buffer * freeing operation and must not attempt to allocate a new buffer from the same pool. * - * @warning When this callback is called, the scheduler is locked and the callee must not perform - * any action that makes the current thread unready. This callback must only be used for very - * short non-blocking operation (e.g. submitting a work item). + * This callback must only be used for very short non-blocking operations (e.g. submitting a work + * item). When called from thread context, the scheduler is locked during execution and the + * callee must not perform any action that makes the current thread unready. When called from ISR + * context, the callback runs without scheduler lock. + * + * @funcprops \isr_ok * * @param type_mask A bit mask of buffer types that have been freed. */ typedef void (*bt_buf_rx_freed_cb_t)(enum bt_buf_type type_mask); /** Set the callback to notify about freed buffer in the incoming data pool. + * + * It's safe to call this inside the callback itself. + * + * @funcprops \isr_ok * * @param cb Callback to notify about freed buffer in the incoming data pool. If NULL, the callback * is disabled. diff --git a/subsys/bluetooth/host/buf.c b/subsys/bluetooth/host/buf.c index ade372504243..688134f1b997 100644 --- a/subsys/bluetooth/host/buf.c +++ b/subsys/bluetooth/host/buf.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -36,17 +37,26 @@ LOG_MODULE_REGISTER(bt_buf, CONFIG_BT_LOG_LEVEL); */ #define SYNC_EVT_SIZE (BT_BUF_RESERVE + BT_HCI_EVT_HDR_SIZE + 255) -static bt_buf_rx_freed_cb_t buf_rx_freed_cb; +static atomic_ptr_t buf_rx_freed_cb; static void buf_rx_freed_notify(enum bt_buf_type mask) { - k_sched_lock(); + bt_buf_rx_freed_cb_t cb; + bool in_isr = k_is_in_isr(); - if (buf_rx_freed_cb) { - buf_rx_freed_cb(mask); + if (!in_isr) { + k_sched_lock(); } - k_sched_unlock(); + cb = (bt_buf_rx_freed_cb_t)atomic_ptr_get(&buf_rx_freed_cb); + + if (cb != NULL) { + cb(mask); + } + + if (!in_isr) { + k_sched_unlock(); + } } #if defined(CONFIG_BT_ISO_RX) @@ -134,15 +144,11 @@ struct net_buf *bt_buf_get_rx(enum bt_buf_type type, k_timeout_t timeout) void bt_buf_rx_freed_cb_set(bt_buf_rx_freed_cb_t cb) { - k_sched_lock(); - - buf_rx_freed_cb = cb; + atomic_ptr_set(&buf_rx_freed_cb, (void *)cb); #if defined(CONFIG_BT_ISO_RX) bt_iso_buf_rx_freed_cb_set(cb != NULL ? iso_rx_freed_cb : NULL); #endif - - k_sched_unlock(); } struct net_buf *bt_buf_get_evt(uint8_t evt, bool discardable, diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index a4f30a3ba0db..25897420a973 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -52,14 +52,18 @@ LOG_MODULE_REGISTER(bt_iso, CONFIG_BT_ISO_LOG_LEVEL); #define iso_chan(_iso) ((_iso)->iso.chan); #if defined(CONFIG_BT_ISO_RX) -static bt_iso_buf_rx_freed_cb_t buf_rx_freed_cb; +static atomic_ptr_t buf_rx_freed_cb; static void iso_rx_buf_destroy(struct net_buf *buf) { + bt_iso_buf_rx_freed_cb_t cb; + + cb = (bt_iso_buf_rx_freed_cb_t)atomic_ptr_get(&buf_rx_freed_cb); + net_buf_destroy(buf); - if (buf_rx_freed_cb) { - buf_rx_freed_cb(); + if (cb != NULL) { + cb(); } } @@ -642,7 +646,7 @@ struct net_buf *bt_iso_get_rx(k_timeout_t timeout) void bt_iso_buf_rx_freed_cb_set(bt_iso_buf_rx_freed_cb_t cb) { - buf_rx_freed_cb = cb; + atomic_ptr_set(&buf_rx_freed_cb, (void *)cb); } void bt_iso_recv(struct bt_conn *iso, struct net_buf *buf, uint8_t flags) From 8d22a53efb9be1bf3fc197279f7d939ac08e1698 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Fri, 14 Nov 2025 14:22:17 +0100 Subject: [PATCH 0662/3334] [nrf fromtree] boards: nordic: nrf54lm20dk: enable debugging for flpr Use specific jlink device for app and flpr core. This will enable flpr core debugging. Signed-off-by: Piotr Kosycarz (cherry picked from commit 0d1f73b6fd714bcdf27b80d4465b41bd537d0184) --- boards/nordic/nrf54lm20dk/board.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake index 6aaf6196d572..f805e0d74112 100644 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ b/boards/nordic/nrf54lm20dk/board.cmake @@ -2,9 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP) - board_runner_args(jlink "--device=cortex-m33" "--speed=4000") + board_runner_args(jlink "--device=nRF54LM20A_M33" "--speed=4000") elseif(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR) - board_runner_args(jlink "--speed=4000") + board_runner_args(jlink "--device=nRF54LM20A_RV32" "--speed=4000") endif() if(CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS) From 59c9dfe8febeeb2431a676f2edffdb2894c83f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 3 Dec 2025 15:29:16 +0100 Subject: [PATCH 0663/3334] [nrf fromlist] tests: drivers: uart: async_api: Add overlay for nRF non-secure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add configuration for nrf9160dk/nrf9160/ns and nrf5340dk/nrf5340/cpuapp/ns targets. Upstream PR #: 100461 Signed-off-by: Krzysztof Chruściński --- .../uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 3 +++ .../boards/nrf5340dk_nrf5340_cpuapp_ns.overlay | 7 +++++++ .../uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf | 4 ++++ .../uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay | 7 +++++++ 4 files changed, 21 insertions(+) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf new file mode 100644 index 000000000000..396d23ba5ae3 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -0,0 +1,3 @@ +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay new file mode 100644 index 000000000000..dd40592f3b48 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf5340dk_nrf5340_cpuapp.overlay" diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf new file mode 100644 index 000000000000..4f738f955e10 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf @@ -0,0 +1,4 @@ +CONFIG_ARM_MPU=n +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay new file mode 100644 index 000000000000..0048d6d052ce --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf9160dk_nrf9160.overlay" From 18c1bc6ba28bc425f2567cf58f4c7353fca1b6eb Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Wed, 12 Nov 2025 11:21:43 +0100 Subject: [PATCH 0664/3334] [nrf fromtree] tests: drivers: uart: uart_async_api: fix execution at lm20/ns Add required overlay. Signed-off-by: Piotr Kosycarz (cherry picked from commit 4bc8b315c701ef4dae8f6813bb42cf130350eb8c) --- .../uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf | 1 + .../boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay new file mode 100644 index 000000000000..5210e41ef553 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay @@ -0,0 +1 @@ +#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 32a0efc4684705890b84fb824f91b6109539d3b0 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 16 Oct 2025 12:53:46 +0100 Subject: [PATCH 0665/3334] [nrf fromtree] dts: vendor: nordic: nrf54lm20a: Fix invalid reg for USB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes an invalid reg value which duplicated the parents range property Signed-off-by: Jamie McCrae (cherry picked from commit 4edc35772b9baf3a79e06ae5dcc555b393c5b3c8) Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf54lm20a.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index d396e17e0cd6..f4b6be2a2352 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -226,7 +226,7 @@ usbhs: usbhs@5a000 { compatible = "nordic,nrf-usbhs-nrf54l", "snps,dwc2"; - reg = <0x5a000 0x1000>, <0x50020000 0x1a000>; + reg = <0x5a000 0x1000>, <0x20000 0x1a000>; reg-names = "wrapper", "core"; interrupts = <90 NRF_DEFAULT_IRQ_PRIORITY>; num-in-eps = <16>; From a8d610e99d8c00cad9d00b9ce52bf71fd08e430b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 2 Dec 2025 12:04:21 +0100 Subject: [PATCH 0666/3334] [nrf fromlist] soc: nordic: nrf54h: Add support for local cpurad GPPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for handling connections within the radio domain using the new GPPI helper. Upstream PR #: 100437 Signed-off-by: Krzysztof Chruściński --- soc/nordic/common/Kconfig.peripherals | 3 +- soc/nordic/common/gppi_init.c | 17 ++++++ soc/nordic/nrf54h/CMakeLists.txt | 4 ++ soc/nordic/nrf54h/nrfx_gppi_cpurad.c | 83 +++++++++++++++++++++++++++ soc/nordic/nrf54h/nrfx_gppi_cpurad.h | 26 +++++++++ 5 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 soc/nordic/nrf54h/nrfx_gppi_cpurad.c create mode 100644 soc/nordic/nrf54h/nrfx_gppi_cpurad.h diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index f15702fa291b..bbfa2c2560a1 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -42,7 +42,8 @@ config HAS_HW_NRF_DCNF def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DCNF)) config HAS_HW_NRF_DPPIC - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC)) || \ + $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC_LOCAL)) config HAS_HW_NRF_ECB def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_ECB)) diff --git a/soc/nordic/common/gppi_init.c b/soc/nordic/common/gppi_init.c index 98915491041b..cb88479b0d51 100644 --- a/soc/nordic/common/gppi_init.c +++ b/soc/nordic/common/gppi_init.c @@ -7,6 +7,8 @@ #include #if defined(NRFX_GPPI_MULTI_DOMAIN) && !defined(NRFX_GPPI_FIXED_CONNECTIONS) #include +#elif defined(CONFIG_SOC_NRF54H20_CPURAD) +#include #endif static int gppi_init(void) @@ -47,6 +49,21 @@ static int gppi_init(void) NRFX_BIT_MASK(DPPIC20_GROUP_NUM_SIZE) & ~NRFX_DPPI20_GROUPS_USED); nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC30, NRFX_BIT_MASK(DPPIC30_GROUP_NUM_SIZE) & ~NRFX_DPPI30_GROUPS_USED); +#elif defined(CONFIG_SOC_NRF54H20_CPURAD) + gppi_instance.routes = nrfx_gppi_routes_get(); + gppi_instance.route_map = nrfx_gppi_route_map_get(); + gppi_instance.nodes = nrfx_gppi_nodes_get(); + + nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC020, + NRFX_BIT_MASK(DPPIC020_CH_NUM_SIZE) & ~NRFX_DPPI020_CHANNELS_USED); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC030, + NRFX_BIT_MASK(DPPIC030_CH_NUM_SIZE) & ~NRFX_DPPI030_CHANNELS_USED); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB020_030, + NRFX_BIT_MASK(PPIB020_NTASKSEVENTS_SIZE)); + nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC020, + NRFX_BIT_MASK(DPPIC020_GROUP_NUM_SIZE) & ~NRFX_DPPI020_GROUPS_USED); + nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC030, + NRFX_BIT_MASK(DPPIC030_GROUP_NUM_SIZE) & ~NRFX_DPPI030_GROUPS_USED); #else #error "Not supported" #endif diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 25e4796a4169..59c62b0b48a3 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -17,6 +17,10 @@ if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) endif() +if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) + zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_CPURAD nrfx_gppi_cpurad.c) +endif() + zephyr_include_directories(.) # Ensure that image size aligns with 16 bytes so that MRAMC finalizes all writes diff --git a/soc/nordic/nrf54h/nrfx_gppi_cpurad.c b/soc/nordic/nrf54h/nrfx_gppi_cpurad.c new file mode 100644 index 000000000000..44bda829f8c3 --- /dev/null +++ b/soc/nordic/nrf54h/nrfx_gppi_cpurad.c @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include "nrfx_gppi_cpurad.h" + +static nrfx_atomic_t channels[NRFX_GPPI_NODE_COUNT]; +static nrfx_atomic_t group_channels[NRFX_GPPI_NODE_DPPI_COUNT]; + +static const nrfx_gppi_node_t nodes[] = { + NRFX_GPPI_DPPI_NODE_DEFINE(020, NRFX_GPPI_NODE_DPPIC020), + NRFX_GPPI_DPPI_NODE_DEFINE(030, NRFX_GPPI_NODE_DPPIC030), + NRFX_GPPI_PPIB_NODE_DEFINE(020, 030), +}; + +static const nrfx_gppi_route_t dppi_routes[] = { + NRFX_GPPI_ROUTE_DEFINE("slow_rad", (&nodes[NRFX_GPPI_NODE_DPPIC020])), + NRFX_GPPI_ROUTE_DEFINE("fast_rad", (&nodes[NRFX_GPPI_NODE_DPPIC030])), + NRFX_GPPI_ROUTE_DEFINE("slow_fast_rad", + (&nodes[NRFX_GPPI_NODE_DPPIC020], + &nodes[NRFX_GPPI_NODE_PPIB020_030], + &nodes[NRFX_GPPI_NODE_DPPIC030])), +}; + +static const nrfx_gppi_route_t *slow_rad_routes[] = { + &dppi_routes[0], &dppi_routes[2] +}; + +static const nrfx_gppi_route_t *fast_rad_routes[] = { + &dppi_routes[1] +}; + +static const nrfx_gppi_route_t **dppi_route_map[] = { + slow_rad_routes, fast_rad_routes +}; + +uint32_t nrfx_gppi_domain_id_get(uint32_t addr) +{ + uint32_t domain = (addr >> 24) & BIT_MASK(3); + uint32_t bus = (addr >> 16) & BIT_MASK(8); + + (void)domain; + __ASSERT_NO_MSG(domain == 3); + switch (bus) { + case 2: + return NRFX_GPPI_NODE_DPPIC020; + case 3: + return NRFX_GPPI_NODE_DPPIC030; + default: + __ASSERT_NO_MSG(0); + return 0; + } +} + +const nrfx_gppi_route_t ***nrfx_gppi_route_map_get(void) +{ + return dppi_route_map; +} + +const nrfx_gppi_route_t *nrfx_gppi_routes_get(void) +{ + return dppi_routes; +} + +const nrfx_gppi_node_t *nrfx_gppi_nodes_get(void) +{ + return nodes; +} + +void nrfx_gppi_channel_init(nrfx_gppi_node_id_t node_id, uint32_t ch_mask) +{ + NRFX_ASSERT(node_id < NRFX_GPPI_NODE_COUNT); + + *nodes[node_id].generic.p_channels = ch_mask; +} + +void nrfx_gppi_groups_init(nrfx_gppi_node_id_t node_id, uint32_t group_mask) +{ + NRFX_ASSERT(node_id < NRFX_GPPI_NODE_DPPI_COUNT); + + *nodes[node_id].dppi.p_group_channels = group_mask; +} diff --git a/soc/nordic/nrf54h/nrfx_gppi_cpurad.h b/soc/nordic/nrf54h/nrfx_gppi_cpurad.h new file mode 100644 index 000000000000..3d3076b5cafd --- /dev/null +++ b/soc/nordic/nrf54h/nrfx_gppi_cpurad.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ +#define SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ + +#include + +typedef enum { + NRFX_GPPI_NODE_DPPIC020, + NRFX_GPPI_NODE_DPPIC030, + NRFX_GPPI_NODE_DPPI_COUNT, + NRFX_GPPI_NODE_PPIB020_030 = NRFX_GPPI_NODE_DPPI_COUNT, + NRFX_GPPI_NODE_COUNT +} nrfx_gppi_node_id_t; + +const nrfx_gppi_route_t ***nrfx_gppi_route_map_get(void); +const nrfx_gppi_route_t *nrfx_gppi_routes_get(void); +const nrfx_gppi_node_t *nrfx_gppi_nodes_get(void); +void nrfx_gppi_channel_init(nrfx_gppi_node_id_t node_id, uint32_t ch_mask); +void nrfx_gppi_groups_init(nrfx_gppi_node_id_t node_id, uint32_t group_mask); + +#endif /* SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ */ From 084b65b8f4e8b30b1d0b3b12a363f9b52b315c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 3 Dec 2025 11:31:58 +0100 Subject: [PATCH 0667/3334] [nrf fromlist] manifest: Update hal_nordic with GPPI helper changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve GPPI documenation and fixes for bsim support in PPI implementation of GPPI helper. Upstream PR #: 100448 Signed-off-by: Krzysztof Chruściński --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index c8ba828de24a..26335c8499e0 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: e891e1cda4db109c6816cc929dda4f6a18e3e1bc + revision: 0dbbf4794156ca09dc2d4bad8c42dcdb54acd662 path: modules/hal/nordic groups: - hal From 11b28c9111b91c280df268ce58a66d1ef152cdeb Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Mon, 17 Nov 2025 08:53:09 +0100 Subject: [PATCH 0668/3334] [nrf fromtree] debug: coredump: stack top limit for current thread Extend the functionality to limit the number of stack bytes included in the core dump by allowing the limit to be different for the current thread and remaining threads. This is useful because it is more likely that we need more call frames of the thread that was running when the exception occurred than of the other threads in order to analyze the exception. Signed-off-by: Damian Krolik (cherry picked from commit 6402a58f34ae7501a4d9726f1056a9b24497345e) --- subsys/debug/coredump/Kconfig | 33 ++++++++++++++++-------- subsys/debug/coredump/coredump_core.c | 36 +++++++++++++++++---------- 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/subsys/debug/coredump/Kconfig b/subsys/debug/coredump/Kconfig index c4e93605988d..c311e706f0c3 100644 --- a/subsys/debug/coredump/Kconfig +++ b/subsys/debug/coredump/Kconfig @@ -151,20 +151,33 @@ config DEBUG_COREDUMP_THREAD_STACK_TOP DEBUG_COREDUMP_MEMORY_DUMP_THREADS depends on ARCH_SUPPORTS_COREDUMP_STACK_PTR help - This option enables dumping only the top portion of each thread's - stack, rather than the entire stack region. The top of the stack is - defined as the area from the stack pointer to the stack end, but the - size of this region can additionally be constrained using the - DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT option. + Dump only the top part of each thread's stack instead of the entire + stack region. The top of the stack is defined as the area starting + from the stack pointer and extending up to the smaller of the stack + end or the limit configured by either + DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT (for the current + thread) or DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT (for remaining ones). + +if DEBUG_COREDUMP_THREAD_STACK_TOP + +config DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT + int "Stack top size limit for current thread" + default DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT + help + The maximum number of stack bytes to be dumped for the thread running + when the exception occurred. + A negative value indicates that there is no limit, meaning that the + stack is dumped till the end of its region. config DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT - int "Stack top size limit" + int "Stack top size limit for non-current threads" default -1 - depends on DEBUG_COREDUMP_THREAD_STACK_TOP help - See the description of the DEBUG_COREDUMP_THREAD_STACK_TOP option. - The value -1 indicates that there is no limit, meaning that the stack - is dumped till the end of its region. + The maximum number of stack bytes to be dumped for threads that were + not running when the exception occurred. + A negative value indicates that there is no limit, meaning that the + stack is dumped till the end of its region. +endif # DEBUG_COREDUMP_THREAD_STACK_TOP endif # DEBUG_COREDUMP diff --git a/subsys/debug/coredump/coredump_core.c b/subsys/debug/coredump/coredump_core.c index fc56e4cf3b6e..797e92b87602 100644 --- a/subsys/debug/coredump/coredump_core.c +++ b/subsys/debug/coredump/coredump_core.c @@ -41,8 +41,16 @@ static struct coredump_backend_api #define DT_DRV_COMPAT zephyr_coredump #endif +#if defined(CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT) && \ + CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT >= 0 +#define STACK_TOP_LIMIT_FOR_CURRENT \ + ((size_t)CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT) +#else +#define STACK_TOP_LIMIT_FOR_CURRENT SIZE_MAX +#endif + #if defined(CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT) && \ - CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT > 0 + CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT >= 0 #define STACK_TOP_LIMIT ((size_t)CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT) #else #define STACK_TOP_LIMIT SIZE_MAX @@ -80,10 +88,11 @@ static void dump_header(unsigned int reason) #if defined(CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN) || \ defined(CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_THREADS) -static inline void select_stack_region(const struct k_thread *thread, uintptr_t *start, - uintptr_t *end) +static inline void select_stack_region(const struct k_thread *thread, bool is_current, + uintptr_t *start, uintptr_t *end) { uintptr_t sp; + size_t limit; *start = thread->stack_info.start; *end = thread->stack_info.start + thread->stack_info.size; @@ -99,11 +108,12 @@ static inline void select_stack_region(const struct k_thread *thread, uintptr_t *start = sp; } - /* Make sure no more than STACK_TOP_LIMIT bytes of the stack are dumped. */ - *end = *start + MIN((size_t)(*end - *start), STACK_TOP_LIMIT); + /* Make sure no more than STACK_TOP_LIMIT[_FOR_CURRENT] bytes of the stack are dumped. */ + limit = (is_current ? STACK_TOP_LIMIT_FOR_CURRENT : STACK_TOP_LIMIT); + *end = *start + MIN((size_t)(*end - *start), limit); } -static void dump_thread(struct k_thread *thread) +static void dump_thread(struct k_thread *thread, bool is_current) { uintptr_t start_addr; uintptr_t end_addr; @@ -122,7 +132,7 @@ static void dump_thread(struct k_thread *thread) end_addr = start_addr + sizeof(*thread); coredump_memory_dump(start_addr, end_addr); - select_stack_region(thread, &start_addr, &end_addr); + select_stack_region(thread, is_current, &start_addr, &end_addr); coredump_memory_dump(start_addr, end_addr); #if defined(CONFIG_DEBUG_COREDUMP_DUMP_THREAD_PRIV_STACK) @@ -140,7 +150,7 @@ static void process_coredump_dev_memory(const struct device *dev) } #endif -void process_memory_region_list(void) +void process_memory_region_list(struct k_thread *current) { #ifdef CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_LINKER_RAM unsigned int idx = 0; @@ -164,10 +174,10 @@ void process_memory_region_list(void) * Content of _kernel.threads not being modified during dump * capture so no need to lock z_thread_monitor_lock. */ - struct k_thread *current; + struct k_thread *thread; - for (current = _kernel.threads; current; current = current->next_thread) { - dump_thread(current); + for (thread = _kernel.threads; thread; thread = thread->next_thread) { + dump_thread(thread, thread == current); } /* Also add interrupt stack, in case error occurred in an interrupt */ @@ -216,11 +226,11 @@ void coredump(unsigned int reason, const struct arch_esf *esf, if (thread != NULL) { #ifdef CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN - dump_thread(thread); + dump_thread(thread, /* is_current */ true); #endif } - process_memory_region_list(); + process_memory_region_list(thread); z_coredump_end(); } From c09c6abd11695d6b9c2ea24c4e88822eee9ff3f9 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 4 Dec 2025 14:12:53 +0100 Subject: [PATCH 0669/3334] [nrf fromlist] drivers: hwinfo: nrf: fix missing reset reasons for nRF5340 Network Incorrect symbols were used for detecting nRF5340 Network-specific reset reasons presence. Upstream PR #: 100526 Signed-off-by: Nikodem Kastelik --- drivers/hwinfo/hwinfo_nrf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index 3d3314ddf581..143a7bd200b0 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -160,16 +160,22 @@ int z_impl_hwinfo_get_reset_cause(uint32_t *cause) flags |= RESET_CLOCK; } #endif -#if NRFX_RESET_REASON_HAS_NETWORK +#if NRFX_RESET_REASON_HAS_LSREQ if (reason & NRFX_RESET_REASON_LSREQ_MASK) { flags |= RESET_SOFTWARE; } +#endif +#if NRFX_RESET_REASON_HAS_LLOCKUP if (reason & NRFX_RESET_REASON_LLOCKUP_MASK) { flags |= RESET_CPU_LOCKUP; } +#endif +#if NRFX_RESET_REASON_HAS_LDOG if (reason & NRFX_RESET_REASON_LDOG_MASK) { flags |= RESET_WATCHDOG; } +#endif +#if NRFX_RESET_REASON_HAS_LCTRLAP if (reason & NRFX_RESET_REASON_LCTRLAP_MASK) { flags |= RESET_DEBUG; } From 62755cbbd8b1043256d520217273d62949bfbe3f Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Fri, 5 Dec 2025 12:47:46 +0100 Subject: [PATCH 0670/3334] [nrf fromlist] soc: nordic: uicr: fix pin function ignore handling in CTRLSEL lookup Upstream PR #: 100579 Selecting the correct CTRLSEL value for VPR IO pins relies on mapping any pinctrl psel value with the correct port/pin set on the VPR nodes in devicetree to the same CTRLSEL value, to avoid enumerating all permutations of (pin function, port, pin). However, the mechanism did not work as intended and ended up mapping all these pins to GPIO instead, which meant that the pins did not behave as expected. Update the handling so that it works as intended. Signed-off-by: Jonathan Nilsen --- soc/nordic/common/uicr/periphconf/builder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py index b8387fd9a756..8950a615f082 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -1116,19 +1116,21 @@ def lookup_ctrlsel_for_property(self, prop: Property, psel: tuple[int, int]) -> def lookup_ctrlsel_for_pinctrl(self, prop: PinCtrl, psel: NrfPsel) -> Ctrlsel | None: """Find the appopriate CTRLSEL value for a given pinctrl.""" + ctrlsel_default = None if psel.fun == NrfFun.ASSUMED_GPIO: # We map unsupported values to GPIO CTRLSEL - return CTRLSEL_DEFAULT + ctrlsel_default = CTRLSEL_DEFAULT periph_addr = dt_reg_addr(prop.node, secure=True) - return self._lookup_ctrlsel(periph_addr, psel) + return self._lookup_ctrlsel(periph_addr, psel, ctrlsel_default=ctrlsel_default) def _lookup_ctrlsel( self, periph_addr: int, prop_or_psel: NrfPsel | GpiosProp, + ctrlsel_default: Ctrlsel | None = None, ) -> Ctrlsel | None: - ctrlsel = None + ctrlsel = ctrlsel_default if periph_addr in self.ctrlsel_lookup: ident_lut = self.ctrlsel_lookup[periph_addr] From 346e6466868e29e2ee87a9bb72231e4f71dd9e37 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Thu, 4 Dec 2025 11:00:23 +0100 Subject: [PATCH 0671/3334] [nrf fromlist] nordic: nrf54h: bicrgen: patch lfosc lfxo accuracy parsing The accuracy field of lfocs lfxo is incorrectly parsed from the SVD file. Instead of stripping the "ppm" from the value before converting it to an int, we are taking only the first three digits. This works for 500ppm, but not for 20ppm. Patch to strip last three digits instead. Upstream PR #: 100506 Signed-off-by: Bjarki Arge Andreasen --- soc/nordic/nrf54h/bicr/bicrgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/bicr/bicrgen.py b/soc/nordic/nrf54h/bicr/bicrgen.py index b28fdc571a88..8b3c96526e08 100644 --- a/soc/nordic/nrf54h/bicr/bicrgen.py +++ b/soc/nordic/nrf54h/bicr/bicrgen.py @@ -324,7 +324,7 @@ def from_raw(cls: "LFXOConfig", bicr_spec: ET.Element, data: bytes) -> "LFXOConf raise ValueError("Invalid LFXO startup time (not configured)") return cls( - accuracy_ppm=int(lfosc_lfxoconfig.enum_get("ACCURACY")[:3]), + accuracy_ppm=int(lfosc_lfxoconfig.enum_get("ACCURACY")[:-3]), mode=LFXOMode(lfosc_lfxoconfig.enum_get("MODE")), builtin_load_capacitors=builtin_load_capacitors, builtin_load_capacitance_pf=builtin_load_capacitance_pf, From 6a9f0debe2cb0d47328b26f109b09649b74ab269 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Mon, 8 Dec 2025 17:05:46 +0100 Subject: [PATCH 0672/3334] [nrf fromlist] mcumgr: Prevent FW loader from self-destruction The FW loader reports and manages exactly two slots: - slot 0: this is the slot for the application code to update - slot 1: this is the slot, in which the FW loader is placed The slot 1 is reported, so tools can fetch metadata about the FW loader installed on the device. Unfortunately, currently SMP-based FW loader allows to issue slot erase command for the slot 1, effectively erasing the FW loader code that is being executed. This change correctly identifies the slot 1 as an active one, marking it as used and blocking erase operation on that slot. Upstream PR #: 100689 Signed-off-by: Tomasz Chyrowicz --- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index 0ebb722c2a90..0a594e238478 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -361,15 +361,13 @@ img_mgmt_state_any_pending(void) int img_mgmt_slot_in_use(int slot) { -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) - return 0; -#else int image = img_mgmt_slot_to_image(slot); int active_slot = img_mgmt_active_slot(image); #if !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) && \ !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) && \ - !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) + !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) && \ + !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) enum img_mgmt_next_boot_type type = NEXT_BOOT_TYPE_NORMAL; int nbs = img_mgmt_get_next_boot_slot(image, &type); @@ -391,7 +389,6 @@ img_mgmt_slot_in_use(int slot) #endif return (active_slot == slot); -#endif /* !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) */ } /** From c3f25395efc494108e389208e77d3f90717b2d08 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 4 Dec 2025 10:29:47 +0000 Subject: [PATCH 0673/3334] [nrf fromtree] drivers: mspi_dw: nrf_qspi_v2: Update to align nrfx 4.0.1 New nrfx release makes including nrf.h invalid. Signed-off-by: David Jewsbury (cherry picked from commit c7eccea6291cc99c848b5afb10810b25cdf913f1) --- drivers/mspi/mspi_dw_vendor_specific.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index 6a76361ccf1c..d994f579ad8e 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -98,7 +98,7 @@ static inline int vendor_specific_xip_disable(const struct device *dev, #endif /* defined(CONFIG_MSPI_XIP) */ #elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) -#include +#include static inline void vendor_specific_init(const struct device *dev) { From 0d88c8902af386655b9007c602afab11e96a005f Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 19 Nov 2025 17:21:27 +0100 Subject: [PATCH 0674/3334] [nrf fromtree] soc: nordic: uicr: Parse pinctrls for local domain peripherals Generate PERIPHCONF SPU/CTRLSEL entries based on pinctrl properties on the local domain peripherals as well as the global ones. This fixes an issue where the required pin configuration was not generated for the pinctrls on the radio local domain GPIOTE0 on nrf54h20. The secure attribute of nodes without an address and without a bus node are now interpreted as being secure by default, instead of failing with an error. This prevents the parsing of certain nodes from triggering failing the build (in particular the 'ieee802154' node in cpurad_peripherals). Signed-off-by: Jonathan Nilsen (cherry picked from commit b1c68f53c91c2c1532826ceebf54246553fc0735) --- soc/nordic/common/uicr/periphconf/builder.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py index 8950a615f082..34ccc6f7b497 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -150,7 +150,7 @@ def add_local_peripheral_cfg( :param node_or_nodelabel: node or label of the node to process. """ - self._add_peripheral_cfg(node_or_nodelabel, is_global=False, add_gpios=False) + self._add_peripheral_cfg(node_or_nodelabel, is_global=False) def add_global_peripheral_cfg( self, @@ -182,7 +182,6 @@ def _add_peripheral_cfg( is_global: bool = True, has_irq_mapping: bool = True, add_ppib_channel_links: bool = True, - add_gpios: bool = True, ) -> None: if isinstance(node_or_nodelabel, str): node = self._dt.label2node[node_or_nodelabel] @@ -223,13 +222,11 @@ def _add_peripheral_cfg( if "nordic,nrf-comp" in node.compats or "nordic,nrf-lpcomp" in node.compats: self._add_nrf_comp_lpcomp_channel_pin_spu_permissions(node) - self._add_peripheral_pinctrls_spu_permissions_and_ctrlsel(node) - if "nordic,nrf-ipct-local" in node.compats: self._add_nrf_ipct_ipcmap_channel_links(node) - if add_gpios: - self._add_peripheral_gpios_spu_permissions_and_ctrlsel(node) + self._add_peripheral_pinctrls_spu_permissions_and_ctrlsel(node) + self._add_peripheral_gpios_spu_permissions_and_ctrlsel(node) def add_gpio_spu_permissions(self, node_or_nodelabel: Node | str, /) -> None: """Generate macros for populating SPU FEATURE.GPIO[n].PIN[m] registers based on @@ -884,10 +881,12 @@ def dt_node_is_secure(node: Node) -> bool: elif node.regs: addr = dt_reg_addr(node) else: - raise ValueError( + log.debug( f"Failed to determine security of {node.path} " - "from the address of its bus node or itself" + "from the address of its bus node or itself. " + "Defaulting to Secure." ) + return True return Address(addr).security From 13f0ae1445f47a553c85b759766f4da4719eea71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grochala?= Date: Wed, 3 Dec 2025 14:57:14 +0100 Subject: [PATCH 0675/3334] [nrf fromlist] soc: nordic: nrf54l: Remove selecting a DTS-type option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove selecting `CONFIG_HAS_HW_NRF_RADIO_IEEE802154` that should be generated from DTS based on the SoC selection. Upstream PR #: 100518 Signed-off-by: Michał Grochala --- soc/nordic/nrf54l/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 7c09a90cf83c..8547c3e12381 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -16,7 +16,6 @@ config SOC_NRF54L_CPUAPP_COMMON select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT select CPU_HAS_ICACHE - select HAS_HW_NRF_RADIO_IEEE802154 select HAS_POWEROFF select HAS_NORDIC_RAM_CTRL From 3fd1ded647b1a248a76cdb83952381450f00f5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 9 Dec 2025 11:56:23 +0100 Subject: [PATCH 0676/3334] [nrf fromlist] drivers: i2c: clean-up macros used in nrfx_twim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed unused macros. Moved common macros to common header. Aligned naming and style to other nrf drivers. Upstream PR #: 93083 Signed-off-by: Michał Stasiak --- drivers/i2c/i2c_nrfx_twim.c | 95 ++++++++----------- drivers/i2c/i2c_nrfx_twim_common.h | 46 +++++---- drivers/i2c/i2c_nrfx_twim_rtio.c | 144 +++++++++++++---------------- 3 files changed, 134 insertions(+), 151 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index 8eee1949bdf4..0229ad5194cb 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -243,62 +243,43 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { #define DT_DRV_COMPAT nordic_nrf_twim #endif -#define CONCAT_BUF_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_concat_buf_size), \ - (DT_INST_PROP(idx, zephyr_concat_buf_size)), (0)) -#define FLASH_BUF_MAX_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_flash_buf_max_size), \ - (DT_INST_PROP(idx, zephyr_flash_buf_max_size)), (0)) - -#define USES_MSG_BUF(idx) \ - COND_CODE_0(CONCAT_BUF_SIZE(idx), \ - (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), \ - (1)) -#define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) - -#define I2C_NRFX_TWIM_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static struct i2c_nrfx_twim_data twim_##idx##_data; \ - static struct i2c_nrfx_twim_common_config twim_##idx##z_config; \ - static void pre_init##idx(void) \ - { \ - twim_##idx##z_config.twim = &twim_##idx##_data.twim; \ - twim_##idx##_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \ - IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \ - &twim_##idx##_data.twim, 0); \ - } \ - IF_ENABLED(USES_MSG_BUF(idx), \ - (static uint8_t twim_##idx##_msg_buf[MSG_BUF_SIZE(idx)] \ - I2C_MEMORY_SECTION(idx);)) \ - PINCTRL_DT_INST_DEFINE(idx); \ - static struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ - .twim_config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .pre_init = pre_init##idx, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ - IF_ENABLED(USES_MSG_BUF(idx), \ - (.msg_buf = twim_##idx##_msg_buf,)) .max_transfer_size = \ - BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)), \ - }; \ - PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ - I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \ - PM_DEVICE_DT_INST_GET(idx), &twim_##idx##_data, \ - &twim_##idx##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api) - -#define I2C_MEMORY_SECTION(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions), \ - (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ - DT_PHANDLE(DT_DRV_INST(idx), memory_regions)))))), \ - ()) +#define I2C_NRFX_TWIM_DEVICE(inst) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ + BUILD_ASSERT(I2C_FREQUENCY(inst) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #inst " frequency setting in dts"); \ + static struct i2c_nrfx_twim_data twim_##inst##_data; \ + static struct i2c_nrfx_twim_common_config twim_##inst##z_config; \ + static void pre_init##inst(void) \ + { \ + twim_##inst##z_config.twim = &twim_##inst##_data.twim; \ + twim_##inst##_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(inst); \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ + nrfx_twim_irq_handler, &twim_##inst##_data.twim, 0); \ + } \ + IF_ENABLED(USES_MSG_BUF(inst), \ + (static uint8_t twim_##inst##_msg_buf[MSG_BUF_SIZE(inst)] \ + DMM_MEMORY_SECTION(DT_DRV_INST(inst));)) \ + PINCTRL_DT_INST_DEFINE(inst); \ + static struct i2c_nrfx_twim_common_config twim_##inst##z_config = { \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(inst), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(inst), \ + .pre_init = pre_init##inst, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ + IF_ENABLED(USES_MSG_BUF(inst), \ + (.msg_buf = twim_##inst##_msg_buf,)) \ + .max_transfer_size = MAX_TRANSFER_SIZE(inst), \ + }; \ + PM_DEVICE_DT_INST_DEFINE(inst, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(inst)); \ + I2C_DEVICE_DT_INST_DEINIT_DEFINE(inst, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \ + PM_DEVICE_DT_INST_GET(inst), &twim_##inst##_data, \ + &twim_##inst##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api) \ DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWIM_DEVICE) diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index c51932af5fd3..a0894cdcac86 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -26,10 +26,8 @@ extern "C" { (bitrate == I2C_BITRATE_FAST_PLUS ? NRF_TWIM_FREQ_1000K :)) \ I2C_NRFX_TWIM_INVALID_FREQUENCY) -#define I2C(idx) DT_NODELABEL(i2c##idx) -#define I2C_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(I2C(idx), prop) -#define I2C_FREQUENCY(node) \ - I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(node, clock_frequency, I2C_BITRATE_STANDARD)) +#define I2C_FREQUENCY(inst) \ + I2C_NRFX_TWIM_FREQUENCY(DT_INST_PROP_OR(inst, clock_frequency, I2C_BITRATE_STANDARD)) /* Macro determines PM actions interrupt safety level. * @@ -38,20 +36,36 @@ extern "C" { * no longer ISR safe. This macro let's us check if we will be requesting/releasing * power domains and determines PM device ISR safety value. */ -#define I2C_PM_ISR_SAFE(idx) \ - COND_CODE_1( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND( \ - DT_NODE_HAS_PROP(DT_DRV_INST(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(DT_DRV_INST(idx), \ - power_domains)) \ - ) \ - ), \ - (0), \ - (PM_DEVICE_ISR_SAFE) \ +#define I2C_PM_ISR_SAFE(inst) \ + COND_CODE_1( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND( \ + DT_NODE_INST_HAS_PROP(inst, power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_INST_PHANDLE(inst, power_domains)) \ + ) \ + ), \ + (0), \ + (PM_DEVICE_ISR_SAFE) \ ) +#define CONCAT_BUF_SIZE(inst) \ + COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, zephyr_concat_buf_size), \ + (DT_INST_PROP(inst, zephyr_concat_buf_size)), (0)) + +#define FLASH_BUF_MAX_SIZE(inst) \ + COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, zephyr_flash_buf_max_size), \ + (DT_INST_PROP(inst, zephyr_flash_buf_max_size)), (0)) + +#define USES_MSG_BUF(inst) \ + COND_CODE_0(CONCAT_BUF_SIZE(inst), \ + (COND_CODE_0(FLASH_BUF_MAX_SIZE(inst), (0), (1))), \ + (1)) + +#define MSG_BUF_SIZE(inst) MAX(CONCAT_BUF_SIZE(inst), FLASH_BUF_MAX_SIZE(inst)) + +#define MAX_TRANSFER_SIZE(inst) BIT_MASK(DT_INST_PROP(inst, easydma_maxcnt_bits)) + struct i2c_nrfx_twim_common_config { nrfx_twim_config_t twim_config; nrfx_twim_event_handler_t event_handler; diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 872c5859bd91..0dbef19c4fab 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -219,85 +219,73 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) return i2c_nrfx_twim_common_deinit(dev); } -#define CONCAT_BUF_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_concat_buf_size), \ - (DT_INST_PROP(idx, zephyr_concat_buf_size)), (0)) -#define FLASH_BUF_MAX_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_flash_buf_max_size), \ - (DT_INST_PROP(idx, zephyr_flash_buf_max_size)), (0)) - -#define USES_MSG_BUF(idx) \ - COND_CODE_0(CONCAT_BUF_SIZE(idx), (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), (1)) -#define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) - -#define MSG_BUF_HAS_MEMORY_REGIONS(idx) DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions) - -#define MSG_BUF_LINKER_REGION_NAME(idx) \ - LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(DT_DRV_INST(idx), memory_regions)) - -#define MSG_BUF_ATTR_SECTION(idx) \ - __attribute__((__section__(MSG_BUF_LINKER_REGION_NAME(idx)))) - -#define MSG_BUF_ATTR(idx) \ - COND_CODE_1( \ - MSG_BUF_HAS_MEMORY_REGIONS(idx), \ - (MSG_BUF_ATTR_SECTION(idx)), \ - () \ +#define MSG_BUF_HAS_MEMORY_REGIONS(inst) DT_INST_NODE_HAS_PROP(inst, memory_regions) + +#define MSG_BUF_LINKER_REGION_NAME(inst) \ + LINKER_DT_NODE_REGION_NAME(DT_INST_PHANDLE(inst, memory_regions)) + +#define MSG_BUF_ATTR_SECTION(inst) \ + __attribute__((__section__(MSG_BUF_LINKER_REGION_NAME(inst)))) + +#define MSG_BUF_ATTR(inst) \ + COND_CODE_1( \ + MSG_BUF_HAS_MEMORY_REGIONS(inst), \ + (MSG_BUF_ATTR_SECTION(inst)), \ + () \ ) -#define MSG_BUF_SYM(idx) \ - _CONCAT_3(twim_, idx, _msg_buf) - -#define MSG_BUF_DEFINE(idx) \ - static uint8_t MSG_BUF_SYM(idx)[MSG_BUF_SIZE(idx)] MSG_BUF_ATTR(idx) - -#define MAX_TRANSFER_SIZE(idx) BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)) - -#define I2C_NRFX_TWIM_RTIO_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data = { \ - .twim = \ - { \ - .p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx), \ - }, \ - }; \ - static void pre_init##idx(void) \ - { \ - twim_##idx##z_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \ - IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \ - &twim_##idx##z_data.twim, 0); \ - } \ - IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ - I2C_RTIO_DEFINE(_i2c##idx##_twim_rtio, \ - DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ - DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ - PINCTRL_DT_INST_DEFINE(idx); \ - static const struct i2c_nrfx_twim_rtio_config twim_##idx##z_config = { \ - .common = \ - { \ - .twim_config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .pre_init = pre_init##idx, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ - IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) \ - .max_transfer_size = MAX_TRANSFER_SIZE(idx), \ - .twim = &twim_##idx##z_data.twim, \ - }, \ - .ctx = &_i2c##idx##_twim_rtio, \ - }; \ - PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ - I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ - PM_DEVICE_DT_INST_GET(idx), &twim_##idx##z_data, \ - &twim_##idx##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api); +#define MSG_BUF_SYM(inst) \ + _CONCAT_3(twim_, inst, _msg_buf) + +#define MSG_BUF_DEFINE(inst) \ + static uint8_t MSG_BUF_SYM(inst)[MSG_BUF_SIZE(inst)] MSG_BUF_ATTR(inst) + +#define I2C_NRFX_TWIM_RTIO_DEVICE(inst) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ + BUILD_ASSERT(I2C_FREQUENCY(inst) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #inst " frequency setting in dts"); \ + static struct i2c_nrfx_twim_rtio_data twim_##inst##z_data = { \ + .twim = \ + { \ + .p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(inst), \ + }, \ + }; \ + static void pre_init##inst(void) \ + { \ + twim_##inst##z_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(inst); \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ + nrfx_twim_irq_handler, &twim_##inst##z_data.twim, 0); \ + } \ + IF_ENABLED(USES_MSG_BUF(inst), (MSG_BUF_DEFINE(inst);)) \ + I2C_RTIO_DEFINE(_i2c##inst##_twim_rtio, \ + DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ + DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ + PINCTRL_DT_INST_DEFINE(inst); \ + static const struct i2c_nrfx_twim_rtio_config twim_##inst##z_config = { \ + .common = \ + { \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(inst), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(inst), \ + .pre_init = pre_init##inst, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ + IF_ENABLED(USES_MSG_BUF(inst), (.msg_buf = MSG_BUF_SYM(inst),)) \ + .max_transfer_size = MAX_TRANSFER_SIZE(inst), \ + .twim = &twim_##inst##z_data.twim, \ + }, \ + .ctx = &_i2c##inst##_twim_rtio, \ + }; \ + PM_DEVICE_DT_INST_DEFINE(inst, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(inst)); \ + I2C_DEVICE_DT_INST_DEINIT_DEFINE(inst, i2c_nrfx_twim_rtio_init, \ + i2c_nrfx_twim_rtio_deinit, \ + PM_DEVICE_DT_INST_GET(inst), &twim_##inst##z_data, \ + &twim_##inst##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api); \ DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWIM_RTIO_DEVICE) From 306d6a7e8fdce34a4060705a3c9b6f8acd5d61d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 9 Dec 2025 13:37:27 +0100 Subject: [PATCH 0677/3334] [nrf fromlist] drivers: i2c: add DMM to i2c_nrfx_twim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added DMM buffer preparation to I2C TWIM driver. Adds little impact as buffer content is already copied into message buffer which is places in proper memory for optimized transfer. Upstream PR #: 93083 Signed-off-by: Michał Stasiak --- drivers/i2c/i2c_nrfx_twim.c | 32 +++++++++++++++++++++++++++++- drivers/i2c/i2c_nrfx_twim_common.h | 1 + 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index 0229ad5194cb..9cd8061dcb7c 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,7 @@ struct i2c_nrfx_twim_data { struct k_sem transfer_sync; struct k_sem completion_sync; volatile int res; + uint8_t *buf_ptr; }; int i2c_nrfx_twim_exclusive_access_acquire(const struct device *dev, k_timeout_t timeout) @@ -70,6 +72,7 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, uint16_t msg_buf_size = dev_config->msg_buf_size; uint8_t *buf; uint16_t buf_len; + uint8_t *dma_buf; (void)i2c_nrfx_twim_exclusive_access_acquire(dev, K_FOREVER); @@ -134,7 +137,23 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, buf = msg_buf; buf_len = msg_buf_used; } - ret = i2c_nrfx_twim_msg_transfer(dev, msgs[i].flags, buf, buf_len, addr); + + if (msgs[i].flags & I2C_MSG_READ) { + ret = dmm_buffer_in_prepare(dev_config->mem_reg, buf, buf_len, + (void **)&dma_buf); + } else { + ret = dmm_buffer_out_prepare(dev_config->mem_reg, buf, buf_len, + (void **)&dma_buf); + } + + if (ret < 0) { + LOG_ERR("Failed to prepare buffer: %d", ret); + return ret; + } + + dev_data->buf_ptr = buf; + + ret = i2c_nrfx_twim_msg_transfer(dev, msgs[i].flags, dma_buf, buf_len, addr); if (ret < 0) { break; } @@ -196,6 +215,16 @@ static void event_handler(nrfx_twim_event_t const *p_event, void *p_context) { const struct device *dev = p_context; struct i2c_nrfx_twim_data *dev_data = dev->data; + const struct i2c_nrfx_twim_common_config *config = dev->config; + + if (p_event->xfer_desc.type == NRFX_TWIM_XFER_TX) { + dmm_buffer_out_release(config->mem_reg, + (void **)&p_event->xfer_desc.p_primary_buf); + } else { + dmm_buffer_in_release(config->mem_reg, dev_data->buf_ptr, + p_event->xfer_desc.primary_length, + p_event->xfer_desc.p_primary_buf); + } switch (p_event->type) { case NRFX_TWIM_EVT_DONE: @@ -275,6 +304,7 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { IF_ENABLED(USES_MSG_BUF(inst), \ (.msg_buf = twim_##inst##_msg_buf,)) \ .max_transfer_size = MAX_TRANSFER_SIZE(inst), \ + .mem_reg = DMM_DEV_TO_REG(DT_DRV_INST(inst)), \ }; \ PM_DEVICE_DT_INST_DEFINE(inst, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(inst)); \ I2C_DEVICE_DT_INST_DEINIT_DEFINE(inst, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \ diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index a0894cdcac86..21ba3c601ac0 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -75,6 +75,7 @@ struct i2c_nrfx_twim_common_config { uint8_t *msg_buf; uint16_t max_transfer_size; nrfx_twim_t *twim; + void *mem_reg; }; int i2c_nrfx_twim_common_init(const struct device *dev); From 2cac023fcdcf302be4dd0a69c63c947060179c59 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Thu, 27 Nov 2025 14:40:11 +0100 Subject: [PATCH 0678/3334] [nrf fromtree] drivers: nrf: Clean up remnants of nrfx error codes Starting with nrfx 4.0.0, the nrfx_err_t, NRFX_SUCCESS and NRFX_ERROR_* have been deprecated. Most of them were removed here: https://github.com/zephyrproject-rtos/zephyr/pull/99399 but a few were missed. Signed-off-by: Carles Cufi (cherry picked from commit a264b54f373d6c5f521b14840a72654b32f05b58) --- drivers/i2c/i2c_nrfx_twi.c | 2 +- drivers/i2c/i2c_nrfx_twi_common.h | 10 +++++----- drivers/i2c/i2c_nrfx_twi_rtio.c | 2 +- .../common/nrf_usbd_common/nrf_usbd_common.c | 18 +++++++++--------- .../common/nrf_usbd_common/nrf_usbd_common.h | 14 +++++++------- drivers/usb/device/usb_dc_nrfx.c | 18 +++++++++--------- modules/hal_nordic/nrfx/nrfx_glue.h | 10 ---------- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 4 ++-- 8 files changed, 34 insertions(+), 44 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c index a28ec6f08a05..12d40ee7323e 100644 --- a/drivers/i2c/i2c_nrfx_twi.c +++ b/drivers/i2c/i2c_nrfx_twi.c @@ -90,7 +90,7 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, break; } - if (data->res != NRFX_SUCCESS) { + if (data->res != 0) { ret = -EIO; break; } diff --git a/drivers/i2c/i2c_nrfx_twi_common.h b/drivers/i2c/i2c_nrfx_twi_common.h index a3e9847bab5b..3f81b5cc94e0 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.h +++ b/drivers/i2c/i2c_nrfx_twi_common.h @@ -36,17 +36,17 @@ struct i2c_nrfx_twi_config { const struct pinctrl_dev_config *pcfg; }; -static inline nrfx_err_t i2c_nrfx_twi_get_evt_result(nrfx_twi_evt_t const *p_event) +static inline int i2c_nrfx_twi_get_evt_result(nrfx_twi_evt_t const *p_event) { switch (p_event->type) { case NRFX_TWI_EVT_DONE: - return NRFX_SUCCESS; + return 0; case NRFX_TWI_EVT_ADDRESS_NACK: - return NRFX_ERROR_DRV_TWI_ERR_ANACK; + __fallthrough; case NRFX_TWI_EVT_DATA_NACK: - return NRFX_ERROR_DRV_TWI_ERR_DNACK; + return -EIO; default: - return NRFX_ERROR_INTERNAL; + return -EINVAL; } } diff --git a/drivers/i2c/i2c_nrfx_twi_rtio.c b/drivers/i2c/i2c_nrfx_twi_rtio.c index e8374f317f47..531b9eaac261 100644 --- a/drivers/i2c/i2c_nrfx_twi_rtio.c +++ b/drivers/i2c/i2c_nrfx_twi_rtio.c @@ -154,7 +154,7 @@ static void event_handler(nrfx_twi_evt_t const *p_event, void *p_context) const struct device *dev = p_context; int status = 0; - if (i2c_nrfx_twi_get_evt_result(p_event) != NRFX_SUCCESS) { + if (i2c_nrfx_twi_get_evt_result(p_event) != 0) { status = -EIO; } 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 9e5024837659..655f643fb64c 100644 --- a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c +++ b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c @@ -248,7 +248,7 @@ typedef struct { size_t transfer_cnt; /** Configured endpoint size. */ uint16_t max_packet_size; - /** NRFX_SUCCESS or error code, never NRFX_ERROR_BUSY - this one is calculated. */ + /** NRF_USBD_COMMON_EP_* - this one is calculated. */ nrf_usbd_common_ep_status_t status; } usbd_ep_state_t; @@ -1096,12 +1096,12 @@ void nrf_usbd_common_irq_handler(void) /** @} */ /** @} */ -nrfx_err_t nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler) +int nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler) { __ASSERT_NO_MSG(event_handler); if (m_drv_state != NRFX_DRV_STATE_UNINITIALIZED) { - return NRFX_ERROR_INVALID_STATE; + return -EALREADY; } m_event_handler = event_handler; @@ -1132,7 +1132,7 @@ nrfx_err_t nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler) p_state->transfer_cnt = 0; } - return NRFX_SUCCESS; + return 0; } void nrf_usbd_common_uninit(void) @@ -1458,10 +1458,10 @@ void nrf_usbd_common_ep_disable(nrf_usbd_common_ep_t ep) usbd_int_rise(); } -nrfx_err_t nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, +int nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, nrf_usbd_common_transfer_t const *p_transfer) { - nrfx_err_t ret; + int ret; const uint8_t ep_bitpos = ep2bit(ep); unsigned int irq_lock_key = irq_lock(); @@ -1469,7 +1469,7 @@ nrfx_err_t nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, /* Setup data transaction can go only in one direction at a time */ if ((NRF_USBD_COMMON_EP_NUM(ep) == 0) && (ep != m_last_setup_dir)) { - ret = NRFX_ERROR_INVALID_ADDR; + ret = -EFAULT; if (NRF_USBD_COMMON_FAILED_TRANSFERS_DEBUG && (NRF_USBD_COMMON_ISO_DEBUG || (!NRF_USBD_COMMON_EP_IS_ISO(ep)))) { LOG_DBG("Transfer failed: Invalid EPr\n"); @@ -1478,7 +1478,7 @@ nrfx_err_t nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, (1U << ep_bitpos)) { /* IN (Device -> Host) transfer has to be transmitted out to allow new transmission */ - ret = NRFX_ERROR_BUSY; + ret = -EBUSY; if (NRF_USBD_COMMON_FAILED_TRANSFERS_DEBUG) { LOG_DBG("Transfer failed: EP is busy"); } @@ -1494,7 +1494,7 @@ nrfx_err_t nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, p_state->transfer_cnt = 0; p_state->status = NRF_USBD_COMMON_EP_OK; m_ep_dma_waiting |= 1U << ep_bitpos; - ret = NRFX_SUCCESS; + ret = 0; usbd_int_rise(); } diff --git a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.h b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.h index bb3db14a05b0..e2fae5c424a8 100644 --- a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.h +++ b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.h @@ -276,10 +276,10 @@ typedef struct { * * @param[in] event_handler Event handler provided by the user. Cannot be null. * - * @retval NRFX_SUCCESS Initialization successful. - * @retval NRFX_ERROR_INVALID_STATE Driver was already initialized. + * @retval 0 Initialization successful. + * @retval -EALREADY Driver was already initialized. */ -nrfx_err_t nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler); +int nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler); /** * @brief Driver deinitialization. @@ -503,11 +503,11 @@ void nrf_usbd_common_ep_disable(nrf_usbd_common_ep_t ep); * For OUT endpoint receiving would be initiated. * @param[in] p_transfer Transfer parameters. * - * @retval NRFX_SUCCESS Transfer queued or started. - * @retval NRFX_ERROR_BUSY Selected endpoint is pending. - * @retval NRFX_ERROR_INVALID_ADDR Unexpected transfer on EPIN0 or EPOUT0. + * @retval 0 Transfer queued or started. + * @retval -EBUSY Selected endpoint is pending. + * @retval -EFAULT Unexpected transfer on EPIN0 or EPOUT0. */ -nrfx_err_t nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, +int nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, nrf_usbd_common_transfer_t const *p_transfer); /** diff --git a/drivers/usb/device/usb_dc_nrfx.c b/drivers/usb/device/usb_dc_nrfx.c index c8bbfd40ada8..da5257b17582 100644 --- a/drivers/usb/device/usb_dc_nrfx.c +++ b/drivers/usb/device/usb_dc_nrfx.c @@ -795,9 +795,9 @@ static inline void usbd_work_process_recvreq(struct nrf_usbd_ctx *ctx, k_mutex_lock(&ctx->drv_lock, K_FOREVER); NRF_USBD_COMMON_TRANSFER_OUT(transfer, ep_ctx->buf.data, ep_ctx->cfg.max_sz); - nrfx_err_t err = nrf_usbd_common_ep_transfer( + int err = nrf_usbd_common_ep_transfer( ep_addr_to_nrfx(ep_ctx->cfg.addr), &transfer); - if (err != NRFX_SUCCESS) { + if (err != 0) { LOG_ERR("nRF USBD transfer error (OUT): 0x%02x", err); } k_mutex_unlock(&ctx->drv_lock); @@ -1146,7 +1146,7 @@ static void usbd_event_handler(nrf_usbd_common_evt_t const *const p_event) static inline void usbd_reinit(void) { int ret; - nrfx_err_t err; + int err; nrfx_power_usbevt_disable(); nrf_usbd_common_disable(); @@ -1160,7 +1160,7 @@ static inline void usbd_reinit(void) nrfx_power_usbevt_enable(); err = nrf_usbd_common_init(usbd_event_handler); - if (err != NRFX_SUCCESS) { + if (err != 0) { LOG_DBG("nRF USBD driver reinit failed. Code: %d", err); __ASSERT_NO_MSG(0); } @@ -1692,9 +1692,9 @@ int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data, ep_ctx->write_in_progress = true; NRF_USBD_COMMON_TRANSFER_IN(transfer, data, data_len, 0); - nrfx_err_t err = nrf_usbd_common_ep_transfer(ep_addr_to_nrfx(ep), &transfer); + int err = nrf_usbd_common_ep_transfer(ep_addr_to_nrfx(ep), &transfer); - if (err != NRFX_SUCCESS) { + if (err != 0) { ep_ctx->write_in_progress = false; if (ret_bytes) { *ret_bytes = 0; @@ -1883,7 +1883,7 @@ int usb_dc_wakeup_request(void) static int usb_init(void) { struct nrf_usbd_ctx *ctx = get_usbd_ctx(); - nrfx_err_t err; + int err; #ifdef CONFIG_HAS_HW_NRF_USBREG /* Use CLOCK/POWER priority for compatibility with other series where @@ -1909,12 +1909,12 @@ static int usb_init(void) }; err = nrf_usbd_common_init(usbd_event_handler); - if (err != NRFX_SUCCESS) { + if (err != 0) { LOG_DBG("nRF USBD driver init failed. Code: %d", (uint32_t)err); return -EIO; } - /* Ignore the return value, as NRFX_ERROR_ALREADY is not + /* Ignore the return value, as -EALREADY is not * a problem here. */ (void)nrfx_power_init(&power_config); diff --git a/modules/hal_nordic/nrfx/nrfx_glue.h b/modules/hal_nordic/nrfx/nrfx_glue.h index 0fadfb61b027..9ff8f061df8e 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.h +++ b/modules/hal_nordic/nrfx/nrfx_glue.h @@ -256,16 +256,6 @@ void nrfx_busy_wait(uint32_t usec_to_wait); //------------------------------------------------------------------------------ -/** - * @brief When set to a non-zero value, this macro specifies that the - * @ref nrfx_error_codes and the @ref nrfx_err_t type itself are defined - * in a customized way and the default definitions from @c - * should not be used. - */ -#define NRFX_CUSTOM_ERROR_CODES 0 - -//------------------------------------------------------------------------------ - /** * @brief When set to a non-zero value, this macro specifies that inside HALs * the event registers are read back after clearing, on devices that 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 03d7ce5cace1..a441bb2d13b1 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 @@ -1941,13 +1941,13 @@ uint32_t radio_tmr_sample_get(void) int radio_gpio_pa_lna_init(void) { #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) - if (nrfx_gpiote_channel_alloc(gpiote_palna, &gpiote_ch_palna) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote_palna, &gpiote_ch_palna) != 0) { return -ENOMEM; } #endif #if defined(NRF_GPIO_PDN_PIN) - if (nrfx_gpiote_channel_alloc(gpiote_pdn, &gpiote_ch_pdn) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(gpiote_pdn, &gpiote_ch_pdn) != 0) { return -ENOMEM; } #endif From 06ae9be299642684fbf2efb0f578217a71d5fce3 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Wed, 10 Dec 2025 12:01:57 +0100 Subject: [PATCH 0679/3334] [nrf fromlist] tests: boards: nrf: i2c: add twi variant Currently only TWIM peripheral is verified against TWIS. Add new test variant to verify nRF52 TWI peripheral as well. Upstream PR #: 100805 Signed-off-by: Nikodem Kastelik --- .../boards/nrf52840dk_nrf52840.overlay | 63 +---------------- .../boards/nrf52840dk_nrf52840_common.overlay | 70 +++++++++++++++++++ .../boards/nrf52840dk_nrf52840_twi.overlay | 10 +++ tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 6 ++ 4 files changed, 87 insertions(+), 62 deletions(-) create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_common.overlay create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_twi.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay index 8f9f7135f7b2..005708caa6f5 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay @@ -3,69 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * Two loopbacks are required: - * P1.01 - P1.02 - * P1.03 - P1.04 - */ - -/ { - aliases { - i2c-slave = &i2c1; - }; -}; - -&pinctrl { - i2c0_default_alt: i2c0_default_alt { - group1 { - psels = , - ; - }; - }; - - i2c0_sleep_alt: i2c0_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c1_default_alt: i2c1_default_alt { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c1_sleep_alt: i2c1_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; +#include "nrf52840dk_nrf52840_common.overlay" dut_twim: &i2c0 { compatible = "nordic,nrf-twim"; - status = "okay"; - pinctrl-0 = <&i2c0_default_alt>; - pinctrl-1 = <&i2c0_sleep_alt>; - pinctrl-names = "default", "sleep"; - clock-frequency = ; - - sensor: sensor@54 { - reg = <0x54>; - }; -}; - -dut_twis: &i2c1 { - compatible = "nordic,nrf-twis"; - status = "okay"; - pinctrl-0 = <&i2c1_default_alt>; - pinctrl-1 = <&i2c1_sleep_alt>; - pinctrl-names = "default", "sleep"; - clock-frequency = ; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_common.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_common.overlay new file mode 100644 index 000000000000..4b52aa7ab9b3 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_common.overlay @@ -0,0 +1,70 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Two loopbacks are required: + * P1.01 - P1.02 + * P1.03 - P1.04 + */ + +/ { + aliases { + i2c-slave = &i2c1; + }; +}; + +&pinctrl { + i2c0_default_alt: i2c0_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep_alt: i2c0_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c1_default_alt: i2c1_default_alt { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c1_sleep_alt: i2c1_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c0 { + status = "okay"; + pinctrl-0 = <&i2c0_default_alt>; + pinctrl-1 = <&i2c0_sleep_alt>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +dut_twis: &i2c1 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c1_default_alt>; + pinctrl-1 = <&i2c1_sleep_alt>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; +}; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_twi.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_twi.overlay new file mode 100644 index 000000000000..36a246257db2 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_twi.overlay @@ -0,0 +1,10 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf52840dk_nrf52840_common.overlay" + +&i2c0 { + compatible = "nordic,nrf-twi"; +}; diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index 8e324bcaf563..b50aade0191e 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -24,6 +24,12 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + boards.nrf.i2c.i2c_slave.twi: + platform_allow: + - nrf52840dk/nrf52840 + integration_platforms: + - nrf52840dk/nrf52840 + extra_args: DTC_OVERLAY_FILE="boards/nrf52840dk_nrf52840_twi.overlay" boards.nrf.i2c.i2c_slave.fast: platform_allow: - nrf52840dk/nrf52840 From e37df13e0e9ba6d539d84dba7fe14c3311d70500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pelikan?= Date: Thu, 4 Dec 2025 16:05:55 +0100 Subject: [PATCH 0680/3334] [nrf fromtree] manifest: Update hal_nordic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manifest to update latest changes. Signed-off-by: Paweł Pelikan (cherry picked from commit 82ed28fea6a9a10c5e9140c6c4eeaaa8191f7709) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 26335c8499e0..3bb47be49563 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 0dbbf4794156ca09dc2d4bad8c42dcdb54acd662 + revision: 757314f07fbf2fb0f0257d7cfa147ca03f9d8398 path: modules/hal/nordic groups: - hal From dcb90afc70fbc3600b66fa4bc234f14021c3ef94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 5 Dec 2025 10:26:22 +0100 Subject: [PATCH 0681/3334] [nrf fromtree] tests: arch: arm: Increase kobject text area when no optimization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When CONFIG_NO_OPTIMIZATIONS=n then kobject area can get inflated. Some targets are currently fail to compile due to that. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 8422e7ed4f867ad70efbfd116f0741b32018ec87) --- tests/arch/arm/arm_interrupt/testcase.yaml | 1 + tests/arch/arm/arm_thread_swap/testcase.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/arch/arm/arm_interrupt/testcase.yaml b/tests/arch/arm/arm_interrupt/testcase.yaml index df47b02fccd9..5836a20b9565 100644 --- a/tests/arch/arm/arm_interrupt/testcase.yaml +++ b/tests/arch/arm/arm_interrupt/testcase.yaml @@ -17,6 +17,7 @@ tests: - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_ZTEST_STACK_SIZE=1280 + - CONFIG_KOBJECT_TEXT_AREA=32768 arch.arm.interrupt.extra_exception_info: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: diff --git a/tests/arch/arm/arm_thread_swap/testcase.yaml b/tests/arch/arm/arm_thread_swap/testcase.yaml index e26d88429050..b60ad6f705d8 100644 --- a/tests/arch/arm/arm_thread_swap/testcase.yaml +++ b/tests/arch/arm/arm_thread_swap/testcase.yaml @@ -14,6 +14,7 @@ tests: - CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 + - CONFIG_KOBJECT_TEXT_AREA=32768 min_flash: 192 arch.arm.swap.common.fpu_sharing: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_ARMV7_M_ARMV8_M_FP @@ -29,4 +30,5 @@ tests: - CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 + - CONFIG_KOBJECT_TEXT_AREA=32768 min_flash: 192 From cd0384d7e99a4787442c56c8375214e31ca42acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Thu, 27 Nov 2025 12:47:16 +0100 Subject: [PATCH 0682/3334] [nrf fromtree] tests: drivers: counter: nrf54h20/cpuflpr support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added new target nrf54h20/cpuflpr/xip to counter basic api tests. Only XIP is supported for cpuflpr since RAM memory for this cpu is too small to fit whole counter basic test code and data. Signed-off-by: Łukasz Stępnicki (cherry picked from commit 1cb7671248f578b739480315f505a8c3180a2ac9) --- .../nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml | 1 - ...nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml | 1 + .../nrf54h20dk_nrf54h20_cpuflpr_xip.overlay | 44 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 10 +++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuflpr_xip.overlay diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml index ff9513fd593b..11a0e7271671 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml @@ -11,7 +11,6 @@ sysbuild: true ram: 46 flash: 46 supported: - - counter - gpio - i2c - pwm diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml index e2880af9be35..39f81211a0b1 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml @@ -12,3 +12,4 @@ ram: 46 flash: 48 supported: - gpio + - counter diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuflpr_xip.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuflpr_xip.overlay new file mode 100644 index 000000000000..bc24f669d92d --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuflpr_xip.overlay @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +#include "nrf54h20dk_nrf54h20_common.dtsi" + +/* FLPR does not have interrupts for slow peripherals. */ +&timer130 { + status = "disabled"; +}; + +&timer131 { + status = "disabled"; +}; + +&timer132 { + status = "disabled"; +}; + +&timer133 { + status = "disabled"; +}; + +&timer134 { + status = "disabled"; +}; + +&timer135 { + status = "disabled"; +}; + +&timer136 { + status = "disabled"; +}; + +&timer137 { + status = "disabled"; +}; + +&rtc130 { + status = "disabled"; +}; + +&rtc131 { + status = "disabled"; +}; diff --git a/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index cf3a4cf12587..71776f1d375c 100644 --- a/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,5 +1,15 @@ /* SPDX-License-Identifier: Apache-2.0 */ +&timer120 { + status = "reserved"; + interrupt-parent = <&cpuflpr_clic>; +}; + +&timer121 { + status = "reserved"; + interrupt-parent = <&cpuflpr_clic>; +}; + &timer130 { status = "reserved"; interrupt-parent = <&cpuppr_clic>; From 419011cb67cfa035ab5e43fd0c0c6e09721e3e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Thu, 27 Nov 2025 11:32:39 +0100 Subject: [PATCH 0683/3334] [nrf fromtree] tests: arch: common: nrf54h20/cpuflpr needs different isr offset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NRF54H20 cpuflpr and cpuppr do not share common interrupts (VEVIF TASKS) that can be used in this test, so they need to be separated. Signed-off-by: Łukasz Stępnicki (cherry picked from commit c00dd68c9d12a4f62d3cc054f7c4951d948f0610) --- tests/arch/common/gen_isr_table/src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/arch/common/gen_isr_table/src/main.c b/tests/arch/common/gen_isr_table/src/main.c index ed764e05b4bf..1b28682eb18f 100644 --- a/tests/arch/common/gen_isr_table/src/main.c +++ b/tests/arch/common/gen_isr_table/src/main.c @@ -27,7 +27,8 @@ extern const uintptr_t _irq_vector_table[]; #if defined(CONFIG_NRFX_CLIC) -#if defined(CONFIG_SOC_SERIES_NRF54LX) && defined(CONFIG_RISCV_CORE_NORDIC_VPR) +#if (defined(CONFIG_SOC_SERIES_NRF54LX) || defined(CONFIG_SOC_NRF54H20_CPUFLPR)) && \ + defined(CONFIG_RISCV_CORE_NORDIC_VPR) #define ISR1_OFFSET 16 #define ISR3_OFFSET 17 #define ISR5_OFFSET 18 From d27c04d05e3e115018be1819320e7935983a74e9 Mon Sep 17 00:00:00 2001 From: Bartlomiej Buczek Date: Fri, 12 Dec 2025 16:21:43 +0100 Subject: [PATCH 0684/3334] [nrf fromtree] Revert "drivers: adc: nrfx: Temporary fix for SAADC power consumption" New hal_nordic was merged some time ago, fix no longer needed. This reverts commit fe0b6b3b55f70c7306bcc21cf5242c00f483dc21. Signed-off-by: Bartlomiej Buczek (cherry picked from commit e02a1b742ae88c1c617722efde2d8a103fceae3d) --- drivers/adc/adc_nrfx_saadc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index f54fd0a1aee8..48a96c4399a5 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -663,7 +663,6 @@ static void event_handler(const nrfx_saadc_evt_t *event) correct_single_ended(&m_data.ctx.sequence, m_data.user_buffer, event->data.done.size); } - nrfy_saadc_disable(NRF_SAADC); adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); } else if (event->type == NRFX_SAADC_EVT_CALIBRATEDONE) { err = nrfx_saadc_mode_trigger(); From a9af9a911a0499828d5db33e74cc6e54e81dce34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 9 Dec 2025 14:35:10 +0100 Subject: [PATCH 0685/3334] [nrf fromtree] boards: nordic: nrf54h20dk: Add workaround for RISC-V debugging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add workaround that enables `west debug` and `west attach` on nrf54h20dk/nrf54h20/cpuppr and cpuflpr. Remove "-if SW" as this generates warning WARNING: runners.jlink: "f SW" does not match any known pattern And breaks JLinkGDBServer command by setting option `-select` to `usb=f SW`. Signed-off-by: Sebastian Głąb (cherry picked from commit 798652841a57450870dca1417855eb12ff043570) --- boards/nordic/nrf54h20dk/board.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/board.cmake b/boards/nordic/nrf54h20dk/board.cmake index b9383042b0c7..cabb050253e9 100644 --- a/boards/nordic/nrf54h20dk/board.cmake +++ b/boards/nordic/nrf54h20dk/board.cmake @@ -20,6 +20,7 @@ if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_C set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuflpr.JLinkScript) endif() - board_runner_args(jlink "--device=RISC-V" "--speed=4000" "-if SW" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") + # Workaround: Use device nRF54L15_RV32 until nRF54H20_RV32 is defined. + board_runner_args(jlink "--device=nRF54L15_RV32" "--speed=4000" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) endif() From bb67e5779f71d0bbd485f739dcbb2eccaa378710 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 4 Dec 2025 14:54:57 +0000 Subject: [PATCH 0686/3334] [nrf fromtree] dts: vendor: nordic: Fix invalid nrf54lm20a partition layout This device indicates 4KiB sector size and has an impossible partition layout that starts part the way through a sector, this fixes the issue by having proper partition alignment Signed-off-by: Jamie McCrae (cherry picked from commit 949adae4f121ee4139a92718d526233028d362d2) --- dts/vendor/nordic/nrf54lm20a_partition.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dts/vendor/nordic/nrf54lm20a_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_partition.dtsi index 049f87139d91..1bc6991c434a 100644 --- a/dts/vendor/nordic/nrf54lm20a_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_partition.dtsi @@ -21,17 +21,17 @@ slot0_partition: partition@10000 { label = "image-0"; - reg = <0x10000 DT_SIZE_K(922)>; + reg = <0x10000 DT_SIZE_K(920)>; }; - slot1_partition: partition@f6800 { + slot1_partition: partition@f6000 { label = "image-1"; - reg = <0xf6800 DT_SIZE_K(922)>; + reg = <0xf6000 DT_SIZE_K(920)>; }; - storage_partition: partition@1dd000 { + storage_partition: partition@1dc000 { label = "storage"; - reg = <0x1dd000 DT_SIZE_K(32)>; + reg = <0x1dc000 DT_SIZE_K(36)>; }; }; }; From f6f7a4e7d39414546b48db1e40fd954a34d6a914 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Mon, 15 Dec 2025 12:10:08 +0100 Subject: [PATCH 0687/3334] Revert "[nrf noup] soc: nordic: ironside: fix typo in Kconfig" This reverts commit 89aeb8e9f617f67a975d1751b89cad6b5e433fe2. Signed-off-by: Jonathan Nilsen --- soc/nordic/ironside/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index ff1d01f99e81..ddc7814fb86e 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -82,7 +82,7 @@ config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS range 0 255 default 50 help - Maximum timeout when waiting for DVFS oppoint change mutex lock. + Maximum attempts with 10us intervals before busy status will be reported. endif # NRF_IRONSIDE_DVFS_SERVICE From 5c98c475b03e41685a8a080e236fdfe0fff70390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Mon, 8 Sep 2025 15:27:55 +0200 Subject: [PATCH 0688/3334] [nrf fromtree] MAINTAINERS: Add maintainer and collaborators for nRF IronSide SE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add maintainers for nordic's IronSide SE. The IronSide Secure Element provides a root-of-trust and cryptographic services to nrf54h20 and nrf9280 SoC's. Signed-off-by: Sebastian Bøe (cherry picked from commit 411ae81348fe586a2b031c267a8e27b5e56a3d61) --- MAINTAINERS.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index aa0718740df8..26a43ca7f8c2 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -6040,6 +6040,21 @@ nRF BSIM: tests: - boards.nrf52_bsim +nRF IronSide SE Platforms: + status: maintained + maintainers: + - hakonfam + collaborators: + - "57300" + - jonathannilsen + - karstenkoenig + - SebastianBoe + files: + - soc/nordic/ironside/ + - soc/nordic/common/uicr/ + labels: + - "platform: nRF IronSide SE" + nRF Platforms: status: maintained maintainers: From ffbeccea8985e4585c922b2c75fe2258246316a4 Mon Sep 17 00:00:00 2001 From: Ville Kujala Date: Tue, 18 Nov 2025 16:10:33 +0200 Subject: [PATCH 0689/3334] [nrf fromtree] boards: nrf9280pdk: Merge cpuapp iron variant into the base variant Replaces the legacy SDFW compatible board configuration with the IronSide SE compatible one, thus removing support for running samples and tests on nRF9280 devices with the old firmware. Signed-off-by: Ville Kujala (cherry picked from commit 8883febbcf065298951f196a19c0d07a40874f16) --- boards/nordic/nrf9280pdk/Kconfig.defconfig | 15 +-- boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk | 4 +- boards/nordic/nrf9280pdk/board.yml | 2 - .../nrf9280pdk_nrf9280-ipc_conf.dtsi | 9 +- .../nrf9280pdk_nrf9280-ipc_conf_iron.dtsi | 30 ----- .../nrf9280pdk_nrf9280-memory_map.dtsi | 104 +++++++++-------- .../nrf9280pdk_nrf9280-memory_map_iron.dtsi | 105 ------------------ .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 24 ++-- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml | 1 + .../nrf9280pdk_nrf9280_cpuapp_defconfig | 2 - .../nrf9280pdk_nrf9280_cpuapp_iron.dts | 41 ------- .../nrf9280pdk_nrf9280_cpuapp_iron.yaml | 23 ---- ...f9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay | 52 --------- .../nrf9280pdk_nrf9280_cpuapp_iron_defconfig | 29 ----- .../nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 7 +- .../nrf9280pdk_nrf9280_cpuapp_iron.overlay | 8 -- soc/nordic/ironside/Kconfig | 4 +- soc/nordic/nrf92/Kconfig | 4 +- .../nrf92/Kconfig.defconfig.nrf9280_cpuapp | 3 - .../nrf92/Kconfig.defconfig.nrf9280_cpurad | 3 - soc/nordic/nrf92/Kconfig.soc | 5 - .../nrf9280pdk_nrf9280_cpuapp_iron.overlay | 7 -- .../nrf9280pdk_nrf9280_cpuapp_iron.overlay | 8 -- 23 files changed, 89 insertions(+), 401 deletions(-) delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig delete mode 100644 samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay delete mode 100644 tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay diff --git a/boards/nordic/nrf9280pdk/Kconfig.defconfig b/boards/nordic/nrf9280pdk/Kconfig.defconfig index 24669fc7f1e6..055c6c8be253 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.defconfig +++ b/boards/nordic/nrf9280pdk/Kconfig.defconfig @@ -4,17 +4,6 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION -if BOARD_NRF9280PDK_NRF9280_CPUAPP - -config BT_HCI_IPC - default y if BT - -endif # BOARD_NRF9280PDK_NRF9280_CPUAPP - -if BOARD_NRF9280PDK_NRF9280_CPURAD - -endif # BOARD_NRF9280PDK_NRF9280_CPURAD - if BOARD_NRF9280PDK_NRF9280_CPUPPR # As PPR has limited memory most of tests does not fit with asserts enabled. @@ -23,7 +12,7 @@ config ASSERT endif # BOARD_NRF9280PDK_NRF9280_CPUPPR -if BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON +if BOARD_NRF9280PDK_NRF9280_CPUAPP config ROM_START_OFFSET default 0x800 if BOOTLOADER_MCUBOOT @@ -31,4 +20,4 @@ config ROM_START_OFFSET config FLASH_LOAD_OFFSET default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) if !USE_DT_CODE_PARTITION -endif # BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON +endif # BOARD_NRF9280PDK_NRF9280_CPUAPP diff --git a/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk b/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk index d66fe31da884..e46ff337ff56 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk +++ b/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk @@ -2,9 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF9280PDK - select SOC_NRF9280_CPUAPP if (BOARD_NRF9280PDK_NRF9280_CPUAPP || \ - BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON) + select SOC_NRF9280_CPUAPP if BOARD_NRF9280PDK_NRF9280_CPUAPP select SOC_NRF9280_CPURAD if BOARD_NRF9280PDK_NRF9280_CPURAD select SOC_NRF9280_CPUPPR if (BOARD_NRF9280PDK_NRF9280_CPUPPR || \ BOARD_NRF9280PDK_NRF9280_CPUPPR_XIP) - select SOC_NRF9280_IRON if BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON diff --git a/boards/nordic/nrf9280pdk/board.yml b/boards/nordic/nrf9280pdk/board.yml index 274b9a84a7b7..c9216bbb9fb6 100644 --- a/boards/nordic/nrf9280pdk/board.yml +++ b/boards/nordic/nrf9280pdk/board.yml @@ -7,8 +7,6 @@ board: variants: - name: xip cpucluster: cpuppr - - name: iron - cpucluster: cpuapp revision: format: major.minor.patch default: 0.2.0 diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi index 0588e8d08018..94ef517601e7 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi @@ -7,17 +7,17 @@ / { ipc { cpusec_cpuapp_ipc: ipc-1-2 { - compatible = "zephyr,ipc-icmsg"; + compatible = "nordic,ironside-call"; status = "disabled"; - dcache-alignment = <32>; + memory-region = <&cpusec_cpuapp_ipc_shm>; mboxes = <&cpusec_bellboard 12>, <&cpuapp_bellboard 0>; }; cpusec_cpurad_ipc: ipc-1-3 { - compatible = "zephyr,ipc-icmsg"; + compatible = "nordic,ironside-call"; status = "disabled"; - dcache-alignment = <32>; + memory-region = <&cpusec_cpurad_ipc_shm>; mboxes = <&cpusec_bellboard 18>, <&cpurad_bellboard 0>; }; @@ -33,6 +33,7 @@ cpuapp_cpusys_ipc: ipc-2-12 { compatible = "zephyr,ipc-icmsg"; status = "disabled"; + unbound = "enable"; dcache-alignment = <32>; mboxes = <&cpuapp_bellboard 6>, <&cpusys_vevif 12>; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi deleted file mode 100644 index a44db40538d2..000000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* This file is to be merged with the original ipc_conf.dtsi in the future. */ - -/ { - ipc { - /delete-node/ ipc-1-2; - /delete-node/ ipc-1-3; - - cpusec_cpuapp_ipc: ipc-1-2 { - compatible = "nordic,ironside-call"; - memory-region = <&cpusec_cpuapp_ipc_shm>; - mboxes = <&cpusec_bellboard 12>, - <&cpuapp_bellboard 0>; - status = "disabled"; - }; - - cpusec_cpurad_ipc: ipc-1-3 { - compatible = "nordic,ironside-call"; - memory-region = <&cpusec_cpurad_ipc_shm>; - mboxes = <&cpusec_bellboard 18>, - <&cpurad_bellboard 0>; - status = "disabled"; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi index 67c70f1d38b5..3823fe27e58f 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi @@ -38,14 +38,6 @@ #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)>; }; @@ -98,12 +90,27 @@ }; }; - cpuapp_cpusys_ipc_shm: memory@2f88fce0 { - reg = <0x2f88fce0 0x80>; + /* Workaround for a data cache related issue with SoC1.1, use secure addresses + * for cpuapp_cpusys_ipc_shm, cpusys_cpuapp_ipc_shm and cpusec_cpuapp_ipc_shm. + */ + cpuapp_cpusys_ipc_shm: memory@3f88f600 { + reg = <0x3f88f600 0x80>; }; - cpusys_cpuapp_ipc_shm: memory@2f88fd60 { - reg = <0x2f88fd60 0x80>; + cpusys_cpuapp_ipc_shm: memory@3f88f680 { + reg = <0x3f88f680 0x80>; + }; + + cpusec_cpuapp_ipc_shm: memory@3f88fb80 { + reg = <0x3f88fb80 0x80>; + }; + + cpuapp_ironside_se_event_report: memory@2f88fc00 { + reg = <0x2f88fc00 0x100>; + }; + + cpuapp_ironside_se_boot_report: memory@2f88fd00 { + reg = <0x2f88fd00 0x200>; }; cpurad_cpusys_ipc_shm: memory@2f88fe00 { @@ -178,57 +185,64 @@ }; &mram1x { - cpurad_rx_partitions: cpurad-rx-partitions { - compatible = "nordic,owned-partitions", "fixed-partitions"; - status = "disabled"; - nordic,access = ; + partitions { + compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - cpurad_slot0_partition: partition@402000 { - reg = <0x402000 DT_SIZE_K(256)>; + cpuapp_boot_partition: partition@312000 { + reg = <0x312000 DT_SIZE_K(64)>; }; - }; - cpuapp_rx_partitions: cpuapp-rx-partitions { - compatible = "nordic,owned-partitions", "fixed-partitions"; - status = "disabled"; - nordic,access = ; - #address-cells = <1>; - #size-cells = <1>; + cpuapp_slot0_partition: partition@322000 { + reg = <0x322000 DT_SIZE_K(336)>; + }; - cpuapp_slot0_partition: partition@442000 { - reg = <0x442000 DT_SIZE_K(1024)>; + cpuapp_slot1_partition: partition@376000 { + reg = <0x376000 DT_SIZE_K(440)>; }; - cpuppr_code_partition: partition@542000 { - reg = <0x542000 DT_SIZE_K(64)>; + cpuppr_code_partition: partition@3E4000 { + reg = <0x3E4000 DT_SIZE_K(64)>; }; - }; - cpuapp_rw_partitions: cpuapp-rw-partitions { - compatible = "nordic,owned-partitions", "fixed-partitions"; - status = "disabled"; - nordic,access = ; - #address-cells = <1>; - #size-cells = <1>; + cpuflpr_code_partition: partition@3F4000 { + reg = <0x3F4000 DT_SIZE_K(48)>; + }; - dfu_partition: partition@600000 { - reg = <0x600000 DT_SIZE_K(512)>; + cpurad_slot0_partition: partition@400000 { + reg = <0x400000 DT_SIZE_K(336)>; }; - storage_partition: partition@680000 { - reg = <0x680000 DT_SIZE_K(24)>; + cpurad_slot1_partition: partition@454000 { + reg = <0x454000 DT_SIZE_K(336)>; }; - }; - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; + storage_partition: partition@600000 { + reg = <0x600000 DT_SIZE_K(40)>; + }; periphconf_partition: partition@60a000 { reg = <0x60a000 DT_SIZE_K(8)>; }; + + /* 0x60c000 was chosen for secure_storage_partition such that + * it resides in the beginning of MRAM11 in storage partition. + */ + secure_storage_partition: partition@60c000 { + compatible = "fixed-subpartitions"; + reg = <0x60c000 DT_SIZE_K(8)>; + ranges = <0x0 0x60c000 0x2000>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_crypto_partition: partition@0 { + reg = <0x0 DT_SIZE_K(4)>; + }; + + cpuapp_its_partition: partition@1000 { + reg = <0x1000 DT_SIZE_K(4)>; + }; + }; }; }; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi deleted file mode 100644 index fba2e0fb6c2d..000000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* This file is to be merged with the original memory_map.dtsi in the future. - * The following nodes will be replaced: - */ -/delete-node/ &cpuapp_cpusys_ipc_shm; -/delete-node/ &cpusec_cpuapp_ipc_shm; -/delete-node/ &cpusys_cpuapp_ipc_shm; -/delete-node/ &cpuapp_rw_partitions; -/delete-node/ &cpuapp_rx_partitions; -/delete-node/ &cpurad_rx_partitions; - -/ { - reserved-memory { - /* Workaround for a data cache related issue with SoC1.1, use secure addresses - * for cpuapp_cpusys_ipc_shm, cpusys_cpuapp_ipc_shm and cpusec_cpuapp_ipc_shm. - */ - cpuapp_cpusys_ipc_shm: memory@3f88f600 { - reg = <0x3f88f600 0x80>; - }; - - cpusys_cpuapp_ipc_shm: memory@3f88f680 { - reg = <0x3f88f680 0x80>; - }; - - cpusec_cpuapp_ipc_shm: memory@3f88fb80 { - reg = <0x3f88fb80 0x80>; - }; - - cpuapp_ironside_se_event_report: memory@2f88fc00 { - reg = <0x2f88fc00 0x100>; - }; - - cpuapp_ironside_se_boot_report: memory@2f88fd00 { - reg = <0x2f88fd00 0x200>; - }; - }; -}; - -&mram1x { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_boot_partition: partition@312000 { - reg = <0x312000 DT_SIZE_K(64)>; - }; - - cpuapp_slot0_partition: partition@322000 { - reg = <0x322000 DT_SIZE_K(336)>; - }; - - cpuapp_slot1_partition: partition@376000 { - reg = <0x376000 DT_SIZE_K(440)>; - }; - - cpuppr_code_partition: partition@3E4000 { - reg = <0x3E4000 DT_SIZE_K(64)>; - }; - - cpuflpr_code_partition: partition@3F4000 { - reg = <0x3F4000 DT_SIZE_K(48)>; - }; - - cpurad_slot0_partition: partition@400000 { - reg = <0x400000 DT_SIZE_K(336)>; - }; - - cpurad_slot1_partition: partition@454000 { - reg = <0x454000 DT_SIZE_K(336)>; - }; - - storage_partition: partition@600000 { - reg = <0x600000 DT_SIZE_K(40)>; - }; - - periphconf_partition: partition@60a000 { - reg = <0x60a000 DT_SIZE_K(8)>; - }; - - /* 0x60c000 was chosen for secure_storage_partition such that - * it resides in the beginning of MRAM11 in storage partition. - */ - secure_storage_partition: partition@60c000 { - compatible = "fixed-subpartitions"; - reg = <0x60c000 DT_SIZE_K(8)>; - ranges = <0x0 0x60c000 0x2000>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_crypto_partition: partition@0 { - reg = <0x0 DT_SIZE_K(4)>; - }; - - cpuapp_its_partition: partition@1000 { - reg = <0x1000 DT_SIZE_K(4)>; - }; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 19dd5e208063..e13022d06c13 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -20,10 +20,11 @@ chosen { zephyr,console = &uart136; - zephyr,code-partition = &cpuapp_slot0_partition; + zephyr,code-partition = &slot0_partition; zephyr,flash = &mram1x; zephyr,sram = &cpuapp_data; zephyr,shell-uart = &uart136; + zephyr,uart-mcumgr = &uart136; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,entropy = &psa_rng; @@ -149,14 +150,17 @@ status = "okay"; }; +&cpusec_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>; + status = "okay"; }; ipc0: &cpuapp_cpurad_ipc { @@ -190,12 +194,18 @@ ipc0: &cpuapp_cpurad_ipc { status = "okay"; }; -&cpuapp_rx_partitions { - status = "okay"; +ironside_se_boot_report: &cpuapp_ironside_se_boot_report {}; + +boot_partition: &cpuapp_boot_partition { + label = "mcuboot"; }; -&cpuapp_rw_partitions { - status = "okay"; +slot0_partition: &cpuapp_slot0_partition { + label = "image-0"; +}; + +slot1_partition: &cpuapp_slot1_partition { + label = "image-1"; }; &cpuppr_vpr { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml index d4bc799100dd..68babc33bcf3 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml @@ -7,6 +7,7 @@ type: mcu arch: arm toolchain: - gnuarmemb + - xtools - zephyr sysbuild: true ram: 512 diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig index d3ce90b8a380..5b27932f7855 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig @@ -8,8 +8,6 @@ CONFIG_SERIAL=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -CONFIG_USE_DT_CODE_PARTITION=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts deleted file mode 100644 index a3ca908f59de..000000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280_cpuapp.dts" -#include "nrf9280pdk_nrf9280-ipc_conf_iron.dtsi" -#include "nrf9280pdk_nrf9280-memory_map_iron.dtsi" - -/delete-node/ &cpusec_cpurad_ipc; - -/ { - chosen { - zephyr,code-partition = &slot0_partition; - zephyr,uart-mcumgr = &uart136; - }; -}; - -&cpusec_bellboard { - status = "okay"; -}; - -&cpusec_cpuapp_ipc { - mbox-names = "tx", "rx"; - status = "okay"; -}; - -ironside_se_boot_report: &cpuapp_ironside_se_boot_report {}; - -boot_partition: &cpuapp_boot_partition { - label = "mcuboot"; -}; - -slot0_partition: &cpuapp_slot0_partition { - label = "image-0"; -}; - -slot1_partition: &cpuapp_slot1_partition { - label = "image-1"; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml deleted file mode 100644 index 029f133993bf..000000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf9280pdk/nrf9280/cpuapp/iron -name: nRF9280-DK-nRF9280-Application -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -sysbuild: true -ram: 512 -flash: 1024 -supported: - - adc - - counter - - gpio - - i2c - - pwm - - spi - - watchdog - - usbd diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay deleted file mode 100644 index 4fa3f667eadd..000000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" - -/ { - aliases { - pwm-led0 = &pwm_led2; /* Alias for compatibility with samples that use pwm-led0 */ - }; - - leds { - compatible = "gpio-leds"; - - led0: led_0 { - gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - - led1: led_1 { - gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - - led2: led_2 { - gpios = <&gpio9 2 GPIO_ACTIVE_HIGH>; - label = "Green LED 2"; - }; - - led3: led_3 { - gpios = <&gpio9 3 GPIO_ACTIVE_HIGH>; - label = "Green LED 3"; - }; - }; - - pwmleds { - compatible = "pwm-leds"; - - /delete-node/ pwm_led_0; - - /* - * There is no valid hardware configuration to pass PWM signal on pins 0 and 1. - * First valid config is P9.2. This corresponds to LED 2. - * Signal on PWM130's channel 0 can be passed directly on GPIO Port 9 pin 2. - */ - pwm_led2: pwm_led_2 { - pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig deleted file mode 100644 index 01f3bec39321..000000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# MPU-based null-pointer dereferencing detection cannot be applied -# as the (0x0 - 0x400) region is unmapped for this target. -CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y - -# Enable cache -CONFIG_CACHE_MANAGEMENT=y -CONFIG_EXTERNAL_CACHE=y - -# Enable GPIO -CONFIG_GPIO=y - -# UICR generation is not supported, and when reintroduced will not use nrf-regtool. -CONFIG_NRF_REGTOOL_GENERATE_UICR=n diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index 91d967ea34aa..17c482e7865c 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -25,6 +25,7 @@ zephyr,flash = &mram1x; zephyr,sram = &cpurad_ram0; zephyr,shell-uart = &uart135; + zephyr,uart-mcumgr = &uart135; zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; @@ -68,8 +69,6 @@ &cpusec_cpurad_ipc { mbox-names = "tx", "rx"; - tx-region = <&cpurad_cpusec_ipc_shm>; - rx-region = <&cpusec_cpurad_ipc_shm>; }; ipc0: &cpuapp_cpurad_ipc { @@ -92,10 +91,6 @@ ipc0: &cpuapp_cpurad_ipc { status = "okay"; }; -&cpurad_rx_partitions { - status = "okay"; -}; - &grtc { status = "okay"; }; diff --git a/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay deleted file mode 100644 index 102abfc8ef27..000000000000 --- a/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "okay"; -}; diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index ddc7814fb86e..7498af71d909 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -3,7 +3,7 @@ config NRF_IRONSIDE bool - depends on SOC_NRF54H20 || SOC_NRF9280_IRON + depends on SOC_NRF54H20 || SOC_NRF9280 help This is selected by drivers interacting with Nordic IronSide firmware. @@ -28,7 +28,7 @@ config NRF_IRONSIDE_CALL_INIT_PRIORITY endif # NRF_IRONSIDE_CALL menu "Nordic IronSide services" - depends on SOC_NRF54H20 || SOC_NRF9280_IRON + depends on SOC_NRF54H20 || SOC_NRF9280 config NRF_IRONSIDE_CPUCONF_SERVICE bool "IronSide CPUCONF service" diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index eea33654f57d..739aada2b26e 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -9,6 +9,7 @@ config SOC_SERIES_NRF92X select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM select NRF_PLATFORM_HALTIUM + select EXPERIMENTAL if MCUBOOT config SOC_NRF9230_ENGB_CPUAPP select ARM @@ -51,6 +52,3 @@ config SOC_NRF9230_ENGB_CPURAD config SOC_NRF9230_ENGB_CPUPPR select RISCV_CORE_NORDIC_VPR - -config SOC_NRF9280_IRON - select EXPERIMENTAL if MCUBOOT diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp index 350f44b5c24e..22ba6612ecfb 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp @@ -8,7 +8,4 @@ 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_cpurad b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad index 9b17a6b988cd..534658997fbe 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad @@ -8,7 +8,4 @@ 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 index 6ad2fb8a0147..99fc28643b74 100644 --- a/soc/nordic/nrf92/Kconfig.soc +++ b/soc/nordic/nrf92/Kconfig.soc @@ -62,10 +62,5 @@ config SOC_NRF9280_CPUPPR help nRF9280 CPUPPR -config SOC_NRF9280_IRON - bool - help - Indicates that local domain firmware is compatible with Nordic IronSide SE. - config SOC default "nrf9280" if SOC_NRF9280 diff --git a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay deleted file mode 100644 index cd9ca89b82a3..000000000000 --- a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -#include "nrf9280pdk_nrf9280_common.dtsi" diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay deleted file mode 100644 index 102abfc8ef27..000000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "okay"; -}; From e7f84467e6029a1ef67bddeee28c7fa557bb7bfc Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Thu, 27 Nov 2025 14:04:00 +0100 Subject: [PATCH 0690/3334] [nrf fromtree] manifest: update hal_nordic revision Update hal_nordic revision to add IronSide support package. Signed-off-by: Jonathan Nilsen (cherry picked from commit 2c934f1dd898bb542375ee6f5e549caf5049f2f8) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 3bb47be49563..b9a1a35b79e9 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 757314f07fbf2fb0f0257d7cfa147ca03f9d8398 + revision: 09f24fd6cc7df57a5b5d08102ceb4a38381e2c82 path: modules/hal/nordic groups: - hal From 157c55f4e34eec9b82e311947c78a0278c126a22 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Mon, 11 Aug 2025 10:14:42 +0200 Subject: [PATCH 0691/3334] [nrf fromtree] modules: hal_nordic: move IronSide SE supporting code to hal_nordic Move most of the code that is used to interface with IronSide SE on the nRF54H20/nRF9280 from the soc/nordic directory to the hal_nordic repository. The interface code is now provided by the new IronSide support package. Build system code and glue code that makes use of Zephyr APIs is now located in the modules/hal_nordic directory. Update the directory path for IronSide SE interface code in MAINTAINERS.yml to match the move from soc/nordic/ironside to modules/hal_nordic/ironside. Also included are some refactoring changes and cleanup to match the new supporting code. C code and Kconfigs have been renamed to *ironside_se* / *IRONSIDE_SE* to match the supporting code changes. Users of these APIs in zephyr have been updated to match. Individual configurations for different "IronSide services" have been removed as the API serialization for all of these is now provided in a single C file / header file (ironside/se/api.h). The ironside_boot_report_get() API has been removed. The boot report structure can be accessed through the IRONSIDE_SE_BOOT_REPORT macro. Most configs relating to UICR / PERIPHCONF have been moved under the "IronSide SE" menu to make it clear that these are part of the IronSide SE interface. The macros that in uicr.h that were used to add entries to the PERIPHCONF section have been removed. The supporting code now provides PERIPHCONF_XYZ() macros that can be used to initialize structures that go into this section, and the zephyr part now only contains a macro UICR_PERIPHCONF_ENTRY() that is used to place an arbitrary structure into the section. The gen_periphconf_entries.py script used to generate PERIPHCONF entries based on devicetree has been updated to use the new macro system. IronSide SE integration code/configs is now guarded by HAS_IRONSIDE_SE. Note that the UICR build system integration that relies on Sysbuild remains under the soc/nordic directory for now, but will be moved to the modules/hal_nordic directory once it is clear how the integration will look there. Signed-off-by: Jonathan Nilsen (cherry picked from commit ef587e12f6881af637a37b7f7860297fb168f11b) --- MAINTAINERS.yml | 2 +- drivers/clock_control/Kconfig.nrf | 2 +- .../clock_control_nrf_iron_hsfll_local.c | 38 +- drivers/debug/Kconfig.nrf | 2 +- drivers/debug/debug_coresight_nrf.c | 6 +- drivers/debug/debug_nrf_etr.c | 2 +- modules/hal_nordic/CMakeLists.txt | 1 + modules/hal_nordic/Kconfig | 1 + .../hal_nordic/ironside/se}/CMakeLists.txt | 22 +- modules/hal_nordic/ironside/se/Kconfig | 66 ++ .../hal_nordic/ironside/se}/call.c | 27 +- .../hal_nordic/ironside/se}/dvfs.c | 83 +- .../se/include/ironside_zephyr/se/dvfs.h | 37 + .../ironside_zephyr/se/uicr_periphconf.h | 34 + .../se/scripts}/gen_periphconf_entries.py | 3 +- .../se/scripts}/periphconf/__init__.py | 0 .../se/scripts}/periphconf/builder.py | 41 +- .../hal_nordic/ironside/se}/uicr.ld | 4 +- .../nordic/nrf_ironside/update/prj.conf | 3 - .../nordic/nrf_ironside/update/src/main.c | 18 +- soc/nordic/CMakeLists.txt | 1 - soc/nordic/common/CMakeLists.txt | 2 - soc/nordic/common/uicr/Kconfig | 18 - soc/nordic/common/uicr/Kconfig.sysbuild | 6 +- soc/nordic/common/uicr/gen_uicr.py | 859 ------------------ .../common/uicr/gen_uicr/CMakeLists.txt | 6 +- soc/nordic/common/uicr/uicr.h | 308 ------- soc/nordic/ironside/CMakeLists.txt | 13 - soc/nordic/ironside/Kconfig | 89 -- soc/nordic/ironside/boot_report.c | 23 - soc/nordic/ironside/bootmode.c | 51 -- soc/nordic/ironside/counter.c | 81 -- soc/nordic/ironside/cpuconf.c | 59 -- .../include/nrf_ironside/boot_report.h | 229 ----- .../ironside/include/nrf_ironside/bootmode.h | 73 -- .../ironside/include/nrf_ironside/call.h | 82 -- .../ironside/include/nrf_ironside/counter.h | 143 --- .../ironside/include/nrf_ironside/cpuconf.h | 74 -- .../ironside/include/nrf_ironside/dvfs.h | 103 --- .../ironside/include/nrf_ironside/tdd.h | 39 - .../ironside/include/nrf_ironside/update.h | 90 -- soc/nordic/ironside/tdd.c | 28 - soc/nordic/ironside/update.c | 33 - soc/nordic/nrf54h/Kconfig | 3 +- .../nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 3 + .../nrf54h/Kconfig.defconfig.nrf54h20_cpurad | 3 + soc/nordic/nrf54h/soc.c | 6 +- soc/nordic/nrf92/Kconfig | 1 + .../nrf92/Kconfig.defconfig.nrf9280_cpuapp | 3 + .../nrf92/Kconfig.defconfig.nrf9280_cpurad | 3 + 50 files changed, 288 insertions(+), 2536 deletions(-) rename {soc/nordic/common/uicr => modules/hal_nordic/ironside/se}/CMakeLists.txt (60%) create mode 100644 modules/hal_nordic/ironside/se/Kconfig rename {soc/nordic/ironside => modules/hal_nordic/ironside/se}/call.c (81%) rename {soc/nordic/ironside => modules/hal_nordic/ironside/se}/dvfs.c (60%) create mode 100644 modules/hal_nordic/ironside/se/include/ironside_zephyr/se/dvfs.h create mode 100644 modules/hal_nordic/ironside/se/include/ironside_zephyr/se/uicr_periphconf.h rename {soc/nordic/common/uicr => modules/hal_nordic/ironside/se/scripts}/gen_periphconf_entries.py (99%) rename {soc/nordic/common/uicr => modules/hal_nordic/ironside/se/scripts}/periphconf/__init__.py (100%) rename {soc/nordic/common/uicr => modules/hal_nordic/ironside/se/scripts}/periphconf/builder.py (97%) rename {soc/nordic/common/uicr => modules/hal_nordic/ironside/se}/uicr.ld (61%) delete mode 100644 soc/nordic/common/uicr/gen_uicr.py delete mode 100644 soc/nordic/common/uicr/uicr.h delete mode 100644 soc/nordic/ironside/CMakeLists.txt delete mode 100644 soc/nordic/ironside/Kconfig delete mode 100644 soc/nordic/ironside/boot_report.c delete mode 100644 soc/nordic/ironside/bootmode.c delete mode 100644 soc/nordic/ironside/counter.c delete mode 100644 soc/nordic/ironside/cpuconf.c delete mode 100644 soc/nordic/ironside/include/nrf_ironside/boot_report.h delete mode 100644 soc/nordic/ironside/include/nrf_ironside/bootmode.h delete mode 100644 soc/nordic/ironside/include/nrf_ironside/call.h delete mode 100644 soc/nordic/ironside/include/nrf_ironside/counter.h delete mode 100644 soc/nordic/ironside/include/nrf_ironside/cpuconf.h delete mode 100644 soc/nordic/ironside/include/nrf_ironside/dvfs.h delete mode 100644 soc/nordic/ironside/include/nrf_ironside/tdd.h delete mode 100644 soc/nordic/ironside/include/nrf_ironside/update.h delete mode 100644 soc/nordic/ironside/tdd.c delete mode 100644 soc/nordic/ironside/update.c diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 26a43ca7f8c2..2018a6ed356b 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -6050,7 +6050,7 @@ nRF IronSide SE Platforms: - karstenkoenig - SebastianBoe files: - - soc/nordic/ironside/ + - modules/hal_nordic/ironside/ - soc/nordic/common/uicr/ labels: - "platform: nRF IronSide SE" diff --git a/drivers/clock_control/Kconfig.nrf b/drivers/clock_control/Kconfig.nrf index a051ebd62b02..f8d51383a35c 100644 --- a/drivers/clock_control/Kconfig.nrf +++ b/drivers/clock_control/Kconfig.nrf @@ -290,7 +290,7 @@ endif # CLOCK_CONTROL_NRF_HSFLL_LOCAL config CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL bool "NRF IronSide HSFLL LOCAL driver support" depends on DT_HAS_NORDIC_NRF_IRON_HSFLL_LOCAL_ENABLED - select NRF_IRONSIDE_DVFS_SERVICE + select IRONSIDE_SE_DVFS select CLOCK_CONTROL_NRF2_COMMON default y diff --git a/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c b/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c index ba4e2a3f6bed..f80521cb03a4 100644 --- a/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c +++ b/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c @@ -14,31 +14,31 @@ LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, "multiple instances not supported"); -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE -#include +#ifdef CONFIG_IRONSIDE_SE_DVFS +#include #define HSFLL_FREQ_LOW MHZ(64) #define HSFLL_FREQ_MEDLOW MHZ(128) #define HSFLL_FREQ_HIGH MHZ(320) -#define IRONSIDE_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_DVFS_TIMEOUT_MS) +#define IRONSIDE_SE_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_DVFS_TIMEOUT_MS) /* Clock options sorted from lowest to highest frequency */ static const struct clock_options { uint32_t frequency; - enum ironside_dvfs_oppoint setting; + enum ironside_se_dvfs_oppoint setting; } clock_options[] = { { .frequency = HSFLL_FREQ_LOW, - .setting = IRONSIDE_DVFS_OPP_LOW, + .setting = IRONSIDE_SE_DVFS_OPP_LOW, }, { .frequency = HSFLL_FREQ_MEDLOW, - .setting = IRONSIDE_DVFS_OPP_MEDLOW, + .setting = IRONSIDE_SE_DVFS_OPP_MEDLOW, }, { .frequency = HSFLL_FREQ_HIGH, - .setting = IRONSIDE_DVFS_OPP_HIGH, + .setting = IRONSIDE_SE_DVFS_OPP_HIGH, }, }; @@ -57,17 +57,17 @@ static void hsfll_update_timeout_handler(struct k_timer *timer) static void hsfll_work_handler(struct k_work *work) { struct hsfll_dev_data *dev_data = CONTAINER_OF(work, struct hsfll_dev_data, clk_cfg.work); - enum ironside_dvfs_oppoint required_setting; + enum ironside_se_dvfs_oppoint required_setting; uint8_t to_activate_idx; int rc; to_activate_idx = clock_config_update_begin(work); required_setting = clock_options[to_activate_idx].setting; - k_timer_start(&dev_data->timer, IRONSIDE_DVFS_TIMEOUT, K_NO_WAIT); + k_timer_start(&dev_data->timer, IRONSIDE_SE_DVFS_TIMEOUT, K_NO_WAIT); /* Request the DVFS service to change the OPP point. */ - rc = ironside_dvfs_change_oppoint(required_setting); + rc = ironside_se_dvfs_change_oppoint(required_setting); k_timer_stop(&dev_data->timer); clock_config_update_end(&dev_data->clk_cfg, rc); } @@ -123,12 +123,12 @@ static struct onoff_manager *hsfll_find_mgr_by_spec(const struct device *dev, idx = hsfll_resolve_spec_to_idx(spec); return idx < 0 ? NULL : hsfll_get_mgr_by_idx(dev, idx); } -#endif /* CONFIG_NRF_IRONSIDE_DVFS_SERVICE */ +#endif /* CONFIG_IRONSIDE_SE_DVFS */ static int api_request_hsfll(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE +#ifdef CONFIG_IRONSIDE_SE_DVFS struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); if (mgr) { @@ -143,7 +143,7 @@ static int api_request_hsfll(const struct device *dev, const struct nrf_clock_sp static int api_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec) { -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE +#ifdef CONFIG_IRONSIDE_SE_DVFS struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); if (mgr) { @@ -159,7 +159,7 @@ static int api_release_hsfll(const struct device *dev, const struct nrf_clock_sp static int api_cancel_or_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE +#ifdef CONFIG_IRONSIDE_SE_DVFS struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); if (mgr) { @@ -175,7 +175,7 @@ static int api_cancel_or_release_hsfll(const struct device *dev, const struct nr static int api_resolve_hsfll(const struct device *dev, const struct nrf_clock_spec *req_spec, struct nrf_clock_spec *res_spec) { -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE +#ifdef CONFIG_IRONSIDE_SE_DVFS int idx; idx = hsfll_resolve_spec_to_idx(req_spec); @@ -192,7 +192,7 @@ static int api_resolve_hsfll(const struct device *dev, const struct nrf_clock_sp static int hsfll_init(const struct device *dev) { -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE +#ifdef CONFIG_IRONSIDE_SE_DVFS struct hsfll_dev_data *dev_data = dev->data; int rc; @@ -220,14 +220,14 @@ static DEVICE_API(nrf_clock_control, hsfll_drv_api) = { .resolve = api_resolve_hsfll, }; -#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE +#ifdef CONFIG_IRONSIDE_SE_DVFS static struct hsfll_dev_data hsfll_data; #endif #ifdef CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_REQ_LOW_FREQ static int dvfs_low_init(void) { - static const k_timeout_t timeout = IRONSIDE_DVFS_TIMEOUT; + static const k_timeout_t timeout = IRONSIDE_SE_DVFS_TIMEOUT; static const struct device *hsfll_dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(DT_NODELABEL(cpu))); static const struct nrf_clock_spec clk_spec = {.frequency = HSFLL_FREQ_LOW}; @@ -238,7 +238,7 @@ SYS_INIT(dvfs_low_init, APPLICATION, 0); #endif DEVICE_DT_INST_DEFINE(0, hsfll_init, NULL, - COND_CODE_1(CONFIG_NRF_IRONSIDE_DVFS_SERVICE, + COND_CODE_1(CONFIG_IRONSIDE_SE_DVFS, (&hsfll_data), (NULL)), NULL, PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &hsfll_drv_api); diff --git a/drivers/debug/Kconfig.nrf b/drivers/debug/Kconfig.nrf index 030e9885a06d..7ea5f6bed5f8 100644 --- a/drivers/debug/Kconfig.nrf +++ b/drivers/debug/Kconfig.nrf @@ -117,7 +117,7 @@ menuconfig DEBUG_CORESIGHT_NRF default y depends on DT_HAS_NORDIC_CORESIGHT_NRF_ENABLED select PINCTRL - select NRF_IRONSIDE_TDD_SERVICE + select IRONSIDE_SE_CALL help Support CoreSight peripherals in Test and Debug Domain for ARM CoreSight System Trace Macrocell (STM) trace support. diff --git a/drivers/debug/debug_coresight_nrf.c b/drivers/debug/debug_coresight_nrf.c index 7bc9bab68ee0..7aeb14ce6eb5 100644 --- a/drivers/debug/debug_coresight_nrf.c +++ b/drivers/debug/debug_coresight_nrf.c @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #undef ETR_MODE_MODE_CIRCULARBUF @@ -262,7 +262,7 @@ static int coresight_nrf_init(const struct device *dev) return 0; } -#define DEBUG_CORESIGHT_NRF_INIT_PRIORITY UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY) +#define DEBUG_CORESIGHT_NRF_INIT_PRIORITY UTIL_INC(CONFIG_IRONSIDE_SE_CALL_INIT_PRIORITY) #define CORESIGHT_NRF_INST(inst) \ COND_CODE_1(DT_INST_PINCTRL_HAS_IDX(inst, 0), \ diff --git a/drivers/debug/debug_nrf_etr.c b/drivers/debug/debug_nrf_etr.c index d536cd4a9f40..200d6edbc1a7 100644 --- a/drivers/debug/debug_nrf_etr.c +++ b/drivers/debug/debug_nrf_etr.c @@ -792,7 +792,7 @@ int etr_process_init(void) return 0; } -#define NRF_ETR_INIT_PRIORITY UTIL_INC(UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY)) +#define NRF_ETR_INIT_PRIORITY UTIL_INC(UTIL_INC(CONFIG_IRONSIDE_SE_CALL_INIT_PRIORITY)) SYS_INIT(etr_process_init, POST_KERNEL, NRF_ETR_INIT_PRIORITY); diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index e5b1ab60dfca..10382bd08201 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -5,6 +5,7 @@ if (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION) add_subdirectory(nrf_802154) endif (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION) +add_subdirectory_ifdef(CONFIG_HAS_IRONSIDE_SE ironside/se) add_subdirectory_ifdef(CONFIG_HAS_NRFX nrfx) add_subdirectory_ifdef(CONFIG_HAS_NRFS nrfs) diff --git a/modules/hal_nordic/Kconfig b/modules/hal_nordic/Kconfig index 7be30750627d..935c4fb4ff38 100644 --- a/modules/hal_nordic/Kconfig +++ b/modules/hal_nordic/Kconfig @@ -258,6 +258,7 @@ endif # NRF_802154_RADIO_DRIVER || NRF_802154_SERIALIZATION endmenu # HAS_NORDIC_DRIVERS +rsource "ironside/se/Kconfig" rsource "nrfs/Kconfig" rsource "nrfx/Kconfig" rsource "Kconfig.nrf_regtool" diff --git a/soc/nordic/common/uicr/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt similarity index 60% rename from soc/nordic/common/uicr/CMakeLists.txt rename to modules/hal_nordic/ironside/se/CMakeLists.txt index d350d8d3f586..50379a084cb9 100644 --- a/soc/nordic/common/uicr/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -1,6 +1,26 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +# The IronSide source directory can be overridden by setting +# IRONSIDE_SUPPORT_DIR before invoking the build system. +zephyr_get(IRONSIDE_SUPPORT_DIR SYSBUILD GLOBAL) +if(NOT DEFINED IRONSIDE_SUPPORT_DIR) + set(IRONSIDE_SUPPORT_DIR + ${ZEPHYR_CURRENT_MODULE_DIR}/ironside CACHE PATH "IronSide Support Directory" + ) +endif() + +zephyr_include_directories(include) +zephyr_include_directories(${IRONSIDE_SUPPORT_DIR}/se/include) + +zephyr_library() +zephyr_library_property(ALLOW_EMPTY TRUE) +zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL + ${IRONSIDE_SUPPORT_DIR}/se/src/ironside_se_api.c + call.c +) +zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c) + if(CONFIG_NRF_PERIPHCONF_SECTION) zephyr_linker_sources(SECTIONS uicr.ld) endif() @@ -10,7 +30,7 @@ if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) execute_process( COMMAND ${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE} - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/gen_periphconf_entries.py + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/scripts/gen_periphconf_entries.py --soc ${CONFIG_SOC} --in-edt-pickle ${EDT_PICKLE} --out-periphconf-source ${periphconf_entries_c_file} diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig new file mode 100644 index 000000000000..eae311bef6d0 --- /dev/null +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -0,0 +1,66 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config HAS_IRONSIDE_SE + bool + +menu "IronSide SE" + depends on HAS_IRONSIDE_SE + +config IRONSIDE_SE_CALL + bool "IronSide calls" + default y + depends on DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED + depends on MULTITHREADING + select EVENTS + select MBOX + help + Support for IronSide call APIs. + +if IRONSIDE_SE_CALL + +config IRONSIDE_SE_CALL_INIT_PRIORITY + int "IronSide calls' driver initialization priority" + default 41 + help + Initialization priority of the IronSide call protocol driver. + It must be below MBOX_INIT_PRIORITY, but higher than the priority of any feature + that depends on IRONSIDE_SE_CALL. + +endif # IRONSIDE_SE_CALL + +config IRONSIDE_SE_DVFS + bool "DVFS support" + depends on SOC_NRF54H20_CPUAPP + depends on IRONSIDE_SE_CALL + help + Support for changing the DVFS operating point. + +if IRONSIDE_SE_DVFS + +config IRONSIDE_SE_DVFS_ABB_STATUSANA_CHECK_MAX_ATTEMPTS + int "ABB analog status check maximum attempts" + range 0 255 + default 50 + help + Maximum attempts with 10us intervals before busy status will be reported. + +endif # IRONSIDE_SE_DVFS + +menuconfig NRF_PERIPHCONF_SECTION + bool "Global peripheral initialization section" + depends on LINKER_DEVNULL_SUPPORT + imply LINKER_DEVNULL_MEMORY + help + Include static global domain peripheral initialization values from the + build in a dedicated section in the devnull region. + +config NRF_PERIPHCONF_GENERATE_ENTRIES + bool "Generate PERIPHCONF entries source file" + default y + depends on NRF_PERIPHCONF_SECTION + help + Generate a C file containing PERIPHCONF entries based on the + device configuration in the devicetree. + +endmenu # IronSide SE diff --git a/soc/nordic/ironside/call.c b/modules/hal_nordic/ironside/se/call.c similarity index 81% rename from soc/nordic/ironside/call.c rename to modules/hal_nordic/ironside/se/call.c index de4f59943f6a..8ca71e2ee690 100644 --- a/soc/nordic/ironside/call.c +++ b/modules/hal_nordic/ironside/se/call.c @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include +#include #include #include #include @@ -15,15 +16,15 @@ #define DT_DRV_COMPAT nordic_ironside_call #define SHM_NODE DT_INST_PHANDLE(0, memory_region) -#define NUM_BUFS (DT_REG_SIZE(SHM_NODE) / sizeof(struct ironside_call_buf)) +#define NUM_BUFS (DT_REG_SIZE(SHM_NODE) / sizeof(struct ironside_se_call_buf)) #define ALL_BUF_BITS BIT_MASK(NUM_BUFS) /* Note: this area is already zero-initialized at reset time. */ -static struct ironside_call_buf *const bufs = (void *)DT_REG_ADDR(SHM_NODE); +static struct ironside_se_call_buf *const bufs = (void *)DT_REG_ADDR(SHM_NODE); #if defined(CONFIG_DCACHE_LINE_SIZE) BUILD_ASSERT((DT_REG_ADDR(SHM_NODE) % CONFIG_DCACHE_LINE_SIZE) == 0); -BUILD_ASSERT((sizeof(struct ironside_call_buf) % CONFIG_DCACHE_LINE_SIZE) == 0); +BUILD_ASSERT((sizeof(struct ironside_se_call_buf) % CONFIG_DCACHE_LINE_SIZE) == 0); #endif static const struct mbox_dt_spec mbox_rx = MBOX_DT_SPEC_INST_GET(0, rx); @@ -40,7 +41,7 @@ static void ironside_call_rsp(const struct device *dev, mbox_channel_id_t channe ARG_UNUSED(user_data); ARG_UNUSED(data); - struct ironside_call_buf *buf; + struct ironside_se_call_buf *buf; uint32_t rsp_buf_bits = 0; /* Check which buffers are not being dispatched currently. Those must @@ -62,8 +63,8 @@ static void ironside_call_rsp(const struct device *dev, mbox_channel_id_t channe sys_cache_data_invd_range(buf, sizeof(*buf)); barrier_dmem_fence_full(); - if (buf->status != IRONSIDE_CALL_STATUS_IDLE && - buf->status != IRONSIDE_CALL_STATUS_REQ) { + if (buf->status != IRONSIDE_SE_CALL_STATUS_IDLE && + buf->status != IRONSIDE_SE_CALL_STATUS_REQ) { rsp_buf_bits |= BIT(i); } } @@ -89,9 +90,9 @@ static int ironside_call_init(const struct device *dev) } DEVICE_DT_INST_DEFINE(0, ironside_call_init, NULL, NULL, NULL, POST_KERNEL, - CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY, NULL); + CONFIG_IRONSIDE_SE_CALL_INIT_PRIORITY, NULL); -struct ironside_call_buf *ironside_call_alloc(void) +struct ironside_se_call_buf *ironside_se_call_alloc(void) { uint32_t avail_buf_bits; uint32_t alloc_buf_bit; @@ -108,12 +109,12 @@ struct ironside_call_buf *ironside_call_alloc(void) return &bufs[u32_count_trailing_zeros(alloc_buf_bit)]; } -void ironside_call_dispatch(struct ironside_call_buf *buf) +void ironside_se_call_dispatch(struct ironside_se_call_buf *buf) { const uint32_t buf_bit = BIT(buf - bufs); int err; - buf->status = IRONSIDE_CALL_STATUS_REQ; + buf->status = IRONSIDE_SE_CALL_STATUS_REQ; barrier_dmem_fence_full(); sys_cache_data_flush_range(buf, sizeof(*buf)); @@ -126,11 +127,11 @@ void ironside_call_dispatch(struct ironside_call_buf *buf) k_event_wait(&rsp_evts, buf_bit, false, K_FOREVER); } -void ironside_call_release(struct ironside_call_buf *buf) +void ironside_se_call_release(struct ironside_se_call_buf *buf) { const uint32_t buf_bit = BIT(buf - bufs); - buf->status = IRONSIDE_CALL_STATUS_IDLE; + buf->status = IRONSIDE_SE_CALL_STATUS_IDLE; barrier_dmem_fence_full(); sys_cache_data_flush_range(buf, sizeof(*buf)); diff --git a/soc/nordic/ironside/dvfs.c b/modules/hal_nordic/ironside/se/dvfs.c similarity index 60% rename from soc/nordic/ironside/dvfs.c rename to modules/hal_nordic/ironside/se/dvfs.c index 6c7a86cd0ad4..8bba1a28f9a3 100644 --- a/soc/nordic/ironside/dvfs.c +++ b/modules/hal_nordic/ironside/se/dvfs.c @@ -2,13 +2,12 @@ * Copyright (c) 2025 Nordic Semiconductor ASA * SPDX-License-Identifier: Apache-2.0 */ +#include +#include #include #include -#include -#include - -static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH; +static enum ironside_se_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_SE_DVFS_OPP_HIGH; #if defined(CONFIG_SOC_SERIES_NRF54HX) #define ABB_STATUSANA_LOCKED_L_Pos (0UL) @@ -18,7 +17,7 @@ static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH; #error "Unsupported SoC series for IronSide DVFS" #endif -#define ABB_STATUSANA_CHECK_MAX_ATTEMPTS (CONFIG_NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS) +#define ABB_STATUSANA_CHECK_MAX_ATTEMPTS (CONFIG_IRONSIDE_SE_DVFS_ABB_STATUSANA_CHECK_MAX_ATTEMPTS) #define ABB_STATUSANA_CHECK_INTERVAL_US (10U) struct dvfs_hsfll_data_t { @@ -48,7 +47,7 @@ static const struct dvfs_hsfll_data_t dvfs_hsfll_data[] = { }, }; -BUILD_ASSERT(ARRAY_SIZE(dvfs_hsfll_data) == (IRONSIDE_DVFS_OPPOINT_COUNT), +BUILD_ASSERT(ARRAY_SIZE(dvfs_hsfll_data) == (IRONSIDE_SE_DVFS_OPPOINT_COUNT), "dvfs_hsfll_data size must match number of DVFS oppoints"); /** @@ -57,7 +56,7 @@ BUILD_ASSERT(ARRAY_SIZE(dvfs_hsfll_data) == (IRONSIDE_DVFS_OPPOINT_COUNT), * @param target_freq_setting The target oppoint to check. * @return true if the current oppoint is higher than the target, false otherwise. */ -static bool ironside_dvfs_is_downscaling(enum ironside_dvfs_oppoint target_freq_setting) +static bool is_downscaling(enum ironside_se_dvfs_oppoint target_freq_setting) { return current_dvfs_oppoint < target_freq_setting; } @@ -67,7 +66,7 @@ static bool ironside_dvfs_is_downscaling(enum ironside_dvfs_oppoint target_freq_ * * @param enum oppoint target operation point */ -static void ironside_dvfs_configure_hsfll(enum ironside_dvfs_oppoint oppoint) +static void configure_hsfll(enum ironside_se_dvfs_oppoint oppoint) { nrf_hsfll_trim_t hsfll_trim = {}; uint8_t freq_trim_idx = dvfs_hsfll_data[oppoint].new_f_trim_entry; @@ -93,15 +92,15 @@ static void ironside_dvfs_configure_hsfll(enum ironside_dvfs_oppoint oppoint) } /* Function handling steps for DVFS oppoint change. */ -static void ironside_dvfs_prepare_to_scale(enum ironside_dvfs_oppoint dvfs_oppoint) +static void prepare_to_scale(enum ironside_se_dvfs_oppoint dvfs_oppoint) { - if (ironside_dvfs_is_downscaling(dvfs_oppoint)) { - ironside_dvfs_configure_hsfll(dvfs_oppoint); + if (is_downscaling(dvfs_oppoint)) { + configure_hsfll(dvfs_oppoint); } } /* Update MDK variable which is used by nrfx_coredep_delay_us (k_busy_wait). */ -static void ironside_dvfs_update_core_clock(enum ironside_dvfs_oppoint dvfs_oppoint) +static void update_core_clock(enum ironside_se_dvfs_oppoint dvfs_oppoint) { extern uint32_t SystemCoreClock; @@ -109,14 +108,14 @@ static void ironside_dvfs_update_core_clock(enum ironside_dvfs_oppoint dvfs_oppo } /* Perform scaling finnish procedure. */ -static void ironside_dvfs_change_oppoint_complete(enum ironside_dvfs_oppoint dvfs_oppoint) +static void change_oppoint_complete(enum ironside_se_dvfs_oppoint dvfs_oppoint) { - if (!ironside_dvfs_is_downscaling(dvfs_oppoint)) { - ironside_dvfs_configure_hsfll(dvfs_oppoint); + if (!is_downscaling(dvfs_oppoint)) { + configure_hsfll(dvfs_oppoint); } current_dvfs_oppoint = dvfs_oppoint; - ironside_dvfs_update_core_clock(dvfs_oppoint); + update_core_clock(dvfs_oppoint); } /** @@ -126,7 +125,7 @@ static void ironside_dvfs_change_oppoint_complete(enum ironside_dvfs_oppoint dvf * * @return true if ABB is locked, false otherwise. */ -static inline bool ironside_dvfs_is_abb_locked(NRF_ABB_Type *abb) +static inline bool is_abb_locked(NRF_ABB_Type *abb) { /* Check if ABB analog part is locked. */ /* Temporary workaround until STATUSANA register is visible. */ @@ -142,46 +141,12 @@ static inline bool ironside_dvfs_is_abb_locked(NRF_ABB_Type *abb) return ((*statusana & ABB_STATUSANA_LOCKED_L_Msk) != 0); } -/** - * @brief Request DVFS oppoint change from IronSide secure domain. - * This function will send a request over IPC to the IronSide secure domain - * This function is synchronous and will return when the request is completed. - * - * @param oppoint @ref enum ironside_dvfs_oppoint - * @return int - */ -static int ironside_dvfs_req_oppoint(enum ironside_dvfs_oppoint oppoint) -{ - int err; - - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_DVFS_SERVICE_V0; - buf->args[IRONSIDE_DVFS_SERVICE_OPPOINT_IDX] = oppoint; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_DVFS_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} - -int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint) +int ironside_se_dvfs_change_oppoint(enum ironside_se_dvfs_oppoint dvfs_oppoint) { int status = 0; - if (!ironside_dvfs_is_oppoint_valid(dvfs_oppoint)) { - return -IRONSIDE_DVFS_ERROR_WRONG_OPPOINT; - } - - if (!ironside_dvfs_is_abb_locked(NRF_ABB)) { - return -IRONSIDE_DVFS_ERROR_BUSY; + if (!is_abb_locked(NRF_ABB)) { + return -IRONSIDE_SE_DVFS_ERROR_BUSY; } if (dvfs_oppoint == current_dvfs_oppoint) { @@ -189,17 +154,17 @@ int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint) } if (k_is_in_isr()) { - return -IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED; + return -IRONSIDE_SE_DVFS_ERROR_ISR_NOT_ALLOWED; } - ironside_dvfs_prepare_to_scale(dvfs_oppoint); - - status = ironside_dvfs_req_oppoint(dvfs_oppoint); + prepare_to_scale(dvfs_oppoint); + status = ironside_se_dvfs_req_oppoint(dvfs_oppoint); if (status != 0) { return status; } - ironside_dvfs_change_oppoint_complete(dvfs_oppoint); + + change_oppoint_complete(dvfs_oppoint); return status; } diff --git a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/dvfs.h b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/dvfs.h new file mode 100644 index 000000000000..d4048704537c --- /dev/null +++ b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/dvfs.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_DVFS_H_ +#define ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_DVFS_H_ + +#include + +/** The DVFS oppoint change operation is not allowed in the ISR context. */ +#define IRONSIDE_SE_DVFS_ERROR_ISR_NOT_ALLOWED (7) + +/** + * @brief Change the current DVFS oppoint. + * + * This function will request a change of the current DVFS oppoint to the + * specified value. It will block until the change is applied. + * + * @param dvfs_oppoint The new DVFS oppoint to set. + * + * @retval 0 on success. + * @retval -IRONSIDE_SE_DVFS_ERROR_WRONG_OPPOINT if the requested DVFS oppoint is not allowed. + * @retval -IRONSIDE_SE_DVFS_ERROR_BUSY if waiting for mutex lock timed out, or hardware is busy. + * @retval -IRONSIDE_SE_DVFS_ERROR_OPPOINT_DATA if there is configuration error in the DVFS service. + * @retval -IRONSIDE_SE_DVFS_ERROR_PERMISSION if the caller does not have permission to change the + * DVFS oppoint. + * @retval -IRONSIDE_SE_DVFS_ERROR_NO_CHANGE_NEEDED if the requested DVFS oppoint is already set. + * @retval -IRONSIDE_SE_DVFS_ERROR_TIMEOUT if the operation timed out, possibly due to a hardware + * issue. + * @retval -IRONSIDE_SE_DVFS_ERROR_ISR_NOT_ALLOWED if the DVFS oppoint change operation is not + * allowed in the ISR context. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_se_dvfs_change_oppoint(enum ironside_se_dvfs_oppoint dvfs_oppoint); + +#endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_DVFS_H_ */ diff --git a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/uicr_periphconf.h b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/uicr_periphconf.h new file mode 100644 index 000000000000..919ccb23a79b --- /dev/null +++ b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/uicr_periphconf.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_UICR_PERIPHCONF_H_ +#define ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_UICR_PERIPHCONF_H_ + +#include + +#include +#include +#include + +/** Add an entry to the PERIPHCONF table section. + * + * This is a Zephyr integration with the IronSide UICR PERIPHCONF construction + * macros that uses an iterable section to store the entries. + * + * The macro expects a struct periphconf_entry initializer as input. + * The macros defined in ironside/se/periphconf.h can be used to construct the initializer. + * For example: + * + * UICR_PERIPHCONF_ENTRY(PERIPHCONF_SPU_FEATURE_GRTC_CC(...)); + * + */ +#define UICR_PERIPHCONF_ENTRY(_entry) \ + static STRUCT_SECTION_ITERABLE(periphconf_entry, \ + _UICR_PERIPHCONF_ENTRY_NAME(__COUNTER__)) = _entry + +#define _UICR_PERIPHCONF_ENTRY_NAME(_id) __UICR_PERIPHCONF_ENTRY_NAME(_id) +#define __UICR_PERIPHCONF_ENTRY_NAME(_id) _uicr_periphconf_entry_##_id + +#endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_UICR_PERIPHCONF_H_ */ diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py similarity index 99% rename from soc/nordic/common/uicr/gen_periphconf_entries.py rename to modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py index 13df5e468ded..b30d36f4c7f6 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py @@ -19,8 +19,9 @@ sys.exit("Set the environment variable 'ZEPHYR_BASE' to point to the zephyr root directory") # Add packages that are located in zephyr itself to the python path so we can import them below +# The devicetree package is needed on the path for unpickling devicetree object, even if we aren't +# importing anything from it directly. sys.path.insert(0, str(ZEPHYR_BASE / "scripts/dts/python-devicetree/src")) -sys.path.insert(0, str(ZEPHYR_BASE / "soc/nordic/common/uicr")) from periphconf.builder import ( Ctrlsel, diff --git a/soc/nordic/common/uicr/periphconf/__init__.py b/modules/hal_nordic/ironside/se/scripts/periphconf/__init__.py similarity index 100% rename from soc/nordic/common/uicr/periphconf/__init__.py rename to modules/hal_nordic/ironside/se/scripts/periphconf/__init__.py diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py similarity index 97% rename from soc/nordic/common/uicr/periphconf/builder.py rename to modules/hal_nordic/ironside/se/scripts/periphconf/builder.py index 34ccc6f7b497..f749a8ea277d 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py @@ -130,7 +130,7 @@ def build_generated_source(self, header_line: str | None = None) -> str: source_lines.extend( [ "#include ", - "#include ", + "#include ", "", ] ) @@ -270,7 +270,7 @@ def _add_global_peripheral_spu_permissions( self._macros.append( MacroCall( - "UICR_SPU_PERIPH_PERM_SET", + "PERIPHCONF_SPU_PERIPH_PERM", [ Address(spu_address), periph_slave_index, @@ -318,7 +318,7 @@ def _add_global_peripheral_irq_mapping(self, node: Node) -> None: self._macros.append( MacroCall( - "UICR_IRQMAP_IRQ_SINK_SET", + "PERIPHCONF_IRQMAP_IRQ_SINK", [ macro_irqn, irq_processor.c_enum, @@ -339,7 +339,7 @@ def _add_nrf_gpiote_spu_permissions(self, node: Node) -> None: for num, secure in dt_split_channels_get(node): self._macros.append( MacroCall( - "UICR_SPU_FEATURE_GPIOTE_CH_SET", + "PERIPHCONF_SPU_FEATURE_GPIOTE_CH", [ Address(spu_address), 0, @@ -370,7 +370,7 @@ def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: for num, secure in channels: self._macros.append( MacroCall( - "UICR_SPU_FEATURE_DPPIC_CH_SET", + "PERIPHCONF_SPU_FEATURE_DPPIC_CH", [ Address(spu_address), num, @@ -384,7 +384,7 @@ def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: for num, secure in channel_groups: self._macros.append( MacroCall( - "UICR_SPU_FEATURE_DPPIC_CHG_SET", + "PERIPHCONF_SPU_FEATURE_DPPIC_CHG", [ Address(spu_address), num, @@ -435,7 +435,7 @@ def _link_dppi_channels( self._macros.append( MacroCall( - "UICR_PPIB_SUBSCRIBE_SEND_ENABLE", + "PERIPHCONF_PPIB_SUBSCRIBE_SEND", [ Address(sub_ppib_addr), sub_ppib_ch, @@ -447,7 +447,7 @@ def _link_dppi_channels( ) self._macros.append( MacroCall( - "UICR_PPIB_PUBLISH_RECEIVE_ENABLE", + "PERIPHCONF_PPIB_PUBLISH_RECEIVE", [ Address(pub_ppib_addr), pub_ppib_ch, @@ -470,7 +470,7 @@ def _add_nrf_ipct_global_spu_permissions(self, node: Node) -> None: for num, secure in dt_split_channels_get(node): self._macros.append( MacroCall( - "UICR_SPU_FEATURE_IPCT_CH_SET", + "PERIPHCONF_SPU_FEATURE_IPCT_CH", [ Address(spu_address), num, @@ -536,8 +536,18 @@ def _link_ipct_channel( self._macros.append( MacroCall( - "UICR_IPCMAP_CHANNEL_CFG", - [self._ipcmap_idx, *link_args], + "PERIPHCONF_IPCMAP_CHANNEL_SOURCE", + [self._ipcmap_idx, source_domain.c_enum, source_ch], + comment=( + f"{source_domain.name} IPCT ch. {source_ch} => " + f"{sink_domain.name} IPCT ch. {sink_ch}" + ), + ) + ) + self._macros.append( + MacroCall( + "PERIPHCONF_IPCMAP_CHANNEL_SINK", + [self._ipcmap_idx, sink_domain.c_enum, sink_ch], comment=( f"{source_domain.name} IPCT ch. {source_ch} => " f"{sink_domain.name} IPCT ch. {sink_ch}" @@ -557,7 +567,7 @@ def _add_nrf_grtc_spu_permissions(self, node: Node) -> None: for num, secure in dt_split_channels_get(node): self._macros.append( MacroCall( - "UICR_SPU_FEATURE_GRTC_CC_SET", + "PERIPHCONF_SPU_FEATURE_GRTC_CC", [ Address(spu_address), num, @@ -679,7 +689,7 @@ def _configure_gpio_pin( self._macros.append( MacroCall( - "UICR_SPU_FEATURE_GPIO_PIN_SET", + "PERIPHCONF_SPU_FEATURE_GPIO_PIN", [ Address(spu_address), gpio_port, @@ -695,7 +705,7 @@ def _configure_gpio_pin( ctrlsel_int = int(ctrlsel) self._macros.append( MacroCall( - "UICR_GPIO_PIN_CNF_CTRLSEL_SET", + "PERIPHCONF_GPIO_PIN_CNF_CTRLSEL", [ Address(gpio_addr), num, @@ -737,7 +747,8 @@ def c_render(self, nodelabel_lookup: dict[int, str]) -> str: str_args.append(str(arg)) comment = f"/* {self.comment} */\n" if self.comment else "" - return f"{comment}{self.name}({', '.join(str_args)});" + entry_macro = f"UICR_PERIPHCONF_ENTRY({self.name}({', '.join(str_args)}))" + return f"{comment}{entry_macro};" def c_hex_addr(address: int) -> str: diff --git a/soc/nordic/common/uicr/uicr.ld b/modules/hal_nordic/ironside/se/uicr.ld similarity index 61% rename from soc/nordic/common/uicr/uicr.ld rename to modules/hal_nordic/ironside/se/uicr.ld index 210495b1c66c..adc2e2cc3f64 100644 --- a/soc/nordic/common/uicr/uicr.ld +++ b/modules/hal_nordic/ironside/se/uicr.ld @@ -5,7 +5,7 @@ #include -SECTION_PROLOGUE(uicr_periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) +SECTION_PROLOGUE(periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) { - Z_LINK_ITERABLE(uicr_periphconf_entry); + Z_LINK_ITERABLE(periphconf_entry); } GROUP_ROM_LINK_IN(DEVNULL_REGION, DEVNULL_REGION) diff --git a/samples/boards/nordic/nrf_ironside/update/prj.conf b/samples/boards/nordic/nrf_ironside/update/prj.conf index 1d6a2ac823df..1e935e973c76 100644 --- a/samples/boards/nordic/nrf_ironside/update/prj.conf +++ b/samples/boards/nordic/nrf_ironside/update/prj.conf @@ -1,4 +1 @@ CONFIG_LOG=y - -CONFIG_NRF_IRONSIDE_UPDATE_SERVICE=y -CONFIG_NRF_IRONSIDE_BOOT_REPORT=y diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c index ee8823217de2..3dbd2de1a85d 100644 --- a/samples/boards/nordic/nrf_ironside/update/src/main.c +++ b/samples/boards/nordic/nrf_ironside/update/src/main.c @@ -4,23 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include +#include +#include #include LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); -BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS >= IRONSIDE_UPDATE_MIN_ADDRESS); -BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS <= IRONSIDE_UPDATE_MAX_ADDRESS); +BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS >= IRONSIDE_SE_UPDATE_MIN_ADDRESS); +BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS <= IRONSIDE_SE_UPDATE_MAX_ADDRESS); int main(void) { int err; - const struct ironside_update_blob *update = (void *)CONFIG_UPDATE_BLOB_ADDRESS; - const struct ironside_boot_report *report; + const struct ironside_se_update_blob *update = (void *)CONFIG_UPDATE_BLOB_ADDRESS; + const struct ironside_se_boot_report *report = IRONSIDE_SE_BOOT_REPORT; - err = ironside_boot_report_get(&report); - LOG_INF("ironside_boot_report_get err: %d", err); /* Extract version components from packed 32-bit integer (8-bit MAJOR.MINOR.PATCH.SEQNUM) */ uint8_t se_major = (report->ironside_se_version_int >> 24) & 0xFF; uint8_t se_minor = (report->ironside_se_version_int >> 16) & 0xFF; @@ -37,9 +35,9 @@ int main(void) LOG_INF("recovery version: %d.%d.%d-%s+%d", recovery_major, recovery_minor, recovery_patch, report->ironside_se_recovery_extraversion, recovery_seqnum); LOG_INF("update status: 0x%x", report->ironside_update_status); - LOG_HEXDUMP_INF((void *)report->random_data, sizeof(report->random_data), "random data"); + LOG_HEXDUMP_INF((void *)report->random.data, sizeof(report->random.data), "random data"); - err = ironside_update(update); + err = ironside_se_update(update); LOG_INF("IronSide update retval: 0x%x", err); if (err == 0) { diff --git a/soc/nordic/CMakeLists.txt b/soc/nordic/CMakeLists.txt index f32466d38ee5..11f6bb66d66f 100644 --- a/soc/nordic/CMakeLists.txt +++ b/soc/nordic/CMakeLists.txt @@ -50,4 +50,3 @@ if(CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable") endif() add_subdirectory(common) -add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE ironside) diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index 1b1c3760c9ae..4462d7dde4e6 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -3,8 +3,6 @@ add_subdirectory_ifdef(CONFIG_RISCV_CORE_NORDIC_VPR vpr) -add_subdirectory(uicr) - # Let SystemInit() be called in place of soc_reset_hook() by default. zephyr_linker_symbol(SYMBOL soc_reset_hook EXPR "@SystemInit@") diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index c3a69c3dbe0f..c38a8e9bc67a 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -1,24 +1,6 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config NRF_PERIPHCONF_SECTION - bool "Populate global peripheral initialization section" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP - depends on LINKER_DEVNULL_SUPPORT - imply LINKER_DEVNULL_MEMORY - help - Include static global domain peripheral initialization values from the - build in a dedicated section in the devnull region. - -config NRF_PERIPHCONF_GENERATE_ENTRIES - bool "Generate PERIPHCONF entries source file" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP - depends on NRF_PERIPHCONF_SECTION - depends on NRF_PLATFORM_HALTIUM - help - Generate a C file containing PERIPHCONF entries based on the - device configuration in the devicetree. - config IS_IRONSIDE_SE_SECONDARY_IMAGE bool "Ironside SE secondary image indicator (informative only, do not change)" help diff --git a/soc/nordic/common/uicr/Kconfig.sysbuild b/soc/nordic/common/uicr/Kconfig.sysbuild index 6a9341f90994..977f910b1617 100644 --- a/soc/nordic/common/uicr/Kconfig.sysbuild +++ b/soc/nordic/common/uicr/Kconfig.sysbuild @@ -2,8 +2,10 @@ # SPDX-License-Identifier: Apache-2.0 config NRF_HALTIUM_GENERATE_UICR - bool "Generate UICR file" + bool "Generate UICR artifacts" depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF92X default y help - Generate UICR HEX file. + When enabled, a UICR generator image is included in the build. + This generates binary configuration artifacts based on the Kconfig and device tree + of the UICR generator image. See the UICR generator options for further details. diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py deleted file mode 100644 index 8dbbc7fe5ce9..000000000000 --- a/soc/nordic/common/uicr/gen_uicr.py +++ /dev/null @@ -1,859 +0,0 @@ -""" -Copyright (c) 2025 Nordic Semiconductor ASA -SPDX-License-Identifier: Apache-2.0 -""" - -from __future__ import annotations - -import argparse -import ctypes as c -import sys -from itertools import groupby, pairwise -from typing import NamedTuple - -from elftools.elf.elffile import ELFFile -from intelhex import IntelHex - -# The UICR format version produced by this script -UICR_FORMAT_VERSION_MAJOR = 2 -UICR_FORMAT_VERSION_MINOR = 0 - -# Name of the ELF section containing PERIPHCONF entries. -# Must match the name used in the linker script. -PERIPHCONF_SECTION = "uicr_periphconf_entry" - -# Common values for representing enabled/disabled in the UICR format. -ENABLED_VALUE = 0xFFFF_FFFF -DISABLED_VALUE = 0xBD23_28A8 -PROTECTED_VALUE = ENABLED_VALUE # UICR_PROTECTED = UICR_ENABLED per uicr_defs.h -UNPROTECTED_VALUE = DISABLED_VALUE # Unprotected uses the default erased value - -KB_4 = 4096 - - -class ScriptError(RuntimeError): ... - - -class PartitionInfo(NamedTuple): - """Information about a partition for secure storage validation.""" - - address: int - size: int - name: str - - -class PeriphconfEntry(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("regptr", c.c_uint32), - ("value", c.c_uint32), - ] - - -PERIPHCONF_ENTRY_SIZE = c.sizeof(PeriphconfEntry) - - -class Version(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("MINOR", c.c_uint16), - ("MAJOR", c.c_uint16), - ] - - -class Approtect(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("APPLICATION", c.c_uint32), - ("RADIOCORE", c.c_uint32), - ("RESERVED", c.c_uint32), - ("CORESIGHT", c.c_uint32), - ] - - -class Protectedmem(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("SIZE4KB", c.c_uint32), - ] - - -class Wdtstart(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("INSTANCE", c.c_uint32), - ("CRV", c.c_uint32), - ] - - -class SecurestorageCrypto(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("APPLICATIONSIZE1KB", c.c_uint32), - ("RADIOCORESIZE1KB", c.c_uint32), - ] - - -class SecurestorageIts(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("APPLICATIONSIZE1KB", c.c_uint32), - ("RADIOCORESIZE1KB", c.c_uint32), - ] - - -class Securestorage(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("ADDRESS", c.c_uint32), - ("CRYPTO", SecurestorageCrypto), - ("ITS", SecurestorageIts), - ] - - -class Periphconf(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("ADDRESS", c.c_uint32), - ("MAXCOUNT", c.c_uint32), - ] - - -class Mpcconf(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("ADDRESS", c.c_uint32), - ("MAXCOUNT", c.c_uint32), - ] - - -class SecondaryTrigger(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("RESETREAS", c.c_uint32), - ("RESERVED", c.c_uint32), - ] - - -class SecondaryProtectedmem(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("SIZE4KB", c.c_uint32), - ] - - -class SecondaryWdtstart(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("INSTANCE", c.c_uint32), - ("CRV", c.c_uint32), - ] - - -class SecondaryPeriphconf(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("ADDRESS", c.c_uint32), - ("MAXCOUNT", c.c_uint32), - ] - - -class SecondaryMpcconf(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("ADDRESS", c.c_uint32), - ("MAXCOUNT", c.c_uint32), - ] - - -class Secondary(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("ENABLE", c.c_uint32), - ("PROCESSOR", c.c_uint32), - ("TRIGGER", SecondaryTrigger), - ("ADDRESS", c.c_uint32), - ("PROTECTEDMEM", SecondaryProtectedmem), - ("WDTSTART", SecondaryWdtstart), - ("PERIPHCONF", SecondaryPeriphconf), - ("MPCCONF", SecondaryMpcconf), - ] - - -class Uicr(c.LittleEndianStructure): - _pack_ = 1 - _fields_ = [ - ("VERSION", Version), - ("RESERVED", c.c_uint32), - ("LOCK", c.c_uint32), - ("RESERVED1", c.c_uint32), - ("APPROTECT", Approtect), - ("ERASEPROTECT", c.c_uint32), - ("PROTECTEDMEM", Protectedmem), - ("WDTSTART", Wdtstart), - ("RESERVED2", c.c_uint32), - ("SECURESTORAGE", Securestorage), - ("RESERVED3", c.c_uint32 * 5), - ("PERIPHCONF", Periphconf), - ("MPCCONF", Mpcconf), - ("SECONDARY", Secondary), - ("PADDING", c.c_uint32 * 15), - ] - - -def validate_secure_storage_partitions(args: argparse.Namespace) -> None: - """ - Validate that secure storage partitions are laid out correctly. - - Args: - args: Parsed command line arguments containing partition information - - Raises: - ScriptError: If validation fails - """ - # Expected order: cpuapp_crypto_partition, cpurad_crypto_partition, - # cpuapp_its_partition, cpurad_its_partition - partitions = [ - PartitionInfo( - args.cpuapp_crypto_address, args.cpuapp_crypto_size, "cpuapp_crypto_partition" - ), - PartitionInfo( - args.cpurad_crypto_address, args.cpurad_crypto_size, "cpurad_crypto_partition" - ), - PartitionInfo(args.cpuapp_its_address, args.cpuapp_its_size, "cpuapp_its_partition"), - PartitionInfo(args.cpurad_its_address, args.cpurad_its_size, "cpurad_its_partition"), - ] - - # Filter out zero-sized partitions (missing partitions) - present_partitions = [p for p in partitions if p.size > 0] - - # Require at least one subpartition to be present - if not present_partitions: - raise ScriptError( - "At least one secure storage subpartition must be defined. " - "Define one or more of: cpuapp_crypto_partition, cpurad_crypto_partition, " - "cpuapp_its_partition, cpurad_its_partition" - ) - - # Check 4KB alignment for secure storage start address - if args.securestorage_address % 4096 != 0: - raise ScriptError( - f"Secure storage address {args.securestorage_address:#x} must be aligned to 4KB " - f"(4096 bytes)" - ) - - # Check 4KB alignment for secure storage size - if args.securestorage_size % 4096 != 0: - raise ScriptError( - f"Secure storage size {args.securestorage_size} bytes must be aligned to 4KB " - f"(4096 bytes)" - ) - - # Check that the first present partition starts at the secure storage address - first_partition = present_partitions[0] - if first_partition.address != args.securestorage_address: - raise ScriptError( - f"First partition {first_partition.name} starts at {first_partition.address:#x}, " - f"but must start at secure storage address {args.securestorage_address:#x}" - ) - - # Check that all present partitions have sizes that are multiples of 1KB - for partition in present_partitions: - if partition.size % 1024 != 0: - raise ScriptError( - f"Partition {partition.name} has size {partition.size} bytes, but must be " - f"a multiple of 1024 bytes (1KB)" - ) - - # Check that partitions are in correct order and don't overlap - for curr_partition, next_partition in pairwise(present_partitions): - # Check order - partitions should be in ascending address order - if curr_partition.address >= next_partition.address: - raise ScriptError( - f"Partition {curr_partition.name} (starts at {curr_partition.address:#x}) " - f"must come before {next_partition.name} (starts at {next_partition.address:#x})" - ) - - # Check for overlap - curr_end = curr_partition.address + curr_partition.size - if curr_end > next_partition.address: - raise ScriptError( - f"Partition {curr_partition.name} (ends at {curr_end:#x}) overlaps with " - f"{next_partition.name} (starts at {next_partition.address:#x})" - ) - - # Check for gaps (should be no gaps between consecutive partitions) - if curr_end < next_partition.address: - gap = next_partition.address - curr_end - raise ScriptError( - f"Gap of {gap} bytes between {curr_partition.name} (ends at {curr_end:#x}) and " - f"{next_partition.name} (starts at {next_partition.address:#x})" - ) - - # Check that combined subpartition sizes equal secure_storage_partition size - total_subpartition_size = sum(p.size for p in present_partitions) - if total_subpartition_size != args.securestorage_size: - raise ScriptError( - f"Combined size of subpartitions ({total_subpartition_size} bytes) does not match " - f"secure_storage_partition size ({args.securestorage_size} bytes). " - f"The definition is not coherent." - ) - - -def main() -> None: - parser = argparse.ArgumentParser( - allow_abbrev=False, - description=( - "Generate artifacts for the UICR and associated configuration blobs from application " - "build outputs. User Information Configuration Registers (UICR), in the context of " - "certain Nordic SoCs, are used to configure system resources, like memory and " - "peripherals, and to protect the device in various ways." - ), - ) - parser.add_argument( - "--in-periphconf-elf", - dest="in_periphconf_elfs", - default=[], - action="append", - type=argparse.FileType("rb"), - help=( - "Path to an ELF file to extract PERIPHCONF data from. Can be provided multiple times. " - "The PERIPHCONF data from each ELF file is combined in a single list which is sorted " - "by ascending address and cleared of duplicate entries." - ), - ) - parser.add_argument( - "--out-merged-hex", - required=True, - type=argparse.FileType("w", encoding="utf-8"), - help="Path to write the merged UICR+PERIPHCONF HEX file to", - ) - parser.add_argument( - "--out-uicr-hex", - required=True, - type=argparse.FileType("w", encoding="utf-8"), - help="Path to write the UICR-only HEX file to", - ) - parser.add_argument( - "--out-periphconf-hex", - type=argparse.FileType("w", encoding="utf-8"), - help="Path to write the PERIPHCONF-only HEX file to", - ) - parser.add_argument( - "--periphconf-address", - default=None, - type=lambda s: int(s, 0), - help="Absolute flash address of the PERIPHCONF partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--periphconf-size", - default=None, - type=lambda s: int(s, 0), - help="Size in bytes of the PERIPHCONF partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--uicr-address", - required=True, - type=lambda s: int(s, 0), - help="Absolute flash address of the UICR region (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--securestorage", - action="store_true", - help="Enable secure storage support in UICR", - ) - parser.add_argument( - "--securestorage-address", - default=None, - type=lambda s: int(s, 0), - help="Absolute flash address of the secure storage partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--securestorage-size", - default=None, - type=lambda s: int(s, 0), - help="Size in bytes of the secure storage partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpuapp-crypto-address", - default=0, - type=lambda s: int(s, 0), - help="Absolute flash address of cpuapp_crypto_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpuapp-crypto-size", - default=0, - type=lambda s: int(s, 0), - help="Size in bytes of cpuapp_crypto_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpurad-crypto-address", - default=0, - type=lambda s: int(s, 0), - help="Absolute flash address of cpurad_crypto_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpurad-crypto-size", - default=0, - type=lambda s: int(s, 0), - help="Size in bytes of cpurad_crypto_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpuapp-its-address", - default=0, - type=lambda s: int(s, 0), - help="Absolute flash address of cpuapp_its_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpuapp-its-size", - default=0, - type=lambda s: int(s, 0), - help="Size in bytes of cpuapp_its_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpurad-its-address", - default=0, - type=lambda s: int(s, 0), - help="Absolute flash address of cpurad_its_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpurad-its-size", - default=0, - type=lambda s: int(s, 0), - help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--permit-permanently-transitioning-device-to-deployed", - action="store_true", - help=( - "Safety flag required to enable both UICR.LOCK and UICR.ERASEPROTECT together. " - "Must be explicitly provided to acknowledge permanent device state changes." - ), - ) - parser.add_argument( - "--lock", - action="store_true", - help="Enable UICR.LOCK to prevent modifications without ERASEALL", - ) - parser.add_argument( - "--eraseprotect", - action="store_true", - help="Enable UICR.ERASEPROTECT to block ERASEALL operations", - ) - parser.add_argument( - "--approtect-application-protected", - action="store_true", - help="Protect application domain access port (disable debug access)", - ) - parser.add_argument( - "--approtect-radiocore-protected", - action="store_true", - help="Protect radio core access port (disable debug access)", - ) - parser.add_argument( - "--approtect-coresight-protected", - action="store_true", - help="Protect CoreSight access port (disable debug access)", - ) - parser.add_argument( - "--protectedmem", - action="store_true", - help="Enable protected memory region in UICR", - ) - parser.add_argument( - "--protectedmem-size-bytes", - type=int, - help="Protected memory size in bytes (must be divisible by 4096)", - ) - parser.add_argument( - "--wdtstart", - action="store_true", - help="Enable watchdog timer start in UICR", - ) - parser.add_argument( - "--wdtstart-instance-code", - type=lambda s: int(s, 0), - help="Watchdog timer instance code (0xBD2328A8 for WDT0, 0x1730C77F for WDT1)", - ) - parser.add_argument( - "--wdtstart-crv", - type=int, - help="Initial Counter Reload Value (CRV) for watchdog timer (minimum: 0xF)", - ) - parser.add_argument( - "--secondary-wdtstart", - action="store_true", - help="Enable watchdog timer start in UICR.SECONDARY", - ) - parser.add_argument( - "--secondary-wdtstart-instance-code", - type=lambda s: int(s, 0), - help="Secondary watchdog timer instance code (0xBD2328A8 for WDT0, 0x1730C77F for WDT1)", - ) - parser.add_argument( - "--secondary-wdtstart-crv", - type=int, - help="Secondary initial Counter Reload Value (CRV) for watchdog timer (minimum: 0xF)", - ) - parser.add_argument( - "--secondary", - action="store_true", - help="Enable secondary firmware support in UICR", - ) - parser.add_argument( - "--secondary-address", - default=None, - type=lambda s: int(s, 0), - help="Absolute flash address of the secondary firmware (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--secondary-processor", - default=0xBD2328A8, - type=lambda s: int(s, 0), - help="Processor to boot for the secondary firmware ", - ) - parser.add_argument( - "--secondary-trigger", - action="store_true", - help="Enable UICR.SECONDARY.TRIGGER for automatic secondary firmware boot on reset events", - ) - parser.add_argument( - "--secondary-trigger-resetreas", - default=0, - type=lambda s: int(s, 0), - help=( - "Bitmask of reset reasons that trigger secondary firmware boot " - "(decimal or 0x-prefixed hex)" - ), - ) - parser.add_argument( - "--secondary-protectedmem-size", - default=None, - type=lambda s: int(s, 0), - help="Size in bytes of the secondary protected memory region (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--secondary-periphconf-address", - default=None, - type=lambda s: int(s, 0), - help=( - "Absolute flash address of the secondary PERIPHCONF partition " - "(decimal or 0x-prefixed hex)" - ), - ) - parser.add_argument( - "--secondary-periphconf-size", - default=None, - type=lambda s: int(s, 0), - help="Size in bytes of the secondary PERIPHCONF partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--in-secondary-periphconf-elf", - dest="in_secondary_periphconf_elfs", - default=[], - action="append", - type=argparse.FileType("rb"), - help=( - "Path to an ELF file to extract secondary PERIPHCONF data from. " - "Can be provided multiple times. The secondary PERIPHCONF data from each ELF file " - "is combined in a single list which is sorted by ascending address and cleared " - "of duplicate entries." - ), - ) - parser.add_argument( - "--out-secondary-periphconf-hex", - type=argparse.FileType("w", encoding="utf-8"), - help="Path to write the secondary PERIPHCONF-only HEX file to", - ) - args = parser.parse_args() - - try: - # Validate argument dependencies - if args.out_periphconf_hex: - if args.periphconf_address is None: - raise ScriptError( - "--periphconf-address is required when --out-periphconf-hex is used" - ) - if args.periphconf_size is None: - raise ScriptError("--periphconf-size is required when --out-periphconf-hex is used") - - # Validate secondary argument dependencies - if args.secondary and args.secondary_address is None: - raise ScriptError("--secondary-address is required when --secondary is used") - - if args.out_secondary_periphconf_hex: - if args.secondary_periphconf_address is None: - raise ScriptError( - "--secondary-periphconf-address is required when " - "--out-secondary-periphconf-hex is used" - ) - if args.secondary_periphconf_size is None: - raise ScriptError( - "--secondary-periphconf-size is required when " - "--out-secondary-periphconf-hex is used" - ) - - # Validate secure storage argument dependencies - if args.securestorage: - if args.securestorage_address is None: - raise ScriptError( - "--securestorage-address is required when --securestorage is used" - ) - if args.securestorage_size is None: - raise ScriptError("--securestorage-size is required when --securestorage is used") - - # Validate partition layout - validate_secure_storage_partitions(args) - - init_values = DISABLED_VALUE.to_bytes(4, "little") * (c.sizeof(Uicr) // 4) - uicr = Uicr.from_buffer_copy(init_values) - - uicr.VERSION.MAJOR = UICR_FORMAT_VERSION_MAJOR - uicr.VERSION.MINOR = UICR_FORMAT_VERSION_MINOR - - # Handle secure storage configuration - if args.securestorage: - uicr.SECURESTORAGE.ENABLE = ENABLED_VALUE - uicr.SECURESTORAGE.ADDRESS = args.securestorage_address - - # Set partition sizes in 1KB units - uicr.SECURESTORAGE.CRYPTO.APPLICATIONSIZE1KB = args.cpuapp_crypto_size // 1024 - uicr.SECURESTORAGE.CRYPTO.RADIOCORESIZE1KB = args.cpurad_crypto_size // 1024 - uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 - uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 - - # Handle LOCK and ERASEPROTECT configuration - # Check if both are enabled together - this requires explicit acknowledgment - if ( - args.lock - and args.eraseprotect - and not args.permit_permanently_transitioning_device_to_deployed - ): - raise ScriptError( - "Enabling both --lock and --eraseprotect requires " - "--permit-permanently-transitioning-device-to-deployed to be specified. " - "This combination permanently locks the device configuration and prevents " - "ERASEALL." - ) - - if args.lock: - uicr.LOCK = ENABLED_VALUE - if args.eraseprotect: - uicr.ERASEPROTECT = ENABLED_VALUE - # Handle APPROTECT configuration - if args.approtect_application_protected: - uicr.APPROTECT.APPLICATION = PROTECTED_VALUE - - if args.approtect_radiocore_protected: - uicr.APPROTECT.RADIOCORE = PROTECTED_VALUE - - if args.approtect_coresight_protected: - uicr.APPROTECT.CORESIGHT = PROTECTED_VALUE - # Handle protected memory configuration - if args.protectedmem: - if args.protectedmem_size_bytes % KB_4 != 0: - raise ScriptError( - f"Protected memory size ({args.protectedmem_size_bytes} bytes) " - f"must be divisible by {KB_4}" - ) - uicr.PROTECTEDMEM.ENABLE = ENABLED_VALUE - uicr.PROTECTEDMEM.SIZE4KB = args.protectedmem_size_bytes // KB_4 - - # Handle WDTSTART configuration - if args.wdtstart: - uicr.WDTSTART.ENABLE = ENABLED_VALUE - uicr.WDTSTART.CRV = args.wdtstart_crv - uicr.WDTSTART.INSTANCE = args.wdtstart_instance_code - - # Process periphconf data first and configure UICR completely before creating hex objects - periphconf_hex = IntelHex() - secondary_periphconf_hex = IntelHex() - - if args.out_periphconf_hex: - periphconf_combined = extract_and_combine_periphconfs(args.in_periphconf_elfs) - - padding_len = args.periphconf_size - len(periphconf_combined) - periphconf_final = periphconf_combined + bytes([0xFF for _ in range(padding_len)]) - - # Add periphconf data to periphconf hex object - periphconf_hex.frombytes(periphconf_final, offset=args.periphconf_address) - - # Configure UICR with periphconf settings - uicr.PERIPHCONF.ENABLE = ENABLED_VALUE - uicr.PERIPHCONF.ADDRESS = args.periphconf_address - - # MAXCOUNT is given in number of 8-byte peripheral - # configuration entries and periphconf_size is given in - # bytes. When setting MAXCOUNT based on the - # periphconf_size we must first assert that - # periphconf_size has not been misconfigured. - if args.periphconf_size % 8 != 0: - raise ScriptError( - f"args.periphconf_size was {args.periphconf_size}, but must be divisible by 8" - ) - - uicr.PERIPHCONF.MAXCOUNT = args.periphconf_size // 8 - - # Handle secondary firmware configuration - if args.secondary: - uicr.SECONDARY.ENABLE = ENABLED_VALUE - uicr.SECONDARY.ADDRESS = args.secondary_address - uicr.SECONDARY.PROCESSOR = args.secondary_processor - - # Handle secondary TRIGGER configuration - if args.secondary_trigger: - uicr.SECONDARY.TRIGGER.ENABLE = ENABLED_VALUE - uicr.SECONDARY.TRIGGER.RESETREAS = args.secondary_trigger_resetreas - - # Handle secondary PROTECTEDMEM configuration - if args.secondary_protectedmem_size: - uicr.SECONDARY.PROTECTEDMEM.ENABLE = ENABLED_VALUE - if args.secondary_protectedmem_size % 4096 != 0: - raise ScriptError( - f"args.secondary_protectedmem_size was {args.secondary_protectedmem_size}, " - f"but must be divisible by 4096" - ) - uicr.SECONDARY.PROTECTEDMEM.SIZE4KB = args.secondary_protectedmem_size // 4096 - # Handle secondary periphconf if provided - if args.out_secondary_periphconf_hex: - secondary_periphconf_combined = extract_and_combine_periphconfs( - args.in_secondary_periphconf_elfs - ) - - padding_len = args.secondary_periphconf_size - len(secondary_periphconf_combined) - secondary_periphconf_final = secondary_periphconf_combined + bytes( - [0xFF for _ in range(padding_len)] - ) - - # Add secondary periphconf data to secondary periphconf hex object - secondary_periphconf_hex.frombytes( - secondary_periphconf_final, offset=args.secondary_periphconf_address - ) - - # Configure UICR with secondary periphconf settings - uicr.SECONDARY.PERIPHCONF.ENABLE = ENABLED_VALUE - uicr.SECONDARY.PERIPHCONF.ADDRESS = args.secondary_periphconf_address - - # MAXCOUNT is given in number of 8-byte peripheral - # configuration entries and secondary_periphconf_size is given in - # bytes. When setting MAXCOUNT based on the - # secondary_periphconf_size we must first assert that - # secondary_periphconf_size has not been misconfigured. - if args.secondary_periphconf_size % 8 != 0: - raise ScriptError( - f"args.secondary_periphconf_size was {args.secondary_periphconf_size}, " - f"but must be divisible by 8" - ) - - uicr.SECONDARY.PERIPHCONF.MAXCOUNT = args.secondary_periphconf_size // 8 - - # Handle secondary WDTSTART configuration - if args.secondary_wdtstart: - uicr.SECONDARY.WDTSTART.ENABLE = ENABLED_VALUE - uicr.SECONDARY.WDTSTART.CRV = args.secondary_wdtstart_crv - uicr.SECONDARY.WDTSTART.INSTANCE = args.secondary_wdtstart_instance_code - - # Create UICR hex object with final UICR data - uicr_hex = IntelHex() - uicr_hex.frombytes(bytes(uicr), offset=args.uicr_address) - - # Create merged hex by combining UICR and periphconf hex objects - merged_hex = IntelHex() - merged_hex.fromdict(uicr_hex.todict()) - - if args.out_periphconf_hex: - periphconf_hex.write_hex_file(args.out_periphconf_hex) - merged_hex.fromdict(periphconf_hex.todict()) - - if args.out_secondary_periphconf_hex: - secondary_periphconf_hex.write_hex_file(args.out_secondary_periphconf_hex) - merged_hex.fromdict(secondary_periphconf_hex.todict()) - - merged_hex.write_hex_file(args.out_merged_hex) - uicr_hex.write_hex_file(args.out_uicr_hex) - - except ScriptError as e: - print(f"Error: {e!s}") - sys.exit(1) - - -def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes: - combined_periphconf = [] - ipcmap_index = 0 - - for in_file in elf_files: - elf = ELFFile(in_file) - conf_section = elf.get_section_by_name(PERIPHCONF_SECTION) - if conf_section is None: - continue - - conf_section_data = conf_section.data() - num_entries = len(conf_section_data) // PERIPHCONF_ENTRY_SIZE - periphconf = (PeriphconfEntry * num_entries).from_buffer_copy(conf_section_data) - ipcmap_index = adjust_ipcmap_entries(periphconf, offset_index=ipcmap_index) - combined_periphconf.extend(periphconf) - - combined_periphconf.sort(key=lambda e: e.regptr) - deduplicated_periphconf = [] - - for regptr, regptr_entries in groupby(combined_periphconf, key=lambda e: e.regptr): - entries = list(regptr_entries) - if len(entries) > 1: - unique_values = {e.value for e in entries} - if len(unique_values) > 1: - raise ScriptError( - f"PERIPHCONF has conflicting values for register 0x{regptr:09_x}: " - + ", ".join([f"0x{val:09_x}" for val in unique_values]) - ) - deduplicated_periphconf.append(entries[0]) - - final_periphconf = (PeriphconfEntry * len(deduplicated_periphconf))() - for i, entry in enumerate(deduplicated_periphconf): - final_periphconf[i] = entry - - return bytes(final_periphconf) - - -# This workaround is currently needed to avoid conflicts in IPCMAP whenever more than -# one image uses IPCMAP, because at the moment each image has no way of knowing which -# IPCMAP channel indices it should use for the configuration it generates locally. -# -# What the workaround does is adjust all IPCMAP entries found in the periphconf by the -# given index offset. -# -# The workaround assumes that IPCMAP entries are allocated sequentially starting from 0 -# in each image, it will probably not work for arbitrary IPCMAP entries. -def adjust_ipcmap_entries(periphconf: c.Array[PeriphconfEntry], offset_index: int) -> int: - max_ipcmap_index = offset_index - - for entry in sorted(periphconf, key=lambda e: e.regptr): - if IPCMAP_CHANNEL_START_ADDR <= entry.regptr < IPCMAP_CHANNEL_END_ADDR: - entry.regptr += offset_index * IPCMAP_CHANNEL_SIZE - entry_ipcmap_index = (entry.regptr - IPCMAP_CHANNEL_START_ADDR) // IPCMAP_CHANNEL_SIZE - max_ipcmap_index = max(max_ipcmap_index, entry_ipcmap_index) - - return max_ipcmap_index + 1 - - -# Size of each IPCMAP.CHANNEL[i] -IPCMAP_CHANNEL_SIZE = 8 -# Number of entries in IPCMAP.CHANNEL -IPCMAP_CHANNEL_COUNT = 16 -# Address of IPCMAP.CHANNEL[0] -IPCMAP_CHANNEL_START_ADDR = 0x5F92_3000 + 256 * 4 -# Address of IPCMAP.CHANNEL[channel count] + 1 -IPCMAP_CHANNEL_END_ADDR = IPCMAP_CHANNEL_START_ADDR + IPCMAP_CHANNEL_SIZE * IPCMAP_CHANNEL_COUNT - - -if __name__ == "__main__": - main() diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 290cf16a0a6f..9c5111717c6c 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -264,11 +264,13 @@ endif() # Generate hex files (merged, uicr-only, periphconf-only, and secondary-periphconf-only) add_custom_command( OUTPUT ${merged_hex_file} ${uicr_hex_file} ${periphconf_hex_file} ${secondary_periphconf_hex_file} - COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${ZEPHYR_BASE}/scripts/dts/python-devicetree/src - ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/soc/nordic/common/uicr/gen_uicr.py + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/ironside/se/tool/ironside/__main__.py + gen-uicr --uicr-address ${UICR_ADDRESS} --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} + --periphconf-section-name "periphconf_entry" + --periphconf-ipcmap-reallocate ${lock_args} ${eraseprotect_args} ${approtect_args} diff --git a/soc/nordic/common/uicr/uicr.h b/soc/nordic/common/uicr/uicr.h deleted file mode 100644 index 7ceb12429e22..000000000000 --- a/soc/nordic/common/uicr/uicr.h +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SOC_NORDIC_COMMON_UICR_UICR_H_ -#define SOC_NORDIC_COMMON_UICR_UICR_H_ - -#include -#include -#include -#include -#include - -/** Entry in the PERIPHCONF table. */ -struct uicr_periphconf_entry { - /** Register pointer. */ - uint32_t regptr; - /** Register value. */ - uint32_t value; -} __packed; - -/** @brief Add an entry to the PERIPHCONF table section. - * - * This should typically not be used directly. - * Prefer to use one of the higher level macros. - */ -#define UICR_PERIPHCONF_ADD(_regptr, _value) \ - static STRUCT_SECTION_ITERABLE(uicr_periphconf_entry, \ - _UICR_PERIPHCONF_ENTRY_NAME(__COUNTER__)) = { \ - .regptr = (_regptr), \ - .value = (_value), \ - } - -#define _UICR_PERIPHCONF_ENTRY_NAME(_id) __UICR_PERIPHCONF_ENTRY_NAME(_id) -#define __UICR_PERIPHCONF_ENTRY_NAME(_id) _uicr_periphconf_entry_##_id - -/** @brief Add a PERIPHCONF entry for a SPU PERIPH[n].PERM register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Peripheral slave index on the bus (PERIPH[n] register index). - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _dmasec If true, set DMASEC to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_PERIPH_PERM_SET(_spu, _index, _secattr, _dmasec, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->PERIPH[(_index)].PERM, \ - (uint32_t)((((_ownerid) << SPU_PERIPH_PERM_OWNERID_Pos) & \ - SPU_PERIPH_PERM_OWNERID_Msk) | \ - (((_secattr) ? SPU_PERIPH_PERM_SECATTR_Secure \ - : SPU_PERIPH_PERM_SECATTR_NonSecure) \ - << SPU_PERIPH_PERM_SECATTR_Pos) | \ - (((_dmasec) ? SPU_PERIPH_PERM_DMASEC_Secure \ - : SPU_PERIPH_PERM_DMASEC_NonSecure) \ - << SPU_PERIPH_PERM_DMASEC_Pos) | \ - (SPU_PERIPH_PERM_LOCK_Locked << SPU_PERIPH_PERM_LOCK_Pos))) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.IPCT.CH[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_IPCT_CH_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.IPCT.CH[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.IPCT.INTERRUPT[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_IPCT_INTERRUPT_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.IPCT.INTERRUPT[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.DPPIC.CH[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_DPPIC_CH_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.DPPIC.CH[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.DPPIC.CHG[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Register index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_DPPIC_CHG_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.DPPIC.CHG[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIOTE[n].CH[m] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index (GPIOTE[n] register index). - * @param _subindex Feature subindex (CH[m] register index). - * @param _secattr If true, set the SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_GPIOTE_CH_SET(_spu, _index, _subindex, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD( \ - (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIOTE[_index].CH[_subindex], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIOTE.INTERRUPT[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _subindex Feature subindex. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_GPIOTE_INTERRUPT_SET(_spu, _index, _subindex, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD( \ - (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIOTE[_index].INTERRUPT[_subindex], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIO[n].PIN[m] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _subindex Feature subindex. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_GPIO_PIN_SET(_spu, _index, _subindex, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD( \ - (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIO[_index].PIN[_subindex], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GRTC.CC[n] register value. - * - * @param _spu Global domain SPU instance address. - * @param _index Feature index. - * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. - * @param _ownerid OWNERID field value. - */ -#define UICR_SPU_FEATURE_GRTC_CC_SET(_spu, _index, _secattr, _ownerid) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GRTC.CC[_index], \ - _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) - -/* Common macro for encoding a SPU FEATURE.* register value. - * Note that the MDK SPU_FEATURE_IPCT_CH_ macros are used for all since all the FEATURE registers - * have the same layout with different naming. - */ -#define _UICR_SPU_FEATURE_VAL(_secattr, _ownerid) \ - (uint32_t)((((_ownerid) << SPU_FEATURE_IPCT_CH_OWNERID_Pos) & \ - SPU_FEATURE_IPCT_CH_OWNERID_Msk) | \ - (((_secattr) ? SPU_FEATURE_IPCT_CH_SECATTR_Secure \ - : SPU_FEATURE_IPCT_CH_SECATTR_NonSecure) \ - << SPU_FEATURE_IPCT_CH_SECATTR_Pos) | \ - (SPU_FEATURE_IPCT_CH_LOCK_Locked << SPU_FEATURE_IPCT_CH_LOCK_Pos)) - -/** @brief Add PERIPHCONF entries for configuring IPCMAP CHANNEL.SOURCE[n] and CHANNEL.SINK[n]. - * - * @param _index CHANNEL.SOURCE[n]/CHANNEL.SINK[n] register index. - * @param _source_domain DOMAIN field value in CHANNEL[n].SOURCE. - * @param _source_ch SOURCE field value in CHANNEL[n].SOURCE. - * @param _sink_domain DOMAIN field value in CHANNEL[n].SINK. - * @param _sink_ch SINK field value in CHANNEL[n].SINK. - */ -#define UICR_IPCMAP_CHANNEL_CFG(_index, _source_domain, _source_ch, _sink_domain, _sink_ch) \ - UICR_IPCMAP_CHANNEL_SOURCE_SET(_index, _source_domain, _source_ch, 1); \ - UICR_IPCMAP_CHANNEL_SINK_SET(_index, _sink_domain, _sink_ch) - -#define UICR_IPCMAP_CHANNEL_SOURCE_SET(_index, _domain, _ch, _enable) \ - UICR_PERIPHCONF_ADD((uint32_t)&NRF_IPCMAP->CHANNEL[(_index)].SOURCE, \ - (uint32_t)((((_domain) << IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos) & \ - IPCMAP_CHANNEL_SOURCE_DOMAIN_Msk) | \ - (((_ch) << IPCMAP_CHANNEL_SOURCE_SOURCE_Pos) & \ - IPCMAP_CHANNEL_SOURCE_SOURCE_Msk) | \ - (((_enable) ? IPCMAP_CHANNEL_SOURCE_ENABLE_Enabled \ - : IPCMAP_CHANNEL_SOURCE_ENABLE_Disabled) \ - << IPCMAP_CHANNEL_SOURCE_ENABLE_Pos))) - -#define UICR_IPCMAP_CHANNEL_SINK_SET(_index, _domain, _ch) \ - UICR_PERIPHCONF_ADD((uint32_t)&NRF_IPCMAP->CHANNEL[(_index)].SINK, \ - (uint32_t)((((_domain) << IPCMAP_CHANNEL_SINK_DOMAIN_Pos) & \ - IPCMAP_CHANNEL_SINK_DOMAIN_Msk) | \ - (((_ch) << IPCMAP_CHANNEL_SINK_SINK_Pos) & \ - IPCMAP_CHANNEL_SINK_SINK_Msk))) - -/** @brief Add a PERIPHCONF entry for an IRQMAP IRQ[n].SINK register value. - * - * @param _irqnum IRQ number (IRQ[n] register index). - * @param _processor Processor to route the interrupt to (PROCESSORID field value). - */ -#define UICR_IRQMAP_IRQ_SINK_SET(_irqnum, _processor) \ - UICR_PERIPHCONF_ADD((uint32_t)&NRF_IRQMAP->IRQ[(_irqnum)].SINK, \ - (uint32_t)(((_processor) << IRQMAP_IRQ_SINK_PROCESSORID_Pos) & \ - IRQMAP_IRQ_SINK_PROCESSORID_Msk)) - -/** @brief Add a PERIPHCONF entry for configuring a GPIO PIN_CNF[n] CTRLSEL field value. - * - * @param _gpio GPIO instance address. - * @param _pin Pin number (PIN_CNF[n] register index). - * @param _ctrlsel CTRLSEL field value. - */ -#define UICR_GPIO_PIN_CNF_CTRLSEL_SET(_gpio, _pin, _ctrlsel) \ - UICR_PERIPHCONF_ADD( \ - (uint32_t)&((NRF_GPIO_Type *)(_gpio))->PIN_CNF[(_pin)], \ - ((GPIO_PIN_CNF_ResetValue) | \ - (uint32_t)(((_ctrlsel) << GPIO_PIN_CNF_CTRLSEL_Pos) & GPIO_PIN_CNF_CTRLSEL_Msk))) - -/** @brief Add a PERIPHCONF entry for a PPIB SUBSCRIBE_SEND[n] register. - * - * @param _ppib Global domain PPIB instance address. - * @param _ppib_ch PPIB channel number. - */ -#define UICR_PPIB_SUBSCRIBE_SEND_ENABLE(_ppib, _ppib_ch) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_PPIB_Type *)(_ppib))->SUBSCRIBE_SEND[(_ppib_ch)], \ - (uint32_t)PPIB_SUBSCRIBE_SEND_EN_Msk) - -/** @brief Add a PERIPHCONF entry for a PPIB PUBLISH_RECEIVE[n] register. - * - * @param _ppib Global domain PPIB instance address. - * @param _ppib_ch PPIB channel number. - */ -#define UICR_PPIB_PUBLISH_RECEIVE_ENABLE(_ppib, _ppib_ch) \ - UICR_PERIPHCONF_ADD((uint32_t)&((NRF_PPIB_Type *)(_ppib))->PUBLISH_RECEIVE[(_ppib_ch)], \ - (uint32_t)PPIB_PUBLISH_RECEIVE_EN_Msk) - -/* The definitions below are not currently available in the MDK but are needed for the macros - * above. When they are, this can be deleted. - */ -#ifndef IPCMAP_CHANNEL_SOURCE_SOURCE_Msk - -typedef struct { - __IOM uint32_t SOURCE; - __IOM uint32_t SINK; -} NRF_IPCMAP_CHANNEL_Type; - -#define IPCMAP_CHANNEL_SOURCE_SOURCE_Pos (0UL) -#define IPCMAP_CHANNEL_SOURCE_SOURCE_Msk (0xFUL << IPCMAP_CHANNEL_SOURCE_SOURCE_Pos) -#define IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos (8UL) -#define IPCMAP_CHANNEL_SOURCE_DOMAIN_Msk (0xFUL << IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos) -#define IPCMAP_CHANNEL_SOURCE_ENABLE_Pos (31UL) -#define IPCMAP_CHANNEL_SOURCE_ENABLE_Disabled (0x0UL) -#define IPCMAP_CHANNEL_SOURCE_ENABLE_Enabled (0x1UL) -#define IPCMAP_CHANNEL_SINK_SINK_Pos (0UL) -#define IPCMAP_CHANNEL_SINK_SINK_Msk (0xFUL << IPCMAP_CHANNEL_SINK_SINK_Pos) -#define IPCMAP_CHANNEL_SINK_DOMAIN_Pos (8UL) -#define IPCMAP_CHANNEL_SINK_DOMAIN_Msk (0xFUL << IPCMAP_CHANNEL_SINK_DOMAIN_Pos) - -typedef struct { - __IM uint32_t RESERVED[256]; - __IOM NRF_IPCMAP_CHANNEL_Type CHANNEL[16]; -} NRF_IPCMAP_Type; - -#endif /* IPCMAP_CHANNEL_SOURCE_SOURCE_Msk */ - -#ifndef NRF_IPCMAP -#define NRF_IPCMAP ((NRF_IPCMAP_Type *)0x5F923000UL) -#endif - -#ifndef IRQMAP_IRQ_SINK_PROCESSORID_Msk - -typedef struct { - __IOM uint32_t SINK; -} NRF_IRQMAP_IRQ_Type; - -#define IRQMAP_IRQ_SINK_PROCESSORID_Pos (8UL) -#define IRQMAP_IRQ_SINK_PROCESSORID_Msk (0xFUL << IRQMAP_IRQ_SINK_PROCESSORID_Pos) - -typedef struct { - __IM uint32_t RESERVED[256]; - __IOM NRF_IRQMAP_IRQ_Type IRQ[480]; -} NRF_IRQMAP_Type; - -#endif /* IRQMAP_IRQ_SINK_PROCESSORID_Msk */ - -#ifndef NRF_IRQMAP -#define NRF_IRQMAP ((NRF_IRQMAP_Type *)0x5F924000UL) -#endif /* NRF_IRQMAP */ - -#ifndef GPIO_PIN_CNF_CTRLSEL_Pos - -#define GPIO_PIN_CNF_CTRLSEL_Pos (28UL) -#define GPIO_PIN_CNF_CTRLSEL_Msk (0x7UL << GPIO_PIN_CNF_CTRLSEL_Pos) -#define GPIO_PIN_CNF_CTRLSEL_Min (0x0UL) -#define GPIO_PIN_CNF_CTRLSEL_Max (0x7UL) -#define GPIO_PIN_CNF_CTRLSEL_GPIO (0x0UL) -#define GPIO_PIN_CNF_CTRLSEL_VPR (0x1UL) -#define GPIO_PIN_CNF_CTRLSEL_GRC (0x1UL) -#define GPIO_PIN_CNF_CTRLSEL_SecureDomain (0x2UL) -#define GPIO_PIN_CNF_CTRLSEL_PWM (0x2UL) -#define GPIO_PIN_CNF_CTRLSEL_I3C (0x2UL) -#define GPIO_PIN_CNF_CTRLSEL_Serial (0x3UL) -#define GPIO_PIN_CNF_CTRLSEL_HSSPI (0x3UL) -#define GPIO_PIN_CNF_CTRLSEL_RadioCore (0x4UL) -#define GPIO_PIN_CNF_CTRLSEL_EXMIF (0x4UL) -#define GPIO_PIN_CNF_CTRLSEL_CELL (0x4UL) -#define GPIO_PIN_CNF_CTRLSEL_DTB (0x6UL) -#define GPIO_PIN_CNF_CTRLSEL_TND (0x7UL) - -#endif /* GPIO_PIN_CNF_CTRLSEL_Pos */ - -#endif /* SOC_NORDIC_COMMON_UICR_UICR_H_ */ diff --git a/soc/nordic/ironside/CMakeLists.txt b/soc/nordic/ironside/CMakeLists.txt deleted file mode 100644 index f1ae2114f2ec..000000000000 --- a/soc/nordic/ironside/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -zephyr_include_directories(include) -zephyr_library() -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOTMODE_SERVICE bootmode.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_TDD_SERVICE tdd.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_DVFS_SERVICE dvfs.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_COUNTER_SERVICE counter.c) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig deleted file mode 100644 index 7498af71d909..000000000000 --- a/soc/nordic/ironside/Kconfig +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config NRF_IRONSIDE - bool - depends on SOC_NRF54H20 || SOC_NRF9280 - help - This is selected by drivers interacting with Nordic IronSide firmware. - -config NRF_IRONSIDE_CALL - bool - depends on DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED - select NRF_IRONSIDE - select EVENTS - select MBOX - help - This is selected by features that require support for IronSide calls. - -if NRF_IRONSIDE_CALL - -config NRF_IRONSIDE_CALL_INIT_PRIORITY - int "IronSide calls' initialization priority" - default 41 - help - Initialization priority of IronSide calls. It must be below MBOX_INIT_PRIORITY, - but higher than the priority of any feature that selects NRF_IRONSIDE_CALL. - -endif # NRF_IRONSIDE_CALL - -menu "Nordic IronSide services" - depends on SOC_NRF54H20 || SOC_NRF9280 - -config NRF_IRONSIDE_CPUCONF_SERVICE - bool "IronSide CPUCONF service" - depends on SOC_NRF54H20_CPUAPP || SOC_NRF9280_CPUAPP - select NRF_IRONSIDE_CALL - help - Service used to boot local domain cores. - -config NRF_IRONSIDE_TDD_SERVICE - bool "IronSide TDD service" - select NRF_IRONSIDE_CALL - help - Service used to control the trace and debug domain. - -config NRF_IRONSIDE_UPDATE_SERVICE - bool "IronSide update service" - select NRF_IRONSIDE_CALL - help - Service used to update the IronSide SE firmware. - -config NRF_IRONSIDE_BOOT_REPORT - bool "IronSide boot report" - depends on $(dt_nodelabel_exists,ironside_se_boot_report) - select NRF_IRONSIDE - help - Support for parsing the Boot Report populated by Nordic IronSide firmware. - -config NRF_IRONSIDE_BOOTMODE_SERVICE - bool "IronSide boot mode service" - select NRF_IRONSIDE_CALL - help - Service used to reboot into secondary firmware boot mode. - -config NRF_IRONSIDE_DVFS_SERVICE - bool "IronSide DVFS service" - depends on SOC_NRF54H20_CPUAPP - select NRF_IRONSIDE_CALL - help - Service used to handle DVFS operating point requests. - -config NRF_IRONSIDE_COUNTER_SERVICE - bool "IronSide counter service" - select NRF_IRONSIDE_CALL - help - Service used to manage secure monotonic counters. - -if NRF_IRONSIDE_DVFS_SERVICE - -config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS - int "IRONSside DVFS ABB analog status check maximum attempts" - range 0 255 - default 50 - help - Maximum attempts with 10us intervals before busy status will be reported. - -endif # NRF_IRONSIDE_DVFS_SERVICE - -endmenu diff --git a/soc/nordic/ironside/boot_report.c b/soc/nordic/ironside/boot_report.c deleted file mode 100644 index ead0afca947f..000000000000 --- a/soc/nordic/ironside/boot_report.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -#define IRONSIDE_SE_BOOT_REPORT_ADDR DT_REG_ADDR(DT_NODELABEL(ironside_se_boot_report)) - -int ironside_boot_report_get(const struct ironside_boot_report **report) -{ - const struct ironside_boot_report *tmp_report = (void *)IRONSIDE_SE_BOOT_REPORT_ADDR; - - if (tmp_report->magic != IRONSIDE_BOOT_REPORT_MAGIC) { - return -EINVAL; - } - - *report = tmp_report; - - return 0; -} diff --git a/soc/nordic/ironside/bootmode.c b/soc/nordic/ironside/bootmode.c deleted file mode 100644 index 92ca5e312653..000000000000 --- a/soc/nordic/ironside/bootmode.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include -#include -#include - -#define BOOT_MODE_SECONDARY (0x1) - -BUILD_ASSERT(IRONSIDE_BOOTMODE_SERVICE_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); - -int ironside_bootmode_secondary_reboot(const uint8_t *msg, size_t msg_size) -{ - int err; - struct ironside_call_buf *buf; - uint8_t *buf_msg; - - if (msg_size > IRONSIDE_BOOTMODE_SERVICE_MSG_MAX_SIZE) { - return -IRONSIDE_BOOTMODE_ERROR_MESSAGE_TOO_LARGE; - } - - buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_BOOTMODE_SERVICE_V1; - - buf->args[IRONSIDE_BOOTMODE_SERVICE_MODE_IDX] = BOOT_MODE_SECONDARY; - - buf_msg = (uint8_t *)&buf->args[IRONSIDE_BOOTMODE_SERVICE_MSG_0_IDX]; - - memset(buf_msg, 0, IRONSIDE_BOOTMODE_SERVICE_MSG_MAX_SIZE); - - if (msg_size > 0) { - memcpy(buf_msg, msg, msg_size); - } - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_BOOTMODE_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/soc/nordic/ironside/counter.c b/soc/nordic/ironside/counter.c deleted file mode 100644 index b4506621851d..000000000000 --- a/soc/nordic/ironside/counter.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -int ironside_counter_set(enum ironside_counter counter_id, uint32_t value) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_COUNTER_SET_V1; - buf->args[IRONSIDE_COUNTER_SET_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; - buf->args[IRONSIDE_COUNTER_SET_SERVICE_VALUE_IDX] = value; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_COUNTER_SET_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} - -int ironside_counter_get(enum ironside_counter counter_id, uint32_t *value) -{ - int err; - struct ironside_call_buf *buf; - - if (value == NULL) { - return -IRONSIDE_COUNTER_ERROR_INVALID_PARAM; - } - - buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_COUNTER_GET_V1; - buf->args[IRONSIDE_COUNTER_GET_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_COUNTER_GET_SERVICE_RETCODE_IDX]; - if (err == 0) { - *value = buf->args[IRONSIDE_COUNTER_GET_SERVICE_VALUE_IDX]; - } - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} - -int ironside_counter_lock(enum ironside_counter counter_id) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_COUNTER_LOCK_V1; - buf->args[IRONSIDE_COUNTER_LOCK_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_COUNTER_LOCK_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/soc/nordic/ironside/cpuconf.c b/soc/nordic/ironside/cpuconf.c deleted file mode 100644 index 264772a09e25..000000000000 --- a/soc/nordic/ironside/cpuconf.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -#include -#include - -#include -#include - -#define CPU_PARAMS_CPU_OFFSET (0) -#define CPU_PARAMS_CPU_MASK (0xF) -#define CPU_PARAMS_WAIT_BIT BIT(4) - -int ironside_cpuconf(NRF_PROCESSORID_Type cpu, const void *vector_table, bool cpu_wait, - const uint8_t *msg, size_t msg_size) -{ - int err; - struct ironside_call_buf *buf; - uint8_t *buf_msg; - - if (msg_size > IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE) { - return -IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE; - } - - buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_CPUCONF_V0; - - buf->args[IRONSIDE_CPUCONF_SERVICE_CPU_PARAMS_IDX] = - (((uint32_t)cpu << CPU_PARAMS_CPU_OFFSET) & CPU_PARAMS_CPU_MASK) | - (cpu_wait ? CPU_PARAMS_WAIT_BIT : 0); - - buf->args[IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX] = (uint32_t)vector_table; - - buf_msg = (uint8_t *)&buf->args[IRONSIDE_CPUCONF_SERVICE_MSG_0]; - if (msg_size > 0) { - memcpy(buf_msg, msg, msg_size); - } - if (msg_size < IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE) { - memset(&buf_msg[msg_size], 0, IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE - msg_size); - } - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_CPUCONF_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/soc/nordic/ironside/include/nrf_ironside/boot_report.h b/soc/nordic/ironside/include/nrf_ironside/boot_report.h deleted file mode 100644 index 8c602c00134c..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/boot_report.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ - -#include -#include - -/** Constant used to check if an Nordic IronSide SE boot report has been written. */ -#define IRONSIDE_BOOT_REPORT_MAGIC (0x4d69546fUL) - -/** UICR had no errors. */ -#define IRONSIDE_UICR_SUCCESS 0 -/** There was an unexpected error processing the UICR. */ -#define IRONSIDE_UICR_ERROR_UNEXPECTED 1 -/** The UICR integrity check failed. */ -#define IRONSIDE_UICR_ERROR_INTEGRITY 2 -/** The UICR content check failed. */ -#define IRONSIDE_UICR_ERROR_CONTENT 3 -/** Failed to configure system based on UICR. */ -#define IRONSIDE_UICR_ERROR_CONFIG 4 -/** Unsupported UICR format version. */ -#define IRONSIDE_UICR_ERROR_FORMAT 5 - -/** Error found in UICR.PROTECTEDMEM. */ -#define IRONSIDE_UICR_REGID_PROTECTEDMEM 36 -/** Error found in UICR.SECURESTORAGE. */ -#define IRONSIDE_UICR_REGID_SECURESTORAGE 64 -/** Error found in UICR.PERIPHCONF. */ -#define IRONSIDE_UICR_REGID_PERIPHCONF 104 -/** Error found in UICR.MPCCONF. */ -#define IRONSIDE_UICR_REGID_MPCCONF 116 -/** Error found in UICR.SECONDARY.ADDRESS/SIZE4KB */ -#define IRONSIDE_UICR_REGID_SECONDARY 128 -/** Error found in UICR.SECONDARY.PROTECTEDMEM. */ -#define IRONSIDE_UICR_REGID_SECONDARY_PROTECTEDMEM 152 -/** Error found in UICR.SECONDARY.PERIPHCONF. */ -#define IRONSIDE_UICR_REGID_SECONDARY_PERIPHCONF 172 -/** Error found in UICR.SECONDARY.MPCCONF. */ -#define IRONSIDE_UICR_REGID_SECONDARY_MPCCONF 184 - -/** Failed to mount a CRYPTO secure storage partition in MRAM. */ -#define IRONSIDE_UICR_SECURESTORAGE_ERROR_MOUNT_CRYPTO_FAILED 1 -/** Failed to mount an ITS secure storage partition in MRAM. */ -#define IRONSIDE_UICR_SECURESTORAGE_ERROR_MOUNT_ITS_FAILED 2 -/** The start address and total size of all ITS partitions are not aligned to 4 KB. */ -#define IRONSIDE_UICR_SECURESTORAGE_ERROR_MISALIGNED 3 - -/** There was an unexpected error processing UICR.PERIPHCONF. */ -#define IRONSIDE_UICR_PERIPHCONF_ERROR_UNEXPECTED 1 -/** The address contained in a UICR.PERIPHCONF array entry is not permitted. */ -#define IRONSIDE_UICR_PERIPHCONF_ERROR_NOT_PERMITTED 2 -/** The readback of the value for a UICR.PERIPHCONF array entry did not match. */ -#define IRONSIDE_UICR_PERIPHCONF_ERROR_READBACK_MISMATCH 3 - -/** Booted in secondary mode. */ -#define IRONSIDE_BOOT_MODE_FLAGS_SECONDARY_MASK 0x1 - -/** Booted normally by IronSide SE.*/ -#define IRONSIDE_BOOT_REASON_DEFAULT 0 -/** Booted because of a cpuconf service call by a different core. */ -#define IRONSIDE_BOOT_REASON_CPUCONF_CALL 1 -/** Booted in secondary mode because of a bootmode service call. */ -#define IRONSIDE_BOOT_REASON_BOOTMODE_SECONDARY_CALL 2 -/** Booted in secondary mode because of a boot error in the primary mode. */ -#define IRONSIDE_BOOT_REASON_BOOTERROR 3 -/** Booted in secondary mode because of local domain reset reason trigger. */ -#define IRONSIDE_BOOT_REASON_TRIGGER_RESETREAS 4 -/** Booted in secondary mode via the CTRL-AP. */ -#define IRONSIDE_BOOT_REASON_CTRLAP_SECONDARYMODE 5 - -/** The boot had no errors. */ -#define IRONSIDE_BOOT_ERROR_SUCCESS 0x0 -/** The reset vector for the application firmware was not programmed. */ -#define IRONSIDE_BOOT_ERROR_NO_APPLICATION_FIRMWARE 0x1 -/** The IronSide SE was unable to parse the SysCtrl ROM report. */ -#define IRONSIDE_BOOT_ERROR_ROM_REPORT_INVALID 0x2 -/** The SysCtrl ROM booted the system in current limited mode due to an issue in the BICR. */ -#define IRONSIDE_BOOT_ERROR_ROM_REPORT_CURRENT_LIMITED 0x3 -/** The IronSide SE detected an issue with the HFXO configuration in the BICR. */ -#define IRONSIDE_BOOT_ERROR_BICR_HFXO_INVALID 0x4 -/** The IronSide SE detected an issue with the LFXO configuration in the BICR. */ -#define IRONSIDE_BOOT_ERROR_BICR_LFXO_INVALID 0x5 -/** The IronSide SE failed to boot the SysCtrl Firmware. */ -#define IRONSIDE_BOOT_ERROR_SYSCTRL_START_FAILED 0x6 -/** The UICR integrity check failed. */ -#define IRONSIDE_BOOT_ERROR_UICR_INTEGRITY_FAILED 0x7 -/** The UICR content is not valid */ -#define IRONSIDE_BOOT_ERROR_UICR_CONTENT_INVALID 0x8 -/** Integrity check of PROTECTEDMEM failed. */ -#define IRONSIDE_BOOT_ERROR_UICR_PROTECTEDMEM_INTEGRITY_FAILED 0x9 -/** Failed to configure system based on UICR. */ -#define IRONSIDE_BOOT_ERROR_UICR_CONFIG_FAILED 0xA -/** The IronSide SE failed to mount its own storage. */ -#define IRONSIDE_BOOT_ERROR_SECDOM_STORAGE_MOUNT_FAILED 0xB -/** Failed to initialize DVFS service */ -#define IRONSIDE_BOOT_ERROR_DVFS_INIT_FAILED 0xC -/** Failed to boot secondary application firmware; configuration missing from UICR. */ -#define IRONSIDE_BOOT_ERROR_NO_SECONDARY_APPLICATION_FIRMWARE 0xD -/** Integrity check of secondary PROTECTEDMEM failed. */ -#define IRONSIDE_BOOT_ERROR_UICR_SECONDARY_PROTECTEDMEM_INTEGRITY_FAILED 0xE -/** Unsupported UICR format version. */ -#define IRONSIDE_BOOT_ERROR_UICR_FORMAT_UNSUPPORTED 0xF -/** Value reserved for conditions that should never happen. */ -#define IRONSIDE_BOOT_ERROR_UNEXPECTED 0xff - -/** Index for RESETREAS.DOMAIN[NRF_DOMAIN_APPLICATION]. */ -#define IRONSIDE_SECONDARY_RESETREAS_APPLICATION 0 -/** Index for RESETREAS.DOMAIN[NRF_DOMAIN_RADIOCORE]. */ -#define IRONSIDE_SECONDARY_RESETREAS_RADIOCORE 1 - -/** Length of the local domain context buffer in bytes. */ -#define IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) -/** Length of the random data buffer in bytes. */ -#define IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) -/** Length of the uuid buffer in bytes. */ -#define IRONSIDE_BOOT_REPORT_UUID_SIZE (16UL) - -/** @brief Initialization/boot status description contained in the boot report. */ -struct ironside_boot_report_init_status { - /** Reserved for Future Use. */ - uint8_t rfu1[3]; - /** Boot error for the current boot (same as reported in BOOTSTATUS)*/ - uint8_t boot_error; - /** Overall UICR status. */ - uint8_t uicr_status; - /** Reserved for Future Use. */ - uint8_t rfu2; - /** ID of the register that caused the error. - * Only relevant for IRONSIDE_UICR_ERROR_CONTENT and IRONSIDE_UICR_ERROR_CONFIG. - */ - uint16_t uicr_regid; - /** Additional description for IRONSIDE_UICR_ERROR_CONFIG. */ - union { - /** UICR.SECURESTORAGE error description. */ - struct { - /** Reason that UICR.SECURESTORAGE configuration failed. */ - uint16_t status; - /** Owner ID of the failing secure storage partition. - * Only relevant for IRONSIDE_UICR_SECURESTORAGE_ERROR_MOUNT_CRYPTO_FAILED - * and IRONSIDE_UICR_SECURESTORAGE_ERROR_MOUNT_ITS_FAILED. - */ - uint16_t owner_id; - } securestorage; - /** UICR.PERIPHCONF error description. */ - struct { - /** Reason that UICR.PERIPHCONF configuration failed. */ - uint16_t status; - /** Index of the failing entry in the UICR.PERIPHCONF array. */ - uint16_t index; - } periphconf; - } uicr_detail; -}; - -/** @brief Initialization/boot context description contained in the boot report. */ -struct ironside_boot_report_init_context { - /** Reserved for Future Use */ - uint8_t rfu[3]; - /** Reason the processor was started. */ - uint8_t boot_reason; - - union { - /** Data passed from booting local domain to local domain being booted. - * - * Valid if the boot reason is one of the following: - * - IRONSIDE_BOOT_REASON_CPUCONF_CALL - * - IRONSIDE_BOOT_REASON_BOOTMODE_SECONDARY_CALL - */ - uint8_t local_domain_context[IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE]; - - /** Initialiation error that triggered the boot. - * - * Valid if the boot reason is IRONSIDE_BOOT_REASON_BOOTERROR. - */ - struct ironside_boot_report_init_status trigger_init_status; - - /** RESETREAS.DOMAIN that triggered the boot. - * - * Valid if the boot reason is IRONSIDE_BOOT_REASON_TRIGGER_RESETREAS. - */ - uint32_t trigger_resetreas[4]; - }; -}; - -/** @brief IronSide boot report. */ -struct ironside_boot_report { - /** Magic value used to identify valid boot report */ - uint32_t magic; - /** Firmware version of IronSide SE. 8bit MAJOR.MINOR.PATCH.SEQNUM */ - uint32_t ironside_se_version_int; - /** Human readable extraversion of IronSide SE */ - char ironside_se_extraversion[12]; - /** Firmware version of IronSide SE recovery firmware. 8bit MAJOR.MINOR.PATCH.SEQNUM */ - uint32_t ironside_se_recovery_version_int; - /** Human readable extraversion of IronSide SE recovery firmware */ - char ironside_se_recovery_extraversion[12]; - /** Copy of SICR.UROT.UPDATE.STATUS.*/ - uint32_t ironside_update_status; - /** Initialization/boot status. */ - struct ironside_boot_report_init_status init_status; - /** Reserved for Future Use */ - uint16_t rfu1; - /** Flags describing the current boot mode. */ - uint16_t boot_mode_flags; - /** Data describing the context under which the CPU was booted. */ - struct ironside_boot_report_init_context init_context; - /** CSPRNG data */ - uint8_t random_data[IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE]; - /** Device Info data : 128-bit Universally Unique IDentifier (UUID) */ - uint8_t device_info_uuid[IRONSIDE_BOOT_REPORT_UUID_SIZE]; - /** Reserved for Future Use */ - uint32_t rfu2[60]; -}; - -/** - * @brief Get a pointer to the IronSide boot report. - * - * @param[out] report Will be set to point to the IronSide boot report. - * - * @retval 0 if successful. - * @retval -EFAULT if the magic field in the report is incorrect. - * @retval -EINVAL if @p report is NULL. - */ -int ironside_boot_report_get(const struct ironside_boot_report **report); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/bootmode.h b/soc/nordic/ironside/include/nrf_ironside/bootmode.h deleted file mode 100644 index 4da46f33dd6d..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/bootmode.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOTMODE_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOTMODE_H_ - -#include -#include -#include - -/** - * @name Boot mode service error codes. - * @{ - */ - -/** Invalid/unsupported boot mode transition. */ -#define IRONSIDE_BOOTMODE_ERROR_UNSUPPORTED_MODE (1) -/** Failed to reboot into the boot mode due to other activity preventing a reset. */ -#define IRONSIDE_BOOTMODE_ERROR_BUSY (2) -/** The boot message is too large to fit in the buffer. */ -#define IRONSIDE_BOOTMODE_ERROR_MESSAGE_TOO_LARGE (3) - -/** - * @} - */ - -/* IronSide call identifiers with implicit versions. */ -#define IRONSIDE_CALL_ID_BOOTMODE_SERVICE_V1 5 - -enum { - IRONSIDE_BOOTMODE_SERVICE_MODE_IDX, - IRONSIDE_BOOTMODE_SERVICE_MSG_0_IDX, - IRONSIDE_BOOTMODE_SERVICE_MSG_1_IDX, - IRONSIDE_BOOTMODE_SERVICE_MSG_2_IDX, - IRONSIDE_BOOTMODE_SERVICE_MSG_3_IDX, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_BOOTMODE_SERVICE_NUM_ARGS, -}; - -/* Maximum size of the message parameter. */ -#define IRONSIDE_BOOTMODE_SERVICE_MSG_MAX_SIZE (4 * sizeof(uint32_t)) - -/* Index of the return code within the service buffer. */ -#define IRONSIDE_BOOTMODE_SERVICE_RETCODE_IDX (0) - -/** - * @brief Request a reboot into the secondary firmware boot mode. - * - * This invokes the IronSide SE boot mode service to restart the system into the secondary boot - * mode. In this mode, the secondary configuration defined in UICR is applied instead of the - * primary one. The system immediately reboots without a reply if the request succeeds. - * - * The given message data is passed to the boot report of the CPU booted in the secondary boot mode. - * - * @note This function does not return if the request is successful. - * @note The device will boot into the secondary firmware instead of primary firmware. - * @note The request does not fail if the secondary firmware is not defined. - * - * @param msg A message that can be placed in the cpu's boot report. - * @param msg_size Size of the message in bytes. - * - * @retval 0 on success. - * @retval -IRONSIDE_BOOTMODE_ERROR_UNSUPPORTED_MODE if the secondary boot mode is unsupported. - * @retval -IRONSIDE_BOOTMODE_ERROR_BUSY if the reboot was blocked. - * @retval -IRONSIDE_BOOTMODE_ERROR_MESSAGE_TOO_LARGE if msg_size is greater than - * IRONSIDE_BOOTMODE_SERVICE_MSG_MAX_SIZE. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_bootmode_secondary_reboot(const uint8_t *msg, size_t msg_size); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOTMODE_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/call.h b/soc/nordic/ironside/include/nrf_ironside/call.h deleted file mode 100644 index 9a2431c7d580..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/call.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ - -#include - -/** @brief Maximum number of arguments to an IronSide call. - * - * This is chosen so that the containing message buffer size is minimal but - * cache line aligned. - */ -#define NRF_IRONSIDE_CALL_NUM_ARGS 7 - -/** @brief Message buffer. */ -struct ironside_call_buf { - /** Status code. This is set by the API. */ - uint16_t status; - /** Operation identifier. This is set by the user. */ - uint16_t id; - /** Operation arguments. These are set by the user. */ - uint32_t args[NRF_IRONSIDE_CALL_NUM_ARGS]; -}; - -/** - * @name Message buffer status codes. - * @{ - */ - -/** Buffer is idle and available for allocation. */ -#define IRONSIDE_CALL_STATUS_IDLE 0 -/** Request was processed successfully by the server. */ -#define IRONSIDE_CALL_STATUS_RSP_SUCCESS 1 -/** Request status code is unknown. */ -#define IRONSIDE_CALL_STATUS_RSP_ERR_UNKNOWN_STATUS 2 -/** Request status code is no longer supported. */ -#define IRONSIDE_CALL_STATUS_RSP_ERR_EXPIRED_STATUS 3 -/** Operation identifier is unknown. */ -#define IRONSIDE_CALL_STATUS_RSP_ERR_UNKNOWN_ID 4 -/** Operation identifier is no longer supported. */ -#define IRONSIDE_CALL_STATUS_RSP_ERR_EXPIRED_ID 5 -/** Buffer contains a request from the client. */ -#define IRONSIDE_CALL_STATUS_REQ 6 - -/** - * @} - */ - -/** - * @brief Allocate memory for an IronSide call. - * - * This function will block when no buffers are available, until one is - * released by another thread on the client side. - * - * @return Pointer to the allocated buffer. - */ -struct ironside_call_buf *ironside_call_alloc(void); - -/** - * @brief Dispatch an IronSide call. - * - * This function will block until a response is received from the server. - * - * @param buf Buffer returned by ironside_call_alloc(). It should be populated - * with request data before calling this function. Upon returning, - * this data will have been replaced by response data. - */ -void ironside_call_dispatch(struct ironside_call_buf *buf); - -/** - * @brief Release an IronSide call buffer. - * - * This function must be called after processing the response. - * - * @param buf Buffer used to perform the call. - */ -void ironside_call_release(struct ironside_call_buf *buf); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/counter.h b/soc/nordic/ironside/include/nrf_ironside/counter.h deleted file mode 100644 index 37866c43a684..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/counter.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ - -#include -#include -#include - -/** - * @name Counter service error codes. - * @{ - */ - -/** Counter value is lower than current value (monotonic violation). */ -#define IRONSIDE_COUNTER_ERROR_TOO_LOW (1) -/** Invalid counter ID. */ -#define IRONSIDE_COUNTER_ERROR_INVALID_ID (2) -/** Counter is locked and cannot be modified. */ -#define IRONSIDE_COUNTER_ERROR_LOCKED (3) -/** Invalid parameter. */ -#define IRONSIDE_COUNTER_ERROR_INVALID_PARAM (4) -/** Storage operation failed. */ -#define IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE (5) - -/** - * @} - */ - -/** Maximum value for a counter */ -#define IRONSIDE_COUNTER_MAX_VALUE UINT32_MAX - -/** Number of counters */ -#define IRONSIDE_COUNTER_NUM 4 - -/** - * @brief Counter identifiers. - */ -enum ironside_counter { - IRONSIDE_COUNTER_0 = 0, - IRONSIDE_COUNTER_1, - IRONSIDE_COUNTER_2, - IRONSIDE_COUNTER_3 -}; - -/* IronSide call identifiers with implicit versions. */ -#define IRONSIDE_CALL_ID_COUNTER_SET_V1 6 -#define IRONSIDE_CALL_ID_COUNTER_GET_V1 7 -#define IRONSIDE_CALL_ID_COUNTER_LOCK_V1 8 - -enum { - IRONSIDE_COUNTER_SET_SERVICE_COUNTER_ID_IDX, - IRONSIDE_COUNTER_SET_SERVICE_VALUE_IDX, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_COUNTER_SET_NUM_ARGS -}; - -enum { - IRONSIDE_COUNTER_GET_SERVICE_COUNTER_ID_IDX, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_COUNTER_GET_NUM_ARGS -}; - -enum { - IRONSIDE_COUNTER_LOCK_SERVICE_COUNTER_ID_IDX, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_COUNTER_LOCK_NUM_ARGS -}; - -/* Index of the return code within the service buffer. */ -#define IRONSIDE_COUNTER_SET_SERVICE_RETCODE_IDX (0) -#define IRONSIDE_COUNTER_GET_SERVICE_RETCODE_IDX (0) -#define IRONSIDE_COUNTER_LOCK_SERVICE_RETCODE_IDX (0) - -/* Index of the value within the GET response buffer. */ -#define IRONSIDE_COUNTER_GET_SERVICE_VALUE_IDX (1) - -BUILD_ASSERT(IRONSIDE_COUNTER_SET_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); -BUILD_ASSERT(IRONSIDE_COUNTER_GET_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); -BUILD_ASSERT(IRONSIDE_COUNTER_LOCK_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); - -/** - * @brief Set a counter value. - * - * This sets the specified counter to the given value. The counter is monotonic, - * so the new value must be greater than or equal to the current value. - * If the counter is locked, the operation will fail. - * - * @note Counters are automatically initialized to 0 during the first boot in LCS ROT. - * The monotonic constraint applies to all subsequent writes. - * - * @param counter_id Counter identifier. - * @param value New counter value. - * - * @retval 0 on success. - * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. - * @retval -IRONSIDE_COUNTER_ERROR_TOO_LOW if value is lower than current value. - * @retval -IRONSIDE_COUNTER_ERROR_LOCKED if counter is locked. - * @retval -IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE if storage operation failed. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_counter_set(enum ironside_counter counter_id, uint32_t value); - -/** - * @brief Get a counter value. - * - * This retrieves the current value of the specified counter. - * - * @note Counters are automatically initialized to 0 during the first boot in LCS ROT, - * so this function will always succeed for valid counter IDs. - * - * @param counter_id Counter identifier. - * @param value Pointer to store the counter value. - * - * @retval 0 on success. - * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. - * @retval -IRONSIDE_COUNTER_ERROR_INVALID_PARAM if value is NULL. - * @retval -IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE if storage operation failed. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_counter_get(enum ironside_counter counter_id, uint32_t *value); - -/** - * @brief Lock a counter for the current boot. - * - * This locks the specified counter, preventing any further modifications until the next reboot. - * The lock state is not persistent and will be cleared on reboot. - * - * @note The intended use case is for a bootloader to lock a counter before transferring control - * to the next boot stage, preventing that image from modifying the counter value. - * - * @param counter_id Counter identifier. - * - * @retval 0 on success. - * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_counter_lock(enum ironside_counter counter_id); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h b/soc/nordic/ironside/include/nrf_ironside/cpuconf.h deleted file mode 100644 index a0fabd8abbd2..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ - -#include -#include -#include -#include -#include - -/** - * @name CPUCONF service error codes. - * @{ - */ - -/** An invalid or unsupported processor ID was specified. */ -#define IRONSIDE_CPUCONF_ERROR_WRONG_CPU (1) -/** The boot message is too large to fit in the buffer. */ -#define IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE (2) - -/** - * @} - */ - -#define IRONSIDE_CALL_ID_CPUCONF_V0 2 - -enum { - IRONSIDE_CPUCONF_SERVICE_CPU_PARAMS_IDX, - IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX, - IRONSIDE_CPUCONF_SERVICE_MSG_0, - IRONSIDE_CPUCONF_SERVICE_MSG_1, - IRONSIDE_CPUCONF_SERVICE_MSG_2, - IRONSIDE_CPUCONF_SERVICE_MSG_3, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_CPUCONF_NUM_ARGS -}; - -/* Maximum size of the CPUCONF message parameter. */ -#define IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE (4 * sizeof(uint32_t)) - -/* IDX 0 is re-used by the error return code and the 'cpu' parameter. */ -#define IRONSIDE_CPUCONF_SERVICE_RETCODE_IDX 0 - -BUILD_ASSERT(IRONSIDE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); - -/** - * @brief Boot a local domain CPU - * - * @param cpu The CPU to be booted - * @param vector_table Pointer to the vector table used to boot the CPU. - * @param cpu_wait When this is true, the CPU will WAIT even if the CPU has clock. - * @param msg A message that can be placed in cpu's boot report. - * @param msg_size Size of the message in bytes. - * - * @note cpu_wait is only intended to be enabled for debug purposes - * and it is only supported that a debugger resumes the CPU. - * - * @note the call always sends IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE message bytes. - * If the given msg_size is less than that, the remaining bytes are set to zero. - * - * @retval 0 on success or if the CPU has already booted. - * @retval -IRONSIDE_CPUCONF_ERROR_WRONG_CPU if cpu is unrecognized. - * @retval -IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE if msg_size is greater than - * IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_cpuconf(NRF_PROCESSORID_Type cpu, const void *vector_table, bool cpu_wait, - const uint8_t *msg, size_t msg_size); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/dvfs.h b/soc/nordic/ironside/include/nrf_ironside/dvfs.h deleted file mode 100644 index c47cc43a8598..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/dvfs.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ - -#include -#include -#include -#include - -enum ironside_dvfs_oppoint { - IRONSIDE_DVFS_OPP_HIGH = 0, - IRONSIDE_DVFS_OPP_MEDLOW = 1, - IRONSIDE_DVFS_OPP_LOW = 2 -}; - -/** - * @brief Number of DVFS oppoints supported by IronSide. - * - * This is the number of different DVFS oppoints that can be set on IronSide. - * The oppoints are defined in the `ironside_dvfs_oppoint` enum. - */ -#define IRONSIDE_DVFS_OPPOINT_COUNT (3) - -/** - * @name IronSide DVFS service error codes. - * @{ - */ - -/** The requested DVFS oppoint is not allowed. */ -#define IRONSIDE_DVFS_ERROR_WRONG_OPPOINT (1) -/** Waiting for mutex lock timed out, or hardware is busy. */ -#define IRONSIDE_DVFS_ERROR_BUSY (2) -/** There is configuration error in the DVFS service. */ -#define IRONSIDE_DVFS_ERROR_OPPOINT_DATA (3) -/** The caller does not have permission to change the DVFS oppoint. */ -#define IRONSIDE_DVFS_ERROR_PERMISSION (4) -/** The requested DVFS oppoint is already set, no change needed. */ -#define IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED (5) -/** The operation timed out, possibly due to a hardware issue. */ -#define IRONSIDE_DVFS_ERROR_TIMEOUT (6) -/** The DVFS oppoint change operation is not allowed in the ISR context. */ -#define IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED (7) - -/** - * @} - */ - -/* IronSide call identifiers with implicit versions. - * - * With the initial "version 0", the service ABI is allowed to break until the - * first production release of IronSide SE. - */ -#define IRONSIDE_CALL_ID_DVFS_SERVICE_V0 3 - -/* Index of the DVFS oppoint within the service buffer. */ -#define IRONSIDE_DVFS_SERVICE_OPPOINT_IDX (0) -/* Index of the return code within the service buffer. */ -#define IRONSIDE_DVFS_SERVICE_RETCODE_IDX (0) - -/** - * @brief Change the current DVFS oppoint. - * - * This function will request a change of the current DVFS oppoint to the - * specified value. It will block until the change is applied. - * - * @param dvfs_oppoint The new DVFS oppoint to set. - * - * @retval 0 on success. - * @retval -IRONSIDE_DVFS_ERROR_WRONG_OPPOINT if the requested DVFS oppoint is not allowed. - * @retval -IRONSIDE_DVFS_ERROR_BUSY if waiting for mutex lock timed out, or hardware is busy. - * @retval -IRONSIDE_DVFS_ERROR_OPPOINT_DATA if there is configuration error in the DVFS service. - * @retval -IRONSIDE_DVFS_ERROR_PERMISSION if the caller does not have permission to change the DVFS - * oppoint. - * @retval -IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED if the requested DVFS oppoint is already set. - * @retval -IRONSIDE_DVFS_ERROR_TIMEOUT if the operation timed out, possibly due to a hardware - * issue. - * @retval -IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED if the DVFS oppoint change operation is not allowed - * in the ISR context. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint); - -/** - * @brief Check if the given oppoint is valid. - * - * @param dvfs_oppoint The oppoint to check. - * @return true if the oppoint is valid, false otherwise. - */ -static inline bool ironside_dvfs_is_oppoint_valid(enum ironside_dvfs_oppoint dvfs_oppoint) -{ - if (dvfs_oppoint != IRONSIDE_DVFS_OPP_HIGH && dvfs_oppoint != IRONSIDE_DVFS_OPP_MEDLOW && - dvfs_oppoint != IRONSIDE_DVFS_OPP_LOW) { - return false; - } - - return true; -} - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/tdd.h b/soc/nordic/ironside/include/nrf_ironside/tdd.h deleted file mode 100644 index adfb1c53a648..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/tdd.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ - -#include - -#include - -#define IRONSIDE_SE_TDD_SERVICE_ERROR_INVALID_CONFIG (1) - -#define IRONSIDE_SE_CALL_ID_TDD_V0 4 - -#define IRONSIDE_SE_TDD_SERVICE_REQ_CONFIG_IDX 0 -#define IRONSIDE_SE_TDD_SERVICE_RSP_RETCODE_IDX 0 - -enum ironside_se_tdd_config { - RESERVED0 = 0, /* Reserved */ - /** Turn off the TDD */ - IRONSIDE_SE_TDD_CONFIG_OFF = 1, - /** Turn on the TDD with default configuration */ - IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT = 2, -}; - -/** - * @brief Control the Trace and Debug Domain (TDD). - * - * @param config The configuration to be applied. - * - * @retval 0 on success. - * @retval -IRONSIDE_SE_TDD_SERVICE_ERROR_INVALID_CONFIG if the configuration is invalid. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_se_tdd_configure(const enum ironside_se_tdd_config config); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/update.h b/soc/nordic/ironside/include/nrf_ironside/update.h deleted file mode 100644 index 6e520e4e680b..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/update.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ - -#include -#include - -/** - * @name Update service error codes. - * @{ - */ - -/** Caller does not have access to the provided update candidate buffer. */ -#define IRONSIDE_UPDATE_ERROR_NOT_PERMITTED (1) -/** Failed to write the update metadata to SICR. */ -#define IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED (2) -/** Update candidate is placed outside of valid range */ -#define IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS (3) - -/** - * @} - */ - -/** Size of the update blob */ -#ifdef CONFIG_SOC_SERIES_NRF54HX -#define IRONSIDE_UPDATE_BLOB_SIZE (160 * 1024) -#elif CONFIG_SOC_SERIES_NRF92X -#define IRONSIDE_UPDATE_BLOB_SIZE (160 * 1024) -#else -#error "Missing update blob size" -#endif - -/** Min address used for storing the update candidate */ -#define IRONSIDE_UPDATE_MIN_ADDRESS (0x0e100000) -/** Max address used for storing the update candidate */ -#define IRONSIDE_UPDATE_MAX_ADDRESS (0x0e200000 - IRONSIDE_UPDATE_BLOB_SIZE) - -/** Length of the update manifest in bytes */ -#define IRONSIDE_UPDATE_MANIFEST_LENGTH (256) -/** Length of the update public key in bytes. */ -#define IRONSIDE_UPDATE_PUBKEY_LENGTH (32) -/** Length of the update signature in bytes. */ -#define IRONSIDE_UPDATE_SIGNATURE_LENGTH (64) - -/* IronSide call identifiers with implicit versions. - * - * With the initial "version 0", the service ABI is allowed to break until the - * first production release of IronSide SE. - */ -#define IRONSIDE_CALL_ID_UPDATE_SERVICE_V0 1 - -/* Index of the update blob pointer within the service buffer. */ -#define IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX (0) -/* Index of the return code within the service buffer. */ -#define IRONSIDE_UPDATE_SERVICE_RETCODE_IDX (0) - -/** - * @brief IronSide update blob. - */ -struct ironside_update_blob { - uint8_t manifest[IRONSIDE_UPDATE_MANIFEST_LENGTH]; - uint8_t pubkey[IRONSIDE_UPDATE_PUBKEY_LENGTH]; - uint8_t signature[IRONSIDE_UPDATE_SIGNATURE_LENGTH]; - uint32_t firmware[]; -}; - -/** - * @brief Request a firmware upgrade of the IronSide SE. - * - * This invokes the IronSide SE update service. The device must be restarted for the update - * to be installed. Check the update status in the application boot report to see if the update - * was successfully installed. - * - * @param update Pointer to update blob - * - * @retval 0 on a successful request (although the update itself may still fail). - * @retval -IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS if the address of the update is outside of the - * accepted range. - * @retval -IRONSIDE_UPDATE_ERROR_NOT_PERMITTED if missing access to the update candidate. - * @retval -IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED if writing update parameters to SICR failed. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - * - */ -int ironside_update(const struct ironside_update_blob *update); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ */ diff --git a/soc/nordic/ironside/tdd.c b/soc/nordic/ironside/tdd.c deleted file mode 100644 index eee5691cf362..000000000000 --- a/soc/nordic/ironside/tdd.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -int ironside_se_tdd_configure(const enum ironside_se_tdd_config config) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_SE_CALL_ID_TDD_V0; - buf->args[IRONSIDE_SE_TDD_SERVICE_REQ_CONFIG_IDX] = (uint32_t)config; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_SE_TDD_SERVICE_RSP_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/soc/nordic/ironside/update.c b/soc/nordic/ironside/update.c deleted file mode 100644 index fabf6fb01049..000000000000 --- a/soc/nordic/ironside/update.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -int ironside_update(const struct ironside_update_blob *update) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - if ((uintptr_t)update < IRONSIDE_UPDATE_MIN_ADDRESS || - (uintptr_t)update > IRONSIDE_UPDATE_MAX_ADDRESS) { - return -IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS; - } - - buf->id = IRONSIDE_CALL_ID_UPDATE_SERVICE_V0; - buf->args[IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX] = (uintptr_t)update; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_UPDATE_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index f07a620ccdb3..a321138f1b02 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -4,6 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF54HX + select HAS_IRONSIDE_SE select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS @@ -71,7 +72,7 @@ config SOC_NRF54H20_CPURAD_ENABLE bool "Boot the nRF54H20 Radio core" default y if NRF_802154_SER_HOST || BT_HCI_HOST depends on SOC_NRF54H20_CPUAPP - select NRF_IRONSIDE_CPUCONF_SERVICE + select IRONSIDE_SE_CALL select SOC_LATE_INIT_HOOK help This will at application boot time enable clock to the diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index 86149e5bd0e0..1260067a2fc5 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -17,4 +17,7 @@ config POWER_DOMAIN config CODE_DATA_RELOCATION default y if (PM || POWEROFF) && !MCUBOOT +config NRF_PERIPHCONF_SECTION + default y + endif # SOC_NRF54H20_CPUAPP diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad index 31687c2a5443..8e0fca298817 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad @@ -17,4 +17,7 @@ config POWER_DOMAIN config CODE_DATA_RELOCATION default y if PM || POWEROFF +config NRF_PERIPHCONF_SECTION + default y + endif # SOC_NRF54H20_CPURAD diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 591b0d480acf..fe664dce6c0d 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -25,7 +25,7 @@ #include #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) -#include +#include #endif LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -237,8 +237,8 @@ void soc_late_init_hook(void) bool cpu_wait = IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT); - err_cpuconf = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, - msg_size); + err_cpuconf = ironside_se_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, + msg_size); __ASSERT(err_cpuconf == 0, "err_cpuconf was %d", err_cpuconf); #endif /* CONFIG_SOC_NRF54H20_CPURAD_ENABLE */ } diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index 739aada2b26e..1c5b1af8deb3 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -4,6 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF92X + select HAS_IRONSIDE_SE select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp index 22ba6612ecfb..4e4bacfb5289 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp @@ -8,4 +8,7 @@ if SOC_NRF9280_CPUAPP config NUM_IRQS default 471 +config NRF_PERIPHCONF_SECTION + default y + endif # SOC_NRF9280_CPUAPP diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad index 534658997fbe..e708e1208cac 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad @@ -8,4 +8,7 @@ if SOC_NRF9280_CPURAD config NUM_IRQS default 471 +config NRF_PERIPHCONF_SECTION + default y + endif # SOC_NRF9280_CPURAD From 6f67db7818c1df927e6d10def4c7c0fb3af26926 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Wed, 3 Sep 2025 15:38:47 +0100 Subject: [PATCH 0692/3334] [nrf fromtree] github: hello_world_multiplatform: run on Ubuntu ARM Add ubuntu-24.04-arm to the list of runners, while this runner is still flagged as being in beta, it's been around for more than one year and has been running for quite a long time in the action-zephyr-setup repository with no problems. Adding it to the list so we get some coverage of the Linux/ARM toolchain and setup, easy enough to get rid of it if it causes problems. Link: https://github.com/actions/partner-runner-images/ Link: https://github.blog/changelog/2024-06-24-github-actions-ubuntu-24-04-image-now-available-for-arm64-runners/ Signed-off-by: Fabio Baltieri (cherry picked from commit 3a78b8ad0129c1310acd5eb32b623ed9de20f2a2) --- .github/workflows/hello_world_multiplatform.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index 0396f37e5816..f2896d97bab5 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -28,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, windows-2022] + os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-13, macos-14, windows-2022] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -72,6 +72,8 @@ jobs: EXTRA_TWISTER_FLAGS="-P native_sim --build-only" elif [ "${{ runner.os }}" = "Windows" ]; then EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out" + elif [ "${{ runner.os }}-${{ runner.arch }}" == "Linux-ARM64" ]; then + EXTRA_TWISTER_FLAGS="--exclude-platform native_sim/native" fi ./scripts/twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS From 5ba8d0f333a333d4207647e49924eaba7359fc48 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Fri, 5 Sep 2025 09:50:09 +0200 Subject: [PATCH 0693/3334] [nrf fromtree] ci: workflows: hello_world: multiplatform: invoke twister via west Invoke twister via west instead of invoking it directly. This tests the twister integration in west across host platforms. Signed-off-by: Henrik Brix Andersen (cherry picked from commit 52efda972b7061cbafaa6eb32de06962e78d4d70) --- .github/workflows/hello_world_multiplatform.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index f2896d97bab5..bdecdbc535ed 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -75,7 +75,7 @@ jobs: elif [ "${{ runner.os }}-${{ runner.arch }}" == "Linux-ARM64" ]; then EXTRA_TWISTER_FLAGS="--exclude-platform native_sim/native" fi - ./scripts/twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS + west twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS - name: Upload artifacts if: failure() From 4d33fc1463c71537e3e983e0fcd1a6b362bc87a1 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Mon, 22 Sep 2025 21:14:46 +0100 Subject: [PATCH 0694/3334] [nrf fromtree] github: hello_world_multiplatform: retire macos-13 This runner is going to go away soon, drop it. Link: https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/ Suggested-by: Thomas Stranger Signed-off-by: Fabio Baltieri (cherry picked from commit ae0e5b1fb5d59d9327089b11158d6494068f2600) --- .github/workflows/hello_world_multiplatform.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index bdecdbc535ed..d71b1166bb61 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -28,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-13, macos-14, windows-2022] + os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-2022] runs-on: ${{ matrix.os }} steps: - name: Checkout From dd66b34752b0e6015d1ecfdc2ebdd718707bb7eb Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Mon, 15 Dec 2025 15:50:55 +0100 Subject: [PATCH 0695/3334] [nrf fromtree] tests: drivers: uart: Extend UART120 testing for nrf54h20 cpuflpr Run UART tests on 54h20 cpuflpr with uart120 Signed-off-by: Bartosz Miller (cherry picked from commit a2661d380a397125f6810e9155d6fecf7de02aaf) --- .../nrf54h20dk_nrf54h20_cpuflpr.overlay | 71 +++++++++++++++++++ .../uart/uart_elementary/testcase.yaml | 1 + 2 files changed, 72 insertions(+) create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuflpr.overlay diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuflpr.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuflpr.overlay new file mode 100644 index 000000000000..ccb2f3342549 --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuflpr.overlay @@ -0,0 +1,71 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/ { + chosen { + zephyr,console = &uart131; + }; +}; + +&pinctrl { + uart120_default_alt: uart120_default_alt { + group1 { + psels = , + ; + }; + }; + + uart120_sleep_alt: uart120_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + uart131_default_alt: uart131_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + uart131_sleep_alt: uart131_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&cpuapp_dma_region { + status = "okay"; +}; + +&dma_fast_region { + status = "okay"; +}; + +&uart131 { + status = "okay"; + memory-regions = <&cpuapp_dma_region>; + pinctrl-0 = <&uart131_default_alt>; + pinctrl-1 = <&uart131_sleep_alt>; + pinctrl-names = "default", "sleep"; + current-speed = <115200>; + hw-flow-control; +}; + +dut: &uart120 { + status = "okay"; + memory-regions = <&dma_fast_region>; + pinctrl-0 = <&uart120_default_alt>; + pinctrl-1 = <&uart120_sleep_alt>; + pinctrl-names = "default", "sleep"; + current-speed = <115200>; + /delete-property/ hw-flow-control; +}; diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index b680e0f96428..e11a220bae39 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -11,6 +11,7 @@ tests: filter: CONFIG_SERIAL_SUPPORT_INTERRUPT platform_allow: - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpuflpr - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp From 4f157341585e9e4f054436f8615903ae8cba9d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 15 Dec 2025 13:38:42 +0100 Subject: [PATCH 0696/3334] [nrf fromtree] tests: boards: nrf: i2s: Remove test that checks I2S clock divider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove test from tests/boards/nrf/i2s/i2s_divider. The i2s_divider test was relying on debug log from I2S driver. With the recent NRFX updates log was removed. Better test, that counts rising edges on I2S_LRCLK line was added in downstream (https://github.com/nrfconnect/sdk-nrf/pull/26230). Signed-off-by: Sebastian Głąb (cherry picked from commit a5ca188d84a60478a6b8d769f3058a6083852a3b) --- .../boards/nrf/i2s/i2s_divider/CMakeLists.txt | 9 - .../boards/nrf52840dk_nrf52840.overlay | 28 --- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 32 ---- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 28 --- tests/boards/nrf/i2s/i2s_divider/prj.conf | 3 - tests/boards/nrf/i2s/i2s_divider/src/main.c | 167 ------------------ .../boards/nrf/i2s/i2s_divider/testcase.yaml | 32 ---- 7 files changed, 299 deletions(-) delete mode 100644 tests/boards/nrf/i2s/i2s_divider/CMakeLists.txt delete mode 100644 tests/boards/nrf/i2s/i2s_divider/boards/nrf52840dk_nrf52840.overlay delete mode 100644 tests/boards/nrf/i2s/i2s_divider/boards/nrf5340dk_nrf5340_cpuapp.overlay delete mode 100644 tests/boards/nrf/i2s/i2s_divider/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 tests/boards/nrf/i2s/i2s_divider/prj.conf delete mode 100644 tests/boards/nrf/i2s/i2s_divider/src/main.c delete mode 100644 tests/boards/nrf/i2s/i2s_divider/testcase.yaml diff --git a/tests/boards/nrf/i2s/i2s_divider/CMakeLists.txt b/tests/boards/nrf/i2s/i2s_divider/CMakeLists.txt deleted file mode 100644 index 35157bf3d443..000000000000 --- a/tests/boards/nrf/i2s/i2s_divider/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(i2s_divider) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/boards/nrf/i2s/i2s_divider/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/i2s/i2s_divider/boards/nrf52840dk_nrf52840.overlay deleted file mode 100644 index ca21135bca4f..000000000000 --- a/tests/boards/nrf/i2s/i2s_divider/boards/nrf52840dk_nrf52840.overlay +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - i2s-node0 = &i2s0; - }; -}; - -&pinctrl { - i2s0_default_alt: i2s0_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&i2s0 { - status = "okay"; - pinctrl-0 = <&i2s0_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/boards/nrf/i2s/i2s_divider/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/i2s/i2s_divider/boards/nrf5340dk_nrf5340_cpuapp.overlay deleted file mode 100644 index a4c595b1bcdb..000000000000 --- a/tests/boards/nrf/i2s/i2s_divider/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - i2s-node0 = &i2s0; - }; -}; - -&pinctrl { - i2s0_default_alt: i2s0_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&uart1 { - status = "disabled"; -}; - -&i2s0 { - status = "okay"; - pinctrl-0 = <&i2s0_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/boards/nrf/i2s/i2s_divider/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/i2s/i2s_divider/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 08de6a76c7c5..000000000000 --- a/tests/boards/nrf/i2s/i2s_divider/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - i2s-node0 = &i2s20; - }; -}; - -&pinctrl { - i2s20_default_alt: i2s20_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&i2s20 { - status = "okay"; - pinctrl-0 = <&i2s20_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/boards/nrf/i2s/i2s_divider/prj.conf b/tests/boards/nrf/i2s/i2s_divider/prj.conf deleted file mode 100644 index 38455942679e..000000000000 --- a/tests/boards/nrf/i2s/i2s_divider/prj.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_ZTEST=y -CONFIG_I2S=y -CONFIG_I2S_LOG_LEVEL_INF=y diff --git a/tests/boards/nrf/i2s/i2s_divider/src/main.c b/tests/boards/nrf/i2s/i2s_divider/src/main.c deleted file mode 100644 index bc4176d3284b..000000000000 --- a/tests/boards/nrf/i2s/i2s_divider/src/main.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -#define I2S_DEV_NODE DT_ALIAS(i2s_node0) - -#define WORD_SIZE 16U -#define NUMBER_OF_CHANNELS 2 -#define FRAME_CLK_FREQ 44100 - -#define NUM_BLOCKS 2 -#define TIMEOUT 1000 - -#define SAMPLES_COUNT 4 -/* Each word has one bit set */ -static const int16_t data[SAMPLES_COUNT] = {16, 32, 64, 128}; - -#define BLOCK_SIZE (2 * sizeof(data)) - -#ifdef CONFIG_NOCACHE_MEMORY - #define MEM_SLAB_CACHE_ATTR __nocache -#else - #define MEM_SLAB_CACHE_ATTR -#endif /* CONFIG_NOCACHE_MEMORY */ - -static char MEM_SLAB_CACHE_ATTR __aligned(WB_UP(32)) - _k_mem_slab_buf_tx_0_mem_slab[NUM_BLOCKS * WB_UP(BLOCK_SIZE)]; -STRUCT_SECTION_ITERABLE(k_mem_slab, tx_0_mem_slab) = - Z_MEM_SLAB_INITIALIZER(tx_0_mem_slab, _k_mem_slab_buf_tx_0_mem_slab, - WB_UP(BLOCK_SIZE), NUM_BLOCKS); - -static const struct device *dev_i2s; - -static const struct i2s_config default_i2s_cfg = { - .word_size = WORD_SIZE, - .channels = NUMBER_OF_CHANNELS, - .format = I2S_FMT_DATA_FORMAT_I2S, - .frame_clk_freq = FRAME_CLK_FREQ, - .block_size = BLOCK_SIZE, - .timeout = TIMEOUT, - .options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER, - .mem_slab = &tx_0_mem_slab, -}; - -/** @brief Check actual PCM rate at frame_clk_freq=8000. - * - * - Configure I2S stream. - */ -ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_08000) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - int ret; - - i2s_cfg.frame_clk_freq = 8000; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_ok(ret, "i2s_configure() returned %d", ret); -} - -/** @brief Check actual PCM rate at frame_clk_freq=16000. - * - * - Configure I2S stream. - */ -ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_16000) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - int ret; - - i2s_cfg.frame_clk_freq = 16000; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_ok(ret, "i2s_configure() returned %d", ret); -} - -/** @brief Check actual PCM rate at frame_clk_freq=32000. - * - * - Configure I2S stream. - */ -ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_32000) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - int ret; - - i2s_cfg.frame_clk_freq = 32000; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_ok(ret, "i2s_configure() returned %d", ret); -} - -/** @brief Check actual PCM rate at frame_clk_freq=44100. - * - * - Configure I2S stream. - */ -ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_44100) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - int ret; - - i2s_cfg.frame_clk_freq = 44100; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_ok(ret, "i2s_configure() returned %d", ret); -} - -/** @brief Check actual PCM rate at frame_clk_freq=48000. - * - * - Configure I2S stream. - */ -ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_48000) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - int ret; - - i2s_cfg.frame_clk_freq = 48000; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_ok(ret, "i2s_configure() returned %d", ret); -} - -/** @brief Check actual PCM rate at frame_clk_freq=88200. - * - * - Configure I2S stream. - */ -ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_88200) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - int ret; - - i2s_cfg.frame_clk_freq = 88200; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_ok(ret, "i2s_configure() returned %d", ret); -} - -/** @brief Check actual PCM rate at frame_clk_freq=96000. - * - * - Configure I2S stream. - */ -ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_96000) -{ - struct i2s_config i2s_cfg = default_i2s_cfg; - int ret; - - i2s_cfg.frame_clk_freq = 96000; - - ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); - zassert_ok(ret, "i2s_configure() returned %d", ret); -} - -static void *suite_setup(void) -{ - /* Check I2S Device. */ - dev_i2s = DEVICE_DT_GET_OR_NULL(I2S_DEV_NODE); - zassert_not_null(dev_i2s, "I2S device not found"); - zassert(device_is_ready(dev_i2s), "I2S device not ready"); - - return 0; -} - -ZTEST_SUITE(drivers_i2s_clk_div, NULL, suite_setup, NULL, NULL, NULL); diff --git a/tests/boards/nrf/i2s/i2s_divider/testcase.yaml b/tests/boards/nrf/i2s/i2s_divider/testcase.yaml deleted file mode 100644 index 55d6912d7b54..000000000000 --- a/tests/boards/nrf/i2s/i2s_divider/testcase.yaml +++ /dev/null @@ -1,32 +0,0 @@ -tests: - boards.nrf.i2s.i2s_divider: - tags: - - drivers - - i2s - harness: console - harness_config: - type: multi_line - ordered: true - regex: - - "test_i2s_frame_clk_freq_08000" - - "I2S MCK frequency: 256000, actual PCM rate: 8000" - - "test_i2s_frame_clk_freq_16000" - - "I2S MCK frequency: 507936, actual PCM rate: 15873" - - "test_i2s_frame_clk_freq_32000" - - "I2S MCK frequency: 1032258, actual PCM rate: 32258" - - "test_i2s_frame_clk_freq_44100" - - "I2S MCK frequency: 1391304, actual PCM rate: 43478" - - "test_i2s_frame_clk_freq_48000" - - "I2S MCK frequency: 1523809, actual PCM rate: 47619" - - "test_i2s_frame_clk_freq_88200" - - "I2S MCK frequency: 2909090, actual PCM rate: 90909" - - "test_i2s_frame_clk_freq_96000" - - "I2S MCK frequency: 3200000, actual PCM rate: 100000" - - "PROJECT EXECUTION SUCCESSFUL" - platform_allow: - - nrf52840dk/nrf52840 - - nrf5340dk/nrf5340/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - integration_platforms: - - nrf52840dk/nrf52840 - - nrf54l15dk/nrf54l15/cpuapp From 7cf858621a7780dc5ca8b9fa07592a98ca8d9514 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 14:30:18 +0100 Subject: [PATCH 0697/3334] [nrf noup] test-spec: update CI-test-low-level nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular folder selection. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 92 ++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 28 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5fdf9c0ca782..14519ac3a149 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -367,35 +367,71 @@ - "drivers/sensor/sensor_shell.c" "CI-test-low-level": - - "arch/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf53*" + - "!soc/nordic/nrf9*" + - "arch/arm/**/*" + - "arch/riscv/**/*" - "boards/nordic/nrf54*/**/*" - - "drivers/**/*" - - "dts/**/*" - - "include/zephyr/**/*" - - "kernel/**/*" + - "drivers/adc/**/*" + - "drivers/cache/**/*" + - "drivers/clock_control/**/*" + - "drivers/comparator/**/*" + - "drivers/counter/**/*" + - "drivers/flash/**/*" + - "drivers/gpio/**/*" + - "drivers/hwinfo/**/*" + - "drivers/i2c/**/*" + - "drivers/i2s/**/*" + - "drivers/interrupt_controller/**/*" + - "drivers/mbox/**/*" + - "drivers/mspi/**/*" + - "drivers/pinctrl/**/*" + - "drivers/power_domain/**/*" + - "drivers/pwm/**/*" + - "drivers/retained_mem/**/*" + - "drivers/rtc/**/*" + - "drivers/serial/**/*" + - "drivers/spi/**/*" + - "drivers/timer/**/*" + - "drivers/usb/**/*" + - "drivers/watchdog/**/*" + - any: + - "dts/vendor/nordic/**/*" + - "!dts/vendor/nordic/nrf52*" + - "!dts/vendor/nordic/nrf53*" + - "!dts/vendor/nordic/nrf9*" - "modules/hal_nordic/**/*" - - "samples/basic/blinky_pwm/**/*" - - "samples/basic/fade_led/**/*" - - "samples/boards/nrf/**/*" - "samples/boards/nordic/**/*" - - "samples/drivers/adc/**/*" - - "samples/drivers/jesd216/**/*" - - "samples/drivers/mbox/**/*" - - "samples/drivers/soc_flash_nrf/**/*" - - "samples/drivers/spi_flash/**/*" - - "samples/drivers/watchdog/**/*" - - "samples/hello_world/**/*" - - "samples/sensor/**/*" - - "samples/subsys/ipc/**/*" - - "samples/subsys/logging/**/*" - - "samples/subsys/settings/**/*" - - "samples/subsys/usb/cdc_acm/**/*" - - "samples/subsys/usb/mass/**/*" - - "samples/synchronization/**/*" - - "subsys/logging/**/*" - - "subsys/settings/**/*" - - "tests/arch/**/*" + - "tests/arch/arm/**/*" - "tests/boards/nrf/**/*" - - "tests/boards/nordic/**/*" - - "tests/drivers/**/*" - - "tests/kernel/**/*" + - "tests/drivers/adc/**/*" + - "tests/drivers/clock_control/**/*" + - "tests/drivers/comparator/**/*" + - "tests/drivers/counter/**/*" + - "tests/drivers/flash/**/*" + - "tests/drivers/gpio/**/*" + - "tests/drivers/hwinfo/**/*" + - "tests/drivers/i2c/**/*" + - "tests/drivers/i2s/**/*" + - "tests/drivers/interrupt_controller/**/*" + - "tests/drivers/mbox/**/*" + - "tests/drivers/mspi/**/*" + - "tests/drivers/pinctrl/**/*" + - "tests/drivers/pwm/**/*" + - "tests/drivers/retained_mem/**/*" + - "tests/drivers/rtc/**/*" + - "tests/drivers/spi/**/*" + - "tests/drivers/timer/**/*" + - "tests/drivers/uart/**/*" + - "tests/drivers/watchdog/**/*" + - "tests/kernel/common/**/*" + - "tests/kernel/context/**/*" + - "tests/kernel/fatal/**/*" + - "tests/kernel/fpu_sharing/**/*" + - "tests/kernel/gen_isr_table/**/*" + - "tests/kernel/interrupt/**/*" + - "tests/kernel/sched/preempt/**/*" From 9e650a033fec9dc8dbcf7244854d3d758bcf0f51 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 14:38:41 +0100 Subject: [PATCH 0698/3334] [nrf noup] test-spec: update CI-audio-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml CI-audio-test more specific at soc/nordic. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 14519ac3a149..483f135b03e2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -345,7 +345,12 @@ - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - "samples/bluetooth/hci_ipc/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf54*" + - "!soc/nordic/nrf9*" - "subsys/bluetooth/audio/**/*" - "subsys/bluetooth/host/**/*" - "subsys/dfu/**/*" From 4f11c2e93c3de15b754da84000727d862afd1b64 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:12:06 +0100 Subject: [PATCH 0699/3334] [nrf noup] test-spec: update CI-find-my-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular for soc and boards. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 483f135b03e2..db9cac90e17f 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -271,13 +271,19 @@ - "!subsys/bluetooth/audio/**/*" "CI-find-my-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf52840dk/**/*" + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf54l15dk/**/*" - "drivers/bluetooth/**/*" - "drivers/entropy/**/*" - "drivers/flash/**/*" - "drivers/usb/**/*" - "drivers/regulator/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/dfu/**/*" - "subsys/fs/**/*" - "subsys/ipc/**/*" From fbabee3e816953726b564c358029bd49b01dd47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bainczyk?= Date: Wed, 3 Dec 2025 12:45:42 +0100 Subject: [PATCH 0700/3334] [nrf fromlist] manifest: update hal_nordic to have fixes for examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update hal_nordic to have examples with SPIM+SPIS and TWIM+TWIS examples fixed. Upstream PR #: 100453 Signed-off-by: Michał Bainczyk --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index b9a1a35b79e9..ad7e9a53ca14 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 09f24fd6cc7df57a5b5d08102ceb4a38381e2c82 + revision: 248eadcacf976bbd27f1c0bc0dd3f11d8ec8657e path: modules/hal/nordic groups: - hal From b7daf22c5d53bbb19943cecc4a9ea742c635682c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ga=C5=82da?= Date: Wed, 3 Dec 2025 12:57:48 +0100 Subject: [PATCH 0701/3334] [nrf noup] ci: Dynamically set target branch for manifest PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrf-squash! [nrf noup] ci: add default permissions nrf-squash! [nrf noup] ci: add reopen for manifest-pr action nrf-squash! [nrf noup] ci: Enable action-manifest-pr Dynamically set target branch for manifest PRs Signed-off-by: Jan Gałda --- .github/workflows/manifest-PR.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 0f3bd738a36c..6e2430ec901e 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -4,6 +4,7 @@ on: types: [opened, synchronize, closed, reopened] branches: - main + - ncs-v*-branch permissions: contents: read @@ -11,9 +12,28 @@ permissions: jobs: call-manifest-pr-action: runs-on: ubuntu-latest + outputs: + base-branch: ${{ steps.set-base-branch.outputs.base_branch }} steps: + # Determine the base branch: + # * sdk-zephyr/main -> sdk-nrf/main + # * sdk-zephyr/ncs-vX.Y-branch -> sdk-nrf/vX.Y-branch + - name: Set base branch + id: set-base-branch + run: | + if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then + echo "base_branch=main" >> "$GITHUB_OUTPUT" + elif [[ "${{ github.event.pull_request.base.ref }}" =~ ^ncs-(v[0-9]+\.[0-9]+-branch)$ ]]; then + branch_name="${{ github.event.pull_request.base.ref }}" + branch_name="${branch_name#ncs-}" + echo "base_branch=${branch_name}" >> "$GITHUB_OUTPUT" + else + echo "Error: Unsupported base branch: ${{ github.event.pull_request.base.ref }}" >&2 + exit 1 + fi - name: handle manifest PR uses: nrfconnect/action-manifest-pr@main with: token: ${{ secrets.NCS_GITHUB_TOKEN }} manifest-pr-title-details: ${{ github.event.pull_request.title }} + base-branch: ${{ steps.set-base-branch.outputs.base_branch }} From f725df43b7e624b229696b669a9762317e3479bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ga=C5=82da?= Date: Fri, 5 Dec 2025 16:04:23 +0100 Subject: [PATCH 0702/3334] [nrf noup] ci: Use NordicBuilder to open backport PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport PRs opened by github-actions[bot] do not trigger action which opens sdk-nrf PR with manifest update Signed-off-by: Jan Gałda --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 3ecf66b17da9..402341a9c389 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -33,6 +33,6 @@ jobs: - name: Backport uses: zephyrproject-rtos/action-backport@7e74f601d11eaca577742445e87775b5651a965f # v2.0.3-3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.NCS_GITHUB_TOKEN }} issue_labels: Backport labels_template: '["Backport"]' From d5ab3bfc2889a22f206e2d5c6fd77c67fa1c869c Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 8 Nov 2025 21:49:42 +0530 Subject: [PATCH 0703/3334] [nrf fromtree] boards: shields: nrf7002eb: Add 54H coex shield This shield is a standalone coex shield without relying on the base Wi-Fi shield (edge_connector). Signed-off-by: Chaitanya Tata (cherry picked from commit d7a22685ec49ce8c295cecbecadf179d096faa31) --- boards/shields/nrf7002eb/Kconfig.shield | 3 +++ boards/shields/nrf7002eb/doc/index.rst | 1 + .../nrf7002eb/nrf7002eb_coex_sa.overlay | 24 +++++++++++++++++++ boards/shields/nrf7002eb/shield.yml | 6 +++++ 4 files changed, 34 insertions(+) create mode 100644 boards/shields/nrf7002eb/nrf7002eb_coex_sa.overlay diff --git a/boards/shields/nrf7002eb/Kconfig.shield b/boards/shields/nrf7002eb/Kconfig.shield index e369cfe3de42..03c85ebdb2a5 100644 --- a/boards/shields/nrf7002eb/Kconfig.shield +++ b/boards/shields/nrf7002eb/Kconfig.shield @@ -6,3 +6,6 @@ config SHIELD_NRF7002EB config SHIELD_NRF7002EB_COEX def_bool $(shields_list_contains,nrf7002eb_coex) + +config SHIELD_NRF7002EB_COEX_SA + def_bool $(shields_list_contains,nrf7002eb_coex_sa) diff --git a/boards/shields/nrf7002eb/doc/index.rst b/boards/shields/nrf7002eb/doc/index.rst index 637f91ae21b4..7b7ce2108a91 100644 --- a/boards/shields/nrf7002eb/doc/index.rst +++ b/boards/shields/nrf7002eb/doc/index.rst @@ -51,6 +51,7 @@ edge-connector on some boards, like earlier revisions of the Thingy53 than v1.0. - ``nrf7002eb``: The default variant. - ``nrf7002eb_coex``: Variant which includes the COEX pins. +- ``nrf7002eb_coex_sa``: Variant which includes the COEX pins and is standalone. SR Co-existence *************** diff --git a/boards/shields/nrf7002eb/nrf7002eb_coex_sa.overlay b/boards/shields/nrf7002eb/nrf7002eb_coex_sa.overlay new file mode 100644 index 000000000000..e65c2f776a31 --- /dev/null +++ b/boards/shields/nrf7002eb/nrf7002eb_coex_sa.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + nrf_radio_coex: coex { + compatible = "nordic,nrf7002-coex"; + status = "okay"; + + status0-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + req-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + grant-gpios = <&gpio1 3 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpiote130 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb/shield.yml b/boards/shields/nrf7002eb/shield.yml index 43ab36ad9951..f765158d0f7e 100644 --- a/boards/shields/nrf7002eb/shield.yml +++ b/boards/shields/nrf7002eb/shield.yml @@ -10,3 +10,9 @@ shields: vendor: nordic supported_features: - wifi + + - name: nrf7002eb_coex_sa + full_name: nRF7002 Evaluation Board Shield (SR Co-Existence) standalone + vendor: nordic + supported_features: + - wifi From ecdee3060c980b049ab57f2856581627cb4946aa Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 11 Nov 2025 00:43:29 +0530 Subject: [PATCH 0704/3334] [nrf fromtree] boards: nordic: nrf54h20dk: Fix CPURAD MPSL init failure Allocate one GPIOTE channel for coex grant GPIO pin. This fixes a nrfx assert during MPSL init in CPURAD. Signed-off-by: Chaitanya Tata (cherry picked from commit 9ea5170f09266b32864a1d802c1953581817efd3) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 3 ++- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index e2d5b08cd300..910c192b0d5c 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -224,9 +224,10 @@ slot3_partition: &cpurad_slot1_partition { memory-regions = <&cpuapp_dma_region>; }; +/* Leave one channel for CPURAD */ &gpiote130 { status = "okay"; - owned-channels = <0 1 2 3 4 5 6 7>; + owned-channels = <0 1 2 3 4 5 6>; }; &gpio0 { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 4a8f5972227f..f3b53844398e 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -141,3 +141,8 @@ zephyr_udc0: &usbhs { }; }; }; + +/* For coex-grant GPIO */ +&gpiote130 { + owned-channels = <7>; +}; From 1c3fc7fb2f4e25e9fa1320fd7c135421ac3b4f7c Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:16:14 +0100 Subject: [PATCH 0705/3334] [nrf noup] test-spec: update CI-cloud-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index db9cac90e17f..00a75b24d829 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -332,7 +332,7 @@ - "drivers/serial/**/*" - "drivers/wifi/**/*" - "lib/posix/**/*" - - "soc/nordic/**/*" + - "soc/nordic/nrf9*/*" - "subsys/dfu/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" From 46ce70cb5f92d3c4f390f6f6677ed46c612fd2fa Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:20:23 +0100 Subject: [PATCH 0706/3334] [nrf noup] test-spec: update CI-nfc-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 00a75b24d829..09d7b372bfca 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -242,7 +242,10 @@ - "drivers/spi/**/*" - "lib/crc/**/*" - "modules/hal_nordic/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf9*" - "subsys/ipc/ipc_service/**/*" - "subsys/fs/**/*" - "subsys/mem_mgmt/**/*" From 7eb1ad9cc9045a5a7671ba5c5f5e84a79564e943 Mon Sep 17 00:00:00 2001 From: "Trond F. Christiansen" Date: Mon, 8 Dec 2025 10:13:20 +0100 Subject: [PATCH 0707/3334] [nrf fromtree] sensor: bmm350: Fix I2C register write to use single transaction The bmm350_prep_reg_write_rtio_async() function was incorrectly using two separate SQEs for register writes, creating two distinct I2C transactions: Before: [START][ADDR+W][REG][RESTART] + [START][ADDR+W][DATA][STOP] Change to use a single SQE for the entire write: After: [START][ADDR+W][REG][DATA][STOP] Signed-off-by: Trond F. Christiansen (cherry picked from commit 049d3685246d10a0a66ba4b644e2f61568c42997) --- drivers/sensor/bosch/bmm350/bmm350_bus.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/sensor/bosch/bmm350/bmm350_bus.c b/drivers/sensor/bosch/bmm350/bmm350_bus.c index e82455e66dd3..d567f207654a 100644 --- a/drivers/sensor/bosch/bmm350/bmm350_bus.c +++ b/drivers/sensor/bosch/bmm350/bmm350_bus.c @@ -52,27 +52,29 @@ static int bmm350_prep_reg_write_rtio_async(const struct bmm350_bus *bus, { struct rtio *ctx = bus->rtio.ctx; struct rtio_iodev *iodev = bus->rtio.iodev; - struct rtio_sqe *write_reg_sqe = rtio_sqe_acquire(ctx); - struct rtio_sqe *write_buf_sqe = rtio_sqe_acquire(ctx); + struct rtio_sqe *write_sqe = rtio_sqe_acquire(ctx); + uint8_t write_buf[2]; - if (!write_reg_sqe || !write_buf_sqe) { + if (!write_sqe) { rtio_sqe_drop_all(ctx); return -ENOMEM; } - rtio_sqe_prep_tiny_write(write_reg_sqe, iodev, RTIO_PRIO_NORM, ®, 1, NULL); - write_reg_sqe->flags |= RTIO_SQE_TRANSACTION; - rtio_sqe_prep_tiny_write(write_buf_sqe, iodev, RTIO_PRIO_NORM, &val, 1, NULL); + write_buf[0] = reg; + write_buf[1] = val; + + /* Single I2C transaction: [W(addr), reg, data] */ + rtio_sqe_prep_tiny_write(write_sqe, iodev, RTIO_PRIO_NORM, write_buf, 2, NULL); if (bus->rtio.type == BMM350_BUS_TYPE_I2C) { - write_buf_sqe->iodev_flags |= RTIO_IODEV_I2C_STOP; + write_sqe->iodev_flags |= RTIO_IODEV_I2C_STOP; } - /** Send back last SQE so it can be concatenated later. */ + /** Send back SQE so it can be concatenated later. */ if (out) { - *out = write_buf_sqe; + *out = write_sqe; } - return 2; + return 1; } static int bmm350_reg_read_rtio(const struct bmm350_bus *bus, uint8_t start, uint8_t *buf, int size) From 5cc9c4e5e802d0fce0d2f6f9f56157eafe54bd5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20Hirsim=C3=A4ki?= Date: Fri, 31 Oct 2025 13:38:27 +0200 Subject: [PATCH 0708/3334] [nrf fromtree] net: ip: new Kconfig NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE is used to set the default size of the data field in the net_mgmt_event_info structure. This change allows the user to configure the size of the data field according to their needs. Signed-off-by: Jani Hirsimäki (cherry picked from commit f55dacf8498fb66895ad21f51eb1cf459bcc85b0) --- subsys/net/ip/Kconfig.mgmt | 10 +++++++++- subsys/net/ip/net_private.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/subsys/net/ip/Kconfig.mgmt b/subsys/net/ip/Kconfig.mgmt index 4ca57e4c8e5e..f5f745390b71 100644 --- a/subsys/net/ip/Kconfig.mgmt +++ b/subsys/net/ip/Kconfig.mgmt @@ -95,15 +95,23 @@ config NET_MGMT_EVENT_INFO and listeners will then be able to get it. Such information depends on the type of event. +if NET_MGMT_EVENT_INFO +config NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE + int "Default size of event information data" + default 32 + help + The default size of the data which can be passed along with an event. + config NET_MGMT_EVENT_MONITOR bool "Monitor network events from net shell" - depends on NET_SHELL && NET_MGMT_EVENT_INFO + depends on NET_SHELL help Allow user to monitor network events from net shell using "net events [on|off]" command. The monitoring is disabled by default. Note that you should probably increase the value of NET_MGMT_EVENT_QUEUE_SIZE from the default in order not to miss any events. +endif # NET_MGMT_EVENT_INFO config NET_MGMT_EVENT_MONITOR_STACK_SIZE int "Size of the stack allocated for the event_mon_stack thread" diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 11ae1be6b9fb..a636fcf9b79a 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -25,7 +25,7 @@ #include #endif /* CONFIG_NET_L2_WIFI_MGMT */ -#define DEFAULT_NET_EVENT_INFO_SIZE 32 +#define DEFAULT_NET_EVENT_INFO_SIZE CONFIG_NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE /* NOTE: Update this union with all *big* event info structs */ union net_mgmt_events { #if defined(CONFIG_NET_DHCPV4) From 791264643d9ecab90dce88872ecf09d99a6bd3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20Hirsim=C3=A4ki?= Date: Fri, 31 Oct 2025 10:42:35 +0200 Subject: [PATCH 0709/3334] [nrf fromtree] net: possibility to set custom link layer address length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a new Kconfig option NET_LINK_ADDR_CUSTOM_LENGTH that allows to set custom link layer address length if your link layer technology is not supported directly. If this option is set to a value greater than 0, that value is used as link layer address length. Signed-off-by: Jani Hirsimäki (cherry picked from commit 9800ff5c478d99ae7b3f372dc73f35e7217f7d54) --- include/zephyr/net/net_linkaddr.h | 4 +++- subsys/net/ip/Kconfig | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/zephyr/net/net_linkaddr.h b/include/zephyr/net/net_linkaddr.h index 134c20574309..74657c814fc8 100644 --- a/include/zephyr/net/net_linkaddr.h +++ b/include/zephyr/net/net_linkaddr.h @@ -30,7 +30,9 @@ extern "C" { */ /** Maximum length of the link address */ -#if defined(CONFIG_NET_L2_PHY_IEEE802154) || defined(CONFIG_NET_L2_PPP) +#if CONFIG_NET_LINK_ADDR_CUSTOM_LENGTH > 0 +#define NET_LINK_ADDR_MAX_LENGTH CONFIG_NET_LINK_ADDR_CUSTOM_LENGTH +#elif defined(CONFIG_NET_L2_PHY_IEEE802154) || defined(CONFIG_NET_L2_PPP) #define NET_LINK_ADDR_MAX_LENGTH 8 #else #define NET_LINK_ADDR_MAX_LENGTH 6 diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index b5557c3632e0..673f24d39dda 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -767,6 +767,14 @@ config NET_HEADERS_ALWAYS_CONTIGUOUS NET_BUF_FIXED_DATA_SIZE enabled and NET_BUF_DATA_SIZE of 128 for instance. +config NET_LINK_ADDR_CUSTOM_LENGTH + int "Size of custom link layer address length" + default 0 + help + This option allows to define custom link layer address length + if your link layer technology is not supported directly. + As a default, custom link layer address length is not used. + # If we are running network tests found in tests/net, then the NET_TEST is # set and in that case we default to Dummy L2 layer as typically the tests # use that by default. From b944a50b18fb5a2adc705ca4dedd5f1a81db77d2 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:49:13 +0100 Subject: [PATCH 0710/3334] [nrf noup] test-spec: update CI-rs-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at board. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 09d7b372bfca..554b15bc2476 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -203,7 +203,11 @@ - "CMakeLists.txt" "CI-rs-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf21540dk*" + - "boards/nordic/nrf52833dk*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From ade912c31368c04f1ff3458a6385a969d426bff7 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:51:19 +0100 Subject: [PATCH 0711/3334] [nrf noup] test-spec: update CI-fem-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 554b15bc2476..27e81cd357e7 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -180,7 +180,11 @@ - "modules/mbedtls/**/*" "CI-fem-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf21540dk*" + - "boards/nordic/nrf52833dk*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From dc60f67fdd2f9c79a08a15161e53934c0c79112d Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:58:09 +0100 Subject: [PATCH 0712/3334] [nrf noup] test-spec: update CI-boot-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 27e81cd357e7..1c45698e423d 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,7 +39,11 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54h20dk*" + - "boards/nordic/nrf54l*" + - "boards/nordic/nrf9160dk*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" From f381002023190d1715400a50fc39672b7150fc1b Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:58:38 +0100 Subject: [PATCH 0713/3334] [nrf noup] test-spec: update CI-dfu-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 1c45698e423d..af7db8adce71 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -54,7 +54,8 @@ - "tests/subsys/mgmt/mcumgr/**/*" "CI-dfu-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf54h20dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/**/*" - "drivers/console/**/*" - "drivers/flash/**/*" From ceabc540fed74d3e1969b78f92dc0fbd7e815a3e Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Fri, 9 Jan 2026 11:35:33 +0100 Subject: [PATCH 0714/3334] [nrf noup] test-spec: update CI-ble-samples-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml Depend on actual used socs. Zephyr ble samples are not executed at all. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index af7db8adce71..7588b157337a 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -115,7 +115,9 @@ - any: - "drivers/bluetooth/**/*" - any: - - "dts/arm/nordic/nrf5*" + - "dts/arm/nordic/nrf52*" + - "dts/arm/nordic/nrf53*" + - "dts/arm/nordic/nrf54*" - any: - "subsys/bluetooth/**/*" - "!subsys/bluetooth/mesh/**/*" @@ -123,7 +125,6 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/**/*" "CI-mesh-test": - "subsys/bluetooth/mesh/**/*" From 59e3ced7c567e0b25c2513e49b11ac5a68299a6c Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:29:12 +0100 Subject: [PATCH 0715/3334] [nrf noup] test-spec: update CI-rs-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 7588b157337a..79064e3febd0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -231,7 +231,11 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From e77279a09ef4adbb6affd4f735a7e10644c7facc Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:30:48 +0100 Subject: [PATCH 0716/3334] [nrf noup] test-spec: update CI-thread-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 79064e3febd0..df4166d8e6b0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -248,7 +248,11 @@ - "modules/mbedtls/**/*" - "modules/openthread/**/*" - "samples/net/openthread/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" From a33f32a96e1fbcbff99ef8e0a4f8909018f218ed Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:32:37 +0100 Subject: [PATCH 0717/3334] [nrf noup] test-spec: update CI-matter-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index df4166d8e6b0..aac297f11412 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -283,7 +283,12 @@ "CI-matter-test": - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/dfu/**/*" - "subsys/settings/**/*" - "subsys/net/**/*" From 338f4a025967dfe67242ebc8fc01706fb89697e5 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:34:16 +0100 Subject: [PATCH 0718/3334] [nrf noup] test-spec: update CI-fem-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index aac297f11412..d91e0f0bd3a2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -204,7 +204,11 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 365da0027ced3963b5c7d8906a99c02d71fb4993 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:37:20 +0100 Subject: [PATCH 0719/3334] [nrf noup] test-spec: update CI-ble-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. test-ble is not validating nrf51 and nrf91, so it does not make sense to trigger ci on these changes. Signed-off-by: Piotr Kosycarz --- .github/test-spec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index d91e0f0bd3a2..ecf8102649dc 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -108,6 +108,8 @@ - "boards/nordic/nrf5*" - any: - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf9*" - any: - "subsys/pm/**/*" From 0d02a57233fdeee0a917779adca3f18b4f5eaa17 Mon Sep 17 00:00:00 2001 From: Sudan Landge Date: Wed, 11 Jun 2025 14:35:48 +0100 Subject: [PATCH 0720/3334] [nrf fromtree] boards: mps4: Enable non-secure variant support Zephyr's TF-M has been aligned with upstream TF-M v2.2.0, which adds support for Corstone-320 (CS320). The previous commit also updates TF-M to fix compiler warnings seen with MPS4. So, with this update, enable build and execution of non-secure variants of MPS4-based boards. Signed-off-by: Sudan Landge (cherry picked from commit 826742fca2c0698f0a0972fe13a51b88434e7bed) --- boards/arm/mps4/board.cmake | 11 ++++++++++- boards/arm/mps4/mps4_corstone315_fvp_ns.yaml | 3 +++ boards/arm/mps4/mps4_corstone320_fvp_ns.yaml | 3 +++ modules/trusted-firmware-m/Kconfig.tfm | 6 ++++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/boards/arm/mps4/board.cmake b/boards/arm/mps4/board.cmake index 9c4d4a0ef337..56090124532a 100644 --- a/boards/arm/mps4/board.cmake +++ b/boards/arm/mps4/board.cmake @@ -33,7 +33,16 @@ if(CONFIG_ARM_PAC OR CONFIG_ARM_BTI) endif() if(CONFIG_BUILD_WITH_TFM) - set(ARMFVP_FLAGS ${ARMFVP_FLAGS} -a ${APPLICATION_BINARY_DIR}/zephyr/tfm_merged.hex) + # Workaround: Use binary (.bin) format images until TF-M supports generating them in hex (.hex) + # format. The image load addresses are referred from the TF-M official documentation at: + # https://trustedfirmware-m.readthedocs.io/en/latest/platform/arm/mps4/corstone320/README.html + set(ARMFVP_FLAGS ${ARMFVP_FLAGS} + --data ${APPLICATION_BINARY_DIR}/tfm/bin/bl1_1.bin@0x11000000 + --data ${APPLICATION_BINARY_DIR}/tfm/bin/cm_provisioning_bundle.bin@0x12024000 + --data ${APPLICATION_BINARY_DIR}/tfm/bin/dm_provisioning_bundle.bin@0x1202aa00 + --data ${APPLICATION_BINARY_DIR}/tfm/bin/bl2_signed.bin@0x12031400 + -a ${APPLICATION_BINARY_DIR}/zephyr/tfm_merged.hex + ) endif() # FVP Parameters diff --git a/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml b/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml index 01bee24100a2..c04889d7f6f4 100644 --- a/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml +++ b/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml @@ -7,6 +7,9 @@ type: mcu arch: arm ram: 1024 flash: 512 +simulation: + - name: armfvp + exec: FVP_Corstone_SSE-315 toolchain: - gnuarmemb - zephyr diff --git a/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml b/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml index 45ee954a3370..51bfb990e5f6 100644 --- a/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml +++ b/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml @@ -7,6 +7,9 @@ type: mcu arch: arm ram: 1024 flash: 512 +simulation: + - name: armfvp + exec: FVP_Corstone_SSE-320 toolchain: - gnuarmemb - zephyr diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 36a734ad8b3e..dc4b206595d0 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -12,11 +12,13 @@ config TFM_BOARD string default "nxp/lpcxpresso55s69" if BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS default "arm/mps2/an521" if BOARD_MPS2_AN521_CPU0_NS - default "arm/mps3/corstone300/fvp" if BOARD_MPS3_CORSTONE300_FVP_NS + default "arm/mps3/corstone300/fvp" if BOARD_MPS3_CORSTONE300_FVP_NS default "arm/mps3/corstone300/an547" if BOARD_MPS3_CORSTONE300_AN547_NS default "arm/mps3/corstone300/an552" if BOARD_MPS3_CORSTONE300_AN552_NS default "arm/mps3/corstone310/an555" if BOARD_MPS3_CORSTONE310_AN555_NS - default "arm/mps3/corstone310/fvp" if BOARD_MPS3_CORSTONE310_FVP_NS + default "arm/mps3/corstone310/fvp" if BOARD_MPS3_CORSTONE310_FVP_NS + default "arm/mps4/corstone315" if BOARD_MPS4_CORSTONE315_FVP_NS + default "arm/mps4/corstone320" if BOARD_MPS4_CORSTONE320_FVP_NS default "stm/b_u585i_iot02a" if BOARD_B_U585I_IOT02A default "stm/nucleo_l552ze_q" if BOARD_NUCLEO_L552ZE_Q default "stm/stm32l562e_dk" if BOARD_STM32L562E_DK From e4577ac8199ac0c1a29ccd4e5c9b75e403514237 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Mon, 31 Mar 2025 12:27:51 +0200 Subject: [PATCH 0721/3334] [nrf fromtree] boards: st: Add stm32wba65i-dk1 Add stm32wba65i-dk1 board support with UART console, LEDs, joystick keys using ADC channel 6. Board YAML file does not list 'supported' tags since the board is very similar to nucleo_wba65ri for which supported features are already covered. Signed-off-by: Etienne Carriere (cherry picked from commit 1dd6c2bb66ae6c7818d85970dd4f4040d667447e) --- boards/st/stm32wba65i_dk1/Kconfig.defconfig | 13 + .../stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 | 5 + .../stm32wba65i_dk1/arduino_r3_connector.dtsi | 41 ++++ boards/st/stm32wba65i_dk1/board.cmake | 7 + boards/st/stm32wba65i_dk1/board.yml | 6 + .../doc/img/stm32wba65i-dk1.webp | Bin 0 -> 40424 bytes boards/st/stm32wba65i_dk1/doc/index.rst | 232 ++++++++++++++++++ boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts | 187 ++++++++++++++ .../st/stm32wba65i_dk1/stm32wba65i_dk1.yaml | 10 + .../stm32wba65i_dk1/stm32wba65i_dk1_defconfig | 24 ++ boards/st/stm32wba65i_dk1/support/openocd.cfg | 26 ++ 11 files changed, 551 insertions(+) create mode 100644 boards/st/stm32wba65i_dk1/Kconfig.defconfig create mode 100644 boards/st/stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 create mode 100644 boards/st/stm32wba65i_dk1/arduino_r3_connector.dtsi create mode 100644 boards/st/stm32wba65i_dk1/board.cmake create mode 100644 boards/st/stm32wba65i_dk1/board.yml create mode 100644 boards/st/stm32wba65i_dk1/doc/img/stm32wba65i-dk1.webp create mode 100644 boards/st/stm32wba65i_dk1/doc/index.rst create mode 100644 boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts create mode 100644 boards/st/stm32wba65i_dk1/stm32wba65i_dk1.yaml create mode 100644 boards/st/stm32wba65i_dk1/stm32wba65i_dk1_defconfig create mode 100644 boards/st/stm32wba65i_dk1/support/openocd.cfg diff --git a/boards/st/stm32wba65i_dk1/Kconfig.defconfig b/boards/st/stm32wba65i_dk1/Kconfig.defconfig new file mode 100644 index 000000000000..620565526e58 --- /dev/null +++ b/boards/st/stm32wba65i_dk1/Kconfig.defconfig @@ -0,0 +1,13 @@ +# STM32WBA65I Discovery kit board configuration + +# Copyright (c) 2025 STMicroelectronics + +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_STM32WBA65I_DK1 + +config SPI_STM32_INTERRUPT + default y + depends on SPI + +endif # BOARD_STM32WBA65I_DK1 diff --git a/boards/st/stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 b/boards/st/stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 new file mode 100644 index 000000000000..9fcfc52471d8 --- /dev/null +++ b/boards/st/stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 @@ -0,0 +1,5 @@ +# Copyright (c) 2025 STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_STM32WBA65I_DK1 + select SOC_STM32WBA65XX diff --git a/boards/st/stm32wba65i_dk1/arduino_r3_connector.dtsi b/boards/st/stm32wba65i_dk1/arduino_r3_connector.dtsi new file mode 100644 index 000000000000..999cb7600ea3 --- /dev/null +++ b/boards/st/stm32wba65i_dk1/arduino_r3_connector.dtsi @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2025 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + arduino_header: connector { + compatible = "arduino-header-r3"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + }; +}; + +arduino_i2c: &i2c1 {}; +arduino_spi: &spi1 {}; diff --git a/boards/st/stm32wba65i_dk1/board.cmake b/boards/st/stm32wba65i_dk1/board.cmake new file mode 100644 index 000000000000..45abc466464f --- /dev/null +++ b/boards/st/stm32wba65i_dk1/board.cmake @@ -0,0 +1,7 @@ +# Copyright (c) 2025 STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") + +include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd-stm32.board.cmake) diff --git a/boards/st/stm32wba65i_dk1/board.yml b/boards/st/stm32wba65i_dk1/board.yml new file mode 100644 index 000000000000..521ca2c3169e --- /dev/null +++ b/boards/st/stm32wba65i_dk1/board.yml @@ -0,0 +1,6 @@ +board: + name: stm32wba65i_dk1 + full_name: STM32WBA65I Discovery kit + vendor: st + socs: + - name: stm32wba65xx diff --git a/boards/st/stm32wba65i_dk1/doc/img/stm32wba65i-dk1.webp b/boards/st/stm32wba65i_dk1/doc/img/stm32wba65i-dk1.webp new file mode 100644 index 0000000000000000000000000000000000000000..4cae2e31f470880f264e98b0d351cffeff87aa20 GIT binary patch literal 40424 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 is required. + +Flashing an application to a STM32WBA65I-DK1 +-------------------------------------------- + +Here is an example for the :zephyr:code-sample:`blinky` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: stm32wba65i_dk1 + :goals: build flash + +You will see the LED blinking every second. + +Debugging +========= + +Debugging using OpenOCD +----------------------- + +You can debug an application in the usual way using OpenOCD. Here is an example for the +:zephyr:code-sample:`blinky` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: stm32wba65i_dk1 + :maybe-skip-config: + :goals: debug + +.. _STM32WBA Series on www.st.com: + https://www.st.com/en/microcontrollers-microprocessors/stm32wba-series.html + +.. _STM32CubeProgrammer: + https://www.st.com/en/development-tools/stm32cubeprog.html diff --git a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts new file mode 100644 index 000000000000..48e70a3e121e --- /dev/null +++ b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2025 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include +#include "arduino_r3_connector.dtsi" +#include + +/ { + model = "STMicroelectronics STM32WBA65I Discovery kit board"; + compatible = "st,stm32wba65i-dk1"; + + #address-cells = <1>; + #size-cells = <1>; + + chosen { + zephyr,bt-c2h-uart = &usart1; + zephyr,console = &usart1; + zephyr,shell-uart = &usart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds: leds { + compatible = "gpio-leds"; + + green_led_1: led_0 { + gpios = <&gpiod 8 GPIO_ACTIVE_LOW>; + label = "User LD6"; + }; + + red_led_2: led_1 { + gpios = <&gpiod 9 GPIO_ACTIVE_LOW>; + label = "User LD5"; + }; + + blue_led_3: led_2 { + /* Not functional w/o a 0Ohm resistor on MB2143 R42 */ + gpios = <&gpiob 10 GPIO_ACTIVE_LOW>; + label = "User LD3"; + }; + }; + + adc-keys { + compatible = "adc-keys"; + io-channels = <&adc4 6>; + keyup-threshold-mv = <3300>; + + select_key { + press-thresholds-mv = <0>; + zephyr,code = ; + }; + + left_key { + press-thresholds-mv = <670>; + zephyr,code = ; + }; + + down_key { + press-thresholds-mv = <1320>; + zephyr,code = ; + }; + + up_key { + press-thresholds-mv = <2010>; + zephyr,code = ; + }; + + right_key { + press-thresholds-mv = <2650>; + zephyr,code = ; + }; + }; + + aliases { + led0 = &green_led_1; + led1 = &red_led_2; + }; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_lse { + status = "okay"; +}; + +&clk_hse { + hse-div2; + status = "okay"; +}; + +&clk_hsi { + status = "okay"; +}; + +&rcc { + clocks = <&clk_hse>; + clock-frequency = ; + ahb-prescaler = <1>; + ahb5-prescaler = <2>; + apb1-prescaler = <1>; + apb2-prescaler = <2>; + apb7-prescaler = <1>; +}; + +&iwdg { + status = "okay"; +}; + +&rtc { + status = "okay"; + clocks = <&rcc STM32_CLOCK(APB7, 21)>, + <&rcc STM32_SRC_LSE RTC_SEL(1)>; + prescaler = <32768>; +}; + +&usart1 { + clocks = <&rcc STM32_CLOCK(APB2, 14)>, + <&rcc STM32_SRC_HSI16 USART1_SEL(2)>; + pinctrl-0 = <&usart1_tx_pb12 &usart1_rx_pa8>; + pinctrl-1 = <&analog_pb12 &analog_pa8>; + pinctrl-names = "default", "sleep"; + current-speed = <115200>; + status = "okay"; +}; + +&spi1 { + pinctrl-0 = <&spi1_nss_pa12 &spi1_sck_pb4 + &spi1_miso_pb3 &spi1_mosi_pa15>; + pinctrl-names = "default"; + status = "okay"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_scl_pb2 &i2c1_sda_pb1>; + pinctrl-names = "default"; + status = "okay"; + clock-frequency = ; +}; + +&adc4 { + pinctrl-0 = <&adc4_in6_pa3>; + pinctrl-names = "default"; + st,adc-clock-source = "ASYNC"; + st,adc-prescaler = <4>; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + channel@6 { + reg = <0x6>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + zephyr,vref-mv = <3300>; + }; +}; + +stm32_lp_tick_source: &lptim1 { + clocks = <&rcc STM32_CLOCK(APB7, 11)>, + <&rcc STM32_SRC_LSE LPTIM1_SEL(3)>; + status = "okay"; +}; + +&rng { + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + storage_partition: partition@1c0000 { + label = "storage"; + reg = <0x001c0000 DT_SIZE_K(256)>; + }; + }; +}; diff --git a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.yaml b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.yaml new file mode 100644 index 000000000000..b77e57240f1a --- /dev/null +++ b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.yaml @@ -0,0 +1,10 @@ +identifier: stm32wba65i_dk1/stm32wba65xx +name: ST STM32WBA65I Discovery kit +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 512 +flash: 2048 +vendor: st diff --git a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1_defconfig b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1_defconfig new file mode 100644 index 000000000000..5e650e6826cb --- /dev/null +++ b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1_defconfig @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 STMicroelectronics + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable GPIO +CONFIG_GPIO=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable HW stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable the internal SMPS regulator +CONFIG_POWER_SUPPLY_DIRECT_SMPS=y + +# Enable ADC for joystick +CONFIG_ADC=y diff --git a/boards/st/stm32wba65i_dk1/support/openocd.cfg b/boards/st/stm32wba65i_dk1/support/openocd.cfg new file mode 100644 index 000000000000..0745453a16a5 --- /dev/null +++ b/boards/st/stm32wba65i_dk1/support/openocd.cfg @@ -0,0 +1,26 @@ +# Note: Using OpenOCD using stm32wba65i_dk1 requires using openocd fork. +# See board documentation for more information + +source [find interface/stlink-dap.cfg] + +set WORKAREASIZE 0x8000 + +transport select "dapdirect_swd" + +# Enable debug when in low power modes +set ENABLE_LOW_POWER 1 + +# Stop Watchdog counters when halt +set STOP_WATCHDOG 1 + +# STlink Debug clock frequency +set CLOCK_FREQ 8000 + +# Reset configuration +# use hardware reset, connect under reset +# connect_assert_srst needed if low power mode application running (WFI...) +reset_config srst_only srst_nogate + +source [find target/stm32wbax.cfg] + +gdb_memory_map disable From 2eaefa20b26064f3797d92e97f2965f0d51d3cd2 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Fri, 16 May 2025 09:33:16 +0200 Subject: [PATCH 0722/3334] [nrf fromtree] modules: trusted-firmware-m: Declare stm32wba65i support Declare stm32wba65i-dk1 and nucleo_wba65ri boards support in TF-M. Both comply with TF-M integration of platform stm/stm32wba65i-dk. Signed-off-by: Etienne Carriere (cherry picked from commit 0218849c4870847af177ae6747a198d8974e2f3f) --- modules/trusted-firmware-m/Kconfig.tfm | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index dc4b206595d0..10c761b0457e 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -22,6 +22,7 @@ config TFM_BOARD default "stm/b_u585i_iot02a" if BOARD_B_U585I_IOT02A default "stm/nucleo_l552ze_q" if BOARD_NUCLEO_L552ZE_Q default "stm/stm32l562e_dk" if BOARD_STM32L562E_DK + default "stm/stm32wba65i_dk" if BOARD_NUCLEO_WBA65RI || BOARD_STM32WBA65I_DK1 default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS From efba2d2c754e727eff549adf51c4b5c990e7e74f Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Fri, 18 Apr 2025 08:56:21 +0200 Subject: [PATCH 0723/3334] [nrf fromtree] modules: trusted-firmware-m: Add STM32_FLASH_LAYOUT_BEGIN_OFFSET Add TF-M directive STM32_FLASH_LAYOUT_BEGIN_OFFSET needed to specify the gap needed by external boot stage resources at flash beginning. The offset tells STM32 TF-M firmware the base offset in the flash where the several TF-M and non-secure image areas shall be located. The CMake directive was introduced mainline TF-M commit [1] and merged in Zephyr TF-M repository [2]. Link: https://github.com/TrustedFirmware-M/trusted-firmware-m/commit/fc035b874e0ab86e2a13a328da3dce0cf18eb566 [1] Link: https://github.com/zephyrproject-rtos/trusted-firmware-m/commit/954dc805411be8fedac4ed7ddfefe966ffb35576 [2] Signed-off-by: Etienne Carriere (cherry picked from commit f4b9e5f68e238197785e91a20644110a17be11bb) --- modules/trusted-firmware-m/CMakeLists.txt | 6 ++++++ modules/trusted-firmware-m/Kconfig.tfm | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 0add755cdc67..a8d51666591e 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -281,6 +281,12 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DETHOS_DRIVER_PATH=${CONFIG_TFM_ETHOS_DRIVER_PATH_LOCAL}) endif() + if(CONFIG_TFM_STM32_FLASH_LAYOUT_BEGIN_OFFSET) + list(APPEND TFM_CMAKE_ARGS + -DSTM32_FLASH_LAYOUT_BEGIN_OFFSET=${CONFIG_TFM_STM32_FLASH_LAYOUT_BEGIN_OFFSET} + ) + endif() + file(MAKE_DIRECTORY ${TFM_BINARY_DIR}) add_custom_target(tfm_cmake DEPENDS ${TFM_BINARY_DIR}/CMakeCache.txt diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 10c761b0457e..06c7221321ec 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -519,4 +519,14 @@ config TFM_EXCEPTION_INFO_DUMP On fatal errors in the secure firmware, capture info about the exception. Print the info if the SPM log level is sufficient. +config TFM_STM32_FLASH_LAYOUT_BEGIN_OFFSET + int "Offset gap at beginning of flash layout" + depends on SOC_FAMILY_STM32 + default 0 + help + Set an offset at the beginning of the STM32 platform flash + layout above which TF-M resources location start. The platform uses + this gap for platform specific reason, as for example when a + bootloader that is external to TF-M is used. + endif # BUILD_WITH_TFM From 77fc9b93aba8fdb738ab071f1506fc8deecb9be3 Mon Sep 17 00:00:00 2001 From: Tahsin Mutlugun Date: Tue, 26 Aug 2025 15:53:10 +0300 Subject: [PATCH 0724/3334] [nrf fromtree] soc: adi: max32: Add support for MAX32658 SoC MAX32658 is the 1.8V variant of MAX32657. From a software perspective, both SoCs are functionally equivalent. Reuse the existing MAX32657 backend for MAX32658 to enable support with minimal changes. Signed-off-by: Tahsin Mutlugun (cherry picked from commit a97b2007cf9fee0038cab116f7e3374be2ef2e84) --- soc/adi/max32/Kconfig.soc | 5 +++++ soc/adi/max32/soc.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/soc/adi/max32/Kconfig.soc b/soc/adi/max32/Kconfig.soc index e4b2347ca021..7bd66bf2cc70 100644 --- a/soc/adi/max32/Kconfig.soc +++ b/soc/adi/max32/Kconfig.soc @@ -33,6 +33,10 @@ config SOC_MAX32657 bool select SOC_FAMILY_MAX32_M33 +config SOC_MAX32658 + bool + select SOC_MAX32657 + config SOC_MAX32660 bool select SOC_FAMILY_MAX32_M4 @@ -97,6 +101,7 @@ config SOC default "max32650" if SOC_MAX32650 default "max32655" if SOC_MAX32655 default "max32657" if SOC_MAX32657 + default "max32658" if SOC_MAX32658 default "max32660" if SOC_MAX32660 default "max32662" if SOC_MAX32662 default "max32666" if SOC_MAX32666 diff --git a/soc/adi/max32/soc.yml b/soc/adi/max32/soc.yml index 1a4b7c2568d3..270c8c28dfb3 100644 --- a/soc/adi/max32/soc.yml +++ b/soc/adi/max32/soc.yml @@ -9,6 +9,7 @@ family: cpuclusters: - name: m4 - name: max32657 + - name: max32658 - name: max32660 - name: max32662 - name: max32666 From 70f1acd17ce3be4226a1e7cbd81ecf79c831276e Mon Sep 17 00:00:00 2001 From: Tahsin Mutlugun Date: Tue, 26 Aug 2025 16:06:45 +0300 Subject: [PATCH 0725/3334] [nrf fromtree] boards: adi: Add MAX32658EVKIT secure and nonsecure boards Adds MAX32658EVKIT board with secure and nonsecure variants. Signed-off-by: Tahsin Mutlugun (cherry picked from commit 9625f00929d891a9b7add1432aba8319c3decb6d) --- boards/adi/max32658evkit/Kconfig.defconfig | 48 ++ .../adi/max32658evkit/Kconfig.max32658evkit | 6 + boards/adi/max32658evkit/board.cmake | 12 + boards/adi/max32658evkit/board.yml | 10 + .../max32658evkit/doc/img/max32658evkit.webp | Bin 0 -> 76448 bytes boards/adi/max32658evkit/doc/index.rst | 571 ++++++++++++++++++ .../max32658evkit/max32658evkit_max32658.dts | 52 ++ .../max32658evkit/max32658evkit_max32658.yaml | 21 + .../max32658evkit_max32658_common.dtsi | 108 ++++ .../max32658evkit_max32658_defconfig | 16 + .../max32658evkit_max32658_ns.dts | 75 +++ .../max32658evkit_max32658_ns.yaml | 20 + .../max32658evkit_max32658_ns_defconfig | 19 + modules/trusted-firmware-m/CMakeLists.txt | 2 +- modules/trusted-firmware-m/Kconfig.tfm | 2 +- 15 files changed, 960 insertions(+), 2 deletions(-) create mode 100644 boards/adi/max32658evkit/Kconfig.defconfig create mode 100644 boards/adi/max32658evkit/Kconfig.max32658evkit create mode 100644 boards/adi/max32658evkit/board.cmake create mode 100644 boards/adi/max32658evkit/board.yml create mode 100644 boards/adi/max32658evkit/doc/img/max32658evkit.webp create mode 100644 boards/adi/max32658evkit/doc/index.rst create mode 100644 boards/adi/max32658evkit/max32658evkit_max32658.dts create mode 100644 boards/adi/max32658evkit/max32658evkit_max32658.yaml create mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_common.dtsi create mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_defconfig create mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_ns.dts create mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_ns.yaml create mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_ns_defconfig diff --git a/boards/adi/max32658evkit/Kconfig.defconfig b/boards/adi/max32658evkit/Kconfig.defconfig new file mode 100644 index 000000000000..8235ba516f2b --- /dev/null +++ b/boards/adi/max32658evkit/Kconfig.defconfig @@ -0,0 +1,48 @@ +# Copyright (c) 2024-2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_MAX32658EVKIT + +# Code Partition: +# +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +if BOARD_MAX32658EVKIT_MAX32658_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +# MAX32658 has one UART interface, +# It can be used either on TFM or Zephyr +# Enabling debug (TFM_SPM_LOG_LEVEL || TFM_PARTITION_LOG_LEVEL) will transfer it to the TFM side +# Disabling TFM debug will transfer it to the Zephyr side. + +choice TFM_SPM_LOG_LEVEL + default TFM_SPM_LOG_LEVEL_SILENCE +endchoice + +choice TFM_PARTITION_LOG_LEVEL + default TFM_PARTITION_LOG_LEVEL_SILENCE +endchoice + +endif # BOARD_MAX32658EVKIT_MAX32658_NS + +config I3C + default y if ADXL367 + +endif # BOARD_MAX32658EVKIT diff --git a/boards/adi/max32658evkit/Kconfig.max32658evkit b/boards/adi/max32658evkit/Kconfig.max32658evkit new file mode 100644 index 000000000000..d7b695e47587 --- /dev/null +++ b/boards/adi/max32658evkit/Kconfig.max32658evkit @@ -0,0 +1,6 @@ +# Copyright (c) 2024-2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MAX32658EVKIT + select SOC_MAX32658 if BOARD_MAX32658EVKIT_MAX32658 || \ + BOARD_MAX32658EVKIT_MAX32658_NS diff --git a/boards/adi/max32658evkit/board.cmake b/boards/adi/max32658evkit/board.cmake new file mode 100644 index 000000000000..32e6669b7018 --- /dev/null +++ b/boards/adi/max32658evkit/board.cmake @@ -0,0 +1,12 @@ +# Copyright (c) 2024-2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +if(CONFIG_BOARD_MAX32658EVKIT_MAX32658_NS) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) +endif() + +board_runner_args(jlink "--device=MAX32658" "--reset-after-load") + +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/adi/max32658evkit/board.yml b/boards/adi/max32658evkit/board.yml new file mode 100644 index 000000000000..07a2bd79226d --- /dev/null +++ b/boards/adi/max32658evkit/board.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2024-2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board: + name: max32658evkit + vendor: adi + socs: + - name: max32658 + variants: + - name: "ns" diff --git a/boards/adi/max32658evkit/doc/img/max32658evkit.webp b/boards/adi/max32658evkit/doc/img/max32658evkit.webp new file mode 100644 index 0000000000000000000000000000000000000000..7bbf5b668eef641659656e1ba888ba53d0954131 GIT binary patch literal 76448 zcmV(?K-a%gNk&GPDggjjMM6+kP&gorDggkHc>|6lMU`VaXJ{Xgmd zd47O@SAXFDe*ZuJm;KNG|FM7ZKW=@-e`)`h`FHRO`cL_9{a@@q+W++VWB+ISWB&W# zxAyP%f4N`tK0v>#|A+s}{;&7{<{SQJ|DXCF0^i@i=JN>8sfA#+FzxTiV zf6f1k|NrRs`^Wvi+%NZk|Ne#lw*RRA+y1}z|KtPz*R^l(5B`3j9;*E{{+;-{?@Q!A zpnqBZwfDdef_)kZ}Xqk|HyxY{l@=G`-S!k`2X@h?H}5I#Q(Pb z)BDl(EAyY|ztexH{iN~R)&I}`t^Yy$r~Ci(3+h+QzsLV>{}=yH{8#Tkv3K!*<9~Gj zxBvhD&-7>J-`79I|AYT6{^$G8|Nr`*pg+eyn*W9V+x}brNB6(~|MndM z|0n!!`Tzbu=zstJ@cjnhHe}z-tdq5BYqC*^{Ji@Obc$z_)SnNX^NHasNUFwDc z6Z|TlzVMB2;Tq)*8nGcYVZ+AK3$i~t!eg+YWHtcYROBsAE7wPc?J0DYzV>NQ-qRv$VtScXU>5lF4rHU>M;}bDXRu#&by8PRer8B1s^A3 z0?IG48Y0rH@srcPa7Quo2Eg(Ai*xht6!uRsqe6=UF>6!1q#&zT6uNdt#fhPBy;?ln zpb4DrlC+yG0Z2mPV#f=|ZB4@n!vLbAQuW(TSC99c{r3Ld zbe<4PYaTUFc~@-E)~BrjwIb@zZoCo^rhq2*zRAocA#<0!;~sVon&N=g4ldNhP3P@b0qVANx*&U|c(H>@ScM#(5j13oU5P zM78t^NArC6q%+7tKeLgqlT-R6XY$?&A3yy4ueo{$kc?YW)!FKbsTL$N)vsbGeIb@K3C!&fmtZ{e`yf=igMwXW|2SBmil!n}}5VHB{8j6>sM*x(bfJTGZ^`bnm7t z&V9b1G*XkpL7}f2p4bLh;C%7kjmyrZ9*2d|5kwZ}bTN=eq*ttymz@P#_iFsDC9S9NqA}P2B zFPgtWE9Rb@IH{xl5-n6)|HS|N$3TPEt)1!R0aA9ADjyw>JyQq2m?nuHG~-7C-r-0r zrP>GjP(+?bP@Ki;lf<=Mqp)t%29BrbV(1?_tb5&&8s85;vokv%IN*{P-fIg8202Lc zbnfDu0(@=V882no!Oknz`)-t|R_Stey_>PX1Narxn(0^)daoY^JYnd=tKD};DUz>Z z4C)N-PgUaTtzuHLZ|8kqPk2LJ?FIFAjeTj)M3>xS4bajxa*_BAQ|a~en9z1xegYX} zQFZwEpkYbWV+CZ-3|0%*_nf}Xoy=gTHqkQ@mAW=;D;JwnxB{6ep)!n| z=D?*i@jSIm$ubOWXJq;~cMfD!T3#s~^h!RA%0ZE(^oh}pI_OzQmC_rVjYr>00rg+c z9zU&TVURKC{2N-G2ql(Fa8^~WiBwFR$6AT|#jjzPvF#yjuDBFspFwd6rtK@v;&8{&kR(vuiRq+&1OIfk^qUuUu6OY?#k9R-E&a%VkNm61eR$cA)%Ycq2Q0CpndyTb~srC~f&g#Cg= z-Q0o@(5U8y2kXT<{b2pmi?{VlPbuw(l;N`6XYin9$O8yD$qiQLZhjw9 z2b23BV~1@=9jYgY7y}ug{KEbFy2N%{Vt!cQ=)T6U)e|1Tpz2aK$HRH-#hlZ%2OKd0 zcaZn6p%POULDnj=ibx?vM+yH|(#M1?lMW|6O6(xMJY$)>*i5xmKFQt>n2(=={&OzkF~1IpIiCEa&A<`^i_|# z<|Jxb9k?H0dI}mIt;sO$iktK%_um_7Jt%yi>ZYgxTmplT5xC(G9bY^#n(gGPO>{2B zkIYI=0gp(hAWizO>)8021qgveglz#60{^lUQg*%4aZP50Xt!v>&=8P6%t`_)76pjm zW5ITQJW@bA)o+q^MLxEkdw`z9j-Hp!MKu#p39Mj0U9nUYUrV4#^(kJqp=F*@+KVZ0 zwVGvtDt#;rTVx=RIj;C@ROCce`7Q1gT)TIWL*4V!R~7n5Y(Q0hF+1oXYA?eC{b)i{ zs4j<+Es`7-%(%4Owq;y@Uq{&>H&|uTx**)*)JPH&jf<8y+EN~WZJQ=?_0|7SJ-c72CTe{;-EGKdGh4pjp!CRiwUMFQ|GGk7V zVqNEZ9LPzLkhze`D^&AiN|k2|{w=#*v~3UEknYHid?nl(K>o&x1DpfuGC<{NH&BFutp=5eh!VPS$$!4*5RUhqBf-Aa-g0wJSEWz2LyLe)W`UmI`wu#SI#FvDr|oBc#@Y zDR=U(`gml{oR871uQ6ldDSfAI8N+`w9;wkRSf#C1cax<5t{5q%X13r>PETG3f$FMa zq6+(H|AmF%=ufR#+&S%=>mb%QHmF(sgGaz3ftx1HdQ#=DtDIzw>@;7J|uVkM_70lXgM_3<j6oJ;++>46^EO-&MwvxW6N@|HrEAl<=3RdDG51bB;ouPP}us(hz1?9-oPl(_waC#b8(B+l772b+Glo3YpF?R~Y!~!cI~l5_H3? z!PG<&@V#u&e0ot(?v361LE}9~*y$=4Z&fgV+w>MV4Ct@6SR3WVF7p{9%~*l;NMEgu zan!G1DD_Vs&Ad=I{Ac}x`xAIz7nz)UW-#gZs&4H9cdKvM_QG!TgVpTEVv2nE1ySg_ zmyXyK9<|CP_Gq$5az1Fqn(RQ~;y})4S3mk|L35mKIreEHR&4+Kvz6ge$TE>&LuOI_ z$@A~NW!E`>hO2bMMcA`xzACEp3zVKcTXxKih|KMe&kDBU49mXLx-XrJ2z z`RL6$>3U2z8wD|*MnG8BAz??5pIVe`C_GUo)=5J26V$Y{e%qguF;kWe)C?eRm<@7pg}c?KI#a#Pjqa^t}*Qb6r}Cp=t9x1;prbmq3k zY(GXF9x_+B#XirU+SnK5xDv%cDe2M15O>+Q%_6Q*Sw3VVryJ{s)2ZKt)%ujgFGc@< zJO!6&5Pfry>+?+|90#)Vrdiv{)EXW@nXSTCGZ{bEdzBt!S39QQKswaZm0J&X8%hrf zzR~MMy{1iT8bl~WFEFR)SBpGkPBwUY3I!*wg_L~5fn`nJ=sV^M=Pt`WIL8JL8wg_2 zgD3>t6T0137ko_YCN8N$rW3q-NG-bJC>0k3gYCH>10-g_`D6#q9ai1!0JXhYf z3TQv=G38f#3}WZZgodm_N{($Gvksp)yu#1WO*Gg;4(rk%drKmZ2+CG~aadCHJ+s6F zI>9#G&KcMtF`4HerU0#JeoVfPEPn3nT;F^w9{zA{2Drj(SeMhxX&GN%BL#|`xfdKl{8UOFV?Jr&o-kP{QYvnTk&!LYvQw$g|+_l zMCF!`gsXWpiayz~Ola;M?luXjNn=mCOu&P zgV&3|q<^o8c=0E8n+soyD7IXqTcZI?V&QUUszX#euk+AKj7>Z`eDmUcQ4Y*sJ#rk7 zQpXS5`HlPjhCclWL^vc0+n%xr-_unhTg3fHy06*_@9**dHYkA?&63dDuy<4Gx&5-C z2$*?m@L9!n$JI`ekQc#}CbZ#-!sw&#@bqs&-`TJj{MtoQg!|kvZ07H%yfGE`gwbAZ zlsGjAv+RLfL8Egp?l;};($Yvv-zslR6kO|VG6;Wg@6tmTe0(yEn`bX@x=`425 zm31A>xHE+2dkv-7z&JvT(7R|1DwJ?!qVpd^`)2E&)86PVisbWn4XX-zI0+OXc~m?2R(h zqAAWDeN_J~8M2)LP?X4!F0CCru$$V3do%2z=N<{$KdaT{0TQJ9h;@(pF7WxWD_-Pu z(EjG8u8G`2tN?V3kF(qog0fS418c{?baVsN)pN$D-Mn3O)qk8G0B4$}QP_6lt_MJGjdCVm_U~3Auf!DXx z1qTq{iZ;CL*&elbB|QL3v8gP0`@ylie_{nyVKLY2bB=*MT{?Mt1cHn*;B+TH();b! zn#{%dNwhyv{rS+TzU+pZFSX89zKe^*E&Nce8wxT=kqDl#$D7Ex7*1A(L}lB*3FYIT z_<)-=W9P7WlwnV_%16{+p14^Hi&BJC{=};9XF_~O&YXy(JVgacpDTb}9s!0r@$jTE zH^k&s(nbIJ$p{naKiosAltcCTu$_E{G|7h{M$29TAn#j0Fg)EKV2Se$bMXLtIoZgv z@ZgE_;2;hS;xl6_`y+iG5q*p>eU*@-4-NQ|1As$@BZ0$pptIpB`gMiTn18z3T#Lj>~LJ$4oI3kAE1& zjUzxRxrmy00BV7mfL%|9w?cUFaW-$MMC#GNkve%|4viA(xWrHrvbJC5@4{}SfIz!u zm^*DbQC!+zW&GFoX8fHCtjVXd?0o3B7;vzL z-Cc#E@W@*`=)Itss>z&9byMAlXRPk^_Dh z<+wtJS?5{Os~PPz@hqnu4I;rowj1W+5P~x|lL*RBQX_yVu%UG`eM$40>{YyJcelq& z-Hh&PsD$sd zu3`-dTjbYb!^4t}b6>MQER@d?m-sk_iVWUVXDZonapAbg>RWL{3NhU_L=Alr&|p4G zhJYHFYQogE@7y!Ji9A9hi<6g_M6v2M*$u-yBT3zCo{&AUe-fTZM^6)G0R2VEI z=U*X4%^o3Jv0t9sK`92FltJQGHUw4zXr^fX@gkfkxX<)?f#13wzvxrX+M5yDHSkQb zl&yvX^!iNuky{>1=n-H7>bLbwQ^0_KJMq z8|^@6rDCbB9-1huALpU+z3uVK#MVY2rel$`pDa|%BZAnxVHwx2x*D$`wtc$zaC5mKmSVFA>!{3UE4rs!xG@3ZQJnT3&dKZ& z4V!H4$+yOTBJOyssF5Y0r^(u6Lva!wY{TwLQNBpww3#bfsrprLp z&ZN^<$cWB^Cyp17qA3}AY*+q`AzYzjTJ~xbIuk-l)3Z7g)=MI06Cj9kOUWw?_lb`c}gw_d?n*vA!Cmdr!}p(B`KN8fsn5YMVzvCo|e^ z=FUoUwNO|sSE_zI#2LYm5w6BNoedhtKhkS(^q=E+)uWucdnYk|235FH94oEn(%vIp z#wd1*@%pMQz6<)cA!fP*Gzxygm=fg9uL3fSNTLa~+tml$T{#2utpQ(R;+#c8uL;%c z%>eM|=sX#vcJm++Qo)O*dwwu!Ii)u>)9s{mM!RTQzp_06L1XL@Jrg_Rtrn$2@0d0M3tlUm_db6#U5WbtS};E<|1D z^ka3C6?erzJ?5-1HQZlA=Lg9uwJf`UR|1~|GPh03T9?r^ z{4>BQDCN{o9-XN@KI3;A&t-5u@d9vh-vOz4nQ!|ZzNz=BI4sy^-14MIQ6};3e@egi zoGvDR!amSp>Lpc-tc2vm#BXdLnIX2exn>A9<^C#ke)646C}pr2$NINh8SL>js#NsO zXYvtiDd~XlJi6Y_*3=OOrLQYVuaTx%V0I1rE}De%Nr4nW*_l=3?O!GMee5o|_piYg zrGWK7sRH3d=w9`Uc7u>ucmNVb>@QNV1t^H>~|sonIk(W6rF z`EDoEPa2ns0L|pl;#05bZ+?%Ziq~zK<8$d6JvQmO*r2cLUEs!=z1LEXCSJuFU89RH z(4yt4bS>qAD45uu)^f6Id* z{;uJ%DKYJ%FBhG3Z9a8wMFHDmo~>G#o8=Mw!w3j zX*3s9o~~LtDcv%rKWbqkhe(1JJR}-oe)<>~hJB?u*!`<7GlDoa9`h*d53b@Qx|AmU z=Evo$&pRe#v9s!buhf0Z^W^N_6^ymx7ntFshROmdWzZc>#?s^bwol}fG!7YWYn4vM z7o#d33XEenh4IU>0|FcAytOzh0}kMj#5#n4pC*jRKud~zfbQj&3Ey@v%ITjZ{f7m~ zX(u8~Fh&PkcpoUD@l*(czzn@l1<6gxwyrXevY=|OvQdkv$ie-*Y@TTLs!uRK*&Dx; z7PnY+vDm^<5sCWzXr)~-7UH*nbOb8i)1A_~ypP8`=s5>fn|_gH<#aZ0H`!fB|p4v8NaZ ziqmSS4|4I;PPd9-gzd(5pos=fE&&fN{#prB&6l{jpowPwX()G1kbFycf(|x%Z{RIU zCa+}1;NS&yh}9|}Hx)LfYE4iVzAFjQ>ch{6%_0}6Y~DM1`Vz8}#;&5A`*Bjd1-1q5u${L_P(lB;COlfbwvLCL2`US&omvTV2^z3*H z)!IdQATU@HZ3`SkM#GUZ_(koE0BM&sbM;qs@3w8kTy;jh`B4S2X4ITQ?=4@#f8mC(7Fh}v1Tx2Z+7>?-nmCO?vb;}8i9!wzx| zeB!Adk7vb(UfMU_Y+p}ik9hNySXS*%6ABSG^f?N4+u{D}#_$6Z8<&HY8^rpl(!VQk zMH%$UT7EO>xEMLF`=XBziH7>N<_@EV3}eT;g3z&NG%H6MyXfaaCq;`~yA4ov*|2LP z*8vy+ry=v`s0}RnSZOV0)`%`NHStjZ|4{NP=AdU{e*k%o6cAf;`T%90(eE-ua23n{ zz@GWKInT;Gt~J1az;)o!EJ%Kivvq#@Z`YH;UOuLA?(?6`~D%P8n_Ov`@;Y)L{DkP0y>jJUB@ADRh-;?VF)xmF;Z@-j zdnbPNFEC!ftxjlV%!4avWcPYN%+Usw$cFhj{&0lA%#3gB@xEt((aK6{=ZWZ$6|c%Y zExB@bVk(vg4fjrY&8pg^%U)j=UAo8lSQPIB%M5zMZDOn(@_E(NKuI4B3}x0KIyBN& zv!`G#!Cmzi2Id~xqFA(04F6=67^SBEZ^jv0ggB31$^fEam*wX^3x07<>$+IYf(jH5F zdn+64*HT_~E$r23Z6{PLT|uI}$C-97OG|PIVTXaK$&Y(*tp;QQJ>rSMn_F>JB8G{~ z_-Z9X?CAEnlRZ<@I@e{K0xP(`>QruBVhv^js!sANTA1(h_iN|zRk5;kXFWO%Ls@-x zUg@qL;aDI(1c0%DLtnJ~O!3D&BYY+&Ya6%NR=Ys5CSv+>yhQR4K;jDMLTpx;1#Mgv z&NqK!2&ud^tWeuOtInlGWrx7IG#01fY)F%$LS)_1f^~|)H&GIe9C9&aS*cC&zbm8` z)tQ55;ohq*_jaX^aHq>vsnMm&#Ah7&>(^M_S=A&iqnGp_0;klziFq>rFafgX?WrO1 zqjLa*UvS%^7QZXkX_Xam2g@o(S+s#Fa{IA3f21&?Adgff?dg4|5ediBmb<`~G(J1e zqsCG|2EP$dZ`lU*M8K%0CHeV`FP;JWk1hy=<7Pc9(dTm++*P}?-dzQiR|9G?gmmsj zZLPY9M%0Yyj#;@FLCBSDyVC`oza5iUy^jAfpW8~lX|`DTynnU5339Q`?{;I(@bxs& z)T=yoY!+BR%H<>8nutISs zv=1=_5(&eo?xT z=(P?0{BQ^?(&j^Q1$06fFA4KVjG~opJkb4 z|A0xwL>LCS>8llDpbbsA69VIx>%Nndb8$8bwi{HW^!FG9GAfv0DbOOikd)(gnmwG- z@T9R8Q!jc`hLv})erf3?MHepSUS3cnA59U5y?D2s+U>T~uHPE|)@!RbuC{;ljHOMP z?-qyItU%Lk1?Da^cxY0{I@`AbjKLS`?}>d-gvtbrRIF&xPcKx)K064{6Ky?^EU=Sb zp%26awmRvg@yGs$u+(kcE05zA(52gY5BH$R-F+6!N|!7ix` zX4&f|P_cLSMGOuFib4%}KlrZ(HTCKyKL^Q=(bS820t*Vj{+eH9NGf8NViazx`hdU> zQl+Tw4fLz^!VV5U(j|ATENl@_%(<7%f6tiV%v4mroIOe6EFzWz@goz)MlmQ?P5D3)POu4$)kG zqtE%P)@a}@09S>!i!qp4nhX)fui4o~BhrlVHF!EZpI%<;y;%V^?kZHrOuCWnoCSSD4Y-x3whFwZ7$0X@7})F%c87vRfD1C3|H~Sronfu2xL+7 znw%i16?lxN>P-owROx|ob4+U)GYXcXXR3sic!cmdQe>E8)xbc&0%fRlTDmDV*)!&s z?ZY_G#ARBoFwRmxw$z6?TFZM~aKMDDob`82+#y(j67+GZ(||d|SB35uqOS~yRE0ji z37k?wB_MM2d?&J`ISQXq;w2Ywdq#cffnZH0)_=alaAOD*zlkvRi6T${zOG385ZWTM z2Y7LG&%?xS1h;jfOo?U!i1i8$^IVqWe$m@;-$({^E$ZeQ;!_$t8RdLYZ}hkc{!F%X ziUAtLLCyUG&_L}Y8G(cp@_>0N>^Xzo`T?>Gm(wBm_EA3u{+6;{h0T4TWg>p-j_rkb zcsh&NKxU*{i0}p#bS%w6YFsVHr5bX4uNw9njhgN%0vY*j*=x2eZaPC?UkZe#`Uvpt z9Nv)=etBY-DhbNbgZ-8mYaEY?KfU(1#DyZsGnlZJdA-ygEuRkasR6`#$7R?xfjr7t z&mo*Vj;l{f(kQwUK_UFB9Rp-?^V1*T=TbOlS&d&+3+AIg?fcqHi3sHmNkGSN$25;% zQ6}PyyZ&efy=wJk>_t0i5cbIvpazqR&$z0fvPPh{eRzPV4-nRsu}VR9LrId3Yp=vv zKoSsUV7~$HbN}O;Zu+9*DfLT1fir)IqK&?U^1`OEn$QG4hNfHa=aY6Qj*zInxnog; zz-||qqw=`1S_iMU;ZaTdnm#P<&=Xn0|V!J_XH)9)B~_D7A~vIT%0#E^~Z{Yt|@pl#9*np zXL;3~BXtwBl#2^vHUk*M`98%c&_teJ=0$25G5jAC(BrEuP3_$Ms0%kTJ&plJv3U(l zpqBfs_<1ISRxKnQXC%z+`fCPw8uya_eW#|ORkjp16Vde1oi~aZd_wC7K&eC3sLMxU z)4~{Vk+ZwlwRIB9RA|d-qYGwm1KF|H<8HKE?+uibB+>PY(XqCr%dEaV&U0eHB+Wki zO}L`EX#mT^q3b&7ucQZ_NI`PnyDxZMj*5h+JVL@GO`OC3nh{zFq!Wqr2BfAMa=_&lox>#$}yJtTcsxXmo*4f@jGss5- z6(2S_AC+qov|YiPS+M!lr zq%;{gZzzv>Rm%qB(&Sr3PR2leKMpt;x=mv3djuCEA2Om`y1=|Hc&)E>2-Y!ND-0XE zvbDLe@T9{%%K${36HxRm4|j32*`>6TDmiVJX6G>D<4Qt!REU7oVJZC<^mL)GJB>!~ zEEVRv8>j#hW&jGcs1e9Mod|(Spl9^dgcM?n(0oHb- zZ3FASX!X6EDvu}+;Zz;jz{Z?qn-MhK|Hpn=BWUt4kWnCtteH!1^2Q4cy@X8F21wJT zn2=zwg7iQ&BFQD~xmGK1q)5@W`^2p6UXM9ywHGX@d}^?ag+7bj z4S~<>ere2M5o!I9jzzJiw%n85%#f7c%C#MzXYbk z)aqJzQ{|iQsNb4|cgN(@6XMeYL7_;4OB~L@+VQEf$hcZ%623#55DB~@HPIeRAL{Ui zCM1O|&GHVBEIhY$RGUf-?SuEfm?y%lr1(l0k*}jhO*@YqKGs!Y2b9lHGEfvvmSeZ$ z+$zi zvE&@$muBN+ceTpt1{pcDYVH6kj3@!`mqAWp)ezTM(!N`*ZxeT!sooq5J*^wq55vA$|*k-kwuSDw%SGUQI ztjkY%MhYcXYm!S;54s0owNr3KNK*-9+!lm?#Osms+1+72!xlzL)*f?GAi>vv620b2zDd4Z9c@$V)ROSBQl4#CPvpdNhVh93I2yP66uytts1}6 zQyd<``~vT)U0iq(!7?FbtCSvU;0&=XtF#kKcK=bWRdD9TqYy=$MUP%)C~et$mkdk!9fx;rHNoPV^b1X;j8n*SPam zBCm@vfAR$Yzl`REzVN(#;QrR`ZaEBGykGiS+(b-~;B8|18JgN%uw)zXyIBt`E`@(w znwo?zo}bZe27MDz7a%O_8al%}boyJTa2I6?O$DLwjQ68>1!b3#`$a)q_Nvc<5PUW^ zPcmAKIoKHVp9-pA16rv~`LFslujCYLNn+UuO9vDj7k4@`lK7p5$pJx8@CcKuM{kbd z>U8me(Dswplc+TuMG^LSW@&12#sS(uZS)#aSi61#-*v6c`~&+F;b-6d*1>B=%Y=?d zZ3E+r8Vx4m{yMV>vI+x(;8U9e^WGoeS7pAHc!VsYD6|$*u{Y6s7bUA&TzkF;rFqmZ zKg;+^N~n8X$l}dLBn872?#g=q1$&Igo-j?b(JQ4fNNbZ4Oo&CRpH$+%x8Twp{d>e* zP0gwC6%pfoJujj?!Il7#^ zG7F~9_RW;*^kW>#+nnJi_+qS%pA;K8VM@m*Q#_t-FK%-o&<7@Lwws=wNekg~2^eWB? zPew*|_oxO8*!I>&2+I3y=R}U8O7`k6y*)hjvb5CHkD>17k`2`y%!)q5vaJhtW{umP zfaPJA^8v4O#ixmTaT(Qtw!g!qzG@|^rH~Vkxn15HsvW%Rhdv$>V8RXuK23KK{=K)u zU~w!?(D!52ISot=vSG)ACjLBHbwbC|`DDblfVaJk)zWdz zBwm02mzu_x)W+qh1ASLi9Rl3z)4Jo>zUp7x5+%B{9-?*ITyAU%96Y4DJoY&|W_Apv z+A!`@xceg?x}TqN&)WXrZFjsI8YId^Qq7Yy!9w;92%o~Gio%2Y4r^UUH)CLy!T}d) z7#;P!Q(z<%ujb3hV&HOEaO38*;)VO%4qwXTX|40>-B@s zM*-vRK{Q?B`thtT$mpr+OpDO!gpoeB{-isIHMQPQR-TW5nHvp>Lu<8OI}A^C((=#* z4RS+y>P8Hkfcvi&+R*ul=`;v2`gEekD$}9aX-60=|A{%&no|_s=45MXDS7oM*tbdD z1u`dp{6+o>OhH94NdY}J(FGOgfw?bv#2AmQF;>sFVLc&yaLxN|MBPq>cFYA`WIuJ{20__dL zR4Z}@ipa3|0UF13aHWt6K-mE^ISn%D#W91#_m(3a>wjT6lINGymTQ80oZ53c!u*_L3R`C{~+MFbW?8RW+d)-)aeF&$O9JU&^^J9);lWP z>C(lRh9d`)s;R}S7Bpwr9OmQ36X*GgaHJtRNPm57hq?iuaZm?QQruCg{9GM@M>$9RJ%9RY~Ls0Lg<1v6?*bJzREqP zGd99IpBt4I9%WpQ@>M%9*t}dAz(AEdI-%jD98*BH>$gy8ZZ?$g+J^S+IDjt{E@YaIM|c>HhfN0A-2inI zfOi=Yq+0QZy57pV2|&~C-K^M3rB?#1JFGmLE5gRt8(5MN0m^o5n1ZKfB~vHYj6Z*d zZf1Hq){Hh}4PwmZJGCs!+`xQU;b)+`MC(T;t>Kj5V5%T+QGzhN7O$^Zg}5RY&owwB zfVZIz-CCx>Hxnyfph~s6=q|~2HoKXV;&F7+kX9B|xnSoq@y-j6O6)Yc#4sbk??qHbTqStTP;b|mHN^4yj#Eu;@z=#5MRnJp0P>o2XJxX){ z)W1bB__M`5(x0UKZH`@1_93+jitVio4pAPl(+r(0qwr@V7V`Gpou2|Vh-bUbU!9?9(JH1}Xr0dy00q*w}FSICV(w>QNtpFMCui}e{^N!siGZsV#7VnDg2PuEB!(Jmv zvlMjFdr)3&O&p)|gR=r)3}!2$SvJs{PQ^B zUkA?4`6`-Od}wVxbX^G(ZHthsMsW*NaA+5z7Mvcr3cu-yG%vKo1rg`r?TQoo`|z&P zjp^8v6Q6yRLxvDd{g`>(=978Dje+7pLAQqmJ>*{M~exA|eYYv+a087apnTVeG;K9%@ z`<5J3T{&h`c?Na-IB}4kbT_+Y5L*7qxNhAg?osXoi!5Pjb0FxA=Wyw^* z$zFnqkQ1ZEqhD1Un1!!oRP0+*iOsU^Y){X0kSKB>WdqR^!G1R9YJU7=2^DXq+VkqM z*;5w08#ZyZA{Soae2RU=a1n%jdfSK`Gt4srAd#Wd%O<<`e3l=4wvgE$*s$AT#xZE8 zhq%mNWZ=j>Lz=!70YVZCk)(2NYgNa3R=m0}06}#iI&dzzf~MW3u_woD5sO?zoGQ41kJcgLFBApCsZPo)SLgFDkLI_A=@* z`buk`&Bt>LXCIFXS}&!}-ZM&{)m2xHr4R5XYJD`iuky zLR}7~94#`zI9nMAB71=p$%>(=KqMhR$YvPSa-MD>-u>j<*X;4DrAI_*8!73C_v|&o z?{Cw^dN9R`$+8OfO5xY%LG_msuyr{Kk^Y= zUHc|;Bf(zi`>H%WlO)>N(1bc}3FEHd#;Us8Af;GE@L3_fgvAf1=TqC2)jE2Gr?1h( z^4^4%8ekk9C846b+aF#V!n4BrO{#6|934ms$r-(Fh77O4P_mrY=|u9wc|}59FElxs zH&rX<=q`?v;`m9NhqA`l%FAoBs>Z86$xYl1VNhc`cpdL4WK#171j0^Qv?!YS!Q~0O zEW^r1!em-mKHF8aUeXGGRR^JH zLZG7}BulSu(ob_6`JxpMyf3BE{A7z~4{x%m@NHKrP!m%E*7Xky9vz=T?^!jg01rIi zu`&kk!WQ2f%LBF7j(NRj+sDB;YHQ60HK$o5{bx^5i&iCk=s`TR&=i;KwNkQ(n^sAB z3RadQTeF)-!TIY5k=z0xSi#IeB~h|@&o*Y5IAkYAb(^TBuIeQj3OBP01DM^(@3fkL z+oXvko8`BA(Ln)#AMZLaDCjG?75X+26QFV#b4+Bva!Ew!zt{i(=BQj1GxI)YJ(IbI zAqzSaT@gA}@(%aW*N384T`bs;Dt7FQH{R?M_S8vR0{O;YK!P!LI|K$F<2UUZ#z7u! z(H=M#Yo9l@bM_dyq4lwZvw_sCEc4*0qpZTb0iLPwB64>yK@5fQs)L>9HqKgLBps%H z=nZXBK<3p#Mh`b$Sz(u{ERG(!%P~CC)VC#!v9%PUaYz=L8rg@3_{gcX?}hqrz848E zb-xU1=7oH=?n-j7nanK9FI1I|2wMDi_i3Oc_57c$?ju-z35fPPxqndgzUo+EG$gQ= zqpi$!O6FX<)oFEvuDNQ-djZQ_F;UR4LPF!RvXjLcoMyU6XvZPy#`APnoCyEw4(Y+p zST1YdsQ@g#nMimUedSSx+#_?+8?>%pjSJ1WnBH^H!m<&;A8OaGEiky!Qe|o4#K!su zsA-}iYX8e{n*s25)1Uu__3GPPdU8Y_Fa7Z){c#4o1gRJ?7vO;z#Vbu)+q@~M=6xO~`Sa8Cx7(lMc1y$B1(t;MztpON=0a{_m0?|2MnWW9^5Ni?l z)WTYOc7P$T!Y7J{e+~awQ{tX}8HOVkC&qgv!vSbGPxRNp&J-hvmt72;JiMv@K;1MgX?u>lasSQ@(1v>RVO=DPaty$D?vbPrdKRSG`7S1ibY#{BF@%tBx}5KrLW0 z!d2L%cM`fGE2%<{Q4C>K2XUq6==nkN=a+kX_oIB2f<)u1=Zrj+KD-MFdv*Wp2%Wmv z3LY;lr_n(U-bZX#q{i$%1Ecq@X%zS~!F;)h@Fbx&6%8h?d4(H#g5;ep%gl-Le0_xb z3fr+uGsZv3*W(7`J={PB%-XS}l*P4Sun2Qn)3Lg%dvx-8FfX_yNvQUaJ>8~FstCRu zUI>#6JYk0rm5AwAcpW#W5R^!0?9};ylo*!U zy$F#b%I4KYEX(LZH<8ABL?~6pu&u2RqM}XTz(u2SCmh z&3d_bqV-h*JVex9z_YI`Q;v}`z-bnwT$W|a!Ly?3z8(ltP$t%myd#t2(aQb%6K&~r zGUJ>w?bR|l3B+F1n!O~?@=Hp!4S%c`-NU;U3GJNhju(OUq%*;;k}GOqm5|Eo~DAdNT zL?Rb&gi9ZijAM99Y8mrH^BdBoFXA6tHF3O_z+@~=8xY<>n9}Gs*@K%db5$Tshy2Hg zMV!~vp&2I)Dh*((@9A7jyqjfzpQ zqahYwu{a*;ePzBSg9+-L{DJa}Dl9H9@MS%E7Hp=RzWxdXMai*D1eHZi_dmJYo_1U2 zI>B(1Oyq<%eNdBrCN*{W$(gpAVi0?`B>E!l@7GTWvHhTAW5k=-#lul&VUN?Df1v1$f7c0 zi&4ROfH@VFM|=n4XdmI$9OPn{)0d1?bN|e|gH10NY5w>Kh4$CqdyIm8+Bm4km)xVm zGg!Qzf&a z$YCz@6qVrHL?=zn%1{`ca=|7UI&RnIYk;i0YO60=z@BxCq=i%PslXFp1{Mnh%J~ET zQwy!KaP|qA9I#v4>b&TyVTeu1#40Z=0$-SeE`+g`6 z9#igZe|>(uq!Cw#w1Q6EZ44YLo3gqr0X+O+R$~CXS_UW;vA-80%l$5k;X(t}r;~Hp(1Az;fS8RY;l^1kXY}sRE zPRE3#2ENF6lFzH$a^*HVht3*5a(4^tkpX4*HT1r4L6OXpgr2piT8h?1Pl(<+kbI#U zwDX!BnTNhj289q0>vsxP<>%65)->a-LRYL`mfKsuiAj{kS{Yr^N^Cvdx0`6C%%{A# zmb1fqf--oz&ll)fRaFJNTE5PiLOyvp7n)W6f>=Os8N`B12@cz5{(EG|(41ipp<$1F z!zW1q?XqhU2bjPk5BO021Psxgo5#3N;O=1?YWWkIw`7AH?wtV`OS4)UD zLKWUspscg#hq1X1bQo8=?Cy%3!AxEr!@`=JzqcZmm?{qx6fEzF5Rey0r#H{^;Q4XK%ofD3o@Nh`T40l;U5-nxJ&GsfE*5 zt|IFB*Cf8!iFm7()XZmGyy?YUyN^;3YB5@7K_F~qlEd38d&Zc)@MeqOgA!Ve^_|TK z!ivx3%Oi~ex2#Ln+1nW6p)(HVN`tpOG1Mdu!oQnszZ+nCn2x}suHM*}i?(>BEtw&ROLMf;!P6Reu*xPG4}KMPd_97;E4cpB&X^V$+dBMCz&cEf{Hau})}I^47gH zPKqq8*o@>i|c`!kT-$*MtKQV^1=(f30>qzK|OU+D_G+N>it$Zn6APAbif6) z`!g{3FXq$c&5`phce_O*d*}-Qw5fAWu>!B8*4KO+kiuGp><%S+M$rK&p(qM87D)(e zH$U7p&kuKY#?b=(gfh94cWecKh$oO=ex1<-fr@iA#&?%KhI4o{|;7X1wBU${``_iAO~lK1c=yqKCxSQ2@2iv2dQV3IpkN2Q&V>X0mUw z0r)M+mGLfy5Y#Nu>w~5iX1sNET*w{|C=Yova8fm<4#TFwhnk^uu*9#*v+)iIqDO^` zi(V%F>cKM5tRM6;@;E;>1)k%b{JJF`>d2z7rp*Y7_1BH^xVA>pZ++(Xi1cc3S39IzaO^z$OZ?nE* zny+sHuj#BLvWybbZg-wJ^$&_VPVxa9AjJHi~@7BHF4@JmR#-nJkO?kMB)(DsM~b9`a`ZolJMEBcfbpXkk}L@)yvxv(iNfO zB6Bh-mOc>%946MNk_(^au4a|z-WFhO99K%>byRm!rReoBH>@h3Srs9IENUE601D8+ z7^bbF4SuI6q5?Y?a^s5atu&wGt|hU%@0Y*NQ8eUAdtyQYlz@KI141XvddM^OU{_Hp zJD%qFryAjLxfzyFl4YcxPX^)1 z)><{@;H?_-6agLetan1id;jsNoJ|D81t4LnJxH+|hHhqS6P(v*3Ll#g|BttUuy<{4 zkP|kZxMAOse<^(a%?pu}?ImT(1t5?w#K(56in)EvJheyq0+IY@F5gWx6Yd`ur5@LbsytGZ`rg&4)_-Ovr`#xlnHde-|>0L(t z7703Rf1Dp)b;XC`^73*aBQe-^vv}U~p|DWOeeDMQGL<6;5UJQCH{I|&ecGQPrC{PO z14^ig3k3l{6*@+e<@b%O_0NeWnfrP~S2NkxXrB|EKps!~BvE)z2Fm~d@jgcdDX%0F-9Yy{Rv@MFIT}= zMa7mhrH2=tOeHTR+t5L6gI^OG1J7P`{cz9nvWtsc5TUnhv?Q{%^U$iQet{3T-@3x|S-yVDaDV9-*UDqQcDHT}rCoSptdb{vpPDawmFA%)T=-Eug#; zdz?S2?^&leWH-%w2J**?nSc7ys-m#{3Q3Y$MXV*M;%0$IXhf{5dI}rj`U;lH#RbxW zJJk_`Wg`0YI?x0vQb8i~KLl?YL8gPYRgrP1nr{N_JO4F9^=4#@S-v*_z$44!ATRJ!sF04m*ZvQ~)x*7qvkK&VzL7^*;zuU1cF=tgr7SIecGau@;H08|af|%A z>ZyaYZ0B24L5RuaM|0Q<+2J9We33?{>dh+L;+lqPI3?KN5qIGAW4>b`Q=qDOet`p< z@}#=4JE(>x9zLYth=di7a2(PreK*$;b-Jf8To$>zBT{!4AlG@CH!Tdc|4z$eOb$rN zE&tFJXqw98aLB2nWK@Pt z1tO=qz5r&SoPv=HB{EY5Jm*5q!+y|QcsqJs?3vyBp3_f~(r#-8%i?^_(RL*Aa5aRqJp${qIZe z6~Uoa--URJ6SYg--ANc6C5E=vK6@sAh4Etp`chjzz}V29+&Y*|&NfDj2|?<;xV_>H zX_}Cp%XUs59_a3c_%g6++!zbRp6}_Zws#A6Tv0~4T3Td@SgK(p-RKVd*o=N1!#3N` z%b55xSF5yM4eE>U#E#5~WXff|S^2EO-h!`FeDRP5GPH1>PDKPo_oLWjtvYsBHn)!S zhzk<)7zp-pg{7l{0&|QH?Qhw`akQ;VfN+)avmv*X#oIXsrd7%BL|%?r4fz| zb@RGLl_Isd6g^AOAM);?k|tc(Cj+8G$UNK0hu29G=jL`fK7HJ81T9ac71k=amTdHT z=sZ=${;<9`KF6B44(K*#G6g|&aV#x$=ysw`10GC;9HN8{xClQ3PHi>~54hqEWY5By zj(0dKu>sN9_TB8|nihph93q}8yypmdk-`q@vZM8ubMdgT3_E+E&VmSBoj>JvEvxZdzHs-ezEGCL+ncP1Gqw~I@MMoY>}FW3N$Ra;^&?p; z7o0h!81KS~!{O(~)m+O*JOJi(bD@wOWS6{SGT5+W{#mNDfFdmy#iJWf`H%3ai!%HE z&Py~3AUbkv<{1Dj9gx4}_io8lx7f3wi3;;Zz`vTL4)4ZozkDx^SNuyz_zYCNiNrR; zUkM2r_9!n(0BGM@AhC{cU8gVTSuv3k3;V$@fpdXf3e=G^g)0-ZR+a?kO!`^5LGP+T z0bq0Z>^{Q8*Ieo(R+bobhRa(=L&Z#(q0AM@^v*$8Zg_f38aNgOs9AO_ax?I_L~RJ` zfYqk~Gy9bK-cw@mj0x1R_f+V{@v#}XIV+CUdKk9JaBs*G<4z?^zW!#K*w4Xz)GlY2 zRL3HDar+V(uabHb5kvlvB}-k*2o7_Lmr?=#EK~fz962T-G{RTmZ6NE>4|>hgWIh4X z5zEdsDE6?;YP#fh>|(}&_XW&`pS>{zaD71CUq`i@8Z2&B+Xm*?p-aa)x`}(#nB}tQD1Kb&f_EDi)1F9j`h5^|S28}u z`>Gp|jTB#T8~Q6ShmGN;)k$4(2SE#8J7Jsd**0c4@&vD70N<(P>ow+*r#k$+keK^UYX9P&h(`)cO%Di-FktA2h%6Xt%I2Bus|iz0(L z28=agR(-)`@gMI%-FrI7SAJG^g4sGP!O;e^T?NOV!bd*Xcu%t|{_PgFK_8%T61qd7 zQAg=dw#(v@AjtN>FbvK9H|%H$(q*m&g`8_(5=nZS@l-xeN>ym-+M-3wYH+Pz^eH5J zgTe?iq$1^y9Znxw5b=-E{+Z7=kr)QGX3$d3t$A=x_Ud^sJ_L}#0LP1QL}bUMf(TC8 z&dfzRSFD+ab}X$2S1!L=<#fa1NpxfUwgb_#QnBR&$JvjChY2k1AH1k!xq?%)F%7)Do9q%b5Pp}3lgjX_QL zHWsmK$H(FI*5#cZqxnQ@0-fe!cOe-@EM5Etp{}jC(viF(Qtt8uQs?JFDvBKxT%SeD z<~r0_bTXTRc0!2nA!*kEA~I45W{+;&I`kG1bg5&mE6}}NBaka$=Dlg*skWLNF>Kvs z!Nlou>iVSJ$|B+Z>cMM`4MwHmZ5R$V36>^?X3P#T7k>53C^}XXstUwxGTgCH9m}ksT9fd;>rmKU>YTzrjbXfHCz%Kxot+>@eB0noh_;}m z^VOq~kU<4E(*=EU15RJUya5ss72wt3;EzV0Hazt}UulK_rt?nseMu8(r3JD$hkiHU z2HeC5JC0AT52#p!Iif^LTjom7r8NDs@fk|M?1kJ))p(-5)9#Ei5FW++qeBIEOoinL zP0m!(c5%_ZX3kf5TO@{suYx(4Q=R1=5a<1m8wm`_-GI!qbaInCBJ= zq5U=wc}I+}?rw}>p-}q-I{QTLXggLUC*YfvN$(h06kbwLX=hkp6p9?vwnDjfRCvsiJGL`!9FpATfMn2Q5rux0W0`}1GkLDVop zt9PQox}g+Cy|G?7;%b5w!>%8$-!o+4PJ>}PP6bNVTs~_zmKebQfWO7r428Y6fom6w zRgd*lD#Tl|mxCe1yckvp{w$Xa>%`=s3qZ3%k>o&iwyS9e&GH&^P2E**KZHA#8j`b) zvhP?L?0IN~w#p9k6&|WBb&Xu4IuRnpg(&UX(w~m$bl|BkF8$yH<)S%ILM;K1+-#5e zns7wZ0=KQwzVg8}3-aIThi_QRBa@v3O468}L^Juwdo>y;V{4e3>;-=DF!3{?cxP;N zIQlYXBc+k`90LCTneIOzODcU zeM!diJ7!2?$O_?yl$AoK|8l;nUEGz_Z-r)bN4y)Q2oBjwm8_r)kmVDcP$v+s zlElm0N=1ZEx6Rt~hfWXc7m`a9x$hT4KPz{|-c`y**BI89{YTKX)2xsn(%RI4o$`uZ zrXUn(P2krzecW2~MrjwFe4%S;eRJ(jC{^~q&Zv^)KTxM{f_@qT8$&t?FWo`T8BrC! zUVyLYPT7Z(lJD8dto0A2b1Q*QbDVl!rI+z|$!c7(2T4SPFB6ddMag}jdh_S^eNi?q zyFyl1VCu5xjgy5(cwfkM8r6oI=6-6kb0kTyMnGyZWCnD(;8XE&i!QXxTo*Bn85h91 zY2)TjJtHq5*ZC)VxY!sqO|CLi?8A;7yj94qEJyS#LAln*N&n@<52PeR5|zi0O^lhC z=Adksfpk=6_|}U%+C2S)ByLJ_FXIcC;i9R#HGr$*c?>?!H1{kEFt2CnVGWGCoDx=jVJx{E2wrs`dPSZl$X zaJDc|9TuyDe+Zhhwg8aRc(QNE07SsOr|rTHW^YjwA-Uc99`$p zpZ!+YKB*E!CO42^k5#PkcI+#Vxhr$!I0}`;NDdKIfr@26vrJk8-K3Q&Oc2MrR-Spu zj_sL@!{6>-UR61lgWZ0Qdxb=`g&`+vBfas71ypU3W~Tq``@6~sK9oEp4Yp3!i# zYc>uce&e|_1po$u+3I2?18AVTJ4N|9YWDqyo<*O6*T(zgn94~xc)-CxRw$2E1g%nzRHQMRGMrU%{Vi3kTg z_n#ZzXyA6)M_L#0Q{SP7zvc?=W15==V3}&oId@@4g2-`{g7DmDMRDkZnkC2G1tC_9 zUfXF8;q)_zCDlzIXW?pyoCY#Q1Xi2yA`JIy(>Fhg{EgSO{Ue*)A$~_*!Ag?cRg_Jd z178iOzWdu;{e6WWJAj)Vbk)*IMHsGM+p(QA23#x_k)J7l;t4PjO&C{MoVnoB2f|As z3iSka>OHq*!km(mlYPk_iLpbI@f}yEi}gTYy3w%QYY2D#0_kN zrlRglShv+~45g+bKibAILvHvc>rcrzyULoTKiy z*P#hGI+6q9naGK<@8wzrwMc)<#(|g1Q%=geL8{cV6NfiPXUyA%1!vwQ#5~$Y!c6=f-PL`(3S_Z>$oE;GCr7ul$WL~ZC-dfLG-Iu z)#3&P3N=z=Po0Wv~-&)_okarnR(rV9porwz}g9%fO=9D zP@BgUxazOfSS6SGFCNNOhTL_?B6SFb}m4fZpC9Aof$g=Q8akV|i6oE+pLsRiCWHvK>w&?t*oAGv6#JwaEO zEyZteE9&Hu0-kcmToO)&@)ly!`bDc<8=C15$Lw_^vJfdEgwX}-c)Wkk2sS$k_1|5S zD`&f*)N|jccA%NuHC~3s3UM5ALPvw@u%0!6F4iEEsqFXa<;dzvQGVMyA2ZM*w%B_6EMsqvVn4m^9)SI5#XS(qjrx^2r{e*mI_m;bO95dtRl&{jevt?O{AYe z2$aL03fbTW+}vgx5Z(Q0h}PZ5|EW)8^T-axIdFGlIsxS zHPn$eR3u>z0skEbT3HPQ>vg)waXq8gz}T9f)diFYWCKcZ^wn`7n@1cu_T+Jo z>rpATWb6O4n!>*DKn5lcu;9F&$T;$Ch^@+43qF*?x0UC>W^|>K;g|U4QRah+6Emg2FgH_LQ8T5U0aSJi@{2973IjMq$zn!PcGZDkih4 z#uv+`j;Ad75304Jwqck_u2a6^L>O|fFlM*NN4%~h@f*t>D3Gh=3*xf`+X=#YDjN*A zkPgJSXV+XX>+ixVJoXSHK=V*XYeeoxM0%vaDUZ=axmGFHNF+Iy;InVA-*X-g0RJAN z-PPx^Y(C#{<0WSlAm0mByZLOYTaI4*j$B5kE+9|#&kzY48@ih@tr;kJ(v96xQ{Zp;tKXtyxMv#@W1*z@4{NJn1xa#tOn~^(KWp}{a@4$NQHqw=yOTF%N zih3vRs`rYN;`lKELY=>aXW6!$)~KB4@cJzQ^P`lE*I-zuG^Gg(Glg-64^C_Qo{mWdLzG9RU2yZ*2cqr>ne3+=24r&p) zuE6oIaOii>#UKg#wxbe&4^?kjv#QdKF|Wo}t)ia)zR-al8&`uA)*w=f`S(|GMiQNi z6w(%?*C(7&)|5PL+4xAdY^$FE2hpx?gW%PJ294o!y16B6=}d=`Rn*4--cc$Pjd2(4 z&aX#dsnzzEbjE-XX&uZP!>P9s`!Cb4;LFAQ|SO0Q4E#5ZkfRm(3bz@noYA#-;v7RMEZ%V%5#GyKY zl-k8l`{0e5Fp%Jp-f-c<`_kgR3~gAb^Y7lf|4ehyj6TvI6Xff)$B)SqulI?&`&AkG z;;g8aPx?!}p7aoLX&dV%Vm`fJz+YK=K>6zsDW2F#!yTQuHeGi1B@oGA#}}>h-kN!6 z>|T1_T&eZdK8RDVC|3kOTDKO6@E6BfmFJqCinPyAOmpdxY? z?4fRe-gSCCA4bK3ej{@7GP^38!Fd60``M4;jS9#yi2=S5Y+}4+4vHH8$18^hL!zJe zGf@3zn+h+Xgr(VD*eSnrFjT13C<_b zL-|}>28OGI+&?ziS(g(`3*-E@1+_eKPVdNScXZ`51zQriGxzZw!mye8>q45Pg5DC8 z5SeM7y!i~&&mnQMR}w28{t_z7@&p$6$$zYl?FP8UoY6;QVRhjnSGB=;W$hkqbRFZB z-aUByg@)L8L!9Ah*1Qzwra3*zjf;A!!FX@|pfRHDc!dJx1H`V_{%5S>?uN^=XuEzE zskG;$Mb3fPUg!Kq=1rWuhBbT_n8hz;cvwQHc-UR9+rS`>j)^u|QEQCn9GrNfol#EK zsiw$?D@ct1uPZw6%*cpBkX(*RzK5RgxTJ^@9a7gSgn)QFSHpLmRYacloa0s$rh~O5 z!-9^L?>PGkL|KfRSlUfS5JiM{OG+ANfv(zI982d9bv>kKU7_zk=zay4#5I`g?vz34 z{%7ZP4u5s~C#TX@LPgz|3NJzUYKs~{kcRm=?31)uj4+xqM zWb~%I%B3c^v1nn1Z`$qgJE!89YTcPW7~8g92}84>~?vhlB=W|KG;%E<%~x{{#BT zJ4}FmGrzF1#1LX~bPj!zW};V?0&7&9h1KgBZohKmzJqH9XWE55r=h{m6vf=g1#hyw z!V4+uD!Q9E*+}xYT^q>AjksU8C3X=2Ecq;AC<-}5eXFxu#LI9yyZA`Ao>17FAoaI( zS3>dEOG(oJ$~j0A~_AtzUv{Q|>3@twFj!uTV|u4>Gy zku}6>+Moe~uJSW+dpRE{PzCezv4)=DU&@QQv`xiwreeBS!P}qQ-M3^>h|9hpy$~31 z`E>`-lCWd|97?^5>IyshY5SFQe}FHSHCON@R9PdcZK2f97*aKnk)YS1j{a;M!)E5C zo|3|JL$y2iAJk1}@ynG82fro)L+rP`U4kQG=ZQRGOGCqp%gKL*MocpaoVyof;8k`K zx9G?niQ&!}r!a}YEy8d~C?XdyDY1eKeYP%0EN!@H`@&8w@x!H;Z!9FsJ0uvY=o&nSK#bu<@AUhv?kYZ@Q9vH;m^{0YgIK`4@7csyOn}c`tBeLEfVN z=2Ii+H-u#yw#6_E5WD8KmBf4Mi7e%QqJDTMP~b8v<>d&tFM=B;Er6*cQc=#~ha zSknGQpKaku>J(!}NZ{@!#>qE-p3eI62le6YG7{cJ{?eV91Ant%472Vvi|P1e1=|%t z9ILRYO;|XYcvrMUSI~?=t-HvI#~-))L5){N3X#$N5ybShZ~rw&eHxIV@LS3R2-*#W zE!W+xfe!ej_z2h4Dt9PSLNW$*b!!duwK<#6gVA)a$XFJc?IoKlqqhy5nMYrLdkBtZ ztVpxsd;`mLs{8R6!6%~RtM#;8bakz?J;q^pKno#n$-A!pw6 zg#0q0)0HnLWf%m3n!_M}-VAs5p-Nm)w$=gmoumZO({Kj2g1fZ(TY*kKzl~lDqJJis z-gg5vih5y!ly($5_x8zUU71(!wZLdl^9l|1F23%aT#JcA)K#?DdD>64;oIzGgbxrr z_ldND?p{hTSjBku{t~G5Z3}cF!S)XFEap|cACW(0Bi@^O4oTop*?Z;s?E#U?HOwhp zh;v~L@e=BdTpkm6``n?m@^#B&lZ=Z>C>IZit*;%GJ(au9XFR6+hNv~HEC0Zv?6Bl%B z1lt0y7;CQpYeiiOzbe-ON}Bbx{QcYyKQ~kw>Ar6sQc|VPI`B&Yojd$WEn1!r0i?1l zOpzXQHOjPq!EuI(=fNu8as(4;M*hDDFQ}pxqWB{CvTy|LHHM(KO_4p|2;|(T)@lSK z-@Pt8^25Pha&*#XTI$vUUau?7G1!gF?><_wnGf*a!eyZC4_GR@X8E?bn{`MDdT(H5 zxf~?*0~>WiwW5Sh%)*kb0`9bwgr$L+EIY~WIm05X8D5#uZ~ zh2dIZWUMo-X}rq^Gwob=Kd46W1 z+!QeWGZ)da3erhu`dRYrh+e~2eXoVCeAMf7;*rKsrj(t=GAQM4qwaB|;MQm{u=D+IMEZa)39p;uKL(}pGS$F(HsWPda{gBG- z5dV3cYSFLKDNu+nXB(CyA;~YI9502qYt&}udG$X!fc&^Ih$LycmZ>{oKGY6%d4(V7 zQ>_66TYuk_|2q=xo&_l<6;((aZnEw>=?3+nlYRE`w`ll6@-DUh{6|HSK;Lj6Z9b~q zC$|78cn$nRc}WO(O}AQm!kXl6_@#`a&u5 z7VSD6!fIp&Eg{H_Gs~ci3cfru`-r&%sp`d!Cw4MZ^{Xz6lV6kxD`RGpvZrRcmqQD-T)>7 zHap^vpw{5ogga|U;(4XbC-Ei<9snO11ZXi@Yzfe>N@hn#A*caIWUhlj2vJdB)z_f` zAa|VYqgm&vL1R+7kyvDR%I1ycet09VgHYp5At!XxthimmcaAzLYytsv6vGiC?Pl{> z=0cC?qagBa5Nhb{bnhQ}3W?e~Mx-%_>B6C+eDy=lM{IOf;+nT}jOA#9QcI21+I!{G zbo3{eVr)X0f9J-(F#IwTKRczR|)xio0W`ale6W^InNuR^#Mp9 zknP|F%k$0&+dGvQwtH*xG2a% z?qg=X(N$*AnJyLEAY^x9{^A1L-srjYZb;NB3>^7_n%%>3@sv@?I4({yId`5|ypREdi)Y4aW4^qPfLO;))qVit@v`x#O`gG@WB3;|`kXv@=Ks;Xjep_? zGs1d1>$)1R0tGN=KQmb^#9P0EGH$3RV#an%_u{W?&>#0G^UH%#U@{GqkM!llmClMMr8y4W-I&%1;23A7EC3>{0Bqgq!}c)1pv7;Xrw6uSnvv zhoAs$YiH<_H=^^)WPp^16hOe;QngXj`9lUjQkrJdUv;~>a12N5 zBU|Ns=QOC`8i?#X_Qixioyq>@(rkQG zu`7*PTMn4_(%y|_E|2yS8n#_h<(lHuWdft5*a)8zNGTPXRE57W9`(SgILM77LJ9dO zk1W8YD0Tf)s88L`=z;Fksz_#bl!xxbfQ@%%qp7O4kY3eRN6!3gWa%=SC{$h_3$fh*Y=Z6WAEp!4RA9U=1QC3`Cjyk2oJkU zvC_CbwUUH;-D_*uX^7niAMX4xTAQn$c?h%WB?zreR|Lj=M; z1m|5BN`i~y_GXo+9yb&5MR?_8`n+4J0OOLq4fpEMyL%jy)6oc3taQT9-dDO2@!#@` zm}At6ex!LD`f!_WfjdMT4@=>#(_Y%38cr6UzSe2_oHiP$A`M)u^?>9xVmR9lUsnohw~Y`SXd#>i~S}V^-gq zR%?oSci;6GB5?5Q=GA6^BwEBMD@50jh-nHKx zve8es++`V2YTnBksA=kj2p^083Wj8pI-EopivxJj4t!)D{I$}T+f&=w z;P}}lH!-vPu{-H`btYC(#4GZbreNzmiKPsLRr9~YoYyk=Dm0y7=d?~fZ^|^Ap+u(V z;0&*l38SuBx*}G177;X(qws7$s(5sxW8=1qBrxbm{p26jb_6`$O7q)&>M zAcd!*+FH#A4_+Y?YYc-ORrX3qT#+;{#chKJyew&Bg$x%0(f?6$Q%T*fkuwuYUm@h+ z=0#LSPXfIMtSl?iOALaDa7o`F+^KVgJYy6)Fo-O$2;)dr$zRo>@rA+>WFGT_WD+0B-bXXD&*%{a+->zX)nWqPwN}+zK1+Hq(GK z^RvVJ10TCy2Uy_6>q63cfescsDr@Uo6r*MEf4{JYcA;X*mWO=ovXpe(&Uv!*pIhRa-M-|=T z4&8OTYWT-qDc@eIP*hRPJAIf7w@^y$SbN3(%_2Zm?mJp=kFiF=6t=sD4`t9yDa`G3 z=O9Mc1$cgrRZ`od3w3%2(pK2-2dY=nd;YYYm zu8H^|QE-V-O^;Pa+2SJN(7;Re)HZ<@U*FYM+kEZCNQ0PJpD~Q6L!k~25Fiu{jHA~8`+agX2xP)H{ zJ1ocx1)SyY|M#Dz|7^BgjRvd^3!xE=qe&GJN?*u$1PH>xE`MM>Y3Wk8KH9LHSV$(W za;_()+p^e~#IEna0eGNG$LW1rff!1FA(dP@(=_CtoD{4ux0EHQB(KF{8h4-{r@v1z zI>$JT)jYw&pU#&DSNlCbjH8Zbn6RyUI%f$eoU$I}t72NwqySEJB&^wJk2OtWG(_3> zXBkWBNK#ptPWhc*?Vh?)9v|rnD5Y>Yu1+R^Cf5DN?yQi;Fjjsd6a?sS`-OM?tS>ge zi2z1GxxW$q5lz4^Fp!YrI03@JA*$6ReB+t0|Ky*DRGBaLYxZG5^tn|u>IW%ym+*lU z7sm8u6PsQW@BR3wJ-pQiLbMta)qMoayr4XHg$uDt|GoHsqPzucQ~d+IuCD=(gtKP* z@@hqoD_G7~UsH~9obBJEm|oAq?$v(X$*re{t1Pp5{*3 zR+rVVEd@Vx+Tj$!QqLZAUo=Oro(2Muz&R7|R`+c8+^sBgGG;j4iNB@MFl6gZ)cwHB))NZ2Gl?9sVU}OrJgc3^6%{#P<`9h4iD8+;cou# zX43DCKfNy-mP-@+4cIrj8}W_4A5VlY%OGHrpDxv1JXFKxVYN`7J-u-A;R=fqm4E}# zB-3V9RokL9IN@at85PFBPrw7s=jW~3DOjbkuZBdozAwdVG6k_wR~2tF&h;ZcO!t*n zjx)KXifu~%=4^ly0o3GNL zY^)*dmhPF|65G>ke+wLv6A-{Ce81xBP5s2SIt4X6s-J88UvwP<<{VaivFq=vhZVrY z_S7cZgSG>(7~ue5HrlvJHiv1$ccESA$4;_zE}FxvXQPZ-`QYwWyf!^3fOKFLTkMZv z+Pg6U@t^h9WO&-@nKaZA?hG2cCuKeIOX`B<4saV3;u7J_cQ`OIcx+NZMS!8=+4II! zTgVzN_z;94Au12^8$qV3oSop0fC_fdpR|i^6s+eLE-+MSa~TuGab+XOeC$c_&3k@- zar!%=zjYu7gZ!Eo5Mdv1{j3q%52MD8jN=VjcJ)BQ<)fiR^rX4N6Z`GCtmp#%5nsz( z!$x~~>mCx?8-r<^Y1|rR|f_uk{fD}cd{1LG7r7MX`#UcmyMOh zUAxw$@5O9AqZ;UI(os-APbd}7z`r>gDSX9T)nHW`UB>NZq@p;Kxx!P-#bf!eIXpY3 z{W&X?xNdIZD`qDrbzT0e4uzq?E$=NYVekzdTwU1#F;)l)JKI1ZNFFy(l;OKcGG^!< zX6%Df3~7u6pVlz+7p67l;NB@crbRwt+uD~77PZ`tP+!$eKJ^8HnJ%;2Q%7#79?b+0 zwDrU2N=!XL(dHy1vMcamI>IzFXW;c%oObX=r#La(->9(~02^e=fyj?ktE4jpBbXCN zPX{n=r}8W&?fo29VH|CIf0mfLe4^2Kr&z>}GN{ZFJ}?hK^1^QxKTP{XE>xgGU_byJ zE~1`RnXrysEVPD1U?RoopgalaVI ze`+Tpp~Ef3W;6=)Gi~Gs6&?Yg)HFqq?1uuQqa3Ex>4LtE^cEb&qBEh9O4XWaKz%xm4sR5y5*>W?F24iwXbt=OKW zB=C85jW-s|qY-|IQcOj8>P^0>9P%Uu?uj$BBGDMw}!W$`)r?gru zC>3Hy?xY7FJ_hS>RPAhtxQu8G#~iQxT7l;sogU66*%i?miqv0?ej zY16W@G)3U(myax^$>$I zn$ePrlYBm1m(TY;P>CQEBMZ3OS1|V+&au|D2FR=oSpxQD|7Ed6r5O2@!*PlgC+P0Z z8XE>DvrjyAjPs5&(~}|_hJosHA>X^>z-!BZRZfY4_j#ot`~wGl5&`w1!RXJ_z)1P) zx4{~Pu`)0LxkEFgp9jDGfLjT)#~OgByY!!wHR}5<%GW(J$S}9Rdfu10JBXaN(C!fe z6H{70H0JGk9S0B*_|OhGQw& z`xs2TKkp3dpY$}-d($J`^$oD8jqNf%|{1C?$b^^!@!-(r*F z^Bg!>v)kpVs%f@gxw47d!8=vq%l_hCH zYOpa@T`JTzs_xuxBQ9#K*^iZXC^^g~wx+2OX>&-2+n?V>DU2o#->}hJLIkUB#_sNW zr)qZ<=iH-XF_1J^=^0O6rvseo#MvU2ZPHeRrzvm8I=5qvZ3dCK-pl^7L@w&m!$*L% z=SwWcz8ay$nGIP!pk|NA{`)9WO%xF$2UU-8-wgPntDl?gX{>n~Y`=*?(gG29%p@33tSz{bZ5Z7`isPs4fVEtF*fj3ha869VS_O#xKzdeZbQUx_2#fcn?~1ouPXp1XS`jh zHAI(4>XL0%#XW@aXIHJ~0zO#5t^e023kn_QGfVVE@OG({;xl`f)kRF+mLjy#kf2q` zictjTKeKn2?x766ZbL$s1nxAn!Yri}`W~`-MzzXEW1MZEiy>4@J@LQ_vM%o~WkJWy z`4{loS|-$CmF$HcQlX~t-S{W|)6dp-^VG2)wos$%ClBo+<~+E@KZqI1?%`zcbPXT7 zslIL(9*`kFAbUb)t_0fca2hCDWRUVQEIxg<%^Q^jl&Ij0%x!YB3LcS(Ilm~)WOZKl zX=pH=CT_y7DFIQ7+lCp|@gd==dCf4)+p^ZD)ue^%dG%V7*qQGut2BR>aml<0DAVm@ zI%`$nao~(fiEo3O2;RguIS4r6%A8&FUufrf0BOwJ74-b=4nnJLz43zkB-ze_N>FYz zF*W3|Cob1DPO(~&57N2CS&hI1?=BVTM7KT6TYwm5dE|He=EajpA@8yc4oj6`D98>i z(Y6#O2K3hWzP8byZwjhMfH^rqQjH;)=b2%?(^|?mgoYeF&2G%hrkt`Ho_{KqlV^Nj zvL&>6{GSQS`^h?(H|Y6AWqxZa0iVSdaVF-dBsCZ@dnC;LHgy%+p60wCm|(7IaA}8- z)4r0JS|Yk=73_~fqrCPWGiNLiD5o9>;nB7aLjEloizhfTessQ+r(z^Bk+o|b4pC>xnC2v z6^s0(H%ikAhC@5_wMq4*TidK%Luqd_bM~^bP=WJv^I*mu5P#(bKE$v!EJT26{dlok zjld5{z5ZT_tZdVV0$78C85Apf&_RilA^xrzS_t+8YdpSrxvIV}Bx@ylI@j92bI4?F z5OyKVEB-wK@ziyXx!$?iLqjsV!pfKlO#NHxAJsL;IkYPLjUhKM`R&NTK7mW*n3Yy( z7?Exnm6E;gBNES!t`$ue=)y_HxiEa^ve6@*UI;hO@%s|Yc7%kl{{220jb#;Gl;Bve1 zNaoG<5hJxe32m{>v{=D7#L@yecSAJ!(BAOGczX!(bglyt6^8%w{H(QKc@-rI+MQ}`{=3&`s&%>wXZ0MwIh(jH(fDEGV7ETpW~S0I0xe)*Q2f~w zkHvih1j{=K+wVEP5K4w33bAI;%i!9S{=^F?^|O4er6^*#Zz;Q#C&yq{gY&_l3k>Op zFFxPoDn(%7ZeuZadcIyQe*S4PCh~D1p+XM6dkx=p+0Z!lOl*UnXKIVq{ENyA2VR6h zCywS*6 zHjPcGI3f!84EUDdSFQN8NBLEB)p`>i3_8dL5_qxB-@%LDN}_zJz(%{$D{tQ^^s`ku zRlK>D;lMYVEMwtw@qsMSREbUji?`xK<`k#v=^q;i9>?_g_H{c;LoaxoTH=px=Hxz| z4Z$*grv&5(KxZtBSdZF!8NqRq*%83qh{hnr$_Hg`gut7SBD%3FuL7In;F~&d zPtAr3y^xFIhvL|Quc)a&a6YD)V3Mh~0RB=LR|p7m6d6)DERPC)N0I`6@@3-N&5JEcWQKCbsgkiudHD5fXMh zQi?w+WcTq}zYz2ADljAV=Q6Z!x=%r8Es_9Qfb6|Em5}y8oh6i@BLxYUQuMaIOF7Q! zB~X7L{dtBcsYiNiN0t%jE9}z_i)62oigRWW{v^wsc39mK?R5!YuhyI(3GrOQ(b8yYjFiUt`JS9jg(-COyg|n@lEVTaA%tuh7WZ2dNkeBaHbVVjJ_!_3h zqBY&KjB5xUGw5>gZeRZIXc)&7_1^LnTY#X1(o+v?Xb?nn)AD9X_nL(^cNev^#ZD#X zTlt$)cax+4l=7o<#?^!1q7KLYHs#wt!6C(YF1{v$4yi9jw&Q~SdHFPZ48m($*yMR! zS;-Ty9|EX@CahJ!GhIWMgAmXd4i!a{oKfZiXyNfdZw+cb#`9&GRMp*yzYV(r7hpOc zImH*FVzZQmo?3<_q}B-h#}9(6$QJ+6%YCB!oJf$U`^x#~811kvg@q(C(=~4S75mJnJxyia+s$2k@`u$j9s>)HkT)>)IR3+otEuy(F_VQa02C ztTF5%d4YBqWGnxuALIJ=L}p}-t)^c)hy~pj!PC5Uq)>gGn0eT@R@^?+qi?SGTs=@Q z2h@$kUjgkI6YCsJEGAhW$@XgJ`i9U>9T<;n@i^9`SZJi3gT?P7cv(>KUtpDUs%mRB z9*+gykY>4`@t=niv%eXj|Bs&E4KCPkqG9tW`1n!ubrYw8}XG zGJx7S9ONjzchvgIbWwwzm<_*j8`|`fjO9+Uc|hTg>K0HIt(kJY9O(NpFr)DrWI|wfkg&e=WXF?<9czmnN9Oi_3GP-yspNPW~$+U}0v zs`i*+W6?!J`foq1-=89jM%S}v$8_!oIIYf>>xQ7lo75_UrH^Em+JM-)TV*T!7t@`j zhCuasW^X@y9EvAhzP?q18^ofJqEv2v2NWQyv51N%?IKA!EA6tD7!hBq=tNP#0X>rr z+pu96|CmSg>lL50mHh6Lz~&$K5sbl_!}M-)>~`0^K~>r(wyc%6lplBFz+HwgIX2@mO5Fo!XTg)_T{Z!0$>FF|mvs_| z+N~FpOR=P#n`Gr;W8mDSJJP8Y<$J{?1Tj^D@&RJ-ZO4Fu_OY8xCbK23$)_&Ak%Zux zb)hL4?)rLs5R}kvS0@a1ar1ppnkA)7nu)~}ZSz4A6sQ#|%CnGt-@B#GsYyxmK@(KNb{#g*@|Rr30EgK9qS_zpPbMH1iYG%q zna}4#nxBHTewP@W2z6EDv*sb(eB1ARby$V%@j_rn(b?8TVrk6HltXQWDZm zPlG|e8QJGj!rD{M&-8eNUFlthhrMQ{ZakmqcTU`WHrKl(0+L0)0qK0|5g=~3>`{q*kM@=}? z!`GlMxzx4zQ6xi ze&n_{q<4D9>Wx;_#>03U#M+b(PbnVHKS6{TWIcZ5PD^K81cp|Thz7D{T4q@%pA?E7 z%b;jmVy%x!3E^l3J-+74e@v7F7b1cPptEviS2jUYdEmnF2$9gYHwyvv?jSQfY)zSr1@doilvRa8X%|ahd758h1KC{VCl$8A4WgB zHxg`_lhQ;twmqzC#u9^1+_zn+j9Lujj6uYP+{o2O#ADmM$*w;2G>Amm1)U~H3li_+ z8(6v8JcVW#>7rB79BG4H_8ryCXzGR!Y-r1E-qua9<&gQmPO-pDP+va( z{>>e&|J;v>>gIsPRK>z=!(`?&{e;@)wPwbdT2-TNu>+v$9P;oEo^YChMJ#8{!{|#k z2biU@|Ei_@G>@GJw%e_fYgaF%NQYmI2Y-fOYDjanSzlvAHyrgv-Y)`oE1Vz=(uJb){(o7`cnzXdooT6&BAV zn|xIsieDAjhM~*8yd^P@W8KAuPAdzac1gSKV&-6=*>lLuz0fd!>Gk)uY~C;LBB6K| z2Y7((l?*&)C)Bb}tpjLttZtK~Yl{OPzb^Zj1ne7{+(QUOQYHR;lGEr=@PS>Ij5y$> z4xHh%sC6g)5whwkWvk08`3n}IyB@Bn#2zisqpDD>=WnT?X*MXb@iQ$<8|f3Z3j%uC zueq+I^(EBa@zda_3~rVj!>H*V=UcMuIIgLoE1v36gaMGbM)Ax&Bqd+Ladw1uyQczM z>iwS%hG(_9<4lwI_N2}!grCm11PA=9j4Rnke&0~lmy$f9q&TJ#r`=9r-M3?28*|x_ z;R6A;ay2%A|(DH~u}CTd%p*5ypQ#eP<=i11BTM&27{87Ms=4MpM9Xzrmf z8%DWD7d2-dT#Hn3(lu!a=Dn5{oU{vyz+C^l2~+~JM_!NWhkeCq?()3eV7GOuC(cgn zZ7k9`U6lMfP$%va>w`h^s%nutN8Z59?!n-uY5ce-D9%_lZVCki74B}d$}sNUkg0K6*5tMc1=8$A z;{TW9?Pj%E|F)lf*4j;*i)xx0$O@NnJp;#5@I1NSC^(#!&}ywYVpIChzfJI_R5Mp` z>OhPjtF$ubSLClt5nUD3KayxiV{a=fb-<2228G-;^BOz6Ci4b3S44zq0^gJA9z9Lo zgsiGi)NaDTNbKU0{AUa6fD-?AOO)-OJ2UTUU4)2)(&%w$$yVy7L z1|HgSGmo1aS)~T~;>>06u4Pco)iTT!%91xg&)-yJ|si z`38Rpb5rvxyosopRENp=>c#Eh>$lUpCv;Im^Kz&DYE#?6$(|kb3H7}S`YoK@8ZpDG zGHNt_8X*EtJPu`aG)8Lb$cbfN;U5)6#53E{$=5mowj)_?K6Y>>BFE=Mc=lW}14)E8 z{DMr`D8b7#7s6uCk=WiLK}q8fqQwrf6K)j8l4=T)X3M`W5^P%|1AmSmbvh1N~y8OgcA0g0u@h$hg*%V7XWn4ljs+@XbAAv@szK z({ma?ND8=Xq$NGnD`f%G4oaR2C6cS5KH@<~8;#azCDuXYdpqvj>ko2A&ZJEO7Q{K9 zugNlL_(A-YV@YMqg7xO`huTEEsWmNVGApBJx#&_?u$~qh!RbI;>kwlLOXE4_$59UO zX^sidjNhl2-7T z7Kp+Kn+)xO-3z5APYmIWG~}ve#=LfV@HnaB$9&_@wv5VhMv|ymf;vlb9U7kh(=!Aa z^@V5Uf=^F(0xwY|sp?(k)>st0?{tQU3|~&OIiqD0x(TgFei}_D$lTRNzCd8EUgGUn z_y^IRBZyTpL#M4v2By3j)`nQ=dQcV&)to{J_iZVGn&6J0;U>rnKI{@^rdJe_n8@?u znm5#+W7iNyS8IYJEk(wrV;ie-p(MIOeqQkG({z%{BC~H~0YqA(%B|unyv_*nC}k<4 zzgxJ*$`+Q(>?CeNI@Y+#u`&e8yJ}x$Xr9L2;O9D32UWQ076dDDjz4b4*BClgf9AjC zf~dIQ^%$t8@uRY<3#k0B2#p-8knd{HVutky^jWOVrzVPQl#@5YvFNiKt~G(R@nZJR z+~zCA*}MdUL*~MixcTHYU20V_u11QTHMe4pxyIKM>`a}>smTRAQO5kz9(Ne9JWD_M zf+>16YCbe59^@C(cXYBDi$ZlHb?@U?j7=S=_cGnv1Ru94y6(!@5crn9ba)_OzQ?w| zajQb<&pF(I!}Loi@<$%Arvc`hZljlI-s{s*c8cQpbrS3XI3K3-pgg56?ZSY- zk9FZ6rGv&aLn<%w?a;@1HXN@o(|D*clk=}#<{@hh_(b~JFNn8)TJr`Pp(3P6P{+oI zOzj>~lxn0oPI9c-eJ;laui~AgFt4d=n0MOIE?CbN79KZH3d(9tK);!vKC-qgF)eG@n&}PS>6f zgT+Otw3Sk!r2)u+T-d%|k*ltv;a;vQ2+s{|jC7++1o)}8GW?Q+Ya8AiV6fP9L zqg#y8_fN`Hd&}Y?KaBWI@SmS(qe&zSh3q?N3pm(BNT=|?=FAs5sxwoG7C*CcxB-WY zDeguF9GV>K3RTv!AA5IP)(k84D#m9j!I!I$c-PF!rF590du_%oHDS~O@2y*4ya@Nn zPBefIbaXt!E6=&aQMAkxIFEYhn%YG9;h*vV&% z=<7Uiv|ib0+UC5FiD6bnx=yxdPJT;`D}WX_?~&y0#J&E^!ybPTC@I5Zg|LLmC6hP1L>1<#twiI(*s=f~GG*#+2V_h9Y(Ksn2{fp0f7!936dtOUnGG*$ zLg^O*iDn1Uh^Wvg^)t@5fJLuvds~9AjCQw9wOX}CIik%41R#d^*+)Eabp1oXz7xK` zb+6A8zpzw{AB>jTdSgMnsA3fC1EADD-Rp;LRRaNgA;#-{8(f?9|AD!lb4hFGUMXnd zcy$3lD`7$zSAvkDtwYYK9c2Y_+*h zKc^$Ti6&D_HQy~`zD~dTk3$_pKNrAsg9+wZ)@Az|rFv)^jgfVBy9xA)`m{}>{fec- z(y?MopN70#A}@%r&{s=nBY~B?yIG^5WmU?*AZ#mX{uNj&zTdVb?*-Je(?U&Vh#phg zwTdCQZG%kX3CoL?1@WfKX29keCe}oIB=^G!T59I9^_yrlu;M|*&{RdHHEUV|7KS1w zS>S5ih70Y&x4`bofv64H6a!Qzt`Md6Z|IjEipW#u=yn(J8Gz)|K0dis7J(Tt9MUCB z4?7ESj8ceGY220WgBrC}L3@WLU3d8%=3aHeA@AG&Pgs*Ne!cFf;MpGe61g|*FOYZK znP+~0qD~iz^UCt?yy#N-_%e2s?nPpdoQ@yhe(J~Zwr(ns@>*Gdg+$Av1O3NxB&cKaMFmFgM*z2 zO(KJ}2arKUHaiTN4=?XC#P0MyXllKsnL0Qgp<+oDD*N7p9d}xxC$-1@hN*8FhjC>e z^c}h8W?wVJ#|oew9Vv^)dd)f7JpWOv4_r`0bR{@@3LCV&Y1GQSRYN*BrU2lEg!(^x_DDSV}dZb@RN>r$KsIL86lv zH+2s{jQg(TQXiIK@GAwTPM#^r&w{5EQ%jEPpD4_$^F~tn6cN{c zre$#SlpQfgQG~H)LEtaxX&Xx?v(`|9=4;G)G6R$#bUQLd?-VWt<_E8D_=tCqt&Xt!Kq^=5xEuOSEB0|@0` zH;-^QXD&`Ftq+BvKhvYH*d5pmV8zC|ItZ0JIc3HhsM(KRddW8IP@BGoz6P&0g8GrRLQMEPK_dfnvq3;oa2~>>sXkqFcwAoCxH-Xx%!1unPgsgI`5gDBHXUj0 z#3(|0KY+}8wJOY1Uv+{1Mck4EJiYfR#&xM>tHy1-zaFtS~ z=$Nku@s}hE3%r=u9nbZoUY~(-=_T}-`ZX&QCY>SIy4T zNq>Tt8M#gg=LpzcKM{|b_1ioi+3;GL-k%esf~U% zNRevGfd!>1in)W7wT|Izc9%9MP@Vzpo8jQY7d<9$DEr8g!p8s=Wd*qcHJ2Y98I9-^ zyq7i|9~p=xmV0`iEVb?NZJt)n6=Q0f%hmxPpw8AXgfnadwx2u6A8vH_oE)AFNr=Mz z^^jGj5DVx-_{1F)wPfyx8X-mzWMkw`zi8#!==AhhN>TZVnhSg1=&b)Mm)VHRT{MvC z&q5$>Hyg43zG;jvUu2bLZO^<}8E2JER>^Y-*aiI=ml`6v*2WNP>6j&^)Jp^Jm?J3Z(5uB&} zlL%^m;P3d{U#3h%$Bc>e0Qk5s{CWd6ONpsZYL82|byuXG)OJ5Zc_lQZn2HdzgN(H= z31&cx=wa#8`wA1qrthfm)Z4FxKtURWyIu3Chr-SI!IzaPEq6W?ztcjr8&t!fY#_yl^M|pgN4Z4`nEsQDN58ocF0-54{^K zZMNpx(L3@YN;eFOV5`n(=YD2-eZQyEbSl(R`1P5@;Sv@VGS1G>5vbCK+5@hy&z(TR zJN7=k4Hzj&03sib$4qIi07$F7Fcw60d*Vc)0qe^hmX#0g`cbr8App)r+AOfu<*y4dxr+)e zp;fh!BDGNtMG<%~S3nY^%3~}qj=JDT(oFgUr1^93pnAvq?QjA!$?oLuEnY|Dhn zoY?uZf!%+E)K|Zzk2>Nm)}m82@-eiq{moq$1yCxDEdXaZuEX4WE z%izzx^R5-}Z>b8QFUs)29-7$!hY!Wr3MNCHSVQBqb7xeQN|ImwdYeRa8|v(O=`h0p zstW|L!4~-)*z`!gbdSK{RD@rUieiJz62!AKhkHs{8PhIpQH7Y~Y00i#hY^P#mL?Qk9UwHxRMKHOf4iK!{2S?D;w%8(L&z!lWZn;6S` z#n;W*-2rB1YY%nN9m4OVE+b4~jUV%k+rBkSGesK0kqg(u`|rR!kc3XzA7UyB5P6$F z5a9V>nu0000{3^5qa?(`qA<+jfciE{niaiWp2 zb-(4ZJxBzpt7Ft3d$DF#=Yc506?Djjt{s0M+!NVg;>ty6w(3zs!7?wT z>4!}LLouvHb3jWZb^|$z!CS9*e}w&neNJ|3lA#xFZf8^e5Aeg^4D7_*Qb^{Y0ZxcKR6&${OPyM`Dm0A1hCrI}bMp;9J{(hnJo>&o}=)(J+B+59QiK zmawded0ffs@#Oa(N#ppNNX(%|gyt(;5Ba&o5B^Lr)A0v1J|+ za(BB-Qr0PK>8vlMg8pUAwiBQ07KZ^@Y~;|6yAhJsZR0E4>J@}X_)$t-d9n6ha{Haa z#e@R2J*GH^N#LMK6Wx7vm1g+1>HD@}(3Y2t(}J!cE~SaB(K7>bSg4a;FBArM2${O} ztBkhqHiQb}sJsi8gFo~sNY;$H48;v3+S{+{e8W2mfh|!Q{qNhe!L1+bKGE8YK{}<~ zy{+wDqcT}2Z5rGu=2Ihdy9?F>EENGH$#_Oe94;OL&^1+1UKE^iqDYgk7EY~$_J&C2 z7=zB~QS@;xVOXIGSL^=Qr_JnIhb5h6OSJ^~ARUNq#wO8nD#LoQ`O&$I`((@;~6LZ~Z|lzQpqXKFhvKw&#YJy_XDh zfDs#u_MUnwEDB`mL68cKz3EN<@IQ zv=5}9d$}dX1dK)>w%K)92O6G~Hxc*?6|JR0g;6?|RC?&#c8P{1c}xG$&vOmmVO5cu zm6R*}xLxEJxSydhy-TbD3kWt+LdOpzAlESLm`s>D-^|f$zf!Y4)<*dm>iLLB)sP=s zo;!O?IcitB@ts9GL*oR+5pWonNCH&tl8eu>Ilx7~J@V4W-ZxTva2O&6PH*Q{%q)pb zW!lzckzZl!ETk(N92Z5JuoEn<70 zy+jjI%KL?2J8^Q)AP$t0K0QeI#h6Ti>XY{_gB6)VfL^3pa~BuHpOYw#V1fycH(m&c z>eA}s_MKv)IU?0piLlZe2~)-}3>mXHSnhWDIT6~`q`YEldM+RecLXsRfa|CM3&vAg zD#b#@SrB`NUw}ag7h2>S zf+yDsKar}^)B&;X-8&m3Cz~?i3j{0minNEIl0P@1o>9Uk(^JCgc+cHnoMKs&6Sqd| zJHFELY{s$`%UWX)tj?Kzc{$@yv?95l~!a+P-7`mF*U*MeWNL#2OUa#p4-um@>MtC<|_IhSYbi-(F6yzJ;e2c z*`p@q(jvSafa;)@3l*Z+mgNiLfF%U~3a|ipv!T z(+3DK@^%A^)x*M(yjPQlo%}>Ui2*AsA=?|aTruMzjb{IbPdn!CQeCoiN$NUEqW!n^ z+LGHcsKGsBudf!G=x>#cg$*!e4|=~44q*Pey+&0NSY3?JpAS1t)qc==fDwESmDmoJ z0h10M24`cwP92l06MmXW2<810bs>==2 zCPPVGAgGDj)*x^WzA_Xg45Ziwp`(qJ+B4M!WUnp|TZ2Nlsd`s<$4}{NJ-sJaK9!%t zLDx3-yPVmKj!q)l(ZuKTE05y)ebm}_>*P+!jf8LcS^F; zn;4hnYtQfwF^J8Zsoi6D=^NDUumThN%hoRx|1Ga?`6@Lnj)s3er!MChnu;PDzw7tI zr9<;aR9O3H#=}$B`K)rlwmyp7o5SODP&$pLX;(47SirXJ)MJ2RDLqA>3hW+T%%^v@ z=*q*IMZL>QT(`@m|MiiAssFFRA7?6SNuX-fJ3h_CTVF`N7->N^(L%{v2}ryJPThbB z%-+%PZ&05|Ce60#xGWWNcj^oYBlXBjV0SZx=NyhkPMJ7~yy8zcEd@OV8zvAe@^{N@ zjj5#h)9pbsEAJiZrW_#{j63=%YjH9EIotK)t+wmBU^;tqvhU*mk4)D9Wi2-1hz$a^ zrUsZqwi2y2yG|fKpfco)1mq+(6Z&?`O2{UFlU=Ks{MX+t9nP>Hy9kKnn2IsYQ_|qD zQNejqJm2>ZnYJkbg@(5~@0z!RqIl1w{h&QyeREBV2cRI3>uIOpLc1UucGL7eu3^-C zDo6aPzRxSlI;m*iZqsn#*Y7XUH~p_0;?7m2UizWcIv*4=ooQ;Yx}^=j7LQ~~@{-5J z5?Ghqf^-$>kVoSbob1$$XOiOz?J8%U9&KB+wdPe6N-uGVERJ-!v@dKTQcyfdKtB)% zUnkH(`y*_b)V2+G52z=qyBEsk`B3une@;y(&?MHV2WU+7f2`v?ugh)4!y=g+VFuJC9PU zLr(#{Uoy)Ln*Jr_2Z}3)EJqhmqOG-?*rk+c(^1uqH=WWV76W78yqro6qO-fT42)zP zt+v2>tLyXRI}*GVjIz`37#P0r`2{ao)i~5nI)KS?N%@g>R+E3n8RMVtyJdjJQt>ZF zgv!2pP3L%u$2`0oWQX8vM;t-G)2vJmohNKkn?Rro8*lm2iUFLNOH_7Q{N3bJbw*lbd@hi~L@c?4NlBu!%33 zoit;6ZtqqiHfi$I6F8Yg+7m!IvH!HEvD@z7XVou~uCk7$QJfB7xHOmC>P`ud4NYtd zT+Sm!qT^a~*0^xqisqH5U%@#$SOQ#AWyV9elDgS&u3{lC%U=KQH-HOD191yWfwah$ zvODW)9*)%r{wh5CcYyaWqy*}O3uKSJS9;$+O4_cfx$EaGMlKCPpuKuxaPTy1Y?hqZH`CkrM6^-tW6vnO?DA_4`*a1Q&@!hoC>O z7^$@VZ0rA;@k10IOit+&Y_pZHrbjbcgP*Yfx=!%w1md^RT_+PhgmrGlqPRc;oqMNC zP!!W&JJqorY;9G|u==&mcjdK^ji57anw+uuTr_B2a2X=~Wd7Q~veL<0hnSm+2J%2& zwBgFHQa;+bpPC4%+Q2S)Kv;Zqcuix-SMp3LlTKiLL4u1A6005^zE7HLyQg$Xd+Z^! zw~AtEucig(l9FpRh8YCDJ#jS-3zT;ZAwem$Z66)xEJX@z=ZpjnZsrHXj#j_;NCRS- zte?WMndhwF@SVQTojHsq#C5A^T*qr+34}ck;@i@Ic!zzsOxq>OkEabB2DdRo;y-K0vy@E{&s68 zh+(g%|L6v`{2Io3e*9PKWNDsZY?&eSPnxF{j|(7tZ$?p&D8zHIZ)R~Ct%tc{ztM^} zxfoi{2>L&Z;uN#nE{HZOV0?g23QD|`SZ10se+vS z>fWL~2w-W9#O|LVV_Vkn|Y;iz{hm^C02Xs&_2Cq9mrBhd1;l$BqO-3w;i^# zXLmnQ!C!#kM1$)kJHJd#kc(wG8G$ShYET1Gg~Ut^kxL$DjJ|_H z6wgCS;M2C=RDLDRd_Wb-dCX{ z+)?2WaEP%IFJCY{3HpV$kBQh?B^S; z1l>eLs|P@_4yWT0EUKBS@^RG`$VP@`LV}YDa1YoDCi&d&iGC{5-3IPl<(~hG0A@Ni zB6Cz)P;rDaX*dEv8J#$yRe3FvnDTPKsXvp(`CC=&PV9QvZ~QCle#3{ASs*g@kw`AV z5!!3ExcTQyGtn9CD2a(S^sxi%xJn)r7WUDRAO|OJUJ4_$fX69{3e7i?o%29E#LOcxhnUlF_G>L^lxIh_STXhxqyonZZFnj z?#x@NK5*P<*;!c3Si}9uaI~}2Z&luToiwF36LhI!<0>e0@6dM^YeH&SNtaS zdY3dd+3OO26JY-??} zzyCGHyQ}MN!2%Gtlx2R{l;AZ4Q=426&I4}X;gfH>i~y5PBWcY|xykOBxw35WH18sW zjlg1>UDI-M-2EV~=?a;T5HlO3*R ziX{JF1iqiAnxT{k>a!*VoW1~<9tD*fE*#=dXJcg9cpr-OufB*QSAIbJ@8?vc-9zgkMPSFI_|S$&E4dmLrGQP)vNS{XD64Ol2qsmf+u%!1d>)BJp9O4BVVqRP8l@ToNTIZ z6L`<02g}!fjN8BIng|+D`12`ZA_PWVSiq8FL#WC47J2Kc2CQLDhpJO}ZTPFd_rXN~ zzlirTo(8TVj{?$bH$v)Z7MJInyxjJX1c*uJ=?$R{D*0JfCv76z=ep9k7VmT znV~&R|52_1RvS?I=AhPaA6>|yGYixCzdA+V3zjZhFx+bB;tjbTP~l@t7S!`TiL-b{G`c{0&V zzl_m+Or7Ujo#swt%kXo|g7;v+`poK*G-B!4WPap@cSLc25BmDVf543HxGYBZ71I~1 z8RvCjCwmfOZ+4{MoDbZJhdHM2{ZTA6wO-aMkI+dhV?vtb?H z>avmIfoI(6k@ZYYG>D#`ZdL?7VMuB0>Du%}f(2$Y(7axMg%!e$r>?KbB4NA5<2e45 zD_I=-w_W$cZ#q;ZA(;lt#(46XhYsBnxNT};z;h$;va9W#-|#RdX_V&x?jDLyU;QfP zvO}2i)(`Pn+4IhE8_)o3s}C9LFxc(*>Qf64_e<%)Vm+szh@#j7W(v>IJN=9b(gb%- z6}no-T@6?9@h-WIB*Lh{9O7pj8Yqfzs5$ah8QHT2RFV4eDLXi8pm2s zpxIzDNn`d=V%czE52(bQx^rNn#%utGj7>IK4?7Lu!&p;o)Ks>=DDBrlvbSc z0W+dk(CnNTMW>V?vtaJlp5ZFuDn)tb0R)xeAn)~~{<@XUS-@M#f*69ixG~a)^=4WB z&KHox#vIrs(MGK|B|MHf7Pp2L7ZVPP#!UE+mrb?YZ$yNFzghak@x-R&iI-#N^JI?J zDh3%qn;TWxww{C!2AQ+sps$N_xZ9q%6ru#tH&|sI_^{Qa~c=xw*YHR&hiXY zKl1kE0MJB?yn@~BDBEt?1c=v64S4nNKN%Bxl`o!ewqERzsh4ZKZJBFrlBm9Z8y@Y= z{6lTul4h4F{vRA#YbY2ql6SJwN25(Wc@&uYJ0} zlydYvlSTmz@Q{~hgubdMpca9Zqlkx7>Wo`|72c?AplsWu4eBh`pdddkV}*c8UwEn~ zR}Hi+g9bb6j=W$K>q1wz(>aSltU%q>ZO7T=61xnvUAW>$Vde-$XzoRCJr&mIYRbA0 zBJB2(yyq&pu1HPRoH^T&5*JRAsNMm$9FLX~b)=e)9j*{~(bvdnIRHy+CJTDX?<@bk zQ0?CITUUd}k>Yh{E?EO=N-7HR4BH&Qd+Fc|4O5?T=%8?IHc$~NKz-@Qmyf#ujug8j zO{e${V-wk!l60&Ye;*Q`II($m+@t1O^E_KK8@PnRQNoEj2T-=iRAVIOlKb!ls(O_{ z+=U#3-As}?=M9j2RoiDDLD$e=V2-m*?_2u?7)uN*kKh^iv1_bz8K(t0mPr?#)FBDzzm5vJv=Y1S59_(rp z)LhfURFNxEfE1x+VdFA00Z`;O>twM4X^>zPCb>!&*WAhzB3^nPo5W@&n_!7&}2u zaia2jnxKCDO{r9lvnoTR>Vrf_Ju(0SPgARN^WE>A#O+2~AZWmuBEXVwE5(ta@S1Vpyn*>HUy1B{aH}m62ejS?lrFjk~n1G9?P3E@5BcMwv6I<|XFR{O}S` zHWujXJ`DwpCLvwz*RQpeNEaOc#2x>7e8}9fT!^WA->6kzePLP1mptT7Xmw8BRDOcJ z9&~2-bbNEG_2;KZUG&Ju&lrLky7w00>a3N`tm*&ZyWmw;=lgd>1L%eU%W zysA}53}}9Q#Pn&*l4m*4b#uP-=)X(Oy~AS7G8^Eyo)cSh>gF>Be0?=M1R11!X!tBx zI;gf-%jE()xSL$0b$hVNDj)wQ*E{vZX(F)Q{tMuEv|f17T^kex(=9{+jEZS&WnV;! zrYT-%g8>$VU_cmsKWZgw?}v`JR!)LRa9c$(;cCr`ar>U~B3l4okMkFv6mzN28zgd` zy3sCYJ%?@)7f!c6Th;^D9cd3@J$vyb&L4rJT>G|+_;+>p>l)c<;s4H6P9lixeP2zO z1WXCH1DC^&-}MUZI6b8aqEmHZ#g$DoOgV@^Sy<$?1DP7=)I6MLyKpq6@o z^=$0q`M=gb(ygI!RhqXIDiCV!UriItc9S29zfzl94m@nDlvAY@BA_Bf_Bb&}3l{TC zY0wH}iI5>Ye|8ka@g`KQ66Z^vzshCLoHVjX2i$T6bMn`3rFg zxY+eT8SNRKQfO4dBrV*rxR5Z|>xi27`|pSeznHec z@e>r;hz&4mJp=XK4LHL4vkgr|*`ly`jh-BdYNbac2?BJAgeR?JOXOi;ss1YmDVo9g zwvo^$u3KA>6TkH&?-c19PbdIF=Zhxj4Nx6UD3YO+7opyE44rgc)*Hn;iS+3=*d^et#9WcTqT)JQ%Nm#)s1NBKZ&f3WoNr<=cGpj-JAM3N%g91SJX*dIg~?XVEYD`q z0sND}C(6J`f~l(cOBF#?Y#WR$md3sXv8i94ENPxYSOldPb+amoU|*f_bKsgCTC(|X zn7v9HRwi#BSzLKs;NqC2ug)&lHw_xZ5pLrq94#pnmXoe21# z15&21JqY3sC4+-yzDDak|AqR+6>s=RYDFyL z169Pw@veC4LgR+e{k}o7r$J(TfRYU!OJq1sWVR%H1T(EfS-mxz-9KXW@X-&L^a2i zm_Fx&wTmsUkykPi`q<8Do!>!71a!k}%pj3fq_~(ujbpH7eT`4EX0MKz-MT95 zRGGQ$8}-9u-!tZskGBnxprOk*+a2pl0;w+THiAgE6PbC$#r~@oh-b#rw}TiNA8cPN z?8Ea6kCFp~zDb9+^4CZm$Vo?$RH&sq0xrffGeIl)S)A=NJ*I-@qK0ZOm zZywAn^lmM?uWDB7V6ab9a;DwSzzE6FQ#lN4PtUY>NFk4V{2vEmx0WSHR>M93s%K!0A6wvGtejtX$8DA3_zOaLQh2inZw+M7op9+erf$dm!%gi+{ac~%xF;8Fl>7ZTA^G zIC+#pk@mhy0bGJAXcGI8Nk_RFK<7!&%)MqNZnb33mYhpYYrgBfBhzA=SZhz zE$@Mckrm6SQR!5QpAq_c`@cigW!0t6{}Lb!c>20Wk$*{-i{6~@g(WXXRhrS+F4aTx zGoCt7NW}|co+G%$9p2Aw#Z)t)8^waOq&#Q0@R_)&dJK@BvS2KayRk^0H0-d4Z#2Ul z&O+-*m-|J|PWY)JW+dYA4RI(vNVK9g>s8vrTi)Z8?&gH=

yPs=Bq-vbQ~E=QN)P}-vL=5h+Gb+lyy25452goNS-iGaD+nbJ5Vn)Qfn!KAc z$^*I1HVI|;J09P?e>6mC6BFt?Yuj}8?0O!?PT(t!dW0NIba9*+lqa4MEoW?sk`ENs zo^f#%QNmiKaqa^Ak>PVH30`-gFjuHbJ_N}l0L1at^&C}yfP`L6;O`wEw)qU;&D*Dp zgqr7u`sx`@pOgIEq}Vr7*5DNF%lKP|J2>M}sJo@l6Fm}^ z8WIuDe4(ok&Z90sCz{R3DQX$>i6E1tSScm$JxY~3iqn^cuQRjGY`5JQ@DRz3AeuK| zd|{wCOb-{AG-ZqeY1D<*uz4cOm~LIf73vyUufqiqn7SgAB@0QCKumC*~zOdhoaGM!r2@f%$WW3VyswCUWps@U~ zpZXowHv7~6>BQT%P*X;wz}lx|BH(XUH&jH#!n-@2)((r*952^96{47BrCM&r55jm9 zxUI%VL*lm&5LTUJy0IYn=MrK5gQZXts5oVmPhYIGti0iBcl3Q9i2p6!5^aG{&d%ysVp@pBtFH^9=Z^sx&;KhFx zHJ69k1#jz|$(z*Ghe=z3RTPHIQ`m}7d{$&EWrG|gp$um3dz`nCiX1aIfxQxMS)9f64g zHof@LF6ONfu707%kpOPWl@w*=B zoo2yNHO@@GOQMYoPvbPc9yS|e5E~V!B8&?R+#tPCxq!*QdL1UZj; z_n^fC2P!Dc(`O9iIP%KIa};!1vIMj^VXcN*drCnYFfmednc(K%FHSrrNu zQUY2R*R5#P36fgu^A#yj_k!-vNhHF zUNSCznX_B~R(&&BY#P>wtEm8`48Tj45He@nqG@FKdy=M9FOX>6qy{2mH`c!r*TLqt3zu76^#pD_+yXxcV>wXXvWX{8l0Bx2!@1)VM?%Sxa^dOhsN#4Mcyx3L>E^pRI4E3#Fz0F7@;I4j z&|an@Z~+_Qz`nsg9zo;jwMVE?j3;c1=kC$Si#(hFy<#0#F#i#4t$PPOGh&|vMW6hN z^;*@W9IwsIXP<>4{fl)`ej?PjV1&h5I)d(JD!KKbAknfbnyBP~508O!FVamZ$UVhb zZsqs++hA!zs>MTe&gi)k?XW+SRPFK+&e1>|>Ccjji@5lNW2+z4^p+z)sO3f})R)y1Kd>eR7FE=j@KsQ=*6e?NlVrW1%HtJ^%J5Y0nXS z2LIGZCdA+A0?x#kHWo+%ex%@5yuI>BScW%)D)c2KcFLj#4^%B0I_GJAljD=^9NB=X z?()q7x9fCR(fVR*Nt{9qFP;}(PaIN~Ys~c;9S3c9p+;rR79|k{^JRf@=&Y^hw#_jH z!wF$h6ZkIlrPVckra-rTdk>RrI{-RFCidB<-GK%{s0CciNAC@Sf|N0YzLwCOHao`L z;@o4%H(f&WsC+irKSt5u9-aWXd1s$v_*%FOm07TcMd^AddCXCS7Yb4Tb zamNspKQ$kT-YJX0xKLWp)@GY+@EY6nXnSwztV{;el3RMK74--Wz(V)zwy!>rI{}mN zyQ|X&$?t@G5IB1b4?J7fHRzTd(b<6xu1FNudvq5mudMbt z>C;H5MCmOZdWm00l8Z66p7h1h8fx_}5~px}=){I?Bev4L0n$0g$!X?HSGzlEbZs#m ze_%g&#zQEUK!ETh>~83Ok(G%MP^b|HTI6~HW67%71E(&?mCBJW2tZ3zy~K(?Fo-=7 zI0;Mosbt79{@%IAnXgkt8R-YVOJg_{cG0?r)2fd};mPS(%ysYS$F&~=+4#&%?&V&QV1mpz2H3<*F1^FWMyTkn z`WODKTWF^H>Z_P|{5iT&A7<~NR&A0UcDjH}QYN~H3WF!HT)3q6su=hH$3U#y-RQ8F zHiUvRXA#zU!eEwm!~(A93Vj$_?6PvDUMK!!d8hqYlcigFNG>zg{#I7n*9>-2TI8-_QA^IaPADcWSPIr|ft1Lg1Vc0?UQ=!ufk%+MSKVnrZ zctsH`){{E%KKRSimXSo{xduT9J>dcyty!mJ<7fM}4Erzi{mUgH< zfzD8niP4jr2z?MKXZ5${>027Qb&B!j^fEM*Cb~Ri^@1!Sk&~%+M?3oe9JT5G??RWO z57D87#w$wFJ2Kmg#1p)ktm-o{-btdx&6FsPGI|zfERgc|l4h8%P z)7Md*GR;;Yrj#KlZ&RBMpll#VgS|<+DOeI>o7W{avhgSga|ZfQ&BicTt-Rc+*#ACH z!!(3i?q(}Q=Lv5J5kY@Fy`;FZ#?+&(i{`RL;{u%Xh*1#`16-5qpPePV2!i+7}H zcImt~=k_nBiLSlIG=z$#8ggU-5dHdhWR9Oz=kpIb&B(5UDC#Wf9g$tm1MYnuMvo!U z_6ajy$d>VphzQPf#Kk1vJ+rQBVG3;mB#$#M_=0&u$1;?CIoUi?C7mir;b1vV80;(h zJmdZcuz0FTT@lvL5eR;$YrY$#{i{yGf^iXN?k$h;`$Y?h#XiCC$BmSnyleioT$*xD zC(yMi3%Wb~Ij_eBSNO$WFZyJ5*!p4}=Sj+kZqHjorGHv~{lx|**JC6OOjbhwXXF5P&AOTJF4E=G#igIDM-={qRV50#(YdupXs z%hpbzrAuQJ_>$9RCmOhSW|`-Gow%l|-3pJ?jxZdc1Tw?M$Y| zPA-pLYF;Mj&cuKew5A;W0H6+8GvjiyPqMyb)LDVOr0uehKvDqs1Uphp-kpDk#vDAj z~y=Taz>z{t*KC;h5XfLKT!#4`s_nu4FDyP0!^wgV|ApZwh## z46LogMCnv+sc{h?`ZTusq*b}E1n(1&9H6y6hSHie!J_ip`0pws!VbKlbsZvn^X3Z4 ztorYovf^Pt=Sr2sCAGctqR2vOc!`HM6u3FVFbXD}9H0R-gJp(c(3IXRMv@Ks{r=l> zQV)oIR*K8F^9hhPN&pGtzbS~NrQUl+p+{MQUQISe$w4*WB}Ic5G5a7t$@~)Wnkv~< zaox8>tZ{jD&HYd?1b`|3A7$iir)?ykgV%IMDK07z2<>#IaolEiHX0T_eK2vretH-a zCjl6Pq~tt>N!fv%xK$>!Te%8|*x>1-P=6ykcs8xIsbtgjupUq2M0f*+RdzwkM@zhI zL>gz3&K1H|HI>Zjn{rW`U7K1^blDubg}oiS;eF5GMlP&vjPfE<2IW<86v@?2iv|dO z`W3~F4;d1-KA2~oONWrE=B}NEddGz;rSUKSKPCkk)osLYBnpSyKV5_eRZznB5pUf^ ze(7eNB8in|OW%_y1z+F*XDDo>*ZaZvC?h*BCd1B|x8d93Yk9`)6~{oD7E1<32$K`Z z7b+;O-|J^FINYrTB^r)(0({E2;tK13;(>_MADvh#B5(@h?gTd*(YJ~*RV0zcgis_B z*q_h)5*%K<@5vs*%u(?AA_fOnT~#;GJ8V=YmMl<;RijYP6xRYr6Ck$tNm&T+KBij= zqT;BzBj?E!hgOjgSTiCi7aF=X&zdTvp4#qiYp8kXId~r1ho#i**|_aTGTtJ+?TVTk z#ec(wCs33q4O4?@Ihs{#Cq97>iycbx@`}9!`M!QOUZ3_Q^&OeaQEA78U18976G)Vc zr*c|@j5_nu{j- zTx&!&o4P@`))`l9MB5-|{aFd0N_M%!I)C*pn(BE*)&V-HK+437e`iN39fF@EOM63P z>}vn-+}Q26vZX0V$-syhxuzpV2PuVzgiY1K^tuVQmi}wFgR+WXg00{$DvbI}J(|bd z=e%p^?tnUppS|>W>p7mm>;*RbSApR|G$+0kQn9GSEZ)g4utgtvx0xZm$`-iqA3OH{ zP=ILIveP+GKN9+sV+AXIt;f&|UWVvYaw#iN9=ege8D+oXnr9vVC6=pF;@~z7>al-A z&0J!th}{vCd+le^!0oirQd_bTM*Pg@SO5W|vni8=D8x1a6hJEi(T{FAlW_}hQ2sOh z+Y=4ghUHlnM0YYD9kx4#1@B9FlBihHj8<|EG*D_W0z@HiY^0cyVSmz+e^?UFT8P}O zSOmmfg-YBVv3Yw>gkVmxAwC4O5YB1r00-t{W1scgG47sB@-BlQe-^Oysk_c0v#ZPZ z6-JqF1O=w-22{VM-r+bG*#v$#PwiC_~lQWwm=cW&trF)^4IxKCuibRa}iloySh zPu!FikeR8jnitVaJ>E+$#JMWuEouj|htC3}6dkJrRo*#dq~;>YT89?=(!_BwAv5~`6Cy}d z@R&5GU#t;-p32BaAkHtwfo#Q?U}rbvPUdSoMP$oou z3U6-;y>F2O_520z08FqzJK!tl)`3Hh4s3N3jG#S}zBvt4Te<{x^rN34@p8qw!=Mfb zuOm@P#%pttL_dAZF)B6<&xD{r-mPPa_4g?BmDTAoTE|&5%bq<+-4dRRiC$$87yY|` zqh8y4x->c?&9~dpcoYZT57bu`2nMW!DLuPZ2wzo~de*0kOi`><8PpPWS!Ydvz5{0J zz1p!QZVw|wnF8Re>~3nFZ^C*=kDHfntIKHl4u&o{@497TiTw+>l!4b1LR&C7F5$M| zu8tgZZ;F)mTcG?_r@t|4Ki&#qxoxMGeL$!hGCsiFn5dI{_T)T;R3z;rdg~;6Q-d?K zghBDI?D)YR^BinG%;3vR4t*wcHB~%p!Qxv}IjlP+(paKv(&Oym*L7cNVm%w)qwY_2 z3<`N8F3sZO+!E?C@Q@)fxHMw2PdDKYq04A@mHdhE#1h-pUgaMC+bAB?C7DR0we54z zEJ~D2KPUe3L*Vh5w)>$F_8?AUp^Z1FwT-$C&dO;F5M@#{6FN`AgOQ6k^9vtY=Q+>n2RW0OK^`3+kNP7WpJzKOQzAx#f#HZ4GBr#) zK-x=S%3YVE7x}Zux-Z>e{Uy0R|@ z4Gt8D@(L{_EKJx3u_wK+hpIV5O>ceDQ^^SV(6*bKTJTRM9Af&$!cg{6vS{!?5XQ=mVoh)Chm_z1u`3bY5(BO?sH)3KD>rr>K zHir)(f*B*R#cn6}b0W$3gKdaH)t8wE;Ol`cI>Hd9g7e2Yjw|0N3q9|y1L&pgs||i3 zai642x>=L{E2WQNlKHF*E~i>?C<9BH=8an2wWgp`Auvz|&$AQnjN%3zvmCou6Y4*k z)LKbi6rP}lF=zz;$&+I{I~bLf8zkcGI>mgz&gqfew8|VAOpc9?Cnk&p04#%oiK=iz z)zt^>pH19$P<`1jm$RMLPjgt$jhLXQAQC*ylzIa%9JXCH6k1RO;nW z5+Ri_epa~ZvM@+FR16JAp>(M)#Vn<&pGTXyX0E+o5|E-!2WE>4aq=(w+vVt~>x#e` z@yqnX=icyrS#0`T z#rvTk-o~L!n|dMMa@YjvU4BI(g9ZJWXU6oTNhVk44oNS*b3^8 z@9_RG{k@t7Z%e~Q97gTTRz*X5?DiE0?VpICf_kOJKrW4ZD<1C5`wkC-z0EFjs(jdg z3CWj+PU1>U*O!D`n=vSY;~BNekH;sJ+nH2xSd|$r{nc-))G8Tua1bq3$V|>w*_i^C zl@I1FJmU}12a*O$&fMs@H(|uzoH$bH^?HFCu_Fa>eH_2A0=o`%a$n=U7OCDU?h~pE zSyGiMpxwi!6V<4*hT3oz_bcZFz^$tq5djCqOh)p!Mn0rY{hAzvz@^F0^}HNQq#Cqj zF`BUF!}DWbr%v~#-GZP;VtNdIZ>GvAcfQdkB)(zdo-rv;Fc>eh%{Muh5{DWixHT=R z2~S!?WqjAS5c7uQ6&Ppdfd zf48CsW0Uk?Z+|pzQ!XB8QnKcfZ-2qx(3Dl)T!3PZoKRb0hW~h#0iXVK zD=lZM6|F9OW**z=_D1MO1iypy3oQef%v7oCF(RM6>=CX#Aw&Xf-g#IsW_MypJ&dWO z#Yzy5YsbIb<*HD=n#S<<#swL|5+%4{`KH^{jPJI;zL8NvzJh+ap5^d;Vb2sxJo@P zv$C{6h=3Q6e}=uk!~sTNFqimgg0%RzRi$@JhP9oMO#>sEj*Y3M_`~u#Z<&)LlS5C^ z=?$`=m~0RyqR+kSEzX8MK8B=HD%4bh9x?x%w5vP-`mWY|k!orwt7bf6`>Gx*#9obz z!!>)+Sw_&Y?s%$xeaP7Jmj_C+hx3c0fN{ZAWa3WEOAeR2*M@|?kS1%!#g{=(R0bRPJfdQ1t%yL0S=O-S zbZ*SF@nt4#3%WspJ(Vyfp;o<+YT$(65^BN@!x_Dy0z-UI`VQkq(e{hPOiZI@P|M_X zpTfC5FpCsBk8tJepe?C;G4|scvr97d1pOJl{ZDM+Bi5$8++~b(?eSlh1e;POm9s13 zo!ISO>&!bAJC_`f{NbOV0X*w>{k{LD@DesrFP1n0x`EPcC~tj$n6=Wi3Ex`*NqDI^ znObrSzksVl{bSDVQLfW>`2Pe)D8--2rMWe;GXck!jV_!X)m=VE0>ksG@wE@pLPWNM zQ$lEFgR2jG1jCGmSC+az_2aMFZmp8tkuTmt>l9);p#-{6YVVOn<};;!VjXl{9{)$6 z?&R9pIBldv()C9dJn47xa|>pfR3eQXmo3qlBCl+2F!&km&VPL*eJZbcYl3vdN{4La zIsQca`K7*;gh&u;)}4If97RxnnC@W&SXVI^)3tYOO<_Wg&P?tQ z$$=!Fbx%g4c{IIze;p?9P>S!V2s48IB0LNP*%*kW{k{8R?=P6j>IRued@=d2+cNyS zGH3ZZb=sZ&N|nT{l4n!D%8~A@CZnU8)4L@QI2xU}$buyU)6bFnw1dyv0VXBeY(e|@ zk&LgKItDZxqKOuW^V9;y&TW#h1K(^7gOIwQybcU~Hi)-~M{mAc_5WeO0};kT?kL*Q ztkdU56JyvtfmoU?*!;_?k5^FcFCxn0yV0vY$TR*RG)CeiOIrN9QnZGdWn%A|sG|={ z#CO*zt^aqeEMXgJAMW*dNAbdq;@GT4F8~74+IIx3ZUrYRizpJ~J^t@`bO*~W7?74$ zy_k!v#D^Vm^Spa(l)y~JxVzE$yVEO&w;U|=)Guk$D3Q3+w9nRY zY0zB*vh{~u6waMzn^i%uoc=l~Yl-$8=R5(z1x?Y%nAsTs?F2W$(R#xAm#Bnht<lG+b=AUu=M6~`LdO7nIfhaq%Ol3~oBfTe z&Pb1EH}tAWAVj|u8)Q7$s0))Rev5MO61)SiZ)skFIPuAW1l{+n>_UmFirYhy<7?hN zj(~QgarIc6EQk=@=b4JHkvfhoS_Pb+CpcB+;G}tDmCJ}-%^R8@BgN=J2-kl((zCeY z3x#E;E(7gpROGS}ZA$BPVq9lK7xYNMP>QX?a7rJNi*f#x4}TAN3<#V3^~u9@S^3|#dRnukCZ&2|4#LvMv7xM8odNu>XX|SMDG299+xDSzPmrfT~*12_~RyKa?9b@-BB?i z#E)Jdb|;U3y&o&O(5gQOLyVL`=X9xt1M5p6%(&ftd2fW**2S&jPjI4SnW1#}s3=qR zJzbZRz8h0}Q+j`weTFm>IEVLpT?ocJXJTfviaM;W=Pl$Ysw3d?~ZC)9*RsH^1rP;k_4%kDV z=J_q!!6s`c7I9um=dM5SClFs}2!C!^EZbCc6 zn9%Q+opWV#vH96g$x|27AvA1!f{a>O29q$rfgwW$>DMh{0vPS*=->AQOMq_wKfo6; zh_99y`{j4TZIeC1InSjn%jeKy)f2R$<2M$`AF2h+ru&V>b~brB`AxLm57z^icCX&d z$4T(4WMVd3??HiMS?uEMP_AcUG7%h_d~4)YxNI$`ms(G&9`!-cpmOS>bq^aKfhS?0 z!4#S!d?HkNH6C|xIBlaBUEEazEaBfq*JMCcsLCox|?9cD>b;;ntAU5(u&CEfKJQp8h*GBlv|x` z)E91(&VO&!^u!kl^M#wl6-VvWHZo>;FtxFy$Iz z#h}sSv@9@g1n9v&Yt&-zp<@^0uNwp$!0=D+v0l2d>{D%}6A`f2zHh5d+6~J`K(3I!?HQ zF&q}ATd|z_(*}>Q%C~sWwE5FWsQP7Gh~^NS#qiAiBEH8@N6%ja{4G3mq2Ycg6WzJ| z0sP=%>Gl9ckEHuK|7jQ~jmh5fl*$ z39rJl;@O&?{nga)_>5v-fi9a9rV;6Kva;-kmv^)$Hn_Z&krhLj5|+y zTGomwwKWmwyZ0ZFx|uC}>TJACH$&VUS;l>fd+^=;wnrY?`cQYF8*TS3n{b= z7L;wOGGZ0m6#e)BsckgukPv_dg)m58_yoD{r03lDNouCO)y4+akD|(t_VL+Hs<6w? zI3;dA=q@Np`%VXS{MOOSh%ccx3sU_hRa$!#%ufeXV#Vt8(S|EDpGxFSzvH*7npPAZO5ZCk zNhvg@0?-vQW3g^UrR8fY9EaYm=)L~QM`GyrJjcIS1$hgvbJFH`B|t&$t$Peja=*y0 z>0HwbUnj>nGgEaM|J=v2rKf(-(piL6ANmndduOM-9FvhVyC|-r+a^4UQ;ofjF7^73 zKjTgMO}Y|@@-E?#QnDL}?Z(%bKJm|K&DwK$QoCLT2cCAcem zqJ)R(Z*bQ{fLsXe|DPr}h=h#FAfT$~-74iHW=a}7vN$D6!?%IZKwCce5?1u-Ux0D% zD7`+jxJkQ)W@8X3qVL$?U5kIc+KS7!&GM0wW3wjrhmIwW)R+*0otw{5LjIHBO0Bw9rk!Vqj`BmicB|ac)mSZA{5Sl(X`fFcp3q)<3u}4< ziyO43AZ?50InxEOpL$DL;vLc^yPlhS+gZ&h&VKGCn?XBE;_?uA3b?VuBYuhHf@JZP z{oQA~2x_3c$#PyKGX_~SwYd-^MUA`P`phWyiyYT8<=ab$I*{LZE_&xnzkL?5fdbr~e!lc&^4SkH4=g;-hW$`KO$$D`iQ)YLcW|H;sodtH=-wR~7KcG5@KOQt zi2iHiXY7Q}C$b$-ELR(hP7-v4a6C6Pvmn;SZJpLS%1 zmXmaho|+gO5DR+<(lpMmdKLvCLHwYhC2j_5+2X+xS8?KmwRN<>PkGH^;a(~Fs#7R{ zjSW&kehm6hW^xf85PH{@bi=?BtS(jy6I*k4&{$fp3RB6oqqzG&b(#^$5x9WaC6G*f`O~TxQmBe#Zp0i-YnyWU&4N$|+#weC*IuK@B;l{G&|og%~0rv_lE& zjqV6uj{j<^s`$NplM$pN{?;8?K0a0Rk>zEq)GUKY70hHnM#CZN*v2yr&05R zVx%!T+8CDp>li48oFlN~tEJVs^xWhT*B$u(Bg(+^+aIzn77s$#|12NdA`?@$S_ke+ z`9-TOp#^g;Lv#m6)A9{}1i&29YuPS*qq2+jq&z8a*+ZVwc&nbvE2F4I;BIs`_sj?o zI`C*^HUS}{#q{YgZ!G$oP-D;FLHzllhr)oAhvXLw)a4Q}F06&QU3*_z*k*oTmpXeB zIg!Lcdy%aML~2_k8*V#Fsdzh!p*SK*Jg-5L`U(-5cFd!7toB}gAD zFu%_vz-Gze@ZLH4os%rN-BaSTK>GCK->x$sZ8;kgTcr1mIbd$O89X$H3$M}nr zyF^eO=|hnRI_Bjrlo>!hm*G(Bl4l1Gi`uyk*)`!ju(}3n-qV%Lr0@o^7}L-y5M1Kq zp<-6~mj%tY0qKRmsgZbx!BVqw=5NCByCl}L$jkF^qpYW2#eLI)W8+-hTrXPjN#m~r z>-Vpyk|RT2hdT}B0#B9^|I%lEO)b4aZ3&J=z2;w2QndBh^_axK+U2dYLW~!6 z=0}FHsr&s>6*Y>Wg(U`iIT-iJp05#bDZ&`8lrL-W=z*YrH^ElHtb;PC0BMEH=yKWE z|93i&K{Fm#3E3a4ClJtTEr`ekbE)8}^Zq2qzWqh?w5lrw9Ej_juCAASG`ylxH$^*V zL=G4%tbMadZ5)TPebuykPb*IeC!(W`2vsd}kK0+G;{$pI0Y!5VoNKK&Esva|)i9t8 zt(~Rx$&TLm2)Gwt=Cm<&kGzoC1rq_}6!AClKH!?EA8}Sy2m-dNMml>6*k+w2OI(3! zQKIsXps-L9W0$Mf`u%us_AAG}%Io2a05TNWzg`8uYqh)-M0%rrXk<2V~6-W)$_d~h77?@GCBFzRnw%)%{DgX*0X7@+4r# z5Vye2&g;-uPMmy-IKA)E#&)P! zZx@|k{$&HTrxd_vd%HgE-30{xH}1bjeb}#Swnuh{=5f~zEB_<+!7)%({?9If)8L@e zP^=pMFT(Zd1<%YhIhdYaN3M0{%;-WoYx5W`N$0>;*=&cD9`i3}M`k#GgTfmb?dyQ5 z1J9+<@&3&-_Tu7R;ZLtZ!EId*APfy#l3QeJy>ont@n&JzI9OtRnE(GQq z+|IUT`6`3X4t#itr%Fh`@*0Dn)oNjS^lYAUr*$$4cH2NCzph$Kz>udO)wdX%^DOkY zIEBY?o_bRCWmy6`X}XP=+5UO*E!kFMs!M{))+OrofM29XZ&`C$uBL&EYC(e4?& zgyO7@PyN(LUCXgeGWCaO+3Kh~`KX2SEZP=OLQk9{dPY(@wIM3yVzeoMY}4o*fWA|u zX8Oh3tu+-YrKmMtx0&?eX`5$Dr+kT!ypK#<5BqI6<#3%4CdO9UxP65KK<+1#GFukD zMtVujbp@Gl=wL~a-{m0Np7eiZ7qoFf%wJ+mU)8CScEDm6v9!tSzd_1!r!35T36&}e zl>kib;3G%U+Cb8OcZH^1GJL0dLXzR_-PonUxuJ)^&;)k;g(dFM1g!2FN;Gt8KHi%f z8Xhk=G3B+Fsa=zR>w_s<`l|F1DVJ%)Wla78V{3jS!QO{&A|n+{-oD>xR^R=Dd|AZ_ z95VLy&@gM1!9NtPW8!?vk+mcuj@_YP&tB#kboWjMT3IF8wSx0(XmG3VMU&JJ?DIC( zN(eL`CXuT9V+ev!y#K0vs%EMuB!bor3xwByzLbyl>Dyk)X5BaV++wj_fohi{I-?*2XKp7mT+Tg zQJjZ-GR6bgp1BiLs9Vt;G6Id@6FEqXS^6%Oo#iySNqev4^7dl5@wJ*T(jBB84+P8P zeOiYFCUs_cS;CYPhCGPMN^w?`4;!)j((Itw3OYo-4gwmo*lCb#*<7cmr?j+LnVF|H z<)LS;yxbl+fsDZu+Z^xz)k1gqSz;$7?tvH}88*EUokO~nNY&#Q^8d=ezXS2Zsdlib zbn%D=x@Vrn93h@%Y_rrkwS1cgpX0j)1U7s)C~Z`SdTd-At{OIK6C=4cR2C#;9o@H! ztvsbHv;iJd>^_Vn52BqvzFcN<;nnP}Xd|y-uL9RyaxqPdaK_s4A0e}3!dz0OmL>}c z*Rf_&)QNlnq*X*}M6uc(+y5l;-?g5efQSDkYrIYDDU>A~fC#NJS$d{0?oz;fxFOIr z97=Wusf&JY3-our{l9qex2Pv2>Dss#8QMy5Guw7B&G&W0LqF7f%@D_?a!Bdw1SVh& zM-^m{H{|bI7rF0drbSj)&=AHUpH|z-^T|7yJTb|=D+#JOCP1Yc9E5#BY?&NI4)79| zttl$L7^@@#8$E7f(B&skRyuv0h2-7&vq;5<7N-tWVEz;N`dJu6P?{e$9xQBi2~Mt% z{O7F!BO+lML~OBiEF+B_PQIWmBh}sTotr8I9T3Re0?mZ98i;@fEhVUQq-SdlNiyto z!1}uW?XI*yYe0@@$jaMy#y`7k@C%&2PcMf=iyb|-)Z_jFrO&FeAF0?0AUZXbHQX;q zq4cqcF$kznkr6d|8w`RhauHwk;3NQ;X(!3`dR-QtaidB*W27kZh;<_~pPn@oh}1vb zed5Up`sN>70Hj1hW9rHnqssWxjFXCy^orDq1>q^IELi){zJ|;;e{rcp*U3OS(+kgTYk4x{Xh*ADJ z6W(&IBnJzTK&&l|N1xfPyQ`9s(xytI4NxfqLxbLc#Q3A|2Q0ahzF7C0&$ZM?6HW{N zI%{efH}eyyIGL&ahp%K^>GMU3904n3mL~E%nzoXXA&)h2i;S;N`8usZSo?0UjR2BL zh80_@zn&#|8_i%d6B(SeekI0z(MzgGOH)F@^ci)Uc;wjkLpb)OP9}*@6MmnKD+c5N z{TMb0pg1Plog8H3$JQ?hPbCbTS{dYWgQYfS?O|({{;GNB)f~Va+zQnzj<2W6FljMX zC3@~m*7;t!$G9UH!AV?;a$}%Lt(I`$v^23Vf=ophdeG&{?Q)hzb0U%-p8|3e=RDE! znsVxB)Wb3jw`GA=8v-;QrCx=@&vkH4wFgQLIuT~AZmLqf=~K&?!_TCxipYNLwb3=^F%NA zdDRHS!DQRjnFuO!HXYQMsB}@~QazBq3cDEv=0;CaDdG~iiX@DQsLYh}`dEqa*`eew30kl6Gy zJaVU$KgGJKqJ>2I306in>o;eoC;eK z5n$V;F4Z%)YR9+Q+^!|jB=)B=Xb6t#^60w-Y6)GLoi!(H_pfvp!%6fulOLPxG2=K< z()>7ehtIpZAQfB;x5TX~9Gf%RdRwgjLw9=U8#CddSL5Hehv(B2`L|ypb+-W&v7nzb zWajn3iQ4e{xT#%cp%*65t}47fGLlYwigF9*TjY3@!S*Gh$B!<}4!A+?-hcMIP!vQP zv0mRS=xLc52vUqcdbC){+ILF|uPvUsYt4`Cslc^18iGH3)6OiAq-1Z{NllccdJgbT zy)JBh>F0MLw3hv_DNfH0grJ}E;&Au|4S>o<%QiXp6a~1dXzX~+ds4|$ThvNikufbI z*w?8~IKA~pD7n$$LDa$3;!t89tu~zkea}TPI!5PH&ZlpSJJqM(a>aJvaqu_JrdBHOA5q?!DhxY>z5V}{Hhl5ES!oQ1#dFS0-94j-5AXZY1KctM_gf`S( zyqriOU~;T&fTuHauk96kAyMF8t%^~LdLBIfH$g88$ zj-e|>AV3*|)PRNXNbvpuBlbCP8cxg_f(BB$Wk3eC6bJf=E-9Zrp^$P^gD!iPfKtvv z-UuvQSzNTA78+bYi>2BWgdNmWr1*P`)rHqHE@5H6#~lMbv5((Js$72SQ_Diy;wf%&Qohla zBvA)w(O=&)K%dItD&E@GO9_eHfj(_E;>1*Mht$AFNn~{W|3pvSR@;#w;Y!eUNU9`f z`0Mo&TvI-Ngnej+t$qNXc=N3mDC*y9DrmEvArb8l@*1DXe+8JX_g2 zEbg=@-A&nh1E;rn@7$XPaWoo%5WXvNP&1feDr)zZe(uYs(dcroZz$))u(c^KVPW0= z=;R$YVqe0Fe~AMu|VW0o3xi*=)%^Z4D2Y zKQ8ms3n4HZ0Cs zdq--fiR9yGr;F+UhGN)|9&0n-yp~cds7QQVEJWF56eFk2+GG|!^ke&8bh8%O#+JB6owkAdT(gwX4dpC5-FN&@O|Zjbzlp2 zpYrVGLJV2>#roWgG*uR7)8)TOPY%<_LUlQ%@bor(LV_TJhh#cYTKB>3#Gm#jFz4V?JY@o=>(IqVS)_NDCx-A0CRPK5w-l4~&tB zV-VRx)GSZNam*IV|E-DW^kLzXxyJ^4@QMg9t-j|gB)`fok?;1&leE8zB8I*q;k>ak z>h3txggtIM$6*3&oLohGxRax|}5}SH#&qm&tg!fHYJRB8?_obJAh|`tJ zrF1Um9Uwd;wz8ady#)m$+*PIpyju#v42~UE#Vmemrv*)S4_}iTa^jrp3`hqY4iAV1 zT>>8rkI%g=&9LZ>G#6C{c2xc<<&krrM2|zj%gEJpfQ7PviN)SE;h+dCS^uQo<;GY)>9kE{m_dQC{J5le2x zxNwJt{_!{Q)Ku)}dF`pj6_5Rx%@jei|EbLVnk_`c2CtP;nF1zHmVk2FwZ`{gLDt?X zo7I#&m=gsri$eDF=jK zp62h6WL+a9!za9pr%Lj@%J)Rn(nY1(5gAfzOl*tz-Fb};q4)c^Z#;1_Zh|#Iv(g&{ z3k(cg)M(a>Dglf&(RD*|4WC8RVG5B|$85s-P8L4sS_Fe|(HaNmiGJ+B@(5~lv#C>9 z+OFaw=Z1vTsa~c>=N2g>)8LX0J{63U>|k5+^pY&(Plp2wUKdD~U)c?5jg8djUoYIA zl0b#RNBQm5%Qq`5R)2CKH;eEo#i|K^IFpLP=iOLA6sWdh$bpG64h;)W49EQXGDe4o z5&3`^u}~&e<0_mxDjfIH_68+VK+lEC;5VV58(9U+gT* z-yke3^#suu=;I7lows26Mi{pG8z{yJm5nKs8SCS&4G2f5`F zUn?=Z9vKEoUPlDw8qxM{9Px72Sj2A`^~4&iagz*M97-E7h@agU5bphv4cpfD;X{QQwmw3?6^(UJ~-x<;qbIEmEL2ZqZ(Qyb6( z_tG`ACLMb9-x$KGN<3)=vsfecr9@R_RkN6kzL{q0I8i^ZW%67bRsihMa zNLL+}1r%N42$+_a8f!Fx90aM4?2~k8I_ep!^rPRTP&_f&a-is6#}gN}<0t73+2rR= zMVA+U5=Plpbnz926QK`{`WC%qC2$d5Et)Rid0R6$D#Re3L_xgAjUQ`%Wc1n=xWFK8 zJ`|sZ59GIY=j#J+3WJUUwKaF1-3m4d&6ANjDsvwLRb=H6B3HrwI)K#B{CZa@^{4QA zmyVlXev1)`8e+!MpY%1`A}~Tooi<3KXy#>KUzhc(0fKhCZShx*ZVVnJ(Bxg-A?6j< zQNhX)^i1+sCV59bbS!Za-Uq5PeWC=aa(9Y0*x2hw8kSQuMPDvG2*`O+YJ0;VEAQ8t zYp&<|TQMO>TsoS5^Gh1|S43G=_vg>`3ZU0P@3F69hi8#*;XyuzZ>%)cx0ItVKj4}?)&T@E2D8-X= zP3T3Tv&A%Aq-j^y-6s=vYj}TjYqcwX4I+^SCiR{|w!S@1+|eS0iBm_Hs~92SD%mkq zeczsaD4_p)Zx(D~HK-3lkr5oaR+O#)8XqNVL)IS*v-ok2Qm{>QQEF<;o0PSUYcyxM zRx#6p)H2Kv!5|$4hik);j`bF_oNmws5Mu6jcB^(F^N;7Fz=u#OYRCBODSZHBifR}I z8!rU1z81^LH`X|ykAVM7sF;=Z?siL@7HP$!$B!zeOVVMB-$5#1@*yAi{Hc*(6Rhsh z(Y~WTxSyNW?prO^w~8t?NS(S|)91JJlo`uIVY#Es)?X}BWFJ*)R61&XUYF(^m;sxA zOG%a_WAGDKCS^9uN+AINI5a<`&Md&yHEo|r#r4@fXz2D_Or2WVnpN-O$$IJSF+>K; z5r{#uJ{*4{tjB(l!gHZGeWJT(4-6QhJH63C#7r6o)k-@LfOBd5t-D|#JWnd@`y=;e zTTDwPY!KzBV;*>4$Z0I1l40hh0vKi@Wc^#enF>b%)U415wt;466O)k}KmT{P7vq&W z`X}*urled@91=@fIn=bv!3?UkWR~Ne|H_=oz;R#Xo71z+ijO))v}AK|vk0io^%7ii zNm!n49)@4nsdEVaVGGRcU?--r;V$0I&8B{RJ#PV2t)4=!I+@w`fZEC};5p8IXtI3Y zd78-c%xQT&vOoX=IJNNz#G6Gd+=?<*u}jRJ6-0L+xt+YRyAthYjiBQpm_X#N*(SD^ z93m-_ZLp#d2+2vx6I{Xj;If4U_bKUlIPnt~a}3UL#8i}1VVxD$zRCIP4EVd^ixh6s zOI4bv9c>W$3?v4&7yjohP>GOZchC@sVtbK|X2T0dF9C7oJ)+e?-S*_ z;z^ehuh@$EJ~kaho+3EHQmt<_Wy~uEs6fe0ZR;U4>2k84@U@0*P{&mvOOFj$ZHpW< z>C@R=L$ILY2!>yA*L;yQeoKWf(um^q4BKQ{r%cb~vK$=YD5<{R#53R{iq1-Sb#FiQ zF2Gcy=%fmJf$cS?&{|vyUucEM=~M-x#CxCl#fSr5B|Bslh4fTnv4?89IGpXzhefs?wqAt#xgkQPwL2XDSPjT-#zOU8SlyBBFY~{3tH2^}B zVg+tYge7+j*Uj{kFTNa*wxlga znGN~+A1zGh?zz^KRR?0B%z4))qQeYY|prFeZqvC(}p=S-6szkE>9~5bE^~ z>1!s7xe*h)S>rW}I9!k2^5MGCJYad!II?4!l1gsm1HcPJ~$rxGDPgW6j=-= z`I3yM>H_uOWc-sMygT%ghwhJ{niMLlBBff$X}CCUDIlMk^=z1Pr2p(VZkoY^T~UYN zAB=o>vXBGYp1EiCD?%IKI8?02XRR)aM%i3q%EaxVP7?EhFo*7Ad}U)u!lMK&W6;o; zu0`}R`a|iw5M=W$F#KM<&ZF)E47orw3k-Alu7-lD%!@MBg+R}=L}xKZhnggM;>g;E zOkpN7rCDw=fc<$68vFPt_#`}oYYNt9hS(XAkorTkA|?cRFt)P8s9XJFv+7!1tWku@ zlf~LYe9Csg(yVR)O8;is0ZB-|IlMsP0 zsMiQ#TZ|s&YViY&aece7aOMNpKut(5mkaB#^ZBT}MA34Hi()G%jOP8EH7)eqVfr5& zX}%kO@&k96v@iwvpsMuQ0$>bJC?`b`4|UN|POGa)LX?pcnK_(^0uaIyme~ug4fwuE zJE^qjb->aifDu#%Mx1gX3O{L6hY`h;XX8#I960xMbguq#;#@Gogl zawI3L7nd(>%>A+)8q$jIz(amviBzt0{**PXe_j*B;m@LL<`Uf;6b;>iNqETY$GvlL z&L}dFFCE{pRsJkSF6$K5{r+@i5q$bXwOSsS!DjY554A_zg<4l0t-Y0&YkGS@zeP2DnehR- zeo*v)D_;E?L-Y?znNVGtraSf-QU% znEmD2a&>F!%Bysfvm$9i)=2dz$2YC`&5|_^b0HcmeV@5KN_S2-=|b>NVw+NA)yHQ_ zg2_4U00GhIr|}D4Co$Zy=riv?Q>fBKKHmkt;TNy|YSFXX!DhH@R(mI-Qc{R|=SnIn zVLfc>1@(y8+Ak;m4l zvzS6>t|)~XJAKaSVaN!mjZ4)xyoeG>9og)oFuNTl07Jc{vC_3);rc$X(qKb^45>yZ>$HGPu9AQ=lfmB7H~Fh2ly%H~uvPhm@J6DZl6p~A_O?16%~_t~G7}eg zWPJbMc;xiw7Iw=(;LJg!i5Ey@n6ndBW#^{6n0NBOR^wecGCba74SEyTFl@7+-m`v`s0($-T1+jnevfc^~m_bqu{K7*2l zovei|;jJFhg6|fooJ5c6TsDv;)|(S~qNLklaNm5;2@Ba$bPx8D#FHNc7isZjjLji? zI+u_Zx3qZ#@{A!f)`uVNp5K(*2lNi@_4GHB$Fi?&kt$dK000Y%Yc6z&9a6YM_vg1Q zLGuQkWo84fovII0&;{4$(@SOS0%1;apPofnucsycnkpKcQnvNNgBV1}w7E)x?M2!4<1!uFG%PBHyB1V2a zg0sS&9zEN!BSL_%UzU9YQ%qzL=CgZ^2JExyh5H^5^H?lAyI6Ubg5%4u=&G../modules/tee/tf-m/trusted-firmware-m/platform/ext/target/adi/max32657/partition/flash_layout.h file.` -If you would like to update flash region for your application you shall update related section in -these files. - -Additionally if firmware update feature requires slot1 and slot1_ns section need to be -defined. On default the section size set as 0 due to firmware update not requires on default. - - -Peripherals and Memory Ownership --------------------------------- - -The ARM Security Extensions model allows system developers to partition device hardware and -software resources, so that they exist in either the Secure world for the security subsystem, -or the Normal world for everything else. Correct system design can ensure that no Secure world -assets can be accessed from the Normal world. A Secure design places all sensitive resources -in the Secure world, and ideally has robust software running that can protect assets against -a wide range of possible software attacks (`1`_). - -MPC (Memory Protection Controller) and PPC (Peripheral Protection Controller) are allow to -protect memory and peripheral. Incase of need peripheral and flash ownership can be updated in -../modules/tee/tf-m/trusted-firmware-m/platform/ext/target/adi/max32657/s_ns_access.cmake` -file by updating cmake flags to ON/OFF. - -As an example for below configuration TRNG, SRAM_0 and SRAM_1 is not going to be accessible -by non-secure. All others is going to be accessible by NS world. - -.. code-block:: - - set(ADI_NS_PRPH_GCR ON CACHE BOOL "") - set(ADI_NS_PRPH_SIR ON CACHE BOOL "") - set(ADI_NS_PRPH_FCR ON CACHE BOOL "") - set(ADI_NS_PRPH_WDT ON CACHE BOOL "") - set(ADI_NS_PRPH_AES OFF CACHE BOOL "") - set(ADI_NS_PRPH_AESKEY OFF CACHE BOOL "") - set(ADI_NS_PRPH_CRC ON CACHE BOOL "") - set(ADI_NS_PRPH_GPIO0 ON CACHE BOOL "") - set(ADI_NS_PRPH_TIMER0 ON CACHE BOOL "") - set(ADI_NS_PRPH_TIMER1 ON CACHE BOOL "") - set(ADI_NS_PRPH_TIMER2 ON CACHE BOOL "") - set(ADI_NS_PRPH_TIMER3 ON CACHE BOOL "") - set(ADI_NS_PRPH_TIMER4 ON CACHE BOOL "") - set(ADI_NS_PRPH_TIMER5 ON CACHE BOOL "") - set(ADI_NS_PRPH_I3C ON CACHE BOOL "") - set(ADI_NS_PRPH_UART ON CACHE BOOL "") - set(ADI_NS_PRPH_SPI ON CACHE BOOL "") - set(ADI_NS_PRPH_TRNG OFF CACHE BOOL "") - set(ADI_NS_PRPH_BTLE_DBB ON CACHE BOOL "") - set(ADI_NS_PRPH_BTLE_RFFE ON CACHE BOOL "") - set(ADI_NS_PRPH_RSTZ ON CACHE BOOL "") - set(ADI_NS_PRPH_BOOST ON CACHE BOOL "") - set(ADI_NS_PRPH_BBSIR ON CACHE BOOL "") - set(ADI_NS_PRPH_BBFCR ON CACHE BOOL "") - set(ADI_NS_PRPH_RTC ON CACHE BOOL "") - set(ADI_NS_PRPH_WUT0 ON CACHE BOOL "") - set(ADI_NS_PRPH_WUT1 ON CACHE BOOL "") - set(ADI_NS_PRPH_PWR ON CACHE BOOL "") - set(ADI_NS_PRPH_MCR ON CACHE BOOL "") - - # SRAMs - set(ADI_NS_SRAM_0 OFF CACHE BOOL "Size: 32KB") - set(ADI_NS_SRAM_1 OFF CACHE BOOL "Size: 32KB") - set(ADI_NS_SRAM_2 ON CACHE BOOL "Size: 64KB") - set(ADI_NS_SRAM_3 ON CACHE BOOL "Size: 64KB") - set(ADI_NS_SRAM_4 ON CACHE BOOL "Size: 64KB") - - # Ramfuncs section size - set(ADI_S_RAM_CODE_SIZE "0x800" CACHE STRING "Default: 2KB") - - # Flash: BL2, TFM and Zephyr are contiguous sections. - set(ADI_FLASH_AREA_BL2_SIZE "0x10000" CACHE STRING "Default: 64KB") - set(ADI_FLASH_S_PARTITION_SIZE "0x50000" CACHE STRING "Default: 320KB") - set(ADI_FLASH_NS_PARTITION_SIZE "0x90000" CACHE STRING "Default: 576KB") - set(ADI_FLASH_PS_AREA_SIZE "0x4000" CACHE STRING "Default: 16KB") - set(ADI_FLASH_ITS_AREA_SIZE "0x4000" CACHE STRING "Default: 16KB") - - # - # Allow user set S-NS resources ownership by overlay file - # - if(EXISTS "${CMAKE_BINARY_DIR}/../../s_ns_access_overlay.cmake") - include(${CMAKE_BINARY_DIR}/../../s_ns_access_overlay.cmake) - endif() - - -As an alternative method (which recommended) user can configurate ownership peripheral by -an cmake overlay file too without touching TF-M source files. For this path -create ``s_ns_access_overlay.cmake`` file under your project root folder and put peripheral/memory -you would like to be accessible by secure world. - -As an example if below configuration files been put in the ``s_ns_access_overlay.cmake`` file -TRNG, SRAM_0 and SRAM_1 will be accessible by secure world only. - -.. code-block:: - - set(ADI_NS_PRPH_TRNG OFF CACHE BOOL "") - set(ADI_NS_SRAM_0 OFF CACHE BOOL "Size: 32KB") - set(ADI_NS_SRAM_1 OFF CACHE BOOL "Size: 32KB") - - -Programming and Debugging -************************* - -.. zephyr:board-supported-runners:: - -Flashing -======== - -Here is an example for the :zephyr:code-sample:`hello_world` application. This example uses the -:ref:`jlink-debug-host-tools` as default. - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: max32658evkit/max32658 - :goals: flash - -Open a serial terminal, reset the board (press the RESET button), and you should -see the following message in the terminal: - -.. code-block:: console - - ***** Booting Zephyr OS build v4.1.0 ***** - Hello World! max32658evkit/max32658 - -Building and flashing secure/non-secure with Arm |reg| TrustZone |reg| ----------------------------------------------------------------------- -The TF-M integration samples can be run using the -``max32658evkit/max32658/ns`` board target. To run we need to manually flash -the resulting image (``tfm_merged.hex``) with a J-Link as follows -(reset and erase are for recovering a locked core): - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: max32658evkit/max32658/ns - :goals: build - -.. code-block:: console - - west flash --hex-file build/zephyr/tfm_merged.hex - -.. code-block:: console - - [INF] Starting bootloader - [WRN] This device was provisioned with dummy keys. This device is NOT SECURE - [INF] PSA Crypto init done, sig_type: RSA-3072 - [WRN] Cannot upgrade: slots have non-compatible sectors - [WRN] Cannot upgrade: slots have non-compatible sectors - [INF] Bootloader chainload address offset: 0x10000 - [INF] Jumping to the first image slot - ***** Booting Zephyr OS build v4.2.0 ***** - Hello World! max32658evkit/max32658/ns - - -Debugging -========= - -Here is an example for the :zephyr:code-sample:`hello_world` application. This example uses the -:ref:`jlink-debug-host-tools` as default. - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: max32658evkit/max32658 - :goals: debug - -Open a serial terminal, step through the application in your debugger, and you -should see the following message in the terminal: - -.. code-block:: console - - ***** Booting Zephyr OS build v4.2.0 ***** - Hello World! max32658evkit/max32658 - -References -********** - -.. _1: - https://developer.arm.com/documentation/100935/0100/The-TrustZone-hardware-architecture- - -.. _Trusted Firmware M: - https://tf-m-user-guide.trustedfirmware.org/building/tfm_build_instruction.html diff --git a/boards/adi/max32658evkit/max32658evkit_max32658.dts b/boards/adi/max32658evkit/max32658evkit_max32658.dts deleted file mode 100644 index 20b52890f76b..000000000000 --- a/boards/adi/max32658evkit/max32658evkit_max32658.dts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2024-2025 Analog Devices, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "max32658evkit_max32658_common.dtsi" - -/ { - chosen { - zephyr,sram = &secure_ram; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_partition; - }; - - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - secure_ram: partition@30000000 { - label = "secure-memory"; - reg = <0x30000000 DT_SIZE_K(256)>; - }; - }; -}; - -&flash0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - slot0_partition: partition@0 { - label = "image-0"; - reg = <0x0 DT_SIZE_K(960)>; - read-only; - }; - - storage_partition: partition@f0000 { - label = "storage"; - reg = <0xf0000 DT_SIZE_K(64)>; - }; - }; -}; - -&trng { - status = "okay"; -}; diff --git a/boards/adi/max32658evkit/max32658evkit_max32658.yaml b/boards/adi/max32658evkit/max32658evkit_max32658.yaml deleted file mode 100644 index f4e7fdac7f8f..000000000000 --- a/boards/adi/max32658evkit/max32658evkit_max32658.yaml +++ /dev/null @@ -1,21 +0,0 @@ -identifier: max32658evkit/max32658 -name: max32658evkit-max32658 -vendor: adi -type: mcu -arch: arm -toolchain: - - zephyr - - gnuarmemb -supported: - - serial - - gpio - - trng - - watchdog - - dma - - counter - - pwm - - rtc_counter - - spi - - i3c -ram: 256 -flash: 960 diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_common.dtsi b/boards/adi/max32658evkit/max32658evkit_max32658_common.dtsi deleted file mode 100644 index 9b65c7bffab6..000000000000 --- a/boards/adi/max32658evkit/max32658evkit_max32658_common.dtsi +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2024-2025 Analog Devices, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -/ { - model = "Analog Devices MAX32658EVKIT"; - compatible = "adi,max32658evkit"; - - chosen { - zephyr,console = &uart0; - zephyr,cortex-m-idle-timer = &counter_wut1; - zephyr,shell-uart = &uart0; - }; - - leds { - compatible = "gpio-leds"; - - led1: led_1 { - gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; - label = "Green LED"; - }; - }; - - buttons { - compatible = "gpio-keys"; - - pb1: pb1 { - gpios = <&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "SW2"; - zephyr,code = ; - }; - }; - - /* These aliases are provided for compatibility with samples */ - aliases { - accel0 = &adxl367; - led0 = &led1; - sw0 = &pb1; - watchdog0 = &wdt0; - }; -}; - -&uart0 { - pinctrl-0 = <&uart0_tx_p0_9 &uart0_rx_p0_5>; - pinctrl-names = "default"; - current-speed = <115200>; - data-bits = <8>; - parity = "none"; - status = "okay"; -}; - -&clk_ipo { - status = "okay"; -}; - -&gpio0 { - status = "okay"; -}; - -&wdt0 { - status = "okay"; -}; - -&spi0 { - status = "okay"; - pinctrl-0 = <&spi0_mosi_p0_2 &spi0_miso_p0_4 &spi0_sck_p0_6 &spi0_ss0_p0_3>; - pinctrl-names = "default"; -}; - -&rtc_counter { - status = "okay"; - clock-source = ; -}; - -&i3c0 { - status = "okay"; - pinctrl-0 = <&i3c_scl_p0_0 &i3c_sda_p0_1>; - pinctrl-names = "default"; - i2c-scl-hz = ; - i3c-scl-hz = ; - i3c-od-scl-hz = ; - - adxl367: adxl367@530000000000000000 { - compatible = "adi,adxl367"; - reg = <0x53 0x00 0x00>; - status = "okay"; - }; -}; - -&wut0 { - clock-source = ; -}; - -&wut1 { - status = "okay"; - clock-source = ; - wakeup-source; - counter_wut1: counter { - status = "okay"; - }; -}; diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_defconfig b/boards/adi/max32658evkit/max32658evkit_max32658_defconfig deleted file mode 100644 index 25ef03ee5131..000000000000 --- a/boards/adi/max32658evkit/max32658evkit_max32658_defconfig +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2024-2025 Analog Devices, Inc. -# SPDX-License-Identifier: Apache-2.0 - -# Enable GPIO -CONFIG_GPIO=y - -# Console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable UART -CONFIG_SERIAL=y -CONFIG_UART_INTERRUPT_DRIVEN=y - -# It is secure fw, enable flags -CONFIG_TRUSTED_EXECUTION_SECURE=y diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_ns.dts b/boards/adi/max32658evkit/max32658evkit_max32658_ns.dts deleted file mode 100644 index 0cc9f0880480..000000000000 --- a/boards/adi/max32658evkit/max32658evkit_max32658_ns.dts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2024-2025 Analog Devices, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "max32658evkit_max32658_common.dtsi" - -/ { - chosen { - zephyr,sram = &non_secure_ram; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - }; - - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - /* RAM split used by TFM */ - secure_ram: partition@20000000 { - label = "secure-memory"; - reg = <0x20000000 DT_SIZE_K(64)>; - }; - - non_secure_ram: partition@20010000 { - label = "non-secure-memory"; - reg = <0x20010000 DT_SIZE_K(192)>; - }; - }; -}; - -&flash0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - read-only; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(320)>; - }; - - slot0_ns_partition: partition@60000 { - label = "image-0-nonsecure"; - reg = <0x60000 DT_SIZE_K(576)>; - }; - - /* - * slot1_partition: partition@f0000 { - * label = "image-1"; - * reg = <0xf0000 DT_SIZE_K(0)>; - * }; - * slot1_ns_partition: partition@f0000 { - * label = "image-1-nonsecure"; - * reg = <0xf0000 DT_SIZE_K(0)>; - * }; - */ - - storage_partition: partition@f0000 { - label = "storage"; - reg = <0xf0000 DT_SIZE_K(64)>; - }; - }; -}; diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_ns.yaml b/boards/adi/max32658evkit/max32658evkit_max32658_ns.yaml deleted file mode 100644 index 9868c5bb8a71..000000000000 --- a/boards/adi/max32658evkit/max32658evkit_max32658_ns.yaml +++ /dev/null @@ -1,20 +0,0 @@ -identifier: max32658evkit/max32658/ns -name: max32658evkit-max32658-Non-Secure -vendor: adi -type: mcu -arch: arm -toolchain: - - zephyr - - gnuarmemb -supported: - - serial - - gpio - - watchdog - - dma - - counter - - pwm - - rtc_counter - - spi - - i3c -ram: 192 -flash: 576 diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_ns_defconfig b/boards/adi/max32658evkit/max32658evkit_max32658_ns_defconfig deleted file mode 100644 index d808f79c5459..000000000000 --- a/boards/adi/max32658evkit/max32658evkit_max32658_ns_defconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2024-2025 Analog Devices, Inc. -# SPDX-License-Identifier: Apache-2.0 - -# Enable GPIO -CONFIG_GPIO=y - -# Console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable UART -CONFIG_SERIAL=y -CONFIG_UART_INTERRUPT_DRIVEN=y - -# It is non-secure fw, enable flags -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# Set TFM and Zephyr sign key -CONFIG_TFM_MCUBOOT_SIGNATURE_TYPE="RSA-3072" diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 4b730b4a342d..a8d51666591e 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -251,7 +251,7 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DTFM_PLATFORM_NXP_HAL_FILE_PATH=${TFM_PLATFORM_NXP_HAL_FILE_PATH}) endif() - if(CONFIG_BOARD_MAX32657EVKIT_MAX32657_NS OR CONFIG_BOARD_MAX32658EVKIT_MAX32658_NS) + if(CONFIG_BOARD_MAX32657EVKIT_MAX32657_NS) # Supply path to hal_adi for TF-M build list(APPEND TFM_CMAKE_ARGS -DHAL_ADI_PATH=${ZEPHYR_ADI_MODULE_DIR}) endif() diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 6c3ac64487f2..06c7221321ec 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -25,7 +25,7 @@ config TFM_BOARD default "stm/stm32wba65i_dk" if BOARD_NUCLEO_WBA65RI || BOARD_STM32WBA65I_DK1 default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 - default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS || BOARD_MAX32658EVKIT_MAX32658_NS + default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9160" if SOC_NRF9160 default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9120" if SOC_NRF9120 default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP From 377a4ed1aa091418bbc7c15b96e10d1b491183da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0805/3334] Revert "[nrf fromtree] soc: adi: max32: Add support for MAX32658 SoC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 77fc9b93aba8fdb738ab071f1506fc8deecb9be3. Signed-off-by: Tomasz Moń --- soc/adi/max32/Kconfig.soc | 5 ----- soc/adi/max32/soc.yml | 1 - 2 files changed, 6 deletions(-) diff --git a/soc/adi/max32/Kconfig.soc b/soc/adi/max32/Kconfig.soc index 7bd66bf2cc70..e4b2347ca021 100644 --- a/soc/adi/max32/Kconfig.soc +++ b/soc/adi/max32/Kconfig.soc @@ -33,10 +33,6 @@ config SOC_MAX32657 bool select SOC_FAMILY_MAX32_M33 -config SOC_MAX32658 - bool - select SOC_MAX32657 - config SOC_MAX32660 bool select SOC_FAMILY_MAX32_M4 @@ -101,7 +97,6 @@ config SOC default "max32650" if SOC_MAX32650 default "max32655" if SOC_MAX32655 default "max32657" if SOC_MAX32657 - default "max32658" if SOC_MAX32658 default "max32660" if SOC_MAX32660 default "max32662" if SOC_MAX32662 default "max32666" if SOC_MAX32666 diff --git a/soc/adi/max32/soc.yml b/soc/adi/max32/soc.yml index 270c8c28dfb3..1a4b7c2568d3 100644 --- a/soc/adi/max32/soc.yml +++ b/soc/adi/max32/soc.yml @@ -9,7 +9,6 @@ family: cpuclusters: - name: m4 - name: max32657 - - name: max32658 - name: max32660 - name: max32662 - name: max32666 From fa6c800b81b17d474a0480073c22b77bc0f73a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0806/3334] Revert "[nrf fromtree] modules: trusted-firmware-m: Add STM32_FLASH_LAYOUT_BEGIN_OFFSET" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit efba2d2c754e727eff549adf51c4b5c990e7e74f. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 6 ------ modules/trusted-firmware-m/Kconfig.tfm | 10 ---------- 2 files changed, 16 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index a8d51666591e..0add755cdc67 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -281,12 +281,6 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DETHOS_DRIVER_PATH=${CONFIG_TFM_ETHOS_DRIVER_PATH_LOCAL}) endif() - if(CONFIG_TFM_STM32_FLASH_LAYOUT_BEGIN_OFFSET) - list(APPEND TFM_CMAKE_ARGS - -DSTM32_FLASH_LAYOUT_BEGIN_OFFSET=${CONFIG_TFM_STM32_FLASH_LAYOUT_BEGIN_OFFSET} - ) - endif() - file(MAKE_DIRECTORY ${TFM_BINARY_DIR}) add_custom_target(tfm_cmake DEPENDS ${TFM_BINARY_DIR}/CMakeCache.txt diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 06c7221321ec..10c761b0457e 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -519,14 +519,4 @@ config TFM_EXCEPTION_INFO_DUMP On fatal errors in the secure firmware, capture info about the exception. Print the info if the SPM log level is sufficient. -config TFM_STM32_FLASH_LAYOUT_BEGIN_OFFSET - int "Offset gap at beginning of flash layout" - depends on SOC_FAMILY_STM32 - default 0 - help - Set an offset at the beginning of the STM32 platform flash - layout above which TF-M resources location start. The platform uses - this gap for platform specific reason, as for example when a - bootloader that is external to TF-M is used. - endif # BUILD_WITH_TFM From 07ae8c0d1e0a853fa0af5c5b6e4845e7b9e635b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0807/3334] Revert "[nrf fromtree] modules: trusted-firmware-m: Declare stm32wba65i support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2eaefa20b26064f3797d92e97f2965f0d51d3cd2. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/Kconfig.tfm | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 10c761b0457e..dc4b206595d0 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -22,7 +22,6 @@ config TFM_BOARD default "stm/b_u585i_iot02a" if BOARD_B_U585I_IOT02A default "stm/nucleo_l552ze_q" if BOARD_NUCLEO_L552ZE_Q default "stm/stm32l562e_dk" if BOARD_STM32L562E_DK - default "stm/stm32wba65i_dk" if BOARD_NUCLEO_WBA65RI || BOARD_STM32WBA65I_DK1 default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS From 3e422e82c621664255746a06552935ccccd89752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0808/3334] Revert "[nrf fromtree] boards: st: Add stm32wba65i-dk1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e4577ac8199ac0c1a29ccd4e5c9b75e403514237. Signed-off-by: Tomasz Moń --- boards/st/stm32wba65i_dk1/Kconfig.defconfig | 13 - .../stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 | 5 - .../stm32wba65i_dk1/arduino_r3_connector.dtsi | 41 ---- boards/st/stm32wba65i_dk1/board.cmake | 7 - boards/st/stm32wba65i_dk1/board.yml | 6 - .../doc/img/stm32wba65i-dk1.webp | Bin 40424 -> 0 bytes boards/st/stm32wba65i_dk1/doc/index.rst | 232 ------------------ boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts | 187 -------------- .../st/stm32wba65i_dk1/stm32wba65i_dk1.yaml | 10 - .../stm32wba65i_dk1/stm32wba65i_dk1_defconfig | 24 -- boards/st/stm32wba65i_dk1/support/openocd.cfg | 26 -- 11 files changed, 551 deletions(-) delete mode 100644 boards/st/stm32wba65i_dk1/Kconfig.defconfig delete mode 100644 boards/st/stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 delete mode 100644 boards/st/stm32wba65i_dk1/arduino_r3_connector.dtsi delete mode 100644 boards/st/stm32wba65i_dk1/board.cmake delete mode 100644 boards/st/stm32wba65i_dk1/board.yml delete mode 100644 boards/st/stm32wba65i_dk1/doc/img/stm32wba65i-dk1.webp delete mode 100644 boards/st/stm32wba65i_dk1/doc/index.rst delete mode 100644 boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts delete mode 100644 boards/st/stm32wba65i_dk1/stm32wba65i_dk1.yaml delete mode 100644 boards/st/stm32wba65i_dk1/stm32wba65i_dk1_defconfig delete mode 100644 boards/st/stm32wba65i_dk1/support/openocd.cfg diff --git a/boards/st/stm32wba65i_dk1/Kconfig.defconfig b/boards/st/stm32wba65i_dk1/Kconfig.defconfig deleted file mode 100644 index 620565526e58..000000000000 --- a/boards/st/stm32wba65i_dk1/Kconfig.defconfig +++ /dev/null @@ -1,13 +0,0 @@ -# STM32WBA65I Discovery kit board configuration - -# Copyright (c) 2025 STMicroelectronics - -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_STM32WBA65I_DK1 - -config SPI_STM32_INTERRUPT - default y - depends on SPI - -endif # BOARD_STM32WBA65I_DK1 diff --git a/boards/st/stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 b/boards/st/stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 deleted file mode 100644 index 9fcfc52471d8..000000000000 --- a/boards/st/stm32wba65i_dk1/Kconfig.stm32wba65i_dk1 +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2025 STMicroelectronics -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_STM32WBA65I_DK1 - select SOC_STM32WBA65XX diff --git a/boards/st/stm32wba65i_dk1/arduino_r3_connector.dtsi b/boards/st/stm32wba65i_dk1/arduino_r3_connector.dtsi deleted file mode 100644 index 999cb7600ea3..000000000000 --- a/boards/st/stm32wba65i_dk1/arduino_r3_connector.dtsi +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 STMicroelectronics - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/ { - arduino_header: connector { - compatible = "arduino-header-r3"; - #gpio-cells = <2>; - gpio-map-mask = <0xffffffff 0xffffffc0>; - gpio-map-pass-thru = <0 0x3f>; - gpio-map = , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - ; - }; -}; - -arduino_i2c: &i2c1 {}; -arduino_spi: &spi1 {}; diff --git a/boards/st/stm32wba65i_dk1/board.cmake b/boards/st/stm32wba65i_dk1/board.cmake deleted file mode 100644 index 45abc466464f..000000000000 --- a/boards/st/stm32wba65i_dk1/board.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2025 STMicroelectronics -# SPDX-License-Identifier: Apache-2.0 - -board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") - -include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) -include(${ZEPHYR_BASE}/boards/common/openocd-stm32.board.cmake) diff --git a/boards/st/stm32wba65i_dk1/board.yml b/boards/st/stm32wba65i_dk1/board.yml deleted file mode 100644 index 521ca2c3169e..000000000000 --- a/boards/st/stm32wba65i_dk1/board.yml +++ /dev/null @@ -1,6 +0,0 @@ -board: - name: stm32wba65i_dk1 - full_name: STM32WBA65I Discovery kit - vendor: st - socs: - - name: stm32wba65xx diff --git a/boards/st/stm32wba65i_dk1/doc/img/stm32wba65i-dk1.webp b/boards/st/stm32wba65i_dk1/doc/img/stm32wba65i-dk1.webp deleted file mode 100644 index 4cae2e31f470880f264e98b0d351cffeff87aa20..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40424 zcmV(jJ0zREaok^-DrX#9TyXdeJ ziDPbV#u=>8_HEg`en3Z(2GP|4o9HFz9HZp}yGMbCk@Hgb1JT}azvf*aKgIF&`fl+* z1M;Hx`l0MfNqGO&hw1W)OV*74#q7_`=ez^sdxRb#{(b!?{eKDnFZ$Q^pWpw`|JMHr z^BwyJPyOHgU;Q8Ly-)i&{Gah2*FU-czvAD^@AQAnep>vBes%p@{!jQ{T>rrRx$#5Z zzux}bdlCDo_V3wmBCq_v*83IuzxsdK|A7DLpWeMv|DEK|=|02X%(kS-FO~2mw0C2v=clJWvA(jrvDK9a=Q5|#&4BB{7ADQ;T!nxPNrc! zPj&wiXT4$v`0JL~^7=swxj+nn^x&j>9EVDU2bae7rr@*_Jc};>^HHu`R`+Nnu7IB+ z@cJZDLt$4W$R)lAiwa`*=^PKupzJEE!q@}hgVklJq@(3!NMP-rCnRC*w2gLzI;FRZ7BT1ykZt#7}5rc)^tMyN*xGf<{ghsr!mZIS|HCAz?3WbYlqv-XE ztgl1$uGc(MOc$;3ay#OLpGw4L=cb^}1$NOVt8UD?^z$hQ{B|M09}Msw23U(KqyoJ3 z5?E28_E( zN;mS1TM>56DJxBSWk3^ed(?Y@Iy(^kb<9hA^=~W=Il=@!CxT4`vr!T846BSr!!@S7 z2bgEH->0SW$73Rg#PH(dV6O3VIN+CBpMecjkXR(Ee5z-g1D37Q$N2#5*J{-hrz*4) z(`_}m5vCe+8DnI|nfJ9&Eq^g8BN*zM!Gj{jSblWfVy#VF#uaf>aaskiHqCROfzcLE z7{@$hO=ppZ$NqlmZL{WsM-@Z`B$^^}wGuQ8em_7C>c3f3c0lb1qOr7WEt(oiNc=rj zY&?Hm({85lb6e=?zpyRc-&+P{gX@QMe0}*HX#{-&j)krmL|qenRJ5-rTwMvrPPbDE z{h6Tt=}k3?H@Z92a&@`gcN_TUC-Xk61b;M9qegz)(}h@rbEmMSP7!tc7W_cU_Rjx9!e)|4Yt5| zRu8j9N#ShmtJv50A9OE*(3b1cN31Jr8w%C^Sd^|@2=JSdV1{S!^T2K#1fGDf8-v-z z80ggI7>e);ez=mz15vxWu2q1t^DmYz4P7xku=NO3IZX~=i?0kNJ>L$gfSxjC!$?Qn zKInmm>RbA0BKAshE~t3d82I3L7dnI?Q~TRVb#fzr=u|~N@@g@SOQCRN;9-qjwwF2V z9L0gG6(?ofGt7R8n_oaJ_N*=yY8guzt(-&|xEPbM_54nMV$Yo;tzfdNJ<8b)R;G$b z$E595b%u`4D6^++$t`*tm-Fdn52kotlOcf#ildpTl3u~yXpEbQNi)|~Aw{3(V@9_+;GFuJzF zym+=jC<*Yf_xW>|3{9T~0okdQ%=HJduT!{L#)wsvQ8@^u$*Xt?BnAXhg^|6$NNKyA zGkax{M|R!SkE*^MG0d(C7j%*)A(ojz5)v|nGN#413nz#|fC#@Bh-7<_CxQB=J)$#0EM^RbWn0vSmMPvK;H+)e z?Mhp>g=tjRJ90}Fx(^<@XmM%-pt(1z^5>75>!qZ=D@AC5xB2mRkFe(PVpv%k zB~}0!jf{|Bv06Y)9L+uWI|<0DTROxnu@#LaL~%?Ihim^}u0Z|MV0;TyuUp3cho~3VCd z5krH6+R&kkgWsp3-|-_+0MMy~boQ7i1c+R94`!D2<&@&WMNB4Ef`w_K zq4KoL#-_mf`X|jReaa?q0+FxdD`#H=Ao|e#dp+|Hyy>>W1GanRKT4$o(gA@z2^lT! zeoNIM>Ls4q*4eN?Shx}YbtKRJlP!>oIv@dO`cpGpsa(Lj?)wF5k`ff|ss#bxnZ~IZ+j~BbC9mG zM~QXyvkrJ6X)e|AvAfM6+;kwNyyecguj&piv_m@|nG6PCF!va7H;jSqj;dbyhaVEm z8ZliGHh1=n>oAw3^KH>yxAzvkun100*TAuc8ybyXT0uJ2cUJoEV$<N3;VNw5l02>KwV zmWZ*>KOZ_%?s1V%VHE&qx@q&EjZ3|+ zWG{nUH^!-|zf_99PhXdI!T#Z_w5cfvkJW)i9Vntxt@=^WW_T(kH1dauMj6Fvll=$m zBtFQpf@v`1<}yWJ$UbDxBWQ<;V91lm1`>^Ao(!>6BuG0+sQmF!MH-#(eN~_*`qSV! zDR5Lw;V3IxOKoDwuWkG`lT$jXiA(U5d#|#0MM>MZEn;#wKevTWmw1`v!54wOF3?U4 zd~<}#Nw$@_TRW+5)2)o-u7>_$tY|Pq97-sD$R*bi3K!khgk?eY$XcEaFt1jZb@!jKw4wJ(Ofvb5#YQ!7KMH3S+2coR z;$zVrGA~M1jPAy~H0?F26y0CJ-?yD-LHJdI&@B2ua0m(oHmnC#d7bi(;R!Lk)vF`} zVI;t6tLBhyg`^pJEw9+)Zryi+^6_X&xx^z$rQ2bfRI#_miFNSDW5zRW$NBgu&>u@k z=&pj@O6S2a+mDiZzfnKTjvikcl)AJeI{WSWwN;90&7}-c-qL6JWEnhiz#anCctcJ& zeRGM)J9}2RzK+H8nl9F4vOh_)jkGAxN1tLjvKPe3yP1X%A){t)aKA=Di+b7P+++*5~D* z2LzC8=2{qPryM+eLX|akFyX-*^AR^}Y4!M6v-LtkeziE*Fyhz#Y4^EWW1~1lHgZwz ztGGhcut8V{ZX5C0c`pN!I7|i55JPD|)yDDEX!yxOQ|g6=+GtG662XHo8Fq!~AHPys zemN&y41Yn=`5d zQ_NhwR*D=H#FuWdtW(MExrID^OlJ7%F}6@z^62n5y&8P&P1{qq@7z|lPJw~(KIBsb8RwH5Fe&!MzMf^-@p+x&9>4eh z5YVq&7l$J&qg>R&`;OirczG>knVgY8x?-EgW}xI2Dih(MK)0X3?2|19Wg0qe>C|LT z1FMyQfhVx%i{6Qum}mBt!%M_5TI2d#W!&;HJ;!fIgW8}S_5FtmR6~HFWRS@j*9N8M z!*Pz)5I^(37qi%%44h2CgWib8fqJu}Iv2USaE*crUa{!|$Zn5M;$HhqY zpZM`9lbHtfBw~yvbK3mnCgqP`CLz*n+I<*w2jMtq=LVxmemHwE*5=|tes1;yruis& z>7o9b$Oh`~kDxMSL|A-6Y)vod-`AfKMY`UrN4O=L+OnBtLVN#n_}{o3JE8$(;c2#T z%GhW%vk#3j;FW-*2a@_9_xy{o)9yexV)DCkz4?hdpfrHBgrv*Hcges4n#VCc+dV+j zPvbS|A3C~IJ2Y;SRNMApBh?$EPuWqpOGJ@Y$k``aI|2hJ8)gfdXSm_0;>n>Fn%BXf z6xHI7A;Y@(2cPm(I#ellieb|n4=MGCSv}N!flj5RmhaqL{iAAM|EQC(i6XWCyw)sL zg*9izcrg9z+>FDzRu6<5kO^BVA%xm$il&27l(x;KnUFJzfU;45@S76$eXS-eW#?^AH1E|;dW!i}-dI9HHg?*- z1|cPT(Cy(@5CtOx7^k?iA%7!adOj;hmtR4|z{m8tKjF@b63- z)3pZW@F;Vc_q=F@2juaM@+q#-cI!Ot zp-X=9XdmD}000000001YKJT+6R!wlXD6KWKN8fctty$gTPwKUo$Xg$;P3p;8X;N}K z;3^C~T|Y7Y9d2=y=zkQ3gKJ!M7wZ=yt?kc+E2~Iqk1zwiA%P4GqK-x`%HYWzS8hV} zl>B_*AKf4#L2*sjf$IRwfB*mh008)YkXap$c!)+UZcs`Ldiea?0??=2R}s|at3ia# z%LR4CCc3FNTtRm7JxB**sY zj+!FR<#O9K2wmh(HAvYi?A0W#^j7*S+&X$&b?$cj+3a%Nro2#2V5>!r&hFdP6ceke z0=zeH2?2%DDu=z+zv>gBOwYbv5xO;x2hx=DQQX00003bV3TV_Qz?KWq{M(%-PWMn_s7Tig?mlfYyWIf5_+QHgFN*`A@Wk zO)6=Xi~EOekLb}Lmh(V%_*Wh7oB=t@^~euRU}6t0jASq5+uOjV^^^GESN;~ESQ^v) zjH5?r0w+wowcg#N{F|e0-arZS#W-wZq3hxlWAd#Tv<2{N4W^3&^i-N0WZot&U@5?l zq9ySDXy{lZ|G@2wI2}}KLuh%tZW3%asrYD~Ob)*Jn4A!N6EL8IE=n-Mcc4sn@a6f# zv!YLRo^`Vgm#`tHzyjaUgPwE5uy=2A2OO3Bd?P;(8Zp-t_N?F52zs~;uf64n&XF&l zPJKnH+IZHeI*OJ?F~}#E!4~4<$XgD#?<6Apwhm?W$=brwsWm|$Qv4JB3EHt7akgWI zms3X{kbvAR_~*^@7OV-}4gY~|B4!~=vIzk^cn)jmnJ`)#wK6`HD1YQWCQw3VW{D_T z1v@N@rs9do0!yDUTW`|2tGXrofyJf>1jUAC#;Ii&M!fsDysTkIn`_kok2-My^Nl$} zP*oFk`1UW@&8H-U2Ytz84OOQK*8M&TxaobGk7aPLgZ|Ls$1)3Tq$GOX-`bv>($-{j-KoV7X_2Acf!+8rvvj&7hn5|V^y?>txT!~q8A`!=vu0wIH(FHh9l zH>6%lO_PE6TH?G$8k{V<@gmU|8?YLyURG)gqS(^ zY(5{=4j=N)M%?S>4=*XikAu%GNNFJ)n;YPgfHC^KGV*yrc!(wBG;}(l5mH6cy=sg{ z;B(sad&OlUOF*dHW(j;XYkeD1FWG4zojQ-T!3C&SXQMCXf`L^Aj_t3BH% zE5u`$=r(LF@Zid9JaZLoHWM`gT_O%LwOk`LAaMorM$+{e$W)`Jg1CzDzM|LYtnBI{ zu57_n%bjXJM7uS%-ANA6qnd5DtU~lZ>>LL&#pn&LMK)QQ?mqNj004EvlOJ~jSX)Jg zI~>@Zi?f0!XOL(a)v&ybC#UH+Eip+eSRKJ}^+}{^Z}b&b=g4E_JWd%Wrm$DP;;6zXkp6bC+=AxsYt%fk&b6`Hdl?-J=#I3cq6_w2ecK63^2yKXlg z6dW?)MJN{4wDY9h`*=@w*YDkqtT@c8;(j0$&i%a4AnpBDxQ`oe||GXdHP&{Y3KxW7*0J$N3Rew6CDG| zjd5MEOb@Wi@J6tNvwb098UspimtB)sTYg7==h+%8X3Di*0RBqo;BA1?K^jD#;0%Wt z`6vf>*d0^ZcgOu>@YcRf?#K9Fg)*6bGb!3>lsAr_ zp2wEN`^=&7y-vUvSN0B_Tfv{z(9YTJr8ki(iZ|XrsD0g@r7;PRe3m29vj}T=vC>&a z=Yu0#9QVEIr=9}qTSkpuYL+pxqb(SUXVUPi6<)73CM!yVa!ax?KD7z)ZxgYDTQ`L1ci~JY9U4Bry4_$XE{3+H-%Vqq#a>{Dngk6!X}oWEpRJ zeRr}Z8+TelnonHxus;4h&dZx2fCm3|c`bl7Qj{dzQsjimMI0?*ykGgk1Rs?5u4_HQ zqzju{ATNRGZQaQu%;nO;s08>VTQUN`=anx1uA5<%&Go=cFW>;dtAf$$z&Gp0)J6{2 zRi1@qj2kp>Ik#iPOhj3)zubJU_>TqHgQA3;<#^e$TzqSS-EBQ_#2sS<9clov8K~CS zYjqf6&G&}nd>k^L#svcigAs6ahEu+?h!71L%bd-frvQE#sYHSHZd)>LXKMHPfL`Rj&=@+Y_w0jc+u$W=$V+OcG9Og!4_C< znH6q1RcM{?y1)@})O>7tYe+_phK>U>AoudN7S2Uo=7Lg{-9JaX^W0-i+K(oD?Ag-N8`P1 zF;`ckXk12zOJ5{De+d#9;pk=pDPgk{X2!suPr>98esdSg5($2BJM}t$ z8r2N$QxR1&NHE*23q`iq?M<^JY%YgDwSf(vG0{9NFrU@ZcSf6PTK+v00iL!Mrv$^p z=J%FKXeZUD;wf$ua3*{^_;kAZLepr}Fv6n0=8r2?n1GY{AReov(T&whRHPcfA{NHd z^%Hq9MlkV2^{x5u2yn1dyirO7LZE}+j1bVpJ7f|{bcCNgiHTBYp3Kw#_%6;;_9X!Z zR3}TU|94`()jYFdsJ0x~^+vnkX-)ktN$-C3_T4cqZp0(Wd=XvU=W^%MTazsWN}?ha zre2(08WHj0DAtlc(9YFi3*SvFs={C0G9;48*9PVzD=82l*lbP#G?24|mH(}bXU0v-V={{c+#Gg0^HDuh_?ZapFKWA>~+?rg}G&j@6G@8M38@%muCS8kpMD(Ht%)KWl;& z=rjmbNaQ06Dz~qcqc`w&64{Rc%4?gN*a{6$(`TBi@mozsYWPdmA64U;@|&drLx8!i zHsU5|Sd-q&V-1Gu8G{Z_o~?)6TR%Vj^FX@iH*~K7KYmq5)L(%Ip-|f;^9SelzsCBO z)QDO06_8iXVthFbuXDv2waLeP@~|I?D%t4Fo{m`%RTCK#h2-3`6Se4Mx3K2lSyApV zhd~Gtpfg13m;%|)#DpR0mUu(CrfJ{2MLPS>b$d#s{2#c-oxOI%MoQxEUKN_pmf5`} z(jeG`GZ26RN^lWO41Z3R+`P)&8guG4iGxshZ^?jJ$_OqUgBiLMq&iHXb7FmKj|s)I z`_iaW%zdRtZPfK<;>Nvw8%aZQLRF-pbVwiK*3uwzJ6G}`$1s3|Bs<|(7VXEe>&8Jt zOitW?v^9*+Cz|NxfGCI(0tazhwEmL~1Gd5zw`vZd~Di#d&@A6 z*$5S|$F8UuD`C}rb*#C(&L>I_?oxVNsm336`BVtIHz=cE&@kdAc=Xux()QL<3oR#S z1aQX!&YGq-izfjx`j4fvcmyz^9e8H;;!h8m{hHK8hTh>vAijsMj-&JKgbnM1w2jUc zWGt}0xSsn=+g-0c!s?LsK9C&yFYfX5V0^J=aOPYH@46)&tOl_2^;3#stX)&LkwhEt zxdxlnmQElvW(Bp7L1x0SHzslSbGiAQZ8b`o&nmR|XjN$;nSF%N;*#Q`(o>+|xNB8W zm1OnZGNL#>d1B$d=6=hwOpA=xc9`S#N+dcU%F7NL>b`yK}2G z@Nw!egK4c!8QF9&LZV5&Vh;XuA`ibwut-If3daT!Sj_Z)uWO?FC=3FJ|#%3_2 z{uTe1BTww?w9|H4d7~N_xy_BK(N@GEIcffDR^>w*=j zlRyAC!E;+#3XW+0?Xl`UT&1|rO+aNWLF+bb`f1#}Z#qoE6k-L+?b`Sl;x#q8tM9)) zYd+j16Fb@8DBnx!Mk0o%xJwrQmtDH_g-wIast~JELV2#J4p!V3h&<| zm$*5quu~IFT~{xkNGiogaw+=l&4?!&(eAB)t4Gu3l&|@F<*04D;jRg*rZAxqvX}PO zc8+AhA}D0+K62a{-s*p3)_P5! zOW?qw^O~)PJOkY&e@)$2=U6FDwqa8*ueyX&6M5uf&qk;neu3G}aiLPih*hiK%)@+q zw=a+O0$-d<8ell8Jx5#%@~74TH_L~;AR|4KGh=)(13F=EA`rsE<0lHvBP5#)QEvIi z>3iDJ(0urS=mr-DRh9c2$PYtooN`6*Szy0du2lCeg?fK=8&7mzI=voESryHZw)N0K zt5#jhKgWrnD1)4H`KhX`HgU50tJyD9(l))jDwp8*Z*LwBQUCTsAzb&Asxu;dfm?Jl zfK2`I3&El4>d@^VNrv7@SG=RZOak-%XE8wnBD&!giWr*_tf5Nby*X-$B-K(2 zPbrm|WYB8F=^%Hy{__8i?AsA|7$HPEyyo>nS6NJAJqR}(JPWWJG*DQxxkZF)VGJy+ z1ZHPp1=l6ITa#2w>pn1JS*Mfd_Yr1^qSS)lqX<8f}5 z>Pgwp(x_|!B3&eJwp%1_Mq&%|%>#`WgvtL*wjmhQfL&zRnYIczcKm#L(dYUVV)YlN zY)3sE42*5IN_uCey;suRg}M8m)&nXDlW*v=V1RtIxIwb>PtoHSpV3TH}>fe?CSu@jnxPrb6BU%yDxS3Nd3KtCj6B?GyS&=&b@NBiqzAW47 zS_Dc7stRv+0zPP;wqxx9gV@oB^j8OOpQnDO{6^ES0Ppx68Ia?C7rX-WRhxkyX1N9? zT4^G&9S@Y(e-X1keeP<9!QYeaovqvH*LX08Kjv^(2J!Cb8fzQXpVav&lmjPS3aT}@ z;W|W?Nq5Y))1>%IAbg!o^UogZk5b~?)9+){!)=j0}^E#dyBO@oAh||K;EAO2%Y%aXC%}hN z>i(lG(BfBLW38iHEU70cN?s*(-y__i3qraj&HSvf+3d6#GNU2%EbKS5U>tWS#Z|n6 z74cQytSq1>+bGJ&gK#Ksw79L&2&f-!WA(x)A) zik-#!QKJNfxr|oRB2(o0un>8F>Uz_}4H7SY4z2Lh58(#!v0^z`F3&p&`CGMiYwD@1 zY91mv)tF=V3y~wN^FDWs&hgLx^-l{_J^Ye!^J`dcTH-}wZIbc?tU)ujLShhw7`RBg4>N zq+2aY=?R6QsPI@R(NDnMDdIV8snWdx8l4UFB(q9M3k1YFNs|XTNjv5U zSZx&U)B1p%FKyUJ*Z(r2RKg!IvPEE-aX>lqr%DLov(3tKJLB6@oKxZ(sl<_g25AMzfV7Ew~*II;(=vlvE#N(z=APSO&dP zfDJcn_6)j_ot$2ev|2)Q{$|C^^m0{hMv-9Mm&@ZU5^_{uNJ%1Lm$JDTPmpZ(n&w_2 zn?c;~3rWr^ypAZ!l)qMq5cw@`ooVDE-#J#wpJxa53pIw~Ud4H@Cn~i33QN0REAEe4 zUD_Yx97owMl}d~@K;jL6bLkBAvowkXOtTv#DA>Fv%cZ1IOL$uN(WwvEPI;y~E`FxY z0{Vc3T#o%3OByp$rYab8Ja~*ms)X$>%@Lc=trvqn8m;pU}@sHC^$~S1)?d@ma2(}hF&854J z6dL4>riM>cBGak*Uoc?GYf)aO^t6fGU(EH9_|3<2&gF&mAp`UlH+2Vol0U+z(r9fV zUZm01@HE5|Xy<%w^C&~}<);3OZovX+?=i3oQLNQ9Ma{P#1WB{8CWYzMpyd?GrIZ-m zxRTASR5W%GoSzPmIkfH!2|L8mEhOjUuBl7%_wv zq4~1gl$6UXLalq5A1ao@iCFIoxE9HlamusqoNRUL_5?UXbdAAS^@=7_hnV;)I#;6% zx~FB0&XMv2C4>%=VDcz#B*_gVqc%7ck~N|HPLf|eI(Ya#vAL=hUZG?kyKDCd=b!J- z{D!$bJ$xf?%9U6Ifo7XVzM9`x6Vpm__97Dlmk~kN4*fl4*;YDiCaHwdk0)PM zd5TK)o`EF`vS=35_`5ljtXbD*BZlUdOl~IwmV0umK~wM#?F%pd4VwDsFn3j<)P43)5d|cfjC9-7BEu|>5M$r@Yr<^aFrpCEmP80^O*B@ zF?V9Nqz~a=kTL$7f)50wHaMDviO!3fdlR$Ztf)H1_DUTxQ2RIf!*;_Ac{Qe(CJG~&@}KtqeTNY51zr62x;cZ3PkEost(#~| zSVIubF08!6n@K8qnuceZ&vK}~zTEUGDI>M=&)RGTPyJ|E`%m@$L0?Cr#76EbHC07C z{H&qCWv1LP2X(T8V0!!IZ%ojzQsyoGG?7j=u^~`cIb~PHOK>4tgzc>fvfF!%iuanO zmx=&f)kRWC@PLsWkFVH<(*MrF6T9A<(hY@V^Y*bOjM^d6x1LES&&WKKue2vI5Md1{=79v623^6YNf3C+I?r|cLa zGNCUUYN6kJ_SS$9-23{6NcO@lW8hI^9kc9fLq(0gxihT`16h-l#+R^Nc%C;rVv46C+;@cNPVkxWfta zHi<*aGFUuh?KVhCMc$RF@NdIRnbhl}(Tsy79TD5gatU!N{ku^%xnxWh2hLYlDlVJGXgFoZJd`LF1J<`dQIpk+@d-7CCY>K41gvG#CqqUoSE%$fDTZ zSYBXMj_7l2ieSy7Q>dT`RBCcf94t?|{TEUUy&m!Q1y!Guk@+ zQW1r{9>h|j27^nVkD#%adij|zS3;3hFVM3|ih^0Z8w+p_T8q^^*@Xsa-p#y=%qbjN z+e_D6f!9oZ)8x1IrBmQG7az((OFZLTpJqOU`BDN5yzDus{oBnO!czYRguW}-m%JZ9 zE?ubwYuw$J>A%KJCJlrQuYQj10M~7RIGORc3$Dqkeza9Q+AmPTMdc~;(Xa*w&lld2 znYi7qLe2aKKOS3!of+gFu6li4Ua{t9^=6#8EPGMuPxaSgE5C2! z-HV>wa_DB{>X3`Z7B;riH8m2m%HOSsa-n|x8cf7x&u%x>xLYb=J&6^!{-xeQarXcV z;>BeEWu+IR&vLSsFVW6b5T(7x6$+v_3t#>H*N8-$qMDJSl|n)KPQU z4|YxnIUCRLO9e$@*#bp-pX1|fu#X-51!`ihq6~gfjH-$tjuy7 zUe~dlBo&GKybYS<5?bcx6PqT1=v)MV_mx71iKF)V*`CC=esj0Mqp-8Xs-~y;cl5J@ z;gtq!mc92r#b72!EzF~&m$FdB3bSKmXDQ=lG51@1xV){--JUWDve`n1zvjZe8oO(!-_>rWQp~H91>*tz^@Z zGhV37MV~KsYBA)-3~(MiRHDWug%T_)@@o)@3S3ohmHEpAjEHtWw)5_ibZUSq0iHfV z`sCNO1=B=?+CrParf`P0TfMFhesPHr4v^O@I!J!9ZXvg2oY&d*wbcG9B797Uh!H^2 z=x|r>(rhM>mdbo$4ld#0u3G$*xO6)fzuv?3Us)x8r6}$`WYL=><8a4PB>e#_fERNK z(Nq4zkv9E;uF-Qt(op2#)ivpPse7O^KYtVd-{GjZf-@`H;+%@`bxsS^2S~a=k9M-$ z6ic1(IZN8h+uZ}3)eg&2#__0crMe$jUxyC*3BI0J+TlR?=>GJ-56WBW^-(k6{Zh)r zPJSvpl1JVds?ZoT1d&pZhLpWv$lyozzx01WCe45AxGSap0QC>ZRw6j zXwvQtgN_82IHo4{v2T|bJ7++WN3)81l0Hx+96j$+c`=+`v z60d#t*61MA=B01Jr~bZj*UWDWvu*pDNA@$S!q-kbzO32J;YGXx-bI;AQoMJm#5pO& z+|yT>$^G}~*Ry%EfJx!SS754tlJDCdwm0<13`J>yP?)7oZ`|;S#$JUU*20>JAf;0U zM{}BBZ!keY~0DH`SdsuM(&M&=O#-3AebNckV z&JdIxVlC2iA=}0;=m{gJUqjk}OI@25&IL<~Xk28;V7@}Za=cX{TcQwv1ct1hELyC- z4)X(O#h5ONC{Sm3!3uL+`Ko*Q-Dd$+mwLooDCn-m(AH*ys3`eIb&iBAd(O|U{xvq0 z@9C#l;A~8wj%+7xPHR*GZ%1}x_BDoL-@{?Nd(~Mu`vz0aA(=?_Z*0>fn{`)~XzU`1 z7SMMEiuB>(4{_{SK3`P2ESlCzH`<|rJe^%6(rH9O@KJyx(4#sQei~f%pXa3P(OCp} z1$cY+r=&q=O>s8Xx2}Uu)W01p&z3fgOEq`!Z^t&ND5bCw?zPv0KixzG(m+-%uJInWlIN834oB#Ar4e3*@wHr zpHY#rosrzew8WLrK)CVkyJdzHIgRaZOmr5tm#IE$l3yW*^k+KO*2&C>tda<_r$dKj z?I3KPUwqxNhcE3S%T~XTXXmckt_1;Hz-07duVNS^yf0Jw^v)z-0CJMkyy%neQmB~3 zTkGr32GgUL3-lepkznS?ZE6a7iCrG5T(Dkutk*)MqdtLLC%{N$i+Y-E=`NC@PSGei ziOzxokLG^@a`GuNafs+8FY_&RR^=SkCfJiI!hO@VwqyF^f-~zwhSCCKHQ2`wK}}pm zyexeT@vDx|)HmjR>6MZIl8b8;3JZLIPmc*l3Ufd+dTcI{T3uXeLTbT8B6q)EE^*`6-m(%I z5Lz{jokJ6%hYzXTX{c~;6*h>8Ev*Jg*JV`?ItD57U^MPn{Y8Tntrx?QU$O-kOQil5 zk7HS&I5?k%!j>@A-%?Jgp(D7~0bOyKwa;LeuhWw=WT$-RC3-ObD3TF_a%ybV`?zY? zi}?_-Yo-EJ)w+-Qeb>xFnUu*|qkjYXcT>%?SG~E0Ka1jbG@>Ox3z#_@5k0tS?3S@m zYw>8wZ()G2X+c~!A#nWVv_w0)YR4&iwZS&j=oUf#%#PsxfZw>pp@rpPb|mRx<%CFc zCgEgigsh8uzl5x_z;a2I)^gtTu}X$FF!34o^;e)#WHhk%J}-0wCMuC|AI>yCPFi^ z1Zj_0e#Ka-5;;j~=(YL~Z5S3wtbzyAiLwn<$@lSHj9psG0Js`j&#K=y@_78vj`LWq z!DD)9*AUG;z|L8`HKGp6Nlc00E9;MK1~FPbBZC-}@n z{Bt}|n!n>x@HtOOQ#ZGZnslQ^JO+Ym$wZ0XPQGg05w3$ zzuz_=$a4B*`4OpBBUxtfFrJqfSO;WmSj%!c5S_7QHV4=nBt;NbH$Dryw7ro!zkzHs z@7~7%+Gum-eB`?$*&65O^GCM|vvE4d7KGV-5blHODksm3n=~^< z9St3 zEEhl*5Qk1L@}n+z2^XwP(g48WX8WwVs-4zNCkc2jI(#X-iX!KKDsu4JXwK?^EMTJ9 z27bwtG$e*Egql_(O`v)2Z|APlv(udYqcYzkyzw;5b5-xmTc4Zk3f8g`<KK^;#TnI|iSMosA*~6<45@r#V&V*E_Vwb4< zS#7lUF_ycK8;6Bj?m78F6C*pGqy?|$ngdcIhSxyVM;*>boO9o^ZM8byh5@u7kV+*4 z^kHx1Z1d+8F!(+L1#C_BXJuB7v}f|x&SU-GllqxM`JeW@@^-a2U2)6emH#n@9xWi6 z(Pb`4Tj6x8#svonc`PvG$69@m{7c^^)(MzVDAXqNM-0Lv-k46|f7n?MEP$%ePFkM+ zV-uU3mGKKwe*n2y#6DM^dk(hioZkAp{N6~gaijjGjt~v)*MTX+D2ZCUKR89ytLb1k z&=}-HXkU?PtYOX|Qw2iJ5T-c+8_vn;^a|@kqx8In-uPFGE`OR%vn$EC;N+#FMD1=M ztsM+M?VcN@M)S-C^o0EcZ)bF=#uoHt+2$7!AN<~7!A6Kyn2@l`2w+HAqFwBlofR{K zZWDHo9bQ7q-cAt+JZiYvaKLL-)JhNsfC0k7^z5*1I@(Xnelkr!Y}-o=*!9hy!uMBP z_?U)c7)H!88j-hX#Yb!=B3reKQupz?ne2F>6RNpIV08~TY%W*111iM3ZGexn`$|`w zrmzg4%hfqbAE&B{uY5Hlxe2Nr9<=Stamr=1)2TkCmmWGAWG@in9ci(u5+>y^mFdGP zj6nRP?Y3Kt+TeqmAM4;9yNM)Jy1CbN5wH{J zQL=ICy2c3UL|i_}sF=3+kPV4mjkTP|q4M8yeSSxA0^vx{zfoJLw=HmGCuz?w8unAc zPD8dKGNm4&q7HcT)nhOTM-0Li-_XF#eO<7qMX;+)_h{jvgKVV`^0dw^+idUPj+2vk zn-zd^g>13VnTYo#HL&}N*Qvg8O)NZm{xD>=at^0i;OLhJG#Dj@O2YLn%%|L)QdR~L z(b?Y|N=lwtE>e($)$6(;%_+0m>3kyKWz{Mr|=+eNSXUa2x1xNg8J0 z8ku=Ja2yP~K7|&+ibnejL#_{bIXtg2%Zc39v4;yJJwICBP@{h+gQvhUp zsn(sugRaJbzp!lOeJ>mKOOV^Z)RZaIvq!?(+&^e;RonuIrMsGOsnoTms5t{ZZ)l9E z)yxVnQ;Un!Jq{lEFg}!q+DJRomn6SlSMWj?jLnTM%TPIiAU7E9g=J$Ux4Me>n9Pub zM~xCgqP9NW8~wvNe=K6=wi-i=n`zzNuof+kJJl^!aTG>638R3CPY`8{n?w}pxBHdV z6Z^JA;A>T7iJWjQD{YJw6~gW+kmce~{fOotd)*m0tM0=5ajOSQ1-|MF`-*7;9zam` z;E`i;V8&aw_-oY}KCom%c*^i0Y_xFl7y`bax`S|SgMkcIVt)^IbDS^Y$2K#TfSn3U z*ypCU@14)U;7{)47^Eh7r-&wlwmIZso|M15G`#aEs}?eZb96cXrqCsMbI9tuaDSS| z3Hvt{n722mJLGo2=7c)!$2dH?lS!g>dFBXsO4L@ip37HZQzdMoKV zd3-jnqtvkKfgx#H5rAC<=eK?o`gZYTv<}F&1LG3LnGg8obikeS9<2#yFALXOiN$Xo za`VXK$Jz&uwKL$T9dsIRZs!^1ZHPlaH1qj)Zb`*b+IPxEdR z(%OV@Id>c+7y%Omgj(kb?SkuF;4&90eK>Y9L;KF!(bae)dAq0AQD7u5RX#j&k#L(D z|4>x_v@I)d1=mS)+f|VnKxZYTT@}0$K(vcQGhobLP;Z)hXn#pb&zxEBu%8p4`?D}c zUBC{b>;7@cHN+rXAzy*AnYSd+yQoQW(^hU+T)6iQgVhg7gRw&SkUUfpJ?OUxqBoN2 z)YimsS1R~Zv3s!;rMGGomjFanH9J-doYxcT?WcJvXg^$C{BP%-yFLJM;UZq6eLDKD zpq=GzwNZcCxeSxQN$*o&$}MwD@bT6{|IbrK5x8fb@a8GbtI_FNN?B`MvDg??Ecqb8 zfir4)Z%`c5hB?ex32aMVIpKD#A$1?}wIyqsP`IV7y-7oF%koD|)Q@cZlLZxg+Cw@0 zD<2>IELXuq11$KvT`RPB!sw=Zj?ci^N*_&~oX`+2SX%3~;6#vrcv;=rvr0XV>X}7k z$m;4`Izeujx>Hc|4`sr_h9NJS!Qdhqs~bR6yO-%Z3M&9E)BvQ$J>V9=dO-5?pGe0! zcVkyiH6Gw`MWSX;K$0cVFt%>Ux;`g70KcrMb@j|)JkBW7GVY?TiCAU;Nbkt4k2%b*W$7e#Jp`D82}&~N5HYSIq1gb{c$*F#Csx~~k?O*Wwo%FG?JCao3@JhR_k(Nk<}#QkY=2R`WC z`Slp&sVhTD&{b{S$V*{WcCqoIg#JWfLo7oA;hv2 zw%HJBu%V?esOZ%dy$6wLhBpBQt2lz!b8iw2YaRfY3o%{*2dtfe1h>BbIn0>6=40c7 zkdXA(`a_UY_AdIJfKugHDKeVlj_%?`JT*O`1IVzpB#^QE1wjk@zU5I0$GIK*`Q2;% z$u=ddU+g3j4DQ7_Zg@(KZcJ)x=gczM7w*G!g%^80g~IZkZ(~r?Sr@*=D$@Cwc0>}m z#s1cQ>k5F$Q%p@}PY}Vy)SaF|f)vPawZr|5q%? z0Oy!tP;ZD#|3@?E(v^_#L>E>R|GdoyR!Vj86agPP8VI20?VoO{aLU}l^im&Xvd1SB zpzaMD{JHlERf{VZ;zbwxDc@tPX~@&jA?fa9fo;J7sSf%y*nOZ8a3BGRhntp6E*@k! zK4Yoh1YB!@uiT?+5+PyFpQ3uqj+86%O>-L6BFhA7M(UobGQ^C@t@O1>DvavuIQ4(J zm%)c<058^3`~C6i-Y{`^{+D{1j*=1g^kJ-LY&ALEffZcAc+lfKO9Czth`c)le7m)# zuzg;WQ4@T~x(s?qGy>l2u$|t>P;ECd2DomO5xoRT>|fHND0Y2ZzJ<0&2X`DDy!mIp z$&~R10G*v)awf{cVYd(T22AV+J_^5Pj5)-hc!{Q*JAvPQxum(_gB$0+7k*)cBwK%y z{^16u?hosSvhjK(lJH|u$~yRQp5{)1Lv7d;E6y|1L7=->XVPf>w0)qvuK{_X*#6sQ zzl2~Yeq3iIbhW$T>E*Nw)pCCMI?=*1L8Ia0By3O6N)nC3_9i3nZk7r5L4D@K8Z=bs zajjLYWZZwj?dpg7W?ZRx?m`UpVoz?)MKfh~Au~eG!1~|(FWkB&L~hy}xHg40knK6Q z;=H}p8NmC@=8ZJ9oRcx$HLWjyn6lcRYEvr*=`N#c(l}o_jz@1GJfvH#W-o%5|Jw{D zrl~_}#;hAjJFbJj z8CvWGd{F(Cr}53pst$xQG4cl->GY}7=BO3!I~J+QY$p@zYRstBbX7WkQ=pm4Fd#jK z=7iz0y<2g8GP}uW#%t%XbkLL76YXe+X{!>^sy@K|yNUiHNB?S&P@241QTCunarUYt zb+^Q^kS&N%t6-?7M1^goA;|LwDx9ACmdB6Uja$B`@ptMvIvoS^&^j{B(DOT6Hsyv4 zR|JOPKPJv1iIQvQtuwLyi({@!EcTIYC*wuH84qv59aMeh z1$_MHkT6X}J&2AMOhze?xXhVA2+k0s)ZG#~MDg(;4tKptlmk;(@L->D`~!uLU$=VS zFbKw5=*5vK{Z{(rhy!G0$Icr`*PT7Dh@!lEAvj~rsMWBBGA6Y#fUd!irT8|Owl++z zh5g1&*OQ$+FNz|fCv|#C$9-ypKJ8EV`9NY#q*EYKHUEay_>h?9OrPrnAgL^i`p0?n z!4+;tYt(w06t2$Lw-Bi<_V2W%eB+J%CF7v64o5=W#%Mlp&=PC~pD1W4RjM!8(I3#G zF6L0SWLbBjk}YrmzadeRLS2KHxkyWiv=*p2qZ6oo1AA-BnxVj%%VTmjc&L>E#MbMP zsw0a?51M9>-3Cv**mXkriK%)Ji%VLPQ$Or+XWEe-v|`c0ayFFvc;}buVamM-Aq1CN zxp!utCIjE1z)ACabx3QYMjPN8Rc*}Ok=kKK@pfWr9)I|dK)|aQiZaX2pJ3J@f4hFK z9iuwq>~MU!(-EZtmU7qHLVPCfrqft+^4+OuZV7mi4eJMfM@IM^`=y?tMcHscs_9n!hdWYk`7$f&8LNGyr|2v;snk0__;@oB#N6lVy{H+EAL?oTk#1++7@EW60B8+9 z<~i9pCe3~u*hYcsK@1zM!EQ zG=2Vin3F1;C57;_YJKk*H@IQu1y~E#bVQjCzimk+RESr|q)Ob9dq>$;ne`g%|_RyY! z;86~R$1z!{#%WEg>5=xnUL;oS5a|mY@Y4KWxW{o7x5tkeU7={0p&O0PW)>H*2>hN~ ze8}8bE-phX)@2VxQMXl_&Zt@Bc+m%;vqh%&05It;n>%yrRrp#?eX^WY6fv?mtO32^ z^Mzs#ReDzp)+-xTu~ktzUY7hCAKz9f7KBW3{k&MiusJ4167OurUVOK6TvtR;UAiA{ ziiO^L`Z268;X2*>1#xMCMKNd%u!n{UAjE-W(K&?$g$3EgxihuNUiy$@Z|YfB^Ty9F z$g>K;#sLQWx1Pl6V5#c6`|yItKpMHQuwE7V=1vIv-jwvjhN74xj1^`iZ<{@Vca{4Nilr#PhsSOLj0p#>I8{h;na74f|I zq80kYgrAy&q}12v!27zEU))M)E8a20D5tQB`8dPKaa?+V|7fwc%{Nt3R$aXPWK)y2 zOzY#rhXel)as6$5byy{nUQvkBX++{y*1O!Rpv~P#S^8$+^{y^CTSGe-w16CBV!X8k zVegH(;*owr-bofA=40%Ys^+mz+vL!?fUT8=-me;9%Nd3a!3bvo7^w4DeX<#uRv!f5 z*8($`6%;&NHMK;bQqZTwtd6WB0dj=dc?e9AC4%qkIPNou)bx^QQql8apIt~wzR2Yd z=Q0#MDB(67FZTD9IS6A;b1QE_+m$QGVVk2cSbyRg`xv)Ko2W)_q@J(F>GZs%Y%j+P z`$kKr;&7`5AkeDb1rRy=9F#XsH}+@|lts4wruEAq#Q|0gr1oa*;yY%v>;a^U@ncqN?Ur zp#B_1K9k7q0D#ZGwbT80=T@h?BxH}M2OWo>YNLpW15lwld7&`3NiVf$voyYI>`*8T zSS=}`XOuS(t1l=`0VMK`0u=9j)S1Ppv>1X%UJ?tpkVhP$&}WU^_cTij{ei(Fp8jBV za=jya_7v)FM*lv`Qe_en5{4f{k_~Ds(~R59e;J!3+oF2sm^O+Y{uAeVK~PLZ%vR&sV~L zvKF}1*+I54maVc;Ww);apy<%xqp7ZW1`Bx1!whV9(n)ba#M z>)rH{7ts^B5sfV%5F8^0ay!iTb#!e7uCpBE|K|u4S7ZjgxqP=JwcF9~H3$c$#t zN%5wzpm8aaKguf^9iZL!d%!3_lAS0RZR8zs<_dl}jKLBX+pqgV;dN5YZ?mX}7xw6P z^*bOPxT*avfcHrY4T8;2(k71__TfN*@Rzlwx+kyo;*zsQ41_gz>>iriNY5$;Ll<~* zThR4S@KMtwk4CQzNPf-(-zg`9`88Z}j}6B&@Ocu|-@rn3KBHW5HYcE(hj3rg_R*;g6KFc&V;xUqODB!3}w5v=}^r%u+VV zpEexC>#P%VCM0Y3ag3xV$1KdyM%F_hby>ZsLv3|4I6D_A2szkZtl==If&F#`5ROap znmuSTQZs|)x^|hVr(JIG93hq7Zlb(Z_V>6TN~I-thhD@3T8CF2w60TeLEgsCss&qx-I z$*#YX254Z71emnESkTKXtj!(^E!w^xB*fP17mci8eehMWeq0&aaB+_WDW0}FM3RRM zK0p_nFPtl!QY<(OLgEr585if4VDEf+z;IHdB1W!Z9WUC+(ILRzyAL^imArWl2OY0Q zWde$`lUoChE(!-^7&&2=29}e#5I&^8z$EQ#7Q=obW13$+^Y+gqwmFX`gD0}S`K3F? zMwI4oD3|rxPjcu5hcplXZioAp-h-Z9_g5RJyEgRnkN-QtSr5@m@_^CZcFS$n+C9gI zcQSmoNR)$Rwgs$hb5s2dGS|qNf@85i;#@+wtkwDpi7YVHdy=`hY*nqDI**wBo5}N9 zo5mw?pYK$4s9D9l8sR!5-knRP9MeIeRXWJ19f(ETha3$Zsx*~}YCy?BxT@TFt{mOr zc0YS;q-78*B`&54y1BfRcB+Ic)qqr1QKPw1T#&0%*ZZDrP(_*jrDl=RutjS6{wLkYhEB=++yoB zUt|41(oBxU2Hs78^vpWK+b_F(^gx4gJGTcjip53B)*lUj1xMTd)|0g$ZnEg*x904` zm*Y_Y@zyUXB`RhWqV9SJ9Z$Ne9YsR`*)BDL)2`Y}Vmc2ng9GTv*Zxi`S{ef7w}-Z~B@L^NoMuVeHiGx{tvO zJ6{JD+Xixb9;?bF%ACRJ*DGDST3ggdM;$Vkc}XB&O9`8PaEOkIt)EO_TevL^<0@93rdycGyF`_qyE2d6 zO--1l%IgU3y==NOc?186A7W%&tp<$bsu0CpDc?HmHnm7OL?)t^3R8VZk@VhQa6Bla z&5E1S&wnxOAGw>%Jyyc;Bzo2PbI6wjT22tOJ_gOeyHSm_(Fy2%Om(b|$*`5sa5one zAn{!wsrdAWQYSl_9uquB?2p=w{?Y;?)Y*E$YB357_f6J2M7G+8cl3$s;{6DF3ik^Xyl7tHtg#IbElnIw; z#$IQBs-O~Rj?>(lcFH@EX)!ZJNc5%`FK9YD$2jCCZDR=#XN;WyR!l1c$B5_ajn zD-f?np-&meC;Ps5*fdz^<_OCufT59@8we^=DCYaorhM260++0Pe{AI1wx;^3GuRIBawqu&b3DUG)qC#y zKiBE!B#vs7bBo@&91BXzsXsA39giNEXiL1(T#8kz`y5wR2)yYSpCiVbQb~J~7vZJS zO6zr4efd{i)J0u-jZUk-5HJgMBFw%U0>-BUK$CEUY(?662}yxiIB9$N8FcC=M?9ah zAx_6C5RjrDAnduf5`G9ftMB|Qz^cxO^ep@P+T@AhdNt~;3nSHIZJL;ZbmD= zQBCKDo8Z6|f&S()id_#F4sqrhRl9u=DH$LQxvU<(-)y#-LJQYx15A+6)v*nAujTRe zS1F^?{boo7c2ZdB_V#d@fhMW^!$cX0dFIMh2QuTUax}sfOG&?r%cq_b^g9Y`)Bc7!OYfRxJm?~zi>Dx9?X3dye`y^ zCrWm57$g`;25O=C&OFZsY-cIsO(+>r(9#A81MBP_QkE?1b$$0ejFxGdAg$nnTwsZ( zl!2)kuVybZ%!5MVAc670L5*9 zL9v{yL1HctD9>r;g_RZ2b=Zw6I*&MkhC`nYhdd~~9-Lobf&6hT??3=v`s=OEGRv?Y0s*~I}%=H@zo^$o>wY~tUfWp>@E zws;=qM3v-X1r_`9v>0wt6QqD0FaZQq`D}MSSY`23^>d^Nv@5(s>>f#o^k#@#>W?rM zkQL~`5n|OpkVsrvjLlccGW`%A<1>X&G3o>NL!K1-r14)kuX5!&I;B=uPJpB7WM99xhzk;w^ib6t>VGa?jHCvd*rmavD?Zs9(@4B{t;7boBrc z;7i{$G!bPDdxYBz>8oLQb||a0)<}&lcAJ5pdmOqpuR zIB0oj)pQCj!=iA&dr@0J8AMAaQK*s~a2f&`BS)om+inUsFkzsMlH^1kJKJb)`~%*Q zp>|dx8{!xq!)Y_6*&>m|)>Mv}rxaq=qyE;}0x1)HUYI7)!EkbvK23wou`WZ5+?WdQccI|?sKg@1+hbvQ+ z4+i#kd*Vj!NHNcFq2~D;DchN|Mi)8Xdk2lYG@Z_Su#3i5Ya^y&FEc&uDHvZ<^f&z+ z{5e0A%8*5OO2Xv2v;w zR}s9Bw>!n`f?Z70&HVvbJ-X}nH-?upb2c+7=>V(7lHU(BCe3o>!v)<1BdQ^oWGEms z)VDu)hHw=1DH*UZ9e%m?|7aJi062ni7!lp6sCforjZHYb`ugZocWk+b;Ymf)5jSRV z&3c6R3Y4zSt1bTzJf?E!!b%#gUBaC7Q_&d7e|q}8xhru32CD@(p?nOdaL<-GEsL8aF9ZO~MbJk@Ad zIs^Mcq{%mPO)z@*ac#BJLY92-&05IdySAFFBoxMi9!F~&;q|-fSSFr}8F?&3?I5qv zr4MlwVDdDzwhxfNKhC8#wBy$#Xh)~uQjjATc8W?r++V<3tb0~wfQ;xm{Ol8oJ|XgMLM=4OJhxg*4$0K8@egKxpmS7?SjorC|!8O%A#P zop&MpLJr_`$)eBrs&|H4)Mwq6V_!%RHY_^l#VjkvjrGs&)AnU14e(-ZQ3tI+tv(evARnnBUNbw zjgof|C%Bayz!)(zdD9w@e_8JBs&`Bk6&bYFiDs^bI54reN(%M;u|pykoSBOWJG_9s zxUOR44!41NG&nsFFEB<=!4SL+`Y;O$6ZhGes~u%|vkn<&v;0M-`mw}J=k|=In(WKN zo8G32kYW`EdS(O#XDAt;Ex_%MTnmcmFhCB(wfE+Wc>P0#dY<#5aD^go5^6#CCdOtH zH6iH~NJ`P$kj`j1q~E0JpT3XQ$#qH~PokLw-4 zZBCg?)sHMHlQC0>A-})V#8^i3ysn^_!YzU7xQ!Pn(9hxFSJlkYb5PP{M1P?jYPO=v zp)-E+I0ru8yWmkP_Xk>Olja0REFy4@eAxIzwZT+1mf+OtBhw>afhh10cs3Z?z$EUj zFZ09gDNudKjvp6;F4}bUjGB||N3Vi~+4n4DAK9+(Ct+2_X`n?x%@du|CFUq#AIm5W zD;myye*sKnyfKVPC5_}nV5J@wt#H%;1CH#3LRPsq!_g3{a!t(^gJ~not=EkosEjlB zZn3rk#)cY{)@XE`pia{p!*RH>H%r`s?uOakA>|?W`M}X+OBTD4BWQ|1qRSN8p)eC9 z77TqIpxW`jg~eM2k1g3dA4=iq3+gEn=a#{F_7WNG&uqK{k4N%f)_dTW;Rtk!3|ONQ zL~9$t*bEK;7;>8~SL&)O?KYF{+$;U!KS8GCd2k&Bm%lYCY~~xYPNV9pMeKxbbgTD; z{!kDf3-ch* zKBgjZW(bGcAfL$-O{W#pRyREFO_~&h_4fV zs{IS(ZqBdv@|?mi3O6S7E-fz}{pY_RSK7f6k{lQiPsPX76^jj`CGA6vWT>(K`jd)D zHr!@!8)*-{QS0GbGe)jtWcraC{r1q?(h~u8Zc22yim6ZP%U4}&0^7LYf$&iseh`B@TID{rA0f~g~M z|2Ljr-Dr&xk_b1D%f+T6m)uNM8J9ZDVYG$ zwdb-8j6x%Lv!GJlIeL-ce=t6-SYx8A@gm%ch|Lb3e)INJ_kP^t!?2m8;{L@&Kw1m? zOjq~VmCjxYS@p_5yOq=jW?-jBI!D_QZ7)X?*dr2K*Ura!mS^X6&yv&?`V_eOg4@+u z0)1(y1*FZk*k9Swo=hoae~*C9{=3nRr65T44xxpY7STP~x zz4OndwnGBv|bRAuIu3tNAzm= z<6dAc#G)W4yXxW!!QVgEji<=kVY?3;TCeOITYD3$AQwaX3c}j~U?Tw}cPqrei7z0f3mxsCGYoqVG6jtzn zlW02-1HxHEQ8?9>%9mN|GwpRq6Ccn9ZB$4>a5_VLY_BWDqYNN2cH51n zIX4e5hZ!!G6eO^{isr@el)hC7<82R2OKoMcReP6{1fG72FWR~xHL&BMk(AusB6Ou< z`+Lg_xo3p1nwTYXGPKw04FJeiIO~dhg1764`yE!vdA_S=$+ZxDfYhl6W4|1*B4Mz$ zTDBGWmh7q{j|3i?EQA-6MNBJ^yJ>4koeFp)4Bys%7DJCr1n6Ttv?f{Ee)_C`>M-!} z2x-3Jc*PnSq3x=mboCtwj~97J#*=*1hEktr0cRl?QSZ3X&ukIB8I(Q;I-ZhK4d|-K z-x3n`>_w=7%F*C<27JU%QT3)acqqdbH<_APIm4gFs^{TM){VKllZI>nge}f=LnU=Q zecQinqB#by7r?{)2kg{)3G zyR_yWp4NE?w0Fe=gH&Yh^0>T7MbGqWd zw`=v`jI~b+-6(}1l`RgxwjB(^P!hLPxN|fNdv!w-SnSfAM5`3ShA`}RsmTCjpZRbM zu&2?f!grY?U_RWpY20AgyEGt@cV1{ck*qt1ma$U8P_vmDVN?3a>IdA@$RmOd47E{O zq^^s12_}jU;)pRdQs~IqNdC+`jxkm{HYD!pvD&D|++zC{SQHQkSrRPqU@`f0H|V}h z2FG&B6@EfEi!ibI`D?Hm!aSNP4wxT}kQmOz4wUpC-6<144icJgQKwqG%3+<&iiKF+ z(0t-=sBB&A588@sQ%|FfeH+kD3+n}U#`FW1Wmt&A+{OYo=@^RJEDhoAn_%GUg{m7Q zx=C+2;-^86VBuxj9()FX!lE27g8MLmzHxhKN;Rx^Ai=?qNN9fFY z7X{E{vV$H6+J<2;7|O78!}b0|Nu-bbMYaGI7}u(;6G;kH!&0EbSS@=nq9cQ%YjvyG zobdz}SkFCXU}8Agl(Z*!#~jna5LaswyYQv$t*aokpG~Xd1NeFhuF6HmKY7OCs?c4+ z8diHn_;{uiuymFQx!m+s>#gHv(0IT0uG`f+gMlz)2_@JUPS9)tN5{vpWHwTi9moz+ zxC=SmQI?iK>6C4$a(v?F4$9_%SyV`3hf}AqRB}`sl-JTvV_D|8_MoFa=1_xXNYWrx z#Dw|&XjK1|l(`Gq>_qiq@0267d~V#D=A^hpr13aDKC8#8Ena+J9wco}_> zXXk7uc#pk!{7(wH#gQ@`COKLO5PRDVMC_e;_*ReB`lcr$JI4=Y^}Hqf5YJa|++eO$ z93+S6o%5WWWZs0U>&U-*hrLGc{~)+0QRi{_ z6^PRb@I+bd#N1kZx@5#MQcxiuL#Dsl9vf_5~|FaNK}Px`%SL^Fje zOt4j_#zEyMZFX5qA$wit6=vaY7VmfFN?c!E|MB`p@?`SgTO+U8wVUAaYAVL<&PAO= z$(+;@K%;Pge#l7lDHCK#g0w8o!aU|pP&k*Q#8ELdXM6oAfl53)tQqb@ zAmU1kTziGYTCtE&uWEn@V)@FCJd>qMm+lKT7+0cMfok+jw3j2cXK7zKUBlA>d#LGJ zvH{?AvA76b{Dw%nm41IlufvaZnvjuk#M%;|KqlMwef!kL??(yu*%#O9+k1!G(G=~{ zv@H-?T14d4Y3yI}q5u8xoN!VXdUQS{%dU$AQ?Apsb9CKY#~o-eOmh&1@EZr*pVOpc zp1OI@gLAwca#_uMXr&Y|DsRsEae=j|z;7L90J_wW6$|5wJXVfM{r3Y>uwa-u9q6)D>#kFhW z(S1IKiTL*_;z_PL6fHAfSIYNiao8PGUGXMmn_w@l*IB9jAL&juxxU2iQZYW(cr+f^)|a?3HOd-ef@38oZP#qgtNA*CNot zMwh5`N7?D($KEWH%CzvvTdZJ5vnRUSjrl|$tP&2`KQ$}(IklAtoAMxs-pJY1k;*Y& zQ`L4f5{W%mb%6c>RrQK_4E(^?Ca=$*?>^6N0hO&MwgL!PCFZRibDDReI7#q^>bouGyel_VdN}bdaW!ZasDRq@JuOb{|c>V4W<)Vw_9J{qsPHo{sAwEOha#%bKY@LfI4?ke3jW0>dnvs%v5+mm4l+2YoMUbut$dHf+*?s_hH9*@ zY*F^Do+HbH+NT<*-3)UBy+D*1i^tyHKTaxkeh86fpbo4{7_QuaT}rT+tFsU;kmhDh zTX*F17!QE2D9X1kT&%MI@%sJzLqlUoCA+)V)CNrhiIL|1CRY1DJgh0})W@_x+s(z^ zI9~e_Mg5_%BW`aFqXlUES%ZoCEBWor+_YN&2KtrH z`rt74D9OXZ0FvUE2FIkFs%#y0_!wA``1;mc=j`Xs#Ha%jVhUawv z?|#JWW= z{sQz{8j^m+^aAzO327&9ztSg==+OlU^p?m}G^rMZFST!0n6SDoN^^@JCE{D>tD7NS zuM26qP~jiugQ}`zUcg#GWVCc@zWW&`|MOxm08`u;l$vepfRbHv(X_w?3*aNVQwpCS zPq9~08arwtkg)PEZE;@Hm*D~jJJNAO5lKR;sa!!I5?jTZjr)NcT`#oNut*kD1+O9K zdUDloX&$DmG8N)a-lh3HlSff2ztcDbF|B{NcmmIUmDQatpY$*wq3?DuIbB#amJD5d z)-~^FmmwnZu_aeupvayDThg*B1;t1+(kPDO0r%U1O$)k0E2RHj-&;rXw#f!*2J_V0o18UB{U1 zmFgcAt-8pA)q3(ZLy*wU%;=o7HeNl-6czhaq)Sj}z%q5?ta=tIe0PyH8mjLN^#=6? zD}sg-c)MCKF73EuFtymPOuIMn@~*bI@G8A{Go0@hO5p+sFLqURhcs3Tjw*?Al^2TeW0VRO4HYc&_-Bk0Pv_fE9Q zqGbCQx3|DInuw&^R_re4A~JxiZ>crM+Epm$TqoS#S=@_1$kKN++0@%!%fPo2^p(Kt zWWn(yrN5kJ!7{UF-w7koe9`CY>p0t7I2;9!SX&63h8}Ei@?A8bc__81*s`N9jj7Bo zd77$Hz-|Y3Nsbh&_0$L^SGFlzlR&7aYSdp`3wVRtTAos2md|Ihy*Xm^3<2fP;U%^@ zgr^kpYy@jNbSIBOPvG9QI?I@XVohNbp*j4E4=~0r{OqztKG6#XzsLC^fJ`kSn-%YX2?4dbq)sIcM?;QZ57dbP2t;!MADw3nR*MI2%QKsLX_PI_Tw zXs=#;pIf%CWM~JEbMJ3fY@uD=O@EOB2Ns*y*Ik*F>gXRnd_&cngxvx~k0=j>H+G(_ z&v#8wE%I=TV^jUcWm5nio z2uYuoDz)0w7H3EggM{J%*R`L_b`|dV*4YSHylT(nxz$E@ch64?Awl1OI!qZ7!i|76 z1BVJJ`MIoO7t^-OdAoRMm($eu>~-bzW@zl5{AC$DX$A@-_a#5NRY1Tvo~-Eb#j0sf z7>2L2bb*>xzweo(>;r{~L6o6;!Z4p5!ee&b(UfK`6gX{_%!6y_vWxC3T{aX-2;2bq z4)}?8jM^shKXmEi9Gx?rObGOgp^pd!`VH`T@Y+5`fs#rKeJtg-PgGLway?NO#xfdZ z+?#cJWi&_n5BcT(Xrzh_+iC>2aFHH!Tg87-vUHrU{6&2-wR9lLLTol({yeDz*In!- zHJFUCj_^OY)@1rM4?`_b-;(l2{tw(M3~kju0Ivh9t0ngDNo|z3u^yUoj(8HqE$;2O`u3%;+A{m zX{5}W^-^g2@N?Rxdqk>(nne&?yAcvweTmO~t3Jc5L#<~C4#<%v^}kSym0s#Zgwl%* ztm5!Fgx)D_lnButI;H5i}Jw*z|Vte>8IQU;sT8Xu${fZcoR0!HX3szDG7c0?x08UE(!1SxuVE! zm)-Cxf`y9w29QqG@E*d-jCW({AWYB7EouW}>n|5r^ftwAm_l{rCJmPPmZ;9(as}eh_mUTdzx`Yc-sO{F8DWKHKg8g|BU)gBy>(T+5DYecw& zEI9o^IluRl!b=Dl$FRug)_X6r7~*45to*RrN06?)q+L?|Rdn(j;$NOV9n@^x*xHo1 z8g&WtaBaDs4=Gaz-?pM^52MoLqU8!qHs#J^-W^=+V~pv`BHKNFLDNBI19#Soh&e=9 z0KxPI#T9=LePI&sr~v`5j~JOdATq<92W%9sZmTy50=u1qpX zUlyyLbAMk-2rifpLBaIG5XW$JpAJF?SFe<;L|y79<=vVBrT&E~>O<Sc-Ny+<)Iu|(;o>c=I9G)cACcOl{IeKdC_3`E2! zUm}3M2&WY_8#)LXjkzf>8ILel@j|T$V@w<8VA8qJYPA%G3u)J-GTHOJb*RZss<6!+ zF-!V59J!66u>zU;<>{x_hVUhuQJlS8my`aCtqQ!n;#k{8cpA z$XipKWRkyX#Lq?-rfud!?;b2~1gWt*Kvya3OW*{G6VVDqF2PFor_IG%=R>;(8It| z%(>pZ3Y?1=_um|OuWwyE_93}VO1`a6^$>WYDH zWip>~^6>J#s3}~~bt=OQoRqky{%J`dasLdu01!0X^hJsU7msK1(pM0Br?Ew3s#jp- zpXJUF0#-u%F0b9B+;fU6YS-~jy-BS#O04L%Wj5(^mxX+ad!B60R%x@1lB*)2VGQLhwp&wX z^&iZHc!OWX%Iruk{h8`9r=s~w?B;sv{1SF#2!&Z*(Hvpu(H_E#v}s10$`IbjXf6N`b4sbL*m=G=T(wr^xnr|I+=gpC=bSo@-h!gC}^! zrMnVYsR=kS7H=uEZU^7ml)J$UNEi!fcig#INHaTqw3*K2P`%P9F*gg1rgB#5Wl{`% zL!7||1qO;@APF#nLZr58{dW-!^UjA6qf44uo6R`WE?qt56^%Jq>Qw5NH3>^>G1mxu z!#%F1ah&aG*~=qLaCp2zMcYC_*Brb-A~^ORIgMZdq`SIR7kv30u&YopvI|)I;GAbq zXu!o7fC{)o0mSgTtSJz)p^FaFim%xLl<8K|V}9GfYh5FJMzKYWxu5cuP}ye^eA*6& zahuv}!v$ha5E@KAN~yIM@Vb0kscfz7%R;=R@~7?L(P<-c`@vFe1!5-4Rq4}w+pR6N znqOCkvj!5&-Hu+Z#s1s1pL<~G!d_42>aV1UF6rF^D1j+7nFW7hxqvsIb8jO7Nmx*pjk*)=j@XPRwmn_m{40L@b403QoRT zkd3ggi}d&7C!F$Ewhmx8)C*G*FItb#Yulup{OPxCZY{W)>Pq4YorpBh5!79ZEID4(G@<1Mm{4P5;9lH&0v1KHwoN=; zK~ro*byvq8lLe7=;})|6&-Ph8AL#;h8b5E2DJwA}8SriX9C0@JodmMM*-6v??G z6Oo6^Y8dpo9oU2ZufUDsm~`^PvjsC)DOQ^Dg8b+|Z!*G`Y?SUV`(wQ2fv=9Ky^=Bm zk6eg)>r{Tsc?HlV$|tuvY(i;nNg}Hz&2Mu7^s3!7&Cu3=tqz*Frn_Jxv}@1h5K~7@ z6r#<>s@N8oVPI12Otk~WNJ$m3^$_q8=-mJ**ZAW?d0I5AeQP}#L9IorBPwoP8rE(0_bsihp;U$QP=?hS@1j{Cbv0U8l3 zZq&!jX0=M3qXbE@`@qw9nf|1P2L9w{Q>=$0De)9WS1q*Rn&kW=(ERt73auWR>Hc5P z=e^VO#R&i3de7iSO}J?5sK)qz5breyy4+n3zdly&#XXVWyzda|0@J}lIPL@%aMc0a zG*9ioQ2mluHb;T<+53l9*Yos3pb*4f&djTl9B2WX>F z1VTS1w*)F1E~6P>+}o>h3c~}IM}Xj+^uH8L4=H4Rn?qB~=8C63chMUJxuLmeXZyjn zn6hq4&wD7ZETf%6-akG12vQa#Ol)v|*J&{z3ANmD%5cuo2{K;r3;o>h4#+JwdrjES z|6Kv&jiOB5K{&>aeI#8(+z4`yplrxSk(zy;1Ps7)m7A*=v^!IGnHGtgm*IZg?vZT+ z=;!(1VOTU4wQX3KKFk$Y(ec)5nuc~$wRlH1cxG|{chkw7#&=mrMELR)MSl5rIHKn_ zkH_+y8IBO@zY^jSz{f)wygw|o|EUaIv(1_#rX`b}+3N#12fHvp-{DxcFo3q_G#fK{ zC)du=`caX5WO1rj@9oB%fJIKnEimQtK_ct#OoVje@diuZiAFM@W3dpm#9(M5rejf2 zS37xWGi0OO`iFmi%sH*^uuq+2ogg1K-cNGc#bC1Tt|?gQ&DaTd5iV~`PNOqT?l757 ztim15gf}<+E%+Sa00H9hn;!>h3YLvaDe*B*Vh;c@01#XrMppSmHEX>Q?GL7y@i3gT zLi5G5Y;_3!2GB{c`E0;QOa| zZ=ul&LrINd9g@Q+)cR&G)xB^_JfZ6XbF8D_O@0P?UX-k@oVZqYI$txVoHXx-6(N;0 z!M5@yk8z>!W;+d{RyaO8DmSo%)huuVaNVa7ajt9frRIZ(F3iOgvSoeoZ3aOgc@90P zuKOh>>W(G%yH@|XQpe8bO$96#!uCbeefKEHk8KGnZ!Te@>Kh;Wr@JaplZGB=-g~~; zoIB+YUq78x-DK93mh(6GC;hHq0AxRfpNQikdr0=IYdPP|^M|b+5Lg~KqELf|NyKG= zl-H_1OR&@7`8F%hXM^&D=E^f5jyJx}lS8e|CeDe(0l^StefbbO6Sa;VFMMN#qeL zDwft8I-P%rze~m0EZXZ0*s-Jk>_8lOJYl_3~Kg5MEg&sRi3u6oro_g zyqh*_gO`!#K1D|%O@J}LHCYzcqF}RUjvrC3T`JGQmJzB{)s|L~auc*~MzLZxQX{!J zqh;r9L-hBEV~y-|uoP)Ij1Lk(){KUE`;#@!e5gEgpg7Y_g(HdCp;b!=-{m8q+|`Lo zJKKy{!a0?9Uld89*B&}*S7w{n&=krrJ+Z(d_?e&xu{#jbo} zZr5)n?-C>_j)#={lV};mXFPE%t6+Kpa;amSe|Wkx6SPsG!v%Gr=|U%ZJAqB25PKlS zbdQ1h%%rQVj{xa5Lf`~2;@{|hV>bVJf{nZ4se3z>>!@y1uP74xJgFP}l}7uX=_pe<{Ro+g50c4qOCE8SW-Lj&9Cs1|fEUGr)cCb6c) z6;H)T&A^`ao6uc{`W_-Akv(H*epp{&D?dx)F%>XXuW0c9&Hg?v7%N8#M}Nd?!KGee zJhiFPJL4-{LQ81yqSnc^_$H;Vaj^uf?+o9C@??t-ym*d2sL2F>k!2E`Scqsdi*>i7 z4DYy`Y79}{-!Bb?0ajLrj6aUip9}s1qpVcDm)2_c#rPLY3?nzk zdPn{{;b&`zGaImT!7E|ofClp6>}WFgBWf66JdO;zmgniQARF^BVYc$R*DES={&NorKnm6{$+pLs$SH!ZwzlvU>-}6d?gq3_0Ma1p zAgkJC{w8ovh;V)9WwUAq@mxx$OlkkcnbS@0$-;Tn9t zG5wIWSQdU7xIh}H9vqNv?rYEka=n>G7gDx1G#z?$x>?$h`bbv2&D9WYTYA&lWQY&4 z!WfcU%Jr8|+tF-|lL9hD__~!l4Fs(q7u$MvdBjew6yeq-`xRTn$OjV;nE)%*lk<^l zIw~=*4&d$0_r;xDgM8O%tx!yNll;n_U-DhlvMMngrGa0}K=iB$IZl#l7}y!f#s>Wq zJ`rPa5<$Mm28wpDpq5hh^<>Pl+tB?gW>le5`(`+8^PXU@GBIBV0nN+TyuSC2>3Gc^ zWY_;XnVwn_)$BJg5BON;X`RVbIym-WxunINVXPIkBKG!@$h2pCA#3$lfPwUJmw9^E zHYaeqQHnN7D7R4~lE3jm^(&j_yHd#EKOG-7=GWPQqYqblSwF8@v0Vil*c49bFvvp?i zG`7q#pD$v({Td*#Uts)4_GEJT2bxV&)AG~~9_^t&Bd90O(_24Q7&`j!Lc zld1g~=cOX+iJK^|v_x-YK(H1`ZCOk_Ii9B2YCo^L2w3db$ydjElRDK$M4ze%xbFU~ zc3r>KV+hz_x4}kWKg|g$xTL`r^Xf7MmXUw7j1|oHibw`$c}aYGE#qo3w619A@i{%T z0eM)aiz1WnBksON2Wu^cw{^dfQx_7N%xJN~@n6WBQ?1M*-x6-si*Q#*}Wup_g7^@$?puJ zFV(S2JK?WuYnCZ=JARL*ccz{E9A5gzK`b>;&&$1cQdAi#gCH=!(Z53z)0)^=|Gnz^H-cYR@wTf2dfi3Pu>( zGOMOwzU_nf+f@R*shgDWTWL_89N9+aFp`aAkE5ac)nn;XS*qx0NG>8+_5jThjhjNQt{BV0MneINdM z&8bZeF=ju%IRT*tqaEUEq z1wY79RUOE)j4b*b&!8pfQdqMt0fi(aN1tM1?uf(^C~8kGSYOK zs)E2uK{)O?SG-5!Bx1!FTh&mtxAR}STw0t|3T?C>+buP+&Rm4cY<{qqONq0BqjRVx zx4eR2;b%>4=$IJXIQ)sU)>36~+A1q;CGzDk98)BO?RAvzP|N2|qpw0V{baiC=Eb%C@4mL9mE;m-!0P%5T-5lxEuG{!n_m>`JvhAgN7vNe{Ta z7N9(=)D!7r-4D>OmjIbytBG2;m&@H#zq&Mlf#vTVQI-T*6H{nxGYsAm8}Yf>z(2J* zX#Tfl2#0yAiZJF=mAM29$2Syx_;-`znA#ZYAwRTF40GCCi<;BBR9*@m3EKl8NTOm` z0ePSyZu{1S8oCe(xRC;I)EIvcpmHZA8Q)B^bE+q&R7!NQmY1f78ysPNJxdo6!QTq^ znSD!A(5i1iZWOEAEtd9dCB?NFCG*$*L{DlzQHJqbUrICIWI^0vXyD~o;jLIUi5sSi zb*(l9oO(zF1!Qchfwn8l;3LEUwZe+rd_Re#*~0;~7KtUmO^#&YSGQme-O_*q$*+V3 zd?*u_ey6hbf-b=BU=u`_TtY_0H zs%>R;B_o8H3@YM^P!~)nlVma&j%)&3VtfDaIHj#JK<*i}=usi>jyI_ylAgAwT5qCG z-EI`r=6^&8Py(o0JxK0P5d=GA2)6@CrlIt>J8oHpTHaaWB|9AaO#Og#gO9kgPk>Gz z_Kz0HG$PQ!PSJ~!Br!{oI*hNLF&1GFMRP3C5DL5>yYRgPs*IAGn6TDuy+_bWdXl(& zVRwDcR96C|D6s!BCcOtt5K06kz~ncoE*s@8r87vgvxBqV&2;|%?{H;kFBG?a&pslw zG*#3)9>|{fgKa;o-{X7beF54ifd` is required. - -Flashing an application to a STM32WBA65I-DK1 --------------------------------------------- - -Here is an example for the :zephyr:code-sample:`blinky` application. - -.. zephyr-app-commands:: - :zephyr-app: samples/basic/blinky - :board: stm32wba65i_dk1 - :goals: build flash - -You will see the LED blinking every second. - -Debugging -========= - -Debugging using OpenOCD ------------------------ - -You can debug an application in the usual way using OpenOCD. Here is an example for the -:zephyr:code-sample:`blinky` application. - -.. zephyr-app-commands:: - :zephyr-app: samples/basic/blinky - :board: stm32wba65i_dk1 - :maybe-skip-config: - :goals: debug - -.. _STM32WBA Series on www.st.com: - https://www.st.com/en/microcontrollers-microprocessors/stm32wba-series.html - -.. _STM32CubeProgrammer: - https://www.st.com/en/development-tools/stm32cubeprog.html diff --git a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts deleted file mode 100644 index 48e70a3e121e..000000000000 --- a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.dts +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2025 STMicroelectronics - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include -#include "arduino_r3_connector.dtsi" -#include - -/ { - model = "STMicroelectronics STM32WBA65I Discovery kit board"; - compatible = "st,stm32wba65i-dk1"; - - #address-cells = <1>; - #size-cells = <1>; - - chosen { - zephyr,bt-c2h-uart = &usart1; - zephyr,console = &usart1; - zephyr,shell-uart = &usart1; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - }; - - leds: leds { - compatible = "gpio-leds"; - - green_led_1: led_0 { - gpios = <&gpiod 8 GPIO_ACTIVE_LOW>; - label = "User LD6"; - }; - - red_led_2: led_1 { - gpios = <&gpiod 9 GPIO_ACTIVE_LOW>; - label = "User LD5"; - }; - - blue_led_3: led_2 { - /* Not functional w/o a 0Ohm resistor on MB2143 R42 */ - gpios = <&gpiob 10 GPIO_ACTIVE_LOW>; - label = "User LD3"; - }; - }; - - adc-keys { - compatible = "adc-keys"; - io-channels = <&adc4 6>; - keyup-threshold-mv = <3300>; - - select_key { - press-thresholds-mv = <0>; - zephyr,code = ; - }; - - left_key { - press-thresholds-mv = <670>; - zephyr,code = ; - }; - - down_key { - press-thresholds-mv = <1320>; - zephyr,code = ; - }; - - up_key { - press-thresholds-mv = <2010>; - zephyr,code = ; - }; - - right_key { - press-thresholds-mv = <2650>; - zephyr,code = ; - }; - }; - - aliases { - led0 = &green_led_1; - led1 = &red_led_2; - }; -}; - -&clk_lsi { - status = "okay"; -}; - -&clk_lse { - status = "okay"; -}; - -&clk_hse { - hse-div2; - status = "okay"; -}; - -&clk_hsi { - status = "okay"; -}; - -&rcc { - clocks = <&clk_hse>; - clock-frequency = ; - ahb-prescaler = <1>; - ahb5-prescaler = <2>; - apb1-prescaler = <1>; - apb2-prescaler = <2>; - apb7-prescaler = <1>; -}; - -&iwdg { - status = "okay"; -}; - -&rtc { - status = "okay"; - clocks = <&rcc STM32_CLOCK(APB7, 21)>, - <&rcc STM32_SRC_LSE RTC_SEL(1)>; - prescaler = <32768>; -}; - -&usart1 { - clocks = <&rcc STM32_CLOCK(APB2, 14)>, - <&rcc STM32_SRC_HSI16 USART1_SEL(2)>; - pinctrl-0 = <&usart1_tx_pb12 &usart1_rx_pa8>; - pinctrl-1 = <&analog_pb12 &analog_pa8>; - pinctrl-names = "default", "sleep"; - current-speed = <115200>; - status = "okay"; -}; - -&spi1 { - pinctrl-0 = <&spi1_nss_pa12 &spi1_sck_pb4 - &spi1_miso_pb3 &spi1_mosi_pa15>; - pinctrl-names = "default"; - status = "okay"; -}; - -&i2c1 { - pinctrl-0 = <&i2c1_scl_pb2 &i2c1_sda_pb1>; - pinctrl-names = "default"; - status = "okay"; - clock-frequency = ; -}; - -&adc4 { - pinctrl-0 = <&adc4_in6_pa3>; - pinctrl-names = "default"; - st,adc-clock-source = "ASYNC"; - st,adc-prescaler = <4>; - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - - channel@6 { - reg = <0x6>; - zephyr,gain = "ADC_GAIN_1"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,resolution = <12>; - zephyr,vref-mv = <3300>; - }; -}; - -stm32_lp_tick_source: &lptim1 { - clocks = <&rcc STM32_CLOCK(APB7, 11)>, - <&rcc STM32_SRC_LSE LPTIM1_SEL(3)>; - status = "okay"; -}; - -&rng { - status = "okay"; -}; - -&flash0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - storage_partition: partition@1c0000 { - label = "storage"; - reg = <0x001c0000 DT_SIZE_K(256)>; - }; - }; -}; diff --git a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.yaml b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.yaml deleted file mode 100644 index b77e57240f1a..000000000000 --- a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1.yaml +++ /dev/null @@ -1,10 +0,0 @@ -identifier: stm32wba65i_dk1/stm32wba65xx -name: ST STM32WBA65I Discovery kit -type: mcu -arch: arm -toolchain: - - zephyr - - gnuarmemb -ram: 512 -flash: 2048 -vendor: st diff --git a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1_defconfig b/boards/st/stm32wba65i_dk1/stm32wba65i_dk1_defconfig deleted file mode 100644 index 5e650e6826cb..000000000000 --- a/boards/st/stm32wba65i_dk1/stm32wba65i_dk1_defconfig +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2025 STMicroelectronics - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable GPIO -CONFIG_GPIO=y - -# Console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable HW stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable the internal SMPS regulator -CONFIG_POWER_SUPPLY_DIRECT_SMPS=y - -# Enable ADC for joystick -CONFIG_ADC=y diff --git a/boards/st/stm32wba65i_dk1/support/openocd.cfg b/boards/st/stm32wba65i_dk1/support/openocd.cfg deleted file mode 100644 index 0745453a16a5..000000000000 --- a/boards/st/stm32wba65i_dk1/support/openocd.cfg +++ /dev/null @@ -1,26 +0,0 @@ -# Note: Using OpenOCD using stm32wba65i_dk1 requires using openocd fork. -# See board documentation for more information - -source [find interface/stlink-dap.cfg] - -set WORKAREASIZE 0x8000 - -transport select "dapdirect_swd" - -# Enable debug when in low power modes -set ENABLE_LOW_POWER 1 - -# Stop Watchdog counters when halt -set STOP_WATCHDOG 1 - -# STlink Debug clock frequency -set CLOCK_FREQ 8000 - -# Reset configuration -# use hardware reset, connect under reset -# connect_assert_srst needed if low power mode application running (WFI...) -reset_config srst_only srst_nogate - -source [find target/stm32wbax.cfg] - -gdb_memory_map disable From fc0860aa4f1bf1fc2ea1d2939e008814d8bdfe93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0809/3334] Revert "[nrf fromtree] boards: mps4: Enable non-secure variant support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0d02a57233fdeee0a917779adca3f18b4f5eaa17. Signed-off-by: Tomasz Moń --- boards/arm/mps4/board.cmake | 11 +---------- boards/arm/mps4/mps4_corstone315_fvp_ns.yaml | 3 --- boards/arm/mps4/mps4_corstone320_fvp_ns.yaml | 3 --- modules/trusted-firmware-m/Kconfig.tfm | 6 ++---- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/boards/arm/mps4/board.cmake b/boards/arm/mps4/board.cmake index 56090124532a..9c4d4a0ef337 100644 --- a/boards/arm/mps4/board.cmake +++ b/boards/arm/mps4/board.cmake @@ -33,16 +33,7 @@ if(CONFIG_ARM_PAC OR CONFIG_ARM_BTI) endif() if(CONFIG_BUILD_WITH_TFM) - # Workaround: Use binary (.bin) format images until TF-M supports generating them in hex (.hex) - # format. The image load addresses are referred from the TF-M official documentation at: - # https://trustedfirmware-m.readthedocs.io/en/latest/platform/arm/mps4/corstone320/README.html - set(ARMFVP_FLAGS ${ARMFVP_FLAGS} - --data ${APPLICATION_BINARY_DIR}/tfm/bin/bl1_1.bin@0x11000000 - --data ${APPLICATION_BINARY_DIR}/tfm/bin/cm_provisioning_bundle.bin@0x12024000 - --data ${APPLICATION_BINARY_DIR}/tfm/bin/dm_provisioning_bundle.bin@0x1202aa00 - --data ${APPLICATION_BINARY_DIR}/tfm/bin/bl2_signed.bin@0x12031400 - -a ${APPLICATION_BINARY_DIR}/zephyr/tfm_merged.hex - ) + set(ARMFVP_FLAGS ${ARMFVP_FLAGS} -a ${APPLICATION_BINARY_DIR}/zephyr/tfm_merged.hex) endif() # FVP Parameters diff --git a/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml b/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml index c04889d7f6f4..01bee24100a2 100644 --- a/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml +++ b/boards/arm/mps4/mps4_corstone315_fvp_ns.yaml @@ -7,9 +7,6 @@ type: mcu arch: arm ram: 1024 flash: 512 -simulation: - - name: armfvp - exec: FVP_Corstone_SSE-315 toolchain: - gnuarmemb - zephyr diff --git a/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml b/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml index 51bfb990e5f6..45ee954a3370 100644 --- a/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml +++ b/boards/arm/mps4/mps4_corstone320_fvp_ns.yaml @@ -7,9 +7,6 @@ type: mcu arch: arm ram: 1024 flash: 512 -simulation: - - name: armfvp - exec: FVP_Corstone_SSE-320 toolchain: - gnuarmemb - zephyr diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index dc4b206595d0..36a734ad8b3e 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -12,13 +12,11 @@ config TFM_BOARD string default "nxp/lpcxpresso55s69" if BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS default "arm/mps2/an521" if BOARD_MPS2_AN521_CPU0_NS - default "arm/mps3/corstone300/fvp" if BOARD_MPS3_CORSTONE300_FVP_NS + default "arm/mps3/corstone300/fvp" if BOARD_MPS3_CORSTONE300_FVP_NS default "arm/mps3/corstone300/an547" if BOARD_MPS3_CORSTONE300_AN547_NS default "arm/mps3/corstone300/an552" if BOARD_MPS3_CORSTONE300_AN552_NS default "arm/mps3/corstone310/an555" if BOARD_MPS3_CORSTONE310_AN555_NS - default "arm/mps3/corstone310/fvp" if BOARD_MPS3_CORSTONE310_FVP_NS - default "arm/mps4/corstone315" if BOARD_MPS4_CORSTONE315_FVP_NS - default "arm/mps4/corstone320" if BOARD_MPS4_CORSTONE320_FVP_NS + default "arm/mps3/corstone310/fvp" if BOARD_MPS3_CORSTONE310_FVP_NS default "stm/b_u585i_iot02a" if BOARD_B_U585I_IOT02A default "stm/nucleo_l552ze_q" if BOARD_NUCLEO_L552ZE_Q default "stm/stm32l562e_dk" if BOARD_STM32L562E_DK From 7d4f4f1c396d3013652a4ce8fe4fab722034631d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0810/3334] Revert "[nrf noup] test-spec: update CI-ble-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 365da0027ced3963b5c7d8906a99c02d71fb4993. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index ecf8102649dc..d91e0f0bd3a2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -108,8 +108,6 @@ - "boards/nordic/nrf5*" - any: - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf9*" - any: - "subsys/pm/**/*" From 3a36189418f02186370a3686021fe4fc7c31845b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0811/3334] Revert "[nrf noup] test-spec: update CI-fem-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 338f4a025967dfe67242ebc8fc01706fb89697e5. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index d91e0f0bd3a2..aac297f11412 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -204,11 +204,7 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 2743601a3ddc33eaf5e822039460d681366cee52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0812/3334] Revert "[nrf noup] test-spec: update CI-matter-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a33f32a96e1fbcbff99ef8e0a4f8909018f218ed. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index aac297f11412..df4166d8e6b0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -283,12 +283,7 @@ "CI-matter-test": - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf52*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/dfu/**/*" - "subsys/settings/**/*" - "subsys/net/**/*" From b329141f52bf82474e141a775b5f052144681b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0813/3334] Revert "[nrf noup] test-spec: update CI-thread-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e77279a09ef4adbb6affd4f735a7e10644c7facc. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index df4166d8e6b0..79064e3febd0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -248,11 +248,7 @@ - "modules/mbedtls/**/*" - "modules/openthread/**/*" - "samples/net/openthread/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" From 520d74cae4d77ab4ed90018ac7327b13fc887712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0814/3334] Revert "[nrf noup] test-spec: update CI-rs-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 59e3ced7c567e0b25c2513e49b11ac5a68299a6c. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 79064e3febd0..7588b157337a 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -231,11 +231,7 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 1387009edac1b67e2bf123adf94ed2d796207256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0815/3334] Revert "[nrf noup] test-spec: update CI-ble-samples-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ceabc540fed74d3e1969b78f92dc0fbd7e815a3e. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 7588b157337a..af7db8adce71 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -115,9 +115,7 @@ - any: - "drivers/bluetooth/**/*" - any: - - "dts/arm/nordic/nrf52*" - - "dts/arm/nordic/nrf53*" - - "dts/arm/nordic/nrf54*" + - "dts/arm/nordic/nrf5*" - any: - "subsys/bluetooth/**/*" - "!subsys/bluetooth/mesh/**/*" @@ -125,6 +123,7 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/**/*" "CI-mesh-test": - "subsys/bluetooth/mesh/**/*" From 53fb5341b40668f14649bea50ad3b38f39d38293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0816/3334] Revert "[nrf noup] test-spec: update CI-dfu-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f381002023190d1715400a50fc39672b7150fc1b. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index af7db8adce71..1c45698e423d 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -54,8 +54,7 @@ - "tests/subsys/mgmt/mcumgr/**/*" "CI-dfu-test": - - "boards/nordic/nrf54h20dk*" - - "boards/nordic/nrf54l*" + - "boards/nordic/**/*" - "drivers/bluetooth/**/*" - "drivers/console/**/*" - "drivers/flash/**/*" From c143fb94a35d6f280a52dc26f3ec0275f19b9147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0817/3334] Revert "[nrf noup] test-spec: update CI-boot-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc60f67fdd2f9c79a08a15161e53934c0c79112d. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 1c45698e423d..27e81cd357e7 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,11 +39,7 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": - - "boards/nordic/nrf52840dk*" - - "boards/nordic/nrf5340dk*" - - "boards/nordic/nrf54h20dk*" - - "boards/nordic/nrf54l*" - - "boards/nordic/nrf9160dk*" + - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" From 736332ea3a698764807e04fe3db48f438eff4568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0818/3334] Revert "[nrf noup] test-spec: update CI-fem-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ade912c31368c04f1ff3458a6385a969d426bff7. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 27e81cd357e7..554b15bc2476 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -180,11 +180,7 @@ - "modules/mbedtls/**/*" "CI-fem-test": - - "boards/nordic/nrf21540dk*" - - "boards/nordic/nrf52833dk*" - - "boards/nordic/nrf52840dk*" - - "boards/nordic/nrf5340dk*" - - "boards/nordic/nrf54l*" + - "boards/nordic/**/*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From 3c0863a1b70643ae464eff27c0771fc88870280b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0819/3334] Revert "[nrf noup] test-spec: update CI-rs-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b944a50b18fb5a2adc705ca4dedd5f1a81db77d2. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 554b15bc2476..09d7b372bfca 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -203,11 +203,7 @@ - "CMakeLists.txt" "CI-rs-test": - - "boards/nordic/nrf21540dk*" - - "boards/nordic/nrf52833dk*" - - "boards/nordic/nrf52840dk*" - - "boards/nordic/nrf5340dk*" - - "boards/nordic/nrf54l*" + - "boards/nordic/**/*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From 3ca60727cfaa8ddfeaaf2c00c71aec35260c607e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0820/3334] Revert "[nrf fromtree] net: possibility to set custom link layer address length" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 791264643d9ecab90dce88872ecf09d99a6bd3cb. Signed-off-by: Tomasz Moń --- include/zephyr/net/net_linkaddr.h | 4 +--- subsys/net/ip/Kconfig | 8 -------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/zephyr/net/net_linkaddr.h b/include/zephyr/net/net_linkaddr.h index 74657c814fc8..134c20574309 100644 --- a/include/zephyr/net/net_linkaddr.h +++ b/include/zephyr/net/net_linkaddr.h @@ -30,9 +30,7 @@ extern "C" { */ /** Maximum length of the link address */ -#if CONFIG_NET_LINK_ADDR_CUSTOM_LENGTH > 0 -#define NET_LINK_ADDR_MAX_LENGTH CONFIG_NET_LINK_ADDR_CUSTOM_LENGTH -#elif defined(CONFIG_NET_L2_PHY_IEEE802154) || defined(CONFIG_NET_L2_PPP) +#if defined(CONFIG_NET_L2_PHY_IEEE802154) || defined(CONFIG_NET_L2_PPP) #define NET_LINK_ADDR_MAX_LENGTH 8 #else #define NET_LINK_ADDR_MAX_LENGTH 6 diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index 673f24d39dda..b5557c3632e0 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -767,14 +767,6 @@ config NET_HEADERS_ALWAYS_CONTIGUOUS NET_BUF_FIXED_DATA_SIZE enabled and NET_BUF_DATA_SIZE of 128 for instance. -config NET_LINK_ADDR_CUSTOM_LENGTH - int "Size of custom link layer address length" - default 0 - help - This option allows to define custom link layer address length - if your link layer technology is not supported directly. - As a default, custom link layer address length is not used. - # If we are running network tests found in tests/net, then the NET_TEST is # set and in that case we default to Dummy L2 layer as typically the tests # use that by default. From 59fc574b9a0a251c97c3e7412156b6dac3703f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:22 +0100 Subject: [PATCH 0821/3334] Revert "[nrf fromtree] net: ip: new Kconfig NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5cc9c4e5e802d0fce0d2f6f9f56157eafe54bd5a. Signed-off-by: Tomasz Moń --- subsys/net/ip/Kconfig.mgmt | 10 +--------- subsys/net/ip/net_private.h | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/subsys/net/ip/Kconfig.mgmt b/subsys/net/ip/Kconfig.mgmt index f5f745390b71..4ca57e4c8e5e 100644 --- a/subsys/net/ip/Kconfig.mgmt +++ b/subsys/net/ip/Kconfig.mgmt @@ -95,23 +95,15 @@ config NET_MGMT_EVENT_INFO and listeners will then be able to get it. Such information depends on the type of event. -if NET_MGMT_EVENT_INFO -config NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE - int "Default size of event information data" - default 32 - help - The default size of the data which can be passed along with an event. - config NET_MGMT_EVENT_MONITOR bool "Monitor network events from net shell" - depends on NET_SHELL + depends on NET_SHELL && NET_MGMT_EVENT_INFO help Allow user to monitor network events from net shell using "net events [on|off]" command. The monitoring is disabled by default. Note that you should probably increase the value of NET_MGMT_EVENT_QUEUE_SIZE from the default in order not to miss any events. -endif # NET_MGMT_EVENT_INFO config NET_MGMT_EVENT_MONITOR_STACK_SIZE int "Size of the stack allocated for the event_mon_stack thread" diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index a636fcf9b79a..11ae1be6b9fb 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -25,7 +25,7 @@ #include #endif /* CONFIG_NET_L2_WIFI_MGMT */ -#define DEFAULT_NET_EVENT_INFO_SIZE CONFIG_NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE +#define DEFAULT_NET_EVENT_INFO_SIZE 32 /* NOTE: Update this union with all *big* event info structs */ union net_mgmt_events { #if defined(CONFIG_NET_DHCPV4) From 4c252a7e32e465ee656ec8103dffe8abd69a6d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0822/3334] Revert "[nrf fromtree] sensor: bmm350: Fix I2C register write to use single transaction" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7eb1ad9cc9045a5a7671ba5c5f5e84a79564e943. Signed-off-by: Tomasz Moń --- drivers/sensor/bosch/bmm350/bmm350_bus.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/sensor/bosch/bmm350/bmm350_bus.c b/drivers/sensor/bosch/bmm350/bmm350_bus.c index d567f207654a..e82455e66dd3 100644 --- a/drivers/sensor/bosch/bmm350/bmm350_bus.c +++ b/drivers/sensor/bosch/bmm350/bmm350_bus.c @@ -52,29 +52,27 @@ static int bmm350_prep_reg_write_rtio_async(const struct bmm350_bus *bus, { struct rtio *ctx = bus->rtio.ctx; struct rtio_iodev *iodev = bus->rtio.iodev; - struct rtio_sqe *write_sqe = rtio_sqe_acquire(ctx); - uint8_t write_buf[2]; + struct rtio_sqe *write_reg_sqe = rtio_sqe_acquire(ctx); + struct rtio_sqe *write_buf_sqe = rtio_sqe_acquire(ctx); - if (!write_sqe) { + if (!write_reg_sqe || !write_buf_sqe) { rtio_sqe_drop_all(ctx); return -ENOMEM; } - write_buf[0] = reg; - write_buf[1] = val; - - /* Single I2C transaction: [W(addr), reg, data] */ - rtio_sqe_prep_tiny_write(write_sqe, iodev, RTIO_PRIO_NORM, write_buf, 2, NULL); + rtio_sqe_prep_tiny_write(write_reg_sqe, iodev, RTIO_PRIO_NORM, ®, 1, NULL); + write_reg_sqe->flags |= RTIO_SQE_TRANSACTION; + rtio_sqe_prep_tiny_write(write_buf_sqe, iodev, RTIO_PRIO_NORM, &val, 1, NULL); if (bus->rtio.type == BMM350_BUS_TYPE_I2C) { - write_sqe->iodev_flags |= RTIO_IODEV_I2C_STOP; + write_buf_sqe->iodev_flags |= RTIO_IODEV_I2C_STOP; } - /** Send back SQE so it can be concatenated later. */ + /** Send back last SQE so it can be concatenated later. */ if (out) { - *out = write_sqe; + *out = write_buf_sqe; } - return 1; + return 2; } static int bmm350_reg_read_rtio(const struct bmm350_bus *bus, uint8_t start, uint8_t *buf, int size) From 08aa525765f6c2b846f4b33e0c8a16d9ec8ff37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0823/3334] Revert "[nrf noup] test-spec: update CI-nfc-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 46ce70cb5f92d3c4f390f6f6677ed46c612fd2fa. Signed-off-by: Tomasz Moń --- .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 09d7b372bfca..00a75b24d829 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -242,10 +242,7 @@ - "drivers/spi/**/*" - "lib/crc/**/*" - "modules/hal_nordic/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/ipc/ipc_service/**/*" - "subsys/fs/**/*" - "subsys/mem_mgmt/**/*" From b89b369ed60257441113af3d649fc63534b1986f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0824/3334] Revert "[nrf noup] test-spec: update CI-cloud-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1c3fc7fb2f4e25e9fa1320fd7c135421ac3b4f7c. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 00a75b24d829..db9cac90e17f 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -332,7 +332,7 @@ - "drivers/serial/**/*" - "drivers/wifi/**/*" - "lib/posix/**/*" - - "soc/nordic/nrf9*/*" + - "soc/nordic/**/*" - "subsys/dfu/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" From 6f68d19a93e9ee4db034c869e06bbdf7af4b17c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0825/3334] Revert "[nrf fromtree] boards: nordic: nrf54h20dk: Fix CPURAD MPSL init failure" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ecdee3060c980b049ab57f2856581627cb4946aa. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 3 +-- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 910c192b0d5c..e2d5b08cd300 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -224,10 +224,9 @@ slot3_partition: &cpurad_slot1_partition { memory-regions = <&cpuapp_dma_region>; }; -/* Leave one channel for CPURAD */ &gpiote130 { status = "okay"; - owned-channels = <0 1 2 3 4 5 6>; + owned-channels = <0 1 2 3 4 5 6 7>; }; &gpio0 { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index f3b53844398e..4a8f5972227f 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -141,8 +141,3 @@ zephyr_udc0: &usbhs { }; }; }; - -/* For coex-grant GPIO */ -&gpiote130 { - owned-channels = <7>; -}; From b1467c3d9f7828d4928ce5c33794f49e506f1e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0826/3334] Revert "[nrf fromtree] boards: shields: nrf7002eb: Add 54H coex shield" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d5ab3bfc2889a22f206e2d5c6fd77c67fa1c869c. Signed-off-by: Tomasz Moń --- boards/shields/nrf7002eb/Kconfig.shield | 3 --- boards/shields/nrf7002eb/doc/index.rst | 1 - .../nrf7002eb/nrf7002eb_coex_sa.overlay | 24 ------------------- boards/shields/nrf7002eb/shield.yml | 6 ----- 4 files changed, 34 deletions(-) delete mode 100644 boards/shields/nrf7002eb/nrf7002eb_coex_sa.overlay diff --git a/boards/shields/nrf7002eb/Kconfig.shield b/boards/shields/nrf7002eb/Kconfig.shield index 03c85ebdb2a5..e369cfe3de42 100644 --- a/boards/shields/nrf7002eb/Kconfig.shield +++ b/boards/shields/nrf7002eb/Kconfig.shield @@ -6,6 +6,3 @@ config SHIELD_NRF7002EB config SHIELD_NRF7002EB_COEX def_bool $(shields_list_contains,nrf7002eb_coex) - -config SHIELD_NRF7002EB_COEX_SA - def_bool $(shields_list_contains,nrf7002eb_coex_sa) diff --git a/boards/shields/nrf7002eb/doc/index.rst b/boards/shields/nrf7002eb/doc/index.rst index 7b7ce2108a91..637f91ae21b4 100644 --- a/boards/shields/nrf7002eb/doc/index.rst +++ b/boards/shields/nrf7002eb/doc/index.rst @@ -51,7 +51,6 @@ edge-connector on some boards, like earlier revisions of the Thingy53 than v1.0. - ``nrf7002eb``: The default variant. - ``nrf7002eb_coex``: Variant which includes the COEX pins. -- ``nrf7002eb_coex_sa``: Variant which includes the COEX pins and is standalone. SR Co-existence *************** diff --git a/boards/shields/nrf7002eb/nrf7002eb_coex_sa.overlay b/boards/shields/nrf7002eb/nrf7002eb_coex_sa.overlay deleted file mode 100644 index e65c2f776a31..000000000000 --- a/boards/shields/nrf7002eb/nrf7002eb_coex_sa.overlay +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - nrf_radio_coex: coex { - compatible = "nordic,nrf7002-coex"; - status = "okay"; - - status0-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; - req-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; - grant-gpios = <&gpio1 3 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&gpiote130 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb/shield.yml b/boards/shields/nrf7002eb/shield.yml index f765158d0f7e..43ab36ad9951 100644 --- a/boards/shields/nrf7002eb/shield.yml +++ b/boards/shields/nrf7002eb/shield.yml @@ -10,9 +10,3 @@ shields: vendor: nordic supported_features: - wifi - - - name: nrf7002eb_coex_sa - full_name: nRF7002 Evaluation Board Shield (SR Co-Existence) standalone - vendor: nordic - supported_features: - - wifi From a30c4b713fc5d70fa40ef5d9648d5b6dcd429391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0827/3334] Revert "[nrf noup] ci: Use NordicBuilder to open backport PRs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f725df43b7e624b229696b669a9762317e3479bf. Signed-off-by: Tomasz Moń --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 402341a9c389..3ecf66b17da9 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -33,6 +33,6 @@ jobs: - name: Backport uses: zephyrproject-rtos/action-backport@7e74f601d11eaca577742445e87775b5651a965f # v2.0.3-3 with: - github_token: ${{ secrets.NCS_GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} issue_labels: Backport labels_template: '["Backport"]' From 465eb89acbe3397d5ffb54c03e364139516be48b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0828/3334] Revert "[nrf noup] ci: Dynamically set target branch for manifest PRs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b7daf22c5d53bbb19943cecc4a9ea742c635682c. Signed-off-by: Tomasz Moń --- .github/workflows/manifest-PR.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 6e2430ec901e..0f3bd738a36c 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -4,7 +4,6 @@ on: types: [opened, synchronize, closed, reopened] branches: - main - - ncs-v*-branch permissions: contents: read @@ -12,28 +11,9 @@ permissions: jobs: call-manifest-pr-action: runs-on: ubuntu-latest - outputs: - base-branch: ${{ steps.set-base-branch.outputs.base_branch }} steps: - # Determine the base branch: - # * sdk-zephyr/main -> sdk-nrf/main - # * sdk-zephyr/ncs-vX.Y-branch -> sdk-nrf/vX.Y-branch - - name: Set base branch - id: set-base-branch - run: | - if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then - echo "base_branch=main" >> "$GITHUB_OUTPUT" - elif [[ "${{ github.event.pull_request.base.ref }}" =~ ^ncs-(v[0-9]+\.[0-9]+-branch)$ ]]; then - branch_name="${{ github.event.pull_request.base.ref }}" - branch_name="${branch_name#ncs-}" - echo "base_branch=${branch_name}" >> "$GITHUB_OUTPUT" - else - echo "Error: Unsupported base branch: ${{ github.event.pull_request.base.ref }}" >&2 - exit 1 - fi - name: handle manifest PR uses: nrfconnect/action-manifest-pr@main with: token: ${{ secrets.NCS_GITHUB_TOKEN }} manifest-pr-title-details: ${{ github.event.pull_request.title }} - base-branch: ${{ steps.set-base-branch.outputs.base_branch }} From 4c6e853bd1228ed1c6d2eab0f60191d58da590bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0829/3334] Revert "[nrf fromlist] manifest: update hal_nordic to have fixes for examples" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fbabee3e816953726b564c358029bd49b01dd47e. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index ad7e9a53ca14..b9a1a35b79e9 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 248eadcacf976bbd27f1c0bc0dd3f11d8ec8657e + revision: 09f24fd6cc7df57a5b5d08102ceb4a38381e2c82 path: modules/hal/nordic groups: - hal From b3c00173ddbef5ac928b95774ca30ab4e76d7b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0830/3334] Revert "[nrf noup] test-spec: update CI-find-my-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4f11c2e93c3de15b754da84000727d862afd1b64. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index db9cac90e17f..483f135b03e2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -271,19 +271,13 @@ - "!subsys/bluetooth/audio/**/*" "CI-find-my-test": - - "boards/nordic/nrf52840dk/**/*" - - "boards/nordic/nrf5340dk/**/*" - - "boards/nordic/nrf54l15dk/**/*" + - "boards/nordic/**/*" - "drivers/bluetooth/**/*" - "drivers/entropy/**/*" - "drivers/flash/**/*" - "drivers/usb/**/*" - "drivers/regulator/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/dfu/**/*" - "subsys/fs/**/*" - "subsys/ipc/**/*" From fc611427b90cd7b9864082daea6e6f03693c5416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0831/3334] Revert "[nrf noup] test-spec: update CI-audio-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9e650a033fec9dc8dbcf7244854d3d758bcf0f51. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 483f135b03e2..14519ac3a149 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -345,12 +345,7 @@ - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - "samples/bluetooth/hci_ipc/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf52*" - - "!soc/nordic/nrf54*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/bluetooth/audio/**/*" - "subsys/bluetooth/host/**/*" - "subsys/dfu/**/*" From e6053b34064b5761efa4de41b4b8dff4bd96b742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0832/3334] Revert "[nrf noup] test-spec: update CI-test-low-level" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7cf858621a7780dc5ca8b9fa07592a98ca8d9514. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 92 +++++++++++++------------------------------ 1 file changed, 28 insertions(+), 64 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 14519ac3a149..5fdf9c0ca782 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -367,71 +367,35 @@ - "drivers/sensor/sensor_shell.c" "CI-test-low-level": - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf52*" - - "!soc/nordic/nrf53*" - - "!soc/nordic/nrf9*" - - "arch/arm/**/*" - - "arch/riscv/**/*" + - "arch/**/*" - "boards/nordic/nrf54*/**/*" - - "drivers/adc/**/*" - - "drivers/cache/**/*" - - "drivers/clock_control/**/*" - - "drivers/comparator/**/*" - - "drivers/counter/**/*" - - "drivers/flash/**/*" - - "drivers/gpio/**/*" - - "drivers/hwinfo/**/*" - - "drivers/i2c/**/*" - - "drivers/i2s/**/*" - - "drivers/interrupt_controller/**/*" - - "drivers/mbox/**/*" - - "drivers/mspi/**/*" - - "drivers/pinctrl/**/*" - - "drivers/power_domain/**/*" - - "drivers/pwm/**/*" - - "drivers/retained_mem/**/*" - - "drivers/rtc/**/*" - - "drivers/serial/**/*" - - "drivers/spi/**/*" - - "drivers/timer/**/*" - - "drivers/usb/**/*" - - "drivers/watchdog/**/*" - - any: - - "dts/vendor/nordic/**/*" - - "!dts/vendor/nordic/nrf52*" - - "!dts/vendor/nordic/nrf53*" - - "!dts/vendor/nordic/nrf9*" + - "drivers/**/*" + - "dts/**/*" + - "include/zephyr/**/*" + - "kernel/**/*" - "modules/hal_nordic/**/*" + - "samples/basic/blinky_pwm/**/*" + - "samples/basic/fade_led/**/*" + - "samples/boards/nrf/**/*" - "samples/boards/nordic/**/*" - - "tests/arch/arm/**/*" + - "samples/drivers/adc/**/*" + - "samples/drivers/jesd216/**/*" + - "samples/drivers/mbox/**/*" + - "samples/drivers/soc_flash_nrf/**/*" + - "samples/drivers/spi_flash/**/*" + - "samples/drivers/watchdog/**/*" + - "samples/hello_world/**/*" + - "samples/sensor/**/*" + - "samples/subsys/ipc/**/*" + - "samples/subsys/logging/**/*" + - "samples/subsys/settings/**/*" + - "samples/subsys/usb/cdc_acm/**/*" + - "samples/subsys/usb/mass/**/*" + - "samples/synchronization/**/*" + - "subsys/logging/**/*" + - "subsys/settings/**/*" + - "tests/arch/**/*" - "tests/boards/nrf/**/*" - - "tests/drivers/adc/**/*" - - "tests/drivers/clock_control/**/*" - - "tests/drivers/comparator/**/*" - - "tests/drivers/counter/**/*" - - "tests/drivers/flash/**/*" - - "tests/drivers/gpio/**/*" - - "tests/drivers/hwinfo/**/*" - - "tests/drivers/i2c/**/*" - - "tests/drivers/i2s/**/*" - - "tests/drivers/interrupt_controller/**/*" - - "tests/drivers/mbox/**/*" - - "tests/drivers/mspi/**/*" - - "tests/drivers/pinctrl/**/*" - - "tests/drivers/pwm/**/*" - - "tests/drivers/retained_mem/**/*" - - "tests/drivers/rtc/**/*" - - "tests/drivers/spi/**/*" - - "tests/drivers/timer/**/*" - - "tests/drivers/uart/**/*" - - "tests/drivers/watchdog/**/*" - - "tests/kernel/common/**/*" - - "tests/kernel/context/**/*" - - "tests/kernel/fatal/**/*" - - "tests/kernel/fpu_sharing/**/*" - - "tests/kernel/gen_isr_table/**/*" - - "tests/kernel/interrupt/**/*" - - "tests/kernel/sched/preempt/**/*" + - "tests/boards/nordic/**/*" + - "tests/drivers/**/*" + - "tests/kernel/**/*" From 42bfc63db75e2a14ae1edcd28a34508229da9f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0833/3334] Revert "[nrf fromtree] tests: boards: nrf: i2s: Remove test that checks I2S clock divider" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4f157341585e9e4f054436f8615903ae8cba9d98. Signed-off-by: Tomasz Moń --- .../boards/nrf/i2s/i2s_divider/CMakeLists.txt | 9 + .../boards/nrf52840dk_nrf52840.overlay | 28 +++ .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 32 ++++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 28 +++ tests/boards/nrf/i2s/i2s_divider/prj.conf | 3 + tests/boards/nrf/i2s/i2s_divider/src/main.c | 167 ++++++++++++++++++ .../boards/nrf/i2s/i2s_divider/testcase.yaml | 32 ++++ 7 files changed, 299 insertions(+) create mode 100644 tests/boards/nrf/i2s/i2s_divider/CMakeLists.txt create mode 100644 tests/boards/nrf/i2s/i2s_divider/boards/nrf52840dk_nrf52840.overlay create mode 100644 tests/boards/nrf/i2s/i2s_divider/boards/nrf5340dk_nrf5340_cpuapp.overlay create mode 100644 tests/boards/nrf/i2s/i2s_divider/boards/nrf54l15dk_nrf54l15_cpuapp.overlay create mode 100644 tests/boards/nrf/i2s/i2s_divider/prj.conf create mode 100644 tests/boards/nrf/i2s/i2s_divider/src/main.c create mode 100644 tests/boards/nrf/i2s/i2s_divider/testcase.yaml diff --git a/tests/boards/nrf/i2s/i2s_divider/CMakeLists.txt b/tests/boards/nrf/i2s/i2s_divider/CMakeLists.txt new file mode 100644 index 000000000000..35157bf3d443 --- /dev/null +++ b/tests/boards/nrf/i2s/i2s_divider/CMakeLists.txt @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(i2s_divider) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/boards/nrf/i2s/i2s_divider/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/i2s/i2s_divider/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..ca21135bca4f --- /dev/null +++ b/tests/boards/nrf/i2s/i2s_divider/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + i2s-node0 = &i2s0; + }; +}; + +&pinctrl { + i2s0_default_alt: i2s0_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&i2s0 { + status = "okay"; + pinctrl-0 = <&i2s0_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/boards/nrf/i2s/i2s_divider/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/i2s/i2s_divider/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..a4c595b1bcdb --- /dev/null +++ b/tests/boards/nrf/i2s/i2s_divider/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + i2s-node0 = &i2s0; + }; +}; + +&pinctrl { + i2s0_default_alt: i2s0_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&uart1 { + status = "disabled"; +}; + +&i2s0 { + status = "okay"; + pinctrl-0 = <&i2s0_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/boards/nrf/i2s/i2s_divider/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/i2s/i2s_divider/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..08de6a76c7c5 --- /dev/null +++ b/tests/boards/nrf/i2s/i2s_divider/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + i2s-node0 = &i2s20; + }; +}; + +&pinctrl { + i2s20_default_alt: i2s20_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&i2s20 { + status = "okay"; + pinctrl-0 = <&i2s20_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/boards/nrf/i2s/i2s_divider/prj.conf b/tests/boards/nrf/i2s/i2s_divider/prj.conf new file mode 100644 index 000000000000..38455942679e --- /dev/null +++ b/tests/boards/nrf/i2s/i2s_divider/prj.conf @@ -0,0 +1,3 @@ +CONFIG_ZTEST=y +CONFIG_I2S=y +CONFIG_I2S_LOG_LEVEL_INF=y diff --git a/tests/boards/nrf/i2s/i2s_divider/src/main.c b/tests/boards/nrf/i2s/i2s_divider/src/main.c new file mode 100644 index 000000000000..bc4176d3284b --- /dev/null +++ b/tests/boards/nrf/i2s/i2s_divider/src/main.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +#define I2S_DEV_NODE DT_ALIAS(i2s_node0) + +#define WORD_SIZE 16U +#define NUMBER_OF_CHANNELS 2 +#define FRAME_CLK_FREQ 44100 + +#define NUM_BLOCKS 2 +#define TIMEOUT 1000 + +#define SAMPLES_COUNT 4 +/* Each word has one bit set */ +static const int16_t data[SAMPLES_COUNT] = {16, 32, 64, 128}; + +#define BLOCK_SIZE (2 * sizeof(data)) + +#ifdef CONFIG_NOCACHE_MEMORY + #define MEM_SLAB_CACHE_ATTR __nocache +#else + #define MEM_SLAB_CACHE_ATTR +#endif /* CONFIG_NOCACHE_MEMORY */ + +static char MEM_SLAB_CACHE_ATTR __aligned(WB_UP(32)) + _k_mem_slab_buf_tx_0_mem_slab[NUM_BLOCKS * WB_UP(BLOCK_SIZE)]; +STRUCT_SECTION_ITERABLE(k_mem_slab, tx_0_mem_slab) = + Z_MEM_SLAB_INITIALIZER(tx_0_mem_slab, _k_mem_slab_buf_tx_0_mem_slab, + WB_UP(BLOCK_SIZE), NUM_BLOCKS); + +static const struct device *dev_i2s; + +static const struct i2s_config default_i2s_cfg = { + .word_size = WORD_SIZE, + .channels = NUMBER_OF_CHANNELS, + .format = I2S_FMT_DATA_FORMAT_I2S, + .frame_clk_freq = FRAME_CLK_FREQ, + .block_size = BLOCK_SIZE, + .timeout = TIMEOUT, + .options = I2S_OPT_FRAME_CLK_MASTER | I2S_OPT_BIT_CLK_MASTER, + .mem_slab = &tx_0_mem_slab, +}; + +/** @brief Check actual PCM rate at frame_clk_freq=8000. + * + * - Configure I2S stream. + */ +ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_08000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + int ret; + + i2s_cfg.frame_clk_freq = 8000; + + ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); + zassert_ok(ret, "i2s_configure() returned %d", ret); +} + +/** @brief Check actual PCM rate at frame_clk_freq=16000. + * + * - Configure I2S stream. + */ +ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_16000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + int ret; + + i2s_cfg.frame_clk_freq = 16000; + + ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); + zassert_ok(ret, "i2s_configure() returned %d", ret); +} + +/** @brief Check actual PCM rate at frame_clk_freq=32000. + * + * - Configure I2S stream. + */ +ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_32000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + int ret; + + i2s_cfg.frame_clk_freq = 32000; + + ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); + zassert_ok(ret, "i2s_configure() returned %d", ret); +} + +/** @brief Check actual PCM rate at frame_clk_freq=44100. + * + * - Configure I2S stream. + */ +ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_44100) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + int ret; + + i2s_cfg.frame_clk_freq = 44100; + + ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); + zassert_ok(ret, "i2s_configure() returned %d", ret); +} + +/** @brief Check actual PCM rate at frame_clk_freq=48000. + * + * - Configure I2S stream. + */ +ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_48000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + int ret; + + i2s_cfg.frame_clk_freq = 48000; + + ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); + zassert_ok(ret, "i2s_configure() returned %d", ret); +} + +/** @brief Check actual PCM rate at frame_clk_freq=88200. + * + * - Configure I2S stream. + */ +ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_88200) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + int ret; + + i2s_cfg.frame_clk_freq = 88200; + + ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); + zassert_ok(ret, "i2s_configure() returned %d", ret); +} + +/** @brief Check actual PCM rate at frame_clk_freq=96000. + * + * - Configure I2S stream. + */ +ZTEST(drivers_i2s_clk_div, test_i2s_frame_clk_freq_96000) +{ + struct i2s_config i2s_cfg = default_i2s_cfg; + int ret; + + i2s_cfg.frame_clk_freq = 96000; + + ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg); + zassert_ok(ret, "i2s_configure() returned %d", ret); +} + +static void *suite_setup(void) +{ + /* Check I2S Device. */ + dev_i2s = DEVICE_DT_GET_OR_NULL(I2S_DEV_NODE); + zassert_not_null(dev_i2s, "I2S device not found"); + zassert(device_is_ready(dev_i2s), "I2S device not ready"); + + return 0; +} + +ZTEST_SUITE(drivers_i2s_clk_div, NULL, suite_setup, NULL, NULL, NULL); diff --git a/tests/boards/nrf/i2s/i2s_divider/testcase.yaml b/tests/boards/nrf/i2s/i2s_divider/testcase.yaml new file mode 100644 index 000000000000..55d6912d7b54 --- /dev/null +++ b/tests/boards/nrf/i2s/i2s_divider/testcase.yaml @@ -0,0 +1,32 @@ +tests: + boards.nrf.i2s.i2s_divider: + tags: + - drivers + - i2s + harness: console + harness_config: + type: multi_line + ordered: true + regex: + - "test_i2s_frame_clk_freq_08000" + - "I2S MCK frequency: 256000, actual PCM rate: 8000" + - "test_i2s_frame_clk_freq_16000" + - "I2S MCK frequency: 507936, actual PCM rate: 15873" + - "test_i2s_frame_clk_freq_32000" + - "I2S MCK frequency: 1032258, actual PCM rate: 32258" + - "test_i2s_frame_clk_freq_44100" + - "I2S MCK frequency: 1391304, actual PCM rate: 43478" + - "test_i2s_frame_clk_freq_48000" + - "I2S MCK frequency: 1523809, actual PCM rate: 47619" + - "test_i2s_frame_clk_freq_88200" + - "I2S MCK frequency: 2909090, actual PCM rate: 90909" + - "test_i2s_frame_clk_freq_96000" + - "I2S MCK frequency: 3200000, actual PCM rate: 100000" + - "PROJECT EXECUTION SUCCESSFUL" + platform_allow: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + integration_platforms: + - nrf52840dk/nrf52840 + - nrf54l15dk/nrf54l15/cpuapp From 9745182450df39e31345c7c16c208e14082793dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0834/3334] Revert "[nrf fromtree] tests: drivers: uart: Extend UART120 testing for nrf54h20 cpuflpr" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd66b34752b0e6015d1ecfdc2ebdd718707bb7eb. Signed-off-by: Tomasz Moń --- .../nrf54h20dk_nrf54h20_cpuflpr.overlay | 71 ------------------- .../uart/uart_elementary/testcase.yaml | 1 - 2 files changed, 72 deletions(-) delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuflpr.overlay diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuflpr.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuflpr.overlay deleted file mode 100644 index ccb2f3342549..000000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuflpr.overlay +++ /dev/null @@ -1,71 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/ { - chosen { - zephyr,console = &uart131; - }; -}; - -&pinctrl { - uart120_default_alt: uart120_default_alt { - group1 { - psels = , - ; - }; - }; - - uart120_sleep_alt: uart120_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - uart131_default_alt: uart131_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - uart131_sleep_alt: uart131_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -&cpuapp_dma_region { - status = "okay"; -}; - -&dma_fast_region { - status = "okay"; -}; - -&uart131 { - status = "okay"; - memory-regions = <&cpuapp_dma_region>; - pinctrl-0 = <&uart131_default_alt>; - pinctrl-1 = <&uart131_sleep_alt>; - pinctrl-names = "default", "sleep"; - current-speed = <115200>; - hw-flow-control; -}; - -dut: &uart120 { - status = "okay"; - memory-regions = <&dma_fast_region>; - pinctrl-0 = <&uart120_default_alt>; - pinctrl-1 = <&uart120_sleep_alt>; - pinctrl-names = "default", "sleep"; - current-speed = <115200>; - /delete-property/ hw-flow-control; -}; diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index e11a220bae39..b680e0f96428 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -11,7 +11,6 @@ tests: filter: CONFIG_SERIAL_SUPPORT_INTERRUPT platform_allow: - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuflpr - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp From a4db7b9cf1cdacb6d091a77fa8b6c4efc8b7b8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0835/3334] Revert "[nrf fromtree] github: hello_world_multiplatform: retire macos-13" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4d33fc1463c71537e3e983e0fcd1a6b362bc87a1. Signed-off-by: Tomasz Moń --- .github/workflows/hello_world_multiplatform.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index d71b1166bb61..bdecdbc535ed 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -28,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-2022] + os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-13, macos-14, windows-2022] runs-on: ${{ matrix.os }} steps: - name: Checkout From 4dfa6a35a86ce28e7028ea17f09963fcc898e11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0836/3334] Revert "[nrf fromtree] ci: workflows: hello_world: multiplatform: invoke twister via west" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ba8d0f333a333d4207647e49924eaba7359fc48. Signed-off-by: Tomasz Moń --- .github/workflows/hello_world_multiplatform.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index bdecdbc535ed..f2896d97bab5 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -75,7 +75,7 @@ jobs: elif [ "${{ runner.os }}-${{ runner.arch }}" == "Linux-ARM64" ]; then EXTRA_TWISTER_FLAGS="--exclude-platform native_sim/native" fi - west twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS + ./scripts/twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS - name: Upload artifacts if: failure() From be4c439ab9a297208dbe347a9938fc56a5c0282f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0837/3334] Revert "[nrf fromtree] github: hello_world_multiplatform: run on Ubuntu ARM" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6f67db7818c1df927e6d10def4c7c0fb3af26926. Signed-off-by: Tomasz Moń --- .github/workflows/hello_world_multiplatform.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index f2896d97bab5..0396f37e5816 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -28,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-13, macos-14, windows-2022] + os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, windows-2022] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -72,8 +72,6 @@ jobs: EXTRA_TWISTER_FLAGS="-P native_sim --build-only" elif [ "${{ runner.os }}" = "Windows" ]; then EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out" - elif [ "${{ runner.os }}-${{ runner.arch }}" == "Linux-ARM64" ]; then - EXTRA_TWISTER_FLAGS="--exclude-platform native_sim/native" fi ./scripts/twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS From 03884b32e608ba0c758c8fb452d27cb1c8921016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:23 +0100 Subject: [PATCH 0838/3334] Revert "[nrf fromtree] modules: hal_nordic: move IronSide SE supporting code to hal_nordic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 157c55f4e34eec9b82e311947c78a0278c126a22. Signed-off-by: Tomasz Moń --- MAINTAINERS.yml | 2 +- drivers/clock_control/Kconfig.nrf | 2 +- .../clock_control_nrf_iron_hsfll_local.c | 38 +- drivers/debug/Kconfig.nrf | 2 +- drivers/debug/debug_coresight_nrf.c | 6 +- drivers/debug/debug_nrf_etr.c | 2 +- modules/hal_nordic/CMakeLists.txt | 1 - modules/hal_nordic/Kconfig | 1 - modules/hal_nordic/ironside/se/Kconfig | 66 -- .../se/include/ironside_zephyr/se/dvfs.h | 37 - .../ironside_zephyr/se/uicr_periphconf.h | 34 - .../nordic/nrf_ironside/update/prj.conf | 3 + .../nordic/nrf_ironside/update/src/main.c | 18 +- soc/nordic/CMakeLists.txt | 1 + soc/nordic/common/CMakeLists.txt | 2 + .../nordic/common/uicr}/CMakeLists.txt | 22 +- soc/nordic/common/uicr/Kconfig | 18 + soc/nordic/common/uicr/Kconfig.sysbuild | 6 +- .../common/uicr}/gen_periphconf_entries.py | 3 +- soc/nordic/common/uicr/gen_uicr.py | 859 ++++++++++++++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 6 +- .../common/uicr}/periphconf/__init__.py | 0 .../nordic/common/uicr}/periphconf/builder.py | 41 +- soc/nordic/common/uicr/uicr.h | 308 +++++++ .../se => soc/nordic/common/uicr}/uicr.ld | 4 +- soc/nordic/ironside/CMakeLists.txt | 13 + soc/nordic/ironside/Kconfig | 89 ++ soc/nordic/ironside/boot_report.c | 23 + soc/nordic/ironside/bootmode.c | 51 ++ .../se => soc/nordic/ironside}/call.c | 27 +- soc/nordic/ironside/counter.c | 81 ++ soc/nordic/ironside/cpuconf.c | 59 ++ .../se => soc/nordic/ironside}/dvfs.c | 83 +- .../include/nrf_ironside/boot_report.h | 229 +++++ .../ironside/include/nrf_ironside/bootmode.h | 73 ++ .../ironside/include/nrf_ironside/call.h | 82 ++ .../ironside/include/nrf_ironside/counter.h | 143 +++ .../ironside/include/nrf_ironside/cpuconf.h | 74 ++ .../ironside/include/nrf_ironside/dvfs.h | 103 +++ .../ironside/include/nrf_ironside/tdd.h | 39 + .../ironside/include/nrf_ironside/update.h | 90 ++ soc/nordic/ironside/tdd.c | 28 + soc/nordic/ironside/update.c | 33 + soc/nordic/nrf54h/Kconfig | 3 +- .../nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 3 - .../nrf54h/Kconfig.defconfig.nrf54h20_cpurad | 3 - soc/nordic/nrf54h/soc.c | 6 +- soc/nordic/nrf92/Kconfig | 1 - .../nrf92/Kconfig.defconfig.nrf9280_cpuapp | 3 - .../nrf92/Kconfig.defconfig.nrf9280_cpurad | 3 - 50 files changed, 2536 insertions(+), 288 deletions(-) delete mode 100644 modules/hal_nordic/ironside/se/Kconfig delete mode 100644 modules/hal_nordic/ironside/se/include/ironside_zephyr/se/dvfs.h delete mode 100644 modules/hal_nordic/ironside/se/include/ironside_zephyr/se/uicr_periphconf.h rename {modules/hal_nordic/ironside/se => soc/nordic/common/uicr}/CMakeLists.txt (60%) rename {modules/hal_nordic/ironside/se/scripts => soc/nordic/common/uicr}/gen_periphconf_entries.py (99%) create mode 100644 soc/nordic/common/uicr/gen_uicr.py rename {modules/hal_nordic/ironside/se/scripts => soc/nordic/common/uicr}/periphconf/__init__.py (100%) rename {modules/hal_nordic/ironside/se/scripts => soc/nordic/common/uicr}/periphconf/builder.py (97%) create mode 100644 soc/nordic/common/uicr/uicr.h rename {modules/hal_nordic/ironside/se => soc/nordic/common/uicr}/uicr.ld (61%) create mode 100644 soc/nordic/ironside/CMakeLists.txt create mode 100644 soc/nordic/ironside/Kconfig create mode 100644 soc/nordic/ironside/boot_report.c create mode 100644 soc/nordic/ironside/bootmode.c rename {modules/hal_nordic/ironside/se => soc/nordic/ironside}/call.c (81%) create mode 100644 soc/nordic/ironside/counter.c create mode 100644 soc/nordic/ironside/cpuconf.c rename {modules/hal_nordic/ironside/se => soc/nordic/ironside}/dvfs.c (60%) create mode 100644 soc/nordic/ironside/include/nrf_ironside/boot_report.h create mode 100644 soc/nordic/ironside/include/nrf_ironside/bootmode.h create mode 100644 soc/nordic/ironside/include/nrf_ironside/call.h create mode 100644 soc/nordic/ironside/include/nrf_ironside/counter.h create mode 100644 soc/nordic/ironside/include/nrf_ironside/cpuconf.h create mode 100644 soc/nordic/ironside/include/nrf_ironside/dvfs.h create mode 100644 soc/nordic/ironside/include/nrf_ironside/tdd.h create mode 100644 soc/nordic/ironside/include/nrf_ironside/update.h create mode 100644 soc/nordic/ironside/tdd.c create mode 100644 soc/nordic/ironside/update.c diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 2018a6ed356b..26a43ca7f8c2 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -6050,7 +6050,7 @@ nRF IronSide SE Platforms: - karstenkoenig - SebastianBoe files: - - modules/hal_nordic/ironside/ + - soc/nordic/ironside/ - soc/nordic/common/uicr/ labels: - "platform: nRF IronSide SE" diff --git a/drivers/clock_control/Kconfig.nrf b/drivers/clock_control/Kconfig.nrf index f8d51383a35c..a051ebd62b02 100644 --- a/drivers/clock_control/Kconfig.nrf +++ b/drivers/clock_control/Kconfig.nrf @@ -290,7 +290,7 @@ endif # CLOCK_CONTROL_NRF_HSFLL_LOCAL config CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL bool "NRF IronSide HSFLL LOCAL driver support" depends on DT_HAS_NORDIC_NRF_IRON_HSFLL_LOCAL_ENABLED - select IRONSIDE_SE_DVFS + select NRF_IRONSIDE_DVFS_SERVICE select CLOCK_CONTROL_NRF2_COMMON default y diff --git a/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c b/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c index f80521cb03a4..ba4e2a3f6bed 100644 --- a/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c +++ b/drivers/clock_control/clock_control_nrf_iron_hsfll_local.c @@ -14,31 +14,31 @@ LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, "multiple instances not supported"); -#ifdef CONFIG_IRONSIDE_SE_DVFS -#include +#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE +#include #define HSFLL_FREQ_LOW MHZ(64) #define HSFLL_FREQ_MEDLOW MHZ(128) #define HSFLL_FREQ_HIGH MHZ(320) -#define IRONSIDE_SE_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_DVFS_TIMEOUT_MS) +#define IRONSIDE_DVFS_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_DVFS_TIMEOUT_MS) /* Clock options sorted from lowest to highest frequency */ static const struct clock_options { uint32_t frequency; - enum ironside_se_dvfs_oppoint setting; + enum ironside_dvfs_oppoint setting; } clock_options[] = { { .frequency = HSFLL_FREQ_LOW, - .setting = IRONSIDE_SE_DVFS_OPP_LOW, + .setting = IRONSIDE_DVFS_OPP_LOW, }, { .frequency = HSFLL_FREQ_MEDLOW, - .setting = IRONSIDE_SE_DVFS_OPP_MEDLOW, + .setting = IRONSIDE_DVFS_OPP_MEDLOW, }, { .frequency = HSFLL_FREQ_HIGH, - .setting = IRONSIDE_SE_DVFS_OPP_HIGH, + .setting = IRONSIDE_DVFS_OPP_HIGH, }, }; @@ -57,17 +57,17 @@ static void hsfll_update_timeout_handler(struct k_timer *timer) static void hsfll_work_handler(struct k_work *work) { struct hsfll_dev_data *dev_data = CONTAINER_OF(work, struct hsfll_dev_data, clk_cfg.work); - enum ironside_se_dvfs_oppoint required_setting; + enum ironside_dvfs_oppoint required_setting; uint8_t to_activate_idx; int rc; to_activate_idx = clock_config_update_begin(work); required_setting = clock_options[to_activate_idx].setting; - k_timer_start(&dev_data->timer, IRONSIDE_SE_DVFS_TIMEOUT, K_NO_WAIT); + k_timer_start(&dev_data->timer, IRONSIDE_DVFS_TIMEOUT, K_NO_WAIT); /* Request the DVFS service to change the OPP point. */ - rc = ironside_se_dvfs_change_oppoint(required_setting); + rc = ironside_dvfs_change_oppoint(required_setting); k_timer_stop(&dev_data->timer); clock_config_update_end(&dev_data->clk_cfg, rc); } @@ -123,12 +123,12 @@ static struct onoff_manager *hsfll_find_mgr_by_spec(const struct device *dev, idx = hsfll_resolve_spec_to_idx(spec); return idx < 0 ? NULL : hsfll_get_mgr_by_idx(dev, idx); } -#endif /* CONFIG_IRONSIDE_SE_DVFS */ +#endif /* CONFIG_NRF_IRONSIDE_DVFS_SERVICE */ static int api_request_hsfll(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { -#ifdef CONFIG_IRONSIDE_SE_DVFS +#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); if (mgr) { @@ -143,7 +143,7 @@ static int api_request_hsfll(const struct device *dev, const struct nrf_clock_sp static int api_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec) { -#ifdef CONFIG_IRONSIDE_SE_DVFS +#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); if (mgr) { @@ -159,7 +159,7 @@ static int api_release_hsfll(const struct device *dev, const struct nrf_clock_sp static int api_cancel_or_release_hsfll(const struct device *dev, const struct nrf_clock_spec *spec, struct onoff_client *cli) { -#ifdef CONFIG_IRONSIDE_SE_DVFS +#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE struct onoff_manager *mgr = hsfll_find_mgr_by_spec(dev, spec); if (mgr) { @@ -175,7 +175,7 @@ static int api_cancel_or_release_hsfll(const struct device *dev, const struct nr static int api_resolve_hsfll(const struct device *dev, const struct nrf_clock_spec *req_spec, struct nrf_clock_spec *res_spec) { -#ifdef CONFIG_IRONSIDE_SE_DVFS +#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE int idx; idx = hsfll_resolve_spec_to_idx(req_spec); @@ -192,7 +192,7 @@ static int api_resolve_hsfll(const struct device *dev, const struct nrf_clock_sp static int hsfll_init(const struct device *dev) { -#ifdef CONFIG_IRONSIDE_SE_DVFS +#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE struct hsfll_dev_data *dev_data = dev->data; int rc; @@ -220,14 +220,14 @@ static DEVICE_API(nrf_clock_control, hsfll_drv_api) = { .resolve = api_resolve_hsfll, }; -#ifdef CONFIG_IRONSIDE_SE_DVFS +#ifdef CONFIG_NRF_IRONSIDE_DVFS_SERVICE static struct hsfll_dev_data hsfll_data; #endif #ifdef CONFIG_CLOCK_CONTROL_NRF_IRON_HSFLL_LOCAL_REQ_LOW_FREQ static int dvfs_low_init(void) { - static const k_timeout_t timeout = IRONSIDE_SE_DVFS_TIMEOUT; + static const k_timeout_t timeout = IRONSIDE_DVFS_TIMEOUT; static const struct device *hsfll_dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(DT_NODELABEL(cpu))); static const struct nrf_clock_spec clk_spec = {.frequency = HSFLL_FREQ_LOW}; @@ -238,7 +238,7 @@ SYS_INIT(dvfs_low_init, APPLICATION, 0); #endif DEVICE_DT_INST_DEFINE(0, hsfll_init, NULL, - COND_CODE_1(CONFIG_IRONSIDE_SE_DVFS, + COND_CODE_1(CONFIG_NRF_IRONSIDE_DVFS_SERVICE, (&hsfll_data), (NULL)), NULL, PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &hsfll_drv_api); diff --git a/drivers/debug/Kconfig.nrf b/drivers/debug/Kconfig.nrf index 7ea5f6bed5f8..030e9885a06d 100644 --- a/drivers/debug/Kconfig.nrf +++ b/drivers/debug/Kconfig.nrf @@ -117,7 +117,7 @@ menuconfig DEBUG_CORESIGHT_NRF default y depends on DT_HAS_NORDIC_CORESIGHT_NRF_ENABLED select PINCTRL - select IRONSIDE_SE_CALL + select NRF_IRONSIDE_TDD_SERVICE help Support CoreSight peripherals in Test and Debug Domain for ARM CoreSight System Trace Macrocell (STM) trace support. diff --git a/drivers/debug/debug_coresight_nrf.c b/drivers/debug/debug_coresight_nrf.c index 7aeb14ce6eb5..7bc9bab68ee0 100644 --- a/drivers/debug/debug_coresight_nrf.c +++ b/drivers/debug/debug_coresight_nrf.c @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #undef ETR_MODE_MODE_CIRCULARBUF @@ -262,7 +262,7 @@ static int coresight_nrf_init(const struct device *dev) return 0; } -#define DEBUG_CORESIGHT_NRF_INIT_PRIORITY UTIL_INC(CONFIG_IRONSIDE_SE_CALL_INIT_PRIORITY) +#define DEBUG_CORESIGHT_NRF_INIT_PRIORITY UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY) #define CORESIGHT_NRF_INST(inst) \ COND_CODE_1(DT_INST_PINCTRL_HAS_IDX(inst, 0), \ diff --git a/drivers/debug/debug_nrf_etr.c b/drivers/debug/debug_nrf_etr.c index 200d6edbc1a7..d536cd4a9f40 100644 --- a/drivers/debug/debug_nrf_etr.c +++ b/drivers/debug/debug_nrf_etr.c @@ -792,7 +792,7 @@ int etr_process_init(void) return 0; } -#define NRF_ETR_INIT_PRIORITY UTIL_INC(UTIL_INC(CONFIG_IRONSIDE_SE_CALL_INIT_PRIORITY)) +#define NRF_ETR_INIT_PRIORITY UTIL_INC(UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY)) SYS_INIT(etr_process_init, POST_KERNEL, NRF_ETR_INIT_PRIORITY); diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index 10382bd08201..e5b1ab60dfca 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -5,7 +5,6 @@ if (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION) add_subdirectory(nrf_802154) endif (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION) -add_subdirectory_ifdef(CONFIG_HAS_IRONSIDE_SE ironside/se) add_subdirectory_ifdef(CONFIG_HAS_NRFX nrfx) add_subdirectory_ifdef(CONFIG_HAS_NRFS nrfs) diff --git a/modules/hal_nordic/Kconfig b/modules/hal_nordic/Kconfig index 935c4fb4ff38..7be30750627d 100644 --- a/modules/hal_nordic/Kconfig +++ b/modules/hal_nordic/Kconfig @@ -258,7 +258,6 @@ endif # NRF_802154_RADIO_DRIVER || NRF_802154_SERIALIZATION endmenu # HAS_NORDIC_DRIVERS -rsource "ironside/se/Kconfig" rsource "nrfs/Kconfig" rsource "nrfx/Kconfig" rsource "Kconfig.nrf_regtool" diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig deleted file mode 100644 index eae311bef6d0..000000000000 --- a/modules/hal_nordic/ironside/se/Kconfig +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config HAS_IRONSIDE_SE - bool - -menu "IronSide SE" - depends on HAS_IRONSIDE_SE - -config IRONSIDE_SE_CALL - bool "IronSide calls" - default y - depends on DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED - depends on MULTITHREADING - select EVENTS - select MBOX - help - Support for IronSide call APIs. - -if IRONSIDE_SE_CALL - -config IRONSIDE_SE_CALL_INIT_PRIORITY - int "IronSide calls' driver initialization priority" - default 41 - help - Initialization priority of the IronSide call protocol driver. - It must be below MBOX_INIT_PRIORITY, but higher than the priority of any feature - that depends on IRONSIDE_SE_CALL. - -endif # IRONSIDE_SE_CALL - -config IRONSIDE_SE_DVFS - bool "DVFS support" - depends on SOC_NRF54H20_CPUAPP - depends on IRONSIDE_SE_CALL - help - Support for changing the DVFS operating point. - -if IRONSIDE_SE_DVFS - -config IRONSIDE_SE_DVFS_ABB_STATUSANA_CHECK_MAX_ATTEMPTS - int "ABB analog status check maximum attempts" - range 0 255 - default 50 - help - Maximum attempts with 10us intervals before busy status will be reported. - -endif # IRONSIDE_SE_DVFS - -menuconfig NRF_PERIPHCONF_SECTION - bool "Global peripheral initialization section" - depends on LINKER_DEVNULL_SUPPORT - imply LINKER_DEVNULL_MEMORY - help - Include static global domain peripheral initialization values from the - build in a dedicated section in the devnull region. - -config NRF_PERIPHCONF_GENERATE_ENTRIES - bool "Generate PERIPHCONF entries source file" - default y - depends on NRF_PERIPHCONF_SECTION - help - Generate a C file containing PERIPHCONF entries based on the - device configuration in the devicetree. - -endmenu # IronSide SE diff --git a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/dvfs.h b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/dvfs.h deleted file mode 100644 index d4048704537c..000000000000 --- a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/dvfs.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_DVFS_H_ -#define ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_DVFS_H_ - -#include - -/** The DVFS oppoint change operation is not allowed in the ISR context. */ -#define IRONSIDE_SE_DVFS_ERROR_ISR_NOT_ALLOWED (7) - -/** - * @brief Change the current DVFS oppoint. - * - * This function will request a change of the current DVFS oppoint to the - * specified value. It will block until the change is applied. - * - * @param dvfs_oppoint The new DVFS oppoint to set. - * - * @retval 0 on success. - * @retval -IRONSIDE_SE_DVFS_ERROR_WRONG_OPPOINT if the requested DVFS oppoint is not allowed. - * @retval -IRONSIDE_SE_DVFS_ERROR_BUSY if waiting for mutex lock timed out, or hardware is busy. - * @retval -IRONSIDE_SE_DVFS_ERROR_OPPOINT_DATA if there is configuration error in the DVFS service. - * @retval -IRONSIDE_SE_DVFS_ERROR_PERMISSION if the caller does not have permission to change the - * DVFS oppoint. - * @retval -IRONSIDE_SE_DVFS_ERROR_NO_CHANGE_NEEDED if the requested DVFS oppoint is already set. - * @retval -IRONSIDE_SE_DVFS_ERROR_TIMEOUT if the operation timed out, possibly due to a hardware - * issue. - * @retval -IRONSIDE_SE_DVFS_ERROR_ISR_NOT_ALLOWED if the DVFS oppoint change operation is not - * allowed in the ISR context. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_se_dvfs_change_oppoint(enum ironside_se_dvfs_oppoint dvfs_oppoint); - -#endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_DVFS_H_ */ diff --git a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/uicr_periphconf.h b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/uicr_periphconf.h deleted file mode 100644 index 919ccb23a79b..000000000000 --- a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/uicr_periphconf.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_UICR_PERIPHCONF_H_ -#define ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_UICR_PERIPHCONF_H_ - -#include - -#include -#include -#include - -/** Add an entry to the PERIPHCONF table section. - * - * This is a Zephyr integration with the IronSide UICR PERIPHCONF construction - * macros that uses an iterable section to store the entries. - * - * The macro expects a struct periphconf_entry initializer as input. - * The macros defined in ironside/se/periphconf.h can be used to construct the initializer. - * For example: - * - * UICR_PERIPHCONF_ENTRY(PERIPHCONF_SPU_FEATURE_GRTC_CC(...)); - * - */ -#define UICR_PERIPHCONF_ENTRY(_entry) \ - static STRUCT_SECTION_ITERABLE(periphconf_entry, \ - _UICR_PERIPHCONF_ENTRY_NAME(__COUNTER__)) = _entry - -#define _UICR_PERIPHCONF_ENTRY_NAME(_id) __UICR_PERIPHCONF_ENTRY_NAME(_id) -#define __UICR_PERIPHCONF_ENTRY_NAME(_id) _uicr_periphconf_entry_##_id - -#endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_UICR_PERIPHCONF_H_ */ diff --git a/samples/boards/nordic/nrf_ironside/update/prj.conf b/samples/boards/nordic/nrf_ironside/update/prj.conf index 1e935e973c76..1d6a2ac823df 100644 --- a/samples/boards/nordic/nrf_ironside/update/prj.conf +++ b/samples/boards/nordic/nrf_ironside/update/prj.conf @@ -1 +1,4 @@ CONFIG_LOG=y + +CONFIG_NRF_IRONSIDE_UPDATE_SERVICE=y +CONFIG_NRF_IRONSIDE_BOOT_REPORT=y diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c index 3dbd2de1a85d..ee8823217de2 100644 --- a/samples/boards/nordic/nrf_ironside/update/src/main.c +++ b/samples/boards/nordic/nrf_ironside/update/src/main.c @@ -4,21 +4,23 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include +#include +#include #include LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); -BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS >= IRONSIDE_SE_UPDATE_MIN_ADDRESS); -BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS <= IRONSIDE_SE_UPDATE_MAX_ADDRESS); +BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS >= IRONSIDE_UPDATE_MIN_ADDRESS); +BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS <= IRONSIDE_UPDATE_MAX_ADDRESS); int main(void) { int err; - const struct ironside_se_update_blob *update = (void *)CONFIG_UPDATE_BLOB_ADDRESS; - const struct ironside_se_boot_report *report = IRONSIDE_SE_BOOT_REPORT; + const struct ironside_update_blob *update = (void *)CONFIG_UPDATE_BLOB_ADDRESS; + const struct ironside_boot_report *report; + err = ironside_boot_report_get(&report); + LOG_INF("ironside_boot_report_get err: %d", err); /* Extract version components from packed 32-bit integer (8-bit MAJOR.MINOR.PATCH.SEQNUM) */ uint8_t se_major = (report->ironside_se_version_int >> 24) & 0xFF; uint8_t se_minor = (report->ironside_se_version_int >> 16) & 0xFF; @@ -35,9 +37,9 @@ int main(void) LOG_INF("recovery version: %d.%d.%d-%s+%d", recovery_major, recovery_minor, recovery_patch, report->ironside_se_recovery_extraversion, recovery_seqnum); LOG_INF("update status: 0x%x", report->ironside_update_status); - LOG_HEXDUMP_INF((void *)report->random.data, sizeof(report->random.data), "random data"); + LOG_HEXDUMP_INF((void *)report->random_data, sizeof(report->random_data), "random data"); - err = ironside_se_update(update); + err = ironside_update(update); LOG_INF("IronSide update retval: 0x%x", err); if (err == 0) { diff --git a/soc/nordic/CMakeLists.txt b/soc/nordic/CMakeLists.txt index 11f6bb66d66f..f32466d38ee5 100644 --- a/soc/nordic/CMakeLists.txt +++ b/soc/nordic/CMakeLists.txt @@ -50,3 +50,4 @@ if(CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable") endif() add_subdirectory(common) +add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE ironside) diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index 4462d7dde4e6..1b1c3760c9ae 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -3,6 +3,8 @@ add_subdirectory_ifdef(CONFIG_RISCV_CORE_NORDIC_VPR vpr) +add_subdirectory(uicr) + # Let SystemInit() be called in place of soc_reset_hook() by default. zephyr_linker_symbol(SYMBOL soc_reset_hook EXPR "@SystemInit@") diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/soc/nordic/common/uicr/CMakeLists.txt similarity index 60% rename from modules/hal_nordic/ironside/se/CMakeLists.txt rename to soc/nordic/common/uicr/CMakeLists.txt index 50379a084cb9..d350d8d3f586 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/soc/nordic/common/uicr/CMakeLists.txt @@ -1,26 +1,6 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -# The IronSide source directory can be overridden by setting -# IRONSIDE_SUPPORT_DIR before invoking the build system. -zephyr_get(IRONSIDE_SUPPORT_DIR SYSBUILD GLOBAL) -if(NOT DEFINED IRONSIDE_SUPPORT_DIR) - set(IRONSIDE_SUPPORT_DIR - ${ZEPHYR_CURRENT_MODULE_DIR}/ironside CACHE PATH "IronSide Support Directory" - ) -endif() - -zephyr_include_directories(include) -zephyr_include_directories(${IRONSIDE_SUPPORT_DIR}/se/include) - -zephyr_library() -zephyr_library_property(ALLOW_EMPTY TRUE) -zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL - ${IRONSIDE_SUPPORT_DIR}/se/src/ironside_se_api.c - call.c -) -zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c) - if(CONFIG_NRF_PERIPHCONF_SECTION) zephyr_linker_sources(SECTIONS uicr.ld) endif() @@ -30,7 +10,7 @@ if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) execute_process( COMMAND ${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE} - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/scripts/gen_periphconf_entries.py + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/gen_periphconf_entries.py --soc ${CONFIG_SOC} --in-edt-pickle ${EDT_PICKLE} --out-periphconf-source ${periphconf_entries_c_file} diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index c38a8e9bc67a..c3a69c3dbe0f 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -1,6 +1,24 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +config NRF_PERIPHCONF_SECTION + bool "Populate global peripheral initialization section" + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP + depends on LINKER_DEVNULL_SUPPORT + imply LINKER_DEVNULL_MEMORY + help + Include static global domain peripheral initialization values from the + build in a dedicated section in the devnull region. + +config NRF_PERIPHCONF_GENERATE_ENTRIES + bool "Generate PERIPHCONF entries source file" + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP + depends on NRF_PERIPHCONF_SECTION + depends on NRF_PLATFORM_HALTIUM + help + Generate a C file containing PERIPHCONF entries based on the + device configuration in the devicetree. + config IS_IRONSIDE_SE_SECONDARY_IMAGE bool "Ironside SE secondary image indicator (informative only, do not change)" help diff --git a/soc/nordic/common/uicr/Kconfig.sysbuild b/soc/nordic/common/uicr/Kconfig.sysbuild index 977f910b1617..6a9341f90994 100644 --- a/soc/nordic/common/uicr/Kconfig.sysbuild +++ b/soc/nordic/common/uicr/Kconfig.sysbuild @@ -2,10 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 config NRF_HALTIUM_GENERATE_UICR - bool "Generate UICR artifacts" + bool "Generate UICR file" depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF92X default y help - When enabled, a UICR generator image is included in the build. - This generates binary configuration artifacts based on the Kconfig and device tree - of the UICR generator image. See the UICR generator options for further details. + Generate UICR HEX file. diff --git a/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py similarity index 99% rename from modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py rename to soc/nordic/common/uicr/gen_periphconf_entries.py index b30d36f4c7f6..13df5e468ded 100644 --- a/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -19,9 +19,8 @@ sys.exit("Set the environment variable 'ZEPHYR_BASE' to point to the zephyr root directory") # Add packages that are located in zephyr itself to the python path so we can import them below -# The devicetree package is needed on the path for unpickling devicetree object, even if we aren't -# importing anything from it directly. sys.path.insert(0, str(ZEPHYR_BASE / "scripts/dts/python-devicetree/src")) +sys.path.insert(0, str(ZEPHYR_BASE / "soc/nordic/common/uicr")) from periphconf.builder import ( Ctrlsel, diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py new file mode 100644 index 000000000000..8dbbc7fe5ce9 --- /dev/null +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -0,0 +1,859 @@ +""" +Copyright (c) 2025 Nordic Semiconductor ASA +SPDX-License-Identifier: Apache-2.0 +""" + +from __future__ import annotations + +import argparse +import ctypes as c +import sys +from itertools import groupby, pairwise +from typing import NamedTuple + +from elftools.elf.elffile import ELFFile +from intelhex import IntelHex + +# The UICR format version produced by this script +UICR_FORMAT_VERSION_MAJOR = 2 +UICR_FORMAT_VERSION_MINOR = 0 + +# Name of the ELF section containing PERIPHCONF entries. +# Must match the name used in the linker script. +PERIPHCONF_SECTION = "uicr_periphconf_entry" + +# Common values for representing enabled/disabled in the UICR format. +ENABLED_VALUE = 0xFFFF_FFFF +DISABLED_VALUE = 0xBD23_28A8 +PROTECTED_VALUE = ENABLED_VALUE # UICR_PROTECTED = UICR_ENABLED per uicr_defs.h +UNPROTECTED_VALUE = DISABLED_VALUE # Unprotected uses the default erased value + +KB_4 = 4096 + + +class ScriptError(RuntimeError): ... + + +class PartitionInfo(NamedTuple): + """Information about a partition for secure storage validation.""" + + address: int + size: int + name: str + + +class PeriphconfEntry(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("regptr", c.c_uint32), + ("value", c.c_uint32), + ] + + +PERIPHCONF_ENTRY_SIZE = c.sizeof(PeriphconfEntry) + + +class Version(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("MINOR", c.c_uint16), + ("MAJOR", c.c_uint16), + ] + + +class Approtect(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("APPLICATION", c.c_uint32), + ("RADIOCORE", c.c_uint32), + ("RESERVED", c.c_uint32), + ("CORESIGHT", c.c_uint32), + ] + + +class Protectedmem(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("SIZE4KB", c.c_uint32), + ] + + +class Wdtstart(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("INSTANCE", c.c_uint32), + ("CRV", c.c_uint32), + ] + + +class SecurestorageCrypto(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("APPLICATIONSIZE1KB", c.c_uint32), + ("RADIOCORESIZE1KB", c.c_uint32), + ] + + +class SecurestorageIts(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("APPLICATIONSIZE1KB", c.c_uint32), + ("RADIOCORESIZE1KB", c.c_uint32), + ] + + +class Securestorage(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("ADDRESS", c.c_uint32), + ("CRYPTO", SecurestorageCrypto), + ("ITS", SecurestorageIts), + ] + + +class Periphconf(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("ADDRESS", c.c_uint32), + ("MAXCOUNT", c.c_uint32), + ] + + +class Mpcconf(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("ADDRESS", c.c_uint32), + ("MAXCOUNT", c.c_uint32), + ] + + +class SecondaryTrigger(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("RESETREAS", c.c_uint32), + ("RESERVED", c.c_uint32), + ] + + +class SecondaryProtectedmem(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("SIZE4KB", c.c_uint32), + ] + + +class SecondaryWdtstart(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("INSTANCE", c.c_uint32), + ("CRV", c.c_uint32), + ] + + +class SecondaryPeriphconf(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("ADDRESS", c.c_uint32), + ("MAXCOUNT", c.c_uint32), + ] + + +class SecondaryMpcconf(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("ADDRESS", c.c_uint32), + ("MAXCOUNT", c.c_uint32), + ] + + +class Secondary(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("ENABLE", c.c_uint32), + ("PROCESSOR", c.c_uint32), + ("TRIGGER", SecondaryTrigger), + ("ADDRESS", c.c_uint32), + ("PROTECTEDMEM", SecondaryProtectedmem), + ("WDTSTART", SecondaryWdtstart), + ("PERIPHCONF", SecondaryPeriphconf), + ("MPCCONF", SecondaryMpcconf), + ] + + +class Uicr(c.LittleEndianStructure): + _pack_ = 1 + _fields_ = [ + ("VERSION", Version), + ("RESERVED", c.c_uint32), + ("LOCK", c.c_uint32), + ("RESERVED1", c.c_uint32), + ("APPROTECT", Approtect), + ("ERASEPROTECT", c.c_uint32), + ("PROTECTEDMEM", Protectedmem), + ("WDTSTART", Wdtstart), + ("RESERVED2", c.c_uint32), + ("SECURESTORAGE", Securestorage), + ("RESERVED3", c.c_uint32 * 5), + ("PERIPHCONF", Periphconf), + ("MPCCONF", Mpcconf), + ("SECONDARY", Secondary), + ("PADDING", c.c_uint32 * 15), + ] + + +def validate_secure_storage_partitions(args: argparse.Namespace) -> None: + """ + Validate that secure storage partitions are laid out correctly. + + Args: + args: Parsed command line arguments containing partition information + + Raises: + ScriptError: If validation fails + """ + # Expected order: cpuapp_crypto_partition, cpurad_crypto_partition, + # cpuapp_its_partition, cpurad_its_partition + partitions = [ + PartitionInfo( + args.cpuapp_crypto_address, args.cpuapp_crypto_size, "cpuapp_crypto_partition" + ), + PartitionInfo( + args.cpurad_crypto_address, args.cpurad_crypto_size, "cpurad_crypto_partition" + ), + PartitionInfo(args.cpuapp_its_address, args.cpuapp_its_size, "cpuapp_its_partition"), + PartitionInfo(args.cpurad_its_address, args.cpurad_its_size, "cpurad_its_partition"), + ] + + # Filter out zero-sized partitions (missing partitions) + present_partitions = [p for p in partitions if p.size > 0] + + # Require at least one subpartition to be present + if not present_partitions: + raise ScriptError( + "At least one secure storage subpartition must be defined. " + "Define one or more of: cpuapp_crypto_partition, cpurad_crypto_partition, " + "cpuapp_its_partition, cpurad_its_partition" + ) + + # Check 4KB alignment for secure storage start address + if args.securestorage_address % 4096 != 0: + raise ScriptError( + f"Secure storage address {args.securestorage_address:#x} must be aligned to 4KB " + f"(4096 bytes)" + ) + + # Check 4KB alignment for secure storage size + if args.securestorage_size % 4096 != 0: + raise ScriptError( + f"Secure storage size {args.securestorage_size} bytes must be aligned to 4KB " + f"(4096 bytes)" + ) + + # Check that the first present partition starts at the secure storage address + first_partition = present_partitions[0] + if first_partition.address != args.securestorage_address: + raise ScriptError( + f"First partition {first_partition.name} starts at {first_partition.address:#x}, " + f"but must start at secure storage address {args.securestorage_address:#x}" + ) + + # Check that all present partitions have sizes that are multiples of 1KB + for partition in present_partitions: + if partition.size % 1024 != 0: + raise ScriptError( + f"Partition {partition.name} has size {partition.size} bytes, but must be " + f"a multiple of 1024 bytes (1KB)" + ) + + # Check that partitions are in correct order and don't overlap + for curr_partition, next_partition in pairwise(present_partitions): + # Check order - partitions should be in ascending address order + if curr_partition.address >= next_partition.address: + raise ScriptError( + f"Partition {curr_partition.name} (starts at {curr_partition.address:#x}) " + f"must come before {next_partition.name} (starts at {next_partition.address:#x})" + ) + + # Check for overlap + curr_end = curr_partition.address + curr_partition.size + if curr_end > next_partition.address: + raise ScriptError( + f"Partition {curr_partition.name} (ends at {curr_end:#x}) overlaps with " + f"{next_partition.name} (starts at {next_partition.address:#x})" + ) + + # Check for gaps (should be no gaps between consecutive partitions) + if curr_end < next_partition.address: + gap = next_partition.address - curr_end + raise ScriptError( + f"Gap of {gap} bytes between {curr_partition.name} (ends at {curr_end:#x}) and " + f"{next_partition.name} (starts at {next_partition.address:#x})" + ) + + # Check that combined subpartition sizes equal secure_storage_partition size + total_subpartition_size = sum(p.size for p in present_partitions) + if total_subpartition_size != args.securestorage_size: + raise ScriptError( + f"Combined size of subpartitions ({total_subpartition_size} bytes) does not match " + f"secure_storage_partition size ({args.securestorage_size} bytes). " + f"The definition is not coherent." + ) + + +def main() -> None: + parser = argparse.ArgumentParser( + allow_abbrev=False, + description=( + "Generate artifacts for the UICR and associated configuration blobs from application " + "build outputs. User Information Configuration Registers (UICR), in the context of " + "certain Nordic SoCs, are used to configure system resources, like memory and " + "peripherals, and to protect the device in various ways." + ), + ) + parser.add_argument( + "--in-periphconf-elf", + dest="in_periphconf_elfs", + default=[], + action="append", + type=argparse.FileType("rb"), + help=( + "Path to an ELF file to extract PERIPHCONF data from. Can be provided multiple times. " + "The PERIPHCONF data from each ELF file is combined in a single list which is sorted " + "by ascending address and cleared of duplicate entries." + ), + ) + parser.add_argument( + "--out-merged-hex", + required=True, + type=argparse.FileType("w", encoding="utf-8"), + help="Path to write the merged UICR+PERIPHCONF HEX file to", + ) + parser.add_argument( + "--out-uicr-hex", + required=True, + type=argparse.FileType("w", encoding="utf-8"), + help="Path to write the UICR-only HEX file to", + ) + parser.add_argument( + "--out-periphconf-hex", + type=argparse.FileType("w", encoding="utf-8"), + help="Path to write the PERIPHCONF-only HEX file to", + ) + parser.add_argument( + "--periphconf-address", + default=None, + type=lambda s: int(s, 0), + help="Absolute flash address of the PERIPHCONF partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--periphconf-size", + default=None, + type=lambda s: int(s, 0), + help="Size in bytes of the PERIPHCONF partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--uicr-address", + required=True, + type=lambda s: int(s, 0), + help="Absolute flash address of the UICR region (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--securestorage", + action="store_true", + help="Enable secure storage support in UICR", + ) + parser.add_argument( + "--securestorage-address", + default=None, + type=lambda s: int(s, 0), + help="Absolute flash address of the secure storage partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--securestorage-size", + default=None, + type=lambda s: int(s, 0), + help="Size in bytes of the secure storage partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpuapp-crypto-address", + default=0, + type=lambda s: int(s, 0), + help="Absolute flash address of cpuapp_crypto_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpuapp-crypto-size", + default=0, + type=lambda s: int(s, 0), + help="Size in bytes of cpuapp_crypto_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpurad-crypto-address", + default=0, + type=lambda s: int(s, 0), + help="Absolute flash address of cpurad_crypto_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpurad-crypto-size", + default=0, + type=lambda s: int(s, 0), + help="Size in bytes of cpurad_crypto_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpuapp-its-address", + default=0, + type=lambda s: int(s, 0), + help="Absolute flash address of cpuapp_its_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpuapp-its-size", + default=0, + type=lambda s: int(s, 0), + help="Size in bytes of cpuapp_its_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpurad-its-address", + default=0, + type=lambda s: int(s, 0), + help="Absolute flash address of cpurad_its_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--cpurad-its-size", + default=0, + type=lambda s: int(s, 0), + help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--permit-permanently-transitioning-device-to-deployed", + action="store_true", + help=( + "Safety flag required to enable both UICR.LOCK and UICR.ERASEPROTECT together. " + "Must be explicitly provided to acknowledge permanent device state changes." + ), + ) + parser.add_argument( + "--lock", + action="store_true", + help="Enable UICR.LOCK to prevent modifications without ERASEALL", + ) + parser.add_argument( + "--eraseprotect", + action="store_true", + help="Enable UICR.ERASEPROTECT to block ERASEALL operations", + ) + parser.add_argument( + "--approtect-application-protected", + action="store_true", + help="Protect application domain access port (disable debug access)", + ) + parser.add_argument( + "--approtect-radiocore-protected", + action="store_true", + help="Protect radio core access port (disable debug access)", + ) + parser.add_argument( + "--approtect-coresight-protected", + action="store_true", + help="Protect CoreSight access port (disable debug access)", + ) + parser.add_argument( + "--protectedmem", + action="store_true", + help="Enable protected memory region in UICR", + ) + parser.add_argument( + "--protectedmem-size-bytes", + type=int, + help="Protected memory size in bytes (must be divisible by 4096)", + ) + parser.add_argument( + "--wdtstart", + action="store_true", + help="Enable watchdog timer start in UICR", + ) + parser.add_argument( + "--wdtstart-instance-code", + type=lambda s: int(s, 0), + help="Watchdog timer instance code (0xBD2328A8 for WDT0, 0x1730C77F for WDT1)", + ) + parser.add_argument( + "--wdtstart-crv", + type=int, + help="Initial Counter Reload Value (CRV) for watchdog timer (minimum: 0xF)", + ) + parser.add_argument( + "--secondary-wdtstart", + action="store_true", + help="Enable watchdog timer start in UICR.SECONDARY", + ) + parser.add_argument( + "--secondary-wdtstart-instance-code", + type=lambda s: int(s, 0), + help="Secondary watchdog timer instance code (0xBD2328A8 for WDT0, 0x1730C77F for WDT1)", + ) + parser.add_argument( + "--secondary-wdtstart-crv", + type=int, + help="Secondary initial Counter Reload Value (CRV) for watchdog timer (minimum: 0xF)", + ) + parser.add_argument( + "--secondary", + action="store_true", + help="Enable secondary firmware support in UICR", + ) + parser.add_argument( + "--secondary-address", + default=None, + type=lambda s: int(s, 0), + help="Absolute flash address of the secondary firmware (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--secondary-processor", + default=0xBD2328A8, + type=lambda s: int(s, 0), + help="Processor to boot for the secondary firmware ", + ) + parser.add_argument( + "--secondary-trigger", + action="store_true", + help="Enable UICR.SECONDARY.TRIGGER for automatic secondary firmware boot on reset events", + ) + parser.add_argument( + "--secondary-trigger-resetreas", + default=0, + type=lambda s: int(s, 0), + help=( + "Bitmask of reset reasons that trigger secondary firmware boot " + "(decimal or 0x-prefixed hex)" + ), + ) + parser.add_argument( + "--secondary-protectedmem-size", + default=None, + type=lambda s: int(s, 0), + help="Size in bytes of the secondary protected memory region (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--secondary-periphconf-address", + default=None, + type=lambda s: int(s, 0), + help=( + "Absolute flash address of the secondary PERIPHCONF partition " + "(decimal or 0x-prefixed hex)" + ), + ) + parser.add_argument( + "--secondary-periphconf-size", + default=None, + type=lambda s: int(s, 0), + help="Size in bytes of the secondary PERIPHCONF partition (decimal or 0x-prefixed hex)", + ) + parser.add_argument( + "--in-secondary-periphconf-elf", + dest="in_secondary_periphconf_elfs", + default=[], + action="append", + type=argparse.FileType("rb"), + help=( + "Path to an ELF file to extract secondary PERIPHCONF data from. " + "Can be provided multiple times. The secondary PERIPHCONF data from each ELF file " + "is combined in a single list which is sorted by ascending address and cleared " + "of duplicate entries." + ), + ) + parser.add_argument( + "--out-secondary-periphconf-hex", + type=argparse.FileType("w", encoding="utf-8"), + help="Path to write the secondary PERIPHCONF-only HEX file to", + ) + args = parser.parse_args() + + try: + # Validate argument dependencies + if args.out_periphconf_hex: + if args.periphconf_address is None: + raise ScriptError( + "--periphconf-address is required when --out-periphconf-hex is used" + ) + if args.periphconf_size is None: + raise ScriptError("--periphconf-size is required when --out-periphconf-hex is used") + + # Validate secondary argument dependencies + if args.secondary and args.secondary_address is None: + raise ScriptError("--secondary-address is required when --secondary is used") + + if args.out_secondary_periphconf_hex: + if args.secondary_periphconf_address is None: + raise ScriptError( + "--secondary-periphconf-address is required when " + "--out-secondary-periphconf-hex is used" + ) + if args.secondary_periphconf_size is None: + raise ScriptError( + "--secondary-periphconf-size is required when " + "--out-secondary-periphconf-hex is used" + ) + + # Validate secure storage argument dependencies + if args.securestorage: + if args.securestorage_address is None: + raise ScriptError( + "--securestorage-address is required when --securestorage is used" + ) + if args.securestorage_size is None: + raise ScriptError("--securestorage-size is required when --securestorage is used") + + # Validate partition layout + validate_secure_storage_partitions(args) + + init_values = DISABLED_VALUE.to_bytes(4, "little") * (c.sizeof(Uicr) // 4) + uicr = Uicr.from_buffer_copy(init_values) + + uicr.VERSION.MAJOR = UICR_FORMAT_VERSION_MAJOR + uicr.VERSION.MINOR = UICR_FORMAT_VERSION_MINOR + + # Handle secure storage configuration + if args.securestorage: + uicr.SECURESTORAGE.ENABLE = ENABLED_VALUE + uicr.SECURESTORAGE.ADDRESS = args.securestorage_address + + # Set partition sizes in 1KB units + uicr.SECURESTORAGE.CRYPTO.APPLICATIONSIZE1KB = args.cpuapp_crypto_size // 1024 + uicr.SECURESTORAGE.CRYPTO.RADIOCORESIZE1KB = args.cpurad_crypto_size // 1024 + uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 + uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 + + # Handle LOCK and ERASEPROTECT configuration + # Check if both are enabled together - this requires explicit acknowledgment + if ( + args.lock + and args.eraseprotect + and not args.permit_permanently_transitioning_device_to_deployed + ): + raise ScriptError( + "Enabling both --lock and --eraseprotect requires " + "--permit-permanently-transitioning-device-to-deployed to be specified. " + "This combination permanently locks the device configuration and prevents " + "ERASEALL." + ) + + if args.lock: + uicr.LOCK = ENABLED_VALUE + if args.eraseprotect: + uicr.ERASEPROTECT = ENABLED_VALUE + # Handle APPROTECT configuration + if args.approtect_application_protected: + uicr.APPROTECT.APPLICATION = PROTECTED_VALUE + + if args.approtect_radiocore_protected: + uicr.APPROTECT.RADIOCORE = PROTECTED_VALUE + + if args.approtect_coresight_protected: + uicr.APPROTECT.CORESIGHT = PROTECTED_VALUE + # Handle protected memory configuration + if args.protectedmem: + if args.protectedmem_size_bytes % KB_4 != 0: + raise ScriptError( + f"Protected memory size ({args.protectedmem_size_bytes} bytes) " + f"must be divisible by {KB_4}" + ) + uicr.PROTECTEDMEM.ENABLE = ENABLED_VALUE + uicr.PROTECTEDMEM.SIZE4KB = args.protectedmem_size_bytes // KB_4 + + # Handle WDTSTART configuration + if args.wdtstart: + uicr.WDTSTART.ENABLE = ENABLED_VALUE + uicr.WDTSTART.CRV = args.wdtstart_crv + uicr.WDTSTART.INSTANCE = args.wdtstart_instance_code + + # Process periphconf data first and configure UICR completely before creating hex objects + periphconf_hex = IntelHex() + secondary_periphconf_hex = IntelHex() + + if args.out_periphconf_hex: + periphconf_combined = extract_and_combine_periphconfs(args.in_periphconf_elfs) + + padding_len = args.periphconf_size - len(periphconf_combined) + periphconf_final = periphconf_combined + bytes([0xFF for _ in range(padding_len)]) + + # Add periphconf data to periphconf hex object + periphconf_hex.frombytes(periphconf_final, offset=args.periphconf_address) + + # Configure UICR with periphconf settings + uicr.PERIPHCONF.ENABLE = ENABLED_VALUE + uicr.PERIPHCONF.ADDRESS = args.periphconf_address + + # MAXCOUNT is given in number of 8-byte peripheral + # configuration entries and periphconf_size is given in + # bytes. When setting MAXCOUNT based on the + # periphconf_size we must first assert that + # periphconf_size has not been misconfigured. + if args.periphconf_size % 8 != 0: + raise ScriptError( + f"args.periphconf_size was {args.periphconf_size}, but must be divisible by 8" + ) + + uicr.PERIPHCONF.MAXCOUNT = args.periphconf_size // 8 + + # Handle secondary firmware configuration + if args.secondary: + uicr.SECONDARY.ENABLE = ENABLED_VALUE + uicr.SECONDARY.ADDRESS = args.secondary_address + uicr.SECONDARY.PROCESSOR = args.secondary_processor + + # Handle secondary TRIGGER configuration + if args.secondary_trigger: + uicr.SECONDARY.TRIGGER.ENABLE = ENABLED_VALUE + uicr.SECONDARY.TRIGGER.RESETREAS = args.secondary_trigger_resetreas + + # Handle secondary PROTECTEDMEM configuration + if args.secondary_protectedmem_size: + uicr.SECONDARY.PROTECTEDMEM.ENABLE = ENABLED_VALUE + if args.secondary_protectedmem_size % 4096 != 0: + raise ScriptError( + f"args.secondary_protectedmem_size was {args.secondary_protectedmem_size}, " + f"but must be divisible by 4096" + ) + uicr.SECONDARY.PROTECTEDMEM.SIZE4KB = args.secondary_protectedmem_size // 4096 + # Handle secondary periphconf if provided + if args.out_secondary_periphconf_hex: + secondary_periphconf_combined = extract_and_combine_periphconfs( + args.in_secondary_periphconf_elfs + ) + + padding_len = args.secondary_periphconf_size - len(secondary_periphconf_combined) + secondary_periphconf_final = secondary_periphconf_combined + bytes( + [0xFF for _ in range(padding_len)] + ) + + # Add secondary periphconf data to secondary periphconf hex object + secondary_periphconf_hex.frombytes( + secondary_periphconf_final, offset=args.secondary_periphconf_address + ) + + # Configure UICR with secondary periphconf settings + uicr.SECONDARY.PERIPHCONF.ENABLE = ENABLED_VALUE + uicr.SECONDARY.PERIPHCONF.ADDRESS = args.secondary_periphconf_address + + # MAXCOUNT is given in number of 8-byte peripheral + # configuration entries and secondary_periphconf_size is given in + # bytes. When setting MAXCOUNT based on the + # secondary_periphconf_size we must first assert that + # secondary_periphconf_size has not been misconfigured. + if args.secondary_periphconf_size % 8 != 0: + raise ScriptError( + f"args.secondary_periphconf_size was {args.secondary_periphconf_size}, " + f"but must be divisible by 8" + ) + + uicr.SECONDARY.PERIPHCONF.MAXCOUNT = args.secondary_periphconf_size // 8 + + # Handle secondary WDTSTART configuration + if args.secondary_wdtstart: + uicr.SECONDARY.WDTSTART.ENABLE = ENABLED_VALUE + uicr.SECONDARY.WDTSTART.CRV = args.secondary_wdtstart_crv + uicr.SECONDARY.WDTSTART.INSTANCE = args.secondary_wdtstart_instance_code + + # Create UICR hex object with final UICR data + uicr_hex = IntelHex() + uicr_hex.frombytes(bytes(uicr), offset=args.uicr_address) + + # Create merged hex by combining UICR and periphconf hex objects + merged_hex = IntelHex() + merged_hex.fromdict(uicr_hex.todict()) + + if args.out_periphconf_hex: + periphconf_hex.write_hex_file(args.out_periphconf_hex) + merged_hex.fromdict(periphconf_hex.todict()) + + if args.out_secondary_periphconf_hex: + secondary_periphconf_hex.write_hex_file(args.out_secondary_periphconf_hex) + merged_hex.fromdict(secondary_periphconf_hex.todict()) + + merged_hex.write_hex_file(args.out_merged_hex) + uicr_hex.write_hex_file(args.out_uicr_hex) + + except ScriptError as e: + print(f"Error: {e!s}") + sys.exit(1) + + +def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes: + combined_periphconf = [] + ipcmap_index = 0 + + for in_file in elf_files: + elf = ELFFile(in_file) + conf_section = elf.get_section_by_name(PERIPHCONF_SECTION) + if conf_section is None: + continue + + conf_section_data = conf_section.data() + num_entries = len(conf_section_data) // PERIPHCONF_ENTRY_SIZE + periphconf = (PeriphconfEntry * num_entries).from_buffer_copy(conf_section_data) + ipcmap_index = adjust_ipcmap_entries(periphconf, offset_index=ipcmap_index) + combined_periphconf.extend(periphconf) + + combined_periphconf.sort(key=lambda e: e.regptr) + deduplicated_periphconf = [] + + for regptr, regptr_entries in groupby(combined_periphconf, key=lambda e: e.regptr): + entries = list(regptr_entries) + if len(entries) > 1: + unique_values = {e.value for e in entries} + if len(unique_values) > 1: + raise ScriptError( + f"PERIPHCONF has conflicting values for register 0x{regptr:09_x}: " + + ", ".join([f"0x{val:09_x}" for val in unique_values]) + ) + deduplicated_periphconf.append(entries[0]) + + final_periphconf = (PeriphconfEntry * len(deduplicated_periphconf))() + for i, entry in enumerate(deduplicated_periphconf): + final_periphconf[i] = entry + + return bytes(final_periphconf) + + +# This workaround is currently needed to avoid conflicts in IPCMAP whenever more than +# one image uses IPCMAP, because at the moment each image has no way of knowing which +# IPCMAP channel indices it should use for the configuration it generates locally. +# +# What the workaround does is adjust all IPCMAP entries found in the periphconf by the +# given index offset. +# +# The workaround assumes that IPCMAP entries are allocated sequentially starting from 0 +# in each image, it will probably not work for arbitrary IPCMAP entries. +def adjust_ipcmap_entries(periphconf: c.Array[PeriphconfEntry], offset_index: int) -> int: + max_ipcmap_index = offset_index + + for entry in sorted(periphconf, key=lambda e: e.regptr): + if IPCMAP_CHANNEL_START_ADDR <= entry.regptr < IPCMAP_CHANNEL_END_ADDR: + entry.regptr += offset_index * IPCMAP_CHANNEL_SIZE + entry_ipcmap_index = (entry.regptr - IPCMAP_CHANNEL_START_ADDR) // IPCMAP_CHANNEL_SIZE + max_ipcmap_index = max(max_ipcmap_index, entry_ipcmap_index) + + return max_ipcmap_index + 1 + + +# Size of each IPCMAP.CHANNEL[i] +IPCMAP_CHANNEL_SIZE = 8 +# Number of entries in IPCMAP.CHANNEL +IPCMAP_CHANNEL_COUNT = 16 +# Address of IPCMAP.CHANNEL[0] +IPCMAP_CHANNEL_START_ADDR = 0x5F92_3000 + 256 * 4 +# Address of IPCMAP.CHANNEL[channel count] + 1 +IPCMAP_CHANNEL_END_ADDR = IPCMAP_CHANNEL_START_ADDR + IPCMAP_CHANNEL_SIZE * IPCMAP_CHANNEL_COUNT + + +if __name__ == "__main__": + main() diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 9c5111717c6c..290cf16a0a6f 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -264,13 +264,11 @@ endif() # Generate hex files (merged, uicr-only, periphconf-only, and secondary-periphconf-only) add_custom_command( OUTPUT ${merged_hex_file} ${uicr_hex_file} ${periphconf_hex_file} ${secondary_periphconf_hex_file} - COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/ironside/se/tool/ironside/__main__.py - gen-uicr + COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${ZEPHYR_BASE}/scripts/dts/python-devicetree/src + ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/soc/nordic/common/uicr/gen_uicr.py --uicr-address ${UICR_ADDRESS} --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} - --periphconf-section-name "periphconf_entry" - --periphconf-ipcmap-reallocate ${lock_args} ${eraseprotect_args} ${approtect_args} diff --git a/modules/hal_nordic/ironside/se/scripts/periphconf/__init__.py b/soc/nordic/common/uicr/periphconf/__init__.py similarity index 100% rename from modules/hal_nordic/ironside/se/scripts/periphconf/__init__.py rename to soc/nordic/common/uicr/periphconf/__init__.py diff --git a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py similarity index 97% rename from modules/hal_nordic/ironside/se/scripts/periphconf/builder.py rename to soc/nordic/common/uicr/periphconf/builder.py index f749a8ea277d..34ccc6f7b497 100644 --- a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -130,7 +130,7 @@ def build_generated_source(self, header_line: str | None = None) -> str: source_lines.extend( [ "#include ", - "#include ", + "#include ", "", ] ) @@ -270,7 +270,7 @@ def _add_global_peripheral_spu_permissions( self._macros.append( MacroCall( - "PERIPHCONF_SPU_PERIPH_PERM", + "UICR_SPU_PERIPH_PERM_SET", [ Address(spu_address), periph_slave_index, @@ -318,7 +318,7 @@ def _add_global_peripheral_irq_mapping(self, node: Node) -> None: self._macros.append( MacroCall( - "PERIPHCONF_IRQMAP_IRQ_SINK", + "UICR_IRQMAP_IRQ_SINK_SET", [ macro_irqn, irq_processor.c_enum, @@ -339,7 +339,7 @@ def _add_nrf_gpiote_spu_permissions(self, node: Node) -> None: for num, secure in dt_split_channels_get(node): self._macros.append( MacroCall( - "PERIPHCONF_SPU_FEATURE_GPIOTE_CH", + "UICR_SPU_FEATURE_GPIOTE_CH_SET", [ Address(spu_address), 0, @@ -370,7 +370,7 @@ def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: for num, secure in channels: self._macros.append( MacroCall( - "PERIPHCONF_SPU_FEATURE_DPPIC_CH", + "UICR_SPU_FEATURE_DPPIC_CH_SET", [ Address(spu_address), num, @@ -384,7 +384,7 @@ def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: for num, secure in channel_groups: self._macros.append( MacroCall( - "PERIPHCONF_SPU_FEATURE_DPPIC_CHG", + "UICR_SPU_FEATURE_DPPIC_CHG_SET", [ Address(spu_address), num, @@ -435,7 +435,7 @@ def _link_dppi_channels( self._macros.append( MacroCall( - "PERIPHCONF_PPIB_SUBSCRIBE_SEND", + "UICR_PPIB_SUBSCRIBE_SEND_ENABLE", [ Address(sub_ppib_addr), sub_ppib_ch, @@ -447,7 +447,7 @@ def _link_dppi_channels( ) self._macros.append( MacroCall( - "PERIPHCONF_PPIB_PUBLISH_RECEIVE", + "UICR_PPIB_PUBLISH_RECEIVE_ENABLE", [ Address(pub_ppib_addr), pub_ppib_ch, @@ -470,7 +470,7 @@ def _add_nrf_ipct_global_spu_permissions(self, node: Node) -> None: for num, secure in dt_split_channels_get(node): self._macros.append( MacroCall( - "PERIPHCONF_SPU_FEATURE_IPCT_CH", + "UICR_SPU_FEATURE_IPCT_CH_SET", [ Address(spu_address), num, @@ -536,18 +536,8 @@ def _link_ipct_channel( self._macros.append( MacroCall( - "PERIPHCONF_IPCMAP_CHANNEL_SOURCE", - [self._ipcmap_idx, source_domain.c_enum, source_ch], - comment=( - f"{source_domain.name} IPCT ch. {source_ch} => " - f"{sink_domain.name} IPCT ch. {sink_ch}" - ), - ) - ) - self._macros.append( - MacroCall( - "PERIPHCONF_IPCMAP_CHANNEL_SINK", - [self._ipcmap_idx, sink_domain.c_enum, sink_ch], + "UICR_IPCMAP_CHANNEL_CFG", + [self._ipcmap_idx, *link_args], comment=( f"{source_domain.name} IPCT ch. {source_ch} => " f"{sink_domain.name} IPCT ch. {sink_ch}" @@ -567,7 +557,7 @@ def _add_nrf_grtc_spu_permissions(self, node: Node) -> None: for num, secure in dt_split_channels_get(node): self._macros.append( MacroCall( - "PERIPHCONF_SPU_FEATURE_GRTC_CC", + "UICR_SPU_FEATURE_GRTC_CC_SET", [ Address(spu_address), num, @@ -689,7 +679,7 @@ def _configure_gpio_pin( self._macros.append( MacroCall( - "PERIPHCONF_SPU_FEATURE_GPIO_PIN", + "UICR_SPU_FEATURE_GPIO_PIN_SET", [ Address(spu_address), gpio_port, @@ -705,7 +695,7 @@ def _configure_gpio_pin( ctrlsel_int = int(ctrlsel) self._macros.append( MacroCall( - "PERIPHCONF_GPIO_PIN_CNF_CTRLSEL", + "UICR_GPIO_PIN_CNF_CTRLSEL_SET", [ Address(gpio_addr), num, @@ -747,8 +737,7 @@ def c_render(self, nodelabel_lookup: dict[int, str]) -> str: str_args.append(str(arg)) comment = f"/* {self.comment} */\n" if self.comment else "" - entry_macro = f"UICR_PERIPHCONF_ENTRY({self.name}({', '.join(str_args)}))" - return f"{comment}{entry_macro};" + return f"{comment}{self.name}({', '.join(str_args)});" def c_hex_addr(address: int) -> str: diff --git a/soc/nordic/common/uicr/uicr.h b/soc/nordic/common/uicr/uicr.h new file mode 100644 index 000000000000..7ceb12429e22 --- /dev/null +++ b/soc/nordic/common/uicr/uicr.h @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef SOC_NORDIC_COMMON_UICR_UICR_H_ +#define SOC_NORDIC_COMMON_UICR_UICR_H_ + +#include +#include +#include +#include +#include + +/** Entry in the PERIPHCONF table. */ +struct uicr_periphconf_entry { + /** Register pointer. */ + uint32_t regptr; + /** Register value. */ + uint32_t value; +} __packed; + +/** @brief Add an entry to the PERIPHCONF table section. + * + * This should typically not be used directly. + * Prefer to use one of the higher level macros. + */ +#define UICR_PERIPHCONF_ADD(_regptr, _value) \ + static STRUCT_SECTION_ITERABLE(uicr_periphconf_entry, \ + _UICR_PERIPHCONF_ENTRY_NAME(__COUNTER__)) = { \ + .regptr = (_regptr), \ + .value = (_value), \ + } + +#define _UICR_PERIPHCONF_ENTRY_NAME(_id) __UICR_PERIPHCONF_ENTRY_NAME(_id) +#define __UICR_PERIPHCONF_ENTRY_NAME(_id) _uicr_periphconf_entry_##_id + +/** @brief Add a PERIPHCONF entry for a SPU PERIPH[n].PERM register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Peripheral slave index on the bus (PERIPH[n] register index). + * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. + * @param _dmasec If true, set DMASEC to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_PERIPH_PERM_SET(_spu, _index, _secattr, _dmasec, _ownerid) \ + UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->PERIPH[(_index)].PERM, \ + (uint32_t)((((_ownerid) << SPU_PERIPH_PERM_OWNERID_Pos) & \ + SPU_PERIPH_PERM_OWNERID_Msk) | \ + (((_secattr) ? SPU_PERIPH_PERM_SECATTR_Secure \ + : SPU_PERIPH_PERM_SECATTR_NonSecure) \ + << SPU_PERIPH_PERM_SECATTR_Pos) | \ + (((_dmasec) ? SPU_PERIPH_PERM_DMASEC_Secure \ + : SPU_PERIPH_PERM_DMASEC_NonSecure) \ + << SPU_PERIPH_PERM_DMASEC_Pos) | \ + (SPU_PERIPH_PERM_LOCK_Locked << SPU_PERIPH_PERM_LOCK_Pos))) + +/** @brief Add a PERIPHCONF entry for a SPU FEATURE.IPCT.CH[n] register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Feature index. + * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_FEATURE_IPCT_CH_SET(_spu, _index, _secattr, _ownerid) \ + UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.IPCT.CH[_index], \ + _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) + +/** @brief Add a PERIPHCONF entry for a SPU FEATURE.IPCT.INTERRUPT[n] register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Feature index. + * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_FEATURE_IPCT_INTERRUPT_SET(_spu, _index, _secattr, _ownerid) \ + UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.IPCT.INTERRUPT[_index], \ + _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) + +/** @brief Add a PERIPHCONF entry for a SPU FEATURE.DPPIC.CH[n] register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Feature index. + * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_FEATURE_DPPIC_CH_SET(_spu, _index, _secattr, _ownerid) \ + UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.DPPIC.CH[_index], \ + _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) + +/** @brief Add a PERIPHCONF entry for a SPU FEATURE.DPPIC.CHG[n] register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Register index. + * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_FEATURE_DPPIC_CHG_SET(_spu, _index, _secattr, _ownerid) \ + UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.DPPIC.CHG[_index], \ + _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) + +/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIOTE[n].CH[m] register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Feature index (GPIOTE[n] register index). + * @param _subindex Feature subindex (CH[m] register index). + * @param _secattr If true, set the SECATTR to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_FEATURE_GPIOTE_CH_SET(_spu, _index, _subindex, _secattr, _ownerid) \ + UICR_PERIPHCONF_ADD( \ + (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIOTE[_index].CH[_subindex], \ + _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) + +/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIOTE.INTERRUPT[n] register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Feature index. + * @param _subindex Feature subindex. + * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_FEATURE_GPIOTE_INTERRUPT_SET(_spu, _index, _subindex, _secattr, _ownerid) \ + UICR_PERIPHCONF_ADD( \ + (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIOTE[_index].INTERRUPT[_subindex], \ + _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) + +/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GPIO[n].PIN[m] register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Feature index. + * @param _subindex Feature subindex. + * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_FEATURE_GPIO_PIN_SET(_spu, _index, _subindex, _secattr, _ownerid) \ + UICR_PERIPHCONF_ADD( \ + (uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GPIO[_index].PIN[_subindex], \ + _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) + +/** @brief Add a PERIPHCONF entry for a SPU FEATURE.GRTC.CC[n] register value. + * + * @param _spu Global domain SPU instance address. + * @param _index Feature index. + * @param _secattr If true, set SECATTR to secure, otherwise set it to non-secure. + * @param _ownerid OWNERID field value. + */ +#define UICR_SPU_FEATURE_GRTC_CC_SET(_spu, _index, _secattr, _ownerid) \ + UICR_PERIPHCONF_ADD((uint32_t)&((NRF_SPU_Type *)(_spu))->FEATURE.GRTC.CC[_index], \ + _UICR_SPU_FEATURE_VAL(_secattr, _ownerid)) + +/* Common macro for encoding a SPU FEATURE.* register value. + * Note that the MDK SPU_FEATURE_IPCT_CH_ macros are used for all since all the FEATURE registers + * have the same layout with different naming. + */ +#define _UICR_SPU_FEATURE_VAL(_secattr, _ownerid) \ + (uint32_t)((((_ownerid) << SPU_FEATURE_IPCT_CH_OWNERID_Pos) & \ + SPU_FEATURE_IPCT_CH_OWNERID_Msk) | \ + (((_secattr) ? SPU_FEATURE_IPCT_CH_SECATTR_Secure \ + : SPU_FEATURE_IPCT_CH_SECATTR_NonSecure) \ + << SPU_FEATURE_IPCT_CH_SECATTR_Pos) | \ + (SPU_FEATURE_IPCT_CH_LOCK_Locked << SPU_FEATURE_IPCT_CH_LOCK_Pos)) + +/** @brief Add PERIPHCONF entries for configuring IPCMAP CHANNEL.SOURCE[n] and CHANNEL.SINK[n]. + * + * @param _index CHANNEL.SOURCE[n]/CHANNEL.SINK[n] register index. + * @param _source_domain DOMAIN field value in CHANNEL[n].SOURCE. + * @param _source_ch SOURCE field value in CHANNEL[n].SOURCE. + * @param _sink_domain DOMAIN field value in CHANNEL[n].SINK. + * @param _sink_ch SINK field value in CHANNEL[n].SINK. + */ +#define UICR_IPCMAP_CHANNEL_CFG(_index, _source_domain, _source_ch, _sink_domain, _sink_ch) \ + UICR_IPCMAP_CHANNEL_SOURCE_SET(_index, _source_domain, _source_ch, 1); \ + UICR_IPCMAP_CHANNEL_SINK_SET(_index, _sink_domain, _sink_ch) + +#define UICR_IPCMAP_CHANNEL_SOURCE_SET(_index, _domain, _ch, _enable) \ + UICR_PERIPHCONF_ADD((uint32_t)&NRF_IPCMAP->CHANNEL[(_index)].SOURCE, \ + (uint32_t)((((_domain) << IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos) & \ + IPCMAP_CHANNEL_SOURCE_DOMAIN_Msk) | \ + (((_ch) << IPCMAP_CHANNEL_SOURCE_SOURCE_Pos) & \ + IPCMAP_CHANNEL_SOURCE_SOURCE_Msk) | \ + (((_enable) ? IPCMAP_CHANNEL_SOURCE_ENABLE_Enabled \ + : IPCMAP_CHANNEL_SOURCE_ENABLE_Disabled) \ + << IPCMAP_CHANNEL_SOURCE_ENABLE_Pos))) + +#define UICR_IPCMAP_CHANNEL_SINK_SET(_index, _domain, _ch) \ + UICR_PERIPHCONF_ADD((uint32_t)&NRF_IPCMAP->CHANNEL[(_index)].SINK, \ + (uint32_t)((((_domain) << IPCMAP_CHANNEL_SINK_DOMAIN_Pos) & \ + IPCMAP_CHANNEL_SINK_DOMAIN_Msk) | \ + (((_ch) << IPCMAP_CHANNEL_SINK_SINK_Pos) & \ + IPCMAP_CHANNEL_SINK_SINK_Msk))) + +/** @brief Add a PERIPHCONF entry for an IRQMAP IRQ[n].SINK register value. + * + * @param _irqnum IRQ number (IRQ[n] register index). + * @param _processor Processor to route the interrupt to (PROCESSORID field value). + */ +#define UICR_IRQMAP_IRQ_SINK_SET(_irqnum, _processor) \ + UICR_PERIPHCONF_ADD((uint32_t)&NRF_IRQMAP->IRQ[(_irqnum)].SINK, \ + (uint32_t)(((_processor) << IRQMAP_IRQ_SINK_PROCESSORID_Pos) & \ + IRQMAP_IRQ_SINK_PROCESSORID_Msk)) + +/** @brief Add a PERIPHCONF entry for configuring a GPIO PIN_CNF[n] CTRLSEL field value. + * + * @param _gpio GPIO instance address. + * @param _pin Pin number (PIN_CNF[n] register index). + * @param _ctrlsel CTRLSEL field value. + */ +#define UICR_GPIO_PIN_CNF_CTRLSEL_SET(_gpio, _pin, _ctrlsel) \ + UICR_PERIPHCONF_ADD( \ + (uint32_t)&((NRF_GPIO_Type *)(_gpio))->PIN_CNF[(_pin)], \ + ((GPIO_PIN_CNF_ResetValue) | \ + (uint32_t)(((_ctrlsel) << GPIO_PIN_CNF_CTRLSEL_Pos) & GPIO_PIN_CNF_CTRLSEL_Msk))) + +/** @brief Add a PERIPHCONF entry for a PPIB SUBSCRIBE_SEND[n] register. + * + * @param _ppib Global domain PPIB instance address. + * @param _ppib_ch PPIB channel number. + */ +#define UICR_PPIB_SUBSCRIBE_SEND_ENABLE(_ppib, _ppib_ch) \ + UICR_PERIPHCONF_ADD((uint32_t)&((NRF_PPIB_Type *)(_ppib))->SUBSCRIBE_SEND[(_ppib_ch)], \ + (uint32_t)PPIB_SUBSCRIBE_SEND_EN_Msk) + +/** @brief Add a PERIPHCONF entry for a PPIB PUBLISH_RECEIVE[n] register. + * + * @param _ppib Global domain PPIB instance address. + * @param _ppib_ch PPIB channel number. + */ +#define UICR_PPIB_PUBLISH_RECEIVE_ENABLE(_ppib, _ppib_ch) \ + UICR_PERIPHCONF_ADD((uint32_t)&((NRF_PPIB_Type *)(_ppib))->PUBLISH_RECEIVE[(_ppib_ch)], \ + (uint32_t)PPIB_PUBLISH_RECEIVE_EN_Msk) + +/* The definitions below are not currently available in the MDK but are needed for the macros + * above. When they are, this can be deleted. + */ +#ifndef IPCMAP_CHANNEL_SOURCE_SOURCE_Msk + +typedef struct { + __IOM uint32_t SOURCE; + __IOM uint32_t SINK; +} NRF_IPCMAP_CHANNEL_Type; + +#define IPCMAP_CHANNEL_SOURCE_SOURCE_Pos (0UL) +#define IPCMAP_CHANNEL_SOURCE_SOURCE_Msk (0xFUL << IPCMAP_CHANNEL_SOURCE_SOURCE_Pos) +#define IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos (8UL) +#define IPCMAP_CHANNEL_SOURCE_DOMAIN_Msk (0xFUL << IPCMAP_CHANNEL_SOURCE_DOMAIN_Pos) +#define IPCMAP_CHANNEL_SOURCE_ENABLE_Pos (31UL) +#define IPCMAP_CHANNEL_SOURCE_ENABLE_Disabled (0x0UL) +#define IPCMAP_CHANNEL_SOURCE_ENABLE_Enabled (0x1UL) +#define IPCMAP_CHANNEL_SINK_SINK_Pos (0UL) +#define IPCMAP_CHANNEL_SINK_SINK_Msk (0xFUL << IPCMAP_CHANNEL_SINK_SINK_Pos) +#define IPCMAP_CHANNEL_SINK_DOMAIN_Pos (8UL) +#define IPCMAP_CHANNEL_SINK_DOMAIN_Msk (0xFUL << IPCMAP_CHANNEL_SINK_DOMAIN_Pos) + +typedef struct { + __IM uint32_t RESERVED[256]; + __IOM NRF_IPCMAP_CHANNEL_Type CHANNEL[16]; +} NRF_IPCMAP_Type; + +#endif /* IPCMAP_CHANNEL_SOURCE_SOURCE_Msk */ + +#ifndef NRF_IPCMAP +#define NRF_IPCMAP ((NRF_IPCMAP_Type *)0x5F923000UL) +#endif + +#ifndef IRQMAP_IRQ_SINK_PROCESSORID_Msk + +typedef struct { + __IOM uint32_t SINK; +} NRF_IRQMAP_IRQ_Type; + +#define IRQMAP_IRQ_SINK_PROCESSORID_Pos (8UL) +#define IRQMAP_IRQ_SINK_PROCESSORID_Msk (0xFUL << IRQMAP_IRQ_SINK_PROCESSORID_Pos) + +typedef struct { + __IM uint32_t RESERVED[256]; + __IOM NRF_IRQMAP_IRQ_Type IRQ[480]; +} NRF_IRQMAP_Type; + +#endif /* IRQMAP_IRQ_SINK_PROCESSORID_Msk */ + +#ifndef NRF_IRQMAP +#define NRF_IRQMAP ((NRF_IRQMAP_Type *)0x5F924000UL) +#endif /* NRF_IRQMAP */ + +#ifndef GPIO_PIN_CNF_CTRLSEL_Pos + +#define GPIO_PIN_CNF_CTRLSEL_Pos (28UL) +#define GPIO_PIN_CNF_CTRLSEL_Msk (0x7UL << GPIO_PIN_CNF_CTRLSEL_Pos) +#define GPIO_PIN_CNF_CTRLSEL_Min (0x0UL) +#define GPIO_PIN_CNF_CTRLSEL_Max (0x7UL) +#define GPIO_PIN_CNF_CTRLSEL_GPIO (0x0UL) +#define GPIO_PIN_CNF_CTRLSEL_VPR (0x1UL) +#define GPIO_PIN_CNF_CTRLSEL_GRC (0x1UL) +#define GPIO_PIN_CNF_CTRLSEL_SecureDomain (0x2UL) +#define GPIO_PIN_CNF_CTRLSEL_PWM (0x2UL) +#define GPIO_PIN_CNF_CTRLSEL_I3C (0x2UL) +#define GPIO_PIN_CNF_CTRLSEL_Serial (0x3UL) +#define GPIO_PIN_CNF_CTRLSEL_HSSPI (0x3UL) +#define GPIO_PIN_CNF_CTRLSEL_RadioCore (0x4UL) +#define GPIO_PIN_CNF_CTRLSEL_EXMIF (0x4UL) +#define GPIO_PIN_CNF_CTRLSEL_CELL (0x4UL) +#define GPIO_PIN_CNF_CTRLSEL_DTB (0x6UL) +#define GPIO_PIN_CNF_CTRLSEL_TND (0x7UL) + +#endif /* GPIO_PIN_CNF_CTRLSEL_Pos */ + +#endif /* SOC_NORDIC_COMMON_UICR_UICR_H_ */ diff --git a/modules/hal_nordic/ironside/se/uicr.ld b/soc/nordic/common/uicr/uicr.ld similarity index 61% rename from modules/hal_nordic/ironside/se/uicr.ld rename to soc/nordic/common/uicr/uicr.ld index adc2e2cc3f64..210495b1c66c 100644 --- a/modules/hal_nordic/ironside/se/uicr.ld +++ b/soc/nordic/common/uicr/uicr.ld @@ -5,7 +5,7 @@ #include -SECTION_PROLOGUE(periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) +SECTION_PROLOGUE(uicr_periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) { - Z_LINK_ITERABLE(periphconf_entry); + Z_LINK_ITERABLE(uicr_periphconf_entry); } GROUP_ROM_LINK_IN(DEVNULL_REGION, DEVNULL_REGION) diff --git a/soc/nordic/ironside/CMakeLists.txt b/soc/nordic/ironside/CMakeLists.txt new file mode 100644 index 000000000000..f1ae2114f2ec --- /dev/null +++ b/soc/nordic/ironside/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +zephyr_include_directories(include) +zephyr_library() +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOTMODE_SERVICE bootmode.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_TDD_SERVICE tdd.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_DVFS_SERVICE dvfs.c) +zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_COUNTER_SERVICE counter.c) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig new file mode 100644 index 000000000000..7498af71d909 --- /dev/null +++ b/soc/nordic/ironside/Kconfig @@ -0,0 +1,89 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config NRF_IRONSIDE + bool + depends on SOC_NRF54H20 || SOC_NRF9280 + help + This is selected by drivers interacting with Nordic IronSide firmware. + +config NRF_IRONSIDE_CALL + bool + depends on DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED + select NRF_IRONSIDE + select EVENTS + select MBOX + help + This is selected by features that require support for IronSide calls. + +if NRF_IRONSIDE_CALL + +config NRF_IRONSIDE_CALL_INIT_PRIORITY + int "IronSide calls' initialization priority" + default 41 + help + Initialization priority of IronSide calls. It must be below MBOX_INIT_PRIORITY, + but higher than the priority of any feature that selects NRF_IRONSIDE_CALL. + +endif # NRF_IRONSIDE_CALL + +menu "Nordic IronSide services" + depends on SOC_NRF54H20 || SOC_NRF9280 + +config NRF_IRONSIDE_CPUCONF_SERVICE + bool "IronSide CPUCONF service" + depends on SOC_NRF54H20_CPUAPP || SOC_NRF9280_CPUAPP + select NRF_IRONSIDE_CALL + help + Service used to boot local domain cores. + +config NRF_IRONSIDE_TDD_SERVICE + bool "IronSide TDD service" + select NRF_IRONSIDE_CALL + help + Service used to control the trace and debug domain. + +config NRF_IRONSIDE_UPDATE_SERVICE + bool "IronSide update service" + select NRF_IRONSIDE_CALL + help + Service used to update the IronSide SE firmware. + +config NRF_IRONSIDE_BOOT_REPORT + bool "IronSide boot report" + depends on $(dt_nodelabel_exists,ironside_se_boot_report) + select NRF_IRONSIDE + help + Support for parsing the Boot Report populated by Nordic IronSide firmware. + +config NRF_IRONSIDE_BOOTMODE_SERVICE + bool "IronSide boot mode service" + select NRF_IRONSIDE_CALL + help + Service used to reboot into secondary firmware boot mode. + +config NRF_IRONSIDE_DVFS_SERVICE + bool "IronSide DVFS service" + depends on SOC_NRF54H20_CPUAPP + select NRF_IRONSIDE_CALL + help + Service used to handle DVFS operating point requests. + +config NRF_IRONSIDE_COUNTER_SERVICE + bool "IronSide counter service" + select NRF_IRONSIDE_CALL + help + Service used to manage secure monotonic counters. + +if NRF_IRONSIDE_DVFS_SERVICE + +config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS + int "IRONSside DVFS ABB analog status check maximum attempts" + range 0 255 + default 50 + help + Maximum attempts with 10us intervals before busy status will be reported. + +endif # NRF_IRONSIDE_DVFS_SERVICE + +endmenu diff --git a/soc/nordic/ironside/boot_report.c b/soc/nordic/ironside/boot_report.c new file mode 100644 index 000000000000..ead0afca947f --- /dev/null +++ b/soc/nordic/ironside/boot_report.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +#define IRONSIDE_SE_BOOT_REPORT_ADDR DT_REG_ADDR(DT_NODELABEL(ironside_se_boot_report)) + +int ironside_boot_report_get(const struct ironside_boot_report **report) +{ + const struct ironside_boot_report *tmp_report = (void *)IRONSIDE_SE_BOOT_REPORT_ADDR; + + if (tmp_report->magic != IRONSIDE_BOOT_REPORT_MAGIC) { + return -EINVAL; + } + + *report = tmp_report; + + return 0; +} diff --git a/soc/nordic/ironside/bootmode.c b/soc/nordic/ironside/bootmode.c new file mode 100644 index 000000000000..92ca5e312653 --- /dev/null +++ b/soc/nordic/ironside/bootmode.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include +#include +#include + +#define BOOT_MODE_SECONDARY (0x1) + +BUILD_ASSERT(IRONSIDE_BOOTMODE_SERVICE_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); + +int ironside_bootmode_secondary_reboot(const uint8_t *msg, size_t msg_size) +{ + int err; + struct ironside_call_buf *buf; + uint8_t *buf_msg; + + if (msg_size > IRONSIDE_BOOTMODE_SERVICE_MSG_MAX_SIZE) { + return -IRONSIDE_BOOTMODE_ERROR_MESSAGE_TOO_LARGE; + } + + buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_BOOTMODE_SERVICE_V1; + + buf->args[IRONSIDE_BOOTMODE_SERVICE_MODE_IDX] = BOOT_MODE_SECONDARY; + + buf_msg = (uint8_t *)&buf->args[IRONSIDE_BOOTMODE_SERVICE_MSG_0_IDX]; + + memset(buf_msg, 0, IRONSIDE_BOOTMODE_SERVICE_MSG_MAX_SIZE); + + if (msg_size > 0) { + memcpy(buf_msg, msg, msg_size); + } + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_BOOTMODE_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} diff --git a/modules/hal_nordic/ironside/se/call.c b/soc/nordic/ironside/call.c similarity index 81% rename from modules/hal_nordic/ironside/se/call.c rename to soc/nordic/ironside/call.c index 8ca71e2ee690..de4f59943f6a 100644 --- a/modules/hal_nordic/ironside/se/call.c +++ b/soc/nordic/ironside/call.c @@ -3,8 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include +#include #include #include #include @@ -16,15 +15,15 @@ #define DT_DRV_COMPAT nordic_ironside_call #define SHM_NODE DT_INST_PHANDLE(0, memory_region) -#define NUM_BUFS (DT_REG_SIZE(SHM_NODE) / sizeof(struct ironside_se_call_buf)) +#define NUM_BUFS (DT_REG_SIZE(SHM_NODE) / sizeof(struct ironside_call_buf)) #define ALL_BUF_BITS BIT_MASK(NUM_BUFS) /* Note: this area is already zero-initialized at reset time. */ -static struct ironside_se_call_buf *const bufs = (void *)DT_REG_ADDR(SHM_NODE); +static struct ironside_call_buf *const bufs = (void *)DT_REG_ADDR(SHM_NODE); #if defined(CONFIG_DCACHE_LINE_SIZE) BUILD_ASSERT((DT_REG_ADDR(SHM_NODE) % CONFIG_DCACHE_LINE_SIZE) == 0); -BUILD_ASSERT((sizeof(struct ironside_se_call_buf) % CONFIG_DCACHE_LINE_SIZE) == 0); +BUILD_ASSERT((sizeof(struct ironside_call_buf) % CONFIG_DCACHE_LINE_SIZE) == 0); #endif static const struct mbox_dt_spec mbox_rx = MBOX_DT_SPEC_INST_GET(0, rx); @@ -41,7 +40,7 @@ static void ironside_call_rsp(const struct device *dev, mbox_channel_id_t channe ARG_UNUSED(user_data); ARG_UNUSED(data); - struct ironside_se_call_buf *buf; + struct ironside_call_buf *buf; uint32_t rsp_buf_bits = 0; /* Check which buffers are not being dispatched currently. Those must @@ -63,8 +62,8 @@ static void ironside_call_rsp(const struct device *dev, mbox_channel_id_t channe sys_cache_data_invd_range(buf, sizeof(*buf)); barrier_dmem_fence_full(); - if (buf->status != IRONSIDE_SE_CALL_STATUS_IDLE && - buf->status != IRONSIDE_SE_CALL_STATUS_REQ) { + if (buf->status != IRONSIDE_CALL_STATUS_IDLE && + buf->status != IRONSIDE_CALL_STATUS_REQ) { rsp_buf_bits |= BIT(i); } } @@ -90,9 +89,9 @@ static int ironside_call_init(const struct device *dev) } DEVICE_DT_INST_DEFINE(0, ironside_call_init, NULL, NULL, NULL, POST_KERNEL, - CONFIG_IRONSIDE_SE_CALL_INIT_PRIORITY, NULL); + CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY, NULL); -struct ironside_se_call_buf *ironside_se_call_alloc(void) +struct ironside_call_buf *ironside_call_alloc(void) { uint32_t avail_buf_bits; uint32_t alloc_buf_bit; @@ -109,12 +108,12 @@ struct ironside_se_call_buf *ironside_se_call_alloc(void) return &bufs[u32_count_trailing_zeros(alloc_buf_bit)]; } -void ironside_se_call_dispatch(struct ironside_se_call_buf *buf) +void ironside_call_dispatch(struct ironside_call_buf *buf) { const uint32_t buf_bit = BIT(buf - bufs); int err; - buf->status = IRONSIDE_SE_CALL_STATUS_REQ; + buf->status = IRONSIDE_CALL_STATUS_REQ; barrier_dmem_fence_full(); sys_cache_data_flush_range(buf, sizeof(*buf)); @@ -127,11 +126,11 @@ void ironside_se_call_dispatch(struct ironside_se_call_buf *buf) k_event_wait(&rsp_evts, buf_bit, false, K_FOREVER); } -void ironside_se_call_release(struct ironside_se_call_buf *buf) +void ironside_call_release(struct ironside_call_buf *buf) { const uint32_t buf_bit = BIT(buf - bufs); - buf->status = IRONSIDE_SE_CALL_STATUS_IDLE; + buf->status = IRONSIDE_CALL_STATUS_IDLE; barrier_dmem_fence_full(); sys_cache_data_flush_range(buf, sizeof(*buf)); diff --git a/soc/nordic/ironside/counter.c b/soc/nordic/ironside/counter.c new file mode 100644 index 000000000000..b4506621851d --- /dev/null +++ b/soc/nordic/ironside/counter.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +int ironside_counter_set(enum ironside_counter counter_id, uint32_t value) +{ + int err; + struct ironside_call_buf *const buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_COUNTER_SET_V1; + buf->args[IRONSIDE_COUNTER_SET_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; + buf->args[IRONSIDE_COUNTER_SET_SERVICE_VALUE_IDX] = value; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_COUNTER_SET_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} + +int ironside_counter_get(enum ironside_counter counter_id, uint32_t *value) +{ + int err; + struct ironside_call_buf *buf; + + if (value == NULL) { + return -IRONSIDE_COUNTER_ERROR_INVALID_PARAM; + } + + buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_COUNTER_GET_V1; + buf->args[IRONSIDE_COUNTER_GET_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_COUNTER_GET_SERVICE_RETCODE_IDX]; + if (err == 0) { + *value = buf->args[IRONSIDE_COUNTER_GET_SERVICE_VALUE_IDX]; + } + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} + +int ironside_counter_lock(enum ironside_counter counter_id) +{ + int err; + struct ironside_call_buf *const buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_COUNTER_LOCK_V1; + buf->args[IRONSIDE_COUNTER_LOCK_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_COUNTER_LOCK_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} diff --git a/soc/nordic/ironside/cpuconf.c b/soc/nordic/ironside/cpuconf.c new file mode 100644 index 000000000000..264772a09e25 --- /dev/null +++ b/soc/nordic/ironside/cpuconf.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include +#include + +#include +#include + +#define CPU_PARAMS_CPU_OFFSET (0) +#define CPU_PARAMS_CPU_MASK (0xF) +#define CPU_PARAMS_WAIT_BIT BIT(4) + +int ironside_cpuconf(NRF_PROCESSORID_Type cpu, const void *vector_table, bool cpu_wait, + const uint8_t *msg, size_t msg_size) +{ + int err; + struct ironside_call_buf *buf; + uint8_t *buf_msg; + + if (msg_size > IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE) { + return -IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE; + } + + buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_CPUCONF_V0; + + buf->args[IRONSIDE_CPUCONF_SERVICE_CPU_PARAMS_IDX] = + (((uint32_t)cpu << CPU_PARAMS_CPU_OFFSET) & CPU_PARAMS_CPU_MASK) | + (cpu_wait ? CPU_PARAMS_WAIT_BIT : 0); + + buf->args[IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX] = (uint32_t)vector_table; + + buf_msg = (uint8_t *)&buf->args[IRONSIDE_CPUCONF_SERVICE_MSG_0]; + if (msg_size > 0) { + memcpy(buf_msg, msg, msg_size); + } + if (msg_size < IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE) { + memset(&buf_msg[msg_size], 0, IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE - msg_size); + } + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_CPUCONF_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} diff --git a/modules/hal_nordic/ironside/se/dvfs.c b/soc/nordic/ironside/dvfs.c similarity index 60% rename from modules/hal_nordic/ironside/se/dvfs.c rename to soc/nordic/ironside/dvfs.c index 8bba1a28f9a3..6c7a86cd0ad4 100644 --- a/modules/hal_nordic/ironside/se/dvfs.c +++ b/soc/nordic/ironside/dvfs.c @@ -2,12 +2,13 @@ * Copyright (c) 2025 Nordic Semiconductor ASA * SPDX-License-Identifier: Apache-2.0 */ -#include -#include #include #include -static enum ironside_se_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_SE_DVFS_OPP_HIGH; +#include +#include + +static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH; #if defined(CONFIG_SOC_SERIES_NRF54HX) #define ABB_STATUSANA_LOCKED_L_Pos (0UL) @@ -17,7 +18,7 @@ static enum ironside_se_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_SE_DVFS_OPP #error "Unsupported SoC series for IronSide DVFS" #endif -#define ABB_STATUSANA_CHECK_MAX_ATTEMPTS (CONFIG_IRONSIDE_SE_DVFS_ABB_STATUSANA_CHECK_MAX_ATTEMPTS) +#define ABB_STATUSANA_CHECK_MAX_ATTEMPTS (CONFIG_NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS) #define ABB_STATUSANA_CHECK_INTERVAL_US (10U) struct dvfs_hsfll_data_t { @@ -47,7 +48,7 @@ static const struct dvfs_hsfll_data_t dvfs_hsfll_data[] = { }, }; -BUILD_ASSERT(ARRAY_SIZE(dvfs_hsfll_data) == (IRONSIDE_SE_DVFS_OPPOINT_COUNT), +BUILD_ASSERT(ARRAY_SIZE(dvfs_hsfll_data) == (IRONSIDE_DVFS_OPPOINT_COUNT), "dvfs_hsfll_data size must match number of DVFS oppoints"); /** @@ -56,7 +57,7 @@ BUILD_ASSERT(ARRAY_SIZE(dvfs_hsfll_data) == (IRONSIDE_SE_DVFS_OPPOINT_COUNT), * @param target_freq_setting The target oppoint to check. * @return true if the current oppoint is higher than the target, false otherwise. */ -static bool is_downscaling(enum ironside_se_dvfs_oppoint target_freq_setting) +static bool ironside_dvfs_is_downscaling(enum ironside_dvfs_oppoint target_freq_setting) { return current_dvfs_oppoint < target_freq_setting; } @@ -66,7 +67,7 @@ static bool is_downscaling(enum ironside_se_dvfs_oppoint target_freq_setting) * * @param enum oppoint target operation point */ -static void configure_hsfll(enum ironside_se_dvfs_oppoint oppoint) +static void ironside_dvfs_configure_hsfll(enum ironside_dvfs_oppoint oppoint) { nrf_hsfll_trim_t hsfll_trim = {}; uint8_t freq_trim_idx = dvfs_hsfll_data[oppoint].new_f_trim_entry; @@ -92,15 +93,15 @@ static void configure_hsfll(enum ironside_se_dvfs_oppoint oppoint) } /* Function handling steps for DVFS oppoint change. */ -static void prepare_to_scale(enum ironside_se_dvfs_oppoint dvfs_oppoint) +static void ironside_dvfs_prepare_to_scale(enum ironside_dvfs_oppoint dvfs_oppoint) { - if (is_downscaling(dvfs_oppoint)) { - configure_hsfll(dvfs_oppoint); + if (ironside_dvfs_is_downscaling(dvfs_oppoint)) { + ironside_dvfs_configure_hsfll(dvfs_oppoint); } } /* Update MDK variable which is used by nrfx_coredep_delay_us (k_busy_wait). */ -static void update_core_clock(enum ironside_se_dvfs_oppoint dvfs_oppoint) +static void ironside_dvfs_update_core_clock(enum ironside_dvfs_oppoint dvfs_oppoint) { extern uint32_t SystemCoreClock; @@ -108,14 +109,14 @@ static void update_core_clock(enum ironside_se_dvfs_oppoint dvfs_oppoint) } /* Perform scaling finnish procedure. */ -static void change_oppoint_complete(enum ironside_se_dvfs_oppoint dvfs_oppoint) +static void ironside_dvfs_change_oppoint_complete(enum ironside_dvfs_oppoint dvfs_oppoint) { - if (!is_downscaling(dvfs_oppoint)) { - configure_hsfll(dvfs_oppoint); + if (!ironside_dvfs_is_downscaling(dvfs_oppoint)) { + ironside_dvfs_configure_hsfll(dvfs_oppoint); } current_dvfs_oppoint = dvfs_oppoint; - update_core_clock(dvfs_oppoint); + ironside_dvfs_update_core_clock(dvfs_oppoint); } /** @@ -125,7 +126,7 @@ static void change_oppoint_complete(enum ironside_se_dvfs_oppoint dvfs_oppoint) * * @return true if ABB is locked, false otherwise. */ -static inline bool is_abb_locked(NRF_ABB_Type *abb) +static inline bool ironside_dvfs_is_abb_locked(NRF_ABB_Type *abb) { /* Check if ABB analog part is locked. */ /* Temporary workaround until STATUSANA register is visible. */ @@ -141,12 +142,46 @@ static inline bool is_abb_locked(NRF_ABB_Type *abb) return ((*statusana & ABB_STATUSANA_LOCKED_L_Msk) != 0); } -int ironside_se_dvfs_change_oppoint(enum ironside_se_dvfs_oppoint dvfs_oppoint) +/** + * @brief Request DVFS oppoint change from IronSide secure domain. + * This function will send a request over IPC to the IronSide secure domain + * This function is synchronous and will return when the request is completed. + * + * @param oppoint @ref enum ironside_dvfs_oppoint + * @return int + */ +static int ironside_dvfs_req_oppoint(enum ironside_dvfs_oppoint oppoint) +{ + int err; + + struct ironside_call_buf *const buf = ironside_call_alloc(); + + buf->id = IRONSIDE_CALL_ID_DVFS_SERVICE_V0; + buf->args[IRONSIDE_DVFS_SERVICE_OPPOINT_IDX] = oppoint; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_DVFS_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} + +int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint) { int status = 0; - if (!is_abb_locked(NRF_ABB)) { - return -IRONSIDE_SE_DVFS_ERROR_BUSY; + if (!ironside_dvfs_is_oppoint_valid(dvfs_oppoint)) { + return -IRONSIDE_DVFS_ERROR_WRONG_OPPOINT; + } + + if (!ironside_dvfs_is_abb_locked(NRF_ABB)) { + return -IRONSIDE_DVFS_ERROR_BUSY; } if (dvfs_oppoint == current_dvfs_oppoint) { @@ -154,17 +189,17 @@ int ironside_se_dvfs_change_oppoint(enum ironside_se_dvfs_oppoint dvfs_oppoint) } if (k_is_in_isr()) { - return -IRONSIDE_SE_DVFS_ERROR_ISR_NOT_ALLOWED; + return -IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED; } - prepare_to_scale(dvfs_oppoint); + ironside_dvfs_prepare_to_scale(dvfs_oppoint); + + status = ironside_dvfs_req_oppoint(dvfs_oppoint); - status = ironside_se_dvfs_req_oppoint(dvfs_oppoint); if (status != 0) { return status; } - - change_oppoint_complete(dvfs_oppoint); + ironside_dvfs_change_oppoint_complete(dvfs_oppoint); return status; } diff --git a/soc/nordic/ironside/include/nrf_ironside/boot_report.h b/soc/nordic/ironside/include/nrf_ironside/boot_report.h new file mode 100644 index 000000000000..8c602c00134c --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/boot_report.h @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ + +#include +#include + +/** Constant used to check if an Nordic IronSide SE boot report has been written. */ +#define IRONSIDE_BOOT_REPORT_MAGIC (0x4d69546fUL) + +/** UICR had no errors. */ +#define IRONSIDE_UICR_SUCCESS 0 +/** There was an unexpected error processing the UICR. */ +#define IRONSIDE_UICR_ERROR_UNEXPECTED 1 +/** The UICR integrity check failed. */ +#define IRONSIDE_UICR_ERROR_INTEGRITY 2 +/** The UICR content check failed. */ +#define IRONSIDE_UICR_ERROR_CONTENT 3 +/** Failed to configure system based on UICR. */ +#define IRONSIDE_UICR_ERROR_CONFIG 4 +/** Unsupported UICR format version. */ +#define IRONSIDE_UICR_ERROR_FORMAT 5 + +/** Error found in UICR.PROTECTEDMEM. */ +#define IRONSIDE_UICR_REGID_PROTECTEDMEM 36 +/** Error found in UICR.SECURESTORAGE. */ +#define IRONSIDE_UICR_REGID_SECURESTORAGE 64 +/** Error found in UICR.PERIPHCONF. */ +#define IRONSIDE_UICR_REGID_PERIPHCONF 104 +/** Error found in UICR.MPCCONF. */ +#define IRONSIDE_UICR_REGID_MPCCONF 116 +/** Error found in UICR.SECONDARY.ADDRESS/SIZE4KB */ +#define IRONSIDE_UICR_REGID_SECONDARY 128 +/** Error found in UICR.SECONDARY.PROTECTEDMEM. */ +#define IRONSIDE_UICR_REGID_SECONDARY_PROTECTEDMEM 152 +/** Error found in UICR.SECONDARY.PERIPHCONF. */ +#define IRONSIDE_UICR_REGID_SECONDARY_PERIPHCONF 172 +/** Error found in UICR.SECONDARY.MPCCONF. */ +#define IRONSIDE_UICR_REGID_SECONDARY_MPCCONF 184 + +/** Failed to mount a CRYPTO secure storage partition in MRAM. */ +#define IRONSIDE_UICR_SECURESTORAGE_ERROR_MOUNT_CRYPTO_FAILED 1 +/** Failed to mount an ITS secure storage partition in MRAM. */ +#define IRONSIDE_UICR_SECURESTORAGE_ERROR_MOUNT_ITS_FAILED 2 +/** The start address and total size of all ITS partitions are not aligned to 4 KB. */ +#define IRONSIDE_UICR_SECURESTORAGE_ERROR_MISALIGNED 3 + +/** There was an unexpected error processing UICR.PERIPHCONF. */ +#define IRONSIDE_UICR_PERIPHCONF_ERROR_UNEXPECTED 1 +/** The address contained in a UICR.PERIPHCONF array entry is not permitted. */ +#define IRONSIDE_UICR_PERIPHCONF_ERROR_NOT_PERMITTED 2 +/** The readback of the value for a UICR.PERIPHCONF array entry did not match. */ +#define IRONSIDE_UICR_PERIPHCONF_ERROR_READBACK_MISMATCH 3 + +/** Booted in secondary mode. */ +#define IRONSIDE_BOOT_MODE_FLAGS_SECONDARY_MASK 0x1 + +/** Booted normally by IronSide SE.*/ +#define IRONSIDE_BOOT_REASON_DEFAULT 0 +/** Booted because of a cpuconf service call by a different core. */ +#define IRONSIDE_BOOT_REASON_CPUCONF_CALL 1 +/** Booted in secondary mode because of a bootmode service call. */ +#define IRONSIDE_BOOT_REASON_BOOTMODE_SECONDARY_CALL 2 +/** Booted in secondary mode because of a boot error in the primary mode. */ +#define IRONSIDE_BOOT_REASON_BOOTERROR 3 +/** Booted in secondary mode because of local domain reset reason trigger. */ +#define IRONSIDE_BOOT_REASON_TRIGGER_RESETREAS 4 +/** Booted in secondary mode via the CTRL-AP. */ +#define IRONSIDE_BOOT_REASON_CTRLAP_SECONDARYMODE 5 + +/** The boot had no errors. */ +#define IRONSIDE_BOOT_ERROR_SUCCESS 0x0 +/** The reset vector for the application firmware was not programmed. */ +#define IRONSIDE_BOOT_ERROR_NO_APPLICATION_FIRMWARE 0x1 +/** The IronSide SE was unable to parse the SysCtrl ROM report. */ +#define IRONSIDE_BOOT_ERROR_ROM_REPORT_INVALID 0x2 +/** The SysCtrl ROM booted the system in current limited mode due to an issue in the BICR. */ +#define IRONSIDE_BOOT_ERROR_ROM_REPORT_CURRENT_LIMITED 0x3 +/** The IronSide SE detected an issue with the HFXO configuration in the BICR. */ +#define IRONSIDE_BOOT_ERROR_BICR_HFXO_INVALID 0x4 +/** The IronSide SE detected an issue with the LFXO configuration in the BICR. */ +#define IRONSIDE_BOOT_ERROR_BICR_LFXO_INVALID 0x5 +/** The IronSide SE failed to boot the SysCtrl Firmware. */ +#define IRONSIDE_BOOT_ERROR_SYSCTRL_START_FAILED 0x6 +/** The UICR integrity check failed. */ +#define IRONSIDE_BOOT_ERROR_UICR_INTEGRITY_FAILED 0x7 +/** The UICR content is not valid */ +#define IRONSIDE_BOOT_ERROR_UICR_CONTENT_INVALID 0x8 +/** Integrity check of PROTECTEDMEM failed. */ +#define IRONSIDE_BOOT_ERROR_UICR_PROTECTEDMEM_INTEGRITY_FAILED 0x9 +/** Failed to configure system based on UICR. */ +#define IRONSIDE_BOOT_ERROR_UICR_CONFIG_FAILED 0xA +/** The IronSide SE failed to mount its own storage. */ +#define IRONSIDE_BOOT_ERROR_SECDOM_STORAGE_MOUNT_FAILED 0xB +/** Failed to initialize DVFS service */ +#define IRONSIDE_BOOT_ERROR_DVFS_INIT_FAILED 0xC +/** Failed to boot secondary application firmware; configuration missing from UICR. */ +#define IRONSIDE_BOOT_ERROR_NO_SECONDARY_APPLICATION_FIRMWARE 0xD +/** Integrity check of secondary PROTECTEDMEM failed. */ +#define IRONSIDE_BOOT_ERROR_UICR_SECONDARY_PROTECTEDMEM_INTEGRITY_FAILED 0xE +/** Unsupported UICR format version. */ +#define IRONSIDE_BOOT_ERROR_UICR_FORMAT_UNSUPPORTED 0xF +/** Value reserved for conditions that should never happen. */ +#define IRONSIDE_BOOT_ERROR_UNEXPECTED 0xff + +/** Index for RESETREAS.DOMAIN[NRF_DOMAIN_APPLICATION]. */ +#define IRONSIDE_SECONDARY_RESETREAS_APPLICATION 0 +/** Index for RESETREAS.DOMAIN[NRF_DOMAIN_RADIOCORE]. */ +#define IRONSIDE_SECONDARY_RESETREAS_RADIOCORE 1 + +/** Length of the local domain context buffer in bytes. */ +#define IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) +/** Length of the random data buffer in bytes. */ +#define IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) +/** Length of the uuid buffer in bytes. */ +#define IRONSIDE_BOOT_REPORT_UUID_SIZE (16UL) + +/** @brief Initialization/boot status description contained in the boot report. */ +struct ironside_boot_report_init_status { + /** Reserved for Future Use. */ + uint8_t rfu1[3]; + /** Boot error for the current boot (same as reported in BOOTSTATUS)*/ + uint8_t boot_error; + /** Overall UICR status. */ + uint8_t uicr_status; + /** Reserved for Future Use. */ + uint8_t rfu2; + /** ID of the register that caused the error. + * Only relevant for IRONSIDE_UICR_ERROR_CONTENT and IRONSIDE_UICR_ERROR_CONFIG. + */ + uint16_t uicr_regid; + /** Additional description for IRONSIDE_UICR_ERROR_CONFIG. */ + union { + /** UICR.SECURESTORAGE error description. */ + struct { + /** Reason that UICR.SECURESTORAGE configuration failed. */ + uint16_t status; + /** Owner ID of the failing secure storage partition. + * Only relevant for IRONSIDE_UICR_SECURESTORAGE_ERROR_MOUNT_CRYPTO_FAILED + * and IRONSIDE_UICR_SECURESTORAGE_ERROR_MOUNT_ITS_FAILED. + */ + uint16_t owner_id; + } securestorage; + /** UICR.PERIPHCONF error description. */ + struct { + /** Reason that UICR.PERIPHCONF configuration failed. */ + uint16_t status; + /** Index of the failing entry in the UICR.PERIPHCONF array. */ + uint16_t index; + } periphconf; + } uicr_detail; +}; + +/** @brief Initialization/boot context description contained in the boot report. */ +struct ironside_boot_report_init_context { + /** Reserved for Future Use */ + uint8_t rfu[3]; + /** Reason the processor was started. */ + uint8_t boot_reason; + + union { + /** Data passed from booting local domain to local domain being booted. + * + * Valid if the boot reason is one of the following: + * - IRONSIDE_BOOT_REASON_CPUCONF_CALL + * - IRONSIDE_BOOT_REASON_BOOTMODE_SECONDARY_CALL + */ + uint8_t local_domain_context[IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE]; + + /** Initialiation error that triggered the boot. + * + * Valid if the boot reason is IRONSIDE_BOOT_REASON_BOOTERROR. + */ + struct ironside_boot_report_init_status trigger_init_status; + + /** RESETREAS.DOMAIN that triggered the boot. + * + * Valid if the boot reason is IRONSIDE_BOOT_REASON_TRIGGER_RESETREAS. + */ + uint32_t trigger_resetreas[4]; + }; +}; + +/** @brief IronSide boot report. */ +struct ironside_boot_report { + /** Magic value used to identify valid boot report */ + uint32_t magic; + /** Firmware version of IronSide SE. 8bit MAJOR.MINOR.PATCH.SEQNUM */ + uint32_t ironside_se_version_int; + /** Human readable extraversion of IronSide SE */ + char ironside_se_extraversion[12]; + /** Firmware version of IronSide SE recovery firmware. 8bit MAJOR.MINOR.PATCH.SEQNUM */ + uint32_t ironside_se_recovery_version_int; + /** Human readable extraversion of IronSide SE recovery firmware */ + char ironside_se_recovery_extraversion[12]; + /** Copy of SICR.UROT.UPDATE.STATUS.*/ + uint32_t ironside_update_status; + /** Initialization/boot status. */ + struct ironside_boot_report_init_status init_status; + /** Reserved for Future Use */ + uint16_t rfu1; + /** Flags describing the current boot mode. */ + uint16_t boot_mode_flags; + /** Data describing the context under which the CPU was booted. */ + struct ironside_boot_report_init_context init_context; + /** CSPRNG data */ + uint8_t random_data[IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE]; + /** Device Info data : 128-bit Universally Unique IDentifier (UUID) */ + uint8_t device_info_uuid[IRONSIDE_BOOT_REPORT_UUID_SIZE]; + /** Reserved for Future Use */ + uint32_t rfu2[60]; +}; + +/** + * @brief Get a pointer to the IronSide boot report. + * + * @param[out] report Will be set to point to the IronSide boot report. + * + * @retval 0 if successful. + * @retval -EFAULT if the magic field in the report is incorrect. + * @retval -EINVAL if @p report is NULL. + */ +int ironside_boot_report_get(const struct ironside_boot_report **report); + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOT_REPORT_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/bootmode.h b/soc/nordic/ironside/include/nrf_ironside/bootmode.h new file mode 100644 index 000000000000..4da46f33dd6d --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/bootmode.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOTMODE_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOTMODE_H_ + +#include +#include +#include + +/** + * @name Boot mode service error codes. + * @{ + */ + +/** Invalid/unsupported boot mode transition. */ +#define IRONSIDE_BOOTMODE_ERROR_UNSUPPORTED_MODE (1) +/** Failed to reboot into the boot mode due to other activity preventing a reset. */ +#define IRONSIDE_BOOTMODE_ERROR_BUSY (2) +/** The boot message is too large to fit in the buffer. */ +#define IRONSIDE_BOOTMODE_ERROR_MESSAGE_TOO_LARGE (3) + +/** + * @} + */ + +/* IronSide call identifiers with implicit versions. */ +#define IRONSIDE_CALL_ID_BOOTMODE_SERVICE_V1 5 + +enum { + IRONSIDE_BOOTMODE_SERVICE_MODE_IDX, + IRONSIDE_BOOTMODE_SERVICE_MSG_0_IDX, + IRONSIDE_BOOTMODE_SERVICE_MSG_1_IDX, + IRONSIDE_BOOTMODE_SERVICE_MSG_2_IDX, + IRONSIDE_BOOTMODE_SERVICE_MSG_3_IDX, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_BOOTMODE_SERVICE_NUM_ARGS, +}; + +/* Maximum size of the message parameter. */ +#define IRONSIDE_BOOTMODE_SERVICE_MSG_MAX_SIZE (4 * sizeof(uint32_t)) + +/* Index of the return code within the service buffer. */ +#define IRONSIDE_BOOTMODE_SERVICE_RETCODE_IDX (0) + +/** + * @brief Request a reboot into the secondary firmware boot mode. + * + * This invokes the IronSide SE boot mode service to restart the system into the secondary boot + * mode. In this mode, the secondary configuration defined in UICR is applied instead of the + * primary one. The system immediately reboots without a reply if the request succeeds. + * + * The given message data is passed to the boot report of the CPU booted in the secondary boot mode. + * + * @note This function does not return if the request is successful. + * @note The device will boot into the secondary firmware instead of primary firmware. + * @note The request does not fail if the secondary firmware is not defined. + * + * @param msg A message that can be placed in the cpu's boot report. + * @param msg_size Size of the message in bytes. + * + * @retval 0 on success. + * @retval -IRONSIDE_BOOTMODE_ERROR_UNSUPPORTED_MODE if the secondary boot mode is unsupported. + * @retval -IRONSIDE_BOOTMODE_ERROR_BUSY if the reboot was blocked. + * @retval -IRONSIDE_BOOTMODE_ERROR_MESSAGE_TOO_LARGE if msg_size is greater than + * IRONSIDE_BOOTMODE_SERVICE_MSG_MAX_SIZE. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_bootmode_secondary_reboot(const uint8_t *msg, size_t msg_size); + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_BOOTMODE_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/call.h b/soc/nordic/ironside/include/nrf_ironside/call.h new file mode 100644 index 000000000000..9a2431c7d580 --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/call.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ + +#include + +/** @brief Maximum number of arguments to an IronSide call. + * + * This is chosen so that the containing message buffer size is minimal but + * cache line aligned. + */ +#define NRF_IRONSIDE_CALL_NUM_ARGS 7 + +/** @brief Message buffer. */ +struct ironside_call_buf { + /** Status code. This is set by the API. */ + uint16_t status; + /** Operation identifier. This is set by the user. */ + uint16_t id; + /** Operation arguments. These are set by the user. */ + uint32_t args[NRF_IRONSIDE_CALL_NUM_ARGS]; +}; + +/** + * @name Message buffer status codes. + * @{ + */ + +/** Buffer is idle and available for allocation. */ +#define IRONSIDE_CALL_STATUS_IDLE 0 +/** Request was processed successfully by the server. */ +#define IRONSIDE_CALL_STATUS_RSP_SUCCESS 1 +/** Request status code is unknown. */ +#define IRONSIDE_CALL_STATUS_RSP_ERR_UNKNOWN_STATUS 2 +/** Request status code is no longer supported. */ +#define IRONSIDE_CALL_STATUS_RSP_ERR_EXPIRED_STATUS 3 +/** Operation identifier is unknown. */ +#define IRONSIDE_CALL_STATUS_RSP_ERR_UNKNOWN_ID 4 +/** Operation identifier is no longer supported. */ +#define IRONSIDE_CALL_STATUS_RSP_ERR_EXPIRED_ID 5 +/** Buffer contains a request from the client. */ +#define IRONSIDE_CALL_STATUS_REQ 6 + +/** + * @} + */ + +/** + * @brief Allocate memory for an IronSide call. + * + * This function will block when no buffers are available, until one is + * released by another thread on the client side. + * + * @return Pointer to the allocated buffer. + */ +struct ironside_call_buf *ironside_call_alloc(void); + +/** + * @brief Dispatch an IronSide call. + * + * This function will block until a response is received from the server. + * + * @param buf Buffer returned by ironside_call_alloc(). It should be populated + * with request data before calling this function. Upon returning, + * this data will have been replaced by response data. + */ +void ironside_call_dispatch(struct ironside_call_buf *buf); + +/** + * @brief Release an IronSide call buffer. + * + * This function must be called after processing the response. + * + * @param buf Buffer used to perform the call. + */ +void ironside_call_release(struct ironside_call_buf *buf); + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CALL_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/counter.h b/soc/nordic/ironside/include/nrf_ironside/counter.h new file mode 100644 index 000000000000..37866c43a684 --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/counter.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ + +#include +#include +#include + +/** + * @name Counter service error codes. + * @{ + */ + +/** Counter value is lower than current value (monotonic violation). */ +#define IRONSIDE_COUNTER_ERROR_TOO_LOW (1) +/** Invalid counter ID. */ +#define IRONSIDE_COUNTER_ERROR_INVALID_ID (2) +/** Counter is locked and cannot be modified. */ +#define IRONSIDE_COUNTER_ERROR_LOCKED (3) +/** Invalid parameter. */ +#define IRONSIDE_COUNTER_ERROR_INVALID_PARAM (4) +/** Storage operation failed. */ +#define IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE (5) + +/** + * @} + */ + +/** Maximum value for a counter */ +#define IRONSIDE_COUNTER_MAX_VALUE UINT32_MAX + +/** Number of counters */ +#define IRONSIDE_COUNTER_NUM 4 + +/** + * @brief Counter identifiers. + */ +enum ironside_counter { + IRONSIDE_COUNTER_0 = 0, + IRONSIDE_COUNTER_1, + IRONSIDE_COUNTER_2, + IRONSIDE_COUNTER_3 +}; + +/* IronSide call identifiers with implicit versions. */ +#define IRONSIDE_CALL_ID_COUNTER_SET_V1 6 +#define IRONSIDE_CALL_ID_COUNTER_GET_V1 7 +#define IRONSIDE_CALL_ID_COUNTER_LOCK_V1 8 + +enum { + IRONSIDE_COUNTER_SET_SERVICE_COUNTER_ID_IDX, + IRONSIDE_COUNTER_SET_SERVICE_VALUE_IDX, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_COUNTER_SET_NUM_ARGS +}; + +enum { + IRONSIDE_COUNTER_GET_SERVICE_COUNTER_ID_IDX, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_COUNTER_GET_NUM_ARGS +}; + +enum { + IRONSIDE_COUNTER_LOCK_SERVICE_COUNTER_ID_IDX, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_COUNTER_LOCK_NUM_ARGS +}; + +/* Index of the return code within the service buffer. */ +#define IRONSIDE_COUNTER_SET_SERVICE_RETCODE_IDX (0) +#define IRONSIDE_COUNTER_GET_SERVICE_RETCODE_IDX (0) +#define IRONSIDE_COUNTER_LOCK_SERVICE_RETCODE_IDX (0) + +/* Index of the value within the GET response buffer. */ +#define IRONSIDE_COUNTER_GET_SERVICE_VALUE_IDX (1) + +BUILD_ASSERT(IRONSIDE_COUNTER_SET_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); +BUILD_ASSERT(IRONSIDE_COUNTER_GET_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); +BUILD_ASSERT(IRONSIDE_COUNTER_LOCK_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); + +/** + * @brief Set a counter value. + * + * This sets the specified counter to the given value. The counter is monotonic, + * so the new value must be greater than or equal to the current value. + * If the counter is locked, the operation will fail. + * + * @note Counters are automatically initialized to 0 during the first boot in LCS ROT. + * The monotonic constraint applies to all subsequent writes. + * + * @param counter_id Counter identifier. + * @param value New counter value. + * + * @retval 0 on success. + * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. + * @retval -IRONSIDE_COUNTER_ERROR_TOO_LOW if value is lower than current value. + * @retval -IRONSIDE_COUNTER_ERROR_LOCKED if counter is locked. + * @retval -IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE if storage operation failed. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_counter_set(enum ironside_counter counter_id, uint32_t value); + +/** + * @brief Get a counter value. + * + * This retrieves the current value of the specified counter. + * + * @note Counters are automatically initialized to 0 during the first boot in LCS ROT, + * so this function will always succeed for valid counter IDs. + * + * @param counter_id Counter identifier. + * @param value Pointer to store the counter value. + * + * @retval 0 on success. + * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. + * @retval -IRONSIDE_COUNTER_ERROR_INVALID_PARAM if value is NULL. + * @retval -IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE if storage operation failed. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_counter_get(enum ironside_counter counter_id, uint32_t *value); + +/** + * @brief Lock a counter for the current boot. + * + * This locks the specified counter, preventing any further modifications until the next reboot. + * The lock state is not persistent and will be cleared on reboot. + * + * @note The intended use case is for a bootloader to lock a counter before transferring control + * to the next boot stage, preventing that image from modifying the counter value. + * + * @param counter_id Counter identifier. + * + * @retval 0 on success. + * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_counter_lock(enum ironside_counter counter_id); + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h b/soc/nordic/ironside/include/nrf_ironside/cpuconf.h new file mode 100644 index 000000000000..a0fabd8abbd2 --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/cpuconf.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ + +#include +#include +#include +#include +#include + +/** + * @name CPUCONF service error codes. + * @{ + */ + +/** An invalid or unsupported processor ID was specified. */ +#define IRONSIDE_CPUCONF_ERROR_WRONG_CPU (1) +/** The boot message is too large to fit in the buffer. */ +#define IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE (2) + +/** + * @} + */ + +#define IRONSIDE_CALL_ID_CPUCONF_V0 2 + +enum { + IRONSIDE_CPUCONF_SERVICE_CPU_PARAMS_IDX, + IRONSIDE_CPUCONF_SERVICE_VECTOR_TABLE_IDX, + IRONSIDE_CPUCONF_SERVICE_MSG_0, + IRONSIDE_CPUCONF_SERVICE_MSG_1, + IRONSIDE_CPUCONF_SERVICE_MSG_2, + IRONSIDE_CPUCONF_SERVICE_MSG_3, + /* The last enum value is reserved for the number of arguments */ + IRONSIDE_CPUCONF_NUM_ARGS +}; + +/* Maximum size of the CPUCONF message parameter. */ +#define IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE (4 * sizeof(uint32_t)) + +/* IDX 0 is re-used by the error return code and the 'cpu' parameter. */ +#define IRONSIDE_CPUCONF_SERVICE_RETCODE_IDX 0 + +BUILD_ASSERT(IRONSIDE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); + +/** + * @brief Boot a local domain CPU + * + * @param cpu The CPU to be booted + * @param vector_table Pointer to the vector table used to boot the CPU. + * @param cpu_wait When this is true, the CPU will WAIT even if the CPU has clock. + * @param msg A message that can be placed in cpu's boot report. + * @param msg_size Size of the message in bytes. + * + * @note cpu_wait is only intended to be enabled for debug purposes + * and it is only supported that a debugger resumes the CPU. + * + * @note the call always sends IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE message bytes. + * If the given msg_size is less than that, the remaining bytes are set to zero. + * + * @retval 0 on success or if the CPU has already booted. + * @retval -IRONSIDE_CPUCONF_ERROR_WRONG_CPU if cpu is unrecognized. + * @retval -IRONSIDE_CPUCONF_ERROR_MESSAGE_TOO_LARGE if msg_size is greater than + * IRONSIDE_CPUCONF_SERVICE_MSG_MAX_SIZE. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_cpuconf(NRF_PROCESSORID_Type cpu, const void *vector_table, bool cpu_wait, + const uint8_t *msg, size_t msg_size); + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_CPUCONF_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/dvfs.h b/soc/nordic/ironside/include/nrf_ironside/dvfs.h new file mode 100644 index 000000000000..c47cc43a8598 --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/dvfs.h @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ + +#include +#include +#include +#include + +enum ironside_dvfs_oppoint { + IRONSIDE_DVFS_OPP_HIGH = 0, + IRONSIDE_DVFS_OPP_MEDLOW = 1, + IRONSIDE_DVFS_OPP_LOW = 2 +}; + +/** + * @brief Number of DVFS oppoints supported by IronSide. + * + * This is the number of different DVFS oppoints that can be set on IronSide. + * The oppoints are defined in the `ironside_dvfs_oppoint` enum. + */ +#define IRONSIDE_DVFS_OPPOINT_COUNT (3) + +/** + * @name IronSide DVFS service error codes. + * @{ + */ + +/** The requested DVFS oppoint is not allowed. */ +#define IRONSIDE_DVFS_ERROR_WRONG_OPPOINT (1) +/** Waiting for mutex lock timed out, or hardware is busy. */ +#define IRONSIDE_DVFS_ERROR_BUSY (2) +/** There is configuration error in the DVFS service. */ +#define IRONSIDE_DVFS_ERROR_OPPOINT_DATA (3) +/** The caller does not have permission to change the DVFS oppoint. */ +#define IRONSIDE_DVFS_ERROR_PERMISSION (4) +/** The requested DVFS oppoint is already set, no change needed. */ +#define IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED (5) +/** The operation timed out, possibly due to a hardware issue. */ +#define IRONSIDE_DVFS_ERROR_TIMEOUT (6) +/** The DVFS oppoint change operation is not allowed in the ISR context. */ +#define IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED (7) + +/** + * @} + */ + +/* IronSide call identifiers with implicit versions. + * + * With the initial "version 0", the service ABI is allowed to break until the + * first production release of IronSide SE. + */ +#define IRONSIDE_CALL_ID_DVFS_SERVICE_V0 3 + +/* Index of the DVFS oppoint within the service buffer. */ +#define IRONSIDE_DVFS_SERVICE_OPPOINT_IDX (0) +/* Index of the return code within the service buffer. */ +#define IRONSIDE_DVFS_SERVICE_RETCODE_IDX (0) + +/** + * @brief Change the current DVFS oppoint. + * + * This function will request a change of the current DVFS oppoint to the + * specified value. It will block until the change is applied. + * + * @param dvfs_oppoint The new DVFS oppoint to set. + * + * @retval 0 on success. + * @retval -IRONSIDE_DVFS_ERROR_WRONG_OPPOINT if the requested DVFS oppoint is not allowed. + * @retval -IRONSIDE_DVFS_ERROR_BUSY if waiting for mutex lock timed out, or hardware is busy. + * @retval -IRONSIDE_DVFS_ERROR_OPPOINT_DATA if there is configuration error in the DVFS service. + * @retval -IRONSIDE_DVFS_ERROR_PERMISSION if the caller does not have permission to change the DVFS + * oppoint. + * @retval -IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED if the requested DVFS oppoint is already set. + * @retval -IRONSIDE_DVFS_ERROR_TIMEOUT if the operation timed out, possibly due to a hardware + * issue. + * @retval -IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED if the DVFS oppoint change operation is not allowed + * in the ISR context. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint); + +/** + * @brief Check if the given oppoint is valid. + * + * @param dvfs_oppoint The oppoint to check. + * @return true if the oppoint is valid, false otherwise. + */ +static inline bool ironside_dvfs_is_oppoint_valid(enum ironside_dvfs_oppoint dvfs_oppoint) +{ + if (dvfs_oppoint != IRONSIDE_DVFS_OPP_HIGH && dvfs_oppoint != IRONSIDE_DVFS_OPP_MEDLOW && + dvfs_oppoint != IRONSIDE_DVFS_OPP_LOW) { + return false; + } + + return true; +} + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_DVFS_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/tdd.h b/soc/nordic/ironside/include/nrf_ironside/tdd.h new file mode 100644 index 000000000000..adfb1c53a648 --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/tdd.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ + +#include + +#include + +#define IRONSIDE_SE_TDD_SERVICE_ERROR_INVALID_CONFIG (1) + +#define IRONSIDE_SE_CALL_ID_TDD_V0 4 + +#define IRONSIDE_SE_TDD_SERVICE_REQ_CONFIG_IDX 0 +#define IRONSIDE_SE_TDD_SERVICE_RSP_RETCODE_IDX 0 + +enum ironside_se_tdd_config { + RESERVED0 = 0, /* Reserved */ + /** Turn off the TDD */ + IRONSIDE_SE_TDD_CONFIG_OFF = 1, + /** Turn on the TDD with default configuration */ + IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT = 2, +}; + +/** + * @brief Control the Trace and Debug Domain (TDD). + * + * @param config The configuration to be applied. + * + * @retval 0 on success. + * @retval -IRONSIDE_SE_TDD_SERVICE_ERROR_INVALID_CONFIG if the configuration is invalid. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + */ +int ironside_se_tdd_configure(const enum ironside_se_tdd_config config); + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_TDD_H_ */ diff --git a/soc/nordic/ironside/include/nrf_ironside/update.h b/soc/nordic/ironside/include/nrf_ironside/update.h new file mode 100644 index 000000000000..6e520e4e680b --- /dev/null +++ b/soc/nordic/ironside/include/nrf_ironside/update.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ +#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ + +#include +#include + +/** + * @name Update service error codes. + * @{ + */ + +/** Caller does not have access to the provided update candidate buffer. */ +#define IRONSIDE_UPDATE_ERROR_NOT_PERMITTED (1) +/** Failed to write the update metadata to SICR. */ +#define IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED (2) +/** Update candidate is placed outside of valid range */ +#define IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS (3) + +/** + * @} + */ + +/** Size of the update blob */ +#ifdef CONFIG_SOC_SERIES_NRF54HX +#define IRONSIDE_UPDATE_BLOB_SIZE (160 * 1024) +#elif CONFIG_SOC_SERIES_NRF92X +#define IRONSIDE_UPDATE_BLOB_SIZE (160 * 1024) +#else +#error "Missing update blob size" +#endif + +/** Min address used for storing the update candidate */ +#define IRONSIDE_UPDATE_MIN_ADDRESS (0x0e100000) +/** Max address used for storing the update candidate */ +#define IRONSIDE_UPDATE_MAX_ADDRESS (0x0e200000 - IRONSIDE_UPDATE_BLOB_SIZE) + +/** Length of the update manifest in bytes */ +#define IRONSIDE_UPDATE_MANIFEST_LENGTH (256) +/** Length of the update public key in bytes. */ +#define IRONSIDE_UPDATE_PUBKEY_LENGTH (32) +/** Length of the update signature in bytes. */ +#define IRONSIDE_UPDATE_SIGNATURE_LENGTH (64) + +/* IronSide call identifiers with implicit versions. + * + * With the initial "version 0", the service ABI is allowed to break until the + * first production release of IronSide SE. + */ +#define IRONSIDE_CALL_ID_UPDATE_SERVICE_V0 1 + +/* Index of the update blob pointer within the service buffer. */ +#define IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX (0) +/* Index of the return code within the service buffer. */ +#define IRONSIDE_UPDATE_SERVICE_RETCODE_IDX (0) + +/** + * @brief IronSide update blob. + */ +struct ironside_update_blob { + uint8_t manifest[IRONSIDE_UPDATE_MANIFEST_LENGTH]; + uint8_t pubkey[IRONSIDE_UPDATE_PUBKEY_LENGTH]; + uint8_t signature[IRONSIDE_UPDATE_SIGNATURE_LENGTH]; + uint32_t firmware[]; +}; + +/** + * @brief Request a firmware upgrade of the IronSide SE. + * + * This invokes the IronSide SE update service. The device must be restarted for the update + * to be installed. Check the update status in the application boot report to see if the update + * was successfully installed. + * + * @param update Pointer to update blob + * + * @retval 0 on a successful request (although the update itself may still fail). + * @retval -IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS if the address of the update is outside of the + * accepted range. + * @retval -IRONSIDE_UPDATE_ERROR_NOT_PERMITTED if missing access to the update candidate. + * @retval -IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED if writing update parameters to SICR failed. + * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). + * + */ +int ironside_update(const struct ironside_update_blob *update); + +#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_UPDATE_H_ */ diff --git a/soc/nordic/ironside/tdd.c b/soc/nordic/ironside/tdd.c new file mode 100644 index 000000000000..eee5691cf362 --- /dev/null +++ b/soc/nordic/ironside/tdd.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +int ironside_se_tdd_configure(const enum ironside_se_tdd_config config) +{ + int err; + struct ironside_call_buf *const buf = ironside_call_alloc(); + + buf->id = IRONSIDE_SE_CALL_ID_TDD_V0; + buf->args[IRONSIDE_SE_TDD_SERVICE_REQ_CONFIG_IDX] = (uint32_t)config; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_SE_TDD_SERVICE_RSP_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} diff --git a/soc/nordic/ironside/update.c b/soc/nordic/ironside/update.c new file mode 100644 index 000000000000..fabf6fb01049 --- /dev/null +++ b/soc/nordic/ironside/update.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +int ironside_update(const struct ironside_update_blob *update) +{ + int err; + struct ironside_call_buf *const buf = ironside_call_alloc(); + + if ((uintptr_t)update < IRONSIDE_UPDATE_MIN_ADDRESS || + (uintptr_t)update > IRONSIDE_UPDATE_MAX_ADDRESS) { + return -IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS; + } + + buf->id = IRONSIDE_CALL_ID_UPDATE_SERVICE_V0; + buf->args[IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX] = (uintptr_t)update; + + ironside_call_dispatch(buf); + + if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { + err = buf->args[IRONSIDE_UPDATE_SERVICE_RETCODE_IDX]; + } else { + err = buf->status; + } + + ironside_call_release(buf); + + return err; +} diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index a321138f1b02..f07a620ccdb3 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -4,7 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF54HX - select HAS_IRONSIDE_SE select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS @@ -72,7 +71,7 @@ config SOC_NRF54H20_CPURAD_ENABLE bool "Boot the nRF54H20 Radio core" default y if NRF_802154_SER_HOST || BT_HCI_HOST depends on SOC_NRF54H20_CPUAPP - select IRONSIDE_SE_CALL + select NRF_IRONSIDE_CPUCONF_SERVICE select SOC_LATE_INIT_HOOK help This will at application boot time enable clock to the diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index 1260067a2fc5..86149e5bd0e0 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -17,7 +17,4 @@ config POWER_DOMAIN config CODE_DATA_RELOCATION default y if (PM || POWEROFF) && !MCUBOOT -config NRF_PERIPHCONF_SECTION - default y - endif # SOC_NRF54H20_CPUAPP diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad index 8e0fca298817..31687c2a5443 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad @@ -17,7 +17,4 @@ config POWER_DOMAIN config CODE_DATA_RELOCATION default y if PM || POWEROFF -config NRF_PERIPHCONF_SECTION - default y - endif # SOC_NRF54H20_CPURAD diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index fe664dce6c0d..591b0d480acf 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -25,7 +25,7 @@ #include #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) -#include +#include #endif LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -237,8 +237,8 @@ void soc_late_init_hook(void) bool cpu_wait = IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT); - err_cpuconf = ironside_se_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, - msg_size); + err_cpuconf = ironside_cpuconf(NRF_PROCESSOR_RADIOCORE, radiocore_address, cpu_wait, msg, + msg_size); __ASSERT(err_cpuconf == 0, "err_cpuconf was %d", err_cpuconf); #endif /* CONFIG_SOC_NRF54H20_CPURAD_ENABLE */ } diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index 1c5b1af8deb3..739aada2b26e 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -4,7 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF92X - select HAS_IRONSIDE_SE select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp index 4e4bacfb5289..22ba6612ecfb 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp @@ -8,7 +8,4 @@ if SOC_NRF9280_CPUAPP config NUM_IRQS default 471 -config NRF_PERIPHCONF_SECTION - default y - endif # SOC_NRF9280_CPUAPP diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad index e708e1208cac..534658997fbe 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad @@ -8,7 +8,4 @@ if SOC_NRF9280_CPURAD config NUM_IRQS default 471 -config NRF_PERIPHCONF_SECTION - default y - endif # SOC_NRF9280_CPURAD From 4ad170d6833f01c852551f904244103172e370e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0839/3334] Revert "[nrf fromtree] manifest: update hal_nordic revision" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e7f84467e6029a1ef67bddeee28c7fa557bb7bfc. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index b9a1a35b79e9..3bb47be49563 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 09f24fd6cc7df57a5b5d08102ceb4a38381e2c82 + revision: 757314f07fbf2fb0f0257d7cfa147ca03f9d8398 path: modules/hal/nordic groups: - hal From f8943b8de16afede45362b6f94750a46850754aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0840/3334] Revert "[nrf fromtree] boards: nrf9280pdk: Merge cpuapp iron variant into the base variant" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ffbeccea8985e4585c922b2c75fe2258246316a4. Signed-off-by: Tomasz Moń --- boards/nordic/nrf9280pdk/Kconfig.defconfig | 15 ++- boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk | 4 +- boards/nordic/nrf9280pdk/board.yml | 2 + .../nrf9280pdk_nrf9280-ipc_conf.dtsi | 9 +- .../nrf9280pdk_nrf9280-ipc_conf_iron.dtsi | 30 +++++ .../nrf9280pdk_nrf9280-memory_map.dtsi | 104 ++++++++--------- .../nrf9280pdk_nrf9280-memory_map_iron.dtsi | 105 ++++++++++++++++++ .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 24 ++-- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml | 1 - .../nrf9280pdk_nrf9280_cpuapp_defconfig | 2 + .../nrf9280pdk_nrf9280_cpuapp_iron.dts | 41 +++++++ .../nrf9280pdk_nrf9280_cpuapp_iron.yaml | 23 ++++ ...f9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay | 52 +++++++++ .../nrf9280pdk_nrf9280_cpuapp_iron_defconfig | 29 +++++ .../nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 7 +- .../nrf9280pdk_nrf9280_cpuapp_iron.overlay | 8 ++ soc/nordic/ironside/Kconfig | 4 +- soc/nordic/nrf92/Kconfig | 4 +- .../nrf92/Kconfig.defconfig.nrf9280_cpuapp | 3 + .../nrf92/Kconfig.defconfig.nrf9280_cpurad | 3 + soc/nordic/nrf92/Kconfig.soc | 5 + .../nrf9280pdk_nrf9280_cpuapp_iron.overlay | 7 ++ .../nrf9280pdk_nrf9280_cpuapp_iron.overlay | 8 ++ 23 files changed, 401 insertions(+), 89 deletions(-) create mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi create mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi create mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts create mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml create mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay create mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig create mode 100644 samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay create mode 100644 tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay create mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay diff --git a/boards/nordic/nrf9280pdk/Kconfig.defconfig b/boards/nordic/nrf9280pdk/Kconfig.defconfig index 055c6c8be253..24669fc7f1e6 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.defconfig +++ b/boards/nordic/nrf9280pdk/Kconfig.defconfig @@ -4,6 +4,17 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION +if BOARD_NRF9280PDK_NRF9280_CPUAPP + +config BT_HCI_IPC + default y if BT + +endif # BOARD_NRF9280PDK_NRF9280_CPUAPP + +if BOARD_NRF9280PDK_NRF9280_CPURAD + +endif # BOARD_NRF9280PDK_NRF9280_CPURAD + if BOARD_NRF9280PDK_NRF9280_CPUPPR # As PPR has limited memory most of tests does not fit with asserts enabled. @@ -12,7 +23,7 @@ config ASSERT endif # BOARD_NRF9280PDK_NRF9280_CPUPPR -if BOARD_NRF9280PDK_NRF9280_CPUAPP +if BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON config ROM_START_OFFSET default 0x800 if BOOTLOADER_MCUBOOT @@ -20,4 +31,4 @@ config ROM_START_OFFSET config FLASH_LOAD_OFFSET default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) if !USE_DT_CODE_PARTITION -endif # BOARD_NRF9280PDK_NRF9280_CPUAPP +endif # BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON diff --git a/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk b/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk index e46ff337ff56..d66fe31da884 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk +++ b/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk @@ -2,7 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF9280PDK - select SOC_NRF9280_CPUAPP if BOARD_NRF9280PDK_NRF9280_CPUAPP + select SOC_NRF9280_CPUAPP if (BOARD_NRF9280PDK_NRF9280_CPUAPP || \ + BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON) select SOC_NRF9280_CPURAD if BOARD_NRF9280PDK_NRF9280_CPURAD select SOC_NRF9280_CPUPPR if (BOARD_NRF9280PDK_NRF9280_CPUPPR || \ BOARD_NRF9280PDK_NRF9280_CPUPPR_XIP) + select SOC_NRF9280_IRON if BOARD_NRF9280PDK_NRF9280_CPUAPP_IRON diff --git a/boards/nordic/nrf9280pdk/board.yml b/boards/nordic/nrf9280pdk/board.yml index c9216bbb9fb6..274b9a84a7b7 100644 --- a/boards/nordic/nrf9280pdk/board.yml +++ b/boards/nordic/nrf9280pdk/board.yml @@ -7,6 +7,8 @@ board: variants: - name: xip cpucluster: cpuppr + - name: iron + cpucluster: cpuapp revision: format: major.minor.patch default: 0.2.0 diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi index 94ef517601e7..0588e8d08018 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi @@ -7,17 +7,17 @@ / { ipc { cpusec_cpuapp_ipc: ipc-1-2 { - compatible = "nordic,ironside-call"; + compatible = "zephyr,ipc-icmsg"; status = "disabled"; - memory-region = <&cpusec_cpuapp_ipc_shm>; + dcache-alignment = <32>; mboxes = <&cpusec_bellboard 12>, <&cpuapp_bellboard 0>; }; cpusec_cpurad_ipc: ipc-1-3 { - compatible = "nordic,ironside-call"; + compatible = "zephyr,ipc-icmsg"; status = "disabled"; - memory-region = <&cpusec_cpurad_ipc_shm>; + dcache-alignment = <32>; mboxes = <&cpusec_bellboard 18>, <&cpurad_bellboard 0>; }; @@ -33,7 +33,6 @@ cpuapp_cpusys_ipc: ipc-2-12 { compatible = "zephyr,ipc-icmsg"; status = "disabled"; - unbound = "enable"; dcache-alignment = <32>; mboxes = <&cpuapp_bellboard 6>, <&cpusys_vevif 12>; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi new file mode 100644 index 000000000000..a44db40538d2 --- /dev/null +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf_iron.dtsi @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is to be merged with the original ipc_conf.dtsi in the future. */ + +/ { + ipc { + /delete-node/ ipc-1-2; + /delete-node/ ipc-1-3; + + cpusec_cpuapp_ipc: ipc-1-2 { + compatible = "nordic,ironside-call"; + memory-region = <&cpusec_cpuapp_ipc_shm>; + mboxes = <&cpusec_bellboard 12>, + <&cpuapp_bellboard 0>; + status = "disabled"; + }; + + cpusec_cpurad_ipc: ipc-1-3 { + compatible = "nordic,ironside-call"; + memory-region = <&cpusec_cpurad_ipc_shm>; + mboxes = <&cpusec_bellboard 18>, + <&cpurad_bellboard 0>; + status = "disabled"; + }; + }; +}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi index 3823fe27e58f..67c70f1d38b5 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi @@ -38,6 +38,14 @@ #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)>; }; @@ -90,27 +98,12 @@ }; }; - /* Workaround for a data cache related issue with SoC1.1, use secure addresses - * for cpuapp_cpusys_ipc_shm, cpusys_cpuapp_ipc_shm and cpusec_cpuapp_ipc_shm. - */ - cpuapp_cpusys_ipc_shm: memory@3f88f600 { - reg = <0x3f88f600 0x80>; + cpuapp_cpusys_ipc_shm: memory@2f88fce0 { + reg = <0x2f88fce0 0x80>; }; - cpusys_cpuapp_ipc_shm: memory@3f88f680 { - reg = <0x3f88f680 0x80>; - }; - - cpusec_cpuapp_ipc_shm: memory@3f88fb80 { - reg = <0x3f88fb80 0x80>; - }; - - cpuapp_ironside_se_event_report: memory@2f88fc00 { - reg = <0x2f88fc00 0x100>; - }; - - cpuapp_ironside_se_boot_report: memory@2f88fd00 { - reg = <0x2f88fd00 0x200>; + cpusys_cpuapp_ipc_shm: memory@2f88fd60 { + reg = <0x2f88fd60 0x80>; }; cpurad_cpusys_ipc_shm: memory@2f88fe00 { @@ -185,64 +178,57 @@ }; &mram1x { - partitions { - compatible = "fixed-partitions"; + cpurad_rx_partitions: cpurad-rx-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "disabled"; + nordic,access = ; #address-cells = <1>; #size-cells = <1>; - cpuapp_boot_partition: partition@312000 { - reg = <0x312000 DT_SIZE_K(64)>; + cpurad_slot0_partition: partition@402000 { + reg = <0x402000 DT_SIZE_K(256)>; }; + }; - cpuapp_slot0_partition: partition@322000 { - reg = <0x322000 DT_SIZE_K(336)>; - }; + cpuapp_rx_partitions: cpuapp-rx-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "disabled"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; - cpuapp_slot1_partition: partition@376000 { - reg = <0x376000 DT_SIZE_K(440)>; + cpuapp_slot0_partition: partition@442000 { + reg = <0x442000 DT_SIZE_K(1024)>; }; - cpuppr_code_partition: partition@3E4000 { - reg = <0x3E4000 DT_SIZE_K(64)>; + cpuppr_code_partition: partition@542000 { + reg = <0x542000 DT_SIZE_K(64)>; }; + }; - cpuflpr_code_partition: partition@3F4000 { - reg = <0x3F4000 DT_SIZE_K(48)>; - }; + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "disabled"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; - cpurad_slot0_partition: partition@400000 { - reg = <0x400000 DT_SIZE_K(336)>; + dfu_partition: partition@600000 { + reg = <0x600000 DT_SIZE_K(512)>; }; - cpurad_slot1_partition: partition@454000 { - reg = <0x454000 DT_SIZE_K(336)>; + storage_partition: partition@680000 { + reg = <0x680000 DT_SIZE_K(24)>; }; + }; - storage_partition: partition@600000 { - reg = <0x600000 DT_SIZE_K(40)>; - }; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; periphconf_partition: partition@60a000 { reg = <0x60a000 DT_SIZE_K(8)>; }; - - /* 0x60c000 was chosen for secure_storage_partition such that - * it resides in the beginning of MRAM11 in storage partition. - */ - secure_storage_partition: partition@60c000 { - compatible = "fixed-subpartitions"; - reg = <0x60c000 DT_SIZE_K(8)>; - ranges = <0x0 0x60c000 0x2000>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_crypto_partition: partition@0 { - reg = <0x0 DT_SIZE_K(4)>; - }; - - cpuapp_its_partition: partition@1000 { - reg = <0x1000 DT_SIZE_K(4)>; - }; - }; }; }; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi new file mode 100644 index 000000000000..fba2e0fb6c2d --- /dev/null +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is to be merged with the original memory_map.dtsi in the future. + * The following nodes will be replaced: + */ +/delete-node/ &cpuapp_cpusys_ipc_shm; +/delete-node/ &cpusec_cpuapp_ipc_shm; +/delete-node/ &cpusys_cpuapp_ipc_shm; +/delete-node/ &cpuapp_rw_partitions; +/delete-node/ &cpuapp_rx_partitions; +/delete-node/ &cpurad_rx_partitions; + +/ { + reserved-memory { + /* Workaround for a data cache related issue with SoC1.1, use secure addresses + * for cpuapp_cpusys_ipc_shm, cpusys_cpuapp_ipc_shm and cpusec_cpuapp_ipc_shm. + */ + cpuapp_cpusys_ipc_shm: memory@3f88f600 { + reg = <0x3f88f600 0x80>; + }; + + cpusys_cpuapp_ipc_shm: memory@3f88f680 { + reg = <0x3f88f680 0x80>; + }; + + cpusec_cpuapp_ipc_shm: memory@3f88fb80 { + reg = <0x3f88fb80 0x80>; + }; + + cpuapp_ironside_se_event_report: memory@2f88fc00 { + reg = <0x2f88fc00 0x100>; + }; + + cpuapp_ironside_se_boot_report: memory@2f88fd00 { + reg = <0x2f88fd00 0x200>; + }; + }; +}; + +&mram1x { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_boot_partition: partition@312000 { + reg = <0x312000 DT_SIZE_K(64)>; + }; + + cpuapp_slot0_partition: partition@322000 { + reg = <0x322000 DT_SIZE_K(336)>; + }; + + cpuapp_slot1_partition: partition@376000 { + reg = <0x376000 DT_SIZE_K(440)>; + }; + + cpuppr_code_partition: partition@3E4000 { + reg = <0x3E4000 DT_SIZE_K(64)>; + }; + + cpuflpr_code_partition: partition@3F4000 { + reg = <0x3F4000 DT_SIZE_K(48)>; + }; + + cpurad_slot0_partition: partition@400000 { + reg = <0x400000 DT_SIZE_K(336)>; + }; + + cpurad_slot1_partition: partition@454000 { + reg = <0x454000 DT_SIZE_K(336)>; + }; + + storage_partition: partition@600000 { + reg = <0x600000 DT_SIZE_K(40)>; + }; + + periphconf_partition: partition@60a000 { + reg = <0x60a000 DT_SIZE_K(8)>; + }; + + /* 0x60c000 was chosen for secure_storage_partition such that + * it resides in the beginning of MRAM11 in storage partition. + */ + secure_storage_partition: partition@60c000 { + compatible = "fixed-subpartitions"; + reg = <0x60c000 DT_SIZE_K(8)>; + ranges = <0x0 0x60c000 0x2000>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_crypto_partition: partition@0 { + reg = <0x0 DT_SIZE_K(4)>; + }; + + cpuapp_its_partition: partition@1000 { + reg = <0x1000 DT_SIZE_K(4)>; + }; + }; + }; +}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index e13022d06c13..19dd5e208063 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -20,11 +20,10 @@ chosen { zephyr,console = &uart136; - zephyr,code-partition = &slot0_partition; + zephyr,code-partition = &cpuapp_slot0_partition; zephyr,flash = &mram1x; zephyr,sram = &cpuapp_data; zephyr,shell-uart = &uart136; - zephyr,uart-mcumgr = &uart136; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,entropy = &psa_rng; @@ -150,17 +149,14 @@ status = "okay"; }; -&cpusec_bellboard { - status = "okay"; -}; - &cpusys_vevif { status = "okay"; }; &cpusec_cpuapp_ipc { mbox-names = "tx", "rx"; - status = "okay"; + tx-region = <&cpuapp_cpusec_ipc_shm>; + rx-region = <&cpusec_cpuapp_ipc_shm>; }; ipc0: &cpuapp_cpurad_ipc { @@ -194,18 +190,12 @@ ipc0: &cpuapp_cpurad_ipc { status = "okay"; }; -ironside_se_boot_report: &cpuapp_ironside_se_boot_report {}; - -boot_partition: &cpuapp_boot_partition { - label = "mcuboot"; -}; - -slot0_partition: &cpuapp_slot0_partition { - label = "image-0"; +&cpuapp_rx_partitions { + status = "okay"; }; -slot1_partition: &cpuapp_slot1_partition { - label = "image-1"; +&cpuapp_rw_partitions { + status = "okay"; }; &cpuppr_vpr { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml index 68babc33bcf3..d4bc799100dd 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml @@ -7,7 +7,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr sysbuild: true ram: 512 diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig index 5b27932f7855..d3ce90b8a380 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig @@ -8,6 +8,8 @@ CONFIG_SERIAL=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y +CONFIG_USE_DT_CODE_PARTITION=y + # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts new file mode 100644 index 000000000000..a3ca908f59de --- /dev/null +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.dts @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf9280pdk_nrf9280_cpuapp.dts" +#include "nrf9280pdk_nrf9280-ipc_conf_iron.dtsi" +#include "nrf9280pdk_nrf9280-memory_map_iron.dtsi" + +/delete-node/ &cpusec_cpurad_ipc; + +/ { + chosen { + zephyr,code-partition = &slot0_partition; + zephyr,uart-mcumgr = &uart136; + }; +}; + +&cpusec_bellboard { + status = "okay"; +}; + +&cpusec_cpuapp_ipc { + mbox-names = "tx", "rx"; + status = "okay"; +}; + +ironside_se_boot_report: &cpuapp_ironside_se_boot_report {}; + +boot_partition: &cpuapp_boot_partition { + label = "mcuboot"; +}; + +slot0_partition: &cpuapp_slot0_partition { + label = "image-0"; +}; + +slot1_partition: &cpuapp_slot1_partition { + label = "image-1"; +}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml new file mode 100644 index 000000000000..029f133993bf --- /dev/null +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf9280pdk/nrf9280/cpuapp/iron +name: nRF9280-DK-nRF9280-Application +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +sysbuild: true +ram: 512 +flash: 1024 +supported: + - adc + - counter + - gpio + - i2c + - pwm + - spi + - watchdog + - usbd diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay new file mode 100644 index 000000000000..4fa3f667eadd --- /dev/null +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" + +/ { + aliases { + pwm-led0 = &pwm_led2; /* Alias for compatibility with samples that use pwm-led0 */ + }; + + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + + led1: led_1 { + gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + + led2: led_2 { + gpios = <&gpio9 2 GPIO_ACTIVE_HIGH>; + label = "Green LED 2"; + }; + + led3: led_3 { + gpios = <&gpio9 3 GPIO_ACTIVE_HIGH>; + label = "Green LED 3"; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + + /delete-node/ pwm_led_0; + + /* + * There is no valid hardware configuration to pass PWM signal on pins 0 and 1. + * First valid config is P9.2. This corresponds to LED 2. + * Signal on PWM130's channel 0 can be passed directly on GPIO Port 9 pin 2. + */ + pwm_led2: pwm_led_2 { + pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; +}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig new file mode 100644 index 000000000000..01f3bec39321 --- /dev/null +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_defconfig @@ -0,0 +1,29 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# MPU-based null-pointer dereferencing detection cannot be applied +# as the (0x0 - 0x400) region is unmapped for this target. +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y + +# Enable cache +CONFIG_CACHE_MANAGEMENT=y +CONFIG_EXTERNAL_CACHE=y + +# Enable GPIO +CONFIG_GPIO=y + +# UICR generation is not supported, and when reintroduced will not use nrf-regtool. +CONFIG_NRF_REGTOOL_GENERATE_UICR=n diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index 17c482e7865c..91d967ea34aa 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -25,7 +25,6 @@ zephyr,flash = &mram1x; zephyr,sram = &cpurad_ram0; zephyr,shell-uart = &uart135; - zephyr,uart-mcumgr = &uart135; zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; @@ -69,6 +68,8 @@ &cpusec_cpurad_ipc { mbox-names = "tx", "rx"; + tx-region = <&cpurad_cpusec_ipc_shm>; + rx-region = <&cpusec_cpurad_ipc_shm>; }; ipc0: &cpuapp_cpurad_ipc { @@ -91,6 +92,10 @@ ipc0: &cpuapp_cpurad_ipc { status = "okay"; }; +&cpurad_rx_partitions { + status = "okay"; +}; + &grtc { status = "okay"; }; diff --git a/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay new file mode 100644 index 000000000000..102abfc8ef27 --- /dev/null +++ b/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay @@ -0,0 +1,8 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt010 { + status = "okay"; +}; diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index 7498af71d909..ddc7814fb86e 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -3,7 +3,7 @@ config NRF_IRONSIDE bool - depends on SOC_NRF54H20 || SOC_NRF9280 + depends on SOC_NRF54H20 || SOC_NRF9280_IRON help This is selected by drivers interacting with Nordic IronSide firmware. @@ -28,7 +28,7 @@ config NRF_IRONSIDE_CALL_INIT_PRIORITY endif # NRF_IRONSIDE_CALL menu "Nordic IronSide services" - depends on SOC_NRF54H20 || SOC_NRF9280 + depends on SOC_NRF54H20 || SOC_NRF9280_IRON config NRF_IRONSIDE_CPUCONF_SERVICE bool "IronSide CPUCONF service" diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index 739aada2b26e..eea33654f57d 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -9,7 +9,6 @@ config SOC_SERIES_NRF92X select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM select NRF_PLATFORM_HALTIUM - select EXPERIMENTAL if MCUBOOT config SOC_NRF9230_ENGB_CPUAPP select ARM @@ -52,3 +51,6 @@ config SOC_NRF9230_ENGB_CPURAD config SOC_NRF9230_ENGB_CPUPPR select RISCV_CORE_NORDIC_VPR + +config SOC_NRF9280_IRON + select EXPERIMENTAL if MCUBOOT diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp index 22ba6612ecfb..350f44b5c24e 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp @@ -8,4 +8,7 @@ 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_cpurad b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad index 534658997fbe..9b17a6b988cd 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad @@ -8,4 +8,7 @@ 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 index 99fc28643b74..6ad2fb8a0147 100644 --- a/soc/nordic/nrf92/Kconfig.soc +++ b/soc/nordic/nrf92/Kconfig.soc @@ -62,5 +62,10 @@ config SOC_NRF9280_CPUPPR help nRF9280 CPUPPR +config SOC_NRF9280_IRON + bool + help + Indicates that local domain firmware is compatible with Nordic IronSide SE. + config SOC default "nrf9280" if SOC_NRF9280 diff --git a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay new file mode 100644 index 000000000000..cd9ca89b82a3 --- /dev/null +++ b/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay @@ -0,0 +1,7 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +#include "nrf9280pdk_nrf9280_common.dtsi" diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay new file mode 100644 index 000000000000..102abfc8ef27 --- /dev/null +++ b/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp_iron.overlay @@ -0,0 +1,8 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt010 { + status = "okay"; +}; From 89da3c1fab890400c9b00c72d68dac6dbd8753c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0841/3334] Revert "[nrf fromtree] MAINTAINERS: Add maintainer and collaborators for nRF IronSide SE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5c98c475b03e41685a8a080e236fdfe0fff70390. Signed-off-by: Tomasz Moń --- MAINTAINERS.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 26a43ca7f8c2..aa0718740df8 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -6040,21 +6040,6 @@ nRF BSIM: tests: - boards.nrf52_bsim -nRF IronSide SE Platforms: - status: maintained - maintainers: - - hakonfam - collaborators: - - "57300" - - jonathannilsen - - karstenkoenig - - SebastianBoe - files: - - soc/nordic/ironside/ - - soc/nordic/common/uicr/ - labels: - - "platform: nRF IronSide SE" - nRF Platforms: status: maintained maintainers: From ebfa08a355815d9037ad52b08326ed53d0afc970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0842/3334] Revert "[nrf fromtree] dts: vendor: nordic: Fix invalid nrf54lm20a partition layout" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb67e5779f71d0bbd485f739dcbb2eccaa378710. Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf54lm20a_partition.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dts/vendor/nordic/nrf54lm20a_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_partition.dtsi index 1bc6991c434a..049f87139d91 100644 --- a/dts/vendor/nordic/nrf54lm20a_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_partition.dtsi @@ -21,17 +21,17 @@ slot0_partition: partition@10000 { label = "image-0"; - reg = <0x10000 DT_SIZE_K(920)>; + reg = <0x10000 DT_SIZE_K(922)>; }; - slot1_partition: partition@f6000 { + slot1_partition: partition@f6800 { label = "image-1"; - reg = <0xf6000 DT_SIZE_K(920)>; + reg = <0xf6800 DT_SIZE_K(922)>; }; - storage_partition: partition@1dc000 { + storage_partition: partition@1dd000 { label = "storage"; - reg = <0x1dc000 DT_SIZE_K(36)>; + reg = <0x1dd000 DT_SIZE_K(32)>; }; }; }; From 2a1edc2f8d6d5d1de2c8fc98399e53391771f9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0843/3334] Revert "[nrf fromtree] boards: nordic: nrf54h20dk: Add workaround for RISC-V debugging" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a9af9a911a0499828d5db33e74cc6e54e81dce34. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/board.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/boards/nordic/nrf54h20dk/board.cmake b/boards/nordic/nrf54h20dk/board.cmake index cabb050253e9..b9383042b0c7 100644 --- a/boards/nordic/nrf54h20dk/board.cmake +++ b/boards/nordic/nrf54h20dk/board.cmake @@ -20,7 +20,6 @@ if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_C set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuflpr.JLinkScript) endif() - # Workaround: Use device nRF54L15_RV32 until nRF54H20_RV32 is defined. - board_runner_args(jlink "--device=nRF54L15_RV32" "--speed=4000" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") + board_runner_args(jlink "--device=RISC-V" "--speed=4000" "-if SW" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) endif() From 8554bb377cfd02848ec20b6ffda1d8c40f0b6ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0844/3334] Revert "[nrf fromtree] Revert "drivers: adc: nrfx: Temporary fix for SAADC power consumption"" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d27c04d05e3e115018be1819320e7935983a74e9. Signed-off-by: Tomasz Moń --- drivers/adc/adc_nrfx_saadc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 48a96c4399a5..f54fd0a1aee8 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -663,6 +663,7 @@ static void event_handler(const nrfx_saadc_evt_t *event) correct_single_ended(&m_data.ctx.sequence, m_data.user_buffer, event->data.done.size); } + nrfy_saadc_disable(NRF_SAADC); adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); } else if (event->type == NRFX_SAADC_EVT_CALIBRATEDONE) { err = nrfx_saadc_mode_trigger(); From e12602f40c8b5f2fc799a1a426d15b3e8bffe707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0845/3334] Revert "[nrf fromtree] tests: arch: common: nrf54h20/cpuflpr needs different isr offset" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 419011cb67cfa035ab5e43fd0c0c6e09721e3e93. Signed-off-by: Tomasz Moń --- tests/arch/common/gen_isr_table/src/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/arch/common/gen_isr_table/src/main.c b/tests/arch/common/gen_isr_table/src/main.c index 1b28682eb18f..ed764e05b4bf 100644 --- a/tests/arch/common/gen_isr_table/src/main.c +++ b/tests/arch/common/gen_isr_table/src/main.c @@ -27,8 +27,7 @@ extern const uintptr_t _irq_vector_table[]; #if defined(CONFIG_NRFX_CLIC) -#if (defined(CONFIG_SOC_SERIES_NRF54LX) || defined(CONFIG_SOC_NRF54H20_CPUFLPR)) && \ - defined(CONFIG_RISCV_CORE_NORDIC_VPR) +#if defined(CONFIG_SOC_SERIES_NRF54LX) && defined(CONFIG_RISCV_CORE_NORDIC_VPR) #define ISR1_OFFSET 16 #define ISR3_OFFSET 17 #define ISR5_OFFSET 18 From 363158b21c0b8900bbd2204ecbb19e66c9895ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0846/3334] Revert "[nrf fromtree] tests: drivers: counter: nrf54h20/cpuflpr support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cd0384d7e99a4787442c56c8375214e31ca42acb. Signed-off-by: Tomasz Moń --- .../nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml | 1 + ...nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml | 1 - .../nrf54h20dk_nrf54h20_cpuflpr_xip.overlay | 44 ------------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 10 ----- 4 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuflpr_xip.overlay diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml index 11a0e7271671..ff9513fd593b 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_0_9_0.yaml @@ -11,6 +11,7 @@ sysbuild: true ram: 46 flash: 46 supported: + - counter - gpio - i2c - pwm diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml index 39f81211a0b1..e2880af9be35 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml @@ -12,4 +12,3 @@ ram: 46 flash: 48 supported: - gpio - - counter diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuflpr_xip.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuflpr_xip.overlay deleted file mode 100644 index bc24f669d92d..000000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuflpr_xip.overlay +++ /dev/null @@ -1,44 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" - -/* FLPR does not have interrupts for slow peripherals. */ -&timer130 { - status = "disabled"; -}; - -&timer131 { - status = "disabled"; -}; - -&timer132 { - status = "disabled"; -}; - -&timer133 { - status = "disabled"; -}; - -&timer134 { - status = "disabled"; -}; - -&timer135 { - status = "disabled"; -}; - -&timer136 { - status = "disabled"; -}; - -&timer137 { - status = "disabled"; -}; - -&rtc130 { - status = "disabled"; -}; - -&rtc131 { - status = "disabled"; -}; diff --git a/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 71776f1d375c..cf3a4cf12587 100644 --- a/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,15 +1,5 @@ /* SPDX-License-Identifier: Apache-2.0 */ -&timer120 { - status = "reserved"; - interrupt-parent = <&cpuflpr_clic>; -}; - -&timer121 { - status = "reserved"; - interrupt-parent = <&cpuflpr_clic>; -}; - &timer130 { status = "reserved"; interrupt-parent = <&cpuppr_clic>; From 9448c2cc7d947abde992c26caa48c6de25a55518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0847/3334] Revert "[nrf fromtree] tests: arch: arm: Increase kobject text area when no optimization" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dcb90afc70fbc3600b66fa4bc234f14021c3ef94. Signed-off-by: Tomasz Moń --- tests/arch/arm/arm_interrupt/testcase.yaml | 1 - tests/arch/arm/arm_thread_swap/testcase.yaml | 2 -- 2 files changed, 3 deletions(-) diff --git a/tests/arch/arm/arm_interrupt/testcase.yaml b/tests/arch/arm/arm_interrupt/testcase.yaml index 5836a20b9565..df47b02fccd9 100644 --- a/tests/arch/arm/arm_interrupt/testcase.yaml +++ b/tests/arch/arm/arm_interrupt/testcase.yaml @@ -17,7 +17,6 @@ tests: - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_ZTEST_STACK_SIZE=1280 - - CONFIG_KOBJECT_TEXT_AREA=32768 arch.arm.interrupt.extra_exception_info: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: diff --git a/tests/arch/arm/arm_thread_swap/testcase.yaml b/tests/arch/arm/arm_thread_swap/testcase.yaml index b60ad6f705d8..e26d88429050 100644 --- a/tests/arch/arm/arm_thread_swap/testcase.yaml +++ b/tests/arch/arm/arm_thread_swap/testcase.yaml @@ -14,7 +14,6 @@ tests: - CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - - CONFIG_KOBJECT_TEXT_AREA=32768 min_flash: 192 arch.arm.swap.common.fpu_sharing: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_ARMV7_M_ARMV8_M_FP @@ -30,5 +29,4 @@ tests: - CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - - CONFIG_KOBJECT_TEXT_AREA=32768 min_flash: 192 From e1a58b5831218c381a56456a1f27eea27746c0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0848/3334] Revert "[nrf fromtree] manifest: Update hal_nordic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e37df13e0e9ba6d539d84dba7fe14c3311d70500. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 3bb47be49563..26335c8499e0 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 757314f07fbf2fb0f0257d7cfa147ca03f9d8398 + revision: 0dbbf4794156ca09dc2d4bad8c42dcdb54acd662 path: modules/hal/nordic groups: - hal From e75b9487d9da9a0a05059332f4e84c074ec84d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0849/3334] Revert "[nrf fromlist] tests: boards: nrf: i2c: add twi variant" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 06ae9be299642684fbf2efb0f578217a71d5fce3. Signed-off-by: Tomasz Moń --- .../boards/nrf52840dk_nrf52840.overlay | 63 ++++++++++++++++- .../boards/nrf52840dk_nrf52840_common.overlay | 70 ------------------- .../boards/nrf52840dk_nrf52840_twi.overlay | 10 --- tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 6 -- 4 files changed, 62 insertions(+), 87 deletions(-) delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_common.overlay delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_twi.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay index 005708caa6f5..8f9f7135f7b2 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay @@ -3,8 +3,69 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf52840dk_nrf52840_common.overlay" +/* + * Two loopbacks are required: + * P1.01 - P1.02 + * P1.03 - P1.04 + */ + +/ { + aliases { + i2c-slave = &i2c1; + }; +}; + +&pinctrl { + i2c0_default_alt: i2c0_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep_alt: i2c0_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c1_default_alt: i2c1_default_alt { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c1_sleep_alt: i2c1_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; dut_twim: &i2c0 { compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c0_default_alt>; + pinctrl-1 = <&i2c0_sleep_alt>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +dut_twis: &i2c1 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c1_default_alt>; + pinctrl-1 = <&i2c1_sleep_alt>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_common.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_common.overlay deleted file mode 100644 index 4b52aa7ab9b3..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_common.overlay +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Two loopbacks are required: - * P1.01 - P1.02 - * P1.03 - P1.04 - */ - -/ { - aliases { - i2c-slave = &i2c1; - }; -}; - -&pinctrl { - i2c0_default_alt: i2c0_default_alt { - group1 { - psels = , - ; - }; - }; - - i2c0_sleep_alt: i2c0_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c1_default_alt: i2c1_default_alt { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c1_sleep_alt: i2c1_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c0 { - status = "okay"; - pinctrl-0 = <&i2c0_default_alt>; - pinctrl-1 = <&i2c0_sleep_alt>; - pinctrl-names = "default", "sleep"; - clock-frequency = ; - - sensor: sensor@54 { - reg = <0x54>; - }; -}; - -dut_twis: &i2c1 { - compatible = "nordic,nrf-twis"; - status = "okay"; - pinctrl-0 = <&i2c1_default_alt>; - pinctrl-1 = <&i2c1_sleep_alt>; - pinctrl-names = "default", "sleep"; - clock-frequency = ; -}; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_twi.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_twi.overlay deleted file mode 100644 index 36a246257db2..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840_twi.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf52840dk_nrf52840_common.overlay" - -&i2c0 { - compatible = "nordic,nrf-twi"; -}; diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index b50aade0191e..8e324bcaf563 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -24,12 +24,6 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - boards.nrf.i2c.i2c_slave.twi: - platform_allow: - - nrf52840dk/nrf52840 - integration_platforms: - - nrf52840dk/nrf52840 - extra_args: DTC_OVERLAY_FILE="boards/nrf52840dk_nrf52840_twi.overlay" boards.nrf.i2c.i2c_slave.fast: platform_allow: - nrf52840dk/nrf52840 From 444a8e2d25350ce8010546dd9c68b3b728903376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0850/3334] Revert "[nrf fromtree] drivers: nrf: Clean up remnants of nrfx error codes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2cac023fcdcf302be4dd0a69c63c947060179c59. Signed-off-by: Tomasz Moń --- drivers/i2c/i2c_nrfx_twi.c | 2 +- drivers/i2c/i2c_nrfx_twi_common.h | 10 +++++----- drivers/i2c/i2c_nrfx_twi_rtio.c | 2 +- .../common/nrf_usbd_common/nrf_usbd_common.c | 18 +++++++++--------- .../common/nrf_usbd_common/nrf_usbd_common.h | 14 +++++++------- drivers/usb/device/usb_dc_nrfx.c | 18 +++++++++--------- modules/hal_nordic/nrfx/nrfx_glue.h | 10 ++++++++++ .../ll_sw/nordic/hal/nrf5/radio/radio.c | 4 ++-- 8 files changed, 44 insertions(+), 34 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c index 12d40ee7323e..a28ec6f08a05 100644 --- a/drivers/i2c/i2c_nrfx_twi.c +++ b/drivers/i2c/i2c_nrfx_twi.c @@ -90,7 +90,7 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, break; } - if (data->res != 0) { + if (data->res != NRFX_SUCCESS) { ret = -EIO; break; } diff --git a/drivers/i2c/i2c_nrfx_twi_common.h b/drivers/i2c/i2c_nrfx_twi_common.h index 3f81b5cc94e0..a3e9847bab5b 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.h +++ b/drivers/i2c/i2c_nrfx_twi_common.h @@ -36,17 +36,17 @@ struct i2c_nrfx_twi_config { const struct pinctrl_dev_config *pcfg; }; -static inline int i2c_nrfx_twi_get_evt_result(nrfx_twi_evt_t const *p_event) +static inline nrfx_err_t i2c_nrfx_twi_get_evt_result(nrfx_twi_evt_t const *p_event) { switch (p_event->type) { case NRFX_TWI_EVT_DONE: - return 0; + return NRFX_SUCCESS; case NRFX_TWI_EVT_ADDRESS_NACK: - __fallthrough; + return NRFX_ERROR_DRV_TWI_ERR_ANACK; case NRFX_TWI_EVT_DATA_NACK: - return -EIO; + return NRFX_ERROR_DRV_TWI_ERR_DNACK; default: - return -EINVAL; + return NRFX_ERROR_INTERNAL; } } diff --git a/drivers/i2c/i2c_nrfx_twi_rtio.c b/drivers/i2c/i2c_nrfx_twi_rtio.c index 531b9eaac261..e8374f317f47 100644 --- a/drivers/i2c/i2c_nrfx_twi_rtio.c +++ b/drivers/i2c/i2c_nrfx_twi_rtio.c @@ -154,7 +154,7 @@ static void event_handler(nrfx_twi_evt_t const *p_event, void *p_context) const struct device *dev = p_context; int status = 0; - if (i2c_nrfx_twi_get_evt_result(p_event) != 0) { + if (i2c_nrfx_twi_get_evt_result(p_event) != NRFX_SUCCESS) { status = -EIO; } 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 655f643fb64c..9e5024837659 100644 --- a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c +++ b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c @@ -248,7 +248,7 @@ typedef struct { size_t transfer_cnt; /** Configured endpoint size. */ uint16_t max_packet_size; - /** NRF_USBD_COMMON_EP_* - this one is calculated. */ + /** NRFX_SUCCESS or error code, never NRFX_ERROR_BUSY - this one is calculated. */ nrf_usbd_common_ep_status_t status; } usbd_ep_state_t; @@ -1096,12 +1096,12 @@ void nrf_usbd_common_irq_handler(void) /** @} */ /** @} */ -int nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler) +nrfx_err_t nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler) { __ASSERT_NO_MSG(event_handler); if (m_drv_state != NRFX_DRV_STATE_UNINITIALIZED) { - return -EALREADY; + return NRFX_ERROR_INVALID_STATE; } m_event_handler = event_handler; @@ -1132,7 +1132,7 @@ int nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler) p_state->transfer_cnt = 0; } - return 0; + return NRFX_SUCCESS; } void nrf_usbd_common_uninit(void) @@ -1458,10 +1458,10 @@ void nrf_usbd_common_ep_disable(nrf_usbd_common_ep_t ep) usbd_int_rise(); } -int nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, +nrfx_err_t nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, nrf_usbd_common_transfer_t const *p_transfer) { - int ret; + nrfx_err_t ret; const uint8_t ep_bitpos = ep2bit(ep); unsigned int irq_lock_key = irq_lock(); @@ -1469,7 +1469,7 @@ int nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, /* Setup data transaction can go only in one direction at a time */ if ((NRF_USBD_COMMON_EP_NUM(ep) == 0) && (ep != m_last_setup_dir)) { - ret = -EFAULT; + ret = NRFX_ERROR_INVALID_ADDR; if (NRF_USBD_COMMON_FAILED_TRANSFERS_DEBUG && (NRF_USBD_COMMON_ISO_DEBUG || (!NRF_USBD_COMMON_EP_IS_ISO(ep)))) { LOG_DBG("Transfer failed: Invalid EPr\n"); @@ -1478,7 +1478,7 @@ int nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, (1U << ep_bitpos)) { /* IN (Device -> Host) transfer has to be transmitted out to allow new transmission */ - ret = -EBUSY; + ret = NRFX_ERROR_BUSY; if (NRF_USBD_COMMON_FAILED_TRANSFERS_DEBUG) { LOG_DBG("Transfer failed: EP is busy"); } @@ -1494,7 +1494,7 @@ int nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, p_state->transfer_cnt = 0; p_state->status = NRF_USBD_COMMON_EP_OK; m_ep_dma_waiting |= 1U << ep_bitpos; - ret = 0; + ret = NRFX_SUCCESS; usbd_int_rise(); } diff --git a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.h b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.h index e2fae5c424a8..bb3db14a05b0 100644 --- a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.h +++ b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.h @@ -276,10 +276,10 @@ typedef struct { * * @param[in] event_handler Event handler provided by the user. Cannot be null. * - * @retval 0 Initialization successful. - * @retval -EALREADY Driver was already initialized. + * @retval NRFX_SUCCESS Initialization successful. + * @retval NRFX_ERROR_INVALID_STATE Driver was already initialized. */ -int nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler); +nrfx_err_t nrf_usbd_common_init(nrf_usbd_common_event_handler_t event_handler); /** * @brief Driver deinitialization. @@ -503,11 +503,11 @@ void nrf_usbd_common_ep_disable(nrf_usbd_common_ep_t ep); * For OUT endpoint receiving would be initiated. * @param[in] p_transfer Transfer parameters. * - * @retval 0 Transfer queued or started. - * @retval -EBUSY Selected endpoint is pending. - * @retval -EFAULT Unexpected transfer on EPIN0 or EPOUT0. + * @retval NRFX_SUCCESS Transfer queued or started. + * @retval NRFX_ERROR_BUSY Selected endpoint is pending. + * @retval NRFX_ERROR_INVALID_ADDR Unexpected transfer on EPIN0 or EPOUT0. */ -int nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, +nrfx_err_t nrf_usbd_common_ep_transfer(nrf_usbd_common_ep_t ep, nrf_usbd_common_transfer_t const *p_transfer); /** diff --git a/drivers/usb/device/usb_dc_nrfx.c b/drivers/usb/device/usb_dc_nrfx.c index da5257b17582..c8bbfd40ada8 100644 --- a/drivers/usb/device/usb_dc_nrfx.c +++ b/drivers/usb/device/usb_dc_nrfx.c @@ -795,9 +795,9 @@ static inline void usbd_work_process_recvreq(struct nrf_usbd_ctx *ctx, k_mutex_lock(&ctx->drv_lock, K_FOREVER); NRF_USBD_COMMON_TRANSFER_OUT(transfer, ep_ctx->buf.data, ep_ctx->cfg.max_sz); - int err = nrf_usbd_common_ep_transfer( + nrfx_err_t err = nrf_usbd_common_ep_transfer( ep_addr_to_nrfx(ep_ctx->cfg.addr), &transfer); - if (err != 0) { + if (err != NRFX_SUCCESS) { LOG_ERR("nRF USBD transfer error (OUT): 0x%02x", err); } k_mutex_unlock(&ctx->drv_lock); @@ -1146,7 +1146,7 @@ static void usbd_event_handler(nrf_usbd_common_evt_t const *const p_event) static inline void usbd_reinit(void) { int ret; - int err; + nrfx_err_t err; nrfx_power_usbevt_disable(); nrf_usbd_common_disable(); @@ -1160,7 +1160,7 @@ static inline void usbd_reinit(void) nrfx_power_usbevt_enable(); err = nrf_usbd_common_init(usbd_event_handler); - if (err != 0) { + if (err != NRFX_SUCCESS) { LOG_DBG("nRF USBD driver reinit failed. Code: %d", err); __ASSERT_NO_MSG(0); } @@ -1692,9 +1692,9 @@ int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data, ep_ctx->write_in_progress = true; NRF_USBD_COMMON_TRANSFER_IN(transfer, data, data_len, 0); - int err = nrf_usbd_common_ep_transfer(ep_addr_to_nrfx(ep), &transfer); + nrfx_err_t err = nrf_usbd_common_ep_transfer(ep_addr_to_nrfx(ep), &transfer); - if (err != 0) { + if (err != NRFX_SUCCESS) { ep_ctx->write_in_progress = false; if (ret_bytes) { *ret_bytes = 0; @@ -1883,7 +1883,7 @@ int usb_dc_wakeup_request(void) static int usb_init(void) { struct nrf_usbd_ctx *ctx = get_usbd_ctx(); - int err; + nrfx_err_t err; #ifdef CONFIG_HAS_HW_NRF_USBREG /* Use CLOCK/POWER priority for compatibility with other series where @@ -1909,12 +1909,12 @@ static int usb_init(void) }; err = nrf_usbd_common_init(usbd_event_handler); - if (err != 0) { + if (err != NRFX_SUCCESS) { LOG_DBG("nRF USBD driver init failed. Code: %d", (uint32_t)err); return -EIO; } - /* Ignore the return value, as -EALREADY is not + /* Ignore the return value, as NRFX_ERROR_ALREADY is not * a problem here. */ (void)nrfx_power_init(&power_config); diff --git a/modules/hal_nordic/nrfx/nrfx_glue.h b/modules/hal_nordic/nrfx/nrfx_glue.h index 9ff8f061df8e..0fadfb61b027 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.h +++ b/modules/hal_nordic/nrfx/nrfx_glue.h @@ -256,6 +256,16 @@ void nrfx_busy_wait(uint32_t usec_to_wait); //------------------------------------------------------------------------------ +/** + * @brief When set to a non-zero value, this macro specifies that the + * @ref nrfx_error_codes and the @ref nrfx_err_t type itself are defined + * in a customized way and the default definitions from @c + * should not be used. + */ +#define NRFX_CUSTOM_ERROR_CODES 0 + +//------------------------------------------------------------------------------ + /** * @brief When set to a non-zero value, this macro specifies that inside HALs * the event registers are read back after clearing, on devices that 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 a441bb2d13b1..03d7ce5cace1 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 @@ -1941,13 +1941,13 @@ uint32_t radio_tmr_sample_get(void) int radio_gpio_pa_lna_init(void) { #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) - if (nrfx_gpiote_channel_alloc(gpiote_palna, &gpiote_ch_palna) != 0) { + if (nrfx_gpiote_channel_alloc(gpiote_palna, &gpiote_ch_palna) != NRFX_SUCCESS) { return -ENOMEM; } #endif #if defined(NRF_GPIO_PDN_PIN) - if (nrfx_gpiote_channel_alloc(gpiote_pdn, &gpiote_ch_pdn) != 0) { + if (nrfx_gpiote_channel_alloc(gpiote_pdn, &gpiote_ch_pdn) != NRFX_SUCCESS) { return -ENOMEM; } #endif From 770f8597132f704dbb0f07d9988d5e4a035d7ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0851/3334] Revert "[nrf fromlist] drivers: i2c: add DMM to i2c_nrfx_twim" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 306d6a7e8fdce34a4060705a3c9b6f8acd5d61d6. Signed-off-by: Tomasz Moń --- drivers/i2c/i2c_nrfx_twim.c | 32 +----------------------------- drivers/i2c/i2c_nrfx_twim_common.h | 1 - 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index 9cd8061dcb7c..0229ad5194cb 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -34,7 +33,6 @@ struct i2c_nrfx_twim_data { struct k_sem transfer_sync; struct k_sem completion_sync; volatile int res; - uint8_t *buf_ptr; }; int i2c_nrfx_twim_exclusive_access_acquire(const struct device *dev, k_timeout_t timeout) @@ -72,7 +70,6 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, uint16_t msg_buf_size = dev_config->msg_buf_size; uint8_t *buf; uint16_t buf_len; - uint8_t *dma_buf; (void)i2c_nrfx_twim_exclusive_access_acquire(dev, K_FOREVER); @@ -137,23 +134,7 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, buf = msg_buf; buf_len = msg_buf_used; } - - if (msgs[i].flags & I2C_MSG_READ) { - ret = dmm_buffer_in_prepare(dev_config->mem_reg, buf, buf_len, - (void **)&dma_buf); - } else { - ret = dmm_buffer_out_prepare(dev_config->mem_reg, buf, buf_len, - (void **)&dma_buf); - } - - if (ret < 0) { - LOG_ERR("Failed to prepare buffer: %d", ret); - return ret; - } - - dev_data->buf_ptr = buf; - - ret = i2c_nrfx_twim_msg_transfer(dev, msgs[i].flags, dma_buf, buf_len, addr); + ret = i2c_nrfx_twim_msg_transfer(dev, msgs[i].flags, buf, buf_len, addr); if (ret < 0) { break; } @@ -215,16 +196,6 @@ static void event_handler(nrfx_twim_event_t const *p_event, void *p_context) { const struct device *dev = p_context; struct i2c_nrfx_twim_data *dev_data = dev->data; - const struct i2c_nrfx_twim_common_config *config = dev->config; - - if (p_event->xfer_desc.type == NRFX_TWIM_XFER_TX) { - dmm_buffer_out_release(config->mem_reg, - (void **)&p_event->xfer_desc.p_primary_buf); - } else { - dmm_buffer_in_release(config->mem_reg, dev_data->buf_ptr, - p_event->xfer_desc.primary_length, - p_event->xfer_desc.p_primary_buf); - } switch (p_event->type) { case NRFX_TWIM_EVT_DONE: @@ -304,7 +275,6 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { IF_ENABLED(USES_MSG_BUF(inst), \ (.msg_buf = twim_##inst##_msg_buf,)) \ .max_transfer_size = MAX_TRANSFER_SIZE(inst), \ - .mem_reg = DMM_DEV_TO_REG(DT_DRV_INST(inst)), \ }; \ PM_DEVICE_DT_INST_DEFINE(inst, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(inst)); \ I2C_DEVICE_DT_INST_DEINIT_DEFINE(inst, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \ diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index 21ba3c601ac0..a0894cdcac86 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -75,7 +75,6 @@ struct i2c_nrfx_twim_common_config { uint8_t *msg_buf; uint16_t max_transfer_size; nrfx_twim_t *twim; - void *mem_reg; }; int i2c_nrfx_twim_common_init(const struct device *dev); From e81ca7f24abe959443122de4fdaa2bb659a28438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0852/3334] Revert "[nrf fromlist] drivers: i2c: clean-up macros used in nrfx_twim" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3fd1ded647b1a248a76cdb83952381450f00f5b0. Signed-off-by: Tomasz Moń --- drivers/i2c/i2c_nrfx_twim.c | 95 +++++++++++-------- drivers/i2c/i2c_nrfx_twim_common.h | 46 ++++----- drivers/i2c/i2c_nrfx_twim_rtio.c | 144 ++++++++++++++++------------- 3 files changed, 151 insertions(+), 134 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index 0229ad5194cb..8eee1949bdf4 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -243,43 +243,62 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { #define DT_DRV_COMPAT nordic_nrf_twim #endif -#define I2C_NRFX_TWIM_DEVICE(inst) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ - BUILD_ASSERT(I2C_FREQUENCY(inst) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #inst " frequency setting in dts"); \ - static struct i2c_nrfx_twim_data twim_##inst##_data; \ - static struct i2c_nrfx_twim_common_config twim_##inst##z_config; \ - static void pre_init##inst(void) \ - { \ - twim_##inst##z_config.twim = &twim_##inst##_data.twim; \ - twim_##inst##_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(inst); \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ - nrfx_twim_irq_handler, &twim_##inst##_data.twim, 0); \ - } \ - IF_ENABLED(USES_MSG_BUF(inst), \ - (static uint8_t twim_##inst##_msg_buf[MSG_BUF_SIZE(inst)] \ - DMM_MEMORY_SECTION(DT_DRV_INST(inst));)) \ - PINCTRL_DT_INST_DEFINE(inst); \ - static struct i2c_nrfx_twim_common_config twim_##inst##z_config = { \ - .twim_config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(inst), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(inst), \ - .pre_init = pre_init##inst, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ - IF_ENABLED(USES_MSG_BUF(inst), \ - (.msg_buf = twim_##inst##_msg_buf,)) \ - .max_transfer_size = MAX_TRANSFER_SIZE(inst), \ - }; \ - PM_DEVICE_DT_INST_DEFINE(inst, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(inst)); \ - I2C_DEVICE_DT_INST_DEINIT_DEFINE(inst, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \ - PM_DEVICE_DT_INST_GET(inst), &twim_##inst##_data, \ - &twim_##inst##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api) \ +#define CONCAT_BUF_SIZE(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_concat_buf_size), \ + (DT_INST_PROP(idx, zephyr_concat_buf_size)), (0)) +#define FLASH_BUF_MAX_SIZE(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_flash_buf_max_size), \ + (DT_INST_PROP(idx, zephyr_flash_buf_max_size)), (0)) + +#define USES_MSG_BUF(idx) \ + COND_CODE_0(CONCAT_BUF_SIZE(idx), \ + (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), \ + (1)) +#define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) + +#define I2C_NRFX_TWIM_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static struct i2c_nrfx_twim_data twim_##idx##_data; \ + static struct i2c_nrfx_twim_common_config twim_##idx##z_config; \ + static void pre_init##idx(void) \ + { \ + twim_##idx##z_config.twim = &twim_##idx##_data.twim; \ + twim_##idx##_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \ + IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \ + &twim_##idx##_data.twim, 0); \ + } \ + IF_ENABLED(USES_MSG_BUF(idx), \ + (static uint8_t twim_##idx##_msg_buf[MSG_BUF_SIZE(idx)] \ + I2C_MEMORY_SECTION(idx);)) \ + PINCTRL_DT_INST_DEFINE(idx); \ + static struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .pre_init = pre_init##idx, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ + IF_ENABLED(USES_MSG_BUF(idx), \ + (.msg_buf = twim_##idx##_msg_buf,)) .max_transfer_size = \ + BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)), \ + }; \ + PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ + I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \ + PM_DEVICE_DT_INST_GET(idx), &twim_##idx##_data, \ + &twim_##idx##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api) + +#define I2C_MEMORY_SECTION(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions), \ + (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ + DT_PHANDLE(DT_DRV_INST(idx), memory_regions)))))), \ + ()) DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWIM_DEVICE) diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index a0894cdcac86..c51932af5fd3 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -26,8 +26,10 @@ extern "C" { (bitrate == I2C_BITRATE_FAST_PLUS ? NRF_TWIM_FREQ_1000K :)) \ I2C_NRFX_TWIM_INVALID_FREQUENCY) -#define I2C_FREQUENCY(inst) \ - I2C_NRFX_TWIM_FREQUENCY(DT_INST_PROP_OR(inst, clock_frequency, I2C_BITRATE_STANDARD)) +#define I2C(idx) DT_NODELABEL(i2c##idx) +#define I2C_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(I2C(idx), prop) +#define I2C_FREQUENCY(node) \ + I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(node, clock_frequency, I2C_BITRATE_STANDARD)) /* Macro determines PM actions interrupt safety level. * @@ -36,36 +38,20 @@ extern "C" { * no longer ISR safe. This macro let's us check if we will be requesting/releasing * power domains and determines PM device ISR safety value. */ -#define I2C_PM_ISR_SAFE(inst) \ - COND_CODE_1( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND( \ - DT_NODE_INST_HAS_PROP(inst, power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_INST_PHANDLE(inst, power_domains)) \ - ) \ - ), \ - (0), \ - (PM_DEVICE_ISR_SAFE) \ +#define I2C_PM_ISR_SAFE(idx) \ + COND_CODE_1( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND( \ + DT_NODE_HAS_PROP(DT_DRV_INST(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(DT_DRV_INST(idx), \ + power_domains)) \ + ) \ + ), \ + (0), \ + (PM_DEVICE_ISR_SAFE) \ ) -#define CONCAT_BUF_SIZE(inst) \ - COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, zephyr_concat_buf_size), \ - (DT_INST_PROP(inst, zephyr_concat_buf_size)), (0)) - -#define FLASH_BUF_MAX_SIZE(inst) \ - COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, zephyr_flash_buf_max_size), \ - (DT_INST_PROP(inst, zephyr_flash_buf_max_size)), (0)) - -#define USES_MSG_BUF(inst) \ - COND_CODE_0(CONCAT_BUF_SIZE(inst), \ - (COND_CODE_0(FLASH_BUF_MAX_SIZE(inst), (0), (1))), \ - (1)) - -#define MSG_BUF_SIZE(inst) MAX(CONCAT_BUF_SIZE(inst), FLASH_BUF_MAX_SIZE(inst)) - -#define MAX_TRANSFER_SIZE(inst) BIT_MASK(DT_INST_PROP(inst, easydma_maxcnt_bits)) - struct i2c_nrfx_twim_common_config { nrfx_twim_config_t twim_config; nrfx_twim_event_handler_t event_handler; diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 0dbef19c4fab..872c5859bd91 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -219,73 +219,85 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) return i2c_nrfx_twim_common_deinit(dev); } -#define MSG_BUF_HAS_MEMORY_REGIONS(inst) DT_INST_NODE_HAS_PROP(inst, memory_regions) - -#define MSG_BUF_LINKER_REGION_NAME(inst) \ - LINKER_DT_NODE_REGION_NAME(DT_INST_PHANDLE(inst, memory_regions)) - -#define MSG_BUF_ATTR_SECTION(inst) \ - __attribute__((__section__(MSG_BUF_LINKER_REGION_NAME(inst)))) - -#define MSG_BUF_ATTR(inst) \ - COND_CODE_1( \ - MSG_BUF_HAS_MEMORY_REGIONS(inst), \ - (MSG_BUF_ATTR_SECTION(inst)), \ - () \ +#define CONCAT_BUF_SIZE(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_concat_buf_size), \ + (DT_INST_PROP(idx, zephyr_concat_buf_size)), (0)) +#define FLASH_BUF_MAX_SIZE(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_flash_buf_max_size), \ + (DT_INST_PROP(idx, zephyr_flash_buf_max_size)), (0)) + +#define USES_MSG_BUF(idx) \ + COND_CODE_0(CONCAT_BUF_SIZE(idx), (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), (1)) +#define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) + +#define MSG_BUF_HAS_MEMORY_REGIONS(idx) DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions) + +#define MSG_BUF_LINKER_REGION_NAME(idx) \ + LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(DT_DRV_INST(idx), memory_regions)) + +#define MSG_BUF_ATTR_SECTION(idx) \ + __attribute__((__section__(MSG_BUF_LINKER_REGION_NAME(idx)))) + +#define MSG_BUF_ATTR(idx) \ + COND_CODE_1( \ + MSG_BUF_HAS_MEMORY_REGIONS(idx), \ + (MSG_BUF_ATTR_SECTION(idx)), \ + () \ ) -#define MSG_BUF_SYM(inst) \ - _CONCAT_3(twim_, inst, _msg_buf) - -#define MSG_BUF_DEFINE(inst) \ - static uint8_t MSG_BUF_SYM(inst)[MSG_BUF_SIZE(inst)] MSG_BUF_ATTR(inst) - -#define I2C_NRFX_TWIM_RTIO_DEVICE(inst) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ - BUILD_ASSERT(I2C_FREQUENCY(inst) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #inst " frequency setting in dts"); \ - static struct i2c_nrfx_twim_rtio_data twim_##inst##z_data = { \ - .twim = \ - { \ - .p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(inst), \ - }, \ - }; \ - static void pre_init##inst(void) \ - { \ - twim_##inst##z_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(inst); \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ - nrfx_twim_irq_handler, &twim_##inst##z_data.twim, 0); \ - } \ - IF_ENABLED(USES_MSG_BUF(inst), (MSG_BUF_DEFINE(inst);)) \ - I2C_RTIO_DEFINE(_i2c##inst##_twim_rtio, \ - DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ - DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ - PINCTRL_DT_INST_DEFINE(inst); \ - static const struct i2c_nrfx_twim_rtio_config twim_##inst##z_config = { \ - .common = \ - { \ - .twim_config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(inst), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(inst), \ - .pre_init = pre_init##inst, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ - IF_ENABLED(USES_MSG_BUF(inst), (.msg_buf = MSG_BUF_SYM(inst),)) \ - .max_transfer_size = MAX_TRANSFER_SIZE(inst), \ - .twim = &twim_##inst##z_data.twim, \ - }, \ - .ctx = &_i2c##inst##_twim_rtio, \ - }; \ - PM_DEVICE_DT_INST_DEFINE(inst, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(inst)); \ - I2C_DEVICE_DT_INST_DEINIT_DEFINE(inst, i2c_nrfx_twim_rtio_init, \ - i2c_nrfx_twim_rtio_deinit, \ - PM_DEVICE_DT_INST_GET(inst), &twim_##inst##z_data, \ - &twim_##inst##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api); \ +#define MSG_BUF_SYM(idx) \ + _CONCAT_3(twim_, idx, _msg_buf) + +#define MSG_BUF_DEFINE(idx) \ + static uint8_t MSG_BUF_SYM(idx)[MSG_BUF_SIZE(idx)] MSG_BUF_ATTR(idx) + +#define MAX_TRANSFER_SIZE(idx) BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)) + +#define I2C_NRFX_TWIM_RTIO_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data = { \ + .twim = \ + { \ + .p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx), \ + }, \ + }; \ + static void pre_init##idx(void) \ + { \ + twim_##idx##z_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \ + IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \ + &twim_##idx##z_data.twim, 0); \ + } \ + IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ + I2C_RTIO_DEFINE(_i2c##idx##_twim_rtio, \ + DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ + DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ + PINCTRL_DT_INST_DEFINE(idx); \ + static const struct i2c_nrfx_twim_rtio_config twim_##idx##z_config = { \ + .common = \ + { \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .pre_init = pre_init##idx, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ + IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) \ + .max_transfer_size = MAX_TRANSFER_SIZE(idx), \ + .twim = &twim_##idx##z_data.twim, \ + }, \ + .ctx = &_i2c##idx##_twim_rtio, \ + }; \ + PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ + I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ + PM_DEVICE_DT_INST_GET(idx), &twim_##idx##z_data, \ + &twim_##idx##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api); DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWIM_RTIO_DEVICE) From 9c1188bf20db3e15283a51c07960776d9a12210a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0853/3334] Revert "[nrf fromlist] soc: nordic: nrf54l: Remove selecting a DTS-type option" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 13f0ae1445f47a553c85b759766f4da4719eea71. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54l/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 8547c3e12381..7c09a90cf83c 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -16,6 +16,7 @@ config SOC_NRF54L_CPUAPP_COMMON select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT select CPU_HAS_ICACHE + select HAS_HW_NRF_RADIO_IEEE802154 select HAS_POWEROFF select HAS_NORDIC_RAM_CTRL From 49c643c86a90407006d818d1c11879464123efb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:24 +0100 Subject: [PATCH 0854/3334] Revert "[nrf fromtree] soc: nordic: uicr: Parse pinctrls for local domain peripherals" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0d88c8902af386655b9007c602afab11e96a005f. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/periphconf/builder.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py index 34ccc6f7b497..8950a615f082 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -150,7 +150,7 @@ def add_local_peripheral_cfg( :param node_or_nodelabel: node or label of the node to process. """ - self._add_peripheral_cfg(node_or_nodelabel, is_global=False) + self._add_peripheral_cfg(node_or_nodelabel, is_global=False, add_gpios=False) def add_global_peripheral_cfg( self, @@ -182,6 +182,7 @@ def _add_peripheral_cfg( is_global: bool = True, has_irq_mapping: bool = True, add_ppib_channel_links: bool = True, + add_gpios: bool = True, ) -> None: if isinstance(node_or_nodelabel, str): node = self._dt.label2node[node_or_nodelabel] @@ -222,11 +223,13 @@ def _add_peripheral_cfg( if "nordic,nrf-comp" in node.compats or "nordic,nrf-lpcomp" in node.compats: self._add_nrf_comp_lpcomp_channel_pin_spu_permissions(node) + self._add_peripheral_pinctrls_spu_permissions_and_ctrlsel(node) + if "nordic,nrf-ipct-local" in node.compats: self._add_nrf_ipct_ipcmap_channel_links(node) - self._add_peripheral_pinctrls_spu_permissions_and_ctrlsel(node) - self._add_peripheral_gpios_spu_permissions_and_ctrlsel(node) + if add_gpios: + self._add_peripheral_gpios_spu_permissions_and_ctrlsel(node) def add_gpio_spu_permissions(self, node_or_nodelabel: Node | str, /) -> None: """Generate macros for populating SPU FEATURE.GPIO[n].PIN[m] registers based on @@ -881,12 +884,10 @@ def dt_node_is_secure(node: Node) -> bool: elif node.regs: addr = dt_reg_addr(node) else: - log.debug( + raise ValueError( f"Failed to determine security of {node.path} " - "from the address of its bus node or itself. " - "Defaulting to Secure." + "from the address of its bus node or itself" ) - return True return Address(addr).security From 7c914d20d1826a81515faf6b724831dcf6c346d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0855/3334] Revert "[nrf fromtree] drivers: mspi_dw: nrf_qspi_v2: Update to align nrfx 4.0.1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c3f25395efc494108e389208e77d3f90717b2d08. Signed-off-by: Tomasz Moń --- drivers/mspi/mspi_dw_vendor_specific.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index d994f579ad8e..6a76361ccf1c 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -98,7 +98,7 @@ static inline int vendor_specific_xip_disable(const struct device *dev, #endif /* defined(CONFIG_MSPI_XIP) */ #elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) -#include +#include static inline void vendor_specific_init(const struct device *dev) { From c5b78262853b92d9bc8c8bc39d9808a037bee338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0856/3334] Revert "[nrf fromlist] mcumgr: Prevent FW loader from self-destruction" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6a9f0debe2cb0d47328b26f109b09649b74ab269. Signed-off-by: Tomasz Moń --- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index 0a594e238478..0ebb722c2a90 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -361,13 +361,15 @@ img_mgmt_state_any_pending(void) int img_mgmt_slot_in_use(int slot) { +#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) + return 0; +#else int image = img_mgmt_slot_to_image(slot); int active_slot = img_mgmt_active_slot(image); #if !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) && \ !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) && \ - !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) && \ - !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) + !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) enum img_mgmt_next_boot_type type = NEXT_BOOT_TYPE_NORMAL; int nbs = img_mgmt_get_next_boot_slot(image, &type); @@ -389,6 +391,7 @@ img_mgmt_slot_in_use(int slot) #endif return (active_slot == slot); +#endif /* !defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) */ } /** From 508316548d710a3ae19c5b44dd9c714ada03a430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0857/3334] Revert "[nrf fromlist] nordic: nrf54h: bicrgen: patch lfosc lfxo accuracy parsing" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 346e6466868e29e2ee87a9bb72231e4f71dd9e37. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/bicr/bicrgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/bicr/bicrgen.py b/soc/nordic/nrf54h/bicr/bicrgen.py index 8b3c96526e08..b28fdc571a88 100644 --- a/soc/nordic/nrf54h/bicr/bicrgen.py +++ b/soc/nordic/nrf54h/bicr/bicrgen.py @@ -324,7 +324,7 @@ def from_raw(cls: "LFXOConfig", bicr_spec: ET.Element, data: bytes) -> "LFXOConf raise ValueError("Invalid LFXO startup time (not configured)") return cls( - accuracy_ppm=int(lfosc_lfxoconfig.enum_get("ACCURACY")[:-3]), + accuracy_ppm=int(lfosc_lfxoconfig.enum_get("ACCURACY")[:3]), mode=LFXOMode(lfosc_lfxoconfig.enum_get("MODE")), builtin_load_capacitors=builtin_load_capacitors, builtin_load_capacitance_pf=builtin_load_capacitance_pf, From 7929a1bc1f9192334ebab49143c2aebaaa360837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0858/3334] Revert "[nrf fromlist] soc: nordic: uicr: fix pin function ignore handling in CTRLSEL lookup" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 62755cbbd8b1043256d520217273d62949bfbe3f. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/periphconf/builder.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py index 8950a615f082..b8387fd9a756 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -1116,21 +1116,19 @@ def lookup_ctrlsel_for_property(self, prop: Property, psel: tuple[int, int]) -> def lookup_ctrlsel_for_pinctrl(self, prop: PinCtrl, psel: NrfPsel) -> Ctrlsel | None: """Find the appopriate CTRLSEL value for a given pinctrl.""" - ctrlsel_default = None if psel.fun == NrfFun.ASSUMED_GPIO: # We map unsupported values to GPIO CTRLSEL - ctrlsel_default = CTRLSEL_DEFAULT + return CTRLSEL_DEFAULT periph_addr = dt_reg_addr(prop.node, secure=True) - return self._lookup_ctrlsel(periph_addr, psel, ctrlsel_default=ctrlsel_default) + return self._lookup_ctrlsel(periph_addr, psel) def _lookup_ctrlsel( self, periph_addr: int, prop_or_psel: NrfPsel | GpiosProp, - ctrlsel_default: Ctrlsel | None = None, ) -> Ctrlsel | None: - ctrlsel = ctrlsel_default + ctrlsel = None if periph_addr in self.ctrlsel_lookup: ident_lut = self.ctrlsel_lookup[periph_addr] From ebc48bae569cfee1c88f50bf4209f86fd073e93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0859/3334] Revert "[nrf fromlist] drivers: hwinfo: nrf: fix missing reset reasons for nRF5340 Network" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c09c6abd11695d6b9c2ea24c4e88822eee9ff3f9. Signed-off-by: Tomasz Moń --- drivers/hwinfo/hwinfo_nrf.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index 143a7bd200b0..3d3314ddf581 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -160,22 +160,16 @@ int z_impl_hwinfo_get_reset_cause(uint32_t *cause) flags |= RESET_CLOCK; } #endif -#if NRFX_RESET_REASON_HAS_LSREQ +#if NRFX_RESET_REASON_HAS_NETWORK if (reason & NRFX_RESET_REASON_LSREQ_MASK) { flags |= RESET_SOFTWARE; } -#endif -#if NRFX_RESET_REASON_HAS_LLOCKUP if (reason & NRFX_RESET_REASON_LLOCKUP_MASK) { flags |= RESET_CPU_LOCKUP; } -#endif -#if NRFX_RESET_REASON_HAS_LDOG if (reason & NRFX_RESET_REASON_LDOG_MASK) { flags |= RESET_WATCHDOG; } -#endif -#if NRFX_RESET_REASON_HAS_LCTRLAP if (reason & NRFX_RESET_REASON_LCTRLAP_MASK) { flags |= RESET_DEBUG; } From d6e4ddec39a8451c1a184fc1573b819c0b53039e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0860/3334] Revert "[nrf fromtree] debug: coredump: stack top limit for current thread" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 11b28c9111b91c280df268ce58a66d1ef152cdeb. Signed-off-by: Tomasz Moń --- subsys/debug/coredump/Kconfig | 33 ++++++++---------------- subsys/debug/coredump/coredump_core.c | 36 ++++++++++----------------- 2 files changed, 23 insertions(+), 46 deletions(-) diff --git a/subsys/debug/coredump/Kconfig b/subsys/debug/coredump/Kconfig index c311e706f0c3..c4e93605988d 100644 --- a/subsys/debug/coredump/Kconfig +++ b/subsys/debug/coredump/Kconfig @@ -151,33 +151,20 @@ config DEBUG_COREDUMP_THREAD_STACK_TOP DEBUG_COREDUMP_MEMORY_DUMP_THREADS depends on ARCH_SUPPORTS_COREDUMP_STACK_PTR help - Dump only the top part of each thread's stack instead of the entire - stack region. The top of the stack is defined as the area starting - from the stack pointer and extending up to the smaller of the stack - end or the limit configured by either - DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT (for the current - thread) or DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT (for remaining ones). - -if DEBUG_COREDUMP_THREAD_STACK_TOP - -config DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT - int "Stack top size limit for current thread" - default DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT - help - The maximum number of stack bytes to be dumped for the thread running - when the exception occurred. - A negative value indicates that there is no limit, meaning that the - stack is dumped till the end of its region. + This option enables dumping only the top portion of each thread's + stack, rather than the entire stack region. The top of the stack is + defined as the area from the stack pointer to the stack end, but the + size of this region can additionally be constrained using the + DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT option. config DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT - int "Stack top size limit for non-current threads" + int "Stack top size limit" default -1 + depends on DEBUG_COREDUMP_THREAD_STACK_TOP help - The maximum number of stack bytes to be dumped for threads that were - not running when the exception occurred. - A negative value indicates that there is no limit, meaning that the - stack is dumped till the end of its region. + See the description of the DEBUG_COREDUMP_THREAD_STACK_TOP option. + The value -1 indicates that there is no limit, meaning that the stack + is dumped till the end of its region. -endif # DEBUG_COREDUMP_THREAD_STACK_TOP endif # DEBUG_COREDUMP diff --git a/subsys/debug/coredump/coredump_core.c b/subsys/debug/coredump/coredump_core.c index 797e92b87602..fc56e4cf3b6e 100644 --- a/subsys/debug/coredump/coredump_core.c +++ b/subsys/debug/coredump/coredump_core.c @@ -41,16 +41,8 @@ static struct coredump_backend_api #define DT_DRV_COMPAT zephyr_coredump #endif -#if defined(CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT) && \ - CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT >= 0 -#define STACK_TOP_LIMIT_FOR_CURRENT \ - ((size_t)CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT_FOR_CURRENT) -#else -#define STACK_TOP_LIMIT_FOR_CURRENT SIZE_MAX -#endif - #if defined(CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT) && \ - CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT >= 0 + CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT > 0 #define STACK_TOP_LIMIT ((size_t)CONFIG_DEBUG_COREDUMP_THREAD_STACK_TOP_LIMIT) #else #define STACK_TOP_LIMIT SIZE_MAX @@ -88,11 +80,10 @@ static void dump_header(unsigned int reason) #if defined(CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN) || \ defined(CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_THREADS) -static inline void select_stack_region(const struct k_thread *thread, bool is_current, - uintptr_t *start, uintptr_t *end) +static inline void select_stack_region(const struct k_thread *thread, uintptr_t *start, + uintptr_t *end) { uintptr_t sp; - size_t limit; *start = thread->stack_info.start; *end = thread->stack_info.start + thread->stack_info.size; @@ -108,12 +99,11 @@ static inline void select_stack_region(const struct k_thread *thread, bool is_cu *start = sp; } - /* Make sure no more than STACK_TOP_LIMIT[_FOR_CURRENT] bytes of the stack are dumped. */ - limit = (is_current ? STACK_TOP_LIMIT_FOR_CURRENT : STACK_TOP_LIMIT); - *end = *start + MIN((size_t)(*end - *start), limit); + /* Make sure no more than STACK_TOP_LIMIT bytes of the stack are dumped. */ + *end = *start + MIN((size_t)(*end - *start), STACK_TOP_LIMIT); } -static void dump_thread(struct k_thread *thread, bool is_current) +static void dump_thread(struct k_thread *thread) { uintptr_t start_addr; uintptr_t end_addr; @@ -132,7 +122,7 @@ static void dump_thread(struct k_thread *thread, bool is_current) end_addr = start_addr + sizeof(*thread); coredump_memory_dump(start_addr, end_addr); - select_stack_region(thread, is_current, &start_addr, &end_addr); + select_stack_region(thread, &start_addr, &end_addr); coredump_memory_dump(start_addr, end_addr); #if defined(CONFIG_DEBUG_COREDUMP_DUMP_THREAD_PRIV_STACK) @@ -150,7 +140,7 @@ static void process_coredump_dev_memory(const struct device *dev) } #endif -void process_memory_region_list(struct k_thread *current) +void process_memory_region_list(void) { #ifdef CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_LINKER_RAM unsigned int idx = 0; @@ -174,10 +164,10 @@ void process_memory_region_list(struct k_thread *current) * Content of _kernel.threads not being modified during dump * capture so no need to lock z_thread_monitor_lock. */ - struct k_thread *thread; + struct k_thread *current; - for (thread = _kernel.threads; thread; thread = thread->next_thread) { - dump_thread(thread, thread == current); + for (current = _kernel.threads; current; current = current->next_thread) { + dump_thread(current); } /* Also add interrupt stack, in case error occurred in an interrupt */ @@ -226,11 +216,11 @@ void coredump(unsigned int reason, const struct arch_esf *esf, if (thread != NULL) { #ifdef CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN - dump_thread(thread, /* is_current */ true); + dump_thread(thread); #endif } - process_memory_region_list(thread); + process_memory_region_list(); z_coredump_end(); } From a76ccffe2adeb538cf3ebbfc46ab2788febf3303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0861/3334] Revert "[nrf fromlist] manifest: Update hal_nordic with GPPI helper changes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 084b65b8f4e8b30b1d0b3b12a363f9b52b315c06. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 26335c8499e0..c8ba828de24a 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 0dbbf4794156ca09dc2d4bad8c42dcdb54acd662 + revision: e891e1cda4db109c6816cc929dda4f6a18e3e1bc path: modules/hal/nordic groups: - hal From 91f5832b8eeaa94461c3355167f38833782c1083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0862/3334] Revert "[nrf fromlist] soc: nordic: nrf54h: Add support for local cpurad GPPI" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a8d610e99d8c00cad9d00b9ce52bf71fd08e430b. Signed-off-by: Tomasz Moń --- soc/nordic/common/Kconfig.peripherals | 3 +- soc/nordic/common/gppi_init.c | 17 ------ soc/nordic/nrf54h/CMakeLists.txt | 4 -- soc/nordic/nrf54h/nrfx_gppi_cpurad.c | 83 --------------------------- soc/nordic/nrf54h/nrfx_gppi_cpurad.h | 26 --------- 5 files changed, 1 insertion(+), 132 deletions(-) delete mode 100644 soc/nordic/nrf54h/nrfx_gppi_cpurad.c delete mode 100644 soc/nordic/nrf54h/nrfx_gppi_cpurad.h diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index bbfa2c2560a1..f15702fa291b 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -42,8 +42,7 @@ config HAS_HW_NRF_DCNF def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DCNF)) config HAS_HW_NRF_DPPIC - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC)) || \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC_LOCAL)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC)) config HAS_HW_NRF_ECB def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_ECB)) diff --git a/soc/nordic/common/gppi_init.c b/soc/nordic/common/gppi_init.c index cb88479b0d51..98915491041b 100644 --- a/soc/nordic/common/gppi_init.c +++ b/soc/nordic/common/gppi_init.c @@ -7,8 +7,6 @@ #include #if defined(NRFX_GPPI_MULTI_DOMAIN) && !defined(NRFX_GPPI_FIXED_CONNECTIONS) #include -#elif defined(CONFIG_SOC_NRF54H20_CPURAD) -#include #endif static int gppi_init(void) @@ -49,21 +47,6 @@ static int gppi_init(void) NRFX_BIT_MASK(DPPIC20_GROUP_NUM_SIZE) & ~NRFX_DPPI20_GROUPS_USED); nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC30, NRFX_BIT_MASK(DPPIC30_GROUP_NUM_SIZE) & ~NRFX_DPPI30_GROUPS_USED); -#elif defined(CONFIG_SOC_NRF54H20_CPURAD) - gppi_instance.routes = nrfx_gppi_routes_get(); - gppi_instance.route_map = nrfx_gppi_route_map_get(); - gppi_instance.nodes = nrfx_gppi_nodes_get(); - - nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC020, - NRFX_BIT_MASK(DPPIC020_CH_NUM_SIZE) & ~NRFX_DPPI020_CHANNELS_USED); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC030, - NRFX_BIT_MASK(DPPIC030_CH_NUM_SIZE) & ~NRFX_DPPI030_CHANNELS_USED); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB020_030, - NRFX_BIT_MASK(PPIB020_NTASKSEVENTS_SIZE)); - nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC020, - NRFX_BIT_MASK(DPPIC020_GROUP_NUM_SIZE) & ~NRFX_DPPI020_GROUPS_USED); - nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC030, - NRFX_BIT_MASK(DPPIC030_GROUP_NUM_SIZE) & ~NRFX_DPPI030_GROUPS_USED); #else #error "Not supported" #endif diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 59c62b0b48a3..25e4796a4169 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -17,10 +17,6 @@ if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) endif() -if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) - zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_CPURAD nrfx_gppi_cpurad.c) -endif() - zephyr_include_directories(.) # Ensure that image size aligns with 16 bytes so that MRAMC finalizes all writes diff --git a/soc/nordic/nrf54h/nrfx_gppi_cpurad.c b/soc/nordic/nrf54h/nrfx_gppi_cpurad.c deleted file mode 100644 index 44bda829f8c3..000000000000 --- a/soc/nordic/nrf54h/nrfx_gppi_cpurad.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include "nrfx_gppi_cpurad.h" - -static nrfx_atomic_t channels[NRFX_GPPI_NODE_COUNT]; -static nrfx_atomic_t group_channels[NRFX_GPPI_NODE_DPPI_COUNT]; - -static const nrfx_gppi_node_t nodes[] = { - NRFX_GPPI_DPPI_NODE_DEFINE(020, NRFX_GPPI_NODE_DPPIC020), - NRFX_GPPI_DPPI_NODE_DEFINE(030, NRFX_GPPI_NODE_DPPIC030), - NRFX_GPPI_PPIB_NODE_DEFINE(020, 030), -}; - -static const nrfx_gppi_route_t dppi_routes[] = { - NRFX_GPPI_ROUTE_DEFINE("slow_rad", (&nodes[NRFX_GPPI_NODE_DPPIC020])), - NRFX_GPPI_ROUTE_DEFINE("fast_rad", (&nodes[NRFX_GPPI_NODE_DPPIC030])), - NRFX_GPPI_ROUTE_DEFINE("slow_fast_rad", - (&nodes[NRFX_GPPI_NODE_DPPIC020], - &nodes[NRFX_GPPI_NODE_PPIB020_030], - &nodes[NRFX_GPPI_NODE_DPPIC030])), -}; - -static const nrfx_gppi_route_t *slow_rad_routes[] = { - &dppi_routes[0], &dppi_routes[2] -}; - -static const nrfx_gppi_route_t *fast_rad_routes[] = { - &dppi_routes[1] -}; - -static const nrfx_gppi_route_t **dppi_route_map[] = { - slow_rad_routes, fast_rad_routes -}; - -uint32_t nrfx_gppi_domain_id_get(uint32_t addr) -{ - uint32_t domain = (addr >> 24) & BIT_MASK(3); - uint32_t bus = (addr >> 16) & BIT_MASK(8); - - (void)domain; - __ASSERT_NO_MSG(domain == 3); - switch (bus) { - case 2: - return NRFX_GPPI_NODE_DPPIC020; - case 3: - return NRFX_GPPI_NODE_DPPIC030; - default: - __ASSERT_NO_MSG(0); - return 0; - } -} - -const nrfx_gppi_route_t ***nrfx_gppi_route_map_get(void) -{ - return dppi_route_map; -} - -const nrfx_gppi_route_t *nrfx_gppi_routes_get(void) -{ - return dppi_routes; -} - -const nrfx_gppi_node_t *nrfx_gppi_nodes_get(void) -{ - return nodes; -} - -void nrfx_gppi_channel_init(nrfx_gppi_node_id_t node_id, uint32_t ch_mask) -{ - NRFX_ASSERT(node_id < NRFX_GPPI_NODE_COUNT); - - *nodes[node_id].generic.p_channels = ch_mask; -} - -void nrfx_gppi_groups_init(nrfx_gppi_node_id_t node_id, uint32_t group_mask) -{ - NRFX_ASSERT(node_id < NRFX_GPPI_NODE_DPPI_COUNT); - - *nodes[node_id].dppi.p_group_channels = group_mask; -} diff --git a/soc/nordic/nrf54h/nrfx_gppi_cpurad.h b/soc/nordic/nrf54h/nrfx_gppi_cpurad.h deleted file mode 100644 index 3d3076b5cafd..000000000000 --- a/soc/nordic/nrf54h/nrfx_gppi_cpurad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ -#define SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ - -#include - -typedef enum { - NRFX_GPPI_NODE_DPPIC020, - NRFX_GPPI_NODE_DPPIC030, - NRFX_GPPI_NODE_DPPI_COUNT, - NRFX_GPPI_NODE_PPIB020_030 = NRFX_GPPI_NODE_DPPI_COUNT, - NRFX_GPPI_NODE_COUNT -} nrfx_gppi_node_id_t; - -const nrfx_gppi_route_t ***nrfx_gppi_route_map_get(void); -const nrfx_gppi_route_t *nrfx_gppi_routes_get(void); -const nrfx_gppi_node_t *nrfx_gppi_nodes_get(void); -void nrfx_gppi_channel_init(nrfx_gppi_node_id_t node_id, uint32_t ch_mask); -void nrfx_gppi_groups_init(nrfx_gppi_node_id_t node_id, uint32_t group_mask); - -#endif /* SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ */ From bbf94d259f456f1d512bcea605d3fff6253a5973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0863/3334] Revert "[nrf fromtree] dts: vendor: nordic: nrf54lm20a: Fix invalid reg for USB" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 32a0efc4684705890b84fb824f91b6109539d3b0. Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf54lm20a.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index f4b6be2a2352..d396e17e0cd6 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -226,7 +226,7 @@ usbhs: usbhs@5a000 { compatible = "nordic,nrf-usbhs-nrf54l", "snps,dwc2"; - reg = <0x5a000 0x1000>, <0x20000 0x1a000>; + reg = <0x5a000 0x1000>, <0x50020000 0x1a000>; reg-names = "wrapper", "core"; interrupts = <90 NRF_DEFAULT_IRQ_PRIORITY>; num-in-eps = <16>; From e3283f4aa79ec82be673174548e1bd2e9acdaa54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0864/3334] Revert "[nrf fromtree] tests: drivers: uart: uart_async_api: fix execution at lm20/ns" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 18c1bc6ba28bc425f2567cf58f4c7353fca1b6eb. Signed-off-by: Tomasz Moń --- .../uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf | 1 - .../boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay | 1 - 2 files changed, 2 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay deleted file mode 100644 index 5210e41ef553..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay +++ /dev/null @@ -1 +0,0 @@ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 8f190a4a2ce7f0d8ee6745d2dd18c126a2a9c817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0865/3334] Revert "[nrf fromlist] tests: drivers: uart: async_api: Add overlay for nRF non-secure" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 59c9dfe8febeeb2431a676f2edffdb2894c83f48. Signed-off-by: Tomasz Moń --- .../uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 3 --- .../boards/nrf5340dk_nrf5340_cpuapp_ns.overlay | 7 ------- .../uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf | 4 ---- .../uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay | 7 ------- 4 files changed, 21 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf deleted file mode 100644 index 396d23ba5ae3..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay deleted file mode 100644 index dd40592f3b48..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf5340dk_nrf5340_cpuapp.overlay" diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf deleted file mode 100644 index 4f738f955e10..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_ARM_MPU=n -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay deleted file mode 100644 index 0048d6d052ce..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9160dk_nrf9160.overlay" From 1033d0eebe43819a41ff8cdad9236d7d3b8160ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0866/3334] Revert "[nrf fromtree] boards: nordic: nrf54lm20dk: enable debugging for flpr" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8d22a53efb9be1bf3fc197279f7d939ac08e1698. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54lm20dk/board.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake index f805e0d74112..6aaf6196d572 100644 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ b/boards/nordic/nrf54lm20dk/board.cmake @@ -2,9 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP) - board_runner_args(jlink "--device=nRF54LM20A_M33" "--speed=4000") + board_runner_args(jlink "--device=cortex-m33" "--speed=4000") elseif(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR) - board_runner_args(jlink "--device=nRF54LM20A_RV32" "--speed=4000") + board_runner_args(jlink "--speed=4000") endif() if(CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS) From e8aefb949a7fb9a6fb247e7d8f073ce94256e5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0867/3334] Revert "[nrf fromlist] bluetooth: buf: Fix callback protection for ISR context" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8c2f434f8e6788e542283f98d9f175140f2017a5. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/buf.h | 13 +++---------- subsys/bluetooth/host/buf.c | 26 ++++++++++---------------- subsys/bluetooth/host/iso.c | 12 ++++-------- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/include/zephyr/bluetooth/buf.h b/include/zephyr/bluetooth/buf.h index 9e6553f067cc..534c75559183 100644 --- a/include/zephyr/bluetooth/buf.h +++ b/include/zephyr/bluetooth/buf.h @@ -196,22 +196,15 @@ struct net_buf *bt_buf_get_rx(enum bt_buf_type type, k_timeout_t timeout); * @ref bt_buf_get_rx function. However, this callback is called from the context of the buffer * freeing operation and must not attempt to allocate a new buffer from the same pool. * - * This callback must only be used for very short non-blocking operations (e.g. submitting a work - * item). When called from thread context, the scheduler is locked during execution and the - * callee must not perform any action that makes the current thread unready. When called from ISR - * context, the callback runs without scheduler lock. - * - * @funcprops \isr_ok + * @warning When this callback is called, the scheduler is locked and the callee must not perform + * any action that makes the current thread unready. This callback must only be used for very + * short non-blocking operation (e.g. submitting a work item). * * @param type_mask A bit mask of buffer types that have been freed. */ typedef void (*bt_buf_rx_freed_cb_t)(enum bt_buf_type type_mask); /** Set the callback to notify about freed buffer in the incoming data pool. - * - * It's safe to call this inside the callback itself. - * - * @funcprops \isr_ok * * @param cb Callback to notify about freed buffer in the incoming data pool. If NULL, the callback * is disabled. diff --git a/subsys/bluetooth/host/buf.c b/subsys/bluetooth/host/buf.c index 688134f1b997..ade372504243 100644 --- a/subsys/bluetooth/host/buf.c +++ b/subsys/bluetooth/host/buf.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -37,26 +36,17 @@ LOG_MODULE_REGISTER(bt_buf, CONFIG_BT_LOG_LEVEL); */ #define SYNC_EVT_SIZE (BT_BUF_RESERVE + BT_HCI_EVT_HDR_SIZE + 255) -static atomic_ptr_t buf_rx_freed_cb; +static bt_buf_rx_freed_cb_t buf_rx_freed_cb; static void buf_rx_freed_notify(enum bt_buf_type mask) { - bt_buf_rx_freed_cb_t cb; - bool in_isr = k_is_in_isr(); + k_sched_lock(); - if (!in_isr) { - k_sched_lock(); + if (buf_rx_freed_cb) { + buf_rx_freed_cb(mask); } - cb = (bt_buf_rx_freed_cb_t)atomic_ptr_get(&buf_rx_freed_cb); - - if (cb != NULL) { - cb(mask); - } - - if (!in_isr) { - k_sched_unlock(); - } + k_sched_unlock(); } #if defined(CONFIG_BT_ISO_RX) @@ -144,11 +134,15 @@ struct net_buf *bt_buf_get_rx(enum bt_buf_type type, k_timeout_t timeout) void bt_buf_rx_freed_cb_set(bt_buf_rx_freed_cb_t cb) { - atomic_ptr_set(&buf_rx_freed_cb, (void *)cb); + k_sched_lock(); + + buf_rx_freed_cb = cb; #if defined(CONFIG_BT_ISO_RX) bt_iso_buf_rx_freed_cb_set(cb != NULL ? iso_rx_freed_cb : NULL); #endif + + k_sched_unlock(); } struct net_buf *bt_buf_get_evt(uint8_t evt, bool discardable, diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index 25897420a973..a4f30a3ba0db 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -52,18 +52,14 @@ LOG_MODULE_REGISTER(bt_iso, CONFIG_BT_ISO_LOG_LEVEL); #define iso_chan(_iso) ((_iso)->iso.chan); #if defined(CONFIG_BT_ISO_RX) -static atomic_ptr_t buf_rx_freed_cb; +static bt_iso_buf_rx_freed_cb_t buf_rx_freed_cb; static void iso_rx_buf_destroy(struct net_buf *buf) { - bt_iso_buf_rx_freed_cb_t cb; - - cb = (bt_iso_buf_rx_freed_cb_t)atomic_ptr_get(&buf_rx_freed_cb); - net_buf_destroy(buf); - if (cb != NULL) { - cb(); + if (buf_rx_freed_cb) { + buf_rx_freed_cb(); } } @@ -646,7 +642,7 @@ struct net_buf *bt_iso_get_rx(k_timeout_t timeout) void bt_iso_buf_rx_freed_cb_set(bt_iso_buf_rx_freed_cb_t cb) { - atomic_ptr_set(&buf_rx_freed_cb, (void *)cb); + buf_rx_freed_cb = cb; } void bt_iso_recv(struct bt_conn *iso, struct net_buf *buf, uint8_t flags) From 1eb07650719552ff5faa1ffb9783f20388a975fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0868/3334] Revert "[nrf fromlist] drivers: i2s: nrf_tdm: Add guards for buffers size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c717584f1a66d914fd87128b3e3c8dd952c8725c. Signed-off-by: Tomasz Moń --- drivers/i2s/i2s_nrf_tdm.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index f1a691e0cefb..07c561b77503 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -32,11 +32,6 @@ LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); */ #define NRFX_TDM_STATUS_TRANSFER_STOPPED BIT(1) -/* Due to hardware limitations, the TDM peripheral requires the rx/tx size - * to be greater than 8 bytes. - */ -#define NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED 8 - /* Maximum clock divider value. Corresponds to CKDIV2. */ #define NRFX_TDM_MAX_SCK_DIV_VALUE TDM_CONFIG_SCK_DIV_SCKDIV_Max #define NRFX_TDM_MAX_MCK_DIV_VALUE TDM_CONFIG_MCK_DIV_DIV_Max @@ -480,10 +475,8 @@ static int tdm_nrf_configure(const struct device *dev, enum i2s_dir dir, __ASSERT_NO_MSG(tdm_cfg->mem_slab != NULL && tdm_cfg->block_size != 0); - if ((tdm_cfg->block_size % sizeof(uint32_t)) != 0 || - tdm_cfg->block_size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) { - LOG_ERR("This device can only transmit full 32-bit words greater than %u bytes.", - NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED); + if ((tdm_cfg->block_size % sizeof(uint32_t)) != 0) { + LOG_ERR("This device can transfer only full 32-bit words"); return -EINVAL; } @@ -680,18 +673,11 @@ static int tdm_nrf_write(const struct device *dev, void *mem_block, size_t size) return -EIO; } - if (size > drv_data->tx.cfg.block_size) { + if (size > drv_data->tx.cfg.block_size || size < sizeof(uint32_t)) { LOG_ERR("This device can only write blocks up to %u bytes", drv_data->tx.cfg.block_size); return -EIO; } - - if ((size % sizeof(uint32_t)) != 0 || size <= NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED) { - LOG_ERR("This device can only write full 32-bit words greater than %u bytes.", - NRFX_TDM_MIN_TRANSFER_SIZE_ALLOWED); - return -EIO; - } - ret = dmm_buffer_out_prepare(drv_cfg->mem_reg, buf.mem_block, buf.size, (void **)&buf.dmm_buf); ret = k_msgq_put(&drv_data->tx_queue, &buf, SYS_TIMEOUT_MS(drv_data->tx.cfg.timeout)); From f3c6b7a4f10c9364165872436822f46135c14ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0869/3334] Revert "[nrf fromlist] docs: Bluetooth: Mesh: Add Static OOB entropy requirement" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a6b10d81b424c927ab76fe2e5d3a7bccb4359ad. Signed-off-by: Tomasz Moń --- doc/connectivity/bluetooth/api/mesh/provisioning.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/connectivity/bluetooth/api/mesh/provisioning.rst b/doc/connectivity/bluetooth/api/mesh/provisioning.rst index e595feaf529f..311904882078 100644 --- a/doc/connectivity/bluetooth/api/mesh/provisioning.rst +++ b/doc/connectivity/bluetooth/api/mesh/provisioning.rst @@ -124,9 +124,7 @@ provisionee: * **Static OOB:** An authentication value is assigned to the device in production, which the provisioner can query in some application specific - way. For secure provisioning with the BTM_ECDH_P256_HMAC_SHA256_AES_CCM - algorithm, the Static OOB value should contain more than 128 bits of entropy - to provide adequate security against attacks. + way. * **Input OOB:** The user inputs the authentication value. The available input actions are listed in :c:enum:`bt_mesh_input_action_t`. * **Output OOB:** Show the user the authentication value. The available output From d537c3feea2b0fe0060ac9de394b96c590c03f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:25 +0100 Subject: [PATCH 0870/3334] Revert "[nrf fromlist] bluetooth: mesh: lpn shouldn't relay messages received over friendship" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 66cda9da197b27272cd50fbdb788620c70b05bd5. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/net.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/subsys/bluetooth/mesh/net.c b/subsys/bluetooth/mesh/net.c index f85f3e7a050c..d791ba46f9ab 100644 --- a/subsys/bluetooth/mesh/net.c +++ b/subsys/bluetooth/mesh/net.c @@ -924,13 +924,10 @@ void bt_mesh_net_recv(struct net_buf_simple *data, int8_t rssi, } /* Relay if this was a group/virtual address, or if the destination - * was neither a local element nor an LPN we're Friends for, and - * device is not in Friendship as the Low Power node or the message is not encrypted using - * friendship security credentials. + * was neither a local element nor an LPN we're Friends for. */ - if ((!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) || - (!rx.local_match && !rx.friend_match)) && - (!bt_mesh_lpn_established() || !rx.friend_cred)) { + if (!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) || + (!rx.local_match && !rx.friend_match)) { net_buf_simple_restore(&buf, &state); bt_mesh_net_relay(&buf, &rx, false); } From c548cd47437f8d69ec5bf1c3fd3cffdaf92c8759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0871/3334] Revert "[nrf fromlist] modules: tf-m: Add syscall header dependency for TF-M" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fc695cbbf493d4a50e6d6c48fb0d87ebaebba998. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 0add755cdc67..5e066130b262 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -420,10 +420,6 @@ if (CONFIG_BUILD_WITH_TFM) ${TFM_INTERFACE_LIB_DIR}/s_veneers.o ) - # Ensure that the generated syscall include headers of Zephyr are available to TF-M - # because some platforms might use the same source files for both builds. - add_dependencies(tfm ${SYSCALL_LIST_H_TARGET}) - # To ensure that generated include files are created before they are used. add_dependencies(zephyr_interface tfm) From 227bed863741435ed015a2d6cc7072968c7c8fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0872/3334] Revert "[nrf fromtree] tests: bluetooth: tester: Start stream from connected_cb" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ed09d97b549002e9534e23827b4e190ce6b1e40d. Signed-off-by: Tomasz Moń --- .../tester/src/audio/btp_bap_unicast.c | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index c7c770ddca00..449ac8076cae 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -693,21 +693,21 @@ static void stream_started_cb(struct bt_bap_stream *stream) static void stream_connected_cb(struct bt_bap_stream *stream) { struct bt_conn_info conn_info; - struct bt_bap_ep_info ep_info; - int err; LOG_DBG("Connected stream %p", stream); - err = bt_bap_ep_get_info(stream->ep, &ep_info); - if (err != 0) { - LOG_ERR("Failed to get info: %d", err); + (void)bt_conn_get_info(stream->conn, &conn_info); + if (conn_info.role == BT_HCI_ROLE_CENTRAL) { + struct bt_bap_ep_info ep_info; + int err; - return; - } + err = bt_bap_ep_get_info(stream->ep, &ep_info); + if (err != 0) { + LOG_ERR("Failed to get info: %d", err); - (void)bt_conn_get_info(stream->conn, &conn_info); + return; + } - if (conn_info.role == BT_HCI_ROLE_CENTRAL) { if (ep_info.dir == BT_AUDIO_DIR_SOURCE) { if (ep_info.state == BT_BAP_EP_STATE_ENABLING) { /* Automatically do the receiver start ready operation for source @@ -727,18 +727,6 @@ static void stream_connected_cb(struct bt_bap_stream *stream) BT_ASCS_START_OP, BTP_ASCS_STATUS_SUCCESS); } - } else { - if (ep_info.dir == BT_AUDIO_DIR_SINK && ep_info.state == BT_BAP_EP_STATE_ENABLING) { - /* Automatically do the receiver start ready operation for sink - * ASEs as the server when in the enabling state. - * The CIS may be connected in the QoS Configured state as well, in - * which case we should wait until we enter the enabling state. - */ - err = bt_bap_stream_start(stream); - if (err != 0) { - LOG_ERR("Failed to start stream %p", stream); - } - } } btp_send_ascs_cis_connected_ev(stream); From b7c8a2e9c53ca0ecb75816d9e5161f5b60a21b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0873/3334] Revert "[nrf fromlist] modules: hal_nordic: nrfx: change symbol for pinreset GPIO" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f3cc078cbe9761282c83b5c6059fd66097ed62c0. Signed-off-by: Tomasz Moń --- modules/hal_nordic/nrfx/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 0ebc92918a3a..bc85b79fbe4e 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -200,9 +200,7 @@ if(DEFINED uicr_path) dt_prop(gpio_as_nreset PATH ${uicr_path} PROPERTY "gpio-as-nreset") if(${gpio_as_nreset}) - zephyr_library_compile_definitions( - NRF_CONFIG_GPIO_AS_PINRESET - ) + zephyr_library_compile_definitions(CONFIG_GPIO_AS_PINRESET) endif() endif() From b39dfac591950b5d465550983cf41f840aee5395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0874/3334] Revert "[nrf fromlist] modules: hal_nordic: nrfx: allow SWD pins as GPIOs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 361cc498f8a9b2978267940b37e63343863fbc83. Signed-off-by: Tomasz Moń --- modules/hal_nordic/nrfx/CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index bc85b79fbe4e..8f6411a93b41 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -204,16 +204,6 @@ if(DEFINED uicr_path) endif() endif() -dt_nodelabel(tampc_path NODELABEL "tampc") -if(DEFINED tampc_path) - dt_prop(swd_pins_as_gpios PATH ${tampc_path} PROPERTY "swd-pins-as-gpios") - if(${swd_pins_as_gpios}) - zephyr_library_compile_definitions( - NRF_CONFIG_SWD_PINS_AS_GPIOS - ) - endif() -endif() - if(CONFIG_SOC_NRF54L_CPUAPP_COMMON) # Ideally, hfpll should taken as a phandle from clocks property from cpu but it # seems that there is no such option in DT cmake functions. Assuming that nrf54l From 2f3965df61525f8726be0479563d7cdd69a76631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0875/3334] Revert "[nrf fromlist] dts: bindings: arm: add binding for Nordic TAMPC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2f27d12709a281d754f2dfe5f1bc3effa8030ada. Signed-off-by: Tomasz Moń --- dts/bindings/arm/nordic,nrf-tampc.yaml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 dts/bindings/arm/nordic,nrf-tampc.yaml diff --git a/dts/bindings/arm/nordic,nrf-tampc.yaml b/dts/bindings/arm/nordic,nrf-tampc.yaml deleted file mode 100644 index f0b07d7acd8b..000000000000 --- a/dts/bindings/arm/nordic,nrf-tampc.yaml +++ /dev/null @@ -1,19 +0,0 @@ -description: Nordic TAMPC (Tamper Controller) - -compatible: "nordic,nrf-tampc" - -include: base.yaml - -properties: - reg: - required: true - - swd-pins-as-gpios: - type: boolean - description: | - When enabled this property will configure pins dedicated to SWD - peripheral as regular GPIOs. - - SWD pins in nRF54LS05B: P1.29 and P1.30 - - This setting, once applied, can only be unset by device reset. From cd4ce0d011a066e802106e01d39bb6cb7e6780e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0876/3334] Revert "[nrf fromlist] manifest: update hal_nordic to have nRF54l errata 55 fixed" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d2bc88b13d5e8f142cd2abed9e5bdec51c0a7336. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index c8ba828de24a..50faba24d158 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: e891e1cda4db109c6816cc929dda4f6a18e3e1bc + revision: 564e754139944286208f3eac122781cec4262392 path: modules/hal/nordic groups: - hal From 83c9e82186a9122b18e6720217731dd92363a3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0877/3334] Revert "[nrf fromtree] bluetooth: host: Fix stale RPA usage after invalidation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 16d748b0c1da1df237c6e36e721033468a4d0303. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 4c8ed649fa91..3a17a7192535 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1566,16 +1566,13 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, if (IS_ENABLED(CONFIG_BT_PRIVACY) && !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && (!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED) || - atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || - !atomic_test_bit(adv->flags, BT_ADV_RPA_VALID))) { + atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED))) { bt_id_set_adv_private_addr(adv); } } else { if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && (!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED) || - atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || - (IS_ENABLED(CONFIG_BT_PRIVACY) && - !atomic_test_bit(adv->flags, BT_ADV_RPA_VALID)))) { + atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED))) { bt_id_set_adv_private_addr(adv); } } From babf11549d6d83ff2af92c8094da23830d53e27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0878/3334] Revert "[nrf fromtree] tests: bluetooth: tester: add support for wid 145 and 167" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 52a2bcec84504d5ace12641b90b1257e9a28ab19. Signed-off-by: Tomasz Moń --- tests/bluetooth/tester/src/btp/btp_gatt.h | 15 ----- tests/bluetooth/tester/src/btp_gatt.c | 76 ----------------------- 2 files changed, 91 deletions(-) diff --git a/tests/bluetooth/tester/src/btp/btp_gatt.h b/tests/bluetooth/tester/src/btp/btp_gatt.h index b31371948f5b..1eef848aa30e 100644 --- a/tests/bluetooth/tester/src/btp/btp_gatt.h +++ b/tests/bluetooth/tester/src/btp/btp_gatt.h @@ -347,21 +347,6 @@ struct btp_gatt_cfg_notify_mult_cmd { uint16_t cnt; uint16_t attr_id[]; } __packed; - -#define BTP_GATT_GET_HANDLE_FROM_UUID 0x22 -struct btp_gatt_get_handle_from_uuid_cmd { - uint8_t uuid_length; - uint8_t uuid[]; -} __packed; -struct btp_gatt_get_handle_from_uuid_rp { - uint16_t handle; -} __packed; - -#define BTP_GATT_REMOVE_HANDLE_FROM_DB 0x23 -struct btp_gatt_remove_handle_from_db_cmd { - uint16_t handle; -} __packed; - /* GATT events */ #define BTP_GATT_EV_NOTIFICATION 0x80 struct btp_gatt_notification_ev { diff --git a/tests/bluetooth/tester/src/btp_gatt.c b/tests/bluetooth/tester/src/btp_gatt.c index efd729751228..e487dd2884d1 100644 --- a/tests/bluetooth/tester/src/btp_gatt.c +++ b/tests/bluetooth/tester/src/btp_gatt.c @@ -452,7 +452,6 @@ static int alloc_characteristic(struct add_characteristic *ch) chrc_data->uuid = attr_value->uuid; ch->char_id = attr_chrc->handle; - return 0; } @@ -2132,71 +2131,6 @@ static uint8_t notify_mult(const void *cmd, uint16_t cmd_len, } #endif /* CONFIG_BT_GATT_NOTIFY_MULTIPLE */ -static uint8_t get_handle_from_uuid(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) -{ - const struct btp_gatt_get_handle_from_uuid_cmd *cp = cmd; - struct btp_gatt_get_handle_from_uuid_rp *rp = rsp; - struct bt_uuid search_uuid; - - if (btp2bt_uuid(cp->uuid, cp->uuid_length, &search_uuid)) { - return BTP_STATUS_FAILED; - } - - __maybe_unused char uuid_str[BT_UUID_STR_LEN]; - - bt_uuid_to_str(&search_uuid, uuid_str, sizeof(uuid_str)); - - LOG_DBG("Searching handle for UUID %s", uuid_str); - - for (int i = 0; i < attr_count; i++) { - if (server_db[i].uuid != NULL && - bt_uuid_cmp(server_db[i].uuid, &search_uuid) == 0) { - rp->handle = sys_cpu_to_le16(server_db[i].handle); - *rsp_len = sizeof(*rp); - - return BTP_STATUS_SUCCESS; - } - } - - LOG_DBG("No handle found"); - return BTP_STATUS_FAILED; -} - -static uint8_t remove_by_handle_from_db(const void *cmd, uint16_t cmd_len, void *rsp, - uint16_t *rsp_len) -{ - const struct btp_gatt_remove_handle_from_db_cmd *cp = cmd; - uint16_t handle = sys_le16_to_cpu(cp->handle); - - /* Search for the service that contains the attribute with the given handle and unregister - * it. - */ - - for (int i = 0; i < svc_count; i++) { - for (int j = 0; j < server_svcs[i].attr_count; j++) { - if (server_svcs[i].attrs[j].handle == handle) { - int err; - - err = bt_gatt_service_unregister(&server_svcs[i]); - if (err < 0 && err != -ENOENT) { - LOG_ERR("Failed to unregister service [%d]: %d", i, err); - return BTP_STATUS_FAILED; - } - - if (err == -ENOENT) { - LOG_WRN("Service [%d] already unregistered", i); - } else { - LOG_DBG("Service [%d] unregistered", i); - } - - return BTP_STATUS_SUCCESS; - } - } - } - - return BTP_STATUS_FAILED; -} - struct get_attrs_foreach_data { struct net_buf_simple *buf; const struct bt_uuid *uuid; @@ -2623,16 +2557,6 @@ static const struct btp_handler handlers[] = { .expect_len = BTP_HANDLER_LENGTH_VARIABLE, .func = notify_mult, }, - { - .opcode = BTP_GATT_GET_HANDLE_FROM_UUID, - .expect_len = BTP_HANDLER_LENGTH_VARIABLE, - .func = get_handle_from_uuid, - }, - { - .opcode = BTP_GATT_REMOVE_HANDLE_FROM_DB, - .expect_len = sizeof(struct btp_gatt_remove_handle_from_db_cmd), - .func = remove_by_handle_from_db, - }, }; uint8_t tester_init_gatt(void) From c324619f272572aa02422c3af3495aa0e53a27ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0879/3334] Revert "[nrf fromlist] soc: nordic: nrf_sys_event: handle errors correctly" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 796b28fa4b098a276322b31eca3516fc190af37a. Signed-off-by: Tomasz Moń --- soc/nordic/common/nrf_sys_event.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 972487c528d9..76664fe5f245 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -76,20 +76,12 @@ int nrf_sys_event_release_global_constlat(void) int nrf_sys_event_request_global_constlat(void) { - int err; - - err = nrfx_power_constlat_mode_request(); - - return (err == 0 || err == -EALREADY) ? 0 : -EAGAIN; + return nrfx_power_constlat_mode_request(); } int nrf_sys_event_release_global_constlat(void) { - int err; - - err = nrfx_power_constlat_mode_free(); - - return (err == 0 || err == -EBUSY) ? 0 : -EAGAIN; + return nrfx_power_constlat_mode_free(); } #endif From 7e4a4de327b61a2eedf5731fb6f2a951ee8fae74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0880/3334] Revert "[nrf fromlist] drivers: pwm: nrf: fix nrfx instance being zeroed on suspend" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ace550c69dd6d6f37a428784dd2136e1c479edb8. Signed-off-by: Tomasz Moń --- drivers/pwm/pwm_nrfx.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index ef3c2c030ff8..2a97aa47dfdc 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -354,11 +354,7 @@ static int pwm_suspend(const struct device *dev) while (!nrfx_pwm_stopped_check(&data->pwm)) { } - /* Explicitly clear driver state that might be invalid after subsequent resume. */ - data->period_cycles = 0; - data->pwm_needed = 0; - data->prescaler = 0; - data->stop_requested = 0; + memset(dev->data, 0, sizeof(struct pwm_nrfx_data)); (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); return 0; From 60a4a36b5cd009a93b9be4ef7888fe34c7c7786d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0881/3334] Revert "[nrf fromtree] arch: riscv: core: vector_table alignement fix" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4e2203637031c09adb1b9fdab0e08b8f7146ae1f. Signed-off-by: Tomasz Moń --- arch/riscv/core/vector_table.ld | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/riscv/core/vector_table.ld b/arch/riscv/core/vector_table.ld index 5667b8935b8e..6a93082ed894 100644 --- a/arch/riscv/core/vector_table.ld +++ b/arch/riscv/core/vector_table.ld @@ -6,7 +6,6 @@ #if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) KEEP(*(.vectors.__start)) -. = ALIGN(CONFIG_ARCH_IRQ_VECTOR_TABLE_ALIGN); INCLUDE isr_tables_vt.ld #else KEEP(*(.vectors.*)) From 2632d51d7cb4e8d98dc7a178d9e89099c9f05701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0882/3334] Revert "[nrf fromtree] kernel: work: work timeout handler uninitialized variables fix" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b13f28165456210820b74cd2dc43d7066cc08a52. Signed-off-by: Tomasz Moń --- kernel/work.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/work.c b/kernel/work.c index 301d138fac7c..bcbb3b467166 100644 --- a/kernel/work.c +++ b/kernel/work.c @@ -606,8 +606,8 @@ bool k_work_cancel_sync(struct k_work *work, static void work_timeout_handler(struct _timeout *record) { struct k_work_q *queue = CONTAINER_OF(record, struct k_work_q, work_timeout_record); - struct k_work *work = NULL; - k_work_handler_t handler = NULL; + struct k_work *work; + k_work_handler_t handler; const char *name; const char *space = " "; From 5e37d1f6bb8fb3c086f81d9afadfc5ae43393280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0883/3334] Revert "[nrf fromtree] arch: riscv: core: vector_table: Fix local ISR generation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9cc2fcd8b3bbf72f1f95c9fda1e6f92569169d82. Signed-off-by: Tomasz Moń --- arch/riscv/core/vector_table.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/core/vector_table.ld b/arch/riscv/core/vector_table.ld index 6a93082ed894..8509ff8eb87c 100644 --- a/arch/riscv/core/vector_table.ld +++ b/arch/riscv/core/vector_table.ld @@ -5,8 +5,8 @@ */ #if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) -KEEP(*(.vectors.__start)) INCLUDE isr_tables_vt.ld +KEEP(*(.vectors.__start)) #else KEEP(*(.vectors.*)) #endif From 595ab0b722fefb3e9b9e2c7eae8994efeb53be94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0884/3334] Revert "[nrf fromlist] drivers: watchdog: wdt_nrfx: return expected error" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0783923a766da87024851b71030e1f70dd404b60. Signed-off-by: Tomasz Moń --- drivers/watchdog/wdt_nrfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/wdt_nrfx.c b/drivers/watchdog/wdt_nrfx.c index 3881f9b55d0c..fa1d45907c69 100644 --- a/drivers/watchdog/wdt_nrfx.c +++ b/drivers/watchdog/wdt_nrfx.c @@ -75,7 +75,7 @@ static int wdt_nrf_disable(const struct device *dev) if (err_code < 0) { /* This can only happen if wdt_nrf_setup() is not called first. */ - return -EFAULT; + return err_code; } #if defined(WDT_NRFX_SYNC_STOP) From f90b1dcb41492e8f639f69ee8f602cdfe68eef99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0885/3334] Revert "[nrf fromlist] drivers: nrf_wifi: Workaround for failing tests" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd5d9933d549b9dd19ba51c0fe14fd7d55e9e7cc. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/net_if.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index af3186d9e428..d4ce230ceeeb 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -441,16 +441,11 @@ int nrf_wifi_if_send(const struct device *dev, ra = nrf_wifi_util_get_ra(sys_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx], nbuf); peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, ra); if (peer_id == -1) { - /* TODO: Make this an error once we fix ping_work sending packets despite - * the interface being dormant - */ -#if CONFIG_WIFI_NRF70_LOG_LEVEL >= LOG_LEVEL_DBG char ra_buf[18] = {0}; - LOG_DBG("%s: Got packet for unknown PEER: %s", __func__, + LOG_ERR("%s: Got packet for unknown PEER: %s", __func__, nrf_wifi_sprint_ll_addr_buf(ra, 6, ra_buf, sizeof(ra_buf))); -#endif goto drop; } From b1dd6a1e973fa99d010ee3568087d59dd1ef168c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0886/3334] Revert "[nrf fromlist] modules: hostap: Fix SoF in softap mode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c063db382bf6f0357d78ed7ca56d1006d83f1f96. Signed-off-by: Tomasz Moń --- modules/hostap/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index ff8327609d0b..ec8263d85a6b 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -60,7 +60,7 @@ config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE # overflow issues. Need to identify the cause for higher stack usage. default 8192 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE # This is needed to handle stack overflow issues on nRF Wi-Fi drivers. - default 6144 if WIFI_NM_WPA_SUPPLICANT_AP + default 5900 if WIFI_NM_WPA_SUPPLICANT_AP default 5800 config WIFI_NM_WPA_SUPPLICANT_WQ_STACK_SIZE From 7b0b50fb195f9f435b8771e62647874bfc322955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:26 +0100 Subject: [PATCH 0887/3334] Revert "[nrf fromlist] manifest: Update nrf_wifi revision" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7bee8405d87f6830dd5d4fb2ffbc9de381085f14. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 50faba24d158..daa021a445f4 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 5eec7aca321735f5fc8e3e7c79e162f0e9810b16 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 97c6751657187ab811e73c36cc4c47acb1783fff + revision: a39e9b155830461c9d1cf587afb151b894369b91 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From c463641846a9ac71565c55adbe29b8d37b1a15d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0888/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Fix invalid pointer access" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 18f5a4efee5c161c1508fd6baae1a98ebf7093d1. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 1fae3d2cf2a4..4c98ef0d8aa0 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -875,6 +875,18 @@ int nrf_wifi_channel(const struct device *dev, return ret; } + for (i = 0; i < MAX_PEERS; i++) { + peer = &sys_dev_ctx->tx_config.peers[i]; + if (peer->peer_id == -1) { + continue; + } + if (peer->authorized) { + LOG_ERR("%s: Cannot change channel when in station connected mode", + __func__); + return ret; + } + } + rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; if (!rpu_ctx_zep) { LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); @@ -890,18 +902,6 @@ int nrf_wifi_channel(const struct device *dev, fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx); - for (i = 0; i < MAX_PEERS; i++) { - peer = &sys_dev_ctx->tx_config.peers[i]; - if (peer->peer_id == -1) { - continue; - } - if (peer->authorized) { - LOG_ERR("%s: Cannot change channel when in station connected mode", - __func__); - return ret; - } - } - if (channel->oper == WIFI_MGMT_SET) { /** * Send the driver vif_idx instead of upper layer sent if_index. From 4a6cfbac9bc9ee991e099ccd741468aa921442c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0889/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Add per-peer authorized flag" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 82fdbd10e12f7325c8d8e70aada5f93b4d6421cb. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 4 +- drivers/wifi/nrf_wifi/src/fmac_main.c | 55 ------------------------- drivers/wifi/nrf_wifi/src/net_if.c | 39 ++++-------------- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 32 ++++---------- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 46 +-------------------- 5 files changed, 19 insertions(+), 157 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 857205eeebbc..799beff1fbaf 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -75,7 +75,7 @@ struct nrf_wifi_vif_ctx_zep { #endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ struct net_stats_eth eth_stats; #endif /* CONFIG_NET_STATISTICS_ETHERNET */ -#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_TX) +#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) bool authorized; #endif #ifdef CONFIG_NRF70_STA_MODE @@ -154,8 +154,6 @@ void configure_tx_pwr_settings(struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_p void configure_board_dep_params(struct nrf_wifi_board_params *board_params); void set_tx_pwr_ceil_default(struct nrf_wifi_tx_pwr_ceil_params *pwr_ceil_params); const char *nrf_wifi_get_drv_version(void); -char *nrf_wifi_sprint_ll_addr_buf(const uint8_t *ll, uint8_t ll_len, - char *buf, int buflen); enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep); enum nrf_wifi_status nrf_wifi_fmac_dev_rem_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep); struct nrf_wifi_vif_ctx_zep *nrf_wifi_get_vif_ctx(struct net_if *iface); diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index ed6e425e98fe..9e8ae2aafb93 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -114,61 +114,6 @@ static const unsigned int rx3_buf_sz = 1000; struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; static K_MUTEX_DEFINE(reg_lock); -/** - * @brief Format a link layer address to a string buffer. - * - * @param ll Pointer to the link layer address bytes. - * @param ll_len Length of the link layer address (typically 6 for MAC). - * @param buf Buffer to store the formatted string. - * @param buflen Size of the buffer. - * - * @return Pointer to the buffer on success, NULL on failure. - */ -char *nrf_wifi_sprint_ll_addr_buf(const uint8_t *ll, uint8_t ll_len, - char *buf, int buflen) -{ - uint8_t i, len, blen; - char *ptr = buf; - - if (ll == NULL) { - return ""; - } - - switch (ll_len) { - case 8: - len = 8U; - break; - case 6: - len = 6U; - break; - case 2: - len = 2U; - break; - default: - len = 6U; - break; - } - - for (i = 0U, blen = buflen; i < len && blen > 0; i++) { - uint8_t high = (ll[i] >> 4) & 0x0f; - uint8_t low = ll[i] & 0x0f; - - *ptr++ = (high < 10) ? (char)(high + '0') : - (char)(high - 10 + 'A'); - *ptr++ = (low < 10) ? (char)(low + '0') : - (char)(low - 10 + 'A'); - *ptr++ = ':'; - blen -= 3U; - } - - if (!(ptr - buf)) { - return NULL; - } - - *(ptr - 1) = '\0'; - return buf; -} - const char *nrf_wifi_get_drv_version(void) { return NRF70_DRIVER_VERSION; diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index d4ce230ceeeb..0662c6c80d09 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -25,12 +25,14 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include "util.h" #include "common/fmac_util.h" -#include "system/fmac_peer.h" #include "shim.h" #include "fmac_main.h" #include "wpa_supp_if.h" #include "net_if.h" +extern char *net_sprint_ll_addr_buf(const uint8_t *ll, uint8_t ll_len, + char *buf, int buflen); + #ifdef CONFIG_NRF70_STA_MODE static struct net_if_mcast_monitor mcast_monitor; #endif /* CONFIG_NRF70_STA_MODE */ @@ -386,9 +388,6 @@ int nrf_wifi_if_send(const struct device *dev, struct rpu_host_stats *host_stats = NULL; void *nbuf = NULL; bool locked = false; - unsigned char *ra = NULL; - int peer_id = -1; - bool authorized; if (!dev || !pkt) { LOG_ERR("%s: vif_ctx_zep is NULL", __func__); @@ -437,30 +436,12 @@ int nrf_wifi_if_send(const struct device *dev, nbuf); } else { #endif /* CONFIG_NRF70_RAW_DATA_TX */ - - ra = nrf_wifi_util_get_ra(sys_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx], nbuf); - peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, ra); - if (peer_id == -1) { - char ra_buf[18] = {0}; - - LOG_ERR("%s: Got packet for unknown PEER: %s", __func__, - nrf_wifi_sprint_ll_addr_buf(ra, 6, ra_buf, - sizeof(ra_buf))); - goto drop; - } - - /* VIF or per-peer depending on RA */ - if (peer_id == MAX_PEERS) { - authorized = vif_ctx_zep->authorized; - } else { - authorized = sys_dev_ctx->tx_config.peers[peer_id].authorized; - } - if ((vif_ctx_zep->if_carr_state != NRF_WIFI_FMAC_IF_CARR_STATE_ON) || - (!authorized && !is_eapol(pkt))) { + (!vif_ctx_zep->authorized && !is_eapol(pkt))) { ret = -EPERM; goto drop; } + ret = nrf_wifi_fmac_start_xmit(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, nbuf); @@ -503,6 +484,7 @@ static void ip_maddr_event_handler(struct net_if *iface, struct net_eth_addr mac_addr; struct nrf_wifi_umac_mcast_cfg *mcast_info = NULL; enum nrf_wifi_status status; + uint8_t mac_string_buf[sizeof("xx:xx:xx:xx:xx:xx")]; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; int ret; @@ -558,15 +540,12 @@ static void ip_maddr_event_handler(struct net_if *iface, vif_ctx_zep->vif_idx, mcast_info); if (status == NRF_WIFI_STATUS_FAIL) { - char mac_string_buf[sizeof("xx:xx:xx:xx:xx:xx")]; - LOG_ERR("%s: nrf_wifi_fmac_set_multicast failed for" " mac addr=%s", __func__, - nrf_wifi_sprint_ll_addr_buf(mac_addr.addr, - WIFI_MAC_ADDR_LEN, - mac_string_buf, - sizeof(mac_string_buf))); + net_sprint_ll_addr_buf(mac_addr.addr, + WIFI_MAC_ADDR_LEN, mac_string_buf, + sizeof(mac_string_buf))); } unlock: nrf_wifi_osal_mem_free(mcast_info); diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 4c98ef0d8aa0..6bb31241b295 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -18,7 +18,6 @@ #include "system/fmac_api.h" #include "system/fmac_tx.h" #include "common/fmac_util.h" -#include "common/fmac_structs_common.h" #include "fmac_main.h" #include "wifi_mgmt.h" @@ -758,8 +757,6 @@ int nrf_wifi_mode(const struct device *dev, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; - struct peers_info *peer = NULL; - int i = 0; int ret = -1; if (!dev || !mode) { @@ -801,16 +798,10 @@ int nrf_wifi_mode(const struct device *dev, goto out; } - for (i = 0; i < MAX_PEERS; i++) { - peer = &sys_dev_ctx->tx_config.peers[i]; - if (peer->peer_id == -1) { - continue; - } - if (peer->authorized && (mode->mode == NRF_WIFI_MONITOR_MODE)) { - LOG_ERR("%s: Cannot set monitor mode when station is connected", - __func__); - goto out; - } + if (vif_ctx_zep->authorized && (mode->mode == NRF_WIFI_MONITOR_MODE)) { + LOG_ERR("%s: Cannot set monitor mode when station is connected", + __func__); + goto out; } /** @@ -860,8 +851,6 @@ int nrf_wifi_channel(const struct device *dev, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; - struct peers_info *peer = NULL; - int i = 0; int ret = -1; if (!dev || !channel) { @@ -875,16 +864,9 @@ int nrf_wifi_channel(const struct device *dev, return ret; } - for (i = 0; i < MAX_PEERS; i++) { - peer = &sys_dev_ctx->tx_config.peers[i]; - if (peer->peer_id == -1) { - continue; - } - if (peer->authorized) { - LOG_ERR("%s: Cannot change channel when in station connected mode", - __func__); - return ret; - } + if (vif_ctx_zep->authorized) { + LOG_ERR("%s: Cannot change channel when in station connected mode", __func__); + return ret; } rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 5a69676e47a1..5885247f342e 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -17,7 +17,6 @@ #include "common/fmac_util.h" #include "wifi_mgmt.h" #include "wpa_supp_if.h" -#include LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); @@ -1108,7 +1107,6 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_umac_chg_sta_info chg_sta_info; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; int ret = -1; @@ -1130,12 +1128,6 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) goto out; } - sys_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); - if (!sys_dev_ctx) { - LOG_ERR("%s: sys_dev_ctx is NULL", __func__); - goto out; - } - if (vif_ctx_zep->if_op_state != NRF_WIFI_FMAC_IF_OP_STATE_UP) { LOG_DBG("%s: Interface not UP, ignoring", __func__); ret = 0; @@ -1147,6 +1139,7 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) memcpy(chg_sta_info.mac_addr, bssid, ETH_ALEN); vif_ctx_zep->authorized = authorized; + if (authorized) { /* BIT(NL80211_STA_FLAG_AUTHORIZED) */ chg_sta_info.sta_flags2.nrf_wifi_mask = 1 << 1; @@ -1164,10 +1157,6 @@ int nrf_wifi_wpa_set_supp_port(void *if_priv, int authorized, char *bssid) goto out; } - if (vif_ctx_zep->if_type == NRF_WIFI_IFTYPE_STATION) { - sys_dev_ctx->tx_config.peers[0].authorized = authorized; - } - ret = 0; out: k_mutex_unlock(&vif_ctx_zep->vif_lock); @@ -3000,11 +2989,8 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_umac_chg_sta_info chg_sta = {0}; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; - int peer_id = -1; int ret = -1; - char buf[18] = {0}; if (!if_priv || !addr) { LOG_ERR("%s: Invalid params", __func__); @@ -3026,46 +3012,18 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, memcpy(chg_sta.mac_addr, addr, sizeof(chg_sta.mac_addr)); - if (!net_eth_is_addr_valid((struct net_eth_addr *)&chg_sta.mac_addr)) { - LOG_ERR("%s: Invalid peer MAC address: %s", __func__, - nrf_wifi_sprint_ll_addr_buf(chg_sta.mac_addr, 6, buf, - sizeof(buf))); - goto out; - } - - peer_id = nrf_wifi_fmac_peer_get_id(rpu_ctx_zep->rpu_ctx, chg_sta.mac_addr); - if (peer_id == -1) { - LOG_ERR("%s: Unknown PEER: %s", __func__, - nrf_wifi_sprint_ll_addr_buf(chg_sta.mac_addr, 6, buf, - sizeof(buf))); - goto out; - } - - if (peer_id == MAX_PEERS) { - LOG_ERR("%s: Invalid PEER (group): %s", __func__, - nrf_wifi_sprint_ll_addr_buf(chg_sta.mac_addr, 6, buf, - sizeof(buf))); - goto out; - } - chg_sta.sta_flags2.nrf_wifi_mask = nrf_wifi_sta_flags_to_nrf(flags_or | ~flags_and); chg_sta.sta_flags2.nrf_wifi_set = nrf_wifi_sta_flags_to_nrf(flags_or); LOG_DBG("%s %x, %x", __func__, chg_sta.sta_flags2.nrf_wifi_set, chg_sta.sta_flags2.nrf_wifi_mask); - status = nrf_wifi_sys_fmac_chg_sta(rpu_ctx_zep->rpu_ctx, - vif_ctx_zep->vif_idx, &chg_sta); + status = nrf_wifi_sys_fmac_chg_sta(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &chg_sta); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_sys_fmac_chg_sta failed", __func__); goto out; } - sys_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); - - sys_dev_ctx->tx_config.peers[peer_id].authorized = - !!(chg_sta.sta_flags2.nrf_wifi_set & NRF_WIFI_STA_FLAG_AUTHORIZED); - ret = 0; out: From f0898a2c42d773578790f31256ebd84492596888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0890/3334] Revert "[nrf fromtree] soc: nordic: gen_uicr: Enable IS_GEN_UICR_IMAGE by default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d3409c65bf0bf3c207fea1d456041939126a5911. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/gen_uicr/Kconfig | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 soc/nordic/common/uicr/gen_uicr/Kconfig diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig deleted file mode 100644 index e453dbcdc7a3..000000000000 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config IS_GEN_UICR_IMAGE - default y - -source "Kconfig.zephyr" From 6dfb9fa75e621de97dda819ded3da4618d4a436a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0891/3334] Revert "[nrf fromtree] tests: pm: policy_api: Add test for locking all PM states" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 034b7c87aab805c9df50c12c40733bae12ee7765. Signed-off-by: Tomasz Moń --- include/zephyr/pm/policy.h | 2 ++ subsys/pm/policy/policy_state_lock.c | 4 ---- tests/subsys/pm/policy_api/src/main.c | 31 --------------------------- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/include/zephyr/pm/policy.h b/include/zephyr/pm/policy.h index 8175214e8774..0be63d38f8ce 100644 --- a/include/zephyr/pm/policy.h +++ b/include/zephyr/pm/policy.h @@ -112,6 +112,7 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks); * * @see pm_policy_state_lock_put() */ + void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id); /** @@ -364,6 +365,7 @@ static inline void pm_policy_device_power_lock_put(const struct device *dev) { ARG_UNUSED(dev); } + #endif /* CONFIG_PM_POLICY_DEVICE_CONSTRAINTS */ #if defined(CONFIG_PM) || defined(CONFIG_PM_POLICY_LATENCY_STANDALONE) || defined(__DOXYGEN__) diff --git a/subsys/pm/policy/policy_state_lock.c b/subsys/pm/policy/policy_state_lock.c index f8f5a7c41de6..7ed8def652b0 100644 --- a/subsys/pm/policy/policy_state_lock.c +++ b/subsys/pm/policy/policy_state_lock.c @@ -50,17 +50,13 @@ static struct k_spinlock lock; void pm_policy_state_all_lock_get(void) { -#if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) (void)atomic_inc(&global_lock_cnt); -#endif } void pm_policy_state_all_lock_put(void) { -#if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) __ASSERT(global_lock_cnt > 0, "Unbalanced state lock get/put"); (void)atomic_dec(&global_lock_cnt); -#endif } diff --git a/tests/subsys/pm/policy_api/src/main.c b/tests/subsys/pm/policy_api/src/main.c index 9bd2e9fccc85..e336b756294d 100644 --- a/tests/subsys/pm/policy_api/src/main.c +++ b/tests/subsys/pm/policy_api/src/main.c @@ -71,37 +71,6 @@ ZTEST(policy_api, test_pm_policy_next_state_default) zassert_equal(next->state, PM_STATE_SUSPEND_TO_RAM); } -ZTEST(policy_api, test_pm_policy_state_all_lock) -{ - /* initial state: PM_STATE_RUNTIME_IDLE allowed */ - zassert_false(pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); - zassert_true(pm_policy_state_is_available(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); - zassert_true(pm_policy_state_any_active()); - - /* Locking all states. */ - pm_policy_state_all_lock_get(); - pm_policy_state_all_lock_get(); - - /* States are locked. */ - zassert_true(pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); - zassert_false(pm_policy_state_is_available(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); - zassert_false(pm_policy_state_any_active()); - - pm_policy_state_all_lock_put(); - - /* States are still locked due to reference counter. */ - zassert_true(pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); - zassert_false(pm_policy_state_is_available(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); - zassert_false(pm_policy_state_any_active()); - - pm_policy_state_all_lock_put(); - - /* States are available again. */ - zassert_false(pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); - zassert_true(pm_policy_state_is_available(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES)); - zassert_true(pm_policy_state_any_active()); -} - /** * @brief Test the behavior of pm_policy_next_state() when * states are allowed/disallowed and CONFIG_PM_POLICY_DEFAULT=y. From 1b777e582edc8b6e213975d0892f27a6bc41aba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0892/3334] Revert "[nrf fromtree] pm: policy: Add option to lock all power states" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1f47bab0f62efa2fe58ff7077dc10f04046f5b4. Signed-off-by: Tomasz Moń --- include/zephyr/pm/policy.h | 22 ---------------------- subsys/pm/policy/policy_state_lock.c | 23 ++--------------------- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/include/zephyr/pm/policy.h b/include/zephyr/pm/policy.h index 0be63d38f8ce..b38fa37f254b 100644 --- a/include/zephyr/pm/policy.h +++ b/include/zephyr/pm/policy.h @@ -112,7 +112,6 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks); * * @see pm_policy_state_lock_put() */ - void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id); /** @@ -126,18 +125,6 @@ void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id); */ void pm_policy_state_lock_put(enum pm_state state, uint8_t substate_id); -/** - * @brief Request to lock all power states. - * - * Requests use a reference counter. - */ -void pm_policy_state_all_lock_get(void); - -/** - * @brief Release locking of all power states. - */ -void pm_policy_state_all_lock_put(void); - /** * @brief Apply power state constraints by locking the specified states. * @@ -287,14 +274,6 @@ static inline void pm_policy_state_lock_put(enum pm_state state, uint8_t substat ARG_UNUSED(substate_id); } -static inline void pm_policy_state_all_lock_get(void) -{ -} - -static inline void pm_policy_state_all_lock_put(void) -{ -} - static inline bool pm_policy_state_lock_is_active(enum pm_state state, uint8_t substate_id) { ARG_UNUSED(state); @@ -365,7 +344,6 @@ static inline void pm_policy_device_power_lock_put(const struct device *dev) { ARG_UNUSED(dev); } - #endif /* CONFIG_PM_POLICY_DEVICE_CONSTRAINTS */ #if defined(CONFIG_PM) || defined(CONFIG_PM_POLICY_LATENCY_STANDALONE) || defined(__DOXYGEN__) diff --git a/subsys/pm/policy/policy_state_lock.c b/subsys/pm/policy/policy_state_lock.c index 7ed8def652b0..b4cc319339ba 100644 --- a/subsys/pm/policy/policy_state_lock.c +++ b/subsys/pm/policy/policy_state_lock.c @@ -43,23 +43,10 @@ static const struct { static atomic_t lock_cnt[ARRAY_SIZE(substates)]; static atomic_t latency_mask = BIT_MASK(ARRAY_SIZE(substates)); static atomic_t unlock_mask = BIT_MASK(ARRAY_SIZE(substates)); -static atomic_t global_lock_cnt; static struct k_spinlock lock; #endif -void pm_policy_state_all_lock_get(void) -{ - (void)atomic_inc(&global_lock_cnt); -} - -void pm_policy_state_all_lock_put(void) -{ - __ASSERT(global_lock_cnt > 0, "Unbalanced state lock get/put"); - (void)atomic_dec(&global_lock_cnt); -} - - void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) @@ -119,8 +106,7 @@ bool pm_policy_state_lock_is_active(enum pm_state state, uint8_t substate_id) for (size_t i = 0; i < ARRAY_SIZE(substates); i++) { if (substates[i].state == state && (substates[i].substate_id == substate_id || substate_id == PM_ALL_SUBSTATES)) { - return (atomic_get(&global_lock_cnt) != 0) || - (atomic_get(&lock_cnt[i]) != 0); + return atomic_get(&lock_cnt[i]) != 0; } } #endif @@ -131,10 +117,6 @@ bool pm_policy_state_lock_is_active(enum pm_state state, uint8_t substate_id) bool pm_policy_state_is_available(enum pm_state state, uint8_t substate_id) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) - if (atomic_get(&global_lock_cnt) != 0) { - return false; - } - for (size_t i = 0; i < ARRAY_SIZE(substates); i++) { if (substates[i].state == state && (substates[i].substate_id == substate_id || substate_id == PM_ALL_SUBSTATES)) { @@ -153,8 +135,7 @@ bool pm_policy_state_any_active(void) /* Check if there is any power state that is not locked and not disabled due * to latency requirements. */ - return (atomic_get(&global_lock_cnt) == 0) && - (atomic_get(&unlock_mask) & atomic_get(&latency_mask)); + return atomic_get(&unlock_mask) & atomic_get(&latency_mask); #endif return true; } From 1e4b15dd2e90be90a80f63d4dd492e5a0cb99202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0893/3334] Revert "[nrf fromtree] pm: Add constraint lists and APIs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a6e81844095b720efc6a2ebfb39c9c10b40bc8b3. Signed-off-by: Tomasz Moń --- include/zephyr/pm/policy.h | 30 ---------- include/zephyr/pm/state.h | 81 +-------------------------- subsys/pm/policy/policy_device_lock.c | 10 ++++ subsys/pm/policy/policy_state_lock.c | 16 ------ subsys/pm/state.c | 17 ------ 5 files changed, 11 insertions(+), 143 deletions(-) diff --git a/include/zephyr/pm/policy.h b/include/zephyr/pm/policy.h index b38fa37f254b..eab33582b920 100644 --- a/include/zephyr/pm/policy.h +++ b/include/zephyr/pm/policy.h @@ -125,36 +125,6 @@ void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id); */ void pm_policy_state_lock_put(enum pm_state state, uint8_t substate_id); -/** - * @brief Apply power state constraints by locking the specified states. - * - * This function locks all power states specified in the union of all constraints - * in the provided constraint list. Each constraint in the set contributes to - * determining which power states should be locked (not allowed), by increasing - * a reference count just as if pm_policy_state_lock_get was called on each constraints' - * states individually. - * - * @param constraints Pointer to the power state constraints set to apply. - * - * @see pm_policy_state_constraints_put() - */ -void pm_policy_state_constraints_get(struct pm_state_constraints *constraints); - -/** - * @brief Remove power state constraints by unlocking the specified states. - * - * This function unlocks all power states that were previously locked by a - * corresponding call to pm_policy_state_constraints_get() with the same - * constraint set. The function decreases the lock counter for each affected - * power state specified in the union of all constraints in the list, just as - * if pm_policy_state_put was called on all the constraints' states individually. - * - * @param constraints Pointer to the power state constraints set to remove. - * - * @see pm_policy_state_constraints_get() - */ -void pm_policy_state_constraints_put(struct pm_state_constraints *constraints); - /** * @brief Check if a power state lock is active (not allowed). * diff --git a/include/zephyr/pm/state.h b/include/zephyr/pm/state.h index 69d0cae8863a..91119efbb69e 100644 --- a/include/zephyr/pm/state.h +++ b/include/zephyr/pm/state.h @@ -168,8 +168,7 @@ struct pm_state_info { }; /** - * Information needed to be able to reference a power state as a constraint - * on some device or system functions. + * Power state information needed to lock a power state. */ struct pm_state_constraint { /** @@ -186,16 +185,6 @@ struct pm_state_constraint { uint8_t substate_id; }; -/** - * Collection of multiple power state constraints. - */ -struct pm_state_constraints { - /** Array of power state constraints */ - struct pm_state_constraint *list; - /** Number of constraints in the list */ - size_t count; -}; - /** @cond INTERNAL_HIDDEN */ /** @@ -370,54 +359,6 @@ struct pm_state_constraints { Z_PM_STATE_FROM_DT_CPU, (), node_id) \ } -/** - * @brief initialize a device pm constraint with information from devicetree. - * - * @param node_id Node identifier. - */ -#define PM_STATE_CONSTRAINT_INIT(node_id) \ - { \ - .state = PM_STATE_DT_INIT(node_id), \ - .substate_id = DT_PROP_OR(node_id, substate_id, 0), \ - } - -#define Z_PM_STATE_CONSTRAINT_REF(node_id, phandle, idx) \ - PM_STATE_CONSTRAINT_INIT(DT_PHANDLE_BY_IDX(node_id, phandle, idx)) - -#define Z_PM_STATE_CONSTRAINTS_LIST_NAME(node_id, phandles) \ - _CONCAT_4(node_id, _, phandles, _constraints) - -/** - * @brief Define a list of power state constraints from devicetree. - * - * This macro creates an array of pm_state_constraint structures initialized - * with power state information from the specified devicetree property. - * - * @param node_id Devicetree node identifier. - * @param prop Property name containing the list of power state phandles. - */ -#define PM_STATE_CONSTRAINTS_LIST_DEFINE(node_id, prop) \ - struct pm_state_constraint Z_PM_STATE_CONSTRAINTS_LIST_NAME(node_id, prop)[] = \ - { \ - DT_FOREACH_PROP_ELEM_SEP(node_id, prop, Z_PM_STATE_CONSTRAINT_REF, (,)) \ - } - -/** - * @brief Get power state constraints structure from devicetree. - * - * This macro creates a structure containing a pointer to the constraints list - * and the count of constraints, suitable for initializing a pm_state_constraints - * structure. Must be used after the PM_STATE_CONSTRAINTS_LIST_DEFINE call for the same - * @param prop to refer to the array of constraints. - * - * @param node_id Devicetree node identifier. - * @param prop Property name containing the list of power state phandles. - */ -#define PM_STATE_CONSTRAINTS_GET(node_id, prop) \ - { \ - .list = Z_PM_STATE_CONSTRAINTS_LIST_NAME(node_id, prop), \ - .count = DT_PROP_LEN(node_id, prop), \ - } #if defined(CONFIG_PM) || defined(__DOXYGEN__) /** @@ -462,18 +403,6 @@ const char *pm_state_to_str(enum pm_state state); * @return 0 on success, -EINVAL if the string is invalid or NULL. */ int pm_state_from_str(const char *name, enum pm_state *out); - -/** - * @brief Check if a power management constraint matches any in a set of constraints. - * - * @param constraints Pointer to the power state constraints structure. - * @param match The constraint to match against. - * - * @return true if the constraint matches, false otherwise. - */ -bool pm_state_in_constraints(const struct pm_state_constraints *constraints, - const struct pm_state_constraint match); - /** * @} */ @@ -499,14 +428,6 @@ static inline const struct pm_state_info *pm_state_get(uint8_t cpu, return NULL; } -static inline bool pm_state_in_constraints(struct pm_state_constraints *constraints, - struct pm_state_constraint match) -{ - ARG_UNUSED(constraints); - ARG_UNUSED(match); - - return false; -} #endif /* CONFIG_PM */ #ifdef __cplusplus diff --git a/subsys/pm/policy/policy_device_lock.c b/subsys/pm/policy/policy_device_lock.c index 0c70dd17a189..290a1ff51597 100644 --- a/subsys/pm/policy/policy_device_lock.c +++ b/subsys/pm/policy/policy_device_lock.c @@ -24,6 +24,16 @@ struct pm_state_device_constraint { */ #define PM_CONSTRAINTS_NAME(node_id) _CONCAT(__devicepmconstraints_, node_id) +/** + * @brief initialize a device pm constraint with information from devicetree. + * + * @param node_id Node identifier. + */ +#define PM_STATE_CONSTRAINT_INIT(node_id) \ + { \ + .state = PM_STATE_DT_INIT(node_id), \ + .substate_id = DT_PROP_OR(node_id, substate_id, 0), \ + } /** * @brief Helper macro to define a device pm constraints. diff --git a/subsys/pm/policy/policy_state_lock.c b/subsys/pm/policy/policy_state_lock.c index b4cc319339ba..f69133dfe893 100644 --- a/subsys/pm/policy/policy_state_lock.c +++ b/subsys/pm/policy/policy_state_lock.c @@ -65,14 +65,6 @@ void pm_policy_state_lock_get(enum pm_state state, uint8_t substate_id) #endif } -void pm_policy_state_constraints_get(struct pm_state_constraints *constraints) -{ - for (int i = 0; i < constraints->count; i++) { - pm_policy_state_lock_get(constraints->list[i].state, - constraints->list[i].substate_id); - } -} - void pm_policy_state_lock_put(enum pm_state state, uint8_t substate_id) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) @@ -92,14 +84,6 @@ void pm_policy_state_lock_put(enum pm_state state, uint8_t substate_id) #endif } -void pm_policy_state_constraints_put(struct pm_state_constraints *constraints) -{ - for (int i = 0; i < constraints->count; i++) { - pm_policy_state_lock_put(constraints->list[i].state, - constraints->list[i].substate_id); - } -} - bool pm_policy_state_lock_is_active(enum pm_state state, uint8_t substate_id) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) diff --git a/subsys/pm/state.c b/subsys/pm/state.c index 3427d6684288..0ff8c4a4bc5f 100644 --- a/subsys/pm/state.c +++ b/subsys/pm/state.c @@ -152,20 +152,3 @@ int pm_state_from_str(const char *name, enum pm_state *out) return 0; } - -bool pm_state_in_constraints(const struct pm_state_constraints *constraints, - const struct pm_state_constraint match) -{ - struct pm_state_constraint *constraints_list = constraints->list; - size_t num_constraints = constraints->count; - bool match_found = false; - - for (int i = 0; i < num_constraints; i++) { - enum pm_state state = constraints_list[i].state; - uint8_t substate = constraints_list[i].substate_id; - - match_found |= ((state == match.state) && (substate == match.substate_id)); - } - - return match_found; -} From 0bb8ecf400208a5bc668078ce175924e80585d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0894/3334] Revert "[nrf fromtree] pm: states: add enum-string conversion helpers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5acf8dc1d967a6b8b6d2d1f1ad5f3e2950bfb976. Signed-off-by: Tomasz Moń --- include/zephyr/pm/state.h | 21 ------------------ subsys/pm/state.c | 45 --------------------------------------- 2 files changed, 66 deletions(-) diff --git a/include/zephyr/pm/state.h b/include/zephyr/pm/state.h index 91119efbb69e..ef191d87c143 100644 --- a/include/zephyr/pm/state.h +++ b/include/zephyr/pm/state.h @@ -9,7 +9,6 @@ #include #include -#include #ifdef __cplusplus extern "C" { @@ -383,26 +382,6 @@ uint8_t pm_state_cpu_get_all(uint8_t cpu, const struct pm_state_info **states); * @return Pointer to the power state structure or NULL if state is not found. */ const struct pm_state_info *pm_state_get(uint8_t cpu, enum pm_state state, uint8_t substate_id); - -/** - * @brief Convert a pm_state enum value to its string representation. - * - * @param state Power state. - * - * @return A constant string representing the state. - */ -const char *pm_state_to_str(enum pm_state state); - - -/** - * @brief Parse a string and convert it to a pm_state enum value. - * - * @param name Input string (e.g., "suspend-to-ram"). - * @param out Pointer to store the parsed pm_state value. - * - * @return 0 on success, -EINVAL if the string is invalid or NULL. - */ -int pm_state_from_str(const char *name, enum pm_state *out); /** * @} */ diff --git a/subsys/pm/state.c b/subsys/pm/state.c index 0ff8c4a4bc5f..477c462408d3 100644 --- a/subsys/pm/state.c +++ b/subsys/pm/state.c @@ -107,48 +107,3 @@ const struct pm_state_info *pm_state_get(uint8_t cpu, enum pm_state state, uint8 return NULL; } - -const char *pm_state_to_str(enum pm_state state) -{ - switch (state) { - case PM_STATE_ACTIVE: - return "active"; - case PM_STATE_RUNTIME_IDLE: - return "runtime-idle"; - case PM_STATE_SUSPEND_TO_IDLE: - return "suspend-to-idle"; - case PM_STATE_STANDBY: - return "standby"; - case PM_STATE_SUSPEND_TO_RAM: - return "suspend-to-ram"; - case PM_STATE_SUSPEND_TO_DISK: - return "suspend-to-disk"; - case PM_STATE_SOFT_OFF: - return "soft-off"; - default: - return "UNKNOWN"; - } -} - -int pm_state_from_str(const char *name, enum pm_state *out) -{ - if (strcmp(name, "active") == 0) { - *out = PM_STATE_ACTIVE; - } else if (strcmp(name, "runtime-idle") == 0) { - *out = PM_STATE_RUNTIME_IDLE; - } else if (strcmp(name, "suspend-to-idle") == 0) { - *out = PM_STATE_SUSPEND_TO_IDLE; - } else if (strcmp(name, "standby") == 0) { - *out = PM_STATE_STANDBY; - } else if (strcmp(name, "suspend-to-ram") == 0) { - *out = PM_STATE_SUSPEND_TO_RAM; - } else if (strcmp(name, "suspend-to-disk") == 0) { - *out = PM_STATE_SUSPEND_TO_DISK; - } else if (strcmp(name, "soft-off") == 0) { - *out = PM_STATE_SOFT_OFF; - } else { - return -EINVAL; - } - - return 0; -} From 1eb32d0c757dc8e64de36807b7f93c42d1b84e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0895/3334] Revert "[nrf fromtree] pm: Extend pm notifier to be able to report substate" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b85b50681663c0a89c6bd4e5749d1258727e8100. Signed-off-by: Tomasz Moń --- include/zephyr/pm/pm.h | 37 ++++++++++--------------------------- subsys/pm/pm.c | 22 ++++++---------------- 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/include/zephyr/pm/pm.h b/include/zephyr/pm/pm.h index 096ca6942e6f..443f5e37d8bd 100644 --- a/include/zephyr/pm/pm.h +++ b/include/zephyr/pm/pm.h @@ -55,33 +55,16 @@ extern "C" { */ struct pm_notifier { sys_snode_t _node; - union { - struct { - /** - * Application defined function for doing any target specific operations - * for power state entry. - */ - void (*state_entry)(enum pm_state state); - /** - * Application defined function for doing any target specific operations - * for power state exit. - */ - void (*state_exit)(enum pm_state state); - }; - struct { - /** - * Application defined function for doing any target specific operations - * for power state entry. Reports the substate id additionally. - */ - void (*substate_entry)(enum pm_state state, uint8_t substate_id); - /** - * Application defined function for doing any target specific operations - * for power state exit. Reports the substate id additionally. - */ - void (*substate_exit)(enum pm_state state, uint8_t substate_id); - }; - }; - bool report_substate; /* 0 is for backwards compatibility that didn't report substates */ + /** + * Application defined function for doing any target specific operations + * for power state entry. + */ + void (*state_entry)(enum pm_state state); + /** + * Application defined function for doing any target specific operations + * for power state exit. + */ + void (*state_exit)(enum pm_state state); }; #if defined(CONFIG_PM) || defined(__DOXYGEN__) diff --git a/subsys/pm/pm.c b/subsys/pm/pm.c index 062c7bd623a0..58448e1eba01 100644 --- a/subsys/pm/pm.c +++ b/subsys/pm/pm.c @@ -47,29 +47,19 @@ static inline void pm_state_notify(bool entering_state) { struct pm_notifier *notifier; k_spinlock_key_t pm_notifier_key; - union { - void (*without_substate)(enum pm_state state); - void (*with_substate)(enum pm_state state, uint8_t substate_id); - } callback; + void (*callback)(enum pm_state state); pm_notifier_key = k_spin_lock(&pm_notifier_lock); SYS_SLIST_FOR_EACH_CONTAINER(&pm_notifiers, notifier, _node) { if (entering_state) { - /* should be equivalent to also setting the "with substate" */ - callback.without_substate = notifier->state_entry; + callback = notifier->state_entry; } else { - /* should be equivalent to also setting the "with substate" */ - callback.without_substate = notifier->state_exit; + callback = notifier->state_exit; } - if (callback.with_substate && notifier->report_substate) { - callback.with_substate(z_cpus_pm_state[CPU_ID]->state, - z_cpus_pm_state[CPU_ID]->substate_id); - } else if (callback.without_substate) { - callback.without_substate(z_cpus_pm_state[CPU_ID]->state); - } else { - /* intentionally empty */ - }; + if (callback) { + callback(z_cpus_pm_state[CPU_ID]->state); + } } k_spin_unlock(&pm_notifier_lock, pm_notifier_key); } From 86579712e1134821a38d716acc1a434dd97d5e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0896/3334] Revert "[nrf fromtree] drivers: udc_dwc2: Avoid endpoint disable timeouts on bus reset" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 56fbb4f3c7bba12fb34a5cd111b4ea9f7ad52162. Signed-off-by: Tomasz Moń --- drivers/usb/udc/udc_dwc2.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 905698bcf977..83ec8dd5f5ec 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -1748,11 +1748,20 @@ static int udc_dwc2_ep_deactivate(const struct device *dev, dxepctl_reg = dwc2_get_dxepctl_reg(dev, cfg->addr); } - udc_dwc2_ep_disable(dev, cfg, false, true); - dxepctl = sys_read32(dxepctl_reg); - LOG_DBG("Disable ep 0x%02x DxEPCTL%u %x", cfg->addr, ep_idx, dxepctl); - dxepctl &= ~USB_DWC2_DEPCTL_USBACTEP; + + if (dxepctl & USB_DWC2_DEPCTL_USBACTEP) { + LOG_DBG("Disable ep 0x%02x DxEPCTL%u %x", + cfg->addr, ep_idx, dxepctl); + + udc_dwc2_ep_disable(dev, cfg, false, true); + + dxepctl = sys_read32(dxepctl_reg); + dxepctl &= ~USB_DWC2_DEPCTL_USBACTEP; + } else { + LOG_WRN("ep 0x%02x is not active DxEPCTL%u %x", + cfg->addr, ep_idx, dxepctl); + } if (USB_EP_DIR_IS_IN(cfg->addr) && udc_mps_ep_size(cfg) != 0U && ep_idx != 0U) { From 63fe9db775daede16370e4476fc49785fc6226de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0897/3334] Revert "[nrf fromtree] drivers: usb: dwc2: Do cache operations on ownership change" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a3d02e2a892a335e88669921c306bba318ddd33b. Signed-off-by: Tomasz Moń --- drivers/usb/udc/udc_dwc2.c | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 83ec8dd5f5ec..769030670918 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -419,11 +419,6 @@ static int dwc2_ctrl_feed_dout(const struct device *dev, const size_t length) return -ENOMEM; } - if (dwc2_in_buffer_dma_mode(dev)) { - /* Get rid of all dirty cache lines */ - sys_cache_data_invd_range(buf->data, net_buf_tailroom(buf)); - } - udc_buf_put(ep_cfg, buf); atomic_set_bit(&priv->xfer_new, 16); k_event_post(&priv->drv_evt, BIT(DWC2_DRV_EVT_XFER)); @@ -594,6 +589,8 @@ static int dwc2_tx_fifo_write(const struct device *dev, sys_write32((uint32_t)buf->data, (mem_addr_t)&base->in_ep[ep_idx].diepdma); + + sys_cache_data_flush_range(buf->data, len); } diepctl = sys_read32(diepctl_reg); @@ -793,6 +790,8 @@ static void dwc2_prep_rx(const struct device *dev, struct net_buf *buf, sys_write32((uint32_t)data, (mem_addr_t)&base->out_ep[ep_idx].doepdma); + + sys_cache_data_invd_range(data, xfersize); } sys_write32(doepctl, doepctl_reg); @@ -969,10 +968,6 @@ static inline int dwc2_handle_evt_dout(const struct device *dev, return -ENODATA; } - if (dwc2_in_buffer_dma_mode(dev)) { - sys_cache_data_invd_range(buf->data, buf->len); - } - udc_ep_set_busy(cfg, false); if (cfg->addr == USB_CONTROL_EP_OUT) { @@ -1840,17 +1835,6 @@ static int udc_dwc2_ep_enqueue(const struct device *dev, struct udc_dwc2_data *const priv = udc_get_private(dev); LOG_DBG("%p enqueue %x %p", dev, cfg->addr, buf); - - if (dwc2_in_buffer_dma_mode(dev)) { - if (USB_EP_DIR_IS_IN(cfg->addr)) { - /* Write all dirty cache lines to memory */ - sys_cache_data_flush_range(buf->data, buf->len); - } else { - /* Get rid of all dirty cache lines */ - sys_cache_data_invd_range(buf->data, net_buf_tailroom(buf)); - } - } - udc_buf_put(cfg, buf); if (!cfg->stat.halted) { @@ -1877,13 +1861,6 @@ static int udc_dwc2_ep_dequeue(const struct device *dev, udc_dwc2_ep_disable(dev, cfg, false, true); buf = udc_buf_get_all(cfg); - - if (dwc2_in_buffer_dma_mode(dev) && USB_EP_DIR_IS_OUT(cfg->addr)) { - for (struct net_buf *iter = buf; iter; iter = iter->frags) { - sys_cache_data_invd_range(iter->data, iter->len); - } - } - if (buf) { udc_submit_ep_event(dev, buf, -ECONNABORTED); } @@ -2844,9 +2821,7 @@ static inline void dwc2_handle_out_xfercompl(const struct device *dev, } if (dwc2_in_buffer_dma_mode(dev) && bcnt) { - /* Update just the length, cache will be invalidated in thread - * context after transfer if finished or cancelled. - */ + sys_cache_data_invd_range(net_buf_tail(buf), bcnt); net_buf_add(buf, bcnt); } From b374036b299948b1c699c423eb42a72bb9e4f932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0898/3334] Revert "[nrf fromtree] usb: device_next: msc: Do not leak SCSI buffer on dequeue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0efb854a12786ea7f1dcf5487b2c256e911bc66e. Signed-off-by: Tomasz Moń --- subsys/usb/device_next/class/usbd_msc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index 6aefb1aefb64..c631376b61f6 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -718,9 +718,6 @@ static void usbd_msc_handle_request(struct usbd_class_data *c_data, } } msc_free_scsi_buf(ctx, buf->__buf); - if (buf->frags) { - msc_free_scsi_buf(ctx, buf->frags->__buf); - } usbd_ep_buf_free(uds_ctx, buf); } From eace8ed7a149fda1f191f6d424eca389e3a4e40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0899/3334] Revert "[nrf fromtree] usb: device_next: msc: Reduce memory usage" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 84577e178ed614b958ecc119ab9b56cc93932549. Signed-off-by: Tomasz Moń --- subsys/usb/device_next/class/usbd_msc.c | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index c631376b61f6..79e81cc01382 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -62,12 +62,8 @@ struct CSW { #define MSC_NUM_BUFFERS UTIL_INC(IS_ENABLED(CONFIG_USBD_MSC_DOUBLE_BUFFERING)) -#if USBD_MAX_BULK_MPS > CONFIG_USBD_MSC_SCSI_BUFFER_SIZE -#error "SCSI buffer must be at least USB bulk endpoint wMaxPacketSize" -#endif - UDC_BUF_POOL_DEFINE(msc_ep_pool, MSC_NUM_INSTANCES * (1 + MSC_NUM_BUFFERS), - 0, sizeof(struct udc_buf_info), NULL); + USBD_MAX_BULK_MPS, sizeof(struct udc_buf_info), NULL); struct msc_event { struct usbd_class_data *c_data; @@ -129,6 +125,22 @@ struct msc_bot_ctx { size_t scsi_bytes; }; +static struct net_buf *msc_buf_alloc(const uint8_t ep) +{ + struct net_buf *buf = NULL; + struct udc_buf_info *bi; + + buf = net_buf_alloc(&msc_ep_pool, K_NO_WAIT); + if (!buf) { + return NULL; + } + + bi = udc_get_buf_info(buf); + bi->ep = ep; + + return buf; +} + static struct net_buf *msc_buf_alloc_data(const uint8_t ep, uint8_t *data, size_t len) { struct net_buf *buf = NULL; @@ -322,7 +334,6 @@ static void msc_queue_cbw(struct usbd_class_data *const c_data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); struct net_buf *buf; - uint8_t *scsi_buf; uint8_t ep; int ret; @@ -331,13 +342,9 @@ static void msc_queue_cbw(struct usbd_class_data *const c_data) return; } - __ASSERT(ctx->scsi_bufs_used == 0, - "CBW can only be queued when SCSI buffers are free"); - LOG_DBG("Queuing OUT"); ep = msc_get_bulk_out(c_data); - scsi_buf = msc_alloc_scsi_buf(ctx); - buf = msc_buf_alloc_data(ep, scsi_buf, USBD_MAX_BULK_MPS); + buf = msc_buf_alloc(ep); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. @@ -348,7 +355,6 @@ static void msc_queue_cbw(struct usbd_class_data *const c_data) if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); - msc_free_scsi_buf(ctx, scsi_buf); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); } else { @@ -642,7 +648,6 @@ static void msc_handle_bulk_in(struct msc_bot_ctx *ctx, static void msc_send_csw(struct msc_bot_ctx *ctx) { struct net_buf *buf; - uint8_t *scsi_buf; uint8_t ep; int ret; @@ -652,25 +657,20 @@ static void msc_send_csw(struct msc_bot_ctx *ctx) return; } - __ASSERT(ctx->scsi_bufs_used == 0, - "CSW can be sent only if SCSI buffers are free"); - /* Convert dCSWDataResidue to LE, other fields are already set */ ctx->csw.dCSWDataResidue = sys_cpu_to_le32(ctx->csw.dCSWDataResidue); ep = msc_get_bulk_in(ctx->class_node); - scsi_buf = msc_alloc_scsi_buf(ctx); - memcpy(scsi_buf, &ctx->csw, sizeof(ctx->csw)); - buf = msc_buf_alloc_data(ep, scsi_buf, sizeof(ctx->csw)); + buf = msc_buf_alloc(ep); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. */ __ASSERT_NO_MSG(buf); + net_buf_add_mem(buf, &ctx->csw, sizeof(ctx->csw)); ret = usbd_ep_enqueue(ctx->class_node, buf); if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); - msc_free_scsi_buf(ctx, scsi_buf); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); } else { From 15b234f934b5f551ba66ff8ae197fbcd0fa9d903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0900/3334] Revert "[nrf fromtree] usb: device_next: msc: Implement double buffering" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9ebaf6ba81a324d7d87718ac52e69a021c7d0663. Signed-off-by: Tomasz Moń --- subsys/usb/device_next/class/Kconfig.msc | 7 - subsys/usb/device_next/class/usbd_msc.c | 239 ++++++----------------- 2 files changed, 60 insertions(+), 186 deletions(-) diff --git a/subsys/usb/device_next/class/Kconfig.msc b/subsys/usb/device_next/class/Kconfig.msc index d4ff01cf17b1..d85d0561cbf4 100644 --- a/subsys/usb/device_next/class/Kconfig.msc +++ b/subsys/usb/device_next/class/Kconfig.msc @@ -30,13 +30,6 @@ config USBD_MSC_SCSI_BUFFER_SIZE Buffer size must be able to hold at least one sector. All LUNs within single instance share the SCSI buffer. -config USBD_MSC_DOUBLE_BUFFERING - bool "SCSI double buffering" - default y - help - Allocate two SCSI buffers instead of one to increase throughput by - using one buffer by disk subsystem and one by USB at the same time. - module = USBD_MSC module-str = usbd msc default-count = 1 diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index 79e81cc01382..ee5784ae00ca 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -60,10 +60,9 @@ struct CSW { /* Single instance is likely enough because it can support multiple LUNs */ #define MSC_NUM_INSTANCES CONFIG_USBD_MSC_INSTANCES_COUNT -#define MSC_NUM_BUFFERS UTIL_INC(IS_ENABLED(CONFIG_USBD_MSC_DOUBLE_BUFFERING)) - -UDC_BUF_POOL_DEFINE(msc_ep_pool, MSC_NUM_INSTANCES * (1 + MSC_NUM_BUFFERS), - USBD_MAX_BULK_MPS, sizeof(struct udc_buf_info), NULL); +UDC_BUF_POOL_DEFINE(msc_ep_pool, + MSC_NUM_INSTANCES * 2, USBD_MAX_BULK_MPS, + sizeof(struct udc_buf_info), NULL); struct msc_event { struct usbd_class_data *c_data; @@ -92,6 +91,8 @@ struct msc_bot_desc { enum { MSC_CLASS_ENABLED, + MSC_BULK_OUT_QUEUED, + MSC_BULK_IN_QUEUED, MSC_BULK_IN_WEDGED, MSC_BULK_OUT_WEDGED, }; @@ -111,16 +112,13 @@ struct msc_bot_ctx { struct msc_bot_desc *const desc; const struct usb_desc_header **const fs_desc; const struct usb_desc_header **const hs_desc; - uint8_t *scsi_bufs[MSC_NUM_BUFFERS]; atomic_t bits; enum msc_bot_state state; - uint8_t scsi_bufs_used; - uint8_t num_in_queued; - uint8_t num_out_queued; uint8_t registered_luns; struct scsi_ctx luns[CONFIG_USBD_MSC_LUNS_PER_INSTANCE]; struct CBW cbw; struct CSW csw; + uint8_t *scsi_buf; uint32_t transferred_data; size_t scsi_bytes; }; @@ -162,34 +160,13 @@ static struct net_buf *msc_buf_alloc_data(const uint8_t ep, uint8_t *data, size_ return buf; } -static uint8_t *msc_alloc_scsi_buf(struct msc_bot_ctx *ctx) -{ - for (int i = 0; i < MSC_NUM_BUFFERS; i++) { - if (!(ctx->scsi_bufs_used & BIT(i))) { - ctx->scsi_bufs_used |= BIT(i); - return ctx->scsi_bufs[i]; - } - } - - /* Code must not attempt to queue more than MSC_NUM_BUFFERS at once */ - __ASSERT(false, "MSC ran out of SCSI buffers"); - return NULL; -} - -void msc_free_scsi_buf(struct msc_bot_ctx *ctx, uint8_t *buf) +static size_t msc_next_transfer_length(struct usbd_class_data *const c_data) { - for (int i = 0; i < MSC_NUM_BUFFERS; i++) { - if (buf == ctx->scsi_bufs[i]) { - ctx->scsi_bufs_used &= ~BIT(i); - return; - } - } -} + struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); + struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); + struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; + size_t len = scsi_cmd_remaining_data_len(lun); -static size_t clamp_transfer_length(struct usbd_context *uds_ctx, - struct scsi_ctx *lun, - size_t len) -{ len = MIN(CONFIG_USBD_MSC_SCSI_BUFFER_SIZE, len); /* Limit transfer to bulk endpoint wMaxPacketSize multiple */ @@ -209,39 +186,6 @@ static size_t clamp_transfer_length(struct usbd_context *uds_ctx, return len; } -static size_t msc_next_in_transfer_length(struct usbd_class_data *const c_data) -{ - struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); - struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); - struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; - size_t len = scsi_cmd_remaining_data_len(lun); - - return clamp_transfer_length(uds_ctx, lun, len); -} - -static size_t msc_next_out_transfer_length(struct usbd_class_data *const c_data) -{ - struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); - struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); - struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; - size_t remaining = scsi_cmd_remaining_data_len(lun); - size_t len = clamp_transfer_length(uds_ctx, lun, remaining); - - /* This function can only estimate one more transfer after the current - * one. Queueing more buffers is not supported. - */ - __ASSERT_NO_MSG(ctx->num_out_queued < 2); - - if (ctx->num_out_queued == 0) { - return len; - } - - /* MSC BOT specification requires host to send all the data it intends - * to send. Therefore it should be safe to use "remaining - len" here. - */ - return clamp_transfer_length(uds_ctx, lun, remaining - len); -} - static uint8_t msc_get_bulk_in(struct usbd_class_data *const c_data) { struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); @@ -295,56 +239,27 @@ static void msc_stall_and_wait_for_recovery(struct msc_bot_ctx *ctx) ctx->state = MSC_BBB_WAIT_FOR_RESET_RECOVERY; } -static void msc_queue_write(struct msc_bot_ctx *ctx) -{ - struct net_buf *buf; - uint8_t *scsi_buf; - uint8_t ep; - size_t len; - int ret; - - ep = msc_get_bulk_out(ctx->class_node); - - /* Ensure there are as many OUT transfers queued as possible */ - while ((ctx->num_out_queued < MSC_NUM_BUFFERS) && - (len = msc_next_out_transfer_length(ctx->class_node))) { - scsi_buf = msc_alloc_scsi_buf(ctx); - buf = msc_buf_alloc_data(ep, scsi_buf, len); - - /* The pool is large enough to support all allocations. Failing - * alloc indicates either a memory leak or logic error. - */ - __ASSERT_NO_MSG(buf); - - ret = usbd_ep_enqueue(ctx->class_node, buf); - if (ret) { - LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); - net_buf_unref(buf); - msc_free_scsi_buf(ctx, scsi_buf); - /* 6.6.2 Internal Device Error */ - msc_stall_and_wait_for_recovery(ctx); - return; - } - - ctx->num_out_queued++; - } -} - -static void msc_queue_cbw(struct usbd_class_data *const c_data) +static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); struct net_buf *buf; + uint8_t *scsi_buf = ctx->scsi_buf; uint8_t ep; int ret; - if (ctx->num_out_queued) { + if (atomic_test_and_set_bit(&ctx->bits, MSC_BULK_OUT_QUEUED)) { /* Already queued */ return; } LOG_DBG("Queuing OUT"); ep = msc_get_bulk_out(c_data); - buf = msc_buf_alloc(ep); + + if (data) { + buf = msc_buf_alloc_data(ep, scsi_buf, msc_next_transfer_length(c_data)); + } else { + buf = msc_buf_alloc(ep); + } /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. @@ -355,10 +270,9 @@ static void msc_queue_cbw(struct usbd_class_data *const c_data) if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); + atomic_clear_bit(&ctx->bits, MSC_BULK_OUT_QUEUED); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); - } else { - ctx->num_out_queued++; } } @@ -397,58 +311,51 @@ static bool is_cbw_meaningful(struct msc_bot_ctx *const ctx) return true; } -static void msc_queue_bulk_in_ep(struct msc_bot_ctx *ctx, uint8_t *data, int len) +static void msc_process_read(struct msc_bot_ctx *ctx) { + struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; + int bytes_queued = 0; struct net_buf *buf; + uint8_t *scsi_buf = ctx->scsi_buf; uint8_t ep; int ret; + /* Fill SCSI Data IN buffer if there is no data available */ + if (ctx->scsi_bytes == 0) { + size_t len = msc_next_transfer_length(ctx->class_node); + + bytes_queued = scsi_read_data(lun, scsi_buf, len); + } else { + bytes_queued = ctx->scsi_bytes; + } + + /* All data is submitted in one go. Any potential new data will + * have to be retrieved using scsi_read_data() on next call. + */ + ctx->scsi_bytes = 0; + + if (atomic_test_and_set_bit(&ctx->bits, MSC_BULK_IN_QUEUED)) { + __ASSERT_NO_MSG(false); + LOG_ERR("IN already queued"); + return; + } + ep = msc_get_bulk_in(ctx->class_node); - buf = msc_buf_alloc_data(ep, data, len); + buf = msc_buf_alloc_data(ep, scsi_buf, bytes_queued); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. */ __ASSERT_NO_MSG(buf); /* Either the net buf is full or there is no more SCSI data */ - ctx->csw.dCSWDataResidue -= len; + ctx->csw.dCSWDataResidue -= bytes_queued; ret = usbd_ep_enqueue(ctx->class_node, buf); if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); - msc_free_scsi_buf(ctx, data); net_buf_unref(buf); + atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); - } else { - ctx->num_in_queued++; - } -} - -static void msc_process_read(struct msc_bot_ctx *ctx) -{ - struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; - int bytes_queued = 0; - uint8_t *scsi_buf; - size_t len; - - /* Data can be already in scsi_buf0 only on first call after CBW */ - if (ctx->scsi_bytes) { - __ASSERT_NO_MSG(ctx->scsi_bufs_used == 0); - ctx->scsi_bufs_used = BIT(0); - msc_queue_bulk_in_ep(ctx, ctx->scsi_bufs[0], ctx->scsi_bytes); - /* All data is submitted in one go. Any potential new data will - * have to be retrieved using scsi_read_data() later. - */ - ctx->scsi_bytes = 0; - } - - /* Fill SCSI Data IN buffer if there is avaialble buffer and data */ - while ((ctx->num_in_queued < MSC_NUM_BUFFERS) && - (ctx->state == MSC_BBB_PROCESS_READ) && - (len = msc_next_in_transfer_length(ctx->class_node))) { - scsi_buf = msc_alloc_scsi_buf(ctx); - bytes_queued = scsi_read_data(lun, scsi_buf, len); - msc_queue_bulk_in_ep(ctx, scsi_buf, bytes_queued); } } @@ -459,11 +366,8 @@ static void msc_process_cbw(struct msc_bot_ctx *ctx) size_t data_len; int cb_len; - /* All SCSI buffers must be available */ - __ASSERT_NO_MSG(ctx->scsi_bufs_used == 0); - cb_len = scsi_usb_boot_cmd_len(ctx->cbw.CBWCB, ctx->cbw.bCBWCBLength); - data_len = scsi_cmd(lun, ctx->cbw.CBWCB, cb_len, ctx->scsi_bufs[0]); + data_len = scsi_cmd(lun, ctx->cbw.CBWCB, cb_len, ctx->scsi_buf); ctx->scsi_bytes = data_len; cmd_is_data_read = scsi_cmd_is_data_read(lun); cmd_is_data_write = scsi_cmd_is_data_write(lun); @@ -626,7 +530,7 @@ static void msc_handle_bulk_in(struct msc_bot_ctx *ctx, struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; ctx->transferred_data += len; - if (msc_next_in_transfer_length(ctx->class_node) == 0) { + if (msc_next_transfer_length(ctx->class_node) == 0) { if (ctx->csw.dCSWDataResidue > 0) { /* Case (5) Hi > Di * While we may have sent short packet, device @@ -651,7 +555,7 @@ static void msc_send_csw(struct msc_bot_ctx *ctx) uint8_t ep; int ret; - if (ctx->num_in_queued) { + if (atomic_test_and_set_bit(&ctx->bits, MSC_BULK_IN_QUEUED)) { __ASSERT_NO_MSG(false); LOG_ERR("IN already queued"); return; @@ -671,10 +575,10 @@ static void msc_send_csw(struct msc_bot_ctx *ctx) if (ret) { LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); + atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); /* 6.6.2 Internal Device Error */ msc_stall_and_wait_for_recovery(ctx); } else { - ctx->num_in_queued++; ctx->state = MSC_BBB_WAIT_FOR_CSW_SENT; } } @@ -707,17 +611,10 @@ static void usbd_msc_handle_request(struct usbd_class_data *c_data, ep_request_error: if (bi->ep == msc_get_bulk_out(c_data)) { - ctx->num_out_queued--; - if (buf->frags) { - ctx->num_out_queued--; - } + atomic_clear_bit(&ctx->bits, MSC_BULK_OUT_QUEUED); } else if (bi->ep == msc_get_bulk_in(c_data)) { - ctx->num_in_queued--; - if (buf->frags) { - ctx->num_in_queued--; - } + atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); } - msc_free_scsi_buf(ctx, buf->__buf); usbd_ep_buf_free(uds_ctx, buf); } @@ -745,14 +642,11 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) switch (ctx->state) { case MSC_BBB_EXPECT_CBW: - msc_queue_cbw(evt.c_data); + msc_queue_bulk_out_ep(evt.c_data, false); break; case MSC_BBB_PROCESS_WRITE: /* Ensure we can accept next OUT packet */ - msc_queue_write(ctx); - break; - case MSC_BBB_PROCESS_READ: - msc_process_read(ctx); + msc_queue_bulk_out_ep(evt.c_data, true); break; default: break; @@ -761,7 +655,7 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) /* Skip (potentially) response generating code if there is * IN data already available for the host to pick up. */ - if (ctx->num_in_queued) { + if (atomic_test_bit(&ctx->bits, MSC_BULK_IN_QUEUED)) { continue; } @@ -772,7 +666,7 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) if (ctx->state == MSC_BBB_PROCESS_READ) { msc_process_read(ctx); } else if (ctx->state == MSC_BBB_PROCESS_WRITE) { - msc_queue_write(ctx); + msc_queue_bulk_out_ep(evt.c_data, true); } else if (ctx->state == MSC_BBB_SEND_CSW) { msc_send_csw(ctx); } @@ -991,27 +885,14 @@ struct usbd_class_api msc_bot_api = { .init = msc_bot_init, }; -#define BUF_NAME(x, i) scsi_buf##i##_##x - -#define DEFINE_SCSI_BUF(x, i) \ - UDC_STATIC_BUF_DEFINE(BUF_NAME(x, i), CONFIG_USBD_MSC_SCSI_BUFFER_SIZE); - -#define DEFINE_SCSI_BUFS(x) \ - DEFINE_SCSI_BUF(x, 0) \ - IF_ENABLED(CONFIG_USBD_MSC_DOUBLE_BUFFERING, (DEFINE_SCSI_BUF(x, 1))) - -#define NAME_SCSI_BUFS(x) \ - BUF_NAME(x, 0) \ - IF_ENABLED(CONFIG_USBD_MSC_DOUBLE_BUFFERING, (, BUF_NAME(x, 1))) - #define DEFINE_MSC_BOT_CLASS_DATA(x, _) \ - DEFINE_SCSI_BUFS(x) \ + UDC_STATIC_BUF_DEFINE(scsi_buf_##x, CONFIG_USBD_MSC_SCSI_BUFFER_SIZE); \ \ static struct msc_bot_ctx msc_bot_ctx_##x = { \ .desc = &msc_bot_desc_##x, \ .fs_desc = msc_bot_fs_desc_##x, \ .hs_desc = msc_bot_hs_desc_##x, \ - .scsi_bufs = { NAME_SCSI_BUFS(x) }, \ + .scsi_buf = scsi_buf_##x \ }; \ \ USBD_DEFINE_CLASS(msc_##x, &msc_bot_api, &msc_bot_ctx_##x, \ From 1762cddcee552591c53028e87ba21c3f8a010385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0901/3334] Revert "[nrf fromtree] usb: device_next: msc: stall endpoints on enqueue error" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8321de52c5cb87435364638ad4e36fa562bb7c3f. Signed-off-by: Tomasz Moń --- subsys/usb/device_next/class/usbd_msc.c | 56 ++++++++++--------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index ee5784ae00ca..6e6c75f671e9 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -214,31 +214,6 @@ static uint8_t msc_get_bulk_out(struct usbd_class_data *const c_data) return desc->if0_out_ep.bEndpointAddress; } -static void msc_stall_bulk_out_ep(struct usbd_class_data *const c_data) -{ - uint8_t ep; - - ep = msc_get_bulk_out(c_data); - usbd_ep_set_halt(usbd_class_get_ctx(c_data), ep); -} - -static void msc_stall_bulk_in_ep(struct usbd_class_data *const c_data) -{ - uint8_t ep; - - ep = msc_get_bulk_in(c_data); - usbd_ep_set_halt(usbd_class_get_ctx(c_data), ep); -} - -static void msc_stall_and_wait_for_recovery(struct msc_bot_ctx *ctx) -{ - atomic_set_bit(&ctx->bits, MSC_BULK_IN_WEDGED); - atomic_set_bit(&ctx->bits, MSC_BULK_OUT_WEDGED); - msc_stall_bulk_in_ep(ctx->class_node); - msc_stall_bulk_out_ep(ctx->class_node); - ctx->state = MSC_BBB_WAIT_FOR_RESET_RECOVERY; -} - static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); @@ -271,11 +246,25 @@ static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool dat LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); atomic_clear_bit(&ctx->bits, MSC_BULK_OUT_QUEUED); - /* 6.6.2 Internal Device Error */ - msc_stall_and_wait_for_recovery(ctx); } } +static void msc_stall_bulk_out_ep(struct usbd_class_data *const c_data) +{ + uint8_t ep; + + ep = msc_get_bulk_out(c_data); + usbd_ep_set_halt(usbd_class_get_ctx(c_data), ep); +} + +static void msc_stall_bulk_in_ep(struct usbd_class_data *const c_data) +{ + uint8_t ep; + + ep = msc_get_bulk_in(c_data); + usbd_ep_set_halt(usbd_class_get_ctx(c_data), ep); +} + static void msc_reset_handler(struct usbd_class_data *c_data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); @@ -354,8 +343,6 @@ static void msc_process_read(struct msc_bot_ctx *ctx) LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); - /* 6.6.2 Internal Device Error */ - msc_stall_and_wait_for_recovery(ctx); } } @@ -513,7 +500,11 @@ static void msc_handle_bulk_out(struct msc_bot_ctx *ctx, } else { /* 6.6.1 CBW Not Valid */ LOG_INF("Invalid CBW"); - msc_stall_and_wait_for_recovery(ctx); + atomic_set_bit(&ctx->bits, MSC_BULK_IN_WEDGED); + atomic_set_bit(&ctx->bits, MSC_BULK_OUT_WEDGED); + msc_stall_bulk_in_ep(ctx->class_node); + msc_stall_bulk_out_ep(ctx->class_node); + ctx->state = MSC_BBB_WAIT_FOR_RESET_RECOVERY; } } else if (ctx->state == MSC_BBB_PROCESS_WRITE) { msc_process_write(ctx, buf, len); @@ -576,11 +567,8 @@ static void msc_send_csw(struct msc_bot_ctx *ctx) LOG_ERR("Failed to enqueue net_buf for 0x%02x", ep); net_buf_unref(buf); atomic_clear_bit(&ctx->bits, MSC_BULK_IN_QUEUED); - /* 6.6.2 Internal Device Error */ - msc_stall_and_wait_for_recovery(ctx); - } else { - ctx->state = MSC_BBB_WAIT_FOR_CSW_SENT; } + ctx->state = MSC_BBB_WAIT_FOR_CSW_SENT; } static void usbd_msc_handle_request(struct usbd_class_data *c_data, From 05377ec1555c14f802e5e32500a3b1de7a9ccc0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0902/3334] Revert "[nrf fromlist] doc: networking: Add Wi-Fi P2P info" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 47a5d74b4b30312280a1a5a99085c6bad8e9f3e7. Signed-off-by: Tomasz Moń --- doc/connectivity/networking/api/wifi.rst | 14 -------------- doc/releases/release-notes-4.4.rst | 6 ------ 2 files changed, 20 deletions(-) diff --git a/doc/connectivity/networking/api/wifi.rst b/doc/connectivity/networking/api/wifi.rst index e50a1f9fc74b..e0be44835443 100644 --- a/doc/connectivity/networking/api/wifi.rst +++ b/doc/connectivity/networking/api/wifi.rst @@ -10,7 +10,6 @@ The Wi-Fi management API is used to manage Wi-Fi networks. It supports below mod * IEEE802.11 Station (STA) * IEEE802.11 Access Point (AP) -* IEEE802.11 P2P (Wi-Fi Direct) Only personal mode security is supported with below types: @@ -216,19 +215,6 @@ The test certificates in ``samples/net/wifi/test_certs/rsa2k`` are generated usi .. note:: These certificates are for testing only and should not be used in production. -Wi-Fi P2P (Wi-Fi Direct) -************************ - -Wi-Fi P2P or Wi-Fi Direct enables devices to communicate directly with each other without requiring -a traditional access point. This feature is particularly useful for device-to-device communication -scenarios. - -To enable and build with Wi-Fi P2P support: - -.. code-block:: bash - - $ west build -p -b samples/net/wifi/shell -- -DCONFIG_WIFI_NM_WPA_SUPPLICANT_P2P=y - API Reference ************* diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index b74d1670107e..a5e1e49dd9c3 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -109,12 +109,6 @@ New APIs and options * :kconfig:option:`CONFIG_NVMEM_FLASH` * :kconfig:option:`CONFIG_NVMEM_FLASH_WRITE` -* Networking - - * Wi-Fi - - * Add support for Wi-Fi Direct (P2P) mode. - * Settings * :kconfig:option:`CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION` From 6076b776fddb8d06b70dd3b8aba6e7cdfd6c135d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:27 +0100 Subject: [PATCH 0903/3334] Revert "[nrf fromtree] doc: releases: 4.4: Add NVMEM entry for flash device support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8c772e3d978dbcbf649c01cb135e01394927aec5. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.4.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index a5e1e49dd9c3..9aa8719c7edc 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -102,13 +102,6 @@ New APIs and options * :dtcompatible:`jedec,mspi-nor` now allows MSPI configuration of read, write and control commands separately via devicetree. -* NVMEM - - * Flash device support - - * :kconfig:option:`CONFIG_NVMEM_FLASH` - * :kconfig:option:`CONFIG_NVMEM_FLASH_WRITE` - * Settings * :kconfig:option:`CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION` From 731d803baa42165329006bc7634cf1fd3e62d404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0904/3334] Revert "[nrf noup] net: l2: wifi: Fix getopt handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6f4fa1e7da65fefa4f2743e4aa87b38103229644. Signed-off-by: Tomasz Moń --- subsys/net/l2/wifi/wifi_shell.c | 82 ++++++++++++++++----------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index f27fe5a6ffcd..220b8bee7633 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3651,19 +3651,19 @@ static int cmd_wifi_p2p_find(const struct shell *sh, size_t argc, char *argv[]) if (argc > 1) { int opt; int opt_index = 0; - struct getopt_state *state; - static const struct option long_options[] = { - {"timeout", required_argument, 0, 't'}, - {"type", required_argument, 0, 'T'}, - {"iface", required_argument, 0, 'i'}, - {"help", no_argument, 0, 'h'}, + struct sys_getopt_state *state; + static const struct sys_getopt_option long_options[] = { + {"timeout", sys_getopt_required_argument, 0, 't'}, + {"type", sys_getopt_required_argument, 0, 'T'}, + {"iface", sys_getopt_required_argument, 0, 'i'}, + {"help", sys_getopt_no_argument, 0, 'h'}, {0, 0, 0, 0} }; long val; - while ((opt = getopt_long(argc, argv, "t:T:i:h", + while ((opt = sys_getopt_long(argc, argv, "t:T:i:h", long_options, &opt_index)) != -1) { - state = getopt_state_get(); + state = sys_getopt_state_get(); switch (opt) { case 't': if (!parse_number(sh, &val, state->optarg, "timeout", 0, 65535)) { @@ -3735,12 +3735,12 @@ static int cmd_wifi_p2p_connect(const struct shell *sh, size_t argc, char *argv[ const char *method_arg = NULL; int opt; int opt_index = 0; - struct getopt_state *state; - static const struct option long_options[] = { - {"go-intent", required_argument, 0, 'g'}, - {"freq", required_argument, 0, 'f'}, - {"iface", required_argument, 0, 'i'}, - {"help", no_argument, 0, 'h'}, + struct sys_getopt_state *state; + static const struct sys_getopt_option long_options[] = { + {"go-intent", sys_getopt_required_argument, 0, 'g'}, + {"freq", sys_getopt_required_argument, 0, 'f'}, + {"iface", sys_getopt_required_argument, 0, 'i'}, + {"help", sys_getopt_no_argument, 0, 'h'}, {0, 0, 0, 0} }; long val; @@ -3784,8 +3784,8 @@ static int cmd_wifi_p2p_connect(const struct shell *sh, size_t argc, char *argv[ /* Set default frequency to 2462 MHz (channel 11, 2.4 GHz) */ params.connect.freq = 2462; - while ((opt = getopt_long(argc, argv, "g:f:i:h", long_options, &opt_index)) != -1) { - state = getopt_state_get(); + while ((opt = sys_getopt_long(argc, argv, "g:f:i:h", long_options, &opt_index)) != -1) { + state = sys_getopt_state_get(); switch (opt) { case 'g': if (!parse_number(sh, &val, state->optarg, "go-intent", 0, 15)) { @@ -3833,17 +3833,17 @@ static int cmd_wifi_p2p_group_add(const struct shell *sh, size_t argc, char *arg struct wifi_p2p_params params = {0}; int opt; int opt_index = 0; - struct getopt_state *state; - static const struct option long_options[] = { - {"freq", required_argument, 0, 'f'}, - {"persistent", required_argument, 0, 'p'}, - {"ht40", no_argument, 0, 'h'}, - {"vht", no_argument, 0, 'v'}, - {"he", no_argument, 0, 'H'}, - {"edmg", no_argument, 0, 'e'}, - {"go-bssid", required_argument, 0, 'b'}, - {"iface", required_argument, 0, 'i'}, - {"help", no_argument, 0, '?'}, + struct sys_getopt_state *state; + static const struct sys_getopt_option long_options[] = { + {"freq", sys_getopt_required_argument, 0, 'f'}, + {"persistent", sys_getopt_required_argument, 0, 'p'}, + {"ht40", sys_getopt_no_argument, 0, 'h'}, + {"vht", sys_getopt_no_argument, 0, 'v'}, + {"he", sys_getopt_no_argument, 0, 'H'}, + {"edmg", sys_getopt_no_argument, 0, 'e'}, + {"go-bssid", sys_getopt_required_argument, 0, 'b'}, + {"iface", sys_getopt_required_argument, 0, 'i'}, + {"help", sys_getopt_no_argument, 0, '?'}, {0, 0, 0, 0} }; long val; @@ -3860,9 +3860,9 @@ static int cmd_wifi_p2p_group_add(const struct shell *sh, size_t argc, char *arg params.group_add.edmg = false; params.group_add.go_bssid_length = 0; - while ((opt = getopt_long(argc, argv, "f:p:hvHeb:i:?", long_options, + while ((opt = sys_getopt_long(argc, argv, "f:p:hvHeb:i:?", long_options, &opt_index)) != -1) { - state = getopt_state_get(); + state = sys_getopt_state_get(); switch (opt) { case 'f': if (!parse_number(sh, &val, state->optarg, "freq", 0, 6000)) { @@ -3951,15 +3951,15 @@ static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[] uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; int opt; int opt_index = 0; - struct getopt_state *state; - static const struct option long_options[] = { - {"persistent", required_argument, 0, 'p'}, - {"group", required_argument, 0, 'g'}, - {"peer", required_argument, 0, 'P'}, - {"freq", required_argument, 0, 'f'}, - {"go-dev-addr", required_argument, 0, 'd'}, - {"iface", required_argument, 0, 'i'}, - {"help", no_argument, 0, 'h'}, + struct sys_getopt_state *state; + static const struct sys_getopt_option long_options[] = { + {"persistent", sys_getopt_required_argument, 0, 'p'}, + {"group", sys_getopt_required_argument, 0, 'g'}, + {"peer", sys_getopt_required_argument, 0, 'P'}, + {"freq", sys_getopt_required_argument, 0, 'f'}, + {"go-dev-addr", sys_getopt_required_argument, 0, 'd'}, + {"iface", sys_getopt_required_argument, 0, 'i'}, + {"help", sys_getopt_no_argument, 0, 'h'}, {0, 0, 0, 0} }; long val; @@ -3980,9 +3980,9 @@ static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[] return -EINVAL; } - while ((opt = getopt_long(argc, argv, "p:g:P:f:d:i:h", long_options, + while ((opt = sys_getopt_long(argc, argv, "p:g:P:f:d:i:h", long_options, &opt_index)) != -1) { - state = getopt_state_get(); + state = sys_getopt_state_get(); switch (opt) { case 'p': if (!parse_number(sh, &val, state->optarg, "persistent", 0, 255)) { @@ -4034,7 +4034,7 @@ static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[] } } - state = getopt_state_get(); + state = sys_getopt_state_get(); if (params.invite.type == WIFI_P2P_INVITE_PERSISTENT && params.invite.persistent_id >= 0 && From 7f3ed11a7cdf762c24a0940fe8f8c88cd12dd1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0905/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Suppress 11b rates in P2P scan" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d0922ddbab87a45fea42d60895e92eefd074aabb. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 5885247f342e..ea88c6b2f729 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -558,10 +558,6 @@ int nrf_wifi_wpa_supp_scan2(void *if_priv, struct wpa_driver_scan_params *params } } - if (params->p2p_probe) { - scan_info->scan_params.no_cck = 1; - } - scan_info->scan_reason = SCAN_CONNECT; /* Copy extra_ies */ From 79d1eb3eccae91ceb18067c84ba6b051b030838f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0906/3334] Revert "[nrf fromlist] net: wifi: Add P2P power save shell command support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9df8e63c054666af123e68d3a479f82d2da8a1b1. Signed-off-by: Tomasz Moń --- subsys/net/l2/wifi/wifi_shell.c | 41 --------------------------------- 1 file changed, 41 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 220b8bee7633..71ff72eff5dc 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -4076,40 +4076,6 @@ static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[] PR("P2P invite initiated\n"); return 0; } - -static int cmd_wifi_p2p_power_save(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_p2p_params params = {0}; - bool power_save_enable = false; - - context.sh = sh; - - if (argc < 2) { - PR_ERROR("Usage: wifi p2p power_save \n"); - return -EINVAL; - } - - if (strcmp(argv[1], "on") == 0) { - power_save_enable = true; - } else if (strcmp(argv[1], "off") == 0) { - power_save_enable = false; - } else { - PR_ERROR("Invalid argument. Use 'on' or 'off'\n"); - return -EINVAL; - } - - params.oper = WIFI_P2P_POWER_SAVE; - params.power_save = power_save_enable; - - if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { - PR_WARNING("P2P power save request failed\n"); - return -ENOEXEC; - } - - PR("P2P power save %s\n", power_save_enable ? "enabled" : "disabled"); - return 0; -} #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[]) @@ -4885,13 +4851,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( "[-d, --go-dev-addr=]: GO device address (for group type)\n" "[-i, --iface=]: Interface index\n", cmd_wifi_p2p_invite, 2, 8), - SHELL_CMD_ARG(power_save, NULL, - "Set P2P power save mode\n" - "Usage: power_save \n" - ": Enable P2P power save\n" - ": Disable P2P power save\n" - "[-i, --iface=]: Interface index\n", - cmd_wifi_p2p_power_save, 2, 3), SHELL_SUBCMD_SET_END ); From d0ddb4aa97bff63797d9f719f2cad5c6c4075489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0907/3334] Revert "[nrf fromlist] net: wifi: Add API support for P2P power save" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 452b60c80ed8c8b2f130772c5fcfd3ec7a2e9d2f. Signed-off-by: Tomasz Moń --- include/zephyr/net/wifi_mgmt.h | 4 ---- modules/hostap/src/supp_api.c | 14 -------------- 2 files changed, 18 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 434e27941965..389ab70d7e7e 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -1473,8 +1473,6 @@ enum wifi_p2p_op { WIFI_P2P_GROUP_REMOVE, /** P2P invite */ WIFI_P2P_INVITE, - /** P2P power save */ - WIFI_P2P_POWER_SAVE, }; /** Wi-Fi P2P discovery type */ @@ -1516,8 +1514,6 @@ struct wifi_p2p_params { struct wifi_p2p_device_info *peers; /** Actual number of peers returned */ uint16_t peer_count; - /** Power save enabled (for power save operation) */ - bool power_save; /** Connect specific parameters */ struct { /** Connection method */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 04c9b7d81e01..2532a11f865e 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -3043,20 +3043,6 @@ int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params break; } - case WIFI_P2P_POWER_SAVE: - snprintk(cmd_buf, sizeof(cmd_buf), "p2p_set ps %d", params->power_save ? 1 : 0); - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); - if (ret < 0) { - wpa_printf(MSG_ERROR, "p2p_set ps command failed: %d", ret); - return -EIO; - } - if (os_strncmp(resp_buf, "FAIL", 4) == 0) { - wpa_printf(MSG_ERROR, "p2p_set ps command returned FAIL"); - return -EIO; - } - ret = 0; - break; - default: wpa_printf(MSG_ERROR, "Unknown P2P operation: %d", params->oper); ret = -EINVAL; From 13775098ca4c5686edaf865b94293f62e5c9a8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0908/3334] Revert "[nrf fromlist] manifest: hostap: Pull in P2P powersave support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4263ac9d90f41815e6db96f7ef2f165df52b3c5b. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index daa021a445f4..639d34d1900b 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 528eb2d95e35c7c9b187a15d2fb7f6e5bb983181 + revision: 51698b0f5fdac2778484f565d4591fcb1dd92bc4 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From e8af0975fe706a7009ba2c41aff049458e454d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0909/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Add cookie handling support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 524641ca012091fa491e745a429a954b187d7e29. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/inc/wpa_supp_if.h | 5 ++--- drivers/wifi/nrf_wifi/src/fmac_main.c | 5 ----- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 11 +++++------ 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h index 321705308d1a..b4ec7545be49 100644 --- a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h +++ b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h @@ -131,9 +131,8 @@ void nrf_wifi_supp_event_roc_cancel_complete(void *os_vif_ctx, unsigned int event_len); int nrf_wifi_supp_set_country(void *if_priv, const char *alpha2); int nrf_wifi_supp_get_country(void *if_priv, char *alpha2); -int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, - unsigned int duration, u64 host_cookie); -int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv, u64 rpu_cookie); +int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration); +int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv); int nrf_wifi_supp_set_p2p_powersave(void *if_priv, int legacy_ps, int opp_ps, int ctwindow); #endif /* CONFIG_NRF70_STA_MODE */ diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 9e8ae2aafb93..8aaac5c2b964 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -452,11 +452,6 @@ void nrf_wifi_event_proc_cookie_rsp(void *vif_ctx, /* TODO: When supp_callbk_fns.mgmt_tx_status is implemented, add logic * here to use the cookie and host_cookie to map requests to responses. */ - if (vif_ctx_zep->supp_drv_if_ctx && - vif_ctx_zep->supp_callbk_fns.cookie_event) { - vif_ctx_zep->supp_callbk_fns.cookie_event(vif_ctx_zep->supp_drv_if_ctx, - cookie_rsp_event->host_cookie, cookie_rsp_event->cookie); - } } #endif /* CONFIG_NRF70_STA_MODE */ diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index ea88c6b2f729..73d9988174b8 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -2021,7 +2021,7 @@ void nrf_wifi_supp_event_remain_on_channel(void *if_priv, if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_complete) { vif_ctx_zep->supp_callbk_fns.roc_complete(vif_ctx_zep->supp_drv_if_ctx, roc_complete->frequency, - roc_complete->dur, roc_complete->cookie); + roc_complete->dur); } } @@ -2050,12 +2050,12 @@ void nrf_wifi_supp_event_roc_cancel_complete(void *if_priv, if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_cancel_complete) { vif_ctx_zep->supp_callbk_fns.roc_cancel_complete(vif_ctx_zep->supp_drv_if_ctx, - roc_cancel_complete->frequency, roc_cancel_complete->cookie); + roc_cancel_complete->frequency); } } int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, - unsigned int duration, u64 host_cookie) + unsigned int duration) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; #ifdef NRF70_P2P_MODE @@ -2088,7 +2088,6 @@ int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, roc_info.nrf_wifi_freq_params.center_frequency2 = 0; roc_info.nrf_wifi_freq_params.channel_type = NRF_WIFI_CHAN_HT20; roc_info.dur = duration; - roc_info.host_cookie = host_cookie; status = nrf_wifi_sys_fmac_p2p_roc_start(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &roc_info); @@ -2102,7 +2101,7 @@ int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, return status; } -int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv, u64 cookie) +int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; #ifdef NRF70_P2P_MODE @@ -2127,7 +2126,7 @@ int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv, u64 cookie) goto out; } - status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, cookie); + status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, 0); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_fmac_cancel_remain_on_channel failed", __func__); goto out; From 1c94cb59ba135bde5bdd3ca1892fa27fa390c814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0910/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Add P2P powersave support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 01d16d61e978db274713d01362b019e65e4f25a6. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/inc/wpa_supp_if.h | 1 - drivers/wifi/nrf_wifi/src/fmac_main.c | 1 - drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 45 ------------------------- 3 files changed, 47 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h index b4ec7545be49..28aadae28ebd 100644 --- a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h +++ b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h @@ -133,7 +133,6 @@ int nrf_wifi_supp_set_country(void *if_priv, const char *alpha2); int nrf_wifi_supp_get_country(void *if_priv, char *alpha2); int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration); int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv); -int nrf_wifi_supp_set_p2p_powersave(void *if_priv, int legacy_ps, int opp_ps, int ctwindow); #endif /* CONFIG_NRF70_STA_MODE */ #ifdef CONFIG_NRF70_AP_MODE diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 8aaac5c2b964..00ea3a873c85 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -967,7 +967,6 @@ static const struct zep_wpa_supp_dev_ops wpa_supp_ops = { .get_country = nrf_wifi_supp_get_country, .remain_on_channel = nrf_wifi_supp_remain_on_channel, .cancel_remain_on_channel = nrf_wifi_supp_cancel_remain_on_channel, - .set_p2p_powersave = nrf_wifi_supp_set_p2p_powersave, #ifdef CONFIG_NRF70_AP_MODE .init_ap = nrf_wifi_wpa_supp_init_ap, .start_ap = nrf_wifi_wpa_supp_start_ap, diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 73d9988174b8..fabf2df96f87 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -2137,51 +2137,6 @@ int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv) return status; } -int nrf_wifi_supp_set_p2p_powersave(void *if_priv, int legacy_ps, int opp_ps, int ctwindow) -{ - enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; -#ifdef NRF70_P2P_MODE - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - - if (!if_priv) { - LOG_ERR("%s: Invalid params", __func__); - return -1; - } - vif_ctx_zep = if_priv; - rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - if (!rpu_ctx_zep) { - LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); - return -1; - } - k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); - if (!rpu_ctx_zep->rpu_ctx) { - LOG_DBG("%s: RPU context not initialized", __func__); - goto out; - } - - if (legacy_ps == -1) { - status = 0; - goto out; - } - - if (legacy_ps != 0 && legacy_ps != 1) { - LOG_ERR("%s: Invalid legacy_ps value: %d", __func__, legacy_ps); - goto out; - } - - status = nrf_wifi_sys_fmac_set_power_save(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, - legacy_ps); - if (status != NRF_WIFI_STATUS_SUCCESS) { - LOG_ERR("%s: nrf_wifi_fmac_set_p2p_powersave failed", __func__); - goto out; - } -out: - k_mutex_unlock(&vif_ctx_zep->vif_lock); -#endif /* NRF70_P2P_MODE */ - return status; -} - #ifdef CONFIG_NRF70_AP_MODE static int nrf_wifi_vif_state_change(struct nrf_wifi_vif_ctx_zep *vif_ctx_zep, enum nrf_wifi_fmac_if_op_state state) From 128659ed6af22252df6587e4b587b15d316a0958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0911/3334] Revert "[nrf fromlist] net: wifi: Add Wi-Fi direct P2P GO mode shell command" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3d0beda7f7c538e8e62bd714130aa4ebf6997175. Signed-off-by: Tomasz Moń --- subsys/net/l2/wifi/wifi_shell.c | 279 -------------------------------- 1 file changed, 279 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 71ff72eff5dc..b468212589ed 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3826,256 +3826,6 @@ static int cmd_wifi_p2p_connect(const struct shell *sh, size_t argc, char *argv[ } return 0; } - -static int cmd_wifi_p2p_group_add(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_p2p_params params = {0}; - int opt; - int opt_index = 0; - struct sys_getopt_state *state; - static const struct sys_getopt_option long_options[] = { - {"freq", sys_getopt_required_argument, 0, 'f'}, - {"persistent", sys_getopt_required_argument, 0, 'p'}, - {"ht40", sys_getopt_no_argument, 0, 'h'}, - {"vht", sys_getopt_no_argument, 0, 'v'}, - {"he", sys_getopt_no_argument, 0, 'H'}, - {"edmg", sys_getopt_no_argument, 0, 'e'}, - {"go-bssid", sys_getopt_required_argument, 0, 'b'}, - {"iface", sys_getopt_required_argument, 0, 'i'}, - {"help", sys_getopt_no_argument, 0, '?'}, - {0, 0, 0, 0} - }; - long val; - uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; - - context.sh = sh; - - params.oper = WIFI_P2P_GROUP_ADD; - params.group_add.freq = 0; - params.group_add.persistent = -1; - params.group_add.ht40 = false; - params.group_add.vht = false; - params.group_add.he = false; - params.group_add.edmg = false; - params.group_add.go_bssid_length = 0; - - while ((opt = sys_getopt_long(argc, argv, "f:p:hvHeb:i:?", long_options, - &opt_index)) != -1) { - state = sys_getopt_state_get(); - switch (opt) { - case 'f': - if (!parse_number(sh, &val, state->optarg, "freq", 0, 6000)) { - return -EINVAL; - } - params.group_add.freq = (int)val; - break; - case 'p': - if (!parse_number(sh, &val, state->optarg, "persistent", -1, 255)) { - return -EINVAL; - } - params.group_add.persistent = (int)val; - break; - case 'h': - params.group_add.ht40 = true; - break; - case 'v': - params.group_add.vht = true; - params.group_add.ht40 = true; - break; - case 'H': - params.group_add.he = true; - break; - case 'e': - params.group_add.edmg = true; - break; - case 'b': - if (sscanf(state->optarg, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &mac_addr[0], &mac_addr[1], &mac_addr[2], &mac_addr[3], - &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { - PR_ERROR("Invalid GO BSSID format. Use: XX:XX:XX:XX:XX:XX\n"); - return -EINVAL; - } - memcpy(params.group_add.go_bssid, mac_addr, WIFI_MAC_ADDR_LEN); - params.group_add.go_bssid_length = WIFI_MAC_ADDR_LEN; - break; - case 'i': - /* Unused, but parsing to avoid unknown option error */ - break; - case '?': - shell_help(sh); - return -ENOEXEC; - default: - PR_ERROR("Invalid option %c\n", state->optopt); - return -EINVAL; - } - } - - if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { - PR_WARNING("P2P group add request failed\n"); - return -ENOEXEC; - } - PR("P2P group add initiated\n"); - return 0; -} - -static int cmd_wifi_p2p_group_remove(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_p2p_params params = {0}; - - context.sh = sh; - - if (argc < 2) { - PR_ERROR("Interface name required. Usage: wifi p2p group_remove \n"); - return -EINVAL; - } - - params.oper = WIFI_P2P_GROUP_REMOVE; - strncpy(params.group_remove.ifname, argv[1], - CONFIG_NET_INTERFACE_NAME_LEN); - params.group_remove.ifname[CONFIG_NET_INTERFACE_NAME_LEN] = '\0'; - - if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { - PR_WARNING("P2P group remove request failed\n"); - return -ENOEXEC; - } - PR("P2P group remove initiated\n"); - return 0; -} - -static int cmd_wifi_p2p_invite(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_p2p_params params = {0}; - uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; - int opt; - int opt_index = 0; - struct sys_getopt_state *state; - static const struct sys_getopt_option long_options[] = { - {"persistent", sys_getopt_required_argument, 0, 'p'}, - {"group", sys_getopt_required_argument, 0, 'g'}, - {"peer", sys_getopt_required_argument, 0, 'P'}, - {"freq", sys_getopt_required_argument, 0, 'f'}, - {"go-dev-addr", sys_getopt_required_argument, 0, 'd'}, - {"iface", sys_getopt_required_argument, 0, 'i'}, - {"help", sys_getopt_no_argument, 0, 'h'}, - {0, 0, 0, 0} - }; - long val; - - context.sh = sh; - - params.oper = WIFI_P2P_INVITE; - params.invite.type = WIFI_P2P_INVITE_PERSISTENT; - params.invite.persistent_id = -1; - params.invite.group_ifname[0] = '\0'; - params.invite.freq = 0; - params.invite.go_dev_addr_length = 0; - memset(params.invite.peer_addr, 0, WIFI_MAC_ADDR_LEN); - - if (argc < 2) { - PR_ERROR("Usage: wifi p2p invite --persistent= OR " - "wifi p2p invite --group= --peer= [options]\n"); - return -EINVAL; - } - - while ((opt = sys_getopt_long(argc, argv, "p:g:P:f:d:i:h", long_options, - &opt_index)) != -1) { - state = sys_getopt_state_get(); - switch (opt) { - case 'p': - if (!parse_number(sh, &val, state->optarg, "persistent", 0, 255)) { - return -EINVAL; - } - params.invite.type = WIFI_P2P_INVITE_PERSISTENT; - params.invite.persistent_id = (int)val; - break; - case 'g': - params.invite.type = WIFI_P2P_INVITE_GROUP; - strncpy(params.invite.group_ifname, state->optarg, - CONFIG_NET_INTERFACE_NAME_LEN); - params.invite.group_ifname[CONFIG_NET_INTERFACE_NAME_LEN] = '\0'; - break; - case 'P': - if (sscanf(state->optarg, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &mac_addr[0], &mac_addr[1], &mac_addr[2], &mac_addr[3], - &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { - PR_ERROR("Invalid peer MAC address format\n"); - return -EINVAL; - } - memcpy(params.invite.peer_addr, mac_addr, WIFI_MAC_ADDR_LEN); - break; - case 'f': - if (!parse_number(sh, &val, state->optarg, "freq", 0, 6000)) { - return -EINVAL; - } - params.invite.freq = (int)val; - break; - case 'd': - if (sscanf(state->optarg, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &mac_addr[0], &mac_addr[1], &mac_addr[2], &mac_addr[3], - &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { - PR_ERROR("Invalid GO device address format\n"); - return -EINVAL; - } - memcpy(params.invite.go_dev_addr, mac_addr, WIFI_MAC_ADDR_LEN); - params.invite.go_dev_addr_length = WIFI_MAC_ADDR_LEN; - break; - case 'i': - /* Unused, but parsing to avoid unknown option error */ - break; - case 'h': - shell_help(sh); - return -ENOEXEC; - default: - PR_ERROR("Invalid option %c\n", state->optopt); - return -EINVAL; - } - } - - state = sys_getopt_state_get(); - - if (params.invite.type == WIFI_P2P_INVITE_PERSISTENT && - params.invite.persistent_id >= 0 && - params.invite.peer_addr[0] == 0 && params.invite.peer_addr[1] == 0 && - argc > state->optind && argv[state->optind][0] != '-') { - if (sscanf(argv[state->optind], "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &mac_addr[0], &mac_addr[1], &mac_addr[2], &mac_addr[3], - &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { - PR_ERROR("Invalid peer MAC address format\n"); - return -EINVAL; - } - memcpy(params.invite.peer_addr, mac_addr, WIFI_MAC_ADDR_LEN); - } - - if (params.invite.type == WIFI_P2P_INVITE_PERSISTENT) { - if (params.invite.persistent_id < 0) { - PR_ERROR("Persistent group ID required. Use --persistent=\n"); - return -EINVAL; - } - if (params.invite.peer_addr[0] == 0 && params.invite.peer_addr[1] == 0) { - PR_ERROR("Peer MAC address required\n"); - return -EINVAL; - } - } else if (params.invite.type == WIFI_P2P_INVITE_GROUP) { - if (params.invite.group_ifname[0] == '\0') { - PR_ERROR("Group interface name required. Use --group=\n"); - return -EINVAL; - } - if (params.invite.peer_addr[0] == 0 && params.invite.peer_addr[1] == 0) { - PR_ERROR("Peer MAC address required. Use --peer=\n"); - return -EINVAL; - } - } - - if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { - PR_WARNING("P2P invite request failed\n"); - return -ENOEXEC; - } - PR("P2P invite initiated\n"); - return 0; -} #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[]) @@ -4822,35 +4572,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( " wifi p2p connect 9c:b1:50:e3:81:96 pin -g 0 (displays PIN)\n" " wifi p2p connect 9c:b1:50:e3:81:96 pin 12345670 -g 0 (uses PIN)\n", cmd_wifi_p2p_connect, 3, 5), - SHELL_CMD_ARG(group_add, NULL, - "Add a P2P group (start as GO)\n" - "Usage: group_add [options]\n" - "[-f, --freq=]: Frequency in MHz (0 = auto)\n" - "[-p, --persistent=]: Persistent group ID (-1 = not persistent)\n" - "[-h, --ht40]: Enable HT40\n" - "[-v, --vht]: Enable VHT (also enables HT40)\n" - "[-H, --he]: Enable HE\n" - "[-e, --edmg]: Enable EDMG\n" - "[-b, --go-bssid=]: GO BSSID (format: XX:XX:XX:XX:XX:XX)\n" - "[-i, --iface=]: Interface index\n", - cmd_wifi_p2p_group_add, 1, 10), - SHELL_CMD_ARG(group_remove, NULL, - "Remove a P2P group\n" - "Usage: group_remove \n" - ": Interface name (e.g., wlan0)\n" - "[-i, --iface=]: Interface index\n", - cmd_wifi_p2p_group_remove, 2, 3), - SHELL_CMD_ARG(invite, NULL, - "Invite a peer to a P2P group\n" - "Usage: invite --persistent= OR\n" - " invite --group= --peer= [options]\n" - "[-p, --persistent=]: Persistent group ID\n" - "[-g, --group=]: Group interface name\n" - "[-P, --peer=]: Peer MAC address (format: XX:XX:XX:XX:XX:XX)\n" - "[-f, --freq=]: Frequency in MHz (0 = auto)\n" - "[-d, --go-dev-addr=]: GO device address (for group type)\n" - "[-i, --iface=]: Interface index\n", - cmd_wifi_p2p_invite, 2, 8), SHELL_SUBCMD_SET_END ); From 466460c67f3669aedeb1ab1a7b6eaedd285b901a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0912/3334] Revert "[nrf fromlist] net: wifi: Add API support for P2P GO mode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 56cb22713f6365998253a747891232eefdbf71f8. Signed-off-by: Tomasz Moń --- include/zephyr/net/wifi_mgmt.h | 50 ------------ modules/hostap/src/supp_api.c | 141 --------------------------------- 2 files changed, 191 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 389ab70d7e7e..6cc7039ade66 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -1467,12 +1467,6 @@ enum wifi_p2p_op { WIFI_P2P_PEER, /** P2P connect to peer */ WIFI_P2P_CONNECT, - /** P2P group add */ - WIFI_P2P_GROUP_ADD, - /** P2P group remove */ - WIFI_P2P_GROUP_REMOVE, - /** P2P invite */ - WIFI_P2P_INVITE, }; /** Wi-Fi P2P discovery type */ @@ -1528,50 +1522,6 @@ struct wifi_p2p_params { /** Frequency in MHz (0 = not specified, use default) */ unsigned int freq; } connect; - /** Group add specific parameters */ - struct { - /** Frequency in MHz (0 = auto) */ - int freq; - /** Persistent group ID (-1 = not persistent) */ - int persistent; - /** Enable HT40 */ - bool ht40; - /** Enable VHT */ - bool vht; - /** Enable HE */ - bool he; - /** Enable EDMG */ - bool edmg; - /** GO BSSID (NULL = auto) */ - uint8_t go_bssid[WIFI_MAC_ADDR_LEN]; - /** GO BSSID length */ - uint8_t go_bssid_length; - } group_add; - /** Group remove specific parameters */ - struct { - /** Interface name (e.g., "wlan0") */ - char ifname[CONFIG_NET_INTERFACE_NAME_LEN + 1]; - } group_remove; - /** Invite specific parameters */ - struct { - /** Invite type: persistent or group */ - enum { - WIFI_P2P_INVITE_PERSISTENT = 0, - WIFI_P2P_INVITE_GROUP, - } type; - /** Persistent group ID (for persistent type) */ - int persistent_id; - /** Group interface name (for group type) */ - char group_ifname[CONFIG_NET_INTERFACE_NAME_LEN + 1]; - /** Peer MAC address */ - uint8_t peer_addr[WIFI_MAC_ADDR_LEN]; - /** Frequency in MHz (0 = auto) */ - int freq; - /** GO device address (for group type, NULL = auto) */ - uint8_t go_dev_addr[WIFI_MAC_ADDR_LEN]; - /** GO device address length */ - uint8_t go_dev_addr_length; - } invite; }; #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 2532a11f865e..8126b92274e1 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -2902,147 +2902,6 @@ int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params break; } - case WIFI_P2P_GROUP_ADD: { - int len = 0; - - if (!params) { - wpa_printf(MSG_ERROR, "P2P group add params are NULL"); - return -EINVAL; - } - - len = snprintk(cmd_buf, sizeof(cmd_buf), "P2P_GROUP_ADD"); - - if (params->group_add.freq > 0) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " freq=%d", - params->group_add.freq); - } - - if (params->group_add.persistent >= 0) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " persistent=%d", - params->group_add.persistent); - } - - if (params->group_add.ht40) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " ht40"); - } - - if (params->group_add.vht) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " vht"); - } - - if (params->group_add.he) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " he"); - } - - if (params->group_add.edmg) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " edmg"); - } - - if (params->group_add.go_bssid_length == WIFI_MAC_ADDR_LEN) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, - " go_bssid=%02x:%02x:%02x:%02x:%02x:%02x", - params->group_add.go_bssid[0], - params->group_add.go_bssid[1], - params->group_add.go_bssid[2], - params->group_add.go_bssid[3], - params->group_add.go_bssid[4], - params->group_add.go_bssid[5]); - } - - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); - if (ret < 0) { - wpa_printf(MSG_ERROR, "P2P_GROUP_ADD command failed: %d", ret); - return -EIO; - } - ret = 0; - break; - } - - case WIFI_P2P_GROUP_REMOVE: - if (!params) { - wpa_printf(MSG_ERROR, "P2P group remove params are NULL"); - return -EINVAL; - } - - if (params->group_remove.ifname[0] == '\0') { - wpa_printf(MSG_ERROR, "Interface name required for P2P_GROUP_REMOVE"); - return -EINVAL; - } - - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_GROUP_REMOVE %s", - params->group_remove.ifname); - - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); - if (ret < 0) { - wpa_printf(MSG_ERROR, "P2P_GROUP_REMOVE command failed: %d", ret); - return -EIO; - } - ret = 0; - break; - - case WIFI_P2P_INVITE: { - char addr_str[18]; - int len = 0; - - if (!params) { - wpa_printf(MSG_ERROR, "P2P invite params are NULL"); - return -EINVAL; - } - - snprintk(addr_str, sizeof(addr_str), "%02x:%02x:%02x:%02x:%02x:%02x", - params->invite.peer_addr[0], params->invite.peer_addr[1], - params->invite.peer_addr[2], params->invite.peer_addr[3], - params->invite.peer_addr[4], params->invite.peer_addr[5]); - - if (params->invite.type == WIFI_P2P_INVITE_PERSISTENT) { - if (params->invite.persistent_id < 0) { - wpa_printf(MSG_ERROR, "Persistent group ID required"); - return -EINVAL; - } - len = snprintk(cmd_buf, sizeof(cmd_buf), "P2P_INVITE persistent=%d peer=%s", - params->invite.persistent_id, addr_str); - - if (params->invite.freq > 0) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " freq=%d", - params->invite.freq); - } - } else if (params->invite.type == WIFI_P2P_INVITE_GROUP) { - if (params->invite.group_ifname[0] == '\0') { - wpa_printf(MSG_ERROR, "Group interface name required"); - return -EINVAL; - } - len = snprintk(cmd_buf, sizeof(cmd_buf), "P2P_INVITE group=%s peer=%s", - params->invite.group_ifname, addr_str); - - if (params->invite.freq > 0) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, " freq=%d", - params->invite.freq); - } - - if (params->invite.go_dev_addr_length == WIFI_MAC_ADDR_LEN) { - len += snprintk(cmd_buf + len, sizeof(cmd_buf) - len, - " go_dev_addr=%02x:%02x:%02x:%02x:%02x:%02x", - params->invite.go_dev_addr[0], - params->invite.go_dev_addr[1], - params->invite.go_dev_addr[2], - params->invite.go_dev_addr[3], - params->invite.go_dev_addr[4], - params->invite.go_dev_addr[5]); - } - } else { - wpa_printf(MSG_ERROR, "Invalid invite type: %d", params->invite.type); - return -EINVAL; - } - - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); - if (ret < 0) { - wpa_printf(MSG_ERROR, "P2P_INVITE command failed: %d", ret); - return -EIO; - } - ret = 0; - break; - } - default: wpa_printf(MSG_ERROR, "Unknown P2P operation: %d", params->oper); ret = -EINVAL; From b457706ea9488ae50789c78cde7383198232f455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0913/3334] Revert "[nrf fromlist] modules: hostap: Add support for P2P GO mode ops" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d8aae7024de29bf4430c8369413b09275e8478f0. Signed-off-by: Tomasz Moń --- modules/hostap/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 42ccd291fb10..dfa542233eef 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -383,9 +383,6 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS ${HOSTAP_SRC_BASE}/wps/wps_enrollee.c ${HOSTAP_SRC_BASE}/wps/wps_registrar.c ${HOSTAP_SRC_BASE}/crypto/dh_groups.c - ${HOSTAP_SRC_BASE}/eap_server/eap_server_wsc.c - ${HOSTAP_SRC_BASE}/eap_server/eap_server.c - ${HOSTAP_SRC_BASE}/eap_server/eap_server_methods.c ) zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P @@ -397,7 +394,6 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS CONFIG_WPS EAP_WSC - EAP_SERVER_WSC ) zephyr_library_sources_ifdef(CONFIG_WIFI_NM_HOSTAPD_WPS From 04a27b141d556a5cbb1bc32f832cea7b88f7941b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0914/3334] Revert "[nrf fromlist] drivers: nrf_wifi: Add default value to p2p mode Kconfig" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0571e4875a64afcbdcb45eed2fa30d47792e472a. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index be0ea854b2e2..2021d25580ae 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -119,7 +119,6 @@ config NRF70_ENABLE_DUAL_VIF config NRF70_P2P_MODE bool "P2P support in driver" - default y if WIFI_NM_WPA_SUPPLICANT_P2P config NRF70_SYSTEM_WITH_RAW_MODES bool "nRF70 system mode with raw modes" From 2e6c3aa2ddda44c4837b1ce6513b2db1a1a9ed2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0915/3334] Revert "[nrf fromlist] net: wifi: Add Wi-Fi direct P2P connect shell command support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1a582c274b1538e11d609ca43fe41c2a822d4270. Signed-off-by: Tomasz Moń --- subsys/net/l2/wifi/wifi_shell.c | 117 -------------------------------- 1 file changed, 117 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index b468212589ed..91e342f81bd0 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3726,106 +3726,6 @@ static int cmd_wifi_p2p_stop_find(const struct shell *sh, size_t argc, char *arg PR("P2P find stopped\n"); return 0; } - -static int cmd_wifi_p2p_connect(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_p2p_params params = {0}; - uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; - const char *method_arg = NULL; - int opt; - int opt_index = 0; - struct sys_getopt_state *state; - static const struct sys_getopt_option long_options[] = { - {"go-intent", sys_getopt_required_argument, 0, 'g'}, - {"freq", sys_getopt_required_argument, 0, 'f'}, - {"iface", sys_getopt_required_argument, 0, 'i'}, - {"help", sys_getopt_no_argument, 0, 'h'}, - {0, 0, 0, 0} - }; - long val; - - context.sh = sh; - - if (argc < 3) { - PR_ERROR("Usage: wifi p2p connect [PIN] " - "[--go-intent=<0-15>] [--freq=]\n"); - return -EINVAL; - } - - /* Parse MAC address */ - if (sscanf(argv[1], "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &mac_addr[0], &mac_addr[1], &mac_addr[2], - &mac_addr[3], &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { - PR_ERROR("Invalid MAC address format. Use: XX:XX:XX:XX:XX:XX\n"); - return -EINVAL; - } - memcpy(params.peer_addr, mac_addr, WIFI_MAC_ADDR_LEN); - - method_arg = argv[2]; - if (strcmp(method_arg, "pbc") == 0) { - params.connect.method = WIFI_P2P_METHOD_PBC; - } else if (strcmp(method_arg, "pin") == 0) { - if (argc > 3 && argv[3][0] != '-') { - params.connect.method = WIFI_P2P_METHOD_KEYPAD; - strncpy(params.connect.pin, argv[3], WIFI_WPS_PIN_MAX_LEN); - params.connect.pin[WIFI_WPS_PIN_MAX_LEN] = '\0'; - } else { - params.connect.method = WIFI_P2P_METHOD_DISPLAY; - params.connect.pin[0] = '\0'; - } - } else { - PR_ERROR("Invalid connection method. Use: pbc or pin\n"); - return -EINVAL; - } - - /* Set default GO intent */ - params.connect.go_intent = 0; - /* Set default frequency to 2462 MHz (channel 11, 2.4 GHz) */ - params.connect.freq = 2462; - - while ((opt = sys_getopt_long(argc, argv, "g:f:i:h", long_options, &opt_index)) != -1) { - state = sys_getopt_state_get(); - switch (opt) { - case 'g': - if (!parse_number(sh, &val, state->optarg, "go-intent", 0, 15)) { - return -EINVAL; - } - params.connect.go_intent = (uint8_t)val; - break; - case 'f': - if (!parse_number(sh, &val, state->optarg, "freq", 0, 6000)) { - return -EINVAL; - } - params.connect.freq = (unsigned int)val; - break; - case 'i': - /* Unused, but parsing to avoid unknown option error */ - break; - case 'h': - shell_help(sh); - return -ENOEXEC; - default: - PR_ERROR("Invalid option %c\n", state->optopt); - return -EINVAL; - } - } - - params.oper = WIFI_P2P_CONNECT; - - if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { - PR_WARNING("P2P connect request failed\n"); - return -ENOEXEC; - } - - /* Display the generated PIN for DISPLAY method */ - if (params.connect.method == WIFI_P2P_METHOD_DISPLAY && params.connect.pin[0] != '\0') { - PR("%s\n", params.connect.pin); - } else { - PR("P2P connection initiated\n"); - } - return 0; -} #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[]) @@ -4555,23 +4455,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( ": Show detailed info for specific peer (format: XX:XX:XX:XX:XX:XX)\n" "[-i, --iface=]: Interface index\n", cmd_wifi_p2p_peer, 1, 3), - SHELL_CMD_ARG(connect, NULL, - "Connect to a P2P peer\n" - "Usage: connect [PIN] [options]\n" - ": Peer device MAC address (format: XX:XX:XX:XX:XX:XX)\n" - ": Use Push Button Configuration\n" - ": Use PIN method\n" - " - Without PIN: Device displays generated PIN for peer to enter\n" - " - With PIN: Device uses provided PIN to connect\n" - "[PIN]: 8-digit PIN (optional, generates if omitted)\n" - "[-g, --go-intent=<0-15>]: GO intent (0=client, 15=GO, default: 0)\n" - "[-f, --freq=]: Frequency in MHz (default: 2462)\n" - "[-i, --iface=]: Interface index\n" - "[-h, --help]: Show help\n" - "Examples:\n" - " wifi p2p connect 9c:b1:50:e3:81:96 pin -g 0 (displays PIN)\n" - " wifi p2p connect 9c:b1:50:e3:81:96 pin 12345670 -g 0 (uses PIN)\n", - cmd_wifi_p2p_connect, 3, 5), SHELL_SUBCMD_SET_END ); From 7a5adac33c7c5f38dc660e4ceb0d84402649b027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0916/3334] Revert "[nrf fromlist] net: wifi: Add Wi-Fi direct P2P connect API support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb791a6c6da5e80f0e94e2536bee901af537b70d. Signed-off-by: Tomasz Moń --- include/zephyr/net/wifi_mgmt.h | 26 ----------- modules/hostap/src/supp_api.c | 81 ---------------------------------- 2 files changed, 107 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 6cc7039ade66..ef0a6bac27cf 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -1465,8 +1465,6 @@ enum wifi_p2p_op { * or specific MAC address to query a single peer */ WIFI_P2P_PEER, - /** P2P connect to peer */ - WIFI_P2P_CONNECT, }; /** Wi-Fi P2P discovery type */ @@ -1479,16 +1477,6 @@ enum wifi_p2p_discovery_type { WIFI_P2P_FIND_PROGRESSIVE, }; -/** Wi-Fi P2P connection method */ -enum wifi_p2p_connection_method { - /** Push Button Configuration */ - WIFI_P2P_METHOD_PBC = 0, - /** Display PIN (device displays PIN for peer to enter) */ - WIFI_P2P_METHOD_DISPLAY, - /** Keypad PIN (user enters PIN on device) */ - WIFI_P2P_METHOD_KEYPAD, -}; - /** Maximum number of P2P peers that can be returned in a single query */ #define WIFI_P2P_MAX_PEERS CONFIG_WIFI_P2P_MAX_PEERS @@ -1508,20 +1496,6 @@ struct wifi_p2p_params { struct wifi_p2p_device_info *peers; /** Actual number of peers returned */ uint16_t peer_count; - /** Connect specific parameters */ - struct { - /** Connection method */ - enum wifi_p2p_connection_method method; - /** PIN for display/keypad methods (8 digits) - * - For DISPLAY: Leave empty, PIN will be generated and returned - * - For KEYPAD: Provide the PIN to use for connection - */ - char pin[WIFI_WPS_PIN_MAX_LEN + 1]; - /** GO intent (0-15, higher values indicate higher willingness to be GO) */ - uint8_t go_intent; - /** Frequency in MHz (0 = not specified, use default) */ - unsigned int freq; - } connect; }; #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 8126b92274e1..8555e91a1cf9 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -2821,87 +2821,6 @@ int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params break; } - case WIFI_P2P_CONNECT: { - char addr_str[18]; - const char *method_str = ""; - char freq_str[32] = ""; - - if (!params) { - wpa_printf(MSG_ERROR, "P2P connect params are NULL"); - return -EINVAL; - } - - snprintk(addr_str, sizeof(addr_str), "%02x:%02x:%02x:%02x:%02x:%02x", - params->peer_addr[0], params->peer_addr[1], params->peer_addr[2], - params->peer_addr[3], params->peer_addr[4], params->peer_addr[5]); - - /* Add frequency parameter if specified */ - if (params->connect.freq > 0) { - snprintk(freq_str, sizeof(freq_str), " freq=%u", params->connect.freq); - } - - switch (params->connect.method) { - case WIFI_P2P_METHOD_PBC: - method_str = "pbc"; - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_CONNECT %s %s go_intent=%d%s", - addr_str, method_str, params->connect.go_intent, freq_str); - break; - case WIFI_P2P_METHOD_DISPLAY: - method_str = "pin"; - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_CONNECT %s %s go_intent=%d%s", - addr_str, method_str, params->connect.go_intent, freq_str); - break; - case WIFI_P2P_METHOD_KEYPAD: - method_str = "keypad"; - if (params->connect.pin[0] == '\0') { - wpa_printf(MSG_ERROR, "PIN required for keypad method"); - return -EINVAL; - } - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_CONNECT %s %s %s go_intent=%d%s", - addr_str, method_str, params->connect.pin, - params->connect.go_intent, freq_str); - break; - default: - wpa_printf(MSG_ERROR, "Unknown P2P connection method: %d", - params->connect.method); - return -EINVAL; - } - - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); - if (ret < 0) { - wpa_printf(MSG_ERROR, "P2P_CONNECT command failed: %d", ret); - return -EIO; - } - if (os_strncmp(resp_buf, "FAIL", 4) == 0) { - wpa_printf(MSG_ERROR, "P2P connect failed: %s", resp_buf); - return -ENODEV; - } - - /* For DISPLAY method, capture the generated PIN from response */ - if (params->connect.method == WIFI_P2P_METHOD_DISPLAY) { - size_t len = 0; - char *pos = resp_buf; - - while (*pos == ' ' || *pos == '\t' || *pos == '\n') { - pos++; - } - - while (*pos != '\0' && *pos != '\n' && *pos != ' ' && - len < WIFI_WPS_PIN_MAX_LEN) { - params->connect.pin[len++] = *pos++; - } - params->connect.pin[len] = '\0'; - - if (params->connect.pin[0] == '\0') { - wpa_printf(MSG_ERROR, "P2P connect: No PIN returned"); - return -ENODEV; - } - } - - ret = 0; - break; - } - default: wpa_printf(MSG_ERROR, "Unknown P2P operation: %d", params->oper); ret = -EINVAL; From e51b8f032933778dfe632ae79492e9f3a7ab2f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0917/3334] Revert "[nrf fromlist] modules: hostap: Remove obsolete conditional" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6ae88163db75d06a70460f0a654ad4c4f5a8c59f. Signed-off-by: Tomasz Moń --- modules/hostap/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index dfa542233eef..106d31b8cca4 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -385,6 +385,14 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS ${HOSTAP_SRC_BASE}/crypto/dh_groups.c ) +if(NOT CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT) +# dh_group5 is only needed if we are not using mbedtls, as mbedtls provides +# its own definition +zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS + ${HOSTAP_SRC_BASE}/crypto/dh_group5.c +) +endif() + zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P CONFIG_P2P CONFIG_GAS From 51bb7fbe737615f84c957da1a9c7f11f973c10a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0918/3334] Revert "[nrf fromlist] modules: hostap: Define heap and stack for P2P support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fdb4ae6a8c2e5817e9fb93eef61f18a71588c312. Signed-off-by: Tomasz Moń --- modules/hostap/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index ec8263d85a6b..9eac239daa7d 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -46,7 +46,6 @@ config HEAP_MEM_POOL_ADD_SIZE_HOSTAP def_int 66560 if WIFI_NM_HOSTAPD_AP def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE - def_int 80000 if WIFI_NM_WPA_SUPPLICANT_P2P def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP # 30K is mandatory, but might need more for long duration use cases def_int 30000 @@ -55,7 +54,6 @@ endif # WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE int "Stack size for wpa_supplicant thread" - default 10000 if WIFI_NM_WPA_SUPPLICANT_P2P # TODO: Providing higher stack size for Enterprise mode to fix stack # overflow issues. Need to identify the cause for higher stack usage. default 8192 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE From 21d0dd88101e13355db10968eb1ff14d716ff69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:28 +0100 Subject: [PATCH 0919/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Register frame without match" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dfcf0e426d40e9ea573acded654ae266d60207af. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index fabf2df96f87..a3f562ed138b 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1702,7 +1702,7 @@ int nrf_wifi_supp_register_frame(void *if_priv, struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; struct nrf_wifi_umac_mgmt_frame_info frame_info; - if (!if_priv) { + if (!if_priv || !match || !match_len) { LOG_ERR("%s: Invalid parameters", __func__); return -1; } @@ -1723,14 +1723,8 @@ int nrf_wifi_supp_register_frame(void *if_priv, memset(&frame_info, 0, sizeof(frame_info)); frame_info.frame_type = type; - if (match_len > 0) { - if (!match) { - LOG_ERR("%s: Invalid match parameters", __func__); - goto out; - } - frame_info.frame_match.frame_match_len = match_len; - memcpy(frame_info.frame_match.frame_match, match, match_len); - } + frame_info.frame_match.frame_match_len = match_len; + memcpy(frame_info.frame_match.frame_match, match, match_len); status = nrf_wifi_sys_fmac_register_frame(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &frame_info); From 54d57ebd19bb4e40df5207c6eac8d95f4a7683e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0920/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Allow off channel TX for probe responses" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0578e64ab22aeb3fe2b837996d1f38f61aa7b19d. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index a3f562ed138b..3caf7f6af526 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1435,10 +1435,6 @@ int nrf_wifi_nl80211_send_mlme(void *if_priv, const u8 *data, goto out; } - if (vif_ctx_zep->if_type == NRF_WIFI_IFTYPE_STATION) { - offchanok = 1; - } - if (offchanok) { mgmt_tx_info->nrf_wifi_flags |= NRF_WIFI_CMD_FRAME_OFFCHANNEL_TX_OK; } From 7a0ebe369c6b1925c4f211448effaadb0c4385ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0921/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Add RoC support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cb8c23c4b0a93bd6d01171b50fae316144dc891c. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/inc/wpa_supp_if.h | 8 -- drivers/wifi/nrf_wifi/src/fmac_main.c | 4 - drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 141 ------------------------ 3 files changed, 153 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h index 28aadae28ebd..c543644e3128 100644 --- a/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h +++ b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h @@ -123,16 +123,8 @@ int nrf_wifi_supp_get_conn_info(void *if_priv, struct wpa_conn_info *info); void nrf_wifi_supp_event_proc_get_conn_info(void *os_vif_ctx, struct nrf_wifi_umac_event_conn_info *info, unsigned int event_len); -void nrf_wifi_supp_event_remain_on_channel(void *os_vif_ctx, - struct nrf_wifi_event_remain_on_channel *info, - unsigned int event_len); -void nrf_wifi_supp_event_roc_cancel_complete(void *os_vif_ctx, - struct nrf_wifi_event_remain_on_channel *info, - unsigned int event_len); int nrf_wifi_supp_set_country(void *if_priv, const char *alpha2); int nrf_wifi_supp_get_country(void *if_priv, char *alpha2); -int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration); -int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv); #endif /* CONFIG_NRF70_STA_MODE */ #ifdef CONFIG_NRF70_AP_MODE diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 00ea3a873c85..47ca53d5a61c 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -843,8 +843,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) callbk_fns.event_get_wiphy = nrf_wifi_wpa_supp_event_get_wiphy; callbk_fns.mgmt_rx_callbk_fn = nrf_wifi_wpa_supp_event_mgmt_rx_callbk_fn; callbk_fns.get_conn_info_callbk_fn = nrf_wifi_supp_event_proc_get_conn_info; - callbk_fns.roc_callbk_fn = nrf_wifi_supp_event_remain_on_channel; - callbk_fns.roc_cancel_callbk_fn = nrf_wifi_supp_event_roc_cancel_complete; #endif /* CONFIG_NRF70_STA_MODE */ /* The OSAL layer needs to be initialized before any other initialization @@ -965,8 +963,6 @@ static const struct zep_wpa_supp_dev_ops wpa_supp_ops = { .get_conn_info = nrf_wifi_supp_get_conn_info, .set_country = nrf_wifi_supp_set_country, .get_country = nrf_wifi_supp_get_country, - .remain_on_channel = nrf_wifi_supp_remain_on_channel, - .cancel_remain_on_channel = nrf_wifi_supp_cancel_remain_on_channel, #ifdef CONFIG_NRF70_AP_MODE .init_ap = nrf_wifi_wpa_supp_init_ap, .start_ap = nrf_wifi_wpa_supp_start_ap, diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 3caf7f6af526..0864a1a00fe3 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1986,147 +1986,6 @@ void nrf_wifi_supp_event_proc_get_conn_info(void *if_priv, k_sem_give(&wait_for_event_sem); } -void nrf_wifi_supp_event_remain_on_channel(void *if_priv, - struct nrf_wifi_event_remain_on_channel *roc_complete, - unsigned int event_len) -{ - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - - if (!if_priv) { - LOG_ERR("%s: Missing interface context", __func__); - return; - } - - vif_ctx_zep = if_priv; - - if (!roc_complete) { - LOG_ERR("%s: Missing ROC complete event data", __func__); - return; - } - - LOG_DBG("%s: ROC complete on freq %d, dur %d, vif_idx %d", - __func__, roc_complete->frequency, - roc_complete->dur, vif_ctx_zep->vif_idx); - - if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_complete) { - vif_ctx_zep->supp_callbk_fns.roc_complete(vif_ctx_zep->supp_drv_if_ctx, - roc_complete->frequency, - roc_complete->dur); - } -} - -void nrf_wifi_supp_event_roc_cancel_complete(void *if_priv, - struct nrf_wifi_event_remain_on_channel - *roc_cancel_complete, - unsigned int event_len) -{ - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - - if (!if_priv) { - LOG_ERR("%s: Missing interface context", __func__); - return; - } - - vif_ctx_zep = if_priv; - - if (!roc_cancel_complete) { - LOG_ERR("%s: Missing ROC cancel complete event data", __func__); - return; - } - - LOG_DBG("%s: ROC cancel complete on freq %d, vif_idx %d", - __func__, roc_cancel_complete->frequency, - vif_ctx_zep->vif_idx); - - if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_cancel_complete) { - vif_ctx_zep->supp_callbk_fns.roc_cancel_complete(vif_ctx_zep->supp_drv_if_ctx, - roc_cancel_complete->frequency); - } -} - -int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, - unsigned int duration) -{ - enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; -#ifdef NRF70_P2P_MODE - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct remain_on_channel_info roc_info; - - if (!if_priv) { - LOG_ERR("%s: Invalid params", __func__); - return -1; - } - - vif_ctx_zep = if_priv; - rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - if (!rpu_ctx_zep) { - LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); - return -1; - } - - k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); - if (!rpu_ctx_zep->rpu_ctx) { - LOG_DBG("%s: RPU context not initialized", __func__); - goto out; - } - - memset(&roc_info, 0, sizeof(roc_info)); - roc_info.nrf_wifi_freq_params.frequency = freq; - roc_info.nrf_wifi_freq_params.channel_width = NRF_WIFI_CHAN_WIDTH_20; - roc_info.nrf_wifi_freq_params.center_frequency1 = freq; - roc_info.nrf_wifi_freq_params.center_frequency2 = 0; - roc_info.nrf_wifi_freq_params.channel_type = NRF_WIFI_CHAN_HT20; - roc_info.dur = duration; - - status = nrf_wifi_sys_fmac_p2p_roc_start(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, - &roc_info); - if (status != NRF_WIFI_STATUS_SUCCESS) { - LOG_ERR("%s: nrf_wifi_fmac_remain_on_channel failed", __func__); - goto out; - } -out: - k_mutex_unlock(&vif_ctx_zep->vif_lock); -#endif /* NRF70_P2P_MODE */ - return status; -} - -int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv) -{ - enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; -#ifdef NRF70_P2P_MODE - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - - if (!if_priv) { - LOG_ERR("%s: Invalid params", __func__); - return -1; - } - - vif_ctx_zep = if_priv; - rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - if (!rpu_ctx_zep) { - LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); - return -1; - } - - k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); - if (!rpu_ctx_zep->rpu_ctx) { - LOG_DBG("%s: RPU context not initialized", __func__); - goto out; - } - - status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, 0); - if (status != NRF_WIFI_STATUS_SUCCESS) { - LOG_ERR("%s: nrf_wifi_fmac_cancel_remain_on_channel failed", __func__); - goto out; - } -out: - k_mutex_unlock(&vif_ctx_zep->vif_lock); -#endif /* NRF70_P2P_MODE */ - return status; -} - #ifdef CONFIG_NRF70_AP_MODE static int nrf_wifi_vif_state_change(struct nrf_wifi_vif_ctx_zep *vif_ctx_zep, enum nrf_wifi_fmac_if_op_state state) From 04e2986b4920c0741c72d54f8a7bf807f3a2062b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0922/3334] Revert "[nrf fromlist] net: wifi: Add Wi-Fi direct P2P discovery shell command support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5806ffc2f8846201b21f164f8f325a7b93880a9d. Signed-off-by: Tomasz Moń --- subsys/net/l2/wifi/wifi_shell.c | 234 +------------------------------- 1 file changed, 1 insertion(+), 233 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 91e342f81bd0..de4d7e9d03cd 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -46,8 +46,7 @@ LOG_MODULE_REGISTER(net_wifi_shell, LOG_LEVEL_INF); NET_EVENT_WIFI_AP_STA_CONNECTED |\ NET_EVENT_WIFI_AP_STA_DISCONNECTED|\ NET_EVENT_WIFI_SIGNAL_CHANGE |\ - NET_EVENT_WIFI_NEIGHBOR_REP_COMP |\ - NET_EVENT_WIFI_P2P_DEVICE_FOUND) + NET_EVENT_WIFI_NEIGHBOR_REP_COMP) #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS_ONLY #define WIFI_SHELL_SCAN_EVENTS ( \ @@ -520,26 +519,6 @@ static void handle_wifi_neighbor_rep_complete(struct net_mgmt_event_callback *cb } #endif -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -static void handle_wifi_p2p_device_found(struct net_mgmt_event_callback *cb) -{ - const struct wifi_p2p_device_info *peer_info = - (const struct wifi_p2p_device_info *)cb->info; - const struct shell *sh = context.sh; - - if (!peer_info || peer_info->device_name[0] == '\0') { - return; - } - - PR("Device Name: %-20s MAC Address: %02x:%02x:%02x:%02x:%02x:%02x " - "Config Methods: 0x%x\n", - peer_info->device_name, - peer_info->mac[0], peer_info->mac[1], peer_info->mac[2], - peer_info->mac[3], peer_info->mac[4], peer_info->mac[5], - peer_info->config_methods); -} -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ - static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event, struct net_if *iface) { @@ -573,11 +552,6 @@ static void wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb, handle_wifi_neighbor_rep_complete(cb, iface); break; #endif -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - case NET_EVENT_WIFI_P2P_DEVICE_FOUND: - handle_wifi_p2p_device_found(cb); - break; -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ default: break; } @@ -3554,180 +3528,6 @@ static int cmd_wifi_dpp_reconfig(const struct shell *sh, size_t argc, char *argv } #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */ - -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -static void print_peer_info(const struct shell *sh, int index, - const struct wifi_p2p_device_info *peer) -{ - uint8_t mac_string_buf[sizeof("xx:xx:xx:xx:xx:xx")]; - const char *device_name; - const char *device_type; - const char *config_methods; - - device_name = (peer->device_name[0] != '\0') ? - peer->device_name : ""; - device_type = (peer->pri_dev_type_str[0] != '\0') ? - peer->pri_dev_type_str : "-"; - config_methods = (peer->config_methods_str[0] != '\0') ? - peer->config_methods_str : "-"; - - PR("%-4d | %-32s | %-17s | %-4d | %-20s | %s\n", - index, - device_name, - net_sprint_ll_addr_buf(peer->mac, WIFI_MAC_ADDR_LEN, - mac_string_buf, - sizeof(mac_string_buf)), - peer->rssi, - device_type, - config_methods); -} - -static int cmd_wifi_p2p_peer(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_p2p_params params = {0}; - uint8_t mac_addr[WIFI_MAC_ADDR_LEN]; - static struct wifi_p2p_device_info peers[WIFI_P2P_MAX_PEERS]; - int ret; - int max_peers = (argc < 2) ? WIFI_P2P_MAX_PEERS : 1; - - context.sh = sh; - - memset(peers, 0, sizeof(peers)); - - params.peers = peers; - params.oper = WIFI_P2P_PEER; - params.peer_count = max_peers; - - if (argc >= 2) { - if (sscanf(argv[1], "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &mac_addr[0], &mac_addr[1], &mac_addr[2], - &mac_addr[3], &mac_addr[4], &mac_addr[5]) != WIFI_MAC_ADDR_LEN) { - PR_ERROR("Invalid MAC address format. Use: XX:XX:XX:XX:XX:XX\n"); - return -EINVAL; - } - memcpy(params.peer_addr, mac_addr, WIFI_MAC_ADDR_LEN); - params.peer_count = 1; - } else { - /* Use broadcast MAC to query all peers */ - memset(params.peer_addr, 0xFF, WIFI_MAC_ADDR_LEN); - } - - ret = net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params)); - if (ret) { - PR_WARNING("P2P peer info request failed\n"); - return -ENOEXEC; - } - - if (params.peer_count > 0) { - PR("\n%-4s | %-32s | %-17s | %-4s | %-20s | %s\n", - "Num", "Device Name", "MAC Address", "RSSI", "Device Type", "Config Methods"); - for (int i = 0; i < params.peer_count; i++) { - print_peer_info(sh, i + 1, &peers[i]); - } - } else { - if (argc >= 2) { - shell_print(sh, "No information available for peer %s", argv[1]); - } else { - shell_print(sh, "No P2P peers found"); - } - } - - return 0; -} - - -static int cmd_wifi_p2p_find(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_p2p_params params = {0}; - - context.sh = sh; - - params.oper = WIFI_P2P_FIND; - params.discovery_type = WIFI_P2P_FIND_START_WITH_FULL; - params.timeout = 10; /* Default 10 second timeout */ - - if (argc > 1) { - int opt; - int opt_index = 0; - struct sys_getopt_state *state; - static const struct sys_getopt_option long_options[] = { - {"timeout", sys_getopt_required_argument, 0, 't'}, - {"type", sys_getopt_required_argument, 0, 'T'}, - {"iface", sys_getopt_required_argument, 0, 'i'}, - {"help", sys_getopt_no_argument, 0, 'h'}, - {0, 0, 0, 0} - }; - long val; - - while ((opt = sys_getopt_long(argc, argv, "t:T:i:h", - long_options, &opt_index)) != -1) { - state = sys_getopt_state_get(); - switch (opt) { - case 't': - if (!parse_number(sh, &val, state->optarg, "timeout", 0, 65535)) { - return -EINVAL; - } - params.timeout = (uint16_t)val; - break; - case 'T': - if (!parse_number(sh, &val, state->optarg, "type", 0, 2)) { - return -EINVAL; - } - switch (val) { - case 0: - params.discovery_type = WIFI_P2P_FIND_ONLY_SOCIAL; - break; - case 1: - params.discovery_type = WIFI_P2P_FIND_PROGRESSIVE; - break; - case 2: - params.discovery_type = WIFI_P2P_FIND_START_WITH_FULL; - break; - default: - return -EINVAL; - } - break; - case 'i': - /* Unused, but parsing to avoid unknown option error */ - break; - case 'h': - shell_help(sh); - return -ENOEXEC; - default: - PR_ERROR("Invalid option %c\n", state->optopt); - return -EINVAL; - } - } - } - - if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { - PR_WARNING("P2P find request failed\n"); - return -ENOEXEC; - } - PR("P2P find started\n"); - return 0; -} - -static int cmd_wifi_p2p_stop_find(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_p2p_params params = {0}; - - context.sh = sh; - - params.oper = WIFI_P2P_STOP_FIND; - - if (net_mgmt(NET_REQUEST_WIFI_P2P_OPER, iface, ¶ms, sizeof(params))) { - PR_WARNING("P2P stop find request failed\n"); - return -ENOEXEC; - } - PR("P2P find stopped\n"); - return 0; -} -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ - static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[]) { struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); @@ -4432,38 +4232,6 @@ SHELL_SUBCMD_ADD((wifi), bgscan, NULL, 2, 6); #endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN */ -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -SHELL_STATIC_SUBCMD_SET_CREATE( - wifi_cmd_p2p, - SHELL_CMD_ARG(find, NULL, - "Start P2P device discovery\n" - "[-t, --timeout=]: Discovery timeout\n" - "[-T, --type=<0|1|2>]: Discovery type\n" - " 0: Social channels only (1, 6, 11)\n" - " 1: Progressive scan (all channels)\n" - " 2: Full scan first, then social (default)\n" - "[-i, --iface=]: Interface index\n" - "[-h, --help]: Show help\n", - cmd_wifi_p2p_find, 1, 6), - SHELL_CMD_ARG(stop_find, NULL, - "Stop P2P device discovery\n" - "[-i, --iface=]: Interface index\n", - cmd_wifi_p2p_stop_find, 1, 2), - SHELL_CMD_ARG(peer, NULL, - "Show information about P2P peers\n" - "Usage: peer []\n" - ": Show detailed info for specific peer (format: XX:XX:XX:XX:XX:XX)\n" - "[-i, --iface=]: Interface index\n", - cmd_wifi_p2p_peer, 1, 3), - SHELL_SUBCMD_SET_END -); - -SHELL_SUBCMD_ADD((wifi), p2p, &wifi_cmd_p2p, - "Wi-Fi Direct (P2P) commands.", - NULL, - 0, 0); -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ - SHELL_SUBCMD_ADD((wifi), config, NULL, "Configure STA parameters.\n" "-o, --okc=<0/1>: Opportunistic Key Caching. 0: disable, 1: enable\n" From 74b2896e16a6797e28b711795a2213929bef2f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0923/3334] Revert "[nrf fromlist] net: wifi: Add Wi-Fi direct P2P discovery API support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 66cf4a3c1047f0f4e322d4953e298a8ae3ea5bfd. Signed-off-by: Tomasz Moń --- include/zephyr/net/wifi_mgmt.h | 126 +-------------- modules/hostap/src/supp_api.c | 254 ------------------------------- modules/hostap/src/supp_api.h | 12 -- modules/hostap/src/supp_events.c | 54 +------ modules/hostap/src/supp_events.h | 7 - modules/hostap/src/supp_main.c | 9 -- subsys/net/l2/wifi/Kconfig | 9 -- subsys/net/l2/wifi/wifi_mgmt.c | 29 ---- 8 files changed, 3 insertions(+), 497 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index ef0a6bac27cf..817a4fcd6fb6 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -139,8 +139,6 @@ enum net_request_wifi_cmd { NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD, /** Configure background scanning */ NET_REQUEST_WIFI_CMD_BGSCAN, - /** Wi-Fi Direct (P2P) operations*/ - NET_REQUEST_WIFI_CMD_P2P_OPER, /** @cond INTERNAL_HIDDEN */ NET_REQUEST_WIFI_CMD_MAX /** @endcond */ @@ -341,11 +339,6 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BGSCAN); -#define NET_REQUEST_WIFI_P2P_OPER \ - (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_P2P_OPER) - -NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_P2P_OPER); - /** @cond INTERNAL_HIDDEN */ enum { @@ -366,7 +359,7 @@ enum { NET_EVENT_WIFI_CMD_AP_STA_CONNECTED_VAL, NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED_VAL, NET_EVENT_WIFI_CMD_SUPPLICANT_VAL, - NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND_VAL, + NET_EVENT_WIFI_CMD_MAX, }; @@ -413,8 +406,6 @@ enum net_event_wifi_cmd { NET_MGMT_CMD(NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED), /** Supplicant specific event */ NET_MGMT_CMD(NET_EVENT_WIFI_CMD_SUPPLICANT), - /** P2P device found */ - NET_MGMT_CMD(NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND), }; /** Event emitted for Wi-Fi scan result */ @@ -477,51 +468,6 @@ enum net_event_wifi_cmd { #define NET_EVENT_WIFI_AP_STA_DISCONNECTED \ (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED) -/** Event emitted for P2P device found event */ -#define NET_EVENT_WIFI_P2P_DEVICE_FOUND \ - (NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_P2P_DEVICE_FOUND) - -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -/** Maximum length for P2P device name */ -#define WIFI_P2P_DEVICE_NAME_MAX_LEN 32 -/** Size of P2P primary device type (8 bytes) */ -#define WIFI_P2P_PRI_DEV_TYPE_SIZE 8 -/** Maximum length for P2P primary device type string */ -#define WIFI_P2P_PRI_DEV_TYPE_STR_MAX_LEN 32 -/** Maximum length for P2P WPS configuration methods string */ -#define WIFI_P2P_CONFIG_METHODS_STR_MAX_LEN 16 -/** Maximum length for P2P manufacturer name */ -#define WIFI_P2P_MANUFACTURER_MAX_LEN 64 -/** Maximum length for P2P model name */ -#define WIFI_P2P_MODEL_NAME_MAX_LEN 32 - -/** @brief Wi-Fi P2P device info */ -struct wifi_p2p_device_info { - /** Device MAC address */ - uint8_t mac[WIFI_MAC_ADDR_LEN]; - /** Device name (max 32 chars + null terminator) */ - char device_name[WIFI_P2P_DEVICE_NAME_MAX_LEN + 1]; - /** Primary device type */ - uint8_t pri_dev_type[WIFI_P2P_PRI_DEV_TYPE_SIZE]; - /** Primary device type string */ - char pri_dev_type_str[WIFI_P2P_PRI_DEV_TYPE_STR_MAX_LEN]; - /** Signal strength (RSSI) */ - int8_t rssi; - /** WPS configuration methods supported */ - uint16_t config_methods; - /** WPS configuration methods string */ - char config_methods_str[WIFI_P2P_CONFIG_METHODS_STR_MAX_LEN]; - /** Device capability */ - uint8_t dev_capab; - /** Group capability */ - uint8_t group_capab; - /** Manufacturer (max 64 chars + null terminator) */ - char manufacturer[WIFI_P2P_MANUFACTURER_MAX_LEN + 1]; - /** Model name (max 32 chars + null terminator) */ - char model_name[WIFI_P2P_MODEL_NAME_MAX_LEN + 1]; -}; -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ - /** @brief Wi-Fi version */ struct wifi_version { /** Driver version */ @@ -1168,9 +1114,6 @@ union wifi_mgmt_events { #endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */ struct wifi_twt_params twt_params; struct wifi_ap_sta_info ap_sta_info; -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - struct wifi_p2p_device_info p2p_device_info; -#endif }; /** @endcond */ @@ -1454,51 +1397,6 @@ struct wifi_wps_config_params { char pin[WIFI_WPS_PIN_MAX_LEN + 1]; }; -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -/** Wi-Fi P2P operation */ -enum wifi_p2p_op { - /** P2P find/discovery */ - WIFI_P2P_FIND = 0, - /** P2P stop find/discovery */ - WIFI_P2P_STOP_FIND, - /** P2P query peer info use broadcast MAC (ff:ff:ff:ff:ff:ff) to list all peers, - * or specific MAC address to query a single peer - */ - WIFI_P2P_PEER, -}; - -/** Wi-Fi P2P discovery type */ -enum wifi_p2p_discovery_type { - /** Start with full scan, then only social channels */ - WIFI_P2P_FIND_START_WITH_FULL = 0, - /** Only social channels (1, 6, 11) */ - WIFI_P2P_FIND_ONLY_SOCIAL, - /** Progressive - scan through all channels one at a time */ - WIFI_P2P_FIND_PROGRESSIVE, -}; - -/** Maximum number of P2P peers that can be returned in a single query */ -#define WIFI_P2P_MAX_PEERS CONFIG_WIFI_P2P_MAX_PEERS - -/** Wi-Fi P2P parameters */ -struct wifi_p2p_params { - /** P2P operation */ - enum wifi_p2p_op oper; - /** Discovery type (for find operation) */ - enum wifi_p2p_discovery_type discovery_type; - /** Timeout in seconds (0 = no timeout, run until stopped) */ - uint16_t timeout; - /** Peer device address (for peer operation) */ - uint8_t peer_addr[WIFI_MAC_ADDR_LEN]; - /** Flag to list only discovered peers (for peers operation) */ - bool discovered_only; - /** Pointer to array for peer info results */ - struct wifi_p2p_device_info *peers; - /** Actual number of peers returned */ - uint16_t peer_count; -}; -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ - /** Wi-Fi AP status */ enum wifi_sap_iface_state { @@ -1887,17 +1785,6 @@ struct wifi_mgmt_ops { */ int (*set_bgscan)(const struct device *dev, struct wifi_bgscan_params *params); #endif -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - /** Wi-Fi Direct (P2P) operations for device discovery - * - * @param dev Pointer to the device structure for the driver instance. - * @param params P2P operation parameters including operation type, discovery settings, - * timeout values and peer information retrieval options - * - * @return 0 if ok, < 0 if error - */ - int (*p2p_oper)(const struct device *dev, struct wifi_p2p_params *params); -#endif }; /** Wi-Fi management offload API */ @@ -2029,17 +1916,6 @@ void wifi_mgmt_raise_ap_sta_connected_event(struct net_if *iface, void wifi_mgmt_raise_ap_sta_disconnected_event(struct net_if *iface, struct wifi_ap_sta_info *sta_info); -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -/** - * @brief Raise P2P device found event - * - * @param iface Network interface - * @param device_info P2P device information - */ -void wifi_mgmt_raise_p2p_device_found_event(struct net_if *iface, - struct wifi_p2p_device_info *peer_info); -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ - /** * @} */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 8555e91a1cf9..11c00de06b37 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -60,14 +60,6 @@ enum status_thread_state { static struct wifi_enterprise_creds_params enterprise_creds; #endif -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -#define P2P_CMD_BUF_SIZE 128 -#define P2P_RESP_BUF_SIZE 64 -#define P2P_PEER_INFO_SIZE 512 -#define P2P_ADDR_SIZE 32 -#define P2P_CMD_SIZE 64 -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ - K_MUTEX_DEFINE(wpa_supplicant_mutex); extern struct k_work_q *get_workq(void); @@ -2584,249 +2576,3 @@ int supplicant_config_params(const struct device *dev, struct wifi_config_params k_mutex_unlock(&wpa_supplicant_mutex); return ret; } - -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -static inline void extract_value(const char *src, char *dest, size_t dest_size) -{ - size_t i = 0; - - while (src[i] != '\0' && src[i] != '\n' && i < dest_size - 1) { - dest[i] = src[i]; - i++; - } - dest[i] = '\0'; -} - -static void parse_peer_info_line(const char *line, struct wifi_p2p_device_info *info) -{ - const char *pos; - - if (strncmp(line, "device_name=", 12) == 0) { - extract_value(line + 12, info->device_name, sizeof(info->device_name)); - } else if (strncmp(line, "pri_dev_type=", 13) == 0) { - extract_value(line + 13, info->pri_dev_type_str, sizeof(info->pri_dev_type_str)); - } else if (strncmp(line, "level=", 6) == 0) { - char *endptr; - long val; - - pos = line + 6; - val = strtol(pos, &endptr, 10); - if (endptr != pos && val >= INT8_MIN && val <= INT8_MAX) { - info->rssi = (int8_t)val; - } - } else if (strncmp(line, "config_methods=", 15) == 0) { - char *endptr; - long val; - - pos = line + 15; - extract_value(pos, info->config_methods_str, sizeof(info->config_methods_str)); - - if (pos[0] == '0' && (pos[1] == 'x' || pos[1] == 'X')) { - val = strtol(pos, &endptr, 16); - } else { - val = strtol(pos, &endptr, 10); - } - if (endptr != pos && val >= 0 && val <= UINT16_MAX) { - info->config_methods = (uint16_t)val; - } - } else if (strncmp(line, "manufacturer=", 13) == 0) { - extract_value(line + 13, info->manufacturer, sizeof(info->manufacturer)); - } else if (strncmp(line, "model_name=", 11) == 0) { - extract_value(line + 11, info->model_name, sizeof(info->model_name)); - } -} - -static void parse_peer_info_response(const char *resp, const uint8_t *mac, - struct wifi_p2p_device_info *info) -{ - const char *line = resp; - const char *next_line; - - memset(info, 0, sizeof(*info)); - - if (mac) { - memcpy(info->mac, mac, WIFI_MAC_ADDR_LEN); - } - - while (line && *line) { - if (*line == '\n') { - line++; - continue; - } - next_line = strchr(line, '\n'); - parse_peer_info_line(line, info); - if (next_line) { - line = next_line + 1; - } else { - break; - } - } -} - -int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params) -{ - struct wpa_supplicant *wpa_s = get_wpa_s_handle(dev); - char cmd_buf[P2P_CMD_BUF_SIZE]; - char resp_buf[P2P_RESP_BUF_SIZE]; - int ret = -1; - const char *discovery_type_str = ""; - - if (!wpa_s || !wpa_s->ctrl_conn) { - wpa_printf(MSG_ERROR, "wpa_supplicant control interface not initialized"); - return -ENOTSUP; - } - - switch (params->oper) { - case WIFI_P2P_FIND: - switch (params->discovery_type) { - case WIFI_P2P_FIND_ONLY_SOCIAL: - discovery_type_str = "type=social"; - break; - case WIFI_P2P_FIND_PROGRESSIVE: - discovery_type_str = "type=progressive"; - break; - case WIFI_P2P_FIND_START_WITH_FULL: - default: - discovery_type_str = ""; - break; - } - - if (params->timeout > 0) { - if (strlen(discovery_type_str) > 0) { - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_FIND %u %s", - params->timeout, discovery_type_str); - } else { - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_FIND %u", - params->timeout); - } - } else { - if (strlen(discovery_type_str) > 0) { - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_FIND %s", - discovery_type_str); - } else { - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_FIND"); - } - } - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); - if (ret < 0) { - wpa_printf(MSG_ERROR, "P2P_FIND command failed: %d", ret); - return -EIO; - } - ret = 0; - break; - - case WIFI_P2P_STOP_FIND: - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_STOP_FIND"); - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, cmd_buf, resp_buf); - if (ret < 0) { - wpa_printf(MSG_ERROR, "P2P_STOP_FIND command failed: %d", ret); - return -EIO; - } - ret = 0; - break; - - case WIFI_P2P_PEER: { - char addr[P2P_ADDR_SIZE]; - char cmd[P2P_CMD_SIZE]; - char peer_info[P2P_PEER_INFO_SIZE]; - char *pos; - size_t len; - uint16_t peer_idx = 0; - uint8_t mac[WIFI_MAC_ADDR_LEN]; - struct net_eth_addr peer_mac; - bool query_all_peers; - - if (!params->peers) { - wpa_printf(MSG_ERROR, "Peer info array not provided"); - return -EINVAL; - } - - memcpy(&peer_mac, params->peer_addr, WIFI_MAC_ADDR_LEN); - query_all_peers = net_eth_is_addr_broadcast(&peer_mac); - - if (query_all_peers) { - os_strlcpy(cmd_buf, "P2P_PEER FIRST", sizeof(cmd_buf)); - - while (peer_idx < params->peer_count) { - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, - cmd_buf, resp_buf); - - if (ret < 0 || resp_buf[0] == '\0' || - os_strncmp(resp_buf, "FAIL", 4) == 0) { - if (peer_idx == 0) { - wpa_printf(MSG_DEBUG, "No P2P peers found"); - } - break; - } - - len = 0; - pos = resp_buf; - while (*pos != '\0' && *pos != '\n' && len < sizeof(addr) - 1) { - addr[len++] = *pos++; - } - addr[len] = '\0'; - - if (os_strncmp(addr, "00:00:00:00:00:00", 17) != 0 && - sscanf(addr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &mac[0], &mac[1], &mac[2], - &mac[3], &mac[4], &mac[5]) == - WIFI_MAC_ADDR_LEN) { - - os_snprintf(cmd, sizeof(cmd), "P2P_PEER %s", addr); - ret = zephyr_wpa_cli_cmd_resp_noprint( - wpa_s->ctrl_conn, cmd, peer_info); - - if (ret >= 0 && - (!params->discovered_only || - os_strstr(peer_info, - "[PROBE_REQ_ONLY]") == NULL)) { - parse_peer_info_response(peer_info, - mac, - ¶ms->peers[peer_idx]); - peer_idx++; - } - } - os_snprintf(cmd_buf, sizeof(cmd_buf), "P2P_PEER NEXT-%s", addr); - } - params->peer_count = peer_idx; - } else { - char addr_str[18]; - - if (params->peer_count < 1) { - wpa_printf(MSG_ERROR, "Peer count must be at least 1"); - return -EINVAL; - } - - snprintk(addr_str, sizeof(addr_str), "%02x:%02x:%02x:%02x:%02x:%02x", - params->peer_addr[0], params->peer_addr[1], params->peer_addr[2], - params->peer_addr[3], params->peer_addr[4], params->peer_addr[5]); - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_PEER %s", addr_str); - - /* Use peer_info buffer for single peer query to avoid large resp_buf */ - ret = zephyr_wpa_cli_cmd_resp_noprint(wpa_s->ctrl_conn, - cmd_buf, peer_info); - if (ret < 0) { - wpa_printf(MSG_ERROR, "P2P_PEER command failed: %d", ret); - return -EIO; - } - if (os_strncmp(peer_info, "FAIL", 4) == 0) { - wpa_printf(MSG_ERROR, "Peer %s not found", addr_str); - return -ENODEV; - } - parse_peer_info_response(peer_info, params->peer_addr, - ¶ms->peers[0]); - params->peer_count = 1; - } - ret = 0; - break; - } - - default: - wpa_printf(MSG_ERROR, "Unknown P2P operation: %d", params->oper); - ret = -EINVAL; - break; - } - - return ret; -} -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ diff --git a/modules/hostap/src/supp_api.h b/modules/hostap/src/supp_api.h index 692db61bf277..8ab49f177e70 100644 --- a/modules/hostap/src/supp_api.h +++ b/modules/hostap/src/supp_api.h @@ -386,16 +386,4 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa * @return 0 for OK; -1 for ERROR */ int supplicant_config_params(const struct device *dev, struct wifi_config_params *params); - -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -/** - * @brief P2P operation - * - * @param dev Wi-Fi interface handle to use - * @param params P2P parameters - * @return 0 for OK; -1 for ERROR - */ -int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params); -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ - #endif /* ZEPHYR_SUPP_MGMT_H */ diff --git a/modules/hostap/src/supp_events.c b/modules/hostap/src/supp_events.c index ee6a05a568ec..c4175a416bea 100644 --- a/modules/hostap/src/supp_events.c +++ b/modules/hostap/src/supp_events.c @@ -43,9 +43,6 @@ static const struct wpa_supp_event_info { { "CTRL-EVENT-NETWORK-REMOVED", SUPPLICANT_EVENT_NETWORK_REMOVED }, { "CTRL-EVENT-DSCP-POLICY", SUPPLICANT_EVENT_DSCP_POLICY }, { "CTRL-EVENT-REGDOM-CHANGE", SUPPLICANT_EVENT_REGDOM_CHANGE }, -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - { "P2P-DEVICE-FOUND", SUPPLICANT_EVENT_P2P_DEVICE_FOUND }, -#endif }; static void copy_mac_addr(const unsigned int *src, uint8_t *dst) @@ -177,43 +174,6 @@ static int supplicant_process_status(struct supplicant_int_event_data *event_dat event_data->data_len = sizeof(data->bss_removed); copy_mac_addr(tmp_mac_addr, data->bss_removed.bssid); break; -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - case SUPPLICANT_EVENT_P2P_DEVICE_FOUND: - { - char *ptr, *name_start, *name_end; - unsigned int config_methods = 0; - - memset(&data->p2p_device_found, 0, sizeof(data->p2p_device_found)); - ret = sscanf(event_no_prefix, MACSTR, MACADDR2STR(tmp_mac_addr)); - if (ret > 0) { - copy_mac_addr(tmp_mac_addr, data->p2p_device_found.mac); - } - name_start = strstr(event_no_prefix, "name='"); - if (name_start) { - name_start += 6; - name_end = strchr(name_start, '\''); - if (name_end) { - size_t name_len = name_end - name_start; - - if (name_len >= sizeof(data->p2p_device_found.device_name)) { - name_len = sizeof(data->p2p_device_found.device_name) - 1; - } - memcpy(data->p2p_device_found.device_name, name_start, name_len); - data->p2p_device_found.device_name[name_len] = '\0'; - } - } - ptr = strstr(event_no_prefix, "config_methods="); - if (ptr) { - ret = sscanf(ptr, "config_methods=%x", &config_methods); - if (ret > 0) { - data->p2p_device_found.config_methods = config_methods; - } - } - event_data->data_len = sizeof(data->p2p_device_found); - ret = 1; - break; - } -#endif case SUPPLICANT_EVENT_TERMINATING: case SUPPLICANT_EVENT_SCAN_STARTED: case SUPPLICANT_EVENT_SCAN_RESULTS: @@ -426,18 +386,8 @@ int supplicant_send_wifi_mgmt_event(const char *ifname, enum net_event_wifi_cmd case NET_EVENT_WIFI_CMD_SUPPLICANT: event_data.data = &data; if (supplicant_process_status(&event_data, (char *)supplicant_status) > 0) { -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - /* Handle P2P events directly */ - if (event_data.event == SUPPLICANT_EVENT_P2P_DEVICE_FOUND) { - wifi_mgmt_raise_p2p_device_found_event(iface, - &data.p2p_device_found); - } else { -#endif - net_mgmt_event_notify_with_info(NET_EVENT_SUPPLICANT_INT_EVENT, - iface, &event_data, sizeof(event_data)); -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - } -#endif + net_mgmt_event_notify_with_info(NET_EVENT_SUPPLICANT_INT_EVENT, + iface, &event_data, sizeof(event_data)); } break; default: diff --git a/modules/hostap/src/supp_events.h b/modules/hostap/src/supp_events.h index 6ff8812c2fb8..1c74af528492 100644 --- a/modules/hostap/src/supp_events.h +++ b/modules/hostap/src/supp_events.h @@ -137,10 +137,6 @@ union supplicant_event_data { unsigned int id; } network_removed; -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - struct wifi_p2p_device_info p2p_device_found; -#endif - char supplicant_event_str[NM_WIFI_EVENT_STR_LEN]; }; @@ -162,9 +158,6 @@ enum supplicant_event_num { SUPPLICANT_EVENT_NETWORK_REMOVED, SUPPLICANT_EVENT_DSCP_POLICY, SUPPLICANT_EVENT_REGDOM_CHANGE, -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - SUPPLICANT_EVENT_P2P_DEVICE_FOUND, -#endif }; struct supplicant_int_event_data { diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index 8afdba33b203..d1f8c360cb50 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -101,9 +101,6 @@ static const struct wifi_mgmt_ops mgmt_ops = { .enterprise_creds = supplicant_add_enterprise_creds, #endif .config_params = supplicant_config_params, -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - .p2p_oper = supplicant_p2p_oper, -#endif }; DEFINE_WIFI_NM_INSTANCE(wifi_supplicant, &mgmt_ops); @@ -248,12 +245,6 @@ static void zephyr_wpa_supplicant_msg(void *ctx, const char *txt, size_t len) supplicant_send_wifi_mgmt_event(wpa_s->ifname, NET_EVENT_WIFI_CMD_NEIGHBOR_REP_RECEIVED, (void *)txt, len); -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - } else if (strncmp(txt, "P2P-", 4) == 0) { - supplicant_send_wifi_mgmt_event(wpa_s->ifname, - NET_EVENT_WIFI_CMD_SUPPLICANT, - (void *)txt, len); -#endif } } diff --git a/subsys/net/l2/wifi/Kconfig b/subsys/net/l2/wifi/Kconfig index eddfb7d4c30a..63680dba9b30 100644 --- a/subsys/net/l2/wifi/Kconfig +++ b/subsys/net/l2/wifi/Kconfig @@ -72,15 +72,6 @@ config WIFI_SHELL_MAX_AP_STA This option defines the maximum number of APs and STAs that can be managed in Wi-Fi shell. -config WIFI_P2P_MAX_PEERS - int "Maximum number of P2P peers that can be returned in a single query" - depends on WIFI_NM_WPA_SUPPLICANT_P2P - default 32 - range 1 256 - help - This option defines the maximum number of P2P peers that can be returned - in a single query operation. - config WIFI_NM bool "Wi-Fi Network manager support" help diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 58d269e277be..6a97f8c0e61c 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -1473,35 +1473,6 @@ static int wifi_set_bgscan(uint64_t mgmt_request, struct net_if *iface, void *da NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_BGSCAN, wifi_set_bgscan); #endif -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P -static int wifi_p2p_oper(uint64_t mgmt_request, struct net_if *iface, - void *data, size_t len) -{ - const struct device *dev = net_if_get_device(iface); - const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_api(iface); - struct wifi_p2p_params *params = data; - - if (wifi_mgmt_api == NULL || wifi_mgmt_api->p2p_oper == NULL) { - return -ENOTSUP; - } - - if (!data || len != sizeof(*params)) { - return -EINVAL; - } - - return wifi_mgmt_api->p2p_oper(dev, params); -} - -NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_P2P_OPER, wifi_p2p_oper); - -void wifi_mgmt_raise_p2p_device_found_event(struct net_if *iface, - struct wifi_p2p_device_info *peer_info) -{ - net_mgmt_event_notify_with_info(NET_EVENT_WIFI_P2P_DEVICE_FOUND, - iface, peer_info, - sizeof(*peer_info)); -} -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P */ #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS void wifi_mgmt_raise_raw_scan_result_event(struct net_if *iface, From d9d92c34b3d2df4c5739333b71924d999ac2be3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0924/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Set P2P capability" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 35055ef3e155580b768adc7de7c3c0915a524722. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 0864a1a00fe3..97c418700431 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1798,9 +1798,6 @@ int nrf_wifi_supp_get_capa(void *if_priv, struct wpa_driver_capa *capa) if (IS_ENABLED(CONFIG_NRF70_AP_MODE)) { capa->flags |= WPA_DRIVER_FLAGS_AP; } - if (IS_ENABLED(CONFIG_NRF70_P2P_MODE)) { - capa->flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE; - } capa->enc |= WPA_DRIVER_CAPA_ENC_WEP40 | WPA_DRIVER_CAPA_ENC_WEP104 | From 31fcaf2d4cf7c0564199510dada98f24358aa4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0925/3334] Revert "[nrf fromlist] drivers: wifi: nrf_wifi: Set SSID for P2P discovery" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a3f1199a2bc24e66ad19017030c24dd07beeae81. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 97c418700431..88ea9f9215b4 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -545,16 +545,16 @@ int nrf_wifi_wpa_supp_scan2(void *if_priv, struct wpa_driver_scan_params *params scan_info->scan_params.num_scan_channels = indx; } - if (params->num_ssids) { - scan_info->scan_params.num_scan_ssids = params->num_ssids; + if (params->filter_ssids) { + scan_info->scan_params.num_scan_ssids = params->num_filter_ssids; - for (indx = 0; indx < params->num_ssids; indx++) { + for (indx = 0; indx < params->num_filter_ssids; indx++) { memcpy(scan_info->scan_params.scan_ssids[indx].nrf_wifi_ssid, - params->ssids[indx].ssid, - params->ssids[indx].ssid_len); + params->filter_ssids[indx].ssid, + params->filter_ssids[indx].ssid_len); scan_info->scan_params.scan_ssids[indx].nrf_wifi_ssid_len = - params->ssids[indx].ssid_len; + params->filter_ssids[indx].ssid_len; } } From 2a071832048e0390f62a19572c7e09eb107473f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0926/3334] Revert "[nrf fromtree] manifest: hostap: Pull fix for SAE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ef871940d16be308d0093932c7d315381b13b7d3. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 639d34d1900b..18f08c9f368a 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 51698b0f5fdac2778484f565d4591fcb1dd92bc4 + revision: 6086dea5ee7406e1eede7f2ca6dff1b00b0f04e2 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 276611b6a4ef50509112fc3cdc963e8b96ed9dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0927/3334] Revert "[nrf fromtree] doc: releases: release-notes: 4.4: Add note on new settings Kconfigs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c3357ce5a375d098b6e3f43b53d20e12d895c5ac. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.4.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 9aa8719c7edc..79a2bbf802e2 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -102,11 +102,6 @@ New APIs and options * :dtcompatible:`jedec,mspi-nor` now allows MSPI configuration of read, write and control commands separately via devicetree. -* Settings - - * :kconfig:option:`CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION` - * :kconfig:option:`CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION_VALUE_SIZE` - .. zephyr-keep-sorted-stop New Boards From 37e728e5b63142e1c213daacde4c016c7ea5c806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0928/3334] Revert "[nrf fromtree] manifest: nrf_wifi: Pull modified API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fab8736d7804b1abe4395f3996813b5c1d06bd1f. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 18f08c9f368a..4315510509bc 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 5eec7aca321735f5fc8e3e7c79e162f0e9810b16 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: a39e9b155830461c9d1cf587afb151b894369b91 + revision: e269670cd17fb8ccc4b7004544276bc7d9578496 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From 075a8bed67a98211abd1b9e0c03a9ba7c45390bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0929/3334] Revert "[nrf fromtree] net: l2: wifi: shell: Add bgscan command" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 669633bf5ca1947e5e308a63c75597aa3aac93f3. Signed-off-by: Tomasz Moń --- subsys/net/l2/wifi/wifi_shell.c | 120 -------------------------------- 1 file changed, 120 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index de4d7e9d03cd..5a90d2ccf4c4 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -3567,113 +3567,6 @@ static int cmd_wifi_set_bss_max_idle_period(const struct shell *sh, size_t argc, return 0; } -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN -static int wifi_bgscan_args_to_params(const struct shell *sh, size_t argc, char *argv[], - struct wifi_bgscan_params *params) -{ - int err; - int opt; - int opt_index = 0; - struct getopt_state *state; - static const struct option long_options[] = { - {"type", required_argument, 0, 't'}, - {"short-interval", required_argument, 0, 's'}, - {"rss-threshold", required_argument, 0, 'r'}, - {"long-interval", required_argument, 0, 'l'}, - {"btm-queries", required_argument, 0, 'b'}, - {"iface", required_argument, 0, 'i'}, - {0, 0, 0, 0}}; - unsigned long uval; - long val; - - while ((opt = getopt_long(argc, argv, "t:s:r:l:b:i:", long_options, &opt_index)) != -1) { - state = getopt_state_get(); - switch (opt) { - case 't': - if (strcmp("simple", state->optarg) == 0) { - params->type = WIFI_BGSCAN_SIMPLE; - } else if (strcmp("learn", state->optarg) == 0) { - params->type = WIFI_BGSCAN_LEARN; - } else if (strcmp("none", state->optarg) == 0) { - params->type = WIFI_BGSCAN_NONE; - } else { - PR_ERROR("Invalid type %s\n", state->optarg); - shell_help(sh); - return SHELL_CMD_HELP_PRINTED; - } - break; - case 's': - uval = shell_strtoul(state->optarg, 10, &err); - if (err < 0) { - PR_ERROR("Invalid short interval %s\n", state->optarg); - return err; - } - params->short_interval = uval; - break; - case 'l': - uval = shell_strtoul(state->optarg, 10, &err); - if (err < 0) { - PR_ERROR("Invalid long interval %s\n", state->optarg); - return err; - } - params->long_interval = uval; - break; - case 'b': - uval = shell_strtoul(state->optarg, 10, &err); - if (err < 0) { - PR_ERROR("Invalid BTM queries %s\n", state->optarg); - return err; - } - params->btm_queries = uval; - break; - case 'r': - val = shell_strtol(state->optarg, 10, &err); - if (err < 0) { - PR_ERROR("Invalid RSSI threshold %s\n", state->optarg); - return err; - } - params->rssi_threshold = val; - break; - case 'i': - /* Unused, but parsing to avoid unknown option error */ - break; - default: - PR_ERROR("Invalid option %c\n", state->optopt); - shell_help(sh); - return SHELL_CMD_HELP_PRINTED; - } - } - - return 0; -} - -static int cmd_wifi_set_bgscan(const struct shell *sh, size_t argc, char *argv[]) -{ - struct net_if *iface = get_iface(IFACE_TYPE_STA, argc, argv); - struct wifi_bgscan_params bgscan_params = { - .type = WIFI_BGSCAN_NONE, - .short_interval = 30, - .long_interval = 300, - .rssi_threshold = 0, - .btm_queries = 0, - }; - int ret; - - if (wifi_bgscan_args_to_params(sh, argc, argv, &bgscan_params) != 0) { - return -ENOEXEC; - } - - ret = net_mgmt(NET_REQUEST_WIFI_BGSCAN, iface, &bgscan_params, - sizeof(struct wifi_bgscan_params)); - if (ret != 0) { - PR_WARNING("Setting background scanning parameters failed: %s\n", strerror(-ret)); - return -ENOEXEC; - } - - return 0; -} -#endif - static int wifi_config_args_to_params(const struct shell *sh, size_t argc, char *argv[], struct wifi_config_params *params) { @@ -4219,19 +4112,6 @@ SHELL_SUBCMD_ADD((wifi), bss_max_idle_period, NULL, cmd_wifi_set_bss_max_idle_period, 2, 2); -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN -SHELL_SUBCMD_ADD((wifi), bgscan, NULL, - "Configure background scanning.\n" - "<-t, --type simple/learn/none> : The scanning type, use none to disable.\n" - "[-s, --short-interval ] : Short scan interval (default: 30).\n" - "[-l, --long-interval ] : Long scan interval (default: 300).\n" - "[-r, --rssi-threshold ] : Signal strength threshold (default: disabled).\n" - "[-b, --btm-queries ] : BTM queries before scanning (default: disabled).\n" - "[-i, --iface=] : Interface index.\n", - cmd_wifi_set_bgscan, - 2, 6); -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN */ - SHELL_SUBCMD_ADD((wifi), config, NULL, "Configure STA parameters.\n" "-o, --okc=<0/1>: Opportunistic Key Caching. 0: disable, 1: enable\n" From 418a2ef83b2382b042ca8e5afd0b3bb2f538a7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0930/3334] Revert "[nrf fromtree] modules: hostap: Support bgscan" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2b747b4cb707d6f83c3fecb9ddf4f4d1e66b8a9d. Signed-off-by: Tomasz Moń --- include/zephyr/net/wifi_mgmt.h | 43 ---------------------- modules/hostap/CMakeLists.txt | 20 ----------- modules/hostap/Kconfig | 30 ---------------- modules/hostap/src/supp_api.c | 65 ---------------------------------- modules/hostap/src/supp_api.h | 11 ------ modules/hostap/src/supp_main.c | 3 -- subsys/net/l2/wifi/wifi_mgmt.c | 25 ------------- 7 files changed, 197 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 817a4fcd6fb6..703f634209d2 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -137,8 +137,6 @@ enum net_request_wifi_cmd { NET_REQUEST_WIFI_CMD_AP_WPS_CONFIG, /** Configure BSS maximum idle period */ NET_REQUEST_WIFI_CMD_BSS_MAX_IDLE_PERIOD, - /** Configure background scanning */ - NET_REQUEST_WIFI_CMD_BGSCAN, /** @cond INTERNAL_HIDDEN */ NET_REQUEST_WIFI_CMD_MAX /** @endcond */ @@ -334,11 +332,6 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_NEIGHBOR_REP_COMPLETE); NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD); -#define NET_REQUEST_WIFI_BGSCAN \ - (NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_BGSCAN) - -NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_BGSCAN); - /** @cond INTERNAL_HIDDEN */ enum { @@ -1410,32 +1403,6 @@ enum wifi_sap_iface_state { WIFI_SAP_IFACE_ENABLED }; -#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN) || defined(__DOXYGEN__) -/** @brief Wi-Fi background scan implementation */ -enum wifi_bgscan_type { - /** None, background scan is disabled */ - WIFI_BGSCAN_NONE = 0, - /** Simple, periodic scan based on signal strength */ - WIFI_BGSCAN_SIMPLE, - /** Learn channels used by the network (experimental) */ - WIFI_BGSCAN_LEARN, -}; - -/** @brief Wi-Fi background scan parameters */ -struct wifi_bgscan_params { - /** The type of background scanning */ - enum wifi_bgscan_type type; - /** Short scan interval in seconds */ - uint16_t short_interval; - /** Long scan interval in seconds */ - uint16_t long_interval; - /** Signal strength threshold in dBm */ - int8_t rssi_threshold; - /** Number of BSS Transition Management (BTM) queries */ - uint16_t btm_queries; -}; -#endif - /* Extended Capabilities */ enum wifi_ext_capab { WIFI_EXT_CAPAB_20_40_COEX = 0, @@ -1775,16 +1742,6 @@ struct wifi_mgmt_ops { */ int (*set_bss_max_idle_period)(const struct device *dev, unsigned short bss_max_idle_period); -#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN) || defined(__DOXYGEN__) - /** Configure background scanning - * - * @param dev Pointer to the device structure for the driver instance. - * @param params Background scanning configuration parameters - * - * @return 0 if ok, < 0 if error - */ - int (*set_bgscan)(const struct device *dev, struct wifi_bgscan_params *params); -#endif }; /** Wi-Fi management offload API */ diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 106d31b8cca4..f3233bb2cfbb 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -78,16 +78,6 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM CONFIG_WNM ) -zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN - CONFIG_BGSCAN -) -zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE - CONFIG_BGSCAN_SIMPLE -) -zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN - CONFIG_BGSCAN_LEARN -) - zephyr_library_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src ${HOSTAP_BASE}/ @@ -166,16 +156,6 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM ${WIFI_NM_WPA_SUPPLICANT_BASE}/wnm_sta.c ) -zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN - ${WIFI_NM_WPA_SUPPLICANT_BASE}/bgscan.c -) -zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE - ${WIFI_NM_WPA_SUPPLICANT_BASE}/bgscan_simple.c -) -zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN - ${WIFI_NM_WPA_SUPPLICANT_BASE}/bgscan_learn.c -) - zephyr_library_sources_ifdef(CONFIG_WPA_CLI src/wpa_cli.c ) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 9eac239daa7d..7799239a2840 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -451,27 +451,6 @@ config WIFI_NM_WPA_SUPPLICANT_SKIP_DHCP_ON_ROAMING needs to get new IP address after roaming to new AP. Disable this to keep DHCP after roaming. -config WIFI_NM_WPA_SUPPLICANT_BGSCAN - bool "Background scanning (for legacy roaming), recommended if 802.11r is not supported" - depends on WIFI_NM_WPA_SUPPLICANT_WNM - depends on !WIFI_NM_WPA_SUPPLICANT_ROAMING - -if WIFI_NM_WPA_SUPPLICANT_BGSCAN - -config WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE - bool "Simple background scanning" - default y - help - Periodic background scans based on signal strength. - -config WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN - bool "Learning" - help - Learn channels used by the network and try to avoid - background scans on other channels (experimental). - -endif # WIFI_NM_WPA_SUPPLICANT_BGSCAN - # Create hidden config options that are used in hostap. This way we do not need # to mark them as allowed for CI checks, and also someone else cannot use the # same name options. @@ -503,15 +482,6 @@ config NO_RANDOM_POOL config WNM bool -config BGSCAN - bool - -config BGSCAN_SIMPLE - bool - -config BGSCAN_LEARN - bool - config NO_WPA bool default y if WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 11c00de06b37..1b3f19b4c1c1 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -1916,71 +1916,6 @@ int supplicant_set_bss_max_idle_period(const struct device *dev, return wifi_mgmt_api->set_bss_max_idle_period(dev, bss_max_idle_period); } -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN -int supplicant_set_bgscan(const struct device *dev, struct wifi_bgscan_params *params) -{ - struct wpa_supplicant *wpa_s; - struct wpa_ssid *ssid; - int ret = -1; - - k_mutex_lock(&wpa_supplicant_mutex, K_FOREVER); - - wpa_s = get_wpa_s_handle(dev); - if (wpa_s == NULL) { - wpa_printf(MSG_ERROR, "Interface %s not found", dev->name); - goto out; - } - - ssid = wpa_s->current_ssid; - if (ssid == NULL) { - wpa_printf(MSG_ERROR, "SSID for %s not found", dev->name); - goto out; - } - - switch (params->type) { - case WIFI_BGSCAN_SIMPLE: - if (!IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE)) { - wpa_printf(MSG_ERROR, "Invalid bgscan type, enable " - "CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_SIMPLE"); - ret = -ENOTSUP; - goto out; - } - if (!wpa_cli_cmd_v("set_network %d bgscan \"simple:%d:%d:%d:%d\"", ssid->id, - params->short_interval, params->rssi_threshold, - params->long_interval, params->btm_queries)) { - goto out; - } - break; - case WIFI_BGSCAN_LEARN: - if (!IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN)) { - wpa_printf(MSG_ERROR, "Invalid bgscan type, enable " - "CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN"); - ret = -ENOTSUP; - goto out; - } - if (!wpa_cli_cmd_v("set_network %d bgscan \"learn:%d:%d:%d\"", ssid->id, - params->short_interval, params->rssi_threshold, - params->long_interval)) { - goto out; - } - break; - case WIFI_BGSCAN_NONE: - default: - if (!wpa_cli_cmd_v("set_network %d bgscan \"\"", ssid->id)) { - goto out; - } - break; - } - - ret = 0; - -out: - k_mutex_unlock(&wpa_supplicant_mutex); - - return ret; -} -#endif - #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM int supplicant_btm_query(const struct device *dev, uint8_t reason) { diff --git a/modules/hostap/src/supp_api.h b/modules/hostap/src/supp_api.h index 8ab49f177e70..1ef63474f3fb 100644 --- a/modules/hostap/src/supp_api.h +++ b/modules/hostap/src/supp_api.h @@ -321,17 +321,6 @@ int supplicant_wps_config(const struct device *dev, struct wifi_wps_config_param */ int supplicant_set_bss_max_idle_period(const struct device *dev, unsigned short bss_max_idle_period); - -#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN) || defined(__DOXYGEN__) -/** @ Set Wi-Fi background scanning parameters - * - * @param dev Wi-Fi interface handle to use - * @param params bgscan parameters - * @return 0 for OK; -1 for ERROR - */ -int supplicant_set_bgscan(const struct device *dev, struct wifi_bgscan_params *params); -#endif - #ifdef CONFIG_AP int set_ap_bandwidth(const struct device *dev, enum wifi_frequency_bandwidths bandwidth); diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index d1f8c360cb50..74d195386b1f 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -85,9 +85,6 @@ static const struct wifi_mgmt_ops mgmt_ops = { .get_conn_params = supplicant_get_wifi_conn_params, .wps_config = supplicant_wps_config, .set_bss_max_idle_period = supplicant_set_bss_max_idle_period, -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN - .set_bgscan = supplicant_set_bgscan, -#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN */ #ifdef CONFIG_AP .ap_enable = supplicant_ap_enable, .ap_disable = supplicant_ap_disable, diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index 6a97f8c0e61c..a962fe317664 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -1449,31 +1449,6 @@ static int wifi_set_bss_max_idle_period(uint64_t mgmt_request, struct net_if *if NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_BSS_MAX_IDLE_PERIOD, wifi_set_bss_max_idle_period); -#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_BGSCAN -static int wifi_set_bgscan(uint64_t mgmt_request, struct net_if *iface, void *data, size_t len) -{ - const struct device *dev = net_if_get_device(iface); - const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_api(iface); - struct wifi_bgscan_params *params = data; - - if (wifi_mgmt_api == NULL || wifi_mgmt_api->set_bgscan == NULL) { - return -ENOTSUP; - } - - if (!net_if_is_admin_up(iface)) { - return -ENETDOWN; - } - - if (data == NULL || len != sizeof(*params)) { - return -EINVAL; - } - - return wifi_mgmt_api->set_bgscan(dev, params); -} - -NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_BGSCAN, wifi_set_bgscan); -#endif - #ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS void wifi_mgmt_raise_raw_scan_result_event(struct net_if *iface, struct wifi_raw_scan_result *raw_scan_result) From dce7be87ca92b28fb9b5badc59979581e0420b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0931/3334] Revert "[nrf fromlist] img_mgmt: Use absolute address in active partition" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5c93c6e873379f1af335279648692611a6444379. Signed-off-by: Tomasz Moń --- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c index 97fc430e374a..5e52a9fa5c15 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -48,9 +48,13 @@ to be able to figure out application running slot. #endif +#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ + (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) + #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && \ + DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) From c7e404c90fee8f2f9b9243fd019d53757e873a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0932/3334] Revert "[nrf fromlist] img_util: Use absolute address in active partition" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aa5ffe9eea8a0c5f7a48b5a21afcb8a092f81492. Signed-off-by: Tomasz Moń --- subsys/dfu/img_util/flash_img.c | 8 ++++++-- tests/subsys/dfu/img_util/src/main.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index d3c9749401b2..152aaabe17ae 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -24,9 +24,13 @@ LOG_MODULE_REGISTER(flash_img, CONFIG_IMG_MANAGER_LOG_LEVEL); #include #endif +#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ + (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) + #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && \ + DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) diff --git a/tests/subsys/dfu/img_util/src/main.c b/tests/subsys/dfu/img_util/src/main.c index c0b5d96daeb1..013498f49bd3 100644 --- a/tests/subsys/dfu/img_util/src/main.c +++ b/tests/subsys/dfu/img_util/src/main.c @@ -13,9 +13,13 @@ #define SLOT0_PARTITION slot0_partition #define SLOT1_PARTITION slot1_partition +#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ + (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) + #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && \ + DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ + FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) From fe6c4e055d6916a4ba5d46fd2cf5853bf0e09a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0933/3334] Revert "[nrf fromlist] soc: Use absolute address in active partition" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 408dfb9c005a28da24a7d3da8920e900c3617aa2. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/soc.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 591b0d480acf..32357011d3f5 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -41,20 +41,14 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); DT_REG_ADDR(COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ (DT_GPARENT(DT_PARENT(DT_NODELABEL(label)))), \ (DT_GPARENT(DT_NODELABEL(label)))))) -#define FIXED_PARTITION_NODE_MTD(node) \ - COND_CODE_1( \ - DT_FIXED_SUBPARTITION_EXISTS(node), \ - (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ - (DT_MTD_FROM_FIXED_PARTITION(node))) #ifdef CONFIG_USE_DT_CODE_PARTITION #define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) #elif defined(CONFIG_FLASH_LOAD_OFFSET) #define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET #endif -#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_NODE_MTD(DT_NODELABEL(label))) && \ + +#define PARTITION_IS_RUNNING_APP_PARTITION(label) \ (DT_REG_ADDR(DT_NODELABEL(label)) <= FLASH_LOAD_OFFSET && \ DT_REG_ADDR(DT_NODELABEL(label)) + DT_REG_SIZE(DT_NODELABEL(label)) > FLASH_LOAD_OFFSET) @@ -216,7 +210,7 @@ void soc_late_init_hook(void) void *radiocore_address = NULL; #if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) - if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { + if (PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition) + CONFIG_ROM_START_OFFSET); } else { From eac1c7d733cde8ba376fbc26ff7604e11a973e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:29 +0100 Subject: [PATCH 0934/3334] Revert "[nrf fromlist] flash_map: Add a macro to fetch controller ID" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 65706b4e87243c122888934837860683148b38bc. Signed-off-by: Tomasz Moń --- include/zephyr/storage/flash_map.h | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 558a0a0b7e72..9dc6bd91438f 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -19,7 +19,7 @@ * * @defgroup flash_area_api flash area Interface * @since 1.11 - * @version 1.1.0 + * @version 1.0.0 * @ingroup storage_apis * @{ */ @@ -469,32 +469,6 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ (DT_MTD_FROM_FIXED_PARTITION(node)))) -/** - * Get the node identifier of the flash controller the area/partition resides on - * - * @param label DTS node label of a partition - * - * @return Pointer to a device. - */ -#define FIXED_PARTITION_MTD(label) \ - COND_CODE_1( \ - DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ - (DT_MTD_FROM_FIXED_SUBPARTITION(DT_NODELABEL(label))), \ - (DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label)))) - -/** - * Get the node identifier of the flash controller the area/partition resides on - * - * @param node DTS node of a partition - * - * @return Pointer to a device. - */ -#define FIXED_PARTITION_NODE_MTD(node) \ - COND_CODE_1( \ - DT_FIXED_SUBPARTITION_EXISTS(node), \ - (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ - (DT_MTD_FROM_FIXED_PARTITION(node))) - /** * Get pointer to flash_area object by partition label * From ffe692ebb3cfb4166a6cce96aa5818882ec1facf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0935/3334] Revert "[nrf fromtree] mgmt: mcumgr: grp: img_mgmt: Fix detecting where a slot resides" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit de60cd46e18ac2c064718ea086feb1c433cf1b7a. Signed-off-by: Tomasz Moń --- subsys/dfu/img_util/flash_img.c | 8 +------- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 8 +------- tests/subsys/dfu/img_util/src/main.c | 7 ------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index 152aaabe17ae..24e95a8dc1a9 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -24,16 +23,11 @@ LOG_MODULE_REGISTER(flash_img, CONFIG_IMG_MANAGER_LOG_LEVEL); #include #endif -#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ - (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) - #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) +#include #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && (CONFIG_TFM_MCUBOOT_IMAGE_NUMBER == 2) #define UPLOAD_FLASH_AREA_LABEL slot1_ns_partition #else 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 5e52a9fa5c15..a2bf006b9474 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2021 mcumgr authors - * Copyright (c) 2022-2025 Nordic Semiconductor ASA + * Copyright (c) 2022-2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -48,13 +48,7 @@ to be able to figure out application running slot. #endif -#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ - (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) - #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) diff --git a/tests/subsys/dfu/img_util/src/main.c b/tests/subsys/dfu/img_util/src/main.c index 013498f49bd3..33956be6251e 100644 --- a/tests/subsys/dfu/img_util/src/main.c +++ b/tests/subsys/dfu/img_util/src/main.c @@ -6,20 +6,13 @@ */ #include -#include #include #include #define SLOT0_PARTITION slot0_partition #define SLOT1_PARTITION slot1_partition -#define FIXED_PARTITION_GET_FLASH_NODE(node_id) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ - (DT_PARENT(DT_GPARENT(node_id))), (DT_GPARENT(node_id))) - #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - DT_SAME_NODE(FIXED_PARTITION_GET_FLASH_NODE(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_GET_FLASH_NODE(DT_NODELABEL(label))) && \ (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) From 5aff1cefde218db0af102e0125ca32046a4cbeec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0936/3334] Revert "[nrf noup] soc: nordic: Support TF-M for poweroff" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 987aaa43680d12d4b6bfff15973da506c302cc3c. Signed-off-by: Tomasz Moń --- soc/nordic/common/poweroff.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/soc/nordic/common/poweroff.c b/soc/nordic/common/poweroff.c index f659d31997f2..ebce3aae77cd 100644 --- a/soc/nordic/common/poweroff.c +++ b/soc/nordic/common/poweroff.c @@ -7,9 +7,7 @@ #include #include -#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) -#include "tfm_platform_api.h" -#elif defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) #include #elif defined(CONFIG_SOC_SERIES_NRF54HX) #include @@ -32,10 +30,6 @@ void z_sys_poweroff(void) { -#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) - tfm_platform_system_off(); -#else - #if defined(CONFIG_HAS_NORDIC_RAM_CTRL) uint8_t *ram_start; size_t ram_size; @@ -84,7 +78,5 @@ void z_sys_poweroff(void) nrf_regulators_system_off(NRF_REGULATORS); #endif -#endif /* CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE */ - CODE_UNREACHABLE; } From 0bbbeeb1b25dc94197b403fad0b3bfa49a9671b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0937/3334] Revert "[nrf fromtree] soc: ironside: counter_service: 2 compilation errors fixed" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3010f403fe083d3a0055de9740e2305b154862a4. Signed-off-by: Tomasz Moń --- soc/nordic/ironside/counter.c | 1 - soc/nordic/ironside/include/nrf_ironside/counter.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/soc/nordic/ironside/counter.c b/soc/nordic/ironside/counter.c index b4506621851d..b0c80ea1bd50 100644 --- a/soc/nordic/ironside/counter.c +++ b/soc/nordic/ironside/counter.c @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include #include #include diff --git a/soc/nordic/ironside/include/nrf_ironside/counter.h b/soc/nordic/ironside/include/nrf_ironside/counter.h index 37866c43a684..ca8f23fd264b 100644 --- a/soc/nordic/ironside/include/nrf_ironside/counter.h +++ b/soc/nordic/ironside/include/nrf_ironside/counter.h @@ -7,7 +7,7 @@ #define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ #include -#include +#include #include /** From acb54086bc9a555ca0470d259303aee41f759fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0938/3334] Revert "[nrf fromtree] soc: nordic: ironside: Add counter service" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7f2ac3ed2f35e631f830962341a2a2e21e29c47e. Signed-off-by: Tomasz Moń --- soc/nordic/ironside/CMakeLists.txt | 1 - soc/nordic/ironside/Kconfig | 6 - soc/nordic/ironside/counter.c | 80 ---------- .../ironside/include/nrf_ironside/counter.h | 143 ------------------ 4 files changed, 230 deletions(-) delete mode 100644 soc/nordic/ironside/counter.c delete mode 100644 soc/nordic/ironside/include/nrf_ironside/counter.h diff --git a/soc/nordic/ironside/CMakeLists.txt b/soc/nordic/ironside/CMakeLists.txt index f1ae2114f2ec..ea7f68207a89 100644 --- a/soc/nordic/ironside/CMakeLists.txt +++ b/soc/nordic/ironside/CMakeLists.txt @@ -10,4 +10,3 @@ zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOTMODE_SERVICE bootmode.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_TDD_SERVICE tdd.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c) zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_DVFS_SERVICE dvfs.c) -zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_COUNTER_SERVICE counter.c) diff --git a/soc/nordic/ironside/Kconfig b/soc/nordic/ironside/Kconfig index ddc7814fb86e..ce4878b7b182 100644 --- a/soc/nordic/ironside/Kconfig +++ b/soc/nordic/ironside/Kconfig @@ -69,12 +69,6 @@ config NRF_IRONSIDE_DVFS_SERVICE help Service used to handle DVFS operating point requests. -config NRF_IRONSIDE_COUNTER_SERVICE - bool "IronSide counter service" - select NRF_IRONSIDE_CALL - help - Service used to manage secure monotonic counters. - if NRF_IRONSIDE_DVFS_SERVICE config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS diff --git a/soc/nordic/ironside/counter.c b/soc/nordic/ironside/counter.c deleted file mode 100644 index b0c80ea1bd50..000000000000 --- a/soc/nordic/ironside/counter.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -int ironside_counter_set(enum ironside_counter counter_id, uint32_t value) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_COUNTER_SET_V1; - buf->args[IRONSIDE_COUNTER_SET_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; - buf->args[IRONSIDE_COUNTER_SET_SERVICE_VALUE_IDX] = value; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_COUNTER_SET_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} - -int ironside_counter_get(enum ironside_counter counter_id, uint32_t *value) -{ - int err; - struct ironside_call_buf *buf; - - if (value == NULL) { - return -IRONSIDE_COUNTER_ERROR_INVALID_PARAM; - } - - buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_COUNTER_GET_V1; - buf->args[IRONSIDE_COUNTER_GET_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_COUNTER_GET_SERVICE_RETCODE_IDX]; - if (err == 0) { - *value = buf->args[IRONSIDE_COUNTER_GET_SERVICE_VALUE_IDX]; - } - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} - -int ironside_counter_lock(enum ironside_counter counter_id) -{ - int err; - struct ironside_call_buf *const buf = ironside_call_alloc(); - - buf->id = IRONSIDE_CALL_ID_COUNTER_LOCK_V1; - buf->args[IRONSIDE_COUNTER_LOCK_SERVICE_COUNTER_ID_IDX] = (uint32_t)counter_id; - - ironside_call_dispatch(buf); - - if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) { - err = buf->args[IRONSIDE_COUNTER_LOCK_SERVICE_RETCODE_IDX]; - } else { - err = buf->status; - } - - ironside_call_release(buf); - - return err; -} diff --git a/soc/nordic/ironside/include/nrf_ironside/counter.h b/soc/nordic/ironside/include/nrf_ironside/counter.h deleted file mode 100644 index ca8f23fd264b..000000000000 --- a/soc/nordic/ironside/include/nrf_ironside/counter.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ -#define ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ - -#include -#include -#include - -/** - * @name Counter service error codes. - * @{ - */ - -/** Counter value is lower than current value (monotonic violation). */ -#define IRONSIDE_COUNTER_ERROR_TOO_LOW (1) -/** Invalid counter ID. */ -#define IRONSIDE_COUNTER_ERROR_INVALID_ID (2) -/** Counter is locked and cannot be modified. */ -#define IRONSIDE_COUNTER_ERROR_LOCKED (3) -/** Invalid parameter. */ -#define IRONSIDE_COUNTER_ERROR_INVALID_PARAM (4) -/** Storage operation failed. */ -#define IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE (5) - -/** - * @} - */ - -/** Maximum value for a counter */ -#define IRONSIDE_COUNTER_MAX_VALUE UINT32_MAX - -/** Number of counters */ -#define IRONSIDE_COUNTER_NUM 4 - -/** - * @brief Counter identifiers. - */ -enum ironside_counter { - IRONSIDE_COUNTER_0 = 0, - IRONSIDE_COUNTER_1, - IRONSIDE_COUNTER_2, - IRONSIDE_COUNTER_3 -}; - -/* IronSide call identifiers with implicit versions. */ -#define IRONSIDE_CALL_ID_COUNTER_SET_V1 6 -#define IRONSIDE_CALL_ID_COUNTER_GET_V1 7 -#define IRONSIDE_CALL_ID_COUNTER_LOCK_V1 8 - -enum { - IRONSIDE_COUNTER_SET_SERVICE_COUNTER_ID_IDX, - IRONSIDE_COUNTER_SET_SERVICE_VALUE_IDX, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_COUNTER_SET_NUM_ARGS -}; - -enum { - IRONSIDE_COUNTER_GET_SERVICE_COUNTER_ID_IDX, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_COUNTER_GET_NUM_ARGS -}; - -enum { - IRONSIDE_COUNTER_LOCK_SERVICE_COUNTER_ID_IDX, - /* The last enum value is reserved for the number of arguments */ - IRONSIDE_COUNTER_LOCK_NUM_ARGS -}; - -/* Index of the return code within the service buffer. */ -#define IRONSIDE_COUNTER_SET_SERVICE_RETCODE_IDX (0) -#define IRONSIDE_COUNTER_GET_SERVICE_RETCODE_IDX (0) -#define IRONSIDE_COUNTER_LOCK_SERVICE_RETCODE_IDX (0) - -/* Index of the value within the GET response buffer. */ -#define IRONSIDE_COUNTER_GET_SERVICE_VALUE_IDX (1) - -BUILD_ASSERT(IRONSIDE_COUNTER_SET_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); -BUILD_ASSERT(IRONSIDE_COUNTER_GET_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); -BUILD_ASSERT(IRONSIDE_COUNTER_LOCK_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS); - -/** - * @brief Set a counter value. - * - * This sets the specified counter to the given value. The counter is monotonic, - * so the new value must be greater than or equal to the current value. - * If the counter is locked, the operation will fail. - * - * @note Counters are automatically initialized to 0 during the first boot in LCS ROT. - * The monotonic constraint applies to all subsequent writes. - * - * @param counter_id Counter identifier. - * @param value New counter value. - * - * @retval 0 on success. - * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. - * @retval -IRONSIDE_COUNTER_ERROR_TOO_LOW if value is lower than current value. - * @retval -IRONSIDE_COUNTER_ERROR_LOCKED if counter is locked. - * @retval -IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE if storage operation failed. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_counter_set(enum ironside_counter counter_id, uint32_t value); - -/** - * @brief Get a counter value. - * - * This retrieves the current value of the specified counter. - * - * @note Counters are automatically initialized to 0 during the first boot in LCS ROT, - * so this function will always succeed for valid counter IDs. - * - * @param counter_id Counter identifier. - * @param value Pointer to store the counter value. - * - * @retval 0 on success. - * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. - * @retval -IRONSIDE_COUNTER_ERROR_INVALID_PARAM if value is NULL. - * @retval -IRONSIDE_COUNTER_ERROR_STORAGE_FAILURE if storage operation failed. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_counter_get(enum ironside_counter counter_id, uint32_t *value); - -/** - * @brief Lock a counter for the current boot. - * - * This locks the specified counter, preventing any further modifications until the next reboot. - * The lock state is not persistent and will be cleared on reboot. - * - * @note The intended use case is for a bootloader to lock a counter before transferring control - * to the next boot stage, preventing that image from modifying the counter value. - * - * @param counter_id Counter identifier. - * - * @retval 0 on success. - * @retval -IRONSIDE_COUNTER_ERROR_INVALID_ID if counter_id is invalid. - * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). - */ -int ironside_counter_lock(enum ironside_counter counter_id); - -#endif /* ZEPHYR_SOC_NORDIC_IRONSIDE_INCLUDE_NRF_IRONSIDE_COUNTER_H_ */ From 7ab669fbc236cae3308259ac066a79f8b034cdce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0939/3334] Revert "[nrf fromlist] boards: shields: Add nRF7002 EB-II shield" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 95ad0eb429a1a17809e5a5594fd8160264233c6e. Signed-off-by: Tomasz Moń --- boards/shields/nrf7002eb2/Kconfig.shield | 14 --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 54 ----------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 89 ------------------ boards/shields/nrf7002eb2/doc/index.rst | 72 -------------- boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg | Bin 49527 -> 0 bytes boards/shields/nrf7002eb2/nrf7002eb2.overlay | 24 ----- .../nrf7002eb2/nrf7002eb2_coex.overlay | 15 --- .../shields/nrf7002eb2/nrf7002eb2_common.dtsi | 20 ---- .../nrf7002eb2/nrf7002eb2_common_5g.dtsi | 12 --- .../nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi | 25 ----- .../nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi | 15 --- .../nrf7002eb2/nrf7002eb2_nrf7000.overlay | 24 ----- .../nrf7002eb2/nrf7002eb2_nrf7001.overlay | 23 ----- boards/shields/nrf7002eb2/shield.yml | 26 ----- 14 files changed, 413 deletions(-) delete mode 100644 boards/shields/nrf7002eb2/Kconfig.shield delete mode 100644 boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 boards/shields/nrf7002eb2/doc/index.rst delete mode 100644 boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2.overlay delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay delete mode 100644 boards/shields/nrf7002eb2/shield.yml diff --git a/boards/shields/nrf7002eb2/Kconfig.shield b/boards/shields/nrf7002eb2/Kconfig.shield deleted file mode 100644 index 3a6309b39148..000000000000 --- a/boards/shields/nrf7002eb2/Kconfig.shield +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config SHIELD_NRF7002EB2 - def_bool $(shields_list_contains,nrf7002eb2) - -config SHIELD_NRF7002EB2_NRF7001 - def_bool $(shields_list_contains,nrf7002eb2_nrf7001) - -config SHIELD_NRF7002EB2_NRF7000 - def_bool $(shields_list_contains,nrf7002eb2_nrf7000) - -config SHIELD_NRF7002EB2_COEX - def_bool $(shields_list_contains,nrf7002eb2_coex) diff --git a/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 912d806b5f47..000000000000 --- a/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "../nrf7002eb2_gpio_pins_1.dtsi" - -/ { - chosen { - zephyr,wifi = &wlan0; - zephyr,console = &uart30; - zephyr,shell-uart = &uart30; - zephyr,uart-mcumgr = &uart30; - zephyr,bt-mon-uart = &uart30; - zephyr,bt-c2h-uart = &uart30; - }; -}; - -&pinctrl { - spi22_default: spi22_default { - group1 { - psels = , - , - ; - bias-pull-down; - }; - }; - - spi22_sleep: spi22_sleep { - group1 { - psels = , - , - ; - bias-pull-down; - low-power-enable; - }; - }; -}; - -&spi22 { - cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&uart20 { - status = "disabled"; -}; - -&uart30 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index dcc759345bad..000000000000 --- a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "../nrf7002eb2_gpio_pins_2.dtsi" - -/ { - chosen { - zephyr,wifi = &wlan0; - zephyr,console = &uart30; - zephyr,shell-uart = &uart30; - zephyr,uart-mcumgr = &uart30; - zephyr,bt-mon-uart = &uart30; - zephyr,bt-c2h-uart = &uart30; - }; - - buttons { - /delete-node/ button_3; - }; - - aliases { - /delete-property/ sw3; - }; -}; - -&gpio3 { - status = "okay"; -}; - -&pinctrl { - spi22_default: spi22_default { - group1 { - psels = , - , - ; - bias-pull-down; - }; - }; - - spi22_sleep: spi22_sleep { - group1 { - psels = , - , - ; - bias-pull-down; - low-power-enable; - }; - }; - - uart30_default: uart30_default { - group1 { - psels = ; - }; - - group2 { - psels = ; - bias-pull-up; - }; - }; - - uart30_sleep: uart30_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&spi22 { - status = "okay"; - cs-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; -}; - -/* uart20 has pin conflicts with EB-II shield hence disabling that - * and enabling uart30 as console port. - */ -&uart20 { - status = "disabled"; -}; - -&uart30 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/doc/index.rst b/boards/shields/nrf7002eb2/doc/index.rst deleted file mode 100644 index 6fe033c21221..000000000000 --- a/boards/shields/nrf7002eb2/doc/index.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. _nrf7002eb2: - -nRF7002 EB II -############# - -Overview -******** - -The nRF7002 EB II is a versatile evaluation kit in the form of a thumbstick shield which connects to -compatible Nordic host boards using the Nordic edge-connector. - -The nRF7002 EB II unlocks low-power Wi-Fi 6 capabilities for your host device. It supports dual-band Wi-Fi -2.4GHz and 5GHz, and is based on the nRF7002 SoC. The shield also supports nRF7001 and nRF7000 SoCs -through variant overlays. -Seamlessly connect to Wi-Fi networks and leverage Wi-Fi-based locationing, enabling advanced -features such as SSID sniffing of local Wi-Fi hubs. - -.. figure:: nrf7002eb2.jpg - :alt: nRF7002 EB II - :align: center - - nRF7002 EB II - -Requirements -************ - -The nRF7002 EB II board is designed to fit straight into a Nordic edge-connector and uses SPI as the -communication interface. Any host board that supports the Nordic edge-connector can be used with -the nRF7002 EB II. - -Prerequisites -------------- - -The nRF70 driver requires firmware binary blobs for Wi-Fi operation. Run the command -below to retrieve those files. - -.. code-block:: console - - west update - west blobs fetch nrf_wifi - -Usage -***** - -The shield can be used in any application by setting ``--shield nrf7002eb2`` when invoking ``west build``. - -Shield Variants -*************** - -The nRF7002 EB II has several variants to support different nRF70 SoCs and features: - -- ``nrf7002eb2``: The default variant using the nRF7002 SoC. -- ``nrf7002eb2_nrf7001``: Variant using the nRF7001 SoC. -- ``nrf7002eb2_nrf7000``: Variant using the nRF7000 SoC. -- ``nrf7002eb2_coex``: Variant which includes the COEX pins. These pins are not routed to the - edge-connector on some boards, like earlier revisions of the Thingy53 than v1.0.0. - -SR Co-existence -*************** - -The nRF7002 EB II supports SR co-existence provided the host board supports it. The SR co-existence -pins are connected to the host board's GPIO pins. - -Two Kconfig options are available to enable SR co-existence: - -- :kconfig:option:`CONFIG_NRF70_SR_COEX`: Enables SR co-existence. -- :kconfig:option:`CONFIG_NRF70_SR_COEX_RF_SWITCH`: Control SR side RF switch. - -References -********** - -- `Developing with nRF7002 EB II `_ diff --git a/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg b/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg deleted file mode 100644 index 458093f1662041123b3afae0d83a1aa9e8564ec3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49527 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 z 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 bi4kLg0)r;$UqfF0JMo17SNgvAYwCXh^nayi diff --git a/boards/shields/nrf7002eb2/nrf7002eb2.overlay b/boards/shields/nrf7002eb2/nrf7002eb2.overlay deleted file mode 100644 index 304814fa3040..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2.overlay +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&wifi_spi { - status = "okay"; - - nrf70: nrf7002-spi@0 { - compatible = "nordic,nrf7002-spi"; - status = "okay"; - - /* Include common nRF70 overlays */ - #include "nrf7002eb2_common.dtsi" - #include "nrf7002eb2_common_5g.dtsi" - }; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay deleted file mode 100644 index 36f352bc6a5e..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - nrf_radio_coex: coex { - compatible = "nordic,nrf7002-coex"; - status = "okay"; - status0-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; - req-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; - grant-gpios = <&gpio1 7 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; - }; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi deleted file mode 100644 index efe0703ac9dd..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include - -/* Common assignments for nRF70 EB-II shield */ -reg = <0>; -spi-max-frequency = ; - -/* Maximum TX power limits for 2.4 GHz */ -wifi-max-tx-pwr-2g-dsss = <21>; -wifi-max-tx-pwr-2g-mcs0 = <16>; -wifi-max-tx-pwr-2g-mcs7 = <16>; - -/* List of interfaces */ -wlan0: wlan0 { - compatible = "nordic,wlan"; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi deleted file mode 100644 index 05a472a32bd5..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -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/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi deleted file mode 100644 index 95ad1ed44221..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - nrf_radio_coex: coex { - compatible = "nordic,nrf7002-coex"; - status = "disabled"; - status0-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; - req-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; - grant-gpios = <&gpio1 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; - }; -}; - -&nrf70 { - iovdd-ctrl-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; - bucken-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; - host-irq-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi deleted file mode 100644 index dc59273a0314..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&nrf70 { - iovdd-ctrl-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - bucken-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; - host-irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay deleted file mode 100644 index 22b36e7b27fc..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&wifi_spi { - status = "okay"; - - nrf70: nrf7000-spi@0 { - compatible = "nordic,nrf7000-spi"; - status = "okay"; - - /* Include common nRF70 overlays */ - #include "nrf7002eb2_common.dtsi" - #include "nrf7002eb2_common_5g.dtsi" - }; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay deleted file mode 100644 index 9a9243063a98..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&wifi_spi { - status = "okay"; - - nrf70: nrf7001-spi@0 { - compatible = "nordic,nrf7001-spi"; - status = "okay"; - - /* Include common nRF70 overlays */ - #include "nrf7002eb2_common.dtsi" - }; -}; diff --git a/boards/shields/nrf7002eb2/shield.yml b/boards/shields/nrf7002eb2/shield.yml deleted file mode 100644 index 60349b0a3cb7..000000000000 --- a/boards/shields/nrf7002eb2/shield.yml +++ /dev/null @@ -1,26 +0,0 @@ -# @Kconfig.shield - -shields: - - name: nrf7002eb2 - full_name: nRF7002 EB-II Shield - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_nrf7001 - full_name: nRF7002 EB-II Shield (nRF7001) - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_nrf7000 - full_name: nRF7002 EB-II Shield (nRF7000) - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_coex - full_name: nRF7002 EB-II Shield (SR Co-Existence) - vendor: nordic - supported_features: - - wifi From fc93d4a1dc8f9642cf2a04cdc520460a6c020b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0940/3334] Revert "[nrf noup] include: net: add TLS_DTLS_FRAG_EXT to NCS extensions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a5a08497515f17ef850dd6884e010f4ffc338483. Signed-off-by: Tomasz Moń --- include/zephyr/net/socket_ncs.h | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h index 7c8bae645f6c..6a77d6c41f13 100644 --- a/include/zephyr/net/socket_ncs.h +++ b/include/zephyr/net/socket_ncs.h @@ -69,27 +69,6 @@ extern "C" { #define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 #define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 -/** Socket option to enable the DTLS fragmentation extension. - * Accepted values for the option are: @ref DTLS_FRAG_EXT_DISABLED, - * @ref DTLS_FRAG_EXT_512_ENABLED, @ref DTLS_FRAG_EXT_1024_ENABLED. - */ -#define TLS_DTLS_FRAG_EXT (NET_SOCKET_NCS_BASE + 22) - -/** Disabled - The DTLS fragmentation extension is not included in the Client Hello. */ -#define DTLS_FRAG_EXT_DISABLED 0 -/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment - * size of 512 bytes. - * - * @note The user data size in send requests also becomes limited to a maximum of 512 bytes. - */ -#define DTLS_FRAG_EXT_512_ENABLED 1 -/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment - * size of 1024 bytes. - * - * @note The user data size in send requests also becomes limited to a maximum of 1024 bytes. - */ -#define DTLS_FRAG_EXT_1024_ENABLED 2 - /* NCS specific socket options */ /** sockopt: enable sending data as part of exceptional events */ From d1bddf2d810feea777d8f0676249ccffb7708432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0941/3334] Revert "[nrf fromtree] drivers: udc_dwc2: avoid register read on disabled controller" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ddef93b14cb967b214eb1a2e15cc9b8ed4f1d708. Signed-off-by: Tomasz Moń --- drivers/usb/udc/udc_dwc2.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 769030670918..eb7368e1178f 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -2328,7 +2328,6 @@ static int udc_dwc2_disable(const struct device *dev) } config->irq_disable_func(dev); - cancel_hibernation_request(priv); if (priv->hibernated) { dwc2_exit_hibernation(dev, false, true); From c6837266be6f382f9c3f730b21bfab78aa06276d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0942/3334] Revert "[nrf fromtree] usb: device_next: use slist to store completed transfer requests" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a275c8bb63cca39f7e29e9cad3439f9cb8f9cf06. Signed-off-by: Tomasz Moń --- include/zephyr/usb/usbd.h | 4 -- subsys/usb/device_next/usbd_core.c | 60 ++++++++---------------------- 2 files changed, 16 insertions(+), 48 deletions(-) diff --git a/include/zephyr/usb/usbd.h b/include/zephyr/usb/usbd.h index 953182096580..d4afb34e7664 100644 --- a/include/zephyr/usb/usbd.h +++ b/include/zephyr/usb/usbd.h @@ -287,10 +287,6 @@ struct usbd_context { const struct device *dev; /** Notification message recipient callback */ usbd_msg_cb_t msg_cb; - /** slist to keep endpoint events */ - sys_slist_t ep_events; - /** Endpoint event list spinlock */ - struct k_spinlock ep_event_lock; /** Middle layer runtime data */ struct usbd_ch9_data ch9_data; /** slist to manage descriptors like string, BOS */ diff --git a/subsys/usb/device_next/usbd_core.c b/subsys/usb/device_next/usbd_core.c index a802d74028a2..9f24530fc2c2 100644 --- a/subsys/usb/device_next/usbd_core.c +++ b/subsys/usb/device_next/usbd_core.c @@ -34,53 +34,29 @@ K_MSGQ_DEFINE(usbd_msgq, sizeof(struct udc_event), static int usbd_event_carrier(const struct device *dev, const struct udc_event *const event) { - struct usbd_context *const uds_ctx = (void *)udc_get_event_ctx(dev); - k_spinlock_key_t key; - - if (event->type == UDC_EVT_EP_REQUEST) { - /* - * Always add completed transfer requests to the list, so they - * do not get lost. - */ - key = k_spin_lock(&uds_ctx->ep_event_lock); - sys_slist_append(&uds_ctx->ep_events, &event->buf->node); - k_spin_unlock(&uds_ctx->ep_event_lock, key); - } - return k_msgq_put(&usbd_msgq, event, K_NO_WAIT); } -static void event_handler_ep_request(struct usbd_context *const uds_ctx) +static int event_handler_ep_request(struct usbd_context *const uds_ctx, + const struct udc_event *const event) { struct udc_buf_info *bi; - k_spinlock_key_t key; - struct net_buf *buf; - sys_snode_t *node; int ret; - while (!sys_slist_is_empty(&uds_ctx->ep_events)) { - key = k_spin_lock(&uds_ctx->ep_event_lock); - node = sys_slist_get(&uds_ctx->ep_events); - k_spin_unlock(&uds_ctx->ep_event_lock, key); - - buf = SYS_SLIST_CONTAINER(node, buf, node); - if (buf == NULL) { - break; - } + bi = udc_get_buf_info(event->buf); - bi = udc_get_buf_info(buf); - if (USB_EP_GET_IDX(bi->ep) == 0) { - ret = usbd_handle_ctrl_xfer(uds_ctx, buf, bi->err); - } else { - ret = usbd_class_handle_xfer(uds_ctx, buf, bi->err); - } + if (USB_EP_GET_IDX(bi->ep) == 0) { + ret = usbd_handle_ctrl_xfer(uds_ctx, event->buf, bi->err); + } else { + ret = usbd_class_handle_xfer(uds_ctx, event->buf, bi->err); + } - if (ret) { - LOG_ERR("Unrecoverable error %d, ep 0x%02x, buf %p", - ret, bi->ep, (void *)buf); - usbd_msg_pub_simple(uds_ctx, USBD_MSG_STACK_ERROR, ret); - } + if (ret) { + LOG_ERR("unrecoverable error %d, ep 0x%02x, buf %p", + ret, bi->ep, event->buf); } + + return ret; } static void usbd_class_bcast_event(struct usbd_context *const uds_ctx, @@ -162,13 +138,6 @@ static ALWAYS_INLINE void usbd_event_handler(struct usbd_context *const uds_ctx, { int err = 0; - /* Always check if there is a completed transfer request. */ - event_handler_ep_request(uds_ctx); - if (event->type == UDC_EVT_EP_REQUEST) { - /* It has already been handled and cannot be another event type. */ - return; - } - switch (event->type) { case UDC_EVT_VBUS_REMOVED: LOG_DBG("VBUS remove event"); @@ -198,6 +167,9 @@ static ALWAYS_INLINE void usbd_event_handler(struct usbd_context *const uds_ctx, err = event_handler_bus_reset(uds_ctx); usbd_msg_pub_simple(uds_ctx, USBD_MSG_RESET, 0); break; + case UDC_EVT_EP_REQUEST: + err = event_handler_ep_request(uds_ctx, event); + break; case UDC_EVT_ERROR: LOG_ERR("UDC error event"); usbd_msg_pub_simple(uds_ctx, USBD_MSG_UDC_ERROR, event->status); From f290ddd3928627a4ac30df399f6d854e84cbf1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0943/3334] Revert "[nrf fromtree] nordic: update and align to nrfx 4.0.1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 428ce9f27bc368f8023de98cdd494b060374962b. Signed-off-by: Tomasz Moń --- boards/native/nrf_bsim/CMakeLists.txt | 9 - boards/native/nrf_bsim/common/cmsis/cmsis.h | 2 +- boards/native/nrf_bsim/gpiote_nrfx_bsim.c | 39 - boards/native/nrf_bsim/soc/soc_secure.h | 2 +- drivers/adc/adc_nrfx_adc.c | 6 +- drivers/adc/adc_nrfx_saadc.c | 283 +++-- drivers/audio/Kconfig.dmic_pdm_nrfx | 4 +- drivers/audio/dmic_nrfx_pdm.c | 397 +++++-- drivers/clock_control/clock_control_nrf.c | 9 +- drivers/comparator/comparator_nrf_common.h | 53 + drivers/comparator/comparator_nrf_comp.c | 281 ++++- drivers/comparator/comparator_nrf_lpcomp.c | 130 ++- drivers/counter/Kconfig.nrfx | 3 +- drivers/counter/counter_nrfx_rtc.c | 60 +- drivers/display/Kconfig.nrf_led_matrix | 2 +- drivers/display/display_nrf_led_matrix.c | 48 +- drivers/entropy/entropy_nrf_cracen.c | 14 +- drivers/flash/nrf_qspi_nor.c | 125 ++- drivers/flash/soc_flash_nrf.c | 5 +- drivers/flash/soc_flash_nrf_mramc.c | 8 +- drivers/gpio/gpio_nrfx.c | 134 +-- drivers/i2c/Kconfig.nrfx | 38 +- drivers/i2c/i2c_nrfx_twi.c | 87 +- drivers/i2c/i2c_nrfx_twi_common.c | 25 +- drivers/i2c/i2c_nrfx_twim.c | 199 ++-- drivers/i2c/i2c_nrfx_twim_common.c | 44 +- drivers/i2c/i2c_nrfx_twim_common.h | 17 +- drivers/i2c/i2c_nrfx_twim_rtio.c | 141 ++- drivers/i2c/i2c_nrfx_twis.c | 221 ++-- drivers/i2s/Kconfig.nrfx | 3 +- drivers/i2s/i2s_nrfx.c | 332 ++++-- drivers/mspi/mspi_dw_vendor_specific.h | 2 +- drivers/pwm/Kconfig.nrfx | 13 +- drivers/pwm/pwm_nrf_sw.c | 69 +- drivers/pwm/pwm_nrfx.c | 210 ++-- drivers/sensor/nordic/qdec_nrfx/Kconfig | 7 +- drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c | 144 +-- drivers/serial/Kconfig.nrfx | 30 +- drivers/serial/uart_nrfx_uarte.c | 75 +- drivers/spi/Kconfig.nrfx | 64 +- drivers/spi/spi_nrfx_common.c | 14 +- drivers/spi/spi_nrfx_common.h | 16 +- drivers/spi/spi_nrfx_spi.c | 19 +- drivers/spi/spi_nrfx_spim.c | 292 ++++-- drivers/spi/spi_nrfx_spis.c | 127 ++- drivers/timer/Kconfig.nrf_rtc | 2 +- drivers/timer/nrf_grtc_timer.c | 75 +- drivers/timer/nrf_rtc_timer.c | 15 +- .../nrf_usbd_common/nrf_usbd_common_errata.h | 1 + drivers/usb/udc/udc_dwc2_vendor_quirks.h | 2 +- drivers/watchdog/Kconfig.nrfx | 10 +- drivers/watchdog/wdt_nrfx.c | 147 ++- dts/arm/nordic/nrf52805.dtsi | 2 +- dts/arm/nordic/nrf52810.dtsi | 8 +- dts/arm/nordic/nrf52811.dtsi | 2 +- dts/arm/nordic/nrf52832.dtsi | 8 +- dts/arm/nordic/nrf52833.dtsi | 2 +- dts/arm/nordic/nrf52840.dtsi | 8 +- dts/arm/nordic/nrf5340_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf5340_cpuappns.dtsi | 2 +- dts/arm/nordic/nrf91.dtsi | 2 +- dts/arm/nordic/nrf91ns.dtsi | 2 +- dts/bindings/spi/nordic,nrf-spim.yaml | 7 + dts/vendor/nordic/nrf54h20.dtsi | 2 +- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 3 +- dts/vendor/nordic/nrf54lm20a.dtsi | 5 +- dts/vendor/nordic/nrf9280.dtsi | 2 +- include/zephyr/drivers/gpio/gpio_nrf.h | 27 - .../dt-bindings/adc/nrf-saadc-haltium.h | 19 + .../zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h | 15 + include/zephyr/dt-bindings/adc/nrf-saadc-v2.h | 14 + include/zephyr/dt-bindings/adc/nrf-saadc-v3.h | 14 + include/zephyr/dt-bindings/adc/nrf-saadc.h | 41 +- .../zephyr/dt-bindings/comparator/nrf-comp.h | 6 +- .../platform/nrf_802154_clock_zephyr.c | 2 +- modules/hal_nordic/nrfx/CMakeLists.txt | 49 +- modules/hal_nordic/nrfx/Kconfig | 968 +++++++++++++++++- modules/hal_nordic/nrfx/Kconfig.logging | 12 + modules/hal_nordic/nrfx/nrfx_config.h | 84 +- modules/hal_nordic/nrfx/nrfx_glue.c | 40 +- modules/hal_nordic/nrfx/nrfx_kconfig.h | 585 ++++++++++- modules/hal_nordic/nrfx/nrfx_log.h | 2 +- modules/nrf_wifi/bus/qspi_if.c | 93 +- .../nordic/include/tfm_read_ranges.h | 2 +- samples/boards/nordic/nrfx/src/main.c | 59 +- samples/boards/nordic/nrfx_prs/prj.conf | 4 +- samples/boards/nordic/nrfx_prs/src/main.c | 41 +- .../led_strip/boards/nrf52dk_nrf52832.conf | 3 + samples/net/zperf/src/nrf5340_cpu_boost.c | 1 + .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 2 +- .../uac2_explicit_feedback/src/feedback_nrf.c | 91 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 2 +- .../uac2_implicit_feedback/src/feedback_nrf.c | 47 +- scripts/ci/check_compliance.py | 1 - soc/nordic/CMakeLists.txt | 5 +- soc/nordic/Kconfig | 8 - soc/nordic/common/CMakeLists.txt | 5 - soc/nordic/common/Kconfig.peripherals | 339 ++++++ soc/nordic/common/gpiote_nrfx.c | 18 - soc/nordic/common/gpiote_nrfx.h | 22 - soc/nordic/common/gppi_init.c | 59 -- soc/nordic/common/nrf_sys_event.c | 12 +- soc/nordic/common/soc_nrf_common.h | 16 +- soc/nordic/common/soc_secure.c | 2 + soc/nordic/common/soc_secure.h | 2 +- .../ironside/include/nrf_ironside/cpuconf.h | 2 +- soc/nordic/nrf51/soc.c | 2 +- soc/nordic/nrf52/CMakeLists.txt | 4 + soc/nordic/nrf52/Kconfig | 10 +- soc/nordic/nrf52/soc.c | 2 +- soc/nordic/nrf53/soc.c | 41 +- soc/nordic/nrf53/sync_rtc.c | 46 +- soc/nordic/nrf54h/bicr/CMakeLists.txt | 2 +- soc/nordic/nrf54h/soc.c | 2 +- soc/nordic/nrf54l/soc.c | 4 +- soc/nordic/nrf91/soc.c | 2 +- soc/nordic/nrf92/soc.c | 2 +- soc/nordic/validate_binding_headers.c | 2 +- subsys/bluetooth/audio/shell/bap_usb.c | 1 + .../ll_sw/nordic/hal/nrf5/radio/radio.c | 29 +- .../nordic/hal/nrf5/radio/radio_nrf52810.h | 2 +- .../nordic/hal/nrf5/radio/radio_nrf52832.h | 2 +- .../nordic/hal/nrf5/radio/radio_nrf52840.h | 2 +- .../hal/nrf5/radio/radio_nrf5_dppi_gpiote.h | 8 +- .../hal/nrf5/radio/radio_nrf5_ppi_gpiote.h | 8 +- .../boards/bl54l15_dvk_nrf54l15_cpuapp.conf | 5 + .../boards/bl54l15u_dvk_nrf54l15_cpuapp.conf | 5 + .../i2c_slave/boards/nrf52840dk_nrf52840.conf | 1 + .../boards/nrf5340dk_nrf5340_cpuapp.conf | 1 + .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 + .../boards/nrf54h20dk_nrf54h20_cpuppr.conf | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 1 + .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 + .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 + tests/boards/nrf/i2c/i2c_slave/prj.conf | 1 - tests/boards/nrf/i2c/i2c_slave/src/main.c | 28 +- tests/drivers/timer/nrf_grtc_timer/src/main.c | 4 - .../uart/uart_mix_fifo_poll/testcase.yaml | 2 +- tests/drivers/uart/uart_pm/testcase.yaml | 4 +- .../boards/nrf52840dk_nrf52840_counter.conf | 1 + west.yml | 8 +- 143 files changed, 5255 insertions(+), 1811 deletions(-) delete mode 100644 boards/native/nrf_bsim/gpiote_nrfx_bsim.c create mode 100644 drivers/comparator/comparator_nrf_common.h delete mode 100644 include/zephyr/drivers/gpio/gpio_nrf.h create mode 100644 include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h create mode 100644 include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h create mode 100644 include/zephyr/dt-bindings/adc/nrf-saadc-v2.h create mode 100644 include/zephyr/dt-bindings/adc/nrf-saadc-v3.h create mode 100644 samples/drivers/led/led_strip/boards/nrf52dk_nrf52832.conf delete mode 100644 soc/nordic/common/gpiote_nrfx.c delete mode 100644 soc/nordic/common/gpiote_nrfx.h delete mode 100644 soc/nordic/common/gppi_init.c create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/bl54l15_dvk_nrf54l15_cpuapp.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/bl54l15u_dvk_nrf54l15_cpuapp.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf diff --git a/boards/native/nrf_bsim/CMakeLists.txt b/boards/native/nrf_bsim/CMakeLists.txt index f96acc58fe46..a457bd3126d6 100644 --- a/boards/native/nrf_bsim/CMakeLists.txt +++ b/boards/native/nrf_bsim/CMakeLists.txt @@ -25,21 +25,12 @@ zephyr_library_sources( argparse.c nsi_if.c native_remap.c - gpiote_nrfx_bsim.c soc/nrfx_coredep.c common/bstests_entry.c common/cmsis/cmsis.c common/trace_hook.c ) -# Include GPIOTE nrfx from real SOC code -zephyr_library_sources(${ZEPHYR_BASE}/soc/nordic/common/gpiote_nrfx.c) - -# Include gppi_init from real SOC code if enabled -if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) - zephyr_library_sources(${ZEPHYR_BASE}/soc/nordic/common/gppi_init.c) -endif() - # Include sync_rtc from real SOC code if enabled zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC ${ZEPHYR_BASE}/soc/nordic/nrf53/sync_rtc.c diff --git a/boards/native/nrf_bsim/common/cmsis/cmsis.h b/boards/native/nrf_bsim/common/cmsis/cmsis.h index 25a9fe4d6578..2afc6e9ae50f 100644 --- a/boards/native/nrf_bsim/common/cmsis/cmsis.h +++ b/boards/native/nrf_bsim/common/cmsis/cmsis.h @@ -15,7 +15,7 @@ #include #include "cmsis_instr.h" #if defined(CONFIG_SOC_COMPATIBLE_NRF52833) -#include "mdk/nrf52833.h" +#include "nrf52833.h" #endif #ifdef __cplusplus diff --git a/boards/native/nrf_bsim/gpiote_nrfx_bsim.c b/boards/native/nrf_bsim/gpiote_nrfx_bsim.c deleted file mode 100644 index d595cc3d117b..000000000000 --- a/boards/native/nrf_bsim/gpiote_nrfx_bsim.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include "gpiote_nrfx.h" - -#define GPIOTE_NRFX_INST_IDX(idx) DT_CAT3(NRFX_GPIOTE, idx, _INST_IDX) -#define GPIOTE_INST_IDX(node_id) GPIOTE_NRFX_INST_IDX(DT_PROP(node_id, instance)) -#define GPIOTE_INST_AND_COMMA(node_id) \ - [GPIOTE_INST_IDX(node_id)] = &GPIOTE_NRFX_INST_BY_NODE(node_id), - -/* Conversion of hardcoded DT addresses into the correct ones for simulation - * is done here rather than within `gpio` driver implementation because `gpio` driver - * operates on GPIO ports instances, which might or might not be associated - * with a GPIOTE instance. Additionally, single GPIOTE instance might be associated - * with multiple GPIO ports instances. This makes iterating over all enabled GPIOTE instances - * problematic in the `gpio` driver initialization function context. - */ -static int gpiote_bsim_init(void) -{ - nrfx_gpiote_t *gpiote_instances[] = { - DT_FOREACH_STATUS_OKAY(nordic_nrf_gpiote, GPIOTE_INST_AND_COMMA) - }; - - /* For simulated devices we need to convert the hardcoded DT address from the real - * peripheral into the correct one for simulation - */ - for (int inst = 0; inst < ARRAY_SIZE(gpiote_instances); inst++) { - gpiote_instances[inst]->p_reg = - nhw_convert_periph_base_addr(gpiote_instances[inst]->p_reg); - } - - return 0; -} - -SYS_INIT(gpiote_bsim_init, PRE_KERNEL_1, 0); diff --git a/boards/native/nrf_bsim/soc/soc_secure.h b/boards/native/nrf_bsim/soc/soc_secure.h index e2be9dc0603c..06e9cc64993c 100644 --- a/boards/native/nrf_bsim/soc/soc_secure.h +++ b/boards/native/nrf_bsim/soc/soc_secure.h @@ -12,7 +12,7 @@ #include -#include +#include #include static inline void soc_secure_read_deviceid(uint32_t deviceid[2]) diff --git a/drivers/adc/adc_nrfx_adc.c b/drivers/adc/adc_nrfx_adc.c index ef5aed898964..85b0940be515 100644 --- a/drivers/adc/adc_nrfx_adc.c +++ b/drivers/adc/adc_nrfx_adc.c @@ -265,12 +265,12 @@ static int init_adc(const struct device *dev) { const nrfx_adc_config_t config = NRFX_ADC_DEFAULT_CONFIG; - int result = nrfx_adc_init(&config, event_handler); + nrfx_err_t result = nrfx_adc_init(&config, event_handler); - if (result != 0) { + if (result != NRFX_SUCCESS) { LOG_ERR("Failed to initialize device: %s", dev->name); - return result; + return -EBUSY; } IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index f54fd0a1aee8..32be9825d243 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -6,7 +6,9 @@ #include "adc_context.h" #include -#include +#include +#include +#include #include #include #include @@ -20,22 +22,91 @@ LOG_MODULE_REGISTER(adc_nrfx_saadc, CONFIG_ADC_LOG_LEVEL); #define DT_DRV_COMPAT nordic_nrf_saadc -BUILD_ASSERT((NRF_SAADC_AIN0 == NRFX_ANALOG_EXTERNAL_AIN0) && - (NRF_SAADC_AIN1 == NRFX_ANALOG_EXTERNAL_AIN1) && - (NRF_SAADC_AIN2 == NRFX_ANALOG_EXTERNAL_AIN2) && - (NRF_SAADC_AIN3 == NRFX_ANALOG_EXTERNAL_AIN3) && - (NRF_SAADC_AIN4 == NRFX_ANALOG_EXTERNAL_AIN4) && - (NRF_SAADC_AIN5 == NRFX_ANALOG_EXTERNAL_AIN5) && - (NRF_SAADC_AIN6 == NRFX_ANALOG_EXTERNAL_AIN6) && - (NRF_SAADC_AIN7 == NRFX_ANALOG_EXTERNAL_AIN7) && -#if NRF_SAADC_HAS_INPUT_VDDHDIV5 - (NRF_SAADC_VDDHDIV5 == NRFX_ANALOG_INTERNAL_VDDHDIV5) && +#if (NRF_SAADC_HAS_AIN_AS_PIN) + +#if defined(CONFIG_NRF_PLATFORM_HALTIUM) +static const uint32_t saadc_psels[NRF_SAADC_AIN13 + 1] = { + [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), + [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), + [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), + [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), + [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), + [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + [NRF_SAADC_AIN8] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 9), + [NRF_SAADC_AIN9] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 9), + [NRF_SAADC_AIN10] = NRF_PIN_PORT_TO_PIN_NUMBER(2U, 9), + [NRF_SAADC_AIN11] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 9), + [NRF_SAADC_AIN12] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 9), + [NRF_SAADC_AIN13] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 9), +}; +#elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15) +static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { + [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), + [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), + [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), + [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), + [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), + [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), + [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, + [NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD, + [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, +}; +#elif defined(NRF54LM20A_ENGA_XXAA) +static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = { + [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), + [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), + [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), + [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1), + [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), + [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), + [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, + [NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD, + [NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD, +}; +#elif defined(NRF54LV10A_ENGA_XXAA) +static const uint32_t saadc_psels[NRF_SAADC_AIN7 + 1] = { + [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), + [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), + [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), + [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + [NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + [NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(10U, 1), + [NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), + [NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), +}; +#elif defined(NRF54LS05B_ENGA_XXAA) +static const uint32_t saadc_psels[NRF_SAADC_AIN3 + 1] = { + [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), + [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + [NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), + [NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), +}; +#endif + +#else +BUILD_ASSERT((NRF_SAADC_AIN0 == NRF_SAADC_INPUT_AIN0) && + (NRF_SAADC_AIN1 == NRF_SAADC_INPUT_AIN1) && + (NRF_SAADC_AIN2 == NRF_SAADC_INPUT_AIN2) && + (NRF_SAADC_AIN3 == NRF_SAADC_INPUT_AIN3) && + (NRF_SAADC_AIN4 == NRF_SAADC_INPUT_AIN4) && + (NRF_SAADC_AIN5 == NRF_SAADC_INPUT_AIN5) && + (NRF_SAADC_AIN6 == NRF_SAADC_INPUT_AIN6) && + (NRF_SAADC_AIN7 == NRF_SAADC_INPUT_AIN7) && +#if defined(SAADC_CH_PSELP_PSELP_VDDHDIV5) + (NRF_SAADC_VDDHDIV5 == NRF_SAADC_INPUT_VDDHDIV5) && #endif -#if NRF_SAADC_HAS_INPUT_VDD - (NRF_SAADC_VDD == NRFX_ANALOG_INTERNAL_VDD) && +#if defined(SAADC_CH_PSELP_PSELP_VDD) + (NRF_SAADC_VDD == NRF_SAADC_INPUT_VDD) && #endif 1, - "Definitions from nrf-saadc.h do not match those from nrfx_analog_common.h"); + "Definitions from nrf-adc.h do not match those from nrf_saadc.h"); +#endif struct driver_data { struct adc_context ctx; @@ -117,46 +188,96 @@ static int acq_time_set(nrf_saadc_channel_config_t *ch_cfg, uint16_t acquisition return 0; } +static int input_assign(nrf_saadc_input_t *pin_p, + nrf_saadc_input_t *pin_n, + const struct adc_channel_cfg *channel_cfg) +{ +#if (NRF_SAADC_HAS_AIN_AS_PIN) + if (channel_cfg->input_positive > ARRAY_SIZE(saadc_psels) || + channel_cfg->input_positive < NRF_SAADC_AIN0) { + LOG_ERR("Invalid analog positive input number: %d", channel_cfg->input_positive); + return -EINVAL; + } + + *pin_p = saadc_psels[channel_cfg->input_positive]; + +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + nrf_gpio_pin_retain_disable(saadc_psels[channel_cfg->input_positive]); +#endif + + if (channel_cfg->differential) { + if (channel_cfg->input_negative > ARRAY_SIZE(saadc_psels) || + (IS_ENABLED(CONFIG_NRF_PLATFORM_HALTIUM) && + (channel_cfg->input_positive > NRF_SAADC_AIN7) != + (channel_cfg->input_negative > NRF_SAADC_AIN7))) { + LOG_ERR("Invalid analog negative input number: %d", + channel_cfg->input_negative); + return -EINVAL; + } + *pin_n = channel_cfg->input_negative == NRF_SAADC_GND ? + NRF_SAADC_INPUT_DISABLED : + saadc_psels[channel_cfg->input_negative]; + +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + if (channel_cfg->input_negative != NRF_SAADC_GND) { + nrf_gpio_pin_retain_disable(saadc_psels[channel_cfg->input_negative]); + } +#endif + } else { + *pin_n = NRF_SAADC_INPUT_DISABLED; + } +#else + *pin_p = channel_cfg->input_positive; + *pin_n = (channel_cfg->differential && (channel_cfg->input_negative != NRF_SAADC_GND)) + ? channel_cfg->input_negative + : NRF_SAADC_INPUT_DISABLED; +#endif + LOG_DBG("ADC positive input: %d", *pin_p); + LOG_DBG("ADC negative input: %d", *pin_n); + + return 0; +} + static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) { #if NRF_SAADC_HAS_CH_GAIN switch (gain) { -#if NRF_SAADC_HAS_GAIN_1_6 +#if defined(SAADC_CH_CONFIG_GAIN_Gain1_6) case ADC_GAIN_1_6: ch_cfg->gain = NRF_SAADC_GAIN1_6; break; #endif -#if NRF_SAADC_HAS_GAIN_1_5 +#if defined(SAADC_CH_CONFIG_GAIN_Gain1_5) case ADC_GAIN_1_5: ch_cfg->gain = NRF_SAADC_GAIN1_5; break; #endif -#if NRF_SAADC_HAS_GAIN_1_4 +#if defined(SAADC_CH_CONFIG_GAIN_Gain1_4) || defined(SAADC_CH_CONFIG_GAIN_Gain2_8) case ADC_GAIN_1_4: ch_cfg->gain = NRF_SAADC_GAIN1_4; break; #endif -#if NRF_SAADC_HAS_GAIN_2_7 +#if defined(SAADC_CH_CONFIG_GAIN_Gain2_7) case ADC_GAIN_2_7: ch_cfg->gain = NRF_SAADC_GAIN2_7; break; #endif -#if NRF_SAADC_HAS_GAIN_1_3 +#if defined(SAADC_CH_CONFIG_GAIN_Gain1_3) || defined(SAADC_CH_CONFIG_GAIN_Gain2_6) case ADC_GAIN_1_3: ch_cfg->gain = NRF_SAADC_GAIN1_3; break; #endif -#if NRF_SAADC_HAS_GAIN_2_5 +#if defined(SAADC_CH_CONFIG_GAIN_Gain2_5) case ADC_GAIN_2_5: ch_cfg->gain = NRF_SAADC_GAIN2_5; break; #endif -#if NRF_SAADC_HAS_GAIN_1_2 +#if defined(SAADC_CH_CONFIG_GAIN_Gain1_2) || defined(SAADC_CH_CONFIG_GAIN_Gain2_4) case ADC_GAIN_1_2: ch_cfg->gain = NRF_SAADC_GAIN1_2; break; #endif -#if NRF_SAADC_HAS_GAIN_2_3 +#if defined(SAADC_CH_CONFIG_GAIN_Gain2_3) case ADC_GAIN_2_3: ch_cfg->gain = NRF_SAADC_GAIN2_3; break; @@ -167,7 +288,7 @@ static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) case ADC_GAIN_2: ch_cfg->gain = NRF_SAADC_GAIN2; break; -#if NRF_SAADC_HAS_GAIN_4 +#if defined(SAADC_CH_CONFIG_GAIN_Gain4) case ADC_GAIN_4: ch_cfg->gain = NRF_SAADC_GAIN4; break; @@ -175,7 +296,7 @@ static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) default: #else if (gain != ADC_GAIN_1) { -#endif /* NRF_SAADC_HAS_CH_GAIN */ +#endif /* defined(NRF_SAADC_HAS_CH_GAIN) */ LOG_ERR("Selected ADC gain is not valid"); return -EINVAL; } @@ -186,17 +307,17 @@ static int gain_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_gain gain) static int reference_set(nrf_saadc_channel_config_t *ch_cfg, enum adc_reference reference) { switch (reference) { -#if NRF_SAADC_HAS_REFERENCE_INTERNAL +#if defined(SAADC_CH_CONFIG_REFSEL_Internal) case ADC_REF_INTERNAL: ch_cfg->reference = NRF_SAADC_REFERENCE_INTERNAL; break; #endif -#if NRF_SAADC_HAS_REFERENCE_VDD4 +#if defined(SAADC_CH_CONFIG_REFSEL_VDD1_4) case ADC_REF_VDD_1_4: ch_cfg->reference = NRF_SAADC_REFERENCE_VDD4; break; #endif -#if NRF_SAADC_HAS_REFERENCE_EXTERNAL +#if defined(SAADC_CH_CONFIG_REFSEL_External) case ADC_REF_EXTERNAL0: ch_cfg->reference = NRF_SAADC_REFERENCE_EXTERNAL; break; @@ -226,11 +347,6 @@ static int adc_nrfx_channel_setup(const struct device *dev, #endif }, .channel_index = channel_cfg->channel_id, - .pin_p = channel_cfg->input_positive, - .pin_n = (channel_cfg->differential && - (channel_cfg->input_negative != NRF_SAADC_GND)) - ? channel_cfg->input_negative - : NRF_SAADC_AIN_DISABLED, }; if (channel_cfg->channel_id >= SAADC_CH_NUM) { @@ -240,6 +356,11 @@ static int adc_nrfx_channel_setup(const struct device *dev, ch_cfg = &cfg.channel_config; + err = input_assign(&cfg.pin_p, &cfg.pin_n, channel_cfg); + if (err != 0) { + return err; + } + err = gain_set(ch_cfg, channel_cfg->gain); if (err != 0) { return err; @@ -273,11 +394,11 @@ static int adc_nrfx_channel_setup(const struct device *dev, m_data.divide_single_ended_value &= ~BIT(channel_cfg->channel_id); } - err = nrfx_saadc_channel_config(&cfg); + nrfx_err_t ret = nrfx_saadc_channel_config(&cfg); - if (err != 0) { - LOG_ERR("Cannot configure channel %d: %d", channel_cfg->channel_id, err); - return err; + if (ret != NRFX_SUCCESS) { + LOG_ERR("Cannot configure channel %d: 0x%08x", channel_cfg->channel_id, ret); + return -EINVAL; } return 0; @@ -288,10 +409,10 @@ static void adc_context_start_sampling(struct adc_context *ctx) if (ctx->sequence.calibrate) { nrfx_saadc_offset_calibrate(event_handler); } else { - int ret = nrfx_saadc_mode_trigger(); + nrfx_err_t ret = nrfx_saadc_mode_trigger(); - if (ret != 0) { - LOG_ERR("Cannot start sampling: %d", ret); + if (ret != NRFX_SUCCESS) { + LOG_ERR("Cannot start sampling: 0x%08x", ret); adc_context_complete(ctx, -EIO); } } @@ -316,9 +437,10 @@ static void adc_context_update_buffer_pointer(struct adc_context *ctx, bool repe return; } - error = nrfx_saadc_buffer_set(samples_buffer, m_data.active_channel_cnt); - if (error != 0) { - LOG_ERR("Failed to set buffer: %d", error); + nrfx_err_t nrfx_err = + nrfx_saadc_buffer_set(samples_buffer, m_data.active_channel_cnt); + if (nrfx_err != NRFX_SUCCESS) { + LOG_ERR("Failed to set buffer: 0x%08x", nrfx_err); adc_context_complete(ctx, -EIO); } } @@ -329,10 +451,10 @@ static inline void adc_context_enable_timer(struct adc_context *ctx) if (!m_data.internal_timer_enabled) { k_timer_start(&m_data.timer, K_NO_WAIT, K_USEC(ctx->options.interval_us)); } else { - int ret = nrfx_saadc_mode_trigger(); + nrfx_err_t ret = nrfx_saadc_mode_trigger(); - if (ret != 0) { - LOG_ERR("Cannot start sampling: %d", ret); + if (ret != NRFX_SUCCESS) { + LOG_ERR("Cannot start sampling: 0x%08x", ret); adc_context_complete(&m_data.ctx, -EIO); } } @@ -502,6 +624,7 @@ static inline uint16_t interval_to_cc(uint16_t interval_us) static int start_read(const struct device *dev, const struct adc_sequence *sequence) { + nrfx_err_t nrfx_err; int error; uint32_t selected_channels = sequence->channels; nrf_saadc_resolution_t resolution; @@ -559,21 +682,21 @@ static int start_read(const struct device *dev, m_data.internal_timer_enabled = true; - error = nrfx_saadc_advanced_mode_set(selected_channels, resolution, &adv_config, - event_handler); + nrfx_err = nrfx_saadc_advanced_mode_set(selected_channels, resolution, &adv_config, + event_handler); } else { m_data.internal_timer_enabled = false; - error = nrfx_saadc_simple_mode_set(selected_channels, resolution, oversampling, - event_handler); + nrfx_err = nrfx_saadc_simple_mode_set(selected_channels, resolution, oversampling, + event_handler); } - if (error != 0) { - return error; + if (nrfx_err != NRFX_SUCCESS) { + return -EINVAL; } error = check_buffer_size(sequence, active_channel_cnt); - if (error != 0) { + if (error) { return error; } @@ -594,13 +717,14 @@ static int start_read(const struct device *dev, /* Buffer is filled in chunks, each chunk composed of number of samples equal to number * of active channels. Buffer pointer is advanced and reloaded after each chunk. */ - error = nrfx_saadc_buffer_set(samples_buffer, - (m_data.internal_timer_enabled - ? (1 + sequence->options->extra_samplings) - : active_channel_cnt)); - if (error != 0) { - LOG_ERR("Failed to set buffer: %d", error); - return error; + nrfx_err = nrfx_saadc_buffer_set( + samples_buffer, + (m_data.internal_timer_enabled + ? (1 + sequence->options->extra_samplings) + : active_channel_cnt)); + if (nrfx_err != NRFX_SUCCESS) { + LOG_ERR("Failed to set buffer: 0x%08x", nrfx_err); + return -EINVAL; } adc_context_start_read(&m_data.ctx, sequence); @@ -648,7 +772,7 @@ static int adc_nrfx_read_async(const struct device *dev, static void event_handler(const nrfx_saadc_evt_t *event) { - int err; + nrfx_err_t err; if (event->type == NRFX_SAADC_EVT_DONE) { dmm_buffer_in_release( @@ -667,8 +791,8 @@ static void event_handler(const nrfx_saadc_evt_t *event) adc_context_on_sampling_done(&m_data.ctx, DEVICE_DT_INST_GET(0)); } else if (event->type == NRFX_SAADC_EVT_CALIBRATEDONE) { err = nrfx_saadc_mode_trigger(); - if (err != 0) { - LOG_ERR("Cannot start sampling: %d", err); + if (err != NRFX_SUCCESS) { + LOG_ERR("Cannot start sampling: 0x%08x", err); adc_context_complete(&m_data.ctx, -EIO); } } else if (event->type == NRFX_SAADC_EVT_FINISHED) { @@ -685,13 +809,13 @@ static int saadc_pm_handler(const struct device *dev, enum pm_device_action acti static int init_saadc(const struct device *dev) { - int err; + nrfx_err_t err; k_timer_init(&m_data.timer, external_timer_expired_handler, NULL); /* The priority value passed here is ignored (see nrfx_glue.h). */ err = nrfx_saadc_init(0); - if (err != 0) { + if (err != NRFX_SUCCESS) { LOG_ERR("Failed to initialize device: %s", dev->name); return -EIO; } @@ -709,9 +833,38 @@ static DEVICE_API(adc, adc_nrfx_driver_api) = { #ifdef CONFIG_ADC_ASYNC .read_async = adc_nrfx_read_async, #endif - .ref_internal = NRFX_SAADC_REF_INTERNAL_VALUE, +#if defined(NRF54LV10A_ENGA_XXAA) + .ref_internal = 1300, +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + .ref_internal = 900, +#elif defined(CONFIG_NRF_PLATFORM_HALTIUM) + .ref_internal = 1024, +#else + .ref_internal = 600, +#endif }; +#if defined(CONFIG_NRF_PLATFORM_HALTIUM) +/* AIN8-AIN14 inputs are on 3v3 GPIO port and they cannot be mixed with other + * analog inputs (from 1v8 ports) in differential mode. + */ +#define CH_IS_3V3(val) (val >= NRF_SAADC_AIN8) + +#define MIXED_3V3_1V8_INPUTS(node) \ + (DT_NODE_HAS_PROP(node, zephyr_input_negative) && \ + (CH_IS_3V3(DT_PROP_OR(node, zephyr_input_negative, 0)) != \ + CH_IS_3V3(DT_PROP_OR(node, zephyr_input_positive, 0)))) +#else +#define MIXED_3V3_1V8_INPUTS(node) false +#endif + +#define VALIDATE_CHANNEL_CONFIG(node) \ + BUILD_ASSERT(MIXED_3V3_1V8_INPUTS(node) == false, \ + "1v8 inputs cannot be mixed with 3v3 inputs"); + +/* Validate configuration of all channels. */ +DT_FOREACH_CHILD(DT_DRV_INST(0), VALIDATE_CHANNEL_CONFIG) + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(0)); PM_DEVICE_DT_INST_DEFINE(0, saadc_pm_handler); diff --git a/drivers/audio/Kconfig.dmic_pdm_nrfx b/drivers/audio/Kconfig.dmic_pdm_nrfx index 9f45144effa9..51a56bebb54d 100644 --- a/drivers/audio/Kconfig.dmic_pdm_nrfx +++ b/drivers/audio/Kconfig.dmic_pdm_nrfx @@ -5,7 +5,9 @@ config AUDIO_DMIC_NRFX_PDM bool "nRF PDM nrfx driver" default y depends on DT_HAS_NORDIC_NRF_PDM_ENABLED - select NRFX_PDM + select NRFX_PDM0 if HAS_HW_NRF_PDM0 + select NRFX_PDM20 if HAS_HW_NRF_PDM20 + select NRFX_PDM21 if HAS_HW_NRF_PDM21 select PINCTRL help Enable support for nrfx PDM driver for nRF MCU series. diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index b3fc87404f82..a2d630f847a9 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT nordic_nrf_pdm - #include #include #include @@ -23,6 +21,7 @@ LOG_MODULE_REGISTER(dmic_nrfx_pdm, CONFIG_AUDIO_DMIC_LOG_LEVEL); #if CONFIG_SOC_SERIES_NRF54HX #define DMIC_NRFX_CLOCK_FREQ MHZ(16) +#define DMIC_NRFX_CLOCK_FACTOR 8192 #define DMIC_NRFX_AUDIO_CLOCK_FREQ DT_PROP_OR(NODE_AUDIOPLL, frequency, 0) #elif DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) #define AUXPLL_FREQUENCY_SETTING DT_PROP(NODE_AUDIO_AUXPLL, nordic_frequency) @@ -36,12 +35,13 @@ BUILD_ASSERT((AUXPLL_FREQUENCY_SETTING == NRF_AUXPLL_FREQ_DIV_AUDIO_48K) || #else #define DMIC_NRFX_CLOCK_FREQ MHZ(32) +#define DMIC_NRFX_CLOCK_FACTOR 4096 #define DMIC_NRFX_AUDIO_CLOCK_FREQ DT_PROP_OR(DT_NODELABEL(aclk), clock_frequency, \ DT_PROP_OR(DT_NODELABEL(clock), hfclkaudio_frequency, 0)) #endif struct dmic_nrfx_pdm_drv_data { - nrfx_pdm_t pdm; + const nrfx_pdm_t *pdm; #if CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL || DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) const struct device *audiopll_dev; #elif CONFIG_CLOCK_CONTROL_NRF @@ -79,7 +79,7 @@ static void free_buffer(struct dmic_nrfx_pdm_drv_data *drv_data, void *buffer) static void stop_pdm(struct dmic_nrfx_pdm_drv_data *drv_data) { drv_data->stopping = true; - nrfx_pdm_stop(&drv_data->pdm); + nrfx_pdm_stop(drv_data->pdm); } static int request_clock(struct dmic_nrfx_pdm_drv_data *drv_data) @@ -120,7 +120,7 @@ static void event_handler(const struct device *dev, const nrfx_pdm_evt_t *evt) if (evt->buffer_requested) { void *buffer; - int err; + nrfx_err_t err; ret = k_mem_slab_alloc(drv_data->mem_slab, &mem_slab_buffer, K_NO_WAIT); if (ret < 0) { @@ -142,9 +142,9 @@ static void event_handler(const struct device *dev, const nrfx_pdm_evt_t *evt) stop_pdm(drv_data); return; } - err = nrfx_pdm_buffer_set(&drv_data->pdm, buffer, drv_data->block_size / 2); - if (err != 0) { - LOG_ERR("Failed to set buffer: %d", err); + err = nrfx_pdm_buffer_set(drv_data->pdm, buffer, drv_data->block_size / 2); + if (err != NRFX_SUCCESS) { + LOG_ERR("Failed to set buffer: 0x%08x", err); stop = true; } } @@ -206,6 +206,220 @@ static void event_handler(const struct device *dev, const nrfx_pdm_evt_t *evt) } } +static bool is_in_freq_range(uint32_t freq, const struct dmic_cfg *pdm_cfg) +{ + return freq >= pdm_cfg->io.min_pdm_clk_freq && freq <= pdm_cfg->io.max_pdm_clk_freq; +} + +static bool is_better(uint32_t freq, + uint8_t ratio, + uint32_t req_rate, + uint32_t *best_diff, + uint32_t *best_rate, + uint32_t *best_freq) +{ + uint32_t act_rate = freq / ratio; + uint32_t diff = act_rate >= req_rate ? (act_rate - req_rate) + : (req_rate - act_rate); + + LOG_DBG("Freq %u, ratio %u, act_rate %u", freq, ratio, act_rate); + + if (diff < *best_diff) { + *best_diff = diff; + *best_rate = act_rate; + *best_freq = freq; + return true; + } + + return false; +} + +static bool check_pdm_frequencies(const struct dmic_nrfx_pdm_drv_cfg *drv_cfg, + nrfx_pdm_config_t *config, + const struct dmic_cfg *pdm_cfg, + uint8_t ratio, + uint32_t *best_diff, + uint32_t *best_rate, + uint32_t *best_freq) +{ + uint32_t req_rate = pdm_cfg->streams[0].pcm_rate; + bool better_found = false; + const uint32_t src_freq = + (NRF_PDM_HAS_SELECTABLE_CLOCK && drv_cfg->clk_src == ACLK) + ? DMIC_NRFX_AUDIO_CLOCK_FREQ + : DMIC_NRFX_CLOCK_FREQ; +#if NRF_PDM_HAS_PRESCALER + uint32_t req_freq = req_rate * ratio; + uint32_t prescaler = src_freq / req_freq; + uint32_t act_freq = src_freq / prescaler; + + if (is_in_freq_range(act_freq, pdm_cfg) && + is_better(act_freq, ratio, req_rate, best_diff, best_rate, best_freq)) { + config->prescaler = prescaler; + + better_found = true; + } + + /* Stop if an exact rate match is found. */ + if (*best_diff == 0) { + return true; + } + + /* Prescaler value is rounded down by default, + * thus value rounded up should be checked as well. + */ + prescaler += 1; + act_freq = src_freq / prescaler; + + if (is_in_freq_range(act_freq, pdm_cfg) && + is_better(act_freq, ratio, req_rate, best_diff, best_rate, best_freq)) { + config->prescaler = prescaler; + + better_found = true; + } +#else + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF53X) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX)) { + uint32_t req_freq = req_rate * ratio; + /* As specified in the nRF5340 PS: + * + * PDMCLKCTRL = 4096 * floor(f_pdm * 1048576 / + * (f_source + f_pdm / 2)) + * f_actual = f_source / floor(1048576 * 4096 / PDMCLKCTRL) + */ + uint32_t clk_factor = (uint32_t)((req_freq * 1048576ULL) / + (src_freq + req_freq / 2)); + uint32_t act_freq = src_freq / (1048576 / clk_factor); + + if (is_in_freq_range(act_freq, pdm_cfg) && + is_better(act_freq, ratio, req_rate, best_diff, best_rate, best_freq)) { + config->clock_freq = clk_factor * DMIC_NRFX_CLOCK_FACTOR; + + better_found = true; + } + } else { /* -> !IS_ENABLED(CONFIG_SOC_SERIES_NRF53X)) */ + static const struct { + uint32_t freq_val; + nrf_pdm_freq_t freq_enum; + } freqs[] = { + { 1000000, NRF_PDM_FREQ_1000K }, + { 1032000, NRF_PDM_FREQ_1032K }, + { 1067000, NRF_PDM_FREQ_1067K }, +#if defined(PDM_PDMCLKCTRL_FREQ_1231K) + { 1231000, NRF_PDM_FREQ_1231K }, +#endif +#if defined(PDM_PDMCLKCTRL_FREQ_1280K) + { 1280000, NRF_PDM_FREQ_1280K }, +#endif +#if defined(PDM_PDMCLKCTRL_FREQ_1333K) + { 1333000, NRF_PDM_FREQ_1333K } +#endif + }; + + for (int i = 0; i < ARRAY_SIZE(freqs); ++i) { + uint32_t freq_val = freqs[i].freq_val; + + if (freq_val < pdm_cfg->io.min_pdm_clk_freq) { + continue; + } + if (freq_val > pdm_cfg->io.max_pdm_clk_freq) { + break; + } + + if (is_better(freq_val, ratio, req_rate, + best_diff, best_rate, best_freq)) { + config->clock_freq = freqs[i].freq_enum; + + /* Stop if an exact rate match is found. */ + if (*best_diff == 0) { + return true; + } + + better_found = true; + } + + /* Since frequencies are in ascending order, stop + * checking next ones for the current ratio after + * resulting PCM rate goes above the one requested. + */ + if ((freq_val / ratio) > req_rate) { + break; + } + } + } +#endif /* NRF_PDM_HAS_PRESCALER */ + + return better_found; +} + +/* Finds clock settings that give the PCM output rate closest to that requested, + * taking into account the hardware limitations. + */ +static bool find_suitable_clock(const struct dmic_nrfx_pdm_drv_cfg *drv_cfg, + nrfx_pdm_config_t *config, + const struct dmic_cfg *pdm_cfg) +{ + uint32_t best_diff = UINT32_MAX; + uint32_t best_rate; + uint32_t best_freq; + +#if NRF_PDM_HAS_RATIO_CONFIG + static const struct { + uint8_t ratio_val; + nrf_pdm_ratio_t ratio_enum; + } ratios[] = { +#if defined(PDM_RATIO_RATIO_Ratio32) + { 32, NRF_PDM_RATIO_32X }, +#endif +#if defined(PDM_RATIO_RATIO_Ratio48) + { 48, NRF_PDM_RATIO_48X }, +#endif +#if defined(PDM_RATIO_RATIO_Ratio50) + { 50, NRF_PDM_RATIO_50X }, +#endif + { 64, NRF_PDM_RATIO_64X }, + { 80, NRF_PDM_RATIO_80X }, +#if defined(PDM_RATIO_RATIO_Ratio96) + { 96, NRF_PDM_RATIO_96X }, +#endif +#if defined(PDM_RATIO_RATIO_Ratio100) + { 100, NRF_PDM_RATIO_100X }, +#endif +#if defined(PDM_RATIO_RATIO_Ratio128) + { 128, NRF_PDM_RATIO_128X } +#endif + }; + + for (int r = 0; best_diff != 0 && r < ARRAY_SIZE(ratios); ++r) { + uint8_t ratio = ratios[r].ratio_val; + + if (check_pdm_frequencies(drv_cfg, config, pdm_cfg, ratio, + &best_diff, &best_rate, &best_freq)) { + config->ratio = ratios[r].ratio_enum; + + /* Look no further if a configuration giving the exact + * PCM rate is found. + */ + if (best_diff == 0) { + break; + } + } + } +#else + uint8_t ratio = 64; + + (void)check_pdm_frequencies(drv_cfg, config, pdm_cfg, ratio, + &best_diff, &best_rate, &best_freq); +#endif + + if (best_diff == UINT32_MAX) { + return false; + } + + LOG_INF("PDM clock frequency: %u, actual PCM rate: %u", + best_freq, best_rate); + return true; +} + static int dmic_nrfx_pdm_configure(const struct device *dev, struct dmic_cfg *config) { @@ -215,7 +429,7 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, struct pcm_stream_cfg *stream = &config->streams[0]; uint32_t def_map, alt_map; nrfx_pdm_config_t nrfx_cfg; - int err; + nrfx_err_t err; if (drv_data->active) { LOG_ERR("Cannot configure device while it is active"); @@ -261,7 +475,7 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, /* If either rate or width is 0, the stream is to be disabled. */ if (stream->pcm_rate == 0 || stream->pcm_width == 0) { if (drv_data->configured) { - nrfx_pdm_uninit(&drv_data->pdm); + nrfx_pdm_uninit(drv_data->pdm); drv_data->configured = false; } @@ -289,28 +503,19 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, ? NRF_PDM_MCLKSRC_ACLK : NRF_PDM_MCLKSRC_PCLK32M; #endif - nrfx_pdm_output_t output_config = { - .base_clock_freq = (NRF_PDM_HAS_SELECTABLE_CLOCK && drv_cfg->clk_src == ACLK) - ? DMIC_NRFX_AUDIO_CLOCK_FREQ - : DMIC_NRFX_CLOCK_FREQ, - .sampling_rate = config->streams[0].pcm_rate, - .output_freq_min = config->io.min_pdm_clk_freq, - .output_freq_max = config->io.max_pdm_clk_freq - }; - - if (nrfx_pdm_prescalers_calc(&output_config, &nrfx_cfg.prescalers) != 0) { + if (!find_suitable_clock(drv_cfg, &nrfx_cfg, config)) { LOG_ERR("Cannot find suitable PDM clock configuration."); return -EINVAL; } if (drv_data->configured) { - nrfx_pdm_uninit(&drv_data->pdm); + nrfx_pdm_uninit(drv_data->pdm); drv_data->configured = false; } - err = nrfx_pdm_init(&drv_data->pdm, &nrfx_cfg, drv_cfg->event_handler); - if (err != 0) { - LOG_ERR("Failed to initialize PDM: %d", err); + err = nrfx_pdm_init(drv_data->pdm, &nrfx_cfg, drv_cfg->event_handler); + if (err != NRFX_SUCCESS) { + LOG_ERR("Failed to initialize PDM: 0x%08x", err); return -EIO; } @@ -331,15 +536,15 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, static int start_transfer(struct dmic_nrfx_pdm_drv_data *drv_data) { - int err; + nrfx_err_t err; int ret; - err = nrfx_pdm_start(&drv_data->pdm); - if (err == 0) { + err = nrfx_pdm_start(drv_data->pdm); + if (err == NRFX_SUCCESS) { return 0; } - LOG_ERR("Failed to start PDM: %d", err); + LOG_ERR("Failed to start PDM: 0x%08x", err); ret = -EIO; ret = release_clock(drv_data); @@ -416,7 +621,7 @@ static int dmic_nrfx_pdm_trigger(const struct device *dev, case DMIC_TRIGGER_STOP: if (drv_data->active) { drv_data->stopping = true; - nrfx_pdm_stop(&drv_data->pdm); + nrfx_pdm_stop(drv_data->pdm); } break; @@ -499,60 +704,80 @@ static const struct _dmic_ops dmic_ops = { .read = dmic_nrfx_pdm_read, }; -#define PDM_CLK_SRC(inst) DT_STRING_TOKEN(DT_DRV_INST(inst), clock_source) - -#define PDM_NRFX_DEVICE(inst) \ - static void *rx_msgs##inst[DT_INST_PROP(inst, queue_size)]; \ - static void *mem_slab_msgs##inst[DT_INST_PROP(inst, queue_size)]; \ - static struct dmic_nrfx_pdm_drv_data dmic_nrfx_pdm_data##inst = { \ - .pdm = NRFX_PDM_INSTANCE(DT_INST_REG_ADDR(inst)), \ - }; \ - static int pdm_nrfx_init##inst(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), nrfx_pdm_irq_handler, \ - &dmic_nrfx_pdm_data##inst.pdm, 0); \ - const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; \ - int err = pinctrl_apply_state(drv_cfg->pcfg, PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - k_msgq_init(&dmic_nrfx_pdm_data##inst.rx_queue, (char *)rx_msgs##inst, \ - sizeof(void *), ARRAY_SIZE(rx_msgs##inst)); \ - k_msgq_init(&dmic_nrfx_pdm_data##inst.mem_slab_queue, (char *)mem_slab_msgs##inst, \ - sizeof(void *), ARRAY_SIZE(mem_slab_msgs##inst)); \ - init_clock_manager(dev); \ - return 0; \ - } \ - static void event_handler##inst(const nrfx_pdm_evt_t *evt) \ - { \ - event_handler(DEVICE_DT_INST_GET(inst), evt); \ - } \ - PINCTRL_DT_INST_DEFINE(inst); \ - static const struct dmic_nrfx_pdm_drv_cfg dmic_nrfx_pdm_cfg##inst = { \ - .event_handler = event_handler##inst, \ - .nrfx_def_cfg = NRFX_PDM_DEFAULT_CONFIG(0, 0), \ - .nrfx_def_cfg.skip_gpio_cfg = true, \ - .nrfx_def_cfg.skip_psel_cfg = true, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ - .clk_src = PDM_CLK_SRC(inst), \ - .mem_reg = DMM_DEV_TO_REG(DT_DRV_INST(inst)), \ - }; \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ - BUILD_ASSERT(PDM_CLK_SRC(inst) != ACLK || NRF_PDM_HAS_SELECTABLE_CLOCK, \ - "Clock source ACLK is not available."); \ - BUILD_ASSERT(PDM_CLK_SRC(inst) != ACLK || \ - DT_NODE_HAS_PROP(DT_NODELABEL(clock), hfclkaudio_frequency) || \ - DT_NODE_HAS_PROP(DT_NODELABEL(aclk), clock_frequency) || \ - DT_NODE_HAS_PROP(NODE_AUDIOPLL, frequency) || \ - DT_NODE_HAS_PROP(NODE_AUDIO_AUXPLL, nordic_frequency), \ - "Clock source ACLK requires one following defined frequency " \ - "properties: " \ - "hfclkaudio-frequency in the nordic,nrf-clock node, " \ - "clock-frequency in the aclk node, " \ - "frequency in the audiopll node, " \ - "nordic-frequency in the audio_auxpll node"); \ - DEVICE_DT_INST_DEFINE(inst, pdm_nrfx_init##inst, NULL, &dmic_nrfx_pdm_data##inst, \ - &dmic_nrfx_pdm_cfg##inst, POST_KERNEL, \ - CONFIG_AUDIO_DMIC_INIT_PRIORITY, &dmic_ops); - -DT_INST_FOREACH_STATUS_OKAY(PDM_NRFX_DEVICE) +#define PDM(idx) DT_NODELABEL(pdm##idx) +#define PDM_CLK_SRC(idx) DT_STRING_TOKEN(PDM(idx), clock_source) + +#define PDM_NRFX_DEVICE(idx) \ + static void *rx_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ + static void *mem_slab_msgs##idx[DT_PROP(PDM(idx), queue_size)]; \ + static struct dmic_nrfx_pdm_drv_data dmic_nrfx_pdm_data##idx; \ + static const nrfx_pdm_t dmic_nrfx_pdm##idx = NRFX_PDM_INSTANCE(idx); \ + static int pdm_nrfx_init##idx(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(PDM(idx)), DT_IRQ(PDM(idx), priority), \ + nrfx_isr, nrfx_pdm_##idx##_irq_handler, 0); \ + const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; \ + int err = pinctrl_apply_state(drv_cfg->pcfg, \ + PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + dmic_nrfx_pdm_data##idx.pdm = &dmic_nrfx_pdm##idx; \ + k_msgq_init(&dmic_nrfx_pdm_data##idx.rx_queue, \ + (char *)rx_msgs##idx, sizeof(void *), \ + ARRAY_SIZE(rx_msgs##idx)); \ + k_msgq_init(&dmic_nrfx_pdm_data##idx.mem_slab_queue, \ + (char *)mem_slab_msgs##idx, sizeof(void *), \ + ARRAY_SIZE(mem_slab_msgs##idx)); \ + init_clock_manager(dev); \ + return 0; \ + } \ + static void event_handler##idx(const nrfx_pdm_evt_t *evt) \ + { \ + event_handler(DEVICE_DT_GET(PDM(idx)), evt); \ + } \ + PINCTRL_DT_DEFINE(PDM(idx)); \ + static const struct dmic_nrfx_pdm_drv_cfg dmic_nrfx_pdm_cfg##idx = { \ + .event_handler = event_handler##idx, \ + .nrfx_def_cfg = NRFX_PDM_DEFAULT_CONFIG(0, 0), \ + .nrfx_def_cfg.skip_gpio_cfg = true, \ + .nrfx_def_cfg.skip_psel_cfg = true, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PDM(idx)), \ + .clk_src = PDM_CLK_SRC(idx), \ + .mem_reg = DMM_DEV_TO_REG(PDM(idx)), \ + }; \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PDM(idx)); \ + BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ + NRF_PDM_HAS_SELECTABLE_CLOCK, \ + "Clock source ACLK is not available."); \ + BUILD_ASSERT(PDM_CLK_SRC(idx) != ACLK || \ + DT_NODE_HAS_PROP(DT_NODELABEL(clock), \ + hfclkaudio_frequency) || \ + DT_NODE_HAS_PROP(DT_NODELABEL(aclk), \ + clock_frequency) || \ + DT_NODE_HAS_PROP(NODE_AUDIOPLL, \ + frequency) || \ + DT_NODE_HAS_PROP(NODE_AUDIO_AUXPLL, \ + nordic_frequency), \ + "Clock source ACLK requires one following defined frequency "\ + "properties: " \ + "hfclkaudio-frequency in the nordic,nrf-clock node, " \ + "clock-frequency in the aclk node, " \ + "frequency in the audiopll node, " \ + "nordic-frequency in the audio_auxpll node"); \ + DEVICE_DT_DEFINE(PDM(idx), pdm_nrfx_init##idx, NULL, \ + &dmic_nrfx_pdm_data##idx, &dmic_nrfx_pdm_cfg##idx, \ + POST_KERNEL, CONFIG_AUDIO_DMIC_INIT_PRIORITY, \ + &dmic_ops); + +#ifdef CONFIG_HAS_HW_NRF_PDM0 +PDM_NRFX_DEVICE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_PDM20 +PDM_NRFX_DEVICE(20); +#endif + +#ifdef CONFIG_HAS_HW_NRF_PDM21 +PDM_NRFX_DEVICE(21); +#endif diff --git a/drivers/clock_control/clock_control_nrf.c b/drivers/clock_control/clock_control_nrf.c index f42a673b7597..caa7aadff613 100644 --- a/drivers/clock_control/clock_control_nrf.c +++ b/drivers/clock_control/clock_control_nrf.c @@ -14,6 +14,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(clock_control, CONFIG_CLOCK_CONTROL_LOG_LEVEL); @@ -316,7 +317,7 @@ static void hfclk_start(void) hf_start_tstamp = k_uptime_get(); } - nrfx_clock_start(NRF_CLOCK_DOMAIN_HFCLK); + nrfx_clock_hfclk_start(); } static void hfclk_stop(void) @@ -325,7 +326,7 @@ static void hfclk_stop(void) hf_stop_tstamp = k_uptime_get(); } - nrfx_clock_stop(NRF_CLOCK_DOMAIN_HFCLK); + nrfx_clock_hfclk_stop(); } #if NRF_CLOCK_HAS_HFCLK24M @@ -800,6 +801,7 @@ static void hfclkaudio_init(void) static int clk_init(const struct device *dev) { + nrfx_err_t nrfx_err; int err; static const struct onoff_transitions transitions = { .start = onoff_start, @@ -813,7 +815,8 @@ static int clk_init(const struct device *dev) IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), nrfx_isr, nrfx_power_clock_irq_handler, 0); - if (nrfx_clock_init(clock_event_handler) != 0) { + nrfx_err = nrfx_clock_init(clock_event_handler); + if (nrfx_err != NRFX_SUCCESS) { return -EIO; } diff --git a/drivers/comparator/comparator_nrf_common.h b/drivers/comparator/comparator_nrf_common.h new file mode 100644 index 000000000000..e86fc9f63692 --- /dev/null +++ b/drivers/comparator/comparator_nrf_common.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_ +#define ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_ + +#include + +#if (NRF_COMP_HAS_AIN_AS_PIN || NRF_LPCOMP_HAS_AIN_AS_PIN) +static const uint32_t shim_nrf_comp_ain_map[] = { +#if defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280) + NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), +#elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15) + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), +#elif defined(NRF54LM20A_ENGA_XXAA) + NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), +#elif defined(NRF54LV10A_ENGA_XXAA) + NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(10U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), +#endif +}; +#endif + +#endif /* ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_ */ diff --git a/drivers/comparator/comparator_nrf_comp.c b/drivers/comparator/comparator_nrf_comp.c index bab02e7b9204..7178c51675d8 100644 --- a/drivers/comparator/comparator_nrf_comp.c +++ b/drivers/comparator/comparator_nrf_comp.c @@ -10,6 +10,7 @@ #include #include #include +#include "comparator_nrf_common.h" #define DT_DRV_COMPAT nordic_nrf_comp @@ -44,6 +45,20 @@ #define SHIM_NRF_COMP_DT_INST_PSEL(inst) DT_INST_PROP(inst, psel) +#if defined(COMP_HYST_HYST_Hyst40mV) +#define NRF_COMP_HYST_ENABLED NRF_COMP_HYST_40MV +#elif defined(COMP_HYST_HYST_Hyst50mV) +#define NRF_COMP_HYST_ENABLED NRF_COMP_HYST_50MV +#endif + +#define NRF_COMP_HYST_DISABLED NRF_COMP_HYST_NO_HYST + +#if defined(NRF_COMP_HYST_ENABLED) +#define NRF_COMP_HAS_HYST 1 +#else +#define NRF_COMP_HAS_HYST 0 +#endif + struct shim_nrf_comp_data { uint32_t event_mask; bool started; @@ -57,41 +72,84 @@ BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_DOWN(0) < 64); BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_UP(0) < 64); #endif -BUILD_ASSERT((NRF_COMP_AIN0 == NRFX_ANALOG_EXTERNAL_AIN0) && - (NRF_COMP_AIN1 == NRFX_ANALOG_EXTERNAL_AIN1) && - (NRF_COMP_AIN2 == NRFX_ANALOG_EXTERNAL_AIN2) && - (NRF_COMP_AIN3 == NRFX_ANALOG_EXTERNAL_AIN3) && - (NRF_COMP_AIN4 == NRFX_ANALOG_EXTERNAL_AIN4) && - (NRF_COMP_AIN5 == NRFX_ANALOG_EXTERNAL_AIN5) && - (NRF_COMP_AIN6 == NRFX_ANALOG_EXTERNAL_AIN6) && - (NRF_COMP_AIN7 == NRFX_ANALOG_EXTERNAL_AIN7) && -#if NRF_COMP_HAS_VDDH_DIV5 - (NRF_COMP_AIN_VDDH_DIV5 == NRFX_ANALOG_INTERNAL_VDDHDIV5) && +#if (NRF_COMP_HAS_AIN_AS_PIN) +BUILD_ASSERT(NRF_COMP_AIN0 == 0); +BUILD_ASSERT(NRF_COMP_AIN7 == 7); +#else +BUILD_ASSERT((NRF_COMP_AIN0 == NRF_COMP_INPUT_0) && + (NRF_COMP_AIN1 == NRF_COMP_INPUT_1) && + (NRF_COMP_AIN2 == NRF_COMP_INPUT_2) && + (NRF_COMP_AIN3 == NRF_COMP_INPUT_3) && +#if defined(COMP_PSEL_PSEL_AnalogInput4) + (NRF_COMP_AIN4 == NRF_COMP_INPUT_4) && +#endif +#if defined(COMP_PSEL_PSEL_AnalogInput5) + (NRF_COMP_AIN5 == NRF_COMP_INPUT_5) && #endif -#if NRF_COMP_HAS_VDD_DIV2 - (NRF_COMP_AIN_VDD_DIV2 == NRFX_ANALOG_INTERNAL_VDDDIV2) && +#if defined(COMP_PSEL_PSEL_AnalogInput6) + (NRF_COMP_AIN6 == NRF_COMP_INPUT_6) && +#endif +#if defined(COMP_PSEL_PSEL_AnalogInput7) + (NRF_COMP_AIN7 == NRF_COMP_INPUT_7) && +#endif + (NRF_COMP_AIN0 == NRF_COMP_EXT_REF_0) && + (NRF_COMP_AIN1 == NRF_COMP_EXT_REF_1) && + (NRF_COMP_AIN2 == NRF_COMP_EXT_REF_2) && + (NRF_COMP_AIN3 == NRF_COMP_EXT_REF_3) && +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference4) + (NRF_COMP_AIN4 == NRF_COMP_EXT_REF_4) && +#endif +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference5) + (NRF_COMP_AIN5 == NRF_COMP_EXT_REF_5) && +#endif +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference6) + (NRF_COMP_AIN6 == NRF_COMP_EXT_REF_6) && +#endif +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference7) + (NRF_COMP_AIN7 == NRF_COMP_EXT_REF_7) && +#endif +#if defined(COMP_PSEL_PSEL_VddDiv2) + (NRF_COMP_VDD_DIV2 == NRF_COMP_VDD_DIV2) && +#endif +#if defined(COMP_PSEL_PSEL_VddhDiv5) + (NRF_COMP_VDDH_DIV5 == NRF_COMP_VDDH_DIV5) && #endif 1, - "Definitions from nrf-comp.h do not match those from nrfx_analog_common.h"); + "Definitions from nrf-comp.h do not match those from HAL"); +#endif -#if !NRF_COMP_HAS_SP_MODE_NORMAL +#ifndef COMP_MODE_SP_Normal BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_SP_MODE(0) != COMP_NRF_COMP_SP_MODE_NORMAL); #endif +#if NRF_COMP_HAS_ISOURCE +#ifndef COMP_ISOURCE_ISOURCE_Ien2uA5 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_ISOURCE(0) != COMP_NRF_COMP_ISOURCE_2UA5); +#endif + +#ifndef COMP_ISOURCE_ISOURCE_Ien5uA +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_ISOURCE(0) != COMP_NRF_COMP_ISOURCE_5UA); +#endif + +#ifndef COMP_ISOURCE_ISOURCE_Ien10uA +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_ISOURCE(0) != COMP_NRF_COMP_ISOURCE_10UA); +#endif +#endif + #if SHIM_NRF_COMP_DT_INST_MAIN_MODE_IS_SE(0) -#if !NRF_COMP_HAS_REF_INT_1V8 +#ifndef COMP_REFSEL_REFSEL_Int1V8 BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_INT_1V8); #endif -#if !NRF_COMP_HAS_REF_INT_2V4 +#ifndef COMP_REFSEL_REFSEL_Int2V4 BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_INT_2V4); #endif -#if !NRF_COMP_HAS_REF_AVDDAO1V8 +#ifndef COMP_REFSEL_REFSEL_AVDDAO1V8 BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_AVDDAO1V8); #endif -#if !NRF_COMP_HAS_REF_VDD +#ifndef COMP_REFSEL_REFSEL_VDD BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_VDD); #endif #endif @@ -183,6 +241,87 @@ static int shim_nrf_comp_pm_callback(const struct device *dev, enum pm_device_ac return 0; } +#if (NRF_COMP_HAS_AIN_AS_PIN) +static int shim_nrf_comp_psel_to_nrf(uint8_t shim, + nrf_comp_input_t *nrf) +{ + if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { + return -EINVAL; + } + + *nrf = shim_nrf_comp_ain_map[shim]; + +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + nrf_gpio_pin_retain_disable(shim_nrf_comp_ain_map[shim]); +#endif + + return 0; +} +#else +static int shim_nrf_comp_psel_to_nrf(uint8_t shim, + nrf_comp_input_t *nrf) +{ + switch (shim) { + case NRF_COMP_AIN0: + *nrf = NRF_COMP_INPUT_0; + break; + + case NRF_COMP_AIN1: + *nrf = NRF_COMP_INPUT_1; + break; + + case NRF_COMP_AIN2: + *nrf = NRF_COMP_INPUT_2; + break; + + case NRF_COMP_AIN3: + *nrf = NRF_COMP_INPUT_3; + break; + +#if defined(COMP_PSEL_PSEL_AnalogInput4) + case NRF_COMP_AIN4: + *nrf = NRF_COMP_INPUT_4; + break; +#endif + +#if defined(COMP_PSEL_PSEL_AnalogInput5) + case NRF_COMP_AIN5: + *nrf = NRF_COMP_INPUT_5; + break; +#endif + +#if defined(COMP_PSEL_PSEL_AnalogInput6) + case NRF_COMP_AIN6: + *nrf = NRF_COMP_INPUT_6; + break; +#endif + +#if defined(COMP_PSEL_PSEL_AnalogInput7) + case NRF_COMP_AIN7: + *nrf = NRF_COMP_INPUT_7; + break; +#endif + +#if defined(COMP_PSEL_PSEL_VddDiv2) + case NRF_COMP_AIN_VDD_DIV2: + *nrf = NRF_COMP_VDD_DIV2; + break; +#endif + +#if defined(COMP_PSEL_PSEL_VddhDiv5) + case NRF_COMP_AIN_VDDH_DIV5: + *nrf = NRF_COMP_VDDH_DIV5; + break; +#endif + + default: + return -EINVAL; + } + + return 0; +} +#endif + static int shim_nrf_comp_sp_mode_to_nrf(enum comp_nrf_comp_sp_mode shim, nrf_comp_sp_mode_t *nrf) { @@ -191,7 +330,7 @@ static int shim_nrf_comp_sp_mode_to_nrf(enum comp_nrf_comp_sp_mode shim, *nrf = NRF_COMP_SP_MODE_LOW; break; -#if NRF_COMP_HAS_SP_MODE_NORMAL +#if defined(COMP_MODE_SP_Normal) case COMP_NRF_COMP_SP_MODE_NORMAL: *nrf = NRF_COMP_SP_MODE_NORMAL; break; @@ -210,21 +349,95 @@ static int shim_nrf_comp_sp_mode_to_nrf(enum comp_nrf_comp_sp_mode shim, #if NRF_COMP_HAS_ISOURCE static int shim_nrf_comp_isource_to_nrf(enum comp_nrf_comp_isource shim, - nrf_comp_isource_t *nrf) + nrf_isource_t *nrf) { switch (shim) { case COMP_NRF_COMP_ISOURCE_DISABLED: *nrf = NRF_COMP_ISOURCE_OFF; break; + +#if defined(COMP_ISOURCE_ISOURCE_Ien2uA5) case COMP_NRF_COMP_ISOURCE_2UA5: *nrf = NRF_COMP_ISOURCE_IEN_2UA5; break; +#endif + +#if defined(COMP_ISOURCE_ISOURCE_Ien5uA) case COMP_NRF_COMP_ISOURCE_5UA: *nrf = NRF_COMP_ISOURCE_IEN_5UA; break; +#endif + +#if defined(COMP_ISOURCE_ISOURCE_Ien10uA) case COMP_NRF_COMP_ISOURCE_10UA: *nrf = NRF_COMP_ISOURCE_IEN_10UA; break; +#endif + + default: + return -EINVAL; + } + + return 0; +} +#endif + +#if (NRF_COMP_HAS_AIN_AS_PIN) +static int shim_nrf_comp_extrefsel_to_nrf(uint8_t shim, + nrf_comp_ext_ref_t *nrf) +{ + if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { + return -EINVAL; + } + + *nrf = shim_nrf_comp_ain_map[shim]; + return 0; +} +#else +static int shim_nrf_comp_extrefsel_to_nrf(uint8_t shim, + nrf_comp_ext_ref_t *nrf) +{ + switch (shim) { + case NRF_COMP_AIN0: + *nrf = NRF_COMP_EXT_REF_0; + break; + + case NRF_COMP_AIN1: + *nrf = NRF_COMP_EXT_REF_1; + break; + + case NRF_COMP_AIN2: + *nrf = NRF_COMP_EXT_REF_2; + break; + + case NRF_COMP_AIN3: + *nrf = NRF_COMP_EXT_REF_3; + break; + +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference4) + case NRF_COMP_AIN4: + *nrf = NRF_COMP_EXT_REF_4; + break; +#endif + +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference5) + case NRF_COMP_AIN5: + *nrf = NRF_COMP_EXT_REF_5; + break; +#endif + +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference6) + case NRF_COMP_AIN6: + *nrf = NRF_COMP_EXT_REF_6; + break; +#endif + +#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference7) + case NRF_COMP_AIN7: + *nrf = NRF_COMP_EXT_REF_7; + break; +#endif + default: return -EINVAL; } @@ -241,25 +454,25 @@ static int shim_nrf_comp_refsel_to_nrf(enum comp_nrf_comp_refsel shim, *nrf = NRF_COMP_REF_INT_1V2; break; -#if NRF_COMP_HAS_REF_INT_1V8 +#if defined(COMP_REFSEL_REFSEL_Int1V8) case COMP_NRF_COMP_REFSEL_INT_1V8: *nrf = NRF_COMP_REF_INT_1V8; break; #endif -#if NRF_COMP_HAS_REF_INT_2V4 +#if defined(COMP_REFSEL_REFSEL_Int2V4) case COMP_NRF_COMP_REFSEL_INT_2V4: *nrf = NRF_COMP_REF_INT_2V4; break; #endif -#if NRF_COMP_HAS_REF_AVDDAO1V8 +#if defined(COMP_REFSEL_REFSEL_AVDDAO1V8) case COMP_NRF_COMP_REFSEL_AVDDAO1V8: *nrf = NRF_COMP_REF_AVDDAO1V8; break; #endif -#if NRF_COMP_HAS_REF_VDD +#if defined(COMP_REFSEL_REFSEL_VDD) case COMP_NRF_COMP_REFSEL_VDD: *nrf = NRF_COMP_REF_VDD; break; @@ -283,8 +496,9 @@ static int shim_nrf_comp_se_config_to_nrf(const struct comp_nrf_comp_se_config * return -EINVAL; } - nrf->ext_ref = (nrfx_analog_input_t)shim->extrefsel; - nrf->input = (nrfx_analog_input_t)shim->psel; + if (shim_nrf_comp_extrefsel_to_nrf(shim->extrefsel, &nrf->ext_ref)) { + return -EINVAL; + } nrf->main_mode = NRF_COMP_MAIN_MODE_SE; @@ -311,6 +525,10 @@ static int shim_nrf_comp_se_config_to_nrf(const struct comp_nrf_comp_se_config * } #endif + if (shim_nrf_comp_psel_to_nrf(shim->psel, &nrf->input)) { + return -EINVAL; + } + nrf->interrupt_priority = 0; return 0; } @@ -320,8 +538,9 @@ static int shim_nrf_comp_diff_config_to_nrf(const struct comp_nrf_comp_diff_conf { nrf->reference = NRF_COMP_REF_AREF; - nrf->ext_ref = (nrfx_analog_input_t)shim->extrefsel; - nrf->input = (nrfx_analog_input_t)shim->psel; + if (shim_nrf_comp_extrefsel_to_nrf(shim->extrefsel, &nrf->ext_ref)) { + return -EINVAL; + } nrf->main_mode = NRF_COMP_MAIN_MODE_DIFF; nrf->threshold.th_down = 0; @@ -353,6 +572,10 @@ static int shim_nrf_comp_diff_config_to_nrf(const struct comp_nrf_comp_diff_conf } #endif + if (shim_nrf_comp_psel_to_nrf(shim->psel, &nrf->input)) { + return -EINVAL; + } + nrf->interrupt_priority = 0; return 0; } @@ -500,7 +723,7 @@ static int shim_nrf_comp_init(const struct device *dev) (void)shim_nrf_comp_diff_config_to_nrf(&shim_nrf_comp_config0, &nrf); #endif - if (nrfx_comp_init(&nrf, shim_nrf_comp_event_handler) != 0) { + if (nrfx_comp_init(&nrf, shim_nrf_comp_event_handler) != NRFX_SUCCESS) { return -ENODEV; } diff --git a/drivers/comparator/comparator_nrf_lpcomp.c b/drivers/comparator/comparator_nrf_lpcomp.c index ec1d10c3dae9..dbd58d342360 100644 --- a/drivers/comparator/comparator_nrf_lpcomp.c +++ b/drivers/comparator/comparator_nrf_lpcomp.c @@ -10,6 +10,7 @@ #include #include #include +#include "comparator_nrf_common.h" #include @@ -37,15 +38,22 @@ struct shim_nrf_lpcomp_data { void *user_data; }; -BUILD_ASSERT((NRF_COMP_AIN0 == NRFX_ANALOG_EXTERNAL_AIN0) && - (NRF_COMP_AIN1 == NRFX_ANALOG_EXTERNAL_AIN1) && - (NRF_COMP_AIN2 == NRFX_ANALOG_EXTERNAL_AIN2) && - (NRF_COMP_AIN3 == NRFX_ANALOG_EXTERNAL_AIN3) && - (NRF_COMP_AIN4 == NRFX_ANALOG_EXTERNAL_AIN4) && - (NRF_COMP_AIN5 == NRFX_ANALOG_EXTERNAL_AIN5) && - (NRF_COMP_AIN6 == NRFX_ANALOG_EXTERNAL_AIN6) && - (NRF_COMP_AIN7 == NRFX_ANALOG_EXTERNAL_AIN7), - "Definitions from nrf-comp.h do not match those from nrfx_analog_common.h"); +#if (NRF_LPCOMP_HAS_AIN_AS_PIN) +BUILD_ASSERT(NRF_COMP_AIN0 == 0); +BUILD_ASSERT(NRF_COMP_AIN7 == 7); +#else +BUILD_ASSERT((NRF_COMP_AIN0 == NRF_LPCOMP_INPUT_0) && + (NRF_COMP_AIN1 == NRF_LPCOMP_INPUT_1) && + (NRF_COMP_AIN2 == NRF_LPCOMP_INPUT_2) && + (NRF_COMP_AIN3 == NRF_LPCOMP_INPUT_3) && + (NRF_COMP_AIN4 == NRF_LPCOMP_INPUT_4) && + (NRF_COMP_AIN5 == NRF_LPCOMP_INPUT_5) && + (NRF_COMP_AIN6 == NRF_LPCOMP_INPUT_6) && + (NRF_COMP_AIN7 == NRF_LPCOMP_INPUT_7) && + (NRF_COMP_AIN0 == NRF_LPCOMP_EXT_REF_REF0) && + (NRF_COMP_AIN1 == NRF_LPCOMP_EXT_REF_REF1), + "Definitions from nrf-comp.h do not match those from HAL"); +#endif #if (LPCOMP_REFSEL_RESOLUTION == 8) BUILD_ASSERT((SHIM_NRF_LPCOMP_DT_INST_REFSEL(0) < COMP_NRF_LPCOMP_REFSEL_VDD_1_16) || @@ -126,6 +134,99 @@ static int shim_nrf_lpcomp_pm_callback(const struct device *dev, enum pm_device_ return 0; } +#if (NRF_LPCOMP_HAS_AIN_AS_PIN) +static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, + nrf_lpcomp_input_t *nrf) +{ + if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { + return -EINVAL; + } + + *nrf = shim_nrf_comp_ain_map[shim]; + +#if NRF_GPIO_HAS_RETENTION_SETCLEAR + nrf_gpio_pin_retain_disable(shim_nrf_comp_ain_map[shim]); +#endif + + return 0; +} +#else +static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, + nrf_lpcomp_input_t *nrf) +{ + switch (shim) { + case NRF_COMP_AIN0: + *nrf = NRF_LPCOMP_INPUT_0; + break; + + case NRF_COMP_AIN1: + *nrf = NRF_LPCOMP_INPUT_1; + break; + + case NRF_COMP_AIN2: + *nrf = NRF_LPCOMP_INPUT_2; + break; + + case NRF_COMP_AIN3: + *nrf = NRF_LPCOMP_INPUT_3; + break; + + case NRF_COMP_AIN4: + *nrf = NRF_LPCOMP_INPUT_4; + break; + + case NRF_COMP_AIN5: + *nrf = NRF_LPCOMP_INPUT_5; + break; + + case NRF_COMP_AIN6: + *nrf = NRF_LPCOMP_INPUT_6; + break; + + case NRF_COMP_AIN7: + *nrf = NRF_LPCOMP_INPUT_7; + break; + + default: + return -EINVAL; + } + + return 0; +} +#endif + +#if (NRF_LPCOMP_HAS_AIN_AS_PIN) +static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, + nrf_lpcomp_ext_ref_t *nrf) +{ + if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { + return -EINVAL; + } + + *nrf = shim_nrf_comp_ain_map[shim]; + return 0; +} +#else +static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, + nrf_lpcomp_ext_ref_t *nrf) +{ + switch (shim) { + case NRF_COMP_AIN0: + *nrf = NRF_LPCOMP_EXT_REF_REF0; + break; + + case NRF_COMP_AIN1: + *nrf = NRF_LPCOMP_EXT_REF_REF1; + break; + + default: + return -EINVAL; + } + + return 0; +} +#endif + static int shim_nrf_lpcomp_refsel_to_nrf(enum comp_nrf_lpcomp_refsel shim, nrf_lpcomp_ref_t *nrf) { @@ -210,8 +311,9 @@ static int shim_nrf_lpcomp_config_to_nrf(const struct comp_nrf_lpcomp_config *sh return -EINVAL; } - nrf->ext_ref = (nrfx_analog_input_t)shim->extrefsel; - nrf->input = (nrfx_analog_input_t)shim->psel; + if (shim_nrf_lpcomp_extrefsel_to_nrf(shim->extrefsel, &nrf->ext_ref)) { + return -EINVAL; + } #if NRF_LPCOMP_HAS_HYST if (shim->enable_hyst) { @@ -225,6 +327,10 @@ static int shim_nrf_lpcomp_config_to_nrf(const struct comp_nrf_lpcomp_config *sh } #endif + if (shim_nrf_lpcomp_psel_to_nrf(shim->psel, &nrf->input)) { + return -EINVAL; + } + return 0; } @@ -357,7 +463,7 @@ static int shim_nrf_lpcomp_init(const struct device *dev) &shim_nrf_lpcomp_data0.config); if (nrfx_lpcomp_init(&shim_nrf_lpcomp_data0.config, - shim_nrf_lpcomp_event_handler) != 0) { + shim_nrf_lpcomp_event_handler) != NRFX_SUCCESS) { return -ENODEV; } diff --git a/drivers/counter/Kconfig.nrfx b/drivers/counter/Kconfig.nrfx index e50b75063135..ed02411de261 100644 --- a/drivers/counter/Kconfig.nrfx +++ b/drivers/counter/Kconfig.nrfx @@ -22,7 +22,8 @@ config COUNTER_RTC_WITH_PPI_WRAP $(dt_nodelabel_bool_prop,rtc1,ppi-wrap) || \ $(dt_nodelabel_bool_prop,rtc2,ppi-wrap) depends on COUNTER_NRF_RTC - select NRFX_GPPI + select NRFX_PPI if HAS_HW_NRF_PPI + select NRFX_DPPI if HAS_HW_NRF_DPPIC # Internal flag which detects if fixed top feature is enabled for any instance config COUNTER_RTC_CUSTOM_TOP_SUPPORT diff --git a/drivers/counter/counter_nrfx_rtc.c b/drivers/counter/counter_nrfx_rtc.c index 70f822591a13..735aa49a76f4 100644 --- a/drivers/counter/counter_nrfx_rtc.c +++ b/drivers/counter/counter_nrfx_rtc.c @@ -11,7 +11,11 @@ #endif #include #include -#include +#ifdef DPPI_PRESENT +#include +#else +#include +#endif #define LOG_MODULE_NAME counter_rtc #include @@ -54,7 +58,7 @@ struct counter_nrfx_data { /* Store channel interrupt pending and CC adjusted flags. */ atomic_t ipend_adj; #if CONFIG_COUNTER_RTC_WITH_PPI_WRAP - nrfx_gppi_handle_t ppi_handle; + uint8_t ppi_ch; #endif }; @@ -375,21 +379,41 @@ static int ppi_setup(const struct device *dev, uint8_t chan) struct counter_nrfx_data *data = dev->data; NRF_RTC_Type *rtc = nrfx_config->rtc; nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(chan); - uint32_t eep = nrf_rtc_event_address_get(rtc, evt); - uint32_t tep = nrfy_rtc_task_address_get(rtc, NRF_RTC_TASK_CLEAR); - int err; + nrfx_err_t result; if (!nrfx_config->use_ppi) { return 0; } nrfy_rtc_event_enable(rtc, NRF_RTC_CHANNEL_INT_MASK(chan)); - err = nrfx_gppi_conn_alloc(eep, tep, &data->ppi_handle); - if (err < 0) { - return err; +#ifdef DPPI_PRESENT + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + + result = nrfx_dppi_channel_alloc(&dppi, &data->ppi_ch); + if (result != NRFX_SUCCESS) { + ERR("Failed to allocate PPI channel."); + return -ENODEV; } - nrfx_gppi_conn_enable(data->ppi_handle); + + nrfy_rtc_subscribe_set(rtc, NRF_RTC_TASK_CLEAR, data->ppi_ch); + nrfy_rtc_publish_set(rtc, evt, data->ppi_ch); + (void)nrfx_dppi_channel_enable(&dppi, data->ppi_ch); +#else /* DPPI_PRESENT */ + uint32_t evt_addr; + uint32_t task_addr; + + evt_addr = nrfy_rtc_event_address_get(rtc, evt); + task_addr = nrfy_rtc_task_address_get(rtc, NRF_RTC_TASK_CLEAR); + + result = nrfx_ppi_channel_alloc(&data->ppi_ch); + if (result != NRFX_SUCCESS) { + ERR("Failed to allocate PPI channel."); + return -ENODEV; + } + (void)nrfx_ppi_channel_assign(data->ppi_ch, evt_addr, task_addr); + (void)nrfx_ppi_channel_enable(data->ppi_ch); #endif +#endif /* CONFIG_COUNTER_RTC_WITH_PPI_WRAP */ return 0; } @@ -398,17 +422,25 @@ static void ppi_free(const struct device *dev, uint8_t chan) #if CONFIG_COUNTER_RTC_WITH_PPI_WRAP const struct counter_nrfx_config *nrfx_config = dev->config; struct counter_nrfx_data *data = dev->data; + uint8_t ppi_ch = data->ppi_ch; NRF_RTC_Type *rtc = nrfx_config->rtc; - nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(chan); - uint32_t eep = nrf_rtc_event_address_get(rtc, evt); - uint32_t tep = nrfy_rtc_task_address_get(rtc, NRF_RTC_TASK_CLEAR); if (!nrfx_config->use_ppi) { return; } nrfy_rtc_event_disable(rtc, NRF_RTC_CHANNEL_INT_MASK(chan)); - nrfx_gppi_conn_disable(data->ppi_handle); - nrfx_gppi_conn_free(eep, tep, data->ppi_handle); +#ifdef DPPI_PRESENT + nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(chan); + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + + (void)nrfx_dppi_channel_disable(&dppi, ppi_ch); + nrfy_rtc_subscribe_clear(rtc, NRF_RTC_TASK_CLEAR); + nrfy_rtc_publish_clear(rtc, evt); + (void)nrfx_dppi_channel_free(&dppi, ppi_ch); +#else /* DPPI_PRESENT */ + (void)nrfx_ppi_channel_disable(ppi_ch); + (void)nrfx_ppi_channel_free(ppi_ch); +#endif #endif } diff --git a/drivers/display/Kconfig.nrf_led_matrix b/drivers/display/Kconfig.nrf_led_matrix index 66bf11dd52ee..7e2a59120736 100644 --- a/drivers/display/Kconfig.nrf_led_matrix +++ b/drivers/display/Kconfig.nrf_led_matrix @@ -6,7 +6,7 @@ config DISPLAY_NRF_LED_MATRIX default y depends on DT_HAS_NORDIC_NRF_LED_MATRIX_ENABLED select NRFX_GPIOTE - select NRFX_GPPI + select NRFX_PPI if HAS_HW_NRF_PPI help Enable driver for a LED matrix with rows and columns driven by GPIOs. The driver allows setting one of 256 levels of brightness diff --git a/drivers/display/display_nrf_led_matrix.c b/drivers/display/display_nrf_led_matrix.c index babd10eb0464..79ae6652807a 100644 --- a/drivers/display/display_nrf_led_matrix.c +++ b/drivers/display/display_nrf_led_matrix.c @@ -13,8 +13,10 @@ #include #endif #include -#include -#include +#ifdef PPI_PRESENT +#include +#endif +#include #include #include LOG_MODULE_REGISTER(nrf_led_matrix, CONFIG_DISPLAY_LOG_LEVEL); @@ -89,7 +91,7 @@ struct display_drv_config { #if USE_PWM NRF_PWM_Type *pwm; #else - nrfx_gpiote_t *gpiote; + nrfx_gpiote_t gpiote; #endif uint8_t rows[ROW_COUNT]; uint8_t cols[COL_COUNT]; @@ -325,7 +327,7 @@ static void prepare_pixel_pulse(const struct device *dev, /* First timer channel is used for timing the period of pulses. */ nrf_timer_cc_set(dev_config->timer, 1 + channel_idx, pulse); - dev_config->gpiote->p_reg->CONFIG[dev_data->gpiote_ch[channel_idx]] = gpiote_cfg; + dev_config->gpiote.p_reg->CONFIG[dev_data->gpiote_ch[channel_idx]] = gpiote_cfg; #endif /* USE_PWM */ } @@ -355,7 +357,7 @@ static void timer_irq_handler(void *arg) } #else for (int i = 0; i < GROUP_SIZE; ++i) { - dev_config->gpiote->p_reg->CONFIG[dev_data->gpiote_ch[i]] = 0; + dev_config->gpiote.p_reg->CONFIG[dev_data->gpiote_ch[i]] = 0; } #endif @@ -435,37 +437,38 @@ static int instance_init(const struct device *dev) nrf_pwm_loop_set(dev_config->pwm, 0); nrf_pwm_shorts_set(dev_config->pwm, NRF_PWM_SHORT_SEQEND0_STOP_MASK); #else - nrfx_gppi_handle_t ppi_handle; - int rv; + nrfx_err_t err; + nrf_ppi_channel_t ppi_ch; for (int i = 0; i < GROUP_SIZE; ++i) { uint8_t *gpiote_ch = &dev_data->gpiote_ch[i]; - rv = nrfx_gpiote_channel_alloc(dev_config->gpiote, gpiote_ch); - if (rv != 0) { - LOG_ERR("Failed to allocate GPIOTE channel."); + err = nrfx_ppi_channel_alloc(&ppi_ch); + if (err != NRFX_SUCCESS) { + LOG_ERR("Failed to allocate PPI channel."); /* Do not bother with freeing resources allocated * so far. The application needs to be reconfigured * anyway. */ - return rv; + return -ENOMEM; } - rv = nrfx_gppi_conn_alloc( - nrf_timer_event_address_get(dev_config->timer, - nrf_timer_compare_event_get(1 + i)), - nrf_gpiote_event_address_get(dev_config->gpiote->p_reg, - nrf_gpiote_out_task_get(*gpiote_ch)), - &ppi_handle); - if (rv < 0) { - LOG_ERR("Failed to allocate PPI channel."); + err = nrfx_gpiote_channel_alloc(&dev_config->gpiote, gpiote_ch); + if (err != NRFX_SUCCESS) { + LOG_ERR("Failed to allocate GPIOTE channel."); /* Do not bother with freeing resources allocated * so far. The application needs to be reconfigured * anyway. */ - return rv; + return -ENOMEM; } - nrfx_gppi_conn_enable(ppi_handle); + + nrf_ppi_channel_endpoint_setup(NRF_PPI, ppi_ch, + nrf_timer_event_address_get(dev_config->timer, + nrf_timer_compare_event_get(1 + i)), + nrf_gpiote_event_address_get(dev_config->gpiote.p_reg, + nrf_gpiote_out_task_get(*gpiote_ch))); + nrf_ppi_channel_enable(NRF_PPI, ppi_ch); } #endif /* USE_PWM */ @@ -539,7 +542,8 @@ static const struct display_drv_config instance_config = { #if USE_PWM .pwm = (NRF_PWM_Type *)DT_REG_ADDR(PWM_NODE), #else - .gpiote = &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(MATRIX_NODE, col_gpios)), + .gpiote = NRFX_GPIOTE_INSTANCE( + NRF_DT_GPIOTE_INST_BY_IDX(MATRIX_NODE, col_gpios, 0)), #endif .rows = { DT_FOREACH_PROP_ELEM(MATRIX_NODE, row_gpios, GET_PIN_INFO) }, .cols = { DT_FOREACH_PROP_ELEM(MATRIX_NODE, col_gpios, GET_PIN_INFO) }, diff --git a/drivers/entropy/entropy_nrf_cracen.c b/drivers/entropy/entropy_nrf_cracen.c index a4e3c25abbcd..8c34a06db61a 100644 --- a/drivers/entropy/entropy_nrf_cracen.c +++ b/drivers/entropy/entropy_nrf_cracen.c @@ -23,10 +23,12 @@ static int nrf_cracen_get_entropy_isr(const struct device *dev, uint8_t *buf, ui irq_unlock(key); - if (likely(ret == 0)) { + if (likely(ret == NRFX_SUCCESS)) { return len; + } else if (ret == NRFX_ERROR_INVALID_PARAM) { + return -EINVAL; } else { - return ret; + return -EAGAIN; } } @@ -45,7 +47,13 @@ static int nrf_cracen_cracen_init(const struct device *dev) { (void)dev; - return nrfx_cracen_ctr_drbg_init(); + int ret = nrfx_cracen_ctr_drbg_init(); + + if (ret == NRFX_SUCCESS) { + return 0; + } else { + return -EIO; + } } static DEVICE_API(entropy, nrf_cracen_api_funcs) = { diff --git a/drivers/flash/nrf_qspi_nor.c b/drivers/flash/nrf_qspi_nor.c index 446216dd29ff..110a2d27c7e9 100644 --- a/drivers/flash/nrf_qspi_nor.c +++ b/drivers/flash/nrf_qspi_nor.c @@ -22,6 +22,7 @@ LOG_MODULE_REGISTER(qspi_nor, CONFIG_FLASH_LOG_LEVEL); #include "spi_nor.h" #include "jesd216.h" #include "flash_priv.h" +#include #include #include #include @@ -110,7 +111,7 @@ BUILD_ASSERT(INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 16), #define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1 #define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV1 /* If anomaly 159 is to be prevented, only /1 divider can be used. */ -#elif NRF_ERRATA_STATIC_CHECK(53, 159) +#elif NRF53_ERRATA_159_ENABLE_WORKAROUND #define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1 #define INST_0_SCK_CFG (DIV_ROUND_UP(NRF_QSPI_BASE_CLOCK_FREQ, \ INST_0_SCK_FREQUENCY) - 1) @@ -237,6 +238,32 @@ static int exit_dpd(const struct device *const dev); #define QSPI_IS_SECTOR_ALIGNED(_ofs) (((_ofs) & (QSPI_SECTOR_SIZE - 1U)) == 0) #define QSPI_IS_BLOCK_ALIGNED(_ofs) (((_ofs) & (QSPI_BLOCK_SIZE - 1U)) == 0) +/** + * @brief Converts NRFX return codes to the zephyr ones + */ +static inline int qspi_get_zephyr_ret_code(nrfx_err_t res) +{ + switch (res) { + case NRFX_SUCCESS: + return 0; + case NRFX_ERROR_INVALID_PARAM: + case NRFX_ERROR_INVALID_ADDR: + return -EINVAL; + case NRFX_ERROR_INVALID_STATE: + return -ECANCELED; +#if NRF53_ERRATA_159_ENABLE_WORKAROUND + case NRFX_ERROR_FORBIDDEN: + LOG_ERR("nRF5340 anomaly 159 conditions detected"); + LOG_ERR("Set the CPU clock to 64 MHz before starting QSPI operation"); + return -ECANCELED; +#endif + case NRFX_ERROR_BUSY: + case NRFX_ERROR_TIMEOUT: + default: + return -EBUSY; + } +} + static inline void qspi_lock(const struct device *dev) { #ifdef CONFIG_MULTITHREADING @@ -348,11 +375,12 @@ static void qspi_release(const struct device *dev) } } -static inline void qspi_wait_for_completion(const struct device *dev, int res) +static inline void qspi_wait_for_completion(const struct device *dev, + nrfx_err_t res) { struct qspi_nor_data *dev_data = dev->data; - if (res == 0) { + if (res == NRFX_SUCCESS) { #ifdef CONFIG_MULTITHREADING k_sem_take(&dev_data->sync, K_FOREVER); #else /* CONFIG_MULTITHREADING */ @@ -448,7 +476,9 @@ static int qspi_send_cmd(const struct device *dev, const struct qspi_cmd *cmd, .wren = wren, }; - return nrfx_qspi_cinstr_xfer(&cinstr_cfg, tx_buf, rx_buf); + int res = nrfx_qspi_cinstr_xfer(&cinstr_cfg, tx_buf, rx_buf); + + return qspi_get_zephyr_ret_code(res); } /* RDSR. Negative value is error. */ @@ -576,7 +606,7 @@ static int qspi_erase(const struct device *dev, uint32_t addr, uint32_t size) return rc; } while (size > 0) { - int res = -1; + nrfx_err_t res = !NRFX_SUCCESS; uint32_t adj = 0; if (size == params->size) { @@ -596,11 +626,11 @@ static int qspi_erase(const struct device *dev, uint32_t addr, uint32_t size) } else { /* minimal erase size is at least a sector size */ LOG_ERR("unsupported at 0x%lx size %zu", (long)addr, size); - res = -EINVAL; + res = NRFX_ERROR_INVALID_PARAM; } qspi_wait_for_completion(dev, res); - if (res == 0) { + if (res == NRFX_SUCCESS) { addr += adj; size -= adj; @@ -615,7 +645,7 @@ static int qspi_erase(const struct device *dev, uint32_t addr, uint32_t size) } } else { LOG_ERR("erase error at 0x%lx size %zu", (long)addr, size); - rc = res; + rc = qspi_get_zephyr_ret_code(res); break; } } @@ -750,24 +780,24 @@ static int qspi_sfdp_read(const struct device *dev, off_t offset, .io2_level = true, .io3_level = true, }; - int res; + nrfx_err_t res; qspi_acquire(dev); res = nrfx_qspi_lfm_start(&cinstr_cfg); - if (res != 0) { + if (res != NRFX_SUCCESS) { LOG_DBG("lfm_start: %x", res); goto out; } res = nrfx_qspi_lfm_xfer(addr_buf, NULL, sizeof(addr_buf), false); - if (res != 0) { + if (res != NRFX_SUCCESS) { LOG_DBG("lfm_xfer addr: %x", res); goto out; } res = nrfx_qspi_lfm_xfer(NULL, data, len, true); - if (res != 0) { + if (res != NRFX_SUCCESS) { LOG_DBG("lfm_xfer read: %x", res); goto out; } @@ -775,14 +805,14 @@ static int qspi_sfdp_read(const struct device *dev, off_t offset, out: qspi_release(dev); - return res; + return qspi_get_zephyr_ret_code(res); } #endif /* CONFIG_FLASH_JESD216_API */ -static inline int read_non_aligned(const struct device *dev, - off_t addr, - void *dest, size_t size) +static inline nrfx_err_t read_non_aligned(const struct device *dev, + off_t addr, + void *dest, size_t size) { uint8_t __aligned(WORD_SIZE) buf[WORD_SIZE * 2]; uint8_t *dptr = dest; @@ -809,14 +839,14 @@ static inline int read_non_aligned(const struct device *dev, flash_suffix = size - flash_prefix - flash_middle; } - int res = 0; + nrfx_err_t res = NRFX_SUCCESS; /* read from aligned flash to aligned memory */ if (flash_middle != 0) { res = nrfx_qspi_read(dptr + dest_prefix, flash_middle, addr + flash_prefix); qspi_wait_for_completion(dev, res); - if (res != 0) { + if (res != NRFX_SUCCESS) { return res; } @@ -831,7 +861,7 @@ static inline int read_non_aligned(const struct device *dev, res = nrfx_qspi_read(buf, WORD_SIZE, addr - (WORD_SIZE - flash_prefix)); qspi_wait_for_completion(dev, res); - if (res != 0) { + if (res != NRFX_SUCCESS) { return res; } memcpy(dptr, buf + WORD_SIZE - flash_prefix, flash_prefix); @@ -842,7 +872,7 @@ static inline int read_non_aligned(const struct device *dev, res = nrfx_qspi_read(buf, WORD_SIZE * 2, addr + flash_prefix + flash_middle); qspi_wait_for_completion(dev, res); - if (res != 0) { + if (res != NRFX_SUCCESS) { return res; } memcpy(dptr + flash_prefix + flash_middle, buf, flash_suffix); @@ -855,7 +885,7 @@ static int qspi_nor_read(const struct device *dev, off_t addr, void *dest, size_t size) { const struct qspi_nor_config *params = dev->config; - int res; + nrfx_err_t res; if (!dest) { return -EINVAL; @@ -881,15 +911,15 @@ static int qspi_nor_read(const struct device *dev, off_t addr, void *dest, qspi_release(dev); - return res; + return qspi_get_zephyr_ret_code(res); } /* addr aligned, sptr not null, slen less than 4 */ -static inline int write_sub_word(const struct device *dev, off_t addr, - const void *sptr, size_t slen) +static inline nrfx_err_t write_sub_word(const struct device *dev, off_t addr, + const void *sptr, size_t slen) { uint8_t __aligned(4) buf[4]; - int res; + nrfx_err_t res; /* read out the whole word so that unchanged data can be * written back @@ -897,7 +927,7 @@ static inline int write_sub_word(const struct device *dev, off_t addr, res = nrfx_qspi_read(buf, sizeof(buf), addr); qspi_wait_for_completion(dev, res); - if (res == 0) { + if (res == NRFX_SUCCESS) { memcpy(buf, sptr, slen); res = nrfx_qspi_write(buf, sizeof(buf), addr); qspi_wait_for_completion(dev, res); @@ -914,30 +944,30 @@ BUILD_ASSERT((CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE % 4) == 0, * * If not enabled return the error the peripheral would have produced. */ -static int write_through_buffer(const struct device *dev, off_t addr, +static nrfx_err_t write_through_buffer(const struct device *dev, off_t addr, const void *sptr, size_t slen) { - int res = 0; + nrfx_err_t res = NRFX_SUCCESS; if (CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE > 0) { uint8_t __aligned(4) buf[CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE]; const uint8_t *sp = sptr; - while ((slen > 0) && (res == 0)) { + while ((slen > 0) && (res == NRFX_SUCCESS)) { size_t len = MIN(slen, sizeof(buf)); memcpy(buf, sp, len); res = nrfx_qspi_write(buf, len, addr); qspi_wait_for_completion(dev, res); - if (res == 0) { + if (res == NRFX_SUCCESS) { slen -= len; sp += len; addr += len; } } } else { - res = -EACCES; + res = NRFX_ERROR_INVALID_ADDR; } return res; } @@ -976,15 +1006,19 @@ static int qspi_nor_write(const struct device *dev, off_t addr, rc = qspi_nor_write_protection_set(dev, false); if (rc == 0) { + nrfx_err_t res; + if (size < 4U) { - rc = write_sub_word(dev, addr, src, size); + res = write_sub_word(dev, addr, src, size); } else if (!nrfx_is_in_ram(src) || !nrfx_is_word_aligned(src)) { - rc = write_through_buffer(dev, addr, src, size); + res = write_through_buffer(dev, addr, src, size); } else { - rc = nrfx_qspi_write(src, size, addr); - qspi_wait_for_completion(dev, rc); + res = nrfx_qspi_write(src, size, addr); + qspi_wait_for_completion(dev, res); } + + rc = qspi_get_zephyr_ret_code(res); } rc2 = qspi_nor_write_protection_set(dev, true); @@ -1046,9 +1080,11 @@ static int qspi_init(const struct device *dev) { const struct qspi_nor_config *dev_config = dev->config; uint8_t id[SPI_NOR_MAX_ID_LEN]; + nrfx_err_t res; int rc; - rc = nrfx_qspi_init(&dev_config->nrfx_cfg, qspi_handler, dev->data); + res = nrfx_qspi_init(&dev_config->nrfx_cfg, qspi_handler, dev->data); + rc = qspi_get_zephyr_ret_code(res); if (rc < 0) { return rc; } @@ -1233,14 +1269,15 @@ static int exit_dpd(const struct device *const dev) .op_code = SPI_NOR_CMD_RDPD, }; uint32_t t_exit_dpd = DT_INST_PROP_OR(0, t_exit_dpd, 0); + nrfx_err_t res; int rc; nrf_qspi_pins_get(NRF_QSPI, &pins); nrf_qspi_pins_set(NRF_QSPI, &disconnected_pins); - rc = nrfx_qspi_activate(true); + res = nrfx_qspi_activate(true); nrf_qspi_pins_set(NRF_QSPI, &pins); - if (rc != 0) { + if (res != NRFX_SUCCESS) { return -EIO; } @@ -1264,10 +1301,11 @@ static int exit_dpd(const struct device *const dev) static int qspi_suspend(const struct device *dev) { const struct qspi_nor_config *dev_config = dev->config; + nrfx_err_t res; int rc; - rc = nrfx_qspi_mem_busy_check(); - if (rc != 0) { + res = nrfx_qspi_mem_busy_check(); + if (res != NRFX_SUCCESS) { return -EBUSY; } @@ -1284,6 +1322,7 @@ static int qspi_suspend(const struct device *dev) static int qspi_resume(const struct device *dev) { const struct qspi_nor_config *dev_config = dev->config; + nrfx_err_t res; int rc; rc = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); @@ -1291,9 +1330,9 @@ static int qspi_resume(const struct device *dev) return rc; } - rc = nrfx_qspi_init(&dev_config->nrfx_cfg, qspi_handler, dev->data); - if (rc < 0) { - return rc; + res = nrfx_qspi_init(&dev_config->nrfx_cfg, qspi_handler, dev->data); + if (res != NRFX_SUCCESS) { + return -EIO; } return exit_dpd(dev); diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index dbbb1da7a985..574739082dc4 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "soc_flash_nrf.h" @@ -120,7 +121,7 @@ static inline bool is_uicr_addr_valid(off_t addr, size_t len) #endif /* CONFIG_SOC_FLASH_NRF_UICR */ } -#if CONFIG_SOC_FLASH_NRF_UICR && NRF_ERRATA_STATIC_CHECK(91, 7) +#if CONFIG_SOC_FLASH_NRF_UICR && IS_ENABLED(NRF91_ERRATA_7_ENABLE_WORKAROUND) static inline void nrf91_errata_7_enter(void) { __disable_irq(); @@ -163,7 +164,7 @@ static int flash_nrf_read(const struct device *dev, off_t addr, return 0; } -#if CONFIG_SOC_FLASH_NRF_UICR && NRF_ERRATA_STATIC_CHECK(91, 7) +#if CONFIG_SOC_FLASH_NRF_UICR && IS_ENABLED(NRF91_ERRATA_7_ENABLE_WORKAROUND) if (within_uicr) { nrf_buffer_read_91_uicr(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_mramc.c b/drivers/flash/soc_flash_nrf_mramc.c index bfc0980816ba..7e3a88af2b23 100644 --- a/drivers/flash/soc_flash_nrf_mramc.c +++ b/drivers/flash/soc_flash_nrf_mramc.c @@ -186,11 +186,11 @@ static int mramc_sys_init(const struct device *dev) ARG_UNUSED(dev); nrfx_mramc_config_t config = NRFX_MRAMC_DEFAULT_CONFIG(); - int ret = nrfx_mramc_init(&config, NULL); + nrfx_err_t err = nrfx_mramc_init(&config, NULL); - if (ret != 0) { - LOG_ERR("Failed to initialize MRAMC: %d", ret); - return ret; + if (err != NRFX_SUCCESS) { + LOG_ERR("Failed to initialize MRAMC: %d", err); + return -EIO; } LOG_DBG("MRAMC initialized successfully"); return 0; diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index 5661aeafe2f1..fcf0b2f8d27c 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -7,10 +7,8 @@ #define DT_DRV_COMPAT nordic_nrf_gpio #include -#include #include #include -#include #include #include #include @@ -47,9 +45,9 @@ struct gpio_nrfx_cfg { /* gpio_driver_config needs to be first */ struct gpio_driver_config common; NRF_GPIO_Type *port; - nrfx_gpiote_t *gpiote; uint32_t edge_sense; uint8_t port_num; + nrfx_gpiote_t gpiote; #if defined(GPIOTE_FEATURE_FLAG) uint32_t flags; #endif @@ -65,16 +63,9 @@ static inline const struct gpio_nrfx_cfg *get_port_cfg(const struct device *port return port->config; } -void *gpio_nrf_gpiote_by_port_get(const struct device *port) -{ - const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); - - return cfg->gpiote; -} - static bool has_gpiote(const struct gpio_nrfx_cfg *cfg) { - return cfg->gpiote != NULL; + return cfg->gpiote.p_reg != NULL; } #if NRF_GPIO_HAS_RETENTION_SETCLEAR @@ -120,7 +111,7 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, gpio_flags_t flags) { int ret = 0; - int err = 0; + nrfx_err_t err = NRFX_SUCCESS; uint8_t ch; bool free_ch = false; const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); @@ -182,13 +173,13 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, * to be freed when the pin is reconfigured or disconnected. */ if (IS_ENABLED(CONFIG_GPIO_NRFX_INTERRUPT)) { - err = nrfx_gpiote_channel_get(cfg->gpiote, abs_pin, &ch); - free_ch = (err == 0); + err = nrfx_gpiote_channel_get(&cfg->gpiote, abs_pin, &ch); + free_ch = (err == NRFX_SUCCESS); } if ((flags & (GPIO_INPUT | GPIO_OUTPUT)) == GPIO_DISCONNECTED) { /* Ignore the error code. The pin may not have been used. */ - (void)nrfx_gpiote_pin_uninit(cfg->gpiote, abs_pin); + (void)nrfx_gpiote_pin_uninit(&cfg->gpiote, abs_pin); } else { /* Remove previously configured trigger when pin is reconfigured. */ if (IS_ENABLED(CONFIG_GPIO_NRFX_INTERRUPT)) { @@ -199,9 +190,11 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, .p_trigger_config = &trigger_config, }; - err = nrfx_gpiote_input_configure(cfg->gpiote, + err = nrfx_gpiote_input_configure(&cfg->gpiote, abs_pin, &input_pin_config); - if (err < 0) { + if (err != NRFX_SUCCESS) { + ret = -EINVAL; + goto end; } } @@ -215,7 +208,7 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, .pull = pull, }; - err = nrfx_gpiote_output_configure(cfg->gpiote, + err = nrfx_gpiote_output_configure(&cfg->gpiote, abs_pin, &output_config, NULL); port_retain_set(cfg, BIT(pin)); @@ -224,11 +217,12 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, .p_pull_config = &pull, }; - err = nrfx_gpiote_input_configure(cfg->gpiote, + err = nrfx_gpiote_input_configure(&cfg->gpiote, abs_pin, &input_pin_config); } - if (err < 0) { + if (err != NRFX_SUCCESS) { + ret = -EINVAL; goto end; } } @@ -240,8 +234,8 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, goto end; } #endif - err = nrfx_gpiote_channel_free(cfg->gpiote, ch); - __ASSERT_NO_MSG(err == 0); + err = nrfx_gpiote_channel_free(&cfg->gpiote, ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); } end: @@ -397,7 +391,7 @@ static nrfx_gpiote_trigger_t get_trigger(enum gpio_int_mode mode, NRFX_GPIOTE_TRIGGER_LOTOHI; } -static int chan_alloc(const struct gpio_nrfx_cfg *cfg, gpio_pin_t pin, uint8_t *ch) +static nrfx_err_t chan_alloc(const struct gpio_nrfx_cfg *cfg, gpio_pin_t pin, uint8_t *ch) { #ifdef GPIOTE_FEATURE_FLAG if (cfg->flags & GPIOTE_FLAG_FIXED_CHAN) { @@ -407,25 +401,25 @@ static int chan_alloc(const struct gpio_nrfx_cfg *cfg, gpio_pin_t pin, uint8_t * * - P1: channel => pin - 4, e.g. P1.4 => channel 0, P1.5 => channel 1 * - P2: channel => pin % 8, e.g. P2.0 => channel 0, P2.8 => channel 0 */ - int err = 0; + nrfx_err_t err = NRFX_SUCCESS; if (cfg->port_num == 1) { if (pin < 4) { - err = -EINVAL; + err = NRFX_ERROR_INVALID_PARAM; } else { *ch = pin - 4; } } else if (cfg->port_num == 2) { *ch = pin & 0x7; } else { - err = -EINVAL; + err = NRFX_ERROR_INVALID_PARAM; } return err; } #endif - return nrfx_gpiote_channel_alloc(cfg->gpiote, ch); + return nrfx_gpiote_channel_alloc(&cfg->gpiote, ch); } static int gpio_nrfx_pin_interrupt_configure(const struct device *port, @@ -435,7 +429,7 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, { const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); uint32_t abs_pin = NRF_GPIO_PIN_MAP(cfg->port_num, pin); - int err; + nrfx_err_t err; uint8_t ch; if (!has_gpiote(cfg)) { @@ -443,7 +437,7 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, } if (mode == GPIO_INT_MODE_DISABLED) { - nrfx_gpiote_trigger_disable(cfg->gpiote, abs_pin); + nrfx_gpiote_trigger_disable(&cfg->gpiote, abs_pin); return 0; } @@ -461,11 +455,11 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, if (!(BIT(pin) & cfg->edge_sense) && (mode == GPIO_INT_MODE_EDGE) && (nrf_gpio_pin_dir_get(abs_pin) == NRF_GPIO_PIN_DIR_INPUT)) { - err = nrfx_gpiote_channel_get(cfg->gpiote, abs_pin, &ch); - if (err == -EINVAL) { + err = nrfx_gpiote_channel_get(&cfg->gpiote, abs_pin, &ch); + if (err == NRFX_ERROR_INVALID_PARAM) { err = chan_alloc(cfg, pin, &ch); - if (err < 0) { - return err; + if (err != NRFX_SUCCESS) { + return -ENOMEM; } } @@ -479,19 +473,19 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, /* If edge mode with channel was previously used and we are changing to sense or * level triggered, we must free the channel. */ - err = nrfx_gpiote_channel_get(cfg->gpiote, abs_pin, &ch); - if (err == 0) { - err = nrfx_gpiote_channel_free(cfg->gpiote, ch); - __ASSERT_NO_MSG(err == 0); + err = nrfx_gpiote_channel_get(&cfg->gpiote, abs_pin, &ch); + if (err == NRFX_SUCCESS) { + err = nrfx_gpiote_channel_free(&cfg->gpiote, ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); } } - err = nrfx_gpiote_input_configure(cfg->gpiote, abs_pin, &input_pin_config); - if (err < 0) { - return err; + err = nrfx_gpiote_input_configure(&cfg->gpiote, abs_pin, &input_pin_config); + if (err != NRFX_SUCCESS) { + return -EINVAL; } - nrfx_gpiote_trigger_enable(cfg->gpiote, abs_pin, true); + nrfx_gpiote_trigger_enable(&cfg->gpiote, abs_pin, true); return 0; } @@ -580,26 +574,9 @@ static void nrfx_gpio_handler(nrfx_gpiote_pin_t abs_pin, } #endif /* CONFIG_GPIO_NRFX_INTERRUPT */ -#ifdef CONFIG_GPIO_NRFX_INTERRUPT -/* Wrap nrfx IRQ handler to make native builds happy, as providing nrfx IRQ handler - * directly in IRQ_CONNECT causes complaints about mismatched types. - * Casting brings similar effect, however clashes with IRQ_CONNECT macro implementation - * for non-native builds. - */ -void gpio_nrfx_gpiote_irq_handler(void const *param) -{ - nrfx_gpiote_t *gpiote = (nrfx_gpiote_t *)param; - - nrfx_gpiote_irq_handler(gpiote); -} -#endif - -#define GPIOTE_IRQ_HANDLER_CONNECT(node_id) \ - IRQ_CONNECT(DT_IRQN(node_id), \ - DT_IRQ(node_id, priority), \ - gpio_nrfx_gpiote_irq_handler, \ - &GPIOTE_NRFX_INST_BY_NODE(node_id), \ - 0); +#define GPIOTE_IRQ_HANDLER_CONNECT(node_id) \ + IRQ_CONNECT(DT_IRQN(node_id), DT_IRQ(node_id, priority), nrfx_isr, \ + NRFX_CONCAT(nrfx_gpiote_, DT_PROP(node_id, instance), _irq_handler), 0); static int gpio_nrfx_pm_hook(const struct device *port, enum pm_device_action action) { @@ -611,23 +588,23 @@ static int gpio_nrfx_pm_hook(const struct device *port, enum pm_device_action ac static int gpio_nrfx_init(const struct device *port) { const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); - int err; + nrfx_err_t err; if (!has_gpiote(cfg)) { goto pm_init; } - if (nrfx_gpiote_init_check(cfg->gpiote)) { + if (nrfx_gpiote_init_check(&cfg->gpiote)) { goto pm_init; } - err = nrfx_gpiote_init(cfg->gpiote, 0 /*not used*/); - if (err != 0) { + err = nrfx_gpiote_init(&cfg->gpiote, 0 /*not used*/); + if (err != NRFX_SUCCESS) { return -EIO; } #ifdef CONFIG_GPIO_NRFX_INTERRUPT - nrfx_gpiote_global_callback_set(cfg->gpiote, nrfx_gpio_handler, NULL); + nrfx_gpiote_global_callback_set(&cfg->gpiote, nrfx_gpio_handler, NULL); DT_FOREACH_STATUS_OKAY(nordic_nrf_gpiote, GPIOTE_IRQ_HANDLER_CONNECT); #endif /* CONFIG_GPIO_NRFX_INTERRUPT */ @@ -654,36 +631,35 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { #endif }; +#define GPIOTE_INST(id) DT_PROP(GPIOTE_PHANDLE(id), instance) + +#define GPIOTE_INSTANCE(id) \ + COND_CODE_1(DT_INST_NODE_HAS_PROP(id, gpiote_instance), \ + (NRFX_GPIOTE_INSTANCE(GPIOTE_INST(id))), \ + ({ .p_reg = NULL })) + /* Device instantiation is done with node labels because 'port_num' is * the peripheral number by SoC numbering. We therefore cannot use * DT_INST APIs here without wider changes. */ -#define HAS_GPIOTE(id) DT_INST_NODE_HAS_PROP(id, gpiote_instance) - #define GPIOTE_CHECK(id) \ - COND_CODE_1(HAS_GPIOTE(id), \ - (BUILD_ASSERT(DT_NODE_HAS_STATUS_OKAY(GPIOTE_PHANDLE(id)), \ + COND_CODE_1(DT_INST_NODE_HAS_PROP(id, gpiote_instance), \ + (BUILD_ASSERT(DT_NODE_HAS_STATUS_OKAY(GPIOTE_PHANDLE(id)), \ "Please enable GPIOTE instance for used GPIO port!")), \ ()) -#define GPIOTE_REF(id) \ - COND_CODE_1(HAS_GPIOTE(id), \ - (&GPIOTE_NRFX_INST_BY_NODE(GPIOTE_PHANDLE(id))), \ - (NULL)) - #define GPIO_NRF_DEVICE(id) \ GPIOTE_CHECK(id); \ - static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \ static const struct gpio_nrfx_cfg gpio_nrfx_p##id##_cfg = { \ .common = { \ .port_pin_mask = \ GPIO_PORT_PIN_MASK_FROM_DT_INST(id), \ }, \ .port = _CONCAT(NRF_P, DT_INST_PROP(id, port)), \ - .gpiote = GPIOTE_REF(id), \ - .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ .port_num = DT_INST_PROP(id, port), \ + .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ + .gpiote = GPIOTE_INSTANCE(id), \ IF_ENABLED(GPIOTE_FEATURE_FLAG, \ (.flags = \ (DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) ? \ @@ -693,6 +669,8 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { ) \ }; \ \ + static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \ + \ PM_DEVICE_DT_INST_DEFINE(id, gpio_nrfx_pm_hook); \ \ DEVICE_DT_INST_DEFINE(id, gpio_nrfx_init, \ diff --git a/drivers/i2c/Kconfig.nrfx b/drivers/i2c/Kconfig.nrfx index c6a7dbeadcf7..54d533636747 100644 --- a/drivers/i2c/Kconfig.nrfx +++ b/drivers/i2c/Kconfig.nrfx @@ -23,7 +23,25 @@ config I2C_NRFX_TWI config I2C_NRFX_TWIM def_bool y depends on DT_HAS_NORDIC_NRF_TWIM_ENABLED - select NRFX_TWIM + select NRFX_TWIM0 if HAS_HW_NRF_TWIM0 + select NRFX_TWIM1 if HAS_HW_NRF_TWIM1 + select NRFX_TWIM2 if HAS_HW_NRF_TWIM2 + select NRFX_TWIM3 if HAS_HW_NRF_TWIM3 + select NRFX_TWIM20 if HAS_HW_NRF_TWIM20 + select NRFX_TWIM21 if HAS_HW_NRF_TWIM21 + select NRFX_TWIM22 if HAS_HW_NRF_TWIM22 + select NRFX_TWIM23 if HAS_HW_NRF_TWIM23 + select NRFX_TWIM24 if HAS_HW_NRF_TWIM24 + select NRFX_TWIM30 if HAS_HW_NRF_TWIM30 + select NRFX_TWIM120 if HAS_HW_NRF_TWIM120 + select NRFX_TWIM130 if HAS_HW_NRF_TWIM130 + select NRFX_TWIM131 if HAS_HW_NRF_TWIM131 + select NRFX_TWIM132 if HAS_HW_NRF_TWIM132 + select NRFX_TWIM133 if HAS_HW_NRF_TWIM133 + select NRFX_TWIM134 if HAS_HW_NRF_TWIM134 + select NRFX_TWIM135 if HAS_HW_NRF_TWIM135 + select NRFX_TWIM136 if HAS_HW_NRF_TWIM136 + select NRFX_TWIM137 if HAS_HW_NRF_TWIM137 config I2C_NRFX_TRANSFER_TIMEOUT int "Transfer timeout [ms]" @@ -38,7 +56,23 @@ config I2C_NRFX_TWIS depends on DT_HAS_NORDIC_NRF_TWIS_ENABLED depends on I2C_TARGET depends on I2C_TARGET_BUFFER_MODE - select NRFX_TWIS + select NRFX_TWIS0 if HAS_HW_NRF_TWIS0 + select NRFX_TWIS1 if HAS_HW_NRF_TWIS1 + select NRFX_TWIS2 if HAS_HW_NRF_TWIS2 + select NRFX_TWIS3 if HAS_HW_NRF_TWIS3 + select NRFX_TWIS20 if HAS_HW_NRF_TWIS20 + select NRFX_TWIS21 if HAS_HW_NRF_TWIS21 + select NRFX_TWIS22 if HAS_HW_NRF_TWIS22 + select NRFX_TWIS23 if HAS_HW_NRF_TWIS23 + select NRFX_TWIS24 if HAS_HW_NRF_TWIS24 + select NRFX_TWIS30 if HAS_HW_NRF_TWIS30 + select NRFX_TWIS130 if HAS_HW_NRF_TWIS130 + select NRFX_TWIS131 if HAS_HW_NRF_TWIS131 + select NRFX_TWIS133 if HAS_HW_NRF_TWIS133 + select NRFX_TWIS134 if HAS_HW_NRF_TWIS134 + select NRFX_TWIS135 if HAS_HW_NRF_TWIS135 + select NRFX_TWIS136 if HAS_HW_NRF_TWIS136 + select NRFX_TWIS137 if HAS_HW_NRF_TWIS137 if I2C_NRFX_TWIS diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c index a28ec6f08a05..c2c0a28d8756 100644 --- a/drivers/i2c/i2c_nrfx_twi.c +++ b/drivers/i2c/i2c_nrfx_twi.c @@ -27,7 +27,7 @@ struct i2c_nrfx_twi_data { uint32_t dev_config; struct k_sem transfer_sync; struct k_sem completion_sync; - volatile int res; + volatile nrfx_err_t res; }; /* Enforce dev_config matches the same offset as the common structure, @@ -109,16 +109,16 @@ static void event_handler(nrfx_twi_evt_t const *p_event, void *p_context) switch (p_event->type) { case NRFX_TWI_EVT_DONE: - dev_data->res = 0; + dev_data->res = NRFX_SUCCESS; break; case NRFX_TWI_EVT_ADDRESS_NACK: - dev_data->res = -EIO; + dev_data->res = NRFX_ERROR_DRV_TWI_ERR_ANACK; break; case NRFX_TWI_EVT_DATA_NACK: - dev_data->res = -EAGAIN; + dev_data->res = NRFX_ERROR_DRV_TWI_ERR_DNACK; break; default: - dev_data->res = -ECANCELED; + dev_data->res = NRFX_ERROR_INTERNAL; break; } @@ -131,40 +131,49 @@ static DEVICE_API(i2c, i2c_nrfx_twi_driver_api) = { .recover_bus = i2c_nrfx_twi_recover_bus, }; -#define I2C_NRFX_TWI_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(I2C(idx)) != I2C_NRFX_TWI_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static int twi_##idx##_init(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ - nrfx_twi_##idx##_irq_handler, 0); \ - const struct i2c_nrfx_twi_config *config = dev->config; \ - int err = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - return i2c_nrfx_twi_init(dev); \ - } \ - static struct i2c_nrfx_twi_data twi_##idx##_data = { \ - .transfer_sync = Z_SEM_INITIALIZER(twi_##idx##_data.transfer_sync, 1, 1), \ - .completion_sync = Z_SEM_INITIALIZER(twi_##idx##_data.completion_sync, 0, 1)}; \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ - .twi = NRFX_TWI_INSTANCE(idx), \ - .config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(I2C(idx)), \ - }, \ - .event_handler = event_handler, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ - }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \ - I2C_DEVICE_DT_DEFINE(I2C(idx), twi_##idx##_init, PM_DEVICE_DT_GET(I2C(idx)), \ - &twi_##idx##_data, &twi_##idx##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twi_driver_api) +#define I2C_NRFX_TWI_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(idx) != \ + I2C_NRFX_TWI_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static int twi_##idx##_init(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ + nrfx_isr, nrfx_twi_##idx##_irq_handler, 0); \ + const struct i2c_nrfx_twi_config *config = dev->config; \ + int err = pinctrl_apply_state(config->pcfg, \ + PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + return i2c_nrfx_twi_init(dev); \ + } \ + static struct i2c_nrfx_twi_data twi_##idx##_data = { \ + .transfer_sync = Z_SEM_INITIALIZER( \ + twi_##idx##_data.transfer_sync, 1, 1), \ + .completion_sync = Z_SEM_INITIALIZER( \ + twi_##idx##_data.completion_sync, 0, 1) \ + }; \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ + .twi = NRFX_TWI_INSTANCE(idx), \ + .config = { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + }; \ + PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \ + I2C_DEVICE_DT_DEFINE(I2C(idx), \ + twi_##idx##_init, \ + PM_DEVICE_DT_GET(I2C(idx)), \ + &twi_##idx##_data, \ + &twi_##idx##z_config, \ + POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, \ + &i2c_nrfx_twi_driver_api) #ifdef CONFIG_HAS_HW_NRF_TWI0 I2C_NRFX_TWI_DEVICE(0); diff --git a/drivers/i2c/i2c_nrfx_twi_common.c b/drivers/i2c/i2c_nrfx_twi_common.c index 2d07863e3d73..0d8bda63425f 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.c +++ b/drivers/i2c/i2c_nrfx_twi_common.c @@ -16,12 +16,12 @@ LOG_MODULE_DECLARE(i2c_nrfx_twi); int i2c_nrfx_twi_init(const struct device *dev) { const struct i2c_nrfx_twi_config *config = dev->config; - int result = nrfx_twi_init(&config->twi, &config->config, - config->event_handler, (void *)dev); - if (result != 0) { + nrfx_err_t result = nrfx_twi_init(&config->twi, &config->config, + config->event_handler, (void *)dev); + if (result != NRFX_SUCCESS) { LOG_ERR("Failed to initialize device: %s", dev->name); - return result; + return -EBUSY; } return 0; @@ -58,11 +58,13 @@ int i2c_nrfx_twi_recover_bus(const struct device *dev) const struct i2c_nrfx_twi_config *config = dev->config; uint32_t scl_pin; uint32_t sda_pin; + nrfx_err_t err; scl_pin = nrf_twi_scl_pin_get(config->twi.p_twi); sda_pin = nrf_twi_sda_pin_get(config->twi.p_twi); - return nrfx_twi_bus_recover(scl_pin, sda_pin); + err = nrfx_twi_bus_recover(scl_pin, sda_pin); + return (err == NRFX_SUCCESS ? 0 : -EBUSY); } int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, @@ -72,6 +74,7 @@ int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, const struct i2c_nrfx_twi_config *config = dev->config; int ret = 0; uint32_t xfer_flags = 0; + nrfx_err_t res; nrfx_twi_xfer_desc_t cur_xfer = { .p_primary_buf = buf, .primary_length = buf_len, @@ -107,7 +110,17 @@ int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, } if (!ret) { - ret = nrfx_twi_xfer(&config->twi, &cur_xfer, xfer_flags); + res = nrfx_twi_xfer(&config->twi, &cur_xfer, xfer_flags); + switch (res) { + case NRFX_SUCCESS: + break; + case NRFX_ERROR_BUSY: + ret = -EBUSY; + break; + default: + ret = -EIO; + break; + } } return ret; diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index 8eee1949bdf4..bc26bf841124 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -29,10 +29,9 @@ LOG_MODULE_REGISTER(i2c_nrfx_twim, CONFIG_I2C_LOG_LEVEL); #endif struct i2c_nrfx_twim_data { - nrfx_twim_t twim; struct k_sem transfer_sync; struct k_sem completion_sync; - volatile int res; + volatile nrfx_err_t res; }; int i2c_nrfx_twim_exclusive_access_acquire(const struct device *dev, k_timeout_t timeout) @@ -82,7 +81,7 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, break; } - bool dma_accessible = nrf_dma_accessible_check(&dev_data->twim, msgs[i].buf); + bool dma_accessible = nrf_dma_accessible_check(&dev_config->twim, msgs[i].buf); /* This fragment needs to be merged with the next one if: * - it is not the last fragment @@ -163,7 +162,7 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, break; } - if (dev_data->res < 0) { + if (dev_data->res != NRFX_SUCCESS) { ret = -EIO; break; } @@ -192,23 +191,23 @@ static int i2c_nrfx_twim_transfer(const struct device *dev, return ret; } -static void event_handler(nrfx_twim_event_t const *p_event, void *p_context) +static void event_handler(nrfx_twim_evt_t const *p_event, void *p_context) { const struct device *dev = p_context; struct i2c_nrfx_twim_data *dev_data = dev->data; switch (p_event->type) { case NRFX_TWIM_EVT_DONE: - dev_data->res = 0; + dev_data->res = NRFX_SUCCESS; break; case NRFX_TWIM_EVT_ADDRESS_NACK: - dev_data->res = -EFAULT; + dev_data->res = NRFX_ERROR_DRV_TWI_ERR_ANACK; break; case NRFX_TWIM_EVT_DATA_NACK: - dev_data->res = -EAGAIN; + dev_data->res = NRFX_ERROR_DRV_TWI_ERR_DNACK; break; default: - dev_data->res = -EIO; + dev_data->res = NRFX_ERROR_INTERNAL; break; } @@ -239,66 +238,142 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { .recover_bus = i2c_nrfx_twim_recover_bus, }; -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_twim) -#define DT_DRV_COMPAT nordic_nrf_twim -#endif - -#define CONCAT_BUF_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_concat_buf_size), \ - (DT_INST_PROP(idx, zephyr_concat_buf_size)), (0)) -#define FLASH_BUF_MAX_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_flash_buf_max_size), \ - (DT_INST_PROP(idx, zephyr_flash_buf_max_size)), (0)) +#define CONCAT_BUF_SIZE(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_concat_buf_size), \ + (DT_PROP(I2C(idx), zephyr_concat_buf_size)), (0)) +#define FLASH_BUF_MAX_SIZE(idx) \ + COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_flash_buf_max_size), \ + (DT_PROP(I2C(idx), zephyr_flash_buf_max_size)), (0)) -#define USES_MSG_BUF(idx) \ - COND_CODE_0(CONCAT_BUF_SIZE(idx), \ - (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), \ +#define USES_MSG_BUF(idx) \ + COND_CODE_0(CONCAT_BUF_SIZE(idx), \ + (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), \ (1)) #define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) -#define I2C_NRFX_TWIM_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static struct i2c_nrfx_twim_data twim_##idx##_data; \ - static struct i2c_nrfx_twim_common_config twim_##idx##z_config; \ - static void pre_init##idx(void) \ - { \ - twim_##idx##z_config.twim = &twim_##idx##_data.twim; \ - twim_##idx##_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \ - IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \ - &twim_##idx##_data.twim, 0); \ - } \ +#define I2C_NRFX_TWIM_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(idx) != \ + I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ + nrfx_isr, nrfx_twim_##idx##_irq_handler, 0); \ + } \ IF_ENABLED(USES_MSG_BUF(idx), \ (static uint8_t twim_##idx##_msg_buf[MSG_BUF_SIZE(idx)] \ - I2C_MEMORY_SECTION(idx);)) \ - PINCTRL_DT_INST_DEFINE(idx); \ - static struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ - .twim_config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .pre_init = pre_init##idx, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ + I2C_MEMORY_SECTION(idx);)) \ + static struct i2c_nrfx_twim_data twim_##idx##_data; \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static const \ + struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ + .twim = NRFX_TWIM_INSTANCE(idx), \ + .twim_config = { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ IF_ENABLED(USES_MSG_BUF(idx), \ - (.msg_buf = twim_##idx##_msg_buf,)) .max_transfer_size = \ - BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)), \ - }; \ - PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ - I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_init, i2c_nrfx_twim_deinit, \ - PM_DEVICE_DT_INST_GET(idx), &twim_##idx##_data, \ - &twim_##idx##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api) - -#define I2C_MEMORY_SECTION(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions), \ + (.msg_buf = twim_##idx##_msg_buf,)) \ + .max_transfer_size = BIT_MASK( \ + DT_PROP(I2C(idx), easydma_maxcnt_bits)), \ + }; \ + PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \ + I2C_PM_ISR_SAFE(idx)); \ + I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \ + i2c_nrfx_twim_init, \ + i2c_nrfx_twim_deinit, \ + PM_DEVICE_DT_GET(I2C(idx)), \ + &twim_##idx##_data, \ + &twim_##idx##z_config, \ + POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, \ + &i2c_nrfx_twim_driver_api) + +#define I2C_MEMORY_SECTION(idx) \ + COND_CODE_1(I2C_HAS_PROP(idx, memory_regions), \ (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ - DT_PHANDLE(DT_DRV_INST(idx), memory_regions)))))), \ + DT_PHANDLE(I2C(idx), memory_regions)))))), \ ()) -DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWIM_DEVICE) +#ifdef CONFIG_HAS_HW_NRF_TWIM0 +I2C_NRFX_TWIM_DEVICE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM1 +I2C_NRFX_TWIM_DEVICE(1); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM2 +I2C_NRFX_TWIM_DEVICE(2); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM3 +I2C_NRFX_TWIM_DEVICE(3); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM20 +I2C_NRFX_TWIM_DEVICE(20); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM21 +I2C_NRFX_TWIM_DEVICE(21); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM22 +I2C_NRFX_TWIM_DEVICE(22); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM23 +I2C_NRFX_TWIM_DEVICE(23); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM24 +I2C_NRFX_TWIM_DEVICE(24); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM30 +I2C_NRFX_TWIM_DEVICE(30); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM120 +I2C_NRFX_TWIM_DEVICE(120); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM130 +I2C_NRFX_TWIM_DEVICE(130); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM131 +I2C_NRFX_TWIM_DEVICE(131); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM132 +I2C_NRFX_TWIM_DEVICE(132); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM133 +I2C_NRFX_TWIM_DEVICE(133); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM134 +I2C_NRFX_TWIM_DEVICE(134); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM135 +I2C_NRFX_TWIM_DEVICE(135); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM136 +I2C_NRFX_TWIM_DEVICE(136); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM137 +I2C_NRFX_TWIM_DEVICE(137); +#endif diff --git a/drivers/i2c/i2c_nrfx_twim_common.c b/drivers/i2c/i2c_nrfx_twim_common.c index 7e8dda45c9af..f7fd0d097b0a 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.c +++ b/drivers/i2c/i2c_nrfx_twim_common.c @@ -20,15 +20,15 @@ int i2c_nrfx_twim_recover_bus(const struct device *dev) enum pm_device_state state; uint32_t scl_pin; uint32_t sda_pin; - int err; + nrfx_err_t err; - scl_pin = nrf_twim_scl_pin_get(config->twim->p_twim); - sda_pin = nrf_twim_sda_pin_get(config->twim->p_twim); + scl_pin = nrf_twim_scl_pin_get(config->twim.p_twim); + sda_pin = nrf_twim_sda_pin_get(config->twim.p_twim); /* disable peripheral if active (required to release SCL/SDA lines) */ (void)pm_device_state_get(dev, &state); if (state == PM_DEVICE_STATE_ACTIVE) { - nrfx_twim_disable(config->twim); + nrfx_twim_disable(&config->twim); } err = nrfx_twim_bus_recover(scl_pin, sda_pin); @@ -36,10 +36,10 @@ int i2c_nrfx_twim_recover_bus(const struct device *dev) /* restore peripheral if it was active before */ if (state == PM_DEVICE_STATE_ACTIVE) { (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); - nrfx_twim_enable(config->twim); + nrfx_twim_enable(&config->twim); } - return err; + return (err == NRFX_SUCCESS ? 0 : -EBUSY); } int i2c_nrfx_twim_configure(const struct device *dev, uint32_t i2c_config) @@ -52,14 +52,14 @@ int i2c_nrfx_twim_configure(const struct device *dev, uint32_t i2c_config) switch (I2C_SPEED_GET(i2c_config)) { case I2C_SPEED_STANDARD: - nrf_twim_frequency_set(config->twim->p_twim, NRF_TWIM_FREQ_100K); + nrf_twim_frequency_set(config->twim.p_twim, NRF_TWIM_FREQ_100K); break; case I2C_SPEED_FAST: - nrf_twim_frequency_set(config->twim->p_twim, NRF_TWIM_FREQ_400K); + nrf_twim_frequency_set(config->twim.p_twim, NRF_TWIM_FREQ_400K); break; #if NRF_TWIM_HAS_1000_KHZ_FREQ case I2C_SPEED_FAST_PLUS: - nrf_twim_frequency_set(config->twim->p_twim, NRF_TWIM_FREQ_1000K); + nrf_twim_frequency_set(config->twim.p_twim, NRF_TWIM_FREQ_1000K); break; #endif default: @@ -80,6 +80,8 @@ int i2c_nrfx_twim_msg_transfer(const struct device *dev, uint8_t flags, uint8_t .p_primary_buf = buf, .primary_length = buf_len, }; + nrfx_err_t res; + int ret = 0; if (buf_len > config->max_transfer_size) { LOG_ERR("Trying to transfer more than the maximum size " @@ -88,8 +90,16 @@ int i2c_nrfx_twim_msg_transfer(const struct device *dev, uint8_t flags, uint8_t return -ENOSPC; } - return nrfx_twim_xfer(config->twim, &cur_xfer, - (flags & I2C_MSG_STOP) ? 0 : NRFX_TWIM_FLAG_TX_NO_STOP); + res = nrfx_twim_xfer(&config->twim, &cur_xfer, + (flags & I2C_MSG_STOP) ? 0 : NRFX_TWIM_FLAG_TX_NO_STOP); + if (res != NRFX_SUCCESS) { + if (res == NRFX_ERROR_BUSY) { + ret = -EBUSY; + } else { + ret = -EIO; + } + } + return ret; } void twim_nrfx_pm_resume(const struct device *dev) @@ -97,14 +107,14 @@ void twim_nrfx_pm_resume(const struct device *dev) const struct i2c_nrfx_twim_common_config *config = dev->config; (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); - nrfx_twim_enable(config->twim); + nrfx_twim_enable(&config->twim); } void twim_nrfx_pm_suspend(const struct device *dev) { const struct i2c_nrfx_twim_common_config *config = dev->config; - nrfx_twim_disable(config->twim); + nrfx_twim_disable(&config->twim); (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); } @@ -128,12 +138,12 @@ int i2c_nrfx_twim_common_init(const struct device *dev) { const struct i2c_nrfx_twim_common_config *config = dev->config; - config->pre_init(); + config->irq_connect(); (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); - if (nrfx_twim_init(config->twim, &config->twim_config, config->event_handler, (void *)dev) < - 0) { + if (nrfx_twim_init(&config->twim, &config->twim_config, config->event_handler, + (void *)dev) != NRFX_SUCCESS) { LOG_ERR("Failed to initialize device: %s", dev->name); return -EIO; } @@ -165,6 +175,6 @@ int i2c_nrfx_twim_common_deinit(const struct device *dev) #endif /* Uninit device hardware */ - nrfx_twim_uninit(config->twim); + nrfx_twim_uninit(&config->twim); return 0; } diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index c51932af5fd3..d476ba3f05ff 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -28,8 +28,8 @@ extern "C" { #define I2C(idx) DT_NODELABEL(i2c##idx) #define I2C_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(I2C(idx), prop) -#define I2C_FREQUENCY(node) \ - I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(node, clock_frequency, I2C_BITRATE_STANDARD)) +#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ + I2C_BITRATE_STANDARD)) /* Macro determines PM actions interrupt safety level. * @@ -38,14 +38,13 @@ extern "C" { * no longer ISR safe. This macro let's us check if we will be requesting/releasing * power domains and determines PM device ISR safety value. */ -#define I2C_PM_ISR_SAFE(idx) \ +#define I2C_PM_ISR_SAFE(idx) \ COND_CODE_1( \ UTIL_AND( \ IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ UTIL_AND( \ - DT_NODE_HAS_PROP(DT_DRV_INST(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(DT_DRV_INST(idx), \ - power_domains)) \ + DT_NODE_HAS_PROP(I2C(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(I2C(idx), power_domains)) \ ) \ ), \ (0), \ @@ -53,14 +52,14 @@ extern "C" { ) struct i2c_nrfx_twim_common_config { + nrfx_twim_t twim; nrfx_twim_config_t twim_config; - nrfx_twim_event_handler_t event_handler; + nrfx_twim_evt_handler_t event_handler; uint16_t msg_buf_size; - void (*pre_init)(void); + void (*irq_connect)(void); const struct pinctrl_dev_config *pcfg; uint8_t *msg_buf; uint16_t max_transfer_size; - nrfx_twim_t *twim; }; int i2c_nrfx_twim_common_init(const struct device *dev); diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 872c5859bd91..7326deaafb03 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -21,15 +21,12 @@ LOG_MODULE_REGISTER(i2c_nrfx_twim, CONFIG_I2C_LOG_LEVEL); -#define DT_DRV_COMPAT nordic_nrf_twim - struct i2c_nrfx_twim_rtio_config { struct i2c_nrfx_twim_common_config common; struct i2c_rtio *ctx; }; struct i2c_nrfx_twim_rtio_data { - nrfx_twim_t twim; uint8_t *user_rx_buf; uint16_t user_rx_buf_size; }; @@ -185,7 +182,7 @@ static void i2c_nrfx_twim_rtio_submit(const struct device *dev, struct rtio_iode } } -static void event_handler(nrfx_twim_event_t const *p_event, void *p_context) +static void event_handler(nrfx_twim_evt_t const *p_event, void *p_context) { const struct device *dev = p_context; const struct i2c_nrfx_twim_rtio_config *config = dev->config; @@ -220,20 +217,21 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) } #define CONCAT_BUF_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_concat_buf_size), \ - (DT_INST_PROP(idx, zephyr_concat_buf_size)), (0)) + COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_concat_buf_size), \ + (DT_PROP(I2C(idx), zephyr_concat_buf_size)), (0)) #define FLASH_BUF_MAX_SIZE(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(idx), zephyr_flash_buf_max_size), \ - (DT_INST_PROP(idx, zephyr_flash_buf_max_size)), (0)) + COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_flash_buf_max_size), \ + (DT_PROP(I2C(idx), zephyr_flash_buf_max_size)), (0)) #define USES_MSG_BUF(idx) \ COND_CODE_0(CONCAT_BUF_SIZE(idx), (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), (1)) #define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) -#define MSG_BUF_HAS_MEMORY_REGIONS(idx) DT_NODE_HAS_PROP(DT_DRV_INST(idx), memory_regions) +#define MSG_BUF_HAS_MEMORY_REGIONS(idx) \ + DT_NODE_HAS_PROP(I2C(idx), memory_regions) -#define MSG_BUF_LINKER_REGION_NAME(idx) \ - LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(DT_DRV_INST(idx), memory_regions)) +#define MSG_BUF_LINKER_REGION_NAME(idx) \ + LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(I2C(idx), memory_regions)) #define MSG_BUF_ATTR_SECTION(idx) \ __attribute__((__section__(MSG_BUF_LINKER_REGION_NAME(idx)))) @@ -251,53 +249,122 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) #define MSG_BUF_DEFINE(idx) \ static uint8_t MSG_BUF_SYM(idx)[MSG_BUF_SIZE(idx)] MSG_BUF_ATTR(idx) -#define MAX_TRANSFER_SIZE(idx) BIT_MASK(DT_INST_PROP(idx, easydma_maxcnt_bits)) +#define MAX_TRANSFER_SIZE(idx) \ + BIT_MASK(DT_PROP(I2C(idx), easydma_maxcnt_bits)) #define I2C_NRFX_TWIM_RTIO_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(idx) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ "Wrong I2C " #idx " frequency setting in dts"); \ - static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data = { \ - .twim = \ - { \ - .p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx), \ - }, \ - }; \ - static void pre_init##idx(void) \ + static void irq_connect##idx(void) \ { \ - twim_##idx##z_data.twim.p_twim = (NRF_TWIM_Type *)DT_INST_REG_ADDR(idx); \ - IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twim_irq_handler, \ - &twim_##idx##z_data.twim, 0); \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ + nrfx_twim_##idx##_irq_handler, 0); \ } \ IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ I2C_RTIO_DEFINE(_i2c##idx##_twim_rtio, \ DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ - PINCTRL_DT_INST_DEFINE(idx); \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data; \ static const struct i2c_nrfx_twim_rtio_config twim_##idx##z_config = { \ .common = \ { \ + .twim = NRFX_TWIM_INSTANCE(idx), \ .twim_config = \ { \ .skip_gpio_cfg = true, \ .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ + .frequency = I2C_FREQUENCY(idx), \ }, \ .event_handler = event_handler, \ .msg_buf_size = MSG_BUF_SIZE(idx), \ - .pre_init = pre_init##idx, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) \ .max_transfer_size = MAX_TRANSFER_SIZE(idx), \ - .twim = &twim_##idx##z_data.twim, \ }, \ .ctx = &_i2c##idx##_twim_rtio, \ }; \ - PM_DEVICE_DT_INST_DEFINE(idx, twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ - I2C_DEVICE_DT_INST_DEINIT_DEFINE(idx, i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ - PM_DEVICE_DT_INST_GET(idx), &twim_##idx##z_data, \ - &twim_##idx##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twim_driver_api); - -DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWIM_RTIO_DEVICE) + PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ + I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ + PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ + &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ + &i2c_nrfx_twim_driver_api); + +#ifdef CONFIG_HAS_HW_NRF_TWIM0 +I2C_NRFX_TWIM_RTIO_DEVICE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM1 +I2C_NRFX_TWIM_RTIO_DEVICE(1); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM2 +I2C_NRFX_TWIM_RTIO_DEVICE(2); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM3 +I2C_NRFX_TWIM_RTIO_DEVICE(3); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM20 +I2C_NRFX_TWIM_RTIO_DEVICE(20); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM21 +I2C_NRFX_TWIM_RTIO_DEVICE(21); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM22 +I2C_NRFX_TWIM_RTIO_DEVICE(22); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM23 +I2C_NRFX_TWIM_RTIO_DEVICE(23); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM24 +I2C_NRFX_TWIM_RTIO_DEVICE(24); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM30 +I2C_NRFX_TWIM_RTIO_DEVICE(30); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM120 +I2C_NRFX_TWIM_RTIO_DEVICE(120); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM130 +I2C_NRFX_TWIM_RTIO_DEVICE(130); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM131 +I2C_NRFX_TWIM_RTIO_DEVICE(131); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM132 +I2C_NRFX_TWIM_RTIO_DEVICE(132); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM133 +I2C_NRFX_TWIM_RTIO_DEVICE(133); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM134 +I2C_NRFX_TWIM_RTIO_DEVICE(134); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM135 +I2C_NRFX_TWIM_RTIO_DEVICE(135); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM136 +I2C_NRFX_TWIM_RTIO_DEVICE(136); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIM137 +I2C_NRFX_TWIM_RTIO_DEVICE(137); +#endif diff --git a/drivers/i2c/i2c_nrfx_twis.c b/drivers/i2c/i2c_nrfx_twis.c index 08f1e33bb601..0fd9b667d23c 100644 --- a/drivers/i2c/i2c_nrfx_twis.c +++ b/drivers/i2c/i2c_nrfx_twis.c @@ -16,10 +16,26 @@ #define DT_DRV_COMPAT nordic_nrf_twis -#define SHIM_NRF_TWIS_HAS_MEMORY_REGIONS(id) DT_NODE_HAS_PROP(DT_DRV_INST(id), memory_regions) +#define SHIM_NRF_TWIS_NODE(id) \ + DT_NODELABEL(_CONCAT(i2c, id)) -#define SHIM_NRF_TWIS_LINKER_REGION_NAME(id) \ - LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(DT_DRV_INST(id), memory_regions)) +#define SHIM_NRF_TWIS_DEVICE_GET(id) \ + DEVICE_DT_GET(SHIM_NRF_TWIS_NODE(id)) + +#define SHIM_NRF_TWIS_IRQ_HANDLER(id) \ + _CONCAT_3(nrfx_twis_, id, _irq_handler) + +#define SHIM_NRF_TWIS_IRQN(id) \ + DT_IRQN(SHIM_NRF_TWIS_NODE(id)) + +#define SHIM_NRF_TWIS_IRQ_PRIO(id) \ + DT_IRQ(SHIM_NRF_TWIS_NODE(id), priority) + +#define SHIM_NRF_TWIS_HAS_MEMORY_REGIONS(id) \ + DT_NODE_HAS_PROP(SHIM_NRF_TWIS_NODE(id), memory_regions) + +#define SHIM_NRF_TWIS_LINKER_REGION_NAME(id) \ + LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(SHIM_NRF_TWIS_NODE(id), memory_regions)) #define SHIM_NRF_TWIS_BUF_ATTR_SECTION(id) \ __attribute__((__section__(SHIM_NRF_TWIS_LINKER_REGION_NAME(id)))) @@ -37,14 +53,14 @@ LOG_MODULE_REGISTER(i2c_nrfx_twis, CONFIG_I2C_LOG_LEVEL); struct shim_nrf_twis_config { - void (*pre_init)(void); - void (*event_handler)(nrfx_twis_event_t const *event); + nrfx_twis_t twis; + void (*irq_connect)(void); + void (*event_handler)(nrfx_twis_evt_t const *event); const struct pinctrl_dev_config *pcfg; uint8_t *buf; }; struct shim_nrf_twis_data { - nrfx_twis_t twis; struct i2c_target_config *target_config; bool enabled; }; @@ -89,7 +105,7 @@ static void shim_nrf_twis_enable(const struct device *dev) } (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); - nrfx_twis_enable(&dev_data->twis); + nrfx_twis_enable(&dev_config->twis); dev_data->enabled = true; } @@ -103,7 +119,7 @@ static void shim_nrf_twis_disable(const struct device *dev) } dev_data->enabled = false; - nrfx_twis_disable(&dev_data->twis); + nrfx_twis_disable(&dev_config->twis); (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -113,10 +129,10 @@ static void shim_nrf_twis_handle_read_req(const struct device *dev) const struct shim_nrf_twis_config *dev_config = dev->config; struct i2c_target_config *target_config = dev_data->target_config; const struct i2c_target_callbacks *callbacks = target_config->callbacks; - nrfx_twis_t *twis = &dev_data->twis; + const nrfx_twis_t *twis = &dev_config->twis; uint8_t *buf; uint32_t buf_size; - int err; + nrfx_err_t err; if (callbacks->buf_read_requested(target_config, &buf, &buf_size)) { LOG_ERR("no buffer provided"); @@ -131,7 +147,7 @@ static void shim_nrf_twis_handle_read_req(const struct device *dev) memcpy(dev_config->buf, buf, buf_size); err = nrfx_twis_tx_prepare(twis, dev_config->buf, buf_size); - if (err < 0) { + if (err != NRFX_SUCCESS) { LOG_ERR("tx prepare failed"); return; } @@ -139,13 +155,12 @@ static void shim_nrf_twis_handle_read_req(const struct device *dev) static void shim_nrf_twis_handle_write_req(const struct device *dev) { - struct shim_nrf_twis_data *dev_data = dev->data; const struct shim_nrf_twis_config *dev_config = dev->config; - nrfx_twis_t *twis = &dev_data->twis; - int err; + const nrfx_twis_t *twis = &dev_config->twis; + nrfx_err_t err; err = nrfx_twis_rx_prepare(twis, dev_config->buf, SHIM_NRF_TWIS_BUF_SIZE); - if (err < 0) { + if (err != NRFX_SUCCESS) { LOG_ERR("rx prepare failed"); return; } @@ -157,12 +172,13 @@ static void shim_nrf_twis_handle_write_done(const struct device *dev) const struct shim_nrf_twis_config *dev_config = dev->config; struct i2c_target_config *target_config = dev_data->target_config; const struct i2c_target_callbacks *callbacks = target_config->callbacks; - nrfx_twis_t *twis = &dev_data->twis; + const nrfx_twis_t *twis = &dev_config->twis; callbacks->buf_write_received(target_config, dev_config->buf, nrfx_twis_rx_amount(twis)); } -static void shim_nrf_twis_event_handler(const struct device *dev, nrfx_twis_event_t const *event) +static void shim_nrf_twis_event_handler(const struct device *dev, + nrfx_twis_evt_t const *event) { switch (event->type) { case NRFX_TWIS_EVT_READ_REQ: @@ -207,8 +223,9 @@ static int shim_nrf_twis_target_register(const struct device *dev, struct i2c_target_config *target_config) { struct shim_nrf_twis_data *dev_data = dev->data; - nrfx_twis_t *twis = &dev_data->twis; - int err; + const struct shim_nrf_twis_config *dev_config = dev->config; + const nrfx_twis_t *twis = &dev_config->twis; + nrfx_err_t err; const nrfx_twis_config_t config = { .addr = { target_config->address, @@ -225,7 +242,7 @@ static int shim_nrf_twis_target_register(const struct device *dev, shim_nrf_twis_disable(dev); err = nrfx_twis_reconfigure(twis, &config); - if (err < 0) { + if (err != NRFX_SUCCESS) { return -ENODEV; } @@ -259,25 +276,25 @@ const struct i2c_driver_api shim_nrf_twis_api = { static int shim_nrf_twis_init(const struct device *dev) { - struct shim_nrf_twis_data *dev_data = dev->data; const struct shim_nrf_twis_config *dev_config = dev->config; - int err; + nrfx_err_t err; const nrfx_twis_config_t config = { .skip_gpio_cfg = true, .skip_psel_cfg = true, }; - dev_config->pre_init(); - err = nrfx_twis_init(&dev_data->twis, &config, dev_config->event_handler); - if (err < 0) { + err = nrfx_twis_init(&dev_config->twis, &config, dev_config->event_handler); + if (err != NRFX_SUCCESS) { return -ENODEV; } + dev_config->irq_connect(); return pm_device_driver_init(dev, shim_nrf_twis_pm_action_cb); } static int shim_nrf_twis_deinit(const struct device *dev) { + const struct shim_nrf_twis_config *dev_config = dev->config; struct shim_nrf_twis_data *dev_data = dev->data; if (dev_data->target_config != NULL) { @@ -300,45 +317,127 @@ static int shim_nrf_twis_deinit(const struct device *dev) #endif /* Uninit device hardware */ - nrfx_twis_uninit(&dev_data->twis); + nrfx_twis_uninit(&dev_config->twis); return 0; } #define SHIM_NRF_TWIS_NAME(id, name) \ _CONCAT_4(shim_nrf_twis_, name, _, id) -#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ - static struct shim_nrf_twis_data SHIM_NRF_TWIS_NAME(id, data); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(id)); \ - static void SHIM_NRF_TWIS_NAME(id, pre_init)(void) \ - { \ - SHIM_NRF_TWIS_NAME(id, data).twis.p_reg = (NRF_TWIS_Type *)DT_INST_REG_ADDR(id); \ - IRQ_CONNECT(DT_INST_IRQN(id), DT_INST_IRQ(id, priority), nrfx_twis_irq_handler, \ - &SHIM_NRF_TWIS_NAME(id, data).twis, 0); \ - } \ - \ - static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_event_t const *event) \ - { \ - shim_nrf_twis_event_handler(DEVICE_DT_INST_GET(id), event); \ - } \ - \ - PINCTRL_DT_INST_DEFINE(id); \ - \ - static uint8_t SHIM_NRF_TWIS_NAME(id, \ - buf)[SHIM_NRF_TWIS_BUF_SIZE] SHIM_NRF_TWIS_BUF_ATTR(id); \ - \ - static const struct shim_nrf_twis_config SHIM_NRF_TWIS_NAME(id, config) = { \ - .pre_init = SHIM_NRF_TWIS_NAME(id, pre_init), \ - .event_handler = SHIM_NRF_TWIS_NAME(id, event_handler), \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(id), \ - .buf = SHIM_NRF_TWIS_NAME(id, buf), \ - }; \ - \ - PM_DEVICE_DT_INST_DEFINE(id, shim_nrf_twis_pm_action_cb,); \ - \ - DEVICE_DT_INST_DEINIT_DEFINE(id, shim_nrf_twis_init, shim_nrf_twis_deinit, \ - PM_DEVICE_DT_INST_GET(id), &SHIM_NRF_TWIS_NAME(id, data), \ - &SHIM_NRF_TWIS_NAME(id, config), POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &shim_nrf_twis_api); - -DT_INST_FOREACH_STATUS_OKAY(SHIM_NRF_TWIS_DEVICE_DEFINE) +#define SHIM_NRF_TWIS_DEVICE_DEFINE(id) \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SHIM_NRF_TWIS_NODE(id)); \ + static void SHIM_NRF_TWIS_NAME(id, irq_connect)(void) \ + { \ + IRQ_CONNECT( \ + SHIM_NRF_TWIS_IRQN(id), \ + SHIM_NRF_TWIS_IRQ_PRIO(id), \ + nrfx_isr, \ + SHIM_NRF_TWIS_IRQ_HANDLER(id), \ + 0 \ + ); \ + } \ + \ + static void SHIM_NRF_TWIS_NAME(id, event_handler)(nrfx_twis_evt_t const *event) \ + { \ + shim_nrf_twis_event_handler(SHIM_NRF_TWIS_DEVICE_GET(id), event); \ + } \ + \ + static struct shim_nrf_twis_data SHIM_NRF_TWIS_NAME(id, data); \ + \ + PINCTRL_DT_DEFINE(SHIM_NRF_TWIS_NODE(id)); \ + \ + static uint8_t SHIM_NRF_TWIS_NAME(id, buf) \ + [SHIM_NRF_TWIS_BUF_SIZE] SHIM_NRF_TWIS_BUF_ATTR(id); \ + \ + static const struct shim_nrf_twis_config SHIM_NRF_TWIS_NAME(id, config) = { \ + .twis = NRFX_TWIS_INSTANCE(id), \ + .irq_connect = SHIM_NRF_TWIS_NAME(id, irq_connect), \ + .event_handler = SHIM_NRF_TWIS_NAME(id, event_handler), \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SHIM_NRF_TWIS_NODE(id)), \ + .buf = SHIM_NRF_TWIS_NAME(id, buf), \ + }; \ + \ + PM_DEVICE_DT_DEFINE( \ + SHIM_NRF_TWIS_NODE(id), \ + shim_nrf_twis_pm_action_cb, \ + ); \ + \ + DEVICE_DT_DEINIT_DEFINE( \ + SHIM_NRF_TWIS_NODE(id), \ + shim_nrf_twis_init, \ + shim_nrf_twis_deinit, \ + PM_DEVICE_DT_GET(SHIM_NRF_TWIS_NODE(id)), \ + &SHIM_NRF_TWIS_NAME(id, data), \ + &SHIM_NRF_TWIS_NAME(id, config), \ + POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, \ + &shim_nrf_twis_api \ + ); + +#ifdef CONFIG_HAS_HW_NRF_TWIS0 +SHIM_NRF_TWIS_DEVICE_DEFINE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS1 +SHIM_NRF_TWIS_DEVICE_DEFINE(1); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS2 +SHIM_NRF_TWIS_DEVICE_DEFINE(2); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS3 +SHIM_NRF_TWIS_DEVICE_DEFINE(3); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS20 +SHIM_NRF_TWIS_DEVICE_DEFINE(20); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS21 +SHIM_NRF_TWIS_DEVICE_DEFINE(21); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS22 +SHIM_NRF_TWIS_DEVICE_DEFINE(22); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS23 +SHIM_NRF_TWIS_DEVICE_DEFINE(23); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS24 +SHIM_NRF_TWIS_DEVICE_DEFINE(24); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS30 +SHIM_NRF_TWIS_DEVICE_DEFINE(30); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS130 +SHIM_NRF_TWIS_DEVICE_DEFINE(130); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS131 +SHIM_NRF_TWIS_DEVICE_DEFINE(131); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS133 +SHIM_NRF_TWIS_DEVICE_DEFINE(133); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS134 +SHIM_NRF_TWIS_DEVICE_DEFINE(134); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS135 +SHIM_NRF_TWIS_DEVICE_DEFINE(135); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS136 +SHIM_NRF_TWIS_DEVICE_DEFINE(136); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWIS137 +SHIM_NRF_TWIS_DEVICE_DEFINE(137); +#endif diff --git a/drivers/i2s/Kconfig.nrfx b/drivers/i2s/Kconfig.nrfx index 786de1ba68b8..7337f9974c0f 100644 --- a/drivers/i2s/Kconfig.nrfx +++ b/drivers/i2s/Kconfig.nrfx @@ -5,7 +5,8 @@ menuconfig I2S_NRFX bool "nRF I2S nrfx driver" default y depends on DT_HAS_NORDIC_NRF_I2S_ENABLED - select NRFX_I2S + select NRFX_I2S0 if HAS_HW_NRF_I2S0 + select NRFX_I2S20 if HAS_HW_NRF_I2S20 select PINCTRL help Enable support for nrfx I2S driver for nRF MCU series. diff --git a/drivers/i2s/i2s_nrfx.c b/drivers/i2s/i2s_nrfx.c index 11ad955cf3c8..8c52fb42da30 100644 --- a/drivers/i2s/i2s_nrfx.c +++ b/drivers/i2s/i2s_nrfx.c @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT nordic_nrf_i2s - #include #include #include @@ -35,20 +33,21 @@ struct i2s_nrfx_drv_data { struct k_msgq tx_queue; struct stream_cfg rx; struct k_msgq rx_queue; - nrfx_i2s_t i2s; + const nrfx_i2s_t *p_i2s; const uint32_t *last_tx_buffer; enum i2s_state state; enum i2s_dir active_dir; bool stop; /* stop after the current (TX or RX) block */ bool discard_rx; /* discard further RX blocks */ volatile bool next_tx_buffer_needed; - bool tx_configured: 1; - bool rx_configured: 1; - bool request_clock: 1; + bool tx_configured : 1; + bool rx_configured : 1; + bool request_clock : 1; }; struct i2s_nrfx_drv_cfg { nrfx_i2s_data_handler_t data_handler; + nrfx_i2s_t i2s; nrfx_i2s_config_t nrfx_def_cfg; const struct pinctrl_dev_config *pcfg; enum clock_source { @@ -65,26 +64,148 @@ static void find_suitable_clock(const struct i2s_nrfx_drv_cfg *drv_cfg, nrfx_i2s_config_t *config, const struct i2s_config *i2s_cfg) { - const nrfx_i2s_clk_params_t clk_params = { - .base_clock_freq = - (NRF_I2S_HAS_CLKCONFIG && drv_cfg->clk_src == ACLK) - /* The I2S_NRFX_DEVICE() macro contains build assertions that - * make sure that the ACLK clock source is only used when it is - * available and only with the "hfclkaudio-frequency" property - * defined, but the default value of 0 here needs to be used to - * prevent compilation errors when the property is not defined - * (this expression will be eventually optimized away then). - */ - ? DT_PROP_OR(DT_NODELABEL(clock), hfclkaudio_frequency, 0) - : 32*1000*1000UL, - .transfer_rate = i2s_cfg->frame_clk_freq, - .swidth = config->sample_width, - .allow_bypass = IS_ENABLED(CONFIG_I2S_NRFX_ALLOW_MCK_BYPASS), + static const struct { + uint16_t ratio_val; + nrf_i2s_ratio_t ratio_enum; + } ratios[] = { + { 32, NRF_I2S_RATIO_32X }, + { 48, NRF_I2S_RATIO_48X }, + { 64, NRF_I2S_RATIO_64X }, + { 96, NRF_I2S_RATIO_96X }, + { 128, NRF_I2S_RATIO_128X }, + { 192, NRF_I2S_RATIO_192X }, + { 256, NRF_I2S_RATIO_256X }, + { 384, NRF_I2S_RATIO_384X }, + { 512, NRF_I2S_RATIO_512X } }; + const uint32_t src_freq = + (NRF_I2S_HAS_CLKCONFIG && drv_cfg->clk_src == ACLK) + /* The I2S_NRFX_DEVICE() macro contains build assertions that + * make sure that the ACLK clock source is only used when it is + * available and only with the "hfclkaudio-frequency" property + * defined, but the default value of 0 here needs to be used to + * prevent compilation errors when the property is not defined + * (this expression will be eventually optimized away then). + */ + ? DT_PROP_OR(DT_NODELABEL(clock), hfclkaudio_frequency, 0) + : 32*1000*1000UL; + uint32_t bits_per_frame = 2 * i2s_cfg->word_size; + uint32_t best_diff = UINT32_MAX; + uint8_t r, best_r = 0; + nrf_i2s_mck_t best_mck_cfg = 0; + uint32_t best_mck = 0; + +#if defined(CONFIG_I2S_NRFX_ALLOW_MCK_BYPASS) && NRF_I2S_HAS_CLKCONFIG + /* Check for bypass before calculating f_MCK */ + for (r = 0; r < ARRAY_SIZE(ratios); ++r) { + if (i2s_cfg->frame_clk_freq * ratios[r].ratio_val == src_freq) { + LOG_INF("MCK bypass calculated"); + best_r = r; + best_mck = src_freq; + best_diff = 0; + + /* Set CONFIG.MCKFREQ register to non-zero reset value to + * ensure peripheral functionality + */ + best_mck_cfg = NRF_I2S_MCK_32MDIV8; + + config->enable_bypass = true; + break; + } + } +#endif + + for (r = 0; (best_diff != 0) && (r < ARRAY_SIZE(ratios)); ++r) { + /* Only multiples of the frame width can be used as ratios. */ + if ((ratios[r].ratio_val % bits_per_frame) != 0) { + continue; + } + + if (IS_ENABLED(CONFIG_SOC_SERIES_NRF53X) || IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { + uint32_t requested_mck = + i2s_cfg->frame_clk_freq * ratios[r].ratio_val; + /* As specified in the nRF5340 PS: + * + * MCKFREQ = 4096 * floor(f_MCK * 1048576 / + * (f_source + f_MCK / 2)) + * f_actual = f_source / + * floor(1048576 * 4096 / MCKFREQ) + */ + enum { MCKCONST = 1048576 }; + uint32_t mck_factor = + (uint32_t)(((uint64_t)requested_mck * MCKCONST) / + (src_freq + requested_mck / 2)); + + /* skip cases when mck_factor is too big for dividing */ + if (mck_factor > MCKCONST) { + continue; + } + uint32_t actual_mck = src_freq / (MCKCONST / mck_factor); + + uint32_t lrck_freq = actual_mck / ratios[r].ratio_val; + uint32_t diff = lrck_freq >= i2s_cfg->frame_clk_freq + ? (lrck_freq - i2s_cfg->frame_clk_freq) + : (i2s_cfg->frame_clk_freq - lrck_freq); + + if (diff < best_diff) { + best_mck_cfg = mck_factor * 4096; + best_mck = actual_mck; + best_r = r; + best_diff = diff; + } + } else { + static const struct { + uint8_t divider_val; + nrf_i2s_mck_t divider_enum; + } dividers[] = { + { 8, NRF_I2S_MCK_32MDIV8 }, + { 10, NRF_I2S_MCK_32MDIV10 }, + { 11, NRF_I2S_MCK_32MDIV11 }, + { 15, NRF_I2S_MCK_32MDIV15 }, + { 16, NRF_I2S_MCK_32MDIV16 }, + { 21, NRF_I2S_MCK_32MDIV21 }, + { 23, NRF_I2S_MCK_32MDIV23 }, + { 30, NRF_I2S_MCK_32MDIV30 }, + { 31, NRF_I2S_MCK_32MDIV31 }, + { 32, NRF_I2S_MCK_32MDIV32 }, + { 42, NRF_I2S_MCK_32MDIV42 }, + { 63, NRF_I2S_MCK_32MDIV63 }, + { 125, NRF_I2S_MCK_32MDIV125 } + }; - if (nrfx_i2s_prescalers_calc(&clk_params, &config->prescalers) != 0) { - LOG_ERR("Failed to find suitable I2S clock configuration."); + for (uint8_t d = 0; (best_diff != 0) && (d < ARRAY_SIZE(dividers)); ++d) { + uint32_t mck_freq = + src_freq / dividers[d].divider_val; + uint32_t lrck_freq = + mck_freq / ratios[r].ratio_val; + uint32_t diff = + lrck_freq >= i2s_cfg->frame_clk_freq + ? (lrck_freq - i2s_cfg->frame_clk_freq) + : (i2s_cfg->frame_clk_freq - lrck_freq); + + if (diff < best_diff) { + best_mck_cfg = dividers[d].divider_enum; + best_mck = mck_freq; + best_r = r; + best_diff = diff; + } + + /* Since dividers are in ascending order, stop + * checking next ones for the current ratio + * after resulting LRCK frequency falls below + * the one requested. + */ + if (lrck_freq < i2s_cfg->frame_clk_freq) { + break; + } + } + } } + + config->mck_setup = best_mck_cfg; + config->ratio = ratios[best_r].ratio_enum; + LOG_INF("I2S MCK frequency: %u, actual PCM rate: %u", + best_mck, best_mck / ratios[best_r].ratio_val); } static bool get_next_tx_buffer(struct i2s_nrfx_drv_data *drv_data, @@ -135,7 +256,7 @@ static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data, if (drv_data->active_dir != I2S_DIR_TX) { /* -> RX active */ if (!get_next_rx_buffer(drv_data, next)) { drv_data->state = I2S_STATE_ERROR; - nrfx_i2s_stop(&drv_data->i2s); + nrfx_i2s_stop(drv_data->p_i2s); return false; } /* Set buffer size if there is no TX buffer (which effectively @@ -150,7 +271,7 @@ static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data, drv_data->last_tx_buffer = next->p_tx_buffer; LOG_DBG("Next buffers: %p/%p", next->p_tx_buffer, next->p_rx_buffer); - nrfx_i2s_next_buffers_set(&drv_data->i2s, next); + nrfx_i2s_next_buffers_set(drv_data->p_i2s, next); return true; } @@ -182,7 +303,7 @@ static void data_handler(const struct device *dev, } drv_data->last_tx_buffer = NULL; } - nrfx_i2s_uninit(&drv_data->i2s); + nrfx_i2s_uninit(drv_data->p_i2s); if (drv_data->request_clock) { (void)onoff_release(drv_data->clk_mgr); } @@ -199,7 +320,7 @@ static void data_handler(const struct device *dev, LOG_ERR("Next buffers not supplied on time"); drv_data->state = I2S_STATE_ERROR; } - nrfx_i2s_stop(&drv_data->i2s); + nrfx_i2s_stop(drv_data->p_i2s); return; } @@ -249,7 +370,7 @@ static void data_handler(const struct device *dev, } if (stop_transfer) { - nrfx_i2s_stop(&drv_data->i2s); + nrfx_i2s_stop(drv_data->p_i2s); } else if (status & NRFX_I2S_STATUS_NEXT_BUFFERS_NEEDED) { nrfx_i2s_buffers_t next = { 0 }; @@ -420,7 +541,8 @@ static int i2s_nrfx_configure(const struct device *dev, enum i2s_dir dir, * the MCK output is used), find a suitable clock configuration for it. */ if (nrfx_cfg.mode == NRF_I2S_MODE_MASTER || - nrf_i2s_mck_pin_connected_check(drv_data->i2s.p_reg)) { + (nrf_i2s_mck_pin_get(drv_cfg->i2s.p_reg) & I2S_PSEL_MCK_CONNECT_Msk) + == I2S_PSEL_MCK_CONNECT_Connected << I2S_PSEL_MCK_CONNECT_Pos) { find_suitable_clock(drv_cfg, &nrfx_cfg, i2s_cfg); /* Unless the PCLK32M source is used with the HFINT oscillator * (which is always available without any additional actions), @@ -429,7 +551,7 @@ static int i2s_nrfx_configure(const struct device *dev, enum i2s_dir dir, */ drv_data->request_clock = (drv_cfg->clk_src != PCLK32M); } else { - nrfx_cfg.prescalers.mck_setup = NRF_I2S_MCK_DISABLED; + nrfx_cfg.mck_setup = NRF_I2S_MCK_DISABLED; drv_data->request_clock = false; } @@ -578,7 +700,7 @@ static int start_transfer(struct i2s_nrfx_drv_data *drv_data) /* Failed to allocate next RX buffer */ ret = -ENOMEM; } else { - int err; + nrfx_err_t err; /* It is necessary to set buffer size here only for I2S_DIR_RX, * because only then the get_next_tx_buffer() call in the if @@ -591,16 +713,16 @@ static int start_transfer(struct i2s_nrfx_drv_data *drv_data) drv_data->last_tx_buffer = initial_buffers.p_tx_buffer; - err = nrfx_i2s_start(&drv_data->i2s, &initial_buffers, 0); - if (err == 0) { + err = nrfx_i2s_start(drv_data->p_i2s, &initial_buffers, 0); + if (err == NRFX_SUCCESS) { return 0; } - LOG_ERR("Failed to start I2S transfer: %d", err); + LOG_ERR("Failed to start I2S transfer: 0x%08x", err); ret = -EIO; } - nrfx_i2s_uninit(&drv_data->i2s); + nrfx_i2s_uninit(drv_data->p_i2s); if (drv_data->request_clock) { (void)onoff_release(drv_data->clk_mgr); } @@ -629,7 +751,7 @@ static void clock_started_callback(struct onoff_manager *mgr, * the actual transfer in such case. */ if (drv_data->state == I2S_STATE_READY) { - nrfx_i2s_uninit(&drv_data->i2s); + nrfx_i2s_uninit(drv_data->p_i2s); (void)onoff_release(drv_data->clk_mgr); } else { (void)start_transfer(drv_data); @@ -640,25 +762,25 @@ static int trigger_start(const struct device *dev) { struct i2s_nrfx_drv_data *drv_data = dev->data; const struct i2s_nrfx_drv_cfg *drv_cfg = dev->config; - int err; + nrfx_err_t err; int ret; const nrfx_i2s_config_t *nrfx_cfg = (drv_data->active_dir == I2S_DIR_TX) ? &drv_data->tx.nrfx_cfg : &drv_data->rx.nrfx_cfg; - err = nrfx_i2s_init(&drv_data->i2s, nrfx_cfg, drv_cfg->data_handler); - if (err != 0) { - LOG_ERR("Failed to initialize I2S: %d", err); + err = nrfx_i2s_init(drv_data->p_i2s, nrfx_cfg, drv_cfg->data_handler); + if (err != NRFX_SUCCESS) { + LOG_ERR("Failed to initialize I2S: 0x%08x", err); return -EIO; } drv_data->state = I2S_STATE_RUNNING; #if NRF_I2S_HAS_CLKCONFIG - nrf_i2s_clk_configure(drv_data->i2s.p_reg, + nrf_i2s_clk_configure(drv_cfg->i2s.p_reg, drv_cfg->clk_src == ACLK ? NRF_I2S_CLKSRC_ACLK : NRF_I2S_CLKSRC_PCLK32M, - nrfx_cfg->prescalers.enable_bypass); + nrfx_cfg->enable_bypass); #endif /* If it is required to use certain HF clock, request it to be running @@ -669,7 +791,7 @@ static int trigger_start(const struct device *dev) clock_started_callback); ret = onoff_request(drv_data->clk_mgr, &drv_data->clk_cli); if (ret < 0) { - nrfx_i2s_uninit(&drv_data->i2s); + nrfx_i2s_uninit(drv_data->p_i2s); drv_data->state = I2S_STATE_READY; LOG_ERR("Failed to request clock: %d", ret); @@ -776,7 +898,7 @@ static int i2s_nrfx_trigger(const struct device *dev, case I2S_TRIGGER_DROP: if (drv_data->state != I2S_STATE_READY) { drv_data->discard_rx = true; - nrfx_i2s_stop(&drv_data->i2s); + nrfx_i2s_stop(drv_data->p_i2s); } purge_queue(dev, dir); drv_data->state = I2S_STATE_READY; @@ -821,56 +943,72 @@ static DEVICE_API(i2s, i2s_nrf_drv_api) = { .trigger = i2s_nrfx_trigger, }; -#define I2S_CLK_SRC(inst) DT_STRING_TOKEN(DT_DRV_INST(inst), clock_source) - -#define I2S_NRFX_DEVICE(inst) \ - static struct i2s_buf tx_msgs##inst[CONFIG_I2S_NRFX_TX_BLOCK_COUNT]; \ - static struct i2s_buf rx_msgs##inst[CONFIG_I2S_NRFX_RX_BLOCK_COUNT]; \ - static void data_handler##inst(nrfx_i2s_buffers_t const *p_released, uint32_t status) \ - { \ - data_handler(DEVICE_DT_GET(DT_DRV_INST(inst)), p_released, status); \ - } \ - PINCTRL_DT_DEFINE(DT_DRV_INST(inst)); \ - static const struct i2s_nrfx_drv_cfg i2s_nrfx_cfg##inst = { \ - .data_handler = data_handler##inst, \ - .nrfx_def_cfg = NRFX_I2S_DEFAULT_CONFIG( \ - NRF_I2S_PIN_NOT_CONNECTED, NRF_I2S_PIN_NOT_CONNECTED, \ - NRF_I2S_PIN_NOT_CONNECTED, NRF_I2S_PIN_NOT_CONNECTED, \ - NRF_I2S_PIN_NOT_CONNECTED), \ - .nrfx_def_cfg.skip_gpio_cfg = true, \ - .nrfx_def_cfg.skip_psel_cfg = true, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(DT_DRV_INST(inst)), \ - .clk_src = I2S_CLK_SRC(inst), \ - }; \ - static struct i2s_nrfx_drv_data i2s_nrfx_data##inst = { \ - .state = I2S_STATE_READY, \ - .i2s = NRFX_I2S_INSTANCE(DT_INST_REG_ADDR(inst)), \ - }; \ - static int i2s_nrfx_init##inst(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), nrfx_i2s_irq_handler, \ - &i2s_nrfx_data##inst.i2s, 0); \ - const struct i2s_nrfx_drv_cfg *drv_cfg = dev->config; \ - int err = pinctrl_apply_state(drv_cfg->pcfg, PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - k_msgq_init(&i2s_nrfx_data##inst.tx_queue, (char *)tx_msgs##inst, \ - sizeof(struct i2s_buf), ARRAY_SIZE(tx_msgs##inst)); \ - k_msgq_init(&i2s_nrfx_data##inst.rx_queue, (char *)rx_msgs##inst, \ - sizeof(struct i2s_buf), ARRAY_SIZE(rx_msgs##inst)); \ - init_clock_manager(dev); \ - return 0; \ - } \ - BUILD_ASSERT(I2S_CLK_SRC(inst) != ACLK || \ - (NRF_I2S_HAS_CLKCONFIG && NRF_CLOCK_HAS_HFCLKAUDIO), \ - "Clock source ACLK is not available."); \ - BUILD_ASSERT(I2S_CLK_SRC(inst) != ACLK || \ - DT_NODE_HAS_PROP(DT_NODELABEL(clock), hfclkaudio_frequency), \ - "Clock source ACLK requires the hfclkaudio-frequency " \ - "property to be defined in the nordic,nrf-clock node."); \ - DEVICE_DT_INST_DEFINE(inst, i2s_nrfx_init##inst, NULL, &i2s_nrfx_data##inst, \ - &i2s_nrfx_cfg##inst, POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, \ - &i2s_nrf_drv_api); - -DT_INST_FOREACH_STATUS_OKAY(I2S_NRFX_DEVICE) +#define I2S(idx) DT_NODELABEL(i2s##idx) +#define I2S_CLK_SRC(idx) DT_STRING_TOKEN(I2S(idx), clock_source) + +#define I2S_NRFX_DEVICE(idx) \ + static struct i2s_buf tx_msgs##idx[CONFIG_I2S_NRFX_TX_BLOCK_COUNT]; \ + static struct i2s_buf rx_msgs##idx[CONFIG_I2S_NRFX_RX_BLOCK_COUNT]; \ + static void data_handler##idx(nrfx_i2s_buffers_t const *p_released, \ + uint32_t status) \ + { \ + data_handler(DEVICE_DT_GET(I2S(idx)), p_released, status); \ + } \ + PINCTRL_DT_DEFINE(I2S(idx)); \ + static const struct i2s_nrfx_drv_cfg i2s_nrfx_cfg##idx = { \ + .data_handler = data_handler##idx, \ + .i2s = NRFX_I2S_INSTANCE(idx), \ + .nrfx_def_cfg = NRFX_I2S_DEFAULT_CONFIG( \ + NRF_I2S_PIN_NOT_CONNECTED, \ + NRF_I2S_PIN_NOT_CONNECTED, \ + NRF_I2S_PIN_NOT_CONNECTED, \ + NRF_I2S_PIN_NOT_CONNECTED, \ + NRF_I2S_PIN_NOT_CONNECTED), \ + .nrfx_def_cfg.skip_gpio_cfg = true, \ + .nrfx_def_cfg.skip_psel_cfg = true, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2S(idx)), \ + .clk_src = I2S_CLK_SRC(idx), \ + }; \ + static struct i2s_nrfx_drv_data i2s_nrfx_data##idx = { \ + .state = I2S_STATE_READY, \ + .p_i2s = &i2s_nrfx_cfg##idx.i2s \ + }; \ + static int i2s_nrfx_init##idx(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(I2S(idx)), DT_IRQ(I2S(idx), priority), \ + nrfx_isr, nrfx_i2s_##idx##_irq_handler, 0); \ + const struct i2s_nrfx_drv_cfg *drv_cfg = dev->config; \ + int err = pinctrl_apply_state(drv_cfg->pcfg, \ + PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + k_msgq_init(&i2s_nrfx_data##idx.tx_queue, \ + (char *)tx_msgs##idx, sizeof(struct i2s_buf), \ + ARRAY_SIZE(tx_msgs##idx)); \ + k_msgq_init(&i2s_nrfx_data##idx.rx_queue, \ + (char *)rx_msgs##idx, sizeof(struct i2s_buf), \ + ARRAY_SIZE(rx_msgs##idx)); \ + init_clock_manager(dev); \ + return 0; \ + } \ + BUILD_ASSERT(I2S_CLK_SRC(idx) != ACLK || \ + (NRF_I2S_HAS_CLKCONFIG && NRF_CLOCK_HAS_HFCLKAUDIO), \ + "Clock source ACLK is not available."); \ + BUILD_ASSERT(I2S_CLK_SRC(idx) != ACLK || \ + DT_NODE_HAS_PROP(DT_NODELABEL(clock), \ + hfclkaudio_frequency), \ + "Clock source ACLK requires the hfclkaudio-frequency " \ + "property to be defined in the nordic,nrf-clock node."); \ + DEVICE_DT_DEFINE(I2S(idx), i2s_nrfx_init##idx, NULL, \ + &i2s_nrfx_data##idx, &i2s_nrfx_cfg##idx, \ + POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, \ + &i2s_nrf_drv_api); + +#ifdef CONFIG_HAS_HW_NRF_I2S0 +I2S_NRFX_DEVICE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_I2S20 +I2S_NRFX_DEVICE(20); +#endif diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index 6a76361ccf1c..0b1fcf1ca7e0 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -12,7 +12,7 @@ #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) -#include +#include static inline void vendor_specific_init(const struct device *dev) { diff --git a/drivers/pwm/Kconfig.nrfx b/drivers/pwm/Kconfig.nrfx index 7bb3881ffc42..d99b5aaf3ab8 100644 --- a/drivers/pwm/Kconfig.nrfx +++ b/drivers/pwm/Kconfig.nrfx @@ -5,7 +5,18 @@ config PWM_NRFX bool "nRF PWM nrfx driver" default y depends on DT_HAS_NORDIC_NRF_PWM_ENABLED - select NRFX_PWM + select NRFX_PWM0 if HAS_HW_NRF_PWM0 + select NRFX_PWM1 if HAS_HW_NRF_PWM1 + select NRFX_PWM2 if HAS_HW_NRF_PWM2 + select NRFX_PWM3 if HAS_HW_NRF_PWM3 + select NRFX_PWM20 if HAS_HW_NRF_PWM20 + select NRFX_PWM21 if HAS_HW_NRF_PWM21 + select NRFX_PWM22 if HAS_HW_NRF_PWM22 + select NRFX_PWM120 if HAS_HW_NRF_PWM120 + select NRFX_PWM130 if HAS_HW_NRF_PWM130 + select NRFX_PWM131 if HAS_HW_NRF_PWM131 + select NRFX_PWM132 if HAS_HW_NRF_PWM132 + select NRFX_PWM133 if HAS_HW_NRF_PWM133 select PINCTRL help Enable support for nrfx Hardware PWM driver for nRF52 MCU series. diff --git a/drivers/pwm/pwm_nrf_sw.c b/drivers/pwm/pwm_nrf_sw.c index 37f3be925a3d..e4cc7ecb42b9 100644 --- a/drivers/pwm/pwm_nrf_sw.c +++ b/drivers/pwm/pwm_nrf_sw.c @@ -14,7 +14,6 @@ #include #include #include -#include #include @@ -63,7 +62,7 @@ struct pwm_config { NRF_RTC_Type *rtc; NRF_TIMER_Type *timer; }; - nrfx_gpiote_t *gpiote[PWM_0_MAP_SIZE]; + nrfx_gpiote_t gpiote[PWM_0_MAP_SIZE]; uint8_t psel_ch[PWM_0_MAP_SIZE]; uint8_t initially_inverted; uint8_t map_size; @@ -73,9 +72,8 @@ struct pwm_config { struct pwm_data { uint32_t period_cycles; uint32_t pulse_cycles[PWM_0_MAP_SIZE]; - nrfx_gppi_handle_t ppi_h[PWM_0_MAP_SIZE][PPI_PER_CH]; + uint8_t ppi_ch[PWM_0_MAP_SIZE][PPI_PER_CH]; uint8_t gpiote_ch[PWM_0_MAP_SIZE]; - uint32_t ppi_ch_mask[PWM_0_MAP_SIZE]; }; static inline NRF_RTC_Type *pwm_config_rtc(const struct pwm_config *config) @@ -128,11 +126,11 @@ static int pwm_nrf_sw_set_cycles(const struct device *dev, uint32_t channel, NRF_RTC_Type *rtc = pwm_config_rtc(config); NRF_GPIOTE_Type *gpiote; struct pwm_data *data = dev->data; + uint32_t ppi_mask; uint8_t active_level; uint8_t psel_ch; uint8_t gpiote_ch; - const nrfx_gppi_handle_t *ppi_chs; - uint32_t src_d = nrfx_gppi_domain_id_get(USE_RTC ? (uint32_t)rtc : (uint32_t)timer); + const uint8_t *ppi_chs; int ret; if (channel >= config->map_size) { @@ -165,16 +163,18 @@ static int pwm_nrf_sw_set_cycles(const struct device *dev, uint32_t channel, } } - gpiote = config->gpiote[channel]->p_reg; + gpiote = config->gpiote[channel].p_reg; psel_ch = config->psel_ch[channel]; gpiote_ch = data->gpiote_ch[channel]; - ppi_chs = data->ppi_h[channel]; + ppi_chs = data->ppi_ch[channel]; LOG_DBG("channel %u, period %u, pulse %u", channel, period_cycles, pulse_cycles); - /* disable PPI used */ - nrfx_gppi_channels_disable(src_d, data->ppi_ch_mask[channel]); + /* clear PPI used */ + ppi_mask = BIT(ppi_chs[0]) | BIT(ppi_chs[1]) | + (PPI_PER_CH > 2 ? BIT(ppi_chs[2]) : 0); + nrfx_gppi_channels_disable(ppi_mask); active_level = (flags & PWM_POLARITY_INVERTED) ? 0 : 1; @@ -278,10 +278,12 @@ static int pwm_nrf_sw_set_cycles(const struct device *dev, uint32_t channel, nrf_rtc_compare_event_get(0)); #if PPI_FORK_AVAILABLE - nrfx_gppi_ep_attach(clear_task_address, ppi_chs[1]); + nrfx_gppi_fork_endpoint_setup(ppi_chs[1], + clear_task_address); #else - nrfx_gppi_ep_attach(period_end_event_address, ppi_chs[2]); - nrfx_gppi_ep_attach(clear_task_address, ppi_chs[2]); + nrfx_gppi_channel_endpoints_setup(ppi_chs[2], + period_end_event_address, + clear_task_address); #endif } else { pulse_end_event_address = @@ -292,13 +294,13 @@ static int pwm_nrf_sw_set_cycles(const struct device *dev, uint32_t channel, nrf_timer_compare_event_get(0)); } - nrfx_gppi_ep_attach(pulse_end_event_address, ppi_chs[0]); - nrfx_gppi_ep_attach(pulse_end_task_address, ppi_chs[0]); - - nrfx_gppi_ep_attach(period_end_event_address, ppi_chs[1]); - nrfx_gppi_ep_attach(period_end_task_address, ppi_chs[1]); - - nrfx_gppi_channels_enable(src_d, data->ppi_ch_mask[channel]); + nrfx_gppi_channel_endpoints_setup(ppi_chs[0], + pulse_end_event_address, + pulse_end_task_address); + nrfx_gppi_channel_endpoints_setup(ppi_chs[1], + period_end_event_address, + period_end_task_address); + nrfx_gppi_channels_enable(ppi_mask); /* start timer, hence PWM */ if (USE_RTC) { @@ -349,37 +351,28 @@ static int pwm_nrf_sw_init(const struct device *dev) NRF_RTC_Type *rtc = pwm_config_rtc(config); for (uint32_t i = 0; i < config->map_size; i++) { - uint32_t src_d = nrfx_gppi_domain_id_get(USE_RTC ? (uint32_t)rtc : (uint32_t)timer); - uint32_t dst_d = nrfx_gppi_domain_id_get((uint32_t)config->gpiote[i]->p_reg); - int rv; + nrfx_err_t err; /* Allocate resources. */ for (uint32_t j = 0; j < PPI_PER_CH; j++) { - int ch; - - rv = nrfx_gppi_domain_conn_alloc(src_d, dst_d, &data->ppi_h[i][j]); - if (rv < 0) { + err = nrfx_gppi_channel_alloc(&data->ppi_ch[i][j]); + if (err != NRFX_SUCCESS) { /* Do not free allocated resource. It is a fatal condition, * system requires reconfiguration. */ LOG_ERR("Failed to allocate PPI channel"); - return rv; + return -ENOMEM; } - /* Enable connection but at the end disable channel on the source domain. */ - nrfx_gppi_conn_enable(data->ppi_h[i][j]); - ch = nrfx_gppi_domain_channel_get(data->ppi_h[i][j], src_d); - __ASSERT_NO_MSG(ch >= 0); - data->ppi_ch_mask[i] |= BIT(ch); } - nrfx_gppi_channels_disable(src_d, data->ppi_ch_mask[i]); - rv = nrfx_gpiote_channel_alloc(config->gpiote[i], &data->gpiote_ch[i]); - if (rv < 0) { + err = nrfx_gpiote_channel_alloc(&config->gpiote[i], + &data->gpiote_ch[i]); + if (err != NRFX_SUCCESS) { /* Do not free allocated resource. It is a fatal condition, * system requires reconfiguration. */ LOG_ERR("Failed to allocate GPIOTE channel"); - return rv; + return -ENOMEM; } /* Set initial state of the output pins. */ @@ -417,7 +410,7 @@ static int pwm_nrf_sw_init(const struct device *dev) ? BIT(_idx) : 0) | #define GPIOTE_AND_COMMA(_node_id, _prop, _idx) \ - &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE_BY_IDX(_node_id, _prop, _idx)) + NRFX_GPIOTE_INSTANCE(NRF_DT_GPIOTE_INST_BY_IDX(_node_id, _prop, _idx)), static const struct pwm_config pwm_nrf_sw_0_config = { COND_CODE_1(USE_RTC, (.rtc), (.timer)) = GENERATOR_ADDR, diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 2a97aa47dfdc..55a2b759b18b 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -3,9 +3,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ - -#define DT_DRV_COMPAT nordic_nrf_pwm - #include #include #include @@ -21,12 +18,31 @@ LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL); +/* NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED can be undefined or defined + * to 0 or 1, hence the use of #if IS_ENABLED(). + */ +#if IS_ENABLED(NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED) +#define ANOMALY_109_EGU_IRQ_CONNECT(idx) _EGU_IRQ_CONNECT(idx) +#define _EGU_IRQ_CONNECT(idx) \ + extern void nrfx_egu_##idx##_irq_handler(void); \ + IRQ_CONNECT(DT_IRQN(DT_NODELABEL(egu##idx)), \ + DT_IRQ(DT_NODELABEL(egu##idx), priority), \ + nrfx_isr, nrfx_egu_##idx##_irq_handler, 0) +#else +#define ANOMALY_109_EGU_IRQ_CONNECT(idx) +#endif + +#define PWM(dev_idx) DT_NODELABEL(pwm##dev_idx) +#define PWM_PROP(dev_idx, prop) DT_PROP(PWM(dev_idx), prop) +#define PWM_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(PWM(idx), prop) + #define PWM_NRFX_CH_POLARITY_MASK BIT(15) #define PWM_NRFX_CH_COMPARE_MASK BIT_MASK(15) #define PWM_NRFX_CH_VALUE(compare_value, inverted) \ (compare_value | (inverted ? 0 : PWM_NRFX_CH_POLARITY_MASK)) struct pwm_nrfx_config { + nrfx_pwm_t pwm; nrfx_pwm_config_t initial_config; nrf_pwm_sequence_t seq; const struct pinctrl_dev_config *pcfg; @@ -37,49 +53,12 @@ struct pwm_nrfx_config { }; struct pwm_nrfx_data { - nrfx_pwm_t pwm; uint32_t period_cycles; /* Bit mask indicating channels that need the PWM generation. */ uint8_t pwm_needed; uint8_t prescaler; bool stop_requested; }; - -#if NRF_ERRATA_STATIC_CHECK(52, 109) -/* Forward-declare pwm_nrfx__data structs to be able to access nrfx_pwm_t needed for the - * workaround. - */ -#define _PWM_DATA_STRUCT_NAME_GET(inst) pwm_nrfx_##inst##_data -#define _PWM_DATA_STRUCT_DECLARE(inst) static struct pwm_nrfx_data _PWM_DATA_STRUCT_NAME_GET(inst); -DT_INST_FOREACH_STATUS_OKAY(_PWM_DATA_STRUCT_DECLARE); - -/* Create an array of pointers to all active PWM instances to loop over them in an EGU interrupt - * handler. - */ -#define _PWM_DATA_STRUCT_PWM_PTR_COMMA_GET(inst) &_PWM_DATA_STRUCT_NAME_GET(inst).pwm, -static nrfx_pwm_t *pwm_instances[] = { - DT_INST_FOREACH_STATUS_OKAY(_PWM_DATA_STRUCT_PWM_PTR_COMMA_GET) -}; - -/* Define an interrupt handler for the EGU instance used by the workaround which calls - * nrfx_pwm_nrf52_anomaly_109_handler for all active PWM instances. - */ -void anomaly_109_egu_handler(void) -{ - for (int i = 0; i < ARRAY_SIZE(pwm_instances); i++) { - nrfx_pwm_nrf52_anomaly_109_handler(pwm_instances[i]); - } -} - -#define ANOMALY_109_EGU_IRQ_CONNECT(idx) _EGU_IRQ_CONNECT(idx) -#define _EGU_IRQ_CONNECT(idx) \ - IRQ_CONNECT(DT_IRQN(DT_NODELABEL(egu##idx)), \ - DT_IRQ(DT_NODELABEL(egu##idx), priority), \ - anomaly_109_egu_handler, 0, 0) -#else -#define ANOMALY_109_EGU_IRQ_CONNECT(idx) -#endif - /* Ensure the pwm_needed bit mask can accommodate all available channels. */ #if (NRF_PWM_CHANNEL_COUNT > 8) #error "Current implementation supports maximum 8 channels." @@ -92,9 +71,9 @@ static uint16_t *seq_values_ptr_get(const struct device *dev) return (uint16_t *)config->seq.values.p_raw; } -static void pwm_handler(nrfx_pwm_event_type_t event, void *p_context) +static void pwm_handler(nrfx_pwm_evt_type_t event_type, void *p_context) { - ARG_UNUSED(event); + ARG_UNUSED(event_type); ARG_UNUSED(p_context); } @@ -132,7 +111,7 @@ static bool pwm_period_check_and_set(const struct device *dev, data->period_cycles = period_cycles; data->prescaler = prescaler; - nrf_pwm_configure(data->pwm.p_reg, + nrf_pwm_configure(config->pwm.p_reg, data->prescaler, config->initial_config.count_mode, (uint16_t)countertop); @@ -147,9 +126,10 @@ static bool pwm_period_check_and_set(const struct device *dev, return false; } -static bool channel_psel_get(uint32_t channel, uint32_t *psel, struct pwm_nrfx_data *data) +static bool channel_psel_get(uint32_t channel, uint32_t *psel, + const struct pwm_nrfx_config *config) { - *psel = nrf_pwm_pin_get(data->pwm.p_reg, (uint8_t)channel); + *psel = nrf_pwm_pin_get(config->pwm.p_reg, (uint8_t)channel); return (((*psel & PWM_PSEL_OUT_CONNECT_Msk) >> PWM_PSEL_OUT_CONNECT_Pos) == PWM_PSEL_OUT_CONNECT_Connected); @@ -157,12 +137,12 @@ static bool channel_psel_get(uint32_t channel, uint32_t *psel, struct pwm_nrfx_d static int stop_pwm(const struct device *dev) { - struct pwm_nrfx_data *data = dev->data; + const struct pwm_nrfx_config *config = dev->config; /* Don't wait here for the peripheral to actually stop. Instead, - * ensure it is stopped before starting the next playback. - */ - nrfx_pwm_stop(&data->pwm, false); + * ensure it is stopped before starting the next playback. + */ + nrfx_pwm_stop(&config->pwm, false); return 0; } @@ -238,7 +218,7 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, if (!needs_pwm) { uint32_t psel; - if (channel_psel_get(channel, &psel, data)) { + if (channel_psel_get(channel, &psel, config)) { uint32_t out_level = (pulse_cycles == 0) ? 0 : 1; if (inverted) { @@ -277,7 +257,7 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, * and till that moment, it ignores any start requests, * so ensure here that it is stopped. */ - while (!nrfx_pwm_stopped_check(&data->pwm)) { + while (!nrfx_pwm_stopped_check(&config->pwm)) { } } @@ -286,7 +266,7 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, * until another playback is requested (new values will be * loaded then) or the PWM peripheral is stopped. */ - nrfx_pwm_simple_playback(&data->pwm, &config->seq, 1, + nrfx_pwm_simple_playback(&config->pwm, &config->seq, 1, NRFX_PWM_FLAG_NO_EVT_FINISHED); } @@ -311,8 +291,6 @@ static DEVICE_API(pwm, pwm_nrfx_drv_api_funcs) = { static int pwm_resume(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; - struct pwm_nrfx_data *data = dev->data; - uint8_t initially_inverted = 0; (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); @@ -320,7 +298,7 @@ static int pwm_resume(const struct device *dev) for (size_t i = 0; i < NRF_PWM_CHANNEL_COUNT; i++) { uint32_t psel; - if (channel_psel_get(i, &psel, data)) { + if (channel_psel_get(i, &psel, config)) { /* Mark channels as inverted according to what initial * state of their outputs has been set by pinctrl (high * idle state means that the channel is inverted). @@ -342,7 +320,6 @@ static int pwm_resume(const struct device *dev) static int pwm_suspend(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; - struct pwm_nrfx_data *data = dev->data; int ret = stop_pwm(dev); @@ -351,7 +328,7 @@ static int pwm_suspend(const struct device *dev) return ret; } - while (!nrfx_pwm_stopped_check(&data->pwm)) { + while (!nrfx_pwm_stopped_check(&config->pwm)) { } memset(dev->data, 0, sizeof(struct pwm_nrfx_data)); @@ -377,9 +354,7 @@ static int pwm_nrfx_pm_action(const struct device *dev, static int pwm_nrfx_init(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; - struct pwm_nrfx_data *data = dev->data; - - int err; + nrfx_err_t err; ANOMALY_109_EGU_IRQ_CONNECT(NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE); @@ -387,70 +362,71 @@ static int pwm_nrfx_init(const struct device *dev) (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); } - err = nrfx_pwm_init(&data->pwm, &config->initial_config, pwm_handler, dev->data); - if (err < 0) { + err = nrfx_pwm_init(&config->pwm, &config->initial_config, pwm_handler, dev->data); + if (err != NRFX_SUCCESS) { LOG_ERR("Failed to initialize device: %s", dev->name); - return err; + return -EBUSY; } return pm_device_driver_init(dev, pwm_nrfx_pm_action); } -#define PWM_MEM_REGION(inst) DT_PHANDLE(DT_DRV_INST(inst), memory_regions) +#define PWM_MEM_REGION(idx) DT_PHANDLE(PWM(idx), memory_regions) -#define PWM_MEMORY_SECTION(inst) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(inst), memory_regions), \ +#define PWM_MEMORY_SECTION(idx) \ + COND_CODE_1(PWM_HAS_PROP(idx, memory_regions), \ (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ - PWM_MEM_REGION(inst)))))), \ + PWM_MEM_REGION(idx)))))), \ ()) -#define PWM_GET_MEM_ATTR(inst) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(inst), memory_regions), \ - (DT_PROP_OR(PWM_MEM_REGION(inst), zephyr_memory_attr, 0)), (0)) - -#define PWM_NRFX_DEFINE(inst) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ - static struct pwm_nrfx_data pwm_nrfx_##inst##_data = { \ - .pwm = NRFX_PWM_INSTANCE(DT_INST_REG_ADDR(inst)), \ - }; \ - static uint16_t pwm_##inst##_seq_values[NRF_PWM_CHANNEL_COUNT] \ - PWM_MEMORY_SECTION(inst); \ - PINCTRL_DT_INST_DEFINE(inst); \ - static const struct pwm_nrfx_config pwm_nrfx_##inst##_config = { \ - .initial_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .base_clock = NRF_PWM_CLK_1MHz, \ - .count_mode = (DT_INST_PROP(inst, center_aligned) \ - ? NRF_PWM_MODE_UP_AND_DOWN \ - : NRF_PWM_MODE_UP), \ - .top_value = 1000, \ - .load_mode = NRF_PWM_LOAD_INDIVIDUAL, \ - .step_mode = NRF_PWM_STEP_TRIGGERED, \ - }, \ - .seq.values.p_raw = pwm_##inst##_seq_values, \ - .seq.length = NRF_PWM_CHANNEL_COUNT, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ - .clock_freq = COND_CODE_1(DT_INST_CLOCKS_HAS_IDX(inst, 0), \ - (DT_PROP(DT_INST_CLOCKS_CTLR(inst), clock_frequency)), \ - (16ul * 1000ul * 1000ul)), \ - IF_ENABLED(CONFIG_DCACHE, \ - (.mem_attr = PWM_GET_MEM_ATTR(inst),)) \ - }; \ - static int pwm_nrfx_init##inst(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ - nrfx_pwm_irq_handler, &pwm_nrfx_##inst##_data.pwm, 0); \ - return pwm_nrfx_init(dev); \ - }; \ - PM_DEVICE_DT_INST_DEFINE(inst, pwm_nrfx_pm_action); \ - DEVICE_DT_INST_DEINIT_DEFINE(inst, \ - pwm_nrfx_init##inst, NULL, \ - PM_DEVICE_DT_INST_GET(inst), \ - &pwm_nrfx_##inst##_data, \ - &pwm_nrfx_##inst##_config, \ - POST_KERNEL, CONFIG_PWM_INIT_PRIORITY, \ - &pwm_nrfx_drv_api_funcs) - -DT_INST_FOREACH_STATUS_OKAY(PWM_NRFX_DEFINE) +#define PWM_GET_MEM_ATTR(idx) \ + COND_CODE_1(PWM_HAS_PROP(idx, memory_regions), \ + (DT_PROP_OR(PWM_MEM_REGION(idx), zephyr_memory_attr, 0)), (0)) + +#define PWM_NRFX_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ + static struct pwm_nrfx_data pwm_nrfx_##idx##_data; \ + static uint16_t pwm_##idx##_seq_values[NRF_PWM_CHANNEL_COUNT] \ + PWM_MEMORY_SECTION(idx); \ + PINCTRL_DT_DEFINE(PWM(idx)); \ + static const struct pwm_nrfx_config pwm_nrfx_##idx##_config = { \ + .pwm = NRFX_PWM_INSTANCE(idx), \ + .initial_config = { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .base_clock = NRF_PWM_CLK_1MHz, \ + .count_mode = (PWM_PROP(idx, center_aligned) \ + ? NRF_PWM_MODE_UP_AND_DOWN \ + : NRF_PWM_MODE_UP), \ + .top_value = 1000, \ + .load_mode = NRF_PWM_LOAD_INDIVIDUAL, \ + .step_mode = NRF_PWM_STEP_TRIGGERED, \ + }, \ + .seq.values.p_raw = pwm_##idx##_seq_values, \ + .seq.length = NRF_PWM_CHANNEL_COUNT, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(PWM(idx)), \ + .clock_freq = COND_CODE_1(DT_CLOCKS_HAS_IDX(PWM(idx), 0), \ + (DT_PROP(DT_CLOCKS_CTLR(PWM(idx)), clock_frequency)), \ + (16ul * 1000ul * 1000ul)), \ + IF_ENABLED(CONFIG_DCACHE, \ + (.mem_attr = PWM_GET_MEM_ATTR(idx),)) \ + }; \ + static int pwm_nrfx_init##idx(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(PWM(idx)), DT_IRQ(PWM(idx), priority), \ + nrfx_isr, nrfx_pwm_##idx##_irq_handler, 0); \ + return pwm_nrfx_init(dev); \ + }; \ + PM_DEVICE_DT_DEFINE(PWM(idx), pwm_nrfx_pm_action); \ + DEVICE_DT_DEFINE(PWM(idx), \ + pwm_nrfx_init##idx, PM_DEVICE_DT_GET(PWM(idx)), \ + &pwm_nrfx_##idx##_data, \ + &pwm_nrfx_##idx##_config, \ + POST_KERNEL, CONFIG_PWM_INIT_PRIORITY, \ + &pwm_nrfx_drv_api_funcs) + +#define COND_PWM_NRFX_DEVICE(unused, prefix, i, _) \ + IF_ENABLED(CONFIG_HAS_HW_NRF_PWM##prefix##i, (PWM_NRFX_DEVICE(prefix##i);)) + +NRFX_FOREACH_PRESENT(PWM, COND_PWM_NRFX_DEVICE, (), (), _) diff --git a/drivers/sensor/nordic/qdec_nrfx/Kconfig b/drivers/sensor/nordic/qdec_nrfx/Kconfig index a69c234caac9..71c3ab1d5b0d 100644 --- a/drivers/sensor/nordic/qdec_nrfx/Kconfig +++ b/drivers/sensor/nordic/qdec_nrfx/Kconfig @@ -5,7 +5,12 @@ config QDEC_NRFX bool "Nordic QDEC nrfx driver" default y depends on DT_HAS_NORDIC_NRF_QDEC_ENABLED - select NRFX_QDEC + select NRFX_QDEC0 if HAS_HW_NRF_QDEC0 + select NRFX_QDEC1 if HAS_HW_NRF_QDEC1 + select NRFX_QDEC20 if HAS_HW_NRF_QDEC20 + select NRFX_QDEC21 if HAS_HW_NRF_QDEC21 + select NRFX_QDEC130 if HAS_HW_NRF_QDEC130 + select NRFX_QDEC131 if HAS_HW_NRF_QDEC131 select PINCTRL help Enable support for nrfx QDEC driver for nRF MCU series. diff --git a/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c index 378ce64f497a..0d5eb5ab8cc2 100644 --- a/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c +++ b/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c @@ -43,7 +43,6 @@ BUILD_ASSERT(NRF_QDEC_SAMPLEPER_16384US == SAMPLEPER_16384US, "Different SAMPLEPER register values in devicetree binding and nRF HAL"); struct qdec_nrfx_data { - nrfx_qdec_t qdec; int32_t fetched_acc; int32_t acc; bool overflow; @@ -52,6 +51,7 @@ struct qdec_nrfx_data { }; struct qdec_nrfx_config { + nrfx_qdec_t qdec; nrfx_qdec_config_t config; void (*irq_connect)(void); const struct pinctrl_dev_config *pcfg; @@ -78,6 +78,7 @@ static void accumulate(struct qdec_nrfx_data *data, int32_t acc) static int qdec_nrfx_sample_fetch(const struct device *dev, enum sensor_channel chan) { + const struct qdec_nrfx_config *config = dev->config; struct qdec_nrfx_data *data = dev->data; int32_t acc; uint32_t accdbl; @@ -86,7 +87,7 @@ static int qdec_nrfx_sample_fetch(const struct device *dev, return -ENOTSUP; } - nrfx_qdec_accumulators_read(&data->qdec, &acc, &accdbl); + nrfx_qdec_accumulators_read(&config->qdec, &acc, &accdbl); accumulate(data, acc); @@ -211,9 +212,8 @@ static DEVICE_API(sensor, qdec_nrfx_driver_api) = { static void qdec_pm_suspend(const struct device *dev) { const struct qdec_nrfx_config *config = dev->config; - struct qdec_nrfx_data *dev_data = dev->data; - nrfx_qdec_disable(&dev_data->qdec); + nrfx_qdec_disable(&config->qdec); qdec_nrfx_gpio_ctrl(dev, false); (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); @@ -222,11 +222,10 @@ static void qdec_pm_suspend(const struct device *dev) static void qdec_pm_resume(const struct device *dev) { const struct qdec_nrfx_config *config = dev->config; - struct qdec_nrfx_data *dev_data = dev->data; (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); qdec_nrfx_gpio_ctrl(dev, true); - nrfx_qdec_enable(&dev_data->qdec); + nrfx_qdec_enable(&config->qdec); } static int qdec_nrfx_pm_action(const struct device *dev, enum pm_device_action action) @@ -252,15 +251,13 @@ static int qdec_nrfx_pm_action(const struct device *dev, enum pm_device_action a static int qdec_nrfx_init(const struct device *dev) { const struct qdec_nrfx_config *config = dev->config; - struct qdec_nrfx_data *dev_data = dev->data; - int nerr; + nrfx_err_t nerr; config->irq_connect(); - nerr = nrfx_qdec_init(&dev_data->qdec, &config->config, qdec_nrfx_event_handler, - (void *)dev); - if (nerr != 0) { - return -EALREADY; + nerr = nrfx_qdec_init(&config->qdec, &config->config, qdec_nrfx_event_handler, (void *)dev); + if (nerr != NRFX_SUCCESS) { + return (nerr == NRFX_ERROR_INVALID_STATE) ? -EBUSY : -EFAULT; } /* End up in suspend state. */ @@ -272,6 +269,9 @@ static int qdec_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, qdec_nrfx_pm_action); } +#define QDEC(idx) DT_NODELABEL(qdec##idx) +#define QDEC_PROP(idx, prop) DT_PROP(QDEC(idx), prop) + /* Macro determines PM actions interrupt safety level. * * Requesting/releasing QDEC device may be ISR safe, but it cannot be reliably known whether @@ -279,56 +279,78 @@ static int qdec_nrfx_init(const struct device *dev) * no longer ISR safe. This macro let's us check if we will be requesting/releasing * power domains and determines PM device ISR safety value. */ -#define QDEC_PM_ISR_SAFE(inst) \ - COND_CODE_1( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND(DT_INST_NODE_HAS_PROP(inst, power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_INST_PHANDLE(inst, power_domains))) \ - ), \ - (0), \ - (PM_DEVICE_ISR_SAFE) \ +#define QDEC_PM_ISR_SAFE(idx) \ + COND_CODE_1( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND( \ + DT_NODE_HAS_PROP(QDEC(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(QDEC(idx), power_domains)) \ + ) \ + ), \ + (0), \ + (PM_DEVICE_ISR_SAFE) \ ) -#define SENSOR_NRFX_QDEC_DEVICE(inst) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ - BUILD_ASSERT(DT_INST_PROP(inst, steps) > 0, \ - "Wrong QDEC"#inst" steps setting in dts. Only positive number valid"); \ - BUILD_ASSERT(DT_INST_PROP(inst, steps) <= 2048, \ - "Wrong QDEC"#inst" steps setting in dts. Overflow possible"); \ - static struct qdec_nrfx_data qdec_##inst##_data = { \ - .qdec = NRFX_QDEC_INSTANCE(DT_INST_REG_ADDR(inst)), \ - }; \ - static void irq_connect##inst(void) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ - nrfx_qdec_irq_handler, &qdec_##inst##_data.qdec, 0); \ - } \ - PINCTRL_DT_DEFINE(DT_DRV_INST(inst)); \ - static struct qdec_nrfx_config qdec_##inst##_config = { \ - .config = { \ - .reportper = NRF_QDEC_REPORTPER_40, \ - .sampleper = DT_STRING_TOKEN(DT_DRV_INST(inst), nordic_period), \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .ledpre = DT_INST_PROP(inst, led_pre), \ - .ledpol = NRF_QDEC_LEPOL_ACTIVE_HIGH, \ - .reportper_inten = true, \ - }, \ - .irq_connect = irq_connect##inst, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(DT_DRV_INST(inst)), \ - .enable_pin = DT_PROP_OR( \ - DT_DRV_INST(inst), enable_pin, NRF_QDEC_PIN_NOT_CONNECTED), \ - .steps = DT_INST_PROP(inst, steps), \ - }; \ - PM_DEVICE_DT_INST_DEFINE(inst, qdec_nrfx_pm_action, QDEC_PM_ISR_SAFE(inst)); \ - SENSOR_DEVICE_DT_DEFINE(DT_DRV_INST(inst), \ - qdec_nrfx_init, \ - PM_DEVICE_DT_INST_GET(inst), \ - &qdec_##inst##_data, \ - &qdec_##inst##_config, \ - POST_KERNEL, \ - CONFIG_SENSOR_INIT_PRIORITY, \ +#define SENSOR_NRFX_QDEC_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QDEC(idx)); \ + BUILD_ASSERT(QDEC_PROP(idx, steps) > 0, \ + "Wrong QDEC"#idx" steps setting in dts. Only positive number valid"); \ + BUILD_ASSERT(QDEC_PROP(idx, steps) <= 2048, \ + "Wrong QDEC"#idx" steps setting in dts. Overflow possible"); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(QDEC(idx)), DT_IRQ(QDEC(idx), priority), \ + nrfx_isr, nrfx_qdec_##idx##_irq_handler, 0); \ + } \ + static struct qdec_nrfx_data qdec_##idx##_data; \ + PINCTRL_DT_DEFINE(QDEC(idx)); \ + static struct qdec_nrfx_config qdec_##idx##_config = { \ + .qdec = NRFX_QDEC_INSTANCE(idx), \ + .config = { \ + .reportper = NRF_QDEC_REPORTPER_40, \ + .sampleper = DT_STRING_TOKEN(QDEC(idx), nordic_period), \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .ledpre = QDEC_PROP(idx, led_pre), \ + .ledpol = NRF_QDEC_LEPOL_ACTIVE_HIGH, \ + .reportper_inten = true, \ + }, \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(QDEC(idx)), \ + .enable_pin = DT_PROP_OR(QDEC(idx), enable_pin, NRF_QDEC_PIN_NOT_CONNECTED), \ + .steps = QDEC_PROP(idx, steps), \ + }; \ + PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, QDEC_PM_ISR_SAFE(idx)); \ + SENSOR_DEVICE_DT_DEFINE(QDEC(idx), \ + qdec_nrfx_init, \ + PM_DEVICE_DT_GET(QDEC(idx)), \ + &qdec_##idx##_data, \ + &qdec_##idx##_config, \ + POST_KERNEL, \ + CONFIG_SENSOR_INIT_PRIORITY, \ &qdec_nrfx_driver_api) -DT_INST_FOREACH_STATUS_OKAY(SENSOR_NRFX_QDEC_DEVICE) +#ifdef CONFIG_HAS_HW_NRF_QDEC0 +SENSOR_NRFX_QDEC_DEVICE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_QDEC1 +SENSOR_NRFX_QDEC_DEVICE(1); +#endif + +#ifdef CONFIG_HAS_HW_NRF_QDEC20 +SENSOR_NRFX_QDEC_DEVICE(20); +#endif + +#ifdef CONFIG_HAS_HW_NRF_QDEC21 +SENSOR_NRFX_QDEC_DEVICE(21); +#endif + +#ifdef CONFIG_HAS_HW_NRF_QDEC130 +SENSOR_NRFX_QDEC_DEVICE(130); +#endif + +#ifdef CONFIG_HAS_HW_NRF_QDEC131 +SENSOR_NRFX_QDEC_DEVICE(131); +#endif diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 8ce35b591634..722cc11da071 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -206,25 +206,37 @@ nrfx_uart_num = 137 rsource "Kconfig.nrfx_uart_instance" endif -config NRFX_TIMER +config NRFX_TIMER0 default y depends on UART_0_NRF_HW_ASYNC_TIMER = 0 \ || UART_1_NRF_HW_ASYNC_TIMER = 0 \ || UART_2_NRF_HW_ASYNC_TIMER = 0 \ - || UART_3_NRF_HW_ASYNC_TIMER = 0 \ - || UART_0_NRF_HW_ASYNC_TIMER = 1 \ + || UART_3_NRF_HW_ASYNC_TIMER = 0 + +config NRFX_TIMER1 + default y + depends on UART_0_NRF_HW_ASYNC_TIMER = 1 \ || UART_1_NRF_HW_ASYNC_TIMER = 1 \ || UART_2_NRF_HW_ASYNC_TIMER = 1 \ - || UART_3_NRF_HW_ASYNC_TIMER = 1 \ - || UART_0_NRF_HW_ASYNC_TIMER = 2 \ + || UART_3_NRF_HW_ASYNC_TIMER = 1 + +config NRFX_TIMER2 + default y + depends on UART_0_NRF_HW_ASYNC_TIMER = 2 \ || UART_1_NRF_HW_ASYNC_TIMER = 2 \ || UART_2_NRF_HW_ASYNC_TIMER = 2 \ - || UART_3_NRF_HW_ASYNC_TIMER = 2 \ - || UART_0_NRF_HW_ASYNC_TIMER = 3 \ + || UART_3_NRF_HW_ASYNC_TIMER = 2 + +config NRFX_TIMER3 + default y + depends on UART_0_NRF_HW_ASYNC_TIMER = 3 \ || UART_1_NRF_HW_ASYNC_TIMER = 3 \ || UART_2_NRF_HW_ASYNC_TIMER = 3 \ - || UART_3_NRF_HW_ASYNC_TIMER = 3 \ - || UART_0_NRF_HW_ASYNC_TIMER = 4 \ + || UART_3_NRF_HW_ASYNC_TIMER = 3 + +config NRFX_TIMER4 + default y + depends on UART_0_NRF_HW_ASYNC_TIMER = 4 \ || UART_1_NRF_HW_ASYNC_TIMER = 4 \ || UART_2_NRF_HW_ASYNC_TIMER = 4 \ || UART_3_NRF_HW_ASYNC_TIMER = 4 diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 7a32cb11e737..a60a1ee97aa1 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -187,8 +187,8 @@ struct uarte_async_rx_cbwt { uint8_t *anomaly_byte_dst; uint8_t anomaly_byte; #endif - nrfx_gppi_handle_t ppi_h; uint8_t bounce_idx; + uint8_t ppi_ch; bool in_irq; bool discard_fifo; }; @@ -217,7 +217,7 @@ struct uarte_async_rx { int32_t timeout_slab; /* rx_timeout divided by RX_TIMEOUT_DIV */ int32_t timeout_left; /* Current time left until user callback */ union { - nrfx_gppi_handle_t ppi; + uint8_t ppi; uint32_t cnt; } cnt; /* Flag to ensure that RX timeout won't be executed during ENDRX ISR */ @@ -264,12 +264,11 @@ struct uarte_nrfx_data { #endif #ifdef UARTE_ANY_ASYNC struct uarte_async_cb *async; - nrfx_timer_t timer; #endif atomic_val_t poll_out_lock; atomic_t flags; #ifdef UARTE_ENHANCED_POLL_OUT - nrfx_gppi_handle_t ppi_h_endtx; + uint8_t ppi_ch_endtx; #endif }; @@ -389,6 +388,7 @@ struct uarte_nrfx_config { size_t bounce_buf_swap_len; struct uarte_async_rx_cbwt *cbwt_data; #endif + nrfx_timer_t timer; uint8_t *tx_cache; uint8_t *rx_flush_buf; #endif @@ -457,7 +457,7 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) #if defined(UARTE_ANY_ASYNC) && !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) if (data->async && HW_RX_COUNTING_ENABLED(config)) { - nrfx_timer_disable(&data->timer); + nrfx_timer_disable(&config->timer); /* Timer/counter value is reset when disabled. */ data->async->rx.total_byte_cnt = 0; data->async->rx.total_user_byte_cnt = 0; @@ -604,7 +604,7 @@ 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_STOP_MODES +#if defined(UARTE_CONFIG_STOP_Msk) switch (cfg->stop_bits) { case UART_CFG_STOP_BITS_1: uarte_cfg.stop = NRF_UARTE_STOP_ONE; @@ -636,7 +636,7 @@ static int uarte_nrfx_configure(const struct device *dev, return -ENOTSUP; } -#if NRF_UARTE_HAS_PARITY_TYPES +#if defined(UARTE_CONFIG_PARITYTYPE_Msk) uarte_cfg.paritytype = NRF_UARTE_PARITYTYPE_EVEN; #endif switch (cfg->parity) { @@ -646,7 +646,7 @@ static int uarte_nrfx_configure(const struct device *dev, case UART_CFG_PARITY_EVEN: uarte_cfg.parity = NRF_UARTE_PARITY_INCLUDED; break; -#if NRF_UARTE_HAS_PARITY_TYPES +#if defined(UARTE_CONFIG_PARITYTYPE_Msk) case UART_CFG_PARITY_ODD: uarte_cfg.parity = NRF_UARTE_PARITY_INCLUDED; uarte_cfg.paritytype = NRF_UARTE_PARITYTYPE_ODD; @@ -765,7 +765,7 @@ static void uarte_periph_enable(const struct device *dev) #ifdef UARTE_ANY_ASYNC if (data->async) { if (HW_RX_COUNTING_ENABLED(config)) { - nrfx_timer_t *timer = &data->timer; + const nrfx_timer_t *timer = &config->timer; nrfx_timer_enable(timer); @@ -954,30 +954,31 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) if (HW_RX_COUNTING_ENABLED(cfg)) { nrfx_timer_config_t tmr_config = NRFX_TIMER_DEFAULT_CONFIG( - NRF_TIMER_BASE_FREQUENCY_GET(data->timer.p_reg)); + NRF_TIMER_BASE_FREQUENCY_GET(cfg->timer.p_reg)); uint32_t evt_addr = nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_RXDRDY); - uint32_t tsk_addr = nrfx_timer_task_address_get(&data->timer, NRF_TIMER_TASK_COUNT); + uint32_t tsk_addr = nrfx_timer_task_address_get(&cfg->timer, NRF_TIMER_TASK_COUNT); tmr_config.mode = NRF_TIMER_MODE_COUNTER; tmr_config.bit_width = NRF_TIMER_BIT_WIDTH_32; - ret = nrfx_timer_init(&data->timer, + ret = nrfx_timer_init(&cfg->timer, &tmr_config, timer_handler); - if (ret != 0) { + if (ret != NRFX_SUCCESS) { LOG_ERR("Timer already initialized"); return -EINVAL; } - nrfx_timer_clear(&data->timer); + nrfx_timer_clear(&cfg->timer); - ret = nrfx_gppi_conn_alloc(evt_addr, tsk_addr, &data->async->rx.cnt.ppi); - if (ret < 0) { + ret = nrfx_gppi_channel_alloc(&data->async->rx.cnt.ppi); + if (ret != NRFX_SUCCESS) { LOG_ERR("Failed to allocate PPI Channel"); - nrfx_timer_uninit(&data->timer); - return ret; + nrfx_timer_uninit(&cfg->timer); + return -EINVAL; } - nrfx_gppi_conn_enable(data->async->rx.cnt.ppi); + nrfx_gppi_channel_endpoints_setup(data->async->rx.cnt.ppi, evt_addr, tsk_addr); + nrfx_gppi_channels_enable(BIT(data->async->rx.cnt.ppi)); } else { nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); } @@ -1608,17 +1609,18 @@ static int cbwt_uarte_async_init(const struct device *dev) NRF_UARTE_INT_RXTO_MASK; uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT); - int ret; + nrfx_err_t ret; nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER); nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32); - ret = nrfx_gppi_conn_alloc(evt, tsk, &cbwt_data->ppi_h); - if (ret < 0) { - return ret; + ret = nrfx_gppi_channel_alloc(&cbwt_data->ppi_ch); + if (ret != NRFX_SUCCESS) { + return -ENOMEM; } - nrfx_gppi_conn_enable(cbwt_data->ppi_h); + nrfx_gppi_channel_endpoints_setup(cbwt_data->ppi_ch, evt, tsk); + nrfx_gppi_channels_enable(BIT(cbwt_data->ppi_ch)); #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; @@ -2115,7 +2117,7 @@ static void rx_timeout(struct k_timer *timer) NRF_UARTE_INT_ENDRX_MASK); if (HW_RX_COUNTING_ENABLED(cfg)) { - read = nrfx_timer_capture(&data->timer, 0); + read = nrfx_timer_capture(&cfg->timer, 0); } else { read = async_rx->cnt.cnt; } @@ -2999,17 +3001,18 @@ static DEVICE_API(uart, uart_nrfx_uarte_driver_api) = { static int endtx_stoptx_ppi_init(NRF_UARTE_Type *uarte, struct uarte_nrfx_data *data) { - int ret; + nrfx_err_t ret; - ret = nrfx_gppi_conn_alloc( - nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_ENDTX), - nrf_uarte_task_address_get(uarte, NRF_UARTE_TASK_STOPTX), &data->ppi_h_endtx); - if (ret < 0) { + ret = nrfx_gppi_channel_alloc(&data->ppi_ch_endtx); + if (ret != NRFX_SUCCESS) { LOG_ERR("Failed to allocate PPI Channel"); - return ret; + return -EIO; } - nrfx_gppi_conn_enable(data->ppi_h_endtx); + nrfx_gppi_channel_endpoints_setup(data->ppi_ch_endtx, + nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_ENDTX), + nrf_uarte_task_address_get(uarte, NRF_UARTE_TASK_STOPTX)); + nrfx_gppi_channels_enable(BIT(data->ppi_ch_endtx)); return 0; } @@ -3089,7 +3092,7 @@ static void uarte_pm_suspend(const struct device *dev) #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) if (data->async && HW_RX_COUNTING_ENABLED(cfg)) { - nrfx_timer_disable(&data->timer); + nrfx_timer_disable(&cfg->timer); /* Timer/counter value is reset when disabled. */ data->async->rx.total_byte_cnt = 0; data->async->rx.total_user_byte_cnt = 0; @@ -3408,9 +3411,6 @@ static int uarte_instance_deinit(const struct device *dev) (.uart_config = UARTE_CONFIG(idx),)) \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ (.async = &uarte##idx##_async,)) \ - IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ - (.timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET( \ - CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER)),)) \ IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \ (.int_driven = &uarte##idx##_int_driven,)) \ }; \ @@ -3452,6 +3452,9 @@ static int uarte_instance_deinit(const struct device *dev) .rx_flush_buf = uarte##idx##_flush_buf,)) \ IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ (UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx))) \ + IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ + (.timer = NRFX_TIMER_INSTANCE( \ + CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ }; \ UARTE_DIRECT_ISR_DECLARE(idx) \ static int uarte_##idx##_init(const struct device *dev) \ diff --git a/drivers/spi/Kconfig.nrfx b/drivers/spi/Kconfig.nrfx index 990f044574ba..e609a6c4933c 100644 --- a/drivers/spi/Kconfig.nrfx +++ b/drivers/spi/Kconfig.nrfx @@ -22,13 +22,73 @@ config SPI_NRFX_SPI config SPI_NRFX_SPIM def_bool y depends on DT_HAS_NORDIC_NRF_SPIM_ENABLED - select NRFX_SPIM + select NRFX_SPIM0 if HAS_HW_NRF_SPIM0 + select NRFX_SPIM1 if HAS_HW_NRF_SPIM1 + select NRFX_SPIM2 if HAS_HW_NRF_SPIM2 + select NRFX_SPIM3 if HAS_HW_NRF_SPIM3 + select NRFX_SPIM4 if HAS_HW_NRF_SPIM4 + select NRFX_SPIM00 if HAS_HW_NRF_SPIM00 + select NRFX_SPIM01 if HAS_HW_NRF_SPIM01 + select NRFX_SPIM20 if HAS_HW_NRF_SPIM20 + select NRFX_SPIM21 if HAS_HW_NRF_SPIM21 + select NRFX_SPIM22 if HAS_HW_NRF_SPIM22 + select NRFX_SPIM23 if HAS_HW_NRF_SPIM23 + select NRFX_SPIM24 if HAS_HW_NRF_SPIM24 + select NRFX_SPIM30 if HAS_HW_NRF_SPIM30 + select NRFX_SPIM120 if HAS_HW_NRF_SPIM120 + select NRFX_SPIM121 if HAS_HW_NRF_SPIM121 + select NRFX_SPIM130 if HAS_HW_NRF_SPIM130 + select NRFX_SPIM131 if HAS_HW_NRF_SPIM131 + select NRFX_SPIM132 if HAS_HW_NRF_SPIM132 + select NRFX_SPIM133 if HAS_HW_NRF_SPIM133 + select NRFX_SPIM134 if HAS_HW_NRF_SPIM134 + select NRFX_SPIM135 if HAS_HW_NRF_SPIM135 + select NRFX_SPIM136 if HAS_HW_NRF_SPIM136 + select NRFX_SPIM137 if HAS_HW_NRF_SPIM137 config SPI_NRFX_SPIS def_bool y depends on DT_HAS_NORDIC_NRF_SPIS_ENABLED select SPI_SLAVE - select NRFX_SPIS + select NRFX_SPIS0 if HAS_HW_NRF_SPIS0 + select NRFX_SPIS1 if HAS_HW_NRF_SPIS1 + select NRFX_SPIS2 if HAS_HW_NRF_SPIS2 + select NRFX_SPIS3 if HAS_HW_NRF_SPIS3 + select NRFX_SPIS00 if HAS_HW_NRF_SPIS00 + select NRFX_SPIS01 if HAS_HW_NRF_SPIS01 + select NRFX_SPIS20 if HAS_HW_NRF_SPIS20 + select NRFX_SPIS21 if HAS_HW_NRF_SPIS21 + select NRFX_SPIS22 if HAS_HW_NRF_SPIS22 + select NRFX_SPIS23 if HAS_HW_NRF_SPIS23 + select NRFX_SPIS24 if HAS_HW_NRF_SPIS24 + select NRFX_SPIS30 if HAS_HW_NRF_SPIS30 + select NRFX_SPIS120 if HAS_HW_NRF_SPIS120 + select NRFX_SPIS130 if HAS_HW_NRF_SPIS130 + select NRFX_SPIS131 if HAS_HW_NRF_SPIS131 + select NRFX_SPIS132 if HAS_HW_NRF_SPIS132 + select NRFX_SPIS133 if HAS_HW_NRF_SPIS133 + select NRFX_SPIS134 if HAS_HW_NRF_SPIS134 + select NRFX_SPIS135 if HAS_HW_NRF_SPIS135 + select NRFX_SPIS136 if HAS_HW_NRF_SPIS136 + select NRFX_SPIS137 if HAS_HW_NRF_SPIS137 + +config SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 + depends on SOC_NRF52832 + select NRFX_PPI + bool "Allow enabling the SPIM driver despite PAN 58" + help + Allow enabling the nRF SPI Master with EasyDMA, despite + Product Anomaly Notice 58 (SPIM: An additional byte is + clocked out when RXD.MAXCNT == 1 and TXD.MAXCNT <= 1). + Without this override, the SPI Master is only available + without EasyDMA. Note that the 'SPIM' and 'SPIS' drivers + use EasyDMA, while the 'SPI' driver does not. + When used in conjunction with nRF SPIM Devicetree property + 'anomaly-58-workaround' a workaround can be enabled per SPIM + instance. If you are certain that transactions with + RXD.MAXCNT == 1 and TXD.MAXCNT <= 1 will NOT be executed + then nRF52832 PPI and GPIOTE resources can be saved by not + enabling 'anomaly-58-workaround' via the Devicetree. config SPI_NRFX_RAM_BUFFER_SIZE int "Size of RAM buffers for SPIM peripherals" diff --git a/drivers/spi/spi_nrfx_common.c b/drivers/spi/spi_nrfx_common.c index 17fd3f52ba33..04a11c2367a9 100644 --- a/drivers/spi/spi_nrfx_common.c +++ b/drivers/spi/spi_nrfx_common.c @@ -7,7 +7,7 @@ #include "spi_nrfx_common.h" #include -int spi_nrfx_wake_init(nrfx_gpiote_t *gpiote, uint32_t wake_pin) +int spi_nrfx_wake_init(const nrfx_gpiote_t *gpiote, uint32_t wake_pin) { nrf_gpio_pin_pull_t pull_config = NRF_GPIO_PIN_PULLDOWN; uint8_t ch; @@ -20,23 +20,23 @@ int spi_nrfx_wake_init(nrfx_gpiote_t *gpiote, uint32_t wake_pin) .p_trigger_config = &trigger_config, .p_handler_config = NULL, }; - int res; + nrfx_err_t res; res = nrfx_gpiote_channel_alloc(gpiote, &ch); - if (res < 0) { - return res; + if (res != NRFX_SUCCESS) { + return -ENODEV; } res = nrfx_gpiote_input_configure(gpiote, wake_pin, &input_config); - if (res < 0) { + if (res != NRFX_SUCCESS) { nrfx_gpiote_channel_free(gpiote, ch); - return res; + return -EIO; } return 0; } -int spi_nrfx_wake_request(nrfx_gpiote_t *gpiote, uint32_t wake_pin) +int spi_nrfx_wake_request(const nrfx_gpiote_t *gpiote, uint32_t wake_pin) { nrf_gpiote_event_t trigger_event = nrfx_gpiote_in_event_get(gpiote, wake_pin); uint32_t start_cycles; diff --git a/drivers/spi/spi_nrfx_common.h b/drivers/spi/spi_nrfx_common.h index 9a0894410783..0cf17e2a0356 100644 --- a/drivers/spi/spi_nrfx_common.h +++ b/drivers/spi/spi_nrfx_common.h @@ -9,18 +9,16 @@ #include #include -#include -#include #define WAKE_PIN_NOT_USED UINT32_MAX -#define WAKE_GPIOTE_NODE(node_id) \ - COND_CODE_1(DT_NODE_HAS_PROP(node_id, wake_gpios), \ - (&GPIOTE_NRFX_INST_BY_NODE(DT_PHANDLE(DT_PHANDLE(node_id, wake_gpios), \ - gpiote_instance))), \ - (NULL)) +#define WAKE_GPIOTE_INSTANCE(node_id) \ + COND_CODE_1(DT_NODE_HAS_PROP(node_id, wake_gpios), \ + (NRFX_GPIOTE_INSTANCE( \ + NRF_DT_GPIOTE_INST(node_id, wake_gpios))), \ + ({0})) -int spi_nrfx_wake_init(nrfx_gpiote_t *gpiote, uint32_t wake_pin); -int spi_nrfx_wake_request(nrfx_gpiote_t *gpiote, uint32_t wake_pin); +int spi_nrfx_wake_init(const nrfx_gpiote_t *gpiote, uint32_t wake_pin); +int spi_nrfx_wake_request(const nrfx_gpiote_t *gpiote, uint32_t wake_pin); #endif /* ZEPHYR_DRIVERS_SPI_NRFX_COMMON_H_ */ diff --git a/drivers/spi/spi_nrfx_spi.c b/drivers/spi/spi_nrfx_spi.c index 10badb033d97..7608f3ab9487 100644 --- a/drivers/spi/spi_nrfx_spi.c +++ b/drivers/spi/spi_nrfx_spi.c @@ -31,8 +31,8 @@ struct spi_nrfx_config { nrfx_spi_config_t def_config; void (*irq_connect)(void); const struct pinctrl_dev_config *pcfg; - nrfx_gpiote_t *wake_gpiote; uint32_t wake_pin; + nrfx_gpiote_t wake_gpiote; }; static void event_handler(const nrfx_spi_evt_t *p_event, void *p_context); @@ -91,7 +91,7 @@ static int configure(const struct device *dev, const struct spi_nrfx_config *dev_config = dev->config; struct spi_context *ctx = &dev_data->ctx; nrfx_spi_config_t config; - int result; + nrfx_err_t result; uint32_t sck_pin; if (dev_data->initialized && spi_context_configured(ctx, spi_cfg)) { @@ -149,8 +149,8 @@ static int configure(const struct device *dev, result = nrfx_spi_init(&dev_config->spi, &config, event_handler, dev_data); - if (result != 0) { - LOG_ERR("Failed to initialize nrfx driver: %d", result); + if (result != NRFX_SUCCESS) { + LOG_ERR("Failed to initialize nrfx driver: %08x", result); return -EIO; } @@ -183,6 +183,7 @@ static void transfer_next_chunk(const struct device *dev) if (chunk_len > 0) { nrfx_spi_xfer_desc_t xfer; + nrfx_err_t result; dev_data->chunk_len = chunk_len; @@ -190,8 +191,8 @@ static void transfer_next_chunk(const struct device *dev) xfer.tx_length = spi_context_tx_buf_on(ctx) ? chunk_len : 0; xfer.p_rx_buffer = ctx->rx_buf; xfer.rx_length = spi_context_rx_buf_on(ctx) ? chunk_len : 0; - error = nrfx_spi_xfer(&dev_config->spi, &xfer, 0); - if (error == 0) { + result = nrfx_spi_xfer(&dev_config->spi, &xfer, 0); + if (result == NRFX_SUCCESS) { return; } @@ -240,7 +241,7 @@ static int transceive(const struct device *dev, dev_data->busy = true; if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { - error = spi_nrfx_wake_request(dev_config->wake_gpiote, + error = spi_nrfx_wake_request(&dev_config->wake_gpiote, dev_config->wake_pin); if (error == -ETIMEDOUT) { LOG_WRN("Waiting for WAKE acknowledgment timed out"); @@ -394,7 +395,7 @@ static int spi_nrfx_init(const struct device *dev) } if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { - err = spi_nrfx_wake_init(dev_config->wake_gpiote, dev_config->wake_pin); + err = spi_nrfx_wake_init(&dev_config->wake_gpiote, dev_config->wake_pin); if (err == -ENODEV) { LOG_ERR("Failed to allocate GPIOTE channel for WAKE"); return err; @@ -457,9 +458,9 @@ static int spi_nrfx_init(const struct device *dev) }, \ .irq_connect = irq_connect##idx, \ .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPI(idx)), \ - .wake_gpiote = WAKE_GPIOTE_NODE(SPI(idx)), \ .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPI(idx), wake_gpios, \ WAKE_PIN_NOT_USED), \ + .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPI(idx)), \ }; \ BUILD_ASSERT(!DT_NODE_HAS_PROP(SPI(idx), wake_gpios) || \ !(DT_GPIO_FLAGS(SPI(idx), wake_gpios) & GPIO_ACTIVE_LOW), \ diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 8a658f2ebb8c..390682260c81 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT nordic_nrf_spim - #include #include #include @@ -15,6 +13,9 @@ #include #include #include +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 +#include +#endif #ifdef CONFIG_SOC_NRF5340_CPUAPP #include #endif @@ -29,12 +30,31 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #include "spi_context.h" #include "spi_nrfx_common.h" +#if defined(CONFIG_SOC_NRF52832) && !defined(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58) +#error This driver is not available by default for nRF52832 because of Product Anomaly 58 \ + (SPIM: An additional byte is clocked out when RXD.MAXCNT == 1 and TXD.MAXCNT <= 1). \ + Use CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y to override this limitation. +#endif + #if (CONFIG_SPI_NRFX_RAM_BUFFER_SIZE > 0) #define SPI_BUFFER_IN_RAM 1 #endif +/* + * We use NODELABEL here because the nrfx API requires us to call + * functions which are named according to SoC peripheral instance + * being operated on. Since DT_INST() makes no guarantees about that, + * it won't work. + */ +#define SPIM(idx) DT_NODELABEL(spi##idx) +#define SPIM_PROP(idx, prop) DT_PROP(SPIM(idx), prop) +#define SPIM_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIM(idx), prop) + +/* Execute macro f(x) for all instances. */ +#define SPIM_FOR_EACH_INSTANCE(f, sep, off_code, ...) \ + NRFX_FOREACH_PRESENT(SPIM, f, sep, off_code, __VA_ARGS__) + struct spi_nrfx_data { - nrfx_spim_t spim; struct spi_context ctx; const struct device *dev; size_t chunk_len; @@ -44,25 +64,35 @@ struct spi_nrfx_data { uint8_t *tx_buffer; uint8_t *rx_buffer; #endif +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 + bool anomaly_58_workaround_active; + uint8_t ppi_ch; + uint8_t gpiote_ch; +#endif }; struct spi_nrfx_config { + nrfx_spim_t spim; uint32_t max_freq; nrfx_spim_config_t def_config; void (*irq_connect)(void); uint16_t max_chunk_len; const struct pinctrl_dev_config *pcfg; - nrfx_gpiote_t *wake_gpiote; +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 + bool anomaly_58_workaround; +#endif uint32_t wake_pin; + nrfx_gpiote_t wake_gpiote; void *mem_reg; }; -static void event_handler(const nrfx_spim_event_t *p_event, void *p_context); +static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context); static inline void finalize_spi_transaction(const struct device *dev, bool deactivate_cs) { struct spi_nrfx_data *dev_data = dev->data; - void *reg = dev_data->spim.p_reg; + const struct spi_nrfx_config *dev_config = dev->config; + void *reg = dev_config->spim.p_reg; if (deactivate_cs) { spi_context_cs_control(&dev_data->ctx, false); @@ -137,7 +167,7 @@ static int configure(const struct device *dev, struct spi_context *ctx = &dev_data->ctx; uint32_t max_freq = dev_config->max_freq; nrfx_spim_config_t config; - int result; + nrfx_err_t result; uint32_t sck_pin; if (dev_data->initialized && spi_context_configured(ctx, spi_cfg)) { @@ -195,22 +225,22 @@ static int configure(const struct device *dev, config.mode = get_nrf_spim_mode(spi_cfg->operation); config.bit_order = get_nrf_spim_bit_order(spi_cfg->operation); - sck_pin = nrfy_spim_sck_pin_get(dev_data->spim.p_reg); + sck_pin = nrfy_spim_sck_pin_get(dev_config->spim.p_reg); if (sck_pin != NRF_SPIM_PIN_NOT_CONNECTED) { nrfy_gpio_pin_write(sck_pin, spi_cfg->operation & SPI_MODE_CPOL ? 1 : 0); } if (dev_data->initialized) { - nrfx_spim_uninit(&dev_data->spim); + nrfx_spim_uninit(&dev_config->spim); dev_data->initialized = false; } - result = nrfx_spim_init(&dev_data->spim, &config, + result = nrfx_spim_init(&dev_config->spim, &config, event_handler, (void *)dev); - if (result < 0) { - LOG_ERR("Failed to initialize nrfx driver: %d", result); - return result; + if (result != NRFX_SUCCESS) { + LOG_ERR("Failed to initialize nrfx driver: %08x", result); + return -EIO; } dev_data->initialized = true; @@ -220,6 +250,89 @@ static int configure(const struct device *dev, return 0; } +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 +static const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(0); + +/* + * Brief Workaround for transmitting 1 byte with SPIM. + * + * Derived from the setup_workaround_for_ftpan_58() function from + * the nRF52832 Rev 1 Errata v1.6 document anomaly 58 workaround. + * + * Warning Must not be used when transmitting multiple bytes. + * + * Warning After this workaround is used, the user must reset the PPI + * channel and the GPIOTE channel before attempting to transmit multiple + * bytes. + */ +static void anomaly_58_workaround_setup(const struct device *dev) +{ + struct spi_nrfx_data *dev_data = dev->data; + const struct spi_nrfx_config *dev_config = dev->config; + NRF_SPIM_Type *spim = dev_config->spim.p_reg; + uint32_t ppi_ch = dev_data->ppi_ch; + uint32_t gpiote_ch = dev_data->gpiote_ch; + uint32_t eep = (uint32_t)&gpiote.p_reg->EVENTS_IN[gpiote_ch]; + uint32_t tep = (uint32_t)&spim->TASKS_STOP; + + dev_data->anomaly_58_workaround_active = true; + + /* Create an event when SCK toggles */ + nrf_gpiote_event_configure(gpiote.p_reg, gpiote_ch, spim->PSEL.SCK, + GPIOTE_CONFIG_POLARITY_Toggle); + nrf_gpiote_event_enable(gpiote.p_reg, gpiote_ch); + + /* Stop the spim instance when SCK toggles */ + nrf_ppi_channel_endpoint_setup(NRF_PPI, ppi_ch, eep, tep); + nrf_ppi_channel_enable(NRF_PPI, ppi_ch); + + /* The spim instance cannot be stopped mid-byte, so it will finish + * transmitting the first byte and then stop. Effectively ensuring + * that only 1 byte is transmitted. + */ +} + +static void anomaly_58_workaround_clear(struct spi_nrfx_data *dev_data) +{ + uint32_t ppi_ch = dev_data->ppi_ch; + uint32_t gpiote_ch = dev_data->gpiote_ch; + + if (dev_data->anomaly_58_workaround_active) { + nrf_ppi_channel_disable(NRF_PPI, ppi_ch); + nrf_gpiote_task_disable(gpiote.p_reg, gpiote_ch); + + dev_data->anomaly_58_workaround_active = false; + } +} + +static int anomaly_58_workaround_init(const struct device *dev) +{ + struct spi_nrfx_data *dev_data = dev->data; + const struct spi_nrfx_config *dev_config = dev->config; + nrfx_err_t err_code; + + dev_data->anomaly_58_workaround_active = false; + + if (dev_config->anomaly_58_workaround) { + err_code = nrfx_ppi_channel_alloc(&dev_data->ppi_ch); + if (err_code != NRFX_SUCCESS) { + LOG_ERR("Failed to allocate PPI channel"); + return -ENODEV; + } + + err_code = nrfx_gpiote_channel_alloc(&gpiote, &dev_data->gpiote_ch); + if (err_code != NRFX_SUCCESS) { + LOG_ERR("Failed to allocate GPIOTE channel"); + return -ENODEV; + } + LOG_DBG("PAN 58 workaround enabled for %s: ppi %u, gpiote %u", + dev->name, dev_data->ppi_ch, dev_data->gpiote_ch); + } + + return 0; +} +#endif + static void finish_transaction(const struct device *dev, int error) { struct spi_nrfx_data *dev_data = dev->data; @@ -249,6 +362,7 @@ static void transfer_next_chunk(const struct device *dev) if (chunk_len > 0) { nrfx_spim_xfer_desc_t xfer; + nrfx_err_t result; const uint8_t *tx_buf = ctx->tx_buf; uint8_t *rx_buf = ctx->rx_buf; @@ -258,7 +372,7 @@ static void transfer_next_chunk(const struct device *dev) #ifdef SPI_BUFFER_IN_RAM if (spi_context_tx_buf_on(ctx) && - !nrf_dma_accessible_check(&dev_data->spim.p_reg, tx_buf)) { + !nrf_dma_accessible_check(&dev_config->spim.p_reg, tx_buf)) { if (chunk_len > CONFIG_SPI_NRFX_RAM_BUFFER_SIZE) { chunk_len = CONFIG_SPI_NRFX_RAM_BUFFER_SIZE; @@ -269,7 +383,7 @@ static void transfer_next_chunk(const struct device *dev) } if (spi_context_rx_buf_on(ctx) && - !nrf_dma_accessible_check(&dev_data->spim.p_reg, rx_buf)) { + !nrf_dma_accessible_check(&dev_config->spim.p_reg, rx_buf)) { if (chunk_len > CONFIG_SPI_NRFX_RAM_BUFFER_SIZE) { chunk_len = CONFIG_SPI_NRFX_RAM_BUFFER_SIZE; @@ -296,9 +410,26 @@ static void transfer_next_chunk(const struct device *dev) goto in_alloc_failed; } - error = nrfx_spim_xfer(&dev_data->spim, &xfer, 0); +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 + if (xfer.rx_length == 1 && xfer.tx_length <= 1) { + if (dev_config->anomaly_58_workaround) { + anomaly_58_workaround_setup(dev); + } else { + LOG_WRN("Transaction aborted since it would trigger " + "nRF52832 PAN 58"); + error = -EIO; + } + } +#endif if (error == 0) { - return; + result = nrfx_spim_xfer(&dev_config->spim, &xfer, 0); + if (result == NRFX_SUCCESS) { + return; + } + error = -EIO; +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 + anomaly_58_workaround_clear(dev_data); +#endif } /* On nrfx_spim_xfer() error */ @@ -312,7 +443,7 @@ static void transfer_next_chunk(const struct device *dev) finish_transaction(dev, error); } -static void event_handler(const nrfx_spim_event_t *p_event, void *p_context) +static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context) { const struct device *dev = p_context; struct spi_nrfx_data *dev_data = dev->data; @@ -327,6 +458,10 @@ static void event_handler(const nrfx_spim_event_t *p_event, void *p_context) return; } +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 + anomaly_58_workaround_clear(dev_data); +#endif + if (spi_context_tx_buf_on(&dev_data->ctx)) { dmm_buffer_out_release(dev_config->mem_reg, (void **)p_event->xfer_desc.p_tx_buffer); @@ -363,7 +498,7 @@ static int transceive(const struct device *dev, { struct spi_nrfx_data *dev_data = dev->data; const struct spi_nrfx_config *dev_config = dev->config; - void *reg = dev_data->spim.p_reg; + void *reg = dev_config->spim.p_reg; int error; pm_device_runtime_get(dev); @@ -375,7 +510,7 @@ static int transceive(const struct device *dev, dev_data->busy = true; if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { - error = spi_nrfx_wake_request(dev_config->wake_gpiote, + error = spi_nrfx_wake_request(&dev_config->wake_gpiote, dev_config->wake_pin); if (error == -ETIMEDOUT) { LOG_WRN("Waiting for WAKE acknowledgment timed out"); @@ -405,7 +540,7 @@ static int transceive(const struct device *dev, /* Abort the current transfer by deinitializing * the nrfx driver. */ - nrfx_spim_uninit(&dev_data->spim); + nrfx_spim_uninit(&dev_config->spim); dev_data->initialized = false; /* Make sure the transaction is finished (it may be @@ -420,6 +555,9 @@ static int transceive(const struct device *dev, #else dev_data->ctx.ready = 0; #endif /* CONFIG_MULTITHREADING */ +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 + anomaly_58_workaround_clear(dev_data); +#endif } else if (error) { finalize_spi_transaction(dev, true); } @@ -486,7 +624,6 @@ static int spim_resume(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; - (void)dev_data; (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); /* nrfx_spim_init() will be called at configuration before @@ -504,15 +641,13 @@ static void spim_suspend(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; - int err; if (dev_data->initialized) { - nrfx_spim_uninit(&dev_data->spim); + nrfx_spim_uninit(&dev_config->spim); dev_data->initialized = false; } - err = spi_context_cs_put_all(&dev_data->ctx); - (void)err; + spi_context_cs_put_all(&dev_data->ctx); (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -542,7 +677,7 @@ static int spi_nrfx_init(const struct device *dev) (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { - err = spi_nrfx_wake_init(dev_config->wake_gpiote, dev_config->wake_pin); + err = spi_nrfx_wake_init(&dev_config->wake_gpiote, dev_config->wake_pin); if (err == -ENODEV) { LOG_ERR("Failed to allocate GPIOTE channel for WAKE"); return err; @@ -562,6 +697,12 @@ static int spi_nrfx_init(const struct device *dev) spi_context_unlock_unconditionally(&dev_data->ctx); +#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 + err = anomaly_58_workaround_init(dev); + if (err < 0) { + return err; + } +#endif return pm_device_driver_init(dev, spim_nrfx_pm_action); } @@ -586,74 +727,81 @@ static int spi_nrfx_deinit(const struct device *dev) return 0; } -#define SPI_NRFX_SPIM_EXTENDED_CONFIG(inst) \ +#define SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \ IF_ENABLED(NRFX_SPIM_EXTENDED_ENABLED, \ (.dcx_pin = NRF_SPIM_PIN_NOT_CONNECTED, \ - COND_CODE_1(DT_INST_PROP(inst, rx_delay_supported), \ - (.rx_delay = DT_INST_PROP(inst, rx_delay),), \ + COND_CODE_1(SPIM_PROP(idx, rx_delay_supported), \ + (.rx_delay = SPIM_PROP(idx, rx_delay),), \ ()) \ )) -#define SPI_NRFX_SPIM_DEFINE(inst) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(inst)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ +#define SPI_NRFX_SPIM_DEFINE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(SPIM(idx)), DT_IRQ(SPIM(idx), priority), \ + nrfx_isr, nrfx_spim_##idx##_irq_handler, 0); \ + } \ IF_ENABLED(SPI_BUFFER_IN_RAM, \ - (static uint8_t spim_##inst##_tx_buffer \ + (static uint8_t spim_##idx##_tx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ - DMM_MEMORY_SECTION(DT_DRV_INST(inst)); \ - static uint8_t spim_##inst##_rx_buffer \ + DMM_MEMORY_SECTION(SPIM(idx)); \ + static uint8_t spim_##idx##_rx_buffer \ [CONFIG_SPI_NRFX_RAM_BUFFER_SIZE] \ - DMM_MEMORY_SECTION(DT_DRV_INST(inst));)) \ - static struct spi_nrfx_data spi_##inst##_data = { \ - .spim = NRFX_SPIM_INSTANCE(DT_INST_REG_ADDR(inst)), \ + DMM_MEMORY_SECTION(SPIM(idx));)) \ + static struct spi_nrfx_data spi_##idx##_data = { \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##inst##_data, ctx),)) \ + (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##inst##_data, ctx),)) \ - SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ + (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ + SPI_CONTEXT_CS_GPIOS_INITIALIZE(SPIM(idx), ctx) \ IF_ENABLED(SPI_BUFFER_IN_RAM, \ - (.tx_buffer = spim_##inst##_tx_buffer, \ - .rx_buffer = spim_##inst##_rx_buffer,)) \ - .dev = DEVICE_DT_GET(DT_DRV_INST(inst)), \ + (.tx_buffer = spim_##idx##_tx_buffer, \ + .rx_buffer = spim_##idx##_rx_buffer,)) \ + .dev = DEVICE_DT_GET(SPIM(idx)), \ .busy = false, \ }; \ - static void irq_connect##inst(void) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ - nrfx_spim_irq_handler, &spi_##inst##_data.spim, 0); \ - } \ - PINCTRL_DT_INST_DEFINE(inst); \ - static const struct spi_nrfx_config spi_##inst##z_config = { \ - .max_freq = DT_INST_PROP(inst, max_frequency), \ + PINCTRL_DT_DEFINE(SPIM(idx)); \ + static const struct spi_nrfx_config spi_##idx##z_config = { \ + .spim = { \ + .p_reg = (NRF_SPIM_Type *)DT_REG_ADDR(SPIM(idx)), \ + .drv_inst_idx = NRFX_SPIM##idx##_INST_IDX, \ + }, \ + .max_freq = SPIM_PROP(idx, max_frequency), \ .def_config = { \ .skip_gpio_cfg = true, \ .skip_psel_cfg = true, \ .ss_pin = NRF_SPIM_PIN_NOT_CONNECTED, \ - .orc = DT_INST_PROP(inst, overrun_character), \ - SPI_NRFX_SPIM_EXTENDED_CONFIG(inst) \ + .orc = SPIM_PROP(idx, overrun_character), \ + SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \ }, \ - .irq_connect = irq_connect##inst, \ - .max_chunk_len = BIT_MASK( \ - DT_INST_PROP(inst, easydma_maxcnt_bits)), \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ - .wake_gpiote = WAKE_GPIOTE_NODE(DT_DRV_INST(inst)), \ - .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(DT_DRV_INST(inst), \ - wake_gpios, \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIM(idx)), \ + .max_chunk_len = BIT_MASK(SPIM_PROP(idx, easydma_maxcnt_bits)),\ + COND_CODE_1(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58, \ + (.anomaly_58_workaround = \ + SPIM_PROP(idx, anomaly_58_workaround),), \ + ()) \ + .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPIM(idx), wake_gpios, \ WAKE_PIN_NOT_USED), \ - .mem_reg = DMM_DEV_TO_REG(DT_DRV_INST(inst)), \ + .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPIM(idx)), \ + .mem_reg = DMM_DEV_TO_REG(SPIM(idx)), \ }; \ - BUILD_ASSERT(!DT_INST_NODE_HAS_PROP(inst, wake_gpios) || \ - !(DT_GPIO_FLAGS(DT_DRV_INST(inst), wake_gpios) & \ - GPIO_ACTIVE_LOW), \ + BUILD_ASSERT(!SPIM_HAS_PROP(idx, wake_gpios) || \ + !(DT_GPIO_FLAGS(SPIM(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ "WAKE line must be configured as active high"); \ - PM_DEVICE_DT_INST_DEFINE(inst, spim_nrfx_pm_action); \ - SPI_DEVICE_DT_INST_DEINIT_DEFINE(inst, \ + PM_DEVICE_DT_DEFINE(SPIM(idx), spim_nrfx_pm_action); \ + SPI_DEVICE_DT_DEINIT_DEFINE(SPIM(idx), \ spi_nrfx_init, \ spi_nrfx_deinit, \ - PM_DEVICE_DT_INST_GET(inst), \ - &spi_##inst##_data, \ - &spi_##inst##z_config, \ + PM_DEVICE_DT_GET(SPIM(idx)), \ + &spi_##idx##_data, \ + &spi_##idx##z_config, \ POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \ &spi_nrfx_driver_api) -DT_INST_FOREACH_STATUS_OKAY(SPI_NRFX_SPIM_DEFINE) +#define COND_NRF_SPIM_DEVICE(unused, prefix, i, _) \ + IF_ENABLED(CONFIG_HAS_HW_NRF_SPIM##prefix##i, (SPI_NRFX_SPIM_DEFINE(prefix##i);)) + +SPIM_FOR_EACH_INSTANCE(COND_NRF_SPIM_DEVICE, (), (), _) diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index 0ddabf62a4ae..0861ed3c2f54 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - #define DT_DRV_COMPAT nordic_nrf_spis - #include #include #include @@ -22,8 +20,19 @@ LOG_MODULE_REGISTER(spi_nrfx_spis, CONFIG_SPI_LOG_LEVEL); #include "spi_context.h" +/* + * Current factors requiring use of DT_NODELABEL: + * + * - HAL design (requirement of drv_inst_idx in nrfx_spis_t) + * - Name-based HAL IRQ handlers, e.g. nrfx_spis_0_irq_handler + */ +#define SPIS_NODE(idx) \ + COND_CODE_1(DT_NODE_EXISTS(DT_NODELABEL(spis##idx)), (spis##idx), (spi##idx)) +#define SPIS(idx) DT_NODELABEL(SPIS_NODE(idx)) +#define SPIS_PROP(idx, prop) DT_PROP(SPIS(idx), prop) +#define SPIS_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIS(idx), prop) + struct spi_nrfx_data { - nrfx_spis_t spis; struct spi_context ctx; const struct device *dev; #ifdef CONFIG_MULTITHREADING @@ -35,6 +44,7 @@ struct spi_nrfx_data { }; struct spi_nrfx_config { + nrfx_spis_t spis; nrfx_spis_config_t config; void (*irq_connect)(void); uint16_t max_buf_len; @@ -72,6 +82,7 @@ static inline nrf_spis_bit_order_t get_nrf_spis_bit_order(uint16_t operation) static int configure(const struct device *dev, const struct spi_config *spi_cfg) { + const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; struct spi_context *ctx = &dev_data->ctx; @@ -113,7 +124,7 @@ static int configure(const struct device *dev, ctx->config = spi_cfg; - nrf_spis_configure(dev_data->spis.p_reg, + nrf_spis_configure(dev_config->spis.p_reg, get_nrf_spis_mode(spi_cfg->operation), get_nrf_spis_bit_order(spi_cfg->operation)); @@ -126,6 +137,7 @@ static int prepare_for_transfer(const struct device *dev, { const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; + nrfx_err_t result; uint8_t *dmm_tx_buf; uint8_t *dmm_rx_buf; int err; @@ -151,10 +163,11 @@ static int prepare_for_transfer(const struct device *dev, goto in_alloc_failed; } - err = nrfx_spis_buffers_set(&dev_data->spis, + result = nrfx_spis_buffers_set(&dev_config->spis, dmm_tx_buf, tx_buf_len, dmm_rx_buf, rx_buf_len); - if (err != 0) { + if (result != NRFX_SUCCESS) { + err = -EIO; goto buffers_set_failed; } @@ -242,7 +255,7 @@ static int transceive(const struct device *dev, if (dev_config->wake_gpio.port) { wait_for_wake(dev_data, dev_config); - nrf_spis_enable(dev_data->spis.p_reg); + nrf_spis_enable(dev_config->spis.p_reg); } error = prepare_for_transfer(dev, @@ -272,7 +285,7 @@ static int transceive(const struct device *dev, } if (dev_config->wake_gpio.port) { - nrf_spis_disable(dev_data->spis.p_reg); + nrf_spis_disable(dev_config->spis.p_reg); } } @@ -326,7 +339,7 @@ static DEVICE_API(spi, spi_nrfx_driver_api) = { .release = spi_nrfx_release, }; -static void event_handler(const nrfx_spis_event_t *p_event, void *p_context) +static void event_handler(const nrfx_spis_evt_t *p_event, void *p_context) { const struct device *dev = p_context; struct spi_nrfx_data *dev_data = dev->data; @@ -354,10 +367,9 @@ static void event_handler(const nrfx_spis_event_t *p_event, void *p_context) static void spi_nrfx_suspend(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; - struct spi_nrfx_data *dev_data = dev->data; if (dev_config->wake_gpio.port == NULL) { - nrf_spis_disable(dev_data->spis.p_reg); + nrf_spis_disable(dev_config->spis.p_reg); } (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); @@ -366,12 +378,11 @@ static void spi_nrfx_suspend(const struct device *dev) static void spi_nrfx_resume(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; - struct spi_nrfx_data *dev_data = dev->data; (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); if (dev_config->wake_gpio.port == NULL) { - nrf_spis_enable(dev_data->spis.p_reg); + nrf_spis_enable(dev_config->spis.p_reg); } } @@ -397,17 +408,18 @@ static int spi_nrfx_init(const struct device *dev) { const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; + nrfx_err_t result; int err; /* This sets only default values of mode and bit order. The ones to be * actually used are set in configure() when a transfer is prepared. */ - err = nrfx_spis_init(&dev_data->spis, &dev_config->config, + result = nrfx_spis_init(&dev_config->spis, &dev_config->config, event_handler, (void *)dev); - if (err != 0) { + if (result != NRFX_SUCCESS) { LOG_ERR("Failed to initialize device: %s", dev->name); - return err; + return -EBUSY; } /* When the WAKE line is used, the SPIS peripheral is enabled @@ -418,7 +430,7 @@ static int spi_nrfx_init(const struct device *dev) * with the SPIS peripheral enabled, significantly reduces idle * power consumption. */ - nrf_spis_disable(dev_data->spis.p_reg); + nrf_spis_disable(dev_config->spis.p_reg); if (dev_config->wake_gpio.port) { if (!gpio_is_ready_dt(&dev_config->wake_gpio)) { @@ -451,54 +463,59 @@ static int spi_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, spi_nrfx_pm_action); } -#define SPI_NRFX_SPIS_DEFINE(inst) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(inst)); \ - static struct spi_nrfx_data spi_##inst##_data = { \ - .spis = NRFX_SPIS_INSTANCE(DT_INST_REG_ADDR(inst)), \ +#define SPI_NRFX_SPIS_DEFINE(idx) \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), \ + nrfx_isr, nrfx_spis_##idx##_irq_handler, 0); \ + } \ + static struct spi_nrfx_data spi_##idx##_data = { \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##inst##_data, ctx),)) \ + (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##inst##_data, ctx),)) \ - .dev = DEVICE_DT_GET(DT_DRV_INST(inst)), \ + (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ + .dev = DEVICE_DT_GET(SPIS(idx)), \ IF_ENABLED(CONFIG_MULTITHREADING, \ (.wake_sem = Z_SEM_INITIALIZER( \ - spi_##inst##_data.wake_sem, 0, 1),)) \ + spi_##idx##_data.wake_sem, 0, 1),)) \ }; \ - static void irq_connect##inst(void) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ - nrfx_spis_irq_handler, &spi_##inst##_data.spis, 0); \ - } \ - PINCTRL_DT_INST_DEFINE(inst); \ - static const struct spi_nrfx_config spi_##inst##z_config = { \ + PINCTRL_DT_DEFINE(SPIS(idx)); \ + static const struct spi_nrfx_config spi_##idx##z_config = { \ + .spis = { \ + .p_reg = (NRF_SPIS_Type *)DT_REG_ADDR(SPIS(idx)), \ + .drv_inst_idx = NRFX_SPIS##idx##_INST_IDX, \ + }, \ .config = { \ .skip_gpio_cfg = true, \ .skip_psel_cfg = true, \ .mode = NRF_SPIS_MODE_0, \ .bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \ - .orc = DT_INST_PROP(inst, overrun_character), \ - .def = DT_INST_PROP(inst, def_char), \ + .orc = SPIS_PROP(idx, overrun_character), \ + .def = SPIS_PROP(idx, def_char), \ }, \ - .irq_connect = irq_connect##inst, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ - .max_buf_len = BIT_MASK(DT_INST_PROP(inst, \ - easydma_maxcnt_bits)), \ - .wake_gpio = GPIO_DT_SPEC_GET_OR(DT_DRV_INST(inst), \ - wake_gpios, {0}), \ - .mem_reg = DMM_DEV_TO_REG(DT_DRV_INST(inst)), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIS(idx)), \ + .max_buf_len = BIT_MASK(SPIS_PROP(idx, easydma_maxcnt_bits)), \ + .wake_gpio = GPIO_DT_SPEC_GET_OR(SPIS(idx), wake_gpios, {0}), \ + .mem_reg = DMM_DEV_TO_REG(SPIS(idx)), \ }; \ - BUILD_ASSERT(!DT_INST_NODE_HAS_PROP(inst, wake_gpios) || \ - !(DT_GPIO_FLAGS(DT_DRV_INST(inst), wake_gpios) & \ - GPIO_ACTIVE_LOW), \ + BUILD_ASSERT(!DT_NODE_HAS_PROP(SPIS(idx), wake_gpios) || \ + !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ "WAKE line must be configured as active high"); \ - PM_DEVICE_DT_INST_DEFINE(inst, spi_nrfx_pm_action, PM_DEVICE_ISR_SAFE);\ - SPI_DEVICE_DT_INST_DEFINE(inst, \ - spi_nrfx_init, \ - PM_DEVICE_DT_INST_GET(inst), \ - &spi_##inst##_data, \ - &spi_##inst##z_config, \ - POST_KERNEL, \ - CONFIG_SPI_INIT_PRIORITY, \ - &spi_nrfx_driver_api) - -DT_INST_FOREACH_STATUS_OKAY(SPI_NRFX_SPIS_DEFINE) + PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, PM_DEVICE_ISR_SAFE);\ + SPI_DEVICE_DT_DEFINE(SPIS(idx), \ + spi_nrfx_init, \ + PM_DEVICE_DT_GET(SPIS(idx)), \ + &spi_##idx##_data, \ + &spi_##idx##z_config, \ + POST_KERNEL, \ + CONFIG_SPI_INIT_PRIORITY, \ + &spi_nrfx_driver_api) + +/* Macro creates device instance if it is enabled in devicetree. */ +#define SPIS_DEVICE(periph, prefix, id, _) \ + IF_ENABLED(CONFIG_HAS_HW_NRF_SPIS##prefix##id, (SPI_NRFX_SPIS_DEFINE(prefix##id);)) + +/* Macro iterates over nrfx_spis instances enabled in the nrfx_config.h. */ +NRFX_FOREACH_ENABLED(SPIS, SPIS_DEVICE, (), (), _) diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index 5cfc368c52ac..c045f85f240c 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -10,7 +10,7 @@ config NRF_RTC_TIMER depends on !$(dt_nodelabel_enabled,rtc1) && !DT_HAS_NORDIC_NRF_GRTC_ENABLED select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT - select NRFX_GPPI if SOC_NRF52832 + select NRFX_PPI if SOC_NRF52832 default y if SYS_CLOCK_EXISTS help This module implements a kernel device driver for the nRF Real Time diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index faecda31b472..94ec7e3a240f 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -94,12 +94,23 @@ static inline uint64_t counter_sub(uint64_t a, uint64_t b) static inline uint64_t counter(void) { - return nrfx_grtc_syscounter_get(); + uint64_t now; + nrfx_grtc_syscounter_get(&now); + return now; } static inline int get_comparator(uint32_t chan, uint64_t *cc) { - return nrfx_grtc_syscounter_cc_value_read(chan, cc); + nrfx_err_t result; + + result = nrfx_grtc_syscounter_cc_value_read(chan, cc); + if (result != NRFX_SUCCESS) { + if (result != NRFX_ERROR_INVALID_PARAM) { + return -EAGAIN; + } + return -EPERM; + } + return 0; } /* @@ -166,14 +177,14 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte int32_t z_nrf_grtc_timer_chan_alloc(void) { uint8_t chan; - int err_code; + nrfx_err_t err_code; /* Prevent allocating all available channels - one must be left for system purposes. */ if (ext_channels_allocated >= EXT_CHAN_COUNT) { return -ENOMEM; } err_code = nrfx_grtc_channel_alloc(&chan); - if (err_code < 0) { + if (err_code != NRFX_SUCCESS) { return -ENOMEM; } ext_channels_allocated++; @@ -183,9 +194,9 @@ int32_t z_nrf_grtc_timer_chan_alloc(void) void z_nrf_grtc_timer_chan_free(int32_t chan) { IS_CHANNEL_ALLOWED_ASSERT(chan); - int err_code = nrfx_grtc_channel_free(chan); + nrfx_err_t err_code = nrfx_grtc_channel_free(chan); - if (err_code == 0) { + if (err_code == NRFX_SUCCESS) { ext_channels_allocated--; } } @@ -242,13 +253,19 @@ int z_nrf_grtc_timer_compare_read(int32_t chan, uint64_t *val) static int compare_set_nolocks(int32_t chan, uint64_t target_time, z_nrf_grtc_timer_compare_handler_t handler, void *user_data) { + nrfx_err_t result; + __ASSERT_NO_MSG(target_time < COUNTER_SPAN); nrfx_grtc_channel_t user_channel_data = { .handler = handler, .p_context = user_data, .channel = chan, }; - return nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, target_time, true); + result = nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, target_time, true); + if (result != NRFX_SUCCESS) { + return -EPERM; + } + return 0; } static int compare_set(int32_t chan, uint64_t target_time, @@ -301,6 +318,7 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan) .p_context = NULL, .channel = chan, }; + nrfx_err_t result; IS_CHANNEL_ALLOWED_ASSERT(chan); @@ -308,12 +326,19 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan) * (makes CCEN=1). COUNTER_SPAN is used so as not to fire an event unnecessarily * - it can be assumed that such a large value will never be reached. */ - return nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, COUNTER_SPAN, false); + result = nrfx_grtc_syscounter_cc_absolute_set(&user_channel_data, COUNTER_SPAN, false); + + if (result != NRFX_SUCCESS) { + return -EPERM; + } + + return 0; } int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) { - int result; + uint64_t capt_time; + nrfx_err_t result; IS_CHANNEL_ALLOWED_ASSERT(chan); @@ -323,10 +348,16 @@ int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) */ return -EBUSY; } - result = nrfx_grtc_syscounter_cc_value_read(chan, captured_time); - __ASSERT_NO_MSG(*captured_time < COUNTER_SPAN); + result = nrfx_grtc_syscounter_cc_value_read(chan, &capt_time); + if (result != NRFX_SUCCESS) { + return -EPERM; + } + + __ASSERT_NO_MSG(capt_time < COUNTER_SPAN); - return result; + *captured_time = capt_time; + + return 0; } uint64_t z_nrf_grtc_timer_startup_value_get(void) @@ -341,7 +372,7 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) return -ENOTSUP; } - int err_code; + nrfx_err_t err_code; static struct k_spinlock lock; static uint8_t systemoff_channel; uint64_t now = counter(); @@ -365,9 +396,9 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) k_spinlock_key_t key = k_spin_lock(&lock); err_code = nrfx_grtc_channel_alloc(&systemoff_channel); - if (err_code < 0) { + if (err_code != NRFX_SUCCESS) { k_spin_unlock(&lock, key); - return err_code; + return -ENOMEM; } (void)nrfx_grtc_syscounter_cc_int_disable(systemoff_channel); ret = compare_set(systemoff_channel, @@ -450,7 +481,7 @@ void sys_clock_disable(void) static int sys_clock_driver_init(void) { - int err_code; + nrfx_err_t err_code; #if defined(CONFIG_GEN_SW_ISR_TABLE) IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr, @@ -475,19 +506,19 @@ static int sys_clock_driver_init(void) #endif err_code = nrfx_grtc_init(0); - if (err_code < 0) { - return err_code; + if (err_code != NRFX_SUCCESS) { + return -EPERM; } #if defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) err_code = nrfx_grtc_syscounter_start(true, &system_clock_channel_data.channel); - if (err_code < 0) { - return err_code; + if (err_code != NRFX_SUCCESS) { + return err_code == NRFX_ERROR_NO_MEM ? -ENOMEM : -EPERM; } #else err_code = nrfx_grtc_channel_alloc(&system_clock_channel_data.channel); - if (err_code < 0) { - return err_code; + if (err_code != NRFX_SUCCESS) { + return -ENOMEM; } #endif /* CONFIG_NRF_GRTC_START_SYSCOUNTER */ diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index 2abc183ad0b9..3db1539f7efe 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -23,7 +23,7 @@ #define CUSTOM_COUNTER_BIT_WIDTH 1 #define WRAP_CH 0 #define SYS_CLOCK_CH 1 -#include "helpers/nrfx_gppi.h" +#include "nrfx_ppi.h" #else #define CUSTOM_COUNTER_BIT_WIDTH 0 #define SYS_CLOCK_CH 0 @@ -806,8 +806,8 @@ static int sys_clock_driver_init(void) alloc_mask &= ~BIT(WRAP_CH); nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(WRAP_CH); - int result; - nrfx_gppi_handle_t handle; + nrfx_err_t result; + nrf_ppi_channel_t ch; nrfy_rtc_event_enable(RTC, NRF_RTC_CHANNEL_INT_MASK(WRAP_CH)); nrfy_rtc_cc_set(RTC, WRAP_CH, COUNTER_MAX); @@ -817,11 +817,12 @@ static int sys_clock_driver_init(void) evt_addr = nrfy_rtc_event_address_get(RTC, evt); task_addr = nrfy_rtc_task_address_get(RTC, NRF_RTC_TASK_CLEAR); - result = nrfx_gppi_conn_alloc(evt_addr, task_addr, &handle); - if (result < 0) { - return result; + result = nrfx_ppi_channel_alloc(&ch); + if (result != NRFX_SUCCESS) { + return -ENODEV; } - nrfx_gppi_conn_enable(handle); + (void)nrfx_ppi_channel_assign(ch, evt_addr, task_addr); + (void)nrfx_ppi_channel_enable(ch); #endif return 0; } diff --git a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common_errata.h b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common_errata.h index 338818d4999b..0ee23ccd2c56 100644 --- a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common_errata.h +++ b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common_errata.h @@ -12,6 +12,7 @@ #define NRF_USBD_COMMON_ERRATA_H__ #include +#include #ifndef NRF_USBD_COMMON_ERRATA_ENABLE /** diff --git a/drivers/usb/udc/udc_dwc2_vendor_quirks.h b/drivers/usb/udc/udc_dwc2_vendor_quirks.h index a3be97a995f7..9b2d26b89008 100644 --- a/drivers/usb/udc/udc_dwc2_vendor_quirks.h +++ b/drivers/usb/udc/udc_dwc2_vendor_quirks.h @@ -328,7 +328,7 @@ DT_INST_FOREACH_STATUS_OKAY(QUIRK_NRF_USBHS_DEFINE) #define USBHS_DT_WRAPPER_REG_ADDR(n) UINT_TO_POINTER(DT_INST_REG_ADDR_BY_NAME(n, wrapper)) -#include +#include #include #include #include diff --git a/drivers/watchdog/Kconfig.nrfx b/drivers/watchdog/Kconfig.nrfx index fea7f1ee6365..d4deeda225ca 100644 --- a/drivers/watchdog/Kconfig.nrfx +++ b/drivers/watchdog/Kconfig.nrfx @@ -7,7 +7,15 @@ config WDT_NRFX bool "nRF WDT nrfx driver" default y depends on DT_HAS_NORDIC_NRF_WDT_ENABLED - select NRFX_WDT + select NRFX_WDT0 if HAS_HW_NRF_WDT0 + select NRFX_WDT1 if HAS_HW_NRF_WDT1 + select NRFX_WDT30 if HAS_HW_NRF_WDT30 + select NRFX_WDT31 if HAS_HW_NRF_WDT31 + select NRFX_WDT010 if HAS_HW_NRF_WDT010 + select NRFX_WDT011 if HAS_HW_NRF_WDT011 + select NRFX_WDT130 if HAS_HW_NRF_WDT130 + select NRFX_WDT131 if HAS_HW_NRF_WDT131 + select NRFX_WDT132 if HAS_HW_NRF_WDT132 help Enable support for nrfx WDT driver for nRF MCU series. diff --git a/drivers/watchdog/wdt_nrfx.c b/drivers/watchdog/wdt_nrfx.c index fa1d45907c69..4459b7fac6d0 100644 --- a/drivers/watchdog/wdt_nrfx.c +++ b/drivers/watchdog/wdt_nrfx.c @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT nordic_nrf_wdt - #include #include #include @@ -21,7 +19,6 @@ LOG_MODULE_REGISTER(wdt_nrfx); #endif struct wdt_nrfx_data { - nrfx_wdt_t wdt; wdt_callback_t m_callbacks[NRF_WDT_CHANNEL_NUMBER]; uint32_t m_timeout; uint8_t m_allocated_channels; @@ -31,10 +28,15 @@ struct wdt_nrfx_data { #endif }; +struct wdt_nrfx_config { + nrfx_wdt_t wdt; +}; + static int wdt_nrf_setup(const struct device *dev, uint8_t options) { + const struct wdt_nrfx_config *config = dev->config; struct wdt_nrfx_data *data = dev->data; - int err_code; + nrfx_err_t err_code; nrfx_wdt_config_t wdt_config = { .reload_value = data->m_timeout @@ -52,13 +54,13 @@ static int wdt_nrf_setup(const struct device *dev, uint8_t options) wdt_config.behaviour |= NRF_WDT_BEHAVIOUR_RUN_HALT_MASK; } - err_code = nrfx_wdt_reconfigure(&data->wdt, &wdt_config); + err_code = nrfx_wdt_reconfigure(&config->wdt, &wdt_config); - if (err_code < 0) { - return err_code; + if (err_code != NRFX_SUCCESS) { + return -EBUSY; } - nrfx_wdt_enable(&data->wdt); + nrfx_wdt_enable(&config->wdt); data->enabled = true; return 0; @@ -67,22 +69,23 @@ static int wdt_nrf_setup(const struct device *dev, uint8_t options) static int wdt_nrf_disable(const struct device *dev) { #if NRFX_WDT_HAS_STOP + const struct wdt_nrfx_config *config = dev->config; struct wdt_nrfx_data *data = dev->data; - int err_code; + nrfx_err_t err_code; int channel_id; - err_code = nrfx_wdt_stop(&data->wdt); + err_code = nrfx_wdt_stop(&config->wdt); - if (err_code < 0) { + if (err_code != NRFX_SUCCESS) { /* This can only happen if wdt_nrf_setup() is not called first. */ - return err_code; + return -EFAULT; } #if defined(WDT_NRFX_SYNC_STOP) k_sem_take(&data->sync_stop, K_FOREVER); #endif - nrfx_wdt_channels_free(&data->wdt); + nrfx_wdt_channels_free(&config->wdt); for (channel_id = 0; channel_id < data->m_allocated_channels; channel_id++) { data->m_callbacks[channel_id] = NULL; @@ -100,8 +103,9 @@ static int wdt_nrf_disable(const struct device *dev) static int wdt_nrf_install_timeout(const struct device *dev, const struct wdt_timeout_cfg *cfg) { + const struct wdt_nrfx_config *config = dev->config; struct wdt_nrfx_data *data = dev->data; - int err_code; + nrfx_err_t err_code; nrfx_wdt_channel_id channel_id; if (data->enabled) { @@ -121,10 +125,10 @@ static int wdt_nrf_install_timeout(const struct device *dev, * in all nRF chips can use reload values (determining * the timeout) from range 0xF-0xFFFFFFFF given in 32768 Hz * clock ticks. This makes the allowed range of 0x1-0x07CFFFFF - * in milliseconds, defined using NRF_WDT_RR_VALUE_MS symbol. - * Check if the provided value is within this range. + * in milliseconds. Check if the provided value is within + * this range. */ - if ((cfg->window.max == 0U) || (cfg->window.max > NRF_WDT_RR_VALUE_MS)) { + if ((cfg->window.max == 0U) || (cfg->window.max > 0x07CFFFFF)) { return -EINVAL; } @@ -134,11 +138,11 @@ static int wdt_nrf_install_timeout(const struct device *dev, return -EINVAL; } - err_code = nrfx_wdt_channel_alloc(&data->wdt, + err_code = nrfx_wdt_channel_alloc(&config->wdt, &channel_id); - if (err_code == -ENOMEM) { - return err_code; + if (err_code == NRFX_ERROR_NO_MEM) { + return -ENOMEM; } if (cfg->callback != NULL) { @@ -151,6 +155,7 @@ static int wdt_nrf_install_timeout(const struct device *dev, static int wdt_nrf_feed(const struct device *dev, int channel_id) { + const struct wdt_nrfx_config *config = dev->config; struct wdt_nrfx_data *data = dev->data; if ((channel_id >= data->m_allocated_channels) || (channel_id < 0)) { @@ -161,7 +166,7 @@ static int wdt_nrf_feed(const struct device *dev, int channel_id) return -EAGAIN; } - nrfx_wdt_channel_feed(&data->wdt, + nrfx_wdt_channel_feed(&config->wdt, (nrfx_wdt_channel_id)channel_id); return 0; @@ -200,46 +205,84 @@ static void wdt_event_handler(const struct device *dev, nrf_wdt_event_t event_ty #define WDT(idx) DT_NODELABEL(wdt##idx) -#define WDT_NRFX_WDT_IRQ(inst) \ +#define WDT_NRFX_WDT_IRQ(idx) \ COND_CODE_1(CONFIG_WDT_NRFX_NO_IRQ, \ (), \ - (IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ - nrfx_wdt_irq_handler, &wdt_##inst##_data.wdt, 0))) + (IRQ_CONNECT(DT_IRQN(WDT(idx)), DT_IRQ(WDT(idx), priority), \ + nrfx_isr, nrfx_wdt_##idx##_irq_handler, 0))) -#define WDT_NRFX_WDT_DEVICE(inst) \ - static void wdt_##inst##_event_handler(nrf_wdt_event_t event_type, \ - uint32_t requests, \ - void *p_context) \ +#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_INST_GET(inst), event_type, \ + wdt_event_handler(DEVICE_DT_GET(WDT(idx)), event_type, \ requests, p_context); \ } \ - static struct wdt_nrfx_data wdt_##inst##_data = { \ - .wdt = NRFX_WDT_INSTANCE(DT_INST_REG_ADDR(inst)), \ - IF_ENABLED(WDT_NRFX_SYNC_STOP, \ - (.sync_stop = Z_SEM_INITIALIZER( \ - wdt_##inst##_data.sync_stop, 0, 1),)) \ - }; \ - static int wdt_##inst##_init(const struct device *dev) \ + static int wdt_##idx##_init(const struct device *dev) \ { \ - int err_code; \ - struct wdt_nrfx_data *data = dev->data; \ - WDT_NRFX_WDT_IRQ(inst); \ - err_code = nrfx_wdt_init(&data->wdt, \ + const struct wdt_nrfx_config *config = dev->config; \ + nrfx_err_t err_code; \ + WDT_NRFX_WDT_IRQ(idx); \ + err_code = nrfx_wdt_init(&config->wdt, \ NULL, \ IS_ENABLED(CONFIG_WDT_NRFX_NO_IRQ) \ ? NULL \ - : wdt_##inst##_event_handler, \ + : wdt_##idx##_event_handler, \ NULL); \ - return err_code; \ + if (err_code != NRFX_SUCCESS) { \ + return -EBUSY; \ + } \ + return 0; \ } \ - DEVICE_DT_INST_DEFINE(inst, \ - wdt_##inst##_init, \ - NULL, \ - &wdt_##inst##_data, \ - NULL, \ - PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ - &wdt_nrfx_driver_api) - -DT_INST_FOREACH_STATUS_OKAY(WDT_NRFX_WDT_DEVICE) + static struct wdt_nrfx_data wdt_##idx##_data = { \ + IF_ENABLED(WDT_NRFX_SYNC_STOP, \ + (.sync_stop = Z_SEM_INITIALIZER( \ + wdt_##idx##_data.sync_stop, 0, 1),)) \ + }; \ + 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 +WDT_NRFX_WDT_DEVICE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_WDT1 +WDT_NRFX_WDT_DEVICE(1); +#endif + +#ifdef CONFIG_HAS_HW_NRF_WDT30 +WDT_NRFX_WDT_DEVICE(30); +#endif + +#ifdef CONFIG_HAS_HW_NRF_WDT31 +WDT_NRFX_WDT_DEVICE(31); +#endif + +#ifdef CONFIG_HAS_HW_NRF_WDT010 +WDT_NRFX_WDT_DEVICE(010); +#endif + +#ifdef CONFIG_HAS_HW_NRF_WDT011 +WDT_NRFX_WDT_DEVICE(011); +#endif + +#ifdef CONFIG_HAS_HW_NRF_WDT130 +WDT_NRFX_WDT_DEVICE(130); +#endif + +#ifdef CONFIG_HAS_HW_NRF_WDT131 +WDT_NRFX_WDT_DEVICE(131); +#endif + +#ifdef CONFIG_HAS_HW_NRF_WDT132 +WDT_NRFX_WDT_DEVICE(132); +#endif diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 8a38d5ac8660..b686ddcabb02 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 4566823b7916..7f4c1a7a5f5b 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -1,12 +1,8 @@ -/* - * Copyright (c) 2018 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 36c3ec6552b9..8431bb9c2ce6 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index 9898bf6748c4..776397ff14a5 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -1,12 +1,8 @@ -/* - * Copyright (c) 2017 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 9cf295dd8266..647f56c5aa42 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index f7e66497df5c..9d7027744bef 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -1,12 +1,8 @@ -/* - * Copyright (c) 2017 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ #include #include -#include +#include #include / { diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 15d4f487f821..b4c077ea2bf4 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include / { cpus { diff --git a/dts/arm/nordic/nrf5340_cpuappns.dtsi b/dts/arm/nordic/nrf5340_cpuappns.dtsi index 25b2d870c111..763e9ca7839b 100644 --- a/dts/arm/nordic/nrf5340_cpuappns.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns.dtsi @@ -8,7 +8,7 @@ #include #include -#include +#include / { cpus { diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 6dfb42ec3365..31cbe7d9ea41 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include / { cpus { diff --git a/dts/arm/nordic/nrf91ns.dtsi b/dts/arm/nordic/nrf91ns.dtsi index 9ab22c6f7ca3..e44bbcde0a43 100644 --- a/dts/arm/nordic/nrf91ns.dtsi +++ b/dts/arm/nordic/nrf91ns.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include / { cpus { diff --git a/dts/bindings/spi/nordic,nrf-spim.yaml b/dts/bindings/spi/nordic,nrf-spim.yaml index 673fcf288b2e..5e95de3e1e0d 100644 --- a/dts/bindings/spi/nordic,nrf-spim.yaml +++ b/dts/bindings/spi/nordic,nrf-spim.yaml @@ -8,6 +8,13 @@ compatible: "nordic,nrf-spim" include: ["nordic,nrf-spi-common.yaml", "memory-region.yaml"] properties: + anomaly-58-workaround: + type: boolean + description: | + Enables the workaround for the nRF52832 SoC SPIM PAN 58 anomaly. + Must be used in conjunction with + CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y + rx-delay-supported: type: boolean description: | diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 5998f6da0a0e..5c445b9d5c75 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 6daf11f4addc..5a4854440b64 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include /delete-node/ &sw_pwm; @@ -106,7 +106,6 @@ #size-cells = <1>; ranges = <0x0 0x40000000 0x10000000>; #else - global_peripherals: peripheral@50000000 { reg = <0x50000000 0x10000000>; #address-cells = <1>; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index d396e17e0cd6..b4ddafac801b 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include /delete-node/ &sw_pwm; @@ -99,7 +99,6 @@ #ifdef USE_NON_SECURE_ADDRESS_MAP /* intentionally empty because UICR is hardware fixed to Secure */ #else - uicr: uicr@ffd000 { compatible = "nordic,nrf-uicr"; reg = <0xffd000 0x1000>; @@ -129,7 +128,6 @@ #size-cells = <1>; ranges = <0x0 0x40000000 0x10000000>; #else - global_peripherals: peripheral@50000000 { reg = <0x50000000 0x10000000>; ranges = <0x0 0x50000000 0x10000000>; @@ -770,7 +768,6 @@ #ifdef USE_NON_SECURE_ADDRESS_MAP /* intentionally empty because WDT30 is hardware fixed to Secure */ #else - wdt30: watchdog@108000 { compatible = "nordic,nrf-wdt"; reg = <0x108000 0x620>; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 435e0db9d20d..7d887b9a2092 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/zephyr/drivers/gpio/gpio_nrf.h b/include/zephyr/drivers/gpio/gpio_nrf.h deleted file mode 100644 index edb5e244fd62..000000000000 --- a/include/zephyr/drivers/gpio/gpio_nrf.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_NRF_H -#define ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_NRF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief Get pointer to GPIOTE driver instance - * associated with specified port device node. - * - * @param port Pointer to port device node. - * - * @return Pointer to GPIOTE driver instance. NULL if not found. - */ -void *gpio_nrf_gpiote_by_port_get(const struct device *port); - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_NRF_H */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h b/include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h new file mode 100644 index 000000000000..e05522975224 --- /dev/null +++ b/include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h @@ -0,0 +1,19 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Nordic Semiconductor ASA + */ + +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_HALTIUM_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_HALTIUM_H_ + +#include + +#define NRF_SAADC_AIN8 9 +#define NRF_SAADC_AIN9 10 +#define NRF_SAADC_AIN10 11 +#define NRF_SAADC_AIN11 12 +#define NRF_SAADC_AIN12 13 +#define NRF_SAADC_AIN13 14 + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_HALTIUM_H_ */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h b/include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h new file mode 100644 index 000000000000..19da4ff6020f --- /dev/null +++ b/include/zephyr/dt-bindings/adc/nrf-saadc-nrf54l.h @@ -0,0 +1,15 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2024 Nordic Semiconductor ASA + */ + +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_ + +#include + +#define NRF_SAADC_AVDD 10 +#define NRF_SAADC_DVDD 11 + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_NRF54L_H_ */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc-v2.h b/include/zephyr/dt-bindings/adc/nrf-saadc-v2.h new file mode 100644 index 000000000000..f5f72bec829e --- /dev/null +++ b/include/zephyr/dt-bindings/adc/nrf-saadc-v2.h @@ -0,0 +1,14 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2024 Nordic Semiconductor ASA + */ + +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_ + +#include + +#define NRF_SAADC_VDD 9 + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V2_H_ */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc-v3.h b/include/zephyr/dt-bindings/adc/nrf-saadc-v3.h new file mode 100644 index 000000000000..c51bab1a91ec --- /dev/null +++ b/include/zephyr/dt-bindings/adc/nrf-saadc-v3.h @@ -0,0 +1,14 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2024 Nordic Semiconductor ASA + */ + +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_ + +#include + +#define NRF_SAADC_VDDHDIV5 13 + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_V3_H_ */ diff --git a/include/zephyr/dt-bindings/adc/nrf-saadc.h b/include/zephyr/dt-bindings/adc/nrf-saadc.h index 21f9cf9fb2f1..e5a86150cd43 100644 --- a/include/zephyr/dt-bindings/adc/nrf-saadc.h +++ b/include/zephyr/dt-bindings/adc/nrf-saadc.h @@ -7,21 +7,6 @@ #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ #define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ -#define NRF_SAADC_AIN0 0 -#define NRF_SAADC_AIN1 1 -#define NRF_SAADC_AIN2 2 -#define NRF_SAADC_AIN3 3 -#define NRF_SAADC_AIN4 4 -#define NRF_SAADC_AIN5 5 -#define NRF_SAADC_AIN6 6 -#define NRF_SAADC_AIN7 7 -#define NRF_SAADC_AIN8 8 -#define NRF_SAADC_AIN9 9 -#define NRF_SAADC_AIN10 10 -#define NRF_SAADC_AIN11 11 -#define NRF_SAADC_AIN12 12 -#define NRF_SAADC_AIN13 13 - /** * @brief Short ADC negative input to ground * @@ -45,22 +30,14 @@ * zephyr,input-positive = ; * @endcode */ -#define NRF_SAADC_GND (NRF_SAADC_AIN_VDD_SHIM_OFFSET - 1) - -#define NRF_SAADC_AIN_VDD_SHIM_OFFSET 128 -#define NRF_SAADC_VDD (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 0) -#define NRF_SAADC_VDDDIV2 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 1) -#define NRF_SAADC_AVDD (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 2) -#define NRF_SAADC_DVDD (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 3) -#define NRF_SAADC_VDDHDIV5 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 4) -#define NRF_SAADC_VDDL (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 5) -#define NRF_SAADC_DECB (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 6) -#define NRF_SAADC_VSS (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 7) -#define NRF_SAADC_VDDAO3V0 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 8) -#define NRF_SAADC_VDDAO1V8 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 9) -#define NRF_SAADC_VDDAO0V8 (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 10) -#define NRF_SAADC_VDDRF (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 11) -#define NRF_SAADC_VBAT (NRF_SAADC_AIN_VDD_SHIM_OFFSET + 12) -#define NRF_SAADC_AIN_DISABLED 255 /* UINT8_MAX */ +#define NRF_SAADC_GND 0 +#define NRF_SAADC_AIN0 1 +#define NRF_SAADC_AIN1 2 +#define NRF_SAADC_AIN2 3 +#define NRF_SAADC_AIN3 4 +#define NRF_SAADC_AIN4 5 +#define NRF_SAADC_AIN5 6 +#define NRF_SAADC_AIN6 7 +#define NRF_SAADC_AIN7 8 #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ */ diff --git a/include/zephyr/dt-bindings/comparator/nrf-comp.h b/include/zephyr/dt-bindings/comparator/nrf-comp.h index 13314bc963cb..1a5407554a15 100644 --- a/include/zephyr/dt-bindings/comparator/nrf-comp.h +++ b/include/zephyr/dt-bindings/comparator/nrf-comp.h @@ -15,9 +15,7 @@ #define NRF_COMP_AIN5 5 /** AIN5 external input */ #define NRF_COMP_AIN6 6 /** AIN6 external input */ #define NRF_COMP_AIN7 7 /** AIN7 external input */ - -#define NRF_COMP_AIN_VDD_SHIM_OFFSET 128 -#define NRF_COMP_AIN_VDD_DIV2 (NRF_COMP_AIN_VDD_SHIM_OFFSET + 1) -#define NRF_COMP_AIN_VDDH_DIV5 (NRF_COMP_AIN_VDD_SHIM_OFFSET + 4) +#define NRF_COMP_AIN_VDD_DIV2 8 /** VDD / 2 */ +#define NRF_COMP_AIN_VDDH_DIV5 9 /** VDDH / 5 */ #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ */ 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 8593ff7269b4..1dcf724b0e52 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 @@ -9,7 +9,7 @@ #include -#include +#include #include #include #include diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 8f6411a93b41..40ef9d08fd86 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -11,30 +11,16 @@ if(NOT DEFINED NRFX_DIR) set(NRFX_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/nrfx CACHE PATH "nrfx Directory") endif() -if(NOT DEFINED CONFIG_SOC_NORDIC_BSP_NAME) - message(FATAL_ERROR "CONFIG_SOC_NORDIC_BSP_NAME has to be defined.") -endif() - set(INC_DIR ${NRFX_DIR}/drivers/include) set(SRC_DIR ${NRFX_DIR}/drivers/src) +set(MDK_DIR ${NRFX_DIR}/mdk) set(HELPERS_DIR ${NRFX_DIR}/helpers) -if(DEFINED CONFIG_SOC_NORDIC_BSP_PATH_OVERRIDE) - set(BSP_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/${CONFIG_SOC_NORDIC_BSP_PATH_OVERRIDE}/${CONFIG_SOC_NORDIC_BSP_NAME}) -else() - set(BSP_DIR ${NRFX_DIR}/bsp/${CONFIG_SOC_NORDIC_BSP_NAME}) -endif() - -set(MDK_DIR ${BSP_DIR}/mdk) - zephyr_include_directories(${NRFX_DIR}) zephyr_include_directories(${INC_DIR}) -zephyr_include_directories(${BSP_DIR}) -zephyr_include_directories(${BSP_DIR}/templates) +zephyr_include_directories(${MDK_DIR}) zephyr_include_directories(.) -include(${BSP_DIR}/zephyr/nrfx.cmake OPTIONAL) - # Define MDK defines globally zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF51X NRF51) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF51822_QFAA NRF51422_XXAA) @@ -126,27 +112,16 @@ 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) zephyr_library_sources_ifdef(CONFIG_HAS_NORDIC_RAM_CTRL ${HELPERS_DIR}/nrfx_ram_ctrl.c) - -if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) - zephyr_library_sources_ifdef(CONFIG_HAS_HW_NRF_PPI ${HELPERS_DIR}/nrfx_gppi_ppi.c) - if(CONFIG_SOC_SERIES_NRF54LX OR CONFIG_HAS_HW_NRF_DPPIC) - zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi.c) - endif() - zephyr_library_sources_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LX ${BSP_DIR}/soc/interconnect/nrfx_gppi_lumos.c) -endif() +zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI ${HELPERS_DIR}/nrfx_gppi_dppi.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI ${HELPERS_DIR}/nrfx_gppi_ppi.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PRS ${SRC_DIR}/prs/nrfx_prs.c) zephyr_library_sources_ifdef(CONFIG_NRFX_ADC ${SRC_DIR}/nrfx_adc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclk.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclkaudio.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_hfclk192m.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_lfclk.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_xo.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_CLOCK ${SRC_DIR}/nrfx_clock_xo24m.c) zephyr_library_sources_ifdef(CONFIG_NRFX_COMP ${SRC_DIR}/nrfx_comp.c) zephyr_library_sources_ifdef(CONFIG_NRFX_CRACEN ${SRC_DIR}/nrfx_cracen.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_DPPI ${SRC_DIR}/nrfx_dppi.c) zephyr_library_sources_ifdef(CONFIG_NRFX_EGU ${SRC_DIR}/nrfx_egu.c) zephyr_library_sources_ifdef(CONFIG_NRFX_GPIOTE ${SRC_DIR}/nrfx_gpiote.c) zephyr_library_sources_ifdef(CONFIG_NRFX_GRTC ${SRC_DIR}/nrfx_grtc.c) @@ -158,6 +133,8 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_NFCT ${SRC_DIR}/nrfx_nfct.c) zephyr_library_sources_ifdef(CONFIG_NRFX_NVMC ${SRC_DIR}/nrfx_nvmc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PDM ${SRC_DIR}/nrfx_pdm.c) zephyr_library_sources_ifdef(CONFIG_NRFX_POWER ${SRC_DIR}/nrfx_power.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_PPI ${SRC_DIR}/nrfx_ppi.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_PPIB ${SRC_DIR}/nrfx_ppib.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PWM ${SRC_DIR}/nrfx_pwm.c) zephyr_library_sources_ifdef(CONFIG_NRFX_QDEC ${SRC_DIR}/nrfx_qdec.c) zephyr_library_sources_ifdef(CONFIG_NRFX_QSPI ${SRC_DIR}/nrfx_qspi.c) @@ -218,9 +195,15 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_DISABLE_FICR_TRIMCNF NRF_DIS zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE NRF_SKIP_GLITCHDETECTOR_DISABLE) zephyr_compile_definitions_ifndef(CONFIG_SOC_NRF54L_ANOMALY_56_WORKAROUND NRF54L_CONFIGURATION_56_ENABLE=0) -if(CONFIG_SOC_SERIES_NRF54HX AND CONFIG_NRFX_GPPI_V1) - zephyr_library_sources(${HELPERS_DIR}/internal/nrfx_gppiv1_ipct.c) - zephyr_library_sources(${HELPERS_DIR}/internal/nrfx_gppiv1_shim.c) +if(CONFIG_SOC_COMPATIBLE_NRF54LX AND CONFIG_NRFX_GPPI) + zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib_lumos.c) + zephyr_library_sources(${NRFX_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c) +endif() + +if(CONFIG_SOC_SERIES_NRF54HX AND CONFIG_NRFX_GPPI) + zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib.c) + zephyr_library_sources(${NRFX_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c) + zephyr_library_sources(${NRFX_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c) endif() # Get the SVD file for the current SoC diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index ed61babb40b2..6065abbf86d6 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -55,11 +55,94 @@ config NRFX_COMP config NRFX_CRACEN bool "CRACEN drivers" depends on SOC_COMPATIBLE_NRF54LX - select NRFX_CRACEN_BSIM_SUPPORT if SOC_SERIES_BSIM_NRFXX -config NRFX_CRACEN_BSIM_SUPPORT +config NRFX_DPPI bool +config NRFX_DPPI0 + bool "DPPI0 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic0) + select NRFX_DPPI + +config NRFX_DPPI00 + bool "DPPI00 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic00) + select NRFX_DPPI + +config NRFX_DPPI10 + bool "DPPI10 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic10) + select NRFX_DPPI + +config NRFX_DPPI20 + bool "DPPI20 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic20) + select NRFX_DPPI + +config NRFX_DPPI30 + bool "DPPI30 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic30) + select NRFX_DPPI + +config NRFX_DPPI020 + bool "DPPI020 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic020) + select NRFX_DPPI + +config NRFX_DPPI120 + bool "DPPI120 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic120) + select NRFX_DPPI + +config NRFX_DPPI130 + bool "DPPI130 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic130) + select NRFX_DPPI + +config NRFX_DPPI131 + bool "DPPI131 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic131) + select NRFX_DPPI + +config NRFX_DPPI132 + bool "DPPI132 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic132) + select NRFX_DPPI + +config NRFX_DPPI133 + bool "DPPI133 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic133) + select NRFX_DPPI + +config NRFX_DPPI134 + bool "DPPI134 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic134) + select NRFX_DPPI + +config NRFX_DPPI135 + bool "DPPI135 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic135) + select NRFX_DPPI + +config NRFX_DPPI136 + bool "DPPI136 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,dppic136) + select NRFX_DPPI + config NRFX_EGU bool @@ -164,19 +247,22 @@ config NRFX_GPPI Enable the nrfx_gppi utilities providing unified API for creating PPI connections across SoC families. -config NRFX_GPPI_V1 - bool "GPPI layer legacy" - depends on NRFX_GPPI - default y if SOC_SERIES_NRF54HX - help - When enabled then legacy version of Generic PPI layer is used. - config NRFX_GRTC bool "GRTC driver" depends on $(dt_nodelabel_exists,grtc) config NRFX_I2S - bool "I2S driver" + bool + +config NRFX_I2S0 + bool "I2S0 driver instance" + depends on $(dt_nodelabel_exists,i2s0) + select NRFX_I2S + +config NRFX_I2S20 + bool "I2S20 driver instance" + depends on $(dt_nodelabel_exists,i2s20) + select NRFX_I2S config NRFX_IPC bool "IPC driver" @@ -193,14 +279,31 @@ config NRFX_MRAMC config NRFX_NFCT bool "NFCT driver" depends on $(dt_nodelabel_exists,nfct) - select NRFX_TIMER + select NRFX_TIMER4 if SOC_SERIES_NRF52X + select NRFX_TIMER2 if SOC_SERIES_NRF53X + select NRFX_TIMER24 if SOC_SERIES_NRF54LX config NRFX_NVMC bool "NVMC driver" depends on $(dt_nodelabel_exists,flash_controller) config NRFX_PDM - bool "PDM driver" + bool + +config NRFX_PDM0 + bool "PDM0 driver instance" + depends on $(dt_nodelabel_exists,pdm0) + select NRFX_PDM + +config NRFX_PDM20 + bool "PDM20 driver instance" + depends on $(dt_nodelabel_exists,pdm20) + select NRFX_PDM + +config NRFX_PDM21 + bool "PDM21 driver instance" + depends on $(dt_nodelabel_exists,pdm21) + select NRFX_PDM config NRFX_POWER bool "POWER driver" @@ -209,11 +312,157 @@ config NRFX_POWER # internally the USBREG driver. select NRFX_USBREG if $(dt_nodelabel_exists,usbreg) +config NRFX_PPI + bool "PPI allocator" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppi) + +config NRFX_PPIB + bool + +config NRFX_PPIB00 + bool "PPIB00 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppib00) + select NRFX_PPIB + +config NRFX_PPIB01 + bool "PPIB01 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppib01) + select NRFX_PPIB + +config NRFX_PPIB10 + bool "PPIB10 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppib10) + select NRFX_PPIB + +config NRFX_PPIB11 + bool "PPIB11 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppib11) + select NRFX_PPIB + +config NRFX_PPIB20 + bool "PPIB20 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppib20) + select NRFX_PPIB + +config NRFX_PPIB21 + bool "PPIB21 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppib21) + select NRFX_PPIB + +config NRFX_PPIB22 + bool "PPIB22 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppib22) + select NRFX_PPIB + +config NRFX_PPIB30 + bool "PPIB30 driver instance" + default y if NRFX_GPPI + depends on $(dt_nodelabel_exists,ppib30) + select NRFX_PPIB + config NRFX_PWM - bool "PWM driver" + bool + +config NRFX_PWM0 + bool "PWM0 driver instance" + depends on $(dt_nodelabel_exists,pwm0) + select NRFX_PWM + +config NRFX_PWM1 + bool "PWM1 driver instance" + depends on $(dt_nodelabel_exists,pwm1) + select NRFX_PWM + +config NRFX_PWM2 + bool "PWM2 driver instance" + depends on $(dt_nodelabel_exists,pwm2) + select NRFX_PWM + +config NRFX_PWM3 + bool "PWM3 driver instance" + depends on $(dt_nodelabel_exists,pwm3) + select NRFX_PWM + +config NRFX_PWM20 + bool "PWM20 driver instance" + depends on $(dt_nodelabel_exists,pwm20) + select NRFX_PWM + +config NRFX_PWM21 + bool "PWM21 driver instance" + depends on $(dt_nodelabel_exists,pwm21) + select NRFX_PWM + +config NRFX_PWM22 + bool "PWM22 driver instance" + depends on $(dt_nodelabel_exists,pwm22) + select NRFX_PWM + +config NRFX_PWM120 + bool "PWM120 driver instance" + depends on $(dt_nodelabel_exists,pwm120) + select NRFX_PWM + +config NRFX_PWM130 + bool "PWM130 driver instance" + depends on $(dt_nodelabel_exists,pwm130) + select NRFX_PWM + +config NRFX_PWM131 + bool "PWM131 driver instance" + depends on $(dt_nodelabel_exists,pwm131) + select NRFX_PWM + +config NRFX_PWM132 + bool "PWM132 driver instance" + depends on $(dt_nodelabel_exists,pwm132) + select NRFX_PWM + +config NRFX_PWM133 + bool "PWM133 driver instance" + depends on $(dt_nodelabel_exists,pwm133) + select NRFX_PWM config NRFX_QDEC - bool "QDEC driver" + bool + +config NRFX_QDEC0 + bool "QDEC0 driver instance" + depends on $(dt_nodelabel_exists,qdec0) + select NRFX_QDEC + +config NRFX_QDEC1 + bool "QDEC1 driver instance" + depends on $(dt_nodelabel_exists,qdec1) + select NRFX_QDEC + +config NRFX_QDEC20 + bool "QDEC20 driver instance" + depends on $(dt_nodelabel_exists,qdec20) + select NRFX_QDEC + +config NRFX_QDEC21 + bool "QDEC21 driver instance" + depends on $(dt_nodelabel_exists,qdec21) + select NRFX_QDEC + +config NRFX_QDEC130 + bool "QDEC130 driver instance" + depends on $(dt_nodelabel_exists,qdec130) + select NRFX_QDEC + +config NRFX_QDEC131 + bool "QDEC131 driver instance" + depends on $(dt_nodelabel_exists,qdec131) + select NRFX_QDEC config NRFX_QSPI bool "QSPI driver" @@ -277,17 +526,231 @@ config NRFX_SPI2 depends on $(dt_nodelabel_exists,spi2) && SOC_SERIES_NRF52X select NRFX_SPI -DT_COMPAT_NORDIC_NRF_SPIM := nordic,nrf-spim - config NRFX_SPIM - bool "SPIM driver" - depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_SPIM)) + bool -DT_COMPAT_NORDIC_NRF_SPIS := nordic,nrf-spis +config NRFX_SPIM0 + bool "SPIM0 driver instance" + depends on $(dt_nodelabel_exists,spi0) && !SOC_SERIES_NRF51X + select NRFX_SPIM + +config NRFX_SPIM1 + bool "SPIM1 driver instance" + depends on $(dt_nodelabel_exists,spi1) && !SOC_SERIES_NRF51X + select NRFX_SPIM + +config NRFX_SPIM2 + bool "SPIM2 driver instance" + depends on $(dt_nodelabel_exists,spi2) + select NRFX_SPIM + +config NRFX_SPIM3 + bool "SPIM3 driver instance" + depends on $(dt_nodelabel_exists,spi3) + select NRFX_SPIM + +config NRFX_SPIM4 + bool "SPIM4 driver instance" + depends on $(dt_nodelabel_exists,spi4) + select NRFX_SPIM + +config NRFX_SPIM00 + bool "SPIM00 driver instance" + depends on $(dt_nodelabel_exists,spi00) + select NRFX_SPIM + +config NRFX_SPIM01 + bool "SPIM01 driver instance" + depends on $(dt_nodelabel_exists,spi01) + select NRFX_SPIM + +config NRFX_SPIM20 + bool "SPIM20 driver instance" + depends on $(dt_nodelabel_exists,spi20) + select NRFX_SPIM + +config NRFX_SPIM21 + bool "SPIM21 driver instance" + depends on $(dt_nodelabel_exists,spi21) + select NRFX_SPIM + +config NRFX_SPIM22 + bool "SPIM22 driver instance" + depends on $(dt_nodelabel_exists,spi22) + select NRFX_SPIM + +config NRFX_SPIM23 + bool "SPIM23 driver instance" + depends on $(dt_nodelabel_exists,spi23) + select NRFX_SPIM + +config NRFX_SPIM24 + bool "SPIM24 driver instance" + depends on $(dt_nodelabel_exists,spi24) + select NRFX_SPIM + +config NRFX_SPIM30 + bool "SPIM30 driver instance" + depends on $(dt_nodelabel_exists,spi30) + select NRFX_SPIM + +config NRFX_SPIM120 + bool "SPIM120 driver instance" + depends on $(dt_nodelabel_exists,spi120) + select NRFX_SPIM + +config NRFX_SPIM121 + bool "SPIM121 driver instance" + depends on $(dt_nodelabel_exists,spi121) + select NRFX_SPIM + +config NRFX_SPIM130 + bool "SPIM130 driver instance" + depends on $(dt_nodelabel_exists,spi130) + select NRFX_SPIM + +config NRFX_SPIM131 + bool "SPIM131 driver instance" + depends on $(dt_nodelabel_exists,spi131) + select NRFX_SPIM + +config NRFX_SPIM132 + bool "SPIM132 driver instance" + depends on $(dt_nodelabel_exists,spi132) + select NRFX_SPIM + +config NRFX_SPIM133 + bool "SPIM133 driver instance" + depends on $(dt_nodelabel_exists,spi133) + select NRFX_SPIM + +config NRFX_SPIM134 + bool "SPIM134 driver instance" + depends on $(dt_nodelabel_exists,spi134) + select NRFX_SPIM + +config NRFX_SPIM135 + bool "SPIM135 driver instance" + depends on $(dt_nodelabel_exists,spi135) + select NRFX_SPIM + +config NRFX_SPIM136 + bool "SPIM136 driver instance" + depends on $(dt_nodelabel_exists,spi136) + select NRFX_SPIM + +config NRFX_SPIM137 + bool "SPIM137 driver instance" + depends on $(dt_nodelabel_exists,spi137) + select NRFX_SPIM config NRFX_SPIS - bool "SPIS driver" - depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_SPIS)) + bool + +config NRFX_SPIS0 + bool "SPIS0 driver instance" + depends on $(dt_nodelabel_exists,spi0) && !SOC_SERIES_NRF51X + select NRFX_SPIS + +config NRFX_SPIS1 + bool "SPIS1 driver instance" + depends on $(dt_nodelabel_exists,spi1) + select NRFX_SPIS + +config NRFX_SPIS2 + bool "SPIS2 driver instance" + depends on $(dt_nodelabel_exists,spi2) + select NRFX_SPIS + +config NRFX_SPIS3 + bool "SPIS3 driver instance" + depends on $(dt_nodelabel_exists,spi3) + select NRFX_SPIS + +config NRFX_SPIS00 + bool "SPIS00 driver instance" + depends on $(dt_nodelabel_exists,spi00) + select NRFX_SPIS + +config NRFX_SPIS01 + bool "SPIS01 driver instance" + depends on $(dt_nodelabel_exists,spi01) + select NRFX_SPIS + +config NRFX_SPIS20 + bool "SPIS20 driver instance" + depends on $(dt_nodelabel_exists,spi20) + select NRFX_SPIS + +config NRFX_SPIS21 + bool "SPIS21 driver instance" + depends on $(dt_nodelabel_exists,spi21) + select NRFX_SPIS + +config NRFX_SPIS22 + bool "SPIS22 driver instance" + depends on $(dt_nodelabel_exists,spi22) + select NRFX_SPIS + +config NRFX_SPIS23 + bool "SPIS23 driver instance" + depends on $(dt_nodelabel_exists,spi23) + select NRFX_SPIS + +config NRFX_SPIS24 + bool "SPIS24 driver instance" + depends on $(dt_nodelabel_exists,spi24) + select NRFX_SPIS + +config NRFX_SPIS30 + bool "SPIS30 driver instance" + depends on $(dt_nodelabel_exists,spi30) + select NRFX_SPIS + +config NRFX_SPIS120 + bool "SPIS120 driver instance" + depends on $(dt_nodelabel_exists,spis120) + select NRFX_SPIS + +config NRFX_SPIS130 + bool "SPIS130 driver instance" + depends on $(dt_nodelabel_exists,spi130) + select NRFX_SPIS + +config NRFX_SPIS131 + bool "SPIS131 driver instance" + depends on $(dt_nodelabel_exists,spi131) + select NRFX_SPIS + +config NRFX_SPIS132 + bool "SPIS132 driver instance" + depends on $(dt_nodelabel_exists,spi132) + select NRFX_SPIS + +config NRFX_SPIS133 + bool "SPIS133 driver instance" + depends on $(dt_nodelabel_exists,spi133) + select NRFX_SPIS + +config NRFX_SPIS134 + bool "SPIS134 driver instance" + depends on $(dt_nodelabel_exists,spi134) + select NRFX_SPIS + +config NRFX_SPIS135 + bool "SPIS135 driver instance" + depends on $(dt_nodelabel_exists,spi135) + select NRFX_SPIS + +config NRFX_SPIS136 + bool "SPIS136 driver instance" + depends on $(dt_nodelabel_exists,spi136) + select NRFX_SPIS + +config NRFX_SPIS137 + bool "SPIS137 driver instance" + depends on $(dt_nodelabel_exists,spi137) + select NRFX_SPIS config NRFX_SYSTICK bool "SYSTICK driver" @@ -302,7 +765,132 @@ config NRFX_TEMP depends on $(dt_nodelabel_exists,temp) config NRFX_TIMER - bool "TIMER driver" + bool + +config NRFX_TIMER0 + bool "TIMER0 driver instance" + depends on $(dt_nodelabel_exists,timer0) + select NRFX_TIMER + +config NRFX_TIMER1 + bool "TIMER1 driver instance" + depends on $(dt_nodelabel_exists,timer1) + select NRFX_TIMER + +config NRFX_TIMER2 + bool "TIMER2 driver instance" + depends on $(dt_nodelabel_exists,timer2) + select NRFX_TIMER + +config NRFX_TIMER3 + bool "TIMER3 driver instance" + depends on $(dt_nodelabel_exists,timer3) + select NRFX_TIMER + +config NRFX_TIMER4 + bool "TIMER4 driver instance" + depends on $(dt_nodelabel_exists,timer4) + select NRFX_TIMER + +config NRFX_TIMER00 + bool "TIMER00 driver instance" + depends on $(dt_nodelabel_exists,timer00) + select NRFX_TIMER + +config NRFX_TIMER10 + bool "TIMER10 driver instance" + depends on $(dt_nodelabel_exists,timer10) + select NRFX_TIMER + +config NRFX_TIMER20 + bool "TIMER20 driver instance" + depends on $(dt_nodelabel_exists,timer20) + select NRFX_TIMER + +config NRFX_TIMER21 + bool "TIMER21 driver instance" + depends on $(dt_nodelabel_exists,timer21) + select NRFX_TIMER + +config NRFX_TIMER22 + bool "TIMER22 driver instance" + depends on $(dt_nodelabel_exists,timer22) + select NRFX_TIMER + +config NRFX_TIMER23 + bool "TIMER23 driver instance" + depends on $(dt_nodelabel_exists,timer23) + select NRFX_TIMER + +config NRFX_TIMER24 + bool "TIMER24 driver instance" + depends on $(dt_nodelabel_exists,timer24) + select NRFX_TIMER + +config NRFX_TIMER020 + bool "TIMER020 driver instance" + depends on $(dt_nodelabel_exists,timer020) + select NRFX_TIMER + +config NRFX_TIMER021 + bool "TIMER021 driver instance" + depends on $(dt_nodelabel_exists,timer021) + select NRFX_TIMER + +config NRFX_TIMER022 + bool "TIMER022 driver instance" + depends on $(dt_nodelabel_exists,timer022) + select NRFX_TIMER + +config NRFX_TIMER120 + bool "TIMER120 driver instance" + depends on $(dt_nodelabel_exists,timer120) + select NRFX_TIMER + +config NRFX_TIMER121 + bool "TIMER121 driver instance" + depends on $(dt_nodelabel_exists,timer121) + select NRFX_TIMER + +config NRFX_TIMER130 + bool "TIMER130 driver instance" + depends on $(dt_nodelabel_exists,timer130) + select NRFX_TIMER + +config NRFX_TIMER131 + bool "TIMER131 driver instance" + depends on $(dt_nodelabel_exists,timer131) + select NRFX_TIMER + +config NRFX_TIMER132 + bool "TIMER132 driver instance" + depends on $(dt_nodelabel_exists,timer132) + select NRFX_TIMER + +config NRFX_TIMER133 + bool "TIMER133 driver instance" + depends on $(dt_nodelabel_exists,timer133) + select NRFX_TIMER + +config NRFX_TIMER134 + bool "TIMER134 driver instance" + depends on $(dt_nodelabel_exists,timer134) + select NRFX_TIMER + +config NRFX_TIMER135 + bool "TIMER135 driver instance" + depends on $(dt_nodelabel_exists,timer135) + select NRFX_TIMER + +config NRFX_TIMER136 + bool "TIMER136 driver instance" + depends on $(dt_nodelabel_exists,timer136) + select NRFX_TIMER + +config NRFX_TIMER137 + bool "TIMER137 driver instance" + depends on $(dt_nodelabel_exists,timer137) + select NRFX_TIMER config NRFX_TWI bool @@ -318,10 +906,195 @@ config NRFX_TWI1 select NRFX_TWI config NRFX_TWIM - bool "NRFX driver for TWIM peripheral" + bool + +config NRFX_TWIM0 + bool "TWIM0 driver instance" + depends on $(dt_nodelabel_exists,i2c0) && !SOC_SERIES_NRF51X + select NRFX_TWIM + +config NRFX_TWIM1 + bool "TWIM1 driver instance" + depends on $(dt_nodelabel_exists,i2c1) && !SOC_SERIES_NRF51X + select NRFX_TWIM + +config NRFX_TWIM2 + bool "TWIM2 driver instance" + depends on $(dt_nodelabel_exists,i2c2) + select NRFX_TWIM + +config NRFX_TWIM3 + bool "TWIM3 driver instance" + depends on $(dt_nodelabel_exists,i2c3) + select NRFX_TWIM + +config NRFX_TWIM20 + bool "TWIM20 driver instance" + depends on $(dt_nodelabel_exists,i2c20) + select NRFX_TWIM + +config NRFX_TWIM21 + bool "TWIM21 driver instance" + depends on $(dt_nodelabel_exists,i2c21) + select NRFX_TWIM + +config NRFX_TWIM22 + bool "TWIM22 driver instance" + depends on $(dt_nodelabel_exists,i2c22) + select NRFX_TWIM + +config NRFX_TWIM23 + bool "TWIM23 driver instance" + depends on $(dt_nodelabel_exists,i2c23) + select NRFX_TWIM + +config NRFX_TWIM24 + bool "TWIM24 driver instance" + depends on $(dt_nodelabel_exists,i2c24) + select NRFX_TWIM + +config NRFX_TWIM30 + bool "TWIM30 driver instance" + depends on $(dt_nodelabel_exists,i2c30) + select NRFX_TWIM + +config NRFX_TWIM120 + bool "TWIM120 driver instance" + depends on $(dt_nodelabel_exists,i2c120) + select NRFX_TWIM + +config NRFX_TWIM130 + bool "TWIM130 driver instance" + depends on $(dt_nodelabel_exists,i2c130) + select NRFX_TWIM + +config NRFX_TWIM131 + bool "TWIM131 driver instance" + depends on $(dt_nodelabel_exists,i2c131) + select NRFX_TWIM + +config NRFX_TWIM132 + bool "TWIM132 driver instance" + depends on $(dt_nodelabel_exists,i2c132) + select NRFX_TWIM + +config NRFX_TWIM133 + bool "TWIM133 driver instance" + depends on $(dt_nodelabel_exists,i2c133) + select NRFX_TWIM + +config NRFX_TWIM134 + bool "TWIM134 driver instance" + depends on $(dt_nodelabel_exists,i2c134) + select NRFX_TWIM + +config NRFX_TWIM135 + bool "TWIM135 driver instance" + depends on $(dt_nodelabel_exists,i2c135) + select NRFX_TWIM + +config NRFX_TWIM136 + bool "TWIM136 driver instance" + depends on $(dt_nodelabel_exists,i2c136) + select NRFX_TWIM + +config NRFX_TWIM137 + bool "TWIM137 driver instance" + depends on $(dt_nodelabel_exists,i2c137) + select NRFX_TWIM config NRFX_TWIS - bool "NRFX driver for TWIS peripheral" + bool + +config NRFX_TWIS0 + bool "TWIS0 driver instance" + depends on $(dt_nodelabel_exists,i2c0) && !SOC_SERIES_NRF51X + select NRFX_TWIS + +config NRFX_TWIS1 + bool "TWIS1 driver instance" + depends on $(dt_nodelabel_exists,i2c1) && !SOC_SERIES_NRF51X + select NRFX_TWIS + +config NRFX_TWIS2 + bool "TWIS2 driver instance" + depends on $(dt_nodelabel_exists,i2c2) + select NRFX_TWIS + +config NRFX_TWIS3 + bool "TWIS3 driver instance" + depends on $(dt_nodelabel_exists,i2c3) + select NRFX_TWIS + +config NRFX_TWIS20 + bool "TWIS20 driver instance" + depends on $(dt_nodelabel_exists,i2c20) + select NRFX_TWIS + +config NRFX_TWIS21 + bool "TWIS21 driver instance" + depends on $(dt_nodelabel_exists,i2c21) + select NRFX_TWIS + +config NRFX_TWIS22 + bool "TWIS22 driver instance" + depends on $(dt_nodelabel_exists,i2c22) + select NRFX_TWIS + +config NRFX_TWIS23 + bool "TWIS23 driver instance" + depends on $(dt_nodelabel_exists,i2c23) + select NRFX_TWIS + +config NRFX_TWIS24 + bool "TWIS24 driver instance" + depends on $(dt_nodelabel_exists,i2c24) + select NRFX_TWIS + +config NRFX_TWIS30 + bool "TWIS30 driver instance" + depends on $(dt_nodelabel_exists,i2c30) + select NRFX_TWIS + +config NRFX_TWIS130 + bool "TWIS130 driver instance" + depends on $(dt_nodelabel_exists,i2c130) + select NRFX_TWIS + +config NRFX_TWIS131 + bool "TWIS131 driver instance" + depends on $(dt_nodelabel_exists,i2c131) + select NRFX_TWIS + +config NRFX_TWIS132 + bool "TWIS132 driver instance" + depends on $(dt_nodelabel_exists,i2c132) + select NRFX_TWIS + +config NRFX_TWIS133 + bool "TWIS133 driver instance" + depends on $(dt_nodelabel_exists,i2c133) + select NRFX_TWIS + +config NRFX_TWIS134 + bool "TWIS134 driver instance" + depends on $(dt_nodelabel_exists,i2c134) + select NRFX_TWIS + +config NRFX_TWIS135 + bool "TWIS135 driver instance" + depends on $(dt_nodelabel_exists,i2c135) + select NRFX_TWIS + +config NRFX_TWIS136 + bool "TWIS136 driver instance" + depends on $(dt_nodelabel_exists,i2c136) + select NRFX_TWIS + +config NRFX_TWIS137 + bool "TWIS137 driver instance" + depends on $(dt_nodelabel_exists,i2c137) + select NRFX_TWIS config NRFX_UART bool @@ -332,7 +1105,107 @@ config NRFX_UART0 select NRFX_UART config NRFX_UARTE - bool "UARTE driver" + bool + +config NRFX_UARTE0 + bool "UARTE0 driver instance" + depends on $(dt_nodelabel_exists,uart0) + select NRFX_UARTE + +config NRFX_UARTE1 + bool "UARTE1 driver instance" + depends on $(dt_nodelabel_exists,uart1) + select NRFX_UARTE + +config NRFX_UARTE2 + bool "UARTE2 driver instance" + depends on $(dt_nodelabel_exists,uart2) + select NRFX_UARTE + +config NRFX_UARTE3 + bool "UARTE3 driver instance" + depends on $(dt_nodelabel_exists,uart3) + select NRFX_UARTE + +config NRFX_UARTE00 + bool "UARTE00 driver instance" + depends on $(dt_nodelabel_exists,uart00) + select NRFX_UARTE + +config NRFX_UARTE20 + bool "UARTE20 driver instance" + depends on $(dt_nodelabel_exists,uart20) + select NRFX_UARTE + +config NRFX_UARTE21 + bool "UARTE21 driver instance" + depends on $(dt_nodelabel_exists,uart21) + select NRFX_UARTE + +config NRFX_UARTE22 + bool "UARTE22 driver instance" + depends on $(dt_nodelabel_exists,uart22) + select NRFX_UARTE + +config NRFX_UARTE23 + bool "UARTE23 driver instance" + depends on $(dt_nodelabel_exists,uart23) + select NRFX_UARTE + +config NRFX_UARTE24 + bool "UARTE24 driver instance" + depends on $(dt_nodelabel_exists,uart24) + select NRFX_UARTE + +config NRFX_UARTE30 + bool "UARTE30 driver instance" + depends on $(dt_nodelabel_exists,uart30) + select NRFX_UARTE + +config NRFX_UARTE120 + bool "UARTE120 driver instance" + depends on $(dt_nodelabel_exists,uart120) + select NRFX_UARTE + +config NRFX_UARTE130 + bool "UARTE130 driver instance" + depends on $(dt_nodelabel_exists,uart130) + select NRFX_UARTE + +config NRFX_UARTE131 + bool "UARTE131 driver instance" + depends on $(dt_nodelabel_exists,uart131) + select NRFX_UARTE + +config NRFX_UARTE132 + bool "UARTE132 driver instance" + depends on $(dt_nodelabel_exists,uart132) + select NRFX_UARTE + +config NRFX_UARTE133 + bool "UARTE133 driver instance" + depends on $(dt_nodelabel_exists,uart133) + select NRFX_UARTE + +config NRFX_UARTE134 + bool "UARTE134 driver instance" + depends on $(dt_nodelabel_exists,uart134) + select NRFX_UARTE + +config NRFX_UARTE135 + bool "UARTE135 driver instance" + depends on $(dt_nodelabel_exists,uart135) + select NRFX_UARTE + +config NRFX_UARTE136 + bool "UARTE136 driver instance" + depends on $(dt_nodelabel_exists,uart136) + select NRFX_UARTE + +config NRFX_UARTE137 + bool "UARTE137 driver instance" + depends on $(dt_nodelabel_exists,uart137) + select NRFX_UARTE config NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG bool "UARTE GPIO configuration support" @@ -361,6 +1234,51 @@ config NRFX_USBREG config NRFX_WDT bool +config NRFX_WDT0 + bool "WDT0 driver instance" + depends on $(dt_nodelabel_exists,wdt0) + select NRFX_WDT + +config NRFX_WDT1 + bool "WDT1 driver instance" + depends on $(dt_nodelabel_exists,wdt1) + select NRFX_WDT + +config NRFX_WDT30 + bool "WDT30 driver instance" + depends on $(dt_nodelabel_exists,wdt30) + select NRFX_WDT + +config NRFX_WDT31 + bool "WDT31 driver instance" + depends on $(dt_nodelabel_exists,wdt31) + select NRFX_WDT + +config NRFX_WDT010 + bool "WDT010 driver instance" + depends on $(dt_nodelabel_exists,wdt010) + select NRFX_WDT + +config NRFX_WDT011 + bool "WDT011 driver instance" + depends on $(dt_nodelabel_exists,wdt011) + select NRFX_WDT + +config NRFX_WDT130 + bool "WDT130 driver instance" + depends on $(dt_nodelabel_exists,wdt130) + select NRFX_WDT + +config NRFX_WDT131 + bool "WDT131 driver instance" + depends on $(dt_nodelabel_exists,wdt131) + select NRFX_WDT + +config NRFX_WDT132 + bool "WDT132 driver instance" + depends on $(dt_nodelabel_exists,wdt132) + select NRFX_WDT + menu "Peripheral Resource Sharing module" config NRFX_PRS diff --git a/modules/hal_nordic/nrfx/Kconfig.logging b/modules/hal_nordic/nrfx/Kconfig.logging index 871dc4382151..322660f40d1a 100644 --- a/modules/hal_nordic/nrfx/Kconfig.logging +++ b/modules/hal_nordic/nrfx/Kconfig.logging @@ -16,6 +16,10 @@ config NRFX_COMP_LOG bool "COMP driver logging" depends on NRFX_COMP +config NRFX_DPPI_LOG + bool "DPPI driver logging" + depends on NRFX_DPPI + config NRFX_EGU_LOG bool "EGU driver logging" depends on NRFX_EGU @@ -60,6 +64,14 @@ config NRFX_POWER_LOG bool "POWER driver logging" depends on NRFX_POWER +config NRFX_PPI_LOG + bool "PPI driver logging" + depends on NRFX_PPI + +config NRFX_PPIB_LOG + bool "PPIB driver logging" + depends on NRFX_PPIB + config NRFX_PRS_LOG bool "PRS driver logging" depends on NRFX_PRS diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index f006240844e5..fac2341c1c55 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -8,8 +8,8 @@ #define NRFX_CONFIG_H__ /* Define nrfx API version used in Zephyr. */ -#define NRFX_CONFIG_API_VER_MAJOR 4 -#define NRFX_CONFIG_API_VER_MINOR 0 +#define NRFX_CONFIG_API_VER_MAJOR 3 +#define NRFX_CONFIG_API_VER_MINOR 12 #define NRFX_CONFIG_API_VER_MICRO 0 /* Macros used in zephyr-specific config files. */ @@ -29,5 +29,83 @@ #endif /* Use defaults for undefined symbols. */ -#include "nrfx_templates_config.h" +#include +#if defined(NRF51) + #include +#elif defined(NRF52805_XXAA) + #include +#elif defined(NRF52810_XXAA) + #include +#elif defined(NRF52811_XXAA) + #include +#elif defined(NRF52820_XXAA) + #include +#elif defined(NRF52832_XXAA) || defined (NRF52832_XXAB) + #include +#elif defined(NRF52833_XXAA) + #include +#elif defined(NRF52840_XXAA) + #include +#elif defined(NRF5340_XXAA_APPLICATION) + #include +#elif defined(NRF5340_XXAA_NETWORK) + #include +#elif defined(NRF54H20_XXAA) && defined(NRF_APPLICATION) + #include +#elif defined(NRF54H20_XXAA) && defined(NRF_RADIOCORE) + #include +#elif defined(NRF54H20_XXAA) && defined(NRF_PPR) + #include +#elif defined(NRF54H20_XXAA) && defined(NRF_FLPR) + #include +#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_APPLICATION) + #include +#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_RADIOCORE) + #include +#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_PPR) + #include +#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_FLPR) + #include +#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_APPLICATION) + #include +#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_RADIOCORE) + #include +#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_PPR) + #include +#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_FLPR) + #include +#elif defined(NRF54L05_XXAA) && defined(NRF_APPLICATION) + #include +#elif defined(NRF54L05_XXAA) && defined(NRF_FLPR) + #include +#elif defined(NRF54L10_XXAA) && defined(NRF_APPLICATION) + #include +#elif defined(NRF54L10_XXAA) && defined(NRF_FLPR) + #include +#elif defined(NRF54L15_XXAA) && defined(NRF_APPLICATION) + #include +#elif defined(NRF54L15_XXAA) && defined(NRF_FLPR) + #include +#elif defined(NRF54LM20A_ENGA_XXAA) && defined(NRF_APPLICATION) + #include +#elif defined(NRF54LM20A_ENGA_XXAA) && defined(NRF_FLPR) + #include +#elif defined(NRF54LV10A_ENGA_XXAA) && defined(NRF_APPLICATION) + #include +#elif defined(NRF54LV10A_ENGA_XXAA) && defined(NRF_FLPR) + #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 +#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_FLPR) + #include +#else + #include "nrfx_config_ext.h" +#endif + #endif // NRFX_CONFIG_H__ diff --git a/modules/hal_nordic/nrfx/nrfx_glue.c b/modules/hal_nordic/nrfx/nrfx_glue.c index 5c0dc4f91d98..4e7fc94e11de 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.c +++ b/modules/hal_nordic/nrfx/nrfx_glue.c @@ -6,11 +6,11 @@ #include #include -#include +#include void nrfx_isr(const void *irq_handler) { - ((nrfx_irq_handler_t)irq_handler)(NULL); + ((nrfx_irq_handler_t)irq_handler)(); } void nrfx_busy_wait(uint32_t usec_to_wait) @@ -22,22 +22,26 @@ void nrfx_busy_wait(uint32_t usec_to_wait) } } -char const *nrfx_error_string_get(int code) +char const *nrfx_error_string_get(nrfx_err_t code) { - switch (-code) { - case 0: return STRINGIFY(0); - case ECANCELED: return STRINGIFY(ECANCELED); - case ENOMEM: return STRINGIFY(ENOMEM); - case ENOTSUP: return STRINGIFY(ENOTSUP); - case EINVAL: return STRINGIFY(EINVAL); - case EINPROGRESS: return STRINGIFY(EINPROGRESS); - case E2BIG: return STRINGIFY(E2BIG); - case ETIMEDOUT: return STRINGIFY(ETIMEDOUT); - case EPERM: return STRINGIFY(EPERM); - case EFAULT: return STRINGIFY(EFAULT); - case EACCES: return STRINGIFY(EACCES); - case EBUSY: return STRINGIFY(EBUSY); - case EALREADY: return STRINGIFY(EALREADY); - default: return "unknown"; + #define NRFX_ERROR_STRING_CASE(code) case code: return #code + switch (code) { + NRFX_ERROR_STRING_CASE(NRFX_SUCCESS); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_INTERNAL); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_NO_MEM); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_NOT_SUPPORTED); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_PARAM); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_STATE); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_LENGTH); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_TIMEOUT); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_FORBIDDEN); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_NULL); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_INVALID_ADDR); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_BUSY); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_ALREADY); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_OVERRUN); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_ANACK); + NRFX_ERROR_STRING_CASE(NRFX_ERROR_DRV_TWI_ERR_DNACK); + default: return "unknown"; } } diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 5118dd29944e..4f0d594a2123 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -81,8 +81,54 @@ #ifdef CONFIG_NRFX_CRACEN #define NRFX_CRACEN_ENABLED 1 #endif -#ifdef CONFIG_NRFX_CRACEN_BSIM_SUPPORT -#define NRFX_CRACEN_BSIM_SUPPORT 1 + +#ifdef CONFIG_NRFX_DPPI +#define NRFX_DPPI_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI_LOG +#define NRFX_DPPI_CONFIG_LOG_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI0 +#define NRFX_DPPI0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI00 +#define NRFX_DPPI00_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI10 +#define NRFX_DPPI10_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI20 +#define NRFX_DPPI20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI30 +#define NRFX_DPPI30_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI020 +#define NRFX_DPPI020_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI120 +#define NRFX_DPPI120_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI130 +#define NRFX_DPPI130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI131 +#define NRFX_DPPI131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI132 +#define NRFX_DPPI132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI133 +#define NRFX_DPPI133_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI134 +#define NRFX_DPPI134_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI135 +#define NRFX_DPPI135_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI136 +#define NRFX_DPPI136_ENABLED 1 #endif #ifdef CONFIG_NRFX_EGU @@ -178,6 +224,12 @@ #ifdef CONFIG_NRFX_I2S_LOG #define NRFX_I2S_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_I2S0 +#define NRFX_I2S0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_I2S20 +#define NRFX_I2S20_ENABLED 1 +#endif #ifdef CONFIG_NRFX_IPC #define NRFX_IPC_ENABLED 1 @@ -220,6 +272,15 @@ #ifdef CONFIG_NRFX_PDM_LOG #define NRFX_PDM_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_PDM0 +#define NRFX_PDM0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PDM20 +#define NRFX_PDM20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PDM21 +#define NRFX_PDM21_ENABLED 1 +#endif #ifdef CONFIG_NRFX_POWER #define NRFX_POWER_ENABLED 1 @@ -228,6 +289,44 @@ #define NRFX_POWER_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_PPI +#define NRFX_PPI_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPI_LOG +#define NRFX_PPI_CONFIG_LOG_ENABLED 1 +#endif + +#ifdef CONFIG_NRFX_PPIB +#define NRFX_PPIB_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB_LOG +#define NRFX_PPIB_CONFIG_LOG_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB00 +#define NRFX_PPIB00_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB01 +#define NRFX_PPIB01_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB10 +#define NRFX_PPIB10_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB11 +#define NRFX_PPIB11_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB20 +#define NRFX_PPIB20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB21 +#define NRFX_PPIB21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB22 +#define NRFX_PPIB22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB30 +#define NRFX_PPIB30_ENABLED 1 +#endif + #ifdef CONFIG_NRFX_PRS #define NRFX_PRS_ENABLED 1 #endif @@ -256,6 +355,42 @@ #ifdef CONFIG_NRFX_PWM_LOG #define NRFX_PWM_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_PWM0 +#define NRFX_PWM0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM1 +#define NRFX_PWM1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM2 +#define NRFX_PWM2_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM3 +#define NRFX_PWM3_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM20 +#define NRFX_PWM20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM21 +#define NRFX_PWM21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM22 +#define NRFX_PWM22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM120 +#define NRFX_PWM120_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM130 +#define NRFX_PWM130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM131 +#define NRFX_PWM131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM132 +#define NRFX_PWM132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PWM133 +#define NRFX_PWM133_ENABLED 1 +#endif #ifdef CONFIG_NRFX_QDEC #define NRFX_QDEC_ENABLED 1 @@ -263,6 +398,24 @@ #ifdef CONFIG_NRFX_QDEC_LOG #define NRFX_QDEC_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_QDEC0 +#define NRFX_QDEC0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_QDEC1 +#define NRFX_QDEC1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_QDEC20 +#define NRFX_QDEC20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_QDEC21 +#define NRFX_QDEC21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_QDEC130 +#define NRFX_QDEC130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_QDEC131 +#define NRFX_QDEC131_ENABLED 1 +#endif #ifdef CONFIG_NRFX_QSPI #define NRFX_QSPI_ENABLED 1 @@ -333,11 +486,23 @@ #ifdef CONFIG_NRFX_SPIM_LOG #define NRFX_SPIM_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_SPIM0 +#define NRFX_SPIM0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM1 +#define NRFX_SPIM1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM2 +#define NRFX_SPIM2_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM3 +#define NRFX_SPIM3_ENABLED 1 #ifdef CONFIG_NRF52_ANOMALY_198_WORKAROUND -#define NRF52_ERRATA_198_ENABLE_WORKAROUND 1 +#define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 1 +#endif #endif -#ifdef CONFIG_NRF52_ANOMALY_58_WORKAROUND -#define NRF52_ERRATA_58_ENABLE_WORKAROUND 1 +#ifdef CONFIG_NRFX_SPIM4 +#define NRFX_SPIM4_ENABLED 1 #endif #define NRFX_SPIM_DT_HAS_RX_DELAY(node) DT_PROP(node, rx_delay_supported) + @@ -348,12 +513,130 @@ #endif #endif +#ifdef CONFIG_NRFX_SPIM00 +#define NRFX_SPIM00_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM01 +#define NRFX_SPIM01_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM20 +#define NRFX_SPIM20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM21 +#define NRFX_SPIM21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM22 +#define NRFX_SPIM22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM23 +#define NRFX_SPIM23_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM24 +#define NRFX_SPIM24_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM30 +#define NRFX_SPIM30_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM120 +#define NRFX_SPIM120_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM121 +#define NRFX_SPIM121_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM130 +#define NRFX_SPIM130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM131 +#define NRFX_SPIM131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM132 +#define NRFX_SPIM132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM133 +#define NRFX_SPIM133_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM134 +#define NRFX_SPIM134_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM135 +#define NRFX_SPIM135_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM136 +#define NRFX_SPIM136_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIM137 +#define NRFX_SPIM137_ENABLED 1 +#endif + #ifdef CONFIG_NRFX_SPIS #define NRFX_SPIS_ENABLED 1 #endif #ifdef CONFIG_NRFX_SPIS_LOG #define NRFX_SPIS_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_SPIS0 +#define NRFX_SPIS0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS1 +#define NRFX_SPIS1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS2 +#define NRFX_SPIS2_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS3 +#define NRFX_SPIS3_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS00 +#define NRFX_SPIS00_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS01 +#define NRFX_SPIS01_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS20 +#define NRFX_SPIS20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS21 +#define NRFX_SPIS21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS22 +#define NRFX_SPIS22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS23 +#define NRFX_SPIS23_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS24 +#define NRFX_SPIS24_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS30 +#define NRFX_SPIS30_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS120 +#define NRFX_SPIS120_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS130 +#define NRFX_SPIS130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS131 +#define NRFX_SPIS131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS132 +#define NRFX_SPIS132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS133 +#define NRFX_SPIS133_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS134 +#define NRFX_SPIS134_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS135 +#define NRFX_SPIS135_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS136 +#define NRFX_SPIS136_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPIS137 +#define NRFX_SPIS137_ENABLED 1 +#endif #ifdef CONFIG_NRFX_SYSTICK #define NRFX_SYSTICK_ENABLED 1 @@ -376,6 +659,84 @@ #ifdef CONFIG_NRFX_TIMER #define NRFX_TIMER_ENABLED 1 #endif +#ifdef CONFIG_NRFX_TIMER_LOG +#define NRFX_TIMER_CONFIG_LOG_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER0 +#define NRFX_TIMER0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER1 +#define NRFX_TIMER1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER2 +#define NRFX_TIMER2_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER3 +#define NRFX_TIMER3_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER4 +#define NRFX_TIMER4_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER00 +#define NRFX_TIMER00_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER10 +#define NRFX_TIMER10_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER20 +#define NRFX_TIMER20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER21 +#define NRFX_TIMER21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER22 +#define NRFX_TIMER22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER23 +#define NRFX_TIMER23_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER24 +#define NRFX_TIMER24_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER020 +#define NRFX_TIMER020_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER021 +#define NRFX_TIMER021_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER022 +#define NRFX_TIMER022_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER120 +#define NRFX_TIMER120_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER121 +#define NRFX_TIMER121_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER130 +#define NRFX_TIMER130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER131 +#define NRFX_TIMER131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER132 +#define NRFX_TIMER132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER133 +#define NRFX_TIMER133_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER134 +#define NRFX_TIMER134_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER135 +#define NRFX_TIMER135_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER136 +#define NRFX_TIMER136_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TIMER137 +#define NRFX_TIMER137_ENABLED 1 +#endif #ifdef CONFIG_NRFX_TWI #define NRFX_TWI_ENABLED 1 @@ -396,11 +757,68 @@ #ifdef CONFIG_NRFX_TWIM_LOG #define NRFX_TWIM_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_TWIM0 +#define NRFX_TWIM0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM1 +#define NRFX_TWIM1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM2 +#define NRFX_TWIM2_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM3 +#define NRFX_TWIM3_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM20 +#define NRFX_TWIM20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM21 +#define NRFX_TWIM21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM22 +#define NRFX_TWIM22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM23 +#define NRFX_TWIM23_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM24 +#define NRFX_TWIM24_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM30 +#define NRFX_TWIM30_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM120 +#define NRFX_TWIM120_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM130 +#define NRFX_TWIM130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM131 +#define NRFX_TWIM131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM132 +#define NRFX_TWIM132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM133 +#define NRFX_TWIM133_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM134 +#define NRFX_TWIM134_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM135 +#define NRFX_TWIM135_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM136 +#define NRFX_TWIM136_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIM137 +#define NRFX_TWIM137_ENABLED 1 +#endif #ifdef CONFIG_NRF52_ANOMALY_219_WORKAROUND -#define NRF52_ERRATA_219_ENABLE_WORKAROUND 1 +#define NRFX_TWIM_NRF52_ANOMALY_219_WORKAROUND_ENABLED 1 #endif #ifdef CONFIG_SOC_NRF53_ANOMALY_47_WORKAROUND -#define NRF53_ERRATA_47_ENABLE_WORKAROUND 1 +#define NRFX_TWIM_NRF53_ANOMALY_47_WORKAROUND_ENABLED 1 #endif #ifdef CONFIG_NRFX_TWIS @@ -409,6 +827,60 @@ #ifdef CONFIG_NRFX_TWIS_LOG #define NRFX_TWIS_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_TWIS0 +#define NRFX_TWIS0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS1 +#define NRFX_TWIS1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS2 +#define NRFX_TWIS2_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS3 +#define NRFX_TWIS3_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS20 +#define NRFX_TWIS20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS21 +#define NRFX_TWIS21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS22 +#define NRFX_TWIS22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS23 +#define NRFX_TWIS23_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS24 +#define NRFX_TWIS24_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS30 +#define NRFX_TWIS30_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS130 +#define NRFX_TWIS130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS131 +#define NRFX_TWIS131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS132 +#define NRFX_TWIS132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS133 +#define NRFX_TWIS133_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS134 +#define NRFX_TWIS134_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS135 +#define NRFX_TWIS135_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS136 +#define NRFX_TWIS136_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWIS137 +#define NRFX_TWIS137_ENABLED 1 +#endif #ifdef CONFIG_NRFX_UART #define NRFX_UART_ENABLED 1 @@ -426,6 +898,66 @@ #ifdef CONFIG_NRFX_UARTE_LOG #define NRFX_UARTE_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_UARTE0 +#define NRFX_UARTE0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE1 +#define NRFX_UARTE1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE2 +#define NRFX_UARTE2_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE3 +#define NRFX_UARTE3_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE00 +#define NRFX_UARTE00_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE20 +#define NRFX_UARTE20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE21 +#define NRFX_UARTE21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE22 +#define NRFX_UARTE22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE23 +#define NRFX_UARTE23_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE24 +#define NRFX_UARTE24_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE30 +#define NRFX_UARTE30_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE120 +#define NRFX_UARTE120_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE130 +#define NRFX_UARTE130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE131 +#define NRFX_UARTE131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE132 +#define NRFX_UARTE132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE133 +#define NRFX_UARTE133_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE134 +#define NRFX_UARTE134_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE135 +#define NRFX_UARTE135_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE136 +#define NRFX_UARTE136_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_UARTE137 +#define NRFX_UARTE137_ENABLED 1 +#endif #ifdef CONFIG_NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG #define NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG 1 #endif @@ -455,13 +987,50 @@ #ifdef CONFIG_NRFX_WDT_LOG #define NRFX_WDT_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_WDT0 +#define NRFX_WDT0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_WDT1 +#define NRFX_WDT1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_WDT30 +#define NRFX_WDT30_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_WDT31 +#define NRFX_WDT31_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_WDT010 +#define NRFX_WDT010_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_WDT011 +#define NRFX_WDT011_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_WDT130 +#define NRFX_WDT130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_WDT131 +#define NRFX_WDT131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_WDT132 +#define NRFX_WDT132_ENABLED 1 +#endif #ifdef CONFIG_NRF52_ANOMALY_109_WORKAROUND -#define NRF52_ERRATA_109_ENABLE_WORKAROUND 1 +#define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 +#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 +#define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 +#define NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1 #define NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE \ CONFIG_NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE #endif +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || \ + DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_local) +#ifndef NRFX_DPPI_ENABLED +#define NRFX_DPPI_ENABLED 1 +#endif +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || ... */ + /* If local or global DPPIC peripherals are used, provide the following macro * definitions required by the interconnect/ipct layer: * - NRFX_IPCTx_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) diff --git a/modules/hal_nordic/nrfx/nrfx_log.h b/modules/hal_nordic/nrfx/nrfx_log.h index 7af77e9396eb..682388d7dd16 100644 --- a/modules/hal_nordic/nrfx/nrfx_log.h +++ b/modules/hal_nordic/nrfx/nrfx_log.h @@ -126,7 +126,7 @@ LOG_MODULE_REGISTER(NRFX_MODULE_PREFIX, NRFX_MODULE_LOG_LEVEL); * @return String containing the textual representation of the error code. */ #define NRFX_LOG_ERROR_STRING_GET(error_code) nrfx_error_string_get(error_code) -extern char const *nrfx_error_string_get(int code); +extern char const *nrfx_error_string_get(nrfx_err_t code); /** @} */ diff --git a/modules/nrf_wifi/bus/qspi_if.c b/modules/nrf_wifi/bus/qspi_if.c index 9b42ed6f1eb0..8d3dc81e3476 100644 --- a/modules/nrf_wifi/bus/qspi_if.c +++ b/modules/nrf_wifi/bus/qspi_if.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -295,17 +296,17 @@ static inline int qspi_get_lines_read(uint8_t lines) return ret; } -int _nrfx_qspi_read(void *p_rx_buffer, size_t rx_buffer_length, uint32_t src_address) +nrfx_err_t _nrfx_qspi_read(void *p_rx_buffer, size_t rx_buffer_length, uint32_t src_address) { return nrfx_qspi_read(p_rx_buffer, rx_buffer_length, src_address); } -int _nrfx_qspi_write(void const *p_tx_buffer, size_t tx_buffer_length, uint32_t dst_address) +nrfx_err_t _nrfx_qspi_write(void const *p_tx_buffer, size_t tx_buffer_length, uint32_t dst_address) { return nrfx_qspi_write(p_tx_buffer, tx_buffer_length, dst_address); } -int _nrfx_qspi_init(nrfx_qspi_config_t const *p_config, nrfx_qspi_handler_t handler, +nrfx_err_t _nrfx_qspi_init(nrfx_qspi_config_t const *p_config, nrfx_qspi_handler_t handler, void *p_context) { NRF_QSPI_Type *p_reg = NRF_QSPI; @@ -318,7 +319,7 @@ int _nrfx_qspi_init(nrfx_qspi_config_t const *p_config, nrfx_qspi_handler_t hand /* LOG_DBG("%04x : IFTIMING", p_reg->IFTIMING & qspi_cfg->RDC4IO); */ /* ACTIVATE task fails for slave bitfile so ignore it */ - return 0; + return NRFX_SUCCESS; } @@ -338,6 +339,32 @@ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QSPI_IF_BUS_NODE); IF_ENABLED(CONFIG_PINCTRL, (PINCTRL_DT_DEFINE(QSPI_IF_BUS_NODE))); +/** + * @brief Converts NRFX return codes to the zephyr ones + */ +static inline int qspi_get_zephyr_ret_code(nrfx_err_t res) +{ + switch (res) { + case NRFX_SUCCESS: + return 0; + case NRFX_ERROR_INVALID_PARAM: + case NRFX_ERROR_INVALID_ADDR: + return -EINVAL; + case NRFX_ERROR_INVALID_STATE: + return -ECANCELED; +#if NRF53_ERRATA_159_ENABLE_WORKAROUND + case NRFX_ERROR_FORBIDDEN: + LOG_ERR("nRF5340 anomaly 159 conditions detected"); + LOG_ERR("Set the CPU clock to 64 MHz before starting QSPI operation"); + return -ECANCELED; +#endif + case NRFX_ERROR_BUSY: + case NRFX_ERROR_TIMEOUT: + default: + return -EBUSY; + } +} + static inline struct qspi_nor_data *get_dev_data(const struct device *dev) { return dev->data; @@ -404,11 +431,11 @@ static inline void qspi_trans_unlock(const struct device *dev) #endif /* CONFIG_MULTITHREADING */ } -static inline void qspi_wait_for_completion(const struct device *dev, int res) +static inline void qspi_wait_for_completion(const struct device *dev, nrfx_err_t res) { struct qspi_nor_data *dev_data = get_dev_data(dev); - if (res == 0) { + if (res == NRFX_SUCCESS) { #ifdef CONFIG_MULTITHREADING k_sem_take(&dev_data->sync, K_FOREVER); #else /* CONFIG_MULTITHREADING */ @@ -442,7 +469,7 @@ static inline void _qspi_complete(struct qspi_nor_data *dev_data) qspi_complete(dev_data); } -static inline void _qspi_wait_for_completion(const struct device *dev, int res) +static inline void _qspi_wait_for_completion(const struct device *dev, nrfx_err_t res) { if (!qspi_cfg->easydma) { return; @@ -472,6 +499,7 @@ static bool qspi_initialized; static int qspi_device_init(const struct device *dev) { struct qspi_nor_data *dev_data = get_dev_data(dev); + nrfx_err_t res; int ret = 0; if (!IS_ENABLED(CONFIG_NRF70_QSPI_LOW_POWER)) { @@ -489,7 +517,8 @@ static int qspi_device_init(const struct device *dev) #endif if (!qspi_initialized) { - ret = nrfx_qspi_init(&QSPIconfig, qspi_handler, dev_data); + res = nrfx_qspi_init(&QSPIconfig, qspi_handler, dev_data); + ret = qspi_get_zephyr_ret_code(res); NRF_QSPI->IFTIMING |= qspi_cfg->RDC4IO; qspi_initialized = (ret == 0); } @@ -514,7 +543,7 @@ static void _qspi_device_uninit(const struct device *dev) #endif if (last) { - while (nrfx_qspi_mem_busy_check() != 0) { + while (nrfx_qspi_mem_busy_check() != NRFX_SUCCESS) { if (IS_ENABLED(CONFIG_MULTITHREADING)) { k_msleep(50); } else { @@ -603,7 +632,7 @@ static int qspi_send_cmd(const struct device *dev, const struct qspi_cmd *cmd, b int res = nrfx_qspi_cinstr_xfer(&cinstr_cfg, tx_buf, rx_buf); qspi_unlock(dev); - return res; + return qspi_get_zephyr_ret_code(res); } /* RDSR wrapper. Negative value is error. */ @@ -711,13 +740,16 @@ static int qspi_nrfx_configure(const struct device *dev) k_busy_wait(BASE_CLOCK_SWITCH_DELAY_US); #endif - int ret = _nrfx_qspi_init(&QSPIconfig, qspi_handler, dev_data); + nrfx_err_t res = _nrfx_qspi_init(&QSPIconfig, qspi_handler, dev_data); #if defined(CONFIG_SOC_SERIES_NRF53X) /* Restore the default /4 divider after the QSPI initialization. */ nrf_clock_hfclk192m_div_set(NRF_CLOCK, NRF_CLOCK_HFCLK_DIV_4); k_busy_wait(BASE_CLOCK_SWITCH_DELAY_US); #endif + + int ret = qspi_get_zephyr_ret_code(res); + if (ret == 0) { /* Set QE to match transfer mode. If not using quad * it's OK to leave QE set, but doing so prevents use @@ -774,7 +806,7 @@ static int qspi_nrfx_configure(const struct device *dev) return ret; } -static inline int read_non_aligned(const struct device *dev, int addr, void *dest, +static inline nrfx_err_t read_non_aligned(const struct device *dev, int addr, void *dest, size_t size) { uint8_t __aligned(WORD_SIZE) buf[WORD_SIZE * 2]; @@ -801,7 +833,7 @@ static inline int read_non_aligned(const struct device *dev, int addr, void *des flash_suffix = size - flash_prefix - flash_middle; } - int res = 0; + nrfx_err_t res = NRFX_SUCCESS; /* read from aligned flash to aligned memory */ if (flash_middle != 0) { @@ -809,7 +841,7 @@ static inline int read_non_aligned(const struct device *dev, int addr, void *des _qspi_wait_for_completion(dev, res); - if (res != 0) { + if (res != NRFX_SUCCESS) { return res; } @@ -825,7 +857,7 @@ static inline int read_non_aligned(const struct device *dev, int addr, void *des _qspi_wait_for_completion(dev, res); - if (res != 0) { + if (res != NRFX_SUCCESS) { return res; } @@ -838,7 +870,7 @@ static inline int read_non_aligned(const struct device *dev, int addr, void *des _qspi_wait_for_completion(dev, res); - if (res != 0) { + if (res != NRFX_SUCCESS) { return res; } @@ -859,28 +891,31 @@ static int qspi_nor_read(const struct device *dev, int addr, void *dest, size_t return 0; } - int ret = qspi_device_init(dev); + int rc = qspi_device_init(dev); - if (ret != 0) { + if (rc != 0) { goto out; } qspi_lock(dev); - ret = read_non_aligned(dev, addr, dest, size); + nrfx_err_t res = read_non_aligned(dev, addr, dest, size); qspi_unlock(dev); + + rc = qspi_get_zephyr_ret_code(res); + out: qspi_device_uninit(dev); - return ret; + return rc; } /* addr aligned, sptr not null, slen less than 4 */ -static inline int write_sub_word(const struct device *dev, int addr, const void *sptr, +static inline nrfx_err_t write_sub_word(const struct device *dev, int addr, const void *sptr, size_t slen) { uint8_t __aligned(4) buf[4]; - int res; + nrfx_err_t res; /* read out the whole word so that unchanged data can be * written back @@ -888,7 +923,7 @@ static inline int write_sub_word(const struct device *dev, int addr, const void res = _nrfx_qspi_read(buf, sizeof(buf), addr); _qspi_wait_for_completion(dev, res); - if (res == 0) { + if (res == NRFX_SUCCESS) { memcpy(buf, sptr, slen); res = _nrfx_qspi_write(buf, sizeof(buf), addr); _qspi_wait_for_completion(dev, res); @@ -913,9 +948,11 @@ static int qspi_nor_write(const struct device *dev, int addr, const void *src, s return -EINVAL; } - int res = qspi_device_init(dev); + nrfx_err_t res = NRFX_SUCCESS; + + int rc = qspi_device_init(dev); - if (res != 0) { + if (rc != 0) { goto out; } @@ -933,9 +970,11 @@ static int qspi_nor_write(const struct device *dev, int addr, const void *src, s qspi_unlock(dev); qspi_trans_unlock(dev); + + rc = qspi_get_zephyr_ret_code(res); out: qspi_device_uninit(dev); - return res; + return rc; } /** @@ -1421,7 +1460,7 @@ int qspi_enable_encryption(uint8_t *key) memcpy(qspi_cfg->p_cfg.key, key, 16); err = nrfx_qspi_dma_encrypt(&qspi_cfg->p_cfg); - if (err != 0) { + if (err != NRFX_SUCCESS) { LOG_ERR("nrfx_qspi_dma_encrypt failed: %d", err); return -EIO; } diff --git a/modules/trusted-firmware-m/nordic/include/tfm_read_ranges.h b/modules/trusted-firmware-m/nordic/include/tfm_read_ranges.h index 0c1ba3459237..43468c7fa319 100644 --- a/modules/trusted-firmware-m/nordic/include/tfm_read_ranges.h +++ b/modules/trusted-firmware-m/nordic/include/tfm_read_ranges.h @@ -9,7 +9,7 @@ #include -#include +#include #ifdef NRF_FICR_S_BASE diff --git a/samples/boards/nordic/nrfx/src/main.c b/samples/boards/nordic/nrfx/src/main.c index bc0506cd2b5d..8b3819f2d8a1 100644 --- a/samples/boards/nordic/nrfx/src/main.c +++ b/samples/boards/nordic/nrfx/src/main.c @@ -36,33 +36,33 @@ int main(void) { LOG_INF("nrfx_gpiote sample on %s", CONFIG_BOARD); - int rv; + nrfx_err_t err; uint8_t in_channel, out_channel; - nrfx_gppi_handle_t ppi_handle; - static nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(NRF_GPIOTE_INST_GET(GPIOTE_INST)); + uint8_t ppi_channel; + const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(GPIOTE_INST); /* Connect GPIOTE instance IRQ to irq handler */ - IRQ_CONNECT(DT_IRQN(GPIOTE_NODE), DT_IRQ(GPIOTE_NODE, priority), nrfx_gpiote_irq_handler, - &gpiote, 0); + IRQ_CONNECT(DT_IRQN(GPIOTE_NODE), DT_IRQ(GPIOTE_NODE, priority), nrfx_isr, + NRFX_CONCAT(nrfx_gpiote_, GPIOTE_INST, _irq_handler), 0); /* Initialize GPIOTE (the interrupt priority passed as the parameter * here is ignored, see nrfx_glue.h). */ - rv = nrfx_gpiote_init(&gpiote, 0); - if (rv != 0) { - LOG_ERR("nrfx_gpiote_init error: %d", rv); + err = nrfx_gpiote_init(&gpiote, 0); + if (err != NRFX_SUCCESS) { + LOG_ERR("nrfx_gpiote_init error: 0x%08X", err); return 0; } - rv = nrfx_gpiote_channel_alloc(&gpiote, &in_channel); - if (rv != 0) { - LOG_ERR("Failed to allocate in_channel, error: %d", rv); + err = nrfx_gpiote_channel_alloc(&gpiote, &in_channel); + if (err != NRFX_SUCCESS) { + LOG_ERR("Failed to allocate in_channel, error: 0x%08X", err); return 0; } - rv = nrfx_gpiote_channel_alloc(&gpiote, &out_channel); - if (rv != 0) { - LOG_ERR("Failed to allocate out_channel, error: %d", rv); + err = nrfx_gpiote_channel_alloc(&gpiote, &out_channel); + if (err != NRFX_SUCCESS) { + LOG_ERR("Failed to allocate out_channel, error: 0x%08X", err); return 0; } @@ -83,10 +83,10 @@ int main(void) .p_handler_config = &handler_config }; - rv = nrfx_gpiote_input_configure(&gpiote, INPUT_PIN, &input_config); + err = nrfx_gpiote_input_configure(&gpiote, INPUT_PIN, &input_config); - if (rv != 0) { - LOG_ERR("nrfx_gpiote_input_configure error: %d", rv); + if (err != NRFX_SUCCESS) { + LOG_ERR("nrfx_gpiote_input_configure error: 0x%08X", err); return 0; } @@ -103,11 +103,11 @@ int main(void) .polarity = NRF_GPIOTE_POLARITY_TOGGLE, .init_val = 1, }; - rv = nrfx_gpiote_output_configure(&gpiote, OUTPUT_PIN, + err = nrfx_gpiote_output_configure(&gpiote, OUTPUT_PIN, &output_config, &task_config); - if (rv != 0) { - LOG_ERR("nrfx_gpiote_output_configure error: %d", rv); + if (err != NRFX_SUCCESS) { + LOG_ERR("nrfx_gpiote_output_configure error: 0x%08X", err); return 0; } @@ -116,20 +116,23 @@ int main(void) LOG_INF("nrfx_gpiote initialized"); + /* Allocate a (D)PPI channel. */ + err = nrfx_gppi_channel_alloc(&ppi_channel); + if (err != NRFX_SUCCESS) { + LOG_ERR("nrfx_gppi_channel_alloc error: 0x%08X", err); + return 0; + } + /* Configure endpoints of the channel so that the input pin event is * connected with the output pin OUT task. This means that each time * the button is pressed, the LED pin will be toggled. */ - rv = nrfx_gppi_conn_alloc(nrfx_gpiote_in_event_address_get(&gpiote, INPUT_PIN), - nrfx_gpiote_out_task_address_get(&gpiote, OUTPUT_PIN), - &ppi_handle); - if (rv < 0) { - LOG_ERR("nrfx_gppi_conn_alloc error: %d", rv); - return 0; - } + nrfx_gppi_channel_endpoints_setup(ppi_channel, + nrfx_gpiote_in_event_address_get(&gpiote, INPUT_PIN), + nrfx_gpiote_out_task_address_get(&gpiote, OUTPUT_PIN)); /* Enable the channel. */ - nrfx_gppi_conn_enable(ppi_handle); + nrfx_gppi_channels_enable(BIT(ppi_channel)); LOG_INF("(D)PPI configured, leaving main()"); return 0; diff --git a/samples/boards/nordic/nrfx_prs/prj.conf b/samples/boards/nordic/nrfx_prs/prj.conf index 47dd7198fd9d..3c8ea985f56c 100644 --- a/samples/boards/nordic/nrfx_prs/prj.conf +++ b/samples/boards/nordic/nrfx_prs/prj.conf @@ -1,8 +1,8 @@ # This is needed for using SPIM2 and UARTE2 via nrfx drivers and for switching # between those peripherals, as they share the same ID and hence cannot be used # simultaneously. -CONFIG_NRFX_SPIM=y -CONFIG_NRFX_UARTE=y +CONFIG_NRFX_SPIM2=y +CONFIG_NRFX_UARTE2=y CONFIG_NRFX_PRS_BOX_2=y # This is needed for using another SPIM instance via the Zephyr SPI driver. diff --git a/samples/boards/nordic/nrfx_prs/src/main.c b/samples/boards/nordic/nrfx_prs/src/main.c index 65476003797e..e9e63e574d29 100644 --- a/samples/boards/nordic/nrfx_prs/src/main.c +++ b/samples/boards/nordic/nrfx_prs/src/main.c @@ -28,13 +28,12 @@ */ #define SPI_DEV_NODE DT_NODELABEL(spi1) -static nrfx_spim_t spim = NRFX_SPIM_INSTANCE(NRF_SPIM2); -static nrfx_uarte_t uarte = NRFX_UARTE_INSTANCE(NRF_UARTE2); +static nrfx_spim_t spim = NRFX_SPIM_INSTANCE(2); +static nrfx_uarte_t uarte = NRFX_UARTE_INSTANCE(2); static bool spim_initialized; static bool uarte_initialized; static volatile size_t received; static K_SEM_DEFINE(transfer_finished, 0, 1); -void nrfx_prs_box_2_irq_handler(void); static enum { PERFORM_TRANSFER, @@ -112,7 +111,7 @@ static bool init_buttons(void) return true; } -static void spim_handler(const nrfx_spim_event_t *p_event, void *p_context) +static void spim_handler(const nrfx_spim_evt_t *p_event, void *p_context) { if (p_event->type == NRFX_SPIM_EVENT_DONE) { k_sem_give(&transfer_finished); @@ -122,6 +121,7 @@ static void spim_handler(const nrfx_spim_event_t *p_event, void *p_context) static bool switch_to_spim(void) { int ret; + nrfx_err_t err; uint32_t sck_pin; PINCTRL_DT_DEFINE(SPIM_NODE); @@ -162,9 +162,9 @@ static bool switch_to_spim(void) nrfy_gpio_pin_write(sck_pin, (spim_config.mode <= NRF_SPIM_MODE_1) ? 0 : 1); } - ret = nrfx_spim_init(&spim, &spim_config, spim_handler, NULL); - if (ret != 0) { - printk("nrfx_spim_init() failed: %d", ret); + err = nrfx_spim_init(&spim, &spim_config, spim_handler, NULL); + if (err != NRFX_SUCCESS) { + printk("nrfx_spim_init() failed: 0x%08x\n", err); return false; } @@ -176,7 +176,7 @@ static bool switch_to_spim(void) static bool spim_transfer(const uint8_t *tx_data, size_t tx_data_len, uint8_t *rx_buf, size_t rx_buf_size) { - int err; + nrfx_err_t err; nrfx_spim_xfer_desc_t xfer_desc = { .p_tx_buffer = tx_data, .tx_length = tx_data_len, @@ -185,8 +185,8 @@ static bool spim_transfer(const uint8_t *tx_data, size_t tx_data_len, }; err = nrfx_spim_xfer(&spim, &xfer_desc, 0); - if (err != 0) { - printk("nrfx_spim_xfer() failed: %d\n", err); + if (err != NRFX_SUCCESS) { + printk("nrfx_spim_xfer() failed: 0x%08x\n", err); return false; } @@ -213,6 +213,7 @@ static void uarte_handler(const nrfx_uarte_event_t *p_event, void *p_context) static bool switch_to_uarte(void) { int ret; + nrfx_err_t err; PINCTRL_DT_DEFINE(UARTE_NODE); @@ -243,9 +244,9 @@ static bool switch_to_uarte(void) return ret; } - ret = nrfx_uarte_init(&uarte, &uarte_config, uarte_handler); - if (ret != 0) { - printk("nrfx_uarte_init() failed: %d\n", ret); + err = nrfx_uarte_init(&uarte, &uarte_config, uarte_handler); + if (err != NRFX_SUCCESS) { + printk("nrfx_uarte_init() failed: 0x%08x\n", err); return false; } @@ -257,23 +258,23 @@ static bool switch_to_uarte(void) static bool uarte_transfer(const uint8_t *tx_data, size_t tx_data_len, uint8_t *rx_buf, size_t rx_buf_size) { - int err; + nrfx_err_t err; err = nrfx_uarte_rx_buffer_set(&uarte, rx_buf, rx_buf_size); - if (err != 0) { - printk("nrfx_uarte_rx_buffer_set() failed: %d\n", err); + if (err != NRFX_SUCCESS) { + printk("nrfx_uarte_rx_buffer_set() failed: 0x%08x\n", err); return false; } err = nrfx_uarte_rx_enable(&uarte, NRFX_UARTE_RX_ENABLE_STOP_ON_END); - if (err != 0) { - printk("nrfx_uarte_rx_enable() failed: %d\n", err); + if (err != NRFX_SUCCESS) { + printk("nrfx_uarte_rx_enable() failed: 0x%08x\n", err); return false; } err = nrfx_uarte_tx(&uarte, tx_data, tx_data_len, 0); - if (err != 0) { - printk("nrfx_uarte_tx() failed: %d\n", err); + if (err != NRFX_SUCCESS) { + printk("nrfx_uarte_tx() failed: 0x%08x\n", err); return false; } diff --git a/samples/drivers/led/led_strip/boards/nrf52dk_nrf52832.conf b/samples/drivers/led/led_strip/boards/nrf52dk_nrf52832.conf new file mode 100644 index 000000000000..b20eefa4deab --- /dev/null +++ b/samples/drivers/led/led_strip/boards/nrf52dk_nrf52832.conf @@ -0,0 +1,3 @@ +# This driver only uses spi_write() with the SPIM instance it allocates, +# so PAN 58 doesn't matter, because the RX length is always 0. +CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58=y diff --git a/samples/net/zperf/src/nrf5340_cpu_boost.c b/samples/net/zperf/src/nrf5340_cpu_boost.c index f1704ebbf818..0eff58c32e37 100644 --- a/samples/net/zperf/src/nrf5340_cpu_boost.c +++ b/samples/net/zperf/src/nrf5340_cpu_boost.c @@ -22,6 +22,7 @@ static int nrf53_cpu_boost(void) /* For optimal performance, the CPU frequency should be set to 128 MHz */ err = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); + err -= NRFX_ERROR_BASE_NUM; if (err != 0) { LOG_WRN("Failed to set 128 MHz: %d", err); } diff --git a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf index 4c7c060177e0..ce67033381a6 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1,2 +1,2 @@ #Enable timer for asynchronous feedback -CONFIG_NRFX_TIMER=y +CONFIG_NRFX_TIMER2=y diff --git a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index ce07cde36568..d7526fc6ec9a 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,4 +1,4 @@ # Enable timer for asynchronous feedback CONFIG_NRFX_GPPI=y -CONFIG_NRFX_TIMER=y +CONFIG_NRFX_TIMER131=y CONFIG_NRFX_GPIOTE130=y diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c index 711dd570d4de..6b7ed239b268 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c @@ -8,8 +8,8 @@ #include #include "feedback.h" +#include #include -#include #include #include #include @@ -60,10 +60,11 @@ static inline void feedback_target_init(void) #error "Unsupported target" #endif -#define FEEDBACK_GPIOTE_NODE DT_NODELABEL(UTIL_CAT(gpiote, FEEDBACK_GPIOTE_INSTANCE_NUMBER)) +static const nrfx_gpiote_t gpiote = + NRFX_GPIOTE_INSTANCE(FEEDBACK_GPIOTE_INSTANCE_NUMBER); -static nrfx_timer_t feedback_timer_instance = - NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(FEEDBACK_TIMER_INSTANCE_NUMBER)); +static const nrfx_timer_t feedback_timer_instance = + NRFX_TIMER_INSTANCE(FEEDBACK_TIMER_INSTANCE_NUMBER); /* See 5.12.4.2 Feedback in Universal Serial Bus Specification Revision 2.0 for * more information about the feedback. There is a direct implementation of the @@ -117,11 +118,11 @@ static struct feedback_ctx { }; } fb_ctx; -static int feedback_edge_counter_setup(void) +static nrfx_err_t feedback_edge_counter_setup(void) { + nrfx_err_t err; uint8_t feedback_gpiote_channel; - nrfx_gppi_handle_t feedback_gppi_handle; - nrfx_gpiote_t *gpiote = &GPIOTE_NRFX_INST_BY_NODE(FEEDBACK_GPIOTE_NODE); + uint8_t feedback_gppi_channel; nrfx_gpiote_trigger_config_t trigger_config = { .trigger = NRFX_GPIOTE_TRIGGER_TOGGLE, .p_in_channel = &feedback_gpiote_channel, @@ -131,17 +132,14 @@ static int feedback_edge_counter_setup(void) .p_pull_config = &pull, .p_trigger_config = &trigger_config, }; - int err; - uint32_t eep = nrfx_gpiote_in_event_address_get(gpiote, FEEDBACK_PIN); - uint32_t tep = nrfx_timer_task_address_get(&feedback_timer_instance, NRF_TIMER_TASK_COUNT); - err = nrfx_gpiote_channel_alloc(gpiote, &feedback_gpiote_channel); - if (err != 0) { + err = nrfx_gpiote_channel_alloc(&gpiote, &feedback_gpiote_channel); + if (err != NRFX_SUCCESS) { return err; } - nrfx_gpiote_input_configure(gpiote, FEEDBACK_PIN, &input_pin_config); - nrfx_gpiote_trigger_enable(gpiote, FEEDBACK_PIN, false); + nrfx_gpiote_input_configure(&gpiote, FEEDBACK_PIN, &input_pin_config); + nrfx_gpiote_trigger_enable(&gpiote, FEEDBACK_PIN, false); /* Configure TIMER in COUNTER mode */ const nrfx_timer_config_t cfg = { @@ -153,26 +151,30 @@ static int feedback_edge_counter_setup(void) }; err = nrfx_timer_init(&feedback_timer_instance, &cfg, NULL); - if (err != 0) { + if (err != NRFX_SUCCESS) { LOG_ERR("nrfx timer init error (sample clk feedback) - Return value: %d", err); return err; } /* Subscribe TIMER COUNT task to GPIOTE IN event */ - err = nrfx_gppi_conn_alloc(eep, tep, &feedback_gppi_handle); - if (err < 0) { - LOG_ERR("gppi_conn_alloc failed with: %d\n", err); + err = nrfx_gppi_channel_alloc(&feedback_gppi_channel); + if (err != NRFX_SUCCESS) { + LOG_ERR("gppi_channel_alloc failed with: %d\n", err); return err; } - nrfx_gppi_conn_enable(feedback_gppi_handle); + nrfx_gppi_channel_endpoints_setup(feedback_gppi_channel, + nrfx_gpiote_in_event_address_get(&gpiote, FEEDBACK_PIN), + nrfx_timer_task_address_get(&feedback_timer_instance, NRF_TIMER_TASK_COUNT)); - return 0; + nrfx_gppi_channels_enable(BIT(feedback_gppi_channel)); + + return NRFX_SUCCESS; } -static int feedback_relative_timer_setup(void) +static nrfx_err_t feedback_relative_timer_setup(void) { - int err; + nrfx_err_t err; const nrfx_timer_config_t cfg = { .frequency = NRFX_MHZ_TO_HZ(16UL), .mode = NRF_TIMER_MODE_TIMER, @@ -182,7 +184,7 @@ static int feedback_relative_timer_setup(void) }; err = nrfx_timer_init(&feedback_timer_instance, &cfg, NULL); - if (err != 0) { + if (err != NRFX_SUCCESS) { LOG_ERR("nrfx timer init error (relative timer) - Return value: %d", err); } @@ -191,13 +193,9 @@ static int feedback_relative_timer_setup(void) struct feedback_ctx *feedback_init(void) { - nrfx_gppi_handle_t usbd_sof_gppi_handle; - nrfx_gppi_handle_t i2s_framestart_gppi_handle; - int err; - uint32_t tsk1 = nrfx_timer_capture_task_address_get(&feedback_timer_instance, - FEEDBACK_TIMER_USBD_SOF_CAPTURE); - uint32_t tsk2 = nrfx_timer_capture_task_address_get(&feedback_timer_instance, - FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE); + nrfx_err_t err; + uint8_t usbd_sof_gppi_channel; + uint8_t i2s_framestart_gppi_channel; feedback_target_init(); @@ -209,31 +207,40 @@ struct feedback_ctx *feedback_init(void) err = feedback_relative_timer_setup(); } - if (err != 0) { + if (err != NRFX_SUCCESS) { return &fb_ctx; } /* Subscribe TIMER CAPTURE task to USBD SOF event */ - err = nrfx_gppi_conn_alloc(USB_SOF_EVENT_ADDRESS, tsk1, &usbd_sof_gppi_handle); - if (err < 0) { - LOG_ERR("gppi_conn_alloc failed with: %d\n", err); + err = nrfx_gppi_channel_alloc(&usbd_sof_gppi_channel); + if (err != NRFX_SUCCESS) { + LOG_ERR("gppi_channel_alloc failed with: %d\n", err); return &fb_ctx; } - nrfx_gppi_ep_attach(nrfx_timer_task_address_get(&feedback_timer_instance, - NRF_TIMER_TASK_CLEAR), - usbd_sof_gppi_handle); + nrfx_gppi_channel_endpoints_setup(usbd_sof_gppi_channel, + USB_SOF_EVENT_ADDRESS, + nrfx_timer_capture_task_address_get(&feedback_timer_instance, + FEEDBACK_TIMER_USBD_SOF_CAPTURE)); + nrfx_gppi_fork_endpoint_setup(usbd_sof_gppi_channel, + nrfx_timer_task_address_get(&feedback_timer_instance, + NRF_TIMER_TASK_CLEAR)); - nrfx_gppi_conn_enable(usbd_sof_gppi_handle); + nrfx_gppi_channels_enable(BIT(usbd_sof_gppi_channel)); /* Subscribe TIMER CAPTURE task to I2S FRAMESTART event */ - err = nrfx_gppi_conn_alloc(I2S_FRAMESTART_EVENT_ADDRESS, tsk2, &i2s_framestart_gppi_handle); - if (err < 0) { - LOG_ERR("gppi_conn_alloc failed with: %d\n", err); + err = nrfx_gppi_channel_alloc(&i2s_framestart_gppi_channel); + if (err != NRFX_SUCCESS) { + LOG_ERR("gppi_channel_alloc failed with: %d\n", err); return &fb_ctx; } - nrfx_gppi_conn_enable(i2s_framestart_gppi_handle); + nrfx_gppi_channel_endpoints_setup(i2s_framestart_gppi_channel, + I2S_FRAMESTART_EVENT_ADDRESS, + nrfx_timer_capture_task_address_get(&feedback_timer_instance, + FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE)); + + nrfx_gppi_channels_enable(BIT(i2s_framestart_gppi_channel)); /* Enable feedback timer */ nrfx_timer_enable(&feedback_timer_instance); diff --git a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf index 4c7c060177e0..ce67033381a6 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1,2 +1,2 @@ #Enable timer for asynchronous feedback -CONFIG_NRFX_TIMER=y +CONFIG_NRFX_TIMER2=y diff --git a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 3f9d5d61d283..c4e23e5d54fe 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,3 +1,3 @@ # Enable timer for asynchronous feedback CONFIG_NRFX_GPPI=y -CONFIG_NRFX_TIMER=y +CONFIG_NRFX_TIMER131=y diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c index c1c72dc07c41..9623f22e5662 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c @@ -7,6 +7,8 @@ #include #include #include "feedback.h" + +#include #include #include @@ -49,8 +51,8 @@ static inline void feedback_target_init(void) #error "Unsupported target" #endif -static nrfx_timer_t feedback_timer_instance = - NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(FEEDBACK_TIMER_INSTANCE_NUMBER)); +static const nrfx_timer_t feedback_timer_instance = + NRFX_TIMER_INSTANCE(FEEDBACK_TIMER_INSTANCE_NUMBER); /* While it might be possible to determine I2S FRAMESTART to USB SOF offset * entirely in software, the I2S API lacks appropriate timestamping. Therefore @@ -76,9 +78,9 @@ static struct feedback_ctx { struct feedback_ctx *feedback_init(void) { - int err; - nrfx_gppi_handle_t usbd_sof_gppi_handle; - nrfx_gppi_handle_t i2s_framestart_gppi_handle; + nrfx_err_t err; + uint8_t usbd_sof_gppi_channel; + uint8_t i2s_framestart_gppi_channel; const nrfx_timer_config_t cfg = { .frequency = NRFX_MHZ_TO_HZ(16UL), .mode = NRF_TIMER_MODE_TIMER, @@ -86,40 +88,47 @@ struct feedback_ctx *feedback_init(void) .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, .p_context = NULL, }; - uint32_t tsk1 = nrfx_timer_capture_task_address_get(&feedback_timer_instance, - FEEDBACK_TIMER_USBD_SOF_CAPTURE); - uint32_t tsk2 = nrfx_timer_task_address_get(&feedback_timer_instance, NRF_TIMER_TASK_CLEAR); - uint32_t tsk3 = nrfx_timer_capture_task_address_get(&feedback_timer_instance, - FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE); feedback_target_init(); feedback_reset_ctx(&fb_ctx); err = nrfx_timer_init(&feedback_timer_instance, &cfg, NULL); - if (err != 0) { + if (err != NRFX_SUCCESS) { LOG_ERR("nrfx timer init error - Return value: %d", err); return &fb_ctx; } /* Subscribe TIMER CAPTURE task to USBD SOF event */ - err = nrfx_gppi_conn_alloc(USB_SOF_EVENT_ADDRESS, tsk1, &usbd_sof_gppi_handle); - if (err < 0) { + err = nrfx_gppi_channel_alloc(&usbd_sof_gppi_channel); + if (err != NRFX_SUCCESS) { LOG_ERR("gppi_channel_alloc failed with: %d\n", err); return &fb_ctx; } - nrfx_gppi_ep_attach(tsk2, usbd_sof_gppi_handle); - nrfx_gppi_conn_enable(usbd_sof_gppi_handle); + nrfx_gppi_channel_endpoints_setup(usbd_sof_gppi_channel, + USB_SOF_EVENT_ADDRESS, + nrfx_timer_capture_task_address_get(&feedback_timer_instance, + FEEDBACK_TIMER_USBD_SOF_CAPTURE)); + nrfx_gppi_fork_endpoint_setup(usbd_sof_gppi_channel, + nrfx_timer_task_address_get(&feedback_timer_instance, + NRF_TIMER_TASK_CLEAR)); + + nrfx_gppi_channels_enable(BIT(usbd_sof_gppi_channel)); /* Subscribe TIMER CAPTURE task to I2S FRAMESTART event */ - err = nrfx_gppi_conn_alloc(I2S_FRAMESTART_EVENT_ADDRESS, tsk3, &i2s_framestart_gppi_handle); - if (err < 0) { - LOG_ERR("gppi_conn_alloc failed with: %d\n", err); + err = nrfx_gppi_channel_alloc(&i2s_framestart_gppi_channel); + if (err != NRFX_SUCCESS) { + LOG_ERR("gppi_channel_alloc failed with: %d\n", err); return &fb_ctx; } - nrfx_gppi_conn_enable(i2s_framestart_gppi_handle); + nrfx_gppi_channel_endpoints_setup(i2s_framestart_gppi_channel, + I2S_FRAMESTART_EVENT_ADDRESS, + nrfx_timer_capture_task_address_get(&feedback_timer_instance, + FEEDBACK_TIMER_I2S_FRAMESTART_CAPTURE)); + + nrfx_gppi_channels_enable(BIT(i2s_framestart_gppi_channel)); /* Enable feedback timer */ nrfx_timer_enable(&feedback_timer_instance); diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index e3208e976942..912dbdad48e3 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1403,7 +1403,6 @@ def check_no_undef_outside_kconfig(self, kconf): "SHIFT", "SINGLE_APPLICATION_SLOT", # Used in sysbuild for MCUboot configuration "SINGLE_APPLICATION_SLOT_RAM_LOAD", # Used in sysbuild for MCUboot configuration - "SOC_NORDIC_BSP_PATH_OVERRIDE", # Used in modules/hal_nordic/nrfx/CMakeLists.txt "SOC_SDKNG_UNSUPPORTED", # Used in modules/hal_nxp/mcux/CMakeLists.txt "SOC_SERIES_", # Used as regex in scripts/utils/board_v1_to_v2.py "SOC_WATCH", # Issue 13749 diff --git a/soc/nordic/CMakeLists.txt b/soc/nordic/CMakeLists.txt index f32466d38ee5..0c9e9184d6dc 100644 --- a/soc/nordic/CMakeLists.txt +++ b/soc/nordic/CMakeLists.txt @@ -45,9 +45,6 @@ if(CONFIG_BUILD_WITH_TFM) ) endif() -if(CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable") - add_subdirectory(${SOC_SERIES}) -endif() - +add_subdirectory(${SOC_SERIES}) add_subdirectory(common) add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE ironside) diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index df4bba2e1ce1..46efc8c2c744 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -48,14 +48,6 @@ config SOC_FAMILY_NORDIC_NRF select SOC_RESET_HOOK select CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK if ARM -if SOC_COMPATIBLE_NRF - -config SOC_NORDIC_BSP_NAME - string - default "stable" - -endif # SOC_COMPATIBLE_NRF - if SOC_FAMILY_NORDIC_NRF rsource "common/Kconfig.peripherals" diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index 1b1c3760c9ae..04f0c1a3219c 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -31,10 +31,6 @@ if(CONFIG_HAS_NORDIC_DMM) zephyr_library_sources(dmm.c) endif() -if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) - zephyr_library_sources(gppi_init.c) -endif() - if(CONFIG_TFM_PARTITION_PLATFORM) zephyr_library_sources(soc_secure.c) zephyr_library_include_directories( @@ -44,4 +40,3 @@ endif() zephyr_library_sources_ifdef(CONFIG_NRF_SYS_EVENT nrf_sys_event.c) zephyr_library_sources_ifdef(CONFIG_MRAM_LATENCY mram_latency.c) -zephyr_library_sources(gpiote_nrfx.c) diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index f15702fa291b..fa7fd2a411aa 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -98,6 +98,12 @@ config HAS_HW_NRF_GPIOTE131 config HAS_HW_NRF_GRTC def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GRTC)) +config HAS_HW_NRF_I2S0 + def_bool $(dt_nodelabel_enabled_with_compat,i2s0,$(DT_COMPAT_NORDIC_NRF_I2S)) + +config HAS_HW_NRF_I2S20 + def_bool $(dt_nodelabel_enabled_with_compat,i2s20,$(DT_COMPAT_NORDIC_NRF_I2S)) + config HAS_HW_NRF_KMU def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_KMU)) @@ -123,12 +129,75 @@ config HAS_HW_NRF_NVMC_PE config HAS_HW_NRF_OSCILLATORS def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_OSCILLATORS)) +config HAS_HW_NRF_PDM0 + def_bool $(dt_nodelabel_enabled_with_compat,pdm0,$(DT_COMPAT_NORDIC_NRF_PDM)) + +config HAS_HW_NRF_PDM20 + def_bool $(dt_nodelabel_enabled_with_compat,pdm20,$(DT_COMPAT_NORDIC_NRF_PDM)) + +config HAS_HW_NRF_PDM21 + def_bool $(dt_nodelabel_enabled_with_compat,pdm21,$(DT_COMPAT_NORDIC_NRF_PDM)) + config HAS_HW_NRF_POWER def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_POWER)) config HAS_HW_NRF_PPI def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_PPI)) +config HAS_HW_NRF_PWM0 + def_bool $(dt_nodelabel_enabled_with_compat,pwm0,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM1 + def_bool $(dt_nodelabel_enabled_with_compat,pwm1,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM2 + def_bool $(dt_nodelabel_enabled_with_compat,pwm2,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM3 + def_bool $(dt_nodelabel_enabled_with_compat,pwm3,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM20 + def_bool $(dt_nodelabel_enabled_with_compat,pwm20,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM21 + def_bool $(dt_nodelabel_enabled_with_compat,pwm21,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM22 + def_bool $(dt_nodelabel_enabled_with_compat,pwm22,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM120 + def_bool $(dt_nodelabel_enabled_with_compat,pwm120,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM130 + def_bool $(dt_nodelabel_enabled_with_compat,pwm130,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM131 + def_bool $(dt_nodelabel_enabled_with_compat,pwm131,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM132 + def_bool $(dt_nodelabel_enabled_with_compat,pwm132,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_PWM133 + def_bool $(dt_nodelabel_enabled_with_compat,pwm133,$(DT_COMPAT_NORDIC_NRF_PWM)) + +config HAS_HW_NRF_QDEC0 + def_bool $(dt_nodelabel_enabled_with_compat,qdec0,$(DT_COMPAT_NORDIC_NRF_QDEC)) + +config HAS_HW_NRF_QDEC1 + def_bool $(dt_nodelabel_enabled_with_compat,qdec1,$(DT_COMPAT_NORDIC_NRF_QDEC)) + +config HAS_HW_NRF_QDEC20 + def_bool $(dt_nodelabel_enabled_with_compat,qdec20,$(DT_COMPAT_NORDIC_NRF_QDEC)) + +config HAS_HW_NRF_QDEC21 + def_bool $(dt_nodelabel_enabled_with_compat,qdec21,$(DT_COMPAT_NORDIC_NRF_QDEC)) + +config HAS_HW_NRF_QDEC130 + def_bool $(dt_nodelabel_enabled_with_compat,qdec130,$(DT_COMPAT_NORDIC_NRF_QDEC)) + +config HAS_HW_NRF_QDEC131 + def_bool $(dt_nodelabel_enabled_with_compat,qdec131,$(DT_COMPAT_NORDIC_NRF_QDEC)) + config HAS_HW_NRF_QSPI def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_QSPI)) @@ -186,6 +255,138 @@ config HAS_HW_NRF_SPI1 config HAS_HW_NRF_SPI2 def_bool $(dt_nodelabel_enabled_with_compat,spi2,$(DT_COMPAT_NORDIC_NRF_SPI)) +config HAS_HW_NRF_SPIM0 + def_bool $(dt_nodelabel_enabled_with_compat,spi0,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM1 + def_bool $(dt_nodelabel_enabled_with_compat,spi1,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM2 + def_bool $(dt_nodelabel_enabled_with_compat,spi2,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM3 + def_bool $(dt_nodelabel_enabled_with_compat,spi3,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM4 + def_bool $(dt_nodelabel_enabled_with_compat,spi4,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM00 + def_bool $(dt_nodelabel_enabled_with_compat,spi00,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM01 + def_bool $(dt_nodelabel_enabled_with_compat,spi01,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM20 + def_bool $(dt_nodelabel_enabled_with_compat,spi20,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM21 + def_bool $(dt_nodelabel_enabled_with_compat,spi21,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM22 + def_bool $(dt_nodelabel_enabled_with_compat,spi22,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM23 + def_bool $(dt_nodelabel_enabled_with_compat,spi23,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM24 + def_bool $(dt_nodelabel_enabled_with_compat,spi24,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM30 + def_bool $(dt_nodelabel_enabled_with_compat,spi30,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM120 + def_bool $(dt_nodelabel_enabled_with_compat,spi120,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM121 + def_bool $(dt_nodelabel_enabled_with_compat,spi121,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM130 + def_bool $(dt_nodelabel_enabled_with_compat,spi130,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM131 + def_bool $(dt_nodelabel_enabled_with_compat,spi131,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM132 + def_bool $(dt_nodelabel_enabled_with_compat,spi132,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM133 + def_bool $(dt_nodelabel_enabled_with_compat,spi133,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM134 + def_bool $(dt_nodelabel_enabled_with_compat,spi134,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM135 + def_bool $(dt_nodelabel_enabled_with_compat,spi135,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM136 + def_bool $(dt_nodelabel_enabled_with_compat,spi136,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIM137 + def_bool $(dt_nodelabel_enabled_with_compat,spi137,$(DT_COMPAT_NORDIC_NRF_SPIM)) + +config HAS_HW_NRF_SPIS0 + def_bool $(dt_nodelabel_enabled_with_compat,spi0,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS1 + def_bool $(dt_nodelabel_enabled_with_compat,spi1,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS2 + def_bool $(dt_nodelabel_enabled_with_compat,spi2,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS3 + def_bool $(dt_nodelabel_enabled_with_compat,spi3,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS00 + def_bool $(dt_nodelabel_enabled_with_compat,spi00,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS01 + def_bool $(dt_nodelabel_enabled_with_compat,spi01,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS20 + def_bool $(dt_nodelabel_enabled_with_compat,spi20,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS21 + def_bool $(dt_nodelabel_enabled_with_compat,spi21,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS22 + def_bool $(dt_nodelabel_enabled_with_compat,spi22,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS23 + def_bool $(dt_nodelabel_enabled_with_compat,spi23,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS24 + def_bool $(dt_nodelabel_enabled_with_compat,spi24,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS30 + def_bool $(dt_nodelabel_enabled_with_compat,spi30,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS120 + def_bool $(dt_nodelabel_enabled_with_compat,spis120,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS130 + def_bool $(dt_nodelabel_enabled_with_compat,spi130,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS131 + def_bool $(dt_nodelabel_enabled_with_compat,spi131,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS132 + def_bool $(dt_nodelabel_enabled_with_compat,spi132,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS133 + def_bool $(dt_nodelabel_enabled_with_compat,spi133,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS134 + def_bool $(dt_nodelabel_enabled_with_compat,spi134,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS135 + def_bool $(dt_nodelabel_enabled_with_compat,spi135,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS136 + def_bool $(dt_nodelabel_enabled_with_compat,spi136,$(DT_COMPAT_NORDIC_NRF_SPIS)) + +config HAS_HW_NRF_SPIS137 + def_bool $(dt_nodelabel_enabled_with_compat,spi137,$(DT_COMPAT_NORDIC_NRF_SPIS)) + config HAS_HW_NRF_SPU def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_SPU)) @@ -300,6 +501,117 @@ config HAS_HW_NRF_TWI0 config HAS_HW_NRF_TWI1 def_bool $(dt_nodelabel_enabled_with_compat,i2c1,$(DT_COMPAT_NORDIC_NRF_TWI)) +config HAS_HW_NRF_TWIM0 + def_bool $(dt_nodelabel_enabled_with_compat,i2c0,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM1 + def_bool $(dt_nodelabel_enabled_with_compat,i2c1,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM2 + def_bool $(dt_nodelabel_enabled_with_compat,i2c2,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM3 + def_bool $(dt_nodelabel_enabled_with_compat,i2c3,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM20 + def_bool $(dt_nodelabel_enabled_with_compat,i2c20,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM21 + def_bool $(dt_nodelabel_enabled_with_compat,i2c21,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM22 + def_bool $(dt_nodelabel_enabled_with_compat,i2c22,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM23 + def_bool $(dt_nodelabel_enabled_with_compat,i2c23,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM24 + def_bool $(dt_nodelabel_enabled_with_compat,i2c24,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM30 + def_bool $(dt_nodelabel_enabled_with_compat,i2c30,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM120 + def_bool $(dt_nodelabel_enabled_with_compat,i2c120,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM130 + def_bool $(dt_nodelabel_enabled_with_compat,i2c130,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM131 + def_bool $(dt_nodelabel_enabled_with_compat,i2c131,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM132 + def_bool $(dt_nodelabel_enabled_with_compat,i2c132,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM133 + def_bool $(dt_nodelabel_enabled_with_compat,i2c133,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM134 + def_bool $(dt_nodelabel_enabled_with_compat,i2c134,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM135 + def_bool $(dt_nodelabel_enabled_with_compat,i2c135,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM136 + def_bool $(dt_nodelabel_enabled_with_compat,i2c136,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIM137 + def_bool $(dt_nodelabel_enabled_with_compat,i2c137,$(DT_COMPAT_NORDIC_NRF_TWIM)) + +config HAS_HW_NRF_TWIS0 + def_bool $(dt_nodelabel_enabled_with_compat,i2c0,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS1 + def_bool $(dt_nodelabel_enabled_with_compat,i2c1,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS2 + def_bool $(dt_nodelabel_enabled_with_compat,i2c2,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS3 + def_bool $(dt_nodelabel_enabled_with_compat,i2c3,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS20 + def_bool $(dt_nodelabel_enabled_with_compat,i2c20,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS21 + def_bool $(dt_nodelabel_enabled_with_compat,i2c21,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS22 + def_bool $(dt_nodelabel_enabled_with_compat,i2c22,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS23 + def_bool $(dt_nodelabel_enabled_with_compat,i2c23,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS24 + def_bool $(dt_nodelabel_enabled_with_compat,i2c24,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS30 + def_bool $(dt_nodelabel_enabled_with_compat,i2c30,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS130 + def_bool $(dt_nodelabel_enabled_with_compat,i2c130,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS131 + def_bool $(dt_nodelabel_enabled_with_compat,i2c131,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS132 + def_bool $(dt_nodelabel_enabled_with_compat,i2c132,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS133 + def_bool $(dt_nodelabel_enabled_with_compat,i2c133,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS134 + def_bool $(dt_nodelabel_enabled_with_compat,i2c134,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS135 + def_bool $(dt_nodelabel_enabled_with_compat,i2c135,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS136 + def_bool $(dt_nodelabel_enabled_with_compat,i2c136,$(DT_COMPAT_NORDIC_NRF_TWIS)) + +config HAS_HW_NRF_TWIS137 + def_bool $(dt_nodelabel_enabled_with_compat,i2c137,$(DT_COMPAT_NORDIC_NRF_TWIS)) + config HAS_HW_NRF_UART0 def_bool $(dt_nodelabel_enabled_with_compat,uart0,$(DT_COMPAT_NORDIC_NRF_UART)) @@ -371,3 +683,30 @@ config HAS_HW_NRF_USBREG config HAS_HW_NRF_VMC def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_VMC)) + +config HAS_HW_NRF_WDT0 + def_bool $(dt_nodelabel_enabled_with_compat,wdt0,$(DT_COMPAT_NORDIC_NRF_WDT)) + +config HAS_HW_NRF_WDT1 + def_bool $(dt_nodelabel_enabled_with_compat,wdt1,$(DT_COMPAT_NORDIC_NRF_WDT)) + +config HAS_HW_NRF_WDT30 + def_bool $(dt_nodelabel_enabled_with_compat,wdt30,$(DT_COMPAT_NORDIC_NRF_WDT)) + +config HAS_HW_NRF_WDT31 + def_bool $(dt_nodelabel_enabled_with_compat,wdt31,$(DT_COMPAT_NORDIC_NRF_WDT)) + +config HAS_HW_NRF_WDT010 + def_bool $(dt_nodelabel_enabled_with_compat,wdt010,$(DT_COMPAT_NORDIC_NRF_WDT)) + +config HAS_HW_NRF_WDT011 + def_bool $(dt_nodelabel_enabled_with_compat,wdt011,$(DT_COMPAT_NORDIC_NRF_WDT)) + +config HAS_HW_NRF_WDT130 + def_bool $(dt_nodelabel_enabled_with_compat,wdt130,$(DT_COMPAT_NORDIC_NRF_WDT)) + +config HAS_HW_NRF_WDT131 + def_bool $(dt_nodelabel_enabled_with_compat,wdt131,$(DT_COMPAT_NORDIC_NRF_WDT)) + +config HAS_HW_NRF_WDT132 + def_bool $(dt_nodelabel_enabled_with_compat,wdt132,$(DT_COMPAT_NORDIC_NRF_WDT)) diff --git a/soc/nordic/common/gpiote_nrfx.c b/soc/nordic/common/gpiote_nrfx.c deleted file mode 100644 index c7ba20f4fa81..000000000000 --- a/soc/nordic/common/gpiote_nrfx.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Keep peripheral addresses as in real HW so we can compare them with DT values */ -#define NRF_H_NO_BSIM_REDEFS - -#include -#include -#include "gpiote_nrfx.h" - -#define GPIOTE_NRFX_INST_DEF(instname, reg) \ - nrfx_gpiote_t instname = NRFX_GPIOTE_INSTANCE(reg); -#define GPIOTE_NRFX_INST_DEFINE(node_id) \ - GPIOTE_NRFX_INST_DEF(GPIOTE_NRFX_INST_BY_NODE(node_id), DT_REG_ADDR(node_id)) - -DT_FOREACH_STATUS_OKAY(nordic_nrf_gpiote, GPIOTE_NRFX_INST_DEFINE) diff --git a/soc/nordic/common/gpiote_nrfx.h b/soc/nordic/common/gpiote_nrfx.h deleted file mode 100644 index 3c01f37d714e..000000000000 --- a/soc/nordic/common/gpiote_nrfx.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SOC_NORDIC_COMMON_GPIOTE_NRFX_H_ -#define SOC_NORDIC_COMMON_GPIOTE_NRFX_H_ - -#include - -#define GPIOTE_NRFX_INST_BY_REG_CONCAT(reg) g_nrfx_gpiote##reg -#define GPIOTE_NRFX_INST_BY_REG(reg) GPIOTE_NRFX_INST_BY_REG_CONCAT(reg) -#define GPIOTE_NRFX_INST_BY_NODE(node) GPIOTE_NRFX_INST_BY_REG(DT_REG_ADDR(node)) - -#define GPIOTE_NRFX_INST_DECL(instname) \ - extern nrfx_gpiote_t instname; -#define GPIOTE_NRFX_INST_DECLARE(node_id) \ - GPIOTE_NRFX_INST_DECL(GPIOTE_NRFX_INST_BY_NODE(node_id)) - -DT_FOREACH_STATUS_OKAY(nordic_nrf_gpiote, GPIOTE_NRFX_INST_DECLARE) - -#endif /* SOC_NORDIC_COMMON_GPIOTE_NRFX_H_ */ diff --git a/soc/nordic/common/gppi_init.c b/soc/nordic/common/gppi_init.c deleted file mode 100644 index 98915491041b..000000000000 --- a/soc/nordic/common/gppi_init.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include -#if defined(NRFX_GPPI_MULTI_DOMAIN) && !defined(NRFX_GPPI_FIXED_CONNECTIONS) -#include -#endif - -static int gppi_init(void) -{ - static nrfx_gppi_t gppi_instance; - -#if defined(PPI_PRESENT) - gppi_instance.ch_mask = BIT_MASK(PPI_CH_NUM) & ~NRFX_PPI_CHANNELS_USED; - gppi_instance.group_mask = BIT_MASK(PPI_GROUP_NUM) & ~NRFX_PPI_GROUPS_USED; -#elif defined(DPPIC_PRESENT) && !defined(NRFX_GPPI_MULTI_DOMAIN) - uint32_t ch_mask = (DPPIC_CH_NUM == 32) ? UINT32_MAX : BIT_MASK(DPPIC_CH_NUM); - - gppi_instance.ch_mask = ch_mask & ~NRFX_DPPI_CHANNELS_USED; - gppi_instance.group_mask = BIT_MASK(DPPIC_GROUP_NUM) & ~NRFX_DPPI_GROUPS_USED; -#elif defined(NRFX_GPPI_MULTI_DOMAIN) && !defined(NRFX_GPPI_FIXED_CONNECTIONS) - gppi_instance.routes = nrfx_gppi_routes_get(); - gppi_instance.route_map = nrfx_gppi_route_map_get(); - gppi_instance.nodes = nrfx_gppi_nodes_get(); - - nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC00, - NRFX_BIT_MASK(DPPIC00_CH_NUM_SIZE) & ~NRFX_DPPI00_CHANNELS_USED); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC10, - NRFX_BIT_MASK(DPPIC10_CH_NUM_SIZE) & ~NRFX_DPPI10_CHANNELS_USED); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC20, - NRFX_BIT_MASK(DPPIC20_CH_NUM_SIZE) & ~NRFX_DPPI20_CHANNELS_USED); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC30, - NRFX_BIT_MASK(DPPIC30_CH_NUM_SIZE) & ~NRFX_DPPI30_CHANNELS_USED); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB00_10, NRFX_BIT_MASK(PPIB10_NTASKSEVENTS_SIZE)); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB11_21, NRFX_BIT_MASK(PPIB11_NTASKSEVENTS_SIZE)); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB01_20, NRFX_BIT_MASK(PPIB01_NTASKSEVENTS_SIZE)); - nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB22_30, NRFX_BIT_MASK(PPIB22_NTASKSEVENTS_SIZE)); - - nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC00, - NRFX_BIT_MASK(DPPIC00_GROUP_NUM_SIZE) & ~NRFX_DPPI00_GROUPS_USED); - nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC10, - NRFX_BIT_MASK(DPPIC10_GROUP_NUM_SIZE) & ~NRFX_DPPI10_GROUPS_USED); - nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC20, - NRFX_BIT_MASK(DPPIC20_GROUP_NUM_SIZE) & ~NRFX_DPPI20_GROUPS_USED); - nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC30, - NRFX_BIT_MASK(DPPIC30_GROUP_NUM_SIZE) & ~NRFX_DPPI30_GROUPS_USED); -#else -#error "Not supported" -#endif - nrfx_gppi_init(&gppi_instance); - return 0; -} - -#if defined(CONFIG_NRFX_GPPI) && !defined(CONFIG_NRFX_GPPI_V1) -SYS_INIT(gppi_init, PRE_KERNEL_1, 0); -#endif diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 76664fe5f245..47c02eadb961 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -76,12 +76,20 @@ int nrf_sys_event_release_global_constlat(void) int nrf_sys_event_request_global_constlat(void) { - return nrfx_power_constlat_mode_request(); + nrfx_err_t err; + + err = nrfx_power_constlat_mode_request(); + + return (err == NRFX_SUCCESS || err == NRFX_ERROR_ALREADY) ? 0 : -EAGAIN; } int nrf_sys_event_release_global_constlat(void) { - return nrfx_power_constlat_mode_free(); + nrfx_err_t err; + + err = nrfx_power_constlat_mode_free(); + + return (err == NRFX_SUCCESS || err == NRFX_ERROR_BUSY) ? 0 : -EAGAIN; } #endif diff --git a/soc/nordic/common/soc_nrf_common.h b/soc/nordic/common/soc_nrf_common.h index c963b6512188..12ac373fd6eb 100644 --- a/soc/nordic/common/soc_nrf_common.h +++ b/soc/nordic/common/soc_nrf_common.h @@ -149,18 +149,6 @@ (NRF_DT_GPIOS_TO_PSEL(node_id, prop)), \ (default_value)) -/** - * @brief Convert a devicetree GPIO phandle+specifier to GPIOTE node. - */ -#define NRF_DT_GPIOTE_NODE_BY_IDX(node_id, prop, idx) \ - DT_PHANDLE(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx), gpiote_instance) - -/** - * @brief Equivalent to NRF_DT_GPIOTE_NODE_BY_IDX(node_id, prop, 0) - */ -#define NRF_DT_GPIOTE_NODE(node_id, prop) \ - NRF_DT_GPIOTE_NODE_BY_IDX(node_id, prop, 0) - /** * @brief Convert a devicetree GPIO phandle+specifier to GPIOTE instance number. * @@ -197,7 +185,9 @@ * NRF_DT_GPIOTE_INST_BY_IDX(DT_NODELABEL(foo), rx_gpios, 1) // = 20 */ #define NRF_DT_GPIOTE_INST_BY_IDX(node_id, prop, idx) \ - DT_PROP(NRF_DT_GPIOTE_NODE_BY_IDX(node_id, prop, idx), instance) + DT_PROP(DT_PHANDLE(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx), \ + gpiote_instance), \ + instance) /** * @brief Equivalent to NRF_DT_GPIOTE_INST_BY_IDX(node_id, prop, 0) diff --git a/soc/nordic/common/soc_secure.c b/soc/nordic/common/soc_secure.c index 3bb8fa9e24ed..64d647f220a9 100644 --- a/soc/nordic/common/soc_secure.c +++ b/soc/nordic/common/soc_secure.c @@ -7,6 +7,8 @@ #include #include +#include "nrf.h" + #include "tfm_platform_api.h" #include "tfm_ioctl_api.h" diff --git a/soc/nordic/common/soc_secure.h b/soc/nordic/common/soc_secure.h index 84a673467b67..e4b34a9bf646 100644 --- a/soc/nordic/common/soc_secure.h +++ b/soc/nordic/common/soc_secure.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ #include -#include +#include #include #include diff --git a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h b/soc/nordic/ironside/include/nrf_ironside/cpuconf.h index a0fabd8abbd2..b112396704a5 100644 --- a/soc/nordic/ironside/include/nrf_ironside/cpuconf.h +++ b/soc/nordic/ironside/include/nrf_ironside/cpuconf.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include /** diff --git a/soc/nordic/nrf51/soc.c b/soc/nordic/nrf51/soc.c index 481d1045b2a6..af14f6f3003a 100644 --- a/soc/nordic/nrf51/soc.c +++ b/soc/nordic/nrf51/soc.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include #define LOG_LEVEL CONFIG_SOC_LOG_LEVEL diff --git a/soc/nordic/nrf52/CMakeLists.txt b/soc/nordic/nrf52/CMakeLists.txt index 49004f15a265..6b01a1ffc778 100644 --- a/soc/nordic/nrf52/CMakeLists.txt +++ b/soc/nordic/nrf52/CMakeLists.txt @@ -3,6 +3,10 @@ zephyr_library_sources(soc.c) zephyr_include_directories(.) +if(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 AND CONFIG_SPI_NRFX_SPIM) + message(WARNING "Both SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 and an NRF SPIM driver are enabled, therefore PAN 58 will apply if RXD.MAXCNT == 1 and TXD.MAXCNT <= 1") +endif() + if(CONFIG_SOC_NRF52832) if(NOT CONFIG_NRF52_ANOMALY_109_WORKAROUND) if (CONFIG_NRFX_SPIS OR CONFIG_NRFX_SPIM OR CONFIG_NRFX_TWIM OR CONFIG_NRFX_PWM) diff --git a/soc/nordic/nrf52/Kconfig b/soc/nordic/nrf52/Kconfig index ff29b6ac69de..65d613a59cd1 100644 --- a/soc/nordic/nrf52/Kconfig +++ b/soc/nordic/nrf52/Kconfig @@ -92,19 +92,11 @@ config NRF52_ANOMALY_132_DELAY_US Additional drivers initialization increases initialization time and delay may be shortened. Workaround is disabled by setting delay to 0. -config NRF52_ANOMALY_58_WORKAROUND - bool "Anomaly 58 workaround" - default y - depends on SOC_NRF52832 - depends on NRFX_SPIM - help - This anomaly causes SPIM to clock out 2 bytes when 1 byte transfer was requested. - config NRF52_ANOMALY_198_WORKAROUND bool "Anomaly 198 workaround" default y depends on SOC_NRF52840 - depends on $(dt_nodelabel_enabled_with_compat,spi3,$(DT_COMPAT_NORDIC_NRF_SPIM)) + depends on NRFX_SPIM3 help This anomaly applies to IC revisions "Engineering B" up to "3", the most recent one. diff --git a/soc/nordic/nrf52/soc.c b/soc/nordic/nrf52/soc.c index e34fcf6b083b..4bb3b8640e58 100644 --- a/soc/nordic/nrf52/soc.c +++ b/soc/nordic/nrf52/soc.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/soc/nordic/nrf53/soc.c b/soc/nordic/nrf53/soc.c index 58730f86d8c4..eb01872a71df 100644 --- a/soc/nordic/nrf53/soc.c +++ b/soc/nordic/nrf53/soc.c @@ -16,9 +16,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -390,8 +390,8 @@ bool z_arm_on_enter_cpu_idle(void) /* RTC pretick - application core part. */ static int rtc_pretick_cpuapp_init(void) { - nrfx_gppi_handle_t handle; - int err; + uint8_t ch; + nrfx_err_t err; nrf_ipc_event_t ipc_event = nrf_ipc_receive_event_get(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET); nrf_ipc_task_t ipc_task = @@ -399,16 +399,19 @@ static int rtc_pretick_cpuapp_init(void) uint32_t task_ipc = nrf_ipc_task_address_get(NRF_IPC, ipc_task); uint32_t evt_ipc = nrf_ipc_event_address_get(NRF_IPC, ipc_event); + err = nrfx_gppi_channel_alloc(&ch); + if (err != NRFX_SUCCESS) { + return -ENOMEM; + } + nrf_ipc_receive_config_set(NRF_IPC, CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET, BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET)); nrf_ipc_send_config_set(NRF_IPC, CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET, BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET)); - err = nrfx_gppi_conn_alloc(evt_ipc, task_ipc, &handle); - if (err < 0) { - return err; - } - nrfx_gppi_conn_enable(handle); + nrfx_gppi_task_endpoint_setup(ch, task_ipc); + nrfx_gppi_event_endpoint_setup(ch, evt_ipc); + nrfx_gppi_channels_enable(BIT(ch)); return 0; } @@ -426,7 +429,7 @@ void rtc_pretick_rtc1_isr_hook(void) static int rtc_pretick_cpunet_init(void) { - nrfx_gppi_handle_t ppi_handle; + uint8_t ppi_ch; nrf_ipc_task_t ipc_task = nrf_ipc_send_task_get(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET); nrf_ipc_event_t ipc_event = @@ -436,7 +439,6 @@ static int rtc_pretick_cpunet_init(void) uint32_t task_wdt = nrf_wdt_task_address_get(NRF_WDT, NRF_WDT_TASK_START); uint32_t evt_cc = nrf_rtc_event_address_get(NRF_RTC1, NRF_RTC_CHANNEL_EVENT_ADDR(RTC1_PRETICK_CC_CHAN)); - int err; /* Configure Watchdog to allow stopping. */ nrf_wdt_behaviour_set(NRF_WDT, WDT_CONFIG_STOPEN_Msk | BIT(4)); @@ -449,16 +451,17 @@ static int rtc_pretick_cpunet_init(void) BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET)); /* Allocate PPI channel for RTC Compare event publishers that starts WDT. */ - err = nrfx_gppi_domain_conn_alloc(0, 0, &ppi_handle); - if (err < 0) { - return err; + nrfx_err_t err = nrfx_gppi_channel_alloc(&ppi_ch); + + if (err != NRFX_SUCCESS) { + return -ENOMEM; } - nrfx_gppi_ep_attach(evt_cc, ppi_handle); - nrfx_gppi_ep_attach(task_ipc, ppi_handle); - nrfx_gppi_ep_attach(evt_ipc, ppi_handle); - nrfx_gppi_ep_attach(task_wdt, ppi_handle); - nrfx_gppi_conn_enable(ppi_handle); + nrfx_gppi_event_endpoint_setup(ppi_ch, evt_cc); + nrfx_gppi_task_endpoint_setup(ppi_ch, task_ipc); + nrfx_gppi_event_endpoint_setup(ppi_ch, evt_ipc); + nrfx_gppi_task_endpoint_setup(ppi_ch, task_wdt); + nrfx_gppi_channels_enable(BIT(ppi_ch)); nrf_rtc_event_enable(NRF_RTC1, NRF_RTC_CHANNEL_INT_MASK(RTC1_PRETICK_CC_CHAN)); nrf_rtc_event_clear(NRF_RTC1, NRF_RTC_CHANNEL_EVENT_ADDR(RTC1_PRETICK_CC_CHAN)); diff --git a/soc/nordic/nrf53/sync_rtc.c b/soc/nordic/nrf53/sync_rtc.c index 3f50964d8a5f..724453583b35 100644 --- a/soc/nordic/nrf53/sync_rtc.c +++ b/soc/nordic/nrf53/sync_rtc.c @@ -3,6 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include #include @@ -26,7 +27,7 @@ static int32_t nrf53_sync_offset = -EBUSY; union rtc_sync_channels { uint32_t raw; struct { - nrfx_gppi_handle_t ppi; + uint8_t ppi; uint8_t rtc; uint8_t ipc_out; uint8_t ipc_in; @@ -73,15 +74,14 @@ union rtc_sync_channels { static void ppi_ipc_to_rtc(union rtc_sync_channels channels, bool setup) { nrf_ipc_event_t ipc_evt = nrf_ipc_receive_event_get(channels.ch.ipc_in); - uint32_t eep = nrf_ipc_event_address_get(NRF_IPC, ipc_evt); - uint32_t tep = z_nrf_rtc_timer_capture_task_address_get(channels.ch.rtc); + uint32_t task_addr = z_nrf_rtc_timer_capture_task_address_get(channels.ch.rtc); if (setup) { - nrfx_gppi_ep_attach(eep, channels.ch.ppi); - nrfx_gppi_ep_attach(tep, channels.ch.ppi); + nrfx_gppi_task_endpoint_setup(channels.ch.ppi, task_addr); + nrf_ipc_publish_set(NRF_IPC, ipc_evt, channels.ch.ppi); } else { - nrfx_gppi_ep_clear(eep); - nrfx_gppi_ep_clear(tep); + nrfx_gppi_task_endpoint_clear(channels.ch.ppi, task_addr); + nrf_ipc_publish_clear(NRF_IPC, ipc_evt); } } @@ -92,25 +92,30 @@ static void ppi_ipc_to_rtc(union rtc_sync_channels channels, bool setup) */ static void ppi_rtc_to_ipc(union rtc_sync_channels channels, bool setup) { + uint32_t evt_addr = z_nrf_rtc_timer_compare_evt_address_get(channels.ch.rtc); nrf_ipc_task_t ipc_task = nrf_ipc_send_task_get(channels.ch.ipc_out); - uint32_t eep = z_nrf_rtc_timer_compare_evt_address_get(channels.ch.rtc); - uint32_t tep = nrf_ipc_task_address_get(NRF_IPC, ipc_task); if (setup) { - nrfx_gppi_ep_attach(eep, channels.ch.ppi); - nrfx_gppi_ep_attach(tep, channels.ch.ppi); + nrf_ipc_subscribe_set(NRF_IPC, ipc_task, channels.ch.ppi); + nrfx_gppi_event_endpoint_setup(channels.ch.ppi, evt_addr); } else { - nrfx_gppi_ep_clear(eep); - nrfx_gppi_ep_clear(tep); + nrfx_gppi_event_endpoint_clear(channels.ch.ppi, evt_addr); + nrf_ipc_subscribe_clear(NRF_IPC, ipc_task); } } /* Free DPPI and RTC channels */ static void free_resources(union rtc_sync_channels channels) { - nrfx_gppi_conn_disable(channels.ch.ppi); - nrfx_gppi_domain_conn_free(channels.ch.ppi); + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + nrfx_err_t err; + + nrfx_gppi_channels_disable(BIT(channels.ch.ppi)); + z_nrf_rtc_timer_chan_free(channels.ch.rtc); + + err = nrfx_dppi_channel_free(&dppi, channels.ch.ppi); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); } int z_nrf_rtc_timer_nrf53net_offset_get(void) @@ -220,18 +225,21 @@ static int mbox_rx_init(void *user_data) /* Setup RTC synchronization. */ static int sync_rtc_setup(void) { + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + nrfx_err_t err; union rtc_sync_channels channels; int32_t sync_rtc_ch; int rv; - rv = nrfx_gppi_domain_conn_alloc(0, 0, &channels.ch.ppi); - if (rv < 0) { + err = nrfx_dppi_channel_alloc(&dppi, &channels.ch.ppi); + if (err != NRFX_SUCCESS) { + rv = -ENODEV; goto bail; } sync_rtc_ch = z_nrf_rtc_timer_chan_alloc(); if (sync_rtc_ch < 0) { - nrfx_gppi_domain_conn_free(channels.ch.ppi); + nrfx_dppi_channel_free(&dppi, channels.ch.ppi); rv = sync_rtc_ch; goto bail; } @@ -245,7 +253,7 @@ static int sync_rtc_setup(void) goto bail; } - nrfx_gppi_conn_enable(channels.ch.ppi); + nrfx_gppi_channels_enable(BIT(channels.ch.ppi)); if (IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP)) { ppi_ipc_to_rtc(channels, true); diff --git a/soc/nordic/nrf54h/bicr/CMakeLists.txt b/soc/nordic/nrf54h/bicr/CMakeLists.txt index 6e26c8196906..0f7cfb33dd1e 100644 --- a/soc/nordic/nrf54h/bicr/CMakeLists.txt +++ b/soc/nordic/nrf54h/bicr/CMakeLists.txt @@ -1,7 +1,7 @@ if(CONFIG_SOC_NRF54H20_GENERATE_BICR) set(bicr_json_file ${BOARD_DIR}/${CONFIG_SOC_NRF54H20_BICR_NAME}) set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex) - set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/bsp/stable/mdk/nrf54h20_application.svd) + set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk/nrf54h20_application.svd) set(app_bicr_json_file ${APPLICATION_SOURCE_DIR}/${CONFIG_SOC_NRF54H20_BICR_NAME}) if(EXISTS ${app_bicr_json_file}) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 32357011d3f5..c291767d0906 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/soc/nordic/nrf54l/soc.c b/soc/nordic/nrf54l/soc.c index 8a73f339dcb5..76225d70ab74 100644 --- a/soc/nordic/nrf54l/soc.c +++ b/soc/nordic/nrf54l/soc.c @@ -20,13 +20,15 @@ #include #include #include -#include +#include +#include #include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #if (defined(NRF_APPLICATION) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)) || \ !defined(__ZEPHYR__) +#include #include #include #include diff --git a/soc/nordic/nrf91/soc.c b/soc/nordic/nrf91/soc.c index fab80836286a..5eb6342e6909 100644 --- a/soc/nordic/nrf91/soc.c +++ b/soc/nordic/nrf91/soc.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include diff --git a/soc/nordic/nrf92/soc.c b/soc/nordic/nrf92/soc.c index bb3fff687be1..3652b554711a 100644 --- a/soc/nordic/nrf92/soc.c +++ b/soc/nordic/nrf92/soc.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); diff --git a/soc/nordic/validate_binding_headers.c b/soc/nordic/validate_binding_headers.c index d917ccba8196..98ffffe86703 100644 --- a/soc/nordic/validate_binding_headers.c +++ b/soc/nordic/validate_binding_headers.c @@ -14,7 +14,7 @@ #include #include -#include +#include /** * Domain IDs. See: diff --git a/subsys/bluetooth/audio/shell/bap_usb.c b/subsys/bluetooth/audio/shell/bap_usb.c index 07e846fe3623..330cff1eb19b 100644 --- a/subsys/bluetooth/audio/shell/bap_usb.c +++ b/subsys/bluetooth/audio/shell/bap_usb.c @@ -738,6 +738,7 @@ int bap_usb_init(void) */ err = nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); + err -= NRFX_ERROR_BASE_NUM; if (err != 0) { LOG_WRN("Failed to set 128 MHz: %d", err); } 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 03d7ce5cace1..7056f020bc28 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 @@ -12,7 +12,6 @@ #include #include -#include #include "util/mem.h" @@ -68,8 +67,8 @@ BUILD_ASSERT(!HAL_RADIO_GPIO_LNA_OFFSET_MISSING, #endif /* FEM_NODE */ #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) -static nrfx_gpiote_t * const gpiote_palna = - &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(FEM_NODE, HAL_RADIO_GPIO_PA_PROP)); +static const nrfx_gpiote_t gpiote_palna = NRFX_GPIOTE_INSTANCE( + NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP)); static uint8_t gpiote_ch_palna; BUILD_ASSERT(NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP) == @@ -79,8 +78,8 @@ BUILD_ASSERT(NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP) == #endif #if defined(HAL_RADIO_FEM_IS_NRF21540) -static nrfx_gpiote_t * const gpiote_pdn = - &GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(FEM_NODE, pdn_gpios)); +static const nrfx_gpiote_t gpiote_pdn = NRFX_GPIOTE_INSTANCE( + NRF_DT_GPIOTE_INST(FEM_NODE, pdn_gpios)); static uint8_t gpiote_ch_pdn; #endif @@ -1941,13 +1940,13 @@ uint32_t radio_tmr_sample_get(void) int radio_gpio_pa_lna_init(void) { #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) - if (nrfx_gpiote_channel_alloc(gpiote_palna, &gpiote_ch_palna) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(&gpiote_palna, &gpiote_ch_palna) != NRFX_SUCCESS) { return -ENOMEM; } #endif #if defined(NRF_GPIO_PDN_PIN) - if (nrfx_gpiote_channel_alloc(gpiote_pdn, &gpiote_ch_pdn) != NRFX_SUCCESS) { + if (nrfx_gpiote_channel_alloc(&gpiote_pdn, &gpiote_ch_pdn) != NRFX_SUCCESS) { return -ENOMEM; } #endif @@ -1958,18 +1957,18 @@ int radio_gpio_pa_lna_init(void) void radio_gpio_pa_lna_deinit(void) { #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) - (void)nrfx_gpiote_channel_free(gpiote_palna, gpiote_ch_palna); + (void)nrfx_gpiote_channel_free(&gpiote_palna, gpiote_ch_palna); #endif #if defined(NRF_GPIO_PDN_PIN) - (void)nrfx_gpiote_channel_free(gpiote_pdn, gpiote_ch_pdn); + (void)nrfx_gpiote_channel_free(&gpiote_pdn, gpiote_ch_pdn); #endif } #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) void radio_gpio_pa_setup(void) { - gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = + gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | (NRF_GPIO_PA_PSEL << @@ -1989,7 +1988,7 @@ void radio_gpio_pa_setup(void) #if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) void radio_gpio_lna_setup(void) { - gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = + gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | (NRF_GPIO_LNA_PSEL << @@ -2009,7 +2008,7 @@ void radio_gpio_pdn_setup(void) { /* Note: the pdn-gpios property is optional. */ #if defined(NRF_GPIO_PDN) - gpiote_pdn->p_reg->CONFIG[gpiote_ch_pdn] = + gpiote_pdn.p_reg->CONFIG[gpiote_ch_pdn] = (GPIOTE_CONFIG_MODE_Task << GPIOTE_CONFIG_MODE_Pos) | (NRF_GPIO_PDN_PSEL << @@ -2063,12 +2062,12 @@ void radio_gpio_pa_lna_disable(void) BIT(HAL_DISABLE_PALNA_PPI) | BIT(HAL_ENABLE_FEM_PPI) | BIT(HAL_DISABLE_FEM_PPI)); - gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = 0; - gpiote_pdn->p_reg->CONFIG[gpiote_ch_pdn] = 0; + gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = 0; + gpiote_pdn.p_reg->CONFIG[gpiote_ch_pdn] = 0; #else hal_radio_nrf_ppi_channels_disable(BIT(HAL_ENABLE_PALNA_PPI) | BIT(HAL_DISABLE_PALNA_PPI)); - gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = 0; + gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = 0; #endif } #endif /* HAL_RADIO_GPIO_HAVE_PA_PIN || HAL_RADIO_GPIO_HAVE_LNA_PIN */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52810.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52810.h index 1545b292d9c9..7b22249ec928 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52810.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52810.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include /* Use the NRF_RTC instance for coarse radio event scheduling */ #define NRF_RTC NRF_RTC0 diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52832.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52832.h index 7a5321e2ea4f..10e942cca1e9 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52832.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52832.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include /* Use the NRF_RTC instance for coarse radio event scheduling */ #define NRF_RTC NRF_RTC0 diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52840.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52840.h index 6c3ce7cf41f2..80ab0f9e2410 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52840.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf52840.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include /* Use the NRF_RTC instance for coarse radio event scheduling */ #define NRF_RTC NRF_RTC0 diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h index 4e3729ad7748..428bcb869687 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h @@ -18,7 +18,7 @@ static inline void hal_palna_ppi_setup(void) nrf_gpiote_task_t task; task = nrf_gpiote_out_task_get(gpiote_ch_palna); - nrf_gpiote_subscribe_set(gpiote_palna->p_reg, task, HAL_DISABLE_PALNA_PPI); + nrf_gpiote_subscribe_set(gpiote_palna.p_reg, task, HAL_DISABLE_PALNA_PPI); #endif } #endif /* defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) */ @@ -44,14 +44,14 @@ static inline void hal_gpiote_tasks_setup(NRF_GPIOTE_Type *gpiote, static inline void hal_pa_ppi_setup(void) { - hal_gpiote_tasks_setup(gpiote_palna->p_reg, gpiote_ch_palna, + hal_gpiote_tasks_setup(gpiote_palna.p_reg, gpiote_ch_palna, IS_ENABLED(HAL_RADIO_GPIO_PA_POL_INV), HAL_ENABLE_PALNA_PPI, HAL_DISABLE_PALNA_PPI); } static inline void hal_lna_ppi_setup(void) { - hal_gpiote_tasks_setup(gpiote_palna->p_reg, gpiote_ch_palna, + hal_gpiote_tasks_setup(gpiote_palna.p_reg, gpiote_ch_palna, IS_ENABLED(HAL_RADIO_GPIO_LNA_POL_INV), HAL_ENABLE_PALNA_PPI, HAL_DISABLE_PALNA_PPI); } @@ -63,7 +63,7 @@ static inline void hal_fem_ppi_setup(void) nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_DISABLED, HAL_DISABLE_FEM_PPI); - hal_gpiote_tasks_setup(gpiote_pdn->p_reg, gpiote_ch_pdn, + hal_gpiote_tasks_setup(gpiote_pdn.p_reg, gpiote_ch_pdn, IS_ENABLED(HAL_RADIO_GPIO_NRF21540_PDN_POL_INV), HAL_ENABLE_FEM_PPI, HAL_DISABLE_FEM_PPI); } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h index b3fecbef87b8..268bae5aef17 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h @@ -13,12 +13,12 @@ static inline void hal_palna_ppi_setup(void) NRF_PPI, HAL_ENABLE_PALNA_PPI, (uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[2]), - (uint32_t)&(gpiote_palna->p_reg->TASKS_OUT[gpiote_ch_palna])); + (uint32_t)&(gpiote_palna.p_reg->TASKS_OUT[gpiote_ch_palna])); nrf_ppi_channel_endpoint_setup( NRF_PPI, HAL_DISABLE_PALNA_PPI, (uint32_t)&(NRF_RADIO->EVENTS_DISABLED), - (uint32_t)&(gpiote_palna->p_reg->TASKS_OUT[gpiote_ch_palna])); + (uint32_t)&(gpiote_palna.p_reg->TASKS_OUT[gpiote_ch_palna])); } #endif /* defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) */ @@ -40,12 +40,12 @@ static inline void hal_fem_ppi_setup(void) NRF_PPI, HAL_ENABLE_FEM_PPI, (uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[3]), - (uint32_t)&(gpiote_pdn->p_reg->TASKS_OUT[gpiote_ch_pdn])); + (uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn])); nrf_ppi_channel_endpoint_setup( NRF_PPI, HAL_DISABLE_FEM_PPI, (uint32_t)&(NRF_RADIO->EVENTS_DISABLED), - (uint32_t)&(gpiote_pdn->p_reg->TASKS_OUT[gpiote_ch_pdn])); + (uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn])); } #endif /* HAL_RADIO_FEM_IS_NRF21540 */ diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15_dvk_nrf54l15_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15_dvk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..eae536f36565 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15_dvk_nrf54l15_cpuapp.conf @@ -0,0 +1,5 @@ +# Copyright 2024 Nordic Semiconductor ASA +# Copyright 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15u_dvk_nrf54l15_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15u_dvk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..eae536f36565 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/bl54l15u_dvk_nrf54l15_cpuapp.conf @@ -0,0 +1,5 @@ +# Copyright 2024 Nordic Semiconductor ASA +# Copyright 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..e79ad7a81266 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS1=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..a7bedf1f04b1 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS2=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..157e0a11f728 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS131=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.conf new file mode 100644 index 000000000000..157e0a11f728 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS131=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..b01af3b36a7b --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf new file mode 100644 index 000000000000..b01af3b36a7b --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf new file mode 100644 index 000000000000..b01af3b36a7b --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/prj.conf b/tests/boards/nrf/i2c/i2c_slave/prj.conf index e96142fe744f..4b19609ecfbd 100644 --- a/tests/boards/nrf/i2c/i2c_slave/prj.conf +++ b/tests/boards/nrf/i2c/i2c_slave/prj.conf @@ -1,3 +1,2 @@ CONFIG_I2C=y CONFIG_ZTEST=y -CONFIG_NRFX_TWIS=y diff --git a/tests/boards/nrf/i2c/i2c_slave/src/main.c b/tests/boards/nrf/i2c/i2c_slave/src/main.c index dccc39762c30..78e6acec8805 100644 --- a/tests/boards/nrf/i2c/i2c_slave/src/main.c +++ b/tests/boards/nrf/i2c/i2c_slave/src/main.c @@ -17,6 +17,24 @@ #include +#if CONFIG_NRFX_TWIS1 +#define I2C_S_INSTANCE 1 +#elif CONFIG_NRFX_TWIS2 +#define I2C_S_INSTANCE 2 +#elif CONFIG_NRFX_TWIS20 +#define I2C_S_INSTANCE 20 +#elif CONFIG_NRFX_TWIS21 +#define I2C_S_INSTANCE 21 +#elif CONFIG_NRFX_TWIS22 +#define I2C_S_INSTANCE 22 +#elif CONFIG_NRFX_TWIS30 +#define I2C_S_INSTANCE 30 +#elif CONFIG_NRFX_TWIS131 +#define I2C_S_INSTANCE 131 +#else +#error "TWIS instance not enabled or not supported" +#endif + #define NODE_SENSOR DT_NODELABEL(sensor) #define NODE_TWIS DT_ALIAS(i2c_slave) @@ -28,9 +46,7 @@ #define TEST_DATA_SIZE 6 static const uint8_t msg[TEST_DATA_SIZE] = "Nordic"; -static nrfx_twis_t twis = { - .p_reg = (NRF_TWIS_Type *)DT_REG_ADDR(NODE_TWIS) -}; +static const nrfx_twis_t twis = NRFX_TWIS_INSTANCE(I2C_S_INSTANCE); static uint8_t i2c_slave_buffer[TEST_DATA_SIZE] TWIS_MEMORY_SECTION; static uint8_t i2c_master_buffer[TEST_DATA_SIZE]; @@ -41,7 +57,7 @@ struct i2c_api_twis_fixture { uint8_t *const slave_buffer; }; -void i2s_slave_handler(nrfx_twis_event_t const *p_event) +void i2s_slave_handler(nrfx_twis_evt_t const *p_event) { switch (p_event->type) { case NRFX_TWIS_EVT_READ_REQ: @@ -80,7 +96,7 @@ static void *test_setup(void) }; int ret; - zassert_equal(0, nrfx_twis_init(&twis, &config, i2s_slave_handler), + zassert_equal(NRFX_SUCCESS, nrfx_twis_init(&twis, &config, i2s_slave_handler), "TWIS initialization failed"); PINCTRL_DT_DEFINE(NODE_TWIS); @@ -88,7 +104,7 @@ static void *test_setup(void) zassert_ok(ret); IRQ_CONNECT(DT_IRQN(NODE_TWIS), DT_IRQ(NODE_TWIS, priority), - nrfx_twis_irq_handler, &twis, 0); + NRFX_TWIS_INST_HANDLER_GET(I2C_S_INSTANCE), NULL, 0); nrfx_twis_enable(&twis); diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index 2acc99f61b75..bcb57519f3b4 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -355,9 +355,7 @@ static void grtc_stress_test(bool busy_sim_en) } if (busy_sim_en) { -#ifdef CONFIG_TEST_BUSY_SIM busy_sim_start(500, 200, 1000, 400, NULL); -#endif } LOG_DBG("Starting test, will end at %d", test_end); @@ -389,9 +387,7 @@ static void grtc_stress_test(bool busy_sim_en) TC_PRINT("CPU load during test:%d.%d\n", load / 10, load % 10); if (busy_sim_en) { -#ifdef CONFIG_TEST_BUSY_SIM busy_sim_stop(); -#endif } if (counter_dev) { diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index d481ed33adcf..0ba5944cca66 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -79,7 +79,7 @@ tests: - CONFIG_UART_0_ENHANCED_POLL_OUT=y - CONFIG_UART_0_NRF_HW_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER=y + - CONFIG_NRFX_TIMER2=y platform_allow: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 38da5dca4800..008eae9d3d7f 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -78,7 +78,7 @@ tests: - CONFIG_UART_0_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER=y + - CONFIG_NRFX_TIMER2=y - CONFIG_UART_0_ENHANCED_POLL_OUT=n drivers.uart.pm.async.enhanced_poll: @@ -88,7 +88,7 @@ tests: - CONFIG_UART_0_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC=y - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER=y + - CONFIG_NRFX_TIMER2=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y platform_exclude: - nrf54h20dk/nrf54h20/cpuapp diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf52840dk_nrf52840_counter.conf b/tests/drivers/watchdog/wdt_basic_api/boards/nrf52840dk_nrf52840_counter.conf index 6152c1fc8105..35a9b2735c6e 100644 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf52840dk_nrf52840_counter.conf +++ b/tests/drivers/watchdog/wdt_basic_api/boards/nrf52840dk_nrf52840_counter.conf @@ -1,3 +1,4 @@ # Disable hardware watchdog CONFIG_WDT_NRFX=n +CONFIG_NRFX_WDT0=n CONFIG_ZERO_LATENCY_IRQS=y diff --git a/west.yml b/west.yml index 4315510509bc..ec5d79378e19 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 564e754139944286208f3eac122781cec4262392 + revision: 7858281d843468fe53c829995fb63f45a227387a path: modules/hal/nordic groups: - hal @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: c11e845e2483917d7478ba1a7a3591a9f4e8d4a2 + revision: f3cc9476e233364031e9ab842290392f260fba82 path: bootloader/mcuboot groups: - bootloader @@ -334,7 +334,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 5eec7aca321735f5fc8e3e7c79e162f0e9810b16 + revision: 26ed181181eed53e400db8f63fa83c566a05d971 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: e269670cd17fb8ccc4b7004544276bc7d9578496 @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: c2f9edc77f72838e7d6f5f9c0b95e4318ddfced1 + revision: 04aa7243e04946b5422b124bea9c0675ab6b120f path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 06d4d615d985e9bc85d8280163eea9b468d82ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0944/3334] Revert "[nrf fromtree] manifest: tf-m: align Mbed TLS header files to v3.6.5" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d3533471ccc2a5c3de94ebf63ef5856470550703. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index ec5d79378e19..f05cbb3f260f 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 04aa7243e04946b5422b124bea9c0675ab6b120f + revision: d3341a660f2f33156e1a8bb8ea47ad83066defea path: modules/tee/tf-m/trusted-firmware-m groups: - tee From c318636cc2fdedc38b86531d01cdd3c2ed288e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0945/3334] Revert "[nrf fromtree] west.yml: Bump TF-M to fix FOTA upgrade regression" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 081d8659e84a25efdf5a049bcadc3b6d953d156c. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f05cbb3f260f..2fdc2969a4be 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: d3341a660f2f33156e1a8bb8ea47ad83066defea + revision: 94691a2ed0d9a2802b3419eaa91958329c36871b path: modules/tee/tf-m/trusted-firmware-m groups: - tee From e414df4c6f6da3242b19b281761334dcc822e3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0946/3334] Revert "[nrf fromtree] west.yml: Bump TF-M to include fixes for stm32h5" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3866eb9fadf1d90bc7f1c1ea4ad4469274f3b684. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 2fdc2969a4be..202d9fa4e44a 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 94691a2ed0d9a2802b3419eaa91958329c36871b + revision: 62ad723311da2cac938e2ae88bafe9e815b3b248 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 58ce5886df740cf504c7fb5d42d1ab368baeaaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0947/3334] Revert "[nrf fromtree] manifest: Update commit id for trusted-firmware-m" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 519fe4d8d99df4373377f0ed3e2b453f2c6a0296. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 202d9fa4e44a..dcbde3f118e7 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 62ad723311da2cac938e2ae88bafe9e815b3b248 + revision: 591f37f31a882208e7b1ddb8e053a4bdf72c68ed path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 2e8f93ec68d798c6b54a7df9f1902e998792b570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0948/3334] Revert "[nrf fromtree] manifest: update TF-M to fix MPS4 warnings" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b2e99f13e92ce8d89a2701586e2b2c1f19de1d90. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index dcbde3f118e7..88309aa8ec8a 100644 --- a/west.yml +++ b/west.yml @@ -364,7 +364,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 591f37f31a882208e7b1ddb8e053a4bdf72c68ed + revision: 3e12b0cc27d828d7ec04c4ac62ad45a9a905573e path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 941a64d97267d82821ca0aa6c3d16d19a178466f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:30 +0100 Subject: [PATCH 0949/3334] Revert "[nrf fromtree] west.yml: MCUboot synchronization from upstream" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6c03cfe038ba037eedfedfe21d05753457d39731. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 88309aa8ec8a..cb93fab23d7d 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: f3cc9476e233364031e9ab842290392f260fba82 + revision: 96576b341ee19f1c3af6622256b0d4f3d408e1e3 path: bootloader/mcuboot groups: - bootloader From 67ab91fbdb3cbd5ef9e401665767dd594a2ad56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0950/3334] Revert "[nrf fromtree] west.yml: MCUboot synchronization from upstream" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ecc1e391d4d94fbd8772446a1af811c7829f1079. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index cb93fab23d7d..fc29f7220831 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: 96576b341ee19f1c3af6622256b0d4f3d408e1e3 + revision: b192716c969ad358bb3a1db60c898212f3275c55 path: bootloader/mcuboot groups: - bootloader From 8887d579aecf8763039938759a2c248cce2bd57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0951/3334] Revert "[nrf fromtree] west.yml: MCUboot synchronization from upstream" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b73862f688494edb7c865cb3239a70c05ba2cde2. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index fc29f7220831..eb77d89c14d6 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: b192716c969ad358bb3a1db60c898212f3275c55 + revision: 48b0f6da9af8d009eb8eafba023998a7d85320a1 path: bootloader/mcuboot groups: - bootloader From 6557ed1ba9a7fa61da258e5b70b999704fbf4262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0952/3334] Revert "[nrf fromtree] west.yml: MCUboot synchronization from upstream" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 71fef903089ef858abac2496eb95e69770cde6e5. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index eb77d89c14d6..3a6ecf61d3e9 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: 48b0f6da9af8d009eb8eafba023998a7d85320a1 + revision: d5b0dcb9aaee397fc105ae2228e8030038c3d871 path: bootloader/mcuboot groups: - bootloader From a0e2fd24d5147c542e450a8e4adc9e3b1fe3bfe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0953/3334] Revert "[nrf fromtree] west.yml: MCUboot synchronization from upstream" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8a44eee8188abfe4b8460275fc689a0320e162a2. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 3a6ecf61d3e9..f938869b8171 100644 --- a/west.yml +++ b/west.yml @@ -316,7 +316,7 @@ manifest: groups: - crypto - name: mcuboot - revision: d5b0dcb9aaee397fc105ae2228e8030038c3d871 + revision: aa4fa2b6e17361dd3ce16a60883059778fd147a9 path: bootloader/mcuboot groups: - bootloader From ac0ecbd8ec4192bb25fb124b72649fa2caaef368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0954/3334] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d8c5d09633195314cd075c0d107abe428f15ac4e. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f938869b8171..a00bfc9e1318 100644 --- a/west.yml +++ b/west.yml @@ -334,7 +334,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 26ed181181eed53e400db8f63fa83c566a05d971 + revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi revision: e269670cd17fb8ccc4b7004544276bc7d9578496 From 8a77ef7618e3185d3eb3bc5c237c2f1f037f780c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0955/3334] Revert "[nrf noup] dts: nordic: remove leftover file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c955bb5ea15584ffcd3c22d1347ceff352548954. Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf54l20.dtsi | 852 ++++++++++++++++++++++++++++++++ 1 file changed, 852 insertions(+) create mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi new file mode 100644 index 000000000000..bee70effa0e8 --- /dev/null +++ b/dts/vendor/nordic/nrf54l20.dtsi @@ -0,0 +1,852 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr"; + reg = <1>; + device_type = "cpu"; + riscv,isa = "rv32emc"; + nordic,bus-width = <64>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + pclk32m: pclk32m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + aclk: aclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; + + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(447)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 0x6fc00>; + }; + + cpuflpr_sram: memory@2006fc00 { + compatible = "mmio-sram"; + reg = <0x2006fc00 DT_SIZE_K(64)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2006fc00 0x10000>; + }; + + global_peripherals: peripheral@50000000 { + ranges = <0x0 0x50000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x143c>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + spi00: spi@4d000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart00: uart@4d000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + pdm20: pdm@d0000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd0000 0x1000>; + interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pdm21: pdm@d1000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd1000 0x1000>; + interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pwm20: pwm@d2000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd2000 0x1000>; + interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm21: pwm@d3000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd3000 0x1000>; + interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm22: pwm@d4000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd4000 0x1000>; + interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <16>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + tdm: tdm@e8000 { + compatible = "nordic,nrf-tdm"; + easydma-maxcnt-bits = <15>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xe8000 0x1000>; + interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + clocks = <&pclk32m>; + }; + + i2c23: i2c@ed000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi23: spi@ed000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart23: uart@ed000 { + compatible = "nordic,nrf-uarte"; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c24: i2c@ee000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi24: spi@ee000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart24: uart@ee000 { + compatible = "nordic,nrf-uarte"; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <5>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@51c { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x51c 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@520 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x520 0x1>; + status = "disabled"; + }; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1972)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + + cpuflpr_rram: rram@1ed000 { + compatible = "soc-nv-flash"; + reg = <0x1ed000 DT_SIZE_K(64)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; From 863bfe0fb87a8b484cdf7b034372ea4847c4f3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0956/3334] Revert "[nrf noup] modules: hal_nordic: cleanup nrfx_config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9f426c320d6f163ac60b4bd4c323413f032b8369. Signed-off-by: Tomasz Moń --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ++++++++++++++++++ .../nrfx/nrfx_reserved_resources_ncs.h | 217 ---- 3 files changed, 949 insertions(+), 218 deletions(-) create mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h delete mode 100644 modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 6065abbf86d6..15ba5475436c 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -1308,6 +1308,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_reserved_resources_ncs.h" + default "nrfx_config_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h new file mode 100644 index 000000000000..ec8a9acaf7b5 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h @@ -0,0 +1,948 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ +#define NRFX_CONFIG_RESERVED_RESOURCES_H__ + +/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE130_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) + +/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE131_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) + +/** @brief Bitmask that defines EGU instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_EGUS_USED 0 + +/** @brief Bitmask that defines TIMER instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_TIMERS_USED 0 + +/* If the GRTC system timer driver is to be used, prepare definitions required + * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and + * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. + */ +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) +#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ + (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ + ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) +#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ + (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ + DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ + +/* + * The enabled Bluetooth controller subsystem is responsible for providing + * definitions of the BT_CTLR_USED_* symbols used below in a file named + * bt_ctlr_used_resources.h and for adding its location to global include + * paths so that the file can be included here for all Zephyr libraries that + * are to be built. + */ +#if defined(CONFIG_BT_LL_SW_SPLIT) +#include +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#endif +#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +/* Define auxiliary symbols needed for SDC device dispatch. */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRF52_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRF53_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRF54L_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF71X) +#define NRF71_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRF54H_SERIES +#endif +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_NRF_802154_RADIO_DRIVER) +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#include <../src/nrf_802154_peripherals_nrf52.h> +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#include <../src/nrf_802154_peripherals_nrf53.h> +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#include <../src/nrf_802154_peripherals_nrf54l.h> +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#include <../src/nrf_802154_peripherals_nrf54h.h> +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL +#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL +#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL +#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL +#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL +#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL +#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL +#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL +#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL +#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL +#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL +#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL +#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL +#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL +#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL +#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL +#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL +#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 +#endif + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_CHANNELS_USED \ + (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI0_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_GROUPS_USED \ + (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI0_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_CHANNELS_USED \ + (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI00_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_GROUPS_USED \ + (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI00_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_CHANNELS_USED \ + (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI10_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_GROUPS_USED \ + (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI10_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_CHANNELS_USED \ + (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI20_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_GROUPS_USED \ + (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI20_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_CHANNELS_USED \ + (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI30_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_GROUPS_USED \ + (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI30_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_CHANNELS_USED \ + (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI020_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_GROUPS_USED \ + (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI020_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_CHANNELS_USED \ + (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI030_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_GROUPS_USED \ + (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI030_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_CHANNELS_USED \ + (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI120_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_GROUPS_USED \ + (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI120_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_CHANNELS_USED \ + (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI130_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_GROUPS_USED \ + (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI130_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_CHANNELS_USED \ + (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI131_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_GROUPS_USED \ + (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI131_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_CHANNELS_USED \ + (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI132_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_GROUPS_USED \ + (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI132_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_CHANNELS_USED \ + (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI133_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_GROUPS_USED \ + (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI133_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_CHANNELS_USED \ + (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI134_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_GROUPS_USED \ + (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI134_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_CHANNELS_USED \ + (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI135_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_GROUPS_USED \ + (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI135_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_CHANNELS_USED \ + (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI136_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_GROUPS_USED \ + (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI136_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines PPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_CHANNELS_USED \ + (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) + +#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED +#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED + +/** @brief Bitmask that defines PPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_GROUPS_USED \ + (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ + NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) + +#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ + (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ + (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ + (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ + (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ + (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ + (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ + (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ + NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) + +#if defined(CONFIG_SOFTDEVICE) +#include +#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED +#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED +#else +#define NRFX_PPI_CHANNELS_USED_BY_SD 0 +#define NRFX_PPI_GROUPS_USED_BY_SD 0 +#endif + +#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h deleted file mode 100644 index 2c1fe3640493..000000000000 --- a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_RESERVED_RESOURCES_NCS_H__ -#define NRFX_RESERVED_RESOURCES_NCS_H__ - -#if defined(CONFIG_BT_LL_SOFTDEVICE) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) -#else -#error Unsupported chip family -#endif -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ - -#if defined(CONFIG_MPSL) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ - (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif - -#include "nrfx_reserved_resources.h" - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) - -BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ -#endif /* NRFX_RESERVED_RESOURCES_NCS_H__ */ From 6e45a7145efb77e8994121d7a30e520c858903ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0957/3334] Revert "[nrf noup] scripts: ci: check_compliance: fix whitespace" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit adb16c7762b7229b523aafa32b7ee2f397599226. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 912dbdad48e3..16aacd4c6a80 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1401,10 +1401,10 @@ def check_no_undef_outside_kconfig(self, kconf): "SECURITY_LOADPIN", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "SEL", "SHIFT", - "SINGLE_APPLICATION_SLOT", # Used in sysbuild for MCUboot configuration - "SINGLE_APPLICATION_SLOT_RAM_LOAD", # Used in sysbuild for MCUboot configuration - "SOC_SDKNG_UNSUPPORTED", # Used in modules/hal_nxp/mcux/CMakeLists.txt - "SOC_SERIES_", # Used as regex in scripts/utils/board_v1_to_v2.py + "SINGLE_APPLICATION_SLOT", # Used in sysbuild for MCUboot configuration + "SINGLE_APPLICATION_SLOT_RAM_LOAD", # Used in sysbuild for MCUboot configuration + "SOC_SDKNG_UNSUPPORTED", # Used in modules/hal_nxp/mcux/CMakeLists.txt + "SOC_SERIES_", # Used as regex in scripts/utils/board_v1_to_v2.py "SOC_WATCH", # Issue 13749 "SOME_BOOL", "SOME_INT", From 17bc97d0e68d51f99c1f03026443c72947216349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0958/3334] Revert "[nrf noup] boards: native: nrf_bsim: apply coding style" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b09e900646e464b339e19767fe000410058bc25d. Signed-off-by: Tomasz Moń --- boards/native/nrf_bsim/CMakeLists.txt | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/boards/native/nrf_bsim/CMakeLists.txt b/boards/native/nrf_bsim/CMakeLists.txt index a457bd3126d6..244133c1bd6a 100644 --- a/boards/native/nrf_bsim/CMakeLists.txt +++ b/boards/native/nrf_bsim/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(BabbleSim) zephyr_library() if (CONFIG_BOARD_NRF54L15BSIM_NRF54L15_CPUFLPR) - message(FATAL_ERROR "Targeting the nrf54l15bsim/nrf54l15/cpuflpr core is not yet supported") + message(FATAL_ERROR "Targeting the nrf54l15bsim/nrf54l15/cpuflpr core is not yet supported") endif() # Due to the BLE controller assumption about enum size @@ -20,15 +20,15 @@ zephyr_compile_options( target_compile_options(native_simulator INTERFACE -fshort-enums) zephyr_library_sources( - irq_handler.c - cpu_wait.c - argparse.c - nsi_if.c - native_remap.c - soc/nrfx_coredep.c - common/bstests_entry.c - common/cmsis/cmsis.c - common/trace_hook.c + irq_handler.c + cpu_wait.c + argparse.c + nsi_if.c + native_remap.c + soc/nrfx_coredep.c + common/bstests_entry.c + common/cmsis/cmsis.c + common/trace_hook.c ) # Include sync_rtc from real SOC code if enabled @@ -37,18 +37,18 @@ zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC ) target_sources(native_simulator INTERFACE - common/bsim_args_runner.c - common/bsim_extra_cpu_if_stubs.c - common/phy_sync_ctrl.c - common/runner_hooks.c - common/posix_arch_if.c - common/trace_hook.c + common/bsim_args_runner.c + common/bsim_extra_cpu_if_stubs.c + common/phy_sync_ctrl.c + common/runner_hooks.c + common/posix_arch_if.c + common/trace_hook.c ) if (CONFIG_IPC_SERVICE AND CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUAPP) - zephyr_library_sources( - ipc_backend.c - ) + zephyr_library_sources( + ipc_backend.c + ) endif() zephyr_include_directories( @@ -70,17 +70,17 @@ zephyr_library_include_directories( set(libpath ${BSIM_OUT_PATH}/lib) set_property(TARGET native_simulator APPEND PROPERTY RUNNER_LINK_LIBRARIES - ${libpath}/libUtilv1.32.a - ${libpath}/libPhyComv1.32.a - ${libpath}/lib2G4PhyComv1.32.a - ${libpath}/libRandv2.32.a + ${libpath}/libUtilv1.32.a + ${libpath}/libPhyComv1.32.a + ${libpath}/lib2G4PhyComv1.32.a + ${libpath}/libRandv2.32.a ) target_compile_options(native_simulator INTERFACE "-DNSI_PRIMARY_MCU_N=${CONFIG_NATIVE_SIMULATOR_PRIMARY_MCU_INDEX}") add_subdirectory(${ZEPHYR_BASE}/boards/native/common/extra_args/ - ${CMAKE_CURRENT_BINARY_DIR}/extra_args + ${CMAKE_CURRENT_BINARY_DIR}/extra_args ) include(../common/natsim_config.cmake) From 8619a4417dd72d4b1b2b422a8a513052cec21650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0959/3334] Revert "[nrf fromtree] samples: nordic: nrfx_prs: remove deprecated UARTE API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 21c44da12a6f7a8744d65e8237523bc375b1ab96. Signed-off-by: Tomasz Moń --- samples/boards/nordic/nrfx_prs/src/main.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/samples/boards/nordic/nrfx_prs/src/main.c b/samples/boards/nordic/nrfx_prs/src/main.c index e9e63e574d29..1b9411d2da43 100644 --- a/samples/boards/nordic/nrfx_prs/src/main.c +++ b/samples/boards/nordic/nrfx_prs/src/main.c @@ -260,15 +260,9 @@ static bool uarte_transfer(const uint8_t *tx_data, size_t tx_data_len, { nrfx_err_t err; - err = nrfx_uarte_rx_buffer_set(&uarte, rx_buf, rx_buf_size); + err = nrfx_uarte_rx(&uarte, rx_buf, rx_buf_size); if (err != NRFX_SUCCESS) { - printk("nrfx_uarte_rx_buffer_set() failed: 0x%08x\n", err); - return false; - } - - err = nrfx_uarte_rx_enable(&uarte, NRFX_UARTE_RX_ENABLE_STOP_ON_END); - if (err != NRFX_SUCCESS) { - printk("nrfx_uarte_rx_enable() failed: 0x%08x\n", err); + printk("nrfx_uarte_rx() failed: 0x%08x\n", err); return false; } From 06729916a1ef5ffcbe2838e7772aecb1e4cb198a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0960/3334] Revert "[nrf fromtree] samples: i2s: echo: Enable nRF53 MCK output in I2S sample" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ec73f6e7bcfbaf72fc4b8f75c8c01ed7fec8ec2e. Signed-off-by: Tomasz Moń --- .../drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay index d34bfc4bf513..c68c24a56115 100644 --- a/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -22,8 +22,7 @@ i2s0_default_alt: i2s0_default_alt { group1 { - psels = , - , + psels = , , , ; From 4e83f86e329893a6d728b42c3ef6d86378734a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0961/3334] Revert "[nrf fromtree] drivers: i2s: nrfx: Allow MCK bypass for proper LRCK and MCK Ratios" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 587ff49516a3d72bab7fe8c204ec45c8de3e6d59. Signed-off-by: Tomasz Moń --- drivers/i2s/Kconfig.nrfx | 8 ------- drivers/i2s/i2s_nrfx.c | 22 +------------------ .../echo/boards/nrf5340dk_nrf5340_cpuapp.conf | 7 ------ 3 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.conf diff --git a/drivers/i2s/Kconfig.nrfx b/drivers/i2s/Kconfig.nrfx index 7337f9974c0f..cc00ac1a9cc3 100644 --- a/drivers/i2s/Kconfig.nrfx +++ b/drivers/i2s/Kconfig.nrfx @@ -21,14 +21,6 @@ config I2S_NRFX_TX_BLOCK_COUNT int "TX queue length" default 4 -config I2S_NRFX_ALLOW_MCK_BYPASS - bool "Allow MCK bypass if a ratio exists" - depends on SOC_SERIES_NRF53X - help - Search for a supported ratio directly from MCK and LRCK - and enable bypass if a ratio exists. If not, fallback to - the standard MCK selection mechanism. - endif # I2S_NRFX menuconfig I2S_NRF_TDM diff --git a/drivers/i2s/i2s_nrfx.c b/drivers/i2s/i2s_nrfx.c index 8c52fb42da30..74f7046732f1 100644 --- a/drivers/i2s/i2s_nrfx.c +++ b/drivers/i2s/i2s_nrfx.c @@ -95,26 +95,6 @@ static void find_suitable_clock(const struct i2s_nrfx_drv_cfg *drv_cfg, nrf_i2s_mck_t best_mck_cfg = 0; uint32_t best_mck = 0; -#if defined(CONFIG_I2S_NRFX_ALLOW_MCK_BYPASS) && NRF_I2S_HAS_CLKCONFIG - /* Check for bypass before calculating f_MCK */ - for (r = 0; r < ARRAY_SIZE(ratios); ++r) { - if (i2s_cfg->frame_clk_freq * ratios[r].ratio_val == src_freq) { - LOG_INF("MCK bypass calculated"); - best_r = r; - best_mck = src_freq; - best_diff = 0; - - /* Set CONFIG.MCKFREQ register to non-zero reset value to - * ensure peripheral functionality - */ - best_mck_cfg = NRF_I2S_MCK_32MDIV8; - - config->enable_bypass = true; - break; - } - } -#endif - for (r = 0; (best_diff != 0) && (r < ARRAY_SIZE(ratios)); ++r) { /* Only multiples of the frame width can be used as ratios. */ if ((ratios[r].ratio_val % bits_per_frame) != 0) { @@ -780,7 +760,7 @@ static int trigger_start(const struct device *dev) nrf_i2s_clk_configure(drv_cfg->i2s.p_reg, drv_cfg->clk_src == ACLK ? NRF_I2S_CLKSRC_ACLK : NRF_I2S_CLKSRC_PCLK32M, - nrfx_cfg->enable_bypass); + false); #endif /* If it is required to use certain HF clock, request it to be running diff --git a/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index df9df966798c..000000000000 --- a/samples/drivers/i2s/echo/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright The Zephyr Project Contributors -# -# SPDX-License-Identifier: Apache-2.0 -# - -CONFIG_I2S_NRFX_ALLOW_MCK_BYPASS=y From d334bb2463abc7ffc4fad4976d5bf4a91f539687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0962/3334] Revert "[nrf fromtree] drivers: timer: nrf_rtc: Kconfig clean up" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 97d1f6b0b478683a37c5e3b14cb589a1fb6ace5a. Signed-off-by: Tomasz Moń --- boards/native/nrf_bsim/Kconfig | 3 +++ drivers/timer/Kconfig.nrf_rtc | 1 - soc/nordic/nrf51/Kconfig.defconfig | 4 ++++ soc/nordic/nrf52/Kconfig.defconfig | 4 ++++ soc/nordic/nrf53/Kconfig.defconfig | 4 ++++ soc/nordic/nrf91/Kconfig.defconfig | 4 ++++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/boards/native/nrf_bsim/Kconfig b/boards/native/nrf_bsim/Kconfig index 9df6cfd2243f..3596ccec0240 100644 --- a/boards/native/nrf_bsim/Kconfig +++ b/boards/native/nrf_bsim/Kconfig @@ -5,6 +5,7 @@ config BOARD_NRF52_BSIM bool select SOC_SERIES_BSIM_NRF52X select SOC_COMPATIBLE_NRF52833 + select NRF_RTC_TIMER select CLOCK_CONTROL help NRF52 simulation model @@ -15,6 +16,7 @@ config BOARD_NRF5340BSIM_NRF5340_CPUNET bool select SOC_SERIES_BSIM_NRF53X select SOC_COMPATIBLE_NRF5340_CPUNET + select NRF_RTC_TIMER select CLOCK_CONTROL help Simulated NRF53 Network core @@ -25,6 +27,7 @@ config BOARD_NRF5340BSIM_NRF5340_CPUAPP bool select SOC_SERIES_BSIM_NRF53X select SOC_COMPATIBLE_NRF5340_CPUAPP + select NRF_RTC_TIMER select CLOCK_CONTROL help Simulated NRF53 Application core diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index c045f85f240c..1ddd473c01a0 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -11,7 +11,6 @@ config NRF_RTC_TIMER select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT select NRFX_PPI if SOC_NRF52832 - default y if SYS_CLOCK_EXISTS help This module implements a kernel device driver for the nRF Real Time Counter NRF_RTC1 and provides the standard "system clock driver" diff --git a/soc/nordic/nrf51/Kconfig.defconfig b/soc/nordic/nrf51/Kconfig.defconfig index dad7aedf09c8..67f1eb86e39f 100644 --- a/soc/nordic/nrf51/Kconfig.defconfig +++ b/soc/nordic/nrf51/Kconfig.defconfig @@ -9,6 +9,10 @@ if SOC_SERIES_NRF51X config NUM_IRQS default 26 +# If the kernel has timer support, enable the timer +config NRF_RTC_TIMER + default y if SYS_CLOCK_EXISTS + config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_nodelabel_int_prop,rtc1,clock-frequency) diff --git a/soc/nordic/nrf52/Kconfig.defconfig b/soc/nordic/nrf52/Kconfig.defconfig index a8220ea2f489..7908f14561ef 100644 --- a/soc/nordic/nrf52/Kconfig.defconfig +++ b/soc/nordic/nrf52/Kconfig.defconfig @@ -7,6 +7,10 @@ if SOC_SERIES_NRF52X rsource "Kconfig.defconfig.nrf52*" +# If the kernel has timer support, enable the timer +config NRF_RTC_TIMER + default y if SYS_CLOCK_EXISTS + config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_nodelabel_int_prop,rtc1,clock-frequency) diff --git a/soc/nordic/nrf53/Kconfig.defconfig b/soc/nordic/nrf53/Kconfig.defconfig index 82974c027426..bd0b9cb6d27d 100644 --- a/soc/nordic/nrf53/Kconfig.defconfig +++ b/soc/nordic/nrf53/Kconfig.defconfig @@ -7,6 +7,10 @@ if SOC_SERIES_NRF53X rsource "Kconfig.defconfig.nrf53*" +# If the kernel has timer support, enable the timer +config NRF_RTC_TIMER + default y if SYS_CLOCK_EXISTS + config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_nodelabel_int_prop,rtc1,clock-frequency) diff --git a/soc/nordic/nrf91/Kconfig.defconfig b/soc/nordic/nrf91/Kconfig.defconfig index bad2765c1b0c..81fce08e5dd4 100644 --- a/soc/nordic/nrf91/Kconfig.defconfig +++ b/soc/nordic/nrf91/Kconfig.defconfig @@ -7,6 +7,10 @@ if SOC_SERIES_NRF91X rsource "Kconfig.defconfig.nrf91*" +# If the kernel has timer support, enable the timer +config NRF_RTC_TIMER + default y if SYS_CLOCK_EXISTS + config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_nodelabel_int_prop,rtc1,clock-frequency) From 199b33cad9e87d5edbf6c437f0c6cce02700d61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0963/3334] Revert "[nrf fromtree] drivers timer nrf_rtc: Fix dependency" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 208c846dffa54fc86e7304c7f66f871995c610c1. Signed-off-by: Tomasz Moń --- drivers/timer/Kconfig.nrf_rtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index 1ddd473c01a0..c596462a6e28 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -7,7 +7,7 @@ config NRF_RTC_TIMER bool "nRF Real Time Counter (NRF_RTC1) Timer" depends on CLOCK_CONTROL depends on SOC_COMPATIBLE_NRF - depends on !$(dt_nodelabel_enabled,rtc1) && !DT_HAS_NORDIC_NRF_GRTC_ENABLED + depends on !DT_HAS_NORDIC_NRF_RTC_ENABLED && !DT_HAS_NORDIC_NRF_GRTC_ENABLED select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT select NRFX_PPI if SOC_NRF52832 From b458defb6c34ba2903c03bfec8a6cee83d86f161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0964/3334] Revert "[nrf fromtree] drivers: Fix some Kconfig bleeds" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d3ad2feac8318e3a36d6ffc9dd766ad0f259f72d. Signed-off-by: Tomasz Moń --- drivers/adc/Kconfig.ad405x | 2 +- drivers/cache/Kconfig.nrf | 1 - drivers/cache/Kconfig.stm32 | 1 - drivers/timer/Kconfig.nrf_rtc | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/adc/Kconfig.ad405x b/drivers/adc/Kconfig.ad405x index 57298c82fa8c..5abc89a8dd56 100644 --- a/drivers/adc/Kconfig.ad405x +++ b/drivers/adc/Kconfig.ad405x @@ -13,6 +13,6 @@ config ADC_AD405X config AD405X_TRIGGER bool "AD405X interrupts" - depends on ADC_AD405X + default n help Enable interrupts for ADI AD405X. diff --git a/drivers/cache/Kconfig.nrf b/drivers/cache/Kconfig.nrf index a308d14cc682..c1cfc2c8c582 100644 --- a/drivers/cache/Kconfig.nrf +++ b/drivers/cache/Kconfig.nrf @@ -11,6 +11,5 @@ config CACHE_NRF_CACHE config CACHE_NRF_PATCH_LINEADDR bool "Patch lineaddr" default y if SOC_NRF54H20 - depends on DCACHE help Manually set 28th bit in the LINEADDR in Trustzone Secure build. diff --git a/drivers/cache/Kconfig.stm32 b/drivers/cache/Kconfig.stm32 index 3c97c614f67c..6d468f98548d 100644 --- a/drivers/cache/Kconfig.stm32 +++ b/drivers/cache/Kconfig.stm32 @@ -4,7 +4,6 @@ menuconfig CACHE_STM32 bool "STM32 cache driver" select CACHE_HAS_DRIVER - depends on SOC_FAMILY_STM32 depends on CACHE_MANAGEMENT help Enable support for the STM32 ICACHE / DCACHE peripheral present in some STM32 chips. diff --git a/drivers/timer/Kconfig.nrf_rtc b/drivers/timer/Kconfig.nrf_rtc index c596462a6e28..82228d453caf 100644 --- a/drivers/timer/Kconfig.nrf_rtc +++ b/drivers/timer/Kconfig.nrf_rtc @@ -7,10 +7,10 @@ config NRF_RTC_TIMER bool "nRF Real Time Counter (NRF_RTC1) Timer" depends on CLOCK_CONTROL depends on SOC_COMPATIBLE_NRF - depends on !DT_HAS_NORDIC_NRF_RTC_ENABLED && !DT_HAS_NORDIC_NRF_GRTC_ENABLED select TICKLESS_CAPABLE select SYSTEM_TIMER_HAS_DISABLE_SUPPORT select NRFX_PPI if SOC_NRF52832 + depends on !$(dt_nodelabel_enabled,rtc1) help This module implements a kernel device driver for the nRF Real Time Counter NRF_RTC1 and provides the standard "system clock driver" From 267e2daf536700b8c1e08b3a144ff59d4cdb02b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:31 +0100 Subject: [PATCH 0965/3334] Revert "[nrf fromtree] tests: Bluetooth: Tester: Audio: Adds BRS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc05376c170fc2739a4881629caf49c40d485a9e. Signed-off-by: Tomasz Moń --- subsys/bluetooth/audio/bap_scan_delegator.c | 1 - .../bluetooth/tester/src/audio/btp/btp_bap.h | 14 ---- tests/bluetooth/tester/src/audio/btp_bap.c | 5 -- .../tester/src/audio/btp_bap_broadcast.c | 65 ------------------- .../tester/src/audio/btp_bap_broadcast.h | 2 - 5 files changed, 87 deletions(-) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index b672640c2b44..90520017209f 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -1617,7 +1617,6 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par state->pa_sync_state = param->pa_state; state->encrypt_state = param->encrypt_state; state->num_subgroups = param->num_subgroups; - if (state->num_subgroups > 0U) { (void)memcpy(state->subgroups, param->subgroups, sizeof(state->subgroups)); diff --git a/tests/bluetooth/tester/src/audio/btp/btp_bap.h b/tests/bluetooth/tester/src/audio/btp/btp_bap.h index a9f045b02975..90544cdcbd0d 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_bap.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_bap.h @@ -202,20 +202,6 @@ struct btp_bap_broadcast_source_setup_v2_rp { uint32_t gap_settings; } __packed; -#define BTP_BAP_SCAN_DELEGATOR_ADD_SRC 0x1a -struct btp_bap_scan_delegator_add_src_cmd { - bt_addr_le_t broadcaster_address; - uint8_t advertiser_sid; - uint8_t broadcast_id[BT_AUDIO_BROADCAST_ID_SIZE]; - uint8_t pa_sync_state; - uint8_t big_encryption; - uint8_t num_subgroups; - uint8_t subgroups[]; -} __packed; -struct btp_bap_scan_delegator_add_src_rp { - uint8_t src_id; -} __packed; - /* BAP events */ #define BTP_BAP_EV_DISCOVERY_COMPLETED 0x80 struct btp_bap_discovery_completed_ev { diff --git a/tests/bluetooth/tester/src/audio/btp_bap.c b/tests/bluetooth/tester/src/audio/btp_bap.c index c860d7341c6f..cf9baeec5c3f 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap.c +++ b/tests/bluetooth/tester/src/audio/btp_bap.c @@ -474,11 +474,6 @@ static const struct btp_handler bap_handlers[] = { .expect_len = sizeof(struct btp_bap_send_past_cmd), .func = btp_bap_broadcast_assistant_send_past, }, - { - .opcode = BTP_BAP_SCAN_DELEGATOR_ADD_SRC, - .expect_len = BTP_HANDLER_LENGTH_VARIABLE, - .func = btp_bap_scan_delegator_add_src, - }, #endif /* CONFIG_BT_BAP_BROADCAST_SOURCE || CONFIG_BT_BAP_BROADCAST_SINK */ }; diff --git a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c index d301fac6c31f..3733ab36440a 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c @@ -1833,71 +1833,6 @@ uint8_t btp_bap_broadcast_assistant_send_past(const void *cmd, uint16_t cmd_len, return BTP_STATUS_SUCCESS; } -uint8_t btp_bap_scan_delegator_add_src(const void *cmd, uint16_t cmd_len, void *rsp, - uint16_t *rsp_len) -{ - const struct btp_bap_scan_delegator_add_src_cmd *cp = cmd; - struct btp_bap_scan_delegator_add_src_rp *rp = rsp; - struct bt_bap_scan_delegator_add_src_param param = {0}; - struct net_buf_simple buf; - int err; - - if (cmd_len < sizeof(*cp)) { - return BTP_STATUS_FAILED; - } - - if (cp->num_subgroups > CONFIG_BT_BAP_BASS_MAX_SUBGROUPS) { - return BTP_STATUS_FAILED; - } - - if (cp->big_encryption > BT_BAP_BIG_ENC_STATE_BAD_CODE) { - return BTP_STATUS_FAILED; - } - - bt_addr_le_copy(¶m.addr, &cp->broadcaster_address); - param.sid = cp->advertiser_sid; - param.pa_state = (enum bt_bap_pa_state)cp->pa_sync_state; - param.encrypt_state = (enum bt_bap_big_enc_state)cp->big_encryption; - param.broadcast_id = sys_get_le24(cp->broadcast_id); - param.num_subgroups = cp->num_subgroups; - - net_buf_simple_init_with_data(&buf, (void *)cp->subgroups, cmd_len - sizeof(*cp)); - - for (uint8_t i = 0; i < param.num_subgroups; i++) { - struct bt_bap_bass_subgroup *subgroup = ¶m.subgroups[i]; - - /* If remaining data is less than the necessary subgroup fields, return failed */ - if (buf.len < sizeof(subgroup->bis_sync) + sizeof(subgroup->metadata_len)) { - return BTP_STATUS_FAILED; - } - - subgroup->bis_sync = net_buf_simple_pull_le32(&buf); - subgroup->metadata_len = net_buf_simple_pull_u8(&buf); - - if (subgroup->metadata_len > sizeof(subgroup->metadata) || - subgroup->metadata_len > buf.len) { - return BTP_STATUS_FAILED; - } - - memcpy(subgroup->metadata, net_buf_simple_pull_mem(&buf, subgroup->metadata_len), - subgroup->metadata_len); - } - - if (buf.len != 0U) { - return BTP_STATUS_FAILED; - } - - err = bt_bap_scan_delegator_add_src(¶m); - if (err < 0) { - return BTP_STATUS_VAL(err); - } - - rp->src_id = (uint8_t)err; - *rsp_len = sizeof(*rp); - - return BTP_STATUS_SUCCESS; -} - static bool broadcast_inited; int btp_bap_broadcast_init(void) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h index a5fea384c45d..3f4ef82b256c 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h +++ b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h @@ -120,5 +120,3 @@ uint8_t btp_bap_broadcast_assistant_set_broadcast_code(const void *cmd, uint16_t void *rsp, uint16_t *rsp_len); uint8_t btp_bap_broadcast_assistant_send_past(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len); -uint8_t btp_bap_scan_delegator_add_src(const void *cmd, uint16_t cmd_len, - void *rsp, uint16_t *rsp_len); From 1769cf2b7338f15c54f6a132aa4187fb7179dbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0966/3334] Revert "[nrf fromtree] bluetooth: audio: Update encrypt state value" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit eaa330e7b7a30c553e5448a4b06081543c973d6a. Signed-off-by: Tomasz Moń --- subsys/bluetooth/audio/bap_scan_delegator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 90520017209f..5e6f8384ef75 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -1615,7 +1615,6 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par state->adv_sid = param->sid; state->broadcast_id = param->broadcast_id; state->pa_sync_state = param->pa_state; - state->encrypt_state = param->encrypt_state; state->num_subgroups = param->num_subgroups; if (state->num_subgroups > 0U) { (void)memcpy(state->subgroups, param->subgroups, From 40beff8a0bb712380de1a5c0750c615f1f188ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0967/3334] Revert "[nrf fromtree] tests: Bluetooth: Tester: Allow connecting CIS in QoS state" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cfb18edbddff949d671710028298231b20e92d3f. Signed-off-by: Tomasz Moń --- .../tester/src/audio/btp_bap_unicast.c | 59 ++++++------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index 449ac8076cae..f620c5e418e7 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -6,7 +6,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include #include #include #include @@ -17,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -560,41 +558,22 @@ static void stream_qos_set_cb(struct bt_bap_stream *stream) static void stream_enabled_cb(struct bt_bap_stream *stream) { - const bool iso_connected = - stream->iso == NULL ? false : stream->iso->state == BT_ISO_STATE_CONNECTED; + struct bt_bap_ep_info info; + struct bt_conn_info conn_info; int err; LOG_DBG("Enabled stream %p", stream); - if (iso_connected) { - struct bt_bap_ep_info ep_info; - struct bt_conn_info conn_info; - - err = bt_bap_ep_get_info(stream->ep, &ep_info); - __ASSERT(err == 0, "Failed to get ISO chan info: %d", err); - err = bt_conn_get_info(stream->conn, &conn_info); - __ASSERT(err == 0, "Failed to get ISO chan info: %d", err); - - /* If we are central and the endpoint is a source or if we are a peripheral and the - * endpoint is a sink, then we can start it, else the remote device needs to start - * the endpoint - */ - const bool start_stream = - (IS_ENABLED(CONFIG_BT_CENTRAL) && conn_info.role == BT_HCI_ROLE_CENTRAL && - ep_info.dir == BT_AUDIO_DIR_SOURCE) || - (IS_ENABLED(CONFIG_BT_PERIPHERAL) && - conn_info.role == BT_HCI_ROLE_PERIPHERAL && - ep_info.dir == BT_AUDIO_DIR_SINK); - - if (start_stream) { - /* Automatically do the receiver start ready operation */ - /* TODO: This should ideally be done by the upper tester */ - err = bt_bap_stream_start(stream); - if (err != 0) { - LOG_DBG("Failed to start stream %p", stream); + (void)bt_bap_ep_get_info(stream->ep, &info); + (void)bt_conn_get_info(stream->conn, &conn_info); + if (conn_info.role == BT_HCI_ROLE_PERIPHERAL && info.dir == BT_AUDIO_DIR_SINK) { + /* Automatically do the receiver start ready operation */ + /* TODO: This should ideally be done by the upper tester */ + err = bt_bap_stream_start(stream); + if (err != 0) { + LOG_DBG("Failed to start stream %p", stream); - return; - } + return; } } @@ -709,16 +688,12 @@ static void stream_connected_cb(struct bt_bap_stream *stream) } if (ep_info.dir == BT_AUDIO_DIR_SOURCE) { - if (ep_info.state == BT_BAP_EP_STATE_ENABLING) { - /* Automatically do the receiver start ready operation for source - * ASEs as the client when in the enabling state. - * The CIS may be connected in the QoS Configured state as well, in - * which case we should wait until we enter the enabling state. - */ - err = bt_bap_stream_start(stream); - if (err != 0) { - LOG_ERR("Failed to start stream %p", stream); - } + /* Automatically do the receiver start ready operation for source ASEs as + * the client + */ + err = bt_bap_stream_start(stream); + if (err != 0) { + LOG_ERR("Failed to start stream %p", stream); } } else { struct btp_bap_unicast_stream *u_stream = stream_bap_to_unicast(stream); From c9ca72990a400887ca5ec5b07367055fc5a6782d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0968/3334] Revert "[nrf fromtree] tests: Bluetooth: Add ASCS CIS connection events" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 92a5ca0fbdcc7ab14b2a10a80afe7f4ace09186a. Signed-off-by: Tomasz Moń --- .../bluetooth/tester/src/audio/btp/btp_ascs.h | 15 ------- .../tester/src/audio/btp_bap_unicast.c | 44 ------------------- tests/bsim/bluetooth/tester/src/bsim_btp.c | 4 -- 3 files changed, 63 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp/btp_ascs.h b/tests/bluetooth/tester/src/audio/btp/btp_ascs.h index 706e6cad1875..50d3291f76e1 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_ascs.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_ascs.h @@ -117,20 +117,5 @@ struct btp_ascs_ase_state_changed_ev { uint8_t state; } __packed; -#define BTP_ASCS_EV_CIS_CONNECTED 0x83 -struct btp_ascs_cis_connected_ev { - bt_addr_le_t address; - uint8_t ase_id; - uint8_t cis_id; -} __packed; - -#define BTP_ASCS_EV_CIS_DISCONNECTED 0x84 -struct btp_ascs_cis_disconnected_ev { - bt_addr_le_t address; - uint8_t ase_id; - uint8_t cis_id; - uint8_t reason; -} __packed; - #define BTP_ASCS_STATUS_SUCCESS 0x00 #define BTP_ASCS_STATUS_FAILED 0x01 diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index f620c5e418e7..c06795e8267a 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -7,15 +7,12 @@ */ #include -#include #include -#include #include #include #include #include -#include #include #include #include @@ -171,37 +168,6 @@ static void btp_send_ascs_ase_state_changed_ev(struct bt_conn *conn, uint8_t ase tester_event(BTP_SERVICE_ID_ASCS, BTP_ASCS_EV_ASE_STATE_CHANGED, &ev, sizeof(ev)); } -static void btp_send_ascs_cis_connected_ev(const struct bt_bap_stream *stream) -{ - struct btp_bap_unicast_stream *u_stream; - struct btp_ascs_cis_connected_ev ev; - - u_stream = stream_bap_to_unicast(stream); - __ASSERT(u_stream != NULL, "Failed to get unicast_stream from %p", stream); - - bt_addr_le_copy(&ev.address, bt_conn_get_dst(stream->conn)); - ev.ase_id = u_stream->ase_id; - ev.cis_id = u_stream->cis_id; - - tester_event(BTP_SERVICE_ID_ASCS, BTP_ASCS_EV_CIS_CONNECTED, &ev, sizeof(ev)); -} - -static void btp_send_ascs_cis_disconnected_ev(const struct bt_bap_stream *stream, uint8_t reason) -{ - struct btp_bap_unicast_stream *u_stream; - struct btp_ascs_cis_disconnected_ev ev; - - u_stream = stream_bap_to_unicast(stream); - __ASSERT(u_stream != NULL, "Failed to get unicast_stream from %p", stream); - - bt_addr_le_copy(&ev.address, bt_conn_get_dst(stream->conn)); - ev.ase_id = u_stream->ase_id; - ev.cis_id = u_stream->cis_id; - ev.reason = reason; - - tester_event(BTP_SERVICE_ID_ASCS, BTP_ASCS_EV_CIS_DISCONNECTED, &ev, sizeof(ev)); -} - static void btp_send_ascs_operation_completed_ev(struct bt_conn *conn, uint8_t ase_id, uint8_t opcode, uint8_t status) { @@ -703,15 +669,6 @@ static void stream_connected_cb(struct bt_bap_stream *stream) BTP_ASCS_STATUS_SUCCESS); } } - - btp_send_ascs_cis_connected_ev(stream); -} - -static void stream_disconnected_cb(struct bt_bap_stream *stream, uint8_t reason) -{ - LOG_DBG("Disconnected stream %p: 0x%02X", stream, reason); - - btp_send_ascs_cis_disconnected_ev(stream, reason); } static void stream_stopped_cb(struct bt_bap_stream *stream, uint8_t reason) @@ -792,7 +749,6 @@ static struct bt_bap_stream_ops stream_ops = { .recv = stream_recv_cb, .sent = btp_bap_audio_stream_sent_cb, .connected = stream_connected_cb, - .disconnected = stream_disconnected_cb, }; struct btp_bap_unicast_stream *btp_bap_unicast_stream_alloc( diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.c b/tests/bsim/bluetooth/tester/src/bsim_btp.c index eaeaa427a70e..19b196d1fe62 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.c +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.c @@ -1041,10 +1041,6 @@ static bool is_valid_ascs_packet_len(const struct btp_hdr *hdr, struct net_buf_s return buf_simple->len == 0U; case BTP_ASCS_EV_ASE_STATE_CHANGED: return buf_simple->len == sizeof(struct btp_ascs_ase_state_changed_ev); - case BTP_ASCS_EV_CIS_CONNECTED: - return buf_simple->len == sizeof(struct btp_ascs_cis_connected_ev); - case BTP_ASCS_EV_CIS_DISCONNECTED: - return buf_simple->len == sizeof(struct btp_ascs_cis_disconnected_ev); default: LOG_ERR("Unhandled opcode 0x%02X", hdr->opcode); return false; From ac8d5fc16b7a84f5a5cf1845104a5d6cd6461263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0969/3334] Revert "[nrf fromtree] Bluetooth: BAP: Fix bad check for ASE state for CIS connect" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b47a92d7718f67ec748985a6784de2184cb885cf. Signed-off-by: Tomasz Moń --- subsys/bluetooth/audio/bap_unicast_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index d0d9001548dc..429431ada433 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -327,8 +327,8 @@ static void unicast_client_ep_iso_connected(struct bt_bap_ep *ep) ep->unicast_group->has_been_connected = true; } - if (ep->state != BT_BAP_EP_STATE_QOS_CONFIGURED && ep->state != BT_BAP_EP_STATE_ENABLING) { - LOG_DBG("endpoint in invalid state: %s", bt_bap_ep_state_str(ep->state)); + if (ep->state != BT_BAP_EP_STATE_ENABLING) { + LOG_DBG("endpoint not in enabling state: %s", bt_bap_ep_state_str(ep->state)); return; } From 608d00a28dd7a5552d944a150d190153a884da8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0970/3334] Revert "[nrf fromtree] bluetooth: audio: scan_delegator: Reject remove when PA synced" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b866b8b2fd9502e60af5dfa14e8365f0043077cc. Signed-off-by: Tomasz Moń --- subsys/bluetooth/audio/bap_scan_delegator.c | 61 ++++++++++--------- .../audio/src/bap_broadcast_assistant_test.c | 43 +++++++------ .../audio/src/bap_scan_delegator_test.c | 58 +++--------------- 3 files changed, 60 insertions(+), 102 deletions(-) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 5e6f8384ef75..6e3316c28443 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -1051,6 +1051,7 @@ static int scan_delegator_rem_src(struct bt_conn *conn, { struct bass_recv_state_internal *internal_state; struct bt_bap_scan_delegator_recv_state *state; + bool bis_sync_was_requested = false; uint8_t src_id; int err; @@ -1077,40 +1078,38 @@ static int scan_delegator_rem_src(struct bt_conn *conn, state = &internal_state->state; - if (state->pa_sync_state == BT_BAP_PA_STATE_SYNCED) { - LOG_DBG("Cannot remove source ID 0x%02x while PA is synced", state->src_id); - err = k_mutex_unlock(&internal_state->mutex); - __ASSERT(err == 0, "Failed to unlock mutex: %d", err); - /* We shouldn't return a success here, but the Test Spec requires it at the moment, - * Errata to fix this: https://bluetooth.atlassian.net/browse/ES-28445 - */ - return BT_GATT_ERR(BT_ATT_ERR_SUCCESS); + /* If conn == NULL then it's a local operation and we do not need to ask the application */ + if (conn != NULL) { + + if (scan_delegator_cbs != NULL && scan_delegator_cbs->remove_source != NULL) { + err = scan_delegator_cbs->remove_source(conn, src_id); + if (err != 0) { + LOG_DBG("Remove Source rejected with reason 0x%02x", err); + err = k_mutex_unlock(&internal_state->mutex); + __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); + } + } + + if (state->pa_sync_state == BT_BAP_PA_STATE_INFO_REQ || + state->pa_sync_state == BT_BAP_PA_STATE_SYNCED) { + /* Terminate PA sync */ + err = pa_sync_term_request(conn, &internal_state->state); + if (err != 0) { + LOG_DBG("PA sync term from %p was rejected with reason %d", + (void *)conn, err); + err = k_mutex_unlock(&internal_state->mutex); + __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); + } + } } for (uint8_t i = 0U; i < state->num_subgroups; i++) { if (internal_state->requested_bis_sync[i] != 0U && internal_state->state.subgroups[i].bis_sync != 0U) { - LOG_DBG("Cannot remove source ID 0x%02x while BIS is synced", - state->src_id); - err = k_mutex_unlock(&internal_state->mutex); - __ASSERT(err == 0, "Failed to unlock mutex: %d", err); - /* We shouldn't return a success here, but the Test Spec requires it at the - * moment, Errata to fix this: - * https://bluetooth.atlassian.net/browse/ES-28445 - */ - return BT_GATT_ERR(BT_ATT_ERR_SUCCESS); - } - } - - /* If conn == NULL then it's a local operation and we do not need to ask the application */ - if (conn != NULL && scan_delegator_cbs != NULL && - scan_delegator_cbs->remove_source != NULL) { - err = scan_delegator_cbs->remove_source(conn, src_id); - if (err != 0) { - LOG_DBG("Remove Source rejected with reason 0x%02x", err); - err = k_mutex_unlock(&internal_state->mutex); - __ASSERT(err == 0, "Failed to unlock mutex: %d", err); - return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); + bis_sync_was_requested = true; + break; } } @@ -1129,6 +1128,10 @@ static int scan_delegator_rem_src(struct bt_conn *conn, err = k_mutex_unlock(&internal_state->mutex); __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + if (bis_sync_was_requested) { + bis_sync_request_updated(conn, internal_state); + } + /* app callback */ receive_state_updated(conn, internal_state); diff --git a/tests/bsim/bluetooth/audio/src/bap_broadcast_assistant_test.c b/tests/bsim/bluetooth/audio/src/bap_broadcast_assistant_test.c index e9a35e0773c2..5d7d3ab7db8e 100644 --- a/tests/bsim/bluetooth/audio/src/bap_broadcast_assistant_test.c +++ b/tests/bsim/bluetooth/audio/src/bap_broadcast_assistant_test.c @@ -502,7 +502,7 @@ static void test_bass_add_source(void) printk("Source added\n"); } -static void test_bass_mod_source(bool pa_sync, uint32_t bis_sync) +static void test_bass_mod_source(uint32_t bis_sync) { int err; struct bt_bap_broadcast_assistant_mod_src_param mod_src_param = { 0 }; @@ -515,7 +515,7 @@ static void test_bass_mod_source(bool pa_sync, uint32_t bis_sync) UNSET_FLAG(flag_recv_state_updated); mod_src_param.src_id = recv_state.src_id; mod_src_param.num_subgroups = 1; - mod_src_param.pa_sync = pa_sync; + mod_src_param.pa_sync = true; mod_src_param.subgroups = &subgroup; mod_src_param.pa_interval = g_broadcaster_info.interval; subgroup.bis_sync = bis_sync; @@ -542,16 +542,14 @@ static void test_bass_mod_source(bool pa_sync, uint32_t bis_sync) WAIT_FOR_AND_CLEAR_FLAG(flag_recv_state_updated); } - if (pa_sync) { - if (recv_state.pa_sync_state != BT_BAP_PA_STATE_SYNCED) { - FAIL("Unexpected PA sync state: %d\n", recv_state.pa_sync_state); - return; - } + if (recv_state.pa_sync_state != BT_BAP_PA_STATE_SYNCED) { + FAIL("Unexpected PA sync state: %d\n", recv_state.pa_sync_state); + return; + } - if (recv_state.encrypt_state != BT_BAP_BIG_ENC_STATE_NO_ENC) { - FAIL("Unexpected BIG encryption state: %d\n", recv_state.pa_sync_state); - return; - } + if (recv_state.encrypt_state != BT_BAP_BIG_ENC_STATE_NO_ENC) { + FAIL("Unexpected BIG encryption state: %d\n", recv_state.pa_sync_state); + return; } if (recv_state.num_subgroups != mod_src_param.num_subgroups) { @@ -565,15 +563,19 @@ static void test_bass_mod_source(bool pa_sync, uint32_t bis_sync) WAIT_FOR_AND_CLEAR_FLAG(flag_recv_state_updated); } - if (bis_sync != 0) { - remote_bis_sync = recv_state.subgroups[0].bis_sync; + remote_bis_sync = recv_state.subgroups[0].bis_sync; + if (subgroup.bis_sync == 0) { + if (remote_bis_sync != 0U) { + FAIL("Unexpected BIS sync value: %u\n", remote_bis_sync); + return; + } + } else { printk("Waiting for BIS sync\n"); if (remote_bis_sync == 0U && recv_state.encrypt_state == BT_BAP_BIG_ENC_STATE_NO_ENC) { - /* Wait for another notification, which will either request a - * broadcast code for encrypted broadcasts, or have the BIS sync - * values set + /* Wait for another notification, which will either request a broadcast code + * for encrypted broadcasts, or have the BIS sync values set */ printk("Waiting for another receive state update with BIS sync\n"); WAIT_FOR_AND_CLEAR_FLAG(flag_recv_state_updated); @@ -768,15 +770,14 @@ static void test_main_client_sync(void) test_bass_scan_stop(); test_bass_create_pa_sync(); test_bass_add_source(); - test_bass_mod_source(true, 0); + test_bass_mod_source(0); test_bass_mod_source_long_meta(); - test_bass_mod_source(true, BT_ISO_BIS_INDEX_BIT(1) | BT_ISO_BIS_INDEX_BIT(2)); + test_bass_mod_source(BT_ISO_BIS_INDEX_BIT(1) | BT_ISO_BIS_INDEX_BIT(2)); test_bass_broadcast_code(BROADCAST_CODE); printk("Waiting for receive state with BIS sync\n"); WAIT_FOR_FLAG(flag_recv_state_updated_with_bis_sync); - test_bass_mod_source(false, 0); test_bass_remove_source(); PASS("BAP Broadcast Assistant Client Sync Passed\n"); @@ -796,12 +797,11 @@ static void test_main_client_sync_incorrect_code(void) test_bass_scan_stop(); test_bass_create_pa_sync(); test_bass_add_source(); - test_bass_mod_source(true, BT_ISO_BIS_INDEX_BIT(1)); + test_bass_mod_source(BT_ISO_BIS_INDEX_BIT(1)); WAIT_FOR_FLAG(flag_broadcast_code_requested); test_bass_broadcast_code(INCORRECT_BROADCAST_CODE); WAIT_FOR_FLAG(flag_incorrect_broadcast_code); - test_bass_mod_source(false, 0); test_bass_remove_source(); PASS("BAP Broadcast Assistant Client Sync Passed\n"); @@ -825,7 +825,6 @@ static void test_main_server_sync_client_rem(void) WAIT_FOR_FLAG(flag_recv_state_updated_with_bis_sync); printk("Attempting to remove source for the first time\n"); - test_bass_mod_source(false, 0); test_bass_remove_source(); WAIT_FOR_FLAG(flag_remove_source_rejected); diff --git a/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c b/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c index b979464a39a5..ca0e38ec600f 100644 --- a/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c +++ b/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c @@ -213,8 +213,6 @@ static int pa_sync_term(struct sync_state *state) printk("Deleting PA sync\n"); - UNSET_FLAG(flag_pa_terminated); - err = bt_le_per_adv_sync_delete(state->pa_sync); if (err != 0) { FAIL("Could not delete per adv sync: %d\n", err); @@ -223,8 +221,6 @@ static int pa_sync_term(struct sync_state *state) state->pa_sync = NULL; } - WAIT_FOR_FLAG(flag_pa_terminated); - return err; } @@ -712,48 +708,13 @@ static void remove_all_sources(void) printk("[%zu]: Source removed with id %u\n", i, state->src_id); - } - } -} - -static void terminate_all_pa(void) -{ - for (size_t i = 0U; i < ARRAY_SIZE(sync_states); i++) { - int err; - struct sync_state *state = &sync_states[i]; - - if (state->pa_sync == NULL) { - continue; - } - - err = pa_sync_term(state); - if (err != 0) { - FAIL("[%zu]: PA sync term failed (err %d)\n", i, err); - return; - } - } -} -static void set_bis_sync_state(struct sync_state *state, - uint32_t bis_sync_req[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS]) -{ - int err; - - err = bt_bap_scan_delegator_set_bis_sync_state(state->src_id, bis_sync_req); - if (err != 0) { - FAIL("Could not set BIS sync state: %d\n", err); - return; - } -} - -static void set_all_bis_sync_states(uint32_t bis_sync_req[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS]) -{ - for (size_t i = 0U; i < ARRAY_SIZE(sync_states); i++) { - struct sync_state *state = &sync_states[i]; - - if (state->recv_state != NULL) { - printk("[%zu]: Setting BIS sync state\n", i); - set_bis_sync_state(state, bis_sync_req); + printk("Terminating PA sync\n"); + err = pa_sync_term(state); + if (err) { + FAIL("[%zu]: PA sync term failed (err %d)\n", err); + return; + } } } } @@ -953,12 +914,7 @@ static void test_main_server_sync_server_rem(void) /* Set the BIS sync state */ sync_all_broadcasts(); - uint32_t bis_sync_req[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS] = {0}; - - set_all_bis_sync_states(bis_sync_req); - terminate_all_pa(); - - /* Remove all sources, causing PA sync term request to trigger */ + /* Remote all sources, causing PA sync term request to trigger */ remove_all_sources(); /* Wait for PA sync to be terminated */ From 7b74241102785733839f708819296f91074ae9ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0971/3334] Revert "[nrf fromtree] doc: migration guide: Add entry for recent change to BT BAP SD" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 91d4f782001390efea9dfa842c50fdb41cb1d804. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.3.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index e895207d03c3..53e6b64ab72d 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -114,12 +114,6 @@ Bluetooth Audio * Setting the BGS role for GMAP now requires also supporting and implementing the :kconfig:option:`CONFIG_BT_BAP_BROADCAST_ASSISTANT`. See the :zephyr:code-sample:`bluetooth_bap_broadcast_assistant` sample as a reference. -* The BAP Scan Delegator will no longer automatically update the PA sync state, and - :c:func:`bt_bap_scan_delegator_set_pa_state` must be used to update the state. If the - BAP Scan Delegator is used together with the BAP Broadcast Sink, then the PA state of the - receive state of a :c:struct:`bt_bap_broadcast_sink` will still be automatically updated when the - PA state changes. (:github:`95453``) - .. zephyr-keep-sorted-stop From c471fe04a9f34f27eb1584aae516c151c8f17797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0972/3334] Revert "[nrf fromtree] tests: Bluetooth: BAP: SD: Update test to set PA sync state" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 01b99f2f011b87e3cd5158cc257379484b3c63bf. Signed-off-by: Tomasz Moń --- .../audio/src/bap_scan_delegator_test.c | 34 ++----------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c b/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c index ca0e38ec600f..c8f728fa96af 100644 --- a/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c +++ b/tests/bsim/bluetooth/audio/src/bap_scan_delegator_test.c @@ -123,7 +123,6 @@ static void pa_timer_handler(struct k_work *work) if (state->recv_state != NULL) { enum bt_bap_pa_state pa_state; - int err; if (state->recv_state->pa_sync_state == BT_BAP_PA_STATE_INFO_REQ) { pa_state = BT_BAP_PA_STATE_NO_PAST; @@ -131,11 +130,8 @@ static void pa_timer_handler(struct k_work *work) pa_state = BT_BAP_PA_STATE_FAILED; } - err = bt_bap_scan_delegator_set_pa_state(state->recv_state->src_id, pa_state); - if (err != 0) { - FAIL("Could not set PA sync state: %d\n", err); - return; - } + bt_bap_scan_delegator_set_pa_state(state->recv_state->src_id, + pa_state); } FAIL("PA timeout\n"); @@ -290,8 +286,7 @@ static int pa_sync_req_cb(struct bt_conn *conn, err = bt_bap_scan_delegator_set_pa_state(state->recv_state->src_id, BT_BAP_PA_STATE_INFO_REQ); if (err != 0) { - FAIL("Could not set PA sync state: %d\n", err); - return err; + printk("Failed to set INFO_REQ state: %d", err); } } } else { @@ -431,16 +426,6 @@ static void pa_synced_cb(struct bt_le_per_adv_sync *sync, return; } - if (state->recv_state != NULL) { - int err; - - err = bt_bap_scan_delegator_set_pa_state(state->src_id, BT_BAP_PA_STATE_SYNCED); - if (err != 0) { - FAIL("Could not set PA sync state: %d\n", err); - return; - } - } - k_work_cancel_delayable(&state->pa_timer); SET_FLAG(flag_pa_synced); @@ -459,16 +444,6 @@ static void pa_term_cb(struct bt_le_per_adv_sync *sync, return; } - if (state->recv_state != NULL) { - int err; - - err = bt_bap_scan_delegator_set_pa_state(state->src_id, BT_BAP_PA_STATE_NOT_SYNCED); - if (err != 0) { - FAIL("Could not set PA sync state: %d\n", err); - return; - } - } - k_work_cancel_delayable(&state->pa_timer); SET_FLAG(flag_pa_terminated); @@ -566,7 +541,6 @@ static int add_source(struct sync_state *state) bt_addr_le_copy(¶m.addr, &sync_info.addr); param.sid = sync_info.sid; - param.pa_state = BT_BAP_PA_STATE_SYNCED; param.encrypt_state = BT_BAP_BIG_ENC_STATE_NO_ENC; param.broadcast_id = g_broadcast_id; param.num_subgroups = 1U; @@ -683,8 +657,6 @@ static int remove_source(struct sync_state *state) return err; } - state->recv_state = NULL; - WAIT_FOR_FLAG(flag_recv_state_updated); return 0; From a63e86b6a801ce808c13a09c61f62da409d8eafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0973/3334] Revert "[nrf fromtree] Bluetooth: BAP: SD: Remove address lookups" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2ee700271633c02b745c1baa712e8f59c1afcdff. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/audio/bap.h | 10 +- subsys/bluetooth/audio/bap_broadcast_sink.c | 69 ++---- subsys/bluetooth/audio/bap_scan_delegator.c | 257 ++++++++++++++------ 3 files changed, 199 insertions(+), 137 deletions(-) diff --git a/include/zephyr/bluetooth/audio/bap.h b/include/zephyr/bluetooth/audio/bap.h index d480837c9713..27f42432e227 100644 --- a/include/zephyr/bluetooth/audio/bap.h +++ b/include/zephyr/bluetooth/audio/bap.h @@ -2661,6 +2661,8 @@ int bt_bap_scan_delegator_unregister(void); * * @param src_id The source id used to identify the receive state. * @param pa_state The Periodic Advertising sync state to set. + * BT_BAP_PA_STATE_NOT_SYNCED and BT_BAP_PA_STATE_SYNCED is + * not necessary to provide, as they are handled internally. * * @return int Error value. 0 on success, errno on fail. */ @@ -2686,14 +2688,6 @@ struct bt_bap_scan_delegator_add_src_param { /** Advertiser SID */ uint8_t sid; - /** - * @brief Periodic Advertising sync state - * - * This will typically be either @ref BT_BAP_PA_STATE_NOT_SYNCED or - * @ref BT_BAP_PA_STATE_SYNCED. - */ - enum bt_bap_pa_state pa_state; - /** The broadcast isochronous group encryption state */ enum bt_bap_big_enc_state encrypt_state; diff --git a/subsys/bluetooth/audio/bap_broadcast_sink.c b/subsys/bluetooth/audio/bap_broadcast_sink.c index cfe02efd01e6..82106a9dfae5 100644 --- a/subsys/bluetooth/audio/bap_broadcast_sink.c +++ b/subsys/bluetooth/audio/bap_broadcast_sink.c @@ -70,8 +70,8 @@ static struct bt_bap_scan_delegator_mod_src_param mod_src_param; static void broadcast_sink_cleanup(struct bt_bap_broadcast_sink *sink); -static bool find_recv_state_by_src_id_cb(const struct bt_bap_scan_delegator_recv_state *recv_state, - void *user_data) +static bool find_recv_state_by_sink_cb(const struct bt_bap_scan_delegator_recv_state *recv_state, + void *user_data) { const struct bt_bap_broadcast_sink *sink = user_data; @@ -83,27 +83,26 @@ static bool find_recv_state_by_src_id_cb(const struct bt_bap_scan_delegator_recv return false; } -static bool -find_recv_state_by_sink_fields_cb(const struct bt_bap_scan_delegator_recv_state *recv_state, - void *user_data) +static bool find_recv_state_by_pa_sync_cb(const struct bt_bap_scan_delegator_recv_state *recv_state, + void *user_data) { - const struct bt_bap_broadcast_sink *sink = user_data; + struct bt_le_per_adv_sync *sync = user_data; struct bt_le_per_adv_sync_info sync_info; int err; - err = bt_le_per_adv_sync_get_info(sink->pa_sync, &sync_info); + err = bt_le_per_adv_sync_get_info(sync, &sync_info); if (err != 0) { LOG_DBG("Failed to get sync info: %d", err); return false; } - /* BAP 6.5.4 states that the combined Source_Address_Type, Source_Adv_SID, and Broadcast_ID - * fields are what makes a receive state unique. - */ - return recv_state->addr.type == sync_info.addr.type && - recv_state->adv_sid == sync_info.sid && - recv_state->broadcast_id == sink->broadcast_id; + if (bt_addr_le_eq(&recv_state->addr, &sync_info.addr) && + recv_state->adv_sid == sync_info.sid) { + return true; + } + + return false; }; static void update_recv_state_big_synced(const struct bt_bap_broadcast_sink *sink) @@ -111,7 +110,7 @@ static void update_recv_state_big_synced(const struct bt_bap_broadcast_sink *sin const struct bt_bap_scan_delegator_recv_state *recv_state; int err; - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_src_id_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_sink_cb, (void *)sink); if (recv_state == NULL) { LOG_WRN("Failed to find receive state for sink %p", sink); @@ -157,7 +156,7 @@ static void update_recv_state_big_cleared(const struct bt_bap_broadcast_sink *si bool sink_is_streaming = false; int err; - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_src_id_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_sink_cb, (void *)sink); if (recv_state == NULL) { /* This is likely due to the receive state being removed while we are BIG synced */ LOG_DBG("Could not find receive state for sink %p", sink); @@ -490,8 +489,6 @@ static void broadcast_sink_add_src(struct bt_bap_broadcast_sink *sink) bt_addr_le_copy(&add_src_param.addr, &sync_info.addr); add_src_param.sid = sync_info.sid; - /* When a broadcast sink is created we always assume the PA sync provided is synced */ - add_src_param.pa_state = BT_BAP_PA_STATE_SYNCED; add_src_param.broadcast_id = sink->broadcast_id; /* Will be updated when we receive the BASE */ add_src_param.encrypt_state = BT_BAP_BIG_ENC_STATE_NO_ENC; @@ -545,7 +542,7 @@ static void update_recv_state_base(const struct bt_bap_broadcast_sink *sink, const struct bt_bap_scan_delegator_recv_state *recv_state; int err; - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_src_id_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_sink_cb, (void *)sink); if (recv_state == NULL) { LOG_WRN("Failed to find receive state for sink %p", sink); @@ -748,23 +745,12 @@ static void pa_recv(struct bt_le_per_adv_sync *sync, bt_data_parse(buf, pa_decode_base, (void *)sink); } -static void pa_synced_cb(struct bt_le_per_adv_sync *sync, - struct bt_le_per_adv_sync_synced_info *info) -{ - struct bt_bap_broadcast_sink *sink = broadcast_sink_get_by_pa(sync); - - if (sink != NULL) { - bt_bap_scan_delegator_set_pa_state(sink->bass_src_id, BT_BAP_PA_STATE_SYNCED); - } -} - static void pa_term_cb(struct bt_le_per_adv_sync *sync, const struct bt_le_per_adv_sync_term_info *info) { struct bt_bap_broadcast_sink *sink = broadcast_sink_get_by_pa(sync); if (sink != NULL) { - bt_bap_scan_delegator_set_pa_state(sink->bass_src_id, BT_BAP_PA_STATE_NOT_SYNCED); sink->pa_sync = NULL; sink->base_size = 0U; } @@ -777,7 +763,7 @@ static void update_recv_state_encryption(const struct bt_bap_broadcast_sink *sin __ASSERT(sink->big == NULL, "Encryption state shall not be updated while synced"); - recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_src_id_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_sink_cb, (void *)sink); if (recv_state == NULL) { LOG_WRN("Failed to find receive state for sink %p", sink); @@ -1087,8 +1073,8 @@ int bt_bap_broadcast_sink_create(struct bt_le_per_adv_sync *pa_sync, uint32_t br sink->broadcast_id = broadcast_id; sink->pa_sync = pa_sync; - recv_state = - bt_bap_scan_delegator_find_state(find_recv_state_by_sink_fields_cb, (void *)sink); + recv_state = bt_bap_scan_delegator_find_state(find_recv_state_by_pa_sync_cb, + (void *)pa_sync); if (recv_state == NULL) { broadcast_sink_add_src(sink); } else { @@ -1102,26 +1088,8 @@ int bt_bap_broadcast_sink_create(struct bt_le_per_adv_sync *pa_sync, uint32_t br } sink->bass_src_id = recv_state->src_id; - if (recv_state->pa_sync_state != BT_BAP_PA_STATE_SYNCED) { - int err; - - /* When a broadcast sink is created we always assume the PA sync provided is - * synced - */ - err = bt_bap_scan_delegator_set_pa_state(sink->bass_src_id, - BT_BAP_PA_STATE_SYNCED); - if (err != 0) { - LOG_DBG("Failed to set PA state: %d", err); - - broadcast_sink_cleanup(sink); - - return err; - } - } - atomic_set_bit(sink->flags, BT_BAP_BROADCAST_SINK_FLAG_SRC_ID_VALID); } - atomic_set_bit(sink->flags, BT_BAP_BROADCAST_SINK_FLAG_INITIALIZED); *out_sink = sink; @@ -1448,7 +1416,6 @@ int bt_bap_broadcast_sink_delete(struct bt_bap_broadcast_sink *sink) static int broadcast_sink_init(void) { static struct bt_le_per_adv_sync_cb cb = { - .synced = pa_synced_cb, .recv = pa_recv, .biginfo = biginfo_recv, .term = pa_term_cb, diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 6e3316c28443..1be1eec56a82 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -65,7 +65,7 @@ struct bass_recv_state_internal { uint8_t index; struct bt_bap_scan_delegator_recv_state state; uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]; - + struct bt_le_per_adv_sync *pa_sync; /** Requested BIS sync bitfield for each subgroup */ uint32_t requested_bis_sync[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS]; @@ -85,6 +85,7 @@ struct bt_bap_scan_delegator_inst { enum scan_delegator_flag { SCAN_DELEGATOR_FLAG_REGISTERED_CONN_CB, SCAN_DELEGATOR_FLAG_REGISTERED_SCAN_DELIGATOR, + SCAN_DELEGATOR_FLAG_REGISTERED_PA_SYNC_CB, SCAN_DELEGATOR_FLAG_NUM, }; @@ -394,43 +395,27 @@ static struct bass_recv_state_internal *bass_lookup_src_id(uint8_t src_id) return NULL; } -/* BAP 6.5.4 states that the combined Source_Address_Type, Source_Adv_SID, and Broadcast_ID fields - * are what makes a receive state unique. - */ -static struct bass_recv_state_internal *bass_lookup_state(uint8_t addr_type, uint8_t adv_sid, - uint32_t broadcast_id) +static struct bass_recv_state_internal *bass_lookup_pa_sync(struct bt_le_per_adv_sync *sync) { - struct bass_recv_state_internal *res = NULL; - - ARRAY_FOR_EACH_PTR(scan_delegator.recv_states, recv_state_internal) { - int err; - - if (!recv_state_internal->active) { - continue; - } - - err = k_mutex_lock(&recv_state_internal->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); - if (err != 0) { - LOG_DBG("Failed to lock mutex: %d", err); - - return NULL; - } - - if (recv_state_internal->state.addr.type == addr_type && - recv_state_internal->state.adv_sid == adv_sid && - recv_state_internal->state.broadcast_id == broadcast_id) { - res = recv_state_internal; + for (size_t i = 0; i < ARRAY_SIZE(scan_delegator.recv_states); i++) { + if (scan_delegator.recv_states[i].pa_sync == sync) { + return &scan_delegator.recv_states[i]; } + } - err = k_mutex_unlock(&recv_state_internal->mutex); - __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + return NULL; +} - if (res != NULL) { - break; +static struct bass_recv_state_internal *bass_lookup_addr(const bt_addr_le_t *addr) +{ + for (size_t i = 0; i < ARRAY_SIZE(scan_delegator.recv_states); i++) { + if (bt_addr_le_eq(&scan_delegator.recv_states[i].state.addr, + addr)) { + return &scan_delegator.recv_states[i]; } } - return res; + return NULL; } static struct bass_recv_state_internal *get_free_recv_state(void) @@ -447,6 +432,85 @@ static struct bass_recv_state_internal *get_free_recv_state(void) return NULL; } +static void pa_synced(struct bt_le_per_adv_sync *sync, + struct bt_le_per_adv_sync_synced_info *info) +{ + struct bass_recv_state_internal *internal_state; + bool state_changed = false; + int err; + + LOG_DBG("Synced%s", info->conn ? " via PAST" : ""); + + internal_state = bass_lookup_addr(info->addr); + if (internal_state == NULL) { + LOG_DBG("BASS receive state not found"); + return; + } + + err = k_mutex_lock(&internal_state->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); + if (err != 0) { + LOG_DBG("Failed to lock mutex: %d", err); + return; + } + + internal_state->pa_sync = sync; + + if (internal_state->state.pa_sync_state != BT_BAP_PA_STATE_SYNCED) { + internal_state->state.pa_sync_state = BT_BAP_PA_STATE_SYNCED; + set_receive_state_changed(internal_state); + state_changed = true; + } + + err = k_mutex_unlock(&internal_state->mutex); + __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + + if (state_changed) { + /* app callback */ + receive_state_updated(info->conn, internal_state); + } +} + +static void pa_terminated(struct bt_le_per_adv_sync *sync, + const struct bt_le_per_adv_sync_term_info *info) +{ + struct bass_recv_state_internal *internal_state = bass_lookup_pa_sync(sync); + bool state_changed = false; + int err; + + LOG_DBG("Terminated"); + if (internal_state == NULL) { + LOG_DBG("BASS receive state not found"); + return; + } + + err = k_mutex_lock(&internal_state->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); + if (err != 0) { + LOG_DBG("Failed to lock mutex: %d", err); + return; + } + + internal_state->pa_sync = NULL; + + if (internal_state->state.pa_sync_state != BT_BAP_PA_STATE_NOT_SYNCED) { + internal_state->state.pa_sync_state = BT_BAP_PA_STATE_NOT_SYNCED; + set_receive_state_changed(internal_state); + state_changed = true; + } + + err = k_mutex_unlock(&internal_state->mutex); + __ASSERT(err == 0, "Failed to unlock mutex: %d", err); + + if (state_changed) { + /* app callback */ + receive_state_updated(NULL, internal_state); + } +} + +static struct bt_le_per_adv_sync_cb pa_sync_cb = { + .synced = pa_synced, + .term = pa_terminated, +}; + static bool supports_past(struct bt_conn *conn, uint8_t pa_sync_val) { if (IS_ENABLED(CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER)) { @@ -516,12 +580,35 @@ static int pa_sync_term_request(struct bt_conn *conn, return err; } +/* BAP 6.5.4 states that the Broadcast Assistant shall not initiate the Add Source operation + * if the operation would result in duplicate values for the combined Source_Address_Type, + * Source_Adv_SID, and Broadcast_ID fields of any Broadcast Receive State characteristic exposed + * by the Scan Delegator. + */ +static bool bass_source_is_duplicate(uint32_t broadcast_id, uint8_t adv_sid, uint8_t addr_type) +{ + struct bass_recv_state_internal *state; + + for (size_t i = 0; i < ARRAY_SIZE(scan_delegator.recv_states); i++) { + state = &scan_delegator.recv_states[i]; + + if (state != NULL && state->state.broadcast_id == broadcast_id && + state->state.adv_sid == adv_sid && state->state.addr.type == addr_type) { + LOG_DBG("recv_state already exists at src_id=0x%02X", state->state.src_id); + + return true; + } + } + + return false; +} + static int scan_delegator_add_src(struct bt_conn *conn, struct net_buf_simple *buf) { struct bass_recv_state_internal *internal_state = NULL; struct bt_bap_scan_delegator_recv_state *state; - bt_addr_le_t *addr; + bt_addr_t *addr; uint8_t pa_sync; uint16_t pa_interval; uint32_t aggregated_bis_syncs = 0; @@ -530,7 +617,6 @@ static int scan_delegator_add_src(struct bt_conn *conn, uint16_t total_len; struct bt_bap_bass_cp_add_src *add_src; int ret = BT_GATT_ERR(BT_ATT_ERR_SUCCESS); - uint8_t adv_sid; int err; /* subtract 1 as the opcode has already been pulled */ @@ -567,29 +653,6 @@ static int scan_delegator_add_src(struct bt_conn *conn, return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); } - addr = net_buf_simple_pull_mem(buf, sizeof(*addr)); - if (addr->type > BT_ADDR_LE_RANDOM) { - LOG_DBG("Invalid address type %u", addr->type); - return BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); - } - - adv_sid = net_buf_simple_pull_u8(buf); - if (adv_sid > BT_GAP_SID_MAX) { - LOG_DBG("Invalid adv SID %u", adv_sid); - return BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); - } - - broadcast_id = net_buf_simple_pull_le24(buf); - - internal_state = bass_lookup_state(addr->type, adv_sid, broadcast_id); - if (internal_state != NULL) { - LOG_DBG("Adding addr type=0x%02X adv_sid=0x%02X and broadcast_id=0x%06X would " - "result in duplication", - addr->type, adv_sid, broadcast_id); - - return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); - } - internal_state = get_free_recv_state(); if (internal_state == NULL) { LOG_DBG("Could not get free receive state"); @@ -607,8 +670,33 @@ static int scan_delegator_add_src(struct bt_conn *conn, state = &internal_state->state; state->src_id = next_src_id(); - bt_addr_le_copy(&state->addr, addr); - state->adv_sid = adv_sid; + state->addr.type = net_buf_simple_pull_u8(buf); + if (state->addr.type > BT_ADDR_LE_RANDOM) { + LOG_DBG("Invalid address type %u", state->addr.type); + ret = BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); + goto unlock_return; + } + + addr = net_buf_simple_pull_mem(buf, sizeof(*addr)); + bt_addr_copy(&state->addr.a, addr); + + state->adv_sid = net_buf_simple_pull_u8(buf); + if (state->adv_sid > BT_GAP_SID_MAX) { + LOG_DBG("Invalid adv SID %u", state->adv_sid); + ret = BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); + goto unlock_return; + } + + broadcast_id = net_buf_simple_pull_le24(buf); + + if (bass_source_is_duplicate(broadcast_id, state->adv_sid, state->addr.type)) { + LOG_DBG("Adding broadcast_id=0x%06X, adv_sid=0x%02X, and addr.type=0x%02X would " + "result in duplication", state->broadcast_id, state->adv_sid, + state->addr.type); + ret = BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED); + goto unlock_return; + } + state->broadcast_id = broadcast_id; pa_sync = net_buf_simple_pull_u8(buf); @@ -1117,6 +1205,7 @@ static int scan_delegator_rem_src(struct bt_conn *conn, internal_state->index, src_id); internal_state->active = false; + internal_state->pa_sync = NULL; (void)memset(&internal_state->state, 0, sizeof(internal_state->state)); (void)memset(internal_state->broadcast_code, 0, sizeof(internal_state->broadcast_code)); @@ -1365,6 +1454,18 @@ int bt_bap_scan_delegator_register(struct bt_bap_scan_delegator_cb *cb) #endif /* CONFIG_BT_BAP_SCAN_DELEGATOR_RECV_STATE_COUNT > 2 */ #endif /* CONFIG_BT_BAP_SCAN_DELEGATOR_RECV_STATE_COUNT > 1 */ + if (!atomic_test_and_set_bit(scan_delegator_flags, + SCAN_DELEGATOR_FLAG_REGISTERED_PA_SYNC_CB)) { + err = bt_le_per_adv_sync_cb_register(&pa_sync_cb); + if (err) { + atomic_clear_bit(scan_delegator_flags, + SCAN_DELEGATOR_FLAG_REGISTERED_PA_SYNC_CB); + atomic_clear_bit(scan_delegator_flags, + SCAN_DELEGATOR_FLAG_REGISTERED_SCAN_DELIGATOR); + return err; + } + } + for (size_t i = 0; i < ARRAY_SIZE(scan_delegator.recv_states); i++) { struct bass_recv_state_internal *internal_state = &scan_delegator.recv_states[i]; @@ -1551,12 +1652,6 @@ static bool valid_bt_bap_scan_delegator_add_src_param( return false; } - if (!IN_RANGE(param->pa_state, BT_BAP_PA_STATE_NOT_SYNCED, BT_BAP_PA_STATE_NO_PAST)) { - LOG_DBG("Invalid PA state: %d", param->pa_state); - - return false; - } - for (uint8_t i = 0U; i < param->num_subgroups; i++) { const struct bt_bap_bass_subgroup *subgroup = ¶m->subgroups[i]; @@ -1582,19 +1677,23 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par { struct bass_recv_state_internal *internal_state = NULL; struct bt_bap_scan_delegator_recv_state *state; + struct bt_le_per_adv_sync *pa_sync; int err; CHECKIF(!valid_bt_bap_scan_delegator_add_src_param(param)) { return -EINVAL; } - internal_state = bass_lookup_state(param->addr.type, param->sid, param->broadcast_id); - if (internal_state != NULL) { - LOG_DBG("Adding addr.type=0x%02X adv_sid=0x%02X and broadcast_id=0x%06X would " - "result in duplication", - param->addr.type, param->sid, param->broadcast_id); + pa_sync = bt_le_per_adv_sync_lookup_addr(¶m->addr, param->sid); - return -EALREADY; + if (pa_sync != NULL) { + internal_state = bass_lookup_pa_sync(pa_sync); + if (internal_state != NULL) { + LOG_DBG("PA Sync already in a receive state with src_id %u", + internal_state->state.src_id); + + return -EALREADY; + } } internal_state = get_free_recv_state(); @@ -1604,20 +1703,14 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par return -ENOMEM; } - err = k_mutex_lock(&internal_state->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); - if (err != 0) { - LOG_DBG("Failed to lock mutex: %d", err); - - return -EBUSY; - } - state = &internal_state->state; state->src_id = next_src_id(); bt_addr_le_copy(&state->addr, ¶m->addr); state->adv_sid = param->sid; state->broadcast_id = param->broadcast_id; - state->pa_sync_state = param->pa_state; + state->pa_sync_state = + pa_sync == NULL ? BT_BAP_PA_STATE_NOT_SYNCED : BT_BAP_PA_STATE_SYNCED; state->num_subgroups = param->num_subgroups; if (state->num_subgroups > 0U) { (void)memcpy(state->subgroups, param->subgroups, @@ -1626,7 +1719,15 @@ int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_par (void)memset(state->subgroups, 0, sizeof(state->subgroups)); } + err = k_mutex_lock(&internal_state->mutex, SCAN_DELEGATOR_BUF_SEM_TIMEOUT); + if (err != 0) { + LOG_DBG("Failed to lock mutex: %d", err); + + return -EBUSY; + } + internal_state->active = true; + internal_state->pa_sync = pa_sync; /* Set all requested_bis_sync to BT_BAP_BIS_SYNC_NO_PREF, as no * Broadcast Assistant has set any requests yet From 3008fc7c730f4a3591e1d04328217aab152e1500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0974/3334] Revert "[nrf noup] bluetooth: host: Add support for bonding with same peer" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 71ebd2b14110f5d9fa3cd23873df0d25c276611b. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/bluetooth.h | 10 -- subsys/bluetooth/host/Kconfig | 18 --- subsys/bluetooth/host/adv.c | 52 ------- subsys/bluetooth/host/adv.h | 1 - subsys/bluetooth/host/hci_core.h | 23 +-- subsys/bluetooth/host/id.c | 219 +++------------------------ subsys/bluetooth/host/id.h | 23 --- subsys/bluetooth/host/keys.c | 79 +--------- subsys/bluetooth/host/keys.h | 6 - subsys/bluetooth/host/smp.c | 18 +-- tests/bluetooth/host/id/mocks/adv.c | 1 - tests/bluetooth/host/id/mocks/adv.h | 4 +- tests/bluetooth/host/id/mocks/keys.c | 1 - tests/bluetooth/host/id/mocks/keys.h | 4 +- 14 files changed, 32 insertions(+), 427 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 0739733c9543..8e738d21970d 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1295,10 +1295,6 @@ struct bt_le_per_adv_param { * This error code is only guaranteed when using Zephyr * controller, for other controllers code returned in * this case may be -EIO. - * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and - * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable - * advertising is requested, and the given local identity has a conflicting - * key with another local identity for which advertising is already started. */ int bt_le_adv_start(const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, @@ -1426,12 +1422,6 @@ struct bt_le_ext_adv_start_param { * * @param adv Advertising set object. * @param param Advertise start parameters. - * - * @return Zero on success or (negative) error code otherwise. - * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and - * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable - * advertising is requested, and the given local identity has a conflicting - * key with another local identity for which advertising is already started. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, const struct bt_le_ext_adv_start_param *param); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index e4a381e9b05a..7306cde7328f 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -659,24 +659,6 @@ config BT_ID_UNPAIR_MATCHING_BONDS link-layer. The Host does not have control over this acknowledgment, and the order of distribution is fixed by the specification. -config BT_ID_AUTO_SWAP_MATCHING_BONDS - bool "Automatically swap conflicting entries in the Resolving List" - depends on !BT_ID_UNPAIR_MATCHING_BONDS - depends on BT_SMP && BT_PERIPHERAL && !BT_CENTRAL - help - If this option is enabled, the Host will not add a new bond with - the same peer address (or IRK) to the Resolving List if there is - already a bond with the same peer address (or IRK) on another local - identity. - - In case of Peripheral, the Host will swap the existing entry in the - Resolving List with the new one, so that the new bond will be used for - address resolution for the new local identity if the device starts - advertising with the new local identity. - - Important: this option is supported exclusively in the Peripheral - role. Excluding the Central role. - config BT_ID_ALLOW_UNAUTH_OVERWRITE bool "Allow unauthenticated pairing with same peer with other local identity" depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 3a17a7192535..e4ad43bea565 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -234,25 +234,6 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) #endif /* CONFIG_BT_BROADCASTER */ #endif /* defined(CONFIG_BT_EXT_ADV) */ -struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id) -{ -#if defined(CONFIG_BT_EXT_ADV) - for (size_t i = 0; i < ARRAY_SIZE(adv_pool); i++) { - if (atomic_test_bit(adv_pool[i].flags, BT_ADV_CREATED) && - adv_pool[i].id == id) { - return &adv_pool[i]; - } - } -#else - if (atomic_test_bit(bt_dev.adv.flags, BT_ADV_CREATED) && bt_dev.adv.id == id) { - return &bt_dev.adv; - } -#endif - - return NULL; -} - - void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), void *data) { @@ -948,14 +929,6 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, adv->id = param->id; bt_dev.adv_conn_id = adv->id; - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - err = bt_id_resolving_list_check_and_update(adv->id, param->peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - err = bt_id_set_adv_own_addr(adv, param->options, dir_adv, &set_param.own_addr_type); if (err) { @@ -1239,15 +1212,6 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } adv->id = param->id; - - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - err = bt_id_resolving_list_check_and_update(adv->id, param->peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - err = le_ext_adv_param_set(adv, param, sd != NULL); if (err) { return err; @@ -1535,22 +1499,6 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, return -EALREADY; } - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - const bt_addr_le_t *peer; - - if (bt_addr_le_eq(&adv->target_addr, BT_ADDR_LE_ANY)) { - peer = NULL; - } else { - peer = &adv->target_addr; - } - - err = bt_id_resolving_list_check_and_update(adv->id, peer); - if (err) { - LOG_ERR("Failed to check and update resolving list: %d", err); - return err; - } - } - if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index a6f7007f64b4..6cc950fe8e7f 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -23,4 +23,3 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable); int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv); void bt_adv_reset_adv_pool(void); -struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index e17277ba4da2..e4a390af20aa 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -497,28 +497,7 @@ struct bt_keys; void bt_id_add(struct bt_keys *keys); void bt_id_del(struct bt_keys *keys); -/** @brief Find a conflict in the resolving list for a candidate IRK. - * - * @param candidate The candidate keys to check for conflicts. - * @param all If true, check all IRKs, otherwise check only added keys. - * - * @return The conflicting key if there is one, or NULL if no conflict was found. - */ -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool all); - -/** * @brief Find multiple conflicts in the resolving list for a candidate IRK. - * - * This function iterates over all keys (added and not added to the Resolving List). If there are - * multiple conflicts, this function will return true. Otherwise, it will return false. - * - * If @c firt_conflict is not NULL, it will be set to the first found conflict. - * - * @param candidate The candidate key to check for conflicts. - * @param first_conflict Pointer to store the first found conflict, if any. Can be NULL. - * - * @return True if there are multiple conflicts, otherwise it returns false. - */ -bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict); +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate); int bt_setup_random_id_addr(void); int bt_setup_public_id_addr(void); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 4c54460ab4df..0ed84dff7331 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -941,33 +941,9 @@ void bt_id_pending_keys_update(void) } } -static bool keys_conflict_check(const struct bt_keys *candidate, const struct bt_keys *resident) -{ - bool addr_conflict; - bool irk_conflict; - - addr_conflict = bt_addr_le_eq(&candidate->addr, &resident->addr); - - /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ - irk_conflict = (!bt_irk_eq(&candidate->irk, &(struct bt_irk){}) && - bt_irk_eq(&candidate->irk, &resident->irk)); - - if (addr_conflict || irk_conflict) { - LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val))); - LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&candidate->addr), - bt_hex(candidate->irk.val, sizeof(candidate->irk.val))); - - return true; - } - - return false; -} - struct bt_id_conflict { struct bt_keys *candidate; struct bt_keys *found; - bool check_all_irk; }; /* The Controller Resolve List is constrained by 7.8.38 "LE Add Device To @@ -979,6 +955,8 @@ struct bt_id_conflict { static void find_rl_conflict(struct bt_keys *resident, void *user_data) { struct bt_id_conflict *conflict = user_data; + bool addr_conflict; + bool irk_conflict; __ASSERT_NO_MSG(conflict != NULL); __ASSERT_NO_MSG(conflict->candidate != NULL); @@ -991,26 +969,32 @@ static void find_rl_conflict(struct bt_keys *resident, void *user_data) } /* Test against committed bonds only. */ - if (!conflict->check_all_irk && (resident->state & BT_KEYS_ID_ADDED) == 0) { - /* If the resident bond is not committed, we cannot have a conflict. */ + if ((resident->state & BT_KEYS_ID_ADDED) == 0) { return; } - if (resident->id == conflict->candidate->id) { - /* If the IDs are the same, we cannot have a conflict. */ - return; - } + addr_conflict = bt_addr_le_eq(&conflict->candidate->addr, &resident->addr); + + /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ + irk_conflict = (!bt_irk_eq(&conflict->candidate->irk, &(struct bt_irk){}) && + bt_irk_eq(&conflict->candidate->irk, &resident->irk)); + + if (addr_conflict || irk_conflict) { + LOG_DBG("Resident : addr %s and IRK %s, id: %d", bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val)), resident->id); + LOG_DBG("Candidate: addr %s and IRK %s, id: %d", + bt_addr_le_str(&conflict->candidate->addr), + bt_hex(conflict->candidate->irk.val, sizeof(conflict->candidate->irk.val)), + conflict->candidate->id); - if (keys_conflict_check(conflict->candidate, resident)) { conflict->found = resident; } } -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_irk) +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) { struct bt_id_conflict conflict = { .candidate = candidate, - .check_all_irk = check_all_irk, }; bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict, &conflict); @@ -1018,59 +1002,6 @@ struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_ir return conflict.found; } -struct bt_id_conflict_multiple { - struct bt_keys *candidate; - struct bt_keys *found; - bool found_multiple; -}; - -void find_rl_conflict_multiple(struct bt_keys *resident, void *user_data) -{ - struct bt_id_conflict_multiple *conflict = user_data; - - __ASSERT_NO_MSG(conflict != NULL); - __ASSERT_NO_MSG(conflict->candidate != NULL); - __ASSERT_NO_MSG(resident != NULL); - - if (conflict->found_multiple) { - /* If we already found enough conflicts, we can stop searching. */ - return; - } - - if (resident->id == conflict->candidate->id) { - /* If the IDs are the same, we cannot have a conflict. */ - return; - } - - if (keys_conflict_check(conflict->candidate, resident)) { - if (conflict->found) { - conflict->found_multiple = true; - - LOG_WRN("Found multiple conflicts for %s: addr %s and IRK %s", - bt_addr_le_str(&conflict->candidate->addr), - bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val))); - } else { - conflict->found = resident; - } - } -} - -bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict) -{ - struct bt_id_conflict_multiple conflict = { - .candidate = candidate, - }; - - bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict_multiple, &conflict); - - if (first_conflict != NULL) { - *first_conflict = conflict.found; - } - - return conflict.found_multiple; -} - void bt_id_add(struct bt_keys *keys) { CHECKIF(keys == NULL) { @@ -1333,122 +1264,6 @@ void bt_id_del(struct bt_keys *keys) bt_le_ext_adv_foreach(adv_unpause_enabled, NULL); } } - -static int conflict_check_and_replace(uint8_t id, struct bt_keys *keys) -{ - /* For the given key check if it has conflicts with other keys in the Resolving List - * (such keys have BT_KEYS_ID_ADDED state and BT_KEYS_ID_CONFLICT flag set). If it does, we - * need to remove the conflicting key from the Resolving List and add the new key. - * - * If the key is not in the Resolving List, we can add the new key right away. - * - * If advertiser for the conflicting key is enabled, we cannot remove the key from the - * Resolving List, so we return an error. - */ - - struct bt_keys *conflict; - const struct bt_le_ext_adv *adv; - - if (!(keys->flags & BT_KEYS_ID_CONFLICT)) { - LOG_DBG("Key has no conflicts for id %u addr %s", id, bt_addr_le_str(&keys->addr)); - return 0; - } - - if (keys->state & BT_KEYS_ID_ADDED) { - LOG_DBG("Key is already added to resolving list for id %u addr %s", id, - bt_addr_le_str(&keys->addr)); - return 0; - } - - /* bt_id_find_conflict returns only keys added to the Resolving List (state is - * BT_KEYS_ID_ADDED). If the key has conflict, but no keys were added (for example, if the - * last added key was removed after bt_unpair()), then this function will return NULL. Then, - * we don't need to remove a conflicting key from the Resolving List. Otherwise, we need to - * remove the conflicting key from the Resolving List before adding the new key. - */ - conflict = bt_id_find_conflict(keys, false); - if (conflict != NULL) { - __ASSERT_NO_MSG((conflict->flags & BT_KEYS_ID_CONFLICT) != 0); - - LOG_DBG("Found conflicting key with id %u addr %s", conflict->id, - bt_addr_le_str(&conflict->addr)); - - adv = bt_adv_lookup_by_id(conflict->id); - if (adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { - LOG_WRN("Cannot remove the conflicting key from the Resolving List while" - " advertising"); - return -EPERM; - } - - /* Drop BT_KEYS_ID_PENDING_DEL flag if we were about to delete the keys since we - * delete it here. - */ - conflict->state &= ~BT_KEYS_ID_PENDING_DEL; - bt_id_del(conflict); - } - - bt_id_add(keys); - - return 0; -} - -struct bt_id_resolve { - uint8_t id; - int err; -}; - -static void check_and_add_keys_for_id(struct bt_keys *keys, void *data) -{ - struct bt_id_resolve *resolve = data; - - if (resolve->err) { - /* Skipping other keys because we got error. */ - return; - } - - if (resolve->id != keys->id) { - /* We are only interested in keys for the given id */ - return; - } - - resolve->err = conflict_check_and_replace(resolve->id, keys); -} - -int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer) -{ - int err; - - if (peer == NULL) { - struct bt_id_resolve resolve = { - .id = id, - }; - - LOG_DBG("Updating resolving list for id %u without peer address", id); - - bt_keys_foreach_type(BT_KEYS_IRK, check_and_add_keys_for_id, &resolve); - err = resolve.err; - } else { - struct bt_keys *keys; - - LOG_DBG("Updating resolving list for id %u addr %s", id, bt_addr_le_str(peer)); - - keys = bt_keys_get_addr(id, peer); - if (!keys) { - LOG_DBG("No keys found for id %u addr %s", id, bt_addr_le_str(peer)); - return -ENOENT; - } - - err = conflict_check_and_replace(id, keys); - } - - if (err) { - LOG_ERR("Failed to update resolving list for id %u addr %s (err %d)", id, - peer ? bt_addr_le_str(peer) : "NULL", err); - return err; - } - - return err; -} #endif /* defined(CONFIG_BT_SMP) */ void bt_id_get(bt_addr_le_t *addrs, size_t *count) diff --git a/subsys/bluetooth/host/id.h b/subsys/bluetooth/host/id.h index cd66784a5037..8824d3bb496b 100644 --- a/subsys/bluetooth/host/id.h +++ b/subsys/bluetooth/host/id.h @@ -60,26 +60,3 @@ void bt_id_pending_keys_update(void); void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag); void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv); - -/** - * @brief Check and update the resolving list for a given identity. - * - * This function checks if the resolving list contains the keys for the given - * identity and peer address. If the keys are not present, it adds them to the - * resolving list. If the keys are present, it checks for conflicts with - * existing keys in the resolving list. If a conflict is found, it replaces - * the conflicting key with the new key. - * - * If the peer address is NULL, it updates the resolving list for all keys that belong to the given - * identity. - * - * If for any of the keys belonging to the given identity a conflict is found and the advertiser for - * that key is enabled, the function returns an error. - * - * @param id The identity ID to check and update. - * @param peer The peer address to check against the resolving list. - * - * @return 0 on success, or a negative error code on failure. - * @return -EPERM if a conflict is found and the advertiser for the conflicting key is enabled. - */ -int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer); diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 4707a2e0fe23..0ab157599408 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -310,57 +310,16 @@ void bt_keys_add_type(struct bt_keys *keys, enum bt_keys_type type) keys->keys |= type; } -static void add_id_cb(struct k_work *work) -{ - bt_id_pending_keys_update(); -} - -static K_WORK_DEFINE(add_id_work, add_id_cb); - void bt_keys_clear(struct bt_keys *keys) { - struct bt_keys *conflict = NULL; - __ASSERT_NO_MSG(keys != NULL); LOG_DBG("%s (keys 0x%04x)", bt_addr_le_str(&keys->addr), keys->keys); - if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && - (keys->flags & BT_KEYS_ID_CONFLICT) != 0) { - /* We need to check how many conflicting keys left. If there is only one conflicting - * key left, we can remove the BT_KEYS_ID_CONFLICT flag from it so that Host don't - * need to check and update the Resolving List whenever this is needed. The key - * should be re-added to the Resolving List. - */ - bool found_multiple; - - found_multiple = bt_id_find_conflict_multiple(keys, &conflict); - if (conflict) { - if (found_multiple || (conflict->state & BT_KEYS_ID_ADDED) != 0) { - /* If we found multiple conflicting keys or the conflicting key - * is already added to the ID list, we don't need to clear the - * conflict flag for it and re-add it to the Resolving List. - */ - conflict = NULL; - } else { - /* Clear the conflict flag for the conflicting key */ - conflict->flags &= ~BT_KEYS_ID_CONFLICT; - } - } - } - if (keys->state & BT_KEYS_ID_ADDED) { bt_id_del(keys); } - if (conflict) { - /* Re-add the conflicting key to the Resolving List if it was the last conflicting - * key. - */ - bt_id_pending_keys_update_set(conflict, BT_KEYS_ID_PENDING_ADD); - k_work_submit(&add_id_work); - } - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { /* Delete stored keys from flash */ bt_settings_delete_keys(keys->id, &keys->addr); @@ -388,28 +347,6 @@ int bt_keys_store(struct bt_keys *keys) return 0; } -static void check_and_set_id_conflict_flag(struct bt_keys *keys) -{ - struct bt_keys *conflict; - - if (!IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - /* If auto-swap is not enabled, we don't need to check for conflicts */ - return; - } - - /* Use bt_id_find_conflict() to check if there are any conflicting keys for the given keys. - * If there is at least one, set the BT_KEYS_ID_CONFLICT flag for both the keys and the - * conflicting key. - */ - conflict = bt_id_find_conflict(keys, true); - if (conflict != NULL) { - LOG_DBG("Found conflicting key %p.", conflict); - - keys->flags |= BT_KEYS_ID_CONFLICT; - conflict->flags |= BT_KEYS_ID_CONFLICT; - } -} - static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { @@ -502,8 +439,6 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, keys->flags &= ~BT_KEYS_AUTHENTICATED; } - check_and_set_id_conflict_flag(keys); - LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { @@ -513,17 +448,17 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return 0; } +static void add_id_cb(struct k_work *work) +{ + bt_id_pending_keys_update(); +} + +static K_WORK_DEFINE(add_id_work, add_id_cb); + static void id_add(struct bt_keys *keys, void *user_data) { __ASSERT_NO_MSG(keys != NULL); - if (keys->flags & BT_KEYS_ID_CONFLICT) { - /* If the keys have the conflict flag set, we don't want to add them to the ID list, - * as this will cause issues with resolving list. - */ - return; - } - bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD); k_work_submit(&add_id_work); } diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index 90c0c92e9de0..ab83aff8ebf0 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -45,12 +45,6 @@ enum { /* Bit 2 and 3 might accidentally exist in old stored keys */ BT_KEYS_SC = BIT(4), BT_KEYS_OOB = BIT(5), - /** Indicates that the keys are in conflict with existing keys. - * - * This is used to indicate that the keys being added conflict with - * existing keys from different identity. - */ - BT_KEYS_ID_CONFLICT = BIT(6), }; struct bt_ltk { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 11fa7a4361f3..1a5592d1d6c2 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -924,7 +924,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) bt_id_del(keys); } - conflict = bt_id_find_conflict(keys, false); + conflict = bt_id_find_conflict(keys); if (conflict != NULL) { int err; @@ -934,7 +934,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) __ASSERT_NO_MSG(!err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(keys, false)); + __ASSERT_NO_MSG(!bt_id_find_conflict(keys)); bt_id_add(keys); } @@ -4135,24 +4135,16 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) */ __ASSERT_NO_MSG(!(smp->remote_dist & BT_SMP_DIST_ID_KEY)); - conflict = bt_id_find_conflict(new_bond, IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)); + conflict = bt_id_find_conflict(new_bond); if (conflict) { LOG_DBG("New bond conflicts with a bond on id %d.", conflict->id); } - if (conflict && !IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && - !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { + if (conflict && !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { LOG_WRN("Refusing new pairing. The old bond must be unpaired first."); return BT_SMP_ERR_AUTH_REQUIREMENTS; } - if (conflict && IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { - LOG_WRN("Conflict detected with %p. Don't add key to Resolve List.", conflict); - new_bond->flags |= BT_KEYS_ID_CONFLICT; - conflict->flags |= BT_KEYS_ID_CONFLICT; - return 0; - } - if (conflict && IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { bool trust_ok; int unpair_err; @@ -4169,7 +4161,7 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) __ASSERT_NO_MSG(!unpair_err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond, false)); + __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond)); bt_id_add(new_bond); return 0; } diff --git a/tests/bluetooth/host/id/mocks/adv.c b/tests/bluetooth/host/id/mocks/adv.c index a22123dea3da..2c2d4f3f3c7a 100644 --- a/tests/bluetooth/host/id/mocks/adv.c +++ b/tests/bluetooth/host/id/mocks/adv.c @@ -15,4 +15,3 @@ DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv *, DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DEFINE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); -DEFINE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/adv.h b/tests/bluetooth/host/id/mocks/adv.h index 1602ddf47185..bfb744001596 100644 --- a/tests/bluetooth/host/id/mocks/adv.h +++ b/tests/bluetooth/host/id/mocks/adv.h @@ -18,8 +18,7 @@ typedef void (*bt_le_ext_adv_foreach_cb)(struct bt_le_ext_adv *adv, void *data); FAKE(bt_le_adv_lookup_legacy) \ FAKE(bt_le_ext_adv_get_index) \ FAKE(bt_le_adv_set_enable_ext) \ - FAKE(bt_le_ext_adv_foreach) \ - FAKE(bt_adv_lookup_by_id) + FAKE(bt_le_ext_adv_foreach) DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable, struct bt_le_ext_adv *, bool); DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_le_adv_lookup_legacy); @@ -28,4 +27,3 @@ DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv * DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DECLARE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); -DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/keys.c b/tests/bluetooth/host/id/mocks/keys.c index 61f73569c469..f885ab875c0f 100644 --- a/tests/bluetooth/host/id/mocks/keys.c +++ b/tests/bluetooth/host/id/mocks/keys.c @@ -10,4 +10,3 @@ DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DEFINE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); -DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); diff --git a/tests/bluetooth/host/id/mocks/keys.h b/tests/bluetooth/host/id/mocks/keys.h index 1912472b78de..b6901e315ab9 100644 --- a/tests/bluetooth/host/id/mocks/keys.h +++ b/tests/bluetooth/host/id/mocks/keys.h @@ -15,9 +15,7 @@ typedef void (*bt_keys_foreach_type_cb)(struct bt_keys *keys, void *data); /* List of fakes used by this unit tester */ #define KEYS_FFF_FAKES_LIST(FAKE) \ FAKE(bt_keys_find_irk) \ - FAKE(bt_keys_foreach_type) \ - FAKE(bt_keys_get_addr) + FAKE(bt_keys_foreach_type) DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DECLARE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); -DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); From 88a6709cf281a6de622841a1976ceb5a2fc14f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0975/3334] Revert "[nrf fromtree] Bluetooth: Host: Add legacy pairing test config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e4c1b245a2babc9e1792d9be86536f03f3fb7126. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/Kconfig | 9 --------- subsys/bluetooth/host/smp.c | 11 +++++------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 7306cde7328f..8920d41d0e07 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -1120,15 +1120,6 @@ config BT_CONN_DISABLE_SECURITY WARNING: This option enables anyone to snoop on-air traffic. Use of this feature in production is strongly discouraged. -config BT_SMP_LEGACY_PAIR_ONLY - bool "Force legacy pairing" - depends on BT_TESTING - depends on !(BT_SMP_SC_PAIR_ONLY || BT_SMP_SC_ONLY) - help - This option enforces legacy pairing. This is required for testing - legacy pairing between two Zephyr Bluetooth devices, as without this - option the devices will default to using Secure Connections pairing. - rsource "./classic/Kconfig" config BT_HCI_VS_EVT_USER diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 1a5592d1d6c2..94e38d766897 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -92,21 +92,21 @@ LOG_MODULE_REGISTER(bt_smp); #if defined(CONFIG_BT_CLASSIC) #define BT_SMP_AUTH_MASK_SC 0x2f -#if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) || defined(CONFIG_BT_SMP_LEGACY_PAIR_ONLY) +#if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) #define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_CT2) #else #define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_CT2 |\ BT_SMP_AUTH_SC) -#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY || CONFIG_BT_SMP_LEGACY_PAIR_ONLY */ +#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ #else #define BT_SMP_AUTH_MASK_SC 0x0f -#if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) || defined(CONFIG_BT_SMP_LEGACY_PAIR_ONLY) +#if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) #define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS) #else #define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_SC) -#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY || CONFIG_BT_SMP_LEGACY_PAIR_ONLY */ +#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ #endif /* CONFIG_BT_CLASSIC */ @@ -321,8 +321,7 @@ static struct { static bool le_sc_supported(void) { - if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) || - IS_ENABLED(CONFIG_BT_SMP_LEGACY_PAIR_ONLY)) { + if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY)) { return false; } From 5f884c27294eb3d0ea2c1432128e4547bf04f7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0976/3334] Revert "[nrf fromtree] Bluetooth: Host: Legacy passkey entry 6.2 update" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ec3c2845820e9d3ed864a493c4afae5136020c5d. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.4.rst | 4 ---- subsys/bluetooth/host/keys.c | 12 ------------ subsys/bluetooth/host/smp.c | 25 ++++++++----------------- 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 762082635b1c..554607e5f857 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -43,10 +43,6 @@ Bluetooth Host * :c:member:`bt_conn_le_info.interval` has been deprecated. Use :c:member:`bt_conn_le_info.interval_us` instead. Note that the units have changed: ``interval`` was in units of 1.25 milliseconds, while ``interval_us`` is in microseconds. -* Legacy Bluetooth LE pairing using the passkey entry method no longer grants authenticated (MITM) - protection as of the Bluetooth Core Specification v6.2. Stored bonds that were generated using - this method will be downgraded to unauthenticated when loaded from persistent storage, resulting - in a lower security level. Networking ********** diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 0ab157599408..1205494e856f 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -427,18 +427,6 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, memcpy(keys->storage_start, val, len); } - /* As of Core v6.2, authenticated keys are only valid for OOB or LE SC pairing - * methods. This check ensures that keys are valid if a device is updated from a - * previous version that did not enforce this requirement. - */ - if ((keys->flags & BT_KEYS_AUTHENTICATED) && - !((keys->flags & BT_KEYS_OOB) || (keys->flags & BT_KEYS_SC))) { - LOG_WRN("The keys for %s are downgraded to unauthenticated as they no longer meet " - "authentication requirements", - bt_addr_le_str(&addr)); - keys->flags &= ~BT_KEYS_AUTHENTICATED; - } - LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 94e38d766897..b935c61d2a36 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -666,9 +666,7 @@ static bool update_keys_check(struct bt_smp *smp, struct bt_keys *keys) } if ((keys->flags & BT_KEYS_AUTHENTICATED) && - ((smp->method == JUST_WORKS) || - (!atomic_test_bit(smp->flags, SMP_FLAG_SC) && - (smp->method == PASSKEY_DISPLAY || smp->method == PASSKEY_INPUT)))) { + smp->method == JUST_WORKS) { return false; } @@ -2493,12 +2491,11 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) * Fail if we have keys that are stronger than keys that will be * distributed in new pairing. This is to avoid replacing authenticated * keys with unauthenticated ones. - */ + */ keys = bt_keys_find_addr(conn->id, &conn->le.dst); if (keys && (keys->flags & BT_KEYS_AUTHENTICATED) && - (smp->method == JUST_WORKS || smp->method == PASSKEY_DISPLAY || - smp->method == PASSKEY_INPUT)) { - LOG_ERR("Pairing failed, authenticated keys present"); + smp->method == JUST_WORKS) { + LOG_ERR("JustWorks failed, authenticated keys present"); return BT_SMP_ERR_UNSPECIFIED; } @@ -2986,9 +2983,7 @@ static uint8_t remote_sec_level_reachable(struct bt_smp *smp) } __fallthrough; case BT_SECURITY_L3: - if (smp->method == JUST_WORKS || - (!atomic_test_bit(smp->flags, SMP_FLAG_SC) && - (smp->method == PASSKEY_DISPLAY || smp->method == PASSKEY_INPUT))) { + if (smp->method == JUST_WORKS) { return BT_SMP_ERR_AUTH_REQUIREMENTS; } @@ -6324,16 +6319,12 @@ void bt_smp_update_keys(struct bt_conn *conn) case LE_SC_OOB: case LEGACY_OOB: conn->le.keys->flags |= BT_KEYS_OOB; - conn->le.keys->flags |= BT_KEYS_AUTHENTICATED; - break; + /* fallthrough */ case PASSKEY_DISPLAY: case PASSKEY_INPUT: case PASSKEY_CONFIRM: - if (atomic_test_bit(smp->flags, SMP_FLAG_SC)) { - conn->le.keys->flags |= BT_KEYS_AUTHENTICATED; - break; - } - /* fallthrough */ + conn->le.keys->flags |= BT_KEYS_AUTHENTICATED; + break; case JUST_WORKS: default: /* unauthenticated key, clear it */ From 4002036c1af7d6e60c499eaa4bd1af02376fed15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0977/3334] Revert "[nrf fromtree] nordic: nrf54h: bicr: allow for custom bicr.json in application" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 716d6a7b2ef73958d914d1f3377a95650689e71f. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/bicr/CMakeLists.txt | 8 +------- soc/nordic/nrf54h/bicr/Kconfig | 9 --------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/soc/nordic/nrf54h/bicr/CMakeLists.txt b/soc/nordic/nrf54h/bicr/CMakeLists.txt index 0f7cfb33dd1e..a93e36abbd26 100644 --- a/soc/nordic/nrf54h/bicr/CMakeLists.txt +++ b/soc/nordic/nrf54h/bicr/CMakeLists.txt @@ -1,14 +1,8 @@ if(CONFIG_SOC_NRF54H20_GENERATE_BICR) - set(bicr_json_file ${BOARD_DIR}/${CONFIG_SOC_NRF54H20_BICR_NAME}) + set(bicr_json_file ${BOARD_DIR}/bicr.json) set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex) set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk/nrf54h20_application.svd) - set(app_bicr_json_file ${APPLICATION_SOURCE_DIR}/${CONFIG_SOC_NRF54H20_BICR_NAME}) - if(EXISTS ${app_bicr_json_file}) - set(bicr_json_file ${app_bicr_json_file}) - endif() - - message(STATUS "Found BICR: ${bicr_json_file}") if(EXISTS ${bicr_json_file}) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${bicr_json_file}) diff --git a/soc/nordic/nrf54h/bicr/Kconfig b/soc/nordic/nrf54h/bicr/Kconfig index c6cc4d7c9d2d..a1ba7d2400c3 100644 --- a/soc/nordic/nrf54h/bicr/Kconfig +++ b/soc/nordic/nrf54h/bicr/Kconfig @@ -8,12 +8,3 @@ config SOC_NRF54H20_GENERATE_BICR help This option generates a BICR file for the board being used. Board directory must contain a "bicr.json" file for this option to work. - -config SOC_NRF54H20_BICR_NAME - string "Name of nRF54H20 BICR file to use" - depends on SOC_NRF54H20_GENERATE_BICR - default "bicr.json" - help - The file will be searched for in application folder first, then - board folder if not found. The application can select a bicr by - setting CONFIG_SOC_NRF54H20_BICR_NAME="some_bicr.json" From 83fdae643494519fcd48d136aa08fee7c5558092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0978/3334] Revert "[nrf fromtree] modules: hostap: Add interface arg to cli commands" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f316ea6f7080c448f423f68b44a0f6fe78d7f455. Signed-off-by: Tomasz Moń --- modules/hostap/src/hapd_api.c | 2 +- modules/hostap/src/wpa_cli.c | 124 +++++----------------------------- 2 files changed, 18 insertions(+), 108 deletions(-) diff --git a/modules/hostap/src/hapd_api.c b/modules/hostap/src/hapd_api.c index 7cdbc89eba86..e9decd25b921 100644 --- a/modules/hostap/src/hapd_api.c +++ b/modules/hostap/src/hapd_api.c @@ -376,7 +376,7 @@ bool hostapd_ap_reg_domain(const struct device *dev, return false; } - return hostapd_cli_cmd_v("set country_code %s", reg_domain->country_code); + return hostapd_cli_cmd_v(iface->ctrl_conn, "set country_code %s", reg_domain->country_code); } static int hapd_config_chan_center_seg0(struct hostapd_iface *iface, diff --git a/modules/hostap/src/wpa_cli.c b/modules/hostap/src/wpa_cli.c index 27bcc6efc3bb..0e1b41728b74 100644 --- a/modules/hostap/src/wpa_cli.c +++ b/modules/hostap/src/wpa_cli.c @@ -9,11 +9,9 @@ */ #include -#include #include #include #include -#include #include @@ -23,64 +21,28 @@ #include "wpa_supplicant_i.h" #include "wpa_cli_zephyr.h" #ifdef CONFIG_WIFI_NM_HOSTAPD_AP -#include "hostapd.h" -#include "hapd_main.h" #include "hostapd_cli_zephyr.h" #endif -static int cmd_wpa_cli(const struct shell *sh, size_t argc, const char *argv[]) +static int cmd_wpa_cli(const struct shell *sh, + size_t argc, + const char *argv[]) { - struct net_if *iface = NULL; + struct net_if *iface = net_if_get_first_wifi(); char if_name[CONFIG_NET_INTERFACE_NAME_LEN + 1]; struct wpa_supplicant *wpa_s = NULL; - size_t arg_offset = 1; - int idx = -1; - bool iface_found = false; - - if (argc > 2 && - ((strcmp(argv[1], "-i") == 0) || - (strncmp(argv[1], "-i", 2) == 0 && argv[1][2] != '\0'))) { - /* Handle both "-i 2" and "-i2" */ - if (strcmp(argv[1], "-i") == 0) { - idx = strtol(argv[2], NULL, 10); - arg_offset = 3; - } else { - idx = strtol(&argv[1][2], NULL, 10); - arg_offset = 2; - } - iface = net_if_get_by_index(idx); - if (!iface) { - shell_error(sh, "Interface index %d not found", idx); - return -ENODEV; - } - net_if_get_name(iface, if_name, sizeof(if_name)); - if_name[sizeof(if_name) - 1] = '\0'; - iface_found = true; - } else { - /* Default to first Wi-Fi interface */ - iface = net_if_get_first_wifi(); - if (!iface) { - shell_error(sh, "No Wi-Fi interface found"); - return -ENOENT; - } - net_if_get_name(iface, if_name, sizeof(if_name)); - if_name[sizeof(if_name) - 1] = '\0'; - arg_offset = 1; - iface_found = true; - } - if (!iface_found) { - shell_error(sh, "No interface found"); - return -ENODEV; + ARG_UNUSED(sh); + + if (iface == NULL) { + shell_error(sh, "No Wifi interface found"); + return -ENOENT; } + net_if_get_name(iface, if_name, sizeof(if_name)); wpa_s = zephyr_get_handle_by_ifname(if_name); - if (!wpa_s) { - shell_error(sh, "No wpa_supplicant context for interface '%s'", if_name); - return -ENODEV; - } - if (argc <= arg_offset) { + if (argc == 1) { shell_error(sh, "Missing argument"); return -EINVAL; } @@ -89,65 +51,15 @@ static int cmd_wpa_cli(const struct shell *sh, size_t argc, const char *argv[]) argc++; /* Remove wpa_cli from the argument list */ - return zephyr_wpa_ctrl_zephyr_cmd(wpa_s->ctrl_conn, argc - arg_offset, &argv[arg_offset]); + return zephyr_wpa_ctrl_zephyr_cmd(wpa_s->ctrl_conn, argc - 1, &argv[1]); } #ifdef CONFIG_WIFI_NM_HOSTAPD_AP static int cmd_hostapd_cli(const struct shell *sh, size_t argc, const char *argv[]) { - struct net_if *iface = NULL; - size_t arg_offset = 1; - struct hostapd_iface *hapd_iface; - int idx = -1; - bool iface_found = false; - char if_name[CONFIG_NET_INTERFACE_NAME_LEN + 1]; - int ret; - - if (argc > 2 && - ((strcmp(argv[1], "-i") == 0) || - (strncmp(argv[1], "-i", 2) == 0 && argv[1][2] != '\0'))) { - /* Handle both "-i 2" and "-i2" */ - if (strcmp(argv[1], "-i") == 0) { - idx = strtol(argv[2], NULL, 10); - arg_offset = 3; - } else { - idx = strtol(&argv[1][2], NULL, 10); - arg_offset = 2; - } - iface = net_if_get_by_index(idx); - if (!iface) { - shell_error(sh, "Interface index %d not found", idx); - return -ENODEV; - } - iface_found = true; - } else { - iface = net_if_get_first_wifi(); - if (!iface) { - shell_error(sh, "No Wi-Fi interface found"); - return -ENOENT; - } - arg_offset = 1; - iface_found = true; - } - - if (!iface_found) { - shell_error(sh, "No interface found"); - return -ENODEV; - } - - ret = net_if_get_name(iface, if_name, sizeof(if_name)); - if (!ret) { - shell_error(sh, "Cannot get interface name (%d)", ret); - return -ENODEV; - } - - hapd_iface = zephyr_get_hapd_handle_by_ifname(if_name); - if (!hapd_iface) { - shell_error(sh, "No hostapd context for interface '%s'", if_name); - return -ENODEV; - } + ARG_UNUSED(sh); - if (argc <= arg_offset) { + if (argc == 1) { shell_error(sh, "Missing argument"); return -EINVAL; } @@ -156,8 +68,7 @@ static int cmd_hostapd_cli(const struct shell *sh, size_t argc, const char *argv argc++; /* Remove hostapd_cli from the argument list */ - return zephyr_hostapd_ctrl_zephyr_cmd(hapd_iface->ctrl_conn, argc - arg_offset, - &argv[arg_offset]); + return zephyr_hostapd_ctrl_zephyr_cmd(argc - 1, &argv[1]); } #endif @@ -166,10 +77,9 @@ static int cmd_hostapd_cli(const struct shell *sh, size_t argc, const char *argv */ SHELL_CMD_REGISTER(wpa_cli, NULL, - "wpa_cli [-i idx] (only for internal use)", + "wpa_cli commands (only for internal use)", cmd_wpa_cli); #ifdef CONFIG_WIFI_NM_HOSTAPD_AP -SHELL_CMD_REGISTER(hostapd_cli, NULL, - "hostapd_cli [-i idx] (only for internal use)", +SHELL_CMD_REGISTER(hostapd_cli, NULL, "hostapd_cli commands (only for internal use)", cmd_hostapd_cli); #endif From 159487b19f55609af523b29e8059ab9e63c06d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0979/3334] Revert "[nrf fromtree] modules: hostap: Use per-interface control connection" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5fb9d91bc21801dce0e9808d789197657fa3bd9e. Signed-off-by: Tomasz Moń --- modules/hostap/src/hapd_api.c | 20 +++++--------------- modules/hostap/src/hapd_api.h | 4 +--- modules/hostap/src/supp_api.c | 2 +- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/modules/hostap/src/hapd_api.c b/modules/hostap/src/hapd_api.c index e9decd25b921..97367d35c531 100644 --- a/modules/hostap/src/hapd_api.c +++ b/modules/hostap/src/hapd_api.c @@ -38,7 +38,7 @@ static struct wifi_enterprise_creds_params hapd_enterprise_creds; #define hostapd_cli_cmd_v(cmd, ...) ({ \ bool status; \ \ - if (zephyr_hostapd_cli_cmd_v(iface->ctrl_conn, cmd, ##__VA_ARGS__) < 0) { \ + if (zephyr_hostapd_cli_cmd_v(cmd, ##__VA_ARGS__) < 0) { \ wpa_printf(MSG_ERROR, \ "Failed to execute wpa_cli command: %s", \ cmd); \ @@ -365,22 +365,12 @@ int hostapd_add_enterprise_creds(const struct device *dev, } #endif -bool hostapd_ap_reg_domain(const struct device *dev, - struct wifi_reg_domain *reg_domain) +bool hostapd_ap_reg_domain(struct wifi_reg_domain *reg_domain) { - struct hostapd_iface *iface; - - iface = get_hostapd_handle(dev); - if (iface == NULL) { - wpa_printf(MSG_ERROR, "Interface %s not found", dev->name); - return false; - } - - return hostapd_cli_cmd_v(iface->ctrl_conn, "set country_code %s", reg_domain->country_code); + return hostapd_cli_cmd_v("set country_code %s", reg_domain->country_code); } -static int hapd_config_chan_center_seg0(struct hostapd_iface *iface, - struct wifi_connect_req_params *params) +static int hapd_config_chan_center_seg0(struct wifi_connect_req_params *params) { int ret = 0; uint8_t center_freq_seg0_idx = 0; @@ -482,7 +472,7 @@ int hapd_config_network(struct hostapd_iface *iface, goto out; } - ret = hapd_config_chan_center_seg0(iface, params); + ret = hapd_config_chan_center_seg0(params); if (ret) { goto out; } diff --git a/modules/hostap/src/hapd_api.h b/modules/hostap/src/hapd_api.h index 3fa0e7963fcb..cc6f1fe74010 100644 --- a/modules/hostap/src/hapd_api.h +++ b/modules/hostap/src/hapd_api.h @@ -25,11 +25,9 @@ int hostapd_ap_config_params(const struct device *dev, struct wifi_ap_config_par * @brief Set Wi-Fi AP region domain * * @param reg_domain region domain parameters - * @param dev Wi-Fi device * @return true for OK; false for ERROR */ -bool hostapd_ap_reg_domain(const struct device *dev, - struct wifi_reg_domain *reg_domain); +bool hostapd_ap_reg_domain(struct wifi_reg_domain *reg_domain); #ifdef CONFIG_WIFI_NM_HOSTAPD_WPS /** Start AP WPS PBC/PIN diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 1b3f19b4c1c1..c905fc4cfbcf 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -1749,7 +1749,7 @@ int supplicant_reg_domain(const struct device *dev, } if (IS_ENABLED(CONFIG_WIFI_NM_HOSTAPD_AP)) { - if (!hostapd_ap_reg_domain(dev, reg_domain)) { + if (!hostapd_ap_reg_domain(reg_domain)) { goto out; } } From a36929d4ea9cfa36cfba9dbe94bfe658df3073ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:32 +0100 Subject: [PATCH 0980/3334] Revert "[nrf fromtree] doc: wifi: Add server certificate domain validation instructions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 17cb7cc9c694aeecfa4a65e41052969cd6cfc02b. Signed-off-by: Tomasz Moń --- doc/connectivity/networking/api/wifi.rst | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/doc/connectivity/networking/api/wifi.rst b/doc/connectivity/networking/api/wifi.rst index e0be44835443..65cc7d9502d8 100644 --- a/doc/connectivity/networking/api/wifi.rst +++ b/doc/connectivity/networking/api/wifi.rst @@ -120,29 +120,6 @@ To initiate a Wi-Fi connection using enterprise security, use one of the followi Server certificate is also provided in the same directory for testing purposes. Any AAA server can be used for testing purposes, for example, ``FreeRADIUS`` or ``hostapd``. -Server certificate domain name verification -------------------------------------------- - -The authentication server’s identity is verified by validating the domain name in the X.509 certificate received from the server, using the ``Common Name`` (CN) field. - -* Exact domain match — Verifies that the certificate’s CN exactly matches the specified domain. - -* Domain suffix match — Allows a certificate whose CN ends with the specified domain suffix. - -To initiate a Wi-Fi connection using enterprise security with server certificate validation, use one of the following commands, depending on the desired validation mode: - -* Exact domain match - - .. code-block:: console - - wifi connect -s -c -k 12 -K -e - -* Domain suffix match - - .. code-block:: console - - wifi connect -s -c -k 12 -K -x - Certificate requirements for EAP methods ---------------------------------------- From 25c5fe99d89da1d0ee52515187537e0fed02834e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0981/3334] Revert "[nrf fromtree] net: l2: wifi: Handle domain match and suffix match parameters" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9a2ff83f08d96df16e93d9258eaa4b25b2c9a4fc. Signed-off-by: Tomasz Moń --- include/zephyr/net/wifi_mgmt.h | 10 ---------- modules/hostap/src/supp_api.c | 16 ---------------- subsys/net/l2/wifi/wifi_shell.c | 16 +--------------- 3 files changed, 1 insertion(+), 41 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 703f634209d2..a9dbd74607ca 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -716,16 +716,6 @@ struct wifi_connect_req_params { uint8_t ignore_broadcast_ssid; /** Parameter used for frequency band */ enum wifi_frequency_bandwidths bandwidth; - - /** Full domain name to verify in the server certificate */ - const uint8_t *server_cert_domain_exact; - /** Length of the server_cert_domain_exact string, maximum 128 bytes */ - uint8_t server_cert_domain_exact_len; - - /** Domain name suffix to verify in the server certificate */ - const uint8_t *server_cert_domain_suffix; - /** Length of the server_cert_domain_suffix string, maximum 64 bytes */ - uint8_t server_cert_domain_suffix_len; }; /** @brief Wi-Fi disconnect reason codes. To be overlaid on top of \ref wifi_status diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index c905fc4cfbcf..7f9993bed2dc 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -969,22 +969,6 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, goto out; } - if (params->server_cert_domain_exact_len > 0) { - if (!wpa_cli_cmd_v("set_network %d domain_match \"%s\"", - resp.network_id, - params->server_cert_domain_exact)) { - goto out; - } - } - - if (params->server_cert_domain_suffix_len > 0) { - if (!wpa_cli_cmd_v("set_network %d domain_suffix_match \"%s\"", - resp.network_id, - params->server_cert_domain_suffix)) { - goto out; - } - } - if (false == ((params->security == WIFI_SECURITY_TYPE_EAP_PEAP_MSCHAPV2 || params->security == WIFI_SECURITY_TYPE_EAP_TTLS_MSCHAPV2) && (!params->verify_peer_cert))) { diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 5a90d2ccf4c4..555358aff0a9 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -620,8 +620,6 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv {"ignore-broadcast-ssid", required_argument, 0, 'g'}, {"ieee-80211r", no_argument, 0, 'R'}, {"iface", required_argument, 0, 'i'}, - {"server-cert-domain-exact", required_argument, 0, 'e'}, - {"server-cert-domain-suffix", required_argument, 0, 'x'}, {"help", no_argument, 0, 'h'}, {0, 0, 0, 0}}; char *endptr; @@ -874,16 +872,6 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv case 'i': /* Unused, but parsing to avoid unknown option error */ break; - case 'e': - params->server_cert_domain_exact = state->optarg; - params->server_cert_domain_exact_len = - strlen(params->server_cert_domain_exact); - break; - case 'x': - params->server_cert_domain_suffix = state->optarg; - params->server_cert_domain_suffix_len = - strlen(params->server_cert_domain_suffix); - break; case 'h': return -ENOEXEC; default: @@ -3933,12 +3921,10 @@ SHELL_SUBCMD_ADD((wifi), connect, NULL, "[-P, --eap-pwd1]: Client Password.\n" "Default no password for eap user.\n" "[-R, --ieee-80211r]: Use IEEE80211R fast BSS transition connect." - "[-e, --server-cert-domain-exact]: Full domain names for server certificate match.\n" - "[-x, --server-cert-domain-suffix]: Domain name suffixes for server certificate match.\n" "[-h, --help]: Print out the help for the connect command.\n" "[-i, --iface=] : Interface index.\n", cmd_wifi_connect, - 2, 46); + 2, 42); SHELL_SUBCMD_ADD((wifi), disconnect, NULL, "Disconnect from the Wi-Fi AP.\n" From 6a51ea1c0fbd5db4bcb1fdce1042464204762e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0982/3334] Revert "[nrf fromtree] manifest: hostap: Enable server certificate verification" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f484e15e4bb0c5c9bd4061f26989e1443a679b4a. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index a00bfc9e1318..9aba75719c07 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 6086dea5ee7406e1eede7f2ca6dff1b00b0f04e2 + revision: cf05f33f594de6b62840a3b0dd435f10467a2e4c - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 30cb10a5a4fe8d93b563912b6a081c81a7db2418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0983/3334] Revert "[nrf fromtree] manifest: hostap: Pull fix for SoftAP start" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f4d338c4005a561fee7b174f9c85086e9d95f9fb. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 9aba75719c07..82ac520eca10 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: cf05f33f594de6b62840a3b0dd435f10467a2e4c + revision: ca77ec50a01a09b8bf149160308736b6b5741f12 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 188ca002b4f0ba272a1e07039f047b9643d29fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0984/3334] Revert "[nrf fromtree] manifest: update hostap to fix EAP-FAST connection issue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 988e3bd0c4bc27dff9b4a02c37252ca6c8d7e810. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 82ac520eca10..42ef14c26e21 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: ca77ec50a01a09b8bf149160308736b6b5741f12 + revision: 3ec675be30c25b56cc0e7dbd5bd931a87d32937e - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From bc8ddcea6e03100999993fac7bc1779955a151bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0985/3334] Revert "[nrf fromtree] manifest: update hostap revision for bgscan fix" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 18a4e244df9eb85a12c71822ae0b4aab73441df7. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 42ef14c26e21..1ac6629e2e8f 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 3ec675be30c25b56cc0e7dbd5bd931a87d32937e + revision: 61182a45fecafaa0f20e98ca7f862d26fbf65293 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From e06e062733442d3f9f353d975c779ba2b7223418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0986/3334] Revert "[nrf fromtree] manifest: update hostap module to correct time.h and signal.h paths" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 394001496836c8293627e8780c4b199385c9f207. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 1ac6629e2e8f..4b5a35fc3ea5 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 61182a45fecafaa0f20e98ca7f862d26fbf65293 + revision: 0798bf0faff40919bd577f1c8f75a2f9baae6299 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From db57dd47d2623e3ceba7a375200ae692aa735d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0987/3334] Revert "[nrf fromtree] modules: hostap: Update WPA supplicant to use per-VIF control channel" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d8f071f29e9138a553983c340ce92748db786ca6. Signed-off-by: Tomasz Moń --- modules/hostap/src/supp_api.c | 38 +++++++++++++++++----------------- modules/hostap/src/supp_main.h | 2 ++ modules/hostap/src/wpa_cli.c | 21 +------------------ 3 files changed, 22 insertions(+), 39 deletions(-) diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 7f9993bed2dc..8ae45d6db2af 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -80,19 +80,20 @@ static void supp_shell_connect_status(struct k_work *work); static K_WORK_DELAYABLE_DEFINE(wpa_supp_status_work, supp_shell_connect_status); -#define wpa_cli_cmd_v(cmd, ...) \ - ({ \ - bool status; \ - \ - if (zephyr_wpa_cli_cmd_v(wpa_s->ctrl_conn, cmd, ##__VA_ARGS__) < 0) { \ - wpa_printf(MSG_ERROR, "Failed to execute wpa_cli command: %s", cmd); \ - status = false; \ - } else { \ - status = true; \ - } \ - \ - status; \ - }) +#define wpa_cli_cmd_v(cmd, ...) ({ \ + bool status; \ + \ + if (zephyr_wpa_cli_cmd_v(cmd, ##__VA_ARGS__) < 0) { \ + wpa_printf(MSG_ERROR, \ + "Failed to execute wpa_cli command: %s", \ + cmd); \ + status = false; \ + } else { \ + status = true; \ + } \ + \ + status; \ +}) static struct wpa_supplicant *get_wpa_s_handle(const struct device *dev) { @@ -625,7 +626,7 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, goto out; } - ret = z_wpa_ctrl_add_network(wpa_s->ctrl_conn, &resp); + ret = z_wpa_ctrl_add_network(&resp); if (ret) { wpa_printf(MSG_ERROR, "Failed to add network"); goto out; @@ -1364,7 +1365,7 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status status->channel = channel; if (ssid_len == 0) { - int _res = z_wpa_ctrl_status(wpa_s->ctrl_conn, &cli_status); + int _res = z_wpa_ctrl_status(&cli_status); if (_res < 0) { ssid_len = 0; @@ -1393,7 +1394,7 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status status->rssi = -WPA_INVALID_NOISE; if (status->iface_mode == WIFI_MODE_INFRA) { - ret = z_wpa_ctrl_signal_poll(wpa_s->ctrl_conn, &signal_poll); + ret = z_wpa_ctrl_signal_poll(&signal_poll); if (!ret) { status->rssi = signal_poll.rssi; status->current_phy_tx_rate = signal_poll.current_txrate; @@ -2006,7 +2007,7 @@ static int supplicant_wps_pin(const struct device *dev, struct wifi_wps_config_p } if (params->oper == WIFI_WPS_PIN_GET) { - if (zephyr_wpa_cli_cmd_resp(wpa_s->ctrl_conn, get_pin_cmd, params->pin)) { + if (zephyr_wpa_cli_cmd_resp(get_pin_cmd, params->pin)) { goto out; } } else if (params->oper == WIFI_WPS_PIN_SET) { @@ -2439,7 +2440,6 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa { int ret; char *cmd = NULL; - struct wpa_supplicant *wpa_s = get_wpa_s_handle(dev); if (params == NULL) { return -EINVAL; @@ -2458,7 +2458,7 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa } wpa_printf(MSG_DEBUG, "wpa_cli %s", cmd); - if (zephyr_wpa_cli_cmd_resp(wpa_s->ctrl_conn, cmd, params->resp)) { + if (zephyr_wpa_cli_cmd_resp(cmd, params->resp)) { os_free(cmd); return -ENOEXEC; } diff --git a/modules/hostap/src/supp_main.h b/modules/hostap/src/supp_main.h index 2b2d5fc61112..60ac642f9c79 100644 --- a/modules/hostap/src/supp_main.h +++ b/modules/hostap/src/supp_main.h @@ -58,6 +58,8 @@ struct wpa_supplicant *zephyr_get_handle_by_ifname(const char *ifname); struct hapd_interfaces *zephyr_get_default_hapd_context(void); #endif +struct wpa_supplicant *zephyr_get_handle_by_ifname(const char *ifname); + struct wpa_supplicant_event_msg { #ifdef CONFIG_WIFI_NM_HOSTAPD_AP int hostapd; diff --git a/modules/hostap/src/wpa_cli.c b/modules/hostap/src/wpa_cli.c index 0e1b41728b74..406008da101a 100644 --- a/modules/hostap/src/wpa_cli.c +++ b/modules/hostap/src/wpa_cli.c @@ -8,17 +8,10 @@ * @brief wpa_cli implementation for Zephyr OS */ -#include #include #include -#include #include - -#include "supp_main.h" - -#include "common.h" -#include "wpa_supplicant_i.h" #include "wpa_cli_zephyr.h" #ifdef CONFIG_WIFI_NM_HOSTAPD_AP #include "hostapd_cli_zephyr.h" @@ -28,20 +21,8 @@ static int cmd_wpa_cli(const struct shell *sh, size_t argc, const char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); - char if_name[CONFIG_NET_INTERFACE_NAME_LEN + 1]; - struct wpa_supplicant *wpa_s = NULL; - ARG_UNUSED(sh); - if (iface == NULL) { - shell_error(sh, "No Wifi interface found"); - return -ENOENT; - } - - net_if_get_name(iface, if_name, sizeof(if_name)); - wpa_s = zephyr_get_handle_by_ifname(if_name); - if (argc == 1) { shell_error(sh, "Missing argument"); return -EINVAL; @@ -51,7 +32,7 @@ static int cmd_wpa_cli(const struct shell *sh, argc++; /* Remove wpa_cli from the argument list */ - return zephyr_wpa_ctrl_zephyr_cmd(wpa_s->ctrl_conn, argc - 1, &argv[1]); + return zephyr_wpa_ctrl_zephyr_cmd(argc - 1, &argv[1]); } #ifdef CONFIG_WIFI_NM_HOSTAPD_AP From b18fa94902d930c44d5179083e48e9134db6da2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0988/3334] Revert "[nrf fromtree] manifest: hostap: Pull hostap changes required for multiple VIF" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 93e60488de31bdc85dba3f6fcffc54b775dc6485. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4b5a35fc3ea5..88b61440d420 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 0798bf0faff40919bd577f1c8f75a2f9baae6299 + revision: f707b19c1733ebe401a50450494e5ebdd2e71b5f - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 3c245f42ac92e13de55c73af5aaf1500a0508b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0989/3334] Revert "[nrf fromtree] samples: net: wifi: Add TLSv1.3 support in wifi example" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 235a1903d7e777c9cc88a25135322dd290e50184. Signed-off-by: Tomasz Moń --- modules/hostap/CMakeLists.txt | 4 ---- modules/hostap/Kconfig | 8 -------- west.yml | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index f3233bb2cfbb..5c750f545d2e 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -572,10 +572,6 @@ zephyr_library_compile_definitions_ifdef(CONFIG_EAP_FAST EAP_FAST ) -zephyr_library_compile_definitions_ifdef(CONFIG_EAP_TLSV1_3 - EAP_TLSV1_3 -) - zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_EAPOL ${HOSTAP_SRC_BASE}/eapol_supp/eapol_supp_sm.c ${HOSTAP_SRC_BASE}/eap_peer/eap.c diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 7799239a2840..1aa21670bb71 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -299,14 +299,6 @@ config EAP_ALL select EAP_TTLS select EAP_MSCHAPV2 default y - -config EAP_TLSV1_3 - bool "EAP TLSv1.3 support" - select MBEDTLS_TLS_VERSION_1_3 - select MBEDTLS_TLS_SESSION_TICKETS - select MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED - select MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED - select MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED endif # WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE config WIFI_NM_WPA_SUPPLICANT_WPA3 diff --git a/west.yml b/west.yml index 88b61440d420..1bff38e1c7b8 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: f707b19c1733ebe401a50450494e5ebdd2e71b5f + revision: 5abcff1c0ecff65f0f81e0cc086b7f766e5101bf - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 570dfc9798a51cb1bf57a9509a59d60dcc3e73c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0990/3334] Revert "[nrf fromtree] scripts: west: nrfutil: Use build dir to store generated json" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9b0a06ea1e410aa33173e39f50315f9db7081e23. Signed-off-by: Tomasz Moń --- scripts/west_commands/runners/nrfutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index 051a686f5a1a..5770cf86fae4 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -152,7 +152,7 @@ def _append_batch(self, op, json_file): def _exec_batch(self): # Use x-append-batch to get the JSON from nrfutil itself - json_file = Path(self.cfg.build_dir) / 'zephyr' / 'generated_nrfutil_batch.json' + json_file = Path(self.hex_).parent / 'generated_nrfutil_batch.json' json_file.unlink(missing_ok=True) for op in self._ops: self._append_batch(op, json_file) From 8b669110313735ed2f9be34f56ec7a18e837e1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0991/3334] Revert "[nrf fromtree] scripts: runners: Enable reusing the core dry run logic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c21478a922dd6af7f1f3651026297714d2ca21aa. Signed-off-by: Tomasz Moń --- scripts/west_commands/runners/core.py | 13 +++++-------- scripts/west_commands/runners/nrfutil.py | 12 +++++++++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/west_commands/runners/core.py b/scripts/west_commands/runners/core.py index a47f76f1e9e0..0efd4c3fb163 100644 --- a/scripts/west_commands/runners/core.py +++ b/scripts/west_commands/runners/core.py @@ -493,9 +493,6 @@ def __init__(self, cfg: RunnerConfig): self.logger = logging.getLogger(f'runners.{self.name()}') '''logging.Logger for this instance.''' - self.dry_run = _DRY_RUN - '''log commands instead of executing them. Can be set by subclasses''' - @staticmethod def get_runners() -> list[type['ZephyrBinaryRunner']]: '''Get a list of all currently defined runner classes.''' @@ -870,7 +867,7 @@ def run_client(self, client, **kwargs): def _log_cmd(self, cmd: list[str]): escaped = ' '.join(shlex.quote(s) for s in cmd) - if not self.dry_run: + if not _DRY_RUN: self.logger.debug(escaped) else: self.logger.info(escaped) @@ -883,7 +880,7 @@ def call(self, cmd: list[str], **kwargs) -> int: using subprocess directly, to keep accurate debug logs. ''' self._log_cmd(cmd) - if self.dry_run: + if _DRY_RUN: return 0 return subprocess.call(cmd, **kwargs) @@ -895,7 +892,7 @@ def check_call(self, cmd: list[str], **kwargs): using subprocess directly, to keep accurate debug logs. ''' self._log_cmd(cmd) - if self.dry_run: + if _DRY_RUN: return subprocess.check_call(cmd, **kwargs) @@ -907,7 +904,7 @@ def check_output(self, cmd: list[str], **kwargs) -> bytes: using subprocess directly, to keep accurate debug logs. ''' self._log_cmd(cmd) - if self.dry_run: + if _DRY_RUN: return b'' return subprocess.check_output(cmd, **kwargs) @@ -928,7 +925,7 @@ def popen_ignore_int(self, cmd: list[str], **kwargs) -> subprocess.Popen: preexec = os.setsid # type: ignore self._log_cmd(cmd) - if self.dry_run: + if _DRY_RUN: return _DebugDummyPopen() # type: ignore return subprocess.Popen(cmd, creationflags=cflags, preexec_fn=preexec, **kwargs) diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index 5770cf86fae4..f5be3ac8eb01 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -5,10 +5,12 @@ '''Runner for flashing with nrfutil.''' import json +import shlex import subprocess import sys from pathlib import Path +from runners.core import _DRY_RUN from runners.nrf_common import NrfBinaryRunner @@ -68,10 +70,14 @@ def _exec(self, args, force=False): jout_all = [] cmd = ['nrfutil', '--json', 'device'] + args - self._log_cmd(cmd) - if self.dry_run and not force: - return {} + escaped = ' '.join(shlex.quote(s) for s in cmd) + if _DRY_RUN or (self.dry_run): + self.logger.info(escaped) + if not force: + return {} + else: + self.logger.debug(escaped) with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p: for line in iter(p.stdout.readline, b''): From 5ec4be5c90b0d7585d0d08bcc4c926f89ff02dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0992/3334] Revert "[nrf fromtree] scripts: runners: Generalize the --dry-run option" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8b5c61292d55ce9f5a319586206ee59b025465a3. Signed-off-by: Tomasz Moń --- scripts/west_commands/runners/core.py | 7 ------- scripts/west_commands/runners/nrf_common.py | 4 ++-- scripts/west_commands/runners/nrfutil.py | 6 +++++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/west_commands/runners/core.py b/scripts/west_commands/runners/core.py index 0efd4c3fb163..611848f671cd 100644 --- a/scripts/west_commands/runners/core.py +++ b/scripts/west_commands/runners/core.py @@ -318,7 +318,6 @@ class RunnerCaps: hide_load_files: bool = False rtt: bool = False # This capability exists separately from the rtt command # to allow other commands to use the rtt address - dry_run: bool = False def __post_init__(self): if self.mult_dev_ids and not self.dev_id: @@ -640,10 +639,6 @@ def add_parser(cls, parser): else: parser.add_argument('--rtt-address', help=argparse.SUPPRESS) - parser.add_argument('--dry-run', action='store_true', - help=('''Print all the commands without actually - executing them''' if caps.dry_run else argparse.SUPPRESS)) - # Runner-specific options. cls.do_add_parser(parser) @@ -690,8 +685,6 @@ def create(cls, cfg: RunnerConfig, _missing_cap(cls, '--file-type') if args.rtt_address and not caps.rtt: _missing_cap(cls, '--rtt-address') - if args.dry_run and not caps.dry_run: - _missing_cap(cls, '--dry-run') ret = cls.do_create(cfg, args) if args.erase: diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index 5cdca1e6b3f6..75ad66aed99f 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -75,10 +75,10 @@ def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, self.tool_opt += opts @classmethod - def _capabilities(cls, mult_dev_ids=False, dry_run=False): + def _capabilities(cls, mult_dev_ids=False): return RunnerCaps(commands={'flash'}, dev_id=True, mult_dev_ids=mult_dev_ids, erase=True, reset=True, - tool_opt=True, dry_run=dry_run) + tool_opt=True) @classmethod def _dev_id_help(cls) -> str: diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index f5be3ac8eb01..9deb32e06a02 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -37,7 +37,7 @@ def name(cls): @classmethod def capabilities(cls): - return NrfBinaryRunner._capabilities(mult_dev_ids=True, dry_run=True) + return NrfBinaryRunner._capabilities(mult_dev_ids=True) @classmethod def dev_id_help(cls) -> str: @@ -65,6 +65,10 @@ def do_add_parser(cls, parser): parser.add_argument('--ext-mem-config-file', required=False, dest='ext_mem_config_file', help='path to an JSON file with external memory configuration') + parser.add_argument('--dry-run', required=False, + action='store_true', + help='''Generate all the commands without actually + executing them''') def _exec(self, args, force=False): jout_all = [] From 8aca01c4f33c241d35e0cda839bf3f7ce133aa7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0993/3334] Revert "[nrf fromlist] drivers: uart_nrfx_uarte: Fix runtime device PM for interrupt driven API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3b0588e9fd9fec29fca3a85b8a840bc5ee4315bf. Signed-off-by: Tomasz Moń --- drivers/serial/uart_nrfx_uarte.c | 38 +++++++++----------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index a60a1ee97aa1..ffb090ca16f1 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2832,35 +2832,27 @@ static void uarte_nrfx_irq_tx_enable(const struct device *dev) { NRF_UARTE_Type *uarte = get_uarte_instance(dev); struct uarte_nrfx_data *data = dev->data; - bool already_enabled; - pm_device_runtime_get(dev); + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_get(dev); + } unsigned int key = irq_lock(); - already_enabled = data->int_driven->tx_irq_enabled; - if (!already_enabled) { - data->int_driven->disable_tx_irq = false; - data->int_driven->tx_irq_enabled = true; - nrf_uarte_int_enable(uarte, NRF_UARTE_INT_TXSTOPPED_MASK); - } + data->int_driven->disable_tx_irq = false; + data->int_driven->tx_irq_enabled = true; + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_TXSTOPPED_MASK); irq_unlock(key); - - if (already_enabled) { - pm_device_runtime_put(dev); - } } /** Interrupt driven transfer disabling function */ static void uarte_nrfx_irq_tx_disable(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; - if (data->int_driven->tx_irq_enabled) { - /* TX IRQ will be disabled after current transmission is finished */ - data->int_driven->disable_tx_irq = true; - data->int_driven->tx_irq_enabled = false; - } + /* TX IRQ will be disabled after current transmission is finished */ + data->int_driven->disable_tx_irq = true; + data->int_driven->tx_irq_enabled = false; } /** Interrupt driven transfer ready function */ @@ -2896,11 +2888,7 @@ static void uarte_nrfx_irq_rx_enable(const struct device *dev) { NRF_UARTE_Type *uarte = get_uarte_instance(dev); - if (!nrf_uarte_int_enable_check(uarte, NRF_UARTE_INT_ENDRX_MASK)) { - pm_device_runtime_get(dev); - - nrf_uarte_int_enable(uarte, NRF_UARTE_INT_ENDRX_MASK); - } + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_ENDRX_MASK); } /** Interrupt driven receiver disabling function */ @@ -2908,11 +2896,7 @@ static void uarte_nrfx_irq_rx_disable(const struct device *dev) { NRF_UARTE_Type *uarte = get_uarte_instance(dev); - if (nrf_uarte_int_enable_check(uarte, NRF_UARTE_INT_ENDRX_MASK)) { - pm_device_runtime_put_async(dev, K_NO_WAIT); - - nrf_uarte_int_disable(uarte, NRF_UARTE_INT_ENDRX_MASK); - } + nrf_uarte_int_disable(uarte, NRF_UARTE_INT_ENDRX_MASK); } /** Interrupt driven error enabling function */ From 15f771f48fc67e9cacb125c7deb26693ee7ddaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0994/3334] Revert "[nrf fromtree] tests: driver: flash: Increase the single I/O test transfer timeout" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 044d5a0445fea6efc85c7f15617c3d57b18cd850. Signed-off-by: Tomasz Moń --- tests/drivers/flash/common/boards/mx25uw63_single_io.overlay | 2 +- .../common/boards/mx25uw63_single_io_4B_addr_sreset.overlay | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay index e74369f372b1..ac06662e9526 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay @@ -58,5 +58,5 @@ status = "okay"; mspi-max-frequency = ; mspi-io-mode = "MSPI_IO_MODE_SINGLE"; - transfer-timeout = <1000>; + transfer-timeout = <500>; }; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay index f2f74b269676..09af484cc212 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay @@ -60,5 +60,5 @@ mspi-io-mode = "MSPI_IO_MODE_SINGLE"; use-4byte-addressing; initial-soft-reset; - transfer-timeout = <1000>; + transfer-timeout = <500>; }; From 615e50573fc066e3c879367cdd96ff4b3bee2d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0995/3334] Revert "[nrf fromtree] bluetooth: host: Fix bt_conn reference leak in Frame Space Update" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ca9ae7fc780e3d3ce61dd123441514b724b8d629. Signed-off-by: Tomasz Moń --- 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 66ba610bee2b..f02755ccf872 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1856,8 +1856,6 @@ static void le_frame_space_update_complete(struct net_buf *buf) } bt_conn_notify_frame_space_update_complete(conn, ¶ms); - - bt_conn_unref(conn); } #endif /* CONFIG_BT_FRAME_SPACE_UPDATE */ From c8ea5b07f4f393229d80081c3545a14ba5f7403f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0996/3334] Revert "[nrf fromtree] bluetooth: host: shell: Add SCI shell commands" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2be3dbcf59c574fa346543b274ddf266621f0b95. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/shell/bt.c | 182 ++-------------------------- tests/bluetooth/shell/testcase.yaml | 7 -- 2 files changed, 11 insertions(+), 178 deletions(-) diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 21302647bdf7..4395a3c62c26 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -1009,30 +1009,7 @@ void subrate_changed(struct bt_conn *conn, bt_shell_print("Subrate change failed (HCI status 0x%02x)", params->status); } } - -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) -static void conn_rate_changed(struct bt_conn *conn, uint8_t status, - const struct bt_conn_le_conn_rate_changed *params) -{ - if (status == BT_HCI_ERR_SUCCESS) { - bt_shell_print("Connection rate parameters changed: " - "Connection Interval: %u us " - "Subrate Factor: %d " - "Peripheral latency: 0x%04x " - "Continuation Number: %d " - "Supervision timeout: 0x%04x (%d ms)", - params->interval_us, - params->subrate_factor, - params->peripheral_latency, - params->continuation_number, - params->supervision_timeout_10ms, - params->supervision_timeout_10ms * 10); - } else { - bt_shell_print("Connection rate change failed (HCI status 0x%02x)", status); - } -} -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ -#endif /* CONFIG_BT_SUBRATING */ +#endif #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) void read_all_remote_feat_complete(struct bt_conn *conn, @@ -1278,9 +1255,6 @@ BT_CONN_CB_DEFINE(conn_callbacks) = { #if defined(CONFIG_BT_SUBRATING) .subrate_changed = subrate_changed, #endif -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) - .conn_rate_changed = conn_rate_changed, -#endif #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) .read_all_remote_feat_complete = read_all_remote_feat_complete, #endif @@ -3387,130 +3361,7 @@ static int cmd_subrate_request(const struct shell *sh, size_t argc, char *argv[] return 0; } - -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) -static int cmd_read_min_conn_interval_groups(const struct shell *sh, size_t argc, char *argv[]) -{ - int err; - struct bt_conn_le_min_conn_interval_info info; - - err = bt_conn_le_read_min_conn_interval_groups(&info); - if (err != 0) { - shell_error(sh, "bt_conn_le_read_min_conn_interval_groups returned error %d", err); - return -ENOEXEC; - } - - shell_print(sh, "Minimum supported connection interval: %u us", - info.min_supported_conn_interval_us); - shell_print(sh, "Number of groups: %u", info.num_groups); - - for (uint8_t i = 0; i < info.num_groups; i++) { - shell_print( - sh, - " Group %u: min=0x%04x (%u us), max=0x%04x (%u us), stride=0x%04x (%u us)", - i, - info.groups[i].min_125us, - BT_CONN_SCI_INTERVAL_TO_US(info.groups[i].min_125us), - info.groups[i].max_125us, - BT_CONN_SCI_INTERVAL_TO_US(info.groups[i].max_125us), - info.groups[i].stride_125us, - BT_CONN_SCI_INTERVAL_TO_US(info.groups[i].stride_125us)); - } - - return 0; -} - -static int cmd_read_min_conn_interval(const struct shell *sh, size_t argc, char *argv[]) -{ - int err; - uint16_t min_interval_us; - - err = bt_conn_le_read_min_conn_interval(&min_interval_us); - if (err != 0) { - shell_error(sh, "bt_conn_le_read_min_conn_interval returned error %d", err); - return -ENOEXEC; - } - - shell_print(sh, "Minimum supported connection interval: %u us", min_interval_us); - return 0; -} - -static int cmd_conn_rate_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 != 0) { - shell_help(sh); - shell_error(sh, "Could not parse input number %zu", argn); - return SHELL_CMD_HELP_PRINTED; - } - } - - const struct bt_conn_le_conn_rate_param params = { - .interval_min_125us = shell_strtoul(argv[1], 10, &err), - .interval_max_125us = shell_strtoul(argv[2], 10, &err), - .subrate_min = shell_strtoul(argv[3], 10, &err), - .subrate_max = shell_strtoul(argv[4], 10, &err), - .max_latency = shell_strtoul(argv[5], 10, &err), - .continuation_number = shell_strtoul(argv[6], 10, &err), - .supervision_timeout_10ms = shell_strtoul(argv[7], 10, &err), - .min_ce_len_125us = shell_strtoul(argv[8], 10, &err), - .max_ce_len_125us = shell_strtoul(argv[9], 10, &err), - }; - - err = bt_conn_le_conn_rate_set_defaults(¶ms); - if (err != 0) { - shell_error(sh, "bt_conn_le_conn_rate_set_defaults returned error %d", err); - return -ENOEXEC; - } - - return 0; -} - -static int cmd_conn_rate_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 != 0) { - shell_help(sh); - shell_error(sh, "Could not parse input number %zu", argn); - return SHELL_CMD_HELP_PRINTED; - } - } - - const struct bt_conn_le_conn_rate_param params = { - .interval_min_125us = shell_strtoul(argv[1], 10, &err), - .interval_max_125us = shell_strtoul(argv[2], 10, &err), - .subrate_min = shell_strtoul(argv[3], 10, &err), - .subrate_max = shell_strtoul(argv[4], 10, &err), - .max_latency = shell_strtoul(argv[5], 10, &err), - .continuation_number = shell_strtoul(argv[6], 10, &err), - .supervision_timeout_10ms = shell_strtoul(argv[7], 10, &err), - .min_ce_len_125us = shell_strtoul(argv[8], 10, &err), - .max_ce_len_125us = shell_strtoul(argv[9], 10, &err), - }; - - err = bt_conn_le_conn_rate_request(default_conn, ¶ms); - if (err != 0) { - shell_error(sh, "bt_conn_le_conn_rate_request returned error %d", err); - return -ENOEXEC; - } - - return 0; -} -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ -#endif /* CONFIG_BT_SUBRATING */ +#endif #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) static int cmd_read_all_remote_features(const struct shell *sh, size_t argc, char *argv[]) @@ -3863,7 +3714,14 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) print_le_addr("Remote on-air", info.le.remote); print_le_addr("Local on-air", info.le.local); - shell_print(sh, "Interval: %u us", info.le.interval_us); + shell_print(sh, "Interval: 0x%04x (%u us)", +#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) + info.le.interval_us / BT_HCI_LE_SCI_INTERVAL_UNIT_US, +#else + info.le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US, +#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ + info.le.interval_us); + shell_print(sh, "Latency: 0x%04x", info.le.latency); shell_print(sh, "Supervision timeout: 0x%04x (%d ms)", @@ -5358,25 +5216,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds, " " " ", cmd_subrate_request, 6, 0), -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) - SHELL_CMD_ARG(read-min-conn-interval-groups, NULL, - "Read minimum supported connection interval and groups", - cmd_read_min_conn_interval_groups, 1, 0), - SHELL_CMD_ARG(read-min-conn-interval, NULL, - "Read minimum supported connection interval only", - cmd_read_min_conn_interval, 1, 0), - SHELL_CMD_ARG(conn-rate-set-defaults, NULL, - " " - " " - " ", - cmd_conn_rate_set_defaults, 10, 0), - SHELL_CMD_ARG(conn-rate-request, NULL, - " " - " " - " ", - cmd_conn_rate_request, 10, 0), -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ -#endif /* CONFIG_BT_SUBRATING */ +#endif #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) SHELL_CMD_ARG(read-all-remote-features, NULL, "", cmd_read_all_remote_features, 2, 0), diff --git a/tests/bluetooth/shell/testcase.yaml b/tests/bluetooth/shell/testcase.yaml index 7cf350dabe81..399c939b0661 100644 --- a/tests/bluetooth/shell/testcase.yaml +++ b/tests/bluetooth/shell/testcase.yaml @@ -46,13 +46,6 @@ tests: - CONFIG_BT_LE_EXTENDED_FEAT_SET=y - CONFIG_BT_LL_SW_SPLIT=n build_only: true - bluetooth.shell.shorter_connection_intervals: - extra_configs: - - CONFIG_BT_SHORTER_CONNECTION_INTERVALS=y - - CONFIG_BT_LE_EXTENDED_FEAT_SET=y - - CONFIG_BT_SUBRATING=y - - CONFIG_BT_LL_SW_SPLIT=n - build_only: true bluetooth.shell.channel_sounding: extra_configs: - CONFIG_BT_CHANNEL_SOUNDING=y From 0a99c4c192467cdc9cfec645cf72b3480f93a5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:33 +0100 Subject: [PATCH 0997/3334] Revert "[nrf fromtree] bluetooth: host: Change uses of interval to interval_us" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2df5bfb6e2543ff008a6da57cf2631e1aacee6c7. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.4.rst | 3 --- doc/releases/release-notes-4.4.rst | 6 ------ include/zephyr/bluetooth/conn.h | 16 +++------------- include/zephyr/bluetooth/hci_types.h | 2 -- subsys/bluetooth/audio/ascs.c | 10 +++++----- subsys/bluetooth/audio/bap_broadcast_assistant.c | 4 ++-- subsys/bluetooth/audio/bap_scan_delegator.c | 2 +- subsys/bluetooth/audio/bap_unicast_client.c | 4 ++-- subsys/bluetooth/audio/tbs.c | 2 +- subsys/bluetooth/host/att.c | 2 +- subsys/bluetooth/host/conn.c | 16 ++++++++-------- subsys/bluetooth/host/conn_internal.h | 2 +- subsys/bluetooth/host/hci_core.c | 13 ++++++------- subsys/bluetooth/host/shell/bt.c | 15 +++++---------- tests/bluetooth/audio/ascs/src/main.c | 2 +- tests/bluetooth/audio/ascs/src/test_common.c | 2 +- tests/bluetooth/tester/src/btp_gap.c | 2 +- 17 files changed, 38 insertions(+), 65 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 554607e5f857..7966cd0f25e3 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -40,9 +40,6 @@ Bluetooth Host * :kconfig:option:`CONFIG_BT_SIGNING` has been deprecated. * :c:macro:`BT_GATT_CHRC_AUTH` has been deprecated. -* :c:member:`bt_conn_le_info.interval` has been deprecated. Use - :c:member:`bt_conn_le_info.interval_us` instead. Note that the units have changed: ``interval`` - was in units of 1.25 milliseconds, while ``interval_us`` is in microseconds. Networking ********** diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 79a2bbf802e2..9622d9c5bd38 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -62,12 +62,6 @@ Deprecated APIs and options * The callback :c:member:`output_number` in :c:struct:`bt_mesh_prov` structure was deprecated. Applications should use :c:member:`output_numeric` callback instead. - * Host - - * :c:member:`bt_conn_le_info.interval` has been deprecated. Use - :c:member:`bt_conn_le_info.interval_us` instead. Note that the units have changed: - ``interval`` was in units of 1.25 milliseconds, while ``interval_us`` is in microseconds. - New APIs and options ==================== diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 4472a2690445..7a2d5d9c1bad 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1056,19 +1056,9 @@ struct bt_conn_le_info { /** Connection interval in microseconds */ uint32_t interval_us; #if !defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) || defined(__DOXYGEN__) - union { - /** @brief Connection interval in units of 1.25 ms - * - * @deprecated Use @ref bt_conn_le_info.interval_us instead - */ - __deprecated uint16_t interval; - /** @cond INTERNAL_HIDDEN */ - /** Workaround for setting deprecated @ref bt_conn_le_info.interval */ - uint16_t _interval; - /** @endcond */ - }; + /** Connection interval in units of 1.25 ms */ + uint16_t interval; #endif /* !CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ - uint16_t latency; /**< Connection peripheral latency */ uint16_t timeout; /**< Connection supervision timeout */ @@ -1106,7 +1096,7 @@ struct bt_conn_le_info { * * Multiply by 125 to get microseconds. */ -#define BT_CONN_SCI_INTERVAL_TO_US(_interval) ((_interval) * BT_HCI_LE_SCI_INTERVAL_UNIT_US) +#define BT_CONN_SCI_INTERVAL_TO_US(interval) ((interval) * BT_HCI_LE_SCI_INTERVAL_UNIT_US) /** BR/EDR Connection Info Structure */ struct bt_conn_br_info { diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index ebdbe5c926ce..98990919b680 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -3289,8 +3289,6 @@ struct bt_hci_evt_le_advertising_report { #define BT_HCI_LE_SUPERVISON_TIMEOUT_MIN 0x000a #define BT_HCI_LE_SUPERVISON_TIMEOUT_MAX 0x0c80 -#define BT_HCI_LE_INTERVAL_UNIT_US (1250U) - #define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE 0x03 struct bt_hci_evt_le_conn_update_complete { uint8_t status; diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index b8123cc3fcf4..48ed34cfd570 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -525,7 +525,7 @@ static void state_transition_work_handler(struct k_work *work) err = ase_state_notify(ase); if (err == -ENOMEM) { struct bt_conn_info info; - uint32_t retry_delay_us; + uint32_t retry_delay_ms; /* Revert back to old state */ ase->ep.state = old_state; @@ -533,14 +533,14 @@ static void state_transition_work_handler(struct k_work *work) err = bt_conn_get_info(ase->conn, &info); __ASSERT_NO_MSG(err == 0); - retry_delay_us = info.le.interval_us; + retry_delay_ms = BT_CONN_INTERVAL_TO_MS(info.le.interval); /* Reschedule the state transition */ - err = k_work_reschedule(d_work, K_USEC(retry_delay_us)); + err = k_work_reschedule(d_work, K_MSEC(retry_delay_ms)); if (err >= 0) { LOG_DBG("Out of buffers for ase state notification. " - "Will retry in %dus", - retry_delay_us); + "Will retry in %dms", + retry_delay_ms); return; } } diff --git a/subsys/bluetooth/audio/bap_broadcast_assistant.c b/subsys/bluetooth/audio/bap_broadcast_assistant.c index 76b80fb59d86..77ead34fef68 100644 --- a/subsys/bluetooth/audio/bap_broadcast_assistant.c +++ b/subsys/bluetooth/audio/bap_broadcast_assistant.c @@ -453,12 +453,12 @@ static void long_bap_read(struct bt_conn *conn, uint16_t handle) if (err != 0) { LOG_DBG("Failed to get conn info, use default interval"); - conn_info.le.interval_us = BT_CONN_INTERVAL_TO_US(BT_GAP_INIT_CONN_INT_MIN); + conn_info.le.interval = BT_GAP_INIT_CONN_INT_MIN; } /* Wait a connection interval to retry */ err = k_work_reschedule(&inst->bap_read_work, - K_USEC(conn_info.le.interval_us)); + K_USEC(BT_CONN_INTERVAL_TO_US(conn_info.le.interval))); if (err < 0) { LOG_DBG("Failed to reschedule read work: %d", err); bap_long_read_reset(inst); diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 1be1eec56a82..8c21b806900f 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -240,7 +240,7 @@ static void receive_state_notify_cb(struct bt_conn *conn, void *data) LOG_DBG("Could not notify receive state: %d", err); err = k_work_reschedule(&internal_state->notify_work, - K_USEC(conn_info.le.interval_us)); + K_USEC(BT_CONN_INTERVAL_TO_US(conn_info.le.interval))); __ASSERT(err >= 0, "Failed to reschedule work: %d", err); } } diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index 429431ada433..48c43f9faa8b 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -1767,12 +1767,12 @@ static void long_ase_read(struct bt_bap_unicast_client_ep *client_ep) if (err != 0) { LOG_DBG("Failed to get conn info, use default interval"); - conn_info.le.interval_us = BT_CONN_INTERVAL_TO_US(BT_GAP_INIT_CONN_INT_MIN); + conn_info.le.interval = BT_GAP_INIT_CONN_INT_MIN; } /* Wait a connection interval to retry */ err = k_work_reschedule(&client_ep->ase_read_work, - K_USEC(conn_info.le.interval_us)); + K_USEC(BT_CONN_INTERVAL_TO_US(conn_info.le.interval))); if (err < 0) { LOG_DBG("Failed to reschedule ASE long read work: %d", err); } diff --git a/subsys/bluetooth/audio/tbs.c b/subsys/bluetooth/audio/tbs.c index d7026c63dbe3..7526c5327e0f 100644 --- a/subsys/bluetooth/audio/tbs.c +++ b/subsys/bluetooth/audio/tbs.c @@ -1005,7 +1005,7 @@ static void notify_handler_cb(struct bt_conn *conn, void *data) LOG_DBG("Notify failed (%d), retrying next connection interval", err); reschedule: err = k_work_reschedule(&inst->notify_work, - K_USEC(info.le.interval_us)); + K_USEC(BT_CONN_INTERVAL_TO_US(info.le.interval))); __ASSERT(err >= 0, "Failed to reschedule work: %d", err); } diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 644952f55257..c822de7ab4bc 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -3538,7 +3538,7 @@ static k_timeout_t credit_based_connection_delay(struct bt_conn *conn) * result in an overflow */ const uint32_t calculated_delay_us = - 2 * (conn->le.latency + 1) * conn->le.interval_us; + 2 * (conn->le.latency + 1) * BT_CONN_INTERVAL_TO_US(conn->le.interval); const uint32_t calculated_delay_ms = calculated_delay_us / USEC_PER_MSEC; return K_MSEC(MAX(100, calculated_delay_ms + rand_delay)); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index f7658646acb1..6eb8d307bf08 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1960,30 +1960,30 @@ void bt_conn_notify_remote_info(struct bt_conn *conn) void bt_conn_notify_le_param_updated(struct bt_conn *conn) { - uint16_t interval_1250us = conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US; - /* If new connection parameters meet requirement of pending * parameters don't send peripheral conn param request anymore on timeout */ if (atomic_test_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET) && - interval_1250us >= conn->le.interval_min && - interval_1250us <= conn->le.interval_max && + conn->le.interval >= conn->le.interval_min && + conn->le.interval <= conn->le.interval_max && conn->le.latency == conn->le.pending_latency && conn->le.timeout == conn->le.pending_timeout) { atomic_clear_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET); } + BT_CONN_CB_DYNAMIC_FOREACH(callback) { if (callback->le_param_updated) { - callback->le_param_updated(conn, interval_1250us, + callback->le_param_updated(conn, conn->le.interval, conn->le.latency, conn->le.timeout); } } STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->le_param_updated) { - cb->le_param_updated(conn, interval_1250us, - conn->le.latency, conn->le.timeout); + cb->le_param_updated(conn, conn->le.interval, + conn->le.latency, + conn->le.timeout); } } } @@ -2841,7 +2841,7 @@ int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info) } info->le.interval_us = conn->le.interval_us; #if !defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) - info->le._interval = conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US; + info->le.interval = conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US; #endif info->le.latency = conn->le.latency; info->le.timeout = conn->le.timeout; diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 32c2445cb0c1..3a4e2847e84d 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -107,7 +107,7 @@ struct bt_conn_le { bt_addr_le_t init_addr; bt_addr_le_t resp_addr; - uint32_t interval_us; + uint16_t interval; uint16_t interval_min; uint16_t interval_max; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index f02755ccf872..b1586d56f930 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1408,7 +1408,7 @@ static void update_conn(struct bt_conn *conn, const bt_addr_le_t *id_addr, { conn->handle = sys_le16_to_cpu(evt->handle); bt_addr_le_copy(&conn->le.dst, id_addr); - conn->le.interval_us = sys_le16_to_cpu(evt->interval) * BT_HCI_LE_INTERVAL_UNIT_US; + conn->le.interval = sys_le16_to_cpu(evt->interval); conn->le.latency = sys_le16_to_cpu(evt->latency); conn->le.timeout = sys_le16_to_cpu(evt->supv_timeout); conn->role = evt->role; @@ -2060,16 +2060,15 @@ static void le_conn_update_complete(struct net_buf *buf) bt_l2cap_update_conn_param(conn, ¶m); } else { if (!evt->status) { - conn->le.interval_us = - sys_le16_to_cpu(evt->interval) * BT_HCI_LE_INTERVAL_UNIT_US; + conn->le.interval = sys_le16_to_cpu(evt->interval); conn->le.latency = sys_le16_to_cpu(evt->latency); conn->le.timeout = sys_le16_to_cpu(evt->supv_timeout); if (!IS_ENABLED(CONFIG_BT_CONN_PARAM_ANY)) { - if (!IN_RANGE(conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US, - BT_HCI_LE_INTERVAL_MIN, BT_HCI_LE_INTERVAL_MAX)) { - LOG_WRN("interval exceeds the valid range %u us", - conn->le.interval_us); + if (!IN_RANGE(conn->le.interval, BT_HCI_LE_INTERVAL_MIN, + BT_HCI_LE_INTERVAL_MAX)) { + LOG_WRN("interval exceeds the valid range 0x%04x", + conn->le.interval); } if (conn->le.latency > BT_HCI_LE_PERIPHERAL_LATENCY_MAX) { LOG_WRN("latency exceeds the valid range 0x%04x", diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 4395a3c62c26..816b6549853b 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -3715,13 +3715,8 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) print_le_addr("Local on-air", info.le.local); shell_print(sh, "Interval: 0x%04x (%u us)", -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) - info.le.interval_us / BT_HCI_LE_SCI_INTERVAL_UNIT_US, -#else - info.le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US, -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ - info.le.interval_us); - + info.le.interval, + BT_CONN_INTERVAL_TO_US(info.le.interval)); shell_print(sh, "Latency: 0x%04x", info.le.latency); shell_print(sh, "Supervision timeout: 0x%04x (%d ms)", @@ -4143,9 +4138,9 @@ static void connection_info(struct bt_conn *conn, void *user_data) #endif case BT_CONN_TYPE_LE: bt_addr_le_to_str(info.le.dst, addr, sizeof(addr)); - bt_shell_print("%s#%u [LE][%s] %s: Interval %u us, latency %u, timeout %u ms", - selected, info.id, role_str, addr, info.le.interval_us, - info.le.latency, info.le.timeout * 10); + bt_shell_print("%s#%u [LE][%s] %s: Interval %u latency %u timeout %u", selected, + info.id, role_str, addr, info.le.interval, info.le.latency, + info.le.timeout); break; #if defined(CONFIG_BT_ISO) case BT_CONN_TYPE_ISO: diff --git a/tests/bluetooth/audio/ascs/src/main.c b/tests/bluetooth/audio/ascs/src/main.c index 4aca7cee1c11..a326c7b1495f 100644 --- a/tests/bluetooth/audio/ascs/src/main.c +++ b/tests/bluetooth/audio/ascs/src/main.c @@ -667,7 +667,7 @@ ZTEST_F(ascs_test_suite, test_ase_state_notification_retry) zassert_equal(err, 0); /* Wait for ASE state notification retry */ - k_sleep(K_USEC(info.le.interval_us)); + k_sleep(K_MSEC(BT_CONN_INTERVAL_TO_MS(info.le.interval))); expect_bt_bap_stream_ops_configured_called_once(stream, EMPTY); } diff --git a/tests/bluetooth/audio/ascs/src/test_common.c b/tests/bluetooth/audio/ascs/src/test_common.c index f97840fe40ac..b09677592f46 100644 --- a/tests/bluetooth/audio/ascs/src/test_common.c +++ b/tests/bluetooth/audio/ascs/src/test_common.c @@ -77,7 +77,7 @@ void test_conn_init(struct bt_conn *conn) conn->info.security.level = BT_SECURITY_L2; conn->info.security.enc_key_size = BT_ENC_KEY_SIZE_MAX; conn->info.security.flags = BT_SECURITY_FLAG_OOB | BT_SECURITY_FLAG_SC; - conn->info.le.interval_us = BT_GAP_INIT_CONN_INT_MIN * BT_HCI_LE_INTERVAL_UNIT_US; + conn->info.le.interval = BT_GAP_INIT_CONN_INT_MIN; } const struct bt_gatt_attr *test_ase_control_point_get(void) diff --git a/tests/bluetooth/tester/src/btp_gap.c b/tests/bluetooth/tester/src/btp_gap.c index f3535d4acca7..80b30467bd9d 100644 --- a/tests/bluetooth/tester/src/btp_gap.c +++ b/tests/bluetooth/tester/src/btp_gap.c @@ -134,7 +134,7 @@ static void le_connected(struct bt_conn *conn, uint8_t err) if (bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { bt_addr_le_copy(&ev.address, info.le.dst); - ev.interval = sys_cpu_to_le16(info.le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US); + ev.interval = sys_cpu_to_le16(info.le.interval); ev.latency = sys_cpu_to_le16(info.le.latency); ev.timeout = sys_cpu_to_le16(info.le.timeout); } else if (IS_ENABLED(CONFIG_BT_CLASSIC) && bt_conn_is_type(conn, BT_CONN_TYPE_BR)) { From f12095307a2158ca9206088e2c78adf3d95d679a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 0998/3334] Revert "[nrf fromtree] bluetooth: host: Add Shorter Connection Intervals support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dbc3c770da707115e58c7713144f3591074d6390. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/conn.h | 269 +------------------------- include/zephyr/bluetooth/hci_types.h | 80 -------- subsys/bluetooth/Kconfig | 11 +- subsys/bluetooth/controller/Kconfig | 14 -- subsys/bluetooth/host/conn.c | 199 +------------------ subsys/bluetooth/host/conn_internal.h | 3 - subsys/bluetooth/host/hci_core.c | 85 +------- 7 files changed, 4 insertions(+), 657 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 7a2d5d9c1bad..881d0894ee11 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -252,169 +252,6 @@ struct bt_conn_le_subrate_changed { uint16_t supervision_timeout; }; -/** @brief Maximum Connection Interval Groups possible - * - * The practical maximum is 41 groups based on HCI event size constraints: - * (HCI event max size - cmd_complete overhead - response fields) / sizeof(group) - * (255 - 4 - 3) / 6 = 41 groups max - */ -#define BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS 41 - -/** @brief Minimum supported connection interval group - * - * Each group represents an arithmetic sequence of supported connection intervals: - * min, min + stride, min + 2 * stride, ..., min + n * stride (where min + n * stride <= max) - * - * Example: min = 10 (1250 us), max = 60 (7500 us), stride = 5 (625 us) - * -> Supported: 1250 us, 1875 us, 2500 us, ..., 6875 us, 7500 us - */ -struct bt_conn_le_min_conn_interval_group { - /** @brief Lower bound of group interval range - * - * Unit: 125 microseconds - * - * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US - */ - uint16_t min_125us; - /** @brief Upper bound of group interval range - * - * Unit: 125 microseconds - * - * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US - */ - uint16_t max_125us; - /** @brief Increment between consecutive supported intervals - * - * Unit: 125 microseconds - * - * Range: @ref BT_HCI_LE_SCI_STRIDE_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US - */ - uint16_t stride_125us; -}; - -/** Minimum supported connection interval information */ -struct bt_conn_le_min_conn_interval_info { - /** @brief Minimum supported connection interval - * - * Unit: microseconds - * - * Range: @ref BT_HCI_LE_MIN_SUPP_CONN_INT_MIN_US - @ref BT_HCI_LE_MIN_SUPP_CONN_INT_MAX_US - */ - uint16_t min_supported_conn_interval_us; - /** @brief Number of interval groups. - * - * Range: 0 - @ref BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS - * - * If zero, the controller only supports Rounded ConnInterval Values (RCV). - */ - uint8_t num_groups; - /** @brief Array of supported connection interval groups. - * - * Multiple groups allow representing non-contiguous or differently-strided ranges. - */ - struct bt_conn_le_min_conn_interval_group groups[BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS]; -}; - -/** Connection rate parameters for LE connections */ -struct bt_conn_le_conn_rate_param { - /** @brief Minimum connection interval - * - * Unit: 125 microseconds - * - * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US - */ - uint16_t interval_min_125us; - /** @brief Maximum connection interval - * - * Unit: 125 microseconds - * - * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_125US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_125US - */ - uint16_t interval_max_125us; - /** @brief Minimum subrate factor - * - * Range: @ref BT_HCI_LE_SUBRATE_FACTOR_MIN - @ref BT_HCI_LE_SUBRATE_FACTOR_MAX - */ - uint16_t subrate_min; - /** @brief Maximum subrate factor - * - * Range: @ref BT_HCI_LE_SUBRATE_FACTOR_MIN - @ref BT_HCI_LE_SUBRATE_FACTOR_MAX - */ - uint16_t subrate_max; - /** @brief Maximum Peripheral latency - * - * Unit: subrated connection intervals @ref bt_conn_le_conn_rate_changed.subrate_factor - * - * Range: @ref BT_HCI_LE_PERIPHERAL_LATENCY_MIN - @ref BT_HCI_LE_PERIPHERAL_LATENCY_MAX - */ - uint16_t max_latency; - /** @brief 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. - * - * Range: @ref BT_HCI_LE_CONTINUATION_NUM_MIN - @ref BT_HCI_LE_CONTINUATION_NUM_MAX - */ - uint16_t continuation_number; - /** @brief Connection Supervision timeout - * - * Unit: 10 milliseconds - * - * Range: @ref BT_HCI_LE_SUPERVISON_TIMEOUT_MIN - @ref BT_HCI_LE_SUPERVISON_TIMEOUT_MAX - */ - uint16_t supervision_timeout_10ms; - /** @brief Minimum length of connection event - * - * Unit: 125 microseconds - * - * Range: @ref BT_HCI_LE_SCI_CE_LEN_MIN_125US - @ref BT_HCI_LE_SCI_CE_LEN_MAX_125US - */ - uint16_t min_ce_len_125us; - /** @brief Maximum length of connection event - * - * Unit: 125 microseconds - * - * Range: @ref BT_HCI_LE_SCI_CE_LEN_MIN_125US - @ref BT_HCI_LE_SCI_CE_LEN_MAX_125US - */ - uint16_t max_ce_len_125us; -}; - -/** Updated connection rate parameters */ -struct bt_conn_le_conn_rate_changed { - /** Connection interval - * - * Unit: microseconds - * - * Range: @ref BT_HCI_LE_SCI_INTERVAL_MIN_US - @ref BT_HCI_LE_SCI_INTERVAL_MAX_US - */ - uint32_t interval_us; - /** Connection subrate factor - * - * Range: @ref BT_HCI_LE_SUBRATE_FACTOR_MIN - @ref BT_HCI_LE_SUBRATE_FACTOR_MAX - */ - uint16_t subrate_factor; - /** Peripheral latency - * - * Unit: subrated connection intervals @ref bt_conn_le_conn_rate_changed.subrate_factor - * - * Range: @ref BT_HCI_LE_PERIPHERAL_LATENCY_MIN - @ref BT_HCI_LE_PERIPHERAL_LATENCY_MAX - */ - uint16_t peripheral_latency; - /** 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. - * - * Range: @ref BT_HCI_LE_CONTINUATION_NUM_MIN - @ref BT_HCI_LE_CONTINUATION_NUM_MAX - */ - uint16_t continuation_number; - /** Connection Supervision timeout - * - * Unit: 10 milliseconds - * - * Range: @ref BT_HCI_LE_SUPERVISON_TIMEOUT_MIN - @ref BT_HCI_LE_SUPERVISON_TIMEOUT_MAX - */ - uint16_t supervision_timeout_10ms; -}; - /** Read all remote features complete callback params */ struct bt_conn_le_read_all_remote_feat_complete { /** @brief HCI Status from LE Read All Remote Features Complete event. @@ -1053,12 +890,7 @@ struct bt_conn_le_info { const bt_addr_le_t *local; /** Remote device address used during connection setup. */ const bt_addr_le_t *remote; - /** Connection interval in microseconds */ - uint32_t interval_us; -#if !defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) || defined(__DOXYGEN__) - /** Connection interval in units of 1.25 ms */ - uint16_t interval; -#endif /* !CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ + uint16_t interval; /**< Connection interval */ uint16_t latency; /**< Connection peripheral latency */ uint16_t timeout; /**< Connection supervision timeout */ @@ -1092,12 +924,6 @@ struct bt_conn_le_info { */ #define BT_CONN_INTERVAL_TO_US(interval) ((interval) * 1250U) -/** @brief Convert shorter connection interval to microseconds - * - * Multiply by 125 to get microseconds. - */ -#define BT_CONN_SCI_INTERVAL_TO_US(interval) ((interval) * BT_HCI_LE_SCI_INTERVAL_UNIT_US) - /** BR/EDR Connection Info Structure */ struct bt_conn_br_info { const bt_addr_t *dst; /**< Destination (Remote) BR/EDR address */ @@ -1503,74 +1329,6 @@ int bt_conn_le_subrate_set_defaults(const struct bt_conn_le_subrate_param *param int bt_conn_le_subrate_request(struct bt_conn *conn, const struct bt_conn_le_subrate_param *params); -/** @brief Read Minimum Supported Connection Interval Groups. - * - * Read the minimum supported connection interval and supported interval - * groups from the local controller. This information describes what the - * local controller supports. - * - * @sa bt_conn_le_read_min_conn_interval if only - * @ref bt_conn_le_min_conn_interval_info.min_supported_conn_interval_us - * is needed. - * - * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} - * - * @param info Pointer to structure to receive the minimum connection interval - * information. - * - * @return Zero on success or (negative) error code on failure. - */ -int bt_conn_le_read_min_conn_interval_groups(struct bt_conn_le_min_conn_interval_info *info); - -/** @brief Read Minimum Supported Connection Interval. - * - * Read the minimum supported connection interval from the local controller. - * - * @sa bt_conn_le_read_min_conn_interval_groups if groups are needed. - * - * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} - * - * @param min_interval_us Pointer to variable to receive the minimum connection interval - * in microseconds. - * - * @return Zero on success or (negative) error code on failure. - */ -int bt_conn_le_read_min_conn_interval(uint16_t *min_interval_us); - -/** @brief Set Default Connection Rate Parameters. - * - * Set default connection rate parameters to be used for future connections. - * This command does not affect any existing connection. - * Parameters set for specific connection will always have precedence. - * - * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} - * - * @param params Connection rate parameters. - * - * @return Zero on success or (negative) error code on failure. - */ -int bt_conn_le_conn_rate_set_defaults(const struct bt_conn_le_conn_rate_param *params); - -/** @brief Request New Connection Rate Parameters. - * - * Request a change to the connection parameters of a connection. This includes - * Subrate parameters. This allows changing the connection interval to below the - * Baseline ConnInterval Values (BCV) and with finer granularity, if supported. - * - * Valid intervals of the local and peer controller should be known. - * See @ref bt_conn_le_read_min_conn_interval_groups - * - * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} - * - * @param conn @ref BT_CONN_TYPE_LE connection object. - * @param params Connection rate parameters. - * - * @return Zero on success or (negative) error code on failure. - * @return -EINVAL @p conn is not a valid @ref BT_CONN_TYPE_LE connection. - */ -int bt_conn_le_conn_rate_request(struct bt_conn *conn, - const struct bt_conn_le_conn_rate_param *params); - /** @brief Read remote feature pages. * * Request remote feature pages, from 0 up to pages_requested or the number @@ -2294,31 +2052,6 @@ struct bt_conn_cb { const struct bt_conn_le_subrate_changed *params); #endif /* CONFIG_BT_SUBRATING */ -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) || defined(__DOXYGEN__) - /** @brief LE Connection Rate Changed event. - * - * This callback notifies the application that the connection rate - * parameters (including both connection interval and subrating) - * of the connection may have changed. - * - * @param conn Connection object. - * @param status HCI Status from LE Connection Rate Change event. - * Possible Status codes: - * - Success (0x00) - * - Unknown Connection Identifier (0x02) - * - Command Disallowed (0x0C) - * - Unsupported Feature or Parameter Value (0x11) - * - Invalid HCI Command Parameters (0x12) - * - Unsupported Remote Feature (0x1A) - * - Unsupported LL Parameter Value (0x20) - * @param params New connection rate parameters. - * The connection rate parameters will be NULL - * if @p status is not @ref BT_HCI_ERR_SUCCESS. - */ - void (*conn_rate_changed)(struct bt_conn *conn, uint8_t status, - const struct bt_conn_le_conn_rate_changed *params); -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ - #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) /** @brief Read all remote features complete event. * diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index 98990919b680..d520a2324266 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -209,8 +209,6 @@ struct bt_hci_cmd_hdr { #define BT_LE_FEAT_BIT_CHANNEL_SOUNDING_TONE_QUAL_IND 48 #define BT_LE_FEAT_BIT_EXTENDED_FEAT_SET 63 #define BT_LE_FEAT_BIT_FRAME_SPACE_UPDATE 65 -#define BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS 72 -#define BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS_HOST_SUPP 73 #define BT_LE_FEAT_TEST(feat, n) (feat[(n) >> 3] & \ BIT((n) & 7)) @@ -291,10 +289,6 @@ struct bt_hci_cmd_hdr { BT_LE_FEAT_BIT_EXTENDED_FEAT_SET) #define BT_FEAT_LE_FRAME_SPACE_UPDATE_SET(feat) BT_LE_FEAT_TEST(feat, \ BT_LE_FEAT_BIT_FRAME_SPACE_UPDATE) -#define BT_FEAT_LE_SHORTER_CONN_INTERVALS(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS) -#define BT_FEAT_LE_SHORTER_CONN_INTERVALS_HOST_SUPP(feat) BT_LE_FEAT_TEST(feat, \ - BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS_HOST_SUPP) #define BT_FEAT_LE_CIS(feat) (BT_FEAT_LE_CIS_CENTRAL(feat) | \ BT_FEAT_LE_CIS_PERIPHERAL(feat)) @@ -2860,66 +2854,6 @@ struct bt_hci_cp_le_frame_space_update { #define BT_HCI_OP_LE_FRAME_SPACE_UPDATE BT_OP(BT_OGF_LE, 0x009D) /* 0x209D */ -/** All limits according to BT Core spec 6.2 [Vol 4, Part E, 7.8.154]. */ -#define BT_HCI_LE_SCI_INTERVAL_MIN_125US (0x0003U) -#define BT_HCI_LE_SCI_INTERVAL_MAX_125US (0x7D00U) -#define BT_HCI_LE_SCI_INTERVAL_MIN_US (375U) -#define BT_HCI_LE_SCI_INTERVAL_MAX_US (4000000U) -#define BT_HCI_LE_SCI_INTERVAL_UNIT_US (125U) - -#define BT_HCI_LE_SCI_STRIDE_MIN_125US (0x0001U) - -#define BT_HCI_LE_MIN_SUPP_CONN_INT_MIN_US (375U) -#define BT_HCI_LE_MIN_SUPP_CONN_INT_MAX_US (7500U) - -#define BT_HCI_LE_SCI_CE_LEN_MIN_125US (0x0001U) -#define BT_HCI_LE_SCI_CE_LEN_MAX_125US (0x3E7FU) - -struct bt_hci_le_read_min_supported_conn_interval_group { - uint16_t group_min; - uint16_t group_max; - uint16_t group_stride; -} __packed; - -struct bt_hci_op_le_read_min_supported_conn_interval { - uint8_t status; - uint8_t min_supported_conn_interval; - uint8_t num_groups; - struct bt_hci_le_read_min_supported_conn_interval_group groups[]; -} __packed; - -#define BT_HCI_OP_LE_READ_MIN_SUPPORTED_CONN_INTERVAL \ - BT_OP(BT_OGF_LE, 0x00A3) /* 0x20A3 */ - -struct bt_hci_op_le_set_default_rate_parameters { - uint16_t conn_interval_min; - uint16_t conn_interval_max; - uint16_t subrate_min; - uint16_t subrate_max; - uint16_t max_latency; - uint16_t continuation_number; - uint16_t supervision_timeout; - uint16_t min_ce_len; - uint16_t max_ce_len; -} __packed; - -#define BT_HCI_OP_LE_SET_DEFAULT_RATE_PARAMETERS BT_OP(BT_OGF_LE, 0x00A2) /* 0x20A2 */ - -struct bt_hci_op_le_connection_rate_request { - uint16_t handle; - uint16_t conn_interval_min; - uint16_t conn_interval_max; - uint16_t subrate_min; - uint16_t subrate_max; - uint16_t max_latency; - uint16_t continuation_number; - uint16_t supervision_timeout; - uint16_t min_ce_len; - uint16_t max_ce_len; -} __packed; - -#define BT_HCI_OP_LE_CONNECTION_RATE_REQUEST BT_OP(BT_OGF_LE, 0x00A1) /* 0x20A1 */ - /* Event definitions */ #define BT_HCI_EVT_UNKNOWN 0x00 @@ -3284,7 +3218,6 @@ struct bt_hci_evt_le_advertising_report { /** All limits according to BT Core Spec v5.4 [Vol 4, Part E]. */ #define BT_HCI_LE_INTERVAL_MIN 0x0006 #define BT_HCI_LE_INTERVAL_MAX 0x0c80 -#define BT_HCI_LE_PERIPHERAL_LATENCY_MIN (0x0000U) #define BT_HCI_LE_PERIPHERAL_LATENCY_MAX 0x01f3 #define BT_HCI_LE_SUPERVISON_TIMEOUT_MIN 0x000a #define BT_HCI_LE_SUPERVISON_TIMEOUT_MAX 0x0c80 @@ -3676,7 +3609,6 @@ struct bt_hci_evt_le_biginfo_adv_report { /** All limits according to BT Core Spec v5.4 [Vol 4, Part E]. */ #define BT_HCI_LE_SUBRATE_FACTOR_MIN 0x0001 #define BT_HCI_LE_SUBRATE_FACTOR_MAX 0x01f4 -#define BT_HCI_LE_CONTINUATION_NUM_MIN (0x0000U) #define BT_HCI_LE_CONTINUATION_NUM_MAX 0x01f3 #define BT_HCI_EVT_LE_SUBRATE_CHANGE 0x23 @@ -4121,17 +4053,6 @@ struct bt_hci_evt_le_frame_space_update_complete { uint16_t spacing_types; } __packed; -#define BT_HCI_EVT_LE_CONN_RATE_CHANGE 0x37 -struct bt_hci_evt_le_conn_rate_change { - uint8_t status; - uint16_t handle; - uint16_t conn_interval; - 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)) @@ -4234,7 +4155,6 @@ struct bt_hci_evt_le_conn_rate_change { #define BT_EVT_MASK_LE_CS_TEST_END_COMPLETE BT_EVT_BIT(50) #define BT_EVT_MASK_LE_FRAME_SPACE_UPDATE_COMPLETE BT_EVT_BIT(52) -#define BT_EVT_MASK_LE_CONN_RATE_CHANGE BT_EVT_BIT(54) /** HCI Error Codes, BT Core Spec v5.4 [Vol 1, Part F]. */ #define BT_HCI_ERR_SUCCESS 0x00 diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index ec5d4fafcc88..7e8fa5dca6ec 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -117,7 +117,7 @@ config BT_CONN_TX config BT_LE_LOCAL_MINIMUM_REQUIRED_FEATURE_PAGE int - default 1 if BT_FRAME_SPACE_UPDATE || BT_SHORTER_CONNECTION_INTERVALS + default 1 if BT_FRAME_SPACE_UPDATE default 0 depends on BT_LE_EXTENDED_FEAT_SET help @@ -260,15 +260,6 @@ config BT_CHANNEL_SOUNDING_REASSEMBLY_BUFFER_CNT results. Each running CS procedure is allocated one buffer and the number of concurrent CS procedures is limited by this value. -config BT_SHORTER_CONNECTION_INTERVALS - bool "Shorter Connection Intervals" - depends on !HAS_BT_CTLR || BT_CTLR_SHORTER_CONNECTION_INTERVALS_SUPPORT - depends on BT_LE_EXTENDED_FEAT_SET - depends on BT_SUBRATING - help - Enable support for the Bluetooth 6.2 Shorter Connection Intervals - feature. - endif # BT_CONN config BT_ISO diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 0892bd97b7eb..98107940b949 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -133,9 +133,6 @@ config BT_CTLR_CHANNEL_SOUNDING_SUPPORT config BT_CTLR_EXTENDED_FEAT_SET_SUPPORT bool -config BT_CTLR_SHORTER_CONNECTION_INTERVALS_SUPPORT - bool - # Virtual option that all local LL implementations should select config HAS_BT_CTLR bool @@ -1189,17 +1186,6 @@ config BT_CTLR_EXTENDED_FEAT_SET Enable support for Bluetooth 6.0 LL Extended Feature Set in the Controller. -config BT_CTLR_SHORTER_CONNECTION_INTERVALS - bool "Shorter Connection Intervals" - depends on BT_CTLR_SHORTER_CONNECTION_INTERVALS_SUPPORT - depends on BT_CTLR_EXTENDED_FEAT_SET - depends on BT_CTLR_SUBRATING - select BT_CTLR_SET_HOST_FEATURE - default y if BT_SHORTER_CONNECTION_INTERVALS - help - Enable support for Bluetooth 6.2 Shorter Connection Intervals - in the controller. - rsource "Kconfig.df" rsource "Kconfig.ll_sw_split" rsource "Kconfig.dtm" diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 6eb8d307bf08..d310ff1de5fe 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2839,10 +2839,7 @@ int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info) info->le.local = &conn->le.resp_addr; info->le.remote = &conn->le.init_addr; } - info->le.interval_us = conn->le.interval_us; -#if !defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) - info->le.interval = conn->le.interval_us / BT_HCI_LE_INTERVAL_UNIT_US; -#endif + info->le.interval = conn->le.interval; info->le.latency = conn->le.latency; info->le.timeout = conn->le.timeout; #if defined(CONFIG_BT_USER_PHY_UPDATE) @@ -3200,24 +3197,6 @@ void bt_conn_notify_subrate_change(struct bt_conn *conn, } } -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) -void bt_conn_notify_conn_rate_change(struct bt_conn *conn, uint8_t status, - const struct bt_conn_le_conn_rate_changed *params) -{ - BT_CONN_CB_DYNAMIC_FOREACH(callback) { - if (callback->conn_rate_changed != NULL) { - callback->conn_rate_changed(conn, status, params); - } - } - - STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { - if (cb->conn_rate_changed != NULL) { - cb->conn_rate_changed(conn, status, params); - } - } -} -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ - 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] */ @@ -3306,182 +3285,6 @@ int bt_conn_le_subrate_request(struct bt_conn *conn, } #endif /* CONFIG_BT_SUBRATING */ -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) -int bt_conn_le_read_min_conn_interval_groups(struct bt_conn_le_min_conn_interval_info *info) -{ - struct net_buf *rsp; - struct bt_hci_op_le_read_min_supported_conn_interval *rp; - int err; - - if (info == NULL) { - return -EINVAL; - } - - err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_MIN_SUPPORTED_CONN_INTERVAL, NULL, - &rsp); - if (err != 0) { - return err; - } - - rp = (struct bt_hci_op_le_read_min_supported_conn_interval *)rsp->data; - - if (rp->num_groups > BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS) { - LOG_ERR("Too many groups: %d (max %d)", - rp->num_groups, BT_CONN_LE_MAX_CONN_INTERVAL_GROUPS); - net_buf_unref(rsp); - return -ENOMEM; - } - - info->min_supported_conn_interval_us = - BT_CONN_SCI_INTERVAL_TO_US(rp->min_supported_conn_interval); - info->num_groups = rp->num_groups; - - /* Copy groups up to the number allocated by the application */ - for (uint8_t i = 0; i < rp->num_groups; i++) { - info->groups[i].min_125us = sys_le16_to_cpu(rp->groups[i].group_min); - info->groups[i].max_125us = sys_le16_to_cpu(rp->groups[i].group_max); - info->groups[i].stride_125us = sys_le16_to_cpu(rp->groups[i].group_stride); - } - - net_buf_unref(rsp); - return 0; -} - -int bt_conn_le_read_min_conn_interval(uint16_t *min_interval_us) -{ - int err; - struct net_buf *rsp; - struct bt_hci_op_le_read_min_supported_conn_interval *rp; - - if (min_interval_us == NULL) { - return -EINVAL; - } - - err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_READ_MIN_SUPPORTED_CONN_INTERVAL, NULL, - &rsp); - if (err != 0) { - return err; - } - - rp = (struct bt_hci_op_le_read_min_supported_conn_interval *)rsp->data; - *min_interval_us = BT_CONN_SCI_INTERVAL_TO_US(rp->min_supported_conn_interval); - - net_buf_unref(rsp); - return 0; -} - -static bool le_conn_rate_common_params_valid(const struct bt_conn_le_conn_rate_param *param) -{ - /* All limits according to BT Core spec 6.2 [Vol 4, Part E, 7.8.154] */ - - if (!IN_RANGE(param->interval_min_125us, BT_HCI_LE_SCI_INTERVAL_MIN_125US, - BT_HCI_LE_SCI_INTERVAL_MAX_125US) || - !IN_RANGE(param->interval_max_125us, BT_HCI_LE_SCI_INTERVAL_MIN_125US, - BT_HCI_LE_SCI_INTERVAL_MAX_125US) || - param->interval_min_125us > param->interval_max_125us) { - return false; - } - - if (!IN_RANGE(param->subrate_min, BT_HCI_LE_SUBRATE_FACTOR_MIN, - BT_HCI_LE_SUBRATE_FACTOR_MAX) || - !IN_RANGE(param->subrate_max, BT_HCI_LE_SUBRATE_FACTOR_MIN, - BT_HCI_LE_SUBRATE_FACTOR_MAX) || - param->subrate_min > param->subrate_max) { - return false; - } - - if (!IN_RANGE(param->max_latency, 0, BT_HCI_LE_PERIPHERAL_LATENCY_MAX) || - param->subrate_max * (param->max_latency + 1) > 500) { - return false; - } - - if (!IN_RANGE(param->continuation_number, 0, BT_HCI_LE_CONTINUATION_NUM_MAX) || - param->continuation_number >= param->subrate_max) { - return false; - } - - if (!IN_RANGE(param->supervision_timeout_10ms, BT_HCI_LE_SUPERVISON_TIMEOUT_MIN, - BT_HCI_LE_SUPERVISON_TIMEOUT_MAX)) { - return false; - } - - if (!IN_RANGE(param->min_ce_len_125us, BT_HCI_LE_SCI_CE_LEN_MIN_125US, - BT_HCI_LE_SCI_CE_LEN_MAX_125US) || - !IN_RANGE(param->max_ce_len_125us, BT_HCI_LE_SCI_CE_LEN_MIN_125US, - BT_HCI_LE_SCI_CE_LEN_MAX_125US) || - param->max_ce_len_125us < param->min_ce_len_125us) { - return false; - } - - return true; -} - -#if defined(CONFIG_BT_CENTRAL) -int bt_conn_le_conn_rate_set_defaults(const struct bt_conn_le_conn_rate_param *params) -{ - struct bt_hci_op_le_set_default_rate_parameters *cp; - struct net_buf *buf; - - if (params == NULL || !le_conn_rate_common_params_valid(params)) { - return -EINVAL; - } - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (buf == NULL) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->conn_interval_min = sys_cpu_to_le16(params->interval_min_125us); - cp->conn_interval_max = sys_cpu_to_le16(params->interval_max_125us); - 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_10ms); - cp->min_ce_len = sys_cpu_to_le16(params->min_ce_len_125us); - cp->max_ce_len = sys_cpu_to_le16(params->max_ce_len_125us); - - return bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_DEFAULT_RATE_PARAMETERS, buf, NULL); -} -#endif /* CONFIG_BT_CENTRAL */ - -int bt_conn_le_conn_rate_request(struct bt_conn *conn, - const struct bt_conn_le_conn_rate_param *params) -{ - struct bt_hci_op_le_connection_rate_request *cp; - struct net_buf *buf; - - if (!bt_conn_is_le(conn)) { - LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); - return -EINVAL; - } - - if (params == NULL || !le_conn_rate_common_params_valid(params)) { - return -EINVAL; - } - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (buf == NULL) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->handle = sys_cpu_to_le16(conn->handle); - cp->conn_interval_min = sys_cpu_to_le16(params->interval_min_125us); - cp->conn_interval_max = sys_cpu_to_le16(params->interval_max_125us); - 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_10ms); - cp->min_ce_len = sys_cpu_to_le16(params->min_ce_len_125us); - cp->max_ce_len = sys_cpu_to_le16(params->max_ce_len_125us); - - return bt_hci_cmd_send_sync(BT_HCI_OP_LE_CONNECTION_RATE_REQUEST, buf, NULL); -} -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ - #if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET) void bt_conn_notify_read_all_remote_feat_complete(struct bt_conn *conn, struct bt_conn_le_read_all_remote_feat_complete *params) diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 3a4e2847e84d..f1e4a289a135 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -527,9 +527,6 @@ void bt_conn_notify_path_loss_threshold_report(struct bt_conn *conn, void bt_conn_notify_subrate_change(struct bt_conn *conn, struct bt_conn_le_subrate_changed params); -void bt_conn_notify_conn_rate_change(struct bt_conn *conn, uint8_t status, - const struct bt_conn_le_conn_rate_changed *params); - void bt_conn_notify_read_all_remote_feat_complete(struct bt_conn *conn, struct bt_conn_le_read_all_remote_feat_complete *params); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index b1586d56f930..ee16fea31064 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -2807,72 +2807,6 @@ void bt_hci_le_subrate_change_event(struct net_buf *buf) } #endif /* CONFIG_BT_SUBRATING */ -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) -void bt_hci_le_conn_rate_change_event(struct net_buf *buf) -{ - struct bt_hci_evt_le_conn_rate_change *evt; - struct bt_conn_le_conn_rate_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 == NULL) { - LOG_ERR("Unknown conn handle 0x%04X for connection rate event", - sys_le16_to_cpu(evt->handle)); - return; - } - - if (evt->status == BT_HCI_ERR_SUCCESS) { - conn->le.interval_us = - BT_CONN_SCI_INTERVAL_TO_US(sys_le16_to_cpu(evt->conn_interval)); - 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); - - if (!IS_ENABLED(CONFIG_BT_CONN_PARAM_ANY)) { - if (!IN_RANGE(conn->le.interval_us / BT_HCI_LE_SCI_INTERVAL_UNIT_US, - BT_HCI_LE_SCI_INTERVAL_MIN_125US, - BT_HCI_LE_SCI_INTERVAL_MAX_125US)) { - LOG_WRN("interval_us exceeds the valid range %u us", - conn->le.interval_us); - } - if (!IN_RANGE(conn->le.subrate.factor, BT_HCI_LE_SUBRATE_FACTOR_MIN, - BT_HCI_LE_SUBRATE_FACTOR_MAX)) { - LOG_WRN("subrate_factor exceeds the valid range %d", - conn->le.subrate.factor); - } - if (conn->le.latency > BT_HCI_LE_PERIPHERAL_LATENCY_MAX) { - LOG_WRN("peripheral_latency exceeds the valid range 0x%04x", - conn->le.latency); - } - if (conn->le.subrate.continuation_number > BT_HCI_LE_CONTINUATION_NUM_MAX) { - LOG_WRN("continuation_number exceeds the valid range %d", - conn->le.subrate.continuation_number); - } - if (!IN_RANGE(conn->le.timeout, BT_HCI_LE_SUPERVISON_TIMEOUT_MIN, - BT_HCI_LE_SUPERVISON_TIMEOUT_MAX)) { - LOG_WRN("supervision_timeout exceeds the valid range 0x%04x", - conn->le.timeout); - } - } - - params.interval_us = conn->le.interval_us; - params.subrate_factor = conn->le.subrate.factor; - params.continuation_number = conn->le.subrate.continuation_number; - params.peripheral_latency = conn->le.latency; - params.supervision_timeout_10ms = conn->le.timeout; - - bt_conn_notify_conn_rate_change(conn, evt->status, ¶ms); - } else { - bt_conn_notify_conn_rate_change(conn, evt->status, NULL); - } - - bt_conn_unref(conn); -} -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ - 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, @@ -3023,11 +2957,7 @@ static const struct event_handler meta_events[] = { #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_SUBRATING */ -#if defined(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) - EVENT_HANDLER(BT_HCI_EVT_LE_CONN_RATE_CHANGE, bt_hci_le_conn_rate_change_event, - sizeof(struct bt_hci_evt_le_conn_rate_change)), -#endif /* CONFIG_BT_SHORTER_CONNECTION_INTERVALS */ +#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)), @@ -3636,11 +3566,6 @@ static int le_set_event_mask(void) mask |= BT_EVT_MASK_LE_SUBRATE_CHANGE; } - if (IS_ENABLED(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) && - BT_FEAT_LE_SHORTER_CONN_INTERVALS(bt_dev.le.features)) { - mask |= BT_EVT_MASK_LE_CONN_RATE_CHANGE; - } - if (IS_ENABLED(CONFIG_BT_LE_EXTENDED_FEAT_SET) && BT_FEAT_LE_EXTENDED_FEAT_SET(bt_dev.le.features)) { mask |= BT_EVT_MASK_LE_READ_ALL_REMOTE_FEAT_COMPLETE; @@ -3955,14 +3880,6 @@ static int le_init(void) } } - if (IS_ENABLED(CONFIG_BT_SHORTER_CONNECTION_INTERVALS) && - BT_FEAT_LE_SHORTER_CONN_INTERVALS(bt_dev.le.features)) { - err = le_set_host_feature(BT_LE_FEAT_BIT_SHORTER_CONN_INTERVALS_HOST_SUPP, 1); - if (err != 0) { - return err; - } - } - return le_set_event_mask(); } From 9d256d423286ce6d7ad44649c3e1d1a42009435b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 0999/3334] Revert "[nrf fromtree] Bluetooth: Conn: add connection type helper functions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 617978c82c4bbf2420da3134fa6aadbb8e344037. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/conn.c | 144 ++++++++++++++------------ subsys/bluetooth/host/conn_internal.h | 35 +------ 2 files changed, 82 insertions(+), 97 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index d310ff1de5fe..2b2ce061bd92 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -217,7 +217,7 @@ int bt_conn_iso_init(void) struct k_sem *bt_conn_get_pkts(struct bt_conn *conn) { #if defined(CONFIG_BT_CLASSIC) - if (bt_conn_is_br(conn) || !bt_dev.le.acl_mtu) { + if (conn->type == BT_CONN_TYPE_BR || !bt_dev.le.acl_mtu) { return &bt_dev.br.pkts; } #endif /* CONFIG_BT_CLASSIC */ @@ -226,7 +226,7 @@ struct k_sem *bt_conn_get_pkts(struct bt_conn *conn) /* Use ISO pkts semaphore if LE Read Buffer Size command returned * dedicated ISO buffers. */ - if (bt_conn_is_iso(conn)) { + if (conn->type == BT_CONN_TYPE_ISO) { if (bt_dev.le.iso_mtu && bt_dev.le.iso_limit != 0) { return &bt_dev.le.iso_pkts; } @@ -470,7 +470,7 @@ static void bt_acl_recv(struct bt_conn *conn, struct net_buf *buf, return; } - if (!bt_conn_is_br(conn) && (conn->rx->len > acl_total_len)) { + if ((conn->type != BT_CONN_TYPE_BR) && (conn->rx->len > acl_total_len)) { LOG_ERR("ACL len mismatch (%u > %u)", conn->rx->len, acl_total_len); bt_conn_reset_rx_state(conn); return; @@ -481,7 +481,7 @@ static void bt_acl_recv(struct bt_conn *conn, struct net_buf *buf, conn->rx = NULL; LOG_DBG("Successfully parsed %u byte L2CAP packet", buf->len); - if (bt_conn_is_br(conn)) { + if (IS_ENABLED(CONFIG_BT_CLASSIC) && (conn->type == BT_CONN_TYPE_BR)) { bt_br_acl_recv(conn, buf, true); } else { bt_l2cap_recv(conn, buf, true); @@ -500,7 +500,7 @@ void bt_conn_recv(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) LOG_DBG("handle %u len %u flags %02x", conn->handle, buf->len, flags); - if (IS_ENABLED(CONFIG_BT_ISO_RX) && bt_conn_is_iso(conn)) { + if (IS_ENABLED(CONFIG_BT_ISO_RX) && conn->type == BT_CONN_TYPE_ISO) { bt_iso_recv(conn, buf, flags); return; } else if (IS_ENABLED(CONFIG_BT_CONN)) { @@ -618,12 +618,13 @@ static int send_iso(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) static inline uint16_t conn_mtu(struct bt_conn *conn) { #if defined(CONFIG_BT_CLASSIC) - if (bt_conn_is_br(conn) || (!bt_conn_is_iso(conn) && !bt_dev.le.acl_mtu)) { + if (conn->type == BT_CONN_TYPE_BR || + (conn->type != BT_CONN_TYPE_ISO && !bt_dev.le.acl_mtu)) { return bt_dev.br.mtu; } #endif /* CONFIG_BT_CLASSIC */ #if defined(CONFIG_BT_ISO) - if (bt_conn_is_iso(conn)) { + if (conn->type == BT_CONN_TYPE_ISO) { return bt_dev.le.iso_mtu; } #endif /* CONFIG_BT_ISO */ @@ -634,14 +635,26 @@ static inline uint16_t conn_mtu(struct bt_conn *conn) #endif /* CONFIG_BT_CONN */ } +static bool is_classic_conn(struct bt_conn *conn) +{ + 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) && bt_conn_is_iso(conn); + return IS_ENABLED(CONFIG_BT_ISO_TX) && + conn->type == BT_CONN_TYPE_ISO; +} + +static bool is_le_conn(struct bt_conn *conn) +{ + return IS_ENABLED(CONFIG_BT_CONN) && conn->type == BT_CONN_TYPE_LE; } static bool is_acl_conn(struct bt_conn *conn) { - return bt_conn_is_le(conn) || bt_conn_is_br(conn); + return is_le_conn(conn) || is_classic_conn(conn); } static int send_buf(struct bt_conn *conn, struct net_buf *buf, @@ -1179,12 +1192,13 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) * bt_conn_add_le() and keep it until reaching DISCONNECTED * again. */ - if (!bt_conn_is_iso(conn)) { + if (conn->type != BT_CONN_TYPE_ISO) { bt_conn_ref(conn); } break; case BT_CONN_INITIATING: - if (IS_ENABLED(CONFIG_BT_CENTRAL) && bt_conn_is_le(conn)) { + if (IS_ENABLED(CONFIG_BT_CENTRAL) && + conn->type == BT_CONN_TYPE_LE) { k_work_cancel_delayable(&conn->deferred_work); } break; @@ -1195,7 +1209,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) /* Actions needed for entering the new state */ switch (conn->state) { case BT_CONN_CONNECTED: - if (bt_conn_is_sco(conn)) { + if (conn->type == BT_CONN_TYPE_SCO) { if (IS_ENABLED(CONFIG_BT_CLASSIC)) { bt_sco_connected(conn); } @@ -1203,7 +1217,8 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) } k_poll_signal_raise(&conn_change, 0); - if (bt_conn_is_iso(conn)) { + if (IS_ENABLED(CONFIG_BT_ISO) && + conn->type == BT_CONN_TYPE_ISO) { bt_iso_connected(conn); break; } @@ -1215,7 +1230,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) conn->role == BT_CONN_ROLE_PERIPHERAL) { #if defined(CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS) - if (bt_conn_is_le(conn)) { + if (conn->type == BT_CONN_TYPE_LE) { conn->le.conn_param_retry_countdown = CONFIG_BT_CONN_PARAM_RETRY_COUNT; } @@ -1229,7 +1244,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) break; case BT_CONN_DISCONNECTED: #if defined(CONFIG_BT_CONN) - if (bt_conn_is_sco(conn)) { + if (conn->type == BT_CONN_TYPE_SCO) { if (IS_ENABLED(CONFIG_BT_CLASSIC)) { bt_sco_disconnected(conn); } @@ -1326,14 +1341,15 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) case BT_CONN_ADV_DIR_CONNECTABLE: break; case BT_CONN_INITIATING: - if (bt_conn_is_sco(conn)) { + if (conn->type == BT_CONN_TYPE_SCO) { break; } /* * Timer is needed only for LE. For other link types controller * will handle connection timeout. */ - if (IS_ENABLED(CONFIG_BT_CENTRAL) && bt_conn_is_le(conn) && + if (IS_ENABLED(CONFIG_BT_CENTRAL) && + conn->type == BT_CONN_TYPE_LE && bt_dev.create_param.timeout != 0) { k_work_schedule(&conn->deferred_work, K_MSEC(10 * bt_dev.create_param.timeout)); @@ -1868,21 +1884,21 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason) } return 0; case BT_CONN_INITIATING: - if (bt_conn_is_le(conn)) { + if (conn->type == BT_CONN_TYPE_LE) { if (IS_ENABLED(CONFIG_BT_CENTRAL)) { k_work_cancel_delayable(&conn->deferred_work); return bt_le_create_conn_cancel(); } } #if defined(CONFIG_BT_ISO) - else if (bt_conn_is_iso(conn)) { + else if (conn->type == BT_CONN_TYPE_ISO) { return conn_disconnect(conn, reason); } #endif /* CONFIG_BT_ISO */ #if defined(CONFIG_BT_CLASSIC) - else if (bt_conn_is_br(conn)) { + else if (conn->type == BT_CONN_TYPE_BR) { return bt_hci_connect_br_cancel(conn); - } else if (bt_conn_is_sco(conn)) { + } else if (conn->type == BT_CONN_TYPE_SCO) { /* There is no HCI cmd to cancel SCO connecting from spec */ return -EPROTONOSUPPORT; } @@ -2163,7 +2179,7 @@ static void deferred_work(struct k_work *work) #if defined(CONFIG_BT_ISO_UNICAST) struct bt_conn *iso; - if (bt_conn_is_iso(conn)) { + if (conn->type == BT_CONN_TYPE_ISO) { /* bt_iso_disconnected is responsible for unref'ing the * connection pointer, as it is conditional on whether * the connection is a central or peripheral. @@ -2223,7 +2239,7 @@ static void deferred_work(struct k_work *work) return; } - if (!bt_conn_is_le(conn)) { + if (conn->type != BT_CONN_TYPE_LE) { return; } @@ -2307,7 +2323,7 @@ struct bt_conn *bt_conn_lookup_addr_sco(const bt_addr_t *peer) continue; } - if (!bt_conn_is_sco(conn)) { + if (conn->type != BT_CONN_TYPE_SCO) { bt_conn_unref(conn); continue; } @@ -2339,7 +2355,7 @@ struct bt_conn *bt_conn_lookup_addr_br(const bt_addr_t *peer) continue; } - if (!bt_conn_is_br(conn)) { + if (conn->type != BT_CONN_TYPE_BR) { bt_conn_unref(conn); continue; } @@ -2482,7 +2498,7 @@ int bt_conn_le_start_encryption(struct bt_conn *conn, uint8_t rand[8], #if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_CLASSIC) uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) { - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return 0; } @@ -2492,7 +2508,7 @@ uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) } #if defined(CONFIG_BT_CLASSIC) - if (bt_conn_is_br(conn)) { + if (conn->type == BT_CONN_TYPE_BR) { return conn->br.link_key ? conn->br.link_key->enc_key_size : 0; } #endif /* CONFIG_BT_CLASSIC */ @@ -2507,7 +2523,7 @@ uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) static void reset_pairing(struct bt_conn *conn) { #if defined(CONFIG_BT_CLASSIC) - if (bt_conn_is_br(conn)) { + if (conn->type == BT_CONN_TYPE_BR) { atomic_clear_bit(conn->flags, BT_CONN_BR_PAIRING); atomic_clear_bit(conn->flags, BT_CONN_BR_PAIRED); atomic_clear_bit(conn->flags, BT_CONN_BR_PAIRING_INITIATOR); @@ -2543,12 +2559,12 @@ void bt_conn_security_changed(struct bt_conn *conn, uint8_t hci_err, #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (!err && conn->sec_level >= BT_SECURITY_L2) { - if (bt_conn_is_le(conn)) { + if (conn->type == BT_CONN_TYPE_LE) { bt_keys_update_usage(conn->id, bt_conn_get_dst(conn)); } #if defined(CONFIG_BT_CLASSIC) - if (bt_conn_is_br(conn)) { + if (conn->type == BT_CONN_TYPE_BR) { bt_keys_link_key_update_usage(&conn->br.dst); } #endif /* CONFIG_BT_CLASSIC */ @@ -2559,7 +2575,7 @@ void bt_conn_security_changed(struct bt_conn *conn, uint8_t hci_err, static int start_security(struct bt_conn *conn) { - if (bt_conn_is_br(conn)) { + if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { return bt_ssp_start_security(conn); } @@ -2575,7 +2591,7 @@ int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec) bool force_pair; int err; - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -2615,7 +2631,7 @@ int bt_conn_set_security(struct bt_conn *conn, bt_security_t sec) bt_security_t bt_conn_get_security(const struct bt_conn *conn) { - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return BT_SECURITY_L0; } @@ -2733,7 +2749,7 @@ struct bt_conn *bt_conn_lookup_addr_le(uint8_t id, const bt_addr_le_t *peer) continue; } - if (!bt_conn_is_le(conn)) { + if (conn->type != BT_CONN_TYPE_LE) { bt_conn_unref(conn); continue; } @@ -2761,7 +2777,7 @@ struct bt_conn *bt_conn_lookup_state_le(uint8_t id, const bt_addr_le_t *peer, continue; } - if (!bt_conn_is_le(conn)) { + if (conn->type != BT_CONN_TYPE_LE) { bt_conn_unref(conn); continue; } @@ -2784,7 +2800,7 @@ struct bt_conn *bt_conn_lookup_state_le(uint8_t id, const bt_addr_le_t *peer, const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn) { - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return NULL; } @@ -2899,7 +2915,7 @@ bool bt_conn_is_type(const struct bt_conn *conn, enum bt_conn_type type) int bt_conn_get_remote_info(const struct bt_conn *conn, struct bt_conn_remote_info *remote_info) { - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -2994,7 +3010,7 @@ int bt_conn_le_enhanced_get_tx_power_level(struct bt_conn *conn, struct bt_hci_cp_le_read_tx_power_level *cp; struct net_buf *buf; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3032,7 +3048,7 @@ int bt_conn_le_get_remote_tx_power_level(struct bt_conn *conn, struct bt_hci_cp_le_read_tx_power_level *cp; struct net_buf *buf; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3060,7 +3076,7 @@ int bt_conn_le_set_tx_power_report_enable(struct bt_conn *conn, struct bt_hci_cp_le_set_tx_power_report_enable *cp; struct net_buf *buf; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3086,7 +3102,7 @@ int bt_conn_le_get_tx_power_level(struct bt_conn *conn, { int err; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3134,7 +3150,7 @@ int bt_conn_le_set_path_loss_mon_param(struct bt_conn *conn, struct bt_hci_cp_le_set_path_loss_reporting_parameters *cp; struct net_buf *buf; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3160,7 +3176,7 @@ int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool reporting_ena struct bt_hci_cp_le_set_path_loss_reporting_enable *cp; struct net_buf *buf; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3259,7 +3275,7 @@ int bt_conn_le_subrate_request(struct bt_conn *conn, struct bt_hci_cp_le_subrate_request *cp; struct net_buf *buf; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3308,7 +3324,7 @@ int bt_conn_le_read_all_remote_features(struct bt_conn *conn, uint8_t pages_requ struct bt_hci_cp_le_read_all_remote_features *cp; struct net_buf *buf; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3377,7 +3393,7 @@ int bt_conn_le_frame_space_update(struct bt_conn *conn, struct bt_hci_cp_le_frame_space_update *cp; struct net_buf *buf; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3519,7 +3535,7 @@ void bt_conn_notify_cs_subevent_result(struct bt_conn *conn, int bt_conn_le_param_update(struct bt_conn *conn, const struct bt_le_conn_param *param) { - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3553,7 +3569,7 @@ int bt_conn_le_param_update(struct bt_conn *conn, int bt_conn_le_data_len_update(struct bt_conn *conn, const struct bt_conn_le_data_len_param *param) { - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -3573,7 +3589,7 @@ int bt_conn_le_phy_update(struct bt_conn *conn, { uint8_t phy_opts, all_phys; - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -4007,7 +4023,7 @@ int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb) #if defined(CONFIG_BT_SMP) int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb *cb) { - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -4021,7 +4037,7 @@ int bt_conn_auth_cb_overlay(struct bt_conn *conn, const struct bt_conn_auth_cb * return -EINVAL; } - if (bt_conn_is_le(conn)) { + if (conn->type == BT_CONN_TYPE_LE) { return bt_smp_auth_cb_overlay(conn, cb); } @@ -4059,16 +4075,16 @@ int bt_conn_auth_info_cb_unregister(struct bt_conn_auth_info_cb *cb) int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) { - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_SMP) && bt_conn_is_le(conn)) { + if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { return bt_smp_auth_passkey_entry(conn, passkey); } - if (bt_conn_is_br(conn)) { + if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { if (!bt_auth) { return -EINVAL; } @@ -4083,7 +4099,7 @@ int bt_conn_auth_passkey_entry(struct bt_conn *conn, unsigned int passkey) int bt_conn_auth_keypress_notify(struct bt_conn *conn, enum bt_conn_auth_keypress type) { - if (!bt_conn_is_le(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } @@ -4099,16 +4115,16 @@ int bt_conn_auth_keypress_notify(struct bt_conn *conn, int bt_conn_auth_passkey_confirm(struct bt_conn *conn) { - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_SMP) && bt_conn_is_le(conn)) { + if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { return bt_smp_auth_passkey_confirm(conn); } - if (bt_conn_is_br(conn)) { + if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { if (!bt_auth) { return -EINVAL; } @@ -4121,16 +4137,16 @@ int bt_conn_auth_passkey_confirm(struct bt_conn *conn) int bt_conn_auth_cancel(struct bt_conn *conn) { - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_SMP) && bt_conn_is_le(conn)) { + if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { return bt_smp_auth_cancel(conn); } - if (bt_conn_is_br(conn)) { + if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { if (!bt_auth) { return -EINVAL; } @@ -4143,16 +4159,16 @@ int bt_conn_auth_cancel(struct bt_conn *conn) int bt_conn_auth_pairing_confirm(struct bt_conn *conn) { - if (!bt_conn_is_le(conn) && !bt_conn_is_br(conn)) { + if (!bt_conn_is_type(conn, BT_CONN_TYPE_LE | BT_CONN_TYPE_BR)) { LOG_DBG("Invalid connection type: %u for %p", conn->type, conn); return -EINVAL; } - if (IS_ENABLED(CONFIG_BT_SMP) && bt_conn_is_le(conn)) { + if (IS_ENABLED(CONFIG_BT_SMP) && conn->type == BT_CONN_TYPE_LE) { return bt_smp_auth_pairing_confirm(conn); } - if (bt_conn_is_br(conn)) { + if (IS_ENABLED(CONFIG_BT_CLASSIC) && conn->type == BT_CONN_TYPE_BR) { if (!bt_auth) { return -EINVAL; } diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index f1e4a289a135..c64ad277b4f8 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -363,38 +363,6 @@ static inline void *closure_data(void *storage) return ((struct closure *)storage)->data; } -#if defined(CONFIG_BT_CLASSIC) -static inline bool bt_conn_is_br(const struct bt_conn *conn) -{ - return conn->type == BT_CONN_TYPE_BR; -} -#else -#define bt_conn_is_br(conn) (false) -#endif - -static inline bool bt_conn_is_le(const struct bt_conn *conn) -{ - return conn->type == BT_CONN_TYPE_LE; -} - -#if defined(CONFIG_BT_ISO) -static inline bool bt_conn_is_iso(const struct bt_conn *conn) -{ - return conn->type == BT_CONN_TYPE_ISO; -} -#else -#define bt_conn_is_iso(conn) (false) -#endif - -#if defined(CONFIG_BT_CLASSIC) -static inline bool bt_conn_is_sco(const struct bt_conn *conn) -{ - return conn->type == BT_CONN_TYPE_SCO; -} -#else -#define bt_conn_is_sco(conn) (false) -#endif - void bt_conn_tx_notify(struct bt_conn *conn, bool wait_for_completion); void bt_conn_reset_rx_state(struct bt_conn *conn); @@ -474,7 +442,8 @@ static inline bool bt_conn_is_handle_valid(struct bt_conn *conn) return true; case BT_CONN_INITIATING: /* ISO connection handle assigned at connect state */ - if (bt_conn_is_iso(conn)) { + if (IS_ENABLED(CONFIG_BT_ISO) && + conn->type == BT_CONN_TYPE_ISO) { return true; } __fallthrough; From 1cfe03c290dbfe07855c7737e86af6af921f98be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1000/3334] Revert "[nrf fromtree] bluetooth: remove blocking operation in bt_conn_get_info" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3c491d7b7b30fa9538be85257d6589708f38847e. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/classic/br.c | 4 ---- subsys/bluetooth/host/conn.c | 32 ++++++++++++++++++++++++++---- subsys/bluetooth/host/hci_core.c | 13 +++--------- subsys/bluetooth/host/keys.h | 1 - 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/subsys/bluetooth/host/classic/br.c b/subsys/bluetooth/host/classic/br.c index 4e9902747381..23a43a01959b 100644 --- a/subsys/bluetooth/host/classic/br.c +++ b/subsys/bluetooth/host/classic/br.c @@ -143,10 +143,6 @@ static bool br_sufficient_key_size(struct bt_conn *conn) key_size = rp->key_size; net_buf_unref(rsp); - if (conn->br.link_key) { - conn->br.link_key->enc_key_size = key_size; - } - LOG_DBG("Encryption key size is %u", key_size); if (conn->sec_level == BT_SECURITY_L4) { diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 2b2ce061bd92..e706fd3fb934 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2507,11 +2507,35 @@ uint8_t bt_conn_enc_key_size(const struct bt_conn *conn) return 0; } -#if defined(CONFIG_BT_CLASSIC) - if (conn->type == BT_CONN_TYPE_BR) { - return conn->br.link_key ? conn->br.link_key->enc_key_size : 0; + if (IS_ENABLED(CONFIG_BT_CLASSIC) && + conn->type == BT_CONN_TYPE_BR) { + struct bt_hci_cp_read_encryption_key_size *cp; + struct bt_hci_rp_read_encryption_key_size *rp; + struct net_buf *buf; + struct net_buf *rsp; + uint8_t key_size; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (!buf) { + return 0; + } + + cp = net_buf_add(buf, sizeof(*cp)); + cp->handle = sys_cpu_to_le16(conn->handle); + + if (bt_hci_cmd_send_sync(BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE, + buf, &rsp)) { + return 0; + } + + rp = (void *)rsp->data; + + key_size = rp->status ? 0 : rp->key_size; + + net_buf_unref(rsp); + + return key_size; } -#endif /* CONFIG_BT_CLASSIC */ if (IS_ENABLED(CONFIG_BT_SMP)) { return conn->le.keys ? conn->le.keys->enc_size : 0; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index ee16fea31064..d2a8d6d1202b 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1077,16 +1077,9 @@ static void hci_disconn_complete(struct net_buf *buf) * If only for one connection session bond was set, clear keys * database row for this connection. */ - if (conn->type == BT_CONN_TYPE_BR && conn->br.link_key != NULL) { - /* - * If the connection link is paired but not bond, remove - * the link key upon disconnection. - */ - if (atomic_test_and_clear_bit(conn->flags, BT_CONN_BR_NOBOND)) { - bt_keys_link_key_clear(conn->br.link_key); - } - - conn->br.link_key->enc_key_size = 0; + if (conn->type == BT_CONN_TYPE_BR && conn->br.link_key != NULL && + atomic_test_and_clear_bit(conn->flags, BT_CONN_BR_NOBOND)) { + bt_keys_link_key_clear(conn->br.link_key); } #endif bt_conn_unref(conn); diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index ab83aff8ebf0..b53635ce2c56 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -217,7 +217,6 @@ enum { struct bt_keys_link_key { bt_addr_t addr; - uint8_t enc_key_size; uint8_t storage_start[0] __aligned(sizeof(void *)); uint8_t flags; uint8_t val[16]; From 0c40fd9fae9c5a8dcf16a095862caeaac3fd4cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1001/3334] Revert "[nrf fromtree] tests: bluetooth: qualification: Remove data signing related ICS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5a4d8277eba38d0e04d28b9a0661f2b3025bd84e. Signed-off-by: Tomasz Moń --- .../ICS_Zephyr_Bluetooth_Host.bqw | 19 +++++-- .../ICS_Zephyr_Bluetooth_Host.pts | 50 ++++++++++++++++++- 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw index 1f0b30081209..399f6eb0ed6b 100644 --- a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw +++ b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw @@ -1,8 +1,8 @@ - + - + @@ -54,6 +54,7 @@ GAP 31/10 GAP 32/1 GAP 32/2 + GAP 35/2 GAP 37/1 GAP 5/4 GAP 8a/1 @@ -83,6 +84,7 @@ GAP 21/5 GAP 23/2 GAP 25/1 + GAP 25/6 GAP 27/7 GAP 28/2 GAP 33/4 @@ -148,6 +150,7 @@ GAP 20A/19 GAP 30a/16 GAP 14a/10 + GAP 27b/8 GAP 27b/3 GAP 27b/6 GAP 25/11 @@ -214,6 +217,7 @@ GAP 33/5 GAP 34/3 GAP 35/3 + GAP 35/5 GAP 35/8 GAP 36/2 GAP 36/5 @@ -236,6 +240,7 @@ GAP 30a/6 GAP 27c/2 GAP 14a/6 + GAP 37b/8 GAP 25/14 GAP 14a/3 GAP 27c/3 @@ -247,11 +252,14 @@ GAP 20/5 GAP 20A/7 GAP 23/3 + GAP 25/2 + GAP 25/5 GAP 26/3 GAP 27/5 GAP 27a/1 GAP 27a/3 GAP 31/3 + GAP 35/6 GAP 37a/2 GAP 6/1 GAP 8a/11 @@ -361,6 +369,7 @@ GATT 9/7 GATT 10/8 GATT 3/30 + GATT 3/13 GATT 3/17 GATT 4/16 GATT 4/2 @@ -384,6 +393,7 @@ GATT 4/13 GATT 4/18 GATT 4/3 + GATT 7/3 GATT 4a/1 GATT 1/1 GATT 3/29 @@ -418,6 +428,7 @@ GATT 4/20 GATT 4/23 GATT 4/26 + GATT 9/10 GATT 3a/1 GATT 9/12 GATT 1a/1 @@ -437,10 +448,12 @@ SM 2/2 SM 5/1 SM 5/4 + SM 6/2 SM 1/1 SM 2/1 SM 4/1 SM 5/3 + SM 6/1 SM 7b/1 SM 4/3 SM 7b/3 @@ -3279,4 +3292,4 @@ - + \ No newline at end of file diff --git a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts index 38a5a2dfa67c..6f31ef84404c 100644 --- a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts +++ b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts @@ -1,6 +1,6 @@  - 376799 + 347313 Zephyr Host @@ -317,6 +317,10 @@ 14a
14 + + 37b
+ 8 +
30a
16 @@ -377,6 +381,10 @@ 14a
10
+ + 27b
+ 8 +
27b
3 @@ -741,6 +749,10 @@ 25
10
+ + 25
+ 2 +
25
3 @@ -749,6 +761,14 @@ 25
4
+ + 25
+ 5 +
+ + 25
+ 6 +
25
7 @@ -949,6 +969,14 @@ 35
4
+ + 35
+ 5 +
+ + 35
+ 6 +
35
7 @@ -1283,6 +1311,10 @@ 2
3a
+ + 9
+ 10 +
10
6 @@ -1459,6 +1491,10 @@ 3
12
+ + 3
+ 13 +
3
14 @@ -1643,6 +1679,10 @@ 7
2
+ + 7
+ 3 +
7
4 @@ -1742,6 +1782,14 @@ 5
4
+ + 6
+ 1 +
+ + 6
+ 2 +
ATT From a3d6abbaf716b64b4dbc5a2e9af4cd8177f51da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1002/3334] Revert "[nrf fromtree] tests: bluetooth: init: Remove duplicate prj_.conf files" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5795561b0c43f152112133a447884f1166ed02e2. Signed-off-by: Tomasz Moń --- tests/bluetooth/init/prj_14.conf | 5 +++++ tests/bluetooth/init/prj_7.conf | 5 +++++ tests/bluetooth/init/prj_8.conf | 6 ++++++ tests/bluetooth/init/prj_9.conf | 6 ++++++ tests/bluetooth/init/testcase.yaml | 12 ++++++++++++ 5 files changed, 34 insertions(+) create mode 100644 tests/bluetooth/init/prj_14.conf create mode 100644 tests/bluetooth/init/prj_7.conf create mode 100644 tests/bluetooth/init/prj_8.conf create mode 100644 tests/bluetooth/init/prj_9.conf diff --git a/tests/bluetooth/init/prj_14.conf b/tests/bluetooth/init/prj_14.conf new file mode 100644 index 000000000000..2a8566b9b467 --- /dev/null +++ b/tests/bluetooth/init/prj_14.conf @@ -0,0 +1,5 @@ +CONFIG_BT=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_SMP=y +CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_7.conf b/tests/bluetooth/init/prj_7.conf new file mode 100644 index 000000000000..2a8566b9b467 --- /dev/null +++ b/tests/bluetooth/init/prj_7.conf @@ -0,0 +1,5 @@ +CONFIG_BT=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_SMP=y +CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_8.conf b/tests/bluetooth/init/prj_8.conf new file mode 100644 index 000000000000..6dfcf4d7f59c --- /dev/null +++ b/tests/bluetooth/init/prj_8.conf @@ -0,0 +1,6 @@ +CONFIG_BT=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_SMP=y +CONFIG_BT_SMP_SC_ONLY=y +CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_9.conf b/tests/bluetooth/init/prj_9.conf new file mode 100644 index 000000000000..6dfcf4d7f59c --- /dev/null +++ b/tests/bluetooth/init/prj_9.conf @@ -0,0 +1,6 @@ +CONFIG_BT=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_SMP=y +CONFIG_BT_SMP_SC_ONLY=y +CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/testcase.yaml b/tests/bluetooth/init/testcase.yaml index bbefd93265c1..a5cc40cd39e7 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -22,6 +22,9 @@ tests: bluetooth.init.test_13: extra_args: CONF_FILE=prj_13.conf platform_allow: qemu_cortex_m3 + bluetooth.init.test_14: + extra_args: CONF_FILE=prj_14.conf + platform_allow: qemu_cortex_m3 bluetooth.init.test_15: extra_args: CONF_FILE=prj_15.conf platform_allow: qemu_cortex_m3 @@ -61,6 +64,15 @@ tests: bluetooth.init.test_6: extra_args: CONF_FILE=prj_6.conf platform_allow: qemu_cortex_m3 + bluetooth.init.test_7: + extra_args: CONF_FILE=prj_7.conf + platform_allow: qemu_cortex_m3 + bluetooth.init.test_8: + extra_args: CONF_FILE=prj_8.conf + platform_allow: qemu_cortex_m3 + bluetooth.init.test_9: + extra_args: CONF_FILE=prj_9.conf + platform_allow: qemu_cortex_m3 bluetooth.init.test_ctlr: extra_args: - CONF_FILE=prj_ctlr.conf From f659a9675018be6a0a05bf905bd312597e78c7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1003/3334] Revert "[nrf fromtree] bluetooth: host: Deprecate CONFIG_BT_SIGNING" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba326ed79ee187960ef3cdf60c130d275f1fe1c3. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.4.rst | 6 ---- include/zephyr/bluetooth/gatt.h | 4 +-- samples/bluetooth/direct_adv/prj.conf | 1 + samples/bluetooth/direct_adv/src/main.c | 23 ++++++------- samples/bluetooth/peripheral/prj.conf | 1 + samples/bluetooth/peripheral/src/main.c | 33 +++++++++++++++++++ .../bluetooth/peripheral_accept_list/prj.conf | 1 + .../peripheral_accept_list/src/main.c | 18 +++++----- subsys/bluetooth/host/Kconfig | 1 - subsys/bluetooth/host/shell/gatt.c | 4 +++ tests/bluetooth/init/prj_10.conf | 1 + tests/bluetooth/init/prj_11.conf | 1 + tests/bluetooth/init/prj_12.conf | 1 + tests/bluetooth/init/prj_13.conf | 1 + tests/bluetooth/init/prj_14.conf | 1 + tests/bluetooth/init/prj_17.conf | 1 + tests/bluetooth/init/prj_20.conf | 1 + tests/bluetooth/init/prj_21.conf | 1 + tests/bluetooth/init/prj_7.conf | 1 + tests/bluetooth/init/prj_8.conf | 1 + tests/bluetooth/init/prj_9.conf | 1 + tests/bluetooth/init/prj_ctlr.conf | 1 + tests/bluetooth/init/prj_ctlr_4_0.conf | 1 + tests/bluetooth/init/prj_ctlr_4_0_dbg.conf | 1 + tests/bluetooth/init/prj_ctlr_5_x_dbg.conf | 1 + tests/bluetooth/init/prj_ctlr_dbg.conf | 1 + tests/bluetooth/init/prj_ctlr_ticker.conf | 1 + tests/bluetooth/init/prj_ctlr_tiny.conf | 1 + tests/bluetooth/init/prj_llcp.conf | 1 + tests/bluetooth/shell/audio.conf | 1 + tests/bluetooth/shell/log.conf | 1 + tests/bluetooth/shell/mesh.conf | 1 + tests/bluetooth/shell/prj.conf | 1 + tests/bluetooth/shell/prj_br.conf | 1 + tests/bluetooth/tester/prj.conf | 1 + tests/bluetooth/tester/src/btp/btp_gatt.h | 8 +++++ tests/bluetooth/tester/src/btp_gatt.c | 33 +++++++++++++++++++ tests/bsim/bluetooth/ll/conn/prj_split.conf | 1 + .../bsim/bluetooth/ll/conn/prj_split_1ms.conf | 1 + .../bluetooth/ll/conn/prj_split_hci_uart.conf | 1 + .../bluetooth/ll/conn/prj_split_low_lat.conf | 1 + .../bluetooth/ll/conn/prj_split_privacy.conf | 1 + .../ll/conn/prj_split_single_timer.conf | 1 + .../bluetooth/ll/conn/prj_split_tx_defer.conf | 1 + .../edtt/gatt_test_app/src/gatt/service_f_1.c | 3 +- .../ll/edtt/tests_scripts/gatt.llcp.test_list | 8 ++--- tests/bsim/bluetooth/tester/src/bsim_btp.c | 2 ++ 47 files changed, 142 insertions(+), 36 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 7966cd0f25e3..b10c86e9f23b 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -35,12 +35,6 @@ Device Drivers and Devicetree Bluetooth ********* -Bluetooth Host -============== - -* :kconfig:option:`CONFIG_BT_SIGNING` has been deprecated. -* :c:macro:`BT_GATT_CHRC_AUTH` has been deprecated. - Networking ********** diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 353f8b248edd..8023e3a0d9ee 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -462,11 +462,9 @@ struct bt_gatt_authorization_cb { /** * @brief Characteristic Authenticated Signed Writes property. * - * @deprecated This API is deprecated. - * * If set, permits signed writes to the Characteristic Value. */ -#define BT_GATT_CHRC_AUTH 0x40 __DEPRECATED_MACRO +#define BT_GATT_CHRC_AUTH 0x40 /** * @brief Characteristic Extended Properties property. * diff --git a/samples/bluetooth/direct_adv/prj.conf b/samples/bluetooth/direct_adv/prj.conf index 410ed9166302..2af54670b51c 100644 --- a/samples/bluetooth/direct_adv/prj.conf +++ b/samples/bluetooth/direct_adv/prj.conf @@ -4,6 +4,7 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT=y CONFIG_LOG=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DIS=y CONFIG_BT_ATT_PREPARE_COUNT=1 diff --git a/samples/bluetooth/direct_adv/src/main.c b/samples/bluetooth/direct_adv/src/main.c index 24c3a53940c1..992c6e46059c 100644 --- a/samples/bluetooth/direct_adv/src/main.c +++ b/samples/bluetooth/direct_adv/src/main.c @@ -32,25 +32,26 @@ static const struct bt_uuid_128 read_characteristic_uuid = BT_UUID_INIT_128( static const struct bt_uuid_128 write_characteristic_uuid = BT_UUID_INIT_128( BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef2)); -static int stored_value; +static int signed_value; static struct bt_le_adv_param adv_param; static bt_addr_le_t bond_addr; -static ssize_t read_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, - uint16_t len, uint16_t offset) +static ssize_t read_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, + void *buf, uint16_t len, uint16_t offset) { - int *value = &stored_value; + int *value = &signed_value; return bt_gatt_attr_read(conn, attr, buf, len, offset, value, - sizeof(stored_value)); + sizeof(signed_value)); } -static ssize_t write_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, - uint16_t len, uint16_t offset, uint8_t flags) +static ssize_t write_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, + const void *buf, uint16_t len, uint16_t offset, + uint8_t flags) { - int *value = &stored_value; + int *value = &signed_value; - if (offset + len > sizeof(stored_value)) { + if (offset + len > sizeof(signed_value)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET); } @@ -65,11 +66,11 @@ BT_GATT_SERVICE_DEFINE(primary_service, BT_GATT_CHARACTERISTIC(&read_characteristic_uuid.uuid, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, - read_cb, NULL, NULL), + read_signed, NULL, NULL), BT_GATT_CHARACTERISTIC(&write_characteristic_uuid.uuid, BT_GATT_CHRC_WRITE, BT_GATT_PERM_WRITE_ENCRYPT, - NULL, write_cb, NULL), + NULL, write_signed, NULL), ); static const struct bt_data ad[] = { diff --git a/samples/bluetooth/peripheral/prj.conf b/samples/bluetooth/peripheral/prj.conf index 493660afa339..f788fa670aa3 100644 --- a/samples/bluetooth/peripheral/prj.conf +++ b/samples/bluetooth/peripheral/prj.conf @@ -4,6 +4,7 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT=y CONFIG_LOG=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DIS=y CONFIG_BT_ATT_PREPARE_COUNT=5 diff --git a/samples/bluetooth/peripheral/src/main.c b/samples/bluetooth/peripheral/src/main.c index 3f15aee100af..db77691db613 100644 --- a/samples/bluetooth/peripheral/src/main.c +++ b/samples/bluetooth/peripheral/src/main.c @@ -130,6 +130,35 @@ static struct bt_gatt_cep vnd_long_cep = { .properties = BT_GATT_CEP_RELIABLE_WRITE, }; +static int signed_value; + +static ssize_t read_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, + void *buf, uint16_t len, uint16_t offset) +{ + const char *value = attr->user_data; + + return bt_gatt_attr_read(conn, attr, buf, len, offset, value, + sizeof(signed_value)); +} + +static ssize_t write_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, + const void *buf, uint16_t len, uint16_t offset, + uint8_t flags) +{ + uint8_t *value = attr->user_data; + + if (offset + len > sizeof(signed_value)) { + return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET); + } + + memcpy(value + offset, buf, len); + + return len; +} + +static const struct bt_uuid_128 vnd_signed_uuid = BT_UUID_INIT_128( + BT_UUID_128_ENCODE(0x13345678, 0x1234, 0x5678, 0x1334, 0x56789abcdef3)); + static const struct bt_uuid_128 vnd_write_cmd_uuid = BT_UUID_INIT_128( BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef4)); @@ -179,6 +208,10 @@ BT_GATT_SERVICE_DEFINE(vnd_svc, BT_GATT_PERM_PREPARE_WRITE, read_vnd, write_long_vnd, &vnd_long_value), BT_GATT_CEP(&vnd_long_cep), + BT_GATT_CHARACTERISTIC(&vnd_signed_uuid.uuid, BT_GATT_CHRC_READ | + BT_GATT_CHRC_WRITE | BT_GATT_CHRC_AUTH, + BT_GATT_PERM_READ | BT_GATT_PERM_WRITE, + read_signed, write_signed, &signed_value), BT_GATT_CHARACTERISTIC(&vnd_write_cmd_uuid.uuid, BT_GATT_CHRC_WRITE_WITHOUT_RESP, BT_GATT_PERM_WRITE, NULL, diff --git a/samples/bluetooth/peripheral_accept_list/prj.conf b/samples/bluetooth/peripheral_accept_list/prj.conf index a9a0e6ecedc8..563ee758d2ec 100644 --- a/samples/bluetooth/peripheral_accept_list/prj.conf +++ b/samples/bluetooth/peripheral_accept_list/prj.conf @@ -4,6 +4,7 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT=y CONFIG_LOG=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DIS=y CONFIG_BT_ATT_PREPARE_COUNT=1 diff --git a/samples/bluetooth/peripheral_accept_list/src/main.c b/samples/bluetooth/peripheral_accept_list/src/main.c index fcb930bdca55..e14ea8dd9977 100644 --- a/samples/bluetooth/peripheral_accept_list/src/main.c +++ b/samples/bluetooth/peripheral_accept_list/src/main.c @@ -29,26 +29,26 @@ static const struct bt_uuid_128 read_characteristic_uuid = BT_UUID_INIT_128( static const struct bt_uuid_128 write_characteristic_uuid = BT_UUID_INIT_128( BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef2)); -static int stored_value; +static int signed_value; static struct bt_le_adv_param adv_param; static int bond_count; -static ssize_t read_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, +static ssize_t read_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset) { - int *value = &stored_value; + int *value = &signed_value; return bt_gatt_attr_read(conn, attr, buf, len, offset, value, - sizeof(stored_value)); + sizeof(signed_value)); } -static ssize_t write_cb(struct bt_conn *conn, const struct bt_gatt_attr *attr, +static ssize_t write_signed(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags) { - int *value = &stored_value; + int *value = &signed_value; - if (offset + len > sizeof(stored_value)) { + if (offset + len > sizeof(signed_value)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET); } @@ -63,11 +63,11 @@ BT_GATT_SERVICE_DEFINE(primary_service, BT_GATT_CHARACTERISTIC(&read_characteristic_uuid.uuid, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, - read_cb, NULL, NULL), + read_signed, NULL, NULL), BT_GATT_CHARACTERISTIC(&write_characteristic_uuid.uuid, BT_GATT_CHRC_WRITE, BT_GATT_PERM_WRITE_ENCRYPT, - NULL, write_cb, NULL), + NULL, write_signed, NULL), ); static const struct bt_data ad[] = { diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 8920d41d0e07..862f71c3651c 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -562,7 +562,6 @@ config BT_RPA_SHARING config BT_SIGNING bool "Data signing support" - select DEPRECATED help This option enables data signing which is used for transferring authenticated data in an unencrypted connection. diff --git a/subsys/bluetooth/host/shell/gatt.c b/subsys/bluetooth/host/shell/gatt.c index 013b878a6af3..00dbd8dc8e26 100644 --- a/subsys/bluetooth/host/shell/gatt.c +++ b/subsys/bluetooth/host/shell/gatt.c @@ -172,6 +172,10 @@ static void print_chrc_props(uint8_t properties) bt_shell_print("[indicate]"); } + if (properties & BT_GATT_CHRC_AUTH) { + bt_shell_print("[auth]"); + } + if (properties & BT_GATT_CHRC_EXT_PROP) { bt_shell_print("[ext prop]"); } diff --git a/tests/bluetooth/init/prj_10.conf b/tests/bluetooth/init/prj_10.conf index a44edf5f7b64..81503cadb9a1 100644 --- a/tests/bluetooth/init/prj_10.conf +++ b/tests/bluetooth/init/prj_10.conf @@ -2,6 +2,7 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_11.conf b/tests/bluetooth/init/prj_11.conf index 84510c4b8c86..a5492c5c1eb4 100644 --- a/tests/bluetooth/init/prj_11.conf +++ b/tests/bluetooth/init/prj_11.conf @@ -2,6 +2,7 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_12.conf b/tests/bluetooth/init/prj_12.conf index 3bf4b202d62e..16fc86e8f823 100644 --- a/tests/bluetooth/init/prj_12.conf +++ b/tests/bluetooth/init/prj_12.conf @@ -1,6 +1,7 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_13.conf b/tests/bluetooth/init/prj_13.conf index 426b3d6aed5f..aa8cc1220837 100644 --- a/tests/bluetooth/init/prj_13.conf +++ b/tests/bluetooth/init/prj_13.conf @@ -1,6 +1,7 @@ CONFIG_BT=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_14.conf b/tests/bluetooth/init/prj_14.conf index 2a8566b9b467..93423f647420 100644 --- a/tests/bluetooth/init/prj_14.conf +++ b/tests/bluetooth/init/prj_14.conf @@ -2,4 +2,5 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_17.conf b/tests/bluetooth/init/prj_17.conf index e179900c641b..5e504b9ead15 100644 --- a/tests/bluetooth/init/prj_17.conf +++ b/tests/bluetooth/init/prj_17.conf @@ -2,6 +2,7 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_20.conf b/tests/bluetooth/init/prj_20.conf index 80c0ad4657d4..4b80a6b44271 100644 --- a/tests/bluetooth/init/prj_20.conf +++ b/tests/bluetooth/init/prj_20.conf @@ -2,6 +2,7 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_21.conf b/tests/bluetooth/init/prj_21.conf index d796dcbdfc4a..49c4c6eb452b 100644 --- a/tests/bluetooth/init/prj_21.conf +++ b/tests/bluetooth/init/prj_21.conf @@ -2,6 +2,7 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_7.conf b/tests/bluetooth/init/prj_7.conf index 2a8566b9b467..93423f647420 100644 --- a/tests/bluetooth/init/prj_7.conf +++ b/tests/bluetooth/init/prj_7.conf @@ -2,4 +2,5 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_8.conf b/tests/bluetooth/init/prj_8.conf index 6dfcf4d7f59c..2fdd77730098 100644 --- a/tests/bluetooth/init/prj_8.conf +++ b/tests/bluetooth/init/prj_8.conf @@ -2,5 +2,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_9.conf b/tests/bluetooth/init/prj_9.conf index 6dfcf4d7f59c..2fdd77730098 100644 --- a/tests/bluetooth/init/prj_9.conf +++ b/tests/bluetooth/init/prj_9.conf @@ -2,5 +2,6 @@ CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_ctlr.conf b/tests/bluetooth/init/prj_ctlr.conf index 67a638b1e078..c733ef4ad3fc 100644 --- a/tests/bluetooth/init/prj_ctlr.conf +++ b/tests/bluetooth/init/prj_ctlr.conf @@ -3,6 +3,7 @@ CONFIG_BT_HCI_ACL_FLOW_CONTROL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_4_0.conf b/tests/bluetooth/init/prj_ctlr_4_0.conf index da51ab380e86..98dcaaa746c8 100644 --- a/tests/bluetooth/init/prj_ctlr_4_0.conf +++ b/tests/bluetooth/init/prj_ctlr_4_0.conf @@ -27,6 +27,7 @@ CONFIG_BT_HCI_VS=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_4_0_dbg.conf b/tests/bluetooth/init/prj_ctlr_4_0_dbg.conf index bc4125363d60..476213c82731 100644 --- a/tests/bluetooth/init/prj_ctlr_4_0_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_4_0_dbg.conf @@ -31,6 +31,7 @@ CONFIG_BT_CTLR_VS_SCAN_REQ_RX=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf b/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf index 0793716a8674..828b486b88fc 100644 --- a/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_5_x_dbg.conf @@ -55,6 +55,7 @@ CONFIG_BT_ISO_SYNC_RECEIVER=y CONFIG_BT_ISO_CENTRAL=y CONFIG_BT_ISO_PERIPHERAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_ctlr_dbg.conf b/tests/bluetooth/init/prj_ctlr_dbg.conf index 497d684c9e29..956c562c5aa0 100644 --- a/tests/bluetooth/init/prj_ctlr_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_dbg.conf @@ -39,6 +39,7 @@ CONFIG_BT_HCI_MESH_EXT=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_ctlr_ticker.conf b/tests/bluetooth/init/prj_ctlr_ticker.conf index bf5f351c72a2..ac15e8662a6b 100644 --- a/tests/bluetooth/init/prj_ctlr_ticker.conf +++ b/tests/bluetooth/init/prj_ctlr_ticker.conf @@ -37,6 +37,7 @@ CONFIG_BT_HCI_MESH_EXT=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_USE_DEBUG_KEYS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/init/prj_ctlr_tiny.conf b/tests/bluetooth/init/prj_ctlr_tiny.conf index b625ea9918bb..e3413d68e981 100644 --- a/tests/bluetooth/init/prj_ctlr_tiny.conf +++ b/tests/bluetooth/init/prj_ctlr_tiny.conf @@ -31,6 +31,7 @@ CONFIG_BT_HCI_VS=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/init/prj_llcp.conf b/tests/bluetooth/init/prj_llcp.conf index 2baa0f1e158e..2bbcfb83834a 100644 --- a/tests/bluetooth/init/prj_llcp.conf +++ b/tests/bluetooth/init/prj_llcp.conf @@ -3,6 +3,7 @@ CONFIG_BT_HCI_ACL_FLOW_CONTROL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/shell/audio.conf b/tests/bluetooth/shell/audio.conf index a7f19336e777..45236a49afae 100644 --- a/tests/bluetooth/shell/audio.conf +++ b/tests/bluetooth/shell/audio.conf @@ -21,6 +21,7 @@ CONFIG_BT_GATT_DYNAMIC_DB=y CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y CONFIG_BT_GATT_AUTO_UPDATE_MTU=y CONFIG_BT_L2CAP_ECRED=y +CONFIG_BT_SIGNING=y CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=5 CONFIG_BT_SHELL=y diff --git a/tests/bluetooth/shell/log.conf b/tests/bluetooth/shell/log.conf index 7cb83fb87644..2da43186e19f 100644 --- a/tests/bluetooth/shell/log.conf +++ b/tests/bluetooth/shell/log.conf @@ -8,6 +8,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/shell/mesh.conf b/tests/bluetooth/shell/mesh.conf index 1e11b5ae75ca..0336d417fb51 100644 --- a/tests/bluetooth/shell/mesh.conf +++ b/tests/bluetooth/shell/mesh.conf @@ -9,6 +9,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 8a9fb1c0ee9e..2c84d55bd69a 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -10,6 +10,7 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_PASSKEY_KEYPRESS=y +CONFIG_BT_SIGNING=y CONFIG_BT_APP_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/shell/prj_br.conf b/tests/bluetooth/shell/prj_br.conf index e9afa4026a34..3f27954ca230 100644 --- a/tests/bluetooth/shell/prj_br.conf +++ b/tests/bluetooth/shell/prj_br.conf @@ -11,6 +11,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_HRS=y diff --git a/tests/bluetooth/tester/prj.conf b/tests/bluetooth/tester/prj.conf index 901042287ce9..382ed5eb6cdc 100644 --- a/tests/bluetooth/tester/prj.conf +++ b/tests/bluetooth/tester/prj.conf @@ -14,6 +14,7 @@ CONFIG_BT_SMP_MIN_ENC_KEY_SIZE=7 CONFIG_BT_SMP_ENFORCE_MITM=n CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y CONFIG_BT_SMP_APP_PAIRING_ACCEPT=y +CONFIG_BT_SIGNING=y CONFIG_BT_BONDABLE=y CONFIG_BT_ATT_PREPARE_COUNT=12 CONFIG_BT_GATT_CLIENT=y diff --git a/tests/bluetooth/tester/src/btp/btp_gatt.h b/tests/bluetooth/tester/src/btp/btp_gatt.h index 1eef848aa30e..e26b3767b6a9 100644 --- a/tests/bluetooth/tester/src/btp/btp_gatt.h +++ b/tests/bluetooth/tester/src/btp/btp_gatt.h @@ -240,6 +240,14 @@ struct btp_gatt_write_without_rsp_cmd { uint8_t data[]; } __packed; +#define BTP_GATT_SIGNED_WRITE_WITHOUT_RSP 0x16 +struct btp_gatt_signed_write_without_rsp_cmd { + bt_addr_le_t address; + uint16_t handle; + uint16_t data_length; + uint8_t data[]; +} __packed; + #define BTP_GATT_WRITE 0x17 struct btp_gatt_write_cmd { bt_addr_le_t address; diff --git a/tests/bluetooth/tester/src/btp_gatt.c b/tests/bluetooth/tester/src/btp_gatt.c index e487dd2884d1..e5f4b9584937 100644 --- a/tests/bluetooth/tester/src/btp_gatt.c +++ b/tests/bluetooth/tester/src/btp_gatt.c @@ -1757,6 +1757,34 @@ static uint8_t write_without_rsp(const void *cmd, uint16_t cmd_len, return BTP_STATUS_SUCCESS; } +static uint8_t write_signed_without_rsp(const void *cmd, uint16_t cmd_len, + void *rsp, uint16_t *rsp_len) +{ + const struct btp_gatt_signed_write_without_rsp_cmd *cp = cmd; + struct bt_conn *conn; + + if (cmd_len < sizeof(*cp) || + cmd_len != sizeof(*cp) + sys_le16_to_cpu(cp->data_length)) { + return BTP_STATUS_FAILED; + } + + conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); + if (!conn) { + return BTP_STATUS_FAILED; + } + + if (bt_gatt_write_without_response(conn, sys_le16_to_cpu(cp->handle), + cp->data, + sys_le16_to_cpu(cp->data_length), + true) < 0) { + bt_conn_unref(conn); + return BTP_STATUS_FAILED; + } + + bt_conn_unref(conn); + return BTP_STATUS_SUCCESS; +} + static void write_rsp(struct bt_conn *conn, uint8_t err, struct bt_gatt_write_params *params) { @@ -2505,6 +2533,11 @@ static const struct btp_handler handlers[] = { .expect_len = BTP_HANDLER_LENGTH_VARIABLE, .func = write_without_rsp, }, + { + .opcode = BTP_GATT_SIGNED_WRITE_WITHOUT_RSP, + .expect_len = BTP_HANDLER_LENGTH_VARIABLE, + .func = write_signed_without_rsp, + }, { .opcode = BTP_GATT_WRITE, .expect_len = BTP_HANDLER_LENGTH_VARIABLE, diff --git a/tests/bsim/bluetooth/ll/conn/prj_split.conf b/tests/bsim/bluetooth/ll/conn/prj_split.conf index c888d586e4b3..94eae38bf62e 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split.conf @@ -4,6 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_1ms.conf b/tests/bsim/bluetooth/ll/conn/prj_split_1ms.conf index def3752f0167..58276bd991e6 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_1ms.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_1ms.conf @@ -4,6 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 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 0ef6b9fb783d..f97b14c88a7b 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_hci_uart.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_hci_uart.conf @@ -5,6 +5,7 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_SMP_SC_PAIR_ONLY=n +CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_low_lat.conf b/tests/bsim/bluetooth/ll/conn/prj_split_low_lat.conf index b07055f8dba6..b00b6c74b934 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_low_lat.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_low_lat.conf @@ -4,6 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_privacy.conf b/tests/bsim/bluetooth/ll/conn/prj_split_privacy.conf index 02e83a4351f7..1147e89ada69 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_privacy.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_privacy.conf @@ -5,6 +5,7 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_SMP_SC_PAIR_ONLY=n +CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_single_timer.conf b/tests/bsim/bluetooth/ll/conn/prj_split_single_timer.conf index 461b5e800958..9d446e0149f8 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_single_timer.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_single_timer.conf @@ -4,6 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_tx_defer.conf b/tests/bsim/bluetooth/ll/conn/prj_split_tx_defer.conf index 147a8f7598bb..22dc32be4c42 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_tx_defer.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_tx_defer.conf @@ -4,6 +4,7 @@ CONFIG_BT_CENTRAL=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y +CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 diff --git a/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/service_f_1.c b/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/service_f_1.c index 04ea7f4b7c5d..374e639862af 100644 --- a/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/service_f_1.c +++ b/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/service_f_1.c @@ -1,6 +1,5 @@ /** * Copyright (c) 2019 Oticon A/S - * Copyright (c) 2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -382,7 +381,7 @@ static struct bt_gatt_attr service_f_1_attrs[] = { BT_GATT_PERM_READ, read_agg_format, NULL, &agg_format_value, 0xAF), BT_GATT_H_CHARACTERISTIC(BT_UUID_VALUE_V17, - BT_GATT_CHRC_READ, + BT_GATT_CHRC_READ | BT_GATT_CHRC_AUTH, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE, read_value_v17, NULL, &value_v17_value, 0xB0) }; diff --git a/tests/bsim/bluetooth/ll/edtt/tests_scripts/gatt.llcp.test_list b/tests/bsim/bluetooth/ll/edtt/tests_scripts/gatt.llcp.test_list index d8ccaee301ef..d606038298ce 100644 --- a/tests/bsim/bluetooth/ll/edtt/tests_scripts/gatt.llcp.test_list +++ b/tests/bsim/bluetooth/ll/edtt/tests_scripts/gatt.llcp.test_list @@ -8,8 +8,8 @@ GATT/SR/GAC/BV-01-C GATT/SR/GAD/BV-01-C GATT/SR/GAD/BV-02-C GATT/SR/GAD/BV-03-C -# GATT/SR/GAD/BV-04-C https://github.com/EDTTool/EDTT/issues/89 -# GATT/SR/GAD/BV-05-C https://github.com/EDTTool/EDTT/issues/89 +GATT/SR/GAD/BV-04-C +GATT/SR/GAD/BV-05-C GATT/SR/GAD/BV-06-C GATT/SR/GAR/BV-01-C GATT/SR/GAR/BI-01-C @@ -22,7 +22,7 @@ GATT/SR/GAR/BI-07-C GATT/SR/GAR/BI-09-C GATT/SR/GAR/BI-10-C #GATT/SR/GAR/BI-11-C https://github.com/EDTTool/EDTT/issues/82 -# GATT/SR/GAR/BV-04-C https://github.com/EDTTool/EDTT/issues/89 +GATT/SR/GAR/BV-04-C GATT/SR/GAR/BI-12-C GATT/SR/GAR/BI-13-C GATT/SR/GAR/BI-14-C @@ -64,7 +64,7 @@ GATT/SR/UNS/BI-02-C GATT/SR/GPA/BV-01-C GATT/SR/GPA/BV-02-C GATT/SR/GPA/BV-03-C -# GATT/SR/GPA/BV-04-C https://github.com/EDTTool/EDTT/issues/89 +GATT/SR/GPA/BV-04-C GATT/SR/GPA/BV-05-C GATT/SR/GPA/BV-06-C GATT/SR/GPA/BV-07-C diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.c b/tests/bsim/bluetooth/tester/src/bsim_btp.c index 19b196d1fe62..2e24514b6606 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.c +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.c @@ -410,6 +410,8 @@ static bool is_valid_gatt_packet_len(const struct btp_hdr *hdr, struct net_buf_s } case BTP_GATT_WRITE_WITHOUT_RSP: return buf_simple->len == 0U; + case BTP_GATT_SIGNED_WRITE_WITHOUT_RSP: + return buf_simple->len == 0U; case BTP_GATT_WRITE: return buf_simple->len == sizeof(struct btp_gatt_write_rp); case BTP_GATT_WRITE_LONG: From 23ed91c4c79ec2519ac072093317a16e33b3d6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1004/3334] Revert "[nrf fromtree] bluetooth: host: Add bt_gatt_cb_unregister() to unregister GATT callbacks" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7ce0b7556bf799b73249abe9057c62f98c7546c9. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.4.rst | 6 ------ include/zephyr/bluetooth/gatt.h | 11 ----------- subsys/bluetooth/host/gatt.c | 17 ++--------------- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 9622d9c5bd38..d6277acc7161 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -65,12 +65,6 @@ Deprecated APIs and options New APIs and options ==================== -* Bluetooth - - * Host - - * :c:func:`bt_gatt_cb_unregister` Added an API to unregister GATT callback handlers. - .. Link to new APIs here, in a group if you think it's necessary, no need to get fancy just list the link, that should contain the documentation. If you feel diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 8023e3a0d9ee..17b125d602c5 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -622,17 +622,6 @@ static inline const char *bt_gatt_err_to_str(int gatt_err) */ void bt_gatt_cb_register(struct bt_gatt_cb *cb); -/** @brief Unregister GATT callbacks. - * - * Unregister callbacks for monitoring the state of GATT. The callback - * struct should be one that was previously registered. - * - * @param cb Callback struct. - * - * @return 0 in case of success or negative value in case of error. - */ -int bt_gatt_cb_unregister(struct bt_gatt_cb *cb); - /** @brief Register GATT authorization callbacks. * * Register callbacks to perform application-specific authorization of GATT diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 4e8b7c78244c..ea1dc73e158a 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1628,19 +1628,6 @@ void bt_gatt_cb_register(struct bt_gatt_cb *cb) sys_slist_append(&callback_list, &cb->node); } -int bt_gatt_cb_unregister(struct bt_gatt_cb *cb) -{ - if (cb == NULL) { - return -EINVAL; - } - - if (!sys_slist_find_and_remove(&callback_list, &cb->node)) { - return -ENOENT; - } - - return 0; -} - #if defined(CONFIG_BT_GATT_DYNAMIC_DB) static void db_changed(void) { @@ -6036,9 +6023,9 @@ void bt_gatt_connected(struct bt_conn *conn) void bt_gatt_att_max_mtu_changed(struct bt_conn *conn, uint16_t tx, uint16_t rx) { - struct bt_gatt_cb *cb, *tmp; + struct bt_gatt_cb *cb; - SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&callback_list, cb, tmp, node) { + SYS_SLIST_FOR_EACH_CONTAINER(&callback_list, cb, node) { if (cb->att_mtu_updated) { cb->att_mtu_updated(conn, tx, rx); } From 22e15ab01b742bad010c8249a3f738a07c683a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1005/3334] Revert "[nrf noup] tests: ram_context_for_isr: Disable KMU by default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8116dbcc6173ae9a1d6c526ec39f6c9b8c09de8d. Signed-off-by: Tomasz Moń --- .../boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ------ .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ------ .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ------ .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ------ .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ------ .../boards/nrf7120pdk_nrf7120_cpuapp.conf | 6 ------ 6 files changed, 36 deletions(-) delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n From d8994266c8b397a9f91dd7da413bdb0382ae9674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1006/3334] Revert "[nrf noup] drivers: can: mcan: implement CAN_MODE_ONE_SHOT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit efadad5f9c1cca4ccfb6903cca8897558f1b1e2e. Signed-off-by: Tomasz Moń --- drivers/can/Kconfig.mcan | 15 ---- drivers/can/can_mcan.c | 114 +------------------------- include/zephyr/drivers/can/can_mcan.h | 1 - 3 files changed, 2 insertions(+), 128 deletions(-) diff --git a/drivers/can/Kconfig.mcan b/drivers/can/Kconfig.mcan index 96c5f22446f6..db09fc800c11 100644 --- a/drivers/can/Kconfig.mcan +++ b/drivers/can/Kconfig.mcan @@ -7,18 +7,3 @@ config CAN_MCAN bool help Enable the Bosch M_CAN CAN IP module driver backend. - -if CAN_MCAN - -config CAN_MCAN_TXBCF_POLL_INTERVAL_MS - int "Polling interval in milliseconds of TXBCF register if DAR is enabled" - default 75 - help - When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, - is enabled, and a transmission fails, a bug in the MCAN IP prevents the - TCF (Transmission Cancellation Finalized) interrupt from triggering, - despite the correct bit being set in the TXBCF register. It is thus - necessary to poll TXBCF register to detect when a transmission failed if - DAR is enabled. - -endif # CAN_MCAN diff --git a/drivers/can/can_mcan.c b/drivers/can/can_mcan.c index e82cac4f19ad..a69a4b2398df 100644 --- a/drivers/can/can_mcan.c +++ b/drivers/can/can_mcan.c @@ -17,7 +17,6 @@ LOG_MODULE_REGISTER(can_mcan, CONFIG_CAN_LOG_LEVEL); #define CAN_INIT_TIMEOUT_MS 100 -#define TXBCF_TIMER_TIMEOUT K_MSEC(CONFIG_CAN_MCAN_TXBCF_POLL_INTERVAL_MS) int can_mcan_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) { @@ -277,7 +276,7 @@ int can_mcan_get_capabilities(const struct device *dev, can_mode_t *cap) { ARG_UNUSED(dev); - *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; + *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; if (IS_ENABLED(CONFIG_CAN_MANUAL_RECOVERY_MODE)) { *cap |= CAN_MODE_MANUAL_RECOVERY; @@ -323,78 +322,12 @@ int can_mcan_start(const struct device *dev) return err; } - uint32_t cccr; - - err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); - if (err != 0) { - return err; - } - - if (cccr & CAN_MCAN_CCCR_DAR) { - /* - * When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, - * is enabled, and a transmission fails, a bug in the MCAN IP prevents the - * TCF (Transmission Cancellation Finalized) interrupt from triggering, - * despite the correct bit being set in the TXBCF register. It is thus - * necessary to poll TXBCF register to detect when a transmission failed if - * DAR is enabled. - */ - k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); - } - data->common.started = true; pm_device_busy_set(dev); return err; } -static int can_mcan_read_txbcf(const struct device *dev) -{ - const struct can_mcan_config *config = dev->config; - const struct can_mcan_callbacks *cbs = config->callbacks; - struct can_mcan_data *data = dev->data; - uint32_t txbcfs; - int err; - can_tx_callback_t tx_cb; - void *user_data; - - err = can_mcan_read_reg(dev, CAN_MCAN_TXBCF, &txbcfs); - if (err != 0) { - LOG_ERR("failed to read tx cancellation finished (err %d)", err); - return err; - } - - if (txbcfs == 0) { - return 0; - } - - for (size_t tx_idx = 0; tx_idx < cbs->num_tx; tx_idx++) { - if ((txbcfs & BIT(tx_idx)) == 0) { - continue; - } - - if (cbs->tx[tx_idx].function == NULL) { - continue; - } - - tx_cb = cbs->tx[tx_idx].function; - user_data = cbs->tx[tx_idx].user_data; - cbs->tx[tx_idx].function = NULL; - LOG_DBG("tx buffer cancellation finished (idx %u)", tx_idx); - k_sem_give(&data->tx_sem); - tx_cb(dev, -EIO, user_data); - } - - return 0; -} - -static void can_mcan_txbcf_timer_handler(struct k_timer *timer_id) -{ - const struct device *dev = k_timer_user_data_get(timer_id); - - can_mcan_read_txbcf(dev); -} - static bool can_mcan_rx_filters_exist(const struct device *dev) { const struct can_mcan_config *config = dev->config; @@ -429,8 +362,6 @@ int can_mcan_stop(const struct device *dev) return -EALREADY; } - k_timer_stop(&data->txbcf_timer); - /* CAN transmissions are automatically stopped when entering init mode */ err = can_mcan_enter_init_mode(dev, K_MSEC(CAN_INIT_TIMEOUT_MS)); if (err != 0) { @@ -471,7 +402,7 @@ int can_mcan_stop(const struct device *dev) int can_mcan_set_mode(const struct device *dev, can_mode_t mode) { - can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; + can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; struct can_mcan_data *data = dev->data; uint32_t cccr; uint32_t test; @@ -529,13 +460,6 @@ int can_mcan_set_mode(const struct device *dev, can_mode_t mode) } #endif /* CONFIG_CAN_FD_MODE */ - if ((mode & CAN_MODE_ONE_SHOT) != 0) { - /* Disable Automatic Retransmission */ - cccr |= CAN_MCAN_CCCR_DAR; - } else { - cccr &= ~CAN_MCAN_CCCR_DAR; - } - err = can_mcan_write_reg(dev, CAN_MCAN_CCCR, cccr); if (err != 0) { goto unlock; @@ -1129,21 +1053,6 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim } } - uint32_t cccr; - - err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); - if (err != 0) { - return err; - } - - if (cccr & CAN_MCAN_CCCR_DAR) { - /* - * TXBCR is cleared after TXBAR is set. Stop timer to ensure - * TXBCR is not read before TXBAR has been set. - */ - k_timer_stop(&data->txbcf_timer); - } - __ASSERT_NO_MSG(put_idx < cbs->num_tx); cbs->tx[put_idx].function = callback; cbs->tx[put_idx].user_data = user_data; @@ -1154,18 +1063,10 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim goto err_unlock; } - if (cccr & CAN_MCAN_CCCR_DAR) { - k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); - } - k_mutex_unlock(&data->tx_mtx); return 0; err_unlock: - if (cccr & CAN_MCAN_CCCR_DAR) { - k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); - } - k_mutex_unlock(&data->tx_mtx); k_sem_give(&data->tx_sem); @@ -1523,8 +1424,6 @@ int can_mcan_init(const struct device *dev) k_mutex_init(&data->lock); k_mutex_init(&data->tx_mtx); k_sem_init(&data->tx_sem, cbs->num_tx, cbs->num_tx); - k_timer_init(&data->txbcf_timer, can_mcan_txbcf_timer_handler, NULL); - k_timer_user_data_set(&data->txbcf_timer, (void *)dev); if (config->common.phy != NULL && !device_is_ready(config->common.phy)) { LOG_ERR("CAN transceiver not ready"); @@ -1666,14 +1565,5 @@ int can_mcan_init(const struct device *dev) return err; } - /* - * Interrupt on every TX buffer cancellation finished event. - */ - reg = CAN_MCAN_TXBCIE_CFIE; - err = can_mcan_write_reg(dev, CAN_MCAN_TXBCIE, reg); - if (err != 0) { - return err; - } - return can_mcan_clear_mram(dev, 0, config->mram_size); } diff --git a/include/zephyr/drivers/can/can_mcan.h b/include/zephyr/drivers/can/can_mcan.h index 28aa899371c8..25eeb437efba 100644 --- a/include/zephyr/drivers/can/can_mcan.h +++ b/include/zephyr/drivers/can/can_mcan.h @@ -1065,7 +1065,6 @@ struct can_mcan_data { struct k_mutex lock; struct k_sem tx_sem; struct k_mutex tx_mtx; - struct k_timer txbcf_timer; void *custom; } __aligned(4); From a80ead163e282f473e4e5aad8ffeaaaccf442329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1007/3334] Revert "[nrf noup] mgmt: mcumgr: Fix nRF5340 network core hook" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6d5efe3b80df4e7caf632647841d8ea4cc25881e. Signed-off-by: Tomasz Moń --- subsys/mgmt/mcumgr/CMakeLists.txt | 13 ++++++------- subsys/mgmt/mcumgr/Kconfig | 2 +- subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 15 ++++++++++++--- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 -------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 3bb21e16f798..ad088eca0677 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -17,11 +17,10 @@ add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) -if(CONFIG_MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index c45cb7f81d6b..1c6a3a2a5162 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,7 @@ menuconfig MCUMGR bool "mcumgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP && MCUMGR_GRP_IMG && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 + imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c index b372ce4e4945..f1ac8a168e65 100644 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -8,10 +8,19 @@ #include #include "bootutil/bootutil_public.h" -int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state) +#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 +/* Sysbuild */ +#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER +#else +/* Legacy child/parent */ +#define NET_CORE_IMAGE 1 +#endif + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) { - if (image_index == CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER) { - /* Pretend that primary slot of the network core update image is unpopulated */ + if (image_index == NET_CORE_IMAGE) { + /* Pretend that primary slot of image 1 unpopulated */ state->magic = BOOT_MAGIC_UNSET; state->swap_type = BOOT_SWAP_TYPE_NONE; state->image_num = image_index; diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index e64f15abd2e6..25979180e2c9 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -237,14 +237,6 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS This will enable the slot info function hooks which can be used to add additional information to responses. -config MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK - bool "nRF5340 network core bootutil hook" - depends on SOC_NRF5340_CPUAPP && BOOT_IMAGE_ACCESS_HOOKS && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 - default y - help - This option will enable a bootutil hook that populates the network core update image - slot with dummy data to allow for uploading a firmware update to the network core. - module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" From 38e15e10c3952a60fb54eb5bbcdc46e0321ab27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1008/3334] Revert "[nrf noup] tests: drivers: mspi: flash: disable psa_rng" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e471dafe200d726897d7573d76b4e91204130e9f. Signed-off-by: Tomasz Moń --- .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 ---- .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 - .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay | 5 ----- 3 files changed, 10 deletions(-) delete mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf delete mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 2e6b6cf5eacc..6e0d84e07cdb 100644 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -8,10 +8,6 @@ aliases { mspi0 = &exmif; }; - - psa_rng: psa-rng { - status = "disabled"; - }; }; &gpio6 { diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index a026df97a458..000000000000 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_PM=n diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay deleted file mode 100644 index 09b4edc100a4..000000000000 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - psa_rng: psa-rng { - status = "disabled"; - }; -}; From e0b93ce2947d04f1221b7f61f0995f263514a487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1009/3334] Revert "[nrf noup] ci: Extend test spec for CI-ble-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2b643c4531d760220a27d9cebb1296b502afcc65. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5fdf9c0ca782..76def875e0be 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -86,8 +86,6 @@ - "samples/tfm_integration/**/*" "CI-ble-test": - - any: - - "arch/arm/**/*" - any: - "drivers/bluetooth/**/*" - any: @@ -99,12 +97,7 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" - - any: - - "boards/nordic/nrf5*" - - any: - - "soc/nordic/**/*" - - any: - - "subsys/pm/**/*" + - "samples/bluetooth/hci_ipc/**/*" "CI-ble-samples-test": - any: From 6ff879cca3c804ec7c8f51ad7f190fe190e696cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1010/3334] Revert "[nrf noup] boards: nordic: Enable PSA RNG for nrf9280" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0d220f23e4eb1c5e9e306879b0b42502b5c148be. Signed-off-by: Tomasz Moń --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 6 ------ boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 6 ------ 2 files changed, 12 deletions(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 19dd5e208063..622fc04e96af 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -26,7 +26,6 @@ zephyr,shell-uart = &uart136; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &psa_rng; }; aliases { @@ -108,11 +107,6 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; }; &cpuapp_ram0x_region { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index 91d967ea34aa..5efa7dbd471c 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -28,18 +28,12 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; }; &cpuapp_cpurad_ram0x_region { From 4ccc188917ad11da484af62094595be830ab9b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:34 +0100 Subject: [PATCH 1011/3334] Revert "[nrf noup] boards: nordic: Enable PSA RNG for nrf54h20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8f80253e7ad61207e91412fad4f830cdc1e4288f. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 6 ------ boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 6 ------ 2 files changed, 12 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index e2d5b08cd300..715eedeb0e8a 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -27,7 +27,6 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; - zephyr,entropy = &psa_rng; }; aliases { @@ -110,11 +109,6 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; }; &cpuapp_bellboard { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 4a8f5972227f..d5fea020431f 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -28,18 +28,12 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; }; &cpurad_bellboard { From 7568df87823475716d4ae2548a2dbd43a868dcf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1012/3334] Revert "[nrf noup] tests: bluetooth: tester: Remove deprecated configs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6aca382718d00391c234d2e4a5eed3886e7c7d7d. Signed-off-by: Tomasz Moń --- tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 + .../sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 0f16f6ea7b4c..51b0ef5fa8d4 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -26,5 +26,6 @@ CONFIG_UART_INTERRUPT_DRIVEN=y # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf index 24e3d84ecf96..b7d64a9e6a08 100644 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -35,5 +35,6 @@ CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y From fcfd1dc648d6779dfccad8845445d4793eeaa90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1013/3334] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding as default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2dcdc2cbe53ac468f10e75ce9f8b0954397e959e. Signed-off-by: Tomasz Moń --- dts/arm/nordic/nrf52805.dtsi | 11 +- dts/arm/nordic/nrf52810.dtsi | 11 +- dts/arm/nordic/nrf52811.dtsi | 11 +- dts/arm/nordic/nrf52820.dtsi | 11 +- dts/arm/nordic/nrf52832.dtsi | 11 +- dts/arm/nordic/nrf52833.dtsi | 11 +- dts/arm/nordic/nrf52840.dtsi | 11 +- dts/arm/nordic/nrf5340_cpunet.dtsi | 11 +- dts/arm/nordic/nrf54h20_cpurad.dtsi | 4 +- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +- dts/vendor/nordic/nrf54h20.dtsi | 7 +- dts/vendor/nordic/nrf54l20.dtsi | 852 ------------------ dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 +- .../bluetooth/bap_broadcast_sink/sample.yaml | 4 +- .../bap_broadcast_sink/sysbuild.cmake | 4 - .../bap_broadcast_source/sample.yaml | 4 +- .../bap_broadcast_source/sysbuild.cmake | 4 - .../bluetooth/bap_unicast_client/sample.yaml | 4 +- .../bap_unicast_client/sysbuild.cmake | 4 - .../bluetooth/bap_unicast_server/sample.yaml | 4 +- .../bap_unicast_server/sysbuild.cmake | 4 - samples/bluetooth/beacon/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sysbuild.cmake | 4 - samples/bluetooth/cap_initiator/sample.yaml | 4 +- .../bluetooth/cap_initiator/sysbuild.cmake | 4 - .../direction_finding_central/sample.yaml | 15 +- .../sample.yaml | 14 +- .../sample.yaml | 14 +- .../direction_finding_peripheral/sample.yaml | 15 +- samples/bluetooth/hci_ipc/sample.yaml | 34 +- samples/bluetooth/hci_uart/sample.yaml | 18 +- samples/bluetooth/hci_vs_scan_req/sample.yaml | 2 - samples/bluetooth/iso_central/sample.yaml | 6 +- .../pbp_public_broadcast_sink/sample.yaml | 4 +- .../pbp_public_broadcast_sink/sysbuild.cmake | 4 - .../pbp_public_broadcast_source/sample.yaml | 4 +- .../sysbuild.cmake | 4 - .../bt-ll-sw-split/bt-ll-sw-split.overlay | 4 - .../controller/ll_sw/nordic/lll/lll.c | 2 +- .../controller/ctrl_api/testcase.yaml | 2 - .../controller/ctrl_chmu/testcase.yaml | 2 - .../controller/ctrl_cis_create/testcase.yaml | 2 - .../ctrl_cis_terminate/testcase.yaml | 2 - .../controller/ctrl_collision/testcase.yaml | 2 - .../controller/ctrl_conn_update/testcase.yaml | 11 +- .../controller/ctrl_cte_req/testcase.yaml | 2 - .../ctrl_data_length_update/testcase.yaml | 10 +- .../controller/ctrl_encrypt/testcase.yaml | 2 - .../ctrl_feature_exchange/testcase.yaml | 2 - .../controller/ctrl_hci/testcase.yaml | 2 - .../controller/ctrl_invalid/testcase.yaml | 2 - .../controller/ctrl_le_ping/testcase.yaml | 2 - .../ctrl_min_used_chans/testcase.yaml | 2 - .../controller/ctrl_phy_update/testcase.yaml | 6 +- .../controller/ctrl_sca_update/testcase.yaml | 2 - .../controller/ctrl_sw_privacy/testcase.yaml | 2 - .../controller/ctrl_terminate/testcase.yaml | 2 - .../ctrl_tx_buffer_alloc/testcase.yaml | 22 +- .../controller/ctrl_tx_queue/testcase.yaml | 2 - .../controller/ctrl_unsupported/testcase.yaml | 6 +- .../controller/ctrl_user_ext/testcase.yaml | 2 - .../controller/ctrl_version/testcase.yaml | 2 - .../df/connection_cte_req/testcase.yaml | 2 - .../df/connection_cte_tx_params/testcase.yaml | 2 - .../connectionless_cte_chains/testcase.yaml | 2 - .../df/connectionless_cte_rx/testcase.yaml | 2 - .../df/connectionless_cte_tx/testcase.yaml | 2 - tests/bluetooth/init/testcase.yaml | 101 +-- 69 files changed, 122 insertions(+), 1235 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index b686ddcabb02..e940c7a2cdf2 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -106,13 +106,12 @@ status = "okay"; ble-2mbps-supported; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 7f4c1a7a5f5b..c1e5f8763172 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -110,13 +110,12 @@ status = "okay"; ble-2mbps-supported; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 8431bb9c2ce6..33f6ac38747a 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -122,13 +122,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index 85aab283bfd2..1073b973c22a 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; }; @@ -123,13 +123,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 776397ff14a5..09a651762db6 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -110,13 +110,12 @@ status = "okay"; ble-2mbps-supported; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 647f56c5aa42..87e6bccfb53d 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -124,13 +124,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 9d7027744bef..b04b31a640dc 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -7,7 +7,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -112,13 +112,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index e80399b5770a..5010f801e0c0 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 2cde225beb01..eac16a3c14f3 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -32,7 +32,7 @@ wdt011: &cpurad_wdt011 {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; }; soc { @@ -136,6 +136,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index f4c673b1f516..a480edb41fdc 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_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; }; @@ -38,7 +38,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 5c445b9d5c75..bac6e0c4fc8e 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -496,10 +496,9 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi deleted file mode 100644 index bee70effa0e8..000000000000 --- a/dts/vendor/nordic/nrf54l20.dtsi +++ /dev/null @@ -1,852 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -/delete-node/ &sw_pwm; - -/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ -#define NRF_DOMAIN_ID_APPLICATION 0 -#define NRF_DOMAIN_ID_FLPR 1 - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@0 { - compatible = "arm,cortex-m33f"; - reg = <0>; - device_type = "cpu"; - clocks = <&hfpll>; - #address-cells = <1>; - #size-cells = <1>; - - itm: itm@e0000000 { - compatible = "arm,armv8m-itm"; - reg = <0xe0000000 0x1000>; - swo-ref-frequency = ; - }; - }; - - cpuflpr: cpu@1 { - compatible = "nordic,vpr"; - reg = <1>; - device_type = "cpu"; - riscv,isa = "rv32emc"; - nordic,bus-width = <64>; - }; - }; - - clocks { - pclk: pclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - pclk32m: pclk32m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfxo: lfxo { - compatible = "nordic,nrf54l-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf54l-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1650>; - }; - - hfpll: hfpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - aclk: aclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - ficr: ficr@ffc000 { - compatible = "nordic,nrf-ficr"; - reg = <0xffc000 0x1000>; - #nordic,ficr-cells = <1>; - }; - - uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; - reg = <0xffd000 0x1000>; - }; - - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(447)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 0x6fc00>; - }; - - cpuflpr_sram: memory@2006fc00 { - compatible = "mmio-sram"; - reg = <0x2006fc00 DT_SIZE_K(64)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2006fc00 0x10000>; - }; - - global_peripherals: peripheral@50000000 { - ranges = <0x0 0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - - dppic00: dppic@42000 { - compatible = "nordic,nrf-dppic"; - reg = <0x42000 0x808>; - status = "disabled"; - }; - - ppib00: ppib@44000 { - compatible = "nordic,nrf-ppib"; - reg = <0x44000 0x1000>; - status = "disabled"; - }; - - ppib01: ppib@45000 { - compatible = "nordic,nrf-ppib"; - reg = <0x45000 0x1000>; - status = "disabled"; - }; - - cpuflpr_vpr: vpr@4c000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x4c000 0x1000>; - ranges = <0x0 0x4c000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - status = "disabled"; - enable-secure; - - cpuflpr_clic: interrupt-controller@f0000000 { - compatible = "nordic,nrf-clic"; - reg = <0xf0000000 0x143c>; - interrupt-controller; - #interrupt-cells = <2>; - #address-cells = <1>; - status = "disabled"; - }; - }; - - spi00: spi@4d000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart00: uart@4d000 { - compatible = "nordic,nrf-uarte"; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - gpio2: gpio@50400 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x50400 0x300>; - #gpio-cells = <2>; - ngpios = <11>; - status = "disabled"; - port = <2>; - }; - - timer00: timer@55000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x55000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - prescaler = <0>; - }; - - dppic10: dppic@82000 { - compatible = "nordic,nrf-dppic"; - reg = <0x82000 0x808>; - status = "disabled"; - }; - - ppib10: ppib@83000 { - compatible = "nordic,nrf-ppib"; - reg = <0x83000 0x1000>; - status = "disabled"; - }; - - ppib11: ppib@84000 { - compatible = "nordic,nrf-ppib"; - reg = <0x84000 0x1000>; - status = "disabled"; - }; - - timer10: timer@85000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x85000 0x1000>; - cc-num = <8>; - max-bit-width = <32>; - interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - prescaler = <0>; - }; - - egu10: egu@87000 { - compatible = "nordic,nrf-egu"; - reg = <0x87000 0x1000>; - interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - radio: radio@8a000 { - compatible = "nordic,nrf-radio"; - reg = <0x8a000 0x1000>; - interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - dfe-supported; - ieee802154-supported; - ble-2mbps-supported; - ble-coded-phy-supported; - cs-supported; - - ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; - }; - - dppic20: dppic@c2000 { - compatible = "nordic,nrf-dppic"; - reg = <0xc2000 0x808>; - status = "disabled"; - }; - - ppib20: ppib@c3000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc3000 0x1000>; - status = "disabled"; - }; - - ppib21: ppib@c4000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc4000 0x1000>; - status = "disabled"; - }; - - ppib22: ppib@c5000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc5000 0x1000>; - status = "disabled"; - }; - - i2c20: i2c@c6000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi20: spi@c6000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart20: uart@c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c21: i2c@c7000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi21: spi@c7000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart21: uart@c7000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c22: i2c@c8000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi22: spi@c8000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart22: uart@c8000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - egu20: egu@c9000 { - compatible = "nordic,nrf-egu"; - reg = <0xc9000 0x1000>; - interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - timer20: timer@ca000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xca000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer21: timer@cb000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcb000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer22: timer@cc000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcc000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer23: timer@cd000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcd000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer24: timer@ce000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xce000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - pdm20: pdm@d0000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd0000 0x1000>; - interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pdm21: pdm@d1000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd1000 0x1000>; - interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pwm20: pwm@d2000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd2000 0x1000>; - interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm21: pwm@d3000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd3000 0x1000>; - interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm22: pwm@d4000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd4000 0x1000>; - interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - adc: adc@d5000 { - compatible = "nordic,nrf-saadc"; - reg = <0xd5000 0x1000>; - interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - zephyr,pm-device-runtime-auto; - }; - - nfct: nfct@d6000 { - compatible = "nordic,nrf-nfct"; - reg = <0xd6000 0x1000>; - interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - temp: temp@d7000 { - compatible = "nordic,nrf-temp"; - reg = <0xd7000 0x1000>; - interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio1: gpio@d8200 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8200 0x300>; - #gpio-cells = <2>; - ngpios = <16>; - status = "disabled"; - port = <1>; - gpiote-instance = <&gpiote20>; - }; - - gpiote20: gpiote@da000 { - compatible = "nordic,nrf-gpiote"; - reg = <0xda000 0x1000>; - status = "disabled"; - instance = <20>; - }; - - qdec20: qdec@e0000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe0000 0x1000>; - interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - qdec21: qdec@e1000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe1000 0x1000>; - interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - grtc: grtc@e2000 { - compatible = "nordic,nrf-grtc"; - reg = <0xe2000 0x1000>; - cc-num = <12>; - clocks = <&lfxo>, <&pclk>; - clock-names = "lfclock", "hfclock"; - status = "disabled"; - }; - - tdm: tdm@e8000 { - compatible = "nordic,nrf-tdm"; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xe8000 0x1000>; - interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - clocks = <&pclk32m>; - }; - - i2c23: i2c@ed000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi23: spi@ed000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart23: uart@ed000 { - compatible = "nordic,nrf-uarte"; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c24: i2c@ee000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi24: spi@ee000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart24: uart@ee000 { - compatible = "nordic,nrf-uarte"; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - dppic30: dppic@102000 { - compatible = "nordic,nrf-dppic"; - reg = <0x102000 0x808>; - status = "disabled"; - }; - - ppib30: ppib@103000 { - compatible = "nordic,nrf-ppib"; - reg = <0x103000 0x1000>; - status = "disabled"; - }; - - i2c30: i2c@104000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi30: spi@104000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart30: uart@104000 { - compatible = "nordic,nrf-uarte"; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - comp: comparator@106000 { - /* - * Use compatible "nordic,nrf-comp" to configure as COMP - * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP - */ - compatible = "nordic,nrf-comp"; - reg = <0x106000 0x1000>; - status = "disabled"; - interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - wdt30: watchdog@108000 { - compatible = "nordic,nrf-wdt"; - reg = <0x108000 0x620>; - interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - wdt31: watchdog@109000 { - compatible = "nordic,nrf-wdt"; - reg = <0x109000 0x620>; - interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio0: gpio@10a000 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x10a000 0x300>; - #gpio-cells = <2>; - ngpios = <5>; - status = "disabled"; - port = <0>; - gpiote-instance = <&gpiote30>; - }; - - gpiote30: gpiote@10c000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x10c000 0x1000>; - status = "disabled"; - instance = <30>; - }; - - clock: clock@10e000 { - compatible = "nordic,nrf-clock"; - reg = <0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@51c { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x51c 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@520 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x520 0x1>; - status = "disabled"; - }; - }; - - regulators: regulator@120000 { - compatible = "nordic,nrf54l-regulators"; - reg = <0x120000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - vregmain: regulator@120600 { - compatible = "nordic,nrf5x-regulator"; - reg = <0x120600 0x1>; - status = "disabled"; - regulator-name = "VREGMAIN"; - regulator-initial-mode = ; - }; - }; - }; - - rram_controller: rram-controller@5004e000 { - compatible = "nordic,rram-controller"; - reg = <0x5004e000 0x1000>; - interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(1972)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - - cpuflpr_rram: rram@1ed000 { - compatible = "soc-nv-flash"; - reg = <0x1ed000 DT_SIZE_K(64)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_nvic: interrupt-controller@e000e100 { - #address-cells = <1>; - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - }; - }; -}; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 5a4854440b64..602a7de7f719 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -252,11 +252,9 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/samples/bluetooth/bap_broadcast_sink/sample.yaml b/samples/bluetooth/bap_broadcast_sink/sample.yaml index 148b8b641697..5d06dee0bf89 100644 --- a/samples/bluetooth/bap_broadcast_sink/sample.yaml +++ b/samples/bluetooth/bap_broadcast_sink/sample.yaml @@ -24,7 +24,5 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake index d5d260789ff7..2523aac8ea76 100644 --- a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_broadcast_source/sample.yaml b/samples/bluetooth/bap_broadcast_source/sample.yaml index 5f745cd08950..5e5b01d942d0 100644 --- a/samples/bluetooth/bap_broadcast_source/sample.yaml +++ b/samples/bluetooth/bap_broadcast_source/sample.yaml @@ -36,7 +36,5 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake index d5d260789ff7..2523aac8ea76 100644 --- a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_client/sample.yaml b/samples/bluetooth/bap_unicast_client/sample.yaml index 44f32934ce99..7283090b8781 100644 --- a/samples/bluetooth/bap_unicast_client/sample.yaml +++ b/samples/bluetooth/bap_unicast_client/sample.yaml @@ -22,7 +22,5 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_client/sysbuild.cmake b/samples/bluetooth/bap_unicast_client/sysbuild.cmake index d5d260789ff7..2523aac8ea76 100644 --- a/samples/bluetooth/bap_unicast_client/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_client/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_server/sample.yaml b/samples/bluetooth/bap_unicast_server/sample.yaml index 266ced73f66d..068f752b626b 100644 --- a/samples/bluetooth/bap_unicast_server/sample.yaml +++ b/samples/bluetooth/bap_unicast_server/sample.yaml @@ -22,7 +22,5 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_server/sysbuild.cmake b/samples/bluetooth/bap_unicast_server/sysbuild.cmake index d5d260789ff7..2523aac8ea76 100644 --- a/samples/bluetooth/bap_unicast_server/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_server/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index 00215341924f..23ffad73c796 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -20,9 +20,7 @@ tests: - ophelia4ev/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp sample.bluetooth.beacon-coex: - extra_args: - - CONF_FILE="prj-coex.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="prj-coex.conf" harness: bluetooth platform_allow: - nrf52840dk/nrf52840 diff --git a/samples/bluetooth/cap_acceptor/sample.yaml b/samples/bluetooth/cap_acceptor/sample.yaml index 9061f44679fb..824e744eecaf 100644 --- a/samples/bluetooth/cap_acceptor/sample.yaml +++ b/samples/bluetooth/cap_acceptor/sample.yaml @@ -26,7 +26,5 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/cap_acceptor/sysbuild.cmake b/samples/bluetooth/cap_acceptor/sysbuild.cmake index d5d260789ff7..2523aac8ea76 100644 --- a/samples/bluetooth/cap_acceptor/sysbuild.cmake +++ b/samples/bluetooth/cap_acceptor/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/cap_initiator/sample.yaml b/samples/bluetooth/cap_initiator/sample.yaml index e3e557f48301..b4f593c99129 100644 --- a/samples/bluetooth/cap_initiator/sample.yaml +++ b/samples/bluetooth/cap_initiator/sample.yaml @@ -26,7 +26,5 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/cap_initiator/sysbuild.cmake b/samples/bluetooth/cap_initiator/sysbuild.cmake index d5d260789ff7..2523aac8ea76 100644 --- a/samples/bluetooth/cap_initiator/sysbuild.cmake +++ b/samples/bluetooth/cap_initiator/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index ffdf634c6e3e..b7a118e6cdc8 100644 --- a/samples/bluetooth/direction_finding_central/sample.yaml +++ b/samples/bluetooth/direction_finding_central/sample.yaml @@ -14,24 +14,15 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.central.aod_with_controller: + sample.bluetooth.direction_finding.central.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aod.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aod.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding.central.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aod.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - tags: bluetooth - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml index c500cc80dcec..8e6097de58ae 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml @@ -12,22 +12,14 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless_rx.aod_with_controller: + sample.bluetooth.direction_finding_connectionless_rx.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aod.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aod.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding_connectionless_rx.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aod.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 2a4fa93d19d5..78d21b2c95f5 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -12,22 +12,14 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless.aoa_with_controller: + sample.bluetooth.direction_finding_connectionless.aoa: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aoa.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding_connectionless.aoa_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aoa.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_peripheral/sample.yaml b/samples/bluetooth/direction_finding_peripheral/sample.yaml index 01f612ad08a0..f300cb415cc5 100644 --- a/samples/bluetooth/direction_finding_peripheral/sample.yaml +++ b/samples/bluetooth/direction_finding_peripheral/sample.yaml @@ -14,24 +14,15 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.peripheral.aod_with_controller: + sample.bluetooth.direction_finding.peripheral.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aoa.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding.peripheral.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aoa.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - tags: bluetooth - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/hci_ipc/sample.yaml b/samples/bluetooth/hci_ipc/sample.yaml index 3763478b6b33..b758b2547688 100644 --- a/samples/bluetooth/hci_ipc/sample.yaml +++ b/samples/bluetooth/hci_ipc/sample.yaml @@ -15,9 +15,7 @@ tests: sample.bluetooth.hci_ipc.iso_broadcast.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -27,9 +25,7 @@ tests: sample.bluetooth.hci_ipc.iso_receive.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -39,9 +35,7 @@ tests: sample.bluetooth.hci_ipc.bis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -51,9 +45,7 @@ tests: sample.bluetooth.hci_ipc.iso_central.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -63,9 +55,7 @@ tests: sample.bluetooth.hci_ipc.iso_peripheral.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -75,9 +65,7 @@ tests: sample.bluetooth.hci_ipc.cis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -87,9 +75,7 @@ tests: sample.bluetooth.hci_ipc.iso.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -113,7 +99,6 @@ tests: extra_args: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet @@ -124,16 +109,13 @@ tests: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - CONFIG_BT_CTLR_PHY_CODED=n - - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet sample.bluetooth.hci_ipc.mesh.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet diff --git a/samples/bluetooth/hci_uart/sample.yaml b/samples/bluetooth/hci_uart/sample.yaml index 8555c65cf0df..df2b40135c67 100644 --- a/samples/bluetooth/hci_uart/sample.yaml +++ b/samples/bluetooth/hci_uart/sample.yaml @@ -24,9 +24,7 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -35,9 +33,7 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -48,9 +44,7 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -60,9 +54,7 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df.iq_report: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -96,7 +88,6 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth @@ -108,7 +99,6 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf54l15dk_nrf54l15_cpuapp_df.overlay - - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth diff --git a/samples/bluetooth/hci_vs_scan_req/sample.yaml b/samples/bluetooth/hci_vs_scan_req/sample.yaml index 49526522d16e..245a83aa0d96 100644 --- a/samples/bluetooth/hci_vs_scan_req/sample.yaml +++ b/samples/bluetooth/hci_vs_scan_req/sample.yaml @@ -9,6 +9,4 @@ tests: - nrf52dk/nrf52832 extra_configs: - CONFIG_BT_LL_SW_SPLIT=y - extra_args: - - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/iso_central/sample.yaml b/samples/bluetooth/iso_central/sample.yaml index 57254ee809ab..3a7dedd404ae 100644 --- a/samples/bluetooth/iso_central/sample.yaml +++ b/samples/bluetooth/iso_central/sample.yaml @@ -11,11 +11,11 @@ tests: sample.bluetooth.iso_central.bt_ll_sw_split: harness: bluetooth platform_allow: + - qemu_cortex_m3 + - qemu_x86 - nrf52_bsim - nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml index 901d40b00d4f..d7c816ee5b76 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml @@ -23,7 +23,5 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake index d5d260789ff7..2523aac8ea76 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml index 1d2e31306e29..80c907042119 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml @@ -23,7 +23,5 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake index e0a7fd9d175d..d3bf7be5b6c3 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake @@ -18,10 +18,6 @@ if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay index a57a0e82ba6e..04bf83ef44d4 100644 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay +++ b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay @@ -2,10 +2,6 @@ status = "okay"; }; -&bt_hci_sdc { - status = "disabled"; -}; - / { chosen { zephyr,bt-hci = &bt_hci_controller; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 0bf5d1772f1e..d5903805e571 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -62,7 +62,7 @@ static struct { /* FIXME: This could probably use a chosen entropy device instead on relying on * the nodelabel being the same as for the old nrf rng. */ -static const struct device *const dev_entropy = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy)); +static const struct device *const dev_entropy = DEVICE_DT_GET(DT_NODELABEL(rng)); #endif /* CONFIG_ENTROPY_HAS_DRIVER */ static int init_reset(void); diff --git a/tests/bluetooth/controller/ctrl_api/testcase.yaml b/tests/bluetooth/controller/ctrl_api/testcase.yaml index 21f178bf9b2b..19bf6c9ab490 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 9c3ee6264335..f7e8068d60ec 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 2371d7063eb7..99612a89bc31 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 a98229ba45f3..956172a89b20 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 daa8f3bc6c3d..6086a9a4ebc8 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 fc4ecb0b647d..5b0bda4b9088 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 c6288aecc433..fd6ff51118d9 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 c7d1174e12bf..9778af435b4a 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 86dd5bfe4d30..d5bb2cb8b110 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 087e49575ff7..257542f36120 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 e0735bae6962..d7f7ce7168d1 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 cee54e6b09ed..2d1741931e37 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 54178905da17..b6a77528f32d 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 a9445cbf8c4d..0991b0cdd43c 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 d5c49d587a8f..1d7da169f1d8 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 cbc3c3faf720..cbf63aa1b575 100644 --- a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_sca_update.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml index ac5dd6e957eb..778606d69549 100644 --- a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml @@ -4,5 +4,3 @@ common: tests: bluetooth.ctrl_sw_privacy.test: platform_allow: nrf52_bsim - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml index 6b1409e9653e..cbe639401ea3 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 363986bd3d35..614eb7fe94c0 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 282b620b317a..295ad891a630 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 48b18af93536..28aba1a752a8 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml @@ -6,11 +6,7 @@ common: tests: bluetooth.controller.ctrl_unsupported.default.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_unsupported.test: type: unit - extra_args: - - CONF_FILE=prj_unsupported.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_unsupported.conf diff --git a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml index be963df24a8a..af319a7a7191 100644 --- a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml @@ -4,5 +4,3 @@ common: tests: bluetooth.ctrl_user_ext.test: platform_allow: nrf52_bsim - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_version/testcase.yaml b/tests/bluetooth/controller/ctrl_version/testcase.yaml index 5df86b9bca9f..6badcbc72547 100644 --- a/tests/bluetooth/controller/ctrl_version/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_version/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_version.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_req/testcase.yaml b/tests/bluetooth/df/connection_cte_req/testcase.yaml index fbfe4b0d9a1a..768aba4a51f5 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 a9986c5b0e53..38a23b0950e3 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 844a7bbb524e..6aa5bb0f0c1c 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 c8f08a908436..f839b1910eb2 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 491cc0e7e599..77d651d0cbc2 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 a5cc40cd39e7..dd44257e0128 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -74,9 +74,7 @@ tests: extra_args: CONF_FILE=prj_9.conf platform_allow: qemu_cortex_m3 bluetooth.init.test_ctlr: - extra_args: - - CONF_FILE=prj_ctlr.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -88,9 +86,7 @@ tests: - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_4_0: - extra_args: - - CONF_FILE=prj_ctlr_4_0.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_4_0.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -99,9 +95,7 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_4_0_dbg: - extra_args: - - CONF_FILE=prj_ctlr_4_0_dbg.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_4_0_dbg.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -110,9 +104,7 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_tiny: - extra_args: - - CONF_FILE=prj_ctlr_tiny.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_tiny.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -124,7 +116,6 @@ tests: extra_args: - CONF_FILE=prj_ctlr_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -135,7 +126,6 @@ tests: extra_args: - CONF_FILE=prj_ctlr_5_x_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -147,7 +137,6 @@ tests: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_CTLR_ADVANCED_FEATURES=y - CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf52840dk/nrf52840 @@ -157,16 +146,13 @@ tests: bluetooth.init.test_ctlr_ticker: extra_args: - CONF_FILE=prj_ctlr_ticker.conf - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_broadcaster: - extra_args: - - CONF_FILE=prj_ctlr_broadcaster.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_broadcaster.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -175,9 +161,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral: - extra_args: - - CONF_FILE=prj_ctlr_peripheral.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -186,9 +170,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral_priv: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -197,9 +179,7 @@ tests: integration_platforms: - nrf52840dk/nrf52840 bluetooth.init.test_ctlr_observer: - extra_args: - - CONF_FILE=prj_ctlr_observer.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_observer.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -208,9 +188,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_central: - extra_args: - - CONF_FILE=prj_ctlr_central.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -220,9 +198,7 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_central_priv: - extra_args: - - CONF_FILE=prj_ctlr_central_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -232,9 +208,7 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_broadcaster_ext: - extra_args: - - CONF_FILE=prj_ctlr_broadcaster_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_broadcaster_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -243,9 +217,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -254,9 +226,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext_priv: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_ext_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_ext_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -265,9 +235,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_oberver_ext: - extra_args: - - CONF_FILE=prj_ctlr_observer_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_observer_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -276,9 +244,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext: - extra_args: - - CONF_FILE=prj_ctlr_central_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -287,9 +253,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext_priv: - extra_args: - - CONF_FILE=prj_ctlr_central_ext_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_ext_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -298,9 +262,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv: - extra_args: - - CONF_FILE=prj_ctlr_per_adv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_adv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -309,9 +271,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv_no_adi: - extra_args: - - CONF_FILE=prj_ctlr_per_adv_no_adi.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_adv_no_adi.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -320,9 +280,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync: - extra_args: - - CONF_FILE=prj_ctlr_per_sync.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_sync.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -331,9 +289,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_adi: - extra_args: - - CONF_FILE=prj_ctlr_per_sync_no_adi.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_sync_no_adi.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -342,9 +298,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_filter: - extra_args: - - CONF_FILE=prj_ctlr_per_sync_no_filter.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_per_sync_no_filter.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -353,9 +307,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_iso: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_iso.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_iso.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -364,9 +316,7 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_iso: - extra_args: - - CONF_FILE=prj_ctlr_central_iso.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_iso.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -385,9 +335,7 @@ tests: - DTC_OVERLAY_FILE=h5.overlay platform_allow: qemu_cortex_m3 bluetooth.init.test_llcp: - extra_args: - - CONF_FILE=prj_llcp.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_llcp.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -399,7 +347,6 @@ tests: extra_args: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_RECV_WORKQ_BT=y - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 bluetooth.init.test_host_6_x: From a6b59adf0c06fd6489749b860d56b280781f770a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1014/3334] Revert "[nrf noup] dts: Add Bluetooth Controller to nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 87b051f5d2fb0d3e7839ae511f96ce073ae8f1e7. Signed-off-by: Tomasz Moń --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 8 -------- dts/vendor/nordic/nrf54h20.dtsi | 8 -------- 2 files changed, 16 deletions(-) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index eac16a3c14f3..b910e42789b0 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -31,10 +31,6 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &s2ram; / { - chosen { - zephyr,bt-hci = &bt_hci_controller; - }; - soc { compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; @@ -135,7 +131,3 @@ wdt011: &cpurad_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; - -&bt_hci_controller { - status = "okay"; -}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index bac6e0c4fc8e..e2ce4cfd9945 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -495,14 +495,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 7da90e37fdf8e607afecca9204a05805f3b310c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1015/3334] Revert "[nrf noup] scripts: ci: check_compliance: Check Kconfigs for enable" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 26f650948186971ad8066d4126208cd6460cf9f2. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 57 ++-------------------------------- 1 file changed, 3 insertions(+), 54 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 16aacd4c6a80..1b85d7408d88 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -505,22 +505,6 @@ class KconfigCheck(ComplianceTest): # Kconfig symbol prefix/namespace. CONFIG_ = "CONFIG_" - # If modules should be excluded from checks. - EXCLUDE_MODULES = False - - # This block list contains a list of upstream Zephyr modules that should not be checked - # DO NOT MERGE CHANGES TO THIS WITHOUT BUILD SYSTEM AND CODE OWNER APPROVAL! - external_module_name_block_list = ['canopennode', 'chre', 'cmsis', 'cmsis-dsp', 'cmsis-nn', - 'cmsis_6', 'edtt', 'fatfs', 'hal_st', 'hal_tdk', - 'hal_wurthelektronik', 'liblc3', 'libmetal', 'littlefs', - 'loramac-node', 'lvgl', 'lz4', 'mipi-sys-t', 'nanopb', - 'net-tools', 'nrf_hw_models', 'open-amp', 'percepio', - 'picolibc', 'segger', 'tf-m-tests', 'tinycrypt', - 'uoscore-uedhoc', 'zscilib'] - - # Holds a list or directories/files which should not be checked - blocked_module_dirs = [] - def run(self): kconf = self.parse_kconfig() @@ -558,22 +542,13 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] - nrf_modules_dir = (Path(ZEPHYR_BASE) / '..' / 'nrf' / 'modules').resolve() + nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') nrf_modules = [] - - for module in modules: - if module in self.external_module_name_block_list: - self.blocked_module_dirs.append(modules_dir / module / 'Kconfig') - if os.path.exists(nrf_modules_dir): nrf_modules = [name for name in os.listdir(nrf_modules_dir) if os.path.exists(os.path.join(nrf_modules_dir, name, 'Kconfig'))] - for module in nrf_modules: - if module in self.external_module_name_block_list: - self.blocked_module_dirs.append(nrf_modules_dir / module / 'Kconfig') - with open(modules_file, 'r') as fp_module_file: content = fp_module_file.read() @@ -592,7 +567,6 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se re.sub('[^a-zA-Z0-9]', '_', module).upper(), modules_dir / module / 'Kconfig' )) - # Add NRF as static entry as workaround for ext Kconfig root support fp_module_file.write("ZEPHYR_NRF_KCONFIG = {}\n".format( nrf_modules_dir / '..' / 'Kconfig.nrf' @@ -1078,32 +1052,9 @@ def check_no_enable_in_boolean_prompt(self, kconf): # Checks that boolean's prompt does not start with "Enable...". for node in kconf.node_iter(): - skip_node = False - - # skip Kconfig nodes not in-tree when set to (will present an absolute path) + # skip Kconfig nodes not in-tree (will present an absolute path) if os.path.isabs(node.filename): - if self.EXCLUDE_MODULES is True: - continue - - normalised_file_name = Path(node.filename).resolve() - - for module_name in self.external_module_name_block_list: - # Workaround for being unable to use full_match() due to python version - if '/modules/' in str(normalised_file_name) and \ - ('/' + module_name + '/') in str(normalised_file_name): - skip_node = True - break - - if skip_node: - continue - - for blocked_dir in self.blocked_module_dirs: - if normalised_file_name.match(blocked_dir, case_sensitive=True): - skip_node = True - break - - if skip_node: - continue + continue # 'kconfiglib' is global # pylint: disable=undefined-variable @@ -1529,7 +1480,6 @@ class KconfigBasicNoModulesCheck(KconfigBasicCheck): name = "KconfigBasicNoModules" path_hint = "" EMPTY_FILE_CONTENTS = "# Empty\n" - EXCLUDE_MODULES = True def get_modules(self, module_dirs_file, modules_file, sysbuild_modules_file, settings_file): with open(module_dirs_file, 'w') as fp_module_file: @@ -1622,7 +1572,6 @@ class SysbuildKconfigBasicNoModulesCheck(SysbuildKconfigCheck, KconfigBasicNoMod """ name = "SysbuildKconfigBasicNoModules" path_hint = "" - EXCLUDE_MODULES = True class Nits(ComplianceTest): From a693365a252d2b1704f2e9206a44628b3912073c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1016/3334] Revert "[nrf noup] boards: nordic: Skip offsets in merged slot" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 552993e42de89af3f9fb9edf8a7697fdd864e0f1. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/Kconfig.defconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index c11d3ef63e1f..069ed7b6eba6 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -13,7 +13,6 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET - default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT if !USE_DT_CODE_PARTITION @@ -40,7 +39,6 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET - default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From 7e919bc2c54c2158a429909fffd0c7b0a1ed273a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1017/3334] Revert "[nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 41aa006934fc11442d82055cfde2284daca54489. Signed-off-by: Tomasz Moń --- drivers/pinctrl/pinctrl_nrf.c | 32 ----------- .../zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 56 ------------------- 2 files changed, 88 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 3ad358158a80..b052e61eb803 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -148,18 +148,6 @@ static void port_pin_clock_set(uint16_t pin_number, bool enable) #endif -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || \ - defined(CONFIG_MSPI_HPF) || \ - DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(nordic_nrf_vpr_coprocessor, pinctrl_0) -#if defined(CONFIG_SOC_SERIES_NRF54LX) -#define NRF_PSEL_SDP_MSPI(psel) \ - nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_VPR); -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -/* On nRF54H, pin routing is controlled by secure domain, via UICR. */ -#define NRF_PSEL_SDP_MSPI(psel) -#endif -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || ... */ - int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg) { @@ -541,26 +529,6 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_DISCONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_coresight_nrf) */ -#if defined(NRF_PSEL_SDP_MSPI) - case NRF_FUN_SDP_MSPI_CS0: - case NRF_FUN_SDP_MSPI_CS1: - case NRF_FUN_SDP_MSPI_CS2: - case NRF_FUN_SDP_MSPI_CS3: - case NRF_FUN_SDP_MSPI_CS4: - case NRF_FUN_SDP_MSPI_SCK: - case NRF_FUN_SDP_MSPI_DQ0: - case NRF_FUN_SDP_MSPI_DQ1: - case NRF_FUN_SDP_MSPI_DQ2: - case NRF_FUN_SDP_MSPI_DQ3: - case NRF_FUN_SDP_MSPI_DQ4: - case NRF_FUN_SDP_MSPI_DQ5: - case NRF_FUN_SDP_MSPI_DQ6: - case NRF_FUN_SDP_MSPI_DQ7: - NRF_PSEL_SDP_MSPI(psel); - dir = NRF_GPIO_PIN_DIR_OUTPUT; - input = NRF_GPIO_PIN_INPUT_CONNECT; - break; -#endif /* defined(NRF_PSEL_SDP_MSPI) */ default: return -ENOTSUP; } diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 4c7f1d3145dd..92e62a9a6bed 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -172,62 +172,6 @@ #define NRF_FUN_GRTC_CLKOUT_FAST 55U /** GRTC slow clock output */ #define NRF_FUN_GRTC_CLKOUT_32K 56U -/** SDP_MSPI clock pin */ -#define NRF_FUN_SDP_MSPI_SCK 57U -/** SDP_MSPI data pin 0 */ -#define NRF_FUN_SDP_MSPI_DQ0 58U -/** SDP_MSPI data pin 1 */ -#define NRF_FUN_SDP_MSPI_DQ1 59U -/** SDP_MSPI data pin 2 */ -#define NRF_FUN_SDP_MSPI_DQ2 60U -/** SDP_MSPI data pin 3 */ -#define NRF_FUN_SDP_MSPI_DQ3 61U -/** SDP_MSPI data pin 4 */ -#define NRF_FUN_SDP_MSPI_DQ4 62U -/** SDP_MSPI data pin 5 */ -#define NRF_FUN_SDP_MSPI_DQ5 63U -/** SDP_MSPI data pin 6 */ -#define NRF_FUN_SDP_MSPI_DQ6 64U -/** SDP_MSPI data pin 7 */ -#define NRF_FUN_SDP_MSPI_DQ7 65U -/** SDP_MSPI chip select 0 */ -#define NRF_FUN_SDP_MSPI_CS0 66U -/** SDP_MSPI chip select 1 */ -#define NRF_FUN_SDP_MSPI_CS1 67U -/** SDP_MSPI chip select 2 */ -#define NRF_FUN_SDP_MSPI_CS2 68U -/** SDP_MSPI chip select 3 */ -#define NRF_FUN_SDP_MSPI_CS3 69U -/** SDP_MSPI chip select 4 */ -#define NRF_FUN_SDP_MSPI_CS4 70U -/** High-Performance Framework MSPI clock pin */ -#define NRF_FUN_HPF_MSPI_SCK NRF_FUN_SDP_MSPI_SCK -/** High-Performance Framework MSPI data pin 0 */ -#define NRF_FUN_HPF_MSPI_DQ0 NRF_FUN_SDP_MSPI_DQ0 -/** High-Performance Framework MSPI data pin 1 */ -#define NRF_FUN_HPF_MSPI_DQ1 NRF_FUN_SDP_MSPI_DQ1 -/** High-Performance Framework MSPI data pin 2 */ -#define NRF_FUN_HPF_MSPI_DQ2 NRF_FUN_SDP_MSPI_DQ2 -/** High-Performance Framework MSPI data pin 3 */ -#define NRF_FUN_HPF_MSPI_DQ3 NRF_FUN_SDP_MSPI_DQ3 -/** High-Performance Framework MSPI data pin 4 */ -#define NRF_FUN_HPF_MSPI_DQ4 NRF_FUN_SDP_MSPI_DQ4 -/** High-Performance Framework MSPI data pin 5 */ -#define NRF_FUN_HPF_MSPI_DQ5 NRF_FUN_SDP_MSPI_DQ5 -/** High-Performance Framework MSPI data pin 6 */ -#define NRF_FUN_HPF_MSPI_DQ6 NRF_FUN_SDP_MSPI_DQ6 -/** High-Performance Framework MSPI data pin 7 */ -#define NRF_FUN_HPF_MSPI_DQ7 NRF_FUN_SDP_MSPI_DQ7 -/** High-Performance Framework MSPI chip select pin 0 */ -#define NRF_FUN_HPF_MSPI_CS0 NRF_FUN_SDP_MSPI_CS0 -/** High-Performance Framework MSPI chip select pin 1 */ -#define NRF_FUN_HPF_MSPI_CS1 NRF_FUN_SDP_MSPI_CS1 -/** High-Performance Framework MSPI chip select pin 2 */ -#define NRF_FUN_HPF_MSPI_CS2 NRF_FUN_SDP_MSPI_CS2 -/** High-Performance Framework MSPI chip select pin 3 */ -#define NRF_FUN_HPF_MSPI_CS3 NRF_FUN_SDP_MSPI_CS3 -/** High-Performance Framework MSPI chip select pin 4 */ -#define NRF_FUN_HPF_MSPI_CS4 NRF_FUN_SDP_MSPI_CS4 /** TDM SCK in master mode */ #define NRF_FUN_TDM_SCK_M 71U /** TDM SCK in slave mode */ From 129c5c85f89ce8df38f5a73be45e970a9636ac4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1018/3334] Revert "[nrf noup] ci: add default permissions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 94b4cf09b6f3a4ae048b8a8318c9f00b0430fbd7. Signed-off-by: Tomasz Moń --- .github/workflows/commit-tags.yml | 5 +---- .github/workflows/manifest-PR.yml | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml index 61fc3a6c5bd3..828f02971678 100644 --- a/.github/workflows/commit-tags.yml +++ b/.github/workflows/commit-tags.yml @@ -6,9 +6,6 @@ on: milestoned, demilestoned, assigned, unassigned, ready_for_review, review_requested] -permissions: - contents: read - jobs: commit_tags: runs-on: ubuntu-22.04 @@ -19,7 +16,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Checkout the code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 0f3bd738a36c..473301146527 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -5,8 +5,6 @@ on: branches: - main -permissions: - contents: read jobs: call-manifest-pr-action: From e019294a98fbc5f26b1cef293bbadd6536facee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1019/3334] Revert "[nrf noup] bluetooth: att: Allow ATT sent callback after data TX is done" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 64ec75ff36924adfe3399c25c0f7618fa23cbe16. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/Kconfig.gatt | 14 -------------- subsys/bluetooth/host/att.c | 17 +---------------- subsys/bluetooth/host/conn.c | 27 +++++---------------------- subsys/bluetooth/host/l2cap.c | 10 ++-------- 4 files changed, 8 insertions(+), 60 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index 3403e8d308b8..a04241a3e94f 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -38,20 +38,6 @@ config BT_ATT_RETRY_ON_SEC_ERR If an ATT request fails due to insufficient security, the host will try to elevate the security level and retry the ATT request. -config BT_ATT_SENT_CB_AFTER_TX - bool "Delay ATT sent callback until data transmission is done by controller [EXPERIMENTAL]" - select EXPERIMENTAL - help - By default, the BLE stack calls sent callback for ATT data when the - data is passed to BLE controller for transmission. Enabling this - Kconfig option delays calling the sent callback until data - transmission is finished by BLE controller (the callback is called - upon receiving the Number of Completed Packets HCI Event). - - The feature is not available in Zephyr RTOS (it's specific to NCS - Zephyr fork). It is a temporary solution allowing to control flow of - GATT notifications with HID reports for HID use-case. - 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 c822de7ab4bc..66833d1cfcc5 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -323,13 +323,6 @@ static void att_disconnect(struct bt_att_chan *chan) } } -static void chan_sent_cb(struct bt_conn *conn, void *user_data, int err) -{ - struct net_buf *nb = user_data; - - net_buf_unref(nb); -} - /* In case of success the ownership of the buffer is transferred to the stack * which takes care of releasing it when it completes transmitting to the * controller. @@ -423,15 +416,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."); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index e706fd3fb934..9c6bb386f6c1 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -711,29 +711,12 @@ 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 (CONFIG_BT_ATT_SENT_CB_AFTER_TX), - * the `chan_send` function from `att.c` introduces 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 (the reference is removed when the TX callback passed - * to `bt_l2cap_send_pdu` is called). - * - * send_buf function can be called multiple times, if buffer - * has to be fragmented over HCI. In that case, the callback - * is provided as an argument only for the last transmitted - * fragment. The `buf->ref == 1` (or 2) check is skipped - * because it's impossible to properly validate number of - * references for the sent fragments if buffers may have the - * additional reference. - * - * Otherwise, check that buf->ref is 1 or 2. It would be 1 - * if this was the only reference (e.g. buf was removed from - * the conn tx_queue). It would be 2 if the tx_data_pull - * kept it on the tx_queue for segmentation. + /* Check that buf->ref is 1 or 2. It would be 1 if this + * was the only reference (e.g. buf was removed + * from the conn tx_queue). It would be 2 if the + * tx_data_pull kept it on the tx_queue for segmentation. */ - __ASSERT_NO_MSG(IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX) || (buf->ref == 1) || - (buf->ref == 2)); + __ASSERT_NO_MSG((buf->ref == 1) || (buf->ref == 2)); /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 882ba9a037b4..6dcdfe04e541 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -787,19 +787,13 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, return -ENOTCONN; } - /* If ATT sent callback is delayed until data transmission is done by BLE controller - * (CONFIG_BT_ATT_SENT_CB_AFTER_TX), the `chan_send` function from `att.c` introduces 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 (the reference is removed when - * the TX callback passed to `bt_l2cap_send_pdu` is called). - */ - 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 f5a7cdff640bdae2e481d69c4792badcae5d8ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1020/3334] Revert "[nrf noup] soc/nordic/nrf54h/pm_s2ram: S2RAM resume hardening" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d68235ee707134c90af942ec848fe91c49efedf9. Signed-off-by: Tomasz Moń --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 13 +++---------- soc/nordic/nrf54h/pm_s2ram.c | 14 -------------- soc/nordic/nrf54h/pm_s2ram.h | 7 ------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 715eedeb0e8a..2c67c3d4e8c1 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -355,21 +355,14 @@ zephyr_udc0: &usbhs { }; /* temporary stack for S2RAM resume logic */ - pm_s2ram_stack: cpuapp_s2ram_stack@22007fc8 { + pm_s2ram_stack: cpuapp_s2ram_stack@22007fd0 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fc8 16>; + reg = <0x22007fd0 16>; zephyr,memory-region = "pm_s2ram_stack"; }; - /* run-time common mcuboot S2RAM support section */ - mcuboot_s2ram: cpuapp_s2ram@22007fd8 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fd8 8>; - zephyr,memory-region = "mcuboot_s2ram_context"; - }; - /* run-time common S2RAM cpu context RAM */ - pm_s2ram: cpuapp_s2ram@22007fe0 { + pm_s2ram: cpuapp_s2ram@22007fe0 { compatible = "zephyr,memory-region", "mmio-sram"; reg = <0x22007fe0 32>; zephyr,memory-region = "pm_s2ram_context"; diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index 768233b2ac8b..753acdda6832 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -223,24 +223,10 @@ static void fpu_restore(_fpu_context_t *backup) #endif /* !defined(CONFIG_FPU_SHARING) */ #endif /* defined(CONFIG_FPU) */ -#if DT_NODE_EXISTS(DT_NODELABEL(mcuboot_s2ram)) &&\ - DT_NODE_HAS_COMPAT(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region) -/* Linker section name is given by `zephyr,memory-region` property of - * `zephyr,memory-region` compatible DT node with nodelabel `mcuboot_s2ram`. - */ -__attribute__((section(DT_PROP(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region)))) -volatile struct mcuboot_resume_s _mcuboot_resume; - -#define SET_MCUBOOT_RESUME_MAGIC() _mcuboot_resume.magic = MCUBOOT_S2RAM_RESUME_MAGIC -#else -#define SET_MCUBOOT_RESUME_MAGIC() -#endif - int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) { int ret; - SET_MCUBOOT_RESUME_MAGIC(); scb_save(&backup_data.scb_context); #if defined(CONFIG_FPU) #if !defined(CONFIG_FPU_SHARING) diff --git a/soc/nordic/nrf54h/pm_s2ram.h b/soc/nordic/nrf54h/pm_s2ram.h index 01c098ea4310..565afad6ca10 100644 --- a/soc/nordic/nrf54h/pm_s2ram.h +++ b/soc/nordic/nrf54h/pm_s2ram.h @@ -10,13 +10,6 @@ #ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ #define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ -#define MCUBOOT_S2RAM_RESUME_MAGIC 0x75832419 - -struct mcuboot_resume_s { - uint32_t magic; /* magic value to identify valid structure */ - uint32_t slot_info; -}; - /** * @brief Save CPU state on suspend * From 2824c2c5f4b2d692b93315a672b648b581495103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1021/3334] Revert "[nrf noup] scripts: ci: check_compliance: Exclude some docs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 02cb82717a2217cb35833ff1c1100f8c4e865e3c. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 1b85d7408d88..9f00d69db1ef 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1180,10 +1180,6 @@ def check_no_undef_outside_kconfig(self, kconf): grep_stdout = git("grep", "--line-number", "-I", "--null", "--perl-regexp", regex, "--", ":!/doc/releases", ":!/doc/security/vulnerabilities.rst", - ":!/doc/nrf/releases_and_maturity", - ":!/doc/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.rst", - ":!/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst", - ":!/doc/nrf-bm/release_notes", cwd=GIT_TOP) # splitlines() supports various line terminators From 4a905bb4e655f1dbe6b8182bb88da8cb3c59f8f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1022/3334] Revert "[nrf noup] scripts: ci: check_compliance: Add undefined Kconfigs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e0c9e903ca64058c689d41d2ef917d7f0883d433. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 75 ---------------------------------- 1 file changed, 75 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 9f00d69db1ef..eded57d639f6 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1376,81 +1376,6 @@ def check_no_undef_outside_kconfig(self, kconf): # documentation "ZTEST_FAIL_TEST_", # regex in tests/ztest/fail/CMakeLists.txt # zephyr-keep-sorted-stop - - # NCS-specific allow list - # zephyr-keep-sorted-start re(^\s+") - "APPLICATION", # Example documentation - "BAR", # Example documentation - "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation - "BT_ADV_PROV_", # Documentation - "BT_CTLR_TX_PWR_MINUS", # CHIP documentation - "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation - "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo - "CHANNEL", # NRF desktop - "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop - "CHANNEL_TRANSPORT_DISABLED", # NRF desktop - "CHANNEL_TRANSPORT_IDLE", # NRF desktop - "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop - "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop - "CHIP_DFU_OVER_BT_SMP", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module - "CHIP_MEMORY_PROFILING", # CHIP module - "CHIP_NUS", # CHIP module - "CHIP_NUS_FIXED_PASSKEY", # CHIP module - "CHIP_NUS_MAX_COMMANDS", # CHIP module - "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module - "CHIP_QSPI_NOR", # CHIP module - "CHIP_SPI_NOR", # CHIP module - "CHIP_WIFI", # CHIP module - "DESKTOP_DVFS_STATE_", # NRF desktop - "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop - "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module - "MEMFAULT_", # Documentation - "MEMFAULT_NCS", # Documentation - "MEMFAULT_NCS_", # Documentation - "MY_CUSTOM_CONFIG", # Example documentation - "MY_EXT_API_ENABLED", # Example documentation - "MY_EXT_API_REQUIRED", # Example documentation - "NCS_IS_VARIANT_IMAGE", # Build system defined symbol - "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot - "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot - "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol - "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation - "PM_PARTITION_SIZE", # Used in search link - "PM_PARTITION_SIZE_", # Used in documentation - "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template - "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template - "SOC_NRF54H20_CPUSEC", # Internal - "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal - "STATUS_", # NRF desktop - "STATUS_COUNT", # NRF desktop - "STATUS_DISCONNECTED", # NRF desktop - "STATUS_FETCH", # NRF desktop - "STATUS_GET_BOARD_NAME", # NRF desktop - "STATUS_GET_HWID", # NRF desktop - "STATUS_GET_MAX_MOD_ID", # NRF desktop - "STATUS_GET_PEER", # NRF desktop - "STATUS_GET_PEERS_CACHE", # NRF desktop - "STATUS_INDEX_PEERS", # NRF desktop - "STATUS_LIST", # NRF desktop - "STATUS_PENDING", # NRF desktop - "STATUS_POS", # NRF desktop - "STATUS_REJECT", # NRF desktop - "STATUS_SET", # NRF desktop - "STATUS_SUCCESS", # NRF desktop - "STATUS_TIMEOUT", # NRF desktop - "STATUS_WRITE_FAIL", # NRF desktop - # zephyr-keep-sorted-stop } From ec6f2cf9307b7098a3da7f79e3970213eb3ece97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1023/3334] Revert "[nrf noup] soc: nordic: nrf54l: Add ROM start offset PM override" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba72a55d65c4e4de93ccd1a931b478ca96cc0f49. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54l/Kconfig.defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index 3274abc88b8a..929d13655c54 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -33,7 +33,6 @@ choice NULL_POINTER_EXCEPTION_DETECTION endchoice config ROM_START_OFFSET - default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # ARM From c39e8f6c80f48469c776b62435e6998aa48d58d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1024/3334] Revert "[nrf noup] boards: nordic: nrf7002: Include required headers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ed1c8ef56abc767d48b4e2901a948886f0b0b1b0. Signed-off-by: Tomasz Moń --- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 9c06a17ad7bf..0deb8ccc1bf5 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -7,8 +7,6 @@ /dts-v1/; #include #include "nrf5340_cpuapp_common.dtsi" -#include "nordic/nrf5340_sram_partition.dtsi" -#include "nordic/nrf5340_cpuapp_ns_partition.dtsi" / { model = "Nordic NRF5340 DK NRF5340 Application"; From 5d4b2708a11ace1dbc12291e3a2a37f6355544c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1025/3334] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding as default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 39166353a40830e5d1bf02cfa4d4c99040adbfc8. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 +++++ boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts | 4 ++++ dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 5 ----- dts/vendor/nordic/nrf54lm20a.dtsi | 5 ----- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index 5b4599cc94e0..39fda7c4c88e 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -18,6 +18,7 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; + zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; @@ -97,6 +98,10 @@ status = "okay"; }; +&bt_hci_controller { + status = "okay"; +}; + &ieee802154 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index 0496f3ca90cf..2e79bbb98215 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -19,5 +19,9 @@ }; }; +&bt_hci_controller { + status = "okay"; +}; + /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index 8c8d006e1a18..dea5d0cd9816 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -19,7 +19,6 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -40,10 +39,6 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { - status = "okay"; -}; - &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index b4ddafac801b..ff000d01143e 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -290,11 +290,6 @@ /* Note: In the nRF Connect SDK the SoftDevice Controller * is added and set as the default Bluetooth Controller. */ - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From ea6f5db5905353280d6c8f0ae48a6a2f3b65a597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:35 +0100 Subject: [PATCH 1026/3334] Revert "[nrf noup] dts: choose a psa-rng for entropy for 54lm20a" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ae18200a608e1cfc048e58bde0e5e1da859cf63c. Signed-off-by: Tomasz Moń --- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index a480edb41fdc..fa269e71c37e 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -28,7 +28,7 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "disabled"; + status = "okay"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index dea5d0cd9816..1798088d6f4a 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -19,7 +19,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &psa_rng; + zephyr,entropy = &rng; }; soc { @@ -30,11 +30,11 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "okay"; + status = "disabled"; }; rng: rng { - status = "disabled"; + status = "okay"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; }; From 7a5d30bd873421b6256a20a3c672c5ff90a4c7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1027/3334] Revert "[nrf noup] soc/nordic/nrf54h: Add extension to define custom s2ram implementation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 52d649275f12b9b275acb742e514ce216cc48a5c. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/CMakeLists.txt | 4 +--- soc/nordic/nrf54h/Kconfig | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 25e4796a4169..a4db05c9e643 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -13,9 +13,7 @@ if(CONFIG_ARM) endif() endif() -if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) - zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) -endif() +zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) zephyr_include_directories(.) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index f07a620ccdb3..94f9cb9749f4 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -100,11 +100,6 @@ config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND default y depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD -config SOC_NRF54H20_PM_S2RAM_OVERRIDE - bool "Override `pm_s2ram` implementation" - help - Override Nordic s2ram implementation. - config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON From f399b28ed55812561b6e1f51fad6156b123395dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1028/3334] Revert "[nrf noup] ci: add reopen for manifest-pr action" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e6d20a77781cd52c546e053d0ae427ebf0669800. Signed-off-by: Tomasz Moń --- .github/workflows/manifest-PR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 473301146527..a871aa381ded 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -1,7 +1,7 @@ name: handle manifest PR on: pull_request_target: - types: [opened, synchronize, closed, reopened] + types: [opened, synchronize, closed] branches: - main From 6dc9ba8e77278a7965af7e693fa16411ff07735f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1029/3334] Revert "[nrf noup] doc: extensions: kconfig: Add SoC sysbuild Kconfigs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ae076725d0a55ca8ce01f17feea2dd68e0ee8e2a. Signed-off-by: Tomasz Moń --- doc/_extensions/zephyr/kconfig/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index 63459a61ade6..704415eac101 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -114,9 +114,6 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d for folder in soc_folders: f.write('source "' + (Path(folder) / 'Kconfig.soc').as_posix() + '"\n') - if "nordic" in folder: - f.write('osource "' + (Path(folder) / 'Kconfig.sysbuild').as_posix() + '"\n') - with open(Path(td) / "soc" / "Kconfig", "w") as f: for folder in soc_folders: f.write('osource "' + (Path(folder) / 'Kconfig').as_posix() + '"\n') From 8dcc0ee887aab8de73ec9df7adbff127fa07c6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1030/3334] Revert "[nrf noup] soc: nrf54h: work around missing power domain handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ea96b5cb7e2294b808d59f81a5103f25d101c288. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/Kconfig | 5 ----- soc/nordic/nrf54h/soc.c | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 94f9cb9749f4..ac25cff79150 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -95,11 +95,6 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT endif # SOC_NRF54H20_CPURAD_ENABLE -config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND - bool "Disable all GPIO pin retention on boot" - default y - depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD - config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index c291767d0906..e6ae033b0cd0 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -14,7 +14,6 @@ #include #endif -#include #include #include #include @@ -181,17 +180,6 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } - - /* This is a workaround for not yet having upstream patches for properly handling - * pin retention. It should be removed as part of the next upmerge. - */ - if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) { - NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST; - - for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) { - nrf_gpio_port_retain_set(gpio_regs[i], 0); - } - } } #if defined(CONFIG_SOC_LATE_INIT_HOOK) From 8e4c26c7014e3c36526d01fa83e914a122445832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1031/3334] Revert "[nrf noup] zms: add lookup cache hash function for legacy ZMS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 02ee30e22ffc3e061a4a9fbd16f6da19bda4c81b. Signed-off-by: Tomasz Moń --- subsys/fs/zms/zms.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index babf6d09b60f..d3bc9275479d 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -13,12 +13,8 @@ #include #include "zms_priv.h" #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS -#ifdef CONFIG_SETTINGS_ZMS_LEGACY -#include -#else #include #endif -#endif #include LOG_MODULE_REGISTER(fs_zms, CONFIG_ZMS_LOG_LEVEL); @@ -36,40 +32,6 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at static inline size_t zms_lookup_cache_pos(zms_id_t id) { #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS -#ifdef CONFIG_SETTINGS_ZMS_LEGACY - /* - * 1. The ZMS settings backend uses up to (ZMS_NAME_ID_OFFSET - 1) ZMS IDs to - store keys and equal number of ZMS IDs to store values. - * 2. For each key-value pair, the value is stored at ZMS ID greater by exactly - * ZMS_NAME_ID_OFFSET than ZMS ID that holds the key. - * 3. The backend tries to minimize the range of ZMS IDs used to store keys. - * That is, ZMS IDs are allocated sequentially, and freed ZMS IDs are reused - * before allocating new ones. - * - * Therefore, to assure the least number of collisions in the lookup cache, - * the least significant bit of the hash indicates whether the given ZMS ID - * represents a key or a value, and remaining bits of the hash are set to - * the ordinal number of the key-value pair. Consequently, the hash function - * provides the following mapping: - * - * 1st settings key => hash 0 - * 1st settings value => hash 1 - * 2nd settings key => hash 2 - * 2nd settings value => hash 3 - * ... - */ - BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAMECNT_ID), "ZMS_NAMECNT_ID is not power of 2"); - BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAME_ID_OFFSET), "ZMS_NAME_ID_OFFSET is not power of 2"); - - uint32_t key_value_bit; - uint32_t key_value_ord; - uint32_t hash; - - key_value_bit = (id >> LOG2(ZMS_NAME_ID_OFFSET)) & 1; - key_value_ord = id & (ZMS_NAME_ID_OFFSET - 1); - - hash = ((key_value_ord << 1) | key_value_bit); -#else /* * 1. Settings subsystem is storing the name ID and the linked list node ID * with only one bit difference at BIT(0). @@ -95,7 +57,6 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; -#endif /* CONFIG_SETTINGS_ZMS_LEGACY */ #elif defined(CONFIG_ZMS_ID_64BIT) /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ From 7d6b5f2954645eeaa2b8c785930016177ea23505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1032/3334] Revert "[nrf noup] tests: crypto: Add ENTROPY_GENERATOR in overlays" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb410b1f8feda5b6f72e8f4216be28f87a9cf401. Signed-off-by: Tomasz Moń --- .../mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ------ 5 files changed, 30 deletions(-) delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y From 36d85581cc26363d00f1a631fffb712a0effe465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1033/3334] Revert "[nrf noup] tests: secure_storage: fix test w/ ZMS backend on 54L15" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cf3f710cf383235fb5b398deb1639535a3107017. Signed-off-by: Tomasz Moń --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index c794ea1797e5..6b244a065b65 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -29,7 +29,6 @@ tests: - EXTRA_DTC_OVERLAY_FILE=zms.overlay - EXTRA_CONF_FILE=\ overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf - - SB_CONFIG_PARTITION_MANAGER=n secure_storage.psa.its.secure_storage.store.zms.64-bit_uids: platform_allow: *zms_platform_allow From 838f4d869acb91cbb2c0618606e9c3d7be885129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1034/3334] Revert "[nrf noup] samples: bluetooth: mesh: update stack sizes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6c4ef51aea7818ffa0ef30ff09c906e5dc87ae87. Signed-off-by: Tomasz Moń --- samples/bluetooth/mesh_provisioner/prj.conf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 0e5f6490edee..241767805164 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -1,10 +1,6 @@ #CONFIG_INIT_STACKS=y -# Stack sizes from thread analysis + 50% margin, rounded to nearest 100 -CONFIG_MAIN_STACK_SIZE=4400 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4800 -CONFIG_BT_MESH_SETTINGS_WORKQ_STACK_SIZE=1700 -CONFIG_BT_MESH_ADV_STACK_SIZE=4000 -CONFIG_BT_RX_STACK_SIZE=3300 +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 # The Bluetooth API should not be used from a preemptive thread: CONFIG_MAIN_THREAD_PRIORITY=-2 From f22d7e67397b49d5c5753a30761ddad88e919fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1035/3334] Revert "[nrf noup] boards: arm: nrf9131ek: enable tfm" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bf4371e95d59ea33d53f5419548c9b618baab547. Signed-off-by: Tomasz Moń --- boards/nordic/nrf9131ek/Kconfig.defconfig | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index 1a30d006b4c6..e1d8de241c0a 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -8,22 +8,3 @@ config HW_STACK_PROTECTION config BOARD_NRF9131EK select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS - -if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_NRF9131EK_NRF9131_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS From 10ae1b97212a5602a54639c2c26713f6eb70d869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1036/3334] Revert "[nrf noup] boards: nordic: nrf7002dk: Bring back NS variants" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 15aa9fd61e8e96d6254fed5e238f300fd5ee3f9a. Signed-off-by: Tomasz Moń --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 --- boards/nordic/nrf7002dk/Kconfig | 4 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 72 ------------------- boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 18 +---- boards/nordic/nrf7002dk/board.yml | 4 -- .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ---------- .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 ----- ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 24 ------- .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 ----------- .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 ----- .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 23 ------ 12 files changed, 4 insertions(+), 273 deletions(-) delete mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt deleted file mode 100644 index db20255712bc..000000000000 --- a/boards/nordic/nrf7002dk/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND - CONFIG_BOARD_ENABLE_CPUNET) - zephyr_library() - zephyr_library_sources(nrf5340_cpunet_reset.c) -endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index d4b7030a65ab..fa6c8097ae32 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,9 +10,7 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 config BT_HCI_IPC default y if BT diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig index 0d89a0089968..48510d6e24f8 100644 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -9,75 +9,3 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION endif # BOARD_NRF7002DK - -if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -# By default, if we build for a Non-Secure version of the board, -# force building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -# Code Partition: -# -# For the secure version of the board the firmware is linked at the beginning -# of the flash, or into the code-partition defined in DT if it is intended to -# be loaded by MCUboot. If the secure firmware is to be combined with a non- -# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always -# be restricted to the size of its code partition. -# -# For the non-secure version of the board, the firmware -# must be linked into the code-partition (non-secure) defined in DT, regardless. -# Apply this configuration below by setting the Kconfig symbols used by -# the linker according to the information extracted from DT partitions. - -# SRAM Partition: -# -# If the secure firmware is to be combined with a non-secure image -# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always -# be restricted to the secure image SRAM partition (sram-secure-partition). -# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram -# may be used by the image. -# -# For the non-secure version of the board, the firmware image SRAM is -# always restricted to the allocated non-secure SRAM partition. -# -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - -if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ - TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif - -if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif - -endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 91f52ee6f08c..61b9e818f367 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,6 +4,4 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index 11a27910eebc..f85bbc86f485 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,24 +1,10 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) - set(TFM_PUBLIC_KEY_FORMAT "full") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -endif() - -if(CONFIG_TFM_FLASH_MERGED_BINARY) - set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 39db5dcfa3a7..4f41341e4423 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,9 +5,5 @@ board: socs: - name: nrf5340 variants: - - name: ns - cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp - variants: - - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts deleted file mode 100644 index 5ff28accf3fc..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dtsi" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - zephyr,wifi = &wlan0; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; -}; - -&qspi { - nrf70: nrf7001@1 { - compatible = "nordic,nrf7001-qspi"; - status = "okay"; - reg = <1>; - qspi-frequency = <24000000>; - qspi-quad-mode; - - #include "nrf70_common.dtsi" - }; -}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml deleted file mode 100644 index 165759691260..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns -name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usbd - - usb_device - - netif:openthread -vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig deleted file mode 100644 index 2c435653140a..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts deleted file mode 100644 index 0deb8ccc1bf5..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dtsi" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns_app; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - zephyr,wifi = &wlan0; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; -}; - -&qspi { - nrf70: nrf7002@1 { - compatible = "nordic,nrf7002-qspi"; - status = "okay"; - reg = <1>; - qspi-frequency = <24000000>; - qspi-quad-mode; - - #include "nrf70_common.dtsi" - #include "nrf70_common_5g.dtsi" - }; -}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml deleted file mode 100644 index ea43785b4559..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk/nrf5340/cpuapp/ns -name: NRF7002-DK-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usbd - - usb_device - - netif:openthread -vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig deleted file mode 100644 index 1886b926bfd5..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig +++ /dev/null @@ -1,23 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y From e0001403b5876459db71e64f38ab80a739a78272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1037/3334] Revert "[nrf noup] modules: hal_nordic: require nrf-regtool" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e8250a96ea58026ef672b999a308745323bbc0c4. Signed-off-by: Tomasz Moń --- modules/hal_nordic/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index e5b1ab60dfca..b6f352864123 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -13,7 +13,6 @@ if(CONFIG_NRF_REGTOOL_GENERATE_UICR) endif() if(DEFINED nrf_regtool_components) find_package(nrf-regtool 9.2.0 - REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From 1866073d4087ce2304122842995071d262dcbfd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1038/3334] Revert "[nrf noup] samples: lwm2m_client: Add support for nRF91x" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 901f81ef30e11f809740f5e90840eaadcd1a1f60. Signed-off-by: Tomasz Moń --- samples/net/lwm2m_client/overlay-nrf91x.conf | 53 -------------------- 1 file changed, 53 deletions(-) delete mode 100644 samples/net/lwm2m_client/overlay-nrf91x.conf diff --git a/samples/net/lwm2m_client/overlay-nrf91x.conf b/samples/net/lwm2m_client/overlay-nrf91x.conf deleted file mode 100644 index 7b902178e078..000000000000 --- a/samples/net/lwm2m_client/overlay-nrf91x.conf +++ /dev/null @@ -1,53 +0,0 @@ -# Configuration file for nRF91x -# This file is merged with prj.conf in the application folder, and options -# set here will take precedence if they are present in both files. - -# General -CONFIG_MAIN_STACK_SIZE=4096 - -CONFIG_NET_SOCKETS=y -CONFIG_NET_NATIVE=y -CONFIG_NET_SOCKETS_OFFLOAD=y - -CONFIG_NET_CONFIG_MY_IPV6_ADDR="" -CONFIG_NET_CONFIG_PEER_IPV6_ADDR="" -CONFIG_NET_CONFIG_MY_IPV4_ADDR="" -CONFIG_NET_CONFIG_MY_IPV4_GW="" - -CONFIG_NET_CONFIG_NEED_IPV6=n -CONFIG_NET_CONFIG_NEED_IPV4=n -CONFIG_NET_CONFIG_AUTO_INIT=n - -# Modem related configurations -CONFIG_NRF_MODEM_LIB_NET_IF=y -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_DOWN=n -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=n -CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y - -CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=n -CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=n - -# Disable Duplicate Address Detection (DAD) -# due to not being properly implemented for offloaded interfaces. -CONFIG_NET_IPV6_NBR_CACHE=n -CONFIG_NET_IPV6_MLD=n - -# Zephyr NET Connection Manager and Connectivity layer. -CONFIG_NET_CONNECTION_MANAGER=y -CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024 - -CONFIG_NET_SAMPLE_LWM2M_ID="nrf91x" -CONFIG_NET_SAMPLE_LWM2M_SERVER="coaps://leshan.eclipseprojects.io:5684" -CONFIG_LWM2M_DNS_SUPPORT=y - -## Enable DTLS support -CONFIG_LWM2M_DTLS_SUPPORT=y -CONFIG_LWM2M_TLS_SESSION_CACHING=y -CONFIG_LWM2M_DTLS_CID=y -CONFIG_TLS_CREDENTIALS=y - -## Crypto -CONFIG_OBERON_BACKEND=y -CONFIG_NORDIC_SECURITY_BACKEND=y -CONFIG_MBEDTLS_SHA256_C=y From 8b276fd4569feba554b084399213fd7aba767c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1039/3334] Revert "[nrf noup] ci: update test_spec label for E2E DFU tests" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0c8ea11856bfe33fb443b2a18c2e156c7d93b288. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 76def875e0be..5337249f7dab 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -49,33 +49,6 @@ - "tests/subsys/dfu/**/*" - "tests/subsys/mgmt/mcumgr/**/*" -"CI-dfu-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/**/*" - - "drivers/console/**/*" - - "drivers/flash/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/spi/**/*" - - "dts/arm/nordic/nrf54h*" - - "dts/common/nordic/*" - - "dts/riscv/nordic/nrf54h*" - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "include/zephyr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" - - "scripts/west_commands/runners/nrfutil.py" - - "soc/nordic/nrf54h/**/*" - - "subsys/bluetooth/**/*" - - "subsys/dfu/**/*" - - "subsys/logging/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "subsys/tracing/**/*" - "CI-tfm-test": - "boards/nordic/nrf5340dk/**/*" - "boards/nordic/nrf9160dk/**/*" From d4a580deaedccb3133e22e76e3e4d18c301521fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1040/3334] Revert "[nrf noup] boards: xiao_ble: Add static partition manager configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 96c7186a4f653b250f461d162b01bcb3b615e534. Signed-off-by: Tomasz Moń --- boards/seeed/xiao_ble/pm_static.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 boards/seeed/xiao_ble/pm_static.yml diff --git a/boards/seeed/xiao_ble/pm_static.yml b/boards/seeed/xiao_ble/pm_static.yml deleted file mode 100644 index 02915293177c..000000000000 --- a/boards/seeed/xiao_ble/pm_static.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Mirror of partitions defined in nrf52840_partition_uf2_sdv7.dtsi -# Default flash layout for nrf52840 using UF2 and SoftDevice s140 v7 - -softdevice_reserved: - address: 0x00 - size: 0x27000 - -app: - address: 0x27000 - size: 0xC5000 - -settings_storage: - address: 0xEC000 - size: 0x8000 - -uf2_partition: - address: 0xF4000 - size: 0xC000 From bdd45bf19ebc2ec4e78ff0a950fd736b67407343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1041/3334] Revert "[nrf noup] boards: nrf54h20dk: Enable default images for sysbuild" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a16995681bbde172a64087d300229a4df6259bf6. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/Kconfig.sysbuild | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 boards/nordic/nrf54h20dk/Kconfig.sysbuild diff --git a/boards/nordic/nrf54h20dk/Kconfig.sysbuild b/boards/nordic/nrf54h20dk/Kconfig.sysbuild deleted file mode 100644 index 29bd62b49927..000000000000 --- a/boards/nordic/nrf54h20dk/Kconfig.sysbuild +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF54H20DK_NRF54H20_CPURAD - -config NRF_DEFAULT_EMPTY - default y - -endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From 1b9b6c8129d6b97deef6bee62014b52d60adaf44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:36 +0100 Subject: [PATCH 1042/3334] Revert "[nrf noup] zephyr: doc: fix board page" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1bf617dae64055105957d594f872d9f56f975cc0. Signed-off-by: Tomasz Moń --- boards/index.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/boards/index.rst b/boards/index.rst index 2ffe426fc24b..3cc92770cfeb 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -12,8 +12,33 @@ template available under :zephyr_file:`doc/templates/board.tmpl`. Shields are hardware add-ons that can be stacked on top of a board to add extra functionality. Refer to the :ref:`shield_porting_guide` for more information on how to port a shield. +.. admonition:: Search Tips + :class: dropdown + + * Use the form below to filter the list of supported boards and shields. If a field is left + empty, it will not be used in the filtering process. + + * Filtering by name and vendor is available for both boards and shields. The rest of the fields + apply only to boards. + + * A board/shield must meet **all** criteria selected across different fields. For example, if you + select both a vendor and an architecture, only boards that match both will be displayed. Within + a single field, selecting multiple options (such as two architectures) will show boards + matching **either** option. + + * The list of supported hardware features for each board is automatically generated using + information from the Devicetree. It may not be reflecting the full list of supported features + since some of them may not be enabled by default. + + * Can't find your exact board? Don't worry! If a similar board with the same or a closely related + MCU exists, you can use it as a :ref:`starting point ` for adding + support for your own board. + .. toctree:: :maxdepth: 2 :glob: + :hidden: */index + +.. zephyr:board-catalog:: From b81a4b8c04428aeba7a69d68e9132a8623f67797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1043/3334] Revert "[nrf noup] ci: Update CI-boot-test patterns and remove SUIT labels" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 00f3f51c8ca6c1d8a51fd6f20f90c949071020c5. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5337249f7dab..6da6bdbaa87d 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,7 +39,6 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": - - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" @@ -365,3 +364,29 @@ - "tests/boards/nordic/**/*" - "tests/drivers/**/*" - "tests/kernel/**/*" + +"CI-suit-dfu-test": + - "subsys/mgmt/mcumgr/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "subsys/bluetooth/**/*" + - "drivers/bluetooth/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/console/**/*" + - "drivers/gpio/**/*" + - "dts/common/nordic/*" + - "dts/arm/nordic/nrf54h*/**/*" + - "dts/riscv/nordic/nrf54h*/**/*" + - "boards/nordic/nrf54h*/**/*" + - "soc/nordic/nrf54h/**/*" + - "include/zephyr/**/*" + - "subsys/logging/**/*" + - "subsys/tracing/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/nrfutil.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" From c35f38432899ef576fbc7ff56ed010d436b25d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1044/3334] Revert "[nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1b4e0ff6ab4bbf17cd8af3d22a662ab959e9b7dd. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index eded57d639f6..842c0850447e 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1446,32 +1446,6 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop - - # NCS-specific allowlist - # zephyr-keep-sorted-start re(^\s+") - "APP_CPUNET_RUN", # Used by sample - "APP_DFU", # Used by sample - "BT_FAST_PAIR", # Legacy/removed, used in migration documentation - "COMP_DATA_LAYOUT_ARRAY", # Used by test - "COMP_DATA_LAYOUT_MULTIPLE", # Used by test - "COMP_DATA_LAYOUT_SINGLE", # Used by test - "DTM_NO_DFE", # Used by DTM application - "DTM_TRANSPORT_HCI", # Used by DTM application - "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation - "INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation - "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "ML_APP_REMOTE_BOARD", # Used by machine learning application - "MY_APP_IMAGE_ABC", # Used in documentation - "NETCORE_ABC", # Used in documentation - "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests - "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation - "SUIT_ENVELOPE_", # Used by jinja - "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation - "SUIT_MPI_", # Used by jinja - "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation - "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample - # zephyr-keep-sorted-stop } From e81123402a3d86f9ca11728a44ed44a810b8d121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1045/3334] Revert "[nrf noup] ci: NCS-specific CI tweaks" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b40cd57e43af44bba3585aced15cda9370a1a660. Signed-off-by: Tomasz Moń --- .github/workflows/commit-tags.yml | 28 -------------------------- .github/workflows/compliance.yml | 13 +++++++----- Jenkinsfile | 5 ----- scripts/gitlint/zephyr_commit_rules.py | 4 ++-- 4 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/commit-tags.yml delete mode 100644 Jenkinsfile diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml deleted file mode 100644 index 828f02971678..000000000000 --- a/.github/workflows/commit-tags.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Commit tags - -on: - pull_request: - types: [synchronize, opened, reopened, edited, labeled, unlabeled, - milestoned, demilestoned, assigned, unassigned, ready_for_review, - review_requested] - -jobs: - commit_tags: - runs-on: ubuntu-22.04 - name: Run commit tags checks on patch series (PR) - steps: - - name: Update PATH for west - run: | - echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Checkout the code - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - - name: Run the commit tags - uses: nrfconnect/action-commit-tags@main - with: - target: . - upstream: zephyrproject-rtos/zephyr/main diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 0e39baa4732d..9d19b5a69e65 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -34,8 +34,8 @@ jobs: git config --global user.name "Your Name" git remote -v # Ensure there's no merge commits in the PR - #[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ - #(echo "::error ::Merge commits not allowed, rebase instead";false) + [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ + (echo "::error ::Merge commits not allowed, rebase instead";false) rm -fr ".git/rebase-apply" rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} @@ -72,9 +72,12 @@ jobs: git log --pretty=oneline | head -n 10 # Increase rename limit to allow for large PRs git config diff.renameLimit 10000 - ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic \ - -e Kconfig -e SysbuildKconfig -e KconfigBasicNoModules -e SysbuildKconfigBasicNoModules \ - -e ModulesMaintainers -c origin/${BASE_REF}.. + excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat" + # The signed-off-by check for dependabot should be skipped + if [ "${{ github.actor }}" == "dependabot[bot]" ]; then + excludes="$excludes -e Identity" + fi + ./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3b9cf0022399..000000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,5 +0,0 @@ -@Library("CI_LIB") _ - -def pipeline = new ncs.sdk_zephyr.Main() - -pipeline.run(JOB_NAME) diff --git a/scripts/gitlint/zephyr_commit_rules.py b/scripts/gitlint/zephyr_commit_rules.py index ef317e22684c..a2c9cd3cb7fe 100644 --- a/scripts/gitlint/zephyr_commit_rules.py +++ b/scripts/gitlint/zephyr_commit_rules.py @@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule): name = "title-max-length-no-revert" id = "UC5" target = CommitMessageTitle - options_spec = [IntOption('line-length', 120, "Max line length")] + options_spec = [IntOption('line-length', 75, "Max line length")] violation_message = "Commit title exceeds max length ({0}>{1})" def validate(self, line, _commit): @@ -103,7 +103,7 @@ class MaxLineLengthExceptions(LineRule): name = "max-line-length-with-exceptions" id = "UC4" target = CommitMessageBody - options_spec = [IntOption('line-length', 120, "Max line length")] + options_spec = [IntOption('line-length', 75, "Max line length")] violation_message = "Commit message body line exceeds max length ({0}>{1})" def validate(self, line, _commit): From 4d6a9c070e2dac23aef8fff2493cd654f4e2b058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1046/3334] Revert "[nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 941e975e39b65ae6eb9c0eca9354b73d18a16a3d. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 ---- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 ------- tests/bluetooth/tester/sysbuild.cmake | 7 ++++ .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 40 ------------------- .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 13 ------ .../tester/sysbuild/hci_ipc/prj.conf | 23 ----------- 6 files changed, 7 insertions(+), 97 deletions(-) delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 51b0ef5fa8d4..5bb1c4d82846 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -22,10 +22,3 @@ CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_BTTESTER_LOG_LEVEL_DBG=y CONFIG_UART_INTERRUPT_DRIVEN=y - -# Enable PSA RNG -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n -CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 4f9de686b7e5..e6d4f675f57a 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,17 +12,3 @@ status = "okay"; hw-flow-control; }; - -// Enable PSA RNG -/ { - chosen { - zephyr,entropy = &psa_rng; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; - - /delete-node/ prng; -}; diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index b640a7d04936..bcd564733c53 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -18,6 +18,13 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) ) endif() + if(SB_CONFIG_SOC_NRF54H20_CPUAPP) + set(${NET_APP}_CONF_FILE + ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf + CACHE INTERNAL "" + ) + endif() + set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index b7d64a9e6a08..000000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,40 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_ISR_STACK_SIZE=1024 -CONFIG_IDLE_STACK_SIZE=256 -CONFIG_MAIN_STACK_SIZE=1024 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=8192 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y - -CONFIG_BT_BUF_EVT_RX_COUNT=16 -CONFIG_BT_BUF_EVT_RX_SIZE=255 -CONFIG_BT_BUF_ACL_RX_SIZE=255 -CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_BUF_CMD_TX_SIZE=255 - -# Host -CONFIG_BT_BROADCASTER=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_OBSERVER=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_EXT_ADV=y -CONFIG_BT_PER_ADV=y -CONFIG_BT_PER_ADV_SYNC=y - -# Controller -CONFIG_BT_LL_SW_SPLIT=n -CONFIG_BT_LL_SOFTDEVICE=y -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 -CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 - -# Enable PSA RNG -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n -CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay deleted file mode 100644 index e34567fe834a..000000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ /dev/null @@ -1,13 +0,0 @@ -// Enable PSA RNG -/ { - chosen { - zephyr,entropy = &psa_rng; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; - - /delete-node/ prng; -}; diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf deleted file mode 100644 index 08b1aed9e7f6..000000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf +++ /dev/null @@ -1,23 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_HEAP_MEM_POOL_SIZE=4096 - -CONFIG_MAIN_STACK_SIZE=512 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y -CONFIG_BT_MAX_CONN=16 - - -# Workaround: Unable to allocate command buffer when using K_NO_WAIT since -# Host number of completed commands does not follow normal flow control. -CONFIG_BT_BUF_CMD_TX_COUNT=10 - -# Enable and adjust the below value as necessary -# CONFIG_BT_BUF_EVT_RX_COUNT=16 -# CONFIG_BT_BUF_EVT_RX_SIZE=255 -# CONFIG_BT_BUF_ACL_RX_SIZE=255 -# CONFIG_BT_BUF_ACL_TX_SIZE=251 -# CONFIG_BT_BUF_CMD_TX_SIZE=255 From 8ac4235bc9b870330193047509fbacb6db4b89be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1047/3334] Revert "[nrf noup] tests: crypto: Set size for PSA slot" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 21e5b2ba250adf950e9d1fbb8a982e75c3cd3e6f. Signed-off-by: Tomasz Moń --- tests/crypto/secp256r1/mbedtls.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/crypto/secp256r1/mbedtls.conf b/tests/crypto/secp256r1/mbedtls.conf index c4ea620de55f..bbc2eb0e6563 100644 --- a/tests/crypto/secp256r1/mbedtls.conf +++ b/tests/crypto/secp256r1/mbedtls.conf @@ -1,7 +1,6 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED=y -CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE=65 CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=2 From 3eca4c6d298ce4e05cd9cb4f126b483d90d0ebcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1048/3334] Revert "[nrf noup] Bluetooth: update experimental for qualification" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 61fb90cffe6b7f097c4250adcc35ec2411d6514d. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/Kconfig | 4 +--- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 98107940b949..7fd3c46fe35a 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -138,12 +138,10 @@ config HAS_BT_CTLR bool config BT_LL_SW_SPLIT - bool "Software-based Bluetooth LE Link Layer [EXPERIMENTAL]" + bool "Software-based Bluetooth LE Link Layer" default y depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED select HAS_BT_CTLR - select EXPERIMENTAL - select ENTROPY_GENERATOR help Use Zephyr software Bluetooth LE Link Layer ULL LLL split implementation. diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index 34e862378c5e..2841e7d8a129 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -52,7 +52,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" + bool "L2CAP Enhanced Credit Based Flow Control support" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From bc19546316419d60187fd67bc7359168a6e000e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1049/3334] Revert "[nrf noup] drivers: spi_dw: Bring back custom EXMIF peripheral handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd107c19620f0a70d83848bc3928d2eb8b9e6f50. Signed-off-by: Tomasz Moń --- drivers/pinctrl/pinctrl_nrf.c | 3 +- drivers/spi/spi_dw.c | 32 +--------------------- dts/bindings/spi/nordic,nrf-exmif-spi.yaml | 8 ------ 3 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 dts/bindings/spi/nordic,nrf-exmif-spi.yaml diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index b052e61eb803..a9902d33f801 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -468,8 +468,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) || \ - DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif_spi) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) /* Pin routing is controlled by secure domain, via UICR */ case NRF_FUN_EXMIF_CK: case NRF_FUN_EXMIF_DQ0: diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index 6941bfdaaa77..bd10447e4429 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -41,14 +41,6 @@ LOG_MODULE_REGISTER(spi_dw); #include #endif -#ifdef CONFIG_HAS_NRFX -#include -#endif - -#ifdef CONFIG_SOC_NRF54H20_GPD -#include -#endif - static inline bool spi_dw_is_slave(struct spi_dw_data *spi) { return (IS_ENABLED(CONFIG_SPI_SLAVE) && @@ -266,7 +258,6 @@ static int spi_dw_configure(const struct device *dev, /* Baud rate and Slave select, for master only */ write_baudr(dev, SPI_DW_CLK_DIVIDER(info->clock_frequency, config->frequency)); - write_ser(dev, BIT(config->slave)); } if (spi_dw_is_slave(spi)) { @@ -521,10 +512,6 @@ void spi_dw_isr(const struct device *dev) uint32_t int_status; int error; -#ifdef CONFIG_HAS_NRFX - NRF_EXMIF->EVENTS_CORE = 0; -#endif - int_status = read_isr(dev); LOG_DBG("SPI %p int_status 0x%x - (tx: %d, rx: %d)", dev, int_status, @@ -573,18 +560,6 @@ int spi_dw_init(const struct device *dev) DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); -#ifdef CONFIG_HAS_NRFX - NRF_EXMIF->INTENSET = BIT(0); - NRF_EXMIF->TASKS_START = 1; - -#ifdef CONFIG_SOC_NRF54H20_GPD - err = nrf_gpd_request(NRF_GPD_FAST_ACTIVE1); - if (err < 0) { - return err; - } -#endif -#endif - info->config_func(); /* Masking interrupt and making sure controller is disabled */ @@ -609,11 +584,6 @@ int spi_dw_init(const struct device *dev) return 0; } -#define REG_ADDR(inst) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), nordic_nrf_exmif_spi), \ - (Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(core, DT_DRV_INST(inst))), \ - (DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)))) - #define SPI_CFG_IRQS_SINGLE_ERR_LINE(inst) \ IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, rx_avail, irq), \ DT_INST_IRQ_BY_NAME(inst, rx_avail, priority), \ @@ -686,7 +656,7 @@ COND_CODE_1(IS_EQ(DT_NUM_IRQS(DT_DRV_INST(inst)), 1), \ SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ }; \ static const struct spi_dw_config spi_dw_config_##inst = { \ - REG_ADDR(inst), \ + DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ .clock_frequency = COND_CODE_1( \ DT_NODE_HAS_PROP(DT_INST_PHANDLE(inst, clocks), clock_frequency), \ (DT_INST_PROP_BY_PHANDLE(inst, clocks, clock_frequency)), \ diff --git a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml deleted file mode 100644 index d988b4146878..000000000000 --- a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic External Memory Interface (EXMIF) used in SPI mode only - -compatible: "nordic,nrf-exmif-spi" - -include: snps,designware-spi.yaml From da04f08bb4bcc07596c95ea23dc3c11c101f0a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1050/3334] Revert "[nrf noup] samples: bluetooth: hci_ipc: increase main stack size for Cracen driver on nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 87b955d64661b0e5a3b8637a6c87bc91f6329bb7. Signed-off-by: Tomasz Moń --- .../bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index 296e68366389..000000000000 --- a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Increase stack size for Cracen driver. -CONFIG_MAIN_STACK_SIZE=1024 From 0273bf4f44d1e3124a405af528c66840fcdc3367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1051/3334] Revert "[nrf noup] samples: bluetooth: mesh: Disable secure storage for real targets." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c503c44c0604383f0b486cde3d92e128a343ee50. Signed-off-by: Tomasz Moń --- samples/bluetooth/mesh/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh/prj.conf | 2 +- samples/bluetooth/mesh_demo/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh_demo/prj.conf | 2 +- samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh_provisioner/prj.conf | 2 +- samples/boards/nordic/mesh/onoff-app/prj.conf | 2 +- .../nordic/mesh/onoff_level_lighting_vnd_app/prj.conf | 2 +- tests/bluetooth/mesh_shell/boards/qemu_x86.conf | 6 ------ tests/bluetooth/mesh_shell/prj.conf | 2 +- 10 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 samples/bluetooth/mesh/boards/qemu_x86.conf delete mode 100644 samples/bluetooth/mesh_demo/boards/qemu_x86.conf delete mode 100644 samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf delete mode 100644 tests/bluetooth/mesh_shell/boards/qemu_x86.conf diff --git a/samples/bluetooth/mesh/boards/qemu_x86.conf b/samples/bluetooth/mesh/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh/prj.conf b/samples/bluetooth/mesh/prj.conf index cd7d6532b614..14b19316a866 100644 --- a/samples/bluetooth/mesh/prj.conf +++ b/samples/bluetooth/mesh/prj.conf @@ -5,7 +5,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_HWINFO=y CONFIG_BT=y diff --git a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_demo/prj.conf b/samples/bluetooth/mesh_demo/prj.conf index b7016b02c65b..bcb738ae5bd1 100644 --- a/samples/bluetooth/mesh_demo/prj.conf +++ b/samples/bluetooth/mesh_demo/prj.conf @@ -31,7 +31,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y # Limit the number of key slots in PSA Crypto core to reduce # RAM footprint diff --git a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 241767805164..10949c5480db 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -45,7 +45,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y #CONFIG_BT_MESH_LOG_LEVEL_DBG=y #CONFIG_BT_MESH_SETTINGS_LOG_LEVEL_DBG=y diff --git a/samples/boards/nordic/mesh/onoff-app/prj.conf b/samples/boards/nordic/mesh/onoff-app/prj.conf index 0783579e795e..0e67042b2653 100644 --- a/samples/boards/nordic/mesh/onoff-app/prj.conf +++ b/samples/boards/nordic/mesh/onoff-app/prj.conf @@ -9,7 +9,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf index 96b5466b4a16..3bb984208c70 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf @@ -7,7 +7,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT_OBSERVER=y CONFIG_BT_BROADCASTER=y diff --git a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index aab2745d359f..2af600295680 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT=y CONFIG_BT_OBSERVER=y From 61a5a4528541ed4fb4163e4bc467eb9b8cdddb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1052/3334] Revert "[nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fe3a3d0941063e3b4207b3593f5165ce12449474. Signed-off-by: Tomasz Moń --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ------------------ 2 files changed, 1 insertion(+), 949 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 15ba5475436c..f92cefce480e 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -1308,6 +1308,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_config_reserved_resources_ncs.h" + default "nrfx_reserved_resources.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h deleted file mode 100644 index ec8a9acaf7b5..000000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h +++ /dev/null @@ -1,948 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ -#define NRFX_CONFIG_RESERVED_RESOURCES_H__ - -/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE130_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) - -/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE131_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) - -/** @brief Bitmask that defines EGU instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_EGUS_USED 0 - -/** @brief Bitmask that defines TIMER instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_TIMERS_USED 0 - -/* If the GRTC system timer driver is to be used, prepare definitions required - * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and - * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. - */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ - (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ - ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ - (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ - DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ - -/* - * The enabled Bluetooth controller subsystem is responsible for providing - * definitions of the BT_CTLR_USED_* symbols used below in a file named - * bt_ctlr_used_resources.h and for adding its location to global include - * paths so that the file can be included here for all Zephyr libraries that - * are to be built. - */ -#if defined(CONFIG_BT_LL_SW_SPLIT) -#include -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#endif -#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ - -#if defined(CONFIG_BT_LL_SOFTDEVICE) -/* Define auxiliary symbols needed for SDC device dispatch. */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRF52_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRF53_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRF54L_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF71X) -#define NRF71_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRF54H_SERIES -#endif -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) -#else -#error Unsupported chip family -#endif -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ - -#if defined(CONFIG_NRF_802154_RADIO_DRIVER) -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#include <../src/nrf_802154_peripherals_nrf52.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#include <../src/nrf_802154_peripherals_nrf53.h> -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#include <../src/nrf_802154_peripherals_nrf54l.h> -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#include <../src/nrf_802154_peripherals_nrf54h.h> -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ - -#if defined(CONFIG_MPSL) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ - (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif - -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL -#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL -#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL -#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL -#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL -#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL -#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL -#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL -#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL -#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL -#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL -#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL -#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL -#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL -#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL -#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL -#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL -#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 -#endif - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) - -BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_CHANNELS_USED \ - (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI0_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_GROUPS_USED \ - (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI0_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_CHANNELS_USED \ - (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI00_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_GROUPS_USED \ - (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI00_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_CHANNELS_USED \ - (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI10_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_GROUPS_USED \ - (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI10_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_CHANNELS_USED \ - (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI20_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_GROUPS_USED \ - (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI20_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_CHANNELS_USED \ - (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI30_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_GROUPS_USED \ - (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI30_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_CHANNELS_USED \ - (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI020_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_GROUPS_USED \ - (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI020_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_CHANNELS_USED \ - (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI030_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_GROUPS_USED \ - (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI030_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_CHANNELS_USED \ - (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI120_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_GROUPS_USED \ - (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI120_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_CHANNELS_USED \ - (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI130_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_GROUPS_USED \ - (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI130_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_CHANNELS_USED \ - (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI131_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_GROUPS_USED \ - (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI131_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_CHANNELS_USED \ - (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI132_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_GROUPS_USED \ - (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI132_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_CHANNELS_USED \ - (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI133_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_GROUPS_USED \ - (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI133_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_CHANNELS_USED \ - (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI134_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_GROUPS_USED \ - (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI134_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_CHANNELS_USED \ - (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI135_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_GROUPS_USED \ - (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI135_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_CHANNELS_USED \ - (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI136_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_GROUPS_USED \ - (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI136_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines PPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_CHANNELS_USED \ - (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) - -#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED -#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED - -/** @brief Bitmask that defines PPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_GROUPS_USED \ - (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) - -#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ - (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ - (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ - (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ - (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ - (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ - (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ - (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ - NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) - -#if defined(CONFIG_SOFTDEVICE) -#include -#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED -#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED -#else -#define NRFX_PPI_CHANNELS_USED_BY_SD 0 -#define NRFX_PPI_GROUPS_USED_BY_SD 0 -#endif - -#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ From 42f83759b3a6265d2de76a33d076aec1da9bb0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1053/3334] Revert "[nrf noup] ble: Adding missing AES config for BT_CRYPTO" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a21f2c7449457ad53ef9ed60f3a4783efe9cfca9. Signed-off-by: Tomasz Moń --- subsys/bluetooth/crypto/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/crypto/Kconfig b/subsys/bluetooth/crypto/Kconfig index 0e382060278a..e9234e4157b3 100644 --- a/subsys/bluetooth/crypto/Kconfig +++ b/subsys/bluetooth/crypto/Kconfig @@ -7,7 +7,6 @@ config BT_CRYPTO select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_CMAC select PSA_WANT_ALG_ECB_NO_PADDING - imply MBEDTLS_CIPHER_AES_ENABLED if !BUILD_WITH_TFM imply MBEDTLS_AES_ROM_TABLES if MBEDTLS_PSA_CRYPTO_C help This option enables the Bluetooth Cryptographic Toolbox. From 3ba6ee557cea99a26ead6ccc5d4c8d8a92141b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1054/3334] Revert "[nrf noup] bluetooth: Temporary Kconfig fix for BT RPC configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 97662003001131768dffc7ec052ade4142ebbb90. Signed-off-by: Tomasz Moń --- drivers/bluetooth/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index e64a33f663ce..a1680af6583d 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -12,7 +12,7 @@ menuconfig BT_DRIVERS bool "Bluetooth drivers" default y - depends on BT && BT_HCI + depends on BT if BT_DRIVERS From 22076a21e2a2891ffe015fa8d905ac0d9c92ee47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1055/3334] Revert "[nrf noup] Revert "mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA"" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 83ee44f5f9f464c472c150e59c889499744ff3aa. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig.mbedtls | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index b4932b31635f..b0077361908c 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -283,6 +283,7 @@ config MBEDTLS_SOME_CIPHER_ENABLED config MBEDTLS_CIPHER_AES_ENABLED bool "AES block cipher" + default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C if MBEDTLS_CIPHER_AES_ENABLED From 51dc80a690660e72ff7956252d038c9d471bb1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1056/3334] Revert "[nrf noup] samples/tests: Add TF-M sysbuild config files" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e404d8bae28549eb35fc207141e3037219213194. Signed-off-by: Tomasz Moń --- samples/subsys/usb/dfu/sysbuild.conf | 1 - tests/drivers/flash/common/sysbuild.conf | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 samples/subsys/usb/dfu/sysbuild.conf create mode 100644 tests/drivers/flash/common/sysbuild.conf diff --git a/samples/subsys/usb/dfu/sysbuild.conf b/samples/subsys/usb/dfu/sysbuild.conf deleted file mode 100644 index 47f00ff3cff8..000000000000 --- a/samples/subsys/usb/dfu/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/drivers/flash/common/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n From 99a472fae8c43b453fcef7242ab5b9d74c990018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:37 +0100 Subject: [PATCH 1057/3334] Revert "[nrf noup] soc: nrf54l: Add custom section for KMU" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit db894542538d1c8afe8a8f5416c2f2472a9a5f79. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54l/CMakeLists.txt | 13 ------------- soc/nordic/nrf54l/kmu_push_area_section.ld | 19 ------------------- 2 files changed, 32 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 b220b9d2a7a2..cebbda571b68 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -6,16 +6,3 @@ zephyr_library_sources( ../validate_rram_partitions.c ) zephyr_include_directories(.) - -dt_nodelabel(kmu_push_area_node NODELABEL nrf_kmu_reserved_push_area) - -# We need a buffer in memory in a static location which can be used by -# the KMU peripheral. The KMU has a static destination address, we chose -# this address to be 0x20000000, which is the first address in the SRAM. -if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND NOT kmu_push_area_node) -# 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) - -zephyr_linker_section(NAME ".nrf_kmu_reserved_push_area" ADDRESS "${RAM_ADDR}" GROUP RAM_REGION NOINIT) -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 e8c8cd9f09ad..000000000000 --- 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 42d480cb5de6511bee3b68e7fbf16fd09ab11310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1058/3334] Revert "[nrf noup] dts: choose a crypto accelerator for entropy" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6468c47d8ff7eb39c96b7893f33978db1b90991c. Signed-off-by: Tomasz Moń --- dts/arm/nordic/nrf52840.dtsi | 4 ++-- dts/arm/nordic/nrf5340_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf91.dtsi | 3 +-- soc/nordic/common/Kconfig.peripherals | 6 ++---- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index b04b31a640dc..c0a2545f0137 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -8,7 +8,7 @@ / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -571,7 +571,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 b4c077ea2bf4..b9762248a5df 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -34,7 +34,7 @@ }; chosen { - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng_hci; zephyr,flash-controller = &flash_controller; }; @@ -104,7 +104,7 @@ reg = <0x50844000 0x1000>, <0x50845000 0x1000>; reg-names = "wrapper", "core"; interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index fa269e71c37e..ee8be4b8d765 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -18,7 +18,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &psa_rng; + zephyr,entropy = &rng; }; soc { @@ -34,7 +34,7 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 31cbe7d9ea41..2ef4b9bbab20 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -28,7 +28,6 @@ }; chosen { - zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -52,7 +51,7 @@ reg = <0x50840000 0x1000>, <0x50841000 0x1000>; reg-names = "wrapper", "core"; interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; - status = "okay"; + status = "disabled"; }; ctrlap: ctrlap@50006000 { diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index fa7fd2a411aa..d7e489b446a5 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 dbdf75b3aa38c4333286b0ca4c4524609bdc5e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1059/3334] Revert "[nrf noup] Bluetooth: Mesh: Disable processing of ext ADV packets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cff0f47ccddabd30b041f88027047598ca39dea9. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/Kconfig | 11 ----------- subsys/bluetooth/mesh/adv_ext.c | 12 ------------ 2 files changed, 23 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 069dbe218f5e..38a39af2820d 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -215,17 +215,6 @@ config BT_MESH_ADV_EXT_FRIEND_SEPARATE messages as close to the start of the ReceiveWindow as possible, thus reducing the scanning time on the Low Power node. -config BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS - bool "Reject or accept extended advertising packets" - depends on BT_LL_SOFTDEVICE - help - Configure the scanner and initiator to either reject or accept extended - advertising packets by the SoftDevice Controller. This is set to false - by default, to prevent loss of scan time when receiving a pointer packet - while scanning for Bluetooth Mesh packets. Set to true if extended - advertising packets are to be received by the SoftDevice Controller for - purposes other than Bluetooth Mesh. - endif # BT_MESH_ADV_EXT endchoice diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 0cfaec39fdb7..68a6c27beebf 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -529,18 +529,6 @@ void bt_mesh_adv_init(void) K_PRIO_COOP(MESH_WORKQ_PRIORITY), NULL); k_thread_name_set(&bt_mesh_workq.thread, "BT MESH WQ"); } - -#if defined(CONFIG_BT_LL_SOFTDEVICE) - const sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t cmd_params = { - .accept_ext_adv_packets = IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS), - }; - - int err = sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set(&cmd_params); - - if (err) { - LOG_ERR("Failed to set accept_ext_adv_packets: %d", err); - } -#endif } static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance) From 2bf688f891550423892764214cf7afb227b601c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1060/3334] Revert "[nrf noup] tests: bluetooth: tester: sysbuild configurable 53/54H" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2527560672fbbee00d6fcb7a4f8e78069293368b. Signed-off-by: Tomasz Moń --- .../nrf54h20_cpurad-bt_ll_softdevice.conf | 33 ------------------- tests/bluetooth/tester/Kconfig.sysbuild | 1 - tests/bluetooth/tester/sysbuild.cmake | 16 ++------- 3 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf diff --git a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf deleted file mode 100644 index 1f7748e5cd7d..000000000000 --- a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf +++ /dev/null @@ -1,33 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_ISR_STACK_SIZE=1024 -CONFIG_IDLE_STACK_SIZE=256 -CONFIG_MAIN_STACK_SIZE=512 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=8192 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y - -CONFIG_BT_BUF_EVT_RX_COUNT=16 -CONFIG_BT_BUF_EVT_RX_SIZE=255 -CONFIG_BT_BUF_ACL_RX_SIZE=255 -CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_BUF_CMD_TX_SIZE=255 - -# Host -CONFIG_BT_BROADCASTER=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_OBSERVER=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_EXT_ADV=y -CONFIG_BT_PER_ADV=y -CONFIG_BT_PER_ADV_SYNC=y - -# Controller -CONFIG_BT_LL_SW_SPLIT=n -CONFIG_BT_LL_SOFTDEVICE=y -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 -CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/tests/bluetooth/tester/Kconfig.sysbuild b/tests/bluetooth/tester/Kconfig.sysbuild index e14a6e1aa8e0..69e4d5a97fbe 100644 --- a/tests/bluetooth/tester/Kconfig.sysbuild +++ b/tests/bluetooth/tester/Kconfig.sysbuild @@ -5,7 +5,6 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string - default "nrf54h20dk/nrf54h20/cpurad" if "$(BOARD)" = "nrf54h20dk" default "nrf5340dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340dk" default "nrf5340_audio_dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340_audio_dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP" diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index bcd564733c53..a9ddf1279471 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -2,6 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) + # For builds in the nrf5340, we build the netcore image with the controller + set(NET_APP hci_ipc) set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP}) @@ -11,20 +13,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) BOARD ${SB_CONFIG_NET_CORE_BOARD} ) - if(SB_CONFIG_SOC_NRF5340_CPUAPP) - set(${NET_APP}_SNIPPET - "bt-ll-sw-split" - CACHE INTERNAL "" - ) - endif() - - if(SB_CONFIG_SOC_NRF54H20_CPUAPP) - set(${NET_APP}_CONF_FILE - ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf - CACHE INTERNAL "" - ) - endif() - set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" From 045746ca99667d172afe547bc72b5324b8d85aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1061/3334] Revert "[nrf noup] net: tests: crypto: Adding legacy Crypto support ipv6 tests" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d362d275f37ae7526714a3b715575a6870848acd. Signed-off-by: Tomasz Moń --- tests/net/ipv6/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index 6a6be5dba36a..9f9f21d59050 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -33,7 +33,6 @@ CONFIG_NET_IF_MAX_IPV6_COUNT=2 CONFIG_NET_IPV6_PE=y CONFIG_NET_IPV6_PE_FILTER_PREFIX_COUNT=2 CONFIG_NET_IPV6_PE_PREFER_PUBLIC_ADDRESSES=n -CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y # Increase the stack a bit for mps2/an385 CONFIG_NET_RX_STACK_SIZE=1700 From 2c11db800ee12e311566abae694899938648569c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1062/3334] Revert "[nrf noup] net: tests: Add legacy crypto API support for big_http_download" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b3b8a6d583656f514d3c8906bf29f5b26eb66842. Signed-off-by: Tomasz Moń --- samples/net/sockets/big_http_download/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/net/sockets/big_http_download/prj.conf b/samples/net/sockets/big_http_download/prj.conf index 8677e7113e4b..a406f314dfb2 100644 --- a/samples/net/sockets/big_http_download/prj.conf +++ b/samples/net/sockets/big_http_download/prj.conf @@ -3,7 +3,6 @@ CONFIG_REQUIRES_FULL_LIBC=y CONFIG_MBEDTLS=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_MD=y -CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y CONFIG_MAIN_STACK_SIZE=2536 # Networking config From bcaa394d469ba5b902f4766cfa7e4748adcdc66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1063/3334] Revert "[nrf noup] mbedtls: Don't enable auto-generation of Mbed TLS files" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a26136810a384b6fd09339d4f2e72428eb0753e. Signed-off-by: Tomasz Moń --- tests/crypto/mbedtls/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/crypto/mbedtls/CMakeLists.txt b/tests/crypto/mbedtls/CMakeLists.txt index 47670bead010..7ebdc9d76a9a 100644 --- a/tests/crypto/mbedtls/CMakeLists.txt +++ b/tests/crypto/mbedtls/CMakeLists.txt @@ -6,5 +6,15 @@ project(mbedtls) set(output_file ${PROJECT_BINARY_DIR}/mbedtls-check.timestamp) +add_custom_command( + COMMENT "Check Mbed TLS auto-generated files" + COMMAND + ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/modules/mbedtls/create_psa_files.py --check + OUTPUT + ${output_file} +) + +add_custom_target(check_mbedtls_auto_generated_files ALL DEPENDS ${output_file}) + FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) From ccb0f17c3e47cffe2f03eacb6356dbeb917e97b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1064/3334] Revert "[nrf noup] samples: net: Enable Wi-Fi driver in sysbuild builds" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4a986ba1947915c34d1127c823c529b6b52e2c0b. Signed-off-by: Tomasz Moń --- samples/net/dns_resolve/Kconfig.sysbuild | 13 ------------- samples/net/ipv4_autoconf/Kconfig.sysbuild | 13 ------------- samples/net/lwm2m_client/Kconfig.sysbuild | 13 ------------- samples/net/mdns_responder/Kconfig.sysbuild | 13 ------------- samples/net/mqtt_publisher/Kconfig.sysbuild | 13 ------------- samples/net/mqtt_sn_publisher/Kconfig.sysbuild | 13 ------------- samples/net/sockets/coap_server/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_async/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_client/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_server/Kconfig.sysbuild | 13 ------------- samples/net/sockets/http_get/Kconfig.sysbuild | 13 ------------- samples/net/sockets/sntp_client/Kconfig.sysbuild | 13 ------------- samples/net/syslog_net/Kconfig.sysbuild | 13 ------------- samples/net/telnet/Kconfig.sysbuild | 13 ------------- samples/net/wifi/Kconfig.sysbuild | 13 ------------- samples/net/wifi/shell/sample.yaml | 2 -- 16 files changed, 197 deletions(-) delete mode 100644 samples/net/dns_resolve/Kconfig.sysbuild delete mode 100644 samples/net/ipv4_autoconf/Kconfig.sysbuild delete mode 100644 samples/net/lwm2m_client/Kconfig.sysbuild delete mode 100644 samples/net/mdns_responder/Kconfig.sysbuild delete mode 100644 samples/net/mqtt_publisher/Kconfig.sysbuild delete mode 100644 samples/net/mqtt_sn_publisher/Kconfig.sysbuild delete mode 100644 samples/net/sockets/coap_server/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_async/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_client/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_server/Kconfig.sysbuild delete mode 100644 samples/net/sockets/http_get/Kconfig.sysbuild delete mode 100644 samples/net/sockets/sntp_client/Kconfig.sysbuild delete mode 100644 samples/net/syslog_net/Kconfig.sysbuild delete mode 100644 samples/net/telnet/Kconfig.sysbuild delete mode 100644 samples/net/wifi/Kconfig.sysbuild diff --git a/samples/net/dns_resolve/Kconfig.sysbuild b/samples/net/dns_resolve/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/dns_resolve/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/ipv4_autoconf/Kconfig.sysbuild b/samples/net/ipv4_autoconf/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/ipv4_autoconf/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/lwm2m_client/Kconfig.sysbuild b/samples/net/lwm2m_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/lwm2m_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mdns_responder/Kconfig.sysbuild b/samples/net/mdns_responder/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/mdns_responder/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_publisher/Kconfig.sysbuild b/samples/net/mqtt_publisher/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/mqtt_publisher/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/coap_server/Kconfig.sysbuild b/samples/net/sockets/coap_server/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/coap_server/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_async/Kconfig.sysbuild b/samples/net/sockets/echo_async/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/echo_async/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_client/Kconfig.sysbuild b/samples/net/sockets/echo_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/echo_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_server/Kconfig.sysbuild b/samples/net/sockets/echo_server/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/echo_server/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/http_get/Kconfig.sysbuild b/samples/net/sockets/http_get/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/http_get/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/sntp_client/Kconfig.sysbuild b/samples/net/sockets/sntp_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/sntp_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/syslog_net/Kconfig.sysbuild b/samples/net/syslog_net/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/syslog_net/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/telnet/Kconfig.sysbuild b/samples/net/telnet/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/telnet/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/Kconfig.sysbuild b/samples/net/wifi/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/wifi/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index 8543e6bfb38b..5f72e0686116 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -58,7 +58,6 @@ tests: - nrf7002dk/nrf5340/cpuapp/nrf7001 sample.net.wifi.nrf7002ek: extra_args: - - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002ek platform_allow: @@ -70,7 +69,6 @@ tests: sample.net.wifi.nrf7002eb: extra_args: - CONFIG_NRF70_UTIL=y - - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002eb platform_allow: From e66442440328e4efa96ed375dd52b94823aea75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1065/3334] Revert "[nrf noup] lib: os: zvfs: Remove EXPERIMENTAL from ZVFS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2aa414a3ac39577a553c4ab2b7a0ded8558ab9a6. Signed-off-by: Tomasz Moń --- lib/os/zvfs/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index 495d5c849685..a9c9518a1d5d 100644 --- a/lib/os/zvfs/Kconfig +++ b/lib/os/zvfs/Kconfig @@ -6,6 +6,7 @@ menuconfig ZVFS bool "Zephyr virtual filesystem (ZVFS) support [EXPERIMENTAL]" select FDTABLE + select EXPERIMENTAL help ZVFS is a central, Zephyr-native library that provides a common interoperable API for all types of file descriptors such as those from the non-virtual FS, sockets, eventfds, FILE *'s From 0c7a31037a5f22f6472675d2caf520ed61ffe1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1066/3334] Revert "[nrf noup] kernel: banner: Make function weak" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 19fcc84b983e4d184492e3f4e97654acab089fec. Signed-off-by: Tomasz Moń --- kernel/banner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/banner.c b/kernel/banner.c index a16784cb975c..5cadda0a5e98 100644 --- a/kernel/banner.c +++ b/kernel/banner.c @@ -24,7 +24,7 @@ #endif /* BUILD_VERSION */ #endif /* !BANNER_VERSION */ -__weak void boot_banner(void) +void boot_banner(void) { #if defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0) #ifdef CONFIG_BOOT_BANNER From c6dcf98e997b280f8467d2fa1483fe54ff9dd0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1067/3334] Revert "[nrf noup] mbedtls: Don't select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2579412c828f02d1e40424e4698590c91d185f3c. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig.mbedtls | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index b0077361908c..df2422d4c1e5 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -117,7 +117,6 @@ config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE if PSA_CRYPTO_CLIENT - select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE if PSA_CRYPTO_CLIENT config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED bool "DHE-RSA based ciphersuite modes" From 2778d99c55d18ef87df0b1eff7eb08847df79f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1068/3334] Revert "[nrf noup] mbedtls: Adding missing configuration for RSA key type derive" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2c73db0cf52ab4670770061de00485acca9af2ee. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig.psa.auto | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index b235c30380fb..834252432b52 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -298,9 +298,4 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE - bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY - default y if PSA_CRYPTO_ENABLE_ALL - endif # PSA_CRYPTO_CLIENT From 2180c387bdce4b36c9b4c05d12897594361a77bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1069/3334] Revert "[nrf noup] mbedtls: Adding helptext warnings for weak crypto" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c85ef306b1a58c9ed57b0ee3185b025401773df6. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig.psa.auto | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 834252432b52..fa8cdbc7b536 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -88,9 +88,7 @@ config PSA_WANT_ALG_HMAC config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - help - Warning: The MD5 hash is weak and deprecated and is only recommended - for use in legacy protocols. + config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -121,9 +119,6 @@ config PSA_WANT_ALG_RSA_PSS config PSA_WANT_ALG_SHA_1 bool "PSA_WANT_ALG_SHA_1" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - help - Warning: The SHA-1 hash is weak and deprecated and is only recommended - for use in legacy protocols. config PSA_WANT_ALG_SHA_224 bool "PSA_WANT_ALG_SHA_224" if !MBEDTLS_PROMPTLESS From f025294f775b5296d60bea1f0b6ae22d17b22eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1070/3334] Revert "[nrf noup] mbedtls: Add dependency logic for PSA crypto configurations" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7b3b6f1e251be8f3c0cbeef0418ef83f541f65af. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig.psa.auto | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index fa8cdbc7b536..56a81dd6efda 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -71,7 +71,6 @@ config PSA_WANT_ALG_GCM config PSA_WANT_ALG_HKDF bool "PSA_WANT_ALG_HKDF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_HKDF_EXTRACT bool "PSA_WANT_ALG_HKDF_EXTRACT" if !MBEDTLS_PROMPTLESS @@ -93,12 +92,11 @@ config PSA_WANT_ALG_MD5 config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_CMAC + config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -155,22 +153,18 @@ config PSA_WANT_ALG_SHA3_512 config PSA_WANT_ALG_STREAM_CIPHER bool "PSA_WANT_ALG_STREAM_CIPHER" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - select PSA_WANT_KEY_TYPE_CHACHA20 config PSA_WANT_ALG_TLS12_PRF bool "PSA_WANT_ALG_TLS12_PRF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_PSK_TO_MS bool "PSA_WANT_ALG_TLS12_PSK_TO_MS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS bool "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_SHA_256 config PSA_WANT_ECC_BRAINPOOL_P_R1_256 bool "PSA_WANT_ECC_BRAINPOOL_P_R1_256" if !MBEDTLS_PROMPTLESS @@ -243,8 +237,7 @@ config PSA_WANT_KEY_TYPE_AES config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_CHACHA20_POLY1305 || \ - PSA_WANT_ALG_STREAM_CIPHER + config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS @@ -260,37 +253,30 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL endif # PSA_CRYPTO_CLIENT From 55f3f007bbd1d6bf23f4e4ebbdca8c914e5089d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1071/3334] Revert "[nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f6c0e6227ff71f6a0dddfbd086f4d90306ceca39. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig.psa.auto | 61 +++++++++++++++++++++++++++++++ modules/mbedtls/Kconfig.psa.logic | 7 ++++ 2 files changed, 68 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 56a81dd6efda..08b1bbc02410 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -36,6 +36,10 @@ config PSA_WANT_ALG_CMAC bool "PSA_WANT_ALG_CMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_CFB + bool "PSA_WANT_ALG_CFB" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_ALG_CHACHA20_POLY1305 bool "PSA_WANT_ALG_CHACHA20_POLY1305" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -56,6 +60,10 @@ config PSA_WANT_ALG_ECDH bool "PSA_WANT_ALG_ECDH" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_FFDH + bool "PSA_WANT_ALG_FFDH" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_ALG_ECDSA bool "PSA_WANT_ALG_ECDSA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -88,6 +96,9 @@ config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_OFB + bool "PSA_WANT_ALG_OFB" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -97,6 +108,9 @@ config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_RIPEMD160 + bool "PSA_WANT_ALG_RIPEMD160" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -214,6 +228,26 @@ config PSA_WANT_ECC_SECP_R1_521 bool "PSA_WANT_ECC_SECP_R1_521" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_DH_RFC7919_2048 + bool "PSA_WANT_DH_RFC7919_2048" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_3072 + bool "PSA_WANT_DH_RFC7919_3072" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_4096 + bool "PSA_WANT_DH_RFC7919_4096" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_6144 + bool "PSA_WANT_DH_RFC7919_6144" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_8192 + bool "PSA_WANT_DH_RFC7919_8192" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_DERIVE bool "PSA_WANT_KEY_TYPE_DERIVE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -234,15 +268,30 @@ config PSA_WANT_KEY_TYPE_AES bool "PSA_WANT_KEY_TYPE_AES" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_ARIA + bool "PSA_WANT_KEY_TYPE_ARIA" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_CAMELLIA + bool "PSA_WANT_KEY_TYPE_CAMELLIA" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DES + bool "PSA_WANT_KEY_TYPE_DES" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY + bool "PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_RAW_DATA bool "PSA_WANT_KEY_TYPE_RAW_DATA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -279,4 +328,16 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + endif # PSA_CRYPTO_CLIENT diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index 9c3a55ea3191..972054e105b0 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -47,3 +47,10 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC + bool + default y + depends on PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT || \ + PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT || \ + PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE From 54e6e91dc8c12bb0f98dea019464517b3e4959ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1072/3334] Revert "[nrf noup] mbedtls: Enable PSA_WANT_GENERATE_RANDOM for PSA RNG" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 61ce2d882c57bb597a46dc04ec73d24a99402760. Signed-off-by: Tomasz Moń --- drivers/entropy/Kconfig.psa_crypto | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/entropy/Kconfig.psa_crypto b/drivers/entropy/Kconfig.psa_crypto index 18514a071d1c..d06001225b05 100644 --- a/drivers/entropy/Kconfig.psa_crypto +++ b/drivers/entropy/Kconfig.psa_crypto @@ -7,7 +7,6 @@ config ENTROPY_PSA_CRYPTO_RNG bool "PSA Crypto Random source Entropy driver" depends on DT_HAS_ZEPHYR_PSA_CRYPTO_RNG_ENABLED select ENTROPY_HAS_DRIVER - select PSA_WANT_GENERATE_RANDOM default y help Enable the PSA Crypto source Entropy driver. From cfd070a37e662f41b60652df2902354e717d6b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:38 +0100 Subject: [PATCH 1073/3334] Revert "[nrf noup] modules: mbedtls: Disable configurations in Kconfig.tls-generic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 82cb1d57ad9bb855515f932534c6bd112d999919. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig.mbedtls | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index df2422d4c1e5..4a71ec496142 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -7,8 +7,6 @@ menu "Mbed TLS configuration" depends on MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-mbedtls.h" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - menu "TLS" config MBEDTLS_TLS_VERSION_1_2 @@ -42,8 +40,6 @@ endif # MBEDTLS_TLS_VERSION_1_2 || MBEDTLS_TLS_VERSION_1_3 endmenu # TLS -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - menu "Ciphersuite configuration" comment "Supported key exchange modes" @@ -64,8 +60,6 @@ config MBEDTLS_GENPRIME_ENABLED endif # MBEDTLS_RSA_C -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_MD @@ -98,8 +92,6 @@ config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED bool "RSA-PSK based ciphersuite modes" depends on MBEDTLS_PKCS1_V15 || MBEDTLS_PKCS1_V21 -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -107,8 +99,6 @@ config MBEDTLS_PSK_MAX_LEN Max size of TLS pre-shared keys, in bytes. It has no effect if no PSK key exchange is used. -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "RSA-only based ciphersuite modes" depends on MBEDTLS_MD @@ -246,12 +236,8 @@ config MBEDTLS_ECP_NIST_OPTIM endif -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - comment "Supported ciphers and cipher modes" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers and modes" select MBEDTLS_CIPHER_AES_ENABLED @@ -342,12 +328,8 @@ config MBEDTLS_CMAC bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers." depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - comment "Supported hash algorithms" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_HASH_ALL_ENABLED bool "All available MAC methods" select MBEDTLS_MD5 @@ -388,14 +370,10 @@ config MBEDTLS_SHA512 config MBEDTLS_POLY1305 bool "Poly1305 hash family" -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - endmenu comment "Random number generators" -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_CTR_DRBG_ENABLED bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED @@ -405,21 +383,15 @@ config MBEDTLS_HMAC_DRBG_ENABLED bool "HMAC_DRBG random generator" select MBEDTLS_MD -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - comment "Other configurations" config MBEDTLS_CIPHER bool "generic cipher layer." default y if PSA_WANT_ALG_CMAC -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_MD bool "generic message digest layer." -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_ASN1_PARSE_C bool "Support for ASN1 parser functions" @@ -459,8 +431,6 @@ config MBEDTLS_HAVE_ASM of asymmetric cryptography, however this might have an impact on the code size. -if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_ENTROPY_C bool "Mbed TLS entropy accumulator" depends on MBEDTLS_SHA256 || MBEDTLS_SHA384 || MBEDTLS_SHA512 @@ -469,8 +439,6 @@ config MBEDTLS_ENTROPY_C mostly used in conjunction with CTR_DRBG or HMAC_DRBG to create a deterministic random number generator. -endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) - config MBEDTLS_ENTROPY_POLL_ZEPHYR bool "Provide entropy data to Mbed TLS through entropy driver or random generator" default y From 3caf70fae116990e38d1fcdf4ad251dd64f6be91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1074/3334] Revert "[nrf noup] samples: basic: blinky: add eGPIO tests configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f7c0fe841bc5c675f28daf3df5b774471b810fcf. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay diff --git a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay deleted file mode 100644 index bd1ceb2f8945..000000000000 --- a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -&led0 { - gpios = <&hpf_gpio 9 GPIO_ACTIVE_HIGH>; -}; From d94d326bcbbacbe58f0b1142ce492ea0dc789e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1075/3334] Revert "[nrf noup] board: nordic_ thingy53: Enable QSPI by default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f65b03997a63031a1393f7c4612aa099d2297d70. Signed-off-by: Tomasz Moń --- 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 b7f33e89bf1b..badcb5c20e5d 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -97,9 +97,6 @@ config MCUBOOT_USB_SUPPORT bool default n -config NORDIC_QSPI_NOR - default y - endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From 726a57b76265a65d25a4a8cd352f8e6577800f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1076/3334] Revert "[nrf noup] drivers: flash: kconfig: nrf_rram region resolution" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ffd7e53f74c26648be3fa6320f8b3a544f010f94. Signed-off-by: Tomasz Moń --- 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 d8a5abf64b2e..b40bb16968bf 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -77,14 +77,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 953dc893e55e4237d268f804dbe3c19002762aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1077/3334] Revert "[nrf noup] ci: Enable action-manifest-pr" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d20c47b85b2ded6bb902954f18b4daded254dbe0. Signed-off-by: Tomasz Moń --- .github/workflows/manifest-PR.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/manifest-PR.yml diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml deleted file mode 100644 index a871aa381ded..000000000000 --- a/.github/workflows/manifest-PR.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: handle manifest PR -on: - pull_request_target: - types: [opened, synchronize, closed] - branches: - - main - - -jobs: - call-manifest-pr-action: - runs-on: ubuntu-latest - steps: - - name: handle manifest PR - uses: nrfconnect/action-manifest-pr@main - with: - token: ${{ secrets.NCS_GITHUB_TOKEN }} - manifest-pr-title-details: ${{ github.event.pull_request.title }} From 04c6a500d1ad8aa339ca76b38837f92d8f829a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1078/3334] Revert "[nrf noup] settings: nvs: use dedicated lookup cache hash function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 726425bfc28f2408dcc66417939bb5e3e97ffca7. Signed-off-by: Tomasz Moń --- subsys/fs/nvs/Kconfig | 9 --------- subsys/fs/nvs/nvs.c | 46 ------------------------------------------- 2 files changed, 55 deletions(-) diff --git a/subsys/fs/nvs/Kconfig b/subsys/fs/nvs/Kconfig index 21798932f521..48915c2f048e 100644 --- a/subsys/fs/nvs/Kconfig +++ b/subsys/fs/nvs/Kconfig @@ -29,15 +29,6 @@ config NVS_LOOKUP_CACHE_SIZE Number of entries in Non-volatile Storage lookup cache. It is recommended that it be a power of 2. -config NVS_LOOKUP_CACHE_FOR_SETTINGS - bool "Non-volatile Storage lookup cache optimized for settings" - depends on NVS_LOOKUP_CACHE - help - Use the lookup cache hash function that results in the least number of - collissions and, in turn, the best NVS performance provided that the NVS - is used as the settings backend only. This option should NOT be enabled - if the NVS is also written to directly, outside the settings layer. - config NVS_DATA_CRC bool "Non-volatile Storage CRC protection on the data" help diff --git a/subsys/fs/nvs/nvs.c b/subsys/fs/nvs/nvs.c index f36d5b76dd56..8a710d570fb1 100644 --- a/subsys/fs/nvs/nvs.c +++ b/subsys/fs/nvs/nvs.c @@ -13,11 +13,6 @@ #include #include "nvs_priv.h" -#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS -#include -#include -#endif - #include LOG_MODULE_REGISTER(fs_nvs, CONFIG_NVS_LOG_LEVEL); @@ -26,45 +21,6 @@ static int nvs_ate_valid(struct nvs_fs *fs, const struct nvs_ate *entry); #ifdef CONFIG_NVS_LOOKUP_CACHE -#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS - -static inline size_t nvs_lookup_cache_pos(uint16_t id) -{ - /* - * 1. The NVS settings backend uses up to (NVS_NAME_ID_OFFSET - 1) NVS IDs to - store keys and equal number of NVS IDs to store values. - * 2. For each key-value pair, the value is stored at NVS ID greater by exactly - * NVS_NAME_ID_OFFSET than NVS ID that holds the key. - * 3. The backend tries to minimize the range of NVS IDs used to store keys. - * That is, NVS IDs are allocated sequentially, and freed NVS IDs are reused - * before allocating new ones. - * - * Therefore, to assure the least number of collisions in the lookup cache, - * the least significant bit of the hash indicates whether the given NVS ID - * represents a key or a value, and remaining bits of the hash are set to - * the ordinal number of the key-value pair. Consequently, the hash function - * provides the following mapping: - * - * 1st settings key => hash 0 - * 1st settings value => hash 1 - * 2nd settings key => hash 2 - * 2nd settings value => hash 3 - * ... - */ - BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAMECNT_ID), "NVS_NAMECNT_ID is not power of 2"); - BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAME_ID_OFFSET), "NVS_NAME_ID_OFFSET is not power of 2"); - - uint16_t key_value_bit; - uint16_t key_value_ord; - - key_value_bit = (id >> LOG2(NVS_NAME_ID_OFFSET)) & 1; - key_value_ord = id & (NVS_NAME_ID_OFFSET - 1); - - return ((key_value_ord << 1) | key_value_bit) % CONFIG_NVS_LOOKUP_CACHE_SIZE; -} - -#else /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ - static inline size_t nvs_lookup_cache_pos(uint16_t id) { uint16_t hash; @@ -80,8 +36,6 @@ static inline size_t nvs_lookup_cache_pos(uint16_t id) return hash % CONFIG_NVS_LOOKUP_CACHE_SIZE; } -#endif /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ - static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) { int rc; From e1cd670186b5862e6d7a4ad756e197cb46233ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1079/3334] Revert "[nrf noup] samples: sysbuild: hello_world: support PM on nRF53" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 166df2e6a793043ee6e275b8d526768944c7410b. Signed-off-by: Tomasz Moń --- samples/sysbuild/hello_world/sysbuild.cmake | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index 8f8fc49dbff3..c7c2615c665a 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -11,17 +11,5 @@ ExternalZephyrProject_Add( BOARD ${SB_CONFIG_REMOTE_BOARD} ) -if(SB_CONFIG_SOC_SERIES_NRF53X) - set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) - set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) - set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) - set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") -else(SB_CONFIG_SOC_SERIES_NRF54LX) - set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) - set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) - set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) - set(CPUFLPR_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") -endif() - add_dependencies(${DEFAULT_IMAGE} remote) sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote) From 29bb844e134cafb1f79a2d61f9b5a5e18ea75b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1080/3334] Revert "[nrf noup] board: nordic: thingy53: Default to update only MCUboot type" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc6ba5504883223dffaa0a96f4b99a5b0f83a778. Signed-off-by: Tomasz Moń --- boards/nordic/thingy53/Kconfig.sysbuild | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index df489c1dd546..c03d191b3708 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -7,10 +7,6 @@ choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -choice MCUBOOT_MODE - default MCUBOOT_MODE_OVERWRITE_ONLY -endchoice - config SECURE_BOOT_NETCORE default y @@ -20,9 +16,6 @@ config NETCORE_APP_UPDATE config NRF_DEFAULT_EMPTY default y if SECURE_BOOT_NETCORE -config MCUBOOT_USE_ALL_AVAILABLE_RAM - default y if BOARD_THINGY53_NRF5340_CPUAPP_NS && BOOTLOADER_MCUBOOT - endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY From e6a257778c5acbdbdd0dc901f8ae64ed30544091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1081/3334] =?UTF-8?q?Revert=20"[nrf=20noup]=C2=A0Bluetooth?= =?UTF-8?q?:=20Mesh:=20remove=20legacy=20adv=20support"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 11670b5620de6d0b7496c70527032ac9331e8667. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/Kconfig | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 38a39af2820d..351b18b88e9a 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -59,16 +59,12 @@ choice BT_MESH_ADV menuconfig BT_MESH_ADV_LEGACY bool "Legacy advertising" - depends on BT_LL_SW_SPLIT help Use legacy advertising commands for mesh sending. Legacy - advertising is significantly slower than the extended advertising. + advertising is significantly slower than the extended advertising, but + is supported by all controllers. - WARNING: This feature is not supported in NCS. The legacy advertiser will not work - with SDC, as attempting to start an advertisement during the scanner duty cycle - will result in an error. The Zephyr Link Layer can be used experimentally as an - alternative. - The legacy advertiser can occasionally do more message + WARNING: The legacy advertiser can occasionally do more message retransmissions than requested because of limitations of HCI interface API. From 6d3c29bb41fb5538a4106f3aeed268802e382300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1082/3334] Revert "[nrf noup] kernel: Disable boot banner if NCS_BOOT_BANNER is enabled" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 88523835cd867c28c27dfd933b19eb3e59b6b086. Signed-off-by: Tomasz Moń --- kernel/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/Kconfig b/kernel/Kconfig index d46026508ae6..3d33a7995ae0 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -457,7 +457,6 @@ config SKIP_BSS_CLEAR config BOOT_BANNER bool "Boot banner" default y - depends on !NCS_BOOT_BANNER select PRINTK select EARLY_CONSOLE help From 87ddbcb96e0eaab0112d9d86c2119a9ab31a6979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1083/3334] Revert "[nrf noup] tree-wide: support NCS Partition Manager (PM) definitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 19efc58959be53320f4de816d0b74c1d49d80485. Signed-off-by: Tomasz Moń --- arch/arm/core/mpu/arm_mpu_regions.c | 13 ----- cmake/linker/ld/target.cmake | 1 - cmake/linker/lld/target.cmake | 1 - cmake/modules/kernel.cmake | 4 -- drivers/flash/soc_flash_nrf.c | 11 ---- drivers/flash/soc_flash_nrf_rram.c | 11 ---- .../arch/arm/cortex_m/scripts/linker.ld | 50 ------------------- include/zephyr/storage/flash_map.h | 6 --- lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 18 +------ subsys/dfu/boot/mcuboot_shell.c | 40 --------------- subsys/fs/littlefs_fs.c | 7 +-- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ---------- 13 files changed, 4 insertions(+), 187 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 383fd573513c..0bf7a219c27d 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,9 +8,6 @@ #include #include -#if USE_PARTITION_MANAGER -#include -#endif static const struct arm_mpu_region mpu_regions[] = { #ifdef CONFIG_XIP @@ -27,14 +24,6 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", -#if USE_PARTITION_MANAGER - PM_SRAM_ADDRESS, -#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) - REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), -#else - REGION_RAM_ATTR(REGION_SRAM_SIZE)), -#endif -#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, \ @@ -42,8 +31,6 @@ static const struct arm_mpu_region mpu_regions[] = { #else REGION_RAM_ATTR(REGION_SRAM_SIZE)), #endif - -#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index ccf6a1903162..592596576d11 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,7 +80,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} - -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index fe8aad62c73d..96df1c123796 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,7 +52,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} - -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 5c8fa184b208..c6319611c8c3 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -256,7 +256,3 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() - -if(ZEPHYR_NRF_MODULE_DIR) - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) -endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 574739082dc4..9e1ba68319ff 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -37,11 +37,6 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -171,12 +166,6 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index 84c7e958f3cd..9f0e24dc33d5 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,11 +54,6 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -297,12 +292,6 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index c8579f2a8023..688165d0698b 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,39 +34,6 @@ #define ROMSTART_REGION ROMABLE_REGION #endif -#if USE_PARTITION_MANAGER - -#include - -#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) -/* We are linking against S1, create symbol containing the flash ID of S0. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S0_ID; - -#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ - -#ifdef PM_S1_ID -/* We are linking against S0, create symbol containing the flash ID of S1. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S1_ID; -#endif /* PM_S1_ID */ - -#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ - -#define ROM_ADDR PM_ADDRESS -#define ROM_SIZE PM_SIZE - -#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) -#define RAM_SIZE CONFIG_PM_SRAM_SIZE -#else -#define RAM_SIZE PM_SRAM_SIZE -#endif -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -88,23 +55,6 @@ _image_1_primary_slot_id = PM_S1_ID; #define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS -#endif /* USE_PARTITION_MANAGER */ - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) -#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) -#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) -#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) -#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) -#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) -#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) -#endif - #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 9dc6bd91438f..6ce33c859632 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -348,10 +348,6 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); -#if USE_PARTITION_MANAGER -#include -#else - /** * Returns non-0 value if fixed-partition or fixed-subpartition of given * DTS node label exists. @@ -521,8 +517,6 @@ DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) #undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ -#endif /* USE_PARTITION_MANAGER */ - #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index 9a39ab8ad73b..0d97da3e340b 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -81,7 +81,7 @@ config HEAP_LISTENER choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) && !PARTITION_MANAGER_ENABLED + default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 2821ae8173ac..2b01e152f009 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,20 +25,6 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); -#if USE_PARTITION_MANAGER - -#include - -#define RAM_SIZE PM_SRAM_SIZE -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - -#define RAM_SIZE (KB((size_t) CONFIG_SRAM_SIZE)) -#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS - -#endif /* USE_PARTITION_MANAGER */ - #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -120,8 +106,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((RAM_SIZE - \ - ((size_t) HEAP_BASE - (size_t) RAM_ADDR)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ + ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index e167bc1e39b8..be4e558713f1 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,16 +20,6 @@ #endif #endif -#if USE_PARTITION_MANAGER -#include - -#ifdef CONFIG_NCS_IS_VARIANT_IMAGE -#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID -#else -#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID -#endif -#endif - struct area_desc { const char *name; unsigned int id; @@ -103,35 +93,6 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ -#if USE_PARTITION_MANAGER -#ifdef PM_MCUBOOT_ID - if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { - shell_error(sh, "Cannot erase boot partition"); - return -EACCES; - } -#endif - -#ifdef PM_APP_ID - if (id == PM_APP_ID) { - shell_error(sh, "Cannot erase this area"); - return -EACCES; - } -#endif - -#ifdef PM_MCUBOOT_PRIMARY_APP_ID - if (id == PM_MCUBOOT_PRIMARY_APP_ID) { - shell_error(sh, "Cannot erase this area"); - return -EACCES; - } -#endif - -#ifdef ACTIVE_IMAGE_ID - if (id == ACTIVE_IMAGE_ID) { - shell_error(sh, "Cannot erase active partitions"); - return -EACCES; - } -#endif -#else #if FIXED_PARTITION_EXISTS(boot_partition) if (id == FIXED_PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -144,7 +105,6 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } -#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index 5abbf95f949e..7cf8aaa44c7b 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1103,12 +1103,7 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = DT_INST_PROP(inst, mount_point), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *) \ - COND_CODE_1(USE_PARTITION_MANAGER, \ - (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ - (FIXED_PARTITION_ID(littlefs_storage)), \ - (FIXED_PARTITION_ID(storage)))), \ - (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ + .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index 9996e1d74d9b..a74e46b85207 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,35 +13,8 @@ extern "C" { #endif -#if CONFIG_PARTITION_MANAGER_ENABLED - -#include "pm_config.h" - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) -#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE -#else -/* The current image is a child image in a different domain than the image - * which defined the required values. To reach the values of the parent domain - * we use the 'PM__' variant of the define. - */ -#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ - -#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ - -#else - -#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) -#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) - -#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From 4cb89a01898f4cdabf3088c174c1d69af537fd96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1084/3334] Revert "[nrf noup] include: net: add NCS extensions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e99b3428e85466a8034c52c4d67542e7b8e19fe0. Signed-off-by: Tomasz Moń --- include/zephyr/net/socket.h | 1 - include/zephyr/net/socket_ncs.h | 207 -------------------------------- 2 files changed, 208 deletions(-) delete mode 100644 include/zephyr/net/socket_ncs.h diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index d5447b097e57..2eab2d964628 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -36,7 +36,6 @@ #include #include #include -#include #include #ifdef __cplusplus diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h deleted file mode 100644 index 6a77d6c41f13..000000000000 --- a/include/zephyr/net/socket_ncs.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ -#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ - -/** - * @file - * @brief NCS specific additions to the BSD sockets API definitions - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence - * when creating a new socket. Combine this flag with a socket type when - * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). - * If it's desired to create a native TLS socket, but still offload the - * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. - */ -#define SOCK_NATIVE 0x80000000 -#define SOCK_NATIVE_TLS 0x40000000 - -/** Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options. - */ -#define NET_SOCKET_NCS_BASE 1000 - -/* NCS specific TLS level socket options */ - -/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. - * The option accepts an integer, indicating the total handshake timeout, - * including retransmissions, in seconds. - * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. - */ -#define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) - -/** Socket option to save DTLS connection, specifically for nRF sockets. - */ -#define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) - -/** Socket option to load DTLS connection, specifically for nRF sockets. - */ -#define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) - -/** Socket option to get result of latest TLS/DTLS completed handshakes end status, - * specifically for nRF sockets. - * The option accepts an integer, indicating the setting. - * Accepted vaules for the option are: 0 and 1. - */ -#define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) - -/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ -#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */ -#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ -#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ - -/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */ -#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 -#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 - -/* NCS specific socket options */ - -/** sockopt: enable sending data as part of exceptional events */ -#define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) -/** sockopt: Keep socket open when its PDN connection is lost - * or the device is put into flight mode. - */ -#define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) -/** sockopt: bind to PDN */ -#define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) - -/** sockopt: Release assistance indication (RAI). - * The option accepts an integer, indicating the type of RAI. - * Accepted values for the option are: @ref RAI_NO_DATA, @ref RAI_LAST, @ref RAI_ONE_RESP, - * @ref RAI_ONGOING, @ref RAI_WAIT_MORE. - */ -#define SO_RAI (NET_SOCKET_NCS_BASE + 61) - -/** Release assistance indication (RAI). - * Indicate that the application does not intend to send more data. - * This applies immediately and lets the modem exit connected mode more - * quickly. - * - * @note This requires the socket to be connected. - */ -#define RAI_NO_DATA 1 -/** Release assistance indication (RAI). - * Indicate that the application does not intend to send more data - * after the next call to send() or sendto(). - * This lets the modem exit connected mode more quickly after sending the data. - */ -#define RAI_LAST 2 -/** Release assistance indication (RAI). - * Indicate that the application is expecting to receive just one data packet - * after the next call to send() or sendto(). - * This lets the modem exit connected mode more quickly after having received the data. - */ -#define RAI_ONE_RESP 3 -/** Release assistance indication (RAI). - * Indicate that the socket is in active use by a client application. - * This lets the modem stay in connected mode longer. - */ -#define RAI_ONGOING 4 -/** Release assistance indication (RAI). - * Indicate that the socket is in active use by a server application. - * This lets the modem stay in connected mode longer. - */ -#define RAI_WAIT_MORE 5 - -/** sockopt: set a callback to be called when a send request is acknowledged by the network and - * the data has been acknowledged by the peer, if required by the network protocol, or until the - * timeout, given by the SO_SNDTIMEO socket option, is reached. Valid timeout values are - * 1 to 600 seconds. - * This option takes a @ref socket_ncs_sendcb structure. - * - * @note The callback is executed in an interrupt context. - * Take care to offload any processing as appropriate. - * - * @note This is only supported by the following modem firmware: - * - mfw_nrf9151-ntn - * - * This socket option cannot be used along with the @ref MSG_WAITACK send flag. - */ -#define SO_SENDCB (NET_SOCKET_NCS_BASE + 63) - -/** Parameters returned in the @ref socket_ncs_sendcb_t callback. */ -struct socket_ncs_sendcb_params { - /** Socket handle. */ - int fd; - /** Status. Can be 0 on successful send or EAGAIN on timeout. */ - int status; - /** Number of bytes that was sent. */ - size_t bytes_sent; -}; - -/** Callback type in the @ref socket_ncs_sendcb structure. */ -typedef void (*socket_ncs_sendcb_t)(const struct socket_ncs_sendcb_params *params); - -/** Option value for the @ref SO_SENDCB socket option. */ -struct socket_ncs_sendcb { - /** Callback function. */ - socket_ncs_sendcb_t callback; -}; - -/* NCS specific IPPROTO_ALL level socket options */ - -/** IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. */ -#define IPPROTO_ALL 512 -/** sockopt: disable all replies to unexpected traffics */ -#define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) - -/* NCS specific IPPROTO_IP level socket options */ - -/** sockopt: enable IPv4 ICMP replies */ -#define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) - -/* NCS specific IPPROTO_IPV6 level socket options */ - -/** sockopt: enable IPv6 ICMP replies */ -#define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) - -/** sockopt: Delay IPv6 address refresh during power saving mode */ -#define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) - -/* NCS specific TCP level socket options */ - -/** sockopt: Configurable TCP server session timeout in minutes. - * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). - */ -#define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) - -/* NCS specific gettaddrinfo() flags */ - -/** Assume `service` contains a Packet Data Network (PDN) ID. - * When specified together with the AI_NUMERICSERV flag, - * `service` shall be formatted as follows: "port:pdn_id" - * where "port" is the port number and "pdn_id" is the PDN ID. - * Example: "8080:1", port 8080 PDN ID 1. - * Example: "42:0", port 42 PDN ID 0. - */ -#define AI_PDNSERV 0x1000 - -/* NCS specific send() and sendto() flags */ - -/** Request a blocking send operation until the request is acknowledged. - * When used in send() or sendto(), the request will not return until the - * send operation is completed by lower layers, or until the timeout, given by the SO_SNDTIMEO - * socket option, is reached. Valid timeout values are 1 to 600 seconds. - */ -#define MSG_WAITACK 0x200 - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ From a81b7d777cf99f30270a3245338fd436807aa371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1085/3334] Revert "[nrf noup] board: nordic: thingy53: Enable default images for sysbuild" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 69261560e778e70cc8b22648b158a011a7d10c9d. Signed-off-by: Tomasz Moń --- boards/nordic/thingy53/Kconfig.sysbuild | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index c03d191b3708..2110f226e6b1 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -1,22 +1,5 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS - -choice BOOTLOADER - default BOOTLOADER_MCUBOOT -endchoice - -config SECURE_BOOT_NETCORE - default y - -config NETCORE_APP_UPDATE - default y if SECURE_BOOT_NETCORE - -config NRF_DEFAULT_EMPTY - default y if SECURE_BOOT_NETCORE - -endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS - config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY default y if BOOTLOADER_MCUBOOT From df223222b83d482b6d34c94b893cb79a35095af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1086/3334] Revert "[nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3d69ff980c3c97218595c492ebf13feb2e95b739. Signed-off-by: Tomasz Moń --- scripts/west_commands/build.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index a271e4075a5b..fb3894944cd8 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -642,12 +642,7 @@ def _run_cmake(self, board, origin, cmake_opts): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', None) - - if config_sysbuild is None: - # If no option is set, then enable sysbuild globally - config_sysbuild = True - + config_sysbuild = config_getboolean('sysbuild', False) if self.args.sysbuild or (config_sysbuild and not self.args.no_sysbuild): cmake_opts.extend([f'-S{SYSBUILD_PROJ_DIR}', f'-DAPP_DIR:PATH={self.source_dir}']) From 11ed4fd0f1da15cd1d375dcd3b7954ec82f60ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1087/3334] Revert "[nrf noup] boards: nordic: thingy53: Add sysbuild Kconfig file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ce294a1bceb8f3852fa64b16e425b71928710ce5. Signed-off-by: Tomasz Moń --- boards/nordic/thingy53/Kconfig.sysbuild | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 boards/nordic/thingy53/Kconfig.sysbuild diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild deleted file mode 100644 index 2110f226e6b1..000000000000 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOOTLOADER_MCUBOOT From 35d7773bcbde40f1f1462a4bde0a358b00cc0360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1088/3334] Revert "[nrf noup] samples: psa_crypto: Remove support for Nordic boards" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e3ec025a735de3f6fc67d84ce20168959cb6f3d1. Signed-off-by: Tomasz Moń --- samples/tfm_integration/psa_crypto/sample.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/tfm_integration/psa_crypto/sample.yaml b/samples/tfm_integration/psa_crypto/sample.yaml index 7d287985bf3c..ea9844730fc1 100644 --- a/samples/tfm_integration/psa_crypto/sample.yaml +++ b/samples/tfm_integration/psa_crypto/sample.yaml @@ -16,6 +16,8 @@ tests: platform_allow: - mps2/an521/cpu0/ns - v2m_musca_s1/musca_s1/ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns - stm32l562e_dk/stm32l562xx/ns - bl5340_dvk/nrf5340/cpuapp/ns - max32657evkit/max32657/ns From f08ca4cddd0b7377dad88ff31bb0171156aa5505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:39 +0100 Subject: [PATCH 1089/3334] Revert "[nrf noup] boards: thingy53_nrf5340: Enable MCUboot by default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 223923a02a5759befedc3f6442ebafd8b57d60d7. Signed-off-by: Tomasz Moń --- boards/nordic/thingy53/Kconfig.defconfig | 6 ------ boards/nordic/thingy53/thingy53_nrf5340_common.dtsi | 1 - 2 files changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index badcb5c20e5d..1aa0d7d082ec 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -8,12 +8,6 @@ config HW_STACK_PROTECTION if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS -config BOOTLOADER_MCUBOOT - default y if !MCUBOOT - -config BOARD_ENABLE_CPUNET - default y if !MCUBOOT - # Code Partition: # # For the secure version of the board the firmware is linked at the beginning diff --git a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi index c8042b284755..fabd5d177a99 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi +++ b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi @@ -13,7 +13,6 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; - nordic,pm-ext-flash = &mx25r64; }; buttons { From 3ef2fe9440a97f20fd269b5e91e7135fbe877204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1090/3334] Revert "[nrf noup] boards: arm: thingy53: Disable USB CDC added by MCUBoot" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7a668858c52a1bedd8b635105982b21c1c477ca6. Signed-off-by: Tomasz Moń --- boards/nordic/thingy53/Kconfig.defconfig | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 1aa0d7d082ec..c1139f0dca10 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -84,13 +84,6 @@ endif # !TRUSTED_EXECUTION_SECURE source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" -# By default, a USB CDC ACM instance is already enabled in the board's DTS. -# It is not necessary for nRF Connect SDK to add another instance if MCUBoot -# bootloader is built as a child image. -config MCUBOOT_USB_SUPPORT - bool - default n - endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From 812cdb29095cf915c6eb28d9c592fecf314b652d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1091/3334] Revert "[nrf noup] boards: thingy53_nrf5340: Add common partition map" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 01ff6eb18aee45d3d7857682f108f05cbab0afe4. Signed-off-by: Tomasz Moń --- .../pm_static_thingy53_nrf5340_cpuapp.yml | 55 -------------- .../pm_static_thingy53_nrf5340_cpuapp_ns.yml | 73 ------------------- 2 files changed, 128 deletions(-) delete mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml delete mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml deleted file mode 100644 index 7a48d51ec334..000000000000 --- a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml +++ /dev/null @@ -1,55 +0,0 @@ -app: - address: 0x10200 - region: flash_primary - size: 0xdfe00 -mcuboot: - address: 0x0 - region: flash_primary - size: 0x10000 -mcuboot_pad: - address: 0x10000 - region: flash_primary - size: 0x200 -mcuboot_primary: - address: 0x10000 - orig_span: &id001 - - mcuboot_pad - - app - region: flash_primary - size: 0xe0000 - span: *id001 -mcuboot_primary_app: - address: 0x10200 - orig_span: &id002 - - app - region: flash_primary - size: 0xdfe00 - span: *id002 -settings_storage: - address: 0xf0000 - region: flash_primary - size: 0x10000 -mcuboot_primary_1: - address: 0x0 - size: 0x40000 - device: flash_ctrl - region: ram_flash -mcuboot_secondary: - address: 0x00000 - size: 0xe0000 - device: MX25R64 - region: external_flash -mcuboot_secondary_1: - address: 0xe0000 - size: 0x40000 - device: MX25R64 - region: external_flash -external_flash: - address: 0x120000 - size: 0x6e0000 - device: MX25R64 - region: external_flash -pcd_sram: - address: 0x20000000 - size: 0x2000 - region: sram_primary diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml deleted file mode 100644 index 70ffe6d9c124..000000000000 --- a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml +++ /dev/null @@ -1,73 +0,0 @@ -mcuboot: - address: 0x0 - region: flash_primary - size: 0x10000 -mcuboot_pad: - address: 0x10000 - region: flash_primary - size: 0x200 -tfm_secure: - address: 0x10000 - size: 0xc000 - span: [mcuboot_pad, tfm] -tfm_nonsecure: - address: 0x1c000 - size: 0xd4000 - span: [app] -tfm: - address: 0x10200 - region: flash_primary - size: 0xbe00 -app: - address: 0x1c000 - region: flash_primary - size: 0xd4000 -mcuboot_primary: - address: 0x10000 - orig_span: &id001 - - mcuboot_pad - - tfm - - app - region: flash_primary - size: 0xe0000 - span: *id001 -mcuboot_primary_app: - address: 0x10200 - orig_span: &id002 - - tfm - - app - region: flash_primary - size: 0xdfe00 - span: *id002 -nonsecure_storage: - address: 0xf0000 - size: 0x10000 - span: [settings_storage] -settings_storage: - address: 0xf0000 - region: flash_primary - size: 0x10000 -mcuboot_primary_1: - address: 0x0 - size: 0x40000 - device: flash_ctrl - region: ram_flash -mcuboot_secondary: - address: 0x00000 - size: 0xe0000 - device: MX25R64 - region: external_flash -mcuboot_secondary_1: - address: 0xe0000 - size: 0x40000 - device: MX25R64 - region: external_flash -external_flash: - address: 0x120000 - size: 0x6e0000 - device: MX25R64 - region: external_flash -pcd_sram: - address: 0x20000000 - size: 0x2000 - region: sram_primary From 74fb33483e96a3e22381fecdd0b9457c56156440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1092/3334] Revert "[nrf noup] soc: arm: nRF91: Add SPU Flash/RAM alignment" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dcb4dc934d2171922c14d1c6417744c494baf297. Signed-off-by: Tomasz Moń --- soc/nordic/nrf53/Kconfig | 22 ++++++++-------------- soc/nordic/nrf91/Kconfig | 20 -------------------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 6e53dc277c65..e326322044ad 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -167,15 +167,12 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_TRUSTZONE_FLASH_REGION_SIZE +config NRF_SPU_FLASH_REGION_ALIGNMENT hex - default NRF_SPU_FLASH_REGION_SIZE + default 0x4000 help - Define the flash region size from a TrustZone perspective. - This is used when we set the security attributes(S/NSC/NS) of a region - in TrustZone enabled devices. - In practice this option defines the granularity of the security attributes, - i.e. the smallest region that can be set to secure or non-secure. + FLASH regions must be aligned to this value due to SPU HW + limitations. config NRF_SPU_RAM_REGION_SIZE hex @@ -183,15 +180,12 @@ config NRF_SPU_RAM_REGION_SIZE help RAM region size for the NRF_SPU peripheral -config NRF_TRUSTZONE_RAM_REGION_SIZE +config NRF_SPU_RAM_REGION_ALIGNMENT hex - default NRF_SPU_RAM_REGION_SIZE + default 0x2000 help - Define the RAM region size from a TrustZone perspective. - This is used when we set the security attributes(S/NSC/NS) of a region - in TrustZone enabled devices. - In practice this option defines the granularity of the security attributes, - i.e. the smallest region that can be set to secure or non-secure. + RAM regions must be aligned to this value due to SPU HW + limitations. config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" diff --git a/soc/nordic/nrf91/Kconfig b/soc/nordic/nrf91/Kconfig index 9f55cdd77ed9..ed38eff73a2d 100644 --- a/soc/nordic/nrf91/Kconfig +++ b/soc/nordic/nrf91/Kconfig @@ -24,16 +24,6 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default NRF_SPU_FLASH_REGION_SIZE - help - Define the flash region size from a TrustZone perspective. - This is used when we set the security attributes(S/NSC/NS) of a region - in TrustZone enabled devices. - In practice this option defines the granularity of the security attributes, - i.e. the smallest region that can be set to secure or non-secure. - config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 @@ -44,14 +34,4 @@ config NRF_ENABLE_ICACHE bool "Instruction cache (I-Cache)" default y -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default NRF_SPU_RAM_REGION_SIZE - help - Define the RAM region size from a TrustZone perspective. - This is used when we set the security attributes(S/NSC/NS) of a region - in TrustZone enabled devices. - In practice this option defines the granularity of the security attributes, - i.e. the smallest region that can be set to secure or non-secure. - endif # SOC_SERIES_NRF91X From d5d0a51346b4ba33da58c2c1de0599ca71016c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1093/3334] Revert "[nrf noup] soc: arm: nRF53: Add SPU Flash/RAM alignment" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1fc5b04e051f1702c7138cbe9739d86de08d9748. Signed-off-by: Tomasz Moń --- soc/nordic/nrf53/Kconfig | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index e326322044ad..7260d5c7d66d 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -167,26 +167,12 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_SPU_FLASH_REGION_ALIGNMENT - hex - default 0x4000 - help - FLASH regions must be aligned to this value due to SPU HW - limitations. - config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 help RAM region size for the NRF_SPU peripheral -config NRF_SPU_RAM_REGION_ALIGNMENT - hex - default 0x2000 - help - RAM regions must be aligned to this value due to SPU HW - limitations. - config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" depends on NRF_SOC_SECURE_SUPPORTED From 453856f95f0c41c6149039307b120a79a679c78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1094/3334] Revert "[nrf noup] net: mqtt: add native TLS support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bc094738b4385dca505a5afe63d8152c348dd029. Signed-off-by: Tomasz Moń --- doc/connectivity/networking/api/mqtt.rst | 3 --- include/zephyr/net/mqtt.h | 3 --- subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 7 +------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/doc/connectivity/networking/api/mqtt.rst b/doc/connectivity/networking/api/mqtt.rst index c2fb612e1cc2..2775d77315b8 100644 --- a/doc/connectivity/networking/api/mqtt.rst +++ b/doc/connectivity/networking/api/mqtt.rst @@ -150,7 +150,6 @@ additional configuration information: tls_config->sec_tag_list = m_sec_tags; tls_config->sec_tag_count = ARRAY_SIZE(m_sec_tags); tls_config->hostname = MQTT_BROKER_HOSTNAME; - tls_config->set_native_tls = true; In this sample code, the ``m_sec_tags`` array holds a list of tags, referencing TLS credentials that the MQTT library should use for authentication. We do not specify @@ -163,8 +162,6 @@ Note, that TLS credentials referenced by the ``m_sec_tags`` array must be registered in the system first. For more information on how to do that, refer to :ref:`secure sockets documentation `. -Finally, ``set_native_tls`` can be optionally set to enable native TLS support instead of offloading TLS operations to the modem. - An example of how to use TLS with MQTT is also present in :zephyr:code-sample:`mqtt-publisher` sample application. diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index 797f8f339d7f..d63cc1316249 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -773,9 +773,6 @@ struct mqtt_sec_config { /** Indicates the preference for copying certificates to the heap. */ int cert_nocopy; - - /** Set socket to native TLS */ - bool set_native_tls; }; /** @brief MQTT transport type. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 617dec4b4d26..68a101e6c846 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -22,15 +22,10 @@ int mqtt_client_tls_connect(struct mqtt_client *client) { const struct sockaddr *broker = client->broker; struct mqtt_sec_config *tls_config = &client->transport.tls.config; - int type = SOCK_STREAM; int ret; - if (tls_config->set_native_tls) { - type |= SOCK_NATIVE_TLS; - } - client->transport.tls.sock = zsock_socket(broker->sa_family, - type, IPPROTO_TLS_1_2); + SOCK_STREAM, IPPROTO_TLS_1_2); if (client->transport.tls.sock < 0) { return -errno; } From ad223b9443d36a3028dd6f87cb2904361ceda11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1095/3334] Revert "[nrf noup] net: mqtt: Provide option to enable TLS session caching" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d593127ffbd013894b1d5afc89bdb7f7fd9a2c07. Signed-off-by: Tomasz Moń --- include/zephyr/net/mqtt.h | 3 --- subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index d63cc1316249..b992714afd32 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -763,9 +763,6 @@ struct mqtt_sec_config { uint32_t alpn_protocol_name_count; #endif - /** Indicates the preference for enabling TLS session caching. */ - int session_cache; - /** Peer hostname for ceritificate verification. * May be NULL to skip hostname verification. */ diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 68a101e6c846..2ff337eef343 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -109,16 +109,6 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } - if (tls_config->session_cache == TLS_SESSION_CACHE_ENABLED) { - ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, - TLS_SESSION_CACHE, - &tls_config->session_cache, - sizeof(tls_config->session_cache)); - if (ret < 0) { - goto error; - } - } - if (tls_config->cert_nocopy != TLS_CERT_NOCOPY_NONE) { ret = zsock_setsockopt(client->transport.tls.sock, SOL_TLS, TLS_CERT_NOCOPY, &tls_config->cert_nocopy, From 4734c9f352597eb93b556c1c185527552d85795c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1096/3334] Revert "[nrf noup] test: schedule_api: Use Minimal C library" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 42834a97d953e02dbd4c87b89d55138499c0d415. Signed-off-by: Tomasz Moń --- tests/kernel/pipe/deprecated/pipe_api/prj.conf | 9 --------- tests/kernel/sched/schedule_api/prj.conf | 1 - tests/kernel/sched/schedule_api/prj_multiq.conf | 1 - 3 files changed, 11 deletions(-) delete mode 100644 tests/kernel/pipe/deprecated/pipe_api/prj.conf diff --git a/tests/kernel/pipe/deprecated/pipe_api/prj.conf b/tests/kernel/pipe/deprecated/pipe_api/prj.conf deleted file mode 100644 index df3270adfdf8..000000000000 --- a/tests/kernel/pipe/deprecated/pipe_api/prj.conf +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG_ZTEST=y -CONFIG_IRQ_OFFLOAD=y -CONFIG_TEST_USERSPACE=y -CONFIG_DYNAMIC_OBJECTS=y -CONFIG_MP_MAX_NUM_CPUS=1 -CONFIG_ZTEST_FATAL_HOOK=y -CONFIG_PIPES=y -CONFIG_DEPRECATION_TEST=y -CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj.conf b/tests/kernel/sched/schedule_api/prj.conf index 8b649a3b7fca..a5ceef694331 100644 --- a/tests/kernel/sched/schedule_api/prj.conf +++ b/tests/kernel/sched/schedule_api/prj.conf @@ -7,4 +7,3 @@ CONFIG_MAX_THREAD_BYTES=6 CONFIG_TEST_USERSPACE=y CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y -CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index 84c9d80ac619..c8dd4bf786bc 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -7,4 +7,3 @@ CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y CONFIG_NUM_COOP_PRIORITIES=30 CONFIG_NUM_PREEMPT_PRIORITIES=40 -CONFIG_MINIMAL_LIBC=y From 52f7221066eb9450fe88e1111334ff51dd61c272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1097/3334] Revert "[nrf noup] modules: mbedtls: Use help for DISABLE_MBEDTLS_BUILTIN info" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5992ed018de716e4d2fb868c58901534a888802b. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index aa8c479e89f7..f7bc6a609f1f 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -43,11 +43,10 @@ config MBEDTLS_LIBRARY endchoice +# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select +# DISABLE_MBEDTLS_BUILTIN. config DISABLE_MBEDTLS_BUILTIN bool - help - Subsystems cannot deselect MBEDTLS_BUILTIN, but they can select - DISABLE_MBEDTLS_BUILTIN. config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" From 78de8224bb8297fd41010bca90a80ce45ea65fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1098/3334] Revert "[nrf noup] dfu/boot/mcuboot: fix confirmation in case of USE_PARTITION_MANAGER" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aef36004d5a7bb90f0860caebe4d2b498c829950. Signed-off-by: Tomasz Moń --- subsys/dfu/boot/mcuboot.c | 47 ++------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/subsys/dfu/boot/mcuboot.c b/subsys/dfu/boot/mcuboot.c index 70c746cf7ce1..ad8ade044d41 100644 --- a/subsys/dfu/boot/mcuboot.c +++ b/subsys/dfu/boot/mcuboot.c @@ -58,49 +58,8 @@ enum IMAGE_INDEXES { IMAGE_INDEX_2 }; -#if USE_PARTITION_MANAGER -#include - -#if CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 -/* Sysbuild */ -#ifdef CONFIG_MCUBOOT -/* lib is part of MCUboot -> operate on the primary application slot */ -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#else -/* TODO: Add firmware loader support */ -/* lib is part of the app -> operate on active slot */ -#if defined(CONFIG_NCS_IS_VARIANT_IMAGE) -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID -#else -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#endif -#endif /* CONFIG_MCUBOOT */ -#else -/* Legacy child/parent */ -#if CONFIG_BUILD_WITH_TFM - #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) -#else - #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) -#endif - -#ifdef CONFIG_MCUBOOT - /* lib is part of MCUboot -> operate on the primary application slot */ - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#else - /* lib is part of the App -> operate on active slot */ -#if (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_PRIMARY_ADDRESS - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#elif (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_SECONDARY_ADDRESS - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID -#else - #error Missing partition definitions. -#endif -#endif /* CONFIG_MCUBOOT */ -#endif /* CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 */ - -#else - -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) +#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \ + defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) /* For RAM LOAD mode, the active image must be fetched from the bootloader */ #define ACTIVE_SLOT_FLASH_AREA_ID boot_fetch_active_slot() #define INVALID_SLOT_ID 255 @@ -109,8 +68,6 @@ enum IMAGE_INDEXES { #define ACTIVE_SLOT_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_code_partition)) #endif -#endif /* USE_PARTITION_MANAGER */ - /* * Raw (on-flash) representation of the v1 image header. */ From d1fcb47f0ae46a41f0cc93155504db9972679714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1099/3334] Revert "[nrf noup] Bluetooth: Mesh: Fix adv randomness bug" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 61a77f407e84b60ce59c46ea0bf77ceda8bfa977. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/adv_ext.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 68a6c27beebf..2382b01bd182 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -578,10 +578,8 @@ int bt_mesh_adv_enable(void) return err; } - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && - IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_FRIEND_SEPARATE) && - advs[i].tags == BT_MESH_ADV_TAG_BIT_FRIEND) { - err = set_adv_randomness(advs[i].instance->handle, 0); + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { + err = set_adv_randomness(adv->instance->handle, 0); if (err) { LOG_ERR("Failed to set zero randomness: %d", err); } From 28d8aa1d23ecd481de40859d5ab17b71d4906a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1100/3334] Revert "[nrf noup] Bluetooth: Mesh: zero randomization for friend's adv" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b106f44581674207cdc1c3352f04658ec6756199. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/Kconfig | 2 +- subsys/bluetooth/mesh/adv_ext.c | 32 -------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 351b18b88e9a..87382d67025b 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1710,7 +1710,7 @@ config BT_MESH_LPN_INIT_POLL_TIMEOUT config BT_MESH_LPN_SCAN_LATENCY int "Latency for enabling scanning" range 0 50 - default 2 + default 15 help Latency in milliseconds that it takes to enable scanning. This is in practice how much time in advance before the Receive Window diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 2382b01bd182..0ff0bc5e9fe7 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -13,9 +13,6 @@ #include #include #include -#if defined(CONFIG_BT_LL_SOFTDEVICE) -#include -#endif #include "common/bt_str.h" @@ -152,28 +149,6 @@ static inline struct bt_mesh_ext_adv *gatt_adv_get(void) } } -static int set_adv_randomness(uint8_t handle, int rand_us) -{ -#if defined(CONFIG_BT_LL_SOFTDEVICE) - struct net_buf *buf; - sdc_hci_cmd_vs_set_adv_randomness_t *cmd_params; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - LOG_ERR("Could not allocate command buffer"); - return -ENOMEM; - } - - cmd_params = net_buf_add(buf, sizeof(*cmd_params)); - cmd_params->adv_handle = handle; - cmd_params->rand_us = rand_us; - - return bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_SET_ADV_RANDOMNESS, buf, NULL); -#else - return 0; -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ -} - static int adv_start(struct bt_mesh_ext_adv *ext_adv, const struct bt_le_adv_param *param, struct bt_le_ext_adv_start_param *start, @@ -577,13 +552,6 @@ int bt_mesh_adv_enable(void) if (err) { return err; } - - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { - err = set_adv_randomness(adv->instance->handle, 0); - if (err) { - LOG_ERR("Failed to set zero randomness: %d", err); - } - } } return 0; From 9e5b701de827facbf54433890b9bba2e61829077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1101/3334] Revert "[nrf noup] modules: tfm: Add Kconfig for CRYPTO_PAKE_MODULE_ENABLED" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 99f08ef8acdcea41299f1b91a6bb9221c1427a47. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 9604319ca012..02d3580c22f3 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -88,17 +88,6 @@ config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED is not used. Note that key agreement is under key derivation in the current implementation. -config TFM_CRYPTO_PAKE_MODULE_ENABLED - bool "PAKE crypto module" - default y - depends on PSA_HAS_PAKE_SUPPORT - depends on NRF_SECURITY - depends on PSA_CRYPTO_DRIVER_OBERON || PSA_CRYPTO_DRIVER_CRACEN - help - Enables the PAKE crypto module within the crypto partition. - Unset this option if the functionality provided by 'crypto_pake.c' - is not used. - endif # TFM_PARTITION_CRYPTO endif # BUILD_WITH_TFM From 48184c47081c563861ab1471abda91346da21bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1102/3334] Revert "[nrf noup] samples/tests: Disable PM for some sysbuild builds" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e99379d6a289797fe4361658f4a04e44b651d705. Signed-off-by: Tomasz Moń --- samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf | 1 - samples/drivers/mbox/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf | 1 - samples/subsys/logging/multidomain/sysbuild.conf | 1 - tests/boot/mcuboot_recovery_retention/sysbuild.conf | 1 - tests/boot/test_mcuboot/sysbuild.conf | 1 - tests/drivers/flash/common/sysbuild.conf | 1 - tests/drivers/flash/negative_tests/sysbuild.conf | 1 - tests/subsys/fs/fcb/sysbuild.conf | 1 - tests/subsys/fs/littlefs/sysbuild.conf | 1 - 12 files changed, 12 deletions(-) delete mode 100644 samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf delete mode 100644 samples/drivers/mbox/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf delete mode 100644 samples/subsys/logging/multidomain/sysbuild.conf delete mode 100644 tests/drivers/flash/common/sysbuild.conf delete mode 100644 tests/drivers/flash/negative_tests/sysbuild.conf delete mode 100644 tests/subsys/fs/fcb/sysbuild.conf delete mode 100644 tests/subsys/fs/littlefs/sysbuild.conf diff --git a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/drivers/mbox/sysbuild.conf b/samples/drivers/mbox/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/drivers/mbox/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/logging/multidomain/sysbuild.conf b/samples/subsys/logging/multidomain/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/subsys/logging/multidomain/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/mcuboot_recovery_retention/sysbuild.conf b/tests/boot/mcuboot_recovery_retention/sysbuild.conf index 3b5b3c963800..47f00ff3cff8 100644 --- a/tests/boot/mcuboot_recovery_retention/sysbuild.conf +++ b/tests/boot/mcuboot_recovery_retention/sysbuild.conf @@ -1,2 +1 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/test_mcuboot/sysbuild.conf b/tests/boot/test_mcuboot/sysbuild.conf index 3b5b3c963800..47f00ff3cff8 100644 --- a/tests/boot/test_mcuboot/sysbuild.conf +++ b/tests/boot/test_mcuboot/sysbuild.conf @@ -1,2 +1 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/drivers/flash/common/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/negative_tests/sysbuild.conf b/tests/drivers/flash/negative_tests/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/drivers/flash/negative_tests/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/fcb/sysbuild.conf b/tests/subsys/fs/fcb/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/subsys/fs/fcb/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/littlefs/sysbuild.conf b/tests/subsys/fs/littlefs/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/subsys/fs/littlefs/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n From b3b361a1bbc0d94610b7a33f06f4bb9b55329887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1103/3334] Revert "[nrf noup] samples&tests: Restore a few CONFIG_NEWLIB_LIBC_NANO=n" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9785674003ca9f90958e8895b5f9e70c21a6ec8f. Signed-off-by: Tomasz Moń --- tests/lib/newlib/heap_listener/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/lib/newlib/heap_listener/prj.conf b/tests/lib/newlib/heap_listener/prj.conf index 7282777ff1ca..e5a5dc6df4c1 100644 --- a/tests/lib/newlib/heap_listener/prj.conf +++ b/tests/lib/newlib/heap_listener/prj.conf @@ -1,4 +1,3 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y From 5ff9659748884214b67fa7b13009985127851bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:40 +0100 Subject: [PATCH 1104/3334] Revert "[nrf noup] samples: mgmt: mcumgr smp_svr: Migrate child image config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b110ac811ea2cf695a72431aa14f8010f7fcf0c6. Signed-off-by: Tomasz Moń --- .../subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf deleted file mode 100644 index 98260877332f..000000000000 --- a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor -# -# SPDX-License-Identifier: Apache-2.0 -# - -CONFIG_BT_MAX_CONN=2 -CONFIG_BT_BUF_ACL_RX_SIZE=502 -CONFIG_BT_BUF_ACL_TX_SIZE=502 -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 From 190a48cef8add2a776404da530e08a9f1db47fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1105/3334] Revert "[nrf noup] samples: bluetooth: hci_pow_ctrl: Migrate child image config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2919de8fa0bfd33d74b6e8ec762aa0f43055a8dc. Signed-off-by: Tomasz Moń --- samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf | 1 - 1 file changed, 1 deletion(-) delete mode 100644 samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf deleted file mode 100644 index e6749ae63990..000000000000 --- a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From ac3db7b2b3227d22eb8cbba632cace167ad546b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1106/3334] Revert "[nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ad57346bf7605728baf1c05c0f4525e43c81cc4f. Signed-off-by: Tomasz Moń --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 ----- subsys/mgmt/mcumgr/Kconfig | 1 - .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 35 ------------------- 3 files changed, 44 deletions(-) delete mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index ad088eca0677..39d4a4ca8ce0 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -16,11 +16,3 @@ add_subdirectory(transport) add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) - -if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) -endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 1c6a3a2a5162..49bd17f46691 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,6 @@ menuconfig MCUMGR bool "mcumgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the mcumgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c deleted file mode 100644 index f1ac8a168e65..000000000000 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include "bootutil/bootutil_public.h" - -#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 -/* Sysbuild */ -#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER -#else -/* Legacy child/parent */ -#define NET_CORE_IMAGE 1 -#endif - -int boot_read_swap_state_primary_slot_hook(int image_index, - struct boot_swap_state *state) -{ - if (image_index == NET_CORE_IMAGE) { - /* Pretend that primary slot of image 1 unpopulated */ - state->magic = BOOT_MAGIC_UNSET; - state->swap_type = BOOT_SWAP_TYPE_NONE; - state->image_num = image_index; - state->copy_done = BOOT_FLAG_UNSET; - state->image_ok = BOOT_FLAG_UNSET; - - /* Prevent bootutil from trying to obtain true info */ - return 0; - } - - return BOOT_HOOK_REGULAR; -} From 03c935a8eb2a0d81c1e10054107d516d82360d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1107/3334] Revert "[nrf noup] drivers/flashdisk: Add support for Partition Manager" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 80eff8d743a831977cb4caab3a07b288362618a0. Signed-off-by: Tomasz Moń --- drivers/disk/flashdisk.c | 78 ---------------------------------------- 1 file changed, 78 deletions(-) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index a2bb7d010365..37606f541390 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -469,8 +469,6 @@ static const struct disk_operations flash_disk_ops = { .ioctl = disk_flash_access_ioctl, }; -#ifndef USE_PARTITION_MANAGER -/* The non-Partition manager, DTS based generators below */ #define DT_DRV_COMPAT zephyr_flash_disk #define PARTITION_PHANDLE(n) DT_PHANDLE_BY_IDX(DT_DRV_INST(n), partition, 0) @@ -512,82 +510,6 @@ DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) "Devicetree node " DT_NODE_PATH(DT_DRV_INST(n)) \ " has cache size which is not a multiple of its sector size"); DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) -#else /* ifndef USE_PARTITION_MANAGER */ -/* Partition Manager based generators below */ - -/* Gets the PM_..._EXTRA_PARAM_##param value */ -#define PM_FLASH_DISK_ENTRY_EXTRA_PARAM(name, param) PM_##name##_EXTRA_PARAM_disk_##param - -/* Gets the PM_..._NAME value which is originally cased, as in yaml, partition name */ -#define PM_FLASH_DISK_ENTRY_PARTITION_NAME(name) PM_##name##_NAME - -/* Generates flashdiskN_cache variable name, where N is partition ID */ -#define PM_FLASH_DISK_CACHE_VARIABLE(n) UTIL_CAT(flashdisk, UTIL_CAT(FIXED_PARTITION_ID(n), _cache)) - -/* Generate cache buffers */ -#define CACHE_SIZE(n) (COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), (0), (1)) * \ - PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size)) -#define DEFINE_FLASHDISKS_CACHE(n) \ - static uint8_t __aligned(4) PM_FLASH_DISK_CACHE_VARIABLE(n)[CACHE_SIZE(n)]; - -PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) - -/* Generated single Flash Disk device data from Partition Manager partition. - * Partition is required to have type set to disk in partition definitions: - * type: disk - * and following extra params can be provided: - * extra_params: { - * name = "", - * cache_size = , - * sector_size = , - * read_only = - * } - * where: - * is mandatory device name that will be used by Disk Access and FAT FS to mount device; - * is cache r/w cache size, which is mandatory if read_only = 0 or not present, - * and should be multiple of ; - * is mandatory device sector size information, usually should be erase page size, - * for flash devices, for example 4096 bytes; - * read_only is optional, if not present then assumed false; can be 0(false) or 1(true). - */ -#define DEFINE_FLASHDISKS_DEVICE(n) \ -{ \ - .info = { \ - .ops = &flash_disk_ops, \ - .name = STRINGIFY(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, name)), \ - }, \ - .area_id = FIXED_PARTITION_ID(n), \ - .offset = FIXED_PARTITION_OFFSET(n), \ - .cache = PM_FLASH_DISK_CACHE_VARIABLE(n), \ - .cache_size = sizeof(PM_FLASH_DISK_CACHE_VARIABLE(n)), \ - .size = FIXED_PARTITION_SIZE(n), \ - .sector_size = PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size), \ -}, - -/* The bellow used PM_FOREACH_TYPE_disk is generated by Partition Manager foreach - * loop macro. The lower case _disk is type name for which the macro has been generated; - * partition entry can have multiple types set and foreach macro will be generated - * for every type found across partition definitions. - */ -static struct flashdisk_data flash_disks[] = { - PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE) -}; - -#define VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY(n) \ - COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), \ - (/* cache-size is not used for read-only disks */), \ - (BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) != 0, \ - "Flash disk partition " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n))\ - " must have non-zero cache-size");)) -PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) - -#define VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE(n) \ - BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) % \ - PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size) == 0, \ - "Devicetree node " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n)) \ - " has cache size which is not a multiple of its sector size"); -PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) -#endif /* USE_PARTITION_MANAGER */ static int disk_flash_init(void) { From ff809cdb9209784caf560685cf9749e7a01cfcb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1108/3334] Revert "[nrf noup] modules: mbedtls: Add include folders" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bec38cb4ce8470154d09ad6fb7cac72b7ae4ca3a. Signed-off-by: Tomasz Moń --- modules/mbedtls/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index 7e16f0de2514..83a8cb674a5e 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -40,8 +40,6 @@ zephyr_interface_library_named(mbedTLS) # Add regular includes target_include_directories(mbedTLS INTERFACE ${ZEPHYR_CURRENT_MODULE_DIR}/include - ${ZEPHYR_CURRENT_MODULE_DIR}/include/library - ${ZEPHYR_CURRENT_MODULE_DIR}/library configs include ) From 1658c34e5a554c49e05e3bacf05962bcbfd90065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1109/3334] Revert "[nrf noup] modules: mbedtls: Allow MBEDTLS_BUILTIN to be deselected" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2416c4da0bcb676c42c42d68030a394a79ca1cbe. Signed-off-by: Tomasz Moń --- modules/mbedtls/Kconfig | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index f7bc6a609f1f..bf165473f17f 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -29,7 +29,6 @@ choice MBEDTLS_IMPLEMENTATION config MBEDTLS_BUILTIN bool "Use Zephyr in-tree mbedTLS version" - depends on ! DISABLE_MBEDTLS_BUILTIN help Link with mbedTLS sources included with Zephyr distribution. Included mbedTLS version is well integrated with and supported @@ -43,11 +42,6 @@ config MBEDTLS_LIBRARY endchoice -# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select -# DISABLE_MBEDTLS_BUILTIN. -config DISABLE_MBEDTLS_BUILTIN - bool - config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" help From 88ce6a74458933b3beecbd68d93c57ac58aa6fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1110/3334] Revert "[nrf noup] modules: tf-m: use of PSA_HAS_XXXX_SUPPORT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8dafdf6cf30f17668414d98af39a882cb5b36c3e. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 02d3580c22f3..1d70a2c44d29 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -10,7 +10,6 @@ if TFM_PARTITION_CRYPTO config TFM_CRYPTO_RNG_MODULE_ENABLED bool "Random number generator crypto module" default y - depends on PSA_WANT_GENERATE_RANDOM && NRF_SECURITY help Enables the random number generator module within the crypto partition. Unset this option if 'psa_generate_random' is not used. @@ -18,7 +17,6 @@ config TFM_CRYPTO_RNG_MODULE_ENABLED config TFM_CRYPTO_KEY_MODULE_ENABLED bool "KEY crypto module" default y - depends on PSA_HAS_KEY_SUPPORT && NRF_SECURITY help Enables the KEY crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_management.c' @@ -27,7 +25,6 @@ config TFM_CRYPTO_KEY_MODULE_ENABLED config TFM_CRYPTO_AEAD_MODULE_ENABLED bool "AEAD crypto module" default y - depends on PSA_HAS_AEAD_SUPPORT && NRF_SECURITY help Enables the AEAD crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_aead.c' @@ -36,7 +33,6 @@ config TFM_CRYPTO_AEAD_MODULE_ENABLED config TFM_CRYPTO_MAC_MODULE_ENABLED bool "MAC crypto module" default y - depends on PSA_HAS_MAC_SUPPORT && NRF_SECURITY help Enables the MAC crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_mac.c' @@ -45,7 +41,6 @@ config TFM_CRYPTO_MAC_MODULE_ENABLED config TFM_CRYPTO_HASH_MODULE_ENABLED bool "HASH crypto module" default y - depends on PSA_HAS_HASH_SUPPORT && NRF_SECURITY help Enables the HASH crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_hash.c' @@ -54,7 +49,6 @@ config TFM_CRYPTO_HASH_MODULE_ENABLED config TFM_CRYPTO_CIPHER_MODULE_ENABLED bool "CIPHER crypto module" default y - depends on PSA_HAS_CIPHER_SUPPORT && NRF_SECURITY help Enables the CIPHER crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_cipher.c' @@ -63,7 +57,6 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED bool "ASYM ENCRYPT crypto module" default y - depends on PSA_HAS_ASYM_ENCRYPT_SUPPORT && NRF_SECURITY help Enables the ASYM ENCRYPT crypto module within the crypto partition. Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' @@ -72,7 +65,6 @@ config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED bool "ASYM SIGN crypto module" default y - depends on PSA_HAS_ASYM_SIGN_SUPPORT && NRF_SECURITY help Enables the ASYM SIGN crypto module within the crypto partition. Unset this option if the sign functionality provided by 'crypto_asymmetric.c' @@ -81,12 +73,10 @@ config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED bool "KEY DERIVATION crypto module" default y - depends on (PSA_HAS_KEY_DERIVATION || PSA_HAS_KEY_AGREEMENT) && NRF_SECURITY help Enables the KEY_DERIVATION crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_derivation.c' is not used. - Note that key agreement is under key derivation in the current implementation. endif # TFM_PARTITION_CRYPTO From 824205ced74a7e4f26042ac52941f1141ca18b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1111/3334] Revert "[nrf noup] doc: remove Kconfig search" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ae54dd0dd72cb3887de9542242c78eb8706848d5. Signed-off-by: Tomasz Moń --- MAINTAINERS.yml | 1 + doc/build/kconfig/setting.rst | 6 ++++-- doc/develop/application/index.rst | 5 +++-- doc/kconfig.rst | 8 ++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 doc/kconfig.rst diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index aa0718740df8..0160330ac59f 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1147,6 +1147,7 @@ Documentation: - doc/images/Zephyr-Kite-in-tree.png - doc/index-tex.rst - doc/index.rst + - doc/kconfig.rst - doc/templates/sample.tmpl - doc/templates/board.tmpl - boards/index.rst diff --git a/doc/build/kconfig/setting.rst b/doc/build/kconfig/setting.rst index 6fe1feaed7d3..ad62d86eb3d4 100644 --- a/doc/build/kconfig/setting.rst +++ b/doc/build/kconfig/setting.rst @@ -7,7 +7,8 @@ The :ref:`menuconfig and guiconfig interfaces ` can be used to test out configurations during application development. This page explains how to make settings permanent. -All Kconfig options can be searched in the Kconfig search page. +All Kconfig options can be searched in the :ref:`Kconfig search page +`. .. note:: @@ -114,7 +115,8 @@ Assignments in configuration files are only respected if the dependencies for the symbol are satisfied. A warning is printed otherwise. To figure out what the dependencies of a symbol are, use one of the :ref:`interactive configuration interfaces ` (you can jump directly to a symbol with -:kbd:`/`), or look up the symbol in the Kconfig search page. +:kbd:`/`), or look up the symbol in the :ref:`Kconfig search page +`. .. _initial-conf: diff --git a/doc/develop/application/index.rst b/doc/develop/application/index.rst index 4f8b5f868a56..c28fa011f3cc 100644 --- a/doc/develop/application/index.rst +++ b/doc/develop/application/index.rst @@ -649,8 +649,9 @@ started. See :ref:`setting_configuration_values` for detailed documentation on setting Kconfig configuration values. The :ref:`initial-conf` section on the same page -explains how the initial configuration is derived. See :ref:`hardening` for -security information related with Kconfig options. +explains how the initial configuration is derived. See :ref:`kconfig-search` +for a complete list of configuration options. +See :ref:`hardening` for security information related with Kconfig options. The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration diff --git a/doc/kconfig.rst b/doc/kconfig.rst new file mode 100644 index 000000000000..1123de2adbd9 --- /dev/null +++ b/doc/kconfig.rst @@ -0,0 +1,8 @@ +:orphan: + +.. _kconfig-search: + +Kconfig Search +============== + +.. kconfig:search:: From 6677762feff130640d709f781738197e5f201d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1112/3334] Revert "[nrf noup] Revert "twister: Use natural sort when generating hardware map"" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6fde6cdb57c8db387e3277d2dcd69c59ee576615. Signed-off-by: Tomasz Moń --- scripts/pylib/twister/twisterlib/hardwaremap.py | 2 +- scripts/requirements-run-test.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 6deca0ac4adf..74c384ab5d6e 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -386,7 +386,7 @@ def save(self, hwm_file): boot_ids = [] # use existing map - self.detected.sort(key=lambda x: x.serial or '') + self.detected = natsorted(self.detected, key=lambda x: x.serial or '') if os.path.exists(hwm_file): with open(hwm_file) as yaml_file: hwm = yaml.load(yaml_file, Loader=SafeLoader) diff --git a/scripts/requirements-run-test.txt b/scripts/requirements-run-test.txt index 4faa17b7b659..6c3f3d93cf8d 100644 --- a/scripts/requirements-run-test.txt +++ b/scripts/requirements-run-test.txt @@ -7,6 +7,7 @@ pyocd>=0.35.0 # used by twister for board/hardware map tabulate +natsort # used by mcuboot cbor>=1.0.0 From d03745655a2fe3a281b237a5c74a92009f41861b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1113/3334] Revert "[nrf noup] tests: drivers: build_all: regulator: use old schema" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e410638df3689a6362551472fbd776bf754af33f. Signed-off-by: Tomasz Moń --- tests/drivers/build_all/regulator/testcase.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/drivers/build_all/regulator/testcase.yaml b/tests/drivers/build_all/regulator/testcase.yaml index b662f0ac2050..30d494aca231 100644 --- a/tests/drivers/build_all/regulator/testcase.yaml +++ b/tests/drivers/build_all/regulator/testcase.yaml @@ -3,7 +3,9 @@ tests: drivers.regulator.build: - tags: drivers regulator + tags: + - drivers + - regulator build_only: true platform_allow: - native_sim From 65a0d845e174757febbc28ab79ea6c6a0d21756b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1114/3334] Revert "[nrf noup] ci: add .github/test-spec.yml" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2572bde23c16a9dd0eede529c6e24226d8930d9f. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 392 ------------------------------------------ 1 file changed, 392 deletions(-) delete mode 100644 .github/test-spec.yml diff --git a/.github/test-spec.yml b/.github/test-spec.yml deleted file mode 100644 index 6da6bdbaa87d..000000000000 --- a/.github/test-spec.yml +++ /dev/null @@ -1,392 +0,0 @@ -# This is the Jenkins ci variant of the .github/labler.yaml - -"CI-run-zephyr-twister": - - any: - - "!.github/**/*" - - "!doc/**/*" - - "!CODEOWNERS" - - "!LICENSE" - - "!**/*.rst" - - "!VERSION" - - "!submanifests/**/*" - - "!MAINTAINERS.yml" - - "!version.h.in" - - "!Jenkinsfile" - - "!**/*.md" - -"CI-iot-zephyr-lwm2m-test": - - "drivers/console/**/*" - - "drivers/flash/**/*" - - "subsys/dfu/boot/**/*" - - "subsys/net/ip/**/*" - - "subsys/net/lib/http/**/*" - - "subsys/net/lib/lwm2m//**/*" - - "subsys/net/**/*" - -"CI-iot-samples-test": - - "boards/nordic/nrf9160dk/**/*" - - "dts/arm/nordic/nrf9160*" - - "include/net/**/*" - - "subsys/net/lib/**/*" - -"CI-iot-libraries-test": - - "boards/nordic/nrf9160dk/**/*" - - "dts/arm/nordic/nrf9160*" - - "include/net/socket_ncs.h" - - "subsys/testsuite/ztest/**/*" - -"CI-lwm2m-test": null -# Not necessary to run tests on changes to this repo. - -"CI-boot-test": - - "subsys/mgmt/mcumgr/**/*" - - "subsys/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "include/dfu/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "tests/boot/**/*" - - "tests/subsys/dfu/**/*" - - "tests/subsys/mgmt/mcumgr/**/*" - -"CI-tfm-test": - - "boards/nordic/nrf5340dk/**/*" - - "boards/nordic/nrf9160dk/**/*" - - "drivers/entropy/*" - - "dts/arm/nordic/nrf5340*" - - "dts/arm/nordic/nrf9160*" - - "modules/trusted-firmware-m/**/*" - - "samples/tfm_integration/**/*" - -"CI-ble-test": - - any: - - "drivers/bluetooth/**/*" - - any: - - "dts/arm/nordic/nrf5*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - - any: - - "include/zephyr/bluetooth/**/*" - - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/hci_ipc/**/*" - -"CI-ble-samples-test": - - any: - - "drivers/bluetooth/**/*" - - any: - - "dts/arm/nordic/nrf5*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - - any: - - "include/zephyr/bluetooth/**/*" - - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/**/*" - -"CI-mesh-test": - - "subsys/bluetooth/mesh/**/*" - - "include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/mesh/**/*" - - "samples/bluetooth/mesh_demo/**/*" - - "samples/bluetooth/mesh_provisioner/**/*" - - "tests/bluetooth/mesh/**/*" - - "tests/bluetooth/mesh_shell/**/*" - -"CI-thingy91-test": - - "boards/nordic/nrf9160dk/**/*" - - "arch/x86/core/**/*" - - "arch/x86/include/**/*" - - "drivers/console/**/*" - - "drivers/ethernet/**/*" - - "drivers/flash/**/*" - - "drivers/hwinfo/**/*" - - "drivers/interrupt_controller/**/*" - - "drivers/net/**/*" - - "drivers/serial/**/*" - - "drivers/timer/**/*" - - "include/**/*" - - "kernel/**/*" - - "lib/libc/common/source/stdlib/**/*" - - "lib/libc/newlib/**/*" - - "lib/libc/picolibc/**/*" - - "lib/os/**/*" - - "lib/posix/**/*" - - "misc/**/*" - - "modules/mbedtls/**/*" - - "soc/x86/ia32/**/*" - - "subsys/fs/fcb/**/*" - - "subsys/logging/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/include/**/*" - - "subsys/settings/src/**/*" - - "subsys/stats/**/*" - - "subsys/storage/flash_map/**/*" - - "subsys/storage/stream/**/*" - - "subsys/tracing/**/*" - -"CI-desktop-test": - - "drivers/bluetooth/*" - - "subsys/bluetooth/*" - - "include/zephyr/bluetooth/*" - -"CI-crypto-test": - - "boards/nordic/nrf52840dk/**/*" - - "boards/nordic/nrf5340dk/**/*" - - "boards/nordic/nrf9160dk/**/*" - - "drivers/entropy/*" - - "drivers/serial/**/*" - - "dts/arm/nordic/nrf52840*" - - "dts/arm/nordic/nrf5340*" - - "dts/arm/nordic/nrf9160*" - - "include/drivers/serial/**/*" - - "modules/mbedtls/**/*" - -"CI-fem-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "dts/bindings/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/arch/**/*" - - "lib/libc/**/*" - - "lib/open-amp/**/*" - - "modules/hal_nordic/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "modules/trusted-firmware-m/**/*" - - "samples/net/sockets/echo_*/**/*" - - "share/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - - "subsys/bluetooth/shell/**/*" - - "subsys/ipc/**/*" - - "Kconfig" - - "CMakeLists.txt" - -"CI-rs-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "dts/bindings/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/arch/**/*" - - "lib/libc/**/*" - - "lib/open-amp/**/*" - - "modules/hal_nordic/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "modules/trusted-firmware-m/**/*" - - "samples/net/sockets/echo_*/**/*" - - "share/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - - "subsys/bluetooth/shell/**/*" - - "subsys/ipc/**/*" - - "Kconfig" - - "CMakeLists.txt" - -"CI-thread-test": - - "include/zephyr/net/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "samples/net/openthread/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-nfc-test": - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "drivers/flash/**/*" - - "drivers/mbox/**/*" - - "drivers/spi/**/*" - - "lib/crc/**/*" - - "modules/hal_nordic/**/*" - - "soc/nordic/**/*" - - "subsys/ipc/ipc_service/**/*" - - "subsys/fs/**/*" - - "subsys/mem_mgmt/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/**/*" - - "subsys/shell/**/*" - - "subsys/storage/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - -"CI-matter-test": - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/settings/**/*" - - "subsys/net/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "drivers/net/**/*" - - "samples/bluetooth/hci_ipc/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - -"CI-find-my-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/**/*" - - "drivers/entropy/**/*" - - "drivers/flash/**/*" - - "drivers/usb/**/*" - - "drivers/regulator/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/fs/**/*" - - "subsys/ipc/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/**/*" - - "subsys/storage/**/*" - - "subsys/tracing/**/*" - - "subsys/usb/device/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - -"CI-rpc-test": - - "subsys/ipc/ipc_service/**/*" - - "subsys/random/**/*" - - "soc/nordic/nrf53/**/*" - -"CI-modemshell-test": - - "include/net/**/*" - - "include/posix/**/*" - - "include/shell/**/*" - - "drivers/net/**/*" - - "drivers/serial/**/*" - - "drivers/wifi/**/*" - - "subsys/shell/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-positioning-test": - - "include/net/**/*" - - "include/posix/**/*" - - "drivers/net/**/*" - - "drivers/wifi/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-cloud-test": - - "include/zephyr/dfu/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/posix/**/*" - - "include/zephyr/settings/**/*" - - "drivers/led/**/*" - - "drivers/net/**/*" - - "drivers/sensor/**/*" - - "drivers/serial/**/*" - - "drivers/wifi/**/*" - - "lib/posix/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-wifi": - - "subsys/net/l2/wifi/**/*" - - "subsys/net/l2/ethernet/**/*" - -"CI-audio-test": - - "boards/nordic/nrf5340_audio_dk/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/gpio/**/*" - - "drivers/i2c/**/*" - - "drivers/watchdog/**/*" - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/bluetooth/hci_ipc/**/*" - - "soc/nordic/**/*" - - "subsys/bluetooth/audio/**/*" - - "subsys/bluetooth/host/**/*" - - "subsys/dfu/**/*" - - "subsys/fs/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "subsys/sd/**/*" - - "subsys/storage/**/*" - - "subsys/task_wdt/**/*" - - "subsys/usb/**/*" - - "subsys/zbus/**/*" - -"CI-pmic-samples-test": - - "samples/shields/npm1300_ek/**/*" - - "boards/shields/npm1300_ek/**/*" - - "**/**npm1300**/**" - - "drivers/regulator/regulator_common.c" - - "drivers/regulator/regulator_shell.c" - - "drivers/gpio/gpio_shell.c" - - "drivers/sensor/sensor_shell.c" - -"CI-test-low-level": - - "arch/**/*" - - "boards/nordic/nrf54*/**/*" - - "drivers/**/*" - - "dts/**/*" - - "include/zephyr/**/*" - - "kernel/**/*" - - "modules/hal_nordic/**/*" - - "samples/basic/blinky_pwm/**/*" - - "samples/basic/fade_led/**/*" - - "samples/boards/nrf/**/*" - - "samples/boards/nordic/**/*" - - "samples/drivers/adc/**/*" - - "samples/drivers/jesd216/**/*" - - "samples/drivers/mbox/**/*" - - "samples/drivers/soc_flash_nrf/**/*" - - "samples/drivers/spi_flash/**/*" - - "samples/drivers/watchdog/**/*" - - "samples/hello_world/**/*" - - "samples/sensor/**/*" - - "samples/subsys/ipc/**/*" - - "samples/subsys/logging/**/*" - - "samples/subsys/settings/**/*" - - "samples/subsys/usb/cdc_acm/**/*" - - "samples/subsys/usb/mass/**/*" - - "samples/synchronization/**/*" - - "subsys/logging/**/*" - - "subsys/settings/**/*" - - "tests/arch/**/*" - - "tests/boards/nrf/**/*" - - "tests/boards/nordic/**/*" - - "tests/drivers/**/*" - - "tests/kernel/**/*" - -"CI-suit-dfu-test": - - "subsys/mgmt/mcumgr/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "subsys/bluetooth/**/*" - - "drivers/bluetooth/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/console/**/*" - - "drivers/gpio/**/*" - - "dts/common/nordic/*" - - "dts/arm/nordic/nrf54h*/**/*" - - "dts/riscv/nordic/nrf54h*/**/*" - - "boards/nordic/nrf54h*/**/*" - - "soc/nordic/nrf54h/**/*" - - "include/zephyr/**/*" - - "subsys/logging/**/*" - - "subsys/tracing/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/nrfutil.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" From 6771c4649076d3b0a7a6870c2a96508a38e1aef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1115/3334] Revert "[nrf noup] ci: scripts: add quarantine file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5a9b99de0317d7f59acb74c988e6a47ed86b815c. Signed-off-by: Tomasz Moń --- scripts/quarantine.yaml | 88 ----------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 scripts/quarantine.yaml diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml deleted file mode 100644 index 20c4f9248ea9..000000000000 --- a/scripts/quarantine.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# The configurations resulting as a product of scenarios and platforms -# will be skipped if quarantine is used. More details here: -# https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine - -- scenarios: - - testing.ztest.busy_sim - - testing.ztest.busy_sim_nrf52840dk_pin - platforms: - - nrf52840dk_nrf52840 - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.unary_f64 - platforms: - - nrf5340dk_nrf5340_cpunet - - qemu_cortex_m3 - comment: "Flash overflows" - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.binary_f16 - - libraries.cmsis_dsp.matrix.binary_f16.fpu - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Flash overflows" - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.binary_q15 - - libraries.cmsis_dsp.matrix.binary_q15.fpu - - libraries.cmsis_dsp.matrix.unary_f32 - - libraries.cmsis_dsp.matrix.unary_f32.fpu - - libraries.cmsis_dsp.matrix.unary_f64 - - libraries.cmsis_dsp.matrix.unary_f64.fpu - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Flash overflows" - -# libsdl2-dev package should be added into docker image -- scenarios: - - sample.boards.nrf.nrf_led_matrix - - sample.display.lvgl.gui - platforms: - - native_posix - comment: "libsdl2-dev package not available" - -- scenarios: - - sample.net.sockets.echo_server.usbnet - - sample.net.sockets.echo_server.usbnet_composite - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - sample.net.zperf.netusb_ecm - - sample.net.zperf.netusb_eem - - sample.net.zperf.netusb_rndis - platforms: - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - net.mqtt.tls - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - kernel.common.picolibc - - libraries.picolibc - - libraries.libc.picolibc.mem_alloc - - libraries.picolibc.sprintf_new - platforms: - - nrf52dk_nrf52832 - comment: "Ram overflows, also in the upstream" - -- scenarios: - - sample.psa_crypto - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Due to using sdk-zephyr manifest instead of nrf. Should be fixed after the change" From 3a2d508b2e8228136bea21ff100c9cc2d6cfbfa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1116/3334] Revert "[nrf noup] ci: set `ZEPHYR__KCONFIG` for NCS modules" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0c00b1800accb3538c3fa7b8787044af9620c54f. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 842c0850447e..64e0d8764fcb 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -542,13 +542,6 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] - nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') - nrf_modules = [] - if os.path.exists(nrf_modules_dir): - nrf_modules = [name for name in os.listdir(nrf_modules_dir) if - os.path.exists(os.path.join(nrf_modules_dir, name, - 'Kconfig'))] - with open(modules_file, 'r') as fp_module_file: content = fp_module_file.read() @@ -558,31 +551,8 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se re.sub('[^a-zA-Z0-9]', '_', module).upper(), modules_dir / module / 'Kconfig' )) - for module in nrf_modules: - fp_module_file.write("ZEPHYR_{}_KCONFIG = {}\n".format( - re.sub('[^a-zA-Z0-9]', '_', module).upper(), - nrf_modules_dir / module / 'Kconfig' - )) - fp_module_file.write("NCS_{}_KCONFIG = {}\n".format( - re.sub('[^a-zA-Z0-9]', '_', module).upper(), - modules_dir / module / 'Kconfig' - )) - # Add NRF as static entry as workaround for ext Kconfig root support - fp_module_file.write("ZEPHYR_NRF_KCONFIG = {}\n".format( - nrf_modules_dir / '..' / 'Kconfig.nrf' - )) fp_module_file.write(content) - with open(sysbuild_modules_file, 'r') as fp_sysbuild_module_file: - content = fp_sysbuild_module_file.read() - - with open(sysbuild_modules_file, 'w') as fp_sysbuild_module_file: - # Add NRF as static entry as workaround for ext Kconfig root support - fp_sysbuild_module_file.write("SYSBUILD_NRF_KCONFIG = {}\n".format( - nrf_modules_dir / '..' / 'sysbuild' / 'Kconfig.sysbuild' - )) - fp_sysbuild_module_file.write(content) - def get_kconfig_dts(self, kconfig_dts_file, settings_file): """ Generate the Kconfig.dts using dts/bindings as the source. From 3c5499e6c5d2e66b6c37e07e0eaa07129a101662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1117/3334] Revert "[nrf fromtree] bluetooth: mesh: update max oob size till 32 bytes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d558ffefc35213a30795b68e0b5cfcabb169b174. Signed-off-by: Tomasz Moń --- .../bluetooth/api/mesh/provisioning.rst | 2 +- doc/releases/release-notes-4.4.rst | 15 -- include/zephyr/bluetooth/mesh/main.h | 45 +--- samples/bluetooth/mesh/src/main.c | 13 +- .../boards/nordic/mesh/onoff-app/src/main.c | 11 +- .../src/mesh/ble_mesh.c | 10 +- subsys/bluetooth/mesh/Kconfig | 12 -- subsys/bluetooth/mesh/prov.c | 199 +++++------------- subsys/bluetooth/mesh/prov.h | 6 +- subsys/bluetooth/mesh/provisioner.c | 6 +- subsys/bluetooth/mesh/shell/shell.c | 114 +--------- tests/bluetooth/tester/src/btp_mesh.c | 14 +- .../bsim/bluetooth/mesh/src/test_provision.c | 89 +++----- 13 files changed, 108 insertions(+), 428 deletions(-) diff --git a/doc/connectivity/bluetooth/api/mesh/provisioning.rst b/doc/connectivity/bluetooth/api/mesh/provisioning.rst index 311904882078..685c9dda455a 100644 --- a/doc/connectivity/bluetooth/api/mesh/provisioning.rst +++ b/doc/connectivity/bluetooth/api/mesh/provisioning.rst @@ -144,7 +144,7 @@ sequence should be repeated after a delay of three seconds or more. When an Input OOB action is selected, the user should be prompted when the application receives the :c:member:`bt_mesh_prov.input` callback. The user response should be fed back to the Provisioning API through -:c:func:`bt_mesh_input_string` or :c:func:`bt_mesh_input_numeric`. If +:c:func:`bt_mesh_input_string` or :c:func:`bt_mesh_input_number`. If no user response is recorded within 60 seconds, the Provisioning process is aborted. diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index d6277acc7161..f413980e39ad 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -53,15 +53,6 @@ Removed APIs and options Deprecated APIs and options =========================== -* Bluetooth - - * Mesh - - * The function :c:func:`bt_mesh_input_number` was deprecated. Applications should use - :c:func:`bt_mesh_input_numeric` instead. - * The callback :c:member:`output_number` in :c:struct:`bt_mesh_prov` structure was deprecated. - Applications should use :c:member:`output_numeric` callback instead. - New APIs and options ==================== @@ -75,12 +66,6 @@ New APIs and options * Bluetooth - * Mesh - - * :c:func:`bt_mesh_input_numeric` to provide provisioning numeric input OOB value. - * :c:member:`output_numeric` callback in :c:struct:`bt_mesh_prov` structure to - output numeric values during provisioning. - * Services * Introduced Alert Notification Service (ANS) :kconfig:option:`CONFIG_BT_ANS` diff --git a/include/zephyr/bluetooth/mesh/main.h b/include/zephyr/bluetooth/mesh/main.h index 76283aa39c8f..dfcd1d0bd7c9 100644 --- a/include/zephyr/bluetooth/mesh/main.h +++ b/include/zephyr/bluetooth/mesh/main.h @@ -173,7 +173,6 @@ struct bt_mesh_prov { */ void (*capabilities)(const struct bt_mesh_dev_capabilities *cap); -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY /** @brief Output of a number is requested. * * This callback notifies the application that it should @@ -184,21 +183,7 @@ struct bt_mesh_prov { * * @return Zero on success or negative error code otherwise */ - int (*output_number)(bt_mesh_output_action_t act, uint32_t num) __deprecated; -#else - /** @brief Output of a numeric value is requested. - * - * This callback notifies the application that it should - * output the given numeric value using the given action. - * - * @param act Action for outputting the numeric value. - * @param numeric memory with numeric value in the little endian format to be outputted. - * @param size size of the numeric value in bytes. - * - * @return Zero on success or negative error code otherwise - */ - int (*output_numeric)(bt_mesh_output_action_t act, uint8_t *numeric, size_t size); -#endif + int (*output_number)(bt_mesh_output_action_t act, uint32_t num); /** @brief Output of a string is requested. * @@ -217,7 +202,7 @@ struct bt_mesh_prov { * request input from the user using the given action. The * requested input will either be a string or a number, and * the application needs to consequently call the - * bt_mesh_input_string() or bt_mesh_input_numeric() functions + * bt_mesh_input_string() or bt_mesh_input_number() functions * once the data has been acquired from the user. * * @param act Action for inputting data. @@ -328,7 +313,7 @@ struct bt_mesh_rpr_node; /** @brief Provide provisioning input OOB string. * - * This is intended to be called after the @ref bt_mesh_prov::input callback + * This is intended to be called after the bt_mesh_prov input callback * has been called with BT_MESH_ENTER_STRING as the action. * * @param str String. @@ -337,30 +322,16 @@ struct bt_mesh_rpr_node; */ int bt_mesh_input_string(const char *str); -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY /** @brief Provide provisioning input OOB number. * - * This is intended to be called after the @ref bt_mesh_prov::input callback - * has been called with @ref BT_MESH_ENTER_NUMBER as the action. + * This is intended to be called after the bt_mesh_prov input callback + * has been called with BT_MESH_ENTER_NUMBER as the action. * * @param num Number. * * @return Zero on success or (negative) error code otherwise. */ -__deprecated int bt_mesh_input_number(uint32_t num); -#endif - -/** @brief Provide provisioning input OOB numeric value. - * - * This is intended to be called after the @ref bt_mesh_prov::input callback - * has been called with @ref BT_MESH_ENTER_NUMBER as the action. - * - * @param numeric Pointer to the numeric value in little endian. - * @param size Size of the numeric value in bytes (this is not OOB size). - * - * @return Zero on success or (negative) error code otherwise. - */ -int bt_mesh_input_numeric(uint8_t *numeric, size_t size); +int bt_mesh_input_number(uint32_t num); /** @brief Provide Device public key. * @@ -376,7 +347,7 @@ int bt_mesh_prov_remote_pub_key_set(const uint8_t public_key[64]); * * Instruct the unprovisioned device to use the specified Input OOB * authentication action. When using @ref BT_MESH_PUSH, @ref BT_MESH_TWIST or - * @ref BT_MESH_ENTER_NUMBER, the @ref bt_mesh_prov::output_numeric callback is + * @ref BT_MESH_ENTER_NUMBER, the @ref bt_mesh_prov::output_number callback is * called with a random number that has to be entered on the unprovisioned * device. * @@ -401,7 +372,7 @@ int bt_mesh_auth_method_set_input(bt_mesh_input_action_t action, uint8_t size); * * When using @ref BT_MESH_BLINK, @ref BT_MESH_BEEP, @ref BT_MESH_VIBRATE * or @ref BT_MESH_DISPLAY_NUMBER, and the application has to call - * @ref bt_mesh_input_numeric with the random number indicated by + * @ref bt_mesh_input_number with the random number indicated by * the unprovisioned device. * * When using @ref BT_MESH_DISPLAY_STRING, the application has to call diff --git a/samples/bluetooth/mesh/src/main.c b/samples/bluetooth/mesh/src/main.c index 02decb8585e2..cec8159e292a 100644 --- a/samples/bluetooth/mesh/src/main.c +++ b/samples/bluetooth/mesh/src/main.c @@ -267,16 +267,9 @@ static const struct bt_mesh_comp comp = { }; /* Provisioning */ -static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size) -{ - uint32_t number; - - if (size != sizeof(number)) { - printk("Wrong OOB size: %u\n", size); - return -EINVAL; - } - number = sys_get_le32(numeric); +static int output_number(bt_mesh_output_action_t action, uint32_t number) +{ printk("OOB Number: %u\n", number); board_output_number(action, number); @@ -300,7 +293,7 @@ static const struct bt_mesh_prov prov = { .uuid = dev_uuid, .output_size = 4, .output_actions = BT_MESH_DISPLAY_NUMBER, - .output_numeric = output_numeric, + .output_number = output_number, .complete = prov_complete, .reset = prov_reset, }; diff --git a/samples/boards/nordic/mesh/onoff-app/src/main.c b/samples/boards/nordic/mesh/onoff-app/src/main.c index a90c45fe7f09..17b04c87fad6 100644 --- a/samples/boards/nordic/mesh/onoff-app/src/main.c +++ b/samples/boards/nordic/mesh/onoff-app/src/main.c @@ -47,7 +47,6 @@ #include #include #include -#include /* Model Operation Codes */ #define BT_MESH_MODEL_OP_GEN_ONOFF_GET BT_MESH_MODEL_OP_2(0x82, 0x01) @@ -367,13 +366,9 @@ static int gen_onoff_status(const struct bt_mesh_model *model, return 0; } -static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size) +static int output_number(bt_mesh_output_action_t action, uint32_t number) { - uint64_t number = 0ull; - - sys_get_le(&number, numeric, size); - - printk("OOB Number %06" PRIu64 "\n", number); + printk("OOB Number %06u\n", number); return 0; } @@ -530,7 +525,7 @@ static const struct bt_mesh_prov prov = { #if 1 .output_size = 6, .output_actions = (BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING), - .output_numeric = output_numeric, + .output_number = output_number, .output_string = output_string, #else .output_size = 0, diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c index c55e0d0ab77e..0234d8d971be 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c @@ -10,13 +10,9 @@ #ifdef OOB_AUTH_ENABLE -static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size) +static int output_number(bt_mesh_output_action_t action, uint32_t number) { - uint64_t number = 0ull; - - sys_get_le(&number, numeric, size); - - printk("OOB Number %06" PRIu64 "\n", number); + printk("OOB Number: %u\n", number); return 0; } @@ -46,7 +42,7 @@ static const struct bt_mesh_prov prov = { .output_size = 6, .output_actions = BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING, - .output_numeric = output_numeric, + .output_number = output_number, .output_string = output_string, #endif diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 87382d67025b..74a5ed11cac5 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -361,18 +361,6 @@ config BT_MESH_OOB_AUTH_REQUIRED bool "OOB authentication mandates to use HMAC SHA256" depends on BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM -config BT_MESH_PROV_OOB_API_LEGACY - bool "Reduced maximum OOB authentication size support [DEPRECATED]" - select DEPRECATED - depends on BT_MESH_PROV - help - By default, the maximum OOB authentication size is 32 bytes. - Enable this option to use the legacy API which is only compatible with - specification v1.1 and earlier. This limits OOB authentication to 8 - bytes maximum. - This option is intended for backward compatibility. - Not recommended for new designs due to reduced security. - config BT_MESH_PROVISIONER bool "Provisioner support" depends on BT_MESH_CDB diff --git a/subsys/bluetooth/mesh/prov.c b/subsys/bluetooth/mesh/prov.c index a5cd8a9fc927..373fec3b4ac7 100644 --- a/subsys/bluetooth/mesh/prov.c +++ b/subsys/bluetooth/mesh/prov.c @@ -28,9 +28,6 @@ #include LOG_MODULE_REGISTER(bt_mesh_prov); -/* 10 power 32 represents 14 bytes maximum in little-endian format */ -#define MAX_NUMERIC_OOB_BYTES 14 - struct bt_mesh_prov_link bt_mesh_prov_link; const struct bt_mesh_prov *bt_mesh_prov; @@ -125,121 +122,57 @@ static int check_input_auth(bt_mesh_input_action_t input, uint8_t size) static void get_auth_string(char *str, uint8_t size) { - static const char characters[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + uint64_t value; - bt_rand(str, size); + bt_rand(&value, sizeof(value)); + + static const char characters[36] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for (int i = 0; i < size; i++) { - str[i] = characters[(uint8_t)str[i] % (uint8_t)36]; + /* pull base-36 digits: */ + int idx = value % 36; + + value = value / 36; + str[i] = characters[idx]; } + str[size] = '\0'; + memcpy(bt_mesh_prov_link.auth, str, size); memset(bt_mesh_prov_link.auth + size, 0, sizeof(bt_mesh_prov_link.auth) - size); } -/* Computes 10^n - 1 in little endian array */ -static void compute_pow10_minus1(uint8_t n, uint8_t *out, size_t *out_len) -{ - out[0] = 1; /* Start with value 1 at LSB */ - size_t len = 1; - - /* Compute 10^n */ - for (uint8_t i = 0; i < n; ++i) { - uint16_t carry = 0; - - for (size_t j = 0; j < len; ++j) { - uint16_t prod = out[j] * 10 + carry; - - out[j] = prod & 0xFF; - carry = prod >> 8; - } - - if (carry > 0 && len < MAX_NUMERIC_OOB_BYTES) { - out[len] = carry; - len++; - } - } - - /* Subtract 1 from the result (10^n - 1) */ - size_t j = 0; - - while (j < len) { - if (out[j] > 0) { - out[j] -= 1; - break; - } - out[j] = 0xFF; - j++; - } - - /* Adjust length if highest byte becomes 0 */ - while (len > 1 && out[len - 1] == 0) { - len--; - } - - *out_len = len; -} - -static void random_byte_shift(uint8_t max_inclusive, uint8_t *out) -{ - if (max_inclusive == 0) { - *out = 0; - return; - } - - while (*out > max_inclusive) { - *out >>= 1; - } -} - -static void generate_random_below_pow10(uint8_t n, uint8_t *output, size_t *out_len) +static uint32_t get_auth_number(bt_mesh_output_action_t output, + bt_mesh_input_action_t input, uint8_t size) { - uint8_t max_val[MAX_NUMERIC_OOB_BYTES] = {0}; - size_t max_len = 0; - - compute_pow10_minus1(n, max_val, &max_len); - bt_rand(output, max_len); - - /* Generate random number less than max_val, starting from MSB in little-endian */ - for (int i = max_len - 1; i >= 0; --i) { - random_byte_shift(max_val[i], &output[i]); - if (output[i] < max_val[i]) { - break; - } - } + const uint32_t divider[PROV_IO_OOB_SIZE_MAX] = { 10, 100, 1000, 10000, + 100000, 1000000, 10000000, 100000000 }; + uint8_t auth_size = bt_mesh_prov_auth_size_get(); + uint32_t num = 0; - /* Ensure the result is not all zero */ - int all_zero = 1; + bt_rand(&num, sizeof(num)); - for (size_t i = 0; i < max_len; ++i) { - if (output[i] != 0) { - all_zero = 0; - break; - } + if (output == BT_MESH_BLINK || output == BT_MESH_BEEP || output == BT_MESH_VIBRATE || + input == BT_MESH_PUSH || input == BT_MESH_TWIST) { + /* According to MshPRTv1.1: 5.4.2.4, blink, beep vibrate, push and twist should be + * a random integer between 0 and 10^size, *exclusive*: + */ + num = (num % (divider[size - 1] - 1)) + 1; + } else { + num %= divider[size - 1]; } - if (all_zero) { - output[0] = 1; - } - - *out_len = max_len; -} - -static void get_auth_number(uint8_t *rand_bytes, size_t *size) -{ - uint8_t auth_size = bt_mesh_prov_auth_size_get(); + sys_put_be32(num, &bt_mesh_prov_link.auth[auth_size - sizeof(num)]); + memset(bt_mesh_prov_link.auth, 0, auth_size - sizeof(num)); - generate_random_below_pow10(*size, rand_bytes, size); - sys_memcpy_swap(bt_mesh_prov_link.auth + (auth_size - *size), rand_bytes, *size); - memset(bt_mesh_prov_link.auth, 0, auth_size - *size); + return num; } -int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, size_t size) +int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8_t size) { bt_mesh_output_action_t output; bt_mesh_input_action_t input; - uint8_t rand_bytes[PROV_IO_OOB_SIZE_MAX + 1] = {0}; uint8_t auth_size = bt_mesh_prov_auth_size_get(); int err; @@ -281,22 +214,18 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, size_ return bt_mesh_prov->input(input, size); } - atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); if (output == BT_MESH_DISPLAY_STRING) { - get_auth_string(rand_bytes, MIN(size, auth_size)); - return bt_mesh_prov->output_string(rand_bytes); - } + char str[9]; - get_auth_number(rand_bytes, &size); -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY - uint32_t output_num; + atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); + get_auth_string(str, size); + return bt_mesh_prov->output_string(str); + } - memcpy(&output_num, rand_bytes, sizeof(output_num)); - return bt_mesh_prov->output_number(output, output_num); -#else - return bt_mesh_prov->output_numeric(output, rand_bytes, size); -#endif + atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); + return bt_mesh_prov->output_number(output, + get_auth_number(output, BT_MESH_NO_INPUT, size)); case AUTH_METHOD_INPUT: input = input_action(action); @@ -315,30 +244,24 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, size_ return bt_mesh_prov->input(input, size); } - atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); - if (input == BT_MESH_ENTER_STRING) { - get_auth_string(rand_bytes, MIN(size, auth_size)); - return bt_mesh_prov->output_string(rand_bytes); + char str[9]; + + atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); + get_auth_string(str, size); + return bt_mesh_prov->output_string(str); } - get_auth_number(rand_bytes, &size); + atomic_set_bit(bt_mesh_prov_link.flags, NOTIFY_INPUT_COMPLETE); output = BT_MESH_DISPLAY_NUMBER; -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY - uint32_t input_num; - - memcpy(&input_num, rand_bytes, sizeof(input_num)); - return bt_mesh_prov->output_number(output, input_num); -#else - return bt_mesh_prov->output_numeric(output, rand_bytes, size); -#endif + return bt_mesh_prov->output_number(output, + get_auth_number(BT_MESH_NO_OUTPUT, input, size)); default: return -EINVAL; } } -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY int bt_mesh_input_number(uint32_t num) { uint8_t auth_size = bt_mesh_prov_auth_size_get(); @@ -355,37 +278,13 @@ int bt_mesh_input_number(uint32_t num) return 0; } -#endif - -int bt_mesh_input_numeric(uint8_t *numeric, size_t size) -{ - uint8_t auth_size = bt_mesh_prov_auth_size_get(); - - LOG_HEXDUMP_DBG(numeric, size, ""); - - if (size > MAX_NUMERIC_OOB_BYTES) { - return -ENOTSUP; - } - - if (!atomic_test_and_clear_bit(bt_mesh_prov_link.flags, WAIT_NUMBER)) { - return -EINVAL; - } - - sys_memcpy_swap(bt_mesh_prov_link.auth + (auth_size - size), numeric, size); - memset(bt_mesh_prov_link.auth, 0, auth_size - size); - - bt_mesh_prov_link.role->input_complete(); - - return 0; -} int bt_mesh_input_string(const char *str) { - size_t size = strlen(str); - LOG_DBG("%s", str); - if (size > PROV_IO_OOB_SIZE_MAX || size > bt_mesh_prov_link.oob_size) { + if (strlen(str) > PROV_IO_OOB_SIZE_MAX || + strlen(str) > bt_mesh_prov_link.oob_size) { return -ENOTSUP; } @@ -393,7 +292,7 @@ int bt_mesh_input_string(const char *str) return -EINVAL; } - memcpy(bt_mesh_prov_link.auth, str, size); + memcpy(bt_mesh_prov_link.auth, str, strlen(str)); memset(bt_mesh_prov_link.auth + size, 0, sizeof(bt_mesh_prov_link.auth) - size); bt_mesh_prov_link.role->input_complete(); diff --git a/subsys/bluetooth/mesh/prov.h b/subsys/bluetooth/mesh/prov.h index 499b1ca60359..c21ec395090c 100644 --- a/subsys/bluetooth/mesh/prov.h +++ b/subsys/bluetooth/mesh/prov.h @@ -68,11 +68,7 @@ #define PROV_ALG_P256 0x00 -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY #define PROV_IO_OOB_SIZE_MAX 8 /* in bytes */ -#else -#define PROV_IO_OOB_SIZE_MAX 32 /* in bytes */ -#endif #define PRIV_KEY_SIZE 32 #define PUB_KEY_SIZE PDU_LEN_PUB_KEY @@ -190,7 +186,7 @@ int bt_mesh_prov_reset_state(void); bool bt_mesh_prov_active(void); -int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, size_t size); +int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8_t size); int bt_mesh_pb_remote_open(struct bt_mesh_rpr_cli *cli, const struct bt_mesh_rpr_node *srv, const uint8_t uuid[16], diff --git a/subsys/bluetooth/mesh/provisioner.c b/subsys/bluetooth/mesh/provisioner.c index efc480b74ef3..28372caf4554 100644 --- a/subsys/bluetooth/mesh/provisioner.c +++ b/subsys/bluetooth/mesh/provisioner.c @@ -172,12 +172,8 @@ static bool prov_check_method(struct bt_mesh_dev_capabilities *caps) return false; } } else { -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY if (!bt_mesh_prov->output_number) { -#else - if (!bt_mesh_prov->output_numeric) { -#endif - LOG_WRN("Not support output numeric"); + LOG_WRN("Not support output number"); return false; } } diff --git a/subsys/bluetooth/mesh/shell/shell.c b/subsys/bluetooth/mesh/shell/shell.c index 10138b164ad7..5475cc5d49b4 100644 --- a/subsys/bluetooth/mesh/shell/shell.c +++ b/subsys/bluetooth/mesh/shell/shell.c @@ -25,7 +25,6 @@ #include "mesh/foundation.h" #include "mesh/settings.h" #include "mesh/access.h" -#include "mesh/prov.h" #include "common/bt_shell_private.h" #include "utils.h" #include "dfu.h" @@ -400,59 +399,18 @@ static int cmd_proxy_solicit(const struct shell *sh, size_t argc, #endif /* CONFIG_BT_MESH_SHELL_GATT_PROXY */ #if defined(CONFIG_BT_MESH_SHELL_PROV) -static int ascii_decimal_to_le_bytes(const char *ascii_str, uint8_t *out, size_t *out_len) -{ - size_t len = 0; - - for (const char *p = ascii_str; *p; ++p) { - if (!isdigit((unsigned char)*p)) { - return -EINVAL; /* Invalid character */ - } - - uint16_t carry = *p - '0'; - - /* If this is the first digit and it's 0, we need at least one byte */ - if (len == 0) { - out[0] = carry; - len = 1; - continue; - } - - /* Multiply current result by 10 and add new digit */ - for (size_t i = 0; i < len; ++i) { - uint16_t value = out[i] * 10 + carry; - - out[i] = value & 0xFF; - carry = value >> 8; - } - - /* Handle overflow to next byte */ - if (carry != 0) { - if (len >= PROV_IO_OOB_SIZE_MAX) { - return -EOVERFLOW; /* Overflow */ - } - out[len++] = carry; - } - } - - *out_len = len; - return 0; -} - static int cmd_input_num(const struct shell *sh, size_t argc, char *argv[]) { int err = 0; - uint8_t result[PROV_IO_OOB_SIZE_MAX] = {0}; - size_t result_len; + uint32_t val; - err = ascii_decimal_to_le_bytes(argv[1], result, &result_len); + val = shell_strtoul(argv[1], 10, &err); if (err) { - shell_warn(sh, err == -EINVAL ? "The input string symbol is not a digit" - : "Overflow in input string argument"); + shell_warn(sh, "Unable to parse input string argument"); return err; } - err = bt_mesh_input_numeric(result, result_len); + err = bt_mesh_input_number(val); if (err) { shell_error(sh, "Numeric input failed (err %d)", err); } @@ -565,76 +523,30 @@ static void prov_reset(void) bt_shell_print("The local node has been reset and needs reprovisioning"); } -static void binary_to_ascii_digits(const uint8_t *in, size_t in_len, char *out_str) -{ - uint8_t temp[PROV_IO_OOB_SIZE_MAX]; - size_t digit_count = 0; - - __ASSERT(in_len <= sizeof(temp), "Output numeric exceeds maximum"); - memcpy(temp, in, in_len); - - while (in_len > 0) { - uint16_t remainder = 0; - - /* Divide the number in `temp` by 10, store quotient back in `temp` */ - for (ssize_t i = in_len - 1; i >= 0; --i) { - uint16_t acc = ((uint16_t)remainder << 8) | temp[i]; - - temp[i] = acc / 10; - remainder = acc % 10; - } - - /* Store ASCII digit */ - out_str[digit_count++] = '0' + remainder; - - /* Trim leading zeros */ - while (in_len > 0 && temp[in_len - 1] == 0) { - in_len--; - } - } - - /* Digits are in reverse order, reverse them to get correct string */ - sys_mem_swap(out_str, digit_count); - - /* Null-terminate the string */ - out_str[digit_count] = '\0'; -} - -static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t len) +static int output_number(bt_mesh_output_action_t action, uint32_t number) { - char oob_string[PROV_IO_OOB_SIZE_MAX + 1]; - - binary_to_ascii_digits(numeric, len, oob_string); - switch (action) { case BT_MESH_BLINK: - bt_shell_print("OOB blink Number: %s", oob_string); + bt_shell_print("OOB blink Number: %u", number); break; case BT_MESH_BEEP: - bt_shell_print("OOB beep Number: %s", oob_string); + bt_shell_print("OOB beep Number: %u", number); break; case BT_MESH_VIBRATE: - bt_shell_print("OOB vibrate Number: %s", oob_string); + bt_shell_print("OOB vibrate Number: %u", number); break; case BT_MESH_DISPLAY_NUMBER: - bt_shell_print("OOB display Number: %s", oob_string); + bt_shell_print("OOB display Number: %u", number); break; default: - bt_shell_error("Unknown Output action %u (number %s) requested!", action, - oob_string); + bt_shell_error("Unknown Output action %u (number %u) requested!", + action, number); return -EINVAL; } return 0; } -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY -static int output_number(bt_mesh_output_action_t action, uint32_t number) -{ - return output_numeric(action, (uint8_t *)&number, sizeof(number)); -} -#endif - static int output_string(const char *str) { bt_shell_print("OOB String: %s", str); @@ -690,11 +602,7 @@ struct bt_mesh_prov bt_mesh_shell_prov = { .output_size = 6, .output_actions = (BT_MESH_BLINK | BT_MESH_BEEP | BT_MESH_VIBRATE | BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING), -#if defined CONFIG_BT_MESH_PROV_OOB_API_LEGACY .output_number = output_number, -#else - .output_numeric = output_numeric, -#endif .output_string = output_string, .input_size = 6, .input_actions = diff --git a/tests/bluetooth/tester/src/btp_mesh.c b/tests/bluetooth/tester/src/btp_mesh.c index 26ab447c8269..3a84e8226197 100644 --- a/tests/bluetooth/tester/src/btp_mesh.c +++ b/tests/bluetooth/tester/src/btp_mesh.c @@ -1175,17 +1175,9 @@ static void link_close(bt_mesh_prov_bearer_t bearer) tester_event(BTP_SERVICE_ID_MESH, BTP_MESH_EV_PROV_LINK_CLOSED, &ev, sizeof(ev)); } -static int output_numeric(bt_mesh_output_action_t action, uint8_t *numeric, size_t size) +static int output_number(bt_mesh_output_action_t action, uint32_t number) { struct btp_mesh_out_number_action_ev ev; - uint32_t number; - - if (size > sizeof(number)) { - LOG_ERR("Unsupported size %zu", size); - return -EINVAL; - } - - number = sys_get_le32(numeric); LOG_DBG("action 0x%04x number 0x%08x", action, number); @@ -1305,7 +1297,7 @@ static struct bt_mesh_prov prov = { .uuid = dev_uuid, .static_val = static_auth, .static_val_len = sizeof(static_auth), - .output_numeric = output_numeric, + .output_number = output_number, .output_string = output_string, .input = input, .link_open = link_open, @@ -1513,7 +1505,7 @@ static uint8_t input_number(const void *cmd, uint16_t cmd_len, LOG_DBG("number 0x%04x", number); - err = bt_mesh_input_numeric((uint8_t *)&cp->number, sizeof(cp->number)); + err = bt_mesh_input_number(number); if (err) { return BTP_STATUS_FAILED; } diff --git a/tests/bsim/bluetooth/mesh/src/test_provision.c b/tests/bsim/bluetooth/mesh/src/test_provision.c index a93add213907..321d168914fd 100644 --- a/tests/bsim/bluetooth/mesh/src/test_provision.c +++ b/tests/bsim/bluetooth/mesh/src/test_provision.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Lingao Meng - * Copyright (c) 2025 Nordic Semiconductor * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,11 +9,12 @@ #include "mesh/access.h" #include "mesh/net.h" #include "mesh/crypto.h" -#include "mesh/prov.h" #include "argparse.h" #include #include +#include + #include #define LOG_MODULE_NAME mesh_prov @@ -65,19 +65,15 @@ static struct oob_auth_test_vector_s { {static_key1, sizeof(static_key1), 0, 0, 0, 0}, {static_key2, sizeof(static_key2), 0, 0, 0, 0}, {static_key3, sizeof(static_key3), 0, 0, 0, 0}, - {NULL, 0, 1, BT_MESH_BLINK, 0, 0}, + {NULL, 0, 3, BT_MESH_BLINK, 0, 0}, {NULL, 0, 5, BT_MESH_BEEP, 0, 0}, - {NULL, 0, 8, BT_MESH_VIBRATE, 0, 0}, - {NULL, 0, 15, BT_MESH_DISPLAY_NUMBER, 0, 0}, - {NULL, 0, 19, BT_MESH_DISPLAY_STRING, 0, 0}, - {NULL, 0, 32, BT_MESH_DISPLAY_NUMBER, 0, 0}, - {NULL, 0, 32, BT_MESH_DISPLAY_STRING, 0, 0}, - {NULL, 0, 0, 0, 1, BT_MESH_PUSH}, + {NULL, 0, 6, BT_MESH_VIBRATE, 0, 0}, + {NULL, 0, 7, BT_MESH_DISPLAY_NUMBER, 0, 0}, + {NULL, 0, 8, BT_MESH_DISPLAY_STRING, 0, 0}, + {NULL, 0, 0, 0, 4, BT_MESH_PUSH}, {NULL, 0, 0, 0, 5, BT_MESH_TWIST}, - {NULL, 0, 0, 0, 13, BT_MESH_ENTER_NUMBER}, - {NULL, 0, 0, 0, 27, BT_MESH_ENTER_STRING}, - {NULL, 0, 0, 0, 32, BT_MESH_ENTER_NUMBER}, - {NULL, 0, 0, 0, 32, BT_MESH_ENTER_STRING}, + {NULL, 0, 0, 0, 8, BT_MESH_ENTER_NUMBER}, + {NULL, 0, 0, 0, 7, BT_MESH_ENTER_STRING}, }; static ATOMIC_DEFINE(test_flags, TEST_FLAGS); @@ -418,23 +414,25 @@ static int input(bt_mesh_input_action_t act, uint8_t size) static void delayed_input(struct k_work *work) { - uint8_t oob_data[PROV_IO_OOB_SIZE_MAX + 1] = {0}; + char oob_str[16]; + uint32_t oob_number; int size = bs_bc_is_msg_received(*oob_channel_id); - ASSERT_TRUE_MSG(size > 0, "OOB data is not gotten"); - ASSERT_TRUE_MSG(size <= PROV_IO_OOB_SIZE_MAX, "OOB data size %d exceeds max %d", - size, PROV_IO_OOB_SIZE_MAX); - - bs_bc_receive_msg(*oob_channel_id, oob_data, size); + if (size <= 0) { + FAIL("OOB data is not gotten"); + } switch (gact) { case BT_MESH_PUSH: case BT_MESH_TWIST: case BT_MESH_ENTER_NUMBER: - ASSERT_OK(bt_mesh_input_numeric(oob_data, size)); + ASSERT_TRUE(size == sizeof(uint32_t)); + bs_bc_receive_msg(*oob_channel_id, (uint8_t *)&oob_number, size); + ASSERT_OK(bt_mesh_input_number(oob_number)); break; case BT_MESH_ENTER_STRING: - ASSERT_OK(bt_mesh_input_string((const char *)oob_data)); + bs_bc_receive_msg(*oob_channel_id, (uint8_t *)oob_str, size); + ASSERT_OK(bt_mesh_input_string(oob_str)); break; default: FAIL("Unknown input action %u (size %u) requested!", gact, gsize); @@ -446,7 +444,7 @@ static void prov_input_complete(void) LOG_INF("Input OOB data completed"); } -static int output_numeric(bt_mesh_output_action_t act, uint8_t *numeric, size_t size); +static int output_number(bt_mesh_output_action_t action, uint32_t number); static int output_string(const char *str); static void capabilities(const struct bt_mesh_dev_capabilities *cap); static struct bt_mesh_prov prov = { @@ -458,7 +456,7 @@ static struct bt_mesh_prov prov = { .link_close = prov_link_close, .reprovisioned = prov_reprovisioned, .node_added = prov_node_added, - .output_numeric = output_numeric, + .output_number = output_number, .output_string = output_string, .input = input, .input_complete = prov_input_complete, @@ -466,48 +464,11 @@ static struct bt_mesh_prov prov = { .reset = prov_reset, }; -static void binary_to_ascii_digits(const uint8_t *in, size_t in_len, char *out_str) -{ - uint8_t temp[PROV_IO_OOB_SIZE_MAX]; - size_t digit_count = 0; - - memcpy(temp, in, in_len); - - while (in_len > 0) { - uint16_t remainder = 0; - - /* Divide the number in `temp` by 10, store quotient back in `temp` */ - for (ssize_t i = in_len - 1; i >= 0; --i) { - uint16_t acc = ((uint16_t)remainder << 8) | temp[i]; - - temp[i] = acc / 10; - remainder = acc % 10; - } - - /* Store ASCII digit */ - out_str[digit_count++] = '0' + remainder; - - /* Trim leading zeros */ - while (in_len > 0 && temp[in_len - 1] == 0) { - in_len--; - } - } - - /* Digits are in reverse order, reverse them to get correct string */ - sys_mem_swap(out_str, digit_count); - - /* Null-terminate the string */ - out_str[digit_count] = '\0'; -} - -static int output_numeric(bt_mesh_output_action_t act, uint8_t *numeric, size_t size) +static int output_number(bt_mesh_output_action_t action, uint32_t number) { - uint8_t numeric_ascii[PROV_IO_OOB_SIZE_MAX + 1]; - - binary_to_ascii_digits(numeric, size, numeric_ascii); - LOG_INF("OOB Number: %s", numeric_ascii); + LOG_INF("OOB Number: %u", number); - bs_bc_send_msg(*oob_channel_id, numeric, size); + bs_bc_send_msg(*oob_channel_id, (uint8_t *)&number, sizeof(uint32_t)); return 0; } @@ -515,7 +476,7 @@ static int output_string(const char *str) { LOG_INF("OOB String: %s", str); - bs_bc_send_msg(*oob_channel_id, (uint8_t *)str, strlen(str)); + bs_bc_send_msg(*oob_channel_id, (uint8_t *)str, strlen(str) + 1); return 0; } From dc1fe1d7b579d1359a26ba947ed160ea933a0799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1118/3334] Revert "[nrf fromtree] bluetooth: mesh: adjust adv stack dependency and size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 74e1653a59a2b4489a8d282c2dd432793742f36f. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 74a5ed11cac5..02845ab743c5 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -72,8 +72,7 @@ if BT_MESH_ADV_LEGACY config BT_MESH_ADV_STACK_SIZE int "Mesh advertiser thread stack size" - default 1800 if BT_MESH_PROVISIONER - default 1536 if BT_MESH_PROXY + default 1024 if BT_HOST_CRYPTO default 776 if BT_MESH_PRIV_BEACONS default 768 help @@ -143,8 +142,8 @@ if BT_MESH_WORKQ_MESH config BT_MESH_ADV_STACK_SIZE int "Mesh extended advertiser thread stack size" - default 2048 if BT_MESH_PROVISIONER default 1536 if BT_MESH_PROXY + default 1024 if BT_HOST_CRYPTO default 776 if BT_MESH_PRIV_BEACONS default 768 help From 2f22ebbd66334d348ea9d5ca4d8180193be09585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1119/3334] Revert "[nrf fromtree] bluetooth: mesh: prevent getting wrong authentication size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 467bf7c0185dace5cb012bd059c896915ded690a. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/prov.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/subsys/bluetooth/mesh/prov.h b/subsys/bluetooth/mesh/prov.h index c21ec395090c..00bd85952e0e 100644 --- a/subsys/bluetooth/mesh/prov.h +++ b/subsys/bluetooth/mesh/prov.h @@ -164,14 +164,10 @@ static inline void bt_mesh_prov_buf_init(struct net_buf_simple *buf, uint8_t typ net_buf_simple_add_u8(buf, type); } + static inline uint8_t bt_mesh_prov_auth_size_get(void) { - if (IS_ENABLED(CONFIG_BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM)) { - return bt_mesh_prov_link.algorithm == BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM ? 16 - : 32; - } else { - return 16; - } + return bt_mesh_prov_link.algorithm == BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM ? 16 : 32; } static inline k_timeout_t bt_mesh_prov_protocol_timeout_get(void) From 452bce9188bfe5c5dca3d8fa65c138f2b47cda73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:41 +0100 Subject: [PATCH 1120/3334] Revert "[nrf fromtree] bluetooth: mesh: zeroing not used part of auth array" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f1214e9819dc3b7d0d54f34b785bbb0fb33a2d3e. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/prov.c | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/mesh/prov.c b/subsys/bluetooth/mesh/prov.c index 373fec3b4ac7..e8e3918bdabf 100644 --- a/subsys/bluetooth/mesh/prov.c +++ b/subsys/bluetooth/mesh/prov.c @@ -293,7 +293,6 @@ int bt_mesh_input_string(const char *str) } memcpy(bt_mesh_prov_link.auth, str, strlen(str)); - memset(bt_mesh_prov_link.auth + size, 0, sizeof(bt_mesh_prov_link.auth) - size); bt_mesh_prov_link.role->input_complete(); From a3a4f4093704f594506e5340de7d84b28b643436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1121/3334] Revert "[nrf fromtree] bluetooth: mesh: improve oob size checking" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0adebce8bb8a4acf8a7c8dda0499dd7f47666f96. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/prov.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/subsys/bluetooth/mesh/prov.c b/subsys/bluetooth/mesh/prov.c index e8e3918bdabf..d83485962a13 100644 --- a/subsys/bluetooth/mesh/prov.c +++ b/subsys/bluetooth/mesh/prov.c @@ -96,7 +96,7 @@ static int check_output_auth(bt_mesh_output_action_t output, uint8_t size) return -EINVAL; } - if (size > bt_mesh_prov->output_size || size == 0) { + if (size > bt_mesh_prov->output_size) { return -EINVAL; } @@ -113,7 +113,7 @@ static int check_input_auth(bt_mesh_input_action_t input, uint8_t size) return -EINVAL; } - if (size > bt_mesh_prov->input_size || size == 0) { + if (size > bt_mesh_prov->input_size) { return -EINVAL; } @@ -176,8 +176,6 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 uint8_t auth_size = bt_mesh_prov_auth_size_get(); int err; - size = MIN(size, PROV_IO_OOB_SIZE_MAX); - switch (method) { case AUTH_METHOD_NO_OOB: if (action || size) { @@ -197,10 +195,6 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 case AUTH_METHOD_OUTPUT: output = output_action(action); - err = check_output_auth(output, size); - if (err) { - return err; - } if (is_provisioner) { if (output == BT_MESH_DISPLAY_STRING) { @@ -214,6 +208,10 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 return bt_mesh_prov->input(input, size); } + err = check_output_auth(output, size); + if (err) { + return err; + } if (output == BT_MESH_DISPLAY_STRING) { char str[9]; @@ -229,12 +227,13 @@ int bt_mesh_prov_auth(bool is_provisioner, uint8_t method, uint8_t action, uint8 case AUTH_METHOD_INPUT: input = input_action(action); - err = check_input_auth(input, size); - if (err) { - return err; - } if (!is_provisioner) { + err = check_input_auth(input, size); + if (err) { + return err; + } + if (input == BT_MESH_ENTER_STRING) { atomic_set_bit(bt_mesh_prov_link.flags, WAIT_STRING); } else { From f75fb11282e161a68ab09be5399eb82a7e4bd6fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1122/3334] Revert "[nrf fromtree] doc: release: Add Bluetooth ANS service to 4.4 release notes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a954a5383ee57bf90203d677a126c0de1b95a7eb. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.4.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index f413980e39ad..4cbcd6f9b217 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -64,12 +64,6 @@ New APIs and options .. zephyr-keep-sorted-start re(^\* \w) -* Bluetooth - - * Services - - * Introduced Alert Notification Service (ANS) :kconfig:option:`CONFIG_BT_ANS` - * Flash * :dtcompatible:`jedec,mspi-nor` now allows MSPI configuration of read, write and @@ -102,8 +96,6 @@ New Drivers New Samples *********** -* :zephyr:code-sample:`ble_peripheral_ans` - .. Same as above, this will also be recomputed at the time of the release. Just link the sample, further details go in the sample documentation itself. From 0559afdaf85cd9059a2bf3231d11cc4cb0c56419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1123/3334] Revert "[nrf fromtree] bluetooth: ANS: Add Alert Notification Service" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2d624e2e81f10ef53bbd110c506bc523c777455e. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/services/ans.h | 136 ----- .../bluetooth/peripheral_ans/CMakeLists.txt | 9 - samples/bluetooth/peripheral_ans/README.rst | 26 - samples/bluetooth/peripheral_ans/prj.conf | 9 - samples/bluetooth/peripheral_ans/sample.yaml | 15 - samples/bluetooth/peripheral_ans/src/main.c | 128 ----- subsys/bluetooth/services/CMakeLists.txt | 1 - subsys/bluetooth/services/Kconfig | 2 - subsys/bluetooth/services/Kconfig.ans | 86 --- subsys/bluetooth/services/ans.c | 489 ------------------ 10 files changed, 901 deletions(-) delete mode 100644 include/zephyr/bluetooth/services/ans.h delete mode 100644 samples/bluetooth/peripheral_ans/CMakeLists.txt delete mode 100644 samples/bluetooth/peripheral_ans/README.rst delete mode 100644 samples/bluetooth/peripheral_ans/prj.conf delete mode 100644 samples/bluetooth/peripheral_ans/sample.yaml delete mode 100644 samples/bluetooth/peripheral_ans/src/main.c delete mode 100644 subsys/bluetooth/services/Kconfig.ans delete mode 100644 subsys/bluetooth/services/ans.c diff --git a/include/zephyr/bluetooth/services/ans.h b/include/zephyr/bluetooth/services/ans.h deleted file mode 100644 index aec1ea7c2af2..000000000000 --- a/include/zephyr/bluetooth/services/ans.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2025 Sean Kyer - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_ANS_H_ -#define ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_ANS_H_ - -/** - * @brief Alert Notification Service (ANS) - * @defgroup bt_ans Alert Notification Service (ANS) - * - * @since 4.4 - * @version 0.1.0 - * - * @ingroup bluetooth - * @{ - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Command not supported error code - */ -#define BT_ANS_ERR_CMD_NOT_SUP 0xa0 - -/** - * @brief ANS max text string size in octets - * - * This is the max string size in octets to be saved in a New Alert. Text longer than the max is - * truncated. - * - * section 3.165 of - * https://btprodspecificationrefs.blob.core.windows.net/gatt-specification-supplement/GATT_Specification_Supplement.pdf - * - */ -#define BT_ANS_MAX_TEXT_STR_SIZE 18 - -/** - * @brief ANS Category ID Enum - * - * Enumeration for whether the category is supported. - */ -enum bt_ans_cat { - BT_ANS_CAT_SIMPLE_ALERT, /**< Simple alerts (general notifications). */ - BT_ANS_CAT_EMAIL, /**< Email messages. */ - BT_ANS_CAT_NEWS, /**< News updates. */ - BT_ANS_CAT_CALL, /**< Incoming call alerts. */ - BT_ANS_CAT_MISSED_CALL, /**< Missed call alerts. */ - BT_ANS_CAT_SMS_MMS, /**< SMS/MMS text messages. */ - BT_ANS_CAT_VOICE_MAIL, /**< Voicemail notifications. */ - BT_ANS_CAT_SCHEDULE, /**< Calendar or schedule alerts. */ - BT_ANS_CAT_HIGH_PRI_ALERT, /**< High-priority alerts. */ - BT_ANS_CAT_INSTANT_MESSAGE, /**< Instant messaging alerts. */ - - /** @cond INTERNAL_HIDDEN */ - BT_ANS_CAT_NUM, /**< Marker for the number of categories. */ - /** @endcond */ - - /* 10–15 reserved for future use */ -}; - -/** - * @brief Set the support for a given new alert category - * - * @param mask The bitmask of supported categories - * - * @return 0 on success - * @return negative error codes on failure - */ -int bt_ans_set_new_alert_support_category(uint16_t mask); - -/** - * @brief Set the support for a given unread new alert category - * - * @param mask The bitmask of supported categories - * - * @return 0 on success - * @return negative error codes on failure - */ -int bt_ans_set_unread_support_category(uint16_t mask); - -/** - * @brief Send a new alert to remote devices - * - * The new alert is transmitted to the remote devices if notifications are enabled. Each category - * will save the latest call to this function in case an immediate replay is requested via the ANS - * control point. - * - * @note This function waits on a Mutex with @ref K_FOREVER to ensure atomic updates to notification - * structs. To avoid deadlocks, do not call this function in BT RX or System Workqueue threads. - * - * @param conn The connection object to send the alert to - * @param category The category the notification is for - * @param num_new Number of new alerts since last alert - * @param text Text brief of alert, null terminated - * - * @return 0 on success - * @return negative error codes on failure - */ -int bt_ans_notify_new_alert(struct bt_conn *conn, enum bt_ans_cat category, uint8_t num_new, - const char *text); - -/** - * @brief Set the total unread count for a given category - * - * The unread count is transmitted to the remote devices if notifications are enabled. Each category - * will save the latest call to this function in case an immediate replay is requested via the ANS - * control point. - * - * @note This function waits on a Mutex with @ref K_FOREVER to ensure atomic updates to notification - * structs. To avoid deadlocks, do not call this function in BT RX or System Workqueue threads. - * - * @param conn The connection object to send the alert to - * @param category The category the unread count is for - * @param unread Total number of unread alerts - * - * @return 0 on success - * @return negative error codes on failure - */ -int bt_ans_set_unread_count(struct bt_conn *conn, enum bt_ans_cat category, uint8_t unread); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_ANS_H_ */ diff --git a/samples/bluetooth/peripheral_ans/CMakeLists.txt b/samples/bluetooth/peripheral_ans/CMakeLists.txt deleted file mode 100644 index 7bbc26196724..000000000000 --- a/samples/bluetooth/peripheral_ans/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(peripheral_ans) - -target_sources(app PRIVATE - src/main.c -) diff --git a/samples/bluetooth/peripheral_ans/README.rst b/samples/bluetooth/peripheral_ans/README.rst deleted file mode 100644 index 409de9716a3a..000000000000 --- a/samples/bluetooth/peripheral_ans/README.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. zephyr:code-sample:: ble_peripheral_ans - :name: Peripheral ANS - :relevant-api: bluetooth - - Send notification using Alert Notification Service (ANS). - -Overview -******** - -This sample demonstrates the usage of ANS by acting as a peripheral periodically sending -notifications to the connected remote device. - -Requirements -************ - -* A board with Bluetooth LE support -* Smartphone with Bluetooth LE app (ADI Attach, nRF Connect, etc.) or dedicated Bluetooth LE sniffer - -Building and Running -******************** - -To start receiving alerts over the connection, refer to -`GATT Specification Supplement `_ -section 3.12 for byte array to enable/disable notifications and control the service. - -See :zephyr:code-sample-category:`bluetooth` samples for details. diff --git a/samples/bluetooth/peripheral_ans/prj.conf b/samples/bluetooth/peripheral_ans/prj.conf deleted file mode 100644 index 3778ea08025b..000000000000 --- a/samples/bluetooth/peripheral_ans/prj.conf +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG_LOG=y -CONFIG_UTF8=y -CONFIG_BT=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_HCI_ERR_TO_STR=y -CONFIG_BT_DEVICE_NAME="Zephyr Peripheral ANS Sample" -CONFIG_BT_ANS=y -CONFIG_BT_ANS_LOG_LEVEL_DBG=y -CONFIG_BT_ANS_NALRT_CAT_SIMPLE_ALERT=y diff --git a/samples/bluetooth/peripheral_ans/sample.yaml b/samples/bluetooth/peripheral_ans/sample.yaml deleted file mode 100644 index e8ceff732c48..000000000000 --- a/samples/bluetooth/peripheral_ans/sample.yaml +++ /dev/null @@ -1,15 +0,0 @@ -sample: - name: Bluetooth Peripheral ANS - description: Demonstrates the Alert Notification Service (ANS) -tests: - sample.bluetooth.peripheral_ans: - harness: bluetooth - platform_allow: - - qemu_cortex_m3 - - qemu_x86 - - nrf52840dk/nrf52840 - integration_platforms: - - qemu_cortex_m3 - - qemu_x86 - - nrf52840dk/nrf52840 - tags: bluetooth diff --git a/samples/bluetooth/peripheral_ans/src/main.c b/samples/bluetooth/peripheral_ans/src/main.c deleted file mode 100644 index 9e76ef612072..000000000000 --- a/samples/bluetooth/peripheral_ans/src/main.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2025 Sean Kyer - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -LOG_MODULE_REGISTER(peripheral_ans, CONFIG_LOG_DEFAULT_LEVEL); - -/* - * Sample loops forever, incrementing number of new and unread notifications. Number of new and - * unread notifications will overflow and loop back around. - */ -static uint8_t num_unread; -static uint8_t num_new; - -static const struct bt_data ad[] = { - BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), - BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(BT_UUID_ANS_VAL))}; - -static const struct bt_data sd[] = { - BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1), -}; - -static void connected(struct bt_conn *conn, uint8_t err) -{ - if (err != 0) { - LOG_ERR("Connection failed, err 0x%02x %s", err, bt_hci_err_to_str(err)); - return; - } - - LOG_INF("Connected"); -} - -static void disconnected(struct bt_conn *conn, uint8_t reason) -{ - LOG_INF("Disconnected, reason 0x%02x %s", reason, bt_hci_err_to_str(reason)); -} - -static void start_adv(void) -{ - int err; - - err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd)); - if (err != 0) { - LOG_ERR("Advertising failed to start (err %d)", err); - return; - } - - LOG_INF("Advertising successfully started"); -} - -BT_CONN_CB_DEFINE(conn_callbacks) = { - .connected = connected, - .disconnected = disconnected, - .recycled = start_adv, -}; - -int main(void) -{ - int ret; - - LOG_INF("Sample - Bluetooth Peripheral ANS"); - - ret = bt_enable(NULL); - if (ret != 0) { - LOG_ERR("Failed to enable bluetooth: %d", ret); - return ret; - } - - start_adv(); - - num_unread = 0; - num_new = 0; - - /* At runtime, enable support for given categories */ - uint16_t new_alert_mask = (1 << BT_ANS_CAT_SIMPLE_ALERT) | (1 << BT_ANS_CAT_HIGH_PRI_ALERT); - uint16_t unread_mask = 1 << BT_ANS_CAT_SIMPLE_ALERT; - - ret = bt_ans_set_new_alert_support_category(new_alert_mask); - if (ret != 0) { - LOG_ERR("Unable to set new alert support category mask! (err: %d)", ret); - } - - ret = bt_ans_set_unread_support_category(unread_mask); - if (ret != 0) { - LOG_ERR("Unable to set unread support category mask! (err: %d)", ret); - } - - while (true) { - static const char test_msg[] = "Test Alert!"; - static const char high_pri_msg[] = "Prio Alert!"; - - num_new++; - - ret = bt_ans_notify_new_alert(NULL, BT_ANS_CAT_SIMPLE_ALERT, num_new, test_msg); - if (ret != 0) { - LOG_ERR("Failed to push new alert! (err: %d)", ret); - } - k_sleep(K_SECONDS(1)); - - ret = bt_ans_notify_new_alert(NULL, BT_ANS_CAT_HIGH_PRI_ALERT, num_new, - high_pri_msg); - if (ret != 0) { - LOG_ERR("Failed to push new alert! (err: %d)", ret); - } - k_sleep(K_SECONDS(1)); - - ret = bt_ans_set_unread_count(NULL, BT_ANS_CAT_SIMPLE_ALERT, num_unread); - if (ret != 0) { - LOG_ERR("Failed to push new unread count! (err: %d)", ret); - } - - num_unread++; - - k_sleep(K_SECONDS(5)); - } - - return 0; -} diff --git a/subsys/bluetooth/services/CMakeLists.txt b/subsys/bluetooth/services/CMakeLists.txt index f17f683d7186..bb69916e301a 100644 --- a/subsys/bluetooth/services/CMakeLists.txt +++ b/subsys/bluetooth/services/CMakeLists.txt @@ -1,6 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_sources_ifdef(CONFIG_BT_ANS ans.c) zephyr_sources_ifdef(CONFIG_BT_DIS dis.c) diff --git a/subsys/bluetooth/services/Kconfig b/subsys/bluetooth/services/Kconfig index cad7dc5a7258..a57d4998f380 100644 --- a/subsys/bluetooth/services/Kconfig +++ b/subsys/bluetooth/services/Kconfig @@ -6,8 +6,6 @@ menu "GATT Services" depends on BT_CONN -rsource "Kconfig.ans" - rsource "Kconfig.dis" rsource "Kconfig.cts" diff --git a/subsys/bluetooth/services/Kconfig.ans b/subsys/bluetooth/services/Kconfig.ans deleted file mode 100644 index e54adb0f76e5..000000000000 --- a/subsys/bluetooth/services/Kconfig.ans +++ /dev/null @@ -1,86 +0,0 @@ -# Bluetooth GATT Alert Notification Service - -# Copyright (c) 2025 Sean Kyer -# -# SPDX-License-Identifier: Apache-2.0 - -menuconfig BT_ANS - bool "GATT Alert Notification Service [EXPERIMENTAL]" - depends on UTF8 - select EXPERIMENTAL - -if BT_ANS - -module = BT_ANS -module-str = Alert Notification Service (ANS) -source "subsys/logging/Kconfig.template.log_config" - -menu "New Alert Categories" - -config BT_ANS_NALRT_CAT_SIMPLE_ALERT - bool "Support Simple Alert" - -config BT_ANS_NALRT_CAT_EMAIL - bool "Support Email" - -config BT_ANS_NALRT_CAT_NEWS - bool "Support News" - -config BT_ANS_NALRT_CAT_CALL - bool "Support Call" - -config BT_ANS_NALRT_CAT_MISSED_CALL - bool "Support Missed Call" - -config BT_ANS_NALRT_CAT_SMS_MMS - bool "Support SMS/MMS" - -config BT_ANS_NALRT_CAT_VOICE_MAIL - bool "Support Voice Mail" - -config BT_ANS_NALRT_CAT_SCHEDULE - bool "Support Schedule" - -config BT_ANS_NALRT_CAT_HIGH_PRI_ALERT - bool "Support High Priority Alert" - -config BT_ANS_NALRT_CAT_INSTANT_MESSAGE - bool "Support Instant Message" - -endmenu - -menu "Unread Alert Categories" - -config BT_ANS_UNALRT_CAT_SIMPLE_ALERT - bool "Support Simple Alert" - -config BT_ANS_UNALRT_CAT_EMAIL - bool "Support Email" - -config BT_ANS_UNALRT_CAT_NEWS - bool "Support News" - -config BT_ANS_UNALRT_CAT_CALL - bool "Support Call" - -config BT_ANS_UNALRT_CAT_MISSED_CALL - bool "Support Missed Call" - -config BT_ANS_UNALRT_CAT_SMS_MMS - bool "Support SMS/MMS" - -config BT_ANS_UNALRT_CAT_VOICE_MAIL - bool "Support Voice Mail" - -config BT_ANS_UNALRT_CAT_SCHEDULE - bool "Support Schedule" - -config BT_ANS_UNALRT_CAT_HIGH_PRI_ALERT - bool "Support High Priority Alert" - -config BT_ANS_UNALRT_CAT_INSTANT_MESSAGE - bool "Support Instant Message" - -endmenu - -endif # BT_ANS diff --git a/subsys/bluetooth/services/ans.c b/subsys/bluetooth/services/ans.c deleted file mode 100644 index 418c90bc1141..000000000000 --- a/subsys/bluetooth/services/ans.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Copyright (c) 2025 Sean Kyer - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * https://www.bluetooth.com/specifications/specs/alert-notification-service-1-0/ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -LOG_MODULE_REGISTER(bt_ans, CONFIG_BT_ANS_LOG_LEVEL); - -/* - * This only enforces a necessary lower bound at build time. It does - * not guarantee that notification/transmit operations will never fail at - * runtime because other subsystems/services can hold outstanding ATT - * buffers concurrently. - */ -BUILD_ASSERT(CONFIG_BT_MAX_CONN <= CONFIG_BT_ATT_TX_COUNT, - "CONFIG_BT_ATT_TX_COUNT must be >= CONFIG_BT_MAX_CONN"); - -/* Build time ANS supported category bit mask */ -#define BT_ANS_NALRT_CAT_MASK \ - ((IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_SIMPLE_ALERT) << BT_ANS_CAT_SIMPLE_ALERT) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_EMAIL) << BT_ANS_CAT_EMAIL) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_NEWS) << BT_ANS_CAT_NEWS) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_CALL) << BT_ANS_CAT_CALL) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_MISSED_CALL) << BT_ANS_CAT_MISSED_CALL) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_SMS_MMS) << BT_ANS_CAT_SMS_MMS) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_VOICE_MAIL) << BT_ANS_CAT_VOICE_MAIL) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_SCHEDULE) << BT_ANS_CAT_SCHEDULE) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_HIGH_PRI_ALERT) << BT_ANS_CAT_HIGH_PRI_ALERT) | \ - (IS_ENABLED(CONFIG_BT_ANS_NALRT_CAT_INSTANT_MESSAGE) << BT_ANS_CAT_INSTANT_MESSAGE)) - -/* Build time ANS supported category bit mask */ -#define BT_ANS_UNALRT_CAT_MASK \ - ((IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_SIMPLE_ALERT) << BT_ANS_CAT_SIMPLE_ALERT) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_EMAIL) << BT_ANS_CAT_EMAIL) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_NEWS) << BT_ANS_CAT_NEWS) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_CALL) << BT_ANS_CAT_CALL) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_MISSED_CALL) << BT_ANS_CAT_MISSED_CALL) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_SMS_MMS) << BT_ANS_CAT_SMS_MMS) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_VOICE_MAIL) << BT_ANS_CAT_VOICE_MAIL) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_SCHEDULE) << BT_ANS_CAT_SCHEDULE) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_HIGH_PRI_ALERT) << BT_ANS_CAT_HIGH_PRI_ALERT) | \ - (IS_ENABLED(CONFIG_BT_ANS_UNALRT_CAT_INSTANT_MESSAGE) << BT_ANS_CAT_INSTANT_MESSAGE)) - -/* As per spec, ensure at least one New Alert category is supported */ -BUILD_ASSERT(BT_ANS_NALRT_CAT_MASK != 0, - "At least one ANS New Alert category must be enabled in Kconfig"); - -static uint16_t alert_sup_cat_bit_mask = BT_ANS_NALRT_CAT_MASK; -static uint16_t unread_sup_cat_bit_mask = BT_ANS_UNALRT_CAT_MASK; - -/* Command ID definitions */ -#define BT_ANS_SEND_ALL_CATEGORY 0xFF -enum bt_ans_command_id { - BT_ANS_CTRL_ENABLE_NEW_ALERT, - BT_ANS_CTRL_ENABLE_UNREAD, - BT_ANS_CTRL_DISABLE_NEW_ALERT, - BT_ANS_CTRL_DISABLE_UNREAD, - BT_ANS_CTRL_NOTIFY_NEW_ALERT_IMMEDIATE, - BT_ANS_CTRL_NOTIFY_UNREAD_IMMEDIATE, -}; - -/* Struct definition for Alert Notification Control Point */ -struct alert_ctrl_p { - uint8_t cmd_id; - uint8_t category; -} __packed; - -/* Struct definition for New Alert */ -struct new_alert { - uint8_t category_id; - uint8_t num_new_alerts; - char text_string[BT_ANS_MAX_TEXT_STR_SIZE + 1]; -} __packed; - -/* Struct definition for Unread Alert */ -struct unread_alert_status { - uint8_t category_id; - uint8_t unread_count; -} __packed; - -/* Mutex for modifying database */ -K_MUTEX_DEFINE(new_alert_mutex); -K_MUTEX_DEFINE(unread_mutex); - -/* Saved messages database */ -static struct new_alert new_alerts[BT_ANS_CAT_NUM]; -static struct unread_alert_status unread_alerts[BT_ANS_CAT_NUM]; - -/* Initialize to 0, it is control point responsibility to enable once connected */ -static uint16_t alert_cat_enabled_map; -static uint16_t unread_cat_enabled_map; - -/* Supported New Alert Category */ -static ssize_t read_supp_new_alert_cat(struct bt_conn *conn, const struct bt_gatt_attr *attr, - void *buf, uint16_t len, uint16_t offset) -{ - LOG_DBG("Supported New Alert Category Read"); - - /* Return the bit mask of the supported categories */ - return bt_gatt_attr_read(conn, attr, buf, len, offset, &alert_sup_cat_bit_mask, - sizeof(alert_sup_cat_bit_mask)); -} - -/* New Alert Notifications */ -static void new_alert_ccc_cfg_changed(const struct bt_gatt_attr *attr, uint16_t value) -{ - ARG_UNUSED(attr); - - LOG_DBG("New Alert Notifications %s", value == BT_GATT_CCC_NOTIFY ? "enabled" : "disabled"); -} - -/* Supported Unread Alert Category*/ -static ssize_t read_supp_unread_alert_cat(struct bt_conn *conn, const struct bt_gatt_attr *attr, - void *buf, uint16_t len, uint16_t offset) -{ - LOG_DBG("Supported Unread Alert Category Read"); - - return bt_gatt_attr_read(conn, attr, buf, len, offset, &unread_sup_cat_bit_mask, - sizeof(unread_sup_cat_bit_mask)); -} - -/* Unread Alert Status Notifications */ -static void unread_alert_status_ccc_cfg_changed(const struct bt_gatt_attr *attr, uint16_t value) -{ - ARG_UNUSED(attr); - - LOG_DBG("Unread Alert Status Notifications %s", - value == BT_GATT_CCC_NOTIFY ? "enabled" : "disabled"); -} - -/* Alert Notification Control Point */ -static int transmit_new_alert(struct bt_conn *conn, enum bt_ans_cat category); -static int transmit_unread_alert(struct bt_conn *conn, enum bt_ans_cat category); -static ssize_t write_alert_notif_ctrl_point(struct bt_conn *conn, const struct bt_gatt_attr *attr, - const void *buf, uint16_t len, uint16_t offset, - uint8_t flags) -{ - int rc; - - LOG_DBG("Alert Control Point Written %u", len); - - if (len != sizeof(struct alert_ctrl_p)) { - LOG_DBG("Length of control packet is %u when expected %zu", len, - sizeof(struct alert_ctrl_p)); - return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); - } - - struct alert_ctrl_p command = *((const struct alert_ctrl_p *)buf); - - LOG_DBG("Command ID 0x%x", command.cmd_id); - LOG_DBG("Category 0x%x", command.category); - - if (command.category >= BT_ANS_CAT_NUM && command.category != BT_ANS_SEND_ALL_CATEGORY) { - LOG_DBG("Received control point request for category out of bounds: %d", - command.category); - return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); - } - - /* - * If category is BT_ANS_SEND_ALL_CATEGORY then only BT_ANS_CTRL_NOTIFY_NEW_ALERT_IMMEDIATE - * or BT_ANS_CTRL_NOTIFY_UNREAD_IMMEDIATE are valid command IDs - */ - if (command.category == BT_ANS_SEND_ALL_CATEGORY) { - switch (command.cmd_id) { - case BT_ANS_CTRL_NOTIFY_NEW_ALERT_IMMEDIATE: - rc = transmit_new_alert(conn, command.category); - return rc ? BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP) : len; - case BT_ANS_CTRL_NOTIFY_UNREAD_IMMEDIATE: - rc = transmit_unread_alert(conn, command.category); - return rc ? BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP) : len; - default: - return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); - } - } - - switch (command.cmd_id) { - case BT_ANS_CTRL_ENABLE_NEW_ALERT: - if ((alert_sup_cat_bit_mask & (1U << command.category)) == 0) { - LOG_DBG("Received control point request for unsupported category: " - "%d", - command.category); - return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); - } - alert_cat_enabled_map |= (1U << command.category); - break; - case BT_ANS_CTRL_ENABLE_UNREAD: - if ((unread_sup_cat_bit_mask & (1U << command.category)) == 0) { - LOG_DBG("Received control point request for unsupported category: " - "%d", - command.category); - return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); - } - unread_cat_enabled_map |= (1U << command.category); - break; - case BT_ANS_CTRL_DISABLE_NEW_ALERT: - if ((alert_sup_cat_bit_mask & (1U << command.category)) == 0) { - LOG_DBG("Received control point request for unsupported category: " - "%d", - command.category); - - return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); - } - alert_cat_enabled_map &= ~(1U << command.category); - break; - case BT_ANS_CTRL_DISABLE_UNREAD: - if ((unread_sup_cat_bit_mask & (1U << command.category)) == 0) { - LOG_DBG("Received control point request for unsupported category: " - "%d", - command.category); - return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); - } - unread_cat_enabled_map &= ~(1U << command.category); - break; - default: - return BT_GATT_ERR(BT_ANS_ERR_CMD_NOT_SUP); - } - - return len; -} - -static int ans_init(void) -{ - for (int i = 0; i < BT_ANS_CAT_NUM; i++) { - new_alerts[i].category_id = i; - unread_alerts[i].category_id = i; - } - - LOG_INF("ANS initialization complete"); - - return 0; -} - -/* Alert Notification Service Declaration */ -BT_GATT_SERVICE_DEFINE( - ans_svc, BT_GATT_PRIMARY_SERVICE(BT_UUID_ANS), - BT_GATT_CHARACTERISTIC(BT_UUID_GATT_SNALRTC, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, - read_supp_new_alert_cat, NULL, NULL), - BT_GATT_CHARACTERISTIC(BT_UUID_GATT_NALRT, BT_GATT_CHRC_NOTIFY, BT_GATT_PERM_NONE, NULL, - NULL, NULL), - BT_GATT_CCC(new_alert_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), - BT_GATT_CHARACTERISTIC(BT_UUID_GATT_SUALRTC, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, - read_supp_unread_alert_cat, NULL, NULL), - BT_GATT_CHARACTERISTIC(BT_UUID_GATT_UALRTS, BT_GATT_CHRC_NOTIFY, BT_GATT_PERM_NONE, NULL, - NULL, NULL), - BT_GATT_CCC(unread_alert_status_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), - BT_GATT_CHARACTERISTIC(BT_UUID_GATT_ALRTNCP, BT_GATT_CHRC_WRITE, BT_GATT_PERM_WRITE, NULL, - write_alert_notif_ctrl_point, NULL)); - -/* Helper to notify a single category */ -static int notify_new_alert_category(struct bt_conn *conn, uint8_t cat) -{ - int rc; - int ret; - - ret = k_mutex_lock(&new_alert_mutex, K_NO_WAIT); - if (ret != 0) { - LOG_ERR("Unable to lock mutex (err: %d)", ret); - return -EAGAIN; - } - - rc = bt_gatt_notify_uuid(conn, BT_UUID_GATT_NALRT, ans_svc.attrs, &new_alerts[cat], - sizeof(struct new_alert)); - - ret = k_mutex_unlock(&new_alert_mutex); - __ASSERT(ret == 0, "Unable to unlock mutex (err: %d)", ret); - - /* If the client is not connected, that is fine */ - if (rc != 0 && rc != -ENOTCONN) { - LOG_DBG("Error notifying New Alert category %d rc: %d", cat, rc); - return rc; - } - - return 0; -} - -/* Transmit New Alert */ -static int transmit_new_alert(struct bt_conn *conn, enum bt_ans_cat category) -{ - int rc; - - uint8_t cat_in = (uint8_t)category; - - /* Nothing to do if notify is disabled */ - if (conn != NULL && !bt_gatt_is_subscribed(conn, &ans_svc.attrs[3], BT_GATT_CCC_NOTIFY)) { - return 0; - } - - /* Special case: send all categories */ - if (cat_in == BT_ANS_SEND_ALL_CATEGORY) { - for (int i = 0; i < BT_ANS_CAT_NUM; i++) { - if (((alert_sup_cat_bit_mask & BIT(i)) != 0) && - ((alert_cat_enabled_map & BIT(i)) != 0)) { - rc = notify_new_alert_category(conn, i); - if (rc < 0) { - return rc; - } - } - } - return 0; - } - - /* Otherwise send just the requested category (if enabled) */ - if ((alert_cat_enabled_map & BIT(cat_in)) != 0) { - return notify_new_alert_category(conn, cat_in); - } - - return 0; -} - -/* Helper to notify a single unread alert category */ -static int notify_unread_alert_category(struct bt_conn *conn, uint8_t cat) -{ - int rc; - int ret; - - ret = k_mutex_lock(&unread_mutex, K_NO_WAIT); - if (ret != 0) { - LOG_ERR("Unable to lock mutex (err: %d)", ret); - return -EAGAIN; - } - - rc = bt_gatt_notify_uuid(conn, BT_UUID_GATT_UALRTS, ans_svc.attrs, &unread_alerts[cat], - sizeof(struct unread_alert_status)); - - ret = k_mutex_unlock(&unread_mutex); - __ASSERT(ret == 0, "Unable to unlock mutex (err: %d)", ret); - - /* If the client is not connected, that is fine */ - if (rc != 0 && rc != -ENOTCONN) { - LOG_DBG("Error notifying Unread Alert category %d rc: %d", cat, rc); - return rc; - } - - return 0; -} - -/* Transmit Unread Alert */ -static int transmit_unread_alert(struct bt_conn *conn, enum bt_ans_cat category) -{ - int rc; - - uint8_t cat_in = (uint8_t)category; - - /* Nothing to do if notify is disabled */ - if (conn != NULL && !bt_gatt_is_subscribed(conn, &ans_svc.attrs[6], BT_GATT_CCC_NOTIFY)) { - return 0; - } - - /* Special case: send all categories */ - if (cat_in == BT_ANS_SEND_ALL_CATEGORY) { - for (int i = 0; i < BT_ANS_CAT_NUM; i++) { - if ((unread_sup_cat_bit_mask & BIT(i)) && - (unread_cat_enabled_map & BIT(i))) { - rc = notify_unread_alert_category(conn, i); - if (rc < 0) { - return rc; - } - } - } - return 0; - } - - /* Otherwise send just the requested category (if enabled) */ - if ((unread_cat_enabled_map & BIT(cat_in)) != 0) { - return notify_unread_alert_category(conn, cat_in); - } - - return 0; -} - -int bt_ans_notify_new_alert(struct bt_conn *conn, enum bt_ans_cat category, uint8_t num_new, - const char *text) -{ - int ret; - - uint8_t cat_in = (uint8_t)category; - - /* Check if the category is supported */ - if ((alert_sup_cat_bit_mask & (1U << cat_in)) == 0) { - LOG_DBG("Category %d unsupported", cat_in); - return -EINVAL; - } - - /* Update the saved value */ - ret = k_mutex_lock(&new_alert_mutex, K_FOREVER); - __ASSERT(ret == 0, "Unable to lock mutex (err: %d)", ret); - new_alerts[cat_in].num_new_alerts = num_new; - utf8_lcpy(new_alerts[cat_in].text_string, text, sizeof(new_alerts[cat_in].text_string)); - ret = k_mutex_unlock(&new_alert_mutex); - __ASSERT(ret == 0, "Unable to unlock mutex (err: %d)", ret); - - return transmit_new_alert(conn, category); -} - -int bt_ans_set_unread_count(struct bt_conn *conn, enum bt_ans_cat category, uint8_t unread) -{ - int ret; - - uint8_t cat_in = (uint8_t)category; - - /* Check if the category is supported */ - if ((unread_sup_cat_bit_mask & (1U << cat_in)) == 0) { - LOG_DBG("Category %d unsupported", cat_in); - return -EINVAL; - } - - /* Update the saved value */ - ret = k_mutex_lock(&unread_mutex, K_FOREVER); - __ASSERT(ret == 0, "Unable to lock mutex (err: %d)", ret); - unread_alerts[cat_in].unread_count = unread; - ret = k_mutex_unlock(&unread_mutex); - __ASSERT(ret == 0, "Unable to unlock mutex (err: %d)", ret); - - return transmit_unread_alert(conn, category); -} - -/* Callback used by bt_conn_foreach() to detect an established connection. */ -static void ans_conn_check_cb(struct bt_conn *conn, void *data) -{ - int err; - bool *has_conn = data; - struct bt_conn_info info; - - err = bt_conn_get_info(conn, &info); - if (err == 0 && info.state == BT_CONN_STATE_CONNECTED) { - *has_conn = true; - } -} - -/* Used to check if an active connect exists, stopping modifications to supported features */ -static bool ans_check_conn_busy(void) -{ - bool has_conn = false; - - bt_conn_foreach(BT_CONN_TYPE_ALL, ans_conn_check_cb, &has_conn); - - if (has_conn) { - /* Cannot change support while connection exists */ - return true; - } - - return false; -} - -int bt_ans_set_new_alert_support_category(uint16_t mask) -{ - if (ans_check_conn_busy()) { - /* Cannot change support while connection exists */ - return -EBUSY; - } - - alert_sup_cat_bit_mask = mask; - - LOG_DBG("New Alert Support Bit Mask: %x", alert_sup_cat_bit_mask); - - return 0; -} - -int bt_ans_set_unread_support_category(uint16_t mask) -{ - if (ans_check_conn_busy()) { - /* Cannot change support while connection exists */ - return -EBUSY; - } - - unread_sup_cat_bit_mask = mask; - - LOG_DBG("Unread Support Bit Mask: %x", unread_sup_cat_bit_mask); - - return 0; -} - -SYS_INIT(ans_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); From 9cdc9966ed3bb1a96355aed69c61826898fa3e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1124/3334] Revert "[nrf fromtree] doc: release: Note changes to flash_mspi_nor" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 444980e1bf478cdcd2860e53f094044f18db4436. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.4.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 4cbcd6f9b217..57f3147e570d 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -64,10 +64,6 @@ New APIs and options .. zephyr-keep-sorted-start re(^\* \w) -* Flash - - * :dtcompatible:`jedec,mspi-nor` now allows MSPI configuration of read, write and - control commands separately via devicetree. .. zephyr-keep-sorted-stop From 2aaff34cf0f6d2d26a5d0f69029ead2e63157ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1125/3334] Revert "[nrf fromtree] doc: releases: introduce release notes and migration guide docs for 4.4" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ac150d9b59b18248a198bb97efebaf7701fab650. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.4.rst | 48 ------------ doc/releases/release-notes-4.4.rst | 108 --------------------------- 2 files changed, 156 deletions(-) delete mode 100644 doc/releases/migration-guide-4.4.rst delete mode 100644 doc/releases/release-notes-4.4.rst diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst deleted file mode 100644 index b10c86e9f23b..000000000000 --- a/doc/releases/migration-guide-4.4.rst +++ /dev/null @@ -1,48 +0,0 @@ -:orphan: - -.. - See - https://docs.zephyrproject.org/latest/releases/index.html#migration-guides - for details of what is supposed to go into this document. - -.. _migration_4.4: - -Migration guide to Zephyr v4.4.0 (Working Draft) -################################################ - -This document describes the changes required when migrating your application from Zephyr v4.3.0 to -Zephyr v4.4.0. - -Any other changes (not directly related to migrating applications) can be found in -the :ref:`release notes`. - -.. contents:: - :local: - :depth: 2 - -Build System -************ - -Kernel -****** - -Boards -****** - -Device Drivers and Devicetree -***************************** - -Bluetooth -********* - -Networking -********** - -Other subsystems -**************** - -Modules -******* - -Architectures -************* diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst deleted file mode 100644 index 57f3147e570d..000000000000 --- a/doc/releases/release-notes-4.4.rst +++ /dev/null @@ -1,108 +0,0 @@ -:orphan: - -.. - What goes here: removed/deprecated apis, new boards, new drivers, notable - features. If you feel like something new can be useful to a user, put it - under "Other Enhancements" in the first paragraph, if you feel like something - is worth mentioning in the project media (release blog post, release - livestream) put it under "Major enhancement". -.. - If you are describing a feature or functionality, consider adding it to the - actual project documentation rather than the release notes, so that the - information does not get lost in time. -.. - No list of bugfixes, minor changes, those are already in the git log, this is - not a changelog. -.. - Does the entry have a link that contains the details? Just add the link, if - you think it needs more details, put them in the content that shows up on the - link. -.. - Are you thinking about generating this? Don't put anything at all. -.. - Does the thing require the user to change their application? Put it on the - migration guide instead. (TODO: move the removed APIs section in the - migration guide) - -.. _zephyr_4.4: - -Zephyr 4.4.0 (Working Draft) -############################ - -We are pleased to announce the release of Zephyr version 4.4.0. - -Major enhancements with this release include: - -An overview of the changes required or recommended when migrating your application from Zephyr -v4.3.0 to Zephyr v4.4.0 can be found in the separate :ref:`migration guide`. - -The following sections provide detailed lists of changes by component. - -Security Vulnerability Related -****************************** - -API Changes -*********** - -.. - Only removed, deprecated and new APIs. Changes go in migration guide. - -Removed APIs and options -======================== - -Deprecated APIs and options -=========================== - -New APIs and options -==================== - -.. - Link to new APIs here, in a group if you think it's necessary, no need to get - fancy just list the link, that should contain the documentation. If you feel - like you need to add more details, add them in the API documentation code - instead. - -.. zephyr-keep-sorted-start re(^\* \w) - - -.. zephyr-keep-sorted-stop - -New Boards -********** - -.. - You may update this list as you contribute a new board during the release cycle, in order to make - it visible to people who might be looking at the working draft of the release notes. However, note - that this list will be recomputed at the time of the release, so you don't *have* to update it. - In any case, just link the board, further details go in the board description. - -New Shields -*********** - -.. - Same as above, this will also be recomputed at the time of the release. - -New Drivers -*********** - -.. - Same as above, this will also be recomputed at the time of the release. - Just link the driver, further details go in the binding description - -New Samples -*********** - -.. - Same as above, this will also be recomputed at the time of the release. - Just link the sample, further details go in the sample documentation itself. - - -Libraries / Subsystems -********************** - -Other notable changes -********************* - -.. - Any more descriptive subsystem or driver changes. Do you really want to write - a paragraph or is it enough to link to the api/driver/Kconfig/board page above? From 4319c62b3c014eecadb86aad5ea5f07ae8f5c35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1126/3334] Revert "[nrf fromtree] tests: Bluetooth: tester: Removed bad guard in btp_gap.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fd5b547f5014825b3c9e7b0d30990eb69ea94005. Signed-off-by: Tomasz Moń --- tests/bluetooth/tester/src/btp/btp_gap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/bluetooth/tester/src/btp/btp_gap.h b/tests/bluetooth/tester/src/btp/btp_gap.h index 81c7ba723b6c..071c72f40b02 100644 --- a/tests/bluetooth/tester/src/btp/btp_gap.h +++ b/tests/bluetooth/tester/src/btp/btp_gap.h @@ -578,6 +578,7 @@ struct btp_gap_periodic_biginfo_ev { uint8_t encryption; } __packed; +#if defined(CONFIG_BT_EXT_ADV) struct bt_le_per_adv_param; struct bt_le_per_adv_sync_param; struct bt_le_adv_param; @@ -598,3 +599,4 @@ int tester_gap_padv_start(struct bt_le_ext_adv *ext_adv); int tester_gap_padv_stop(struct bt_le_ext_adv *ext_adv); int tester_gap_padv_create_sync(struct bt_le_per_adv_sync_param *create_params); int tester_gap_padv_stop_sync(void); +#endif /* defined(CONFIG_BT_EXT_ADV) */ From 5dbacf3de854b28cb7c71cfc82e9af32fb991941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1127/3334] Revert "[nrf fromtree] bluetooth: audio: scan_delegator: Fix validation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3c93492b22710c022038913732697aa5230b65ce. Signed-off-by: Tomasz Moń --- subsys/bluetooth/audio/bap_scan_delegator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 8c21b806900f..da07fab411c8 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -149,7 +149,7 @@ static bool bis_syncs_unique_or_no_pref(uint32_t requested_bis_syncs, return true; } - return (requested_bis_syncs & aggregated_bis_syncs) == 0U; + return (requested_bis_syncs & aggregated_bis_syncs) != 0U; } static bool valid_bis_sync_request(uint32_t requested_bis_syncs, uint32_t aggregated_bis_syncs) @@ -938,7 +938,8 @@ static int scan_delegator_mod_src(struct bt_conn *conn, bis_sync_change_requested = true; } - if (!valid_bis_sync_request(requested_bis_sync[i], aggregated_bis_syncs)) { + if (!valid_bis_sync_request(internal_state->requested_bis_sync[i], + aggregated_bis_syncs)) { LOG_DBG("Invalid BIS Sync request[%d]", i); ret = BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); goto unlock_return; From 06fcb80c0b06c347ea74354147341db96118bdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1128/3334] Revert "[nrf fromtree] tests: bluetooth: tester: Fix VCS tests" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bbbeeebd131522ce06e4e37961906ae8154da1d1. Signed-off-by: Tomasz Moń --- .../bluetooth/tester/src/audio/btp/btp_vcs.h | 9 --- tests/bluetooth/tester/src/audio/btp_vcp.c | 72 ++++++------------- .../tester/src/audio/vcp_peripheral.c | 1 - tests/bsim/bluetooth/tester/src/bsim_btp.c | 2 - tests/bsim/bluetooth/tester/src/bsim_btp.h | 21 ------ 5 files changed, 21 insertions(+), 84 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp/btp_vcs.h b/tests/bluetooth/tester/src/audio/btp/btp_vcs.h index 069b562c03d4..6f31afe020c8 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_vcs.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_vcs.h @@ -8,8 +8,6 @@ #include -#define BTP_VCS_REGISTER_FLAG_MUTED BIT(0) - #define BTP_VCS_READ_SUPPORTED_COMMANDS 0x01 struct btp_vcs_read_supported_commands_rp { uint8_t data[0]; @@ -24,10 +22,3 @@ struct btp_vcs_set_vol_cmd { #define BTP_VCS_VOL_DOWN 0x04 #define BTP_VCS_MUTE 0x05 #define BTP_VCS_UNMUTE 0x06 - -#define BTP_VCS_REGISTER 0x07 -struct btp_vcs_register_cmd { - uint8_t step; - uint8_t flags; - uint8_t volume; -} __packed; diff --git a/tests/bluetooth/tester/src/audio/btp_vcp.c b/tests/bluetooth/tester/src/audio/btp_vcp.c index ec78de2c0435..9205181a0db9 100644 --- a/tests/bluetooth/tester/src/audio/btp_vcp.c +++ b/tests/bluetooth/tester/src/audio/btp_vcp.c @@ -140,43 +140,6 @@ static uint8_t unmute(const void *cmd, uint16_t cmd_len, return BTP_STATUS_SUCCESS; } -static void set_register_params(uint8_t gain_mode, uint8_t step, - bool muted, uint8_t volume); - -static uint8_t register_vcs(const void *cmd, uint16_t cmd_len, - void *rsp, uint16_t *rsp_len) -{ - static bool vcs_registered_flag; - const struct btp_vcs_register_cmd *cp = cmd; - int err; - - LOG_DBG("Registering VCS"); - - if (vcs_registered_flag) { - return BTP_STATUS_FAILED; - } - - bool muted = (cp->flags & BTP_VCS_REGISTER_FLAG_MUTED) != 0; - - set_register_params(BT_AICS_MODE_MANUAL, cp->step, muted, cp->volume); - - err = bt_vcp_vol_rend_register(&vcp_register_param); - if (err != 0) { - return BTP_STATUS_FAILED; - } - - err = bt_vcp_vol_rend_included_get(&included); - if (err != 0) { - return BTP_STATUS_FAILED; - } - - aics_server_instance.aics_cnt = included.aics_cnt; - aics_server_instance.aics = included.aics; - vcs_registered_flag = true; - - return BTP_STATUS_SUCCESS; -} - static void vcs_state_cb(struct bt_conn *conn, int err, uint8_t volume, uint8_t mute) { LOG_DBG("VCP state cb err (%d)", err); @@ -224,11 +187,6 @@ static const struct btp_handler vcs_handlers[] = { .expect_len = 0, .func = unmute, }, - { - .opcode = BTP_VCS_REGISTER, - .expect_len = sizeof(struct btp_vcs_register_cmd), - .func = register_vcs, - }, }; /* Volume Offset Control Service */ @@ -505,8 +463,7 @@ struct bt_aics_cb aics_server_cb = { }; /* General profile handling */ -static void set_register_params(uint8_t gain_mode, uint8_t step, - bool muted, uint8_t volume) +static void set_register_params(uint8_t gain_mode) { char input_desc[CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT] [BT_AICS_MAX_INPUT_DESCRIPTION_SIZE]; @@ -538,18 +495,31 @@ static void set_register_params(uint8_t gain_mode, uint8_t step, vcp_register_param.aics_param[i].cb = &aics_server_cb; } - vcp_register_param.step = step; - if (muted) { - vcp_register_param.mute = BT_VCP_STATE_MUTED; - } else { - vcp_register_param.mute = BT_VCP_STATE_UNMUTED; - } - vcp_register_param.volume = volume; + vcp_register_param.step = 1; + vcp_register_param.mute = BT_VCP_STATE_UNMUTED; + vcp_register_param.volume = 100; vcp_register_param.cb = &vcs_cb; } uint8_t tester_init_vcs(void) { + int err; + + set_register_params(BT_AICS_MODE_MANUAL); + + err = bt_vcp_vol_rend_register(&vcp_register_param); + if (err) { + return BTP_STATUS_FAILED; + } + + err = bt_vcp_vol_rend_included_get(&included); + if (err) { + return BTP_STATUS_FAILED; + } + + aics_server_instance.aics_cnt = included.aics_cnt; + aics_server_instance.aics = included.aics; + tester_register_command_handlers(BTP_SERVICE_ID_VCS, vcs_handlers, ARRAY_SIZE(vcs_handlers)); diff --git a/tests/bsim/bluetooth/tester/src/audio/vcp_peripheral.c b/tests/bsim/bluetooth/tester/src/audio/vcp_peripheral.c index ef5a0efc2f1d..9fdfbcaf50ef 100644 --- a/tests/bsim/bluetooth/tester/src/audio/vcp_peripheral.c +++ b/tests/bsim/bluetooth/tester/src/audio/vcp_peripheral.c @@ -35,7 +35,6 @@ static void test_vcp_peripheral(void) bsim_btp_core_register(BTP_SERVICE_ID_AICS); bsim_btp_gap_set_discoverable(BTP_GAP_GENERAL_DISCOVERABLE); - bsim_btp_vcs_register(1U, 0U, 100U); bsim_btp_gap_start_advertising(0U, 0U, NULL, BT_HCI_OWN_ADDR_PUBLIC); bsim_btp_wait_for_gap_device_connected(&remote_addr); bt_addr_le_to_str(&remote_addr, addr_str, sizeof(addr_str)); diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.c b/tests/bsim/bluetooth/tester/src/bsim_btp.c index 2e24514b6606..d0516cfcaab5 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.c +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.c @@ -873,8 +873,6 @@ static bool is_valid_vcs_packet_len(const struct btp_hdr *hdr, struct net_buf_si return buf_simple->len == 0U; case BTP_VCS_UNMUTE: return buf_simple->len == 0U; - case BTP_VCS_REGISTER: - return buf_simple->len == 0U; /* no events */ default: diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.h b/tests/bsim/bluetooth/tester/src/bsim_btp.h index 2480076bc069..75198bf498eb 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.h +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.h @@ -563,27 +563,6 @@ static inline void bsim_btp_wait_for_tmap_discovery_complete(void) net_buf_unref(buf); } -static inline void bsim_btp_vcs_register(uint8_t step, uint8_t flags, uint8_t vol) -{ - struct btp_vcs_register_cmd *cmd; - struct btp_hdr *cmd_hdr; - - NET_BUF_SIMPLE_DEFINE(cmd_buffer, BTP_MTU); - - cmd_hdr = net_buf_simple_add(&cmd_buffer, sizeof(*cmd_hdr)); - cmd_hdr->service = BTP_SERVICE_ID_VCS; - cmd_hdr->opcode = BTP_VCS_REGISTER; - cmd_hdr->index = BTP_INDEX; - cmd = net_buf_simple_add(&cmd_buffer, sizeof(*cmd)); - cmd->step = step; - cmd->flags = flags; - cmd->volume = vol; - - cmd_hdr->len = sys_cpu_to_le16(cmd_buffer.len - sizeof(*cmd_hdr)); - - bsim_btp_send_to_tester(cmd_buffer.data, cmd_buffer.len); -} - static inline void bsim_btp_vcp_discover(const bt_addr_le_t *address) { struct btp_vcp_discover_cmd *cmd; From 6c204873b4504f4ec688cc71f47dd80e023678fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1129/3334] Revert "[nrf fromtree] tests: bluetooth: tester: CSIS: Add more commands" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit eafe31b0fb1371538167e262825b95eb9af7f840. Signed-off-by: Tomasz Moń --- tests/bluetooth/tester/overlay-le-audio.conf | 2 - .../bluetooth/tester/src/audio/btp/btp_csis.h | 11 ----- tests/bluetooth/tester/src/audio/btp_csis.c | 42 ------------------- 3 files changed, 55 deletions(-) diff --git a/tests/bluetooth/tester/overlay-le-audio.conf b/tests/bluetooth/tester/overlay-le-audio.conf index f6fb0e9c4094..30f609b9ace5 100644 --- a/tests/bluetooth/tester/overlay-le-audio.conf +++ b/tests/bluetooth/tester/overlay-le-audio.conf @@ -130,8 +130,6 @@ CONFIG_BT_HAS_CLIENT=y # CSIS CONFIG_BT_CSIP_SET_MEMBER=y CONFIG_BT_CSIP_SET_MEMBER_ENC_SIRK_SUPPORT=y -CONFIG_BT_CSIP_SET_MEMBER_SIRK_NOTIFIABLE=y -CONFIG_BT_CSIP_SET_MEMBER_SIZE_NOTIFIABLE=y # CSIP CONFIG_BT_CSIP_SET_COORDINATOR=y diff --git a/tests/bluetooth/tester/src/audio/btp/btp_csis.h b/tests/bluetooth/tester/src/audio/btp/btp_csis.h index 3f28e942414d..0f1255301281 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_csis.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_csis.h @@ -41,14 +41,3 @@ struct btp_csis_get_member_rsi_rp { struct btp_csis_sirk_set_type_cmd { uint8_t type; } __packed; - -#define BTP_CSIS_SET_SIRK 0x05 -struct btp_csis_set_sirk_cmd { - uint8_t sirk[BT_CSIP_SIRK_SIZE]; -} __packed; - -#define BTP_CSIS_SET_SET_SIZE 0x06 -struct btp_csis_set_set_size_cmd { - uint8_t set_size; - uint8_t rank; -} __packed; diff --git a/tests/bluetooth/tester/src/audio/btp_csis.c b/tests/bluetooth/tester/src/audio/btp_csis.c index 4e3662487684..c80242b4e7a6 100644 --- a/tests/bluetooth/tester/src/audio/btp_csis.c +++ b/tests/bluetooth/tester/src/audio/btp_csis.c @@ -90,38 +90,6 @@ static uint8_t csis_set_sirk_type(const void *cmd, uint16_t cmd_len, void *rsp, return BTP_STATUS_SUCCESS; } -static uint8_t csis_set_sirk(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) -{ - const struct btp_csis_set_sirk_cmd *cp = cmd; - int err = -ENOENT; - - LOG_DBG("Setting new SIRK"); - - if (csis_svc_inst != NULL) { - err = bt_csip_set_member_sirk(csis_svc_inst, cp->sirk); - } else { - LOG_DBG("No CSIS instance registered"); - } - - return BTP_STATUS_VAL(err); -} - -static uint8_t csis_set_set_size(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) -{ - const struct btp_csis_set_set_size_cmd *cp = cmd; - int err = -ENOENT; - - LOG_DBG("Setting new set size %u and rank %u", cp->set_size, cp->rank); - - if (csis_svc_inst != NULL) { - err = bt_csip_set_member_set_size_and_rank(csis_svc_inst, cp->set_size, cp->rank); - } else { - LOG_DBG("No CSIS instance registered"); - } - - return BTP_STATUS_VAL(err); -} - static const struct btp_handler csis_handlers[] = { { .opcode = BTP_CSIS_READ_SUPPORTED_COMMANDS, @@ -144,16 +112,6 @@ static const struct btp_handler csis_handlers[] = { .expect_len = sizeof(struct btp_csis_sirk_set_type_cmd), .func = csis_set_sirk_type, }, - { - .opcode = BTP_CSIS_SET_SIRK, - .expect_len = sizeof(struct btp_csis_set_sirk_cmd), - .func = csis_set_sirk, - }, - { - .opcode = BTP_CSIS_SET_SET_SIZE, - .expect_len = sizeof(struct btp_csis_set_set_size_cmd), - .func = csis_set_set_size, - }, }; static void lock_changed_cb(struct bt_conn *conn, struct bt_csip_set_member_svc_inst *svc_inst, From 1497495235ba335639c7dcc9dbfb5a97b2a263e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1130/3334] Revert "[nrf fromtree] Bluetooth: Audio: CSIS: Check all pending notifications" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e557daae8da76c3e2f368506076b960556275c37. Signed-off-by: Tomasz Moń --- subsys/bluetooth/audio/csip_set_member.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/audio/csip_set_member.c b/subsys/bluetooth/audio/csip_set_member.c index 5656728f4e5d..cfeb6ac6e45f 100644 --- a/subsys/bluetooth/audio/csip_set_member.c +++ b/subsys/bluetooth/audio/csip_set_member.c @@ -520,10 +520,8 @@ static void csip_security_changed(struct bt_conn *conn, bt_security_t level, return; } - /* Check if client has pending notifications */ - if (atomic_test_bit(client->flags, FLAG_NOTIFY_LOCK) || - atomic_test_bit(client->flags, FLAG_NOTIFY_SIRK) || - atomic_test_bit(client->flags, FLAG_NOTIFY_SIZE)) { + /* Check if client is set with FLAG_NOTIFY_LOCK */ + if (atomic_test_bit(client->flags, FLAG_NOTIFY_LOCK)) { notify_work_reschedule(K_NO_WAIT); break; } From d6cd4de4437b0ae87d420877de634f4627d90a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1131/3334] Revert "[nrf fromtree] tests: bluetooth: tester: Fix CSIS/SR/SP/BV-07-C" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e6f8ad98e78fa2436bad1dcb7365e58d6e89aeba. Signed-off-by: Tomasz Moń --- .../bluetooth/tester/src/audio/btp/btp_csis.h | 10 ++--- tests/bluetooth/tester/src/audio/btp_csis.c | 42 +++++++------------ tests/bsim/bluetooth/tester/src/bsim_btp.c | 2 +- 3 files changed, 19 insertions(+), 35 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp/btp_csis.h b/tests/bluetooth/tester/src/audio/btp/btp_csis.h index 0f1255301281..f007a6a938a2 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_csis.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_csis.h @@ -12,10 +12,6 @@ #include /* CSIS commands */ -#define BTP_CSIS_SIRK_TYPE_PLAINTEXT 0x00 -#define BTP_CSIS_SIRK_TYPE_ENCRYPTED 0x01 -#define BTP_CSIS_SIRK_TYPE_OOB_ONLY 0x02 - #define BTP_CSIS_READ_SUPPORTED_COMMANDS 0x01 struct btp_csis_read_supported_commands_rp { uint8_t data[0]; @@ -37,7 +33,7 @@ struct btp_csis_get_member_rsi_rp { uint8_t rsi[BT_CSIP_RSI_SIZE]; } __packed; -#define BTP_CSIS_SET_SIRK_TYPE 0x04 -struct btp_csis_sirk_set_type_cmd { - uint8_t type; +#define BTP_CSIS_ENC_SIRK_TYPE 0x04 +struct btp_csis_sirk_type_cmd { + uint8_t encrypted; } __packed; diff --git a/tests/bluetooth/tester/src/audio/btp_csis.c b/tests/bluetooth/tester/src/audio/btp_csis.c index c80242b4e7a6..cd62adf6f5eb 100644 --- a/tests/bluetooth/tester/src/audio/btp_csis.c +++ b/tests/bluetooth/tester/src/audio/btp_csis.c @@ -24,7 +24,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL); #define BTP_STATUS_VAL(err) (err) ? BTP_STATUS_FAILED : BTP_STATUS_SUCCESS static struct bt_csip_set_member_svc_inst *csis_svc_inst; -static uint8_t sirk_read_response; +static bool enc_sirk; static uint8_t csis_supported_commands(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) @@ -65,27 +65,13 @@ static uint8_t csis_get_member_rsi(const void *cmd, uint16_t cmd_len, return BTP_STATUS_VAL(err); } -static uint8_t csis_set_sirk_type(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) +static uint8_t csis_sirk_type(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) { - const struct btp_csis_sirk_set_type_cmd *cp = cmd; - - switch (cp->type) { - case BTP_CSIS_SIRK_TYPE_PLAINTEXT: - LOG_DBG("SIRK type: plain text"); - sirk_read_response = BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT; - break; - case BTP_CSIS_SIRK_TYPE_ENCRYPTED: - LOG_DBG("SIRK type: encrypted"); - sirk_read_response = BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT_ENC; - break; - case BTP_CSIS_SIRK_TYPE_OOB_ONLY: - LOG_DBG("SIRK type: OOB procedure only"); - sirk_read_response = BT_CSIP_READ_SIRK_REQ_RSP_OOB_ONLY; - break; - default: - LOG_ERR("Unknown SIRK type: %u", cp->type); - return BTP_STATUS_FAILED; - } + const struct btp_csis_sirk_type_cmd *cp = cmd; + + enc_sirk = cp->encrypted != 0U; + + LOG_DBG("SIRK type: %s", enc_sirk ? "encrypted" : "plain text"); return BTP_STATUS_SUCCESS; } @@ -108,9 +94,9 @@ static const struct btp_handler csis_handlers[] = { .func = csis_get_member_rsi, }, { - .opcode = BTP_CSIS_SET_SIRK_TYPE, - .expect_len = sizeof(struct btp_csis_sirk_set_type_cmd), - .func = csis_set_sirk_type, + .opcode = BTP_CSIS_ENC_SIRK_TYPE, + .expect_len = sizeof(struct btp_csis_sirk_type_cmd), + .func = csis_sirk_type, }, }; @@ -122,7 +108,11 @@ static void lock_changed_cb(struct bt_conn *conn, struct bt_csip_set_member_svc_ static uint8_t sirk_read_cb(struct bt_conn *conn, struct bt_csip_set_member_svc_inst *svc_inst) { - return sirk_read_response; + if (enc_sirk) { + return BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT_ENC; + } else { + return BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT; + } } static struct bt_csip_set_member_cb csis_cb = { @@ -142,8 +132,6 @@ uint8_t tester_init_csis(void) }; int err = bt_csip_set_member_register(®ister_params, &csis_svc_inst); - sirk_read_response = BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT; - tester_register_command_handlers(BTP_SERVICE_ID_CSIS, csis_handlers, ARRAY_SIZE(csis_handlers)); diff --git a/tests/bsim/bluetooth/tester/src/bsim_btp.c b/tests/bsim/bluetooth/tester/src/bsim_btp.c index d0516cfcaab5..a5b2c7000dc8 100644 --- a/tests/bsim/bluetooth/tester/src/bsim_btp.c +++ b/tests/bsim/bluetooth/tester/src/bsim_btp.c @@ -1236,7 +1236,7 @@ static bool is_valid_csis_packet_len(const struct btp_hdr *hdr, struct net_buf_s return buf_simple->len == 0U; case BTP_CSIS_GET_MEMBER_RSI: return buf_simple->len == sizeof(struct btp_csis_get_member_rsi_rp); - case BTP_CSIS_SET_SIRK_TYPE: + case BTP_CSIS_ENC_SIRK_TYPE: return buf_simple->len == 0U; /* No events */ From ec228c1b4d6aa5ad4a2427c86ddd89841037348a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1132/3334] Revert "[nrf fromtree] tests: bluetooth: tester: Fix bis_sink_sync" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb1f28358003727afe10d6ffa20416ad9c7155c7. Signed-off-by: Tomasz Moń --- .../tester/src/audio/btp_bap_broadcast.c | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c index 3733ab36440a..e26046d2b083 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c @@ -1162,8 +1162,6 @@ static int pa_sync_req_cb(struct bt_conn *conn, bt_addr_le_copy(&broadcaster->address, &recv_state->addr); } - broadcast_source_to_sync = broadcaster; - broadcaster->sink_recv_state = recv_state; btp_send_pas_sync_req_ev(conn, recv_state->src_id, recv_state->adv_sid, @@ -1382,6 +1380,20 @@ uint8_t btp_bap_broadcast_sink_sync(const void *cmd, uint16_t cmd_len, void *rsp LOG_DBG(""); + broadcaster = remote_broadcaster_find(&cp->address, broadcast_id); + if (broadcaster == NULL) { + broadcaster = remote_broadcaster_alloc(); + if (broadcaster == NULL) { + LOG_ERR("Failed to allocate broadcast source"); + return BTP_STATUS_FAILED; + } + + broadcaster->broadcast_id = broadcast_id; + bt_addr_le_copy(&broadcaster->address, &cp->address); + } + + broadcast_source_to_sync = broadcaster; + if (IS_ENABLED(CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER) && cp->past_avail) { /* The Broadcast Assistant supports PAST transfer, and it has found * a Broadcaster for us. Let's sync to the Broadcaster PA with the PAST. @@ -1409,22 +1421,7 @@ uint8_t btp_bap_broadcast_sink_sync(const void *cmd, uint16_t cmd_len, void *rsp create_params.sid = cp->advertiser_sid; create_params.skip = cp->skip; create_params.timeout = cp->sync_timeout; - err = tester_gap_padv_create_sync(&create_params); - - broadcaster = remote_broadcaster_find(&cp->address, broadcast_id); - if (broadcaster == NULL) { - broadcaster = remote_broadcaster_alloc(); - if (broadcaster == NULL) { - LOG_ERR("Failed to allocate broadcast source"); - return BTP_STATUS_FAILED; - } - - broadcaster->broadcast_id = broadcast_id; - bt_addr_le_copy(&broadcaster->address, &cp->address); - } - - broadcast_source_to_sync = broadcaster; } if (err != 0) { From 7da9d1a9dbedbb8504f12a4178fee87eeb2aee96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1133/3334] Revert "[nrf fromtree] tests: bluetooth: tester: Add ASE ID when configuring codec" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0f8d17d13c1fba3a9af087db367aa27a51246fb3. Signed-off-by: Tomasz Moń --- tests/bluetooth/tester/src/audio/btp_bap_unicast.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index c06795e8267a..e839a0ddb767 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -511,6 +511,7 @@ static void stream_configured_cb(struct bt_bap_stream *stream, u_stream->conn_id = bt_conn_index(stream->conn); u_conn = &connections[u_stream->conn_id]; + u_stream->ase_id = info.id; stream_state_changed(stream); } @@ -1271,12 +1272,6 @@ static int client_configure_codec(struct btp_bap_unicast_connection *u_conn, str memcpy(&stream->codec_cfg, codec_cfg, sizeof(*codec_cfg)); err = bt_bap_stream_config(conn, stream_unicast_to_bap(stream), ep, &stream->codec_cfg); - - if (err == 0) { - stream->ase_id = ase_id; - } else { - stream->in_use = false; - } } else { /* Reconfigure a stream */ memcpy(&stream->codec_cfg, codec_cfg, sizeof(*codec_cfg)); From 814f73e290b708fa9513bde7233452c4e2d4c149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1134/3334] Revert "[nrf fromtree] tests: bluetooth: Recycle ext_adv_sets when stopping adv" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2a90ac7fa0b6a889f1d50b61fad851342347a715. Signed-off-by: Tomasz Moń --- tests/bluetooth/tester/src/btp/btp_gap.h | 1 - tests/bluetooth/tester/src/btp_gap.c | 42 +----------------------- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/tests/bluetooth/tester/src/btp/btp_gap.h b/tests/bluetooth/tester/src/btp/btp_gap.h index 071c72f40b02..924859c461c2 100644 --- a/tests/bluetooth/tester/src/btp/btp_gap.h +++ b/tests/bluetooth/tester/src/btp/btp_gap.h @@ -585,7 +585,6 @@ struct bt_le_adv_param; struct bt_data; struct bt_le_ext_adv *tester_gap_ext_adv_get(uint8_t ext_adv_idx); struct bt_le_per_adv_sync *tester_gap_padv_get(void); -int tester_gap_clear_adv_instance(struct bt_le_ext_adv *ext_adv); int tester_gap_create_adv_instance(struct bt_le_adv_param *param, uint8_t own_addr_type, const struct bt_data *ad, size_t ad_len, const struct bt_data *sd, size_t sd_len, diff --git a/tests/bluetooth/tester/src/btp_gap.c b/tests/bluetooth/tester/src/btp_gap.c index 80b30467bd9d..1344933eec52 100644 --- a/tests/bluetooth/tester/src/btp_gap.c +++ b/tests/bluetooth/tester/src/btp_gap.c @@ -600,21 +600,6 @@ static int tester_gap_ext_adv_idx_free_get(void) return -ENOMEM; } -static int tester_gap_ext_adv_idx_get(struct bt_le_ext_adv *ext_adv) -{ - if (!IS_ENABLED(CONFIG_BT_EXT_ADV)) { - return -ENOTSUP; - } - - for (int i = 0; i < ARRAY_SIZE(ext_adv_sets); i++) { - if (ext_adv_sets[i] == ext_adv) { - return i; - } - } - - return -EINVAL; -} - int tester_gap_start_ext_adv(struct bt_le_ext_adv *ext_adv) { if (!IS_ENABLED(CONFIG_BT_EXT_ADV)) { @@ -659,8 +644,6 @@ int tester_gap_stop_ext_adv(struct bt_le_ext_adv *ext_adv) return -EINVAL; } - tester_gap_clear_adv_instance(ext_adv); - atomic_clear_bit(¤t_settings, BTP_GAP_SETTINGS_ADVERTISING); return 0; @@ -767,29 +750,6 @@ static uint8_t set_bondable(const void *cmd, uint16_t cmd_len, return BTP_STATUS_SUCCESS; } -int tester_gap_clear_adv_instance(struct bt_le_ext_adv *ext_adv) -{ - if (!IS_ENABLED(CONFIG_BT_EXT_ADV)) { - return -ENOTSUP; - } - - if (ext_adv == NULL) { - LOG_ERR("Invalid ext_adv"); - return -EINVAL; - } - - int index = tester_gap_ext_adv_idx_get(ext_adv); - - if (index < 0) { - LOG_ERR("Failed to get ext_adv index"); - return -EINVAL; - } - - ext_adv_sets[index] = NULL; - - return 0; -} - int tester_gap_create_adv_instance(struct bt_le_adv_param *param, uint8_t own_addr_type, const struct bt_data *ad, size_t ad_len, const struct bt_data *sd, size_t sd_len, uint32_t *settings, @@ -1013,7 +973,7 @@ static uint8_t stop_advertising(const void *cmd, uint16_t cmd_len, if (IS_ENABLED(CONFIG_BT_EXT_ADV) && atomic_test_bit(¤t_settings, BTP_GAP_SETTINGS_EXTENDED_ADVERTISING)) { - err = tester_gap_stop_ext_adv(gap_ext_adv); + err = bt_le_ext_adv_stop(gap_ext_adv); } else { err = bt_le_adv_stop(); } From 02dd7752ce7d5738ac07ea7732670c5c27ef361a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1135/3334] Revert "[nrf fromtree] Bluetooth: Host: shell: Don't use BT_FIXED_PASSKEY" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 30bc2594c91763d184288a33dd84b7eb04609fd0. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/shell/bt.c | 53 ++++++++++---------------------- tests/bluetooth/shell/audio.conf | 2 +- tests/bluetooth/shell/log.conf | 2 +- tests/bluetooth/shell/prj.conf | 2 +- 4 files changed, 19 insertions(+), 40 deletions(-) diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 816b6549853b..a09afe4e3e5c 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -4421,15 +4421,6 @@ static void br_bond_deleted(const bt_addr_t *peer) } #endif /* CONFIG_BT_CLASSIC */ -#if defined(CONFIG_BT_APP_PASSKEY) -static uint32_t app_passkey = BT_PASSKEY_RAND; - -static uint32_t auth_app_passkey(struct bt_conn *conn) -{ - return app_passkey; -} -#endif /* CONFIG_BT_APP_PASSKEY */ - static struct bt_conn_auth_cb auth_cb_display = { .passkey_display = auth_passkey_display, #if defined(CONFIG_BT_PASSKEY_KEYPRESS) @@ -4446,9 +4437,6 @@ static struct bt_conn_auth_cb auth_cb_display = { #if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT) .pairing_accept = pairing_accept, #endif -#if defined(CONFIG_BT_APP_PASSKEY) - .app_passkey = auth_app_passkey, -#endif }; static struct bt_conn_auth_cb auth_cb_display_yes_no = { @@ -4457,9 +4445,6 @@ static struct bt_conn_auth_cb auth_cb_display_yes_no = { .passkey_confirm = auth_passkey_confirm, #if defined(CONFIG_BT_CLASSIC) .pincode_entry = auth_pincode_entry, -#endif -#if defined(CONFIG_BT_APP_PASSKEY) - .app_passkey = auth_app_passkey, #endif .oob_data_request = NULL, .cancel = auth_cancel, @@ -4475,9 +4460,6 @@ static struct bt_conn_auth_cb auth_cb_input = { .passkey_confirm = NULL, #if defined(CONFIG_BT_CLASSIC) .pincode_entry = auth_pincode_entry, -#endif -#if defined(CONFIG_BT_APP_PASSKEY) - .app_passkey = auth_app_passkey, #endif .oob_data_request = NULL, .cancel = auth_cancel, @@ -4490,9 +4472,6 @@ static struct bt_conn_auth_cb auth_cb_input = { static struct bt_conn_auth_cb auth_cb_confirm = { #if defined(CONFIG_BT_CLASSIC) .pincode_entry = auth_pincode_entry, -#endif -#if defined(CONFIG_BT_APP_PASSKEY) - .app_passkey = auth_app_passkey, #endif .oob_data_request = NULL, .cancel = auth_cancel, @@ -4508,9 +4487,6 @@ static struct bt_conn_auth_cb auth_cb_all = { .passkey_confirm = auth_passkey_confirm, #if defined(CONFIG_BT_CLASSIC) .pincode_entry = auth_pincode_entry, -#endif -#if defined(CONFIG_BT_APP_PASSKEY) - .app_passkey = auth_app_passkey, #endif .oob_data_request = auth_pairing_oob_data_request, .cancel = auth_cancel, @@ -4727,15 +4703,16 @@ static int cmd_fal_connect(const struct shell *sh, size_t argc, char *argv[]) #endif /* CONFIG_BT_CENTRAL */ #endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */ -#if defined(CONFIG_BT_APP_PASSKEY) -static int cmd_app_passkey(const struct shell *sh, - size_t argc, char *argv[]) +#if defined(CONFIG_BT_FIXED_PASSKEY) +static int cmd_fixed_passkey(const struct shell *sh, + size_t argc, char *argv[]) { - uint32_t passkey; + unsigned int passkey; + int err; if (argc < 2) { - app_passkey = BT_PASSKEY_RAND; - shell_print(sh, "App passkey cleared"); + bt_passkey_set(BT_PASSKEY_INVALID); + shell_print(sh, "Fixed passkey cleared"); return 0; } @@ -4745,12 +4722,14 @@ static int cmd_app_passkey(const struct shell *sh, return -ENOEXEC; } - app_passkey = passkey; - shell_print(sh, "App passkey set to %06u", passkey); + err = bt_passkey_set(passkey); + if (err) { + shell_print(sh, "Setting fixed passkey failed (err %d)", err); + } - return 0; + return err; } -#endif /* CONFIG_BT_APP_PASSKEY */ +#endif static int cmd_auth_passkey(const struct shell *sh, size_t argc, char *argv[]) @@ -5361,10 +5340,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds, cmd_fal_connect, 2, 3), #endif /* CONFIG_BT_CENTRAL */ #endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */ -#if defined(CONFIG_BT_APP_PASSKEY) - SHELL_CMD_ARG(app-passkey, NULL, "[passkey]", cmd_app_passkey, +#if defined(CONFIG_BT_FIXED_PASSKEY) + SHELL_CMD_ARG(fixed-passkey, NULL, "[passkey]", cmd_fixed_passkey, 1, 1), -#endif /* CONFIG_BT_APP_PASSKEY */ +#endif #endif /* CONFIG_BT_SMP || CONFIG_BT_CLASSIC) */ #endif /* CONFIG_BT_CONN */ diff --git a/tests/bluetooth/shell/audio.conf b/tests/bluetooth/shell/audio.conf index 45236a49afae..bae871f97cb2 100644 --- a/tests/bluetooth/shell/audio.conf +++ b/tests/bluetooth/shell/audio.conf @@ -22,7 +22,7 @@ CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y CONFIG_BT_GATT_AUTO_UPDATE_MTU=y CONFIG_BT_L2CAP_ECRED=y CONFIG_BT_SIGNING=y -CONFIG_BT_APP_PASSKEY=y +CONFIG_BT_FIXED_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=5 CONFIG_BT_SHELL=y CONFIG_BT_DEVICE_NAME="audio test shell" diff --git a/tests/bluetooth/shell/log.conf b/tests/bluetooth/shell/log.conf index 2da43186e19f..7a9aa9b8680f 100644 --- a/tests/bluetooth/shell/log.conf +++ b/tests/bluetooth/shell/log.conf @@ -9,7 +9,7 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y -CONFIG_BT_APP_PASSKEY=y +CONFIG_BT_FIXED_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 2c84d55bd69a..510d0988262c 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -11,7 +11,7 @@ CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_PASSKEY_KEYPRESS=y CONFIG_BT_SIGNING=y -CONFIG_BT_APP_PASSKEY=y +CONFIG_BT_FIXED_PASSKEY=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y From d1bd93ef0f2cc363a4b26e13ad8c01a8a1378c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:42 +0100 Subject: [PATCH 1136/3334] Revert "[nrf fromtree] Bluetooth: Host: Deprecate BT_FIXED_PASSKEY" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 209a01d590e9e0235c44cbdfa6cb4f99d9e77348. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.3.rst | 9 --------- include/zephyr/bluetooth/conn.h | 9 +++------ subsys/bluetooth/host/Kconfig | 4 +--- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index 53e6b64ab72d..a3aec0898c8e 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -123,15 +123,6 @@ Bluetooth HCI * The deprecated ``ipm`` value was removed from ``bt-hci-bus`` devicetree property. ``ipc`` should be used instead. -Bluetooth Host -============== - -* :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` has been deprecated. Instead, the application can - provide passkeys for pairing using the :c:member:`bt_conn_auth_cb.app_passkey` callback, which is - available when :kconfig:option:`CONFIG_BT_APP_PASSKEY` is enabled. The application can return the - passkey for pairing, or :c:macro:`BT_PASSKEY_RAND` for the Host to generate a random passkey - instead. - Ethernet ======== diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 881d0894ee11..0ebfb89bf4bf 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -2380,8 +2380,8 @@ int bt_le_oob_get_sc_data(struct bt_conn *conn, const struct bt_le_oob_sc_data **oobd_remote); /** - * DEPRECATED - use @ref BT_PASSKEY_RAND instead. Special passkey value that can be used to disable - * a previously set fixed passkey. + * Special passkey value that can be used to disable a previously + * set fixed passkey. */ #define BT_PASSKEY_INVALID 0xffffffff @@ -2393,15 +2393,12 @@ int bt_le_oob_get_sc_data(struct bt_conn *conn, * Sets a fixed passkey to be used for pairing. If set, the * pairing_confirm() callback will be called for all incoming pairings. * - * @deprecated Use @ref BT_PASSKEY_RAND and the app_passkey callback from @ref bt_conn_auth_cb - * instead. - * * @param passkey A valid passkey (0 - 999999) or BT_PASSKEY_INVALID * to disable a previously set fixed passkey. * * @return 0 on success or a negative error code on failure. */ -__deprecated int bt_passkey_set(unsigned int passkey); +int bt_passkey_set(unsigned int passkey); /** Info Structure for OOB pairing */ struct bt_conn_oob_info { diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 862f71c3651c..b45febe61869 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -683,10 +683,8 @@ config BT_SMP_USB_HCI_CTLR_WORKAROUND if the keys are distributed over an encrypted link. config BT_FIXED_PASSKEY - bool "Use a fixed passkey for pairing [DEPRECATED]" - select DEPRECATED + bool "Use a fixed passkey for pairing" help - This option is deprecated, use BT_APP_PASSKEY instead. With this option enabled, the application will be able to call the bt_passkey_set() API to set a fixed passkey. If set, the pairing_confirm() callback will be called for all incoming pairings. From ce3a24b15ba14eaefad81bfda6e480d0b7698f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1137/3334] Revert "[nrf fromtree] Bluetooth: Host: Add BT_APP_PASSKEY Kconfig option" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 999c521d05e6e036ba3f119df7cce3370a2321b7. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/conn.h | 31 ------------- subsys/bluetooth/host/Kconfig | 10 ----- subsys/bluetooth/host/smp.c | 77 ++++++++------------------------- 3 files changed, 19 insertions(+), 99 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 0ebfb89bf4bf..67c3db64e92a 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -2464,13 +2464,6 @@ struct bt_conn_pairing_feat { }; #endif /* CONFIG_BT_SMP_APP_PAIRING_ACCEPT */ -/** - * Special passkey value that can be used to generate a random passkey when using the - * app_passkey callback from @ref bt_conn_auth_cb. - * - */ -#define BT_PASSKEY_RAND 0xffffffff - /** Authenticated pairing callback structure */ struct bt_conn_auth_cb { #if defined(CONFIG_BT_SMP_APP_PAIRING_ACCEPT) @@ -2670,30 +2663,6 @@ struct bt_conn_auth_cb { */ void (*pincode_entry)(struct bt_conn *conn, bool highsec); #endif - -#if defined(CONFIG_BT_APP_PASSKEY) - /** @brief Allow the application to provide a passkey for pairing. - * - * If implemented, this callback allows the application to provide passkeys for pairing. - * The valid range of passkeys is 0 - 999999. The application shall return the passkey for - * pairing, or BT_PASSKEY_RAND to generate a random passkey. This callback is invoked only - * for the Passkey Entry method as defined in Core Specification Vol. 3, Part H. Which - * device in the pairing is showing the passkey depends on the IO capabilities of the - * device; see Table 2.8 of the Bluetooth Core Specification V6.0, Vol. 3, Part H for more - * details. For the purposes of this table, the device gains the "display" capability when - * this callback is non-NULL. This is irrespective of whether the callback returns a - * specified key or BT_PASSKEY_RAND. - * - * - * @note When using this callback, it is the responsibility of the application to use - * random and unique keys. - * - * @param conn Connection where pairing is currently active. - * @return Passkey for pairing, or BT_PASSKEY_RAND for the Host to generate a random - * passkey. - */ - uint32_t (*app_passkey)(struct bt_conn *conn); -#endif /* CONFIG_BT_APP_PASSKEY */ }; /** Authenticated pairing information callback structure */ diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index b45febe61869..41fce83a0048 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -689,16 +689,6 @@ config BT_FIXED_PASSKEY bt_passkey_set() API to set a fixed passkey. If set, the pairing_confirm() callback will be called for all incoming pairings. -config BT_APP_PASSKEY - bool "Allow the application to provide passkeys for pairing" - depends on !BT_FIXED_PASSKEY - help - With this option enabled, the application will be able to provide passkeys for pairing - using the app_passkey() callback. If the application does not provide a passkey, a - random passkey will be generated by the Host. - - WARNING: It is the responsibility of the application to use random and unique keys. - config BT_USE_DEBUG_KEYS bool "Security Manager Debug Mode" help diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index b935c61d2a36..702e6fc0d215 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -222,10 +222,10 @@ struct bt_smp { atomic_t bondable; }; -static unsigned int fixed_passkey = BT_PASSKEY_RAND; +static unsigned int fixed_passkey = BT_PASSKEY_INVALID; #define DISPLAY_FIXED(smp) (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && \ - fixed_passkey != BT_PASSKEY_RAND && \ + fixed_passkey != BT_PASSKEY_INVALID && \ (smp)->method == PASSKEY_DISPLAY) #if !defined(CONFIG_BT_SMP_SC_PAIR_ONLY) @@ -363,21 +363,9 @@ static uint8_t get_io_capa(struct bt_smp *smp) return BT_SMP_IO_DISPLAY_YESNO; } -#if defined(CONFIG_BT_APP_PASSKEY) - /* Implementation of the app_passkey cb implies that the application can "know" the passkey - * without actually having a display, thus earning the "display" capability. - */ - if (smp_auth_cb->app_passkey) { - if (smp_auth_cb->passkey_entry) { - return BT_SMP_IO_KEYBOARD_DISPLAY; - } - - return BT_SMP_IO_DISPLAY_ONLY; - } -#endif /* CONFIG_BT_APP_PASSKEY */ - if (smp_auth_cb->passkey_entry) { - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_RAND) { + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && + fixed_passkey != BT_PASSKEY_INVALID) { return BT_SMP_IO_KEYBOARD_DISPLAY; } else { return BT_SMP_IO_KEYBOARD_ONLY; @@ -389,7 +377,8 @@ static uint8_t get_io_capa(struct bt_smp *smp) } no_callbacks: - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_RAND) { + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && + fixed_passkey != BT_PASSKEY_INVALID) { return BT_SMP_IO_DISPLAY_ONLY; } else { return BT_SMP_IO_NO_INPUT_OUTPUT; @@ -2486,6 +2475,7 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) struct bt_conn *conn = smp->chan.chan.conn; const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_keys *keys; + uint32_t passkey; /* * Fail if we have keys that are stronger than keys that will be @@ -2513,25 +2503,11 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) } break; - case PASSKEY_DISPLAY: { - uint32_t passkey; - - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_RAND) { + case PASSKEY_DISPLAY: + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && + fixed_passkey != BT_PASSKEY_INVALID) { passkey = fixed_passkey; -#if defined(CONFIG_BT_APP_PASSKEY) - } else if (smp_auth_cb && smp_auth_cb->app_passkey) { - passkey = smp_auth_cb->app_passkey(conn); - - if (passkey != BT_PASSKEY_RAND && passkey > 999999) { - LOG_WRN("App-provided passkey is out of valid range: %u", passkey); - return BT_SMP_ERR_UNSPECIFIED; - } -#endif /* CONFIG_BT_APP_PASSKEY */ - } else { - passkey = BT_PASSKEY_RAND; - } - - if (passkey == BT_PASSKEY_RAND) { + } else { if (bt_rand(&passkey, sizeof(passkey))) { return BT_SMP_ERR_UNSPECIFIED; } @@ -2551,7 +2527,6 @@ static uint8_t legacy_request_tk(struct bt_smp *smp) sys_put_le32(passkey, smp->tk); break; - } case PASSKEY_INPUT: atomic_set_bit(smp->flags, SMP_FLAG_USER); smp_auth_cb->passkey_entry(conn); @@ -4454,32 +4429,18 @@ __maybe_unused static uint8_t display_passkey(struct bt_smp *smp) { struct bt_conn *conn = smp->chan.chan.conn; const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); - uint32_t passkey = BT_PASSKEY_RAND; - - if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && fixed_passkey != BT_PASSKEY_RAND) { - passkey = fixed_passkey; - } -#if defined(CONFIG_BT_APP_PASSKEY) - if (smp_auth_cb && smp_auth_cb->app_passkey) { - passkey = smp_auth_cb->app_passkey(conn); - - if (passkey != BT_PASSKEY_RAND && passkey > 999999) { - LOG_WRN("App-provided passkey is out of valid range: %u", passkey); - return BT_SMP_ERR_UNSPECIFIED; - } - } -#endif /* CONFIG_BT_APP_PASSKEY */ - - if (passkey == BT_PASSKEY_RAND) { - if (bt_rand(&passkey, sizeof(passkey))) { + if (IS_ENABLED(CONFIG_BT_FIXED_PASSKEY) && + fixed_passkey != BT_PASSKEY_INVALID) { + smp->passkey = fixed_passkey; + } else { + if (bt_rand(&smp->passkey, sizeof(smp->passkey))) { return BT_SMP_ERR_UNSPECIFIED; } - passkey %= 1000000; + smp->passkey %= 1000000; } - smp->passkey = passkey; smp->passkey_round = 0U; if (smp_auth_cb && smp_auth_cb->passkey_display) { @@ -6211,8 +6172,8 @@ int bt_smp_auth_pairing_confirm(struct bt_conn *conn) #if defined(CONFIG_BT_FIXED_PASSKEY) int bt_passkey_set(unsigned int passkey) { - if (passkey == BT_PASSKEY_INVALID || passkey == BT_PASSKEY_RAND) { - fixed_passkey = BT_PASSKEY_RAND; + if (passkey == BT_PASSKEY_INVALID) { + fixed_passkey = BT_PASSKEY_INVALID; return 0; } From 80aac0dd0b3e709f9553e0eb0fd574588b923ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1138/3334] Revert "[nrf fromlist] tests: bluetooth: tester: fix model rx handler" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4f7ae1cd853094a2cf33e800b2bb2662347c90b1. Signed-off-by: Tomasz Moń --- tests/bluetooth/tester/src/btp/btp_mesh.h | 2 +- tests/bluetooth/tester/src/btp_mesh.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/bluetooth/tester/src/btp/btp_mesh.h b/tests/bluetooth/tester/src/btp/btp_mesh.h index 78074e1001e0..353971261b43 100644 --- a/tests/bluetooth/tester/src/btp/btp_mesh.h +++ b/tests/bluetooth/tester/src/btp/btp_mesh.h @@ -1194,7 +1194,7 @@ struct btp_mesh_prov_node_added_ev { struct btp_mesh_model_recv_ev { uint16_t src; uint16_t dst; - uint16_t payload_len; + uint8_t payload_len; uint8_t payload[]; } __packed; diff --git a/tests/bluetooth/tester/src/btp_mesh.c b/tests/bluetooth/tester/src/btp_mesh.c index 3a84e8226197..11156f36c7ec 100644 --- a/tests/bluetooth/tester/src/btp_mesh.c +++ b/tests/bluetooth/tester/src/btp_mesh.c @@ -5332,12 +5332,12 @@ void net_recv_ev(uint8_t ttl, uint8_t ctl, uint16_t src, uint16_t dst, const voi void model_recv_ev(uint16_t src, uint16_t dst, const void *payload, size_t payload_len) { - NET_BUF_SIMPLE_DEFINE(buf, BT_MESH_RX_SDU_MAX + sizeof(struct btp_mesh_model_recv_ev)); + NET_BUF_SIMPLE_DEFINE(buf, UINT8_MAX); struct btp_mesh_model_recv_ev *ev; LOG_DBG("src 0x%04x dst 0x%04x payload_len %zu", src, dst, payload_len); - if (payload_len + sizeof(*ev) > net_buf_simple_tailroom(&buf)) { + if (payload_len > net_buf_simple_tailroom(&buf)) { LOG_ERR("Payload size exceeds buffer size"); return; } From 1e0d9154c02b096d07b43ebf1b3b52d6baf3303d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1139/3334] Revert "[nrf fromtree] drivers: flash: nrf_qspi_nor: Fix compilation with QER set to NONE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 764a90bc3fce93f3bcb3e06aae1ee2bd11348ffd. Signed-off-by: Tomasz Moń --- drivers/flash/nrf_qspi_nor.c | 4 ++-- .../flash/common/boards/nrf52840dk_qer_none.overlay | 9 --------- tests/drivers/flash/common/testcase.yaml | 7 ------- 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 tests/drivers/flash/common/boards/nrf52840dk_qer_none.overlay diff --git a/drivers/flash/nrf_qspi_nor.c b/drivers/flash/nrf_qspi_nor.c index 110a2d27c7e9..e9eb5a17302b 100644 --- a/drivers/flash/nrf_qspi_nor.c +++ b/drivers/flash/nrf_qspi_nor.c @@ -481,6 +481,7 @@ static int qspi_send_cmd(const struct device *dev, const struct qspi_cmd *cmd, return qspi_get_zephyr_ret_code(res); } +#if !IS_EQUAL(INST_0_QER, JESD216_DW15_QER_VAL_NONE) /* RDSR. Negative value is error. */ static int qspi_rdsr(const struct device *dev, uint8_t sr_num) { @@ -524,7 +525,6 @@ static int qspi_wait_while_writing(const struct device *dev, k_timeout_t poll_pe return (rc < 0) ? rc : 0; } -#if !IS_EQUAL(INST_0_QER, JESD216_DW15_QER_VAL_NONE) static int qspi_wrsr(const struct device *dev, uint8_t sr_val, uint8_t sr_num) { int rc = 0; @@ -657,6 +657,7 @@ static int qspi_erase(const struct device *dev, uint32_t addr, uint32_t size) static int configure_chip(const struct device *dev) { + const struct qspi_nor_config *dev_config = dev->config; int rc = 0; /* Set QE to match transfer mode. If not using quad @@ -667,7 +668,6 @@ static int configure_chip(const struct device *dev) * S2B1v1/4/5/6. Other options require more logic. */ #if !IS_EQUAL(INST_0_QER, JESD216_DW15_QER_VAL_NONE) - const struct qspi_nor_config *dev_config = dev->config; nrf_qspi_prot_conf_t const *prot_if = &dev_config->nrfx_cfg.prot_if; bool qe_value = (prot_if->writeoc == NRF_QSPI_WRITEOC_PP4IO) || diff --git a/tests/drivers/flash/common/boards/nrf52840dk_qer_none.overlay b/tests/drivers/flash/common/boards/nrf52840dk_qer_none.overlay deleted file mode 100644 index 190537bf8536..000000000000 --- a/tests/drivers/flash/common/boards/nrf52840dk_qer_none.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - quad-enable-requirements = "NONE"; -}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index d4ac7537b54d..550c73ffb1d5 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -29,13 +29,6 @@ tests: - CONFIG_TEST_DRIVER_FLASH_SIZE=8388608 integration_platforms: - nrf52840dk/nrf52840 - drivers.flash.common.nrf_qspi_nor.qer_none: - build_only: true - platform_allow: nrf52840dk/nrf52840 - extra_args: - - DTC_OVERLAY_FILE=boards/nrf52840dk_qer_none.overlay - integration_platforms: - - nrf52840dk/nrf52840 drivers.flash.common.nrf_qspi_nor_4B_addr: platform_allow: nrf52840dk/nrf52840 extra_configs: From bde02cc956185f31a7e34ec8acb393068bf80530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1140/3334] Revert "[nrf fromtree] samples: boards: nrf: system_off: Add sample with system clock disabled" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2bcbae54d8b89d6fe160f795fdb075234f1f4e4b. Signed-off-by: Tomasz Moń --- samples/boards/nordic/system_off/Kconfig | 5 --- samples/boards/nordic/system_off/sample.yaml | 38 -------------------- samples/boards/nordic/system_off/src/main.c | 8 ----- 3 files changed, 51 deletions(-) diff --git a/samples/boards/nordic/system_off/Kconfig b/samples/boards/nordic/system_off/Kconfig index f5e5ce944acc..c7b4a9f85575 100644 --- a/samples/boards/nordic/system_off/Kconfig +++ b/samples/boards/nordic/system_off/Kconfig @@ -23,9 +23,4 @@ config LPCOMP_WAKEUP_ENABLE help Enable system off wakeup from analog comparator. -config SYS_CLOCK_DISABLE - bool "Power down system clock before system off" - help - System clock and GRTC will be switched off during system off. - source "Kconfig.zephyr" diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index ce9321a845b3..b11f3439e7f6 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -47,44 +47,6 @@ tests: - "Off count: 0" - "Active Ticks:" - "Entering system off; press sw0 to restart" - sample.boards.nrf.system_off.grtc_off: - platform_allow: - - nrf54l15dk/nrf54l05/cpuapp - - nrf54l15dk/nrf54l10/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - extra_configs: - - CONFIG_SYS_CLOCK_DISABLE=y - harness: console - harness_config: - type: multi_line - ordered: true - regex: - - "system off demo" - - "Retained data not supported" - - "System clock will be disabled" - - "Entering system off; press sw0 to restart" - sample.boards.nrf.system_off.retained_mem.grtc_off: - platform_allow: - - nrf54l15dk/nrf54l05/cpuapp - - nrf54l15dk/nrf54l10/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - extra_configs: - - CONFIG_APP_USE_RETAINED_MEM=y - - CONFIG_SYS_CLOCK_DISABLE=y - harness: console - harness_config: - type: multi_line - ordered: true - regex: - - "system off demo" - - "Retained data: valid" - - "Boot count: 1" - - "Off count: 0" - - "Active Ticks:" - - "System clock will be disabled" - - "Entering system off; press sw0 to restart" sample.boards.nrf.system_off.grtc_wakeup: platform_allow: - nrf54l15dk/nrf54l05/cpuapp diff --git a/samples/boards/nordic/system_off/src/main.c b/samples/boards/nordic/system_off/src/main.c index 020e88a5449e..b4c2eeb2b1bb 100644 --- a/samples/boards/nordic/system_off/src/main.c +++ b/samples/boards/nordic/system_off/src/main.c @@ -17,7 +17,6 @@ #include #include #include -#include #define NON_WAKEUP_RESET_REASON (RESET_PIN | RESET_SOFTWARE | RESET_POR | RESET_DEBUG) @@ -98,15 +97,11 @@ int main(void) printf("Retained data not supported\n"); } -#if defined(CONFIG_SYS_CLOCK_DISABLE) - printf("System clock will be disabled\n"); -#endif #if defined(CONFIG_GRTC_WAKEUP_ENABLE) int err = z_nrf_grtc_wakeup_prepare(DEEP_SLEEP_TIME_S * USEC_PER_SEC); if (err < 0) { printk("Unable to prepare GRTC as a wake up source (err = %d).\n", err); - return 0; } else { printk("Entering system off; wait %u seconds to restart\n", DEEP_SLEEP_TIME_S); } @@ -146,9 +141,6 @@ int main(void) } hwinfo_clear_reset_cause(); -#if defined(CONFIG_SYS_CLOCK_DISABLE) - sys_clock_disable(); -#endif sys_poweroff(); return 0; From 40e6191c397fccd16e57e8055ea4607b538a810b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1141/3334] Revert "[nrf fromtree] drivers: timer: nrf_grtc_timer: Add system_clock_disable implementation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 41ee118d809c4e28685b6985ee82cf0b677234f8. Signed-off-by: Tomasz Moń --- drivers/timer/Kconfig.nrf_grtc | 1 - drivers/timer/nrf_grtc_timer.c | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/drivers/timer/Kconfig.nrf_grtc b/drivers/timer/Kconfig.nrf_grtc index ab230245ebfd..24534ae3f95c 100644 --- a/drivers/timer/Kconfig.nrf_grtc +++ b/drivers/timer/Kconfig.nrf_grtc @@ -6,7 +6,6 @@ menuconfig NRF_GRTC_TIMER default y depends on DT_HAS_NORDIC_NRF_GRTC_ENABLED select TICKLESS_CAPABLE - select SYSTEM_TIMER_HAS_DISABLE_SUPPORT select TIMER_HAS_64BIT_CYCLE_COUNTER select NRFX_GRTC help diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 94ec7e3a240f..a7d3d90ef196 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -368,10 +368,6 @@ uint64_t z_nrf_grtc_timer_startup_value_get(void) #if defined(CONFIG_POWEROFF) && defined(CONFIG_NRF_GRTC_START_SYSCOUNTER) int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) { - if (!nrfx_grtc_init_check()) { - return -ENOTSUP; - } - nrfx_err_t err_code; static struct k_spinlock lock; static uint8_t systemoff_channel; @@ -464,21 +460,6 @@ ISR_DIRECT_DECLARE(nrfx_grtc_direct_irq_handler) } #endif -void sys_clock_disable(void) -{ - nrfx_grtc_uninit(); -#if defined(CONFIG_CLOCK_CONTROL_NRF) - int err; - struct onoff_manager *mgr = - z_nrf_clock_control_get_onoff((clock_control_subsys_t)CLOCK_CONTROL_NRF_TYPE_LFCLK); - - err = onoff_release(mgr); - __ASSERT_NO_MSG(err >= 0); - - nrfx_coredep_delay_us(1000); -#endif -} - static int sys_clock_driver_init(void) { nrfx_err_t err_code; From f985324fc23cee7146066d3670dd05cd3f7dee83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1142/3334] Revert "[nrf fromtree] samples: boards: nordic: spis_wakeup: Run sample on APP+PPR" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a30145237ba44a1e8659d80340f215074ef7c3b8. Signed-off-by: Tomasz Moń --- .../nordic/spis_wakeup/Kconfig.sysbuild | 22 ------ .../boards/nrf54h20dk_nrf54h20_common.dtsi | 61 ----------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 59 +++++++++++++++- ...4h20dk_nrf54h20_cpuapp_with_cpuppr.overlay | 16 ----- samples/boards/nordic/spis_wakeup/sample.yaml | 30 +++----- .../boards/nordic/spis_wakeup/sysbuild.cmake | 4 +- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 68 ------------------- .../nrf54h20dk_nrf54h20_cpuppr_xip.conf | 1 - .../nrf54h20dk_nrf54h20_cpuppr_xip.overlay | 6 -- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 3 - .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 64 ++++++++++++++++- .../spis_wakeup/wakeup_trigger/prj.conf | 3 + 12 files changed, 134 insertions(+), 203 deletions(-) delete mode 100644 samples/boards/nordic/spis_wakeup/Kconfig.sysbuild delete mode 100644 samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_common.dtsi delete mode 100644 samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay delete mode 100644 samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_common.dtsi delete mode 100644 samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf delete mode 100644 samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay delete mode 100644 samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/boards/nordic/spis_wakeup/Kconfig.sysbuild b/samples/boards/nordic/spis_wakeup/Kconfig.sysbuild deleted file mode 100644 index caf02cc11919..000000000000 --- a/samples/boards/nordic/spis_wakeup/Kconfig.sysbuild +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig" - -choice REMOTE_NRF54H20_CORE - prompt "Remote nRF54h20 core" - default REMOTE_NRF54H20_CPURAD_CORE - depends on SOC_NRF54H20_CPUAPP - -config REMOTE_NRF54H20_CPUPPR_CORE - bool "ppr core" - -config REMOTE_NRF54H20_CPURAD_CORE - bool "cpurad" - -endchoice - -config REMOTE_BOARD - string - default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPURAD_CORE - default "$(BOARD)/nrf54h20/cpuppr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUPPR_CORE diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_common.dtsi b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_common.dtsi deleted file mode 100644 index 7ce17ba9bd1a..000000000000 --- a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_common.dtsi +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - led = &led0; - spis = &spi130; - /delete-property/ sw0; - /delete-property/ sw1; - /delete-property/ sw2; - /delete-property/ sw3; - /delete-property/ mcuboot-led0; - /delete-property/ mcuboot-button0; - }; - /delete-node/ buttons; -}; - -&exmif { - status = "disabled"; -}; - -&gpiote130 { - status = "okay"; - owned-channels = <0>; -}; - -&pinctrl { - spi130_default_alt: spi130_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi130_sleep_alt: spi130_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -&spi130 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi130_default_alt>; - pinctrl-1 = <&spi130_sleep_alt>; - pinctrl-names = "default", "sleep"; - wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; - memory-regions = <&cpuapp_dma_region>; - /delete-property/ rx-delay-supported; - /delete-property/ rx-delay; -}; diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 75d90b40595a..8023020f2caa 100644 --- a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -3,13 +3,66 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54h20dk_nrf54h20_common.dtsi" - -/* LED1 will be used by the cpurad core. */ / { aliases { + led = &led0; + spis = &spi130; /delete-property/ led1; + /delete-property/ sw0; + /delete-property/ sw1; + /delete-property/ sw2; + /delete-property/ sw3; + /delete-property/ mcuboot-led0; + /delete-property/ mcuboot-button0; }; + /delete-node/ buttons; }; /delete-node/ &led1; + +&exmif { + status = "disabled"; +}; + +&gpiote130 { + status = "okay"; + owned-channels = <0>; +}; + +&pinctrl { + spi130_default_alt: spi130_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spi130_sleep_alt: spi130_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&spi130 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spi130_default_alt>; + pinctrl-1 = <&spi130_sleep_alt>; + pinctrl-names = "default", "sleep"; + wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + memory-regions = <&cpuapp_dma_region>; + /delete-property/ rx-delay-supported; + /delete-property/ rx-delay; +}; + +&uart136 { + zephyr,pm-device-runtime-auto; +}; diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay deleted file mode 100644 index fc0f24ad71c0..000000000000 --- a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" - -&spi131 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&uart135 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; diff --git a/samples/boards/nordic/spis_wakeup/sample.yaml b/samples/boards/nordic/spis_wakeup/sample.yaml index a2dca27d3e82..7bc97eedcb99 100644 --- a/samples/boards/nordic/spis_wakeup/sample.yaml +++ b/samples/boards/nordic/spis_wakeup/sample.yaml @@ -1,32 +1,22 @@ common: sysbuild: true depends_on: spi - tags: - - spi - harness: console - harness_config: - fixture: spi_loopback - type: multi_line - ordered: true - regex: - - ".*SPIS: waiting for SPI transfer" - - ".*SPIS: woken up by" sample: name: SPI wakeup sample tests: sample.drivers.spis.wakeup: + tags: + - spi platform_allow: - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp - sample.drivers.spis.wakeup.ppr: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - extra_args: - - SB_CONFIG_REMOTE_NRF54H20_CPUPPR_CORE=y - - spis_wakeup_CONFIG_SOC_NRF54H20_CPURAD_ENABLE=n - - spis_wakeup_SNIPPET=nordic-ppr-xip - - DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay" + harness: console + harness_config: + fixture: spi_loopback + type: multi_line + ordered: true + regex: + - ".*SPIS: waiting for SPI transfer" + - ".*SPIS: woken up by" diff --git a/samples/boards/nordic/spis_wakeup/sysbuild.cmake b/samples/boards/nordic/spis_wakeup/sysbuild.cmake index becedfd6971f..bbd350fbe637 100644 --- a/samples/boards/nordic/spis_wakeup/sysbuild.cmake +++ b/samples/boards/nordic/spis_wakeup/sysbuild.cmake @@ -3,12 +3,12 @@ # SPDX-License-Identifier: Apache-2.0 # -if(SB_CONFIG_REMOTE_BOARD) +if(SB_CONFIG_SOC_NRF54H20) # Add remote project ExternalZephyrProject_Add( APPLICATION wakeup_trigger SOURCE_DIR ${APP_DIR}/wakeup_trigger - BOARD ${SB_CONFIG_REMOTE_BOARD} + BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpurad BOARD_REVISION ${BOARD_REVISION} ) endif() diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_common.dtsi b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_common.dtsi deleted file mode 100644 index 7ebf62fdae49..000000000000 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_common.dtsi +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - led = &led1; - }; - - leds { - compatible = "gpio-leds"; - - led1: led_1 { - gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - }; -}; - -&gpiote130 { - status = "okay"; - owned-channels = <1>; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio9 { - status = "okay"; -}; - -&pinctrl { - spi131_default_alt: spi131_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi131_sleep_alt: spi131_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - -&spi131 { - compatible = "nordic,nrf-spim"; - status = "okay"; - pinctrl-0 = <&spi131_default_alt>; - pinctrl-1 = <&spi131_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; - wake-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; - - spim_dt: spi-device@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = ; - }; -}; diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf deleted file mode 100644 index 7b0ca9cbcfa3..000000000000 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_ASSERT=n diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay deleted file mode 100644 index 0e01ff40bb9e..000000000000 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index 9eaa8724bb39..000000000000 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_PM=y - -CONFIG_ASSERT=y diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.overlay index 846a44d165a3..c54fb28742e9 100644 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -3,8 +3,70 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54h20dk_nrf54h20_common.dtsi" +/ { + aliases { + led = &led1; + }; + + leds { + compatible = "gpio-leds"; + led1: led_1 { + gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + }; +}; + +&gpiote130 { + status = "okay"; + owned-channels = <1>; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio9 { + status = "okay"; +}; + +&pinctrl { + spi131_default_alt: spi131_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi131_sleep_alt: spi131_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; &spi131 { + compatible = "nordic,nrf-spim"; + status = "okay"; + pinctrl-0 = <&spi131_default_alt>; + pinctrl-1 = <&spi131_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + wake-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + zephyr,pm-device-runtime-auto; memory-regions = <&cpurad_dma_region>; + spim_dt: spi-device@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +&uart135 { + zephyr,pm-device-runtime-auto; }; diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf index 662d75582fea..ad4577807f89 100644 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf @@ -2,7 +2,10 @@ CONFIG_SPI=y CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500 CONFIG_GPIO=y +CONFIG_PM=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_ASSERT=y + CONFIG_LOG=y From d9fbca0ff87bfe68e3365aa7d5e744e5cfede931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1143/3334] Revert "[nrf fromtree] tests: drivers: comparator: Enable test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3529c7d9aa7136c0862d3732f2ccd030e13c9945. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- .../gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay | 7 ------- .../socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay | 7 ------- tests/drivers/comparator/gpio_loopback/testcase.yaml | 2 -- 4 files changed, 23 deletions(-) delete mode 100644 tests/drivers/comparator/gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/comparator/gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/comparator/gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay deleted file mode 100644 index c79dc80c8423..000000000000 --- a/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_comp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15_cpuapp_nrf_comp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay deleted file mode 100644 index 2b1e4b9009ca..000000000000 --- a/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_ns_nrf_lpcomp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15_cpuapp_nrf_lpcomp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index 706e2ac3757f..d6ced33b76e5 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -24,7 +24,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: @@ -34,6 +33,5 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From 7b475471a7fe792f11c85f7f880d41facfe77389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1144/3334] Revert "[nrf fromtree] tests: remove misuse of snippets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7ef48ee9fc0635b71dc6b67fdf49fb7c3ed1590d. Signed-off-by: Tomasz Moń --- .../bl54l15_dvk_nrf54l15_cpuapp.overlay | 19 +++++++++++++++++ .../bl54l15u_dvk_nrf54l15_cpuapp.overlay | 19 +++++++++++++++++ .../boards/nrf5340dk_nrf5340_cpuapp.overlay} | 0 .../nrf54h20dk_nrf54h20_cpuapp.overlay} | 0 .../nrf54l15dk_nrf54l15_cpuapp.overlay} | 0 .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay} | 0 .../snippets/nrf_comp/snippet.yml | 21 +++++++++++++++++++ .../bl54l15_dvk_nrf54l15_cpuapp.overlay | 15 +++++++++++++ .../bl54l15u_dvk_nrf54l15_cpuapp.overlay | 15 +++++++++++++ .../boards/nrf5340dk_nrf5340_cpuapp.overlay} | 0 .../nrf54h20dk_nrf54h20_cpuapp.overlay} | 0 .../nrf54l15dk_nrf54l15_cpuapp.overlay} | 0 .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay} | 0 .../snippets/nrf_lpcomp/snippet.yml | 21 +++++++++++++++++++ .../comparator/gpio_loopback/testcase.yaml | 6 ++++-- 15 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay rename tests/drivers/comparator/gpio_loopback/{socs/nrf5340_cpuapp_nrf_comp.overlay => snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{socs/nrf54h20_cpuapp_nrf_comp.overlay => snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{socs/nrf54l15_cpuapp_nrf_comp.overlay => snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{socs/nrf54lm20a_cpuapp_nrf_comp.overlay => snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay} (100%) create mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml create mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay rename tests/drivers/comparator/gpio_loopback/{socs/nrf5340_cpuapp_nrf_lpcomp.overlay => snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{socs/nrf54h20_cpuapp_nrf_lpcomp.overlay => snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{socs/nrf54l15_cpuapp_nrf_lpcomp.overlay => snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay} (100%) rename tests/drivers/comparator/gpio_loopback/{socs/nrf54lm20a_cpuapp_nrf_lpcomp.overlay => snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay} (100%) create mode 100644 tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..84d3b9f57594 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&comp { + main-mode = "SE"; + psel = ; /* P1.11 */ + refsel = "INT_1V2"; + sp-mode = "HIGH"; + th-up = <63>; + th-down = <59>; + isource = "DISABLED"; + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..84d3b9f57594 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&comp { + main-mode = "SE"; + psel = ; /* P1.11 */ + refsel = "INT_1V2"; + sp-mode = "HIGH"; + th-up = <63>; + th-down = <59>; + isource = "DISABLED"; + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf5340_cpuapp_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/socs/nrf5340_cpuapp_nrf_comp.overlay rename to tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54h20_cpuapp_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/socs/nrf54h20_cpuapp_nrf_comp.overlay rename to tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_nrf_comp.overlay rename to tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20a_cpuapp_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/socs/nrf54lm20a_cpuapp_nrf_comp.overlay rename to tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml new file mode 100644 index 000000000000..9d876bfded03 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml @@ -0,0 +1,21 @@ +# Copyright 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +name: gpio_loopback_nrf_comp + +boards: + nrf5340dk/nrf5340/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay + nrf54h20dk/nrf54h20/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay + nrf54l15dk/nrf54l15/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay + nrf54lm20dk/nrf54lm20a/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay + ophelia4ev/nrf54l15/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..e208b85b2ae9 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&comp { + compatible = "nordic,nrf-lpcomp"; + psel = ; /* P1.11 */ + refsel = "VDD_4_8"; + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..e208b85b2ae9 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&comp { + compatible = "nordic,nrf-lpcomp"; + psel = ; /* P1.11 */ + refsel = "VDD_4_8"; + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf5340_cpuapp_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/socs/nrf5340_cpuapp_nrf_lpcomp.overlay rename to tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54h20_cpuapp_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/socs/nrf54h20_cpuapp_nrf_lpcomp.overlay rename to tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/socs/nrf54l15_cpuapp_nrf_lpcomp.overlay rename to tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20a_cpuapp_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay similarity index 100% rename from tests/drivers/comparator/gpio_loopback/socs/nrf54lm20a_cpuapp_nrf_lpcomp.overlay rename to tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml new file mode 100644 index 000000000000..c2a2005af4d3 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml @@ -0,0 +1,21 @@ +# Copyright 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +name: gpio_loopback_nrf_lpcomp + +boards: + nrf5340dk/nrf5340/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf5340dk_nrf5340_cpuapp.overlay + nrf54h20dk/nrf54h20/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay + nrf54l15dk/nrf54l15/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay + nrf54lm20dk/nrf54lm20a/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay + ophelia4ev/nrf54l15/cpuapp: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index d6ced33b76e5..dfebf3644756 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -19,7 +19,8 @@ tests: - frdm_ke15z drivers.comparator.gpio_loopback.nrf_comp: extra_args: - - FILE_SUFFIX="nrf_comp" + - SNIPPET_ROOT="." + - SNIPPET="gpio_loopback_nrf_comp" platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp @@ -28,7 +29,8 @@ tests: - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: extra_args: - - FILE_SUFFIX="nrf_lpcomp" + - SNIPPET_ROOT="." + - SNIPPET="gpio_loopback_nrf_lpcomp" platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp From f7f296869e0654a65d0a4c622b495fa3971e753f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1145/3334] Revert "[nrf fromtree] tests: drivers: watchdog: wdt_basic_api: Run test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cefd7016eb655544b32fb9bddf314a571972c1eb. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- tests/drivers/watchdog/wdt_basic_api/testcase.yaml | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml index 8ed81c715f90..6efd3fa94e91 100644 --- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml +++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml @@ -26,6 +26,7 @@ tests: - panb611evb/nrf54l15/cpuflpr - panb611evb/nrf54l15/cpuflpr/xip - mimxrt700_evk/mimxrt798s/cm33_cpu1 + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns From 12774996a2c5dd1b932b4ace11625761ed1f491b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1146/3334] Revert "[nrf fromtree] tests: boards: nrf: i2c: i2c_slave: Move tests DTS files" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb1e2c3a97f908c7d3e566dbed08a19100b6f7aa. Signed-off-by: Tomasz Moń --- .../nrf/i2c/i2c_slave/{ => boards}/i2c_speed_fast.overlay | 0 .../i2c/i2c_slave/{ => boards}/i2c_speed_fast_plus.overlay | 0 tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename tests/boards/nrf/i2c/i2c_slave/{ => boards}/i2c_speed_fast.overlay (100%) rename tests/boards/nrf/i2c/i2c_slave/{ => boards}/i2c_speed_fast_plus.overlay (100%) diff --git a/tests/boards/nrf/i2c/i2c_slave/i2c_speed_fast.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/i2c_speed_fast.overlay similarity index 100% rename from tests/boards/nrf/i2c/i2c_slave/i2c_speed_fast.overlay rename to tests/boards/nrf/i2c/i2c_slave/boards/i2c_speed_fast.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/i2c_speed_fast_plus.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/i2c_speed_fast_plus.overlay similarity index 100% rename from tests/boards/nrf/i2c/i2c_slave/i2c_speed_fast_plus.overlay rename to tests/boards/nrf/i2c/i2c_slave/boards/i2c_speed_fast_plus.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index 8e324bcaf563..32ac4fbfe9f3 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -41,7 +41,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp extra_args: - - EXTRA_DTC_OVERLAY_FILE="i2c_speed_fast.overlay" + - EXTRA_DTC_OVERLAY_FILE="boards/i2c_speed_fast.overlay" boards.nrf.i2c.i2c_slave.fast_plus: platform_allow: - nrf5340dk/nrf5340/cpuapp @@ -52,4 +52,4 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr extra_args: - - EXTRA_DTC_OVERLAY_FILE="i2c_speed_fast_plus.overlay" + - EXTRA_DTC_OVERLAY_FILE="boards/i2c_speed_fast_plus.overlay" From b4ba40c0bc90f31c316463b8695031b67c0f2054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1147/3334] Revert "[nrf fromtree] tests: boards: nrf: i2c: i2c_slave: Run test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6764387734081f50e613db93cc8312d33f3c7c76. Signed-off-by: Tomasz Moń --- .../i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 - .../i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 2 -- 3 files changed, 10 deletions(-) delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index b01af3b36a7b..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_NRFX_TWIS22=y diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index 32ac4fbfe9f3..02a2ee5f7518 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -15,7 +15,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -31,7 +30,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf52840dk/nrf52840 From dc449f8ca7bc9f817503de140a198cbbe8e3bc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1148/3334] Revert "[nrf fromtree] tests: boards: nrf: i2c: i2c_slave: Fix DTS formatting" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 429eaa3aca3d2b8cf76a9add093e98d983b42a78. Signed-off-by: Tomasz Moń --- .../i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay | 12 ------------ .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 12 ------------ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 12 ------------ .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 12 ------------ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 12 ------------ 5 files changed, 60 deletions(-) diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay index 8f9f7135f7b2..cb4debaa7e3c 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf52840dk_nrf52840.overlay @@ -1,14 +1,3 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Two loopbacks are required: - * P1.01 - P1.02 - * P1.03 - P1.04 - */ - / { aliases { i2c-slave = &i2c1; @@ -55,7 +44,6 @@ dut_twim: &i2c0 { pinctrl-1 = <&i2c0_sleep_alt>; pinctrl-names = "default", "sleep"; clock-frequency = ; - sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay index c1f2a3b559ee..2ccac66dc723 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -1,14 +1,3 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Two loopbacks are required: - * P0.04 - P0.05 - * P0.06 - P0.07 - */ - / { aliases { i2c-slave = &i2c2; @@ -55,7 +44,6 @@ dut_twim: &i2c1 { pinctrl-1 = <&i2c1_sleep_alt>; pinctrl-names = "default", "sleep"; clock-frequency = ; - sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 4f6894cf8585..444db89627d2 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,14 +1,3 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Two loopbacks are required: - * P2.08 - P2.09 - * P1.02 - P1.03 - */ - / { aliases { i2c-slave = &i2c131; @@ -59,7 +48,6 @@ dut_twim: &i2c130 { pinctrl-names = "default", "sleep"; clock-frequency = ; memory-regions = <&cpuapp_dma_region>; - sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.overlay index b42391719983..fbfb1e55772d 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -1,14 +1,3 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Two loopbacks are required: - * P2.08 - P2.09 - * P1.02 - P1.03 - */ - / { aliases { i2c-slave = &i2c131; @@ -58,7 +47,6 @@ dut_twim: &i2c130 { pinctrl-1 = <&i2c130_sleep_alt>; pinctrl-names = "default", "sleep"; clock-frequency = ; - sensor: sensor@54 { reg = <0x54>; }; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index aed3aca12dcb..feaec96977c7 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -1,14 +1,3 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Two loopbacks are required: - * P1.08 - P1.09 - * P1.12 - P1.13 - */ - / { aliases { i2c-slave = &i2c22; @@ -58,7 +47,6 @@ dut_twim: &i2c21 { pinctrl-1 = <&i2c21_sleep_alt>; pinctrl-names = "default", "sleep"; clock-frequency = ; - sensor: sensor@54 { reg = <0x54>; }; From 2b9a406d30f599a2f317bb530da309a2b75c8beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1149/3334] Revert "[nrf fromtree] tests: drivers: counter: counter_basic_api: Fix test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 84621be509b0076ff9ae1979056cb85e4ac402b0. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index b34c0dadce5c..000000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_common.dtsi" From 73714b0ec94390387f653b4cc96c69285a065f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1150/3334] Revert "[nrf fromtree] tests: drivers: spi: spi_controller_peripheral: Move test overlays" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6226fe112e47b34ebe96b25bb0e8400dc76fd115. Signed-off-by: Tomasz Moń --- .../{ => boards}/1m333333hz.overlay | 0 .../{ => boards}/1mhz.overlay | 0 .../{ => boards}/250khz.overlay | 0 .../{ => boards}/2m666666hz.overlay | 0 .../{ => boards}/2mhz.overlay | 0 .../{ => boards}/4mhz.overlay | 0 .../{ => boards}/500khz.overlay | 0 .../{ => boards}/8mhz.overlay | 0 .../spi/spi_controller_peripheral/testcase.yaml | 16 ++++++++-------- 9 files changed, 8 insertions(+), 8 deletions(-) rename tests/drivers/spi/spi_controller_peripheral/{ => boards}/1m333333hz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{ => boards}/1mhz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{ => boards}/250khz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{ => boards}/2m666666hz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{ => boards}/2mhz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{ => boards}/4mhz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{ => boards}/500khz.overlay (100%) rename tests/drivers/spi/spi_controller_peripheral/{ => boards}/8mhz.overlay (100%) diff --git a/tests/drivers/spi/spi_controller_peripheral/1m333333hz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/1m333333hz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/1m333333hz.overlay rename to tests/drivers/spi/spi_controller_peripheral/boards/1m333333hz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/1mhz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/1mhz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/1mhz.overlay rename to tests/drivers/spi/spi_controller_peripheral/boards/1mhz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/250khz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/250khz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/250khz.overlay rename to tests/drivers/spi/spi_controller_peripheral/boards/250khz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/2m666666hz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/2m666666hz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/2m666666hz.overlay rename to tests/drivers/spi/spi_controller_peripheral/boards/2m666666hz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/2mhz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/2mhz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/2mhz.overlay rename to tests/drivers/spi/spi_controller_peripheral/boards/2mhz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/4mhz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/4mhz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/4mhz.overlay rename to tests/drivers/spi/spi_controller_peripheral/boards/4mhz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/500khz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/500khz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/500khz.overlay rename to tests/drivers/spi/spi_controller_peripheral/boards/500khz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/8mhz.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/8mhz.overlay similarity index 100% rename from tests/drivers/spi/spi_controller_peripheral/8mhz.overlay rename to tests/drivers/spi/spi_controller_peripheral/boards/8mhz.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 3fa4cb16db6b..030e2d52ddb9 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -20,35 +20,35 @@ tests: drivers.spi.spi_mode0: extra_configs: - CONFIG_TESTED_SPI_MODE=0 - extra_args: EXTRA_DTC_OVERLAY_FILE="250khz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/250khz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_mode1: extra_configs: - CONFIG_TESTED_SPI_MODE=1 - extra_args: EXTRA_DTC_OVERLAY_FILE="500khz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/500khz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_mode2: extra_configs: - CONFIG_TESTED_SPI_MODE=2 - extra_args: EXTRA_DTC_OVERLAY_FILE="1mhz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/1mhz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_mode3: extra_configs: - CONFIG_TESTED_SPI_MODE=3 - extra_args: EXTRA_DTC_OVERLAY_FILE="2mhz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/2mhz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_1M333333Hz: extra_configs: - CONFIG_TESTED_SPI_MODE=0 - extra_args: EXTRA_DTC_OVERLAY_FILE="1m333333hz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/1m333333hz.overlay" integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp @@ -56,7 +56,7 @@ tests: drivers.spi.spi_2M666666Hz: extra_configs: - CONFIG_TESTED_SPI_MODE=0 - extra_args: EXTRA_DTC_OVERLAY_FILE="2m666666hz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/2m666666hz.overlay" integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp @@ -64,14 +64,14 @@ tests: drivers.spi.spi_4MHz: extra_configs: - CONFIG_TESTED_SPI_MODE=2 - extra_args: EXTRA_DTC_OVERLAY_FILE="4mhz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/4mhz.overlay" integration_platforms: - nrf52840dk/nrf52840 drivers.spi.spi_8MHz: extra_configs: - CONFIG_TESTED_SPI_MODE=1 - extra_args: EXTRA_DTC_OVERLAY_FILE="8mhz.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/8mhz.overlay" integration_platforms: - nrf52840dk/nrf52840 From 63d00e5419b6e74ee1853e09a32a2e9d9f44fe49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:43 +0100 Subject: [PATCH 1151/3334] Revert "[nrf fromtree] tests: drivers: spi: spi_controller_peripheral: Fix DTS formatting" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 717be11e6a15ec39da71f126a23fea218c53b561. Signed-off-by: Tomasz Moń --- .../spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay | 1 - .../boards/nrf54h20dk_nrf54h20_common.dtsi | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay | 1 - 6 files changed, 6 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 db08930ddd9a..72bb74931860 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay @@ -50,7 +50,6 @@ overrun-character = <0x00>; cs-gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; spi-max-frequency = ; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_common.dtsi index 6aeb34699d9f..bad32ea4d1c9 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -60,7 +60,6 @@ overrun-character = <0x00>; cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay index ee6a5e3c19eb..81b1303ede15 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay @@ -60,7 +60,6 @@ memory-regions = <&dma_fast_region>; cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay index ba00e866b60e..be975607c1b5 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpuapp_fast_spis.overlay @@ -110,7 +110,6 @@ memory-regions = <&dma_fast_region>; cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index cf83ac20a270..7915897066d8 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -54,7 +54,6 @@ overrun-character = <0x00>; cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay index 1c36704b5ba2..7fd8d54d8db5 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay @@ -54,7 +54,6 @@ overrun-character = <0x00>; cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; - dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; From 1544b9d40337e59980c191430823e8825d694398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1152/3334] Revert "[nrf fromtree] tests: drivers: spi: Run spi_controller_peripheral on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a2cb22d5e63614a2dac7fbdfdd462689c94b84eb. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- tests/drivers/spi/spi_controller_peripheral/testcase.yaml | 3 --- 2 files changed, 10 deletions(-) delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 030e2d52ddb9..f2c10b6c716d 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -12,7 +12,6 @@ common: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -82,7 +81,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -96,7 +94,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From fb9ae4c815e3c6988f28b1fea9365ff476deb02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1153/3334] Revert "[nrf fromtree] tests: drivers: adc: Run test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit db649acc72a534717cf71958942a61569fac48d3. Signed-off-by: Tomasz Moń --- .../adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- tests/drivers/adc/adc_api/testcase.yaml | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index 43c28f0658e5..000000000000 --- a/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/adc/adc_api/testcase.yaml b/tests/drivers/adc/adc_api/testcase.yaml index 7b40b93431b9..3aa5e089b830 100644 --- a/tests/drivers/adc/adc_api/testcase.yaml +++ b/tests/drivers/adc/adc_api/testcase.yaml @@ -11,6 +11,7 @@ tests: - nucleo_u031r8 - panb611evb/nrf54l15/cpuapp - panb611evb/nrf54l15/cpuapp/ns + - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns From ebce410445b3ed94451e0c67e6a7f223d6935c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1154/3334] Revert "[nrf fromtree] tests: boards: nrf: qdec: Run test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 42120aeeeed6c859e60f421cb1e0388272495886. Signed-off-by: Tomasz Moń --- .../qdec/boards/nrf54l15dk_nrf54l15_common.dtsi | 16 ---------------- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 5 +++++ .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 6 ------ .../boards/nrf54l15dk_nrf54l15_cpuflpr.overlay | 5 +++++ tests/boards/nrf/qdec/testcase.yaml | 1 - 5 files changed, 10 insertions(+), 23 deletions(-) delete mode 100644 tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi index 2b9db5d36352..f27294146527 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi @@ -13,19 +13,15 @@ / { encoder-emulate { compatible = "gpio-leds"; - phase_a0: phase_a0 { gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; - phase_b0: phase_b0 { gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; - phase_a1: phase_a1 { gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; }; - phase_b1: phase_b1 { gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; }; @@ -33,12 +29,10 @@ qdec_loopbacks: loopbacks { compatible = "test-qdec-loopbacks"; - loopback0 { qdec = <&qdec20>; qenc-emul-gpios = <&phase_a0 &phase_b0>; }; - loopback1 { qdec = <&qdec21>; qenc-emul-gpios = <&phase_a1 &phase_b1>; @@ -105,13 +99,3 @@ led-pre = <500>; zephyr,pm-device-runtime-auto; }; - -/* To prevent enabling console receiver on cpuapp. */ -&uart20 { - disable-rx; -}; - -/* To prevent enabling console receiver on cpuflpr. */ -&uart30 { - disable-rx; -}; diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 68c360fe5eb8..65d42ec40869 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,3 +4,8 @@ */ #include "nrf54l15dk_nrf54l15_common.dtsi" + +/* To prevent enabling console receiver. */ +&uart20 { + disable-rx; +}; diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index 6537ce98e293..000000000000 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_common.dtsi" diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay index 68c360fe5eb8..76038a2fa012 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -4,3 +4,8 @@ */ #include "nrf54l15dk_nrf54l15_common.dtsi" + +/* To prevent enabling console receiver. */ +&uart30 { + disable-rx; +}; diff --git a/tests/boards/nrf/qdec/testcase.yaml b/tests/boards/nrf/qdec/testcase.yaml index e3eb262685ad..2908a68a6d14 100644 --- a/tests/boards/nrf/qdec/testcase.yaml +++ b/tests/boards/nrf/qdec/testcase.yaml @@ -5,7 +5,6 @@ common: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr integration_platforms: From 483e82ead8f1f620d6a0fbf4019da624ef45f183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1155/3334] Revert "[nrf fromtree] tests: drivers: sensor: temp_sensor: Run test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 20f1eb391fb278aef44fe774b9a2d7b0b0e1b4fc. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tests/drivers/sensor/temp_sensor/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/sensor/temp_sensor/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/sensor/temp_sensor/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/sensor/temp_sensor/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" From dd998cfe2ff110ea584a20524f26cde335a99070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1156/3334] Revert "[nrf fromtree] tests: drivers: pwm: Run test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 821a72fea67174e3b0458eb1da4eecb102b94215. Signed-off-by: Tomasz Moń --- .../nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml | 1 - 4 files changed, 10 deletions(-) delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml index cff1b1970d39..28b7a3c15db3 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml @@ -16,7 +16,6 @@ supported: - gpio - i2c - i2s - - pwm - spi - watchdog vendor: nordic diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index 795414a504ab..000000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SKIP_EDGE_NUM=4 diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml index 448eccb5e3bb..2959739d50be 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml @@ -20,7 +20,6 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From e28b7f635791815f6701233f6802115773183017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1157/3334] Revert "[nrf fromtree] boards: nordic: nrf54l15dk: Sort supported fetures" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 62b29a2bde6c1934f9f102ff6e33e396c3056a34. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml | 2 +- boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml index 6447d9d789bd..e23a2a0073a9 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml @@ -17,8 +17,8 @@ supported: - dmic - gpio - i2c - - i2s - pwm - retained_mem - spi - watchdog + - i2s diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml index 28b7a3c15db3..43bd7c8f2445 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns.yaml @@ -12,11 +12,12 @@ ram: 256 flash: 1524 supported: - adc - - counter - gpio - i2c - - i2s - spi + - counter - watchdog + - adc + - i2s vendor: nordic sysbuild: true From 53469b9db0e6971c10889b1b4a14182d28cfb70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1158/3334] Revert "[nrf fromtree] tests: drivers: i2s: Run I2S tests on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c929668f3e19242004581521c5c7d7789704115c. Signed-off-by: Tomasz Moń --- .../i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- .../i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- 2 files changed, 14 deletions(-) delete mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay delete mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/i2s/i2s_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" From 4215a31bef5c157dfa861ddde4d382d4575df29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1159/3334] Revert "[nrf fromtree] tests: drivers: timer: nrf_grtc_timer: Run test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8a2eff89107b3aeb1dbbdf9478f7d3a7a84fe4fa. Signed-off-by: Tomasz Moń --- 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 549234220ceb..140d9b222599 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -6,7 +6,6 @@ common: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuflpr - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp From 6e46b83aee16ac644acfbface1a48ecc26a83177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1160/3334] Revert "[nrf fromtree] tests: drivers: gpio: gpio_basic_api: Run test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 046b19177101945ebedd862e555dc073c91ad6a2. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- tests/drivers/gpio/gpio_basic_api/testcase.yaml | 1 - 2 files changed, 8 deletions(-) delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" diff --git a/tests/drivers/gpio/gpio_basic_api/testcase.yaml b/tests/drivers/gpio/gpio_basic_api/testcase.yaml index 86431a3dbe5e..2acaf8d8f621 100644 --- a/tests/drivers/gpio/gpio_basic_api/testcase.yaml +++ b/tests/drivers/gpio/gpio_basic_api/testcase.yaml @@ -27,7 +27,6 @@ tests: drivers.gpio.nrf_sense_edge.nrf54l: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns extra_args: "EXTRA_DTC_OVERLAY_FILE=boards/nrf54l_sense_edge.overlay" drivers.gpio.mr_canhubk3_wkpu: From 0258665fbd22bb9d944085c6193dd9b9bc3d78e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1161/3334] Revert "[nrf fromtree] tests: drivers: clock_control: Enable tests on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d45e116be8a44b634356177bb7c2c873948a4230. Signed-off-by: Tomasz Moń --- .../clock_control/clock_control_api/testcase.yaml | 2 -- .../clock_control/nrf_clock_calibration/testcase.yaml | 1 - .../clock_control/nrf_lf_clock_start/testcase.yaml | 9 --------- tests/drivers/clock_control/onoff/testcase.yaml | 1 - 4 files changed, 13 deletions(-) diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index 3ea6f930f3dc..d3c2669641fc 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -23,7 +23,6 @@ tests: - nrf52840dk/nrf52840 - nrf9160dk/nrf9160 - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -34,7 +33,6 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index 39fec028a40b..708e563900c2 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -9,7 +9,6 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index d789b0e52882..17a783a48084 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -15,7 +15,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -33,7 +32,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -51,7 +49,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -68,7 +65,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -85,7 +81,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -102,7 +97,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -119,7 +113,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -136,7 +129,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -153,7 +145,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpunet - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index 4c50ba3c3ade..1f557c918ab8 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -8,7 +8,6 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp From 95778d4b50ce6519d54aa6463501906677236a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1162/3334] Revert "[nrf fromtree] tests: drivers: uart: uart_async_api: Fix test on nrf54l15 NS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 520864916386062fa7c72c0be16e04b4fc5f26e1. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 7 ------- 2 files changed, 8 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay deleted file mode 100644 index f1d1d387c2e0..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuapp.overlay" From 78b09a07e743a41fc32ef235a5b50288bd86cb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1163/3334] Revert "[nrf fromtree] usb: device_next: msc: do not copy SCSI data" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ee9de26a78a5b1a494b82ec062f8c3c17633c5ec. Signed-off-by: Tomasz Moń --- subsys/usb/device_next/class/usbd_msc.c | 180 +++++++++---------- subsys/usb/device_next/class/usbd_msc_scsi.c | 29 +-- subsys/usb/device_next/class/usbd_msc_scsi.h | 6 +- 3 files changed, 94 insertions(+), 121 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index 6e6c75f671e9..07d5d09347f6 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -60,8 +60,11 @@ struct CSW { /* Single instance is likely enough because it can support multiple LUNs */ #define MSC_NUM_INSTANCES CONFIG_USBD_MSC_INSTANCES_COUNT +/* Can be 64 if device is not High-Speed capable */ +#define MSC_BUF_SIZE USBD_MAX_BULK_MPS + UDC_BUF_POOL_DEFINE(msc_ep_pool, - MSC_NUM_INSTANCES * 2, USBD_MAX_BULK_MPS, + MSC_NUM_INSTANCES * 2, MSC_BUF_SIZE, sizeof(struct udc_buf_info), NULL); struct msc_event { @@ -118,8 +121,9 @@ struct msc_bot_ctx { struct scsi_ctx luns[CONFIG_USBD_MSC_LUNS_PER_INSTANCE]; struct CBW cbw; struct CSW csw; - uint8_t *scsi_buf; + uint8_t scsi_buf[CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]; uint32_t transferred_data; + size_t scsi_offset; size_t scsi_bytes; }; @@ -139,53 +143,6 @@ static struct net_buf *msc_buf_alloc(const uint8_t ep) return buf; } -static struct net_buf *msc_buf_alloc_data(const uint8_t ep, uint8_t *data, size_t len) -{ - struct net_buf *buf = NULL; - struct udc_buf_info *bi; - - buf = net_buf_alloc_with_data(&msc_ep_pool, data, len, K_NO_WAIT); - if (buf == NULL) { - return NULL; - } - - if (USB_EP_DIR_IS_OUT(ep)) { - /* Buffer is empty, USB stack will write data from host */ - buf->len = 0; - } - - bi = udc_get_buf_info(buf); - bi->ep = ep; - - return buf; -} - -static size_t msc_next_transfer_length(struct usbd_class_data *const c_data) -{ - struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); - struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); - struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; - size_t len = scsi_cmd_remaining_data_len(lun); - - len = MIN(CONFIG_USBD_MSC_SCSI_BUFFER_SIZE, len); - - /* Limit transfer to bulk endpoint wMaxPacketSize multiple */ - if (USBD_SUPPORTS_HIGH_SPEED && - usbd_bus_speed(uds_ctx) == USBD_SPEED_HS) { - len = ROUND_DOWN(len, 512); - } else { - /* Full-Speed */ - len = ROUND_DOWN(len, 64); - } - - /* Round down to sector size multiple */ - if (lun->sector_size) { - len = ROUND_DOWN(len, lun->sector_size); - } - - return len; -} - static uint8_t msc_get_bulk_in(struct usbd_class_data *const c_data) { struct usbd_context *uds_ctx = usbd_class_get_ctx(c_data); @@ -214,11 +171,10 @@ static uint8_t msc_get_bulk_out(struct usbd_class_data *const c_data) return desc->if0_out_ep.bEndpointAddress; } -static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool data) +static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data) { struct msc_bot_ctx *ctx = usbd_class_get_private(c_data); struct net_buf *buf; - uint8_t *scsi_buf = ctx->scsi_buf; uint8_t ep; int ret; @@ -229,13 +185,7 @@ static void msc_queue_bulk_out_ep(struct usbd_class_data *const c_data, bool dat LOG_DBG("Queuing OUT"); ep = msc_get_bulk_out(c_data); - - if (data) { - buf = msc_buf_alloc_data(ep, scsi_buf, msc_next_transfer_length(c_data)); - } else { - buf = msc_buf_alloc(ep); - } - + buf = msc_buf_alloc(ep); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. */ @@ -305,24 +255,16 @@ static void msc_process_read(struct msc_bot_ctx *ctx) struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; int bytes_queued = 0; struct net_buf *buf; - uint8_t *scsi_buf = ctx->scsi_buf; uint8_t ep; + size_t len; int ret; /* Fill SCSI Data IN buffer if there is no data available */ if (ctx->scsi_bytes == 0) { - size_t len = msc_next_transfer_length(ctx->class_node); - - bytes_queued = scsi_read_data(lun, scsi_buf, len); - } else { - bytes_queued = ctx->scsi_bytes; + ctx->scsi_bytes = scsi_read_data(lun, ctx->scsi_buf); + ctx->scsi_offset = 0; } - /* All data is submitted in one go. Any potential new data will - * have to be retrieved using scsi_read_data() on next call. - */ - ctx->scsi_bytes = 0; - if (atomic_test_and_set_bit(&ctx->bits, MSC_BULK_IN_QUEUED)) { __ASSERT_NO_MSG(false); LOG_ERR("IN already queued"); @@ -330,12 +272,33 @@ static void msc_process_read(struct msc_bot_ctx *ctx) } ep = msc_get_bulk_in(ctx->class_node); - buf = msc_buf_alloc_data(ep, scsi_buf, bytes_queued); + buf = msc_buf_alloc(ep); /* The pool is large enough to support all allocations. Failing alloc * indicates either a memory leak or logic error. */ __ASSERT_NO_MSG(buf); + while (ctx->scsi_bytes - ctx->scsi_offset > 0) { + len = MIN(ctx->scsi_bytes - ctx->scsi_offset, + MSC_BUF_SIZE - bytes_queued); + if (len == 0) { + /* Either queued as much as possible or there is no more + * SCSI IN data available + */ + break; + } + + net_buf_add_mem(buf, &ctx->scsi_buf[ctx->scsi_offset], len); + bytes_queued += len; + ctx->scsi_offset += len; + + if (ctx->scsi_bytes == ctx->scsi_offset) { + /* SCSI buffer can be reused now */ + ctx->scsi_bytes = scsi_read_data(lun, ctx->scsi_buf); + ctx->scsi_offset = 0; + } + } + /* Either the net buf is full or there is no more SCSI data */ ctx->csw.dCSWDataResidue -= bytes_queued; ret = usbd_ep_enqueue(ctx->class_node, buf); @@ -356,6 +319,7 @@ static void msc_process_cbw(struct msc_bot_ctx *ctx) cb_len = scsi_usb_boot_cmd_len(ctx->cbw.CBWCB, ctx->cbw.bCBWCBLength); data_len = scsi_cmd(lun, ctx->cbw.CBWCB, cb_len, ctx->scsi_buf); ctx->scsi_bytes = data_len; + ctx->scsi_offset = 0; cmd_is_data_read = scsi_cmd_is_data_read(lun); cmd_is_data_write = scsi_cmd_is_data_write(lun); data_len += scsi_cmd_remaining_data_len(lun); @@ -435,17 +399,46 @@ static void msc_process_write(struct msc_bot_ctx *ctx, ctx->transferred_data += len; - if ((len > 0) && (scsi_cmd_remaining_data_len(lun) > 0)) { - /* Pass data to SCSI layer. */ - tmp = scsi_write_data(lun, buf, len); - __ASSERT(tmp <= len, "Processed more data than requested"); - if (tmp == 0) { - LOG_WRN("SCSI handler didn't process %d bytes", len); - } else { - LOG_DBG("SCSI processed %d out of %d bytes", tmp, len); - } + while ((len > 0) && (scsi_cmd_remaining_data_len(lun) > 0)) { + /* Copy received data to the end of SCSI buffer */ + tmp = MIN(len, sizeof(ctx->scsi_buf) - ctx->scsi_bytes); + memcpy(&ctx->scsi_buf[ctx->scsi_bytes], buf, tmp); + ctx->scsi_bytes += tmp; + buf += tmp; + len -= tmp; + + /* Pass data to SCSI layer when either all transfer data bytes + * have been received or SCSI buffer is full. + */ + while ((ctx->scsi_bytes >= scsi_cmd_remaining_data_len(lun)) || + (ctx->scsi_bytes == sizeof(ctx->scsi_buf))) { + tmp = scsi_write_data(lun, ctx->scsi_buf, ctx->scsi_bytes); + __ASSERT(tmp <= ctx->scsi_bytes, + "Processed more data than requested"); + if (tmp == 0) { + LOG_WRN("SCSI handler didn't process %d bytes", + ctx->scsi_bytes); + ctx->scsi_bytes = 0; + } else { + LOG_DBG("SCSI processed %d out of %d bytes", + tmp, ctx->scsi_bytes); + } - ctx->csw.dCSWDataResidue -= tmp; + ctx->csw.dCSWDataResidue -= tmp; + if (scsi_cmd_remaining_data_len(lun) == 0) { + /* Abandon any leftover data */ + ctx->scsi_bytes = 0; + break; + } + + /* Move remaining data at the start of SCSI buffer. Note + * that the copied length here is zero (and thus no copy + * happens) when underlying sector size is equal to SCSI + * buffer size. + */ + memmove(ctx->scsi_buf, &ctx->scsi_buf[tmp], ctx->scsi_bytes - tmp); + ctx->scsi_bytes -= tmp; + } } if ((ctx->transferred_data >= ctx->cbw.dCBWDataTransferLength) || @@ -521,7 +514,7 @@ static void msc_handle_bulk_in(struct msc_bot_ctx *ctx, struct scsi_ctx *lun = &ctx->luns[ctx->cbw.bCBWLUN]; ctx->transferred_data += len; - if (msc_next_transfer_length(ctx->class_node) == 0) { + if (ctx->scsi_bytes == 0) { if (ctx->csw.dCSWDataResidue > 0) { /* Case (5) Hi > Di * While we may have sent short packet, device @@ -630,11 +623,9 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) switch (ctx->state) { case MSC_BBB_EXPECT_CBW: - msc_queue_bulk_out_ep(evt.c_data, false); - break; case MSC_BBB_PROCESS_WRITE: /* Ensure we can accept next OUT packet */ - msc_queue_bulk_out_ep(evt.c_data, true); + msc_queue_bulk_out_ep(evt.c_data); break; default: break; @@ -654,7 +645,7 @@ static void usbd_msc_thread(void *arg1, void *arg2, void *arg3) if (ctx->state == MSC_BBB_PROCESS_READ) { msc_process_read(ctx); } else if (ctx->state == MSC_BBB_PROCESS_WRITE) { - msc_queue_bulk_out_ep(evt.c_data, true); + msc_queue_bulk_out_ep(evt.c_data); } else if (ctx->state == MSC_BBB_SEND_CSW) { msc_send_csw(ctx); } @@ -873,17 +864,14 @@ struct usbd_class_api msc_bot_api = { .init = msc_bot_init, }; -#define DEFINE_MSC_BOT_CLASS_DATA(x, _) \ - UDC_STATIC_BUF_DEFINE(scsi_buf_##x, CONFIG_USBD_MSC_SCSI_BUFFER_SIZE); \ - \ - static struct msc_bot_ctx msc_bot_ctx_##x = { \ - .desc = &msc_bot_desc_##x, \ - .fs_desc = msc_bot_fs_desc_##x, \ - .hs_desc = msc_bot_hs_desc_##x, \ - .scsi_buf = scsi_buf_##x \ - }; \ - \ - USBD_DEFINE_CLASS(msc_##x, &msc_bot_api, &msc_bot_ctx_##x, \ +#define DEFINE_MSC_BOT_CLASS_DATA(x, _) \ + static struct msc_bot_ctx msc_bot_ctx_##x = { \ + .desc = &msc_bot_desc_##x, \ + .fs_desc = msc_bot_fs_desc_##x, \ + .hs_desc = msc_bot_hs_desc_##x, \ + }; \ + \ + USBD_DEFINE_CLASS(msc_##x, &msc_bot_api, &msc_bot_ctx_##x, \ &msc_bot_vregs); LISTIFY(MSC_NUM_INSTANCES, DEFINE_MSC_BOT_DESCRIPTOR, ()) diff --git a/subsys/usb/device_next/class/usbd_msc_scsi.c b/subsys/usb/device_next/class/usbd_msc_scsi.c index ad88b08af2a3..82aa0f50e624 100644 --- a/subsys/usb/device_next/class/usbd_msc_scsi.c +++ b/subsys/usb/device_next/class/usbd_msc_scsi.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "usbd_msc_scsi.h" @@ -340,24 +339,6 @@ static int update_disk_info(struct scsi_ctx *const ctx) status = -EIO; } - if (!ctx->sector_size) { - status = -EIO; - } else if ((ctx->sector_size % USBD_MAX_BULK_MPS) && - (USBD_MAX_BULK_MPS % ctx->sector_size)) { - /* Zephyr MSC class implementation initially allowed any sector - * size, however doing so requires bouncing which significantly - * impedes throughput. To enable zero-copy and scheduling larger - * transfers, the implementation is now restricted to work only - * with power of two disk sizes. - * - * USB bulk wMaxPacketSize is 64 (Full-Speed), 512 (High-Speed) - * or 1024 (Super-Speed) and most common disk sector sizes are - * either 512 or 4096. Therefore the power of two limitation - * shouldn't have effect on any actual application. - */ - status = -EIO; - } - if (ctx->sector_size > CONFIG_USBD_MSC_SCSI_BUFFER_SIZE) { status = -ENOMEM; } @@ -726,11 +707,12 @@ validate_transfer_length(struct scsi_ctx *ctx, uint32_t lba, uint16_t length) return 0; } -static size_t fill_read_10(struct scsi_ctx *ctx, uint8_t *buf, size_t length) +static size_t fill_read_10(struct scsi_ctx *ctx, + uint8_t buf[static CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]) { uint32_t sectors; - sectors = MIN(length, ctx->remaining_data) / ctx->sector_size; + sectors = MIN(CONFIG_USBD_MSC_SCSI_BUFFER_SIZE, ctx->remaining_data) / ctx->sector_size; if (disk_access_read(ctx->disk, buf, ctx->lba, sectors) != 0) { /* Terminate transfer */ sectors = 0; @@ -915,14 +897,15 @@ size_t scsi_cmd_remaining_data_len(struct scsi_ctx *ctx) return ctx->remaining_data; } -size_t scsi_read_data(struct scsi_ctx *ctx, uint8_t *buf, size_t length) +size_t scsi_read_data(struct scsi_ctx *ctx, + uint8_t buf[static CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]) { size_t retrieved = 0; __ASSERT_NO_MSG(ctx->cmd_is_data_read); if ((ctx->remaining_data > 0) && ctx->read_cb) { - retrieved = ctx->read_cb(ctx, buf, length); + retrieved = ctx->read_cb(ctx, buf); } ctx->remaining_data -= retrieved; if (retrieved == 0) { diff --git a/subsys/usb/device_next/class/usbd_msc_scsi.h b/subsys/usb/device_next/class/usbd_msc_scsi.h index ef92899d477a..338bb3d5f9bc 100644 --- a/subsys/usb/device_next/class/usbd_msc_scsi.h +++ b/subsys/usb/device_next/class/usbd_msc_scsi.h @@ -66,7 +66,8 @@ struct scsi_ctx { const char *vendor; const char *product; const char *revision; - size_t (*read_cb)(struct scsi_ctx *ctx, uint8_t *buf, size_t length); + size_t (*read_cb)(struct scsi_ctx *ctx, + uint8_t buf[static CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]); size_t (*write_cb)(struct scsi_ctx *ctx, const uint8_t *buf, size_t length); size_t remaining_data; uint32_t lba; @@ -91,7 +92,8 @@ size_t scsi_cmd(struct scsi_ctx *ctx, const uint8_t *cb, int len, bool scsi_cmd_is_data_read(struct scsi_ctx *ctx); bool scsi_cmd_is_data_write(struct scsi_ctx *ctx); size_t scsi_cmd_remaining_data_len(struct scsi_ctx *ctx); -size_t scsi_read_data(struct scsi_ctx *ctx, uint8_t *data_in_buf, size_t length); +size_t scsi_read_data(struct scsi_ctx *ctx, + uint8_t data_in_buf[static CONFIG_USBD_MSC_SCSI_BUFFER_SIZE]); size_t scsi_write_data(struct scsi_ctx *ctx, const uint8_t *buf, size_t length); enum scsi_status_code scsi_cmd_get_status(struct scsi_ctx *ctx); From e3393b2385c065ad5512ff09d04112e9e9cba922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1164/3334] Revert "[nrf fromtree] samples: usb: uac2: explicit: Fix SOF offset integer conversion glitch" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1d99ca53ee5ad1eb8eedfb7f73208032943d08ba. Signed-off-by: Tomasz Moń --- .../usb/uac2_explicit_feedback/src/feedback_nrf.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c index 6b7ed239b268..6ea9d2374d96 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c @@ -272,7 +272,7 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, int sof_offset; if (!IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)) { - uint32_t nominator; + uint32_t clks_per_edge; /* Convert timer clock (independent from both Audio clock and * USB host SOF clock) to fake sample clock shifted by P values. @@ -282,17 +282,18 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, * when regulated and therefore the relative clock frequency * discrepancies are essentially negligible. */ - nominator = MIN(sof_cc, framestart_cc) * ctx->counts_per_sof; - sof_offset = nominator / MAX(sof_cc, 1); - } else { - sof_offset = framestart_cc; + clks_per_edge = sof_cc / ctx->counts_per_sof; + sof_cc /= MAX(clks_per_edge, 1); + framestart_cc /= MAX(clks_per_edge, 1); } /* /2 because we treat the middle as a turning point from being * "too late" to "too early". */ - if (sof_offset > ctx->counts_per_sof/2) { - sof_offset -= ctx->counts_per_sof; + if (framestart_cc > ctx->counts_per_sof/2) { + sof_offset = framestart_cc - ctx->counts_per_sof; + } else { + sof_offset = framestart_cc; } /* The heuristic above is not enough when the offset gets too large. From 077e6bd614bd183e454b1abe908ef011e962183e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1165/3334] Revert "[nrf fromtree] samples: usb: uac2: Support High-Speed operation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b92a74ec63d125b34666ce669d3580f02561c429. Signed-off-by: Tomasz Moń --- .../usb/uac2_explicit_feedback/app.overlay | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 4 + .../usb/uac2_explicit_feedback/src/feedback.h | 13 +- .../src/feedback_dummy.c | 28 +-- .../uac2_explicit_feedback/src/feedback_nrf.c | 166 +++++------------- .../usb/uac2_explicit_feedback/src/main.c | 28 ++- .../usb/uac2_implicit_feedback/app.overlay | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 4 + .../usb/uac2_implicit_feedback/src/feedback.h | 9 +- .../src/feedback_dummy.c | 4 +- .../uac2_implicit_feedback/src/feedback_nrf.c | 26 +-- .../usb/uac2_implicit_feedback/src/main.c | 51 ++---- 12 files changed, 109 insertions(+), 226 deletions(-) diff --git a/samples/subsys/usb/uac2_explicit_feedback/app.overlay b/samples/subsys/usb/uac2_explicit_feedback/app.overlay index 21119a79206d..3ff71797aa99 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/app.overlay +++ b/samples/subsys/usb/uac2_explicit_feedback/app.overlay @@ -11,7 +11,6 @@ compatible = "zephyr,uac2"; status = "okay"; full-speed; - high-speed; audio-function = ; uac_aclk: aclk { diff --git a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index d7526fc6ec9a..0e35fa1f491e 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/subsys/usb/uac2_explicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -2,3 +2,7 @@ CONFIG_NRFX_GPPI=y CONFIG_NRFX_TIMER131=y CONFIG_NRFX_GPIOTE130=y + +# Sample is Full-Speed only, prevent High-Speed enumeration +CONFIG_UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED=n +CONFIG_USBD_MAX_SPEED_FULL=y diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h b/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h index 37c1dc975e58..7f5bf2027d8f 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h @@ -9,14 +9,15 @@ #include -/* This sample is currently supporting only 48 kHz sample rate. */ -#define SAMPLE_RATE 48000 +/* Nominal number of samples received on each SOF. This sample is currently + * supporting only 48 kHz sample rate. + */ +#define SAMPLES_PER_SOF 48 struct feedback_ctx *feedback_init(void); -void feedback_reset_ctx(struct feedback_ctx *ctx, bool microframes); +void feedback_reset_ctx(struct feedback_ctx *ctx); void feedback_process(struct feedback_ctx *ctx); -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, - bool microframes); +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued); uint32_t feedback_value(struct feedback_ctx *ctx); -#define SAMPLES_PER_SOF 48 + #endif /* FEEDBACK_H_ */ diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c index 378a43e06ef4..7e274ca2ed05 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c @@ -5,23 +5,15 @@ */ #include -#include #include "feedback.h" #warning "No target specific feedback code, overruns/underruns will occur" -#define FEEDBACK_FS_K 10 -#define FEEDBACK_FS_SHIFT 4 -#define FEEDBACK_HS_K 13 -#define FEEDBACK_HS_SHIFT 3 - -static struct feedback_ctx { - bool high_speed; -} fb_ctx; +#define FEEDBACK_K 10 struct feedback_ctx *feedback_init(void) { - return &fb_ctx; + return NULL; } void feedback_process(struct feedback_ctx *ctx) @@ -29,25 +21,19 @@ void feedback_process(struct feedback_ctx *ctx) ARG_UNUSED(ctx); } -void feedback_reset_ctx(struct feedback_ctx *ctx, bool microframes) +void feedback_reset_ctx(struct feedback_ctx *ctx) { - ctx->high_speed = microframes; + ARG_UNUSED(ctx); } -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, - bool microframes) +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued) { + ARG_UNUSED(ctx); ARG_UNUSED(i2s_blocks_queued); - - ctx->high_speed = microframes; } uint32_t feedback_value(struct feedback_ctx *ctx) { /* Always request nominal number of samples */ - if (USBD_SUPPORTS_HIGH_SPEED && ctx->high_speed) { - return (SAMPLE_RATE / 8000) << (FEEDBACK_HS_K + FEEDBACK_HS_SHIFT); - } - - return (SAMPLE_RATE / 1000) << (FEEDBACK_FS_K + FEEDBACK_FS_SHIFT); + return SAMPLES_PER_SOF << FEEDBACK_K; } diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c index 6ea9d2374d96..62a7ad05ef9c 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf.c @@ -84,14 +84,8 @@ static const nrfx_timer_t feedback_timer_instance = * Full-Speed isochronous feedback is Q10.10 unsigned integer left-justified in * the 24-bits so it has Q10.14 format. This sample application puts zeroes to * the 4 least significant bits (does not use the bits for extra precision). - * - * High-Speed isochronous feedback is Q12.13 unsigned integer aligned in the - * 32-bits so the binary point is located between second and third byte so it - * has Q16.16 format. This sample applications puts zeroes to the 3 least - * significant bits (does not use the bits for extra precision). */ -#define FEEDBACK_FS_K 10 -#define FEEDBACK_HS_K 13 +#define FEEDBACK_K 10 #if defined(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER) #define FEEDBACK_P 1 #else @@ -99,14 +93,11 @@ static const nrfx_timer_t feedback_timer_instance = #endif #define FEEDBACK_FS_SHIFT 4 -#define FEEDBACK_HS_SHIFT 3 static struct feedback_ctx { uint32_t fb_value; int32_t rel_sof_offset; int32_t base_sof_offset; - uint32_t counts_per_sof; - bool high_speed; union { /* For edge counting */ struct { @@ -199,7 +190,7 @@ struct feedback_ctx *feedback_init(void) feedback_target_init(); - feedback_reset_ctx(&fb_ctx, false); + feedback_reset_ctx(&fb_ctx); if (IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)) { err = feedback_edge_counter_setup(); @@ -248,24 +239,6 @@ struct feedback_ctx *feedback_init(void) return &fb_ctx; } -static uint32_t nominal_feedback_value(struct feedback_ctx *ctx) -{ - if (ctx->high_speed) { - return (SAMPLE_RATE / 8000) << (FEEDBACK_HS_K + FEEDBACK_HS_SHIFT); - } - - return (SAMPLE_RATE / 1000) << (FEEDBACK_FS_K + FEEDBACK_FS_SHIFT); -} - -static uint32_t feedback_period(struct feedback_ctx *ctx) -{ - if (ctx->high_speed) { - return BIT(FEEDBACK_HS_K - FEEDBACK_P); - } - - return BIT(FEEDBACK_FS_K - FEEDBACK_P); -} - static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, uint32_t framestart_cc) { @@ -282,7 +255,7 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, * when regulated and therefore the relative clock frequency * discrepancies are essentially negligible. */ - clks_per_edge = sof_cc / ctx->counts_per_sof; + clks_per_edge = sof_cc / (SAMPLES_PER_SOF << FEEDBACK_P); sof_cc /= MAX(clks_per_edge, 1); framestart_cc /= MAX(clks_per_edge, 1); } @@ -290,8 +263,8 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, /* /2 because we treat the middle as a turning point from being * "too late" to "too early". */ - if (framestart_cc > ctx->counts_per_sof/2) { - sof_offset = framestart_cc - ctx->counts_per_sof; + if (framestart_cc > (SAMPLES_PER_SOF << FEEDBACK_P)/2) { + sof_offset = framestart_cc - (SAMPLES_PER_SOF << FEEDBACK_P); } else { sof_offset = framestart_cc; } @@ -306,17 +279,17 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, if (sof_offset >= 0) { abs_diff = sof_offset - ctx->rel_sof_offset; - base_change = -ctx->counts_per_sof; + base_change = -(SAMPLES_PER_SOF << FEEDBACK_P); } else { abs_diff = ctx->rel_sof_offset - sof_offset; - base_change = ctx->counts_per_sof; + base_change = SAMPLES_PER_SOF << FEEDBACK_P; } /* Adjust base offset only if the change happened through the * outer bound. The actual changes should be significantly lower * than the threshold here. */ - if (abs_diff > ctx->counts_per_sof/2) { + if (abs_diff > (SAMPLES_PER_SOF << FEEDBACK_P)/2) { ctx->base_sof_offset += base_change; } } @@ -324,12 +297,8 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, ctx->rel_sof_offset = sof_offset; } -static inline int32_t offset_to_correction(struct feedback_ctx *ctx, int32_t offset) +static inline int32_t offset_to_correction(int32_t offset) { - if (ctx->high_speed) { - return -(offset / BIT(FEEDBACK_P)) * BIT(FEEDBACK_HS_SHIFT); - } - return -(offset / BIT(FEEDBACK_P)) * BIT(FEEDBACK_FS_SHIFT); } @@ -351,66 +320,39 @@ static int32_t pi_update(struct feedback_ctx *ctx) int32_t error = SP - PV; /* - * With above normalization, when data received during SOF n appears on - * I2S during SOF n+3, the Ziegler Nichols Ultimate Gain and oscillation - * periods are as follows: - * - * Full-Speed Linux: Ku = 1.34 tu=77 [FS SOFs] - * Full-Speed Mac OS: Ku = 0.173 tu=580 [FS SOFs] - * High-Speed Mac OS: Ku = 0.895 tu=4516 [HS SOFs] - * High-Speed Windows: Ku = 0.515 tu=819 [HS SOFs] - * - * Linux and Mac OS oscillations were very neat, while Windows seems to - * be averaging feedback value and therefore it is hard to get steady - * oscillations without getting buffer uderrun. + * With above normalization at Full-Speed, when data received during + * SOF n appears on I2S during SOF n+3, the Ziegler Nichols Ultimate + * Gain is around 1.15 and the oscillation period is around 90 SOF. + * (much nicer oscillations with 204.8 SOF period can be observed with + * gain 0.5 when the delay is not n+3, but n+33 - surprisingly the + * resulting PI coefficients after power of two rounding are the same). * * Ziegler-Nichols rule with applied stability margin of 2 results in: - * [FS Linux] [FS Mac] [HS Mac] [HS Windows] - * Kc = 0.22 * Ku 0.2948 0.0381 0.1969 0.1133 - * Ti = 0.83 * tu 63.91 481.4 3748 647.9 - * - * Converting the rules to work with following simple regulator: - * ctx->integrator += error; - * return (error + (ctx->integrator / Ti)) / invKc; + * Kc = 0.22 * Ku = 0.22 * 1.15 = 0.253 + * Ti = 0.83 * tu = 0.83 * 80 = 66.4 * - * gives following parameters: - * [FS Linux] [FS Mac] [HS Mac] [HS Windows] - * invKc = 1/Kc 3 26 5 8 - * Ti 64 482 3748 648 + * Converting the rules above to parallel PI gives: + * Kp = Kc = 0.253 + * Ki = Kc/Ti = 0.254/66.4 ~= 0.0038253 * - * The respective regulators seem to give quarter-amplitude-damping on - * respective hosts, but tuning from one host can get into oscillations - * on another host. The regulation goal is to achieve a single set of - * parameters to be used with all hosts, the only parameter difference - * can be based on operating speed. + * Because we want fixed-point optimized non-tunable implementation, + * the parameters can be conveniently expressed with power of two: + * Kp ~= pow(2, -2) = 0.25 (divide by 4) + * Ki ~= pow(2, -8) = 0.0039 (divide by 256) * - * After a number of tests with all the hosts, following parameters - * were determined to result in nice no-overshoot response: - * [Full-Speed] [High-Speed] - * invKc 128 128 - * Ti 2048 16384 - * - * The power-of-two parameters were arbitrarily chosen for rounding. - * The 16384 = 2048 * 8 can be considered as unifying integration time. - * - * While the no-overshoot is also present with invKc as low as 32, such - * regulator is pretty aggressive and keeps oscillating rather quickly - * around the setpoint (within +-1 sample). Lowering the controller gain - * (increasing invKc value) yields really good results (the outcome is - * similar to using I2S LRCLK edge counting directly). + * This can be implemented as: + * ctx->integrator += error; + * return (error + (ctx->integrator / 64)) / 4; + * but unfortunately such regulator is pretty aggressive and keeps + * oscillating rather quickly around the setpoint (within +-1 sample). * - * The most challenging scenario is for the regulator to stabilize right - * after startup when I2S consumes data faster than nominal sample rate - * (48 kHz = 6 samples per SOF at High-Speed, 48 samples at Full-Speed) - * according to host (I2S consuming data slower slower than nominal - * sample rate is not problematic at all because buffer overrun does not - * stop I2S streaming). This regulator should be able to stabilize for - * any frequency that is within required USB SOF accuracy of 500 ppm, - * i.e. when nominal sample rate is 48 kHz the real sample rate can be - * anywhere in [47.976 kHz; 48.024 kHz] range. + * Manually tweaking the constants so the regulator output is shifted + * down by 4 bits (i.e. change /64 to /2048 and /4 to /128) yields + * really good results (the outcome is similar, even slightly better, + * than using I2S LRCLK edge counting directly). */ ctx->integrator += error; - return (error + (ctx->integrator / (ctx->high_speed ? 16384 : 2048))) / 128; + return (error + (ctx->integrator / 2048)) / 128; } void feedback_process(struct feedback_ctx *ctx) @@ -432,21 +374,17 @@ void feedback_process(struct feedback_ctx *ctx) ctx->fb_counter += sof_cc; ctx->fb_periods++; - if (ctx->fb_periods == feedback_period(ctx)) { + if (ctx->fb_periods == BIT(FEEDBACK_K - FEEDBACK_P)) { - if (ctx->high_speed) { - fb = ctx->fb_counter << FEEDBACK_HS_SHIFT; - } else { - /* fb_counter holds Q10.10 value, left-justify it */ - fb = ctx->fb_counter << FEEDBACK_FS_SHIFT; - } + /* fb_counter holds Q10.10 value, left-justify it */ + fb = ctx->fb_counter << FEEDBACK_FS_SHIFT; /* Align I2S FRAMESTART to USB SOF by adjusting reported * feedback value. This is endpoint specific correction * mentioned but not specified in USB 2.0 Specification. */ if (abs(offset) > BIT(FEEDBACK_P)) { - fb += offset_to_correction(ctx, offset); + fb += offset_to_correction(offset); } ctx->fb_value = fb; @@ -454,25 +392,22 @@ void feedback_process(struct feedback_ctx *ctx) ctx->fb_periods = 0; } } else { - const uint32_t zero_lsb_mask = ctx->high_speed ? 0x7 : 0xF; - /* Use PI controller to generate required feedback deviation * from nominal feedback value. */ - fb = nominal_feedback_value(ctx); + fb = SAMPLES_PER_SOF << (FEEDBACK_K + FEEDBACK_FS_SHIFT); /* Clear the additional LSB bits in feedback value, i.e. do not * use the optional extra resolution. */ - fb += pi_update(ctx) & ~zero_lsb_mask; + fb += pi_update(ctx) & ~0xF; ctx->fb_value = fb; } } -void feedback_reset_ctx(struct feedback_ctx *ctx, bool microframes) +void feedback_reset_ctx(struct feedback_ctx *ctx) { /* Reset feedback to nominal value */ - ctx->high_speed = microframes; - ctx->fb_value = nominal_feedback_value(ctx); + ctx->fb_value = SAMPLES_PER_SOF << (FEEDBACK_K + FEEDBACK_FS_SHIFT); if (IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)) { ctx->fb_counter = 0; ctx->fb_periods = 0; @@ -481,28 +416,19 @@ void feedback_reset_ctx(struct feedback_ctx *ctx, bool microframes) } } -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, - bool microframes) +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued) { - ctx->high_speed = microframes; - ctx->fb_value = nominal_feedback_value(ctx); - - if (microframes) { - ctx->counts_per_sof = (SAMPLE_RATE / 8000) << FEEDBACK_P; - } else { - ctx->counts_per_sof = (SAMPLE_RATE / 1000) << FEEDBACK_P; - } - /* I2S data was supposed to go out at SOF, but it is inevitably * delayed due to triggering I2S start by software. Set relative * SOF offset value in a way that ensures that values past "half * frame" are treated as "too late" instead of "too early" */ - ctx->rel_sof_offset = ctx->counts_per_sof / 2; + ctx->rel_sof_offset = (SAMPLES_PER_SOF << FEEDBACK_P) / 2; /* If there are more than 2 I2S blocks queued, use feedback regulator * to correct the situation. */ - ctx->base_sof_offset = (i2s_blocks_queued - 2) * ctx->counts_per_sof; + ctx->base_sof_offset = (i2s_blocks_queued - 2) * + (SAMPLES_PER_SOF << FEEDBACK_P); } uint32_t feedback_value(struct feedback_ctx *ctx) diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/main.c b/samples/subsys/usb/uac2_explicit_feedback/src/main.c index 40df3f5b8fc7..3f4f596f35c2 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/main.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/main.c @@ -20,17 +20,14 @@ LOG_MODULE_REGISTER(uac2_sample, LOG_LEVEL_INF); #define HEADPHONES_OUT_TERMINAL_ID UAC2_ENTITY_ID(DT_NODELABEL(out_terminal)) -#define FS_SAMPLES_PER_SOF 48 -#define HS_SAMPLES_PER_SOF 6 -#define MAX_SAMPLES_PER_SOF MAX(FS_SAMPLES_PER_SOF, HS_SAMPLES_PER_SOF) -#define SAMPLE_FREQUENCY (FS_SAMPLES_PER_SOF * 1000) +#define SAMPLE_FREQUENCY (SAMPLES_PER_SOF * 1000) #define SAMPLE_BIT_WIDTH 16 #define NUMBER_OF_CHANNELS 2 #define BYTES_PER_SAMPLE DIV_ROUND_UP(SAMPLE_BIT_WIDTH, 8) #define BYTES_PER_SLOT (BYTES_PER_SAMPLE * NUMBER_OF_CHANNELS) -#define MIN_BLOCK_SIZE ((MAX_SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT) -#define BLOCK_SIZE (MAX_SAMPLES_PER_SOF * BYTES_PER_SLOT) -#define MAX_BLOCK_SIZE ((MAX_SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT) +#define MIN_BLOCK_SIZE ((SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT) +#define BLOCK_SIZE (SAMPLES_PER_SOF * BYTES_PER_SLOT) +#define MAX_BLOCK_SIZE ((SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT) /* Absolute minimum is 5 buffers (1 actively consumed by I2S, 2nd queued as next * buffer, 3rd acquired by USB stack to receive data to, and 2 to handle SOF/I2S @@ -45,7 +42,6 @@ struct usb_i2s_ctx { const struct device *i2s_dev; bool terminal_enabled; bool i2s_started; - bool microframes; /* Number of blocks written, used to determine when to start I2S. * Overflows are not a problem becuse this variable is not necessary * after I2S is started. @@ -64,15 +60,15 @@ static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, * ignore the terminal variable. */ __ASSERT_NO_MSG(terminal == HEADPHONES_OUT_TERMINAL_ID); - - ctx->microframes = microframes; + /* This sample is for Full-Speed only devices. */ + __ASSERT_NO_MSG(microframes == false); ctx->terminal_enabled = enabled; if (ctx->i2s_started && !enabled) { i2s_trigger(ctx->i2s_dev, I2S_DIR_TX, I2S_TRIGGER_DROP); ctx->i2s_started = false; ctx->i2s_blocks_written = 0; - feedback_reset_ctx(ctx->fb, ctx->microframes); + feedback_reset_ctx(ctx->fb); } } @@ -118,11 +114,7 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, * either disable terminal (or the cable will be disconnected) * which will stop I2S. */ - if (USBD_SUPPORTS_HIGH_SPEED && ctx->microframes) { - size = HS_SAMPLES_PER_SOF * BYTES_PER_SLOT; - } else { - size = FS_SAMPLES_PER_SOF * BYTES_PER_SLOT; - } + size = BLOCK_SIZE; memset(buf, 0, size); } @@ -132,7 +124,7 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, if (ret < 0) { ctx->i2s_started = false; ctx->i2s_blocks_written = 0; - feedback_reset_ctx(ctx->fb, ctx->microframes); + feedback_reset_ctx(ctx->fb); /* Most likely underrun occurred, prepare I2S restart */ i2s_trigger(ctx->i2s_dev, I2S_DIR_TX, I2S_TRIGGER_PREPARE); @@ -244,7 +236,7 @@ static void uac2_sof(const struct device *dev, void *user_data) ctx->i2s_blocks_written >= 2) { i2s_trigger(ctx->i2s_dev, I2S_DIR_TX, I2S_TRIGGER_START); ctx->i2s_started = true; - feedback_start(ctx->fb, ctx->i2s_blocks_written, ctx->microframes); + feedback_start(ctx->fb, ctx->i2s_blocks_written); } } diff --git a/samples/subsys/usb/uac2_implicit_feedback/app.overlay b/samples/subsys/usb/uac2_implicit_feedback/app.overlay index 583b1f8ef7b3..799d9e40d433 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/app.overlay +++ b/samples/subsys/usb/uac2_implicit_feedback/app.overlay @@ -11,7 +11,6 @@ compatible = "zephyr,uac2"; status = "okay"; full-speed; - high-speed; audio-function = ; uac_aclk: aclk { diff --git a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index c4e23e5d54fe..1b1edb40666c 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/samples/subsys/usb/uac2_implicit_feedback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,3 +1,7 @@ # Enable timer for asynchronous feedback CONFIG_NRFX_GPPI=y CONFIG_NRFX_TIMER131=y + +# Sample is Full-Speed only, prevent High-Speed enumeration +CONFIG_UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED=n +CONFIG_USBD_MAX_SPEED_FULL=y diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback.h b/samples/subsys/usb/uac2_implicit_feedback/src/feedback.h index 584bc0135c2c..3fff2425d8b8 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback.h +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback.h @@ -9,14 +9,15 @@ #include -/* This sample is currently supporting only 48 kHz sample rate. */ -#define SAMPLE_RATE 48000 +/* Nominal number of samples received on each SOF. This sample is currently + * supporting only 48 kHz sample rate. + */ +#define SAMPLES_PER_SOF 48 struct feedback_ctx *feedback_init(void); void feedback_reset_ctx(struct feedback_ctx *ctx); void feedback_process(struct feedback_ctx *ctx); -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, - bool microframes); +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued); /* Return offset between I2S block start and USB SOF in samples. * diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_dummy.c b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_dummy.c index d28181033b94..3b91deafe5c1 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_dummy.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_dummy.c @@ -24,12 +24,10 @@ void feedback_reset_ctx(struct feedback_ctx *ctx) ARG_UNUSED(ctx); } -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, - bool microframes) +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued) { ARG_UNUSED(ctx); ARG_UNUSED(i2s_blocks_queued); - ARG_UNUSED(microframes); } int feedback_samples_offset(struct feedback_ctx *ctx) diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c index 9623f22e5662..a7dfad370b87 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/feedback_nrf.c @@ -68,12 +68,11 @@ static const nrfx_timer_t feedback_timer_instance = * SOF offset is around 0 when regulated and therefore the relative clock * frequency discrepancies are essentially negligible. */ -#define CLKS_PER_SAMPLE (16000000 / (SAMPLE_RATE)) +#define CLKS_PER_SAMPLE (16000000 / (SAMPLES_PER_SOF * 1000)) static struct feedback_ctx { int32_t rel_sof_offset; int32_t base_sof_offset; - unsigned int nominal; } fb_ctx; struct feedback_ctx *feedback_init(void) @@ -144,8 +143,8 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, /* /2 because we treat the middle as a turning point from being * "too late" to "too early". */ - if (framestart_cc > (ctx->nominal * CLKS_PER_SAMPLE)/2) { - sof_offset = framestart_cc - ctx->nominal * CLKS_PER_SAMPLE; + if (framestart_cc > (SAMPLES_PER_SOF * CLKS_PER_SAMPLE)/2) { + sof_offset = framestart_cc - SAMPLES_PER_SOF * CLKS_PER_SAMPLE; } else { sof_offset = framestart_cc; } @@ -160,17 +159,17 @@ static void update_sof_offset(struct feedback_ctx *ctx, uint32_t sof_cc, if (sof_offset >= 0) { abs_diff = sof_offset - ctx->rel_sof_offset; - base_change = -(ctx->nominal * CLKS_PER_SAMPLE); + base_change = -(SAMPLES_PER_SOF * CLKS_PER_SAMPLE); } else { abs_diff = ctx->rel_sof_offset - sof_offset; - base_change = ctx->nominal * CLKS_PER_SAMPLE; + base_change = SAMPLES_PER_SOF * CLKS_PER_SAMPLE; } /* Adjust base offset only if the change happened through the * outer bound. The actual changes should be significantly lower * than the threshold here. */ - if (abs_diff > (ctx->nominal * CLKS_PER_SAMPLE)/2) { + if (abs_diff > (SAMPLES_PER_SOF * CLKS_PER_SAMPLE)/2) { ctx->base_sof_offset += base_change; } } @@ -196,26 +195,19 @@ void feedback_reset_ctx(struct feedback_ctx *ctx) ARG_UNUSED(ctx); } -void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued, - bool microframes) +void feedback_start(struct feedback_ctx *ctx, int i2s_blocks_queued) { - if (microframes) { - ctx->nominal = SAMPLE_RATE / 8000; - } else { - ctx->nominal = SAMPLE_RATE / 1000; - } - /* I2S data was supposed to go out at SOF, but it is inevitably * delayed due to triggering I2S start by software. Set relative * SOF offset value in a way that ensures that values past "half * frame" are treated as "too late" instead of "too early" */ - ctx->rel_sof_offset = (ctx->nominal * CLKS_PER_SAMPLE) / 2; + ctx->rel_sof_offset = (SAMPLES_PER_SOF * CLKS_PER_SAMPLE) / 2; /* If there are more than 2 I2S TX blocks queued, use feedback regulator * to correct the situation. */ ctx->base_sof_offset = (i2s_blocks_queued - 2) * - (ctx->nominal * CLKS_PER_SAMPLE); + (SAMPLES_PER_SOF * CLKS_PER_SAMPLE); } int feedback_samples_offset(struct feedback_ctx *ctx) diff --git a/samples/subsys/usb/uac2_implicit_feedback/src/main.c b/samples/subsys/usb/uac2_implicit_feedback/src/main.c index 06334866e7a2..12abdf4fe681 100644 --- a/samples/subsys/usb/uac2_implicit_feedback/src/main.c +++ b/samples/subsys/usb/uac2_implicit_feedback/src/main.c @@ -21,17 +21,15 @@ LOG_MODULE_REGISTER(uac2_sample, LOG_LEVEL_INF); #define HEADPHONES_OUT_TERMINAL_ID UAC2_ENTITY_ID(DT_NODELABEL(out_terminal)) #define MICROPHONE_IN_TERMINAL_ID UAC2_ENTITY_ID(DT_NODELABEL(in_terminal)) -#define FS_SAMPLES_PER_SOF 48 -#define HS_SAMPLES_PER_SOF 6 -#define MAX_SAMPLES_PER_SOF MAX(FS_SAMPLES_PER_SOF, HS_SAMPLES_PER_SOF) -#define SAMPLE_FREQUENCY (FS_SAMPLES_PER_SOF * 1000) +#define SAMPLES_PER_SOF 48 +#define SAMPLE_FREQUENCY (SAMPLES_PER_SOF * 1000) #define SAMPLE_BIT_WIDTH 16 #define NUMBER_OF_CHANNELS 2 #define BYTES_PER_SAMPLE DIV_ROUND_UP(SAMPLE_BIT_WIDTH, 8) #define BYTES_PER_SLOT (BYTES_PER_SAMPLE * NUMBER_OF_CHANNELS) -#define MIN_BLOCK_SIZE ((MAX_SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT) -#define BLOCK_SIZE (MAX_SAMPLES_PER_SOF * BYTES_PER_SLOT) -#define MAX_BLOCK_SIZE ((MAX_SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT) +#define MIN_BLOCK_SIZE ((SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT) +#define BLOCK_SIZE (SAMPLES_PER_SOF * BYTES_PER_SLOT) +#define MAX_BLOCK_SIZE ((SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT) /* Absolute minimum is 5 TX buffers (1 actively consumed by I2S, 2nd queued as * next buffer, 3rd acquired by USB stack to receive data to, and 2 to handle @@ -51,7 +49,6 @@ struct usb_i2s_ctx { bool i2s_started; bool rx_started; bool usb_data_received; - bool microframes; /* Counter used to determine when to start I2S and then when to start * sending RX packets to host. Overflows are not a problem because this * variable is not necessary after both I2S and RX is started. @@ -73,8 +70,8 @@ struct usb_i2s_ctx { * Used to avoid overcompensation in feedback regulator. LSBs indicate * latest write size. */ - uint32_t plus_ones; - uint32_t minus_ones; + uint8_t plus_ones; + uint8_t minus_ones; }; static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, @@ -83,7 +80,8 @@ static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, { struct usb_i2s_ctx *ctx = user_data; - ctx->microframes = microframes; + /* This sample is for Full-Speed only devices. */ + __ASSERT_NO_MSG(microframes == false); if (terminal == HEADPHONES_OUT_TERMINAL_ID) { ctx->headphones_enabled = enabled; @@ -106,15 +104,6 @@ static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal, } } -static int nominal_samples_per_sof(struct usb_i2s_ctx *ctx) -{ - if (USBD_SUPPORTS_HIGH_SPEED && ctx->microframes) { - return HS_SAMPLES_PER_SOF; - } - - return FS_SAMPLES_PER_SOF; -} - static void *uac2_get_recv_buf(const struct device *dev, uint8_t terminal, uint16_t size, void *user_data) { @@ -144,7 +133,6 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, void *buf, uint16_t size, void *user_data) { struct usb_i2s_ctx *ctx = user_data; - int nominal = nominal_samples_per_sof(ctx); int ret; ctx->usb_data_received = true; @@ -171,11 +159,11 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal, * of samples sent. */ if (ctx->plus_ones & 1) { - size = (nominal + 1) * BYTES_PER_SLOT; + size = (SAMPLES_PER_SOF + 1) * BYTES_PER_SLOT; } else if (ctx->minus_ones & 1) { - size = (nominal - 1) * BYTES_PER_SLOT; + size = (SAMPLES_PER_SOF - 1) * BYTES_PER_SLOT; } else { - size = nominal * BYTES_PER_SLOT; + size = SAMPLES_PER_SOF * BYTES_PER_SLOT; } memset(buf, 0, size); } @@ -220,7 +208,6 @@ static void uac2_buf_release_cb(const struct device *dev, uint8_t terminal, /* Determine next number of samples to send, called at most once every SOF */ static int next_mic_num_samples(struct usb_i2s_ctx *ctx) { - int nominal = nominal_samples_per_sof(ctx); int offset = feedback_samples_offset(ctx->fb); /* The rolling buffers essentially handle controller dead time, i.e. @@ -230,18 +217,12 @@ static int next_mic_num_samples(struct usb_i2s_ctx *ctx) ctx->plus_ones <<= 1; ctx->minus_ones <<= 1; - /* At Full-Speed only remember last 8 frames */ - if (!USBD_SUPPORTS_HIGH_SPEED || !ctx->microframes) { - ctx->plus_ones &= 0x000000FF; - ctx->minus_ones &= 0x000000FF; - } - if ((offset < 0) && (POPCOUNT(ctx->plus_ones) < -offset)) { /* I2S buffer starts at least 1 sample before SOF, send nominal * + 1 samples to host in order to shift offset towards 0. */ ctx->plus_ones |= 1; - return nominal + 1; + return SAMPLES_PER_SOF + 1; } if ((offset > 0) && (POPCOUNT(ctx->minus_ones) < offset)) { @@ -249,11 +230,11 @@ static int next_mic_num_samples(struct usb_i2s_ctx *ctx) * - 1 samples to host in order to shift offset towards 0 */ ctx->minus_ones |= 1; - return nominal - 1; + return SAMPLES_PER_SOF - 1; } /* I2S is either spot on, or the offset is expected to correct soon */ - return nominal; + return SAMPLES_PER_SOF; } static void process_mic_data(const struct device *dev, struct usb_i2s_ctx *ctx) @@ -507,7 +488,7 @@ static void uac2_sof(const struct device *dev, void *user_data) ctx->i2s_counter >= 2) { i2s_trigger(ctx->i2s_dev, I2S_DIR_BOTH, I2S_TRIGGER_START); ctx->i2s_started = true; - feedback_start(ctx->fb, ctx->i2s_counter, ctx->microframes); + feedback_start(ctx->fb, ctx->i2s_counter); ctx->i2s_counter = 0; } From ef58a42442228ea1f07ff83a130813225ad82354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1166/3334] Revert "[nrf fromtree] drivers: udc_dwc2: Control D+ pull-up on nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6477c975e80278f8ad298a851763807499810968. Signed-off-by: Tomasz Moń --- drivers/usb/udc/udc_dwc2_vendor_quirks.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2_vendor_quirks.h b/drivers/usb/udc/udc_dwc2_vendor_quirks.h index 9b2d26b89008..cd25f0ec9d33 100644 --- a/drivers/usb/udc/udc_dwc2_vendor_quirks.h +++ b/drivers/usb/udc/udc_dwc2_vendor_quirks.h @@ -213,21 +213,10 @@ static inline int usbhs_enable_core(const struct device *dev) return 0; } -static inline int usbhs_enable_pullup(const struct device *dev) -{ - /* Core is ready to handle connection, enable D+ pull-up */ - nrfs_usb_dplus_pullup_enable((void *)dev); - - return 0; -} - static inline int usbhs_disable_core(const struct device *dev) { NRF_USBHS_Type *wrapper = USBHS_DT_WRAPPER_REG_ADDR(0); - /* Disable D+ pull-up until next post enable quirk */ - nrfs_usb_dplus_pullup_disable((void *)dev); - /* Disable interrupts */ wrapper->INTENCLR = 1UL; @@ -310,7 +299,6 @@ static inline int usbhs_pre_hibernation_exit(const struct device *dev) const struct dwc2_vendor_quirks dwc2_vendor_quirks_##n = { \ .init = usbhs_enable_nrfs_service, \ .pre_enable = usbhs_enable_core, \ - .post_enable = usbhs_enable_pullup, \ .disable = usbhs_disable_core, \ .shutdown = usbhs_disable_nrfs_service, \ .irq_clear = usbhs_irq_clear, \ From dcf2d6521bdb4b3e756fd55ddf8a8fa73666afa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:44 +0100 Subject: [PATCH 1167/3334] Revert "[nrf fromtree] driver: flash_mspi_nor: Allow specific read/write IO modes and frequencies" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 937c2be0e121e3a4cf96a44deebf3358aeececbb. Signed-off-by: Tomasz Moń --- drivers/flash/flash_mspi_nor.c | 94 ++++++++-------------------- drivers/flash/flash_mspi_nor.h | 8 --- dts/bindings/mtd/jedec,mspi-nor.yaml | 56 ----------------- 3 files changed, 26 insertions(+), 132 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 405fd8800b36..613ebfbab60c 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -43,18 +43,6 @@ static bool in_octal_io(const struct device *dev) dev_data->last_applied_cfg->io_mode == MSPI_IO_MODE_OCTAL; } -static bool is_quad_enable_needed(const struct mspi_dev_cfg *cfg) -{ - return cfg && (cfg->io_mode == MSPI_IO_MODE_QUAD_1_1_4 || - cfg->io_mode == MSPI_IO_MODE_QUAD_1_4_4); -} - -static bool is_octal_enable_needed(const struct mspi_dev_cfg *cfg) -{ - return cfg && (cfg->io_mode == MSPI_IO_MODE_OCTAL_1_1_8 || - cfg->io_mode == MSPI_IO_MODE_OCTAL_1_8_8); -} - static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir) { const struct flash_mspi_nor_config *dev_config = dev->config; @@ -101,6 +89,8 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const struct mspi_dev_cfg *cfg = NULL; + bool mem_access = (cmd == dev_data->cmd_info.read_cmd || + cmd == dev_data->cmd_info.pp_cmd); int rc; if (dev_data->cmd_info.cmd_extension != CMD_EXTENSION_NONE && @@ -112,21 +102,25 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) dev_data->packet.cmd = cmd; } - /* Commands before chip is initialized manually apply a MSPI config - * which all flash chips support by JEDEC standard. Do not switch - * to device tree config yet. - * If multiple IO lines are used in all the transfer phases - * there's no need to switch the IO mode. - */ - if (dev_data->chip_initialized && !dev_config->multi_io_cmd) { - if (cmd == dev_data->cmd_info.read_cmd) { - cfg = dev_data->read_cfg; - } else if (cmd == dev_data->cmd_info.pp_cmd) { - cfg = dev_data->write_cfg; - } else { - /* For all other commands, use control command config */ - cfg = &dev_config->mspi_control_cfg; + if (!dev_data->chip_initialized || + dev_config->multi_io_cmd || + dev_config->mspi_nor_cfg.io_mode == MSPI_IO_MODE_SINGLE) { + /* Commands before chip is initialized manually apply a MSPI config + * which all flash chips support by JEDEC standard. Do not switch + * to device tree config yet. + * If multiple IO lines are used in all the transfer phases + * there's no need to switch the IO mode. + */ + } else if (mem_access) { + /* For commands accessing the flash memory (read and program), + * ensure that the target IO mode is active. + */ + if (!in_octal_io(dev)) { + cfg = &dev_config->mspi_nor_cfg; } + } else { + /* For all other commands, use control command config */ + cfg = &dev_config->mspi_control_cfg; } if (cfg && cfg != dev_data->last_applied_cfg) { @@ -830,11 +824,12 @@ static int switch_to_target_io_mode(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; + enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode; int rc = 0; if (dev_data->switch_info.quad_enable_req != JESD216_DW15_QER_VAL_NONE) { - bool quad_needed = is_quad_enable_needed(dev_data->read_cfg) || - is_quad_enable_needed(dev_data->write_cfg); + bool quad_needed = io_mode == MSPI_IO_MODE_QUAD_1_1_4 || + io_mode == MSPI_IO_MODE_QUAD_1_4_4; rc = quad_enable_set(dev, quad_needed); if (rc < 0) { @@ -844,8 +839,8 @@ static int switch_to_target_io_mode(const struct device *dev) } if (dev_data->switch_info.octal_enable_req != OCTAL_ENABLE_REQ_NONE) { - bool octal_needed = is_octal_enable_needed(dev_data->read_cfg) || - is_octal_enable_needed(dev_data->write_cfg); + bool octal_needed = io_mode == MSPI_IO_MODE_OCTAL_1_1_8 || + io_mode == MSPI_IO_MODE_OCTAL_1_8_8; rc = octal_enable_set(dev, octal_needed); if (rc < 0) { @@ -1094,33 +1089,6 @@ static int flash_chip_init(const struct device *dev) } } - /* If read/write commands and frequency do not match the default - * MSPI device configuration, store new ones for those commands - * specifically. - */ - if (dev_config->read_io_mode == dev_config->mspi_nor_cfg.io_mode && - dev_config->read_freq == dev_config->mspi_nor_cfg.freq) { - dev_data->read_cfg = &dev_config->mspi_nor_cfg; - } else { - memcpy(&dev_data->mspi_dev_read_cfg, &dev_config->mspi_nor_cfg, - sizeof(dev_config->mspi_nor_cfg)); - dev_data->mspi_dev_read_cfg.io_mode = dev_config->read_io_mode; - dev_data->mspi_dev_read_cfg.freq = dev_config->read_freq; - dev_data->read_cfg = &dev_data->mspi_dev_read_cfg; - } - - if (dev_config->write_io_mode == dev_config->mspi_nor_cfg.io_mode && - dev_config->write_freq == dev_config->mspi_nor_cfg.freq) { - dev_data->write_cfg = &dev_config->mspi_nor_cfg; - } else { - memcpy(&dev_data->mspi_dev_write_cfg, &dev_config->mspi_nor_cfg, - sizeof(dev_config->mspi_nor_cfg)); - dev_data->mspi_dev_write_cfg.io_mode = dev_config->write_io_mode; - dev_data->mspi_dev_write_cfg.freq = dev_config->write_freq; - dev_data->write_cfg = &dev_data->mspi_dev_write_cfg; - } - - if (dev_config->jedec_id_specified) { rc = read_jedec_id(dev, id); if (rc < 0) { @@ -1295,12 +1263,10 @@ static DEVICE_API(flash, drv_api) = { #endif }; -#define FLASH_MSPI_MAX_FREQ(inst) DT_INST_PROP(inst, mspi_max_frequency) - #define FLASH_CONTROL_CMD_CONFIG(inst) \ { \ .ce_num = DT_INST_PROP_OR(inst, mspi_hardware_ce_num, 0), \ - .freq = FLASH_MSPI_MAX_FREQ(inst), \ + .freq = DT_INST_PROP(inst, mspi_max_frequency), \ .io_mode = MSPI_IO_MODE_SINGLE, \ .data_rate = MSPI_DATA_RATE_SINGLE, \ .cpp = MSPI_CPP_MODE_0, \ @@ -1384,14 +1350,6 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ .default_erase_types = DEFAULT_ERASE_TYPES(inst), \ .default_cmd_info = DEFAULT_CMD_INFO(inst), \ .default_switch_info = DEFAULT_SWITCH_INFO(inst), \ - .read_freq = DT_INST_PROP_OR(inst, read_frequency, \ - FLASH_MSPI_MAX_FREQ(inst)), \ - .read_io_mode = DT_INST_ENUM_IDX_OR(inst, read_io_mode, \ - DT_INST_ENUM_IDX(inst, mspi_io_mode)), \ - .write_freq = DT_INST_PROP_OR(inst, write_frequency, \ - FLASH_MSPI_MAX_FREQ(inst)), \ - .write_io_mode = DT_INST_ENUM_IDX_OR(inst, write_io_mode, \ - DT_INST_ENUM_IDX(inst, mspi_io_mode)), \ .jedec_id_specified = DT_INST_NODE_HAS_PROP(inst, jedec_id), \ .rx_dummy_specified = DT_INST_NODE_HAS_PROP(inst, rx_dummy), \ .multiperipheral_bus = DT_PROP(DT_INST_BUS(inst), \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 6252b838c0cd..7d95588c4721 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -96,10 +96,6 @@ struct flash_mspi_nor_config { const struct jesd216_erase_type *default_erase_types; struct flash_mspi_nor_cmd_info default_cmd_info; struct flash_mspi_nor_switch_info default_switch_info; - uint32_t read_freq; - enum mspi_io_mode read_io_mode; - uint32_t write_freq; - enum mspi_io_mode write_io_mode; bool jedec_id_specified : 1; bool rx_dummy_specified : 1; bool multiperipheral_bus : 1; @@ -119,10 +115,6 @@ struct flash_mspi_nor_data { struct flash_mspi_nor_switch_info switch_info; const struct mspi_dev_cfg *last_applied_cfg; bool chip_initialized; - const struct mspi_dev_cfg *read_cfg; - struct mspi_dev_cfg mspi_dev_read_cfg; - const struct mspi_dev_cfg *write_cfg; - struct mspi_dev_cfg mspi_dev_write_cfg; }; #ifdef __cplusplus diff --git a/dts/bindings/mtd/jedec,mspi-nor.yaml b/dts/bindings/mtd/jedec,mspi-nor.yaml index e59fe117557e..348e11cd9833 100644 --- a/dts/bindings/mtd/jedec,mspi-nor.yaml +++ b/dts/bindings/mtd/jedec,mspi-nor.yaml @@ -21,62 +21,6 @@ include: - t-exit-dpd properties: - read-frequency: - type: int - description: | - Clock frequency of device to configure in Hz for read - command, when reads are desired to be in a different - frequency than the rest of the commands. - - read-io-mode: - type: string - enum: - - "MSPI_IO_MODE_SINGLE" - - "MSPI_IO_MODE_DUAL" - - "MSPI_IO_MODE_DUAL_1_1_2" - - "MSPI_IO_MODE_DUAL_1_2_2" - - "MSPI_IO_MODE_QUAD" - - "MSPI_IO_MODE_QUAD_1_1_4" - - "MSPI_IO_MODE_QUAD_1_4_4" - - "MSPI_IO_MODE_OCTAL" - - "MSPI_IO_MODE_OCTAL_1_1_8" - - "MSPI_IO_MODE_OCTAL_1_8_8" - - "MSPI_IO_MODE_HEX" - - "MSPI_IO_MODE_HEX_8_8_16" - - "MSPI_IO_MODE_HEX_8_16_16" - description: | - MSPI I/O mode setting for read command when desired to - be different from base device `mspi-io-mode` for the rest - of the commands. - - write-frequency: - type: int - description: | - Clock frequency of device to configure in Hz for write - command, when write are desired to be in a different - frequency than the rest of the commands. - - write-io-mode: - type: string - enum: - - "MSPI_IO_MODE_SINGLE" - - "MSPI_IO_MODE_DUAL" - - "MSPI_IO_MODE_DUAL_1_1_2" - - "MSPI_IO_MODE_DUAL_1_2_2" - - "MSPI_IO_MODE_QUAD" - - "MSPI_IO_MODE_QUAD_1_1_4" - - "MSPI_IO_MODE_QUAD_1_4_4" - - "MSPI_IO_MODE_OCTAL" - - "MSPI_IO_MODE_OCTAL_1_1_8" - - "MSPI_IO_MODE_OCTAL_1_8_8" - - "MSPI_IO_MODE_HEX" - - "MSPI_IO_MODE_HEX_8_8_16" - - "MSPI_IO_MODE_HEX_8_16_16" - description: | - MSPI I/O mode setting for write command when desired to - be different from base device `mspi-io-mode` for the rest - of the commands. - reset-gpios: type: phandle-array description: | From af637e8ef74d66c278cfb759102bb87e2a524b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1168/3334] Revert "[nrf fromtree] drivers: flash_mspi_nor: Remove bool tracking of target IO mode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e9414925f451a9ec9d4435e811c0cabefbb69f33. Signed-off-by: Tomasz Moń --- drivers/flash/flash_mspi_nor.c | 25 ++++++++++++------------- drivers/flash/flash_mspi_nor.h | 1 + 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 613ebfbab60c..965fd385251f 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -35,14 +35,6 @@ static int cmd_wrsr(const struct device *dev, uint8_t op_code, #include "flash_mspi_nor_quirks.h" -static bool in_octal_io(const struct device *dev) -{ - struct flash_mspi_nor_data *dev_data = dev->data; - - return dev_data->last_applied_cfg && - dev_data->last_applied_cfg->io_mode == MSPI_IO_MODE_OCTAL; -} - static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir) { const struct flash_mspi_nor_config *dev_config = dev->config; @@ -94,7 +86,7 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) int rc; if (dev_data->cmd_info.cmd_extension != CMD_EXTENSION_NONE && - in_octal_io(dev)) { + dev_data->in_target_io_mode) { dev_data->xfer.cmd_length = 2; dev_data->packet.cmd = get_extended_command(dev, cmd); } else { @@ -115,7 +107,7 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) /* For commands accessing the flash memory (read and program), * ensure that the target IO mode is active. */ - if (!in_octal_io(dev)) { + if (!dev_data->in_target_io_mode) { cfg = &dev_config->mspi_nor_cfg; } } else { @@ -131,6 +123,7 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) return rc; } dev_data->last_applied_cfg = cfg; + dev_data->in_target_io_mode = mem_access; } rc = mspi_transceive(dev_config->bus, &dev_config->mspi_id, @@ -149,7 +142,7 @@ static int cmd_rdsr(const struct device *dev, uint8_t op_code, uint8_t *sr) int rc; set_up_xfer(dev, MSPI_RX); - if (in_octal_io(dev)) { + if (dev_data->in_target_io_mode) { dev_data->xfer.rx_dummy = dev_data->cmd_info.rdsr_dummy; dev_data->xfer.addr_length = dev_data->cmd_info.rdsr_addr_4 ? 4 : 0; @@ -261,6 +254,7 @@ static int acquire(const struct device *dev) } else { if (dev_config->multiperipheral_bus) { dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; + dev_data->in_target_io_mode = true; } return 0; @@ -552,7 +546,7 @@ static int sfdp_read(const struct device *dev, off_t addr, void *dest, int rc; set_up_xfer(dev, MSPI_RX); - if (in_octal_io(dev)) { + if (dev_data->in_target_io_mode) { dev_data->xfer.rx_dummy = dev_data->cmd_info.sfdp_dummy_20 ? 20 : 8; dev_data->xfer.addr_length = dev_data->cmd_info.sfdp_addr_4 @@ -578,7 +572,7 @@ static int read_jedec_id(const struct device *dev, uint8_t *id) int rc; set_up_xfer(dev, MSPI_RX); - if (in_octal_io(dev)) { + if (dev_data->in_target_io_mode) { dev_data->xfer.rx_dummy = dev_data->cmd_info.rdid_dummy; dev_data->xfer.addr_length = dev_data->cmd_info.rdid_addr_4 ? 4 : 0; @@ -969,6 +963,7 @@ static int soft_reset(const struct device *dev) return rc; } dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; + dev_data->in_target_io_mode = true; rc = soft_reset_66_99(dev); if (rc < 0) { @@ -983,6 +978,7 @@ static int soft_reset(const struct device *dev) return rc; } dev_data->last_applied_cfg = &dev_config->mspi_control_cfg; + dev_data->in_target_io_mode = false; } rc = soft_reset_66_99(dev); @@ -1015,6 +1011,7 @@ static int flash_chip_init(const struct device *dev) LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } + dev_data->in_target_io_mode = false; #if defined(WITH_SUPPLY_GPIO) if (dev_config->supply.port) { @@ -1114,6 +1111,8 @@ static int flash_chip_init(const struct device *dev) } dev_data->chip_initialized = true; + dev_data->in_target_io_mode = true; + if (IS_ENABLED(CONFIG_FLASH_MSPI_NOR_USE_SFDP)) { /* Read the SFDP signature to test if communication with * the flash chip can be successfully performed after switching diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 7d95588c4721..a8c7bfaab547 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -113,6 +113,7 @@ struct flash_mspi_nor_data { struct jesd216_erase_type erase_types[JESD216_NUM_ERASE_TYPES]; struct flash_mspi_nor_cmd_info cmd_info; struct flash_mspi_nor_switch_info switch_info; + bool in_target_io_mode; const struct mspi_dev_cfg *last_applied_cfg; bool chip_initialized; }; From 594d2710d31b8543aa6f6aff2fd92c9a5ea196fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1169/3334] Revert "[nrf fromtree] drivers: flash_mspi_nor: Flash control commands to use their own configs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0f56e0cb4206b28475382f5bb399fd8a441910ea. Signed-off-by: Tomasz Moń --- drivers/flash/flash_mspi_nor.c | 49 +++++++++++++++++++--------------- drivers/flash/flash_mspi_nor.h | 3 +-- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 965fd385251f..b53b50d3663f 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -94,14 +94,10 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) dev_data->packet.cmd = cmd; } - if (!dev_data->chip_initialized || - dev_config->multi_io_cmd || - dev_config->mspi_nor_cfg.io_mode == MSPI_IO_MODE_SINGLE) { - /* Commands before chip is initialized manually apply a MSPI config - * which all flash chips support by JEDEC standard. Do not switch - * to device tree config yet. - * If multiple IO lines are used in all the transfer phases - * there's no need to switch the IO mode. + if (dev_config->multi_io_cmd || + dev_config->mspi_nor_cfg.io_mode == MSPI_IO_MODE_SINGLE) { + /* If multiple IO lines are used in all the transfer phases + * or in none of them, there's no need to switch the IO mode. */ } else if (mem_access) { /* For commands accessing the flash memory (read and program), @@ -111,13 +107,26 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) cfg = &dev_config->mspi_nor_cfg; } } else { - /* For all other commands, use control command config */ - cfg = &dev_config->mspi_control_cfg; + /* For all other commands, switch to Single IO mode if a given + * command needs the data or address phase and in the target IO + * mode multiple IO lines are used in these phases. + */ + if (dev_data->in_target_io_mode) { + if (dev_data->packet.num_bytes != 0 || + (dev_data->xfer.addr_length != 0 && + !dev_config->single_io_addr)) { + /* Only the IO mode is to be changed, so the + * initial configuration structure can be used + * for this operation. + */ + cfg = &dev_config->mspi_nor_init_cfg; + } + } } if (cfg && cfg != dev_data->last_applied_cfg) { rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, - MSPI_DEVICE_CONFIG_IO_MODE | MSPI_DEVICE_CONFIG_FREQUENCY, cfg); + MSPI_DEVICE_CONFIG_IO_MODE, cfg); if (rc < 0) { LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; @@ -972,12 +981,12 @@ static int soft_reset(const struct device *dev) rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, MSPI_DEVICE_CONFIG_IO_MODE, - &dev_config->mspi_control_cfg); + &dev_config->mspi_nor_init_cfg); if (rc < 0) { LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->last_applied_cfg = &dev_config->mspi_control_cfg; + dev_data->last_applied_cfg = &dev_config->mspi_nor_init_cfg; dev_data->in_target_io_mode = false; } @@ -994,23 +1003,20 @@ static int flash_chip_init(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; - struct mspi_dev_cfg mspi_nor_init_cfg; uint8_t id[JESD216_READ_ID_LEN] = {0}; uint16_t dts_cmd = 0; uint32_t sfdp_signature; bool flash_reset = false; int rc; - /* Do initial checks at max 50MHz required to be supported by JEDEC */ - memcpy(&mspi_nor_init_cfg, &dev_config->mspi_control_cfg, sizeof(mspi_nor_init_cfg)); - mspi_nor_init_cfg.freq = MIN(dev_config->mspi_control_cfg.freq, MHZ(50)); rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, MSPI_DEVICE_CONFIG_ALL, - &mspi_nor_init_cfg); + &dev_config->mspi_nor_init_cfg); if (rc < 0) { LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } + dev_data->last_applied_cfg = &dev_config->mspi_nor_init_cfg; dev_data->in_target_io_mode = false; #if defined(WITH_SUPPLY_GPIO) @@ -1109,7 +1115,6 @@ static int flash_chip_init(const struct device *dev) LOG_ERR("Failed to switch to target io mode: %d", rc); return rc; } - dev_data->chip_initialized = true; dev_data->in_target_io_mode = true; @@ -1262,10 +1267,10 @@ static DEVICE_API(flash, drv_api) = { #endif }; -#define FLASH_CONTROL_CMD_CONFIG(inst) \ +#define FLASH_INITIAL_CONFIG(inst) \ { \ .ce_num = DT_INST_PROP_OR(inst, mspi_hardware_ce_num, 0), \ - .freq = DT_INST_PROP(inst, mspi_max_frequency), \ + .freq = MIN(DT_INST_PROP(inst, mspi_max_frequency), MHZ(50)), \ .io_mode = MSPI_IO_MODE_SINGLE, \ .data_rate = MSPI_DATA_RATE_SINGLE, \ .cpp = MSPI_CPP_MODE_0, \ @@ -1331,7 +1336,7 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ .page_size = FLASH_PAGE_SIZE(inst), \ .mspi_id = MSPI_DEVICE_ID_DT_INST(inst), \ .mspi_nor_cfg = MSPI_DEVICE_CONFIG_DT_INST(inst), \ - .mspi_control_cfg = FLASH_CONTROL_CMD_CONFIG(inst), \ + .mspi_nor_init_cfg = FLASH_INITIAL_CONFIG(inst), \ IF_ENABLED(CONFIG_MSPI_XIP, \ (.xip_cfg = MSPI_XIP_CONFIG_DT_INST(inst),)) \ IF_ENABLED(WITH_SUPPLY_GPIO, \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index a8c7bfaab547..f86c82fa7b70 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -75,7 +75,7 @@ struct flash_mspi_nor_config { uint16_t page_size; struct mspi_dev_id mspi_id; struct mspi_dev_cfg mspi_nor_cfg; - struct mspi_dev_cfg mspi_control_cfg; + struct mspi_dev_cfg mspi_nor_init_cfg; #if defined(CONFIG_MSPI_XIP) struct mspi_xip_cfg xip_cfg; #endif @@ -115,7 +115,6 @@ struct flash_mspi_nor_data { struct flash_mspi_nor_switch_info switch_info; bool in_target_io_mode; const struct mspi_dev_cfg *last_applied_cfg; - bool chip_initialized; }; #ifdef __cplusplus From 869b1abf90505c5ec1688cc005c0fe60440f4db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1170/3334] Revert "[nrf fromtree] drivers: flash_mspi_nor: Track last applied MSPI config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9e55d283518d1ccd98d5cbe7646bc4ff8bcdec82. Signed-off-by: Tomasz Moń --- drivers/flash/flash_mspi_nor.c | 18 ++++++------------ drivers/flash/flash_mspi_nor.h | 1 - 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index b53b50d3663f..595e02281f60 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -124,14 +124,14 @@ static int perform_xfer(const struct device *dev, uint8_t cmd) } } - if (cfg && cfg != dev_data->last_applied_cfg) { + if (cfg) { rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, MSPI_DEVICE_CONFIG_IO_MODE, cfg); if (rc < 0) { LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->last_applied_cfg = cfg; + dev_data->in_target_io_mode = mem_access; } @@ -262,7 +262,6 @@ static int acquire(const struct device *dev) LOG_ERR("mspi_dev_config() failed: %d", rc); } else { if (dev_config->multiperipheral_bus) { - dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; dev_data->in_target_io_mode = true; } @@ -868,14 +867,9 @@ static int switch_to_target_io_mode(const struct device *dev) } } - rc = mspi_dev_config(dev_config->bus, &dev_config->mspi_id, + return mspi_dev_config(dev_config->bus, &dev_config->mspi_id, NON_XIP_DEV_CFG_MASK, &dev_config->mspi_nor_cfg); - if (rc < 0) { - return rc; - } - dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; - return 0; } #if defined(WITH_SUPPLY_GPIO) @@ -971,7 +965,7 @@ static int soft_reset(const struct device *dev) LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->last_applied_cfg = &dev_config->mspi_nor_cfg; + dev_data->in_target_io_mode = true; rc = soft_reset_66_99(dev); @@ -986,7 +980,7 @@ static int soft_reset(const struct device *dev) LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->last_applied_cfg = &dev_config->mspi_nor_init_cfg; + dev_data->in_target_io_mode = false; } @@ -1016,7 +1010,7 @@ static int flash_chip_init(const struct device *dev) LOG_ERR("%s: dev_config() failed: %d", __func__, rc); return rc; } - dev_data->last_applied_cfg = &dev_config->mspi_nor_init_cfg; + dev_data->in_target_io_mode = false; #if defined(WITH_SUPPLY_GPIO) diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index f86c82fa7b70..335af449b261 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -114,7 +114,6 @@ struct flash_mspi_nor_data { struct flash_mspi_nor_cmd_info cmd_info; struct flash_mspi_nor_switch_info switch_info; bool in_target_io_mode; - const struct mspi_dev_cfg *last_applied_cfg; }; #ifdef __cplusplus From 3b62304d95a9692e0fac722ede172968e0f6d51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1171/3334] Revert "[nrf fromtree] drivers: flash_mspi_nor: Simplify perform_xfer function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0098e9e46962acedce266183f5437f66d08170c8. Signed-off-by: Tomasz Moń --- drivers/flash/flash_mspi_nor.c | 34 +++++++++++++-------------- drivers/flash/flash_mspi_nor_quirks.h | 8 +++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 595e02281f60..444509b695b5 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -26,7 +26,8 @@ LOG_MODULE_REGISTER(flash_mspi_nor, CONFIG_FLASH_LOG_LEVEL); #define NON_XIP_DEV_CFG_MASK (MSPI_DEVICE_CONFIG_ALL & ~XIP_DEV_CFG_MASK) static void set_up_xfer(const struct device *dev, enum mspi_xfer_direction dir); -static int perform_xfer(const struct device *dev, uint8_t cmd); +static int perform_xfer(const struct device *dev, + uint8_t cmd, bool mem_access); static int cmd_rdsr(const struct device *dev, uint8_t op_code, uint8_t *sr); static int wait_until_ready(const struct device *dev, k_timeout_t poll_period); static int cmd_wren(const struct device *dev); @@ -76,13 +77,12 @@ static uint16_t get_extended_command(const struct device *dev, return ((uint16_t)cmd << 8) | cmd_extension; } -static int perform_xfer(const struct device *dev, uint8_t cmd) +static int perform_xfer(const struct device *dev, + uint8_t cmd, bool mem_access) { const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const struct mspi_dev_cfg *cfg = NULL; - bool mem_access = (cmd == dev_data->cmd_info.read_cmd || - cmd == dev_data->cmd_info.pp_cmd); int rc; if (dev_data->cmd_info.cmd_extension != CMD_EXTENSION_NONE && @@ -158,7 +158,7 @@ static int cmd_rdsr(const struct device *dev, uint8_t op_code, uint8_t *sr) } dev_data->packet.num_bytes = sizeof(uint8_t); dev_data->packet.data_buf = sr; - rc = perform_xfer(dev, op_code); + rc = perform_xfer(dev, op_code, false); if (rc < 0) { LOG_ERR("%s 0x%02x failed: %d", __func__, op_code, rc); return rc; @@ -194,7 +194,7 @@ static int cmd_wren(const struct device *dev) int rc; set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_WREN); + rc = perform_xfer(dev, SPI_NOR_CMD_WREN, false); if (rc < 0) { LOG_ERR("%s failed: %d", __func__, rc); return rc; @@ -217,7 +217,7 @@ static int cmd_wrsr(const struct device *dev, uint8_t op_code, set_up_xfer(dev, MSPI_TX); dev_data->packet.num_bytes = sr_cnt; dev_data->packet.data_buf = sr; - rc = perform_xfer(dev, op_code); + rc = perform_xfer(dev, op_code, false); if (rc < 0) { LOG_ERR("%s 0x%02x failed: %d", __func__, op_code, rc); return rc; @@ -368,7 +368,7 @@ static int api_read(const struct device *dev, off_t addr, void *dest, dev_data->xfer.rx_dummy = get_rx_dummy(dev); dev_data->packet.data_buf = dest; dev_data->packet.num_bytes = to_read; - rc = perform_xfer(dev, dev_data->cmd_info.read_cmd); + rc = perform_xfer(dev, dev_data->cmd_info.read_cmd, true); addr += to_read; dest = (uint8_t *)dest + to_read; @@ -419,7 +419,7 @@ static int api_write(const struct device *dev, off_t addr, const void *src, set_up_xfer_with_addr(dev, MSPI_TX, addr); dev_data->packet.data_buf = (uint8_t *)src; dev_data->packet.num_bytes = to_write; - rc = perform_xfer(dev, dev_data->cmd_info.pp_cmd); + rc = perform_xfer(dev, dev_data->cmd_info.pp_cmd, true); if (rc < 0) { LOG_ERR("Page program xfer failed: %d", rc); break; @@ -491,7 +491,7 @@ static int api_erase(const struct device *dev, off_t addr, size_t size) if (size == flash_size) { /* Chip erase. */ set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_CE); + rc = perform_xfer(dev, SPI_NOR_CMD_CE, false); size -= flash_size; } else { @@ -500,7 +500,7 @@ static int api_erase(const struct device *dev, off_t addr, size_t size) if (best_et != NULL) { set_up_xfer_with_addr(dev, MSPI_TX, addr); - rc = perform_xfer(dev, best_et->cmd); + rc = perform_xfer(dev, best_et->cmd, false); addr += BIT(best_et->exp); size -= BIT(best_et->exp); @@ -566,7 +566,7 @@ static int sfdp_read(const struct device *dev, off_t addr, void *dest, dev_data->packet.address = addr; dev_data->packet.data_buf = dest; dev_data->packet.num_bytes = size; - rc = perform_xfer(dev, JESD216_CMD_READ_SFDP); + rc = perform_xfer(dev, JESD216_CMD_READ_SFDP, false); if (rc < 0) { LOG_ERR("Read SFDP xfer failed: %d", rc); } @@ -587,7 +587,7 @@ static int read_jedec_id(const struct device *dev, uint8_t *id) } dev_data->packet.data_buf = id; dev_data->packet.num_bytes = JESD216_READ_ID_LEN; - rc = perform_xfer(dev, SPI_NOR_CMD_RDID); + rc = perform_xfer(dev, SPI_NOR_CMD_RDID, false); if (rc < 0) { LOG_ERR("Read JEDEC ID failed: %d", rc); } @@ -777,7 +777,7 @@ static int octal_enable_set(const struct device *dev, bool enable) dev_data->packet.address = 0x02; dev_data->packet.num_bytes = sizeof(uint8_t); dev_data->packet.data_buf = &status_reg; - rc = perform_xfer(dev, op_code); + rc = perform_xfer(dev, op_code, false); if (rc < 0) { LOG_ERR("cmd_rdsr 0x%02x failed: %d", op_code, rc); return rc; @@ -813,7 +813,7 @@ static int enter_4byte_addressing_mode(const struct device *dev) } set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, 0xB7); + rc = perform_xfer(dev, 0xB7, false); if (rc < 0) { LOG_ERR("Command 0xB7 failed: %d", rc); return rc; @@ -932,14 +932,14 @@ static int soft_reset_66_99(const struct device *dev) int rc; set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_RESET_EN); + rc = perform_xfer(dev, SPI_NOR_CMD_RESET_EN, false); if (rc < 0) { LOG_ERR("CMD_RESET_EN failed: %d", rc); return rc; } set_up_xfer(dev, MSPI_TX); - rc = perform_xfer(dev, SPI_NOR_CMD_RESET_MEM); + rc = perform_xfer(dev, SPI_NOR_CMD_RESET_MEM, false); if (rc < 0) { LOG_ERR("CMD_RESET_MEM failed: %d", rc); return rc; diff --git a/drivers/flash/flash_mspi_nor_quirks.h b/drivers/flash/flash_mspi_nor_quirks.h index 83480b4643a8..d58fbea4ff9b 100644 --- a/drivers/flash/flash_mspi_nor_quirks.h +++ b/drivers/flash/flash_mspi_nor_quirks.h @@ -80,7 +80,7 @@ static inline int mxicy_mx25r_post_switch_mode(const struct device *dev) set_up_xfer(dev, MSPI_TX); dev_data->packet.data_buf = mxicy_mx25r_hp_payload; dev_data->packet.num_bytes = sizeof(mxicy_mx25r_hp_payload); - rc = perform_xfer(dev, SPI_NOR_CMD_WRSR); + rc = perform_xfer(dev, SPI_NOR_CMD_WRSR, false); if (rc < 0) { return rc; } @@ -101,7 +101,7 @@ static inline int mxicy_mx25r_post_switch_mode(const struct device *dev) set_up_xfer(dev, MSPI_RX); dev_data->packet.num_bytes = sizeof(config); dev_data->packet.data_buf = config; - rc = perform_xfer(dev, SPI_NOR_CMD_RDCR); + rc = perform_xfer(dev, SPI_NOR_CMD_RDCR, false); if (rc < 0) { return rc; } @@ -159,7 +159,7 @@ static inline int mxicy_mx25u_post_switch_mode(const struct device *dev) dev_data->packet.address = 0; dev_data->packet.data_buf = &opi_enable; dev_data->packet.num_bytes = sizeof(opi_enable); - return perform_xfer(dev, SPI_NOR_CMD_WR_CFGREG2); + return perform_xfer(dev, SPI_NOR_CMD_WR_CFGREG2, false); } static int mxicy_mx25u_pre_init(const struct device *dev) @@ -192,7 +192,7 @@ static int mxicy_mx25u_pre_init(const struct device *dev) dev_data->packet.address = 0x300; dev_data->packet.data_buf = &cfg_reg; dev_data->packet.num_bytes = sizeof(cfg_reg); - rc = perform_xfer(dev, SPI_NOR_CMD_RD_CFGREG2); + rc = perform_xfer(dev, SPI_NOR_CMD_RD_CFGREG2, false); if (rc < 0) { LOG_ERR("Failed to read Dummy Cycle from CFGREG2"); return rc; From 8707a4cee17127ce9735f60bffc575e910951a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1172/3334] Revert "[nrf fromtree] soc: nordic: Gate FLASH_0 MPU region on CONFIG_XIP" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6d6e2691e6f913a740b1767b2b15661079cbbf9d. Signed-off-by: Tomasz Moń --- soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c index 14b63a6481c9..a9e8b3de7a91 100644 --- a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c +++ b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c @@ -22,12 +22,10 @@ #define SOFTPERIPH_SIZE DT_REG_SIZE(DT_NODELABEL(softperiph_ram)) static struct arm_mpu_region mpu_regions[] = { -#ifdef CONFIG_XIP MPU_REGION_ENTRY("FLASH_0", CONFIG_FLASH_BASE_ADDRESS, REGION_FLASH_ATTR(CONFIG_FLASH_BASE_ADDRESS, CONFIG_FLASH_SIZE * 1024)), -#endif MPU_REGION_ENTRY("SRAM_0", CONFIG_SRAM_BASE_ADDRESS, REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, From 6e0585c60d90eaa6b3517e84b4c13c0bc4b50f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1173/3334] Revert "[nrf fromtree] soc: nordic: uicr: Move GEN_UICR options into the main Zephyr tree" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 884547b509d7e96e3e7673195c61847ce5a79c4a. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 33 +++++++++++++++++++ soc/nordic/common/uicr/Kconfig | 11 ------- .../{Kconfig.gen_uicr => gen_uicr/Kconfig} | 21 ++++++------ soc/nordic/common/uicr/gen_uicr/prj.conf | 7 +--- 4 files changed, 45 insertions(+), 27 deletions(-) rename soc/nordic/common/uicr/{Kconfig.gen_uicr => gen_uicr/Kconfig} (96%) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 64e0d8764fcb..8e3dc7347bb8 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1267,6 +1267,39 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_LOG_LEVEL", "FOO_SETTING_1", "FOO_SETTING_2", + "GEN_UICR_APPROTECT_APPLICATION_PROTECTED", + "GEN_UICR_APPROTECT_CORESIGHT_PROTECTED", + "GEN_UICR_APPROTECT_RADIOCORE_PROTECTED", + "GEN_UICR_ERASEPROTECT", + "GEN_UICR_GENERATE_PERIPHCONF", + "GEN_UICR_LOCK", + "GEN_UICR_PROTECTEDMEM", + "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", + "GEN_UICR_SECONDARY", + "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", + "GEN_UICR_SECONDARY_PROCESSOR_APPLICATION", + "GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE", + "GEN_UICR_SECONDARY_PROCESSOR_VALUE", + "GEN_UICR_SECONDARY_PROTECTEDMEM", + "GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES", + "GEN_UICR_SECONDARY_TRIGGER", + "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP", + "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0", + "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1", + "GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP", + "GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0", + "GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1", + "GEN_UICR_SECONDARY_WDTSTART", + "GEN_UICR_SECONDARY_WDTSTART_CRV", + "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE", + "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0", + "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT1", + "GEN_UICR_SECURESTORAGE", + "GEN_UICR_WDTSTART", + "GEN_UICR_WDTSTART_CRV", + "GEN_UICR_WDTSTART_INSTANCE_CODE", + "GEN_UICR_WDTSTART_INSTANCE_WDT0", + "GEN_UICR_WDTSTART_INSTANCE_WDT1", "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "IAR_BUFFERED_WRITE", diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index c3a69c3dbe0f..9f22fbbf7269 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -25,14 +25,3 @@ config IS_IRONSIDE_SE_SECONDARY_IMAGE This Kconfig is set by sysbuild to indicate that this image is a secondary firmware for Ironside SE. This is used by the UICR generation system to determine which PERIPHCONF partition to use. - -config IS_GEN_UICR_IMAGE - bool "UICR generator image indicator (informative only, do not change)" - help - This Kconfig is automatically set when building the gen_uicr image. - It indicates that this is the UICR generator utility image and enables - the UICR generator configuration options. - -# Source UICR generator options when building the gen_uicr image -# All options are disabled by default unless IS_GEN_UICR_IMAGE is set -rsource "Kconfig.gen_uicr" diff --git a/soc/nordic/common/uicr/Kconfig.gen_uicr b/soc/nordic/common/uicr/gen_uicr/Kconfig similarity index 96% rename from soc/nordic/common/uicr/Kconfig.gen_uicr rename to soc/nordic/common/uicr/gen_uicr/Kconfig index 4ee6af87eaef..7f25cc839dd6 100644 --- a/soc/nordic/common/uicr/Kconfig.gen_uicr +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -2,7 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 menu "UICR generator options" - depends on IS_GEN_UICR_IMAGE config GEN_UICR_GENERATE_PERIPHCONF bool "Generate PERIPHCONF hex alongside UICR" @@ -12,7 +11,7 @@ config GEN_UICR_GENERATE_PERIPHCONF periphconf_partition partition. config GEN_UICR_SECURESTORAGE - bool "UICR.SECURESTORAGE" + bool "Enable UICR.SECURESTORAGE" default y depends on $(dt_nodelabel_enabled,secure_storage_partition) help @@ -34,7 +33,7 @@ config GEN_UICR_SECURESTORAGE - Combined subpartition sizes must equal secure_storage_partition size config GEN_UICR_LOCK - bool "UICR.LOCK" + bool "Enable UICR.LOCK" help When enabled, locks the entire contents of the NVR0 page located in MRAM10. This includes all values in both the UICR and the BICR (Board @@ -45,7 +44,7 @@ config GEN_UICR_LOCK unauthorized modification. config GEN_UICR_ERASEPROTECT - bool "UICR.ERASEPROTECT" + bool "Enable UICR.ERASEPROTECT" depends on ! GEN_UICR_LOCK help When enabled, ERASEALL operations are blocked. @@ -81,7 +80,7 @@ config GEN_UICR_APPROTECT_CORESIGHT_PROTECTED endmenu config GEN_UICR_PROTECTEDMEM - bool "UICR.PROTECTEDMEM" + bool "Enable UICR.PROTECTEDMEM" help When enabled, the UICR generator will configure the protected memory region. @@ -95,7 +94,7 @@ config GEN_UICR_PROTECTEDMEM_SIZE_BYTES This value must be divisible by 4096 (4 kiB). config GEN_UICR_WDTSTART - bool "UICR.WDTSTART" + bool "Enable UICR.WDTSTART" help When enabled, the UICR generator will configure an application domain watchdog timer to start automatically before the @@ -138,7 +137,7 @@ config GEN_UICR_WDTSTART_CRV Default value 65535 creates a 2-second timeout. config GEN_UICR_SECONDARY_WDTSTART - bool "UICR.SECONDARY.WDTSTART" + bool "Enable UICR.SECONDARY.WDTSTART" depends on GEN_UICR_SECONDARY help When enabled, the UICR generator will configure the @@ -182,7 +181,7 @@ config GEN_UICR_SECONDARY_WDTSTART_CRV Default value 65535 creates a 2-second timeout. config GEN_UICR_SECONDARY - bool "UICR.SECONDARY.ENABLE" + bool "Enable UICR.SECONDARY.ENABLE" if GEN_UICR_SECONDARY @@ -217,7 +216,7 @@ config GEN_UICR_SECONDARY_PROCESSOR_VALUE default 0x1730C77F if GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE config GEN_UICR_SECONDARY_TRIGGER - bool "UICR.SECONDARY.TRIGGER" + bool "Enable UICR.SECONDARY.TRIGGER" help When enabled, configures automatic triggers that cause IronSide SE to boot the secondary firmware instead of the primary firmware based @@ -258,7 +257,7 @@ config GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP endif # GEN_UICR_SECONDARY_TRIGGER config GEN_UICR_SECONDARY_PROTECTEDMEM - bool "UICR.SECONDARY.PROTECTEDMEM" + bool "Enable UICR.SECONDARY.PROTECTEDMEM" depends on GEN_UICR_SECONDARY help When enabled, the UICR generator will configure the @@ -275,3 +274,5 @@ config GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES endif # GEN_UICR_SECONDARY endmenu + +source "Kconfig.zephyr" diff --git a/soc/nordic/common/uicr/gen_uicr/prj.conf b/soc/nordic/common/uicr/gen_uicr/prj.conf index e967f3a8ee98..b2a4ba591044 100644 --- a/soc/nordic/common/uicr/gen_uicr/prj.conf +++ b/soc/nordic/common/uicr/gen_uicr/prj.conf @@ -1,6 +1 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable UICR generator options - this is automatically set when building -# the gen_uicr image and enables the UICR generator configuration menu -CONFIG_IS_GEN_UICR_IMAGE=y +# nothing here From 86acc537843a931b10532a3cb2c9165dd7f19f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1174/3334] Revert "[nrf fromtree] Bluetooth: Mesh: Make net msg cache netkey aware" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5e22fe189a52fa13c7ed9e92c0c1e87a0798a7bc. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/net.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/subsys/bluetooth/mesh/net.c b/subsys/bluetooth/mesh/net.c index d791ba46f9ab..b2e1cc695f94 100644 --- a/subsys/bluetooth/mesh/net.c +++ b/subsys/bluetooth/mesh/net.c @@ -82,8 +82,7 @@ struct iv_val { static struct { uint32_t src : 15, /* MSb of source is always 0 */ - seq : 17; - uint16_t net_idx; + seq : 17; } msg_cache[CONFIG_BT_MESH_MSG_CACHE_SIZE]; static uint16_t msg_cache_next; @@ -146,22 +145,20 @@ static bool check_dup(struct net_buf_simple *data) return false; } -static bool msg_cache_match(struct net_buf_simple *pdu, uint16_t net_idx) +static bool msg_cache_match(struct net_buf_simple *pdu) { uint16_t i; for (i = msg_cache_next; i > 0U;) { if (msg_cache[--i].src == SRC(pdu->data) && - msg_cache[i].seq == (SEQ(pdu->data) & BIT_MASK(17)) && - msg_cache[i].net_idx == net_idx) { + msg_cache[i].seq == (SEQ(pdu->data) & BIT_MASK(17))) { return true; } } for (i = ARRAY_SIZE(msg_cache); i > msg_cache_next;) { if (msg_cache[--i].src == SRC(pdu->data) && - msg_cache[i].seq == (SEQ(pdu->data) & BIT_MASK(17)) && - msg_cache[i].net_idx == net_idx) { + msg_cache[i].seq == (SEQ(pdu->data) & BIT_MASK(17))) { return true; } } @@ -174,7 +171,6 @@ static void msg_cache_add(struct bt_mesh_net_rx *rx) msg_cache_next %= ARRAY_SIZE(msg_cache); msg_cache[msg_cache_next].src = rx->ctx.addr; msg_cache[msg_cache_next].seq = rx->seq; - msg_cache[msg_cache_next].net_idx = rx->sub->net_idx; msg_cache_next++; } @@ -657,14 +653,15 @@ static bool net_decrypt(struct bt_mesh_net_rx *rx, struct net_buf_simple *in, return false; } - if (rx->net_if == BT_MESH_NET_IF_ADV && msg_cache_match(out, rx->sub->net_idx)) { + if (rx->net_if == BT_MESH_NET_IF_ADV && msg_cache_match(out)) { LOG_DBG("Duplicate found in Network Message Cache"); return false; } LOG_DBG("src 0x%04x", rx->ctx.addr); - return bt_mesh_net_decrypt(&cred->enc, out, BT_MESH_NET_IVI_RX(rx), proxy) == 0; + return bt_mesh_net_decrypt(&cred->enc, out, BT_MESH_NET_IVI_RX(rx), + proxy) == 0; } /* Relaying from advertising to the advertising bearer should only happen From 0ea37b1c09764d9fec241e40f557d4a3ebf00651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1175/3334] Revert "[nrf fromtree] bluetooth: mesh: Increase BT RX Stack Size for PB-GATT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 44fc0c5595de0d9297287b53eeaef5bb9227a777. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 41fce83a0048..e89ca2bce919 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -111,7 +111,6 @@ config BT_RX_STACK_SIZE int "Size of the receiving thread stack" default 768 if BT_HCI_RAW default 3092 if BT_MESH_GATT_CLIENT - default 2800 if BT_MESH_PB_GATT default 2600 if BT_MESH default 2048 if BT_AUDIO default 1200 From ce93400ec86a66e742e38ea65700259c6cb6b08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1176/3334] Revert "[nrf fromtree] Bluetooth: Decode Bluetooth 6.2 version number" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a4ed97ac924abf769cea19963c324401b6aca5e. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/hci_types.h | 1 - subsys/bluetooth/host/hci_core.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index d520a2324266..cd6c716c1cbe 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -913,7 +913,6 @@ struct bt_hci_rp_configure_data_path { #define BT_HCI_VERSION_5_4 13 #define BT_HCI_VERSION_6_0 14 #define BT_HCI_VERSION_6_1 15 -#define BT_HCI_VERSION_6_2 16 #define BT_HCI_OP_READ_LOCAL_VERSION_INFO BT_OP(BT_OGF_INFO, 0x0001) /* 0x1001 */ struct bt_hci_rp_read_local_version_info { diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index d2a8d6d1202b..29a7f5d30ebf 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3963,7 +3963,7 @@ const char *bt_hci_get_ver_str(uint8_t core_version) { const char * const str[] = { "1.0b", "1.1", "1.2", "2.0", "2.1", "3.0", "4.0", "4.1", "4.2", - "5.0", "5.1", "5.2", "5.3", "5.4", "6.0", "6.1", "6.2" + "5.0", "5.1", "5.2", "5.3", "5.4", "6.0", "6.1" }; if (core_version < ARRAY_SIZE(str)) { From 0d1e26e82b864abf05c59a48ab6c98f2797284e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1177/3334] Revert "[nrf fromtree] Bluetooth: Host: Fix build error with observer-only config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ceb6274848b13fb79f0101fd43c2bd208185392f. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/scan.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index 8c5278f362c0..36aa492d611c 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -538,6 +538,7 @@ int bt_le_scan_user_remove(enum bt_le_scan_user flag) return scan_update(); } +#if defined(CONFIG_BT_CENTRAL) static void check_pending_conn(const bt_addr_le_t *id_addr, const bt_addr_le_t *addr, uint8_t adv_props) { @@ -592,6 +593,7 @@ static void check_pending_conn(const bt_addr_le_t *id_addr, LOG_WRN("Error while updating the scanner (%d)", err); } } +#endif /* CONFIG_BT_CENTRAL */ /* Convert Legacy adv report evt_type field to adv props */ static uint8_t get_adv_props_legacy(uint8_t evt_type) @@ -654,7 +656,7 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, /* For connection-purpose scanning, * skip app callbacks but allow pending-conn check logic. */ - if (IS_ENABLED(CONFIG_BT_CENTRAL) && !explicit_scan && conn_scan) { + if (!explicit_scan && conn_scan) { goto check_pending_conn; } @@ -684,9 +686,9 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, info->addr = NULL; check_pending_conn: - if (IS_ENABLED(CONFIG_BT_CENTRAL)) { - check_pending_conn(&id_addr, addr, info->adv_props); - } +#if defined(CONFIG_BT_CENTRAL) + check_pending_conn(&id_addr, addr, info->adv_props); +#endif /* CONFIG_BT_CENTRAL */ } #if defined(CONFIG_BT_EXT_ADV) From 3605209da832a1212ba06c018d581b33d91e20e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1178/3334] Revert "[nrf fromtree] Bluetooth: Host: Fix handling of adv reports when scanning for connection" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 346776f00643867b18831d8781ae6962f809573c. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/scan.c | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index 36aa492d611c..bffc5fd907f2 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -632,14 +632,13 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, struct bt_le_scan_cb *listener, *next; struct net_buf_simple_state state; bt_addr_le_t id_addr; - bool explicit_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN); - bool conn_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_CONN); LOG_DBG("%s event %u, len %u, rssi %d dBm", bt_addr_le_str(addr), info->adv_type, len, info->rssi); if (!IS_ENABLED(CONFIG_BT_PRIVACY) && !IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) && - explicit_scan && (info->adv_props & BT_HCI_LE_ADV_PROP_DIRECT)) { + atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN) && + (info->adv_props & BT_HCI_LE_ADV_PROP_DIRECT)) { LOG_DBG("Dropped direct adv report"); return; } @@ -653,13 +652,6 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, bt_lookup_id_addr(BT_ID_DEFAULT, addr)); } - /* For connection-purpose scanning, - * skip app callbacks but allow pending-conn check logic. - */ - if (!explicit_scan && conn_scan) { - goto check_pending_conn; - } - if (scan_dev_found_cb) { net_buf_simple_save(buf, &state); @@ -685,7 +677,6 @@ static void le_adv_recv(bt_addr_le_t *addr, struct bt_le_scan_recv_info *info, /* Clear pointer to this stack frame before returning to calling function */ info->addr = NULL; -check_pending_conn: #if defined(CONFIG_BT_CENTRAL) check_pending_conn(&id_addr, addr, info->adv_props); #endif /* CONFIG_BT_CENTRAL */ @@ -814,8 +805,6 @@ static void create_ext_adv_info(struct bt_hci_evt_le_ext_advertising_info const void bt_hci_le_adv_ext_report(struct net_buf *buf) { uint8_t num_reports = net_buf_pull_u8(buf); - bool explicit_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN); - bool conn_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_CONN); LOG_DBG("Adv number of reports %u", num_reports); @@ -828,23 +817,19 @@ void bt_hci_le_adv_ext_report(struct net_buf *buf) bool more_to_come; bool is_new_advertiser; - if (!explicit_scan) { + if (!atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN)) { /* The application has not requested explicit scan, so it is not expecting * advertising reports. Discard, and reset the reassembler if not inactive * This is done in the loop as this flag can change between each iteration, * and it is not uncommon that scanning is disabled in the callback called - * from le_adv_recv. - * - * However, if scanning is running for connection purposes, - * the report shall still be processed to allow pending connections. + * from le_adv_recv */ + if (reassembling_advertiser.state != FRAG_ADV_INACTIVE) { reset_reassembling_advertiser(); } - if (!conn_scan) { - break; - } + break; } if (buf->len < sizeof(*evt)) { @@ -1684,23 +1669,18 @@ void bt_hci_le_adv_report(struct net_buf *buf) { uint8_t num_reports = net_buf_pull_u8(buf); struct bt_hci_evt_le_advertising_info *evt; - bool explicit_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN); - bool conn_scan = atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_CONN); LOG_DBG("Adv number of reports %u", num_reports); while (num_reports--) { struct bt_le_scan_recv_info adv_info; - if (!explicit_scan && !conn_scan) { + if (!atomic_test_bit(scan_state.scan_flags, BT_LE_SCAN_USER_EXPLICIT_SCAN)) { /* The application has not requested explicit scan, so it is not expecting * advertising reports. Discard. * This is done in the loop as this flag can change between each iteration, * and it is not uncommon that scanning is disabled in the callback called - * from le_adv_recv. - * - * However, if scanning is running for connection purposes, - * the report shall still be processed to allow pending connections. + * from le_adv_recv */ break; From e6ec22654b2c4dcd6829b0ce601402151204a3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1179/3334] Revert "[nrf fromtree] Bluetooth: Mesh: Fix invalid write in private beacon server" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fecbc5eb47a5d2d24e3b2f9e6ad7b8f11ab80dce. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/priv_beacon_srv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/mesh/priv_beacon_srv.c b/subsys/bluetooth/mesh/priv_beacon_srv.c index 790ffe562835..8dd1ba3b1d8c 100644 --- a/subsys/bluetooth/mesh/priv_beacon_srv.c +++ b/subsys/bluetooth/mesh/priv_beacon_srv.c @@ -151,14 +151,13 @@ static int handle_node_id_get(const struct bt_mesh_model *mod, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - enum bt_mesh_feat_state node_id; + uint8_t node_id, status; uint16_t net_idx; - uint8_t status; net_idx = net_buf_simple_pull_le16(buf) & 0xfff; - status = bt_mesh_subnet_priv_node_id_get(net_idx, &node_id); - node_id_status_rsp(mod, ctx, status, net_idx, (uint8_t)node_id); + status = bt_mesh_subnet_priv_node_id_get(net_idx, (enum bt_mesh_feat_state *)&node_id); + node_id_status_rsp(mod, ctx, status, net_idx, node_id); return 0; } From 8bc82c1d018c483644bb2898cdfbadfe51ac041b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1180/3334] Revert "[nrf fromtree] Bluetooth: Host: Fix crash on bt_disable() with limited advertising" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit abd7a1ac72e4a21a2c882d0810ecc8001fead0aa. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index e4ad43bea565..98d3fe15061d 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -34,7 +34,6 @@ #include "hci_core.h" #include "id.h" #include "scan.h" -#include "adv.h" #define LOG_LEVEL CONFIG_BT_HCI_CORE_LOG_LEVEL LOG_MODULE_REGISTER(bt_adv); @@ -248,15 +247,12 @@ void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), #endif /* defined(CONFIG_BT_EXT_ADV) */ } -static void clear_ext_adv_instance(struct bt_le_ext_adv *adv, void *data) -{ - bt_le_lim_adv_cancel_timeout(adv); - memset(adv, 0, sizeof(*adv)); -} - void bt_adv_reset_adv_pool(void) { - bt_le_ext_adv_foreach(clear_ext_adv_instance, NULL); +#if defined(CONFIG_BT_EXT_ADV) + (void)memset(&adv_pool, 0, sizeof(adv_pool)); +#endif /* defined(CONFIG_BT_EXT_ADV) */ + (void)memset(&bt_dev.adv, 0, sizeof(bt_dev.adv)); } From 8696b9e37a7a4582072843d2d63870a0252caf04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1181/3334] Revert "[nrf fromtree] drivers: bluetooth: h4: Fix check for sufficient buffer size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 13430117590222f30b58d697ffbc53183203c900. Signed-off-by: Tomasz Moń --- drivers/bluetooth/hci/h4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci/h4.c b/drivers/bluetooth/hci/h4.c index 21be2213fb87..cfea346a946c 100644 --- a/drivers/bluetooth/hci/h4.c +++ b/drivers/bluetooth/hci/h4.c @@ -338,7 +338,7 @@ static inline void read_payload(const struct device *dev) LOG_DBG("Allocated rx.buf %p", h4->rx.buf); buf_tailroom = net_buf_tailroom(h4->rx.buf); - if (buf_tailroom < (h4->rx.remaining + h4->rx.hdr_len)) { + 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; From 76ddf00cbef3f97d23f5db666afe89c9f0b37151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1182/3334] Revert "[nrf fromtree] bluetooth: mesh: adv_ext: Fix scheduling with multiple relay adv sets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 824beb359eb511b79e76aa0abfc9b2bba1e90285. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/adv_ext.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 0ff0bc5e9fe7..b056f74a5876 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -391,16 +391,6 @@ static bool schedule_send(struct bt_mesh_ext_adv *ext_adv) if (!atomic_test_bit(ext_adv->flags, ADV_FLAG_PROXY)) { return false; } - } else if (k_work_is_pending(&ext_adv->work) && - !atomic_test_bit(ext_adv->flags, ADV_FLAG_PROXY)) { - /* This can happen if we try to schedule a send while a previous send is still - * pending in the work queue. There is nothing wrong with resubmitting the same - * work to the work queue, but in this case won't have a change to try a work from - * another advertising set which can be ready for sending. - * - * If, however, ADV_FLAG_PROXY is set, we want to stop the proxy advertising. - */ - return false; } bt_mesh_wq_submit(&ext_adv->work); From 0aec9127b677a9c3bc9b9c323dcf2320eb4518be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:45 +0100 Subject: [PATCH 1183/3334] Revert "[nrf fromtree] tests: bluetooth: audio: fix bsim timing" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a983f57d53dd0b78fe06d61e99d3f608a87596f5. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 8 ++++---- tests/bsim/bluetooth/audio/src/common.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 98d3fe15061d..ec339bd6f60c 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1509,14 +1509,14 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { if (IS_ENABLED(CONFIG_BT_PRIVACY) && !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - (!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED) || - atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED))) { + (atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || + !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) { bt_id_set_adv_private_addr(adv); } } else { if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - (!atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED) || - atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED))) { + (atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || + !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) { bt_id_set_adv_private_addr(adv); } } diff --git a/tests/bsim/bluetooth/audio/src/common.c b/tests/bsim/bluetooth/audio/src/common.c index d09bcacd3797..29e8c5cc2379 100644 --- a/tests/bsim/bluetooth/audio/src/common.c +++ b/tests/bsim/bluetooth/audio/src/common.c @@ -264,20 +264,20 @@ void start_broadcast_adv(struct bt_le_ext_adv *adv) return; } - if (info.per_adv_state == BT_LE_PER_ADV_STATE_DISABLED) { - /* Enable Periodic Advertising */ - err = bt_le_per_adv_start(adv); + if (info.ext_adv_state == BT_LE_EXT_ADV_STATE_DISABLED) { + /* Start extended advertising */ + err = bt_le_ext_adv_start(adv, BT_LE_EXT_ADV_START_DEFAULT); if (err != 0) { - FAIL("Failed to enable periodic advertising: %d\n", err); + FAIL("Failed to start extended advertising: %d\n", err); return; } } - if (info.ext_adv_state == BT_LE_EXT_ADV_STATE_DISABLED) { - /* Start extended advertising */ - err = bt_le_ext_adv_start(adv, BT_LE_EXT_ADV_START_DEFAULT); + if (info.per_adv_state == BT_LE_PER_ADV_STATE_DISABLED) { + /* Enable Periodic Advertising */ + err = bt_le_per_adv_start(adv); if (err != 0) { - FAIL("Failed to start extended advertising: %d\n", err); + FAIL("Failed to enable periodic advertising: %d\n", err); return; } } From 44e3579c4963d78be10020a8a478e9d386ff9150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1184/3334] Revert "[nrf fromtree] Bluetooth: Host: Fix Periodic Advertising random address update" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 008c0fdfc893866172bfd5898cab5012347b6735. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index ec339bd6f60c..77dc28345987 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1509,14 +1509,12 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { if (IS_ENABLED(CONFIG_BT_PRIVACY) && !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - (atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || - !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) { + !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) { bt_id_set_adv_private_addr(adv); } } else { if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - (atomic_test_bit(adv->flags, BT_PER_ADV_ENABLED) || - !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED))) { + !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) { bt_id_set_adv_private_addr(adv); } } From 161b193601e3075b57db6de88a4f34b83637c195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1185/3334] Revert "[nrf fromtree] Bluetooth: Host: Fix unnecessary random address update" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ca99382d97dc15596e7a22ebe22380e0c193b4c. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 9 ++------- subsys/bluetooth/host/hci_core.h | 4 ---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 77dc28345987..6841f0646012 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1176,9 +1176,6 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, atomic_set_bit_to(adv->flags, BT_ADV_EXT_ADV, param->options & BT_LE_ADV_OPT_EXT_ADV); - atomic_set_bit_to(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED, - own_addr_type == BT_HCI_OWN_ADDR_RANDOM); - return 0; } @@ -1508,13 +1505,11 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { if (IS_ENABLED(CONFIG_BT_PRIVACY) && - !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) { + !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { bt_id_set_adv_private_addr(adv); } } else { - if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY) && - !atomic_test_and_clear_bit(adv->flags, BT_ADV_RANDOM_ADDR_UPDATED)) { + if (!atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { bt_id_set_adv_private_addr(adv); } } diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index e4a390af20aa..3d1c87cb3c0b 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -116,10 +116,6 @@ enum { BT_ADV_PARAMS_SET, /* Advertising data has been set in the controller. */ BT_ADV_DATA_SET, - /* Advertising random address has been updated in the controller before - * enabling advertising. - */ - BT_ADV_RANDOM_ADDR_UPDATED, /* Advertising random address pending to be set in the controller. */ BT_ADV_RANDOM_ADDR_PENDING, /* The private random address of the advertiser is valid for this cycle From 333aad4205537372c42a3ea6107224a4fe4e92bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1186/3334] Revert "[nrf fromtree] Bluetooth: Host: Make use of common array helper macros" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2f15eba8803812a08fdf7f326a531c1f7abd3f61. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 6 ++++-- subsys/bluetooth/host/conn.c | 15 +++++++++------ subsys/bluetooth/host/scan.c | 7 ++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 6841f0646012..bdf74f47aa84 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -187,9 +187,11 @@ static struct bt_le_ext_adv adv_pool[CONFIG_BT_EXT_ADV_MAX_ADV_SET]; #if defined(CONFIG_BT_EXT_ADV) uint8_t bt_le_ext_adv_get_index(struct bt_le_ext_adv *adv) { - __ASSERT(IS_ARRAY_ELEMENT(adv_pool, adv), "Invalid bt_adv pointer"); + ptrdiff_t index = adv - adv_pool; - return (uint8_t)ARRAY_INDEX(adv_pool, adv); + __ASSERT(index >= 0 && index < ARRAY_SIZE(adv_pool), + "Invalid bt_adv pointer"); + return (uint8_t)index; } static struct bt_le_ext_adv *adv_new(void) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 9c6bb386f6c1..6702073ce69f 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1546,20 +1546,23 @@ uint8_t bt_conn_index(const struct bt_conn *conn) switch (conn->type) { #if defined(CONFIG_BT_ISO) case BT_CONN_TYPE_ISO: - __ASSERT(IS_ARRAY_ELEMENT(iso_conns, conn), "Invalid bt_conn pointer"); - index = ARRAY_INDEX(iso_conns, conn); + index = conn - iso_conns; + __ASSERT(index >= 0 && index < ARRAY_SIZE(iso_conns), + "Invalid bt_conn pointer"); break; #endif #if defined(CONFIG_BT_CLASSIC) case BT_CONN_TYPE_SCO: - __ASSERT(IS_ARRAY_ELEMENT(sco_conns, conn), "Invalid bt_conn pointer"); - index = ARRAY_INDEX(sco_conns, conn); + index = conn - sco_conns; + __ASSERT(index >= 0 && index < ARRAY_SIZE(sco_conns), + "Invalid bt_conn pointer"); break; #endif default: #if defined(CONFIG_BT_CONN) - __ASSERT(IS_ARRAY_ELEMENT(acl_conns, conn), "Invalid bt_conn pointer"); - index = ARRAY_INDEX(acl_conns, conn); + index = conn - acl_conns; + __ASSERT(index >= 0 && index < ARRAY_SIZE(acl_conns), + "Invalid bt_conn pointer"); #else __ASSERT(false, "Invalid connection type %u", conn->type); #endif /* CONFIG_BT_CONN */ diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index bffc5fd907f2..b154729438a0 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -1841,10 +1841,11 @@ void bt_le_scan_cb_unregister(struct bt_le_scan_cb *cb) #if defined(CONFIG_BT_PER_ADV_SYNC) uint8_t bt_le_per_adv_sync_get_index(struct bt_le_per_adv_sync *per_adv_sync) { - __ASSERT(IS_ARRAY_ELEMENT(per_adv_sync_pool, per_adv_sync), - "Invalid per_adv_sync pointer"); + ptrdiff_t index = per_adv_sync - per_adv_sync_pool; - return (uint8_t)ARRAY_INDEX(per_adv_sync_pool, per_adv_sync); + __ASSERT(index >= 0 && ARRAY_SIZE(per_adv_sync_pool) > index, + "Invalid per_adv_sync pointer"); + return (uint8_t)index; } struct bt_le_per_adv_sync *bt_le_per_adv_sync_lookup_index(uint8_t index) From 0732ee2b50360b497a9d5b19d1c0364fd2171757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1187/3334] Revert "[nrf fromtree] Bluetooth: Mesh: Filter duplicates in brg subnets list" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c386832bef8326208c1d3b74e0a1ae661d6f39c1. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/brg_cfg_srv.c | 64 ++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/subsys/bluetooth/mesh/brg_cfg_srv.c b/subsys/bluetooth/mesh/brg_cfg_srv.c index 0d0bda534b66..d622ebf48a25 100644 --- a/subsys/bluetooth/mesh/brg_cfg_srv.c +++ b/subsys/bluetooth/mesh/brg_cfg_srv.c @@ -145,34 +145,60 @@ static int bridged_subnets_get(const struct bt_mesh_model *model, struct bt_mesh net_buf_simple_add_le16(&msg, net_idx_filter); net_buf_simple_add_u8(&msg, start_id); + uint8_t cnt = 0; + uint16_t net_idx1, net_idx2; + for (int i = 0; i < rows; i++) { - uint16_t net_idx1 = brg_tbl[i].net_idx1; - uint16_t net_idx2 = brg_tbl[i].net_idx2; - bool is_first_instance; + net_idx1 = brg_tbl[i].net_idx1; + net_idx2 = brg_tbl[i].net_idx2; if (net_buf_simple_tailroom(&msg) < 3 + BT_MESH_MIC_SHORT) { break; } - is_first_instance = true; - for (int j = 0; j < i; j++) { - if (net_idx1 == brg_tbl[j].net_idx1 && net_idx2 == brg_tbl[j].net_idx2) { - is_first_instance = false; - break; + switch (filter_net_idx.filter) { + /* Report pair of NetKeys from the table, starting from start_id. */ + case 0: + if (i >= start_id) { + key_idx_pack_pair(&msg, net_idx1, net_idx2); } - } + break; - if (is_first_instance && - (filter_net_idx.filter == 0 || - (filter_net_idx.filter == 1 && net_idx1 == filter_net_idx.net_idx) || - (filter_net_idx.filter == 2 && net_idx2 == filter_net_idx.net_idx) || - (filter_net_idx.filter == 3 && (net_idx1 == filter_net_idx.net_idx || - net_idx2 == filter_net_idx.net_idx)))) { - if (start_id > 0) { - start_id--; - } else { - key_idx_pack_pair(&msg, net_idx1, net_idx2); + /* Report pair of NetKeys in which (NetKeyIndex1) matches the net_idx */ + case 1: + if (net_idx1 == filter_net_idx.net_idx) { + if (cnt >= start_id) { + key_idx_pack_pair(&msg, net_idx1, net_idx2); + } + cnt++; } + break; + + /* Report pair of NetKeys in which (NetKeyIndex2) matches the net_idx */ + case 2: + if (net_idx2 == filter_net_idx.net_idx) { + if (cnt >= start_id) { + key_idx_pack_pair(&msg, net_idx1, net_idx2); + } + cnt++; + } + break; + + /* Report pair of NetKeys in which (NetKeyIndex1 or NetKeyIndex2) matches the + * net_idx + */ + case 3: + if (net_idx1 == filter_net_idx.net_idx || + net_idx2 == filter_net_idx.net_idx) { + if (cnt >= start_id) { + key_idx_pack_pair(&msg, net_idx1, net_idx2); + } + cnt++; + } + break; + + default: + CODE_UNREACHABLE; } } From 54c4b8144237615edd014a93af454ba987250efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1188/3334] Revert "[nrf fromtree] bluetooth: mesh: Fix build without settings under asan" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9bbab4ead9fc50171aaf0a5b7c3adf3d9707b9db. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/app_keys.c | 4 ---- subsys/bluetooth/mesh/brg_cfg.c | 4 ---- subsys/bluetooth/mesh/cdb.c | 16 ---------------- subsys/bluetooth/mesh/cfg.c | 4 ---- subsys/bluetooth/mesh/heartbeat.c | 4 ---- subsys/bluetooth/mesh/net.c | 16 ---------------- subsys/bluetooth/mesh/rpl.c | 4 ---- subsys/bluetooth/mesh/solicitation.c | 8 -------- subsys/bluetooth/mesh/subnet.c | 4 ---- subsys/bluetooth/mesh/va.c | 4 ---- 10 files changed, 68 deletions(-) diff --git a/subsys/bluetooth/mesh/app_keys.c b/subsys/bluetooth/mesh/app_keys.c index f573add5a324..5afd887a8e80 100644 --- a/subsys/bluetooth/mesh/app_keys.c +++ b/subsys/bluetooth/mesh/app_keys.c @@ -666,10 +666,6 @@ static int app_key_set(const char *name, size_t len_rd, uint16_t app_idx; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; diff --git a/subsys/bluetooth/mesh/brg_cfg.c b/subsys/bluetooth/mesh/brg_cfg.c index d0bdaef7f05e..58d1aada550d 100644 --- a/subsys/bluetooth/mesh/brg_cfg.c +++ b/subsys/bluetooth/mesh/brg_cfg.c @@ -52,10 +52,6 @@ static int brg_en_set(const char *name, size_t len_rd, settings_read_cb read_cb, { int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (len_rd == 0) { brg_enabled = 0; LOG_DBG("Cleared bridge enable state"); diff --git a/subsys/bluetooth/mesh/cdb.c b/subsys/bluetooth/mesh/cdb.c index dc2725a7a327..310108d7b756 100644 --- a/subsys/bluetooth/mesh/cdb.c +++ b/subsys/bluetooth/mesh/cdb.c @@ -180,10 +180,6 @@ static int cdb_net_set(const char *name, size_t len_rd, struct net_val net; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (len_rd == 0) { LOG_DBG("val (null)"); return 0; @@ -223,10 +219,6 @@ static int cdb_node_set(const char *name, size_t len_rd, uint16_t addr; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; @@ -289,10 +281,6 @@ static int cdb_subnet_set(const char *name, size_t len_rd, uint16_t net_idx; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; @@ -359,10 +347,6 @@ static int cdb_app_key_set(const char *name, size_t len_rd, uint16_t app_idx; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; diff --git a/subsys/bluetooth/mesh/cfg.c b/subsys/bluetooth/mesh/cfg.c index e5563b95c3c1..155c2e616d55 100644 --- a/subsys/bluetooth/mesh/cfg.c +++ b/subsys/bluetooth/mesh/cfg.c @@ -429,10 +429,6 @@ static int cfg_set(const char *name, size_t len_rd, struct cfg_val cfg; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (len_rd == 0) { LOG_DBG("Cleared configuration state"); return 0; diff --git a/subsys/bluetooth/mesh/heartbeat.c b/subsys/bluetooth/mesh/heartbeat.c index 0ad4828279c2..133c552620f5 100644 --- a/subsys/bluetooth/mesh/heartbeat.c +++ b/subsys/bluetooth/mesh/heartbeat.c @@ -416,10 +416,6 @@ static int hb_pub_set(const char *name, size_t len_rd, struct hb_pub_val hb_val; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - err = bt_mesh_settings_set(read_cb, cb_arg, &hb_val, sizeof(hb_val)); if (err) { LOG_ERR("Failed to set \'hb_val\'"); diff --git a/subsys/bluetooth/mesh/net.c b/subsys/bluetooth/mesh/net.c index b2e1cc695f94..276728bd9a45 100644 --- a/subsys/bluetooth/mesh/net.c +++ b/subsys/bluetooth/mesh/net.c @@ -1005,10 +1005,6 @@ static int net_set(const char *name, size_t len_rd, settings_read_cb read_cb, struct bt_mesh_key key; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (len_rd == 0) { LOG_DBG("val (null)"); @@ -1046,10 +1042,6 @@ static int iv_set(const char *name, size_t len_rd, settings_read_cb read_cb, struct iv_val iv; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (len_rd == 0) { LOG_DBG("IV deleted"); @@ -1082,10 +1074,6 @@ static int seq_set(const char *name, size_t len_rd, settings_read_cb read_cb, struct seq_val seq; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (len_rd == 0) { LOG_DBG("val (null)"); @@ -1125,10 +1113,6 @@ static int dev_key_cand_set(const char *name, size_t len_rd, settings_read_cb re int err; struct bt_mesh_key key; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (len_rd == 0) { LOG_DBG("val (null)"); diff --git a/subsys/bluetooth/mesh/rpl.c b/subsys/bluetooth/mesh/rpl.c index 7c9317fcc94c..581c94771c81 100644 --- a/subsys/bluetooth/mesh/rpl.c +++ b/subsys/bluetooth/mesh/rpl.c @@ -272,10 +272,6 @@ static int rpl_set(const char *name, size_t len_rd, int err; uint16_t src; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; diff --git a/subsys/bluetooth/mesh/solicitation.c b/subsys/bluetooth/mesh/solicitation.c index 2d863dc57dc5..a2872daecb03 100644 --- a/subsys/bluetooth/mesh/solicitation.c +++ b/subsys/bluetooth/mesh/solicitation.c @@ -120,10 +120,6 @@ static int sseq_set(const char *name, size_t len_rd, { int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - err = bt_mesh_settings_set(read_cb, cb_arg, &sseq_out, sizeof(sseq_out)); if (err) { LOG_ERR("Failed to set \'sseq\'"); @@ -369,10 +365,6 @@ static int srpl_set(const char *name, size_t len_rd, } } - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - err = bt_mesh_settings_set(read_cb, cb_arg, &sseq, sizeof(sseq)); if (err) { LOG_ERR("Failed to set \'sseq\'"); diff --git a/subsys/bluetooth/mesh/subnet.c b/subsys/bluetooth/mesh/subnet.c index 7f2943365976..b17b9a497400 100644 --- a/subsys/bluetooth/mesh/subnet.c +++ b/subsys/bluetooth/mesh/subnet.c @@ -971,10 +971,6 @@ static int net_key_set(const char *name, size_t len_rd, int err; uint16_t net_idx; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; diff --git a/subsys/bluetooth/mesh/va.c b/subsys/bluetooth/mesh/va.c index 0b83e93e1c8d..fb81f36251cf 100644 --- a/subsys/bluetooth/mesh/va.c +++ b/subsys/bluetooth/mesh/va.c @@ -219,10 +219,6 @@ static int va_set(const char *name, size_t len_rd, uint16_t index; int err; - if (!IS_ENABLED(CONFIG_BT_SETTINGS)) { - return 0; - } - if (!name) { LOG_ERR("Insufficient number of arguments"); return -ENOENT; From d3133ddcaa5e3d2317b85192e6706772920c8657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1189/3334] Revert "[nrf fromtree] Bluetooth: Mesh: Minor cleanup of prov link close on success" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a3da8729e24a060f2317e32484c8c6ff9fe855c8. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/provisioner.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/provisioner.c b/subsys/bluetooth/mesh/provisioner.c index 28372caf4554..353cde6b673a 100644 --- a/subsys/bluetooth/mesh/provisioner.c +++ b/subsys/bluetooth/mesh/provisioner.c @@ -577,9 +577,10 @@ static void prov_complete(const uint8_t *data) bt_hex(&provisionee.new_dev_key, 16), node->net_idx, node->num_elem, node->addr); + bt_mesh_prov_link.expect = PROV_NO_PDU; atomic_set_bit(bt_mesh_prov_link.flags, COMPLETE); - prov_link_close(PROV_BEARER_LINK_STATUS_SUCCESS); + bt_mesh_prov_link.bearer->link_close(PROV_BEARER_LINK_STATUS_SUCCESS); } static void prov_node_add(void) From 1c388847378830da59170013b77ead71c7541e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1190/3334] Revert "[nrf fromtree] Bluetooth: Mesh: Provisioner closes link on failed" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c8843dc5627dd65ed91597fd5f0f8fc0bc1c23e2. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/provisioner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/provisioner.c b/subsys/bluetooth/mesh/provisioner.c index 353cde6b673a..b1df6431d068 100644 --- a/subsys/bluetooth/mesh/provisioner.c +++ b/subsys/bluetooth/mesh/provisioner.c @@ -685,7 +685,7 @@ static void prov_confirm(const uint8_t *data) static void prov_failed(const uint8_t *data) { LOG_WRN("Error: 0x%02x", data[0]); - prov_link_close(PROV_BEARER_LINK_STATUS_FAIL); + reset_state(); } static void local_input_complete(void) From e0e944664b8e900266d98a667e60ea1a79a90273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1191/3334] Revert "[nrf fromtree] Bluetooth: Host: bt_iso_reset before bt_conn_cleanup_all" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 699429b4d78c61c769adea98b471609abefd298a. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/hci_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 29a7f5d30ebf..274c202d800a 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4650,10 +4650,6 @@ int bt_disable(void) bt_periodic_sync_disable(); #endif /* CONFIG_BT_PER_ADV_SYNC */ - if (IS_ENABLED(CONFIG_BT_ISO)) { - bt_iso_reset(); - } - #if defined(CONFIG_BT_CONN) if (IS_ENABLED(CONFIG_BT_SMP)) { bt_pub_key_hci_disrupted(); @@ -4708,6 +4704,10 @@ int bt_disable(void) /* 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(); + } + bt_monitor_send(BT_MONITOR_CLOSE_INDEX, NULL, 0); /* Clear BT_DEV_ENABLE here to prevent early bt_enable() calls, before disable is From 65546fbd35bea1d16282323b4aebf77df2c98b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1192/3334] Revert "[nrf fromtree] bluetooth: host: remove useless internal flag BT_ADV_PERSIST" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7bd6ca378acd5fb89c93961a1ff9d53fe931cea2. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 15 +++++++++++++++ subsys/bluetooth/host/hci_core.c | 5 ++++- subsys/bluetooth/host/hci_core.h | 4 ++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index bdf74f47aa84..0b79ffc9d168 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1005,6 +1005,8 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, bt_conn_unref(conn); } + atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); + atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable); @@ -1168,6 +1170,9 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, } } + /* Flag only used by bt_le_adv_start API. */ + atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); + atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable); @@ -1254,6 +1259,9 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, bt_conn_unref(conn); } + /* Flag always set to false by le_ext_adv_param_set */ + atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); + return 0; } @@ -1310,6 +1318,11 @@ int bt_le_adv_stop(void) (void)bt_le_lim_adv_cancel_timeout(adv); + /* Make sure advertising is not re-enabled later even if it's not + * currently enabled (i.e. BT_DEV_ADVERTISING is not set). + */ + atomic_clear_bit(adv->flags, BT_ADV_PERSIST); + if (!atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { /* Legacy advertiser exists, but is not currently advertising. * This happens when keep advertising behavior is active but @@ -1549,6 +1562,8 @@ int bt_le_ext_adv_stop(struct bt_le_ext_adv *adv) (void)bt_le_lim_adv_cancel_timeout(adv); + atomic_clear_bit(adv->flags, BT_ADV_PERSIST); + if (!atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { return 0; } diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 274c202d800a..2ba274cd2275 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1499,10 +1499,13 @@ void bt_hci_le_enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt) if (IS_ENABLED(CONFIG_BT_EXT_ADV) && !BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) { + struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy(); /* No advertising set terminated event, must be a * legacy advertiser set. */ - bt_le_adv_delete_legacy(); + if (!atomic_test_bit(adv->flags, BT_ADV_PERSIST)) { + bt_le_adv_delete_legacy(); + } } } diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 3d1c87cb3c0b..315db2d38884 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -140,6 +140,10 @@ enum { * the identity address instead. */ BT_ADV_USE_IDENTITY, + /* Advertiser has been configured to keep advertising after a connection + * has been established as long as there are connections available. + */ + BT_ADV_PERSIST, /* Advertiser has been temporarily disabled. */ BT_ADV_PAUSED, /* Periodic Advertising has been enabled in the controller. */ From 8073b2cf585eb062c6c30bbbea24a86da8443ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1193/3334] Revert "[nrf fromtree] bluetooth: host: remove no longer used internal API bt_le_adv_resume()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ef041b051e3429a32b7098fc838a02d694f38e79. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 83 +++++++++++++++++++++++++++++++++++++ subsys/bluetooth/host/adv.h | 2 + 2 files changed, 85 insertions(+) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 0b79ffc9d168..d76e6bb69e50 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1369,6 +1369,89 @@ int bt_le_adv_stop(void) return 0; } +#if defined(CONFIG_BT_PERIPHERAL) +static uint32_t adv_get_options(const struct bt_le_ext_adv *adv) +{ + uint32_t options = 0; + + if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { + options |= BT_LE_ADV_OPT_CONN; + } + + if (atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { + options |= BT_LE_ADV_OPT_USE_IDENTITY; + } + + return options; +} + +void bt_le_adv_resume(void) +{ + struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy(); + struct bt_conn *conn; + bool persist_paused = false; + int err; + + if (!adv) { + LOG_DBG("No valid legacy adv to resume"); + return; + } + + if (!(atomic_test_bit(adv->flags, BT_ADV_PERSIST) && + !atomic_test_bit(adv->flags, BT_ADV_ENABLED))) { + return; + } + + if (!atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { + return; + } + + err = le_adv_start_add_conn(adv, &conn); + if (err) { + LOG_ERR("Host cannot resume connectable advertising (%d)", err); + return; + } + + LOG_DBG("Resuming connectable advertising"); + + if (IS_ENABLED(CONFIG_BT_PRIVACY) && + !atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { + bt_id_set_adv_private_addr(adv); + } else { + uint8_t own_addr_type; + bool dir_adv = adv_is_directed(adv); + uint32_t options = adv_get_options(adv); + + /* Always set the address. Don't assume it has not changed. */ + err = bt_id_set_adv_own_addr(adv, options, dir_adv, &own_addr_type); + if (err) { + LOG_ERR("Controller cannot resume connectable advertising (%d)", err); + return; + } + } + + err = bt_le_adv_set_enable(adv, true); + if (err) { + LOG_ERR("Controller cannot resume connectable advertising (%d)", err); + bt_conn_set_state(conn, BT_CONN_DISCONNECTED); + + /* Temporarily clear persist flag to avoid recursion in + * bt_conn_unref if the flag is still set. + */ + persist_paused = atomic_test_and_clear_bit(adv->flags, + BT_ADV_PERSIST); + } + + /* Since we don't give the application a reference to manage in + * this case, we need to release this reference here. + */ + bt_conn_unref(conn); + if (persist_paused) { + atomic_set_bit(adv->flags, BT_ADV_PERSIST); + } +} +#endif /* defined(CONFIG_BT_PERIPHERAL) */ + #if defined(CONFIG_BT_EXT_ADV) int bt_le_ext_adv_get_info(const struct bt_le_ext_adv *adv, struct bt_le_ext_adv_info *info) diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index 6cc950fe8e7f..65ad51135ce0 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -9,6 +9,8 @@ #include +void bt_le_adv_resume(void); + struct bt_le_ext_adv *bt_le_adv_lookup_legacy(void); void bt_le_adv_delete_legacy(void); From 51b6de0bdbdca857c68dd9785dde3a33db2e4359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1194/3334] Revert "[nrf fromtree] bluetooth: host: do not attempt to resume terminated advertising sets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f6f1ea3c5e1d61d55421dc45ce771ca2df518f3f. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/adv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index d76e6bb69e50..6bf3e4ed9517 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -2249,7 +2249,13 @@ void bt_hci_le_adv_set_terminated(struct net_buf *buf) } if (adv == bt_dev.adv) { - bt_le_adv_delete_legacy(); + if (atomic_test_bit(adv->flags, BT_ADV_PERSIST)) { +#if defined(CONFIG_BT_PERIPHERAL) + bt_le_adv_resume(); +#endif + } else { + bt_le_adv_delete_legacy(); + } } } From acf3fb3db4c6657aa692414de05945eef35a0ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1195/3334] Revert "[nrf fromtree] bluetooth: host: do not resume periodic connectable advertisers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c6c0e33ba2d3a2fac877490f4d3c594e8cb4b3fa. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/hci_core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 2ba274cd2275..33306596b2ce 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1497,6 +1497,15 @@ void bt_hci_le_enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt) bt_addr_copy(&conn->le.resp_addr.a, &evt->local_rpa); } + /* if the controller supports, lets advertise for another + * peripheral connection. + * check for connectable advertising state is sufficient as + * this is how this le connection complete for peripheral occurred. + */ + if (BT_LE_STATES_PER_CONN_ADV(bt_dev.le.states)) { + bt_le_adv_resume(); + } + if (IS_ENABLED(CONFIG_BT_EXT_ADV) && !BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) { struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy(); From adeb58cd541cc1bf5235e356bb4e6a57fc3603f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1196/3334] Revert "[nrf fromtree] bluetooth: host: do not use freed connection to resume advertising" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 36ec1c58f8a166b48343b112c2940d89158c4ae6. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/conn.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 6702073ce69f..15dd01fafeac 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1497,6 +1497,8 @@ void bt_conn_unref(struct bt_conn *conn) { atomic_val_t old; bool deallocated; + enum bt_conn_type conn_type; + uint8_t conn_role; uint16_t conn_handle; /* Used only if CONFIG_ASSERT and CONFIG_BT_CONN_TX. */ __maybe_unused bool conn_tx_is_pending; @@ -1510,6 +1512,8 @@ void bt_conn_unref(struct bt_conn *conn) * we store its properties of interest before decrementing the ref-count, * then unset the local pointer. */ + conn_type = conn->type; + conn_role = conn->role; conn_handle = conn->handle; #if CONFIG_BT_CONN_TX && CONFIG_ASSERT conn_tx_is_pending = k_work_is_pending(&conn->tx_complete_work); @@ -1537,6 +1541,18 @@ void bt_conn_unref(struct bt_conn *conn) */ k_sem_give(&pending_recycled_events); k_work_submit(&recycled_work); + + /* Use the freed slot to automatically resume LE peripheral advertising. + * + * This behavior is deprecated: + * - 8cfad44: Bluetooth: Deprecate adv auto-resume + * - #72567: Bluetooth: Advertising resume functionality is broken + * - Migration guide to Zephyr v4.0.0, Automatic advertiser resumption is deprecated + */ + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && conn_type == BT_CONN_TYPE_LE && + conn_role == BT_CONN_ROLE_PERIPHERAL) { + bt_le_adv_resume(); + } } uint8_t bt_conn_index(const struct bt_conn *conn) From d3f6ab10e593d6248782e4faafc6a2a932d9b39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1197/3334] Revert "[nrf fromtree] bluetooth: host: remove transitional option _BT_LE_ADV_OPT_ONE_TIME" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 03241df398d3d63130fc9378d0bb5a82112cd248. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/bluetooth.h | 8 ++++++++ subsys/bluetooth/host/adv.c | 22 ++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 8e738d21970d..0b27fd8ba137 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -691,6 +691,14 @@ enum bt_le_adv_opt { /** Convenience value when no options are specified. */ BT_LE_ADV_OPT_NONE = 0, + /** + * @internal + * + * Internal access to the deprecated value to maintain + * the implementation of the deprecated feature. + */ + _BT_LE_ADV_OPT_ONE_TIME = BIT(1), + /** * @brief Connectable advertising * diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 6bf3e4ed9517..a5c923b95b22 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -981,6 +981,11 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && (param->options & BT_LE_ADV_OPT_CONN)) { err = le_adv_start_add_conn(adv, &conn); if (err) { + if (err == -ENOMEM && !dir_adv && + !(param->options & _BT_LE_ADV_OPT_ONE_TIME)) { + goto set_adv_state; + } + return err; } } @@ -1005,7 +1010,9 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, bt_conn_unref(conn); } - atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); +set_adv_state: + atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, !dir_adv && + !(param->options & _BT_LE_ADV_OPT_ONE_TIME)); atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); @@ -1235,6 +1242,11 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && (param->options & BT_LE_ADV_OPT_CONN)) { err = le_adv_start_add_conn(adv, &conn); if (err) { + if (err == -ENOMEM && !dir_adv && + !(param->options & _BT_LE_ADV_OPT_ONE_TIME)) { + goto set_adv_state; + } + return err; } } @@ -1259,8 +1271,10 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, bt_conn_unref(conn); } +set_adv_state: /* Flag always set to false by le_ext_adv_param_set */ - atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); + atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, !dir_adv && + !(param->options & _BT_LE_ADV_OPT_ONE_TIME)); return 0; } @@ -1374,6 +1388,10 @@ static uint32_t adv_get_options(const struct bt_le_ext_adv *adv) { uint32_t options = 0; + if (!atomic_test_bit(adv->flags, BT_ADV_PERSIST)) { + options |= _BT_LE_ADV_OPT_ONE_TIME; + } + if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { options |= BT_LE_ADV_OPT_CONN; } From a30da31518d783d57c5a7e399c69a861782225fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:46 +0100 Subject: [PATCH 1198/3334] Revert "[nrf fromtree] bluetooth: host: remove transitional option _BT_LE_ADV_OPT_CONNECTABLE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b04ae4bfb71cd640c314b79516c5f1303428ed65. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/bluetooth.h | 12 ++++++++++++ subsys/bluetooth/host/adv.c | 29 ++++++++++++++++------------ subsys/bluetooth/host/id.c | 9 +++++---- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 0b27fd8ba137..a365698d063c 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -691,6 +691,18 @@ enum bt_le_adv_opt { /** Convenience value when no options are specified. */ BT_LE_ADV_OPT_NONE = 0, + /** + * @internal + * + * Internal access to the deprecated value to maintain the + * implementation of the deprecated feature. + * + * At the end of the deprecation period, ABI will change so + * `BT_LE_ADV_OPT_CONN` is just `BIT(0)`, removing the need for this + * symbol. + */ + _BT_LE_ADV_OPT_CONNECTABLE = BIT(0), + /** * @internal * diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index a5c923b95b22..749495bcb563 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -368,8 +368,9 @@ static bool valid_adv_ext_param(const struct bt_le_adv_param *param) { if (IS_ENABLED(CONFIG_BT_EXT_ADV) && BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) { - if (param->peer && !(param->options & BT_LE_ADV_OPT_EXT_ADV) && - !(param->options & BT_LE_ADV_OPT_CONN)) { + if (param->peer && + !(param->options & BT_LE_ADV_OPT_EXT_ADV) && + !(param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { /* Cannot do directed non-connectable advertising * without extended advertising. */ @@ -409,7 +410,7 @@ static bool valid_adv_ext_param(const struct bt_le_adv_param *param) return false; } - if (!(param->options & BT_LE_ADV_OPT_CONN)) { + if (!(param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { /* * BT Core 4.2 [Vol 2, Part E, 7.8.5] * The Advertising_Interval_Min and Advertising_Interval_Max @@ -452,7 +453,7 @@ static bool valid_adv_param(const struct bt_le_adv_param *param) return false; } - if (param->peer && !(param->options & BT_LE_ADV_OPT_CONN)) { + if (param->peer && !(param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { return false; } @@ -939,7 +940,7 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, bt_addr_le_copy(&adv->target_addr, BT_ADDR_LE_ANY); } - if (param->options & BT_LE_ADV_OPT_CONN) { + if (param->options & _BT_LE_ADV_OPT_CONNECTABLE) { if (dir_adv) { if (param->options & BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY) { set_param.type = BT_HCI_ADV_DIRECT_IND_LOW_DUTY; @@ -978,7 +979,8 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, } } - if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && (param->options & BT_LE_ADV_OPT_CONN)) { + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && + (param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); if (err) { if (err == -ENOMEM && !dir_adv && @@ -1014,7 +1016,8 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, !dir_adv && !(param->options & _BT_LE_ADV_OPT_ONE_TIME)); - atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); + atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, + param->options & _BT_LE_ADV_OPT_CONNECTABLE); atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable); @@ -1122,7 +1125,7 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, cp->scan_req_notify_enable = BT_HCI_LE_ADV_SCAN_REQ_ENABLE; } - if (param->options & BT_LE_ADV_OPT_CONN) { + if (param->options & _BT_LE_ADV_OPT_CONNECTABLE) { props |= BT_HCI_LE_ADV_PROP_CONN; if (!dir_adv && !(param->options & BT_LE_ADV_OPT_EXT_ADV)) { /* When using non-extended adv packets then undirected @@ -1180,7 +1183,8 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, /* Flag only used by bt_le_adv_start API. */ atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false); - atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN); + atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, + param->options & _BT_LE_ADV_OPT_CONNECTABLE); atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable); @@ -1239,7 +1243,8 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } } - if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && (param->options & BT_LE_ADV_OPT_CONN)) { + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && + (param->options & _BT_LE_ADV_OPT_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); if (err) { if (err == -ENOMEM && !dir_adv && @@ -1393,7 +1398,7 @@ static uint32_t adv_get_options(const struct bt_le_ext_adv *adv) } if (atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { - options |= BT_LE_ADV_OPT_CONN; + options |= _BT_LE_ADV_OPT_CONNECTABLE; } if (atomic_test_bit(adv->flags, BT_ADV_USE_IDENTITY)) { @@ -1573,7 +1578,7 @@ int bt_le_ext_adv_update_param(struct bt_le_ext_adv *adv, /* If params for per adv has been set, do not allow setting * connectable, scanable or use legacy adv */ - if (param->options & BT_LE_ADV_OPT_CONN || + if (param->options & _BT_LE_ADV_OPT_CONNECTABLE || param->options & BT_LE_ADV_OPT_SCANNABLE || !(param->options & BT_LE_ADV_OPT_EXT_ADV) || param->options & BT_LE_ADV_OPT_ANONYMOUS) { diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 0ed84dff7331..a43aaef78f44 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -803,11 +803,12 @@ bool bt_id_adv_random_addr_check(const struct bt_le_adv_param *param) * Explicitly stop it here. */ - if (!(param->options & BT_LE_ADV_OPT_CONN) && - (param->options & BT_LE_ADV_OPT_USE_IDENTITY)) { + if (!(param->options & _BT_LE_ADV_OPT_CONNECTABLE) && + (param->options & BT_LE_ADV_OPT_USE_IDENTITY)) { /* Attempt to set non-connectable NRPA */ return false; - } else if (bt_dev.id_addr[param->id].type == BT_ADDR_LE_RANDOM && + } else if (bt_dev.id_addr[param->id].type == + BT_ADDR_LE_RANDOM && param->id != BT_ID_DEFAULT) { /* Attempt to set connectable, or non-connectable with * identity different than scanner. @@ -1935,7 +1936,7 @@ int bt_id_set_adv_own_addr(struct bt_le_ext_adv *adv, uint32_t options, return 0; } - if (options & BT_LE_ADV_OPT_CONN) { + if (options & _BT_LE_ADV_OPT_CONNECTABLE) { if (dir_adv && (options & BT_LE_ADV_OPT_DIR_ADDR_RPA) && !BT_FEAT_LE_PRIVACY(bt_dev.le.features)) { return -ENOTSUP; From 752df831ff4468a6b8c92a746a6d43eeb730d578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1199/3334] Revert "[nrf fromtree] bluetooth: host: remove API for automatic advertising resumption" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c4cf398c69949d7c8136d9bab0e185ee7a1ad102. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/bluetooth.h | 61 +++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index a365698d063c..f9bc6c1724a3 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -691,6 +691,28 @@ enum bt_le_adv_opt { /** Convenience value when no options are specified. */ BT_LE_ADV_OPT_NONE = 0, + /** + * @brief Advertise as connectable. + * + * @deprecated Use @ref BT_LE_ADV_OPT_CONN instead. + * + * Advertise as connectable. If not connectable then the type of + * advertising is determined by providing scan response data. + * The advertiser address is determined by the type of advertising + * and/or enabling privacy @kconfig{CONFIG_BT_PRIVACY}. + * + * Starting connectable advertising preallocates a connection + * object. If this fails, the API returns @c -ENOMEM. + * + * When an advertiser set results in a connection creation, the + * controller automatically disables that advertising set. + * + * If the advertising set was started with @ref bt_le_adv_start + * without @ref BT_LE_ADV_OPT_ONE_TIME, the host will attempt to + * resume the advertiser under some conditions. + */ + BT_LE_ADV_OPT_CONNECTABLE __deprecated = BIT(0), + /** * @internal * @@ -703,6 +725,24 @@ enum bt_le_adv_opt { */ _BT_LE_ADV_OPT_CONNECTABLE = BIT(0), + /** + * @brief Advertise one time. + * + * @deprecated Use @ref BT_LE_ADV_OPT_CONN instead. + * + * Don't try to resume connectable advertising after a connection. + * This option is only meaningful when used together with + * BT_LE_ADV_OPT_CONNECTABLE. If set the advertising will be stopped + * when @ref bt_le_adv_stop is called or when an incoming (peripheral) + * connection happens. If this option is not set the stack will + * take care of keeping advertising enabled even as connections + * occur. + * If Advertising directed or the advertiser was started with + * @ref bt_le_ext_adv_start then this behavior is the default behavior + * and this flag has no effect. + */ + BT_LE_ADV_OPT_ONE_TIME __deprecated = BIT(1), + /** * @internal * @@ -1125,6 +1165,17 @@ struct bt_le_per_adv_param { #define BT_LE_ADV_CONN_DIR(_peer) BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN, 0, 0, _peer) +/** + * @deprecated This is a convenience macro for @ref + * BT_LE_ADV_OPT_CONNECTABLE, which is deprecated. Please use + * @ref BT_LE_ADV_CONN_FAST_1 or @ref BT_LE_ADV_CONN_FAST_2 + * instead. + */ +#define BT_LE_ADV_CONN \ + BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, BT_GAP_ADV_FAST_INT_MIN_2, \ + BT_GAP_ADV_FAST_INT_MAX_2, NULL) \ + __DEPRECATED_MACRO + /** * @brief GAP recommended connectable advertising parameters user-initiated * @@ -1169,6 +1220,10 @@ struct bt_le_per_adv_param { * - Limited Discoverable Mode * - General Discoverable Mode * + * The advertising interval corresponds to what was offered as @ref BT_LE_ADV_CONN in Zephyr 3.6 and + * earlier, but unlike @ref BT_LE_ADV_CONN, the host does not automatically resume the advertiser + * after it results in a connection. + * * See Bluetooth Core Specification: * - 6.0 Vol 3, Part C, Appendix A "Timers and Constants", T_GAP(adv_fast_interval2) * - 6.0 Vol 3, Part C, Section 9.3.11 "Connection Establishment Timing parameters" @@ -1177,6 +1232,8 @@ struct bt_le_per_adv_param { BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN, BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, \ NULL) +#define BT_LE_ADV_CONN_ONE_TIME BT_LE_ADV_CONN_FAST_2 __DEPRECATED_MACRO + #define BT_LE_ADV_CONN_DIR_LOW_DUTY(_peer) \ BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN | BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY, \ BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, _peer) @@ -1612,7 +1669,7 @@ typedef void bt_le_scan_cb_t(const bt_addr_le_t *addr, int8_t rssi, * The periodic advertising parameters can only be set or updated on an * extended advertisement set which is neither scannable, connectable nor * anonymous (meaning, the advertising options @ref BT_LE_ADV_OPT_SCANNABLE, - * @ref BT_LE_ADV_OPT_CONN and @ref BT_LE_ADV_OPT_ANONYMOUS cannot be set for @p adv). + * @ref BT_LE_ADV_OPT_CONNECTABLE and @ref BT_LE_ADV_OPT_ANONYMOUS cannot be set for @p adv). * * @param adv Advertising set object. * @param param Advertising parameters. @@ -1628,7 +1685,7 @@ int bt_le_per_adv_set_param(struct bt_le_ext_adv *adv, * The periodic advertisement data can only be set or updated on an * extended advertisement set which is neither scannable, connectable nor * anonymous (meaning, the advertising options @ref BT_LE_ADV_OPT_SCANNABLE, - * @ref BT_LE_ADV_OPT_CONN and @ref BT_LE_ADV_OPT_ANONYMOUS cannot be set for @p adv). + * @ref BT_LE_ADV_OPT_CONNECTABLE and @ref BT_LE_ADV_OPT_ANONYMOUS cannot be set for @p adv). * * @param adv Advertising set object. * @param ad Advertising data. From e0c44eaa6fb3aa3a9eb9089404da528236b7bbc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1200/3334] Revert "[nrf fromtree] Bluetooth: Host: Change WRN->DBG for not connect for TX" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b45bc9edc802a68097cf44561c79c9559b3a78f3. Signed-off-by: Tomasz Moń --- 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 15dd01fafeac..ad627bcdf175 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1051,7 +1051,7 @@ void bt_conn_tx_processor(void) LOG_DBG("processing conn %p", conn); if (conn->state != BT_CONN_CONNECTED) { - LOG_DBG("conn %p: not connected: state %d", conn, conn->state); + LOG_WRN("conn %p: not connected", conn); goto raise_and_exit; } From 8eea0bff5bc339ebfd84b9c12b05d91892778424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1201/3334] Revert "[nrf fromtree] doc: releases: Add note about CONFIG_BT_BUF_ACL_RX_COUNT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3684f5c7c03973edc554b386022735327899d8ab. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.3.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index 3e9b87db998e..dc5393b418dd 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -62,7 +62,6 @@ Removed APIs and options PSA Crypto API is now the recommended cryptographic library for Zephyr. * The legacy pipe object API was removed. Use the new pipe API instead. * ``bt_le_set_auto_conn`` -* ``CONFIG_BT_BUF_ACL_RX_COUNT`` Deprecated APIs and options =========================== From 6a54924d5f67a43f0dfd3b0e19012a0d1ece2806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1202/3334] Revert "[nrf fromtree] Bluetooth: Remove CONFIG_BT_BUF_ACL_RX_COUNT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 52c0ff43b6b0a7a26963841b348723c6d2e47883. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/buf.h | 23 +++++++++++++++-------- subsys/bluetooth/common/Kconfig | 21 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/include/zephyr/bluetooth/buf.h b/include/zephyr/bluetooth/buf.h index 534c75559183..a4b59dcbaa92 100644 --- a/include/zephyr/bluetooth/buf.h +++ b/include/zephyr/bluetooth/buf.h @@ -144,20 +144,27 @@ static inline enum bt_buf_type bt_buf_type_from_h4(uint8_t h4_type, enum bt_buf_ #define BT_BUF_ACL_RX_COUNT_MAX 65535 #if defined(CONFIG_BT_CONN) && defined(CONFIG_BT_HCI_HOST) -/* The host needs more ACL buffers than maximum ACL links. This is because of - * the way we re-assemble ACL packets into L2CAP PDUs. - * - * We keep around the first buffer (that comes from the driver) to do - * re-assembly into, and if all links are re-assembling, there will be no buffer - * available for the HCI driver to allocate from. - */ + /* The host needs more ACL buffers than maximum ACL links. This is because of + * the way we re-assemble ACL packets into L2CAP PDUs. + * + * We keep around the first buffer (that comes from the driver) to do + * re-assembly into, and if all links are re-assembling, there will be no buffer + * available for the HCI driver to allocate from. + * + * TODO: When CONFIG_BT_BUF_ACL_RX_COUNT is removed, + * remove the MAX and only keep the 1. + */ #define BT_BUF_ACL_RX_COUNT_EXTRA CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA -#define BT_BUF_ACL_RX_COUNT (1 + BT_BUF_ACL_RX_COUNT_EXTRA) +#define BT_BUF_ACL_RX_COUNT (MAX(CONFIG_BT_BUF_ACL_RX_COUNT, 1) + BT_BUF_ACL_RX_COUNT_EXTRA) #else #define BT_BUF_ACL_RX_COUNT_EXTRA 0 #define BT_BUF_ACL_RX_COUNT 0 #endif /* CONFIG_BT_CONN && CONFIG_BT_HCI_HOST */ +#if defined(CONFIG_BT_BUF_ACL_RX_COUNT) && CONFIG_BT_BUF_ACL_RX_COUNT > 0 +#warning "CONFIG_BT_BUF_ACL_RX_COUNT is deprecated, see Zephyr 4.1 migration guide" +#endif /* CONFIG_BT_BUF_ACL_RX_COUNT && CONFIG_BT_BUF_ACL_RX_COUNT > 0 */ + BUILD_ASSERT(BT_BUF_ACL_RX_COUNT <= BT_BUF_ACL_RX_COUNT_MAX, "Maximum number of ACL RX buffer is 65535, reduce CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA"); diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 9ba9cb325855..ae95785f8ab3 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -102,6 +102,27 @@ config BT_BUF_ACL_RX_COUNT_EXTRA connection and uses one Rx buffer across all connections to receive a fragment from the Controller. +config BT_BUF_ACL_RX_COUNT + int "[DEPRECATED] Number of incoming ACL data buffers" + default 0 + range 0 256 + help + Number or incoming ACL data buffers sent from the Controller to the + Host. + In a combined Host and Controller build the buffers are shared and + therefore Controller to Host flow control is not needed. + + In a Host only build with Controller to Host flow control enabled + the Host will inform the Controller about the maximum number of + buffers by setting this value in the Host Buffer Size command. + + When Controller to Host flow control is not enabled the Controller + can assume that the Host has infinite amount of buffers. + + For both configurations, there is an additional requirement that is + enforced by a build-time check: BT_BUF_ACL_RX_COUNT needs to be at + least one greater than BT_MAX_CONN. + config BT_BUF_EVT_RX_SIZE int "Maximum supported HCI Event buffer length" default $(UINT8_MAX) if (BT_EXT_ADV && BT_OBSERVER) || BT_PER_ADV_SYNC || BT_DF_CONNECTION_CTE_RX || BT_CLASSIC || BT_CHANNEL_SOUNDING || BT_LE_EXTENDED_FEAT_SET From 21fee83d48a42f40ab7b494f6a1354bef0680dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1203/3334] Revert "[nrf fromtree] doc: releases: Add note for bt_le_set_auto_conn" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7d82a3bf29342a9690cb3d73b8b9f81d81a6f772. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.3.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index dc5393b418dd..718e4ad3ba33 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -61,7 +61,6 @@ Removed APIs and options * The TinyCrypt library was removed as the upstream version is no longer maintained. PSA Crypto API is now the recommended cryptographic library for Zephyr. * The legacy pipe object API was removed. Use the new pipe API instead. -* ``bt_le_set_auto_conn`` Deprecated APIs and options =========================== From 0e81efcc5a4b26d05157dfa7e384b51da47eb2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1204/3334] Revert "[nrf fromtree] Bluetooth: Host: Remove bt_le_set_auto_conn" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 42c1f03e74c1ac2d2ff7f2ab0cb7de35fd74caef. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/conn.h | 17 ++++++++++ subsys/bluetooth/host/conn.c | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 67c3db64e92a..2f9b796e1ec1 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1639,6 +1639,23 @@ int bt_conn_le_create_auto(const struct bt_conn_le_create_param *create_param, */ int bt_conn_create_auto_stop(void); +/** @brief Automatically connect to remote device if it's in range. + * + * This function enables/disables automatic connection initiation. + * Every time the device loses the connection with peer, this connection + * will be re-established if connectable advertisement from peer is received. + * + * @note Auto connect is disabled during explicit scanning. + * + * @param addr Remote Bluetooth address. + * @param param If non-NULL, auto connect is enabled with the given + * parameters. If NULL, auto connect is disabled. + * + * @return Zero on success or error code otherwise. + */ +__deprecated int bt_le_set_auto_conn(const bt_addr_le_t *addr, + const struct bt_le_conn_param *param); + /** @brief Set security level for a connection. * * This function enable security (encryption) for a connection. If the device diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index ad627bcdf175..fb31f879191e 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -3994,6 +3994,65 @@ int bt_conn_le_create_synced(const struct bt_le_ext_adv *adv, *ret_conn = conn; return 0; } + +#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST) +int bt_le_set_auto_conn(const bt_addr_le_t *addr, + const struct bt_le_conn_param *param) +{ + struct bt_conn *conn; + + if (!atomic_test_bit(bt_dev.flags, BT_DEV_READY)) { + return -EAGAIN; + } + + if (param && !bt_le_conn_params_valid(param)) { + return -EINVAL; + } + + if (!bt_id_scan_random_addr_check()) { + return -EINVAL; + } + + /* Only default identity is supported */ + conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, addr); + if (!conn) { + conn = bt_conn_add_le(BT_ID_DEFAULT, addr); + if (!conn) { + return -ENOMEM; + } + } + + if (param) { + bt_conn_set_param_le(conn, param); + + if (!atomic_test_and_set_bit(conn->flags, + BT_CONN_AUTO_CONNECT)) { + bt_conn_ref(conn); + } + } else { + if (atomic_test_and_clear_bit(conn->flags, + BT_CONN_AUTO_CONNECT)) { + bt_conn_unref(conn); + if (conn->state == BT_CONN_SCAN_BEFORE_INITIATING) { + bt_conn_set_state(conn, BT_CONN_DISCONNECTED); + } + } + } + + int err = 0; + if (conn->state == BT_CONN_DISCONNECTED && + atomic_test_bit(bt_dev.flags, BT_DEV_READY)) { + if (param) { + bt_conn_set_state(conn, BT_CONN_SCAN_BEFORE_INITIATING); + err = bt_le_scan_user_add(BT_LE_SCAN_USER_CONN); + } + } + + bt_conn_unref(conn); + + return err; +} +#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */ #endif /* CONFIG_BT_CENTRAL */ int bt_conn_le_conn_update(struct bt_conn *conn, From 1e95b1d28094c0a9769b3a5df1f547c7a740aacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1205/3334] Revert "[nrf fromtree] drivers: bluetooth: hci: Introduce bt_spi_close to support bt_disable" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba47629e78fdf805576cd42a38cf07fc5e1e0031. Signed-off-by: Tomasz Moń --- drivers/bluetooth/hci/hci_spi_st.c | 33 +----------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/bluetooth/hci/hci_spi_st.c b/drivers/bluetooth/hci/hci_spi_st.c index 5b0d8fc674af..8f6bf72c0edb 100644 --- a/drivers/bluetooth/hci/hci_spi_st.c +++ b/drivers/bluetooth/hci/hci_spi_st.c @@ -515,11 +515,7 @@ static void bt_spi_rx_thread(void *p1, void *p2, void *p3) while (true) { /* Wait for interrupt pin to be active */ - ret = k_sem_take(&sem_request, K_FOREVER); - if (ret) { - LOG_DBG("Failed to take the semaphore. The RX thread exits."); - break; - } + k_sem_take(&sem_request, K_FOREVER); LOG_DBG(""); @@ -689,39 +685,12 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static int bt_spi_close(const struct device *dev) -{ - struct bt_spi_data *hci = dev->data; - int ret; - - gpio_pin_interrupt_configure_dt(&irq_gpio, GPIO_INT_DISABLE); - - /* To exit the thread safely */ - k_sem_reset(&sem_request); - ret = k_thread_join(&spi_rx_thread_data, K_MSEC(100)); - if (ret) { - LOG_DBG("bt_spi_rx_thread is unable to exit"); - return ret; - } - - /* Reset the BLE controller */ - 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); - - hci->recv = NULL; - LOG_DBG("Bluetooth disabled"); - - return 0; -} - static DEVICE_API(bt_hci, drv) = { #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 */ .open = bt_spi_open, .send = bt_spi_send, - .close = bt_spi_close, }; static int bt_spi_init(const struct device *dev) From 0b0923835f674da1d4e1b23be7e4aa5ec0213028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1206/3334] Revert "[nrf fromtree] Bluetooth: Host: Add note about recycled for BT_LE_ADV_OPT_CONN" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 993787643e98cc1360ff3cf2f84848c177eb5ac8. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/bluetooth.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index f9bc6c1724a3..1656f1f56844 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -756,8 +756,6 @@ enum bt_le_adv_opt { * * Starting connectable advertising preallocates a connection * object. If this fails, the API returns @c -ENOMEM. - * Stopping connectable advertising will free the connection object, - * and will trigger a call to @ref bt_conn_cb.recycled. * * The advertising set stops immediately after it creates a * connection. This happens automatically in the controller. From cd8f5e3a8140e4e76ec83ed9e3f9203dbbc21475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1207/3334] Revert "[nrf fromtree] Bluetooth: Host: Add userdefined fixed l2cap chans" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a28e3f030ac23984dc114aeb79baafb3039d181e. Signed-off-by: Tomasz Moń --- doc/connectivity/bluetooth/api/l2cap.rst | 38 +------- include/zephyr/bluetooth/l2cap.h | 111 +++-------------------- subsys/bluetooth/host/att.c | 5 +- subsys/bluetooth/host/l2cap.c | 45 ++------- subsys/bluetooth/host/l2cap_internal.h | 19 ++++ subsys/bluetooth/host/smp.c | 5 +- subsys/bluetooth/host/smp_null.c | 5 +- 7 files changed, 47 insertions(+), 181 deletions(-) diff --git a/doc/connectivity/bluetooth/api/l2cap.rst b/doc/connectivity/bluetooth/api/l2cap.rst index 157f9684be13..581edda83485 100644 --- a/doc/connectivity/bluetooth/api/l2cap.rst +++ b/doc/connectivity/bluetooth/api/l2cap.rst @@ -3,45 +3,11 @@ Logical Link Control and Adaptation Protocol (L2CAP) #################################################### -L2CAP layer enables connection-oriented channels which can be enabled with the -configuration option: :kconfig:option:`CONFIG_BT_L2CAP_DYNAMIC_CHANNEL`. These channels +L2CAP layer enables connection-oriented channels which can be enable with the +configuration option: :kconfig:option:`CONFIG_BT_L2CAP_DYNAMIC_CHANNEL`. This channels support segmentation and reassembly transparently, they also support credit based flow control making it suitable for data streams. -The user can also define fixed channels using the :c:macro:`BT_L2CAP_FIXED_CHANNEL_DEFINE` -macro. Fixed channels are initialized upon connection, and do not support segmentation. An example -of how to define a fixed channel is shown below. - -.. code-block:: c - - static struct bt_l2cap_chan fixed_chan[CONFIG_BT_MAX_CONN]; - - /* Callbacks are assumed to be defined prior. */ - static struct bt_l2cap_chan_ops ops = { - .recv = recv_cb, - .sent = sent_cb, - .connected = connected_cb, - .disconnected = disconnected_cb, - }; - - static int l2cap_fixed_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) - { - uint8_t conn_index = bt_conn_index(conn); - - *chan = &fixed_chan[conn_index]; - - **chan = (struct bt_l2cap_chan){ - .ops = &ops, - }; - - return 0; - } - - BT_L2CAP_FIXED_CHANNEL_DEFINE(fixed_channel) = { - .cid = 0x0010, - .accept = l2cap_fixed_accept, - }; - Channels instances are represented by the :c:struct:`bt_l2cap_chan` struct which contains the callbacks in the :c:struct:`bt_l2cap_chan_ops` struct to inform when the channel has been connected, disconnected or when the encryption has diff --git a/include/zephyr/bluetooth/l2cap.h b/include/zephyr/bluetooth/l2cap.h index 0ffa85bc41c6..571b57e76ac9 100644 --- a/include/zephyr/bluetooth/l2cap.h +++ b/include/zephyr/bluetooth/l2cap.h @@ -139,27 +139,6 @@ extern "C" { */ #define BT_L2CAP_ECRED_CHAN_MAX_PER_REQ 5 -/** - * @defgroup l2cap_cid L2CAP channel identifiers - * @ingroup bt_l2cap - * @{ - * - * @brief Standard L2CAP channel identifiers - */ - -/** @brief BR signaling channel */ -#define BT_L2CAP_CID_BR_SIG 0x0001 -/** @brief Attribute Protocol channel */ -#define BT_L2CAP_CID_ATT 0x0004 -/** @brief LE signaling channel */ -#define BT_L2CAP_CID_LE_SIG 0x0005 -/** @brief Security Manager Protocol channel */ -#define BT_L2CAP_CID_SMP 0x0006 -/** @brief BR Security Manager Protocol channel */ -#define BT_L2CAP_CID_BR_SMP 0x0007 - -/** @} */ - struct bt_l2cap_chan; /** @typedef bt_l2cap_chan_destroy_t @@ -311,68 +290,6 @@ struct bt_l2cap_le_chan { */ #define BT_L2CAP_LE_CHAN(_ch) CONTAINER_OF(_ch, struct bt_l2cap_le_chan, chan) -/** @brief Fixed L2CAP Channel structure. Should be defined using the - * @ref BT_L2CAP_FIXED_CHANNEL_DEFINE macro. - */ -struct bt_l2cap_fixed_chan { - /** @brief Channel Identifier (CID) - * - * @note Shall be in the range 0x0001 to 0x003F (Core 3.A.2.1 v6.0). The CIDs in this range - * are reserved by the stack, so the application needs to make sure that the CID is - * not already in use. Table 2.1 in Core 3.A.2.1 and @ref l2cap_cid shows the - * CIDs used by the stack. - */ - uint16_t cid; - - /** @brief Channel accept callback - * - * This callback needs to be provided by the application, and is invoked when a new - * connection has been established. If accepting the connection, the user is expected to - * allocate memory with suitable alignment for the type @ref bt_l2cap_chan for the channel, - * and update the channel reference @p chan to point to the allocated memory. The channel - * should be initialized by assigning the callbacks to the @ref bt_l2cap_chan_ops field - * as follows: - * @code - * static int accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) - * { - * // Allocation of fixed_chan and definition of the ops are assumed done prior. - * *chan = &fixed_chan; - * - * **chan = (struct bt_l2cap_chan){ - * .ops = &ops, - * }; - * - * return 0; - * } - * @endcode - * The allocated context needs to be valid for the lifetime of the channel, i. e. - * freeing of the memory can be done in the @ref bt_l2cap_chan_ops.released callback. - * - * @param conn The connection that has been established. - * @param chan L2CAP channel reference. - * - * @return 0 to accept the channel connection, negative error code otherwise. - */ - int (*accept)(struct bt_conn *conn, struct bt_l2cap_chan **chan); -}; - -/** - * @brief Register a fixed L2CAP channel. - * - * Define and register a fixed L2CAP channel of type @ref bt_l2cap_fixed_chan. - * - * @note Fixed L2CAP channels are according to the Core Specification (3.A.2.1 v6.0) reserved - * for the stack, but this allows the application to define their own, for instance if there - * are memory constraints and dynamic channels are not suitable. The application needs to - * make sure that the CID for the fixed channel is not already in use. - * - * @param _name Name of the fixed L2CAP channel. The channels are sorted lexicographically, and - * will be initialized in the same order. - */ -#define BT_L2CAP_FIXED_CHANNEL_DEFINE(_name) \ - static const STRUCT_SECTION_ITERABLE(bt_l2cap_fixed_chan, \ - _CONCAT(bt_l2cap_fixed_chan, _name)) - /** L2CAP Endpoint Link Mode. Basic mode. */ #define BT_L2CAP_BR_LINK_MODE_BASIC 0x00 /** L2CAP Endpoint Link Mode. Retransmission mode. */ @@ -993,21 +910,23 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan); /** @brief Send data to L2CAP channel * - * Send data from buffer to the channel. For dynamic channels; if credits are - * not available, buf will be queued and sent as and when credits are received - * from peer. + * Send data from buffer to the channel. If credits are not available, buf will + * be queued and sent as and when credits are received from peer. + * Regarding to first input parameter, to get details see reference description + * to bt_l2cap_chan_connect() API above. * * Network buffer fragments (ie `buf->frags`) are not supported. * - * When sending L2CAP data over an BR/EDR connection or a fixed L2CAP channel, - * the application is sending L2CAP PDUs. The application is required to have - * reserved @ref BT_L2CAP_CHAN_SEND_RESERVE bytes in the buffer before sending. - * The application should use the BT_L2CAP_BUF_SIZE() helper to correctly size - * the buffers for the for the outgoing buffer pool. + * When sending L2CAP data over an BR/EDR connection the application is sending + * L2CAP PDUs. The application is required to have reserved + * @ref BT_L2CAP_CHAN_SEND_RESERVE bytes in the buffer before sending. + * The application should use the BT_L2CAP_BUF_SIZE() helper to correctly + * size the buffers for the for the outgoing buffer pool. * - * When sending L2CAP data over a dynamic L2CAP channel, the application is - * sending L2CAP SDUs. The application shall reserve + * When sending L2CAP data over an LE connection the application is sending + * L2CAP SDUs. The application shall reserve * @ref BT_L2CAP_SDU_CHAN_SEND_RESERVE bytes in the buffer before sending. + * * The application can use the BT_L2CAP_SDU_BUF_SIZE() helper to correctly size * the buffer to account for the reserved headroom. * @@ -1023,13 +942,9 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan); * @note Buffer ownership is transferred to the stack in case of success, in * case of an error the caller retains the ownership of the buffer. * - * @param chan The channel to send the data to. See @ref bt_l2cap_chan_connect - * for more details. - * @param buf Buffer containing the data. - * * @return 0 in case of success or negative value in case of error. * @return -EINVAL if `buf` or `chan` is NULL. - * @return -EINVAL if `chan` is not either BR/EDR or LE based. + * @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. diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 66833d1cfcc5..e9e0add6fbfa 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -3489,10 +3489,7 @@ static int bt_att_accept(struct bt_conn *conn, struct bt_l2cap_chan **ch) * placed as the last one to ensure that SMP channel is properly initialized before bt_att_connected * tries to send security request. */ -BT_L2CAP_FIXED_CHANNEL_DEFINE(z_att_fixed_chan) = { - .cid = BT_L2CAP_CID_ATT, - .accept = bt_att_accept, -}; +BT_L2CAP_CHANNEL_DEFINE(z_att_fixed_chan, BT_L2CAP_CID_ATT, bt_att_accept, NULL); #if defined(CONFIG_BT_EATT) static k_timeout_t credit_based_connection_delay(struct bt_conn *conn) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 6dcdfe04e541..c4e37f74b5ae 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -50,11 +50,6 @@ LOG_MODULE_REGISTER(bt_l2cap, CONFIG_BT_L2CAP_LOG_LEVEL); #define L2CAP_LE_MAX_CREDITS (BT_BUF_ACL_RX_COUNT - 1) -#define L2CAP_LE_CID_FIXED_START 0x0001 -#define L2CAP_LE_CID_FIXED_END 0x003f -#define L2CAP_LE_CID_IS_FIXED(_cid) \ - (_cid >= L2CAP_LE_CID_FIXED_START && _cid <= L2CAP_LE_CID_FIXED_END) - #define L2CAP_LE_CID_DYN_START 0x0040 #define L2CAP_LE_CID_DYN_END 0x007f #define L2CAP_LE_CID_IS_DYN(_cid) \ @@ -430,12 +425,6 @@ void bt_l2cap_connected(struct bt_conn *conn) STRUCT_SECTION_FOREACH(bt_l2cap_fixed_chan, fchan) { struct bt_l2cap_le_chan *le_chan; - __ASSERT(L2CAP_LE_CID_IS_FIXED(fchan->cid), - "CID %u is not in the fixed channel range", fchan->cid); - - chan = bt_l2cap_le_lookup_tx_cid(conn, fchan->cid); - __ASSERT(chan == NULL, "Fixed channel with CID %u already exists", fchan->cid); - if (fchan->accept(conn, &chan) < 0) { continue; } @@ -448,7 +437,7 @@ void bt_l2cap_connected(struct bt_conn *conn) le_chan->rx.cid = fchan->cid; le_chan->tx.cid = fchan->cid; - if (!l2cap_chan_add(conn, chan, NULL)) { + if (!l2cap_chan_add(conn, chan, fchan->destroy)) { return; } @@ -2962,10 +2951,7 @@ static int l2cap_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) return -ENOMEM; } -BT_L2CAP_FIXED_CHANNEL_DEFINE(le_fixed_chan) = { - .cid = BT_L2CAP_CID_LE_SIG, - .accept = l2cap_accept, -}; +BT_L2CAP_CHANNEL_DEFINE(le_fixed_chan, BT_L2CAP_CID_LE_SIG, l2cap_accept, NULL); void bt_l2cap_init(void) { @@ -3423,16 +3409,6 @@ static int bt_l2cap_dyn_chan_send(struct bt_l2cap_le_chan *le_chan, struct net_b return 0; } -#endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ - -static void l2cap_fixed_chan_sent_cb(struct bt_conn *conn, void *user_data, int err) -{ - struct bt_l2cap_chan *chan = user_data; - - if (chan->ops->sent) { - chan->ops->sent(chan); - } -} int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf) { @@ -3460,21 +3436,20 @@ int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf) return bt_l2cap_br_chan_send_cb(chan, buf, NULL, NULL); } - struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); + /* Sending over static channels is not supported by this fn. Use + * `bt_l2cap_send_pdu()` instead. + */ + if (IS_ENABLED(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL)) { + struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); - __ASSERT_NO_MSG(le_chan); + __ASSERT_NO_MSG(le_chan); + __ASSERT_NO_MSG(L2CAP_LE_CID_IS_DYN(le_chan->tx.cid)); -#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) - if (L2CAP_LE_CID_IS_DYN(le_chan->tx.cid)) { return bt_l2cap_dyn_chan_send(le_chan, buf); } -#endif - - if (L2CAP_LE_CID_IS_FIXED(le_chan->tx.cid)) { - return bt_l2cap_send_pdu(le_chan, buf, l2cap_fixed_chan_sent_cb, (void *)chan); - } LOG_DBG("Invalid channel type (chan %p)", chan); return -EINVAL; } +#endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index 82d6d65434f9..3f84b2b43d74 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -26,6 +26,12 @@ enum l2cap_conn_list_action { BT_L2CAP_CHAN_DETACH, }; +#define BT_L2CAP_CID_BR_SIG 0x0001 +#define BT_L2CAP_CID_ATT 0x0004 +#define BT_L2CAP_CID_LE_SIG 0x0005 +#define BT_L2CAP_CID_SMP 0x0006 +#define BT_L2CAP_CID_BR_SMP 0x0007 + #define BT_L2CAP_PSM_RFCOMM 0x0003 struct bt_l2cap_hdr { @@ -158,6 +164,19 @@ struct bt_l2cap_ecred_reconf_rsp { uint16_t result; } __packed; +struct bt_l2cap_fixed_chan { + uint16_t cid; + int (*accept)(struct bt_conn *conn, struct bt_l2cap_chan **chan); + bt_l2cap_chan_destroy_t destroy; +}; + +#define BT_L2CAP_CHANNEL_DEFINE(_name, _cid, _accept, _destroy) \ + const STRUCT_SECTION_ITERABLE(bt_l2cap_fixed_chan, _name) = { \ + .cid = _cid, \ + .accept = _accept, \ + .destroy = _destroy, \ + } + /* Notify L2CAP channels of a new connection */ void bt_l2cap_connected(struct bt_conn *conn); diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 702e6fc0d215..e5fa3f3614d0 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -6354,10 +6354,7 @@ static int bt_smp_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) return -ENOMEM; } -BT_L2CAP_FIXED_CHANNEL_DEFINE(smp_fixed_chan) = { - .cid = BT_L2CAP_CID_SMP, - .accept = bt_smp_accept, -}; +BT_L2CAP_CHANNEL_DEFINE(smp_fixed_chan, BT_L2CAP_CID_SMP, bt_smp_accept, NULL); #if defined(CONFIG_BT_CLASSIC) BT_L2CAP_BR_CHANNEL_DEFINE(smp_br_fixed_chan, BT_L2CAP_CID_BR_SMP, bt_smp_br_accept); diff --git a/subsys/bluetooth/host/smp_null.c b/subsys/bluetooth/host/smp_null.c index 92a6596860e0..0ff20b4a16d6 100644 --- a/subsys/bluetooth/host/smp_null.c +++ b/subsys/bluetooth/host/smp_null.c @@ -102,10 +102,7 @@ static int bt_smp_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) return -ENOMEM; } -BT_L2CAP_FIXED_CHANNEL_DEFINE(smp_fixed_chan) = { - .cid = BT_L2CAP_CID_SMP, - .accept = bt_smp_accept, -}; +BT_L2CAP_CHANNEL_DEFINE(smp_fixed_chan, BT_L2CAP_CID_SMP, bt_smp_accept, NULL); int bt_smp_init(void) { From 45d9c4b426e45dafa1ef354af9b04a412cd0738d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1208/3334] Revert "[nrf fromtree] bluetooth: mesh: access: doxygen improvements" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2bfc30feb57919803052074ddbfe1dacfb59177e. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/mesh/access.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/include/zephyr/bluetooth/mesh/access.h b/include/zephyr/bluetooth/mesh/access.h index c2dc4df4fdac..06ae4f6e9f6f 100644 --- a/include/zephyr/bluetooth/mesh/access.h +++ b/include/zephyr/bluetooth/mesh/access.h @@ -15,10 +15,6 @@ #include #include -/** - * @cond INTERNAL_HIDDEN - */ - /* Internal macros used to initialize array members */ #define BT_MESH_KEY_UNUSED_ELT_(IDX, _) BT_MESH_KEY_UNUSED #define BT_MESH_ADDR_UNASSIGNED_ELT_(IDX, _) BT_MESH_ADDR_UNASSIGNED @@ -35,8 +31,6 @@ #define BT_MESH_MODEL_UUIDS_UNASSIGNED() #endif -/** @endcond */ - #define BT_MESH_MODEL_RUNTIME_INIT(_user_data) \ .rt = &(struct bt_mesh_model_rt_ctx){ .user_data = (_user_data) }, @@ -205,11 +199,8 @@ struct bt_mesh_model_op { struct net_buf_simple *buf); }; -/** Macro for encoding a 1-byte opcode (used by Bluetooth SIG defined models). */ #define BT_MESH_MODEL_OP_1(b0) (b0) -/** Macro for encoding a 2-byte opcode (used by Bluetooth SIG defined models). */ #define BT_MESH_MODEL_OP_2(b0, b1) (((b0) << 8) | (b1)) -/** Macro for encoding a 3-byte opcode (vendor-specific message). */ #define BT_MESH_MODEL_OP_3(b0, cid) ((((b0) << 16) | 0xc00000) | (cid)) /** Macro for encoding exact message length for fixed-length messages. */ @@ -602,13 +593,13 @@ struct bt_mesh_model_pub { * BT_MESH_MODELS_METADATA_ENTRY macro. */ struct bt_mesh_models_metadata_entry { - /** Length of the metadata */ + /* Length of the metadata */ const uint16_t len; - /** ID of the metadata */ + /* ID of the metadata */ const uint16_t id; - /** Pointer to raw data */ + /* Pointer to raw data */ const void * const data; }; From c50b75cba548e3cb88e0141a27f3bb16d214e576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1209/3334] Revert "[nrf fromtree] bluetooth: host: conn: handle `bt_le_create_conn_cancel` error" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d1f08acf6c97c254c754475d1d3f2208a042cb82. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/conn.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index fb31f879191e..c52ecc42fc1c 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2251,10 +2251,7 @@ static void deferred_work(struct k_work *work) * auto connect flag if it was set, instead just cancel * connection directly */ - if (bt_le_create_conn_cancel() == -ENOBUFS) { - LOG_WRN("No buffers to cancel connection, retrying in 10 ms"); - k_work_reschedule(dwork, K_MSEC(10)); - } + bt_le_create_conn_cancel(); return; } From f6d7e37f9de1d60c3ee58faeffa9b842ebb71721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1210/3334] Revert "[nrf fromtree] Bluetooth: Host: Fix some MISRA c:M23_112 warnings" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5908b65085abb05bffe11ed62c4ab743193355e5. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/conn.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index c52ecc42fc1c..c1a2940d0186 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2291,10 +2291,6 @@ static void deferred_work(struct k_work *work) err); } #endif - } else { - /* Neither the application nor the configuration - * set LE connection parameters. - */ } atomic_set_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_UPDATE); @@ -2397,8 +2393,6 @@ struct bt_conn *bt_conn_add_sco(const bt_addr_t *peer, int link_type) } else if (link_type == BT_HCI_ESCO) { sco_conn->sco.pkt_type = (bt_dev.br.esco_pkt_type & ~EDR_ESCO_PKT_MASK); - } else { - /* Ignoring unexpected link type BT_HCI_ACL. */ } return sco_conn; From 112d3049ffee9c60f1b8cad57dceaab1791da0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1211/3334] Revert "[nrf fromtree] Bluetooth: Host: Amend disconnected() callback documentation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 68f3e886d0771822f4c934fff385f10754daf791. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/conn.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 2f9b796e1ec1..51b8065fcdc2 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1877,8 +1877,9 @@ struct bt_conn_cb { * start either a connectable advertiser or create a new connection * this might fail because there are no free connection objects * available. - * To avoid this issue, it's recommended to rely instead on @ref bt_conn_cb.recycled - * which notifies the application when a connection object has actually been freed. + * To avoid this issue it is recommended to either start connectable + * advertise or create a new connection using @ref k_work_submit or + * increase @kconfig{CONFIG_BT_MAX_CONN}. * * @param conn Connection object. * @param reason BT_HCI_ERR_* reason for the disconnection. From a436e8c8a08d91be763bffc7d72c4ceaa46c0555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1212/3334] Revert "[nrf fromtree] Bluetooth: Host: Amend recycled() callback documentation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 597c94f79c92344f0a9254d94b66de41d5ab5534. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/conn.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 51b8065fcdc2..6a4b7c238c89 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1891,13 +1891,12 @@ struct bt_conn_cb { * This callback notifies the application that it might be able to * allocate a connection object. No guarantee, first come, first serve. * - * The maximum number of simultaneous connections is configured - * by @kconfig{CONFIG_BT_MAX_CONN}. + * Use this to e.g. re-start connectable advertising or scanning. * - * This is the event to listen for to start a new connection or connectable advertiser, - * both when the intention is to start it after the system is completely - * finished with an earlier connection, and when the application wants to start - * a connection for any reason but failed and is waiting for the right time to retry. + * Treat this callback as an ISR, as it originates from + * @ref bt_conn_unref which is used by the BT stack. Making + * Bluetooth API calls in this context is error-prone and strongly + * discouraged. */ void (*recycled)(void); From b7ba7dd4bb63d1bd6201ce99f728b1d4c7811c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:47 +0100 Subject: [PATCH 1213/3334] Revert "[nrf fromtree] Bluetooth: Host: Fix possible inconsistent access to connection state" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f44b6bea3caa9b90458eba9412d3fbb448cbe53a. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/conn.c | 49 +++++++++++------------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index c1a2940d0186..9f3ea02f3f16 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1500,57 +1500,38 @@ void bt_conn_unref(struct bt_conn *conn) enum bt_conn_type conn_type; uint8_t conn_role; uint16_t conn_handle; - /* Used only if CONFIG_ASSERT and CONFIG_BT_CONN_TX. */ - __maybe_unused bool conn_tx_is_pending; __ASSERT(conn, "Invalid connection reference"); - /* If we're removing the last reference, the connection object will be - * considered freed and possibly re-allocated by the Bluetooth Host stack - * as soon as we decrement the counter. - * To prevent inconsistencies when accessing the connection's state, - * we store its properties of interest before decrementing the ref-count, - * then unset the local pointer. + /* Storing parameters of interest so we don't access the object + * after decrementing its ref-count */ conn_type = conn->type; conn_role = conn->role; conn_handle = conn->handle; -#if CONFIG_BT_CONN_TX && CONFIG_ASSERT - conn_tx_is_pending = k_work_is_pending(&conn->tx_complete_work); -#endif + old = atomic_dec(&conn->ref); + /* Whether we removed the last reference. */ + deallocated = (old == 1); + IF_ENABLED(CONFIG_BT_CONN_TX, + (__ASSERT(!(deallocated && k_work_is_pending(&conn->tx_complete_work)), + "tx_complete_work is pending when conn is deallocated"))); conn = NULL; LOG_DBG("handle %u ref %ld -> %ld", conn_handle, old, (old - 1)); __ASSERT(old > 0, "Conn reference counter is 0"); - /* Whether we removed the last reference. */ - deallocated = (old == 1); - if (!deallocated) { - return; - } - - IF_ENABLED(CONFIG_BT_CONN_TX, - (__ASSERT(!conn_tx_is_pending, - "tx_complete_work is pending when conn is deallocated");)) - - /* Notify listeners that a slot has been freed and can be taken. - * No guarantees are made on requests to claim connection object - * as only the first claim will be served. + /* Slot has been freed and can be taken. No guarantees are made on requests + * to claim connection object as only the first claim will be served. */ - k_sem_give(&pending_recycled_events); - k_work_submit(&recycled_work); + if (deallocated) { + k_sem_give(&pending_recycled_events); + k_work_submit(&recycled_work); + } - /* Use the freed slot to automatically resume LE peripheral advertising. - * - * This behavior is deprecated: - * - 8cfad44: Bluetooth: Deprecate adv auto-resume - * - #72567: Bluetooth: Advertising resume functionality is broken - * - Migration guide to Zephyr v4.0.0, Automatic advertiser resumption is deprecated - */ if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && conn_type == BT_CONN_TYPE_LE && - conn_role == BT_CONN_ROLE_PERIPHERAL) { + conn_role == BT_CONN_ROLE_PERIPHERAL && deallocated) { bt_le_adv_resume(); } } From 41b7137bb344066a2ee1584f4b98f89477ac3d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1214/3334] Revert "[nrf fromtree] Bluetooth: Host: Fix use of local variable as atomic target" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8ef8eefad8b3bc5f3b7e1602db4ed605f55fcc1e. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/conn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 9f3ea02f3f16..f3abf67d4fb6 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1511,8 +1511,8 @@ void bt_conn_unref(struct bt_conn *conn) conn_handle = conn->handle; old = atomic_dec(&conn->ref); - /* Whether we removed the last reference. */ - deallocated = (old == 1); + /* Prevent from accessing connection object */ + deallocated = (atomic_get(&old) == 1); IF_ENABLED(CONFIG_BT_CONN_TX, (__ASSERT(!(deallocated && k_work_is_pending(&conn->tx_complete_work)), "tx_complete_work is pending when conn is deallocated"))); From 92b4981b86d9e6f8a1b0725c6d9b62013356c8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1215/3334] Revert "[nrf fromtree] Bluetooth: SMP: Print extra state information on timeout" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ca32df94650136011da39c4fdf998691602f9184. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/smp.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index e5fa3f3614d0..4590f5d411a1 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -2020,15 +2020,7 @@ static void smp_timeout(struct k_work *work) struct k_work_delayable *dwork = k_work_delayable_from_work(work); struct bt_smp *smp = CONTAINER_OF(dwork, struct bt_smp, work); - /* if number of flags or supported commands exceed capacity of one - * atomic variable following error log shall be extended - */ - BUILD_ASSERT(ATOMIC_BITMAP_SIZE(SMP_NUM_FLAGS) == 1); - BUILD_ASSERT(ATOMIC_BITMAP_SIZE(BT_SMP_NUM_CMDS) == 1); - - LOG_ERR("SMP Timeout (flags:0x%08x allowed_cmds:0x%08x)", - (unsigned int)atomic_get(&smp->flags[0]), - (unsigned int)atomic_get(&smp->allowed_cmds[0])); + LOG_ERR("SMP Timeout"); smp_pairing_complete(smp, BT_SMP_ERR_UNSPECIFIED); From d5a68886c72ffef5f8ca922935a3dd3486a32bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1216/3334] Revert "[nrf fromtree] bluetooth: host: move bt_gatt_authorization_cb_register to gatt.c" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2f7b709ba93104c8f2aef14e3db13f4ef2e47268. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/att.c | 63 ++++++++++++++++++++++++--- subsys/bluetooth/host/gatt.c | 51 ---------------------- subsys/bluetooth/host/gatt_internal.h | 3 -- 3 files changed, 58 insertions(+), 59 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index e9e0add6fbfa..82d82526b5b0 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -143,6 +143,11 @@ static uint16_t bt_att_mtu(struct bt_att_chan *chan) return MIN(chan->chan.rx.mtu, chan->chan.tx.mtu); } +/* Descriptor of application-specific authorization callbacks that are used + * with the CONFIG_BT_GATT_AUTHORIZATION_CUSTOM Kconfig enabled. + */ +static const struct bt_gatt_authorization_cb *authorization_cb; + /* ATT connection specific data */ struct bt_att { struct bt_conn *conn; @@ -1345,6 +1350,20 @@ struct read_type_data { typedef bool (*attr_read_cb)(struct net_buf *buf, ssize_t read, void *user_data); +static bool attr_read_authorize(struct bt_conn *conn, + const struct bt_gatt_attr *attr) +{ + if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { + return true; + } + + if (!authorization_cb || !authorization_cb->read_authorize) { + return true; + } + + return authorization_cb->read_authorize(conn, attr); +} + static bool attr_read_type_cb(struct net_buf *frag, ssize_t read, void *user_data) { @@ -1455,7 +1474,7 @@ static uint8_t read_type_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!bt_gatt_attr_read_authorize(conn, attr)) { + if (!attr_read_authorize(conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -1611,7 +1630,7 @@ static uint8_t read_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!bt_gatt_attr_read_authorize(conn, attr)) { + if (!attr_read_authorize(conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -1782,7 +1801,7 @@ static uint8_t read_vl_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!bt_gatt_attr_read_authorize(conn, attr)) { + if (!attr_read_authorize(conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -2031,6 +2050,20 @@ struct write_data { uint8_t err; }; +static bool attr_write_authorize(struct bt_conn *conn, + const struct bt_gatt_attr *attr) +{ + if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { + return true; + } + + if (!authorization_cb || !authorization_cb->write_authorize) { + return true; + } + + return authorization_cb->write_authorize(conn, attr); +} + static uint8_t write_cb(const struct bt_gatt_attr *attr, uint16_t handle, void *user_data) { @@ -2048,7 +2081,7 @@ static uint8_t write_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!bt_gatt_attr_write_authorize(data->conn, attr)) { + if (!attr_write_authorize(data->conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -2167,7 +2200,7 @@ static uint8_t prep_write_cb(const struct bt_gatt_attr *attr, uint16_t handle, } /* Check the attribute authorization logic */ - if (!bt_gatt_attr_write_authorize(data->conn, attr)) { + if (!attr_write_authorize(data->conn, attr)) { data->err = BT_ATT_ERR_AUTHORIZATION; return BT_GATT_ITER_STOP; } @@ -4136,3 +4169,23 @@ bool bt_att_chan_opt_valid(struct bt_conn *conn, enum bt_att_chan_opt chan_opt) return true; } + +int bt_gatt_authorization_cb_register(const struct bt_gatt_authorization_cb *cb) +{ + if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { + return -ENOSYS; + } + + if (!cb) { + authorization_cb = NULL; + return 0; + } + + if (authorization_cb) { + return -EALREADY; + } + + authorization_cb = cb; + + return 0; +} diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index ea1dc73e158a..0770d6a407bb 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -6590,54 +6590,3 @@ void bt_gatt_req_set_mtu(struct bt_att_req *req, uint16_t mtu) * request types if needed. */ } - -/* Descriptor of application-specific authorization callbacks that are used - * with the CONFIG_BT_GATT_AUTHORIZATION_CUSTOM Kconfig enabled. - */ -static const struct bt_gatt_authorization_cb *authorization_cb; - -bool bt_gatt_attr_read_authorize(struct bt_conn *conn, const struct bt_gatt_attr *attr) -{ - if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { - return true; - } - - if (!authorization_cb || !authorization_cb->read_authorize) { - return true; - } - - return authorization_cb->read_authorize(conn, attr); -} - -bool bt_gatt_attr_write_authorize(struct bt_conn *conn, const struct bt_gatt_attr *attr) -{ - if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { - return true; - } - - if (!authorization_cb || !authorization_cb->write_authorize) { - return true; - } - - return authorization_cb->write_authorize(conn, attr); -} - -int bt_gatt_authorization_cb_register(const struct bt_gatt_authorization_cb *cb) -{ - if (!IS_ENABLED(CONFIG_BT_GATT_AUTHORIZATION_CUSTOM)) { - return -ENOSYS; - } - - if (!cb) { - authorization_cb = NULL; - return 0; - } - - if (authorization_cb) { - return -EALREADY; - } - - authorization_cb = cb; - - return 0; -} diff --git a/subsys/bluetooth/host/gatt_internal.h b/subsys/bluetooth/host/gatt_internal.h index dbe3736cb0fc..1dab30471af1 100644 --- a/subsys/bluetooth/host/gatt_internal.h +++ b/subsys/bluetooth/host/gatt_internal.h @@ -68,6 +68,3 @@ struct bt_gatt_attr; /* Check attribute permission */ uint8_t bt_gatt_check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr, uint16_t mask); - -bool bt_gatt_attr_read_authorize(struct bt_conn *conn, const struct bt_gatt_attr *attr); -bool bt_gatt_attr_write_authorize(struct bt_conn *conn, const struct bt_gatt_attr *attr); From ec07d8d61efc290218d2115ba4f188d2705bad66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1217/3334] Revert "[nrf fromtree] bluetooth: mesh: move mesh assigned numbers to dedicated header" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e0d10c24a47fdb8bad78be4b10fa1d6266cb826. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/assigned_numbers.h | 197 -------------------- include/zephyr/bluetooth/mesh/access.h | 189 ++++++++++++++++++- 2 files changed, 188 insertions(+), 198 deletions(-) diff --git a/include/zephyr/bluetooth/assigned_numbers.h b/include/zephyr/bluetooth/assigned_numbers.h index 44c69d16a227..8cd5fc422c2d 100644 --- a/include/zephyr/bluetooth/assigned_numbers.h +++ b/include/zephyr/bluetooth/assigned_numbers.h @@ -717,203 +717,6 @@ extern "C" { /** @} */ /* end of @name Flags data type values */ /** @} */ /* end of bt_assigned_numbers_core */ -/** - * @brief Bluetooth Mesh Assigned Numbers - * @defgroup bt_assigned_numbers_mesh Bluetooth Mesh Assigned Numbers - * @ingroup bt_assigned_numbers - * @{ - */ - -/** - * @name Foundation Models - * @{ - */ -/** Configuration Server */ -#define BT_MESH_MODEL_ID_CFG_SRV 0x0000 -/** Configuration Client */ -#define BT_MESH_MODEL_ID_CFG_CLI 0x0001 -/** Health Server */ -#define BT_MESH_MODEL_ID_HEALTH_SRV 0x0002 -/** Health Client */ -#define BT_MESH_MODEL_ID_HEALTH_CLI 0x0003 -/** Remote Provisioning Server */ -#define BT_MESH_MODEL_ID_REMOTE_PROV_SRV 0x0004 -/** Remote Provisioning Client */ -#define BT_MESH_MODEL_ID_REMOTE_PROV_CLI 0x0005 -/** Bridge Configuration Sever */ -#define BT_MESH_MODEL_ID_BRG_CFG_SRV 0x0008 -/** Bridge Configuration Client */ -#define BT_MESH_MODEL_ID_BRG_CFG_CLI 0x0009 -/** Private Beacon Server */ -#define BT_MESH_MODEL_ID_PRIV_BEACON_SRV 0x000a -/** Private Beacon Client */ -#define BT_MESH_MODEL_ID_PRIV_BEACON_CLI 0x000b -/** SAR Configuration Server */ -#define BT_MESH_MODEL_ID_SAR_CFG_SRV 0x000e -/** SAR Configuration Client */ -#define BT_MESH_MODEL_ID_SAR_CFG_CLI 0x000f -/** Opcodes Aggregator Server */ -#define BT_MESH_MODEL_ID_OP_AGG_SRV 0x0010 -/** Opcodes Aggregator Client */ -#define BT_MESH_MODEL_ID_OP_AGG_CLI 0x0011 -/** Large Composition Data Server */ -#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_SRV 0x0012 -/** Large Composition Data Client */ -#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_CLI 0x0013 -/** Solicitation PDU RPL Configuration Client */ -#define BT_MESH_MODEL_ID_SOL_PDU_RPL_SRV 0x0014 -/** Solicitation PDU RPL Configuration Server */ -#define BT_MESH_MODEL_ID_SOL_PDU_RPL_CLI 0x0015 -/** Private Proxy Server */ -#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_SRV 0x000c -/** Private Proxy Client */ -#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_CLI 0x000d -/** - * @} - */ - -/** - * @name Models from the Mesh Model Specification - * @{ - */ -/** Generic OnOff Server */ -#define BT_MESH_MODEL_ID_GEN_ONOFF_SRV 0x1000 -/** Generic OnOff Client */ -#define BT_MESH_MODEL_ID_GEN_ONOFF_CLI 0x1001 -/** Generic Level Server */ -#define BT_MESH_MODEL_ID_GEN_LEVEL_SRV 0x1002 -/** Generic Level Client */ -#define BT_MESH_MODEL_ID_GEN_LEVEL_CLI 0x1003 -/** Generic Default Transition Time Server */ -#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV 0x1004 -/** Generic Default Transition Time Client */ -#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_CLI 0x1005 -/** Generic Power OnOff Server */ -#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV 0x1006 -/** Generic Power OnOff Setup Server */ -#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV 0x1007 -/** Generic Power OnOff Client */ -#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI 0x1008 -/** Generic Power Level Server */ -#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV 0x1009 -/** Generic Power Level Setup Server */ -#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV 0x100a -/** Generic Power Level Client */ -#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI 0x100b -/** Generic Battery Server */ -#define BT_MESH_MODEL_ID_GEN_BATTERY_SRV 0x100c -/** Generic Battery Client */ -#define BT_MESH_MODEL_ID_GEN_BATTERY_CLI 0x100d -/** Generic Location Server */ -#define BT_MESH_MODEL_ID_GEN_LOCATION_SRV 0x100e -/** Generic Location Setup Server */ -#define BT_MESH_MODEL_ID_GEN_LOCATION_SETUPSRV 0x100f -/** Generic Location Client */ -#define BT_MESH_MODEL_ID_GEN_LOCATION_CLI 0x1010 -/** Generic Admin Property Server */ -#define BT_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV 0x1011 -/** Generic Manufacturer Property Server */ -#define BT_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV 0x1012 -/** Generic User Property Server */ -#define BT_MESH_MODEL_ID_GEN_USER_PROP_SRV 0x1013 -/** Generic Client Property Server */ -#define BT_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV 0x1014 -/** Generic Property Client */ -#define BT_MESH_MODEL_ID_GEN_PROP_CLI 0x1015 -/** Sensor Server */ -#define BT_MESH_MODEL_ID_SENSOR_SRV 0x1100 -/** Sensor Setup Server */ -#define BT_MESH_MODEL_ID_SENSOR_SETUP_SRV 0x1101 -/** Sensor Client */ -#define BT_MESH_MODEL_ID_SENSOR_CLI 0x1102 -/** Time Server */ -#define BT_MESH_MODEL_ID_TIME_SRV 0x1200 -/** Time Setup Server */ -#define BT_MESH_MODEL_ID_TIME_SETUP_SRV 0x1201 -/** Time Client */ -#define BT_MESH_MODEL_ID_TIME_CLI 0x1202 -/** Scene Server */ -#define BT_MESH_MODEL_ID_SCENE_SRV 0x1203 -/** Scene Setup Server */ -#define BT_MESH_MODEL_ID_SCENE_SETUP_SRV 0x1204 -/** Scene Client */ -#define BT_MESH_MODEL_ID_SCENE_CLI 0x1205 -/** Scheduler Server */ -#define BT_MESH_MODEL_ID_SCHEDULER_SRV 0x1206 -/** Scheduler Setup Server */ -#define BT_MESH_MODEL_ID_SCHEDULER_SETUP_SRV 0x1207 -/** Scheduler Client */ -#define BT_MESH_MODEL_ID_SCHEDULER_CLI 0x1208 -/** Light Lightness Server */ -#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV 0x1300 -/** Light Lightness Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV 0x1301 -/** Light Lightness Client */ -#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI 0x1302 -/** Light CTL Server */ -#define BT_MESH_MODEL_ID_LIGHT_CTL_SRV 0x1303 -/** Light CTL Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV 0x1304 -/** Light CTL Client */ -#define BT_MESH_MODEL_ID_LIGHT_CTL_CLI 0x1305 -/** Light CTL Temperature Server */ -#define BT_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV 0x1306 -/** Light HSL Server */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_SRV 0x1307 -/** Light HSL Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV 0x1308 -/** Light HSL Client */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_CLI 0x1309 -/** Light HSL Hue Server */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV 0x130a -/** Light HSL Saturation Server */ -#define BT_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV 0x130b -/** Light xyL Server */ -#define BT_MESH_MODEL_ID_LIGHT_XYL_SRV 0x130c -/** Light xyL Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV 0x130d -/** Light xyL Client */ -#define BT_MESH_MODEL_ID_LIGHT_XYL_CLI 0x130e -/** Light LC Server */ -#define BT_MESH_MODEL_ID_LIGHT_LC_SRV 0x130f -/** Light LC Setup Server */ -#define BT_MESH_MODEL_ID_LIGHT_LC_SETUPSRV 0x1310 -/** Light LC Client */ -#define BT_MESH_MODEL_ID_LIGHT_LC_CLI 0x1311 -/** - * @} - */ - -/** - * @name Models from the Mesh Binary Large Object Transfer Model Specification - * @{ - */ -/** BLOB Transfer Server */ -#define BT_MESH_MODEL_ID_BLOB_SRV 0x1400 -/** BLOB Transfer Client */ -#define BT_MESH_MODEL_ID_BLOB_CLI 0x1401 -/** - * @} - */ - -/** - * @name Models from the Mesh Device Firmware Update Model Specification - * @{ - */ -/** Firmware Update Server */ -#define BT_MESH_MODEL_ID_DFU_SRV 0x1402 -/** Firmware Update Client */ -#define BT_MESH_MODEL_ID_DFU_CLI 0x1403 -/** Firmware Distribution Server */ -#define BT_MESH_MODEL_ID_DFD_SRV 0x1404 -/** Firmware Distribution Client */ -#define BT_MESH_MODEL_ID_DFD_CLI 0x1405 -/** - * @} - */ - -/** @} */ /* end of bt_assigned_numbers_mesh */ - /** * @brief Generic Audio Assigned Numbers * @defgroup bt_assigned_numbers_audio Generic Audio Assigned Numbers diff --git a/include/zephyr/bluetooth/mesh/access.h b/include/zephyr/bluetooth/mesh/access.h index 06ae4f6e9f6f..71aa89db0ef3 100644 --- a/include/zephyr/bluetooth/mesh/access.h +++ b/include/zephyr/bluetooth/mesh/access.h @@ -12,7 +12,6 @@ #include #include -#include #include /* Internal macros used to initialize array members */ @@ -172,6 +171,194 @@ struct bt_mesh_elem { const struct bt_mesh_model * const vnd_models; }; +/** + * @name Foundation Models + * @{ + */ +/** Configuration Server */ +#define BT_MESH_MODEL_ID_CFG_SRV 0x0000 +/** Configuration Client */ +#define BT_MESH_MODEL_ID_CFG_CLI 0x0001 +/** Health Server */ +#define BT_MESH_MODEL_ID_HEALTH_SRV 0x0002 +/** Health Client */ +#define BT_MESH_MODEL_ID_HEALTH_CLI 0x0003 +/** Remote Provisioning Server */ +#define BT_MESH_MODEL_ID_REMOTE_PROV_SRV 0x0004 +/** Remote Provisioning Client */ +#define BT_MESH_MODEL_ID_REMOTE_PROV_CLI 0x0005 +/** Bridge Configuration Sever */ +#define BT_MESH_MODEL_ID_BRG_CFG_SRV 0x0008 +/** Bridge Configuration Client */ +#define BT_MESH_MODEL_ID_BRG_CFG_CLI 0x0009 +/** Private Beacon Server */ +#define BT_MESH_MODEL_ID_PRIV_BEACON_SRV 0x000a +/** Private Beacon Client */ +#define BT_MESH_MODEL_ID_PRIV_BEACON_CLI 0x000b +/** SAR Configuration Server */ +#define BT_MESH_MODEL_ID_SAR_CFG_SRV 0x000e +/** SAR Configuration Client */ +#define BT_MESH_MODEL_ID_SAR_CFG_CLI 0x000f +/** Opcodes Aggregator Server */ +#define BT_MESH_MODEL_ID_OP_AGG_SRV 0x0010 +/** Opcodes Aggregator Client */ +#define BT_MESH_MODEL_ID_OP_AGG_CLI 0x0011 +/** Large Composition Data Server */ +#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_SRV 0x0012 +/** Large Composition Data Client */ +#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_CLI 0x0013 +/** Solicitation PDU RPL Configuration Client */ +#define BT_MESH_MODEL_ID_SOL_PDU_RPL_SRV 0x0014 +/** Solicitation PDU RPL Configuration Server */ +#define BT_MESH_MODEL_ID_SOL_PDU_RPL_CLI 0x0015 +/** Private Proxy Server */ +#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_SRV 0x000c +/** Private Proxy Client */ +#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_CLI 0x000d +/** + * @} + */ + +/** + * @name Models from the Mesh Model Specification + * @{ + */ +/** Generic OnOff Server */ +#define BT_MESH_MODEL_ID_GEN_ONOFF_SRV 0x1000 +/** Generic OnOff Client */ +#define BT_MESH_MODEL_ID_GEN_ONOFF_CLI 0x1001 +/** Generic Level Server */ +#define BT_MESH_MODEL_ID_GEN_LEVEL_SRV 0x1002 +/** Generic Level Client */ +#define BT_MESH_MODEL_ID_GEN_LEVEL_CLI 0x1003 +/** Generic Default Transition Time Server */ +#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV 0x1004 +/** Generic Default Transition Time Client */ +#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_CLI 0x1005 +/** Generic Power OnOff Server */ +#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV 0x1006 +/** Generic Power OnOff Setup Server */ +#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV 0x1007 +/** Generic Power OnOff Client */ +#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI 0x1008 +/** Generic Power Level Server */ +#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV 0x1009 +/** Generic Power Level Setup Server */ +#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV 0x100a +/** Generic Power Level Client */ +#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI 0x100b +/** Generic Battery Server */ +#define BT_MESH_MODEL_ID_GEN_BATTERY_SRV 0x100c +/** Generic Battery Client */ +#define BT_MESH_MODEL_ID_GEN_BATTERY_CLI 0x100d +/** Generic Location Server */ +#define BT_MESH_MODEL_ID_GEN_LOCATION_SRV 0x100e +/** Generic Location Setup Server */ +#define BT_MESH_MODEL_ID_GEN_LOCATION_SETUPSRV 0x100f +/** Generic Location Client */ +#define BT_MESH_MODEL_ID_GEN_LOCATION_CLI 0x1010 +/** Generic Admin Property Server */ +#define BT_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV 0x1011 +/** Generic Manufacturer Property Server */ +#define BT_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV 0x1012 +/** Generic User Property Server */ +#define BT_MESH_MODEL_ID_GEN_USER_PROP_SRV 0x1013 +/** Generic Client Property Server */ +#define BT_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV 0x1014 +/** Generic Property Client */ +#define BT_MESH_MODEL_ID_GEN_PROP_CLI 0x1015 +/** Sensor Server */ +#define BT_MESH_MODEL_ID_SENSOR_SRV 0x1100 +/** Sensor Setup Server */ +#define BT_MESH_MODEL_ID_SENSOR_SETUP_SRV 0x1101 +/** Sensor Client */ +#define BT_MESH_MODEL_ID_SENSOR_CLI 0x1102 +/** Time Server */ +#define BT_MESH_MODEL_ID_TIME_SRV 0x1200 +/** Time Setup Server */ +#define BT_MESH_MODEL_ID_TIME_SETUP_SRV 0x1201 +/** Time Client */ +#define BT_MESH_MODEL_ID_TIME_CLI 0x1202 +/** Scene Server */ +#define BT_MESH_MODEL_ID_SCENE_SRV 0x1203 +/** Scene Setup Server */ +#define BT_MESH_MODEL_ID_SCENE_SETUP_SRV 0x1204 +/** Scene Client */ +#define BT_MESH_MODEL_ID_SCENE_CLI 0x1205 +/** Scheduler Server */ +#define BT_MESH_MODEL_ID_SCHEDULER_SRV 0x1206 +/** Scheduler Setup Server */ +#define BT_MESH_MODEL_ID_SCHEDULER_SETUP_SRV 0x1207 +/** Scheduler Client */ +#define BT_MESH_MODEL_ID_SCHEDULER_CLI 0x1208 +/** Light Lightness Server */ +#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV 0x1300 +/** Light Lightness Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV 0x1301 +/** Light Lightness Client */ +#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI 0x1302 +/** Light CTL Server */ +#define BT_MESH_MODEL_ID_LIGHT_CTL_SRV 0x1303 +/** Light CTL Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV 0x1304 +/** Light CTL Client */ +#define BT_MESH_MODEL_ID_LIGHT_CTL_CLI 0x1305 +/** Light CTL Temperature Server */ +#define BT_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV 0x1306 +/** Light HSL Server */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_SRV 0x1307 +/** Light HSL Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV 0x1308 +/** Light HSL Client */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_CLI 0x1309 +/** Light HSL Hue Server */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV 0x130a +/** Light HSL Saturation Server */ +#define BT_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV 0x130b +/** Light xyL Server */ +#define BT_MESH_MODEL_ID_LIGHT_XYL_SRV 0x130c +/** Light xyL Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV 0x130d +/** Light xyL Client */ +#define BT_MESH_MODEL_ID_LIGHT_XYL_CLI 0x130e +/** Light LC Server */ +#define BT_MESH_MODEL_ID_LIGHT_LC_SRV 0x130f +/** Light LC Setup Server */ +#define BT_MESH_MODEL_ID_LIGHT_LC_SETUPSRV 0x1310 +/** Light LC Client */ +#define BT_MESH_MODEL_ID_LIGHT_LC_CLI 0x1311 +/** + * @} + */ + +/** + * @name Models from the Mesh Binary Large Object Transfer Model Specification + * @{ + */ +/** BLOB Transfer Server */ +#define BT_MESH_MODEL_ID_BLOB_SRV 0x1400 +/** BLOB Transfer Client */ +#define BT_MESH_MODEL_ID_BLOB_CLI 0x1401 +/** + * @} + */ + +/** + * @name Models from the Mesh Device Firmware Update Model Specification + * @{ + */ +/** Firmware Update Server */ +#define BT_MESH_MODEL_ID_DFU_SRV 0x1402 +/** Firmware Update Client */ +#define BT_MESH_MODEL_ID_DFU_CLI 0x1403 +/** Firmware Distribution Server */ +#define BT_MESH_MODEL_ID_DFD_SRV 0x1404 +/** Firmware Distribution Client */ +#define BT_MESH_MODEL_ID_DFD_CLI 0x1405 +/** + * @} + */ + /** Model opcode handler. */ struct bt_mesh_model_op { /** OpCode encoded using the BT_MESH_MODEL_OP_* macros */ From 5ba60cd20d6c4d50664b51f4b7bd4976980cafc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1218/3334] Revert "[nrf fromtree] bluetooth: host: audio: move audio assigned numbers to dedicated header" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 16c192f90d2648e9a1ec8be9d84538593cf0c581. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/assigned_numbers.h | 541 -------------------- include/zephyr/bluetooth/audio/audio.h | 530 ++++++++++++++++++- 2 files changed, 529 insertions(+), 542 deletions(-) diff --git a/include/zephyr/bluetooth/assigned_numbers.h b/include/zephyr/bluetooth/assigned_numbers.h index 8cd5fc422c2d..de978b3cb1de 100644 --- a/include/zephyr/bluetooth/assigned_numbers.h +++ b/include/zephyr/bluetooth/assigned_numbers.h @@ -21,8 +21,6 @@ * @{ */ -#include - #ifdef __cplusplus extern "C" { #endif @@ -717,545 +715,6 @@ extern "C" { /** @} */ /* end of @name Flags data type values */ /** @} */ /* end of bt_assigned_numbers_core */ -/** - * @brief Generic Audio Assigned Numbers - * @defgroup bt_assigned_numbers_audio Generic Audio Assigned Numbers - * @ingroup bt_assigned_numbers - * @{ - */ - -/** - * @brief Codec capability types - * - * Used to build and parse codec capabilities as specified in the PAC specification. - * Source is assigned numbers for Generic Audio, bluetooth.com. - */ -enum bt_audio_codec_cap_type { - /** Supported sampling frequencies */ - BT_AUDIO_CODEC_CAP_TYPE_FREQ = 0x01, - - /** Supported frame durations */ - BT_AUDIO_CODEC_CAP_TYPE_DURATION = 0x02, - - /** Supported audio channel counts */ - BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT = 0x03, - - /** Supported octets per codec frame */ - BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN = 0x04, - - /** Supported maximum codec frames per SDU */ - BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT = 0x05, -}; - -/** @brief Supported frequencies bitfield */ -enum bt_audio_codec_cap_freq { - /** 8 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_8KHZ = BIT(0), - - /** 11.025 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_11KHZ = BIT(1), - - /** 16 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_16KHZ = BIT(2), - - /** 22.05 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_22KHZ = BIT(3), - - /** 24 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_24KHZ = BIT(4), - - /** 32 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_32KHZ = BIT(5), - - /** 44.1 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_44KHZ = BIT(6), - - /** 48 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_48KHZ = BIT(7), - - /** 88.2 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_88KHZ = BIT(8), - - /** 96 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_96KHZ = BIT(9), - - /** 176.4 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_176KHZ = BIT(10), - - /** 192 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_192KHZ = BIT(11), - - /** 384 Khz sampling frequency */ - BT_AUDIO_CODEC_CAP_FREQ_384KHZ = BIT(12), - - /** Any frequency capability */ - BT_AUDIO_CODEC_CAP_FREQ_ANY = - (BT_AUDIO_CODEC_CAP_FREQ_8KHZ | BT_AUDIO_CODEC_CAP_FREQ_11KHZ | - BT_AUDIO_CODEC_CAP_FREQ_16KHZ | BT_AUDIO_CODEC_CAP_FREQ_22KHZ | - BT_AUDIO_CODEC_CAP_FREQ_24KHZ | BT_AUDIO_CODEC_CAP_FREQ_32KHZ | - BT_AUDIO_CODEC_CAP_FREQ_44KHZ | BT_AUDIO_CODEC_CAP_FREQ_48KHZ | - BT_AUDIO_CODEC_CAP_FREQ_88KHZ | BT_AUDIO_CODEC_CAP_FREQ_96KHZ | - BT_AUDIO_CODEC_CAP_FREQ_176KHZ | BT_AUDIO_CODEC_CAP_FREQ_192KHZ | - BT_AUDIO_CODEC_CAP_FREQ_384KHZ), -}; - -/** @brief Supported frame durations bitfield */ -enum bt_audio_codec_cap_frame_dur { - /** 7.5 msec frame duration capability */ - BT_AUDIO_CODEC_CAP_DURATION_7_5 = BIT(0), - - /** 10 msec frame duration capability */ - BT_AUDIO_CODEC_CAP_DURATION_10 = BIT(1), - - /** Any frame duration capability */ - BT_AUDIO_CODEC_CAP_DURATION_ANY = - (BT_AUDIO_CODEC_CAP_DURATION_7_5 | BT_AUDIO_CODEC_CAP_DURATION_10), - - /** - * @brief 7.5 msec preferred frame duration capability. - * - * This shall only be set if @ref BT_AUDIO_CODEC_CAP_DURATION_7_5 is also set, and if @ref - * BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 is not set. - */ - BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 = BIT(4), - - /** - * @brief 10 msec preferred frame duration capability - * - * This shall only be set if @ref BT_AUDIO_CODEC_CAP_DURATION_10 is also set, and if @ref - * BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 is not set. - */ - BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 = BIT(5), -}; - -/** Supported audio capabilities channel count bitfield */ -enum bt_audio_codec_cap_chan_count { - /** Supporting 1 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 = BIT(0), - - /** Supporting 2 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 = BIT(1), - - /** Supporting 3 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 = BIT(2), - - /** Supporting 4 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 = BIT(3), - - /** Supporting 5 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 = BIT(4), - - /** Supporting 6 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 = BIT(5), - - /** Supporting 7 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 = BIT(6), - - /** Supporting 8 channel */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_8 = BIT(7), - - /** Supporting all channels */ - BT_AUDIO_CODEC_CAP_CHAN_COUNT_ANY = - (BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 | - BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 | - BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 | - BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_8), -}; - -/** Minimum supported channel counts */ -#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN 1 -/** Maximum supported channel counts */ -#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX 8 - -/** The minimum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */ -#define BT_AUDIO_BROADCAST_NAME_LEN_MIN 4 -/** The maximum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */ -#define BT_AUDIO_BROADCAST_NAME_LEN_MAX 128 - -/** - * @brief Codec configuration types - * - * Used to build and parse codec configurations as specified in the ASCS and BAP specifications. - * Source is assigned numbers for Generic Audio, bluetooth.com. - */ -enum bt_audio_codec_cfg_type { - /** Sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ = 0x01, - - /** Frame duration */ - BT_AUDIO_CODEC_CFG_DURATION = 0x02, - - /** Audio channel allocation */ - BT_AUDIO_CODEC_CFG_CHAN_ALLOC = 0x03, - - /** Octets per codec frame */ - BT_AUDIO_CODEC_CFG_FRAME_LEN = 0x04, - - /** Codec frame blocks per SDU */ - BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU = 0x05, -}; - -/** Codec configuration sampling freqency */ -enum bt_audio_codec_cfg_freq { - /** 8 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_8KHZ = 0x01, - - /** 11.025 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_11KHZ = 0x02, - - /** 16 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_16KHZ = 0x03, - - /** 22.05 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_22KHZ = 0x04, - - /** 24 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_24KHZ = 0x05, - - /** 32 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_32KHZ = 0x06, - - /** 44.1 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_44KHZ = 0x07, - - /** 48 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_48KHZ = 0x08, - - /** 88.2 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_88KHZ = 0x09, - - /** 96 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_96KHZ = 0x0a, - - /** 176.4 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_176KHZ = 0x0b, - - /** 192 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_192KHZ = 0x0c, - - /** 384 Khz codec sampling frequency */ - BT_AUDIO_CODEC_CFG_FREQ_384KHZ = 0x0d, -}; - -/** Codec configuration frame duration */ -enum bt_audio_codec_cfg_frame_dur { - /** 7.5 msec Frame Duration configuration */ - BT_AUDIO_CODEC_CFG_DURATION_7_5 = 0x00, - - /** 10 msec Frame Duration configuration */ - BT_AUDIO_CODEC_CFG_DURATION_10 = 0x01, -}; - -/** - * @brief Audio Context Type for Generic Audio - * - * These values are defined by the Generic Audio Assigned Numbers, bluetooth.com - */ -enum bt_audio_context { - /** No context type */ - BT_AUDIO_CONTEXT_TYPE_NONE = 0, - /** - * Identifies audio where the use case context does not match any other defined value, - * or where the context is unknown or cannot be determined. - */ - BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED = BIT(0), - /** - * Conversation between humans, for example, in telephony or video calls, including - * traditional cellular as well as VoIP and Push-to-Talk - */ - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL = BIT(1), - /** Media, for example, music playback, radio, podcast or movie soundtrack, or tv audio */ - BT_AUDIO_CONTEXT_TYPE_MEDIA = BIT(2), - /** - * Audio associated with video gaming, for example gaming media; gaming effects; music - * and in-game voice chat between participants; or a mix of all the above - */ - BT_AUDIO_CONTEXT_TYPE_GAME = BIT(3), - /** Instructional audio, for example, in navigation, announcements, or user guidance */ - BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL = BIT(4), - /** Man-machine communication, for example, with voice recognition or virtual assistants */ - BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS = BIT(5), - /** - * Live audio, for example, from a microphone where audio is perceived both through a - * direct acoustic path and through an LE Audio Stream - */ - BT_AUDIO_CONTEXT_TYPE_LIVE = BIT(6), - /** - * Sound effects including keyboard and touch feedback; menu and user interface sounds; - * and other system sounds - */ - BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS = BIT(7), - /** - * Notification and reminder sounds; attention-seeking audio, for example, - * in beeps signaling the arrival of a message - */ - BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS = BIT(8), - /** - * Alerts the user to an incoming call, for example, an incoming telephony or video call, - * including traditional cellular as well as VoIP and Push-to-Talk - */ - BT_AUDIO_CONTEXT_TYPE_RINGTONE = BIT(9), - /** - * Alarms and timers; immediate alerts, for example, in a critical battery alarm, - * timer expiry or alarm clock, toaster, cooker, kettle, microwave, etc. - */ - BT_AUDIO_CONTEXT_TYPE_ALERTS = BIT(10), - /** Emergency alarm Emergency sounds, for example, fire alarms or other urgent alerts */ - BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM = BIT(11), -}; - -/** - * Any known context. - */ -#define BT_AUDIO_CONTEXT_TYPE_ANY (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | \ - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \ - BT_AUDIO_CONTEXT_TYPE_MEDIA | \ - BT_AUDIO_CONTEXT_TYPE_GAME | \ - BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL | \ - BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS | \ - BT_AUDIO_CONTEXT_TYPE_LIVE | \ - BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS | \ - BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS | \ - BT_AUDIO_CONTEXT_TYPE_RINGTONE | \ - BT_AUDIO_CONTEXT_TYPE_ALERTS | \ - BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM) - -/** - * @brief Parental rating defined by the Generic Audio assigned numbers (bluetooth.com). - * - * The numbering scheme is aligned with Annex F of EN 300 707 v1.2.1 which - * defined parental rating for viewing. - */ -enum bt_audio_parental_rating { - /** No rating */ - BT_AUDIO_PARENTAL_RATING_NO_RATING = 0x00, - /** For all ages */ - BT_AUDIO_PARENTAL_RATING_AGE_ANY = 0x01, - /** Recommended for listeners of age 5 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_5_OR_ABOVE = 0x02, - /** Recommended for listeners of age 6 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_6_OR_ABOVE = 0x03, - /** Recommended for listeners of age 7 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_7_OR_ABOVE = 0x04, - /** Recommended for listeners of age 8 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_8_OR_ABOVE = 0x05, - /** Recommended for listeners of age 9 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_9_OR_ABOVE = 0x06, - /** Recommended for listeners of age 10 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_10_OR_ABOVE = 0x07, - /** Recommended for listeners of age 11 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_11_OR_ABOVE = 0x08, - /** Recommended for listeners of age 12 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_12_OR_ABOVE = 0x09, - /** Recommended for listeners of age 13 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_13_OR_ABOVE = 0x0A, - /** Recommended for listeners of age 14 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_14_OR_ABOVE = 0x0B, - /** Recommended for listeners of age 15 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_15_OR_ABOVE = 0x0C, - /** Recommended for listeners of age 16 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_16_OR_ABOVE = 0x0D, - /** Recommended for listeners of age 17 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_17_OR_ABOVE = 0x0E, - /** Recommended for listeners of age 18 and above */ - BT_AUDIO_PARENTAL_RATING_AGE_18_OR_ABOVE = 0x0F -}; - -/** @brief Audio Active State defined by the Generic Audio assigned numbers (bluetooth.com). */ -enum bt_audio_active_state { - /** No audio data is being transmitted */ - BT_AUDIO_ACTIVE_STATE_DISABLED = 0x00, - /** Audio data is being transmitted */ - BT_AUDIO_ACTIVE_STATE_ENABLED = 0x01, -}; - -/** Assisted Listening Stream defined by the Generic Audio assigned numbers (bluetooth.com). */ -enum bt_audio_assisted_listening_stream { - /** Unspecified audio enhancement */ - BT_AUDIO_ASSISTED_LISTENING_STREAM_UNSPECIFIED = 0x00, -}; - -/** - * @brief Codec metadata type IDs - * - * Metadata types defined by the Generic Audio assigned numbers (bluetooth.com). - */ -enum bt_audio_metadata_type { - /** - * @brief Preferred audio context. - * - * Bitfield of preferred audio contexts. - * - * If 0, the context type is not a preferred use case for this codec - * configuration. - * - * See the BT_AUDIO_CONTEXT_* for valid values. - */ - BT_AUDIO_METADATA_TYPE_PREF_CONTEXT = 0x01, - - /** - * @brief Streaming audio context. - * - * Bitfield of streaming audio contexts. - * - * If 0, the context type is not a preferred use case for this codec - * configuration. - * - * See the BT_AUDIO_CONTEXT_* for valid values. - */ - BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT = 0x02, - - /** UTF-8 encoded title or summary of stream content */ - BT_AUDIO_METADATA_TYPE_PROGRAM_INFO = 0x03, - - /** - * @brief Language - * - * 3 octet lower case language code defined by ISO 639-3 - * Possible values can be found at https://iso639-3.sil.org/code_tables/639/data - */ - BT_AUDIO_METADATA_TYPE_LANG = 0x04, - - /** Array of 8-bit CCID values */ - BT_AUDIO_METADATA_TYPE_CCID_LIST = 0x05, - - /** - * @brief Parental rating - * - * See @ref bt_audio_parental_rating for valid values. - */ - BT_AUDIO_METADATA_TYPE_PARENTAL_RATING = 0x06, - - /** UTF-8 encoded URI for additional Program information */ - BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI = 0x07, - - /** - * @brief Audio active state - * - * See @ref bt_audio_active_state for valid values. - */ - BT_AUDIO_METADATA_TYPE_AUDIO_STATE = 0x08, - - /** Broadcast Audio Immediate Rendering flag */ - BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE = 0x09, - - /** - * @brief Assisted listening stream - * - * See @ref bt_audio_assisted_listening_stream for valid values. - */ - BT_AUDIO_METADATA_TYPE_ASSISTED_LISTENING_STREAM = 0x0A, - - /** UTF-8 encoded Broadcast name */ - BT_AUDIO_METADATA_TYPE_BROADCAST_NAME = 0x0B, - - /** Extended metadata */ - BT_AUDIO_METADATA_TYPE_EXTENDED = 0xFE, - - /** Vendor specific metadata */ - BT_AUDIO_METADATA_TYPE_VENDOR = 0xFF, -}; - -/** - * @brief Location values for BT Audio. - * - * These values are defined by the Generic Audio Assigned Numbers, bluetooth.com - */ -enum bt_audio_location { - /** Mono Audio (no specified Audio Location) */ - BT_AUDIO_LOCATION_MONO_AUDIO = 0, - /** Front Left */ - BT_AUDIO_LOCATION_FRONT_LEFT = BIT(0), - /** Front Right */ - BT_AUDIO_LOCATION_FRONT_RIGHT = BIT(1), - /** Front Center */ - BT_AUDIO_LOCATION_FRONT_CENTER = BIT(2), - /** Low Frequency Effects 1 */ - BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 = BIT(3), - /** Back Left */ - BT_AUDIO_LOCATION_BACK_LEFT = BIT(4), - /** Back Right */ - BT_AUDIO_LOCATION_BACK_RIGHT = BIT(5), - /** Front Left of Center */ - BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER = BIT(6), - /** Front Right of Center */ - BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER = BIT(7), - /** Back Center */ - BT_AUDIO_LOCATION_BACK_CENTER = BIT(8), - /** Low Frequency Effects 2 */ - BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 = BIT(9), - /** Side Left */ - BT_AUDIO_LOCATION_SIDE_LEFT = BIT(10), - /** Side Right */ - BT_AUDIO_LOCATION_SIDE_RIGHT = BIT(11), - /** Top Front Left */ - BT_AUDIO_LOCATION_TOP_FRONT_LEFT = BIT(12), - /** Top Front Right */ - BT_AUDIO_LOCATION_TOP_FRONT_RIGHT = BIT(13), - /** Top Front Center */ - BT_AUDIO_LOCATION_TOP_FRONT_CENTER = BIT(14), - /** Top Center */ - BT_AUDIO_LOCATION_TOP_CENTER = BIT(15), - /** Top Back Left */ - BT_AUDIO_LOCATION_TOP_BACK_LEFT = BIT(16), - /** Top Back Right */ - BT_AUDIO_LOCATION_TOP_BACK_RIGHT = BIT(17), - /** Top Side Left */ - BT_AUDIO_LOCATION_TOP_SIDE_LEFT = BIT(18), - /** Top Side Right */ - BT_AUDIO_LOCATION_TOP_SIDE_RIGHT = BIT(19), - /** Top Back Center */ - BT_AUDIO_LOCATION_TOP_BACK_CENTER = BIT(20), - /** Bottom Front Center */ - BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER = BIT(21), - /** Bottom Front Left */ - BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT = BIT(22), - /** Bottom Front Right */ - BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT = BIT(23), - /** Front Left Wide */ - BT_AUDIO_LOCATION_FRONT_LEFT_WIDE = BIT(24), - /** Front Right Wide */ - BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE = BIT(25), - /** Left Surround */ - BT_AUDIO_LOCATION_LEFT_SURROUND = BIT(26), - /** Right Surround */ - BT_AUDIO_LOCATION_RIGHT_SURROUND = BIT(27), -}; - -/** - * Any known location. - */ -#define BT_AUDIO_LOCATION_ANY (BT_AUDIO_LOCATION_FRONT_LEFT | \ - BT_AUDIO_LOCATION_FRONT_RIGHT | \ - BT_AUDIO_LOCATION_FRONT_CENTER | \ - BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 | \ - BT_AUDIO_LOCATION_BACK_LEFT | \ - BT_AUDIO_LOCATION_BACK_RIGHT | \ - BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER | \ - BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER | \ - BT_AUDIO_LOCATION_BACK_CENTER | \ - BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 | \ - BT_AUDIO_LOCATION_SIDE_LEFT | \ - BT_AUDIO_LOCATION_SIDE_RIGHT | \ - BT_AUDIO_LOCATION_TOP_FRONT_LEFT | \ - BT_AUDIO_LOCATION_TOP_FRONT_RIGHT | \ - BT_AUDIO_LOCATION_TOP_FRONT_CENTER | \ - BT_AUDIO_LOCATION_TOP_CENTER | \ - BT_AUDIO_LOCATION_TOP_BACK_LEFT | \ - BT_AUDIO_LOCATION_TOP_BACK_RIGHT | \ - BT_AUDIO_LOCATION_TOP_SIDE_LEFT | \ - BT_AUDIO_LOCATION_TOP_SIDE_RIGHT | \ - BT_AUDIO_LOCATION_TOP_BACK_CENTER | \ - BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER | \ - BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT | \ - BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT | \ - BT_AUDIO_LOCATION_FRONT_LEFT_WIDE | \ - BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE | \ - BT_AUDIO_LOCATION_LEFT_SURROUND | \ - BT_AUDIO_LOCATION_RIGHT_SURROUND) - -/** @} */ /* end of bt_assigned_numbers_audio */ - /** * @name Company Identifiers (see Bluetooth Assigned Numbers) * @{ diff --git a/include/zephyr/bluetooth/audio/audio.h b/include/zephyr/bluetooth/audio/audio.h index 87eac9d4a203..230f2735e4d5 100644 --- a/include/zephyr/bluetooth/audio/audio.h +++ b/include/zephyr/bluetooth/audio/audio.h @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -50,10 +49,157 @@ extern "C" { #define BT_AUDIO_PD_MAX 0xFFFFFFU /** Indicates that the unicast server does not have a preference for any retransmission number */ #define BT_AUDIO_RTN_PREF_NONE 0xFFU +/** The minimum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */ +#define BT_AUDIO_BROADCAST_NAME_LEN_MIN 4 +/** The maximum size of a Broadcast Name as defined by Bluetooth Assigned Numbers */ +#define BT_AUDIO_BROADCAST_NAME_LEN_MAX 128 /** Size of the stream language value, e.g. "eng" */ #define BT_AUDIO_LANG_SIZE 3 +/** + * @brief Codec capability types + * + * Used to build and parse codec capabilities as specified in the PAC specification. + * Source is assigned numbers for Generic Audio, bluetooth.com. + */ +enum bt_audio_codec_cap_type { + /** Supported sampling frequencies */ + BT_AUDIO_CODEC_CAP_TYPE_FREQ = 0x01, + + /** Supported frame durations */ + BT_AUDIO_CODEC_CAP_TYPE_DURATION = 0x02, + + /** Supported audio channel counts */ + BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT = 0x03, + + /** Supported octets per codec frame */ + BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN = 0x04, + + /** Supported maximum codec frames per SDU */ + BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT = 0x05, +}; + +/** @brief Supported frequencies bitfield */ +enum bt_audio_codec_cap_freq { + /** 8 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_8KHZ = BIT(0), + + /** 11.025 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_11KHZ = BIT(1), + + /** 16 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_16KHZ = BIT(2), + + /** 22.05 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_22KHZ = BIT(3), + + /** 24 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_24KHZ = BIT(4), + + /** 32 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_32KHZ = BIT(5), + + /** 44.1 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_44KHZ = BIT(6), + + /** 48 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_48KHZ = BIT(7), + + /** 88.2 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_88KHZ = BIT(8), + + /** 96 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_96KHZ = BIT(9), + + /** 176.4 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_176KHZ = BIT(10), + + /** 192 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_192KHZ = BIT(11), + + /** 384 Khz sampling frequency */ + BT_AUDIO_CODEC_CAP_FREQ_384KHZ = BIT(12), + + /** Any frequency capability */ + BT_AUDIO_CODEC_CAP_FREQ_ANY = + (BT_AUDIO_CODEC_CAP_FREQ_8KHZ | BT_AUDIO_CODEC_CAP_FREQ_11KHZ | + BT_AUDIO_CODEC_CAP_FREQ_16KHZ | BT_AUDIO_CODEC_CAP_FREQ_22KHZ | + BT_AUDIO_CODEC_CAP_FREQ_24KHZ | BT_AUDIO_CODEC_CAP_FREQ_32KHZ | + BT_AUDIO_CODEC_CAP_FREQ_44KHZ | BT_AUDIO_CODEC_CAP_FREQ_48KHZ | + BT_AUDIO_CODEC_CAP_FREQ_88KHZ | BT_AUDIO_CODEC_CAP_FREQ_96KHZ | + BT_AUDIO_CODEC_CAP_FREQ_176KHZ | BT_AUDIO_CODEC_CAP_FREQ_192KHZ | + BT_AUDIO_CODEC_CAP_FREQ_384KHZ), +}; + +/** @brief Supported frame durations bitfield */ +enum bt_audio_codec_cap_frame_dur { + /** 7.5 msec frame duration capability */ + BT_AUDIO_CODEC_CAP_DURATION_7_5 = BIT(0), + + /** 10 msec frame duration capability */ + BT_AUDIO_CODEC_CAP_DURATION_10 = BIT(1), + + /** Any frame duration capability */ + BT_AUDIO_CODEC_CAP_DURATION_ANY = + (BT_AUDIO_CODEC_CAP_DURATION_7_5 | BT_AUDIO_CODEC_CAP_DURATION_10), + + /** + * @brief 7.5 msec preferred frame duration capability. + * + * This shall only be set if @ref BT_AUDIO_CODEC_CAP_DURATION_7_5 is also set, and if @ref + * BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 is not set. + */ + BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 = BIT(4), + + /** + * @brief 10 msec preferred frame duration capability + * + * This shall only be set if @ref BT_AUDIO_CODEC_CAP_DURATION_10 is also set, and if @ref + * BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 is not set. + */ + BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 = BIT(5), +}; + +/** Supported audio capabilities channel count bitfield */ +enum bt_audio_codec_cap_chan_count { + /** Supporting 1 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 = BIT(0), + + /** Supporting 2 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 = BIT(1), + + /** Supporting 3 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 = BIT(2), + + /** Supporting 4 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 = BIT(3), + + /** Supporting 5 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 = BIT(4), + + /** Supporting 6 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 = BIT(5), + + /** Supporting 7 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 = BIT(6), + + /** Supporting 8 channel */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_8 = BIT(7), + + /** Supporting all channels */ + BT_AUDIO_CODEC_CAP_CHAN_COUNT_ANY = + (BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 | + BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 | + BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 | + BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 | BT_AUDIO_CODEC_CAP_CHAN_COUNT_8), +}; + +/** Minimum supported channel counts */ +#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN 1 +/** Maximum supported channel counts */ +#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX 8 + /** * @brief Channel count support capability * @@ -75,6 +221,290 @@ struct bt_audio_codec_octets_per_codec_frame { uint16_t max; }; +/** + * @brief Codec configuration types + * + * Used to build and parse codec configurations as specified in the ASCS and BAP specifications. + * Source is assigned numbers for Generic Audio, bluetooth.com. + */ +enum bt_audio_codec_cfg_type { + /** Sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ = 0x01, + + /** Frame duration */ + BT_AUDIO_CODEC_CFG_DURATION = 0x02, + + /** Audio channel allocation */ + BT_AUDIO_CODEC_CFG_CHAN_ALLOC = 0x03, + + /** Octets per codec frame */ + BT_AUDIO_CODEC_CFG_FRAME_LEN = 0x04, + + /** Codec frame blocks per SDU */ + BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU = 0x05, +}; + +/** Codec configuration sampling freqency */ +enum bt_audio_codec_cfg_freq { + /** 8 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_8KHZ = 0x01, + + /** 11.025 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_11KHZ = 0x02, + + /** 16 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_16KHZ = 0x03, + + /** 22.05 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_22KHZ = 0x04, + + /** 24 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_24KHZ = 0x05, + + /** 32 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_32KHZ = 0x06, + + /** 44.1 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_44KHZ = 0x07, + + /** 48 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_48KHZ = 0x08, + + /** 88.2 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_88KHZ = 0x09, + + /** 96 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_96KHZ = 0x0a, + + /** 176.4 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_176KHZ = 0x0b, + + /** 192 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_192KHZ = 0x0c, + + /** 384 Khz codec sampling frequency */ + BT_AUDIO_CODEC_CFG_FREQ_384KHZ = 0x0d, +}; + +/** Codec configuration frame duration */ +enum bt_audio_codec_cfg_frame_dur { + /** 7.5 msec Frame Duration configuration */ + BT_AUDIO_CODEC_CFG_DURATION_7_5 = 0x00, + + /** 10 msec Frame Duration configuration */ + BT_AUDIO_CODEC_CFG_DURATION_10 = 0x01, +}; + +/** + * @brief Audio Context Type for Generic Audio + * + * These values are defined by the Generic Audio Assigned Numbers, bluetooth.com + */ +enum bt_audio_context { + /** No context type */ + BT_AUDIO_CONTEXT_TYPE_NONE = 0, + /** + * Identifies audio where the use case context does not match any other defined value, + * or where the context is unknown or cannot be determined. + */ + BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED = BIT(0), + /** + * Conversation between humans, for example, in telephony or video calls, including + * traditional cellular as well as VoIP and Push-to-Talk + */ + BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL = BIT(1), + /** Media, for example, music playback, radio, podcast or movie soundtrack, or tv audio */ + BT_AUDIO_CONTEXT_TYPE_MEDIA = BIT(2), + /** + * Audio associated with video gaming, for example gaming media; gaming effects; music + * and in-game voice chat between participants; or a mix of all the above + */ + BT_AUDIO_CONTEXT_TYPE_GAME = BIT(3), + /** Instructional audio, for example, in navigation, announcements, or user guidance */ + BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL = BIT(4), + /** Man-machine communication, for example, with voice recognition or virtual assistants */ + BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS = BIT(5), + /** + * Live audio, for example, from a microphone where audio is perceived both through a + * direct acoustic path and through an LE Audio Stream + */ + BT_AUDIO_CONTEXT_TYPE_LIVE = BIT(6), + /** + * Sound effects including keyboard and touch feedback; menu and user interface sounds; + * and other system sounds + */ + BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS = BIT(7), + /** + * Notification and reminder sounds; attention-seeking audio, for example, + * in beeps signaling the arrival of a message + */ + BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS = BIT(8), + /** + * Alerts the user to an incoming call, for example, an incoming telephony or video call, + * including traditional cellular as well as VoIP and Push-to-Talk + */ + BT_AUDIO_CONTEXT_TYPE_RINGTONE = BIT(9), + /** + * Alarms and timers; immediate alerts, for example, in a critical battery alarm, + * timer expiry or alarm clock, toaster, cooker, kettle, microwave, etc. + */ + BT_AUDIO_CONTEXT_TYPE_ALERTS = BIT(10), + /** Emergency alarm Emergency sounds, for example, fire alarms or other urgent alerts */ + BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM = BIT(11), +}; + +/** + * Any known context. + */ +#define BT_AUDIO_CONTEXT_TYPE_ANY (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | \ + BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \ + BT_AUDIO_CONTEXT_TYPE_MEDIA | \ + BT_AUDIO_CONTEXT_TYPE_GAME | \ + BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL | \ + BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS | \ + BT_AUDIO_CONTEXT_TYPE_LIVE | \ + BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS | \ + BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS | \ + BT_AUDIO_CONTEXT_TYPE_RINGTONE | \ + BT_AUDIO_CONTEXT_TYPE_ALERTS | \ + BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM) + +/** + * @brief Parental rating defined by the Generic Audio assigned numbers (bluetooth.com). + * + * The numbering scheme is aligned with Annex F of EN 300 707 v1.2.1 which + * defined parental rating for viewing. + */ +enum bt_audio_parental_rating { + /** No rating */ + BT_AUDIO_PARENTAL_RATING_NO_RATING = 0x00, + /** For all ages */ + BT_AUDIO_PARENTAL_RATING_AGE_ANY = 0x01, + /** Recommended for listeners of age 5 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_5_OR_ABOVE = 0x02, + /** Recommended for listeners of age 6 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_6_OR_ABOVE = 0x03, + /** Recommended for listeners of age 7 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_7_OR_ABOVE = 0x04, + /** Recommended for listeners of age 8 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_8_OR_ABOVE = 0x05, + /** Recommended for listeners of age 9 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_9_OR_ABOVE = 0x06, + /** Recommended for listeners of age 10 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_10_OR_ABOVE = 0x07, + /** Recommended for listeners of age 11 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_11_OR_ABOVE = 0x08, + /** Recommended for listeners of age 12 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_12_OR_ABOVE = 0x09, + /** Recommended for listeners of age 13 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_13_OR_ABOVE = 0x0A, + /** Recommended for listeners of age 14 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_14_OR_ABOVE = 0x0B, + /** Recommended for listeners of age 15 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_15_OR_ABOVE = 0x0C, + /** Recommended for listeners of age 16 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_16_OR_ABOVE = 0x0D, + /** Recommended for listeners of age 17 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_17_OR_ABOVE = 0x0E, + /** Recommended for listeners of age 18 and above */ + BT_AUDIO_PARENTAL_RATING_AGE_18_OR_ABOVE = 0x0F +}; + +/** @brief Audio Active State defined by the Generic Audio assigned numbers (bluetooth.com). */ +enum bt_audio_active_state { + /** No audio data is being transmitted */ + BT_AUDIO_ACTIVE_STATE_DISABLED = 0x00, + /** Audio data is being transmitted */ + BT_AUDIO_ACTIVE_STATE_ENABLED = 0x01, +}; + +/** Assisted Listening Stream defined by the Generic Audio assigned numbers (bluetooth.com). */ +enum bt_audio_assisted_listening_stream { + /** Unspecified audio enhancement */ + BT_AUDIO_ASSISTED_LISTENING_STREAM_UNSPECIFIED = 0x00, +}; + +/** + * @brief Codec metadata type IDs + * + * Metadata types defined by the Generic Audio assigned numbers (bluetooth.com). + */ +enum bt_audio_metadata_type { + /** + * @brief Preferred audio context. + * + * Bitfield of preferred audio contexts. + * + * If 0, the context type is not a preferred use case for this codec + * configuration. + * + * See the BT_AUDIO_CONTEXT_* for valid values. + */ + BT_AUDIO_METADATA_TYPE_PREF_CONTEXT = 0x01, + + /** + * @brief Streaming audio context. + * + * Bitfield of streaming audio contexts. + * + * If 0, the context type is not a preferred use case for this codec + * configuration. + * + * See the BT_AUDIO_CONTEXT_* for valid values. + */ + BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT = 0x02, + + /** UTF-8 encoded title or summary of stream content */ + BT_AUDIO_METADATA_TYPE_PROGRAM_INFO = 0x03, + + /** + * @brief Language + * + * 3 octet lower case language code defined by ISO 639-3 + * Possible values can be found at https://iso639-3.sil.org/code_tables/639/data + */ + BT_AUDIO_METADATA_TYPE_LANG = 0x04, + + /** Array of 8-bit CCID values */ + BT_AUDIO_METADATA_TYPE_CCID_LIST = 0x05, + + /** + * @brief Parental rating + * + * See @ref bt_audio_parental_rating for valid values. + */ + BT_AUDIO_METADATA_TYPE_PARENTAL_RATING = 0x06, + + /** UTF-8 encoded URI for additional Program information */ + BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI = 0x07, + + /** + * @brief Audio active state + * + * See @ref bt_audio_active_state for valid values. + */ + BT_AUDIO_METADATA_TYPE_AUDIO_STATE = 0x08, + + /** Broadcast Audio Immediate Rendering flag */ + BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE = 0x09, + + /** + * @brief Assisted listening stream + * + * See @ref bt_audio_assisted_listening_stream for valid values. + */ + BT_AUDIO_METADATA_TYPE_ASSISTED_LISTENING_STREAM = 0x0A, + + /** UTF-8 encoded Broadcast name */ + BT_AUDIO_METADATA_TYPE_BROADCAST_NAME = 0x0B, + + /** Extended metadata */ + BT_AUDIO_METADATA_TYPE_EXTENDED = 0xFE, + + /** Vendor specific metadata */ + BT_AUDIO_METADATA_TYPE_VENDOR = 0xFF, +}; + /** * @brief Helper to check whether metadata type is known by the stack. * @@ -156,6 +586,104 @@ struct bt_audio_codec_octets_per_codec_frame { .meta = _meta, \ }) +/** + * @brief Location values for BT Audio. + * + * These values are defined by the Generic Audio Assigned Numbers, bluetooth.com + */ +enum bt_audio_location { + /** Mono Audio (no specified Audio Location) */ + BT_AUDIO_LOCATION_MONO_AUDIO = 0, + /** Front Left */ + BT_AUDIO_LOCATION_FRONT_LEFT = BIT(0), + /** Front Right */ + BT_AUDIO_LOCATION_FRONT_RIGHT = BIT(1), + /** Front Center */ + BT_AUDIO_LOCATION_FRONT_CENTER = BIT(2), + /** Low Frequency Effects 1 */ + BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 = BIT(3), + /** Back Left */ + BT_AUDIO_LOCATION_BACK_LEFT = BIT(4), + /** Back Right */ + BT_AUDIO_LOCATION_BACK_RIGHT = BIT(5), + /** Front Left of Center */ + BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER = BIT(6), + /** Front Right of Center */ + BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER = BIT(7), + /** Back Center */ + BT_AUDIO_LOCATION_BACK_CENTER = BIT(8), + /** Low Frequency Effects 2 */ + BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 = BIT(9), + /** Side Left */ + BT_AUDIO_LOCATION_SIDE_LEFT = BIT(10), + /** Side Right */ + BT_AUDIO_LOCATION_SIDE_RIGHT = BIT(11), + /** Top Front Left */ + BT_AUDIO_LOCATION_TOP_FRONT_LEFT = BIT(12), + /** Top Front Right */ + BT_AUDIO_LOCATION_TOP_FRONT_RIGHT = BIT(13), + /** Top Front Center */ + BT_AUDIO_LOCATION_TOP_FRONT_CENTER = BIT(14), + /** Top Center */ + BT_AUDIO_LOCATION_TOP_CENTER = BIT(15), + /** Top Back Left */ + BT_AUDIO_LOCATION_TOP_BACK_LEFT = BIT(16), + /** Top Back Right */ + BT_AUDIO_LOCATION_TOP_BACK_RIGHT = BIT(17), + /** Top Side Left */ + BT_AUDIO_LOCATION_TOP_SIDE_LEFT = BIT(18), + /** Top Side Right */ + BT_AUDIO_LOCATION_TOP_SIDE_RIGHT = BIT(19), + /** Top Back Center */ + BT_AUDIO_LOCATION_TOP_BACK_CENTER = BIT(20), + /** Bottom Front Center */ + BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER = BIT(21), + /** Bottom Front Left */ + BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT = BIT(22), + /** Bottom Front Right */ + BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT = BIT(23), + /** Front Left Wide */ + BT_AUDIO_LOCATION_FRONT_LEFT_WIDE = BIT(24), + /** Front Right Wide */ + BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE = BIT(25), + /** Left Surround */ + BT_AUDIO_LOCATION_LEFT_SURROUND = BIT(26), + /** Right Surround */ + BT_AUDIO_LOCATION_RIGHT_SURROUND = BIT(27), +}; + +/** + * Any known location. + */ +#define BT_AUDIO_LOCATION_ANY (BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT | \ + BT_AUDIO_LOCATION_FRONT_CENTER | \ + BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 | \ + BT_AUDIO_LOCATION_BACK_LEFT | \ + BT_AUDIO_LOCATION_BACK_RIGHT | \ + BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER | \ + BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER | \ + BT_AUDIO_LOCATION_BACK_CENTER | \ + BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 | \ + BT_AUDIO_LOCATION_SIDE_LEFT | \ + BT_AUDIO_LOCATION_SIDE_RIGHT | \ + BT_AUDIO_LOCATION_TOP_FRONT_LEFT | \ + BT_AUDIO_LOCATION_TOP_FRONT_RIGHT | \ + BT_AUDIO_LOCATION_TOP_FRONT_CENTER | \ + BT_AUDIO_LOCATION_TOP_CENTER | \ + BT_AUDIO_LOCATION_TOP_BACK_LEFT | \ + BT_AUDIO_LOCATION_TOP_BACK_RIGHT | \ + BT_AUDIO_LOCATION_TOP_SIDE_LEFT | \ + BT_AUDIO_LOCATION_TOP_SIDE_RIGHT | \ + BT_AUDIO_LOCATION_TOP_BACK_CENTER | \ + BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER | \ + BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT | \ + BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT | \ + BT_AUDIO_LOCATION_FRONT_LEFT_WIDE | \ + BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE | \ + BT_AUDIO_LOCATION_LEFT_SURROUND | \ + BT_AUDIO_LOCATION_RIGHT_SURROUND) + /** @brief Codec capability structure. */ struct bt_audio_codec_cap { /** Data path ID From d6def199d8f02445fb99dd8d3d44a16471377b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1219/3334] Revert "[nrf fromtree] bluetooth: host: move assigned numbers out of gap.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8d9cc646301032094a66825217f05a4f25976b39. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/assigned_numbers.h | 735 -------------------- include/zephyr/bluetooth/gap.h | 677 +++++++++++++++++- 2 files changed, 676 insertions(+), 736 deletions(-) delete mode 100644 include/zephyr/bluetooth/assigned_numbers.h diff --git a/include/zephyr/bluetooth/assigned_numbers.h b/include/zephyr/bluetooth/assigned_numbers.h deleted file mode 100644 index de978b3cb1de..000000000000 --- a/include/zephyr/bluetooth/assigned_numbers.h +++ /dev/null @@ -1,735 +0,0 @@ -/** @file - * @brief Bluetooth Assigned Numbers, codes and identifiers. - */ - -/* - * Copyright (c) 2015-2025 Intel Corporation - * Copyright (c) 2017-2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_BLUETOOTH_ASSIGNED_NUMBERS_H_ -#define ZEPHYR_INCLUDE_BLUETOOTH_ASSIGNED_NUMBERS_H_ - -/** - * @brief Bluetooth Assigned Numbers, codes and identifiers. - * @defgroup bt_assigned_numbers Assigned Numbers. - * @since 1.0 - * @version 1.0.0 - * @ingroup bluetooth - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Core Specification Assigned Numbers - * @defgroup bt_assigned_numbers_core Core Specification Assigned Numbers - * @ingroup bt_assigned_numbers - * @{ - */ - -/** - * @name Appearance Numbers - * - * Last Modified on 2023-01-05 - * @{ - */ - -/** Generic Unknown */ -#define BT_APPEARANCE_UNKNOWN 0x0000 -/** Generic Phone */ -#define BT_APPEARANCE_GENERIC_PHONE 0x0040 -/** Generic Computer */ -#define BT_APPEARANCE_GENERIC_COMPUTER 0x0080 -/** Desktop Workstation */ -#define BT_APPEARANCE_COMPUTER_DESKTOP_WORKSTATION 0x0081 -/** Server-class Computer */ -#define BT_APPEARANCE_COMPUTER_SERVER_CLASS 0x0082 -/** Laptop */ -#define BT_APPEARANCE_COMPUTER_LAPTOP 0x0083 -/** Handheld PC/PDA (clamshell) */ -#define BT_APPEARANCE_COMPUTER_HANDHELD_PCPDA 0x0084 -/** Palm­size PC/PDA */ -#define BT_APPEARANCE_COMPUTER_PALMSIZE_PCPDA 0x0085 -/** Wearable computer (watch size) */ -#define BT_APPEARANCE_COMPUTER_WEARABLE_COMPUTER 0x0086 -/** Tablet */ -#define BT_APPEARANCE_COMPUTER_TABLET 0x0087 -/** Docking Station */ -#define BT_APPEARANCE_COMPUTER_DOCKING_STATION 0x0088 -/** All in One */ -#define BT_APPEARANCE_COMPUTER_ALL_IN_ONE 0x0089 -/** Blade Server */ -#define BT_APPEARANCE_COMPUTER_BLADE_SERVER 0x008A -/** Convertible */ -#define BT_APPEARANCE_COMPUTER_CONVERTIBLE 0x008B -/** Detachable */ -#define BT_APPEARANCE_COMPUTER_DETACHABLE 0x008C -/** IoT Gateway */ -#define BT_APPEARANCE_COMPUTER_IOT_GATEWAY 0x008D -/** Mini PC */ -#define BT_APPEARANCE_COMPUTER_MINI_PC 0x008E -/** Stick PC */ -#define BT_APPEARANCE_COMPUTER_STICK_PC 0x008F -/** Generic Watch */ -#define BT_APPEARANCE_GENERIC_WATCH 0x00C0 -/** Sports Watch */ -#define BT_APPEARANCE_SPORTS_WATCH 0x00C1 -/** Smartwatch */ -#define BT_APPEARANCE_SMARTWATCH 0x00C2 -/** Generic Clock */ -#define BT_APPEARANCE_GENERIC_CLOCK 0x0100 -/** Generic Display */ -#define BT_APPEARANCE_GENERIC_DISPLAY 0x0140 -/** Generic Remote Control */ -#define BT_APPEARANCE_GENERIC_REMOTE 0x0180 -/** Generic Eye-glasses */ -#define BT_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 -/** Generic Tag */ -#define BT_APPEARANCE_GENERIC_TAG 0x0200 -/** Generic Keyring */ -#define BT_APPEARANCE_GENERIC_KEYRING 0x0240 -/** Generic Media Player */ -#define BT_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 -/** Generic Barcode Scanner */ -#define BT_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 -/** Generic Thermometer */ -#define BT_APPEARANCE_GENERIC_THERMOMETER 0x0300 -/** Ear Thermometer */ -#define BT_APPEARANCE_THERMOMETER_EAR 0x0301 -/** Generic Heart Rate Sensor */ -#define BT_APPEARANCE_GENERIC_HEART_RATE 0x0340 -/** Heart Rate Belt */ -#define BT_APPEARANCE_HEART_RATE_BELT 0x0341 -/** Generic Blood Pressure */ -#define BT_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 -/** Arm Blood Pressure */ -#define BT_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 -/** Wrist Blood Pressure */ -#define BT_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 -/** Generic Human Interface Device */ -#define BT_APPEARANCE_GENERIC_HID 0x03C0 -/** Keyboard */ -#define BT_APPEARANCE_HID_KEYBOARD 0x03C1 -/** Mouse */ -#define BT_APPEARANCE_HID_MOUSE 0x03C2 -/** Joystick */ -#define BT_APPEARANCE_HID_JOYSTICK 0x03C3 -/** Gamepad */ -#define BT_APPEARANCE_HID_GAMEPAD 0x03C4 -/** Digitizer Tablet */ -#define BT_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 -/** Card Reader */ -#define BT_APPEARANCE_HID_CARD_READER 0x03C6 -/** Digital Pen */ -#define BT_APPEARANCE_HID_DIGITAL_PEN 0x03C7 -/** Barcode Scanner */ -#define BT_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 -/** Touchpad */ -#define BT_APPEARANCE_HID_TOUCHPAD 0x03C9 -/** Presentation Remote */ -#define BT_APPEARANCE_HID_PRESENTATION_REMOTE 0x03CA -/** Generic Glucose Meter */ -#define BT_APPEARANCE_GENERIC_GLUCOSE 0x0400 -/** Generic Running Walking Sensor */ -#define BT_APPEARANCE_GENERIC_WALKING 0x0440 -/** In-Shoe Running Walking Sensor */ -#define BT_APPEARANCE_WALKING_IN_SHOE 0x0441 -/** On-Shoe Running Walking Sensor */ -#define BT_APPEARANCE_WALKING_ON_SHOE 0x0442 -/** On-Hip Running Walking Sensor */ -#define BT_APPEARANCE_WALKING_ON_HIP 0x0443 -/** Generic Cycling */ -#define BT_APPEARANCE_GENERIC_CYCLING 0x0480 -/** Cycling Computer */ -#define BT_APPEARANCE_CYCLING_COMPUTER 0x0481 -/** Speed Sensor */ -#define BT_APPEARANCE_CYCLING_SPEED 0x0482 -/** Cadence Sensor */ -#define BT_APPEARANCE_CYCLING_CADENCE 0x0483 -/** Power Sensor */ -#define BT_APPEARANCE_CYCLING_POWER 0x0484 -/** Speed and Cadence Sensor */ -#define BT_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 -/** Generic Control Device */ -#define BT_APPEARANCE_GENERIC_CONTROL_DEVICE 0x04C0 -/** Switch */ -#define BT_APPEARANCE_CONTROL_SWITCH 0x04C1 -/** Multi-switch */ -#define BT_APPEARANCE_CONTROL_MULTI_SWITCH 0x04C2 -/** Button */ -#define BT_APPEARANCE_CONTROL_BUTTON 0x04C3 -/** Slider */ -#define BT_APPEARANCE_CONTROL_SLIDER 0x04C4 -/** Rotary Switch */ -#define BT_APPEARANCE_CONTROL_ROTARY_SWITCH 0x04C5 -/** Touch Panel */ -#define BT_APPEARANCE_CONTROL_TOUCH_PANEL 0x04C6 -/** Single Switch */ -#define BT_APPEARANCE_CONTROL_SINGLE_SWITCH 0x04C7 -/** Double Switch */ -#define BT_APPEARANCE_CONTROL_DOUBLE_SWITCH 0x04C8 -/** Triple Switch */ -#define BT_APPEARANCE_CONTROL_TRIPLE_SWITCH 0x04C9 -/** Battery Switch */ -#define BT_APPEARANCE_CONTROL_BATTERY_SWITCH 0x04CA -/** Energy Harvesting Switch */ -#define BT_APPEARANCE_CONTROL_ENERGY_HARVESTING_SWITCH 0x04CB -/** Push Button */ -#define BT_APPEARANCE_CONTROL_PUSH_BUTTON 0x04CC -/** Generic Network Device */ -#define BT_APPEARANCE_GENERIC_NETWORK_DEVICE 0x0500 -/** Access Point */ -#define BT_APPEARANCE_NETWORK_ACCESS_POINT 0x0501 -/** Mesh Device */ -#define BT_APPEARANCE_NETWORK_MESH_DEVICE 0x0502 -/** Mesh Network Proxy */ -#define BT_APPEARANCE_NETWORK_MESH_PROXY 0x0503 -/** Generic Sensor */ -#define BT_APPEARANCE_GENERIC_SENSOR 0x0540 -/** Motion Sensor */ -#define BT_APPEARANCE_SENSOR_MOTION 0x0541 -/** Air quality Sensor */ -#define BT_APPEARANCE_SENSOR_AIR_QUALITY 0x0542 -/** Temperature Sensor */ -#define BT_APPEARANCE_SENSOR_TEMPERATURE 0x0543 -/** Humidity Sensor */ -#define BT_APPEARANCE_SENSOR_HUMIDITY 0x0544 -/** Leak Sensor */ -#define BT_APPEARANCE_SENSOR_LEAK 0x0545 -/** Smoke Sensor */ -#define BT_APPEARANCE_SENSOR_SMOKE 0x0546 -/** Occupancy Sensor */ -#define BT_APPEARANCE_SENSOR_OCCUPANCY 0x0547 -/** Contact Sensor */ -#define BT_APPEARANCE_SENSOR_CONTACT 0x0548 -/** Carbon Monoxide Sensor */ -#define BT_APPEARANCE_SENSOR_CARBON_MONOXIDE 0x0549 -/** Carbon Dioxide Sensor */ -#define BT_APPEARANCE_SENSOR_CARBON_DIOXIDE 0x054A -/** Ambient Light Sensor */ -#define BT_APPEARANCE_SENSOR_AMBIENT_LIGHT 0x054B -/** Energy Sensor */ -#define BT_APPEARANCE_SENSOR_ENERGY 0x054C -/** Color Light Sensor */ -#define BT_APPEARANCE_SENSOR_COLOR_LIGHT 0x054D -/** Rain Sensor */ -#define BT_APPEARANCE_SENSOR_RAIN 0x054E -/** Fire Sensor */ -#define BT_APPEARANCE_SENSOR_FIRE 0x054F -/** Wind Sensor */ -#define BT_APPEARANCE_SENSOR_WIND 0x0550 -/** Proximity Sensor */ -#define BT_APPEARANCE_SENSOR_PROXIMITY 0x0551 -/** Multi-Sensor */ -#define BT_APPEARANCE_SENSOR_MULTI 0x0552 -/** Flush Mounted Sensor */ -#define BT_APPEARANCE_SENSOR_FLUSH_MOUNTED 0x0553 -/** Ceiling Mounted Sensor */ -#define BT_APPEARANCE_SENSOR_CEILING_MOUNTED 0x0554 -/** Wall Mounted Sensor */ -#define BT_APPEARANCE_SENSOR_WALL_MOUNTED 0x0555 -/** Multisensor */ -#define BT_APPEARANCE_MULTISENSOR 0x0556 -/** Energy Meter */ -#define BT_APPEARANCE_SENSOR_ENERGY_METER 0x0557 -/** Flame Detector */ -#define BT_APPEARANCE_SENSOR_FLAME_DETECTOR 0x0558 -/** Vehicle Tire Pressure Sensor */ -#define BT_APPEARANCE_SENSOR_VEHICLE_TIRE_PRESSURE 0x0559 -/** Generic Light Fixtures */ -#define BT_APPEARANCE_GENERIC_LIGHT_FIXTURES 0x0580 -/** Wall Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_WALL 0x0581 -/** Ceiling Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_CEILING 0x0582 -/** Floor Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_FLOOR 0x0583 -/** Cabinet Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_CABINET 0x0584 -/** Desk Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_DESK 0x0585 -/** Troffer Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_TROFFER 0x0586 -/** Pendant Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_PENDANT 0x0587 -/** In-ground Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_IN_GROUND 0x0588 -/** Flood Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_FLOOD 0x0589 -/** Underwater Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_UNDERWATER 0x058A -/** Bollard with Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_BOLLARD_WITH 0x058B -/** Pathway Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_PATHWAY 0x058C -/** Garden Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_GARDEN 0x058D -/** Pole-top Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_POLE_TOP 0x058E -/** Spotlight */ -#define BT_APPEARANCE_SPOT_LIGHT 0x058F -/** Linear Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_LINEAR 0x0590 -/** Street Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_STREET 0x0591 -/** Shelves Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_SHELVES 0x0592 -/** Bay Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_BAY 0x0593 -/** Emergency Exit Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_EMERGENCY_EXIT 0x0594 -/** Light Controller */ -#define BT_APPEARANCE_LIGHT_FIXTURES_CONTROLLER 0x0595 -/** Light Driver */ -#define BT_APPEARANCE_LIGHT_FIXTURES_DRIVER 0x0596 -/** Bulb */ -#define BT_APPEARANCE_LIGHT_FIXTURES_BULB 0x0597 -/** Low-bay Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_LOW_BAY 0x0598 -/** High-bay Light */ -#define BT_APPEARANCE_LIGHT_FIXTURES_HIGH_BAY 0x0599 -/** Generic Fan */ -#define BT_APPEARANCE_GENERIC_FAN 0x05C0 -/** Ceiling Fan */ -#define BT_APPEARANCE_FAN_CEILING 0x05C1 -/** Axial Fan */ -#define BT_APPEARANCE_FAN_AXIAL 0x05C2 -/** Exhaust Fan */ -#define BT_APPEARANCE_FAN_EXHAUST 0x05C3 -/** Pedestal Fan */ -#define BT_APPEARANCE_FAN_PEDESTAL 0x05C4 -/** Desk Fan */ -#define BT_APPEARANCE_FAN_DESK 0x05C5 -/** Wall Fan */ -#define BT_APPEARANCE_FAN_WALL 0x05C6 -/** Generic HVAC */ -#define BT_APPEARANCE_GENERIC_HVAC 0x0600 -/** Thermostat */ -#define BT_APPEARANCE_HVAC_THERMOSTAT 0x0601 -/** Humidifier */ -#define BT_APPEARANCE_HVAC_HUMIDIFIER 0x0602 -/** De-humidifier */ -#define BT_APPEARANCE_HVAC_DEHUMIDIFIER 0x0603 -/** Heater */ -#define BT_APPEARANCE_HVAC_HEATER 0x0604 -/** Radiator */ -#define BT_APPEARANCE_HVAC_RADIATOR 0x0605 -/** Boiler */ -#define BT_APPEARANCE_HVAC_BOILER 0x0606 -/** Heat Pump */ -#define BT_APPEARANCE_HVAC_HEAT_PUMP 0x0607 -/** Infrared Heater */ -#define BT_APPEARANCE_HVAC_INFRARED_HEATER 0x0608 -/** Radiant Panel Heater */ -#define BT_APPEARANCE_HVAC_RADIANT_PANEL_HEATER 0x0609 -/** Fan Heater */ -#define BT_APPEARANCE_HVAC_FAN_HEATER 0x060A -/** Air Curtain */ -#define BT_APPEARANCE_HVAC_AIR_CURTAIN 0x060B -/** Generic Air Conditioning */ -#define BT_APPEARANCE_GENERIC_AIR_CONDITIONING 0x0640 -/** Generic Humidifier */ -#define BT_APPEARANCE_GENERIC_HUMIDIFIER 0x0680 -/** Generic Heating */ -#define BT_APPEARANCE_GENERIC_HEATING 0x06C0 -/** Radiator */ -#define BT_APPEARANCE_HEATING_RADIATOR 0x06C1 -/** Boiler */ -#define BT_APPEARANCE_HEATING_BOILER 0x06C2 -/** Heat Pump */ -#define BT_APPEARANCE_HEATING_HEAT_PUMP 0x06C3 -/** Infrared Heater */ -#define BT_APPEARANCE_HEATING_INFRARED_HEATER 0x06C4 -/** Radiant Panel Heater */ -#define BT_APPEARANCE_HEATING_RADIANT_PANEL_HEATER 0x06C5 -/** Fan Heater */ -#define BT_APPEARANCE_HEATING_FAN_HEATER 0x06C6 -/** Air Curtain */ -#define BT_APPEARANCE_HEATING_AIR_CURTAIN 0x06C7 -/** Generic Access Control */ -#define BT_APPEARANCE_GENERIC_ACCESS_CONTROL 0x0700 -/** Access Door */ -#define BT_APPEARANCE_CONTROL_ACCESS_DOOR 0x0701 -/** Garage Door */ -#define BT_APPEARANCE_CONTROL_GARAGE_DOOR 0x0702 -/** Emergency Exit Door */ -#define BT_APPEARANCE_CONTROL_EMERGENCY_EXIT_DOOR 0x0703 -/** Access Lock */ -#define BT_APPEARANCE_CONTROL_ACCESS_LOCK 0x0704 -/** Elevator */ -#define BT_APPEARANCE_CONTROL_ELEVATOR 0x0705 -/** Window */ -#define BT_APPEARANCE_CONTROL_WINDOW 0x0706 -/** Entrance Gate */ -#define BT_APPEARANCE_CONTROL_ENTRANCE_GATE 0x0707 -/** Door Lock */ -#define BT_APPEARANCE_CONTROL_DOOR_LOCK 0x0708 -/** Locker */ -#define BT_APPEARANCE_CONTROL_LOCKER 0x0709 -/** Generic Motorized Device */ -#define BT_APPEARANCE_GENERIC_MOTORIZED_DEVICE 0x0740 -/** Motorized Gate */ -#define BT_APPEARANCE_MOTORIZED_GATE 0x0741 -/** Awning */ -#define BT_APPEARANCE_MOTORIZED_AWNING 0x0742 -/** Blinds or Shades */ -#define BT_APPEARANCE_MOTORIZED_BLINDS_OR_SHADES 0x0743 -/** Curtains */ -#define BT_APPEARANCE_MOTORIZED_CURTAINS 0x0744 -/** Screen */ -#define BT_APPEARANCE_MOTORIZED_SCREEN 0x0745 -/** Generic Power Device */ -#define BT_APPEARANCE_GENERIC_POWER_DEVICE 0x0780 -/** Power Outlet */ -#define BT_APPEARANCE_POWER_OUTLET 0x0781 -/** Power Strip */ -#define BT_APPEARANCE_POWER_STRIP 0x0782 -/** Plug */ -#define BT_APPEARANCE_POWER_PLUG 0x0783 -/** Power Supply */ -#define BT_APPEARANCE_POWER_SUPPLY 0x0784 -/** LED Driver */ -#define BT_APPEARANCE_POWER_LED_DRIVER 0x0785 -/** Fluorescent Lamp Gear */ -#define BT_APPEARANCE_POWER_FLUORESCENT_LAMP_GEAR 0x0786 -/** HID Lamp Gear */ -#define BT_APPEARANCE_POWER_HID_LAMP_GEAR 0x0787 -/** Charge Case */ -#define BT_APPEARANCE_POWER_CHARGE_CASE 0x0788 -/** Power Bank */ -#define BT_APPEARANCE_POWER_POWER_BANK 0x0789 -/** Generic Light Source */ -#define BT_APPEARANCE_GENERIC_LIGHT_SOURCE 0x07C0 -/** Incandescent Light Bulb */ -#define BT_APPEARANCE_LIGHT_SOURCE_INCANDESCENT_BULB 0x07C1 -/** LED Lamp */ -#define BT_APPEARANCE_LIGHT_SOURCE_LED_LAMP 0x07C2 -/** HID Lamp */ -#define BT_APPEARANCE_LIGHT_SOURCE_HID_LAMP 0x07C3 -/** Fluorescent Lamp */ -#define BT_APPEARANCE_LIGHT_SOURCE_FLUORESCENT_LAMP 0x07C4 -/** LED Array */ -#define BT_APPEARANCE_LIGHT_SOURCE_LED_ARRAY 0x07C5 -/** Multi-Color LED Array */ -#define BT_APPEARANCE_LIGHT_SOURCE_MULTICOLOR_LED_ARRAY 0x07C6 -/** Low voltage halogen */ -#define BT_APPEARANCE_LIGHT_SOURCE_LOW_VOLTAGE_HALOGEN 0x07C7 -/** Organic light emitting diode */ -#define BT_APPEARANCE_LIGHT_SOURCE_OLED 0x07C8 -/** Generic Window Covering */ -#define BT_APPEARANCE_GENERIC_WINDOW_COVERING 0x0800 -/** Window Shades */ -#define BT_APPEARANCE_WINDOW_SHADES 0x0801 -/** Window Blinds */ -#define BT_APPEARANCE_WINDOW_BLINDS 0x0802 -/** Window Awning */ -#define BT_APPEARANCE_WINDOW_AWNING 0x0803 -/** Window Curtain */ -#define BT_APPEARANCE_WINDOW_CURTAIN 0x0804 -/** Exterior Shutter */ -#define BT_APPEARANCE_WINDOW_EXTERIOR_SHUTTER 0x0805 -/** Exterior Screen */ -#define BT_APPEARANCE_WINDOW_EXTERIOR_SCREEN 0x0806 -/** Generic Audio Sink */ -#define BT_APPEARANCE_GENERIC_AUDIO_SINK 0x0840 -/** Standalone Speaker */ -#define BT_APPEARANCE_AUDIO_SINK_STANDALONE_SPEAKER 0x0841 -/** Soundbar */ -#define BT_APPEARANCE_AUDIO_SINK_SOUNDBAR 0x0842 -/** Bookshelf Speaker */ -#define BT_APPEARANCE_AUDIO_SINK_BOOKSHELF_SPEAKER 0x0843 -/** Standmounted Speaker */ -#define BT_APPEARANCE_AUDIO_SINK_STANDMOUNTED_SPEAKER 0x0844 -/** Speakerphone */ -#define BT_APPEARANCE_AUDIO_SINK_SPEAKERPHONE 0x0845 -/** Generic Audio Source */ -#define BT_APPEARANCE_GENERIC_AUDIO_SOURCE 0x0880 -/** Microphone */ -#define BT_APPEARANCE_AUDIO_SOURCE_MICROPHONE 0x0881 -/** Alarm */ -#define BT_APPEARANCE_AUDIO_SOURCE_ALARM 0x0882 -/** Bell */ -#define BT_APPEARANCE_AUDIO_SOURCE_BELL 0x0883 -/** Horn */ -#define BT_APPEARANCE_AUDIO_SOURCE_HORN 0x0884 -/** Broadcasting Device */ -#define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_DEVICE 0x0885 -/** Service Desk */ -#define BT_APPEARANCE_AUDIO_SOURCE_SERVICE_DESK 0x0886 -/** Kiosk */ -#define BT_APPEARANCE_AUDIO_SOURCE_KIOSK 0x0887 -/** Broadcasting Room */ -#define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_ROOM 0x0888 -/** Auditorium */ -#define BT_APPEARANCE_AUDIO_SOURCE_AUDITORIUM 0x0889 -/** Generic Motorized Vehicle */ -#define BT_APPEARANCE_GENERIC_MOTORIZED_VEHICLE 0x08C0 -/** Car */ -#define BT_APPEARANCE_VEHICLE_CAR 0x08C1 -/** Large Goods Vehicle */ -#define BT_APPEARANCE_VEHICLE_LARGE_GOODS 0x08C2 -/** 2-Wheeled Vehicle */ -#define BT_APPEARANCE_VEHICLE_TWO_WHEELED 0x08C3 -/** Motorbike */ -#define BT_APPEARANCE_VEHICLE_MOTORBIKE 0x08C4 -/** Scooter */ -#define BT_APPEARANCE_VEHICLE_SCOOTER 0x08C5 -/** Moped */ -#define BT_APPEARANCE_VEHICLE_MOPED 0x08C6 -/** 3-Wheeled Vehicle */ -#define BT_APPEARANCE_VEHICLE_THREE_WHEELED 0x08C7 -/** Light Vehicle */ -#define BT_APPEARANCE_VEHICLE_LIGHT 0x08C8 -/** Quad Bike */ -#define BT_APPEARANCE_VEHICLE_QUAD_BIKE 0x08C9 -/** Minibus */ -#define BT_APPEARANCE_VEHICLE_MINIBUS 0x08CA -/** Bus */ -#define BT_APPEARANCE_VEHICLE_BUS 0x08CB -/** Trolley */ -#define BT_APPEARANCE_VEHICLE_TROLLEY 0x08CC -/** Agricultural Vehicle */ -#define BT_APPEARANCE_VEHICLE_AGRICULTURAL 0x08CD -/** Camper/Caravan */ -#define BT_APPEARANCE_VEHICLE_CAMPER_OR_CARAVAN 0x08CE -/** Recreational Vehicle/Motor Home */ -#define BT_APPEARANCE_VEHICLE_RECREATIONAL 0x08CF -/** Generic Domestic Appliance */ -#define BT_APPEARANCE_GENERIC_DOMESTIC_APPLIANCE 0x0900 -/** Refrigerator */ -#define BT_APPEARANCE_APPLIANCE_REFRIGERATOR 0x0901 -/** Freezer */ -#define BT_APPEARANCE_APPLIANCE_FREEZER 0x0902 -/** Oven */ -#define BT_APPEARANCE_APPLIANCE_OVEN 0x0903 -/** Microwave */ -#define BT_APPEARANCE_APPLIANCE_MICROWAVE 0x0904 -/** Toaster */ -#define BT_APPEARANCE_APPLIANCE_TOASTER 0x0905 -/** Washing Machine */ -#define BT_APPEARANCE_APPLIANCE_WASHING_MACHINE 0x0906 -/** Dryer */ -#define BT_APPEARANCE_APPLIANCE_DRYER 0x0907 -/** Coffee maker */ -#define BT_APPEARANCE_APPLIANCE_COFFEE_MAKER 0x0908 -/** Clothes iron */ -#define BT_APPEARANCE_APPLIANCE_CLOTHES_IRON 0x0909 -/** Curling iron */ -#define BT_APPEARANCE_APPLIANCE_CURLING_IRON 0x090A -/** Hair dryer */ -#define BT_APPEARANCE_APPLIANCE_HAIR_DRYER 0x090B -/** Vacuum cleaner */ -#define BT_APPEARANCE_APPLIANCE_VACUUM_CLEANER 0x090C -/** Robotic vacuum cleaner */ -#define BT_APPEARANCE_APPLIANCE_ROBOTIC_VACUUM_CLEANER 0x090D -/** Rice cooker */ -#define BT_APPEARANCE_APPLIANCE_RICE_COOKER 0x090E -/** Clothes steamer */ -#define BT_APPEARANCE_APPLIANCE_CLOTHES_STEAMER 0x090F -/** Generic Wearable Audio Device */ -#define BT_APPEARANCE_GENERIC_WEARABLE_AUDIO_DEVICE 0x0940 -/** Earbud */ -#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_EARBUD 0x0941 -/** Headset */ -#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADSET 0x0942 -/** Headphones */ -#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADPHONES 0x0943 -/** Neck Band */ -#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_NECK_BAND 0x0944 -/** Generic Aircraft */ -#define BT_APPEARANCE_GENERIC_AIRCRAFT 0x0980 -/** Light Aircraft */ -#define BT_APPEARANCE_AIRCRAFT_LIGHT 0x0981 -/** Microlight */ -#define BT_APPEARANCE_AIRCRAFT_MICROLIGHT 0x0982 -/** Paraglider */ -#define BT_APPEARANCE_AIRCRAFT_PARAGLIDER 0x0983 -/** Large Passenger Aircraft */ -#define BT_APPEARANCE_AIRCRAFT_LARGE_PASSENGER 0x0984 -/** Generic AV Equipment */ -#define BT_APPEARANCE_GENERIC_AV_EQUIPMENT 0x09C0 -/** Amplifier */ -#define BT_APPEARANCE_AV_EQUIPMENT_AMPLIFIER 0x09C1 -/** Receiver */ -#define BT_APPEARANCE_AV_EQUIPMENT_RECEIVER 0x09C2 -/** Radio */ -#define BT_APPEARANCE_AV_EQUIPMENT_RADIO 0x09C3 -/** Tuner */ -#define BT_APPEARANCE_AV_EQUIPMENT_TUNER 0x09C4 -/** Turntable */ -#define BT_APPEARANCE_AV_EQUIPMENT_TURNTABLE 0x09C5 -/** CD Player */ -#define BT_APPEARANCE_AV_EQUIPMENT_CD_PLAYER 0x09C6 -/** DVD Player */ -#define BT_APPEARANCE_AV_EQUIPMENT_DVD_PLAYER 0x09C7 -/** Bluray Player */ -#define BT_APPEARANCE_AV_EQUIPMENT_BLURAY_PLAYER 0x09C8 -/** Optical Disc Player */ -#define BT_APPEARANCE_AV_EQUIPMENT_OPTICAL_DISC_PLAYER 0x09C9 -/** Set-Top Box */ -#define BT_APPEARANCE_AV_EQUIPMENT_SET_TOP_BOX 0x09CA -/** Generic Display Equipment */ -#define BT_APPEARANCE_GENERIC_DISPLAY_EQUIPMENT 0x0A00 -/** Television */ -#define BT_APPEARANCE_DISPLAY_EQUIPMENT_TELEVISION 0x0A01 -/** Monitor */ -#define BT_APPEARANCE_DISPLAY_EQUIPMENT_MONITOR 0x0A02 -/** Projector */ -#define BT_APPEARANCE_DISPLAY_EQUIPMENT_PROJECTOR 0x0A03 -/** Generic Hearing aid */ -#define BT_APPEARANCE_GENERIC_HEARING_AID 0x0A40 -/** In-ear hearing aid */ -#define BT_APPEARANCE_HEARING_AID_IN_EAR 0x0A41 -/** Behind-ear hearing aid */ -#define BT_APPEARANCE_HEARING_AID_BEHIND_EAR 0x0A42 -/** Cochlear Implant */ -#define BT_APPEARANCE_HEARING_AID_COCHLEAR_IMPLANT 0x0A43 -/** Generic Gaming */ -#define BT_APPEARANCE_GENERIC_GAMING 0x0A80 -/** Home Video Game Console */ -#define BT_APPEARANCE_HOME_VIDEO_GAME_CONSOLE 0x0A81 -/** Portable handheld console */ -#define BT_APPEARANCE_PORTABLE_HANDHELD_CONSOLE 0x0A82 -/** Generic Signage */ -#define BT_APPEARANCE_GENERIC_SIGNAGE 0x0AC0 -/** Digital Signage */ -#define BT_APPEARANCE_SIGNAGE_DIGITAL 0x0AC1 -/** Electronic Label */ -#define BT_APPEARANCE_SIGNAGE_ELECTRONIC_LABEL 0x0AC2 -/** Generic Pulse Oximeter */ -#define BT_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 -/** Fingertip Pulse Oximeter */ -#define BT_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 -/** Wrist Worn Pulse Oximeter */ -#define BT_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 -/** Generic Weight Scale */ -#define BT_APPEARANCE_GENERIC_WEIGHT_SCALE 0x0C80 -/** Generic Personal Mobility Device */ -#define BT_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 -/** Powered Wheelchair */ -#define BT_APPEARANCE_MOBILITY_POWERED_WHEELCHAIR 0x0CC1 -/** Mobility Scooter */ -#define BT_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 -/** Continuous Glucose Monitor */ -#define BT_APPEARANCE_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 -/** Generic Insulin Pump */ -#define BT_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 -/** Insulin Pump, durable pump */ -#define BT_APPEARANCE_INSULIN_PUMP_DURABLE 0x0D41 -/** Insulin Pump, patch pump */ -#define BT_APPEARANCE_INSULIN_PUMP_PATCH 0x0D44 -/** Insulin Pen */ -#define BT_APPEARANCE_INSULIN_PEN 0x0D48 -/** Generic Medication Delivery */ -#define BT_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 -/** Generic Spirometer */ -#define BT_APPEARANCE_GENERIC_SPIROMETER 0x0DC0 -/** Handheld Spirometer */ -#define BT_APPEARANCE_SPIROMETER_HANDHELD 0x0DC1 -/** Generic Outdoor Sports Activity */ -#define BT_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 -/** Location Display */ -#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 -/** Location and Navigation Display */ -#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 -/** Location Pod */ -#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 -/** Location and Navigation Pod */ -#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 - -/** @} */ /* end of @name Appearance Numbers */ - -/** - * @name Common Data Types - * @{ - */ -#define BT_DATA_FLAGS 0x01 /**< AD flags */ -#define BT_DATA_UUID16_SOME 0x02 /**< 16-bit UUID, more available */ -#define BT_DATA_UUID16_ALL 0x03 /**< 16-bit UUID, all listed */ -#define BT_DATA_UUID32_SOME 0x04 /**< 32-bit UUID, more available */ -#define BT_DATA_UUID32_ALL 0x05 /**< 32-bit UUID, all listed */ -#define BT_DATA_UUID128_SOME 0x06 /**< 128-bit UUID, more available */ -#define BT_DATA_UUID128_ALL 0x07 /**< 128-bit UUID, all listed */ -#define BT_DATA_NAME_SHORTENED 0x08 /**< Shortened name */ -#define BT_DATA_NAME_COMPLETE 0x09 /**< Complete name */ -#define BT_DATA_TX_POWER 0x0a /**< Tx Power */ -#define BT_DATA_DEVICE_CLASS 0x0d /**< Class of Device */ -#define BT_DATA_SIMPLE_PAIRING_HASH_C192 0x0e /**< Simple Pairing Hash C-192 */ -#define BT_DATA_SIMPLE_PAIRING_RAND_C192 0x0f /**< Simple Pairing Randomizer R-192 */ -#define BT_DATA_DEVICE_ID 0x10 /**< Device ID (Profile) */ -#define BT_DATA_SM_TK_VALUE 0x10 /**< Security Manager TK Value */ -#define BT_DATA_SM_OOB_FLAGS 0x11 /**< Security Manager OOB Flags */ -#define BT_DATA_PERIPHERAL_INT_RANGE 0x12 /**< Peripheral Connection Interval Range */ -#define BT_DATA_SOLICIT16 0x14 /**< Solicit UUIDs, 16-bit */ -#define BT_DATA_SOLICIT128 0x15 /**< Solicit UUIDs, 128-bit */ -#define BT_DATA_SVC_DATA16 0x16 /**< Service data, 16-bit UUID */ -#define BT_DATA_PUB_TARGET_ADDR 0x17 /**< Public Target Address */ -#define BT_DATA_RAND_TARGET_ADDR 0x18 /**< Random Target Address */ -#define BT_DATA_GAP_APPEARANCE 0x19 /**< GAP appearance */ -#define BT_DATA_ADV_INT 0x1a /**< Advertising Interval */ -#define BT_DATA_LE_BT_DEVICE_ADDRESS 0x1b /**< LE Bluetooth Device Address */ -#define BT_DATA_LE_ROLE 0x1c /**< LE Role */ -#define BT_DATA_SIMPLE_PAIRING_HASH 0x1d /**< Simple Pairing Hash C256 */ -#define BT_DATA_SIMPLE_PAIRING_RAND 0x1e /**< Simple Pairing Randomizer R256 */ -#define BT_DATA_SOLICIT32 0x1f /**< Solicit UUIDs, 32-bit */ -#define BT_DATA_SVC_DATA32 0x20 /**< Service data, 32-bit UUID */ -#define BT_DATA_SVC_DATA128 0x21 /**< Service data, 128-bit UUID */ -#define BT_DATA_LE_SC_CONFIRM_VALUE 0x22 /**< LE SC Confirmation Value */ -#define BT_DATA_LE_SC_RANDOM_VALUE 0x23 /**< LE SC Random Value */ -#define BT_DATA_URI 0x24 /**< URI */ -#define BT_DATA_INDOOR_POS 0x25 /**< Indoor Positioning */ -#define BT_DATA_TRANS_DISCOVER_DATA 0x26 /**< Transport Discovery Data */ -#define BT_DATA_LE_SUPPORTED_FEATURES 0x27 /**< LE Supported Features */ -#define BT_DATA_CHANNEL_MAP_UPDATE_IND 0x28 /**< Channel Map Update Indication */ -#define BT_DATA_MESH_PROV 0x29 /**< Mesh Provisioning PDU */ -#define BT_DATA_MESH_MESSAGE 0x2a /**< Mesh Networking PDU */ -#define BT_DATA_MESH_BEACON 0x2b /**< Mesh Beacon */ -#define BT_DATA_BIG_INFO 0x2c /**< BIGInfo */ -#define BT_DATA_BROADCAST_CODE 0x2d /**< Broadcast Code */ -#define BT_DATA_CSIS_RSI 0x2e /**< CSIS Random Set ID type */ -#define BT_DATA_ADV_INT_LONG 0x2f /**< Advertising Interval long */ -#define BT_DATA_BROADCAST_NAME 0x30 /**< Broadcast Name */ -#define BT_DATA_ENCRYPTED_AD_DATA 0x31 /**< Encrypted Advertising Data */ -#define BT_DATA_PAWR_TIMING_INFO 0x32 /**< Periodic Advertising Response Timing Info */ -#define BT_DATA_ESL 0x34 /**< Electronic Shelf Label Profile */ -#define BT_DATA_3D_INFO 0x3D /**< 3D Information Data */ - -#define BT_DATA_MANUFACTURER_DATA 0xff /**< Manufacturer Specific Data */ - -/** @} */ /* end of @name Common Data Types */ - -/** - * @name Flags data type values - * @{ - */ - -#define BT_LE_AD_LIMITED 0x01 /**< Limited Discoverable */ -#define BT_LE_AD_GENERAL 0x02 /**< General Discoverable */ -#define BT_LE_AD_NO_BREDR 0x04 /**< BR/EDR not supported */ - -/** @} */ /* end of @name Flags data type values */ -/** @} */ /* end of bt_assigned_numbers_core */ - -/** - * @name Company Identifiers (see Bluetooth Assigned Numbers) - * @{ - */ - -#define BT_COMP_ID_LF 0x05f1 /**< The Linux Foundation */ - -/** @} */ /* end of @name Company Identifiers */ - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* ZEPHYR_INCLUDE_BLUETOOTH_ASSIGNED_NUMBERS_H_ */ diff --git a/include/zephyr/bluetooth/gap.h b/include/zephyr/bluetooth/gap.h index b446ad521d4c..a6ca5d0ebdc7 100644 --- a/include/zephyr/bluetooth/gap.h +++ b/include/zephyr/bluetooth/gap.h @@ -11,7 +11,6 @@ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_ #define ZEPHYR_INCLUDE_BLUETOOTH_GAP_H_ -#include #include #include @@ -35,6 +34,682 @@ extern "C" { * @} */ +/** + * @name EIR/AD data type definitions + * @{ + */ +#define BT_DATA_FLAGS 0x01 /**< AD flags */ +#define BT_DATA_UUID16_SOME 0x02 /**< 16-bit UUID, more available */ +#define BT_DATA_UUID16_ALL 0x03 /**< 16-bit UUID, all listed */ +#define BT_DATA_UUID32_SOME 0x04 /**< 32-bit UUID, more available */ +#define BT_DATA_UUID32_ALL 0x05 /**< 32-bit UUID, all listed */ +#define BT_DATA_UUID128_SOME 0x06 /**< 128-bit UUID, more available */ +#define BT_DATA_UUID128_ALL 0x07 /**< 128-bit UUID, all listed */ +#define BT_DATA_NAME_SHORTENED 0x08 /**< Shortened name */ +#define BT_DATA_NAME_COMPLETE 0x09 /**< Complete name */ +#define BT_DATA_TX_POWER 0x0a /**< Tx Power */ +#define BT_DATA_DEVICE_CLASS 0x0d /**< Class of Device */ +#define BT_DATA_SIMPLE_PAIRING_HASH_C192 0x0e /**< Simple Pairing Hash C-192 */ +#define BT_DATA_SIMPLE_PAIRING_RAND_C192 0x0f /**< Simple Pairing Randomizer R-192 */ +#define BT_DATA_DEVICE_ID 0x10 /**< Device ID (Profile) */ +#define BT_DATA_SM_TK_VALUE 0x10 /**< Security Manager TK Value */ +#define BT_DATA_SM_OOB_FLAGS 0x11 /**< Security Manager OOB Flags */ +#define BT_DATA_PERIPHERAL_INT_RANGE 0x12 /**< Peripheral Connection Interval Range */ +#define BT_DATA_SOLICIT16 0x14 /**< Solicit UUIDs, 16-bit */ +#define BT_DATA_SOLICIT128 0x15 /**< Solicit UUIDs, 128-bit */ +#define BT_DATA_SVC_DATA16 0x16 /**< Service data, 16-bit UUID */ +#define BT_DATA_PUB_TARGET_ADDR 0x17 /**< Public Target Address */ +#define BT_DATA_RAND_TARGET_ADDR 0x18 /**< Random Target Address */ +#define BT_DATA_GAP_APPEARANCE 0x19 /**< GAP appearance */ +#define BT_DATA_ADV_INT 0x1a /**< Advertising Interval */ +#define BT_DATA_LE_BT_DEVICE_ADDRESS 0x1b /**< LE Bluetooth Device Address */ +#define BT_DATA_LE_ROLE 0x1c /**< LE Role */ +#define BT_DATA_SIMPLE_PAIRING_HASH 0x1d /**< Simple Pairing Hash C256 */ +#define BT_DATA_SIMPLE_PAIRING_RAND 0x1e /**< Simple Pairing Randomizer R256 */ +#define BT_DATA_SOLICIT32 0x1f /**< Solicit UUIDs, 32-bit */ +#define BT_DATA_SVC_DATA32 0x20 /**< Service data, 32-bit UUID */ +#define BT_DATA_SVC_DATA128 0x21 /**< Service data, 128-bit UUID */ +#define BT_DATA_LE_SC_CONFIRM_VALUE 0x22 /**< LE SC Confirmation Value */ +#define BT_DATA_LE_SC_RANDOM_VALUE 0x23 /**< LE SC Random Value */ +#define BT_DATA_URI 0x24 /**< URI */ +#define BT_DATA_INDOOR_POS 0x25 /**< Indoor Positioning */ +#define BT_DATA_TRANS_DISCOVER_DATA 0x26 /**< Transport Discovery Data */ +#define BT_DATA_LE_SUPPORTED_FEATURES 0x27 /**< LE Supported Features */ +#define BT_DATA_CHANNEL_MAP_UPDATE_IND 0x28 /**< Channel Map Update Indication */ +#define BT_DATA_MESH_PROV 0x29 /**< Mesh Provisioning PDU */ +#define BT_DATA_MESH_MESSAGE 0x2a /**< Mesh Networking PDU */ +#define BT_DATA_MESH_BEACON 0x2b /**< Mesh Beacon */ +#define BT_DATA_BIG_INFO 0x2c /**< BIGInfo */ +#define BT_DATA_BROADCAST_CODE 0x2d /**< Broadcast Code */ +#define BT_DATA_CSIS_RSI 0x2e /**< CSIS Random Set ID type */ +#define BT_DATA_ADV_INT_LONG 0x2f /**< Advertising Interval long */ +#define BT_DATA_BROADCAST_NAME 0x30 /**< Broadcast Name */ +#define BT_DATA_ENCRYPTED_AD_DATA 0x31 /**< Encrypted Advertising Data */ +#define BT_DATA_PAWR_TIMING_INFO 0x32 /**< Periodic Advertising Response Timing Info */ +#define BT_DATA_ESL 0x34 /**< Electronic Shelf Label Profile */ +#define BT_DATA_3D_INFO 0x3D /**< 3D Information Data */ + +#define BT_DATA_MANUFACTURER_DATA 0xff /**< Manufacturer Specific Data */ + +#define BT_LE_AD_LIMITED 0x01 /**< Limited Discoverable */ +#define BT_LE_AD_GENERAL 0x02 /**< General Discoverable */ +#define BT_LE_AD_NO_BREDR 0x04 /**< BR/EDR not supported */ +/** + * @} + */ + +/** + * @name Appearance Values + * + * Last Modified on 2023-01-05 + * @{ + */ +/** Generic Unknown */ +#define BT_APPEARANCE_UNKNOWN 0x0000 +/** Generic Phone */ +#define BT_APPEARANCE_GENERIC_PHONE 0x0040 +/** Generic Computer */ +#define BT_APPEARANCE_GENERIC_COMPUTER 0x0080 +/** Desktop Workstation */ +#define BT_APPEARANCE_COMPUTER_DESKTOP_WORKSTATION 0x0081 +/** Server-class Computer */ +#define BT_APPEARANCE_COMPUTER_SERVER_CLASS 0x0082 +/** Laptop */ +#define BT_APPEARANCE_COMPUTER_LAPTOP 0x0083 +/** Handheld PC/PDA (clamshell) */ +#define BT_APPEARANCE_COMPUTER_HANDHELD_PCPDA 0x0084 +/** Palm­size PC/PDA */ +#define BT_APPEARANCE_COMPUTER_PALMSIZE_PCPDA 0x0085 +/** Wearable computer (watch size) */ +#define BT_APPEARANCE_COMPUTER_WEARABLE_COMPUTER 0x0086 +/** Tablet */ +#define BT_APPEARANCE_COMPUTER_TABLET 0x0087 +/** Docking Station */ +#define BT_APPEARANCE_COMPUTER_DOCKING_STATION 0x0088 +/** All in One */ +#define BT_APPEARANCE_COMPUTER_ALL_IN_ONE 0x0089 +/** Blade Server */ +#define BT_APPEARANCE_COMPUTER_BLADE_SERVER 0x008A +/** Convertible */ +#define BT_APPEARANCE_COMPUTER_CONVERTIBLE 0x008B +/** Detachable */ +#define BT_APPEARANCE_COMPUTER_DETACHABLE 0x008C +/** IoT Gateway */ +#define BT_APPEARANCE_COMPUTER_IOT_GATEWAY 0x008D +/** Mini PC */ +#define BT_APPEARANCE_COMPUTER_MINI_PC 0x008E +/** Stick PC */ +#define BT_APPEARANCE_COMPUTER_STICK_PC 0x008F +/** Generic Watch */ +#define BT_APPEARANCE_GENERIC_WATCH 0x00C0 +/** Sports Watch */ +#define BT_APPEARANCE_SPORTS_WATCH 0x00C1 +/** Smartwatch */ +#define BT_APPEARANCE_SMARTWATCH 0x00C2 +/** Generic Clock */ +#define BT_APPEARANCE_GENERIC_CLOCK 0x0100 +/** Generic Display */ +#define BT_APPEARANCE_GENERIC_DISPLAY 0x0140 +/** Generic Remote Control */ +#define BT_APPEARANCE_GENERIC_REMOTE 0x0180 +/** Generic Eye-glasses */ +#define BT_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 +/** Generic Tag */ +#define BT_APPEARANCE_GENERIC_TAG 0x0200 +/** Generic Keyring */ +#define BT_APPEARANCE_GENERIC_KEYRING 0x0240 +/** Generic Media Player */ +#define BT_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 +/** Generic Barcode Scanner */ +#define BT_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 +/** Generic Thermometer */ +#define BT_APPEARANCE_GENERIC_THERMOMETER 0x0300 +/** Ear Thermometer */ +#define BT_APPEARANCE_THERMOMETER_EAR 0x0301 +/** Generic Heart Rate Sensor */ +#define BT_APPEARANCE_GENERIC_HEART_RATE 0x0340 +/** Heart Rate Belt */ +#define BT_APPEARANCE_HEART_RATE_BELT 0x0341 +/** Generic Blood Pressure */ +#define BT_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 +/** Arm Blood Pressure */ +#define BT_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 +/** Wrist Blood Pressure */ +#define BT_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 +/** Generic Human Interface Device */ +#define BT_APPEARANCE_GENERIC_HID 0x03C0 +/** Keyboard */ +#define BT_APPEARANCE_HID_KEYBOARD 0x03C1 +/** Mouse */ +#define BT_APPEARANCE_HID_MOUSE 0x03C2 +/** Joystick */ +#define BT_APPEARANCE_HID_JOYSTICK 0x03C3 +/** Gamepad */ +#define BT_APPEARANCE_HID_GAMEPAD 0x03C4 +/** Digitizer Tablet */ +#define BT_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 +/** Card Reader */ +#define BT_APPEARANCE_HID_CARD_READER 0x03C6 +/** Digital Pen */ +#define BT_APPEARANCE_HID_DIGITAL_PEN 0x03C7 +/** Barcode Scanner */ +#define BT_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 +/** Touchpad */ +#define BT_APPEARANCE_HID_TOUCHPAD 0x03C9 +/** Presentation Remote */ +#define BT_APPEARANCE_HID_PRESENTATION_REMOTE 0x03CA +/** Generic Glucose Meter */ +#define BT_APPEARANCE_GENERIC_GLUCOSE 0x0400 +/** Generic Running Walking Sensor */ +#define BT_APPEARANCE_GENERIC_WALKING 0x0440 +/** In-Shoe Running Walking Sensor */ +#define BT_APPEARANCE_WALKING_IN_SHOE 0x0441 +/** On-Shoe Running Walking Sensor */ +#define BT_APPEARANCE_WALKING_ON_SHOE 0x0442 +/** On-Hip Running Walking Sensor */ +#define BT_APPEARANCE_WALKING_ON_HIP 0x0443 +/** Generic Cycling */ +#define BT_APPEARANCE_GENERIC_CYCLING 0x0480 +/** Cycling Computer */ +#define BT_APPEARANCE_CYCLING_COMPUTER 0x0481 +/** Speed Sensor */ +#define BT_APPEARANCE_CYCLING_SPEED 0x0482 +/** Cadence Sensor */ +#define BT_APPEARANCE_CYCLING_CADENCE 0x0483 +/** Power Sensor */ +#define BT_APPEARANCE_CYCLING_POWER 0x0484 +/** Speed and Cadence Sensor */ +#define BT_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 +/** Generic Control Device */ +#define BT_APPEARANCE_GENERIC_CONTROL_DEVICE 0x04C0 +/** Switch */ +#define BT_APPEARANCE_CONTROL_SWITCH 0x04C1 +/** Multi-switch */ +#define BT_APPEARANCE_CONTROL_MULTI_SWITCH 0x04C2 +/** Button */ +#define BT_APPEARANCE_CONTROL_BUTTON 0x04C3 +/** Slider */ +#define BT_APPEARANCE_CONTROL_SLIDER 0x04C4 +/** Rotary Switch */ +#define BT_APPEARANCE_CONTROL_ROTARY_SWITCH 0x04C5 +/** Touch Panel */ +#define BT_APPEARANCE_CONTROL_TOUCH_PANEL 0x04C6 +/** Single Switch */ +#define BT_APPEARANCE_CONTROL_SINGLE_SWITCH 0x04C7 +/** Double Switch */ +#define BT_APPEARANCE_CONTROL_DOUBLE_SWITCH 0x04C8 +/** Triple Switch */ +#define BT_APPEARANCE_CONTROL_TRIPLE_SWITCH 0x04C9 +/** Battery Switch */ +#define BT_APPEARANCE_CONTROL_BATTERY_SWITCH 0x04CA +/** Energy Harvesting Switch */ +#define BT_APPEARANCE_CONTROL_ENERGY_HARVESTING_SWITCH 0x04CB +/** Push Button */ +#define BT_APPEARANCE_CONTROL_PUSH_BUTTON 0x04CC +/** Generic Network Device */ +#define BT_APPEARANCE_GENERIC_NETWORK_DEVICE 0x0500 +/** Access Point */ +#define BT_APPEARANCE_NETWORK_ACCESS_POINT 0x0501 +/** Mesh Device */ +#define BT_APPEARANCE_NETWORK_MESH_DEVICE 0x0502 +/** Mesh Network Proxy */ +#define BT_APPEARANCE_NETWORK_MESH_PROXY 0x0503 +/** Generic Sensor */ +#define BT_APPEARANCE_GENERIC_SENSOR 0x0540 +/** Motion Sensor */ +#define BT_APPEARANCE_SENSOR_MOTION 0x0541 +/** Air quality Sensor */ +#define BT_APPEARANCE_SENSOR_AIR_QUALITY 0x0542 +/** Temperature Sensor */ +#define BT_APPEARANCE_SENSOR_TEMPERATURE 0x0543 +/** Humidity Sensor */ +#define BT_APPEARANCE_SENSOR_HUMIDITY 0x0544 +/** Leak Sensor */ +#define BT_APPEARANCE_SENSOR_LEAK 0x0545 +/** Smoke Sensor */ +#define BT_APPEARANCE_SENSOR_SMOKE 0x0546 +/** Occupancy Sensor */ +#define BT_APPEARANCE_SENSOR_OCCUPANCY 0x0547 +/** Contact Sensor */ +#define BT_APPEARANCE_SENSOR_CONTACT 0x0548 +/** Carbon Monoxide Sensor */ +#define BT_APPEARANCE_SENSOR_CARBON_MONOXIDE 0x0549 +/** Carbon Dioxide Sensor */ +#define BT_APPEARANCE_SENSOR_CARBON_DIOXIDE 0x054A +/** Ambient Light Sensor */ +#define BT_APPEARANCE_SENSOR_AMBIENT_LIGHT 0x054B +/** Energy Sensor */ +#define BT_APPEARANCE_SENSOR_ENERGY 0x054C +/** Color Light Sensor */ +#define BT_APPEARANCE_SENSOR_COLOR_LIGHT 0x054D +/** Rain Sensor */ +#define BT_APPEARANCE_SENSOR_RAIN 0x054E +/** Fire Sensor */ +#define BT_APPEARANCE_SENSOR_FIRE 0x054F +/** Wind Sensor */ +#define BT_APPEARANCE_SENSOR_WIND 0x0550 +/** Proximity Sensor */ +#define BT_APPEARANCE_SENSOR_PROXIMITY 0x0551 +/** Multi-Sensor */ +#define BT_APPEARANCE_SENSOR_MULTI 0x0552 +/** Flush Mounted Sensor */ +#define BT_APPEARANCE_SENSOR_FLUSH_MOUNTED 0x0553 +/** Ceiling Mounted Sensor */ +#define BT_APPEARANCE_SENSOR_CEILING_MOUNTED 0x0554 +/** Wall Mounted Sensor */ +#define BT_APPEARANCE_SENSOR_WALL_MOUNTED 0x0555 +/** Multisensor */ +#define BT_APPEARANCE_MULTISENSOR 0x0556 +/** Energy Meter */ +#define BT_APPEARANCE_SENSOR_ENERGY_METER 0x0557 +/** Flame Detector */ +#define BT_APPEARANCE_SENSOR_FLAME_DETECTOR 0x0558 +/** Vehicle Tire Pressure Sensor */ +#define BT_APPEARANCE_SENSOR_VEHICLE_TIRE_PRESSURE 0x0559 +/** Generic Light Fixtures */ +#define BT_APPEARANCE_GENERIC_LIGHT_FIXTURES 0x0580 +/** Wall Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_WALL 0x0581 +/** Ceiling Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_CEILING 0x0582 +/** Floor Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_FLOOR 0x0583 +/** Cabinet Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_CABINET 0x0584 +/** Desk Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_DESK 0x0585 +/** Troffer Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_TROFFER 0x0586 +/** Pendant Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_PENDANT 0x0587 +/** In-ground Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_IN_GROUND 0x0588 +/** Flood Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_FLOOD 0x0589 +/** Underwater Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_UNDERWATER 0x058A +/** Bollard with Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_BOLLARD_WITH 0x058B +/** Pathway Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_PATHWAY 0x058C +/** Garden Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_GARDEN 0x058D +/** Pole-top Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_POLE_TOP 0x058E +/** Spotlight */ +#define BT_APPEARANCE_SPOT_LIGHT 0x058F +/** Linear Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_LINEAR 0x0590 +/** Street Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_STREET 0x0591 +/** Shelves Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_SHELVES 0x0592 +/** Bay Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_BAY 0x0593 +/** Emergency Exit Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_EMERGENCY_EXIT 0x0594 +/** Light Controller */ +#define BT_APPEARANCE_LIGHT_FIXTURES_CONTROLLER 0x0595 +/** Light Driver */ +#define BT_APPEARANCE_LIGHT_FIXTURES_DRIVER 0x0596 +/** Bulb */ +#define BT_APPEARANCE_LIGHT_FIXTURES_BULB 0x0597 +/** Low-bay Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_LOW_BAY 0x0598 +/** High-bay Light */ +#define BT_APPEARANCE_LIGHT_FIXTURES_HIGH_BAY 0x0599 +/** Generic Fan */ +#define BT_APPEARANCE_GENERIC_FAN 0x05C0 +/** Ceiling Fan */ +#define BT_APPEARANCE_FAN_CEILING 0x05C1 +/** Axial Fan */ +#define BT_APPEARANCE_FAN_AXIAL 0x05C2 +/** Exhaust Fan */ +#define BT_APPEARANCE_FAN_EXHAUST 0x05C3 +/** Pedestal Fan */ +#define BT_APPEARANCE_FAN_PEDESTAL 0x05C4 +/** Desk Fan */ +#define BT_APPEARANCE_FAN_DESK 0x05C5 +/** Wall Fan */ +#define BT_APPEARANCE_FAN_WALL 0x05C6 +/** Generic HVAC */ +#define BT_APPEARANCE_GENERIC_HVAC 0x0600 +/** Thermostat */ +#define BT_APPEARANCE_HVAC_THERMOSTAT 0x0601 +/** Humidifier */ +#define BT_APPEARANCE_HVAC_HUMIDIFIER 0x0602 +/** De-humidifier */ +#define BT_APPEARANCE_HVAC_DEHUMIDIFIER 0x0603 +/** Heater */ +#define BT_APPEARANCE_HVAC_HEATER 0x0604 +/** Radiator */ +#define BT_APPEARANCE_HVAC_RADIATOR 0x0605 +/** Boiler */ +#define BT_APPEARANCE_HVAC_BOILER 0x0606 +/** Heat Pump */ +#define BT_APPEARANCE_HVAC_HEAT_PUMP 0x0607 +/** Infrared Heater */ +#define BT_APPEARANCE_HVAC_INFRARED_HEATER 0x0608 +/** Radiant Panel Heater */ +#define BT_APPEARANCE_HVAC_RADIANT_PANEL_HEATER 0x0609 +/** Fan Heater */ +#define BT_APPEARANCE_HVAC_FAN_HEATER 0x060A +/** Air Curtain */ +#define BT_APPEARANCE_HVAC_AIR_CURTAIN 0x060B +/** Generic Air Conditioning */ +#define BT_APPEARANCE_GENERIC_AIR_CONDITIONING 0x0640 +/** Generic Humidifier */ +#define BT_APPEARANCE_GENERIC_HUMIDIFIER 0x0680 +/** Generic Heating */ +#define BT_APPEARANCE_GENERIC_HEATING 0x06C0 +/** Radiator */ +#define BT_APPEARANCE_HEATING_RADIATOR 0x06C1 +/** Boiler */ +#define BT_APPEARANCE_HEATING_BOILER 0x06C2 +/** Heat Pump */ +#define BT_APPEARANCE_HEATING_HEAT_PUMP 0x06C3 +/** Infrared Heater */ +#define BT_APPEARANCE_HEATING_INFRARED_HEATER 0x06C4 +/** Radiant Panel Heater */ +#define BT_APPEARANCE_HEATING_RADIANT_PANEL_HEATER 0x06C5 +/** Fan Heater */ +#define BT_APPEARANCE_HEATING_FAN_HEATER 0x06C6 +/** Air Curtain */ +#define BT_APPEARANCE_HEATING_AIR_CURTAIN 0x06C7 +/** Generic Access Control */ +#define BT_APPEARANCE_GENERIC_ACCESS_CONTROL 0x0700 +/** Access Door */ +#define BT_APPEARANCE_CONTROL_ACCESS_DOOR 0x0701 +/** Garage Door */ +#define BT_APPEARANCE_CONTROL_GARAGE_DOOR 0x0702 +/** Emergency Exit Door */ +#define BT_APPEARANCE_CONTROL_EMERGENCY_EXIT_DOOR 0x0703 +/** Access Lock */ +#define BT_APPEARANCE_CONTROL_ACCESS_LOCK 0x0704 +/** Elevator */ +#define BT_APPEARANCE_CONTROL_ELEVATOR 0x0705 +/** Window */ +#define BT_APPEARANCE_CONTROL_WINDOW 0x0706 +/** Entrance Gate */ +#define BT_APPEARANCE_CONTROL_ENTRANCE_GATE 0x0707 +/** Door Lock */ +#define BT_APPEARANCE_CONTROL_DOOR_LOCK 0x0708 +/** Locker */ +#define BT_APPEARANCE_CONTROL_LOCKER 0x0709 +/** Generic Motorized Device */ +#define BT_APPEARANCE_GENERIC_MOTORIZED_DEVICE 0x0740 +/** Motorized Gate */ +#define BT_APPEARANCE_MOTORIZED_GATE 0x0741 +/** Awning */ +#define BT_APPEARANCE_MOTORIZED_AWNING 0x0742 +/** Blinds or Shades */ +#define BT_APPEARANCE_MOTORIZED_BLINDS_OR_SHADES 0x0743 +/** Curtains */ +#define BT_APPEARANCE_MOTORIZED_CURTAINS 0x0744 +/** Screen */ +#define BT_APPEARANCE_MOTORIZED_SCREEN 0x0745 +/** Generic Power Device */ +#define BT_APPEARANCE_GENERIC_POWER_DEVICE 0x0780 +/** Power Outlet */ +#define BT_APPEARANCE_POWER_OUTLET 0x0781 +/** Power Strip */ +#define BT_APPEARANCE_POWER_STRIP 0x0782 +/** Plug */ +#define BT_APPEARANCE_POWER_PLUG 0x0783 +/** Power Supply */ +#define BT_APPEARANCE_POWER_SUPPLY 0x0784 +/** LED Driver */ +#define BT_APPEARANCE_POWER_LED_DRIVER 0x0785 +/** Fluorescent Lamp Gear */ +#define BT_APPEARANCE_POWER_FLUORESCENT_LAMP_GEAR 0x0786 +/** HID Lamp Gear */ +#define BT_APPEARANCE_POWER_HID_LAMP_GEAR 0x0787 +/** Charge Case */ +#define BT_APPEARANCE_POWER_CHARGE_CASE 0x0788 +/** Power Bank */ +#define BT_APPEARANCE_POWER_POWER_BANK 0x0789 +/** Generic Light Source */ +#define BT_APPEARANCE_GENERIC_LIGHT_SOURCE 0x07C0 +/** Incandescent Light Bulb */ +#define BT_APPEARANCE_LIGHT_SOURCE_INCANDESCENT_BULB 0x07C1 +/** LED Lamp */ +#define BT_APPEARANCE_LIGHT_SOURCE_LED_LAMP 0x07C2 +/** HID Lamp */ +#define BT_APPEARANCE_LIGHT_SOURCE_HID_LAMP 0x07C3 +/** Fluorescent Lamp */ +#define BT_APPEARANCE_LIGHT_SOURCE_FLUORESCENT_LAMP 0x07C4 +/** LED Array */ +#define BT_APPEARANCE_LIGHT_SOURCE_LED_ARRAY 0x07C5 +/** Multi-Color LED Array */ +#define BT_APPEARANCE_LIGHT_SOURCE_MULTICOLOR_LED_ARRAY 0x07C6 +/** Low voltage halogen */ +#define BT_APPEARANCE_LIGHT_SOURCE_LOW_VOLTAGE_HALOGEN 0x07C7 +/** Organic light emitting diode */ +#define BT_APPEARANCE_LIGHT_SOURCE_OLED 0x07C8 +/** Generic Window Covering */ +#define BT_APPEARANCE_GENERIC_WINDOW_COVERING 0x0800 +/** Window Shades */ +#define BT_APPEARANCE_WINDOW_SHADES 0x0801 +/** Window Blinds */ +#define BT_APPEARANCE_WINDOW_BLINDS 0x0802 +/** Window Awning */ +#define BT_APPEARANCE_WINDOW_AWNING 0x0803 +/** Window Curtain */ +#define BT_APPEARANCE_WINDOW_CURTAIN 0x0804 +/** Exterior Shutter */ +#define BT_APPEARANCE_WINDOW_EXTERIOR_SHUTTER 0x0805 +/** Exterior Screen */ +#define BT_APPEARANCE_WINDOW_EXTERIOR_SCREEN 0x0806 +/** Generic Audio Sink */ +#define BT_APPEARANCE_GENERIC_AUDIO_SINK 0x0840 +/** Standalone Speaker */ +#define BT_APPEARANCE_AUDIO_SINK_STANDALONE_SPEAKER 0x0841 +/** Soundbar */ +#define BT_APPEARANCE_AUDIO_SINK_SOUNDBAR 0x0842 +/** Bookshelf Speaker */ +#define BT_APPEARANCE_AUDIO_SINK_BOOKSHELF_SPEAKER 0x0843 +/** Standmounted Speaker */ +#define BT_APPEARANCE_AUDIO_SINK_STANDMOUNTED_SPEAKER 0x0844 +/** Speakerphone */ +#define BT_APPEARANCE_AUDIO_SINK_SPEAKERPHONE 0x0845 +/** Generic Audio Source */ +#define BT_APPEARANCE_GENERIC_AUDIO_SOURCE 0x0880 +/** Microphone */ +#define BT_APPEARANCE_AUDIO_SOURCE_MICROPHONE 0x0881 +/** Alarm */ +#define BT_APPEARANCE_AUDIO_SOURCE_ALARM 0x0882 +/** Bell */ +#define BT_APPEARANCE_AUDIO_SOURCE_BELL 0x0883 +/** Horn */ +#define BT_APPEARANCE_AUDIO_SOURCE_HORN 0x0884 +/** Broadcasting Device */ +#define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_DEVICE 0x0885 +/** Service Desk */ +#define BT_APPEARANCE_AUDIO_SOURCE_SERVICE_DESK 0x0886 +/** Kiosk */ +#define BT_APPEARANCE_AUDIO_SOURCE_KIOSK 0x0887 +/** Broadcasting Room */ +#define BT_APPEARANCE_AUDIO_SOURCE_BROADCASTING_ROOM 0x0888 +/** Auditorium */ +#define BT_APPEARANCE_AUDIO_SOURCE_AUDITORIUM 0x0889 +/** Generic Motorized Vehicle */ +#define BT_APPEARANCE_GENERIC_MOTORIZED_VEHICLE 0x08C0 +/** Car */ +#define BT_APPEARANCE_VEHICLE_CAR 0x08C1 +/** Large Goods Vehicle */ +#define BT_APPEARANCE_VEHICLE_LARGE_GOODS 0x08C2 +/** 2-Wheeled Vehicle */ +#define BT_APPEARANCE_VEHICLE_TWO_WHEELED 0x08C3 +/** Motorbike */ +#define BT_APPEARANCE_VEHICLE_MOTORBIKE 0x08C4 +/** Scooter */ +#define BT_APPEARANCE_VEHICLE_SCOOTER 0x08C5 +/** Moped */ +#define BT_APPEARANCE_VEHICLE_MOPED 0x08C6 +/** 3-Wheeled Vehicle */ +#define BT_APPEARANCE_VEHICLE_THREE_WHEELED 0x08C7 +/** Light Vehicle */ +#define BT_APPEARANCE_VEHICLE_LIGHT 0x08C8 +/** Quad Bike */ +#define BT_APPEARANCE_VEHICLE_QUAD_BIKE 0x08C9 +/** Minibus */ +#define BT_APPEARANCE_VEHICLE_MINIBUS 0x08CA +/** Bus */ +#define BT_APPEARANCE_VEHICLE_BUS 0x08CB +/** Trolley */ +#define BT_APPEARANCE_VEHICLE_TROLLEY 0x08CC +/** Agricultural Vehicle */ +#define BT_APPEARANCE_VEHICLE_AGRICULTURAL 0x08CD +/** Camper/Caravan */ +#define BT_APPEARANCE_VEHICLE_CAMPER_OR_CARAVAN 0x08CE +/** Recreational Vehicle/Motor Home */ +#define BT_APPEARANCE_VEHICLE_RECREATIONAL 0x08CF +/** Generic Domestic Appliance */ +#define BT_APPEARANCE_GENERIC_DOMESTIC_APPLIANCE 0x0900 +/** Refrigerator */ +#define BT_APPEARANCE_APPLIANCE_REFRIGERATOR 0x0901 +/** Freezer */ +#define BT_APPEARANCE_APPLIANCE_FREEZER 0x0902 +/** Oven */ +#define BT_APPEARANCE_APPLIANCE_OVEN 0x0903 +/** Microwave */ +#define BT_APPEARANCE_APPLIANCE_MICROWAVE 0x0904 +/** Toaster */ +#define BT_APPEARANCE_APPLIANCE_TOASTER 0x0905 +/** Washing Machine */ +#define BT_APPEARANCE_APPLIANCE_WASHING_MACHINE 0x0906 +/** Dryer */ +#define BT_APPEARANCE_APPLIANCE_DRYER 0x0907 +/** Coffee maker */ +#define BT_APPEARANCE_APPLIANCE_COFFEE_MAKER 0x0908 +/** Clothes iron */ +#define BT_APPEARANCE_APPLIANCE_CLOTHES_IRON 0x0909 +/** Curling iron */ +#define BT_APPEARANCE_APPLIANCE_CURLING_IRON 0x090A +/** Hair dryer */ +#define BT_APPEARANCE_APPLIANCE_HAIR_DRYER 0x090B +/** Vacuum cleaner */ +#define BT_APPEARANCE_APPLIANCE_VACUUM_CLEANER 0x090C +/** Robotic vacuum cleaner */ +#define BT_APPEARANCE_APPLIANCE_ROBOTIC_VACUUM_CLEANER 0x090D +/** Rice cooker */ +#define BT_APPEARANCE_APPLIANCE_RICE_COOKER 0x090E +/** Clothes steamer */ +#define BT_APPEARANCE_APPLIANCE_CLOTHES_STEAMER 0x090F +/** Generic Wearable Audio Device */ +#define BT_APPEARANCE_GENERIC_WEARABLE_AUDIO_DEVICE 0x0940 +/** Earbud */ +#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_EARBUD 0x0941 +/** Headset */ +#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADSET 0x0942 +/** Headphones */ +#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_HEADPHONES 0x0943 +/** Neck Band */ +#define BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_NECK_BAND 0x0944 +/** Generic Aircraft */ +#define BT_APPEARANCE_GENERIC_AIRCRAFT 0x0980 +/** Light Aircraft */ +#define BT_APPEARANCE_AIRCRAFT_LIGHT 0x0981 +/** Microlight */ +#define BT_APPEARANCE_AIRCRAFT_MICROLIGHT 0x0982 +/** Paraglider */ +#define BT_APPEARANCE_AIRCRAFT_PARAGLIDER 0x0983 +/** Large Passenger Aircraft */ +#define BT_APPEARANCE_AIRCRAFT_LARGE_PASSENGER 0x0984 +/** Generic AV Equipment */ +#define BT_APPEARANCE_GENERIC_AV_EQUIPMENT 0x09C0 +/** Amplifier */ +#define BT_APPEARANCE_AV_EQUIPMENT_AMPLIFIER 0x09C1 +/** Receiver */ +#define BT_APPEARANCE_AV_EQUIPMENT_RECEIVER 0x09C2 +/** Radio */ +#define BT_APPEARANCE_AV_EQUIPMENT_RADIO 0x09C3 +/** Tuner */ +#define BT_APPEARANCE_AV_EQUIPMENT_TUNER 0x09C4 +/** Turntable */ +#define BT_APPEARANCE_AV_EQUIPMENT_TURNTABLE 0x09C5 +/** CD Player */ +#define BT_APPEARANCE_AV_EQUIPMENT_CD_PLAYER 0x09C6 +/** DVD Player */ +#define BT_APPEARANCE_AV_EQUIPMENT_DVD_PLAYER 0x09C7 +/** Bluray Player */ +#define BT_APPEARANCE_AV_EQUIPMENT_BLURAY_PLAYER 0x09C8 +/** Optical Disc Player */ +#define BT_APPEARANCE_AV_EQUIPMENT_OPTICAL_DISC_PLAYER 0x09C9 +/** Set-Top Box */ +#define BT_APPEARANCE_AV_EQUIPMENT_SET_TOP_BOX 0x09CA +/** Generic Display Equipment */ +#define BT_APPEARANCE_GENERIC_DISPLAY_EQUIPMENT 0x0A00 +/** Television */ +#define BT_APPEARANCE_DISPLAY_EQUIPMENT_TELEVISION 0x0A01 +/** Monitor */ +#define BT_APPEARANCE_DISPLAY_EQUIPMENT_MONITOR 0x0A02 +/** Projector */ +#define BT_APPEARANCE_DISPLAY_EQUIPMENT_PROJECTOR 0x0A03 +/** Generic Hearing aid */ +#define BT_APPEARANCE_GENERIC_HEARING_AID 0x0A40 +/** In-ear hearing aid */ +#define BT_APPEARANCE_HEARING_AID_IN_EAR 0x0A41 +/** Behind-ear hearing aid */ +#define BT_APPEARANCE_HEARING_AID_BEHIND_EAR 0x0A42 +/** Cochlear Implant */ +#define BT_APPEARANCE_HEARING_AID_COCHLEAR_IMPLANT 0x0A43 +/** Generic Gaming */ +#define BT_APPEARANCE_GENERIC_GAMING 0x0A80 +/** Home Video Game Console */ +#define BT_APPEARANCE_HOME_VIDEO_GAME_CONSOLE 0x0A81 +/** Portable handheld console */ +#define BT_APPEARANCE_PORTABLE_HANDHELD_CONSOLE 0x0A82 +/** Generic Signage */ +#define BT_APPEARANCE_GENERIC_SIGNAGE 0x0AC0 +/** Digital Signage */ +#define BT_APPEARANCE_SIGNAGE_DIGITAL 0x0AC1 +/** Electronic Label */ +#define BT_APPEARANCE_SIGNAGE_ELECTRONIC_LABEL 0x0AC2 +/** Generic Pulse Oximeter */ +#define BT_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 +/** Fingertip Pulse Oximeter */ +#define BT_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 +/** Wrist Worn Pulse Oximeter */ +#define BT_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 +/** Generic Weight Scale */ +#define BT_APPEARANCE_GENERIC_WEIGHT_SCALE 0x0C80 +/** Generic Personal Mobility Device */ +#define BT_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 +/** Powered Wheelchair */ +#define BT_APPEARANCE_MOBILITY_POWERED_WHEELCHAIR 0x0CC1 +/** Mobility Scooter */ +#define BT_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 +/** Continuous Glucose Monitor */ +#define BT_APPEARANCE_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 +/** Generic Insulin Pump */ +#define BT_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 +/** Insulin Pump, durable pump */ +#define BT_APPEARANCE_INSULIN_PUMP_DURABLE 0x0D41 +/** Insulin Pump, patch pump */ +#define BT_APPEARANCE_INSULIN_PUMP_PATCH 0x0D44 +/** Insulin Pen */ +#define BT_APPEARANCE_INSULIN_PEN 0x0D48 +/** Generic Medication Delivery */ +#define BT_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 +/** Generic Spirometer */ +#define BT_APPEARANCE_GENERIC_SPIROMETER 0x0DC0 +/** Handheld Spirometer */ +#define BT_APPEARANCE_SPIROMETER_HANDHELD 0x0DC1 +/** Generic Outdoor Sports Activity */ +#define BT_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 +/** Location Display */ +#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 +/** Location and Navigation Display */ +#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 +/** Location Pod */ +#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 +/** Location and Navigation Pod */ +#define BT_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 +/** + * @} + */ + /** * @name Defined GAP timers * @{ From cdbc490f7d842404871972b049c6308f9787afb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1220/3334] Revert "[nrf fromtree] tests: kernel: timer: behavior: Adjustments for NRF54H20 PPR" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a952d240e2d7a3f17e77d8b7722d70f0aacbbc0b. Signed-off-by: Tomasz Moń --- .../timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tests/kernel/timer/timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf diff --git a/tests/kernel/timer/timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/tests/kernel/timer/timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf deleted file mode 100644 index 2e06babf30a7..000000000000 --- a/tests/kernel/timer/timer_behavior/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SYS_CLOCK_TICKS_PER_SEC=3906 From 7047dbacde2a537bbb73d807c6f3ca6894c2b57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1221/3334] Revert "[nrf fromtree] drivers: timer: nrf_grtc_timer: Optimize to reduce register access" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5c4763df9143b9fc2f30951723386dfdacdff662. Signed-off-by: Tomasz Moń --- drivers/timer/nrf_grtc_timer.c | 92 ++++++++++++---------------------- 1 file changed, 31 insertions(+), 61 deletions(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index a7d3d90ef196..22aed43d8e47 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -49,9 +49,10 @@ #define COUNTER_SPAN (GRTC_SYSCOUNTERL_VALUE_Msk | ((uint64_t)GRTC_SYSCOUNTERH_VALUE_Msk << 32)) #define MAX_ABS_TICKS (COUNTER_SPAN / CYC_PER_TICK) -/* To allow use of CCADD we need to limit max cycles to 31 bits. */ -#define MAX_REL_CYCLES BIT_MASK(31) -#define MAX_REL_TICKS (MAX_REL_CYCLES / CYC_PER_TICK) +#define MAX_TICKS \ + (((COUNTER_SPAN / CYC_PER_TICK) > INT_MAX) ? INT_MAX : (COUNTER_SPAN / CYC_PER_TICK)) + +#define MAX_CYCLES (MAX_TICKS * CYC_PER_TICK) #if DT_NODE_HAS_STATUS_OKAY(LFCLK_NODE) #define LFCLK_FREQUENCY_HZ DT_PROP(LFCLK_NODE, clock_frequency) @@ -59,21 +60,14 @@ #define LFCLK_FREQUENCY_HZ CONFIG_CLOCK_CONTROL_NRF_K32SRC_FREQUENCY #endif -/* Threshold used to determine if there is a risk of unexpected GRTC COMPARE event coming - * from previous CC value. - */ -#define LATENCY_THR_TICKS 200 - #if defined(CONFIG_TEST) const int32_t z_sys_timer_irq_for_test = DT_IRQN(GRTC_NODE); #endif static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_context); +static struct k_spinlock lock; static uint64_t last_count; /* Time (SYSCOUNTER value) @last sys_clock_announce() */ -static uint64_t last_elapsed; -static uint64_t cc_value; /* Value that is expected to be in CC register. */ -static uint64_t expired_cc; /* Value that is expected to be in CC register. */ static atomic_t int_mask; static uint8_t ext_channels_allocated; static uint64_t grtc_start_value; @@ -157,11 +151,16 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte { ARG_UNUSED(id); ARG_UNUSED(p_context); - uint32_t dticks; + uint64_t dticks; + uint64_t now = counter(); + + if (unlikely(now < cc_val)) { + return; + } dticks = counter_sub(cc_val, last_count) / CYC_PER_TICK; - last_count += (dticks * CYC_PER_TICK); - expired_cc = cc_val; + + last_count += dticks * CYC_PER_TICK; if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { /* protection is not needed because we are in the GRTC interrupt @@ -170,7 +169,6 @@ static void sys_clock_timeout_handler(int32_t id, uint64_t cc_val, void *p_conte system_timeout_set_abs(last_count + CYC_PER_TICK); } - last_elapsed = 0; sys_clock_announce((int32_t)dticks); } @@ -369,7 +367,6 @@ uint64_t z_nrf_grtc_timer_startup_value_get(void) int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) { nrfx_err_t err_code; - static struct k_spinlock lock; static uint8_t systemoff_channel; uint64_t now = counter(); nrfx_grtc_sleep_config_t sleep_cfg; @@ -432,12 +429,20 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) uint32_t sys_clock_cycle_get_32(void) { - return (uint32_t)counter(); + k_spinlock_key_t key = k_spin_lock(&lock); + uint32_t ret = (uint32_t)counter(); + + k_spin_unlock(&lock, key); + return ret; } uint64_t sys_clock_cycle_get_64(void) { - return counter(); + k_spinlock_key_t key = k_spin_lock(&lock); + uint64_t ret = counter(); + + k_spin_unlock(&lock, key); + return ret; } uint32_t sys_clock_elapsed(void) @@ -446,9 +451,7 @@ uint32_t sys_clock_elapsed(void) return 0; } - last_elapsed = counter_sub(counter(), last_count); - - return (uint32_t)(last_elapsed / CYC_PER_TICK); + return (uint32_t)(counter_sub(counter(), last_count) / CYC_PER_TICK); } #if !defined(CONFIG_GEN_SW_ISR_TABLE) @@ -505,10 +508,6 @@ static int sys_clock_driver_init(void) last_count = (counter() / CYC_PER_TICK) * CYC_PER_TICK; grtc_start_value = last_count; - expired_cc = UINT64_MAX; - nrfx_grtc_channel_callback_set(system_clock_channel_data.channel, - sys_clock_timeout_handler, NULL); - int_mask = NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK; if (!IS_ENABLED(CONFIG_TICKLESS_KERNEL)) { system_timeout_set_relative(CYC_PER_TICK); @@ -572,47 +571,18 @@ void sys_clock_set_timeout(int32_t ticks, bool idle) return; } - uint32_t ch = system_clock_channel_data.channel; + ticks = (ticks == K_TICKS_FOREVER) ? MAX_TICKS : MIN(MAX_TICKS, MAX(ticks, 0)); - if ((cc_value == expired_cc) && (ticks <= MAX_REL_TICKS)) { - uint32_t cyc = ticks * CYC_PER_TICK; + uint64_t delta_time = ticks * CYC_PER_TICK; - if (cyc == 0) { - /* GRTC will expire anyway since HW ensures that past value triggers an - * event but we need to ensure to always progress the cc_value as this - * if condition expects that cc_value will change after each call to - * set_timeout function. - */ - cyc = 1; - } + uint64_t target_time = counter() + delta_time; - /* If it's the first timeout setting after previous expiration and timeout - * is short so fast method can be used which utilizes relative CC configuration. - */ - cc_value += cyc; - nrfx_grtc_syscounter_cc_rel_set(ch, cyc, NRFX_GRTC_CC_RELATIVE_COMPARE); - return; - } - - uint64_t cyc = (uint64_t)ticks * CYC_PER_TICK; - bool safe_setting = false; - uint64_t prev_cc_val = cc_value; - uint64_t now = last_count + last_elapsed; - - cc_value = now + cyc; - - /* In case of timeout abort it may happen that CC is being set to a value - * that later than previous CC. If previous CC value is not far in the - * future, there is a risk that COMPARE event will be triggered for that - * previous CC value. If there is such risk safe procedure must be applied - * which is more time consuming but ensures that there will be no spurious - * event. + /* Rounded down target_time to the tick boundary + * (but not less than one tick after the last) */ - if (prev_cc_val < cc_value) { - safe_setting = (int64_t)(prev_cc_val - now) < LATENCY_THR_TICKS; - } + target_time = MAX((target_time - last_count)/CYC_PER_TICK, 1)*CYC_PER_TICK + last_count; - nrfx_grtc_syscounter_cc_abs_set(ch, cc_value, safe_setting); + system_timeout_set_abs(target_time); } #if defined(CONFIG_NRF_GRTC_TIMER_APP_DEFINED_INIT) From 1decfb5a9acddcafafd6bf860d3ad3995411cdc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1222/3334] Revert "[nrf fromtree] dts: nordic: update nrf9280 nodes in dtsi" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1d3ba5fa3b32d3c3a04b214da2de440f22bb9d54. Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf9280.dtsi | 41 ++++++++-------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 7d887b9a2092..791cd7d4c663 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -116,17 +116,16 @@ write-block-size = <16>; }; - uicr: uicr@fff8000 { - compatible = "nordic,nrf-uicr"; - reg = <0xfff8000 DT_SIZE_K(3)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xfff8000 DT_SIZE_K(3)>; + cpuapp_uicr: uicr@fff8000 { + compatible = "nordic,nrf-uicr-v2"; + reg = <0xfff8000 DT_SIZE_K(2)>; + domain = <2>; + }; - bicr: bicr@800 { - compatible = "nordic,nrf-bicr"; - reg = <0x800 204>; - }; + cpurad_uicr: uicr@fffa000 { + compatible = "nordic,nrf-uicr-v2"; + reg = <0xfffa000 DT_SIZE_K(2)>; + domain = <3>; }; ficr: ficr@fffe000 { @@ -359,28 +358,6 @@ }; }; - tdd_peripherals: peripheral@bf000000 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0xbf000000 0x1000000>; - ranges = <0x0 0xbf000000 0x1000000>; - - tbm: tbm@3000 { - compatible = "nordic,nrf-tbm"; - reg = <0x3000 0x408>; - status = "disabled"; - interrupts = <127 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - hsfll200: clock@4000 { - compatible = "fixed-clock"; - reg = <0x4000 0x1000>; - #clock-cells = <0>; - status = "disabled"; - clock-frequency = ; - }; - }; - global_peripherals: peripheral@5f000000 { #address-cells = <1>; #size-cells = <1>; From 2f25968bdce10ff8bfa2b6a9f65161d535a2a7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1223/3334] Revert "[nrf fromtree] boards: nordic: add partitions to memory map for nRF9280" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8747da21a62dd632cfbffa90cbb83e88c96b0622. Signed-off-by: Tomasz Moń --- .../nrf9280pdk_nrf9280-memory_map.dtsi | 10 -------- .../nrf9280pdk_nrf9280-memory_map_iron.dtsi | 23 ------------------- 2 files changed, 33 deletions(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi index 67c70f1d38b5..0127998509e8 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi @@ -221,14 +221,4 @@ reg = <0x680000 DT_SIZE_K(24)>; }; }; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - periphconf_partition: partition@60a000 { - reg = <0x60a000 DT_SIZE_K(8)>; - }; - }; }; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi index fba2e0fb6c2d..d3aea1f979ae 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi @@ -78,28 +78,5 @@ storage_partition: partition@600000 { reg = <0x600000 DT_SIZE_K(40)>; }; - - periphconf_partition: partition@60a000 { - reg = <0x60a000 DT_SIZE_K(8)>; - }; - - /* 0x60c000 was chosen for secure_storage_partition such that - * it resides in the beginning of MRAM11 in storage partition. - */ - secure_storage_partition: partition@60c000 { - compatible = "fixed-subpartitions"; - reg = <0x60c000 DT_SIZE_K(8)>; - ranges = <0x0 0x60c000 0x2000>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_crypto_partition: partition@0 { - reg = <0x0 DT_SIZE_K(4)>; - }; - - cpuapp_its_partition: partition@1000 { - reg = <0x1000 DT_SIZE_K(4)>; - }; - }; }; }; From f6f5eeec791abdda6e73b02dc3be65c4dba2b00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1224/3334] Revert "[nrf fromtree] soc: nordic: activate uicr generation and use correct dt reg check" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 216971ec0259855f5f1fc2e47e820f855b72b611. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/Kconfig | 4 +- soc/nordic/common/uicr/Kconfig.sysbuild | 2 +- .../common/uicr/gen_periphconf_entries.py | 48 ++----------------- soc/nordic/validate_base_addresses.c | 2 +- 4 files changed, 8 insertions(+), 48 deletions(-) diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index 9f22fbbf7269..37bdd014b7d6 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -3,7 +3,7 @@ config NRF_PERIPHCONF_SECTION bool "Populate global peripheral initialization section" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD depends on LINKER_DEVNULL_SUPPORT imply LINKER_DEVNULL_MEMORY help @@ -12,7 +12,7 @@ config NRF_PERIPHCONF_SECTION config NRF_PERIPHCONF_GENERATE_ENTRIES bool "Generate PERIPHCONF entries source file" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD depends on NRF_PERIPHCONF_SECTION depends on NRF_PLATFORM_HALTIUM help diff --git a/soc/nordic/common/uicr/Kconfig.sysbuild b/soc/nordic/common/uicr/Kconfig.sysbuild index 6a9341f90994..eb885beaaaf7 100644 --- a/soc/nordic/common/uicr/Kconfig.sysbuild +++ b/soc/nordic/common/uicr/Kconfig.sysbuild @@ -3,7 +3,7 @@ config NRF_HALTIUM_GENERATE_UICR bool "Generate UICR file" - depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF92X + depends on SOC_SERIES_NRF54HX default y help Generate UICR HEX file. diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index 13df5e468ded..9a273dab7a59 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -54,51 +54,11 @@ def get_additional_node_kwargs(node: Node) -> dict[str, Any]: return additional_kwargs -class Family(enum.Enum): - """Families of SoCs supported by this script""" - - SERIES_NRF54HX = "nrf54h" - SERIES_NRF92X = "nrf92" - SERIES_UNKNOWN = "unknown" - - @classmethod - def family(cls, soc): - if soc.startswith("nrf54h") and len(soc) == 8: - return cls.SERIES_NRF54HX - elif soc.startswith("nrf92") and len(soc) == 7: - return cls.SERIES_NRF92X - else: - return cls.SERIES_UNKNOWN - - class Soc(enum.Enum): """Names of SoCs supported by this script""" NRF54H20 = "nrf54h20" NRF9280 = "nrf9280" - UNKNOWN = "unknown" - - @classmethod - def soc(cls, soc): - if soc.startswith("nrf54h20") and len(soc) == 8: - return cls.NRF54H20 - elif soc.startswith("nrf9280") and len(soc) == 7: - return cls.NRF9280 - else: - return cls.UNKNOWN - - -def validate_soc_choice(soc): - """Helper for argparse to validate soc parameter type""" - - if (soc.startswith("nrf54h") and soc[6:].isdigit() and len(soc) == 8) or ( - soc.startswith("nrf92") and soc[5:].isdigit() and len(soc) == 7 - ): - return soc - else: - raise argparse.ArgumentTypeError( - f"Invalid soc '{soc}'. Must start with 'nrf54h' or 'nrf92' followed by 2 digits." - ) def parse_args() -> argparse.Namespace: @@ -118,8 +78,8 @@ def parse_args() -> argparse.Namespace: ) parser.add_argument( "--soc", - type=validate_soc_choice, required=True, + choices=[soc.value for soc in Soc], help=( "SoC to generate PERIPHCONF macros for. " "Used to look up soc specific hardware information" @@ -144,7 +104,7 @@ def main() -> None: args = parse_args() dt = pickle.load(args.in_edt_pickle) processor = dt_processor_id(dt) - lookup_tables = lookup_tables_get(Soc.soc(args.soc), Family.family(args.soc)) + lookup_tables = lookup_tables_get(Soc(args.soc)) builder = PeriphconfBuilder(dt, lookup_tables) # Application local peripherals @@ -178,7 +138,7 @@ def main() -> None: args.out_periphconf_source.write(generated_source) -def lookup_tables_get(soc: Soc, family: Family) -> SocLookupTables: +def lookup_tables_get(soc: Soc) -> SocLookupTables: if soc == Soc.NRF54H20: ctrlsel_lookup = { # CAN120 @@ -478,7 +438,7 @@ def lookup_tables_get(soc: Soc, family: Family) -> SocLookupTables: NrfPsel(fun=NrfFun.TPIU_DATA3, port=7, pin=7): Ctrlsel.TND, }, } - elif family == Family.SERIES_NRF92X: + elif soc == Soc.NRF9280: ctrlsel_lookup = { # PWM120 0x5F8E_4000: { diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index f8e5245b51cb..4f17e32e5d5b 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -346,7 +346,7 @@ CHECK_DT_REG(uart134, NRF_UARTE134); CHECK_DT_REG(uart135, NRF_UARTE135); CHECK_DT_REG(uart136, NRF_UARTE136); CHECK_DT_REG(uart137, NRF_UARTE137); -#if !defined(CONFIG_SOC_SERIES_NRF54HX) && !defined(CONFIG_SOC_SERIES_NRF92X) +#if !defined(CONFIG_SOC_SERIES_NRF54HX) CHECK_DT_REG(uicr, NRF_UICR); #else CHECK_DT_REG(uicr, NRF_APPLICATION_UICR); From 453fe75bdae33bcd1755c3d1e38426b430432cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1225/3334] Revert "[nrf fromlist] drivers: clock_control nrf_lfclk: patch clock option order" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a816c20837801f125fb9928f8a25d54e1e3ebbf8. Signed-off-by: Tomasz Moń --- .../clock_control/clock_control_nrf_lfclk.c | 104 +++++++++--------- 1 file changed, 49 insertions(+), 55 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf_lfclk.c b/drivers/clock_control/clock_control_nrf_lfclk.c index dbf7f66e2e25..9551fb4e6361 100644 --- a/drivers/clock_control/clock_control_nrf_lfclk.c +++ b/drivers/clock_control/clock_control_nrf_lfclk.c @@ -25,25 +25,38 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, #define LFCLK_LFRC_STARTUP_TIME_US DT_INST_PROP(0, lfrc_startup_time_us) #define LFCLK_MAX_OPTS 4 +#define LFCLK_DEF_OPTS 2 #define NRFS_CLOCK_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF_LFCLK_CLOCK_TIMEOUT_MS) #define BICR (NRF_BICR_Type *)DT_REG_ADDR(DT_NODELABEL(bicr)) -/* - * Clock options sorted from lowest to highest power consumption. If clock option - * is not available it is not included. - * - External sine or square wave - * - XTAL low precision - * - XTAL high precision - * - Internal RC oscillator +/* Clock options sorted from highest to lowest power consumption. * - Clock synthesized from a high frequency clock + * - Internal RC oscillator + * - External clock. These are inserted into the list at driver initialization. + * Set to one of the following: + * - XTAL. Low or High precision + * - External sine or square wave */ static struct clock_options { uint16_t accuracy : 15; uint16_t precision : 1; nrfs_clock_src_t src; -} clock_options[LFCLK_MAX_OPTS]; +} clock_options[LFCLK_MAX_OPTS] = { + { + /* 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, + }, + { + .accuracy = LFCLK_LFRC_ACCURACY, + .precision = 0, + .src = NRFS_CLOCK_SRC_LFCLK_LFRC, + }, + /* Remaining options are populated on lfclk_init */ +}; struct lfclk_dev_data { STRUCT_CLOCK_CONFIG(lfclk, ARRAY_SIZE(clock_options)) clk_cfg; @@ -148,7 +161,7 @@ static int lfclk_resolve_spec_to_idx(const struct device *dev, ? dev_data->max_accuracy : req_spec->accuracy; - for (int i = 0; i < dev_data->clock_options_cnt; i++) { + for (int i = dev_data->clock_options_cnt - 1; i >= 0; --i) { /* Iterate to a more power hungry and accurate clock source * If the requested accuracy is higher (lower ppm) than what * the clock source can provide. @@ -318,17 +331,15 @@ static int api_get_rate_lfclk(const struct device *dev, static int lfclk_init(const struct device *dev) { struct lfclk_dev_data *dev_data = dev->data; - nrfs_err_t res; - int ret; nrf_bicr_lfosc_mode_t lfosc_mode; - struct clock_options *clock_option; + nrfs_err_t res; res = nrfs_clock_init(clock_evt_handler); if (res != NRFS_SUCCESS) { return -EIO; } - dev_data->clock_options_cnt = 0; + dev_data->clock_options_cnt = LFCLK_DEF_OPTS; lfosc_mode = nrf_bicr_lfosc_mode_get(BICR); @@ -336,6 +347,8 @@ static int lfclk_init(const struct device *dev) lfosc_mode == NRF_BICR_LFOSC_MODE_DISABLED) { dev_data->max_accuracy = LFCLK_HFXO_ACCURACY; } else { + int ret; + ret = lfosc_get_accuracy(&dev_data->max_accuracy); if (ret < 0) { LOG_ERR("LFOSC enabled with invalid accuracy"); @@ -344,41 +357,34 @@ static int lfclk_init(const struct device *dev) switch (lfosc_mode) { case NRF_BICR_LFOSC_MODE_CRYSTAL: - clock_option = &clock_options[dev_data->clock_options_cnt]; - clock_option->accuracy = dev_data->max_accuracy; - clock_option->precision = 0; - clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE; - dev_data->clock_options_cnt++; - - clock_option = &clock_options[dev_data->clock_options_cnt]; - clock_option->accuracy = dev_data->max_accuracy; - clock_option->precision = 1; - clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE_HP; - dev_data->clock_options_cnt++; - break; + clock_options[LFCLK_MAX_OPTS - 1].accuracy = dev_data->max_accuracy; + clock_options[LFCLK_MAX_OPTS - 1].precision = 0; + clock_options[LFCLK_MAX_OPTS - 1].src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE; - case NRF_BICR_LFOSC_MODE_EXTSINE: - clock_option = &clock_options[dev_data->clock_options_cnt]; - clock_option->accuracy = dev_data->max_accuracy; - clock_option->precision = 0; - clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE; - dev_data->clock_options_cnt++; - - clock_option = &clock_options[dev_data->clock_options_cnt]; - clock_option->accuracy = dev_data->max_accuracy; - clock_option->precision = 1; - clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE_HP; - dev_data->clock_options_cnt++; + clock_options[LFCLK_MAX_OPTS - 2].accuracy = dev_data->max_accuracy; + clock_options[LFCLK_MAX_OPTS - 2].precision = 1; + clock_options[LFCLK_MAX_OPTS - 2].src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE_HP; + + dev_data->clock_options_cnt += 2; break; + case NRF_BICR_LFOSC_MODE_EXTSINE: + clock_options[LFCLK_MAX_OPTS - 1].accuracy = dev_data->max_accuracy; + clock_options[LFCLK_MAX_OPTS - 1].precision = 0; + clock_options[LFCLK_MAX_OPTS - 1].src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE; - case NRF_BICR_LFOSC_MODE_EXTSQUARE: - clock_option = &clock_options[dev_data->clock_options_cnt]; - clock_option->accuracy = dev_data->max_accuracy; - clock_option->precision = 0; - clock_option->src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SQUARE; - dev_data->clock_options_cnt++; + clock_options[LFCLK_MAX_OPTS - 2].accuracy = dev_data->max_accuracy; + clock_options[LFCLK_MAX_OPTS - 2].precision = 1; + clock_options[LFCLK_MAX_OPTS - 2].src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE_HP; + + dev_data->clock_options_cnt += 2; break; + case NRF_BICR_LFOSC_MODE_EXTSQUARE: + clock_options[LFCLK_MAX_OPTS - 2].accuracy = dev_data->max_accuracy; + clock_options[LFCLK_MAX_OPTS - 2].precision = 0; + clock_options[LFCLK_MAX_OPTS - 2].src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SQUARE; + dev_data->clock_options_cnt += 1; + break; default: LOG_ERR("Unexpected LFOSC mode"); return -EINVAL; @@ -392,18 +398,6 @@ static int lfclk_init(const struct device *dev) } } - clock_option = &clock_options[dev_data->clock_options_cnt]; - clock_option->accuracy = LFCLK_LFRC_ACCURACY; - clock_option->precision = 0; - clock_option->src = NRFS_CLOCK_SRC_LFCLK_LFRC; - dev_data->clock_options_cnt++; - - clock_option = &clock_options[dev_data->clock_options_cnt]; - clock_option->accuracy = LFCLK_HFXO_ACCURACY; - clock_option->precision = 1; - clock_option->src = NRFS_CLOCK_SRC_LFCLK_SYNTH; - dev_data->clock_options_cnt++; - dev_data->hfxo_startup_time_us = nrf_bicr_hfxo_startup_time_us_get(BICR); if (dev_data->hfxo_startup_time_us == NRF_BICR_HFXO_STARTUP_TIME_UNCONFIGURED) { LOG_ERR("BICR HFXO startup time invalid"); From 258b13f305a16f5200387cb635ed5f0a26302725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1226/3334] Revert "[nrf fromtree] drivers: nrf: remove handling of cross domain pins" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ca171188af1fb548a9c8266326c9d819e4884082. Signed-off-by: Tomasz Moń --- drivers/serial/uart_nrfx_uarte.c | 84 ++++++++++++++++++ drivers/spi/spi_nrfx_spim.c | 85 +++++++++++++++++++ drivers/spi/spi_nrfx_spis.c | 84 ++++++++++++++++++ dts/bindings/spi/nordic,nrf-spi-common.yaml | 10 +++ dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 ++ .../spi_controller_peripheral/testcase.yaml | 2 - .../uart/uart_elementary/testcase.yaml | 1 - 7 files changed, 271 insertions(+), 3 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index ffb090ca16f1..08cb236b918d 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -127,6 +127,27 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); */ #define UARTE_ANY_HIGH_SPEED (UARTE_FOR_EACH_INSTANCE(INSTANCE_IS_HIGH_SPEED, (||), (0))) +#define UARTE_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ + COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(UARTE(prefix##idx)), \ + (UARTE_PROP(idx, cross_domain_pins_supported)), \ + (0)) + +#if UARTE_FOR_EACH_INSTANCE(UARTE_PINS_CROSS_DOMAIN, (||), (0)) +#include +/* Certain UARTE instances support usage of cross domain pins in form of dedicated pins on + * a port different from the default one. + */ +#define UARTE_CROSS_DOMAIN_PINS_SUPPORTED 1 +#endif + +#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) +#include +/* To use cross domain pins, constant latency mode needs to be applied, which is + * handled via nrf_sys_event requests. + */ +#define UARTE_CROSS_DOMAIN_PINS_HANDLE 1 +#endif + #ifdef UARTE_ANY_CACHE /* uart120 instance does not retain BAUDRATE register when ENABLE=0. When this instance * is used then baudrate must be set after enabling the peripheral and not before. @@ -394,6 +415,10 @@ struct uarte_nrfx_config { #endif uint8_t *poll_out_byte; uint8_t *poll_in_byte; +#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED + bool cross_domain; + int8_t default_port; +#endif }; /* Using Macro instead of static inline function to handle NO_OPTIMIZATIONS case @@ -468,6 +493,32 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); } +#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED +static bool uarte_has_cross_domain_connection(const struct uarte_nrfx_config *config) +{ + const struct pinctrl_dev_config *pcfg = config->pcfg; + const struct pinctrl_state *state; + int ret; + + ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); + if (ret < 0) { + LOG_ERR("Unable to read pin state"); + return false; + } + + for (uint8_t i = 0U; i < state->pin_cnt; i++) { + uint32_t pin = NRF_GET_PIN(state->pins[i]); + + if ((pin != NRF_PIN_DISCONNECTED) && + (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { + return true; + } + } + + return false; +} +#endif + #if defined(UARTE_ANY_NONE_ASYNC) && !defined(CONFIG_UART_NRFX_UARTE_NO_IRQ) /** * @brief Interrupt service routine. @@ -754,6 +805,20 @@ static void uarte_periph_enable(const struct device *dev) (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); nrf_uarte_enable(uarte); +#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED + if (config->cross_domain && uarte_has_cross_domain_connection(config)) { +#if UARTE_CROSS_DOMAIN_PINS_HANDLE + int err; + + err = nrf_sys_event_request_global_constlat(); + (void)err; + __ASSERT_NO_MSG(err >= 0); +#else + __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); +#endif + } +#endif + #if UARTE_BAUDRATE_RETENTION_WORKAROUND if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { nrf_uarte_baudrate_set(uarte, @@ -3110,6 +3175,20 @@ static void uarte_pm_suspend(const struct device *dev) wait_for_tx_stopped(dev); } +#if UARTE_CROSS_DOMAIN_PINS_SUPPORTED + if (cfg->cross_domain && uarte_has_cross_domain_connection(cfg)) { +#if UARTE_CROSS_DOMAIN_PINS_HANDLE + int err; + + err = nrf_sys_event_release_global_constlat(); + (void)err; + __ASSERT_NO_MSG(err >= 0); +#else + __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); +#endif + } +#endif + (void)pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP); nrf_uarte_disable(uarte); } @@ -3439,6 +3518,11 @@ static int uarte_instance_deinit(const struct device *dev) IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ (.timer = NRFX_TIMER_INSTANCE( \ CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ + IF_ENABLED(UARTE_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ + (.cross_domain = true, \ + .default_port = \ + DT_PROP_OR(DT_PHANDLE(UARTE(idx), \ + default_gpio_port), port, -1),)) \ }; \ UARTE_DIRECT_ISR_DECLARE(idx) \ static int uarte_##idx##_init(const struct device *dev) \ diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 390682260c81..44451be58bc7 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -54,6 +54,28 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #define SPIM_FOR_EACH_INSTANCE(f, sep, off_code, ...) \ NRFX_FOREACH_PRESENT(SPIM, f, sep, off_code, __VA_ARGS__) +#define SPIM_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ + COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIM(prefix##idx)), \ + (SPIM_PROP(idx, cross_domain_pins_supported)), \ + (0)) + +#if NRFX_FOREACH_PRESENT(SPIM, SPIM_PINS_CROSS_DOMAIN, (||), (0)) +#include +/* Certain SPIM instances support usage of cross domain pins in form of dedicated pins on + * a port different from the default one. + */ +#define SPIM_CROSS_DOMAIN_SUPPORTED 1 +#endif + +#if SPIM_CROSS_DOMAIN_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) +#include +/* To use cross domain pins, constant latency mode needs to be applied, which is + * handled via nrf_sys_event requests. + */ +#define SPIM_CROSS_DOMAIN_PINS_HANDLE 1 +#endif + + struct spi_nrfx_data { struct spi_context ctx; const struct device *dev; @@ -83,11 +105,41 @@ struct spi_nrfx_config { #endif uint32_t wake_pin; nrfx_gpiote_t wake_gpiote; +#if SPIM_CROSS_DOMAIN_SUPPORTED + bool cross_domain; + int8_t default_port; +#endif void *mem_reg; }; static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context); +#if SPIM_CROSS_DOMAIN_SUPPORTED +static bool spim_has_cross_domain_connection(const struct spi_nrfx_config *config) +{ + const struct pinctrl_dev_config *pcfg = config->pcfg; + const struct pinctrl_state *state; + int ret; + + ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); + if (ret < 0) { + LOG_ERR("Unable to read pin state"); + return false; + } + + for (uint8_t i = 0U; i < state->pin_cnt; i++) { + uint32_t pin = NRF_GET_PIN(state->pins[i]); + + if ((pin != NRF_PIN_DISCONNECTED) && + (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { + return true; + } + } + + return false; +} +#endif + static inline void finalize_spi_transaction(const struct device *dev, bool deactivate_cs) { struct spi_nrfx_data *dev_data = dev->data; @@ -634,6 +686,20 @@ static int spim_resume(const struct device *dev) return -EAGAIN; } +#if SPIM_CROSS_DOMAIN_SUPPORTED + if (dev_config->cross_domain && spim_has_cross_domain_connection(dev_config)) { +#if SPIM_CROSS_DOMAIN_PINS_HANDLE + int err; + + err = nrf_sys_event_request_global_constlat(); + (void)err; + __ASSERT_NO_MSG(err >= 0); +#else + __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); +#endif + } +#endif + return 0; } @@ -649,6 +715,20 @@ static void spim_suspend(const struct device *dev) spi_context_cs_put_all(&dev_data->ctx); +#if SPIM_CROSS_DOMAIN_SUPPORTED + if (dev_config->cross_domain && spim_has_cross_domain_connection(dev_config)) { +#if SPIM_CROSS_DOMAIN_PINS_HANDLE + int err; + + err = nrf_sys_event_release_global_constlat(); + (void)err; + __ASSERT_NO_MSG(err >= 0); +#else + __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); +#endif + } +#endif + (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -786,6 +866,11 @@ static int spi_nrfx_deinit(const struct device *dev) .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPIM(idx), wake_gpios, \ WAKE_PIN_NOT_USED), \ .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPIM(idx)), \ + IF_ENABLED(SPIM_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ + (.cross_domain = true, \ + .default_port = \ + DT_PROP_OR(DT_PHANDLE(SPIM(idx), \ + default_gpio_port), port, -1),)) \ .mem_reg = DMM_DEV_TO_REG(SPIM(idx)), \ }; \ BUILD_ASSERT(!SPIM_HAS_PROP(idx, wake_gpios) || \ diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index 0861ed3c2f54..4d1a9070c1ac 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -32,6 +32,27 @@ LOG_MODULE_REGISTER(spi_nrfx_spis, CONFIG_SPI_LOG_LEVEL); #define SPIS_PROP(idx, prop) DT_PROP(SPIS(idx), prop) #define SPIS_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIS(idx), prop) +#define SPIS_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ + COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIS(prefix##idx)), \ + (SPIS_PROP(idx, cross_domain_pins_supported)), \ + (0)) + +#if NRFX_FOREACH_PRESENT(SPIS, SPIS_PINS_CROSS_DOMAIN, (||), (0)) +#include +/* Certain SPIM instances support usage of cross domain pins in form of dedicated pins on + * a port different from the default one. + */ +#define SPIS_CROSS_DOMAIN_SUPPORTED 1 +#endif + +#if SPIS_CROSS_DOMAIN_SUPPORTED && defined(CONFIG_NRF_SYS_EVENT) +#include +/* To use cross domain pins, constant latency mode needs to be applied, which is + * handled via nrf_sys_event requests. + */ +#define SPIS_CROSS_DOMAIN_PINS_HANDLE 1 +#endif + struct spi_nrfx_data { struct spi_context ctx; const struct device *dev; @@ -51,8 +72,38 @@ struct spi_nrfx_config { const struct pinctrl_dev_config *pcfg; struct gpio_dt_spec wake_gpio; void *mem_reg; +#if SPIS_CROSS_DOMAIN_SUPPORTED + bool cross_domain; + int8_t default_port; +#endif }; +#if SPIS_CROSS_DOMAIN_SUPPORTED +static bool spis_has_cross_domain_connection(const struct spi_nrfx_config *config) +{ + const struct pinctrl_dev_config *pcfg = config->pcfg; + const struct pinctrl_state *state; + int ret; + + ret = pinctrl_lookup_state(pcfg, PINCTRL_STATE_DEFAULT, &state); + if (ret < 0) { + LOG_ERR("Unable to read pin state"); + return false; + } + + for (uint8_t i = 0U; i < state->pin_cnt; i++) { + uint32_t pin = NRF_GET_PIN(state->pins[i]); + + if ((pin != NRF_PIN_DISCONNECTED) && + (nrf_gpio_pin_port_number_extract(&pin) != config->default_port)) { + return true; + } + } + + return false; +} +#endif + static inline nrf_spis_mode_t get_nrf_spis_mode(uint16_t operation) { if (SPI_MODE_GET(operation) & SPI_MODE_CPOL) { @@ -372,6 +423,20 @@ static void spi_nrfx_suspend(const struct device *dev) nrf_spis_disable(dev_config->spis.p_reg); } +#if SPIS_CROSS_DOMAIN_SUPPORTED + if (dev_config->cross_domain && spis_has_cross_domain_connection(dev_config)) { +#if SPIS_CROSS_DOMAIN_PINS_HANDLE + int err; + + err = nrf_sys_event_release_global_constlat(); + (void)err; + __ASSERT_NO_MSG(err >= 0); +#else + __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); +#endif + } +#endif + (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); } @@ -381,6 +446,20 @@ static void spi_nrfx_resume(const struct device *dev) (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); +#if SPIS_CROSS_DOMAIN_SUPPORTED + if (dev_config->cross_domain && spis_has_cross_domain_connection(dev_config)) { +#if SPIS_CROSS_DOMAIN_PINS_HANDLE + int err; + + err = nrf_sys_event_request_global_constlat(); + (void)err; + __ASSERT_NO_MSG(err >= 0); +#else + __ASSERT(false, "NRF_SYS_EVENT needs to be enabled to use cross domain pins.\n"); +#endif + } +#endif + if (dev_config->wake_gpio.port == NULL) { nrf_spis_enable(dev_config->spis.p_reg); } @@ -499,6 +578,11 @@ static int spi_nrfx_init(const struct device *dev) .max_buf_len = BIT_MASK(SPIS_PROP(idx, easydma_maxcnt_bits)), \ .wake_gpio = GPIO_DT_SPEC_GET_OR(SPIS(idx), wake_gpios, {0}), \ .mem_reg = DMM_DEV_TO_REG(SPIS(idx)), \ + IF_ENABLED(SPIS_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ + (.cross_domain = true, \ + .default_port = \ + DT_PROP_OR(DT_PHANDLE(SPIS(idx), \ + default_gpio_port), port, -1),)) \ }; \ BUILD_ASSERT(!DT_NODE_HAS_PROP(SPIS(idx), wake_gpios) || \ !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ diff --git a/dts/bindings/spi/nordic,nrf-spi-common.yaml b/dts/bindings/spi/nordic,nrf-spi-common.yaml index dc81950aed3d..e76d785b2f42 100644 --- a/dts/bindings/spi/nordic,nrf-spi-common.yaml +++ b/dts/bindings/spi/nordic,nrf-spi-common.yaml @@ -61,3 +61,13 @@ properties: and SPI master again keeps the line in the low state Please note that the line must be configured and properly handled on both sides for the mechanism to work correctly. + + default-gpio-port: + type: phandle + description: | + SPI default GPIO port. + + cross-domain-pins-supported: + type: boolean + description: | + SPI allows usage of cross domain pins with constant latency mode required. diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 602a7de7f719..4d15eebe8d02 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -313,6 +313,8 @@ rx-delay-supported; rx-delay = <1>; status = "disabled"; + default-gpio-port = <&gpio1>; + cross-domain-pins-supported; }; uart20: uart@c6000 { @@ -322,6 +324,8 @@ status = "disabled"; endtx-stoptx-supported; frame-timeout-supported; + default-gpio-port = <&gpio1>; + cross-domain-pins-supported; }; i2c21: i2c@c7000 { @@ -352,6 +356,8 @@ rx-delay-supported; rx-delay = <1>; status = "disabled"; + default-gpio-port = <&gpio1>; + cross-domain-pins-supported; }; uart21: uart@c7000 { @@ -361,6 +367,8 @@ status = "disabled"; endtx-stoptx-supported; frame-timeout-supported; + default-gpio-port = <&gpio1>; + cross-domain-pins-supported; }; i2c22: i2c@c8000 { diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index f2c10b6c716d..a4581e54820d 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -109,8 +109,6 @@ tests: extra_configs: - CONFIG_TESTED_SPI_MODE=0 - CONFIG_NRF_SYS_EVENT=y - - CONFIG_SOC_NRF_FORCE_CONSTLAT=y - - CONFIG_POWER_DOMAIN=n extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay" platform_exclude: - nrf52840dk/nrf52840 diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index b680e0f96428..cd25f46c1415 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -100,4 +100,3 @@ tests: extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay" extra_configs: - CONFIG_NRF_SYS_EVENT=y - - CONFIG_SOC_NRF_FORCE_CONSTLAT=y From 7e14ec5c759a65b94b654a14731c956cc518b2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1227/3334] Revert "[nrf fromtree] drivers: can: tcan4x5x: Add device PM support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 66ebe5c4bef1a9170d34517a7f416ba4c6de0e39. Signed-off-by: Tomasz Moń --- drivers/can/can_mcan.c | 35 ------- drivers/can/can_tcan4x5x.c | 208 ++++++++----------------------------- 2 files changed, 46 insertions(+), 197 deletions(-) diff --git a/drivers/can/can_mcan.c b/drivers/can/can_mcan.c index a69a4b2398df..3f7d771e5f4a 100644 --- a/drivers/can/can_mcan.c +++ b/drivers/can/can_mcan.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -323,32 +322,10 @@ int can_mcan_start(const struct device *dev) } data->common.started = true; - pm_device_busy_set(dev); return err; } -static bool can_mcan_rx_filters_exist(const struct device *dev) -{ - const struct can_mcan_config *config = dev->config; - const struct can_mcan_callbacks *cbs = config->callbacks; - int i; - - for (i = 0; i < cbs->num_std; i++) { - if (cbs->std[i].function != NULL) { - return true; - } - } - - for (i = 0; i < cbs->num_ext; i++) { - if (cbs->ext[i].function != NULL) { - return true; - } - } - - return false; -} - int can_mcan_stop(const struct device *dev) { const struct can_mcan_config *config = dev->config; @@ -391,12 +368,6 @@ int can_mcan_stop(const struct device *dev) } } - k_mutex_lock(&data->lock, K_FOREVER); - if (!can_mcan_rx_filters_exist(dev)) { - pm_device_busy_clear(dev); - } - k_mutex_unlock(&data->lock); - return 0; } @@ -1213,8 +1184,6 @@ int can_mcan_add_rx_filter(const struct device *dev, can_rx_callback_t callback, filter_id = can_mcan_add_rx_filter_std(dev, callback, user_data, filter); } - pm_device_busy_set(dev); - return filter_id; } @@ -1261,10 +1230,6 @@ void can_mcan_remove_rx_filter(const struct device *dev, int filter_id) } } - if (!can_mcan_rx_filters_exist(dev) && !data->common.started) { - pm_device_busy_clear(dev); - } - k_mutex_unlock(&data->lock); } diff --git a/drivers/can/can_tcan4x5x.c b/drivers/can/can_tcan4x5x.c index 31f61b7dd72d..2abd0467a5ee 100644 --- a/drivers/can/can_tcan4x5x.c +++ b/drivers/can/can_tcan4x5x.c @@ -12,8 +12,6 @@ #include #include #include -#include -#include LOG_MODULE_REGISTER(can_tcan4x5x, CONFIG_CAN_LOG_LEVEL); @@ -102,10 +100,6 @@ LOG_MODULE_REGISTER(can_tcan4x5x, CONFIG_CAN_LOG_LEVEL); #define CAN_TCAN4X5X_MODE_CONFIG_SWE_DIS BIT(1) #define CAN_TCAN4X5X_MODE_CONFIG_TEST_MODE_CONFIG BIT(0) -#define CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP 0 -#define CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY 1 -#define CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL 2 - /* Timestamp Prescaler register */ #define CAN_TCAN4X5X_TIMESTAMP_PRESCALER 0x0804 #define CAN_TCAN4X5X_TIMESTAMP_PRESCALER_MASK GENMASK(7, 0) @@ -207,9 +201,6 @@ LOG_MODULE_REGISTER(can_tcan4x5x, CONFIG_CAN_LOG_LEVEL); /* TCAN4x5x timing requirements */ #define CAN_TCAN4X5X_T_MODE_STBY_NOM_US 70 -#define CAN_TCAN4X5X_T_MODE_NOM_SLP_US 200 -#define CAN_TCAN4X5X_T_MODE_NOM_STBY_US 200 -#define CAN_TCAN4X5X_T_MODE_SLP_STBY_US 200 #define CAN_TCAN4X5X_T_WAKE_US 50 #define CAN_TCAN4X5X_T_PULSE_WIDTH_US 30 #define CAN_TCAN4X5X_T_RESET_US 1000 @@ -560,154 +551,6 @@ static int tcan4x5x_reset(const struct device *dev) return 0; } -static int tcan4x5x_set_config_mode_sel(const struct device *dev, uint8_t mode, uint32_t *reg) -{ - int err; - uint8_t current_mode; - - switch (mode) { - case CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP: - case CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY: - case CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL: - break; - default: - LOG_ERR("invalid mode %u", mode); - return -EINVAL; - } - - err = tcan4x5x_read_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, reg); - if (err != 0) { - LOG_ERR("failed to read configuration register (err %d)", err); - return -EIO; - } - - current_mode = FIELD_GET(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL, *reg); - LOG_DBG("current mode %u, new mode %u", current_mode, mode); - - *reg &= ~(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL); - *reg |= FIELD_PREP(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL, mode); - - err = tcan4x5x_write_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, *reg); - if (err != 0) { - LOG_ERR("failed to write configuration register (err %d)", err); - return -EIO; - } - - if (current_mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY && - mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL) { - /* Wait for standby to normal mode switch */ - k_busy_wait(CAN_TCAN4X5X_T_MODE_STBY_NOM_US); - } else if (current_mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL && - mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP) { - /* Wait for normal to sleep mode switch */ - k_busy_wait(CAN_TCAN4X5X_T_MODE_NOM_SLP_US); - } else if (current_mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL && - mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY) { - /* Wait for normal to standby mode switch */ - k_busy_wait(CAN_TCAN4X5X_T_MODE_NOM_STBY_US); - } else if (current_mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP && - mode == CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_STANDBY) { - /* Wait for sleep to standby mode switch */ - k_busy_wait(CAN_TCAN4X5X_T_MODE_SLP_STBY_US); - } - - return 0; -} - -static int tcan4x5x_init_normal_mode(const struct device *dev) -{ - const struct can_mcan_config *mcan_config = dev->config; - const struct tcan4x5x_config *tcan_config = mcan_config->custom; - int err = 0; - uint32_t reg; - - /* Set TCAN4x5x mode normal */ - err = tcan4x5x_set_config_mode_sel(dev, CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_NORMAL, ®); - if (err != 0) { - return -ENODEV; - } - - /* Configure the frequency reference */ - if (tcan_config->clk_freq == MHZ(20)) { - /* 20 MHz frequency reference */ - reg &= ~(CAN_TCAN4X5X_MODE_CONFIG_CLK_REF); - } else { - /* 40 MHz frequency reference */ - reg |= CAN_TCAN4X5X_MODE_CONFIG_CLK_REF; - } - - /* Set nWKRQ voltage to VIO */ - reg |= CAN_TCAN4X5X_MODE_CONFIG_NWKRQ_VOLTAGE; - - /* Write remaining configuration to the device */ - err = tcan4x5x_write_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, reg); - if (err != 0) { - LOG_ERR("failed to write configuration register (err %d)", err); - return -EIO; - } - - /* Configure Message RAM */ - err = can_mcan_configure_mram(dev, CAN_TCAN4X5X_MRAM_BASE, CAN_TCAN4X5X_MRAM_BASE); - if (err != 0) { - return -EIO; - } - - /* Initialize M_CAN */ - err = can_mcan_init(dev); - if (err != 0) { - LOG_ERR("failed to initialize mcan (err %d)", err); - return err; - } - - return err; -} - -#ifdef CONFIG_PM_DEVICE -static int tcan4x5x_pm_control(const struct device *dev, enum pm_device_action action) -{ - int err = 0; - uint32_t reg; - - switch (action) { - case PM_DEVICE_ACTION_SUSPEND: - if (pm_device_is_busy(dev)) { - LOG_DBG("Cannot suspend while device is busy"); - return -EBUSY; - } - - /* - * Enter sleep mode. - * NOTE: All RX filters are cleared when entering sleep mode. - * User must remove and re-add filters at the application layer. - */ - err = tcan4x5x_set_config_mode_sel(dev, CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL_SLEEP, - ®); - return err; - case PM_DEVICE_ACTION_RESUME: - /* Wake up the device */ -#if TCAN4X5X_WAKE_GPIO_SUPPORT - LOG_DBG("Waking up TCAN4x5x via WAKE GPIO"); - err = tcan4x5x_wake(dev); - if (err != 0) { - return err; - } -#else - LOG_DBG("Waking up TCAN4x5x via reset"); - err = tcan4x5x_reset(dev); - if (err != 0) { - return err; - } -#endif - /* Enter normal mode */ - return tcan4x5x_init_normal_mode(dev); - default: - break; - } - - return -ENOTSUP; -} -#endif /* CONFIG_PM_DEVICE */ - static int tcan4x5x_init(const struct device *dev) { const struct can_mcan_config *mcan_config = dev->config; @@ -715,6 +558,7 @@ static int tcan4x5x_init(const struct device *dev) struct can_mcan_data *mcan_data = dev->data; struct tcan4x5x_data *tcan_data = mcan_data->custom; k_tid_t tid; + uint32_t reg; int err; /* Initialize int_sem to 1 to ensure any pending IRQ is serviced */ @@ -827,7 +671,48 @@ static int tcan4x5x_init(const struct device *dev) FIELD_GET(GENMASK(15, 8), info[2]), FIELD_GET(GENMASK(7, 0), info[2])); #endif /* CONFIG_CAN_LOG_LEVEL >= LOG_LEVEL_DBG */ - return tcan4x5x_init_normal_mode(dev); + /* Set TCAN4x5x mode normal */ + err = tcan4x5x_read_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, ®); + if (err != 0) { + LOG_ERR("failed to read configuration register (err %d)", err); + return -ENODEV; + } + + reg &= ~(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL); + reg |= FIELD_PREP(CAN_TCAN4X5X_MODE_CONFIG_MODE_SEL, 0x02); + reg |= CAN_TCAN4X5X_MODE_CONFIG_WAKE_CONFIG; + + if (tcan_config->clk_freq == MHZ(20)) { + /* 20 MHz frequency reference */ + reg &= ~(CAN_TCAN4X5X_MODE_CONFIG_CLK_REF); + } else { + /* 40 MHz frequency reference */ + reg |= CAN_TCAN4X5X_MODE_CONFIG_CLK_REF; + } + + err = tcan4x5x_write_tcan_reg(dev, CAN_TCAN4X5X_MODE_CONFIG, reg); + if (err != 0) { + LOG_ERR("failed to write configuration register (err %d)", err); + return -ENODEV; + } + + /* Wait for standby to normal mode switch */ + k_busy_wait(CAN_TCAN4X5X_T_MODE_STBY_NOM_US); + + /* Configure Message RAM */ + err = can_mcan_configure_mram(dev, CAN_TCAN4X5X_MRAM_BASE, CAN_TCAN4X5X_MRAM_BASE); + if (err != 0) { + return -EIO; + } + + /* Initialize M_CAN */ + err = can_mcan_init(dev); + if (err != 0) { + LOG_ERR("failed to initialize mcan (err %d)", err); + return err; + } + + return 0; } static DEVICE_API(can, tcan4x5x_driver_api) = { @@ -909,9 +794,8 @@ static const struct can_mcan_ops tcan4x5x_ops = { static struct can_mcan_data can_mcan_data_##inst = \ CAN_MCAN_DATA_INITIALIZER(&tcan4x5x_data_##inst); \ \ - PM_DEVICE_DT_INST_DEFINE(inst, tcan4x5x_pm_control); \ - CAN_DEVICE_DT_INST_DEFINE(inst, tcan4x5x_init, PM_DEVICE_DT_INST_GET(inst), \ - &can_mcan_data_##inst, &can_mcan_config_##inst, POST_KERNEL, \ - CONFIG_CAN_INIT_PRIORITY, &tcan4x5x_driver_api); + CAN_DEVICE_DT_INST_DEFINE(inst, tcan4x5x_init, NULL, &can_mcan_data_##inst, \ + &can_mcan_config_##inst, POST_KERNEL, CONFIG_CAN_INIT_PRIORITY, \ + &tcan4x5x_driver_api); DT_INST_FOREACH_STATUS_OKAY(TCAN4X5X_INIT) From 920b3deb370ba0196a44d0012d8b8b9a5329e490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:48 +0100 Subject: [PATCH 1228/3334] Revert "[nrf fromlist] shell: backends: uart: implement pm_device_runtime" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a8bc748c250b0f8479e883300fe6becfc1d6bfb3. Signed-off-by: Tomasz Moń --- subsys/shell/backends/shell_uart.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/subsys/shell/backends/shell_uart.c b/subsys/shell/backends/shell_uart.c index a65c2fb16aef..1d19ce19a318 100644 --- a/subsys/shell/backends/shell_uart.c +++ b/subsys/shell/backends/shell_uart.c @@ -13,7 +13,6 @@ #include #include #include -#include #define LOG_MODULE_NAME shell_uart LOG_MODULE_REGISTER(shell_uart); @@ -291,7 +290,6 @@ static int init(const struct shell_transport *transport, void *context) { struct shell_uart_common *common = (struct shell_uart_common *)transport->ctx; - int ret; common->dev = (const struct device *)config; common->handler = evt_handler; @@ -302,11 +300,6 @@ static int init(const struct shell_transport *transport, k_fifo_init(&common->smp.buf_ready); #endif - ret = pm_device_runtime_get(common->dev); - if (ret < 0) { - return ret; - } - if (IS_ENABLED(CONFIG_SHELL_BACKEND_SERIAL_API_ASYNC)) { async_init((struct shell_uart_async *)transport->ctx); } else if (IS_ENABLED(CONFIG_SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN)) { @@ -338,8 +331,6 @@ static void polling_uninit(struct shell_uart_polling *sh_uart) static int uninit(const struct shell_transport *transport) { - struct shell_uart_common *common = (struct shell_uart_common *)transport->ctx; - if (IS_ENABLED(CONFIG_SHELL_BACKEND_SERIAL_API_ASYNC)) { async_uninit((struct shell_uart_async *)transport->ctx); } else if (IS_ENABLED(CONFIG_SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN)) { @@ -348,7 +339,7 @@ static int uninit(const struct shell_transport *transport) polling_uninit((struct shell_uart_polling *)transport->ctx); } - return pm_device_runtime_put(common->dev); + return 0; } static int enable(const struct shell_transport *transport, bool blocking_tx) From f05e241d7b565e0b447d912e08f645fca22dad3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1229/3334] Revert "[nrf fromlist] drivers: timer: nrf_grtc: Decouple clock source from CLOCK_CONTROL" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5c4e2631a7a009c1ce1af91b8f796c2d987b120b. Signed-off-by: Tomasz Moń --- drivers/timer/Kconfig.nrf_grtc | 25 ------------------------- drivers/timer/nrf_grtc_timer.c | 5 ++--- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/drivers/timer/Kconfig.nrf_grtc b/drivers/timer/Kconfig.nrf_grtc index 24534ae3f95c..082c15333dcb 100644 --- a/drivers/timer/Kconfig.nrf_grtc +++ b/drivers/timer/Kconfig.nrf_grtc @@ -56,29 +56,4 @@ config NRF_GRTC_TIMER_AUTO_KEEP_ALIVE This feature prevents the SYSCOUNTER from sleeping when any core is in active state. -if NRF_GRTC_START_SYSCOUNTER - -choice NRF_GRTC_TIMER_SOURCE - prompt "nRF GRTC clock source" - # Default to LFLPRC if CLOCK_CONTROL_NRF_K32SRC_RC for backwards compatibility - default NRF_GRTC_TIMER_SOURCE_LFLPRC if CLOCK_CONTROL_NRF_K32SRC_RC - # Default to LFXO if present as this allows GRTC to run in SYSTEM OFF - default NRF_GRTC_TIMER_SOURCE_LFXO - # Default to SYSTEM_LFCLK if LFXO is not present - default NRF_GRTC_TIMER_SOURCE_SYSTEM_LFCLK - -config NRF_GRTC_TIMER_SOURCE_LFXO - bool "Use Low Frequency XO as clock source" - depends on $(dt_nodelabel_enabled,lfxo) - -config NRF_GRTC_TIMER_SOURCE_SYSTEM_LFCLK - bool "Use System Low Frequency clock as clock source" - -config NRF_GRTC_TIMER_SOURCE_LFLPRC - bool "Use Low Frequency Low Power RC as clock source" - -endchoice # NRF_GRTC_TIMER_SOURCE - -endif # NRF_GRTC_START_SYSCOUNTER - endif # NRF_GRTC_TIMER diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 22aed43d8e47..b0593e3bd135 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -477,14 +477,13 @@ static int sys_clock_driver_init(void) #endif #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && NRF_GRTC_HAS_CLKSEL -#if defined(CONFIG_NRF_GRTC_TIMER_SOURCE_LFLPRC) +#if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC) /* Switch to LFPRC as the low-frequency clock source. */ nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFLPRC); -#elif defined(CONFIG_NRF_GRTC_TIMER_SOURCE_LFXO) +#elif DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lfxo)) /* Switch to LFXO as the low-frequency clock source. */ nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFXO); #else - /* Use LFCLK as the low-frequency clock source. */ nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFCLK); #endif #endif From 480df633cb3c5961bec9998645fee8667f9ea5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1230/3334] Revert "[nrf fromlist] drivers: can: nrf: use CAN_DEVICE_DT_INST_DEFINE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b6ed07418dfc5e33fcb79e07a2a012f8fdfdbad8. Signed-off-by: Tomasz Moń --- drivers/can/can_nrf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/can/can_nrf.c b/drivers/can/can_nrf.c index fa287b301ed1..38021d764b17 100644 --- a/drivers/can/can_nrf.c +++ b/drivers/can/can_nrf.c @@ -201,8 +201,8 @@ static int can_nrf_init(const struct device *dev) \ static struct can_mcan_data can_mcan_nrf_data##n = CAN_MCAN_DATA_INITIALIZER(NULL); \ \ - CAN_DEVICE_DT_INST_DEFINE(n, can_nrf_init, NULL, &can_mcan_nrf_data##n, \ - &can_mcan_nrf_config##n, POST_KERNEL, CONFIG_CAN_INIT_PRIORITY, \ - &can_nrf_api); + DEVICE_DT_INST_DEFINE(n, can_nrf_init, NULL, &can_mcan_nrf_data##n, \ + &can_mcan_nrf_config##n, POST_KERNEL, CONFIG_CAN_INIT_PRIORITY, \ + &can_nrf_api); DT_INST_FOREACH_STATUS_OKAY(CAN_NRF_DEFINE) From 17d841bd62593299a174f8c45439f97e4691ae49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1231/3334] Revert "[nrf fromlist] soc: nordic: nrf54l: make SoCs select specific symbols" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3a090f59bef6347f61e585fbbe3437f4f8389a13. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54l/Kconfig | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 7c09a90cf83c..b211d2417cd8 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -13,48 +13,33 @@ config SOC_SERIES_NRF54LX config SOC_NRF54L_CPUAPP_COMMON bool select ARM + select ARMV8_M_DSP select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT + 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 select HAS_NORDIC_RAM_CTRL + select HAS_SWO config SOC_NRF54L05_CPUAPP select SOC_NRF54L_CPUAPP_COMMON - select ARMV8_M_DSP - select CPU_HAS_ARM_MPU - select CPU_HAS_ARM_SAU - select CPU_HAS_FPU - select HAS_SWO config SOC_NRF54L10_CPUAPP select SOC_NRF54L_CPUAPP_COMMON - select ARMV8_M_DSP - select CPU_HAS_ARM_MPU - select CPU_HAS_ARM_SAU - select CPU_HAS_FPU - select HAS_SWO config SOC_NRF54L15_CPUAPP select SOC_NRF54L_CPUAPP_COMMON select SOC_COMPATIBLE_NRF54L15 select SOC_COMPATIBLE_NRF54L15_CPUAPP - select ARMV8_M_DSP - select CPU_HAS_ARM_MPU - select CPU_HAS_ARM_SAU - select CPU_HAS_FPU - select HAS_SWO config SOC_NRF54LM20A_ENGA_CPUAPP select SOC_NRF54L_CPUAPP_COMMON select SOC_COMPATIBLE_NRF54LM20A select SOC_COMPATIBLE_NRF54LM20A_CPUAPP - select ARMV8_M_DSP - select CPU_HAS_ARM_MPU - select CPU_HAS_ARM_SAU - select CPU_HAS_FPU - select HAS_SWO config SOC_NRF54L05_CPUFLPR select RISCV_CORE_NORDIC_VPR From f47da8c4878b92c8af02a50d63a238f373b0e3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1232/3334] Revert "[nrf fromlist] tests: drivers: i2c: i2c_nrfx_twim: add nrf54lm20a" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f326f9d218e4e1c4a95cf29ad8f41c039b065c37. Signed-off-by: Tomasz Moń --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 67 ------------------- tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml | 1 - 2 files changed, 68 deletions(-) delete mode 100644 tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 1fc56cc63298..000000000000 --- a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SDA = P1.13 and P1.14 - * SCL = P1.23 and P1.24 - */ - -/ { - aliases { - i2c-controller = &i2c21; - i2c-controller-target = &i2c22; - }; -}; - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml index 42d1d98f3af8..4fa30bae7e84 100644 --- a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml +++ b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml @@ -14,7 +14,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp From 240b8ea91b63aa790289a34702b4fb4cf41f0597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1233/3334] Revert "[nrf fromlist] net: l2: ppp: Allow PPP to transtition ESTABLISH->DEAD" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6e92cee1f94e63917e45296dd80284dbbc0b6ac2. Signed-off-by: Tomasz Moń --- subsys/net/l2/ppp/fsm.c | 11 ----------- subsys/net/l2/ppp/lcp.c | 7 +------ 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/subsys/net/l2/ppp/fsm.c b/subsys/net/l2/ppp/fsm.c index e5ca056e1c03..3dd280230883 100644 --- a/subsys/net/l2/ppp/fsm.c +++ b/subsys/net/l2/ppp/fsm.c @@ -53,13 +53,6 @@ struct net_if *ppp_fsm_iface(struct ppp_fsm *fsm) return ctx->iface; } -static bool ppp_fsm_is_dead(struct ppp_fsm *fsm) -{ - struct ppp_context *ctx = ppp_fsm_ctx(fsm); - - return ctx->phase == PPP_DEAD; -} - static void fsm_send_configure_req(struct ppp_fsm *fsm, bool retransmit) { struct net_pkt *pkt = NULL; @@ -253,10 +246,6 @@ void ppp_fsm_close(struct ppp_fsm *fsm, const uint8_t *reason) case PPP_STOPPING: ppp_change_state(fsm, PPP_CLOSING); - if (ppp_fsm_is_dead(fsm)) { - fsm->retransmits = 0; - k_work_reschedule(&fsm->timer, K_NO_WAIT); - } break; default: diff --git a/subsys/net/l2/ppp/lcp.c b/subsys/net/l2/ppp/lcp.c index 49b0b53ab7e7..a62a9e52541e 100644 --- a/subsys/net/l2/ppp/lcp.c +++ b/subsys/net/l2/ppp/lcp.c @@ -163,12 +163,7 @@ static void lcp_open(struct ppp_context *ctx) static void lcp_close(struct ppp_context *ctx, const uint8_t *reason) { if (ctx->phase != PPP_DEAD) { - if (ctx->phase == PPP_ESTABLISH) { - /* Link is not established yet, so we can go directly to DEAD */ - ppp_change_phase(ctx, PPP_DEAD); - } else { - ppp_change_phase(ctx, PPP_TERMINATE); - } + ppp_change_phase(ctx, PPP_TERMINATE); } ppp_fsm_close(&ctx->lcp.fsm, reason); From 064079deffc1445179df9b4363a524c2f1a30ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1234/3334] Revert "[nrf fromlist] dts: nrf54lm20a: align GPIOTE IRQn to non-secure build" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2efd2b50b707c930de030245d14d38cd4146561d. Signed-off-by: Tomasz Moń --- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index 1798088d6f4a..dff01d80d7fe 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -75,19 +75,11 @@ nvic: &cpuapp_nvic {}; }; &gpiote20 { -#ifdef USE_NON_SECURE_ADDRESS_MAP - interrupts = <218 NRF_DEFAULT_IRQ_PRIORITY>; -#else interrupts = <219 NRF_DEFAULT_IRQ_PRIORITY>; -#endif }; &gpiote30 { -#ifdef USE_NON_SECURE_ADDRESS_MAP - interrupts = <268 NRF_DEFAULT_IRQ_PRIORITY>; -#else interrupts = <269 NRF_DEFAULT_IRQ_PRIORITY>; -#endif }; &dppic00 { From ad82ce3c8ace0b24b3a3d73e5dbef638d729ff69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1235/3334] Revert "[nrf fromlist] drivers: modem_cellular: Update nRF91 Serial Modem PPP script" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 19c007047ddb10263f93bf382fc0920101be19fb. Signed-off-by: Tomasz Moń --- drivers/modem/modem_cellular.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index b99401fedca5..dfa2c719a8af 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -2816,7 +2816,6 @@ MODEM_CHAT_SCRIPT_DEFINE(telit_me310g1_shutdown_chat_script, #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf91_slm) MODEM_CHAT_SCRIPT_CMDS_DEFINE(nordic_nrf91_slm_init_chat_script_cmds, MODEM_CHAT_SCRIPT_CMD_RESP_MULT("AT", allow_match), - MODEM_CHAT_SCRIPT_CMD_RESP("AT+CFUN=4", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+CMEE=1", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG=1", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG?", ok_match), @@ -2834,7 +2833,7 @@ MODEM_CHAT_SCRIPT_DEFINE(nordic_nrf91_slm_init_chat_script, nordic_nrf91_slm_ini abort_matches, modem_cellular_chat_callback_handler, 10); MODEM_CHAT_SCRIPT_CMDS_DEFINE(nordic_nrf91_slm_dial_chat_script_cmds, - MODEM_CHAT_SCRIPT_CMD_RESP("AT#XPPP=1", ok_match), + MODEM_CHAT_SCRIPT_CMD_RESP("AT+CFUN=4", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT+CFUN=1", ok_match), MODEM_CHAT_SCRIPT_CMD_RESP("AT#XCMUX=2", ok_match)); From 66a2bd7d698516569ce436c7a5ef6dbc2fa24749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1236/3334] Revert "[nrf fromtree] kernel: events: Depend on multithreading" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ed17be7d4a3b9b9117337d4b9d3ccde66ea3c072. Signed-off-by: Tomasz Moń --- kernel/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/Kconfig b/kernel/Kconfig index 3d33a7995ae0..bb2c5bade905 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -734,7 +734,6 @@ config NUM_MBOX_ASYNC_MSGS config EVENTS bool "Event objects" - depends on MULTITHREADING help This option enables event objects. Threads may wait on event objects for specific events, but both threads and ISRs may deliver From 22b25d91cdf630911a353690fd0519e3613d6f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1237/3334] Revert "[nrf fromtree] modules: nordic: select correct timer for NFCT on nRF54L" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5d67dcaeb80dffd530a13d25e5ff7acabb4755d7. Signed-off-by: Tomasz Moń --- modules/hal_nordic/nrfx/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index f92cefce480e..0b1882ba7a65 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -281,7 +281,6 @@ config NRFX_NFCT depends on $(dt_nodelabel_exists,nfct) select NRFX_TIMER4 if SOC_SERIES_NRF52X select NRFX_TIMER2 if SOC_SERIES_NRF53X - select NRFX_TIMER24 if SOC_SERIES_NRF54LX config NRFX_NVMC bool "NVMC driver" From a712e3eeb88e22be83df2970aa830e0e2d45e00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1238/3334] Revert "[nrf fromtree] drivers: mspi_dw: Use uint32_t for dummy_bytes field" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f0657befe0c0a194fa00d0619cd60ca4c4914a4e. Signed-off-by: Tomasz Moń --- drivers/mspi/mspi_dw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 66bdf670c02d..4f6616a91749 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -59,7 +59,7 @@ struct mspi_dw_data { enum mspi_cpp_mode xip_cpp; #endif - uint32_t dummy_bytes; + uint16_t dummy_bytes; uint8_t bytes_to_discard; uint8_t bytes_per_frame_exp; bool standard_spi; @@ -317,7 +317,7 @@ static bool tx_dummy_bytes(const struct device *dev, bool *repeat) uint8_t fifo_room = dev_config->max_queued_dummy_bytes - FIELD_GET(TXFLR_TXTFL_MASK, read_txflr(dev)); uint8_t rx_fifo_items = FIELD_GET(RXFLR_RXTFL_MASK, read_rxflr(dev)); - uint32_t dummy_bytes = dev_data->dummy_bytes; + uint16_t dummy_bytes = dev_data->dummy_bytes; const uint8_t dummy_val = 0; /* Subtract the number of items that are already stored in the RX From e23b5432b7ee60ee9d590f994b3d5b20d8d68de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1239/3334] Revert "[nrf fromtree] soc: nordic: nrf54h: Disable S2RAM on cpurad" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d545d3951ea44e5b13bd72fd2963895607b7ba94. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index ac25cff79150..d5632943e19f 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -65,6 +65,7 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_NORDIC_DMM select HAS_NORDIC_RAM_CTRL select HAS_PM + select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF config SOC_NRF54H20_CPURAD_ENABLE From aef913fcc2d089317105b8cc4bdd80df7cb3f916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1240/3334] Revert "[nrf fromtree] soc: nordic: nrf54h: s2ram: Support disabled MPU" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ad01194b50b88c183b541c3908228657abe62bef. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/pm_s2ram.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index 753acdda6832..221293c5b82e 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -76,9 +76,7 @@ typedef struct { struct backup { _nvic_context_t nvic_context; -#if defined(CONFIG_MPU) _mpu_context_t mpu_context; -#endif _scb_context_t scb_context; #if defined(CONFIG_FPU) && !defined(CONFIG_FPU_SHARING) _fpu_context_t fpu_context; @@ -90,7 +88,6 @@ static __noinit struct backup backup_data; extern void z_arm_configure_static_mpu_regions(void); extern int z_arm_mpu_init(void); -#if defined(CONFIG_MPU) /* MPU registers cannot be simply copied because content of RBARx RLARx registers * depends on region which is selected by RNR register. */ @@ -133,7 +130,6 @@ static void mpu_restore(_mpu_context_t *backup) MPU->RNR = rnr; MPU->CTRL = backup->CTRL; } -#endif /* defined(CONFIG_MPU) */ static void nvic_save(_nvic_context_t *backup) { @@ -235,9 +231,7 @@ int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) fpu_power_down(); #endif nvic_save(&backup_data.nvic_context); -#if defined(CONFIG_MPU) mpu_save(&backup_data.mpu_context); -#endif ret = arch_pm_s2ram_suspend(system_off); /* Cache and FPU are powered down so power up is needed even if s2ram failed. */ nrf_power_up_cache(); @@ -252,9 +246,7 @@ int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) return ret; } -#if defined(CONFIG_MPU) mpu_restore(&backup_data.mpu_context); -#endif nvic_restore(&backup_data.nvic_context); scb_restore(&backup_data.scb_context); From ff1fe2d75e5826cd538c98ec69f19c3ffe5387de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1241/3334] Revert "[nrf fromtree] pm: refactor PM_S2RAM_CUSTOM_MARKING option to be promptless" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ec40f54e613e48a4adaa8bd15b2666aa13a8c6c2. Signed-off-by: Tomasz Moń --- arch/arm/core/cortex_m/pm_s2ram.c | 4 ++-- include/zephyr/arch/common/pm_s2ram.h | 8 ++++---- samples/boards/nordic/spis_wakeup/prj.conf | 1 + .../nordic/spis_wakeup/wakeup_trigger/prj.conf | 1 + soc/nordic/nrf54h/Kconfig | 2 -- subsys/pm/Kconfig | 15 +++++++-------- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/arm/core/cortex_m/pm_s2ram.c b/arch/arm/core/cortex_m/pm_s2ram.c index ce80c78a078a..81a4ae20a4f6 100644 --- a/arch/arm/core/cortex_m/pm_s2ram.c +++ b/arch/arm/core/cortex_m/pm_s2ram.c @@ -28,7 +28,7 @@ __noinit #endif _cpu_context_t _cpu_context; -#ifndef CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING +#ifndef CONFIG_PM_S2RAM_CUSTOM_MARKING /** * S2RAM Marker */ @@ -50,4 +50,4 @@ bool pm_s2ram_mark_check_and_clear(void) return false; } -#endif /* CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING */ +#endif /* CONFIG_PM_S2RAM_CUSTOM_MARKING */ diff --git a/include/zephyr/arch/common/pm_s2ram.h b/include/zephyr/arch/common/pm_s2ram.h index 322cefe6ebb2..34c544c769b9 100644 --- a/include/zephyr/arch/common/pm_s2ram.h +++ b/include/zephyr/arch/common/pm_s2ram.h @@ -63,8 +63,8 @@ int arch_pm_s2ram_suspend(pm_s2ram_system_off_fn_t system_off); * Function is called when system state is stored to RAM, just before going to system * off. * - * Default implementation is setting a magic word in RAM used if - * CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING is not set. + * Default implementation is setting a magic word in RAM. CONFIG_PM_S2RAM_CUSTOM_MARKING + * allows custom implementation. */ void pm_s2ram_mark_set(void); @@ -74,8 +74,8 @@ void pm_s2ram_mark_set(void); * Function is used to determine if resuming after suspend-to-RAM shall be performed * or standard boot code shall be executed. * - * Default implementation is checking a magic word in RAM used if - * CONFIG_HAS_PM_S2RAM_CUSTOM_MARKING is not set. + * Default implementation is checking a magic word in RAM. CONFIG_PM_S2RAM_CUSTOM_MARKING + * allows custom implementation. * * @retval true if marking is found which indicates resuming after suspend-to-RAM. * @retval false if marking is not found which indicates standard boot. diff --git a/samples/boards/nordic/spis_wakeup/prj.conf b/samples/boards/nordic/spis_wakeup/prj.conf index e313ffeed82b..c1cc933296f0 100644 --- a/samples/boards/nordic/spis_wakeup/prj.conf +++ b/samples/boards/nordic/spis_wakeup/prj.conf @@ -3,6 +3,7 @@ CONFIG_SPI_SLAVE=y CONFIG_GPIO=y CONFIG_PM=y +CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf index ad4577807f89..9c30d5a98fd7 100644 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf @@ -3,6 +3,7 @@ CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500 CONFIG_GPIO=y CONFIG_PM=y +CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index d5632943e19f..85d55ebf1aa8 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -35,7 +35,6 @@ config SOC_NRF54H20_CPUAPP_COMMON select NRFS_HAS_TEMP_SERVICE select NRFS_HAS_VBUS_DETECTOR_SERVICE select HAS_PM - select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF config SOC_NRF54H20_CPUAPP @@ -65,7 +64,6 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_NORDIC_DMM select HAS_NORDIC_RAM_CTRL select HAS_PM - select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF config SOC_NRF54H20_CPURAD_ENABLE diff --git a/subsys/pm/Kconfig b/subsys/pm/Kconfig index 676f4ef229f5..abd424a88009 100644 --- a/subsys/pm/Kconfig +++ b/subsys/pm/Kconfig @@ -10,14 +10,6 @@ config HAS_PM This option must be selected by SoCs that provide PM hooks, that is, calls to configure low-power states. -config HAS_PM_S2RAM_CUSTOM_MARKING - bool - depends on HAS_PM - help - By default a magic word in RAM is used to mark entering suspend-to-RAM. If this - option is selected, a custom implementation of functions which handle the marking - must be provided. - config PM bool "System Power Management" depends on SYS_CLOCK_EXISTS && HAS_PM @@ -53,6 +45,13 @@ config PM_S2RAM sleep states if PM is enabled and one or more suspend-to-ram sleep states are enabled in the devicetree. +config PM_S2RAM_CUSTOM_MARKING + bool "Use custom marking functions" + depends on PM_S2RAM + help + By default a magic word in RAM is used to mark entering suspend-to-RAM. Enabling + this option allows custom implementation of functions which handle the marking. + config PM_NEED_ALL_DEVICES_IDLE bool "System Low Power Mode Needs All Devices Idle" depends on PM_DEVICE && !SMP From b6b4644b9463f780a232b68e597877291a9a7d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1242/3334] Revert "[nrf fromtree] pm: bind the PM_S2RAM kconfig option to devicetree" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 44217a5e8182e1d52ddd554504881c2193596f2f. Signed-off-by: Tomasz Moń --- samples/boards/nordic/spis_wakeup/prj.conf | 1 + .../nordic/spis_wakeup/wakeup_trigger/prj.conf | 1 + .../boards/st/power_mgmt/suspend_to_ram/prj.conf | 1 + subsys/pm/Kconfig | 13 +++++-------- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/boards/nordic/spis_wakeup/prj.conf b/samples/boards/nordic/spis_wakeup/prj.conf index c1cc933296f0..ca92fc6de6ae 100644 --- a/samples/boards/nordic/spis_wakeup/prj.conf +++ b/samples/boards/nordic/spis_wakeup/prj.conf @@ -3,6 +3,7 @@ CONFIG_SPI_SLAVE=y CONFIG_GPIO=y CONFIG_PM=y +CONFIG_PM_S2RAM=y CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf index 9c30d5a98fd7..1de6459a6083 100644 --- a/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf +++ b/samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf @@ -3,6 +3,7 @@ CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500 CONFIG_GPIO=y CONFIG_PM=y +CONFIG_PM_S2RAM=y CONFIG_PM_S2RAM_CUSTOM_MARKING=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y diff --git a/samples/boards/st/power_mgmt/suspend_to_ram/prj.conf b/samples/boards/st/power_mgmt/suspend_to_ram/prj.conf index 1f23c5a27e2c..b9a1cf9305e4 100644 --- a/samples/boards/st/power_mgmt/suspend_to_ram/prj.conf +++ b/samples/boards/st/power_mgmt/suspend_to_ram/prj.conf @@ -2,6 +2,7 @@ CONFIG_PM=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y CONFIG_PM_DEVICE_SYSTEM_MANAGED=y +CONFIG_PM_S2RAM=y CONFIG_ADC=y CONFIG_ENTROPY_GENERATOR=y CONFIG_SPI=y diff --git a/subsys/pm/Kconfig b/subsys/pm/Kconfig index abd424a88009..d1d99ac02e3a 100644 --- a/subsys/pm/Kconfig +++ b/subsys/pm/Kconfig @@ -33,17 +33,14 @@ config PM_STATS help Enable System Power Management Stats. -DT_POWER_STATE_COMPAT := zephyr,power-state - config PM_S2RAM - bool - default y + bool "Suspend-to-RAM (S2RAM)" depends on ARCH_HAS_SUSPEND_TO_RAM - depends on $(dt_compat_any_has_prop,$(DT_POWER_STATE_COMPAT),power-state-name,suspend-to-ram) help - This option enables the SoC specific implementations of suspend-to-ram (S2RAM) - sleep states if PM is enabled and one or more suspend-to-ram sleep states are - enabled in the devicetree. + This option enables suspend-to-RAM (S2RAM). + When enabled on Cortex-M, and a 'zephyr,memory-region' compatible node with nodelabel + 'pm_s2ram' is defined in DT, _cpu_context symbol (located in arch/arm/core/cortex_m/pm_s2ram.c) + is placed in linker section given by 'zephyr,memory-region' property of aforementioned node. config PM_S2RAM_CUSTOM_MARKING bool "Use custom marking functions" From c56195b994f6d3ba0e76acce6d745e809ec17cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1243/3334] Revert "[nrf fromlist] Bluetooth: Controller: Add BT_HCI_VS_FATAL_ERROR_SUPPORT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 702676c88d3bc3ac4c213fcba5d78a83a5fca0c0. Signed-off-by: Tomasz Moń --- subsys/bluetooth/common/Kconfig | 5 +---- subsys/bluetooth/controller/Kconfig.ll_sw_split | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index ae95785f8ab3..f4fb9ab9bc75 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -230,12 +230,9 @@ config BT_HCI_VS Host and/or Controller. This enables Set Version Information, Supported Commands, Supported Features vendor commands. -config BT_HCI_VS_FATAL_ERROR_SUPPORT - bool - config BT_HCI_VS_FATAL_ERROR bool "Allow vendor specific HCI event Zephyr Fatal Error" - depends on BT_HCI_VS && BT_HCI_VS_FATAL_ERROR_SUPPORT + depends on BT_HCI_VS help Enable emitting HCI Vendor-Specific events for system and Controller errors that are unrecoverable. diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 744727eb11f3..b6774d63c7c6 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -17,7 +17,6 @@ config BT_LLL_VENDOR_NORDIC select EXPERIMENTAL if !ENTROPY_HAS_DRIVER select BT_HAS_HCI_VS - select BT_HCI_VS_FATAL_ERROR_SUPPORT select BT_CTLR_CRYPTO_SUPPORT select BT_CTLR_LE_ENC_SUPPORT if BT_CTLR_CRYPTO_SUPPORT && \ !BT_CTLR_DATA_LENGTH_CLEAR && \ From b091a0449dac8cdf5138b0460f6f35b8b502262a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:49 +0100 Subject: [PATCH 1244/3334] Revert "[nrf fromtree] manifest: nrf_wifi: Pull nRF71 support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7f8c8762a56f3504ffea11d5eba2a72617666944. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 1bff38e1c7b8..01532b68b61a 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: e269670cd17fb8ccc4b7004544276bc7d9578496 + revision: b822726084f55df19aa6660dc46cf602757e8645 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From d455e7f3f6534157dd9456ba1253cde28403ffaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1245/3334] Revert "[nrf noup] manifest: nrf_wifi: Pull script to parse nRF70 FW stats blob" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1914deeb2c206cf1ce35cb4b64a93371a4d5f3c8. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 01532b68b61a..f08cf11203a6 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: b822726084f55df19aa6660dc46cf602757e8645 + revision: 53500666a59195b44e2e5a939c111effbf23db7b path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From 45413e1fbaff894d513fe0a7f5dad501d1fd68c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1246/3334] Revert "[nrf fromtree] manifest: Update hal_nordic to pull file missing in mdk 8.72.4 release" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3ee3cb1b84c6568c4daf420e3762c1f36b44abdb. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f08cf11203a6..e507c2f15991 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 7858281d843468fe53c829995fb63f45a227387a + revision: 2c0fd06a98bb9b89ac234b75b2c217742f0df1ba path: modules/hal/nordic groups: - hal From e3861034c328e4507e6d0cfcb9c5c94482dd13fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1247/3334] Revert "[nrf fromtree] west.yml: update few modules to pickup min/max define guards" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8e8b93ca47cc835697f196d556540ee0426e4d01. Signed-off-by: Tomasz Moń --- west.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/west.yml b/west.yml index e507c2f15991..19c87b1b4e77 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 2c0fd06a98bb9b89ac234b75b2c217742f0df1ba + revision: 979a58d0829108b57f10e90b6c3fc35ab6206e4b path: modules/hal/nordic groups: - hal @@ -226,7 +226,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: 740a944351300664ea17fb7913f0036a5263f008 + revision: d8ee5f18e95b9f4616a481be65e2c9ee0af1779f groups: - hal - name: hal_rpi_pico @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 53500666a59195b44e2e5a939c111effbf23db7b + revision: acb24fe26f479df9dba3c4bd97ea653ad3086ee7 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From 1c58ffee2cd806c96a3c6708e3dfa6d935e21647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1248/3334] Revert "[nrf fromtree] manifest: update revision of hal_renesas to latest" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 24e154744a018d2a09d8ffdafc7003e255f447fe. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 19c87b1b4e77..66d2e1c00348 100644 --- a/west.yml +++ b/west.yml @@ -226,7 +226,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: d8ee5f18e95b9f4616a481be65e2c9ee0af1779f + revision: f0b78440ba8f0b4a07cdd657031ac9ec1cc4c126 groups: - hal - name: hal_rpi_pico From 20390d63bac0b96a5eea70e48e302e65c59da42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1249/3334] Revert "[nrf fromtree] manifest: Update revision of hal_renesas" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b4ff4d1796bcf0baa63d8e4218591a1e853d7ac3. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 66d2e1c00348..e88a416ffaec 100644 --- a/west.yml +++ b/west.yml @@ -226,7 +226,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: f0b78440ba8f0b4a07cdd657031ac9ec1cc4c126 + revision: 6ff5c0662bc9ad4a126be28eab0addcb2454fe69 groups: - hal - name: hal_rpi_pico From 053b07ad90eb6a67561c4736e5b1281ea9c407b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1250/3334] Revert "[nrf fromtree] manifest: Update commit id for hal_renesas" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6cd23ef161192c2cb640e2f816c82e0f46e4925a. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e88a416ffaec..b84f3e46eb9e 100644 --- a/west.yml +++ b/west.yml @@ -226,7 +226,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: 6ff5c0662bc9ad4a126be28eab0addcb2454fe69 + revision: 74c9186c0a01c53e320421bd0e8b85fc266f3260 groups: - hal - name: hal_rpi_pico From a23c8bae4df113105c10ac23805a65ff2eaa3504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1251/3334] Revert "[nrf fromtree] tests: drivers: Trigger drop event for proper clean-up" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3f1c7b4e946ccc8525a4cd16fb97e4ded02fc781. Signed-off-by: Tomasz Moń --- tests/drivers/i2s/i2s_api/src/test_i2s_errors.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/drivers/i2s/i2s_api/src/test_i2s_errors.c b/tests/drivers/i2s/i2s_api/src/test_i2s_errors.c index 230a71e95d4d..477292d84c26 100644 --- a/tests/drivers/i2s/i2s_api/src/test_i2s_errors.c +++ b/tests/drivers/i2s/i2s_api/src/test_i2s_errors.c @@ -76,9 +76,6 @@ ZTEST_USER(i2s_errors, test_i2s_config_attempt_in_wrong_state) err = i2s_trigger(dev_i2s, I2S_DIR_TX, I2S_TRIGGER_STOP); zassert_equal(err, 0, "I2S_TRIGGER_STOP unexpected error: %d", err); - err = i2s_trigger(dev_i2s, I2S_DIR_TX, I2S_TRIGGER_DROP); - zassert_equal(err, 0, "I2S_TRIGGER_DROP unexpected error: %d", err); - zassert_not_equal( config_err, 0, "I2S configuration should not be possible in states other than I2S_STATE_READY"); From b8d70c6eb90fd72ce2a1d618292072cfe3171681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1252/3334] Revert "[nrf fromtree] drivers: i2s: Support audio auxpll in TDM driver" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1432164b4e417f1e486f99259054b6526fbe22db. Signed-off-by: Tomasz Moń --- drivers/i2s/i2s_nrf_tdm.c | 48 ++++++++++++--------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index 07c561b77503..fc823ce5055a 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -48,13 +47,11 @@ LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(audiopll)) #define NODE_ACLK DT_NODELABEL(audiopll) #define ACLK_FREQUENCY DT_PROP_OR(NODE_ACLK, frequency, 0) -#elif DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(audio_auxpll)) -#define NODE_AUDIO_AUXPLL DT_NODELABEL(audio_auxpll) -#define ACLK_NORDIC_FREQUENCY DT_PROP(NODE_AUDIO_AUXPLL, nordic_frequency) -BUILD_ASSERT((ACLK_NORDIC_FREQUENCY == NRF_AUXPLL_FREQ_DIV_AUDIO_48K) || - (ACLK_NORDIC_FREQUENCY == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1), - "Unsupported Audio AUXPLL frequency selection for TDM"); -#define ACLK_FREQUENCY CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(NODE_AUDIO_AUXPLL) + +static const struct device *audiopll = DEVICE_DT_GET(NODE_ACLK); +static const struct nrf_clock_spec aclk_spec = { + .frequency = ACLK_FREQUENCY, +}; #elif DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(aclk)) #define NODE_ACLK DT_NODELABEL(aclk) #define ACLK_FREQUENCY DT_PROP_OR(NODE_ACLK, clock_frequency, 0) @@ -110,10 +107,7 @@ struct tdm_drv_cfg { }; struct tdm_drv_data { -#if CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL || DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) - const struct device *audiopll; - struct nrf_clock_spec aclk_spec; -#elif CONFIG_CLOCK_CONTROL_NRF +#if CONFIG_CLOCK_CONTROL_NRF struct onoff_manager *clk_mgr; #endif struct onoff_client clk_cli; @@ -138,10 +132,8 @@ static int audio_clock_request(struct tdm_drv_data *drv_data) { #if DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRF return onoff_request(drv_data->clk_mgr, &drv_data->clk_cli); -#elif (DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL) || \ - DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) - return nrf_clock_control_request(drv_data->audiopll, &drv_data->aclk_spec, - &drv_data->clk_cli); +#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL + return nrf_clock_control_request(audiopll, &aclk_spec, &drv_data->clk_cli); #else (void)drv_data; @@ -153,9 +145,10 @@ static int audio_clock_release(struct tdm_drv_data *drv_data) { #if DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRF return onoff_release(drv_data->clk_mgr); -#elif (DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL) || \ - DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) - return nrf_clock_control_release(drv_data->audiopll, &drv_data->aclk_spec); +#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL + (void)drv_data; + + return nrf_clock_control_release(audiopll, &aclk_spec); #else (void)drv_data; @@ -1127,16 +1120,6 @@ static void clock_manager_init(const struct device *dev) subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO; drv_data->clk_mgr = z_nrf_clock_control_get_onoff(subsys); __ASSERT_NO_MSG(drv_data->clk_mgr != NULL); -#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL - struct tdm_drv_data *drv_data = dev->data; - - drv_data->audiopll = DEVICE_DT_GET(NODE_ACLK); - drv_data->aclk_spec.frequency = ACLK_FREQUENCY; -#elif DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) - struct tdm_drv_data *drv_data = dev->data; - - drv_data->audiopll = DEVICE_DT_GET(NODE_AUDIO_AUXPLL); - drv_data->aclk_spec.frequency = ACLK_FREQUENCY; #else (void)dev; #endif @@ -1211,10 +1194,9 @@ static DEVICE_API(i2s, tdm_nrf_drv_api) = { clock_manager_init(dev); \ return 0; \ } \ - BUILD_ASSERT((TDM_SCK_CLK_SRC(idx) != ACLK && TDM_MCK_CLK_SRC(idx) != ACLK) || \ - (DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) || \ - DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL)), \ - "Clock source ACLK requires the audiopll/audio_auxpll node."); \ + BUILD_ASSERT((TDM_SCK_CLK_SRC(idx) != ACLK && TDM_MCK_CLK_SRC(idx) != ACLK) || \ + DT_NODE_HAS_STATUS_OKAY(NODE_ACLK), \ + "Clock source ACLK requires the audiopll node."); \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(TDM(idx)); \ DEVICE_DT_DEFINE(TDM(idx), tdm_nrf_init##idx, NULL, &tdm_nrf_data##idx, &tdm_nrf_cfg##idx, \ POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, &tdm_nrf_drv_api); From 5b373ebeef9d62947e17d8841b1f8ba3692ddb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1253/3334] Revert "[nrf fromtree] tests: drivers: Update AUXPLL test to use frequency Macros" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6038f47d230e632c89ad53a29ce4bc9ac6fc5ca1. Signed-off-by: Tomasz Moń --- .../clock_control/nrf_clock_control/src/main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/drivers/clock_control/nrf_clock_control/src/main.c b/tests/drivers/clock_control/nrf_clock_control/src/main.c index 3612373a867d..83fdc98ca193 100644 --- a/tests/drivers/clock_control/nrf_clock_control/src/main.c +++ b/tests/drivers/clock_control/nrf_clock_control/src/main.c @@ -162,10 +162,17 @@ static const struct test_clk_context lfclk_test_clk_contexts[] = { #define AUXPLL_NODE DT_INST(0, AUXPLL_COMPAT) #define AUXPLL_FREQ DT_PROP(AUXPLL_NODE, nordic_frequency) - -/* Gets expected AUXPLL frequency */ -#define AUXPLL_FREQ_OUT CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(AUXPLL_NODE) -#if AUXPLL_FREQ_OUT == 0 +/* Gets selected AUXPLL DIV and selects the expected frequency */ +#if AUXPLL_FREQ == NRF_AUXPLL_FREQUENCY_DIV_MIN +#define AUXPLL_FREQ_OUT 80000000 +#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 +#define AUXPLL_FREQ_OUT 11289591 +#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_USB_24M +#define AUXPLL_FREQ_OUT 24000000 +#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_48K +#define AUXPLL_FREQ_OUT 12287963 +#else +/*No use case for NRF_AUXPLL_FREQ_DIV_MAX or others yet*/ #error "Unsupported AUXPLL frequency selection" #endif From 00b8c27445f4d2b029c11b5b7408e64ebd42b098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1254/3334] Revert "[nrf fromtree] drivers: audio: dmic_nrfx: Update AUXPLL control with frequency macros" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5f7cb30e6ee73d694ab46ae2c15d4ef199f56bb6. Signed-off-by: Tomasz Moń --- drivers/audio/dmic_nrfx_pdm.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index a2d630f847a9..c2c80a7414c1 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -24,15 +24,11 @@ LOG_MODULE_REGISTER(dmic_nrfx_pdm, CONFIG_AUDIO_DMIC_LOG_LEVEL); #define DMIC_NRFX_CLOCK_FACTOR 8192 #define DMIC_NRFX_AUDIO_CLOCK_FREQ DT_PROP_OR(NODE_AUDIOPLL, frequency, 0) #elif DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) -#define AUXPLL_FREQUENCY_SETTING DT_PROP(NODE_AUDIO_AUXPLL, nordic_frequency) -BUILD_ASSERT((AUXPLL_FREQUENCY_SETTING == NRF_AUXPLL_FREQ_DIV_AUDIO_48K) || - (AUXPLL_FREQUENCY_SETTING == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1), +#define DMIC_NRFX_AUDIO_CLOCK_FREQ DT_PROP(NODE_AUDIO_AUXPLL, nordic_frequency) +BUILD_ASSERT((DMIC_NRFX_AUDIO_CLOCK_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_48K) || + (DMIC_NRFX_AUDIO_CLOCK_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1), "Unsupported Audio AUXPLL frequency selection for PDM"); - -#define DMIC_NRFX_AUDIO_CLOCK_FREQ CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(NODE_AUDIO_AUXPLL) - #define DMIC_NRFX_CLOCK_FREQ MHZ(32) - #else #define DMIC_NRFX_CLOCK_FREQ MHZ(32) #define DMIC_NRFX_CLOCK_FACTOR 4096 From 4f8dd21ee489020faa308673272d52d350aec37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1255/3334] Revert "[nrf fromtree] drivers: clock_control: Add macros for AUXPLL output frequencies" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c9f7b705358d7b7fa68d8a1b354e5fc1baf238dd. Signed-off-by: Tomasz Moń --- .../drivers/clock_control/nrf_clock_control.h | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/include/zephyr/drivers/clock_control/nrf_clock_control.h b/include/zephyr/drivers/clock_control/nrf_clock_control.h index 7fa4530a6a04..37fc4a1f1a85 100644 --- a/include/zephyr/drivers/clock_control/nrf_clock_control.h +++ b/include/zephyr/drivers/clock_control/nrf_clock_control.h @@ -188,29 +188,6 @@ uint32_t z_nrf_clock_bt_ctlr_hf_get_startup_time_us(void); /* Specifies that default precision of the clock is sufficient. */ #define NRF_CLOCK_CONTROL_PRECISION_DEFAULT 0 -/* AUXPLL devicetree takes in raw register values, these are the actual frequencies outputted */ -#define CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_MIN_HZ 80000000 -#define CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_AUDIO_44K1_HZ 11289591 -#define CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_USB24M_HZ 24000000 -#define CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_AUDIO_48K_HZ 12287963 - -/* Internal helper macro to map DT property value to output frequency */ -#define _CLOCK_CONTROL_NRF_AUXPLL_MAP_FREQ(freq_val) \ - ((freq_val) == NRF_AUXPLL_FREQ_DIV_MIN ? \ - CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_MIN_HZ : \ - (freq_val) == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1 ? \ - CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_AUDIO_44K1_HZ : \ - (freq_val) == NRF_AUXPLL_FREQ_DIV_USB24M ? \ - CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_USB24M_HZ : \ - (freq_val) == NRF_AUXPLL_FREQ_DIV_AUDIO_48K ? \ - CLOCK_CONTROL_NRF_AUXPLL_FREQ_OUT_AUDIO_48K_HZ : 0) - -/* Public macro to get output frequency of AUXPLL */ -#define CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(node) \ - COND_CODE_1(DT_NODE_HAS_PROP(node, nordic_frequency), \ - (_CLOCK_CONTROL_NRF_AUXPLL_MAP_FREQ(DT_PROP(node, nordic_frequency))), \ - (0)) - struct nrf_clock_spec { uint32_t frequency; uint16_t accuracy : 15; From 637e3a27a97ef58224bb492766ff21c9a7966d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1256/3334] Revert "[nrf fromlist] modem: cmux: Add struct cmux_config into struct cmux" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 23b2c7aa2230a9b6c421b8ea6600f9fc33b6cd7b. Signed-off-by: Tomasz Moń --- include/zephyr/modem/cmux.h | 63 ++++++++++++++++++++++--------------- subsys/modem/modem_cmux.c | 59 ++++++++++++++++++---------------- 2 files changed, 70 insertions(+), 52 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 0faa8d5d4b38..18bb6fff980d 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -53,30 +53,6 @@ enum modem_cmux_event { typedef void (*modem_cmux_callback)(struct modem_cmux *cmux, enum modem_cmux_event event, void *user_data); -/** - * @brief Contains CMUX instance configuration data - */ -struct modem_cmux_config { - /** Invoked when event occurs */ - modem_cmux_callback callback; - /** Free to use pointer passed to event handler when invoked */ - void *user_data; - /** Receive buffer */ - uint8_t *receive_buf; - /** Size of receive buffer in bytes [127, ...] */ - uint16_t receive_buf_size; - /** Transmit buffer */ - uint8_t *transmit_buf; - /** Size of transmit buffer in bytes [149, ...] */ - uint16_t transmit_buf_size; - /** Enable runtime power management */ - bool enable_runtime_power_management; - /** Close pipe on power save */ - bool close_pipe_on_power_save; - /** Idle timeout for power save */ - k_timeout_t idle_timeout; -}; - /** * @cond INTERNAL_HIDDEN */ @@ -172,6 +148,10 @@ struct modem_cmux { /* Bus pipe */ struct modem_pipe *pipe; + /* Event handler */ + modem_cmux_callback callback; + void *user_data; + /* DLCI channel contexts */ sys_slist_t dlcis; @@ -179,6 +159,12 @@ struct modem_cmux { enum modem_cmux_state state; bool flow_control_on : 1; bool initiator : 1; + /** Enable runtime power management */ + bool enable_runtime_power_management; + /** Close pipe on power save */ + bool close_pipe_on_power_save; + /** Idle timeout for power save */ + k_timeout_t idle_timeout; /* Work lock */ bool attached : 1; @@ -186,6 +172,10 @@ struct modem_cmux { /* Receive state*/ enum modem_cmux_receive_state receive_state; + + /* Receive buffer */ + uint8_t *receive_buf; + uint16_t receive_buf_size; uint16_t receive_buf_len; uint8_t work_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; @@ -216,13 +206,36 @@ struct modem_cmux { struct modem_stats_buffer receive_buf_stats; struct modem_stats_buffer transmit_buf_stats; #endif - struct modem_cmux_config config; }; /** * @endcond */ +/** + * @brief Contains CMUX instance configuration data + */ +struct modem_cmux_config { + /** Invoked when event occurs */ + modem_cmux_callback callback; + /** Free to use pointer passed to event handler when invoked */ + void *user_data; + /** Receive buffer */ + uint8_t *receive_buf; + /** Size of receive buffer in bytes [127, ...] */ + uint16_t receive_buf_size; + /** Transmit buffer */ + uint8_t *transmit_buf; + /** Size of transmit buffer in bytes [149, ...] */ + uint16_t transmit_buf_size; + /** Enable runtime power management */ + bool enable_runtime_power_management; + /** Close pipe on power save */ + bool close_pipe_on_power_save; + /** Idle timeout for power save */ + k_timeout_t idle_timeout; +}; + /** * @brief Initialize CMUX instance * @param cmux CMUX instance diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 1edf3feaff41..94c249aaa938 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -400,7 +400,7 @@ static uint32_t modem_cmux_get_receive_buf_length(struct modem_cmux *cmux) static uint32_t modem_cmux_get_receive_buf_size(struct modem_cmux *cmux) { - return cmux->config.receive_buf_size; + return cmux->receive_buf_size; } static uint32_t modem_cmux_get_transmit_buf_length(struct modem_cmux *cmux) @@ -483,11 +483,11 @@ static void modem_cmux_log_received_command(const struct modem_cmux_command *com static void modem_cmux_raise_event(struct modem_cmux *cmux, enum modem_cmux_event event) { - if (cmux->config.callback == NULL) { + if (cmux->callback == NULL) { return; } - cmux->config.callback(cmux, event, cmux->config.user_data); + cmux->callback(cmux, event, cmux->user_data); } static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_event event, @@ -506,7 +506,7 @@ static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_eve break; case MODEM_PIPE_EVENT_TRANSMIT_IDLE: /* If we keep UART open in power-save, we should avoid waking up on RX idle */ - if (!cmux->config.close_pipe_on_power_save && is_powersaving(cmux)) { + if (!cmux->close_pipe_on_power_save && is_powersaving(cmux)) { break; } modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); @@ -896,7 +896,7 @@ static void modem_cmux_on_psc_response(struct modem_cmux *cmux) set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); k_mutex_unlock(&cmux->transmit_rb_lock); - if (cmux->config.close_pipe_on_power_save) { + if (cmux->close_pipe_on_power_save) { modem_pipe_close_async(cmux->pipe); } } @@ -1244,8 +1244,8 @@ static void modem_cmux_drop_frame(struct modem_cmux *cmux) #if defined(CONFIG_MODEM_CMUX_LOG_LEVEL_DBG) struct modem_cmux_frame *frame = &cmux->frame; - frame->data = cmux->config.receive_buf; - modem_cmux_log_frame(frame, "dropped", MIN(frame->data_len, cmux->config.receive_buf_size)); + frame->data = cmux->receive_buf; + modem_cmux_log_frame(frame, "dropped", MIN(frame->data_len, cmux->receive_buf_size)); #endif } @@ -1369,9 +1369,9 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by break; } - if (cmux->frame.data_len > cmux->config.receive_buf_size) { + if (cmux->frame.data_len > cmux->receive_buf_size) { LOG_ERR("Indicated frame data length %u exceeds receive buffer size %u", - cmux->frame.data_len, cmux->config.receive_buf_size); + cmux->frame.data_len, cmux->receive_buf_size); modem_cmux_drop_frame(cmux); break; @@ -1383,8 +1383,8 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by case MODEM_CMUX_RECEIVE_STATE_DATA: /* Copy byte to data */ - if (cmux->receive_buf_len < cmux->config.receive_buf_size) { - cmux->config.receive_buf[cmux->receive_buf_len] = byte; + if (cmux->receive_buf_len < cmux->receive_buf_size) { + cmux->receive_buf[cmux->receive_buf_len] = byte; } cmux->receive_buf_len++; @@ -1397,9 +1397,9 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by break; case MODEM_CMUX_RECEIVE_STATE_FCS: - if (cmux->receive_buf_len > cmux->config.receive_buf_size) { - LOG_WRN("Receive buffer overrun (%u > %u)", cmux->receive_buf_len, - cmux->config.receive_buf_size); + if (cmux->receive_buf_len > cmux->receive_buf_size) { + LOG_WRN("Receive buffer overrun (%u > %u)", + cmux->receive_buf_len, cmux->receive_buf_size); modem_cmux_drop_frame(cmux); break; } @@ -1433,7 +1433,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by } /* Process frame */ - cmux->frame.data = cmux->config.receive_buf; + cmux->frame.data = cmux->receive_buf; modem_cmux_on_frame(cmux); /* Await start of next frame */ @@ -1483,7 +1483,7 @@ static void modem_cmux_runtime_pm_handler(struct k_work *item) struct k_work_delayable *dwork = k_work_delayable_from_work(item); struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, runtime_pm_work); - if (!cmux->config.enable_runtime_power_management) { + if (!cmux->enable_runtime_power_management) { return; } @@ -1510,12 +1510,12 @@ static void modem_cmux_runtime_pm_handler(struct k_work *item) static void runtime_pm_keepalive(struct modem_cmux *cmux) { - if (cmux == NULL || !cmux->config.enable_runtime_power_management) { + if (cmux == NULL || !cmux->enable_runtime_power_management) { return; } - cmux->idle_timepoint = sys_timepoint_calc(cmux->config.idle_timeout); - k_work_reschedule(&cmux->runtime_pm_work, cmux->config.idle_timeout); + cmux->idle_timepoint = sys_timepoint_calc(cmux->idle_timeout); + k_work_reschedule(&cmux->runtime_pm_work, cmux->idle_timeout); } /** Transmit bytes bypassing the CMUX buffers. @@ -1540,7 +1540,7 @@ static bool powersave_wait_wakeup(struct modem_cmux *cmux) LOG_DBG("Power saving mode, wake up first"); set_state(cmux, MODEM_CMUX_STATE_WAKEUP); - if (cmux->config.close_pipe_on_power_save) { + if (cmux->close_pipe_on_power_save) { ret = modem_pipe_open(cmux->pipe, K_FOREVER); if (ret < 0) { LOG_ERR("Failed to open pipe for wake up (%d)", ret); @@ -1629,7 +1629,7 @@ static void modem_cmux_transmit_handler(struct k_work *item) if (cmux->state == MODEM_CMUX_STATE_CONFIRM_POWERSAVE) { set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); LOG_DBG("Entered power saving mode"); - if (cmux->config.close_pipe_on_power_save) { + if (cmux->close_pipe_on_power_save) { modem_pipe_close_async(cmux->pipe); } } @@ -1934,13 +1934,18 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co __ASSERT_NO_MSG(config->transmit_buf != NULL); __ASSERT_NO_MSG(config->transmit_buf_size >= MODEM_CMUX_DATA_FRAME_SIZE_MAX); - *cmux = (struct modem_cmux){ - .t3_timepoint = sys_timepoint_calc(K_NO_WAIT), - .config = *config, - }; + memset(cmux, 0x00, sizeof(*cmux)); + cmux->callback = config->callback; + cmux->user_data = config->user_data; + cmux->receive_buf = config->receive_buf; + cmux->receive_buf_size = config->receive_buf_size; + cmux->t3_timepoint = sys_timepoint_calc(K_NO_WAIT); + cmux->enable_runtime_power_management = config->enable_runtime_power_management; + cmux->close_pipe_on_power_save = config->close_pipe_on_power_save; + cmux->idle_timeout = + cmux->enable_runtime_power_management ? config->idle_timeout : K_FOREVER; sys_slist_init(&cmux->dlcis); - ring_buf_init(&cmux->transmit_rb, cmux->config.transmit_buf_size, - cmux->config.transmit_buf); + ring_buf_init(&cmux->transmit_rb, config->transmit_buf_size, config->transmit_buf); k_mutex_init(&cmux->transmit_rb_lock); k_work_init_delayable(&cmux->receive_work, modem_cmux_receive_handler); k_work_init_delayable(&cmux->transmit_work, modem_cmux_transmit_handler); From 990db0e25ed0ffbab6f58f6a132682bfb6dbcc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1257/3334] Revert "[nrf fromlist] modem: pipe: Don't return EPERM on closed pipe" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0983122f394e78f68c76eaa66f7f263b332fa5ef. Signed-off-by: Tomasz Moń --- subsys/modem/modem_pipe.c | 4 ++-- tests/subsys/modem/modem_pipe/src/main.c | 19 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/subsys/modem/modem_pipe.c b/subsys/modem/modem_pipe.c index ef66b9085ea6..bf642b3984dc 100644 --- a/subsys/modem/modem_pipe.c +++ b/subsys/modem/modem_pipe.c @@ -136,7 +136,7 @@ void modem_pipe_attach(struct modem_pipe *pipe, modem_pipe_api_callback callback int modem_pipe_transmit(struct modem_pipe *pipe, const uint8_t *buf, size_t size) { if (!pipe_test_events(pipe, PIPE_EVENT_OPENED_BIT)) { - return 0; + return -EPERM; } pipe_clear_events(pipe, PIPE_EVENT_TRANSMIT_IDLE_BIT); @@ -146,7 +146,7 @@ int modem_pipe_transmit(struct modem_pipe *pipe, const uint8_t *buf, size_t size int modem_pipe_receive(struct modem_pipe *pipe, uint8_t *buf, size_t size) { if (!pipe_test_events(pipe, PIPE_EVENT_OPENED_BIT)) { - return 0; + return -EPERM; } pipe_clear_events(pipe, PIPE_EVENT_RECEIVE_READY_BIT); diff --git a/tests/subsys/modem/modem_pipe/src/main.c b/tests/subsys/modem/modem_pipe/src/main.c index 7889d111d1b9..3cb330550fd5 100644 --- a/tests/subsys/modem/modem_pipe/src/main.c +++ b/tests/subsys/modem/modem_pipe/src/main.c @@ -327,14 +327,6 @@ static void test_pipe_notify_receive_ready(void) "Unexpected state %u", (uint32_t)atomic_get(&test_state)); } -static void test_pipe_receive_closed(void) -{ - /* Try to receive from a closed pipe - should return 0 */ - zassert_equal(modem_pipe_receive(test_pipe, test_buffer, test_buffer_size), 0, - "Reading from closed pipe should return 0"); - zassert_false(test_backend.receive_called, "receive should not be called on closed pipe"); -} - ZTEST(modem_pipe, test_async_open_close) { test_pipe_open(); @@ -405,16 +397,5 @@ ZTEST(modem_pipe, test_attach) test_pipe_attach_receive_not_ready_transmit_idle(); } -ZTEST(modem_pipe, test_receive_closed) -{ - test_pipe_open(); - test_reset(); - test_pipe_async_transmit(); - test_reset(); - test_pipe_close(); - /* Test reading from a closed pipe should return 0 */ - test_pipe_receive_closed(); -} - ZTEST_SUITE(modem_pipe, NULL, modem_backend_fake_setup, modem_backend_fake_before, modem_backend_fake_after, NULL); From 376ea545d4aa13aee04473bb2e13766578275879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1258/3334] Revert "[nrf fromlist] drivers: modem: Implement support for RING indicator" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a818a937d02604c4512a459a9dfa21580f32f63. Signed-off-by: Tomasz Moń --- drivers/modem/modem_cellular.c | 59 +------------------ .../modem/zephyr,cellular-modem-device.yaml | 4 -- 2 files changed, 3 insertions(+), 60 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index dfa2c719a8af..f42622840a2d 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -96,7 +96,6 @@ enum modem_cellular_event { MODEM_CELLULAR_EVENT_PPP_DEAD, MODEM_CELLULAR_EVENT_MODEM_READY, MODEM_CELLULAR_EVENT_APN_SET, - MODEM_CELLULAR_EVENT_RING, }; struct modem_cellular_event_cb { @@ -171,9 +170,6 @@ struct modem_cellular_data { struct k_mutex api_lock; struct modem_cellular_event_cb cb; - - /* Ring interrupt */ - struct gpio_callback ring_gpio_cb; }; struct modem_cellular_user_pipe { @@ -190,7 +186,6 @@ struct modem_cellular_config { struct gpio_dt_spec power_gpio; struct gpio_dt_spec reset_gpio; struct gpio_dt_spec wake_gpio; - struct gpio_dt_spec ring_gpio; struct gpio_dt_spec dtr_gpio; uint16_t power_pulse_duration_ms; uint16_t reset_pulse_duration_ms; @@ -290,8 +285,6 @@ static const char *modem_cellular_event_str(enum modem_cellular_event event) return "modem ready"; case MODEM_CELLULAR_EVENT_APN_SET: return "apn set"; - case MODEM_CELLULAR_EVENT_RING: - return "RING"; } return ""; @@ -1249,10 +1242,7 @@ static void modem_cellular_run_dial_script_event_handler(struct modem_cellular_d case MODEM_CELLULAR_EVENT_SUSPEND: modem_cellular_enter_state(data, MODEM_CELLULAR_STATE_INIT_POWER_OFF); break; - case MODEM_CELLULAR_EVENT_RING: - LOG_INF("RING received!"); - modem_pipe_open_async(data->uart_pipe); - break; + default: break; } @@ -1297,10 +1287,7 @@ static void modem_cellular_await_registered_event_handler(struct modem_cellular_ case MODEM_CELLULAR_EVENT_SUSPEND: modem_cellular_enter_state(data, MODEM_CELLULAR_STATE_INIT_POWER_OFF); break; - case MODEM_CELLULAR_EVENT_RING: - LOG_INF("RING received!"); - modem_pipe_open_async(data->uart_pipe); - break; + default: break; } @@ -1345,10 +1332,7 @@ static void modem_cellular_carrier_on_event_handler(struct modem_cellular_data * modem_ppp_release(data->ppp); modem_cellular_enter_state(data, MODEM_CELLULAR_STATE_INIT_POWER_OFF); break; - case MODEM_CELLULAR_EVENT_RING: - LOG_INF("RING received!"); - modem_pipe_open_async(data->uart_pipe); - break; + default: break; } @@ -2085,15 +2069,6 @@ static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint64_t } } -static void modem_cellular_ring_gpio_callback(const struct device *dev, struct gpio_callback *cb, - uint32_t pins) -{ - struct modem_cellular_data *data = - CONTAINER_OF(cb, struct modem_cellular_data, ring_gpio_cb); - - modem_cellular_delegate_event(data, MODEM_CELLULAR_EVENT_RING); -} - static void modem_cellular_init_apn(struct modem_cellular_data *data) { #ifdef CONFIG_MODEM_CELLULAR_APN @@ -2140,33 +2115,6 @@ static int modem_cellular_init(const struct device *dev) gpio_pin_configure_dt(&config->reset_gpio, GPIO_OUTPUT_ACTIVE); } - if (modem_cellular_gpio_is_enabled(&config->ring_gpio)) { - int ret; - - ret = gpio_pin_configure_dt(&config->ring_gpio, GPIO_INPUT); - if (ret < 0) { - LOG_ERR("Failed to configure ring GPIO (%d)", ret); - return ret; - } - - gpio_init_callback(&data->ring_gpio_cb, modem_cellular_ring_gpio_callback, - BIT(config->ring_gpio.pin)); - - ret = gpio_add_callback(config->ring_gpio.port, &data->ring_gpio_cb); - if (ret < 0) { - LOG_ERR("Failed to add ring GPIO callback (%d)", ret); - return ret; - } - - ret = gpio_pin_interrupt_configure_dt(&config->ring_gpio, GPIO_INT_EDGE_TO_ACTIVE); - if (ret < 0) { - LOG_ERR("Failed to configure ring GPIO interrupt (%d)", ret); - return ret; - } - - LOG_DBG("Ring GPIO interrupt configured"); - } - if (modem_cellular_gpio_is_enabled(&config->dtr_gpio)) { gpio_pin_configure_dt(&config->dtr_gpio, GPIO_OUTPUT_INACTIVE); dtr_gpio = &config->dtr_gpio; @@ -2943,7 +2891,6 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, .power_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_power_gpios, {}), \ .reset_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_reset_gpios, {}), \ .wake_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_wake_gpios, {}), \ - .ring_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_ring_gpios, {}), \ .dtr_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_dtr_gpios, {}), \ .power_pulse_duration_ms = (power_ms), \ .reset_pulse_duration_ms = (reset_ms), \ diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml index d2ab0056841b..c2d2e9e00a88 100644 --- a/dts/bindings/modem/zephyr,cellular-modem-device.yaml +++ b/dts/bindings/modem/zephyr,cellular-modem-device.yaml @@ -18,10 +18,6 @@ properties: type: phandle-array description: GPIO for modem wake - mdm-ring-gpios: - type: phandle-array - description: GPIO for modem ring indicator - mdm-dtr-gpios: type: phandle-array description: | From c1d23351641ea85db2b912fdb97237a931e723e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1259/3334] Revert "[nrf fromlist] drivers: modem: cellular: Use k_pipe instead of ringbuffer" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 24e7ebfc51fe06eba3bb8cf4a708d06aeac8c7ab. Signed-off-by: Tomasz Moń --- drivers/modem/modem_cellular.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index f42622840a2d..5d381af2a821 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -166,7 +166,8 @@ struct modem_cellular_data { /* Event dispatcher */ struct k_work event_dispatch_work; uint8_t event_buf[8]; - struct k_pipe event_pipe; + struct ring_buf event_rb; + struct k_mutex event_rb_lock; struct k_mutex api_lock; struct modem_cellular_event_cb cb; @@ -710,18 +711,26 @@ static void modem_cellular_event_dispatch_handler(struct k_work *item) struct modem_cellular_data *data = CONTAINER_OF(item, struct modem_cellular_data, event_dispatch_work); - enum modem_cellular_event event; - const size_t len = sizeof(event); + uint8_t events[sizeof(data->event_buf)]; + uint8_t events_cnt; - while (k_pipe_read(&data->event_pipe, (uint8_t *)&event, len, K_NO_WAIT) == len) { - modem_cellular_event_handler(data, (enum modem_cellular_event)event); + k_mutex_lock(&data->event_rb_lock, K_FOREVER); + + events_cnt = (uint8_t)ring_buf_get(&data->event_rb, events, sizeof(data->event_buf)); + + k_mutex_unlock(&data->event_rb_lock); + + for (uint8_t i = 0; i < events_cnt; i++) { + modem_cellular_event_handler(data, (enum modem_cellular_event)events[i]); } } static void modem_cellular_delegate_event(struct modem_cellular_data *data, enum modem_cellular_event evt) { - k_pipe_write(&data->event_pipe, (const uint8_t *)&evt, sizeof(evt), K_NO_WAIT); + k_mutex_lock(&data->event_rb_lock, K_FOREVER); + ring_buf_put(&data->event_rb, (uint8_t *)&evt, 1); + k_mutex_unlock(&data->event_rb_lock); k_work_submit(&data->event_dispatch_work); } @@ -2099,7 +2108,7 @@ static int modem_cellular_init(const struct device *dev) k_mutex_init(&data->api_lock); k_work_init_delayable(&data->timeout_work, modem_cellular_timeout_handler); k_work_init(&data->event_dispatch_work, modem_cellular_event_dispatch_handler); - k_pipe_init(&data->event_pipe, data->event_buf, sizeof(data->event_buf)); + ring_buf_init(&data->event_rb, sizeof(data->event_buf), data->event_buf); k_sem_init(&data->suspended_sem, 0, 1); From 0890a89376238e296407d122dcac939fc1fdfa8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:50 +0100 Subject: [PATCH 1260/3334] Revert "[nrf fromlist] drivers: modem: Implement runtime power management for CMUX" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6dcae640dfdc7d913f4f9f09a0de9dce79654ed6. Signed-off-by: Tomasz Moń --- drivers/modem/modem_cellular.c | 31 +++--- .../modem/zephyr,cellular-modem-device.yaml | 19 ---- include/zephyr/modem/cmux.h | 14 --- .../modem/backends/modem_backend_uart_async.c | 13 --- .../backends/modem_backend_uart_async_hwfc.c | 14 --- subsys/modem/modem_cmux.c | 96 +------------------ 6 files changed, 16 insertions(+), 171 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 5d381af2a821..0079a07b10d6 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include #include @@ -193,9 +191,6 @@ struct modem_cellular_config { uint16_t startup_time_ms; uint16_t shutdown_time_ms; bool autostarts; - bool cmux_enable_runtime_power_save; - bool cmux_close_pipe_on_power_save; - k_timeout_t cmux_idle_timeout; const struct modem_chat_script *init_chat_script; const struct modem_chat_script *dial_chat_script; const struct modem_chat_script *periodic_chat_script; @@ -2107,6 +2102,7 @@ static int modem_cellular_init(const struct device *dev) k_mutex_init(&data->api_lock); k_work_init_delayable(&data->timeout_work, modem_cellular_timeout_handler); + k_work_init(&data->event_dispatch_work, modem_cellular_event_dispatch_handler); ring_buf_init(&data->event_rb, sizeof(data->event_buf), data->event_buf); @@ -2153,9 +2149,6 @@ static int modem_cellular_init(const struct device *dev) .receive_buf_size = ARRAY_SIZE(data->cmux_receive_buf), .transmit_buf = data->cmux_transmit_buf, .transmit_buf_size = ARRAY_SIZE(data->cmux_transmit_buf), - .enable_runtime_power_management = config->cmux_enable_runtime_power_save, - .close_pipe_on_power_save = config->cmux_close_pipe_on_power_save, - .idle_timeout = config->cmux_idle_timeout, }; modem_cmux_init(&data->cmux, &cmux_config); @@ -2893,8 +2886,11 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, /* Helper to define modem instance */ #define MODEM_CELLULAR_DEFINE_INSTANCE(inst, power_ms, reset_ms, startup_ms, shutdown_ms, start, \ - set_baudrate_script, init_script, dial_script, \ - periodic_script, shutdown_script) \ + set_baudrate_script, \ + init_script, \ + dial_script, \ + periodic_script, \ + shutdown_script) \ static const struct modem_cellular_config MODEM_CELLULAR_INST_NAME(config, inst) = { \ .uart = DEVICE_DT_GET(DT_INST_BUS(inst)), \ .power_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_power_gpios, {}), \ @@ -2903,19 +2899,14 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, .dtr_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_dtr_gpios, {}), \ .power_pulse_duration_ms = (power_ms), \ .reset_pulse_duration_ms = (reset_ms), \ - .startup_time_ms = (startup_ms), \ + .startup_time_ms = (startup_ms), \ .shutdown_time_ms = (shutdown_ms), \ .autostarts = DT_INST_PROP_OR(inst, autostarts, (start)), \ - .cmux_enable_runtime_power_save = \ - DT_INST_PROP_OR(inst, cmux_enable_runtime_power_save, 0), \ - .cmux_close_pipe_on_power_save = \ - DT_INST_PROP_OR(inst, cmux_close_pipe_on_power_save, 0), \ - .cmux_idle_timeout = K_MSEC(DT_INST_PROP_OR(inst, cmux_idle_timeout_ms, 0)), \ - .set_baudrate_chat_script = (set_baudrate_script), \ - .init_chat_script = (init_script), \ - .dial_chat_script = (dial_script), \ + .set_baudrate_chat_script = (set_baudrate_script), \ + .init_chat_script = (init_script), \ + .dial_chat_script = (dial_script), \ .periodic_chat_script = (periodic_script), \ - .shutdown_chat_script = (shutdown_script), \ + .shutdown_chat_script = (shutdown_script), \ .user_pipes = MODEM_CELLULAR_GET_USER_PIPES(inst), \ .user_pipes_size = ARRAY_SIZE(MODEM_CELLULAR_GET_USER_PIPES(inst)), \ }; \ diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml index c2d2e9e00a88..66c7fd91d092 100644 --- a/dts/bindings/modem/zephyr,cellular-modem-device.yaml +++ b/dts/bindings/modem/zephyr,cellular-modem-device.yaml @@ -25,22 +25,3 @@ properties: Asserted (logical high) when UART is active and deasserted (logical low) when UART is inactive, powered down or in low power mode. - - cmux-enable-runtime-power-save: - type: boolean - description: | - Enable runtime power saving using CMUX PSC commands. - This requires modem to support CMUX and PSC commands while keeping the data - connection active. - - cmux-close-pipe-on-power-save: - type: boolean - description: | - Close the modem pipe when entering power save mode. - When runtime power management is enabled, this closes the UART. - This requires modem to support waking up the UART using RING signal. - - cmux-idle-timeout-ms: - type: int - description: Time in milliseconds after which CMUX will enter power save mode. - default: 10000 diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 18bb6fff980d..912edb1b79ef 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -159,12 +159,6 @@ struct modem_cmux { enum modem_cmux_state state; bool flow_control_on : 1; bool initiator : 1; - /** Enable runtime power management */ - bool enable_runtime_power_management; - /** Close pipe on power save */ - bool close_pipe_on_power_save; - /** Idle timeout for power save */ - k_timeout_t idle_timeout; /* Work lock */ bool attached : 1; @@ -194,12 +188,10 @@ struct modem_cmux { struct k_work_delayable transmit_work; struct k_work_delayable connect_work; struct k_work_delayable disconnect_work; - struct k_work_delayable runtime_pm_work; /* Synchronize actions */ struct k_event event; k_timepoint_t t3_timepoint; - k_timepoint_t idle_timepoint; /* Statistics */ #if CONFIG_MODEM_STATS @@ -228,12 +220,6 @@ struct modem_cmux_config { uint8_t *transmit_buf; /** Size of transmit buffer in bytes [149, ...] */ uint16_t transmit_buf_size; - /** Enable runtime power management */ - bool enable_runtime_power_management; - /** Close pipe on power save */ - bool close_pipe_on_power_save; - /** Idle timeout for power save */ - k_timeout_t idle_timeout; }; /** diff --git a/subsys/modem/backends/modem_backend_uart_async.c b/subsys/modem/backends/modem_backend_uart_async.c index 0cfcff9e86ed..1615120a4d5e 100644 --- a/subsys/modem/backends/modem_backend_uart_async.c +++ b/subsys/modem/backends/modem_backend_uart_async.c @@ -11,7 +11,6 @@ LOG_MODULE_REGISTER(modem_backend_uart_async, CONFIG_MODEM_MODULES_LOG_LEVEL); #include -#include #include #include @@ -159,11 +158,6 @@ static int modem_backend_uart_async_open(void *data) atomic_clear(&backend->async.common.state); ring_buf_reset(&backend->async.receive_rb); - ret = pm_device_runtime_get(backend->uart); - if (ret < 0) { - LOG_ERR("Failed to power on UART: %d", ret); - return ret; - } if (backend->dtr_gpio) { gpio_pin_set_dt(backend->dtr_gpio, 1); } @@ -275,7 +269,6 @@ static int modem_backend_uart_async_receive(void *data, uint8_t *buf, size_t siz static int modem_backend_uart_async_close(void *data) { struct modem_backend_uart *backend = (struct modem_backend_uart *)data; - int ret; atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); uart_tx_abort(backend->uart); @@ -283,12 +276,6 @@ static int modem_backend_uart_async_close(void *data) if (backend->dtr_gpio) { gpio_pin_set_dt(backend->dtr_gpio, 0); } - ret = pm_device_runtime_put_async(backend->uart, K_NO_WAIT); - if (ret < 0) { - LOG_ERR("Failed to power off UART: %d", ret); - return ret; - } - modem_pipe_notify_closed(&backend->pipe); return 0; } diff --git a/subsys/modem/backends/modem_backend_uart_async_hwfc.c b/subsys/modem/backends/modem_backend_uart_async_hwfc.c index df69c40b6679..3aaaad2e196c 100644 --- a/subsys/modem/backends/modem_backend_uart_async_hwfc.c +++ b/subsys/modem/backends/modem_backend_uart_async_hwfc.c @@ -11,7 +11,6 @@ LOG_MODULE_REGISTER(modem_backend_uart_async_hwfc, CONFIG_MODEM_MODULES_LOG_LEVEL); #include -#include #include #include @@ -223,11 +222,6 @@ static int modem_backend_uart_async_hwfc_open(void *data) return -ENOMEM; } - ret = pm_device_runtime_get(backend->uart); - if (ret < 0) { - LOG_ERR("Failed to power on UART: %d", ret); - return ret; - } if (backend->dtr_gpio) { gpio_pin_set_dt(backend->dtr_gpio, 1); } @@ -358,7 +352,6 @@ static int modem_backend_uart_async_hwfc_receive(void *data, uint8_t *buf, size_ static int modem_backend_uart_async_hwfc_close(void *data) { struct modem_backend_uart *backend = (struct modem_backend_uart *)data; - int ret; atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); uart_tx_abort(backend->uart); @@ -372,13 +365,6 @@ static int modem_backend_uart_async_hwfc_close(void *data) if (backend->dtr_gpio) { gpio_pin_set_dt(backend->dtr_gpio, 0); } - ret = pm_device_runtime_put_async(backend->uart, K_NO_WAIT); - if (ret < 0) { - LOG_ERR("Failed to power off UART: %d", ret); - return ret; - } - modem_pipe_notify_closed(&backend->pipe); - return 0; } diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 94c249aaa938..a491195b78e9 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -10,8 +10,6 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #include #include #include -#include -#include #include @@ -102,7 +100,6 @@ struct modem_cmux_msc_addr { static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address); static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux); static void modem_cmux_tx_bypass(struct modem_cmux *cmux, const uint8_t *data, size_t len); -static void runtime_pm_keepalive(struct modem_cmux *cmux); static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) { @@ -500,17 +497,10 @@ static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_eve modem_work_schedule(&cmux->receive_work, K_NO_WAIT); break; - case MODEM_PIPE_EVENT_OPENED: - cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_SOF; - modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); - break; case MODEM_PIPE_EVENT_TRANSMIT_IDLE: - /* If we keep UART open in power-save, we should avoid waking up on RX idle */ - if (!cmux->close_pipe_on_power_save && is_powersaving(cmux)) { - break; - } modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); break; + default: break; } @@ -895,10 +885,6 @@ static void modem_cmux_on_psc_response(struct modem_cmux *cmux) k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); k_mutex_unlock(&cmux->transmit_rb_lock); - - if (cmux->close_pipe_on_power_save) { - modem_pipe_close_async(cmux->pipe); - } } static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) @@ -1451,8 +1437,6 @@ static void modem_cmux_receive_handler(struct k_work *item) struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, receive_work); int ret; - runtime_pm_keepalive(cmux); - /* Receive data from pipe */ while ((ret = modem_pipe_receive(cmux->pipe, cmux->work_buf, sizeof(cmux->work_buf))) > 0) { /* Process received data */ @@ -1478,46 +1462,6 @@ static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) } } -static void modem_cmux_runtime_pm_handler(struct k_work *item) -{ - struct k_work_delayable *dwork = k_work_delayable_from_work(item); - struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, runtime_pm_work); - - if (!cmux->enable_runtime_power_management) { - return; - } - - bool expired = sys_timepoint_expired(cmux->idle_timepoint); - - if (!expired) { - return; - } - - if (is_connected(cmux) && expired) { - LOG_DBG("Idle timeout, entering power saving mode"); - set_state(cmux, MODEM_CMUX_STATE_ENTER_POWERSAVE); - modem_cmux_send_psc(cmux); - k_work_reschedule(&cmux->runtime_pm_work, MODEM_CMUX_T3_TIMEOUT); - return; - } - if (cmux->state == MODEM_CMUX_STATE_ENTER_POWERSAVE) { - LOG_WRN("PSC timeout, not entering power saving mode"); - set_state(cmux, MODEM_CMUX_STATE_CONNECTED); - runtime_pm_keepalive(cmux); - return; - } -} - -static void runtime_pm_keepalive(struct modem_cmux *cmux) -{ - if (cmux == NULL || !cmux->enable_runtime_power_management) { - return; - } - - cmux->idle_timepoint = sys_timepoint_calc(cmux->idle_timeout); - k_work_reschedule(&cmux->runtime_pm_work, cmux->idle_timeout); -} - /** Transmit bytes bypassing the CMUX buffers. * Causes modem_cmux_transmit_handler() to be rescheduled as a result of TRANSMIT_IDLE event. */ @@ -1539,17 +1483,6 @@ static bool powersave_wait_wakeup(struct modem_cmux *cmux) if (is_powersaving(cmux)) { LOG_DBG("Power saving mode, wake up first"); set_state(cmux, MODEM_CMUX_STATE_WAKEUP); - - if (cmux->close_pipe_on_power_save) { - ret = modem_pipe_open(cmux->pipe, K_FOREVER); - if (ret < 0) { - LOG_ERR("Failed to open pipe for wake up (%d)", ret); - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); - modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); - return true; - } - } - cmux->t3_timepoint = sys_timepoint_calc(MODEM_CMUX_T3_TIMEOUT); modem_cmux_tx_bypass(cmux, wakeup_pattern, sizeof(wakeup_pattern)); return true; @@ -1589,22 +1522,18 @@ static void modem_cmux_transmit_handler(struct k_work *item) modem_cmux_advertise_transmit_buf_stats(cmux); #endif - if (!is_transitioning_to_powersave(cmux)) { - runtime_pm_keepalive(cmux); - } - while (true) { transmit_rb_empty = ring_buf_is_empty(&cmux->transmit_rb); + if (transmit_rb_empty) { + break; + } + if (powersave_wait_wakeup(cmux)) { k_mutex_unlock(&cmux->transmit_rb_lock); return; } - if (transmit_rb_empty) { - break; - } - reserved_size = ring_buf_get_claim(&cmux->transmit_rb, &reserved, UINT32_MAX); ret = modem_pipe_transmit(cmux->pipe, reserved, reserved_size); @@ -1629,9 +1558,6 @@ static void modem_cmux_transmit_handler(struct k_work *item) if (cmux->state == MODEM_CMUX_STATE_CONFIRM_POWERSAVE) { set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); LOG_DBG("Entered power saving mode"); - if (cmux->close_pipe_on_power_save) { - modem_pipe_close_async(cmux->pipe); - } } modem_cmux_dlci_notify_transmit_idle(cmux); } @@ -1767,13 +1693,6 @@ static int modem_cmux_dlci_pipe_api_transmit(void *data, const uint8_t *buf, siz struct modem_cmux *cmux = dlci->cmux; int ret = 0; - if (size == 0 || buf == NULL) { - /* Allow empty transmit request to wake up CMUX */ - runtime_pm_keepalive(cmux); - k_work_reschedule(&cmux->transmit_work, K_NO_WAIT); - return 0; - } - if (dlci->flow_control) { return 0; } @@ -1940,10 +1859,6 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co cmux->receive_buf = config->receive_buf; cmux->receive_buf_size = config->receive_buf_size; cmux->t3_timepoint = sys_timepoint_calc(K_NO_WAIT); - cmux->enable_runtime_power_management = config->enable_runtime_power_management; - cmux->close_pipe_on_power_save = config->close_pipe_on_power_save; - cmux->idle_timeout = - cmux->enable_runtime_power_management ? config->idle_timeout : K_FOREVER; sys_slist_init(&cmux->dlcis); ring_buf_init(&cmux->transmit_rb, config->transmit_buf_size, config->transmit_buf); k_mutex_init(&cmux->transmit_rb_lock); @@ -1951,7 +1866,6 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co k_work_init_delayable(&cmux->transmit_work, modem_cmux_transmit_handler); k_work_init_delayable(&cmux->connect_work, modem_cmux_connect_handler); k_work_init_delayable(&cmux->disconnect_work, modem_cmux_disconnect_handler); - k_work_init_delayable(&cmux->runtime_pm_work, modem_cmux_runtime_pm_handler); k_event_init(&cmux->event); set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); From 6ba057107b1d44f160d4e5d9f29ed4822b30d7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1261/3334] Revert "[nrf fromlist] modem: cmux: Implement Power Saving Control message" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9e650b35e334a94c27711fbdfc912cb4c0fe0673. Signed-off-by: Tomasz Moń --- include/zephyr/modem/cmux.h | 5 -- subsys/modem/Kconfig | 8 -- subsys/modem/modem_cmux.c | 175 +++++------------------------------- 3 files changed, 20 insertions(+), 168 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 912edb1b79ef..bf349980e2c9 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -72,10 +72,6 @@ enum modem_cmux_state { MODEM_CMUX_STATE_DISCONNECTED = 0, MODEM_CMUX_STATE_CONNECTING, MODEM_CMUX_STATE_CONNECTED, - MODEM_CMUX_STATE_ENTER_POWERSAVE, - MODEM_CMUX_STATE_POWERSAVE, - MODEM_CMUX_STATE_CONFIRM_POWERSAVE, - MODEM_CMUX_STATE_WAKEUP, MODEM_CMUX_STATE_DISCONNECTING, }; @@ -191,7 +187,6 @@ struct modem_cmux { /* Synchronize actions */ struct k_event event; - k_timepoint_t t3_timepoint; /* Statistics */ #if CONFIG_MODEM_STATS diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index 8b4a411c26f6..dfcb7ddae9a3 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -64,14 +64,6 @@ config MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA Extra bytes to add to the work buffers used by the CMUX module. The default size of these buffers is MODEM_CMUX_MTU + 7 (CMUX header size). -config MODEM_CMUX_T3_TIMEOUT - int "CMUX T3 timeout in seconds" - range 1 255 - default 10 - help - Response Timer for wake-up procedure(T3). - Time in seconds before the link is considered dead. - module = MODEM_CMUX module-str = modem_cmux source "subsys/logging/Kconfig.template.log_config" diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index a491195b78e9..3bebde19d462 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -37,7 +37,9 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #define MODEM_CMUX_T1_TIMEOUT (K_MSEC(330)) #define MODEM_CMUX_T2_TIMEOUT (K_MSEC(660)) -#define MODEM_CMUX_T3_TIMEOUT (K_SECONDS(CONFIG_MODEM_CMUX_T3_TIMEOUT)) + +#define MODEM_CMUX_EVENT_CONNECTED_BIT (BIT(0)) +#define MODEM_CMUX_EVENT_DISCONNECTED_BIT (BIT(1)) enum modem_cmux_frame_types { MODEM_CMUX_FRAME_TYPE_RR = 0x01, @@ -99,7 +101,6 @@ struct modem_cmux_msc_addr { static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address); static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux); -static void modem_cmux_tx_bypass(struct modem_cmux *cmux, const uint8_t *data, size_t len); static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) { @@ -117,22 +118,6 @@ static bool is_connected(struct modem_cmux *cmux) return cmux->state == MODEM_CMUX_STATE_CONNECTED; } -static bool is_powersaving(struct modem_cmux *cmux) -{ - return cmux->state == MODEM_CMUX_STATE_POWERSAVE; -} - -static bool is_waking_up(struct modem_cmux *cmux) -{ - return cmux->state == MODEM_CMUX_STATE_WAKEUP; -} - -static bool is_transitioning_to_powersave(struct modem_cmux *cmux) -{ - return (cmux->state == MODEM_CMUX_STATE_ENTER_POWERSAVE || - cmux->state == MODEM_CMUX_STATE_CONFIRM_POWERSAVE); -} - static bool modem_cmux_command_type_is_valid(const struct modem_cmux_command_type type) { /* All commands are only 7 bits, so EA is always set */ @@ -596,7 +581,7 @@ static int16_t modem_cmux_transmit_data_frame(struct modem_cmux *cmux, k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); - if (cmux->flow_control_on == false || is_transitioning_to_powersave(cmux)) { + if (cmux->flow_control_on == false) { k_mutex_unlock(&cmux->transmit_rb_lock); return 0; } @@ -645,34 +630,6 @@ static void modem_cmux_acknowledge_received_frame(struct modem_cmux *cmux) } } -static void modem_cmux_send_psc(struct modem_cmux *cmux) -{ - uint16_t len; - uint8_t *data = modem_cmux_command_encode(&(struct modem_cmux_command){ - .type.ea = 1, - .type.cr = 1, - .type.value = MODEM_CMUX_COMMAND_PSC, - .length.ea = 1, - .length.value = 0, - }, &len); - - if (data == NULL) { - return; - } - - struct modem_cmux_frame frame = { - .dlci_address = 0, - .cr = cmux->initiator, - .pf = true, - .type = MODEM_CMUX_FRAME_TYPE_UIH, - .data = data, - .data_len = len, - }; - - LOG_DBG("Sending PSC command"); - modem_cmux_transmit_cmd_frame(cmux, &frame); -} - static void modem_cmux_send_msc(struct modem_cmux *cmux, struct modem_cmux_dlci *dlci) { if (cmux == NULL || dlci == NULL) { @@ -870,28 +827,12 @@ static void modem_cmux_respond_unsupported_cmd(struct modem_cmux *cmux) modem_cmux_transmit_cmd_frame(cmux, &frame); } -static void modem_cmux_on_psc_command(struct modem_cmux *cmux) -{ - LOG_DBG("Received power saving command"); - k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); - set_state(cmux, MODEM_CMUX_STATE_CONFIRM_POWERSAVE); - modem_cmux_acknowledge_received_frame(cmux); - k_mutex_unlock(&cmux->transmit_rb_lock); -} - -static void modem_cmux_on_psc_response(struct modem_cmux *cmux) -{ - LOG_DBG("Enter power saving"); - k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); - set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); - k_mutex_unlock(&cmux->transmit_rb_lock); -} - static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) { struct modem_cmux_command command; - if (cmux->state < MODEM_CMUX_STATE_CONNECTED) { + if ((cmux->state != MODEM_CMUX_STATE_CONNECTED) && + (cmux->state != MODEM_CMUX_STATE_DISCONNECTING)) { LOG_DBG("Unexpected UIH frame"); return; } @@ -910,9 +851,6 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) case MODEM_CMUX_COMMAND_CLD: modem_cmux_on_cld_command(cmux, &command); break; - case MODEM_CMUX_COMMAND_PSC: - modem_cmux_on_psc_response(cmux); - break; default: /* Responses to other commands are ignored */ break; @@ -937,10 +875,6 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) modem_cmux_on_fcoff_command(cmux); break; - case MODEM_CMUX_COMMAND_PSC: - modem_cmux_on_psc_command(cmux); - break; - default: LOG_DBG("Unknown control command"); modem_cmux_respond_unsupported_cmd(cmux); @@ -1206,11 +1140,6 @@ static void modem_cmux_on_frame(struct modem_cmux *cmux) modem_cmux_advertise_receive_buf_stats(cmux); #endif - if (is_powersaving(cmux) || is_waking_up(cmux)) { - set_state(cmux, MODEM_CMUX_STATE_CONNECTED); - LOG_DBG("Exit powersave on received frame"); - } - if (cmux->frame.dlci_address == 0) { modem_cmux_on_control_frame(cmux); } else { @@ -1241,10 +1170,8 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by switch (cmux->receive_state) { case MODEM_CMUX_RECEIVE_STATE_SOF: - cmux->frame_header_len = 0; if (byte == MODEM_CMUX_SOF) { cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_RESYNC; - cmux->frame_header_len++; break; } @@ -1256,20 +1183,6 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by * 0xF9 could also be a valid address field for DLCI 62. */ if (byte == MODEM_CMUX_SOF) { - /* Use "header_len" to count SOF bytes, only start transmitting - * flag bytes after receiving more than 3 flags. - * Don't reply flags if we are transitioning between modes or - * if T3 timer is still active (suppress residual flags). - */ - cmux->frame_header_len++; - if ((is_powersaving(cmux) || - (is_connected(cmux) && sys_timepoint_expired(cmux->t3_timepoint))) && - cmux->frame_header_len > 3) { - modem_cmux_tx_bypass(cmux, &(char){MODEM_CMUX_SOF}, 1); - } - if (is_waking_up(cmux)) { - k_work_reschedule(&cmux->transmit_work, K_NO_WAIT); - } break; } @@ -1438,15 +1351,21 @@ static void modem_cmux_receive_handler(struct k_work *item) int ret; /* Receive data from pipe */ - while ((ret = modem_pipe_receive(cmux->pipe, cmux->work_buf, sizeof(cmux->work_buf))) > 0) { - /* Process received data */ - for (int i = 0; i < ret; i++) { - modem_cmux_process_received_byte(cmux, cmux->work_buf[i]); + ret = modem_pipe_receive(cmux->pipe, cmux->work_buf, sizeof(cmux->work_buf)); + if (ret < 1) { + if (ret < 0) { + LOG_ERR("Pipe receiving error: %d", ret); } + return; } - if (ret < 0) { - LOG_ERR("Pipe receiving error: %d", ret); + + /* Process received data */ + for (int i = 0; i < ret; i++) { + modem_cmux_process_received_byte(cmux, cmux->work_buf[i]); } + + /* Reschedule received work */ + modem_work_schedule(&cmux->receive_work, K_NO_WAIT); } static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) @@ -1462,51 +1381,6 @@ static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) } } -/** Transmit bytes bypassing the CMUX buffers. - * Causes modem_cmux_transmit_handler() to be rescheduled as a result of TRANSMIT_IDLE event. - */ -static void modem_cmux_tx_bypass(struct modem_cmux *cmux, const uint8_t *data, size_t len) -{ - if (cmux == NULL) { - return; - } - - modem_pipe_transmit(cmux->pipe, data, len); -} - -static bool powersave_wait_wakeup(struct modem_cmux *cmux) -{ - static const uint8_t wakeup_pattern[] = {MODEM_CMUX_SOF, MODEM_CMUX_SOF, MODEM_CMUX_SOF, - MODEM_CMUX_SOF, MODEM_CMUX_SOF}; - int ret; - - if (is_powersaving(cmux)) { - LOG_DBG("Power saving mode, wake up first"); - set_state(cmux, MODEM_CMUX_STATE_WAKEUP); - cmux->t3_timepoint = sys_timepoint_calc(MODEM_CMUX_T3_TIMEOUT); - modem_cmux_tx_bypass(cmux, wakeup_pattern, sizeof(wakeup_pattern)); - return true; - } - - if (is_waking_up(cmux)) { - if (sys_timepoint_expired(cmux->t3_timepoint)) { - LOG_ERR("Wake up timed out, link dead"); - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); - modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); - return true; - } - if (cmux->receive_state != MODEM_CMUX_RECEIVE_STATE_RESYNC) { - /* Retry single flag, until remote wakes up */ - modem_cmux_tx_bypass(cmux, &(uint8_t){MODEM_CMUX_SOF}, 1); - return true; - } - set_state(cmux, MODEM_CMUX_STATE_CONNECTED); - LOG_DBG("Woke up from power saving mode"); - } - - return false; -} - static void modem_cmux_transmit_handler(struct k_work *item) { struct k_work_delayable *dwork = k_work_delayable_from_work(item); @@ -1529,11 +1403,6 @@ static void modem_cmux_transmit_handler(struct k_work *item) break; } - if (powersave_wait_wakeup(cmux)) { - k_mutex_unlock(&cmux->transmit_rb_lock); - return; - } - reserved_size = ring_buf_get_claim(&cmux->transmit_rb, &reserved, UINT32_MAX); ret = modem_pipe_transmit(cmux->pipe, reserved, reserved_size); @@ -1554,14 +1423,11 @@ static void modem_cmux_transmit_handler(struct k_work *item) } } + k_mutex_unlock(&cmux->transmit_rb_lock); + if (transmit_rb_empty) { - if (cmux->state == MODEM_CMUX_STATE_CONFIRM_POWERSAVE) { - set_state(cmux, MODEM_CMUX_STATE_POWERSAVE); - LOG_DBG("Entered power saving mode"); - } modem_cmux_dlci_notify_transmit_idle(cmux); } - k_mutex_unlock(&cmux->transmit_rb_lock); } static void modem_cmux_connect_handler(struct k_work *item) @@ -1858,7 +1724,6 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co cmux->user_data = config->user_data; cmux->receive_buf = config->receive_buf; cmux->receive_buf_size = config->receive_buf_size; - cmux->t3_timepoint = sys_timepoint_calc(K_NO_WAIT); sys_slist_init(&cmux->dlcis); ring_buf_init(&cmux->transmit_rb, config->transmit_buf_size, config->transmit_buf); k_mutex_init(&cmux->transmit_rb_lock); From b39bb426edcd92df7995c58276b296e7bfde168d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1262/3334] Revert "[nrf fromlist] drivers: modem: Implement support for DTR signal" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 20f2a05812d6aa8d7eb84c95ec7c8ffa21e37f66. Signed-off-by: Tomasz Moń --- drivers/modem/modem_cellular.c | 9 --------- dts/bindings/modem/zephyr,cellular-modem-device.yaml | 8 -------- include/zephyr/modem/backend/uart.h | 2 -- subsys/modem/backends/modem_backend_uart.c | 1 - subsys/modem/backends/modem_backend_uart_async.c | 8 -------- subsys/modem/backends/modem_backend_uart_async_hwfc.c | 8 -------- 6 files changed, 36 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 0079a07b10d6..64e3614b51eb 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -185,7 +185,6 @@ struct modem_cellular_config { struct gpio_dt_spec power_gpio; struct gpio_dt_spec reset_gpio; struct gpio_dt_spec wake_gpio; - struct gpio_dt_spec dtr_gpio; uint16_t power_pulse_duration_ms; uint16_t reset_pulse_duration_ms; uint16_t startup_time_ms; @@ -2096,7 +2095,6 @@ static int modem_cellular_init(const struct device *dev) { struct modem_cellular_data *data = (struct modem_cellular_data *)dev->data; struct modem_cellular_config *config = (struct modem_cellular_config *)dev->config; - const struct gpio_dt_spec *dtr_gpio = NULL; data->dev = dev; @@ -2120,15 +2118,9 @@ static int modem_cellular_init(const struct device *dev) gpio_pin_configure_dt(&config->reset_gpio, GPIO_OUTPUT_ACTIVE); } - if (modem_cellular_gpio_is_enabled(&config->dtr_gpio)) { - gpio_pin_configure_dt(&config->dtr_gpio, GPIO_OUTPUT_INACTIVE); - dtr_gpio = &config->dtr_gpio; - } - { const struct modem_backend_uart_config uart_backend_config = { .uart = config->uart, - .dtr_gpio = dtr_gpio, .receive_buf = data->uart_backend_receive_buf, .receive_buf_size = ARRAY_SIZE(data->uart_backend_receive_buf), .transmit_buf = data->uart_backend_transmit_buf, @@ -2896,7 +2888,6 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, .power_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_power_gpios, {}), \ .reset_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_reset_gpios, {}), \ .wake_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_wake_gpios, {}), \ - .dtr_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_dtr_gpios, {}), \ .power_pulse_duration_ms = (power_ms), \ .reset_pulse_duration_ms = (reset_ms), \ .startup_time_ms = (startup_ms), \ diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml index 66c7fd91d092..bff39d7f9f61 100644 --- a/dts/bindings/modem/zephyr,cellular-modem-device.yaml +++ b/dts/bindings/modem/zephyr,cellular-modem-device.yaml @@ -17,11 +17,3 @@ properties: mdm-wake-gpios: type: phandle-array description: GPIO for modem wake - - mdm-dtr-gpios: - type: phandle-array - description: | - GPIO for modem data terminal ready. - - Asserted (logical high) when UART is active and - deasserted (logical low) when UART is inactive, powered down or in low power mode. diff --git a/include/zephyr/modem/backend/uart.h b/include/zephyr/modem/backend/uart.h index 6407af8cf6af..73054b792d8e 100644 --- a/include/zephyr/modem/backend/uart.h +++ b/include/zephyr/modem/backend/uart.h @@ -68,7 +68,6 @@ struct modem_backend_uart_async { struct modem_backend_uart { const struct device *uart; - const struct gpio_dt_spec *dtr_gpio; struct modem_pipe pipe; struct k_work_delayable receive_ready_work; struct k_work transmit_idle_work; @@ -86,7 +85,6 @@ struct modem_backend_uart { struct modem_backend_uart_config { const struct device *uart; - const struct gpio_dt_spec *dtr_gpio; /* Address must be word-aligned when CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC is enabled. */ uint8_t *receive_buf; uint32_t receive_buf_size; diff --git a/subsys/modem/backends/modem_backend_uart.c b/subsys/modem/backends/modem_backend_uart.c index 13a35406f182..82242a76c019 100644 --- a/subsys/modem/backends/modem_backend_uart.c +++ b/subsys/modem/backends/modem_backend_uart.c @@ -39,7 +39,6 @@ struct modem_pipe *modem_backend_uart_init(struct modem_backend_uart *backend, memset(backend, 0x00, sizeof(*backend)); backend->uart = config->uart; - backend->dtr_gpio = config->dtr_gpio; k_work_init_delayable(&backend->receive_ready_work, modem_backend_uart_receive_ready_handler); k_work_init(&backend->transmit_idle_work, modem_backend_uart_transmit_idle_handler); diff --git a/subsys/modem/backends/modem_backend_uart_async.c b/subsys/modem/backends/modem_backend_uart_async.c index 1615120a4d5e..9b5edc8965c5 100644 --- a/subsys/modem/backends/modem_backend_uart_async.c +++ b/subsys/modem/backends/modem_backend_uart_async.c @@ -11,7 +11,6 @@ LOG_MODULE_REGISTER(modem_backend_uart_async, CONFIG_MODEM_MODULES_LOG_LEVEL); #include -#include #include enum { @@ -158,10 +157,6 @@ static int modem_backend_uart_async_open(void *data) atomic_clear(&backend->async.common.state); ring_buf_reset(&backend->async.receive_rb); - if (backend->dtr_gpio) { - gpio_pin_set_dt(backend->dtr_gpio, 1); - } - atomic_set_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_RX_BUF0_USED_BIT); atomic_set_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_RECEIVING_BIT); @@ -273,9 +268,6 @@ static int modem_backend_uart_async_close(void *data) atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); uart_tx_abort(backend->uart); uart_rx_disable(backend->uart); - if (backend->dtr_gpio) { - gpio_pin_set_dt(backend->dtr_gpio, 0); - } return 0; } diff --git a/subsys/modem/backends/modem_backend_uart_async_hwfc.c b/subsys/modem/backends/modem_backend_uart_async_hwfc.c index 3aaaad2e196c..61d307604e5c 100644 --- a/subsys/modem/backends/modem_backend_uart_async_hwfc.c +++ b/subsys/modem/backends/modem_backend_uart_async_hwfc.c @@ -11,7 +11,6 @@ LOG_MODULE_REGISTER(modem_backend_uart_async_hwfc, CONFIG_MODEM_MODULES_LOG_LEVEL); #include -#include #include struct rx_buf_t { @@ -222,10 +221,6 @@ static int modem_backend_uart_async_hwfc_open(void *data) return -ENOMEM; } - if (backend->dtr_gpio) { - gpio_pin_set_dt(backend->dtr_gpio, 1); - } - atomic_clear(&backend->async.common.state); atomic_set_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT); @@ -362,9 +357,6 @@ static int modem_backend_uart_async_hwfc_close(void *data) uart_rx_disable(backend->uart); } - if (backend->dtr_gpio) { - gpio_pin_set_dt(backend->dtr_gpio, 0); - } return 0; } From 76a049e2a9d877ad0bc4b618301840a4862e6f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1263/3334] Revert "[nrf fromlist] modem: cmux: Define encoding and decoding functions for commands" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 66e2865edb8ecbf67d1651fdb916463454eb4d78. Signed-off-by: Tomasz Moń --- subsys/modem/modem_cmux.c | 314 ++++++----------------- tests/subsys/modem/modem_cmux/src/main.c | 19 -- 2 files changed, 83 insertions(+), 250 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 3bebde19d462..fb0b04aa6469 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -30,8 +30,7 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); * * PN would be 10 bytes, but that is not implemented */ -#define MODEM_CMUX_CMD_DATA_SIZE_MAX 5 /* Max size of information field of UIH frame */ -#define MODEM_CMUX_CMD_HEADER_SIZE 2 /* command type + length */ +#define MODEM_CMUX_CMD_DATA_SIZE_MAX 5 #define MODEM_CMUX_CMD_FRAME_SIZE_MAX (MODEM_CMUX_HEADER_SIZE + \ MODEM_CMUX_CMD_DATA_SIZE_MAX) @@ -81,7 +80,7 @@ struct modem_cmux_command_length { struct modem_cmux_command { struct modem_cmux_command_type type; struct modem_cmux_command_length length; - uint8_t value[MODEM_CMUX_CMD_DATA_SIZE_MAX - 2]; /* Subtract type and length bytes */ + uint8_t value[]; }; struct modem_cmux_msc_signals { @@ -99,182 +98,53 @@ struct modem_cmux_msc_addr { uint8_t dlci_address: 6; /**< DLCI channel address */ }; +struct modem_cmux_command_msc { + struct modem_cmux_command command; + uint8_t value[2]; +}; + static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address); static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux); -static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) -{ - cmux->state = state; - k_event_set(&cmux->event, BIT(state)); -} - -static bool wait_state(struct modem_cmux *cmux, enum modem_cmux_state state, k_timeout_t timeout) -{ - return k_event_wait(&cmux->event, BIT(state), false, timeout) == BIT(state); -} - -static bool is_connected(struct modem_cmux *cmux) +static int modem_cmux_wrap_command(struct modem_cmux_command **command, const uint8_t *data, + uint16_t data_len) { - return cmux->state == MODEM_CMUX_STATE_CONNECTED; -} - -static bool modem_cmux_command_type_is_valid(const struct modem_cmux_command_type type) -{ - /* All commands are only 7 bits, so EA is always set */ - if (type.ea == 0) { - return false; - } - switch (type.value) { - case MODEM_CMUX_COMMAND_NSC: - case MODEM_CMUX_COMMAND_TEST: - case MODEM_CMUX_COMMAND_PSC: - case MODEM_CMUX_COMMAND_RLS: - case MODEM_CMUX_COMMAND_FCOFF: - case MODEM_CMUX_COMMAND_PN: - case MODEM_CMUX_COMMAND_RPN: - case MODEM_CMUX_COMMAND_FCON: - case MODEM_CMUX_COMMAND_CLD: - case MODEM_CMUX_COMMAND_SNC: - case MODEM_CMUX_COMMAND_MSC: - return true; - default: - return false; + if ((data == NULL) || (data_len < 2)) { + return -EINVAL; } -} -static bool modem_cmux_command_length_is_valid(const struct modem_cmux_command_length length) -{ - /* All commands are shorter than 127 bytes, so EA is always set */ - if (length.ea == 0) { - return false; - } - if (length.value > (MODEM_CMUX_CMD_DATA_SIZE_MAX - MODEM_CMUX_CMD_HEADER_SIZE)) { - return false; - } - return true; -} + (*command) = (struct modem_cmux_command *)data; -static bool modem_cmux_command_is_valid(const struct modem_cmux_command *command) -{ - if (!modem_cmux_command_type_is_valid(command->type)) { - return false; - } - if (!modem_cmux_command_length_is_valid(command->length)) { - return false; - } - /* Verify known value sizes as specified in 3GPP TS 27.010 - * section 5.4.6.3 Message Type and Actions - */ - switch (command->type.value) { - case MODEM_CMUX_COMMAND_PN: - return command->length.value == 8; - case MODEM_CMUX_COMMAND_TEST: - return (command->length.value > 0 && - command->length.value <= MODEM_CMUX_CMD_DATA_SIZE_MAX - 2); - case MODEM_CMUX_COMMAND_MSC: - return command->length.value == 2 || command->length.value == 3; - case MODEM_CMUX_COMMAND_NSC: - return command->length.value == 1; - case MODEM_CMUX_COMMAND_RPN: - return command->length.value == 1 || command->length.value == 8; - case MODEM_CMUX_COMMAND_RLS: - return command->length.value == 2; - case MODEM_CMUX_COMMAND_SNC: - return command->length.value == 1 || command->length.value == 3; - default: - return command->length.value == 0; + if (((*command)->length.ea == 0) || ((*command)->type.ea == 0)) { + return -EINVAL; } -} -static struct modem_cmux_command_type modem_cmux_command_type_decode(const uint8_t byte) -{ - struct modem_cmux_command_type type = { - .ea = (byte & MODEM_CMUX_EA) ? 1 : 0, - .cr = (byte & MODEM_CMUX_CR) ? 1 : 0, - .value = (byte >> 2) & 0x3F, - }; - - if (type.ea == 0) { - return (struct modem_cmux_command_type){0}; + if ((*command)->length.value != (data_len - 2)) { + return -EINVAL; } - return type; -} - -static uint8_t modem_cmux_command_type_encode(const struct modem_cmux_command_type type) -{ - return (type.ea ? MODEM_CMUX_EA : 0) | - (type.cr ? MODEM_CMUX_CR : 0) | - ((type.value & 0x3F) << 2); + return 0; } -static struct modem_cmux_command_length modem_cmux_command_length_decode(const uint8_t byte) +static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) { - struct modem_cmux_command_length length = { - .ea = (byte & MODEM_CMUX_EA) ? 1 : 0, - .value = (byte >> 1) & 0x7F, - }; - - if (length.ea == 0) { - return (struct modem_cmux_command_length){0}; - } - - return length; + cmux->state = state; + k_event_set(&cmux->event, BIT(state)); } -static uint8_t modem_cmux_command_length_encode(const struct modem_cmux_command_length length) +static bool wait_state(struct modem_cmux *cmux, enum modem_cmux_state state, k_timeout_t timeout) { - return (length.ea ? MODEM_CMUX_EA : 0) | - ((length.value & 0x7F) << 1); + return k_event_wait(&cmux->event, BIT(state), false, timeout) == BIT(state); } -static struct modem_cmux_command modem_cmux_command_decode(const uint8_t *data, size_t len) +static bool is_connected(struct modem_cmux *cmux) { - if (len < 2) { - return (struct modem_cmux_command){0}; - } - - struct modem_cmux_command command = { - .type = modem_cmux_command_type_decode(data[0]), - .length = modem_cmux_command_length_decode(data[1]), - }; - - if (command.type.ea == 0 || command.length.ea == 0 || - command.length.value > MODEM_CMUX_CMD_DATA_SIZE_MAX || - (2 + command.length.value) > len) { - return (struct modem_cmux_command){0}; - } - - memcpy(&command.value[0], &data[2], command.length.value); - - return command; + return cmux->state == MODEM_CMUX_STATE_CONNECTED; } -/** - * @brief Encode command into a shared buffer - * - * Not a thread safe, so can only be used within a workqueue context and data - * must be copied out to a TX ringbuffer. - * - * @param command command to encode - * @param len encoded length of the command is written here - * @return pointer to encoded command buffer on success, NULL on failure - */ -static uint8_t *modem_cmux_command_encode(struct modem_cmux_command *command, uint16_t *len) +static struct modem_cmux_command *modem_cmux_command_wrap(const uint8_t *data) { - static uint8_t buf[MODEM_CMUX_CMD_DATA_SIZE_MAX]; - - __ASSERT_NO_MSG(len != NULL); - __ASSERT_NO_MSG(command != NULL); - __ASSERT_NO_MSG(modem_cmux_command_is_valid(command)); - - buf[0] = modem_cmux_command_type_encode(command->type); - buf[1] = modem_cmux_command_length_encode(command->length); - if (command->length.value > 0) { - memcpy(&buf[2], &command->value[0], command->length.value); - } - *len = 2 + command->length.value; - return buf; + return (struct modem_cmux_command *)data; } static struct modem_cmux_msc_signals modem_cmux_msc_signals_decode(const uint8_t byte) @@ -551,7 +421,7 @@ static bool modem_cmux_transmit_cmd_frame(struct modem_cmux *cmux, const struct modem_cmux_frame *frame) { uint16_t space; - struct modem_cmux_command command; + struct modem_cmux_command *command; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); space = ring_buf_space_get(&cmux->transmit_rb); @@ -563,9 +433,8 @@ static bool modem_cmux_transmit_cmd_frame(struct modem_cmux *cmux, } modem_cmux_log_transmit_frame(frame); - command = modem_cmux_command_decode(frame->data, frame->data_len); - if (modem_cmux_command_is_valid(&command)) { - modem_cmux_log_transmit_command(&command); + if (modem_cmux_wrap_command(&command, frame->data, frame->data_len) == 0) { + modem_cmux_log_transmit_command(command); } modem_cmux_transmit_frame(cmux, frame); @@ -608,7 +477,7 @@ static int16_t modem_cmux_transmit_data_frame(struct modem_cmux *cmux, static void modem_cmux_acknowledge_received_frame(struct modem_cmux *cmux) { - struct modem_cmux_command_type command; + struct modem_cmux_command *command; struct modem_cmux_frame frame; uint8_t data[MODEM_CMUX_CMD_DATA_SIZE_MAX]; @@ -619,9 +488,8 @@ static void modem_cmux_acknowledge_received_frame(struct modem_cmux *cmux) memcpy(&frame, &cmux->frame, sizeof(cmux->frame)); memcpy(data, cmux->frame.data, cmux->frame.data_len); - command = modem_cmux_command_type_decode(data[0]); - command.cr = 0; - data[0] = modem_cmux_command_type_encode(command); + modem_cmux_wrap_command(&command, data, cmux->frame.data_len); + command->type.cr = 0; frame.data = data; frame.data_len = cmux->frame.data_len; @@ -648,34 +516,29 @@ static void modem_cmux_send_msc(struct modem_cmux *cmux, struct modem_cmux_dlci .rtr = dlci->state == MODEM_CMUX_DLCI_STATE_OPEN ? 1 : 0, .dv = 1, }; - struct modem_cmux_command cmd = { - .type = { - .ea = 1, - .cr = 1, - .value = MODEM_CMUX_COMMAND_MSC, - }, - .length = { - .ea = 1, - .value = 2, + struct modem_cmux_command_msc cmd = { + .command = { + .type = { + .ea = 1, + .cr = 1, + .value = MODEM_CMUX_COMMAND_MSC, + }, + .length = { + .ea = 1, + .value = sizeof(cmd.value), + }, }, .value[0] = modem_cmux_msc_addr_encode(addr), .value[1] = modem_cmux_msc_signals_encode(signals), }; - uint16_t len; - uint8_t *data = modem_cmux_command_encode(&cmd, &len); - - if (data == NULL) { - return; - } - struct modem_cmux_frame frame = { .dlci_address = 0, .cr = cmux->initiator, .pf = false, .type = MODEM_CMUX_FRAME_TYPE_UIH, - .data = data, - .data_len = len, + .data = (void *)&cmd, + .data_len = sizeof(cmd), }; LOG_DBG("Sending MSC command for DLCI %u, FC:%d RTR: %d DV: %d", addr.dlci_address, @@ -792,44 +655,41 @@ static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) static void modem_cmux_respond_unsupported_cmd(struct modem_cmux *cmux) { struct modem_cmux_frame frame = cmux->frame; - struct modem_cmux_command cmd = modem_cmux_command_decode(frame.data, frame.data_len); + struct modem_cmux_command *cmd; - if (!modem_cmux_command_is_valid(&cmd)) { + if (modem_cmux_wrap_command(&cmd, frame.data, frame.data_len) < 0) { LOG_WRN("Invalid command"); return; } - - /* 3GPP TS 27.010: 5.4.6.3.8 Non Supported Command Response (NSC) */ - struct modem_cmux_command nsc_cmd = { - .type = { - .ea = 1, - .cr = 0, - .value = MODEM_CMUX_COMMAND_NSC, - }, - .length = { - .ea = 1, - .value = 1, + struct { + /* 3GPP TS 27.010: 5.4.6.3.8 Non Supported Command Response (NSC) */ + struct modem_cmux_command nsc; + struct modem_cmux_command_type value; + } nsc_cmd = { + .nsc = { + .type = { + .ea = 1, + .cr = 0, + .value = MODEM_CMUX_COMMAND_NSC, + }, + .length = { + .ea = 1, + .value = 1, + }, }, - .value[0] = modem_cmux_command_type_encode(cmd.type), + .value = cmd->type, }; - uint16_t len; - uint8_t *data = modem_cmux_command_encode(&nsc_cmd, &len); - - if (data == NULL) { - return; - } - - frame.data = data; - frame.data_len = len; + frame.data = (uint8_t *)&nsc_cmd; + frame.data_len = sizeof(nsc_cmd); modem_cmux_transmit_cmd_frame(cmux, &frame); } static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) { - struct modem_cmux_command command; + struct modem_cmux_command *command; if ((cmux->state != MODEM_CMUX_STATE_CONNECTED) && (cmux->state != MODEM_CMUX_STATE_DISCONNECTING)) { @@ -837,19 +697,18 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) return; } - command = modem_cmux_command_decode(cmux->frame.data, cmux->frame.data_len); - if (!modem_cmux_command_is_valid(&command)) { + if (modem_cmux_wrap_command(&command, cmux->frame.data, cmux->frame.data_len) < 0) { LOG_WRN("Invalid command"); return; } - modem_cmux_log_received_command(&command); + modem_cmux_log_received_command(command); - if (!command.type.cr) { + if (!command->type.cr) { LOG_DBG("Received response command"); - switch (command.type.value) { + switch (command->type.value) { case MODEM_CMUX_COMMAND_CLD: - modem_cmux_on_cld_command(cmux, &command); + modem_cmux_on_cld_command(cmux, command); break; default: /* Responses to other commands are ignored */ @@ -858,13 +717,13 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) return; } - switch (command.type.value) { + switch (command->type.value) { case MODEM_CMUX_COMMAND_CLD: - modem_cmux_on_cld_command(cmux, &command); + modem_cmux_on_cld_command(cmux, command); break; case MODEM_CMUX_COMMAND_MSC: - modem_cmux_on_msc_command(cmux, &command); + modem_cmux_on_msc_command(cmux, command); break; case MODEM_CMUX_COMMAND_FCON: @@ -1462,6 +1321,8 @@ static void modem_cmux_disconnect_handler(struct k_work *item) { struct k_work_delayable *dwork = k_work_delayable_from_work(item); struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, disconnect_work); + struct modem_cmux_command *command; + uint8_t data[2]; if (cmux->state == MODEM_CMUX_STATE_DISCONNECTING) { disconnect(cmux); @@ -1470,21 +1331,12 @@ static void modem_cmux_disconnect_handler(struct k_work *item) k_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); } - struct modem_cmux_command command = { - .type.ea = 1, - .type.cr = 1, - .type.value = MODEM_CMUX_COMMAND_CLD, - .length.ea = 1, - .length.value = 0, - }; - - uint16_t len; - uint8_t *data = modem_cmux_command_encode(&command, &len); - - if (data == NULL) { - return; - } - + command = modem_cmux_command_wrap(data); + command->type.ea = 1; + command->type.cr = 1; + command->type.value = MODEM_CMUX_COMMAND_CLD; + command->length.ea = 1; + command->length.value = 0; struct modem_cmux_frame frame = { .dlci_address = 0, @@ -1492,7 +1344,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) .pf = false, .type = MODEM_CMUX_FRAME_TYPE_UIH, .data = data, - .data_len = len, + .data_len = sizeof(data), }; /* Transmit close down command */ diff --git a/tests/subsys/modem/modem_cmux/src/main.c b/tests/subsys/modem/modem_cmux/src/main.c index b40af7e0de89..67833baabe76 100644 --- a/tests/subsys/modem/modem_cmux/src/main.c +++ b/tests/subsys/modem/modem_cmux/src/main.c @@ -937,23 +937,4 @@ ZTEST(modem_cmux, test_modem_cmux_invalid_cr) zassert_false(events, "Wrong CMD should have been ignored"); } -ZTEST(modem_cmux, test_modem_cmux_invalid_command) -{ - static uint8_t invalid_cmd[] = {0xF9, 0x03, 0xEF, 0x09, 0x00, - 0x00, 0x00, 0x00, 0xFB, 0xF9}; - uint32_t events; - - modem_backend_mock_put(&bus_mock, invalid_cmd, - sizeof(invalid_cmd)); - - events = k_event_wait_all(&cmux_event, - (MODEM_CMUX_EVENT_CONNECTED | MODEM_CMUX_EVENT_DISCONNECTED), - false, K_SECONDS(1)); - - zassert_false(events, "Wrong CMD should have been ignored"); - - /* Invalid command should not cause any response */ - zassert_equal(0, modem_backend_mock_get(&bus_mock, buffer1, sizeof(buffer1))); -} - ZTEST_SUITE(modem_cmux, NULL, test_modem_cmux_setup, test_modem_cmux_before, NULL, NULL); From f59880b80b943239582ea05c3fa019232801b1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1264/3334] Revert "[nrf fromtree] modem: optional dedicated workqueue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ce9e6624fd62d16f8972aa57bbe9eed7218ea0f6. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.3.rst | 4 -- subsys/modem/CMakeLists.txt | 1 - subsys/modem/Kconfig | 15 ------ .../modem/backends/modem_backend_uart_async.c | 11 ++--- .../backends/modem_backend_uart_async_hwfc.c | 13 +++-- .../modem/backends/modem_backend_uart_isr.c | 9 ++-- subsys/modem/modem_chat.c | 18 +++---- subsys/modem/modem_cmux.c | 26 +++++----- subsys/modem/modem_ppp.c | 10 ++-- subsys/modem/modem_ubx.c | 4 +- subsys/modem/modem_workqueue.c | 39 --------------- subsys/modem/modem_workqueue.h | 49 ------------------- 12 files changed, 40 insertions(+), 159 deletions(-) delete mode 100644 subsys/modem/modem_workqueue.c delete mode 100644 subsys/modem/modem_workqueue.h diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index 718e4ad3ba33..43b217ae205c 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -171,10 +171,6 @@ New APIs and options * :kconfig:option:`CONFIG_HAWKBIT_REBOOT_NONE` -* Modem - - * :kconfig:option:`CONFIG_MODEM_DEDICATED_WORKQUEUE` - * Networking * Sockets diff --git a/subsys/modem/CMakeLists.txt b/subsys/modem/CMakeLists.txt index a1db3ab90361..c374bcab9cff 100644 --- a/subsys/modem/CMakeLists.txt +++ b/subsys/modem/CMakeLists.txt @@ -5,7 +5,6 @@ if(CONFIG_MODEM_MODULES) zephyr_library() -zephyr_library_sources_ifdef(CONFIG_MODEM_DEDICATED_WORKQUEUE modem_workqueue.c) zephyr_library_sources_ifdef(CONFIG_MODEM_CHAT modem_chat.c) zephyr_library_sources_ifdef(CONFIG_MODEM_CMUX modem_cmux.c) zephyr_library_sources_ifdef(CONFIG_MODEM_PIPE modem_pipe.c) diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index dfcb7ddae9a3..34114cd3893b 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -6,21 +6,6 @@ menuconfig MODEM_MODULES if MODEM_MODULES -config MODEM_DEDICATED_WORKQUEUE - bool "Use a dedicated workqueue for modem operations" - -if MODEM_DEDICATED_WORKQUEUE - -config MODEM_DEDICATED_WORKQUEUE_STACK_SIZE - int "Modem dedicated workqueue stack size" - default 1024 - -config MODEM_DEDICATED_WORKQUEUE_PRIORITY - int "Modem dedicated workqueue priority" - default SYSTEM_WORKQUEUE_PRIORITY - -endif # MODEM_DEDICATED_WORKQUEUE - config MODEM_CHAT bool "Modem chat module" select RING_BUFFER diff --git a/subsys/modem/backends/modem_backend_uart_async.c b/subsys/modem/backends/modem_backend_uart_async.c index 9b5edc8965c5..d96f513d6061 100644 --- a/subsys/modem/backends/modem_backend_uart_async.c +++ b/subsys/modem/backends/modem_backend_uart_async.c @@ -5,7 +5,6 @@ */ #include "modem_backend_uart_async.h" -#include "../modem_workqueue.h" #include LOG_MODULE_REGISTER(modem_backend_uart_async, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -59,7 +58,7 @@ static void modem_backend_uart_async_event_handler(const struct device *dev, case UART_TX_DONE: atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_TRANSMITTING_BIT); - modem_work_submit(&backend->transmit_idle_work); + k_work_submit(&backend->transmit_idle_work); break; case UART_TX_ABORTED: @@ -68,7 +67,7 @@ static void modem_backend_uart_async_event_handler(const struct device *dev, } atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_TRANSMITTING_BIT); - modem_work_submit(&backend->transmit_idle_work); + k_work_submit(&backend->transmit_idle_work); break; @@ -128,7 +127,7 @@ static void modem_backend_uart_async_event_handler(const struct device *dev, } k_spin_unlock(&backend->async.receive_rb_lock, key); - modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); break; case UART_RX_DISABLED: @@ -145,7 +144,7 @@ static void modem_backend_uart_async_event_handler(const struct device *dev, } if (modem_backend_uart_async_is_uart_stopped(backend)) { - modem_work_submit(&backend->async.common.rx_disabled_work); + k_work_submit(&backend->async.common.rx_disabled_work); } } @@ -255,7 +254,7 @@ static int modem_backend_uart_async_receive(void *data, uint8_t *buf, size_t siz k_spin_unlock(&backend->async.receive_rb_lock, key); if (!empty) { - modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); } return (int)received; diff --git a/subsys/modem/backends/modem_backend_uart_async_hwfc.c b/subsys/modem/backends/modem_backend_uart_async_hwfc.c index 61d307604e5c..78855daa4eb3 100644 --- a/subsys/modem/backends/modem_backend_uart_async_hwfc.c +++ b/subsys/modem/backends/modem_backend_uart_async_hwfc.c @@ -5,7 +5,6 @@ */ #include "modem_backend_uart_async.h" -#include "../modem_workqueue.h" #include LOG_MODULE_REGISTER(modem_backend_uart_async_hwfc, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -137,7 +136,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev case UART_TX_DONE: atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_TRANSMIT_BIT); - modem_work_submit(&backend->transmit_idle_work); + k_work_submit(&backend->transmit_idle_work); break; case UART_TX_ABORTED: @@ -146,7 +145,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev } atomic_clear_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_TRANSMIT_BIT); - modem_work_submit(&backend->transmit_idle_work); + k_work_submit(&backend->transmit_idle_work); break; @@ -183,7 +182,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev rx_buf_unref(&backend->async, evt->data.rx.buf); break; } - modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); } break; @@ -192,7 +191,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT)) { if (!atomic_test_and_set_bit(&backend->async.common.state, MODEM_BACKEND_UART_ASYNC_STATE_RECOVERY_BIT)) { - modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); LOG_DBG("RX recovery started"); } } @@ -207,7 +206,7 @@ static void modem_backend_uart_async_hwfc_event_handler(const struct device *dev } if (modem_backend_uart_async_hwfc_is_uart_stopped(backend)) { - modem_work_submit(&backend->async.common.rx_disabled_work); + k_work_submit(&backend->async.common.rx_disabled_work); } } @@ -336,7 +335,7 @@ static int modem_backend_uart_async_hwfc_receive(void *data, uint8_t *buf, size_ if (backend->async.rx_event.len != 0 || k_msgq_num_used_get(&backend->async.rx_queue) != 0) { - modem_work_schedule(&backend->receive_ready_work, K_NO_WAIT); + k_work_schedule(&backend->receive_ready_work, K_NO_WAIT); } modem_backend_uart_async_hwfc_rx_recovery(backend); diff --git a/subsys/modem/backends/modem_backend_uart_isr.c b/subsys/modem/backends/modem_backend_uart_isr.c index 6c6c27c2db2e..a9266cc86657 100644 --- a/subsys/modem/backends/modem_backend_uart_isr.c +++ b/subsys/modem/backends/modem_backend_uart_isr.c @@ -5,7 +5,6 @@ */ #include "modem_backend_uart_isr.h" -#include "../modem_workqueue.h" #include LOG_MODULE_REGISTER(modem_backend_uart_isr, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -55,11 +54,11 @@ static void modem_backend_uart_isr_irq_handler_receive_ready(struct modem_backen * It temporarily disables the UART RX IRQ when swapping buffers * which can cause byte loss at higher baud rates. */ - modem_work_schedule(&backend->receive_ready_work, - K_MSEC(CONFIG_MODEM_BACKEND_UART_ISR_RECEIVE_IDLE_TIMEOUT_MS)); + k_work_schedule(&backend->receive_ready_work, + K_MSEC(CONFIG_MODEM_BACKEND_UART_ISR_RECEIVE_IDLE_TIMEOUT_MS)); } else { /* The buffer is getting full. Run the work item immediately to free up space. */ - modem_work_reschedule(&backend->receive_ready_work, K_NO_WAIT); + k_work_reschedule(&backend->receive_ready_work, K_NO_WAIT); } } @@ -71,7 +70,7 @@ static void modem_backend_uart_isr_irq_handler_transmit_ready(struct modem_backe if (ring_buf_is_empty(&backend->isr.transmit_rb) == true) { uart_irq_tx_disable(backend->uart); - modem_work_submit(&backend->transmit_idle_work); + k_work_submit(&backend->transmit_idle_work); return; } diff --git a/subsys/modem/modem_chat.c b/subsys/modem/modem_chat.c index 001be1c7e707..088a2bc038dc 100644 --- a/subsys/modem/modem_chat.c +++ b/subsys/modem/modem_chat.c @@ -15,8 +15,6 @@ LOG_MODULE_REGISTER(modem_chat, CONFIG_MODEM_MODULES_LOG_LEVEL); #include -#include "modem_workqueue.h" - const struct modem_chat_match modem_chat_any_match = MODEM_CHAT_MATCH("", "", NULL); const struct modem_chat_match modem_chat_empty_matches[0]; const struct modem_chat_script_chat modem_chat_empty_script_chats[0]; @@ -129,7 +127,7 @@ static void modem_chat_set_script_send_state(struct modem_chat *chat, static void modem_chat_script_send(struct modem_chat *chat) { modem_chat_set_script_send_state(chat, MODEM_CHAT_SCRIPT_SEND_STATE_REQUEST); - modem_work_submit(&chat->script_send_work); + k_work_submit(&chat->script_send_work); } static void modem_chat_script_set_response_matches(struct modem_chat *chat) @@ -180,7 +178,7 @@ static void modem_chat_script_chat_schedule_send_timeout(struct modem_chat *chat { uint16_t timeout = modem_chat_script_chat_get_send_timeout(chat); - modem_work_schedule(&chat->script_send_timeout_work, K_MSEC(timeout)); + k_work_schedule(&chat->script_send_timeout_work, K_MSEC(timeout)); } static void modem_chat_script_next(struct modem_chat *chat, bool initial) @@ -235,7 +233,7 @@ static void modem_chat_script_start(struct modem_chat *chat, const struct modem_ /* Start timeout work if script started */ if (chat->script != NULL) { - modem_work_schedule(&chat->script_timeout_work, K_SECONDS(chat->script->timeout)); + k_work_schedule(&chat->script_timeout_work, K_SECONDS(chat->script->timeout)); } } @@ -744,7 +742,7 @@ static void modem_chat_process_handler(struct k_work *item) /* Process data */ modem_chat_process_bytes(chat); - modem_work_submit(&chat->receive_work); + k_work_submit(&chat->receive_work); } static void modem_chat_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_event event, @@ -754,11 +752,11 @@ static void modem_chat_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_ev switch (event) { case MODEM_PIPE_EVENT_RECEIVE_READY: - modem_work_submit(&chat->receive_work); + k_work_submit(&chat->receive_work); break; case MODEM_PIPE_EVENT_TRANSMIT_IDLE: - modem_work_submit(&chat->script_send_work); + k_work_submit(&chat->script_send_work); break; default: @@ -882,7 +880,7 @@ int modem_chat_run_script_async(struct modem_chat *chat, const struct modem_chat k_sem_reset(&chat->script_stopped_sem); chat->pending_script = script; - modem_work_submit(&chat->script_run_work); + k_work_submit(&chat->script_run_work); return 0; } @@ -905,7 +903,7 @@ int modem_chat_run_script(struct modem_chat *chat, const struct modem_chat_scrip void modem_chat_script_abort(struct modem_chat *chat) { - modem_work_submit(&chat->script_abort_work); + k_work_submit(&chat->script_abort_work); } void modem_chat_release(struct modem_chat *chat) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index fb0b04aa6469..b311ab7865d9 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -13,8 +13,6 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #include -#include "modem_workqueue.h" - #define MODEM_CMUX_SOF (0xF9) #define MODEM_CMUX_FCS_POLYNOMIAL (0xE0) #define MODEM_CMUX_FCS_INIT_VALUE (0xFF) @@ -349,11 +347,11 @@ static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_eve switch (event) { case MODEM_PIPE_EVENT_RECEIVE_READY: - modem_work_schedule(&cmux->receive_work, K_NO_WAIT); + k_work_schedule(&cmux->receive_work, K_NO_WAIT); break; case MODEM_PIPE_EVENT_TRANSMIT_IDLE: - modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); + k_work_schedule(&cmux->transmit_work, K_NO_WAIT); break; default: @@ -413,7 +411,7 @@ static uint16_t modem_cmux_transmit_frame(struct modem_cmux *cmux, buf[0] = fcs; buf[1] = MODEM_CMUX_SOF; ring_buf_put(&cmux->transmit_rb, buf, 2); - modem_work_schedule(&cmux->transmit_work, K_NO_WAIT); + k_work_schedule(&cmux->transmit_work, K_NO_WAIT); return data_len; } @@ -1224,7 +1222,7 @@ static void modem_cmux_receive_handler(struct k_work *item) } /* Reschedule received work */ - modem_work_schedule(&cmux->receive_work, K_NO_WAIT); + k_work_schedule(&cmux->receive_work, K_NO_WAIT); } static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) @@ -1314,7 +1312,7 @@ static void modem_cmux_connect_handler(struct k_work *item) }; modem_cmux_transmit_cmd_frame(cmux, &frame); - modem_work_schedule(&cmux->connect_work, MODEM_CMUX_T1_TIMEOUT); + k_work_schedule(&cmux->connect_work, MODEM_CMUX_T1_TIMEOUT); } static void modem_cmux_disconnect_handler(struct k_work *item) @@ -1349,7 +1347,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) /* Transmit close down command */ modem_cmux_transmit_cmd_frame(cmux, &frame); - modem_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); + k_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); } #if CONFIG_MODEM_STATS @@ -1399,7 +1397,7 @@ static int modem_cmux_dlci_pipe_api_open(void *data) K_SPINLOCK_BREAK; } - modem_work_schedule(&dlci->open_work, K_NO_WAIT); + k_work_schedule(&dlci->open_work, K_NO_WAIT); } return ret; @@ -1478,7 +1476,7 @@ static int modem_cmux_dlci_pipe_api_close(void *data) K_SPINLOCK_BREAK; } - modem_work_schedule(&dlci->close_work, K_NO_WAIT); + k_work_schedule(&dlci->close_work, K_NO_WAIT); } return ret; @@ -1516,7 +1514,7 @@ static void modem_cmux_dlci_open_handler(struct k_work *item) }; modem_cmux_transmit_cmd_frame(dlci->cmux, &frame); - modem_work_schedule(&dlci->open_work, MODEM_CMUX_T1_TIMEOUT); + k_work_schedule(&dlci->open_work, MODEM_CMUX_T1_TIMEOUT); } static void modem_cmux_dlci_close_handler(struct k_work *item) @@ -1545,7 +1543,7 @@ static void modem_cmux_dlci_close_handler(struct k_work *item) }; modem_cmux_transmit_cmd_frame(cmux, &frame); - modem_work_schedule(&dlci->close_work, MODEM_CMUX_T1_TIMEOUT); + k_work_schedule(&dlci->close_work, MODEM_CMUX_T1_TIMEOUT); } static void modem_cmux_dlci_pipes_release(struct modem_cmux *cmux) @@ -1668,7 +1666,7 @@ int modem_cmux_connect_async(struct modem_cmux *cmux) } if (k_work_delayable_is_pending(&cmux->connect_work) == false) { - modem_work_schedule(&cmux->connect_work, K_NO_WAIT); + k_work_schedule(&cmux->connect_work, K_NO_WAIT); } } @@ -1706,7 +1704,7 @@ int modem_cmux_disconnect_async(struct modem_cmux *cmux) } if (k_work_delayable_is_pending(&cmux->disconnect_work) == false) { - modem_work_schedule(&cmux->disconnect_work, K_NO_WAIT); + k_work_schedule(&cmux->disconnect_work, K_NO_WAIT); } } diff --git a/subsys/modem/modem_ppp.c b/subsys/modem/modem_ppp.c index 09b62bdaa11e..cd13d4ac8b1a 100644 --- a/subsys/modem/modem_ppp.c +++ b/subsys/modem/modem_ppp.c @@ -10,8 +10,6 @@ #include #include -#include "modem_workqueue.h" - #include LOG_MODULE_REGISTER(modem_ppp, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -329,12 +327,12 @@ static void modem_ppp_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_eve switch (event) { case MODEM_PIPE_EVENT_RECEIVE_READY: - modem_work_submit(&ppp->process_work); + k_work_submit(&ppp->process_work); break; case MODEM_PIPE_EVENT_OPENED: case MODEM_PIPE_EVENT_TRANSMIT_IDLE: - modem_work_submit(&ppp->send_work); + k_work_submit(&ppp->send_work); break; default: @@ -417,7 +415,7 @@ static void modem_ppp_process_handler(struct k_work *item) modem_ppp_process_received_byte(ppp, ppp->receive_buf[i]); } - modem_work_submit(&ppp->process_work); + k_work_submit(&ppp->process_work); } static void modem_ppp_ppp_api_init(struct net_if *iface) @@ -480,7 +478,7 @@ static int modem_ppp_ppp_api_send(const struct device *dev, struct net_pkt *pkt) net_pkt_ref(pkt); k_fifo_put(&ppp->tx_pkt_fifo, pkt); - modem_work_submit(&ppp->send_work); + k_work_submit(&ppp->send_work); return 0; } diff --git a/subsys/modem/modem_ubx.c b/subsys/modem/modem_ubx.c index 89d968caf799..22586b8444d0 100644 --- a/subsys/modem/modem_ubx.c +++ b/subsys/modem/modem_ubx.c @@ -9,8 +9,6 @@ #include #include -#include "modem_workqueue.h" - #include LOG_MODULE_REGISTER(modem_ubx, CONFIG_MODEM_MODULES_LOG_LEVEL); @@ -21,7 +19,7 @@ static void modem_ubx_pipe_callback(struct modem_pipe *pipe, struct modem_ubx *ubx = (struct modem_ubx *)user_data; if (event == MODEM_PIPE_EVENT_RECEIVE_READY) { - modem_work_submit(&ubx->process_work); + k_work_submit(&ubx->process_work); } } diff --git a/subsys/modem/modem_workqueue.c b/subsys/modem/modem_workqueue.c deleted file mode 100644 index 4fb5d716c5c7..000000000000 --- a/subsys/modem/modem_workqueue.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 Embeint Pty Ltd - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include "modem_workqueue.h" - -static struct k_work_q modem_work_q; -static K_THREAD_STACK_DEFINE(modem_stack_area, CONFIG_MODEM_DEDICATED_WORKQUEUE_STACK_SIZE); - -int modem_work_submit(struct k_work *work) -{ - return k_work_submit_to_queue(&modem_work_q, work); -} - -int modem_work_schedule(struct k_work_delayable *dwork, k_timeout_t delay) -{ - return k_work_schedule_for_queue(&modem_work_q, dwork, delay); -} - -int modem_work_reschedule(struct k_work_delayable *dwork, k_timeout_t delay) -{ - return k_work_reschedule_for_queue(&modem_work_q, dwork, delay); -} - -static int modem_work_q_init(void) -{ - /* Boot the dedicated workqueue */ - k_work_queue_init(&modem_work_q); - k_work_queue_start(&modem_work_q, modem_stack_area, K_THREAD_STACK_SIZEOF(modem_stack_area), - CONFIG_MODEM_DEDICATED_WORKQUEUE_PRIORITY, NULL); - k_thread_name_set(k_work_queue_thread_get(&modem_work_q), "modem_workq"); - return 0; -} - -SYS_INIT(modem_work_q_init, POST_KERNEL, 0); diff --git a/subsys/modem/modem_workqueue.h b/subsys/modem/modem_workqueue.h deleted file mode 100644 index d906ed2e00f0..000000000000 --- a/subsys/modem/modem_workqueue.h +++ /dev/null @@ -1,49 +0,0 @@ -/** @file - * @brief Modem workqueue header file. - */ - -/* - * Copyright (c) 2025 Embeint Pty Ltd - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_MODEM_WORKQUEUE_H_ -#define ZEPHYR_INCLUDE_MODEM_WORKQUEUE_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef CONFIG_MODEM_DEDICATED_WORKQUEUE - -int modem_work_submit(struct k_work *work); -int modem_work_schedule(struct k_work_delayable *dwork, k_timeout_t delay); -int modem_work_reschedule(struct k_work_delayable *dwork, k_timeout_t delay); - -#else - -static inline int modem_work_submit(struct k_work *work) -{ - return k_work_submit(work); -} - -static inline int modem_work_schedule(struct k_work_delayable *dwork, k_timeout_t delay) -{ - return k_work_schedule(dwork, delay); -} - -static inline int modem_work_reschedule(struct k_work_delayable *dwork, k_timeout_t delay) -{ - return k_work_reschedule(dwork, delay); -} - -#endif /* CONFIG_MODEM_DEDICATED_WORKQUEUE */ - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_MODEM_WORKQUEUE_H_ */ From 42f85987338b5e574ab1a9d7f1f8aa83fbe3be2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1265/3334] Revert "[nrf fromtree] doc: release-notes-4.3: Mention the backlog support for listen()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8cbcadb5405d3657ed75ff8bb6a9492f7cbbbca9. Signed-off-by: Tomasz Moń --- doc/releases/release-notes-4.3.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/releases/release-notes-4.3.rst b/doc/releases/release-notes-4.3.rst index 43b217ae205c..6dfc304b3ef5 100644 --- a/doc/releases/release-notes-4.3.rst +++ b/doc/releases/release-notes-4.3.rst @@ -171,13 +171,6 @@ New APIs and options * :kconfig:option:`CONFIG_HAWKBIT_REBOOT_NONE` -* Networking - - * Sockets - - * :c:func:`zsock_listen` now implements the ``backlog`` parameter support. The TCP server - socket will limit the number of pending incoming connections to that value. - * Power management * :c:func:`pm_device_driver_deinit` From 162ac0b0991e08e5f93e9fca095e49be0c2d032f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1266/3334] Revert "[nrf fromtree] drivers: modem: Extract common dts bindings" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 828ad64831cbaa3da85cc0154e8ccfdc28171c64. Signed-off-by: Tomasz Moń --- dts/bindings/modem/nordic,nrf91-slm.yaml | 6 +++++- dts/bindings/modem/quectel,bg95.yaml | 2 +- dts/bindings/modem/quectel,bg9x.yaml | 5 ++++- dts/bindings/modem/quectel,eg25-g.yaml | 2 +- dts/bindings/modem/quectel,eg800q.yaml | 2 +- dts/bindings/modem/simcom,a76xx.yaml | 2 +- dts/bindings/modem/simcom,sim7080.yaml | 2 +- dts/bindings/modem/sqn,gm02s.yaml | 5 ++++- dts/bindings/modem/swir,hl7800.yaml | 2 +- dts/bindings/modem/telit,me310g1.yaml | 2 +- dts/bindings/modem/telit,me910g1.yaml | 2 +- dts/bindings/modem/u-blox,lara-r6.yaml | 5 ++++- dts/bindings/modem/u-blox,sara-r4.yaml | 5 ++++- dts/bindings/modem/u-blox,sara-r5.yaml | 9 ++++++++- dts/bindings/modem/wnc,m14a2a.yaml | 2 +- .../modem/zephyr,cellular-modem-device.yaml | 19 ------------------- 16 files changed, 38 insertions(+), 34 deletions(-) delete mode 100644 dts/bindings/modem/zephyr,cellular-modem-device.yaml diff --git a/dts/bindings/modem/nordic,nrf91-slm.yaml b/dts/bindings/modem/nordic,nrf91-slm.yaml index 11bf39018696..3f06696197d2 100644 --- a/dts/bindings/modem/nordic,nrf91-slm.yaml +++ b/dts/bindings/modem/nordic,nrf91-slm.yaml @@ -2,4 +2,8 @@ description: Nordic nRF91 series running the Serial LTE Modem application compatible: "nordic,nrf91-slm" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml + +properties: + mdm-power-gpios: + type: phandle-array diff --git a/dts/bindings/modem/quectel,bg95.yaml b/dts/bindings/modem/quectel,bg95.yaml index 940cd41ea27e..9b1f6c734be4 100644 --- a/dts/bindings/modem/quectel,bg95.yaml +++ b/dts/bindings/modem/quectel,bg95.yaml @@ -5,7 +5,7 @@ description: Quectel BG95 modem compatible: "quectel,bg95" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/quectel,bg9x.yaml b/dts/bindings/modem/quectel,bg9x.yaml index 41f32d0d4c26..836df0ba36e5 100644 --- a/dts/bindings/modem/quectel,bg9x.yaml +++ b/dts/bindings/modem/quectel,bg9x.yaml @@ -5,13 +5,16 @@ description: quectel BG9x modem compatible: "quectel,bg9x" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: type: phandle-array required: true + mdm-reset-gpios: + type: phandle-array + mdm-dtr-gpios: type: phandle-array diff --git a/dts/bindings/modem/quectel,eg25-g.yaml b/dts/bindings/modem/quectel,eg25-g.yaml index 2e688e587dea..45284ddf174b 100644 --- a/dts/bindings/modem/quectel,eg25-g.yaml +++ b/dts/bindings/modem/quectel,eg25-g.yaml @@ -2,7 +2,7 @@ description: Quectel EG25-G modem compatible: "quectel,eg25-g" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-reset-gpios: diff --git a/dts/bindings/modem/quectel,eg800q.yaml b/dts/bindings/modem/quectel,eg800q.yaml index 6b86456bcc91..80c591b90350 100644 --- a/dts/bindings/modem/quectel,eg800q.yaml +++ b/dts/bindings/modem/quectel,eg800q.yaml @@ -2,7 +2,7 @@ description: Quectel EG800Q modem compatible: "quectel,eg800q" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/simcom,a76xx.yaml b/dts/bindings/modem/simcom,a76xx.yaml index 428977b42a13..586b356de474 100644 --- a/dts/bindings/modem/simcom,a76xx.yaml +++ b/dts/bindings/modem/simcom,a76xx.yaml @@ -5,7 +5,7 @@ description: Simcom A76XX modem compatible: "simcom,a76xx" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/simcom,sim7080.yaml b/dts/bindings/modem/simcom,sim7080.yaml index deb5a0ec4dd6..952ce6b514b6 100644 --- a/dts/bindings/modem/simcom,sim7080.yaml +++ b/dts/bindings/modem/simcom,sim7080.yaml @@ -5,7 +5,7 @@ description: Simcom Sim7080 modem compatible: "simcom,sim7080" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/sqn,gm02s.yaml b/dts/bindings/modem/sqn,gm02s.yaml index 4875f6dcc471..584fc878e18d 100644 --- a/dts/bindings/modem/sqn,gm02s.yaml +++ b/dts/bindings/modem/sqn,gm02s.yaml @@ -5,9 +5,12 @@ description: Sequans Monarch 2 GM02S Modem compatible: "sqn,gm02s" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-reset-gpios: type: phandle-array required: true + + mdm-wake-gpios: + type: phandle-array diff --git a/dts/bindings/modem/swir,hl7800.yaml b/dts/bindings/modem/swir,hl7800.yaml index 3daf4b383d38..b937031455ff 100644 --- a/dts/bindings/modem/swir,hl7800.yaml +++ b/dts/bindings/modem/swir,hl7800.yaml @@ -8,7 +8,7 @@ description: Sierra Wireless HL7800 Modem compatible: "swir,hl7800" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-wake-gpios: diff --git a/dts/bindings/modem/telit,me310g1.yaml b/dts/bindings/modem/telit,me310g1.yaml index ff354dcc2951..2ee36fce5958 100644 --- a/dts/bindings/modem/telit,me310g1.yaml +++ b/dts/bindings/modem/telit,me310g1.yaml @@ -2,7 +2,7 @@ description: Telit ME310G1 Modem compatible: "telit,me310g1" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/telit,me910g1.yaml b/dts/bindings/modem/telit,me910g1.yaml index 5ffa10af0347..2599b6cd237d 100644 --- a/dts/bindings/modem/telit,me910g1.yaml +++ b/dts/bindings/modem/telit,me910g1.yaml @@ -5,7 +5,7 @@ description: Telit ME910G1 Modem compatible: "telit,me910g1" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: diff --git a/dts/bindings/modem/u-blox,lara-r6.yaml b/dts/bindings/modem/u-blox,lara-r6.yaml index 12c802391e6b..89e02d86dba1 100644 --- a/dts/bindings/modem/u-blox,lara-r6.yaml +++ b/dts/bindings/modem/u-blox,lara-r6.yaml @@ -5,9 +5,12 @@ description: u-blox LARA-R6 modem compatible: "u-blox,lara-r6" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: type: phandle-array required: true + + mdm-reset-gpios: + type: phandle-array diff --git a/dts/bindings/modem/u-blox,sara-r4.yaml b/dts/bindings/modem/u-blox,sara-r4.yaml index c9ec63dc7381..f24bc57e0a74 100644 --- a/dts/bindings/modem/u-blox,sara-r4.yaml +++ b/dts/bindings/modem/u-blox,sara-r4.yaml @@ -5,12 +5,15 @@ description: u-blox SARA-R4 modem compatible: "u-blox,sara-r4" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-power-gpios: type: phandle-array required: true + mdm-reset-gpios: + type: phandle-array + mdm-vint-gpios: type: phandle-array diff --git a/dts/bindings/modem/u-blox,sara-r5.yaml b/dts/bindings/modem/u-blox,sara-r5.yaml index 40e846fd4eae..af6c3318fd07 100644 --- a/dts/bindings/modem/u-blox,sara-r5.yaml +++ b/dts/bindings/modem/u-blox,sara-r5.yaml @@ -5,4 +5,11 @@ description: u-blox SARA-R5 modem compatible: "u-blox,sara-r5" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml + +properties: + mdm-power-gpios: + type: phandle-array + + mdm-reset-gpios: + type: phandle-array diff --git a/dts/bindings/modem/wnc,m14a2a.yaml b/dts/bindings/modem/wnc,m14a2a.yaml index 71f9d2775938..db00b6fbeb64 100644 --- a/dts/bindings/modem/wnc,m14a2a.yaml +++ b/dts/bindings/modem/wnc,m14a2a.yaml @@ -5,7 +5,7 @@ description: WNC-M14A2A LTE-M modem compatible: "wnc,m14a2a" -include: zephyr,cellular-modem-device.yaml +include: uart-device.yaml properties: mdm-boot-mode-sel-gpios: diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml deleted file mode 100644 index bff39d7f9f61..000000000000 --- a/dts/bindings/modem/zephyr,cellular-modem-device.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Common properties for Zephyr cellular modems - -include: uart-device.yaml - -properties: - mdm-power-gpios: - type: phandle-array - description: GPIO for modem power control - - mdm-reset-gpios: - type: phandle-array - description: GPIO for modem reset - - mdm-wake-gpios: - type: phandle-array - description: GPIO for modem wake From 5fd78c5147365b7d17f713715d4fc4cc116b063c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1267/3334] Revert "[nrf fromtree] modem: cmux: Implement Modem Status Command" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e4a845f502bf21cc80e046b7503ae13887611abc. Signed-off-by: Tomasz Moń --- include/zephyr/modem/cmux.h | 4 - subsys/modem/modem_cmux.c | 194 +------------------ tests/subsys/modem/mock/modem_backend_mock.c | 18 +- tests/subsys/modem/mock/modem_backend_mock.h | 5 - tests/subsys/modem/modem_cmux/src/main.c | 61 ++---- 5 files changed, 22 insertions(+), 260 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index bf349980e2c9..17b63bdf66af 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -120,10 +120,6 @@ struct modem_cmux_dlci { #if CONFIG_MODEM_STATS struct modem_stats_buffer receive_buf_stats; #endif - /* Flow control */ - bool flow_control : 1; - bool rx_full : 1; - bool msc_sent : 1; }; struct modem_cmux_frame { diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index b311ab7865d9..914f3348f401 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -81,29 +81,6 @@ struct modem_cmux_command { uint8_t value[]; }; -struct modem_cmux_msc_signals { - uint8_t ea: 1; /**< Last octet, always 1 */ - uint8_t fc: 1; /**< Flow Control */ - uint8_t rtc: 1; /**< Ready to Communicate */ - uint8_t rtr: 1; /**< Ready to Transmit */ - uint8_t res_0: 2; /**< Reserved, set to zero */ - uint8_t ic: 1; /**< Incoming call indicator */ - uint8_t dv: 1; /**< Data Valid */ -}; -struct modem_cmux_msc_addr { - uint8_t ea: 1; /**< Last octet, always 1 */ - uint8_t pad_one: 1; /**< Set to 1 */ - uint8_t dlci_address: 6; /**< DLCI channel address */ -}; - -struct modem_cmux_command_msc { - struct modem_cmux_command command; - uint8_t value[2]; -}; - -static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address); -static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux); - static int modem_cmux_wrap_command(struct modem_cmux_command **command, const uint8_t *data, uint16_t data_len) { @@ -145,53 +122,6 @@ static struct modem_cmux_command *modem_cmux_command_wrap(const uint8_t *data) return (struct modem_cmux_command *)data; } -static struct modem_cmux_msc_signals modem_cmux_msc_signals_decode(const uint8_t byte) -{ - struct modem_cmux_msc_signals signals; - - /* 3GPP TS 27.010 MSC signals octet: - * |0 |1 |2 |3 |4 |5 |6 |7 | - * |EA |FC|RTC|RTR|0 |0 |IC|DV| - */ - signals.ea = (byte & BIT(0)) ? 1 : 0; - signals.fc = (byte & BIT(1)) ? 1 : 0; - signals.rtc = (byte & BIT(2)) ? 1 : 0; - signals.rtr = (byte & BIT(3)) ? 1 : 0; - signals.ic = (byte & BIT(6)) ? 1 : 0; - signals.dv = (byte & BIT(7)) ? 1 : 0; - - return signals; -} - -static uint8_t modem_cmux_msc_signals_encode(const struct modem_cmux_msc_signals signals) -{ - return (signals.ea ? BIT(0) : 0) | (signals.fc ? BIT(1) : 0) | - (signals.rtc ? BIT(2) : 0) | (signals.rtr ? BIT(3) : 0) | - (signals.ic ? BIT(6) : 0) | (signals.dv ? BIT(7) : 0); -} - -static struct modem_cmux_msc_addr modem_cmux_msc_addr_decode(const uint8_t byte) -{ - struct modem_cmux_msc_addr addr; - - /* 3GPP TS 27.010 MSC address octet: - * |0 |1 |2 |3 |4 |5 |6 |7 | - * |EA |1 | DLCI | - */ - addr.ea = (byte & BIT(0)) ? 1 : 0; - addr.pad_one = 1; - addr.dlci_address = (byte >> 2) & 0x3F; - - return addr; -} - -static uint8_t modem_cmux_msc_addr_encode(const struct modem_cmux_msc_addr a) -{ - return (a.ea ? BIT(0) : 0) | BIT(1) | - ((a.dlci_address & 0x3F) << 2); -} - - #if CONFIG_MODEM_CMUX_LOG_FRAMES static const char *modem_cmux_frame_type_to_str(enum modem_cmux_frame_types frame_type) { @@ -496,92 +426,10 @@ static void modem_cmux_acknowledge_received_frame(struct modem_cmux *cmux) } } -static void modem_cmux_send_msc(struct modem_cmux *cmux, struct modem_cmux_dlci *dlci) -{ - if (cmux == NULL || dlci == NULL) { - return; - } - - struct modem_cmux_msc_addr addr = { - .ea = 1, - .pad_one = 1, - .dlci_address = dlci->dlci_address, - }; - struct modem_cmux_msc_signals signals = { - .ea = 1, - .fc = dlci->rx_full ? 1 : 0, - .rtc = dlci->state == MODEM_CMUX_DLCI_STATE_OPEN ? 1 : 0, - .rtr = dlci->state == MODEM_CMUX_DLCI_STATE_OPEN ? 1 : 0, - .dv = 1, - }; - struct modem_cmux_command_msc cmd = { - .command = { - .type = { - .ea = 1, - .cr = 1, - .value = MODEM_CMUX_COMMAND_MSC, - }, - .length = { - .ea = 1, - .value = sizeof(cmd.value), - }, - }, - .value[0] = modem_cmux_msc_addr_encode(addr), - .value[1] = modem_cmux_msc_signals_encode(signals), - }; - - struct modem_cmux_frame frame = { - .dlci_address = 0, - .cr = cmux->initiator, - .pf = false, - .type = MODEM_CMUX_FRAME_TYPE_UIH, - .data = (void *)&cmd, - .data_len = sizeof(cmd), - }; - - LOG_DBG("Sending MSC command for DLCI %u, FC:%d RTR: %d DV: %d", addr.dlci_address, - signals.fc, signals.rtr, signals.dv); - modem_cmux_transmit_cmd_frame(cmux, &frame); -} - static void modem_cmux_on_msc_command(struct modem_cmux *cmux, struct modem_cmux_command *command) { - if (!command->type.cr) { - return; - } - - modem_cmux_acknowledge_received_frame(cmux); - - uint8_t len = command->length.value; - - if (len != 2 && len != 3) { - LOG_WRN("Unexpected MSC command length %d", (int)len); - return; - } - - struct modem_cmux_msc_addr msc = modem_cmux_msc_addr_decode(command->value[0]); - struct modem_cmux_msc_signals signals = modem_cmux_msc_signals_decode(command->value[1]); - struct modem_cmux_dlci *dlci = modem_cmux_find_dlci(cmux, msc.dlci_address); - - if (dlci) { - LOG_DBG("MSC command received for DLCI %u", msc.dlci_address); - bool fc_signal = signals.fc || !signals.rtr; - - if (fc_signal != dlci->flow_control) { - if (fc_signal) { - dlci->flow_control = true; - LOG_DBG("DLCI %u flow control ON", dlci->dlci_address); - } else { - dlci->flow_control = false; - LOG_DBG("DLCI %u flow control OFF", dlci->dlci_address); - modem_pipe_notify_transmit_idle(&dlci->pipe); - } - } - /* As we have received MSC, send also our MSC */ - if (!dlci->msc_sent && dlci->state == MODEM_CMUX_DLCI_STATE_OPEN) { - dlci->msc_sent = true; - modem_cmux_send_msc(cmux, dlci); - } + if (command->type.cr) { + modem_cmux_acknowledge_received_frame(cmux); } } @@ -591,7 +439,6 @@ static void modem_cmux_on_fcon_command(struct modem_cmux *cmux) cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); modem_cmux_acknowledge_received_frame(cmux); - modem_cmux_dlci_notify_transmit_idle(cmux); } static void modem_cmux_on_fcoff_command(struct modem_cmux *cmux) @@ -823,7 +670,7 @@ static void modem_cmux_on_control_frame(struct modem_cmux *cmux) } } -static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uint8_t dlci_address) +static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux) { sys_snode_t *node; struct modem_cmux_dlci *dlci; @@ -831,7 +678,7 @@ static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux, uin SYS_SLIST_FOR_EACH_NODE(&cmux->dlcis, node) { dlci = (struct modem_cmux_dlci *)node; - if (dlci->dlci_address == dlci_address) { + if (dlci->dlci_address == cmux->frame.dlci_address) { return dlci; } } @@ -863,12 +710,6 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) k_mutex_lock(&dlci->receive_rb_lock, K_FOREVER); ring_buf_reset(&dlci->receive_rb); k_mutex_unlock(&dlci->receive_rb_lock); - if (dlci->cmux->initiator) { - modem_cmux_send_msc(dlci->cmux, dlci); - dlci->msc_sent = true; - } else { - dlci->msc_sent = false; - } break; case MODEM_CMUX_DLCI_STATE_CLOSING: @@ -901,12 +742,6 @@ static void modem_cmux_on_dlci_frame_uih(struct modem_cmux_dlci *dlci) LOG_WRN("DLCI %u receive buffer overrun (dropped %u out of %u bytes)", dlci->dlci_address, cmux->frame.data_len - written, cmux->frame.data_len); } - if (written < cmux->frame.data_len || - ring_buf_space_get(&dlci->receive_rb) < MODEM_CMUX_DATA_FRAME_SIZE_MAX) { - LOG_WRN("DLCI %u receive buffer is full", dlci->dlci_address); - dlci->rx_full = true; - modem_cmux_send_msc(cmux, dlci); - } modem_pipe_notify_receive_ready(&dlci->pipe); } @@ -923,7 +758,6 @@ static void modem_cmux_on_dlci_frame_sabm(struct modem_cmux_dlci *dlci) LOG_DBG("DLCI %u SABM request accepted, DLCI opened", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_OPEN; - dlci->msc_sent = false; modem_pipe_notify_opened(&dlci->pipe); k_mutex_lock(&dlci->receive_rb_lock, K_FOREVER); ring_buf_reset(&dlci->receive_rb); @@ -957,7 +791,7 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) return; } - dlci = modem_cmux_find_dlci(cmux, cmux->frame.dlci_address); + dlci = modem_cmux_find_dlci(cmux); if (dlci == NULL) { LOG_WRN("Frame intended for unconfigured DLCI %u.", cmux->frame.dlci_address); @@ -1232,9 +1066,7 @@ static void modem_cmux_dlci_notify_transmit_idle(struct modem_cmux *cmux) SYS_SLIST_FOR_EACH_NODE(&cmux->dlcis, node) { dlci = (struct modem_cmux_dlci *)node; - if (!dlci->flow_control) { - modem_pipe_notify_transmit_idle(&dlci->pipe); - } + modem_pipe_notify_transmit_idle(&dlci->pipe); } } @@ -1409,10 +1241,6 @@ static int modem_cmux_dlci_pipe_api_transmit(void *data, const uint8_t *buf, siz struct modem_cmux *cmux = dlci->cmux; int ret = 0; - if (dlci->flow_control) { - return 0; - } - K_SPINLOCK(&cmux->work_lock) { if (!cmux->attached) { ret = -EPERM; @@ -1447,15 +1275,6 @@ static int modem_cmux_dlci_pipe_api_receive(void *data, uint8_t *buf, size_t siz ret = ring_buf_get(&dlci->receive_rb, buf, size); k_mutex_unlock(&dlci->receive_rb_lock); - - /* Release FC if set */ - if (dlci->rx_full && - ring_buf_space_get(&dlci->receive_rb) >= MODEM_CMUX_DATA_FRAME_SIZE_MAX) { - LOG_DBG("DLCI %u receive buffer is no longer full", dlci->dlci_address); - dlci->rx_full = false; - modem_cmux_send_msc(dlci->cmux, dlci); - } - return ret; } @@ -1502,7 +1321,6 @@ static void modem_cmux_dlci_open_handler(struct k_work *item) dlci = CONTAINER_OF(dwork, struct modem_cmux_dlci, open_work); dlci->state = MODEM_CMUX_DLCI_STATE_OPENING; - dlci->msc_sent = false; struct modem_cmux_frame frame = { .dlci_address = dlci->dlci_address, diff --git a/tests/subsys/modem/mock/modem_backend_mock.c b/tests/subsys/modem/mock/modem_backend_mock.c index 49ea1927076b..5b7b47c0eb49 100644 --- a/tests/subsys/modem/mock/modem_backend_mock.c +++ b/tests/subsys/modem/mock/modem_backend_mock.c @@ -52,15 +52,12 @@ static int modem_backend_mock_transmit(void *data, const uint8_t *buf, size_t si return ret; } + ret = ring_buf_put(&mock->tx_rb, buf, size); if (modem_backend_mock_update(mock, buf, size)) { - /* Skip ringbuffer if transaction consumes bytes */ - ret = size; modem_backend_mock_put(mock, mock->transaction->put, mock->transaction->put_size); - modem_backend_mock_prime(mock, mock->transaction->next); - } else { - ret = ring_buf_put(&mock->tx_rb, buf, size); + mock->transaction = NULL; } k_work_submit(&mock->transmit_idle_work); @@ -140,10 +137,6 @@ int modem_backend_mock_get(struct modem_backend_mock *mock, uint8_t *buf, size_t void modem_backend_mock_put(struct modem_backend_mock *mock, const uint8_t *buf, size_t size) { - if (size == 0) { - return; - } - __ASSERT(ring_buf_put(&mock->rx_rb, buf, size) == size, "Mock buffer capacity exceeded"); @@ -162,10 +155,3 @@ void modem_backend_mock_bridge(struct modem_backend_mock *mock_a, struct modem_b mock_a->bridge = mock_b; mock_b->bridge = mock_a; } - -void modem_backend_mock_wait_for_transaction(struct modem_backend_mock *mock) -{ - while (mock->transaction) { - k_msleep(1); - } -} diff --git a/tests/subsys/modem/mock/modem_backend_mock.h b/tests/subsys/modem/mock/modem_backend_mock.h index 34b79aca552f..56a5b585cb12 100644 --- a/tests/subsys/modem/mock/modem_backend_mock.h +++ b/tests/subsys/modem/mock/modem_backend_mock.h @@ -19,9 +19,6 @@ struct modem_backend_mock_transaction { /* Data which will be put in response to get data */ const uint8_t *put; size_t put_size; - - /* Next transaction in chain */ - const struct modem_backend_mock_transaction *next; }; struct modem_backend_mock { @@ -65,6 +62,4 @@ void modem_backend_mock_prime(struct modem_backend_mock *mock, void modem_backend_mock_bridge(struct modem_backend_mock *mock_a, struct modem_backend_mock *mock_b); -void modem_backend_mock_wait_for_transaction(struct modem_backend_mock *mock); - #endif /* ZEPHYR_DRIVERS_MODEM_MODEM_PIPE_MOCK */ diff --git a/tests/subsys/modem/modem_cmux/src/main.c b/tests/subsys/modem/modem_cmux/src/main.c index 67833baabe76..30c055bc8e74 100644 --- a/tests/subsys/modem/modem_cmux/src/main.c +++ b/tests/subsys/modem/modem_cmux/src/main.c @@ -117,19 +117,17 @@ static uint8_t cmux_frame_control_cld_ack[] = {0xF9, 0x03, 0xEF, 0x05, 0xC1, 0x0 static uint8_t cmux_frame_dlci1_sabm_cmd[] = {0xF9, 0x07, 0x3F, 0x01, 0xDE, 0xF9}; static uint8_t cmux_frame_dlci1_sabm_ack[] = {0xF9, 0x07, 0x73, 0x01, 0x15, 0xF9}; static uint8_t cmux_frame_dlci1_disc_cmd[] = {0xF9, 0x07, 0x53, 0x01, 0x3F, 0xF9}; -static uint8_t cmux_frame_dlci1_msc_cmd[] = {0xF9, 0x03, 0xEF, 0x09, 0xE3, - 0x05, 0x07, 0x8D, 0xFB, 0xF9}; static uint8_t cmux_frame_dlci1_ua_ack[] = {0xF9, 0x07, 0x73, 0x01, 0x15, 0xF9}; static uint8_t cmux_frame_dlci2_sabm_cmd[] = {0xF9, 0x0B, 0x3F, 0x01, 0x59, 0xF9}; static uint8_t cmux_frame_dlci2_sabm_ack[] = {0xF9, 0x0B, 0x73, 0x01, 0x92, 0xF9}; static uint8_t cmux_frame_dlci2_disc_cmd[] = {0xF9, 0x0B, 0x53, 0x01, 0xB8, 0xF9}; -static uint8_t cmux_frame_dlci2_msc_cmd[] = {0xF9, 0x03, 0xEF, 0x09, 0xE3, - 0x05, 0x0B, 0x8D, 0xFB, 0xF9}; static uint8_t cmux_frame_dlci2_ua_ack[] = {0xF9, 0x0B, 0x73, 0x01, 0x92, 0xF9}; -static uint8_t cmux_frame_control_msc_cmd[] = {0xF9, 0x01, 0xEF, 0x09, 0xE3, - 0x05, 0x07, 0x01, 0x9A, 0xF9}; -static uint8_t cmux_frame_control_msc_ack[] = {0xF9, 0x01, 0xEF, 0x09, 0xE1, - 0x05, 0x07, 0x01, 0x9A, 0xF9}; +static uint8_t cmux_frame_control_msc_cmd[] = {0xF9, 0x01, 0xFF, 0x0B, 0xE3, + 0x07, 0x0B, 0x09, 0x01, 0x6C, 0xF9}; + +static uint8_t cmux_frame_control_msc_ack[] = {0xF9, 0x01, 0xFF, 0x0B, 0xE1, + 0x07, 0x0B, 0x09, 0x01, 0x6C, 0xF9}; + static uint8_t cmux_frame_control_fcon_cmd[] = {0xF9, 0x01, 0xFF, 0x05, 0xA3, 0x01, 0x86, 0xF9}; static uint8_t cmux_frame_control_fcon_ack[] = {0xF9, 0x01, 0xFF, 0x05, 0xA1, 0x01, 0x86, 0xF9}; static uint8_t cmux_frame_control_fcoff_cmd[] = {0xF9, 0x01, 0xFF, 0x05, 0x63, 0x01, 0x86, 0xF9}; @@ -229,31 +227,19 @@ const static struct modem_backend_mock_transaction transaction_dlci2_disc = { .put_size = sizeof(cmux_frame_dlci2_ua_ack) }; -const static struct modem_backend_mock_transaction transaction_dlci1_msc = { - .get = cmux_frame_dlci1_msc_cmd, - .get_size = sizeof(cmux_frame_dlci1_msc_cmd), - .put = NULL, - .put_size = 0}; - -const static struct modem_backend_mock_transaction transaction_dlci2_msc = { - .get = cmux_frame_dlci2_msc_cmd, - .get_size = sizeof(cmux_frame_dlci2_msc_cmd), - .put = NULL, - .put_size = 0}; - const static struct modem_backend_mock_transaction transaction_dlci1_sabm = { .get = cmux_frame_dlci1_sabm_cmd, .get_size = sizeof(cmux_frame_dlci1_sabm_cmd), .put = cmux_frame_dlci1_ua_ack, - .put_size = sizeof(cmux_frame_dlci1_ua_ack), - .next = &transaction_dlci1_msc}; + .put_size = sizeof(cmux_frame_dlci1_ua_ack) +}; const static struct modem_backend_mock_transaction transaction_dlci2_sabm = { .get = cmux_frame_dlci2_sabm_cmd, .get_size = sizeof(cmux_frame_dlci2_sabm_cmd), .put = cmux_frame_dlci2_ua_ack, - .put_size = sizeof(cmux_frame_dlci2_ua_ack), - .next = &transaction_dlci2_msc}; + .put_size = sizeof(cmux_frame_dlci2_ua_ack) +}; static void test_modem_cmux_callback(struct modem_cmux *cmux, enum modem_cmux_event event, void *user_data) @@ -331,9 +317,6 @@ static void *test_modem_cmux_setup(void) events = k_event_wait(&cmux_event, EVENT_CMUX_DLCI2_OPEN, false, K_MSEC(100)); __ASSERT_NO_MSG((events & EVENT_CMUX_DLCI2_OPEN)); - /* Consume the MSC command sent after DLCI opening */ - modem_backend_mock_wait_for_transaction(&bus_mock); - return NULL; } @@ -620,8 +603,8 @@ ZTEST(modem_cmux, test_modem_cmux_dlci1_close_open) zassert_true((events & EVENT_CMUX_DLCI1_OPEN), "DLCI1 not opened as expected"); - modem_backend_mock_prime(&bus_mock, &transaction_dlci1_msc); - modem_backend_mock_wait_for_transaction(&bus_mock); + /* Wait for potential T1 timeout */ + k_msleep(500); ret = modem_backend_mock_get(&bus_mock, buffer1, sizeof(buffer1)); zassert_true(ret == 0, "Received unexpected data"); @@ -722,9 +705,6 @@ ZTEST(modem_cmux, test_modem_cmux_disconnect_connect) zassert_true((events & EVENT_CMUX_DLCI1_OPEN), "DLCI1 not opened as expected"); - modem_backend_mock_prime(&bus_mock, &transaction_dlci1_msc); - modem_backend_mock_wait_for_transaction(&bus_mock); - /* Wait for potential T1 timeout */ k_msleep(500); @@ -750,10 +730,8 @@ ZTEST(modem_cmux, test_modem_cmux_disconnect_connect) events = k_event_wait_all(&cmux_event, (EVENT_CMUX_DLCI2_OPEN), false, K_MSEC(100)); - zassert_true((events & EVENT_CMUX_DLCI2_OPEN), "DLCI2 not opened as expected"); - - modem_backend_mock_prime(&bus_mock, &transaction_dlci2_msc); - modem_backend_mock_wait_for_transaction(&bus_mock); + zassert_true((events & EVENT_CMUX_DLCI2_OPEN), + "DLCI1 not opened as expected"); /* Wait for potential T1 timeout */ k_msleep(500); @@ -768,10 +746,6 @@ ZTEST(modem_cmux, test_modem_cmux_disconnect_connect_sync) zassert_true(modem_pipe_close(dlci1_pipe, K_SECONDS(10)) == 0, "Failed to close DLCI1"); modem_backend_mock_prime(&bus_mock, &transaction_dlci2_disc); zassert_true(modem_pipe_close(dlci2_pipe, K_SECONDS(10)) == 0, "Failed to close DLCI2"); - - /* Clear any pending data before CLD transaction */ - modem_backend_mock_reset(&bus_mock); - modem_backend_mock_prime(&bus_mock, &transaction_control_cld); zassert_true(modem_cmux_disconnect(&cmux) == 0, "Failed to disconnect CMUX"); zassert_true(modem_cmux_disconnect(&cmux) == -EALREADY, @@ -785,11 +759,9 @@ ZTEST(modem_cmux, test_modem_cmux_disconnect_connect_sync) modem_backend_mock_prime(&bus_mock, &transaction_dlci1_sabm); zassert_true(modem_pipe_open(dlci1_pipe, K_SECONDS(10)) == 0, "Failed to open DLCI1 pipe"); - modem_backend_mock_wait_for_transaction(&bus_mock); modem_backend_mock_prime(&bus_mock, &transaction_dlci2_sabm); zassert_true(modem_pipe_open(dlci2_pipe, K_SECONDS(10)) == 0, "Failed to open DLCI2 pipe"); - modem_backend_mock_wait_for_transaction(&bus_mock); } ZTEST(modem_cmux, test_modem_cmux_dlci_close_open_sync) @@ -801,11 +773,9 @@ ZTEST(modem_cmux, test_modem_cmux_dlci_close_open_sync) modem_backend_mock_prime(&bus_mock, &transaction_dlci1_sabm); zassert_true(modem_pipe_open(dlci1_pipe, K_SECONDS(10)) == 0, "Failed to open DLCI1 pipe"); - modem_backend_mock_wait_for_transaction(&bus_mock); modem_backend_mock_prime(&bus_mock, &transaction_dlci2_sabm); zassert_true(modem_pipe_open(dlci2_pipe, K_SECONDS(10)) == 0, "Failed to open DLCI2 pipe"); - modem_backend_mock_wait_for_transaction(&bus_mock); } ZTEST(modem_cmux, test_modem_cmux_prevent_work_while_released) @@ -850,13 +820,10 @@ ZTEST(modem_cmux, test_modem_cmux_prevent_work_while_released) zassert_ok(modem_cmux_attach(&cmux, bus_mock_pipe)); modem_backend_mock_prime(&bus_mock, &transaction_control_sabm); zassert_ok(modem_cmux_connect(&cmux)); - modem_backend_mock_wait_for_transaction(&bus_mock); modem_backend_mock_prime(&bus_mock, &transaction_dlci1_sabm); zassert_ok(modem_pipe_open(dlci1_pipe, K_SECONDS(10))); - modem_backend_mock_wait_for_transaction(&bus_mock); modem_backend_mock_prime(&bus_mock, &transaction_dlci2_sabm); zassert_ok(modem_pipe_open(dlci2_pipe, K_SECONDS(10))); - modem_backend_mock_wait_for_transaction(&bus_mock); } ZTEST(modem_cmux, test_modem_drop_frames_with_invalid_length) From 4109555d11190009eead3424d9a0a1812d329ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1268/3334] Revert "[nrf fromtree] drivers: modem: cellular: Close down CMUX before shut down" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d502d6b0bab038512b8ce6444234fef8a99e6dfb. Signed-off-by: Tomasz Moń --- drivers/modem/modem_cellular.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 64e3614b51eb..c0cc43a5dafa 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -83,7 +83,6 @@ enum modem_cellular_event { MODEM_CELLULAR_EVENT_SCRIPT_SUCCESS, MODEM_CELLULAR_EVENT_SCRIPT_FAILED, MODEM_CELLULAR_EVENT_CMUX_CONNECTED, - MODEM_CELLULAR_EVENT_CMUX_DISCONNECTED, MODEM_CELLULAR_EVENT_DLCI1_OPENED, MODEM_CELLULAR_EVENT_DLCI2_OPENED, MODEM_CELLULAR_EVENT_TIMEOUT, @@ -258,8 +257,6 @@ static const char *modem_cellular_event_str(enum modem_cellular_event event) return "script failed"; case MODEM_CELLULAR_EVENT_CMUX_CONNECTED: return "cmux connected"; - case MODEM_CELLULAR_EVENT_CMUX_DISCONNECTED: - return "cmux disconnected"; case MODEM_CELLULAR_EVENT_DLCI1_OPENED: return "dlci1 opened"; case MODEM_CELLULAR_EVENT_DLCI2_OPENED: @@ -1380,7 +1377,6 @@ static int modem_cellular_on_dormant_state_leave(struct modem_cellular_data *dat static int modem_cellular_on_init_power_off_state_enter(struct modem_cellular_data *data) { - modem_cmux_disconnect_async(&data->cmux); modem_cellular_start_timer(data, K_MSEC(2000)); return 0; } @@ -1392,9 +1388,6 @@ static void modem_cellular_init_power_off_event_handler(struct modem_cellular_da (const struct modem_cellular_config *)data->dev->config; switch (evt) { - case MODEM_CELLULAR_EVENT_CMUX_DISCONNECTED: - modem_cellular_stop_timer(data); - __fallthrough; case MODEM_CELLULAR_EVENT_TIMEOUT: /* Shutdown script can only be used if cmd_pipe is available, i.e. we are not in * some intermediary state without a pipe for commands available @@ -1782,9 +1775,7 @@ static void modem_cellular_cmux_handler(struct modem_cmux *cmux, enum modem_cmux case MODEM_CMUX_EVENT_CONNECTED: modem_cellular_delegate_event(data, MODEM_CELLULAR_EVENT_CMUX_CONNECTED); break; - case MODEM_CMUX_EVENT_DISCONNECTED: - modem_cellular_delegate_event(data, MODEM_CELLULAR_EVENT_CMUX_DISCONNECTED); - break; + default: break; } From 5c3a891f107f3a18d20013de04445a550477226b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1269/3334] Revert "[nrf fromtree] modem: cmux: Send disconnect event only after responding to CLD" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b979d4d3e85660b7bd34fe3224e3f986366f4e60. Signed-off-by: Tomasz Moń --- subsys/modem/modem_cmux.c | 31 ++++++------------- tests/subsys/modem/modem_cmux_pair/src/main.c | 8 ++--- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 914f3348f401..e668052ffb5d 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -449,17 +449,6 @@ static void modem_cmux_on_fcoff_command(struct modem_cmux *cmux) modem_cmux_acknowledge_received_frame(cmux); } -static void disconnect(struct modem_cmux *cmux) -{ - LOG_DBG("CMUX disconnected"); - k_work_cancel_delayable(&cmux->disconnect_work); - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); - k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); - cmux->flow_control_on = false; - k_mutex_unlock(&cmux->transmit_rb_lock); - modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); -} - static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux_command *command) { if (command->type.cr) { @@ -473,11 +462,16 @@ static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux } if (cmux->state == MODEM_CMUX_STATE_DISCONNECTING) { - disconnect(cmux); - } else { - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTING); - k_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); + k_work_cancel_delayable(&cmux->disconnect_work); } + + LOG_DBG("CMUX disconnected"); + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); + k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); + cmux->flow_control_on = false; + k_mutex_unlock(&cmux->transmit_rb_lock); + + modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); } static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) @@ -1154,12 +1148,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) struct modem_cmux_command *command; uint8_t data[2]; - if (cmux->state == MODEM_CMUX_STATE_DISCONNECTING) { - disconnect(cmux); - } else { - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTING); - k_work_schedule(&cmux->disconnect_work, MODEM_CMUX_T1_TIMEOUT); - } + set_state(cmux, MODEM_CMUX_STATE_DISCONNECTING); command = modem_cmux_command_wrap(data); command->type.ea = 1; diff --git a/tests/subsys/modem/modem_cmux_pair/src/main.c b/tests/subsys/modem/modem_cmux_pair/src/main.c index 1988e9d73319..5cc8fed4b458 100644 --- a/tests/subsys/modem/modem_cmux_pair/src/main.c +++ b/tests/subsys/modem/modem_cmux_pair/src/main.c @@ -507,10 +507,9 @@ ZTEST(modem_cmux_pair, test_modem_cmux_disconnect_connect) modem_backend_mock_reset(&bus_mock_dte); zassert_true(modem_cmux_disconnect_async(&cmux_dte) == 0, "Failed to disconnect CMUX"); - events = k_event_wait_all(&cmux_event_dte, (EVENT_CMUX_DISCONNECTED), false, K_MSEC(660)); - zassert_true((events & EVENT_CMUX_DISCONNECTED), "Failed to disconnect CMUX"); + k_msleep(100); - events = k_event_wait_all(&cmux_event_dce, (EVENT_CMUX_DISCONNECTED), false, K_MSEC(660)); + events = k_event_wait_all(&cmux_event_dte, (EVENT_CMUX_DISCONNECTED), false, K_MSEC(100)); zassert_true((events & EVENT_CMUX_DISCONNECTED), "Failed to disconnect CMUX"); /* Reconnect CMUX */ @@ -555,9 +554,6 @@ ZTEST(modem_cmux_pair, test_modem_cmux_disconnect_connect_sync) zassert_true(modem_cmux_disconnect(&cmux_dte) == 0, "Failed to disconnect CMUX"); zassert_true(modem_cmux_disconnect(&cmux_dte) == -EALREADY, "Should already be disconnected"); - - events = k_event_wait_all(&cmux_event_dce, (EVENT_CMUX_DISCONNECTED), false, K_MSEC(660)); - zassert_true((events & EVENT_CMUX_DISCONNECTED), "Failed to disconnect CMUX"); zassert_true(modem_cmux_disconnect(&cmux_dce) == -EALREADY, "Should already be disconnected"); From fb532e26e29e457f52e867ce132a2e180d0a2977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1270/3334] Revert "[nrf fromtree] modem: cmux: Handle CLD response" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4e650ccf2b4336db9a5d2ba64a37d0eedfa99602. Signed-off-by: Tomasz Moń --- subsys/modem/modem_cmux.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index e668052ffb5d..4573c1b8bdc5 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -543,19 +543,6 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) modem_cmux_log_received_command(command); - if (!command->type.cr) { - LOG_DBG("Received response command"); - switch (command->type.value) { - case MODEM_CMUX_COMMAND_CLD: - modem_cmux_on_cld_command(cmux, command); - break; - default: - /* Responses to other commands are ignored */ - break; - } - return; - } - switch (command->type.value) { case MODEM_CMUX_COMMAND_CLD: modem_cmux_on_cld_command(cmux, command); @@ -642,7 +629,8 @@ static void modem_cmux_on_control_frame(struct modem_cmux *cmux) modem_cmux_log_received_frame(&cmux->frame); if (is_connected(cmux) && cmux->frame.cr == cmux->initiator) { - LOG_DBG("Received a response frame"); + LOG_DBG("Received a response frame, dropping"); + return; } switch (cmux->frame.type) { From c2efbd66fb79c57cd6215d0f77d8873e9e8c3454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1271/3334] Revert "[nrf fromtree] modem: cmux: Combine state and event" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit daf81b401b2a3d44a61f2f0b9e5c29c341e479a2. Signed-off-by: Tomasz Moń --- subsys/modem/modem_cmux.c | 53 ++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 4573c1b8bdc5..f304985717ac 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -101,22 +101,6 @@ static int modem_cmux_wrap_command(struct modem_cmux_command **command, const ui return 0; } -static void set_state(struct modem_cmux *cmux, enum modem_cmux_state state) -{ - cmux->state = state; - k_event_set(&cmux->event, BIT(state)); -} - -static bool wait_state(struct modem_cmux *cmux, enum modem_cmux_state state, k_timeout_t timeout) -{ - return k_event_wait(&cmux->event, BIT(state), false, timeout) == BIT(state); -} - -static bool is_connected(struct modem_cmux *cmux) -{ - return cmux->state == MODEM_CMUX_STATE_CONNECTED; -} - static struct modem_cmux_command *modem_cmux_command_wrap(const uint8_t *data) { return (struct modem_cmux_command *)data; @@ -466,12 +450,14 @@ static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux } LOG_DBG("CMUX disconnected"); - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); + cmux->state = MODEM_CMUX_STATE_DISCONNECTED; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = false; k_mutex_unlock(&cmux->transmit_rb_lock); modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_DISCONNECTED); + k_event_clear(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); + k_event_post(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); } static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) @@ -482,13 +468,15 @@ static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) } LOG_DBG("CMUX connected"); - set_state(cmux, MODEM_CMUX_STATE_CONNECTED); + cmux->state = MODEM_CMUX_STATE_CONNECTED; cmux->initiator = true; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); k_work_cancel_delayable(&cmux->connect_work); modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_CONNECTED); + k_event_clear(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); + k_event_post(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); } static void modem_cmux_respond_unsupported_cmd(struct modem_cmux *cmux) @@ -616,19 +604,21 @@ static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) LOG_DBG("CMUX connection request received"); cmux->initiator = false; - set_state(cmux, MODEM_CMUX_STATE_CONNECTED); + cmux->state = MODEM_CMUX_STATE_CONNECTED; modem_cmux_connect_response_transmit(cmux); k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); modem_cmux_raise_event(cmux, MODEM_CMUX_EVENT_CONNECTED); + k_event_clear(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); + k_event_post(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); } static void modem_cmux_on_control_frame(struct modem_cmux *cmux) { modem_cmux_log_received_frame(&cmux->frame); - if (is_connected(cmux) && cmux->frame.cr == cmux->initiator) { + if (cmux->state == MODEM_CMUX_STATE_CONNECTED && cmux->frame.cr == cmux->initiator) { LOG_DBG("Received a response frame, dropping"); return; } @@ -1113,7 +1103,7 @@ static void modem_cmux_connect_handler(struct k_work *item) dwork = k_work_delayable_from_work(item); cmux = CONTAINER_OF(dwork, struct modem_cmux, connect_work); - set_state(cmux, MODEM_CMUX_STATE_CONNECTING); + cmux->state = MODEM_CMUX_STATE_CONNECTING; cmux->initiator = true; static const struct modem_cmux_frame frame = { @@ -1136,7 +1126,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) struct modem_cmux_command *command; uint8_t data[2]; - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTING); + cmux->state = MODEM_CMUX_STATE_DISCONNECTING; command = modem_cmux_command_wrap(data); command->type.ea = 1; @@ -1370,6 +1360,7 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co cmux->receive_buf = config->receive_buf; cmux->receive_buf_size = config->receive_buf_size; sys_slist_init(&cmux->dlcis); + cmux->state = MODEM_CMUX_STATE_DISCONNECTED; ring_buf_init(&cmux->transmit_rb, config->transmit_buf_size, config->transmit_buf); k_mutex_init(&cmux->transmit_rb_lock); k_work_init_delayable(&cmux->receive_work, modem_cmux_receive_handler); @@ -1377,7 +1368,8 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co k_work_init_delayable(&cmux->connect_work, modem_cmux_connect_handler); k_work_init_delayable(&cmux->disconnect_work, modem_cmux_disconnect_handler); k_event_init(&cmux->event); - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); + k_event_clear(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); + k_event_post(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); #if CONFIG_MODEM_STATS modem_cmux_init_buf_stats(cmux); @@ -1439,7 +1431,8 @@ int modem_cmux_connect(struct modem_cmux *cmux) return ret; } - if (!wait_state(cmux, MODEM_CMUX_STATE_CONNECTED, MODEM_CMUX_T2_TIMEOUT)) { + if (k_event_wait(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT, false, + MODEM_CMUX_T2_TIMEOUT) == 0) { return -EAGAIN; } @@ -1450,7 +1443,7 @@ int modem_cmux_connect_async(struct modem_cmux *cmux) { int ret = 0; - if (cmux->state != MODEM_CMUX_STATE_DISCONNECTED) { + if (k_event_test(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT)) { return -EALREADY; } @@ -1477,7 +1470,8 @@ int modem_cmux_disconnect(struct modem_cmux *cmux) return ret; } - if (!wait_state(cmux, MODEM_CMUX_STATE_DISCONNECTED, MODEM_CMUX_T2_TIMEOUT)) { + if (k_event_wait(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT, false, + MODEM_CMUX_T2_TIMEOUT) == 0) { return -EAGAIN; } @@ -1488,7 +1482,7 @@ int modem_cmux_disconnect_async(struct modem_cmux *cmux) { int ret = 0; - if (cmux->state == MODEM_CMUX_STATE_DISCONNECTED) { + if (k_event_test(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT)) { return -EALREADY; } @@ -1535,6 +1529,7 @@ void modem_cmux_release(struct modem_cmux *cmux) /* Unreference pipe */ cmux->pipe = NULL; - /* Reset state */ - set_state(cmux, MODEM_CMUX_STATE_DISCONNECTED); + /* Reset events */ + k_event_clear(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); + k_event_post(&cmux->event, MODEM_CMUX_EVENT_DISCONNECTED_BIT); } From 76427e6fc0668b2d79208aa9214611211f4d055e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1272/3334] Revert "[nrf fromtree] modem: modem_ppp: optimise frame wrapping" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb88fa56bafe5bf87cb02916dad1aa49277e9ce0. Signed-off-by: Tomasz Moń --- include/zephyr/modem/ppp.h | 21 ++- subsys/modem/modem_ppp.c | 282 +++++++++++++++++++------------------ 2 files changed, 166 insertions(+), 137 deletions(-) diff --git a/include/zephyr/modem/ppp.h b/include/zephyr/modem/ppp.h index 69b35897e2d2..b3dbcfdeb7fb 100644 --- a/include/zephyr/modem/ppp.h +++ b/include/zephyr/modem/ppp.h @@ -50,10 +50,27 @@ enum modem_ppp_receive_state { }; enum modem_ppp_transmit_state { + /* Idle */ MODEM_PPP_TRANSMIT_STATE_IDLE = 0, + /* Writing header */ MODEM_PPP_TRANSMIT_STATE_SOF, - MODEM_PPP_TRANSMIT_STATE_PROTOCOL, + MODEM_PPP_TRANSMIT_STATE_HDR_FF, + MODEM_PPP_TRANSMIT_STATE_HDR_7D, + MODEM_PPP_TRANSMIT_STATE_HDR_23, + /* Writing protocol */ + MODEM_PPP_TRANSMIT_STATE_PROTOCOL_HIGH, + MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_HIGH, + MODEM_PPP_TRANSMIT_STATE_PROTOCOL_LOW, + MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_LOW, + /* Writing data */ MODEM_PPP_TRANSMIT_STATE_DATA, + MODEM_PPP_TRANSMIT_STATE_ESCAPING_DATA, + /* Writing FCS */ + MODEM_PPP_TRANSMIT_STATE_FCS_LOW, + MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_LOW, + MODEM_PPP_TRANSMIT_STATE_FCS_HIGH, + MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_HIGH, + /* Writing end of frame */ MODEM_PPP_TRANSMIT_STATE_EOF, }; @@ -83,6 +100,8 @@ struct modem_ppp { /* Packet being sent */ enum modem_ppp_transmit_state transmit_state; struct net_pkt *tx_pkt; + uint8_t tx_pkt_escaped; + uint16_t tx_pkt_protocol; uint16_t tx_pkt_fcs; /* Ring buffer used for transmitting partial PPP frame */ diff --git a/subsys/modem/modem_ppp.c b/subsys/modem/modem_ppp.c index cd13d4ac8b1a..9e2e2b5d71b7 100644 --- a/subsys/modem/modem_ppp.c +++ b/subsys/modem/modem_ppp.c @@ -49,134 +49,148 @@ static uint16_t modem_ppp_ppp_protocol(struct net_pkt *pkt) return 0; } -static bool modem_ppp_needs_escape(uint8_t byte) +static uint8_t modem_ppp_wrap_net_pkt_byte(struct modem_ppp *ppp) { - return (byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || - (byte < MODEM_PPP_VALUE_ESCAPE); -} - -static uint32_t modem_ppp_wrap(struct modem_ppp *ppp, uint8_t *buffer, uint32_t available) -{ - uint32_t offset = 0; - uint32_t remaining; - uint16_t protocol; - uint8_t upper; - uint8_t lower; uint8_t byte; - while (offset < available) { - remaining = available - offset; + switch (ppp->transmit_state) { + case MODEM_PPP_TRANSMIT_STATE_IDLE: + LOG_WRN("Invalid transmit state"); + return 0; - switch (ppp->transmit_state) { - case MODEM_PPP_TRANSMIT_STATE_SOF: - if (remaining < 4) { - /* Insufficient space for constant header prefix */ - goto end; - } - /* Init cursor for later phases */ - net_pkt_cursor_init(ppp->tx_pkt); - /* 3 byte common header */ - buffer[offset++] = MODEM_PPP_CODE_DELIMITER; - buffer[offset++] = 0xFF; - buffer[offset++] = MODEM_PPP_CODE_ESCAPE; - buffer[offset++] = 0x23; - /* Initialise the FCS. - * This value is always the same at this point, so use the constant value. - * Equivelent to: - * ppp->tx_pkt_fcs = modem_ppp_fcs_init(0xFF); - * ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, 0x03); - */ - ARG_UNUSED(modem_ppp_fcs_init); - ppp->tx_pkt_fcs = 0x3DE3; - /* Next state */ - if (net_pkt_is_ppp(ppp->tx_pkt)) { - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; - } else { - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_PROTOCOL; - } - break; - case MODEM_PPP_TRANSMIT_STATE_PROTOCOL: - /* If both protocol bytes need escaping, it could be 4 bytes */ - if (remaining < 4) { - /* Insufficient space for protocol bytes */ - goto end; - } - /* Extract protocol bytes */ - protocol = modem_ppp_ppp_protocol(ppp->tx_pkt); - upper = (protocol >> 8) & 0xFF; - lower = (protocol >> 0) & 0xFF; - /* FCS is computed without the escape/modification */ - ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, upper); - ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, lower); - /* Push protocol bytes (with required escaping) */ - if (modem_ppp_needs_escape(upper)) { - buffer[offset++] = MODEM_PPP_CODE_ESCAPE; - upper ^= MODEM_PPP_VALUE_ESCAPE; - } - buffer[offset++] = upper; - if (modem_ppp_needs_escape(lower)) { - buffer[offset++] = MODEM_PPP_CODE_ESCAPE; - lower ^= MODEM_PPP_VALUE_ESCAPE; - } - buffer[offset++] = lower; - /* Next state */ + /* Writing header */ + case MODEM_PPP_TRANSMIT_STATE_SOF: + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_HDR_FF; + return MODEM_PPP_CODE_DELIMITER; + + case MODEM_PPP_TRANSMIT_STATE_HDR_FF: + net_pkt_cursor_init(ppp->tx_pkt); + ppp->tx_pkt_fcs = modem_ppp_fcs_init(0xFF); + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_HDR_7D; + return 0xFF; + + case MODEM_PPP_TRANSMIT_STATE_HDR_7D: + ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, 0x03); + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_HDR_23; + return MODEM_PPP_CODE_ESCAPE; + + case MODEM_PPP_TRANSMIT_STATE_HDR_23: + if (net_pkt_is_ppp(ppp->tx_pkt) == true) { ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; - break; - case MODEM_PPP_TRANSMIT_STATE_DATA: - /* Push all data bytes into the buffer */ - while (net_pkt_remaining_data(ppp->tx_pkt) > 0) { - /* Space available, taking into account possible escapes */ - if (remaining < 2) { - goto end; - } - /* Pull next byte we're sending */ - (void)net_pkt_read_u8(ppp->tx_pkt, &byte); - /* FCS is computed without the escape/modification */ - ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, byte); - /* Push encoded bytes into buffer */ - if (modem_ppp_needs_escape(byte)) { - buffer[offset++] = MODEM_PPP_CODE_ESCAPE; - byte ^= MODEM_PPP_VALUE_ESCAPE; - remaining--; - } - buffer[offset++] = byte; - remaining--; - } - /* Data phase finished */ - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_EOF; - break; - case MODEM_PPP_TRANSMIT_STATE_EOF: - /* If both FCS bytes need escaping, it could be 5 bytes */ - if (remaining < 5) { - /* Insufficient space for protocol bytes */ - goto end; - } - /* Push FCS (order is [lower, upper] unlike the protocol) */ - ppp->tx_pkt_fcs = modem_ppp_fcs_final(ppp->tx_pkt_fcs); - lower = (ppp->tx_pkt_fcs >> 0) & 0xFF; - upper = (ppp->tx_pkt_fcs >> 8) & 0xFF; - if (modem_ppp_needs_escape(lower)) { - buffer[offset++] = MODEM_PPP_CODE_ESCAPE; - lower ^= MODEM_PPP_VALUE_ESCAPE; - } - buffer[offset++] = lower; - if (modem_ppp_needs_escape(upper)) { - buffer[offset++] = MODEM_PPP_CODE_ESCAPE; - upper ^= MODEM_PPP_VALUE_ESCAPE; - } - buffer[offset++] = upper; - buffer[offset++] = MODEM_PPP_CODE_DELIMITER; - - /* Packet has finished */ - ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_IDLE; - goto end; - default: - LOG_DBG("Invalid transmit state (%d)", ppp->transmit_state); - goto end; + } else { + ppp->tx_pkt_protocol = modem_ppp_ppp_protocol(ppp->tx_pkt); + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_PROTOCOL_HIGH; + } + + return 0x23; + + /* Writing protocol */ + case MODEM_PPP_TRANSMIT_STATE_PROTOCOL_HIGH: + byte = (ppp->tx_pkt_protocol >> 8) & 0xFF; + ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, byte); + + if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || + (byte < MODEM_PPP_VALUE_ESCAPE)) { + ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_HIGH; + return MODEM_PPP_CODE_ESCAPE; + } + + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_PROTOCOL_LOW; + return byte; + + case MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_HIGH: + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_PROTOCOL_LOW; + return ppp->tx_pkt_escaped; + + case MODEM_PPP_TRANSMIT_STATE_PROTOCOL_LOW: + byte = ppp->tx_pkt_protocol & 0xFF; + ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, byte); + + if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || + (byte < MODEM_PPP_VALUE_ESCAPE)) { + ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_LOW; + return MODEM_PPP_CODE_ESCAPE; + } + + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; + return byte; + + case MODEM_PPP_TRANSMIT_STATE_ESCAPING_PROTOCOL_LOW: + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; + return ppp->tx_pkt_escaped; + + /* Writing data */ + case MODEM_PPP_TRANSMIT_STATE_DATA: + (void)net_pkt_read_u8(ppp->tx_pkt, &byte); + ppp->tx_pkt_fcs = modem_ppp_fcs_update(ppp->tx_pkt_fcs, byte); + + if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || + (byte < MODEM_PPP_VALUE_ESCAPE)) { + ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_DATA; + return MODEM_PPP_CODE_ESCAPE; + } + + if (net_pkt_remaining_data(ppp->tx_pkt) == 0) { + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_FCS_LOW; + } + + return byte; + + case MODEM_PPP_TRANSMIT_STATE_ESCAPING_DATA: + if (net_pkt_remaining_data(ppp->tx_pkt) == 0) { + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_FCS_LOW; + } else { + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_DATA; + } + + return ppp->tx_pkt_escaped; + + /* Writing FCS */ + case MODEM_PPP_TRANSMIT_STATE_FCS_LOW: + ppp->tx_pkt_fcs = modem_ppp_fcs_final(ppp->tx_pkt_fcs); + byte = ppp->tx_pkt_fcs & 0xFF; + + if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || + (byte < MODEM_PPP_VALUE_ESCAPE)) { + ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_LOW; + return MODEM_PPP_CODE_ESCAPE; } + + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_FCS_HIGH; + return byte; + + case MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_LOW: + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_FCS_HIGH; + return ppp->tx_pkt_escaped; + + case MODEM_PPP_TRANSMIT_STATE_FCS_HIGH: + byte = (ppp->tx_pkt_fcs >> 8) & 0xFF; + + if ((byte == MODEM_PPP_CODE_DELIMITER) || (byte == MODEM_PPP_CODE_ESCAPE) || + (byte < MODEM_PPP_VALUE_ESCAPE)) { + ppp->tx_pkt_escaped = byte ^ MODEM_PPP_VALUE_ESCAPE; + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_HIGH; + return MODEM_PPP_CODE_ESCAPE; + } + + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_EOF; + return byte; + + case MODEM_PPP_TRANSMIT_STATE_ESCAPING_FCS_HIGH: + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_EOF; + return ppp->tx_pkt_escaped; + + /* Writing end of frame */ + case MODEM_PPP_TRANSMIT_STATE_EOF: + ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_IDLE; + return MODEM_PPP_CODE_DELIMITER; } -end: - return offset; + + return 0; } static bool modem_ppp_is_byte_expected(uint8_t byte, uint8_t expected_byte) @@ -343,36 +357,32 @@ static void modem_ppp_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_eve static void modem_ppp_send_handler(struct k_work *item) { struct modem_ppp *ppp = CONTAINER_OF(item, struct modem_ppp, send_work); + uint8_t byte; uint8_t *reserved; uint32_t reserved_size; - uint32_t pushed; int ret; if (ppp->tx_pkt == NULL) { ppp->tx_pkt = k_fifo_get(&ppp->tx_pkt_fifo, K_NO_WAIT); } - if (ring_buf_is_empty(&ppp->transmit_rb)) { - /* Reset to initial state to maximise contiguous claim */ - ring_buf_reset(&ppp->transmit_rb); - } - if (ppp->tx_pkt != NULL) { /* Initialize wrap */ if (ppp->transmit_state == MODEM_PPP_TRANSMIT_STATE_IDLE) { ppp->transmit_state = MODEM_PPP_TRANSMIT_STATE_SOF; } - /* Claim as much space as possible */ - reserved_size = ring_buf_put_claim(&ppp->transmit_rb, &reserved, UINT32_MAX); - /* Push wrapped data into claimed buffer */ - pushed = modem_ppp_wrap(ppp, reserved, reserved_size); - /* Limit claimed data to what was actually pushed */ - ring_buf_put_finish(&ppp->transmit_rb, pushed); + /* Fill transmit ring buffer */ + while (ring_buf_space_get(&ppp->transmit_rb) > 0) { + byte = modem_ppp_wrap_net_pkt_byte(ppp); - if (ppp->transmit_state == MODEM_PPP_TRANSMIT_STATE_IDLE) { - net_pkt_unref(ppp->tx_pkt); - ppp->tx_pkt = k_fifo_get(&ppp->tx_pkt_fifo, K_NO_WAIT); + ring_buf_put(&ppp->transmit_rb, &byte, 1); + + if (ppp->transmit_state == MODEM_PPP_TRANSMIT_STATE_IDLE) { + net_pkt_unref(ppp->tx_pkt); + ppp->tx_pkt = k_fifo_get(&ppp->tx_pkt_fifo, K_NO_WAIT); + break; + } } } From 10dca86ef41ebbd02722928c40ef07bfdf0a57fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1273/3334] Revert "[nrf fromtree] modem: cmux: Handle C/R bit from address field" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b8ee41bc8d646d3d05135a15b690cca8e15e6981. Signed-off-by: Tomasz Moń --- include/zephyr/modem/cmux.h | 5 ++-- subsys/modem/modem_cmux.c | 32 ++++++------------------ tests/subsys/modem/modem_cmux/src/main.c | 18 ------------- 3 files changed, 9 insertions(+), 46 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 17b63bdf66af..fd9481fee035 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -149,11 +149,10 @@ struct modem_cmux { /* State */ enum modem_cmux_state state; - bool flow_control_on : 1; - bool initiator : 1; + bool flow_control_on; /* Work lock */ - bool attached : 1; + bool attached; struct k_spinlock work_lock; /* Receive state*/ diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index f304985717ac..fb0f14a84807 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -463,13 +463,12 @@ static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) { if (cmux->state != MODEM_CMUX_STATE_CONNECTING) { - LOG_DBG("Unexpected UA frame in state %d", cmux->state); + LOG_DBG("Unexpected UA frame"); return; } LOG_DBG("CMUX connected"); cmux->state = MODEM_CMUX_STATE_CONNECTED; - cmux->initiator = true; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); @@ -596,6 +595,8 @@ static void modem_cmux_dm_response_transmit(struct modem_cmux *cmux) static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) { + modem_cmux_connect_response_transmit(cmux); + if ((cmux->state == MODEM_CMUX_STATE_CONNECTED) || (cmux->state == MODEM_CMUX_STATE_DISCONNECTING)) { LOG_DBG("Connect request not accepted"); @@ -603,9 +604,7 @@ static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) } LOG_DBG("CMUX connection request received"); - cmux->initiator = false; cmux->state = MODEM_CMUX_STATE_CONNECTED; - modem_cmux_connect_response_transmit(cmux); k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; k_mutex_unlock(&cmux->transmit_rb_lock); @@ -618,11 +617,6 @@ static void modem_cmux_on_control_frame(struct modem_cmux *cmux) { modem_cmux_log_received_frame(&cmux->frame); - if (cmux->state == MODEM_CMUX_STATE_CONNECTED && cmux->frame.cr == cmux->initiator) { - LOG_DBG("Received a response frame, dropping"); - return; - } - switch (cmux->frame.type) { case MODEM_CMUX_FRAME_TYPE_UA: modem_cmux_on_control_frame_ua(cmux); @@ -667,12 +661,6 @@ static void modem_cmux_on_dlci_frame_dm(struct modem_cmux_dlci *dlci) static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) { - /* Drop invalid UA frames */ - if (dlci->cmux->frame.cr != dlci->cmux->initiator) { - LOG_DBG("Received a response frame, dropping"); - return; - } - switch (dlci->state) { case MODEM_CMUX_DLCI_STATE_OPENING: LOG_DBG("DLCI %u opened", dlci->dlci_address); @@ -758,11 +746,6 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) modem_cmux_log_received_frame(&cmux->frame); - if (cmux->state != MODEM_CMUX_STATE_CONNECTED) { - LOG_DBG("Unexpected DLCI frame in state %d", cmux->state); - return; - } - dlci = modem_cmux_find_dlci(cmux); if (dlci == NULL) { LOG_WRN("Frame intended for unconfigured DLCI %u.", @@ -1104,7 +1087,6 @@ static void modem_cmux_connect_handler(struct k_work *item) cmux = CONTAINER_OF(dwork, struct modem_cmux, connect_work); cmux->state = MODEM_CMUX_STATE_CONNECTING; - cmux->initiator = true; static const struct modem_cmux_frame frame = { .dlci_address = 0, @@ -1137,7 +1119,7 @@ static void modem_cmux_disconnect_handler(struct k_work *item) struct modem_cmux_frame frame = { .dlci_address = 0, - .cr = cmux->initiator, + .cr = true, .pf = false, .type = MODEM_CMUX_FRAME_TYPE_UIH, .data = data, @@ -1216,7 +1198,7 @@ static int modem_cmux_dlci_pipe_api_transmit(void *data, const uint8_t *buf, siz struct modem_cmux_frame frame = { .dlci_address = dlci->dlci_address, - .cr = cmux->initiator, + .cr = true, .pf = false, .type = MODEM_CMUX_FRAME_TYPE_UIH, .data = buf, @@ -1291,7 +1273,7 @@ static void modem_cmux_dlci_open_handler(struct k_work *item) struct modem_cmux_frame frame = { .dlci_address = dlci->dlci_address, - .cr = dlci->cmux->initiator, + .cr = true, .pf = true, .type = MODEM_CMUX_FRAME_TYPE_SABM, .data = NULL, @@ -1320,7 +1302,7 @@ static void modem_cmux_dlci_close_handler(struct k_work *item) struct modem_cmux_frame frame = { .dlci_address = dlci->dlci_address, - .cr = dlci->cmux->initiator, + .cr = true, .pf = true, .type = MODEM_CMUX_FRAME_TYPE_DISC, .data = NULL, diff --git a/tests/subsys/modem/modem_cmux/src/main.c b/tests/subsys/modem/modem_cmux/src/main.c index 30c055bc8e74..b1adce37cc46 100644 --- a/tests/subsys/modem/modem_cmux/src/main.c +++ b/tests/subsys/modem/modem_cmux/src/main.c @@ -886,22 +886,4 @@ ZTEST(modem_cmux, test_modem_cmux_split_large_data) "Incorrect number of bytes transmitted %d", ret); } -ZTEST(modem_cmux, test_modem_cmux_invalid_cr) -{ - uint32_t events; - - /* We are initiator, so any CMD with CR set should be dropped */ - modem_backend_mock_put(&bus_mock, cmux_frame_control_cld_cmd, - sizeof(cmux_frame_control_cld_cmd)); - - modem_backend_mock_put(&bus_mock, cmux_frame_control_sabm_cmd, - sizeof(cmux_frame_control_sabm_cmd)); - - events = k_event_wait_all(&cmux_event, - (MODEM_CMUX_EVENT_CONNECTED | MODEM_CMUX_EVENT_DISCONNECTED), - false, K_MSEC(100)); - - zassert_false(events, "Wrong CMD should have been ignored"); -} - ZTEST_SUITE(modem_cmux, NULL, test_modem_cmux_setup, test_modem_cmux_before, NULL, NULL); From 641cfb973dfd35f57d81064e2c157a85279579aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1274/3334] Revert "[nrf fromtree] modem: cmux: Define macros for header size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bdb2bd440ee95ff45ae6fd98147de3032eacb516. Signed-off-by: Tomasz Moń --- include/zephyr/modem/cmux.h | 9 +-------- subsys/modem/modem_cmux.c | 28 +++++++++++++--------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index fd9481fee035..913f4187d729 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -57,15 +57,8 @@ typedef void (*modem_cmux_callback)(struct modem_cmux *cmux, enum modem_cmux_eve * @cond INTERNAL_HIDDEN */ -#if CONFIG_MODEM_CMUX_MTU > 127 -#define MODEM_CMUX_HEADER_SIZE 7 -#else -#define MODEM_CMUX_HEADER_SIZE 6 -#endif - - /* Total size of the CMUX work buffers */ -#define MODEM_CMUX_WORK_BUFFER_SIZE (CONFIG_MODEM_CMUX_MTU + MODEM_CMUX_HEADER_SIZE + \ +#define MODEM_CMUX_WORK_BUFFER_SIZE (CONFIG_MODEM_CMUX_MTU + 7 + \ CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA) enum modem_cmux_state { diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index fb0f14a84807..93665525ac7b 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -19,18 +19,14 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #define MODEM_CMUX_EA (0x01) #define MODEM_CMUX_CR (0x02) #define MODEM_CMUX_PF (0x10) -#define MODEM_CMUX_DATA_SIZE_MIN 8 -#define MODEM_CMUX_DATA_FRAME_SIZE_MIN (MODEM_CMUX_HEADER_SIZE + MODEM_CMUX_DATA_SIZE_MIN) -#define MODEM_CMUX_DATA_FRAME_SIZE_MAX (MODEM_CMUX_HEADER_SIZE + CONFIG_MODEM_CMUX_MTU) +#define MODEM_CMUX_FRAME_SIZE_MAX (0x07) +#define MODEM_CMUX_DATA_SIZE_MIN (0x08) +#define MODEM_CMUX_DATA_FRAME_SIZE_MIN (MODEM_CMUX_FRAME_SIZE_MAX + \ + MODEM_CMUX_DATA_SIZE_MIN) -/* Biggest supported Multiplexer control commands in UIH frame - * Modem Status Command (MSC) - 5 bytes when Break is included. - * - * PN would be 10 bytes, but that is not implemented - */ -#define MODEM_CMUX_CMD_DATA_SIZE_MAX 5 -#define MODEM_CMUX_CMD_FRAME_SIZE_MAX (MODEM_CMUX_HEADER_SIZE + \ - MODEM_CMUX_CMD_DATA_SIZE_MAX) +#define MODEM_CMUX_CMD_DATA_SIZE_MAX (0x08) +#define MODEM_CMUX_CMD_FRAME_SIZE_MAX (MODEM_CMUX_FRAME_SIZE_MAX + \ + MODEM_CMUX_CMD_DATA_SIZE_MAX) #define MODEM_CMUX_T1_TIMEOUT (K_MSEC(330)) #define MODEM_CMUX_T2_TIMEOUT (K_MSEC(660)) @@ -276,13 +272,13 @@ static void modem_cmux_bus_callback(struct modem_pipe *pipe, enum modem_pipe_eve static uint16_t modem_cmux_transmit_frame(struct modem_cmux *cmux, const struct modem_cmux_frame *frame) { - uint8_t buf[MODEM_CMUX_HEADER_SIZE]; + uint8_t buf[MODEM_CMUX_FRAME_SIZE_MAX]; uint8_t fcs; uint16_t space; uint16_t data_len; uint16_t buf_idx; - space = ring_buf_space_get(&cmux->transmit_rb) - MODEM_CMUX_HEADER_SIZE; + space = ring_buf_space_get(&cmux->transmit_rb) - MODEM_CMUX_FRAME_SIZE_MAX; data_len = MIN(space, frame->data_len); data_len = MIN(data_len, CONFIG_MODEM_CMUX_MTU); @@ -1332,9 +1328,11 @@ void modem_cmux_init(struct modem_cmux *cmux, const struct modem_cmux_config *co __ASSERT_NO_MSG(cmux != NULL); __ASSERT_NO_MSG(config != NULL); __ASSERT_NO_MSG(config->receive_buf != NULL); - __ASSERT_NO_MSG(config->receive_buf_size >= MODEM_CMUX_DATA_FRAME_SIZE_MAX); + __ASSERT_NO_MSG(config->receive_buf_size >= + (CONFIG_MODEM_CMUX_MTU + MODEM_CMUX_FRAME_SIZE_MAX)); __ASSERT_NO_MSG(config->transmit_buf != NULL); - __ASSERT_NO_MSG(config->transmit_buf_size >= MODEM_CMUX_DATA_FRAME_SIZE_MAX); + __ASSERT_NO_MSG(config->transmit_buf_size >= + (CONFIG_MODEM_CMUX_MTU + MODEM_CMUX_FRAME_SIZE_MAX)); memset(cmux, 0x00, sizeof(*cmux)); cmux->callback = config->callback; From b38b550e226cfcf7c5b6ddff1b7bae6ddb6feb74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:51 +0100 Subject: [PATCH 1275/3334] Revert "[nrf fromtree] modem: cmux: Implement DM and NSC responses" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f89762bf8f09e117ff7eb842504a4f83cdb6530a. Signed-off-by: Tomasz Moń --- subsys/modem/modem_cmux.c | 79 +++------------------------------------ 1 file changed, 6 insertions(+), 73 deletions(-) diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 93665525ac7b..563f6a0baed6 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -336,7 +336,6 @@ static bool modem_cmux_transmit_cmd_frame(struct modem_cmux *cmux, if (space < MODEM_CMUX_CMD_FRAME_SIZE_MAX) { k_mutex_unlock(&cmux->transmit_rb_lock); - LOG_WRN("CMD buffer overflow"); return false; } @@ -474,41 +473,6 @@ static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) k_event_post(&cmux->event, MODEM_CMUX_EVENT_CONNECTED_BIT); } -static void modem_cmux_respond_unsupported_cmd(struct modem_cmux *cmux) -{ - struct modem_cmux_frame frame = cmux->frame; - struct modem_cmux_command *cmd; - - if (modem_cmux_wrap_command(&cmd, frame.data, frame.data_len) < 0) { - LOG_WRN("Invalid command"); - return; - } - - struct { - /* 3GPP TS 27.010: 5.4.6.3.8 Non Supported Command Response (NSC) */ - struct modem_cmux_command nsc; - struct modem_cmux_command_type value; - } nsc_cmd = { - .nsc = { - .type = { - .ea = 1, - .cr = 0, - .value = MODEM_CMUX_COMMAND_NSC, - }, - .length = { - .ea = 1, - .value = 1, - }, - }, - .value = cmd->type, - }; - - frame.data = (uint8_t *)&nsc_cmd; - frame.data_len = sizeof(nsc_cmd); - - modem_cmux_transmit_cmd_frame(cmux, &frame); -} - static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) { struct modem_cmux_command *command; @@ -545,7 +509,6 @@ static void modem_cmux_on_control_frame_uih(struct modem_cmux *cmux) default: LOG_DBG("Unknown control command"); - modem_cmux_respond_unsupported_cmd(cmux); break; } } @@ -569,26 +532,6 @@ static void modem_cmux_connect_response_transmit(struct modem_cmux *cmux) modem_cmux_transmit_cmd_frame(cmux, &frame); } -static void modem_cmux_dm_response_transmit(struct modem_cmux *cmux) -{ - if (cmux == NULL) { - return; - } - - /* 3GPP TS 27.010: 5.3.3 Disconnected Mode (DM) response */ - struct modem_cmux_frame frame = { - .dlci_address = cmux->frame.dlci_address, - .cr = cmux->frame.cr, - .pf = 1, - .type = MODEM_CMUX_FRAME_TYPE_DM, - .data = NULL, - .data_len = 0, - }; - - LOG_DBG("Send DM response"); - modem_cmux_transmit_cmd_frame(cmux, &frame); -} - static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) { modem_cmux_connect_response_transmit(cmux); @@ -648,13 +591,6 @@ static struct modem_cmux_dlci *modem_cmux_find_dlci(struct modem_cmux *cmux) return NULL; } -static void modem_cmux_on_dlci_frame_dm(struct modem_cmux_dlci *dlci) -{ - dlci->state = MODEM_CMUX_DLCI_STATE_CLOSED; - modem_pipe_notify_closed(&dlci->pipe); - k_work_cancel_delayable(&dlci->close_work); -} - static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) { switch (dlci->state) { @@ -670,7 +606,9 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) case MODEM_CMUX_DLCI_STATE_CLOSING: LOG_DBG("DLCI %u closed", dlci->dlci_address); - modem_cmux_on_dlci_frame_dm(dlci); + dlci->state = MODEM_CMUX_DLCI_STATE_CLOSED; + modem_pipe_notify_closed(&dlci->pipe); + k_work_cancel_delayable(&dlci->close_work); break; default: @@ -679,8 +617,6 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) } } - - static void modem_cmux_on_dlci_frame_uih(struct modem_cmux_dlci *dlci) { struct modem_cmux *cmux = dlci->cmux; @@ -727,7 +663,7 @@ static void modem_cmux_on_dlci_frame_disc(struct modem_cmux_dlci *dlci) modem_cmux_connect_response_transmit(cmux); if (dlci->state != MODEM_CMUX_DLCI_STATE_OPEN) { - modem_cmux_dm_response_transmit(cmux); + LOG_DBG("Unexpected Disc frame"); return; } @@ -744,9 +680,8 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) dlci = modem_cmux_find_dlci(cmux); if (dlci == NULL) { - LOG_WRN("Frame intended for unconfigured DLCI %u.", + LOG_WRN("Ignoring frame intended for unconfigured DLCI %u.", cmux->frame.dlci_address); - modem_cmux_dm_response_transmit(cmux); return; } @@ -766,9 +701,7 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) case MODEM_CMUX_FRAME_TYPE_DISC: modem_cmux_on_dlci_frame_disc(dlci); break; - case MODEM_CMUX_FRAME_TYPE_DM: - modem_cmux_on_dlci_frame_dm(dlci); - break; + default: LOG_WRN("Unknown %s frame type (%d, DLCI %d)", "DLCI", cmux->frame.type, cmux->frame.dlci_address); From 18d4a5d3845a46ddd0027cd34aec4ce02e4c070a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1276/3334] Revert "[nrf fromtree] drivers: modem: cellular: nRF91: Remove periodic chat script" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 46ef539f59552451ccee09572753d9653ed7ae4c. Signed-off-by: Tomasz Moń --- drivers/modem/modem_cellular.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index c0cc43a5dafa..277ae390fae4 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -2773,8 +2773,12 @@ MODEM_CHAT_SCRIPT_CMDS_DEFINE(nordic_nrf91_slm_dial_chat_script_cmds, MODEM_CHAT_SCRIPT_DEFINE(nordic_nrf91_slm_dial_chat_script, nordic_nrf91_slm_dial_chat_script_cmds, dial_abort_matches, modem_cellular_chat_callback_handler, 10); -MODEM_CHAT_SCRIPT_EMPTY_DEFINE(nordic_nrf91_slm_periodic_chat_script); +MODEM_CHAT_SCRIPT_CMDS_DEFINE(nordic_nrf91_slm_periodic_chat_script_cmds, + MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG?", ok_match)); +MODEM_CHAT_SCRIPT_DEFINE(nordic_nrf91_slm_periodic_chat_script, + nordic_nrf91_slm_periodic_chat_script_cmds, abort_matches, + modem_cellular_chat_callback_handler, 4); #endif #if DT_HAS_COMPAT_STATUS_OKAY(sqn_gm02s) @@ -3127,8 +3131,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, NULL, \ &nordic_nrf91_slm_init_chat_script, \ &nordic_nrf91_slm_dial_chat_script, \ - &nordic_nrf91_slm_periodic_chat_script, \ - NULL) + &nordic_nrf91_slm_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SQN_GM02S(inst) \ MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ From 4b26b5e830269794b7a2d0d2e14a203f8e9a3f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1277/3334] Revert "[nrf fromtree] modem: cmux: auto calculate work buffer sizes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 88c99a5a16c5230acfda3cc460c77f2e92bc787d. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.3.rst | 2 -- drivers/modem/modem_cellular.c | 8 ++++---- include/zephyr/modem/cmux.h | 6 +----- subsys/modem/Kconfig | 12 +++++++----- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index a3aec0898c8e..97e913c765ed 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -157,8 +157,6 @@ Modem ***** * ``CONFIG_MODEM_AT_SHELL_USER_PIPE`` has been renamed to :kconfig:option:`CONFIG_MODEM_AT_USER_PIPE`. -* ``CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE`` has been updated to :kconfig:option:`CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA`, - which only takes the number of extra bytes desired over the default of (:kconfig:option:`CONFIG_MODEM_CMUX_MTU` + 7). Display ******* diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 277ae390fae4..23c4795a3549 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -110,8 +110,8 @@ struct modem_cellular_data { /* CMUX */ struct modem_cmux cmux; - uint8_t cmux_receive_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; - uint8_t cmux_transmit_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t cmux_receive_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t cmux_transmit_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; struct modem_cmux_dlci dlci1; struct modem_cmux_dlci dlci2; @@ -119,9 +119,9 @@ struct modem_cellular_data { struct modem_pipe *dlci2_pipe; /* Points to dlci2_pipe or NULL. Used for shutdown script if not NULL */ struct modem_pipe *cmd_pipe; - uint8_t dlci1_receive_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t dlci1_receive_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; /* DLCI 2 is only used for chat scripts. */ - uint8_t dlci2_receive_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t dlci2_receive_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; /* Modem chat */ struct modem_chat chat; diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 913f4187d729..10fe93132819 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -57,10 +57,6 @@ typedef void (*modem_cmux_callback)(struct modem_cmux *cmux, enum modem_cmux_eve * @cond INTERNAL_HIDDEN */ -/* Total size of the CMUX work buffers */ -#define MODEM_CMUX_WORK_BUFFER_SIZE (CONFIG_MODEM_CMUX_MTU + 7 + \ - CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA) - enum modem_cmux_state { MODEM_CMUX_STATE_DISCONNECTED = 0, MODEM_CMUX_STATE_CONNECTING, @@ -156,7 +152,7 @@ struct modem_cmux { uint16_t receive_buf_size; uint16_t receive_buf_len; - uint8_t work_buf[MODEM_CMUX_WORK_BUFFER_SIZE]; + uint8_t work_buf[CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE]; /* Transmit buffer */ struct ring_buf transmit_rb; diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index 34114cd3893b..9f6ce441b7d5 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -42,12 +42,14 @@ config MODEM_CMUX_MTU Maximum Transmission Unit (MTU) size for the CMUX module. Linux ldattach defaults to 127 bytes, 3GPP TS 27.010 to 31. -config MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA - int "CMUX module extra work buffer size in bytes" - default 0 +config MODEM_CMUX_WORK_BUFFER_SIZE + int "CMUX module work buffer size in bytes" + range 23 1507 + default 134 if MODEM_CMUX_DEFAULT_MTU_127 + default 38 help - Extra bytes to add to the work buffers used by the CMUX module. - The default size of these buffers is MODEM_CMUX_MTU + 7 (CMUX header size). + Size of the work buffer used by the CMUX module. + Recommended size is MODEM_CMUX_MTU + 7 (CMUX header size). module = MODEM_CMUX module-str = modem_cmux From 81f702a2e6b3b7506d92a01af330a6e0392c8356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1278/3334] Revert "[nrf fromtree] modem: cmux: Rework the drop handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 15780164878ef21037e604353379280b31c72732. Signed-off-by: Tomasz Moń --- include/zephyr/modem/cmux.h | 1 + subsys/modem/modem_cmux.c | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/zephyr/modem/cmux.h b/include/zephyr/modem/cmux.h index 10fe93132819..3332c40bd18e 100644 --- a/include/zephyr/modem/cmux.h +++ b/include/zephyr/modem/cmux.h @@ -74,6 +74,7 @@ enum modem_cmux_receive_state { MODEM_CMUX_RECEIVE_STATE_LENGTH_CONT, MODEM_CMUX_RECEIVE_STATE_DATA, MODEM_CMUX_RECEIVE_STATE_FCS, + MODEM_CMUX_RECEIVE_STATE_DROP, MODEM_CMUX_RECEIVE_STATE_EOF, }; diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 563f6a0baed6..3e7a001c82ca 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -13,7 +13,6 @@ LOG_MODULE_REGISTER(modem_cmux, CONFIG_MODEM_CMUX_LOG_LEVEL); #include -#define MODEM_CMUX_SOF (0xF9) #define MODEM_CMUX_FCS_POLYNOMIAL (0xE0) #define MODEM_CMUX_FCS_INIT_VALUE (0xFF) #define MODEM_CMUX_EA (0x01) @@ -283,7 +282,7 @@ static uint16_t modem_cmux_transmit_frame(struct modem_cmux *cmux, data_len = MIN(data_len, CONFIG_MODEM_CMUX_MTU); /* SOF */ - buf[0] = MODEM_CMUX_SOF; + buf[0] = 0xF9; /* DLCI Address (Max 63) */ buf[1] = 0x01 | (frame->cr << 1) | (frame->dlci_address << 2); @@ -319,7 +318,7 @@ static uint16_t modem_cmux_transmit_frame(struct modem_cmux *cmux, /* FCS and EOF will be put on the same call */ buf[0] = fcs; - buf[1] = MODEM_CMUX_SOF; + buf[1] = 0xF9; ring_buf_put(&cmux->transmit_rb, buf, 2); k_work_schedule(&cmux->transmit_work, K_NO_WAIT); return data_len; @@ -745,7 +744,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by switch (cmux->receive_state) { case MODEM_CMUX_RECEIVE_STATE_SOF: - if (byte == MODEM_CMUX_SOF) { + if (byte == 0xF9) { cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_RESYNC; break; } @@ -757,7 +756,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by * Allow any number of consecutive flags (0xF9). * 0xF9 could also be a valid address field for DLCI 62. */ - if (byte == MODEM_CMUX_SOF) { + if (byte == 0xF9) { break; } @@ -814,7 +813,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by if (cmux->frame.data_len > CONFIG_MODEM_CMUX_MTU) { LOG_ERR("Too large frame"); - modem_cmux_drop_frame(cmux); + cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; break; } @@ -839,7 +838,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by if (cmux->frame.data_len > CONFIG_MODEM_CMUX_MTU) { LOG_ERR("Too large frame"); - modem_cmux_drop_frame(cmux); + cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; break; } @@ -847,7 +846,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by LOG_ERR("Indicated frame data length %u exceeds receive buffer size %u", cmux->frame.data_len, cmux->receive_buf_size); - modem_cmux_drop_frame(cmux); + cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; break; } @@ -874,7 +873,7 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by if (cmux->receive_buf_len > cmux->receive_buf_size) { LOG_WRN("Receive buffer overrun (%u > %u)", cmux->receive_buf_len, cmux->receive_buf_size); - modem_cmux_drop_frame(cmux); + cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; break; } @@ -891,16 +890,21 @@ static void modem_cmux_process_received_byte(struct modem_cmux *cmux, uint8_t by if (fcs != byte) { LOG_WRN("Frame FCS error"); - modem_cmux_drop_frame(cmux); + /* Drop frame */ + cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_DROP; break; } cmux->receive_state = MODEM_CMUX_RECEIVE_STATE_EOF; break; + case MODEM_CMUX_RECEIVE_STATE_DROP: + modem_cmux_drop_frame(cmux); + break; + case MODEM_CMUX_RECEIVE_STATE_EOF: /* Validate byte is EOF */ - if (byte != MODEM_CMUX_SOF) { + if (byte != 0xF9) { /* Unexpected byte */ modem_cmux_drop_frame(cmux); break; From b53d0ecc9dae74a6a3d459eeb3e4f8dc7984a019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1279/3334] Revert "[nrf fromtree] modem: cmux: Clean debugging a bit" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b39cff87dd671d34f69e4dda75324aed791362e8. Signed-off-by: Tomasz Moń --- subsys/modem/Kconfig | 6 ------ subsys/modem/modem_cmux.c | 23 +++++------------------ 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index 9f6ce441b7d5..087b4d79be8c 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -55,12 +55,6 @@ module = MODEM_CMUX module-str = modem_cmux source "subsys/logging/Kconfig.template.log_config" -config MODEM_CMUX_LOG_FRAMES - bool "Log CMUX frames" - depends on MODEM_CMUX_LOG_LEVEL_DBG - help - Enable logging of CMUX frames. This can produce a lot of log data. - endif config MODEM_PIPE diff --git a/subsys/modem/modem_cmux.c b/subsys/modem/modem_cmux.c index 3e7a001c82ca..d5547e03da28 100644 --- a/subsys/modem/modem_cmux.c +++ b/subsys/modem/modem_cmux.c @@ -101,7 +101,6 @@ static struct modem_cmux_command *modem_cmux_command_wrap(const uint8_t *data) return (struct modem_cmux_command *)data; } -#if CONFIG_MODEM_CMUX_LOG_FRAMES static const char *modem_cmux_frame_type_to_str(enum modem_cmux_frame_types frame_type) { switch (frame_type) { @@ -132,14 +131,8 @@ static void modem_cmux_log_frame(const struct modem_cmux_frame *frame, { LOG_DBG("%s ch:%u cr:%u pf:%u type:%s dlen:%u", action, frame->dlci_address, frame->cr, frame->pf, modem_cmux_frame_type_to_str(frame->type), frame->data_len); - if (hexdump_len > 0) { - LOG_HEXDUMP_DBG(frame->data, hexdump_len, "data:"); - } + LOG_HEXDUMP_DBG(frame->data, hexdump_len, "data:"); } -#else -#define modem_cmux_log_frame(frame, action, hexdump_len) \ - do { ARG_UNUSED(frame); ARG_UNUSED(action); ARG_UNUSED(hexdump_len); } while (0) -#endif /* CONFIG_MODEM_CMUX_LOG_FRAMES */ static void modem_cmux_log_transmit_frame(const struct modem_cmux_frame *frame) { @@ -232,12 +225,14 @@ static void modem_cmux_log_transmit_command(const struct modem_cmux_command *com { LOG_DBG("ea:%u,cr:%u,type:%s", command->type.ea, command->type.cr, modem_cmux_command_type_to_str(command->type.value)); + LOG_HEXDUMP_DBG(command->value, command->length.value, "data:"); } static void modem_cmux_log_received_command(const struct modem_cmux_command *command) { LOG_DBG("ea:%u,cr:%u,type:%s", command->type.ea, command->type.cr, modem_cmux_command_type_to_str(command->type.value)); + LOG_HEXDUMP_DBG(command->value, command->length.value, "data:"); } static void modem_cmux_raise_event(struct modem_cmux *cmux, enum modem_cmux_event event) @@ -443,7 +438,6 @@ static void modem_cmux_on_cld_command(struct modem_cmux *cmux, struct modem_cmux k_work_cancel_delayable(&cmux->disconnect_work); } - LOG_DBG("CMUX disconnected"); cmux->state = MODEM_CMUX_STATE_DISCONNECTED; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = false; @@ -461,7 +455,6 @@ static void modem_cmux_on_control_frame_ua(struct modem_cmux *cmux) return; } - LOG_DBG("CMUX connected"); cmux->state = MODEM_CMUX_STATE_CONNECTED; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; @@ -541,7 +534,6 @@ static void modem_cmux_on_control_frame_sabm(struct modem_cmux *cmux) return; } - LOG_DBG("CMUX connection request received"); cmux->state = MODEM_CMUX_STATE_CONNECTED; k_mutex_lock(&cmux->transmit_rb_lock, K_FOREVER); cmux->flow_control_on = true; @@ -569,7 +561,7 @@ static void modem_cmux_on_control_frame(struct modem_cmux *cmux) break; default: - LOG_WRN("Unknown %s frame type %d", "control", cmux->frame.type); + LOG_WRN("Unknown %s frame type", "control"); break; } } @@ -594,7 +586,6 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) { switch (dlci->state) { case MODEM_CMUX_DLCI_STATE_OPENING: - LOG_DBG("DLCI %u opened", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_OPEN; modem_pipe_notify_opened(&dlci->pipe); k_work_cancel_delayable(&dlci->open_work); @@ -604,7 +595,6 @@ static void modem_cmux_on_dlci_frame_ua(struct modem_cmux_dlci *dlci) break; case MODEM_CMUX_DLCI_STATE_CLOSING: - LOG_DBG("DLCI %u closed", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_CLOSED; modem_pipe_notify_closed(&dlci->pipe); k_work_cancel_delayable(&dlci->close_work); @@ -647,7 +637,6 @@ static void modem_cmux_on_dlci_frame_sabm(struct modem_cmux_dlci *dlci) return; } - LOG_DBG("DLCI %u SABM request accepted, DLCI opened", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_OPEN; modem_pipe_notify_opened(&dlci->pipe); k_mutex_lock(&dlci->receive_rb_lock, K_FOREVER); @@ -666,7 +655,6 @@ static void modem_cmux_on_dlci_frame_disc(struct modem_cmux_dlci *dlci) return; } - LOG_DBG("DLCI %u disconnected", dlci->dlci_address); dlci->state = MODEM_CMUX_DLCI_STATE_CLOSED; modem_pipe_notify_closed(&dlci->pipe); } @@ -702,8 +690,7 @@ static void modem_cmux_on_dlci_frame(struct modem_cmux *cmux) break; default: - LOG_WRN("Unknown %s frame type (%d, DLCI %d)", "DLCI", cmux->frame.type, - cmux->frame.dlci_address); + LOG_WRN("Unknown %s frame type", "DLCI"); break; } } From 687c3c6d57c5a319be3cf11c47810810f6ee9147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1280/3334] Revert "[nrf fromtree] modem: modem_cellular: Allow PPP interface to wake up the device" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 04e697e8f360f5ba1c1002ce2a05f7e29540238a. Signed-off-by: Tomasz Moń --- drivers/modem/modem_cellular.c | 26 ++++++++++++------------- include/zephyr/modem/ppp.h | 35 ++++------------------------------ subsys/modem/Kconfig | 1 - subsys/modem/modem_ppp.c | 17 ++--------------- 4 files changed, 19 insertions(+), 60 deletions(-) diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c index 23c4795a3549..3e7b3a30eff1 100644 --- a/drivers/modem/modem_cellular.c +++ b/drivers/modem/modem_cellular.c @@ -2905,7 +2905,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &modem_cellular_api); #define MODEM_CELLULAR_DEVICE_QUECTEL_BG9X(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -2925,7 +2925,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &quectel_bg9x_shutdown_chat_script) #define MODEM_CELLULAR_DEVICE_QUECTEL_EG25_G(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -2944,7 +2944,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &quectel_eg25_g_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_QUECTEL_EG800Q(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -2963,7 +2963,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &quectel_eg800q_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SIMCOM_SIM7080(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -2982,7 +2982,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &simcom_sim7080_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SIMCOM_A76XX(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3002,7 +3002,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &simcom_a76xx_shutdown_chat_script) #define MODEM_CELLULAR_DEVICE_U_BLOX_SARA_R4(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3021,7 +3021,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &u_blox_sara_r4_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_U_BLOX_SARA_R5(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3040,7 +3040,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &u_blox_sara_r5_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_U_BLOX_LARA_R6(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3060,7 +3060,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SWIR_HL7800(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3079,7 +3079,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &swir_hl7800_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_TELIT_ME910G1(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3098,7 +3098,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_TELIT_ME310G1(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ @@ -3117,7 +3117,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &telit_me310g1_shutdown_chat_script) #define MODEM_CELLULAR_DEVICE_NORDIC_NRF91_SLM(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 1500); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 1500); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r\n", \ @@ -3134,7 +3134,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, &nordic_nrf91_slm_periodic_chat_script, NULL) #define MODEM_CELLULAR_DEVICE_SQN_GM02S(inst) \ - MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ + MODEM_PPP_DEFINE(MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ \ static struct modem_cellular_data MODEM_CELLULAR_INST_NAME(data, inst) = { \ .chat_delimiter = "\r", \ diff --git a/include/zephyr/modem/ppp.h b/include/zephyr/modem/ppp.h index b3dbcfdeb7fb..2b91e51a35c9 100644 --- a/include/zephyr/modem/ppp.h +++ b/include/zephyr/modem/ppp.h @@ -123,10 +123,6 @@ struct modem_ppp { #endif }; -struct modem_ppp_config { - const struct device *dev; -}; - /** * @endcond */ @@ -176,17 +172,13 @@ int modem_ppp_init_internal(const struct device *dev); * network device instance, and binds the modem_ppp instance to the PPP L2 * instance. * - * If underlying cellular device is given, the PPP interface will manage the - * power state of the cellular device when starting and stopping the PPP. - * - * @param _dev Cellular device instance for power management or NULL if not used * @param _name Name of the statically defined modem_ppp instance * @param _init_iface Hook for the PPP L2 network interface init function * @param _prio Initialization priority of the PPP L2 net iface * @param _mtu Max size of net_pkt data sent and received on PPP L2 net iface * @param _buf_size Size of partial PPP frame transmit and receive buffers */ -#define MODEM_DEV_PPP_DEFINE(_dev, _name, _init_iface, _prio, _mtu, _buf_size) \ +#define MODEM_PPP_DEFINE(_name, _init_iface, _prio, _mtu, _buf_size) \ extern const struct ppp_api modem_ppp_ppp_api; \ \ static uint8_t _CONCAT(_name, _receive_buf)[_buf_size]; \ @@ -197,30 +189,11 @@ int modem_ppp_init_internal(const struct device *dev); .receive_buf = _CONCAT(_name, _receive_buf), \ .transmit_buf = _CONCAT(_name, _transmit_buf), \ .buf_size = _buf_size, \ - }; \ - static const struct modem_ppp_config _CONCAT(_name, _config) = { \ - .dev = _dev, \ }; \ \ - NET_DEVICE_INIT(_CONCAT(ppp_net_dev_, _name), "modem_ppp_" #_name, \ - modem_ppp_init_internal, NULL, &_name, &_CONCAT(_name, _config), _prio, \ - &modem_ppp_ppp_api, PPP_L2, NET_L2_GET_CTX_TYPE(PPP_L2), _mtu) - -/** - * @brief Define a modem PPP module for cellular device tree instance. - * - * @see MODEM_DEV_PPP_DEFINE - */ -#define MODEM_DT_INST_PPP_DEFINE(inst, _name, _init_iface, _prio, _mtu, _buf_size) \ - MODEM_DEV_PPP_DEFINE(DEVICE_DT_INST_GET(inst), _name, _init_iface, _prio, _mtu, _buf_size) - -/** - * @brief Define a modem PPP module without a device and bind it to a network interface. - * - * @see MODEM_DEV_PPP_DEFINE - */ -#define MODEM_PPP_DEFINE(_name, _init_iface, _prio, _mtu, _buf_size) \ - MODEM_DEV_PPP_DEFINE(NULL, _name, _init_iface, _prio, _mtu, _buf_size) + NET_DEVICE_INIT(_CONCAT(ppp_net_dev_, _name), "modem_ppp_" # _name, \ + modem_ppp_init_internal, NULL, &_name, NULL, _prio, &modem_ppp_ppp_api, \ + PPP_L2, NET_L2_GET_CTX_TYPE(PPP_L2), _mtu) /** * @} diff --git a/subsys/modem/Kconfig b/subsys/modem/Kconfig index 087b4d79be8c..b7c3f7ba9014 100644 --- a/subsys/modem/Kconfig +++ b/subsys/modem/Kconfig @@ -71,7 +71,6 @@ config MODEM_PPP select MODEM_PIPE select RING_BUFFER select CRC - select PM_DEVICE_RUNTIME_ASYNC if PM_DEVICE_RUNTIME if MODEM_PPP diff --git a/subsys/modem/modem_ppp.c b/subsys/modem/modem_ppp.c index 9e2e2b5d71b7..537f198251f7 100644 --- a/subsys/modem/modem_ppp.c +++ b/subsys/modem/modem_ppp.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -446,24 +445,12 @@ static void modem_ppp_ppp_api_init(struct net_if *iface) static int modem_ppp_ppp_api_start(const struct device *dev) { - const struct modem_ppp_config *config = (const struct modem_ppp_config *)dev->config; - - if (config == NULL || config->dev == NULL) { - return 0; - } - - return pm_device_runtime_get(config->dev); + return 0; } static int modem_ppp_ppp_api_stop(const struct device *dev) { - const struct modem_ppp_config *config = (const struct modem_ppp_config *)dev->config; - - if (config == NULL || config->dev == NULL) { - return 0; - } - - return pm_device_runtime_put_async(config->dev, K_NO_WAIT); + return 0; } static int modem_ppp_ppp_api_send(const struct device *dev, struct net_pkt *pkt) From 15456d2e16766abd37b5f745497499b0efc0904d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1281/3334] Revert "[nrf fromtree] modem: at_shell: extract user pipe handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f832194f291c63cdb4b512f54d6c6bebb76e658f. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.3.rst | 5 -- drivers/modem/CMakeLists.txt | 1 - drivers/modem/Kconfig.at_shell | 24 ++--- drivers/modem/modem_at_shell.c | 126 +++++++++++++++++++++++---- drivers/modem/modem_at_user_pipe.c | 124 -------------------------- include/zephyr/modem/at/user_pipe.h | 37 -------- 6 files changed, 117 insertions(+), 200 deletions(-) delete mode 100644 drivers/modem/modem_at_user_pipe.c delete mode 100644 include/zephyr/modem/at/user_pipe.h diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index 97e913c765ed..83dc5e771201 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -153,11 +153,6 @@ Networking .. zephyr-keep-sorted-stop -Modem -***** - -* ``CONFIG_MODEM_AT_SHELL_USER_PIPE`` has been renamed to :kconfig:option:`CONFIG_MODEM_AT_USER_PIPE`. - Display ******* diff --git a/drivers/modem/CMakeLists.txt b/drivers/modem/CMakeLists.txt index adc6614dc7fe..62b84bd79294 100644 --- a/drivers/modem/CMakeLists.txt +++ b/drivers/modem/CMakeLists.txt @@ -36,5 +36,4 @@ if (CONFIG_MODEM_SIM7080) endif() zephyr_library_sources_ifdef(CONFIG_MODEM_CELLULAR modem_cellular.c) -zephyr_library_sources_ifdef(CONFIG_MODEM_AT_USER_PIPE modem_at_user_pipe.c) zephyr_library_sources_ifdef(CONFIG_MODEM_AT_SHELL modem_at_shell.c) diff --git a/drivers/modem/Kconfig.at_shell b/drivers/modem/Kconfig.at_shell index 3d399e2338ce..b2f6f42e3936 100644 --- a/drivers/modem/Kconfig.at_shell +++ b/drivers/modem/Kconfig.at_shell @@ -1,30 +1,22 @@ # Copyright (c) 2024 Trackunit Corporation # SPDX-License-Identifier: Apache-2.0 -config MODEM_AT_USER_PIPE - bool "Modem AT command user pipe helpers" - depends on $(dt_alias_enabled,modem) - select MODEM_CHAT - select MODEM_PIPE - select MODEM_PIPELINK - help - Utility functions for managing access to user pipes - for arbitrary AT commands - -config MODEM_AT_USER_PIPE_IDX - int "User pipe number to use" - depends on MODEM_AT_USER_PIPE - default 0 - config MODEM_AT_SHELL bool "AT command shell based on modem modules" select MODEM_MODULES - select MODEM_AT_USER_PIPE + select MODEM_CHAT + select MODEM_PIPE + select MODEM_PIPELINK depends on !MODEM_SHELL depends on !SHELL_WILDCARD + depends on $(dt_alias_enabled,modem) if MODEM_AT_SHELL +config MODEM_AT_SHELL_USER_PIPE + int "User pipe number to use" + default 0 + config MODEM_AT_SHELL_RESPONSE_TIMEOUT_S int "Timeout waiting for response to AT command in seconds" default 5 diff --git a/drivers/modem/modem_at_shell.c b/drivers/modem/modem_at_shell.c index 7d1930b6b04b..5d2820d7483e 100644 --- a/drivers/modem/modem_at_shell.c +++ b/drivers/modem/modem_at_shell.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -14,6 +13,17 @@ #include LOG_MODULE_REGISTER(modem_at_shell, CONFIG_MODEM_LOG_LEVEL); +#define AT_SHELL_MODEM_NODE DT_ALIAS(modem) +#define AT_SHELL_PIPELINK_NAME _CONCAT(user_pipe_, CONFIG_MODEM_AT_SHELL_USER_PIPE) + +#define AT_SHELL_STATE_ATTACHED_BIT 0 +#define AT_SHELL_STATE_SCRIPT_RUNNING_BIT 1 + +MODEM_PIPELINK_DT_DECLARE(AT_SHELL_MODEM_NODE, AT_SHELL_PIPELINK_NAME); + +static struct modem_pipelink *at_shell_pipelink = + MODEM_PIPELINK_DT_GET(AT_SHELL_MODEM_NODE, AT_SHELL_PIPELINK_NAME); + static struct modem_chat at_shell_chat; static uint8_t at_shell_chat_receive_buf[CONFIG_MODEM_AT_SHELL_CHAT_RECEIVE_BUF_SIZE]; static uint8_t *at_shell_chat_argv_buf[2]; @@ -22,6 +32,10 @@ static struct modem_chat_script_chat at_shell_script_chat[1]; static struct modem_chat_match at_shell_script_chat_matches[2]; static uint8_t at_shell_match_buf[CONFIG_MODEM_AT_SHELL_RESPONSE_MAX_SIZE]; static const struct shell *at_shell_active_shell; +static struct k_work at_shell_open_pipe_work; +static struct k_work at_shell_attach_chat_work; +static struct k_work at_shell_release_chat_work; +static atomic_t at_shell_state; static void at_shell_print_any_match(struct modem_chat *chat, char **argv, uint16_t argc, void *user_data) @@ -60,7 +74,7 @@ static void at_shell_script_callback(struct modem_chat *chat, enum modem_chat_script_result result, void *user_data) { - modem_at_user_pipe_release(); + atomic_clear_bit(&at_shell_state, AT_SHELL_STATE_SCRIPT_RUNNING_BIT); } MODEM_CHAT_SCRIPT_DEFINE( @@ -71,6 +85,83 @@ MODEM_CHAT_SCRIPT_DEFINE( CONFIG_MODEM_AT_SHELL_RESPONSE_TIMEOUT_S ); +static void at_shell_pipe_callback(struct modem_pipe *pipe, + enum modem_pipe_event event, + void *user_data) +{ + ARG_UNUSED(user_data); + + switch (event) { + case MODEM_PIPE_EVENT_OPENED: + LOG_INF("pipe opened"); + k_work_submit(&at_shell_attach_chat_work); + break; + + default: + break; + } +} + +void at_shell_pipelink_callback(struct modem_pipelink *link, + enum modem_pipelink_event event, + void *user_data) +{ + ARG_UNUSED(user_data); + + switch (event) { + case MODEM_PIPELINK_EVENT_CONNECTED: + LOG_INF("pipe connected"); + k_work_submit(&at_shell_open_pipe_work); + break; + + case MODEM_PIPELINK_EVENT_DISCONNECTED: + LOG_INF("pipe disconnected"); + k_work_submit(&at_shell_release_chat_work); + break; + + default: + break; + } +} + +static void at_shell_open_pipe_handler(struct k_work *work) +{ + ARG_UNUSED(work); + + LOG_INF("opening pipe"); + + modem_pipe_attach(modem_pipelink_get_pipe(at_shell_pipelink), + at_shell_pipe_callback, + NULL); + + modem_pipe_open_async(modem_pipelink_get_pipe(at_shell_pipelink)); +} + +static void at_shell_attach_chat_handler(struct k_work *work) +{ + ARG_UNUSED(work); + + modem_chat_attach(&at_shell_chat, modem_pipelink_get_pipe(at_shell_pipelink)); + atomic_set_bit(&at_shell_state, AT_SHELL_STATE_ATTACHED_BIT); + LOG_INF("chat attached"); +} + +static void at_shell_release_chat_handler(struct k_work *work) +{ + ARG_UNUSED(work); + + modem_chat_release(&at_shell_chat); + atomic_clear_bit(&at_shell_state, AT_SHELL_STATE_ATTACHED_BIT); + LOG_INF("chat released"); +} + +static void at_shell_init_work(void) +{ + k_work_init(&at_shell_open_pipe_work, at_shell_open_pipe_handler); + k_work_init(&at_shell_attach_chat_work, at_shell_attach_chat_handler); + k_work_init(&at_shell_release_chat_work, at_shell_release_chat_handler); +} + static void at_shell_init_chat(void) { const struct modem_chat_config at_shell_chat_config = { @@ -113,11 +204,17 @@ static void at_shell_init_script_chat(void) CONFIG_MODEM_AT_SHELL_RESPONSE_TIMEOUT_S); } +static void at_shell_init_pipelink(void) +{ + modem_pipelink_attach(at_shell_pipelink, at_shell_pipelink_callback, NULL); +} + static int at_shell_init(void) { + at_shell_init_work(); at_shell_init_chat(); at_shell_init_script_chat(); - modem_at_user_pipe_init(&at_shell_chat); + at_shell_init_pipelink(); return 0; } @@ -131,19 +228,14 @@ static int at_shell_cmd_handler(const struct shell *sh, size_t argc, char **argv return -EINVAL; } - ret = modem_at_user_pipe_claim(); - if (ret < 0) { - switch (ret) { - case -EPERM: - shell_error(sh, "modem is not ready"); - break; - case -EBUSY: - shell_error(sh, "script is already running"); - break; - default: - shell_error(sh, "unknown"); - } - return ret; + if (!atomic_test_bit(&at_shell_state, AT_SHELL_STATE_ATTACHED_BIT)) { + shell_error(sh, "modem is not ready"); + return -EPERM; + } + + if (atomic_test_and_set_bit(&at_shell_state, AT_SHELL_STATE_SCRIPT_RUNNING_BIT)) { + shell_error(sh, "script is already running"); + return -EBUSY; } strncpy(at_shell_request_buf, argv[1], sizeof(at_shell_request_buf) - 1); @@ -168,7 +260,7 @@ static int at_shell_cmd_handler(const struct shell *sh, size_t argc, char **argv ret = modem_chat_run_script_async(&at_shell_chat, &at_shell_script); if (ret < 0) { shell_error(sh, "failed to start script"); - modem_at_user_pipe_release(); + atomic_clear_bit(&at_shell_state, AT_SHELL_STATE_SCRIPT_RUNNING_BIT); } return ret; diff --git a/drivers/modem/modem_at_user_pipe.c b/drivers/modem/modem_at_user_pipe.c deleted file mode 100644 index 6fb0046f0fef..000000000000 --- a/drivers/modem/modem_at_user_pipe.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2025 Embeint Holdings Pty Ltd - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include - -#define AT_UTIL_MODEM_NODE DT_ALIAS(modem) -#define AT_UTIL_PIPELINK_NAME _CONCAT(user_pipe_, CONFIG_MODEM_AT_USER_PIPE_IDX) - -#define AT_UTIL_STATE_ATTACHED_BIT 0 -#define AT_UTIL_STATE_SCRIPT_RUNNING_BIT 1 - -MODEM_PIPELINK_DT_DECLARE(AT_UTIL_MODEM_NODE, AT_UTIL_PIPELINK_NAME); - -static struct modem_pipelink *at_util_pipelink = - MODEM_PIPELINK_DT_GET(AT_UTIL_MODEM_NODE, AT_UTIL_PIPELINK_NAME); - -static struct k_work at_util_open_pipe_work; -static struct k_work at_util_attach_chat_work; -static struct k_work at_util_release_chat_work; -static struct modem_chat *at_util_chat; -static atomic_t at_util_state; - -LOG_MODULE_REGISTER(modem_at_user_pipe, CONFIG_MODEM_LOG_LEVEL); - -static void at_util_pipe_callback(struct modem_pipe *pipe, enum modem_pipe_event event, - void *user_data) -{ - ARG_UNUSED(user_data); - - switch (event) { - case MODEM_PIPE_EVENT_OPENED: - LOG_INF("pipe opened"); - k_work_submit(&at_util_attach_chat_work); - break; - - default: - break; - } -} - -void at_util_pipelink_callback(struct modem_pipelink *link, enum modem_pipelink_event event, - void *user_data) -{ - ARG_UNUSED(user_data); - - switch (event) { - case MODEM_PIPELINK_EVENT_CONNECTED: - LOG_INF("pipe connected"); - k_work_submit(&at_util_open_pipe_work); - break; - - case MODEM_PIPELINK_EVENT_DISCONNECTED: - LOG_INF("pipe disconnected"); - k_work_submit(&at_util_release_chat_work); - break; - - default: - break; - } -} - -static void at_util_open_pipe_handler(struct k_work *work) -{ - ARG_UNUSED(work); - - LOG_INF("opening pipe"); - - modem_pipe_attach(modem_pipelink_get_pipe(at_util_pipelink), at_util_pipe_callback, NULL); - - modem_pipe_open_async(modem_pipelink_get_pipe(at_util_pipelink)); -} - -static void at_util_attach_chat_handler(struct k_work *work) -{ - ARG_UNUSED(work); - - modem_chat_attach(at_util_chat, modem_pipelink_get_pipe(at_util_pipelink)); - atomic_set_bit(&at_util_state, AT_UTIL_STATE_ATTACHED_BIT); - LOG_INF("chat attached"); -} - -static void at_util_release_chat_handler(struct k_work *work) -{ - ARG_UNUSED(work); - - modem_chat_release(at_util_chat); - atomic_clear_bit(&at_util_state, AT_UTIL_STATE_ATTACHED_BIT); - LOG_INF("chat released"); -} - -void modem_at_user_pipe_init(struct modem_chat *chat) -{ - at_util_chat = chat; - /* Initialise workers and setup callbacks */ - k_work_init(&at_util_open_pipe_work, at_util_open_pipe_handler); - k_work_init(&at_util_attach_chat_work, at_util_attach_chat_handler); - k_work_init(&at_util_release_chat_work, at_util_release_chat_handler); - modem_pipelink_attach(at_util_pipelink, at_util_pipelink_callback, NULL); -} - -int modem_at_user_pipe_claim(void) -{ - if (!atomic_test_bit(&at_util_state, AT_UTIL_STATE_ATTACHED_BIT)) { - return -EPERM; - } - - if (atomic_test_and_set_bit(&at_util_state, AT_UTIL_STATE_SCRIPT_RUNNING_BIT)) { - return -EBUSY; - } - - return 0; -} - -void modem_at_user_pipe_release(void) -{ - atomic_clear_bit(&at_util_state, AT_UTIL_STATE_SCRIPT_RUNNING_BIT); -} diff --git a/include/zephyr/modem/at/user_pipe.h b/include/zephyr/modem/at/user_pipe.h deleted file mode 100644 index 9732f5131111..000000000000 --- a/include/zephyr/modem/at/user_pipe.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 Embeint Holdings Pty Ltd - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_MODEM_AT_USER_PIPE_ -#define ZEPHYR_MODEM_AT_USER_PIPE_ - -#include - -/** - * @brief Initialise the AT command user pipe - * - * @param chat Chat instance that will be used with the user pipe - */ -void modem_at_user_pipe_init(struct modem_chat *chat); - -/** - * @brief Claim the AT command user pipe to run commands - * - * - * @retval 0 On success - * @retval -EPERM Modem is not ready - * @retval -EBUSY User pipe already claimed - */ -int modem_at_user_pipe_claim(void); - -/** - * @brief Release the AT command user pipe to other users - * - * Must be called after @ref modem_at_user_pipe_claim when pipe is no longer - * in use. - */ -void modem_at_user_pipe_release(void); - -#endif /* ZEPHYR_MODEM_AT_USER_PIPE_ */ From 52313e25b46e4f010d279edf7d7f27a772100bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1282/3334] Revert "[nrf fromtree] drivers: mspi_dw: Add CONFIG_MSPI_DW_DDR" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d6275556f4e341c6c2023a57eee2365b69b94c14. Signed-off-by: Tomasz Moń --- drivers/mspi/Kconfig.dw | 9 --------- drivers/mspi/mspi_dw.c | 4 ---- 2 files changed, 13 deletions(-) diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index e967671e4723..71302a801fdb 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -11,13 +11,6 @@ config MSPI_DW if MSPI_DW -config MSPI_DW_DDR - bool "Dual Data-Rate (DDR) capabilities" - default y - help - Dual data rate is supported by some devices and requires specific - registers to be enabled in the IP. - config MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE bool "Handle FIFO in system workqueue" depends on MULTITHREADING @@ -30,7 +23,6 @@ config MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE config MSPI_DW_TXD_DIV int "Designware SSI TX Drive edge divisor" - depends on MSPI_DW_DDR default 4 help Division factor to apply to calculated BAUDR value when writing it @@ -39,7 +31,6 @@ config MSPI_DW_TXD_DIV config MSPI_DW_TXD_MUL int "Designware SSI TX Drive edge multiplier" - depends on MSPI_DW_DDR default 1 help Multiplication factor to apply to calculated BAUDR value when writing diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 4f6616a91749..b52e0533e3a9 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -937,7 +937,6 @@ static int _api_dev_config(const struct device *dev, switch (cfg->data_rate) { case MSPI_DATA_RATE_SINGLE: break; -#if defined(CONFIG_MSPI_DW_DDR) case MSPI_DATA_RATE_DUAL: dev_data->spi_ctrlr0 |= SPI_CTRLR0_INST_DDR_EN_BIT; /* Also need to set DDR_EN bit */ @@ -945,7 +944,6 @@ static int _api_dev_config(const struct device *dev, case MSPI_DATA_RATE_S_D_D: dev_data->spi_ctrlr0 |= SPI_CTRLR0_SPI_DDR_EN_BIT; break; -#endif default: LOG_ERR("Data rate %d not supported", cfg->data_rate); @@ -1240,7 +1238,6 @@ static int start_next_packet(const struct device *dev) write_spi_ctrlr0(dev, dev_data->spi_ctrlr0); write_baudr(dev, dev_data->baudr); write_rx_sample_dly(dev, dev_data->rx_sample_dly); -#if defined(CONFIG_MSPI_DW_DDR) if (dev_data->spi_ctrlr0 & (SPI_CTRLR0_SPI_DDR_EN_BIT | SPI_CTRLR0_INST_DDR_EN_BIT)) { int txd = (CONFIG_MSPI_DW_TXD_MUL * dev_data->baudr) / @@ -1250,7 +1247,6 @@ static int start_next_packet(const struct device *dev) } else { write_txd_drive_edge(dev, 0); } -#endif if (xip_enabled) { write_ssienr(dev, SSIENR_SSIC_EN_BIT); From 8a29cb18bd581a393d89f84a324b8e7ce8ee6192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1283/3334] Revert "[nrf fromtree] drivers: mspi_dw: Edit core disable to after PM init" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 154a7104459d65e49d452f15c8037282d2933ef3. Signed-off-by: Tomasz Moń --- drivers/mspi/mspi_dw.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index b52e0533e3a9..d4700a99261a 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -1864,6 +1864,9 @@ static int dev_init(const struct device *dev) } } + /* Make sure controller is disabled. */ + write_ssienr(dev, 0); + #if defined(CONFIG_PINCTRL) if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { rc = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); @@ -1874,15 +1877,7 @@ static int dev_init(const struct device *dev) } #endif - rc = pm_device_driver_init(dev, dev_pm_action_cb); - if (rc < 0) { - return rc; - } - - /* Make sure controller is disabled. */ - write_ssienr(dev, 0); - - return 0; + return pm_device_driver_init(dev, dev_pm_action_cb); } static DEVICE_API(mspi, drv_api) = { From 006761f5f428e41ccdfa6a3124bcdc4ee0b9dc94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1284/3334] Revert "[nrf fromtree] drivers: mspi: mspi_dw: Add DMA support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b79b24cbbe7e23966dea34f4f9a0e43566599d3b. Signed-off-by: Tomasz Moń --- doc/hardware/peripherals/mspi.rst | 1 - drivers/mspi/Kconfig | 6 - drivers/mspi/Kconfig.dw | 1 + drivers/mspi/mspi_dw.c | 227 ++++++------------- drivers/mspi/mspi_dw.h | 16 -- drivers/mspi/mspi_dw_vendor_specific.h | 247 +-------------------- dts/bindings/mspi/snps,designware-ssi.yaml | 17 -- 7 files changed, 76 insertions(+), 439 deletions(-) diff --git a/doc/hardware/peripherals/mspi.rst b/doc/hardware/peripherals/mspi.rst index b9139f1ed1a8..1f01857f32cc 100644 --- a/doc/hardware/peripherals/mspi.rst +++ b/doc/hardware/peripherals/mspi.rst @@ -194,7 +194,6 @@ Related configuration options: * :kconfig:option:`CONFIG_MSPI_TIMING` * :kconfig:option:`CONFIG_MSPI_INIT_PRIORITY` * :kconfig:option:`CONFIG_MSPI_COMPLETION_TIMEOUT_TOLERANCE` -* :kconfig:option:`CONFIG_MSPI_DMA` API Reference ************* diff --git a/drivers/mspi/Kconfig b/drivers/mspi/Kconfig index a6442c1f70fe..269d8d16f04a 100644 --- a/drivers/mspi/Kconfig +++ b/drivers/mspi/Kconfig @@ -55,12 +55,6 @@ config MSPI_TIMING Enables mspi_timing_config calls in device drivers for those controllers that need this to proper function at high frequencies. -config MSPI_DMA - bool "DMA support" - help - Enables DMA capabilities, depending on the driver and hardware it - runs on. - module = MSPI module-str = mspi source "subsys/logging/Kconfig.template.log_config" diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index 71302a801fdb..485ea6c1a420 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -7,6 +7,7 @@ config MSPI_DW default y depends on DT_HAS_SNPS_DESIGNWARE_SSI_ENABLED select PINCTRL if $(dt_compat_any_has_prop,$(DT_COMPAT_SNPS_DESIGNWARE_SSI),pinctrl-0) + imply MSPI_XIP imply MSPI_TIMING if MSPI_DW diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index d4700a99261a..cefcb5e59568 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -95,7 +95,6 @@ struct mspi_dw_data { struct mspi_dw_config { DEVICE_MMIO_ROM; - void *wrapper_regs; void (*irq_config)(void); uint32_t clock_frequency; #if defined(CONFIG_PINCTRL) @@ -113,11 +112,6 @@ struct mspi_dw_config { uint8_t max_queued_dummy_bytes; uint8_t tx_fifo_threshold; uint8_t rx_fifo_threshold; -#ifdef CONFIG_MSPI_DMA - uint8_t dma_tx_data_level; - uint8_t dma_rx_data_level; -#endif - void *vendor_specific_data; DECLARE_REG_ACCESS(); bool sw_multi_periph; enum mspi_op_mode op_mode; @@ -145,11 +139,6 @@ DEFINE_MM_REG_RD_WR(dr, 0x60) DEFINE_MM_REG_WR(rx_sample_dly, 0xf0) DEFINE_MM_REG_WR(spi_ctrlr0, 0xf4) DEFINE_MM_REG_WR(txd_drive_edge, 0xf8) -#if defined(CONFIG_MSPI_DMA) -DEFINE_MM_REG_WR(dmacr, 0x4C) -DEFINE_MM_REG_WR(dmatdlr, 0x50) -DEFINE_MM_REG_WR(dmardlr, 0x54) -#endif #if defined(CONFIG_MSPI_XIP) DEFINE_MM_REG_WR(xip_incr_inst, 0x100) @@ -552,19 +541,6 @@ static void fifo_work_handler(struct k_work *work) static void mspi_dw_isr(const struct device *dev) { -#if defined(CONFIG_MSPI_DMA) - struct mspi_dw_data *dev_data = dev->data; - - if (dev_data->xfer.xfer_mode == MSPI_DMA) { - if (vendor_specific_read_dma_irq(dev)) { - set_imr(dev, 0); - handle_end_of_packet(dev_data); - } - vendor_specific_irq_clear(dev); - return; - } -#endif - #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) struct mspi_dw_data *dev_data = dev->data; int rc; @@ -1091,7 +1067,7 @@ static int start_next_packet(const struct device *dev) (false)); unsigned int key; uint32_t packet_frames; - uint32_t imr = 0; + uint32_t imr; int rc = 0; if (packet->num_bytes == 0 && @@ -1139,18 +1115,6 @@ static int start_next_packet(const struct device *dev) return -EINVAL; } -#if defined(CONFIG_MSPI_DMA) - if (dev_data->xfer.xfer_mode == MSPI_DMA) { - /* Check if the packet buffer is accessible */ - if (packet->num_bytes > 0 && - !vendor_specific_dma_accessible_check(dev, packet->data_buf)) { - LOG_ERR("Buffer not DMA accessible: ptr=0x%lx, size=%u", - (uintptr_t)packet->data_buf, packet->num_bytes); - return -EINVAL; - } - } -#endif - if (packet->dir == MSPI_TX || packet->num_bytes == 0) { imr = IMR_TXEIM_BIT; dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_TMOD_MASK, @@ -1159,12 +1123,6 @@ static int start_next_packet(const struct device *dev) dev_data->xfer.tx_dummy); write_rxftlr(dev, 0); -#if defined(CONFIG_MSPI_DMA) - } else if (dev_data->xfer.xfer_mode == MSPI_DMA) { - dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_TMOD_MASK, CTRLR0_TMOD_RX); - dev_data->spi_ctrlr0 |= FIELD_PREP(SPI_CTRLR0_WAIT_CYCLES_MASK, - dev_data->xfer.rx_dummy); -#endif } else { uint32_t tmod; uint8_t rx_fifo_threshold; @@ -1253,124 +1211,95 @@ static int start_next_packet(const struct device *dev) irq_unlock(key); } -#if defined(CONFIG_MSPI_DMA) - if (dev_data->xfer.xfer_mode == MSPI_DMA) { - /* For DMA mode, set start level based on transfer length to prevent underflow */ - uint32_t total_transfer_bytes = packet->num_bytes + dev_data->xfer.addr_length + - dev_data->xfer.cmd_length; - uint32_t transfer_frames = total_transfer_bytes >> dev_data->bytes_per_frame_exp; - - /* Use minimum of transfer length or FIFO depth, but at least 1 */ - uint8_t dma_start_level = MIN(transfer_frames - 1, - dev_config->tx_fifo_depth_minus_1); - - dma_start_level = (dma_start_level > 0 ? dma_start_level : 1); - - /* Only TXFTHR needs to be set to the minimum number of frames */ - write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, dma_start_level)); - write_dmatdlr(dev, FIELD_PREP(DMATDLR_DMATDL_MASK, dev_config->dma_tx_data_level)); - write_dmardlr(dev, FIELD_PREP(DMARDLR_DMARDL_MASK, dev_config->dma_rx_data_level)); - write_dmacr(dev, DMACR_TDMAE_BIT | DMACR_RDMAE_BIT); - write_imr(dev, 0); - write_ssienr(dev, SSIENR_SSIC_EN_BIT); + dev_data->buf_pos = packet->data_buf; + dev_data->buf_end = &packet->data_buf[packet->num_bytes]; + + /* Set the TX FIFO threshold and its transmit start level. */ + if (packet->num_bytes) { + /* If there is some data to send/receive, set the threshold to + * the value configured for the driver instance and the start + * level to the maximum possible value (it will be updated later + * in tx_fifo() or tx_dummy_bytes() when TX is to be finished). + * This helps avoid a situation when the TX FIFO becomes empty + * before the transfer is complete and the SSI core finishes the + * transaction and deactivates the CE line. This could occur + * right before the data phase in enhanced SPI modes, when the + * clock stretching feature does not work yet, or in Standard + * SPI mode, where the clock stretching is not available at all. + */ + uint8_t start_level = dev_data->dummy_bytes != 0 + ? dev_config->max_queued_dummy_bytes - 1 + : dev_config->tx_fifo_depth_minus_1; - vendor_specific_start_dma_xfer(dev); + write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, start_level) | + FIELD_PREP(TXFTLR_TFT_MASK, + dev_config->tx_fifo_threshold)); } else { -#endif - /* PIO mode */ - dev_data->buf_pos = packet->data_buf; - dev_data->buf_end = &packet->data_buf[packet->num_bytes]; - /* Set the TX FIFO threshold and its transmit start level. */ - if (packet->num_bytes) { - /* If there is some data to send/receive, set the threshold to - * the value configured for the driver instance and the start - * level to the maximum possible value (it will be updated later - * in tx_fifo() or tx_dummy_bytes() when TX is to be finished). - * This helps avoid a situation when the TX FIFO becomes empty - * before the transfer is complete and the SSI core finishes the - * transaction and deactivates the CE line. This could occur - * right before the data phase in enhanced SPI modes, when the - * clock stretching feature does not work yet, or in Standard - * SPI mode, where the clock stretching is not available at all. - */ - uint8_t start_level = dev_data->dummy_bytes != 0 - ? dev_config->max_queued_dummy_bytes - 1 - : dev_config->tx_fifo_depth_minus_1; - - write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, start_level) | - FIELD_PREP(TXFTLR_TFT_MASK, - dev_config->tx_fifo_threshold)); - - } else { - uint32_t total_tx_entries = 0; + uint32_t total_tx_entries = 0; - /* It the whole transfer is to contain only the command and/or - * address, set up the transfer to start right after entries - * for those appear in the TX FIFO, and the threshold to 0, - * so that the interrupt occurs when the TX FIFO gets emptied. - */ - if (dev_data->xfer.cmd_length) { - if (dev_data->standard_spi) { - total_tx_entries += dev_data->xfer.cmd_length; - } else { - total_tx_entries += 1; - } + /* It the whole transfer is to contain only the command and/or + * address, set up the transfer to start right after entries + * for those appear in the TX FIFO, and the threshold to 0, + * so that the interrupt occurs when the TX FIFO gets emptied. + */ + if (dev_data->xfer.cmd_length) { + if (dev_data->standard_spi) { + total_tx_entries += dev_data->xfer.cmd_length; + } else { + total_tx_entries += 1; } + } - if (dev_data->xfer.addr_length) { - if (dev_data->standard_spi) { - total_tx_entries += dev_data->xfer.addr_length; - } else { - total_tx_entries += 1; - } + if (dev_data->xfer.addr_length) { + if (dev_data->standard_spi) { + total_tx_entries += dev_data->xfer.addr_length; + } else { + total_tx_entries += 1; } - - write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, - total_tx_entries - 1)); } - /* Ensure that there will be no interrupt from the controller yet. */ - write_imr(dev, 0); - /* Enable the controller. This must be done before DR is written. */ - write_ssienr(dev, SSIENR_SSIC_EN_BIT); + write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, + total_tx_entries - 1)); + } - /* Since the FIFO depth in SSI is always at least 8, it can be safely - * assumed that the command and address fields (max. 2 and 4 bytes, - * respectively) can be written here before the TX FIFO gets filled up. - */ - if (dev_data->standard_spi) { - if (dev_data->xfer.cmd_length) { - tx_control_field(dev, packet->cmd, - dev_data->xfer.cmd_length); - } + /* Ensure that there will be no interrupt from the controller yet. */ + write_imr(dev, 0); + /* Enable the controller. This must be done before DR is written. */ + write_ssienr(dev, SSIENR_SSIC_EN_BIT); - if (dev_data->xfer.addr_length) { - tx_control_field(dev, packet->address, - dev_data->xfer.addr_length); - } - } else { - if (dev_data->xfer.cmd_length) { - write_dr(dev, packet->cmd); - } + /* Since the FIFO depth in SSI is always at least 8, it can be safely + * assumed that the command and address fields (max. 2 and 4 bytes, + * respectively) can be written here before the TX FIFO gets filled up. + */ + if (dev_data->standard_spi) { + if (dev_data->xfer.cmd_length) { + tx_control_field(dev, packet->cmd, + dev_data->xfer.cmd_length); + } - if (dev_data->xfer.addr_length) { - write_dr(dev, packet->address); - } + if (dev_data->xfer.addr_length) { + tx_control_field(dev, packet->address, + dev_data->xfer.addr_length); + } + } else { + if (dev_data->xfer.cmd_length) { + write_dr(dev, packet->cmd); } - /* Prefill TX FIFO with any data we can */ - if (dev_data->dummy_bytes && tx_dummy_bytes(dev, NULL)) { - imr = IMR_RXFIM_BIT; - } else if (packet->dir == MSPI_TX && packet->num_bytes) { - tx_data(dev, packet); + if (dev_data->xfer.addr_length) { + write_dr(dev, packet->address); } + } - /* Enable interrupts now and wait until the packet is done unless async. */ - write_imr(dev, imr); -#if defined(CONFIG_MSPI_DMA) + /* Prefill TX FIFO with any data we can */ + if (dev_data->dummy_bytes && tx_dummy_bytes(dev, NULL)) { + imr = IMR_RXFIM_BIT; + } else if (packet->dir == MSPI_TX && packet->num_bytes) { + tx_data(dev, packet); } -#endif + /* Enable interrupts now */ + write_imr(dev, imr); /* Write SER to start transfer */ write_ser(dev, BIT(dev_data->dev_id->dev_idx)); @@ -1938,16 +1867,9 @@ static DEVICE_API(mspi, drv_api) = { DT_INST_PROP_OR(inst, rx_fifo_threshold, \ 1 * RX_FIFO_DEPTH(inst) / 8 - 1) -#define MSPI_DW_DMA_DATA_LEVELS(inst) \ - .dma_tx_data_level = \ - DT_INST_PROP_OR(inst, dma_transmit_data_level, 0), \ - .dma_rx_data_level = \ - DT_INST_PROP_OR(inst, dma_receive_data_level, 0) - #define MSPI_DW_INST(inst) \ PM_DEVICE_DT_INST_DEFINE(inst, dev_pm_action_cb); \ IF_ENABLED(CONFIG_PINCTRL, (PINCTRL_DT_INST_DEFINE(inst);)) \ - VENDOR_SPECIFIC_DATA_DEFINE(inst); \ static void irq_config##inst(void) \ { \ LISTIFY(DT_INST_NUM_IRQS(inst), \ @@ -1956,7 +1878,6 @@ static DEVICE_API(mspi, drv_api) = { static struct mspi_dw_data dev##inst##_data; \ static const struct mspi_dw_config dev##inst##_config = { \ MSPI_DW_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ - .wrapper_regs = (void *)DT_INST_REG_ADDR(inst), \ .irq_config = irq_config##inst, \ .clock_frequency = MSPI_DW_CLOCK_FREQUENCY(inst), \ IF_ENABLED(CONFIG_PINCTRL, \ @@ -1964,8 +1885,6 @@ static DEVICE_API(mspi, drv_api) = { IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, ce_gpios), \ (MSPI_DW_CE_GPIOS(inst),)) \ MSPI_DW_FIFO_PROPS(inst), \ - IF_ENABLED(CONFIG_MSPI_DMA, (MSPI_DW_DMA_DATA_LEVELS(inst),)) \ - .vendor_specific_data = VENDOR_SPECIFIC_DATA_GET(inst), \ DEFINE_REG_ACCESS(inst) \ .sw_multi_periph = \ DT_INST_PROP(inst, software_multiperipheral), \ diff --git a/drivers/mspi/mspi_dw.h b/drivers/mspi/mspi_dw.h index 0d015ae3db03..894bee40d6c4 100644 --- a/drivers/mspi/mspi_dw.h +++ b/drivers/mspi/mspi_dw.h @@ -173,22 +173,6 @@ #define XIP_WRITE_CTRL_FRF_QUAD 2UL #define XIP_WRITE_CTRL_FRF_OCTAL 3UL -/* DMACR - DMA Control Register */ -#define DMACR_ATW_MASK GENMASK(4, 3) -#define DMACR_ATW_1 0UL -#define DMACR_ATW_2 1UL -#define DMACR_ATW_4 2UL -#define DMACR_ATW_8 3UL -#define DMACR_IDMAE_BIT BIT(2) -#define DMACR_TDMAE_BIT BIT(1) -#define DMACR_RDMAE_BIT BIT(0) - -/* DMATDLR - DMA Transmit Data Level */ -#define DMATDLR_DMATDL_MASK GENMASK(3, 0) - -/* DMARDLR - DMA Receive Data Level */ -#define DMARDLR_DMARDL_MASK GENMASK(3, 0) - /* Register access helpers. */ #define USES_AUX_REG(inst) + DT_INST_PROP(inst, aux_reg_enable) #define AUX_REG_INSTANCES (0 DT_INST_FOREACH_STATUS_OKAY(USES_AUX_REG)) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index 0b1fcf1ca7e0..d32a53ac2939 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -97,221 +97,7 @@ static inline int vendor_specific_xip_disable(const struct device *dev, } #endif /* defined(CONFIG_MSPI_XIP) */ -#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) -#include - -static inline void vendor_specific_init(const struct device *dev) -{ - const struct mspi_dw_config *config = dev->config; - NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; - - preg->EVENTS_CORE = 0; - preg->EVENTS_DMA.DONE = 0; - - preg->INTENSET = BIT(QSPI_INTENSET_CORE_Pos) - | BIT(QSPI_INTENSET_DMADONE_Pos); -} - -static inline void vendor_specific_suspend(const struct device *dev) -{ - const struct mspi_dw_config *config = dev->config; - NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; - - preg->ENABLE = 0; -} - -static inline void vendor_specific_resume(const struct device *dev) -{ - const struct mspi_dw_config *config = dev->config; - NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; - - preg->ENABLE = 1; - -} - -static inline void vendor_specific_irq_clear(const struct device *dev) -{ - const struct mspi_dw_config *config = dev->config; - NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; - - preg->EVENTS_CORE = 0; - preg->EVENTS_DMA.DONE = 0; -} - -/* DMA support */ - -#define EVDMA_ATTR_LEN_Pos (0UL) -#define EVDMA_ATTR_LEN_Msk (0x00FFFFFFUL) - -#define EVDMA_ATTR_ATTR_Pos (24UL) -#define EVDMA_ATTR_ATTR_Msk (0x3FUL << EVDMA_ATTR_ATTR_Pos) - -#define EVDMA_ATTR_32AXI_Pos (30UL) -#define EVDMA_ATTR_32AXI_Msk (0x1UL << EVDMA_ATTR_32AXI_Pos) - -#define EVDMA_ATTR_EVENTS_Pos (31UL) -#define EVDMA_ATTR_EVENTS_Msk (0x1UL << EVDMA_ATTR_EVENTS_Pos) - -typedef enum { - EVDMA_BYTE_SWAP = 0, - EVDMA_JOBLIST = 1, - EVDMA_BUFFER_FILL = 2, - EVDMA_FIXED_ATTR = 3, - EVDMA_STATIC_ADDR = 4, - EVDMA_PLAIN_DATA_BUF_WR = 5, -} EVDMA_ATTR_Type; - -/* Setup EVDMA attribute with the following configuratrion */ -#define EVDMA_ATTRIBUTE (BIT(EVDMA_BYTE_SWAP) | BIT(EVDMA_JOBLIST) | \ - BIT(EVDMA_BUFFER_FILL) | BIT(EVDMA_FIXED_ATTR) | \ - BIT(EVDMA_STATIC_ADDR) | BIT(EVDMA_PLAIN_DATA_BUF_WR)) - -typedef struct { - uint8_t *addr; - uint32_t attr; -} EVDMA_JOB_Type; - -#define EVDMA_JOB(BUFFER, SIZE, ATTR) \ - (EVDMA_JOB_Type) { .addr = (uint8_t *)BUFFER, .attr = (ATTR << EVDMA_ATTR_ATTR_Pos | SIZE) } -#define EVDMA_NULL_JOB() \ - (EVDMA_JOB_Type) { .addr = (uint8_t *)0, .attr = 0 } -typedef struct { - EVDMA_JOB_Type *tx_job; - EVDMA_JOB_Type *rx_job; -} QSPI_TRANSFER_LIST_Type; - -/* Number of jobs needed for transmit trasaction */ -#define MAX_NUM_JOBS 5 - -/* Vendor-specific data structure for Nordic QSPI */ -typedef struct { - QSPI_TRANSFER_LIST_Type *transfer_list; - EVDMA_JOB_Type *joblist; -} nordic_qspi_vendor_data_t; - -/* Static allocation macros for vendor-specific data */ -#define VENDOR_SPECIFIC_DATA_DEFINE(inst) \ - static QSPI_TRANSFER_LIST_Type mspi_dw_##inst##_transfer_list; \ - static EVDMA_JOB_Type mspi_dw_##inst##_joblist[MAX_NUM_JOBS]; \ - static const nordic_qspi_vendor_data_t mspi_dw_##inst##_vendor_data = { \ - .transfer_list = &mspi_dw_##inst##_transfer_list, \ - .joblist = &mspi_dw_##inst##_joblist[0] \ - }; - -#define VENDOR_SPECIFIC_DATA_GET(inst) (void *)&mspi_dw_##inst##_vendor_data - -/* Temporarily hard-coded as not in MDK yet */ -#define QSPI_TMOD_OFFSET (0x490UL) -#define QSPI_TMOD_TX_AND_RX (0x0) -#define QSPI_TMOD_TX_ONLY (0x1) -#define QSPI_TMOD_RX_ONLY (0x2) -static inline void vendor_specific_start_dma_xfer(const struct device *dev) -{ - struct mspi_dw_data *dev_data = dev->data; - const struct mspi_dw_config *config = dev->config; - const struct mspi_xfer_packet *packet = - &dev_data->xfer.packets[dev_data->packets_done]; - NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; - - /* Use vendor-specific data from config - stores job and transfer lists */ - const nordic_qspi_vendor_data_t *vendor_data = (const nordic_qspi_vendor_data_t *) - config->vendor_specific_data; - - QSPI_TRANSFER_LIST_Type *transfer_list = vendor_data->transfer_list; - EVDMA_JOB_Type *joblist = vendor_data->joblist; - - int tmod = 0; - int job_idx = 0; - - /* Set up tx job pointer to the first job */ - transfer_list->tx_job = &joblist[0]; - - /* - * The Command and Address will always have a length of 4 from the DMA's - * perspective. QSPI peripheral will use length of data specified in core registers - */ - if (dev_data->xfer.cmd_length > 0) { - joblist[job_idx++] = EVDMA_JOB(&packet->cmd, 4, EVDMA_ATTRIBUTE); - } - if (dev_data->xfer.addr_length > 0) { - joblist[job_idx++] = EVDMA_JOB(&packet->address, 4, EVDMA_ATTRIBUTE); - } - - if (packet->dir == MSPI_TX) { - preg->CONFIG.RXTRANSFERLENGTH = 0; - - if (packet->num_bytes > 0) { - joblist[job_idx++] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_ATTRIBUTE); - } - - /* Always terminate with null job */ - joblist[job_idx] = EVDMA_NULL_JOB(); - /* rx_job is always EVDMA_NULL_JOB() for transmit */ - transfer_list->rx_job = &joblist[job_idx]; - tmod = QSPI_TMOD_TX_ONLY; - } else { - preg->CONFIG.RXTRANSFERLENGTH = ((packet->num_bytes + dev_data->xfer.addr_length + - dev_data->xfer.cmd_length) >> - dev_data->bytes_per_frame_exp) - 1; - - /* If sending address or command while being configured as controller */ - if (job_idx > 0 && config->op_mode == MSPI_OP_MODE_CONTROLLER) { - tmod = QSPI_TMOD_TX_AND_RX; - - /* After command and address, setup RX job for data */ - joblist[job_idx++] = EVDMA_NULL_JOB(); - transfer_list->rx_job = &joblist[job_idx]; - joblist[job_idx++] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_ATTRIBUTE); - joblist[job_idx] = EVDMA_NULL_JOB(); - } else { - /* Sending command or address while configured as target isn't supported */ - tmod = QSPI_TMOD_RX_ONLY; - - transfer_list->rx_job = &joblist[0]; - joblist[0] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_ATTRIBUTE); - joblist[1] = EVDMA_NULL_JOB(); - transfer_list->tx_job = &joblist[1]; - } - } - - /* - * In slave mode, a tmod register in the wrapper also needs to be set. Currently - * the address not in MDK so this is a temporary fix. - */ - uintptr_t tmod_addr = (uintptr_t)preg + QSPI_TMOD_OFFSET; - - sys_write32(tmod, tmod_addr); - - preg->CONFIG.TXBURSTLENGTH = config->tx_fifo_depth_minus_1 + 1 - - config->dma_tx_data_level; - preg->CONFIG.RXBURSTLENGTH = config->dma_rx_data_level + 1; - preg->DMA.CONFIG.LISTPTR = (uint32_t)transfer_list; - - preg->TASKS_START = 1; -} - -static inline bool vendor_specific_dma_accessible_check(const struct device *dev, - const uint8_t *data_buf) -{ - const struct mspi_dw_config *config = dev->config; - NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; - - return nrf_dma_accessible_check(preg, data_buf); -} - -static inline bool vendor_specific_read_dma_irq(const struct device *dev) -{ - const struct mspi_dw_config *config = dev->config; - NRF_QSPI_Type *preg = (NRF_QSPI_Type *)config->wrapper_regs; - - return (bool) preg->EVENTS_DMA.DONE; -} - -#else /* Supply empty vendor specific macros for generic case */ - +#else static inline void vendor_specific_init(const struct device *dev) { ARG_UNUSED(dev); @@ -348,33 +134,4 @@ static inline int vendor_specific_xip_disable(const struct device *dev, return 0; } -#if defined(CONFIG_MSPI_DMA) -static inline void vendor_specific_start_dma_xfer(const struct device *dev) -{ - ARG_UNUSED(dev); -} - -static inline bool vendor_specific_dma_accessible_check(const struct device *dev, - const uint8_t *data_buf) { - ARG_UNUSED(dev); - ARG_UNUSED(data_buf); - - return true; -} -static inline bool vendor_specific_read_dma_irq(const struct device *dev) -{ - ARG_UNUSED(dev); - - return true; -} -#endif /* defined(CONFIG_MSPI_DMA) */ -#endif /* Empty vendor specific macros */ - -/* Empty macros for generic case - no vendor-specific data */ -#ifndef VENDOR_SPECIFIC_DATA_DEFINE -#define VENDOR_SPECIFIC_DATA_DEFINE(inst) -#endif - -#ifndef VENDOR_SPECIFIC_DATA_GET -#define VENDOR_SPECIFIC_DATA_GET(inst) (void *)NULL -#endif +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) */ diff --git a/dts/bindings/mspi/snps,designware-ssi.yaml b/dts/bindings/mspi/snps,designware-ssi.yaml index 7677325493b2..69a2947f9efb 100644 --- a/dts/bindings/mspi/snps,designware-ssi.yaml +++ b/dts/bindings/mspi/snps,designware-ssi.yaml @@ -47,20 +47,3 @@ properties: description: | Number of entries in the RX FIFO above which the controller gets an RX interrupt. Maximum value is the RX FIFO depth - 1. - - dma-transmit-data-level: - type: int - description: | - When in DMA mode, the transmit data level field controls the level at which a DMA request - is made by the transmit logic. A request to transmit is generated when the number of - valid data entries in the transmit FIFO is equal to or below this field value. Lower values - mean less frequent DMA triggers with larger bursts. Higher values mean fewer, smaller bursts - (lower latency, higher overhead). Range: 0-15 - - dma-receive-data-level: - type: int - description: | - When in DMA mode, the receive data level field controls the level at which a DMA request - is made by the receive logic. A request to receive is generated when the number of - valid data entries in the receive FIFO is greater than this value. Lower values mean - more frequent DMA triggers and higher values mean larger less frequent bursts. Range: 0-15 From 43af9c21d1475568b93cd52f048cddedc15f1add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1285/3334] Revert "[nrf fromtree] drivers: mspi_dw: Add support for slave mode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 53e5501b345d31534d2ef00eaa63b3de2b54efe2. Signed-off-by: Tomasz Moń --- drivers/mspi/mspi_dw.c | 8 ++------ drivers/mspi/mspi_dw.h | 1 - dts/bindings/mspi/nordic,nrf-exmif.yaml | 4 ---- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index cefcb5e59568..e8c9a817095d 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -114,7 +114,6 @@ struct mspi_dw_config { uint8_t rx_fifo_threshold; DECLARE_REG_ACCESS(); bool sw_multi_periph; - enum mspi_op_mode op_mode; }; /* Register access helpers. */ @@ -1749,7 +1748,6 @@ static int dev_pm_action_cb(const struct device *dev, static int dev_init(const struct device *dev) { - struct mspi_dw_data *dev_data = dev->data; const struct mspi_dw_config *dev_config = dev->config; const struct gpio_dt_spec *ce_gpio; int rc; @@ -1758,12 +1756,11 @@ static int dev_init(const struct device *dev) vendor_specific_init(dev); - dev_data->ctrlr0 |= FIELD_PREP(CTRLR0_SSI_IS_MST_BIT, - dev_config->op_mode == MSPI_OP_MODE_CONTROLLER); - dev_config->irq_config(); #if defined(CONFIG_MULTITHREADING) + struct mspi_dw_data *dev_data = dev->data; + dev_data->dev = dev; k_sem_init(&dev_data->finished, 0, 1); k_sem_init(&dev_data->cfg_lock, 1, 1); @@ -1888,7 +1885,6 @@ static DEVICE_API(mspi, drv_api) = { DEFINE_REG_ACCESS(inst) \ .sw_multi_periph = \ DT_INST_PROP(inst, software_multiperipheral), \ - .op_mode = DT_INST_STRING_TOKEN(inst, op_mode), \ }; \ DEVICE_DT_INST_DEFINE(inst, \ dev_init, PM_DEVICE_DT_INST_GET(inst), \ diff --git a/drivers/mspi/mspi_dw.h b/drivers/mspi/mspi_dw.h index 894bee40d6c4..28e4bed016e7 100644 --- a/drivers/mspi/mspi_dw.h +++ b/drivers/mspi/mspi_dw.h @@ -19,7 +19,6 @@ */ /* CTRLR0 - Control Register 0 */ -#define CTRLR0_SSI_IS_MST_BIT BIT(31) #define CTRLR0_SPI_FRF_MASK COND_CODE_1(SSI_VERSION_2, GENMASK(22, 21), GENMASK(23, 22)) #define CTRLR0_SPI_FRF_STANDARD 0UL #define CTRLR0_SPI_FRF_DUAL 1UL diff --git a/dts/bindings/mspi/nordic,nrf-exmif.yaml b/dts/bindings/mspi/nordic,nrf-exmif.yaml index 4e46e5d6b142..294254aa60ef 100644 --- a/dts/bindings/mspi/nordic,nrf-exmif.yaml +++ b/dts/bindings/mspi/nordic,nrf-exmif.yaml @@ -6,7 +6,3 @@ description: Nordic External Memory Interface (EXMIF) compatible: "nordic,nrf-exmif" include: snps,designware-ssi.yaml - -properties: - op-mode: - default: "MSPI_OP_MODE_CONTROLLER" From 7dc884a9a6035ef0148be5f30ddfb934c7f44485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1286/3334] Revert "[nrf fromtree] drivers: mspi_dw: Add support for asynchronous transfers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f7a4516f23fddbd24ebdac9cb95230818f3d3332. Signed-off-by: Tomasz Moń --- drivers/mspi/Kconfig.dw | 1 - drivers/mspi/mspi_dw.c | 238 ++++------------------------------------ 2 files changed, 20 insertions(+), 219 deletions(-) diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index 485ea6c1a420..cff148c138c6 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -14,7 +14,6 @@ if MSPI_DW config MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE bool "Handle FIFO in system workqueue" - depends on MULTITHREADING help When the driver does not use DMA for transferring data to/from the SSI FIFOs, handling of those may take a significant amount of time. diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index e8c9a817095d..518b5605785f 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -66,29 +66,20 @@ struct mspi_dw_data { bool suspended; #if defined(CONFIG_MULTITHREADING) - const struct device *dev; - struct k_sem finished; /* For synchronization of API calls made from different contexts. */ struct k_sem ctx_lock; /* For locking of controller configuration. */ struct k_sem cfg_lock; - - struct k_timer async_timer; - struct k_work async_timeout_work; - struct k_work async_packet_work; - - mspi_callback_handler_t cbs[MSPI_BUS_EVENT_MAX]; - struct mspi_callback_context *cb_ctxs[MSPI_BUS_EVENT_MAX]; #else volatile bool finished; bool cfg_lock; #endif - struct mspi_xfer xfer; #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) struct k_work fifo_work; + const struct device *dev; uint32_t imr; #endif }; @@ -150,100 +141,6 @@ DEFINE_MM_REG_WR(xip_write_ctrl, 0x148) #include "mspi_dw_vendor_specific.h" -static int start_next_packet(const struct device *dev); -static int finalize_packet(const struct device *dev, int rc); -static int finalize_transceive(const struct device *dev, int rc); - -#if defined(CONFIG_MULTITHREADING) -/* Common function to setup callback context and call user callback */ -static void call_user_callback_with_context(const struct device *dev, - enum mspi_bus_event evt_type, - uint32_t packet_idx, - int status) -{ - struct mspi_dw_data *dev_data = dev->data; - const struct mspi_xfer_packet *packet = - &dev_data->xfer.packets[packet_idx]; - struct mspi_callback_context *cb_ctx = dev_data->cb_ctxs[evt_type]; - - if (!(packet->cb_mask & BIT(evt_type)) || - !dev_data->cbs[evt_type]) { - return; - } - - LOG_DBG("Calling user function with evt_type: %u", evt_type); - - cb_ctx->mspi_evt.evt_type = evt_type; - cb_ctx->mspi_evt.evt_data.controller = dev; - cb_ctx->mspi_evt.evt_data.dev_id = dev_data->dev_id; - cb_ctx->mspi_evt.evt_data.packet = packet; - cb_ctx->mspi_evt.evt_data.packet_idx = packet_idx; - cb_ctx->mspi_evt.evt_data.status = status; - - dev_data->cbs[evt_type](cb_ctx); -} - -static void async_timeout_timer_handler(struct k_timer *timer) -{ - struct mspi_dw_data *dev_data = - CONTAINER_OF(timer, struct mspi_dw_data, async_timer); - - /* Submit work to handle timeout in proper context */ - k_work_submit(&dev_data->async_timeout_work); -} - -static void async_timeout_work_handler(struct k_work *work) -{ - struct mspi_dw_data *dev_data = - CONTAINER_OF(work, struct mspi_dw_data, async_timeout_work); - const struct device *dev = dev_data->dev; - int rc; - - LOG_ERR("Async transfer timed out"); - - rc = finalize_packet(dev, -ETIMEDOUT); - rc = finalize_transceive(dev, rc); - - /* Call user callback with timeout error (outside of any locks) */ - call_user_callback_with_context(dev, MSPI_BUS_TIMEOUT, - dev_data->packets_done, rc); -} - -static void async_packet_work_handler(struct k_work *work) -{ - struct mspi_dw_data *dev_data = - CONTAINER_OF(work, struct mspi_dw_data, async_packet_work); - const struct device *dev = dev_data->dev; - uint32_t packet_idx = dev_data->packets_done; - int rc; - - LOG_DBG("Processing async work in thread context"); - - rc = finalize_packet(dev, 0); - if (rc >= 0) { - ++dev_data->packets_done; - if (dev_data->packets_done < dev_data->xfer.num_packet) { - LOG_DBG("Starting next packet (%d/%d)", - dev_data->packets_done + 1, - dev_data->xfer.num_packet); - - rc = start_next_packet(dev); - if (rc >= 0) { - return; - } - - ++packet_idx; - } - } - - rc = finalize_transceive(dev, rc); - call_user_callback_with_context(dev, - rc < 0 ? MSPI_BUS_ERROR - : MSPI_BUS_XFER_COMPLETE, - packet_idx, rc); -} -#endif /* defined(CONFIG_MULTITHREADING) */ - static void tx_data(const struct device *dev, const struct mspi_xfer_packet *packet) { @@ -419,22 +316,6 @@ static inline void set_imr(const struct device *dev, uint32_t imr) #endif } -static void handle_end_of_packet(struct mspi_dw_data *dev_data) - -{ -#if defined(CONFIG_MULTITHREADING) - if (dev_data->xfer.async) { - k_timer_stop(&dev_data->async_timer); - - k_work_submit(&dev_data->async_packet_work); - } else { - k_sem_give(&dev_data->finished); - } -#else - dev_data->finished = true; -#endif -} - static void handle_fifos(const struct device *dev) { struct mspi_dw_data *dev_data = dev->data; @@ -520,8 +401,11 @@ static void handle_fifos(const struct device *dev) if (finished) { set_imr(dev, 0); - handle_end_of_packet(dev_data); - +#if defined(CONFIG_MULTITHREADING) + k_sem_give(&dev_data->finished); +#else + dev_data->finished = true; +#endif } } @@ -990,10 +874,6 @@ static int api_dev_config(const struct device *dev, } dev_data->dev_id = dev_id; - -#if defined(CONFIG_MULTITHREADING) - memset(dev_data->cbs, 0, sizeof(dev_data->cbs)); -#endif } if (param_mask == MSPI_DEVICE_CONFIG_NONE && @@ -1055,7 +935,7 @@ static void tx_control_field(const struct device *dev, } while (shift); } -static int start_next_packet(const struct device *dev) +static int start_next_packet(const struct device *dev, k_timeout_t timeout) { const struct mspi_dw_config *dev_config = dev->config; struct mspi_dw_data *dev_data = dev->data; @@ -1297,26 +1177,13 @@ static int start_next_packet(const struct device *dev) tx_data(dev, packet); } - /* Enable interrupts now */ + /* Enable interrupts now and wait until the packet is done. */ write_imr(dev, imr); /* Write SER to start transfer */ write_ser(dev, BIT(dev_data->dev_id->dev_idx)); #if defined(CONFIG_MULTITHREADING) - k_timeout_t timeout = K_MSEC(dev_data->xfer.timeout); - - /* For async transfer, start the timeout timer and exit. */ - if (dev_data->xfer.async) { - k_timer_start(&dev_data->async_timer, timeout, K_NO_WAIT); - - return 0; - } - - /* For sync transfer, wait until the packet is finished. */ rc = k_sem_take(&dev_data->finished, timeout); - if (rc < 0) { - rc = -ETIMEDOUT; - } #else if (!WAIT_FOR(dev_data->finished, dev_data->xfer.timeout * USEC_PER_MSEC, @@ -1326,22 +1193,12 @@ static int start_next_packet(const struct device *dev) dev_data->finished = false; #endif - - return finalize_packet(dev, rc); -} - -static int finalize_packet(const struct device *dev, int rc) -{ - struct mspi_dw_data *dev_data = dev->data; - bool xip_enabled = COND_CODE_1(CONFIG_MSPI_XIP, - (dev_data->xip_enabled != 0), - (false)); - if (read_risr(dev) & RISR_RXOIR_BIT) { LOG_ERR("RX FIFO overflow occurred"); rc = -EIO; - } else if (rc == -ETIMEDOUT) { + } else if (rc < 0) { LOG_ERR("Transfer timed out"); + rc = -ETIMEDOUT; } /* Disable the controller. This will immediately halt the transfer @@ -1350,10 +1207,10 @@ static int finalize_packet(const struct device *dev, int rc) if (xip_enabled) { /* If XIP is enabled, the controller must be kept enabled, * so disable it only momentarily if there's a need to halt - * a transfer that ended up with an error. + * a transfer that has timeout out. */ - if (rc < 0) { - unsigned int key = irq_lock(); + if (rc == -ETIMEDOUT) { + key = irq_lock(); write_ssienr(dev, 0); write_ssienr(dev, SSIENR_SSIC_EN_BIT); @@ -1363,14 +1220,13 @@ static int finalize_packet(const struct device *dev, int rc) } else { write_ssienr(dev, 0); } - /* Clear SER */ write_ser(dev, 0); if (dev_data->dev_id->ce.port) { int rc2; - /* Do not use `rc` to not overwrite potential packet error. */ + /* Do not use `rc` to not overwrite potential timeout error. */ rc2 = gpio_pin_set_dt(&dev_data->dev_id->ce, 0); if (rc2 < 0) { LOG_ERR("Failed to deactivate CE line (%d)", rc2); @@ -1413,18 +1269,10 @@ static int _api_transceive(const struct device *dev, dev_data->xfer = *req; - /* For async, only the first packet is started here, next ones, if any, - * are started by ISR. - */ - if (req->async) { - dev_data->packets_done = 0; - return start_next_packet(dev); - } - for (dev_data->packets_done = 0; dev_data->packets_done < dev_data->xfer.num_packet; dev_data->packets_done++) { - rc = start_next_packet(dev); + rc = start_next_packet(dev, K_MSEC(dev_data->xfer.timeout)); if (rc < 0) { return rc; } @@ -1438,15 +1286,16 @@ static int api_transceive(const struct device *dev, const struct mspi_xfer *req) { struct mspi_dw_data *dev_data = dev->data; - int rc; + int rc, rc2; if (dev_id != dev_data->dev_id) { LOG_ERR("Controller is not configured for this device"); return -EINVAL; } - if (req->async && !IS_ENABLED(CONFIG_MULTITHREADING)) { - LOG_ERR("Asynchronous transfers require multithreading"); + /* TODO: add support for asynchronous transfers */ + if (req->async) { + LOG_ERR("Asynchronous transfers are not supported"); return -ENOTSUP; } @@ -1466,20 +1315,7 @@ static int api_transceive(const struct device *dev, rc = _api_transceive(dev, req); } - if (req->async && rc >= 0) { - return rc; - } - - return finalize_transceive(dev, rc); -} - -static int finalize_transceive(const struct device *dev, int rc) -{ - int rc2; - #if defined(CONFIG_MULTITHREADING) - struct mspi_dw_data *dev_data = dev->data; - k_sem_give(&dev_data->ctx_lock); #endif @@ -1492,33 +1328,6 @@ static int finalize_transceive(const struct device *dev, int rc) return rc; } -#if defined(CONFIG_MULTITHREADING) -static int api_register_callback(const struct device *dev, - const struct mspi_dev_id *dev_id, - const enum mspi_bus_event evt_type, - mspi_callback_handler_t cb, - struct mspi_callback_context *ctx) -{ - struct mspi_dw_data *dev_data = dev->data; - - if (dev_id != dev_data->dev_id) { - LOG_ERR("Controller is not configured for this device"); - return -EINVAL; - } - - if (evt_type != MSPI_BUS_ERROR && - evt_type != MSPI_BUS_XFER_COMPLETE && - evt_type != MSPI_BUS_TIMEOUT) { - LOG_ERR("Callback type %d not supported", evt_type); - return -ENOTSUP; - } - - dev_data->cbs[evt_type] = cb; - dev_data->cb_ctxs[evt_type] = ctx; - return 0; -} -#endif /* defined(CONFIG_MULTITHREADING) */ - #if defined(CONFIG_MSPI_TIMING) static int api_timing_config(const struct device *dev, const struct mspi_dev_id *dev_id, @@ -1761,17 +1570,13 @@ static int dev_init(const struct device *dev) #if defined(CONFIG_MULTITHREADING) struct mspi_dw_data *dev_data = dev->data; - dev_data->dev = dev; k_sem_init(&dev_data->finished, 0, 1); k_sem_init(&dev_data->cfg_lock, 1, 1); k_sem_init(&dev_data->ctx_lock, 1, 1); - - k_timer_init(&dev_data->async_timer, async_timeout_timer_handler, NULL); - k_work_init(&dev_data->async_timeout_work, async_timeout_work_handler); - k_work_init(&dev_data->async_packet_work, async_packet_work_handler); #endif #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) + dev_data->dev = dev; k_work_init(&dev_data->fifo_work, fifo_work_handler); #endif @@ -1811,9 +1616,6 @@ static DEVICE_API(mspi, drv_api) = { .dev_config = api_dev_config, .get_channel_status = api_get_channel_status, .transceive = api_transceive, -#if defined(CONFIG_MULTITHREADING) - .register_callback = api_register_callback, -#endif #if defined(CONFIG_MSPI_TIMING) .timing_config = api_timing_config, #endif From fded4b7bc007dbe68ac5fe8c6e9fb8a558f44bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1287/3334] Revert "[nrf fromtree] dts: mspi: Align op-mode binding with mspi.h enum" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5312fd6b6f06020c5b1e73ae845c5d67cb4f2a7b. Signed-off-by: Tomasz Moń --- dts/bindings/mspi/mspi-controller.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dts/bindings/mspi/mspi-controller.yaml b/dts/bindings/mspi/mspi-controller.yaml index dd7c99e34ece..6f22d0dc0bf2 100644 --- a/dts/bindings/mspi/mspi-controller.yaml +++ b/dts/bindings/mspi/mspi-controller.yaml @@ -22,8 +22,8 @@ properties: op-mode: type: string enum: - - "MSPI_OP_MODE_CONTROLLER" - - "MSPI_OP_MODE_PERIPHERAL" + - "MSPI_CONTROLLER" + - "MSPI_PERIPHERAL" description: | Indicate MSPI controller or peripheral mode of the controller. The controller driver may use this during initialization. From c5f9aa27ab97bbf0e95f473a74cc188defbe44e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1288/3334] Revert "[nrf fromtree] drivers: mspi: Add timeout callback to MSPI API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fb161c891a348d2c442c9c12fab041cdbf9ec9d8. Signed-off-by: Tomasz Moń --- doc/hardware/peripherals/mspi.rst | 10 ++++------ include/zephyr/drivers/mspi.h | 3 --- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/doc/hardware/peripherals/mspi.rst b/doc/hardware/peripherals/mspi.rst index 1f01857f32cc..176c9bf5ede3 100644 --- a/doc/hardware/peripherals/mspi.rst +++ b/doc/hardware/peripherals/mspi.rst @@ -100,12 +100,10 @@ whether to support scatter IO and callback management. The controller can determ which user callback to trigger based on :c:enum:`mspi_bus_event_cb_mask` upon completion of each async/sync transfer if the callback had been registered using :c:func:`mspi_register_callback`. Or not to trigger any callback at all with -:c:enum:`MSPI_BUS_NO_CB` even if the callbacks are already registered. If the implemented -driver support it, the API supports :c:enum:`MSPI_BUS_XFER_COMPLETE_CB` to signal when a -transfer finishes and :c:enum:`MSPI_BUS_TIMEOUT_CB` to signal when a transfer or request -has timed-out. In which case that a controller supports hardware command queue, user could -take full advantage of the hardware performance if scatter IO and callback management are -supported by the driver implementation. +:c:enum:`MSPI_BUS_NO_CB` even if the callbacks are already registered. +In which case that a controller supports hardware command queue, user could take full +advantage of the hardware performance if scatter IO and callback management are supported +by the driver implementation. Device Tree =========== diff --git a/include/zephyr/drivers/mspi.h b/include/zephyr/drivers/mspi.h index b30627efad78..c486f48a8ddf 100644 --- a/include/zephyr/drivers/mspi.h +++ b/include/zephyr/drivers/mspi.h @@ -126,8 +126,6 @@ enum mspi_bus_event { MSPI_BUS_RESET = 0, MSPI_BUS_ERROR = 1, MSPI_BUS_XFER_COMPLETE = 2, - /** @brief When a request or xfer has timed out */ - MSPI_BUS_TIMEOUT = 3, MSPI_BUS_EVENT_MAX, }; @@ -141,7 +139,6 @@ enum mspi_bus_event_cb_mask { MSPI_BUS_RESET_CB = BIT(0), MSPI_BUS_ERROR_CB = BIT(1), MSPI_BUS_XFER_COMPLETE_CB = BIT(2), - MSPI_BUS_TIMEOUT_CB = BIT(3), }; /** From c3c6ef582c31896b1ca5965b0e075670986931cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1289/3334] Revert "[nrf fromtree] drivers: pinctrl: nrf: add support for MSPI" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a8e2937fa7bd5b4fe8ea8b80fea3cb75c7c879d0. Signed-off-by: Tomasz Moń --- drivers/pinctrl/pinctrl_nrf.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index a9902d33f801..f960ce4d97a3 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -486,19 +486,6 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_DISCONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) - /* No PSEL for QSPI_V2, pins only controlled by CTRLSEL */ - case NRF_FUN_QSPI_SCK: - case NRF_FUN_QSPI_CSN: - case NRF_FUN_QSPI_IO0: - case NRF_FUN_QSPI_IO1: - case NRF_FUN_QSPI_IO2: - case NRF_FUN_QSPI_IO3: - nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_QSPI); - dir = NRF_GPIO_PIN_DIR_OUTPUT; - input = NRF_GPIO_PIN_INPUT_CONNECT; - break; -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) */ #if defined(NRF_PSEL_TWIS) case NRF_FUN_TWIS_SCL: NRF_PSEL_TWIS(reg, SCL) = psel; From ff7a9cb4728b5b4059e193ceb838a189249d8663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1290/3334] Revert "[nrf fromtree] dts: nordic: Add nrf-qspi-v2 binding" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 20a2e381a1144ed37377eb4dda9bcc1a072a314b. Signed-off-by: Tomasz Moń --- dts/bindings/mspi/nordic,nrf-qspi-v2.yaml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 dts/bindings/mspi/nordic,nrf-qspi-v2.yaml diff --git a/dts/bindings/mspi/nordic,nrf-qspi-v2.yaml b/dts/bindings/mspi/nordic,nrf-qspi-v2.yaml deleted file mode 100644 index 5ad8a6fd2452..000000000000 --- a/dts/bindings/mspi/nordic,nrf-qspi-v2.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic QSPI v2 Interface using SSI IP - -compatible: "nordic,nrf-qspi-v2" - -include: snps,designware-ssi.yaml From 10065d196d9f43e7f72266612ac82345e686dcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:52 +0100 Subject: [PATCH 1291/3334] Revert "[nrf fromtree] mgmt: Handle slot version equality" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 58e60e8ae5142c8d4e66ff247542418906e1debb. Signed-off-by: Tomasz Moń --- .../mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 40 +++---------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index 0ebb722c2a90..dbb496fb3b33 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -127,30 +127,21 @@ img_mgmt_state_flags(int query_slot) int image = query_slot / 2; /* We support max 2 images for now */ int active_slot = img_mgmt_active_slot(image); - /* In case when MCUboot is configured for FW loader/updater mode, slots - * can be either active or non-active. There is no concept of pending - * or confirmed slots. - * - * In case when MCUboot is configured for DirectXIP slot may only be - * active or pending. - * Slot is marked as pending when: - * - version in that slot is higher than version of active slot. - * - versions are equal but slot number is lower than the active slot. + /* In case when MCUboot is configured for DirectXIP slot may only be + * active or pending. Slot is marked pending only when version in that slot + * is higher than version of active slot. */ if (image == img_mgmt_active_image() && query_slot == active_slot) { flags = IMG_MGMT_STATE_F_ACTIVE; -#ifdef CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP } else { struct image_version sver; struct image_version aver; int rcs = img_mgmt_read_info(query_slot, &sver, NULL, NULL); int rca = img_mgmt_read_info(active_slot, &aver, NULL, NULL); - if (rcs == 0 && rca == 0 && ((img_mgmt_vercmp(&aver, &sver) < 0) || - ((img_mgmt_vercmp(&aver, &sver) == 0) && (active_slot > query_slot)))) { + if (rcs == 0 && rca == 0 && img_mgmt_vercmp(&aver, &sver) < 0) { flags = IMG_MGMT_STATE_F_PENDING | IMG_MGMT_STATE_F_PERMANENT; } -#endif /* CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP */ } return flags; @@ -294,37 +285,18 @@ int img_mgmt_get_next_boot_slot(int image, enum img_mgmt_next_boot_type *type) if (active_slot_state == DIRECT_XIP_BOOT_ONCE) { lt = NEXT_BOOT_TYPE_TEST; } - } else if ((img_mgmt_vercmp(&aver, &over) < 0) || - ((img_mgmt_vercmp(&aver, &over) == 0) && (active_slot > other_slot))) { - /* Check if MCUboot will select the non-active slot during the next boot. - * The logic is as follows: - * - If both slots are valid, a slot with higher version is preferred. - * - If both slots are valid and the versions are equal, a slot with lower number - * is preferred. - */ + } else if (img_mgmt_vercmp(&aver, &over) < 0) { if (other_slot_state == DIRECT_XIP_BOOT_FOREVER) { return_slot = other_slot; } else if (other_slot_state == DIRECT_XIP_BOOT_ONCE) { lt = NEXT_BOOT_TYPE_TEST; return_slot = other_slot; } - } else { - /* There is neither a preference nor a necessity to boot the other slot. - * The active slot will be used again. - */ } out: #else - if (rcs == 0 && rca == 0 && - ((img_mgmt_vercmp(&aver, &over) < 0) || - ((img_mgmt_vercmp(&aver, &over) == 0) && (active_slot > other_slot)))) { - /* Check if MCUboot will select the non-active slot during the next boot. - * The logic is as follows: - * - If both slots are valid, a slot with higher version is preferred. - * - If both slots are valid and the versions are equal, a slot with lower number - * is preferred. - */ + if (rcs == 0 && rca == 0 && img_mgmt_vercmp(&aver, &over) < 0) { return_slot = other_slot; } #endif /* defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) */ From f3bf998b08f3147a55a01a283b6b44a5b097768c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1292/3334] Revert "[nrf fromtree] tests: drivers: flash: Add test with buffer size over the bus packet limit" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3fc4245a064690741ba29d036818c5080568be57. Signed-off-by: Tomasz Moń --- .../common/boards/mx25uw63_low_freq.overlay | 1 - .../common/boards/mx25uw63_single_io.overlay | 1 - .../mx25uw63_single_io_4B_addr_sreset.overlay | 2 +- tests/drivers/flash/common/src/main.c | 38 ------------------- 4 files changed, 1 insertion(+), 41 deletions(-) diff --git a/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay index 8dacdb15ff55..950005eaf5c2 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay @@ -7,5 +7,4 @@ &mx25uw63 { status = "okay"; mspi-max-frequency = ; - transfer-timeout = <500>; }; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay index ac06662e9526..062020aea353 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io.overlay @@ -58,5 +58,4 @@ status = "okay"; mspi-max-frequency = ; mspi-io-mode = "MSPI_IO_MODE_SINGLE"; - transfer-timeout = <500>; }; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay index 09af484cc212..587d68546561 100644 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay +++ b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay @@ -40,6 +40,7 @@ ; }; }; + }; &gpio6 { @@ -60,5 +61,4 @@ mspi-io-mode = "MSPI_IO_MODE_SINGLE"; use-4byte-addressing; initial-soft-reset; - transfer-timeout = <500>; }; diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index df484f825e89..b629c39ebc51 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -65,11 +65,6 @@ #error There is no flash device enabled or it is missing Kconfig options #endif -#if DT_NODE_HAS_PROP(DT_BUS(TEST_AREA_DEV_NODE), packet_data_limit) -#define CONTROLLER_PACKET_DATA_LIMIT DT_PROP(DT_BUS(TEST_AREA_DEV_NODE), packet_data_limit) -#define BUFFER_SIZE_OVER_PACKET_LIMIT CONTROLLER_PACKET_DATA_LIMIT + 1 -#endif - static const struct device *const flash_dev = TEST_AREA_DEVICE; static struct flash_pages_info page_info; static uint8_t __aligned(4) expected[EXPECTED_SIZE]; @@ -333,39 +328,6 @@ ZTEST(flash_driver, test_flash_erase) zassert_not_equal(expected[0], erase_value, "These values shall be different"); } -ZTEST(flash_driver, test_flash_write_read_over_the_packet_limit) -{ - -#if !defined(CONTROLLER_PACKET_DATA_LIMIT) - TC_PRINT("Given bus controller does not have 'packet_data_limit' property\n"); - ztest_test_skip(); -#else - int rc; - const uint8_t pattern = 0xA1; - static uint8_t large_data_buf[BUFFER_SIZE_OVER_PACKET_LIMIT]; - - /* Flatten area corresponding to the size of two packets */ - rc = flash_flatten(flash_dev, page_info.start_offset, 2 * CONTROLLER_PACKET_DATA_LIMIT); - zassert_equal(rc, 0, "Flash flatten failed: %d", rc); - - /* Fill flash area with buffer size over the configured packet limit */ - rc = flash_fill(flash_dev, pattern, page_info.start_offset, BUFFER_SIZE_OVER_PACKET_LIMIT); - zassert_equal(rc, 0, "Flash fill failed"); - - /* Read flash area with buffer size over the MSPI packet limit */ - rc = flash_read(flash_dev, page_info.start_offset, large_data_buf, - BUFFER_SIZE_OVER_PACKET_LIMIT); - zassert_equal(rc, 0, "Flash read failed"); - - /* Compare read data to the pre-defined pattern */ - for (int i = 0; i < BUFFER_SIZE_OVER_PACKET_LIMIT; i++) { - zassert_equal(large_data_buf[i], pattern, - "large_data_buf[%u]=%x read, does not match written pattern %x", i, - large_data_buf[i], pattern); - } -#endif -} - ZTEST(flash_driver, test_supply_gpios_control) { if (!DT_NODE_HAS_PROP(TEST_AREA_DEV_NODE, supply_gpios)) { From 26ad8b0da9412fde990f57fe4666e69d7736655b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1293/3334] Revert "[nrf fromtree] ipc: icmsg: Increase default stack size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 99a8a860f5df1f9c5f28102c3042b3ffe7027cad. Signed-off-by: Tomasz Moń --- subsys/ipc/ipc_service/lib/Kconfig.icmsg | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/ipc/ipc_service/lib/Kconfig.icmsg b/subsys/ipc/ipc_service/lib/Kconfig.icmsg index fa84c399ffb5..6bbc79d4fa2a 100644 --- a/subsys/ipc/ipc_service/lib/Kconfig.icmsg +++ b/subsys/ipc/ipc_service/lib/Kconfig.icmsg @@ -43,7 +43,6 @@ if IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE config IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE int "Size of RX work queue stack" - default 5400 if NRF71_ON_IPC default 1280 help Size of stack used by work queue RX thread. This work queue is From a090d62371525f1e7a087071b9929dd50f689817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1294/3334] Revert "[nrf fromtree] manifest: nrf_wifi: Pull fix for max VIF check" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4a43336e5508d3f55eb3425421ea453b9534118d. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index b84f3e46eb9e..4df2b937a46d 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: acb24fe26f479df9dba3c4bd97ea653ad3086ee7 + revision: 5fffeab6496932abb10f9dae53ed3686967aa050 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From e7e53572b43480667d67187eda8dec916b5a798c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1295/3334] Revert "[nrf fromtree] drivers: nrf_wifi: Rejig band config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 75a6012fdba8966f7cc588cf3eb13c312638bf26. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 31 ++++++++++--------- .../nrf_wifi/off_raw_tx/src/off_raw_tx_api.c | 22 +------------ drivers/wifi/nrf_wifi/src/fmac_main.c | 22 +------------ 3 files changed, 18 insertions(+), 57 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 2021d25580ae..df4414a316e0 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -665,27 +665,28 @@ config WIFI_NRF70_SCAN_TIMEOUT_S int "Scan timeout in seconds" default 30 -choice NRF_WIFI_OP_BAND - prompt "nRF Wi-Fi operation bands" - default NRF_WIFI_2G_BAND if NRF70_2_4G_ONLY - default NRF_WIFI_ALL_BAND - -config NRF_WIFI_ALL_BAND - bool "Set operation band to all supported bands" +menu "nRF Wi-Fi operation band(s)" + visible if !NRF70_2_4G_ONLY config NRF_WIFI_2G_BAND bool "Set operation band to 2.4GHz" + default y if NRF70_2_4G_ONLY config NRF_WIFI_5G_BAND bool "Set operation band to 5GHz" -if NRF71_ON_IPC -config NRF_WIFI_6G_BAND - bool "Set operation band to 6GHz" - -config NRF_WIFI_DUAL_BAND - bool "Set operation band to 2.4GHz and 5GHz" -endif # NRF71_ON_IPC -endchoice + depends on !NRF70_2_4G_ONLY + +config NRF_WIFI_OP_BAND + int "Options to set operation band" + default 1 if NRF_WIFI_2G_BAND + default 2 if NRF_WIFI_5G_BAND + default 3 + help + Set this option to select frequency band + 1 - 2.4GHz + 2 - 5GHz + 3 - All ( 2.4GHz and 5GHz ) +endmenu config NRF_WIFI_IFACE_MTU int "MTU for Wi-Fi interface" diff --git a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c index 1e53f70c111f..17825511787b 100644 --- a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c +++ b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c @@ -128,25 +128,6 @@ static int bytes_from_str(uint8_t *buf, int buf_len, const char *src) } #endif /* CONFIG_WIFI_FIXED_MAC_ADDRESS_ENABLED */ -static enum op_band get_nrf_wifi_op_band(void) -{ - if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { - return BAND_24G; - } -#ifdef CONFIG_NRF71_ON_IPC - if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { - return BAND_5G; - } - if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { - return BAND_6G; - } - if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { - return BAND_DUAL; - } -#endif /* CONFIG_NRF71_ON_IPC */ - return BAND_ALL; -} - int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; @@ -157,7 +138,6 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) struct nrf_wifi_board_params board_params; unsigned int fw_ver = 0; k_spinlock_key_t key; - enum op_band op_band = get_nrf_wifi_op_band(); /* The OSAL layer needs to be initialized before any other initialization * so that other layers (like FW IF,HW IF etc) have access to OS ops @@ -222,7 +202,7 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) HW_SLEEP_ENABLE, #endif /* CONFIG_NRF_WIFI_LOW_POWER */ NRF_WIFI_DEF_PHY_CALIB, - op_band, + CONFIG_NRF_WIFI_OP_BAND, IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING), &ctrl_params, &ceil_params, diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 47ca53d5a61c..764cab93193e 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -587,32 +587,12 @@ void configure_board_dep_params(struct nrf_wifi_board_params *board_params) } #endif /* CONFIG_NRF71_ON_IPC */ -static enum op_band get_nrf_wifi_op_band(void) -{ - if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { - return BAND_24G; - } -#ifdef CONFIG_NRF71_ON_IPC - if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { - return BAND_5G; - } - - if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { - return BAND_6G; - } - if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { - return BAND_DUAL; - } -#endif /* CONFIG_NRF71_ON_IPC */ - return BAND_ALL; -} - enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; void *rpu_ctx = NULL; - enum op_band op_band = get_nrf_wifi_op_band(); + enum op_band op_band = CONFIG_NRF_WIFI_OP_BAND; #ifdef CONFIG_NRF_WIFI_LOW_POWER int sleep_type = -1; From 88935734fdce866b19c4b9da4081b85f844394a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1296/3334] Revert "[nrf fromtree] drivers: nrf_wifi: Use new nRF71 interface files" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a2c19edbc910fa14bfbc7599c3455b9742de6bf0. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 1 - drivers/wifi/nrf_wifi/inc/fmac_main.h | 5 +---- drivers/wifi/nrf_wifi/src/debug_shell.c | 4 ---- drivers/wifi/nrf_wifi/src/fmac_main.c | 17 ++++++----------- drivers/wifi/nrf_wifi/src/fw_load.c | 8 +------- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 3 +-- drivers/wifi/nrf_wifi/src/wifi_util.c | 4 ---- 7 files changed, 9 insertions(+), 33 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index df4414a316e0..29f8c86250a3 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -174,7 +174,6 @@ config NRF_WIFI_LOW_POWER config NRF70_TCP_IP_CHECKSUM_OFFLOAD bool "TCP/IP checksum offload" - depends on !NRF71_ON_IPC default y config NRF70_REG_DOMAIN diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 799beff1fbaf..48d3791961e3 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -31,11 +31,8 @@ #else #include #endif /* !CONFIG_NRF70_RADIO_TEST */ -#ifdef CONFIG_NRF71_ON_IPC -#include -#else + #include -#endif /* CONFIG_NRF71_ON_IPC */ #define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING diff --git a/drivers/wifi/nrf_wifi/src/debug_shell.c b/drivers/wifi/nrf_wifi/src/debug_shell.c index b6ac79bf7724..70fb77d6ed0d 100644 --- a/drivers/wifi/nrf_wifi/src/debug_shell.c +++ b/drivers/wifi/nrf_wifi/src/debug_shell.c @@ -9,11 +9,7 @@ */ #include #include -#ifdef NRF71_ON_IPC -#include -#else #include "host_rpu_umac_if.h" -#endif #include "fmac_main.h" extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 764cab93193e..d0fa7cfba410 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -69,10 +69,9 @@ BUILD_ASSERT(CONFIG_NRF70_MAX_TX_AGGREGATION <= 15, "Max TX aggregation is 15"); BUILD_ASSERT(CONFIG_NRF70_RX_NUM_BUFS >= 1, "At least one RX buffer is required"); -#ifndef CONFIG_NRF71_ON_IPC BUILD_ASSERT(RPU_PKTRAM_SIZE - TOTAL_RX_SIZE >= TOTAL_TX_SIZE, "Packet RAM overflow: not enough memory for TX"); -#endif /* CONFIG_NRF71_ON_IPC */ + BUILD_ASSERT(CONFIG_NRF70_TX_MAX_DATA_SIZE >= MAX_TX_FRAME_SIZE, "TX buffer size must be at least as big as the MTU and headroom"); @@ -504,9 +503,12 @@ void reg_change_callbk_fn(void *vif_ctx, } #endif /* !CONFIG_NRF70_RADIO_TEST */ -#ifndef CONFIG_NRF71_ON_IPC +#ifdef CONFIG_NRF71_ON_IPC +#define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(wifi), label) * 4 +#else /* DTS uses 1dBm as the unit for TX power, while the RPU uses 0.25dBm */ #define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(nrf70), label) * 4 +#endif /* CONFIG_NRF71_ON_IPC */ void configure_tx_pwr_settings(struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params, struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params) @@ -585,7 +587,6 @@ void configure_board_dep_params(struct nrf_wifi_board_params *board_params) board_params->pcb_loss_5g_band3 = CONFIG_NRF70_PCB_LOSS_5G_BAND3; #endif /* CONFIG_NRF70_2_4G_ONLY */ } -#endif /* CONFIG_NRF71_ON_IPC */ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep) { @@ -605,6 +606,7 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv struct nrf_wifi_tx_pwr_ctrl_params tx_pwr_ctrl_params; struct nrf_wifi_tx_pwr_ceil_params tx_pwr_ceil_params; struct nrf_wifi_board_params board_params; + unsigned int fw_ver = 0; #if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \ @@ -652,12 +654,10 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv NRF_WIFI_UMAC_VER_MIN(fw_ver), NRF_WIFI_UMAC_VER_EXTRA(fw_ver)); -#ifndef CONFIG_NRF71_ON_IPC configure_tx_pwr_settings(&tx_pwr_ctrl_params, &tx_pwr_ceil_params); configure_board_dep_params(&board_params); -#endif /* CONFIG_NRF71_ON_IPC */ #if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \ defined(CONFIG_NRF70_SYSTEM_MODE) @@ -853,14 +853,9 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) struct nrf_wifi_sys_fmac_priv *sys_fpriv = NULL; sys_fpriv = wifi_fmac_priv(rpu_drv_priv_zep.fmac_priv); -#ifdef CONFIG_NRF71_ON_IPC - /* TODO: Revisit this */ - sys_fpriv->max_ampdu_len_per_token = 8192; -#else sys_fpriv->max_ampdu_len_per_token = (RPU_PKTRAM_SIZE - (CONFIG_NRF70_RX_NUM_BUFS * CONFIG_NRF70_RX_MAX_DATA_SIZE)) / CONFIG_NRF70_MAX_TX_TOKENS; -#endif /* CONFIG_NRF71_ON_IPC */ /* Align to 4-byte */ sys_fpriv->max_ampdu_len_per_token &= ~0x3; diff --git a/drivers/wifi/nrf_wifi/src/fw_load.c b/drivers/wifi/nrf_wifi/src/fw_load.c index cce5a98372fc..f09643a585a8 100644 --- a/drivers/wifi/nrf_wifi/src/fw_load.c +++ b/drivers/wifi/nrf_wifi/src/fw_load.c @@ -17,17 +17,13 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include -#ifndef CONFIG_NRF71_ON_IPC static const char fw_patch[] = { #include }; -#endif /* CONFIG_NRF71_ON_IPC */ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; - -#ifndef CONFIG_NRF71_ON_IPC struct nrf_wifi_fmac_fw_info fw_info = { 0 }; status = nrf_wifi_fmac_fw_parse(rpu_ctx, fw_patch, sizeof(fw_patch), &fw_info); @@ -35,15 +31,13 @@ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) LOG_ERR("%s: nrf_wifi_fmac_fw_parse failed", __func__); return status; } - +#ifndef CONFIG_NRF71_ON_IPC /* Load the FW patches to the RPU */ status = nrf_wifi_fmac_fw_load(rpu_ctx, &fw_info); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_fmac_fw_load failed", __func__); } -#else - status = NRF_WIFI_STATUS_SUCCESS; #endif /* !CONFIG_NRF71_ON_IPC */ return status; } diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 6bb31241b295..e48ae31734a7 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -564,9 +564,8 @@ int nrf_wifi_set_twt(const struct device *dev, twt_info.dialog_token = twt_params->dialog_token; twt_info.twt_wake_ahead_duration = twt_params->setup.twt_wake_ahead_duration; -#ifndef CONFIG_NRF71_ON_IPC twt_info.twt_req_timeout = CONFIG_NRF_WIFI_TWT_SETUP_TIMEOUT_MS; -#endif /* CONFIG_NRF71_ON_IPC */ + status = nrf_wifi_sys_fmac_twt_setup(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &twt_info); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index 50c9e947229b..4a8309434794 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -8,11 +8,7 @@ * @brief NRF Wi-Fi util shell module */ #include -#ifdef NRF71_ON_IPC -#include -#else #include "host_rpu_umac_if.h" -#endif #include "common/fmac_util.h" #include "system/fmac_api.h" #include "fmac_main.h" From 16221ad36d9072d393d2ab4fb4569a8938bf1332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1297/3334] Revert "[nrf fromtree] drivers: nrf_wifi: Fix NRF71 build" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 265a8688beaaf4093dd95e4d7cf42708b0895f6b. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wifi_util.c | 7 ------- drivers/wifi/nrf_wifi/src/wifi_util.h | 4 ---- 2 files changed, 11 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index 4a8309434794..57bda1f4ff4f 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -14,10 +14,8 @@ #include "fmac_main.h" #include "wifi_util.h" -#ifndef CONFIG_NRF71_ON_IPC #include "rpu_lmac_phy_stats.h" #include "rpu_umac_stats.h" -#endif extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; struct nrf_wifi_ctx_zep *ctx = &rpu_drv_priv_zep.rpu_ctx_zep; @@ -975,7 +973,6 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, } #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ -#ifndef CONFIG_NRF71_ON_IPC static int nrf_wifi_dump_stats(const struct shell *sh, struct nrf_wifi_hal_dev_ctx *hal_dev_ctx, const char *name, @@ -1013,7 +1010,6 @@ static int nrf_wifi_dump_stats(const struct shell *sh, return ret; } - static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh, size_t argc, const char *argv[]) @@ -1099,7 +1095,6 @@ static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh, k_mutex_unlock(&ctx->rpu_lock); return ret; } -#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_STATIC_SUBCMD_SET_CREATE( nrf70_util, @@ -1204,7 +1199,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 1, 0), #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ -#ifndef CONFIG_NRF71_ON_IPC SHELL_CMD_ARG(rpu_stats_mem, NULL, "Display RPU stats by reading from memory " @@ -1212,7 +1206,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_util_dump_rpu_stats_mem, 1, 1), -#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_SUBCMD_SET_END); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.h b/drivers/wifi/nrf_wifi/src/wifi_util.h index a2490a1df24c..303d5feac99f 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.h +++ b/drivers/wifi/nrf_wifi/src/wifi_util.h @@ -14,11 +14,7 @@ #include #include #include -#ifdef CONFIG_NRF71_ON_IPC -#include -#else #include -#endif #include #include From f66d04caa3292cedd673e7624b2899f335a12de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1298/3334] Revert "[nrf fromtree] drivers: nrf_wifi: Implement vendor stats" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit eaabc3f5820052c53a752c65627c6c1cc10d13c7. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/inc/fmac_main.h | 9 ---- drivers/wifi/nrf_wifi/src/net_if.c | 73 --------------------------- 2 files changed, 82 deletions(-) diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 48d3791961e3..7a863d8b614a 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -36,11 +36,6 @@ #define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING -/* Calculate compile-time maximum for vendor stats */ -#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR -#define MAX_VENDOR_STATS ((sizeof(struct rpu_sys_fw_stats) / sizeof(uint32_t)) + 1) -#endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ - #ifndef CONFIG_NRF70_OFFLOADED_RAW_TX #ifndef CONFIG_NRF70_RADIO_TEST struct nrf_wifi_vif_ctx_zep { @@ -66,10 +61,6 @@ struct nrf_wifi_vif_ctx_zep { bool set_if_event_received; int set_if_status; #ifdef CONFIG_NET_STATISTICS_ETHERNET -#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR - struct net_stats_eth_vendor eth_stats_vendor_data[MAX_VENDOR_STATS]; - char vendor_key_strings[MAX_VENDOR_STATS][16]; -#endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ struct net_stats_eth eth_stats; #endif /* CONFIG_NET_STATISTICS_ETHERNET */ #if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 0662c6c80d09..d1fc9195dbb2 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -1213,16 +1213,6 @@ int nrf_wifi_if_set_config_zep(const struct device *dev, struct net_stats_eth *nrf_wifi_eth_stats_get(const struct device *dev) { struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; -#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR - struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct rpu_sys_op_stats stats; - enum nrf_wifi_status status; - size_t fw_stats_size; - size_t num_uint32; - const uint8_t *fw_stats_bytes; - size_t i; - int vendor_idx = 0; -#endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ if (!dev) { LOG_ERR("%s Device not found", __func__); @@ -1235,69 +1225,6 @@ struct net_stats_eth *nrf_wifi_eth_stats_get(const struct device *dev) goto out; } -#ifdef CONFIG_NET_STATISTICS_ETHERNET_VENDOR - rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - if (!rpu_ctx_zep || !rpu_ctx_zep->rpu_ctx) { - LOG_ERR("%s: rpu_ctx_zep or rpu_ctx is NULL", __func__); - goto out; - } - - memset(&stats, 0, sizeof(stats)); - status = nrf_wifi_sys_fmac_stats_get(rpu_ctx_zep->rpu_ctx, - RPU_STATS_TYPE_ALL, - &stats); - if (status != NRF_WIFI_STATUS_SUCCESS) { - LOG_ERR("%s: Failed to get RPU stats", __func__); - goto ret; - } - - /* Treat stats.fw as a blob and divide into uint32_t chunks */ - fw_stats_size = sizeof(stats.fw); - num_uint32 = fw_stats_size / sizeof(uint32_t); - fw_stats_bytes = (const uint8_t *)&stats.fw; - - vendor_idx = 0; - - for (i = 0; i < num_uint32 && vendor_idx < MAX_VENDOR_STATS - 1; i++) { - uint32_t val; - const char **key_ptr; - uint32_t *val_ptr; - - /* Extract uint32_t value from blob */ - memcpy(&val, fw_stats_bytes + i * sizeof(uint32_t), sizeof(uint32_t)); - - /* Create key name */ - snprintk(vif_ctx_zep->vendor_key_strings[vendor_idx], 16, "fw_%zu", i); - - /* Assign key */ - key_ptr = (const char **) - &vif_ctx_zep->eth_stats_vendor_data[vendor_idx].key; - *key_ptr = vif_ctx_zep->vendor_key_strings[vendor_idx]; - - /* Assign value */ - val_ptr = (uint32_t *) - &vif_ctx_zep->eth_stats_vendor_data[vendor_idx].value; - *val_ptr = val; - - vendor_idx++; - } - - /* Null terminator entry */ - { - const char **key_ptr = (const char **) - &vif_ctx_zep->eth_stats_vendor_data[vendor_idx].key; - uint32_t *val_ptr = (uint32_t *) - &vif_ctx_zep->eth_stats_vendor_data[vendor_idx].value; - - *key_ptr = NULL; - *val_ptr = 0; - } - - /* Point to the static vendor data */ - vif_ctx_zep->eth_stats.vendor = vif_ctx_zep->eth_stats_vendor_data; - -ret: -#endif /* CONFIG_NET_STATISTICS_ETHERNET_VENDOR */ return &vif_ctx_zep->eth_stats; out: return NULL; From 35113a13e8fb07fb7ad67870b61818573e9cb933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1299/3334] Revert "[nrf fromtree] drivers: nrf_wifi: Fix scan crash for 2nd VIF" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cfc627cdecf0857091efd8c420e5579ee6d0cb41. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/fmac_main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index d0fa7cfba410..5932ec4f026f 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -752,14 +752,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) /* Setup the linkage between the FMAC and the VIF contexts */ vif_ctx_zep->rpu_ctx_zep = &rpu_drv_priv_zep.rpu_ctx_zep; -#ifndef CONFIG_NRF70_RADIO_TEST - k_work_init_delayable(&vif_ctx_zep->scan_timeout_work, - nrf_wifi_scan_timeout_work); - k_work_init(&vif_ctx_zep->disp_scan_res_work, - nrf_wifi_disp_scan_res_work_handler); - - vif_ctx_zep->bss_max_idle_period = USHRT_MAX; -#endif /* !CONFIG_NRF70_RADIO_TEST */ if (fixed_vif_cnt++ > 0) { /* FMAC is already initialized for VIF-0 */ @@ -843,6 +835,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) rpu_drv_priv_zep.fmac_priv = nrf_wifi_rt_fmac_init(); #endif /* CONFIG_NRF70_RADIO_TEST */ + if (rpu_drv_priv_zep.fmac_priv == NULL) { LOG_ERR("%s: nrf_wifi_fmac_init failed", __func__); @@ -871,10 +864,17 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) LOG_ERR("%s: nrf_wifi_fmac_dev_add_zep failed", __func__); goto fmac_deinit; } +#else + k_work_init_delayable(&vif_ctx_zep->scan_timeout_work, + nrf_wifi_scan_timeout_work); + k_work_init(&vif_ctx_zep->disp_scan_res_work, + nrf_wifi_disp_scan_res_work_handler); #endif /* CONFIG_NRF70_RADIO_TEST */ k_mutex_init(&rpu_drv_priv_zep.rpu_ctx_zep.rpu_lock); - +#ifndef CONFIG_NRF70_RADIO_TEST + vif_ctx_zep->bss_max_idle_period = USHRT_MAX; +#endif /* !CONFIG_NRF70_RADIO_TEST */ return 0; #ifdef CONFIG_NRF70_RADIO_TEST fmac_deinit: From 7e8415dac00f9cbe9a48135c8a175715de1a070e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1300/3334] Revert "[nrf fromtree] drivers: wifi: nrf7002: Add support for multiple virtual interfaces (VIFs)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 08559d6a10502e9239cddeb0b0bec5ddef126a04. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 9 --------- drivers/wifi/nrf_wifi/src/fmac_main.c | 27 ------------------------- drivers/wifi/nrf_wifi/src/net_if.c | 3 ++- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 5 +---- 4 files changed, 3 insertions(+), 41 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 29f8c86250a3..9b37c302872b 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -108,15 +108,6 @@ config NRF70_AP_MODE depends on WIFI_NM_WPA_SUPPLICANT_AP default y if WIFI_USAGE_MODE_AP || WIFI_USAGE_MODE_STA_AP -config NRF70_ENABLE_DUAL_VIF - bool "Dual virtual Wi-Fi interfaces" - default y if WIFI_NM_MAX_MANAGED_INTERFACES = 2 - depends on (WIFI_NRF7002 || WIFI_NRF7001) && NET_L2_ETHERNET - help - Enable support for two virtual Wi-Fi interfaces (VIFs). - When enabled, the driver can operate two VIFs simultaneously, - allowing use cases such as one interface in AP mode and another in STA mode. - config NRF70_P2P_MODE bool "P2P support in driver" diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 5932ec4f026f..125ffd7a9a10 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -743,21 +743,9 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) struct nrf_wifi_data_config_params data_config = { 0 }; struct rx_buf_pool_params rx_buf_pools[MAX_NUM_OF_RX_QUEUES]; struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = dev->data; - static unsigned char fixed_vif_cnt; - if (fixed_vif_cnt >= MAX_NUM_VIFS) { - LOG_ERR("%s: Max number of VIFs reached", __func__); - return -ENOMEM; - } - - /* Setup the linkage between the FMAC and the VIF contexts */ vif_ctx_zep->rpu_ctx_zep = &rpu_drv_priv_zep.rpu_ctx_zep; - if (fixed_vif_cnt++ > 0) { - /* FMAC is already initialized for VIF-0 */ - return 0; - } - #ifdef CONFIG_NRF70_DATA_TX data_config.aggregation = aggregation; data_config.wmm = IS_ENABLED(CONFIG_NRF_WIFI_FEAT_WMM); @@ -991,21 +979,6 @@ ETH_NET_DEVICE_DT_INST_DEFINE(0, CONFIG_WIFI_INIT_PRIORITY, /* prio */ &wifi_offload_ops, /* api */ CONFIG_NRF_WIFI_IFACE_MTU); /*mtu */ -#ifdef CONFIG_NRF70_ENABLE_DUAL_VIF -/* Register second interface */ -ETH_NET_DEVICE_DT_INST_DEFINE(1, - nrf_wifi_drv_main_zep, /* init_fn */ - NULL, /* pm_action_cb */ - &rpu_drv_priv_zep.rpu_ctx_zep.vif_ctx_zep[1], /* data */ -#ifdef CONFIG_NRF70_STA_MODE - &wpa_supp_ops, /* cfg */ -#else /* CONFIG_NRF70_STA_MODE */ - NULL, /* cfg */ -#endif /* !CONFIG_NRF70_STA_MODE */ - CONFIG_WIFI_INIT_PRIORITY, /* prio */ - &wifi_offload_ops, /* api */ - CONFIG_NRF_WIFI_IFACE_MTU); /*mtu */ -#endif /* NRF70_ENABLE_DUAL_VIF */ #else DEVICE_DT_INST_DEFINE(0, nrf_wifi_drv_main_zep, /* init_fn */ diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index d1fc9195dbb2..4830d63c9d15 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -824,7 +824,8 @@ int nrf_wifi_if_start_zep(const struct device *dev) } k_mutex_init(&vif_ctx_zep->vif_lock); - vif_ctx_zep->if_type = add_vif_info.iftype; + rpu_ctx_zep->vif_ctx_zep[vif_ctx_zep->vif_idx].if_type = + add_vif_info.iftype; /* Check if user has provided a valid MAC address, if not * fetch it from OTP. diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 88ea9f9215b4..9f1fff535454 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -447,10 +447,7 @@ void *nrf_wifi_wpa_supp_dev_init(void *supp_drv_if_ctx, const char *iface_name, struct zep_wpa_supp_dev_callbk_fns *supp_callbk_fns) { struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; - /* Get device for each interface */ - int if_idx = net_if_get_by_name(iface_name); - struct net_if *iface = net_if_get_by_index(if_idx); - const struct device *device = net_if_get_device(iface); + const struct device *device = DEVICE_DT_GET(DT_CHOSEN(zephyr_wifi)); if (!device) { LOG_ERR("%s: Interface %s not found", __func__, iface_name); From c43c75ecd80a664fb2d25d7788d61c62e7606146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1301/3334] Revert "[nrf fromtree] boards: nordic: Add initial support for nRF54LM20A/ns" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 14bab27db4822d198707908c654584c94fdb6f22. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54lm20dk/Kconfig | 28 -------- boards/nordic/nrf54lm20dk/Kconfig.defconfig | 9 --- boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk | 2 +- boards/nordic/nrf54lm20dk/board.cmake | 8 --- boards/nordic/nrf54lm20dk/board.yml | 5 -- .../nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 38 +++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.dts | 1 - .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts | 68 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml | 22 ------ ...nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig | 45 ------------ dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 4 -- dts/vendor/nordic/nrf54lm20a.dtsi | 25 ------- .../nordic/nrf54lm20a_ns_partition.dtsi | 62 ----------------- dts/vendor/nordic/nrf54lm20a_partition.dtsi | 37 ---------- modules/trusted-firmware-m/Kconfig.tfm | 1 - .../nordic/nrf54lm20a_cpuapp/CMakeLists.txt | 23 ------- .../nordic/nrf54lm20a_cpuapp/config.cmake | 9 --- .../nordic/nrf54lm20a_cpuapp/cpuarch.cmake | 9 --- .../nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake | 10 --- samples/drivers/watchdog/sample.yaml | 1 - .../tfm_integration/config_build/sample.yaml | 1 - samples/tfm_integration/tfm_ipc/sample.yaml | 1 - tests/drivers/adc/adc_api/testcase.yaml | 1 - .../watchdog/wdt_basic_api/testcase.yaml | 1 - tests/subsys/settings/its/testcase.yaml | 1 - 25 files changed, 39 insertions(+), 373 deletions(-) delete mode 100644 boards/nordic/nrf54lm20dk/Kconfig delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig delete mode 100644 dts/vendor/nordic/nrf54lm20a_ns_partition.dtsi delete mode 100644 dts/vendor/nordic/nrf54lm20a_partition.dtsi delete mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/CMakeLists.txt delete mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/config.cmake delete mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/cpuarch.cmake delete mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake diff --git a/boards/nordic/nrf54lm20dk/Kconfig b/boards/nordic/nrf54lm20dk/Kconfig deleted file mode 100644 index 0b1905a0d8ef..000000000000 --- a/boards/nordic/nrf54lm20dk/Kconfig +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) - -if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig index c77e844b822c..67410cd4d653 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54lm20dk/Kconfig.defconfig @@ -7,12 +7,3 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP - -if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y - -endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS diff --git a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk index b311fd9ae87e..83b3842211f3 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk +++ b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk @@ -2,5 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF54LM20DK - select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS + select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP select SOC_NRF54LM20A_ENGA_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake index 6aaf6196d572..e487ecfb476f 100644 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ b/boards/nordic/nrf54lm20dk/board.cmake @@ -7,13 +7,5 @@ elseif(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR) board_runner_args(jlink "--speed=4000") endif() -if(CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS) - set(TFM_PUBLIC_KEY_FORMAT "full") -endif() - -if(CONFIG_TFM_FLASH_MERGED_BINARY) - set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) -endif() - include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nordic/nrf54lm20dk/board.yml b/boards/nordic/nrf54lm20dk/board.yml index 86decbf7c7cd..2930f9d3dfbd 100644 --- a/boards/nordic/nrf54lm20dk/board.yml +++ b/boards/nordic/nrf54lm20dk/board.yml @@ -5,8 +5,6 @@ board: socs: - name: nrf54lm20a variants: - - name: ns - cpucluster: cpuapp - name: xip cpucluster: cpuflpr runners: @@ -19,7 +17,6 @@ runners: groups: - boards: - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr/xip '--erase': @@ -31,7 +28,6 @@ runners: groups: - boards: - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr/xip '--reset': @@ -43,6 +39,5 @@ runners: groups: - boards: - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr/xip diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index 39fda7c4c88e..c6943b5a1028 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -58,6 +58,44 @@ status = "okay"; }; +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(449)>; + }; + + slot0_ns_partition: partition@80400 { + label = "image-0-nonsecure"; + reg = <0x80400 DT_SIZE_K(449)>; + }; + + slot1_partition: partition@f0800 { + label = "image-1"; + reg = <0xf0800 DT_SIZE_K(449)>; + }; + + slot1_ns_partition: partition@160c00 { + label = "image-1-nonsecure"; + reg = <0x160c00 DT_SIZE_K(449)>; + }; + + storage_partition: partition@1d1000 { + label = "storage"; + reg = <0x1d1000 DT_SIZE_K(36)>; + }; + }; +}; + &uart20 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index 2e79bbb98215..6dd2c5b2e850 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -7,7 +7,6 @@ /dts-v1/; #include "nrf54lm20a_cpuapp_common.dtsi" -#include / { compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp"; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts deleted file mode 100644 index 04cb9d04a60c..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#define USE_NON_SECURE_ADDRESS_MAP 1 - -#include "nrf54lm20a_cpuapp_common.dtsi" - -/ { - compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp-ns"; - model = "Nordic nRF54LM20 DK nRF54LM20A Application MCU Non-Secure"; - - chosen { - zephyr,code-partition = &slot0_ns_partition; - zephyr,sram = &sram0_ns; - zephyr,entropy = &psa_rng; - }; - - /delete-node/ rng; - - psa_rng: psa-rng { - status = "okay"; - }; -}; - -/ { - /* - * Default SRAM planning when building for nRF54LM20A with ARM TrustZone-M support - * - Lowest 208 kB SRAM allocated to Secure image (sram0_s). - * - Upper 208 kB SRAM allocated to Non-Secure image (sram0_ns). - * - * nRF54LM20A has 512 kB of volatile memory (SRAM), but 96kB is allocated for the FLPR MCU. - * This static layout needs to be the same with the upstream TF-M layout in the - * header flash_layout.h of the relevant platform. Any updates in the layout - * needs to happen both in the flash_layout.h and in this file at the same time. - */ - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - sram0_s: image_s@20000000 { - /* Secure image memory */ - reg = <0x20000000 DT_SIZE_K(208)>; - }; - - sram0_ns: image_ns@20034000 { - /* Non-Secure image memory */ - reg = <0x20034000 DT_SIZE_K(208)>; - }; - }; -}; - -&bt_hci_controller { - status = "disabled"; -}; - -&uart30 { - /* Disable so that TF-M can use this UART */ - status = "disabled"; -}; - -/* Include default memory partition configuration file */ -#include diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml deleted file mode 100644 index 3f10201892fb..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml +++ /dev/null @@ -1,22 +0,0 @@ -identifier: nrf54lm20dk/nrf54lm20a/cpuapp/ns -name: nRF54lm20-DK-nRF54lm20a-Application-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - zephyr -ram: 208 -flash: 1356 -supported: - - adc - - counter - - dmic - - gpio - - i2c - - i2s - - pwm - - spi - - usbd - - watchdog -vendor: nordic -sysbuild: true diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig deleted file mode 100644 index d360ef89bac4..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns_defconfig +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y -CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# Use devicetree code partition for TF-M -CONFIG_USE_DT_CODE_PARTITION=y - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable GPIO -CONFIG_GPIO=y - -# Don't enable the cache in the non-secure image as it is a -# secure-only peripheral on 54l -CONFIG_CACHE_MANAGEMENT=n -CONFIG_EXTERNAL_CACHE=n - -# Start SYSCOUNTER on driver init -CONFIG_NRF_GRTC_START_SYSCOUNTER=y - -# Disable TFM BL2 since it is not supported -CONFIG_TFM_BL2=n -# Support for silence logging is not supported at the moment -# Tracked by: NCSDK-31930 -CONFIG_TFM_LOG_LEVEL_SILENCE=n - -# The oscillators are configured as secure and cannot be configured -# from the non secure application directly. This needs to be set -# otherwise nrfx will try to configure them, resulting in a bus -# fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index dff01d80d7fe..d5aa024dd6d3 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -66,11 +66,7 @@ nvic: &cpuapp_nvic {}; }; &grtc { -#ifdef USE_NON_SECURE_ADDRESS_MAP - interrupts = <227 NRF_DEFAULT_IRQ_PRIORITY>, -#else interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>, -#endif <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ }; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index ff000d01143e..ae17be2c8d42 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -96,14 +96,10 @@ #nordic,ficr-cells = <1>; }; -#ifdef USE_NON_SECURE_ADDRESS_MAP - /* intentionally empty because UICR is hardware fixed to Secure */ -#else uicr: uicr@ffd000 { compatible = "nordic,nrf-uicr"; reg = <0xffd000 0x1000>; }; -#endif cpuapp_sram: memory@20000000 { compatible = "mmio-sram"; @@ -121,19 +117,11 @@ ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; }; -#ifdef USE_NON_SECURE_ADDRESS_MAP - global_peripherals: peripheral@40000000 { - reg = <0x40000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x40000000 0x10000000>; -#else global_peripherals: peripheral@50000000 { reg = <0x50000000 0x10000000>; ranges = <0x0 0x50000000 0x10000000>; #address-cells = <1>; #size-cells = <1>; -#endif dppic00: dppic@42000 { compatible = "nordic,nrf-dppic"; @@ -760,16 +748,12 @@ interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; }; -#ifdef USE_NON_SECURE_ADDRESS_MAP - /* intentionally empty because WDT30 is hardware fixed to Secure */ -#else wdt30: watchdog@108000 { compatible = "nordic,nrf-wdt"; reg = <0x108000 0x620>; interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; }; -#endif wdt31: watchdog@109000 { compatible = "nordic,nrf-wdt"; @@ -868,15 +852,6 @@ }; }; - nrf_mpc: memory@50041000 { - compatible = "nordic,nrf-mpc"; - reg = <0x50041000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - override-num = <5>; - override-granularity = <4096>; - }; - cpuapp_ppb: cpuapp-ppb-bus { #address-cells = <1>; #size-cells = <1>; diff --git a/dts/vendor/nordic/nrf54lm20a_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_ns_partition.dtsi deleted file mode 100644 index 954dd8290453..000000000000 --- a/dts/vendor/nordic/nrf54lm20a_ns_partition.dtsi +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuapp_rram { - /* - * Default NVM layout on NRF54LM20A Application MCU without BL2: - * This layout matches (by necessity) that in the TF-M repository: - * - * 0x0000_0000 Secure image primary (512 KB) - * 0x0008_0000 Protected Storage Area (16 KB) - * 0x0008_4000 Internal Trusted Storage Area (16 KB) - * 0x0008_8000 OTP / NV counters area (8 KB) - * 0x0008_A000 Non-secure image primary (1356 KB) - * 0x001D_DD00 Non-secure storage, used when built with NRF_NS_STORAGE=ON, - * otherwise unused (32 KB) - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - /* nRF54LM20A has 2036 kB of non-volatile memory (RRAM) but the last - * 96 kB are reserved for the FLPR MCU. - * - * This static layout needs to be the same with the upstream TF-M layout in the - * header flash_layout.h of the relevant platform. Any updates in the layout - * needs to happen both in the flash_layout.h and in this file at the same time. - */ - slot0_partition: partition@0 { - label = "image-0"; - reg = <0x0000000 DT_SIZE_K(512)>; - }; - - tfm_ps_partition: partition@80000 { - label = "tfm-ps"; - reg = <0x00080000 DT_SIZE_K(16)>; - }; - - tfm_its_partition: partition@84000 { - label = "tfm-its"; - reg = <0x00084000 DT_SIZE_K(16)>; - }; - - tfm_otp_partition: partition@88000 { - label = "tfm-otp"; - reg = <0x00088000 DT_SIZE_K(8)>; - }; - - slot0_ns_partition: partition@8A000 { - label = "image-0-nonsecure"; - reg = <0x0008A000 DT_SIZE_K(1356)>; - }; - - storage_partition: partition@1DD000 { - label = "storage"; - reg = <0x001DD000 DT_SIZE_K(32)>; - }; - }; -}; diff --git a/dts/vendor/nordic/nrf54lm20a_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_partition.dtsi deleted file mode 100644 index 049f87139d91..000000000000 --- a/dts/vendor/nordic/nrf54lm20a_partition.dtsi +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - /* nRF54LM20A has 2036 kB of non-volatile memory (RRAM) but the last - * 96 kB are reserved for the FLPR MCU, so we have ~1940 kB available. - */ - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(922)>; - }; - - slot1_partition: partition@f6800 { - label = "image-1"; - reg = <0xf6800 DT_SIZE_K(922)>; - }; - - storage_partition: partition@1dd000 { - label = "storage"; - reg = <0x1dd000 DT_SIZE_K(32)>; - }; - }; -}; diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 36a734ad8b3e..55e08ee45e4a 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -28,7 +28,6 @@ config TFM_BOARD default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l15_cpuapp" if SOC_NRF54L15_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp" if SOC_NRF54LM20A_ENGA_CPUAPP help The board name used for building TFM. Building with TFM requires that TFM has been ported to the given board/SoC. diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/CMakeLists.txt b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/CMakeLists.txt deleted file mode 100644 index c926ace19c8f..000000000000 --- a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (c) 2025, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(NRF_BOARD_SELECTED True) - -add_subdirectory(${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/common/nrf54lm20a nrf54lm20a) - -add_subdirectory(.. common) - -install(FILES ${CMAKE_CURRENT_LIST_DIR}/ns/cpuarch_ns.cmake - DESTINATION ${INSTALL_PLATFORM_NS_DIR} - RENAME cpuarch.cmake) - -install(FILES config.cmake - DESTINATION ${INSTALL_PLATFORM_NS_DIR}) - -install(DIRECTORY ${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/nrf54lm20dk_nrf54lm20a_cpuapp/tests - - DESTINATION ${INSTALL_PLATFORM_NS_DIR} -) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/config.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/config.cmake deleted file mode 100644 index 4b1e3ab5e97c..000000000000 --- a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/config.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2025, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(NRF_SOC_VARIANT nrf54lm20a CACHE STRING "nRF SoC Variant") - -include(${PLATFORM_PATH}/common/nrf54lm20a/config.cmake) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/cpuarch.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/cpuarch.cmake deleted file mode 100644 index 1766b89f9964..000000000000 --- a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/cpuarch.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2025, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(PLATFORM_PATH platform/ext/target/nordic_nrf) - -include(${PLATFORM_PATH}/common/nrf54lm20a/cpuarch.cmake) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake deleted file mode 100644 index cec0a5536dd3..000000000000 --- a/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp/ns/cpuarch_ns.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) 2025, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(PLATFORM_DIR ${CMAKE_CURRENT_LIST_DIR}) -set(PLATFORM_PATH ${CMAKE_CURRENT_LIST_DIR}) - -include(${CMAKE_CURRENT_LIST_DIR}/common/nrf54lm20a/cpuarch.cmake) diff --git a/samples/drivers/watchdog/sample.yaml b/samples/drivers/watchdog/sample.yaml index 8cf1d7db91a5..a1069108fb05 100644 --- a/samples/drivers/watchdog/sample.yaml +++ b/samples/drivers/watchdog/sample.yaml @@ -26,7 +26,6 @@ tests: - panb611evb/nrf54l15/cpuapp/ns - panb611evb/nrf54l15/cpuflpr - panb611evb/nrf54l15/cpuflpr/xip - - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns diff --git a/samples/tfm_integration/config_build/sample.yaml b/samples/tfm_integration/config_build/sample.yaml index 55c4e2348081..3c46c148f7ba 100644 --- a/samples/tfm_integration/config_build/sample.yaml +++ b/samples/tfm_integration/config_build/sample.yaml @@ -10,7 +10,6 @@ common: - nrf9160dk/nrf9160/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl5340_dvk/nrf5340/cpuapp/ns integration_platforms: - nrf5340dk/nrf5340/cpuapp/ns diff --git a/samples/tfm_integration/tfm_ipc/sample.yaml b/samples/tfm_integration/tfm_ipc/sample.yaml index 154d91b23f31..390efa24fb7e 100644 --- a/samples/tfm_integration/tfm_ipc/sample.yaml +++ b/samples/tfm_integration/tfm_ipc/sample.yaml @@ -35,7 +35,6 @@ tests: - mps2/an521/cpu0/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - - nrf54lm20dk/nrf54lm20a/cpuapp/ns extra_configs: - CONFIG_TFM_BL2=n harness: console diff --git a/tests/drivers/adc/adc_api/testcase.yaml b/tests/drivers/adc/adc_api/testcase.yaml index 3aa5e089b830..cd90f5356a51 100644 --- a/tests/drivers/adc/adc_api/testcase.yaml +++ b/tests/drivers/adc/adc_api/testcase.yaml @@ -13,7 +13,6 @@ tests: - panb611evb/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns - bl54l15u_dvk/nrf54l15/cpuapp/ns diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml index 6efd3fa94e91..01b8e6d833a8 100644 --- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml +++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml @@ -28,7 +28,6 @@ tests: - mimxrt700_evk/mimxrt798s/cm33_cpu1 - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns - bl54l15u_dvk/nrf54l15/cpuapp/ns diff --git a/tests/subsys/settings/its/testcase.yaml b/tests/subsys/settings/its/testcase.yaml index c63019e63457..de11f1ef7264 100644 --- a/tests/subsys/settings/its/testcase.yaml +++ b/tests/subsys/settings/its/testcase.yaml @@ -10,6 +10,5 @@ tests: - max32657evkit/max32657/ns - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - - nrf54lm20dk/nrf54lm20a/cpuapp/ns platform_exclude: - lpcxpresso55s69/lpc55s69/cpu0/ns From 4f99a81537251d9694cef13316181bfc91b79e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1302/3334] Revert "[nrf fromtree] Bluetooth: Controller: Fix use-after-release in lll_scan/lll_scan_aux" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0b1cbe3981444d0dde039353a19550b1f72af84c. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/ll_sw/lll_scan.h | 8 -------- .../controller/ll_sw/nordic/lll/lll_scan.c | 16 +++++----------- .../controller/ll_sw/nordic/lll/lll_scan_aux.c | 13 +++---------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/lll_scan.h b/subsys/bluetooth/controller/ll_sw/lll_scan.h index b9633f899383..db0f08a182e1 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_scan.h +++ b/subsys/bluetooth/controller/ll_sw/lll_scan.h @@ -17,14 +17,6 @@ struct lll_scan { uint8_t adv_addr[BDADDR_SIZE]; uint32_t conn_win_offset_us; uint16_t conn_timeout; - -#if defined(CONFIG_BT_CTLR_SCHED_ADVANCED) - /* Stores prepare parameters for deferred mayfly execution. - * This prevents use-after-release issues by ensuring the parameters - * remain valid until execution. - */ - struct lll_prepare_param prepare_param; -#endif /* CONFIG_BT_CTLR_SCHED_ADVANCED */ #endif /* CONFIG_BT_CENTRAL */ uint8_t state:1; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index 5cfa63b3bcf5..7ae1f8bb6de2 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -509,19 +509,13 @@ static int common_prepare_cb(struct lll_prepare_param *p, bool is_resume) static memq_link_t link; static struct mayfly mfy_after_cen_offset_get = { 0U, 0U, &link, NULL, ull_sched_mfy_after_cen_offset_get}; - struct lll_prepare_param *prepare_param; + uint32_t retval; - /* Copy the required values to calculate the offsets */ - prepare_param = &lll->prepare_param; - prepare_param->ticks_at_expire = p->ticks_at_expire; - prepare_param->remainder = p->remainder; - prepare_param->param = lll; + mfy_after_cen_offset_get.param = p; - mfy_after_cen_offset_get.param = prepare_param; - - ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, - &mfy_after_cen_offset_get); - LL_ASSERT_ERR(!ret); + retval = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, + &mfy_after_cen_offset_get); + LL_ASSERT_ERR(!retval); } #endif /* CONFIG_BT_CENTRAL && CONFIG_BT_CTLR_SCHED_ADVANCED */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c index 8606a7913609..6665dc7390e2 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c @@ -607,19 +607,12 @@ static int prepare_cb(struct lll_prepare_param *p) static memq_link_t link; static struct mayfly mfy_after_cen_offset_get = { 0U, 0U, &link, NULL, ull_sched_mfy_after_cen_offset_get}; - struct lll_prepare_param *prepare_param; - /* Copy the required values to calculate the offsets - * - * NOTE: LLL scan instance passed, as done when + /* NOTE: LLL scan instance passed, as done when * establishing legacy connections. */ - prepare_param = &lll->prepare_param; - prepare_param->ticks_at_expire = p->ticks_at_expire; - prepare_param->remainder = p->remainder; - prepare_param->param = lll; - - mfy_after_cen_offset_get.param = prepare_param; + p->param = lll; + mfy_after_cen_offset_get.param = p; ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, &mfy_after_cen_offset_get); From e2f880f3e714a2338c71e907bf58f88da019b94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1303/3334] Revert "[nrf fromtree] Bluetooth: Controller: Handle overlapping CIG and ACL" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9949a4f086a55731ef3ad86e45eb0799ae23fb40. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/ll_sw/ull_conn_iso.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c index 30dcb8419ad7..2ce0d8c3649b 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c @@ -979,17 +979,6 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle, lost_cig_events = 1U; cis_offset = cis->offset + iso_interval_us - acl_latency_us; } - /* Correct the cis_offset to next CIG event, if the ACL and CIG overlaps. - * ACL radio event at the instant was skipped and a relative CIS offset at - * the current ACL event has been calculated. But the current ACL event - * is partially overlapping with the other of CISes (not yet established) in - * the CIG event. Hence, lets establish the CIS at the next ISO interval so - * as to have a positive CIG event offset. - */ - if (cis_offset < (cig->sync_delay - cis->sync_delay)) { - cis_offset += iso_interval_us; - lost_cig_events++; - } cis->lll.event_count_prepare += lost_cig_events; From 11fff8ec2cb8161f33c1341b9310300d7bee0b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1304/3334] Revert "[nrf fromtree] Bluetooth: Controller: nRF54Lx: Enable Controller Privacy Support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc8a0df3a08973c340037c3b3d7cee4cdec4b5b8. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/Kconfig.ll_sw_split | 3 ++- tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh | 2 -- tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index b6774d63c7c6..e862034c2550 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -22,7 +22,8 @@ config BT_LLL_VENDOR_NORDIC !BT_CTLR_DATA_LENGTH_CLEAR && \ !BT_CTLR_PHY_2M_NRF select BT_CTLR_PRIVACY_SUPPORT if BT_CTLR_CRYPTO_SUPPORT && \ - !SOC_SERIES_NRF51X + !SOC_SERIES_NRF51X && \ + !SOC_COMPATIBLE_NRF54LX select BT_CTLR_CONN_PARAM_REQ_SUPPORT select BT_CTLR_EXT_REJ_IND_SUPPORT select BT_CTLR_PER_INIT_FEAT_XCHG_SUPPORT diff --git a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh index ee428e1a97ce..75b006af80a2 100755 --- a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh +++ b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh @@ -16,8 +16,6 @@ source ${ZEPHYR_BASE}/tests/bsim/compile.source app=tests/bsim/bluetooth/ll/advx compile app=tests/bsim/bluetooth/ll/advx conf_overlay=overlay-ticker_expire_info.conf compile app=tests/bsim/bluetooth/ll/advx conf_overlay=overlay-scan_aux_use_chains.conf compile -app=tests/bsim/bluetooth/ll/conn conf_file=prj_split.conf compile -app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_privacy.conf compile app=tests/bsim/bluetooth/ll/throughput compile app=tests/bsim/bluetooth/ll/throughput conf_overlay=overlay-no_phy_update.conf compile app=tests/bsim/bluetooth/ll/multiple_id compile diff --git a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt index d289755e9fb3..4b94f5ee29f0 100644 --- a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt +++ b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt @@ -1,8 +1,6 @@ # Search paths(s) for tests which will be run in the nrf54l15 app core # This file is used in CI to select which tests are run tests/bsim/bluetooth/ll/advx/ -tests/bsim/bluetooth/ll/conn/tests_scripts/basic_conn_encrypted_split.sh -tests/bsim/bluetooth/ll/conn/tests_scripts/basic_conn_encrypted_split_privacy.sh tests/bsim/bluetooth/ll/throughput/ tests/bsim/bluetooth/ll/multiple_id/ tests/bsim/bluetooth/ll/bis/tests_scripts/broadcast_iso_interleaved.sh From 433c4313e4c5f00e9656f6291dc4eaff4cda5861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1305/3334] Revert "[nrf fromtree] tests: bsim: Bluetooth: Conditionally compile Controller Privacy" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0d61391f2775a384a22c62992fe86fa0156bd5de. Signed-off-by: Tomasz Moń --- .../compile.nrf54l15bsim_nrf54l15_cpuapp.sh | 3 - tests/bsim/bluetooth/ll/advx/src/main.c | 90 +++++++------------ .../ll/advx/tests_scripts/basic_advx.sh | 4 +- .../basic_advx_scan_aux_use_chains.sh | 4 +- .../basic_advx_ticker_expire_info.sh | 4 +- .../tests.nrf54l15bsim_nrf54l15_cpuapp.txt | 1 - 6 files changed, 38 insertions(+), 68 deletions(-) diff --git a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh index 75b006af80a2..9db8bbcf8d25 100755 --- a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh +++ b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh @@ -13,9 +13,6 @@ export BOARD="${BOARD:-nrf54l15bsim/nrf54l15/cpuapp}" source ${ZEPHYR_BASE}/tests/bsim/compile.source -app=tests/bsim/bluetooth/ll/advx compile -app=tests/bsim/bluetooth/ll/advx conf_overlay=overlay-ticker_expire_info.conf compile -app=tests/bsim/bluetooth/ll/advx conf_overlay=overlay-scan_aux_use_chains.conf compile app=tests/bsim/bluetooth/ll/throughput compile app=tests/bsim/bluetooth/ll/throughput conf_overlay=overlay-no_phy_update.conf compile app=tests/bsim/bluetooth/ll/multiple_id compile diff --git a/tests/bsim/bluetooth/ll/advx/src/main.c b/tests/bsim/bluetooth/ll/advx/src/main.c index ac9d99976c55..cd9f0a4cd503 100644 --- a/tests/bsim/bluetooth/ll/advx/src/main.c +++ b/tests/bsim/bluetooth/ll/advx/src/main.c @@ -29,11 +29,7 @@ #define EVT_PROP_TXP BIT(6) #define ADV_INTERVAL 0x20 /* 20 ms advertising interval */ #define ADV_WAIT_MS 10 /* 10 ms wait loop */ -#if defined(CONFIG_BT_CTLR_PRIVACY) -#define OWN_ADDR_TYPE BT_HCI_OWN_ADDR_RPA_OR_RANDOM -#else /* !CONFIG_BT_CTLR_PRIVACY */ #define OWN_ADDR_TYPE BT_HCI_OWN_ADDR_RANDOM -#endif /* !CONFIG_BT_CTLR_PRIVACY */ #define PEER_ADDR_TYPE BT_HCI_OWN_ADDR_RANDOM #define PEER_ADDR peer_addr #define ADV_CHAN_MAP 0x07 @@ -679,32 +675,28 @@ static void test_advx_main(void) k_sleep(K_MSEC(1000)); - if (IS_ENABLED(CONFIG_BT_CTLR_PRIVACY)) { - printk("Add to resolving list..."); - bt_addr_le_t peer_id_addr = { - .type = BT_ADDR_LE_RANDOM, - .a = { - .val = {0xc6, 0xc7, 0xc8, 0xc9, 0xc1, 0xcb} - } - }; - uint8_t pirk[16] = {0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA, - 0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA, 0xAB, 0xBA}; - uint8_t lirk[16] = {0x12, 0x21, 0x12, 0x21, 0x12, 0x21, 0x12, 0x21, - 0x12, 0x21, 0x12, 0x21, 0x12, 0x21, 0x12, 0x21}; - - err = ll_rl_add(&peer_id_addr, pirk, lirk); - if (err) { - goto exit; + printk("Add to resolving list..."); + bt_addr_le_t peer_id_addr = { + .type = BT_ADDR_LE_RANDOM, + .a = { + .val = {0xc6, 0xc7, 0xc8, 0xc9, 0xc1, 0xcb} } - printk("success.\n"); + }; + uint8_t pirk[16] = {0x00, }; + uint8_t lirk[16] = {0x01, }; - printk("Enable resolving list..."); - err = ll_rl_enable(BT_HCI_ADDR_RES_ENABLE); - if (err) { - goto exit; - } - printk("success.\n"); + err = ll_rl_add(&peer_id_addr, pirk, lirk); + if (err) { + goto exit; } + printk("success.\n"); + + printk("Enable resolving list..."); + err = ll_rl_enable(BT_HCI_ADDR_RES_ENABLE); + if (err) { + goto exit; + } + printk("success.\n"); printk("Enabling extended..."); err = ll_adv_enable(handle, 1, 0, 0); @@ -1724,46 +1716,28 @@ static void test_scanx_main(void) } printk("done.\n"); + printk("Add to resolving list..."); bt_addr_le_t peer_id_addr = { .type = BT_ADDR_LE_RANDOM, .a = { .val = {0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5} } }; + uint8_t pirk[16] = {0x01, }; + uint8_t lirk[16] = {0x00, }; - if (IS_ENABLED(CONFIG_BT_CTLR_PRIVACY)) { - printk("Add to resolving list..."); - bt_addr_le_t some_id_addr = { - .type = BT_ADDR_LE_RANDOM, - .a = { - .val = {0x78, 0x87, 0x78, 0x87, 0x78, 0x87} - } - }; - uint8_t pirk[16] = {0x12, 0x21, 0x12, 0x21, 0x12, 0x21, 0x12, 0x21, - 0x12, 0x21, 0x12, 0x21, 0x12, 0x21, 0x12, 0x21}; - uint8_t lirk[16] = {0xCD, 0xDC, 0xCD, 0xDC, 0xCD, 0xDC, 0xCD, 0xDC, - 0xCD, 0xDC, 0xCD, 0xDC, 0xCD, 0xDC, 0xCD, 0xDC}; - - /* some_id_addr with swapped peer IRK and local IRK */ - err = ll_rl_add(&some_id_addr, lirk, pirk); - if (err) { - goto exit; - } - - /* peer_id_addr with correct peer IRK and local IRK */ - err = ll_rl_add(&peer_id_addr, pirk, lirk); - if (err) { - goto exit; - } - printk("success.\n"); + err = ll_rl_add(&peer_id_addr, pirk, lirk); + if (err) { + goto exit; + } + printk("success.\n"); - printk("Enable resolving list..."); - err = ll_rl_enable(BT_HCI_ADDR_RES_ENABLE); - if (err) { - goto exit; - } - printk("success.\n"); + printk("Enable resolving list..."); + err = ll_rl_enable(BT_HCI_ADDR_RES_ENABLE); + if (err) { + goto exit; } + printk("success.\n"); printk("Add device to periodic advertising list..."); err = bt_le_per_adv_list_add(&peer_id_addr, per_sid); diff --git a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx.sh b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx.sh index 02add45e85eb..540611f69a37 100755 --- a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx.sh +++ b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx.sh @@ -13,10 +13,10 @@ EXECUTE_TIMEOUT=120 cd ${BSIM_OUT_PATH}/bin Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf \ - -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=0 -testid=advx + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=advx Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf\ - -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=1 -testid=scanx + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scanx Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ -D=2 -sim_length=60e6 $@ diff --git a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_scan_aux_use_chains.sh b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_scan_aux_use_chains.sh index 0331788a6309..0e26ae907de3 100755 --- a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_scan_aux_use_chains.sh +++ b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_scan_aux_use_chains.sh @@ -13,10 +13,10 @@ EXECUTE_TIMEOUT=120 cd ${BSIM_OUT_PATH}/bin Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf_overlay-scan_aux_use_chains_conf \ - -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=0 -testid=advx + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=advx Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf_overlay-scan_aux_use_chains_conf \ - -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=1 -testid=scanx + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scanx Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ -D=2 -sim_length=60e6 $@ diff --git a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_ticker_expire_info.sh b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_ticker_expire_info.sh index 655732639171..cabee84f0157 100755 --- a/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_ticker_expire_info.sh +++ b/tests/bsim/bluetooth/ll/advx/tests_scripts/basic_advx_ticker_expire_info.sh @@ -13,10 +13,10 @@ EXECUTE_TIMEOUT=120 cd ${BSIM_OUT_PATH}/bin Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf_overlay-ticker_expire_info_conf \ - -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=0 -testid=advx + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=advx Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_advx_prj_conf_overlay-ticker_expire_info_conf \ - -v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=1 -testid=scanx + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scanx Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ -D=2 -sim_length=60e6 $@ diff --git a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt index 4b94f5ee29f0..d5dee727d5e9 100644 --- a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt +++ b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt @@ -1,6 +1,5 @@ # Search paths(s) for tests which will be run in the nrf54l15 app core # This file is used in CI to select which tests are run -tests/bsim/bluetooth/ll/advx/ tests/bsim/bluetooth/ll/throughput/ tests/bsim/bluetooth/ll/multiple_id/ tests/bsim/bluetooth/ll/bis/tests_scripts/broadcast_iso_interleaved.sh From 0cbec41d699a669d86dc955f4cf7b9890815c9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:53 +0100 Subject: [PATCH 1306/3334] Revert "[nrf fromtree] Bluetooth: Controller: nRF54Lx: Add Controller Privacy Support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8fa4b61ea0c14bca2727ad62cc6d64e23d419884. Signed-off-by: Tomasz Moń --- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 110 ------------------ .../nordic/hal/nrf5/radio/radio_nrf54lx.h | 3 - .../nordic/hal/nrf5/radio/radio_nrf5_dppi.h | 11 -- .../nrf5/radio/radio_nrf5_dppi_resources.h | 12 +- .../nordic/hal/nrf5/radio/radio_sim_nrf54l.h | 3 - 5 files changed, 3 insertions(+), 136 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 7056f020bc28..218965d11bd0 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 @@ -2562,48 +2562,7 @@ void radio_ccm_disable(void) #endif /* CONFIG_BT_CTLR_LE_ENC || CONFIG_BT_CTLR_BROADCAST_ISO_ENC */ #if defined(CONFIG_BT_CTLR_PRIVACY) -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -struct aar_job_ptr { - void *ptr; - struct { - uint32_t length:24; - uint32_t attribute:8; - } __packed; -} __packed; - -#define AAR_JOB_PTR_ATTRIBUTE_HASH 11U -#define AAR_JOB_PTR_ATTRIBUTE_PRAND 12U -#define AAR_JOB_PTR_ATTRIBUTE_IRK 13U -#define AAR_JOB_PTR_ATTRIBUTE_INDEX 11U - -#define AAR_JOB_OUT_MAX_RESOLVED 1U - -#define AAR_IRK_SIZE 16U - -#define RADIO_PACKET_PTR_TO_PDU_OFFSET 3U - -#define BDADDR_HASH_OFFSET 0U -#define BDADDR_HASH_SIZE 3U -#define BDADDR_PRND_OFFSET 3U -#define BDADDR_PRND_SIZE 3U - -/* AAR HAL global memory referenced by the h/w peripheral and its DMA */ -static struct { - /* Index of the IRK match in the AAR job list, on successful resolution */ - uint32_t status; - - /* Input AAR job list; list of Hash, Prand, IRKs and a terminating empty job entry */ - struct aar_job_ptr in[CONFIG_BT_CTLR_RL_SIZE + 3]; - - /* Output AAR job list of one entry */ - struct aar_job_ptr out[AAR_JOB_OUT_MAX_RESOLVED]; - - /* NOTE: Refer to the AAR section in the SoC product specification for details */ -} aar_job; - -#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ static uint8_t MALIGN(4) _aar_scratch[3]; -#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ void radio_ar_configure(uint32_t nirk, void *irk, uint8_t flags) { @@ -2640,57 +2599,10 @@ void radio_ar_configure(uint32_t nirk, void *irk, uint8_t flags) NRF_AAR->ENABLE = (AAR_ENABLE_ENABLE_Enabled << AAR_ENABLE_ENABLE_Pos) & AAR_ENABLE_ENABLE_Msk; - -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - /* Input, Resolvable Address Hash offset in the legacy or extended advertising PDU. - * Radio packet pointer offset by 3 compared to legacy AAR in nRF51/52/53 SoCs that took - * Radio packet pointer value. - */ - aar_job.in[0].ptr = (uint8_t *)addrptr + RADIO_PACKET_PTR_TO_PDU_OFFSET + - BDADDR_HASH_OFFSET; - aar_job.in[0].length = BDADDR_HASH_SIZE; - aar_job.in[0].attribute = AAR_JOB_PTR_ATTRIBUTE_HASH; - - /* Input, Resolvable Address Random offset in the legacy or extended advertising PDU. - * Radio packet pointer offset by 3 compared to legacy AAR in nRF51/52/53 SoCs that took - * Radio packet pointer, plus offset of the 24-bit random in the legacy or extended - * advertising PDU after the 24-bit Hash in the Resolvable Address. - */ - aar_job.in[1].ptr = (uint8_t *)addrptr + RADIO_PACKET_PTR_TO_PDU_OFFSET + - BDADDR_PRND_OFFSET; - aar_job.in[1].length = BDADDR_PRND_SIZE; - aar_job.in[1].attribute = AAR_JOB_PTR_ATTRIBUTE_PRAND; - - /* Input, list of IRKs used for resolution */ - for (uint32_t i = 0; i < nirk; i++) { - aar_job.in[2U + i].ptr = (void *)(((uint8_t *)irk) + (AAR_IRK_SIZE * i)); - aar_job.in[2U + i].length = AAR_IRK_SIZE; - aar_job.in[2U + i].attribute = AAR_JOB_PTR_ATTRIBUTE_IRK; - } - - /* A terminating empty job entry */ - aar_job.in[2U + nirk].ptr = 0U; - aar_job.in[2U + nirk].length = 0U; - aar_job.in[2U + nirk].attribute = 0U; - - /* Reset match index to invalid value ( >= CONFIG_BT_CTLR_RL_SIZE ) */ - aar_job.status = UINT32_MAX; - - /* Output, single job entry that populates the `status` value with match index */ - aar_job.out[0].ptr = &aar_job.status; - aar_job.out[0].length = sizeof(aar_job.status); - aar_job.out[0].attribute = AAR_JOB_PTR_ATTRIBUTE_INDEX; - - NRF_AAR->IN.PTR = (uint32_t)&aar_job.in[0]; - NRF_AAR->OUT.PTR = (uint32_t)&aar_job.out[0]; - NRF_AAR->MAXRESOLVED = AAR_JOB_OUT_MAX_RESOLVED; - -#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ NRF_AAR->NIRK = nirk; NRF_AAR->IRKPTR = (uint32_t)irk; NRF_AAR->ADDRPTR = addrptr; NRF_AAR->SCRATCHPTR = (uint32_t)&_aar_scratch[0]; -#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ nrf_aar_event_clear(NRF_AAR, NRF_AAR_EVENT_END); nrf_aar_event_clear(NRF_AAR, NRF_AAR_EVENT_RESOLVED); @@ -2705,11 +2617,7 @@ void radio_ar_configure(uint32_t nirk, void *irk, uint8_t flags) uint32_t radio_ar_match_get(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - return aar_job.status; -#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ return NRF_AAR->STATUS; -#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_ar_status_reset(void) @@ -2752,25 +2660,7 @@ uint8_t radio_ar_resolve(const uint8_t *addr) NRF_AAR->ENABLE = (AAR_ENABLE_ENABLE_Enabled << AAR_ENABLE_ENABLE_Pos) & AAR_ENABLE_ENABLE_Msk; -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - /* Input, Resolvable Address Hash offset in the supplied address buffer */ - aar_job.in[0].ptr = (void *)&addr[BDADDR_HASH_OFFSET]; - - /* Input, Resolvable Address Prand offset in the supplied address buffer */ - aar_job.in[1].ptr = (void *)&addr[BDADDR_PRND_OFFSET]; - - /* Reset match index to invalid value ( >= CONFIG_BT_CTLR_RL_SIZE ) */ - aar_job.status = UINT32_MAX; - - /* NOTE: Other `aar_job` structure members are initialized in `radio_ar_configure()` */ - - NRF_AAR->IN.PTR = (uint32_t)&aar_job.in[0]; - NRF_AAR->OUT.PTR = (uint32_t)&aar_job.out[0]; - NRF_AAR->MAXRESOLVED = AAR_JOB_OUT_MAX_RESOLVED; - -#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ NRF_AAR->ADDRPTR = (uint32_t)addr - 3; -#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ nrf_aar_event_clear(NRF_AAR, NRF_AAR_EVENT_END); nrf_aar_event_clear(NRF_AAR, NRF_AAR_EVENT_RESOLVED); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h index 3a8206d79764..047e3ea24878 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h @@ -398,9 +398,6 @@ #define CCM_MODE_DATARATE_500Kbps CCM_MODE_DATARATE_500Kbit #define CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbps CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbit -/* HAL abstraction of AAR h/w */ -#define NRF_AAR NRF_AAR00 - static inline void hal_radio_reset(void) { /* TODO: Add any required setup for each radio event diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h index 1085f72f0b98..3b68259c9bf6 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h @@ -226,17 +226,6 @@ static inline void hal_trigger_aar_ppi_config(void) { nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_BCMATCH, HAL_TRIGGER_AAR_PPI); nrf_aar_subscribe_set(NRF_AAR, NRF_AAR_TASK_START, HAL_TRIGGER_AAR_PPI); - -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - /* Enable same DPPI in MCU domain */ - nrf_dppi_channels_enable(NRF_DPPIC00, BIT(HAL_TRIGGER_AAR_PPI)); - - /* Setup PPIB send subscribe */ - nrf_ppib_subscribe_set(NRF_PPIB10, HAL_PPIB_SEND_TRIGGER_AAR_PPI, HAL_TRIGGER_AAR_PPI); - - /* Setup PPIB receive publish */ - nrf_ppib_publish_set(NRF_PPIB00, HAL_PPIB_RECEIVE_TRIGGER_AAR_PPI, HAL_TRIGGER_AAR_PPI); -#endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ } #endif /* CONFIG_BT_CTLR_PRIVACY */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_resources.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_resources.h index 3a49b97e7b26..3c9a9e6949b3 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_resources.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_resources.h @@ -60,25 +60,19 @@ */ #if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) #define HAL_TRIGGER_CRYPT_PPI 7 +#else /* CONFIG_SOC_COMPATIBLE_NRF54LX */ +#define HAL_TRIGGER_CRYPT_PPI HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI +#endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ #define HAL_PPIB_SEND_TRIGGER_CRYPT_PPI \ _CONCAT(NRF_PPIB_TASK_SEND_, HAL_TRIGGER_CRYPT_PPI) #define HAL_PPIB_RECEIVE_TRIGGER_CRYPT_PPI \ _CONCAT(NRF_PPIB_EVENT_RECEIVE_, HAL_TRIGGER_CRYPT_PPI) -#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ -#define HAL_TRIGGER_CRYPT_PPI HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI -#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ /******************************************************************************* * Trigger automatic address resolution on Bit counter match: * wire the RADIO EVENTS_BCMATCH event to the AAR TASKS_START task. */ #define HAL_TRIGGER_AAR_PPI 6 -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define HAL_PPIB_SEND_TRIGGER_AAR_PPI \ - _CONCAT(NRF_PPIB_TASK_SEND_, HAL_TRIGGER_AAR_PPI) -#define HAL_PPIB_RECEIVE_TRIGGER_AAR_PPI \ - _CONCAT(NRF_PPIB_EVENT_RECEIVE_, HAL_TRIGGER_AAR_PPI) -#endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ #if defined(CONFIG_BT_CTLR_PHY_CODED) && \ defined(CONFIG_HAS_HW_NRF_RADIO_BLE_CODED) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_sim_nrf54l.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_sim_nrf54l.h index 8987031db5f1..324f2c8edb3f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_sim_nrf54l.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_sim_nrf54l.h @@ -392,9 +392,6 @@ #define CCM_MODE_DATARATE_500Kbps CCM_MODE_DATARATE_500Kbit #define CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbps CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbit -/* HAL abstraction of AAR h/w */ -#define NRF_AAR NRF_AAR00 - static inline void hal_radio_reset(void) { /* TODO: Add any required setup for each radio event From 1d627eb192d81e6a7ac38bad60b98ef5e0e00170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1307/3334] Revert "[nrf fromtree] Bluetooth: Controller: Add code comments related to short prepare" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ec0b45602e7edbc4d93040c8e469f3d19d9043cd. Signed-off-by: Tomasz Moń --- .../controller/ll_sw/nordic/lll/lll.c | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index d5903805e571..6a61c0c6605d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -852,41 +852,16 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, ticks_at_preempt_next = ready->prepare_param.ticks_at_expire; diff = ticker_ticks_diff_get(ticks_at_preempt_min, ticks_at_preempt_next); - /* If the enqueued prepare is a resume or current ready prepare is shorter, then we - * should pick current ready prepare for setting up the prepare timeout. - */ if (is_resume || ((diff & BIT(HAL_TICKER_CNTR_MSBIT)) == 0U)) { ticks_at_preempt_min = ticks_at_preempt_next; if (&ready->prepare_param != prepare_param) { - /* There is a shorter prepare in the pipeline */ ready_short = ready; - } else { - /* It is the same prepare in the pipeline being enqueued. - * This can happen executing `lll_done()`. - * Hence, we should ignore it being the `first` that setup the - * preempt timeout and also it has already setup the preempt - * timeout, refer to `preempt_ticker_start()` for details. - * - * We also set the `ready` to NULL as it is the same ready, the one - * being enqueued. This help short circuit a related assertion check - * later in this function. - */ - ready = NULL; } } else { ready = NULL; idx_backup = UINT8_MAX; } - /* Loop and find any short prepare present out-of-order in the prepare pipeline. - * - * NOTE: This loop is O(n), where n is number of items in prepare pipeline present - * before a short prepare was enqueued in to the FIFO. - * Use of ordered linked list implementation has show improved lower latencies - * and less CPU use. - * TODO: Replace use of FIFO for prepare pipeline with ordered linked list - * implementation. - */ do { struct lll_event *ready_next; From da05e6085479fdc0f6fda945fa8c08a696b19324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1308/3334] Revert "[nrf fromtree] samples: Bluetooth: hci_ipc: Enable HCI vendor-specific h/w error event" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4e43e216124881251a21dc25bd48546ba18840d8. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.3.rst | 5 +- include/zephyr/bluetooth/hci_vs.h | 2 +- .../nrf5340_cpunet_bis-bt_ll_sw_split.conf | 3 +- ...nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf | 2 - .../nrf5340_cpunet_cis-bt_ll_sw_split.conf | 3 +- .../nrf5340_cpunet_df-bt_ll_sw_split.conf | 3 +- .../nrf5340_cpunet_iso-bt_ll_sw_split.conf | 3 +- ...0_cpunet_iso_broadcast-bt_ll_sw_split.conf | 2 - ...340_cpunet_iso_central-bt_ll_sw_split.conf | 2 - ..._cpunet_iso_peripheral-bt_ll_sw_split.conf | 2 - ...340_cpunet_iso_receive-bt_ll_sw_split.conf | 2 - samples/bluetooth/hci_ipc/src/main.c | 4 -- .../hci_uart/overlay-all-bt_ll_sw_split.conf | 3 +- subsys/bluetooth/controller/hci/hci.c | 57 +++++++++---------- 14 files changed, 33 insertions(+), 60 deletions(-) diff --git a/doc/releases/migration-guide-4.3.rst b/doc/releases/migration-guide-4.3.rst index 83dc5e771201..e2e6c21b57d7 100644 --- a/doc/releases/migration-guide-4.3.rst +++ b/doc/releases/migration-guide-4.3.rst @@ -91,13 +91,10 @@ Bluetooth Bluetooth Controller ==================== -* The following have been renamed: +* The following Kconfig option have been renamed: * :kconfig:option:`CONFIG_BT_CTRL_ADV_ADI_IN_SCAN_RSP` to :kconfig:option:`CONFIG_BT_CTLR_ADV_ADI_IN_SCAN_RSP` - * :c:struct:`bt_hci_vs_fata_error_cpu_data_cortex_m` to - :c:struct:`bt_hci_vs_fatal_error_cpu_data_cortex_m` and now contains the program counter - value. .. zephyr-keep-sorted-start re(^\w) diff --git a/include/zephyr/bluetooth/hci_vs.h b/include/zephyr/bluetooth/hci_vs.h index 904bcbdb2d5d..3943696c195b 100644 --- a/include/zephyr/bluetooth/hci_vs.h +++ b/include/zephyr/bluetooth/hci_vs.h @@ -225,7 +225,7 @@ struct bt_hci_evt_vs { #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_STACK_FRAME 0x01 #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_CTRL_ASSERT 0x02 #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_TRACE 0x03 -struct bt_hci_vs_fatal_error_cpu_data_cortex_m { +struct bt_hci_vs_fata_error_cpu_data_cortex_m { uint32_t a1; uint32_t a2; uint32_t a3; diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf index 2827eeeeab23..9e3225621842 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf @@ -44,9 +44,8 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_DTM_HCI=y CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y +CONFIG_BT_CTLR_DTM_HCI=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf index 1ba04dc5dd5b..89ba46ff357a 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf @@ -12,8 +12,6 @@ CONFIG_BT_MAX_CONN=16 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y # Disable unused Bluetooth features CONFIG_BT_CTLR_DUP_FILTER_LEN=0 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf index 1f652ddbeb58..740de0cc83eb 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf @@ -43,9 +43,8 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_DTM_HCI=y CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y +CONFIG_BT_CTLR_DTM_HCI=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf index 7a6f8544986b..663751c16e65 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf @@ -29,9 +29,8 @@ CONFIG_BT_MAX_CONN=2 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_DTM_HCI=y CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y +CONFIG_BT_CTLR_DTM_HCI=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf index 6016318536bc..710530568acb 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf @@ -53,9 +53,8 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_DTM_HCI=y CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y +CONFIG_BT_CTLR_DTM_HCI=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf index 015a0e102f71..c63928dd27ca 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf @@ -30,8 +30,6 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # ISO Broadcast Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y CONFIG_BT_CTLR_ADV_PERIODIC=y CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191 CONFIG_BT_CTLR_ADV_ISO=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf index 6f84bc3d7cfe..55e680990eed 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf @@ -40,8 +40,6 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf index 3629ee8c9176..0031111ede82 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf @@ -40,8 +40,6 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf index 1b2e85e7a604..c0922ba9f932 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf @@ -22,8 +22,6 @@ CONFIG_BT_PERIPHERAL=n # ISO Receive Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y CONFIG_BT_CTLR_SYNC_PERIODIC=y CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 CONFIG_BT_CTLR_SYNC_ISO=y diff --git a/samples/bluetooth/hci_ipc/src/main.c b/samples/bluetooth/hci_ipc/src/main.c index 1dd941b58bd9..3641d5d98968 100644 --- a/samples/bluetooth/hci_ipc/src/main.c +++ b/samples/bluetooth/hci_ipc/src/main.c @@ -307,10 +307,7 @@ void bt_ctlr_assert_handle(char *file, uint32_t line) LOG_PANIC(); while (true) { - k_cpu_idle(); }; - - CODE_UNREACHABLE; } #endif /* CONFIG_BT_CTLR_ASSERT_HANDLER */ @@ -341,7 +338,6 @@ void k_sys_fatal_error_handler(unsigned int reason, const struct arch_esf *esf) LOG_PANIC(); while (true) { - k_cpu_idle(); }; CODE_UNREACHABLE; diff --git a/samples/bluetooth/hci_uart/overlay-all-bt_ll_sw_split.conf b/samples/bluetooth/hci_uart/overlay-all-bt_ll_sw_split.conf index e5b65559919c..05fbeb7be780 100644 --- a/samples/bluetooth/hci_uart/overlay-all-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_uart/overlay-all-bt_ll_sw_split.conf @@ -28,9 +28,8 @@ CONFIG_BT_ISO_RX_BUF_COUNT=1 # Controller CONFIG_BT_LL_SW_SPLIT=y -CONFIG_BT_CTLR_DTM_HCI=y CONFIG_BT_CTLR_ASSERT_HANDLER=y -CONFIG_BT_HCI_VS_FATAL_ERROR=y +CONFIG_BT_CTLR_DTM_HCI=y # Rx ACL and Adv Reports CONFIG_BT_CTLR_RX_BUFFERS=9 diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 81856d7c428d..0e8a41260ccb 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -5273,9 +5273,9 @@ NET_BUF_POOL_FIXED_DEFINE(vs_err_tx_pool, 1, BT_BUF_EVT_RX_SIZE, 0, NULL); * the alias is defined here. */ #if defined(CONFIG_CPU_CORTEX_M) -static struct net_buf *vs_err_evt_create(uint8_t subevt, uint8_t len); +typedef struct bt_hci_vs_fata_error_cpu_data_cortex_m bt_hci_vs_fatal_error_cpu_data; -static void vs_err_fatal_cpu_data_fill(struct bt_hci_vs_fatal_error_cpu_data_cortex_m *cpu_data, +static void vs_err_fatal_cpu_data_fill(bt_hci_vs_fatal_error_cpu_data *cpu_data, const struct arch_esf *esf) { cpu_data->a1 = sys_cpu_to_le32(esf->basic.a1); @@ -5287,35 +5287,7 @@ static void vs_err_fatal_cpu_data_fill(struct bt_hci_vs_fatal_error_cpu_data_cor cpu_data->pc = sys_cpu_to_le32(esf->basic.pc); cpu_data->xpsr = sys_cpu_to_le32(esf->basic.xpsr); } - -struct net_buf *hci_vs_err_stack_frame(unsigned int reason, const struct arch_esf *esf) -{ - /* Prepare vendor specific HCI Fatal Error event */ - struct bt_hci_vs_fatal_error_stack_frame *sf; - struct bt_hci_vs_fatal_error_cpu_data_cortex_m *cpu_data; - struct net_buf *buf; - - buf = vs_err_evt_create(BT_HCI_EVT_VS_ERROR_DATA_TYPE_STACK_FRAME, - sizeof(*sf) + sizeof(*cpu_data)); - if (buf != NULL) { - sf = net_buf_add(buf, (sizeof(*sf) + sizeof(*cpu_data))); - sf->reason = sys_cpu_to_le32(reason); - sf->cpu_type = BT_HCI_EVT_VS_ERROR_CPU_TYPE_CORTEX_M; - - vs_err_fatal_cpu_data_fill((void *)sf->cpu_data, esf); - } else { - LOG_WRN("Can't create HCI Fatal Error event"); - } - - return buf; -} - -#else /* !CONFIG_CPU_CORTEX_M */ -struct net_buf *hci_vs_err_stack_frame(unsigned int reason, const struct arch_esf *esf) -{ - return NULL; -} -#endif /* !CONFIG_CPU_CORTEX_M */ +#endif /* CONFIG_CPU_CORTEX_M */ static struct net_buf *vs_err_evt_create(uint8_t subevt, uint8_t len) { @@ -5339,6 +5311,29 @@ static struct net_buf *vs_err_evt_create(uint8_t subevt, uint8_t len) return buf; } +struct net_buf *hci_vs_err_stack_frame(unsigned int reason, const struct arch_esf *esf) +{ + /* Prepare vendor specific HCI Fatal Error event */ + struct bt_hci_vs_fatal_error_stack_frame *sf; + bt_hci_vs_fatal_error_cpu_data *cpu_data; + struct net_buf *buf; + + buf = vs_err_evt_create(BT_HCI_EVT_VS_ERROR_DATA_TYPE_STACK_FRAME, + sizeof(*sf) + sizeof(*cpu_data)); + if (buf != NULL) { + sf = net_buf_add(buf, (sizeof(*sf) + sizeof(*cpu_data))); + sf->reason = sys_cpu_to_le32(reason); + sf->cpu_type = BT_HCI_EVT_VS_ERROR_CPU_TYPE_CORTEX_M; + + vs_err_fatal_cpu_data_fill( + (bt_hci_vs_fatal_error_cpu_data *)sf->cpu_data, esf); + } else { + LOG_ERR("Can't create HCI Fatal Error event"); + } + + return buf; +} + static struct net_buf *hci_vs_err_trace_create(uint8_t data_type, const char *file_path, uint32_t line, uint64_t pc) From ed586ad5c090a98d5fa91bad5b5d11efe23052ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1309/3334] Revert "[nrf fromtree] Bluetooth: Controller: Reduce assertion check code size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5a5e7f1349e0b04dd9ea0591fed777a76f4afa8c. Signed-off-by: Tomasz Moń --- doc/connectivity/bluetooth/api/hci.txt | 8 ++-- include/zephyr/bluetooth/hci_vs.h | 4 +- subsys/bluetooth/controller/Kconfig | 15 ------ .../bluetooth/controller/Kconfig.ll_sw_split | 2 - subsys/bluetooth/controller/hal/debug.h | 47 +++---------------- subsys/bluetooth/controller/hci/hci.c | 1 - 6 files changed, 12 insertions(+), 65 deletions(-) diff --git a/doc/connectivity/bluetooth/api/hci.txt b/doc/connectivity/bluetooth/api/hci.txt index a23b24e6ad0e..2ad17bfae5eb 100644 --- a/doc/connectivity/bluetooth/api/hci.txt +++ b/doc/connectivity/bluetooth/api/hci.txt @@ -1085,13 +1085,14 @@ represents. | Event | Event Code | Event Parameters | +-------------------------------+------------+-------------------------------+ | Fatal_Error | 0xFF | Subevent_Code, | +| | | Error_Data_Type, | | | | Error_Data | +-------------------------------+------------+-------------------------------+ -The Subevent_Code provides an information about what is the Error_Data size and -content. +The Error_Data_Type provides an information about what is the Error_Data size +and content. - Subevent_Code: Size: 1 Octet + Error_Data_Type: Size: 1 Octet +--------------------+--------------------------------------+ | Value | Parameter Description | +--------------------+--------------------------------------+ @@ -1156,7 +1157,6 @@ Zephyr Fatal Error event may be generated by k_sys_fatal_error_handler. | a4 | 4 octets | General purpose register | | ip | 4 octets | Instruction pointer register | | lr | 4 octets | Link register | - | pc | 4 octets | Program counter register | | xpsr | 4 octets | Program status register | +--------------------+--------------------------------------------+ diff --git a/include/zephyr/bluetooth/hci_vs.h b/include/zephyr/bluetooth/hci_vs.h index 3943696c195b..1170c41474a2 100644 --- a/include/zephyr/bluetooth/hci_vs.h +++ b/include/zephyr/bluetooth/hci_vs.h @@ -222,6 +222,8 @@ struct bt_hci_evt_vs { uint8_t subevent; } __packed; +#define BT_HCI_EVT_VS_FATAL_ERROR 0x02 + #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_STACK_FRAME 0x01 #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_CTRL_ASSERT 0x02 #define BT_HCI_EVT_VS_ERROR_DATA_TYPE_TRACE 0x03 @@ -232,10 +234,8 @@ struct bt_hci_vs_fata_error_cpu_data_cortex_m { uint32_t a4; uint32_t ip; uint32_t lr; - uint32_t pc; uint32_t xpsr; } __packed; - #define BT_HCI_EVT_VS_ERROR_CPU_TYPE_CORTEX_M 0x01 struct bt_hci_vs_fatal_error_stack_frame { uint32_t reason; diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 7fd3c46fe35a..d6c7db02ea6e 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -1188,9 +1188,6 @@ rsource "Kconfig.df" rsource "Kconfig.ll_sw_split" rsource "Kconfig.dtm" -config BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE_SUPPORT - bool - config BT_CTLR_ASSERT_DEBUG bool "Development asserts" default y @@ -1212,18 +1209,6 @@ config BT_CTLR_ASSERT_HANDLER and will be invoked whenever the controller code encounters an unrecoverable error. -config BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE - bool "Assertions optimized for code size" - depends on BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE_SUPPORT - default y - help - Optimize Controller assertion check for code size. - - Example, reduces assertion check code size for ARM Cortex-M CPUs by using the undefined - instruction exception. - `arm-none-eabi-addr2line` commandline can be used to get the source file and line number - from the program counter value. - config BT_CTLR_VS_SCAN_REQ_RX bool "Use scan request reporting" depends on BT_HCI_VS && !BT_CTLR_ADV_EXT diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index e862034c2550..950e9bc7e58b 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -70,8 +70,6 @@ config BT_LLL_VENDOR_NORDIC select BT_TICKER_PREFER_START_BEFORE_STOP if BT_TICKER_SLOT_AGNOSTIC - select BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE_SUPPORT if CPU_CORTEX_M - default y help Use Nordic Lower Link Layer implementation. diff --git a/subsys/bluetooth/controller/hal/debug.h b/subsys/bluetooth/controller/hal/debug.h index 98e827534fe7..cb193a460971 100644 --- a/subsys/bluetooth/controller/hal/debug.h +++ b/subsys/bluetooth/controller/hal/debug.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2025 Nordic Semiconductor ASA + * Copyright (c) 2016 Nordic Semiconductor ASA * Copyright (c) 2016 Vinayak Kariappa Chettimada * * SPDX-License-Identifier: Apache-2.0 @@ -7,60 +7,25 @@ #include "common/assert.h" -#if defined(CONFIG_BT_CTLR_ASSERT_HANDLER) +#ifdef CONFIG_BT_CTLR_ASSERT_HANDLER void bt_ctlr_assert_handle(char *file, uint32_t line); - -#if defined(CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE) -BUILD_ASSERT(IS_ENABLED(CONFIG_CPU_CORTEX_M)); -/* Generate assertion as undefined instruction exception. - */ -#define LL_ASSERT(x) \ - do { \ - if (unlikely(!(x))) { \ - __asm__ inline volatile (".inst 0xde00\n"); \ - } \ - } while (0) - -#else /* !CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE */ -/* Generate assertion with file name and line number. - * NOTE: Variable code size increase per assertion check, depends on full file name path string - * length. - */ #define LL_ASSERT(cond) \ - if (unlikely(!(cond))) { \ + if (!(cond)) { \ BT_ASSERT_PRINT(cond); \ bt_ctlr_assert_handle(__FILE__, __LINE__); \ } -#endif /* !CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE */ - #define LL_ASSERT_MSG(cond, fmt, ...) \ - if (unlikely(!(cond))) { \ + if (!(cond)) { \ BT_ASSERT_PRINT(cond); \ BT_ASSERT_PRINT_MSG(fmt, ##__VA_ARGS__); \ bt_ctlr_assert_handle(__FILE__, __LINE__); \ } - -#else /* !CONFIG_BT_CTLR_ASSERT_HANDLER */ - -#if defined(CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE) -BUILD_ASSERT(IS_ENABLED(CONFIG_CPU_CORTEX_M)); -/* Generate assertion as undefined instruction exception. - */ -#define LL_ASSERT(x) \ - do { \ - if (unlikely(!(x))) { \ - __asm__ inline volatile (".inst 0xde00\n"); \ - } \ - } while (0) - -#else /* !CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE */ +#else #define LL_ASSERT(cond) \ BT_ASSERT(cond) -#endif /* !CONFIG_BT_CTLR_ASSERT_OPTIMIZE_FOR_SIZE */ - #define LL_ASSERT_MSG(cond, fmt, ...) \ BT_ASSERT_MSG(cond, fmt, ##__VA_ARGS__) -#endif /* !CONFIG_BT_CTLR_ASSERT_HANDLER */ +#endif /* Fatal asserts. * The Controller will otherwise misbehave causing memory leak or system-wide memory corruptions due diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 0e8a41260ccb..eaf4667a1b85 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -5284,7 +5284,6 @@ static void vs_err_fatal_cpu_data_fill(bt_hci_vs_fatal_error_cpu_data *cpu_data, cpu_data->a4 = sys_cpu_to_le32(esf->basic.a4); cpu_data->ip = sys_cpu_to_le32(esf->basic.ip); cpu_data->lr = sys_cpu_to_le32(esf->basic.lr); - cpu_data->pc = sys_cpu_to_le32(esf->basic.pc); cpu_data->xpsr = sys_cpu_to_le32(esf->basic.xpsr); } #endif /* CONFIG_CPU_CORTEX_M */ From 63f40f27ed5830b5f2022b2ec1fcf616c260f40b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1310/3334] Revert "[nrf fromtree] Bluetooth: Controller: Introduce LL_ASSERT_DBG/ERR" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b2452412474bf3094809cdbf0148636000083362. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/Kconfig | 12 - subsys/bluetooth/controller/hal/debug.h | 19 -- subsys/bluetooth/controller/hci/hci.c | 44 ++-- subsys/bluetooth/controller/hci/hci_driver.c | 55 +++-- subsys/bluetooth/controller/ll_sw/isoal.c | 44 ++-- subsys/bluetooth/controller/ll_sw/lll_chan.c | 206 +++++++++--------- .../bluetooth/controller/ll_sw/lll_common.c | 2 +- .../controller/ll_sw/nordic/hal/nrf5/cntr.c | 2 +- .../controller/ll_sw/nordic/hal/nrf5/ecb.c | 2 +- .../controller/ll_sw/nordic/hal/nrf5/mayfly.c | 6 +- .../controller/ll_sw/nordic/hal/nrf5/ticker.c | 16 +- .../controller/ll_sw/nordic/lll/lll.c | 80 +++---- .../controller/ll_sw/nordic/lll/lll_adv.c | 42 ++-- .../controller/ll_sw/nordic/lll/lll_adv_aux.c | 40 ++-- .../controller/ll_sw/nordic/lll/lll_adv_iso.c | 28 +-- .../ll_sw/nordic/lll/lll_adv_sync.c | 20 +- .../controller/ll_sw/nordic/lll/lll_central.c | 8 +- .../ll_sw/nordic/lll/lll_central_iso.c | 46 ++-- .../controller/ll_sw/nordic/lll/lll_conn.c | 30 +-- .../controller/ll_sw/nordic/lll/lll_df.c | 2 +- .../ll_sw/nordic/lll/lll_peripheral.c | 8 +- .../ll_sw/nordic/lll/lll_peripheral_iso.c | 44 ++-- .../controller/ll_sw/nordic/lll/lll_scan.c | 44 ++-- .../ll_sw/nordic/lll/lll_scan_aux.c | 48 ++-- .../controller/ll_sw/nordic/lll/lll_sync.c | 30 +-- .../ll_sw/nordic/lll/lll_sync_iso.c | 56 ++--- .../controller/ll_sw/nordic/lll/lll_test.c | 8 +- subsys/bluetooth/controller/ll_sw/ull.c | 110 +++++----- subsys/bluetooth/controller/ll_sw/ull_adv.c | 86 ++++---- .../bluetooth/controller/ll_sw/ull_adv_aux.c | 59 +++-- .../bluetooth/controller/ll_sw/ull_adv_iso.c | 63 +++--- .../bluetooth/controller/ll_sw/ull_adv_sync.c | 45 ++-- .../bluetooth/controller/ll_sw/ull_central.c | 42 ++-- .../controller/ll_sw/ull_central_iso.c | 32 +-- subsys/bluetooth/controller/ll_sw/ull_conn.c | 90 ++++---- .../bluetooth/controller/ll_sw/ull_conn_iso.c | 90 ++++---- subsys/bluetooth/controller/ll_sw/ull_df.c | 6 +- .../bluetooth/controller/ll_sw/ull_filter.c | 34 +-- subsys/bluetooth/controller/ll_sw/ull_iso.c | 64 +++--- subsys/bluetooth/controller/ll_sw/ull_llcp.c | 18 +- .../bluetooth/controller/ll_sw/ull_llcp_cc.c | 24 +- .../controller/ll_sw/ull_llcp_chmu.c | 6 +- .../controller/ll_sw/ull_llcp_common.c | 44 ++-- .../controller/ll_sw/ull_llcp_conn_upd.c | 28 +-- .../bluetooth/controller/ll_sw/ull_llcp_enc.c | 26 +-- .../controller/ll_sw/ull_llcp_local.c | 14 +- .../controller/ll_sw/ull_llcp_past.c | 6 +- .../bluetooth/controller/ll_sw/ull_llcp_phy.c | 34 +-- .../controller/ll_sw/ull_llcp_remote.c | 22 +- .../controller/ll_sw/ull_peripheral.c | 24 +- .../controller/ll_sw/ull_peripheral_iso.c | 17 +- subsys/bluetooth/controller/ll_sw/ull_scan.c | 36 +-- .../bluetooth/controller/ll_sw/ull_scan_aux.c | 205 +++++++++-------- subsys/bluetooth/controller/ll_sw/ull_sched.c | 6 +- subsys/bluetooth/controller/ll_sw/ull_sync.c | 52 ++--- .../bluetooth/controller/ll_sw/ull_sync_iso.c | 51 +++-- subsys/bluetooth/controller/ticker/ticker.c | 10 +- tests/bluetooth/init/prj_ctlr.conf | 1 - tests/bluetooth/init/prj_ctlr_dbg.conf | 1 - 59 files changed, 1118 insertions(+), 1170 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index d6c7db02ea6e..926fc060a89c 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -1188,18 +1188,6 @@ rsource "Kconfig.df" rsource "Kconfig.ll_sw_split" rsource "Kconfig.dtm" -config BT_CTLR_ASSERT_DEBUG - bool "Development asserts" - default y - help - This option enables development asserts used for code coverage. - - The Controller will continue to function without memory leak or corruption with these - assertion checks disabled. Example, run-time mis-aligned memory access etc. which do - otherwise implicitly cause CPU fault during development testing. But these type of - asserted are essentially required for debugging, code and unit test coverage during - development cycle. - config BT_CTLR_ASSERT_HANDLER bool "Application Defined Assertion Handler" help diff --git a/subsys/bluetooth/controller/hal/debug.h b/subsys/bluetooth/controller/hal/debug.h index cb193a460971..653aa304b070 100644 --- a/subsys/bluetooth/controller/hal/debug.h +++ b/subsys/bluetooth/controller/hal/debug.h @@ -27,25 +27,6 @@ void bt_ctlr_assert_handle(char *file, uint32_t line); BT_ASSERT_MSG(cond, fmt, ##__VA_ARGS__) #endif -/* Fatal asserts. - * The Controller will otherwise misbehave causing memory leak or system-wide memory corruptions due - * to uncontrolled DMA transfers etc. - * It is not safe to disable these assertion checks. - */ -#define LL_ASSERT_ERR(cond) LL_ASSERT(cond) - -/* Development asserts. - * The Controller will continue to function without memory leak or corruption with these assertion - * checks disabled. Example, run-time mis-aligned memory access etc. which do otherwise implicitly - * cause CPU fault during development testing. But these type of asserted are essentially required - * for debugging, code and unit test coverage during development cycle. - */ -#if defined(CONFIG_BT_CTLR_ASSERT_DEBUG) -#define LL_ASSERT_DBG(cond) LL_ASSERT(cond) -#else /* !CONFIG_BT_CTLR_ASSERT_DEBUG */ -#define LL_ASSERT_DBG(cond) ARG_UNUSED((cond)) -#endif /* !CONFIG_BT_CTLR_ASSERT_DEBUG */ - #if defined(CONFIG_BT_CTLR_ASSERT_VENDOR) #define LL_ASSERT_INFO1(cond, param) \ BT_ASSERT_VND(cond, param, 0) diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index eaf4667a1b85..683c4cadf919 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -3222,7 +3222,7 @@ static void le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct net_b phy_rx = lll->phy_rx; /* Make sure the report is generated for connection on PHY UNCODED */ - LL_ASSERT_DBG(phy_rx != PHY_CODED); + LL_ASSERT(phy_rx != PHY_CODED); #else phy_rx = PHY_1M; #endif /* CONFIG_BT_CTLR_PHY */ @@ -4412,7 +4412,7 @@ static void le_cis_request(struct pdu_data *pdu_data, * event. */ node = pdu_data; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_conn_iso_estab)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_conn_iso_estab)); req = node; if (!(ll_feat_get() & BIT64(BT_LE_FEAT_BIT_ISO_CHANNELS)) || @@ -4459,7 +4459,7 @@ static void le_cis_established(struct pdu_data *pdu_data, * event. */ node = pdu_data; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_conn_iso_estab)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_conn_iso_estab)); est = node; sep->status = est->status; @@ -4518,7 +4518,7 @@ static void le_per_adv_sync_transfer_received(struct pdu_data *pdu_data_rx, * event. */ node = pdu_data_rx; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_past_received)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_past_received)); se = node; sep->status = se->rx_sync.status; @@ -5520,7 +5520,7 @@ static void vs_le_df_connection_iq_report(struct node_rx_pdu *node_rx, struct ne phy_rx = lll->phy_rx; /* Make sure the report is generated for connection on PHY UNCODED */ - LL_ASSERT_DBG(phy_rx != PHY_CODED); + LL_ASSERT(phy_rx != PHY_CODED); #else phy_rx = PHY_1M; #endif /* CONFIG_BT_CTLR_PHY */ @@ -6300,7 +6300,7 @@ int hci_iso_handle(struct net_buf *buf, struct net_buf **evt) /* Start Fragmentation */ /* FIXME: need to ensure ISO-AL returns proper isoal_status. - * Currently there are cases where ISO-AL calls LL_ASSERT_ERR. + * Currently there are cases where ISO-AL calls LL_ASSERT. */ isoal_status_t isoal_status = isoal_tx_sdu_fragment(stream->dp->source_hdl, &sdu_frag_tx); @@ -6554,7 +6554,7 @@ static inline void le_dir_adv_report(struct pdu_adv *adv, struct net_buf *buf, return; } - LL_ASSERT_DBG(adv->type == PDU_ADV_TYPE_DIRECT_IND); + LL_ASSERT(adv->type == PDU_ADV_TYPE_DIRECT_IND); #if CONFIG_BT_CTLR_DUP_FILTER_LEN > 0 if (dup_scan && @@ -6624,7 +6624,7 @@ static inline void le_mesh_scan_report(struct pdu_adv *adv, uint32_t instant; uint8_t chan; - LL_ASSERT_DBG(adv->type == PDU_ADV_TYPE_NONCONN_IND); + LL_ASSERT(adv->type == PDU_ADV_TYPE_NONCONN_IND); /* Filter based on currently active Scan Filter */ if (sf_curr < ARRAY_SIZE(scan_filters) && @@ -7093,7 +7093,7 @@ static void ext_adv_pdu_frag(uint8_t evt_type, uint8_t phy, uint8_t sec_phy, *data_len_total -= data_len_frag; *evt_buf = bt_buf_get_rx(BT_BUF_EVT, BUF_GET_TIMEOUT); - LL_ASSERT_ERR(*evt_buf); + LL_ASSERT(*evt_buf); net_buf_frag_add(buf, *evt_buf); @@ -7630,7 +7630,7 @@ static void le_ext_adv_report(struct pdu_data *pdu_data, * event. */ evt_buf = bt_buf_get_rx(BT_BUF_EVT, BUF_GET_TIMEOUT); - LL_ASSERT_ERR(evt_buf); + LL_ASSERT(evt_buf); net_buf_frag_add(buf, evt_buf); @@ -7726,7 +7726,7 @@ static void le_per_adv_sync_established(struct pdu_data *pdu_data, * event. */ node = pdu_data; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_sync)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_sync)); se = node; sep->status = se->status; @@ -8006,7 +8006,7 @@ static void le_per_adv_sync_report(struct pdu_data *pdu_data, data_status = BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_PARTIAL; evt_buf = bt_buf_get_rx(BT_BUF_EVT, BUF_GET_TIMEOUT); - LL_ASSERT_ERR(evt_buf); + LL_ASSERT(evt_buf); net_buf_frag_add(buf, evt_buf); @@ -8062,7 +8062,7 @@ static void le_per_adv_sync_report(struct pdu_data *pdu_data, */ if (!evt_buf) { evt_buf = bt_buf_get_rx(BT_BUF_EVT, BUF_GET_TIMEOUT); - LL_ASSERT_ERR(evt_buf); + LL_ASSERT(evt_buf); net_buf_frag_add(buf, evt_buf); } @@ -8147,7 +8147,7 @@ static void le_big_sync_established(struct pdu_data *pdu, * established event. */ node = pdu; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_sync_iso)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_sync_iso)); se = node; sep->status = se->status; @@ -8451,7 +8451,7 @@ static void le_conn_complete(struct pdu_data *pdu_data, uint16_t handle, * complete event. */ node = pdu_data; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_cc)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_cc)); cc = node; status = cc->status; @@ -8588,7 +8588,7 @@ static void le_conn_update_complete(struct pdu_data *pdu_data, uint16_t handle, * update complete event. */ node = pdu_data; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_cu)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_cu)); cu = node; sep->status = cu->status; @@ -8845,7 +8845,7 @@ static void encode_control(struct node_rx_pdu *node_rx, #elif defined(CONFIG_BT_CTLR_VS_SCAN_REQ_RX) le_vs_scan_req_received(pdu_data, node_rx, buf); #else - LL_ASSERT_DBG(0); + LL_ASSERT(0); #endif /* CONFIG_BT_CTLR_ADV_EXT */ break; #endif /* CONFIG_BT_CTLR_SCAN_REQ_NOTIFY */ @@ -8984,7 +8984,7 @@ static void encode_control(struct node_rx_pdu *node_rx, #endif /* CONFIG_BT_CTLR_USER_EVT_RANGE > 0 */ default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); return; } } @@ -9212,7 +9212,7 @@ static void encode_data_ctrl(struct node_rx_pdu *node_rx, break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); return; } } @@ -9243,20 +9243,20 @@ void hci_acl_encode(struct node_rx_pdu *node_rx, struct net_buf *buf) memcpy(data, pdu_data->lldata, pdu_data->len); #if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) if (hci_hbuf_total > 0) { - LL_ASSERT_DBG((hci_hbuf_sent - hci_hbuf_acked) < + LL_ASSERT((hci_hbuf_sent - hci_hbuf_acked) < hci_hbuf_total); hci_hbuf_sent++; /* Note: This requires linear handle values starting * from 0 */ - LL_ASSERT_DBG(handle < ARRAY_SIZE(hci_hbuf_pend)); + LL_ASSERT(handle < ARRAY_SIZE(hci_hbuf_pend)); hci_hbuf_pend[handle]++; } #endif /* CONFIG_BT_HCI_ACL_FLOW_CONTROL */ break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } diff --git a/subsys/bluetooth/controller/hci/hci_driver.c b/subsys/bluetooth/controller/hci/hci_driver.c index 43b2ad1ef656..8f3fd04d8e9e 100644 --- a/subsys/bluetooth/controller/hci/hci_driver.c +++ b/subsys/bluetooth/controller/hci/hci_driver.c @@ -91,20 +91,21 @@ isoal_status_t sink_sdu_alloc_hci(const struct isoal_sink *sink_ctx, const struct isoal_pdu_rx *valid_pdu, struct isoal_sdu_buffer *sdu_buffer) { - struct net_buf *buf; - ARG_UNUSED(sink_ctx); ARG_UNUSED(valid_pdu); /* TODO copy valid pdu into netbuf ? */ - buf = bt_buf_get_rx(BT_BUF_ISO_IN, K_FOREVER); - LL_ASSERT_ERR(buf); + struct net_buf *buf = bt_buf_get_rx(BT_BUF_ISO_IN, K_FOREVER); - /* Increase reserved space for headers */ - net_buf_reset(buf); - net_buf_reserve(buf, BT_BUF_RESERVE + SDU_HCI_HDR_SIZE); - - sdu_buffer->dbuf = buf; - sdu_buffer->size = net_buf_tailroom(buf); + if (buf) { + /* Increase reserved space for headers */ + net_buf_reset(buf); + net_buf_reserve(buf, BT_BUF_RESERVE + SDU_HCI_HDR_SIZE); + + sdu_buffer->dbuf = buf; + sdu_buffer->size = net_buf_tailroom(buf); + } else { + LL_ASSERT(0); + } return ISOAL_STATUS_OK; } @@ -211,13 +212,11 @@ isoal_status_t sink_sdu_write_hci(void *dbuf, const uint8_t *pdu_payload, const size_t consume_len) { - struct net_buf *buf; - ARG_UNUSED(sdu_written); - buf = (struct net_buf *) dbuf; - LL_ASSERT_ERR(buf); + struct net_buf *buf = (struct net_buf *) dbuf; + LL_ASSERT(buf); net_buf_add_mem(buf, pdu_payload, consume_len); return ISOAL_STATUS_OK; @@ -365,7 +364,7 @@ static void prio_recv_thread(void *p1, void *p2, void *p3) LOG_DBG("Num Complete: 0x%04x:%u", handle, num_cmplt); err = bt_recv_prio(dev, buf); - LL_ASSERT_DBG(err == 0); + LL_ASSERT(err == 0); k_yield(); #endif /* CONFIG_BT_CONN || CONFIG_BT_CTLR_ADV_ISO */ @@ -393,7 +392,7 @@ static void prio_recv_thread(void *p1, void *p2, void *p3) } err = bt_recv_prio(dev, buf); - LL_ASSERT_DBG(err == 0); + LL_ASSERT(err == 0); /* bt_recv_prio would not release normal evt * buf. @@ -471,7 +470,7 @@ static void node_rx_recv(const struct device *dev) #if defined(CONFIG_BT_CONN) || defined(CONFIG_BT_CTLR_ADV_ISO) struct net_buf *buf; - LL_ASSERT_DBG(node_rx == NULL); + LL_ASSERT(node_rx == NULL); buf = bt_buf_get_evt(BT_HCI_EVT_NUM_COMPLETED_PACKETS, false, K_FOREVER); @@ -483,7 +482,7 @@ static void node_rx_recv(const struct device *dev) k_yield(); #else /* !CONFIG_BT_CONN && !CONFIG_BT_CTLR_ADV_ISO */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); #endif /* !CONFIG_BT_CONN && !CONFIG_BT_CTLR_ADV_ISO */ num_cmplt = ll_rx_get((void *)&node_rx, &handle); @@ -590,7 +589,7 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx, isoal_rx_pdu_recombine(dp->sink_hdl, &pckt_meta); /* TODO handle err */ - LL_ASSERT_ERR(err == ISOAL_STATUS_OK); + LL_ASSERT(err == ISOAL_STATUS_OK); } } #endif /* CONFIG_BT_CTLR_CONN_ISO */ @@ -614,13 +613,13 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx, isoal_rx.pdu = (void *)node_rx->pdu; err = isoal_rx_pdu_recombine(stream->dp->sink_hdl, &isoal_rx); - LL_ASSERT_ERR(err == ISOAL_STATUS_OK || - err == ISOAL_STATUS_ERR_SDU_ALLOC); + LL_ASSERT(err == ISOAL_STATUS_OK || + err == ISOAL_STATUS_ERR_SDU_ALLOC); } #endif /* CONFIG_BT_CTLR_SYNC_ISO */ } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } node_rx->hdr.next = NULL; @@ -631,7 +630,7 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx, #endif /* CONFIG_BT_CTLR_SYNC_ISO || CONFIG_BT_CTLR_CONN_ISO */ default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -669,7 +668,7 @@ static inline struct net_buf *process_node(struct node_rx_pdu *node_rx) } break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -742,7 +741,7 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n) case HCI_CLASS_EVT_DISCARDABLE: case HCI_CLASS_EVT_REQUIRED: default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -824,7 +823,7 @@ static void recv_thread(void *p1, void *p2, void *p3) int err; err = k_poll(events, ARRAY_SIZE(events), K_FOREVER); - LL_ASSERT_ERR(err == 0 || err == -EINTR); + LL_ASSERT(err == 0 || err == -EINTR); if (false) { @@ -836,7 +835,7 @@ static void recv_thread(void *p1, void *p2, void *p3) #if !defined(CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE) } else if (events[EVENT_SEM].state == K_POLL_STATE_SEM_AVAILABLE) { err = k_sem_take(events[EVENT_SEM].sem, K_NO_WAIT); - LL_ASSERT_DBG(err == 0); + LL_ASSERT(err == 0); node_rx_recv(dev); #endif /* !CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE */ @@ -1048,7 +1047,7 @@ static int hci_driver_close(const struct device *dev) /* Resetting the LL stops all roles */ err = ll_deinit(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #if defined(CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE) /* Abort prio RX thread */ diff --git a/subsys/bluetooth/controller/ll_sw/isoal.c b/subsys/bluetooth/controller/ll_sw/isoal.c index 9d2db83668d3..625edbbb63d7 100644 --- a/subsys/bluetooth/controller/ll_sw/isoal.c +++ b/subsys/bluetooth/controller/ll_sw/isoal.c @@ -151,8 +151,8 @@ static bool isoal_get_time_diff(uint32_t time_before, uint32_t time_after, uint3 { bool valid = false; - LL_ASSERT_DBG(time_before <= ISOAL_TIME_WRAPPING_POINT_US); - LL_ASSERT_DBG(time_after <= ISOAL_TIME_WRAPPING_POINT_US); + LL_ASSERT(time_before <= ISOAL_TIME_WRAPPING_POINT_US); + LL_ASSERT(time_after <= ISOAL_TIME_WRAPPING_POINT_US); if (time_before > time_after) { if (time_before >= ISOAL_TIME_MID_POINT_US && @@ -225,13 +225,13 @@ static void isoal_sink_deallocate(isoal_sink_handle_t hdl) if (hdl < ARRAY_SIZE(isoal_global.sink_allocated)) { isoal_global.sink_allocated[hdl] = ISOAL_ALLOC_STATE_FREE; } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } if (hdl < ARRAY_SIZE(isoal_global.sink_state)) { (void)memset(&isoal_global.sink_state[hdl], 0, sizeof(struct isoal_sink)); } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -350,7 +350,7 @@ isoal_status_t isoal_sink_create( session->sdu_sync_const = group_sync_delay; } } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } /* Remember the platform-specific callbacks */ @@ -378,7 +378,7 @@ void isoal_sink_enable(isoal_sink_handle_t hdl) /* Atomically enable */ isoal_global.sink_state[hdl].sdu_production.mode = ISOAL_PRODUCTION_MODE_ENABLED; } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -392,7 +392,7 @@ void isoal_sink_disable(isoal_sink_handle_t hdl) /* Atomically disable */ isoal_global.sink_state[hdl].sdu_production.mode = ISOAL_PRODUCTION_MODE_DISABLED; } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -441,7 +441,7 @@ static isoal_status_t isoal_rx_allocate_sdu(struct isoal_sink *sink, /* Nothing has been written into buffer yet */ sp->sdu_written = 0; sp->sdu_available = sdu->contents.size; - LL_ASSERT_ERR(sdu->contents.size > 0); + LL_ASSERT(sdu->contents.size > 0); /* Get seq number from session counter */ sdu->sn = session->sn; @@ -568,7 +568,7 @@ static isoal_status_t isoal_rx_buffered_emit_sdu(struct isoal_sink *sink, bool e #endif /* ISOAL_BUFFER_RX_SDUS_ENABLE */ } else { /* Unreachable */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } return err; @@ -653,6 +653,7 @@ static isoal_status_t isoal_rx_append_to_sdu(struct isoal_sink *sink, handle_error_case = (is_end_fragment && (packet_available == 0)); pdu_payload = pdu_meta->pdu->payload + offset; + LL_ASSERT(pdu_payload); /* While there is something left of the packet to consume */ err = ISOAL_STATUS_OK; @@ -879,7 +880,7 @@ static isoal_status_t isoal_rx_unframed_consume(struct isoal_sink *sink, /* Unsupported case */ err = ISOAL_STATUS_ERR_UNSPECIFIED; LOG_ERR("Invalid unframed LLID (%d)", llid); - LL_ASSERT_ERR(0); + LL_ASSERT(0); } break; @@ -1458,8 +1459,7 @@ static void isoal_source_deallocate(isoal_source_handle_t hdl) if (hdl < ARRAY_SIZE(isoal_global.source_state)) { source = &isoal_global.source_state[hdl]; } else { - LL_ASSERT_DBG(0); - + LL_ASSERT(0); return; } @@ -1477,7 +1477,7 @@ static void isoal_source_deallocate(isoal_source_handle_t hdl) if (hdl < ARRAY_SIZE(isoal_global.source_allocated)) { isoal_global.source_allocated[hdl] = ISOAL_ALLOC_STATE_FREE; } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } (void)memset(source, 0, sizeof(struct isoal_source)); @@ -1594,7 +1594,7 @@ void isoal_source_enable(isoal_source_handle_t hdl) /* Atomically enable */ isoal_global.source_state[hdl].pdu_production.mode = ISOAL_PRODUCTION_MODE_ENABLED; } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -1608,7 +1608,7 @@ void isoal_source_disable(isoal_source_handle_t hdl) /* Atomically disable */ isoal_global.source_state[hdl].pdu_production.mode = ISOAL_PRODUCTION_MODE_DISABLED; } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -1770,7 +1770,7 @@ static isoal_status_t isoal_tx_allocate_pdu(struct isoal_source *source, pp->pdu_written = 0; pp->pdu_available = available_len; pp->pdu_allocated = 1U; - LL_ASSERT_ERR(available_len > 0); + LL_ASSERT(available_len > 0); pp->pdu_cnt++; } @@ -1982,7 +1982,7 @@ static isoal_status_t isoal_tx_unframed_produce(isoal_source_handle_t source_hdl packet_available = tx_sdu->size; sdu_payload = tx_sdu->dbuf; - LL_ASSERT_DBG(sdu_payload); + LL_ASSERT(sdu_payload); zero_length_sdu = (packet_available == 0 && tx_sdu->sdu_state == BT_ISO_SINGLE); @@ -2468,12 +2468,12 @@ static uint16_t isoal_tx_framed_find_correct_tx_event(const struct isoal_source time_diff_valid = isoal_get_time_diff(time_stamp_selected, actual_grp_ref_point, &time_diff); - LL_ASSERT_DBG(time_diff_valid); - LL_ASSERT_DBG(time_diff > 0); + LL_ASSERT(time_diff_valid); + LL_ASSERT(time_diff > 0); /* Time difference must be less than the maximum possible * time-offset of 24-bits. */ - LL_ASSERT_DBG(time_diff <= 0x00FFFFFF); + LL_ASSERT(time_diff <= 0x00FFFFFF); } *payload_number = next_payload_number; @@ -2514,7 +2514,7 @@ static isoal_status_t isoal_tx_framed_produce(isoal_source_handle_t source_hdl, packet_available = tx_sdu->size; sdu_payload = tx_sdu->dbuf; - LL_ASSERT_DBG(sdu_payload); + LL_ASSERT(sdu_payload); zero_length_sdu = (packet_available == 0 && tx_sdu->sdu_state == BT_ISO_SINGLE); @@ -2791,7 +2791,7 @@ static isoal_status_t isoal_tx_framed_event_prepare_handle(isoal_source_handle_t } /* Not possible to recover if allocation or emit fails here*/ - LL_ASSERT_ERR(!(err || err_alloc)); + LL_ASSERT(!(err || err_alloc)); if (pp->payload_number < last_event_payload + 1ULL) { pp->payload_number = last_event_payload + 1ULL; diff --git a/subsys/bluetooth/controller/ll_sw/lll_chan.c b/subsys/bluetooth/controller/ll_sw/lll_chan.c index e45134144b64..213fce38a8f5 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_chan.c +++ b/subsys/bluetooth/controller/ll_sw/lll_chan.c @@ -349,39 +349,39 @@ void lll_chan_sel_2_ut(void) /* Tests when ISO not supported */ /* Section 3.1 Sample Data 1 (37 used channels) */ m = lll_chan_sel_2(0U, chan_id, chan_map_1, chan_map_1_37_used); - LL_ASSERT_ERR(m == 25U); + LL_ASSERT(m == 25U); m = lll_chan_sel_2(1U, chan_id, chan_map_1, chan_map_1_37_used); - LL_ASSERT_ERR(m == 20U); + LL_ASSERT(m == 20U); m = lll_chan_sel_2(2U, chan_id, chan_map_1, chan_map_1_37_used); - LL_ASSERT_ERR(m == 6U); + LL_ASSERT(m == 6U); m = lll_chan_sel_2(3U, chan_id, chan_map_1, chan_map_1_37_used); - LL_ASSERT_ERR(m == 21U); + LL_ASSERT(m == 21U); /* Section 3.2 Sample Data 2 (9 used channels) */ m = lll_chan_sel_2(6U, chan_id, chan_map_2, chan_map_2_9_used); - LL_ASSERT_ERR(m == 23U); + LL_ASSERT(m == 23U); m = lll_chan_sel_2(7U, chan_id, chan_map_2, chan_map_2_9_used); - LL_ASSERT_ERR(m == 9U); + LL_ASSERT(m == 9U); m = lll_chan_sel_2(8U, chan_id, chan_map_2, chan_map_2_9_used); - LL_ASSERT_ERR(m == 34U); + LL_ASSERT(m == 34U); /* FIXME: Use Sample Data from Spec, if one is added. * Below is a random sample to cover implementation in this file. */ /* Section x.x Sample Data 3 (2 used channels) */ m = lll_chan_sel_2(11U, chan_id, chan_map_3, chan_map_3_2_used); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT(m == 1U); m = lll_chan_sel_2(12U, chan_id, chan_map_3, chan_map_3_2_used); - LL_ASSERT_ERR(m == 2U); + LL_ASSERT(m == 2U); m = lll_chan_sel_2(13U, chan_id, chan_map_3, chan_map_3_2_used); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT(m == 1U); #if defined(CONFIG_BT_CTLR_ISO) uint16_t prn_subevent_lu; @@ -393,164 +393,164 @@ void lll_chan_sel_2_ut(void) prn_s = 56857U ^ chan_id; prn_subevent_lu = prn_s; prn_subevent_se = chan_prn_subevent_se(chan_id, &prn_subevent_lu); - LL_ASSERT_ERR(prn_subevent_se == 11710U); + LL_ASSERT(prn_subevent_se == 11710U); /* BIS subevent 3, event counter 0 */ prn_subevent_se = chan_prn_subevent_se(chan_id, &prn_subevent_lu); - LL_ASSERT_ERR(prn_subevent_se == 16649U); + LL_ASSERT(prn_subevent_se == 16649U); /* BIS subevent 4, event counter 0 */ prn_subevent_se = chan_prn_subevent_se(chan_id, &prn_subevent_lu); - LL_ASSERT_ERR(prn_subevent_se == 38198U); + LL_ASSERT(prn_subevent_se == 38198U); /* Section 3.1 Sample Data 1 (37 used channels) */ /* BIS subevent 1, event counter 0 */ m = lll_chan_iso_event(0U, chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 56857U); - LL_ASSERT_ERR(m == 25U); - LL_ASSERT_ERR(remap_idx == 25U); + LL_ASSERT((prn_s ^ chan_id) == 56857U); + LL_ASSERT(m == 25U); + LL_ASSERT(remap_idx == 25U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 1U); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT(remap_idx == 1U); + LL_ASSERT(m == 1U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 16U); - LL_ASSERT_ERR(m == 16U); + LL_ASSERT(remap_idx == 16U); + LL_ASSERT(m == 16U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 36U); - LL_ASSERT_ERR(m == 36U); + LL_ASSERT(remap_idx == 36U); + LL_ASSERT(m == 36U); /* BIS subevent 1, event counter 1 */ m = lll_chan_iso_event(1U, chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 1685U); - LL_ASSERT_ERR(m == 20U); - LL_ASSERT_ERR(remap_idx == 20U); + LL_ASSERT((prn_s ^ chan_id) == 1685U); + LL_ASSERT(m == 20U); + LL_ASSERT(remap_idx == 20U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 36U); - LL_ASSERT_ERR(m == 36U); + LL_ASSERT(remap_idx == 36U); + LL_ASSERT(m == 36U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 12U); - LL_ASSERT_ERR(m == 12U); + LL_ASSERT(remap_idx == 12U); + LL_ASSERT(m == 12U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 34U); - LL_ASSERT_ERR(m == 34U); + LL_ASSERT(remap_idx == 34U); + LL_ASSERT(m == 34U); /* BIS subevent 1, event counter 2 */ m = lll_chan_iso_event(2U, chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 38301U); - LL_ASSERT_ERR(m == 6U); - LL_ASSERT_ERR(remap_idx == 6U); + LL_ASSERT((prn_s ^ chan_id) == 38301U); + LL_ASSERT(m == 6U); + LL_ASSERT(remap_idx == 6U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 18U); - LL_ASSERT_ERR(m == 18U); + LL_ASSERT(remap_idx == 18U); + LL_ASSERT(m == 18U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 32U); - LL_ASSERT_ERR(m == 32U); + LL_ASSERT(remap_idx == 32U); + LL_ASSERT(m == 32U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 21U); - LL_ASSERT_ERR(m == 21U); + LL_ASSERT(remap_idx == 21U); + LL_ASSERT(m == 21U); /* BIS subevent 1, event counter 3 */ m = lll_chan_iso_event(3U, chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 27475U); - LL_ASSERT_ERR(m == 21U); - LL_ASSERT_ERR(remap_idx == 21U); + LL_ASSERT((prn_s ^ chan_id) == 27475U); + LL_ASSERT(m == 21U); + LL_ASSERT(remap_idx == 21U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 4U); - LL_ASSERT_ERR(m == 4U); + LL_ASSERT(remap_idx == 4U); + LL_ASSERT(m == 4U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 22U); - LL_ASSERT_ERR(m == 22U); + LL_ASSERT(remap_idx == 22U); + LL_ASSERT(m == 22U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_1, chan_map_1_37_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 8U); - LL_ASSERT_ERR(m == 8U); + LL_ASSERT(remap_idx == 8U); + LL_ASSERT(m == 8U); /* Section 3.2 Sample Data 2 (9 used channels) */ /* BIS subevent 1, event counter 6 */ m = lll_chan_iso_event(6U, chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 10975U); - LL_ASSERT_ERR(remap_idx == 4U); - LL_ASSERT_ERR(m == 23U); + LL_ASSERT((prn_s ^ chan_id) == 10975U); + LL_ASSERT(remap_idx == 4U); + LL_ASSERT(m == 23U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 7U); - LL_ASSERT_ERR(m == 35U); + LL_ASSERT(remap_idx == 7U); + LL_ASSERT(m == 35U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 2U); - LL_ASSERT_ERR(m == 21U); + LL_ASSERT(remap_idx == 2U); + LL_ASSERT(m == 21U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 8U); - LL_ASSERT_ERR(m == 36U); + LL_ASSERT(remap_idx == 8U); + LL_ASSERT(m == 36U); /* BIS subevent 1, event counter 7 */ m = lll_chan_iso_event(7U, chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 5490U); - LL_ASSERT_ERR(remap_idx == 0U); - LL_ASSERT_ERR(m == 9U); + LL_ASSERT((prn_s ^ chan_id) == 5490U); + LL_ASSERT(remap_idx == 0U); + LL_ASSERT(m == 9U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 3U); - LL_ASSERT_ERR(m == 22U); + LL_ASSERT(remap_idx == 3U); + LL_ASSERT(m == 22U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 8U); - LL_ASSERT_ERR(m == 36U); + LL_ASSERT(remap_idx == 8U); + LL_ASSERT(m == 36U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 5U); - LL_ASSERT_ERR(m == 33U); + LL_ASSERT(remap_idx == 5U); + LL_ASSERT(m == 33U); /* BIS subevent 1, event counter 8 */ m = lll_chan_iso_event(8U, chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 46970U); - LL_ASSERT_ERR(remap_idx == 6U); - LL_ASSERT_ERR(m == 34U); + LL_ASSERT((prn_s ^ chan_id) == 46970U); + LL_ASSERT(remap_idx == 6U); + LL_ASSERT(m == 34U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 0U); - LL_ASSERT_ERR(m == 9U); + LL_ASSERT(remap_idx == 0U); + LL_ASSERT(m == 9U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 5U); - LL_ASSERT_ERR(m == 33U); + LL_ASSERT(remap_idx == 5U); + LL_ASSERT(m == 33U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_2, chan_map_2_9_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 1U); - LL_ASSERT_ERR(m == 10U); + LL_ASSERT(remap_idx == 1U); + LL_ASSERT(m == 10U); /* FIXME: Use Sample Data from Spec, if one is added. * Below is a random sample to cover implementation in this file. @@ -558,66 +558,66 @@ void lll_chan_sel_2_ut(void) /* Section x.x Sample Data 3 (2 used channels) */ /* BIS subevent 1, event counter 11 */ m = lll_chan_iso_event(11U, chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 8628U); - LL_ASSERT_ERR(remap_idx == 0U); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT((prn_s ^ chan_id) == 8628U); + LL_ASSERT(remap_idx == 0U); + LL_ASSERT(m == 1U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 1U); - LL_ASSERT_ERR(m == 2U); + LL_ASSERT(remap_idx == 1U); + LL_ASSERT(m == 2U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 0U); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT(remap_idx == 0U); + LL_ASSERT(m == 1U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 1U); - LL_ASSERT_ERR(m == 2U); + LL_ASSERT(remap_idx == 1U); + LL_ASSERT(m == 2U); /* BIS subevent 1, event counter 12 */ m = lll_chan_iso_event(12U, chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 34748U); - LL_ASSERT_ERR(remap_idx == 1U); - LL_ASSERT_ERR(m == 2U); + LL_ASSERT((prn_s ^ chan_id) == 34748U); + LL_ASSERT(remap_idx == 1U); + LL_ASSERT(m == 2U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 0U); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT(remap_idx == 0U); + LL_ASSERT(m == 1U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 1U); - LL_ASSERT_ERR(m == 2U); + LL_ASSERT(remap_idx == 1U); + LL_ASSERT(m == 2U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 0U); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT(remap_idx == 0U); + LL_ASSERT(m == 1U); /* BIS subevent 1, event counter 13 */ m = lll_chan_iso_event(13U, chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR((prn_s ^ chan_id) == 22072U); - LL_ASSERT_ERR(remap_idx == 0U); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT((prn_s ^ chan_id) == 22072U); + LL_ASSERT(remap_idx == 0U); + LL_ASSERT(m == 1U); /* BIS subvent 2 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 1U); - LL_ASSERT_ERR(m == 2U); + LL_ASSERT(remap_idx == 1U); + LL_ASSERT(m == 2U); /* BIS subvent 3 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 0U); - LL_ASSERT_ERR(m == 1U); + LL_ASSERT(remap_idx == 0U); + LL_ASSERT(m == 1U); /* BIS subvent 4 */ m = lll_chan_iso_subevent(chan_id, chan_map_3, chan_map_3_2_used, &prn_s, &remap_idx); - LL_ASSERT_ERR(remap_idx == 1U); - LL_ASSERT_ERR(m == 2U); + LL_ASSERT(remap_idx == 1U); + LL_ASSERT(m == 2U); #endif /* CONFIG_BT_CTLR_ISO */ } diff --git a/subsys/bluetooth/controller/ll_sw/lll_common.c b/subsys/bluetooth/controller/ll_sw/lll_common.c index 96861aa72010..c6c561dbb76d 100644 --- a/subsys/bluetooth/controller/ll_sw/lll_common.c +++ b/subsys/bluetooth/controller/ll_sw/lll_common.c @@ -77,7 +77,7 @@ void lll_resume(void *param) next = param; err = lll_prepare_resolve(next->is_abort_cb, next->abort_cb, next->prepare_cb, &next->prepare_param, next->is_resume, 1U); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } #if defined(CONFIG_BT_CTLR_JIT_SCHEDULING) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cntr.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cntr.c index ba6487b53534..eb1116c987f7 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cntr.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cntr.c @@ -110,7 +110,7 @@ uint32_t cntr_start(void) uint32_t cntr_stop(void) { - LL_ASSERT_ERR(_refcount); + LL_ASSERT(_refcount); if (--_refcount) { return 1; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ecb.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ecb.c index 38b70c491d7d..2398bdc44fd7 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ecb.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ecb.c @@ -225,7 +225,7 @@ static void isr_ecb(const void *arg) } else { - LL_ASSERT_DBG(false); + LL_ASSERT(false); } } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/mayfly.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/mayfly.c index 73408b234544..531cbd5b2412 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/mayfly.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/mayfly.c @@ -42,7 +42,7 @@ void mayfly_enable_cb(uint8_t caller_id, uint8_t callee_id, uint8_t enable) break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -62,7 +62,7 @@ uint32_t mayfly_is_enabled(uint8_t caller_id, uint8_t callee_id) return irq_is_enabled(HAL_SWI_JOB_IRQ); default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -120,7 +120,7 @@ void mayfly_pend(uint8_t caller_id, uint8_t callee_id) break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ticker.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ticker.c index e46ba7f6f62f..9ebafae2e9c4 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ticker.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/ticker.c @@ -38,10 +38,10 @@ uint8_t hal_ticker_instance0_caller_id_get(uint8_t user_id) { uint8_t caller_id; - LL_ASSERT_DBG(user_id < sizeof(caller_id_lut)); + LL_ASSERT(user_id < sizeof(caller_id_lut)); caller_id = caller_id_lut[user_id]; - LL_ASSERT_DBG(caller_id != TICKER_CALL_ID_NONE); + LL_ASSERT(caller_id != TICKER_CALL_ID_NONE); return caller_id; } @@ -73,7 +73,7 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; @@ -96,7 +96,7 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; @@ -119,7 +119,7 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; @@ -157,7 +157,7 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; @@ -181,13 +181,13 @@ void hal_ticker_instance0_sched(uint8_t caller_id, uint8_t callee_id, uint8_t ch break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 6a61c0c6605d..b44847c05850 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -461,7 +461,7 @@ void lll_disable(void *param) if (event.curr.abort_cb && event.curr.param) { event.curr.abort_cb(NULL, event.curr.param); } else { - LL_ASSERT_ERR(!param); + LL_ASSERT(!param); } } { @@ -519,12 +519,12 @@ int lll_done(void *param) /* Assert if param supplied without a pending prepare to cancel. */ next = ull_prepare_dequeue_get(); - LL_ASSERT_ERR(!param || next); + LL_ASSERT(!param || next); /* check if current LLL event is done */ if (!param) { /* Reset current event instance */ - LL_ASSERT_ERR(event.curr.abort_cb); + LL_ASSERT(event.curr.abort_cb); event.curr.abort_cb = NULL; param = event.curr.param; @@ -567,7 +567,7 @@ int lll_done(void *param) lll_done_score(param, result); extra = ull_event_done_extra_get(); - LL_ASSERT_ERR(extra); + LL_ASSERT(extra); /* Set result in done extra data - type was set by the role */ extra->result = result; @@ -575,7 +575,7 @@ int lll_done(void *param) /* Let ULL know about LLL event done */ evdone = ull_event_done(ull); - LL_ASSERT_ERR(evdone); + LL_ASSERT(evdone); return 0; } @@ -583,7 +583,7 @@ int lll_done(void *param) #if defined(CONFIG_BT_CTLR_LOW_LAT_ULL_DONE) void lll_done_ull_inc(void) { - LL_ASSERT_ERR(event.done.ull_count != event.done.lll_count); + LL_ASSERT(event.done.ull_count != event.done.lll_count); event.done.ull_count++; } #endif /* CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */ @@ -623,7 +623,7 @@ void lll_abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); lll_done(param); } @@ -681,7 +681,7 @@ void lll_chan_set(uint32_t chan) } else if (chan < 40) { radio_freq_chan_set(28 + ((chan - 11) * 2U)); } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } break; } @@ -805,7 +805,7 @@ void lll_isr_cleanup(void *param) radio_stop(); err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); lll_done(NULL); } @@ -822,7 +822,7 @@ void lll_isr_early_abort(void *param) } err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); lll_done(NULL); } @@ -900,7 +900,7 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, /* Store the next prepare for deferred call */ next = ull_prepare_enqueue(is_abort_cb, abort_cb, prepare_param, prepare_cb, is_resume); - LL_ASSERT_ERR(next); + LL_ASSERT(next); #if !defined(CONFIG_BT_CTLR_LOW_LAT) if (is_resume || prepare_param->defer) { @@ -918,8 +918,8 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, /* Start the preempt timeout */ ret = preempt_ticker_start(first, ready, next); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); #else /* CONFIG_BT_CTLR_LOW_LAT */ next = NULL; @@ -941,7 +941,7 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, /* check if resume requested by curr */ err = event.curr.is_abort_cb(NULL, event.curr.param, &resume_cb); - LL_ASSERT_DBG(err); + LL_ASSERT(err); if (err == -EAGAIN) { void *curr_param; @@ -954,9 +954,9 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, next = resume_enqueue(event.curr.is_abort_cb, event.curr.abort_cb, resume_cb, curr_param); - LL_ASSERT_ERR(next); + LL_ASSERT(next); } else { - LL_ASSERT_ERR(err == -ECANCELED); + LL_ASSERT(err == -ECANCELED); } } #endif /* CONFIG_BT_CTLR_LOW_LAT */ @@ -964,7 +964,7 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, return -EINPROGRESS; } - LL_ASSERT_ERR(!ready || &ready->prepare_param == prepare_param); + LL_ASSERT(!ready || &ready->prepare_param == prepare_param); event.curr.param = prepare_param->param; event.curr.is_abort_cb = is_abort_cb; @@ -996,8 +996,8 @@ int lll_prepare_resolve(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb, /* Start the preempt timeout */ ret = preempt_ticker_start(next, NULL, next); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); #endif /* !CONFIG_BT_CTLR_LOW_LAT */ return err; @@ -1012,7 +1012,7 @@ static int init_reset(void) static inline void done_inc(void) { event.done.lll_count++; - LL_ASSERT_ERR(event.done.lll_count != event.done.ull_count); + LL_ASSERT(event.done.lll_count != event.done.ull_count); } #endif /* CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */ @@ -1066,7 +1066,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(preempt_stop_req != preempt_stop_ack); + LL_ASSERT(preempt_stop_req != preempt_stop_ack); preempt_stop_ack = preempt_stop_req; /* We do not fail on status not being success because under scenarios @@ -1077,7 +1077,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) * safe to reset preempt_req and preempt_ack here. */ if (status == TICKER_STATUS_SUCCESS) { - LL_ASSERT_ERR(preempt_req != preempt_ack); + LL_ASSERT(preempt_req != preempt_ack); } preempt_req = preempt_ack; @@ -1086,18 +1086,18 @@ static void ticker_stop_op_cb(uint32_t status, void *param) static void ticker_start_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); /* Increase preempt requested count before acknowledging that the * ticker start operation for the preempt timeout has been handled. */ - LL_ASSERT_ERR(preempt_req == preempt_ack); + LL_ASSERT(preempt_req == preempt_ack); preempt_req++; /* Increase preempt start ack count, to acknowledge that the ticker * start operation has been handled. */ - LL_ASSERT_ERR(preempt_start_req != preempt_start_ack); + LL_ASSERT(preempt_start_req != preempt_start_ack); preempt_start_ack = preempt_start_req; } @@ -1141,8 +1141,8 @@ static uint32_t preempt_ticker_start(struct lll_event *first, /* Stop any scheduled preempt ticker */ ret = preempt_ticker_stop(); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); /* Schedule short preempt timeout */ first = next; @@ -1196,8 +1196,8 @@ static uint32_t preempt_ticker_stop(void) TICKER_USER_ID_LLL, TICKER_ID_LLL_PREEMPT, ticker_stop_op_cb, NULL); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); return ret; } @@ -1210,13 +1210,13 @@ static void preempt_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, static struct mayfly mfy = {0, 0, &link, NULL, preempt}; uint32_t ret; - LL_ASSERT_ERR(preempt_ack != preempt_req); + LL_ASSERT(preempt_ack != preempt_req); preempt_ack = preempt_req; mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void preempt(void *param) @@ -1287,8 +1287,8 @@ static void preempt(void *param) /* Start the preempt timeout for (short) ready event */ ret = preempt_ticker_start(ready, NULL, ready); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); return; } @@ -1322,7 +1322,7 @@ static void preempt(void *param) return; } - LL_ASSERT_ERR(ready->prepare_param.param == param); + LL_ASSERT(ready->prepare_param.param == param); } /* Check if current event want to continue */ @@ -1345,8 +1345,8 @@ static void preempt(void *param) /* Start the preempt timeout for next ready prepare */ ret = preempt_ticker_start(ready, NULL, ready); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } else { /* Let preemptor LLL know about the cancelled prepare */ @@ -1416,9 +1416,9 @@ static void preempt(void *param) /* Enqueue as resume event */ iter = resume_enqueue(is_abort_cb, abort_cb, resume_cb, curr_param); - LL_ASSERT_ERR(iter); + LL_ASSERT(iter); } else { - LL_ASSERT_ERR(err == -ECANCELED); + LL_ASSERT(err == -ECANCELED); } } #else /* CONFIG_BT_CTLR_LOW_LAT */ @@ -1432,8 +1432,8 @@ static void mfy_ticker_job_idle_get(void *param) ret = ticker_job_idle_get(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_LOW, ticker_op_job_disable, NULL); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } static void ticker_op_job_disable(uint32_t status, void *op_context) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c index 8c7837bf9805..5d1d89712619 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c @@ -435,12 +435,12 @@ struct pdu_adv *lll_adv_pdu_alloc_pdu_adv(void) } err = k_sem_take(&sem_pdu_free, PDU_FREE_TIMEOUT); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); k_sem_reset(&sem_pdu_free); p = MFIFO_DEQUEUE(pdu_free); - LL_ASSERT_ERR(p); + LL_ASSERT(p); #if defined(CONFIG_BT_CTLR_ADV_PDU_LINK) PDU_ADV_NEXT_PTR(p) = NULL; @@ -681,10 +681,10 @@ void lll_adv_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } bool lll_adv_scan_req_check(struct lll_adv *lll, struct pdu_adv *sr, @@ -836,7 +836,7 @@ static void *adv_extra_data_allocate(struct lll_adv_pdu *pdu, uint8_t last) extra_data = MFIFO_DEQUEUE_PEEK(extra_data_free); if (extra_data) { err = k_sem_take(&sem_extra_data_free, K_NO_WAIT); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); MFIFO_DEQUEUE(extra_data_free); pdu->extra_data[last] = extra_data; @@ -852,10 +852,10 @@ static void *adv_extra_data_allocate(struct lll_adv_pdu *pdu, uint8_t last) } err = k_sem_take(&sem_extra_data_free, PDU_FREE_TIMEOUT); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); extra_data = MFIFO_DEQUEUE(extra_data_free); - LL_ASSERT_ERR(extra_data); + LL_ASSERT(extra_data); pdu->extra_data[last] = (void *)extra_data; @@ -913,7 +913,7 @@ static void extra_data_free_sem_give(void) retval = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!retval); + LL_ASSERT(!retval); } #else /* !CONFIG_BT_CTLR_ZLI */ @@ -1062,7 +1062,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_A(1); @@ -1102,7 +1102,7 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) /* Retain HF clk */ err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); return -EAGAIN; #endif /* CONFIG_BT_PERIPHERAL */ @@ -1140,7 +1140,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); lll_done(param); } @@ -1178,7 +1178,7 @@ static void isr_tx(void *param) /* setup Rx buffer */ node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ @@ -1186,7 +1186,7 @@ static void isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1426,7 +1426,7 @@ static void isr_done(void *param) struct event_done_extra *extra; extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_ADV); - LL_ASSERT_ERR(extra); + LL_ASSERT(extra); } #endif /* CONFIG_BT_CTLR_ADV_EXT || CONFIG_BT_CTLR_JIT_SCHEDULING */ @@ -1464,7 +1464,7 @@ static void isr_abort_all(void *param) /* Abort any LLL prepare/resume enqueued in pipeline */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_LLL, 1U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } #endif /* CONFIG_BT_PERIPHERAL */ @@ -1475,7 +1475,7 @@ static struct pdu_adv *chan_prepare(struct lll_adv *lll) uint8_t upd; chan = find_lsb_set(lll->chan_map_curr); - LL_ASSERT_DBG(chan); + LL_ASSERT(chan); lll->chan_map_curr &= (lll->chan_map_curr - 1); @@ -1484,7 +1484,7 @@ static struct pdu_adv *chan_prepare(struct lll_adv *lll) /* FIXME: get latest only when primary PDU without Aux PDUs */ upd = 0U; pdu = lll_adv_data_latest_get(lll, &upd); - LL_ASSERT_DBG(pdu); + LL_ASSERT(pdu); radio_pkt_tx_set(pdu); @@ -1494,7 +1494,7 @@ static struct pdu_adv *chan_prepare(struct lll_adv *lll) struct pdu_adv *scan_pdu; scan_pdu = lll_adv_scan_rsp_latest_get(lll, &upd); - LL_ASSERT_DBG(scan_pdu); + LL_ASSERT(scan_pdu); #if defined(CONFIG_BT_CTLR_PRIVACY) if (upd) { @@ -1551,7 +1551,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, #endif /* CONFIG_BT_CTLR_PRIVACY */ node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu_rx = (void *)node_rx->pdu; pdu_adv = lll_adv_data_curr_get(lll); @@ -1580,7 +1580,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1656,7 +1656,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c index f4b48cabab9c..c4ee5af14b1d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c @@ -104,10 +104,10 @@ void lll_adv_aux_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); err = lll_prepare(lll_is_abort_cb, lll_abort_cb, prepare_cb, 0, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } void lll_adv_aux_pback_prepare(void *param) @@ -143,7 +143,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* FIXME: get latest only when primary PDU without Aux PDUs */ upd = 0U; sec_pdu = lll_adv_aux_data_latest_get(lll, &upd); - LL_ASSERT_DBG(sec_pdu); + LL_ASSERT(sec_pdu); #if defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) struct ll_adv_aux_set *aux; @@ -163,14 +163,14 @@ static int prepare_cb(struct lll_prepare_param *p) /* Get reference to primary PDU */ pri_pdu = lll_adv_data_curr_get(lll_adv); - LL_ASSERT_DBG(pri_pdu->type == PDU_ADV_TYPE_EXT_IND); + LL_ASSERT(pri_pdu->type == PDU_ADV_TYPE_EXT_IND); /* Get reference to common extended header */ com_hdr = (void *)&pri_pdu->adv_ext_ind; /* Get reference to aux pointer structure */ err = aux_ptr_get(pri_pdu, &aux_ptr); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* Abort if no aux_ptr filled */ if (unlikely(!aux_ptr || !PDU_ADV_AUX_PTR_OFFSET_GET(aux_ptr))) { @@ -218,7 +218,7 @@ static int prepare_cb(struct lll_prepare_param *p) struct pdu_adv *scan_pdu; scan_pdu = lll_adv_scan_rsp_latest_get(lll_adv, &upd); - LL_ASSERT_DBG(scan_pdu); + LL_ASSERT(scan_pdu); radio_isr_set(isr_tx_rx, lll); radio_tmr_tifs_set(EVENT_IFS_US); @@ -340,7 +340,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_ADV_AUX_PDU_BACK2BACK */ ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_A(1); @@ -411,7 +411,7 @@ static void isr_early_abort(void *param) /* Generate auxiliary radio event done */ extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_ADV_AUX); - LL_ASSERT_ERR(extra); + LL_ASSERT(extra); radio_isr_set(isr_race, param); if (!radio_is_idle()) { @@ -419,7 +419,7 @@ static void isr_early_abort(void *param) } err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); lll_done(NULL); } @@ -434,7 +434,7 @@ static void isr_done(void *param) /* Generate auxiliary radio event done */ extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_ADV_AUX); - LL_ASSERT_ERR(extra); + LL_ASSERT(extra); /* Cleanup radio event and dispatch the done event */ lll_isr_cleanup(param); @@ -462,14 +462,14 @@ static void isr_tx_chain(void *param) /* Get reference to aux pointer structure */ err = aux_ptr_get(lll_aux->last_pdu, &aux_ptr); - LL_ASSERT_ERR(!err && aux_ptr); + LL_ASSERT(!err && aux_ptr); /* Use channel idx that was in aux_ptr */ lll_chan_set(aux_ptr->chan_idx); /* Get reference to the auxiliary chain PDU */ pdu = lll_adv_pdu_linked_next_get(lll_aux->last_pdu); - LL_ASSERT_DBG(pdu); + LL_ASSERT(pdu); /* Set the last used auxiliary PDU for transmission */ lll_aux->last_pdu = pdu; @@ -492,7 +492,7 @@ static void isr_tx_chain(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -557,7 +557,7 @@ static void aux_ptr_chan_idx_set(struct lll_adv_aux *lll, struct pdu_adv *pdu) /* Get reference to aux pointer structure */ err = aux_ptr_get(pdu, &aux_ptr); - LL_ASSERT_ERR(!err && aux_ptr); + LL_ASSERT(!err && aux_ptr); /* Calculate a new channel index */ aux = HDR_LLL2ULL(lll); @@ -603,7 +603,7 @@ static void isr_tx_rx(void *param) /* setup Rx buffer */ node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ @@ -611,7 +611,7 @@ static void isr_tx_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -764,12 +764,12 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, lll = lll_aux->adv; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu_rx = (void *)node_rx->pdu; pdu_adv = lll_adv_data_curr_get(lll); pdu_aux = lll_adv_aux_data_latest_get(lll_aux, &upd); - LL_ASSERT_DBG(pdu_aux); + LL_ASSERT(pdu_aux); hdr = &pdu_aux->adv_ext_ind.ext_hdr; @@ -823,7 +823,7 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -900,7 +900,7 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c index cc26f729dfce..774a10da2b30 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c @@ -115,7 +115,7 @@ static void prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); p = param; @@ -135,7 +135,7 @@ static void create_prepare_bh(void *param) /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, lll_abort_cb, create_prepare_cb, 0U, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } static void prepare_bh(void *param) @@ -144,7 +144,7 @@ static void prepare_bh(void *param) /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, lll_abort_cb, prepare_cb, 0U, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } static int create_prepare_cb(struct lll_prepare_param *p) @@ -269,7 +269,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) stream_handle = lll->stream_handle[bis_idx]; handle = LL_BIS_ADV_HANDLE_FROM_IDX(stream_handle); stream = ull_adv_iso_lll_stream_get(stream_handle); - LL_ASSERT_DBG(stream); + LL_ASSERT(stream); do { link = memq_peek(stream->memq_tx.head, @@ -448,7 +448,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); /* Calculate ahead the next subevent channel index */ if (false) { @@ -470,7 +470,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_ADV_ISO_INTERLEAVED */ } else { - LL_ASSERT_DBG(false); + LL_ASSERT(false); } return 0; @@ -582,7 +582,7 @@ static void isr_tx_common(void *param, } else { bis = 0U; - LL_ASSERT_DBG(false); + LL_ASSERT(false); } if (!is_ctrl) { @@ -649,7 +649,7 @@ static void isr_tx_common(void *param, stream_handle = lll->stream_handle[bis_idx]; handle = LL_BIS_ADV_HANDLE_FROM_IDX(stream_handle); stream = ull_adv_iso_lll_stream_get(stream_handle); - LL_ASSERT_DBG(stream); + LL_ASSERT(stream); do { struct node_tx_iso *tx; @@ -727,7 +727,7 @@ static void isr_tx_common(void *param, /* FIXME: memq_peek_n function does not support indices > UINT8_MAX, * add assertion check to honor this limitation. */ - LL_ASSERT_DBG(payload_index <= UINT8_MAX); + LL_ASSERT(payload_index <= UINT8_MAX); } else { payload_index = lll->bn_curr - 1U; /* 3 bits */ } @@ -742,7 +742,7 @@ static void isr_tx_common(void *param, stream_handle = lll->stream_handle[lll->bis_curr - 1U]; stream = ull_adv_iso_lll_stream_get(stream_handle); - LL_ASSERT_DBG(stream); + LL_ASSERT(stream); link = memq_peek_n(stream->memq_tx.head, stream->memq_tx.tail, payload_index, (void **)&tx); @@ -873,7 +873,7 @@ static void isr_tx_common(void *param, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -922,7 +922,7 @@ static void isr_tx_common(void *param, #endif /* CONFIG_BT_CTLR_ADV_ISO_INTERLEAVED */ } else { - LL_ASSERT_DBG(false); + LL_ASSERT(false); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1038,7 +1038,7 @@ static void isr_done_term(void *param) lll_isr_status_reset(); lll = param; - LL_ASSERT_DBG(lll->ctrl_expire); + LL_ASSERT(lll->ctrl_expire); elapsed_event = lll->latency_event + 1U; if (lll->ctrl_expire > elapsed_event) { @@ -1075,7 +1075,7 @@ static void isr_done_term(void *param) * Advertising PDU. */ rx = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(rx); + LL_ASSERT(rx); rx->hdr.type = NODE_RX_TYPE_BIG_CHM_COMPLETE; rx->rx_ftr.param = lll; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c index be8b8aa03a41..7bcc0435fe53 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c @@ -86,11 +86,11 @@ void lll_adv_sync_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } static int init_reset(void) @@ -176,7 +176,7 @@ static int prepare_cb(struct lll_prepare_param *p) upd = 0U; pdu = lll_adv_sync_data_latest_get(lll, NULL, &upd); - LL_ASSERT_DBG(pdu); + LL_ASSERT(pdu); #if defined(CONFIG_BT_CTLR_DF_ADV_CTE_TX) lll_df_cte_tx_enable(lll, pdu, &cte_len_us); @@ -278,7 +278,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK */ ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_A(1); @@ -305,7 +305,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Accumulate the latency as event is aborted while being in pipeline */ lll = prepare_param->param; @@ -336,7 +336,7 @@ static void isr_done(void *param) * the thread context. */ rx = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(rx); + LL_ASSERT(rx); rx->hdr.type = NODE_RX_TYPE_SYNC_CHM_COMPLETE; rx->rx_ftr.param = lll; @@ -370,14 +370,14 @@ static void isr_tx(void *param) /* Get reference to aux pointer structure */ err = aux_ptr_get(lll_sync->last_pdu, &aux_ptr); - LL_ASSERT_ERR(!err && aux_ptr); + LL_ASSERT(!err && aux_ptr); /* Use channel idx that was in aux_ptr */ lll_chan_set(aux_ptr->chan_idx); /* Get reference to the auxiliary chain PDU */ pdu = lll_adv_pdu_linked_next_get(lll_sync->last_pdu); - LL_ASSERT_DBG(pdu); + LL_ASSERT(pdu); /* Set the last used auxiliary PDU for transmission */ lll_sync->last_pdu = pdu; @@ -405,7 +405,7 @@ static void isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -514,7 +514,7 @@ static void aux_ptr_chan_idx_set(struct lll_adv_sync *lll, struct pdu_adv *pdu) /* Get reference to aux pointer structure */ err = aux_ptr_get(pdu, &aux_ptr); - LL_ASSERT_ERR(!err && aux_ptr); + LL_ASSERT(!err && aux_ptr); /* Calculate a new channel index */ chan_idx = lll_chan_sel_2(lll->data_chan_counter, lll->data_chan_id, diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central.c index fb170046a96f..4f082b4957a4 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central.c @@ -72,12 +72,12 @@ void lll_central_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_conn_central_is_abort_cb, lll_conn_abort_cb, prepare_cb, 0, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } static int init_reset(void) @@ -139,7 +139,7 @@ static int prepare_cb(struct lll_prepare_param *p) lll->data_chan_count); #else /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ data_chan_use = 0; - LL_ASSERT_DBG(0); + LL_ASSERT(0); #endif /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ } else { data_chan_use = lll_chan_sel_1(&lll->data_chan_use, @@ -266,7 +266,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif /* !CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_M(1); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c index 3d02a092f33f..fc44233f1ee8 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c @@ -97,11 +97,11 @@ void lll_central_iso_prepare(void *param) /* Initiate HF clock start up */ err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, abort_cb, prepare_cb, 0U, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } static int init_reset(void) @@ -143,7 +143,7 @@ static int prepare_cb(struct lll_prepare_param *p) cis_lll = ull_conn_iso_lll_stream_get_by_group(cig_lll, &cis_handle_curr); } while (cis_lll && !cis_lll->active); - LL_ASSERT_DBG(cis_lll); + LL_ASSERT(cis_lll); /* Unconditionally set the prepared flag. * This flag ensures current CIG event does not pick up a new CIS becoming active when the @@ -156,7 +156,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); /* Pick the event_count calculated in the ULL prepare */ cis_lll->event_count = cis_lll->event_count_prepare; @@ -395,7 +395,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Prepare is done */ ret = lll_prepare_done(cig_lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_M(1); @@ -435,7 +435,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); if (conn_lll->enc_rx) { radio_ccm_disable(); @@ -449,7 +449,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Get reference to CIG LLL context */ cig_lll = prepare_param->param; @@ -494,13 +494,13 @@ static void isr_tx(void *param) /* Acquire rx node for reception */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); #if defined(CONFIG_BT_CTLR_LE_ENC) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); #endif /* CONFIG_BT_CTLR_LE_ENC */ /* PHY */ @@ -547,7 +547,7 @@ static void isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } /* +/- 2us active clock jitter, +1 us PPI to timer start compensation */ @@ -608,12 +608,12 @@ static void isr_tx(void *param) (cis_lll->sub_interval * se_curr); start_us = radio_tmr_start_us(1U, subevent_us); - LL_ASSERT_ERR(start_us == (subevent_us + 1U)); + LL_ASSERT(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Get reference to ACL context */ evt_conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(evt_conn_lll != NULL); + LL_ASSERT(evt_conn_lll != NULL); /* Calculate the radio channel to use for next subevent */ data_chan_id = lll_chan_id(cis_lll->access_addr); @@ -652,7 +652,7 @@ static void isr_tx(void *param) subevent_us += next_cis_lll->offset - cis_offset_first; start_us = radio_tmr_start_us(1U, subevent_us); - LL_ASSERT_ERR(start_us == (subevent_us + 1U)); + LL_ASSERT(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Event counter value, 0-15 bit of cisEventCounter */ @@ -660,7 +660,7 @@ static void isr_tx(void *param) /* Get reference to ACL context */ next_conn_lll = ull_conn_lll_get(next_cis_lll->acl_handle); - LL_ASSERT_DBG(next_conn_lll != NULL); + LL_ASSERT(next_conn_lll != NULL); /* Calculate the radio channel to use for ISO event */ data_chan_id = lll_chan_id(next_cis_lll->access_addr); @@ -772,7 +772,7 @@ static void isr_rx(void *param) /* Get reference to received PDU */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu_rx = (void *)node_rx->pdu; /* Tx ACK */ @@ -805,7 +805,7 @@ static void isr_rx(void *param) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); /* If required, wait for CCM to finish */ @@ -813,7 +813,7 @@ static void isr_rx(void *param) uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT_ERR(done); + LL_ASSERT(done); if (!radio_ccm_mic_is_valid()) { /* Record MIC invalid */ @@ -894,7 +894,7 @@ static void isr_rx(void *param) /* Get reference to ACL context */ next_conn_lll = ull_conn_lll_get(next_cis_lll->acl_handle); - LL_ASSERT_DBG(next_conn_lll != NULL); + LL_ASSERT(next_conn_lll != NULL); /* Calculate CIS channel if not already calculated */ if (se_curr < cis_lll->nse) { @@ -912,7 +912,7 @@ static void isr_rx(void *param) subevent_us += next_cis_lll->offset - cis_offset_first; start_us = radio_tmr_start_us(1U, subevent_us); - LL_ASSERT_ERR(start_us == (subevent_us + 1U)); + LL_ASSERT(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Event counter value, 0-15 bit of cisEventCounter */ @@ -1075,7 +1075,7 @@ static void isr_prepare_subevent(void *param) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); #endif /* CONFIG_BT_CTLR_LE_ENC */ /* PHY */ @@ -1134,7 +1134,7 @@ static void isr_prepare_subevent(void *param) #if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER) start_us = radio_tmr_start_us(1U, subevent_us); - LL_ASSERT_ERR(start_us == (subevent_us + 1U)); + LL_ASSERT(start_us == (subevent_us + 1U)); #else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Compensate for the 1 us added by radio_tmr_start_us() */ @@ -1177,7 +1177,7 @@ static void isr_prepare_subevent(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1203,7 +1203,7 @@ static void isr_done(void *param) payload_count_flush_or_inc_on_close(cis_lll); e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_CIS; e->trx_performed_bitmask = trx_performed_bitmask; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c index 76663641f80a..a528e06c939e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c @@ -189,7 +189,7 @@ int lll_conn_central_is_abort_cb(void *next, void *curr, return -EBUSY; } - LL_ASSERT_DBG(trx_busy_iteration < CENTRAL_TRX_BUSY_ITERATION_MAX); + LL_ASSERT(trx_busy_iteration < CENTRAL_TRX_BUSY_ITERATION_MAX); return -ECANCELED; } @@ -223,7 +223,7 @@ int lll_conn_peripheral_is_abort_cb(void *next, void *curr, return -EBUSY; } - LL_ASSERT_DBG(trx_busy_iteration < PERIPHERAL_TRX_BUSY_ITERATION_MAX); + LL_ASSERT(trx_busy_iteration < PERIPHERAL_TRX_BUSY_ITERATION_MAX); return -ECANCELED; } @@ -268,7 +268,7 @@ void lll_conn_abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Get reference to LLL connection context */ lll = prepare_param->param; @@ -290,7 +290,7 @@ void lll_conn_abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Extra done event, to check supervision timeout */ e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_CONN; e->trx_cnt = 0U; @@ -364,7 +364,7 @@ void lll_conn_isr_rx(void *param) lll = param; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu_data_rx = (void *)node_rx->pdu; @@ -385,7 +385,7 @@ void lll_conn_isr_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } goto lll_conn_isr_rx_exit; @@ -475,7 +475,7 @@ void lll_conn_isr_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } /* Restore state if last transmitted was empty PDU */ @@ -538,7 +538,7 @@ void lll_conn_isr_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_TX_DEFER) @@ -570,7 +570,7 @@ void lll_conn_isr_rx(void *param) is_ull_rx = 0U; if (tx_release) { - LL_ASSERT_DBG(lll->handle != 0xFFFF); + LL_ASSERT(lll->handle != 0xFFFF); ull_conn_lll_ack_enqueue(lll->handle, tx_release); @@ -736,12 +736,12 @@ void lll_conn_isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX) pdu_tx = get_last_tx_pdu(lll); - LL_ASSERT_DBG(pdu_tx); + LL_ASSERT(pdu_tx); if (pdu_tx->cp) { cte_len = CTE_LEN_US(pdu_tx->octet3.cte_info.time); @@ -836,7 +836,7 @@ void lll_conn_rx_pkt_set(struct lll_conn *lll) uint8_t phy; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); /* In case of ISR latencies, if packet pointer has not been set on time * then we do not want to check uninitialized length in rx buffer that @@ -1041,7 +1041,7 @@ static void isr_done(void *param) lll_isr_status_reset(); e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_CONN; e->trx_cnt = trx_cnt; @@ -1182,7 +1182,7 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, FORCE_MD_CNT_SET(); } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } if (IS_ENABLED(CONFIG_BT_CENTRAL) && !lll->role && @@ -1209,7 +1209,7 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT_ERR(done); + LL_ASSERT(done); bool mic_failure = !radio_ccm_mic_is_valid(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c index a9a575a32306..f4a12ef5e934 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_df.c @@ -103,7 +103,7 @@ void lll_df_cte_tx_enable(struct lll_adv_sync *lll_sync, const struct pdu_adv *p const struct lll_df_adv_cfg *df_cfg; df_cfg = lll_adv_sync_extra_data_curr_get(lll_sync); - LL_ASSERT_DBG(df_cfg); + LL_ASSERT(df_cfg); lll_df_cte_tx_configure(df_cfg->cte_type, df_cfg->cte_length, df_cfg->ant_sw_len, df_cfg->ant_ids); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c index a25265400db8..8c3b83efd721 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c @@ -73,7 +73,7 @@ void lll_periph_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); p = param; @@ -82,7 +82,7 @@ void lll_periph_prepare(void *param) /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_conn_peripheral_is_abort_cb, lll_conn_abort_cb, prepare_cb, 0U, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } static int init_reset(void) @@ -143,7 +143,7 @@ static int prepare_cb(struct lll_prepare_param *p) lll->data_chan_count); #else /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ data_chan_use = 0; - LL_ASSERT_DBG(0); + LL_ASSERT(0); #endif /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ } else { data_chan_use = lll_chan_sel_1(&lll->data_chan_use, @@ -355,7 +355,7 @@ static int prepare_cb(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_S(1); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c index 8178be1c7d26..46e6aad63b7e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c @@ -100,7 +100,7 @@ void lll_peripheral_iso_prepare(void *param) /* Initiate HF clock start up */ err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); p = param; @@ -108,7 +108,7 @@ void lll_peripheral_iso_prepare(void *param) /* Invoke common pipeline handling of prepare */ err = lll_prepare(lll_is_abort_cb, abort_cb, prepare_cb, 0U, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } void lll_peripheral_iso_flush(uint16_t handle, struct lll_conn_iso_stream *lll) @@ -157,7 +157,7 @@ static int prepare_cb(struct lll_prepare_param *p) cis_lll = ull_conn_iso_lll_stream_sorted_get_by_group(cig_lll, &cis_handle_curr); } while (cis_lll && !cis_lll->active); - LL_ASSERT_DBG(cis_lll); + LL_ASSERT(cis_lll); /* Unconditionally set the prepared flag. * This flag ensures current CIG event does not pick up a new CIS becoming active when the @@ -170,7 +170,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); /* Pick the event_count calculated in the ULL prepare */ cis_lll->event_count = cis_lll->event_count_prepare; @@ -233,7 +233,7 @@ static int prepare_cb(struct lll_prepare_param *p) lll_chan_set(data_chan_use); node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); /* Encryption */ if (false) { @@ -410,7 +410,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Prepare is done */ ret = lll_prepare_done(cig_lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_S(1); @@ -451,7 +451,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); if (conn_lll->enc_rx) { radio_ccm_disable(); @@ -465,7 +465,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Get reference to CIG LLL context */ cig_lll = prepare_param->param; @@ -578,7 +578,7 @@ static void isr_rx(void *param) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); if (crc_ok) { struct node_rx_pdu *node_rx; @@ -586,7 +586,7 @@ static void isr_rx(void *param) /* Get reference to received PDU */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu_rx = (void *)node_rx->pdu; @@ -624,7 +624,7 @@ static void isr_rx(void *param) uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT_ERR(done); + LL_ASSERT(done); if (!radio_ccm_mic_is_valid()) { /* Record MIC invalid */ @@ -804,7 +804,7 @@ static void isr_rx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -884,7 +884,7 @@ static void isr_rx(void *param) #endif /* !CONFIG_BT_CTLR_PHY */ start_us = radio_tmr_start_us(0U, subevent_us); - LL_ASSERT_ERR(start_us == (subevent_us + 1U)); + LL_ASSERT(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -916,13 +916,13 @@ static void isr_tx(void *param) cis_lll = param; node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); #if defined(CONFIG_BT_CTLR_LE_ENC) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); #endif /* CONFIG_BT_CTLR_LE_ENC */ /* PHY */ @@ -999,7 +999,7 @@ static void isr_tx(void *param) #if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER) start_us = radio_tmr_start_us(0U, subevent_us); - LL_ASSERT_ERR(start_us == (subevent_us + 1U)); + LL_ASSERT(start_us == (subevent_us + 1U)); #else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ /* Compensate for the 1 us added by radio_tmr_start_us() */ @@ -1091,7 +1091,7 @@ static void isr_prepare_subevent(void *param) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); /* Calculate the radio channel to use for next subevent */ @@ -1117,7 +1117,7 @@ static void isr_prepare_subevent_next_cis(void *param) /* Get reference to ACL context */ conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); /* Event counter value, 0-15 bit of cisEventCounter */ event_counter = cis_lll->event_count; @@ -1149,13 +1149,13 @@ static void isr_prepare_subevent_common(void *param) cis_lll = param; node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); #if defined(CONFIG_BT_CTLR_LE_ENC) /* Get reference to ACL context */ const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); - LL_ASSERT_DBG(conn_lll != NULL); + LL_ASSERT(conn_lll != NULL); #endif /* CONFIG_BT_CTLR_LE_ENC */ /* PHY */ @@ -1236,7 +1236,7 @@ static void isr_prepare_subevent_common(void *param) } start_us = radio_tmr_start_us(0U, subevent_us); - LL_ASSERT_ERR(!trx_performed_bitmask || (start_us == (subevent_us + 1U))); + LL_ASSERT(!trx_performed_bitmask || (start_us == (subevent_us + 1U))); /* If no anchor point sync yet, continue to capture access address * timestamp. @@ -1297,7 +1297,7 @@ static void isr_done(void *param) payload_count_rx_flush_or_txrx_inc(cis_lll); e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_CIS; e->trx_performed_bitmask = trx_performed_bitmask; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index 7ae1f8bb6de2..f1fab4b664de 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -125,10 +125,10 @@ void lll_scan_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } void lll_scan_isr_resume(void *param) @@ -391,7 +391,7 @@ static int common_prepare_cb(struct lll_prepare_param *p, bool is_resume) #endif /* !CONFIG_BT_CTLR_ADV_EXT */ node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_pkt_rx_set(node_rx->pdu); @@ -497,8 +497,8 @@ static int common_prepare_cb(struct lll_prepare_param *p, bool is_resume) ticks_at_event, lll->ticks_window, TICKER_NULL_PERIOD, TICKER_NULL_REMAINDER, TICKER_NULL_LAZY, TICKER_NULL_SLOT, ticker_stop_cb, lll, ticker_op_start_cb, (void *)__LINE__); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } #if defined(CONFIG_BT_CENTRAL) && defined(CONFIG_BT_CTLR_SCHED_ADVANCED) @@ -515,12 +515,12 @@ static int common_prepare_cb(struct lll_prepare_param *p, bool is_resume) retval = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, &mfy_after_cen_offset_get); - LL_ASSERT_ERR(!retval); + LL_ASSERT(!retval); } #endif /* CONFIG_BT_CENTRAL && CONFIG_BT_CTLR_SCHED_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_O(1); @@ -561,7 +561,7 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) /* Retain HF clock */ err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Yield to the pre-emptor, but be * resumed thereafter. @@ -629,7 +629,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); lll_done(param); } @@ -645,14 +645,14 @@ static void ticker_stop_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void ticker_op_start_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); } static void isr_rx(void *param) @@ -708,7 +708,7 @@ static void isr_rx(void *param) } node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu = (void *)node_rx->pdu; @@ -787,7 +787,7 @@ static void isr_tx(void *param) radio_switch_complete_and_disable(); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ @@ -795,7 +795,7 @@ static void isr_tx(void *param) LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } #if defined(CONFIG_BT_CTLR_PRIVACY) @@ -865,7 +865,7 @@ static void isr_common_done(void *param) } node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_pkt_rx_set(node_rx->pdu); #if defined(CONFIG_BT_CTLR_PRIVACY) @@ -1006,7 +1006,7 @@ static void isr_abort(void *param) * detected in ULL. */ extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN); - LL_ASSERT_ERR(extra); + LL_ASSERT(extra); #endif /* CONFIG_BT_CTLR_ADV_EXT */ lll_isr_cleanup(param); @@ -1084,7 +1084,7 @@ static void isr_done_cleanup(void *param) * detected in ULL. */ extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN); - LL_ASSERT_ERR(extra); + LL_ASSERT(extra); } /* Prevent scan events in pipeline from being scheduled if duration has @@ -1103,7 +1103,7 @@ static void isr_done_cleanup(void *param) lll->is_aux_sched = 0U; node_rx2 = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(node_rx2); + LL_ASSERT(node_rx2); node_rx2->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1126,7 +1126,7 @@ static void isr_done_cleanup(void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_LLL, 1U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } lll_isr_cleanup(param); @@ -1220,7 +1220,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1357,7 +1357,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1567,7 +1567,7 @@ static int isr_rx_scan_report(struct lll_scan *lll, uint8_t devmatch_ok, break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c index 6665dc7390e2..0478fbc80011 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c @@ -108,10 +108,10 @@ void lll_scan_aux_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } uint8_t lll_scan_aux_setup(struct pdu_adv *pdu, uint8_t pdu_phy, @@ -132,7 +132,7 @@ uint8_t lll_scan_aux_setup(struct pdu_adv *pdu, uint8_t pdu_phy, uint32_t pdu_us; uint8_t phy; - LL_ASSERT_DBG(pdu->type == PDU_ADV_TYPE_EXT_IND); + LL_ASSERT(pdu->type == PDU_ADV_TYPE_EXT_IND); /* Get reference to extended header */ pri_com_hdr = (void *)&pdu->adv_ext_ind; @@ -231,7 +231,7 @@ uint8_t lll_scan_aux_setup(struct pdu_adv *pdu, uint8_t pdu_phy, } node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); /* Store the lll context, aux_ptr and start of PDU in footer */ ftr = &(node_rx->rx_ftr); @@ -499,7 +499,7 @@ static int prepare_cb(struct lll_prepare_param *p) RADIO_PKT_CONF_PHY(lll_aux->phy)); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_pkt_rx_set(node_rx->pdu); @@ -616,12 +616,12 @@ static int prepare_cb(struct lll_prepare_param *p) ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_ULL_LOW, 1U, &mfy_after_cen_offset_get); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } #endif /* CONFIG_BT_CENTRAL && CONFIG_BT_CTLR_SCHED_ADVANCED */ ret = lll_prepare_done(lll_aux); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_O(1); @@ -640,7 +640,7 @@ static int is_abort_cb(void *next, void *curr, lll_prepare_cb_t *resume_cb) /* Auxiliary event shall not overlap as they are not periodically * scheduled. */ - LL_ASSERT_DBG(next != curr); + LL_ASSERT(next != curr); lll = ull_scan_lll_is_valid_get(next); if (lll) { @@ -674,10 +674,10 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX); - LL_ASSERT_ERR(e); + LL_ASSERT(e); #if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS) e->lll = param; @@ -711,7 +711,7 @@ static void isr_done(void *param) * generated thereafter by HCI as incomplete. */ node_rx = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(node_rx); + LL_ASSERT(node_rx); node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -725,7 +725,7 @@ static void isr_done(void *param) struct event_done_extra *e; e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX); - LL_ASSERT_ERR(e); + LL_ASSERT(e); #if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS) e->lll = param; @@ -744,7 +744,7 @@ static void isr_done(void *param) mfy.param = scan_lll; ret = mayfly_enqueue(TICKER_USER_ID_LLL, TICKER_USER_ID_LLL, 1U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } lll_isr_cleanup(param); @@ -905,7 +905,7 @@ static void isr_rx(struct lll_scan *lll, struct lll_scan_aux *lll_aux, struct node_rx_pdu *node_rx2; node_rx2 = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(node_rx2); + LL_ASSERT(node_rx2); node_rx2->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1055,7 +1055,7 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1210,7 +1210,7 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1421,7 +1421,7 @@ static void isr_tx(struct lll_scan_aux *lll_aux, void *pdu_rx, LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT_ERR(!radio_is_ready()); + LL_ASSERT(!radio_is_ready()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1484,7 +1484,7 @@ static void isr_tx_scan_req_ull_schedule(void *param) struct node_rx_pdu *node_rx; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); isr_tx(param, node_rx->pdu, isr_rx_ull_schedule, param); } @@ -1498,7 +1498,7 @@ static void isr_tx_scan_req_lll_schedule(void *param) lll = node_rx_adv->rx_ftr.param; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); isr_tx(lll->lll_aux, node_rx->pdu, isr_rx_lll_schedule, param); } @@ -1509,7 +1509,7 @@ static void isr_tx_connect_req(void *param) struct node_rx_pdu *node_rx; node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); isr_tx(param, (void *)node_rx->pdu, isr_rx_connect_rsp, param); } @@ -1559,7 +1559,7 @@ static void isr_rx_connect_rsp(void *param) * release it if failed to receive AUX_CONNECT_RSP PDU. */ rx = lll_aux->node_conn_rx; - LL_ASSERT_DBG(rx); + LL_ASSERT(rx); lll_aux->node_conn_rx = NULL; #if defined(CONFIG_BT_CTLR_PRIVACY) @@ -1577,7 +1577,7 @@ static void isr_rx_connect_rsp(void *param) pdu_tx = radio_pkt_scratch_get(); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu_rx = (void *)node_rx->pdu; trx_done = isr_rx_connect_rsp_check(lll, pdu_tx, pdu_rx, @@ -1660,7 +1660,7 @@ static void isr_rx_connect_rsp(void *param) /* Send message to flush Auxiliary PDU list */ node_rx = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(node_rx); + LL_ASSERT(node_rx); node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1713,7 +1713,7 @@ static void isr_early_abort(void *param) struct event_done_extra *e; e = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN_AUX); - LL_ASSERT_ERR(e); + LL_ASSERT(e); #if defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS) e->lll = param; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c index fe5b9efdb989..d549d914f591 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c @@ -101,11 +101,11 @@ void lll_sync_create_prepare(void *param) /* Request to start HF Clock */ err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(is_abort_cb, abort_cb, create_prepare_cb, 0, param); - LL_ASSERT_ERR(!err || err == -EINPROGRESS); + LL_ASSERT(!err || err == -EINPROGRESS); } void lll_sync_prepare(void *param) @@ -114,11 +114,11 @@ void lll_sync_prepare(void *param) /* Request to start HF Clock */ err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Invoke common pipeline handling of prepare */ err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0, param); - LL_ASSERT_ERR(err == 0 || err == -EINPROGRESS); + LL_ASSERT(err == 0 || err == -EINPROGRESS); } void lll_sync_aux_prepare_cb(struct lll_sync *lll, @@ -137,7 +137,7 @@ void lll_sync_aux_prepare_cb(struct lll_sync *lll, RADIO_PKT_CONF_PHY(lll_aux->phy)); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_pkt_rx_set(node_rx->pdu); @@ -456,7 +456,7 @@ static int prepare_cb_common(struct lll_prepare_param *p, uint8_t chan_idx) lll_chan_set(chan_idx); node_rx = ull_pdu_rx_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_pkt_rx_set(node_rx->pdu); @@ -510,7 +510,7 @@ static int prepare_cb_common(struct lll_prepare_param *p, uint8_t chan_idx) #endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_START_O(1); @@ -617,7 +617,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Get reference to LLL connection context */ lll = prepare_param->param; @@ -635,7 +635,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Extra done event, to check sync lost */ e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC; e->trx_cnt = 0U; @@ -745,7 +745,7 @@ static void isr_aux_setup(void *param) aux_start_us -= EVENT_JITTER_US; start_us = radio_tmr_start_us(0, aux_start_us); - LL_ASSERT_ERR(start_us == (aux_start_us + 1U)); + LL_ASSERT(start_us == (aux_start_us + 1U)); /* Setup header complete timeout */ hcto = start_us; @@ -951,7 +951,7 @@ static void isr_rx_adv_sync_estab(void *param) /* TODO: Combine the early exit with above if-then-else block */ #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) - LL_ASSERT_DBG(!lll->node_cte_incomplete); + LL_ASSERT(!lll->node_cte_incomplete); #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ goto isr_rx_done; @@ -1137,7 +1137,7 @@ static void isr_rx_aux_chain(void *param) * generated thereafter by HCI as incomplete. */ node_rx = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(node_rx); + LL_ASSERT(node_rx); node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1188,7 +1188,7 @@ static void isr_rx_done_cleanup(struct lll_sync *lll, uint8_t crc_ok, bool sync_ /* Calculate and place the drift information in done event */ e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC; e->trx_cnt = trx_cnt; @@ -1240,7 +1240,7 @@ static void isr_done(void *param) * generated thereafter by HCI as incomplete. */ node_rx = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(node_rx); + LL_ASSERT(node_rx); node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE; @@ -1325,7 +1325,7 @@ static int iq_report_create_put(struct lll_sync *lll, uint8_t rssi_ready, uint8_ if (!lll->is_cte_incomplete && is_max_cte_reached(cfg->max_cte_count, cfg->cte_count)) { iq_report = ull_df_iq_report_alloc(); - LL_ASSERT_ERR(iq_report); + LL_ASSERT(iq_report); iq_report_create(lll, rssi_ready, packet_status, cfg->slot_durations, iq_report); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index d6931c9b7f59..2083d8d7780a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -101,11 +101,11 @@ void lll_sync_iso_create_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, create_prepare_cb, 0U, param); - LL_ASSERT_ERR(err == 0 || err == -EINPROGRESS); + LL_ASSERT(err == 0 || err == -EINPROGRESS); } void lll_sync_iso_prepare(void *param) @@ -113,10 +113,10 @@ void lll_sync_iso_prepare(void *param) int err; err = lll_hfclock_on(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); err = lll_prepare(is_abort_cb, abort_cb, prepare_cb, 0U, param); - LL_ASSERT_ERR(err == 0 || err == -EINPROGRESS); + LL_ASSERT(err == 0 || err == -EINPROGRESS); } void lll_sync_iso_flush(uint8_t handle, struct lll_sync_iso *lll) @@ -288,7 +288,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_SYNC_ISO_INTERLEAVED */ } else { - LL_ASSERT_DBG(false); + LL_ASSERT(false); } } @@ -313,7 +313,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) * setting up radio for new PDU reception. */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); /* Encryption */ if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC) && @@ -400,7 +400,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */ ret = lll_prepare_done(lll); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); /* Calculate ahead the next subevent channel index */ if (false) { @@ -422,7 +422,7 @@ static int prepare_cb_common(struct lll_prepare_param *p) #endif /* CONFIG_BT_CTLR_SYNC_ISO_INTERLEAVED */ } else { - LL_ASSERT_DBG(false); + LL_ASSERT(false); } return 0; @@ -468,7 +468,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) * currently in preparation pipeline. */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Get reference to LLL connection context */ lll = prepare_param->param; @@ -486,7 +486,7 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) /* Extra done event, to check sync lost */ e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC_ISO; e->estab_failed = 0U; @@ -531,7 +531,7 @@ static void isr_rx_estab(void *param) * for new PDU reception. */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); /* Get reference to received PDU and validate MIC for non-empty PDU */ pdu = (void *)node_rx->pdu; @@ -540,7 +540,7 @@ static void isr_rx_estab(void *param) uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT_ERR(done); + LL_ASSERT(done); mic_failure = !radio_ccm_mic_is_valid(); if (mic_failure) { @@ -555,7 +555,7 @@ static void isr_rx_estab(void *param) /* Calculate and place the drift information in done event */ e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); e->type = EVENT_DONE_EXTRA_TYPE_SYNC_ISO_ESTAB; e->estab_failed = lll->term_reason ? 1U : 0U; @@ -659,7 +659,7 @@ static void isr_rx(void *param) } else { se_offset_us = 0U; - LL_ASSERT_DBG(false); + LL_ASSERT(false); } radio_tmr_aa_save(radio_tmr_aa_get() - se_offset_us); @@ -702,7 +702,7 @@ static void isr_rx(void *param) } node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu = (void *)node_rx->pdu; @@ -753,7 +753,7 @@ static void isr_rx(void *param) uint32_t done; done = radio_ccm_is_done(); - LL_ASSERT_ERR(done); + LL_ASSERT(done); mic_failure = !radio_ccm_mic_is_valid(); if (mic_failure) { @@ -850,7 +850,7 @@ static void isr_rx(void *param) * skip subevents as buffers at these high offset are unavailable. */ payload_offset = (lll->latency_event * lll->bn); - LL_ASSERT_ERR(payload_offset <= UINT8_MAX); + LL_ASSERT(payload_offset <= UINT8_MAX); /* Find the index of the (irc_curr)th bn = 1 Rx PDU * buffer. @@ -941,7 +941,7 @@ static void isr_rx(void *param) * these high offsets are unavailable. */ payload_offset = (lll->latency_event * lll->bn); - LL_ASSERT_ERR(payload_offset <= UINT8_MAX); + LL_ASSERT(payload_offset <= UINT8_MAX); /* Find the index of the (irc_curr)th bn = 1 Rx * PDU buffer. @@ -1062,7 +1062,7 @@ static void isr_rx(void *param) lll->bis_curr = sync_stream->bis_index; bis_idx = lll->bis_curr - 1U; } else { - LL_ASSERT_DBG(false); + LL_ASSERT(false); } } @@ -1261,7 +1261,7 @@ static void isr_rx(void *param) * available for setting up radio for new PDU reception. */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu = (void *)node_rx->pdu; } else { @@ -1288,7 +1288,7 @@ static void isr_rx(void *param) * available for setting up radio for new PDU reception. */ node_rx = ull_iso_pdu_rx_alloc_peek(1U); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); pdu = (void *)node_rx->pdu; } else { @@ -1331,7 +1331,7 @@ static void isr_rx(void *param) nse = 0U; hcto = 0U; - LL_ASSERT_DBG(false); + LL_ASSERT(false); } if (trx_cnt) { @@ -1361,7 +1361,7 @@ static void isr_rx(void *param) overhead_us += radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); /* Add base clock jitter overhead */ overhead_us += (EVENT_CLOCK_JITTER_US << 1); - LL_ASSERT_DBG(EVENT_IFS_US > overhead_us); + LL_ASSERT(EVENT_IFS_US > overhead_us); /* Max. available clock jitter */ jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1; @@ -1376,13 +1376,13 @@ static void isr_rx(void *param) jitter_us = jitter_max_us; } - LL_ASSERT_DBG(hcto > jitter_us); + LL_ASSERT(hcto > jitter_us); hcto -= jitter_us; start_us = hcto; hcto = radio_tmr_start_us(0U, start_us); - LL_ASSERT_ERR(hcto == (start_us + 1U)); + LL_ASSERT(hcto == (start_us + 1U)); /* Add 8 us * subevents so far, as radio was setup to listen * 4 us early and subevents could have a 4 us drift each until @@ -1399,7 +1399,7 @@ static void isr_rx(void *param) start_us = hcto; hcto = radio_tmr_start_us(0U, start_us); - LL_ASSERT_ERR(hcto == (start_us + 1U)); + LL_ASSERT(hcto == (start_us + 1U)); hcto += ((EVENT_JITTER_US + EVENT_TICKER_RES_MARGIN_US + lll->window_widening_event_us) << 1) + @@ -1448,7 +1448,7 @@ static void isr_rx(void *param) #endif /* CONFIG_BT_CTLR_SYNC_ISO_INTERLEAVED */ } else { - LL_ASSERT_DBG(false); + LL_ASSERT(false); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1546,7 +1546,7 @@ static void isr_rx_done(void *param) } e = ull_event_done_extra_get(); - LL_ASSERT_ERR(e); + LL_ASSERT(e); /* Check if BIG terminate procedure received */ if (lll->term_reason) { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c index c724bd08e0bb..9715b934e5e8 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c @@ -238,7 +238,7 @@ static void isr_rx(void *param) if (test_cte_len > 0) { /* Get free iq report node for next Rx operation. */ node_rx = ull_df_iq_report_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_df_iq_data_packet_set(node_rx->pdu, IQ_SAMPLE_TOTAL_CNT); } @@ -435,7 +435,7 @@ static uint8_t cte_rx_init(uint8_t expected_cte_len, uint8_t expected_cte_type, struct node_rx_iq_report *node_rx; node_rx = ull_df_iq_report_alloc_peek(1); - LL_ASSERT_DBG(node_rx); + LL_ASSERT(node_rx); radio_df_iq_data_packet_set(node_rx->pdu, IQ_SAMPLE_TOTAL_CNT); #else @@ -498,7 +498,7 @@ static uint8_t init(uint8_t chan, uint8_t phy, int8_t tx_power, /* Setup resources required by Radio */ err = lll_hfclock_on_wait(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Reset Radio h/w */ radio_reset(); @@ -744,7 +744,7 @@ uint8_t ll_test_end(uint16_t *num_rx) /* Release resources acquired for Radio */ err = lll_hfclock_off(); - LL_ASSERT_ERR(err >= 0); + LL_ASSERT(err >= 0); /* Stop coarse timer */ cntr_stop(); diff --git a/subsys/bluetooth/controller/ll_sw/ull.c b/subsys/bluetooth/controller/ll_sw/ull.c index 4ff06e60fda9..bf15820ecd6d 100644 --- a/subsys/bluetooth/controller/ll_sw/ull.c +++ b/subsys/bluetooth/controller/ll_sw/ull.c @@ -627,7 +627,7 @@ int ll_init(struct k_sem *sem_rx) hal_ticker_instance0_caller_id_get, hal_ticker_instance0_sched, hal_ticker_instance0_trigger_set); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* Initialize semaphore for ticker API blocking wait */ k_sem_init(&sem_ticker_api_cb, 0, 1); @@ -816,12 +816,12 @@ void ll_reset(void) #if defined(CONFIG_BT_CTLR_ADV_ISO) /* Reset adv iso sets */ err = ull_adv_iso_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CTLR_ADV_ISO */ /* Reset adv state */ err = ull_adv_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_BROADCASTER */ #if defined(CONFIG_BT_OBSERVER) @@ -829,43 +829,43 @@ void ll_reset(void) #if defined(CONFIG_BT_CTLR_SYNC_ISO) /* Reset sync iso sets */ err = ull_sync_iso_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CTLR_SYNC_ISO */ /* Reset periodic sync sets */ err = ull_sync_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */ /* Reset scan state */ err = ull_scan_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_OBSERVER */ #if defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) err = ull_peripheral_iso_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CTLR_PERIPHERAL_ISO */ #if defined(CONFIG_BT_CTLR_CENTRAL_ISO) err = ull_central_iso_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CTLR_CENTRAL_ISO */ #if defined(CONFIG_BT_CTLR_CONN_ISO) err = ull_conn_iso_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CTLR_CONN_ISO */ #if defined(CONFIG_BT_CTLR_ISO) err = ull_iso_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CTLR_ISO */ #if defined(CONFIG_BT_CONN) /* Reset conn role */ err = ull_conn_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); MFIFO_INIT(tx_ack); #endif /* CONFIG_BT_CONN */ @@ -912,7 +912,7 @@ void ll_reset(void) retval = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!retval); + LL_ASSERT(!retval); #if !defined(CONFIG_BT_CTLR_ZLI) /* LLL reset must complete before returning - wait for @@ -925,7 +925,7 @@ void ll_reset(void) #if defined(CONFIG_BT_BROADCASTER) /* Finalize after adv state LLL context reset */ err = ull_adv_reset_finalize(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_BROADCASTER */ /* Reset/End DTM Tx or Rx commands */ @@ -938,7 +938,7 @@ void ll_reset(void) /* Common to init and reset */ err = init_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #if defined(CONFIG_BT_CTLR_DF) /* Direction Finding has to be reset after ull init_reset call because @@ -946,7 +946,7 @@ void ll_reset(void) * in common ull init_reset. */ err = ull_df_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif #if defined(CONFIG_BT_CTLR_SET_HOST_FEATURE) @@ -1101,7 +1101,7 @@ void ll_rx_dequeue(void) link = memq_dequeue(memq_ll_rx.tail, &memq_ll_rx.head, (void **)&rx); - LL_ASSERT_DBG(link); + LL_ASSERT(link); ll_rx_link_release(link); @@ -1129,7 +1129,7 @@ void ll_rx_dequeue(void) while (rx_curr) { memq_link_t *link_free; - LL_ASSERT_ERR(loop); + LL_ASSERT(loop); loop--; link_free = rx_curr->hdr.link; @@ -1154,7 +1154,7 @@ void ll_rx_dequeue(void) struct lll_adv_aux *lll_aux; adv = ull_adv_set_get(rx->hdr.handle); - LL_ASSERT_DBG(adv); + LL_ASSERT(adv); lll_aux = adv->lll.aux; if (lll_aux) { @@ -1174,11 +1174,11 @@ void ll_rx_dequeue(void) break; } - LL_ASSERT_DBG(!lll_conn->link_tx_free); + LL_ASSERT(!lll_conn->link_tx_free); memq_link_t *memq_link = memq_deinit(&lll_conn->memq_tx.head, &lll_conn->memq_tx.tail); - LL_ASSERT_DBG(memq_link); + LL_ASSERT(memq_link); lll_conn->link_tx_free = memq_link; @@ -1223,13 +1223,13 @@ void ll_rx_dequeue(void) memq_link_t *memq_link; conn_lll = lll->conn; - LL_ASSERT_DBG(conn_lll); + LL_ASSERT(conn_lll); lll->conn = NULL; - LL_ASSERT_DBG(!conn_lll->link_tx_free); + LL_ASSERT(!conn_lll->link_tx_free); memq_link = memq_deinit(&conn_lll->memq_tx.head, &conn_lll->memq_tx.tail); - LL_ASSERT_DBG(memq_link); + LL_ASSERT(memq_link); conn_lll->link_tx_free = memq_link; conn = HDR_LLL2ULL(conn_lll); @@ -1294,7 +1294,7 @@ void ll_rx_dequeue(void) scan->is_enabled = 0U; #else /* !CONFIG_BT_CENTRAL */ } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); #endif /* !CONFIG_BT_CENTRAL */ } @@ -1416,11 +1416,11 @@ void ll_rx_dequeue(void) * code block. */ case NODE_RX_TYPE_NONE: - LL_ASSERT_DBG(rx->hdr.type != NODE_RX_TYPE_NONE); + LL_ASSERT(rx->hdr.type != NODE_RX_TYPE_NONE); break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -1432,11 +1432,11 @@ void ll_rx_dequeue(void) struct ll_scan_set *scan; adv = ull_adv_is_enabled_get(0); - LL_ASSERT_DBG(adv); + LL_ASSERT(adv); adv->is_enabled = 0U; scan = ull_scan_is_enabled_get(0); - LL_ASSERT_DBG(scan); + LL_ASSERT(scan); scan->is_enabled = 0U; @@ -1520,7 +1520,7 @@ void ll_rx_mem_release(void **node_rx) #endif /* CONFIG_BT_CENTRAL */ } else { - LL_ASSERT_DBG(!cc->status); + LL_ASSERT(!cc->status); } } @@ -1607,7 +1607,7 @@ void ll_rx_mem_release(void **node_rx) * code block. */ case NODE_RX_TYPE_NONE: - LL_ASSERT_DBG(rx_free->hdr.type != NODE_RX_TYPE_NONE); + LL_ASSERT(rx_free->hdr.type != NODE_RX_TYPE_NONE); ll_rx_link_quota_inc(); ll_rx_release(rx_free); break; @@ -1652,7 +1652,7 @@ void ll_rx_mem_release(void **node_rx) break; } else { - LL_ASSERT_DBG(status == BT_HCI_ERR_OP_CANCELLED_BY_HOST); + LL_ASSERT(status == BT_HCI_ERR_OP_CANCELLED_BY_HOST); /* Fall through and release sync context */ } @@ -1716,12 +1716,12 @@ void ll_rx_mem_release(void **node_rx) memq_link_t *link; conn = ll_conn_get(rx_free->hdr.handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); - LL_ASSERT_DBG(!conn->lll.link_tx_free); + LL_ASSERT(!conn->lll.link_tx_free); link = memq_deinit(&conn->lll.memq_tx.head, &conn->lll.memq_tx.tail); - LL_ASSERT_DBG(link); + LL_ASSERT(link); conn->lll.link_tx_free = link; ll_conn_release(conn); @@ -1735,7 +1735,7 @@ void ll_rx_mem_release(void **node_rx) case NODE_RX_TYPE_EVENT_DONE: default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -1747,7 +1747,7 @@ void ll_rx_mem_release(void **node_rx) static void ll_rx_link_quota_update(int8_t delta) { - LL_ASSERT_DBG(delta <= 0 || mem_link_rx.quota_pdu < RX_CNT); + LL_ASSERT(delta <= 0 || mem_link_rx.quota_pdu < RX_CNT); mem_link_rx.quota_pdu += delta; } @@ -1837,7 +1837,7 @@ void ll_tx_ack_put(uint16_t handle, struct node_tx *node_tx) uint8_t idx; idx = MFIFO_ENQUEUE_GET(tx_ack, (void **)&tx); - LL_ASSERT_ERR(tx); + LL_ASSERT(tx); tx->handle = handle; tx->node = node_tx; @@ -1868,7 +1868,7 @@ void ll_radio_state_abort(void) ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } uint32_t ll_radio_state_is_idle(void) @@ -2053,7 +2053,7 @@ int ull_disable(void *lll) mfy.param = lll; ret = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); err = k_sem_take(&sem, ULL_DISABLE_TIMEOUT); if (err != 0) { @@ -2195,7 +2195,7 @@ void ull_prepare_dequeue(uint8_t caller_id) /* Assert if we exceed iterations processing the prepare queue */ - LL_ASSERT_ERR(loop); + LL_ASSERT(loop); loop--; /* Let LLL invoke the `prepare` interface if radio not in active @@ -2210,7 +2210,7 @@ void ull_prepare_dequeue(uint8_t caller_id) mfy.param = next; ret = mayfly_enqueue(caller_id, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } MFIFO_DEQUEUE(prep); @@ -2391,14 +2391,14 @@ static inline int init_reset(void) /* Acquire a link to initialize ull rx memq */ link = mem_acquire(&mem_link_rx.free); - LL_ASSERT_DBG(link); + LL_ASSERT(link); /* Initialize ull rx memq */ MEMQ_INIT(ull_rx, link); /* Acquire a link to initialize ll rx memq */ link = mem_acquire(&mem_link_rx.free); - LL_ASSERT_DBG(link); + LL_ASSERT(link); /* Initialize ll rx memq */ MEMQ_INIT(ll_rx, link); @@ -2428,29 +2428,29 @@ static void perform_lll_reset(void *param) /* Reset LLL */ err = lll_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #if defined(CONFIG_BT_BROADCASTER) /* Reset adv state */ err = lll_adv_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_BROADCASTER */ #if defined(CONFIG_BT_OBSERVER) /* Reset scan state */ err = lll_scan_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_OBSERVER */ #if defined(CONFIG_BT_CONN) /* Reset conn role */ err = lll_conn_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_CTLR_DF) err = lll_df_reset(); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #endif /* CONFIG_BT_CTLR_DF */ #if !defined(CONFIG_BT_CTLR_ZLI) @@ -2611,7 +2611,7 @@ static void rx_demux(void *param) link = memq_peek(memq_ull_rx.head, memq_ull_rx.tail, (void **)&rx); if (link) { - LL_ASSERT_DBG(rx); + LL_ASSERT(rx); #if defined(CONFIG_BT_CONN) link_tx = ull_conn_ack_by_last_peek(rx->ack_last, &handle, &tx); @@ -2910,7 +2910,7 @@ static inline void rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx) (void)memq_dequeue(memq_ull_rx.tail, &memq_ull_rx.head, NULL); conn = ll_conn_get(rx->handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); if (ull_cp_cc_awaiting_established(conn)) { ull_cp_cc_established(conn, BT_HCI_ERR_SUCCESS); @@ -3021,7 +3021,7 @@ static inline void rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx) rx_demux_rx_proprietary(link, rx, memq_ull_rx.tail, &memq_ull_rx.head); #else - LL_ASSERT_DBG(0); + LL_ASSERT(0); #endif /* CONFIG_BT_CTLR_USER_EXT */ } break; @@ -3037,7 +3037,7 @@ static inline void rx_demux_event_done(memq_link_t *link, /* Decrement prepare reference if ULL will not resume */ ull_hdr = done->param; if (ull_hdr) { - LL_ASSERT_DBG(ull_ref_get(ull_hdr)); + LL_ASSERT(ull_ref_get(ull_hdr)); ull_ref_dec(ull_hdr); } else { /* No reference count decrement, event placed back as resume event in the pipeline. @@ -3127,14 +3127,14 @@ static inline void rx_demux_event_done(memq_link_t *link, break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } /* Release done */ done->extra.type = 0U; release = RXFIFO_RELEASE(done, link, done); - LL_ASSERT_DBG(release == done); + LL_ASSERT(release == done); #if defined(CONFIG_BT_CTLR_LOW_LAT_ULL_DONE) /* dequeue prepare pipeline */ @@ -3218,7 +3218,7 @@ void *ull_rxfifo_release(uint8_t s, uint8_t n, uint8_t f, uint8_t *l, uint8_t *m */ uint32_t ull_get_wrapped_time_us(uint32_t time_now_us, int32_t time_diff_us) { - LL_ASSERT_DBG(time_now_us <= ULL_TIME_WRAPPING_POINT_US); + LL_ASSERT(time_now_us <= ULL_TIME_WRAPPING_POINT_US); uint32_t result = ((uint64_t)time_now_us + ULL_TIME_SPAN_FULL_US + time_diff_us) % ((uint64_t)ULL_TIME_SPAN_FULL_US); diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv.c b/subsys/bluetooth/controller/ll_sw/ull_adv.c index f9f1ee78afe4..18f3f24b11db 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv.c @@ -206,7 +206,7 @@ uint8_t ll_adv_set_hci_handle_get(uint8_t handle) struct ll_adv_set *adv; adv = ull_adv_set_get(handle); - LL_ASSERT_DBG(adv && adv->is_created); + LL_ASSERT(adv && adv->is_created); return adv->hci_handle; } @@ -442,8 +442,8 @@ uint8_t ll_adv_params_set(uint16_t interval, uint8_t adv_type, if (pdu->len == 0U) { adv->ad_data_backup.len = 0U; } else { - LL_ASSERT_DBG(pdu->len >= - offsetof(struct pdu_adv_adv_ind, data)); + LL_ASSERT(pdu->len >= + offsetof(struct pdu_adv_adv_ind, data)); adv->ad_data_backup.len = pdu->len - offsetof(struct pdu_adv_adv_ind, data); @@ -1970,9 +1970,9 @@ static uint32_t ticker_update_rand(struct ll_adv_set *adv, uint32_t ticks_delay_ ticks_adjust_minus, 0, 0, 0, 0, fp_op_func, adv); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY) || - (fp_op_func == NULL)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY) || + (fp_op_func == NULL)); return random_delay; } @@ -2090,7 +2090,7 @@ void ull_adv_done(struct node_rx_event_done *done) } handle = ull_adv_handle_get(adv); - LL_ASSERT_DBG(handle < BT_CTLR_ADV_SET); + LL_ASSERT(handle < BT_CTLR_ADV_SET); rx->hdr.type = NODE_RX_TYPE_EXT_ADV_TERMINATE; rx->hdr.handle = handle; @@ -2115,8 +2115,8 @@ void ull_adv_done(struct node_rx_event_done *done) ticker_stop_ext_op_cb, adv); } - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); #endif /* CONFIG_BT_CTLR_ADV_EXT */ } #endif /* CONFIG_BT_CTLR_ADV_EXT || CONFIG_BT_CTLR_JIT_SCHEDULING */ @@ -2369,7 +2369,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, (lazy != TICKER_LAZY_MUST_EXPIRE)) { /* Increment prepare reference count */ ref = ull_ref_inc(&adv->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); #if defined(CONFIG_BT_CTLR_ADV_EXT) && (CONFIG_BT_CTLR_ADV_AUX_SET > 0) && \ defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) @@ -2377,7 +2377,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint32_t ticks_to_expire; uint32_t other_remainder = 0U; - LL_ASSERT_DBG(context->other_expire_info); + LL_ASSERT(context->other_expire_info); /* Adjust ticks to expire based on remainder value */ ticks_to_expire = context->other_expire_info->ticks_to_expire; @@ -2405,7 +2405,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); #if defined(CONFIG_BT_CTLR_JIT_SCHEDULING) || \ (defined(CONFIG_BT_CTLR_ADV_EXT) && \ @@ -2496,7 +2496,7 @@ static void ticker_update_op_cb(uint32_t status, void *param) /* Reset update requested */ ticker_update_ack = ticker_update_req; -#if defined(CONFIG_BT_PERIPHERAL) +#if defined(CONFIG_BT_PERIPHERAL) && (defined(CONFIG_BT_ASSERT) || defined(CONFIG_ASSERT)) struct ll_adv_set *adv = param; struct pdu_adv *pdu = lll_adv_data_peek(&adv->lll); bool connectable = (pdu->type == PDU_ADV_TYPE_ADV_IND) || @@ -2508,13 +2508,13 @@ static void ticker_update_op_cb(uint32_t status, void *param) 0; #endif /* CONFIG_BT_PERIPHERAL && (CONFIG_BT_ASSERT || CONFIG_ASSERT) */ - LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || - (param == ull_disable_mark_get()) || + LL_ASSERT(status == TICKER_STATUS_SUCCESS || + param == ull_disable_mark_get() || #if defined(CONFIG_BT_PERIPHERAL) - /* if using connectable adv and lll.conn is 0 -> a connection is underway */ - (connectable && !adv->lll.conn) || + /* if using connectable adv and lll.conn is 0 -> a connection is underway */ + (connectable && !adv->lll.conn) || #endif /* CONFIG_BT_PERIPHERAL */ - 0); + 0); } #if defined(CONFIG_BT_PERIPHERAL) @@ -2527,13 +2527,13 @@ static void ticker_stop_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint32_t ret; handle = ull_adv_handle_get(adv); - LL_ASSERT_DBG(handle < BT_CTLR_ADV_SET); + LL_ASSERT(handle < BT_CTLR_ADV_SET); ret = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, TICKER_ID_ADV_BASE + handle, ticker_stop_op_cb, adv); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } static void ticker_stop_op_cb(uint32_t status, void *param) @@ -2560,7 +2560,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void adv_disable(void *param) @@ -2581,14 +2581,14 @@ static void adv_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } else { /* No pending LLL events */ disabled_cb(&adv->lll); @@ -2604,11 +2604,11 @@ static void disabled_cb(void *param) adv = ((struct lll_hdr *)param)->parent; - LL_ASSERT_DBG(adv->link_cc_free); + LL_ASSERT(adv->link_cc_free); link = adv->link_cc_free; adv->link_cc_free = NULL; - LL_ASSERT_DBG(adv->node_rx_cc_free); + LL_ASSERT(adv->node_rx_cc_free); rx = adv->node_rx_cc_free; adv->node_rx_cc_free = NULL; @@ -2628,7 +2628,7 @@ static void disabled_cb(void *param) ll_rx_put(link, rx); handle = ull_adv_handle_get(adv); - LL_ASSERT_DBG(handle < BT_CTLR_ADV_SET); + LL_ASSERT(handle < BT_CTLR_ADV_SET); rx = (void *)adv->lll.node_rx_adv_term; rx->hdr.type = NODE_RX_TYPE_EXT_ADV_TERMINATE; @@ -2649,9 +2649,9 @@ static void conn_release(struct ll_adv_set *adv) struct lll_conn *lll = adv->lll.conn; memq_link_t *link; - LL_ASSERT_DBG(!lll->link_tx_free); + LL_ASSERT(!lll->link_tx_free); link = memq_deinit(&lll->memq_tx.head, &lll->memq_tx.tail); - LL_ASSERT_DBG(link); + LL_ASSERT(link); lll->link_tx_free = link; ll_conn_release(lll->hdr.parent); @@ -2702,13 +2702,13 @@ static void ticker_stop_aux_op_cb(uint32_t status, void *param) static struct mayfly mfy = {0, 0, &link, NULL, aux_disable}; uint32_t ret; - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); /* Check if any pending LLL events that need to be aborted */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void aux_disable(void *param) @@ -2723,7 +2723,7 @@ static void aux_disable(void *param) aux = HDR_LLL2ULL(lll_aux); hdr = &aux->ull; if (ull_ref_get(hdr)) { - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = adv; hdr->disabled_cb = aux_disabled_cb; } else { @@ -2741,8 +2741,8 @@ static void aux_disabled_cb(void *param) TICKER_USER_ID_ULL_HIGH, (TICKER_ID_ADV_BASE + handle), ticker_stop_ext_op_cb, param); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } static void ticker_stop_ext_op_cb(uint32_t status, void *param) @@ -2762,7 +2762,7 @@ static void ticker_stop_ext_op_cb(uint32_t status, void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void ext_disable(void *param) @@ -2783,14 +2783,14 @@ static void ext_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = ext_disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } else { /* No pending LLL events */ ext_disabled_cb(&adv->lll); @@ -2852,7 +2852,7 @@ static inline uint8_t disable(uint8_t handle) #endif /* CONFIG_BT_PERIPHERAL */ mark = ull_disable_mark(adv); - LL_ASSERT_DBG(mark == adv); + LL_ASSERT(mark == adv); #if defined(CONFIG_BT_PERIPHERAL) if (adv->lll.is_hdcd) { @@ -2863,7 +2863,7 @@ static inline uint8_t disable(uint8_t handle) ret = ull_ticker_status_take(ret, &ret_cb); if (ret) { mark = ull_disable_unmark(adv); - LL_ASSERT_DBG(mark == adv); + LL_ASSERT(mark == adv); return BT_HCI_ERR_CMD_DISALLOWED; } @@ -2877,16 +2877,16 @@ static inline uint8_t disable(uint8_t handle) ret = ull_ticker_status_take(ret, &ret_cb); if (ret) { mark = ull_disable_unmark(adv); - LL_ASSERT_DBG(mark == adv); + LL_ASSERT(mark == adv); return BT_HCI_ERR_CMD_DISALLOWED; } err = ull_disable(&adv->lll); - LL_ASSERT_ERR(!err || (err == -EALREADY)); + LL_ASSERT(!err || (err == -EALREADY)); mark = ull_disable_unmark(adv); - LL_ASSERT_DBG(mark == adv); + LL_ASSERT(mark == adv); #if defined(CONFIG_BT_CTLR_ADV_EXT) && (CONFIG_BT_CTLR_ADV_AUX_SET > 0) struct lll_adv_aux *lll_aux = adv->lll.aux; @@ -3043,7 +3043,7 @@ static inline uint8_t *adv_pdu_adva_get(struct pdu_adv *pdu) /* All extended PDUs have AdvA at the same offset in common header */ if (pdu->type == PDU_ADV_TYPE_EXT_IND) { - LL_ASSERT_DBG(hdr_flags.adv_addr); + LL_ASSERT(hdr_flags.adv_addr); return &com_hdr->ext_hdr_adv_data[1]; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c index 8701f3f65fa9..d77c004069e0 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_aux.c @@ -256,7 +256,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Get the reference to auxiliary PDU chain */ pdu_prev = lll_adv_aux_data_alloc(adv->lll.aux, &idx); - LL_ASSERT_DBG(idx == sec_idx); + LL_ASSERT(idx == sec_idx); /* Current auxiliary PDU */ pdu = pdu_prev; @@ -269,7 +269,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, pdu_parent = lll_adv_aux_data_alloc(adv->lll.aux, &idx); - LL_ASSERT_DBG(idx == sec_idx); + LL_ASSERT(idx == sec_idx); /* Remove/Release any previous chain PDU * allocations @@ -340,7 +340,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, 0U, hdr_data); ad_len_prev = hdr_data[ULL_ADV_HDR_DATA_LEN_OFFSET]; - LL_ASSERT_DBG(!err || (err == BT_HCI_ERR_PACKET_TOO_LONG)); + LL_ASSERT(!err || (err == BT_HCI_ERR_PACKET_TOO_LONG)); /* Check of max supported AD data len */ ad_len_total += ad_len_prev; @@ -363,8 +363,8 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, pdu_chain_prev = lll_adv_pdu_linked_next_get(pdu_prev); pdu_chain = lll_adv_pdu_linked_next_get(pdu); - LL_ASSERT_DBG((pdu_chain_prev && pdu_chain) || - (!pdu_chain_prev && !pdu_chain)); + LL_ASSERT((pdu_chain_prev && pdu_chain) || + (!pdu_chain_prev && !pdu_chain)); } while (pdu_chain_prev); /* No AD data overflow */ @@ -408,7 +408,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ULL_ADV_PDU_HDR_FIELD_AD_DATA_APPEND, 0U, hdr_data); - LL_ASSERT_DBG((!chain_err) || (chain_err == BT_HCI_ERR_PACKET_TOO_LONG)); + LL_ASSERT((!chain_err) || (chain_err == BT_HCI_ERR_PACKET_TOO_LONG)); /* FIXME: the code has become quite complex, an alternative and simpler * implementation would be to first fill an array with all data that @@ -456,7 +456,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, chain_err = ull_adv_aux_pdu_set_clear(adv, pdu_prev, pdu, chain_add_fields, 0U, hdr_data); - LL_ASSERT_DBG(chain_err == 0U); + LL_ASSERT(chain_err == 0U); /* * in the next PDU we still need to add ad_len_chain bytes of data * but we do not have overflow, since we already added @@ -495,7 +495,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); - LL_ASSERT_ERR(pdu_chain); + LL_ASSERT(pdu_chain); /* Populate the appended chain PDU */ pdu_chain->type = PDU_ADV_TYPE_AUX_CHAIN_IND; @@ -509,8 +509,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, hdr_chain = (void *)&com_hdr_chain->ext_hdr_adv_data[0]; dptr_chain = (void *)hdr_chain; - LL_ASSERT_DBG(dptr_chain); - + LL_ASSERT(dptr_chain); /* Flags */ *dptr_chain = 0U; @@ -782,7 +781,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, } /* Scannable advertising shall have aux context allocated */ - LL_ASSERT_DBG(lll->aux); + LL_ASSERT(lll->aux); /* Get reference to previous secondary channel PDU */ sec_pdu_prev = lll_adv_aux_data_peek(lll->aux); @@ -1047,7 +1046,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, err = ull_adv_aux_pdu_set_clear(adv, sr_pdu_prev, sr_pdu, hdr_add_fields, 0U, hdr_data); - LL_ASSERT_DBG(!err || (err == BT_HCI_ERR_PACKET_TOO_LONG)); + LL_ASSERT(!err || (err == BT_HCI_ERR_PACKET_TOO_LONG)); /* Get PDUs previous AD data length */ ad_len_prev = @@ -1074,8 +1073,8 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, pdu_chain_prev = lll_adv_pdu_linked_next_get(sr_pdu_prev); pdu_chain = lll_adv_pdu_linked_next_get(sr_pdu); - LL_ASSERT_DBG((pdu_chain_prev && pdu_chain) || - (!pdu_chain_prev && !pdu_chain)); + LL_ASSERT((pdu_chain_prev && pdu_chain) || + (!pdu_chain_prev && !pdu_chain)); } while (pdu_chain_prev); if (err == BT_HCI_ERR_PACKET_TOO_LONG) { @@ -1142,7 +1141,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, /* Allocate new PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); - LL_ASSERT_ERR(pdu_chain); + LL_ASSERT(pdu_chain); /* Populate the appended chain PDU */ pdu_chain->type = PDU_ADV_TYPE_AUX_CHAIN_IND; @@ -1529,8 +1528,8 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, lll = &adv->lll; /* Can't have both flags set here since both use 'hdr_data' param */ - LL_ASSERT_DBG(!(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADVA) || - !(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AD_DATA)); + LL_ASSERT(!(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_ADVA) || + !(sec_hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AD_DATA)); /* Get reference to previous primary PDU data */ pri_pdu_prev = lll_adv_data_peek(lll); @@ -1580,7 +1579,7 @@ uint8_t ull_adv_aux_hdr_set_clear(struct ll_adv_set *adv, if (!lll_aux) { aux = ull_adv_aux_acquire(lll); if (!aux) { - LL_ASSERT_DBG(pri_pdu != pri_pdu_prev); + LL_ASSERT(pri_pdu != pri_pdu_prev); return BT_HCI_ERR_MEM_CAPACITY_EXCEEDED; } @@ -2567,7 +2566,7 @@ void ull_adv_sync_started_stopped(struct ll_adv_aux_set *aux) struct ll_adv_sync_set *sync; uint8_t aux_handle; - LL_ASSERT_DBG(lll_sync); + LL_ASSERT(lll_sync); sync = HDR_LLL2ULL(lll_sync); aux_handle = ull_adv_aux_handle_get(aux); @@ -2761,7 +2760,7 @@ void ull_adv_aux_offset_get(struct ll_adv_set *adv) mfy.param = adv; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } #endif /* !CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ @@ -2887,7 +2886,7 @@ void ull_adv_aux_chain_pdu_duplicate(struct pdu_adv *pdu_prev, if (!pdu_chain) { /* Get a new chain PDU */ pdu_chain = lll_adv_pdu_alloc_pdu_adv(); - LL_ASSERT_ERR(pdu_chain); + LL_ASSERT(pdu_chain); /* Copy previous chain PDU into new chain PDU */ (void)memcpy(pdu_chain, pdu_chain_prev, @@ -3241,7 +3240,7 @@ static void mfy_aux_offset_get(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT_ERR(success); + LL_ASSERT(success); /* FIXME: If the reference ticks change then implement the * compensation by adding the difference to the @@ -3250,9 +3249,9 @@ static void mfy_aux_offset_get(void *param) * ticker expiry that update the ticks_current. * For now assert until the fix implementation is added. */ - LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); + LL_ASSERT((ticks_current == ticks_previous) || retry--); - LL_ASSERT_ERR(id != TICKER_NULL); + LL_ASSERT(id != TICKER_NULL); } while (id != ticker_id); /* Adjust ticks to expire based on remainder value */ @@ -3327,7 +3326,7 @@ static void mfy_aux_offset_get(void *param) ticks_elapsed = ticker_ticks_diff_get(ticks_now, ticks_current); ticks_to_start = HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_XTAL_US) - HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_PREEMPT_MIN_US); - LL_ASSERT_ERR(ticks_elapsed < ticks_to_start); + LL_ASSERT(ticks_elapsed < ticks_to_start); } static void ticker_op_cb(uint32_t status, void *param) @@ -3359,7 +3358,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&aux->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); #if defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) #if defined(CONFIG_BT_CTLR_ADV_PERIODIC) @@ -3375,7 +3374,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint32_t ticks_to_expire; uint32_t sync_remainder_us = 0U; - LL_ASSERT_DBG(context->other_expire_info); + LL_ASSERT(context->other_expire_info); /* Reduce a tick for negative remainder and return positive remainder * value. @@ -3419,7 +3418,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); #if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && !defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) struct ll_adv_set *adv; @@ -3442,8 +3441,8 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, #if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) static void ticker_update_op_cb(uint32_t status, void *param) { - LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || - (param == ull_disable_mark_get())); + LL_ASSERT(status == TICKER_STATUS_SUCCESS || + param == ull_disable_mark_get()); } #endif /* !CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_iso.c b/subsys/bluetooth/controller/ll_sw/ull_adv_iso.c index 775baf1c63e7..f8f7cb35d64a 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_iso.c @@ -507,7 +507,7 @@ static uint8_t big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bi lll_adv_iso->max_sdu = max_sdu; res = util_saa_le32(lll_adv_iso->seed_access_addr, big_handle); - LL_ASSERT_DBG(!res); + LL_ASSERT(!res); (void)lll_csrand_get(lll_adv_iso->base_crc_init, sizeof(lll_adv_iso->base_crc_init)); @@ -604,11 +604,11 @@ static uint8_t big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bi /* Calculate GSK */ err = bt_crypto_h7(BIG1, bcode, igltk); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); err = bt_crypto_h6(igltk, BIG2, gltk); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); err = bt_crypto_h8(gltk, big_info->gskd, BIG3, gsk); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* Prepare the CCM parameters */ ccm_tx = &lll_adv_iso->ccm_tx; @@ -820,7 +820,7 @@ int ull_adv_iso_reset(void) } mark = ull_disable_mark(adv_iso); - LL_ASSERT_DBG(mark == adv_iso); + LL_ASSERT(mark == adv_iso); /* Stop event scheduling */ ret_cb = TICKER_STATUS_BUSY; @@ -830,20 +830,20 @@ int ull_adv_iso_reset(void) ret = ull_ticker_status_take(ret, &ret_cb); if (ret) { mark = ull_disable_unmark(adv_iso); - LL_ASSERT_DBG(mark == adv_iso); + LL_ASSERT(mark == adv_iso); /* Assert as there shall be a ticker instance active */ - LL_ASSERT_DBG(false); + LL_ASSERT(false); return BT_HCI_ERR_CMD_DISALLOWED; } /* Abort any events in LLL pipeline */ err = ull_disable(adv_iso_lll); - LL_ASSERT_ERR(!err || (err == -EALREADY)); + LL_ASSERT(!err || (err == -EALREADY)); mark = ull_disable_unmark(adv_iso); - LL_ASSERT_DBG(mark == adv_iso); + LL_ASSERT(mark == adv_iso); /* Reset associated streams */ while (adv_iso_lll->num_bis--) { @@ -970,7 +970,7 @@ void ull_adv_iso_offset_get(struct ll_adv_sync_set *sync) mfy.param = sync; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } #if defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) @@ -1071,8 +1071,8 @@ void ull_adv_iso_done_terminate(struct node_rx_event_done *done) ret = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, (TICKER_ID_ADV_ISO_BASE + lll->handle), ticker_stop_op_cb, adv_iso); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); /* Invalidate the handle */ lll->handle = LLL_ADV_HANDLE_INVALID; @@ -1115,10 +1115,10 @@ void ull_adv_iso_stream_release(struct ll_adv_iso_set *adv_iso) stream_handle = lll->stream_handle[lll->num_bis]; stream = ull_adv_iso_stream_get(stream_handle); - LL_ASSERT_DBG(!stream->link_tx_free); + LL_ASSERT(!stream->link_tx_free); link = memq_deinit(&stream->memq_tx.head, &stream->memq_tx.tail); - LL_ASSERT_DBG(link); + LL_ASSERT(link); stream->link_tx_free = link; dp = stream->dp; @@ -1220,7 +1220,7 @@ static uint8_t ptc_calc(const struct lll_adv_iso *lll, uint32_t event_spacing, * running buffer offset related to nse. Fix ptc and ptc_curr definitions, * until then lets have an assert check here. */ - LL_ASSERT_DBG(ptc <= BIT_MASK(4)); + LL_ASSERT(ptc <= BIT_MASK(4)); return ptc; } @@ -1378,11 +1378,11 @@ static void adv_iso_chm_complete_commit(struct lll_adv_iso *lll_iso) adv = HDR_LLL2ULL(lll_iso->adv); err = ull_adv_sync_pdu_alloc(adv, ULL_ADV_PDU_EXTRA_DATA_ALLOC_IF_EXIST, &pdu_prev, &pdu, NULL, NULL, &ter_idx); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* Copy content */ err = ull_adv_sync_duplicate(pdu_prev, pdu); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* Get the current ACAD */ acad = ull_adv_sync_get_acad(pdu, &acad_len); @@ -1390,7 +1390,7 @@ static void adv_iso_chm_complete_commit(struct lll_adv_iso *lll_iso) lll_sync = adv->lll.sync; /* Dev assert if ACAD empty */ - LL_ASSERT_DBG(acad_len); + LL_ASSERT(acad_len); /* Find the BIGInfo */ len = acad_len; @@ -1404,13 +1404,12 @@ static void adv_iso_chm_complete_commit(struct lll_adv_iso *lll_iso) ad_len += 1U; - LL_ASSERT_DBG(ad_len <= len); + LL_ASSERT(ad_len <= len); ad += ad_len; len -= ad_len; } while (len); - - LL_ASSERT_DBG(len); + LL_ASSERT(len); /* Get reference to BIGInfo */ bi = (void *)&ad[PDU_ADV_DATA_HEADER_DATA_OFFSET]; @@ -1475,11 +1474,11 @@ static void mfy_iso_offset_get(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT_ERR(success); + LL_ASSERT(success); - LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); + LL_ASSERT((ticks_current == ticks_previous) || retry--); - LL_ASSERT_ERR(id != TICKER_NULL); + LL_ASSERT(id != TICKER_NULL); } while (id != ticker_id); payload_count = lll_iso->payload_count + @@ -1594,7 +1593,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&adv_iso->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -1607,7 +1606,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy_lll_prepare); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); /* Calculate the BIG reference point of current BIG event */ remainder_us = remainder; @@ -1631,13 +1630,13 @@ static void ticker_stop_op_cb(uint32_t status, void *param) static struct mayfly mfy = {0U, 0U, &link, NULL, adv_iso_disable}; uint32_t ret; - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); /* Check if any pending LLL events that need to be aborted */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void adv_iso_disable(void *param) @@ -1658,14 +1657,14 @@ static void adv_iso_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } else { /* No pending LLL events */ disabled_cb(&adv_iso->lll); @@ -1681,7 +1680,7 @@ static void disabled_cb(void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void tx_lll_flush(void *param) @@ -1727,7 +1726,7 @@ static void tx_lll_flush(void *param) adv_iso = HDR_LLL2ULL(lll); rx = (void *)&adv_iso->node_rx_terminate; link = rx->hdr.link; - LL_ASSERT_DBG(link); + LL_ASSERT(link); rx->hdr.link = NULL; /* Enqueue the terminate towards ULL context */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c index ea1311c528e1..8c4d610b8874 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv_sync.c @@ -176,7 +176,7 @@ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags) lll_hdr_init(lll_sync, sync); err = util_aa_le32(lll_sync->access_addr); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); lll_sync->data_chan_id = lll_chan_id(lll_sync->access_addr); chm_last = lll_sync->chm_first; @@ -940,11 +940,11 @@ void ull_adv_sync_chm_complete(struct node_rx_pdu *rx) adv = HDR_LLL2ULL(lll_sync->adv); err = ull_adv_sync_pdu_alloc(adv, ULL_ADV_PDU_EXTRA_DATA_ALLOC_IF_EXIST, &pdu_prev, &pdu, NULL, NULL, &ter_idx); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); err = ull_adv_sync_remove_from_acad(lll_sync, pdu_prev, pdu, PDU_ADV_DATA_TYPE_CHANNEL_MAP_UPDATE_IND); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); lll_adv_sync_data_enqueue(lll_sync, ter_idx); } @@ -981,7 +981,7 @@ void ull_adv_sync_offset_get(struct ll_adv_set *adv) mfy.param = adv; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } #endif /* CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ @@ -1013,12 +1013,11 @@ void ull_adv_sync_pdu_init(struct pdu_adv *pdu, uint8_t ext_hdr_flags, *(uint8_t *)ext_hdr = ext_hdr_flags; dptr = ext_hdr->data; - LL_ASSERT_DBG(!(ext_hdr_flags & (ULL_ADV_PDU_HDR_FIELD_ADVA | - ULL_ADV_PDU_HDR_FIELD_TARGETA | + LL_ASSERT(!(ext_hdr_flags & (ULL_ADV_PDU_HDR_FIELD_ADVA | ULL_ADV_PDU_HDR_FIELD_TARGETA | #if !defined(CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT) - ULL_ADV_PDU_HDR_FIELD_ADI | + ULL_ADV_PDU_HDR_FIELD_ADI | #endif /* CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT */ - ULL_ADV_PDU_HDR_FIELD_SYNC_INFO))); + ULL_ADV_PDU_HDR_FIELD_SYNC_INFO))); #if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK) if (IS_ENABLED(CONFIG_BT_CTLR_DF_ADV_CTE_TX) && @@ -1175,8 +1174,8 @@ static void ull_adv_sync_add_to_header(struct pdu_adv *pdu, /* Push back any adv data - overflow will be returned via ad_overflow */ if (pdu->len > hdr->ext_hdr_len + 1U) { if (pdu->len > PDU_AC_EXT_PAYLOAD_SIZE_MAX - delta) { - LL_ASSERT_DBG(ad_overflow); - LL_ASSERT_DBG(overflow_len); + LL_ASSERT(ad_overflow); + LL_ASSERT(overflow_len); #if defined(CONFIG_BT_CTLR_ADV_SYNC_PDU_LINK) *overflow_len = delta - (PDU_AC_EXT_PAYLOAD_SIZE_MAX - pdu->len); memcpy(ad_overflow, @@ -1376,7 +1375,7 @@ static void ull_adv_sync_copy_pdu_header(struct pdu_adv *target_pdu, const uint8_t *source_dptr; uint8_t *target_dptr; - LL_ASSERT_DBG(target_pdu != source_pdu); + LL_ASSERT(target_pdu != source_pdu); /* Initialize PDU header */ target_pdu->type = source_pdu->type; @@ -1862,8 +1861,7 @@ static uint8_t ull_adv_sync_add_adi(struct lll_adv_sync *lll_sync, last_pdu = pdu; /* We should always have enough available overflow space to fit an ADI */ - LL_ASSERT_DBG((total_overflow_len + sizeof(struct pdu_adv_adi)) <= - sizeof(ad_overflow)); + LL_ASSERT(total_overflow_len + sizeof(struct pdu_adv_adi) <= sizeof(ad_overflow)); ull_adv_sync_add_to_header(pdu, &add_fields, &ad_overflow[total_overflow_len], &overflow_len); @@ -2056,7 +2054,7 @@ uint8_t ull_adv_sync_remove_from_acad(struct lll_adv_sync *lll_sync, ad_len += 1U; - LL_ASSERT_DBG(ad_len <= len); + LL_ASSERT(ad_len <= len); ad += ad_len; len -= ad_len; @@ -2182,8 +2180,7 @@ uint8_t ull_adv_sync_add_cteinfo(struct lll_adv_sync *lll_sync, last_pdu = pdu; /* We should always have enough available overflow space to fit CTEInfo */ - LL_ASSERT_DBG((total_overflow_len + sizeof(struct pdu_cte_info)) <= - sizeof(ad_overflow)); + LL_ASSERT(total_overflow_len + sizeof(struct pdu_cte_info) <= sizeof(ad_overflow)); ull_adv_sync_add_to_header(pdu, &add_fields, &ad_overflow[total_overflow_len], &overflow_len); @@ -2723,11 +2720,11 @@ static void mfy_sync_offset_get(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT_ERR(success); + LL_ASSERT(success); - LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); + LL_ASSERT((ticks_current == ticks_previous) || retry--); - LL_ASSERT_ERR(id != TICKER_NULL); + LL_ASSERT(id != TICKER_NULL); } while (id != ticker_id); /* Reduced a tick for negative remainder and return positive remainder @@ -2864,14 +2861,14 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&sync->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); #if defined(CONFIG_BT_CTLR_ADV_ISO) && \ defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) if (lll->iso) { struct lll_adv_iso *lll_iso = lll->iso; - LL_ASSERT_DBG(context->other_expire_info); + LL_ASSERT(context->other_expire_info); /* Check: No need for remainder in this case? */ lll_iso->ticks_sync_pdu_offset = context->other_expire_info->ticks_to_expire; @@ -2890,7 +2887,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); #if defined(CONFIG_BT_CTLR_ADV_ISO) && \ !defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) @@ -2906,7 +2903,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) static void ticker_update_op_cb(uint32_t status, void *param) { - LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || - (param == ull_disable_mark_get())); + LL_ASSERT(status == TICKER_STATUS_SUCCESS || + param == ull_disable_mark_get()); } #endif /* !CONFIG_BT_CTLR_ADV_ISO && CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_central.c b/subsys/bluetooth/controller/ll_sw/ull_central.c index f4bc227cfdf5..1771cda124bd 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_central.c +++ b/subsys/bluetooth/controller/ll_sw/ull_central.c @@ -190,7 +190,7 @@ uint8_t ll_create_connection(uint16_t scan_interval, uint16_t scan_window, conn_lll = &conn->lll; err = util_aa_le32(conn_lll->access_addr); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); lll_csrand_get(conn_lll->crc_init, sizeof(conn_lll->crc_init)); @@ -519,7 +519,7 @@ uint8_t ll_connect_disable(void **rx) conn = HDR_LLL2ULL(conn_lll); node_rx = (void *)&conn->llcp_terminate.node_rx.rx; link = node_rx->hdr.link; - LL_ASSERT_DBG(link); + LL_ASSERT(link); /* free the memq link early, as caller could overwrite it */ ll_rx_link_release(link); @@ -603,7 +603,7 @@ int ull_central_reset(void) } } - LL_ASSERT_DBG(scan); + LL_ASSERT(scan); scan->is_enabled = 0U; scan->lll.conn = NULL; @@ -628,13 +628,13 @@ void ull_central_cleanup(struct node_rx_pdu *rx_free) */ scan = HDR_LLL2ULL(rx_free->rx_ftr.param); conn_lll = scan->lll.conn; - LL_ASSERT_DBG(conn_lll); + LL_ASSERT(conn_lll); scan->lll.conn = NULL; - LL_ASSERT_DBG(!conn_lll->link_tx_free); + LL_ASSERT(!conn_lll->link_tx_free); link = memq_deinit(&conn_lll->memq_tx.head, &conn_lll->memq_tx.tail); - LL_ASSERT_DBG(link); + LL_ASSERT(link); conn_lll->link_tx_free = link; conn = HDR_LLL2ULL(conn_lll); @@ -655,7 +655,7 @@ void ull_central_cleanup(struct node_rx_pdu *rx_free) ull_scan_is_enabled_get(SCAN_HANDLE_PHY_CODED); if (scan_coded && scan_coded != scan) { conn_lll = scan_coded->lll.conn; - LL_ASSERT_DBG(conn_lll); + LL_ASSERT(conn_lll); scan_coded->lll.conn = NULL; scan_coded->is_enabled = 0U; @@ -699,7 +699,7 @@ void ull_central_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, * complete event. */ node = pdu_tx; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_cc)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_cc)); /* Populate the fields required for connection complete event */ cc = node; @@ -831,8 +831,8 @@ void ull_central_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, TICKER_USER_ID_ULL_HIGH, ticker_id_scan, ticks_at_stop, ticker_op_stop_scan_cb, scan); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #if defined(CONFIG_BT_CTLR_ADV_EXT) && defined(CONFIG_BT_CTLR_PHY_CODED) /* Determine if coded PHY was also enabled, if so, reset the assigned @@ -853,8 +853,8 @@ void ull_central_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, ticker_id_scan, ticker_op_stop_scan_other_cb, scan_other); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } } #endif /* CONFIG_BT_CTLR_ADV_EXT && CONFIG_BT_CTLR_PHY_CODED */ @@ -880,8 +880,8 @@ void ull_central_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, (conn->ull.ticks_slot + ticks_slot_overhead), ull_central_ticker_cb, conn, ticker_op_cb, (void *)__LINE__); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) /* enable ticker job, irrespective of disabled in this function so @@ -944,7 +944,7 @@ void ull_central_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&conn->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* Increment event counter. * @@ -972,7 +972,7 @@ void ull_central_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ err = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!err); + LL_ASSERT(!err); /* De-mux remaining tx nodes from FIFO */ ull_conn_tx_demux(UINT8_MAX); @@ -1044,7 +1044,7 @@ static void ticker_op_stop_scan_other_cb(uint32_t status, void *param) ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } } #endif /* CONFIG_BT_CTLR_ADV_EXT && CONFIG_BT_CTLR_PHY_CODED */ @@ -1053,7 +1053,7 @@ static void ticker_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); } static inline void conn_release(struct ll_scan_set *scan) @@ -1064,16 +1064,16 @@ static inline void conn_release(struct ll_scan_set *scan) memq_link_t *link; lll = scan->lll.conn; - LL_ASSERT_DBG(!lll->link_tx_free); + LL_ASSERT(!lll->link_tx_free); link = memq_deinit(&lll->memq_tx.head, &lll->memq_tx.tail); - LL_ASSERT_DBG(link); + LL_ASSERT(link); lll->link_tx_free = link; conn = HDR_LLL2ULL(lll); cc = (void *)&conn->llcp_terminate.node_rx.rx; link = cc->hdr.link; - LL_ASSERT_DBG(link); + LL_ASSERT(link); ll_rx_link_release(link); diff --git a/subsys/bluetooth/controller/ll_sw/ull_central_iso.c b/subsys/bluetooth/controller/ll_sw/ull_central_iso.c index d99896a975ba..c2f86c263dff 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_central_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_central_iso.c @@ -355,7 +355,7 @@ uint8_t ll_cig_parameters_commit(uint8_t cig_id, uint16_t *handles) tx = cis->lll.tx.bn && cis->lll.tx.max_pdu; rx = cis->lll.rx.bn && cis->lll.rx.max_pdu; } else { - LL_ASSERT_DBG(cis->framed || iso_interval_us >= cig->c_sdu_interval); + LL_ASSERT(cis->framed || iso_interval_us >= cig->c_sdu_interval); tx = cig->c_sdu_interval && cis->c_max_sdu; rx = cig->p_sdu_interval && cis->p_max_sdu; @@ -463,7 +463,7 @@ uint8_t ll_cig_parameters_commit(uint8_t cig_id, uint16_t *handles) if (!cig->central.test) { #if defined(CONFIG_BT_CTLR_CONN_ISO_LOW_LATENCY_POLICY) /* TODO: Only implemented for sequential packing */ - LL_ASSERT_ERR(cig->central.packing == BT_ISO_PACKING_SEQUENTIAL); + LL_ASSERT(cig->central.packing == BT_ISO_PACKING_SEQUENTIAL); /* Use symmetric flush timeout */ cis->lll.tx.ft = DIV_ROUND_UP(total_time, iso_interval_us); @@ -494,7 +494,7 @@ uint8_t ll_cig_parameters_commit(uint8_t cig_id, uint16_t *handles) } #else - LL_ASSERT_ERR(0); + LL_ASSERT(0); #endif cis->lll.nse = DIV_ROUND_UP(se[i].total_count, cis->lll.tx.ft); } @@ -736,7 +736,7 @@ void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle) /* Create access address */ err = util_aa_le32(cis->lll.access_addr); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* Initialize stream states */ cis->established = 0; @@ -754,7 +754,7 @@ void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle) /* Initiate CIS Request Control Procedure */ if (ull_cp_cis_create(conn, cis) == BT_HCI_ERR_SUCCESS) { - LL_ASSERT_DBG(cis->group); + LL_ASSERT(cis->group); if (cis->group->state == CIG_STATE_CONFIGURABLE) { /* This CIG is now initiating an ISO connection */ @@ -859,7 +859,7 @@ uint8_t ull_central_iso_setup(uint16_t cis_handle, /* ACL connection of the new CIS */ conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); #if defined(CONFIG_BT_CTLR_JIT_SCHEDULING) uint16_t event_counter; @@ -980,10 +980,10 @@ int ull_central_iso_cis_offset_get(uint16_t cis_handle, struct ll_conn *conn; cis = ll_conn_iso_stream_get(cis_handle); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); /* `ull_conn_llcp()` (caller of this function) is called before `ull_ref_inc()` hence we do * not need to use `ull_conn_event_counter()`. @@ -1032,7 +1032,7 @@ static void cig_offset_get(struct ll_conn_iso_stream *cis) mfy.param = cis; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void mfy_cig_offset_get(void *param) @@ -1055,7 +1055,7 @@ static void mfy_cig_offset_get(void *param) */ err = ull_sched_conn_iso_free_offset_get(cig->ull.ticks_slot, &ticks_to_expire); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* Calculate the offset for the select CIS in the CIG */ offset_min_us = HAL_TICKER_TICKS_TO_US(ticks_to_expire) + @@ -1063,7 +1063,7 @@ static void mfy_cig_offset_get(void *param) offset_min_us += cig->sync_delay - cis->sync_delay; conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); /* Ensure the offset is not greater than the ACL interval, considering * the minimum CIS offset requirement. @@ -1088,7 +1088,7 @@ static void cis_offset_get(struct ll_conn_iso_stream *cis) mfy.param = cis; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void mfy_cis_offset_get(void *param) @@ -1161,11 +1161,11 @@ static void mfy_cis_offset_get(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT_ERR(success); + LL_ASSERT(success); - LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); + LL_ASSERT((ticks_current == ticks_previous) || retry--); - LL_ASSERT_ERR(id != TICKER_NULL); + LL_ASSERT(id != TICKER_NULL); } while (id != ticker_id); /* Reduced a tick for negative remainder and return positive remainder @@ -1175,7 +1175,7 @@ static void mfy_cis_offset_get(void *param) cig_remainder_us = remainder; conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); /* Add a tick for negative remainder and return positive remainder * value. diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index fb6e98915d7f..e76b3e7147e9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -444,7 +444,7 @@ uint8_t ll_terminate_ind_send(uint16_t handle, uint8_t reason) } else if (cis->group->state == CIG_STATE_INITIATING) { conn = ll_connected_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); /* CIS is not yet established - try to cancel procedure */ if (ull_cp_cc_cancel(conn)) { @@ -452,7 +452,7 @@ uint8_t ll_terminate_ind_send(uint16_t handle, uint8_t reason) struct node_rx_pdu *node_terminate; node_terminate = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(node_terminate); + LL_ASSERT(node_terminate); node_terminate->hdr.handle = handle; node_terminate->hdr.type = NODE_RX_TYPE_TERMINATE; @@ -900,7 +900,7 @@ void ull_conn_setup(memq_link_t *rx_link, struct node_rx_pdu *rx) /* Setup connection in ULL disabled callback, * pass the node rx as disabled callback parameter. */ - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = rx; hdr->disabled_cb = conn_setup_adv_scan_disabled_cb; @@ -976,7 +976,7 @@ void ull_conn_rx(memq_link_t *link, struct node_rx_pdu **rx) int ull_conn_llcp(struct ll_conn *conn, uint32_t ticks_at_expire, uint32_t remainder, uint16_t lazy) { - LL_ASSERT_DBG(conn->lll.handle != LLL_HANDLE_INVALID); + LL_ASSERT(conn->lll.handle != LLL_HANDLE_INVALID); conn->llcp.prep.ticks_at_expire = ticks_at_expire; conn->llcp.prep.remainder = remainder; @@ -1410,9 +1410,9 @@ void ull_conn_done(struct node_rx_event_done *done) lazy, force, ticker_update_conn_op_cb, conn_ll); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)conn_ll == ull_disable_mark_get())); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)conn_ll == ull_disable_mark_get())); } } @@ -1479,7 +1479,7 @@ void ull_conn_tx_lll_enqueue(struct ll_conn *conn, uint8_t count) } link = mem_acquire(&mem_link_tx.free); - LL_ASSERT_ERR(link); + LL_ASSERT(link); /* Enqueue towards LLL */ memq_enqueue(link, tx, &conn->lll.memq_tx.tail); @@ -1542,7 +1542,7 @@ void ull_conn_lll_ack_enqueue(uint16_t handle, struct node_tx *tx) uint8_t idx; idx = MFIFO_ENQUEUE_GET(conn_ack, (void **)&lll_tx); - LL_ASSERT_ERR(lll_tx); + LL_ASSERT(lll_tx); lll_tx->handle = handle; lll_tx->node = tx; @@ -1555,13 +1555,13 @@ void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx) struct pdu_data *pdu_tx; pdu_tx = (void *)tx->pdu; - LL_ASSERT_DBG(pdu_tx->len); + LL_ASSERT(pdu_tx->len); if (pdu_tx->ll_id == PDU_DATA_LLID_CTRL) { if (handle != LLL_HANDLE_INVALID) { struct ll_conn *conn = ll_conn_get(handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); ull_cp_tx_ack(conn, tx); } @@ -1571,7 +1571,7 @@ void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx) struct ll_conn *conn; /* Tx Node not re-used, ensure link->next is non-NULL */ - LL_ASSERT_DBG(link->next); + LL_ASSERT(link->next); /* Pass conn as-is to ull_cp_release_tx(), NULL check is done there */ conn = ll_connected_get(handle); @@ -1585,12 +1585,12 @@ void ull_conn_tx_ack(uint16_t handle, memq_link_t *link, struct node_tx *tx) return; } - LL_ASSERT_DBG(!link->next); + LL_ASSERT(!link->next); } else if (handle == LLL_HANDLE_INVALID) { pdu_tx->ll_id = PDU_DATA_LLID_RESV; } else { - LL_ASSERT_DBG(handle != LLL_HANDLE_INVALID); + LL_ASSERT(handle != LLL_HANDLE_INVALID); } ll_tx_ack_put(handle, tx); @@ -1784,33 +1784,29 @@ static void ticker_update_conn_op_cb(uint32_t status, void *param) * when disconnecting or connection update (race between ticker_update * and ticker_stop calls). */ - LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || - (param == ull_update_mark_get()) || - (param == ull_disable_mark_get())); + LL_ASSERT(status == TICKER_STATUS_SUCCESS || + param == ull_update_mark_get() || + param == ull_disable_mark_get()); } static void ticker_stop_conn_op_cb(uint32_t status, void *param) { void *p; - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); p = ull_update_mark(param); - if (p != param) { - LL_ASSERT_DBG(false); - } + LL_ASSERT(p == param); } static void ticker_start_conn_op_cb(uint32_t status, void *param) { void *p; - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); p = ull_update_unmark(param); - if (p != param) { - LL_ASSERT_DBG(false); - } + LL_ASSERT(p == param); } static void conn_setup_adv_scan_disabled_cb(void *param) @@ -1849,7 +1845,7 @@ static void conn_setup_adv_scan_disabled_cb(void *param) #endif /* CONFIG_BT_PERIPHERAL */ default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -1860,7 +1856,7 @@ static inline void disable(uint16_t handle) int err; conn = ll_conn_get(handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); err = ull_ticker_stop_with_mark(TICKER_ID_CONN_BASE + handle, conn, &conn->lll); @@ -1913,9 +1909,9 @@ static void conn_cleanup_finalize(struct ll_conn *conn) TICKER_USER_ID_ULL_HIGH, TICKER_ID_CONN_BASE + lll->handle, ticker_stop_op_cb, conn); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)conn == ull_disable_mark_get())); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)conn == ull_disable_mark_get())); /* Invalidate the connection context */ lll->handle = LLL_HANDLE_INVALID; @@ -1972,7 +1968,7 @@ static void tx_ull_flush(struct ll_conn *conn) memq_link_t *link; link = mem_acquire(&mem_link_tx.free); - LL_ASSERT_ERR(link); + LL_ASSERT(link); /* Enqueue towards LLL */ memq_enqueue(link, tx, &conn->lll.memq_tx.tail); @@ -1991,7 +1987,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) * when disconnecting (race with ticker_stop), say on HCI Reset. */ if (status != TICKER_STATUS_SUCCESS) { - LL_ASSERT_ERR(param == ull_disable_mark_get()); + LL_ASSERT(param == ull_disable_mark_get()); return; } @@ -2000,7 +1996,7 @@ static void ticker_stop_op_cb(uint32_t status, void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void conn_disable(void *param) @@ -2021,14 +2017,14 @@ static void conn_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } else { /* No pending LLL events */ disabled_cb(&conn->lll); @@ -2044,7 +2040,7 @@ static void disabled_cb(void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void tx_lll_flush(void *param) @@ -2070,7 +2066,7 @@ static void tx_lll_flush(void *param) struct lll_tx *tx_buf; idx = MFIFO_ENQUEUE_GET(conn_ack, (void **)&tx_buf); - LL_ASSERT_ERR(tx_buf); + LL_ASSERT(tx_buf); tx_buf->handle = LLL_HANDLE_INVALID; tx_buf->node = tx; @@ -2090,7 +2086,7 @@ static void tx_lll_flush(void *param) * populated before this mayfly function was scheduled. */ rx = (void *)&conn->llcp_terminate.node_rx; - LL_ASSERT_DBG(rx->hdr.link); + LL_ASSERT(rx->hdr.link); link = rx->hdr.link; rx->hdr.link = NULL; @@ -2243,8 +2239,8 @@ static void ull_conn_update_ticker(struct ll_conn *conn, uint32_t ticker_status = ticker_stop_abs(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, ticker_id_conn, ticks_at_expire, ticker_stop_conn_op_cb, (void *)conn); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); ticker_status = ticker_start( TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, ticker_id_conn, ticks_at_expire, ticks_win_offset, HAL_TICKER_US_TO_TICKS(periodic_us), @@ -2264,8 +2260,8 @@ static void ull_conn_update_ticker(struct ll_conn *conn, ull_central_ticker_cb, #endif /* CONFIG_BT_PERIPHERAL && CONFIG_BT_CENTRAL */ conn, ticker_start_conn_op_cb, (void *)conn); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) /* enable ticker job, if disabled in this function */ @@ -2467,7 +2463,7 @@ void ull_conn_update_parameters(struct ll_conn *conn, uint8_t is_cu_proc, uint8_ #endif /*CONFIG_BT_CENTRAL */ default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -2829,7 +2825,7 @@ static uint32_t get_ticker_offset(uint8_t ticker_id, uint16_t *lazy) } } - LL_ASSERT_ERR(ret_cb == TICKER_STATUS_SUCCESS); + LL_ASSERT(ret_cb == TICKER_STATUS_SUCCESS); /* Reduced a tick for negative remainder and return positive remainder * value. @@ -2871,7 +2867,7 @@ static void mfy_past_sender_offset_get(void *param) if (adv_sync_handle != BT_HCI_ADV_HANDLE_INVALID) { const struct ll_adv_sync_set *adv_sync = ull_adv_sync_get(adv_sync_handle); - LL_ASSERT_DBG(adv_sync); + LL_ASSERT(adv_sync); ticker_offset_us = get_ticker_offset(TICKER_ID_ADV_SYNC_BASE + adv_sync_handle, &lazy); @@ -2883,7 +2879,7 @@ static void mfy_past_sender_offset_get(void *param) uint32_t interval_us = sync->interval * PERIODIC_INT_UNIT_US; uint32_t window_widening_event_us; - LL_ASSERT_DBG(sync); + LL_ASSERT(sync); ticker_offset_us = get_ticker_offset(TICKER_ID_SCAN_SYNC_BASE + sync_handle, &lazy); @@ -2927,7 +2923,7 @@ void ull_conn_past_sender_offset_request(struct ll_conn *conn) mfy.param = conn; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_SENDER */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c index 2ce0d8c3649b..a28655218738 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c @@ -460,7 +460,7 @@ void ull_conn_iso_done(struct node_rx_event_done *done) /* Check all CISes for supervison/establishment timeout */ for (cis_idx = 0; cis_idx < cig->lll.num_cis; cis_idx++) { cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); if (cis->lll.active && cis->lll.handle != LLL_HANDLE_INVALID) { /* CIS was setup and is now expected to be going */ @@ -485,7 +485,7 @@ void ull_conn_iso_done(struct node_rx_event_done *done) if (!cis->event_expire) { struct ll_conn *conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); cis->event_expire = RADIO_CONN_EVENTS( conn->supervision_timeout * 10U * 1000U, @@ -532,7 +532,7 @@ void ull_conn_iso_done(struct node_rx_event_done *done) struct ll_conn *conn; conn = ll_connected_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); ticker_status = ticker_update(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, @@ -543,9 +543,9 @@ void ull_conn_iso_done(struct node_rx_event_done *done) ticker_update_cig_op_cb, cig); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)conn == ull_disable_mark_get())); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)conn == ull_disable_mark_get())); } } @@ -569,8 +569,8 @@ void ull_conn_iso_cis_stop(struct ll_conn_iso_stream *cis, if (cis->teardown) { /* Teardown already started */ - LL_ASSERT_ERR(!cis->released_cb || !cis_released_cb || - (cis->released_cb == cis_released_cb)); + LL_ASSERT(!cis->released_cb || !cis_released_cb || + (cis->released_cb == cis_released_cb)); if (cis_released_cb) { cis->released_cb = cis_released_cb; @@ -600,15 +600,15 @@ void ull_conn_iso_cis_stop(struct ll_conn_iso_stream *cis, * continue CIS teardown from there. The disabled_cb cannot be * reserved for other use. */ - LL_ASSERT_ERR(!hdr->disabled_cb || - (hdr->disabled_cb == cis_disabled_cb)); + LL_ASSERT(!hdr->disabled_cb || + (hdr->disabled_cb == cis_disabled_cb)); hdr->disabled_param = mfy.param; hdr->disabled_cb = cis_disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } else { /* No pending LLL events */ @@ -707,7 +707,7 @@ void ull_conn_iso_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment CIS event counters */ for (int i = 0; i < cig->lll.num_cis; i++) { cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); /* New CIS may become available by creation prior to the CIG * event in which it has event_count == 0. Don't increment @@ -747,7 +747,7 @@ void ull_conn_iso_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&cig->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -767,7 +767,7 @@ void ull_conn_iso_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, mfy.fp = lll_peripheral_iso_prepare; #else /* !CONFIG_BT_CTLR_CENTRAL_ISO && !CONFIG_BT_CTLR_PERIPHERAL_ISO */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); return; #endif /* !CONFIG_BT_CTLR_CENTRAL_ISO && !CONFIG_BT_CTLR_PERIPHERAL_ISO */ @@ -791,7 +791,7 @@ void ull_conn_iso_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ err = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!err); + LL_ASSERT(!err); /* Handle ISO Transmit Test for this CIG */ ull_conn_iso_transmit_test_cig_interval(cig->lll.handle, ticks_at_expire); @@ -1022,9 +1022,9 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle, /* FIXME: Handle latency due to skipped ACL events around the * instant to start CIG */ - LL_ASSERT_ERR(instant_latency == 0U); + LL_ASSERT(instant_latency == 0U); } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); return; } @@ -1032,7 +1032,7 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle, /* Make sure we have time to service first subevent. TODO: Improve * by skipping interval(s) and incrementing event_count. */ - LL_ASSERT_ERR(cig_offset_us > 0); + LL_ASSERT(cig_offset_us > 0); ull_hdr_init(&cig->ull); @@ -1097,8 +1097,8 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle, TICKER_NULL_LAZY, ticks_slot, ull_conn_iso_ticker_cb, cig, ticker_start_op_cb, NULL); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); /* Set CIG and the first CIS state as active */ cig->state = CIG_STATE_ACTIVE; @@ -1114,7 +1114,7 @@ static void cis_lazy_fill(struct ll_conn_iso_stream *cis) mfy.param = cis; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 1U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void mfy_cis_lazy_fill(void *param) @@ -1177,11 +1177,11 @@ static void mfy_cis_lazy_fill(void *param) } success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT_ERR(success); + LL_ASSERT(success); - LL_ASSERT_ERR((ticks_current == ticks_previous) || retry--); + LL_ASSERT((ticks_current == ticks_previous) || retry--); - LL_ASSERT_ERR(id != TICKER_NULL); + LL_ASSERT(id != TICKER_NULL); } while (id != ticker_id); /* Set CIS active in already active CIG and any previous laziness in @@ -1203,7 +1203,7 @@ static void ticker_start_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); } static void ticker_update_cig_op_cb(uint32_t status, void *param) @@ -1212,9 +1212,9 @@ static void ticker_update_cig_op_cb(uint32_t status, void *param) * when disconnecting (race between ticker_update and ticker_stop * calls). TODO: Are the race-checks needed? */ - LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || - (param == ull_update_mark_get()) || - (param == ull_disable_mark_get())); + LL_ASSERT(status == TICKER_STATUS_SUCCESS || + param == ull_update_mark_get() || + param == ull_disable_mark_get()); } static void cis_disabled_cb(void *param) @@ -1241,7 +1241,7 @@ static void cis_disabled_cb(void *param) num_cis = cig->lll.num_cis; for (cis_idx = 0; cis_idx < num_cis; cis_idx++) { cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); if (!cis->lll.active && (cis->lll.flush != LLL_CIS_FLUSH_COMPLETE)) { /* CIS is not active and did not just complete LLL flush - skip it */ @@ -1257,7 +1257,7 @@ static void cis_disabled_cb(void *param) ll_iso_stream_released_cb_t cis_released_cb; conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); cis_released_cb = cis->released_cb; cis->released_cb = NULL; @@ -1285,7 +1285,7 @@ static void cis_disabled_cb(void *param) cis->lll.acl_handle = LLL_HANDLE_INVALID; } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } /* CIS is no longer active */ @@ -1313,7 +1313,7 @@ static void cis_disabled_cb(void *param) * further enqueuing of TX nodes for terminating CIS. */ node_terminate = ull_pdu_rx_alloc(); - LL_ASSERT_ERR(node_terminate); + LL_ASSERT(node_terminate); node_terminate->hdr.handle = cis->lll.handle; node_terminate->hdr.type = NODE_RX_TYPE_TERMINATE; *((uint8_t *)node_terminate->pdu) = cis->terminate_reason; @@ -1321,7 +1321,7 @@ static void cis_disabled_cb(void *param) ll_rx_put_sched(node_terminate->hdr.link, node_terminate); } else { conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); /* CIS was not established - complete the procedure with error */ if (ull_cp_cc_awaiting_established(conn)) { @@ -1369,8 +1369,8 @@ static void cis_disabled_cb(void *param) ticker_stop_op_cb, cig); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } } @@ -1395,7 +1395,7 @@ static void cis_tx_lll_flush(void *param) memq_link_t *link; cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); lll = &cis->lll; @@ -1423,9 +1423,9 @@ static void cis_tx_lll_flush(void *param) (void **)&tx); } - LL_ASSERT_DBG(!lll->link_tx_free); + LL_ASSERT(!lll->link_tx_free); link = memq_deinit(&lll->memq_tx.head, &lll->memq_tx.tail); - LL_ASSERT_DBG(link); + LL_ASSERT(link); lll->link_tx_free = link; lll->flush = LLL_CIS_FLUSH_COMPLETE; @@ -1444,13 +1444,13 @@ static void ticker_stop_op_cb(uint32_t status, void *param) uint32_t ret; /* Assert if race between thread and ULL */ - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); /* Check if any pending LLL events that need to be aborted */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void cig_disable(void *param) @@ -1471,14 +1471,14 @@ static void cig_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = cig_disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } else { /* No pending LLL events */ cig_disabled_cb(&cig->lll); @@ -1527,7 +1527,7 @@ void ull_conn_iso_transmit_test_cig_interval(uint16_t handle, uint32_t ticks_at_ uint8_t tx_sdu_count; cig = ll_conn_iso_group_get(handle); - LL_ASSERT_DBG(cig); + LL_ASSERT(cig); handle_iter = UINT16_MAX; @@ -1540,7 +1540,7 @@ void ull_conn_iso_transmit_test_cig_interval(uint16_t handle, uint32_t ticks_at_ sdu_interval = cig->c_sdu_interval; } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); return; } @@ -1550,7 +1550,7 @@ void ull_conn_iso_transmit_test_cig_interval(uint16_t handle, uint32_t ticks_at_ /* Handle ISO Transmit Test for all active CISes in the group */ for (uint8_t i = 0; i < cig->lll.num_cis; i++) { cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); if (!cis->hdr.test_mode.tx.enabled || cis->lll.handle == LLL_HANDLE_INVALID) { continue; diff --git a/subsys/bluetooth/controller/ll_sw/ull_df.c b/subsys/bluetooth/controller/ll_sw/ull_df.c index ac26c11cd725..ba04dac16489 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_df.c +++ b/subsys/bluetooth/controller/ll_sw/ull_df.c @@ -451,7 +451,7 @@ uint8_t ll_df_set_cl_iq_sampling_enable(uint16_t handle, #if defined(CONFIG_BT_CTLR_DF_DEBUG_ENABLE) /* When CTE is enabled there should be no iq report allocated */ - IF_SINGLE_ADV_SYNC_SET(LL_ASSERT_DBG(iq_report_alloc_count == 0)); + IF_SINGLE_ADV_SYNC_SET(LL_ASSERT(iq_report_alloc_count == 0)); #endif /* CONFIG_BT_CTLR_DF_DEBUG_ENABLE */ /* Enable of already enabled CTE updates AoA configuration */ @@ -510,7 +510,7 @@ uint8_t ll_df_set_cl_iq_sampling_enable(uint16_t handle, * Periodic sync lost event also disables the CTE sampling. */ err = ull_sync_slot_update(sync, slot_plus_us, slot_minus_us); - LL_ASSERT_DBG(err == 0 || err == -ENOENT); + LL_ASSERT(err == 0 || err == -ENOENT); } return 0; @@ -580,7 +580,7 @@ void ull_df_iq_report_mem_release(struct node_rx_pdu *rx) void ull_iq_report_link_inc_quota(int8_t delta) { - LL_ASSERT_DBG(delta <= 0 || mem_link_iq_report_quota_pdu < (IQ_REPORT_CNT)); + LL_ASSERT(delta <= 0 || mem_link_iq_report_quota_pdu < (IQ_REPORT_CNT)); mem_link_iq_report_quota_pdu += delta; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_filter.c b/subsys/bluetooth/controller/ll_sw/ull_filter.c index 8466e20731e9..bff2a0633674 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_filter.c +++ b/subsys/bluetooth/controller/ll_sw/ull_filter.c @@ -277,8 +277,8 @@ uint8_t ll_fal_remove(bt_addr_le_t *addr) #if defined(CONFIG_BT_CTLR_PRIVACY) void ll_rl_id_addr_get(uint8_t rl_idx, uint8_t *id_addr_type, uint8_t *id_addr) { - LL_ASSERT_DBG(rl_idx < CONFIG_BT_CTLR_RL_SIZE); - LL_ASSERT_DBG(rl[rl_idx].taken); + LL_ASSERT(rl_idx < CONFIG_BT_CTLR_RL_SIZE); + LL_ASSERT(rl[rl_idx].taken); *id_addr_type = rl[rl_idx].id_addr_type; (void)memcpy(id_addr, rl[rl_idx].id_addr.val, BDADDR_SIZE); @@ -607,7 +607,7 @@ bool ull_filter_ull_pal_listed(const uint8_t rl_idx, uint8_t *const addr_type, return false; } - LL_ASSERT_DBG(rl[rl_idx].taken); + LL_ASSERT(rl[rl_idx].taken); if (rl[rl_idx].pal) { uint8_t pal_idx = rl[rl_idx].pal - 1; @@ -663,7 +663,7 @@ struct lll_filter *ull_filter_lll_get(bool filter) } return &rl_filter; #else - LL_ASSERT_DBG(filter); + LL_ASSERT(filter); return &fal_filter; #endif } @@ -752,7 +752,7 @@ void ull_filter_rpa_update(bool timeout) sys_memcpy_swap(irk, peer_irks[rl[i].pirk_idx], IRK_SIZE); err = bt_rpa_create(irk, &rl[i].peer_rpa); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); #if defined(CONFIG_BT_CTLR_SW_DEFERRED_PRIVACY) /* a new key was added, * invalidate the known/unknown peer RPA cache @@ -766,7 +766,7 @@ void ull_filter_rpa_update(bool timeout) bt_addr_t rpa; err = bt_rpa_create(rl[i].local_irk, &rpa); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* pointer read/write assumed to be atomic * so that if ISR fires the local_rpa pointer * will always point to a valid full RPA @@ -805,7 +805,7 @@ const uint8_t *ull_filter_adva_get(uint8_t rl_idx) { /* AdvA */ if (rl_idx < ARRAY_SIZE(rl) && rl[rl_idx].lirk) { - LL_ASSERT_DBG(rl[rl_idx].rpas_ready); + LL_ASSERT(rl[rl_idx].rpas_ready); return rl[rl_idx].local_rpa->val; } @@ -884,13 +884,13 @@ uint8_t ull_filter_lll_rl_idx(bool filter, uint8_t devmatch_id) uint8_t i; if (filter) { - LL_ASSERT_DBG(devmatch_id < ARRAY_SIZE(fal)); - LL_ASSERT_DBG(fal[devmatch_id].taken); + LL_ASSERT(devmatch_id < ARRAY_SIZE(fal)); + LL_ASSERT(fal[devmatch_id].taken); i = fal[devmatch_id].rl_idx; } else { - LL_ASSERT_DBG(devmatch_id < ARRAY_SIZE(rl)); + LL_ASSERT(devmatch_id < ARRAY_SIZE(rl)); i = devmatch_id; - LL_ASSERT_DBG(rl[i].taken); + LL_ASSERT(rl[i].taken); } return i; @@ -900,10 +900,10 @@ uint8_t ull_filter_lll_rl_irk_idx(uint8_t irkmatch_id) { uint8_t i; - LL_ASSERT_DBG(irkmatch_id < peer_irk_count); + LL_ASSERT(irkmatch_id < peer_irk_count); i = peer_irk_rl_ids[irkmatch_id]; - LL_ASSERT_DBG(i < CONFIG_BT_CTLR_RL_SIZE); - LL_ASSERT_DBG(rl[i].taken); + LL_ASSERT(i < CONFIG_BT_CTLR_RL_SIZE); + LL_ASSERT(rl[i].taken); return i; } @@ -914,7 +914,7 @@ bool ull_filter_lll_irk_in_fal(uint8_t rl_idx) return false; } - LL_ASSERT_DBG(rl[rl_idx].taken); + LL_ASSERT(rl[rl_idx].taken); return rl[rl_idx].fal; } @@ -938,8 +938,8 @@ bool ull_filter_lll_rl_idx_allowed(uint8_t irkmatch_ok, uint8_t rl_idx) return true; } - LL_ASSERT_DBG(rl_idx < CONFIG_BT_CTLR_RL_SIZE); - LL_ASSERT_DBG(rl[rl_idx].taken); + LL_ASSERT(rl_idx < CONFIG_BT_CTLR_RL_SIZE); + LL_ASSERT(rl[rl_idx].taken); return !rl[rl_idx].pirk || rl[rl_idx].dev; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_iso.c b/subsys/bluetooth/controller/ll_sw/ull_iso.c index c32aaced2076..31a51a8bc145 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_iso.c @@ -662,7 +662,7 @@ static isoal_status_t ll_iso_test_sdu_alloc(const struct isoal_sink *sink_ctx, struct ll_conn_iso_stream *cis; cis = ll_iso_stream_connected_get(sink_ctx->session.handle); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); /* For unframed, SDU counter is the payload number */ cis->hdr.test_mode.rx.sdu_counter = @@ -675,7 +675,7 @@ static isoal_status_t ll_iso_test_sdu_alloc(const struct isoal_sink *sink_ctx, stream_handle = LL_BIS_SYNC_IDX_FROM_HANDLE(handle); sync_stream = ull_sync_iso_stream_get(stream_handle); - LL_ASSERT_DBG(sync_stream); + LL_ASSERT(sync_stream); sync_stream->test_mode->sdu_counter = (uint32_t)valid_pdu->meta->payload_number; @@ -709,7 +709,7 @@ static isoal_status_t ll_iso_test_sdu_emit(const struct isoal_sink * struct ll_conn_iso_stream *cis; cis = ll_iso_stream_connected_get(sink_ctx->session.handle); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); test_mode_rx = &cis->hdr.test_mode.rx; max_sdu = cis->c_max_sdu; @@ -721,7 +721,7 @@ static isoal_status_t ll_iso_test_sdu_emit(const struct isoal_sink * stream_handle = LL_BIS_SYNC_IDX_FROM_HANDLE(handle); sync_stream = ull_sync_iso_stream_get(stream_handle); - LL_ASSERT_DBG(sync_stream); + LL_ASSERT(sync_stream); sync_iso = ull_sync_iso_by_stream_get(stream_handle); @@ -790,7 +790,7 @@ static isoal_status_t ll_iso_test_sdu_emit(const struct isoal_sink * break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); return ISOAL_STATUS_ERR_SDU_EMIT; } break; @@ -1105,7 +1105,7 @@ void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire) uint8_t rand_8; cis = ll_iso_stream_connected_get(handle); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); if (!cis->hdr.test_mode.tx.enabled) { /* Transmit Test Mode not enabled */ @@ -1130,12 +1130,12 @@ void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire) break; case BT_HCI_ISO_TEST_MAX_SIZE_SDU: - LL_ASSERT_DBG(max_sdu > ISO_TEST_PACKET_COUNTER_SIZE); + LL_ASSERT(max_sdu > ISO_TEST_PACKET_COUNTER_SIZE); remaining_tx = max_sdu; break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); return; } @@ -1206,7 +1206,7 @@ void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire) /* Send to ISOAL */ err = isoal_tx_sdu_fragment(source_handle, &sdu); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); remaining_tx -= sdu.size; @@ -1222,7 +1222,7 @@ void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire) } else if (IS_ADV_ISO_HANDLE(handle)) { /* FIXME: Implement for broadcaster */ } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } #endif /* CONFIG_BT_CTLR_CONN_ISO */ @@ -1503,7 +1503,7 @@ void ull_iso_lll_ack_enqueue(uint16_t handle, struct node_tx_iso *node_tx) ll_tx_ack_put(handle, (void *)node_tx); ll_rx_sched(); } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -1538,7 +1538,7 @@ void ull_iso_lll_event_prepare(uint16_t handle, uint64_t event_count) isoal_tx_event_prepare(dp->source_hdl, event_count); } } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } #endif /* CONFIG_BT_CTLR_ADV_ISO || CONFIG_BT_CTLR_CONN_ISO */ @@ -1692,7 +1692,7 @@ static void iso_rx_demux(void *param) const isoal_status_t err = isoal_rx_pdu_recombine(dp->sink_hdl, &pckt_meta); - LL_ASSERT_ERR(err == ISOAL_STATUS_OK); /* TODO handle err */ + LL_ASSERT(err == ISOAL_STATUS_OK); /* TODO handle err */ } #endif /* CONFIG_BT_CTLR_CONN_ISO || CONFIG_BT_CTLR_SYNC_ISO */ @@ -1702,7 +1702,7 @@ static void iso_rx_demux(void *param) break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -1749,7 +1749,7 @@ void ll_iso_rx_dequeue(void) link = memq_dequeue(memq_ll_iso_rx.tail, &memq_ll_iso_rx.head, (void **)&rx); - LL_ASSERT_DBG(link); + LL_ASSERT(link); mem_release(link, &mem_link_iso_rx.free); @@ -1758,7 +1758,7 @@ void ll_iso_rx_dequeue(void) case NODE_RX_TYPE_ISO_PDU: break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -1825,7 +1825,7 @@ static isoal_status_t ll_iso_pdu_alloc(struct isoal_pdu_buffer *pdu_buffer) /* TODO: Report overflow to HCI and remove assert * data_buf_overflow(evt, BT_OVERFLOW_LINK_ISO) */ - LL_ASSERT_ERR(0); + LL_ASSERT(0); return ISOAL_STATUS_ERR_PDU_ALLOC; } @@ -1860,9 +1860,9 @@ static isoal_status_t ll_iso_pdu_write(struct isoal_pdu_buffer *pdu_buffer, ARG_UNUSED(pdu_offset); ARG_UNUSED(consume_len); - LL_ASSERT_DBG(pdu_buffer); - LL_ASSERT_DBG(pdu_buffer->pdu); - LL_ASSERT_DBG(sdu_payload); + LL_ASSERT(pdu_buffer); + LL_ASSERT(pdu_buffer->pdu); + LL_ASSERT(sdu_payload); if ((pdu_offset + consume_len) > pdu_buffer->size) { /* Exceeded PDU buffer */ @@ -1887,7 +1887,7 @@ static isoal_status_t ll_iso_pdu_emit(struct node_tx_iso *node_tx, memq_link_t *link; link = mem_acquire(&mem_link_iso_tx.free); - LL_ASSERT_ERR(link); + LL_ASSERT(link); if (ll_iso_tx_mem_enqueue(handle, node_tx, link)) { return ISOAL_STATUS_ERR_PDU_EMIT; @@ -1947,7 +1947,7 @@ static int init_reset(void) /* Acquire a link to initialize ull rx memq */ link = mem_acquire(&mem_link_iso_rx.free); - LL_ASSERT_DBG(link); + LL_ASSERT(link); #if defined(CONFIG_BT_CTLR_ISO_VENDOR_DATA_PATH) /* Initialize ull rx memq */ @@ -1956,7 +1956,7 @@ static int init_reset(void) /* Acquire a link to initialize ll_iso_rx memq */ link = mem_acquire(&mem_link_iso_rx.free); - LL_ASSERT_DBG(link); + LL_ASSERT(link); /* Initialize ll_iso_rx memq */ MEMQ_INIT(ll_iso_rx, link); @@ -2012,7 +2012,7 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, ticker_id = TICKER_ID_SCAN_SYNC_ISO_RESUME_BASE + group_handle; #endif /* CONFIG_BT_CTLR_SYNC_ISO */ } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } if (role == BT_HCI_ROLE_PERIPHERAL) { @@ -2031,7 +2031,7 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, cis = ll_conn_iso_stream_get(stream_handle); conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); phy = conn->lll.phy_rx; #endif /* CONFIG_BT_CTLR_CONN_ISO */ @@ -2045,7 +2045,7 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, phy = sync_iso->lll.phy; #endif /* CONFIG_BT_CTLR_SYNC_ISO */ } else { - LL_ASSERT_DBG(0); + LL_ASSERT(0); } resume_delay_us += @@ -2058,7 +2058,7 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, } resume_offset_us = (int32_t)(resume_timeout - resume_delay_us); - LL_ASSERT_DBG(resume_offset_us >= 0); + LL_ASSERT(resume_offset_us >= 0); /* Setup resume timeout as single-shot */ ret = ticker_start(TICKER_INSTANCE_ID_CTLR, @@ -2073,15 +2073,15 @@ void ull_iso_resume_ticker_start(struct lll_event *resume_event, ticker_resume_cb, resume_event, ticker_resume_op_cb, NULL); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } static void ticker_resume_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); } static void ticker_resume_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, @@ -2094,7 +2094,7 @@ static void ticker_resume_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint32_t ret; ARG_UNUSED(ticks_drift); - LL_ASSERT_DBG(lazy == 0); + LL_ASSERT(lazy == 0); resume_event = param; @@ -2109,6 +2109,6 @@ static void ticker_resume_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } #endif /* CONFIG_BT_CTLR_CONN_ISO || CONFIG_BT_CTLR_SYNC_ISO */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp.c b/subsys/bluetooth/controller/ll_sw/ull_llcp.c index f23b7f388bc2..0f9877ecc845 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp.c @@ -109,7 +109,7 @@ static struct proc_ctx *proc_ctx_acquire(struct llcp_mem_pool *owner) void llcp_proc_ctx_release(struct proc_ctx *ctx) { /* We need to have an owner otherwise the memory allocated would leak */ - LL_ASSERT_DBG(ctx->owner); + LL_ASSERT(ctx->owner); /* Release the memory back to the owner */ mem_release(ctx, &ctx->owner->free); @@ -297,7 +297,7 @@ void llcp_tx_resume_data(struct ll_conn *conn, enum llcp_tx_q_pause_data_mask re void llcp_rx_node_retain(struct proc_ctx *ctx) { - LL_ASSERT_DBG(ctx->node_ref.rx); + LL_ASSERT(ctx->node_ref.rx); /* Only retain if not already retained */ if (ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN) { @@ -311,7 +311,7 @@ void llcp_rx_node_retain(struct proc_ctx *ctx) void llcp_rx_node_release(struct proc_ctx *ctx) { - LL_ASSERT_DBG(ctx->node_ref.rx); + LL_ASSERT(ctx->node_ref.rx); /* Only release if retained */ if (ctx->node_ref.rx->hdr.type == NODE_RX_TYPE_RETAIN) { @@ -472,7 +472,7 @@ void ull_cp_release_tx(struct ll_conn *conn, struct node_tx *tx) { #if defined(LLCP_TX_CTRL_BUF_QUEUE_ENABLE) if (conn) { - LL_ASSERT_DBG(conn->llcp.tx_buffer_alloc > 0); + LL_ASSERT(conn->llcp.tx_buffer_alloc > 0); if (conn->llcp.tx_buffer_alloc > CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) { common_tx_buffer_alloc--; } @@ -511,7 +511,7 @@ int ull_cp_prt_elapse(struct ll_conn *conn, uint16_t elapsed_event, uint8_t *err struct proc_ctx *ctx; ctx = llcp_lr_peek(conn); - LL_ASSERT_DBG(ctx); + LL_ASSERT(ctx); if (ctx->proc == PROC_TERMINATE) { /* Active procedure is ACL Termination */ @@ -1026,7 +1026,7 @@ uint8_t ull_cp_conn_update(struct ll_conn *conn, uint16_t interval_min, uint16_t } #endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */ } else { - LL_ASSERT_DBG(0); /* Unknown procedure */ + LL_ASSERT(0); /* Unknown procedure */ } llcp_lr_enqueue(conn, ctx); @@ -1051,7 +1051,7 @@ uint8_t ull_cp_periodic_sync(struct ll_conn *conn, struct ll_sync_set *sync, uint8_t phy; /* Exactly one of the sync and adv_sync pointers should be non-null */ - LL_ASSERT_DBG((!adv_sync && sync) || (adv_sync && !sync)); + LL_ASSERT((!adv_sync && sync) || (adv_sync && !sync)); if (!feature_peer_periodic_sync_recv(conn)) { return BT_HCI_ERR_UNSUPP_REMOTE_FEATURE; @@ -1080,7 +1080,7 @@ uint8_t ull_cp_periodic_sync(struct ll_conn *conn, struct ll_sync_set *sync, rl_idx = ull_filter_rl_find(addr_type, sync->peer_id_addr, NULL); /* A resolved address must be present in the resolve list */ - LL_ASSERT_DBG(rl_idx < ll_rl_size_get()); + LL_ASSERT(rl_idx < ll_rl_size_get()); /* Generate RPAs if required */ ull_filter_rpa_update(false); @@ -1999,7 +1999,7 @@ void ull_cp_rx(struct ll_conn *conn, memq_link_t *link, struct node_rx_pdu *rx) */ /* Process PDU as a new remote request */ - LL_ASSERT_DBG(pdu_valid); + LL_ASSERT(pdu_valid); llcp_rr_new(conn, link, rx, true); } else { /* Local active procedure diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c index e70d6e664fc9..6e12571d88c6 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c @@ -65,7 +65,7 @@ static void cc_ntf_established(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate ntf node */ ntf = ctx->node_ref.rx; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); ctx->node_ref.rx = NULL; piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN); @@ -146,7 +146,7 @@ static void llcp_rp_cc_tx_rsp(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; conn_event_count = ctx->data.cis_create.conn_event_count; @@ -201,7 +201,7 @@ static void llcp_rp_cc_tx_reject(struct ll_conn *conn, struct proc_ctx *ctx, uin /* Allocate tx node */ tx = ctx->node_ref.tx; - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); ctx->node_ref.tx = NULL; pdu = (struct pdu_data *)tx->pdu; @@ -221,7 +221,7 @@ static void rp_cc_ntf_create(struct ll_conn *conn, struct proc_ctx *ctx) ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); ntf->hdr.type = NODE_RX_TYPE_CIS_REQUEST; ntf->hdr.handle = conn->lll.handle; @@ -490,7 +490,7 @@ static void rp_cc_state_wait_rx_cis_ind(struct ll_conn *conn, struct proc_ctx *c } /* If we get to here the CIG_ID referred in req/acquire has become void/invalid */ /* This cannot happen unless the universe has started to deflate */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); case RP_CC_EVT_REJECT: /* Handle CIS creation rejection */ break; @@ -656,7 +656,7 @@ static void rp_cc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -767,7 +767,7 @@ static void lp_cc_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -781,7 +781,7 @@ static void lp_cc_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) break; default: /* Unknown opcode */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -929,7 +929,7 @@ static void lp_cc_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t ev break; default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; @@ -971,7 +971,7 @@ static void cc_prepare_cis_ind(struct ll_conn *conn, struct proc_ctx *ctx) &ctx->data.cis_create.cis_offset_max, &ctx->data.cis_create.conn_event_count, ctx->data.cis_create.aa); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); ctx->state = LP_CC_STATE_WAIT_INSTANT; ctx->rx_opcode = PDU_DATA_LLCTRL_TYPE_UNUSED; @@ -1054,7 +1054,7 @@ static void lp_cc_st_wait_rx_cis_rsp_cancel(struct ll_conn *conn, struct proc_ct case LP_CC_EVT_CIS_RSP: /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -1177,7 +1177,7 @@ static void lp_cc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c index 772aba812d15..04b51ce79947 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c @@ -89,7 +89,7 @@ static void lp_chmu_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -180,7 +180,7 @@ static void lp_chmu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -293,7 +293,7 @@ static void rp_chmu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c index 84098f1b149f..b0e28e124bdc 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c @@ -159,7 +159,7 @@ static void lp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -218,7 +218,7 @@ static void lp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -255,7 +255,7 @@ static void lp_comm_ntf_feature_exchange(struct ll_conn *conn, struct proc_ctx * break; default: /* Unexpected PDU, should not get through, so ASSERT */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -268,7 +268,7 @@ static void lp_comm_ntf_version_ind(struct ll_conn *conn, struct proc_ctx *ctx, break; default: /* Unexpected PDU, should not get through, so ASSERT */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -305,7 +305,7 @@ static void lp_comm_ntf_cte_req(struct ll_conn *conn, struct proc_ctx *ctx, stru break; default: /* Unexpected PDU, should not get through, so ASSERT */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -393,7 +393,7 @@ static void lp_comm_ntf(struct ll_conn *conn, struct proc_ctx *ctx) if (!ntf) { /* Allocate ntf node */ ntf = llcp_ntf_alloc(); - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); piggy_back = 0U; } @@ -424,7 +424,7 @@ static void lp_comm_ntf(struct ll_conn *conn, struct proc_ctx *ctx) break; #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -585,7 +585,7 @@ static void lp_comm_complete(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -716,7 +716,7 @@ static void lp_comm_send_req(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -819,7 +819,7 @@ static void lp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct break; case PDU_DATA_LLCTRL_TYPE_TERMINATE_IND: /* No response expected */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; #if defined(CONFIG_BT_CTLR_DATA_LENGTH) case PDU_DATA_LLCTRL_TYPE_LENGTH_RSP: @@ -844,7 +844,7 @@ static void lp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct break; default: /* Unknown opcode */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -889,7 +889,7 @@ static void lp_comm_st_wait_ntf_avail(struct ll_conn *conn, struct proc_ctx *ctx * out of the ones handled in ull_llcp_common should end up waiting for * non-piggy-back'ed NTF */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; @@ -919,7 +919,7 @@ static void lp_comm_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -1034,7 +1034,7 @@ static void rp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown opcode */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -1045,7 +1045,7 @@ static void rp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -1115,7 +1115,7 @@ static void rp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -1147,10 +1147,10 @@ static void rp_comm_ntf(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t gene /* Allocate ntf node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); /* This should be an 'old' RX node, so put/sched when done */ - LL_ASSERT_DBG(ntf->hdr.type == NODE_RX_TYPE_RETAIN); + LL_ASSERT(ntf->hdr.type == NODE_RX_TYPE_RETAIN); /* And release memory if no NTF to be generated */ ntf->hdr.type = NODE_RX_TYPE_RELEASE; @@ -1159,7 +1159,7 @@ static void rp_comm_ntf(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t gene ntf->hdr.type = NODE_RX_TYPE_DC_PDU; ntf->hdr.handle = conn->lll.handle; pdu = (struct pdu_data *)ntf->pdu; - LL_ASSERT_DBG(ctx->proc == PROC_DATA_LENGTH_UPDATE); + LL_ASSERT(ctx->proc == PROC_DATA_LENGTH_UPDATE); llcp_ntf_encode_length_change(conn, pdu); } @@ -1291,7 +1291,7 @@ static void rp_comm_send_rsp(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -1313,7 +1313,7 @@ static void rp_comm_st_postpone_terminate(struct ll_conn *conn, struct proc_ctx { switch (evt) { case RP_COMMON_EVT_RUN: - LL_ASSERT_DBG(ctx->proc == PROC_TERMINATE); + LL_ASSERT(ctx->proc == PROC_TERMINATE); /* Note: now we terminate, mimicking legacy LLCP behaviour * A check should be added to ensure that the ack of the terminate_ind was @@ -1415,7 +1415,7 @@ static void rp_comm_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c index d1a91c8d673d..5fc5a261640f 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c @@ -260,7 +260,7 @@ static void cu_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate ntf node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN); @@ -300,7 +300,7 @@ static void lp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) if (!tx) { /* Allocate tx node if non pre-alloc'ed */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); } pdu = (struct pdu_data *)tx->pdu; @@ -323,7 +323,7 @@ static void lp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) #endif /* CONFIG_BT_CENTRAL */ default: /* Unknown opcode */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -408,7 +408,7 @@ static void lp_cu_send_conn_param_req(struct ll_conn *conn, struct proc_ctx *ctx #endif /* CONFIG_BT_PERIPHERAL */ default: /* Unknown role */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -491,7 +491,7 @@ static void lp_cu_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t ev #endif /* CONFIG_BT_CENTRAL */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; @@ -761,7 +761,7 @@ static void lp_cu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -815,7 +815,7 @@ static void rp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) if (!tx) { /* Allocate tx node if non pre-alloc'ed */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); } pdu = (struct pdu_data *)tx->pdu; @@ -841,7 +841,7 @@ static void rp_cu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) break; default: /* Unknown opcode */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -869,7 +869,7 @@ static void rp_cu_conn_param_req_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate ntf node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN); @@ -903,7 +903,7 @@ static void rp_cu_send_conn_update_ind_finalize(struct ll_conn *conn, struct pro uint8_t evt, void *param) { /* Central role path, should not get here with !=NULL rx-node reference */ - LL_ASSERT_DBG(ctx->node_ref.rx == NULL); + LL_ASSERT(ctx->node_ref.rx == NULL); /* We pre-alloc NTF node */ ctx->node_ref.rx = llcp_ntf_alloc(); @@ -1015,7 +1015,7 @@ static void rp_cu_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t ev break; default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } break; @@ -1162,7 +1162,7 @@ static void rp_cu_state_wait_conn_param_req_reply_continue(struct ll_conn *conn, } } else { /* Unknown role */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } break; default: @@ -1313,7 +1313,7 @@ static void rp_cu_st_wait_rx_conn_update_ind(struct ll_conn *conn, struct proc_c break; default: /* Unknown role */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } default: /* Ignore other evts */ @@ -1382,7 +1382,7 @@ static void rp_cu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c index 13fae31f9e50..392f37963ae0 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c @@ -187,7 +187,7 @@ static struct node_tx *llcp_lp_enc_tx(struct ll_conn *conn, struct proc_ctx *ctx /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -206,7 +206,7 @@ static struct node_tx *llcp_lp_enc_tx(struct ll_conn *conn, struct proc_ctx *ctx llcp_pdu_encode_pause_enc_rsp(pdu); break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -228,7 +228,7 @@ static void lp_enc_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Piggy-back on RX node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); ntf->hdr.type = NODE_RX_TYPE_DC_PDU; ntf->hdr.handle = conn->lll.handle; @@ -244,7 +244,7 @@ static void lp_enc_ntf(struct ll_conn *conn, struct proc_ctx *ctx) ntf->hdr.type = NODE_RX_TYPE_ENC_REFRESH; } else { /* Should never happen */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } else { llcp_pdu_encode_reject_ind(pdu, ctx->data.enc.error); @@ -379,7 +379,7 @@ static inline uint8_t reject_error_code(struct pdu_data *pdu) #endif /* CONFIG_BT_CTLR_EXT_REJ_IND */ } else { /* Called with an invalid PDU */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); /* Keep compiler happy */ error = BT_HCI_ERR_UNSPECIFIED; @@ -639,7 +639,7 @@ static void lp_enc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8 break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -705,7 +705,7 @@ static struct node_tx *llcp_rp_enc_tx(struct ll_conn *conn, struct proc_ctx *ctx /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -732,7 +732,7 @@ static struct node_tx *llcp_rp_enc_tx(struct ll_conn *conn, struct proc_ctx *ctx } break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -755,7 +755,7 @@ static void rp_enc_ntf_ltk(struct ll_conn *conn, struct proc_ctx *ctx) /* Piggy-back on RX node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN); @@ -780,7 +780,7 @@ static void rp_enc_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Piggy-back on RX node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); ntf->hdr.type = NODE_RX_TYPE_DC_PDU; ntf->hdr.handle = conn->lll.handle; @@ -795,7 +795,7 @@ static void rp_enc_ntf(struct ll_conn *conn, struct proc_ctx *ctx) ntf->hdr.type = NODE_RX_TYPE_ENC_REFRESH; } else { /* Should never happen */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -884,7 +884,7 @@ static void rp_enc_send_reject_ind(struct ll_conn *conn, struct proc_ctx *ctx, u */ } else { /* Shouldn't happen */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } } @@ -1232,7 +1232,7 @@ static void rp_enc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8 break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c index 812d84955aa2..8c97bcdfb5f7 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c @@ -79,13 +79,13 @@ void llcp_lr_check_done(struct ll_conn *conn, struct proc_ctx *ctx) struct proc_ctx *ctx_header; ctx_header = llcp_lr_peek(conn); - LL_ASSERT_DBG(ctx_header == ctx); + LL_ASSERT(ctx_header == ctx); /* If we have a node rx it must not be marked RETAIN as * the memory referenced would leak */ - LL_ASSERT_DBG(ctx->node_ref.rx == NULL || - ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN); + LL_ASSERT(ctx->node_ref.rx == NULL || + ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN); lr_dequeue(conn); @@ -326,7 +326,7 @@ void llcp_lr_rx(struct ll_conn *conn, struct proc_ctx *ctx, memq_link_t *link, #endif /* CONFIG_BT_CTLR_SCA_UPDATE */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -475,7 +475,7 @@ static void lr_act_run(struct ll_conn *conn) #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_SENDER */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -487,7 +487,7 @@ static void lr_act_complete(struct ll_conn *conn) struct proc_ctx *ctx; ctx = llcp_lr_peek(conn); - LL_ASSERT_DBG(ctx != NULL); + LL_ASSERT(ctx != NULL); /* Stop procedure response timeout timer */ llcp_lr_prt_stop(conn); @@ -617,7 +617,7 @@ static void lr_execute_fsm(struct ll_conn *conn, uint8_t evt, void *param) break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_past.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_past.c index 53e16b9f52ad..8b8f88147e0f 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_past.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_past.c @@ -326,7 +326,7 @@ static void rp_past_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint #endif /* CONFIG_BT_CTLR_SW_DEFERRED_PRIVACY */ default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } @@ -400,7 +400,7 @@ static void lp_past_tx(struct ll_conn *conn, struct proc_ctx *ctx) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -563,7 +563,7 @@ static void lp_past_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c index 9e8ebaf7a401..a9b48be2702f 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c @@ -379,7 +379,7 @@ static void lp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo struct node_tx *tx; struct pdu_data *pdu; - LL_ASSERT_DBG(ctx->node_ref.tx); + LL_ASSERT(ctx->node_ref.tx); #if defined(CONFIG_BT_CTLR_DATA_LENGTH) if (!((ctx->tx_opcode == PDU_DATA_LLCTRL_TYPE_PHY_REQ) && @@ -390,7 +390,7 @@ static void lp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo return; } ctx->data.pu.ntf_dle_node = llcp_ntf_alloc(); - LL_ASSERT_DBG(ctx->data.pu.ntf_dle_node); + LL_ASSERT(ctx->data.pu.ntf_dle_node); } #endif /* CONFIG_BT_CTLR_DATA_LENGTH */ @@ -417,7 +417,7 @@ static void lp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo break; #endif /* CONFIG_BT_CENTRAL */ default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); } /* Enqueue LL Control PDU towards LLL */ @@ -435,10 +435,10 @@ static void pu_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Piggy-back on stored RX node */ ntf = ctx->node_ref.rx; ctx->node_ref.rx = NULL; - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); if (ctx->data.pu.ntf_pu) { - LL_ASSERT_DBG(ntf->hdr.type == NODE_RX_TYPE_RETAIN); + LL_ASSERT(ntf->hdr.type == NODE_RX_TYPE_RETAIN); ntf->hdr.type = NODE_RX_TYPE_PHY_UPDATE; ntf->hdr.handle = conn->lll.handle; pdu = (struct node_rx_pu *)ntf->pdu; @@ -476,7 +476,7 @@ static void pu_dle_ntf(struct ll_conn *conn, struct proc_ctx *ctx) /* Signal to release pre-allocated node in case there is no DLE ntf */ ntf->hdr.type = NODE_RX_TYPE_RELEASE; } else { - LL_ASSERT_DBG(ntf); + LL_ASSERT(ntf); ntf->hdr.type = NODE_RX_TYPE_DC_PDU; ntf->hdr.handle = conn->lll.handle; @@ -646,7 +646,7 @@ static void lp_pu_st_wait_tx_ack_phy_req(struct ll_conn *conn, struct proc_ctx * #endif /* CONFIG_BT_PERIPHERAL */ default: /* Unknown role */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } break; @@ -675,7 +675,7 @@ static void lp_pu_st_wait_tx_ack_phy_update_ind(struct ll_conn *conn, struct pro { switch (evt) { case LP_PU_EVT_ACK: - LL_ASSERT_DBG(conn->lll.role == BT_HCI_ROLE_CENTRAL); + LL_ASSERT(conn->lll.role == BT_HCI_ROLE_CENTRAL); if (ctx->data.pu.p_to_c_phy || ctx->data.pu.c_to_p_phy) { /* Either phys should change */ if (ctx->data.pu.c_to_p_phy) { @@ -711,7 +711,7 @@ static void lp_pu_st_wait_rx_phy_update_ind(struct ll_conn *conn, struct proc_ct { switch (evt) { case LP_PU_EVT_PHY_UPDATE_IND: - LL_ASSERT_DBG(conn->lll.role == BT_HCI_ROLE_PERIPHERAL); + LL_ASSERT(conn->lll.role == BT_HCI_ROLE_PERIPHERAL); llcp_rr_set_incompat(conn, INCOMPAT_RESERVED); llcp_pdu_decode_phy_update_ind(ctx, (struct pdu_data *)param); const uint8_t end_procedure = pu_check_update_ind(conn, ctx); @@ -867,7 +867,7 @@ static void lp_pu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ #endif /* CONFIG_BT_CTLR_DATA_LENGTH */ default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } @@ -930,7 +930,7 @@ static void rp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo struct node_tx *tx; struct pdu_data *pdu; - LL_ASSERT_DBG(ctx->node_ref.tx); + LL_ASSERT(ctx->node_ref.tx); #if defined(CONFIG_BT_CTLR_DATA_LENGTH) if (!llcp_ntf_alloc_is_available()) { @@ -940,7 +940,7 @@ static void rp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo } ctx->data.pu.ntf_dle_node = llcp_ntf_alloc(); - LL_ASSERT_DBG(ctx->data.pu.ntf_dle_node); + LL_ASSERT(ctx->data.pu.ntf_dle_node); #endif /* CONFIG_BT_CTLR_DATA_LENGTH */ tx = ctx->node_ref.tx; @@ -967,7 +967,7 @@ static void rp_pu_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t evt, vo break; #endif /* CONFIG_BT_CENTRAL */ default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); } /* Enqueue LL Control PDU towards LLL */ @@ -1073,7 +1073,7 @@ static void rp_pu_st_wait_rx_phy_req(struct ll_conn *conn, struct proc_ctx *ctx, #endif /* CONFIG_BT_PERIPHERAL */ default: /* Unknown role */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } break; default: @@ -1105,7 +1105,7 @@ static void rp_pu_st_wait_tx_ack_phy(struct ll_conn *conn, struct proc_ctx *ctx, if (0) { #if defined(CONFIG_BT_PERIPHERAL) } else if (ctx->state == RP_PU_STATE_WAIT_TX_ACK_PHY_RSP) { - LL_ASSERT_DBG(conn->lll.role == BT_HCI_ROLE_PERIPHERAL); + LL_ASSERT(conn->lll.role == BT_HCI_ROLE_PERIPHERAL); /* When we act as peripheral apply timing restriction */ pu_set_timing_restrict( conn, pu_select_phy_timing_restrict(conn, ctx->data.pu.tx)); @@ -1114,7 +1114,7 @@ static void rp_pu_st_wait_tx_ack_phy(struct ll_conn *conn, struct proc_ctx *ctx, #endif /* CONFIG_BT_PERIPHERAL */ #if defined(CONFIG_BT_CENTRAL) } else if (ctx->state == RP_PU_STATE_WAIT_TX_ACK_PHY_UPDATE_IND) { - LL_ASSERT_DBG(conn->lll.role == BT_HCI_ROLE_CENTRAL); + LL_ASSERT(conn->lll.role == BT_HCI_ROLE_CENTRAL); if (ctx->data.pu.c_to_p_phy || ctx->data.pu.p_to_c_phy) { /* UPDATE_IND acked, so lets await instant */ if (ctx->data.pu.c_to_p_phy) { @@ -1289,7 +1289,7 @@ static void rp_pu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_ #endif /* CONFIG_BT_CTLR_DATA_LENGTH */ default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c index 3a90a9d950ba..185cad7911d1 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c @@ -104,7 +104,7 @@ static bool proc_with_instant(struct proc_ctx *ctx) return 1U; default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -117,12 +117,12 @@ void llcp_rr_check_done(struct ll_conn *conn, struct proc_ctx *ctx) struct proc_ctx *ctx_header; ctx_header = llcp_rr_peek(conn); - LL_ASSERT_DBG(ctx_header == ctx); + LL_ASSERT(ctx_header == ctx); /* If we have a node rx it must not be marked RETAIN as * the memory referenced would leak */ - LL_ASSERT_DBG(ctx->node_ref.rx == NULL || + LL_ASSERT(ctx->node_ref.rx == NULL || ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN); rr_dequeue(conn); @@ -319,7 +319,7 @@ void llcp_rr_rx(struct ll_conn *conn, struct proc_ctx *ctx, memq_link_t *link, #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -459,7 +459,7 @@ static void rr_act_run(struct ll_conn *conn) #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER */ default: /* Unknown procedure */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); break; } @@ -475,7 +475,7 @@ static void rr_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) /* Allocate tx node */ tx = llcp_tx_alloc(conn, ctx); - LL_ASSERT_DBG(tx); + LL_ASSERT(tx); pdu = (struct pdu_data *)tx->pdu; @@ -502,7 +502,7 @@ static void rr_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode) llcp_pdu_encode_unknown_rsp(ctx, pdu); break; default: - LL_ASSERT_DBG(0); + LL_ASSERT(0); } ctx->tx_opcode = pdu->llctrl.opcode; @@ -515,7 +515,7 @@ static void rr_act_reject(struct ll_conn *conn) { struct proc_ctx *ctx = llcp_rr_peek(conn); - LL_ASSERT_DBG(ctx != NULL); + LL_ASSERT(ctx != NULL); if (llcp_rr_ispaused(conn) || !llcp_tx_alloc_peek(conn, ctx)) { rr_set_state(conn, RR_STATE_REJECT); @@ -531,7 +531,7 @@ static void rr_act_unsupported(struct ll_conn *conn) { struct proc_ctx *ctx = llcp_rr_peek(conn); - LL_ASSERT_DBG(ctx != NULL); + LL_ASSERT(ctx != NULL); if (llcp_rr_ispaused(conn) || !llcp_tx_alloc_peek(conn, ctx)) { rr_set_state(conn, RR_STATE_UNSUPPORTED); @@ -550,7 +550,7 @@ static void rr_act_complete(struct ll_conn *conn) rr_set_collision(conn, 0U); ctx = llcp_rr_peek(conn); - LL_ASSERT_DBG(ctx != NULL); + LL_ASSERT(ctx != NULL); /* Stop procedure response timeout timer */ llcp_rr_prt_stop(conn); @@ -777,7 +777,7 @@ static void rr_execute_fsm(struct ll_conn *conn, uint8_t evt, void *param) break; default: /* Unknown state */ - LL_ASSERT_DBG(0); + LL_ASSERT(0); } } diff --git a/subsys/bluetooth/controller/ll_sw/ull_peripheral.c b/subsys/bluetooth/controller/ll_sw/ull_peripheral.c index aa6db211ed19..8032b18e9950 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_peripheral.c +++ b/subsys/bluetooth/controller/ll_sw/ull_peripheral.c @@ -250,7 +250,7 @@ void ull_periph_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, * complete event. */ node = pdu_adv; - LL_ASSERT_DBG(IS_PTR_ALIGNED(node, struct node_rx_cc)); + LL_ASSERT(IS_PTR_ALIGNED(node, struct node_rx_cc)); /* Populate the fields required for connection complete event */ cc = node; @@ -334,7 +334,7 @@ void ull_periph_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, link = rx->hdr.link; handle = ull_adv_handle_get(adv); - LL_ASSERT_DBG(handle < BT_CTLR_ADV_SET); + LL_ASSERT(handle < BT_CTLR_ADV_SET); rx->hdr.type = NODE_RX_TYPE_EXT_ADV_TERMINATE; rx->hdr.handle = handle; @@ -494,8 +494,8 @@ void ull_periph_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr, ticks_slot_overhead), ull_periph_ticker_cb, conn, ticker_op_cb, (void *)__LINE__); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) /* enable ticker job, irrespective of disabled in this function so @@ -520,8 +520,8 @@ void ull_periph_latency_cancel(struct ll_conn *conn, uint16_t handle) 0, 0, 0, 0, 1, 0, ticker_update_latency_cancel_op_cb, (void *)conn); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } } @@ -578,7 +578,7 @@ void ull_periph_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&conn->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* Increment event counter */ conn->event_counter += (lazy + 1U); @@ -594,7 +594,7 @@ void ull_periph_ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ err = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!err); + LL_ASSERT(!err); /* De-mux remaining tx nodes from FIFO */ ull_conn_tx_demux(UINT8_MAX); @@ -664,15 +664,15 @@ static void invalid_release(struct ull_hdr *hdr, struct lll_conn *lll, static void ticker_op_stop_adv_cb(uint32_t status, void *param) { - LL_ASSERT_ERR((status != TICKER_STATUS_FAILURE) || - (param == ull_disable_mark_get())); + LL_ASSERT(status != TICKER_STATUS_FAILURE || + param == ull_disable_mark_get()); } static void ticker_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); } static void ticker_update_latency_cancel_op_cb(uint32_t ticker_status, @@ -680,7 +680,7 @@ static void ticker_update_latency_cancel_op_cb(uint32_t ticker_status, { struct ll_conn *conn = param; - LL_ASSERT_ERR(ticker_status == TICKER_STATUS_SUCCESS); + LL_ASSERT(ticker_status == TICKER_STATUS_SUCCESS); conn->periph.latency_cancel = 0U; } diff --git a/subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c b/subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c index 21ff94e90bb6..dd360c9f9eb8 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c @@ -158,7 +158,7 @@ void ull_peripheral_iso_release(uint16_t cis_handle) struct ll_conn_iso_group *cig; cis = ll_conn_iso_stream_get(cis_handle); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); cig = cis->group; @@ -318,7 +318,7 @@ uint8_t ull_peripheral_iso_setup(struct pdu_data_llctrl_cis_ind *ind, } conn = ll_conn_get(cis->lll.acl_handle); - LL_ASSERT_DBG(conn != NULL); + LL_ASSERT(conn != NULL); cis_offset = sys_get_le24(ind->cis_offset); @@ -366,7 +366,7 @@ static void ticker_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); } void ull_peripheral_iso_update_ticker(struct ll_conn_iso_group *cig, @@ -378,8 +378,8 @@ void ull_peripheral_iso_update_ticker(struct ll_conn_iso_group *cig, uint8_t ticker_id_cig = TICKER_ID_CONN_ISO_BASE + ll_conn_iso_group_handle_get(cig); uint32_t ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, ticker_id_cig, ticker_op_cb, NULL); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); ticker_status = ticker_start(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, @@ -393,8 +393,8 @@ void ull_peripheral_iso_update_ticker(struct ll_conn_iso_group *cig, ull_conn_iso_ticker_cb, cig, ticker_op_cb, NULL); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } @@ -412,9 +412,8 @@ void ull_peripheral_iso_update_peer_sca(struct ll_conn *acl) if (!cig || !cig->lll.num_cis) { continue; } - cis = ll_conn_iso_stream_get_by_group(cig, NULL); - LL_ASSERT_DBG(cis); + LL_ASSERT(cis); uint16_t cis_handle = cis->lll.handle; diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan.c b/subsys/bluetooth/controller/ll_sw/ull_scan.c index 514072643e16..493c2330db0b 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan.c @@ -696,7 +696,7 @@ uint8_t ull_scan_disable(uint8_t handle, struct ll_scan_set *scan) * sync role. */ parent = aux->parent; - LL_ASSERT_DBG(!parent || (parent != aux_scan_lll)); + LL_ASSERT(!parent || (parent != aux_scan_lll)); } } #endif /* !CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */ @@ -727,7 +727,7 @@ void ull_scan_done(struct node_rx_event_done *done) lll->duration_reload = 0U; handle = ull_scan_handle_get(scan); - LL_ASSERT_DBG(handle < BT_CTLR_SCAN_SET); + LL_ASSERT(handle < BT_CTLR_SCAN_SET); #if defined(CONFIG_BT_CTLR_PHY_CODED) /* Prevent duplicate terminate event if ull_scan_done get called by @@ -751,8 +751,8 @@ void ull_scan_done(struct node_rx_event_done *done) (TICKER_ID_SCAN_BASE + handle), ticker_stop_ext_op_cb, scan); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } void ull_scan_term_dequeue(uint8_t handle) @@ -760,7 +760,7 @@ void ull_scan_term_dequeue(uint8_t handle) struct ll_scan_set *scan; scan = ull_scan_set_get(handle); - LL_ASSERT_DBG(scan); + LL_ASSERT(scan); scan->is_enabled = 0U; @@ -773,7 +773,7 @@ void ull_scan_term_dequeue(uint8_t handle) uint8_t err; err = disable(SCAN_HANDLE_PHY_CODED); - LL_ASSERT_ERR(!err); + LL_ASSERT(!err); } } else { struct ll_scan_set *scan_1m; @@ -783,7 +783,7 @@ void ull_scan_term_dequeue(uint8_t handle) uint8_t err; err = disable(SCAN_HANDLE_1M); - LL_ASSERT_ERR(!err); + LL_ASSERT(!err); } } #endif /* CONFIG_BT_CTLR_PHY_CODED */ @@ -924,7 +924,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&scan->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -937,7 +937,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); #if defined(CONFIG_BT_CTLR_ADV_EXT) if (lll->duration_expire) { @@ -955,7 +955,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, scan->duration_lazy - elapsed; handle = ull_scan_handle_get(scan); - LL_ASSERT_DBG(handle < BT_CTLR_SCAN_SET); + LL_ASSERT(handle < BT_CTLR_SCAN_SET); ret = ticker_update(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, @@ -963,8 +963,8 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, handle), 0, 0, 0, 0, duration_lazy, 0, NULL, NULL); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } lll->duration_expire = 0U; @@ -973,15 +973,15 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, uint8_t handle; handle = ull_scan_handle_get(scan); - LL_ASSERT_DBG(handle < BT_CTLR_SCAN_SET); + LL_ASSERT(handle < BT_CTLR_SCAN_SET); lll->duration_expire = lll->duration_reload; ret = ticker_update(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, (TICKER_ID_SCAN_BASE + handle), 0, 0, 0, 0, 1, 1, NULL, NULL); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } #endif /* CONFIG_BT_CTLR_ADV_EXT */ @@ -1105,7 +1105,7 @@ static void ticker_stop_ext_op_cb(uint32_t status, void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void ext_disable(void *param) @@ -1126,14 +1126,14 @@ static void ext_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = ext_disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } else { /* No pending LLL events */ ext_disabled_cb(&scan->lll); diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c index 012168b768d9..953575885bc5 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c @@ -215,7 +215,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) rx_incomplete = NULL; lll = ftr->param; - LL_ASSERT_DBG(!lll->lll_aux); + LL_ASSERT(!lll->lll_aux); scan = HDR_LLL2ULL(lll); sync = sync_create_get(scan); @@ -234,7 +234,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) rx_incomplete = NULL; lll = ftr->param; - LL_ASSERT_DBG(!lll->lll_aux); + LL_ASSERT(!lll->lll_aux); scan = HDR_LLL2ULL(lll); sync = sync_create_get(scan); @@ -259,7 +259,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) /* aux parent will be NULL for periodic sync */ lll = aux->parent; - LL_ASSERT_DBG(lll); + LL_ASSERT(lll); ticker_yield_handle = TICKER_ID_SCAN_AUX_BASE + aux_handle_get(aux); @@ -280,10 +280,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * is being received before we process the node here. */ lll_aux = ftr->lll_aux; - LL_ASSERT_DBG(lll_aux); + LL_ASSERT(lll_aux); aux = HDR_LLL2ULL(lll_aux); - LL_ASSERT_DBG(lll == aux->parent); + LL_ASSERT(lll == aux->parent); ticker_yield_handle = TICKER_NULL; @@ -301,10 +301,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * is being received before we process the node here. */ lll_aux = ftr->lll_aux; - LL_ASSERT_DBG(lll_aux); + LL_ASSERT(lll_aux); aux = HDR_LLL2ULL(lll_aux); - LL_ASSERT_DBG(sync_lll == aux->parent); + LL_ASSERT(sync_lll == aux->parent); ticker_yield_handle = TICKER_NULL; } @@ -340,8 +340,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) break; #endif /* CONFIG_BT_CTLR_PHY_CODED */ default: - LL_ASSERT_DBG(0); - + LL_ASSERT(0); return; } @@ -376,7 +375,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * passed in the node rx footer field. */ sync_lll = ftr->param; - LL_ASSERT_DBG(!sync_lll->lll_aux); + LL_ASSERT(!sync_lll->lll_aux); ull_sync = HDR_LLL2ULL(sync_lll); rx->hdr.handle = ull_sync_handle_get(ull_sync); @@ -407,8 +406,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } break; default: - LL_ASSERT_DBG(0); - + LL_ASSERT(0); return; } @@ -603,7 +601,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } if (is_scan_req) { - LL_ASSERT_DBG(aux && aux->rx_last); + LL_ASSERT(aux && aux->rx_last); aux->rx_last->rx_ftr.extra = rx; aux->rx_last = rx; @@ -820,7 +818,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * scheduling, or receiving a chain then it will * reuse the aux context. */ - LL_ASSERT_DBG(!lll->lll_aux || (lll->lll_aux == lll_aux)); + LL_ASSERT(!lll->lll_aux || (lll->lll_aux == lll_aux)); /* Associate Scan context with the Aux context so that * it can continue reception in LLL scheduling. @@ -843,7 +841,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) /* Switching to ULL scheduling to receive auxiliary PDUs */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || lll) { - LL_ASSERT_DBG(scan); + LL_ASSERT(scan); /* Do not ULL schedule if scan disable requested */ if (unlikely(scan->is_stop)) { @@ -859,8 +857,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } else { struct ll_sync_set *sync_set; - LL_ASSERT_ERR(sync_lll && - (!sync_lll->lll_aux || sync_lll->lll_aux == lll_aux)); + LL_ASSERT(sync_lll && + (!sync_lll->lll_aux || sync_lll->lll_aux == lll_aux)); /* Do not ULL schedule if sync terminate requested */ sync_set = HDR_LLL2ULL(sync_lll); @@ -919,8 +917,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) ticks_aux_offset - ticks_slot_offset), NULL, NULL); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } aux_handle = aux_handle_get(aux); @@ -935,10 +933,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) (aux->ull.ticks_slot + ticks_slot_overhead), ticker_cb, aux, ticker_op_cb, aux); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((ticker_status == TICKER_STATUS_FAILURE) && - IS_ENABLED(CONFIG_BT_TICKER_LOW_LAT))); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((ticker_status == TICKER_STATUS_FAILURE) && + IS_ENABLED(CONFIG_BT_TICKER_LOW_LAT))); #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) /* enable ticker job, queued ticker operation will be handled @@ -962,7 +960,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * immediately since we are in sync context. */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || aux->rx_last) { - LL_ASSERT_DBG(scan); + LL_ASSERT(scan); /* If scan is being disabled, rx could already be * enqueued before coming here to ull_scan_aux_rx_flush. @@ -992,7 +990,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } else { const struct ll_sync_set *sync_set; - LL_ASSERT_DBG(sync_lll); + LL_ASSERT(sync_lll); ll_rx_put_sched(link, rx); @@ -1002,7 +1000,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } } - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); flush_safe(aux); @@ -1030,7 +1028,7 @@ void ull_scan_aux_done(struct node_rx_event_done *done) struct ll_sync_set *sync; sync = CONTAINER_OF(done->param, struct ll_sync_set, ull); - LL_ASSERT_DBG(ull_sync_is_valid_get(sync)); + LL_ASSERT(ull_sync_is_valid_get(sync)); /* Auxiliary context will be flushed by ull_scan_aux_stop() */ if (unlikely(sync->is_stop) || !sync->lll.lll_aux) { @@ -1038,16 +1036,16 @@ void ull_scan_aux_done(struct node_rx_event_done *done) } aux = HDR_LLL2ULL(sync->lll.lll_aux); - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); } else { struct ll_scan_set *scan; struct lll_scan *lll; lll = aux->parent; - LL_ASSERT_DBG(lll); + LL_ASSERT(lll); scan = HDR_LLL2ULL(lll); - LL_ASSERT_DBG(ull_scan_is_valid_get(scan)); + LL_ASSERT(ull_scan_is_valid_get(scan)); /* Auxiliary context will be flushed by ull_scan_aux_stop() */ if (unlikely(scan->is_stop)) { @@ -1088,7 +1086,7 @@ void *ull_scan_aux_lll_parent_get(struct lll_scan_aux *lll, struct lll_scan *lllscan; lllscan = aux->parent; - LL_ASSERT_DBG(lllscan); + LL_ASSERT(lllscan); scan = HDR_LLL2ULL(lllscan); *is_lll_scan = !!ull_scan_is_valid_get(scan); @@ -1198,8 +1196,7 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) rx->rx_ftr.extra = NULL; } else { - LL_ASSERT_DBG(0); - + LL_ASSERT(0); lll_aux = NULL; } @@ -1211,7 +1208,7 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) aux = HDR_LLL2ULL(lll_aux); lll = aux->parent; - LL_ASSERT_DBG(lll); + LL_ASSERT(lll); scan = HDR_LLL2ULL(lll); scan = ull_scan_is_valid_get(scan); @@ -1225,13 +1222,12 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) sync = HDR_LLL2ULL(sync_lll); is_stop = sync->is_stop; } else { - LL_ASSERT_DBG(0); - + LL_ASSERT(0); return; } if (!is_stop) { - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); flush_safe(aux); @@ -1291,7 +1287,7 @@ int ull_scan_aux_stop(struct ll_scan_aux_set *aux) struct lll_scan *lll; lll = aux->parent; - LL_ASSERT_DBG(lll); + LL_ASSERT(lll); scan = HDR_LLL2ULL(lll); scan = ull_scan_is_valid_get(scan); @@ -1312,7 +1308,7 @@ int ull_scan_aux_stop(struct ll_scan_aux_set *aux) mfy.param = aux; ret = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); return 0; } @@ -1337,7 +1333,7 @@ static inline void aux_release(struct ll_scan_aux_set *aux) /* Clear the parent so that when scan is being disabled then this * auxiliary context shall not associate itself from being disable. */ - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); aux->parent = NULL; mem_release(aux, &scan_aux_free); @@ -1354,7 +1350,7 @@ static void done_disabled_cb(void *param) struct ll_scan_aux_set *aux; aux = param; - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); flush(aux); } @@ -1366,7 +1362,7 @@ static void flush_safe(void *param) uint8_t ref; aux = param; - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); /* ref == 0 * All PDUs were scheduled from LLL and there is no pending done @@ -1386,9 +1382,9 @@ static void flush_safe(void *param) * cannot overlap, i.e. ULL reference count * shall be less than 2. */ - LL_ASSERT_DBG(ref < 2U); + LL_ASSERT(ref < 2U); - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = aux; hdr->disabled_cb = done_disabled_cb; @@ -1410,7 +1406,7 @@ static void flush(void *param) * auxiliary channel PDUs. */ aux = param; - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); rx = aux->rx_head; if (rx) { @@ -1460,7 +1456,7 @@ static void aux_sync_partial(void *param) rx = aux->rx_head; aux->rx_head = NULL; - LL_ASSERT_DBG(rx); + LL_ASSERT(rx); rx->rx_ftr.aux_sched = 1U; ll_rx_put_sched(rx->hdr.link, rx); @@ -1472,7 +1468,7 @@ static void aux_sync_incomplete(void *param) struct ll_scan_aux_set *aux; aux = param; - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); /* ULL scheduling succeeded hence no backup node rx present, use the * extra node rx reserved for incomplete data status generation. @@ -1484,7 +1480,7 @@ static void aux_sync_incomplete(void *param) /* get reference to sync context */ lll = aux->parent; - LL_ASSERT_DBG(lll); + LL_ASSERT(lll); sync = HDR_LLL2ULL(lll); /* reset data len total */ @@ -1492,7 +1488,7 @@ static void aux_sync_incomplete(void *param) /* pick extra node rx stored in aux context */ rx = aux->rx_incomplete; - LL_ASSERT_DBG(rx); + LL_ASSERT(rx); aux->rx_incomplete = NULL; /* prepare sync report with failure */ @@ -1512,7 +1508,7 @@ static void aux_sync_incomplete(void *param) aux->rx_head = rx; } - LL_ASSERT_DBG(!ull_ref_get(&aux->ull)); + LL_ASSERT(!ull_ref_get(&aux->ull)); flush(aux); #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */ @@ -1533,7 +1529,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&aux->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -1546,7 +1542,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_PREPARE_O(1); } @@ -1564,7 +1560,7 @@ static void ticker_op_cb(uint32_t status, void *param) aux = param; sync_lll = aux->parent; - LL_ASSERT_DBG(sync_lll); + LL_ASSERT(sync_lll); sync = HDR_LLL2ULL(sync_lll); sync = ull_sync_is_valid_get(sync); @@ -1585,7 +1581,7 @@ static void ticker_op_cb(uint32_t status, void *param) struct ll_scan_aux_set *aux; aux = param; - LL_ASSERT_DBG(aux->parent); + LL_ASSERT(aux->parent); mfy.fp = flush_safe; } @@ -1595,7 +1591,7 @@ static void ticker_op_cb(uint32_t status, void *param) ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } #else /* CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */ @@ -1652,7 +1648,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) rx_incomplete = NULL; lll = ftr->param; - LL_ASSERT_DBG(!lll->lll_aux); + LL_ASSERT(!lll->lll_aux); scan = HDR_LLL2ULL(lll); sync = sync_create_get(scan); @@ -1668,7 +1664,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) rx_incomplete = NULL; lll = ftr->param; - LL_ASSERT_DBG(!lll->lll_aux); + LL_ASSERT(!lll->lll_aux); scan = HDR_LLL2ULL(lll); sync = sync_create_get(scan); @@ -1690,7 +1686,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) /* chain parent will be NULL for periodic sync */ lll = chain->parent; - LL_ASSERT_DBG(lll); + LL_ASSERT(lll); } else if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || ull_scan_is_valid_get(HDR_LLL2ULL(ftr->param))) { @@ -1704,10 +1700,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) lll = ftr->param; lll_aux = lll->lll_aux; - LL_ASSERT_DBG(lll_aux); + LL_ASSERT(lll_aux); chain = CONTAINER_OF(lll_aux, struct ll_scan_aux_chain, lll); - LL_ASSERT_DBG(lll == chain->parent); + LL_ASSERT(lll == chain->parent); } else { lll = NULL; @@ -1717,10 +1713,10 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) sync_lll = ftr->param; lll_aux = sync_lll->lll_aux; - LL_ASSERT_DBG(lll_aux); + LL_ASSERT(lll_aux); chain = CONTAINER_OF(lll_aux, struct ll_scan_aux_chain, lll); - LL_ASSERT_DBG(sync_lll == chain->parent); + LL_ASSERT(sync_lll == chain->parent); } if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || lll) { @@ -1754,8 +1750,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) break; #endif /* CONFIG_BT_CTLR_PHY_CODED */ default: - LL_ASSERT_DBG(0); - + LL_ASSERT(0); return; } @@ -1790,7 +1785,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * passed in the node rx footer field. */ sync_lll = ftr->param; - LL_ASSERT_DBG(!sync_lll->lll_aux); + LL_ASSERT(!sync_lll->lll_aux); ull_sync = HDR_LLL2ULL(sync_lll); rx->hdr.handle = ull_sync_handle_get(ull_sync); @@ -1818,8 +1813,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } break; default: - LL_ASSERT_DBG(0); - + LL_ASSERT(0); return; } @@ -2015,7 +2009,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) PDU_ADV_AUX_PTR_PHY_GET(aux_ptr) == EXT_ADV_AUX_PHY_LE_CODED) || (aux_ptr->chan_idx >= CHM_USED_COUNT_MAX)) { if (is_scan_req) { - LL_ASSERT_DBG(chain && chain->rx_last); + LL_ASSERT(chain && chain->rx_last); chain->rx_last->rx_ftr.extra = rx; chain->rx_last = rx; @@ -2213,7 +2207,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) /* Switching to ULL scheduling to receive auxiliary PDUs */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || lll) { - LL_ASSERT_DBG(scan); + LL_ASSERT(scan); /* Do not ULL schedule if scan disable requested */ if (unlikely(scan->is_stop)) { @@ -2229,8 +2223,8 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) } else { struct ll_sync_set *sync_set; - LL_ASSERT_ERR(sync_lll && - (!sync_lll->lll_aux || sync_lll->lll_aux == lll_aux)); + LL_ASSERT(sync_lll && + (!sync_lll->lll_aux || sync_lll->lll_aux == lll_aux)); /* Do not ULL schedule if sync terminate requested */ sync_set = HDR_LLL2ULL(sync_lll); @@ -2284,7 +2278,7 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) * immediately since we are in sync context. */ if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) || chain->rx_last) { - LL_ASSERT_DBG(scan); + LL_ASSERT(scan); /* rx could already be enqueued before coming here - * check if rx not the last in the list of received PDUs @@ -2297,12 +2291,12 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_pdu *rx) chain->rx_last = rx; } } else { - LL_ASSERT_DBG(sync_lll); + LL_ASSERT(sync_lll); ll_rx_put_sched(link, rx); } - LL_ASSERT_DBG(chain->parent); + LL_ASSERT(chain->parent); flush_safe(chain); @@ -2324,7 +2318,7 @@ void ull_scan_aux_done(struct node_rx_event_done *done) /* Get reference to chain */ chain = CONTAINER_OF(done->extra.lll, struct ll_scan_aux_chain, lll); - LL_ASSERT_DBG(scan_aux_chain_is_valid_get(chain)); + LL_ASSERT(scan_aux_chain_is_valid_get(chain)); /* Remove chain from active list */ chain_remove_from_list(&scan_aux_set.active_chains, chain); @@ -2349,7 +2343,7 @@ void *ull_scan_aux_lll_parent_get(struct lll_scan_aux *lll, struct lll_scan *lllscan; lllscan = chain->parent; - LL_ASSERT_DBG(lllscan); + LL_ASSERT(lllscan); scan = HDR_LLL2ULL(lllscan); *is_lll_scan = !!ull_scan_is_valid_get(scan); @@ -2425,8 +2419,7 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) rx->rx_ftr.extra = NULL; } } else { - LL_ASSERT_DBG(0); - + LL_ASSERT(0); lll_aux = NULL; } @@ -2438,7 +2431,7 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) chain = CONTAINER_OF(lll_aux, struct ll_scan_aux_chain, lll); lll = chain->parent; - LL_ASSERT_DBG(lll); + LL_ASSERT(lll); scan = HDR_LLL2ULL(lll); scan = ull_scan_is_valid_get(scan); @@ -2454,7 +2447,7 @@ void ull_scan_aux_release(memq_link_t *link, struct node_rx_pdu *rx) } if (!is_stop) { - LL_ASSERT_DBG(chain->parent); + LL_ASSERT(chain->parent); /* Remove chain from active list and flush */ chain_remove_from_list(&scan_aux_set.active_chains, chain); @@ -2481,8 +2474,8 @@ static void scan_aux_stop_all_chains_for_parent(void *parent) /* Scheduled head is about to be removed - stop running ticker */ ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, TICKER_ID_SCAN_AUX, NULL, NULL); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); ticker_stopped = true; } @@ -2538,7 +2531,7 @@ static void scan_aux_stop_all_chains_for_parent(void *parent) mfy.param = &curr->lll; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } } else { prev = curr; @@ -2562,7 +2555,7 @@ int ull_scan_aux_stop(void *parent) /* Stop chains in ULL execution context */ mfy.param = parent; ret = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); /* Wait for chains to be stopped before returning */ (void)k_sem_take(&sem_scan_aux_stop, K_FOREVER); @@ -2594,7 +2587,7 @@ static inline void aux_chain_release(struct ll_scan_aux_chain *chain) /* Clear the parent so that when scan is being disabled then this * auxiliary context shall not associate itself from being disable. */ - LL_ASSERT_DBG(chain->parent); + LL_ASSERT(chain->parent); chain->parent = NULL; mem_release(chain, &scan_aux_free); @@ -2621,7 +2614,7 @@ static void flush_safe(void *param) struct ll_scan_aux_chain *chain; chain = param; - LL_ASSERT_DBG(chain->parent); + LL_ASSERT(chain->parent); if (chain_is_in_list(scan_aux_set.flushing_chains, chain)) { /* Chain already marked for flushing */ @@ -2653,7 +2646,7 @@ static void flush(struct ll_scan_aux_chain *chain) /* Debug check that parent was assigned when allocated for reception of * auxiliary channel PDUs. */ - LL_ASSERT_DBG(chain->parent); + LL_ASSERT(chain->parent); /* Chain is being flushed now - remove from flushing_chains if present */ chain_remove_from_list(&scan_aux_set.flushing_chains, chain); @@ -2709,7 +2702,7 @@ static void flush(struct ll_scan_aux_chain *chain) sync_lll = chain->parent; sync = HDR_LLL2ULL(sync_lll); - LL_ASSERT_DBG(sync->is_stop || sync_lll->lll_aux); + LL_ASSERT(sync->is_stop || sync_lll->lll_aux); sync_lll->lll_aux = NULL; } @@ -2723,16 +2716,16 @@ static void aux_sync_incomplete(struct ll_scan_aux_chain *chain) struct node_rx_pdu *rx; struct lll_sync *lll; - LL_ASSERT_DBG(chain->parent); + LL_ASSERT(chain->parent); /* get reference to sync context */ lll = chain->parent; - LL_ASSERT_DBG(lll); + LL_ASSERT(lll); sync = HDR_LLL2ULL(lll); /* pick extra node rx stored in sync context */ rx = sync->rx_incomplete; - LL_ASSERT_DBG(rx); + LL_ASSERT(rx); sync->rx_incomplete = NULL; /* prepare sync report with failure */ @@ -2817,16 +2810,16 @@ static void chain_start_ticker(struct ll_scan_aux_chain *chain, bool replace) (chain->ticker_ticks - ticks_slot_offset), NULL, NULL); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } #endif /* !CONFIG_BT_TICKER_SLOT_AGNOSTIC */ if (replace) { ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, TICKER_ID_SCAN_AUX, NULL, NULL); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); } ticker_status = ticker_start(TICKER_INSTANCE_ID_CTLR, @@ -2841,13 +2834,13 @@ static void chain_start_ticker(struct ll_scan_aux_chain *chain, bool replace) ticks_slot_overhead), ticker_cb, chain, ticker_op_cb, chain); #if defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY)); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY)); #else - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((ticker_status == TICKER_STATUS_FAILURE) && - IS_ENABLED(CONFIG_BT_TICKER_LOW_LAT))); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((ticker_status == TICKER_STATUS_FAILURE) && + IS_ENABLED(CONFIG_BT_TICKER_LOW_LAT))); #endif /* !CONFIG_BT_TICKER_SLOT_AGNOSTIC */ #if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) @@ -2873,10 +2866,10 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&scan_aux_set.ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* The chain should always be the first in the sched_chains list */ - LL_ASSERT_DBG(scan_aux_set.sched_chains == chain); + LL_ASSERT(scan_aux_set.sched_chains == chain); /* Move chain to active list */ chain_remove_from_list(&scan_aux_set.sched_chains, chain); @@ -2893,7 +2886,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); if (scan_aux_set.sched_chains) { /* Start ticker for next chain */ @@ -2923,7 +2916,7 @@ static void ticker_start_failed(void *param) static void ticker_op_cb(uint32_t status, void *param) { #if defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); #else /* !CONFIG_BT_TICKER_SLOT_AGNOSTIC */ static memq_link_t link; static struct mayfly mfy = {0, 0, &link, NULL, ticker_start_failed}; @@ -2937,7 +2930,7 @@ static void ticker_op_cb(uint32_t status, void *param) ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 1, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); #endif /* !CONFIG_BT_TICKER_SLOT_AGNOSTIC */ } diff --git a/subsys/bluetooth/controller/ll_sw/ull_sched.c b/subsys/bluetooth/controller/ll_sw/ull_sched.c index 5309e5c1f2a5..116ea101d133 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sched.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sched.c @@ -465,12 +465,12 @@ static uint8_t after_match_slot_get(uint8_t user_id, uint32_t ticks_slot_abs, /* Using a local variable to address the Coverity rule: * Incorrect expression (ASSERT_SIDE_EFFECT) - * Argument "ret_cb" of LL_ASSERT_ERR() has a side effect + * Argument "ret_cb" of LL_ASSERT() has a side effect * because the variable is volatile. The containing function * might work differently in a non-debug build. */ success = (ret_cb == TICKER_STATUS_SUCCESS); - LL_ASSERT_ERR(success); + LL_ASSERT(success); /* There is a possibility that tickers expire while we * iterate through the active list of tickers, start over with @@ -478,7 +478,7 @@ static uint8_t after_match_slot_get(uint8_t user_id, uint32_t ticks_slot_abs, */ if ((ticker_id_prev != TICKER_NULL) && (*ticks_anchor != ticks_anchor_prev)) { - LL_ASSERT_ERR(retry); + LL_ASSERT(retry); retry--; ticker_id = ticker_id_prev = TICKER_NULL; diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index 183e8bc72bfb..0ce9658e8d24 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -425,8 +425,8 @@ void ull_sync_setup_from_sync_transfer(struct ll_conn *conn, uint16_t service_da (sync->ull.ticks_slot + ticks_slot_overhead), ticker_cb, sync, ticker_start_op_cb, (void *)__LINE__); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } #endif /* CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER */ @@ -490,7 +490,7 @@ uint8_t ll_sync_create_cancel(void **rx) if (sync->timeout_reload != 0U) { uint16_t sync_handle = ull_sync_handle_get(sync); - LL_ASSERT_DBG(sync_handle <= UINT8_MAX); + LL_ASSERT(sync_handle <= UINT8_MAX); /* Sync is not established yet, so stop sync ticker */ const int err = @@ -585,7 +585,7 @@ uint8_t ll_sync_terminate(uint16_t handle) } #if !defined(CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS) - LL_ASSERT_DBG(!aux->parent); + LL_ASSERT(!aux->parent); #endif /* !CONFIG_BT_CTLR_SCAN_AUX_USE_CHAINS */ } @@ -1153,8 +1153,8 @@ void ull_sync_setup(struct ll_scan_set *scan, uint8_t phy, (sync->ull.ticks_slot + ticks_slot_overhead), ticker_cb, sync, ticker_start_op_cb, (void *)__LINE__); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } void ull_sync_setup_reset(struct ll_sync_set *sync) @@ -1418,9 +1418,9 @@ void ull_sync_done(struct node_rx_event_done *done) ticks_drift_minus, 0, 0, lazy, force, ticker_update_op_cb, sync); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)sync == ull_disable_mark_get())); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)sync == ull_disable_mark_get())); } } } @@ -1435,7 +1435,7 @@ void ull_sync_chm_update(uint8_t sync_handle, uint8_t *acad, uint8_t acad_len) /* Get reference to LLL context */ sync = ull_sync_set_get(sync_handle); - LL_ASSERT_DBG(sync); + LL_ASSERT(sync); lll = &sync->lll; /* Ignore if already in progress */ @@ -1612,7 +1612,7 @@ static struct ll_sync_set *ull_sync_create(uint8_t sid, uint16_t timeout, uint16 /* Make sure that the node_rx_sync_establ hasn't got anything assigned. It is used to * mark when sync establishment is in progress. */ - LL_ASSERT_DBG(!sync->node_rx_sync_estab); + LL_ASSERT(!sync->node_rx_sync_estab); sync->node_rx_sync_estab = node_rx; /* Reporting initially enabled/disabled */ @@ -1659,7 +1659,7 @@ static struct ll_sync_set *ull_sync_create(uint8_t sid, uint16_t timeout, uint16 #if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) ull_df_sync_cfg_init(&lll->df_cfg); - LL_ASSERT_DBG(!lll->node_cte_incomplete); + LL_ASSERT(!lll->node_cte_incomplete); #endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */ /* Initialise ULL and LLL headers */ @@ -1677,8 +1677,8 @@ static void sync_ticker_cleanup(struct ll_sync_set *sync, ticker_op_func stop_op /* Stop Periodic Sync Ticker */ ret = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, TICKER_ID_SCAN_SYNC_BASE + sync_handle, stop_op_cb, (void *)sync); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); /* Mark sync context not sync established */ sync->timeout_reload = 0U; @@ -1706,7 +1706,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&sync->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -1720,7 +1720,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0, &mfy_lll_prepare); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_PREPARE_O(1); } @@ -1728,13 +1728,13 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, static void ticker_start_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); } static void ticker_update_op_cb(uint32_t status, void *param) { - LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || - (param == ull_disable_mark_get())); + LL_ASSERT(status == TICKER_STATUS_SUCCESS || + param == ull_disable_mark_get()); } static void ticker_stop_sync_expire_op_cb(uint32_t status, void *param) @@ -1743,13 +1743,13 @@ static void ticker_stop_sync_expire_op_cb(uint32_t status, void *param) static memq_link_t link; static struct mayfly mfy = {0, 0, &link, NULL, sync_expire}; - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); mfy.param = param; retval = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!retval); + LL_ASSERT(!retval); } static void sync_expire(void *param) @@ -1789,7 +1789,7 @@ static void ticker_stop_sync_lost_op_cb(uint32_t status, void *param) * sync lost scenario, do not generate the sync lost node rx from here */ if (status != TICKER_STATUS_SUCCESS) { - LL_ASSERT_DBG(param == ull_disable_mark_get()); + LL_ASSERT(param == ull_disable_mark_get()); return; } @@ -1798,7 +1798,7 @@ static void ticker_stop_sync_lost_op_cb(uint32_t status, void *param) retval = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0, &mfy); - LL_ASSERT_ERR(!retval); + LL_ASSERT(!retval); } static void sync_lost(void *param) @@ -1900,8 +1900,8 @@ static struct pdu_cte_info *pdu_cte_info_get(struct pdu_adv *pdu) } /* Make sure there are no fields that are not allowed for AUX_SYNC_IND and AUX_CHAIN_IND */ - LL_ASSERT_DBG(!hdr->adv_addr); - LL_ASSERT_DBG(!hdr->tgt_addr); + LL_ASSERT(!hdr->adv_addr); + LL_ASSERT(!hdr->tgt_addr); return (struct pdu_cte_info *)hdr->data; } @@ -1956,7 +1956,7 @@ void ull_sync_transfer_received(struct ll_conn *conn, uint16_t service_data, conn_evt_current = ull_conn_event_counter(conn); /* LLCP should have ensured this holds */ - LL_ASSERT_DBG(sync_conn_event_count != conn_evt_current); + LL_ASSERT(sync_conn_event_count != conn_evt_current); ull_sync_setup_from_sync_transfer(conn, service_data, sync, si, conn_event_count - conn_evt_current, diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c index de741adfd6d5..222191bde22c 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c @@ -203,9 +203,9 @@ uint8_t ll_big_sync_create(uint8_t big_handle, uint16_t sync_handle, /* Calculate GLTK */ err = bt_crypto_h7(BIG1, bcode, igltk); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); err = bt_crypto_h6(igltk, BIG2, sync_iso->gltk); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); lll->enc = 1U; } else { @@ -309,8 +309,7 @@ uint8_t ll_big_sync_terminate(uint8_t big_handle, void **rx) mfy.param = &sync_iso->lll; ret = mayfly_enqueue(TICKER_USER_ID_THREAD, TICKER_USER_ID_LLL, 0, &mfy); - LL_ASSERT_ERR(!ret); - + LL_ASSERT(!ret); k_sem_take(&sem, K_FOREVER); sync_iso->flush_sem = NULL; @@ -391,7 +390,7 @@ void ull_sync_iso_stream_release(struct ll_sync_iso_set *sync_iso) stream_handle = lll->stream_handle[lll->stream_count]; stream = ull_sync_iso_stream_get(stream_handle); - LL_ASSERT_DBG(stream); + LL_ASSERT(stream); dp = stream->dp; if (dp) { @@ -504,7 +503,7 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, * Fix ptc and ptc_curr definitions, until then we keep an assertion check * here. */ - LL_ASSERT_DBG(ptc <= BIT_MASK(4)); + LL_ASSERT(ptc <= BIT_MASK(4)); lll->ptc = ptc; } else { lll->ptc = 0U; @@ -535,7 +534,7 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, /* Calculate GSK */ err = bt_crypto_h8(sync_iso->gltk, bi->gskd, BIG3, gsk); - LL_ASSERT_DBG(!err); + LL_ASSERT(!err); /* Prepare the CCM parameters */ ccm_rx = &lll->ccm_rx; @@ -587,7 +586,7 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, lll->window_size_event_us; /* Skip to first selected BIS subevent */ stream = ull_sync_iso_stream_get(lll->stream_handle[0]); - LL_ASSERT_DBG(stream); + LL_ASSERT(stream); if (lll->bis_spacing >= (lll->sub_interval * lll->nse)) { sync_iso_offset_us += (stream->bis_index - 1U) * @@ -710,8 +709,8 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, (sync_iso->ull.ticks_slot + ticks_slot_overhead), ticker_cb, sync_iso, ticker_start_op_cb, (void *)__LINE__); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } void ull_sync_iso_estab_done(struct node_rx_event_done *done) @@ -848,9 +847,9 @@ void ull_sync_iso_done(struct node_rx_event_done *done) lazy, force, ticker_update_op_cb, sync_iso); - LL_ASSERT_ERR((ticker_status == TICKER_STATUS_SUCCESS) || - (ticker_status == TICKER_STATUS_BUSY) || - ((void *)sync_iso == ull_disable_mark_get())); + LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) || + (ticker_status == TICKER_STATUS_BUSY) || + ((void *)sync_iso == ull_disable_mark_get())); } } @@ -1000,7 +999,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Increment prepare reference count */ ref = ull_ref_inc(&sync_iso->ull); - LL_ASSERT_DBG(ref); + LL_ASSERT(ref); /* Append timing parameters */ p.ticks_at_expire = ticks_at_expire; @@ -1013,7 +1012,7 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift, /* Kick LLL prepare */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy_lll_prepare); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); DEBUG_RADIO_PREPARE_O(1); } @@ -1022,13 +1021,13 @@ static void ticker_start_op_cb(uint32_t status, void *param) { ARG_UNUSED(param); - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); } static void ticker_update_op_cb(uint32_t status, void *param) { - LL_ASSERT_ERR((status == TICKER_STATUS_SUCCESS) || - (param == ull_disable_mark_get())); + LL_ASSERT(status == TICKER_STATUS_SUCCESS || + param == ull_disable_mark_get()); } static void ticker_stop_op_cb(uint32_t status, void *param) @@ -1037,13 +1036,13 @@ static void ticker_stop_op_cb(uint32_t status, void *param) static struct mayfly mfy = {0U, 0U, &link, NULL, sync_iso_disable}; uint32_t ret; - LL_ASSERT_ERR(status == TICKER_STATUS_SUCCESS); + LL_ASSERT(status == TICKER_STATUS_SUCCESS); /* Check if any pending LLL events that need to be aborted */ mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_LOW, TICKER_USER_ID_ULL_HIGH, 0U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void sync_iso_disable(void *param) @@ -1064,14 +1063,14 @@ static void sync_iso_disable(void *param) /* Setup disabled callback to be called when ref count * returns to zero. */ - LL_ASSERT_ERR(!hdr->disabled_cb); + LL_ASSERT(!hdr->disabled_cb); hdr->disabled_param = mfy.param; hdr->disabled_cb = disabled_cb; /* Trigger LLL disable */ ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } else { /* No pending LLL events */ disabled_cb(&sync_iso->lll); @@ -1108,7 +1107,7 @@ static void disabled_cb(void *param) /* Generate BIG sync lost */ rx = (void *)&sync_iso->node_rx_lost; - LL_ASSERT_DBG(rx->hdr.link); + LL_ASSERT(rx->hdr.link); link = rx->hdr.link; rx->hdr.link = NULL; @@ -1118,7 +1117,7 @@ static void disabled_cb(void *param) mfy.param = param; ret = mayfly_enqueue(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_LLL, 0U, &mfy); - LL_ASSERT_ERR(!ret); + LL_ASSERT(!ret); } static void stop_ticker(struct ll_sync_iso_set *sync_iso, ticker_op_func fp_op_func) @@ -1138,6 +1137,6 @@ static void stop_ticker(struct ll_sync_iso_set *sync_iso, ticker_op_func fp_op_f sync_iso_handle_to_index(handle), fp_op_func, fp_op_func ? (void *)sync_iso : NULL); - LL_ASSERT_ERR((ret == TICKER_STATUS_SUCCESS) || - (ret == TICKER_STATUS_BUSY)); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); } diff --git a/subsys/bluetooth/controller/ticker/ticker.c b/subsys/bluetooth/controller/ticker/ticker.c index 567301756e29..065e9981c5f0 100644 --- a/subsys/bluetooth/controller/ticker/ticker.c +++ b/subsys/bluetooth/controller/ticker/ticker.c @@ -1448,7 +1448,7 @@ void ticker_worker(void *param) timeout_func = ticker->ext_data->ext_timeout_func; expire_info = ticker->ext_data->other_expire_info; if (ticker->ext_data->expire_info_id != TICKER_NULL) { - LL_ASSERT_DBG(expire_info && !expire_info->outdated); + LL_ASSERT(expire_info && !expire_info->outdated); } ext_context.context = ticker->context; @@ -2327,7 +2327,7 @@ static inline uint32_t ticker_job_op_start(struct ticker_instance *instance, #if defined(CONFIG_BT_TICKER_LOW_LAT) /* Must expire is not supported in compatibility mode */ - LL_ASSERT_DBG(start->lazy < TICKER_LAZY_MUST_EXPIRE_KEEP); + LL_ASSERT(start->lazy < TICKER_LAZY_MUST_EXPIRE_KEEP); #else #if !defined(CONFIG_BT_TICKER_SLOT_AGNOSTIC) if (start->lazy != TICKER_LAZY_MUST_EXPIRE_KEEP) { @@ -2492,7 +2492,7 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) } /* Ensure that resched ticker is expired */ - LL_ASSERT_DBG(ticker_resched->ticks_to_expire == 0U); + LL_ASSERT(ticker_resched->ticks_to_expire == 0U); /* Use ticker's reserved time ticks_slot, else for unreserved * tickers use the reschedule margin as ticks_slot. @@ -2500,7 +2500,7 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) if (ticker_resched->ticks_slot) { ticks_slot = ticker_resched->ticks_slot; } else { - LL_ASSERT_DBG(TICKER_HAS_SLOT_WINDOW(ticker_resched)); + LL_ASSERT(TICKER_HAS_SLOT_WINDOW(ticker_resched)); ticks_slot = HAL_TICKER_RESCHEDULE_MARGIN; } @@ -3181,7 +3181,7 @@ ticker_job_compare_update(struct ticker_instance *instance, uint32_t ticks_elapsed; uint32_t ticks_diff; - LL_ASSERT_ERR(i); + LL_ASSERT(i); i--; cc = instance->ticks_current; diff --git a/tests/bluetooth/init/prj_ctlr.conf b/tests/bluetooth/init/prj_ctlr.conf index c733ef4ad3fc..b311a76b1cde 100644 --- a/tests/bluetooth/init/prj_ctlr.conf +++ b/tests/bluetooth/init/prj_ctlr.conf @@ -8,7 +8,6 @@ CONFIG_BT_SMP_SC_ONLY=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_GATT_CLIENT=y CONFIG_BT_CLASSIC=n -CONFIG_BT_CTLR_ASSERT_DEBUG=n CONFIG_FLASH=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC_TICKER=y CONFIG_ZTEST=y diff --git a/tests/bluetooth/init/prj_ctlr_dbg.conf b/tests/bluetooth/init/prj_ctlr_dbg.conf index 956c562c5aa0..cc6f478b66b6 100644 --- a/tests/bluetooth/init/prj_ctlr_dbg.conf +++ b/tests/bluetooth/init/prj_ctlr_dbg.conf @@ -31,7 +31,6 @@ CONFIG_BT_CTLR_SCAN_REQ_RSSI=y CONFIG_BT_CTLR_SCAN_INDICATION=y CONFIG_BT_CTLR_OPTIMIZE_FOR_SPEED=y CONFIG_BT_CTLR_PROFILE_ISR=y -CONFIG_BT_CTLR_ASSERT_DEBUG=y CONFIG_BT_CTLR_DEBUG_PINS=y CONFIG_BT_CTLR_TEST=y CONFIG_BT_HCI_VS=y From e19f8ff050082ba25aae8fde780e718fda0566ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1311/3334] Revert "[nrf fromtree] Bluetooth: Controller: nRF54L: Fix PPIB interface include cond compile" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 901c7263fad9d5b3280f8b8e3b66a5262f709a1b. Signed-off-by: Tomasz Moń --- .../controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h index 1b15f41c4080..f01f9859db4b 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5.h @@ -40,7 +40,6 @@ #include #include "radio_nrf5340.h" #elif defined(CONFIG_SOC_SERIES_NRF54LX) -#include #include "radio_nrf54lx.h" #elif defined(CONFIG_BOARD_NRF52_BSIM) #include "radio_sim_nrf52.h" @@ -48,7 +47,6 @@ #include #include "radio_sim_nrf5340.h" #elif defined(CONFIG_BOARD_NRF54L15BSIM_NRF54L15_CPUAPP) -#include #include "radio_sim_nrf54l.h" #else #error "Unsupported SoC." @@ -56,6 +54,7 @@ #if defined(CONFIG_BT_CTLR_NRF_GRTC) #include +#include #else /* !CONFIG_BT_CTLR_NRF_GRTC */ #include #endif /* !CONFIG_BT_CTLR_NRF_GRTC */ From ecc55bf2c1350c8377562d5571222c4ff22a6bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1312/3334] Revert "[nrf fromtree] Bluetooth: Controller: nRF54L: Fix to improve decryption speed" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9c2eec4cc456ae1bc840d3812e02dd3f3a19ce6a. Signed-off-by: Tomasz Moń --- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 77 +++++++------------ .../nordic/hal/nrf5/radio/radio_nrf5_dppi.h | 30 ++++---- 2 files changed, 42 insertions(+), 65 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 218965d11bd0..dbca89da1c58 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 @@ -2114,14 +2114,10 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ NRF_CCM->ENABLE = CCM_ENABLE_ENABLE_Disabled; NRF_CCM->ENABLE = CCM_ENABLE_ENABLE_Enabled; - /* Select the CCM decryption mode for the SoC */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - /* NOTE: Use fast decryption as rx data is decrypt after payload is received, compared to - * decrypting in parallel with radio reception of address in nRF51/nRF52/nRF53. - */ - mode = (CCM_MODE_MODE_FastDecryption << CCM_MODE_MODE_Pos) & + mode = (CCM_MODE_MODE_Decryption << CCM_MODE_MODE_Pos) & CCM_MODE_MODE_Msk; +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* Enable CCM Protocol Mode Bluetooth LE */ mode |= (CCM_MODE_PROTOCOL_Ble << CCM_MODE_PROTOCOL_Pos) & CCM_MODE_PROTOCOL_Msk; @@ -2130,30 +2126,21 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ mode |= (CCM_MODE_MACLEN_M4 << CCM_MODE_MACLEN_Pos) & CCM_MODE_MACLEN_Msk; -#elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) || defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) - mode = (CCM_MODE_MODE_Decryption << CCM_MODE_MODE_Pos) & - CCM_MODE_MODE_Msk; - +#elif !defined(CONFIG_SOC_SERIES_NRF51X) /* Enable CCM support for 8-bit length field PDUs. */ mode |= (CCM_MODE_LENGTH_Extended << CCM_MODE_LENGTH_Pos) & CCM_MODE_LENGTH_Msk; - -#elif defined(CONFIG_SOC_SERIES_NRF51X) - mode = (CCM_MODE_MODE_Decryption << CCM_MODE_MODE_Pos) & - CCM_MODE_MODE_Msk; - -#else -#error "H/w accelerated decryption unsupported." -#endif +#endif /* !CONFIG_SOC_SERIES_NRF51X */ /* Select CCM data rate based on current PHY in use. */ switch (phy) { default: case PHY_1M: -#if !defined(CONFIG_SOC_SERIES_NRF51X) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - mode |= (CCM_MODE_DATARATE_1Mbit << CCM_MODE_DATARATE_Pos) & +#if !defined(CONFIG_SOC_SERIES_NRF51X) + mode |= (CCM_MODE_DATARATE_1Mbit << + CCM_MODE_DATARATE_Pos) & CCM_MODE_DATARATE_Msk; -#endif /* !CONFIG_SOC_SERIES_NRF51X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_SERIES_NRF51X */ if (false) { @@ -2176,10 +2163,11 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ break; case PHY_2M: -#if !defined(CONFIG_SOC_SERIES_NRF51X) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - mode |= (CCM_MODE_DATARATE_2Mbit << CCM_MODE_DATARATE_Pos) & +#if !defined(CONFIG_SOC_SERIES_NRF51X) + mode |= (CCM_MODE_DATARATE_2Mbit << + CCM_MODE_DATARATE_Pos) & CCM_MODE_DATARATE_Msk; -#endif /* !CONFIG_SOC_SERIES_NRF51X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_SERIES_NRF51X */ hal_trigger_crypt_ppi_config(); hal_radio_nrf_ppi_channels_enable(BIT(HAL_TRIGGER_CRYPT_PPI)); @@ -2189,10 +2177,9 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ #if defined(CONFIG_BT_CTLR_PHY_CODED) #if defined(CONFIG_HAS_HW_NRF_RADIO_BLE_CODED) case PHY_CODED: -#if !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - mode |= (CCM_MODE_DATARATE_125Kbps << CCM_MODE_DATARATE_Pos) & + mode |= (CCM_MODE_DATARATE_125Kbps << + CCM_MODE_DATARATE_Pos) & CCM_MODE_DATARATE_Msk; -#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ NRF_CCM->RATEOVERRIDE = (CCM_RATEOVERRIDE_RATEOVERRIDE_500Kbps << @@ -2359,11 +2346,22 @@ static void *radio_ccm_ext_tx_pkt_set(struct ccm *cnf, uint8_t pdu_type, void *p NRF_CCM->ENABLE = CCM_ENABLE_ENABLE_Disabled; NRF_CCM->ENABLE = CCM_ENABLE_ENABLE_Enabled; - /* Select the CCM encryption mode for the SoC */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) mode = (CCM_MODE_MODE_Encryption << CCM_MODE_MODE_Pos) & CCM_MODE_MODE_Msk; +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) || \ + defined(CONFIG_SOC_COMPATIBLE_NRF53X) + /* Enable CCM support for 8-bit length field PDUs. */ + mode |= (CCM_MODE_LENGTH_Extended << CCM_MODE_LENGTH_Pos) & + CCM_MODE_LENGTH_Msk; + + /* NOTE: use fastest data rate as tx data needs to be prepared before + * radio Tx on any PHY. + */ + mode |= (CCM_MODE_DATARATE_2Mbit << CCM_MODE_DATARATE_Pos) & + CCM_MODE_DATARATE_Msk; + +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* Enable CCM Protocol Mode Bluetooth LE */ mode |= (CCM_MODE_PROTOCOL_Ble << CCM_MODE_PROTOCOL_Pos) & CCM_MODE_PROTOCOL_Msk; @@ -2377,27 +2375,6 @@ static void *radio_ccm_ext_tx_pkt_set(struct ccm *cnf, uint8_t pdu_type, void *p /* Enable CCM MAC Length 4 bytes */ mode |= (CCM_MODE_MACLEN_M4 << CCM_MODE_MACLEN_Pos) & CCM_MODE_MACLEN_Msk; - -#elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) || defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) - mode = (CCM_MODE_MODE_Encryption << CCM_MODE_MODE_Pos) & - CCM_MODE_MODE_Msk; - - /* Enable CCM support for 8-bit length field PDUs. */ - mode |= (CCM_MODE_LENGTH_Extended << CCM_MODE_LENGTH_Pos) & - CCM_MODE_LENGTH_Msk; - - /* NOTE: use fastest data rate as tx data needs to be prepared before - * radio Tx on any PHY. - */ - mode |= (CCM_MODE_DATARATE_2Mbit << CCM_MODE_DATARATE_Pos) & - CCM_MODE_DATARATE_Msk; - -#elif defined(CONFIG_SOC_SERIES_NRF51X) - mode = (CCM_MODE_MODE_Encryption << CCM_MODE_MODE_Pos) & - CCM_MODE_MODE_Msk; - -#else -#error "H/w accelerated encryption unsupported." #endif NRF_CCM->MODE = mode; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h index 3b68259c9bf6..11bb973994b4 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h @@ -106,17 +106,17 @@ static inline void hal_event_timer_start_ppi_config(void) nrf_grtc_publish_set(NRF_GRTC, HAL_CNTR_GRTC_EVENT_COMPARE_RADIO, HAL_EVENT_TIMER_START_PPI); - /* Setup PPIB receive publish */ - nrf_ppib_publish_set(NRF_PPIB11, HAL_PPIB_RECEIVE_EVENT_TIMER_START_PPI, - HAL_EVENT_TIMER_START_PPI); + /* Enable same DPPI in Peripheral domain */ + nrf_dppi_channels_enable(NRF_DPPIC20, + BIT(HAL_EVENT_TIMER_START_PPI)); /* Setup PPIB send subscribe */ nrf_ppib_subscribe_set(NRF_PPIB21, HAL_PPIB_SEND_EVENT_TIMER_START_PPI, HAL_EVENT_TIMER_START_PPI); - /* Enable same DPPI in Peripheral domain */ - nrf_dppi_channels_enable(NRF_DPPIC20, - BIT(HAL_EVENT_TIMER_START_PPI)); + /* Setup PPIB receive publish */ + nrf_ppib_publish_set(NRF_PPIB11, HAL_PPIB_RECEIVE_EVENT_TIMER_START_PPI, + HAL_EVENT_TIMER_START_PPI); #else /* !CONFIG_BT_CTLR_NRF_GRTC */ nrf_rtc_publish_set(NRF_RTC, NRF_RTC_EVENT_COMPARE_2, HAL_EVENT_TIMER_START_PPI); @@ -148,22 +148,22 @@ static inline void hal_radio_ready_time_capture_ppi_config(void) */ static inline void hal_trigger_crypt_ppi_config(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_PAYLOAD, HAL_TRIGGER_CRYPT_PPI); nrf_ccm_subscribe_set(NRF_CCM, NRF_CCM_TASK_START, HAL_TRIGGER_CRYPT_PPI); - /* Setup PPIB receive publish */ - nrf_ppib_publish_set(NRF_PPIB00, HAL_PPIB_RECEIVE_TRIGGER_CRYPT_PPI, HAL_TRIGGER_CRYPT_PPI); +#if !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) + nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS, HAL_TRIGGER_CRYPT_PPI); - /* Setup PPIB send subscribe */ - nrf_ppib_subscribe_set(NRF_PPIB10, HAL_PPIB_SEND_TRIGGER_CRYPT_PPI, HAL_TRIGGER_CRYPT_PPI); +#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ + nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_PAYLOAD, HAL_TRIGGER_CRYPT_PPI); /* Enable same DPPI in MCU domain */ nrf_dppi_channels_enable(NRF_DPPIC00, BIT(HAL_TRIGGER_CRYPT_PPI)); -#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ - nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS, HAL_TRIGGER_CRYPT_PPI); - nrf_ccm_subscribe_set(NRF_CCM, NRF_CCM_TASK_START, HAL_TRIGGER_CRYPT_PPI); + /* Setup PPIB send subscribe */ + nrf_ppib_subscribe_set(NRF_PPIB10, HAL_PPIB_SEND_TRIGGER_CRYPT_PPI, HAL_TRIGGER_CRYPT_PPI); + + /* Setup PPIB receive publish */ + nrf_ppib_publish_set(NRF_PPIB00, HAL_PPIB_RECEIVE_TRIGGER_CRYPT_PPI, HAL_TRIGGER_CRYPT_PPI); #endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ } From 1b2a0ea3d83165a8ce96321720d1f398b5deb0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1313/3334] Revert "[nrf fromtree] Bluetooth: Controller: Revert relaxed radio packet assignment deadline" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 68e687c348690ddaf33da3a07123c6e7067617c0. Signed-off-by: Tomasz Moń --- .../controller/ll_sw/nordic/lll/lll_adv.c | 21 ++-------- .../controller/ll_sw/nordic/lll/lll_adv_aux.c | 28 ++------------ .../controller/ll_sw/nordic/lll/lll_adv_iso.c | 7 +--- .../ll_sw/nordic/lll/lll_adv_sync.c | 7 +--- .../ll_sw/nordic/lll/lll_central_iso.c | 38 +------------------ .../controller/ll_sw/nordic/lll/lll_conn.c | 30 ++++++--------- .../ll_sw/nordic/lll/lll_peripheral_iso.c | 35 +---------------- .../controller/ll_sw/nordic/lll/lll_scan.c | 12 +++--- .../ll_sw/nordic/lll/lll_scan_aux.c | 21 ++-------- 9 files changed, 33 insertions(+), 166 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c index 5d1d89712619..96d93b2b855b 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c @@ -1182,12 +1182,7 @@ static void isr_tx(void *param) radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -1576,12 +1571,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, radio_pkt_tx_set(lll_adv_scan_rsp_curr_get(lll)); /* assert if radio packet ptr is not set and radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -1652,12 +1642,7 @@ static inline int isr_rx_pdu(struct lll_adv *lll, radio_disable(); /* assert if radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c index c4ee5af14b1d..731ca94ed508 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c @@ -488,12 +488,7 @@ static void isr_tx_chain(void *param) radio_pkt_tx_set(pdu); /* assert if radio packet ptr is not set and radio started rx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -607,12 +602,7 @@ static void isr_tx_rx(void *param) radio_pkt_rx_set(node_rx->pdu); /* assert if radio packet ptr is not set and radio started rx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -819,12 +809,7 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, radio_pkt_tx_set(sr_pdu); /* assert if radio packet ptr is not set and radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -896,12 +881,7 @@ static inline int isr_rx_pdu(struct lll_adv_aux *lll_aux, uint8_t phy_flags_rx, radio_pkt_tx_set(pdu_tx); /* assert if radio packet ptr is not set and radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c index 774a10da2b30..0b9ff8d938c2 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_iso.c @@ -869,12 +869,7 @@ static void isr_tx_common(void *param, } /* assert if radio packet ptr is not set and radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c index 7bcc0435fe53..e30b6d6b8d2a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_sync.c @@ -401,12 +401,7 @@ static void isr_tx(void *param) radio_pkt_tx_set(pdu); /* assert if radio packet ptr is not set and radio started rx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c index fc44233f1ee8..7ae759dd2bec 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c @@ -34,7 +34,6 @@ #include "lll_internal.h" #include "lll_tim_internal.h" -#include "lll_prof_internal.h" #include "ll_feat.h" @@ -467,10 +466,6 @@ static void isr_tx(void *param) struct node_rx_pdu *node_rx; uint32_t hcto; - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_latency_capture(); - } - /* Call to ensure packet/event timer accumulates the elapsed time * under single timer use. */ @@ -543,12 +538,7 @@ static void isr_tx(void *param) } /* assert if radio packet ptr is not set and radio started rx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); /* +/- 2us active clock jitter, +1 us PPI to timer start compensation */ hcto = radio_tmr_tifs_base_get() + cis_lll->tifs_us + @@ -715,10 +705,6 @@ static void isr_rx(void *param) uint8_t crc_ok; uint8_t cie; - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_latency_capture(); - } - /* Read radio status and events */ trx_done = radio_is_done(); if (trx_done) { @@ -989,10 +975,6 @@ static void isr_rx(void *param) isr_prepare_subevent(param); - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_send(); - } - return; isr_rx_done: @@ -1149,13 +1131,6 @@ static void isr_prepare_subevent(void *param) radio_tmr_end_capture(); #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) - /* PA enable is overwriting packet end used in ISR profiling, hence - * back it up for later use. - */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_radio_end_backup(); - } - radio_gpio_pa_setup(); #if defined(CONFIG_BT_CTLR_PHY) @@ -1173,16 +1148,7 @@ static void isr_prepare_subevent(void *param) #endif /* !HAL_RADIO_GPIO_HAVE_PA_PIN */ /* assert if radio packet ptr is not set and radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } - - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_cputime_capture(); - } + LL_ASSERT(!radio_is_ready()); radio_isr_set(isr_tx, param); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c index a528e06c939e..1527987c02d0 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c @@ -311,6 +311,9 @@ void lll_conn_isr_rx(void *param) struct pdu_data *pdu_data_tx; struct node_rx_pdu *node_rx; struct node_tx *tx_release; +#if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) + uint32_t pa_lna_enable_us; +#endif /* HAL_RADIO_GPIO_HAVE_PA_PIN */ uint8_t is_rx_enqueue; struct lll_conn *lll; uint8_t rssi_ready; @@ -381,12 +384,7 @@ void lll_conn_isr_rx(void *param) radio_disable(); /* assert if radio started tx before being disabled */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", - __func__, lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); goto lll_conn_isr_rx_exit; } @@ -470,13 +468,10 @@ void lll_conn_isr_rx(void *param) } else if (!lll->role) { radio_disable(); - /* assert if radio started tx before being disabled */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", - __func__, lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + /* assert if radio packet ptr is not set and radio + * started tx. + */ + LL_ASSERT(!radio_is_ready()); /* Restore state if last transmitted was empty PDU */ lll->empty = is_empty_pdu_tx_retry; @@ -512,7 +507,6 @@ void lll_conn_isr_rx(void *param) lll_conn_tx_pkt_set(lll, pdu_data_tx); #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) - uint32_t pa_lna_enable_us; #if defined(CONFIG_BT_CTLR_PROFILE_ISR) /* PA enable is overwriting packet end used in ISR profiling, hence @@ -535,10 +529,10 @@ void lll_conn_isr_rx(void *param) /* assert if radio packet ptr is not set and radio started tx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT(!radio_is_address()); } #if defined(CONFIG_BT_CTLR_TX_DEFER) @@ -733,10 +727,10 @@ void lll_conn_isr_tx(void *param) /* assert if radio packet ptr is not set and radio started rx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT(!radio_is_address()); } #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c index 46e6aad63b7e..5d23a12993bd 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c @@ -34,7 +34,6 @@ #include "lll_internal.h" #include "lll_tim_internal.h" -#include "lll_prof_internal.h" #include "ll_feat.h" @@ -497,10 +496,6 @@ static void isr_rx(void *param) uint8_t crc_ok; uint8_t cie; - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_latency_capture(); - } - /* Read radio status and events */ trx_done = radio_is_done(); if (trx_done) { @@ -779,13 +774,6 @@ static void isr_rx(void *param) #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) uint32_t pa_lna_enable_us; - /* PA enable is overwriting packet end used in ISR profiling, hence - * back it up for later use. - */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_radio_end_backup(); - } - radio_gpio_pa_setup(); pa_lna_enable_us = radio_tmr_tifs_base_get() + cis_lll->tifs_us - @@ -800,16 +788,7 @@ static void isr_rx(void *param) #endif /* HAL_RADIO_GPIO_HAVE_PA_PIN */ /* assert if radio packet ptr is not set and radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } - - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_cputime_capture(); - } + LL_ASSERT(!radio_is_ready()); /* Schedule next subevent */ if (!cie && (se_curr < cis_lll->nse)) { @@ -886,10 +865,6 @@ static void isr_rx(void *param) start_us = radio_tmr_start_us(0U, subevent_us); LL_ASSERT(start_us == (subevent_us + 1U)); #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ - - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_send(); - } } static void isr_tx(void *param) @@ -901,10 +876,6 @@ static void isr_tx(void *param) uint32_t start_us; uint32_t hcto; - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - lll_prof_latency_capture(); - } - /* Call to ensure packet/event timer accumulates the elapsed time * under single timer use. */ @@ -1023,10 +994,6 @@ static void isr_tx(void *param) radio_tmr_hcto_configure_abs(hcto); -#if defined(CONFIG_BT_CTLR_PROFILE_ISR) || defined(HAL_RADIO_GPIO_HAVE_PA_PIN) - radio_tmr_end_capture(); -#endif /* CONFIG_BT_CTLR_PROFILE_ISR || HAL_RADIO_GPIO_HAVE_PA_PIN */ - #if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) radio_gpio_lna_setup(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index f1fab4b664de..79f60677be7c 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -792,10 +792,10 @@ static void isr_tx(void *param) /* assert if radio packet ptr is not set and radio started rx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT(!radio_is_address()); } #if defined(CONFIG_BT_CTLR_PRIVACY) @@ -1217,10 +1217,10 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, /* assert if radio packet ptr is not set and radio started tx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT(!radio_is_address()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { @@ -1354,10 +1354,10 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx, /* assert if radio packet ptr is not set and radio started tx */ if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, + LL_ASSERT_MSG(!radio_is_address(), "%s: Radio ISR latency: %u", __func__, lll_prof_latency_get()); } else { - LL_ASSERT(!radio_is_ready()); + LL_ASSERT(!radio_is_address()); } if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c index 0478fbc80011..1a8aeb536f0c 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c @@ -1051,12 +1051,7 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux, radio_pkt_tx_set(pdu_tx); /* assert if radio packet ptr is not set and radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -1206,12 +1201,7 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux, radio_pkt_tx_set(pdu_tx); /* assert if radio packet ptr is not set and radio started tx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); @@ -1417,12 +1407,7 @@ static void isr_tx(struct lll_scan_aux *lll_aux, void *pdu_rx, radio_pkt_rx_set(pdu_rx); /* assert if radio packet ptr is not set and radio started rx */ - if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { - LL_ASSERT_MSG(!radio_is_ready(), "%s: Radio ISR latency: %u", __func__, - lll_prof_latency_get()); - } else { - LL_ASSERT(!radio_is_ready()); - } + LL_ASSERT(!radio_is_ready()); if (IS_ENABLED(CONFIG_BT_CTLR_PROFILE_ISR)) { lll_prof_cputime_capture(); From 52dca193d38dc08c17e31fd021fe8278a8a2bbce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1314/3334] Revert "[nrf fromtree] Bluetooth: Controller: Use CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 22fc62f966c9a3306275c227a60ef7a01b2756b8. Signed-off-by: Tomasz Moń --- .../ll_sw/nordic/hal/nrf5/radio/radio.c | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 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 dbca89da1c58..0199326ed3ce 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 @@ -317,7 +317,7 @@ void radio_tx_power_set(int8_t power) value = hal_radio_tx_power_value(power); NRF_RADIO->TXPOWER = value; -#elif defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) uint32_t value; /* NOTE: TXPOWER register only accepts upto 0dBm, hence use the HAL @@ -328,12 +328,12 @@ void radio_tx_power_set(int8_t power) NRF_RADIO->TXPOWER = value; hal_radio_tx_power_high_voltage_set(power); -#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ /* NOTE: valid value range is passed by Kconfig define. */ NRF_RADIO->TXPOWER = (uint32_t)power; -#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tx_power_max_set(void) @@ -351,25 +351,25 @@ int8_t radio_tx_power_min_get(void) int8_t radio_tx_power_max_get(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) return RADIO_TXPOWER_TXPOWER_Pos3dBm; -#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF53X */ return (int8_t)hal_radio_tx_power_max_get(); -#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X */ } int8_t radio_tx_power_floor(int8_t power) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) /* NOTE: TXPOWER register only accepts upto 0dBm, +3dBm permitted by * use of high voltage being set for radio when TXPOWER register is set. */ if (power >= (int8_t)RADIO_TXPOWER_TXPOWER_Pos3dBm) { return RADIO_TXPOWER_TXPOWER_Pos3dBm; } -#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF53X */ return (int8_t)hal_radio_tx_power_floor(power); } @@ -427,7 +427,7 @@ void radio_pkt_configure(uint8_t bits_len, uint8_t max_len, uint8_t flags) bits_s1 = RADIO_PKT_CONF_LENGTH_8BIT - bits_len; #elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) || \ - defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || \ + defined(CONFIG_SOC_COMPATIBLE_NRF53X) || \ defined(CONFIG_SOC_COMPATIBLE_NRF54LX) extra = 0U; @@ -525,7 +525,7 @@ uint32_t radio_rx_chain_delay_get(uint8_t phy, uint8_t flags) void radio_rx_enable(void) { #if !defined(CONFIG_BT_CTLR_TIFS_HW) -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* NOTE: Timer clear DPPI configuration is needed only for nRF53 * because of calls to radio_disable() and * radio_switch_complete_and_disable() inside a radio event call @@ -538,7 +538,7 @@ void radio_rx_enable(void) * radio event but when the radio event is done. */ hal_sw_switch_timer_clear_ppi_config(); -#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_RXEN); @@ -547,7 +547,7 @@ void radio_rx_enable(void) void radio_tx_enable(void) { #if !defined(CONFIG_BT_CTLR_TIFS_HW) -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* NOTE: Timer clear DPPI configuration is needed only for nRF53 * because of calls to radio_disable() and * radio_switch_complete_and_disable() inside a radio event call @@ -560,7 +560,7 @@ void radio_tx_enable(void) * radio event but when the radio event is done. */ hal_sw_switch_timer_clear_ppi_config(); -#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_TXEN); @@ -939,13 +939,13 @@ void sw_switch(uint8_t dir_curr, uint8_t dir_next, uint8_t phy_curr, uint8_t fla * time-stamp. */ hal_radio_end_time_capture_ppi_config(); -#if !defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if !defined(CONFIG_SOC_COMPATIBLE_NRF53X) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* The function is not called for nRF5340 single timer configuration because * HAL_SW_SWITCH_TIMER_CLEAR_PPI is equal to HAL_RADIO_END_TIME_CAPTURE_PPI, * so channel is already enabled. */ hal_radio_nrf_ppi_channels_enable(BIT(HAL_RADIO_END_TIME_CAPTURE_PPI)); -#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ sw_tifs_toggle += 1U; @@ -1360,38 +1360,38 @@ void radio_tmr_rx_status_reset(void) void radio_tmr_tx_enable(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ #if (HAL_RADIO_ENABLE_TX_ON_TICK_PPI == HAL_RADIO_ENABLE_RX_ON_TICK_PPI) hal_radio_enable_on_tick_ppi_config_and_enable(1U); #endif /* HAL_RADIO_ENABLE_TX_ON_TICK_PPI == HAL_RADIO_ENABLE_RX_ON_TICK_PPI */ -#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tmr_rx_enable(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ #if (HAL_RADIO_ENABLE_TX_ON_TICK_PPI == HAL_RADIO_ENABLE_RX_ON_TICK_PPI) hal_radio_enable_on_tick_ppi_config_and_enable(0U); #endif /* HAL_RADIO_ENABLE_TX_ON_TICK_PPI == HAL_RADIO_ENABLE_RX_ON_TICK_PPI */ -#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tmr_tx_disable(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) nrf_radio_subscribe_clear(NRF_RADIO, NRF_RADIO_TASK_TXEN); -#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ -#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tmr_rx_disable(void) { -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) nrf_radio_subscribe_clear(NRF_RADIO, NRF_RADIO_TASK_RXEN); -#else /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ -#endif /* !CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* !CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX */ } void radio_tmr_tifs_set(uint32_t tifs) @@ -1627,7 +1627,7 @@ uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t ticks_start) #if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER) last_pdu_end_us_init(latency_us); #endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* NOTE: Timer clear DPPI configuration is needed only for nRF53 * because of calls to radio_disable() and * radio_switch_complete_and_disable() inside a radio event call @@ -1640,7 +1640,7 @@ uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t ticks_start) * radio event but when the radio event is done. */ hal_sw_switch_timer_clear_ppi_config(); -#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ return remainder_us; @@ -1657,7 +1657,7 @@ uint32_t radio_tmr_start_us(uint8_t trx, uint32_t start_us) */ start_us -= last_pdu_end_us; #endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX) /* NOTE: Timer clear DPPI configuration is needed only for nRF53 * because of calls to radio_disable() and * radio_switch_complete_and_disable() inside a radio event call @@ -1670,7 +1670,7 @@ uint32_t radio_tmr_start_us(uint8_t trx, uint32_t start_us) * radio event but when the radio event is done. */ hal_sw_switch_timer_clear_ppi_config(); -#endif /* CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX */ +#endif /* CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX */ #endif /* !CONFIG_BT_CTLR_TIFS_HW */ /* start_us could be the current count in the timer */ @@ -1876,14 +1876,13 @@ void radio_tmr_end_capture(void) * hal_sw_switch_timer_clear_ppi_config() and sw_switch(). There is no need to * configure the channel again in this function. */ -#if (!defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX)) || \ - ((defined(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET) || \ - defined(CONFIG_SOC_COMPATIBLE_NRF54LX)) && \ +#if (!defined(CONFIG_SOC_COMPATIBLE_NRF53X) && !defined(CONFIG_SOC_COMPATIBLE_NRF54LX)) || \ + ((defined(CONFIG_SOC_COMPATIBLE_NRF53X) || defined(CONFIG_SOC_COMPATIBLE_NRF54LX)) && \ !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)) hal_radio_end_time_capture_ppi_config(); hal_radio_nrf_ppi_channels_enable(BIT(HAL_RADIO_END_TIME_CAPTURE_PPI)); -#endif /* (!CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET && !CONFIG_SOC_COMPATIBLE_NRF54LX) || - * ((CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET || CONFIG_SOC_COMPATIBLE_NRF54LX) && +#endif /* (!CONFIG_SOC_COMPATIBLE_NRF53X && !CONFIG_SOC_COMPATIBLE_NRF54LX) || + * ((CONFIG_SOC_COMPATIBLE_NRF53X || CONFIG_SOC_COMPATIBLE_NRF54LX) && * !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER) */ } From 8267ca4f69e98eac9871ee68db68d06c6e6a12cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1315/3334] Revert "[nrf fromtree] Bluetooth: Controller: Cosmetic changes to Link Layer interface" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4b3169c21c11359b0449c97377a50977cf1b1d8c. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/include/ll.h | 149 ++++++++---------- .../controller/include/ll_settings.h | 24 ++- 2 files changed, 72 insertions(+), 101 deletions(-) diff --git a/subsys/bluetooth/controller/include/ll.h b/subsys/bluetooth/controller/include/ll.h index f807842e6c34..9d08436da8c4 100644 --- a/subsys/bluetooth/controller/include/ll.h +++ b/subsys/bluetooth/controller/include/ll.h @@ -1,39 +1,63 @@ /* - * Copyright (c) 2016-2025 Nordic Semiconductor ASA + * Copyright (c) 2016-2021 Nordic Semiconductor ASA * Copyright (c) 2016 Vinayak Kariappa Chettimada * * SPDX-License-Identifier: Apache-2.0 */ -#if defined(CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING) -#define LL_ADV_HANDLE_MAPPING -#else /* !CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING */ -#define LL_ADV_HANDLE_MAPPING static __attribute__((always_inline)) inline -#endif /* !CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING */ - -/* Initialization and Reset Interfaces */ int ll_init(struct k_sem *sem_rx); int ll_deinit(void); void ll_reset(void); -/* Features Interfaces */ uint8_t ll_set_host_feature(uint8_t bit_number, uint8_t bit_value); uint64_t ll_feat_get(void); -/* Device Address Interfaces */ uint8_t ll_addr_set(uint8_t addr_type, uint8_t const *const p_bdaddr); uint8_t *ll_addr_get(uint8_t addr_type); uint8_t *ll_addr_read(uint8_t addr_type, uint8_t *const bdaddr); -/* Advertising Handles Interfaces */ -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle); -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_by_hci_handle_get_or_new(uint8_t hci_handle, - uint8_t *handle); -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_hci_handle_get(uint8_t handle); -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle); -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, uint8_t *handle); +#if defined(CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING) +uint8_t ll_adv_set_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle); +uint8_t ll_adv_set_by_hci_handle_get_or_new(uint8_t hci_handle, + uint8_t *handle); +uint8_t ll_adv_set_hci_handle_get(uint8_t handle); +uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle); +uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, uint8_t *handle); +#else +static inline uint8_t ll_adv_set_by_hci_handle_get(uint8_t hci_handle, + uint8_t *handle) +{ + *handle = hci_handle; + return 0; +} + +static inline uint8_t ll_adv_set_by_hci_handle_get_or_new(uint8_t hci_handle, + uint8_t *handle) +{ + *handle = hci_handle; + return 0; +} + +static inline uint8_t ll_adv_set_hci_handle_get(uint8_t handle) +{ + return handle; +} + +static inline uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, + uint8_t *handle) +{ + *handle = hci_handle; + return 0; +} + +static inline uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, + uint8_t *handle) +{ + *handle = hci_handle; + return 0; +} +#endif -/* Advertising State Interfaces */ #if defined(CONFIG_BT_CTLR_ADV_EXT) uint8_t ll_adv_params_set(uint8_t handle, uint16_t evt_prop, uint32_t interval, uint8_t adv_type, uint8_t own_addr_type, @@ -54,7 +78,6 @@ uint8_t ll_adv_data_set(uint8_t len, uint8_t const *const p_data); uint8_t ll_adv_scan_rsp_set(uint8_t len, uint8_t const *const p_data); #endif /* !CONFIG_BT_CTLR_ADV_EXT */ -/* Extended Advertising State Interfaces */ uint8_t ll_adv_aux_random_addr_set(uint8_t handle, uint8_t const *const addr); uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, uint8_t len, uint8_t const *const data); @@ -64,15 +87,12 @@ uint16_t ll_adv_aux_max_data_length_get(void); uint8_t ll_adv_aux_set_count_get(void); uint8_t ll_adv_aux_set_remove(uint8_t handle); uint8_t ll_adv_aux_set_clear(void); - -/* Periodic Advertising State Interfaces */ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags); uint8_t ll_adv_sync_ad_data_set(uint8_t handle, uint8_t op, uint8_t len, uint8_t const *const data); uint8_t ll_adv_sync_enable(uint8_t handle, uint8_t enable); -/* Advertising Enable and Disable Interfaces */ #if defined(CONFIG_BT_CTLR_ADV_EXT) || defined(CONFIG_BT_HCI_MESH_EXT) #if defined(CONFIG_BT_HCI_MESH_EXT) uint8_t ll_adv_enable(uint8_t handle, uint8_t enable, @@ -88,7 +108,6 @@ uint8_t ll_adv_enable(uint8_t enable); uint8_t ll_adv_disable_all(void); -/* Broadcast ISO State Interfaces */ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis, uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_latency, uint8_t rtn, uint8_t phy, @@ -102,7 +121,6 @@ uint8_t ll_big_test_create(uint8_t big_handle, uint8_t adv_handle, uint8_t pto, uint8_t encryption, uint8_t *bcode); uint8_t ll_big_terminate(uint8_t big_handle, uint8_t reason); -/* Scanning State Interfaces */ uint8_t ll_scan_params_set(uint8_t type, uint16_t interval, uint16_t window, uint8_t own_addr_type, uint8_t filter_policy); #if defined(CONFIG_BT_CTLR_ADV_EXT) @@ -111,30 +129,24 @@ uint8_t ll_scan_enable(uint8_t enable, uint16_t duration, uint16_t period); uint8_t ll_scan_enable(uint8_t enable); #endif /* !CONFIG_BT_CTLR_ADV_EXT */ -/* Periodic Advertising Sync State Interfaces */ uint8_t ll_sync_create(uint8_t options, uint8_t sid, uint8_t adv_addr_type, uint8_t *adv_addr, uint16_t skip, uint16_t sync_timeout, uint8_t sync_cte_type); uint8_t ll_sync_create_cancel(void **rx); uint8_t ll_sync_terminate(uint16_t handle); uint8_t ll_sync_recv_enable(uint16_t handle, uint8_t enable); - -/* Periodic Advertising Sync Transfer Interfaces */ uint8_t ll_sync_transfer(uint16_t conn_handle, uint16_t service_data, uint16_t sync_handle); uint8_t ll_adv_sync_set_info_transfer(uint16_t conn_handle, uint16_t service_data, uint8_t adv_handle); uint8_t ll_past_param(uint16_t conn_handle, uint8_t mode, uint16_t skip, uint16_t timeout, uint8_t cte_type); uint8_t ll_default_past_param(uint8_t mode, uint16_t skip, uint16_t timeout, uint8_t cte_type); - -/* Broadcast ISO Sync Receiver State Interfaces */ uint8_t ll_big_sync_create(uint8_t big_handle, uint16_t sync_handle, uint8_t encryption, uint8_t *bcode, uint8_t mse, uint16_t sync_timeout, uint8_t num_bis, uint8_t *bis); uint8_t ll_big_sync_terminate(uint8_t big_handle, void **rx); -/* Connected ISO State Interfaces */ uint8_t ll_cig_parameters_open(uint8_t cig_id, uint32_t c_interval, uint32_t p_interval, uint8_t sca, uint8_t packing, uint8_t framing, @@ -160,15 +172,6 @@ uint8_t ll_cis_parameters_test_set(uint8_t cis_id, uint8_t nse, uint16_t c_pdu, uint16_t p_pdu, uint8_t c_phy, uint8_t p_phy, uint8_t c_bn, uint8_t p_bn); -uint8_t ll_cig_remove(uint8_t cig_id); -uint8_t ll_cis_create_check(uint16_t cis_handle, uint16_t acl_handle); -void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle); -uint8_t ll_cis_accept(uint16_t handle); -uint8_t ll_cis_reject(uint16_t handle, uint8_t reason); -uint8_t ll_conn_iso_accept_timeout_get(uint16_t *timeout); -uint8_t ll_conn_iso_accept_timeout_set(uint16_t timeout); - -/* ISO SDU data Interfaces */ /* Must be implemented by vendor if vendor-specific data path is supported */ uint8_t ll_configure_data_path(uint8_t data_path_dir, uint8_t data_path_id, @@ -197,19 +200,24 @@ uint8_t ll_iso_read_test_counters(uint16_t handle, uint32_t *received_cnt, uint32_t *missed_cnt, uint32_t *failed_cnt); -/* Filter Accept List Interfaces */ +uint8_t ll_cig_remove(uint8_t cig_id); + +uint8_t ll_cis_create_check(uint16_t cis_handle, uint16_t acl_handle); +void ll_cis_create(uint16_t cis_handle, uint16_t acl_handle); + +uint8_t ll_cis_accept(uint16_t handle); +uint8_t ll_cis_reject(uint16_t handle, uint8_t reason); + uint8_t ll_fal_size_get(void); uint8_t ll_fal_clear(void); uint8_t ll_fal_add(bt_addr_le_t *addr); uint8_t ll_fal_remove(bt_addr_le_t *addr); -/* Privacy Accept List Interfaces */ uint8_t ll_pal_size_get(void); uint8_t ll_pal_clear(void); uint8_t ll_pal_add(const bt_addr_le_t *const addr, const uint8_t sid); uint8_t ll_pal_remove(const bt_addr_le_t *const addr, const uint8_t sid); -/* Private Resolvable Address Resolution Interfaces */ void ll_rl_id_addr_get(uint8_t rl_idx, uint8_t *id_addr_type, uint8_t *id_addr); uint8_t ll_rl_size_get(void); uint8_t ll_rl_clear(void); @@ -223,7 +231,6 @@ uint8_t ll_rl_enable(uint8_t enable); void ll_rl_timeout_set(uint16_t timeout); uint8_t ll_priv_mode_set(bt_addr_le_t *id_addr, uint8_t mode); -/* Connection State Interfaces */ #if defined(CONFIG_BT_CTLR_ADV_EXT) uint8_t ll_create_connection(uint16_t scan_interval, uint16_t scan_window, uint8_t filter_policy, uint8_t peer_addr_type, @@ -276,7 +283,7 @@ uint8_t ll_phy_req_send(uint16_t handle, uint8_t tx, uint8_t flags, uint8_t rx); uint8_t ll_set_min_used_chans(uint16_t handle, uint8_t const phys, uint8_t const min_used_chans); -/* Direction Finding Interfaces */ +/* Direction Finding */ /* Sets CTE transmission parameters for periodic advertising */ uint8_t ll_df_set_cl_cte_tx_params(uint8_t adv_handle, uint8_t cte_len, uint8_t cte_type, uint8_t cte_count, @@ -309,21 +316,12 @@ void ll_df_read_ant_inf(uint8_t *switch_sample_rates, uint8_t *max_switch_pattern_len, uint8_t *max_cte_len); -/* Path Loss Monitoring Interfaces */ -uint8_t ll_conn_set_path_loss_parameters(uint16_t handle, - uint8_t high_threshold, - uint8_t high_hysteresis, - uint8_t low_threshold, - uint8_t low_hysteresis, - uint16_t min_time_spent); -uint8_t ll_conn_set_path_loss_reporting(uint16_t handle, uint8_t enable); - -/* Downstream - ACL Data */ +/* Downstream - Data */ void *ll_tx_mem_acquire(void); void ll_tx_mem_release(void *node_tx); int ll_tx_mem_enqueue(uint16_t handle, void *node_tx); -/* Upstream - Num. Completes, Events, ACL and ISO Data */ +/* Upstream - Num. Completes, Events and Data */ uint8_t ll_rx_get(void **node_rx, uint16_t *handle); void ll_rx_dequeue(void); void ll_rx_mem_release(void **node_rx); @@ -335,6 +333,9 @@ void ll_iso_tx_mem_release(void *tx); int ll_iso_tx_mem_enqueue(uint16_t handle, void *tx, void *link); void ll_iso_link_tx_release(void *link); +uint8_t ll_conn_iso_accept_timeout_get(uint16_t *timeout); +uint8_t ll_conn_iso_accept_timeout_set(uint16_t timeout); + /* External co-operation */ void ll_timeslice_ticker_id_get(uint8_t * const instance_index, uint8_t * const ticker_id); @@ -343,35 +344,11 @@ void ll_coex_ticker_id_get(uint8_t * const instance_index, void ll_radio_state_abort(void); uint32_t ll_radio_state_is_idle(void); -/* Static inline functions */ -#if !defined(CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING) -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle) -{ - *handle = hci_handle; - return 0U; -} - -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_by_hci_handle_get_or_new(uint8_t hci_handle, - uint8_t *handle) -{ - *handle = hci_handle; - return 0U; -} - -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_set_hci_handle_get(uint8_t handle) -{ - return handle; -} - -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle) -{ - *handle = hci_handle; - return 0U; -} +uint8_t ll_conn_set_path_loss_parameters(uint16_t handle, + uint8_t high_threshold, + uint8_t high_hysteresis, + uint8_t low_threshold, + uint8_t low_hysteresis, + uint16_t min_time_spent); -LL_ADV_HANDLE_MAPPING uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, uint8_t *handle) -{ - *handle = hci_handle; - return 0U; -} -#endif /* !CONFIG_BT_CTLR_HCI_ADV_HANDLE_MAPPING */ +uint8_t ll_conn_set_path_loss_reporting(uint16_t handle, uint8_t enable); diff --git a/subsys/bluetooth/controller/include/ll_settings.h b/subsys/bluetooth/controller/include/ll_settings.h index df3835481f3e..c79a4fb1537b 100644 --- a/subsys/bluetooth/controller/include/ll_settings.h +++ b/subsys/bluetooth/controller/include/ll_settings.h @@ -1,31 +1,25 @@ /* - * Copyright (c) 2025 Nordic Semiconductor ASA * Copyright (c) 2019 Oticon A/S * * SPDX-License-Identifier: Apache-2.0 */ #if defined(CONFIG_BT_CTLR_VERSION_SETTINGS) -#define LL_VERSION_SETTINGS -#else /* !CONFIG_BT_CTLR_VERSION_SETTINGS */ -#define LL_VERSION_SETTINGS static __attribute__((always_inline)) inline -#endif /* !CONFIG_BT_CTLR_VERSION_SETTINGS */ -/* Version Interfaces */ -LL_VERSION_SETTINGS uint16_t ll_settings_company_id(void); -LL_VERSION_SETTINGS uint16_t ll_settings_subversion_number(void); +uint16_t ll_settings_company_id(void); +uint16_t ll_settings_subversion_number(void); -/* Stable Modulation Index Interfaces */ -bool ll_settings_smi_tx(void); +#else -/* Static inline functions */ -#if !defined(CONFIG_BT_CTLR_VERSION_SETTINGS) -LL_VERSION_SETTINGS uint16_t ll_settings_company_id(void) +static inline uint16_t ll_settings_company_id(void) { return CONFIG_BT_CTLR_COMPANY_ID; } -LL_VERSION_SETTINGS uint16_t ll_settings_subversion_number(void) +static inline uint16_t ll_settings_subversion_number(void) { return CONFIG_BT_CTLR_SUBVERSION_NUMBER; } -#endif /* !CONFIG_BT_CTLR_VERSION_SETTINGS */ + +#endif /* CONFIG_BT_CTLR_VERSION_SETTINGS */ + +bool ll_settings_smi_tx(void); From 130375639868a10f8caa1f67ea5fd9f8a8f04958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1316/3334] Revert "[nrf fromtree] Bluetooth: Controller: Fix single switch timer use in ISO Sync" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0b19ef9debf1693cbd422680ba4df72a432b05c4. Signed-off-by: Tomasz Moń --- .../ll_sw/nordic/lll/lll_sync_iso.c | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index 2083d8d7780a..4f4dad90754f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -1352,25 +1352,22 @@ static void isr_rx(void *param) hcto -= addr_us_get(lll->phy); hcto -= radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); - /* Overhead within EVENT_IFS_US to exclude from max. jitter */ - /* Required radio ready duration, settling time */ - overhead_us = radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); - /* If single timer used, then consider required max. latency */ - overhead_us += HAL_RADIO_ISR_LATENCY_MAX_US; - /* Add chain delay overhead */ - overhead_us += radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); - /* Add base clock jitter overhead */ + overhead_us = radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); + overhead_us += addr_us_get(lll->phy); + overhead_us += radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); overhead_us += (EVENT_CLOCK_JITTER_US << 1); + LL_ASSERT(EVENT_IFS_US > overhead_us); - /* Max. available clock jitter */ jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1; - /* Max. clock jitter per subevent */ jitter_max_us = (jitter_max_us * nse) / (lll->num_bis * lll->nse); - /* Min. clock jitter we shall use */ - jitter_max_us = MAX(jitter_max_us, (EVENT_CLOCK_JITTER_US << 1)); + overhead_us = HAL_RADIO_TMR_START_DELAY_US; + if (jitter_max_us > overhead_us) { + jitter_max_us -= overhead_us; + } else { + jitter_max_us = 0U; + } - /* Jitter for current subevent */ jitter_us = (EVENT_CLOCK_JITTER_US << 1) * nse; if (jitter_us > jitter_max_us) { jitter_us = jitter_max_us; From 843c6a5d60812ebbfd42439f718b77d06a9a8f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1317/3334] Revert "[nrf fromtree] Bluetooth: Controller: Fix return types for ll_length" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d79ba9db5832568def13b8d9b4497dfdc541d72a. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/include/ll.h | 4 ++-- subsys/bluetooth/controller/ll_sw/ull_conn.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/controller/include/ll.h b/subsys/bluetooth/controller/include/ll.h index 9d08436da8c4..378686064e15 100644 --- a/subsys/bluetooth/controller/include/ll.h +++ b/subsys/bluetooth/controller/include/ll.h @@ -267,10 +267,10 @@ uint8_t ll_tx_pwr_lvl_set(uint8_t handle_type, uint16_t handle, uint8_t ll_apto_get(uint16_t handle, uint16_t *const apto); uint8_t ll_apto_set(uint16_t handle, uint16_t apto); -uint8_t ll_length_req_send(uint16_t handle, uint16_t tx_octets, uint16_t tx_time); +uint32_t ll_length_req_send(uint16_t handle, uint16_t tx_octets, uint16_t tx_time); void ll_length_default_get(uint16_t *const max_tx_octets, uint16_t *const max_tx_time); -uint8_t ll_length_default_set(uint16_t max_tx_octets, uint16_t max_tx_time); +uint32_t ll_length_default_set(uint16_t max_tx_octets, uint16_t max_tx_time); void ll_length_max_get(uint16_t *const max_tx_octets, uint16_t *const max_tx_time, uint16_t *const max_rx_octets, diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index e76b3e7147e9..b68eaea19589 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -562,7 +562,8 @@ static bool ll_len_validate(uint16_t tx_octets, uint16_t tx_time) return true; } -uint8_t ll_length_req_send(uint16_t handle, uint16_t tx_octets, uint16_t tx_time) +uint32_t ll_length_req_send(uint16_t handle, uint16_t tx_octets, + uint16_t tx_time) { struct ll_conn *conn; @@ -600,7 +601,7 @@ void ll_length_default_get(uint16_t *max_tx_octets, uint16_t *max_tx_time) *max_tx_time = default_tx_time; } -uint8_t ll_length_default_set(uint16_t max_tx_octets, uint16_t max_tx_time) +uint32_t ll_length_default_set(uint16_t max_tx_octets, uint16_t max_tx_time) { if (IS_ENABLED(CONFIG_BT_CTLR_PARAM_CHECK) && !ll_len_validate(max_tx_octets, max_tx_time)) { From bce99794f81366227986b64361b8d49af2a4b1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1318/3334] Revert "[nrf fromtree] bluetooth: controller: ll_sw: nordic: constant latency req" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8f55652953dc21fcdb30db4f39ec143c8148a89b. Signed-off-by: Tomasz Moń --- .../controller/ll_sw/nordic/hal/nrf5/radio/radio.c | 9 --------- 1 file changed, 9 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 0199326ed3ce..90a0945f5a19 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 @@ -10,7 +10,6 @@ #include #include -#include #include #include "util/mem.h" @@ -222,11 +221,7 @@ void radio_reset(void) RADIO_TIMING_RU_Msk; #endif /* !CONFIG_BT_CTLR_TIFS_HW */ -#if defined(CONFIG_NRF_SYS_EVENT) - (void)nrf_sys_event_request_global_constlat(); -#else /* !CONFIG_NRF_SYS_EVENT */ NRF_POWER->TASKS_CONSTLAT = 1U; -#endif /* !CONFIG_NRF_SYS_EVENT */ #endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) @@ -1793,11 +1788,7 @@ void radio_tmr_stop(void) #endif /* !CONFIG_BT_CTLR_TIFS_HW */ #if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#if defined(CONFIG_NRF_SYS_EVENT) - (void)nrf_sys_event_release_global_constlat(); -#else /* !CONFIG_NRF_SYS_EVENT */ NRF_POWER->TASKS_LOWPWR = 1U; -#endif /* !CONFIG_NRF_SYS_EVENT */ #endif /* CONFIG_SOC_COMPATIBLE_NRF54LX */ } From d7c765c8fe208c63f46f4d8b62084b6b365ee9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:54 +0100 Subject: [PATCH 1319/3334] Revert "[nrf fromtree] Bluetooth: Controller: Fix missing null pointer check" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f5c2c5cc6793dc41de0209088bbc2b762ba378f4. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/ll_sw/ull_sync_iso.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c index 222191bde22c..65cd09f602fd 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c @@ -586,8 +586,6 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, lll->window_size_event_us; /* Skip to first selected BIS subevent */ stream = ull_sync_iso_stream_get(lll->stream_handle[0]); - LL_ASSERT(stream); - if (lll->bis_spacing >= (lll->sub_interval * lll->nse)) { sync_iso_offset_us += (stream->bis_index - 1U) * lll->sub_interval * From 9320f55972b4860032622cc81eb2f4ebdac27005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1320/3334] Revert "[nrf fromtree] Bluetooth: Controller: fix assertion check for ptc value" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 39262b9a841a91e7f2a37022b2fba74ab3e4b56c. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/ll_sw/ull_sync_iso.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c index 65cd09f602fd..b3737c8fc4a0 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c @@ -489,22 +489,20 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso, lll->irc = PDU_BIG_INFO_IRC_GET(bi); if (lll->pto) { uint8_t nse; - uint8_t ptc; nse = lll->irc * lll->bn; /* 4 bits * 3 bits, total 7 bits */ if (nse >= lll->nse) { return; } - ptc = lll->nse - nse; + lll->ptc = lll->nse - nse; /* FIXME: Do not remember why ptc is 4 bits, it should be 5 bits as ptc is a * running buffer offset related to nse. * Fix ptc and ptc_curr definitions, until then we keep an assertion check * here. */ - LL_ASSERT(ptc <= BIT_MASK(4)); - lll->ptc = ptc; + LL_ASSERT(lll->ptc <= BIT_MASK(4)); } else { lll->ptc = 0U; } From bb8ca3e547c7a597a2a68cfca955ae07185b128f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1321/3334] Revert "[nrf fromtree] Bluetooth: Controller: Fix inter-operability when BT_PHY_UPDATE=n" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6cdc189affd8463e2fafe28fdd628baf9820b9f3. Signed-off-by: Tomasz Moń --- subsys/bluetooth/controller/include/ll_feat.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subsys/bluetooth/controller/include/ll_feat.h b/subsys/bluetooth/controller/include/ll_feat.h index 9e5cd3144b7a..946441720769 100644 --- a/subsys/bluetooth/controller/include/ll_feat.h +++ b/subsys/bluetooth/controller/include/ll_feat.h @@ -63,11 +63,11 @@ #define LL_FEAT_BIT_EXT_SCAN 0 #endif /* !CONFIG_BT_CTLR_EXT_SCAN_FP */ -#if defined(CONFIG_BT_CTLR_PHY) && defined(CONFIG_BT_CTLR_PHY_2M) +#if defined(CONFIG_BT_CTLR_PHY_2M) #define LL_FEAT_BIT_PHY_2M BIT64(BT_LE_FEAT_BIT_PHY_2M) -#else /* !CONFIG_BT_CTLR_PHY || !CONFIG_BT_CTLR_PHY_2M */ +#else /* !CONFIG_BT_CTLR_PHY_2M */ #define LL_FEAT_BIT_PHY_2M 0 -#endif /* !CONFIG_BT_CTLR_PHY || !CONFIG_BT_CTLR_PHY_2M */ +#endif /* !CONFIG_BT_CTLR_PHY_2M */ #if defined(CONFIG_BT_CTLR_SMI_TX) #if defined(CONFIG_BT_CTLR_SMI_TX_SETTING) @@ -86,11 +86,11 @@ #define LL_FEAT_BIT_SMI_RX 0 #endif /* !CONFIG_BT_CTLR_SMI_RX */ -#if defined(CONFIG_BT_CTLR_PHY) && defined(CONFIG_BT_CTLR_PHY_CODED) +#if defined(CONFIG_BT_CTLR_PHY_CODED) #define LL_FEAT_BIT_PHY_CODED BIT64(BT_LE_FEAT_BIT_PHY_CODED) -#else /* !CONFIG_BT_CTLR_PHY || !CONFIG_BT_CTLR_PHY_CODED */ +#else /* !CONFIG_BT_CTLR_PHY_CODED */ #define LL_FEAT_BIT_PHY_CODED 0 -#endif /* !CONFIG_BT_CTLR_PHY || !CONFIG_BT_CTLR_PHY_CODED */ +#endif /* !CONFIG_BT_CTLR_PHY_CODED */ #if defined(CONFIG_BT_CTLR_ADV_EXT) #define LL_FEAT_BIT_EXT_ADV BIT64(BT_LE_FEAT_BIT_EXT_ADV) From 243cd57d464d13078e06c3e6ec8d3c590b20630a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1322/3334] Revert "[nrf fromtree] samples: usb: hid-keyboard: allow to set polling period at runtime" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5467b653132bf6eae9f7151249ff2e64e8ead4bf. Signed-off-by: Tomasz Moń --- samples/subsys/usb/hid-keyboard/sample.yaml | 2 -- samples/subsys/usb/hid-keyboard/src/main.c | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/samples/subsys/usb/hid-keyboard/sample.yaml b/samples/subsys/usb/hid-keyboard/sample.yaml index 2998f84807d2..f53ae514f97c 100644 --- a/samples/subsys/usb/hid-keyboard/sample.yaml +++ b/samples/subsys/usb/hid-keyboard/sample.yaml @@ -33,5 +33,3 @@ tests: sample.usbd.hid-keyboard.large-out-report: extra_args: - EXTRA_DTC_OVERLAY_FILE="large_out_report.overlay" - extra_configs: - - CONFIG_USBD_HID_SET_POLLING_PERIOD=y diff --git a/samples/subsys/usb/hid-keyboard/src/main.c b/samples/subsys/usb/hid-keyboard/src/main.c index 39ce8836ff6a..45580c95a845 100644 --- a/samples/subsys/usb/hid-keyboard/src/main.c +++ b/samples/subsys/usb/hid-keyboard/src/main.c @@ -206,18 +206,6 @@ int main(void) return ret; } - if (IS_ENABLED(CONFIG_USBD_HID_SET_POLLING_PERIOD)) { - ret = hid_device_set_in_polling(hid_dev, 1000); - if (ret) { - LOG_WRN("Failed to set IN report polling period, %d", ret); - } - - ret = hid_device_set_out_polling(hid_dev, 1000); - if (ret != 0 && ret != -ENOTSUP) { - LOG_WRN("Failed to set OUT report polling period, %d", ret); - } - } - sample_usbd = sample_usbd_init_device(msg_cb); if (sample_usbd == NULL) { LOG_ERR("Failed to initialize USB device"); From 9309ca5ab058c66bb4128e363611f82056f8c892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1323/3334] Revert "[nrf fromtree] usb: device_next: hid: allow to set polling period at runtime" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a21b9a01210e5b6991a0dba581d8ccbce0ba444f. Signed-off-by: Tomasz Moń --- include/zephyr/usb/class/usbd_hid.h | 32 ----------- subsys/usb/device_next/class/Kconfig.hid | 5 -- subsys/usb/device_next/class/usbd_hid.c | 54 ------------------- subsys/usb/device_next/class/usbd_hid_api.c | 22 -------- .../usb/device_next/class/usbd_hid_internal.h | 2 - 5 files changed, 115 deletions(-) diff --git a/include/zephyr/usb/class/usbd_hid.h b/include/zephyr/usb/class/usbd_hid.h index 79b52dd8fd9d..5539369d5b05 100644 --- a/include/zephyr/usb/class/usbd_hid.h +++ b/include/zephyr/usb/class/usbd_hid.h @@ -212,38 +212,6 @@ int hid_device_register(const struct device *dev, int hid_device_submit_report(const struct device *dev, const uint16_t size, const uint8_t *const report); -/** - * @brief Set input report polling period - * - * Similar to devicetree property in-polling-period-us, but it allows setting - * different polling periods at runtime. - * - * @kconfig_dep{CONFIG_USBD_HID_SET_POLLING_PERIOD} - * - * @param[in] dev Pointer to HID device - * @param[in] period_us Polling period in microseconds - * - * @return 0 on success, negative errno code on failure. - * @retval -ENOTSUP If API is not enabled. - */ -int hid_device_set_in_polling(const struct device *dev, const unsigned int period_us); - -/** - * @brief Set output report polling period - * - * Similar to devicetree property out-polling-period-us, but it allows setting - * different polling periods at runtime. - * - * @kconfig_dep{CONFIG_USBD_HID_SET_POLLING_PERIOD} - * - * @param[in] dev Pointer to HID device - * @param[in] period_us Polling period in microseconds - * - * @return 0 on success, negative errno code on failure. - * @retval -ENOTSUP If API is not enabled. - */ -int hid_device_set_out_polling(const struct device *dev, const unsigned int period_us); - /** * @} */ diff --git a/subsys/usb/device_next/class/Kconfig.hid b/subsys/usb/device_next/class/Kconfig.hid index a6f2980ec3ab..8e3133a1dde8 100644 --- a/subsys/usb/device_next/class/Kconfig.hid +++ b/subsys/usb/device_next/class/Kconfig.hid @@ -30,11 +30,6 @@ config USBD_HID_INIT_PRIORITY help HID device initialization priority -config USBD_HID_SET_POLLING_PERIOD - bool "Allow to set polling period at runtime" - help - Allow to set input or output report polling period at runtime. - module = USBD_HID module-str = usbd hid source "subsys/logging/Kconfig.template.log_config" diff --git a/subsys/usb/device_next/class/usbd_hid.c b/subsys/usb/device_next/class/usbd_hid.c index 2ea3a08db763..212b409e9570 100644 --- a/subsys/usb/device_next/class/usbd_hid.c +++ b/subsys/usb/device_next/class/usbd_hid.c @@ -632,56 +632,6 @@ static int hid_dev_submit_report(const struct device *dev, return 0; } -static inline int hid_dev_set_out_polling(const struct device *dev, - const unsigned int period_us) -{ - const struct hid_device_config *const dcfg = dev->config; - struct hid_device_data *const ddata = dev->data; - struct usbd_hid_descriptor *const desc = dcfg->desc; - - if (atomic_test_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED)) { - return -EBUSY; - } - - if (USBD_SUPPORTS_HIGH_SPEED) { - if (desc->hs_out_ep.bLength == 0) { - /* This device does not have output reports. */ - return -ENOTSUP; - } - - desc->hs_out_ep.bInterval = USB_HS_INT_EP_INTERVAL(period_us); - } - - if (desc->out_ep.bLength == 0) { - /* This device does not have output reports. */ - return -ENOTSUP; - } - - desc->out_ep.bInterval = USB_FS_INT_EP_INTERVAL(period_us); - - return 0; -} - -static inline int hid_dev_set_in_polling(const struct device *dev, - const unsigned int period_us) -{ - const struct hid_device_config *const dcfg = dev->config; - struct hid_device_data *const ddata = dev->data; - struct usbd_hid_descriptor *const desc = dcfg->desc; - - if (atomic_test_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED)) { - return -EBUSY; - } - - if (USBD_SUPPORTS_HIGH_SPEED) { - desc->hs_in_ep.bInterval = USB_HS_INT_EP_INTERVAL(period_us); - } - - desc->in_ep.bInterval = USB_FS_INT_EP_INTERVAL(period_us); - - return 0; -} - static int hid_dev_register(const struct device *dev, const uint8_t *const rdesc, const uint16_t rsize, const struct hid_device_ops *const ops) @@ -756,10 +706,6 @@ struct usbd_class_api usbd_hid_api = { static const struct hid_device_driver_api hid_device_api = { .submit_report = hid_dev_submit_report, .dev_register = hid_dev_register, -#if CONFIG_USBD_HID_SET_POLLING_PERIOD - .set_out_polling = hid_dev_set_out_polling, - .set_in_polling = hid_dev_set_in_polling, -#endif }; #include "usbd_hid_macros.h" diff --git a/subsys/usb/device_next/class/usbd_hid_api.c b/subsys/usb/device_next/class/usbd_hid_api.c index fd9f27a23ba9..f2efa4e3cb1e 100644 --- a/subsys/usb/device_next/class/usbd_hid_api.c +++ b/subsys/usb/device_next/class/usbd_hid_api.c @@ -34,28 +34,6 @@ int hid_device_register(const struct device *dev, return api->dev_register(dev, rdesc, rsize, ops); } -int hid_device_set_in_polling(const struct device *dev, const unsigned int period_us) -{ - const struct hid_device_driver_api *const api = dev->api; - - if (IS_ENABLED(CONFIG_USBD_HID_SET_POLLING_PERIOD)) { - return api->set_in_polling(dev, period_us); - } - - return -ENOTSUP; -} - -int hid_device_set_out_polling(const struct device *dev, const unsigned int period_us) -{ - const struct hid_device_driver_api *const api = dev->api; - - if (IS_ENABLED(CONFIG_USBD_HID_SET_POLLING_PERIOD)) { - return api->set_out_polling(dev, period_us); - } - - return -ENOTSUP; -} - /* Legacy HID API wrapper below */ struct legacy_wrapper { diff --git a/subsys/usb/device_next/class/usbd_hid_internal.h b/subsys/usb/device_next/class/usbd_hid_internal.h index dcb747486279..d049b0c22a35 100644 --- a/subsys/usb/device_next/class/usbd_hid_internal.h +++ b/subsys/usb/device_next/class/usbd_hid_internal.h @@ -20,6 +20,4 @@ struct hid_device_driver_api { int (*dev_register)(const struct device *dev, const uint8_t *const rdesc, const uint16_t rsize, const struct hid_device_ops *const ops); - int (*set_in_polling)(const struct device *dev, const unsigned int period_us); - int (*set_out_polling)(const struct device *dev, const unsigned int period_us); }; From 6c30cec8d7cf42d9b4f3f70db95b40ff80525b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1324/3334] Revert "[nrf fromtree] usb: device_next: fail on initialization if no HID device is registered" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 308c9ffc4e0045cddcb4240f2c0ef234d36e2247. Signed-off-by: Tomasz Moń --- subsys/usb/device_next/class/usbd_hid.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/subsys/usb/device_next/class/usbd_hid.c b/subsys/usb/device_next/class/usbd_hid.c index 212b409e9570..d978aea0d27c 100644 --- a/subsys/usb/device_next/class/usbd_hid.c +++ b/subsys/usb/device_next/class/usbd_hid.c @@ -57,7 +57,6 @@ struct usbd_hid_descriptor { }; enum { - HID_DEV_CLASS_INITIALIZED, HID_DEV_CLASS_ENABLED, }; @@ -504,14 +503,7 @@ static int usbd_hid_init(struct usbd_class_data *const c_data) const struct device *dev = usbd_class_get_private(c_data); const struct hid_device_config *dcfg = dev->config; struct usbd_hid_descriptor *const desc = dcfg->desc; - struct hid_device_data *const ddata = dev->data; - - if (ddata->ops == NULL || ddata->rdesc == NULL || !ddata->rsize) { - LOG_ERR("HID device does not seem to be registered"); - return -EINVAL; - } - atomic_set_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED); LOG_DBG("HID class %s init", c_data->name); if (dcfg->if_desc_data != NULL && desc->if0.iInterface == 0) { @@ -527,10 +519,6 @@ static int usbd_hid_init(struct usbd_class_data *const c_data) static void usbd_hid_shutdown(struct usbd_class_data *const c_data) { - const struct device *dev = usbd_class_get_private(c_data); - struct hid_device_data *const ddata = dev->data; - - atomic_clear_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED); LOG_DBG("HID class %s shutdown", c_data->name); } @@ -640,7 +628,7 @@ static int hid_dev_register(const struct device *dev, struct hid_device_data *const ddata = dev->data; struct usbd_hid_descriptor *const desc = dcfg->desc; - if (atomic_test_bit(&ddata->state, HID_DEV_CLASS_INITIALIZED)) { + if (atomic_test_bit(&ddata->state, HID_DEV_CLASS_ENABLED)) { return -EALREADY; } From a5cf9e60f9cbf8ffca1deefb76da7dea7a95c950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1325/3334] Revert "[nrf fromtree] drivers: udc_dwc2: Fix deactivate when hibernated" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0c47b6fcd991557ab2eb518d39b17622205de6c1. Signed-off-by: Tomasz Moń --- drivers/usb/udc/udc_dwc2.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index eb7368e1178f..d279c1ce0284 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -1730,19 +1730,7 @@ static int udc_dwc2_ep_deactivate(const struct device *dev, mem_addr_t dxepctl_reg; uint32_t dxepctl; - if (priv->hibernated) { - /* If usbd_disable() is called when core is hibernated, modify - * backup registers instead of real ones. - */ - if (USB_EP_DIR_IS_OUT(cfg->addr)) { - dxepctl_reg = (mem_addr_t)&priv->backup.doepctl[ep_idx]; - } else { - dxepctl_reg = (mem_addr_t)&priv->backup.diepctl[ep_idx]; - } - } else { - dxepctl_reg = dwc2_get_dxepctl_reg(dev, cfg->addr); - } - + dxepctl_reg = dwc2_get_dxepctl_reg(dev, cfg->addr); dxepctl = sys_read32(dxepctl_reg); if (dxepctl & USB_DWC2_DEPCTL_USBACTEP) { From 288ebd7b147361ec9bc48197ea8b3c3a02e006a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1326/3334] Revert "[nrf fromtree] udc_dwc2: fix off-by-one in TX FIFO unset check" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0910452508168f16fda2eb7790f79aae9a0cd4c3. Signed-off-by: Tomasz Moń --- drivers/usb/udc/udc_dwc2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index d279c1ce0284..f8b03c372147 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -1586,11 +1586,9 @@ static int dwc2_unset_dedicated_fifo(const struct device *dev, *diepctl &= ~USB_DWC2_DEPCTL_TXFNUM_MASK; if (priv->dynfifosizing) { - uint16_t higher_mask = ~BIT_MASK(ep_idx + 1); - - if (priv->txf_set & higher_mask) { - LOG_WRN("Some of the FIFOs higher than %u are set, %x", - ep_idx, priv->txf_set & higher_mask); + if (priv->txf_set & ~BIT_MASK(ep_idx)) { + LOG_WRN("Some of the FIFOs higher than %u are set, %lx", + ep_idx, priv->txf_set & ~BIT_MASK(ep_idx)); return 0; } From 418f0016d4f79eed749d359ac474134b5ef6825a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1327/3334] Revert "[nrf fromtree] drivers: udc_dwc2: Fix memory leak on subsequent bus resets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 626cee133d613a4357d6ae009d48c486476ec2fd. Signed-off-by: Tomasz Moń --- drivers/usb/udc/udc_dwc2.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index f8b03c372147..35fb78adecfa 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -434,11 +434,6 @@ static void dwc2_ensure_setup_ready(const struct device *dev) } else { struct udc_dwc2_data *const priv = udc_get_private(dev); - if (udc_ep_is_busy(udc_get_ep_cfg(dev, USB_CONTROL_EP_OUT))) { - /* There is already buffer queued */ - return; - } - /* Enable EP0 OUT only if there is no pending EP0 IN transfer * after which the stack has to enable EP0 OUT. */ From 65dab39227b8f7437de7a7e8ea16b79c765267fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1328/3334] Revert "[nrf fromtree] drivers: usb: udc: Fix VBUS ready timeout dependency in Kconfig.dwc2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4d5d9775263deec09af3435871885ccf17ea90db. Signed-off-by: Tomasz Moń --- drivers/usb/udc/Kconfig.dwc2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/udc/Kconfig.dwc2 b/drivers/usb/udc/Kconfig.dwc2 index ff3b169e66a5..16350ef568d4 100644 --- a/drivers/usb/udc/Kconfig.dwc2 +++ b/drivers/usb/udc/Kconfig.dwc2 @@ -49,7 +49,7 @@ config UDC_DWC2_THREAD_PRIORITY config UDC_DWC2_USBHS_VBUS_READY_TIMEOUT int "UDC DWC2 USBHS VBUS ready event timeout in ms" - depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX || SOC_SERIES_NRF92X + depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX default 0 help UDC DWC2 USBHS VBUS ready event timeout. If the VBUS is not ready From ccd16617f755162acc21024cfda550ac89515893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1329/3334] Revert "[nrf fromtree] drivers: udc: allow to use timeout Kconfig option on nRF54LM20A SoC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6c8fb4a4439e6162f4a5b5cf535e67d0e4eda1a6. Signed-off-by: Tomasz Moń --- drivers/usb/udc/Kconfig.dwc2 | 2 +- drivers/usb/udc/udc_dwc2_vendor_quirks.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/usb/udc/Kconfig.dwc2 b/drivers/usb/udc/Kconfig.dwc2 index 16350ef568d4..3764aa7a4e2c 100644 --- a/drivers/usb/udc/Kconfig.dwc2 +++ b/drivers/usb/udc/Kconfig.dwc2 @@ -49,7 +49,7 @@ config UDC_DWC2_THREAD_PRIORITY config UDC_DWC2_USBHS_VBUS_READY_TIMEOUT int "UDC DWC2 USBHS VBUS ready event timeout in ms" - depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX + depends on NRFS_HAS_VBUS_DETECTOR_SERVICE default 0 help UDC DWC2 USBHS VBUS ready event timeout. If the VBUS is not ready diff --git a/drivers/usb/udc/udc_dwc2_vendor_quirks.h b/drivers/usb/udc/udc_dwc2_vendor_quirks.h index cd25f0ec9d33..330ff8d113f1 100644 --- a/drivers/usb/udc/udc_dwc2_vendor_quirks.h +++ b/drivers/usb/udc/udc_dwc2_vendor_quirks.h @@ -381,10 +381,6 @@ static inline int usbhs_enable_core(const struct device *dev) k_timeout_t timeout = K_FOREVER; int err; - if (CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT) { - timeout = K_MSEC(CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT); - } - if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, K_NO_WAIT)) { LOG_WRN("VBUS is not ready, block udc_enable()"); if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, timeout)) { From 6952f8aa33a9255894bb17053ef850e4ba6c6cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1330/3334] Revert "[nrf fromtree] drivers: udc: cleanup depends in Kconfig.dwc2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d19d96ca8ba5f9be2a17d138c504017b8b28e3e1. Signed-off-by: Tomasz Moń --- drivers/usb/udc/Kconfig.dwc2 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/udc/Kconfig.dwc2 b/drivers/usb/udc/Kconfig.dwc2 index 3764aa7a4e2c..1bb0e99fedde 100644 --- a/drivers/usb/udc/Kconfig.dwc2 +++ b/drivers/usb/udc/Kconfig.dwc2 @@ -12,22 +12,23 @@ config UDC_DWC2 help DWC2 USB device controller driver. -if UDC_DWC2 - config UDC_DWC2_DMA bool "DWC2 USB DMA support" default y + depends on UDC_DWC2 help Enable Buffer DMA if DWC2 USB controller supports Internal DMA. config UDC_DWC2_HIBERNATION bool "DWC2 USB Hibernation support" default y + depends on UDC_DWC2 help Enable Hibernation if DWC2 USB controller supports hibernation. config UDC_DWC2_PTI bool "DWC2 USB Periodic Transfer Interrupt" + depends on UDC_DWC2 help Ignore frame number when scheduling isochronous endpoints. Use this when isochronous transfers should finish only after receiving token @@ -37,23 +38,24 @@ config UDC_DWC2_PTI config UDC_DWC2_STACK_SIZE int "UDC DWC2 driver internal thread stack size" + depends on UDC_DWC2 default 512 help DWC2 driver internal thread stack size. config UDC_DWC2_THREAD_PRIORITY int "UDC DWC2 driver thread priority" + depends on UDC_DWC2 default 8 help DWC2 driver thread priority. config UDC_DWC2_USBHS_VBUS_READY_TIMEOUT int "UDC DWC2 USBHS VBUS ready event timeout in ms" + depends on UDC_DWC2 depends on NRFS_HAS_VBUS_DETECTOR_SERVICE default 0 help UDC DWC2 USBHS VBUS ready event timeout. If the VBUS is not ready and the Nordic USBHS controller is used, the udc_enable() is blocked for this amount of time. Set it to zero to wait forever. - -endif # UDC_DWC2 From 78e9683dbe79a1fb24bf2defd587881b7c92e726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1331/3334] Revert "[nrf fromtree] soc: nordic: instantiate NRF_PLATFORM_LUMOS kconfig" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 90d9ce1ec26f0d819de7d7f5e90ed98496cd8a5b. Signed-off-by: Tomasz Moń --- .../bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig | 2 +- .../bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig | 2 +- .../bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig | 2 +- .../nrf54l15dk_nrf54l10_cpuapp_ns_defconfig | 2 +- .../nrf54l15dk_nrf54l15_cpuapp_ns_defconfig | 2 +- .../panb611evb_nrf54l15_cpuapp_ns_defconfig | 2 +- ...ytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig | 2 +- modules/hal_nordic/nrfx/CMakeLists.txt | 2 +- soc/nordic/Kconfig | 16 ---------------- soc/nordic/nrf54l/Kconfig | 7 ++++++- 10 files changed, 14 insertions(+), 25 deletions(-) diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig index e62b6fe90745..dea04c45f20c 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig @@ -34,4 +34,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig index e62b6fe90745..dea04c45f20c 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig @@ -34,4 +34,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig index e62b6fe90745..dea04c45f20c 100644 --- a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig @@ -34,4 +34,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig index a0a4a0c63ac6..d9f869918bfe 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l10_cpuapp_ns_defconfig @@ -32,4 +32,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig index a0a4a0c63ac6..d9f869918bfe 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_ns_defconfig @@ -32,4 +32,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuapp_ns_defconfig b/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuapp_ns_defconfig index e360981191e8..5f6e098f4528 100644 --- a/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuapp_ns_defconfig +++ b/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuapp_ns_defconfig @@ -33,4 +33,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig index 0df2316b4502..866a03cd8687 100644 --- a/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig +++ b/boards/raytac/an54l15q_db/raytac_an54l15q_db_nrf54l15_cpuapp_ns_defconfig @@ -34,4 +34,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n # from the non secure application directly. This needs to be set # otherwise nrfx will try to configure them, resulting in a bus # fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 40ef9d08fd86..e944f06c805b 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -190,7 +190,7 @@ if(CONFIG_SOC_NRF54L_CPUAPP_COMMON) zephyr_compile_definitions("NRF_CONFIG_CPU_FREQ_MHZ=${clock_frequency_mhz}") endif() -zephyr_compile_definitions_ifdef(CONFIG_NRF_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_DISABLE_FICR_TRIMCNF NRF_DISABLE_FICR_TRIMCNF) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE NRF_SKIP_GLITCHDETECTOR_DISABLE) zephyr_compile_definitions_ifndef(CONFIG_SOC_NRF54L_ANOMALY_56_WORKAROUND NRF54L_CONFIGURATION_56_ENABLE=0) diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 46efc8c2c744..d86e98e3dbc7 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -197,15 +197,6 @@ config NRF_SECURE_APPROTECT_USER_HANDLING endchoice -config NRF_SKIP_CLOCK_CONFIG - bool - prompt "Skip clock frequency configuration" if TRUSTED_EXECUTION_SECURE - depends on NRF_PLATFORM_LUMOS - default y if TRUSTED_EXECUTION_NONSECURE - help - With this option, the CPU clock frequency is not set during system initialization. - The CPU runs with the default, hardware-selected frequency. - config NRF_TRACE_PORT bool "nRF TPIU" depends on !SOC_SERIES_NRF51X @@ -221,11 +212,4 @@ config NRF_PLATFORM_HALTIUM this option. This allows to easily enable common functionality on SoCs based on the Haltium platform. -config NRF_PLATFORM_LUMOS - bool - help - SoC series based on the Nordic nRF Lumos platform such as nRF54Lx - series. This allows to easily enable common functionality on - SoCs based on the Lumos platform. - endif # SOC_FAMILY_NORDIC_NRF diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index b211d2417cd8..114c1dc6b5a6 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -8,7 +8,6 @@ config SOC_SERIES_NRF54LX select HAS_NRFX select HAS_NORDIC_DRIVERS select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE - select NRF_PLATFORM_LUMOS config SOC_NRF54L_CPUAPP_COMMON bool @@ -56,6 +55,12 @@ config SOC_NRF54LM20A_ENGA_CPUFLPR if SOC_SERIES_NRF54LX +config SOC_NRF54LX_SKIP_CLOCK_CONFIG + bool "Skip clock frequency configuration in system initialization" + help + With this option, the CPU clock frequency is not set during system initialization. + The CPU runs with the default, hardware-selected frequency. + config SOC_NRF54LX_DISABLE_FICR_TRIMCNF bool "Disable trimming of the device" default y if TRUSTED_EXECUTION_NONSECURE From 13ec60b0605d492512f0469a09c2245542bc1e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1332/3334] Revert "[nrf fromtree] scripts: runners: nrfutil: Add a new --dry-run parameter" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f846c3f63e74b85f834f15556c3c03d46da05045. Signed-off-by: Tomasz Moń --- scripts/west_commands/runners/nrf_common.py | 9 +++---- scripts/west_commands/runners/nrfutil.py | 28 +++++++-------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index 75ad66aed99f..e4c54732d59b 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -53,7 +53,7 @@ class NrfBinaryRunner(ZephyrBinaryRunner): def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, erase_mode=None, ext_erase_mode=None, reset=True, - tool_opt=None, force=False, recover=False, dry_run=False): + tool_opt=None, force=False, recover=False): super().__init__(cfg) self.hex_ = cfg.hex_file # The old --nrf-family options takes upper-case family names @@ -67,7 +67,6 @@ def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, self.reset = bool(reset) self.force = force self.recover = bool(recover) - self.dry_run = bool(dry_run) self.tool_opt = [] if tool_opt is not None: @@ -119,6 +118,7 @@ def do_add_parser(cls, parser): choices=['none', 'ranges', 'all'], help='Select the type of erase operation for the ' 'external non-volatile memory') + parser.set_defaults(reset=True) @classmethod @@ -139,10 +139,7 @@ def ensure_snr(self): self.dev_id = [d.lstrip("0") for d in dev_id] return if not dev_id or "*" in dev_id: - if not self.dry_run: - dev_id = self.get_board_snr(dev_id or "*") - else: - dev_id = "DEVICEID" # for a dry run + dev_id = self.get_board_snr(dev_id or "*") self.dev_id = dev_id.lstrip("0") @abc.abstractmethod diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index 9deb32e06a02..0490df29ca17 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -5,7 +5,6 @@ '''Runner for flashing with nrfutil.''' import json -import shlex import subprocess import sys from pathlib import Path @@ -19,12 +18,12 @@ class NrfUtilBinaryRunner(NrfBinaryRunner): def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, erase_mode=None, ext_erase_mode=None, reset=True, tool_opt=None, - force=False, recover=False, ext_mem_config_file=None, - dry_run=False): + force=False, recover=False, + ext_mem_config_file=None): super().__init__(cfg, family, softreset, pinreset, dev_id, erase, erase_mode, ext_erase_mode, reset, tool_opt, force, - recover, dry_run) + recover) self.ext_mem_config_file = ext_mem_config_file @@ -56,8 +55,7 @@ def do_create(cls, cfg, args): ext_erase_mode=args.ext_erase_mode, reset=args.reset, tool_opt=args.tool_opt, force=args.force, recover=args.recover, - ext_mem_config_file=args.ext_mem_config_file, - dry_run=args.dry_run) + ext_mem_config_file=args.ext_mem_config_file) @classmethod def do_add_parser(cls, parser): @@ -65,23 +63,15 @@ def do_add_parser(cls, parser): parser.add_argument('--ext-mem-config-file', required=False, dest='ext_mem_config_file', help='path to an JSON file with external memory configuration') - parser.add_argument('--dry-run', required=False, - action='store_true', - help='''Generate all the commands without actually - executing them''') - def _exec(self, args, force=False): + def _exec(self, args): jout_all = [] cmd = ['nrfutil', '--json', 'device'] + args + self._log_cmd(cmd) - escaped = ' '.join(shlex.quote(s) for s in cmd) - if _DRY_RUN or (self.dry_run): - self.logger.info(escaped) - if not force: - return {} - else: - self.logger.debug(escaped) + if _DRY_RUN: + return {} with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p: for line in iter(p.stdout.readline, b''): @@ -158,7 +148,7 @@ def _append_batch(self, op, json_file): cmd += ['--core', op['core']] if op.get('core') else [] cmd += ['--x-family', f'{self.family}'] cmd += ['--x-append-batch', f'{json_file}'] - self._exec(cmd, force=True) + self._exec(cmd) def _exec_batch(self): # Use x-append-batch to get the JSON from nrfutil itself From 11642673326ec07234f9652c24225037416640b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1333/3334] Revert "[nrf fromtree] scripts: runners: nrf: Generalize the use of --erase-mode for all ICs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3861d81770e4a09b2e36045fe4193300ad23961b. Signed-off-by: Tomasz Moń --- scripts/west_commands/runners/nrf_common.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index e4c54732d59b..afa4665d8f47 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -357,13 +357,10 @@ def program_hex(self): if not self.erase and regtool_generated_uicr: self.exec_op('erase', core=core, kind='uicr') else: - erase_mode = self._get_erase_mode(self.erase_mode) if self.erase: erase_arg = 'ERASE_ALL' - elif self.erase_mode: - erase_arg = erase_mode elif self.family == 'nrf54l': - erase_arg = 'ERASE_NONE' + erase_arg = self._get_erase_mode(self.erase_mode) or 'ERASE_NONE' else: erase_arg = 'ERASE_RANGES_TOUCHED_BY_FIRMWARE' @@ -482,6 +479,10 @@ def do_run(self, command, **kwargs): self.ensure_family() + if self.family != 'nrf54l' and self.erase_mode: + raise RuntimeError('Option --erase-mode can only be used with the ' + 'nRF54L family.') + self.ensure_output('hex') if IntelHex is None: raise RuntimeError('Python dependency intelhex was missing; ' From 62bbdae1104d89696072a34d4e76f73ec9d88666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:55 +0100 Subject: [PATCH 1334/3334] Revert "[nrf fromtree] scripts: ci: check_compliance: Add missing gen_uicr UNDEF's" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fad3004ea77f425161790de7a8563244c904fd4a. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 8e3dc7347bb8..7584fa801187 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1277,8 +1277,6 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", "GEN_UICR_SECONDARY", "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", - "GEN_UICR_SECONDARY_PROCESSOR_APPLICATION", - "GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE", "GEN_UICR_SECONDARY_PROCESSOR_VALUE", "GEN_UICR_SECONDARY_PROTECTEDMEM", "GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES", @@ -1292,14 +1290,10 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_SECONDARY_WDTSTART", "GEN_UICR_SECONDARY_WDTSTART_CRV", "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE", - "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0", - "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT1", "GEN_UICR_SECURESTORAGE", "GEN_UICR_WDTSTART", "GEN_UICR_WDTSTART_CRV", "GEN_UICR_WDTSTART_INSTANCE_CODE", - "GEN_UICR_WDTSTART_INSTANCE_WDT0", - "GEN_UICR_WDTSTART_INSTANCE_WDT1", "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "IAR_BUFFERED_WRITE", From 92d8d3c61b01ae3ed82dca4b4b5fdadad7b7b75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1335/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add safety flag for permanent device transition" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a623ac2a835279583ec59281ed7b78641008eba0. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 2 +- soc/nordic/common/uicr/gen_uicr.py | 24 ++---------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 7584fa801187..e0f67ce8ac62 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1271,7 +1271,7 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_APPROTECT_CORESIGHT_PROTECTED", "GEN_UICR_APPROTECT_RADIOCORE_PROTECTED", "GEN_UICR_ERASEPROTECT", - "GEN_UICR_GENERATE_PERIPHCONF", + "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_LOCK", "GEN_UICR_PROTECTEDMEM", "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 8dbbc7fe5ce9..036ee770e12c 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -432,14 +432,6 @@ def main() -> None: type=lambda s: int(s, 0), help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", ) - parser.add_argument( - "--permit-permanently-transitioning-device-to-deployed", - action="store_true", - help=( - "Safety flag required to enable both UICR.LOCK and UICR.ERASEPROTECT together. " - "Must be explicitly provided to acknowledge permanent device state changes." - ), - ) parser.add_argument( "--lock", action="store_true", @@ -632,22 +624,10 @@ def main() -> None: uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 - # Handle LOCK and ERASEPROTECT configuration - # Check if both are enabled together - this requires explicit acknowledgment - if ( - args.lock - and args.eraseprotect - and not args.permit_permanently_transitioning_device_to_deployed - ): - raise ScriptError( - "Enabling both --lock and --eraseprotect requires " - "--permit-permanently-transitioning-device-to-deployed to be specified. " - "This combination permanently locks the device configuration and prevents " - "ERASEALL." - ) - + # Handle LOCK configuration if args.lock: uicr.LOCK = ENABLED_VALUE + # Handle ERASEPROTECT configuration if args.eraseprotect: uicr.ERASEPROTECT = ENABLED_VALUE # Handle APPROTECT configuration From ad178a6bd0eb39360edea95324b3544b0c8ecf51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1336/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for UICR.APPROTECT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d063f0bf70a4b5f12c1a7aa7d478be2b7b6afc9e. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 3 --- soc/nordic/common/uicr/gen_uicr.py | 26 ------------------- .../common/uicr/gen_uicr/CMakeLists.txt | 15 ----------- soc/nordic/common/uicr/gen_uicr/Kconfig | 24 ----------------- 4 files changed, 68 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index e0f67ce8ac62..73734026c7b6 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1267,9 +1267,6 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_LOG_LEVEL", "FOO_SETTING_1", "FOO_SETTING_2", - "GEN_UICR_APPROTECT_APPLICATION_PROTECTED", - "GEN_UICR_APPROTECT_CORESIGHT_PROTECTED", - "GEN_UICR_APPROTECT_RADIOCORE_PROTECTED", "GEN_UICR_ERASEPROTECT", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_LOCK", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 036ee770e12c..390d96042528 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -25,8 +25,6 @@ # Common values for representing enabled/disabled in the UICR format. ENABLED_VALUE = 0xFFFF_FFFF DISABLED_VALUE = 0xBD23_28A8 -PROTECTED_VALUE = ENABLED_VALUE # UICR_PROTECTED = UICR_ENABLED per uicr_defs.h -UNPROTECTED_VALUE = DISABLED_VALUE # Unprotected uses the default erased value KB_4 = 4096 @@ -442,21 +440,6 @@ def main() -> None: action="store_true", help="Enable UICR.ERASEPROTECT to block ERASEALL operations", ) - parser.add_argument( - "--approtect-application-protected", - action="store_true", - help="Protect application domain access port (disable debug access)", - ) - parser.add_argument( - "--approtect-radiocore-protected", - action="store_true", - help="Protect radio core access port (disable debug access)", - ) - parser.add_argument( - "--approtect-coresight-protected", - action="store_true", - help="Protect CoreSight access port (disable debug access)", - ) parser.add_argument( "--protectedmem", action="store_true", @@ -630,15 +613,6 @@ def main() -> None: # Handle ERASEPROTECT configuration if args.eraseprotect: uicr.ERASEPROTECT = ENABLED_VALUE - # Handle APPROTECT configuration - if args.approtect_application_protected: - uicr.APPROTECT.APPLICATION = PROTECTED_VALUE - - if args.approtect_radiocore_protected: - uicr.APPROTECT.RADIOCORE = PROTECTED_VALUE - - if args.approtect_coresight_protected: - uicr.APPROTECT.CORESIGHT = PROTECTED_VALUE # Handle protected memory configuration if args.protectedmem: if args.protectedmem_size_bytes % KB_4 != 0: diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 290cf16a0a6f..0802d4f2f870 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -77,7 +77,6 @@ endif() set(lock_args) set(eraseprotect_args) -set(approtect_args) set(protectedmem_args) set(periphconf_args) set(wdtstart_args) @@ -128,19 +127,6 @@ if(CONFIG_GEN_UICR_ERASEPROTECT) list(APPEND eraseprotect_args --eraseprotect) endif() -# Handle APPROTECT configuration -if(CONFIG_GEN_UICR_APPROTECT_APPLICATION_PROTECTED) - list(APPEND approtect_args --approtect-application-protected) -endif() - -if(CONFIG_GEN_UICR_APPROTECT_RADIOCORE_PROTECTED) - list(APPEND approtect_args --approtect-radiocore-protected) -endif() - -if(CONFIG_GEN_UICR_APPROTECT_CORESIGHT_PROTECTED) - list(APPEND approtect_args --approtect-coresight-protected) -endif() - # Handle protected memory configuration if(CONFIG_GEN_UICR_PROTECTEDMEM) list(APPEND protectedmem_args --protectedmem) @@ -271,7 +257,6 @@ add_custom_command( --out-uicr-hex ${uicr_hex_file} ${lock_args} ${eraseprotect_args} - ${approtect_args} ${wdtstart_args} ${periphconf_args} ${securestorage_args} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 7f25cc839dd6..39f304eb47cd 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -55,30 +55,6 @@ config GEN_UICR_ERASEPROTECT Note that gen_uicr.py can be used directly to create a configuration with both enabled if needed. -menu "UICR.APPROTECT - Access Port Protection" - -config GEN_UICR_APPROTECT_APPLICATION_PROTECTED - bool "Protect application domain access port" - help - When enabled, disables debug access to the application domain processor, - preventing debugger connection to application memory, registers, and debug - features. When disabled, full debug access is enabled. - -config GEN_UICR_APPROTECT_RADIOCORE_PROTECTED - bool "Protect radio core access port" - help - When enabled, disables debug access to the radio core processor, - preventing debugger connection to radio core memory, registers, and debug - features. When disabled, full debug access is enabled. - -config GEN_UICR_APPROTECT_CORESIGHT_PROTECTED - bool "Disable CoreSight subsystem" - help - When enabled will disable the coresight subsystem, preventing - system level trace features. - -endmenu - config GEN_UICR_PROTECTEDMEM bool "Enable UICR.PROTECTEDMEM" help From c0f2512d1c80cc975f9478e12e0ad9f258923e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1337/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for UICR.ERASEPROTECT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 868f02b0965929999bd9209eb44d3b238d29d550. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 1 - soc/nordic/common/uicr/gen_uicr.py | 8 -------- soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 7 ------- soc/nordic/common/uicr/gen_uicr/Kconfig | 12 ------------ 4 files changed, 28 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 73734026c7b6..96fda75b3b3c 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1267,7 +1267,6 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_LOG_LEVEL", "FOO_SETTING_1", "FOO_SETTING_2", - "GEN_UICR_ERASEPROTECT", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_LOCK", "GEN_UICR_PROTECTEDMEM", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 390d96042528..103dec53e82b 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -435,11 +435,6 @@ def main() -> None: action="store_true", help="Enable UICR.LOCK to prevent modifications without ERASEALL", ) - parser.add_argument( - "--eraseprotect", - action="store_true", - help="Enable UICR.ERASEPROTECT to block ERASEALL operations", - ) parser.add_argument( "--protectedmem", action="store_true", @@ -610,9 +605,6 @@ def main() -> None: # Handle LOCK configuration if args.lock: uicr.LOCK = ENABLED_VALUE - # Handle ERASEPROTECT configuration - if args.eraseprotect: - uicr.ERASEPROTECT = ENABLED_VALUE # Handle protected memory configuration if args.protectedmem: if args.protectedmem_size_bytes % KB_4 != 0: diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 0802d4f2f870..8df980b0743b 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -76,7 +76,6 @@ if(CMAKE_VERBOSE_MAKEFILE) endif() set(lock_args) -set(eraseprotect_args) set(protectedmem_args) set(periphconf_args) set(wdtstart_args) @@ -122,11 +121,6 @@ if(CONFIG_GEN_UICR_LOCK) list(APPEND lock_args --lock) endif() -# Handle ERASEPROTECT configuration -if(CONFIG_GEN_UICR_ERASEPROTECT) - list(APPEND eraseprotect_args --eraseprotect) -endif() - # Handle protected memory configuration if(CONFIG_GEN_UICR_PROTECTEDMEM) list(APPEND protectedmem_args --protectedmem) @@ -256,7 +250,6 @@ add_custom_command( --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} ${lock_args} - ${eraseprotect_args} ${wdtstart_args} ${periphconf_args} ${securestorage_args} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 39f304eb47cd..ef78927c8619 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -43,18 +43,6 @@ config GEN_UICR_LOCK This should be enabled only in production devices to prevent unauthorized modification. -config GEN_UICR_ERASEPROTECT - bool "Enable UICR.ERASEPROTECT" - depends on ! GEN_UICR_LOCK - help - When enabled, ERASEALL operations are blocked. - - This option is mutually exclusive with UICR.LOCK in Kconfig to prevent - accidental configuration where both are enabled simultaneously. If both - were enabled, the UICR would become impossible to modify in any way. - Note that gen_uicr.py can be used directly to create a configuration - with both enabled if needed. - config GEN_UICR_PROTECTEDMEM bool "Enable UICR.PROTECTEDMEM" help From a11c155988b2edca866280ffa31d5981a1424882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1338/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for UICR.LOCK" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3ec66739f3f33993b8094b53112438b0a897275c. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 1 - soc/nordic/common/uicr/gen_uicr.py | 8 -------- soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 7 ------- soc/nordic/common/uicr/gen_uicr/Kconfig | 11 ----------- 4 files changed, 27 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 96fda75b3b3c..f7d444a55565 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1268,7 +1268,6 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_SETTING_1", "FOO_SETTING_2", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_LOCK", "GEN_UICR_PROTECTEDMEM", "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", "GEN_UICR_SECONDARY", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 103dec53e82b..0b47be4c5a4d 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -430,11 +430,6 @@ def main() -> None: type=lambda s: int(s, 0), help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", ) - parser.add_argument( - "--lock", - action="store_true", - help="Enable UICR.LOCK to prevent modifications without ERASEALL", - ) parser.add_argument( "--protectedmem", action="store_true", @@ -602,9 +597,6 @@ def main() -> None: uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 - # Handle LOCK configuration - if args.lock: - uicr.LOCK = ENABLED_VALUE # Handle protected memory configuration if args.protectedmem: if args.protectedmem_size_bytes % KB_4 != 0: diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 8df980b0743b..41ccdf454a33 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -75,7 +75,6 @@ endfunction() if(CMAKE_VERBOSE_MAKEFILE) endif() -set(lock_args) set(protectedmem_args) set(periphconf_args) set(wdtstart_args) @@ -116,11 +115,6 @@ if(CONFIG_GEN_UICR_SECURESTORAGE) list(APPEND securestorage_args --cpurad-its-size ${CPURAD_ITS_SIZE}) endif(CONFIG_GEN_UICR_SECURESTORAGE) -# Handle LOCK configuration -if(CONFIG_GEN_UICR_LOCK) - list(APPEND lock_args --lock) -endif() - # Handle protected memory configuration if(CONFIG_GEN_UICR_PROTECTEDMEM) list(APPEND protectedmem_args --protectedmem) @@ -249,7 +243,6 @@ add_custom_command( --uicr-address ${UICR_ADDRESS} --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} - ${lock_args} ${wdtstart_args} ${periphconf_args} ${securestorage_args} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index ef78927c8619..df5616dc0442 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -32,17 +32,6 @@ config GEN_UICR_SECURESTORAGE - At least one subpartition must be defined - Combined subpartition sizes must equal secure_storage_partition size -config GEN_UICR_LOCK - bool "Enable UICR.LOCK" - help - When enabled, locks the entire contents of the NVR0 page located in - MRAM10. This includes all values in both the UICR and the BICR (Board - Information Configuration Registers). Once locked, the UICR can only - be modified by performing an ERASEALL operation. - - This should be enabled only in production devices to prevent - unauthorized modification. - config GEN_UICR_PROTECTEDMEM bool "Enable UICR.PROTECTEDMEM" help From 5a45753f511d3457b6c320af511b8eb0ba74b903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1339/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for UICR.SECONDARY.PROTECTEDMEM" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 914c52e08ada7bdf825ee487f5de04d67ec5a6f8. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 2 -- soc/nordic/common/uicr/gen_uicr.py | 15 --------------- soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 5 ----- soc/nordic/common/uicr/gen_uicr/Kconfig | 16 +--------------- 4 files changed, 1 insertion(+), 37 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index f7d444a55565..35778c02e1f0 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1273,8 +1273,6 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_SECONDARY", "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", "GEN_UICR_SECONDARY_PROCESSOR_VALUE", - "GEN_UICR_SECONDARY_PROTECTEDMEM", - "GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES", "GEN_UICR_SECONDARY_TRIGGER", "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP", "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 0b47be4c5a4d..36f4dc1d44c0 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -501,12 +501,6 @@ def main() -> None: "(decimal or 0x-prefixed hex)" ), ) - parser.add_argument( - "--secondary-protectedmem-size", - default=None, - type=lambda s: int(s, 0), - help="Size in bytes of the secondary protected memory region (decimal or 0x-prefixed hex)", - ) parser.add_argument( "--secondary-periphconf-address", default=None, @@ -653,15 +647,6 @@ def main() -> None: uicr.SECONDARY.TRIGGER.ENABLE = ENABLED_VALUE uicr.SECONDARY.TRIGGER.RESETREAS = args.secondary_trigger_resetreas - # Handle secondary PROTECTEDMEM configuration - if args.secondary_protectedmem_size: - uicr.SECONDARY.PROTECTEDMEM.ENABLE = ENABLED_VALUE - if args.secondary_protectedmem_size % 4096 != 0: - raise ScriptError( - f"args.secondary_protectedmem_size was {args.secondary_protectedmem_size}, " - f"but must be divisible by 4096" - ) - uicr.SECONDARY.PROTECTEDMEM.SIZE4KB = args.secondary_protectedmem_size // 4096 # Handle secondary periphconf if provided if args.out_secondary_periphconf_hex: secondary_periphconf_combined = extract_and_combine_periphconfs( diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 41ccdf454a33..d5a71e0562f4 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -216,11 +216,6 @@ if(CONFIG_GEN_UICR_SECONDARY) list(APPEND secondary_args --secondary-trigger-resetreas ${resetreas_value}) endif() - # Handle secondary PROTECTEDMEM configuration - if(CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM) - list(APPEND secondary_args --secondary-protectedmem-size ${CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES}) - endif() - if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) # Compute SECONDARY_PERIPHCONF absolute address and size from this image's devicetree compute_partition_address_and_size("secondary_periphconf_partition" SECONDARY_PERIPHCONF_ADDRESS SECONDARY_PERIPHCONF_SIZE) diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index df5616dc0442..6d213a95887d 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -207,22 +207,8 @@ config GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP help Boot secondary firmware when Radio core CPU lockup causes a reset. -endif # GEN_UICR_SECONDARY_TRIGGER - -config GEN_UICR_SECONDARY_PROTECTEDMEM - bool "Enable UICR.SECONDARY.PROTECTEDMEM" - depends on GEN_UICR_SECONDARY - help - When enabled, the UICR generator will configure the - protected memory region for the secondary firmware. -config GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES - int "Secondary protected memory size in bytes" - default 4096 - depends on GEN_UICR_SECONDARY_PROTECTEDMEM - help - Size of the secondary protected memory region in bytes. - This value must be divisible by 4096 (4 kiB). +endif # GEN_UICR_SECONDARY_TRIGGER endif # GEN_UICR_SECONDARY From ed0b4ed3f429b3cb9025904ac7a6b2fce19c091c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1340/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for UICR.SECONDARY.TRIGGER" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b607d4377d06fac29f1b63e445c57a238e32fc02. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 7 ---- soc/nordic/common/uicr/gen_uicr.py | 19 --------- .../common/uicr/gen_uicr/CMakeLists.txt | 28 ------------- soc/nordic/common/uicr/gen_uicr/Kconfig | 42 ------------------- 4 files changed, 96 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 35778c02e1f0..01d002e227a8 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1273,13 +1273,6 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_SECONDARY", "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", "GEN_UICR_SECONDARY_PROCESSOR_VALUE", - "GEN_UICR_SECONDARY_TRIGGER", - "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP", - "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0", - "GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1", - "GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP", - "GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0", - "GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1", "GEN_UICR_SECONDARY_WDTSTART", "GEN_UICR_SECONDARY_WDTSTART_CRV", "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index 36f4dc1d44c0..da2938bf05c9 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -487,20 +487,6 @@ def main() -> None: type=lambda s: int(s, 0), help="Processor to boot for the secondary firmware ", ) - parser.add_argument( - "--secondary-trigger", - action="store_true", - help="Enable UICR.SECONDARY.TRIGGER for automatic secondary firmware boot on reset events", - ) - parser.add_argument( - "--secondary-trigger-resetreas", - default=0, - type=lambda s: int(s, 0), - help=( - "Bitmask of reset reasons that trigger secondary firmware boot " - "(decimal or 0x-prefixed hex)" - ), - ) parser.add_argument( "--secondary-periphconf-address", default=None, @@ -642,11 +628,6 @@ def main() -> None: uicr.SECONDARY.ADDRESS = args.secondary_address uicr.SECONDARY.PROCESSOR = args.secondary_processor - # Handle secondary TRIGGER configuration - if args.secondary_trigger: - uicr.SECONDARY.TRIGGER.ENABLE = ENABLED_VALUE - uicr.SECONDARY.TRIGGER.RESETREAS = args.secondary_trigger_resetreas - # Handle secondary periphconf if provided if args.out_secondary_periphconf_hex: secondary_periphconf_combined = extract_and_combine_periphconfs( diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index d5a71e0562f4..39737888023a 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -188,34 +188,6 @@ if(CONFIG_GEN_UICR_SECONDARY) list(APPEND secondary_args --secondary-wdtstart-crv ${CONFIG_GEN_UICR_SECONDARY_WDTSTART_CRV}) endif() - # Handle secondary TRIGGER configuration - if(CONFIG_GEN_UICR_SECONDARY_TRIGGER) - list(APPEND secondary_args --secondary-trigger) - - # Compute RESETREAS bitmask from individual trigger configs - set(resetreas_value 0) - if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0) - math(EXPR resetreas_value "${resetreas_value} + 0x001") - endif() - if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1) - math(EXPR resetreas_value "${resetreas_value} + 0x002") - endif() - if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP) - math(EXPR resetreas_value "${resetreas_value} + 0x008") - endif() - if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0) - math(EXPR resetreas_value "${resetreas_value} + 0x020") - endif() - if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1) - math(EXPR resetreas_value "${resetreas_value} + 0x040") - endif() - if(CONFIG_GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP) - math(EXPR resetreas_value "${resetreas_value} + 0x100") - endif() - - list(APPEND secondary_args --secondary-trigger-resetreas ${resetreas_value}) - endif() - if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) # Compute SECONDARY_PERIPHCONF absolute address and size from this image's devicetree compute_partition_address_and_size("secondary_periphconf_partition" SECONDARY_PERIPHCONF_ADDRESS SECONDARY_PERIPHCONF_SIZE) diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 6d213a95887d..74e24cafbee4 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -168,48 +168,6 @@ config GEN_UICR_SECONDARY_PROCESSOR_VALUE default 0xBD2328A8 if GEN_UICR_SECONDARY_PROCESSOR_APPLICATION default 0x1730C77F if GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE -config GEN_UICR_SECONDARY_TRIGGER - bool "Enable UICR.SECONDARY.TRIGGER" - help - When enabled, configures automatic triggers that cause IronSide SE - to boot the secondary firmware instead of the primary firmware based - on specific reset reasons. - -if GEN_UICR_SECONDARY_TRIGGER - -config GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT0 - bool "Trigger on Application domain watchdog 0 reset" - help - Boot secondary firmware when Application domain watchdog 0 causes a reset. - -config GEN_UICR_SECONDARY_TRIGGER_APPLICATIONWDT1 - bool "Trigger on Application domain watchdog 1 reset" - help - Boot secondary firmware when Application domain watchdog 1 causes a reset. - -config GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP - bool "Trigger on Application domain CPU lockup reset" - help - Boot secondary firmware when Application domain CPU lockup causes a reset. - -config GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT0 - bool "Trigger on Radio core watchdog 0 reset" - help - Boot secondary firmware when Radio core watchdog 0 causes a reset. - -config GEN_UICR_SECONDARY_TRIGGER_RADIOCOREWDT1 - bool "Trigger on Radio core watchdog 1 reset" - help - Boot secondary firmware when Radio core watchdog 1 causes a reset. - -config GEN_UICR_SECONDARY_TRIGGER_RADIOCORELOCKUP - bool "Trigger on Radio core CPU lockup reset" - help - Boot secondary firmware when Radio core CPU lockup causes a reset. - - -endif # GEN_UICR_SECONDARY_TRIGGER - endif # GEN_UICR_SECONDARY endmenu From 2780b7fbfb1bfdbddec948592fe4369823df65ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1341/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for UICR.WDTSTART" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6333fa8efd71718fed5a340d3c6c1eae0f0aee8a. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 18 ++-- soc/nordic/common/uicr/gen_uicr.py | 42 --------- .../common/uicr/gen_uicr/CMakeLists.txt | 16 ---- soc/nordic/common/uicr/gen_uicr/Kconfig | 87 ------------------- 4 files changed, 6 insertions(+), 157 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 01d002e227a8..eea833ce0849 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1268,18 +1268,12 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_SETTING_1", "FOO_SETTING_2", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_PROTECTEDMEM", - "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", - "GEN_UICR_SECONDARY", - "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", - "GEN_UICR_SECONDARY_PROCESSOR_VALUE", - "GEN_UICR_SECONDARY_WDTSTART", - "GEN_UICR_SECONDARY_WDTSTART_CRV", - "GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE", - "GEN_UICR_SECURESTORAGE", - "GEN_UICR_WDTSTART", - "GEN_UICR_WDTSTART_CRV", - "GEN_UICR_WDTSTART_INSTANCE_CODE", + "GEN_UICR_PROTECTEDMEM", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_SECONDARY", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_SECONDARY_PROCESSOR_VALUE", # Used in specialized build tool, not part of main Kconfig + "GEN_UICR_SECURESTORAGE", # Used in specialized build tool, not part of main Kconfig "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "IAR_BUFFERED_WRITE", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index da2938bf05c9..bea0ba2a2dfa 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -440,36 +440,6 @@ def main() -> None: type=int, help="Protected memory size in bytes (must be divisible by 4096)", ) - parser.add_argument( - "--wdtstart", - action="store_true", - help="Enable watchdog timer start in UICR", - ) - parser.add_argument( - "--wdtstart-instance-code", - type=lambda s: int(s, 0), - help="Watchdog timer instance code (0xBD2328A8 for WDT0, 0x1730C77F for WDT1)", - ) - parser.add_argument( - "--wdtstart-crv", - type=int, - help="Initial Counter Reload Value (CRV) for watchdog timer (minimum: 0xF)", - ) - parser.add_argument( - "--secondary-wdtstart", - action="store_true", - help="Enable watchdog timer start in UICR.SECONDARY", - ) - parser.add_argument( - "--secondary-wdtstart-instance-code", - type=lambda s: int(s, 0), - help="Secondary watchdog timer instance code (0xBD2328A8 for WDT0, 0x1730C77F for WDT1)", - ) - parser.add_argument( - "--secondary-wdtstart-crv", - type=int, - help="Secondary initial Counter Reload Value (CRV) for watchdog timer (minimum: 0xF)", - ) parser.add_argument( "--secondary", action="store_true", @@ -587,12 +557,6 @@ def main() -> None: uicr.PROTECTEDMEM.ENABLE = ENABLED_VALUE uicr.PROTECTEDMEM.SIZE4KB = args.protectedmem_size_bytes // KB_4 - # Handle WDTSTART configuration - if args.wdtstart: - uicr.WDTSTART.ENABLE = ENABLED_VALUE - uicr.WDTSTART.CRV = args.wdtstart_crv - uicr.WDTSTART.INSTANCE = args.wdtstart_instance_code - # Process periphconf data first and configure UICR completely before creating hex objects periphconf_hex = IntelHex() secondary_periphconf_hex = IntelHex() @@ -661,12 +625,6 @@ def main() -> None: uicr.SECONDARY.PERIPHCONF.MAXCOUNT = args.secondary_periphconf_size // 8 - # Handle secondary WDTSTART configuration - if args.secondary_wdtstart: - uicr.SECONDARY.WDTSTART.ENABLE = ENABLED_VALUE - uicr.SECONDARY.WDTSTART.CRV = args.secondary_wdtstart_crv - uicr.SECONDARY.WDTSTART.INSTANCE = args.secondary_wdtstart_instance_code - # Create UICR hex object with final UICR data uicr_hex = IntelHex() uicr_hex.frombytes(bytes(uicr), offset=args.uicr_address) diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 39737888023a..b64b7c0399ac 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -77,7 +77,6 @@ endif() set(protectedmem_args) set(periphconf_args) -set(wdtstart_args) set(periphconf_elfs) set(merged_hex_file ${APPLICATION_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.hex) set(secondary_periphconf_elfs) @@ -121,13 +120,6 @@ if(CONFIG_GEN_UICR_PROTECTEDMEM) list(APPEND protectedmem_args --protectedmem-size-bytes ${CONFIG_GEN_UICR_PROTECTEDMEM_SIZE_BYTES}) endif() -# Handle WDTSTART configuration -if(CONFIG_GEN_UICR_WDTSTART) - list(APPEND wdtstart_args --wdtstart) - list(APPEND wdtstart_args --wdtstart-instance-code ${CONFIG_GEN_UICR_WDTSTART_INSTANCE_CODE}) - list(APPEND wdtstart_args --wdtstart-crv ${CONFIG_GEN_UICR_WDTSTART_CRV}) -endif() - if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) # gen_uicr.py parses all zephyr.elf files. To find these files (which # have not been built yet) we scan sibling build directories for @@ -181,13 +173,6 @@ if(CONFIG_GEN_UICR_SECONDARY) --secondary-processor ${CONFIG_GEN_UICR_SECONDARY_PROCESSOR_VALUE} ) - # Handle secondary WDTSTART configuration - if(CONFIG_GEN_UICR_SECONDARY_WDTSTART) - list(APPEND secondary_args --secondary-wdtstart) - list(APPEND secondary_args --secondary-wdtstart-instance-code ${CONFIG_GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE}) - list(APPEND secondary_args --secondary-wdtstart-crv ${CONFIG_GEN_UICR_SECONDARY_WDTSTART_CRV}) - endif() - if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) # Compute SECONDARY_PERIPHCONF absolute address and size from this image's devicetree compute_partition_address_and_size("secondary_periphconf_partition" SECONDARY_PERIPHCONF_ADDRESS SECONDARY_PERIPHCONF_SIZE) @@ -210,7 +195,6 @@ add_custom_command( --uicr-address ${UICR_ADDRESS} --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} - ${wdtstart_args} ${periphconf_args} ${securestorage_args} ${protectedmem_args} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 74e24cafbee4..fe7413a9d0da 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -46,93 +46,6 @@ config GEN_UICR_PROTECTEDMEM_SIZE_BYTES Size of the protected memory region in bytes. This value must be divisible by 4096 (4 kiB). -config GEN_UICR_WDTSTART - bool "Enable UICR.WDTSTART" - help - When enabled, the UICR generator will configure an application - domain watchdog timer to start automatically before the - application core is booted. - -choice GEN_UICR_WDTSTART_INSTANCE - prompt "Watchdog timer instance" - depends on GEN_UICR_WDTSTART - default GEN_UICR_WDTSTART_INSTANCE_WDT0 - help - Select which watchdog timer instance to use. - -config GEN_UICR_WDTSTART_INSTANCE_WDT0 - bool "WDT0" - help - Use watchdog timer instance 0. - -config GEN_UICR_WDTSTART_INSTANCE_WDT1 - bool "WDT1" - help - Use watchdog timer instance 1. - -endchoice - -config GEN_UICR_WDTSTART_INSTANCE_CODE - hex - default 0xBD2328A8 if GEN_UICR_WDTSTART_INSTANCE_WDT0 - default 0x1730C77F if GEN_UICR_WDTSTART_INSTANCE_WDT1 - depends on GEN_UICR_WDTSTART - -config GEN_UICR_WDTSTART_CRV - int "Initial Counter Reload Value (CRV)" - default 65535 - range 15 4294967295 - depends on GEN_UICR_WDTSTART - help - Initial Counter Reload Value (CRV) for the watchdog timer. - This value determines the watchdog timeout period. - Must be at least 15 (0xF) to ensure proper watchdog operation. - Default value 65535 creates a 2-second timeout. - -config GEN_UICR_SECONDARY_WDTSTART - bool "Enable UICR.SECONDARY.WDTSTART" - depends on GEN_UICR_SECONDARY - help - When enabled, the UICR generator will configure the - watchdog timer to start automatically before the - secondary firmware is booted. - -choice GEN_UICR_SECONDARY_WDTSTART_INSTANCE - prompt "Secondary watchdog timer instance" - depends on GEN_UICR_SECONDARY_WDTSTART - default GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0 - help - Select which watchdog timer instance to use for secondary firmware. - -config GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0 - bool "WDT0" - help - Use watchdog timer instance 0 for secondary firmware. - -config GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT1 - bool "WDT1" - help - Use watchdog timer instance 1 for secondary firmware. - -endchoice - -config GEN_UICR_SECONDARY_WDTSTART_INSTANCE_CODE - hex - default 0xBD2328A8 if GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT0 - default 0x1730C77F if GEN_UICR_SECONDARY_WDTSTART_INSTANCE_WDT1 - depends on GEN_UICR_SECONDARY_WDTSTART - -config GEN_UICR_SECONDARY_WDTSTART_CRV - int "Secondary initial Counter Reload Value (CRV)" - default 65535 - range 15 4294967295 - depends on GEN_UICR_SECONDARY_WDTSTART - help - Initial Counter Reload Value (CRV) for the secondary watchdog timer. - This value determines the watchdog timeout period. - Must be at least 15 (0xF) to ensure proper watchdog operation. - Default value 65535 creates a 2-second timeout. - config GEN_UICR_SECONDARY bool "Enable UICR.SECONDARY.ENABLE" From 258aefb0d16aff03a4f8d81944226d33eb12f286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1342/3334] Revert "[nrf fromtree] drivers: mspi_dw: Remove needless TXEIR check" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3d5ca147ffdca3936590dd83ab960bce7a6ef244. Signed-off-by: Tomasz Moń --- drivers/mspi/mspi_dw.c | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index 518b5605785f..f7be2e33c9e5 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -195,7 +195,7 @@ static void tx_data(const struct device *dev, dev_data->buf_pos = (uint8_t *)buf_pos; } -static bool tx_dummy_bytes(const struct device *dev, bool *repeat) +static bool tx_dummy_bytes(const struct device *dev) { struct mspi_dw_data *dev_data = dev->data; const struct mspi_dw_config *dev_config = dev->config; @@ -209,17 +209,8 @@ static bool tx_dummy_bytes(const struct device *dev, bool *repeat) * FIFO to avoid overflowing it; `max_queued_dummy_bytes` accounts * that one byte that can be partially received, thus not included * in the value from the RXFLR register. - * This check also handles the case when the function is called but - * the TX FIFO is already filled up (fifo_room == 0). */ if (fifo_room <= rx_fifo_items) { - if (repeat) { - /* If no dummy bytes can be sent now, there is no point - * in repeating the loop that reads the RX FIFO. - */ - *repeat = false; - } - return false; } fifo_room -= rx_fifo_items; @@ -338,9 +329,7 @@ static void handle_fifos(const struct device *dev) finished = true; } } else { - bool repeat = true; - - do { + for (;;) { /* Always read everything from the RX FIFO, regardless * of the interrupt status. * tx_dummy_bytes() subtracts the number of items that @@ -374,28 +363,19 @@ static void handle_fifos(const struct device *dev) break; } - /* If there are still some dummy bytes to transmit, - * always try to put some into the TX FIFO, no matter - * what's the TXE interrupt status - the TX FIFO may be - * filled above its threshold level (then its interrupt - * flag is not set), but below its transfer start level, - * so the controller may be waiting for more items to - * appear there. - */ - if (dev_data->dummy_bytes == 0) { + if (dev_data->dummy_bytes == 0 || + !(int_status & RISR_TXEIR_BIT)) { break; } - if (tx_dummy_bytes(dev, &repeat)) { + if (tx_dummy_bytes(dev)) { /* All the required dummy bytes were written * to the FIFO; disable the TXE interrupt, * as it's no longer needed. */ set_imr(dev, IMR_RXFIM_BIT); } - - /* Repeat the loop only if any dummy bytes were sent. */ - } while (repeat); + } } if (finished) { @@ -1171,7 +1151,7 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) } /* Prefill TX FIFO with any data we can */ - if (dev_data->dummy_bytes && tx_dummy_bytes(dev, NULL)) { + if (dev_data->dummy_bytes && tx_dummy_bytes(dev)) { imr = IMR_RXFIM_BIT; } else if (packet->dir == MSPI_TX && packet->num_bytes) { tx_data(dev, packet); From 280c662040c6216c5539767169594ec01d4101df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1343/3334] Revert "[nrf fromtree] dts: bindings: introduce nordic,nrfs-swext" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 765d007f7a497d663d5dbd583bf6ee06a3de5086. Signed-off-by: Tomasz Moń --- .../power-domain/nordic,nrfs-swext.yaml | 26 ------------------- dts/vendor/nordic/nrf54h20.dtsi | 9 ------- 2 files changed, 35 deletions(-) delete mode 100644 dts/bindings/power-domain/nordic,nrfs-swext.yaml diff --git a/dts/bindings/power-domain/nordic,nrfs-swext.yaml b/dts/bindings/power-domain/nordic,nrfs-swext.yaml deleted file mode 100644 index a504f4d97cdd..000000000000 --- a/dts/bindings/power-domain/nordic,nrfs-swext.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2025 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic NRFS SWEXT power domain - -compatible: "nordic,nrfs-swext" - -include: power-domain.yaml - -properties: - "#power-domain-cells": - const: 0 - - max-current-ua: - type: int - description: Maxmimum supported current in microamps. - required: true - - current-limit-ua: - type: int - description: Maxmimum allowed current in microamps. - required: true - - power-down-clamp: - type: boolean - description: Enable ground clamp on output when powered down. diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index e2ce4cfd9945..06a7fe4d2495 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -252,15 +252,6 @@ }; }; - swext: swext { - compatible = "nordic,nrfs-swext"; - status = "disabled"; - max-current-ua = <7500>; - current-limit-ua = <7500>; - zephyr,pm-device-runtime-auto; - #power-domain-cells = <0>; - }; - soc { #address-cells = <1>; #size-cells = <1>; From a229fe682f38c66666de0125fa67aa7905ca0ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1344/3334] Revert "[nrf fromlist] tests: drivers: spi_loopback: increase latency limit for nrf54h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a9f0bdb9f6367f3d8214a5b0d8342302ce8c6fba. Signed-off-by: Tomasz Moń --- .../spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 2 +- .../spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 725924348b53..ad922ab8d26f 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1 +1 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15 +CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf index 725924348b53..ad922ab8d26f 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -1 +1 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15 +CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 From cd0b3e6ce2e800301dc4f31f5d62ec12a5d65a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1345/3334] Revert "[nrf fromlist] tests: arch: arm: irq_vector_table: disable POWER_DOMAIN for nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dced9a7f1f592cac87847c8968f629cd5d7721e8. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 4 ---- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index e12e413d9e5a..000000000000 --- a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_POWER_DOMAIN=n diff --git a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index e12e413d9e5a..000000000000 --- a/tests/arch/arm/arm_irq_vector_table/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_POWER_DOMAIN=n From 3100e2662e5d01b30d05bc38eb88c7a6ea24c11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1346/3334] Revert "[nrf fromtree] dts: bindings: comparator: nordic: Change inputs type to int" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9b97e030fa729eb0ed434b373742c526bcbccfab. Signed-off-by: Tomasz Moń --- dts/bindings/comparator/nordic,nrf-comp.yaml | 32 +++++++++++++++---- .../comparator/nordic,nrf-lpcomp.yaml | 20 +++++++++--- .../zephyr/dt-bindings/comparator/nrf-comp.h | 21 ------------ 3 files changed, 42 insertions(+), 31 deletions(-) delete mode 100644 include/zephyr/dt-bindings/comparator/nrf-comp.h diff --git a/dts/bindings/comparator/nordic,nrf-comp.yaml b/dts/bindings/comparator/nordic,nrf-comp.yaml index f1405a6de2c9..e4f6838d2049 100644 --- a/dts/bindings/comparator/nordic,nrf-comp.yaml +++ b/dts/bindings/comparator/nordic,nrf-comp.yaml @@ -25,7 +25,7 @@ description: | &comp { status = "okay"; main-mode = "SE"; - psel = ; + psel = "AIN0"; refsel = "INT_1V2"; sp-mode = "NORMAL"; th-up = <36>; @@ -39,7 +39,7 @@ description: | &comp { ... refsel = "AREF"; - extrefsel = ; + extrefsel = "AIN1"; ... }; @@ -49,8 +49,8 @@ description: | &comp { status = "okay"; main-mode = "DIFF"; - psel = ; - extrefsel = ; + psel = "AIN0"; + extrefsel = "AIN1"; sp-mode = "NORMAL"; enable-hyst; isource = "DISABLED"; @@ -68,10 +68,30 @@ properties: - "DIFF" psel: - type: int + type: string + enum: + - "AIN0" + - "AIN1" + - "AIN2" + - "AIN3" + - "AIN4" + - "AIN5" + - "AIN6" + - "AIN7" + - "VDD_DIV2" + - "VDDH_DIV5" extrefsel: - type: int + type: string + enum: + - "AIN0" + - "AIN1" + - "AIN2" + - "AIN3" + - "AIN4" + - "AIN5" + - "AIN6" + - "AIN7" refsel: type: string diff --git a/dts/bindings/comparator/nordic,nrf-lpcomp.yaml b/dts/bindings/comparator/nordic,nrf-lpcomp.yaml index 4995155ed76b..64a30b330d8b 100644 --- a/dts/bindings/comparator/nordic,nrf-lpcomp.yaml +++ b/dts/bindings/comparator/nordic,nrf-lpcomp.yaml @@ -21,7 +21,7 @@ description: | &comp { status = "okay"; - psel = ; + psel = "AIN0"; refsel = "VDD_4_8"; enable-hyst; }; @@ -32,7 +32,7 @@ description: | &comp { ... refsel = "AREF"; - extrefsel = ; + extrefsel = "AIN1"; ... }; @@ -42,10 +42,22 @@ include: base.yaml properties: psel: - type: int + type: string + enum: + - "AIN0" + - "AIN1" + - "AIN2" + - "AIN3" + - "AIN4" + - "AIN5" + - "AIN6" + - "AIN7" extrefsel: - type: int + type: string + enum: + - "AIN0" + - "AIN1" refsel: type: string diff --git a/include/zephyr/dt-bindings/comparator/nrf-comp.h b/include/zephyr/dt-bindings/comparator/nrf-comp.h deleted file mode 100644 index 1a5407554a15..000000000000 --- a/include/zephyr/dt-bindings/comparator/nrf-comp.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ - -#define NRF_COMP_AIN0 0 /** AIN0 external input */ -#define NRF_COMP_AIN1 1 /** AIN1 external input */ -#define NRF_COMP_AIN2 2 /** AIN2 external input */ -#define NRF_COMP_AIN3 3 /** AIN3 external input */ -#define NRF_COMP_AIN4 4 /** AIN4 external input */ -#define NRF_COMP_AIN5 5 /** AIN5 external input */ -#define NRF_COMP_AIN6 6 /** AIN6 external input */ -#define NRF_COMP_AIN7 7 /** AIN7 external input */ -#define NRF_COMP_AIN_VDD_DIV2 8 /** VDD / 2 */ -#define NRF_COMP_AIN_VDDH_DIV5 9 /** VDDH / 5 */ - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_COMP_H_ */ From e901858e0ff21ee5556855bd69f34b85d9b3d880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1347/3334] Revert "[nrf fromtree] tests: comparator: nordic: Align boards overlays for changed input types" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d31f006719183b2d430fafc623341a03dc527c14. Signed-off-by: Tomasz Moń --- .../nrf54l15dk_nrf54l15_cpuapp_comparator.overlay | 4 +--- .../boards/bl54l15_dvk_nrf54l15_cpuapp.overlay | 6 ++---- .../boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay | 6 ++---- .../comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 6 ++---- .../comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 6 ++---- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 6 ++---- tests/boards/nrf/comp/src/test.c | 14 ++++++++------ .../build_all/comparator/nrf_comp/diff.overlay | 6 ++---- .../build_all/comparator/nrf_comp/se.overlay | 4 +--- .../build_all/comparator/nrf_comp/se_aref.overlay | 6 ++---- .../comparator/nrf_lpcomp/ext_ref.overlay | 4 +--- .../comparator/nrf_lpcomp/int_ref.overlay | 6 ++---- .../boards/bl54l15_dvk_nrf54l15_cpuapp.overlay | 4 +--- .../boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay | 4 +--- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 4 +--- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 +--- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 4 +--- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 4 +--- .../boards/bl54l15_dvk_nrf54l15_cpuapp.overlay | 4 +--- .../boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay | 4 +--- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 4 +--- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 +--- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 4 +--- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 4 +--- 24 files changed, 39 insertions(+), 83 deletions(-) diff --git a/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_comparator.overlay b/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_comparator.overlay index ce93cee141a1..f0b39b456206 100644 --- a/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_comparator.overlay +++ b/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_comparator.overlay @@ -1,8 +1,6 @@ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; + psel = "AIN4"; refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay index c928e7eff243..aaf1006300a5 100644 --- a/tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -5,8 +5,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - / { aliases { test-comp = ∁ @@ -32,9 +30,9 @@ &comp { status = "okay"; - psel = ; + psel = "AIN4"; refsel = "AREF"; - extrefsel = ; + extrefsel = "AIN3"; sp-mode = "NORMAL"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay index c928e7eff243..aaf1006300a5 100644 --- a/tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -5,8 +5,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - / { aliases { test-comp = ∁ @@ -32,9 +30,9 @@ &comp { status = "okay"; - psel = ; + psel = "AIN4"; refsel = "AREF"; - extrefsel = ; + extrefsel = "AIN3"; sp-mode = "NORMAL"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 27008ba6760f..4e9e898ea184 100644 --- a/tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - / { aliases { test-comp = ∁ @@ -27,9 +25,9 @@ &comp { status = "okay"; - psel = ; + psel = "AIN5"; refsel = "AREF"; - extrefsel = ; + extrefsel = "AIN1"; sp-mode = "HIGH"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 5695f7d90dcd..d6492e37c343 100644 --- a/tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - / { aliases { test-comp = ∁ @@ -31,9 +29,9 @@ &comp { status = "okay"; - psel = ; + psel = "AIN4"; refsel = "AREF"; - extrefsel = ; + extrefsel = "AIN3"; sp-mode = "NORMAL"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 94087309aee9..45cefc0815bb 100644 --- a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -5,8 +5,6 @@ * AIN4 (P1.06) tied to VDD */ -#include - / { aliases { test-comp = ∁ @@ -24,9 +22,9 @@ &comp { status = "okay"; - psel = ; + psel = "AIN4"; refsel = "AREF"; - extrefsel = ; + extrefsel = "AIN3"; sp-mode = "NORMAL"; th-up = <36>; th-down = <30>; diff --git a/tests/boards/nrf/comp/src/test.c b/tests/boards/nrf/comp/src/test.c index 481760da5bd4..1d1876e76faa 100644 --- a/tests/boards/nrf/comp/src/test.c +++ b/tests/boards/nrf/comp/src/test.c @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -14,11 +13,14 @@ static const struct device *test_dev = DEVICE_DT_GET(DT_ALIAS(test_comp)); static const struct gpio_dt_spec test_pin_1 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), first_gpios); static const struct gpio_dt_spec test_pin_2 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), second_gpios); -#define TEST_COMP_SE_PSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX) -#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX) -#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX) -#define TEST_COMP_DIFF_EXTREFSEL_AIN \ - _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX) +#define TEST_COMP_SE_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \ + CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX) +#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \ + CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX) +#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \ + CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX) +#define TEST_COMP_DIFF_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \ + CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX) struct comp_nrf_comp_se_config comp_se_config = { .psel = TEST_COMP_SE_PSEL_AIN, diff --git a/tests/drivers/build_all/comparator/nrf_comp/diff.overlay b/tests/drivers/build_all/comparator/nrf_comp/diff.overlay index 56b4249d3c53..8b8e9a02c2b1 100644 --- a/tests/drivers/build_all/comparator/nrf_comp/diff.overlay +++ b/tests/drivers/build_all/comparator/nrf_comp/diff.overlay @@ -4,12 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "DIFF"; - psel = ; - extrefsel = ; + psel = "AIN0"; + extrefsel = "AIN1"; sp-mode = "HIGH"; isource = "DISABLED"; status = "okay"; diff --git a/tests/drivers/build_all/comparator/nrf_comp/se.overlay b/tests/drivers/build_all/comparator/nrf_comp/se.overlay index 67798ab4bcf1..e4eb56f61a92 100644 --- a/tests/drivers/build_all/comparator/nrf_comp/se.overlay +++ b/tests/drivers/build_all/comparator/nrf_comp/se.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "SE"; - psel = ; + psel = "AIN0"; refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <36>; diff --git a/tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay b/tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay index 04216a7ac10e..0d36a3e40b40 100644 --- a/tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay +++ b/tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay @@ -4,12 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "SE"; - psel = ; - extrefsel = ; + psel = "AIN0"; + extrefsel = "AIN1"; refsel = "AREF"; sp-mode = "HIGH"; th-up = <36>; diff --git a/tests/drivers/build_all/comparator/nrf_lpcomp/ext_ref.overlay b/tests/drivers/build_all/comparator/nrf_lpcomp/ext_ref.overlay index 0d990b2c3f88..95e44fbed3d6 100644 --- a/tests/drivers/build_all/comparator/nrf_lpcomp/ext_ref.overlay +++ b/tests/drivers/build_all/comparator/nrf_lpcomp/ext_ref.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; + psel = "AIN0"; refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/build_all/comparator/nrf_lpcomp/int_ref.overlay b/tests/drivers/build_all/comparator/nrf_lpcomp/int_ref.overlay index a42ad2f13a16..7aadd8b3faee 100644 --- a/tests/drivers/build_all/comparator/nrf_lpcomp/int_ref.overlay +++ b/tests/drivers/build_all/comparator/nrf_lpcomp/int_ref.overlay @@ -4,12 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; + psel = "AIN0"; refsel = "AREF"; - extrefsel = ; + extrefsel = "AIN1"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay index 84d3b9f57594..ddcf8d26cadd 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -5,11 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "SE"; - psel = ; /* P1.11 */ + psel = "AIN4"; /* P1.11 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay index 84d3b9f57594..ddcf8d26cadd 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -5,11 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "SE"; - psel = ; /* P1.11 */ + psel = "AIN4"; /* P1.11 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay index 68fea53e2b45..e11bdcd3173d 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "SE"; - psel = ; /* P0.04 */ + psel = "AIN0"; /* P0.04 */ refsel = "VDD"; sp-mode = "HIGH"; th-up = <34>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 5923e3ab07c8..f90c2051255f 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "SE"; - psel = ; /* P1.02 */ + psel = "AIN2"; /* P1.02 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 925417d48ab5..3a7a8f0ef811 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "SE"; - psel = ; /* P1.11 */ + psel = "AIN4"; /* P1.11 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 623bfd9c45f3..2709df531950 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { main-mode = "SE"; - psel = ; /* P1.31 */ + psel = "AIN1"; /* P1.31 */ refsel = "INT_1V2"; sp-mode = "HIGH"; th-up = <63>; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay index e208b85b2ae9..58e055a02406 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay @@ -5,11 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; /* P1.11 */ + psel = "AIN4"; /* P1.11 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay index e208b85b2ae9..58e055a02406 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay @@ -5,11 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; /* P1.11 */ + psel = "AIN4"; /* P1.11 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay index 0c571fa21b8f..d35a20dfc223 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; /* P0.04 */ + psel = "AIN0"; /* P0.04 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 66306268a117..349cd7051f99 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; /* P1.02 */ + psel = "AIN2"; /* P1.02 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index e82d8b98521c..ebb652bdd871 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; /* P1.11 */ + psel = "AIN4"; /* P1.11 */ refsel = "VDD_4_8"; status = "okay"; }; diff --git a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index db097a9fd6fd..0f51a9951a16 100644 --- a/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &comp { compatible = "nordic,nrf-lpcomp"; - psel = ; /* P1.31 */ + psel = "AIN1"; /* P1.31 */ refsel = "VDD_4_8"; status = "okay"; }; From 0b8db5a9984556be6ebc54c77035dc09d31c8ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1348/3334] Revert "[nrf fromtree] tests: drivers: comparator: Enable nxp cmp test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 52dd64b8d7ad1c6e59d2e74ce467e47ecfcabcc7. Signed-off-by: Tomasz Moń --- .../comparator/nxp_cmp/frdm_mcxc242.dts | 18 ------------- .../build_all/comparator/testcase.yaml | 5 ---- .../gpio_loopback/boards/frdm_mcxc242.overlay | 25 ------------------- 3 files changed, 48 deletions(-) delete mode 100644 tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.dts delete mode 100644 tests/drivers/comparator/gpio_loopback/boards/frdm_mcxc242.overlay diff --git a/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.dts b/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.dts deleted file mode 100644 index 93dc828c7a03..000000000000 --- a/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.dts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2025 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&cmp { - positive-mux-input = "IN0"; /* PTC6 */ - negative-mux-input = "IN7"; /* DAC */ - dac-vref-source = "VIN2"; - dac-value = <31>; - filter-count = <0x3>; - filter-period = <0xF>; - hysteresis-mode = "LEVEL2"; - enable-high-speed-mode; - invert-output; - enable-pin-out; -}; diff --git a/tests/drivers/build_all/comparator/testcase.yaml b/tests/drivers/build_all/comparator/testcase.yaml index 1dda00155206..298dcc884107 100644 --- a/tests/drivers/build_all/comparator/testcase.yaml +++ b/tests/drivers/build_all/comparator/testcase.yaml @@ -119,8 +119,3 @@ tests: - DTC_OVERLAY_FILE="mcux_acmp/mke15z7_mux_mux.dts" platform_allow: - frdm_ke15z - drivers.build_all.comparator.nxp_cmp.frdm_mcxc242: - extra_args: - - DTC_OVERLAY_FILE="nxp_cmp/frdm_mcxc242.dts" - platform_allow: - - frdm_mcxc242 diff --git a/tests/drivers/comparator/gpio_loopback/boards/frdm_mcxc242.overlay b/tests/drivers/comparator/gpio_loopback/boards/frdm_mcxc242.overlay deleted file mode 100644 index 755db58ab40f..000000000000 --- a/tests/drivers/comparator/gpio_loopback/boards/frdm_mcxc242.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2025 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/ { - aliases { - test-comp = &cmp; - }; - - zephyr,user { - /* PTC4 output connect to PTC6. */ - test-gpios = <&gpioc 4 GPIO_ACTIVE_HIGH>; - }; -}; - -&cmp { - positive-mux-input = "IN0"; /* PTC6, FRDM-MCXC242 J2-8 */ - negative-mux-input = "IN7"; /* DAC output => 1.65V */ - dac-vref-source = "VIN2"; - dac-value = <31>; -}; From 98562f48623b1ab00ae0cf0e0f6999bbdadae077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:56 +0100 Subject: [PATCH 1349/3334] Revert "[nrf fromlist] dts: drivers: nordic: nrf54h: Don't manage clocks from drivers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d9c72ef97d5059e8bd4a623adc516798bbb60fcc. Signed-off-by: Tomasz Moń --- drivers/can/can_nrf.c | 28 ++- drivers/counter/counter_nrfx_timer.c | 64 ++++++- drivers/pwm/pwm_nrfx.c | 109 +++++++++++- drivers/serial/Kconfig.nrfx | 7 + drivers/serial/uart_nrfx_uarte.c | 163 ++++++++++++++++-- drivers/spi/spi_nrfx_spim.c | 108 +++++++++++- drivers/spi/spi_nrfx_spis.c | 38 +++- dts/arm/nordic/nrf54h20_cpuapp.dtsi | 12 ++ dts/arm/nordic/nrf54h20_cpurad.dtsi | 12 ++ .../configs/cpuapp_hsfll.overlay | 4 - .../clock_control/configs/fll16m.overlay | 4 - .../configs/global_hsfll.overlay | 4 - .../clock_control/configs/lfclk.overlay | 4 - .../clock_control/configs/uart135.overlay | 4 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 21 --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 + 16 files changed, 518 insertions(+), 65 deletions(-) delete mode 100644 tests/drivers/clock_control/nrf_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/drivers/can/can_nrf.c b/drivers/can/can_nrf.c index 38021d764b17..8e19b5420356 100644 --- a/drivers/can/can_nrf.c +++ b/drivers/can/can_nrf.c @@ -29,6 +29,7 @@ struct can_nrf_config { uint32_t mrba; uint32_t mram; const struct device *auxpll; + const struct device *hsfll; const struct pinctrl_dev_config *pcfg; void (*irq_configure)(void); uint16_t irq; @@ -132,16 +133,40 @@ static const struct can_mcan_ops can_mcan_nrf_ops = { .clear_mram = can_nrf_clear_mram, }; +static int configure_hsfll(const struct device *dev, bool on) +{ + const struct can_mcan_config *mcan_config = dev->config; + const struct can_nrf_config *config = mcan_config->custom; + struct nrf_clock_spec spec = { 0 }; + + /* If CAN is on, HSFLL frequency >= AUXPLL frequency */ + if (on) { + int ret; + + ret = clock_control_get_rate(config->auxpll, NULL, &spec.frequency); + if (ret < 0) { + return ret; + } + } + + return nrf_clock_control_request_sync(config->hsfll, &spec, K_FOREVER); +} + static int can_nrf_init(const struct device *dev) { const struct can_mcan_config *mcan_config = dev->config; const struct can_nrf_config *config = mcan_config->custom; int ret; - if (!device_is_ready(config->auxpll)) { + if (!device_is_ready(config->auxpll) || !device_is_ready(config->hsfll)) { return -ENODEV; } + ret = configure_hsfll(dev, true); + if (ret < 0) { + return ret; + } + ret = nrf_clock_control_request_sync(config->auxpll, NULL, K_FOREVER); if (ret < 0) { return ret; @@ -190,6 +215,7 @@ static int can_nrf_init(const struct device *dev) .mram = CAN_MCAN_DT_INST_MRAM_ADDR(n), \ .auxpll = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR_BY_NAME(n, auxpll)), \ .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n), \ + .hsfll = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR_BY_NAME(n, hsfll)), \ .irq = DT_INST_IRQN(n), \ .irq_configure = can_nrf_irq_configure##n, \ }; \ diff --git a/drivers/counter/counter_nrfx_timer.c b/drivers/counter/counter_nrfx_timer.c index 1a614b391c06..26fa49b1aeed 100644 --- a/drivers/counter/counter_nrfx_timer.c +++ b/drivers/counter/counter_nrfx_timer.c @@ -5,6 +5,7 @@ */ #include #include +#include #include #include #include @@ -34,11 +35,21 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, LOG_LEVEL); #define MAYBE_CONST_CONFIG const #endif +#if NRF_DT_INST_ANY_IS_FAST && CONFIG_CLOCK_CONTROL +#define COUNTER_IS_FAST(idx) NRF_DT_INST_IS_FAST(idx) +#define COUNTER_ANY_FAST +#else +#define COUNTER_IS_FAST(idx) 0 +#endif + struct counter_nrfx_data { counter_top_callback_t top_cb; void *top_user_data; uint32_t guard_period; atomic_t cc_int_pending; +#ifdef COUNTER_ANY_FAST + atomic_t active; +#endif }; struct counter_nrfx_ch_data { @@ -50,6 +61,10 @@ struct counter_nrfx_config { struct counter_config_info info; struct counter_nrfx_ch_data *ch_data; NRF_TIMER_Type *timer; +#ifdef COUNTER_ANY_FAST + const struct device *clk_dev; + struct nrf_clock_spec clk_spec; +#endif LOG_INSTANCE_PTR_DECLARE(log); }; @@ -63,6 +78,18 @@ static int start(const struct device *dev) { const struct counter_nrfx_config *config = dev->config; +#ifdef COUNTER_ANY_FAST + struct counter_nrfx_data *data = dev->data; + + if (config->clk_dev && atomic_cas(&data->active, 0, 1)) { + int err; + + err = nrf_clock_control_request_sync(config->clk_dev, &config->clk_spec, K_FOREVER); + if (err < 0) { + return err; + } + } +#endif nrf_timer_task_trigger(config->timer, NRF_TIMER_TASK_START); return 0; @@ -79,6 +106,19 @@ static int stop(const struct device *dev) nrf_timer_task_trigger(config->timer, NRF_TIMER_TASK_CLEAR); #endif +#ifdef COUNTER_ANY_FAST + struct counter_nrfx_data *data = dev->data; + + if (config->clk_dev && atomic_cas(&data->active, 1, 0)) { + int err; + + err = nrf_clock_control_release(config->clk_dev, &config->clk_spec); + if (err < 0) { + return err; + } + } +#endif + return 0; } @@ -419,6 +459,20 @@ static DEVICE_API(counter, counter_nrfx_driver_api) = { .set_guard_period = set_guard_period, }; +/* Get initialization level of an instance. Instances that requires clock control + * which is using nrfs (IPC) are initialized later. + */ +#define TIMER_INIT_LEVEL(idx) \ + COND_CODE_1(COUNTER_IS_FAST(idx), (POST_KERNEL), (PRE_KERNEL_1)) + +/* Get initialization priority of an instance. Instances that requires clock control + * which is using nrfs (IPC) are initialized later. + */ +#define TIMER_INIT_PRIO(idx) \ + COND_CODE_1(COUNTER_IS_FAST(idx), \ + (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ + (CONFIG_COUNTER_INIT_PRIORITY)) + /* * Device instantiation is done with node labels due to HAL API * requirements. In particular, TIMERx_MAX_SIZE values from HALs @@ -471,6 +525,14 @@ static DEVICE_API(counter, counter_nrfx_driver_api) = { }, \ .ch_data = counter##idx##_ch_data, \ .timer = (NRF_TIMER_Type *)DT_INST_REG_ADDR(idx), \ + IF_ENABLED(COUNTER_IS_FAST(idx), \ + (.clk_dev = DEVICE_DT_GET_OR_NULL(DT_CLOCKS_CTLR(DT_DRV_INST(idx))), \ + .clk_spec = { \ + .frequency = NRF_PERIPH_GET_FREQUENCY(DT_DRV_INST(idx)), \ + .accuracy = 0, \ + .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, \ + }, \ + )) \ LOG_INSTANCE_PTR_INIT(log, LOG_MODULE_NAME, idx) \ }; \ DEVICE_DT_INST_DEFINE(idx, \ @@ -478,7 +540,7 @@ static DEVICE_API(counter, counter_nrfx_driver_api) = { NULL, \ &counter_##idx##_data, \ &nrfx_counter_##idx##_config.info, \ - PRE_KERNEL_1, CONFIG_COUNTER_INIT_PRIORITY, \ + TIMER_INIT_LEVEL(idx), TIMER_INIT_PRIO(idx), \ &counter_nrfx_driver_api); DT_INST_FOREACH_STATUS_OKAY(COUNTER_NRFX_TIMER_DEVICE) diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c index 55a2b759b18b..8565fd1187ac 100644 --- a/drivers/pwm/pwm_nrfx.c +++ b/drivers/pwm/pwm_nrfx.c @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -35,6 +36,20 @@ LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL); #define PWM(dev_idx) DT_NODELABEL(pwm##dev_idx) #define PWM_PROP(dev_idx, prop) DT_PROP(PWM(dev_idx), prop) #define PWM_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(PWM(idx), prop) +#define PWM_NRFX_IS_FAST(idx) NRF_DT_IS_FAST(PWM(idx)) + +#if NRF_DT_INST_ANY_IS_FAST +#define PWM_NRFX_FAST_PRESENT 1 +/* If fast instances are used then system managed device PM cannot be used because + * it may call PM actions from locked context and fast PWM PM actions can only be + * called in a thread context. + */ +BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); +#endif + +#if defined(PWM_NRFX_FAST_PRESENT) && CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL +#define PWM_NRFX_USE_CLOCK_CONTROL 1 +#endif #define PWM_NRFX_CH_POLARITY_MASK BIT(15) #define PWM_NRFX_CH_COMPARE_MASK BIT_MASK(15) @@ -50,6 +65,10 @@ struct pwm_nrfx_config { #ifdef CONFIG_DCACHE uint32_t mem_attr; #endif +#ifdef PWM_NRFX_USE_CLOCK_CONTROL + const struct device *clk_dev; + struct nrf_clock_spec clk_spec; +#endif }; struct pwm_nrfx_data { @@ -58,12 +77,27 @@ struct pwm_nrfx_data { uint8_t pwm_needed; uint8_t prescaler; bool stop_requested; +#ifdef PWM_NRFX_USE_CLOCK_CONTROL + bool clock_requested; +#endif }; /* Ensure the pwm_needed bit mask can accommodate all available channels. */ #if (NRF_PWM_CHANNEL_COUNT > 8) #error "Current implementation supports maximum 8 channels." #endif +#ifdef PWM_NRFX_FAST_PRESENT +static bool pwm_is_fast(const struct pwm_nrfx_config *config) +{ + return config->clock_freq > MHZ(16); +} +#else +static bool pwm_is_fast(const struct pwm_nrfx_config *config) +{ + return false; +} +#endif + static uint16_t *seq_values_ptr_get(const struct device *dev) { const struct pwm_nrfx_config *config = dev->config; @@ -144,6 +178,21 @@ static int stop_pwm(const struct device *dev) */ nrfx_pwm_stop(&config->pwm, false); +#if PWM_NRFX_USE_CLOCK_CONTROL + struct pwm_nrfx_data *data = dev->data; + + if (data->clock_requested) { + int ret = nrf_clock_control_release(config->clk_dev, &config->clk_spec); + + if (ret < 0) { + LOG_ERR("Global HSFLL release failed: %d", ret); + return ret; + } + + data->clock_requested = false; + } +#endif + return 0; } @@ -183,8 +232,9 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, /* Constantly active (duty 100%). */ /* This value is always greater than or equal to COUNTERTOP. */ compare_value = PWM_NRFX_CH_COMPARE_MASK; - needs_pwm = IS_ENABLED(NRF_PWM_HAS_IDLEOUT) && - IS_ENABLED(CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100); + needs_pwm = pwm_is_fast(config) || + (IS_ENABLED(NRF_PWM_HAS_IDLEOUT) && + IS_ENABLED(CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100)); } else { /* PWM generation needed. Check if the requested period matches * the one that is currently set, or the PWM peripheral can be @@ -240,6 +290,22 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, * registers and drives its outputs accordingly. */ if (data->pwm_needed == 0) { + if (pwm_is_fast(config)) { +#if PWM_NRFX_USE_CLOCK_CONTROL + if (data->clock_requested) { + int ret = nrf_clock_control_release(config->clk_dev, + &config->clk_spec); + + if (ret < 0) { + LOG_ERR("Global HSFLL release failed: %d", ret); + return ret; + } + + data->clock_requested = false; + } +#endif + return 0; + } int ret = stop_pwm(dev); if (ret < 0) { @@ -266,6 +332,20 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, * until another playback is requested (new values will be * loaded then) or the PWM peripheral is stopped. */ +#if PWM_NRFX_USE_CLOCK_CONTROL + if (config->clk_dev && !data->clock_requested) { + int ret = nrf_clock_control_request_sync(config->clk_dev, + &config->clk_spec, + K_FOREVER); + + if (ret < 0) { + LOG_ERR("Global HSFLL request failed: %d", ret); + return ret; + } + + data->clock_requested = true; + } +#endif nrfx_pwm_simple_playback(&config->pwm, &config->seq, 1, NRFX_PWM_FLAG_NO_EVT_FINISHED); } @@ -383,6 +463,21 @@ static int pwm_nrfx_init(const struct device *dev) COND_CODE_1(PWM_HAS_PROP(idx, memory_regions), \ (DT_PROP_OR(PWM_MEM_REGION(idx), zephyr_memory_attr, 0)), (0)) +/* Fast instances depend on the global HSFLL clock controller (as they need + * to request the highest frequency from it to operate correctly), so they + * must be initialized after that controller driver, hence the default PWM + * initialization priority may be too early for them. + */ +#if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY) && \ + CONFIG_PWM_INIT_PRIORITY < CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY +#define PWM_INIT_PRIORITY(idx) \ + COND_CODE_1(PWM_NRFX_IS_FAST(idx), \ + (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ + (CONFIG_PWM_INIT_PRIORITY)) +#else +#define PWM_INIT_PRIORITY(idx) CONFIG_PWM_INIT_PRIORITY +#endif + #define PWM_NRFX_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(PWM(idx)); \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(PWM(idx)); \ @@ -411,6 +506,14 @@ static int pwm_nrfx_init(const struct device *dev) (16ul * 1000ul * 1000ul)), \ IF_ENABLED(CONFIG_DCACHE, \ (.mem_attr = PWM_GET_MEM_ATTR(idx),)) \ + IF_ENABLED(PWM_NRFX_USE_CLOCK_CONTROL, \ + (.clk_dev = PWM_NRFX_IS_FAST(idx) \ + ? DEVICE_DT_GET(DT_CLOCKS_CTLR(PWM(idx))) \ + : NULL, \ + .clk_spec = { \ + .frequency = \ + NRF_PERIPH_GET_FREQUENCY(PWM(idx)), \ + },)) \ }; \ static int pwm_nrfx_init##idx(const struct device *dev) \ { \ @@ -423,7 +526,7 @@ static int pwm_nrfx_init(const struct device *dev) pwm_nrfx_init##idx, PM_DEVICE_DT_GET(PWM(idx)), \ &pwm_nrfx_##idx##_data, \ &pwm_nrfx_##idx##_config, \ - POST_KERNEL, CONFIG_PWM_INIT_PRIORITY, \ + POST_KERNEL, PWM_INIT_PRIORITY(idx), \ &pwm_nrfx_drv_api_funcs) #define COND_PWM_NRFX_DEVICE(unused, prefix, i, _) \ diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 722cc11da071..a39f882f644a 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -28,6 +28,13 @@ config UART_NRFX_UARTE imply NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG if !UART_NRFX_UARTE_LEGACY_SHIM imply NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG if !UART_NRFX_UARTE_LEGACY_SHIM +config UART_NRFX_UARTE_USE_CLOCK_CONTROL + def_bool y + depends on UART_NRFX_UARTE + depends on $(dt_nodelabel_enabled,uart120) + depends on !SOC_NRF54H20_CPUFLPR && !SOC_NRF54H20_CPUPPR + select CLOCK_CONTROL + config UART_NRFX_UARTE_NO_IRQ bool "Polling without interrupt" depends on UART_NRFX_UARTE diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 08cb236b918d..00489e7d8856 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -23,6 +23,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); @@ -117,6 +118,26 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); #define UARTE_ANY_LOW_POWER 1 #endif +/* Only cores with access to GDFS can control clocks and power domains, so if a fast instance is + * used by other cores, treat the UART like a normal one. This presumes cores with access to GDFS + * have requested the clocks and power domains needed by the fast instance to be ACTIVE before + * other cores use the fast instance. + */ +#if CONFIG_NRFS_GDFS_SERVICE_ENABLED +#define INSTANCE_IS_FAST(unused, prefix, idx, _) \ + UTIL_AND( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_HAS_HW_NRF_UARTE##prefix##idx), \ + NRF_DT_IS_FAST(UARTE(idx)) \ + ), \ + IS_ENABLED(CONFIG_CLOCK_CONTROL) \ + ) + +#if UARTE_FOR_EACH_INSTANCE(INSTANCE_IS_FAST, (||), (0)) +#define UARTE_ANY_FAST 1 +#endif +#endif + #define INSTANCE_IS_HIGH_SPEED(unused, prefix, idx, _) \ COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(UARTE(prefix##idx)), \ ((NRF_PERIPH_GET_FREQUENCY(UARTE(prefix##idx)) > NRF_UARTE_BASE_FREQUENCY_16MHZ)), \ @@ -377,6 +398,20 @@ struct uarte_nrfx_data { !IS_ENABLED(CONFIG_PM_DEVICE) && \ (_config->flags & UARTE_CFG_FLAG_LOW_POWER)) +/** @brief Check if device has PM that works in ISR safe mode. + * + * Only fast UARTE instance does not work in that mode so check PM configuration + * flags only if there is any fast instance present. + * + * @retval true if device PM is ISR safe. + * @retval false if device PM is not ISR safe. + */ +#define IS_PM_ISR_SAFE(dev) \ + (!IS_ENABLED(UARTE_ANY_FAST) ||\ + COND_CODE_1(CONFIG_PM_DEVICE,\ + ((dev->pm_base->flags & BIT(PM_DEVICE_FLAG_ISR_SAFE))), \ + (0))) + /** * @brief Structure for UARTE configuration. */ @@ -388,6 +423,10 @@ struct uarte_nrfx_config { #ifdef CONFIG_HAS_NORDIC_DMM void *mem_reg; #endif +#ifdef UARTE_ANY_FAST + const struct device *clk_dev; + struct nrf_clock_spec clk_spec; +#endif #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE /* None-zero in case of high speed instances. Baudrate is adjusted by that ratio. */ uint32_t clock_freq; @@ -801,6 +840,15 @@ static void uarte_periph_enable(const struct device *dev) struct uarte_nrfx_data *data = dev->data; (void)data; +#ifdef UARTE_ANY_FAST + if (config->clk_dev) { + int err; + + err = nrf_clock_control_request_sync(config->clk_dev, &config->clk_spec, K_FOREVER); + (void)err; + __ASSERT_NO_MSG(err >= 0); + } +#endif (void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); nrf_uarte_enable(uarte); @@ -1815,6 +1863,20 @@ static int uarte_nrfx_tx(const struct device *dev, const uint8_t *buf, } if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + if (!IS_PM_ISR_SAFE(dev) && k_is_in_isr()) { + /* If instance does not support PM from ISR device shall + * already be turned on. + */ + enum pm_device_state state; + int err; + + err = pm_device_state_get(dev, &state); + (void)err; + __ASSERT_NO_MSG(err == 0); + if (state != PM_DEVICE_STATE_ACTIVE) { + return -ENOTSUP; + } + } pm_device_runtime_get(dev); } @@ -1946,6 +2008,20 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, async_rx->next_buf_len = 0; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + if (!IS_PM_ISR_SAFE(dev) && k_is_in_isr()) { + /* If instance does not support PM from ISR device shall + * already be turned on. + */ + enum pm_device_state state; + int err; + + err = pm_device_state_get(dev, &state); + (void)err; + __ASSERT_NO_MSG(err == 0); + if (state != PM_DEVICE_STATE_ACTIVE) { + return -ENOTSUP; + } + } pm_device_runtime_get(dev); } else if (LOW_POWER_ENABLED(cfg)) { unsigned int key = irq_lock(); @@ -2009,7 +2085,7 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, nrf_uarte_rx_buffer_set(uarte, buf, len); - if (IS_ENABLED(CONFIG_HAS_HW_NRF_UARTE120) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { + if (IS_ENABLED(UARTE_ANY_FAST) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { /* Spurious RXTO event was seen on fast instance (UARTE120) thus * RXTO interrupt is kept enabled only when RX is active. */ @@ -2504,7 +2580,7 @@ static void rxto_isr(const struct device *dev) #ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX NRF_UARTE_Type *uarte = get_uarte_instance(dev); - if (IS_ENABLED(CONFIG_HAS_HW_NRF_UARTE120) && (config->flags & UARTE_CFG_FLAG_CACHEABLE)) { + if (IS_ENABLED(UARTE_ANY_FAST) && (config->flags & UARTE_CFG_FLAG_CACHEABLE)) { /* Spurious RXTO event was seen on fast instance (UARTE120) thus * RXTO interrupt is kept enabled only when RX is active. */ @@ -2797,6 +2873,22 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c) } if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + if (!IS_PM_ISR_SAFE(dev) && k_is_in_isr()) { + /* If instance does not support PM from ISR device shall + * already be turned on. + */ + enum pm_device_state state; + int err; + + err = pm_device_state_get(dev, &state); + (void)err; + __ASSERT_NO_MSG(err == 0); + if (state != PM_DEVICE_STATE_ACTIVE) { + irq_unlock(key); + return; + } + } + if (!(data->flags & UARTE_FLAG_POLL_OUT)) { data->flags |= UARTE_FLAG_POLL_OUT; pm_device_runtime_get(dev); @@ -3122,6 +3214,15 @@ static void uarte_pm_suspend(const struct device *dev) struct uarte_nrfx_data *data = dev->data; (void)data; +#ifdef UARTE_ANY_FAST + if (cfg->clk_dev) { + int err; + + err = nrf_clock_control_release(cfg->clk_dev, &cfg->clk_spec); + (void)err; + __ASSERT_NO_MSG(err >= 0); + } +#endif #ifdef UARTE_ANY_ASYNC if (data->async) { @@ -3403,6 +3504,20 @@ static int uarte_instance_deinit(const struct device *dev) #define UARTE_GET_BAUDRATE(idx) \ UARTE_GET_BAUDRATE2(NRF_PERIPH_GET_FREQUENCY(UARTE(idx)), UARTE_PROP(idx, current_speed)) +/* Get initialization level of an instance. Instances that requires clock control + * which is using nrfs (IPC) are initialized later. + */ +#define UARTE_INIT_LEVEL(idx) \ + COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _), (POST_KERNEL), (PRE_KERNEL_1)) + +/* Get initialization priority of an instance. Instances that requires clock control + * which is using nrfs (IPC) are initialized later. + */ +#define UARTE_INIT_PRIO(idx) \ + COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _), \ + (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ + (CONFIG_SERIAL_INIT_PRIORITY)) + /* Macro for setting nRF specific configuration structures. */ #define UARTE_NRF_CONFIG(idx) { \ .hwfc = (UARTE_PROP(idx, hw_flow_control) == \ @@ -3430,24 +3545,33 @@ static int uarte_instance_deinit(const struct device *dev) : UART_CFG_FLOW_CTRL_NONE, \ } +#define UARTE_ON_MANAGED_POWER_DOMAIN(idx) \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND( \ + DT_NODE_HAS_PROP(UARTE(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(UARTE(idx), power_domains)) \ + ) \ + ) + /* Macro determines if PM actions are interrupt safe. * - * Non-asynchronous API if RX is disabled is not ISR safe. + * Requesting/releasing clocks or power domains is not necessarily ISR safe (we can't + * reliably know, its out of our control). UARTE_ON_MANAGED_POWER_DOMAIN() let's us check if we + * will be requesting/releasing power domains (and clocks for now since the only case where we + * need to request power domains happens to be the same criteria). + * + * Furthermore, non-asynchronous API if RX is disabled is not ISR safe. * * Macro must resolve to a literal 1 or 0. */ #define UARTE_PM_ISR_SAFE(idx) \ - COND_CODE_1( \ - CONFIG_UART_##idx##_ASYNC, \ - (PM_DEVICE_ISR_SAFE), \ - ( \ - COND_CODE_1( \ - UARTE_PROP(idx, disable_rx), \ - (PM_DEVICE_ISR_SAFE), \ - (0) \ - ) \ - ) \ - ) + COND_CODE_1(UARTE_ON_MANAGED_POWER_DOMAIN(idx), \ + (0), \ + (COND_CODE_1(CONFIG_UART_##idx##_ASYNC, \ + (PM_DEVICE_ISR_SAFE), \ + (COND_CODE_1(UARTE_PROP(idx, disable_rx), \ + (PM_DEVICE_ISR_SAFE), (0)))))) \ #define UART_NRF_UARTE_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(UARTE(idx)); \ @@ -3518,6 +3642,13 @@ static int uarte_instance_deinit(const struct device *dev) IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ (.timer = NRFX_TIMER_INSTANCE( \ CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ + IF_ENABLED(INSTANCE_IS_FAST(_, /*empty*/, idx, _), \ + (.clk_dev = DEVICE_DT_GET_OR_NULL(DT_CLOCKS_CTLR(UARTE(idx))), \ + .clk_spec = { \ + .frequency = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),\ + .accuracy = 0, \ + .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT,\ + },)) \ IF_ENABLED(UARTE_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ (.cross_domain = true, \ .default_port = \ @@ -3542,8 +3673,8 @@ static int uarte_instance_deinit(const struct device *dev) PM_DEVICE_DT_GET(UARTE(idx)), \ &uarte_##idx##_data, \ &uarte_##idx##z_config, \ - PRE_KERNEL_1, \ - CONFIG_SERIAL_INIT_PRIORITY, \ + UARTE_INIT_LEVEL(idx), \ + UARTE_INIT_PRIO(idx), \ &uart_nrfx_uarte_driver_api) #define UARTE_INT_DRIVEN(idx) \ diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 44451be58bc7..447c0e54fba5 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -54,6 +55,31 @@ LOG_MODULE_REGISTER(spi_nrfx_spim, CONFIG_SPI_LOG_LEVEL); #define SPIM_FOR_EACH_INSTANCE(f, sep, off_code, ...) \ NRFX_FOREACH_PRESENT(SPIM, f, sep, off_code, __VA_ARGS__) +/* Only CPUAPP and CPURAD can control clocks and power domains, so if a fast instance is + * used by other cores, treat the SPIM like a normal one. This presumes the CPUAPP or CPURAD + * have requested the clocks and power domains needed by the fast instance to be ACTIVE before + * other cores use the fast instance. + */ +#if CONFIG_SOC_NRF54H20_CPUAPP || CONFIG_SOC_NRF54H20_CPURAD +#define INSTANCE_IS_FAST(unused, prefix, idx, _) \ + UTIL_AND( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_HAS_HW_NRF_SPIM##prefix##idx), \ + NRF_DT_IS_FAST(SPIM(idx)) \ + ), \ + IS_ENABLED(CONFIG_CLOCK_CONTROL) \ + ) + +#if SPIM_FOR_EACH_INSTANCE(INSTANCE_IS_FAST, (||), (0)) +#define SPIM_ANY_FAST 1 +/* If fast instances are used then system managed device PM cannot be used because + * it may call PM actions from locked context and fast SPIM PM actions can only be + * called from a thread context. + */ +BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); +#endif +#endif + #define SPIM_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIM(prefix##idx)), \ (SPIM_PROP(idx, cross_domain_pins_supported)), \ @@ -91,6 +117,9 @@ struct spi_nrfx_data { uint8_t ppi_ch; uint8_t gpiote_ch; #endif +#ifdef SPIM_ANY_FAST + bool clock_requested; +#endif }; struct spi_nrfx_config { @@ -105,6 +134,10 @@ struct spi_nrfx_config { #endif uint32_t wake_pin; nrfx_gpiote_t wake_gpiote; +#ifdef SPIM_ANY_FAST + const struct device *clk_dev; + struct nrf_clock_spec clk_spec; +#endif #if SPIM_CROSS_DOMAIN_SUPPORTED bool cross_domain; int8_t default_port; @@ -114,6 +147,51 @@ struct spi_nrfx_config { static void event_handler(const nrfx_spim_evt_t *p_event, void *p_context); +static inline int request_clock(const struct device *dev) +{ +#ifdef SPIM_ANY_FAST + struct spi_nrfx_data *dev_data = dev->data; + const struct spi_nrfx_config *dev_config = dev->config; + int error; + + if (!dev_config->clk_dev) { + return 0; + } + + error = nrf_clock_control_request_sync( + dev_config->clk_dev, &dev_config->clk_spec, + K_MSEC(CONFIG_SPI_COMPLETION_TIMEOUT_TOLERANCE)); + if (error < 0) { + LOG_ERR("Failed to request clock: %d", error); + return error; + } + + dev_data->clock_requested = true; +#else + ARG_UNUSED(dev); +#endif + + return 0; +} + +static inline void release_clock(const struct device *dev) +{ +#ifdef SPIM_ANY_FAST + struct spi_nrfx_data *dev_data = dev->data; + const struct spi_nrfx_config *dev_config = dev->config; + + if (!dev_data->clock_requested) { + return; + } + + dev_data->clock_requested = false; + + nrf_clock_control_release(dev_config->clk_dev, &dev_config->clk_spec); +#else + ARG_UNUSED(dev); +#endif +} + #if SPIM_CROSS_DOMAIN_SUPPORTED static bool spim_has_cross_domain_connection(const struct spi_nrfx_config *config) { @@ -154,6 +232,10 @@ static inline void finalize_spi_transaction(const struct device *dev, bool deact nrfy_spim_disable(reg); } + if (!pm_device_runtime_is_enabled(dev)) { + release_clock(dev); + } + pm_device_runtime_put_async(dev, K_NO_WAIT); } @@ -558,6 +640,10 @@ static int transceive(const struct device *dev, error = configure(dev, spi_cfg); + if (error == 0 && !pm_device_runtime_is_enabled(dev)) { + error = request_clock(dev); + } + if (error == 0) { dev_data->busy = true; @@ -700,7 +786,7 @@ static int spim_resume(const struct device *dev) } #endif - return 0; + return pm_device_runtime_is_enabled(dev) ? request_clock(dev) : 0; } static void spim_suspend(const struct device *dev) @@ -713,6 +799,10 @@ static void spim_suspend(const struct device *dev) dev_data->initialized = false; } + if (pm_device_runtime_is_enabled(dev)) { + release_clock(dev); + } + spi_context_cs_put_all(&dev_data->ctx); #if SPIM_CROSS_DOMAIN_SUPPORTED @@ -815,6 +905,14 @@ static int spi_nrfx_deinit(const struct device *dev) ()) \ )) +/* Get initialization priority of an instance. Instances that requires clock control + * which is using nrfs (IPC) are initialized later. + */ +#define SPIM_INIT_PRIORITY(idx) \ + COND_CODE_1(INSTANCE_IS_FAST(_, /*empty*/, idx, _), \ + (UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \ + (CONFIG_SPI_INIT_PRIORITY)) + #define SPI_NRFX_SPIM_DEFINE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPIM(idx)); \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIM(idx)); \ @@ -866,6 +964,12 @@ static int spi_nrfx_deinit(const struct device *dev) .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPIM(idx), wake_gpios, \ WAKE_PIN_NOT_USED), \ .wake_gpiote = WAKE_GPIOTE_INSTANCE(SPIM(idx)), \ + IF_ENABLED(SPIM_ANY_FAST, \ + (.clk_dev = DEVICE_DT_GET_OR_NULL( \ + DT_CLOCKS_CTLR(SPIM(idx))), \ + .clk_spec = { \ + .frequency = NRF_CLOCK_CONTROL_FREQUENCY_MAX, \ + },)) \ IF_ENABLED(SPIM_PINS_CROSS_DOMAIN(_, /*empty*/, idx, _), \ (.cross_domain = true, \ .default_port = \ @@ -883,7 +987,7 @@ static int spi_nrfx_deinit(const struct device *dev) PM_DEVICE_DT_GET(SPIM(idx)), \ &spi_##idx##_data, \ &spi_##idx##z_config, \ - POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \ + POST_KERNEL, SPIM_INIT_PRIORITY(idx), \ &spi_nrfx_driver_api) #define COND_NRF_SPIM_DEVICE(unused, prefix, i, _) \ diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index 4d1a9070c1ac..aa59d9abc9b2 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -20,6 +20,14 @@ LOG_MODULE_REGISTER(spi_nrfx_spis, CONFIG_SPI_LOG_LEVEL); #include "spi_context.h" +#if NRF_DT_INST_ANY_IS_FAST +/* If fast instances are used then system managed device PM cannot be used because + * it may call PM actions from locked context and fast SPIM PM actions can only be + * called from a thread context. + */ +BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE_SYSTEM_MANAGED)); +#endif + /* * Current factors requiring use of DT_NODELABEL: * @@ -31,6 +39,7 @@ LOG_MODULE_REGISTER(spi_nrfx_spis, CONFIG_SPI_LOG_LEVEL); #define SPIS(idx) DT_NODELABEL(SPIS_NODE(idx)) #define SPIS_PROP(idx, prop) DT_PROP(SPIS(idx), prop) #define SPIS_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(SPIS(idx), prop) +#define SPIS_IS_FAST(idx) NRF_DT_IS_FAST(SPIS(idx)) #define SPIS_PINS_CROSS_DOMAIN(unused, prefix, idx, _) \ COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(SPIS(prefix##idx)), \ @@ -542,6 +551,32 @@ static int spi_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, spi_nrfx_pm_action); } +/* Macro determines PM actions interrupt safety level. + * + * Requesting/releasing SPIS device may be ISR safe, but it cannot be reliably known whether + * managing its power domain is. It is then assumed that if power domains are used, device is + * no longer ISR safe. This macro let's us check if we will be requesting/releasing + * power domains and determines PM device ISR safety value. + * + * Additionally, fast SPIS devices are not ISR safe. + */ +#define SPIS_PM_ISR_SAFE(idx) \ + COND_CODE_1( \ + UTIL_AND( \ + IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ + UTIL_AND( \ + DT_NODE_HAS_PROP(SPIS(idx), power_domains), \ + DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(SPIS(idx), power_domains)) \ + ) \ + ), \ + (0), \ + (COND_CODE_1( \ + SPIS_IS_FAST(idx), \ + (0), \ + (PM_DEVICE_ISR_SAFE) \ + )) \ + ) + #define SPI_NRFX_SPIS_DEFINE(idx) \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ static void irq_connect##idx(void) \ @@ -587,7 +622,8 @@ static int spi_nrfx_init(const struct device *dev) BUILD_ASSERT(!DT_NODE_HAS_PROP(SPIS(idx), wake_gpios) || \ !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ "WAKE line must be configured as active high"); \ - PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, PM_DEVICE_ISR_SAFE);\ + PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, \ + SPIS_PM_ISR_SAFE(idx)); \ SPI_DEVICE_DT_DEFINE(SPIS(idx), \ spi_nrfx_init, \ PM_DEVICE_DT_GET(SPIS(idx)), \ diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index 88ace7842aa3..f3b8e4f8c08c 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -67,6 +67,18 @@ wdt011: &cpuapp_wdt011 {}; interrupts = <109 NRF_DEFAULT_IRQ_PRIORITY>; }; +&fll16m { + status = "okay"; +}; + +&hsfll120 { + status = "okay"; +}; + +&lfclk { + status = "okay"; +}; + &gdpwr { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index b910e42789b0..cc7b0a97b513 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -108,6 +108,18 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; +&fll16m { + status = "okay"; +}; + +&hsfll120 { + status = "okay"; +}; + +&lfclk { + status = "okay"; +}; + &gdpwr { status = "okay"; }; diff --git a/samples/boards/nordic/clock_control/configs/cpuapp_hsfll.overlay b/samples/boards/nordic/clock_control/configs/cpuapp_hsfll.overlay index f2ab83533f48..0d46dfbda451 100644 --- a/samples/boards/nordic/clock_control/configs/cpuapp_hsfll.overlay +++ b/samples/boards/nordic/clock_control/configs/cpuapp_hsfll.overlay @@ -9,7 +9,3 @@ sample-clock = &cpuapp_hsfll; }; }; - -&cpuapp_hsfll { - status = "okay"; -}; diff --git a/samples/boards/nordic/clock_control/configs/fll16m.overlay b/samples/boards/nordic/clock_control/configs/fll16m.overlay index c4e24588f227..e6484259ce4f 100644 --- a/samples/boards/nordic/clock_control/configs/fll16m.overlay +++ b/samples/boards/nordic/clock_control/configs/fll16m.overlay @@ -9,7 +9,3 @@ sample-clock = &fll16m; }; }; - -&fll16m { - status = "okay"; -}; diff --git a/samples/boards/nordic/clock_control/configs/global_hsfll.overlay b/samples/boards/nordic/clock_control/configs/global_hsfll.overlay index ef14d521a589..c7e67b9c4e85 100644 --- a/samples/boards/nordic/clock_control/configs/global_hsfll.overlay +++ b/samples/boards/nordic/clock_control/configs/global_hsfll.overlay @@ -9,7 +9,3 @@ sample-clock = &hsfll120; }; }; - -&hsfll120 { - status = "okay"; -}; diff --git a/samples/boards/nordic/clock_control/configs/lfclk.overlay b/samples/boards/nordic/clock_control/configs/lfclk.overlay index 4b601f56fd08..db48e5f7705d 100644 --- a/samples/boards/nordic/clock_control/configs/lfclk.overlay +++ b/samples/boards/nordic/clock_control/configs/lfclk.overlay @@ -9,7 +9,3 @@ sample-clock = &lfclk; }; }; - -&lfclk { - status = "okay"; -}; diff --git a/samples/boards/nordic/clock_control/configs/uart135.overlay b/samples/boards/nordic/clock_control/configs/uart135.overlay index dfc32c3cd9f1..547145fa91de 100644 --- a/samples/boards/nordic/clock_control/configs/uart135.overlay +++ b/samples/boards/nordic/clock_control/configs/uart135.overlay @@ -14,7 +14,3 @@ status = "okay"; memory-regions = <&cpuapp_dma_region>; }; - -&fll16m { - status = "okay"; -}; diff --git a/tests/drivers/clock_control/nrf_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/clock_control/nrf_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 20fe7b305261..000000000000 --- a/tests/drivers/clock_control/nrf_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&fll16m { - status = "okay"; -}; - -&hsfll120 { - status = "okay"; -}; - -&lfclk { - status = "okay"; -}; - -&canpll { - status = "okay"; -}; diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 74cc8d7691e1..6dffc1fe4e19 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,2 +1,3 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_CLOCK_CONTROL=y From 8696b63c54a64f0d2f9180e9cfb0e87eee964804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1350/3334] Revert "[nrf fromlist] drivers: nordic: support pin retention for AIN" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8d3892fc7359e5f60f6d6a287d320e0c858f9b24. Signed-off-by: Tomasz Moń --- drivers/adc/adc_nrfx_saadc.c | 11 ----------- drivers/comparator/comparator_nrf_comp.c | 6 ------ drivers/comparator/comparator_nrf_lpcomp.c | 6 ------ 3 files changed, 23 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 32be9825d243..2c56e79f4897 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -16,7 +16,6 @@ #include #include #include -#include LOG_MODULE_REGISTER(adc_nrfx_saadc, CONFIG_ADC_LOG_LEVEL); @@ -201,10 +200,6 @@ static int input_assign(nrf_saadc_input_t *pin_p, *pin_p = saadc_psels[channel_cfg->input_positive]; -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - nrf_gpio_pin_retain_disable(saadc_psels[channel_cfg->input_positive]); -#endif - if (channel_cfg->differential) { if (channel_cfg->input_negative > ARRAY_SIZE(saadc_psels) || (IS_ENABLED(CONFIG_NRF_PLATFORM_HALTIUM) && @@ -217,12 +212,6 @@ static int input_assign(nrf_saadc_input_t *pin_p, *pin_n = channel_cfg->input_negative == NRF_SAADC_GND ? NRF_SAADC_INPUT_DISABLED : saadc_psels[channel_cfg->input_negative]; - -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - if (channel_cfg->input_negative != NRF_SAADC_GND) { - nrf_gpio_pin_retain_disable(saadc_psels[channel_cfg->input_negative]); - } -#endif } else { *pin_n = NRF_SAADC_INPUT_DISABLED; } diff --git a/drivers/comparator/comparator_nrf_comp.c b/drivers/comparator/comparator_nrf_comp.c index 7178c51675d8..6c5acdf5c080 100644 --- a/drivers/comparator/comparator_nrf_comp.c +++ b/drivers/comparator/comparator_nrf_comp.c @@ -5,7 +5,6 @@ */ #include -#include #include #include @@ -250,11 +249,6 @@ static int shim_nrf_comp_psel_to_nrf(uint8_t shim, } *nrf = shim_nrf_comp_ain_map[shim]; - -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - nrf_gpio_pin_retain_disable(shim_nrf_comp_ain_map[shim]); -#endif - return 0; } #else diff --git a/drivers/comparator/comparator_nrf_lpcomp.c b/drivers/comparator/comparator_nrf_lpcomp.c index dbd58d342360..6faba2b8669c 100644 --- a/drivers/comparator/comparator_nrf_lpcomp.c +++ b/drivers/comparator/comparator_nrf_lpcomp.c @@ -5,7 +5,6 @@ */ #include -#include #include #include @@ -143,11 +142,6 @@ static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, } *nrf = shim_nrf_comp_ain_map[shim]; - -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - nrf_gpio_pin_retain_disable(shim_nrf_comp_ain_map[shim]); -#endif - return 0; } #else From df1106e23146faa7bd1f92b8fec8c92dc86d23e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1351/3334] Revert "[nrf fromtree] drivers comparator: nordic: Align drivers to changed analog input types" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dcc72044c700709f9efb5dcba2a76c3a7d3a52a9. Signed-off-by: Tomasz Moń --- drivers/comparator/comparator_nrf_comp.c | 131 +++++++++--------- drivers/comparator/comparator_nrf_lpcomp.c | 54 +++----- include/zephyr/drivers/comparator/nrf_comp.h | 61 ++++++-- .../zephyr/drivers/comparator/nrf_lpcomp.h | 37 ++++- 4 files changed, 175 insertions(+), 108 deletions(-) diff --git a/drivers/comparator/comparator_nrf_comp.c b/drivers/comparator/comparator_nrf_comp.c index 6c5acdf5c080..311a864303bf 100644 --- a/drivers/comparator/comparator_nrf_comp.c +++ b/drivers/comparator/comparator_nrf_comp.c @@ -19,7 +19,8 @@ #define SHIM_NRF_COMP_DT_INST_REFSEL_IS_AREF(inst) \ DT_INST_ENUM_HAS_VALUE(inst, refsel, aref) -#define SHIM_NRF_COMP_DT_INST_EXTREFSEL(inst) DT_INST_PROP(inst, extrefsel) +#define SHIM_NRF_COMP_DT_INST_EXTREFSEL(inst) \ + _CONCAT(COMP_NRF_COMP_EXTREFSEL_, DT_INST_STRING_TOKEN(inst, extrefsel)) #define SHIM_NRF_COMP_DT_INST_MAIN_MODE_IS_SE(inst) \ DT_INST_ENUM_HAS_VALUE(inst, main_mode, se) @@ -42,7 +43,8 @@ #define SHIM_NRF_COMP_DT_INST_ISOURCE(inst) \ _CONCAT(COMP_NRF_COMP_ISOURCE_, DT_INST_STRING_TOKEN(inst, isource)) -#define SHIM_NRF_COMP_DT_INST_PSEL(inst) DT_INST_PROP(inst, psel) +#define SHIM_NRF_COMP_DT_INST_PSEL(inst) \ + _CONCAT(COMP_NRF_COMP_PSEL_, DT_INST_STRING_TOKEN(inst, psel)) #if defined(COMP_HYST_HYST_Hyst40mV) #define NRF_COMP_HYST_ENABLED NRF_COMP_HYST_40MV @@ -71,50 +73,35 @@ BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_DOWN(0) < 64); BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_UP(0) < 64); #endif -#if (NRF_COMP_HAS_AIN_AS_PIN) -BUILD_ASSERT(NRF_COMP_AIN0 == 0); -BUILD_ASSERT(NRF_COMP_AIN7 == 7); +#if NRF_COMP_HAS_AIN_AS_PIN +BUILD_ASSERT((COMP_NRF_COMP_PSEL_AIN0 == 0)); +BUILD_ASSERT((COMP_NRF_COMP_PSEL_AIN7 == 7)); +BUILD_ASSERT((COMP_NRF_COMP_EXTREFSEL_AIN0 == 0)); +BUILD_ASSERT((COMP_NRF_COMP_EXTREFSEL_AIN7 == 7)); #else -BUILD_ASSERT((NRF_COMP_AIN0 == NRF_COMP_INPUT_0) && - (NRF_COMP_AIN1 == NRF_COMP_INPUT_1) && - (NRF_COMP_AIN2 == NRF_COMP_INPUT_2) && - (NRF_COMP_AIN3 == NRF_COMP_INPUT_3) && -#if defined(COMP_PSEL_PSEL_AnalogInput4) - (NRF_COMP_AIN4 == NRF_COMP_INPUT_4) && -#endif -#if defined(COMP_PSEL_PSEL_AnalogInput5) - (NRF_COMP_AIN5 == NRF_COMP_INPUT_5) && -#endif -#if defined(COMP_PSEL_PSEL_AnalogInput6) - (NRF_COMP_AIN6 == NRF_COMP_INPUT_6) && -#endif -#if defined(COMP_PSEL_PSEL_AnalogInput7) - (NRF_COMP_AIN7 == NRF_COMP_INPUT_7) && +#ifndef COMP_PSEL_PSEL_AnalogInput4 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_AIN4); #endif - (NRF_COMP_AIN0 == NRF_COMP_EXT_REF_0) && - (NRF_COMP_AIN1 == NRF_COMP_EXT_REF_1) && - (NRF_COMP_AIN2 == NRF_COMP_EXT_REF_2) && - (NRF_COMP_AIN3 == NRF_COMP_EXT_REF_3) && -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference4) - (NRF_COMP_AIN4 == NRF_COMP_EXT_REF_4) && -#endif -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference5) - (NRF_COMP_AIN5 == NRF_COMP_EXT_REF_5) && + +#ifndef COMP_PSEL_PSEL_AnalogInput5 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_AIN5); #endif -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference6) - (NRF_COMP_AIN6 == NRF_COMP_EXT_REF_6) && + +#ifndef COMP_PSEL_PSEL_AnalogInput6 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_AIN6); #endif -#if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference7) - (NRF_COMP_AIN7 == NRF_COMP_EXT_REF_7) && + +#ifndef COMP_PSEL_PSEL_AnalogInput7 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_AIN7); #endif -#if defined(COMP_PSEL_PSEL_VddDiv2) - (NRF_COMP_VDD_DIV2 == NRF_COMP_VDD_DIV2) && #endif -#if defined(COMP_PSEL_PSEL_VddhDiv5) - (NRF_COMP_VDDH_DIV5 == NRF_COMP_VDDH_DIV5) && + +#ifndef COMP_PSEL_PSEL_VddDiv2 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_VDD_DIV2); #endif - 1, - "Definitions from nrf-comp.h do not match those from HAL"); + +#ifndef COMP_PSEL_PSEL_VddhDiv5 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_PSEL(0) != COMP_NRF_COMP_PSEL_VDDH_DIV5); #endif #ifndef COMP_MODE_SP_Normal @@ -135,6 +122,24 @@ BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_ISOURCE(0) != COMP_NRF_COMP_ISOURCE_10UA); #endif #endif +#if SHIM_NRF_COMP_DT_INST_REFSEL_IS_AREF(0) +#ifndef COMP_EXTREFSEL_EXTREFSEL_AnalogReference4 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_EXTREFSEL(0) != COMP_NRF_COMP_EXTREFSEL_AIN4); +#endif + +#ifndef COMP_EXTREFSEL_EXTREFSEL_AnalogReference5 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_EXTREFSEL(0) != COMP_NRF_COMP_EXTREFSEL_AIN5); +#endif + +#ifndef COMP_EXTREFSEL_EXTREFSEL_AnalogReference6 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_EXTREFSEL(0) != COMP_NRF_COMP_EXTREFSEL_AIN6); +#endif + +#ifndef COMP_EXTREFSEL_EXTREFSEL_AnalogReference7 +BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_EXTREFSEL(0) != COMP_NRF_COMP_EXTREFSEL_AIN7); +#endif +#endif + #if SHIM_NRF_COMP_DT_INST_MAIN_MODE_IS_SE(0) #ifndef COMP_REFSEL_REFSEL_Int1V8 BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_REFSEL(0) != COMP_NRF_COMP_REFSEL_INT_1V8); @@ -241,69 +246,69 @@ static int shim_nrf_comp_pm_callback(const struct device *dev, enum pm_device_ac } #if (NRF_COMP_HAS_AIN_AS_PIN) -static int shim_nrf_comp_psel_to_nrf(uint8_t shim, +static int shim_nrf_comp_psel_to_nrf(enum comp_nrf_comp_psel shim, nrf_comp_input_t *nrf) { if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { return -EINVAL; } - *nrf = shim_nrf_comp_ain_map[shim]; + *nrf = shim_nrf_comp_ain_map[(uint32_t)shim]; return 0; } #else -static int shim_nrf_comp_psel_to_nrf(uint8_t shim, +static int shim_nrf_comp_psel_to_nrf(enum comp_nrf_comp_psel shim, nrf_comp_input_t *nrf) { switch (shim) { - case NRF_COMP_AIN0: + case COMP_NRF_COMP_PSEL_AIN0: *nrf = NRF_COMP_INPUT_0; break; - case NRF_COMP_AIN1: + case COMP_NRF_COMP_PSEL_AIN1: *nrf = NRF_COMP_INPUT_1; break; - case NRF_COMP_AIN2: + case COMP_NRF_COMP_PSEL_AIN2: *nrf = NRF_COMP_INPUT_2; break; - case NRF_COMP_AIN3: + case COMP_NRF_COMP_PSEL_AIN3: *nrf = NRF_COMP_INPUT_3; break; #if defined(COMP_PSEL_PSEL_AnalogInput4) - case NRF_COMP_AIN4: + case COMP_NRF_COMP_PSEL_AIN4: *nrf = NRF_COMP_INPUT_4; break; #endif #if defined(COMP_PSEL_PSEL_AnalogInput5) - case NRF_COMP_AIN5: + case COMP_NRF_COMP_PSEL_AIN5: *nrf = NRF_COMP_INPUT_5; break; #endif #if defined(COMP_PSEL_PSEL_AnalogInput6) - case NRF_COMP_AIN6: + case COMP_NRF_COMP_PSEL_AIN6: *nrf = NRF_COMP_INPUT_6; break; #endif #if defined(COMP_PSEL_PSEL_AnalogInput7) - case NRF_COMP_AIN7: + case COMP_NRF_COMP_PSEL_AIN7: *nrf = NRF_COMP_INPUT_7; break; #endif #if defined(COMP_PSEL_PSEL_VddDiv2) - case NRF_COMP_AIN_VDD_DIV2: + case COMP_NRF_COMP_PSEL_VDD_DIV2: *nrf = NRF_COMP_VDD_DIV2; break; #endif #if defined(COMP_PSEL_PSEL_VddhDiv5) - case NRF_COMP_AIN_VDDH_DIV5: + case COMP_NRF_COMP_PSEL_VDDH_DIV5: *nrf = NRF_COMP_VDDH_DIV5; break; #endif @@ -377,57 +382,57 @@ static int shim_nrf_comp_isource_to_nrf(enum comp_nrf_comp_isource shim, #endif #if (NRF_COMP_HAS_AIN_AS_PIN) -static int shim_nrf_comp_extrefsel_to_nrf(uint8_t shim, +static int shim_nrf_comp_extrefsel_to_nrf(enum comp_nrf_comp_extrefsel shim, nrf_comp_ext_ref_t *nrf) { if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { return -EINVAL; } - *nrf = shim_nrf_comp_ain_map[shim]; + *nrf = shim_nrf_comp_ain_map[(uint32_t)shim]; return 0; } #else -static int shim_nrf_comp_extrefsel_to_nrf(uint8_t shim, +static int shim_nrf_comp_extrefsel_to_nrf(enum comp_nrf_comp_extrefsel shim, nrf_comp_ext_ref_t *nrf) { switch (shim) { - case NRF_COMP_AIN0: + case COMP_NRF_COMP_EXTREFSEL_AIN0: *nrf = NRF_COMP_EXT_REF_0; break; - case NRF_COMP_AIN1: + case COMP_NRF_COMP_EXTREFSEL_AIN1: *nrf = NRF_COMP_EXT_REF_1; break; - case NRF_COMP_AIN2: + case COMP_NRF_COMP_EXTREFSEL_AIN2: *nrf = NRF_COMP_EXT_REF_2; break; - case NRF_COMP_AIN3: + case COMP_NRF_COMP_EXTREFSEL_AIN3: *nrf = NRF_COMP_EXT_REF_3; break; #if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference4) - case NRF_COMP_AIN4: + case COMP_NRF_COMP_EXTREFSEL_AIN4: *nrf = NRF_COMP_EXT_REF_4; break; #endif #if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference5) - case NRF_COMP_AIN5: + case COMP_NRF_COMP_EXTREFSEL_AIN5: *nrf = NRF_COMP_EXT_REF_5; break; #endif #if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference6) - case NRF_COMP_AIN6: + case COMP_NRF_COMP_EXTREFSEL_AIN6: *nrf = NRF_COMP_EXT_REF_6; break; #endif #if defined(COMP_EXTREFSEL_EXTREFSEL_AnalogReference7) - case NRF_COMP_AIN7: + case COMP_NRF_COMP_EXTREFSEL_AIN7: *nrf = NRF_COMP_EXT_REF_7; break; #endif diff --git a/drivers/comparator/comparator_nrf_lpcomp.c b/drivers/comparator/comparator_nrf_lpcomp.c index 6faba2b8669c..623c7adacd42 100644 --- a/drivers/comparator/comparator_nrf_lpcomp.c +++ b/drivers/comparator/comparator_nrf_lpcomp.c @@ -21,12 +21,14 @@ #define SHIM_NRF_LPCOMP_DT_INST_REFSEL_IS_AREF(inst) \ DT_INST_ENUM_HAS_VALUE(inst, refsel, aref) -#define SHIM_NRF_LPCOMP_DT_INST_EXTREFSEL(inst) DT_INST_PROP(inst, extrefsel) +#define SHIM_NRF_LPCOMP_DT_INST_EXTREFSEL(inst) \ + _CONCAT(COMP_NRF_LPCOMP_EXTREFSEL_, DT_INST_STRING_TOKEN(inst, extrefsel)) #define SHIM_NRF_LPCOMP_DT_INST_ENABLE_HYST(inst) \ DT_INST_PROP(inst, enable_hyst) -#define SHIM_NRF_LPCOMP_DT_INST_PSEL(inst) DT_INST_PROP(inst, psel) +#define SHIM_NRF_LPCOMP_DT_INST_PSEL(inst) \ + _CONCAT(COMP_NRF_LPCOMP_PSEL_, DT_INST_STRING_TOKEN(inst, psel)) struct shim_nrf_lpcomp_data { nrfx_lpcomp_config_t config; @@ -38,20 +40,10 @@ struct shim_nrf_lpcomp_data { }; #if (NRF_LPCOMP_HAS_AIN_AS_PIN) -BUILD_ASSERT(NRF_COMP_AIN0 == 0); -BUILD_ASSERT(NRF_COMP_AIN7 == 7); -#else -BUILD_ASSERT((NRF_COMP_AIN0 == NRF_LPCOMP_INPUT_0) && - (NRF_COMP_AIN1 == NRF_LPCOMP_INPUT_1) && - (NRF_COMP_AIN2 == NRF_LPCOMP_INPUT_2) && - (NRF_COMP_AIN3 == NRF_LPCOMP_INPUT_3) && - (NRF_COMP_AIN4 == NRF_LPCOMP_INPUT_4) && - (NRF_COMP_AIN5 == NRF_LPCOMP_INPUT_5) && - (NRF_COMP_AIN6 == NRF_LPCOMP_INPUT_6) && - (NRF_COMP_AIN7 == NRF_LPCOMP_INPUT_7) && - (NRF_COMP_AIN0 == NRF_LPCOMP_EXT_REF_REF0) && - (NRF_COMP_AIN1 == NRF_LPCOMP_EXT_REF_REF1), - "Definitions from nrf-comp.h do not match those from HAL"); +BUILD_ASSERT(COMP_NRF_LPCOMP_PSEL_AIN0 == 0); +BUILD_ASSERT(COMP_NRF_LPCOMP_PSEL_AIN7 == 7); +BUILD_ASSERT(COMP_NRF_LPCOMP_EXTREFSEL_AIN0 == 0); +BUILD_ASSERT(COMP_NRF_LPCOMP_EXTREFSEL_AIN1 == 1); #endif #if (LPCOMP_REFSEL_RESOLUTION == 8) @@ -134,50 +126,50 @@ static int shim_nrf_lpcomp_pm_callback(const struct device *dev, enum pm_device_ } #if (NRF_LPCOMP_HAS_AIN_AS_PIN) -static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, +static int shim_nrf_lpcomp_psel_to_nrf(enum comp_nrf_lpcomp_psel shim, nrf_lpcomp_input_t *nrf) { if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { return -EINVAL; } - *nrf = shim_nrf_comp_ain_map[shim]; + *nrf = shim_nrf_comp_ain_map[(uint32_t)shim]; return 0; } #else -static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, +static int shim_nrf_lpcomp_psel_to_nrf(enum comp_nrf_lpcomp_psel shim, nrf_lpcomp_input_t *nrf) { switch (shim) { - case NRF_COMP_AIN0: + case COMP_NRF_LPCOMP_PSEL_AIN0: *nrf = NRF_LPCOMP_INPUT_0; break; - case NRF_COMP_AIN1: + case COMP_NRF_LPCOMP_PSEL_AIN1: *nrf = NRF_LPCOMP_INPUT_1; break; - case NRF_COMP_AIN2: + case COMP_NRF_LPCOMP_PSEL_AIN2: *nrf = NRF_LPCOMP_INPUT_2; break; - case NRF_COMP_AIN3: + case COMP_NRF_LPCOMP_PSEL_AIN3: *nrf = NRF_LPCOMP_INPUT_3; break; - case NRF_COMP_AIN4: + case COMP_NRF_LPCOMP_PSEL_AIN4: *nrf = NRF_LPCOMP_INPUT_4; break; - case NRF_COMP_AIN5: + case COMP_NRF_LPCOMP_PSEL_AIN5: *nrf = NRF_LPCOMP_INPUT_5; break; - case NRF_COMP_AIN6: + case COMP_NRF_LPCOMP_PSEL_AIN6: *nrf = NRF_LPCOMP_INPUT_6; break; - case NRF_COMP_AIN7: + case COMP_NRF_LPCOMP_PSEL_AIN7: *nrf = NRF_LPCOMP_INPUT_7; break; @@ -190,7 +182,7 @@ static int shim_nrf_lpcomp_psel_to_nrf(uint8_t shim, #endif #if (NRF_LPCOMP_HAS_AIN_AS_PIN) -static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, +static int shim_nrf_lpcomp_extrefsel_to_nrf(enum comp_nrf_lpcomp_extrefsel shim, nrf_lpcomp_ext_ref_t *nrf) { if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) { @@ -201,15 +193,15 @@ static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, return 0; } #else -static int shim_nrf_lpcomp_extrefsel_to_nrf(uint8_t shim, +static int shim_nrf_lpcomp_extrefsel_to_nrf(enum comp_nrf_lpcomp_extrefsel shim, nrf_lpcomp_ext_ref_t *nrf) { switch (shim) { - case NRF_COMP_AIN0: + case COMP_NRF_LPCOMP_EXTREFSEL_AIN0: *nrf = NRF_LPCOMP_EXT_REF_REF0; break; - case NRF_COMP_AIN1: + case COMP_NRF_LPCOMP_EXTREFSEL_AIN1: *nrf = NRF_LPCOMP_EXT_REF_REF1; break; diff --git a/include/zephyr/drivers/comparator/nrf_comp.h b/include/zephyr/drivers/comparator/nrf_comp.h index 09c870f9a33c..59e1cbbb3ce9 100644 --- a/include/zephyr/drivers/comparator/nrf_comp.h +++ b/include/zephyr/drivers/comparator/nrf_comp.h @@ -7,13 +7,56 @@ #ifndef ZEPHYR_INCLUDE_DRIVERS_COMP_NRF_COMP_H_ #define ZEPHYR_INCLUDE_DRIVERS_COMP_NRF_COMP_H_ -#include #include #ifdef __cplusplus extern "C" { #endif +/** Positive input selection */ +enum comp_nrf_comp_psel { + /** AIN0 external input */ + COMP_NRF_COMP_PSEL_AIN0, + /** AIN1 external input */ + COMP_NRF_COMP_PSEL_AIN1, + /** AIN2 external input */ + COMP_NRF_COMP_PSEL_AIN2, + /** AIN3 external input */ + COMP_NRF_COMP_PSEL_AIN3, + /** AIN4 external input */ + COMP_NRF_COMP_PSEL_AIN4, + /** AIN5 external input */ + COMP_NRF_COMP_PSEL_AIN5, + /** AIN6 external input */ + COMP_NRF_COMP_PSEL_AIN6, + /** AIN7 external input */ + COMP_NRF_COMP_PSEL_AIN7, + /** VDD / 2 */ + COMP_NRF_COMP_PSEL_VDD_DIV2, + /** VDDH / 5 */ + COMP_NRF_COMP_PSEL_VDDH_DIV5, +}; + +/** External reference selection */ +enum comp_nrf_comp_extrefsel { + /** AIN0 external input */ + COMP_NRF_COMP_EXTREFSEL_AIN0, + /** AIN1 external input */ + COMP_NRF_COMP_EXTREFSEL_AIN1, + /** AIN2 external input */ + COMP_NRF_COMP_EXTREFSEL_AIN2, + /** AIN3 external input */ + COMP_NRF_COMP_EXTREFSEL_AIN3, + /** AIN4 external input */ + COMP_NRF_COMP_EXTREFSEL_AIN4, + /** AIN5 external input */ + COMP_NRF_COMP_EXTREFSEL_AIN5, + /** AIN6 external input */ + COMP_NRF_COMP_EXTREFSEL_AIN6, + /** AIN7 external input */ + COMP_NRF_COMP_EXTREFSEL_AIN7, +}; + /** Reference selection */ enum comp_nrf_comp_refsel { /** Internal 1.2V reference */ @@ -60,14 +103,14 @@ enum comp_nrf_comp_isource { * @note Hysteresis up in volts = ((th_up + 1) / 64) * ref */ struct comp_nrf_comp_se_config { - /** Positive input selection defined by the NRF_COMP_AIN defines */ - uint8_t psel; + /** Positive input selection */ + enum comp_nrf_comp_psel psel; /** Speed mode selection */ enum comp_nrf_comp_sp_mode sp_mode; /** Current source configuration */ enum comp_nrf_comp_isource isource; - /** External reference input selection defined by the NRF_COMP_AIN defines */ - uint8_t extrefsel; + /** External reference selection */ + enum comp_nrf_comp_extrefsel extrefsel; /** Reference selection */ enum comp_nrf_comp_refsel refsel; /** Hysteresis down threshold configuration */ @@ -90,14 +133,14 @@ int comp_nrf_comp_configure_se(const struct device *dev, /** Differential mode configuration structure */ struct comp_nrf_comp_diff_config { - /** Positive input selection defined by the NRF_COMP_AIN defines */ - uint8_t psel; + /** Positive input selection */ + enum comp_nrf_comp_psel psel; /** Speed mode selection */ enum comp_nrf_comp_sp_mode sp_mode; /** Current source configuration */ enum comp_nrf_comp_isource isource; - /** Negative input selection defined by the NRF_COMP_AIN defines */ - uint8_t extrefsel; + /** Negative input selection */ + enum comp_nrf_comp_extrefsel extrefsel; /** Hysteresis configuration */ bool enable_hyst; }; diff --git a/include/zephyr/drivers/comparator/nrf_lpcomp.h b/include/zephyr/drivers/comparator/nrf_lpcomp.h index 1cae4caae330..e1f2343a8de8 100644 --- a/include/zephyr/drivers/comparator/nrf_lpcomp.h +++ b/include/zephyr/drivers/comparator/nrf_lpcomp.h @@ -7,13 +7,40 @@ #ifndef ZEPHYR_INCLUDE_DRIVERS_COMP_NRF_LPCOMP_H_ #define ZEPHYR_INCLUDE_DRIVERS_COMP_NRF_LPCOMP_H_ -#include #include #ifdef __cplusplus extern "C" { #endif +/** Positive input selection */ +enum comp_nrf_lpcomp_psel { + /** AIN0 external input */ + COMP_NRF_LPCOMP_PSEL_AIN0, + /** AIN1 external input */ + COMP_NRF_LPCOMP_PSEL_AIN1, + /** AIN2 external input */ + COMP_NRF_LPCOMP_PSEL_AIN2, + /** AIN3 external input */ + COMP_NRF_LPCOMP_PSEL_AIN3, + /** AIN4 external input */ + COMP_NRF_LPCOMP_PSEL_AIN4, + /** AIN5 external input */ + COMP_NRF_LPCOMP_PSEL_AIN5, + /** AIN6 external input */ + COMP_NRF_LPCOMP_PSEL_AIN6, + /** AIN7 external input */ + COMP_NRF_LPCOMP_PSEL_AIN7, +}; + +/** External reference selection */ +enum comp_nrf_lpcomp_extrefsel { + /** AIN0 external input */ + COMP_NRF_LPCOMP_EXTREFSEL_AIN0, + /** AIN1 external input */ + COMP_NRF_LPCOMP_EXTREFSEL_AIN1, +}; + /** Reference selection */ enum comp_nrf_lpcomp_refsel { /** Use (VDD * (1/8)) as reference */ @@ -56,10 +83,10 @@ enum comp_nrf_lpcomp_refsel { * @note extrefsel is only used if refsel == COMP_NRF_LPCOMP_REFSEL_AREF */ struct comp_nrf_lpcomp_config { - /** Positive input selection defined by the NRF_COMP_AIN defines */ - uint8_t psel; - /** External reference input selection defined by the NRF_COMP_AIN defines */ - uint8_t extrefsel; + /** Positive input selection */ + enum comp_nrf_lpcomp_psel psel; + /** External reference selection */ + enum comp_nrf_lpcomp_extrefsel extrefsel; /** Reference selection */ enum comp_nrf_lpcomp_refsel refsel; /** Hysteresis configuration */ From 0c1fdb88b991b9cf8e3cc54b6d4d879d360b67a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1352/3334] Revert "[nrf fromlist] drivers: gpio: remove pad group integration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 30af3b334892439c2c4682ca148144f4aae2d27c. Signed-off-by: Tomasz Moń --- drivers/gpio/gpio_nrfx.c | 138 ++++++++++++++++++++++++++------------- 1 file changed, 92 insertions(+), 46 deletions(-) diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index fcf0b2f8d27c..6ccb378e161d 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -12,9 +12,16 @@ #include #include #include +#include #include +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_pad_group) +#define GPIO_HAS_PAD_GROUP 1 +#else +#define GPIO_HAS_PAD_GROUP 0 +#endif + #define GPIOTE_PHANDLE(id) DT_INST_PHANDLE(id, gpiote_instance) #define GPIOTE_PROP(idx, prop) DT_PROP(GPIOTE(idx), prop) @@ -48,6 +55,9 @@ struct gpio_nrfx_cfg { uint32_t edge_sense; uint8_t port_num; nrfx_gpiote_t gpiote; +#if GPIO_HAS_PAD_GROUP + const struct device *pad_group; +#endif #if defined(GPIOTE_FEATURE_FLAG) uint32_t flags; #endif @@ -68,34 +78,6 @@ static bool has_gpiote(const struct gpio_nrfx_cfg *cfg) return cfg->gpiote.p_reg != NULL; } -#if NRF_GPIO_HAS_RETENTION_SETCLEAR - -static void port_retain_set(const struct gpio_nrfx_cfg *cfg, uint32_t mask) -{ - nrf_gpio_port_retain_enable(cfg->port, mask); -} - -static void port_retain_clear(const struct gpio_nrfx_cfg *cfg, uint32_t mask) -{ - nrf_gpio_port_retain_disable(cfg->port, mask); -} - -#else - -static void port_retain_set(const struct gpio_nrfx_cfg *cfg, uint32_t mask) -{ - ARG_UNUSED(cfg); - ARG_UNUSED(mask); -} - -static void port_retain_clear(const struct gpio_nrfx_cfg *cfg, uint32_t mask) -{ - ARG_UNUSED(cfg); - ARG_UNUSED(mask); -} - -#endif - static nrf_gpio_pin_pull_t get_pull(gpio_flags_t flags) { if (flags & GPIO_PULL_UP) { @@ -118,6 +100,7 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, nrfx_gpiote_pin_t abs_pin = NRF_GPIO_PIN_MAP(cfg->port_num, pin); nrf_gpio_pin_pull_t pull = get_pull(flags); nrf_gpio_pin_drive_t drive; + int pm_ret; switch (flags & (NRF_GPIO_DRIVE_MSK | GPIO_OPEN_DRAIN)) { case NRF_GPIO_DRIVE_S0S1: @@ -148,7 +131,10 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, return -EINVAL; } - port_retain_clear(cfg, BIT(pin)); + ret = pm_device_runtime_get(port); + if (ret < 0) { + return ret; + } if (flags & GPIO_OUTPUT_INIT_HIGH) { nrf_gpio_port_out_set(cfg->port, BIT(pin)); @@ -210,8 +196,6 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, err = nrfx_gpiote_output_configure(&cfg->gpiote, abs_pin, &output_config, NULL); - - port_retain_set(cfg, BIT(pin)); } else { nrfx_gpiote_input_pin_config_t input_pin_config = { .p_pull_config = &pull, @@ -239,7 +223,9 @@ static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin, } end: - return ret; + pm_ret = pm_device_runtime_put(port); + + return (ret != 0) ? ret : pm_ret; } #ifdef CONFIG_GPIO_GET_CONFIG @@ -329,37 +315,49 @@ static int gpio_nrfx_port_set_masked_raw(const struct device *port, gpio_port_value_t value) { NRF_GPIO_Type *reg = get_port_cfg(port)->port; + int ret; const uint32_t set_mask = value & mask; const uint32_t clear_mask = (~set_mask) & mask; - port_retain_clear(get_port_cfg(port), mask); + ret = pm_device_runtime_get(port); + if (ret < 0) { + return ret; + } + nrf_gpio_port_out_set(reg, set_mask); nrf_gpio_port_out_clear(reg, clear_mask); - port_retain_set(get_port_cfg(port), mask); - return 0; + return pm_device_runtime_put(port); } static int gpio_nrfx_port_set_bits_raw(const struct device *port, gpio_port_pins_t mask) { NRF_GPIO_Type *reg = get_port_cfg(port)->port; + int ret; + + ret = pm_device_runtime_get(port); + if (ret < 0) { + return ret; + } - port_retain_clear(get_port_cfg(port), mask); nrf_gpio_port_out_set(reg, mask); - port_retain_set(get_port_cfg(port), mask); - return 0; + return pm_device_runtime_put(port); } static int gpio_nrfx_port_clear_bits_raw(const struct device *port, gpio_port_pins_t mask) { NRF_GPIO_Type *reg = get_port_cfg(port)->port; + int ret; + + ret = pm_device_runtime_get(port); + if (ret < 0) { + return ret; + } - port_retain_clear(get_port_cfg(port), mask); nrf_gpio_port_out_clear(reg, mask); - port_retain_set(get_port_cfg(port), mask); - return 0; + return pm_device_runtime_put(port); } static int gpio_nrfx_port_toggle_bits(const struct device *port, @@ -369,12 +367,16 @@ static int gpio_nrfx_port_toggle_bits(const struct device *port, const uint32_t value = nrf_gpio_port_out_read(reg) ^ mask; const uint32_t set_mask = value & mask; const uint32_t clear_mask = (~value) & mask; + int ret; + + ret = pm_device_runtime_get(port); + if (ret < 0) { + return ret; + } - port_retain_clear(get_port_cfg(port), mask); nrf_gpio_port_out_set(reg, set_mask); nrf_gpio_port_out_clear(reg, clear_mask); - port_retain_set(get_port_cfg(port), mask); - return 0; + return pm_device_runtime_put(port); } #ifdef CONFIG_GPIO_NRFX_INTERRUPT @@ -578,11 +580,47 @@ static void nrfx_gpio_handler(nrfx_gpiote_pin_t abs_pin, IRQ_CONNECT(DT_IRQN(node_id), DT_IRQ(node_id, priority), nrfx_isr, \ NRFX_CONCAT(nrfx_gpiote_, DT_PROP(node_id, instance), _irq_handler), 0); -static int gpio_nrfx_pm_hook(const struct device *port, enum pm_device_action action) +static int gpio_nrfx_pm_suspend(const struct device *port) { +#if GPIO_HAS_PAD_GROUP + const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); + + return pm_device_runtime_put(cfg->pad_group); +#else ARG_UNUSED(port); - ARG_UNUSED(action); return 0; +#endif +} + +static int gpio_nrfx_pm_resume(const struct device *port) +{ +#if GPIO_HAS_PAD_GROUP + const struct gpio_nrfx_cfg *cfg = get_port_cfg(port); + + return pm_device_runtime_get(cfg->pad_group); +#else + ARG_UNUSED(port); + return 0; +#endif +} + +static int gpio_nrfx_pm_hook(const struct device *port, enum pm_device_action action) +{ + int ret; + + switch (action) { + case PM_DEVICE_ACTION_SUSPEND: + ret = gpio_nrfx_pm_suspend(port); + break; + case PM_DEVICE_ACTION_RESUME: + ret = gpio_nrfx_pm_resume(port); + break; + default: + ret = -ENOTSUP; + break; + } + + return ret; } static int gpio_nrfx_init(const struct device *port) @@ -649,6 +687,13 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { "Please enable GPIOTE instance for used GPIO port!")), \ ()) +#if GPIO_HAS_PAD_GROUP +#define GPIO_NRF_PAD_GROUP_INIT(id) \ + .pad_group = DEVICE_DT_GET(DT_INST_CHILD(id, pad_group)), +#else +#define GPIO_NRF_PAD_GROUP_INIT(id) +#endif + #define GPIO_NRF_DEVICE(id) \ GPIOTE_CHECK(id); \ static const struct gpio_nrfx_cfg gpio_nrfx_p##id##_cfg = { \ @@ -660,6 +705,7 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { .port_num = DT_INST_PROP(id, port), \ .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ .gpiote = GPIOTE_INSTANCE(id), \ + GPIO_NRF_PAD_GROUP_INIT(id) \ IF_ENABLED(GPIOTE_FEATURE_FLAG, \ (.flags = \ (DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) ? \ From c87fbdc3420e068850342af5cc395f42250750e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1353/3334] Revert "[nrf fromlist] drivers: pinctrl: nrf: simplify pin retention" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 221141019a53b3687eb73ec31e44770b755f4458. Signed-off-by: Tomasz Moń --- drivers/pinctrl/pinctrl_nrf.c | 73 ++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index f960ce4d97a3..ac9b17d27b39 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -5,6 +5,7 @@ */ #include +#include #include #include @@ -110,23 +111,75 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = { #define NRF_PSEL_TDM(reg, line) ((NRF_TDM_Type *)reg)->PSEL.line #endif -#if NRF_GPIO_HAS_RETENTION_SETCLEAR +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_pad_group) +#define GPIO_HAS_PAD_GROUP 1 +#else +#define GPIO_HAS_PAD_GROUP 0 +#endif + +#if GPIO_HAS_PAD_GROUP + +#define GPIO_PAD_GROUP_GET_OR_NULL(idx, _) \ + DEVICE_DT_GET_OR_NULL(DT_NODELABEL(_CONCAT(gpio_pad_group, idx))) + +static const struct device *const pad_groups[] = { + LISTIFY(10, GPIO_PAD_GROUP_GET_OR_NULL, (,)) +}; + +static atomic_t pad_group_masks[ARRAY_SIZE(pad_groups)]; + +static int pad_group_request_pin(uint16_t pin_number) +{ + uint8_t port_number = NRF_GET_PORT(pin_number); + uint8_t port_pin_number = NRF_GET_PORT_PIN(pin_number); + const struct device *pad_group = pad_groups[port_number]; + atomic_t *pad_group_mask = &pad_group_masks[port_number]; + + if (atomic_test_and_set_bit(pad_group_mask, port_pin_number)) { + /* already requested */ + return 0; + } + + if (pm_device_runtime_get(pad_group)) { + atomic_clear_bit(pad_group_mask, port_pin_number); + return -EIO; + } + + return 0; +} -static void port_pin_retain_set(uint16_t pin_number, bool enable) +static int pad_group_release_pin(uint16_t pin_number) { - if (enable) { - nrf_gpio_pin_retain_enable(pin_number); - } else { - nrf_gpio_pin_retain_disable(pin_number); + uint8_t port_number = NRF_GET_PORT(pin_number); + uint8_t port_pin_number = NRF_GET_PORT_PIN(pin_number); + const struct device *pad_group = pad_groups[port_number]; + atomic_t *pad_group_mask = &pad_group_masks[port_number]; + + if (!atomic_test_and_clear_bit(pad_group_mask, port_pin_number)) { + /* already released */ + return 0; + } + + if (pm_device_runtime_put(pad_group)) { + atomic_set_bit(pad_group_mask, port_pin_number); + return -EIO; } + + return 0; } #else -static void port_pin_retain_set(uint16_t pin_number, bool enable) +static int pad_group_request_pin(uint16_t pin_number) { ARG_UNUSED(pin_number); - ARG_UNUSED(enable); + return 0; +} + +static int pad_group_release_pin(uint16_t pin_number) +{ + ARG_UNUSED(pin_number); + return 0; } #endif @@ -524,7 +577,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uint32_t pin = psel; /* enable pin */ - port_pin_retain_set(pin, false); + pad_group_request_pin(pin); if (write != NO_WRITE) { nrf_gpio_pin_write(pin, write); @@ -542,7 +595,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, if (NRF_GET_LP(pins[i]) == NRF_LP_ENABLE) { /* disable pin and pin clock */ - port_pin_retain_set(pin, true); + pad_group_release_pin(pin); port_pin_clock_set(pin, false); } else { /* configure pin clock */ From 289ab2491a3f25124db727a4f532236a7538a499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1354/3334] Revert "[nrf fromlist] dts: vendor: nordic: nrf54h: remove gpio-pad-groups" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba2b8455a16e25cfebb6ec6df682d3b422926e54. Signed-off-by: Tomasz Moń --- drivers/power_domain/CMakeLists.txt | 1 + drivers/power_domain/Kconfig | 1 + .../power_domain/Kconfig.nrf_gpio_pad_group | 7 ++ .../power_domain_nrf_gpio_pad_group.c | 82 +++++++++++++++++++ dts/arm/nordic/nrf54h20_cpuapp.dtsi | 24 ++++++ dts/arm/nordic/nrf54h20_cpurad.dtsi | 24 ++++++ .../gpio/nordic,nrf-gpio-pad-group.yaml | 43 ++++++++++ dts/vendor/nordic/nrf54h20.dtsi | 42 ++++++++++ 8 files changed, 224 insertions(+) create mode 100644 drivers/power_domain/Kconfig.nrf_gpio_pad_group create mode 100644 drivers/power_domain/power_domain_nrf_gpio_pad_group.c create mode 100644 dts/bindings/gpio/nordic,nrf-gpio-pad-group.yaml diff --git a/drivers/power_domain/CMakeLists.txt b/drivers/power_domain/CMakeLists.txt index 2749a32d5d63..e4a7c7dbc28b 100644 --- a/drivers/power_domain/CMakeLists.txt +++ b/drivers/power_domain/CMakeLists.txt @@ -9,6 +9,7 @@ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_INTEL_ADSP power_domain_intel_a zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NXP_SCU power_domain_nxp_scu.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_GDPWR power_domain_nrfs_gdpwr.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_SWEXT power_domain_nrfs_swext.c) +zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRF_GPIO_PAD_GROUP power_domain_nrf_gpio_pad_group.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SOC_PM_STATE power_domain_soc_state_change.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_TISCI power_domain_tisci.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SILABS_SIWX91X power_domain_silabs_siwx91x.c) diff --git a/drivers/power_domain/Kconfig b/drivers/power_domain/Kconfig index 3de9185761c0..ce6fb4d42db8 100644 --- a/drivers/power_domain/Kconfig +++ b/drivers/power_domain/Kconfig @@ -125,6 +125,7 @@ endif #POWER_DOMAIN_TISCI rsource "Kconfig.nrfs_gdpwr" rsource "Kconfig.nrfs_swext" +rsource "Kconfig.nrf_gpio_pad_group" rsource "Kconfig.silabs_siwx91x" endif diff --git a/drivers/power_domain/Kconfig.nrf_gpio_pad_group b/drivers/power_domain/Kconfig.nrf_gpio_pad_group new file mode 100644 index 000000000000..1b36c0cc7e08 --- /dev/null +++ b/drivers/power_domain/Kconfig.nrf_gpio_pad_group @@ -0,0 +1,7 @@ +# Copyright 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config POWER_DOMAIN_NRF_GPIO_PAD_GROUP + bool "NRFS Global Domain Power Request driver" + depends on DT_HAS_NORDIC_NRF_GPIO_PAD_GROUP_ENABLED + default y diff --git a/drivers/power_domain/power_domain_nrf_gpio_pad_group.c b/drivers/power_domain/power_domain_nrf_gpio_pad_group.c new file mode 100644 index 000000000000..06b40d9d5840 --- /dev/null +++ b/drivers/power_domain/power_domain_nrf_gpio_pad_group.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#define DT_DRV_COMPAT nordic_nrf_gpio_pad_group + +#include +#include +#include +#include + +#include + +LOG_MODULE_REGISTER(nrf_gpio_pad_group, CONFIG_POWER_DOMAIN_LOG_LEVEL); + +struct nrf_port_retain_config { + NRF_GPIO_Type *regs; + uint32_t retain_mask; +}; + +static void nrf_port_retain_driver_turn_off(const struct device *dev) +{ + const struct nrf_port_retain_config *dev_config = dev->config; + + LOG_DBG("%s pads 0x%08x retain %s", dev->name, dev_config->retain_mask, "enable"); + nrf_gpio_port_retain_enable(dev_config->regs, dev_config->retain_mask); +} + +static void nrf_port_retain_driver_turn_on(const struct device *dev) +{ + const struct nrf_port_retain_config *dev_config = dev->config; + + LOG_DBG("%s pads 0x%08x retain %s", dev->name, dev_config->retain_mask, "disable"); + nrf_gpio_port_retain_disable(dev_config->regs, dev_config->retain_mask); +} + +static int nrf_port_retain_driver_pm_action(const struct device *dev, + enum pm_device_action action) +{ + switch (action) { + case PM_DEVICE_ACTION_TURN_OFF: + nrf_port_retain_driver_turn_off(dev); + break; + + case PM_DEVICE_ACTION_TURN_ON: + nrf_port_retain_driver_turn_on(dev); + break; + + default: + break; + }; + + return 0; +} + +static int nrf_port_retain_driver_init(const struct device *dev) +{ + return pm_device_driver_init(dev, nrf_port_retain_driver_pm_action); +} + +#define NRF_GPIO_PAD_GROUP_DEFINE(inst) \ + static const struct nrf_port_retain_config _CONCAT(config, inst) = { \ + .regs = (NRF_GPIO_Type *)DT_REG_ADDR(DT_INST_PARENT(inst)), \ + .retain_mask = DT_INST_PROP_OR(inst, retain_mask, UINT32_MAX), \ + }; \ + \ + PM_DEVICE_DT_INST_DEFINE(inst, nrf_port_retain_driver_pm_action); \ + \ + DEVICE_DT_INST_DEFINE( \ + inst, \ + nrf_port_retain_driver_init, \ + PM_DEVICE_DT_INST_GET(inst), \ + NULL, \ + &_CONCAT(config, inst), \ + PRE_KERNEL_1, \ + UTIL_INC(CONFIG_GPIO_INIT_PRIORITY), \ + NULL \ + ); + +DT_INST_FOREACH_STATUS_OKAY(NRF_GPIO_PAD_GROUP_DEFINE) diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index f3b8e4f8c08c..1e6eb128443d 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -102,3 +102,27 @@ wdt011: &cpuapp_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; + +&gpio_pad_group0 { + status = "okay"; +}; + +&gpio_pad_group1 { + status = "okay"; +}; + +&gpio_pad_group2 { + status = "okay"; +}; + +&gpio_pad_group6 { + status = "okay"; +}; + +&gpio_pad_group7 { + status = "okay"; +}; + +&gpio_pad_group9 { + status = "okay"; +}; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index cc7b0a97b513..378d27c3fd62 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -143,3 +143,27 @@ wdt011: &cpurad_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; + +&gpio_pad_group0 { + status = "okay"; +}; + +&gpio_pad_group1 { + status = "okay"; +}; + +&gpio_pad_group2 { + status = "okay"; +}; + +&gpio_pad_group6 { + status = "okay"; +}; + +&gpio_pad_group7 { + status = "okay"; +}; + +&gpio_pad_group9 { + status = "okay"; +}; diff --git a/dts/bindings/gpio/nordic,nrf-gpio-pad-group.yaml b/dts/bindings/gpio/nordic,nrf-gpio-pad-group.yaml new file mode 100644 index 000000000000..104277addd35 --- /dev/null +++ b/dts/bindings/gpio/nordic,nrf-gpio-pad-group.yaml @@ -0,0 +1,43 @@ +# Copyright 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Nordic nRF GPIO pad group. + + The GPIO pad group describes the pads (package + pins of the SoC) the GPIO controller manages. + + The pads may be in a different power domain than + the GPIO controller, and may require enabling + retention to preserve the GPIO configuration if + the power domain is suspended. + + The GPIO pad group is a child node of the GPIO + controller which manages the pad group, named + pad-group. The pad group's nodelabel is named + gpio_pad_group. + + Example layout: + + gpio0: gpio@938000 { + compatible = "nordic,nrf-gpio"; + + ... + + gpio_pad_group0: pad-group { + compatible = "nordic,nrf-gpio-pad-group"; + power-domains = <&gdpwr_slow_main>; + retain-mask = <0xFFF>; + }; + }; + +compatible: "nordic,nrf-gpio-pad-group" + +include: base.yaml + +properties: + retain-mask: + type: int + description: | + Mask of pins which shall be retained if pad + group's power domain is powered off. diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 06a7fe4d2495..e98693d1be97 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -908,6 +908,13 @@ ngpios = <12>; port = <0>; zephyr,pm-device-runtime-auto; + + gpio_pad_group0: pad-group { + compatible = "nordic,nrf-gpio-pad-group"; + retain-mask = <0xFFF>; + zephyr,pm-device-runtime-auto; + status = "disabled"; + }; }; gpio1: gpio@938200 { @@ -920,6 +927,13 @@ ngpios = <12>; port = <1>; zephyr,pm-device-runtime-auto; + + gpio_pad_group1: pad-group { + compatible = "nordic,nrf-gpio-pad-group"; + retain-mask = <0xFFF>; + zephyr,pm-device-runtime-auto; + status = "disabled"; + }; }; gpio2: gpio@938400 { @@ -932,6 +946,13 @@ ngpios = <12>; port = <2>; zephyr,pm-device-runtime-auto; + + gpio_pad_group2: pad-group { + compatible = "nordic,nrf-gpio-pad-group"; + retain-mask = <0xFFF>; + zephyr,pm-device-runtime-auto; + status = "disabled"; + }; }; gpio6: gpio@938c00 { @@ -943,6 +964,13 @@ ngpios = <14>; port = <6>; zephyr,pm-device-runtime-auto; + + gpio_pad_group6: pad-group { + compatible = "nordic,nrf-gpio-pad-group"; + retain-mask = <0x3FFF>; + zephyr,pm-device-runtime-auto; + status = "disabled"; + }; }; gpio7: gpio@938e00 { @@ -954,6 +982,13 @@ ngpios = <8>; port = <7>; zephyr,pm-device-runtime-auto; + + gpio_pad_group7: pad-group { + compatible = "nordic,nrf-gpio-pad-group"; + retain-mask = <0xFF>; + zephyr,pm-device-runtime-auto; + status = "disabled"; + }; }; gpio9: gpio@939200 { @@ -966,6 +1001,13 @@ ngpios = <6>; port = <9>; zephyr,pm-device-runtime-auto; + + gpio_pad_group9: pad-group { + compatible = "nordic,nrf-gpio-pad-group"; + retain-mask = <0x3F>; + zephyr,pm-device-runtime-auto; + status = "disabled"; + }; }; dppic131: dppic@981000 { From 0d32d1dfb9a9c3ac4c66c56ee944f2728b137057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1355/3334] Revert "[nrf fromtree] drivers: power_domain: nrf_gpio_pad_group: Fix DT macro" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4f29999e683ea62b19c84c53cc8f3b6b9da2d116. Signed-off-by: Tomasz Moń --- drivers/power_domain/power_domain_nrf_gpio_pad_group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power_domain/power_domain_nrf_gpio_pad_group.c b/drivers/power_domain/power_domain_nrf_gpio_pad_group.c index 06b40d9d5840..8b4119312c10 100644 --- a/drivers/power_domain/power_domain_nrf_gpio_pad_group.c +++ b/drivers/power_domain/power_domain_nrf_gpio_pad_group.c @@ -63,7 +63,7 @@ static int nrf_port_retain_driver_init(const struct device *dev) #define NRF_GPIO_PAD_GROUP_DEFINE(inst) \ static const struct nrf_port_retain_config _CONCAT(config, inst) = { \ .regs = (NRF_GPIO_Type *)DT_REG_ADDR(DT_INST_PARENT(inst)), \ - .retain_mask = DT_INST_PROP_OR(inst, retain_mask, UINT32_MAX), \ + .retain_mask = DT_PROP_OR(inst, retain_mask, UINT32_MAX), \ }; \ \ PM_DEVICE_DT_INST_DEFINE(inst, nrf_port_retain_driver_pm_action); \ From 44a42911eec506224c69e52b68b0904eb7a718a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1356/3334] Revert "[nrf fromtree] drivers: power_domain: introduce nrfs_swext device driver" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6c2dcd4fb03e7d719ef3df4b538213ff0f4d9c3e. Signed-off-by: Tomasz Moń --- drivers/power_domain/CMakeLists.txt | 1 - drivers/power_domain/Kconfig | 1 - drivers/power_domain/Kconfig.nrfs_swext | 9 - .../power_domain/power_domain_nrfs_swext.c | 200 ------------------ 4 files changed, 211 deletions(-) delete mode 100644 drivers/power_domain/Kconfig.nrfs_swext delete mode 100644 drivers/power_domain/power_domain_nrfs_swext.c diff --git a/drivers/power_domain/CMakeLists.txt b/drivers/power_domain/CMakeLists.txt index e4a7c7dbc28b..3b7ba378f9e3 100644 --- a/drivers/power_domain/CMakeLists.txt +++ b/drivers/power_domain/CMakeLists.txt @@ -8,7 +8,6 @@ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_GPIO_MONITOR power_domain_gpio_ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_INTEL_ADSP power_domain_intel_adsp.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NXP_SCU power_domain_nxp_scu.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_GDPWR power_domain_nrfs_gdpwr.c) -zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_SWEXT power_domain_nrfs_swext.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRF_GPIO_PAD_GROUP power_domain_nrf_gpio_pad_group.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SOC_PM_STATE power_domain_soc_state_change.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_TISCI power_domain_tisci.c) diff --git a/drivers/power_domain/Kconfig b/drivers/power_domain/Kconfig index ce6fb4d42db8..2c3592c773db 100644 --- a/drivers/power_domain/Kconfig +++ b/drivers/power_domain/Kconfig @@ -124,7 +124,6 @@ config SOC_POWER_DOMAIN_INIT endif #POWER_DOMAIN_TISCI rsource "Kconfig.nrfs_gdpwr" -rsource "Kconfig.nrfs_swext" rsource "Kconfig.nrf_gpio_pad_group" rsource "Kconfig.silabs_siwx91x" diff --git a/drivers/power_domain/Kconfig.nrfs_swext b/drivers/power_domain/Kconfig.nrfs_swext deleted file mode 100644 index 1a2c5d2d895e..000000000000 --- a/drivers/power_domain/Kconfig.nrfs_swext +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config POWER_DOMAIN_NRFS_SWEXT - bool "NRFS SWEXT power domain driver" - depends on DT_HAS_NORDIC_NRFS_SWEXT_ENABLED - select NRFS - select NRFS_SWEXT_SERVICE_ENABLED - default y diff --git a/drivers/power_domain/power_domain_nrfs_swext.c b/drivers/power_domain/power_domain_nrfs_swext.c deleted file mode 100644 index 900fe4f7a8e6..000000000000 --- a/drivers/power_domain/power_domain_nrfs_swext.c +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrfs_swext - -#include -#include -#include -#include - -#include -#include - -LOG_MODULE_REGISTER(nrfs_swext, CONFIG_POWER_DOMAIN_LOG_LEVEL); - -BUILD_ASSERT( - DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, - "multiple instances not supported" -); - -struct nrfs_swext_data { - struct k_sem evt_sem; - nrfs_swext_evt_type_t evt; -}; - -struct nrfs_swext_config { - uint16_t current_limit_ua; - bool enable_power_down_clamp; -}; - -static void nrfs_swext_driver_evt_handler(nrfs_swext_evt_t const *p_evt, void *context) -{ - struct nrfs_swext_data *dev_data = context; - - LOG_DBG("evt %u", (uint32_t)p_evt->type); - - if (p_evt->type == NRFS_SWEXT_EVT_OVERCURRENT) { - /* Overcurrent is an unrecoverable condition which requires hardware fix */ - LOG_ERR("overcurrent"); - k_panic(); - }; - - dev_data->evt = p_evt->type; - k_sem_give(&dev_data->evt_sem); -} - -static int nrfs_swext_driver_power_down(const struct device *dev) -{ - const struct nrfs_swext_config *dev_config = dev->config; - nrfs_err_t err; - swext_pd_clamp_t pd_clamp = dev_config->enable_power_down_clamp - ? SWEXT_PD_CLAMP_ENABLED - : SWEXT_PD_CLAMP_DISABLED; - - /* - * Power down request does not respond with an event. - * Set context to NULL, fire and forget. - */ - err = nrfs_swext_power_down(pd_clamp, NULL); - if (err != NRFS_SUCCESS) { - LOG_ERR("failed to request power down"); - return -ENODEV; - } - - return 0; -} - -static int nrfs_swext_driver_power_up(const struct device *dev) -{ - struct nrfs_swext_data *dev_data = dev->data; - const struct nrfs_swext_config *dev_config = dev->config; - nrfs_err_t err; - uint8_t load_current; - - load_current = nrfs_swext_load_current_to_raw(dev_config->current_limit_ua); - err = nrfs_swext_power_up(load_current, dev_data); - if (err != NRFS_SUCCESS) { - LOG_ERR("failed to request power up"); - return -ENODEV; - } - - (void)k_sem_take(&dev_data->evt_sem, K_FOREVER); - - if (dev_data->evt == NRFS_SWEXT_EVT_ENABLED) { - return 0; - } - - LOG_ERR("power up request rejected"); - return -EIO; -} - -#if IS_ENABLED(CONFIG_DEVICE_DEPS) && IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN) -static void nrfs_swext_driver_notify_children(const struct device *dev, - enum pm_device_action action) -{ - pm_device_children_action_run(dev, action, NULL); -} -#else -static void nrfs_swext_driver_notify_children(const struct device *dev, - enum pm_device_action action) -{ - ARG_UNUSED(dev); - ARG_UNUSED(action); -} -#endif - -static int nrfs_swext_driver_suspend(const struct device *dev) -{ - int ret; - - nrfs_swext_driver_notify_children(dev, PM_DEVICE_ACTION_TURN_OFF); - - ret = nrfs_swext_driver_power_down(dev); - if (ret) { - nrfs_swext_driver_notify_children(dev, PM_DEVICE_ACTION_TURN_ON); - } - - return ret; -} - -static int nrfs_swext_driver_resume(const struct device *dev) -{ - int ret; - - ret = nrfs_swext_driver_power_up(dev); - if (ret == 0) { - nrfs_swext_driver_notify_children(dev, PM_DEVICE_ACTION_TURN_ON); - } - - return ret; -} - -static int nrfs_swext_driver_pm_action(const struct device *dev, - enum pm_device_action action) -{ - int ret; - - switch (action) { - case PM_DEVICE_ACTION_SUSPEND: - ret = nrfs_swext_driver_suspend(dev); - break; - - case PM_DEVICE_ACTION_RESUME: - ret = nrfs_swext_driver_resume(dev); - break; - - default: - ret = -ENOTSUP; - break; - }; - - return ret; -} - -static int nrfs_swext_driver_init(const struct device *dev) -{ - struct nrfs_swext_data *dev_data = dev->data; - nrfs_err_t err; - - LOG_DBG("waiting for nrfs backend connected"); - err = nrfs_backend_wait_for_connection(K_FOREVER); - if (err != NRFS_SUCCESS) { - LOG_ERR("nrfs backend not connected"); - return -ENODEV; - } - - err = nrfs_swext_init(nrfs_swext_driver_evt_handler); - if (err != NRFS_SUCCESS) { - LOG_ERR("failed to init swext service"); - return -ENODEV; - } - - k_sem_init(&dev_data->evt_sem, 0, 1); - return pm_device_driver_init(dev, nrfs_swext_driver_pm_action); -} - -PM_DEVICE_DT_INST_DEFINE(0, nrfs_swext_driver_pm_action); - -BUILD_ASSERT(DT_INST_PROP(0, max_current_ua) <= UINT16_MAX); -BUILD_ASSERT(DT_INST_PROP(0, current_limit_ua) <= DT_INST_PROP(0, max_current_ua)); - -static struct nrfs_swext_data data0; -static const struct nrfs_swext_config config0 = { - .current_limit_ua = DT_INST_PROP(0, current_limit_ua), - .enable_power_down_clamp = DT_INST_PROP(0, power_down_clamp), -}; - -DEVICE_DT_INST_DEFINE( - 0, - nrfs_swext_driver_init, - PM_DEVICE_DT_INST_GET(0), - &data0, - &config0, - POST_KERNEL, - UTIL_INC(CONFIG_NRFS_BACKEND_IPC_SERVICE_INIT_PRIO), - NULL -); From a9c929e8bec23d091e49b32d2b7258743e5eea2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1357/3334] Revert "[nrf fromtree] drivers: power_domain: siwx91x: Add power domain driver for siwx91x SoC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f36e76fac6278251b07d96dec0822f7148704715. Signed-off-by: Tomasz Moń --- drivers/power_domain/CMakeLists.txt | 1 - drivers/power_domain/Kconfig | 1 - drivers/power_domain/Kconfig.silabs_siwx91x | 16 ------- .../power_domain_silabs_siwx91x.c | 42 ------------------- dts/arm/silabs/siwg917.dtsi | 13 ------ .../silabs,siwx91x-power-domain.yaml | 5 --- 6 files changed, 78 deletions(-) delete mode 100644 drivers/power_domain/Kconfig.silabs_siwx91x delete mode 100644 drivers/power_domain/power_domain_silabs_siwx91x.c delete mode 100644 dts/bindings/power-domain/silabs,siwx91x-power-domain.yaml diff --git a/drivers/power_domain/CMakeLists.txt b/drivers/power_domain/CMakeLists.txt index 3b7ba378f9e3..357efe6f4ab7 100644 --- a/drivers/power_domain/CMakeLists.txt +++ b/drivers/power_domain/CMakeLists.txt @@ -11,4 +11,3 @@ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_GDPWR power_domain_nrfs_gd zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRF_GPIO_PAD_GROUP power_domain_nrf_gpio_pad_group.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SOC_PM_STATE power_domain_soc_state_change.c) zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_TISCI power_domain_tisci.c) -zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SILABS_SIWX91X power_domain_silabs_siwx91x.c) diff --git a/drivers/power_domain/Kconfig b/drivers/power_domain/Kconfig index 2c3592c773db..7b336700dd6e 100644 --- a/drivers/power_domain/Kconfig +++ b/drivers/power_domain/Kconfig @@ -125,6 +125,5 @@ endif #POWER_DOMAIN_TISCI rsource "Kconfig.nrfs_gdpwr" rsource "Kconfig.nrf_gpio_pad_group" -rsource "Kconfig.silabs_siwx91x" endif diff --git a/drivers/power_domain/Kconfig.silabs_siwx91x b/drivers/power_domain/Kconfig.silabs_siwx91x deleted file mode 100644 index 3fa95f335538..000000000000 --- a/drivers/power_domain/Kconfig.silabs_siwx91x +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2025 Silicon Laboratories Inc. -# SPDX-License-Identifier: Apache-2.0 - -config POWER_DOMAIN_SILABS_SIWX91X - bool "Silabs siwx91x power domain driver" - default y - select DEVICE_DEPS - depends on DT_HAS_SILABS_SIWX91X_POWER_DOMAIN_ENABLED - help - Driver for Silabs siwx91x power domain. - -config SIWX91X_POWER_DOMAIN_INIT_PRIORITY - int "Silabs siwx91x power domain init priority" - default 10 - help - Silabs siwx91x power domain initialization priority. diff --git a/drivers/power_domain/power_domain_silabs_siwx91x.c b/drivers/power_domain/power_domain_silabs_siwx91x.c deleted file mode 100644 index 8350e8a25e15..000000000000 --- a/drivers/power_domain/power_domain_silabs_siwx91x.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 Silicon Laboratories Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -#define DT_DRV_COMPAT silabs_siwx91x_power_domain - -static int siwx91x_pd_pm_action(const struct device *dev, enum pm_device_action action) -{ - switch (action) { - case PM_DEVICE_ACTION_RESUME: - pm_device_children_action_run(dev, PM_DEVICE_ACTION_TURN_ON, NULL); - break; - case PM_DEVICE_ACTION_SUSPEND: - pm_device_children_action_run(dev, PM_DEVICE_ACTION_TURN_OFF, NULL); - break; - case PM_DEVICE_ACTION_TURN_ON: - break; - case PM_DEVICE_ACTION_TURN_OFF: - break; - default: - return -ENOTSUP; - } - - return 0; -} - -static int siwx91x_pd_init(const struct device *dev) -{ - return pm_device_driver_init(dev, siwx91x_pd_pm_action); -} - -#define SIWX91X_PD_INIT(inst) \ - PM_DEVICE_DT_INST_DEFINE(inst, siwx91x_pd_pm_action); \ - DEVICE_DT_INST_DEFINE(inst, siwx91x_pd_init, PM_DEVICE_DT_INST_GET(inst), NULL, NULL, \ - PRE_KERNEL_1, CONFIG_SIWX91X_POWER_DOMAIN_INIT_PRIORITY, NULL); - -DT_INST_FOREACH_STATUS_OKAY(SIWX91X_PD_INIT) diff --git a/dts/arm/silabs/siwg917.dtsi b/dts/arm/silabs/siwg917.dtsi index 9cc9f358f048..ceb79d35152c 100644 --- a/dts/arm/silabs/siwg917.dtsi +++ b/dts/arm/silabs/siwg917.dtsi @@ -124,13 +124,6 @@ status = "disabled"; }; - siwx91x_soc_pd: siwx91x-soc-pd { - compatible = "silabs,siwx91x-power-domain"; - #power-domain-cells = <0>; - zephyr,pm-device-runtime-auto; - status = "okay"; - }; - ulpuart: uart@24041800 { compatible = "ns16550"; reg = <0x24041800 0x1000>; @@ -138,8 +131,6 @@ reg-shift = <2>; clocks = <&clock0 SIWX91X_CLK_ULP_UART>; current-speed = <115200>; - power-domains = <&siwx91x_soc_pd>; - zephyr,pm-device-runtime-auto; status = "disabled"; }; @@ -150,8 +141,6 @@ reg-shift = <2>; clocks = <&clock0 SIWX91X_CLK_UART0>; current-speed = <115200>; - power-domains = <&siwx91x_soc_pd>; - zephyr,pm-device-runtime-auto; status = "disabled"; }; @@ -162,8 +151,6 @@ reg-shift = <2>; clocks = <&clock0 SIWX91X_CLK_UART1>; current-speed = <115200>; - power-domains = <&siwx91x_soc_pd>; - zephyr,pm-device-runtime-auto; status = "disabled"; }; diff --git a/dts/bindings/power-domain/silabs,siwx91x-power-domain.yaml b/dts/bindings/power-domain/silabs,siwx91x-power-domain.yaml deleted file mode 100644 index cd0bafa8237e..000000000000 --- a/dts/bindings/power-domain/silabs,siwx91x-power-domain.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Silabs siwx91x soc power domain - -compatible: "silabs,siwx91x-power-domain" - -include: power-domain.yaml From 52011f75618a0a3c1e23d3c9c43766efe81781da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1358/3334] Revert "[nrf fromtree] devicetree: format files in dts/arm/nordic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 345a9f6fe5e466ac6537f83a3f1b5bc5df9c4f4b. Signed-off-by: Tomasz Moń --- dts/arm/nordic/nrf51822.dtsi | 1 + dts/arm/nordic/nrf52805.dtsi | 1 + dts/arm/nordic/nrf52810.dtsi | 2 +- dts/arm/nordic/nrf52811.dtsi | 3 ++- dts/arm/nordic/nrf52820.dtsi | 2 ++ dts/arm/nordic/nrf52832.dtsi | 1 + dts/arm/nordic/nrf52833.dtsi | 1 + dts/arm/nordic/nrf52840.dtsi | 1 + dts/arm/nordic/nrf52840_qfaa.dtsi | 1 + dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi | 1 + dts/arm/nordic/nrf5340_cpunet.dtsi | 1 + dts/arm/nordic/nrf54h20_cpuapp.dtsi | 13 +++---------- dts/arm/nordic/nrf54h20_cpurad.dtsi | 13 +++---------- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +--- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 2 -- dts/arm/nordic/nrf91.dtsi | 2 +- dts/arm/nordic/nrf91_peripherals.dtsi | 1 + dts/arm/nordic/nrf9280_cpuapp.dtsi | 6 ------ dts/arm/nordic/nrf9280_cpurad.dtsi | 6 ------ 19 files changed, 22 insertions(+), 40 deletions(-) diff --git a/dts/arm/nordic/nrf51822.dtsi b/dts/arm/nordic/nrf51822.dtsi index 8f262909d61f..cbfef90faa5b 100644 --- a/dts/arm/nordic/nrf51822.dtsi +++ b/dts/arm/nordic/nrf51822.dtsi @@ -311,6 +311,7 @@ #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <1024>; diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index e940c7a2cdf2..45a54f97b061 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -320,6 +320,7 @@ #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index c1e5f8763172..217758dd1614 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -180,7 +180,6 @@ #io-channel-cells = <1>; zephyr,pm-device-runtime-auto; }; - timer0: timer@40008000 { compatible = "nordic,nrf-timer"; status = "disabled"; @@ -346,6 +345,7 @@ #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 33f6ac38747a..670f569c0ace 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -159,7 +159,7 @@ }; spi1: spi@40003000 { - /* cannot be used with i2c0 */ + /* cannot be used with i2c0 */ /* * This spi node can be SPI, SPIM, or SPIS, * for the user to pick: @@ -377,6 +377,7 @@ #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index 1073b973c22a..50c8d2ba07f0 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -9,6 +9,7 @@ #include / { + chosen { zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; @@ -388,6 +389,7 @@ #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index 09a651762db6..7bd62c707545 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -412,6 +412,7 @@ #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 87e6bccfb53d..8202ddc45431 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -434,6 +434,7 @@ #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index c0a2545f0137..dab5f7620585 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -421,6 +421,7 @@ #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf52840_qfaa.dtsi b/dts/arm/nordic/nrf52840_qfaa.dtsi index 6d549a45d1dd..85acf5ab4685 100644 --- a/dts/arm/nordic/nrf52840_qfaa.dtsi +++ b/dts/arm/nordic/nrf52840_qfaa.dtsi @@ -19,6 +19,7 @@ soc { compatible = "simple-bus"; }; + }; /delete-node/ &usbd; diff --git a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi index ea56b3206bcc..7021b7eedeb1 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi @@ -536,6 +536,7 @@ flash_controller: flash-controller@39000 { #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 5010f801e0c0..4f9164767f1a 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -309,6 +309,7 @@ #address-cells = <1>; #size-cells = <1>; + flash1: flash@1000000 { compatible = "soc-nv-flash"; erase-block-size = <2048>; diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index 1e6eb128443d..9e790656e501 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -7,19 +7,12 @@ #include cpu: &cpuapp {}; - systick: &cpuapp_systick {}; - nvic: &cpuapp_nvic {}; - cpuppr_vevif: &cpuppr_vevif_tx {}; - cpuflpr_vevif: &cpuflpr_vevif_tx {}; - cpusys_vevif: &cpusys_vevif_tx {}; - wdt010: &cpuapp_wdt010 {}; - wdt011: &cpuapp_wdt011 {}; /delete-node/ &cpuppr; @@ -67,15 +60,15 @@ wdt011: &cpuapp_wdt011 {}; interrupts = <109 NRF_DEFAULT_IRQ_PRIORITY>; }; -&fll16m { +&fll16m { status = "okay"; }; -&hsfll120 { +&hsfll120 { status = "okay"; }; -&lfclk { +&lfclk { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 378d27c3fd62..f7f7464f91c2 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -7,19 +7,12 @@ #include cpu: &cpurad {}; - systick: &cpurad_systick {}; - nvic: &cpurad_nvic {}; - cpuppr_vevif: &cpuppr_vevif_tx {}; - cpuflpr_vevif: &cpuflpr_vevif_tx {}; - cpusys_vevif: &cpusys_vevif_tx {}; - wdt010: &cpurad_wdt010 {}; - wdt011: &cpurad_wdt011 {}; /delete-node/ &cpuapp; @@ -108,15 +101,15 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&fll16m { +&fll16m { status = "okay"; }; -&hsfll120 { +&hsfll120 { status = "okay"; }; -&lfclk { +&lfclk { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index ee8be4b8d765..3f1fe655b6e5 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -5,9 +5,7 @@ */ cpu: &cpuapp {}; - systick: &cpuapp_systick {}; - nvic: &cpuapp_nvic {}; /delete-node/ &cpuflpr; @@ -74,7 +72,7 @@ nvic: &cpuapp_nvic {}; #else interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>, #endif - <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ + <229 NRF_DEFAULT_IRQ_PRIORITY>; /* reserved for Zero Latency IRQs */ }; &gpiote20 { diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index d5aa024dd6d3..dc13fb40d6aa 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -7,9 +7,7 @@ #include cpu: &cpuapp {}; - systick: &cpuapp_systick {}; - nvic: &cpuapp_nvic {}; /delete-node/ &cpuflpr; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 2ef4b9bbab20..1747dcea74a9 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -65,7 +65,7 @@ * so we give it the 'gpiote' label for use when building * code for this target. */ - gpiote: gpiote0: gpiote@5000d000 { + gpiote: gpiote0: gpiote@5000d000 { compatible = "nordic,nrf-gpiote"; reg = <0x5000d000 0x1000>; interrupts = <13 5>; diff --git a/dts/arm/nordic/nrf91_peripherals.dtsi b/dts/arm/nordic/nrf91_peripherals.dtsi index 3e7e42472b9b..476f8415853a 100644 --- a/dts/arm/nordic/nrf91_peripherals.dtsi +++ b/dts/arm/nordic/nrf91_peripherals.dtsi @@ -12,6 +12,7 @@ flash_controller: flash-controller@39000 { #address-cells = <1>; #size-cells = <1>; + flash0: flash@0 { compatible = "soc-nv-flash"; erase-block-size = <4096>; diff --git a/dts/arm/nordic/nrf9280_cpuapp.dtsi b/dts/arm/nordic/nrf9280_cpuapp.dtsi index 01716a656785..29edae31051d 100644 --- a/dts/arm/nordic/nrf9280_cpuapp.dtsi +++ b/dts/arm/nordic/nrf9280_cpuapp.dtsi @@ -7,17 +7,11 @@ #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; diff --git a/dts/arm/nordic/nrf9280_cpurad.dtsi b/dts/arm/nordic/nrf9280_cpurad.dtsi index 9a88533507f3..265cd6239537 100644 --- a/dts/arm/nordic/nrf9280_cpurad.dtsi +++ b/dts/arm/nordic/nrf9280_cpurad.dtsi @@ -7,17 +7,11 @@ #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; From ef62e13959b7790a60179e745bd8980af4d8ee6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1359/3334] Revert "[nrf fromlist] dts: vendor: nordic: nrf54h: remove power-domains from devices" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2bde7ed745dd97b6766595d7094f68d65cb90160. Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf54h20.dtsi | 89 +++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index e98693d1be97..5fcfec37c2c5 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -259,6 +259,7 @@ mram1x: mram@e000000 { compatible = "nordic,mram"; reg = <0xe000000 DT_SIZE_K(2048)>; + power-domains = <&gdpwr_fast_active_0>; erase-block-size = <4096>; write-block-size = <16>; }; @@ -621,6 +622,7 @@ reg = <0x86000 0x1000>, <0x2f700000 0x40000>; reg-names = "wrapper", "core"; interrupts = <134 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_fast_active_0>; num-in-eps = <8>; num-out-eps = <10>; ghwcfg1 = <0xaa555000>; @@ -636,6 +638,7 @@ reg = <0x95000 0x500 0x95500 0xb00>; reg-names = "wrapper", "core"; interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_fast_active_0>; clock-frequency = ; packet-data-limit = <65536>; fifo-depth = <32>; @@ -645,18 +648,21 @@ cpusec_bellboard: mailbox@99000 { reg = <0x99000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_fast_active_0>; #mbox-cells = <1>; }; cpuapp_bellboard: mailbox@9a000 { reg = <0x9a000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_fast_active_0>; #mbox-cells = <1>; }; cpurad_bellboard: mailbox@9b000 { reg = <0x9b000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_fast_active_0>; #mbox-cells = <1>; }; @@ -697,6 +703,7 @@ compatible = "nordic,nrf-vpr-coprocessor"; reg = <0x8d4000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_fast_active_1>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x8d4000 0x1000>; @@ -718,6 +725,7 @@ interrupts = <216 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&canpll>, <&hsfll120>; clock-names = "auxpll", "hsfll"; + power-domains = <&gdpwr_fast_active_1>; bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>; status = "disabled"; }; @@ -726,6 +734,7 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x8e1000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_fast_active_1>; }; timer120: timer@8e2000 { @@ -734,6 +743,7 @@ status = "disabled"; cc-num = <6>; interrupts = <226 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_fast_active_1>; max-bit-width = <32>; clocks = <&hsfll120>; prescaler = <0>; @@ -745,6 +755,7 @@ status = "disabled"; cc-num = <6>; interrupts = <227 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_fast_active_1>; max-bit-width = <32>; clocks = <&hsfll120>; prescaler = <0>; @@ -756,6 +767,7 @@ status = "disabled"; interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; + power-domains = <&gdpwr_fast_active_1>; #pwm-cells = <3>; idleout-supported; }; @@ -764,6 +776,7 @@ compatible = "nordic,nrf-spis"; reg = <0x8e5000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_fast_active_1>; easydma-maxcnt-bits = <15>; interrupts = <229 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; @@ -777,6 +790,7 @@ compatible = "nordic,nrf-spim"; reg = <0x8e6000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_fast_active_1>; easydma-maxcnt-bits = <15>; interrupts = <230 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; @@ -794,6 +808,7 @@ status = "disabled"; interrupts = <230 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; + power-domains = <&gdpwr_fast_active_1>; endtx-stoptx-supported; frame-timeout-supported; zephyr,pm-device-runtime-auto; @@ -806,6 +821,7 @@ easydma-maxcnt-bits = <15>; interrupts = <231 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&hsfll120>; + power-domains = <&gdpwr_fast_active_1>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -821,6 +837,7 @@ #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x908000 0x1000>; + power-domains = <&gdpwr_slow_active>; cpuppr_vevif_tx: mailbox@0 { compatible = "nordic,nrf-vevif-task-tx"; @@ -836,6 +853,7 @@ compatible = "nordic,nrf-ipct-global"; reg = <0x921000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_main>; channels = <8>; global-domain-id = <13>; }; @@ -844,6 +862,7 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x922000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_main>; }; rtc130: rtc@928000 { @@ -853,6 +872,7 @@ cc-num = <4>; clock-frequency = <32768>; interrupts = <296 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_slow_main>; clocks = <&lfclk>; prescaler = <1>; }; @@ -864,6 +884,7 @@ cc-num = <4>; clock-frequency = <32768>; interrupts = <297 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_slow_main>; clocks = <&lfclk>; prescaler = <1>; }; @@ -874,6 +895,7 @@ status = "disabled"; interrupts = <299 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&lfclk>; + power-domains = <&gdpwr_slow_main>; }; wdt132: watchdog@92c000 { @@ -882,6 +904,7 @@ status = "disabled"; interrupts = <300 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&lfclk>; + power-domains = <&gdpwr_slow_main>; }; egu130: egu@92d000 { @@ -889,12 +912,14 @@ reg = <0x92d000 0x1000>; status = "disabled"; interrupts = <301 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_slow_main>; }; gpiote130: gpiote@934000 { compatible = "nordic,nrf-gpiote"; reg = <0x934000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_main>; instance = <130>; }; @@ -904,6 +929,7 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; + power-domains = <&gdpwr_slow_main>; gpiote-instance = <&gpiote130>; ngpios = <12>; port = <0>; @@ -911,6 +937,7 @@ gpio_pad_group0: pad-group { compatible = "nordic,nrf-gpio-pad-group"; + power-domains = <&gdpwr_slow_main>; retain-mask = <0xFFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -923,6 +950,7 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; + power-domains = <&gdpwr_slow_main>; gpiote-instance = <&gpiote130>; ngpios = <12>; port = <1>; @@ -930,6 +958,7 @@ gpio_pad_group1: pad-group { compatible = "nordic,nrf-gpio-pad-group"; + power-domains = <&gdpwr_slow_main>; retain-mask = <0xFFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -942,6 +971,7 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; + power-domains = <&gdpwr_slow_main>; gpiote-instance = <&gpiote130>; ngpios = <12>; port = <2>; @@ -949,6 +979,7 @@ gpio_pad_group2: pad-group { compatible = "nordic,nrf-gpio-pad-group"; + power-domains = <&gdpwr_slow_main>; retain-mask = <0xFFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -961,12 +992,14 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; + power-domains = <&gdpwr_slow_main>; ngpios = <14>; port = <6>; zephyr,pm-device-runtime-auto; gpio_pad_group6: pad-group { compatible = "nordic,nrf-gpio-pad-group"; + power-domains = <&gdpwr_fast_active_1>; retain-mask = <0x3FFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -979,12 +1012,14 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; + power-domains = <&gdpwr_slow_main>; ngpios = <8>; port = <7>; zephyr,pm-device-runtime-auto; gpio_pad_group7: pad-group { compatible = "nordic,nrf-gpio-pad-group"; + power-domains = <&gdpwr_fast_active_1>; retain-mask = <0xFF>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -997,6 +1032,7 @@ status = "disabled"; #gpio-cells = <2>; gpio-controller; + power-domains = <&gdpwr_slow_main>; gpiote-instance = <&gpiote130>; ngpios = <6>; port = <9>; @@ -1004,6 +1040,7 @@ gpio_pad_group9: pad-group { compatible = "nordic,nrf-gpio-pad-group"; + power-domains = <&gdpwr_slow_main>; retain-mask = <0x3F>; zephyr,pm-device-runtime-auto; status = "disabled"; @@ -1014,6 +1051,7 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x981000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_active>; }; adc: adc@982000 { @@ -1028,6 +1066,7 @@ * gdpwr_slow_main. Request gdpwr_slow_main and rely on the * device HW to force its own power domain on while ENABLED. */ + power-domains = <&gdpwr_slow_main>; zephyr,pm-device-runtime-auto; }; @@ -1046,6 +1085,7 @@ * gdpwr_slow_main. Request gdpwr_slow_main and rely on the * device HW to force its own power domain on while ENABLED. */ + power-domains = <&gdpwr_slow_main>; }; temp: temperature-sensor@984000 { @@ -1053,6 +1093,7 @@ reg = <0x984000 0x1000>; interrupts = <388 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; + power-domains = <&gdpwr_slow_active>; }; nfct: nfct@985000 { @@ -1060,12 +1101,14 @@ reg = <0x985000 0x1000>; status = "disabled"; interrupts = <389 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_slow_active>; }; dppic132: dppic@991000 { compatible = "nordic,nrf-dppic-global"; reg = <0x991000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_active>; }; pdm0: pdm@993000 { @@ -1074,6 +1117,7 @@ status = "disabled"; interrupts = <403 NRF_DEFAULT_IRQ_PRIORITY>; nordic,clockpin-enable = ; + power-domains = <&gdpwr_slow_active>; }; qdec130: qdec@994000 { @@ -1081,6 +1125,7 @@ reg = <0x994000 0x1000>; status = "disabled"; interrupts = <404 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_slow_active>; }; qdec131: qdec@995000 { @@ -1088,6 +1133,7 @@ reg = <0x995000 0x1000>; status = "disabled"; interrupts = <405 NRF_DEFAULT_IRQ_PRIORITY>; + power-domains = <&gdpwr_slow_active>; }; grtc: grtc@99c000 { @@ -1097,12 +1143,14 @@ cc-num = <16>; clocks = <&lfclk>, <&fll16m>; clock-names = "lfclock", "hfclock"; + power-domains = <&gdpwr_slow_active>; }; dppic133: dppic@9a1000 { compatible = "nordic,nrf-dppic-global"; reg = <0x9a1000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_active>; }; timer130: timer@9a2000 { @@ -1112,6 +1160,7 @@ cc-num = <6>; interrupts = <418 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1123,6 +1172,7 @@ cc-num = <6>; interrupts = <419 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1133,6 +1183,7 @@ status = "disabled"; interrupts = <420 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; #pwm-cells = <3>; idleout-supported; }; @@ -1143,6 +1194,7 @@ status = "disabled"; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1158,6 +1210,7 @@ easydma-maxcnt-bits = <15>; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1175,6 +1228,7 @@ status = "disabled"; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1187,6 +1241,7 @@ status = "disabled"; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1202,6 +1257,7 @@ easydma-maxcnt-bits = <15>; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1219,6 +1275,7 @@ status = "disabled"; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1229,6 +1286,7 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x9b1000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_active>; }; timer132: timer@9b2000 { @@ -1238,6 +1296,7 @@ cc-num = <6>; interrupts = <434 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1249,6 +1308,7 @@ cc-num = <6>; interrupts = <435 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1259,6 +1319,7 @@ status = "disabled"; interrupts = <436 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; #pwm-cells = <3>; idleout-supported; }; @@ -1269,6 +1330,7 @@ status = "disabled"; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1284,6 +1346,7 @@ easydma-maxcnt-bits = <15>; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1301,6 +1364,7 @@ status = "disabled"; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1313,6 +1377,7 @@ status = "disabled"; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1328,6 +1393,7 @@ easydma-maxcnt-bits = <15>; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1345,6 +1411,7 @@ status = "disabled"; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1355,6 +1422,7 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x9c1000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_active>; }; timer134: timer@9c2000 { @@ -1364,6 +1432,7 @@ cc-num = <6>; interrupts = <450 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1375,6 +1444,7 @@ cc-num = <6>; interrupts = <451 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1386,6 +1456,7 @@ interrupts = <452 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; #pwm-cells = <3>; + power-domains = <&gdpwr_slow_active>; idleout-supported; }; @@ -1395,6 +1466,7 @@ status = "disabled"; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1410,6 +1482,7 @@ easydma-maxcnt-bits = <15>; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1427,6 +1500,7 @@ status = "disabled"; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1439,6 +1513,7 @@ status = "disabled"; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1454,6 +1529,7 @@ easydma-maxcnt-bits = <15>; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1471,6 +1547,7 @@ status = "disabled"; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1481,6 +1558,7 @@ compatible = "nordic,nrf-dppic-global"; reg = <0x9d1000 0x1000>; status = "disabled"; + power-domains = <&gdpwr_slow_active>; }; timer136: timer@9d2000 { @@ -1490,6 +1568,7 @@ cc-num = <6>; interrupts = <466 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1501,6 +1580,7 @@ cc-num = <6>; interrupts = <467 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-bit-width = <32>; prescaler = <0>; }; @@ -1512,6 +1592,7 @@ interrupts = <468 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; #pwm-cells = <3>; + power-domains = <&gdpwr_slow_active>; idleout-supported; }; @@ -1521,6 +1602,7 @@ status = "disabled"; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1536,6 +1618,7 @@ easydma-maxcnt-bits = <15>; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1553,6 +1636,7 @@ status = "disabled"; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1565,6 +1649,7 @@ status = "disabled"; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1580,6 +1665,7 @@ easydma-maxcnt-bits = <15>; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1597,6 +1683,7 @@ status = "disabled"; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; @@ -1612,6 +1699,7 @@ interrupts = <402 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = , ; }; @@ -1625,6 +1713,7 @@ interrupts = <407 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; clocks = <&fll16m>; + power-domains = <&gdpwr_slow_active>; nordic,clockpin-enable = , ; }; From 62e9675369623d118bbc05b918607785ffa0bd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1360/3334] Revert "[nrf fromtree] soc: nordic: enable CONFIG_PM_DEVICE_RUNTIME_DEFAULT_ENABLE for all" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 182509a8601eef62971f36f28b06afc1ca99cf9b. Signed-off-by: Tomasz Moń --- soc/nordic/common/Kconfig.defconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/soc/nordic/common/Kconfig.defconfig b/soc/nordic/common/Kconfig.defconfig index 846151dd11a8..077a73ad24d9 100644 --- a/soc/nordic/common/Kconfig.defconfig +++ b/soc/nordic/common/Kconfig.defconfig @@ -6,6 +6,3 @@ if RISCV_CORE_NORDIC_VPR rsource "vpr/Kconfig.defconfig" endif # RISCV_CORE_NORDIC_VPR - -config PM_DEVICE_RUNTIME_DEFAULT_ENABLE - default y if PM_DEVICE_RUNTIME From f53ca080689f7a85c956ffcd5805d3b8140b4093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1361/3334] Revert "[nrf fromtree] pm: device: runtime: add PM_DEVICE_RUNTIME_DEFAULT_ENABLE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 91910f7362107f9f981f1cd9974834018cbfbf27. Signed-off-by: Tomasz Moń --- subsys/pm/Kconfig | 9 --------- subsys/pm/device.c | 3 +-- subsys/pm/device_runtime.c | 9 ++------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/subsys/pm/Kconfig b/subsys/pm/Kconfig index d1d99ac02e3a..af0409de559a 100644 --- a/subsys/pm/Kconfig +++ b/subsys/pm/Kconfig @@ -177,15 +177,6 @@ endif #PM_DEVICE_RUNTIME_USE_DEDICATED_WQ endchoice endif # PM_DEVICE_RUNTIME_ASYNC - -config PM_DEVICE_RUNTIME_DEFAULT_ENABLE - bool "PM device runtime enable by default" - help - Enable PM device runtime by default for all devices when they are - initialized. This option is identical to adding the devicetree - property zephyr,pm-device-runtime-auto to all nodes in the - devicetree. - endif # PM_DEVICE_RUNTIME config PM_DEVICE_SHELL diff --git a/subsys/pm/device.c b/subsys/pm/device.c index c74eea661f05..2d7bb3176c36 100644 --- a/subsys/pm/device.c +++ b/subsys/pm/device.c @@ -388,8 +388,7 @@ int pm_device_driver_init(const struct device *dev, /* If device will have PM device runtime enabled */ if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) && - (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME_DEFAULT_ENABLE) || - atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_AUTO))) { + atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_AUTO)) { return 0; } diff --git a/subsys/pm/device_runtime.c b/subsys/pm/device_runtime.c index 104d1fdb5955..490d7de49334 100644 --- a/subsys/pm/device_runtime.c +++ b/subsys/pm/device_runtime.c @@ -401,15 +401,10 @@ int pm_device_runtime_auto_enable(const struct device *dev) { struct pm_device_base *pm = dev->pm_base; - if (!pm) { + /* No action needed if PM_DEVICE_FLAG_RUNTIME_AUTO is not enabled */ + if (!pm || !atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_AUTO)) { return 0; } - - if (!IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME_DEFAULT_ENABLE) && - !atomic_test_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_AUTO)) { - return 0; - } - return pm_device_runtime_enable(dev); } From 853d4f99b4a3bcec03829545a370e5e5cb447a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1362/3334] Revert "[nrf fromtree] dts: vendor: nordic: nrf54h: move adc and comp to gdpwr_slow_main" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d70b3d746c596e3f9300ae9d6ca5f7612ca0c111. Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf54h20.dtsi | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 5fcfec37c2c5..ddbf255e936b 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -1060,13 +1060,7 @@ interrupts = <386 NRF_DEFAULT_IRQ_PRIORITY>; status = "disabled"; #io-channel-cells = <1>; - /* - * This device is actually in the gdpwr_slow_active domain, but - * all of its analog inputs are routed to pads in the - * gdpwr_slow_main. Request gdpwr_slow_main and rely on the - * device HW to force its own power domain on while ENABLED. - */ - power-domains = <&gdpwr_slow_main>; + power-domains = <&gdpwr_slow_active>; zephyr,pm-device-runtime-auto; }; @@ -1079,13 +1073,7 @@ reg = <0x983000 0x1000>; status = "disabled"; interrupts = <387 NRF_DEFAULT_IRQ_PRIORITY>; - /* - * This device is actually in the gdpwr_slow_active domain, but - * all of its analog inputs are routed to pads in the - * gdpwr_slow_main. Request gdpwr_slow_main and rely on the - * device HW to force its own power domain on while ENABLED. - */ - power-domains = <&gdpwr_slow_main>; + power-domains = <&gdpwr_slow_active>; }; temp: temperature-sensor@984000 { From 4521523cda76acc040420d6bf9c7c5282fd949c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1363/3334] Revert "[nrf fromtree] drivers: adc: nrfx_saadc: implement PM device runtime" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e3e4ef816feb419ab60f8e6e6cda867c2f2bf06d. Signed-off-by: Tomasz Moń --- drivers/adc/adc_nrfx_saadc.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 2c56e79f4897..b92b5ccfe6b3 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -12,8 +12,6 @@ #include #include #include -#include -#include #include #include @@ -727,19 +725,10 @@ static int adc_nrfx_read(const struct device *dev, { int error; - error = pm_device_runtime_get(dev); - if (error) { - return error; - } - adc_context_lock(&m_data.ctx, false, NULL); error = start_read(dev, sequence); adc_context_release(&m_data.ctx, error); - if (pm_device_runtime_put(dev)) { - LOG_ERR("PM put failed"); - } - return error; } @@ -789,13 +778,6 @@ static void event_handler(const nrfx_saadc_evt_t *event) } } -static int saadc_pm_handler(const struct device *dev, enum pm_device_action action) -{ - ARG_UNUSED(dev); - ARG_UNUSED(action); - return 0; -} - static int init_saadc(const struct device *dev) { nrfx_err_t err; @@ -813,7 +795,7 @@ static int init_saadc(const struct device *dev) adc_context_unlock_unconditionally(&m_data.ctx); - return pm_device_driver_init(dev, saadc_pm_handler); + return 0; } static DEVICE_API(adc, adc_nrfx_driver_api) = { @@ -856,7 +838,5 @@ DT_FOREACH_CHILD(DT_DRV_INST(0), VALIDATE_CHANNEL_CONFIG) NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(DT_DRV_INST(0)); -PM_DEVICE_DT_INST_DEFINE(0, saadc_pm_handler); -DEVICE_DT_INST_DEFINE(0, init_saadc, PM_DEVICE_DT_INST_GET(0), NULL, - NULL, POST_KERNEL, CONFIG_ADC_INIT_PRIORITY, - &adc_nrfx_driver_api); +DEVICE_DT_INST_DEFINE(0, init_saadc, NULL, NULL, NULL, POST_KERNEL, + CONFIG_ADC_INIT_PRIORITY, &adc_nrfx_driver_api); From 9722ce3cc8c6ed167ca5c57c138a737cf4ab519e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1364/3334] Revert "[nrf fromtree] soc: nordic: nrf54h: increase default log stack size if CONFIG_PM=y" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fde8ab3bbd32097b6675a725f8e99837a85c9fb4. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/Kconfig.defconfig | 7 ------- 1 file changed, 7 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig.defconfig b/soc/nordic/nrf54h/Kconfig.defconfig index 3e4c61810984..a1b7961f3007 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig +++ b/soc/nordic/nrf54h/Kconfig.defconfig @@ -40,13 +40,6 @@ if PM config PM_DEVICE default y -if LOG - -config LOG_PROCESS_THREAD_STACK_SIZE - default 1536 - -endif # LOG - endif # PM if PM_DEVICE From 426ce9889bdccec15c95185f0e2212ca2faaf43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:57 +0100 Subject: [PATCH 1365/3334] Revert "[nrf fromtree] modules: mbedtls: add new helper Kconfig symbol PSA_CRYPTO" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ee2298ed3dc1006bf7e55c4245f1436334ba86d. Signed-off-by: Tomasz Moń --- drivers/bluetooth/hci/Kconfig | 3 +- modules/hostap/Kconfig | 2 +- modules/mbedtls/Kconfig.psa.logic | 33 ++----------------- modules/uoscore-uedhoc/Kconfig | 4 ++- samples/net/sockets/http_server/Kconfig | 2 +- .../subsys/mgmt/updatehub/overlay-psa.conf | 3 +- subsys/bluetooth/crypto/Kconfig | 3 +- subsys/bluetooth/host/Kconfig | 6 ++-- subsys/jwt/Kconfig | 6 ++-- .../host/gatt/caching/psa_overlay.conf | 3 +- tests/bsim/bluetooth/ll/conn/psa_overlay.conf | 3 +- 11 files changed, 25 insertions(+), 43 deletions(-) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 92f4d4fa3d71..ba218d731609 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -158,7 +158,8 @@ config BT_SILABS_EFR32 depends on ZEPHYR_HAL_SILABS_MODULE_BLOBS || BUILD_ONLY_NO_BLOBS depends on !PM || SOC_GECKO_PM_BACKEND_PMGR select SOC_GECKO_USE_RAIL - select PSA_CRYPTO + select MBEDTLS + select MBEDTLS_PSA_CRYPTO_C select HAS_BT_CTLR select BT_CTLR_PHY_UPDATE_SUPPORT select BT_CTLR_PER_INIT_FEAT_XCHG_SUPPORT diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 1aa21670bb71..aa6d5d8689f6 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -204,7 +204,7 @@ endchoice config WIFI_NM_WPA_SUPPLICANT_CRYPTO_MBEDTLS_PSA bool "Crypto Platform Secure Architecture support for WiFi" - select PSA_CRYPTO + imply MBEDTLS_PSA_CRYPTO_C select MBEDTLS_USE_PSA_CRYPTO select PSA_WANT_ALG_ECDH select PSA_WANT_ALG_HMAC diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index 972054e105b0..dcea9e354052 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -1,37 +1,8 @@ # Copyright (c) 2024 BayLibre SAS # SPDX-License-Identifier: Apache-2.0 -config PSA_CRYPTO - bool "PSA Crypto API" - help - Enable a PSA Crypto API provider in the build. If TF-M is enabled then - it will be used for this scope, otherwise Mbed TLS will be used. - PSA_CRYPTO_PROVIDER_CUSTOM can be selected to use an out-of-tree - implementation. - -choice PSA_CRYPTO_PROVIDER - prompt "PSA Crypto API provider" - depends on PSA_CRYPTO - -config PSA_CRYPTO_PROVIDER_TFM - bool "Use TF-M" - depends on BUILD_WITH_TFM - select TFM_PARTITION_CRYPTO - -config PSA_CRYPTO_PROVIDER_MBEDTLS - bool "Use Mbed TLS" - depends on !BUILD_WITH_TFM - select MBEDTLS - select MBEDTLS_PSA_CRYPTO_C - -config PSA_CRYPTO_PROVIDER_CUSTOM - bool "Use an out-of-tree library" - depends on !BUILD_WITH_TFM - -endchoice # PSA_CRYPTO_PROVIDER - -# The following section extends Kconfig.psa.auto (which is automatically -# generated) by adding some logic between PSA_WANT symbols. +# This file extends Kconfig.psa (which is automatically generated) by adding +# some logic between PSA_WANT symbols. config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC bool diff --git a/modules/uoscore-uedhoc/Kconfig b/modules/uoscore-uedhoc/Kconfig index 766249553188..06eaecd7b210 100644 --- a/modules/uoscore-uedhoc/Kconfig +++ b/modules/uoscore-uedhoc/Kconfig @@ -5,6 +5,7 @@ menuconfig UOSCORE bool "UOSCORE library" depends on ZCBOR depends on ZCBOR_CANONICAL + depends on MBEDTLS select UOSCORE_UEDHOC_CRYPTO_COMMON help @@ -21,6 +22,7 @@ menuconfig UEDHOC bool "UEDHOC library" depends on ZCBOR depends on ZCBOR_CANONICAL + depends on MBEDTLS select UOSCORE_UEDHOC_CRYPTO_COMMON help This option enables the UEDHOC library. @@ -36,7 +38,7 @@ if UOSCORE || UEDHOC config UOSCORE_UEDHOC_CRYPTO_COMMON bool - select PSA_CRYPTO + imply MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM select PSA_WANT_ALG_ECDH select PSA_WANT_ALG_ECDSA select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT diff --git a/samples/net/sockets/http_server/Kconfig b/samples/net/sockets/http_server/Kconfig index 07d5b26e52d5..2f607259dfaa 100644 --- a/samples/net/sockets/http_server/Kconfig +++ b/samples/net/sockets/http_server/Kconfig @@ -17,7 +17,7 @@ config NET_SAMPLE_HTTP_SERVER_SERVICE_PORT config NET_SAMPLE_HTTPS_SERVICE bool "Enable https service" depends on NET_SOCKETS_SOCKOPT_TLS || TLS_CREDENTIALS - select PSA_CRYPTO + imply MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM if NET_SAMPLE_HTTPS_SERVICE diff --git a/samples/subsys/mgmt/updatehub/overlay-psa.conf b/samples/subsys/mgmt/updatehub/overlay-psa.conf index 8a70becc92d3..4b5dcfd9af67 100644 --- a/samples/subsys/mgmt/updatehub/overlay-psa.conf +++ b/samples/subsys/mgmt/updatehub/overlay-psa.conf @@ -1,2 +1,3 @@ CONFIG_FLASH_AREA_CHECK_INTEGRITY_PSA=y -CONFIG_PSA_CRYPTO=y +CONFIG_MBEDTLS=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y diff --git a/subsys/bluetooth/crypto/Kconfig b/subsys/bluetooth/crypto/Kconfig index e9234e4157b3..0856daf9d9a5 100644 --- a/subsys/bluetooth/crypto/Kconfig +++ b/subsys/bluetooth/crypto/Kconfig @@ -3,7 +3,8 @@ config BT_CRYPTO bool - select PSA_CRYPTO + select MBEDTLS if !BUILD_WITH_TFM + select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_CMAC select PSA_WANT_ALG_ECB_NO_PADDING diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index e89ca2bce919..72deb4343dc4 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -200,7 +200,8 @@ config BT_BUF_EVT_DISCARDABLE_COUNT config BT_HOST_CRYPTO bool "Use crypto functionality implemented in the Bluetooth host" default y if !BT_CTLR_CRYPTO - select PSA_CRYPTO + select MBEDTLS if !BUILD_WITH_TFM + select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_ECB_NO_PADDING help @@ -1022,7 +1023,8 @@ endif # BT_DF config BT_ECC bool - select PSA_CRYPTO + select MBEDTLS if !BUILD_WITH_TFM + select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM select PSA_WANT_ALG_ECDH select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT diff --git a/subsys/jwt/Kconfig b/subsys/jwt/Kconfig index c1cafcc829cf..052908a77754 100644 --- a/subsys/jwt/Kconfig +++ b/subsys/jwt/Kconfig @@ -28,7 +28,8 @@ config JWT_SIGN_RSA_LEGACY config JWT_SIGN_RSA_PSA bool "Use RSA signature (RS-256). Use PSA Crypto API." - select PSA_CRYPTO + select MBEDTLS if !BUILD_WITH_TFM + select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT select PSA_WANT_ALG_RSA_PKCS1V15_SIGN @@ -36,7 +37,8 @@ config JWT_SIGN_RSA_PSA config JWT_SIGN_ECDSA_PSA bool "Use ECDSA signature (ES-256). Use PSA Crypto API." - select PSA_CRYPTO + select MBEDTLS if !BUILD_WITH_TFM + select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT select PSA_WANT_ALG_ECDSA select PSA_WANT_ECC_SECP_R1_256 diff --git a/tests/bsim/bluetooth/host/gatt/caching/psa_overlay.conf b/tests/bsim/bluetooth/host/gatt/caching/psa_overlay.conf index bc7c220f62f6..b836ab2c23b2 100644 --- a/tests/bsim/bluetooth/host/gatt/caching/psa_overlay.conf +++ b/tests/bsim/bluetooth/host/gatt/caching/psa_overlay.conf @@ -1,2 +1,3 @@ -CONFIG_PSA_CRYPTO=y +CONFIG_MBEDTLS=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_PSA_CRYPTO_ENABLE_ALL=y diff --git a/tests/bsim/bluetooth/ll/conn/psa_overlay.conf b/tests/bsim/bluetooth/ll/conn/psa_overlay.conf index bc7c220f62f6..b836ab2c23b2 100644 --- a/tests/bsim/bluetooth/ll/conn/psa_overlay.conf +++ b/tests/bsim/bluetooth/ll/conn/psa_overlay.conf @@ -1,2 +1,3 @@ -CONFIG_PSA_CRYPTO=y +CONFIG_MBEDTLS=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_PSA_CRYPTO_ENABLE_ALL=y From 9e8c4a90629c6337e3fb9a4a4de848d3ca1c4013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1366/3334] Revert "[nrf fromtree] drivers: bluetooth: hci: do not select MBEDTLS_ENTROPY_C in BT_SILABS_EFR32" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c6f4831daf88f9b71d2b63bbd0eebccbf776595a. Signed-off-by: Tomasz Moń --- drivers/bluetooth/hci/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index ba218d731609..f1d1939259dc 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -160,6 +160,7 @@ config BT_SILABS_EFR32 select SOC_GECKO_USE_RAIL select MBEDTLS select MBEDTLS_PSA_CRYPTO_C + select MBEDTLS_ENTROPY_C select HAS_BT_CTLR select BT_CTLR_PHY_UPDATE_SUPPORT select BT_CTLR_PER_INIT_FEAT_XCHG_SUPPORT From 5ea2619179d54ff934da462a91c65cb9c659bbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1367/3334] Revert "[nrf fromtree] drivers: bluetooth: esp32: remove selection of MBEDTLS_PSA_CRYPTO_C" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fc2da8b2b1a5e2a7a6c2977e8448c1792fda26be. Signed-off-by: Tomasz Moń --- drivers/bluetooth/hci/Kconfig.esp32 | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bluetooth/hci/Kconfig.esp32 b/drivers/bluetooth/hci/Kconfig.esp32 index 501c5238db79..9f363ebc700f 100644 --- a/drivers/bluetooth/hci/Kconfig.esp32 +++ b/drivers/bluetooth/hci/Kconfig.esp32 @@ -492,6 +492,7 @@ config ESP32_BT_LE_CRYPTO_STACK_MBEDTLS select MBEDTLS_ECP_DP_SECP256R1_ENABLED select MBEDTLS_ECDH_C select MBEDTLS_ENTROPY_C + select MBEDTLS_PSA_CRYPTO_C help Use mbedTLS library for BLE cryptographic operations. From 6e7dcdd3e679ada138fb5674a7e4b240a43ce770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1368/3334] Revert "[nrf fromtree] modules: openthread: fix dependency for OPENTHREAD_CRYPTO_PSA" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 22f2f13bdbac902e57885fee66a64e1e0cca9b2d. Signed-off-by: Tomasz Moń --- modules/openthread/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openthread/Kconfig b/modules/openthread/Kconfig index afbc479b4fdd..99a90633f13a 100644 --- a/modules/openthread/Kconfig +++ b/modules/openthread/Kconfig @@ -320,7 +320,7 @@ config OPENTHREAD_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE config OPENTHREAD_CRYPTO_PSA bool "ARM PSA crypto API" - depends on PSA_CRYPTO_CLIENT + depends on MBEDTLS_PSA_CRYPTO_CLIENT select OPENTHREAD_PLATFORM_KEY_REF if !OPENTHREAD_COPROCESSOR_RCP imply OPENTHREAD_PLATFORM_KEYS_EXPORTABLE_ENABLE help From 56c10f9bafef50dc23d9bb1ea76b4aa882c97c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1369/3334] Revert "[nrf fromlist] tests: secure_storage: Exclude nRF54H20 targets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ebb84d10514478a44aebbdab1f9506741923468a. Signed-off-by: Tomasz Moń --- tests/subsys/secure_storage/psa/crypto/testcase.yaml | 3 --- tests/subsys/secure_storage/psa/its/testcase.yaml | 2 -- 2 files changed, 5 deletions(-) diff --git a/tests/subsys/secure_storage/psa/crypto/testcase.yaml b/tests/subsys/secure_storage/psa/crypto/testcase.yaml index 150177b8e3fc..1482d23cb6c7 100644 --- a/tests/subsys/secure_storage/psa/crypto/testcase.yaml +++ b/tests/subsys/secure_storage/psa/crypto/testcase.yaml @@ -1,9 +1,6 @@ common: tags: - psa.secure_storage - platform_exclude: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad tests: secure_storage.psa.crypto.secure_storage: filter: CONFIG_SECURE_STORAGE and not CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index 6b244a065b65..75950a798143 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -4,8 +4,6 @@ common: - nrf54l15dk/nrf54l15/cpuapp platform_exclude: - qemu_cortex_m0 # settings subsystem initialization fails - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad timeout: 600 tags: - psa.secure_storage From ab2c61a51cfa640bb1661494c1eb3242082dc403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1370/3334] Revert "[nrf fromtree] drivers: flash_mspi_nor: Take into account MSPI controller packet limit" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0e2635ce9ce8f1842948011413166d59aeb9b4ae. Signed-off-by: Tomasz Moń --- drivers/flash/flash_mspi_nor.c | 35 +++++----------------------------- drivers/flash/flash_mspi_nor.h | 1 - 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 444509b695b5..03430401de0c 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -336,7 +336,6 @@ static uint8_t get_rx_dummy(const struct device *dev) static int api_read(const struct device *dev, off_t addr, void *dest, size_t size) { - const struct flash_mspi_nor_config *dev_config = dev->config; struct flash_mspi_nor_data *dev_data = dev->data; const uint32_t flash_size = dev_flash_size(dev); int rc; @@ -354,26 +353,11 @@ static int api_read(const struct device *dev, off_t addr, void *dest, return rc; } - while (size > 0) { - uint32_t to_read; - - if (dev_config->packet_data_limit && - dev_config->packet_data_limit < size) { - to_read = dev_config->packet_data_limit; - } else { - to_read = size; - } - - set_up_xfer_with_addr(dev, MSPI_RX, addr); - dev_data->xfer.rx_dummy = get_rx_dummy(dev); - dev_data->packet.data_buf = dest; - dev_data->packet.num_bytes = to_read; - rc = perform_xfer(dev, dev_data->cmd_info.read_cmd, true); - - addr += to_read; - dest = (uint8_t *)dest + to_read; - size -= to_read; - } + set_up_xfer_with_addr(dev, MSPI_RX, addr); + dev_data->xfer.rx_dummy = get_rx_dummy(dev); + dev_data->packet.data_buf = dest; + dev_data->packet.num_bytes = size; + rc = perform_xfer(dev, dev_data->cmd_info.read_cmd, true); release(dev); @@ -1310,22 +1294,13 @@ BUILD_ASSERT((FLASH_SIZE(inst) % CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE) == 0, \ #define INIT_PRIORITY UTIL_INC(CONFIG_MSPI_INIT_PRIORITY) #endif -#define PACKET_DATA_LIMIT(inst) \ - DT_PROP_OR(DT_INST_BUS(inst), packet_data_limit, 0) - #define FLASH_MSPI_NOR_INST(inst) \ - BUILD_ASSERT(!PACKET_DATA_LIMIT(inst) || \ - FLASH_PAGE_SIZE(inst) <= PACKET_DATA_LIMIT(inst), \ - "Page size for " DT_NODE_FULL_NAME(DT_DRV_INST(inst)) \ - " exceeds controller packet data limit"); \ SFDP_BUILD_ASSERTS(inst); \ PM_DEVICE_DT_INST_DEFINE(inst, dev_pm_action_cb); \ DEFAULT_ERASE_TYPES_DEFINE(inst); \ static struct flash_mspi_nor_data dev##inst##_data; \ static const struct flash_mspi_nor_config dev##inst##_config = { \ .bus = DEVICE_DT_GET(DT_INST_BUS(inst)), \ - .packet_data_limit = DT_PROP_OR(DT_INST_BUS(inst), \ - packet_data_limit, 0), \ .flash_size = FLASH_SIZE(inst), \ .page_size = FLASH_PAGE_SIZE(inst), \ .mspi_id = MSPI_DEVICE_ID_DT_INST(inst), \ diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 335af449b261..86c824cf4856 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -70,7 +70,6 @@ struct flash_mspi_nor_switch_info { struct flash_mspi_nor_config { const struct device *bus; - uint32_t packet_data_limit; uint32_t flash_size; uint16_t page_size; struct mspi_dev_id mspi_id; From e12c75d52c37598c34027777b5ba313e722600ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1371/3334] Revert "[nrf fromtree] dts: bindings: mspi-controller: Add "packet-data-limit" property" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d96928774c5e3cab5cca6c8ce5ab62d04d893425. Signed-off-by: Tomasz Moń --- dts/bindings/mspi/mspi-controller.yaml | 8 -------- dts/bindings/mspi/snps,designware-ssi.yaml | 4 ---- dts/vendor/nordic/nrf54h20.dtsi | 1 - dts/vendor/nordic/nrf9280.dtsi | 1 - 4 files changed, 14 deletions(-) diff --git a/dts/bindings/mspi/mspi-controller.yaml b/dts/bindings/mspi/mspi-controller.yaml index 6f22d0dc0bf2..0f574c12153e 100644 --- a/dts/bindings/mspi/mspi-controller.yaml +++ b/dts/bindings/mspi/mspi-controller.yaml @@ -92,11 +92,3 @@ properties: Regardless of whether the CE pin may need software control or MSPI controller has dedicated CE pin, this field should be defined to help manage multiple devices on the same MSPI controller. - - packet-data-limit: - type: int - description: | - Specifies the maximum length of data that the controller can transfer - in a single packet. Transceive requests made to the controller must be - split into multiple packets if a single one would exceed this value. - If not specified, no limit is imposed. diff --git a/dts/bindings/mspi/snps,designware-ssi.yaml b/dts/bindings/mspi/snps,designware-ssi.yaml index 69a2947f9efb..fb516cb78358 100644 --- a/dts/bindings/mspi/snps,designware-ssi.yaml +++ b/dts/bindings/mspi/snps,designware-ssi.yaml @@ -14,10 +14,6 @@ properties: interrupts: required: true - packet-data-limit: - required: true - const: 65536 - aux-reg-enable: type: boolean description: | diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index ddbf255e936b..62ab535006bd 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -640,7 +640,6 @@ interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; power-domains = <&gdpwr_fast_active_0>; clock-frequency = ; - packet-data-limit = <65536>; fifo-depth = <32>; status = "disabled"; }; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 791cd7d4c663..fb27488e9dc4 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -384,7 +384,6 @@ reg-names = "wrapper", "core"; interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; clock-frequency = ; - packet-data-limit = <65536>; fifo-depth = <32>; status = "disabled"; }; From 8b36f9e461a6f21f75c00c462dae2164805ed113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1372/3334] Revert "[nrf fromtree] dfu: Allow to use imgtool-based headers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6c67604fa7fd9e69463b2b2be36a9dc5052e03f4. Signed-off-by: Tomasz Moń --- subsys/dfu/img_util/flash_img.c | 5 ++--- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 5 ++--- tests/subsys/dfu/img_util/src/main.c | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index 24e95a8dc1a9..83eb013c6612 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -23,9 +23,8 @@ LOG_MODULE_REGISTER(flash_img, CONFIG_IMG_MANAGER_LOG_LEVEL); #include #endif -#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ - FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) +#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + (FIXED_PARTITION_OFFSET(label) == CONFIG_FLASH_LOAD_OFFSET) #include #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && (CONFIG_TFM_MCUBOOT_IMAGE_NUMBER == 2) 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 a2bf006b9474..7abcac8afad5 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -48,9 +48,8 @@ to be able to figure out application running slot. #endif -#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ - FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) +#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + (FIXED_PARTITION_OFFSET(label) == CONFIG_FLASH_LOAD_OFFSET) BUILD_ASSERT(sizeof(struct image_header) == IMAGE_HEADER_SIZE, "struct image_header not required size"); diff --git a/tests/subsys/dfu/img_util/src/main.c b/tests/subsys/dfu/img_util/src/main.c index 33956be6251e..dc7c46721267 100644 --- a/tests/subsys/dfu/img_util/src/main.c +++ b/tests/subsys/dfu/img_util/src/main.c @@ -12,9 +12,8 @@ #define SLOT0_PARTITION slot0_partition #define SLOT1_PARTITION slot1_partition -#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ - FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) +#define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ + (FIXED_PARTITION_OFFSET(label) == CONFIG_FLASH_LOAD_OFFSET) #if FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot0_partition) #define UPLOAD_PARTITION_ID FIXED_PARTITION_ID(SLOT1_PARTITION) From 856615522a17742269bed530c1016185a1e1e8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1373/3334] Revert "[nrf fromtree] soc: Move to the app-specific partitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4b8157419b8a04ae7801370986d89c0086a03ca5. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/soc.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index e6ae033b0cd0..8493aa03bc34 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -35,12 +35,6 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #define HSFLL_NODE DT_NODELABEL(cpurad_hsfll) #endif -#define FIXED_PARTITION_ADDRESS(label) \ - (DT_REG_ADDR(DT_NODELABEL(label)) + \ - DT_REG_ADDR(COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ - (DT_GPARENT(DT_PARENT(DT_NODELABEL(label)))), \ - (DT_GPARENT(DT_NODELABEL(label)))))) - #ifdef CONFIG_USE_DT_CODE_PARTITION #define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) #elif defined(CONFIG_FLASH_LOAD_OFFSET) @@ -48,8 +42,7 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #endif #define PARTITION_IS_RUNNING_APP_PARTITION(label) \ - (DT_REG_ADDR(DT_NODELABEL(label)) <= FLASH_LOAD_OFFSET && \ - DT_REG_ADDR(DT_NODELABEL(label)) + DT_REG_SIZE(DT_NODELABEL(label)) > FLASH_LOAD_OFFSET) + (DT_REG_ADDR(DT_NODELABEL(label)) == FLASH_LOAD_OFFSET) sys_snode_t soc_node; @@ -198,16 +191,22 @@ void soc_late_init_hook(void) void *radiocore_address = NULL; #if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) - if (PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition) + - CONFIG_ROM_START_OFFSET); + if (PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) { + radiocore_address = + (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot1_partition))) + + DT_REG_ADDR(DT_NODELABEL(cpurad_slot1_partition)) + + CONFIG_ROM_START_OFFSET); } else { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + - CONFIG_ROM_START_OFFSET); + radiocore_address = + (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) + + DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + + CONFIG_ROM_START_OFFSET); } #else radiocore_address = - (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + CONFIG_ROM_START_OFFSET); + (void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) + + DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) + + CONFIG_ROM_START_OFFSET); #endif if (IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR) && From f07486de22d6a2ed68b9d10c8ca915ceaac16cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1374/3334] Revert "[nrf fromtree] cmake: define linker argument for undefined symbol" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 29396df89dbb54904ba9a79ca29dbf40d9fee11f. Signed-off-by: Tomasz Moń --- arch/common/CMakeLists.txt | 3 --- cmake/linker/arcmwdt/linker_flags.cmake | 2 -- cmake/linker/armlink/linker_flags.cmake | 5 ----- cmake/linker/iar/linker_flags.cmake | 1 - cmake/linker/ld/linker_flags.cmake | 2 -- cmake/linker/xt-ld/linker_flags.cmake | 6 ++---- 6 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 cmake/linker/armlink/linker_flags.cmake diff --git a/arch/common/CMakeLists.txt b/arch/common/CMakeLists.txt index a764235130ed..d817afa3d7fe 100644 --- a/arch/common/CMakeLists.txt +++ b/arch/common/CMakeLists.txt @@ -109,9 +109,6 @@ if (CONFIG_GEN_ISR_TABLES) add_dependencies(isr_tables zephyr_generated_headers) target_link_libraries(isr_tables zephyr_interface) zephyr_library_link_libraries(isr_tables) - - zephyr_link_libraries($_sw_isr_table) - zephyr_link_libraries($_irq_vector_table) endif() if(CONFIG_COVERAGE) diff --git a/cmake/linker/arcmwdt/linker_flags.cmake b/cmake/linker/arcmwdt/linker_flags.cmake index e2984268d9db..32c6cb9dd660 100644 --- a/cmake/linker/arcmwdt/linker_flags.cmake +++ b/cmake/linker/arcmwdt/linker_flags.cmake @@ -41,8 +41,6 @@ check_set_linker_property(TARGET linker PROPERTY orphan_error ${LINKERFLAGPREFIX},--orphan-handling=error ) -check_set_linker_property(TARGET linker PROPERTY undefined ${LINKERFLAGPREFIX},-u) - set_property(TARGET linker PROPERTY partial_linking "-r") # Extra warnings options for twister run diff --git a/cmake/linker/armlink/linker_flags.cmake b/cmake/linker/armlink/linker_flags.cmake deleted file mode 100644 index 207f83246a8f..000000000000 --- a/cmake/linker/armlink/linker_flags.cmake +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor -# -# SPDX-License-Identifier: Apache-2.0 - -set_property(TARGET linker PROPERTY undefined --undefined=) diff --git a/cmake/linker/iar/linker_flags.cmake b/cmake/linker/iar/linker_flags.cmake index cdfc3a8e9a5a..12d44ca24cd2 100644 --- a/cmake/linker/iar/linker_flags.cmake +++ b/cmake/linker/iar/linker_flags.cmake @@ -23,7 +23,6 @@ set_property(TARGET linker PROPERTY optimization_speed --entry_list_in_address_o set_property(TARGET linker PROPERTY optimization_size --entry_list_in_address_order) set_property(TARGET linker PROPERTY optimization_size_aggressive --entry_list_in_address_order) -set_linker_property(TARGET linker PROPERTY undefined "--keep=") string(APPEND CMAKE_C_LINK_FLAGS --no-wrap-diagnostics) diff --git a/cmake/linker/ld/linker_flags.cmake b/cmake/linker/ld/linker_flags.cmake index 33e5cd59322d..885a1844cc5d 100644 --- a/cmake/linker/ld/linker_flags.cmake +++ b/cmake/linker/ld/linker_flags.cmake @@ -22,8 +22,6 @@ check_set_linker_property(TARGET linker PROPERTY orphan_error ${LINKERFLAGPREFIX},--orphan-handling=error ) -set_property(TARGET linker PROPERTY undefined ${LINKERFLAGPREFIX},--undefined=) - check_set_linker_property(TARGET linker PROPERTY memusage "${LINKERFLAGPREFIX},--print-memory-usage") check_set_linker_property(TARGET linker PROPERTY sanitizer_undefined -fsanitize=undefined) diff --git a/cmake/linker/xt-ld/linker_flags.cmake b/cmake/linker/xt-ld/linker_flags.cmake index 535d76ecf650..ab66461e4522 100644 --- a/cmake/linker/xt-ld/linker_flags.cmake +++ b/cmake/linker/xt-ld/linker_flags.cmake @@ -19,11 +19,11 @@ check_set_linker_property(TARGET linker PROPERTY baremetal ) check_set_linker_property(TARGET linker PROPERTY orphan_warning - ${LINKERFLAGPREFIX},--orphan-handling=warn + ${LINKERFLAGPREFIX},--orphan-handling=warn ) check_set_linker_property(TARGET linker PROPERTY orphan_error - ${LINKERFLAGPREFIX},--orphan-handling=error + ${LINKERFLAGPREFIX},--orphan-handling=error ) set_property(TARGET linker PROPERTY partial_linking "-r") @@ -34,5 +34,3 @@ check_set_linker_property(TARGET linker PROPERTY sort_alignment ${LINKERFLAGPREFIX},--sort-common=descending ${LINKERFLAGPREFIX},--sort-section=alignment ) - -set_property(TARGET linker PROPERTY undefined ${LINKERFLAGPREFIX},--undefined=) From 5d5eaed174b3c197f15bc3b9bcb421d9f519a3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1375/3334] Revert "[nrf fromtree] tests: boards: nrf: hwinfo: Add latest reset causes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 47813359a087fbfa71f5b25d6c967ccc641c8747. Signed-off-by: Tomasz Moń --- tests/boards/nrf/hwinfo/reset_cause/src/main.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/boards/nrf/hwinfo/reset_cause/src/main.c b/tests/boards/nrf/hwinfo/reset_cause/src/main.c index 4e4e3a1c5d44..7df98bce9bc1 100644 --- a/tests/boards/nrf/hwinfo/reset_cause/src/main.c +++ b/tests/boards/nrf/hwinfo/reset_cause/src/main.c @@ -134,16 +134,6 @@ static void print_supported_reset_cause(void) } else { LOG_INF("14: no support for RESET_TEMPERATURE"); } - if (supported & RESET_BOOTLOADER) { - LOG_INF("15: RESET_BOOTLOADER is supported"); - } else { - LOG_INF("15: no support for RESET_BOOTLOADER"); - } - if (supported & RESET_FLASH) { - LOG_INF("16: RESET_FLASH is supported"); - } else { - LOG_INF("16: no support for RESET_FLASH"); - } } else if (ret == -ENOSYS) { LOG_INF("hwinfo_get_supported_reset_cause() is NOT supported"); supported = 0; @@ -207,12 +197,6 @@ static void print_current_reset_cause(uint32_t *cause) if (*cause & RESET_TEMPERATURE) { LOG_INF("14: reset due to RESET_TEMPERATURE"); } - if (*cause & RESET_BOOTLOADER) { - LOG_INF("15: reset due to RESET_BOOTLOADER"); - } - if (*cause & RESET_FLASH) { - LOG_INF("16: reset due to RESET_FLASH"); - } } else if (ret == -ENOSYS) { LOG_INF("hwinfo_get_reset_cause() is NOT supported"); *cause = 0; From be21edfebfed6e4c5be95f24a07e5da7ff240999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1376/3334] Revert "[nrf fromlist] boards: nordic: nrf54h: fix pm_ramfunc region" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8126a9b889bbb8a07dfbe742cd71c624595fb0a9. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index d5fea020431f..fd5ad106117b 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -130,7 +130,7 @@ zephyr_udc0: &usbhs { /* cache control functions - must be executed from RAM */ pm_ramfunc: cpurad_s2ram@2302ff40 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2302ff40 192>; + reg = <0x2302ff80 192>; zephyr,memory-region = "PMLocalRamfunc"; }; }; From bd3f15cf47241ec8ea8e178a2ed50720bc6b7bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1377/3334] Revert "[nrf fromtree] storage: Allow to use subpartitions in flash_map" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 47fb2200d27a3115468aeaf20ea44dd40dea81a5. Signed-off-by: Tomasz Moń --- include/zephyr/storage/flash_map.h | 60 ++------------------ subsys/storage/flash_map/flash_map_default.c | 13 ++--- 2 files changed, 12 insertions(+), 61 deletions(-) diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 6ce33c859632..d8ba414abd3d 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -349,17 +349,14 @@ const char *flash_area_label(const struct flash_area *fa); uint8_t flash_area_erased_val(const struct flash_area *fa); /** - * Returns non-0 value if fixed-partition or fixed-subpartition of given - * DTS node label exists. + * Returns non-0 value if fixed-partition of given DTS node label exists. * * @param label DTS node label * * @return non-0 if fixed-partition node exists and is enabled; * 0 if node does not exist, is not enabled or is not fixed-partition. */ -#define FIXED_PARTITION_EXISTS(label) \ - UTIL_OR(DT_FIXED_PARTITION_EXISTS(DT_NODELABEL(label)), \ - DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label))) +#define FIXED_PARTITION_EXISTS(label) DT_FIXED_PARTITION_EXISTS(DT_NODELABEL(label)) /** * Get flash area ID from fixed-partition DTS node label @@ -371,7 +368,7 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); #define FIXED_PARTITION_ID(label) DT_FIXED_PARTITION_ID(DT_NODELABEL(label)) /** - * Get fixed-partition or fixed-subpartition offset from DTS node label + * Get fixed-partition offset from DTS node label * * @param label DTS node label of a partition * @@ -379,30 +376,6 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); */ #define FIXED_PARTITION_OFFSET(label) DT_REG_ADDR(DT_NODELABEL(label)) -/** - * Get fixed-partition or fixed-subpartition address from DTS node label - * - * @param label DTS node label of a partition or subpartition - * - * @return fixed-partition address, as defined for the partition in DTS. - */ -#define FIXED_PARTITION_ADDRESS(label) \ - (COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ - (DT_FIXED_SUBPARTITION_ADDR(DT_NODELABEL(label))), \ - (DT_FIXED_PARTITION_ADDR(DT_NODELABEL(label))))) - -/** - * Get fixed-partition or fixed-subpartition address from DTS node - * - * @param node DTS node of a partition - * - * @return fixed-partition address, as defined for the partition in DTS. - */ -#define FIXED_PARTITION_NODE_ADDRESS(node) \ - (COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(node), \ - (DT_FIXED_SUBPARTITION_ADDR(node)), \ - (DT_FIXED_PARTITION_ADDR(node)))) - /** * Get fixed-partition offset from DTS node * @@ -448,10 +421,8 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); * @return Pointer to a device. */ #define FIXED_PARTITION_DEVICE(label) \ - DEVICE_DT_GET(COND_CODE_1( \ - DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ - (DT_MTD_FROM_FIXED_SUBPARTITION(DT_NODELABEL(label))), \ - (DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label))))) + DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label))) + /** * Get device pointer for device the area/partition resides on * @@ -460,10 +431,7 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); * @return Pointer to a device. */ #define FIXED_PARTITION_NODE_DEVICE(node) \ - DEVICE_DT_GET(COND_CODE_1( \ - DT_FIXED_SUBPARTITION_EXISTS(node), \ - (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ - (DT_MTD_FROM_FIXED_PARTITION(node)))) + DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(node)) /** * Get pointer to flash_area object by partition label @@ -499,22 +467,6 @@ DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) #undef DECLARE_PARTITION #undef DECLARE_PARTITION_0 #undef FOR_EACH_PARTITION_TABLE - -#define FIXED_SUBPARTITION_1(node) FIXED_SUBPARTITION_0(DT_DEP_ORD(node)) -#define FIXED_SUBPARTITION_0(ord) \ - ((const struct flash_area *)&DT_CAT(global_fixed_subpartition_ORD_, ord)) - -#define DECLARE_SUBPARTITION(node) DECLARE_SUBPARTITION_0(DT_DEP_ORD(node)) -#define DECLARE_SUBPARTITION_0(ord) \ - extern const struct flash_area DT_CAT(global_fixed_subpartition_ORD_, ord); -#define FOR_EACH_SUBPARTITION_TABLE(table) DT_FOREACH_CHILD(table, DECLARE_SUBPARTITION) - -/* Generate declarations */ -DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) - -#undef DECLARE_SUBPARTITION -#undef DECLARE_SUBPARTITION_0 -#undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ #ifdef __cplusplus diff --git a/subsys/storage/flash_map/flash_map_default.c b/subsys/storage/flash_map/flash_map_default.c index 6b1edfbbaef5..c0514d28a12c 100644 --- a/subsys/storage/flash_map/flash_map_default.c +++ b/subsys/storage/flash_map/flash_map_default.c @@ -40,7 +40,6 @@ */ const struct flash_area default_flash_map[] = { DT_FOREACH_STATUS_OKAY(fixed_partitions, FOREACH_PARTITION) - DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOREACH_PARTITION) }; const int flash_map_entries = ARRAY_SIZE(default_flash_map); @@ -64,11 +63,11 @@ const struct flash_area *flash_map = default_flash_map; #define FOR_EACH_PARTITION_TABLE(table) DT_FOREACH_CHILD(table, DEFINE_PARTITION) DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) -#define DEFINE_SUBPARTITION(part) DEFINE_SUBPARTITION_1(part, DT_DEP_ORD(part)) -#define DEFINE_SUBPARTITION_1(part, ord) \ +#define DEFINE_SUB_PARTITION(part) DEFINE_SUB_PARTITION_1(part, DT_DEP_ORD(part)) +#define DEFINE_SUB_PARTITION_1(part, ord) \ COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(DT_MTD_FROM_FIXED_SUBPARTITION(part)), \ - (DEFINE_SUBPARTITION_0(part, ord)), ()) -#define DEFINE_SUBPARTITION_0(part, ord) \ + (DEFINE_SUB_PARTITION_0(part, ord)), ()) +#define DEFINE_SUB_PARTITION_0(part, ord) \ const struct flash_area DT_CAT(global_fixed_subpartition_ORD_, ord) = { \ .fa_id = DT_FIXED_PARTITION_ID(part), \ .fa_off = DT_REG_ADDR(part), \ @@ -76,5 +75,5 @@ DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) .fa_size = DT_REG_SIZE(part), \ }; -#define FOR_EACH_SUBPARTITION_TABLE(table) DT_FOREACH_CHILD(table, DEFINE_SUBPARTITION) -DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) +#define FOR_EACH_SUB_PARTITION_TABLE(table) DT_FOREACH_CHILD(table, DEFINE_SUB_PARTITION) +DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUB_PARTITION_TABLE) From f4d5ea7c96a1db35f613d20972bdd2ebad93bc9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1378/3334] Revert "[nrf fromtree] devicetree: Fix ADDRESS macro for non-nv-flash" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e879cb05220843e18908b21331d2146eb614738d. Signed-off-by: Tomasz Moń --- include/zephyr/devicetree/fixed-partitions.h | 4 ++-- tests/lib/devicetree/api/src/main.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/zephyr/devicetree/fixed-partitions.h b/include/zephyr/devicetree/fixed-partitions.h index ff44e07ef644..ad219ab7206f 100644 --- a/include/zephyr/devicetree/fixed-partitions.h +++ b/include/zephyr/devicetree/fixed-partitions.h @@ -131,7 +131,7 @@ extern "C" { * node containing it. */ #define DT_FIXED_PARTITION_ADDR(node_id) \ - (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(node_id))) + (DT_REG_ADDR(DT_MEM_FROM_FIXED_PARTITION(node_id)) + DT_REG_ADDR(node_id)) /** * @brief Test if fixed-subpartitions compatible node exists @@ -207,7 +207,7 @@ extern "C" { * node containing it. */ #define DT_FIXED_SUBPARTITION_ADDR(node_id) \ - (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(DT_PARENT(node_id)))) + (DT_REG_ADDR(DT_MEM_FROM_FIXED_SUBPARTITION(node_id)) + DT_REG_ADDR(node_id)) /** * @} diff --git a/tests/lib/devicetree/api/src/main.c b/tests/lib/devicetree/api/src/main.c index 6c154d6dd5e1..ab2c72750764 100644 --- a/tests/lib/devicetree/api/src/main.c +++ b/tests/lib/devicetree/api/src/main.c @@ -3271,7 +3271,13 @@ ZTEST(devicetree_api, test_fixed_partitions) /* Test DT_FIXED_PARTITION_ADDR. */ zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_0), 0x20000000); zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_1), 0x200000c0); - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2), 0x33291080); + + /* DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2) expands to an invalid expression. + * Test this by way of string comparison. + */ + zassert_true(!strcmp(TO_STRING(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2)), + "(__REG_IDX_0_VAL_ADDRESSU + 458624U)")); + zassert_equal(DT_REG_ADDR(TEST_PARTITION_2), 458624); /* Test that all DT_FIXED_PARTITION_ID are defined and unique. */ #define FIXED_PARTITION_ID_COMMA(node_id) DT_FIXED_PARTITION_ID(node_id), From 183624a65d2ab04e5729d80bed9d141f19e0300b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1379/3334] Revert "[nrf fromtree] devicetree: Fix MTD macro for subpartitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4e2fc60cc5049ca958376d57d271273a0291f932. Signed-off-by: Tomasz Moń --- include/zephyr/devicetree/fixed-partitions.h | 2 +- tests/lib/devicetree/api/src/main.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/zephyr/devicetree/fixed-partitions.h b/include/zephyr/devicetree/fixed-partitions.h index ad219ab7206f..14bb96bfc592 100644 --- a/include/zephyr/devicetree/fixed-partitions.h +++ b/include/zephyr/devicetree/fixed-partitions.h @@ -160,7 +160,7 @@ extern "C" { */ #define DT_MTD_FROM_FIXED_SUBPARTITION(node_id) \ COND_CODE_1(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_SUBPARTITION(node_id)), \ - (DT_PARENT(DT_MEM_FROM_FIXED_SUBPARTITION(node_id))), (DT_GPARENT(DT_PARENT(node_id)))) + (DT_PARENT(DT_MEM_FROM_FIXED_SUBPARTITION(node_id))), (DT_GPARENT(node_id))) /** * @brief Get the absolute address of a fixed subpartition diff --git a/tests/lib/devicetree/api/src/main.c b/tests/lib/devicetree/api/src/main.c index ab2c72750764..98189ebe582c 100644 --- a/tests/lib/devicetree/api/src/main.c +++ b/tests/lib/devicetree/api/src/main.c @@ -3312,9 +3312,6 @@ ZTEST(devicetree_api, test_fixed_subpartitions) zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION(TEST_SUBPARTITION_COMBINED))); zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_0))); zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_1))); - zassert_true(DT_SAME_NODE( - DT_MTD_FROM_FIXED_PARTITION(TEST_SUBPARTITION_COMBINED), - DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_1))); /* Test DT_FIXED_SUBPARTITION_ADDR. */ zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED), 0x20000100); From 9112c1887ab338713caf8a8c172c3467760da1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:58 +0100 Subject: [PATCH 1380/3334] Revert "[nrf fromlist] samples: drivers: jesd216: add nrf54l15dk cases." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a61d55df5af9e48836634381fd4048a999c9764f. Signed-off-by: Tomasz Moń --- samples/drivers/jesd216/sample.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/samples/drivers/jesd216/sample.yaml b/samples/drivers/jesd216/sample.yaml index 4fd0af6c9ca2..a5b661c492ce 100644 --- a/samples/drivers/jesd216/sample.yaml +++ b/samples/drivers/jesd216/sample.yaml @@ -30,11 +30,8 @@ tests: platform_allow: nrf52840dk/nrf52840 integration_platforms: - nrf52840dk/nrf52840 - sample.drivers.jesd216.nrf54l: + sample.drivers.jesd216.nrf54lm20: platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l10/cpuapp - - nrf54l15dk/nrf54l05/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp From 3beb16474f48c0774d2330107af091c31065c5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1381/3334] Revert "[nrf fromlist] test: drivers: flash: common: Add sfdp case for nrf54l15 tests." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 25deef5205a3619f52b282e79761356a56c96f21. Signed-off-by: Tomasz Moń --- .../common/boards/nrf54l15dk_remove_dt_sfdp.overlay | 13 ------------- tests/drivers/flash/common/testcase.yaml | 11 ----------- 2 files changed, 24 deletions(-) delete mode 100644 tests/drivers/flash/common/boards/nrf54l15dk_remove_dt_sfdp.overlay diff --git a/tests/drivers/flash/common/boards/nrf54l15dk_remove_dt_sfdp.overlay b/tests/drivers/flash/common/boards/nrf54l15dk_remove_dt_sfdp.overlay deleted file mode 100644 index b6ffcf23c785..000000000000 --- a/tests/drivers/flash/common/boards/nrf54l15dk_remove_dt_sfdp.overlay +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { -/delete-property/ jedec-id; -/delete-property/ sfdp-bfp; -/delete-property/ has-dpd; -/delete-property/ t-enter-dpd; -/delete-property/ t-exit-dpd; -}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 550c73ffb1d5..e5b0688deab3 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -61,17 +61,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp harness_config: fixture: external_flash - drivers.flash.common.no_explicit_erase.sfdp_runtime: - platform_allow: - - nrf54l15dk/nrf54l05/cpuapp - - nrf54l15dk/nrf54l10/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - harness_config: - fixture: external_flash - extra_configs: - - CONFIG_SPI_NOR_SFDP_RUNTIME=y - extra_args: - - DTC_OVERLAY_FILE=boards/nrf54l15dk_remove_dt_sfdp.overlay drivers.flash.common.no_explicit_erase.nrf54h: platform_allow: - nrf54h20dk/nrf54h20/cpuapp From b5f4aebe5ffed3d20b189bf0fafdf7e2874bc13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1382/3334] Revert "[nrf fromtree] tests: drivers: flash: Add missing fixtures for nrf54h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8acc899b51f87f6f3995db660f071d2b8bf0dd28. Signed-off-by: Tomasz Moń --- tests/drivers/flash/common/testcase.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index e5b0688deab3..c2a4da0a705c 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -177,8 +177,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_single_io.overlay - harness_config: - fixture: gpio_loopback drivers.flash.common.ra_qspi_nor: filter: CONFIG_FLASH_RENESAS_RA_QSPI and dt_compat_enabled("renesas,ra-qspi-nor") platform_allow: @@ -194,8 +192,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_single_io_4B_addr_sreset.overlay - harness_config: - fixture: gpio_loopback drivers.flash.common.mspi_low_frequency: platform_allow: - nrf54h20dk/nrf54h20/cpuapp From d9b0a55fae515fe4a854c549c6266a0067fb8776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1383/3334] Revert "[nrf fromtree] boards: nrf9280pdk: Add workaround for SoC1.1 data cache issue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7627de877a810c1847b5c4da79ab62ac51b851d8. Signed-off-by: Tomasz Moń --- .../nrf9280pdk_nrf9280-memory_map_iron.dtsi | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi index d3aea1f979ae..aa95021d887c 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi @@ -16,19 +16,16 @@ / { reserved-memory { - /* Workaround for a data cache related issue with SoC1.1, use secure addresses - * for cpuapp_cpusys_ipc_shm, cpusys_cpuapp_ipc_shm and cpusec_cpuapp_ipc_shm. - */ - cpuapp_cpusys_ipc_shm: memory@3f88f600 { - reg = <0x3f88f600 0x80>; + cpuapp_cpusys_ipc_shm: memory@2f88f600 { + reg = <0x2f88f600 0x80>; }; - cpusys_cpuapp_ipc_shm: memory@3f88f680 { - reg = <0x3f88f680 0x80>; + cpusys_cpuapp_ipc_shm: memory@2f88f680 { + reg = <0x2f88f680 0x80>; }; - cpusec_cpuapp_ipc_shm: memory@3f88fb80 { - reg = <0x3f88fb80 0x80>; + cpusec_cpuapp_ipc_shm: memory@2f88fb80 { + reg = <0x2f88fb80 0x80>; }; cpuapp_ironside_se_event_report: memory@2f88fc00 { From fd46997a5856d82456d0d2ca4dbc9b9f1cd2d8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1384/3334] Revert "[nrf fromtree] boards: nrf9280pdk: Fix LED pins for rev. 0.2.0 with IronSide" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ec89c552276397b52eb60290a449864e9e87e50f. Signed-off-by: Tomasz Moń --- ...f9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay index 4fa3f667eadd..f2d986e6cb06 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay @@ -5,48 +5,3 @@ */ #include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" - -/ { - aliases { - pwm-led0 = &pwm_led2; /* Alias for compatibility with samples that use pwm-led0 */ - }; - - leds { - compatible = "gpio-leds"; - - led0: led_0 { - gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - - led1: led_1 { - gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - - led2: led_2 { - gpios = <&gpio9 2 GPIO_ACTIVE_HIGH>; - label = "Green LED 2"; - }; - - led3: led_3 { - gpios = <&gpio9 3 GPIO_ACTIVE_HIGH>; - label = "Green LED 3"; - }; - }; - - pwmleds { - compatible = "pwm-leds"; - - /delete-node/ pwm_led_0; - - /* - * There is no valid hardware configuration to pass PWM signal on pins 0 and 1. - * First valid config is P9.2. This corresponds to LED 2. - * Signal on PWM130's channel 0 can be passed directly on GPIO Port 9 pin 2. - */ - pwm_led2: pwm_led_2 { - pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; - }; - }; -}; From f008c2194d392adc87cf94d67a2b408a7751ebfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1385/3334] Revert "[nrf fromlist] soc: nordic: nrf54h: uicr: Improve deps for uicr/zephyr/zephyr.hex" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e5dddc093a9c2ade30bb9660a6febf02733fccc4. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/sysbuild.cmake | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/soc/nordic/common/uicr/sysbuild.cmake b/soc/nordic/common/uicr/sysbuild.cmake index fb797b6b76ee..9cafd261036d 100644 --- a/soc/nordic/common/uicr/sysbuild.cmake +++ b/soc/nordic/common/uicr/sysbuild.cmake @@ -9,23 +9,7 @@ ExternalZephyrProject_Add( # Ensure UICR is configured and built after the default image so EDT/ELFs exist. sysbuild_add_dependencies(CONFIGURE uicr ${DEFAULT_IMAGE}) -# Add build dependencies for all images whose ELF files may be used by gen_uicr. -# The gen_uicr/CMakeLists.txt scans all sibling build directories and adds their -# ELF files as file dependencies. However, we also need target dependencies to -# ensure those images are built before uicr attempts to use their ELF files. -# -# Use cmake_language(DEFER DIRECTORY) to ensure this runs after ALL images have -# been added to the sysbuild_images global property, even if some module adds -# images after the soc subdirectory is processed. We defer to the source root -# directory to ensure we're at the top-level scope where all subdirectories have -# completed processing. -function(uicr_add_image_dependencies) - get_property(all_images GLOBAL PROPERTY sysbuild_images) - foreach(img ${all_images}) - if(NOT img STREQUAL "uicr") - add_dependencies(uicr ${img}) - endif() - endforeach() -endfunction() - -cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL uicr_add_image_dependencies) +add_dependencies(uicr ${DEFAULT_IMAGE}) +if(DEFINED image) + add_dependencies(uicr ${image}) +endif() From aaf1ff515e7c8346e2797bc03f302c7d9297c91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1386/3334] Revert "[nrf fromtree] soc: ironside: Add UUID to boot report" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0c83552cd6d012534d24a80c50bd86a22964d4aa. Signed-off-by: Tomasz Moń --- soc/nordic/ironside/include/nrf_ironside/boot_report.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/soc/nordic/ironside/include/nrf_ironside/boot_report.h b/soc/nordic/ironside/include/nrf_ironside/boot_report.h index 8c602c00134c..c4d31c9dbc59 100644 --- a/soc/nordic/ironside/include/nrf_ironside/boot_report.h +++ b/soc/nordic/ironside/include/nrf_ironside/boot_report.h @@ -116,8 +116,6 @@ #define IRONSIDE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) /** Length of the random data buffer in bytes. */ #define IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) -/** Length of the uuid buffer in bytes. */ -#define IRONSIDE_BOOT_REPORT_UUID_SIZE (16UL) /** @brief Initialization/boot status description contained in the boot report. */ struct ironside_boot_report_init_status { @@ -209,10 +207,8 @@ struct ironside_boot_report { struct ironside_boot_report_init_context init_context; /** CSPRNG data */ uint8_t random_data[IRONSIDE_BOOT_REPORT_RANDOM_DATA_SIZE]; - /** Device Info data : 128-bit Universally Unique IDentifier (UUID) */ - uint8_t device_info_uuid[IRONSIDE_BOOT_REPORT_UUID_SIZE]; /** Reserved for Future Use */ - uint32_t rfu2[60]; + uint32_t rfu2[64]; }; /** From 5459a59e217ecde938f9405d08c93dd65d2bd054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1387/3334] Revert "[nrf fromtree] net: l2: wifi: Fix override certs directory for sysbuild" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e66b9557f7a3cb9004127910f7d6eb9201ea9fe6. Signed-off-by: Tomasz Moń --- subsys/net/l2/wifi/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/net/l2/wifi/CMakeLists.txt b/subsys/net/l2/wifi/CMakeLists.txt index c3f12fe132cf..f91964d9d83a 100644 --- a/subsys/net/l2/wifi/CMakeLists.txt +++ b/subsys/net/l2/wifi/CMakeLists.txt @@ -28,8 +28,6 @@ if(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE AND CONFIG_NET_L2_WIFI_SHELL) # Wi-Fi Enterprise test certificates handling set(gen_inc_dir ${ZEPHYR_BINARY_DIR}/misc/generated) set(gen_dir ${gen_inc_dir}/wifi_enterprise_test_certs) - zephyr_get(WIFI_TEST_CERTS_DIR SYSBUILD GLOBAL) - message(DEBUG "WIFI_TEST_CERTS_DIR is set to ${WIFI_TEST_CERTS_DIR}") if(NOT DEFINED WIFI_TEST_CERTS_DIR) set(WIFI_TEST_CERTS_DIR ${ZEPHYR_BASE}/samples/net/wifi/test_certs/rsa3k) endif() From 66ef1e2ef9b90e0a70f267adbea8bc0b3d617b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1388/3334] Revert "[nrf fromtree] tests: boards: nrf: coresight_stm: Align test to STM driver" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a9167115dd645215f3e811e8705ec51ab90171de. Signed-off-by: Tomasz Moń --- .../nordic/coresight_stm/pytest/test_stm.py | 38 +++++++++---------- tests/boards/nrf/coresight_stm/prj.conf | 1 - 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/samples/boards/nordic/coresight_stm/pytest/test_stm.py b/samples/boards/nordic/coresight_stm/pytest/test_stm.py index 993df0b55fb8..6db0b5685759 100644 --- a/samples/boards/nordic/coresight_stm/pytest/test_stm.py +++ b/samples/boards/nordic/coresight_stm/pytest/test_stm.py @@ -275,9 +275,9 @@ def test_STM_decoded(dut: DeviceAdapter): app_constraints = STMLimits( # all values in us - log_0_arg=0.6, - log_1_arg=0.6, - log_2_arg=2.1, + log_0_arg=1.8, + log_1_arg=2.1, + log_2_arg=2.0, log_3_arg=2.1, log_str=4.5, tracepoint=0.5, @@ -286,35 +286,35 @@ def test_STM_decoded(dut: DeviceAdapter): ) rad_constraints = STMLimits( # all values in us - log_0_arg=5.6, - log_1_arg=5.8, - log_2_arg=6.1, - log_3_arg=6.4, - log_str=7.1, + log_0_arg=4.6, + log_1_arg=5.0, + log_2_arg=5.2, + log_3_arg=5.6, + log_str=6.3, tracepoint=0.5, tracepoint_d32=0.5, tolerance=0.5, ) ppr_constraints = STMLimits( # all values in us - log_0_arg=2.3, - log_1_arg=2.0, - log_2_arg=26.9, - log_3_arg=27.5, - log_str=68.3, + log_0_arg=25.7, + log_1_arg=27.1, + log_2_arg=27.3, + log_3_arg=30.4, + log_str=65.7, tracepoint=0.55, tracepoint_d32=0.25, tolerance=0.5, ) flpr_constraints = STMLimits( # all values in us - log_0_arg=0.2, - log_1_arg=0.2, - log_2_arg=1.2, - log_3_arg=1.2, + log_0_arg=1.3, + log_1_arg=1.6, + log_2_arg=1.6, + log_3_arg=1.7, log_str=3.0, - tracepoint=0.25, - tracepoint_d32=0.25, + tracepoint=0.5, + tracepoint_d32=0.5, tolerance=0.5, ) diff --git a/tests/boards/nrf/coresight_stm/prj.conf b/tests/boards/nrf/coresight_stm/prj.conf index 9ee7cf8cc03a..1e935e973c76 100644 --- a/tests/boards/nrf/coresight_stm/prj.conf +++ b/tests/boards/nrf/coresight_stm/prj.conf @@ -1,2 +1 @@ CONFIG_LOG=y -CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y From 553a4d31819cfee05114a8361fa8d2aedeb3ba0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1389/3334] Revert "[nrf fromtree] boards: nordic: nrf54h20dk: ETM in JLinkScript" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d6e2c6c7afde0f2c2c59f66aa613bfa3fe523523. Signed-off-by: Tomasz Moń --- .../support/nrf54h20_cpuapp.JLinkScript | 139 ++++++++-------- .../support/nrf54h20_cpurad.JLinkScript | 149 +----------------- 2 files changed, 78 insertions(+), 210 deletions(-) diff --git a/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript index d79c93417455..9738ec77f437 100644 --- a/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript +++ b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuapp.JLinkScript @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - __constant U32 _CPUCONF_ADDR = 0x52011000; __constant U32 _CPUCONF_CPUWAIT_OFFSET = 0x50C; @@ -11,17 +5,32 @@ __constant U32 _CPUCONF_CPUWAIT_OFFSET = 0x50C; __constant U32 _ATBFUNNEL211_ADDR = 0xBF04D000; __constant U32 _ATBFUNNEL212_ADDR = 0xBF04E000; __constant U32 _ATBFUNNEL_CTRLREG_OFFSET = 0x0; -__constant U32 _ATBFUNNEL_HOLDTIME_MASK = 0x700; __constant U32 _HOLDTIME_4 = 0x300; -__constant U32 _ENS0 = 0x1; // Application Core -__constant U32 _ENS1 = 0x2; // Radio Core +__constant U32 _ENS0 = 0x1; +__constant U32 _ENS1 = 0x2; +__constant U32 _ENS2 = 0x4; // ATBREPLICATOR __constant U32 _ATBREPLICATOR212_ADDR = 0xBF04A000; __constant U32 _ATBREPLICATOR213_ADDR = 0xBF04B000; __constant U32 _ATBREPLICATOR_IDFILTER0_OFFSET = 0x0; __constant U32 _ATBREPLICATOR_IDFILTER1_OFFSET = 0x4; -__constant U32 _ATBREPLICATOR_IDFILTER_ETM = 0x2; // ETM has 0x10 TRACEID +__constant U32 _ID_NONE = 0xFFFFFFFF; +__constant U32 _ID1x = 0xFFFFFFFD; + +// TSGEN +__constant U32 _TSGEN_ADDR = 0xBF041000; +__constant U32 _TSGEN_CNTCR_OFFSET = 0x0; +__constant U32 _TSGEN_CNTFID0_OFFSET = 0x20; +// Clock rate = TDD Freq. / 8 +__constant U32 _TS_CLOCKRATE = 40000000; + +// CTI +__constant U32 _CTI210_ADDR = 0xBF046000; +__constant U32 _CTICONTROL_OFFSET = 0x0; +__constant U32 _CTIOUTEN_OFFSET = 0xA0; +__constant U32 _CTIGATE_OFFSET = 0x140; +__constant U32 _TPIU_FLUSH_TRIG = 0x2; // TPIU __constant U32 _TPIU_ADDR = 0xBF043000; @@ -34,10 +43,30 @@ __constant U32 _ENFTC = 0x1; __constant U32 _TPIU_SYNC_FRAME_COUNT = 0x8; __constant U32 _CURRENTPORTSIZE_4 = 0x8; +// TDDCONF +__constant U32 _TDDCONF_ADDR = 0xBF001000; +__constant U32 _TRACEPORTSPEED_OFFSET = 0x408; +__constant U32 _SPEED80MHZ = 0x0; + // CoreSight general +__constant U32 _CORESIGHT_CLAIMSET_OFFSET = 0xFA0; +__constant U32 _CORESIGHT_CLAIMCLR_OFFSET = 0xFA4; __constant U32 _CORESIGHT_LAR_OFFSET = 0xFB0; __constant U32 _CORESIGHT_UNLOCK_KEY = 0xC5ACCE55; +// GPIO P7 +__constant U32 _P7_ADDR = 0x5F938E00; +__constant U32 _PIN_CNF3_OFFSET = 0x8C; +__constant U32 _PIN_CNF4_OFFSET = 0x90; +__constant U32 _PIN_CNF5_OFFSET = 0x94; +__constant U32 _PIN_CNF6_OFFSET = 0x98; +__constant U32 _PIN_CNF7_OFFSET = 0x9C; +__constant U32 _PIN_CNF_TPIU_CLOCK_VALUE = 0x80000503; +__constant U32 _PIN_CNF_TPIU_DATA_VALUE = 0x00000503; + +// Settings +__constant U32 _DEBUGGER_CLAIM_MASK = 0x2; + // Used to check if we have already set up tracing int _needCoresightSetup = 1; @@ -53,59 +82,68 @@ void _CSLock(U32 addr) JLINK_MEM_WriteU32(addr + _CORESIGHT_LAR_OFFSET, 0); } +// Set claim bits in the CoreSight peripheral to indicate to the firmware that it +// has been configured by the host debugger +void _CSClaim(U32 addr) +{ + JLINK_MEM_WriteU32(addr + _CORESIGHT_CLAIMSET_OFFSET, _DEBUGGER_CLAIM_MASK); +} + // Set up CoreSight and other necessary configuration so to enable ETM -> TPIU tracing. int _SetupETMTPIUTrace(void) { - U32 ctrlreg_old; - U32 ctrlreg_new; - U32 idfilter0_old; - U32 idfilter1_old; - U32 idfilter0_new; - U32 idfilter1_new; - // Set up ATB funnels/replicators to route ApplicationDomain ETM to TPIU - _CSUnlock(_ATBFUNNEL212_ADDR); - ctrlreg_old = JLINK_MEM_ReadU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET); - ctrlreg_new = (ctrlreg_old & ~_ATBFUNNEL_HOLDTIME_MASK) | _HOLDTIME_4 | _ENS0; - JLINK_MEM_WriteU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, ctrlreg_new); + JLINK_MEM_WriteU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, _HOLDTIME_4 | _ENS0); + _CSClaim(_ATBFUNNEL212_ADDR); _CSLock(_ATBFUNNEL212_ADDR); _CSUnlock(_ATBREPLICATOR212_ADDR); - idfilter0_old = JLINK_MEM_ReadU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET); - idfilter1_old = JLINK_MEM_ReadU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET); - - idfilter0_new = idfilter0_old | _ATBREPLICATOR_IDFILTER_ETM; // SET for output 0 - idfilter1_new = idfilter1_old & ~_ATBREPLICATOR_IDFILTER_ETM; // CLEAR for output 1 - - JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, idfilter0_new); - JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, idfilter1_new); + JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, _ID_NONE); + JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, _ID1x); + _CSLock(_ATBREPLICATOR212_ADDR); + _CSClaim(_ATBREPLICATOR212_ADDR); _CSLock(_ATBREPLICATOR212_ADDR); _CSUnlock(_ATBFUNNEL211_ADDR); - ctrlreg_old = JLINK_MEM_ReadU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET); - ctrlreg_new = (ctrlreg_old & ~_ATBFUNNEL_HOLDTIME_MASK) | _HOLDTIME_4 | _ENS0; - JLINK_MEM_WriteU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, ctrlreg_new); + JLINK_MEM_WriteU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, _HOLDTIME_4 | _ENS0); + _CSClaim(_ATBFUNNEL211_ADDR); _CSLock(_ATBFUNNEL211_ADDR); _CSUnlock(_ATBREPLICATOR213_ADDR); - idfilter0_old = JLINK_MEM_ReadU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET); - idfilter1_old = JLINK_MEM_ReadU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET); + JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, _ID1x); + JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, _ID_NONE); + _CSClaim(_ATBREPLICATOR213_ADDR); + _CSLock(_ATBREPLICATOR213_ADDR); - idfilter0_new = idfilter0_old & ~_ATBREPLICATOR_IDFILTER_ETM; // CLEAR for output 0 - idfilter1_new = idfilter1_old | _ATBREPLICATOR_IDFILTER_ETM; // SET for output 1 + // Configure timestamp generator for the correct clock rate + JLINK_MEM_WriteU32(_TSGEN_ADDR + _TSGEN_CNTFID0_OFFSET, _TS_CLOCKRATE); + JLINK_MEM_WriteU32(_TSGEN_ADDR + _TSGEN_CNTCR_OFFSET, 1); + _CSClaim(_TSGEN_ADDR); - JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, idfilter0_new); - JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, idfilter1_new); - _CSLock(_ATBREPLICATOR213_ADDR); + // Configure CTI1 for TPIU formatter flushing + _CSUnlock(_CTI210_ADDR); + JLINK_MEM_WriteU32(_CTI210_ADDR + _CTIOUTEN_OFFSET, _TPIU_FLUSH_TRIG); + JLINK_MEM_WriteU32(_CTI210_ADDR + _CTIGATE_OFFSET, _TPIU_FLUSH_TRIG); + JLINK_MEM_WriteU32(_CTI210_ADDR + _CTICONTROL_OFFSET, 1); + _CSClaim(_CTI210_ADDR); + _CSLock(_CTI210_ADDR); // Configure TPIU for port size 4, continuous formatting _CSUnlock(_TPIU_ADDR); JLINK_MEM_WriteU32(_TPIU_ADDR + _CURRENTPORTSIZE_OFFSET, _CURRENTPORTSIZE_4); JLINK_MEM_WriteU32(_TPIU_ADDR + _FFCR_OFFSET, _ENFCONT | _FONFLIN | _ENFTC); JLINK_MEM_WriteU32(_TPIU_ADDR + _FSCR_OFFSET, _TPIU_SYNC_FRAME_COUNT); + _CSClaim(_TPIU_ADDR); _CSLock(_TPIU_ADDR); + // Configure the trace pins + JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF3_OFFSET, _PIN_CNF_TPIU_CLOCK_VALUE); + JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF4_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); + JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF5_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); + JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF6_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); + JLINK_MEM_WriteU32(_P7_ADDR + _PIN_CNF7_OFFSET, _PIN_CNF_TPIU_DATA_VALUE); + return 0; } @@ -117,19 +155,6 @@ int ConfigTargetSettings(void) // Adjust trace sample delay to compensate for timing when using 320MHz JLINK_ExecCommand("TraceSampleAdjust TD = 1000"); - JLINK_ExecCommand("CORESIGHT_SetTPIUBaseAddr = 0xBF043000"); - - return 0; -} - -int StartTPIU(void) -{ - /* We sort this ourselves in _SetupETMTPIUTrace, don't let JLink touch it */ - return 0; -} - -int StopTPIU(void) -{ return 0; } @@ -144,11 +169,6 @@ int OnTraceStart(void) return 0; } -int AfterResetTarget(void) -{ - _needCoresightSetup = 1; - return 0; -} int SetupTarget(void) { @@ -159,8 +179,3 @@ int SetupTarget(void) return 0; } - -int InitEMU(void) { - JLINK_ExecCommand("EnableLowPowerHandlingMode"); - return 0; -} diff --git a/boards/nordic/nrf54h20dk/support/nrf54h20_cpurad.JLinkScript b/boards/nordic/nrf54h20dk/support/nrf54h20_cpurad.JLinkScript index 2ff7f6c160e3..e1861ae8c972 100644 --- a/boards/nordic/nrf54h20dk/support/nrf54h20_cpurad.JLinkScript +++ b/boards/nordic/nrf54h20dk/support/nrf54h20_cpurad.JLinkScript @@ -1,153 +1,11 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -__constant U32 _CPUCONF_ADDR = 0x52011000; +__constant U32 _CPUCONF_ADDR = 0x53011000; __constant U32 _CPUCONF_CPUWAIT_OFFSET = 0x50C; -// ATBFUNNEL -__constant U32 _ATBFUNNEL211_ADDR = 0xBF04D000; -__constant U32 _ATBFUNNEL212_ADDR = 0xBF04E000; -__constant U32 _ATBFUNNEL_CTRLREG_OFFSET = 0x0; -__constant U32 _ATBFUNNEL_HOLDTIME_MASK = 0x700; -__constant U32 _HOLDTIME_4 = 0x300; -__constant U32 _ENS0 = 0x1; // Application Core -__constant U32 _ENS1 = 0x2; // Radio Core - -// ATBREPLICATOR -__constant U32 _ATBREPLICATOR212_ADDR = 0xBF04A000; -__constant U32 _ATBREPLICATOR213_ADDR = 0xBF04B000; -__constant U32 _ATBREPLICATOR_IDFILTER0_OFFSET = 0x0; -__constant U32 _ATBREPLICATOR_IDFILTER1_OFFSET = 0x4; -__constant U32 _ATBREPLICATOR_IDFILTER_ETM = 0x2; // ETM has 0x10 TRACEID - -// TPIU -__constant U32 _TPIU_ADDR = 0xBF043000; -__constant U32 _CURRENTPORTSIZE_OFFSET = 0x4; -__constant U32 _FFCR_OFFSET = 0x304; -__constant U32 _FSCR_OFFSET = 0x308; -__constant U32 _ENFCONT = 0x02; -__constant U32 _FONFLIN = 0x10; -__constant U32 _ENFTC = 0x1; -__constant U32 _TPIU_SYNC_FRAME_COUNT = 0x8; -__constant U32 _CURRENTPORTSIZE_4 = 0x8; - -// CoreSight general -__constant U32 _CORESIGHT_LAR_OFFSET = 0xFB0; -__constant U32 _CORESIGHT_UNLOCK_KEY = 0xC5ACCE55; - -// Used to check if we have already set up tracing -int _needCoresightSetup = 1; - -// Unlock a CoreSight peripheral -void _CSUnlock(U32 addr) -{ - JLINK_MEM_WriteU32(addr + _CORESIGHT_LAR_OFFSET, _CORESIGHT_UNLOCK_KEY); -} - -// Lock a CoreSight peripheral -void _CSLock(U32 addr) -{ - JLINK_MEM_WriteU32(addr + _CORESIGHT_LAR_OFFSET, 0); -} - -// Set up CoreSight and other necessary configuration so to enable ETM -> TPIU tracing. -int _SetupETMTPIUTrace(void) -{ - U32 ctrlreg_old; - U32 ctrlreg_new; - U32 idfilter0_old; - U32 idfilter1_old; - U32 idfilter0_new; - U32 idfilter1_new; - - // Set up ATB funnels/replicators to route ApplicationDomain ETM to TPIU - - _CSUnlock(_ATBFUNNEL212_ADDR); - ctrlreg_old = JLINK_MEM_ReadU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET); - ctrlreg_new = (ctrlreg_old & ~_ATBFUNNEL_HOLDTIME_MASK) | _HOLDTIME_4 | _ENS1; - JLINK_MEM_WriteU32(_ATBFUNNEL212_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, ctrlreg_new); - _CSLock(_ATBFUNNEL212_ADDR); - - _CSUnlock(_ATBREPLICATOR212_ADDR); - idfilter0_old = JLINK_MEM_ReadU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET); - idfilter1_old = JLINK_MEM_ReadU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET); - - idfilter0_new = idfilter0_old | _ATBREPLICATOR_IDFILTER_ETM; // SET for output 0 - idfilter1_new = idfilter1_old & ~_ATBREPLICATOR_IDFILTER_ETM; // CLEAR for output 1 - - JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, idfilter0_new); - JLINK_MEM_WriteU32(_ATBREPLICATOR212_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, idfilter1_new); - _CSLock(_ATBREPLICATOR212_ADDR); - - _CSUnlock(_ATBFUNNEL211_ADDR); - ctrlreg_old = JLINK_MEM_ReadU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET); - ctrlreg_new = (ctrlreg_old & ~_ATBFUNNEL_HOLDTIME_MASK) | _HOLDTIME_4 | _ENS1; - JLINK_MEM_WriteU32(_ATBFUNNEL211_ADDR + _ATBFUNNEL_CTRLREG_OFFSET, ctrlreg_new); - _CSLock(_ATBFUNNEL211_ADDR); - - _CSUnlock(_ATBREPLICATOR213_ADDR); - idfilter0_old = JLINK_MEM_ReadU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET); - idfilter1_old = JLINK_MEM_ReadU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET); - - idfilter0_new = idfilter0_old & ~_ATBREPLICATOR_IDFILTER_ETM; // CLEAR for output 0 - idfilter1_new = idfilter1_old | _ATBREPLICATOR_IDFILTER_ETM; // SET for output 1 - - JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER0_OFFSET, idfilter0_new); - JLINK_MEM_WriteU32(_ATBREPLICATOR213_ADDR + _ATBREPLICATOR_IDFILTER1_OFFSET, idfilter1_new); - _CSLock(_ATBREPLICATOR213_ADDR); - - // Configure TPIU for port size 4, continuous formatting - _CSUnlock(_TPIU_ADDR); - JLINK_MEM_WriteU32(_TPIU_ADDR + _CURRENTPORTSIZE_OFFSET, _CURRENTPORTSIZE_4); - JLINK_MEM_WriteU32(_TPIU_ADDR + _FFCR_OFFSET, _ENFCONT | _FONFLIN | _ENFTC); - JLINK_MEM_WriteU32(_TPIU_ADDR + _FSCR_OFFSET, _TPIU_SYNC_FRAME_COUNT); - _CSLock(_TPIU_ADDR); - - return 0; -} - int ConfigTargetSettings(void) { JLINK_ExecCommand("CORESIGHT_AddAP = Index=1 Type=AHB-AP"); CORESIGHT_IndexAHBAPToUse = 1; - // Adjust trace sample delay to compensate for timing when using 320MHz - JLINK_ExecCommand("TraceSampleAdjust TD = 1000"); - - JLINK_ExecCommand("CORESIGHT_SetTPIUBaseAddr = 0xBF043000"); - - return 0; -} - -int StartTPIU(void) -{ - /* We sort this ourselves in _SetupETMTPIUTrace, don't let JLink touch it */ - return 0; -} - -int StopTPIU(void) -{ - return 0; -} - - -int OnTraceStart(void) -{ - // Set up CoreSight if not already configured - if (_needCoresightSetup) { - _SetupETMTPIUTrace(); - _needCoresightSetup = 0; - } - - return 0; -} - -int AfterResetTarget(void) -{ - _needCoresightSetup = 1; return 0; } @@ -160,8 +18,3 @@ int SetupTarget(void) return 0; } - -int InitEMU(void) { - JLINK_ExecCommand("EnableLowPowerHandlingMode"); - return 0; -} From ee8db1f8381d31537263afeef1ea96fb1526d124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1390/3334] Revert "[nrf fromtree] snippets: nordic-log-stm-tpiu-dict: Added" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b119f0af5cb8ef38d93bba3be9710b7bf0275967. Signed-off-by: Tomasz Moń --- samples/boards/nordic/coresight_stm/sample.yaml | 7 ------- snippets/nordic/nordic-log-stm-tpiu-dict/README.rst | 11 ----------- .../boards/nrf54h20_cpuapp.overlay | 11 ----------- .../nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf | 6 ------ snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml | 7 ------- 5 files changed, 42 deletions(-) delete mode 100644 snippets/nordic/nordic-log-stm-tpiu-dict/README.rst delete mode 100644 snippets/nordic/nordic-log-stm-tpiu-dict/boards/nrf54h20_cpuapp.overlay delete mode 100644 snippets/nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf delete mode 100644 snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml diff --git a/samples/boards/nordic/coresight_stm/sample.yaml b/samples/boards/nordic/coresight_stm/sample.yaml index 9ff835d8ffad..000241d4d979 100644 --- a/samples/boards/nordic/coresight_stm/sample.yaml +++ b/samples/boards/nordic/coresight_stm/sample.yaml @@ -22,13 +22,6 @@ tests: - SB_CONFIG_APP_CPUPPR_RUN=y - SB_CONFIG_APP_CPUFLPR_RUN=y - sample.boards.nrf.coresight_stm.tpiu.dict: - required_snippets: - - nordic-log-stm-tpiu-dict - extra_args: - - SB_CONFIG_APP_CPUPPR_RUN=y - - SB_CONFIG_APP_CPUFLPR_RUN=y - sample.boards.nrf.coresight_stm: harness: pytest harness_config: diff --git a/snippets/nordic/nordic-log-stm-tpiu-dict/README.rst b/snippets/nordic/nordic-log-stm-tpiu-dict/README.rst deleted file mode 100644 index 9dbf067671bf..000000000000 --- a/snippets/nordic/nordic-log-stm-tpiu-dict/README.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. _nordic-log-stm-tpiu-dict: - -Nordic Dictionary-based STM to TPIU logging snippet (nordic-log-stm-tpiu-dict) -############################################################################## - -Overview -******** - -This snippet allows users to build Zephyr with the dictionary-based logging to -the Coresight STM stimulus ports. Data is written to the TPIU interface and can -be captured with nrfutil trace to translate into a human-readable format. diff --git a/snippets/nordic/nordic-log-stm-tpiu-dict/boards/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-log-stm-tpiu-dict/boards/nrf54h20_cpuapp.overlay deleted file mode 100644 index e6f14f46a6a4..000000000000 --- a/snippets/nordic/nordic-log-stm-tpiu-dict/boards/nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&coresight { - status = "okay"; - mode = "stm-tpiu"; - pinctrl-0 = <&tpiu_default>; - pinctrl-names = "default"; -}; diff --git a/snippets/nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf b/snippets/nordic/nordic-log-stm-tpiu-dict/log_stm_dict.conf deleted file mode 100644 index 0bd8b46d387e..000000000000 --- a/snippets/nordic/nordic-log-stm-tpiu-dict/log_stm_dict.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_DEBUG_DRIVER=y diff --git a/snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml b/snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml deleted file mode 100644 index 32cd36d377ea..000000000000 --- a/snippets/nordic/nordic-log-stm-tpiu-dict/snippet.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: nordic-log-stm-tpiu-dict -append: - EXTRA_CONF_FILE: log_stm_dict.conf -boards: - /.*/nrf54h20/cpuapp/: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay From 72e9be4948038eb7f23ac50fa2a705b88b176f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1391/3334] Revert "[nrf fromtree] drivers: misc: nordic_vpr_launcher: Init order" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1c80bbd5b7071976bdd31c933c252770977cd540. Signed-off-by: Tomasz Moń --- drivers/misc/nordic_vpr_launcher/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/misc/nordic_vpr_launcher/Kconfig b/drivers/misc/nordic_vpr_launcher/Kconfig index edd2a9ead753..d00bcc583f96 100644 --- a/drivers/misc/nordic_vpr_launcher/Kconfig +++ b/drivers/misc/nordic_vpr_launcher/Kconfig @@ -18,7 +18,6 @@ source "subsys/logging/Kconfig.template.log_config" config NORDIC_VPR_LAUNCHER_INIT_PRIORITY int "Nordic VPR coprocessor launcher init priority" - default 44 if DT_HAS_NORDIC_CORESIGHT_NRF_ENABLED default 0 help The init priority of the VPR coprocessor launcher. From 71458578070c46d17e2b26d596e14435d0d4351f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1392/3334] Revert "[nrf fromtree] snippets: nordic-log-stm: Updated for coresight" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4ed4db53a5e588fbf5109de8a43cfdd781e88adc. Signed-off-by: Tomasz Moń --- samples/boards/nordic/coresight_stm/prj.conf | 1 - .../nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay | 7 +++++-- .../nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay | 9 +++++++++ snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf | 1 - snippets/nordic/nordic-log-stm-dict/snippet.yml | 3 +++ .../nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay | 7 +++++-- .../nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay | 9 +++++++++ snippets/nordic/nordic-log-stm/log_stm.conf | 1 - snippets/nordic/nordic-log-stm/snippet.yml | 3 +++ 9 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay create mode 100644 snippets/nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay diff --git a/samples/boards/nordic/coresight_stm/prj.conf b/samples/boards/nordic/coresight_stm/prj.conf index 9ee7cf8cc03a..1e935e973c76 100644 --- a/samples/boards/nordic/coresight_stm/prj.conf +++ b/samples/boards/nordic/coresight_stm/prj.conf @@ -1,2 +1 @@ CONFIG_LOG=y -CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y diff --git a/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay index 962aa231b7a9..fec548173648 100644 --- a/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay +++ b/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay @@ -7,7 +7,10 @@ status = "okay"; }; -&coresight { +&tddconf { status = "okay"; - mode = "stm-etr"; + etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR | + NRF_TDDCONF_SOURCE_STMFLPR)>; + portconfig = <0>; + etrbuffer = <&etr_buffer>; }; diff --git a/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay b/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..5bdeddd3c07f --- /dev/null +++ b/snippets/nordic/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +&tddconf { + status = "okay"; + etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>; +}; diff --git a/snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf b/snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf index 0bd8b46d387e..7384e36b92a2 100644 --- a/snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf +++ b/snippets/nordic/nordic-log-stm-dict/log_stm_dict.conf @@ -3,4 +3,3 @@ CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_LOG_FRONTEND=y CONFIG_LOG_FRONTEND_ONLY=y CONFIG_LOG_FRONTEND_STMESP=y -CONFIG_DEBUG_DRIVER=y diff --git a/snippets/nordic/nordic-log-stm-dict/snippet.yml b/snippets/nordic/nordic-log-stm-dict/snippet.yml index a717d39399b5..6e4f1c6d23e1 100644 --- a/snippets/nordic/nordic-log-stm-dict/snippet.yml +++ b/snippets/nordic/nordic-log-stm-dict/snippet.yml @@ -5,3 +5,6 @@ boards: /.*/nrf54h20/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay + /.*/nrf54h20/cpurad/: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpurad.overlay diff --git a/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay index 962aa231b7a9..fec548173648 100644 --- a/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay +++ b/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpuapp.overlay @@ -7,7 +7,10 @@ status = "okay"; }; -&coresight { +&tddconf { status = "okay"; - mode = "stm-etr"; + etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR | + NRF_TDDCONF_SOURCE_STMFLPR)>; + portconfig = <0>; + etrbuffer = <&etr_buffer>; }; diff --git a/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay b/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..5bdeddd3c07f --- /dev/null +++ b/snippets/nordic/nordic-log-stm/boards/nrf54h20_cpurad.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +&tddconf { + status = "okay"; + etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>; +}; diff --git a/snippets/nordic/nordic-log-stm/log_stm.conf b/snippets/nordic/nordic-log-stm/log_stm.conf index 46550a258cd1..1325c25b505f 100644 --- a/snippets/nordic/nordic-log-stm/log_stm.conf +++ b/snippets/nordic/nordic-log-stm/log_stm.conf @@ -4,4 +4,3 @@ CONFIG_LOG_FRONTEND=y CONFIG_LOG_FRONTEND_ONLY=y CONFIG_LOG_FRONTEND_STMESP=y CONFIG_LOG_FRONTEND_STMESP_FSC=y -CONFIG_DEBUG_DRIVER=y diff --git a/snippets/nordic/nordic-log-stm/snippet.yml b/snippets/nordic/nordic-log-stm/snippet.yml index 918379360afc..0a984a8312cc 100644 --- a/snippets/nordic/nordic-log-stm/snippet.yml +++ b/snippets/nordic/nordic-log-stm/snippet.yml @@ -5,3 +5,6 @@ boards: /.*/nrf54h20/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay + /.*/nrf54h20/cpurad/: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpurad.overlay From c05dafdbbbc8aea7bddd7dbdc662076702c40e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1393/3334] Revert "[nrf fromtree] drivers: debub: coresight: Added coresight_nrf" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6a9ecd8c5198e308248748e1b657c480b3a00130. Signed-off-by: Tomasz Moń --- drivers/debug/CMakeLists.txt | 3 +- drivers/debug/Kconfig.nrf | 65 ---- drivers/debug/coresight_arm.h | 208 ------------- drivers/debug/debug_coresight_nrf.c | 281 ------------------ drivers/debug/debug_nrf_etr.c | 13 +- dts/bindings/arm/nordic,nrf-tddconf.yaml | 44 +++ dts/bindings/debug/nordic,coresight-nrf.yaml | 22 -- dts/vendor/nordic/nrf54h20.dtsi | 79 +---- .../zephyr/dt-bindings/misc/nordic-tddconf.h | 15 + .../common/uicr/gen_periphconf_entries.py | 4 - soc/nordic/nrf54h/Kconfig | 11 + soc/nordic/nrf54h/soc.c | 18 ++ 12 files changed, 94 insertions(+), 669 deletions(-) delete mode 100644 drivers/debug/coresight_arm.h delete mode 100644 drivers/debug/debug_coresight_nrf.c create mode 100644 dts/bindings/arm/nordic,nrf-tddconf.yaml delete mode 100644 dts/bindings/debug/nordic,coresight-nrf.yaml create mode 100644 include/zephyr/dt-bindings/misc/nordic-tddconf.h diff --git a/drivers/debug/CMakeLists.txt b/drivers/debug/CMakeLists.txt index 29763be07ec1..8314379f8fa8 100644 --- a/drivers/debug/CMakeLists.txt +++ b/drivers/debug/CMakeLists.txt @@ -4,7 +4,6 @@ zephyr_library() # zephyr-keep-sorted-start -zephyr_library_sources_ifdef(CONFIG_DEBUG_CORESIGHT_NRF debug_coresight_nrf.c) -zephyr_library_sources_ifdef(CONFIG_DEBUG_NRF_ETR debug_nrf_etr.c) zephyr_library_sources_ifdef(CONFIG_DEBUG_SILABS_PTI debug_silabs_pti.c) +zephyr_library_sources_ifdef(CONFIG_DEBUG_NRF_ETR debug_nrf_etr.c) # zephyr-keep-sorted-stop diff --git a/drivers/debug/Kconfig.nrf b/drivers/debug/Kconfig.nrf index 030e9885a06d..da2721947e13 100644 --- a/drivers/debug/Kconfig.nrf +++ b/drivers/debug/Kconfig.nrf @@ -111,68 +111,3 @@ config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT endif # DEBUG_NRF_ETR_SHELL endif # DEBUG_NRF_ETR - -menuconfig DEBUG_CORESIGHT_NRF - bool "Coresight Trace support" - default y - depends on DT_HAS_NORDIC_CORESIGHT_NRF_ENABLED - select PINCTRL - select NRF_IRONSIDE_TDD_SERVICE - help - Support CoreSight peripherals in Test and Debug Domain for ARM - CoreSight System Trace Macrocell (STM) trace support. - -if DEBUG_CORESIGHT_NRF - -config DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL - def_hex 0x40 - help - Global trace ID used by STM. - -config DEBUG_CORESIGHT_NRF_STM_SYNC_BYTE_COUNT - int "STM: Emit synhronization packet every N bytes" - range 0 4095 - default 512 - -config DEBUG_CORESIGHT_NRF_STM_HWEVENTS - bool "STM: Enable hardware events" - help - Enable the output of hardware events in STM. - -config DEBUG_CORESIGHT_NRF_TPIU_FFCR_TRIG - bool "TPIU: Use flush request trigger" - default y - help - Use CTI channel 1 for triggering flush request in TPIU. - -config DEBUG_CORESIGHT_NRF_TPIU_SYNC_FRAME_COUNT - int "TPIU: Emit synchronisation packet every N frames" - default 8 - -config DEBUG_CORESIGHT_NRF_TPIU_PORTSIZE - int "TPIU: Size of the current TPIU port in bits" - range 1 32 - default 4 - -config DEBUG_CORESIGHT_NRF_ATBFUNNEL_HOLD_TIME - int "ATBFUNNEL: Hold time for the transaction" - range 1 15 - default 4 - help - Number of transactions that are output on the funnel master port from the - same slave. - -config DEBUG_CORESIGHT_NRF_TSGEN_CLK_DIV - int - default 8 - help - Clock division factor for generating trace timestamps. The timestamp - counter should not be slower than 10% of the fastest processor clock - frequency in the system, therefore its clock speed is divided by - eight. - -module = DEBUG_CORESIGHT_NRF -module-str = CoreSight Trace -source "subsys/logging/Kconfig.template.log_config" - -endif # DEBUG_CORESIGHT_NRF diff --git a/drivers/debug/coresight_arm.h b/drivers/debug/coresight_arm.h deleted file mode 100644 index b0c5da3e92d0..000000000000 --- a/drivers/debug/coresight_arm.h +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef CORESIGHT_ARM_H_ -#define CORESIGHT_ARM_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file - * @brief Generic ARM CoreSight Hardware Abstraction Layer - * - * This HAL provides generic register definitions and utility functions for ARM CoreSight - * peripherals. Platform-specific drivers should provide base addresses and use these - * generic definitions for register access. - */ - -/* Common CoreSight unlock key as defined by ARM architecture */ -#define CORESIGHT_UNLOCK_KEY (0xC5ACCE55UL) - -/* CoreSight register offsets */ - -/* Common CoreSight peripheral register offsets (found at the end of all CoreSight peripherals) */ -#define CORESIGHT_CLAIMSET_OFFSET (0xFA0UL) /* Claim Tag Set Register */ -#define CORESIGHT_CLAIMCLR_OFFSET (0xFA4UL) /* Claim Tag Clear Register */ -#define CORESIGHT_LAR_OFFSET (0xFB0UL) /* Lock Access Register */ -#define CORESIGHT_LSR_OFFSET (0xFB4UL) /* Lock Status Register */ - -/* ATB Funnel register offsets */ -#define ATBFUNNEL_CTRLREG_OFFSET (0x000UL) /* Control Register */ - -/* ATB Replicator register offsets */ -#define ATBREPLICATOR_IDFILTER0_OFFSET (0x000UL) /* ID Filter Register 0 */ -#define ATBREPLICATOR_IDFILTER1_OFFSET (0x004UL) /* ID Filter Register 1 */ - -/* ETR (Embedded Trace Router/TMC-ETR) register offsets */ -#define ETR_RSZ_OFFSET (0x004UL) /* RAM Size Register */ -#define ETR_RWP_OFFSET (0x018UL) /* RAM Write Pointer Register */ -#define ETR_CTL_OFFSET (0x020UL) /* Control Register */ -#define ETR_MODE_OFFSET (0x028UL) /* Mode Register */ -#define ETR_DBALO_OFFSET (0x118UL) /* Data Buffer Address Low Register */ -#define ETR_DBAHI_OFFSET (0x11CUL) /* Data Buffer Address High Register */ -#define ETR_FFCR_OFFSET (0x304UL) /* Formatter and Flush Control Register */ - -/* STM (System Trace Macrocell) register offsets */ -#define STM_STMHEER_OFFSET (0xD00UL) /* Hardware Event Enable Register */ -#define STM_STMHEMCR_OFFSET (0xD64UL) /* Hardware Event Master Control Register */ -#define STM_STMSPER_OFFSET (0xE00UL) /* Stimulus Port Enable Register */ -#define STM_STMTCSR_OFFSET (0xE80UL) /* Trace Control and Status Register */ -#define STM_STMTSFREQR_OFFSET (0xE8CUL) /* Timestamp Frequency Register */ -#define STM_STMSYNCR_OFFSET (0xE90UL) /* Synchronization Control Register */ -#define STM_STMAUXCR_OFFSET (0xE94UL) /* Auxiliary Control Register */ - -/* TPIU (Trace Port Interface Unit) register offsets */ -#define TPIU_CSPSR_OFFSET (0x004UL) /* Current Parallel Port Size Register */ -#define TPIU_FFCR_OFFSET (0x304UL) /* Formatter and Flush Control Register */ -#define TPIU_FSCR_OFFSET (0x308UL) /* Formatter Synchronization Counter Register */ - -/* CTI (Cross Trigger Interface) register offsets */ -#define CTI_CTICONTROL_OFFSET (0x000UL) /* CTI Control Register */ -#define CTI_CTIOUTEN0_OFFSET (0x0A0UL) /* CTI Trigger Output Enable Register 0 */ -#define CTI_CTIGATE_OFFSET (0x140UL) /* CTI Channel Gate Enable Register */ - -/* TSGEN (Timestamp Generator) register offsets */ -#define TSGEN_CNTCR_OFFSET (0x000UL) /* Counter Control Register */ -#define TSGEN_CNTFID0_OFFSET (0x020UL) /* Counter Frequency ID Register 0 */ - -/* Lock Status Register (LSR) bit fields */ -#define CORESIGHT_LSR_LOCKED_Pos (1UL) -#define CORESIGHT_LSR_LOCKED_Msk (0x1UL << CORESIGHT_LSR_LOCKED_Pos) -#define CORESIGHT_LSR_PRESENT_Pos (0UL) -#define CORESIGHT_LSR_PRESENT_Msk (0x1UL << CORESIGHT_LSR_PRESENT_Pos) - -/* STM Trace Control and Status Register (STMTCSR) bit fields */ -#define STM_STMTCSR_EN_Pos (0UL) -#define STM_STMTCSR_EN_Msk (0x1UL << STM_STMTCSR_EN_Pos) -#define STM_STMTCSR_TSEN_Pos (1UL) -#define STM_STMTCSR_TSEN_Msk (0x1UL << STM_STMTCSR_TSEN_Pos) -#define STM_STMTCSR_TRACEID_Pos (16UL) -#define STM_STMTCSR_TRACEID_Msk (0x7FUL << STM_STMTCSR_TRACEID_Pos) - -/* STM Hardware Event Master Control Register (STMHEMCR) bit fields */ -#define STM_STMHEMCR_EN_Pos (0UL) -#define STM_STMHEMCR_EN_Msk (0x1UL << STM_STMHEMCR_EN_Pos) - -/* STM Auxiliary Control Register (STMAUXCR) bit fields */ -#define STM_STMAUXCR_FIFOAF_Pos (0UL) -#define STM_STMAUXCR_FIFOAF_Msk (0x1UL << STM_STMAUXCR_FIFOAF_Pos) - -/* CTI Control Register (CTICONTROL) bit fields */ -#define CTI_CTICONTROL_GLBEN_Pos (0UL) -#define CTI_CTICONTROL_GLBEN_Msk (0x1UL << CTI_CTICONTROL_GLBEN_Pos) - -/* TPIU Formatter and Flush Control Register (FFCR) bit fields */ -#define TPIU_FFCR_ENFCONT_Pos (1UL) -#define TPIU_FFCR_ENFCONT_Msk (0x1UL << TPIU_FFCR_ENFCONT_Pos) -#define TPIU_FFCR_FONFLIN_Pos (4UL) -#define TPIU_FFCR_FONFLIN_Msk (0x1UL << TPIU_FFCR_FONFLIN_Pos) -#define TPIU_FFCR_ENFTC_Pos (0UL) -#define TPIU_FFCR_ENFTC_Msk (0x1UL << TPIU_FFCR_ENFTC_Pos) - -/* ETR Mode Register bit fields */ -#define ETR_MODE_MODE_Pos (0UL) -#define ETR_MODE_MODE_Msk (0x3UL << ETR_MODE_MODE_Pos) -#define ETR_MODE_MODE_CIRCULARBUF (0UL) /* Circular Buffer mode */ -#define ETR_MODE_MODE_SWFIFO1 (1UL) /* Software FIFO mode */ -#define ETR_MODE_MODE_HWFIFO (2UL) /* Hardware FIFO mode */ -#define ETR_MODE_MODE_SWFIFO2 (3UL) /* Software FIFO mode */ - -/* ETR Control Register bit fields */ -#define ETR_CTL_TRACECAPTEN_Pos (0UL) -#define ETR_CTL_TRACECAPTEN_Msk (0x1UL << ETR_CTL_TRACECAPTEN_Pos) - -/* ETR Formatter and Flush Control Register (FFCR) bit fields */ -#define ETR_FFCR_ENFT_Pos (0UL) -#define ETR_FFCR_ENFT_Msk (0x1UL << ETR_FFCR_ENFT_Pos) -#define ETR_FFCR_ENTI_Pos (1UL) -#define ETR_FFCR_ENTI_Msk (0x1UL << ETR_FFCR_ENTI_Pos) - -/* ATB Funnel Control Register bit fields */ -#define ATBFUNNEL_CTRLREG_ENS0_Pos (0UL) -#define ATBFUNNEL_CTRLREG_ENS0_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS0_Pos) -#define ATBFUNNEL_CTRLREG_ENS1_Pos (1UL) -#define ATBFUNNEL_CTRLREG_ENS1_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS1_Pos) -#define ATBFUNNEL_CTRLREG_ENS2_Pos (2UL) -#define ATBFUNNEL_CTRLREG_ENS2_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS2_Pos) -#define ATBFUNNEL_CTRLREG_ENS3_Pos (3UL) -#define ATBFUNNEL_CTRLREG_ENS3_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS3_Pos) -#define ATBFUNNEL_CTRLREG_ENS4_Pos (4UL) -#define ATBFUNNEL_CTRLREG_ENS4_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS4_Pos) -#define ATBFUNNEL_CTRLREG_ENS5_Pos (5UL) -#define ATBFUNNEL_CTRLREG_ENS5_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS5_Pos) -#define ATBFUNNEL_CTRLREG_ENS6_Pos (6UL) -#define ATBFUNNEL_CTRLREG_ENS6_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS6_Pos) -#define ATBFUNNEL_CTRLREG_ENS7_Pos (7UL) -#define ATBFUNNEL_CTRLREG_ENS7_Msk (0x1UL << ATBFUNNEL_CTRLREG_ENS7_Pos) -#define ATBFUNNEL_CTRLREG_HT_Pos (8UL) -#define ATBFUNNEL_CTRLREG_HT_Msk (0xFUL << ATBFUNNEL_CTRLREG_HT_Pos) - -/* TSGEN Counter Control Register bit fields */ -#define TSGEN_CNTCR_EN_Pos (0UL) -#define TSGEN_CNTCR_EN_Msk (0x1UL << TSGEN_CNTCR_EN_Pos) - -/** - * @brief Check if a CoreSight peripheral is locked - * - * @param base_addr Base address of CoreSight peripheral - * @return true if peripheral is locked, false otherwise - */ -static inline bool coresight_is_locked(mem_addr_t base_addr) -{ - uint32_t lsr = *(volatile uint32_t *)(base_addr + CORESIGHT_LSR_OFFSET); - - return (lsr & CORESIGHT_LSR_LOCKED_Msk) != 0; -} - -/** - * @brief Unlock a CoreSight peripheral - * - * @param base_addr Base address of CoreSight peripheral - * @retval 0 on success - * @retval -EIO if unlock operation failed - */ -static inline int coresight_unlock(mem_addr_t base_addr) -{ - *(volatile uint32_t *)(base_addr + CORESIGHT_LAR_OFFSET) = CORESIGHT_UNLOCK_KEY; - - if (coresight_is_locked(base_addr)) { - return -EIO; - } - - return 0; -} - -/** - * @brief Lock a CoreSight peripheral - * - * @param base_addr Base address of CoreSight peripheral - * @retval 0 on success - * @retval -EIO if lock operation failed - */ -static inline int coresight_lock(mem_addr_t base_addr) -{ - /* Write any value other than unlock key to Lock Access Register to lock */ - *(volatile uint32_t *)(base_addr + CORESIGHT_LAR_OFFSET) = 0x00000000; - - if (!coresight_is_locked(base_addr)) { - return -EIO; - } - - return 0; -} - -#ifdef __cplusplus -} -#endif - -#endif /* CORESIGHT_ARM_H_ */ diff --git a/drivers/debug/debug_coresight_nrf.c b/drivers/debug/debug_coresight_nrf.c deleted file mode 100644 index 7bc9bab68ee0..000000000000 --- a/drivers/debug/debug_coresight_nrf.c +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include -#include - -#undef ETR_MODE_MODE_CIRCULARBUF - -#include "coresight_arm.h" - -#define DT_DRV_COMPAT nordic_coresight_nrf - -#include -LOG_MODULE_REGISTER(cs_trace, CONFIG_DEBUG_CORESIGHT_NRF_LOG_LEVEL); - -#define CTI_CH_TPIU_FLUSH_REQ_OFFSET (1) - -#define TS_CLOCKRATE \ - (DT_PROP(DT_NODELABEL(hsfll200), clock_frequency) / \ - CONFIG_DEBUG_CORESIGHT_NRF_TSGEN_CLK_DIV) - -#define ATBREPLICATOR_IDFILTER_FORWARD_STM \ - BIT(CONFIG_DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL >> 4) -#define ATBFUNNEL211_STM_ENS_MASK BIT(2) - -enum coresight_nrf_mode { - CORESIGHT_NRF_MODE_UNCONFIGURED, - CORESIGHT_NRF_MODE_STM_TPIU, - CORESIGHT_NRF_MODE_STM_ETR, -}; - -struct coresight_nrf_config { - enum coresight_nrf_mode mode; - const struct pinctrl_dev_config *pcfg; -}; - -static void nrf_tsgen_init(void) -{ - mem_addr_t tsgen = DT_REG_ADDR(DT_NODELABEL(tsgen)); - - coresight_unlock(tsgen); - - sys_write32(TS_CLOCKRATE, tsgen + TSGEN_CNTFID0_OFFSET); - sys_write32(TSGEN_CNTCR_EN_Msk, tsgen + TSGEN_CNTCR_OFFSET); - - coresight_lock(tsgen); - - LOG_INF("CoreSight Host TSGEN initialized with clockrate %u", TS_CLOCKRATE); -} - -static void nrf_cti_for_tpiu_init(void) -{ - mem_addr_t cti210 = DT_REG_ADDR(DT_NODELABEL(cti210)); - - coresight_unlock(cti210); - - /* Connect CTI channel to TPIU formatter flushin */ - sys_write32(BIT(CTI_CH_TPIU_FLUSH_REQ_OFFSET), cti210 + CTI_CTIOUTEN0_OFFSET); - sys_write32(BIT(CTI_CH_TPIU_FLUSH_REQ_OFFSET), cti210 + CTI_CTIGATE_OFFSET); - sys_write32(CTI_CTICONTROL_GLBEN_Msk, cti210 + CTI_CTICONTROL_OFFSET); - - coresight_lock(cti210); - - LOG_INF("CoreSight Host CTI initialized"); -} - -static void nrf_tpiu_init(void) -{ - mem_addr_t tpiu = DT_REG_ADDR(DT_NODELABEL(tpiu)); - - coresight_unlock(tpiu); - - sys_write32(BIT((CONFIG_DEBUG_CORESIGHT_NRF_TPIU_PORTSIZE - 1)), tpiu + TPIU_CSPSR_OFFSET); - - /* Continuous formatting */ - if (IS_ENABLED(CONFIG_DEBUG_CORESIGHT_NRF_TPIU_FFCR_TRIG)) { - sys_write32((TPIU_FFCR_ENFCONT_Msk | TPIU_FFCR_FONFLIN_Msk | TPIU_FFCR_ENFTC_Msk), - tpiu + TPIU_FFCR_OFFSET); - } else { - sys_write32((TPIU_FFCR_ENFCONT_Msk | TPIU_FFCR_ENFTC_Msk), tpiu + TPIU_FFCR_OFFSET); - } - - sys_write32(CONFIG_DEBUG_CORESIGHT_NRF_TPIU_SYNC_FRAME_COUNT, tpiu + TPIU_FSCR_OFFSET); - - coresight_lock(tpiu); - - LOG_INF("CoreSight Host TPIU initialized"); -} - -static void nrf_etr_init(uintptr_t buf, size_t buf_word_len) -{ - mem_addr_t etr = DT_REG_ADDR(DT_NODELABEL(etr)); - - coresight_unlock(etr); - - sys_write32(buf_word_len, etr + ETR_RSZ_OFFSET); - sys_write32(buf, etr + ETR_RWP_OFFSET); - sys_write32(buf, etr + ETR_DBALO_OFFSET); - sys_write32(0UL, etr + ETR_DBAHI_OFFSET); - sys_write32(ETR_FFCR_ENFT_Msk, etr + ETR_FFCR_OFFSET); - sys_write32(ETR_MODE_MODE_CIRCULARBUF, etr + ETR_MODE_OFFSET); - sys_write32(ETR_CTL_TRACECAPTEN_Msk, etr + ETR_CTL_OFFSET); - - coresight_lock(etr); - - LOG_INF("Coresight Host ETR initialized"); -} - -static void nrf_stm_init(void) -{ - mem_addr_t stm = DT_REG_ADDR(DT_NODELABEL(stm)); - - coresight_unlock(stm); - - sys_write32(1, stm + STM_STMAUXCR_OFFSET); - - sys_write32(TS_CLOCKRATE, stm + STM_STMTSFREQR_OFFSET); - - sys_write32((CONFIG_DEBUG_CORESIGHT_NRF_STM_SYNC_BYTE_COUNT & 0xFFF), - stm + STM_STMSYNCR_OFFSET); - - sys_write32(0xFFFFFFFF, stm + STM_STMSPER_OFFSET); - - if (IS_ENABLED(CONFIG_DEBUG_CORESIGHT_NRF_STM_HWEVENTS)) { - sys_write32(0xFFFFFFFF, stm + STM_STMHEER_OFFSET); - sys_write32((1 << STM_STMHEMCR_EN_Pos), stm + STM_STMHEMCR_OFFSET); - } - - sys_write32(((CONFIG_DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL & STM_STMTCSR_TRACEID_Msk) - << STM_STMTCSR_TRACEID_Pos) | - (1 << STM_STMTCSR_EN_Pos) | (1 << STM_STMTCSR_TSEN_Pos), - stm + STM_STMTCSR_OFFSET); - - coresight_lock(stm); - - LOG_INF("CoreSight STM initialized with clockrate %u", TS_CLOCKRATE); -} - -static void nrf_atbfunnel_init(mem_addr_t funnel_addr, uint32_t enable_set_mask) -{ - coresight_unlock(funnel_addr); - - uint32_t ctrlreg_old = sys_read32(funnel_addr + ATBFUNNEL_CTRLREG_OFFSET); - - const uint32_t funnel_hold_time = (((CONFIG_DEBUG_CORESIGHT_NRF_ATBFUNNEL_HOLD_TIME - 1) - << ATBFUNNEL_CTRLREG_HT_Pos) & - ATBFUNNEL_CTRLREG_HT_Msk); - - uint32_t ctrlreg_new = (ctrlreg_old & ~ATBFUNNEL_CTRLREG_HT_Msk) | funnel_hold_time | - (enable_set_mask & 0xFF); - - sys_write32(ctrlreg_new, funnel_addr + ATBFUNNEL_CTRLREG_OFFSET); - - coresight_lock(funnel_addr); -} - -static void nrf_atbreplicator_init(mem_addr_t replicator_addr, uint32_t filter, bool ch0_allow, - bool ch1_allow) -{ - coresight_unlock(replicator_addr); - - uint32_t ch0_current = sys_read32(replicator_addr + ATBREPLICATOR_IDFILTER0_OFFSET); - uint32_t ch1_current = sys_read32(replicator_addr + ATBREPLICATOR_IDFILTER1_OFFSET); - - if (ch0_allow) { - sys_write32(ch0_current & ~filter, - replicator_addr + ATBREPLICATOR_IDFILTER0_OFFSET); - } else { - sys_write32(ch0_current | filter, replicator_addr + ATBREPLICATOR_IDFILTER0_OFFSET); - } - - if (ch1_allow) { - sys_write32(ch1_current & ~filter, - replicator_addr + ATBREPLICATOR_IDFILTER1_OFFSET); - } else { - sys_write32(ch1_current | filter, replicator_addr + ATBREPLICATOR_IDFILTER1_OFFSET); - } - - coresight_lock(replicator_addr); -} - -static int coresight_nrf_init_stm_etr(uintptr_t buf, size_t buf_word_len) -{ - mem_addr_t atbfunnel211 = DT_REG_ADDR(DT_NODELABEL(atbfunnel211)); - mem_addr_t atbreplicator210 = DT_REG_ADDR(DT_NODELABEL(atbreplicator210)); - mem_addr_t atbreplicator213 = DT_REG_ADDR(DT_NODELABEL(atbreplicator213)); - - nrf_atbfunnel_init(atbfunnel211, ATBFUNNEL211_STM_ENS_MASK); - nrf_atbreplicator_init(atbreplicator210, ATBREPLICATOR_IDFILTER_FORWARD_STM, false, true); - nrf_atbreplicator_init(atbreplicator213, ATBREPLICATOR_IDFILTER_FORWARD_STM, false, true); - - nrf_tsgen_init(); - nrf_etr_init(buf, buf_word_len); - nrf_stm_init(); - - return 0; -} - -static int coresight_nrf_init_stm_tpiu(void) -{ - mem_addr_t atbfunnel211 = DT_REG_ADDR(DT_NODELABEL(atbfunnel211)); - mem_addr_t atbreplicator210 = DT_REG_ADDR(DT_NODELABEL(atbreplicator210)); - mem_addr_t atbreplicator213 = DT_REG_ADDR(DT_NODELABEL(atbreplicator213)); - - nrf_atbfunnel_init(atbfunnel211, ATBFUNNEL211_STM_ENS_MASK); - nrf_atbreplicator_init(atbreplicator210, ATBREPLICATOR_IDFILTER_FORWARD_STM, false, true); - nrf_atbreplicator_init(atbreplicator213, ATBREPLICATOR_IDFILTER_FORWARD_STM, true, false); - - nrf_tsgen_init(); - nrf_cti_for_tpiu_init(); - nrf_tpiu_init(); - nrf_stm_init(); - - return 0; -} - -static int coresight_nrf_init(const struct device *dev) -{ - int err; - struct coresight_nrf_config *cfg = (struct coresight_nrf_config *)dev->config; - - if (cfg->pcfg) { - err = pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_DEFAULT); - if (err) { - LOG_ERR("Failed to configure pins (%d)", err); - return err; - } - } - - err = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT); - if (err) { - LOG_ERR("Failed to configure TDD (%d)", err); - return err; - } - - switch (cfg->mode) { - case CORESIGHT_NRF_MODE_UNCONFIGURED: { - return 0; - } - case CORESIGHT_NRF_MODE_STM_TPIU: { - return coresight_nrf_init_stm_tpiu(); - } - case CORESIGHT_NRF_MODE_STM_ETR: { - uintptr_t etr_buffer = DT_REG_ADDR(DT_NODELABEL(etr_buffer)); - size_t buf_word_len = DT_REG_SIZE(DT_NODELABEL(etr_buffer)) / sizeof(uint32_t); - - return coresight_nrf_init_stm_etr(etr_buffer, buf_word_len); - } - default: { - LOG_ERR("Unsupported Coresight mode"); - return -ENOTSUP; - } - } - return 0; -} - -#define DEBUG_CORESIGHT_NRF_INIT_PRIORITY UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY) - -#define CORESIGHT_NRF_INST(inst) \ - COND_CODE_1(DT_INST_PINCTRL_HAS_IDX(inst, 0), \ - (PINCTRL_DT_INST_DEFINE(inst);), ()) \ - \ - static struct coresight_nrf_config coresight_nrf_cfg_##inst = { \ - .mode = _CONCAT(CORESIGHT_NRF_MODE_, \ - DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), mode)), \ - .pcfg = COND_CODE_1(DT_INST_PINCTRL_HAS_IDX(inst, 0), \ - (PINCTRL_DT_INST_DEV_CONFIG_GET(inst)), \ - (NULL)) }; \ - \ - DEVICE_DT_INST_DEFINE(inst, coresight_nrf_init, NULL, NULL, &coresight_nrf_cfg_##inst, \ - POST_KERNEL, DEBUG_CORESIGHT_NRF_INIT_PRIORITY, NULL); - -DT_INST_FOREACH_STATUS_OKAY(CORESIGHT_NRF_INST) diff --git a/drivers/debug/debug_nrf_etr.c b/drivers/debug/debug_nrf_etr.c index d536cd4a9f40..da425716dbbe 100644 --- a/drivers/debug/debug_nrf_etr.c +++ b/drivers/debug/debug_nrf_etr.c @@ -768,7 +768,6 @@ int etr_process_init(void) 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))); - nrfx_tbm_start(); #ifdef CONFIG_DEBUG_NRF_ETR_SHELL uint32_t level = CONFIG_LOG_MAX_LEVEL; @@ -792,17 +791,7 @@ int etr_process_init(void) return 0; } -#define NRF_ETR_INIT_PRIORITY UTIL_INC(UTIL_INC(CONFIG_NRF_IRONSIDE_CALL_INIT_PRIORITY)) - -SYS_INIT(etr_process_init, POST_KERNEL, NRF_ETR_INIT_PRIORITY); - -#if defined(CONFIG_NORDIC_VPR_LAUNCHER) && defined(CONFIG_LOG_FRONTEND_STMESP_FSC) -/* TDD/ETR must be up and running before VPR cores are started as they write to - * ETR some vital initial data that cannot be lost. - */ -BUILD_ASSERT(CONFIG_NORDIC_VPR_LAUNCHER_INIT_PRIORITY > NRF_ETR_INIT_PRIORITY); -#endif - +SYS_INIT(etr_process_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); #ifdef CONFIG_DEBUG_NRF_ETR_SHELL diff --git a/dts/bindings/arm/nordic,nrf-tddconf.yaml b/dts/bindings/arm/nordic,nrf-tddconf.yaml new file mode 100644 index 000000000000..2273082c12f9 --- /dev/null +++ b/dts/bindings/arm/nordic,nrf-tddconf.yaml @@ -0,0 +1,44 @@ +# 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: + etbsources: + type: int + description: | + Bitmask of enabled sources for the ETB sink. Valid values can be found in + dt-bindings/misc/nordic-tddconf.h + + tpiusources: + type: int + description: | + Bitmask of enabled sources for the TPIU sink. Valid values can be found in + dt-bindings/misc/nordic-tddconf.h + + etrsources: + type: int + description: | + Bitmask of enabled sources for the ETR sink. Valid values can be found in + dt-bindings/misc/nordic-tddconf.h + + portconfig: + type: int + default: 3 + description: TPIU clock divider - TDD HSFLL / 2^(2 + portconfig) + enum: + - 0 + - 1 + - 2 + - 3 + + etrbuffer: + description: phandle to the memory region used for the ETR buffer + type: phandle diff --git a/dts/bindings/debug/nordic,coresight-nrf.yaml b/dts/bindings/debug/nordic,coresight-nrf.yaml deleted file mode 100644 index fec4f37ce5a9..000000000000 --- a/dts/bindings/debug/nordic,coresight-nrf.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic Coresight Subsystem (Trace Port Interface Unit) - -compatible: "nordic,coresight-nrf" - -include: [base.yaml, pinctrl-device.yaml, nordic-clockpin.yaml] - -properties: - reg: - required: true - - mode: - required: true - type: string - enum: - - "unconfigured" - - "stm-tpiu" - - "stm-etr" - description: > - Specifies which mode to configure the Coresight subsystem in. diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 62ab535006bd..b3a960e740b9 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -13,6 +13,7 @@ #include #include #include +#include /delete-node/ &sw_pwm; @@ -531,82 +532,10 @@ interrupts = <127 NRF_DEFAULT_IRQ_PRIORITY>; }; - hsfll200: clock@4000 { - compatible = "fixed-clock"; - reg = <0x4000 0x1000>; - #clock-cells = <0>; - status = "disabled"; - clock-frequency = ; - }; - - coresight: coresight@40000 { - compatible = "nordic,coresight-nrf"; - reg = <0x40000 0x11000>; + tddconf: tddconf@1000 { + compatible = "nordic,nrf-tddconf"; + reg = <0x1000 0x10>; status = "disabled"; - nordic,clockpin-enable = ; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x40000 0x11000>; - - tsgen: tsgen@1000 { - reg = <0x1000 0x1000>; - }; - - stm: stm@2000 { - reg = <0x2000 0x1000>; - }; - - tpiu: tpiu@3000 { - reg = <0x3000 0x1000>; - }; - - etb: etb@4000 { - reg = <0x4000 0x1000>; - }; - - etr: etr@5000 { - reg = <0x5000 0x1000>; - }; - - cti210: cti@6000 { - reg = <0x6000 0x1000>; - }; - - cti211: cti@7000 { - reg = <0x7000 0x1000>; - }; - - atbreplicator210: atbreplicator@8000 { - reg = <0x8000 0x1000>; - }; - - atbreplicator211: atbreplicator@9000 { - reg = <0x9000 0x1000>; - }; - - atbreplicator212: atbreplicator@A000 { - reg = <0xA000 0x1000>; - }; - - atbreplicator213: atbreplicator@B000 { - reg = <0xB000 0x1000>; - }; - - atbfunnel210: atbfunnel@C000 { - reg = <0xC000 0x1000>; - }; - - atbfunnel211: atbfunnel@D000 { - reg = <0xD000 0x1000>; - }; - - atbfunnel212: atbfunnel@E000 { - reg = <0xE000 0x1000>; - }; - - atbfunnel213: atbfunnel@F000 { - reg = <0xF000 0x1000>; - }; }; }; diff --git a/include/zephyr/dt-bindings/misc/nordic-tddconf.h b/include/zephyr/dt-bindings/misc/nordic-tddconf.h new file mode 100644 index 000000000000..44bc74e491c0 --- /dev/null +++ b/include/zephyr/dt-bindings/misc/nordic-tddconf.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_TDDCONF_H_ +#define ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_TDDCONF_H_ + +#define NRF_TDDCONF_SOURCE_STMMAINCORE BIT(0) +#define NRF_TDDCONF_SOURCE_ETMMAINCORE BIT(1) +#define NRF_TDDCONF_SOURCE_STMHWEVENTS BIT(2) +#define NRF_TDDCONF_SOURCE_STMPPR BIT(3) +#define NRF_TDDCONF_SOURCE_STMFLPR BIT(4) + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_TDDCONF_H_ */ diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index 9a273dab7a59..d3b79e43f149 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -121,10 +121,6 @@ def main() -> None: for node in dt.label2node["global_peripherals"].children.values(): builder.add_global_peripheral_cfg(node, **get_additional_node_kwargs(node)) - # TDD (Trace and Debug Domain) peripherals - contains coresight/TPIU - for node in dt.label2node["tdd_peripherals"].children.values(): - builder.add_global_peripheral_cfg(node, **get_additional_node_kwargs(node)) - # Add pins referenced by 'gpios' properties on non-peripheral nodes, for example # buttons and leds. We only add SPU configurations for these and not CTRLSEL, # to avoid false CTRLSEL conflicts for things like PWM leds. diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 85d55ebf1aa8..de88045d32fb 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -66,6 +66,17 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_PM select HAS_POWEROFF +config SOC_NRF54H20_TDD_ENABLE + bool "Power and configure the trace and debug domain (TDD)" + depends on SOC_NRF54H20_CPUAPP + select NRF_IRONSIDE_TDD_SERVICE + select SOC_LATE_INIT_HOOK + help + This will at application boot time request that the trace and + debug domain (TDD) is powered up and configured. + This allows configuring the coresight peripherals from + the application domain. + config SOC_NRF54H20_CPURAD_ENABLE bool "Boot the nRF54H20 Radio core" default y if NRF_802154_SER_HOST || BT_HCI_HOST diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 8493aa03bc34..1206e6767aa2 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,10 +22,14 @@ #include #include #include +#include #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) #include #endif +#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE) +#include +#endif LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -179,6 +183,20 @@ void soc_early_init_hook(void) void soc_late_init_hook(void) { +#if defined(CONFIG_SOC_NRF54H20_TDD_ENABLE) + int err_tdd; + + err_tdd = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_DEFAULT); + __ASSERT(err_tdd == 0, "err_tdd was %d", err_tdd); + + UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 3, GPIO_PIN_CNF_CTRLSEL_TND); + UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 4, GPIO_PIN_CNF_CTRLSEL_TND); + UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 5, GPIO_PIN_CNF_CTRLSEL_TND); + UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 6, GPIO_PIN_CNF_CTRLSEL_TND); + UICR_GPIO_PIN_CNF_CTRLSEL_SET(NRF_P7, 7, GPIO_PIN_CNF_CTRLSEL_TND); + +#endif + #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) int err_cpuconf; From 8181870bb4abdecc31a560ea487fa61684be0886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1394/3334] Revert "[nrf fromtree] drivers: pinctrl_nrf: Add coresight tpiu pins" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 23b342295481943c2a5dfacbef512124a09e6d58. Signed-off-by: Tomasz Moń --- .../nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi | 11 ----------- drivers/pinctrl/pinctrl_nrf.c | 11 ----------- include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 12 +----------- soc/nordic/common/uicr/gen_periphconf_entries.py | 8 -------- soc/nordic/common/uicr/periphconf/builder.py | 8 -------- 5 files changed, 1 insertion(+), 49 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi index 0e2ab313df9b..f62df87dfe26 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi @@ -138,15 +138,4 @@ low-power-enable; }; }; - - /omit-if-no-ref/ tpiu_default: tpiu_default { - group1 { - psels = , - , - , - , - ; - nordic,drive-mode = ; - }; - }; }; diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index ac9b17d27b39..429ed761e614 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -557,17 +557,6 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* defined(NRF_PSEL_TWIS) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_coresight_nrf) - /* Pin routing is controlled by secure domain, via UICR */ - case NRF_FUN_TPIU_CLOCK: - case NRF_FUN_TPIU_DATA0: - case NRF_FUN_TPIU_DATA1: - case NRF_FUN_TPIU_DATA2: - case NRF_FUN_TPIU_DATA3: - dir = NRF_GPIO_PIN_DIR_OUTPUT; - input = NRF_GPIO_PIN_INPUT_DISCONNECT; - break; -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_coresight_nrf) */ default: return -ENOTSUP; } diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 92e62a9a6bed..42b302193ed0 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -187,17 +187,7 @@ /** TDM MCK */ #define NRF_FUN_TDM_MCK 77U /** SPI master CSN */ -#define NRF_FUN_SPIM_CSN 78U -/** TPIU CLOCK */ -#define NRF_FUN_TPIU_CLOCK 79U -/** TPIU DATA0 */ -#define NRF_FUN_TPIU_DATA0 80U -/** TPIU DATA1 */ -#define NRF_FUN_TPIU_DATA1 81U -/** TPIU DATA2 */ -#define NRF_FUN_TPIU_DATA2 82U -/** TPIU DATA3 */ -#define NRF_FUN_TPIU_DATA3 83U +#define NRF_FUN_SPIM_CSN 78U /** @} */ diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index d3b79e43f149..4308df31449f 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -425,14 +425,6 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: NrfPsel(fun=NrfFun.IGNORE, port=2, pin=10): Ctrlsel.CAN, NrfPsel(fun=NrfFun.IGNORE, port=2, pin=11): Ctrlsel.CAN, }, - # Coresight (TPIU) - 0xBF04_0000: { - NrfPsel(fun=NrfFun.TPIU_CLOCK, port=7, pin=3): Ctrlsel.TND, - NrfPsel(fun=NrfFun.TPIU_DATA0, port=7, pin=4): Ctrlsel.TND, - NrfPsel(fun=NrfFun.TPIU_DATA1, port=7, pin=5): Ctrlsel.TND, - NrfPsel(fun=NrfFun.TPIU_DATA2, port=7, pin=6): Ctrlsel.TND, - NrfPsel(fun=NrfFun.TPIU_DATA3, port=7, pin=7): Ctrlsel.TND, - }, } elif soc == Soc.NRF9280: ctrlsel_lookup = { diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py index b8387fd9a756..1a343dee44a0 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -41,9 +41,6 @@ "nordic,nrf-temp", "nordic,nrf-vevif-task-tx", "nordic,nrf-vevif-task-rx", - # No retention in TDD so permissions can't be set outside of the TDD service - "nordic,coresight-nrf", - "nordic,nrf-tbm", } # Compatibles of global peripherals that should be assigned to the current core but do not have DMA @@ -1021,11 +1018,6 @@ class NrfFun(int, enum.Enum): TDM_SDOUT = 76 TDM_MCK = 77 SPIM_CSN = 78 - TPIU_CLOCK = 79 - TPIU_DATA0 = 80 - TPIU_DATA1 = 81 - TPIU_DATA2 = 82 - TPIU_DATA3 = 83 # Value used to ignore the function field and only check (port, pin) IGNORE = -1 From 98345868a9f428d9f340858550818ddb54c72f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:59 +0100 Subject: [PATCH 1395/3334] Revert "[nrf fromtree] drivers: debug: Moved nrf_etr from misc" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d69be6e9a9f2d404f86861a8b913d5a13e7f6be3. Signed-off-by: Tomasz Moń --- doc/services/logging/cs_stm.rst | 4 +- drivers/debug/CMakeLists.txt | 1 - drivers/debug/Kconfig | 1 - drivers/misc/CMakeLists.txt | 1 + drivers/misc/Kconfig | 1 + drivers/misc/coresight/CMakeLists.txt | 4 + .../Kconfig.nrf => misc/coresight/Kconfig} | 40 +++++----- .../coresight/nrf_etr.c} | 74 +++++++++---------- .../{debug => misc}/nordic,nrf-tbm.yaml | 0 .../coresight/nrf_etr.h} | 8 +- .../{debug => misc/coresight}/stmesp.h | 6 +- include/zephyr/logging/log_frontend_stmesp.h | 2 +- .../nordic/coresight_stm/pytest/test_stm.py | 2 +- .../nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 2 +- subsys/logging/frontends/Kconfig | 4 +- .../logging/frontends/log_frontend_stmesp.c | 13 ++-- 16 files changed, 82 insertions(+), 81 deletions(-) create mode 100644 drivers/misc/coresight/CMakeLists.txt rename drivers/{debug/Kconfig.nrf => misc/coresight/Kconfig} (79%) rename drivers/{debug/debug_nrf_etr.c => misc/coresight/nrf_etr.c} (92%) rename dts/bindings/{debug => misc}/nordic,nrf-tbm.yaml (100%) rename include/zephyr/drivers/{debug/debug_nrf_etr.h => misc/coresight/nrf_etr.h} (52%) rename include/zephyr/drivers/{debug => misc/coresight}/stmesp.h (96%) diff --git a/doc/services/logging/cs_stm.rst b/doc/services/logging/cs_stm.rst index 77b097d65161..75a371dfd24e 100644 --- a/doc/services/logging/cs_stm.rst +++ b/doc/services/logging/cs_stm.rst @@ -119,7 +119,7 @@ When using logs, this method has the following advantages: 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/debug/debug_nrf_etr.c`. +:zephyr_file:`drivers/misc/coresight/nrf_etr.c`. Configuration ------------- @@ -175,7 +175,7 @@ in :zephyr_file:`subsys/logging/frontends/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/debug/debug_nrf_etr.c`. It is using :ref:`cs_trace_defmt` and +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 diff --git a/drivers/debug/CMakeLists.txt b/drivers/debug/CMakeLists.txt index 8314379f8fa8..54ca9f71694e 100644 --- a/drivers/debug/CMakeLists.txt +++ b/drivers/debug/CMakeLists.txt @@ -5,5 +5,4 @@ zephyr_library() # zephyr-keep-sorted-start zephyr_library_sources_ifdef(CONFIG_DEBUG_SILABS_PTI debug_silabs_pti.c) -zephyr_library_sources_ifdef(CONFIG_DEBUG_NRF_ETR debug_nrf_etr.c) # zephyr-keep-sorted-stop diff --git a/drivers/debug/Kconfig b/drivers/debug/Kconfig index b38c5206f3cb..68c23fdf1243 100644 --- a/drivers/debug/Kconfig +++ b/drivers/debug/Kconfig @@ -15,7 +15,6 @@ config DEBUG_DRIVER_INIT_PRIORITY Debug drivers initialization priority. # zephyr-keep-sorted-start -source "drivers/debug/Kconfig.nrf" source "drivers/debug/Kconfig.silabs" # zephyr-keep-sorted-stop diff --git a/drivers/misc/CMakeLists.txt b/drivers/misc/CMakeLists.txt index 8426090ab14e..437bd124247a 100644 --- a/drivers/misc/CMakeLists.txt +++ b/drivers/misc/CMakeLists.txt @@ -15,4 +15,5 @@ add_subdirectory_ifdef(CONFIG_RENESAS_RX_EXTERNAL_INTERRUPT renesas_rx_external_ add_subdirectory_ifdef(CONFIG_NXP_RTXXX_DSP_CTRL nxp_rtxxx_dsp_ctrl) add_subdirectory_ifdef(CONFIG_STM32N6_AXISRAM stm32n6_axisram) +add_subdirectory(coresight) add_subdirectory(interconn) diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 0a3af14dc2c0..6d4d5cfc16fe 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -15,6 +15,7 @@ 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" source "drivers/misc/interconn/Kconfig" source "drivers/misc/renesas_ra_external_interrupt/Kconfig" source "drivers/misc/renesas_rx_external_interrupt/Kconfig" diff --git a/drivers/misc/coresight/CMakeLists.txt b/drivers/misc/coresight/CMakeLists.txt new file mode 100644 index 000000000000..1ec34ca2f75a --- /dev/null +++ b/drivers/misc/coresight/CMakeLists.txt @@ -0,0 +1,4 @@ +# 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/debug/Kconfig.nrf b/drivers/misc/coresight/Kconfig similarity index 79% rename from drivers/debug/Kconfig.nrf rename to drivers/misc/coresight/Kconfig index da2721947e13..997d0c23c0a5 100644 --- a/drivers/debug/Kconfig.nrf +++ b/drivers/misc/coresight/Kconfig @@ -3,7 +3,7 @@ DT_COMPAT_NORDIC_NRF_TBM := nordic,nrf-tbm -config DEBUG_NRF_ETR +config NRF_ETR bool "Coresight ETR handler (with Nordic TBM)" depends on $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_TBM)) select NRFX_TBM @@ -14,9 +14,9 @@ config DEBUG_NRF_ETR data). Busyness is tracked using TBM (Trace Buffer Monitor) peripheral which is specific to Nordic Semiconductor SoCs. -if DEBUG_NRF_ETR +if NRF_ETR -config DEBUG_NRF_ETR_DECODE +config NRF_ETR_DECODE bool "Decode ETR content" default y if LOG_FRONTEND_STMESP_FSC select MIPI_STP_DECODER @@ -29,14 +29,14 @@ config DEBUG_NRF_ETR_DECODE In this mode, log messages stored by Coresight STM logging frontends are decoded and printed in the human readable form. -config DEBUG_NRF_ETR_DECODE_DROP_PERIOD +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 DEBUG_NRF_ETR_DEBUG +config NRF_ETR_DEBUG bool "Debug mode" depends on !LOG_PRINTK select MIPI_STP_DECODER @@ -44,18 +44,18 @@ config DEBUG_NRF_ETR_DEBUG help In debug mode STPv2 decoded data is printed. -config DEBUG_NRF_ETR_STACK_SIZE +config NRF_ETR_STACK_SIZE int "ETR thread stack size" - default 2048 if DEBUG_NRF_ETR_DECODE || DEBUG_NRF_ETR_DEBUG + default 2048 if NRF_ETR_DECODE || NRF_ETR_DEBUG default 1024 -config DEBUG_NRF_ETR_BACKOFF +config NRF_ETR_BACKOFF int "Thread backoff time (ms)" default 10 help Determines how often attempt to dump the data is performed. -config DEBUG_NRF_ETR_FLUSH_TIMEOUT +config NRF_ETR_FLUSH_TIMEOUT int "Backoff time during flushing (ms)" default 100 help @@ -63,10 +63,10 @@ config DEBUG_NRF_ETR_FLUSH_TIMEOUT there is still a pending ETR data. This option specifies how often thread is waking up to check. Given in milliseconds. -config DEBUG_NRF_ETR_SYNC_PERIOD +config NRF_ETR_SYNC_PERIOD int "Period of custom synchronization frame" - default 0 if DEBUG_NRF_ETR_DECODE - default 0 if DEBUG_NRF_ETR_DEBUG + 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 @@ -74,25 +74,25 @@ config DEBUG_NRF_ETR_SYNC_PERIOD sent on regular intervals. This frame is sent between Coresight formatter frames. Use 0 to disable. -config DEBUG_NRF_ETR_SHELL +config NRF_ETR_SHELL bool "Use shell" select UART_ASYNC_API select UART_ASYNC_RX_HELPER select SHELL_LOG_BACKEND_CUSTOM - depends on DEBUG_NRF_ETR_DECODE + depends on NRF_ETR_DECODE default y if SHELL help Enable shell with Coresight STM logging support. -if DEBUG_NRF_ETR_SHELL +if NRF_ETR_SHELL -config DEBUG_NRF_ETR_SHELL_PROMPT +config NRF_ETR_SHELL_PROMPT string "Displayed prompt name" default "uart:~$ " help Displayed prompt name for UART shell with Coresight STM logging. -config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE +config NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE int "Size of the RX buffer" default 16 help @@ -101,13 +101,13 @@ config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE slow and may need to be increased if long messages are pasted directly to the shell prompt. -config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT +config NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT int "Number of RX buffers" default 4 range 2 64 help Number of RX buffers. -endif # DEBUG_NRF_ETR_SHELL +endif # NRF_ETR_SHELL -endif # DEBUG_NRF_ETR +endif # NRF_ETR diff --git a/drivers/debug/debug_nrf_etr.c b/drivers/misc/coresight/nrf_etr.c similarity index 92% rename from drivers/debug/debug_nrf_etr.c rename to drivers/misc/coresight/nrf_etr.c index da425716dbbe..bf1aecd6f5b4 100644 --- a/drivers/debug/debug_nrf_etr.c +++ b/drivers/misc/coresight/nrf_etr.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -29,15 +29,15 @@ LOG_MODULE_REGISTER(cs_etr_tbm); #define ETR_BUFFER_NODE DT_NODELABEL(etr_buffer) #define DROP_CHECK_PERIOD \ - COND_CODE_1(CONFIG_DEBUG_NRF_ETR_DECODE, \ - (CONFIG_DEBUG_NRF_ETR_DECODE_DROP_PERIOD), (0)) + COND_CODE_1(CONFIG_NRF_ETR_DECODE, \ + (CONFIG_NRF_ETR_DECODE_DROP_PERIOD), (0)) #define MIN_DATA (2 * CORESIGHT_TRACE_FRAME_SIZE32) /* 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_DEBUG_NRF_ETR_DEBUG, (printk(__VA_ARGS__))) +#define DBG(...) IF_ENABLED(CONFIG_NRF_ETR_DEBUG, (printk(__VA_ARGS__))) /** @brief Macro for dumping debug data. * @@ -86,10 +86,10 @@ static const struct device *uart_dev = DEVICE_DT_GET(UART_NODE); static uint32_t frame_buf0[CORESIGHT_TRACE_FRAME_SIZE32] DMM_MEMORY_SECTION(UART_NODE); static uint32_t frame_buf1[CORESIGHT_TRACE_FRAME_SIZE32] DMM_MEMORY_SECTION(UART_NODE); static uint32_t frame_buf_decode[CORESIGHT_TRACE_FRAME_SIZE32]; -static uint32_t *frame_buf = IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) ? +static uint32_t *frame_buf = IS_ENABLED(CONFIG_NRF_ETR_DECODE) ? frame_buf_decode : frame_buf0; -K_KERNEL_STACK_DEFINE(etr_stack, CONFIG_DEBUG_NRF_ETR_STACK_SIZE); +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); @@ -134,10 +134,9 @@ static const char *const hw_evts[] = { "GD0 HS down", /* 31 Global domain high speed 0 down */ }; -#ifdef CONFIG_DEBUG_NRF_ETR_SHELL +#ifdef CONFIG_NRF_ETR_SHELL #define RX_BUF_SIZE \ - (CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE * \ - CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT) + (CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE * CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT) static void etr_timer_handler(struct k_timer *timer); K_TIMER_DEFINE(etr_timer, etr_timer_handler, NULL); @@ -279,7 +278,7 @@ static void message_process(union log_frontend_stmesp_demux_packet packet) */ static void sync_loss(void) { - if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { + if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { mipi_stp_decoder_sync_loss(); log_frontend_stmesp_demux_reset(); oosync_cnt++; @@ -293,7 +292,7 @@ static void sync_loss(void) */ static void on_resync(void) { - if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { + if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { in_sync = true; } } @@ -366,7 +365,7 @@ static void decoder_cb(enum mipi_stp_decoder_ctrl_type type, decoder_cb_debug(type, data, ts, marked); - if (!IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { + if (!IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { return; } @@ -550,7 +549,7 @@ static void dump_frame(uint8_t *buf) static void process(void) { static const uint32_t *const etr_buf = (uint32_t *)(DT_REG_ADDR(ETR_BUFFER_NODE)); - static uint32_t sync_cnt = CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD; + static uint32_t sync_cnt; uint32_t pending; /* If function is called in panic mode then it may interrupt ongoing @@ -563,7 +562,7 @@ static void process(void) */ while ((pending = pending_data()) >= MIN_DATA) { /* Do not read the data that has already been read but not yet processed. */ - if (sync_cnt || (CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD == 0)) { + 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); @@ -573,12 +572,11 @@ static void process(void) rd_idx_inc(); __sync_synchronize(); } else { - sync_cnt = CONFIG_DEBUG_NRF_ETR_SYNC_PERIOD; + sync_cnt = CONFIG_NRF_ETR_SYNC_PERIOD; memset(frame_buf, 0xff, CORESIGHT_TRACE_FRAME_SIZE); } - if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || - IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) { + 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 @@ -588,7 +586,7 @@ static void process(void) } process_frame((uint8_t *)frame_buf, pending); - if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { + if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { process_messages(); } } else { @@ -614,7 +612,7 @@ static int decoder_init(void) } once = true; - if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE)) { + 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), @@ -637,12 +635,12 @@ static int decoder_init(void) return 0; } -void debug_nrf_etr_flush(void) +void nrf_etr_flush(void) { int cnt = 4; - if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || - IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) { + if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || + IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { (void)decoder_init(); } @@ -660,13 +658,13 @@ void debug_nrf_etr_flush(void) irq_unlock(k); } -#ifndef CONFIG_DEBUG_NRF_ETR_SHELL +#ifndef CONFIG_NRF_ETR_SHELL static void etr_thread_func(void *dummy1, void *dummy2, void *dummy3) { uint64_t checkpoint = 0; - if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || - IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) { + if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || + IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { int err; err = decoder_init(); @@ -690,7 +688,7 @@ static void etr_thread_func(void *dummy1, void *dummy2, void *dummy3) } } - k_sleep(K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF)); + k_sleep(K_MSEC(CONFIG_NRF_ETR_BACKOFF)); } } #endif @@ -705,7 +703,7 @@ static void uart_event_handler(const struct device *dev, struct uart_event *evt, case UART_TX_DONE: k_sem_give(&uart_sem); break; -#ifdef CONFIG_DEBUG_NRF_ETR_SHELL +#ifdef CONFIG_NRF_ETR_SHELL case UART_RX_RDY: uart_async_rx_on_rdy(&async_rx, evt->data.rx.buf, evt->data.rx.len); shell_handler(SHELL_TRANSPORT_EVT_RX_RDY, shell_context); @@ -731,7 +729,7 @@ static void uart_event_handler(const struct device *dev, struct uart_event *evt, break; case UART_RX_DISABLED: break; -#endif /* CONFIG_DEBUG_NRF_ETR_SHELL */ +#endif /* CONFIG_NRF_ETR_SHELL */ default: __ASSERT_NO_MSG(0); } @@ -745,7 +743,7 @@ static void tbm_event_handler(nrf_tbm_event_t event) tbm_full = true; } -#ifdef CONFIG_DEBUG_NRF_ETR_SHELL +#ifdef CONFIG_NRF_ETR_SHELL k_poll_signal_raise(&etr_shell.ctx->signals[SHELL_SIGNAL_LOG_MSG], 0); #else k_wakeup(&etr_thread); @@ -769,14 +767,14 @@ int etr_process_init(void) nrfx_isr, nrfx_tbm_irq_handler, 0); irq_enable(DT_IRQN(DT_NODELABEL(tbm))); -#ifdef CONFIG_DEBUG_NRF_ETR_SHELL +#ifdef CONFIG_NRF_ETR_SHELL uint32_t level = CONFIG_LOG_MAX_LEVEL; static const struct shell_backend_config_flags cfg_flags = SHELL_DEFAULT_BACKEND_CONFIG_FLAGS; shell_init(&etr_shell, NULL, cfg_flags, true, level); - k_timer_start(&etr_timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT); - if (IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_DEBUG_NRF_ETR_DEBUG)) { + k_timer_start(&etr_timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT); + if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { err = decoder_init(); if (err < 0) { return err; @@ -793,14 +791,14 @@ int etr_process_init(void) SYS_INIT(etr_process_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); -#ifdef CONFIG_DEBUG_NRF_ETR_SHELL +#ifdef CONFIG_NRF_ETR_SHELL static void etr_timer_handler(struct k_timer *timer) { if (pending_data() >= MIN_DATA) { k_poll_signal_raise(&etr_shell.ctx->signals[SHELL_SIGNAL_LOG_MSG], 0); } else { - k_timer_start(timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT); + k_timer_start(timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT); } } @@ -809,7 +807,7 @@ bool z_shell_log_backend_process(const struct shell_log_backend *backend) ARG_UNUSED(backend); process(); - k_timer_start(&etr_timer, K_MSEC(CONFIG_DEBUG_NRF_ETR_BACKOFF), K_NO_WAIT); + k_timer_start(&etr_timer, K_MSEC(CONFIG_NRF_ETR_BACKOFF), K_NO_WAIT); return false; } @@ -903,7 +901,7 @@ static int etr_shell_init(const struct shell_transport *transport, const void *c static const struct uart_async_rx_config async_rx_config = { .buffer = rx_buf, .length = sizeof(rx_buf), - .buf_cnt = CONFIG_DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT, + .buf_cnt = CONFIG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT, }; shell_context = context; @@ -941,6 +939,6 @@ static struct shell_transport transport = { }; static uint8_t shell_out_buffer[CONFIG_SHELL_PRINTF_BUFF_SIZE]; -Z_SHELL_DEFINE(etr_shell, CONFIG_DEBUG_NRF_ETR_SHELL_PROMPT, &transport, shell_out_buffer, NULL, +Z_SHELL_DEFINE(etr_shell, CONFIG_NRF_ETR_SHELL_PROMPT, &transport, shell_out_buffer, NULL, SHELL_FLAG_OLF_CRLF); -#endif /* CONFIG_DEBUG_NRF_ETR_SHELL */ +#endif /* CONFIG_NRF_ETR_SHELL */ diff --git a/dts/bindings/debug/nordic,nrf-tbm.yaml b/dts/bindings/misc/nordic,nrf-tbm.yaml similarity index 100% rename from dts/bindings/debug/nordic,nrf-tbm.yaml rename to dts/bindings/misc/nordic,nrf-tbm.yaml diff --git a/include/zephyr/drivers/debug/debug_nrf_etr.h b/include/zephyr/drivers/misc/coresight/nrf_etr.h similarity index 52% rename from include/zephyr/drivers/debug/debug_nrf_etr.h rename to include/zephyr/drivers/misc/coresight/nrf_etr.h index 04805a7e2d1d..062afa3b61aa 100644 --- a/include/zephyr/drivers/debug/debug_nrf_etr.h +++ b/include/zephyr/drivers/misc/coresight/nrf_etr.h @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_ -#define _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_ +#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 debug_nrf_etr_flush(void); +void nrf_etr_flush(void); #ifdef __cplusplus } #endif -#endif /* _ZEPHYR_DRIVERS_DEBUG_CORESIGHT_NRF_ETR_H_ */ +#endif /* _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_ */ diff --git a/include/zephyr/drivers/debug/stmesp.h b/include/zephyr/drivers/misc/coresight/stmesp.h similarity index 96% rename from include/zephyr/drivers/debug/stmesp.h rename to include/zephyr/drivers/misc/coresight/stmesp.h index d4b245857eb3..ce0f64b52dde 100644 --- a/include/zephyr/drivers/debug/stmesp.h +++ b/include/zephyr/drivers/misc/coresight/stmesp.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_ -#define ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_ +#ifndef ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ +#define ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ #include @@ -190,4 +190,4 @@ static inline int stmesp_get_port(uint32_t idx, STMESP_Type **port) * @} */ -#endif /* ZEPHYR_INCLUDE_DRIVERS_DEBUG_CORESIGHT_STMESP_H_ */ +#endif /* ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ */ diff --git a/include/zephyr/logging/log_frontend_stmesp.h b/include/zephyr/logging/log_frontend_stmesp.h index c30972319fa7..38f33bf62f10 100644 --- a/include/zephyr/logging/log_frontend_stmesp.h +++ b/include/zephyr/logging/log_frontend_stmesp.h @@ -9,7 +9,7 @@ #include #include #ifdef CONFIG_LOG_FRONTEND_STMESP -#include +#include #endif #ifdef __cplusplus diff --git a/samples/boards/nordic/coresight_stm/pytest/test_stm.py b/samples/boards/nordic/coresight_stm/pytest/test_stm.py index 6db0b5685759..4af24fbfa3c9 100644 --- a/samples/boards/nordic/coresight_stm/pytest/test_stm.py +++ b/samples/boards/nordic/coresight_stm/pytest/test_stm.py @@ -20,7 +20,7 @@ SB_CONFIG_APP_CPUFLPR_RUN = None # See definition of stm_m_id[] and stm_m_name[] in -# https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/debug/debug_nrf_etr.c +# https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/misc/coresight/nrf_etr.c STM_M_ID = { "sec": 33, "app": 34, diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index 86149e5bd0e0..674b5433c147 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -9,7 +9,7 @@ config NUM_IRQS default 471 config SHELL_BACKEND_SERIAL - default n if DEBUG_NRF_ETR_SHELL + default n if NRF_ETR_SHELL config POWER_DOMAIN default y diff --git a/subsys/logging/frontends/Kconfig b/subsys/logging/frontends/Kconfig index 8bad85c69814..6e5602763574 100644 --- a/subsys/logging/frontends/Kconfig +++ b/subsys/logging/frontends/Kconfig @@ -46,7 +46,7 @@ config LOG_FRONTEND_STMESP_DICT config LOG_FRONTEND_STMESP_FSC bool "Send fully self-contained messages" - select LOG_MSG_APPEND_RO_STRING_LOC if !(DEBUG_NRF_ETR || \ + select LOG_MSG_APPEND_RO_STRING_LOC if !(NRF_ETR || \ SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) config LOG_FRONTEND_STMESP_FLUSH_COUNT @@ -70,7 +70,7 @@ config LOG_FRONTEND_STMESP_DICT_VER config LOG_FRONTEND_STMESP_TURBO_LOG bool "Optimize short_logs" select LOG_CUSTOM_HEADER - default y if (DEBUG_NRF_ETR || SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) \ + default y if (NRF_ETR || SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) \ && LOG_FRONTEND_STMESP_FSC help When enabled, then logging messages with 0 and 1 numeric argument are diff --git a/subsys/logging/frontends/log_frontend_stmesp.c b/subsys/logging/frontends/log_frontend_stmesp.c index 7cdd16ffdd34..0ede3cb48906 100644 --- a/subsys/logging/frontends/log_frontend_stmesp.c +++ b/subsys/logging/frontends/log_frontend_stmesp.c @@ -11,8 +11,8 @@ #include #include #include -#ifdef CONFIG_DEBUG_NRF_ETR -#include +#ifdef CONFIG_NRF_ETR +#include #endif /* Only 32 bit platforms supported. */ @@ -574,16 +574,15 @@ void log_frontend_simple_2(const void *source, uint32_t level, const char *fmt, void log_frontend_panic(void) { in_panic = true; -#ifdef CONFIG_DEBUG_NRF_ETR - debug_nrf_etr_flush(); +#ifdef CONFIG_NRF_ETR + nrf_etr_flush(); #endif } void log_frontend_init(void) { -#if defined(CONFIG_LOG_FRONTEND_STPESP_TURBO_SOURCE_PORT_ID) \ - && !defined(CONFIG_DEBUG_NRF_ETR) \ - && !defined(CONFIG_LOG_MSG_APPEND_RO_STRING_LOC) +#if defined(CONFIG_LOG_FRONTEND_STPESP_TURBO_SOURCE_PORT_ID) && !defined(CONFIG_NRF_ETR) && \ + !defined(CONFIG_LOG_MSG_APPEND_RO_STRING_LOC) /* Send location of section with constant source data. It is used by the * application core to retrieve source names of log messages coming from * coprocessors (FLPR and PPR). From 9e4cbd7d95cc457f1405e1c954b58789d0e4d40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1396/3334] Revert "[nrf fromtree] soc: nordic: uicr: fix SPIM CSN CTRLSEL values" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cbe4cea2253d19daefece123f6fa670cf47dd572. Signed-off-by: Tomasz Moń --- .../common/uicr/gen_periphconf_entries.py | 27 ++++++++++--------- soc/nordic/common/uicr/periphconf/builder.py | 1 - 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index 4308df31449f..92f5f1d24559 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -25,6 +25,7 @@ from periphconf.builder import ( Ctrlsel, FixedPPIMap, + GpiosProp, Node, NrfCompChannel, NrfFun, @@ -177,7 +178,7 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_CSN, port=9, pin=3): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=9, pin=3): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=4): Ctrlsel.SERIAL0, # SPIS mappings NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=5): Ctrlsel.SERIAL0, @@ -201,7 +202,7 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.SPIM_CSN, port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, + GpiosProp(name="cs-gpios", port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, # SPIS mappings NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, @@ -283,17 +284,17 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM P6 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=8): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=5): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=6, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=1): Ctrlsel.SERIAL0, # SPIM P7 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=7, pin=7): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=7, pin=6): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_CSN, port=7, pin=5): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=7, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=7, pin=3): Ctrlsel.SERIAL0, # SPIM P2 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=6): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_CSN, port=2, pin=7): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=2, pin=7): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=3): Ctrlsel.SERIAL0, # UARTÈ P6 mappings NrfPsel(fun=NrfFun.UART_TX, port=6, pin=8): Ctrlsel.SERIAL0, @@ -316,21 +317,21 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM P6 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=13): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=12): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=10): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=6, pin=10): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=2): Ctrlsel.SERIAL0, # SPIM P7 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=7, pin=1): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIS_MISO, port=7, pin=1): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIM_MISO, port=7, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIS_MOSI, port=7, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.SPIM_CSN, port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, + GpiosProp(name="cs-gpios", port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIS_CSN, port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIM_SCK, port=7, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, NrfPsel(fun=NrfFun.SPIS_SCK, port=7, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, # SPIM P2 mappings NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=11): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=10): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_CSN, port=2, pin=8): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=2, pin=8): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=2): Ctrlsel.SERIAL0, }, # EXMIF @@ -448,12 +449,12 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM120/UARTE120 0x5F8E_6000: { # SPIM P2 mappings - NrfPsel(fun=NrfFun.SPIM_CSN, port=2, pin=5): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=2, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=3): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=4): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=0): Ctrlsel.SERIAL0, # SPIM P6 mappings - NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=5): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=6, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=8): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=1): Ctrlsel.SERIAL0, @@ -471,12 +472,12 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM121 0x5F8E_7000: { # P2 - NrfPsel(fun=NrfFun.SPIM_CSN, port=2, pin=6): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=2, pin=6): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=8): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=9): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=1): Ctrlsel.SERIAL0, # P6 - NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=10): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=6, pin=10): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=12): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=13): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=2): Ctrlsel.SERIAL0, @@ -491,7 +492,7 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: # SPIM130/SPIS130/TWIM130/TWIS130/UARTE130 0x5F9A_5000: { # SPIM mappings - NrfPsel(fun=NrfFun.SPIM_CSN, port=9, pin=1): Ctrlsel.SERIAL0, + GpiosProp(name="cs-gpios", port=9, pin=1): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=3): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=0): Ctrlsel.SERIAL0, diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py index 1a343dee44a0..98c2bdfb0a0a 100644 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ b/soc/nordic/common/uicr/periphconf/builder.py @@ -1017,7 +1017,6 @@ class NrfFun(int, enum.Enum): TDM_SDIN = 75 TDM_SDOUT = 76 TDM_MCK = 77 - SPIM_CSN = 78 # Value used to ignore the function field and only check (port, pin) IGNORE = -1 From 659fe4ef05db91323879974af4c4f7a32d9cdf12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1397/3334] Revert "[nrf fromtree] drivers: pinctrl_nrf: Add support for SPIM CSN pin function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 37ebe97ebc956d3e20a38bd055f3a4d1252342f0. Signed-off-by: Tomasz Moń --- drivers/pinctrl/pinctrl_nrf.c | 14 +++----------- include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 2 -- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 429ed761e614..1dfb6cb7c720 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -46,11 +46,11 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = { #define NRF_PSEL_UART(reg, line) ((NRF_UARTE_Type *)reg)->PSEL.line #endif -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spim) || defined(CONFIG_NRFX_SPIM) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spi) || defined(CONFIG_NRFX_SPI) +#define NRF_PSEL_SPIM(reg, line) ((NRF_SPI_Type *)reg)->PSEL##line +#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spim) || defined(CONFIG_NRFX_SPIM) #include #define NRF_PSEL_SPIM(reg, line) ((NRF_SPIM_Type *)reg)->PSEL.line -#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spi) || defined(CONFIG_NRFX_SPI) -#define NRF_PSEL_SPIM(reg, line) ((NRF_SPI_Type *)reg)->PSEL##line #endif #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_spis) || defined(CONFIG_NRFX_SPIS) @@ -265,14 +265,6 @@ 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; break; -#if defined(NRF_SPIM_HAS_HW_CSN) && NRF_SPIM_HAS_HW_CSN - case NRF_FUN_SPIM_CSN: - NRF_PSEL_SPIM(reg, CSN) = psel; - write = 1U; - dir = NRF_GPIO_PIN_DIR_OUTPUT; - input = NRF_GPIO_PIN_INPUT_DISCONNECT; - break; -#endif #endif /* defined(NRF_PSEL_SPIM) */ #if defined(NRF_PSEL_SPIS) case NRF_FUN_SPIS_SCK: diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 42b302193ed0..9de74061e8da 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -186,8 +186,6 @@ #define NRF_FUN_TDM_SDOUT 76U /** TDM MCK */ #define NRF_FUN_TDM_MCK 77U -/** SPI master CSN */ -#define NRF_FUN_SPIM_CSN 78U /** @} */ From 63253ba6cd43d8a140cd4f58057fc92fb0ba9ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1398/3334] Revert "[nrf fromtree] boards: nrf54h20dk: Add secure storage partitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6379df47cc0f91693aa8bd08f503676c56ff05a6. Signed-off-by: Tomasz Moń --- .../nrf54h20dk_nrf54h20-memory_map.dtsi | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index eafaf69b3989..e14426c59fc8 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -174,34 +174,5 @@ secondary_periphconf_partition: partition@1c0000 { reg = <0x1c0000 DT_SIZE_K(8)>; }; - - /* NB: A gap has been left here for future partitions */ - - /* 0x1fd000 was chosen for secure_storage_partition such that - * there is no more space after secure_storage_partition. - */ - secure_storage_partition: partition@1fd000 { - compatible = "fixed-subpartitions"; - reg = <0x1fd000 DT_SIZE_K(12)>; - ranges = <0x0 0x1fd000 0x3000>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_crypto_partition: partition@0 { - reg = <0x0 DT_SIZE_K(4)>; - }; - - cpurad_crypto_partition: partition@1000 { - reg = <0x1000 DT_SIZE_K(4)>; - }; - - cpuapp_its_partition: partition@2000 { - reg = <0x2000 DT_SIZE_K(2)>; - }; - - cpurad_its_partition: partition@2800 { - reg = <0x2800 DT_SIZE_K(2)>; - }; - }; }; }; From 2d73f3e97d7c060ceed96077c8d279e3a20df759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1399/3334] Revert "[nrf fromtree] soc: ironside: add min and max values for update" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1cfda09be90d3510f2a91fb5cb09dcc2a81c3fa0. Signed-off-by: Tomasz Moń --- .../nordic/nrf_ironside/update/src/main.c | 3 --- .../ironside/include/nrf_ironside/update.h | 18 ------------------ soc/nordic/ironside/update.c | 5 ----- 3 files changed, 26 deletions(-) diff --git a/samples/boards/nordic/nrf_ironside/update/src/main.c b/samples/boards/nordic/nrf_ironside/update/src/main.c index ee8823217de2..29d058ca139c 100644 --- a/samples/boards/nordic/nrf_ironside/update/src/main.c +++ b/samples/boards/nordic/nrf_ironside/update/src/main.c @@ -10,9 +10,6 @@ LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); -BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS >= IRONSIDE_UPDATE_MIN_ADDRESS); -BUILD_ASSERT(CONFIG_UPDATE_BLOB_ADDRESS <= IRONSIDE_UPDATE_MAX_ADDRESS); - int main(void) { int err; diff --git a/soc/nordic/ironside/include/nrf_ironside/update.h b/soc/nordic/ironside/include/nrf_ironside/update.h index 6e520e4e680b..b01b5df6dadb 100644 --- a/soc/nordic/ironside/include/nrf_ironside/update.h +++ b/soc/nordic/ironside/include/nrf_ironside/update.h @@ -18,27 +18,11 @@ #define IRONSIDE_UPDATE_ERROR_NOT_PERMITTED (1) /** Failed to write the update metadata to SICR. */ #define IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED (2) -/** Update candidate is placed outside of valid range */ -#define IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS (3) /** * @} */ -/** Size of the update blob */ -#ifdef CONFIG_SOC_SERIES_NRF54HX -#define IRONSIDE_UPDATE_BLOB_SIZE (160 * 1024) -#elif CONFIG_SOC_SERIES_NRF92X -#define IRONSIDE_UPDATE_BLOB_SIZE (160 * 1024) -#else -#error "Missing update blob size" -#endif - -/** Min address used for storing the update candidate */ -#define IRONSIDE_UPDATE_MIN_ADDRESS (0x0e100000) -/** Max address used for storing the update candidate */ -#define IRONSIDE_UPDATE_MAX_ADDRESS (0x0e200000 - IRONSIDE_UPDATE_BLOB_SIZE) - /** Length of the update manifest in bytes */ #define IRONSIDE_UPDATE_MANIFEST_LENGTH (256) /** Length of the update public key in bytes. */ @@ -78,8 +62,6 @@ struct ironside_update_blob { * @param update Pointer to update blob * * @retval 0 on a successful request (although the update itself may still fail). - * @retval -IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS if the address of the update is outside of the - * accepted range. * @retval -IRONSIDE_UPDATE_ERROR_NOT_PERMITTED if missing access to the update candidate. * @retval -IRONSIDE_UPDATE_ERROR_SICR_WRITE_FAILED if writing update parameters to SICR failed. * @retval Positive error status if reported by IronSide call (see error codes in @ref call.h). diff --git a/soc/nordic/ironside/update.c b/soc/nordic/ironside/update.c index fabf6fb01049..a56407a3fa14 100644 --- a/soc/nordic/ironside/update.c +++ b/soc/nordic/ironside/update.c @@ -11,11 +11,6 @@ int ironside_update(const struct ironside_update_blob *update) int err; struct ironside_call_buf *const buf = ironside_call_alloc(); - if ((uintptr_t)update < IRONSIDE_UPDATE_MIN_ADDRESS || - (uintptr_t)update > IRONSIDE_UPDATE_MAX_ADDRESS) { - return -IRONSIDE_UPDATE_ERROR_INVALID_ADDRESS; - } - buf->id = IRONSIDE_CALL_ID_UPDATE_SERVICE_V0; buf->args[IRONSIDE_UPDATE_SERVICE_UPDATE_PTR_IDX] = (uintptr_t)update; From 766def79bd61c8d4122b0b20a9a90235a7ab3e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1400/3334] Revert "[nrf fromtree] samples/boards/nordic: align nrf54h20dk overlay" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d284430202c21a59569f6938b28293a5de8263d7. Signed-off-by: Tomasz Moń --- .../spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 8023020f2caa..ae3c8b6c81fc 100644 --- a/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,8 +12,6 @@ /delete-property/ sw1; /delete-property/ sw2; /delete-property/ sw3; - /delete-property/ mcuboot-led0; - /delete-property/ mcuboot-button0; }; /delete-node/ buttons; }; From aba2fccf361d5bb6fef51ae880f29182d98357fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1401/3334] Revert "[nrf fromtree] boards/nordic/nrf54h20dk: Add button/LED aliases" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4ede28ebfd4acce4060afd74fed4bc070c0fb5f2. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 2c67c3d4e8c1..06e208e248a2 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -42,8 +42,6 @@ sw3 = &button3; ipc-to-cpusys = &cpuapp_cpusys_ipc; watchdog0 = &wdt010; - mcuboot-button0 = &button0; - mcuboot-led0 = &led0; }; buttons { From f6bc81946c9ca71a098f8618771285a4b46ccebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1402/3334] Revert "[nrf fromlist] tests: drivers: gpio: add nrf54h20dk_nrf54h20_cpuppr" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2a5a7733a3ecc3d54495de80387c6f105c2a089c. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 23 ------------- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 23 ------------- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 34 ------------------- tests/drivers/gpio/gpio_hogs/testcase.yaml | 1 - .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 23 ------------- 5 files changed, 104 deletions(-) delete mode 100644 samples/basic/blinky/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 tests/drivers/gpio/gpio_get_direction/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 tests/drivers/gpio/gpio_hogs/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 tests/drivers/gpio/gpio_nrf/boards/nrf54h20dk_nrf54h20_cpuppr.overlay diff --git a/samples/basic/blinky/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/basic/blinky/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index cbc7b679be00..000000000000 --- a/samples/basic/blinky/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/ { - aliases { - led0 = &led0; - }; - - leds { - compatible = "gpio-leds"; - led0: led_0 { - gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - }; -}; - -&gpiote130 { - status = "okay"; -}; - -&gpio9 { - status = "okay"; -}; diff --git a/tests/drivers/gpio/gpio_get_direction/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/gpio/gpio_get_direction/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index cbc7b679be00..000000000000 --- a/tests/drivers/gpio/gpio_get_direction/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/ { - aliases { - led0 = &led0; - }; - - leds { - compatible = "gpio-leds"; - led0: led_0 { - gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - }; -}; - -&gpiote130 { - status = "okay"; -}; - -&gpio9 { - status = "okay"; -}; diff --git a/tests/drivers/gpio/gpio_hogs/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/gpio/gpio_hogs/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index 3d0a4ccf5a6d..000000000000 --- a/tests/drivers/gpio/gpio_hogs/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,34 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/ { - zephyr,user { - output-high-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; - output-low-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; - input-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; - }; -}; - -&gpio0 { - status = "okay"; - hog1 { - gpio-hog; - gpios = <3 GPIO_ACTIVE_LOW>; - output-high; - }; - - hog2 { - gpio-hog; - gpios = <4 GPIO_ACTIVE_HIGH>; - output-low; - }; - - hog3 { - gpio-hog; - gpios = <1 GPIO_ACTIVE_LOW>; - input; - }; -}; - -&gpiote130 { - status = "okay"; -}; diff --git a/tests/drivers/gpio/gpio_hogs/testcase.yaml b/tests/drivers/gpio/gpio_hogs/testcase.yaml index 43b01894f5fb..3de068163b85 100644 --- a/tests/drivers/gpio/gpio_hogs/testcase.yaml +++ b/tests/drivers/gpio/gpio_hogs/testcase.yaml @@ -11,7 +11,6 @@ tests: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nucleo_g474re - nrf52_bsim - nrf5340bsim/nrf5340/cpuapp diff --git a/tests/drivers/gpio/gpio_nrf/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/gpio/gpio_nrf/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index cbc7b679be00..000000000000 --- a/tests/drivers/gpio/gpio_nrf/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/ { - aliases { - led0 = &led0; - }; - - leds { - compatible = "gpio-leds"; - led0: led_0 { - gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - }; -}; - -&gpiote130 { - status = "okay"; -}; - -&gpio9 { - status = "okay"; -}; From e9f2bed982fa7fa7e74e0742ec6239ef0de79615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1403/3334] Revert "[nrf fromlist] soc: nordic: uicr: Change how secondary images are detected" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8f89a479ac970736e6192a122a1d0c060b7d7360. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/Kconfig | 7 ------- soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 13 ++----------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index 37bdd014b7d6..73b5e5cf2d1c 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -18,10 +18,3 @@ config NRF_PERIPHCONF_GENERATE_ENTRIES help Generate a C file containing PERIPHCONF entries based on the device configuration in the devicetree. - -config IS_IRONSIDE_SE_SECONDARY_IMAGE - bool "Ironside SE secondary image indicator (informative only, do not change)" - help - This Kconfig is set by sysbuild to indicate that this image is a - secondary firmware for Ironside SE. This is used by the UICR generation - system to determine which PERIPHCONF partition to use. diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index b64b7c0399ac..9e37639a82cb 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -23,19 +23,11 @@ project(uicr) function(parse_kconfig_value config_file config_name output_var) file(STRINGS ${config_file} config_lines ENCODING "UTF-8") foreach(line ${config_lines}) - # Match quoted strings like CONFIG_FOO="value" if("${line}" MATCHES "^${config_name}=\"(.*)\"$") set(${output_var} "${CMAKE_MATCH_1}" PARENT_SCOPE) return() endif() - # Match unquoted values like CONFIG_FOO=y or CONFIG_FOO=n - if("${line}" MATCHES "^${config_name}=(.*)$") - set(${output_var} "${CMAKE_MATCH_1}" PARENT_SCOPE) - return() - endif() endforeach() - # If not found, return empty (including "# CONFIG_FOO is not set" case) - set(${output_var} "" PARENT_SCOPE) endfunction() # Function to compute partition absolute address and size from devicetree @@ -139,9 +131,8 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) parse_kconfig_value(${_dir}/zephyr/.config CONFIG_KERNEL_BIN_NAME kernel_bin_name) set(kernel_elf_path ${_dir}/zephyr/${kernel_bin_name}.elf) - # Check if this is secondary firmware by reading the Kconfig from .config - parse_kconfig_value(${_dir}/zephyr/.config CONFIG_IS_IRONSIDE_SE_SECONDARY_IMAGE is_secondary) - if(is_secondary STREQUAL "y") + # Check if this is secondary firmware by looking for the marker file + if(EXISTS ${_dir}/is_secondary_firmware.txt) list(APPEND secondary_periphconf_elfs ${kernel_elf_path}) else() list(APPEND periphconf_elfs ${kernel_elf_path}) From 7828af8e15b501dccd8f069118320bd1ddc681ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1404/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for uicr.PROTECTEDMEM" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ad38f6ff83359d9b32f603904b11d20cef237815. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 2 -- soc/nordic/common/uicr/gen_uicr.py | 22 ------------------- .../common/uicr/gen_uicr/CMakeLists.txt | 8 ------- soc/nordic/common/uicr/gen_uicr/Kconfig | 14 ------------ 4 files changed, 46 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index eea833ce0849..79b0777ca488 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1268,8 +1268,6 @@ def check_no_undef_outside_kconfig(self, kconf): "FOO_SETTING_1", "FOO_SETTING_2", "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_PROTECTEDMEM", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_PROTECTEDMEM_SIZE_BYTES", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY_PROCESSOR_VALUE", # Used in specialized build tool, not part of main Kconfig diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index bea0ba2a2dfa..e074314a1abb 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -26,8 +26,6 @@ ENABLED_VALUE = 0xFFFF_FFFF DISABLED_VALUE = 0xBD23_28A8 -KB_4 = 4096 - class ScriptError(RuntimeError): ... @@ -430,16 +428,6 @@ def main() -> None: type=lambda s: int(s, 0), help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", ) - parser.add_argument( - "--protectedmem", - action="store_true", - help="Enable protected memory region in UICR", - ) - parser.add_argument( - "--protectedmem-size-bytes", - type=int, - help="Protected memory size in bytes (must be divisible by 4096)", - ) parser.add_argument( "--secondary", action="store_true", @@ -547,16 +535,6 @@ def main() -> None: uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 - # Handle protected memory configuration - if args.protectedmem: - if args.protectedmem_size_bytes % KB_4 != 0: - raise ScriptError( - f"Protected memory size ({args.protectedmem_size_bytes} bytes) " - f"must be divisible by {KB_4}" - ) - uicr.PROTECTEDMEM.ENABLE = ENABLED_VALUE - uicr.PROTECTEDMEM.SIZE4KB = args.protectedmem_size_bytes // KB_4 - # Process periphconf data first and configure UICR completely before creating hex objects periphconf_hex = IntelHex() secondary_periphconf_hex = IntelHex() diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 9e37639a82cb..fe1b0e378cf7 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -67,7 +67,6 @@ endfunction() if(CMAKE_VERBOSE_MAKEFILE) endif() -set(protectedmem_args) set(periphconf_args) set(periphconf_elfs) set(merged_hex_file ${APPLICATION_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.hex) @@ -106,12 +105,6 @@ if(CONFIG_GEN_UICR_SECURESTORAGE) list(APPEND securestorage_args --cpurad-its-size ${CPURAD_ITS_SIZE}) endif(CONFIG_GEN_UICR_SECURESTORAGE) -# Handle protected memory configuration -if(CONFIG_GEN_UICR_PROTECTEDMEM) - list(APPEND protectedmem_args --protectedmem) - list(APPEND protectedmem_args --protectedmem-size-bytes ${CONFIG_GEN_UICR_PROTECTEDMEM_SIZE_BYTES}) -endif() - if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) # gen_uicr.py parses all zephyr.elf files. To find these files (which # have not been built yet) we scan sibling build directories for @@ -188,7 +181,6 @@ add_custom_command( --out-uicr-hex ${uicr_hex_file} ${periphconf_args} ${securestorage_args} - ${protectedmem_args} ${secondary_args} DEPENDS ${periphconf_elfs} ${secondary_periphconf_elfs} WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index fe7413a9d0da..1c49209592fe 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -32,20 +32,6 @@ config GEN_UICR_SECURESTORAGE - At least one subpartition must be defined - Combined subpartition sizes must equal secure_storage_partition size -config GEN_UICR_PROTECTEDMEM - bool "Enable UICR.PROTECTEDMEM" - help - When enabled, the UICR generator will configure the - protected memory region. - -config GEN_UICR_PROTECTEDMEM_SIZE_BYTES - int "Protected memory size in bytes" - default 4096 - depends on GEN_UICR_PROTECTEDMEM - help - Size of the protected memory region in bytes. - This value must be divisible by 4096 (4 kiB). - config GEN_UICR_SECONDARY bool "Enable UICR.SECONDARY.ENABLE" From 435f5abe338c588590a4c1506d56b432f8bf9d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1405/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for uicr.SECONDARY.PROCESSOR" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ff6ac9f133f76605b1a894e4c1129dd42afcfd7c. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 1 - soc/nordic/common/uicr/gen_uicr.py | 7 --- .../common/uicr/gen_uicr/CMakeLists.txt | 1 - soc/nordic/common/uicr/gen_uicr/Kconfig | 48 +++++-------------- 4 files changed, 11 insertions(+), 46 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 79b0777ca488..92b0640450ee 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1270,7 +1270,6 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_SECONDARY_PROCESSOR_VALUE", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECURESTORAGE", # Used in specialized build tool, not part of main Kconfig "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index e074314a1abb..b4594d2e2722 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -439,12 +439,6 @@ def main() -> None: type=lambda s: int(s, 0), help="Absolute flash address of the secondary firmware (decimal or 0x-prefixed hex)", ) - parser.add_argument( - "--secondary-processor", - default=0xBD2328A8, - type=lambda s: int(s, 0), - help="Processor to boot for the secondary firmware ", - ) parser.add_argument( "--secondary-periphconf-address", default=None, @@ -568,7 +562,6 @@ def main() -> None: if args.secondary: uicr.SECONDARY.ENABLE = ENABLED_VALUE uicr.SECONDARY.ADDRESS = args.secondary_address - uicr.SECONDARY.PROCESSOR = args.secondary_processor # Handle secondary periphconf if provided if args.out_secondary_periphconf_hex: diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index fe1b0e378cf7..28c6e6749094 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -154,7 +154,6 @@ if(CONFIG_GEN_UICR_SECONDARY) list(APPEND secondary_args --secondary-address ${SECONDARY_ADDRESS} - --secondary-processor ${CONFIG_GEN_UICR_SECONDARY_PROCESSOR_VALUE} ) if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 1c49209592fe..17758597bc34 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -10,6 +10,17 @@ config GEN_UICR_GENERATE_PERIPHCONF When enabled, the UICR generator will populate the periphconf_partition partition. +config GEN_UICR_SECONDARY + bool "Enable UICR.SECONDARY.ENABLE" + +config GEN_UICR_SECONDARY_GENERATE_PERIPHCONF + bool "Generate SECONDARY.PERIPHCONF hex alongside UICR" + default y + depends on GEN_UICR_SECONDARY + help + When enabled, the UICR generator will populate the + secondary_periphconf_partition partition. + config GEN_UICR_SECURESTORAGE bool "Enable UICR.SECURESTORAGE" default y @@ -32,43 +43,6 @@ config GEN_UICR_SECURESTORAGE - At least one subpartition must be defined - Combined subpartition sizes must equal secure_storage_partition size -config GEN_UICR_SECONDARY - bool "Enable UICR.SECONDARY.ENABLE" - -if GEN_UICR_SECONDARY - -config GEN_UICR_SECONDARY_GENERATE_PERIPHCONF - bool "Generate SECONDARY.PERIPHCONF hex alongside UICR" - default y - help - When enabled, the UICR generator will populate the - secondary_periphconf_partition partition. - -choice GEN_UICR_SECONDARY_PROCESSOR - prompt "Secondary processor selection" - default GEN_UICR_SECONDARY_PROCESSOR_APPLICATION - help - Processor to boot for the secondary firmware. - -config GEN_UICR_SECONDARY_PROCESSOR_APPLICATION - bool "APPLICATION processor" - help - Boot secondary firmware on the APPLICATION processor. - -config GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE - bool "RADIOCORE processor" - help - Boot secondary firmware on the RADIOCORE processor. - -endchoice - -config GEN_UICR_SECONDARY_PROCESSOR_VALUE - hex - default 0xBD2328A8 if GEN_UICR_SECONDARY_PROCESSOR_APPLICATION - default 0x1730C77F if GEN_UICR_SECONDARY_PROCESSOR_RADIOCORE - -endif # GEN_UICR_SECONDARY - endmenu source "Kconfig.zephyr" From c30a99659e4ef0c3371e017a87c134631c75b426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1406/3334] Revert "[nrf fromtree] soc: nordic: uicr: Add support for SECURESTORAGE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2f7818c3a3662ff5b9d99d9a2e4c3fd5b64a885d. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 1 - soc/nordic/common/uicr/gen_uicr.py | 198 +----------------- .../common/uicr/gen_uicr/CMakeLists.txt | 46 ---- soc/nordic/common/uicr/gen_uicr/Kconfig | 22 -- 4 files changed, 1 insertion(+), 266 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 92b0640450ee..9ea01ed3b610 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1270,7 +1270,6 @@ def check_no_undef_outside_kconfig(self, kconf): "GEN_UICR_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY", # Used in specialized build tool, not part of main Kconfig "GEN_UICR_SECONDARY_GENERATE_PERIPHCONF", # Used in specialized build tool, not part of main Kconfig - "GEN_UICR_SECURESTORAGE", # Used in specialized build tool, not part of main Kconfig "HEAP_MEM_POOL_ADD_SIZE_", # Used as an option matching prefix "HUGETLBFS", # Linux, in boards/xtensa/intel_adsp_cavs25/doc "IAR_BUFFERED_WRITE", diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index b4594d2e2722..ce69cd7e80a3 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -8,8 +8,7 @@ import argparse import ctypes as c import sys -from itertools import groupby, pairwise -from typing import NamedTuple +from itertools import groupby from elftools.elf.elffile import ELFFile from intelhex import IntelHex @@ -30,14 +29,6 @@ class ScriptError(RuntimeError): ... -class PartitionInfo(NamedTuple): - """Information about a partition for secure storage validation.""" - - address: int - size: int - name: str - - class PeriphconfEntry(c.LittleEndianStructure): _pack_ = 1 _fields_ = [ @@ -207,105 +198,6 @@ class Uicr(c.LittleEndianStructure): ] -def validate_secure_storage_partitions(args: argparse.Namespace) -> None: - """ - Validate that secure storage partitions are laid out correctly. - - Args: - args: Parsed command line arguments containing partition information - - Raises: - ScriptError: If validation fails - """ - # Expected order: cpuapp_crypto_partition, cpurad_crypto_partition, - # cpuapp_its_partition, cpurad_its_partition - partitions = [ - PartitionInfo( - args.cpuapp_crypto_address, args.cpuapp_crypto_size, "cpuapp_crypto_partition" - ), - PartitionInfo( - args.cpurad_crypto_address, args.cpurad_crypto_size, "cpurad_crypto_partition" - ), - PartitionInfo(args.cpuapp_its_address, args.cpuapp_its_size, "cpuapp_its_partition"), - PartitionInfo(args.cpurad_its_address, args.cpurad_its_size, "cpurad_its_partition"), - ] - - # Filter out zero-sized partitions (missing partitions) - present_partitions = [p for p in partitions if p.size > 0] - - # Require at least one subpartition to be present - if not present_partitions: - raise ScriptError( - "At least one secure storage subpartition must be defined. " - "Define one or more of: cpuapp_crypto_partition, cpurad_crypto_partition, " - "cpuapp_its_partition, cpurad_its_partition" - ) - - # Check 4KB alignment for secure storage start address - if args.securestorage_address % 4096 != 0: - raise ScriptError( - f"Secure storage address {args.securestorage_address:#x} must be aligned to 4KB " - f"(4096 bytes)" - ) - - # Check 4KB alignment for secure storage size - if args.securestorage_size % 4096 != 0: - raise ScriptError( - f"Secure storage size {args.securestorage_size} bytes must be aligned to 4KB " - f"(4096 bytes)" - ) - - # Check that the first present partition starts at the secure storage address - first_partition = present_partitions[0] - if first_partition.address != args.securestorage_address: - raise ScriptError( - f"First partition {first_partition.name} starts at {first_partition.address:#x}, " - f"but must start at secure storage address {args.securestorage_address:#x}" - ) - - # Check that all present partitions have sizes that are multiples of 1KB - for partition in present_partitions: - if partition.size % 1024 != 0: - raise ScriptError( - f"Partition {partition.name} has size {partition.size} bytes, but must be " - f"a multiple of 1024 bytes (1KB)" - ) - - # Check that partitions are in correct order and don't overlap - for curr_partition, next_partition in pairwise(present_partitions): - # Check order - partitions should be in ascending address order - if curr_partition.address >= next_partition.address: - raise ScriptError( - f"Partition {curr_partition.name} (starts at {curr_partition.address:#x}) " - f"must come before {next_partition.name} (starts at {next_partition.address:#x})" - ) - - # Check for overlap - curr_end = curr_partition.address + curr_partition.size - if curr_end > next_partition.address: - raise ScriptError( - f"Partition {curr_partition.name} (ends at {curr_end:#x}) overlaps with " - f"{next_partition.name} (starts at {next_partition.address:#x})" - ) - - # Check for gaps (should be no gaps between consecutive partitions) - if curr_end < next_partition.address: - gap = next_partition.address - curr_end - raise ScriptError( - f"Gap of {gap} bytes between {curr_partition.name} (ends at {curr_end:#x}) and " - f"{next_partition.name} (starts at {next_partition.address:#x})" - ) - - # Check that combined subpartition sizes equal secure_storage_partition size - total_subpartition_size = sum(p.size for p in present_partitions) - if total_subpartition_size != args.securestorage_size: - raise ScriptError( - f"Combined size of subpartitions ({total_subpartition_size} bytes) does not match " - f"secure_storage_partition size ({args.securestorage_size} bytes). " - f"The definition is not coherent." - ) - - def main() -> None: parser = argparse.ArgumentParser( allow_abbrev=False, @@ -363,71 +255,6 @@ def main() -> None: type=lambda s: int(s, 0), help="Absolute flash address of the UICR region (decimal or 0x-prefixed hex)", ) - parser.add_argument( - "--securestorage", - action="store_true", - help="Enable secure storage support in UICR", - ) - parser.add_argument( - "--securestorage-address", - default=None, - type=lambda s: int(s, 0), - help="Absolute flash address of the secure storage partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--securestorage-size", - default=None, - type=lambda s: int(s, 0), - help="Size in bytes of the secure storage partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpuapp-crypto-address", - default=0, - type=lambda s: int(s, 0), - help="Absolute flash address of cpuapp_crypto_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpuapp-crypto-size", - default=0, - type=lambda s: int(s, 0), - help="Size in bytes of cpuapp_crypto_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpurad-crypto-address", - default=0, - type=lambda s: int(s, 0), - help="Absolute flash address of cpurad_crypto_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpurad-crypto-size", - default=0, - type=lambda s: int(s, 0), - help="Size in bytes of cpurad_crypto_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpuapp-its-address", - default=0, - type=lambda s: int(s, 0), - help="Absolute flash address of cpuapp_its_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpuapp-its-size", - default=0, - type=lambda s: int(s, 0), - help="Size in bytes of cpuapp_its_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpurad-its-address", - default=0, - type=lambda s: int(s, 0), - help="Absolute flash address of cpurad_its_partition (decimal or 0x-prefixed hex)", - ) - parser.add_argument( - "--cpurad-its-size", - default=0, - type=lambda s: int(s, 0), - help="Size in bytes of cpurad_its_partition (decimal or 0x-prefixed hex)", - ) parser.add_argument( "--secondary", action="store_true", @@ -500,35 +327,12 @@ def main() -> None: "--out-secondary-periphconf-hex is used" ) - # Validate secure storage argument dependencies - if args.securestorage: - if args.securestorage_address is None: - raise ScriptError( - "--securestorage-address is required when --securestorage is used" - ) - if args.securestorage_size is None: - raise ScriptError("--securestorage-size is required when --securestorage is used") - - # Validate partition layout - validate_secure_storage_partitions(args) - init_values = DISABLED_VALUE.to_bytes(4, "little") * (c.sizeof(Uicr) // 4) uicr = Uicr.from_buffer_copy(init_values) uicr.VERSION.MAJOR = UICR_FORMAT_VERSION_MAJOR uicr.VERSION.MINOR = UICR_FORMAT_VERSION_MINOR - # Handle secure storage configuration - if args.securestorage: - uicr.SECURESTORAGE.ENABLE = ENABLED_VALUE - uicr.SECURESTORAGE.ADDRESS = args.securestorage_address - - # Set partition sizes in 1KB units - uicr.SECURESTORAGE.CRYPTO.APPLICATIONSIZE1KB = args.cpuapp_crypto_size // 1024 - uicr.SECURESTORAGE.CRYPTO.RADIOCORESIZE1KB = args.cpurad_crypto_size // 1024 - uicr.SECURESTORAGE.ITS.APPLICATIONSIZE1KB = args.cpuapp_its_size // 1024 - uicr.SECURESTORAGE.ITS.RADIOCORESIZE1KB = args.cpurad_its_size // 1024 - # Process periphconf data first and configure UICR completely before creating hex objects periphconf_hex = IntelHex() secondary_periphconf_hex = IntelHex() diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 28c6e6749094..1163ff8e21f9 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -44,25 +44,6 @@ function(compute_partition_address_and_size partition_nodelabel output_address_v set(${output_size_var} ${partition_size} PARENT_SCOPE) endfunction() -# Function to compute optional partition address and size from devicetree -# If partition doesn't exist, sets both address and size to 0 -function(compute_optional_partition_address_and_size partition_nodelabel output_address_var output_size_var) - # Initialize with default values - set(${output_address_var} 0 PARENT_SCOPE) - set(${output_size_var} 0 PARENT_SCOPE) - - # Check if partition exists - dt_nodelabel(partition_path NODELABEL ${partition_nodelabel} QUIET) - if(partition_path) - # Call nested function with different variable names to avoid naming conflicts - compute_partition_address_and_size(${partition_nodelabel} temp_addr temp_size) - - # Copy the results to the output variables in parent scope - set(${output_address_var} ${temp_addr} PARENT_SCOPE) - set(${output_size_var} ${temp_size} PARENT_SCOPE) - endif() -endfunction() - # Use CMAKE_VERBOSE_MAKEFILE to silence an unused-variable warning. if(CMAKE_VERBOSE_MAKEFILE) endif() @@ -79,32 +60,6 @@ set(secondary_periphconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/secondary_per dt_nodelabel(uicr_path NODELABEL "uicr" REQUIRED) dt_reg_addr(UICR_ADDRESS PATH ${uicr_path} REQUIRED) -# Handle secure storage configuration -set(securestorage_args) -if(CONFIG_GEN_UICR_SECURESTORAGE) - list(APPEND securestorage_args --securestorage) - - # Extract secure storage partition information (required) - compute_partition_address_and_size("secure_storage_partition" SECURE_STORAGE_ADDRESS SECURE_STORAGE_SIZE) - list(APPEND securestorage_args --securestorage-address ${SECURE_STORAGE_ADDRESS}) - list(APPEND securestorage_args --securestorage-size ${SECURE_STORAGE_SIZE}) - - # Extract individual partition information for validation (optional partitions) - compute_optional_partition_address_and_size("cpuapp_crypto_partition" CPUAPP_CRYPTO_ADDRESS CPUAPP_CRYPTO_SIZE) - compute_optional_partition_address_and_size("cpurad_crypto_partition" CPURAD_CRYPTO_ADDRESS CPURAD_CRYPTO_SIZE) - compute_optional_partition_address_and_size("cpuapp_its_partition" CPUAPP_ITS_ADDRESS CPUAPP_ITS_SIZE) - compute_optional_partition_address_and_size("cpurad_its_partition" CPURAD_ITS_ADDRESS CPURAD_ITS_SIZE) - - list(APPEND securestorage_args --cpuapp-crypto-address ${CPUAPP_CRYPTO_ADDRESS}) - list(APPEND securestorage_args --cpuapp-crypto-size ${CPUAPP_CRYPTO_SIZE}) - list(APPEND securestorage_args --cpurad-crypto-address ${CPURAD_CRYPTO_ADDRESS}) - list(APPEND securestorage_args --cpurad-crypto-size ${CPURAD_CRYPTO_SIZE}) - list(APPEND securestorage_args --cpuapp-its-address ${CPUAPP_ITS_ADDRESS}) - list(APPEND securestorage_args --cpuapp-its-size ${CPUAPP_ITS_SIZE}) - list(APPEND securestorage_args --cpurad-its-address ${CPURAD_ITS_ADDRESS}) - list(APPEND securestorage_args --cpurad-its-size ${CPURAD_ITS_SIZE}) -endif(CONFIG_GEN_UICR_SECURESTORAGE) - if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) # gen_uicr.py parses all zephyr.elf files. To find these files (which # have not been built yet) we scan sibling build directories for @@ -179,7 +134,6 @@ add_custom_command( --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} ${periphconf_args} - ${securestorage_args} ${secondary_args} DEPENDS ${periphconf_elfs} ${secondary_periphconf_elfs} WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} diff --git a/soc/nordic/common/uicr/gen_uicr/Kconfig b/soc/nordic/common/uicr/gen_uicr/Kconfig index 17758597bc34..41d31db64647 100644 --- a/soc/nordic/common/uicr/gen_uicr/Kconfig +++ b/soc/nordic/common/uicr/gen_uicr/Kconfig @@ -21,28 +21,6 @@ config GEN_UICR_SECONDARY_GENERATE_PERIPHCONF When enabled, the UICR generator will populate the secondary_periphconf_partition partition. -config GEN_UICR_SECURESTORAGE - bool "Enable UICR.SECURESTORAGE" - default y - depends on $(dt_nodelabel_enabled,secure_storage_partition) - help - When enabled, the UICR generator will configure the - secure storage region based on device tree partitions. - - The following device tree partitions are used: - - secure_storage_partition: Main secure storage partition (required) - - cpuapp_crypto_partition: Application processor crypto storage (optional) - - cpurad_crypto_partition: Radio core crypto storage (optional) - - cpuapp_its_partition: Application processor internal trusted storage (optional) - - cpurad_its_partition: Radio core internal trusted storage (optional) - - Requirements: - - The secure_storage_partition address and size must be aligned to 4KB - - All subpartitions must be multiples of 1KB and laid out contiguously - without gaps - - At least one subpartition must be defined - - Combined subpartition sizes must equal secure_storage_partition size - endmenu source "Kconfig.zephyr" From 079eaa15737729ca12faec11254eafd6adc9420f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1407/3334] Revert "[nrf fromlist] drivers: flashdisk: fix value returned from disk_flash_access_write" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 43994db7bbe789b6400ac813d918b72254edbc2e. Signed-off-by: Tomasz Moń --- drivers/disk/flashdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index 37606f541390..1ac3d15ba62f 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -424,7 +424,7 @@ static int disk_flash_access_write(struct disk_info *disk, const uint8_t *buff, end: k_mutex_unlock(&ctx->lock); - return rc; + return 0; } static int disk_flash_access_ioctl(struct disk_info *disk, uint8_t cmd, void *buff) From 63ca398e80d61703c601483d5407993ff007b1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1408/3334] Revert "[nrf fromlist] drivers: timer: nrf_grtc_timer: use a function for cc enable check" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d9475479482372e4451e3b98f92b0f6d6be76f27. Signed-off-by: Tomasz Moń --- drivers/timer/nrf_grtc_timer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index b0593e3bd135..75278e104bd2 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -335,13 +335,18 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan) int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time) { + /* TODO: The implementation should probably go to nrfx_grtc and this + * should be just a wrapper for some nrfx_grtc_syscounter_capture_read. + */ + uint64_t capt_time; nrfx_err_t result; IS_CHANNEL_ALLOWED_ASSERT(chan); - if (nrfx_grtc_sys_counter_cc_enable_check(chan)) { - /* If the channel is enabled, it means that there was no capture + /* TODO: Use `nrfy_grtc_sys_counter_enable_check` when available (NRFX-2480) */ + if (NRF_GRTC->CC[chan].CCEN == GRTC_CC_CCEN_ACTIVE_Enable) { + /* If the channel is enabled (.CCEN), it means that there was no capture * triggering event. */ return -EBUSY; From 503df37adf7010925d492b8cb047b15c0f4e8e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1409/3334] Revert "[nrf fromtree] tests: drivers: flash: Fix fixture assignment for the supply-gpios test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a028ccb9b587a8d18dc8dfe5e4790e36200ae07d. Signed-off-by: Tomasz Moń --- tests/drivers/flash/common/testcase.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index c2a4da0a705c..d441d3c8f7bf 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -59,13 +59,9 @@ tests: - nrf54l15dk/nrf54l05/cpuapp - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - harness_config: - fixture: external_flash - drivers.flash.common.no_explicit_erase.nrf54h: - platform_allow: - nrf54h20dk/nrf54h20/cpuapp harness_config: - fixture: gpio_loopback + fixture: external_flash drivers.flash.common.nrf54lm20a: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp @@ -197,5 +193,3 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_low_freq.overlay - harness_config: - fixture: gpio_loopback From a0a4d40ffceb0c800c38b947bb08666ef348a4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1410/3334] Revert "[nrf fromtree] tests: drivers: flash: common: require external_flash fixture" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c3f522872fe9e8b21c446f839ab5454cd3a9ae4b. Signed-off-by: Tomasz Moń --- tests/drivers/flash/common/testcase.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index d441d3c8f7bf..6f59f3799c5a 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -60,8 +60,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - harness_config: - fixture: external_flash + - ophelia4ev/nrf54l15/cpuapp drivers.flash.common.nrf54lm20a: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp From b6ed896c58222dcb987cc379b0e1eae5db74f325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:00 +0100 Subject: [PATCH 1411/3334] Revert "[nrf fromtree] arch/arm: introduce the pre-stack/RAM init hook" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ee906f48bb0363a3dfe4c122f40db1690df6ef2. Signed-off-by: Tomasz Moń --- arch/arm/core/cortex_m/reset.S | 8 -------- include/zephyr/platform/hooks.h | 13 ------------- kernel/Kconfig.init | 22 ---------------------- 3 files changed, 43 deletions(-) diff --git a/arch/arm/core/cortex_m/reset.S b/arch/arm/core/cortex_m/reset.S index 85002c275f7c..b09391aaf0b5 100644 --- a/arch/arm/core/cortex_m/reset.S +++ b/arch/arm/core/cortex_m/reset.S @@ -35,10 +35,6 @@ GTEXT(z_arm_init_arch_hw_at_boot) #if defined(CONFIG_PM_S2RAM) GTEXT(arch_pm_s2ram_resume) #endif -#if defined(CONFIG_SOC_EARLY_RESET_HOOK) -GTEXT(soc_early_reset_hook) -#endif - /* * PACBTI Mask for CONTROL register: @@ -104,10 +100,6 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start) #endif /* CONFIG_INIT_ARCH_HW_AT_BOOT */ -#if defined(CONFIG_SOC_EARLY_RESET_HOOK) - /* Call custom code that executes before any stack is set up or RAM memory is accessed */ - bl soc_early_reset_hook -#endif #if defined(CONFIG_PM_S2RAM) /* * Temporarily set MSP to interrupt stack so that arch_pm_s2ram_resume can diff --git a/include/zephyr/platform/hooks.h b/include/zephyr/platform/hooks.h index 12defd10ab84..9989f640d65e 100644 --- a/include/zephyr/platform/hooks.h +++ b/include/zephyr/platform/hooks.h @@ -19,19 +19,6 @@ * directly from application code but may be freely used within the OS. */ -#ifdef CONFIG_SOC_EARLY_RESET_HOOK -/** - * @brief SoC hook executed before data RAM initialization, at the beginning - * of the reset vector. - * - * This hook is implemented by the SoC and can be used to perform any - * SoC-specific initialization. Refer to :kconfig:option:`SOC_EARLY_RESET_HOOK` - * and relevant architecture zephyr-rtos startup implementation for more details. - */ -void soc_early_reset_hook(void); -#else -#define soc_early_reset_hook() do { } while (0) -#endif /** * @brief SoC hook executed at the beginning of the reset vector. diff --git a/kernel/Kconfig.init b/kernel/Kconfig.init index c752fa5a0e43..495381638fb0 100644 --- a/kernel/Kconfig.init +++ b/kernel/Kconfig.init @@ -6,28 +6,6 @@ menu "SoC and Board Hooks" -config SOC_EARLY_RESET_HOOK - bool "Run SoC-specific early reset hook" - help - Run a SoC-specific hook early in the reset/startup code (__start). - A custom hook soc_early_reset_hook() will be executed at the beginning - of the architecture-specific startup code, after hardware has been - configured (as required by CONFIG_INIT_ARCH_HW_AT_BOOT) but before - architecture's own resume logic. - - Returning from this hook is not mandatory: it can be used to implement - special logic to resume execution in some scenarios (for example, when - a bootloader is used). - - The stack pointer register should be considered as not initialized upon - call to this hook. In particular, this means that the hook is NOT allowed - to "push" any data using this stack pointer value. However, the hook may - use an implementation-specific area as stack if desired; in such case, - the original value of the stack pointer needs not to be "restored" before - returning control to the hook's caller. - - Additional constraints may be imposed on the hook by the architecture. - config SOC_RESET_HOOK bool "Run early SoC reset hook" help From 07749e24fef37daf317408fd7834563642ae6942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1412/3334] Revert "[nrf fromlist] samples: drivers: adc: Enable samples for nrf54h20 PPR." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1a22fa1433d5035aae439c89b0f9935bc1a6b436. Signed-off-by: Tomasz Moń --- samples/drivers/adc/adc_dt/sample.yaml | 1 - .../boards/nrf54h20dk_nrf54h20_common.dtsi | 50 ------------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 45 ++++++++++++++++- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 11 ---- samples/drivers/adc/adc_sequence/sample.yaml | 2 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 11 ---- .../sysbuild/vpr_launcher/prj.conf | 1 - 7 files changed, 44 insertions(+), 77 deletions(-) delete mode 100644 samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_common.dtsi delete mode 100644 samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/prj.conf diff --git a/samples/drivers/adc/adc_dt/sample.yaml b/samples/drivers/adc/adc_dt/sample.yaml index d6842d47f988..b6eaa02cf14a 100644 --- a/samples/drivers/adc/adc_dt/sample.yaml +++ b/samples/drivers/adc/adc_dt/sample.yaml @@ -16,7 +16,6 @@ tests: - nrf51dk/nrf51822 - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_common.dtsi b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_common.dtsi deleted file mode 100644 index 291faa0440de..000000000000 --- a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_common.dtsi +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -/ { - aliases { - adc0 = &adc; - }; -}; - -&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 = ; /* P1.01 */ - }; - - channel@1 { - reg = <1>; - zephyr,gain = "ADC_GAIN_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.02 */ - }; - - channel@2 { - reg = <2>; - zephyr,gain = "ADC_GAIN_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P9.01 */ - zephyr,vref-mv = <3686>; /* 3.6V * 1024 */ - }; - - channel@7 { - reg = <7>; - zephyr,gain = "ADC_GAIN_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P1.03 */ - zephyr,input-negative = ; /* P1.07 */ - }; -}; diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 658b19b0ae5d..d4f9e8db7c2b 100644 --- a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,4 +4,47 @@ * Copyright (c) 2024 Nordic Semiconductor ASA */ -#include "nrf54h20dk_nrf54h20_common.dtsi" +/ { + aliases { + adc0 = &adc; + }; +}; + +&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 = ; /* P1.01 */ + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.02 */ + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P9.01 */ + zephyr,vref-mv = <3686>; /* 3.6V * 1024 */ + }; + + channel@7 { + reg = <7>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.03 */ + zephyr,input-negative = ; /* P1.07 */ + }; +}; diff --git a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index bcd359c3aa23..000000000000 --- a/samples/drivers/adc/adc_sequence/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" - -&adc { - status = "okay"; -}; diff --git a/samples/drivers/adc/adc_sequence/sample.yaml b/samples/drivers/adc/adc_sequence/sample.yaml index 6927bcdf88d9..d176e2593d4b 100644 --- a/samples/drivers/adc/adc_sequence/sample.yaml +++ b/samples/drivers/adc/adc_sequence/sample.yaml @@ -19,7 +19,6 @@ tests: - cy8cproto_062_4343w - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -33,7 +32,6 @@ tests: sample.drivers.adc.adc_sequence.8bit: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: diff --git a/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 2570d64e2eb3..000000000000 --- a/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include "../../../boards/nrf54h20dk_nrf54h20_common.dtsi" - -&adc { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; diff --git a/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/prj.conf b/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/prj.conf deleted file mode 100644 index b2a4ba591044..000000000000 --- a/samples/drivers/adc/adc_sequence/sysbuild/vpr_launcher/prj.conf +++ /dev/null @@ -1 +0,0 @@ -# nothing here From e4aae8012e98e0a9fcd09a4ad0d33ee25e883363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1413/3334] Revert "[nrf fromlist] drivers: nrf: Add missing SoC header includes to adc and i2s" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2ff960e88efceef4339d89105dead18e3cc57e76. Signed-off-by: Tomasz Moń --- drivers/adc/adc_nrfx_saadc.c | 1 - drivers/i2s/i2s_nrf_tdm.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index b92b5ccfe6b3..06035e2c3c5d 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -13,7 +13,6 @@ #include #include #include -#include LOG_MODULE_REGISTER(adc_nrfx_saadc, CONFIG_ADC_LOG_LEVEL); diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index fc823ce5055a..45e5b3d18049 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -16,7 +16,6 @@ #include #include #include -#include #include LOG_MODULE_REGISTER(tdm_nrf, CONFIG_I2S_LOG_LEVEL); From f6794fa8f6c86608aa7bc7a051eb23c47cb33e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1414/3334] Revert "[nrf fromlist] tests: drivers: adc: Enable tests for nrf54h20 PPR." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 926b74cef26e63f2e8c9061599c924f2295dfd20. Signed-off-by: Tomasz Moń --- tests/drivers/adc/adc_accuracy_test/testcase.yaml | 1 - .../boards/nrf54h20dk_nrf54h20_common.dtsi | 11 ----------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 8 ++++++-- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 11 ----------- tests/drivers/adc/adc_error_cases/testcase.yaml | 1 - 5 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_common.dtsi delete mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr.overlay diff --git a/tests/drivers/adc/adc_accuracy_test/testcase.yaml b/tests/drivers/adc/adc_accuracy_test/testcase.yaml index 1f2f7c0fcfeb..03f122f9cdaa 100644 --- a/tests/drivers/adc/adc_accuracy_test/testcase.yaml +++ b/tests/drivers/adc/adc_accuracy_test/testcase.yaml @@ -22,7 +22,6 @@ tests: - frdm_mcxc444 - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_common.dtsi deleted file mode 100644 index bb3597397b96..000000000000 --- a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_common.dtsi +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 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 index efc3d8f64b45..18e74f72ee26 100644 --- a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,7 +1,11 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA */ -#include "nrf54h20dk_nrf54h20_common.dtsi" +/ { + aliases { + adc = &adc; + }; +}; diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index bcd359c3aa23..000000000000 --- a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2025 Nordic Semiconductor ASA - */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" - -&adc { - status = "okay"; -}; diff --git a/tests/drivers/adc/adc_error_cases/testcase.yaml b/tests/drivers/adc/adc_error_cases/testcase.yaml index 739efb735632..57513c78e156 100644 --- a/tests/drivers/adc/adc_error_cases/testcase.yaml +++ b/tests/drivers/adc/adc_error_cases/testcase.yaml @@ -11,7 +11,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - ophelia4ev/nrf54l15/cpuapp - xg24_rb4187c - xg27_dk2602a From 017cf94fe08935cf60a80d162ace51cd406fd91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1415/3334] Revert "[nrf fromlist] boards: nordic: nrf54h20: Add adc to supported features" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a8c9070e4892ad19f028849e7abe16576ee0746c. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml index 87fe8c68ba91..60f22350504d 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_0_9_0.yaml @@ -11,7 +11,6 @@ sysbuild: true ram: 62 flash: 62 supported: - - adc - counter - gpio - i2c From 87b3577fccf3ed0924e9b4f75979f6fe783f29d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1416/3334] Revert "[nrf fromlist] Bluetooth: Host: Invoke tx callbacks when channel is deleted" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2d07f22566945a84254eca09b0f6953555193e3a. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/l2cap.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index c4e37f74b5ae..f65827fac1be 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -273,21 +273,6 @@ static void l2cap_chan_del(struct bt_l2cap_chan *chan) * `l2cap_chan_destroy()` as it is not called for fixed channels. */ while ((buf = k_fifo_get(&le_chan->tx_queue, K_NO_WAIT))) { - bt_conn_tx_cb_t cb = closure_cb(buf->user_data); - - if (cb) { - void *user_data = closure_data(buf->user_data); - - /* When bt_l2cap_send_pdu() succeeds, the stack takes ownership - * and must invoke the callback eventually. Since these PDUs will - * never be transmitted, invoke the callback now with an error. - * Note: We cannot use conn_tx_destroy() here because no bt_conn_tx - * struct has been allocated yet - the closure is still in the - * buf->user_data. - */ - cb(chan->conn, user_data, -ESHUTDOWN); - } - net_buf_unref(buf); } From 7d345138060797f6c4906f212b0a814cdb56907c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1417/3334] Revert "[nrf fromlist] tests: mbox: Add support for nRF54LM20A" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c5abbea4f0140057215fe9799ea8e21c8a55c04a. Signed-off-by: Tomasz Moń --- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 23 ------------------- .../drivers/mbox/mbox_error_cases/sample.yaml | 2 -- .../drivers/mbox/mbox_error_cases/src/main.c | 3 +-- 3 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 334ba0fa5b42..000000000000 --- a/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&cpuapp_vevif_tx 21>, <&cpuapp_vevif_tx 32>, - <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_rx 32>; - mbox-names = "remote_valid", "remote_incorrect", - "local_valid", "local_incorrect"; - - }; -}; - -&cpuapp_vevif_rx { - status = "okay"; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; diff --git a/tests/drivers/mbox/mbox_error_cases/sample.yaml b/tests/drivers/mbox/mbox_error_cases/sample.yaml index a285478b4235..2746a1c29044 100644 --- a/tests/drivers/mbox/mbox_error_cases/sample.yaml +++ b/tests/drivers/mbox/mbox_error_cases/sample.yaml @@ -17,10 +17,8 @@ tests: tests.drivers.mbox_error_cases.nrf54l: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_args: SNIPPET=nordic-flpr diff --git a/tests/drivers/mbox/mbox_error_cases/src/main.c b/tests/drivers/mbox/mbox_error_cases/src/main.c index 377ab6b8be43..54a4a628ec23 100644 --- a/tests/drivers/mbox/mbox_error_cases/src/main.c +++ b/tests/drivers/mbox/mbox_error_cases/src/main.c @@ -11,8 +11,7 @@ int dummy_value; #if defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || \ - defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) || \ - defined(CONFIG_SOC_NRF54LM20A) + defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) #define EXPECTED_MTU_VALUE (0) #define DATA_TRANSFER_MODE_SUPPORTED (0) #define REMOTE_BUSY_SUPPORTED (0) From 7bb80ef9c003f7608b30399bc6ba522221aad385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1418/3334] Revert "[nrf fromtree] tests: drivers: uart: uart_async_api: Enable test on nrf54h20 PPR XIP" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d2c4a88902da1582a2b8c75dd5f8a5fa5273d201. Signed-off-by: Tomasz Moń --- .../uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf | 3 --- .../boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf deleted file mode 100644 index 47f481017118..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_PM_DEVICE=y -CONFIG_PM_DEVICE_RUNTIME=y -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay deleted file mode 100644 index f65b4dd3b0ba..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" From 55792ab02c22fbbccd004338d42f8700ed6210ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1419/3334] Revert "[nrf fromlist] soc: nordic: nrf54h: Disable code relocation for MCUBOOT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8cf0404c5023efbfe877edc8e25c0adc212a1bc7. Signed-off-by: Tomasz Moń --- soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 2 +- soc/nordic/nrf54h/power.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index 674b5433c147..f2e0343d6350 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -15,6 +15,6 @@ config POWER_DOMAIN default y config CODE_DATA_RELOCATION - default y if (PM || POWEROFF) && !MCUBOOT + default y if PM || POWEROFF endif # SOC_NRF54H20_CPUAPP diff --git a/soc/nordic/nrf54h/power.c b/soc/nordic/nrf54h/power.c index c72cb6e834e5..3a23a6050605 100644 --- a/soc/nordic/nrf54h/power.c +++ b/soc/nordic/nrf54h/power.c @@ -88,12 +88,7 @@ void nrf_poweroff(void) CODE_UNREACHABLE; } -#if CONFIG_MCUBOOT -static __ramfunc -#else -static __attribute__((__used__, noinline)) -#endif -void cache_retain_and_sleep(void) +static __attribute__((__used__, noinline)) void cache_retain_and_sleep(void) { nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_SAVE); nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_SAVE); From b8f9baafa079cf03a143d2a52a5a7727b90a788b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1420/3334] Revert "[nrf fromlist] boards: Define pm_s2ram_stack for nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cc5f16968849d89b7b0343a9ee7bfceb6d55cc8f. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 06e208e248a2..a3be7ecaca94 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -352,13 +352,6 @@ zephyr_udc0: &usbhs { zephyr,memory-region = "PMLocalRamfunc"; }; - /* temporary stack for S2RAM resume logic */ - pm_s2ram_stack: cpuapp_s2ram_stack@22007fd0 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fd0 16>; - zephyr,memory-region = "pm_s2ram_stack"; - }; - /* run-time common S2RAM cpu context RAM */ pm_s2ram: cpuapp_s2ram@22007fe0 { compatible = "zephyr,memory-region", "mmio-sram"; From 2e2c1d9b8a076e06a5ed4d649ddd29ffbbea86e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1421/3334] Revert "[nrf fromtree] soc: nordic: nrf54h: Implement idle with cache retained state" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2aee95730b7d5eb72aee37c8d978527e20cb3588. Signed-off-by: Tomasz Moń --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 13 ++--- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 17 ------- dts/vendor/nordic/nrf54h20.dtsi | 12 ++--- soc/nordic/nrf54h/CMakeLists.txt | 5 -- .../nrf54h/Kconfig.defconfig.nrf54h20_cpuapp | 3 -- .../nrf54h/Kconfig.defconfig.nrf54h20_cpurad | 3 -- soc/nordic/nrf54h/power.c | 50 ++++--------------- soc/nordic/nrf54h/soc.c | 42 +++++++--------- soc/nordic/nrf54h/soc.h | 7 --- 9 files changed, 36 insertions(+), 116 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index a3be7ecaca94..f0e04ecfb51e 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -337,21 +337,14 @@ zephyr_udc0: &usbhs { status = "okay"; }; -/* Trim this RAM block for power management related features. */ +/* Trim this RAM block for making room on all run-time common S2RAM cpu context. */ &cpuapp_ram0 { - reg = <0x22000000 (DT_SIZE_K(32) - 256)>; - ranges = <0x0 0x22000000 (0x8000 - 0x100)>; + reg = <0x22000000 (DT_SIZE_K(32) - 32)>; + ranges = <0x0 0x22000000 (0x8000 - 0x20)>; }; / { soc { - /* cache control functions - must be executed from local SRAM */ - pm_ramfunc: cpuapp_s2ram@22007f00 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007f00 192>; - zephyr,memory-region = "PMLocalRamfunc"; - }; - /* run-time common S2RAM cpu context RAM */ pm_s2ram: cpuapp_s2ram@22007fe0 { compatible = "zephyr,memory-region", "mmio-sram"; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index fd5ad106117b..487df83f3bbf 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -118,20 +118,3 @@ slot1_partition: &cpurad_slot1_partition { zephyr_udc0: &usbhs { status = "disabled"; }; - -/* Trim this RAM block for power management related features. */ -&cpurad_ram0 { - reg = <0x23000000 (DT_SIZE_K(192) - 192)>; - ranges = <0x0 0x23000000 (0x30000 - 0xC0)>; -}; - -/ { - soc { - /* cache control functions - must be executed from RAM */ - pm_ramfunc: cpurad_s2ram@2302ff40 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2302ff80 192>; - zephyr,memory-region = "PMLocalRamfunc"; - }; - }; -}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index b3a960e740b9..70dd5809ba0b 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -31,7 +31,7 @@ device_type = "cpu"; clocks = <&cpuapp_hsfll>; clock-frequency = ; - cpu-power-states = <&idle_cache_retained &idle_cache_disabled &s2ram>; + cpu-power-states = <&idle_cache_disabled &s2ram>; }; cpurad: cpu@3 { @@ -40,7 +40,7 @@ device_type = "cpu"; clocks = <&cpurad_hsfll>; clock-frequency = ; - cpu-power-states = <&idle_cache_retained &idle_cache_disabled>; + cpu-power-states = <&idle_cache_disabled>; }; cpuppr: cpu@d { @@ -130,13 +130,7 @@ power-states { // substate-id = <0>; is reserved for "idle", cache powered on - idle_cache_retained: idle_cache_retained { - compatible = "zephyr,power-state"; - power-state-name = "suspend-to-idle"; - substate-id = <1>; - min-residency-us = <700>; - exit-latency-us = <5>; - }; + // substate-id = <1>; is reserved for "idle-cache-retained" idle_cache_disabled: idle_cache_disabled { compatible = "zephyr,power-state"; power-state-name = "suspend-to-idle"; diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index a4db05c9e643..94e38e62f2b1 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -5,11 +5,6 @@ if(CONFIG_ARM) zephyr_library_sources(soc.c) if(CONFIG_PM OR CONFIG_POWEROFF) zephyr_library_sources(power.c) - zephyr_code_relocate( - FILES power.c - FILTER ".*\\.cache_retain_and_sleep" - LOCATION PMLocalRamfunc_TEXT - ) endif() endif() diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index f2e0343d6350..0cdc22760405 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -14,7 +14,4 @@ config SHELL_BACKEND_SERIAL config POWER_DOMAIN default y -config CODE_DATA_RELOCATION - default y if PM || POWEROFF - endif # SOC_NRF54H20_CPUAPP diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad index 31687c2a5443..b3f5216c8f9f 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpurad @@ -14,7 +14,4 @@ config PM config POWER_DOMAIN default y -config CODE_DATA_RELOCATION - default y if PM || POWEROFF - endif # SOC_NRF54H20_CPURAD diff --git a/soc/nordic/nrf54h/power.c b/soc/nordic/nrf54h/power.c index 3a23a6050605..e1263be0d0e5 100644 --- a/soc/nordic/nrf54h/power.c +++ b/soc/nordic/nrf54h/power.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -88,43 +87,18 @@ void nrf_poweroff(void) CODE_UNREACHABLE; } -static __attribute__((__used__, noinline)) void cache_retain_and_sleep(void) +static void s2idle_enter(uint8_t substate_id) { - nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_SAVE); - nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_SAVE); - while (nrf_cache_busy_check(NRF_DCACHE) || - nrf_cache_busy_check(NRF_ICACHE)) { - - } - - __set_BASEPRI(0); - __ISB(); - __DSB(); - __WFI(); - - nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_RESTORE); - nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_RESTORE); - while (nrf_cache_busy_check(NRF_DCACHE) || - nrf_cache_busy_check(NRF_ICACHE)) { - - } -} - -void s2idle_enter(uint8_t substate_id) -{ -#if !defined(CONFIG_SOC_NRF54H20_CPURAD) - soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_MAIN); -#endif switch (substate_id) { case 0: /* Substate for idle with cache powered on - not implemented yet. */ break; - case 1: /* Substate for idle with cache retained. */ - soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); - nrf_soc_memconf_retain_set(true); - cache_retain_and_sleep(); - return; + case 1: /* Substate for idle with cache retained - not implemented yet. */ + break; case 2: /* Substate for idle with cache disabled. */ +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) + soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_MAIN); +#endif common_suspend(); break; default: /* Unknown substate. */ @@ -143,19 +117,17 @@ static void s2idle_exit(uint8_t substate_id) case 0: /* Substate for idle with cache powered on - not implemented yet. */ break; - case 1: /* Substate for idle with cache retained. */ - nrf_soc_memconf_retain_set(false); + case 1: /* Substate for idle with cache retained - not implemented yet. */ break; case 2: /* Substate for idle with cache disabled. */ nrf_power_up_cache(); - break; + common_resume(); +#if !defined(CONFIG_SOC_NRF54H20_CPURAD) + soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_MAIN); +#endif default: /* Unknown substate. */ return; } - common_resume(); -#if !defined(CONFIG_SOC_NRF54H20_CPURAD) - soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_MAIN); -#endif } #if defined(CONFIG_PM_S2RAM) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 1206e6767aa2..01cacf48f62f 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -60,26 +60,6 @@ sys_snode_t soc_node; ADDRESS_DOMAIN_Msk | \ ADDRESS_BUS_Msk))) -void nrf_soc_memconf_retain_set(bool enable) -{ - uint32_t ret_mask = BIT(RAMBLOCK_RET_BIT_ICACHE) | BIT(RAMBLOCK_RET_BIT_DCACHE); - - nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, ret_mask, enable); - nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 1, ret_mask, enable); - -#if defined(RAMBLOCK_RET2_MASK) - ret_mask = 0; -#if defined(RAMBLOCK_RET2_BIT_ICACHE) - ret_mask |= BIT(RAMBLOCK_RET2_BIT_ICACHE); -#endif -#if defined(RAMBLOCK_RET2_BIT_DCACHE) - ret_mask |= BIT(RAMBLOCK_RET2_BIT_DCACHE); -#endif - nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, ret_mask, enable); - nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 1, ret_mask, enable); -#endif /* defined(RAMBLOCK_RET2_MASK) */ -} - static void power_domain_init(void) { /* @@ -95,12 +75,28 @@ static void power_domain_init(void) soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); nrf_lrcconf_poweron_force_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_MAIN, false); - nrf_soc_memconf_retain_set(false); + + nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET_BIT_ICACHE, false); + nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET_BIT_DCACHE, false); + nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET_BIT_ICACHE, false); + nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET_BIT_DCACHE, false); +#if defined(RAMBLOCK_RET2_BIT_ICACHE) + nrf_memconf_ramblock_ret2_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET2_BIT_ICACHE, false); + nrf_memconf_ramblock_ret2_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET2_BIT_ICACHE, false); +#endif +#if defined(RAMBLOCK_RET2_BIT_DCACHE) + nrf_memconf_ramblock_ret2_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET2_BIT_DCACHE, false); + nrf_memconf_ramblock_ret2_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET2_BIT_DCACHE, false); +#endif nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET_MASK, true); nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET_MASK, true); #if defined(RAMBLOCK_RET2_MASK) - nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET2_MASK, true); - nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET2_MASK, true); + /* + * TODO: Use nrf_memconf_ramblock_ret2_mask_enable_set() function + * when will be provided by HAL. + */ + NRF_MEMCONF->POWER[0].RET2 = RAMBLOCK_RET2_MASK; + NRF_MEMCONF->POWER[1].RET2 = RAMBLOCK_RET2_MASK; #endif } diff --git a/soc/nordic/nrf54h/soc.h b/soc/nordic/nrf54h/soc.h index 69c22e52bd16..566c07a8c2cb 100644 --- a/soc/nordic/nrf54h/soc.h +++ b/soc/nordic/nrf54h/soc.h @@ -36,11 +36,4 @@ #define RAMBLOCK_RET2_BIT_DCACHE MEMCONF_POWER_RET2_MEM7_Pos #endif -/** - * @brief Enable or disable the retention for cache RAM blocks. - * - * @param enable True if the retention is to be enabled, false otherwise. - */ -void nrf_soc_memconf_retain_set(bool enable); - #endif /* SOC_ARM_NORDIC_NRF_NRF54H_SOC_H_ */ From 3331252036818ea486486574fcd2854eec96b2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1422/3334] Revert "[nrf noup] boards: Align board DTS with upstream." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 96f15ca90e4b260943d012a1a6b5bf3bf093559d. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index f0e04ecfb51e..e587bc8b4d99 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -339,8 +339,8 @@ zephyr_udc0: &usbhs { /* Trim this RAM block for making room on all run-time common S2RAM cpu context. */ &cpuapp_ram0 { - reg = <0x22000000 (DT_SIZE_K(32) - 32)>; - ranges = <0x0 0x22000000 (0x8000 - 0x20)>; + reg = <0x22000000 (DT_SIZE_K(32)-32)>; + ranges = <0x0 0x22000000 (0x8000-0x20)>; }; / { From 272e19ec24f3e8ba3ba9dc663d53a797903b56c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1423/3334] Revert "[nrf fromtree] tests: boot: Fix bootloader.mcuboot boot loop for nrf platforms" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e5079bb3123140c02a84f20c30507d9e7360a390. Signed-off-by: Tomasz Moń --- tests/boot/test_mcuboot/sysbuild.cmake | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/boot/test_mcuboot/sysbuild.cmake b/tests/boot/test_mcuboot/sysbuild.cmake index 920d07933917..dc5165114b58 100644 --- a/tests/boot/test_mcuboot/sysbuild.cmake +++ b/tests/boot/test_mcuboot/sysbuild.cmake @@ -14,12 +14,6 @@ ExternalZephyrProject_Add( SOURCE_DIR ${APP_DIR}/swapped_app ) -# This section ensures that sysbuild-related configurations, such as the MCUBOOT swap type, -# are passed down to the swapped_app image. -set_target_properties(swapped_app PROPERTIES - IMAGE_CONF_SCRIPT ${ZEPHYR_BASE}/share/sysbuild/image_configurations/MAIN_image_default.cmake -) - # Add the swapped app to the list of images to flash # Ensure the flashing order of images is as follows: # - mcuboot From 04116b3aaf8c58cc9851ce53a242799764bcaf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1424/3334] Revert "[nrf fromtree] Bluetooth: Mesh: Deprecate blob_io_flash erase cap options" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit da3588e6d2dc200e1a56d267139aa809e048d318. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/Kconfig | 27 +++++++++++++++++---------- subsys/bluetooth/mesh/blob_io_flash.c | 10 ++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 02845ab743c5..dc0eb71841d7 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1038,7 +1038,6 @@ config BT_MESH_BLOB_IO_FLASH default y depends on BT_MESH_BLOB_SRV || BT_MESH_BLOB_CLI depends on FLASH_MAP - depends on FLASH_PAGE_LAYOUT help Enable the BLOB flash stream for reading and writing BLOBs directly to and from flash. @@ -1046,28 +1045,36 @@ config BT_MESH_BLOB_IO_FLASH if BT_MESH_BLOB_IO_FLASH config BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE - bool "BLOB flash support for devices without erase [DEPRECATED]" - default n + bool "BLOB flash support for devices without erase" + default y if FLASH_HAS_NO_EXPLICIT_ERASE depends on FLASH_HAS_NO_EXPLICIT_ERASE - select DEPRECATED help - This option is deprecated and is no longer used by the BLOB IO Flash module. + Enable path supporting devices without erase. This option appears only + if there are devices without explicit erase requirements in the system + and may be disabled to reduce code size in case when no operations + are intended on such type of devices. config BT_MESH_BLOB_IO_FLASH_WITH_ERASE - bool "BLOB flash support for devices with erase [DEPRECATED]" - default n + bool "BLOB flash support for devices with erase" + default y if FLASH_HAS_EXPLICIT_ERASE depends on FLASH_HAS_EXPLICIT_ERASE depends on FLASH_PAGE_LAYOUT - select DEPRECATED help - This option is deprecated and is no longer used by the BLOB IO Flash module. + Enable path supporting devices with erase. This option appears only + if there are devices requiring erase, before write, in the system + and may be disabled to reduce code size in case when no operations + are intended on such type of devices. + +if BT_MESH_BLOB_IO_FLASH_WITH_ERASE config BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX int "Maximum supported write block size" default 4 help The BLOB IO Flash module will support flash devices with explicit erase - when this value is set to a multiple of the device write block size. + using a write block size of at most this value. + +endif # BT_MESH_BLOB_IO_FLASH_WITH_ERASE endif # BT_MESH_BLOB_IO_FLASH diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index 792c53d4a0a6..95554dd2f55b 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -70,6 +70,8 @@ static void io_close(const struct bt_mesh_blob_io *io, flash_area_close(flash->area); } +/* Erasure code not needed if no flash in the system requires explicit erase */ +#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE static inline int erase_device_block(const struct flash_area *fa, off_t start, size_t size) { const struct device *fdev = flash_area_get_device(fa); @@ -80,12 +82,15 @@ static inline int erase_device_block(const struct flash_area *fa, off_t start, s return -ENODEV; } +#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE + /* We have a mix of devices in system */ const struct flash_parameters *fparam = flash_get_parameters(fdev); /* If device has no erase requirement then do nothing */ if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { return 0; } +#endif /* CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE */ err = flash_get_page_info_by_offs(fdev, start, &page); if (err) { @@ -115,6 +120,7 @@ static int block_start(const struct bt_mesh_blob_io *io, return erase_device_block(flash->area, flash->offset + block->offset, block->size); } +#endif /* CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE */ static int rd_chunk(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, @@ -193,7 +199,11 @@ int bt_mesh_blob_io_flash_init(struct bt_mesh_blob_io_flash *flash, flash->offset = offset; flash->io.open = io_open; flash->io.close = io_close; +#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE flash->io.block_start = block_start; +#else + flash->io.block_start = NULL; +#endif flash->io.block_end = NULL; flash->io.rd = rd_chunk; flash->io.wr = wr_chunk; From abbd16b249acd79469f8ff4a669ac528fba925f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1425/3334] Revert "[nrf fromtree] Bluetooth: Mesh: decouple blob_io_flash from internal flash" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit af3a68be8c7c883d334de5b869f285a2081a75dd. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/Kconfig | 11 ----- subsys/bluetooth/mesh/blob_io_flash.c | 63 +++++++-------------------- 2 files changed, 15 insertions(+), 59 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index dc0eb71841d7..c6a25260612f 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1065,17 +1065,6 @@ config BT_MESH_BLOB_IO_FLASH_WITH_ERASE and may be disabled to reduce code size in case when no operations are intended on such type of devices. -if BT_MESH_BLOB_IO_FLASH_WITH_ERASE - -config BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX - int "Maximum supported write block size" - default 4 - help - The BLOB IO Flash module will support flash devices with explicit erase - using a write block size of at most this value. - -endif # BT_MESH_BLOB_IO_FLASH_WITH_ERASE - endif # BT_MESH_BLOB_IO_FLASH config BT_MESH_DFU_SRV diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index 95554dd2f55b..f4856723d7a1 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -12,17 +12,13 @@ #include "net.h" #include "transport.h" -#define LOG_LEVEL CONFIG_BT_MESH_MODEL_LOG_LEVEL -#include -LOG_MODULE_REGISTER(bt_mesh_blob_io_flash); +#define WRITE_BLOCK_SIZE DT_PROP(DT_INST(0, soc_nv_flash), write_block_size) #define FLASH_IO(_io) CONTAINER_OF(_io, struct bt_mesh_blob_io_flash, io) static int test_flash_area(uint8_t area_id) { - const struct flash_parameters *fparam; const struct flash_area *area; - const struct device *fdev; uint8_t align; int err; @@ -32,19 +28,9 @@ static int test_flash_area(uint8_t area_id) } align = flash_area_align(area); - fdev = flash_area_get_device(area); - fparam = flash_get_parameters(fdev); - flash_area_close(area); - if (!fdev) { - return -ENODEV; - } - - if ((flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT) && - CONFIG_BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX % align) { - LOG_ERR("CONFIG_BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX must be set to a\n" - "multiple of the write block size for the flash deviced used."); + if (align > WRITE_BLOCK_SIZE) { return -EINVAL; } @@ -140,49 +126,30 @@ static int wr_chunk(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_chunk *chunk) { struct bt_mesh_blob_io_flash *flash = FLASH_IO(io); - const struct device *fdev = flash_area_get_device(flash->area); - if (!fdev) { - return -ENODEV; - } - - const struct flash_parameters *fparam = flash_get_parameters(fdev); - - /* - * If device has no erase requirement then write directly. - * This is required since trick with padding using the erase value will - * not work in this case. - */ - if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { + if (IS_ENABLED(CONFIG_SOC_FLASH_NRF_RRAM)) { return flash_area_write(flash->area, flash->offset + block->offset + chunk->offset, chunk->data, chunk->size); } - /* - * Allocate one additional write block for the case where a chunk will need - * an extra write block on both sides to fit. - */ - uint8_t buf[ROUND_UP(BLOB_RX_CHUNK_SIZE, CONFIG_BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX) - + CONFIG_BT_MESH_BLOB_IO_FLASH_WRITE_BLOCK_SIZE_MAX]; - uint32_t write_block_size = flash_area_align(flash->area); + uint8_t buf[ROUND_UP(BLOB_RX_CHUNK_SIZE, WRITE_BLOCK_SIZE)]; off_t area_offset = flash->offset + block->offset + chunk->offset; - int start_pad = area_offset % write_block_size; + int i = 0; + + /* Write block align the chunk data */ + memset(&buf[i], 0xff, area_offset % WRITE_BLOCK_SIZE); + i += area_offset % WRITE_BLOCK_SIZE; - /* - * Fill buffer with erase value, to make sure only the part of the - * buffer with chunk data will overwrite flash. - * (Because chunks can arrive in random order, this is required unless - * the entire block is cached in RAM). - */ - memset(buf, fparam->erase_value, sizeof(buf)); + memcpy(&buf[i], chunk->data, chunk->size); + i += chunk->size; - memcpy(&buf[start_pad], chunk->data, chunk->size); + memset(&buf[i], 0xff, ROUND_UP(i, WRITE_BLOCK_SIZE) - i); + i = ROUND_UP(i, WRITE_BLOCK_SIZE); return flash_area_write(flash->area, - ROUND_DOWN(area_offset, write_block_size), - buf, - ROUND_UP(start_pad + chunk->size, write_block_size)); + ROUND_DOWN(area_offset, WRITE_BLOCK_SIZE), + buf, i); } int bt_mesh_blob_io_flash_init(struct bt_mesh_blob_io_flash *flash, From 4021de48ef0518eab9be005e8230c63e3bac04ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:01 +0100 Subject: [PATCH 1426/3334] Revert "[nrf fromtree] Bluetooth: Mesh: make blob_io_flash support smaller blocks" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 466221ac7f44a7ad199b8c959e41e1f71db885c4. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/blob_io_flash.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index f4856723d7a1..293f08feecdc 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -83,13 +83,9 @@ static inline int erase_device_block(const struct flash_area *fa, off_t start, s return err; } - if (start != page.start_offset) { - /* Only need to erase when starting the first block on the page. */ - return 0; - } - /* Align to page boundary. */ size = page.size * DIV_ROUND_UP(size, page.size); + start = page.start_offset; return flash_area_erase(fa, start, size); } From 7bf571e9c9ca8908ab708b892e470c29b8a8eb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1427/3334] Revert "[nrf fromtree] Bluetooth: Mesh: Decouple blob_io_flash erase from flash config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9f3067646ac8ea7ec76862d8c4d80290610cdd50. Signed-off-by: Tomasz Moń --- subsys/bluetooth/mesh/Kconfig | 1 - subsys/bluetooth/mesh/blob_io_flash.c | 65 +++++++++++++-------------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index c6a25260612f..2c03c4e9ea3f 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1058,7 +1058,6 @@ config BT_MESH_BLOB_IO_FLASH_WITH_ERASE bool "BLOB flash support for devices with erase" default y if FLASH_HAS_EXPLICIT_ERASE depends on FLASH_HAS_EXPLICIT_ERASE - depends on FLASH_PAGE_LAYOUT help Enable path supporting devices with erase. This option appears only if there are devices requiring erase, before write, in the system diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index 293f08feecdc..8d989a6feca5 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -56,38 +56,42 @@ static void io_close(const struct bt_mesh_blob_io *io, flash_area_close(flash->area); } -/* Erasure code not needed if no flash in the system requires explicit erase */ -#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE static inline int erase_device_block(const struct flash_area *fa, off_t start, size_t size) { - const struct device *fdev = flash_area_get_device(fa); - struct flash_pages_info page; - int err; - - if (!fdev) { - return -ENODEV; - } - -#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE - /* We have a mix of devices in system */ - const struct flash_parameters *fparam = flash_get_parameters(fdev); - - /* If device has no erase requirement then do nothing */ - if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { - return 0; + /* If there are no devices requiring erase, then there is nothing to do */ + if (IS_ENABLED(CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE)) { + const struct device *fdev = flash_area_get_device(fa); + + if (!fdev) { + return -ENODEV; + } + + /* We have a mix of devices in system */ + if (IS_ENABLED(CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE)) { + const struct flash_parameters *fparam = flash_get_parameters(fdev); + + /* If device has no erase requirement then do nothing */ + if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { + return 0; + } + } + + if (IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT)) { + struct flash_pages_info page; + int err; + + err = flash_get_page_info_by_offs(fdev, start, &page); + if (err) { + return err; + } + + size = page.size * DIV_ROUND_UP(size, page.size); + start = page.start_offset; + } + return flash_area_erase(fa, start, size); } -#endif /* CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE */ - err = flash_get_page_info_by_offs(fdev, start, &page); - if (err) { - return err; - } - - /* Align to page boundary. */ - size = page.size * DIV_ROUND_UP(size, page.size); - start = page.start_offset; - - return flash_area_erase(fa, start, size); + return 0; } static int block_start(const struct bt_mesh_blob_io *io, @@ -102,7 +106,6 @@ static int block_start(const struct bt_mesh_blob_io *io, return erase_device_block(flash->area, flash->offset + block->offset, block->size); } -#endif /* CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE */ static int rd_chunk(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, @@ -162,11 +165,7 @@ int bt_mesh_blob_io_flash_init(struct bt_mesh_blob_io_flash *flash, flash->offset = offset; flash->io.open = io_open; flash->io.close = io_close; -#ifdef CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE flash->io.block_start = block_start; -#else - flash->io.block_start = NULL; -#endif flash->io.block_end = NULL; flash->io.rd = rd_chunk; flash->io.wr = wr_chunk; From 1a78e3eab3873eea4b86e0c33f312483c1052db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1428/3334] Revert "[nrf fromtree] dts: arm: nrf54h20_cpurad: disable unsuppported s2ram state" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 262d3e43c26d859b0cfbb8961cb436f3f503255d. Signed-off-by: Tomasz Moń --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index f7f7464f91c2..279bc7581112 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -21,7 +21,6 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &cpuapp_ram0; /delete-node/ &cpuppr; /delete-node/ &cpuflpr; -/delete-node/ &s2ram; / { soc { From ac0d5d7041a825bd06b903a1701f040243691783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1429/3334] Revert "[nrf fromlist] soc: nordic: common: dmm: Fix allocation algorithm" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5e15ebc78368d551bff9087db2e0dedca4fdd934. Signed-off-by: Tomasz Moń --- soc/nordic/common/dmm.c | 91 ++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index ac22f8ee430a..e832a1f27b80 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -135,19 +135,32 @@ static void tail_mask_set(atomic_t *tail_mask, size_t num_bits, size_t off) return; } + /* If bit mask exceeds a single word then tail may spill to the adjacent word. */ size_t idx = tail_off / 32; - atomic_t *t_mask = &tail_mask[idx]; - tail_off = tail_off % 32; - while (tail_bits > 0) { - uint32_t bits = MIN(32 - tail_off, tail_bits); - uint32_t mask = (bits == 32) ? UINT32_MAX : (BIT_MASK(bits) << tail_off); + tail_off = tail_off - 32 * idx; + if ((tail_off + tail_bits) <= 32) { + /* Tail mask fits in a single word. */ + atomic_or(&tail_mask[idx], BIT_MASK(tail_bits) << tail_off); + return; + } + + /* Tail spilled. Remainder is set in the next word. Since number of tail_masks + * match number of words in bitarray we don't need to check if we are exceeding + * the array boundary. + */ + atomic_or(&tail_mask[idx], BIT_MASK(32 - tail_off) << tail_off); + + + size_t rem_tail = tail_bits - (32 - tail_off); + atomic_t *mask = &tail_mask[idx + 1]; - atomic_or(t_mask, mask); - t_mask++; - tail_off = 0; - tail_bits -= bits; + while (rem_tail >= 32) { + atomic_or(mask, UINT32_MAX); + mask++; + rem_tail -= 32; } + atomic_or(mask, BIT_MASK(rem_tail)); } /* Function determines how many chunks were used for the allocated buffer. It is @@ -162,37 +175,47 @@ static void tail_mask_set(atomic_t *tail_mask, size_t num_bits, size_t off) */ static uint32_t num_bits_get(atomic_t *tail_mask, size_t off) { - uint32_t num_bits = 1; - size_t tail_off = off + 1; - size_t idx = tail_off / 32; - atomic_t *t_mask = &tail_mask[idx]; + uint32_t mask; + uint32_t num_bits; - tail_off = tail_off % 32; - do { - uint32_t mask = (uint32_t)*t_mask >> tail_off; - - if (mask == UINT32_MAX) { - num_bits += 32; - atomic_set(t_mask, 0); - } else { - uint32_t bits = __builtin_ctz(~mask); + if (HEAP_NUM_WORDS == 1) { + mask = (*tail_mask | BIT(off)) >> off; + num_bits = (~mask == 0) ? 32 : __builtin_ctz(~mask); + if (num_bits > 1) { + mask = BIT_MASK(num_bits - 1) << (off + 1); + atomic_and(tail_mask, ~mask); + } - if (bits == 0) { - break; - } + return num_bits; + } - num_bits += bits; - atomic_and(t_mask, ~(BIT_MASK(bits) << tail_off)); + /* In multiword bit array we need to check if tail is spilling over to the next word. */ + size_t idx = off / 32; + size_t w_off = off - 32 * idx; + atomic_t *t_mask = &tail_mask[idx]; - if (bits + tail_off < 32) { - break; - } + mask = (*t_mask | BIT(w_off)) >> w_off; + num_bits = (~mask == 0) ? 32 : __builtin_ctz(~mask); + if (num_bits == 1) { + return num_bits; + } - tail_off = 0; - } + mask = BIT_MASK(num_bits - 1) << (w_off + 1); + atomic_and(t_mask, ~mask); + if (((w_off + num_bits) == 32) && (idx < (HEAP_NUM_WORDS - 1))) { + size_t tmp_bits; - t_mask++; - } while ((HEAP_NUM_WORDS > 1) && (t_mask != &tail_mask[HEAP_NUM_WORDS])); + /* If we are at the end of the one mask we need to check the beginning of the + * next one as there might be remaining part of the tail. + */ + do { + t_mask++; + tmp_bits = (*t_mask == UINT32_MAX) ? 32 : __builtin_ctz(~(*t_mask)); + mask = (tmp_bits == 32) ? UINT32_MAX : BIT_MASK(tmp_bits); + atomic_and(t_mask, ~mask); + num_bits += tmp_bits; + } while ((tmp_bits == 32) && (t_mask != &tail_mask[HEAP_NUM_WORDS - 1])); + } return num_bits; } From f4a196248827f6046c48650a1446cfe01c93c65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1430/3334] Revert "[nrf fromlist] tests: boards: nrf: dmm: Skip stress test for empty memory region" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 853ce9833bd2b694cb09d2d2077348741cf76b32. Signed-off-by: Tomasz Moń --- tests/boards/nrf/dmm/src/main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 58b7e891c795..27d239d5cf20 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -522,10 +522,6 @@ static void stress_allocator(void *mem_reg, bool cached) int rv; uint32_t curr_use; - if (mem_reg == NULL) { - ztest_test_skip(); - } - memset(&ctx, 0, sizeof(ctx)); ctx.mem_reg = mem_reg; ctx.cached = cached; From 70a58b0c5f6bffc5bef1f80f4c77527487461647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1431/3334] Revert "[nrf fromtree] tests: boards: nrf: dmm: Add stress test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 46682fcc47a2f6f42b9e161c10e33b065a6ebb8c. Signed-off-by: Tomasz Moń --- tests/boards/nrf/dmm/prj.conf | 1 - tests/boards/nrf/dmm/src/main.c | 178 ----------------------------- tests/boards/nrf/dmm/testcase.yaml | 6 - 3 files changed, 185 deletions(-) diff --git a/tests/boards/nrf/dmm/prj.conf b/tests/boards/nrf/dmm/prj.conf index c05afbb6ad35..0b99d72b0c32 100644 --- a/tests/boards/nrf/dmm/prj.conf +++ b/tests/boards/nrf/dmm/prj.conf @@ -1,5 +1,4 @@ CONFIG_ZTEST=y -CONFIG_ZTRESS=y CONFIG_ASSERT=n CONFIG_SPIN_VALIDATE=n CONFIG_TEST_EXTRA_STACK_SIZE=512 diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 27d239d5cf20..f4073d82e9b2 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include @@ -385,182 +383,6 @@ ZTEST_USER_F(dmm, test_check_multiple_alloc_and_free) } } -struct dmm_stress_data { - void *mem_reg; - void *alloc_ptr[32]; - uint8_t alloc_token[32]; - size_t alloc_len[32]; - atomic_t alloc_mask; - atomic_t busy_mask; - atomic_t fails; - atomic_t cnt; - bool cached; -}; - -static void stress_free_op(struct dmm_stress_data *data, int prio, int id) -{ - /* buffer is allocated. */ - uint8_t token = data->alloc_token[id]; - size_t len = data->alloc_len[id]; - uint8_t *ptr = data->alloc_ptr[id]; - int rv; - - for (int j = 0; j < len; j++) { - uint8_t exp_val = (uint8_t)(token + j); - - if (ptr[j] != exp_val) { - for (int k = 0; k < len; k++) { - printk("%02x ", ptr[k]); - } - } - zassert_equal(ptr[j], exp_val, "At %d got:%d exp:%d, len:%d id:%d, alloc_cnt:%d", - j, ptr[j], exp_val, len, id, (uint32_t)data->cnt); - } - - rv = dmm_buffer_in_release(data->mem_reg, ptr, len, ptr); - zassert_ok(rv); - /* Indicate that buffer is released. */ - atomic_and(&data->alloc_mask, ~BIT(id)); -} - -static bool stress_alloc_op(struct dmm_stress_data *data, int prio, int id) -{ - uint32_t r32 = sys_rand32_get(); - size_t len = r32 % 512; - uint8_t *ptr = data->alloc_ptr[id]; - int rv; - - /* Rarely allocate bigger buffer. */ - if ((r32 & 0x7) == 0) { - len += 512; - } - - rv = dmm_buffer_in_prepare(data->mem_reg, &r32/*dummy*/, len, (void **)&ptr); - if (rv < 0) { - atomic_inc(&data->fails); - return true; - } - - uint8_t token = r32 >> 24; - - data->alloc_ptr[id] = ptr; - data->alloc_len[id] = len; - data->alloc_token[id] = token; - for (int j = 0; j < len; j++) { - ptr[j] = (uint8_t)(j + token); - } - if (data->cached) { - sys_cache_data_flush_range(ptr, len); - } - atomic_inc(&data->cnt); - return false; -} - -bool stress_func(void *user_data, uint32_t cnt, bool last, int prio) -{ - struct dmm_stress_data *data = user_data; - uint32_t r = sys_rand32_get(); - int rpt = r & 0x3; - - r >>= 2; - - for (int i = 0; i < rpt + 1; i++) { - int id = r % 32; - int key; - bool free_op; - bool clear_bit; - - key = irq_lock(); - if ((data->busy_mask & BIT(id)) == 0) { - data->busy_mask |= BIT(id); - if (data->alloc_mask & BIT(id)) { - free_op = true; - } else { - data->alloc_mask |= BIT(id); - free_op = false; - } - } else { - irq_unlock(key); - continue; - } - - irq_unlock(key); - r >>= 5; - - if (free_op) { - stress_free_op(data, prio, id); - clear_bit = true; - } else { - clear_bit = stress_alloc_op(data, prio, id); - } - - key = irq_lock(); - data->busy_mask &= ~BIT(id); - if (clear_bit) { - data->alloc_mask &= ~BIT(id); - } - irq_unlock(key); - } - - return true; -} - -static void free_all(struct dmm_stress_data *data) -{ - while (data->alloc_mask) { - int id = 31 - __builtin_clz(data->alloc_mask); - - stress_free_op(data, 0, id); - data->alloc_mask &= ~BIT(id); - } -} - -static void stress_allocator(void *mem_reg, bool cached) -{ - uint32_t timeout = 3000; - struct dmm_stress_data ctx; - int rv; - uint32_t curr_use; - - memset(&ctx, 0, sizeof(ctx)); - ctx.mem_reg = mem_reg; - ctx.cached = cached; - - if (IS_ENABLED(CONFIG_DMM_STATS)) { - rv = dmm_stats_get(ctx.mem_reg, NULL, &curr_use, NULL); - zassert_ok(rv); - } - - ztress_set_timeout(K_MSEC(timeout)); - - ZTRESS_EXECUTE(ZTRESS_THREAD(stress_func, &ctx, INT32_MAX, INT32_MAX, Z_TIMEOUT_TICKS(4)), - ZTRESS_THREAD(stress_func, &ctx, INT32_MAX, INT32_MAX, Z_TIMEOUT_TICKS(4)), - ZTRESS_THREAD(stress_func, &ctx, INT32_MAX, INT32_MAX, Z_TIMEOUT_TICKS(4))); - - free_all(&ctx); - TC_PRINT("Executed %d allocation operation. Failed to allocate %d times.\n", - (uint32_t)ctx.cnt, (uint32_t)ctx.fails); - - if (IS_ENABLED(CONFIG_DMM_STATS)) { - uint32_t curr_use2; - - rv = dmm_stats_get(ctx.mem_reg, NULL, &curr_use2, NULL); - zassert_ok(rv); - zassert_equal(curr_use, curr_use2, "Unexpected usage got:%d exp:%d", - curr_use2, curr_use); - } -} - -ZTEST_F(dmm, test_stress_allocator_nocache) -{ - stress_allocator(fixture->regions[DMM_TEST_REGION_NOCACHE].mem_reg, false); -} - -ZTEST_F(dmm, test_stress_allocator_cache) -{ - stress_allocator(fixture->regions[DMM_TEST_REGION_CACHE].mem_reg, true); -} - ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); int dmm_test_prepare(void) diff --git a/tests/boards/nrf/dmm/testcase.yaml b/tests/boards/nrf/dmm/testcase.yaml index 7fc991d4824c..140454add34e 100644 --- a/tests/boards/nrf/dmm/testcase.yaml +++ b/tests/boards/nrf/dmm/testcase.yaml @@ -21,9 +21,3 @@ tests: - CONFIG_DMM_STATS=y platform_allow: - nrf54h20dk/nrf54h20/cpuapp - boards.nrf.dmm.more_chunks: - extra_configs: - - CONFIG_DMM_STATS=y - - CONFIG_DMM_HEAP_CHUNKS=96 - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp From 3af0db7c2ff0bab4add36864e52dd86424468e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1432/3334] Revert "[nrf fromtree] tests: boards: nrf: dmm: Extend test coverage" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2b669605aa89d4233fde1eef1bdfdba127e5299e. Signed-off-by: Tomasz Moń --- tests/boards/nrf/dmm/src/main.c | 46 ------------------------------ tests/boards/nrf/dmm/testcase.yaml | 5 ---- 2 files changed, 51 deletions(-) diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index f4073d82e9b2..6cfeb1372ec2 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -337,52 +337,6 @@ ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) user_data, sizeof(user_data), true, false, true); } -ZTEST_USER_F(dmm, test_check_multiple_alloc_and_free) -{ - int retval; - uint8_t buf[256]; - uint8_t buf2[32]; - void *dmm_buf; - void *dmm_buf2; - void *mem_reg = fixture->regions[DMM_TEST_REGION_NOCACHE].mem_reg; - uintptr_t start_address; - uint32_t curr_use, max_use; - - if (IS_ENABLED(CONFIG_DMM_STATS)) { - retval = dmm_stats_get(mem_reg, &start_address, &curr_use, &max_use); - zassert_ok(retval); - } - - memset(buf, 0, sizeof(buf)); - memset(buf2, 0, sizeof(buf2)); - - retval = dmm_buffer_out_prepare(mem_reg, (void *)buf, sizeof(buf), &dmm_buf); - zassert_ok(retval); - zassert_true(dmm_buf != NULL); - - retval = dmm_buffer_out_prepare(mem_reg, (void *)buf2, sizeof(buf2), &dmm_buf2); - zassert_ok(retval); - zassert_true(dmm_buf2 != NULL); - - retval = dmm_buffer_out_release(mem_reg, dmm_buf2); - zassert_ok(retval); - zassert_true(dmm_buf != NULL); - - retval = dmm_buffer_out_release(mem_reg, dmm_buf); - zassert_ok(retval); - zassert_true(dmm_buf != NULL); - - if (IS_ENABLED(CONFIG_DMM_STATS)) { - uint32_t curr_use2; - - retval = dmm_stats_get(mem_reg, &start_address, &curr_use2, &max_use); - zassert_ok(retval); - zassert_equal(curr_use, curr_use2); - TC_PRINT("Stats start_address:%p current use:%d%% max use:%d%%\n", - (void *)start_address, curr_use2, max_use); - } -} - ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); int dmm_test_prepare(void) diff --git a/tests/boards/nrf/dmm/testcase.yaml b/tests/boards/nrf/dmm/testcase.yaml index 140454add34e..b5f41f281a5b 100644 --- a/tests/boards/nrf/dmm/testcase.yaml +++ b/tests/boards/nrf/dmm/testcase.yaml @@ -16,8 +16,3 @@ tests: - CONFIG_DCACHE=n platform_allow: - nrf54h20dk/nrf54h20/cpuapp - boards.nrf.dmm.stats: - extra_configs: - - CONFIG_DMM_STATS=y - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp From 20be4774c9af6e0a1b9ae1f496a77f8fb8c7dc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1433/3334] Revert "[nrf fromtree] soc: nordic: common: dmm: Add optional usage stats" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4294147e26f94c2c5c6c58fda5bda1cbb2da25f5. Signed-off-by: Tomasz Moń --- soc/nordic/common/Kconfig | 3 --- soc/nordic/common/dmm.c | 45 --------------------------------------- soc/nordic/common/dmm.h | 27 ----------------------- 3 files changed, 75 deletions(-) diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index e1fcd713c77c..b3a8f13089db 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -60,9 +60,6 @@ config DMM_HEAP_CHUNKS Number of chunks is a trade-off between performance and granularity. Must be multiply of 32. -config DMM_STATS - bool "Usage statistics" - endif # HAS_NORDIC_DMM rsource "vpr/Kconfig" diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index e832a1f27b80..411b8be14a75 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -52,11 +52,6 @@ struct dmm_heap { size_t blk_size; const struct dmm_region *region; sys_bitarray_t bitarray; -#ifdef CONFIG_DMM_STATS - atomic_t curr_use; - uint32_t max_use; - struct k_spinlock lock; -#endif }; static const struct dmm_region dmm_regions[] = { @@ -240,15 +235,6 @@ static void *dmm_buffer_alloc(struct dmm_heap *dh, size_t length) tail_mask_set(dh->tail_mask, num_bits, off); -#ifdef CONFIG_DMM_STATS - k_spinlock_key_t key; - - key = k_spin_lock(&dh->lock); - dh->curr_use += num_bits; - dh->max_use = MAX(dh->max_use, dh->curr_use); - k_spin_unlock(&dh->lock, key); -#endif - return (void *)(dh->ptr + dh->blk_size * off); } @@ -258,9 +244,6 @@ static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) size_t num_bits = num_bits_get(dh->tail_mask, offset); int rv; -#ifdef CONFIG_DMM_STATS - atomic_sub(&dh->curr_use, num_bits); -#endif rv = sys_bitarray_free(&dh->bitarray, num_bits, offset); (void)rv; __ASSERT_NO_MSG(rv == 0); @@ -448,34 +431,6 @@ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, v return 0; } -int dmm_stats_get(void *region, uintptr_t *start_addr, uint32_t *curr_use, uint32_t *max_use) -{ -#ifdef CONFIG_DMM_STATS - struct dmm_heap *dh; - - dh = dmm_heap_find(region); - if (dh == NULL) { - return -EINVAL; - } - - if (start_addr) { - *start_addr = dh->ptr; - } - - if (curr_use) { - *curr_use = (100 * dh->curr_use) / dh->bitarray.num_bits; - } - - if (max_use) { - *max_use = (100 * dh->max_use) / dh->bitarray.num_bits; - } - - return 0; -#else - return -ENOTSUP; -#endif -} - int dmm_init(void) { struct dmm_heap *dh; diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index 09486289aa60..ca627fbd55f4 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -163,22 +163,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 Get statistics. - * - * Must be enabled with CONFIG_DMM_STATS. - * - * @param[in] region DMM memory region. - * @param[out] start_addr Location where starting address of the memory region is set. Can be null. - * @param[out] curr_use Location where current use in percent is written. Can be null. - * @param[out] max_use Location where maximum use in percent is written. Can be null. - * - * @retval 0 on success. - * @retval -EINVAL Invalid region. - * @retval -ENOTSUP Feature is disabled. - */ -int dmm_stats_get(void *region, uintptr_t *start_addr, uint32_t *curr_use, uint32_t *max_use); - /** * @brief Initialize DMM. * @@ -226,17 +210,6 @@ static ALWAYS_INLINE int dmm_buffer_in_release(void *region, void *user_buffer, return 0; } -static ALWAYS_INLINE int dmm_stats_get(void *region, uintptr_t *start_addr, - uint32_t *curr_use, uint32_t *max_use) -{ - ARG_UNUSED(region); - ARG_UNUSED(start_addr); - ARG_UNUSED(curr_use); - ARG_UNUSED(max_use); - - return 0; -} - static ALWAYS_INLINE int dmm_init(void) { return 0; From f5e513e8a262c5c11df220e6d8920ea5d61483e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1434/3334] Revert "[nrf fromtree] tests: boards: nrf: dmm: Align test to changes in DMM" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3e669e315b2f76972e684a2f18a71885d0b432b3. Signed-off-by: Tomasz Moń --- tests/boards/nrf/dmm/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 6cfeb1372ec2..06f4ace0e608 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -28,7 +28,7 @@ #if CONFIG_DCACHE BUILD_ASSERT(DMM_ALIGN_SIZE(DUT_CACHE) == CONFIG_DCACHE_LINE_SIZE); -BUILD_ASSERT(DMM_ALIGN_SIZE(DUT_NOCACHE) == sizeof(uint32_t)); +BUILD_ASSERT(DMM_ALIGN_SIZE(DUT_NOCACHE) == 1); #endif struct dmm_test_region { From f35ef26c22556985816f4d9d327230818454ce46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1435/3334] Revert "[nrf fromtree] soc: nordic: common: dmm: Optimize by using a micro heap" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fb1f6b0dc1103bf6789b95542dae9d9aa1e5c90a. Signed-off-by: Tomasz Moń --- soc/nordic/common/Kconfig | 14 ---- soc/nordic/common/dmm.c | 164 +++++--------------------------------- 2 files changed, 21 insertions(+), 157 deletions(-) diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index b3a8f13089db..782d9452b677 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -48,19 +48,5 @@ source "subsys/logging/Kconfig.template.log_config" endif # MRAM_LATENCY -if HAS_NORDIC_DMM - -config DMM_HEAP_CHUNKS - int "Number of chunks in the DMM heap" - default 32 - help - DMM is using a simplified heap which is using 32 bit mask to allocate - required buffer which consists of contiguous chunks. If there are many - small buffers used with DMM it is possible that allocation will fail. - Number of chunks is a trade-off between performance and granularity. - Must be multiply of 32. - -endif # HAS_NORDIC_DMM - rsource "vpr/Kconfig" rsource "uicr/Kconfig" diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index 411b8be14a75..78b43e7a4b98 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include "dmm.h" @@ -26,9 +26,6 @@ .dt_align = DMM_REG_ALIGN_SIZE(node_id), \ .dt_allc = &_BUILD_LINKER_END_VAR(node_id)}, -#define HEAP_NUM_WORDS (CONFIG_DMM_HEAP_CHUNKS / 32) -BUILD_ASSERT(IS_ALIGNED(CONFIG_DMM_HEAP_CHUNKS, 32)); - /* 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. @@ -45,13 +42,9 @@ struct dmm_region { }; struct dmm_heap { - uint32_t mask[HEAP_NUM_WORDS]; - atomic_t tail_mask[HEAP_NUM_WORDS]; - uintptr_t ptr; - uintptr_t ptr_end; - size_t blk_size; + struct sys_heap heap; const struct dmm_region *region; - sys_bitarray_t bitarray; + struct k_spinlock lock; }; static const struct dmm_region dmm_regions[] = { @@ -62,6 +55,7 @@ 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; @@ -109,144 +103,37 @@ static bool is_user_buffer_correctly_preallocated(void const *user_buffer, size_ return false; } -/* Function updates the tail bits mask after the allocation. Tail bits are all bits - * except the head. Tail bits mask together with a known index of the start of - * chunk (because freeing has a buffer address) allows to determine the size of the - * buffer (how many chunks were included. Because tail_mask is updated after allocation - * we can safely modify bits that represents allocated buffer, we only need to use - * atomic operation on the mask since mask may be modified (but different bits). - */ -static void tail_mask_set(atomic_t *tail_mask, size_t num_bits, size_t off) +static size_t dmm_heap_start_get(struct dmm_heap *dh) { - size_t tail_bits = num_bits - 1; - size_t tail_off = off + 1; - - if (tail_bits == 0) { - return; - } - - if (HEAP_NUM_WORDS == 1) { - atomic_or(tail_mask, BIT_MASK(tail_bits) << tail_off); - return; - } - - /* If bit mask exceeds a single word then tail may spill to the adjacent word. */ - size_t idx = tail_off / 32; - - tail_off = tail_off - 32 * idx; - if ((tail_off + tail_bits) <= 32) { - /* Tail mask fits in a single word. */ - atomic_or(&tail_mask[idx], BIT_MASK(tail_bits) << tail_off); - return; - } - - /* Tail spilled. Remainder is set in the next word. Since number of tail_masks - * match number of words in bitarray we don't need to check if we are exceeding - * the array boundary. - */ - atomic_or(&tail_mask[idx], BIT_MASK(32 - tail_off) << tail_off); - - - size_t rem_tail = tail_bits - (32 - tail_off); - atomic_t *mask = &tail_mask[idx + 1]; - - while (rem_tail >= 32) { - atomic_or(mask, UINT32_MAX); - mask++; - rem_tail -= 32; - } - atomic_or(mask, BIT_MASK(rem_tail)); + return ROUND_UP(dh->region->dt_allc, dh->region->dt_align); } -/* Function determines how many chunks were used for the allocated buffer. It is - * determined from tail bits mask and index of the starting chunk (%p off). - * Function is called before bits are freed in the bitarray so we can safely modify - * bits that belong to that buffer. - * - * @param tail_mask Pointer to tail_mask array. - * @param off Index of the start of the buffer. - * - * @return Number of chunks that forms the buffer that will be freed. - */ -static uint32_t num_bits_get(atomic_t *tail_mask, size_t off) +static size_t dmm_heap_size_get(struct dmm_heap *dh) { - uint32_t mask; - uint32_t num_bits; - - if (HEAP_NUM_WORDS == 1) { - mask = (*tail_mask | BIT(off)) >> off; - num_bits = (~mask == 0) ? 32 : __builtin_ctz(~mask); - if (num_bits > 1) { - mask = BIT_MASK(num_bits - 1) << (off + 1); - atomic_and(tail_mask, ~mask); - } - - return num_bits; - } - - /* In multiword bit array we need to check if tail is spilling over to the next word. */ - size_t idx = off / 32; - size_t w_off = off - 32 * idx; - atomic_t *t_mask = &tail_mask[idx]; - - mask = (*t_mask | BIT(w_off)) >> w_off; - num_bits = (~mask == 0) ? 32 : __builtin_ctz(~mask); - if (num_bits == 1) { - return num_bits; - } - - mask = BIT_MASK(num_bits - 1) << (w_off + 1); - atomic_and(t_mask, ~mask); - if (((w_off + num_bits) == 32) && (idx < (HEAP_NUM_WORDS - 1))) { - size_t tmp_bits; - - /* If we are at the end of the one mask we need to check the beginning of the - * next one as there might be remaining part of the tail. - */ - do { - t_mask++; - tmp_bits = (*t_mask == UINT32_MAX) ? 32 : __builtin_ctz(~(*t_mask)); - mask = (tmp_bits == 32) ? UINT32_MAX : BIT_MASK(tmp_bits); - atomic_and(t_mask, ~mask); - num_bits += tmp_bits; - } while ((tmp_bits == 32) && (t_mask != &tail_mask[HEAP_NUM_WORDS - 1])); - } - - return num_bits; + 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) { - size_t num_bits, off; - int rv; - - if (dh->ptr == 0) { - /* Not initialized. */ - return NULL; - } + void *ret; + k_spinlock_key_t key; length = ROUND_UP(length, dh->region->dt_align); - num_bits = DIV_ROUND_UP(length, dh->blk_size); - - rv = sys_bitarray_alloc(&dh->bitarray, num_bits, &off); - if (rv < 0) { - return NULL; - } - tail_mask_set(dh->tail_mask, num_bits, off); + key = k_spin_lock(&dh->lock); + ret = sys_heap_aligned_alloc(&dh->heap, dh->region->dt_align, length); + k_spin_unlock(&dh->lock, key); - return (void *)(dh->ptr + dh->blk_size * off); + return ret; } static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) { - size_t offset = ((uintptr_t)buffer - dh->ptr) / dh->blk_size; - size_t num_bits = num_bits_get(dh->tail_mask, offset); - int rv; + k_spinlock_key_t key; - rv = sys_bitarray_free(&dh->bitarray, num_bits, offset); - (void)rv; - __ASSERT_NO_MSG(rv == 0); + key = k_spin_lock(&dh->lock); + sys_heap_free(&dh->heap, buffer); + k_spin_unlock(&dh->lock, key); } static void dmm_memcpy(void *dst, const void *src, size_t len) @@ -335,7 +222,7 @@ int dmm_buffer_out_release(void *region, void *buffer_out) /* Check if output buffer is contained within memory area * managed by dynamic memory allocator */ - if (is_buffer_within_region(addr, 0, dh->ptr, dh->ptr_end)) { + 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); } @@ -422,7 +309,7 @@ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, v /* Check if input buffer is contained within memory area * managed by dynamic memory allocator */ - if (is_buffer_within_region(addr, user_length, dh->ptr, dh->ptr_end)) { + 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); } @@ -434,20 +321,11 @@ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, v int dmm_init(void) { struct dmm_heap *dh; - int blk_cnt; - int heap_space; for (size_t idx = 0; idx < ARRAY_SIZE(dmm_regions); idx++) { dh = &dmm_heaps_data.dmm_heaps[idx]; dh->region = &dmm_regions[idx]; - dh->ptr = ROUND_UP(dh->region->dt_allc, dh->region->dt_align); - heap_space = dh->region->dt_size - (dh->ptr - dh->region->dt_addr); - dh->blk_size = ROUND_UP(heap_space / (32 * HEAP_NUM_WORDS), dh->region->dt_align); - blk_cnt = heap_space / dh->blk_size; - dh->ptr_end = dh->ptr + blk_cnt * dh->blk_size; - dh->bitarray.num_bits = blk_cnt; - dh->bitarray.num_bundles = HEAP_NUM_WORDS; - dh->bitarray.bundles = dh->mask; + sys_heap_init(&dh->heap, (void *)dmm_heap_start_get(dh), dmm_heap_size_get(dh)); } return 0; From 497c855006482e8def4d0b495085210728cce8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1436/3334] Revert "[nrf fromtree] soc: nordic: common: dmm: Optimize memcpy" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6ec5bc6c31d98fa5019e52fa2b100d894d3de499. Signed-off-by: Tomasz Moń --- soc/nordic/common/dmm.c | 25 ++----------------------- soc/nordic/common/dmm.h | 4 ++-- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index 78b43e7a4b98..0b4e42f8c6de 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -136,27 +136,6 @@ static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) k_spin_unlock(&dh->lock, key); } -static void dmm_memcpy(void *dst, const void *src, size_t len) -{ -#define IS_ALIGNED32(x) IS_ALIGNED(x, sizeof(uint32_t)) -#define IS_ALIGNED64(x) IS_ALIGNED(x, sizeof(uint64_t)) - if (IS_ALIGNED64(len) && IS_ALIGNED64(dst) && IS_ALIGNED64(src)) { - for (uint32_t i = 0; i < len / sizeof(uint64_t); i++) { - ((uint64_t *)dst)[i] = ((uint64_t *)src)[i]; - } - return; - } - - if (IS_ALIGNED32(len) && IS_ALIGNED32(dst) && IS_ALIGNED32(src)) { - for (uint32_t i = 0; i < len / sizeof(uint32_t); i++) { - ((uint32_t *)dst)[i] = ((uint32_t *)src)[i]; - } - return; - } - - memcpy(dst, src, len); -} - int dmm_buffer_out_prepare(void *region, void const *user_buffer, size_t user_length, void **buffer_out) { @@ -193,7 +172,7 @@ int dmm_buffer_out_prepare(void *region, void const *user_buffer, size_t user_le return -ENOMEM; } /* - copy user buffer contents into allocated buffer */ - dmm_memcpy(*buffer_out, user_buffer, user_length); + memcpy(*buffer_out, user_buffer, user_length); } /* Check if device memory region is cacheable @@ -302,7 +281,7 @@ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, v * If no, copy allocated buffer to the user buffer */ if (buffer_in != user_buffer) { - dmm_memcpy(user_buffer, buffer_in, user_length); + memcpy(user_buffer, buffer_in, user_length); } /* If yes, no action is needed */ diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index ca627fbd55f4..34b517c92dfc 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -35,12 +35,12 @@ extern "C" { * Cache line alignment is required if region is cacheable and data cache is enabled. */ #define DMM_REG_ALIGN_SIZE(node_id) \ - (DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint32_t)) + (DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint8_t)) #else #define DMM_IS_REG_CACHEABLE(node_id) 0 -#define DMM_REG_ALIGN_SIZE(node_id) (sizeof(uint32_t)) +#define DMM_REG_ALIGN_SIZE(node_id) (sizeof(uint8_t)) #endif /* CONFIG_DCACHE */ From 08ac3c732981ae47a3461ca4d419c23d38055064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1437/3334] Revert "[nrf fromtree] tests: boards: nrf: dmm: Add timing measurements" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ef9afa4a3a9c970b22ad4928fc2d8fdf39ce104. Signed-off-by: Tomasz Moń --- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 10 -- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 10 -- tests/boards/nrf/dmm/prj.conf | 4 - tests/boards/nrf/dmm/src/main.c | 153 ++---------------- 4 files changed, 15 insertions(+), 162 deletions(-) diff --git a/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay index 48a4e8adc264..3e0b1b4d5356 100644 --- a/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - / { aliases { dut-cache = &spi1; @@ -58,7 +52,3 @@ pinctrl-1 = <&spi3_sleep_alt>; pinctrl-names = "default", "sleep"; }; - -cycle_timer: &timer1 { - status = "okay"; -}; diff --git a/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 2507dd83dfe3..e3924657b86e 100644 --- a/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -1,9 +1,3 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - / { aliases { dut-cache = &spi120; @@ -64,7 +58,3 @@ pinctrl-names = "default", "sleep"; memory-regions = <&dma_fast_region>; }; - -cycle_timer: &timer120 { - status = "okay"; -}; diff --git a/tests/boards/nrf/dmm/prj.conf b/tests/boards/nrf/dmm/prj.conf index 0b99d72b0c32..9467c2926896 100644 --- a/tests/boards/nrf/dmm/prj.conf +++ b/tests/boards/nrf/dmm/prj.conf @@ -1,5 +1 @@ CONFIG_ZTEST=y -CONFIG_ASSERT=n -CONFIG_SPIN_VALIDATE=n -CONFIG_TEST_EXTRA_STACK_SIZE=512 -CONFIG_COUNTER=y diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 06f4ace0e608..214a90697525 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -9,12 +9,9 @@ #include #include #include -#include #include -#define IS_ALIGNED64(x) IS_ALIGNED(x, sizeof(uint64_t)) - #define DUT_CACHE DT_ALIAS(dut_cache) #define DUT_NOCACHE DT_ALIAS(dut_nocache) @@ -60,49 +57,13 @@ static const struct dmm_test_region dmm_test_regions[DMM_TEST_REGION_COUNT] = { .size = DMM_TEST_GET_REG_SIZE(DUT_NOCACHE) }, }; -static const struct device *counter = DEVICE_DT_GET(DT_NODELABEL(cycle_timer)); -static uint32_t t_delta; - -static uint32_t ts_get(void) -{ - uint32_t t; - - (void)counter_get_value(counter, &t); - return t; -} - -static uint32_t ts_from_get(uint32_t from) -{ - return ts_get() - from; -} - -static uint32_t cyc_to_us(uint32_t cyc) -{ - return counter_ticks_to_us(counter, cyc); -} - -static uint32_t cyc_to_rem_ns(uint32_t cyc) -{ - uint32_t us = counter_ticks_to_us(counter, cyc); - uint32_t ns; - - cyc = cyc - counter_us_to_ticks(counter, (uint64_t)us); - ns = counter_ticks_to_us(counter, 1000 * cyc); - - return ns; -} static void *test_setup(void) { static struct dmm_fixture fixture; - uint32_t t; - counter_start(counter); - t = ts_get(); - t_delta = ts_get() - t; memcpy(fixture.regions, dmm_test_regions, sizeof(dmm_test_regions)); fixture.fill_value = 0x1; - return &fixture; } @@ -118,25 +79,13 @@ 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, bool print_report) + void *data, size_t size, bool was_prealloc, bool is_cached) { void *buf; int retval; - uint32_t t; - bool aligned; memset(data, (*fill_value)++, size); - t = ts_get(); retval = dmm_buffer_out_prepare(dtr->mem_reg, data, size, &buf); - t = ts_from_get(t); - aligned = IS_ALIGNED64(data) && IS_ALIGNED64(buf) && IS_ALIGNED64(size); - - if (print_report) { - TC_PRINT("%saligned buffer out prepare size:%d buf:%p took %d.%dus (%d cycles)\n", - aligned ? "" : "not ", size, buf, cyc_to_us(t), cyc_to_rem_ns(t), t); - } - zassert_ok(retval); if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { zassert_true(IS_ALIGNED(buf, CONFIG_DCACHE_LINE_SIZE)); @@ -155,37 +104,21 @@ static void dmm_check_output_buffer(struct dmm_test_region *dtr, uint32_t *fill_ sys_cache_data_invd_range(buf, size); zassert_mem_equal(buf, data, size); - t = ts_get(); retval = dmm_buffer_out_release(dtr->mem_reg, buf); - t = ts_from_get(t); - if (print_report) { - TC_PRINT("buffer out release buf:%p size:%d took %d.%dus (%d cycles)\n", - buf, size, cyc_to_us(t), cyc_to_rem_ns(t), t); - } 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, bool print_report) + void *data, size_t size, bool was_prealloc, bool is_cached) { void *buf; int retval; - uint32_t t; uint8_t intermediate_buf[128]; - bool aligned; - zassert_true(size <= sizeof(intermediate_buf)); + zassert_true(size < sizeof(intermediate_buf)); - t = ts_get(); retval = dmm_buffer_in_prepare(dtr->mem_reg, data, size, &buf); - t = ts_from_get(t); - aligned = IS_ALIGNED64(data) && IS_ALIGNED64(buf) && IS_ALIGNED64(size); zassert_ok(retval); - if (print_report) { - TC_PRINT("%saligned buffer in prepare buf:%p size:%d took %d.%dus (%d cycles)\n", - aligned ? "" : "not ", buf, size, cyc_to_us(t), cyc_to_rem_ns(t), t); - } if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { zassert_true(IS_ALIGNED(buf, CONFIG_DCACHE_LINE_SIZE)); } @@ -211,13 +144,7 @@ static void dmm_check_input_buffer(struct dmm_test_region *dtr, uint32_t *fill_v memset(buf, (*fill_value)++, size); } - t = ts_get(); retval = dmm_buffer_in_release(dtr->mem_reg, data, size, buf); - t = ts_from_get(t); - if (print_report) { - TC_PRINT("buffer in release buf:%p size:%d took %d.%dus (%d cycles)\n", - buf, size, cyc_to_us(t), cyc_to_rem_ns(t), t); - } zassert_ok(retval); zassert_mem_equal(data, intermediate_buf, size); @@ -225,14 +152,10 @@ static void dmm_check_input_buffer(struct dmm_test_region *dtr, uint32_t *fill_v ZTEST_USER_F(dmm, test_check_dev_cache_in_allocate) { - uint8_t user_data[128] __aligned(sizeof(uint64_t)); + uint8_t user_data[16]; dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, 16, false, true, false); - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, 16, false, true, true); - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, true, true); + user_data, sizeof(user_data), false, true); } ZTEST_USER_F(dmm, test_check_dev_cache_in_preallocate) @@ -240,30 +163,15 @@ 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, true); + user_data, sizeof(user_data), true, true); } ZTEST_USER_F(dmm, test_check_dev_cache_out_allocate) { - uint8_t user_data[129] __aligned(sizeof(uint64_t)); - - /* First run to get code into ICACHE so that following runs has consistent timing. */ - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, 16, false, true, false); + uint8_t user_data[16]; - /* Aligned user buffer. */ - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, 16, false, true, true); - /* Unaligned user buffer. */ dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - &user_data[1], 16, false, true, true); - - /* Aligned user buffer. */ - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data) - 1, false, true, true); - /* Unaligned user buffer. */ - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - &user_data[1], sizeof(user_data) - 1, false, true, true); + user_data, sizeof(user_data), false, true); } ZTEST_USER_F(dmm, test_check_dev_cache_out_preallocate) @@ -271,31 +179,15 @@ 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, true); + user_data, sizeof(user_data), true, true); } ZTEST_USER_F(dmm, test_check_dev_nocache_in_allocate) { - uint8_t user_data[129] __aligned(sizeof(uint64_t)); - - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, 16, false, false, false); - - /* Aligned user buffer. */ - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, 16, false, false, true); - - /* Unaligned user buffer. */ - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - &user_data[1], 16, false, false, true); + uint8_t user_data[16]; - /* Aligned user buffer. */ dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data) - 1, false, false, true); - - /* Unaligned user buffer. */ - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - &user_data[1], sizeof(user_data) - 1, false, false, true); + user_data, sizeof(user_data), false, false); } ZTEST_USER_F(dmm, test_check_dev_nocache_in_preallocate) @@ -303,30 +195,15 @@ 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, true); + user_data, sizeof(user_data), true, false); } ZTEST_USER_F(dmm, test_check_dev_nocache_out_allocate) { - uint8_t user_data[129] __aligned(sizeof(uint64_t)); + uint8_t user_data[16]; - /* First run to get code into ICACHE so that following results are consistent. */ - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, 16, false, false, false); - - /* Aligned user buffer. */ - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, 16, false, false, true); - /* Unaligned user buffer. */ - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - &user_data[1], 16, false, false, true); - - /* Aligned user buffer. */ - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data) - 1, false, false, true); - /* Unaligned user buffer. */ dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - &user_data[1], sizeof(user_data) - 1, false, false, true); + user_data, sizeof(user_data), false, false); } ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) @@ -334,7 +211,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, true); + user_data, sizeof(user_data), true, false); } ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); From 87d1e89ba324c233f8864947810f7034497b86ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1438/3334] Revert "[nrf fromlist] drivers: timer: nrf_grtc: Move GRTC initialization to early init" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 63534249c4e791a170f4da1b455b220ef03d6cdd. Signed-off-by: Tomasz Moń --- drivers/timer/nrf_grtc_timer.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 75278e104bd2..df59b9f6d4b6 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -517,11 +517,6 @@ static int sys_clock_driver_init(void) system_timeout_set_relative(CYC_PER_TICK); } - return 0; -} - -static int grtc_post_init(void) -{ #if defined(CONFIG_CLOCK_CONTROL_NRF) static const enum nrf_lfclk_start_mode mode = IS_ENABLED(CONFIG_SYSTEM_CLOCK_NO_WAIT) @@ -595,6 +590,5 @@ int nrf_grtc_timer_clock_driver_init(void) return sys_clock_driver_init(); } #else -SYS_INIT(sys_clock_driver_init, EARLY, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); -SYS_INIT(grtc_post_init, PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); +SYS_INIT(sys_clock_driver_init, PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY); #endif From f51e4fca059f32b1a9ad7c50282992e229a04838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1439/3334] Revert "[nrf fromtree] requirements: update spsdk version" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit deb247470c1534a460d543ebe9f42230ff49dcd5. Signed-off-by: Tomasz Moń --- scripts/requirements-extras.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/requirements-extras.txt b/scripts/requirements-extras.txt index 2d7a51cf29ab..b7a93427d725 100644 --- a/scripts/requirements-extras.txt +++ b/scripts/requirements-extras.txt @@ -19,7 +19,7 @@ junit2html lpc_checksum # used by NXP platform to generate/flash firmware images -spsdk >= 3.0.0 +spsdk == 2.6.0 # used by scripts/build/gen_cfb_font_header.py - helper script for user Pillow>=10.3.0 From 536771ea3fa8aa4406119bb92b417d84a30ada0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1440/3334] Revert "[nrf fromtree] scripts: dts: fix CMake DT API helper for compatible properties" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 03d989c8508743fa006d05f84a0a82f46b5b3940. Signed-off-by: Tomasz Moń --- scripts/dts/gen_dts_cmake.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/dts/gen_dts_cmake.py b/scripts/dts/gen_dts_cmake.py index a8a2c3df611f..5dd4a8779d32 100755 --- a/scripts/dts/gen_dts_cmake.py +++ b/scripts/dts/gen_dts_cmake.py @@ -134,8 +134,10 @@ def main(): cmake_prop = f'DT_PROP|{node.path}|{item}' cmake_props.append(f'"{cmake_prop}" "{escape(cmake_value)}"') - for comp in node.compats: - compatible2paths[comp].append(node.path) + if item == 'compatible': + # compatibles is always an array + for comp in node.props[item].val: + compatible2paths[comp].append(node.path) if node.regs is not None: cmake_props.append(f'"DT_REG|{node.path}|NUM" "{len(node.regs)}"') From f06d44a62d64975d50fc14039790144daf4711c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:02 +0100 Subject: [PATCH 1441/3334] Revert "[nrf fromtree] scripts: compliance: Add basic cmake style checks" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a8c9ce6a9ebbe422a5967c60148c979ab26dea5. Signed-off-by: Tomasz Moń --- scripts/ci/check_compliance.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 9ea01ed3b610..540744d7e122 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1659,34 +1659,6 @@ def filter_py(root, fnames): mime=True) == "text/x-python")] -class CMakeStyle(ComplianceTest): - """ - Checks cmake style added/modified files - """ - name = "CMakeStyle" - doc = "See https://docs.zephyrproject.org/latest/contribute/style/cmake.html for more details." - - def run(self): - # Loop through added/modified files - for fname in get_files(filter="d"): - if fname.endswith(".cmake") or fname == "CMakeLists.txt": - self.check_style(fname) - - def check_style(self, fname): - SPACE_BEFORE_OPEN_BRACKETS_CHECK = re.compile(r"^\s*if\s+\(") - TAB_INDENTATION_CHECK = re.compile(r"^\t+") - - with open(fname, encoding="utf-8") as f: - for line_num, line in enumerate(f.readlines(), start=1): - if TAB_INDENTATION_CHECK.match(line): - self.fmtd_failure("error", "CMakeStyle", fname, line_num, - "Use spaces instead of tabs for indentation") - - if SPACE_BEFORE_OPEN_BRACKETS_CHECK.match(line): - self.fmtd_failure("error", "CMakeStyle", fname, line_num, - "Remove space before '(' in if() statements") - - class Identity(ComplianceTest): """ Checks if Emails of author and signed-off messages are consistent. From ee94806816a6e858ddac43e68f420d95621ad8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1442/3334] Revert "[nrf fromtree] drivers: mspi_dw: Fix race condition in RX interrupt handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ccc65921c1ea461da98a1ee5da2f7f9675f49071. Signed-off-by: Tomasz Moń --- drivers/mspi/mspi_dw.c | 48 ++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index f7be2e33c9e5..f2ad49759e07 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -250,12 +250,9 @@ static bool read_rx_fifo(const struct device *dev, uint8_t *buf_pos = dev_data->buf_pos; const uint8_t *buf_end = &packet->data_buf[packet->num_bytes]; uint8_t bytes_per_frame_exp = dev_data->bytes_per_frame_exp; + /* See `room` in tx_data(). */ + uint32_t in_fifo = 1; uint32_t remaining_frames; - uint32_t in_fifo = FIELD_GET(RXFLR_RXTFL_MASK, read_rxflr(dev)); - - if (in_fifo == 0) { - return false; - } do { uint32_t data = read_dr(dev); @@ -330,37 +327,28 @@ static void handle_fifos(const struct device *dev) } } else { for (;;) { - /* Always read everything from the RX FIFO, regardless - * of the interrupt status. - * tx_dummy_bytes() subtracts the number of items that - * are present in the RX FIFO from the number of dummy - * bytes it is allowed to send, so it can potentially - * not fill the TX FIFO above its transfer start level - * in some iteration of this loop. If in such case the - * interrupt handler exited without emptying the RX FIFO - * (seeing the RXFIS flag not set due to not enough - * items in the RX FIFO), this could lead to a situation - * in which a transfer stopped temporarily (after the TX - * FIFO got empty) is not resumed (since the TX FIFO is - * not filled above its transfer start level), so no - * further dummy bytes are transmitted and the RX FIFO - * has no chance to get new entries, hence no further - * interrupts are generated and the transfer gets stuck. - */ - if (read_rx_fifo(dev, packet)) { - finished = true; - break; - } - /* Use RISR, not ISR, because when this function is * executed through the system workqueue, all interrupts * are masked (IMR is 0). */ uint32_t int_status = read_risr(dev); - if (int_status & RISR_RXOIR_BIT) { - finished = true; - break; + if (int_status & RISR_RXFIR_BIT) { + if (read_rx_fifo(dev, packet)) { + finished = true; + break; + } + + if (int_status & RISR_RXOIR_BIT) { + finished = true; + break; + } + + /* Refresh interrupt status, as during reading + * from the RX FIFO, the TX FIFO status might + * have changed. + */ + int_status = read_risr(dev); } if (dev_data->dummy_bytes == 0 || From 85595a64112049d193d3576429ff747cfc843f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1443/3334] Revert "[nrf fromtree] tests: mspi: flash: Add scenario for non-multithreading flash_mspi_nor" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9ba6595f2ddb0fc19872cfba747409e54d9a3974. Signed-off-by: Tomasz Moń --- tests/drivers/mspi/flash/testcase.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/drivers/mspi/flash/testcase.yaml b/tests/drivers/mspi/flash/testcase.yaml index ae1db5d4d6d2..dba610a40235 100644 --- a/tests/drivers/mspi/flash/testcase.yaml +++ b/tests/drivers/mspi/flash/testcase.yaml @@ -36,9 +36,3 @@ tests: - nrf54h20dk/nrf54h20/cpuapp extra_configs: - CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE=y - drivers.mspi.flash.mspi_nor_no_multithreading: - filter: dt_alias_exists("mspi0") and CONFIG_FLASH_MSPI_NOR - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - extra_configs: - - CONFIG_MULTITHREADING=n From 65406eeb1aeb1b3fce7f20d1cce4886e818ffbd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1444/3334] Revert "[nrf fromtree] drivers: flash_mspi_nor: Add support for CONFIG_MULTITHREADING=n" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4ac833b3d121021b8fe00d7c4429f83f9691c29f. Signed-off-by: Tomasz Moń --- drivers/flash/flash_mspi_nor.c | 12 +----------- drivers/flash/flash_mspi_nor.h | 2 -- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/flash/flash_mspi_nor.c b/drivers/flash/flash_mspi_nor.c index 03430401de0c..a634b3d9118b 100644 --- a/drivers/flash/flash_mspi_nor.c +++ b/drivers/flash/flash_mspi_nor.c @@ -237,9 +237,7 @@ static int acquire(const struct device *dev) struct flash_mspi_nor_data *dev_data = dev->data; int rc; -#if defined(CONFIG_MULTITHREADING) k_sem_take(&dev_data->acquired, K_FOREVER); -#endif rc = pm_device_runtime_get(dev_config->bus); if (rc < 0) { @@ -271,27 +269,21 @@ static int acquire(const struct device *dev) (void)pm_device_runtime_put(dev_config->bus); } -#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->acquired); -#endif - return rc; } static void release(const struct device *dev) { const struct flash_mspi_nor_config *dev_config = dev->config; + struct flash_mspi_nor_data *dev_data = dev->data; /* This releases the MSPI controller. */ (void)mspi_get_channel_status(dev_config->bus, 0); (void)pm_device_runtime_put(dev_config->bus); -#if defined(CONFIG_MULTITHREADING) - struct flash_mspi_nor_data *dev_data = dev->data; - k_sem_give(&dev_data->acquired); -#endif } static inline uint32_t dev_flash_size(const struct device *dev) @@ -1223,9 +1215,7 @@ static int drv_init(const struct device *dev) } } -#if defined(CONFIG_MULTITHREADING) k_sem_init(&dev_data->acquired, 1, K_SEM_MAX_LIMIT); -#endif return pm_device_driver_init(dev, dev_pm_action_cb); } diff --git a/drivers/flash/flash_mspi_nor.h b/drivers/flash/flash_mspi_nor.h index 86c824cf4856..480bccce4729 100644 --- a/drivers/flash/flash_mspi_nor.h +++ b/drivers/flash/flash_mspi_nor.h @@ -104,9 +104,7 @@ struct flash_mspi_nor_config { }; struct flash_mspi_nor_data { -#if defined(CONFIG_MULTITHREADING) struct k_sem acquired; -#endif struct mspi_xfer_packet packet; struct mspi_xfer xfer; struct jesd216_erase_type erase_types[JESD216_NUM_ERASE_TYPES]; From 6c43db4bc3bd0653f82f604118bdae9e914557bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1445/3334] Revert "[nrf fromtree] drivers: mspi_dw: Add support for CONFIG_MULTITHREADING=n" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b01b8f6124a90ea8d6887db7803c87c49e1566c2. Signed-off-by: Tomasz Moń --- drivers/mspi/mspi_dw.c | 62 ++---------------------------------------- 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index f2ad49759e07..f1195314c6c2 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -65,16 +65,11 @@ struct mspi_dw_data { bool standard_spi; bool suspended; -#if defined(CONFIG_MULTITHREADING) struct k_sem finished; /* For synchronization of API calls made from different contexts. */ struct k_sem ctx_lock; /* For locking of controller configuration. */ struct k_sem cfg_lock; -#else - volatile bool finished; - bool cfg_lock; -#endif struct mspi_xfer xfer; #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) @@ -369,11 +364,7 @@ static void handle_fifos(const struct device *dev) if (finished) { set_imr(dev, 0); -#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->finished); -#else - dev_data->finished = true; -#endif } } @@ -825,17 +816,8 @@ static int api_dev_config(const struct device *dev, int rc; if (dev_id != dev_data->dev_id) { -#if defined(CONFIG_MULTITHREADING) rc = k_sem_take(&dev_data->cfg_lock, K_MSEC(CONFIG_MSPI_COMPLETION_TIMEOUT_TOLERANCE)); -#else - if (dev_data->cfg_lock) { - rc = -1; - } else { - dev_data->cfg_lock = true; - rc = 0; - } -#endif if (rc < 0) { LOG_ERR("Failed to switch controller to device"); return -EBUSY; @@ -849,23 +831,15 @@ static int api_dev_config(const struct device *dev, return 0; } -#if defined(CONFIG_MULTITHREADING) (void)k_sem_take(&dev_data->ctx_lock, K_FOREVER); -#endif rc = _api_dev_config(dev, param_mask, cfg); -#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->ctx_lock); -#endif if (rc < 0) { dev_data->dev_id = NULL; -#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->cfg_lock); -#else - dev_data->cfg_lock = false; -#endif } return rc; @@ -877,17 +851,12 @@ static int api_get_channel_status(const struct device *dev, uint8_t ch) struct mspi_dw_data *dev_data = dev->data; -#if defined(CONFIG_MULTITHREADING) (void)k_sem_take(&dev_data->ctx_lock, K_FOREVER); -#endif dev_data->dev_id = NULL; -#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->cfg_lock); + k_sem_give(&dev_data->ctx_lock); -#else - dev_data->cfg_lock = false; -#endif return 0; } @@ -1150,17 +1119,7 @@ static int start_next_packet(const struct device *dev, k_timeout_t timeout) /* Write SER to start transfer */ write_ser(dev, BIT(dev_data->dev_id->dev_idx)); -#if defined(CONFIG_MULTITHREADING) rc = k_sem_take(&dev_data->finished, timeout); -#else - if (!WAIT_FOR(dev_data->finished, - dev_data->xfer.timeout * USEC_PER_MSEC, - NULL)) { - rc = -ETIMEDOUT; - } - - dev_data->finished = false; -#endif if (read_risr(dev) & RISR_RXOIR_BIT) { LOG_ERR("RX FIFO overflow occurred"); rc = -EIO; @@ -1273,9 +1232,7 @@ static int api_transceive(const struct device *dev, return rc; } -#if defined(CONFIG_MULTITHREADING) (void)k_sem_take(&dev_data->ctx_lock, K_FOREVER); -#endif if (dev_data->suspended) { rc = -EFAULT; @@ -1283,9 +1240,7 @@ static int api_transceive(const struct device *dev, rc = _api_transceive(dev, req); } -#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->ctx_lock); -#endif rc2 = pm_device_runtime_put(dev); if (rc2 < 0) { @@ -1436,9 +1391,7 @@ static int api_xip_config(const struct device *dev, return rc; } -#if defined(CONFIG_MULTITHREADING) (void)k_sem_take(&dev_data->ctx_lock, K_FOREVER); -#endif if (dev_data->suspended) { rc = -EFAULT; @@ -1446,9 +1399,7 @@ static int api_xip_config(const struct device *dev, rc = _api_xip_config(dev, dev_id, cfg); } -#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->ctx_lock); -#endif rc2 = pm_device_runtime_put(dev); if (rc2 < 0) { @@ -1499,12 +1450,8 @@ static int dev_pm_action_cb(const struct device *dev, return rc; } #endif -#if defined(CONFIG_MULTITHREADING) if (xip_enabled || k_sem_take(&dev_data->ctx_lock, K_NO_WAIT) != 0) { -#else - if (xip_enabled) { -#endif LOG_ERR("Controller in use, cannot be suspended"); return -EBUSY; } @@ -1513,9 +1460,7 @@ static int dev_pm_action_cb(const struct device *dev, vendor_specific_suspend(dev); -#if defined(CONFIG_MULTITHREADING) k_sem_give(&dev_data->ctx_lock); -#endif return 0; } @@ -1525,6 +1470,7 @@ static int dev_pm_action_cb(const struct device *dev, static int dev_init(const struct device *dev) { + struct mspi_dw_data *dev_data = dev->data; const struct mspi_dw_config *dev_config = dev->config; const struct gpio_dt_spec *ce_gpio; int rc; @@ -1535,13 +1481,9 @@ static int dev_init(const struct device *dev) dev_config->irq_config(); -#if defined(CONFIG_MULTITHREADING) - struct mspi_dw_data *dev_data = dev->data; - k_sem_init(&dev_data->finished, 0, 1); k_sem_init(&dev_data->cfg_lock, 1, 1); k_sem_init(&dev_data->ctx_lock, 1, 1); -#endif #if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) dev_data->dev = dev; From 19dac706245a0041708b640beb34aa1bdd191f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1446/3334] Revert "[nrf fromtree] drivers: power_domain: nrfs_gdpwr: depend on multithreading" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d761a46e0fc856ba1a501ec6ce5d5ade651d6de7. Signed-off-by: Tomasz Moń --- drivers/power_domain/Kconfig.nrfs_gdpwr | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/power_domain/Kconfig.nrfs_gdpwr b/drivers/power_domain/Kconfig.nrfs_gdpwr index c5f05d88a7ee..bf9abd59aedb 100644 --- a/drivers/power_domain/Kconfig.nrfs_gdpwr +++ b/drivers/power_domain/Kconfig.nrfs_gdpwr @@ -4,7 +4,6 @@ config POWER_DOMAIN_NRFS_GDPWR bool "NRFS Global Domain Power Request driver" depends on DT_HAS_NORDIC_NRFS_GDPWR_ENABLED - depends on MULTITHREADING select NRFS select NRFS_GDPWR_SERVICE_ENABLED default y From b0b5a17b9dad10f2064999cbe3bd6eff87730a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1447/3334] Revert "[nrf fromtree] boards: nordic: nrf54h20dk: fix flashing for xip variants" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 69a06afb081131f32311a2ea2ecb8fc0be9e9a25. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/board.yml | 40 ------------------------------ 1 file changed, 40 deletions(-) diff --git a/boards/nordic/nrf54h20dk/board.yml b/boards/nordic/nrf54h20dk/board.yml index 1a505729f99c..2d3d40c20e0b 100644 --- a/boards/nordic/nrf54h20dk/board.yml +++ b/boards/nordic/nrf54h20dk/board.yml @@ -14,43 +14,3 @@ board: default: "0.9.0" revisions: - name: "0.9.0" -runners: - run_once: - '--recover': - - runners: - - nrfutil - run: first - groups: - - boards: - - nrf54h20dk@0.9.0/nrf54h20/cpuapp - - nrf54h20dk@0.9.0/nrf54h20/cpurad - - nrf54h20dk@0.9.0/nrf54h20/cpuppr - - nrf54h20dk@0.9.0/nrf54h20/cpuppr/xip - - nrf54h20dk@0.9.0/nrf54h20/cpuflpr - - nrf54h20dk@0.9.0/nrf54h20/cpuflpr/xip - '--erase': - - runners: - - jlink - - nrfutil - run: first - groups: - - boards: - - nrf54h20dk@0.9.0/nrf54h20/cpuapp - - nrf54h20dk@0.9.0/nrf54h20/cpurad - - nrf54h20dk@0.9.0/nrf54h20/cpuppr - - nrf54h20dk@0.9.0/nrf54h20/cpuppr/xip - - nrf54h20dk@0.9.0/nrf54h20/cpuflpr - - nrf54h20dk@0.9.0/nrf54h20/cpuflpr/xip - '--reset': - - runners: - - jlink - - nrfutil - run: last - groups: - - boards: - - nrf54h20dk@0.9.0/nrf54h20/cpuapp - - nrf54h20dk@0.9.0/nrf54h20/cpurad - - nrf54h20dk@0.9.0/nrf54h20/cpuppr - - nrf54h20dk@0.9.0/nrf54h20/cpuppr/xip - - nrf54h20dk@0.9.0/nrf54h20/cpuflpr - - nrf54h20dk@0.9.0/nrf54h20/cpuflpr/xip From b910879425a977d3af4b7374e3089a6d4844440f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1448/3334] Revert "[nrf fromtree] boards: nordic: nrf54h20dk: Add SPI to supported features on PPR XIP" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ac35ccd7e72b3532a049a2d15424b7c1a788bd5. Signed-off-by: Tomasz Moń --- .../nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml index 58c6473538d9..7198a379a9c9 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr_xip_0_9_0.yaml @@ -12,4 +12,3 @@ ram: 62 flash: 64 supported: - gpio - - spi From ed32303e61577b4ae04cdf635a629569496d9a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1449/3334] Revert "[nrf fromtree] tests: drivers: spi: spi_error_cases: Extend platform_allow list" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 00f71047ce5b0de51a2ec1fc6fcf002d745beef2. Signed-off-by: Tomasz Moń --- tests/drivers/spi/spi_error_cases/testcase.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/drivers/spi/spi_error_cases/testcase.yaml b/tests/drivers/spi/spi_error_cases/testcase.yaml index eb3f4c78c580..9ad509baddb0 100644 --- a/tests/drivers/spi/spi_error_cases/testcase.yaml +++ b/tests/drivers/spi/spi_error_cases/testcase.yaml @@ -11,10 +11,8 @@ tests: drivers.spi.spi_error_cases: platform_allow: - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 716593e3601244570a2789f763effde8aef6862a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1450/3334] Revert "[nrf fromtree] tests: drivers: spi: spi_loopback: Run test on nrf54h20 PPR XIP" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3572b3590d27dc99b022ca2cf6650dfe661074ca. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 11 +++++++++++ .../boards/nrf54h20dk_nrf54h20_cpuppr.conf | 1 + ...xip.overlay => nrf54h20dk_nrf54h20_cpuppr.overlay} | 2 +- .../boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf | 2 -- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf rename tests/drivers/spi/spi_loopback/boards/{nrf54h20dk_nrf54h20_cpuppr_xip.overlay => nrf54h20dk_nrf54h20_cpuppr.overlay} (66%) delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index aa5dc30239ce..17c2909717f2 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -7,4 +7,15 @@ &spi130 { memory-regions = <&cpuapp_dma_region>; + zephyr,pm-device-runtime-auto; + slow@0 { + compatible = "test-spi-loopback-slow"; + reg = <0>; + spi-max-frequency = ; + }; + fast@0 { + compatible = "test-spi-loopback-fast"; + reg = <0>; + spi-max-frequency = ; + }; }; diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf new file mode 100644 index 000000000000..af7d7e938e0f --- /dev/null +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf @@ -0,0 +1 @@ +CONFIG_SPI_LARGE_BUFFER_SIZE=1024 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay similarity index 66% rename from tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay rename to tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay index 76ebe3410375..cea31612851b 100644 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.overlay +++ b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf deleted file mode 100644 index 250de8d4487a..000000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_SPI_LARGE_BUFFER_SIZE=1024 -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15 From 2582eee57a4c871bb42d58153a85f117235a6230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1451/3334] Revert "[nrf fromtree] boards: Add secondary_app_partition alias" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ed6f047a646e148a4f7fc0a6efa1c609acabaa5f. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 4 +--- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index e587bc8b4d99..ba22403a9acd 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -18,7 +18,7 @@ chosen { zephyr,console = &uart136; - zephyr,code-partition = &cpuapp_slot0_partition; + zephyr,code-partition = &slot0_partition; zephyr,flash = &mram1x; zephyr,sram = &cpuapp_data; zephyr,shell-uart = &uart136; @@ -187,8 +187,6 @@ slot0_partition: &cpuapp_slot0_partition { label = "image-0"; }; -secondary_app_partition: &cpuapp_slot1_partition {}; - slot1_partition: &cpuapp_slot1_partition { label = "image-1"; }; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 487df83f3bbf..5473d9a7405a 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -85,8 +85,6 @@ slot0_partition: &cpurad_slot0_partition { label = "image-0"; }; -secondary_app_partition: &cpurad_slot1_partition {}; - slot1_partition: &cpurad_slot1_partition { label = "image-1"; }; From 949aa6483c15678090975aae7ed1038745b283d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1452/3334] Revert "[nrf fromtree] tests: drivers: flash: Test newly introduced MSPI driver features" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2ee3f42a321194f1743ea7227544ab2c5d6e2f92. Signed-off-by: Tomasz Moń --- .../common/boards/mx25uw63_low_freq.overlay | 10 --- .../mx25uw63_single_io_4B_addr_sreset.overlay | 64 ------------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 11 ---- tests/drivers/flash/common/src/main.c | 17 ----- tests/drivers/flash/common/testcase.yaml | 10 --- 5 files changed, 112 deletions(-) delete mode 100644 tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay delete mode 100644 tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay diff --git a/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay b/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay deleted file mode 100644 index 950005eaf5c2..000000000000 --- a/tests/drivers/flash/common/boards/mx25uw63_low_freq.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25uw63 { - status = "okay"; - mspi-max-frequency = ; -}; diff --git a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay b/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay deleted file mode 100644 index 587d68546561..000000000000 --- a/tests/drivers/flash/common/boards/mx25uw63_single_io_4B_addr_sreset.overlay +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - - /delete-node/ exmif_default; - /delete-node/ exmif_sleep; - - exmif_default: exmif_default { - group1 { - psels = , - , - , - , - , - , - , - , - , - ; - nordic,drive-mode = ; - }; - }; - - exmif_sleep: exmif_sleep { - group1 { - low-power-enable; - psels = , - , - , - , - , - , - , - , - , - ; - }; - }; - -}; - -&gpio6 { - status = "okay"; -}; - -&exmif { - status = "okay"; - pinctrl-0 = <&exmif_default>; - pinctrl-1 = <&exmif_sleep>; - pinctrl-names = "default", "sleep"; - ce-gpios = <&gpio6 3 GPIO_ACTIVE_LOW>; -}; - -&mx25uw63 { - status = "okay"; - mspi-max-frequency = ; - mspi-io-mode = "MSPI_IO_MODE_SINGLE"; - use-4byte-addressing; - initial-soft-reset; -}; diff --git a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 5272bb8fdde3..22c24c32f6d8 100644 --- a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,16 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/ { - zephyr,user { - test-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio0 { - status = "okay"; -}; - &gpio6 { status = "okay"; zephyr,pm-device-runtime-auto; @@ -26,5 +16,4 @@ &mx25uw63 { status = "okay"; - supply-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; }; diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index b629c39ebc51..337876a9e8d7 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -9,7 +9,6 @@ #include #include #include -#include #if defined(CONFIG_NORDIC_QSPI_NOR) #define TEST_AREA_DEV_NODE DT_INST(0, nordic_qspi_nor) @@ -328,22 +327,6 @@ ZTEST(flash_driver, test_flash_erase) zassert_not_equal(expected[0], erase_value, "These values shall be different"); } -ZTEST(flash_driver, test_supply_gpios_control) -{ - if (!DT_NODE_HAS_PROP(TEST_AREA_DEV_NODE, supply_gpios)) { - ztest_test_skip(); - } - -#if DT_NODE_HAS_PROP(DT_PATH(zephyr_user), test_gpios) - const struct gpio_dt_spec test_gpio = - GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), test_gpios); - zassert_true(gpio_is_ready_dt(&test_gpio), "Test GPIO is not ready\n"); - zassert_ok(gpio_pin_configure_dt(&test_gpio, GPIO_INPUT | GPIO_PULL_DOWN), - "Failed to configure test pin\n"); - zassert_equal(gpio_pin_get(test_gpio.port, test_gpio.pin), 1, "Supply GPIO is not set\n"); -#endif -} - struct test_cb_data_type { uint32_t page_counter; /* used to count how many pages was iterated */ uint32_t exit_page; /* terminate iteration when this page is reached */ diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 6f59f3799c5a..34123ffde77f 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -182,13 +182,3 @@ tests: extra_args: - DTC_OVERLAY_FILE="./boards/${BOARD}_qspi_nor.overlay" - CONF_FILE="./prj.conf ./boards/${BOARD}_qspi_nor.conf" - drivers.flash.common.mspi_single_io.4B_addr_soft_reset: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - extra_args: - - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_single_io_4B_addr_sreset.overlay - drivers.flash.common.mspi_low_frequency: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - extra_args: - - EXTRA_DTC_OVERLAY_FILE=boards/mx25uw63_low_freq.overlay From 7ecd342562f945f6122e77aaa54b4321e066b3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1453/3334] Revert "[nrf fromlist] drivers: pinctrl: nrf: use HAL defines" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc062c260f250aaa37ec1423da4bcb69dbaa874b. Signed-off-by: Tomasz Moń --- drivers/pinctrl/pinctrl_nrf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 1dfb6cb7c720..bbcaea06435f 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -15,7 +15,7 @@ BUILD_ASSERT(((NRF_PULL_NONE == NRF_GPIO_PIN_NOPULL) && (NRF_PULL_UP == NRF_GPIO_PIN_PULLUP)), "nRF pinctrl pull settings do not match HAL values"); -#if NRF_GPIO_HAS_DRIVE_EXTRA +#if defined(GPIO_PIN_CNF_DRIVE_E0E1) || defined(GPIO_PIN_CNF_DRIVE0_E0) #define NRF_DRIVE_COUNT (NRF_DRIVE_E0E1 + 1) #else #define NRF_DRIVE_COUNT (NRF_DRIVE_H0D1 + 1) @@ -29,7 +29,7 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = { [NRF_DRIVE_D0H1] = NRF_GPIO_PIN_D0H1, [NRF_DRIVE_S0D1] = NRF_GPIO_PIN_S0D1, [NRF_DRIVE_H0D1] = NRF_GPIO_PIN_H0D1, -#if NRF_GPIO_HAS_DRIVE_EXTRA +#if defined(GPIO_PIN_CNF_DRIVE_E0E1) || defined(GPIO_PIN_CNF_DRIVE0_E0) [NRF_DRIVE_E0E1] = NRF_GPIO_PIN_E0E1, #endif }; @@ -486,7 +486,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, #endif /* defined(NRF_PSEL_TDM) */ #if defined(NRF_GRTC_CLKOUT_FAST) case NRF_FUN_GRTC_CLKOUT_FAST: -#if NRF_GPIO_HAS_SEL && NRF_GPIO_HAS_CTRLSEL_GRTC +#if NRF_GPIO_HAS_SEL && defined(GPIO_PIN_CNF_CTRLSEL_GRTC) nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_GRTC); #endif dir = NRF_GPIO_PIN_DIR_OUTPUT; @@ -495,7 +495,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, #endif /* defined(NRF_GRTC_CLKOUT_FAST) */ #if defined(NRF_GRTC_CLKOUT_SLOW) case NRF_FUN_GRTC_CLKOUT_32K: -#if NRF_GPIO_HAS_SEL && NRF_GPIO_HAS_CTRLSEL_GRTC +#if NRF_GPIO_HAS_SEL && defined(GPIO_PIN_CNF_CTRLSEL_GRTC) nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_GRTC); #endif dir = NRF_GPIO_PIN_DIR_OUTPUT; From fbb25381f25f2793129cc5e4e765eecfc4ed432b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1454/3334] Revert "[nrf fromtree] mcumgr: Enable permanent updates in overwrite mode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ff727a5f5781d5725da115d48663093761551e8b. Signed-off-by: Tomasz Moń --- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index 25979180e2c9..dd4c1a3e61cd 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -118,22 +118,18 @@ config MCUMGR_GRP_IMG_REJECT_DIRECT_XIP_MISMATCHED_SLOT using the --rom-fixed command line option. config MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT - bool "Allow to confirm non-active slots of any image" if !MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY + bool "Allow to confirm non-active slots of any image" depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT || \ MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT || \ MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH || \ MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE || \ - MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET || \ - MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY + MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET default y help Allows to confirm non-active slot of any image. Normally it should not be allowed to confirm any slots via MCUmgr commands, to prevent confirming something that is broken and was not verified to boot correctly. - Option always enabled in the overwrite mode, because the permanent - update, that uses the confirm flag, is the intended way to provide - updates. config MCUMGR_GRP_IMG_FRUGAL_LIST bool "Omit zero, empty or false values from status list" From d0fd31c20100faf0cd20c02a98a5494571a50470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1455/3334] Revert "[nrf fromtree] mgmt: Add missing CONFIG_ prefixes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8262c7e0714a55be14b6816b979c7ffbd0ac0dc3. Signed-off-by: Tomasz Moń --- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index dbb496fb3b33..cc465fbea740 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -685,7 +685,7 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) * verified to actually be bootable, a new policy was introduced, * that applies to both active and inactive images. */ -#ifndef CONFIG_MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT +#ifndef MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT if (confirm && slot != active_slot) { return IMG_MGMT_ERR_IMAGE_CONFIRMATION_DENIED; } @@ -751,7 +751,7 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) return IMG_MGMT_ERR_IMAGE_SETTING_TEST_TO_ACTIVE_DENIED; } -#ifndef CONFIG_MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT +#ifndef MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT if (slot != active_slot && confirm) { return IMG_MGMT_ERR_IMAGE_CONFIRMATION_DENIED; } From efde5732663531a65c4eef16c8042b40468aa997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:03 +0100 Subject: [PATCH 1456/3334] Revert "[nrf fromtree] mgmt: Allow to block confirming non-acive slots" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 79b00e519c938672cd76431f38c74b1a9d5cefe1. Signed-off-by: Tomasz Moń --- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 14 ------------- .../mcumgr/grp/img_mgmt/src/img_mgmt_state.c | 20 +------------------ 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index dd4c1a3e61cd..0915d70e8706 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -117,20 +117,6 @@ config MCUMGR_GRP_IMG_REJECT_DIRECT_XIP_MISMATCHED_SLOT The base address can be set, to an image binary header, with imgtool, using the --rom-fixed command line option. -config MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT - bool "Allow to confirm non-active slots of any image" - depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT || \ - MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT || \ - MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH || \ - MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE || \ - MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET - default y - help - Allows to confirm non-active slot of any image. - Normally it should not be allowed to confirm any slots via MCUmgr - commands, to prevent confirming something that is broken and was not - verified to boot correctly. - config MCUMGR_GRP_IMG_FRUGAL_LIST bool "Omit zero, empty or false values from status list" help diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c index cc465fbea740..fb15c15b6e9e 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c @@ -680,17 +680,6 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) } #endif - /* The rules above apply only to the inactive image. - * To effectively prevent confirming something that might not have been - * verified to actually be bootable, a new policy was introduced, - * that applies to both active and inactive images. - */ -#ifndef MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT - if (confirm && slot != active_slot) { - return IMG_MGMT_ERR_IMAGE_CONFIRMATION_DENIED; - } -#endif - /* Setting test to active slot is not allowed. */ if (!confirm && slot == active_slot) { return IMG_MGMT_ERR_IMAGE_SETTING_TEST_TO_ACTIVE_DENIED; @@ -739,9 +728,8 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) #else int img_mgmt_set_next_boot_slot(int slot, bool confirm) { - int image = img_mgmt_slot_to_image(slot); - int active_slot = img_mgmt_active_slot(image); int active_image = img_mgmt_active_image(); + int active_slot = img_mgmt_active_slot(active_image); LOG_DBG("(%d, %s)", slot, confirm ? "confirm" : "test"); LOG_DBG("aimg = %d, aslot = %d, slot = %d", @@ -751,12 +739,6 @@ int img_mgmt_set_next_boot_slot(int slot, bool confirm) return IMG_MGMT_ERR_IMAGE_SETTING_TEST_TO_ACTIVE_DENIED; } -#ifndef MCUMGR_GRP_IMG_ALLOW_CONFIRM_NON_ACTIVE_SLOT - if (slot != active_slot && confirm) { - return IMG_MGMT_ERR_IMAGE_CONFIRMATION_DENIED; - } -#endif - return img_mgmt_set_next_boot_slot_common(slot, active_slot, confirm); } #endif From c86d9723ded13d150ec424482e4745dd34e6f0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1457/3334] Revert "[nrf fromtree] samples: drivers: spi_bitbang: Enable sample on nrf54h20 PPR core" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e87c1bc6163a3a1449d7b75c0be627858b9e04f2. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 32 ------------------- samples/drivers/spi_bitbang/sample.yaml | 1 - 2 files changed, 33 deletions(-) delete mode 100644 samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuppr.overlay diff --git a/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index d3083d6cbd94..000000000000 --- a/samples/drivers/spi_bitbang/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Test requires loopback between P0.06 and P0.07. - * No other driver on SPI_CLK and SPI_CS. - */ - -/ { - spibb0: spibb0 { - compatible = "zephyr,spi-bitbang"; - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - clk-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; - mosi-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; - miso-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; - cs-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; - }; -}; - -&gpio0 { - status = "okay"; -}; - -&gpiote130 { - status = "okay"; - owned-channels = <7>; -}; diff --git a/samples/drivers/spi_bitbang/sample.yaml b/samples/drivers/spi_bitbang/sample.yaml index e3265ce2fdb6..c90f02313f2b 100644 --- a/samples/drivers/spi_bitbang/sample.yaml +++ b/samples/drivers/spi_bitbang/sample.yaml @@ -9,7 +9,6 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: From 441dc4e23d190b2e63c310eba7822f6eebba7ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1458/3334] Revert "[nrf fromlist] dts: arm: nordic: Remove superfluous compatible strings" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e063ccd9d4730d03f9d3e2a7efd8ccf2ab153252. Signed-off-by: Tomasz Moń --- dts/arm/nordic/nrf51822_qfaa.dtsi | 3 ++- dts/arm/nordic/nrf51822_qfab.dtsi | 3 ++- dts/arm/nordic/nrf51822_qfac.dtsi | 3 ++- dts/arm/nordic/nrf52805_caaa.dtsi | 3 ++- dts/arm/nordic/nrf52810_qfaa.dtsi | 3 ++- dts/arm/nordic/nrf52811_qfaa.dtsi | 3 ++- dts/arm/nordic/nrf52820_qdaa.dtsi | 3 ++- dts/arm/nordic/nrf52832_ciaa.dtsi | 3 ++- dts/arm/nordic/nrf52832_qfaa.dtsi | 3 ++- dts/arm/nordic/nrf52832_qfab.dtsi | 3 ++- dts/arm/nordic/nrf52833_qdaa.dtsi | 3 ++- dts/arm/nordic/nrf52833_qiaa.dtsi | 3 ++- dts/arm/nordic/nrf52840_qfaa.dtsi | 3 ++- dts/arm/nordic/nrf52840_qiaa.dtsi | 3 ++- dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi | 3 ++- dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi | 3 ++- dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi | 3 ++- dts/arm/nordic/nrf9131_laca.dtsi | 3 ++- dts/arm/nordic/nrf9131ns_laca.dtsi | 3 ++- dts/arm/nordic/nrf9151_laca.dtsi | 3 ++- dts/arm/nordic/nrf9151ns_laca.dtsi | 3 ++- dts/arm/nordic/nrf9160_sica.dtsi | 3 ++- dts/arm/nordic/nrf9160ns_sica.dtsi | 3 ++- dts/arm/nordic/nrf9161_laca.dtsi | 3 ++- dts/arm/nordic/nrf9161ns_laca.dtsi | 3 ++- 25 files changed, 50 insertions(+), 25 deletions(-) diff --git a/dts/arm/nordic/nrf51822_qfaa.dtsi b/dts/arm/nordic/nrf51822_qfaa.dtsi index 2aeec68fd852..07fc5dd1cce9 100644 --- a/dts/arm/nordic/nrf51822_qfaa.dtsi +++ b/dts/arm/nordic/nrf51822_qfaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf51822-qfaa", "nordic,nrf51822", + "nordic,nrf51", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf51822_qfab.dtsi b/dts/arm/nordic/nrf51822_qfab.dtsi index 6f6818ac4607..7fb4364d0379 100644 --- a/dts/arm/nordic/nrf51822_qfab.dtsi +++ b/dts/arm/nordic/nrf51822_qfab.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf51822-qfab", "nordic,nrf51822", + "nordic,nrf51", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf51822_qfac.dtsi b/dts/arm/nordic/nrf51822_qfac.dtsi index eae879189c0c..59a2ed265e67 100644 --- a/dts/arm/nordic/nrf51822_qfac.dtsi +++ b/dts/arm/nordic/nrf51822_qfac.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf51822-qfac", "nordic,nrf51822", + "nordic,nrf51", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52805_caaa.dtsi b/dts/arm/nordic/nrf52805_caaa.dtsi index 285d21440599..b7d24861893a 100644 --- a/dts/arm/nordic/nrf52805_caaa.dtsi +++ b/dts/arm/nordic/nrf52805_caaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52805-caaa", "nordic,nrf52805", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52810_qfaa.dtsi b/dts/arm/nordic/nrf52810_qfaa.dtsi index bbc76ab75971..98fbd9a09369 100644 --- a/dts/arm/nordic/nrf52810_qfaa.dtsi +++ b/dts/arm/nordic/nrf52810_qfaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52810-qfaa", "nordic,nrf52810", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52811_qfaa.dtsi b/dts/arm/nordic/nrf52811_qfaa.dtsi index 17b387919dc8..3bb1556eadb7 100644 --- a/dts/arm/nordic/nrf52811_qfaa.dtsi +++ b/dts/arm/nordic/nrf52811_qfaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52811-qfaa", "nordic,nrf52811", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52820_qdaa.dtsi b/dts/arm/nordic/nrf52820_qdaa.dtsi index a683ddcd2e61..c1d4a5a95f5a 100644 --- a/dts/arm/nordic/nrf52820_qdaa.dtsi +++ b/dts/arm/nordic/nrf52820_qdaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52820-qdaa", "nordic,nrf52820", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52832_ciaa.dtsi b/dts/arm/nordic/nrf52832_ciaa.dtsi index 81bed18daf27..88f16574bbb9 100644 --- a/dts/arm/nordic/nrf52832_ciaa.dtsi +++ b/dts/arm/nordic/nrf52832_ciaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52832-ciaa", "nordic,nrf52832", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52832_qfaa.dtsi b/dts/arm/nordic/nrf52832_qfaa.dtsi index 81bed18daf27..2943de6d1155 100644 --- a/dts/arm/nordic/nrf52832_qfaa.dtsi +++ b/dts/arm/nordic/nrf52832_qfaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52832-qfaa", "nordic,nrf52832", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52832_qfab.dtsi b/dts/arm/nordic/nrf52832_qfab.dtsi index faecc765efdf..fe1605394e72 100644 --- a/dts/arm/nordic/nrf52832_qfab.dtsi +++ b/dts/arm/nordic/nrf52832_qfab.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52832-qfab", "nordic,nrf52832", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52833_qdaa.dtsi b/dts/arm/nordic/nrf52833_qdaa.dtsi index 64462d29269b..7f9be6f22550 100644 --- a/dts/arm/nordic/nrf52833_qdaa.dtsi +++ b/dts/arm/nordic/nrf52833_qdaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52833-qdaa", "nordic,nrf52833", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52833_qiaa.dtsi b/dts/arm/nordic/nrf52833_qiaa.dtsi index 6ab9a4f1e6eb..68eabb08bcf7 100644 --- a/dts/arm/nordic/nrf52833_qiaa.dtsi +++ b/dts/arm/nordic/nrf52833_qiaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52833-qiaa", "nordic,nrf52833", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52840_qfaa.dtsi b/dts/arm/nordic/nrf52840_qfaa.dtsi index 85acf5ab4685..8c927eb5c0a6 100644 --- a/dts/arm/nordic/nrf52840_qfaa.dtsi +++ b/dts/arm/nordic/nrf52840_qfaa.dtsi @@ -17,7 +17,8 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52840-qfaa", "nordic,nrf52840", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf52840_qiaa.dtsi b/dts/arm/nordic/nrf52840_qiaa.dtsi index 7986ab41fd6a..657222447193 100644 --- a/dts/arm/nordic/nrf52840_qiaa.dtsi +++ b/dts/arm/nordic/nrf52840_qiaa.dtsi @@ -26,6 +26,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf52840-qiaa", "nordic,nrf52840", + "nordic,nrf52", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi index 76a2af386623..a543ffe906b1 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf5340-cpuapp-qkaa", "nordic,nrf5340-cpuapp", + "nordic,nrf53", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi index 37d6a605556e..80d5706232f6 100644 --- a/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf5340-cpuapp-qkaa", "nordic,nrf5340-cpuapp", + "nordic,nrf53", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi index e9948125ba89..19eb682ddfc6 100644 --- a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi @@ -21,6 +21,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf5340-cpunet-qkaa", "nordic,nrf5340-cpunet", + "nordic,nrf53", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9131_laca.dtsi b/dts/arm/nordic/nrf9131_laca.dtsi index 77fe73c22af6..f32f0c825ad1 100644 --- a/dts/arm/nordic/nrf9131_laca.dtsi +++ b/dts/arm/nordic/nrf9131_laca.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf9131-laca", "nordic,nrf9120", + "nordic,nrf91", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9131ns_laca.dtsi b/dts/arm/nordic/nrf9131ns_laca.dtsi index 6ab80a842a33..3b6208f45e91 100644 --- a/dts/arm/nordic/nrf9131ns_laca.dtsi +++ b/dts/arm/nordic/nrf9131ns_laca.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf9131-laca", "nordic,nrf9120", + "nordic,nrf91", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9151_laca.dtsi b/dts/arm/nordic/nrf9151_laca.dtsi index 77fe73c22af6..9ed202740170 100644 --- a/dts/arm/nordic/nrf9151_laca.dtsi +++ b/dts/arm/nordic/nrf9151_laca.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf9151-laca", "nordic,nrf9120", + "nordic,nrf91", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9151ns_laca.dtsi b/dts/arm/nordic/nrf9151ns_laca.dtsi index 6ab80a842a33..ac31c6e19c60 100644 --- a/dts/arm/nordic/nrf9151ns_laca.dtsi +++ b/dts/arm/nordic/nrf9151ns_laca.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf9151-laca", "nordic,nrf9120", + "nordic,nrf91", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9160_sica.dtsi b/dts/arm/nordic/nrf9160_sica.dtsi index 6bbe048277c1..15096534016d 100644 --- a/dts/arm/nordic/nrf9160_sica.dtsi +++ b/dts/arm/nordic/nrf9160_sica.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf9160-sica", "nordic,nrf9160", + "nordic,nrf91", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9160ns_sica.dtsi b/dts/arm/nordic/nrf9160ns_sica.dtsi index 12ec1fcbc8e0..c6adbaa7ca2f 100644 --- a/dts/arm/nordic/nrf9160ns_sica.dtsi +++ b/dts/arm/nordic/nrf9160ns_sica.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf9160-sica", "nordic,nrf9160", + "nordic,nrf91", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9161_laca.dtsi b/dts/arm/nordic/nrf9161_laca.dtsi index 77fe73c22af6..e94ab99166a0 100644 --- a/dts/arm/nordic/nrf9161_laca.dtsi +++ b/dts/arm/nordic/nrf9161_laca.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf9161-laca", "nordic,nrf9120", + "nordic,nrf91", "simple-bus"; }; }; diff --git a/dts/arm/nordic/nrf9161ns_laca.dtsi b/dts/arm/nordic/nrf9161ns_laca.dtsi index 6ab80a842a33..4449c3565b32 100644 --- a/dts/arm/nordic/nrf9161ns_laca.dtsi +++ b/dts/arm/nordic/nrf9161ns_laca.dtsi @@ -17,6 +17,7 @@ / { soc { - compatible = "simple-bus"; + compatible = "nordic,nrf9161-laca", "nordic,nrf9120", + "nordic,nrf91", "simple-bus"; }; }; From 86240dfc36476058997baa40d100a0767dce142b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1459/3334] Revert "[nrf fromlist] boards: nordic: nrf54l15dk: Fix cpuflpr SRAM address" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f2dd3bf75034542651f9a5b878d4db4a80d05648. Signed-off-by: Tomasz Moń --- .../nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts index eae0b605eb4b..2bc4ba292bed 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts @@ -8,8 +8,6 @@ #include #include "nrf54l15dk_common.dtsi" -/delete-node/ &cpuflpr_sram; - / { model = "Nordic nRF54L15 DK nRF54L15 FLPR MCU"; compatible = "nordic,nrf54l15dk_nrf54l15-cpuflpr"; @@ -21,16 +19,13 @@ zephyr,flash = &cpuflpr_rram; zephyr,sram = &cpuflpr_sram; }; +}; - cpuflpr_sram: memory@20028000 { - compatible = "mmio-sram"; - /* Size must be increased due to booting from SRAM */ - reg = <0x20028000 DT_SIZE_K(96)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20028000 0x18000>; - status = "okay"; - }; +&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 { From 3fa0e2c1efcd8a6e9f1dc08a8529e6b26e59b6d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1460/3334] Revert "[nrf fromlist] dts: vendor: nordic: Add missing reg parameters" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ec9d5a4e0cd3abe2fc61f9fa3a2214b21ff2a11c. Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 2 -- dts/vendor/nordic/nrf54lm20a.dtsi | 1 - 2 files changed, 3 deletions(-) diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 4d15eebe8d02..aa259713d2fd 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -101,13 +101,11 @@ #ifdef USE_NON_SECURE_ADDRESS_MAP global_peripherals: peripheral@40000000 { - reg = <0x40000000 0x10000000>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x40000000 0x10000000>; #else global_peripherals: peripheral@50000000 { - reg = <0x50000000 0x10000000>; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x50000000 0x10000000>; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index ae17be2c8d42..0601771d496a 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -118,7 +118,6 @@ }; global_peripherals: peripheral@50000000 { - reg = <0x50000000 0x10000000>; ranges = <0x0 0x50000000 0x10000000>; #address-cells = <1>; #size-cells = <1>; From f1eafc56e0341a0b4d43b61e707651d68d0a47a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1461/3334] Revert "[nrf fromtree] manifest: Update hal_nordic to pull latest mdk 8.72.4" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5fda247a13f5693ba5b88a94e0685853e15d2970. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4df2b937a46d..f411f6fbd642 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 979a58d0829108b57f10e90b6c3fc35ab6206e4b + revision: e3bf121f1ba72fb1090ef67d19a702b0d77b9f93 path: modules/hal/nordic groups: - hal From b614965037c5365d712a915c62d2ada7f575aa71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1462/3334] Revert "[nrf fromtree] drivers: ieee802154: nrf5: Remove temporary API migration code" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c5c9074792135caff3c672987fe1bfbc8fc93747. Signed-off-by: Tomasz Moń --- drivers/ieee802154/ieee802154_nrf5.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index 60f45edb9c79..e099b2f33a97 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -499,9 +499,13 @@ static bool nrf5_tx_immediate(struct net_pkt *pkt, uint8_t *payload, bool cca) }, }; +#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE nrf_802154_tx_error_t result = nrf_802154_transmit_raw(payload, &metadata); return result == NRF_802154_TX_ERROR_NONE; +#else + return nrf_802154_transmit_raw(payload, &metadata); +#endif } #if NRF_802154_CSMA_CA_ENABLED @@ -518,9 +522,13 @@ static bool nrf5_tx_csma_ca(struct net_pkt *pkt, uint8_t *payload) }, }; +#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE nrf_802154_tx_error_t result = nrf_802154_transmit_csma_ca_raw(payload, &metadata); return result == NRF_802154_TX_ERROR_NONE; +#else + return nrf_802154_transmit_csma_ca_raw(payload, &metadata); +#endif } #endif @@ -577,9 +585,13 @@ static bool nrf5_tx_at(struct nrf5_802154_data *nrf5_radio, struct net_pkt *pkt, uint64_t tx_at = nrf_802154_timestamp_phr_to_shr_convert( net_pkt_timestamp_ns(pkt) / NSEC_PER_USEC); +#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE nrf_802154_tx_error_t result = nrf_802154_transmit_raw_at(payload, tx_at, &metadata); return result == NRF_802154_TX_ERROR_NONE; +#else + return nrf_802154_transmit_raw_at(payload, tx_at, &metadata); +#endif } #endif /* CONFIG_NET_PKT_TXTIME */ From 6cab3a9bbd95f00901efd45dce9b62e1a4ca68db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1463/3334] Revert "[nrf fromtree] manifest: update hal_nordic to pull nrf-802154 changes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6d39d65fb94db85f4dc559c88db91df10032d70d. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f411f6fbd642..0011534d31da 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: e3bf121f1ba72fb1090ef67d19a702b0d77b9f93 + revision: 57d9fc59c9ea86465b5cd26f0fe2b9dcc520768b path: modules/hal/nordic groups: - hal From 51a0cbdfc90783f2011b53b9a69ac5ac85ac296e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1464/3334] Revert "[nrf fromtree] modules: hal_nordic: nrf_802154: Add new Kconfig options" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 88f85b4c70a038edcbb625923ddaa17a8b2da20d. Signed-off-by: Tomasz Moń --- modules/hal_nordic/Kconfig | 14 -------------- modules/hal_nordic/nrf_802154/CMakeLists.txt | 14 +++----------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/modules/hal_nordic/Kconfig b/modules/hal_nordic/Kconfig index 7be30750627d..b8b659374752 100644 --- a/modules/hal_nordic/Kconfig +++ b/modules/hal_nordic/Kconfig @@ -203,20 +203,6 @@ config NRF_802154_PENDING_EXTENDED_ADDRESSES config NRF_802154_ENCRYPTION bool "nRF 802.15.4 AES-CCM* authentication & encryption" depends on !CRYPTO_NRF_ECB - select NRF_802154_IE_WRITER - select NRF_802154_SECURITY_WRITER - help - Enable module for encryption and authentication of outgoing frames and Acks. - -config NRF_802154_IE_WRITER - bool "Information element writer" - help - Enable data injection for some Information Element types. - -config NRF_802154_SECURITY_WRITER - bool "Security frame counter writer" - help - Enable injection of security frame counter. config NRF_802154_SECURITY_KEY_STORAGE_SIZE int "nRF 802.15.4 security key storage size" diff --git a/modules/hal_nordic/nrf_802154/CMakeLists.txt b/modules/hal_nordic/nrf_802154/CMakeLists.txt index 1f504242cb22..957019ff1e67 100644 --- a/modules/hal_nordic/nrf_802154/CMakeLists.txt +++ b/modules/hal_nordic/nrf_802154/CMakeLists.txt @@ -70,20 +70,12 @@ endif() if (CONFIG_NRF_802154_ENCRYPTION) target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_ENCRYPTION_ENABLED=1) -else () - target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_ENCRYPTION_ENABLED=0) -endif () - -if (CONFIG_NRF_802154_IE_WRITER) - target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_IE_WRITER_ENABLED=1) -else () - target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_IE_WRITER_ENABLED=0) -endif () - -if (CONFIG_NRF_802154_SECURITY_WRITER) target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_SECURITY_WRITER_ENABLED=1) + target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_IE_WRITER_ENABLED=1) else () + target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_ENCRYPTION_ENABLED=0) target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_SECURITY_WRITER_ENABLED=0) + target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_IE_WRITER_ENABLED=0) endif() if (NOT CONFIG_IEEE802154_NRF5 AND NOT CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT AND CONFIG_NRF_802154_SL_OPENSOURCE) From df6ad370075c1b9ee749e09fa27c11bb3cf22ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1465/3334] Revert "[nrf fromtree] manifest: update hal_nordic to pull nrf-802154 changes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 94d3990cb26c68522b0d7a51f1f501883ec134d1. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 0011534d31da..d0e76dbc5760 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 57d9fc59c9ea86465b5cd26f0fe2b9dcc520768b + revision: d0cef2363e572679deba0e796ef6c77f1188bb04 path: modules/hal/nordic groups: - hal From 9b154413e231c7492ed7a846f12e34121f340074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1466/3334] Revert "[nrf fromtree] soc: nordic: nrf54l: Set ROM_START_OFFSET instead of by each board" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fd2b5dc0483585cb0959593c34b4ee6e8d3400a3. Signed-off-by: Tomasz Moń --- boards/ezurio/bl54l15_dvk/Kconfig.defconfig | 7 +++++++ boards/ezurio/bl54l15u_dvk/Kconfig.defconfig | 7 +++++++ boards/nordic/nrf54l15dk/Kconfig.defconfig | 9 +++++++++ boards/nordic/nrf54lm20dk/Kconfig.defconfig | 3 +++ boards/panasonic/panb611evb/Kconfig.defconfig | 7 +++++++ boards/raytac/an54l15q_db/Kconfig.defconfig | 7 +++++++ boards/seeed/xiao_nrf54l15/Kconfig.defconfig | 3 +++ boards/we/ophelia4ev/Kconfig.defconfig | 7 +++++++ soc/nordic/nrf54l/Kconfig.defconfig | 3 --- 9 files changed, 50 insertions(+), 3 deletions(-) diff --git a/boards/ezurio/bl54l15_dvk/Kconfig.defconfig b/boards/ezurio/bl54l15_dvk/Kconfig.defconfig index 2ff8fe6e3027..78ec8fa7116a 100644 --- a/boards/ezurio/bl54l15_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl54l15_dvk/Kconfig.defconfig @@ -6,6 +6,13 @@ DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition +if BOARD_BL54L15_DVK_NRF54L10_CPUAPP || BOARD_BL54L15_DVK_NRF54L15_CPUAPP + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_BL54L15_DVK_NRF54L10_CPUAPP || BOARD_BL54L15_DVK_NRF54L15_CPUAPP + if BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS config HAS_BT_CTLR diff --git a/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig b/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig index 1e706cb66dd2..bb4934e7fd36 100644 --- a/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig @@ -6,6 +6,13 @@ DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition +if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_BL54L15U_DVK_NRF54L15_CPUAPP + if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS config HAS_BT_CTLR diff --git a/boards/nordic/nrf54l15dk/Kconfig.defconfig b/boards/nordic/nrf54l15dk/Kconfig.defconfig index f57b30c2c42d..49e38070a01a 100644 --- a/boards/nordic/nrf54l15dk/Kconfig.defconfig +++ b/boards/nordic/nrf54l15dk/Kconfig.defconfig @@ -4,6 +4,15 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION +if BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ + BOARD_NRF54L15DK_NRF54L15_CPUAPP + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \ + # BOARD_NRF54L15DK_NRF54L15_CPUAPP + if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS config BOARD_NRF54L15DK diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig index 67410cd4d653..1f0a706ae6ca 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54lm20dk/Kconfig.defconfig @@ -6,4 +6,7 @@ if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP diff --git a/boards/panasonic/panb611evb/Kconfig.defconfig b/boards/panasonic/panb611evb/Kconfig.defconfig index 1b469232537f..6ad6d9426dbf 100644 --- a/boards/panasonic/panb611evb/Kconfig.defconfig +++ b/boards/panasonic/panb611evb/Kconfig.defconfig @@ -5,6 +5,13 @@ DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition +if BOARD_PANB611EVB_NRF54L15_CPUAPP + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_PANB611EVB_NRF54L15_CPUAPP + if BOARD_PANB611EVB_NRF54L15_CPUAPP_NS config HAS_BT_CTLR diff --git a/boards/raytac/an54l15q_db/Kconfig.defconfig b/boards/raytac/an54l15q_db/Kconfig.defconfig index 0d903ea091d0..72616407eb7b 100644 --- a/boards/raytac/an54l15q_db/Kconfig.defconfig +++ b/boards/raytac/an54l15q_db/Kconfig.defconfig @@ -6,6 +6,13 @@ DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition +if BOARD_RAYTAC_AN54L15Q_DB_NRF54L15_CPUAPP + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_RAYTAC_AN54L15Q_DB_NRF54L15_CPUAPP + if BOARD_RAYTAC_AN54L15Q_DB_NRF54L15_CPUAPP_NS config HAS_BT_CTLR diff --git a/boards/seeed/xiao_nrf54l15/Kconfig.defconfig b/boards/seeed/xiao_nrf54l15/Kconfig.defconfig index 9dae62ca0403..dd9a6feb90e6 100644 --- a/boards/seeed/xiao_nrf54l15/Kconfig.defconfig +++ b/boards/seeed/xiao_nrf54l15/Kconfig.defconfig @@ -5,4 +5,7 @@ if BOARD_XIAO_NRF54L15_NRF54L15_CPUAPP config HAS_BT_CTLR default BT +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + endif # BOARD_XIAO_NRF54L15_NRF54L15_CPUAPP diff --git a/boards/we/ophelia4ev/Kconfig.defconfig b/boards/we/ophelia4ev/Kconfig.defconfig index 2c11dd05e163..94e5d7e9e0c5 100644 --- a/boards/we/ophelia4ev/Kconfig.defconfig +++ b/boards/we/ophelia4ev/Kconfig.defconfig @@ -3,3 +3,10 @@ config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION + +if BOARD_OPHELIA4EV_NRF54L15_CPUAPP + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_OPHELIA4EV_NRF54L15_CPUAPP diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index 929d13655c54..9e84d3bc09f7 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -32,9 +32,6 @@ choice NULL_POINTER_EXCEPTION_DETECTION default NULL_POINTER_EXCEPTION_DETECTION_NONE endchoice -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - endif # ARM if RISCV From 878a05124e8eef2ba9479bf4367251cf1cbb1913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1467/3334] Revert "[nrf fromtree] boards: we: update WE ophelia4 board definition" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2289e0459f6ec5f63b259ed78aa814c054b4216d. Signed-off-by: Tomasz Moń --- boards/we/ophelia4ev/Kconfig.defconfig | 3 -- .../ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts | 29 +++---------------- .../ophelia4ev_nrf54l15_cpuapp_defconfig | 3 ++ .../ophelia4ev_nrf54l15_cpuflpr.yaml | 1 + 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/boards/we/ophelia4ev/Kconfig.defconfig b/boards/we/ophelia4ev/Kconfig.defconfig index 94e5d7e9e0c5..ae367b374d7e 100644 --- a/boards/we/ophelia4ev/Kconfig.defconfig +++ b/boards/we/ophelia4ev/Kconfig.defconfig @@ -1,9 +1,6 @@ # Copyright (c) 2025 Würth Elektronik eiSos GmbH & Co. KG # SPDX-License-Identifier: Apache-2.0 -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - if BOARD_OPHELIA4EV_NRF54L15_CPUAPP config ROM_START_OFFSET diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts index 9acc3e1fff90..2380fcd5b8d3 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp.dts @@ -15,20 +15,14 @@ chosen { zephyr,console = &uart20; zephyr,shell-uart = &uart20; + zephyr,code-partition = &slot0_partition; + zephyr,flash = &cpuapp_rram; + zephyr,sram = &cpuapp_sram; 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; - zephyr,boot-mode = &boot_mode0; - zephyr,code-partition = &slot0_partition; - zephyr,sram = &cpuapp_sram; - }; - - aliases { - mcuboot-button0 = &button0; - mcuboot-led0 = &led0; }; }; @@ -38,7 +32,7 @@ &lfxo { load-capacitors = "internal"; - load-capacitance-femtofarad = <17000>; + load-capacitance-femtofarad = <15500>; }; &hfxo { @@ -69,10 +63,6 @@ status = "okay"; }; -&nfct { - status = "okay"; -}; - &gpio0 { status = "okay"; }; @@ -109,16 +99,6 @@ status = "okay"; }; -&gpregret1 { - status = "okay"; - - boot_mode0: boot_mode@0 { - compatible = "zephyr,retention"; - status = "okay"; - reg = <0x0 0x1>; - }; -}; - &spi00 { status = "okay"; @@ -146,7 +126,6 @@ has-dpd; t-enter-dpd = <10000>; t-exit-dpd = <35000>; - reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; }; }; diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp_defconfig b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp_defconfig index f880aa57105c..80a40b5a79d9 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp_defconfig +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuapp_defconfig @@ -14,5 +14,8 @@ CONFIG_GPIO=y # Enable MPU CONFIG_ARM_MPU=y +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + # Use internal LFCLK CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.yaml b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.yaml index 6e1264242d64..a302cf4a192d 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.yaml +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.yaml @@ -15,3 +15,4 @@ supported: - gpio - i2c - spi + - watchdog From e41371d0d221bdb843b6dd3009b743125736c72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1468/3334] Revert "[nrf fromtree] drivers: i2c: Extend i2c testing on nrf54h20 PPR" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1c671c3ab203d1f7ae9f51121763025115cf564a. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_cpuppr.conf | 4 - .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 69 ------------- samples/drivers/i2c/rtio_loopback/sample.yaml | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 15 --- .../sysbuild/vpr_launcher/prj.conf | 3 - .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 70 ------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 15 --- .../sysbuild/vpr_launcher/prj.conf | 3 - tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml | 1 - .../boards/nrf54h20dk_nrf54h20_cpuppr.conf | 5 - .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 97 ------------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 15 --- .../sysbuild/vpr_launcher/prj.conf | 3 - .../drivers/i2c/i2c_target_api/testcase.yaml | 1 - 14 files changed, 302 deletions(-) delete mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf delete mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/prj.conf delete mode 100644 tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/prj.conf delete mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf delete mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/prj.conf diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf deleted file mode 100644 index 7dfef7da2839..000000000000 --- a/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index f31ea5090df8..000000000000 --- a/samples/drivers/i2c/rtio_loopback/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SDA = P2.8 and P2.9 - * SCL = P1.2 and P1.3 - */ - -/ { - aliases { - i2c-controller = &i2c130; - i2c-controller-target = &i2c131; - }; -}; - -&pinctrl { - i2c130_default: i2c130_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c130_sleep: i2c130_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c131_default: i2c131_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c131_sleep: i2c131_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c130 { - clock-frequency = ; - pinctrl-0 = <&i2c130_default>; - pinctrl-1 = <&i2c130_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; -}; - -&i2c131 { - compatible = "nordic,nrf-twis"; - clock-frequency = ; - pinctrl-0 = <&i2c131_default>; - pinctrl-1 = <&i2c131_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; diff --git a/samples/drivers/i2c/rtio_loopback/sample.yaml b/samples/drivers/i2c/rtio_loopback/sample.yaml index dadfe1fff98e..a356a2697fdd 100644 --- a/samples/drivers/i2c/rtio_loopback/sample.yaml +++ b/samples/drivers/i2c/rtio_loopback/sample.yaml @@ -15,7 +15,6 @@ tests: - b_u585i_iot02a - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nucleo_f401re diff --git a/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 69aedabd69dc..000000000000 --- a/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&i2c130 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&i2c131 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; diff --git a/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/prj.conf b/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/prj.conf deleted file mode 100644 index d6c8f934808e..000000000000 --- a/samples/drivers/i2c/rtio_loopback/sysbuild/vpr_launcher/prj.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 -# nothing here diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index 1d4259cacc11..000000000000 --- a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SDA = P2.8 and P2.9 - * SCL = P1.2 and P1.3 - */ - -/ { - aliases { - i2c-controller = &i2c130; - i2c-controller-target = &i2c131; - }; -}; - -&pinctrl { - i2c130_default: i2c130_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c130_sleep: i2c130_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c131_default: i2c131_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c131_sleep: i2c131_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c130 { - compatible = "nordic,nrf-twim"; - clock-frequency = ; - pinctrl-0 = <&i2c130_default>; - pinctrl-1 = <&i2c130_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; -}; - -&i2c131 { - compatible = "nordic,nrf-twis"; - clock-frequency = ; - pinctrl-0 = <&i2c131_default>; - pinctrl-1 = <&i2c131_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 69aedabd69dc..000000000000 --- a/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&i2c130 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&i2c131 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/prj.conf b/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/prj.conf deleted file mode 100644 index d6c8f934808e..000000000000 --- a/tests/drivers/i2c/i2c_nrfx_twim/sysbuild/vpr_launcher/prj.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 -# nothing here diff --git a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml index 4fa30bae7e84..e35dd49dbb76 100644 --- a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml +++ b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml @@ -12,7 +12,6 @@ tests: platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf deleted file mode 100644 index baa00bdf40f7..000000000000 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 -CONFIG_GPIO=y diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index 0138f287de8e..000000000000 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SDA = P2.8 and P2.9 - * SCL = P1.2 and P1.3 - */ - -/ { - zephyr,user { - sda0-gpios = <&gpio2 8 0>; - scl0-gpios = <&gpio1 2 0>; - sda1-gpios = <&gpio2 9 0>; - scl1-gpios = <&gpio1 3 0>; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&pinctrl { - i2c130_default: i2c130_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c130_sleep: i2c130_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c131_default: i2c131_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c131_sleep: i2c131_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c130 { - clock-frequency = ; - pinctrl-0 = <&i2c130_default>; - pinctrl-1 = <&i2c130_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; - - eeprom1: eeprom@56 { - compatible = "zephyr,i2c-target-eeprom"; - reg = <0x56>; - address-width = <8>; - size = <256>; - }; -}; - -&i2c131 { - compatible = "nordic,nrf-twis"; - clock-frequency = ; - pinctrl-0 = <&i2c131_default>; - pinctrl-1 = <&i2c131_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; - - eeprom0: eeprom@54 { - compatible = "zephyr,i2c-target-eeprom"; - reg = <0x54>; - address-width = <8>; - size = <256>; - }; -}; - -&gpiote130 { - status = "okay"; -}; diff --git a/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 69aedabd69dc..000000000000 --- a/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&i2c130 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&i2c131 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; diff --git a/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/prj.conf b/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/prj.conf deleted file mode 100644 index d6c8f934808e..000000000000 --- a/tests/drivers/i2c/i2c_target_api/sysbuild/vpr_launcher/prj.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 -# nothing here diff --git a/tests/drivers/i2c/i2c_target_api/testcase.yaml b/tests/drivers/i2c/i2c_target_api/testcase.yaml index 35207c6ab91b..13ef2bb16c4c 100644 --- a/tests/drivers/i2c/i2c_target_api/testcase.yaml +++ b/tests/drivers/i2c/i2c_target_api/testcase.yaml @@ -65,7 +65,6 @@ tests: - max32690evkit/max32690/m4 - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - ophelia4ev/nrf54l15/cpuapp From 7d9a195ada19490b8f2ab6c48174df40b6d35ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1469/3334] Revert "[nrf fromtree] arch: riscv: Support for Direct ISRs for RISCV targets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 21ac1dd9a5582255ac736b54116e9d978614e729. Signed-off-by: Tomasz Moń --- arch/riscv/core/irq_manage.c | 17 ----------------- drivers/timer/nrf_grtc_timer.c | 15 --------------- include/zephyr/arch/riscv/irq.h | 9 --------- 3 files changed, 41 deletions(-) diff --git a/arch/riscv/core/irq_manage.c b/arch/riscv/core/irq_manage.c index 3d18ec59dba3..8ba7b615b422 100644 --- a/arch/riscv/core/irq_manage.c +++ b/arch/riscv/core/irq_manage.c @@ -10,7 +10,6 @@ #include #include #include -#include #ifdef CONFIG_RISCV_HAS_PLIC #include @@ -76,19 +75,3 @@ int arch_irq_disconnect_dynamic(unsigned int irq, unsigned int priority, } #endif /* CONFIG_SHARED_INTERRUPTS */ #endif /* CONFIG_DYNAMIC_INTERRUPTS */ - -#ifdef CONFIG_PM -void arch_isr_direct_pm(void) -{ - unsigned int key; - - key = irq_lock(); - - if (_kernel.idle) { - _kernel.idle = 0; - pm_system_resume(); - } - - irq_unlock(key); -} -#endif diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index df59b9f6d4b6..4e1223635085 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -459,27 +459,12 @@ uint32_t sys_clock_elapsed(void) return (uint32_t)(counter_sub(counter(), last_count) / CYC_PER_TICK); } -#if !defined(CONFIG_GEN_SW_ISR_TABLE) -ISR_DIRECT_DECLARE(nrfx_grtc_direct_irq_handler) -{ - nrfx_grtc_irq_handler(); - ISR_DIRECT_PM(); - return 1; -} -#endif - static int sys_clock_driver_init(void) { nrfx_err_t err_code; -#if defined(CONFIG_GEN_SW_ISR_TABLE) IRQ_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), nrfx_isr, nrfx_grtc_irq_handler, 0); -#else - IRQ_DIRECT_CONNECT(DT_IRQN(GRTC_NODE), DT_IRQ(GRTC_NODE, priority), - nrfx_grtc_direct_irq_handler, 0); - irq_enable(DT_IRQN(GRTC_NODE)); -#endif #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && NRF_GRTC_HAS_CLKSEL #if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC) diff --git a/include/zephyr/arch/riscv/irq.h b/include/zephyr/arch/riscv/irq.h index c3c4baff3518..8408912716a7 100644 --- a/include/zephyr/arch/riscv/irq.h +++ b/include/zephyr/arch/riscv/irq.h @@ -83,15 +83,6 @@ extern void z_riscv_irq_vector_set(unsigned int irq); z_riscv_irq_vector_set(irq_p); \ } -#ifdef CONFIG_PM -extern void arch_isr_direct_pm(void); -#define ARCH_ISR_DIRECT_PM() arch_isr_direct_pm() -#else -#define ARCH_ISR_DIRECT_PM() \ - do { \ - } while (false) -#endif - #define ARCH_ISR_DIRECT_HEADER() arch_isr_direct_header() #define ARCH_ISR_DIRECT_FOOTER(swap) arch_isr_direct_footer(swap) From 82ed27eb39c95d0d3b2e6c64efd711c09e528ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1470/3334] Revert "[nrf fromtree] soc: nordic: common: uicr: Add GRTC fast clkout" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 93d5531ae8b9dff4b7b469d9f0e2d17458826bb3. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/gen_periphconf_entries.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index 92f5f1d24559..e70e56acc1f3 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -395,12 +395,6 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=2, pin=7): Ctrlsel.CAN_TDM_SERIAL2, NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=2, pin=7): Ctrlsel.CAN_TDM_SERIAL2, }, - # GRTC - 0x5F99_C000: { - NrfPsel(fun=NrfFun.GRTC_CLKOUT_FAST, port=1, pin=8): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.GRTC_CLKOUT_FAST, port=2, pin=5): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.GRTC_CLKOUT_FAST, port=9, pin=0): Ctrlsel.SERIAL0, - }, # GPIOTE0 (RAD) 0x5302_7000: { # P1 From ebea92f111b71735c8c7fe949951938718e48e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1471/3334] Revert "[nrf fromlist] tests: ram_context_for_isr: pick IRQ number for nRF54L" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a4a7b2ed718e58c7c46fb9679375a99d5c0e2588. Signed-off-by: Tomasz Moń --- tests/application_development/ram_context_for_isr/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/application_development/ram_context_for_isr/Kconfig b/tests/application_development/ram_context_for_isr/Kconfig index b4031538b4b9..61b3a4224949 100644 --- a/tests/application_development/ram_context_for_isr/Kconfig +++ b/tests/application_development/ram_context_for_isr/Kconfig @@ -12,7 +12,6 @@ config TEST_IRQ_NUM default 18 if SOC_SERIES_STM32C0X default 1 if (SOC_SERIES_NPCX9 || SOC_SERIES_NPCX7 || SOC_SERIES_NPCK3) default 29 if SOC_K32L2B31A - default 28 if SOC_SERIES_NRF54LX default 0 help IRQ number to use for testing purposes. This should be an From 4ea95f8e93bc5e2074652c33c4cf96e6e61730c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:04 +0100 Subject: [PATCH 1472/3334] Revert "[nrf fromtree] tests: ram_context_for_isr: pick an available IRQ for nxp_k32l2b3 soc" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 954a65035c22916937a6e2d7a832b7fbb55f6bf3. Signed-off-by: Tomasz Moń --- tests/application_development/ram_context_for_isr/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/application_development/ram_context_for_isr/Kconfig b/tests/application_development/ram_context_for_isr/Kconfig index 61b3a4224949..7bd3688470f6 100644 --- a/tests/application_development/ram_context_for_isr/Kconfig +++ b/tests/application_development/ram_context_for_isr/Kconfig @@ -11,7 +11,6 @@ config TEST_IRQ_NUM default 22 if SOC_SERIES_DA1469X default 18 if SOC_SERIES_STM32C0X default 1 if (SOC_SERIES_NPCX9 || SOC_SERIES_NPCX7 || SOC_SERIES_NPCK3) - default 29 if SOC_K32L2B31A default 0 help IRQ number to use for testing purposes. This should be an @@ -23,7 +22,6 @@ config TEST_IRQ_NUM - DA1469X series: 22 (available test IRQ) - STM32C0X series: 18 (available test IRQ) - NPCX9, NPCX7, NPCK3 series: 1 (unused IRQ not mapped to MIWU groups) - - K32L2B31A: 29 (available test IRQ) - Other platforms: 0 (magic config value to select the last IRQ: NUM_IRQS - 1) config TEST_IRQ_PRIO From 7daefe8d65390e514f8fedfcdf7c241de2fa774f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1473/3334] Revert "[nrf fromtree] tests: ram_context_for_isr: pick an available IRQ for Nuvoton platforms" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b0443875a7e46b27f7b7b0f4d4434ba9808dfd1f. Signed-off-by: Tomasz Moń --- tests/application_development/ram_context_for_isr/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/application_development/ram_context_for_isr/Kconfig b/tests/application_development/ram_context_for_isr/Kconfig index 7bd3688470f6..30f2e20a3d12 100644 --- a/tests/application_development/ram_context_for_isr/Kconfig +++ b/tests/application_development/ram_context_for_isr/Kconfig @@ -10,7 +10,6 @@ config TEST_IRQ_NUM default 14 if GIC default 22 if SOC_SERIES_DA1469X default 18 if SOC_SERIES_STM32C0X - default 1 if (SOC_SERIES_NPCX9 || SOC_SERIES_NPCX7 || SOC_SERIES_NPCK3) default 0 help IRQ number to use for testing purposes. This should be an @@ -21,7 +20,6 @@ config TEST_IRQ_NUM - GIC platforms: 14 (available test SGI - Software Generated Interrupt) - DA1469X series: 22 (available test IRQ) - STM32C0X series: 18 (available test IRQ) - - NPCX9, NPCX7, NPCK3 series: 1 (unused IRQ not mapped to MIWU groups) - Other platforms: 0 (magic config value to select the last IRQ: NUM_IRQS - 1) config TEST_IRQ_PRIO From 269f650ddb6d2a46f05b66ba75afdc62a86a34ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1474/3334] Revert "[nrf fromtree] scripts: requirements: Use gitlint-core for loose requirements" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 701ae1edd94bc43ac0846ebc6d7351aecb3d3d4d. Signed-off-by: Tomasz Moń --- scripts/requirements-actions.in | 2 +- scripts/requirements-actions.txt | 6 +++++- scripts/requirements-compliance.txt | 2 +- scripts/requirements-extras.txt | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index cc170f59d779..6baf9dc9e3f4 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -6,7 +6,7 @@ clang-format>=15.0.0 elasticsearch<9 exceptiongroup>=1.0.0rc8 gcovr==6.0 -gitlint-core>=0.19.1 +gitlint>=0.19.1 gitpython>=3.1.41 ijson intelhex diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 32173378473d..21505203bfa6 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -345,10 +345,14 @@ gitdb==4.0.12 \ --hash=sha256:5ef71f855d191a3326fcfbc0d5da835f26b13fbcba60c32c21091c349ffdb571 \ --hash=sha256:67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf # via gitpython +gitlint==0.19.1 \ + --hash=sha256:26bb085959148d99fbbc178b4e56fda6c3edd7646b7c2a24d8ee1f8e036ed85d \ + --hash=sha256:b5b70fb894e80849b69abbb65ee7dbb3520fc3511f202a6e6b6ddf1a71ee8f61 + # via -r requirements-actions.in gitlint-core==0.19.1 \ --hash=sha256:7bf977b03ff581624a9e03f65ebb8502cc12dfaa3e92d23e8b2b54bbdaa29992 \ --hash=sha256:f41effd1dcbc06ffbfc56b6888cce72241796f517b46bd9fd4ab1b145056988c - # via -r requirements-actions.in + # via gitlint gitpython==3.1.44 \ --hash=sha256:9e0e10cda9bed1ee64bc9a6de50e7e38a9c9943241cd7f585f6df3ed28011110 \ --hash=sha256:c87e30b26253bf5418b01b0660f818967f3c503193838337fe5e573331249269 diff --git a/scripts/requirements-compliance.txt b/scripts/requirements-compliance.txt index dcb8baae0f97..6d90ac4b2587 100644 --- a/scripts/requirements-compliance.txt +++ b/scripts/requirements-compliance.txt @@ -3,7 +3,7 @@ # used by ci/check_compliance # zephyr-keep-sorted-start clang-format>=15.0.0 -gitlint-core +gitlint junitparser>=4.0.1 lxml>=5.3.0 pykwalify diff --git a/scripts/requirements-extras.txt b/scripts/requirements-extras.txt index b7a93427d725..59f2eb3ff986 100644 --- a/scripts/requirements-extras.txt +++ b/scripts/requirements-extras.txt @@ -10,7 +10,7 @@ gitpython>=3.1.41 plotly # helper for developers - check git commit messages -gitlint-core +gitlint # helper for developers junit2html From 50791aeef6a596d9652af40face2691993786d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1475/3334] Revert "[nrf fromtree] tests: mspi: flash: Add scenario for new mspi_dw option" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d02df6285076303e3c6616cf17eab55a03c7b427. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 23 ------------------ tests/drivers/mspi/flash/testcase.yaml | 24 ++++++++----------- 2 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 6e0d84e07cdb..000000000000 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - mspi0 = &exmif; - }; -}; - -&gpio6 { - status = "okay"; -}; - -&exmif { - status = "okay"; -}; - -&mx25uw63 { - status = "okay"; -}; diff --git a/tests/drivers/mspi/flash/testcase.yaml b/tests/drivers/mspi/flash/testcase.yaml index dba610a40235..72755fd2aa43 100644 --- a/tests/drivers/mspi/flash/testcase.yaml +++ b/tests/drivers/mspi/flash/testcase.yaml @@ -1,18 +1,16 @@ # Copyright (c) 2024 Ambiq Micro Inc. # SPDX-License-Identifier: Apache-2.0 -common: - tags: - - drivers - - mspi - - flash - harness: ztest - tests: drivers.mspi.flash: + tags: + - drivers + - mspi + - flash filter: dt_compat_enabled("zephyr,mspi-emul-flash") or dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("jedec,mspi-nor") or dt_compat_enabled("mspi-atxp032") or dt_compat_enabled("mspi-is25xX0xx") + harness: ztest platform_allow: - native_sim - apollo3p_evb @@ -22,17 +20,15 @@ tests: - apollo3p_evb - apollo510_evb drivers.mspi.flash.xip_read: + tags: + - drivers + - mspi + - flash filter: dt_compat_enabled("mspi-is25xX0xx") + harness: ztest platform_allow: - apollo510_evb integration_platforms: - apollo510_evb extra_configs: - CONFIG_FLASH_MSPI_XIP_READ=y - drivers.mspi.flash.mspi_dw_system_workqueue: - filter: dt_alias_exists("mspi0") and dt_compat_enabled("jedec,mspi-nor") - and CONFIG_MSPI_DW - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - extra_configs: - - CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE=y From 502a489b04f99bc593e2639f4b9f4b2fd31c6525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1476/3334] Revert "[nrf fromtree] drivers: mspi_dw: Add option to offload handling of FIFOs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e0ca2034b5123e631a30fdf2b077858c4a30f0d. Signed-off-by: Tomasz Moń --- drivers/mspi/Kconfig.dw | 9 ---- drivers/mspi/mspi_dw.c | 100 ++++++++-------------------------------- 2 files changed, 18 insertions(+), 91 deletions(-) diff --git a/drivers/mspi/Kconfig.dw b/drivers/mspi/Kconfig.dw index cff148c138c6..06d2e09c8af1 100644 --- a/drivers/mspi/Kconfig.dw +++ b/drivers/mspi/Kconfig.dw @@ -12,15 +12,6 @@ config MSPI_DW if MSPI_DW -config MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE - bool "Handle FIFO in system workqueue" - help - When the driver does not use DMA for transferring data to/from the - SSI FIFOs, handling of those may take a significant amount of time. - It may be destructive for some applications if that time is spent - in the interrupt context. This option allows offloading the job to - the system workqueue. - config MSPI_DW_TXD_DIV int "Designware SSI TX Drive edge divisor" default 4 diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index f1195314c6c2..66f257839aa4 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -71,12 +71,6 @@ struct mspi_dw_data { /* For locking of controller configuration. */ struct k_sem cfg_lock; struct mspi_xfer xfer; - -#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) - struct k_work fifo_work; - const struct device *dev; - uint32_t imr; -#endif }; struct mspi_dw_config { @@ -117,7 +111,7 @@ DEFINE_MM_REG_RD_WR(rxftlr, 0x1c) DEFINE_MM_REG_RD(txflr, 0x20) DEFINE_MM_REG_RD(rxflr, 0x24) DEFINE_MM_REG_RD(sr, 0x28) -DEFINE_MM_REG_RD_WR(imr, 0x2c) +DEFINE_MM_REG_WR(imr, 0x2c) DEFINE_MM_REG_RD(isr, 0x30) DEFINE_MM_REG_RD(risr, 0x34) DEFINE_MM_REG_RD_WR(dr, 0x60) @@ -224,8 +218,6 @@ static bool tx_dummy_bytes(const struct device *dev) write_dr(dev, dummy_val); } while (--dummy_bytes); - dev_data->dummy_bytes = 0; - /* Set the TX start level to 0, so that the transmission will be * started now if it hasn't been yet. The threshold value is also * set to 0 here, but it doesn't really matter, as the interrupt @@ -288,18 +280,7 @@ static bool read_rx_fifo(const struct device *dev, return false; } -static inline void set_imr(const struct device *dev, uint32_t imr) -{ -#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) - struct mspi_dw_data *dev_data = dev->data; - - dev_data->imr = imr; -#else - write_imr(dev, imr); -#endif -} - -static void handle_fifos(const struct device *dev) +static void mspi_dw_isr(const struct device *dev) { struct mspi_dw_data *dev_data = dev->data; const struct mspi_xfer_packet *packet = @@ -321,82 +302,42 @@ static void handle_fifos(const struct device *dev) finished = true; } } else { - for (;;) { - /* Use RISR, not ISR, because when this function is - * executed through the system workqueue, all interrupts - * are masked (IMR is 0). - */ - uint32_t int_status = read_risr(dev); + uint32_t int_status = read_isr(dev); - if (int_status & RISR_RXFIR_BIT) { + do { + if (int_status & ISR_RXFIS_BIT) { if (read_rx_fifo(dev, packet)) { finished = true; break; } - if (int_status & RISR_RXOIR_BIT) { + if (read_risr(dev) & RISR_RXOIR_BIT) { finished = true; break; } - /* Refresh interrupt status, as during reading - * from the RX FIFO, the TX FIFO status might - * have changed. - */ - int_status = read_risr(dev); + int_status = read_isr(dev); } - if (dev_data->dummy_bytes == 0 || - !(int_status & RISR_TXEIR_BIT)) { - break; - } + if (int_status & ISR_TXEIS_BIT) { + if (tx_dummy_bytes(dev)) { + /* All the required dummy bytes were + * written to the FIFO; disable the TXE + * interrupt, as it's no longer needed. + */ + write_imr(dev, IMR_RXFIM_BIT); + } - if (tx_dummy_bytes(dev)) { - /* All the required dummy bytes were written - * to the FIFO; disable the TXE interrupt, - * as it's no longer needed. - */ - set_imr(dev, IMR_RXFIM_BIT); + int_status = read_isr(dev); } - } + } while (int_status != 0); } if (finished) { - set_imr(dev, 0); + write_imr(dev, 0); k_sem_give(&dev_data->finished); } -} - -#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) -static void fifo_work_handler(struct k_work *work) -{ - struct mspi_dw_data *dev_data = - CONTAINER_OF(work, struct mspi_dw_data, fifo_work); - const struct device *dev = dev_data->dev; - - handle_fifos(dev); - - write_imr(dev, dev_data->imr); -} -#endif - -static void mspi_dw_isr(const struct device *dev) -{ -#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) - struct mspi_dw_data *dev_data = dev->data; - int rc; - - dev_data->imr = read_imr(dev); - write_imr(dev, 0); - - rc = k_work_submit(&dev_data->fifo_work); - if (rc < 0) { - LOG_ERR("k_work_submit failed: %d\n", rc); - } -#else - handle_fifos(dev); -#endif vendor_specific_irq_clear(dev); } @@ -1485,11 +1426,6 @@ static int dev_init(const struct device *dev) k_sem_init(&dev_data->cfg_lock, 1, 1); k_sem_init(&dev_data->ctx_lock, 1, 1); -#if defined(CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE) - dev_data->dev = dev; - k_work_init(&dev_data->fifo_work, fifo_work_handler); -#endif - for (ce_gpio = dev_config->ce_gpios; ce_gpio < &dev_config->ce_gpios[dev_config->ce_gpios_len]; ce_gpio++) { From 5fefe5471ff41514186293ba1c5d7a23de6c1d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1477/3334] Revert "[nrf fromtree] drivers: flash: nrf_rram: add support for RRAM throttling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 326936b9365c7fae14912fb6b3f26a33867e7240. Signed-off-by: Tomasz Moń --- drivers/flash/Kconfig.nrf_rram | 23 ----------------------- drivers/flash/soc_flash_nrf_rram.c | 21 ++++----------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/drivers/flash/Kconfig.nrf_rram b/drivers/flash/Kconfig.nrf_rram index b40bb16968bf..3dea687a0f80 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -56,15 +56,8 @@ config SOC_FLASH_NRF_RADIO_SYNC_NONE bool "none" help disable synchronization between flash memory driver and radio. - endchoice -config SOC_FLASH_NRF_THROTTLING - bool "Nordic nRFx throttling for flash write operations" - help - Enable throttling for flash write operations to avoid overloading the - flash memory controller. - config SOC_FLASH_NRF_TIMEOUT_MULTIPLIER int "Multiplier for flash operation timeouts [x0.1]" depends on !SOC_FLASH_NRF_RADIO_SYNC_NONE @@ -88,20 +81,4 @@ config NRF_RRAM_REGION_SIZE_UNIT help Base unit for the size of RRAMC's region protection. -config NRF_RRAM_THROTTLING_DELAY - int "Delay between flash write operations" - depends on SOC_FLASH_NRF_THROTTLING - default 2000 - help - This is the delay (in microseconds) between consecutive flash write - operations when throttling is enabled. - -config NRF_RRAM_THROTTLING_DATA_BLOCK - int "Number of Data blocks for each flash write operations" - depends on SOC_FLASH_NRF_THROTTLING - default 16 - help - This is the number of data blocks (in number of 128-bit words) for flash write - operations when throttling is enabled. - endif # SOC_FLASH_NRF_RRAM diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index 9f0e24dc33d5..d26a15cf7236 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -159,24 +159,11 @@ static void rram_write(off_t addr, const void *data, size_t len) nrf_rramc_config_set(NRF_RRAMC, &config); #endif - size_t chunk_len = len; - -#ifdef CONFIG_SOC_FLASH_NRF_THROTTLING - while (len > 0) { - chunk_len = MIN(len, CONFIG_NRF_RRAM_THROTTLING_DATA_BLOCK * WRITE_LINE_SIZE); -#endif /* CONFIG_SOC_FLASH_NRF_THROTTLING */ - if (data) { - memcpy((void *)addr, data, chunk_len); - } else { - memset((void *)addr, ERASE_VALUE, chunk_len); - } -#ifdef CONFIG_SOC_FLASH_NRF_THROTTLING - addr += chunk_len; - data = (const uint8_t *)data + chunk_len; - len -= chunk_len; - k_usleep(CONFIG_NRF_RRAM_THROTTLING_DELAY); + if (data) { + memcpy((void *)addr, data, len); + } else { + memset((void *)addr, ERASE_VALUE, len); } -#endif /* CONFIG_SOC_FLASH_NRF_THROTTLING */ barrier_dmem_fence_full(); /* Barrier following our last write. */ From 008dfc966844e25ae3dff8d935d10b05ac9045b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1478/3334] Revert "[nrf fromtree] boards: nordic: nrf54lm20dk: Add aliases for MCUboot button/LED" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 78aa98967aefa2451850d57f4e66d8da86b66941. Signed-off-by: Tomasz Moń --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index c6943b5a1028..d6184705899d 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -21,11 +21,6 @@ zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; - - aliases { - mcuboot-button0 = &button0; - mcuboot-led0 = &led0; - }; }; &cpuapp_sram { From a20a618ef9ea679020bfcbb7055fc0f59aa39692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1479/3334] Revert "[nrf fromlist] cmake: Use temp. for edt pickle CMake output" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b34a242a9273d01ec2138a8b301ef05f862cc71a. Signed-off-by: Tomasz Moń --- cmake/modules/extensions.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake index 5aacb8690da0..55ce61fffc6a 100644 --- a/cmake/modules/extensions.cmake +++ b/cmake/modules/extensions.cmake @@ -4705,7 +4705,6 @@ function(zephyr_dt_import) zephyr_check_arguments_required_all(${CMAKE_CURRENT_FUNCTION} arg ${req_single_args}) set(gen_dts_cmake_script ${ZEPHYR_BASE}/scripts/dts/gen_dts_cmake.py) - set(gen_dts_cmake_temp ${arg_EDT_PICKLE_FILE}.cmake.new) set(gen_dts_cmake_output ${arg_EDT_PICKLE_FILE}.cmake) if((${arg_EDT_PICKLE_FILE} IS_NEWER_THAN ${gen_dts_cmake_output}) OR @@ -4714,13 +4713,11 @@ function(zephyr_dt_import) execute_process( COMMAND ${PYTHON_EXECUTABLE} ${gen_dts_cmake_script} --edt-pickle ${arg_EDT_PICKLE_FILE} - --cmake-out ${gen_dts_cmake_temp} + --cmake-out ${gen_dts_cmake_output} WORKING_DIRECTORY ${PROJECT_BINARY_DIR} RESULT_VARIABLE ret COMMAND_ERROR_IS_FATAL ANY ) - - file(COPY_FILE ${gen_dts_cmake_temp} ${gen_dts_cmake_output} ONLY_IF_DIFFERENT) endif() set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${gen_dts_cmake_script}) From ac83103d64193830132575f667134df12e737752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1480/3334] Revert "[nrf fromtree] boards: nrf9280pdk: Add missing overlays for rev. 0.2.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f0f4572cc889df85ec0bfc78da9b6a132214a50e. Signed-off-by: Tomasz Moń --- .../nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay | 7 ------- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay | 7 ------- 2 files changed, 14 deletions(-) delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay deleted file mode 100644 index f2d986e6cb06..000000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_iron_0_2_0.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay deleted file mode 100644 index f2d986e6cb06..000000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_0_2_0.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280-pinctrl_0_2_0.dtsi" From 35d1e1dd1a101d47f2df751ccc663eb59e51592f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1481/3334] Revert "[nrf fromlist] drivers: i2c: i2c_nrfx_twim: add conditional PM ISR safety" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e894f6bbb6a21e80607cd3705778354abdda99df. Signed-off-by: Tomasz Moń --- drivers/i2c/i2c_nrfx_twim.c | 2 +- drivers/i2c/i2c_nrfx_twim_common.h | 20 -------------------- drivers/i2c/i2c_nrfx_twim_rtio.c | 2 +- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index bc26bf841124..e3c307231ab1 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -285,7 +285,7 @@ static DEVICE_API(i2c, i2c_nrfx_twim_driver_api) = { DT_PROP(I2C(idx), easydma_maxcnt_bits)), \ }; \ PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \ - I2C_PM_ISR_SAFE(idx)); \ + PM_DEVICE_ISR_SAFE); \ I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \ i2c_nrfx_twim_init, \ i2c_nrfx_twim_deinit, \ diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index d476ba3f05ff..3c5c82311bae 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -31,26 +31,6 @@ extern "C" { #define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ I2C_BITRATE_STANDARD)) -/* Macro determines PM actions interrupt safety level. - * - * Requesting/releasing TWIM device may be ISR safe, but it cannot be reliably known whether - * managing its power domain is. It is then assumed that if power domains are used, device is - * no longer ISR safe. This macro let's us check if we will be requesting/releasing - * power domains and determines PM device ISR safety value. - */ -#define I2C_PM_ISR_SAFE(idx) \ - COND_CODE_1( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND( \ - DT_NODE_HAS_PROP(I2C(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(I2C(idx), power_domains)) \ - ) \ - ), \ - (0), \ - (PM_DEVICE_ISR_SAFE) \ - ) - struct i2c_nrfx_twim_common_config { nrfx_twim_t twim; nrfx_twim_config_t twim_config; diff --git a/drivers/i2c/i2c_nrfx_twim_rtio.c b/drivers/i2c/i2c_nrfx_twim_rtio.c index 7326deaafb03..0ddf5ffdd777 100644 --- a/drivers/i2c/i2c_nrfx_twim_rtio.c +++ b/drivers/i2c/i2c_nrfx_twim_rtio.c @@ -287,7 +287,7 @@ static int i2c_nrfx_twim_rtio_deinit(const struct device *dev) }, \ .ctx = &_i2c##idx##_twim_rtio, \ }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ + PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \ I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ From b4ddce2a4cdc5088856fee00764234d0996093df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1482/3334] Revert "[nrf fromlist] drivers: spi: spi_nrfx_spis: add conditional PM ISR safety" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ada35d672f9ebb40d53e793dc349b81cc87cfa8b. Signed-off-by: Tomasz Moń --- drivers/spi/spi_nrfx_spis.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/spi/spi_nrfx_spis.c b/drivers/spi/spi_nrfx_spis.c index aa59d9abc9b2..64c9a6f14c45 100644 --- a/drivers/spi/spi_nrfx_spis.c +++ b/drivers/spi/spi_nrfx_spis.c @@ -551,32 +551,6 @@ static int spi_nrfx_init(const struct device *dev) return pm_device_driver_init(dev, spi_nrfx_pm_action); } -/* Macro determines PM actions interrupt safety level. - * - * Requesting/releasing SPIS device may be ISR safe, but it cannot be reliably known whether - * managing its power domain is. It is then assumed that if power domains are used, device is - * no longer ISR safe. This macro let's us check if we will be requesting/releasing - * power domains and determines PM device ISR safety value. - * - * Additionally, fast SPIS devices are not ISR safe. - */ -#define SPIS_PM_ISR_SAFE(idx) \ - COND_CODE_1( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND( \ - DT_NODE_HAS_PROP(SPIS(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(SPIS(idx), power_domains)) \ - ) \ - ), \ - (0), \ - (COND_CODE_1( \ - SPIS_IS_FAST(idx), \ - (0), \ - (PM_DEVICE_ISR_SAFE) \ - )) \ - ) - #define SPI_NRFX_SPIS_DEFINE(idx) \ NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ static void irq_connect##idx(void) \ @@ -623,7 +597,8 @@ static int spi_nrfx_init(const struct device *dev) !(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\ "WAKE line must be configured as active high"); \ PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, \ - SPIS_PM_ISR_SAFE(idx)); \ + COND_CODE_1(SPIS_IS_FAST(idx), (0), \ + (PM_DEVICE_ISR_SAFE))); \ SPI_DEVICE_DT_DEFINE(SPIS(idx), \ spi_nrfx_init, \ PM_DEVICE_DT_GET(SPIS(idx)), \ From 1318e18e91abf99a1f7767a17e9cf19d79248c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1483/3334] Revert "[nrf fromlist] drivers: sensor: qdec_nrfx: add conditional PM ISR safety" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e31af5a58009d1ec35511a787f90c205938b99ef. Signed-off-by: Tomasz Moń --- drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c | 22 +-------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c index 0d5eb5ab8cc2..9ecfb5c122da 100644 --- a/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c +++ b/drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c @@ -272,26 +272,6 @@ static int qdec_nrfx_init(const struct device *dev) #define QDEC(idx) DT_NODELABEL(qdec##idx) #define QDEC_PROP(idx, prop) DT_PROP(QDEC(idx), prop) -/* Macro determines PM actions interrupt safety level. - * - * Requesting/releasing QDEC device may be ISR safe, but it cannot be reliably known whether - * managing its power domain is. It is then assumed that if power domains are used, device is - * no longer ISR safe. This macro let's us check if we will be requesting/releasing - * power domains and determines PM device ISR safety value. - */ -#define QDEC_PM_ISR_SAFE(idx) \ - COND_CODE_1( \ - UTIL_AND( \ - IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \ - UTIL_AND( \ - DT_NODE_HAS_PROP(QDEC(idx), power_domains), \ - DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(QDEC(idx), power_domains)) \ - ) \ - ), \ - (0), \ - (PM_DEVICE_ISR_SAFE) \ - ) - #define SENSOR_NRFX_QDEC_DEVICE(idx) \ NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QDEC(idx)); \ BUILD_ASSERT(QDEC_PROP(idx, steps) > 0, \ @@ -321,7 +301,7 @@ static int qdec_nrfx_init(const struct device *dev) .enable_pin = DT_PROP_OR(QDEC(idx), enable_pin, NRF_QDEC_PIN_NOT_CONNECTED), \ .steps = QDEC_PROP(idx, steps), \ }; \ - PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, QDEC_PM_ISR_SAFE(idx)); \ + PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \ SENSOR_DEVICE_DT_DEFINE(QDEC(idx), \ qdec_nrfx_init, \ PM_DEVICE_DT_GET(QDEC(idx)), \ From e616cbf41a6ea01f96d0a8ce266321d443c324bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1484/3334] Revert "[nrf fromtree] tests: net: socket: getaddrinfo: Align with dns_unpack_query() change" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a8505576178c946dcb7e45fd1f8ab3ceec3b4b3d. Signed-off-by: Tomasz Moń --- tests/net/socket/getaddrinfo/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/net/socket/getaddrinfo/src/main.c b/tests/net/socket/getaddrinfo/src/main.c index 25be0205ea87..c412cce87f41 100644 --- a/tests/net/socket/getaddrinfo/src/main.c +++ b/tests/net/socket/getaddrinfo/src/main.c @@ -96,7 +96,7 @@ static bool check_dns_query(uint8_t *buf, int buf_len) /* In this test we are just checking if the query came to us in correct * form, we are not creating a DNS server implementation here. */ - if (strncmp(result->data, QUERY_HOST, + if (strncmp(result->data + 1, QUERY_HOST, sizeof(QUERY_HOST) - 1)) { net_buf_unref(result); return false; From fadc2ff51de75c95f5e8c856329ceac88a688935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1485/3334] Revert "[nrf fromtree] net: llmnr_responder: Align with dns_unpack_query() change" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2df4854efd730ed5adff6d3e6471b0964e193b88. Signed-off-by: Tomasz Moń --- subsys/net/lib/dns/llmnr_responder.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/subsys/net/lib/dns/llmnr_responder.c b/subsys/net/lib/dns/llmnr_responder.c index 7dfa682f53d6..c8b1500b1b01 100644 --- a/subsys/net/lib/dns/llmnr_responder.c +++ b/subsys/net/lib/dns/llmnr_responder.c @@ -192,19 +192,23 @@ static void setup_dns_hdr(uint8_t *buf, uint16_t answers, uint16_t dns_id) static void add_question(struct net_buf *query, enum dns_rr_type qtype) { - char *dot = query->data + DNS_MSG_HEADER_SIZE + 1; - char *prev = query->data + DNS_MSG_HEADER_SIZE; + char *dot = query->data + DNS_MSG_HEADER_SIZE; + char *prev = NULL; uint16_t offset; - /* For the length of the first label. */ - query->len += 1; + while ((dot = strchr(dot, '.'))) { + if (!prev) { + prev = dot++; + continue; + } - while ((dot = strchr(dot, '.')) != NULL) { *prev = dot - prev - 1; prev = dot++; } - *prev = strlen(prev + 1); + if (prev) { + *prev = strlen(prev) - 1; + } offset = DNS_MSG_HEADER_SIZE + query->len + 1; UNALIGNED_PUT(htons(qtype), (uint16_t *)(query->data+offset)); @@ -241,15 +245,14 @@ static int create_answer(enum dns_rr_type qtype, /* Prepare the response into the query buffer: move the name * query buffer has to get enough free space: dns_hdr + query + answer */ - if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + 1 + + if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + (DNS_QTYPE_LEN + DNS_QCLASS_LEN) * 2 + DNS_TTL_LEN + DNS_RDLENGTH_LEN + addr_len + query->len)) { return -ENOBUFS; } - /* +1 for the initial label length */ - memmove(query->data + DNS_MSG_HEADER_SIZE + 1, query->data, query->len); + memmove(query->data + DNS_MSG_HEADER_SIZE, query->data, query->len); setup_dns_hdr(query->data, 1, dns_id); @@ -485,8 +488,8 @@ static int dns_read(int sock, result->data, ret); /* If the query matches to our hostname, then send reply */ - if (!strncasecmp(hostname, result->data, hostname_len) && - (result->len) >= hostname_len) { + if (!strncasecmp(hostname, result->data + 1, hostname_len) && + (result->len - 1) >= hostname_len) { NET_DBG("%s query to our hostname %s", "LLMNR", hostname); ret = send_response(sock, src_addr, addrlen, result, qtype, From 375318f8b200599f15cc37b01b078f32dfbb9430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1486/3334] Revert "[nrf fromtree] net: mdns_responder: Align with dns_unpack_query() change" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc96fd7014822b33830f14ba3a3bf2eac71a15e4. Signed-off-by: Tomasz Moń --- subsys/net/lib/dns/mdns_responder.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/subsys/net/lib/dns/mdns_responder.c b/subsys/net/lib/dns/mdns_responder.c index e60ab9b70029..a867cd079a13 100644 --- a/subsys/net/lib/dns/mdns_responder.c +++ b/subsys/net/lib/dns/mdns_responder.c @@ -274,19 +274,23 @@ static void setup_dns_hdr(uint8_t *buf, uint16_t answers) static void add_answer(struct net_buf *query, enum dns_rr_type qtype, uint32_t ttl, uint16_t addr_len, uint8_t *addr) { - char *dot = query->data + DNS_MSG_HEADER_SIZE + 1; - char *prev = query->data + DNS_MSG_HEADER_SIZE; + char *dot = query->data + DNS_MSG_HEADER_SIZE; + char *prev = NULL; uint16_t offset; - /* For the length of the first label. */ - query->len += 1; + while ((dot = strchr(dot, '.'))) { + if (!prev) { + prev = dot++; + continue; + } - while ((dot = strchr(dot, '.')) != NULL) { *prev = dot - prev - 1; prev = dot++; } - *prev = strlen(prev + 1); + if (prev) { + *prev = strlen(prev) - 1; + } /* terminator byte (0x00) */ query->len += 1; @@ -318,15 +322,14 @@ static int create_answer(int sock, /* Prepare the response into the query buffer: move the name * query buffer has to get enough free space: dns_hdr + answer */ - if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + 1 + + if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + DNS_QTYPE_LEN + DNS_QCLASS_LEN + DNS_TTL_LEN + DNS_RDLENGTH_LEN + addr_len)) { return -ENOBUFS; } - /* +1 for the initial label length */ - memmove(query->data + DNS_MSG_HEADER_SIZE + 1, query->data, query->len); + memmove(query->data + DNS_MSG_HEADER_SIZE, query->data, query->len); setup_dns_hdr(query->data, 1); @@ -638,7 +641,7 @@ static int dns_read(int sock, } /* Handle only .local queries */ - lquery = strrchr(result->data, '.'); + lquery = strrchr(result->data + 1, '.'); if (!lquery || memcmp(lquery, (const void *){ ".local" }, 7)) { continue; } @@ -651,9 +654,9 @@ static int dns_read(int sock, * We skip the first dot, and make sure there is dot after * matching hostname. */ - if (!strncasecmp(hostname, result->data, hostname_len) && - (result->len) >= hostname_len && - &result->data[hostname_len] == lquery) { + if (!strncasecmp(hostname, result->data + 1, hostname_len) && + (result->len - 1) >= hostname_len && + &(result->data + 1)[hostname_len] == lquery) { NET_DBG("%s %s %s to our hostname %s%s", "mDNS", family == AF_INET ? "IPv4" : "IPv6", "query", hostname, ".local"); From 3a2dc9d4e3d459fcc75e381d4c5017b95be20907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:05 +0100 Subject: [PATCH 1487/3334] Revert "[nrf fromtree] net: tcp: Fix ACK processing when FIN packet is received" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3ea99eb6c6c5c56d4bce22afaf9a9efad6b5eb92. Signed-off-by: Tomasz Moń --- subsys/net/ip/tcp.c | 76 ++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/subsys/net/ip/tcp.c b/subsys/net/ip/tcp.c index f86e782ac9f5..270675fe27fd 100644 --- a/subsys/net/ip/tcp.c +++ b/subsys/net/ip/tcp.c @@ -2719,7 +2719,7 @@ static void tcp_queue_recv_data(struct tcp *conn, struct net_pkt *pkt, } static enum net_verdict tcp_data_received(struct tcp *conn, struct net_pkt *pkt, - size_t *len, bool psh, bool fin) + size_t *len, bool psh) { enum net_verdict ret; @@ -2732,13 +2732,6 @@ static enum net_verdict tcp_data_received(struct tcp *conn, struct net_pkt *pkt, net_stats_update_tcp_seg_recv(conn->iface); conn_ack(conn, *len); - /* In case FIN was received, don't send ACK just yet, FIN,ACK will be - * sent instead. - */ - if (fin) { - return ret; - } - /* Delay ACK response in case of small window or missing PSH, * as described in RFC 813. */ @@ -3150,8 +3143,37 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) } break; - case TCP_ESTABLISHED: { - bool fin = FL(&fl, &, FIN, th_seq(th) == conn->ack); + case TCP_ESTABLISHED: + /* full-close */ + if (FL(&fl, &, FIN, th_seq(th) == conn->ack)) { + if (len) { + verdict = tcp_data_get(conn, pkt, &len); + if (verdict == NET_OK) { + /* net_pkt owned by the recv fifo now */ + pkt = NULL; + } + } else { + verdict = NET_OK; + } + + conn_ack(conn, + len + 1); + keep_alive_timer_stop(conn); + + if (net_tcp_seq_cmp(th_ack(th), conn->seq) > 0) { + uint32_t len_acked = th_ack(th) - conn->seq; + + conn_seq(conn, + len_acked); + } + + tcp_out(conn, FIN | ACK); + conn_seq(conn, + 1); + tcp_setup_retransmission(conn); + + tcp_setup_last_ack_timer(conn); + next = TCP_LAST_ACK; + + break; + } /* Whatever we've received, we know that peer is alive, so reset * the keepalive timer. @@ -3257,21 +3279,11 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) /* We are closing the connection, send a FIN to peer */ if (conn->in_close && conn->send_data_total == 0) { - if (fin) { - /* If FIN was also present in the processed - * packet, acknowledge that and jump directly - * to TCP_LAST_ACK. - */ - conn_ack(conn, + 1); - next = TCP_LAST_ACK; - tcp_setup_last_ack_timer(conn); - } else { - /* Otherwise, wait for FIN in TCP_FIN_WAIT_1 */ - next = TCP_FIN_WAIT_1; - k_work_reschedule_for_queue(&tcp_work_q, - &conn->fin_timer, - FIN_TIMEOUT); - } + next = TCP_FIN_WAIT_1; + + k_work_reschedule_for_queue(&tcp_work_q, + &conn->fin_timer, + FIN_TIMEOUT); tcp_out(conn, FIN | ACK); conn_seq(conn, + 1); @@ -3302,7 +3314,7 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) data_recv: psh = FL(&fl, &, PSH); - verdict = tcp_data_received(conn, pkt, &len, psh, fin); + verdict = tcp_data_received(conn, pkt, &len, psh); if (verdict == NET_OK) { /* net_pkt owned by the recv fifo now */ pkt = NULL; @@ -3346,19 +3358,7 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) k_sem_give(&conn->tx_sem); } - /* Finally, after all Data/ACK processing, check for FIN flag. */ - if (fin) { - keep_alive_timer_stop(conn); - conn_ack(conn, + 1); - tcp_out(conn, FIN | ACK); - conn_seq(conn, + 1); - tcp_setup_retransmission(conn); - tcp_setup_last_ack_timer(conn); - next = TCP_LAST_ACK; - } - break; - } case TCP_CLOSE_WAIT: /* Half-close is not supported, so do nothing here */ break; From dc47313c218353923584c2cd7980812aaed0bc6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1488/3334] Revert "[nrf fromtree] tests: net: tcp: Add test for FIN,ACK received after final data" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 228a166e001d4255ca24c8098f2c87fd54623e7e. Signed-off-by: Tomasz Moń --- tests/net/tcp/src/main.c | 205 --------------------------------------- 1 file changed, 205 deletions(-) diff --git a/tests/net/tcp/src/main.c b/tests/net/tcp/src/main.c index db57b70a40ef..2c0cfcd9ef2c 100644 --- a/tests/net/tcp/src/main.c +++ b/tests/net/tcp/src/main.c @@ -116,7 +116,6 @@ static enum test_case_no { TEST_CLIENT_FIN_ACK_WITH_DATA = 18, TEST_CLIENT_SEQ_VALIDATION = 19, TEST_SERVER_ACK_VALIDATION = 20, - TEST_SERVER_FIN_ACK_AFTER_DATA = 21, } test_case_no; static enum test_state t_state; @@ -143,7 +142,6 @@ static void handle_syn_invalid_ack(sa_family_t af, struct tcphdr *th); static void handle_client_fin_ack_with_data_test(sa_family_t af, struct tcphdr *th); static void handle_client_seq_validation_test(sa_family_t af, struct tcphdr *th); static void handle_server_ack_validation_test(struct net_pkt *pkt); -static void handle_server_fin_ack_after_data_test(sa_family_t af, struct tcphdr *th); static void verify_flags(struct tcphdr *th, uint8_t flags, const char *fun, int line) @@ -496,9 +494,6 @@ static int tester_send(const struct device *dev, struct net_pkt *pkt) case TEST_SERVER_ACK_VALIDATION: handle_server_ack_validation_test(pkt); break; - case TEST_SERVER_FIN_ACK_AFTER_DATA: - handle_server_fin_ack_after_data_test(net_pkt_family(pkt), &th); - break; default: zassert_true(false, "Undefined test case"); } @@ -3007,204 +3002,4 @@ ZTEST(net_tcp, test_server_ack_validation) net_context_put(accepted_ctx); } -#define TEST_FIN_ACK_AFTER_DATA_REQ "request" -#define TEST_FIN_ACK_AFTER_DATA_RSP "test data response" - -/* In this test we check that FIN,ACK packet acknowledging latest data is - * handled correctly by the TCP stack. - */ -static void handle_server_fin_ack_after_data_test(sa_family_t af, struct tcphdr *th) -{ - struct net_pkt *reply = NULL; - - zassert_false(th == NULL && t_state != T_SYN, - "NULL pkt only expected in T_SYN state"); - - switch (t_state) { - case T_SYN: - reply = prepare_syn_packet(af, htons(MY_PORT), htons(PEER_PORT)); - seq++; - t_state = T_SYN_ACK; - break; - case T_SYN_ACK: - test_verify_flags(th, SYN | ACK); - zassert_equal(ntohl(th->th_ack), seq, - "Unexpected ACK in T_SYN_ACK, got %d, expected %d", - ntohl(th->th_ack), seq); - device_initial_seq = ntohl(th->th_seq); - ack = ntohl(th->th_seq) + 1U; - t_state = T_DATA_ACK; - - /* Dummy "request" packet */ - reply = prepare_data_packet(af, htons(MY_PORT), htons(PEER_PORT), - TEST_FIN_ACK_AFTER_DATA_REQ, - sizeof(TEST_FIN_ACK_AFTER_DATA_REQ) - 1); - seq += sizeof(TEST_FIN_ACK_AFTER_DATA_REQ) - 1; - break; - case T_DATA_ACK: - test_verify_flags(th, ACK); - t_state = T_DATA; - zassert_equal(ntohl(th->th_seq), ack, - "Unexpected SEQ in T_DATA_ACK, got %d, expected %d", - get_rel_seq(th), ack); - zassert_equal(ntohl(th->th_ack), seq, - "Unexpected ACK in T_DATA_ACK, got %d, expected %d", - ntohl(th->th_ack), seq); - break; - case T_DATA: - test_verify_flags(th, PSH | ACK); - zassert_equal(ntohl(th->th_seq), ack, - "Unexpected SEQ in T_DATA, got %d, expected %d", - get_rel_seq(th), ack); - zassert_equal(ntohl(th->th_ack), seq, - "Unexpected ACK in T_DATA, got %d, expected %d", - ntohl(th->th_ack), seq); - ack += sizeof(TEST_FIN_ACK_AFTER_DATA_RSP) - 1; - t_state = T_FIN_ACK; - - reply = prepare_fin_ack_packet(af, htons(MY_PORT), htons(PEER_PORT)); - seq++; - break; - case T_FIN_ACK: - test_verify_flags(th, FIN | ACK); - zassert_equal(ntohl(th->th_seq), ack, - "Unexpected SEQ in T_FIN_ACK, got %d, expected %d", - get_rel_seq(th), ack); - zassert_equal(ntohl(th->th_ack), seq, - "Unexpected ACK in T_FIN_ACK, got %d, expected %d", - ntohl(th->th_ack), seq); - - ack++; - t_state = T_CLOSING; - - reply = prepare_ack_packet(af, htons(MY_PORT), htons(PEER_PORT)); - seq++; - break; - case T_CLOSING: - zassert_true(false, "Should not receive anything after final ACK"); - break; - default: - zassert_true(false, "%s unexpected state", __func__); - return; - } - - if (reply != NULL) { - zassert_ok(net_recv_data(net_iface, reply), "%s failed", __func__); - } -} - -/* Receive callback to be installed in the accept handler */ -static void test_fin_ack_after_data_recv_cb(struct net_context *context, - struct net_pkt *pkt, - union net_ip_header *ip_hdr, - union net_proto_header *proto_hdr, - int status, - void *user_data) -{ - zassert_ok(status, "failed to recv the data"); - - if (pkt != NULL) { - uint8_t buf[sizeof(TEST_FIN_ACK_AFTER_DATA_REQ)] = { 0 }; - int data_len = net_pkt_remaining_data(pkt); - - zassert_equal(data_len, sizeof(TEST_FIN_ACK_AFTER_DATA_REQ) - 1, - "Invalid packet length, %d", data_len); - zassert_ok(net_pkt_read(pkt, buf, data_len)); - zassert_mem_equal(buf, TEST_FIN_ACK_AFTER_DATA_REQ, data_len); - - net_pkt_unref(pkt); - } - - test_sem_give(); -} - -static void test_fin_ack_after_data_accept_cb(struct net_context *ctx, - struct sockaddr *addr, - socklen_t addrlen, - int status, - void *user_data) -{ - int ret; - - zassert_ok(status, "failed to accept the conn"); - - /* set callback on newly created context */ - accepted_ctx = ctx; - ret = net_context_recv(ctx, test_fin_ack_after_data_recv_cb, - K_NO_WAIT, NULL); - zassert_ok(ret, "Failed to recv data from peer"); - - /* Ref the context on the app behalf. */ - net_context_ref(ctx); -} - -/* Verify that the TCP stack replies with a valid FIN,ACK after the peer - * acknowledges the latest data in the FIN packet. - * Test case scenario IPv4 - * send SYN, - * expect SYN ACK, - * send ACK with Data, - * expect ACK, - * expect Data, - * send FIN,ACK - * expect FIN,ACK - * send ACK - * any failures cause test case to fail. - */ -ZTEST(net_tcp, test_server_fin_ack_after_data) -{ - struct net_context *ctx; - int ret; - - test_case_no = TEST_SERVER_FIN_ACK_AFTER_DATA; - - t_state = T_SYN; - seq = ack = 0; - - ret = net_context_get(AF_INET, SOCK_STREAM, IPPROTO_TCP, &ctx); - zassert_ok(ret, "Failed to get net_context"); - - net_context_ref(ctx); - - ret = net_context_bind(ctx, (struct sockaddr *)&my_addr_s, - sizeof(struct sockaddr_in)); - zassert_ok(ret, "Failed to bind net_context"); - - /* Put context into listening mode and install accept cb */ - ret = net_context_listen(ctx, 1); - zassert_ok(ret, "Failed to listen on net_context"); - - ret = net_context_accept(ctx, test_fin_ack_after_data_accept_cb, - K_NO_WAIT, NULL); - zassert_ok(ret, "Failed to set accept on net_context"); - - /* Trigger the peer to send SYN */ - handle_server_fin_ack_after_data_test(AF_INET, NULL); - - /* test_fin_ack_after_data_recv_cb will release the semaphore after - * dummy request is read. - */ - test_sem_take(K_MSEC(100), __LINE__); - - /* Send dummy "response" */ - ret = net_context_send(accepted_ctx, TEST_FIN_ACK_AFTER_DATA_RSP, - sizeof(TEST_FIN_ACK_AFTER_DATA_RSP) - 1, NULL, - K_NO_WAIT, NULL); - zassert_equal(ret, sizeof(TEST_FIN_ACK_AFTER_DATA_RSP) - 1, - "Failed to send data to peer %d", ret); - - /* test_fin_ack_after_data_recv_cb will release the semaphore after - * the connection is marked closed. - */ - test_sem_take(K_MSEC(100), __LINE__); - - net_context_put(ctx); - net_context_put(accepted_ctx); - - /* Connection is in TIME_WAIT state, context will be released - * after K_MSEC(CONFIG_NET_TCP_TIME_WAIT_DELAY), so wait for it. - */ - k_sleep(K_MSEC(CONFIG_NET_TCP_TIME_WAIT_DELAY)); -} - ZTEST_SUITE(net_tcp, NULL, presetup, NULL, NULL, NULL); From 7b137108f071568108e58b796135a79f684ad19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1489/3334] Revert "[nrf fromlist] drivers: i2c: nrfx_twis: fix missing SoC header include" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 07ef691a1b0b5e02b3f716069490737d6203b804. Signed-off-by: Tomasz Moń --- drivers/i2c/i2c_nrfx_twis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c_nrfx_twis.c b/drivers/i2c/i2c_nrfx_twis.c index 0fd9b667d23c..be55c851f3a7 100644 --- a/drivers/i2c/i2c_nrfx_twis.c +++ b/drivers/i2c/i2c_nrfx_twis.c @@ -10,7 +10,7 @@ #include #include #include -#include + #include #include From dac539f665793edac63f8325fbcc90e5988877b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1490/3334] Revert "[nrf fromlist] drivers: ieee802154: nrf5: Add temporary API migration code" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8cbb39f9841963559873c09c9c408abbbb6f83f3. Signed-off-by: Tomasz Moń --- drivers/ieee802154/ieee802154_nrf5.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index e099b2f33a97..aa67a1f99e15 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -499,13 +499,7 @@ static bool nrf5_tx_immediate(struct net_pkt *pkt, uint8_t *payload, bool cca) }, }; -#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE - nrf_802154_tx_error_t result = nrf_802154_transmit_raw(payload, &metadata); - - return result == NRF_802154_TX_ERROR_NONE; -#else return nrf_802154_transmit_raw(payload, &metadata); -#endif } #if NRF_802154_CSMA_CA_ENABLED @@ -522,13 +516,7 @@ static bool nrf5_tx_csma_ca(struct net_pkt *pkt, uint8_t *payload) }, }; -#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE - nrf_802154_tx_error_t result = nrf_802154_transmit_csma_ca_raw(payload, &metadata); - - return result == NRF_802154_TX_ERROR_NONE; -#else return nrf_802154_transmit_csma_ca_raw(payload, &metadata); -#endif } #endif @@ -585,13 +573,7 @@ static bool nrf5_tx_at(struct nrf5_802154_data *nrf5_radio, struct net_pkt *pkt, uint64_t tx_at = nrf_802154_timestamp_phr_to_shr_convert( net_pkt_timestamp_ns(pkt) / NSEC_PER_USEC); -#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE - nrf_802154_tx_error_t result = nrf_802154_transmit_raw_at(payload, tx_at, &metadata); - - return result == NRF_802154_TX_ERROR_NONE; -#else return nrf_802154_transmit_raw_at(payload, tx_at, &metadata); -#endif } #endif /* CONFIG_NET_PKT_TXTIME */ From 8b2b7e5aab92c767d353ecd0cda7c3be3b18189c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1491/3334] Revert "[nrf fromlist] soc: nordic: uicr: print cmake warning when used without sysbuild" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit eeed71d2c6344820bd51d362d628175dc6af12f5. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/soc/nordic/common/uicr/CMakeLists.txt b/soc/nordic/common/uicr/CMakeLists.txt index d350d8d3f586..9d5deec52d57 100644 --- a/soc/nordic/common/uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/CMakeLists.txt @@ -20,11 +20,3 @@ if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) zephyr_sources(${periphconf_entries_c_file}) message(STATUS "Generated ${periphconf_entries_c_file} from ${EDT_PICKLE}") endif() - -if(CONFIG_NRF_PERIPHCONF_SECTION AND NOT SYSBUILD) - message(WARNING "CONFIG_NRF_PERIPHCONF_SECTION is enabled, but Sysbuild is not being used. " - "The global peripheral configuration will not be applied unless artifacts " - "are generated manually/externally. To enable automatic generation, build with " - "Sysbuild and ensure that SB_CONFIG_NRF_HALTIUM_GENERATE_UICR=y." - ) -endif() From 3df77f6f6f1c1b64be0ab324df38748f9dd9ccfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1492/3334] Revert "[nrf fromlist] soc: nordic: nrf54h: generate PERIPHCONF entries based on devicetree" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c56cab3f095cd00643751966ff8e2a210a0b64a5. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/CMakeLists.txt | 16 - soc/nordic/common/uicr/Kconfig | 9 - .../common/uicr/gen_periphconf_entries.py | 658 -------- soc/nordic/common/uicr/gen_uicr.py | 33 - soc/nordic/common/uicr/periphconf/__init__.py | 6 - soc/nordic/common/uicr/periphconf/builder.py | 1460 ----------------- 6 files changed, 2182 deletions(-) delete mode 100644 soc/nordic/common/uicr/gen_periphconf_entries.py delete mode 100644 soc/nordic/common/uicr/periphconf/__init__.py delete mode 100644 soc/nordic/common/uicr/periphconf/builder.py diff --git a/soc/nordic/common/uicr/CMakeLists.txt b/soc/nordic/common/uicr/CMakeLists.txt index 9d5deec52d57..1ec3a35c5665 100644 --- a/soc/nordic/common/uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/CMakeLists.txt @@ -4,19 +4,3 @@ if(CONFIG_NRF_PERIPHCONF_SECTION) zephyr_linker_sources(SECTIONS uicr.ld) endif() - -if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) - set(periphconf_entries_c_file ${PROJECT_BINARY_DIR}/periphconf_entries_generated.c) - execute_process( - COMMAND - ${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE} - ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/gen_periphconf_entries.py - --soc ${CONFIG_SOC} - --in-edt-pickle ${EDT_PICKLE} - --out-periphconf-source ${periphconf_entries_c_file} - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMAND_ERROR_IS_FATAL ANY - ) - zephyr_sources(${periphconf_entries_c_file}) - message(STATUS "Generated ${periphconf_entries_c_file} from ${EDT_PICKLE}") -endif() diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index 73b5e5cf2d1c..3c4c6c8219b6 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -9,12 +9,3 @@ config NRF_PERIPHCONF_SECTION help Include static global domain peripheral initialization values from the build in a dedicated section in the devnull region. - -config NRF_PERIPHCONF_GENERATE_ENTRIES - bool "Generate PERIPHCONF entries source file" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD - depends on NRF_PERIPHCONF_SECTION - depends on NRF_PLATFORM_HALTIUM - help - Generate a C file containing PERIPHCONF entries based on the - device configuration in the devicetree. diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py deleted file mode 100644 index e70e56acc1f3..000000000000 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ /dev/null @@ -1,658 +0,0 @@ -""" -Copyright (c) 2025 Nordic Semiconductor ASA -SPDX-License-Identifier: Apache-2.0 -""" - -from __future__ import annotations - -import argparse -import enum -import os -import pickle -import sys -from pathlib import Path -from typing import Any - -try: - ZEPHYR_BASE = Path(os.environ["ZEPHYR_BASE"]).resolve() -except KeyError: - sys.exit("Set the environment variable 'ZEPHYR_BASE' to point to the zephyr root directory") - -# Add packages that are located in zephyr itself to the python path so we can import them below -sys.path.insert(0, str(ZEPHYR_BASE / "scripts/dts/python-devicetree/src")) -sys.path.insert(0, str(ZEPHYR_BASE / "soc/nordic/common/uicr")) - -from periphconf.builder import ( - Ctrlsel, - FixedPPIMap, - GpiosProp, - Node, - NrfCompChannel, - NrfFun, - NrfPsel, - NrfSaadcChannel, - PeriphconfBuilder, - ProcessorId, - SocLookupTables, - dt_processor_id, -) - -# These peripherals are special cases that don't fit the general rules we use to generate -# PERIPHCONF entries based on the devicetree. -NODELABEL_TO_KWARGS = { - # Channel links on this node do not result in PPIB connections, because the *-links properties - # are ambiguous. Instead, the PPIB connections are configured by the DPPICs connected to this. - "dppic130": {"add_ppib_channel_links": False}, - # The interrupts for this node are not managed in IRQMAP. - "canpll": {"has_irq_mapping": False}, -} - - -def get_additional_node_kwargs(node: Node) -> dict[str, Any]: - additional_kwargs = {} - for label in node.labels: - additional_kwargs.update(NODELABEL_TO_KWARGS.get(label, {})) - return additional_kwargs - - -class Soc(enum.Enum): - """Names of SoCs supported by this script""" - - NRF54H20 = "nrf54h20" - NRF9280 = "nrf9280" - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - allow_abbrev=False, - description=( - "Generate a C source file containing entries for the PERIPHCONF blob based on the " - "device configuration in devicetree." - ), - ) - parser.add_argument( - "-v", - "--verbose", - default=0, - action="count", - help="Print verbose output such as debug information.", - ) - parser.add_argument( - "--soc", - required=True, - choices=[soc.value for soc in Soc], - help=( - "SoC to generate PERIPHCONF macros for. " - "Used to look up soc specific hardware information" - ), - ) - parser.add_argument( - "--in-edt-pickle", - type=argparse.FileType("rb"), - required=True, - help="Path to the pickled edtlib.EDT object with devicetree contents.", - ) - parser.add_argument( - "--out-periphconf-source", - type=argparse.FileType("w", encoding="utf-8"), - required=True, - help="Path to write the generated PERIPHCONF C source file to.", - ) - return parser.parse_args() - - -def main() -> None: - args = parse_args() - dt = pickle.load(args.in_edt_pickle) - processor = dt_processor_id(dt) - lookup_tables = lookup_tables_get(Soc(args.soc)) - builder = PeriphconfBuilder(dt, lookup_tables) - - # Application local peripherals - if processor == ProcessorId.APPLICATION: - for node in dt.label2node["cpuapp_peripherals"].children.values(): - builder.add_local_peripheral_cfg(node, **get_additional_node_kwargs(node)) - - # Radio local peripherals - if processor == ProcessorId.RADIOCORE: - for node in dt.label2node["cpurad_peripherals"].children.values(): - builder.add_local_peripheral_cfg(node, **get_additional_node_kwargs(node)) - - # Global domain peripherals - for node in dt.label2node["global_peripherals"].children.values(): - builder.add_global_peripheral_cfg(node, **get_additional_node_kwargs(node)) - - # Add pins referenced by 'gpios' properties on non-peripheral nodes, for example - # buttons and leds. We only add SPU configurations for these and not CTRLSEL, - # to avoid false CTRLSEL conflicts for things like PWM leds. - for node in dt.nodes: - builder.add_gpio_spu_permissions(node) - - script_name = Path(__file__).resolve().relative_to(ZEPHYR_BASE) - generated_by = f"Generated by {script_name}" - - generated_source = builder.build_generated_source(generated_by) - args.out_periphconf_source.write(generated_source) - - -def lookup_tables_get(soc: Soc) -> SocLookupTables: - if soc == Soc.NRF54H20: - ctrlsel_lookup = { - # CAN120 - 0x5F8D_8000: { - # P2 - NrfPsel(fun=NrfFun.CAN_TX, port=2, pin=9): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.CAN_RX, port=2, pin=8): Ctrlsel.CAN_PWM_I3C, - # P9 - NrfPsel(fun=NrfFun.CAN_TX, port=9, pin=5): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.CAN_RX, port=9, pin=4): Ctrlsel.CAN, - }, - # PWM120 - 0x5F8E_4000: { - # P2 - NrfPsel(fun=NrfFun.PWM_OUT0, port=2, pin=4): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT1, port=2, pin=5): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT2, port=2, pin=6): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT3, port=2, pin=7): Ctrlsel.CAN_PWM_I3C, - # P6 - NrfPsel(fun=NrfFun.PWM_OUT0, port=6, pin=6): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT1, port=6, pin=7): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT2, port=6, pin=8): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT3, port=6, pin=9): Ctrlsel.CAN_PWM_I3C, - # P7 - NrfPsel(fun=NrfFun.PWM_OUT0, port=7, pin=0): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT1, port=7, pin=1): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT2, port=7, pin=6): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT3, port=7, pin=7): Ctrlsel.CAN_PWM_I3C, - }, - # PWM130 - 0x5F9A_4000: { - # P9 - NrfPsel(fun=NrfFun.PWM_OUT0, port=9, pin=2): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT1, port=9, pin=3): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT2, port=9, pin=4): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT3, port=9, pin=5): Ctrlsel.CAN_PWM_I3C, - }, - # SPIM130/SPIS130/TWIM130/TWIS130/UARTE130 - 0x5F9A_5000: { - # SPIM mappings - NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=9, pin=3): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=4): Ctrlsel.SERIAL0, - # SPIS mappings - NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_MOSI, port=9, pin=2): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_CSN, port=9, pin=3): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_SCK, port=9, pin=4): Ctrlsel.SERIAL0, - # TWIM mappings - NrfPsel(fun=NrfFun.TWIM_SDA, port=9, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.TWIM_SCL, port=9, pin=4): Ctrlsel.SERIAL0, - # TWIS mappings - NrfPsel(fun=NrfFun.TWIS_SDA, port=9, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.TWIS_SCL, port=9, pin=4): Ctrlsel.SERIAL0, - # UARTÈ mappings - NrfPsel(fun=NrfFun.UART_TX, port=9, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RX, port=9, pin=4): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.UART_CTS, port=9, pin=2): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RTS, port=9, pin=3): Ctrlsel.SERIAL0, - }, - # SPIM131/SPIS131/TWIM131/TWIS131/UARTE131 - 0x5F9A_6000: { - # SPIM mappings - NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.CAN_TDM_SERIAL2, - GpiosProp(name="cs-gpios", port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, - # SPIS mappings - NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.SPIS_MOSI, port=9, pin=2): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.SPIS_CSN, port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.SPIS_SCK, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, - # TWIM mappings - NrfPsel(fun=NrfFun.TWIM_SDA, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TWIM_SCL, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, - # TWIS mappings - NrfPsel(fun=NrfFun.TWIS_SDA, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TWIS_SCL, port=9, pin=1): Ctrlsel.CAN_TDM_SERIAL2, - # UARTÈ mappings - NrfPsel(fun=NrfFun.UART_TX, port=9, pin=0): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.UART_RX, port=9, pin=1): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_CTS, port=9, pin=2): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.UART_RTS, port=9, pin=3): Ctrlsel.CAN_TDM_SERIAL2, - }, - # VPR121 (FLPR) - 0x5F8D_4000: { - # P1 - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=8): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=9): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=10): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=11): Ctrlsel.VPR_GRC, - # P2 - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=0): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=1): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=2): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=3): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=4): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=5): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=6): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=7): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=8): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=9): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=10): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=11): Ctrlsel.VPR_GRC, - # P6 - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=0): Ctrlsel.VPR_GRC, - # (pin 1-2 are not connected with VIO) - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=3): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=4): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=5): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=6): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=7): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=8): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=9): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=10): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=11): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=12): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=6, pin=13): Ctrlsel.VPR_GRC, - # P7 - NrfPsel(fun=NrfFun.IGNORE, port=7, pin=0): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=7, pin=1): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=7, pin=2): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=7, pin=3): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=7, pin=4): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=7, pin=5): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=7, pin=6): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=7, pin=7): Ctrlsel.VPR_GRC, - # P9 - NrfPsel(fun=NrfFun.IGNORE, port=9, pin=0): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=9, pin=1): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=9, pin=2): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=9, pin=3): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=9, pin=4): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=9, pin=5): Ctrlsel.VPR_GRC, - }, - # SPIS120 - 0x5F8E_5000: { - NrfPsel(fun=NrfFun.SPIS_MISO, port=6, pin=3): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_MOSI, port=6, pin=4): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_CSN, port=6, pin=9): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_SCK, port=6, pin=0): Ctrlsel.SERIAL0, - }, - # SPIM120/UARTE120 - 0x5F8E_6000: { - # SPIM P6 mappings - NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=8): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=6, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=1): Ctrlsel.SERIAL0, - # SPIM P7 mappings - NrfPsel(fun=NrfFun.SPIM_MOSI, port=7, pin=7): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=7, pin=6): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=7, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=7, pin=3): Ctrlsel.SERIAL0, - # SPIM P2 mappings - NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=6): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=5): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=2, pin=7): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=3): Ctrlsel.SERIAL0, - # UARTÈ P6 mappings - NrfPsel(fun=NrfFun.UART_TX, port=6, pin=8): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_CTS, port=6, pin=7): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RX, port=6, pin=6): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RTS, port=6, pin=5): Ctrlsel.SERIAL0, - # UARTÈ P7 mappings - NrfPsel(fun=NrfFun.UART_TX, port=7, pin=7): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_CTS, port=7, pin=6): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RX, port=7, pin=4): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RTS, port=7, pin=5): Ctrlsel.SERIAL0, - # UARTÈ P2 mappings - NrfPsel(fun=NrfFun.UART_TX, port=2, pin=6): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_CTS, port=2, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RX, port=2, pin=4): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RTS, port=2, pin=7): Ctrlsel.SERIAL0, - }, - # SPIM121 - 0x5F8E_7000: { - # SPIM P6 mappings - NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=13): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=12): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=6, pin=10): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=2): Ctrlsel.SERIAL0, - # SPIM P7 mappings - NrfPsel(fun=NrfFun.SPIM_MOSI, port=7, pin=1): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.SPIS_MISO, port=7, pin=1): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.SPIM_MISO, port=7, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.SPIS_MOSI, port=7, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, - GpiosProp(name="cs-gpios", port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.SPIS_CSN, port=7, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.SPIM_SCK, port=7, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.SPIS_SCK, port=7, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, - # SPIM P2 mappings - NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=11): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=10): Ctrlsel.SERIAL0, - GpiosProp(name="cs-gpios", port=2, pin=8): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=2): Ctrlsel.SERIAL0, - }, - # EXMIF - 0x5F09_5000: { - NrfPsel(fun=NrfFun.EXMIF_CK, port=6, pin=0): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_RWDS, port=6, pin=2): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_CS0, port=6, pin=3): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_DQ7, port=6, pin=4): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_DQ1, port=6, pin=5): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_DQ6, port=6, pin=6): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_DQ0, port=6, pin=7): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_DQ5, port=6, pin=8): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_DQ3, port=6, pin=9): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_DQ2, port=6, pin=10): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_DQ4, port=6, pin=11): Ctrlsel.EXMIF_RADIO_SERIAL1, - NrfPsel(fun=NrfFun.EXMIF_CS1, port=6, pin=13): Ctrlsel.EXMIF_RADIO_SERIAL1, - }, - # VPR130 (PPR) - 0x5F90_8000: { - # P0 - NrfPsel(fun=NrfFun.IGNORE, port=0, pin=4): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=0, pin=5): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=0, pin=6): Ctrlsel.VPR_GRC, - NrfPsel(fun=NrfFun.IGNORE, port=0, pin=7): Ctrlsel.VPR_GRC, - }, - # TDM130 - 0x5F99_2000: { - # TDM P1 mappings - NrfPsel(fun=NrfFun.TDM_MCK, port=1, pin=2): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SCK_M, port=1, pin=3): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SCK_S, port=1, pin=3): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SDOUT, port=1, pin=4): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SDIN, port=1, pin=5): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=1, pin=6): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=1, pin=6): Ctrlsel.CAN_TDM_SERIAL2, - # TDM P2 mappings - NrfPsel(fun=NrfFun.TDM_MCK, port=2, pin=0): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SCK_M, port=2, pin=1): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SCK_S, port=2, pin=1): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SDOUT, port=2, pin=9): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SDIN, port=2, pin=10): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=2, pin=11): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=2, pin=11): Ctrlsel.CAN_TDM_SERIAL2, - }, - # TDM131 - 0x5F99_7000: { - # TDM P1 mappings - NrfPsel(fun=NrfFun.TDM_MCK, port=1, pin=0): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SCK_M, port=1, pin=1): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SCK_S, port=1, pin=1): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SDOUT, port=1, pin=9): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SDIN, port=1, pin=10): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=1, pin=11): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=1, pin=11): Ctrlsel.CAN_TDM_SERIAL2, - # TDM P2 mappings - NrfPsel(fun=NrfFun.TDM_MCK, port=2, pin=2): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SCK_M, port=2, pin=3): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SCK_S, port=2, pin=3): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SDOUT, port=2, pin=4): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_SDIN, port=2, pin=6): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_FSYNC_M, port=2, pin=7): Ctrlsel.CAN_TDM_SERIAL2, - NrfPsel(fun=NrfFun.TDM_FSYNC_S, port=2, pin=7): Ctrlsel.CAN_TDM_SERIAL2, - }, - # GPIOTE0 (RAD) - 0x5302_7000: { - # P1 - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=4): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=5): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=6): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=7): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=8): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=9): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=10): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=1, pin=11): Ctrlsel.CAN, - # P2 - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=0): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=1): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=2): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=3): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=4): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=5): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=6): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=7): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=8): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=9): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=10): Ctrlsel.CAN, - NrfPsel(fun=NrfFun.IGNORE, port=2, pin=11): Ctrlsel.CAN, - }, - } - elif soc == Soc.NRF9280: - ctrlsel_lookup = { - # PWM120 - 0x5F8E_4000: { - # P2 - NrfPsel(fun=NrfFun.PWM_OUT0, port=2, pin=0): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT1, port=2, pin=1): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT2, port=2, pin=2): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT3, port=2, pin=3): Ctrlsel.CAN_PWM_I3C, - # P6 - NrfPsel(fun=NrfFun.PWM_OUT0, port=6, pin=0): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT0, port=6, pin=6): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT1, port=6, pin=1): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT1, port=6, pin=7): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT2, port=6, pin=2): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT2, port=6, pin=8): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT3, port=6, pin=3): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT3, port=6, pin=9): Ctrlsel.CAN_PWM_I3C, - }, - # SPIM120/UARTE120 - 0x5F8E_6000: { - # SPIM P2 mappings - GpiosProp(name="cs-gpios", port=2, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=3): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=4): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=0): Ctrlsel.SERIAL0, - # SPIM P6 mappings - GpiosProp(name="cs-gpios", port=6, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=8): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=1): Ctrlsel.SERIAL0, - # UARTE P2 mappings - NrfPsel(fun=NrfFun.UART_CTS, port=2, pin=3): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RTS, port=2, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RX, port=2, pin=2): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_TX, port=2, pin=4): Ctrlsel.SERIAL0, - # UARTE P6 mappings - NrfPsel(fun=NrfFun.UART_CTS, port=6, pin=7): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RTS, port=6, pin=5): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RX, port=6, pin=6): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_TX, port=6, pin=8): Ctrlsel.SERIAL0, - }, - # SPIM121 - 0x5F8E_7000: { - # P2 - GpiosProp(name="cs-gpios", port=2, pin=6): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=8): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=9): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=1): Ctrlsel.SERIAL0, - # P6 - GpiosProp(name="cs-gpios", port=6, pin=10): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=12): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MOSI, port=6, pin=13): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=6, pin=2): Ctrlsel.SERIAL0, - }, - # PWM130 - 0x5F9A_4000: { - NrfPsel(fun=NrfFun.PWM_OUT0, port=9, pin=2): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT1, port=9, pin=3): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT2, port=9, pin=4): Ctrlsel.CAN_PWM_I3C, - NrfPsel(fun=NrfFun.PWM_OUT3, port=9, pin=5): Ctrlsel.CAN_PWM_I3C, - }, - # SPIM130/SPIS130/TWIM130/TWIS130/UARTE130 - 0x5F9A_5000: { - # SPIM mappings - GpiosProp(name="cs-gpios", port=9, pin=1): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MISO, port=9, pin=2): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_MOSI, port=9, pin=3): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIM_SCK, port=9, pin=0): Ctrlsel.SERIAL0, - # SPIS mappings - NrfPsel(fun=NrfFun.SPIS_CSN, port=9, pin=1): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_MISO, port=9, pin=3): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_MOSI, port=9, pin=2): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.SPIS_SCK, port=9, pin=0): Ctrlsel.SERIAL0, - # TWIM mappings - NrfPsel(fun=NrfFun.TWIM_SCL, port=9, pin=0): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.TWIM_SDA, port=9, pin=3): Ctrlsel.SERIAL0, - # UARTE mappings - NrfPsel(fun=NrfFun.UART_CTS, port=9, pin=2): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RTS, port=9, pin=1): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_RX, port=9, pin=4): Ctrlsel.SERIAL0, - NrfPsel(fun=NrfFun.UART_TX, port=9, pin=3): Ctrlsel.SERIAL0, - }, - } - else: - raise NotImplementedError(f"No CTRLSEL table exists for soc {soc}") - - # Entries below this are common to all supported socs at the time of writing. - - adc_channel_pin_lookup = { - # SAADC - 0x5F98_2000: { - NrfSaadcChannel.AIN0: (1, 0), - NrfSaadcChannel.AIN1: (1, 1), - NrfSaadcChannel.AIN2: (1, 2), - NrfSaadcChannel.AIN3: (1, 3), - NrfSaadcChannel.AIN4: (1, 4), - NrfSaadcChannel.AIN5: (1, 5), - NrfSaadcChannel.AIN6: (1, 6), - NrfSaadcChannel.AIN7: (1, 7), - NrfSaadcChannel.AIN8: (9, 0), - NrfSaadcChannel.AIN9: (9, 1), - NrfSaadcChannel.AIN10: (9, 2), - NrfSaadcChannel.AIN11: (9, 3), - NrfSaadcChannel.AIN12: (9, 4), - NrfSaadcChannel.AIN13: (9, 5), - } - } - comp_channel_pin_lookup = { - # COMP/LPCOMP - 0x5F98_3000: { - NrfCompChannel.AIN0: (1, 0), - NrfCompChannel.AIN1: (1, 1), - NrfCompChannel.AIN2: (1, 2), - NrfCompChannel.AIN3: (1, 3), - NrfCompChannel.AIN4: (1, 4), - NrfCompChannel.AIN5: (1, 5), - NrfCompChannel.AIN6: (1, 6), - NrfCompChannel.AIN7: (1, 7), - NrfCompChannel.AIN8: (9, 0), - NrfCompChannel.AIN9: (9, 1), - } - } - spu_instances = [ - ("SPU110", 0x5F08_0000), - ("SPU111", 0x5F09_0000), - ("SPU120", 0x5F8C_0000), - ("SPU121", 0x5F8D_0000), - ("SPU122", 0x5F8E_0000), - ("SPU130", 0x5F90_0000), - ("SPU131", 0x5F92_0000), - ("SPU132", 0x5F98_0000), - ("SPU133", 0x5F99_0000), - ("SPU134", 0x5F9A_0000), - ("SPU135", 0x5F9B_0000), - ("SPU136", 0x5F9C_0000), - ("SPU137", 0x5F9D_0000), - ] - dppics = { - "DPPIC120": 0x5F8E_1000, - "DPPIC130": 0x5F92_2000, - "DPPIC131": 0x5F98_1000, - "DPPIC132": 0x5F99_1000, - "DPPIC133": 0x5F9A_1000, - "DPPIC134": 0x5F9B_1000, - "DPPIC135": 0x5F9C_1000, - "DPPIC136": 0x5F9D_1000, - } - ppib_instances = [ - ("PPIB110", 0x5F09_8000), - ("PPIB120", 0x5F8E_E000), - ("PPIB121", 0x5F8E_F000), - ("PPIB130", 0x5F92_5000), - ("PPIB131", 0x5F92_6000), - ("PPIB132", 0x5F98_D000), - ("PPIB133", 0x5F99_D000), - ("PPIB134", 0x5F9A_D000), - ("PPIB135", 0x5F9B_D000), - ("PPIB136", 0x5F9C_D000), - ("PPIB137", 0x5F9D_D000), - ] - ppib_name_to_addr = dict(ppib_instances) - dppic_to_ppib_connections = { - dppics["DPPIC120"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB121"], - channel_map=range(0, 8), - ), - dppics["DPPIC131"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB132"], - channel_map=range(0, 8), - ), - dppics["DPPIC132"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB133"], - channel_map=range(0, 8), - ), - dppics["DPPIC133"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB134"], - channel_map=range(0, 8), - ), - dppics["DPPIC134"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB135"], - channel_map=range(0, 8), - ), - dppics["DPPIC135"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB136"], - channel_map=range(0, 8), - ), - dppics["DPPIC136"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB137"], - channel_map=range(0, 8), - ), - } - ppib_to_ppib_connections = { - ppib_name_to_addr["PPIB132"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB130"], - channel_map=range(0, 8), - ), - ppib_name_to_addr["PPIB133"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB130"], - channel_map=range(8, 16), - ), - ppib_name_to_addr["PPIB134"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB130"], - channel_map=range(16, 24), - ), - ppib_name_to_addr["PPIB135"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB130"], - channel_map=range(24, 32), - ), - ppib_name_to_addr["PPIB136"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB131"], - channel_map=range(0, 8), - ), - ppib_name_to_addr["PPIB137"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB131"], - channel_map=range(8, 16), - ), - ppib_name_to_addr["PPIB121"]: FixedPPIMap( - connected_to=ppib_name_to_addr["PPIB131"], - channel_map=range(16, 24), - ), - } - return SocLookupTables( - ctrlsel_lookup=ctrlsel_lookup, - adc_channel_pin_lookup=adc_channel_pin_lookup, - comp_channel_pin_lookup=comp_channel_pin_lookup, - dppic_to_ppib_connections=dppic_to_ppib_connections, - ppib_to_ppib_connections=ppib_to_ppib_connections, - spu_instances=spu_instances, - ppib_instances=ppib_instances, - ) - - -if __name__ == "__main__": - main() diff --git a/soc/nordic/common/uicr/gen_uicr.py b/soc/nordic/common/uicr/gen_uicr.py index ce69cd7e80a3..78422e4312cd 100644 --- a/soc/nordic/common/uicr/gen_uicr.py +++ b/soc/nordic/common/uicr/gen_uicr.py @@ -426,7 +426,6 @@ def main() -> None: def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes: combined_periphconf = [] - ipcmap_index = 0 for in_file in elf_files: elf = ELFFile(in_file) @@ -437,7 +436,6 @@ def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes conf_section_data = conf_section.data() num_entries = len(conf_section_data) // PERIPHCONF_ENTRY_SIZE periphconf = (PeriphconfEntry * num_entries).from_buffer_copy(conf_section_data) - ipcmap_index = adjust_ipcmap_entries(periphconf, offset_index=ipcmap_index) combined_periphconf.extend(periphconf) combined_periphconf.sort(key=lambda e: e.regptr) @@ -461,36 +459,5 @@ def extract_and_combine_periphconfs(elf_files: list[argparse.FileType]) -> bytes return bytes(final_periphconf) -# This workaround is currently needed to avoid conflicts in IPCMAP whenever more than -# one image uses IPCMAP, because at the moment each image has no way of knowing which -# IPCMAP channel indices it should use for the configuration it generates locally. -# -# What the workaround does is adjust all IPCMAP entries found in the periphconf by the -# given index offset. -# -# The workaround assumes that IPCMAP entries are allocated sequentially starting from 0 -# in each image, it will probably not work for arbitrary IPCMAP entries. -def adjust_ipcmap_entries(periphconf: c.Array[PeriphconfEntry], offset_index: int) -> int: - max_ipcmap_index = offset_index - - for entry in sorted(periphconf, key=lambda e: e.regptr): - if IPCMAP_CHANNEL_START_ADDR <= entry.regptr < IPCMAP_CHANNEL_END_ADDR: - entry.regptr += offset_index * IPCMAP_CHANNEL_SIZE - entry_ipcmap_index = (entry.regptr - IPCMAP_CHANNEL_START_ADDR) // IPCMAP_CHANNEL_SIZE - max_ipcmap_index = max(max_ipcmap_index, entry_ipcmap_index) - - return max_ipcmap_index + 1 - - -# Size of each IPCMAP.CHANNEL[i] -IPCMAP_CHANNEL_SIZE = 8 -# Number of entries in IPCMAP.CHANNEL -IPCMAP_CHANNEL_COUNT = 16 -# Address of IPCMAP.CHANNEL[0] -IPCMAP_CHANNEL_START_ADDR = 0x5F92_3000 + 256 * 4 -# Address of IPCMAP.CHANNEL[channel count] + 1 -IPCMAP_CHANNEL_END_ADDR = IPCMAP_CHANNEL_START_ADDR + IPCMAP_CHANNEL_SIZE * IPCMAP_CHANNEL_COUNT - - if __name__ == "__main__": main() diff --git a/soc/nordic/common/uicr/periphconf/__init__.py b/soc/nordic/common/uicr/periphconf/__init__.py deleted file mode 100644 index fe8f6fbacece..000000000000 --- a/soc/nordic/common/uicr/periphconf/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Copyright (c) 2025 Nordic Semiconductor ASA -SPDX-License-Identifier: Apache-2.0 -""" - -# empty diff --git a/soc/nordic/common/uicr/periphconf/builder.py b/soc/nordic/common/uicr/periphconf/builder.py deleted file mode 100644 index 98c2bdfb0a0a..000000000000 --- a/soc/nordic/common/uicr/periphconf/builder.py +++ /dev/null @@ -1,1460 +0,0 @@ -""" -Copyright (c) 2025 Nordic Semiconductor ASA -SPDX-License-Identifier: Apache-2.0 -""" - -from __future__ import annotations - -import enum -import logging -import re -from collections.abc import Iterable, Iterator, Mapping -from dataclasses import dataclass -from functools import cached_property -from itertools import islice -from typing import ( - Any, - Literal, - NamedTuple, -) - -# edtlib classes used in this module. -# Defined this way as placeholders so type checking for these could be added later. -EDT = Any -Node = Any -PinCtrl = Any -Property = Any - -# Status values that indicate ownership either by the processor or a child processor -STATUS_OWNED = ("okay", "reserved") - -# Compatibles of global peripherals that should not be assigned to current core. -SKIP_SPU_PERIPH_PERM_COMPATS = { - "nordic,nrf-bellboard-tx", - "nordic,nrf-bellboard-rx", - "nordic,nrf-clic", - "nordic,nrf-dppic-global", - "nordic,nrf-gpio", - "nordic,nrf-gpiote", - "nordic,nrf-grtc", - "nordic,nrf-ipct-global", - "nordic,nrf-temp", - "nordic,nrf-vevif-task-tx", - "nordic,nrf-vevif-task-rx", -} - -# Compatibles of global peripherals that should be assigned to the current core but do not have DMA -NO_DMA_COMPATS = { - "nordic,nrf-auxpll", - "nordic,nrf-comp", - "nordic,nrf-egu", - "nordic,nrf-exmif", - "nordic,nrf-lpcomp", - "nordic,nrf-qdec", - "nordic,nrf-timer", - "nordic,nrf-rtc", - "nordic,nrf-wdt", - # VPRs have a PERM DMASEC setting, but PPR applications currently do not work as intended when - # setting it to secure. - "nordic,nrf-vpr-coprocessor", -} - - -class BuilderError(RuntimeError): - """Generic runtime error raised by the PeriphconfBuilder""" - - ... - - -class BadDevicetreeError(BuilderError): - """Error raised when the devicetree is misconfigured - or if assumptions about the devicetree are not met. - """ - - ... - - -def _init_logger() -> logging.Logger: - formatter = logging.Formatter("{message}", style="{") - handler = logging.StreamHandler() - handler.setFormatter(formatter) - - logger = logging.getLogger("periphconf") - logger.setLevel(logging.ERROR) - logger.addHandler(handler) - - return logger - - -# Logger for the script -log = _init_logger() - - -class PeriphconfBuilder: - def __init__( - self, - dt: EDT, - lookup_tables: SocLookupTables, - ) -> None: - """Builder class used to generate a PERIPHCONF C source file based on the devicetree. - - :param dt: Devicetree object. - :param lookup_tables: Lookup table object containing soc-specific information. - """ - - self._dt = dt - self._hw_tables = lookup_tables - self._processor_id = dt_processor_id(dt) - self._owner_id = self._processor_id.default_owner_id - - self._macros = [] - self._ipcmap_idx = 0 - self._generated_ipcmaps = set() - - self._nodelabel_lookup = { - dt_reg_addr(node): node.labels[0] for node in dt.nodes if node.regs and node.labels - } - - def build_generated_source(self, header_line: str | None = None) -> str: - """Generate a C source file containing all the macros generated through - calls to the API. - """ - source_lines = [] - - if header_line: - source_lines.extend([f"/* {header_line} */", ""]) - - source_lines.extend( - [ - "#include ", - "#include ", - "", - ] - ) - - for macro in sorted(self._macros): - source_lines.append(macro.c_render(self._nodelabel_lookup)) - - return "\n".join(source_lines) - - def add_local_peripheral_cfg( - self, - node_or_nodelabel: Node | str, - /, - ) -> None: - """Generate macros for populating PERIPHCONF based on the properties of a local domain - devicetree node. - - :param node_or_nodelabel: node or label of the node to process. - """ - self._add_peripheral_cfg(node_or_nodelabel, is_global=False, add_gpios=False) - - def add_global_peripheral_cfg( - self, - node_or_nodelabel: Node | str, - /, - *, - has_irq_mapping: bool = True, - add_ppib_channel_links: bool = True, - ) -> None: - """Generate macros for populating PERIPHCONF based on the properties of the given - devicetree node located in a global domain. - - :param node_or_nodelabel: node or label of the node to process. - :param has_irq_mapping: configure IRQMAP to map the peripheral IRQs to the processor the - devicetree belongs to, if interrupts are specified on the node. - :param add_ppib_channel_links: add PPIB connections based on the channel link properties of - the node. - """ - self._add_peripheral_cfg( - node_or_nodelabel, - is_global=True, - has_irq_mapping=has_irq_mapping, - add_ppib_channel_links=add_ppib_channel_links, - ) - - def _add_peripheral_cfg( - self, - node_or_nodelabel: Node | str, - is_global: bool = True, - has_irq_mapping: bool = True, - add_ppib_channel_links: bool = True, - add_gpios: bool = True, - ) -> None: - if isinstance(node_or_nodelabel, str): - node = self._dt.label2node[node_or_nodelabel] - else: - node = node_or_nodelabel - - if node.status not in STATUS_OWNED: - return - - if is_global: - has_skip_spu_periph_perm_compat = any( - compat in SKIP_SPU_PERIPH_PERM_COMPATS for compat in node.compats - ) - if not has_skip_spu_periph_perm_compat: - has_no_dma_compat = any(compat in NO_DMA_COMPATS for compat in node.compats) - self._add_global_peripheral_spu_permissions(node, has_dma=not has_no_dma_compat) - if has_irq_mapping: - self._add_global_peripheral_irq_mapping(node) - - if "nordic,nrf-gpiote" in node.compats: - self._add_nrf_gpiote_spu_permissions(node) - - if "nordic,nrf-dppic-global" in node.compats: - self._add_nrf_dppic_spu_permissions(node) - if add_ppib_channel_links: - self._add_nrf_dppic_ppib_links(node) - - if "nordic,nrf-ipct-global" in node.compats: - self._add_nrf_ipct_global_spu_permissions(node) - self._add_nrf_ipct_ipcmap_channel_links(node) - - if "nordic,nrf-grtc" in node.compats: - self._add_nrf_grtc_spu_permissions(node) - - if "nordic,nrf-saadc" in node.compats: - self._add_nrf_saadc_channel_pin_spu_permissions(node) - - if "nordic,nrf-comp" in node.compats or "nordic,nrf-lpcomp" in node.compats: - self._add_nrf_comp_lpcomp_channel_pin_spu_permissions(node) - - self._add_peripheral_pinctrls_spu_permissions_and_ctrlsel(node) - - if "nordic,nrf-ipct-local" in node.compats: - self._add_nrf_ipct_ipcmap_channel_links(node) - - if add_gpios: - self._add_peripheral_gpios_spu_permissions_and_ctrlsel(node) - - def add_gpio_spu_permissions(self, node_or_nodelabel: Node | str, /) -> None: - """Generate macros for populating SPU FEATURE.GPIO[n].PIN[m] registers based on - gpios properties on the given devicetree node. - - CTRLSEL is not set for these properties; it is assumed that the default CTRLSEL - value (GPIO) is the correct CTRLSEL for these pins. - - :param node_or_nodelabel: node or label of the node to process. - """ - if isinstance(node_or_nodelabel, str): - node = self._dt.label2node[node_or_nodelabel] - else: - node = node_or_nodelabel - - if node.status not in STATUS_OWNED: - return - - self._add_peripheral_gpios_spu_permissions_and_ctrlsel(node, skip_ctrlsel=True) - - def _add_global_peripheral_spu_permissions( - self, - node: Node, - has_dma: bool = True, - ) -> None: - """Adds an SPU PERIPH[n].PERM entry for the peripheral described by the node.""" - addr = dt_reg_addr(node) - secure = dt_node_is_secure(node) - if has_dma: - dma_secure = secure - else: - # If there is no DMA then the DMASEC field is not writable and reads as zero. - # Set to zero to avoid readback errors. - dma_secure = False - periph_label = node.labels[0] - - spu_address = get_spu_addr_for_periph(addr) - spu_name = self._hw_tables.spu_addr_to_name[spu_address] - parsed_addr = Address(addr) - periph_slave_index = parsed_addr.slave_index - - self._macros.append( - MacroCall( - "UICR_SPU_PERIPH_PERM_SET", - [ - Address(spu_address), - periph_slave_index, - secure, - dma_secure, - self._owner_id.c_enum, - ], - comment=f"{spu_name}: {periph_label} permissions", - ) - ) - - def _add_global_peripheral_irq_mapping(self, node: Node) -> None: - """Adds an IRQMAP[n].SINK entry for each interrupt on the - peripheral described by the node. - """ - periph_identifier = dt_node_identifier(node) - get_irqn_from_dt = bool(node.labels) - - for i, interrupt in enumerate(node.interrupts): - interrupt_processors = set() - interrupt_ctrl = interrupt.controller - - interrupt_processors.update(dt_node_processors_from_labels(interrupt_ctrl)) - - if not interrupt_processors: - interrupt_processors.update(dt_node_processors_from_labels(node)) - - if not interrupt_processors: - raise BuilderError( - f"No unique processor ID could be found based on interrupt controllers " - f"or nodelabels for peripheral node {node.path}" - ) - if len(interrupt_processors) > 1: - raise BuilderError( - f"Peripheral node {node.path} corresponds to multiple processors " - f"({interrupt_processors}), which is not supported." - ) - - irq_processor = next(iter(interrupt_processors)) - - if get_irqn_from_dt: - macro_irqn = f"DT_IRQN_BY_IDX(DT_NODELABEL({node.labels[0]}), {i})" - else: - macro_irqn = str(interrupt.data["irq"]) - - self._macros.append( - MacroCall( - "UICR_IRQMAP_IRQ_SINK_SET", - [ - macro_irqn, - irq_processor.c_enum, - ], - comment=f"{periph_identifier} IRQ => {irq_processor.name}", - ) - ) - - def _add_nrf_gpiote_spu_permissions(self, node: Node) -> None: - """Adds SPU FEATURE.GPIOTE[n].CH[m] entries for configured channels on the - GPIOTE peripheral described by the node. - """ - addr = dt_reg_addr(node) - instance_name = dt_node_identifier(node) - spu_address = get_spu_addr_for_periph(addr) - spu_name = self._hw_tables.spu_addr_to_name[spu_address] - - for num, secure in dt_split_channels_get(node): - self._macros.append( - MacroCall( - "UICR_SPU_FEATURE_GPIOTE_CH_SET", - [ - Address(spu_address), - 0, - num, - secure, - self._owner_id.c_enum, - ], - comment=f"{spu_name}: {instance_name} ch. {num} permissions", - ) - ) - - def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: - """Adds SPU FEATURE.DPPIC[n].CH[m] and SPU FEATURE.DPPIC[n].CHG[m] entries for - configured channels and channel groups on the DPPIC peripheral described by the node. - """ - addr = dt_reg_addr(node) - channels = dt_split_channels_get(node) - channel_groups = dt_split_channels_get( - node, - owned_name="owned-channel-groups", - nonsecure_name="nonsecure-channel-groups", - ) - - instance_name = dt_node_identifier(node) - spu_address = get_spu_addr_for_periph(addr) - spu_name = self._hw_tables.spu_addr_to_name[spu_address] - - for num, secure in channels: - self._macros.append( - MacroCall( - "UICR_SPU_FEATURE_DPPIC_CH_SET", - [ - Address(spu_address), - num, - secure, - self._owner_id.c_enum, - ], - comment=f"{spu_name}: {instance_name} ch. {num} permissions", - ) - ) - - for num, secure in channel_groups: - self._macros.append( - MacroCall( - "UICR_SPU_FEATURE_DPPIC_CHG_SET", - [ - Address(spu_address), - num, - secure, - self._owner_id.c_enum, - ], - comment=f"{spu_name}: {instance_name} ch. group {num} permissions", - ) - ) - - def _add_nrf_dppic_ppib_links(self, node: Node) -> None: - """Adds PPIB SUBSCRIBE_SEND[n] and PPIB PUBLISH_RECEIVE[n] entries for - configured "source" and "sink" channels on the DPPIC peripheral described by the node. - """ - addr = dt_reg_addr(node, secure=True) - source_channels = dt_array_prop(node, "source-channels", []) - sink_channels = dt_array_prop(node, "sink-channels", []) - - for num in source_channels: - self._link_dppi_channels(addr, num, direction="source") - - for num in sink_channels: - self._link_dppi_channels(addr, num, direction="sink") - - def _link_dppi_channels( - self, - dppic_addr: int, - channel_num: int, - direction: Literal["source"] | Literal["sink"], - ) -> None: - local_ppib_addr, local_ppib_ch_map = self._hw_tables.dppic_to_ppib_connections[dppic_addr] - local_ppib_ch = local_ppib_ch_map[channel_num] - - remote_ppib_addr, remote_ppib_ch_map = self._hw_tables.ppib_to_ppib_connections[ - local_ppib_addr - ] - remote_ppib_ch = remote_ppib_ch_map[local_ppib_ch] - - if direction == "source": - sub_ppib_addr, sub_ppib_ch = local_ppib_addr, local_ppib_ch - pub_ppib_addr, pub_ppib_ch = remote_ppib_addr, remote_ppib_ch - else: - sub_ppib_addr, sub_ppib_ch = remote_ppib_addr, remote_ppib_ch - pub_ppib_addr, pub_ppib_ch = local_ppib_addr, local_ppib_ch - - sub_ppib_name = self._hw_tables.ppib_addr_to_name[sub_ppib_addr] - pub_ppib_name = self._hw_tables.ppib_addr_to_name[pub_ppib_addr] - - self._macros.append( - MacroCall( - "UICR_PPIB_SUBSCRIBE_SEND_ENABLE", - [ - Address(sub_ppib_addr), - sub_ppib_ch, - ], - comment=( - f"SUB: {sub_ppib_name} ch. {sub_ppib_ch} => {pub_ppib_name} ch. {pub_ppib_ch}" - ), - ) - ) - self._macros.append( - MacroCall( - "UICR_PPIB_PUBLISH_RECEIVE_ENABLE", - [ - Address(pub_ppib_addr), - pub_ppib_ch, - ], - comment=( - f"PUB: {sub_ppib_name} ch. {sub_ppib_ch} => {pub_ppib_name} ch. {pub_ppib_ch}" - ), - ) - ) - - def _add_nrf_ipct_global_spu_permissions(self, node: Node) -> None: - """Adds SPU FEATURE.IPCT[n].CH[m] entries for configured channels - on the IPCT peripheral described by the node. - """ - addr = dt_reg_addr(node) - instance_name = dt_node_identifier(node) - spu_address = get_spu_addr_for_periph(addr) - spu_name = self._hw_tables.spu_addr_to_name[spu_address] - - for num, secure in dt_split_channels_get(node): - self._macros.append( - MacroCall( - "UICR_SPU_FEATURE_IPCT_CH_SET", - [ - Address(spu_address), - num, - secure, - self._owner_id.c_enum, - ], - comment=f"{spu_name}: {instance_name} ch. {num} permissions", - ) - ) - - def _add_nrf_ipct_ipcmap_channel_links(self, node: Node) -> None: - """Adds IPCMAP CHANNEL[n].SOURCE and CHANNEL[n].SINK entries for "sink" and "source" - channels on the IPCT peripheral described by the node. - """ - source_channel_links = dt_array_prop(node, "source-channel-links", []) - if len(source_channel_links) % 3 != 0: - raise BadDevicetreeError() - - sink_channel_links = dt_array_prop(node, "sink-channel-links", []) - if len(sink_channel_links) % 3 != 0: - raise BadDevicetreeError() - - node_domain_raw = dt_prop(node, "global-domain-id", None) - if node_domain_raw is None: - addr = dt_reg_addr(node) - try: - node_domain = Address(addr).domain - except ValueError as e: - raise BadDevicetreeError( - f"Failed to determine domain ID for address 0x{addr:08x} " - f"specified on node {node.path}" - ) from e - else: - node_domain = DomainId(node_domain_raw) - - for source_ch, sink_domain_raw, sink_ch in batched(source_channel_links, 3): - sink_domain = DomainId(sink_domain_raw) - self._link_ipct_channel(node_domain, source_ch, sink_domain, sink_ch) - - for sink_ch, source_domain_raw, source_ch in batched(sink_channel_links, 3): - source_domain = DomainId(source_domain_raw) - self._link_ipct_channel(source_domain, source_ch, node_domain, sink_ch) - - def _link_ipct_channel( - self, - source_domain: DomainId, - source_ch: int, - sink_domain: DomainId, - sink_ch: int, - ) -> None: - # Setting "source-channel-links" on one end and "sink-channel-links" on the other - # leads to duplicated entries without this check. - link_args = ( - source_domain.c_enum, - source_ch, - sink_domain.c_enum, - sink_ch, - ) - if link_args in self._generated_ipcmaps: - log.debug(f"Skip duplicate IPCMAP entry: {link_args}") - return - self._generated_ipcmaps.add(link_args) - - self._macros.append( - MacroCall( - "UICR_IPCMAP_CHANNEL_CFG", - [self._ipcmap_idx, *link_args], - comment=( - f"{source_domain.name} IPCT ch. {source_ch} => " - f"{sink_domain.name} IPCT ch. {sink_ch}" - ), - ) - ) - self._ipcmap_idx += 1 - - def _add_nrf_grtc_spu_permissions(self, node: Node) -> None: - """Adds SPU FEATURE.GRTC[n].CC[m] entries for configured channels - on the GRTC peripheral described by the node. - """ - grtc_addr = dt_reg_addr(node) - spu_address = get_spu_addr_for_periph(grtc_addr) - spu_name = self._hw_tables.spu_addr_to_name[spu_address] - - for num, secure in dt_split_channels_get(node): - self._macros.append( - MacroCall( - "UICR_SPU_FEATURE_GRTC_CC_SET", - [ - Address(spu_address), - num, - secure, - self._owner_id.c_enum, - ], - comment=f"{spu_name}: GRTC CC{num} permissions", - ) - ) - - def _add_peripheral_gpios_spu_permissions_and_ctrlsel( - self, - node: Node, - skip_ctrlsel: bool = False, - ) -> None: - """Adds SPU FEATURE.GPIO[n].PIN[m] and GPIO PIN_CNF[n] entries for - pins used in phandle-array properties called 'gpios' or ending in '-gpios' - found on the peripheral node. - """ - for name in node.props: - if not re.fullmatch(r"^(.+-)?gpios$", name): - continue - - if node.props[name].type != "phandle-array": - log.debug(f"skipping *-gpios prop {name} in {node.path} (not a phandle-array)") - continue - - for entry in dt_array_prop(node, name): - gpio_node = entry.controller - if "nordic,nrf-gpio" not in gpio_node.compats: - continue - - port = gpio_node.props["port"].val - num = entry.data["pin"] - secure = dt_node_is_secure(gpio_node) - if not skip_ctrlsel: - ctrlsel = self._hw_tables.lookup_ctrlsel_for_property( - node.props[name], (port, num) - ) - else: - ctrlsel = None - self._configure_gpio_pin(entry.controller, num, secure, ctrlsel) - - def _add_peripheral_pinctrls_spu_permissions_and_ctrlsel(self, node: Node) -> None: - """Adds SPU FEATURE.GPIO[n].PIN[m] and GPIO PIN_CNF[n] entries for - pins used in pinctrl properties referenced by the peripheral node. - """ - secure = dt_node_is_secure(node) - for pinctrl in node.pinctrls: - for config_node in pinctrl.conf_nodes: - for group_node in config_node.children.values(): - for i, psel_val in enumerate(dt_array_prop(group_node, "psels")): - psel = NrfPsel.from_raw(psel_val) - - if psel.is_disconnected(): - # Pin is unused and should be ignored - continue - - gpio_node = find_gpio_node_by_port( - node.edt, - psel.port, - err_suffix=f" (referenced by {group_node.path}:psels[{i}])", - ) - num = psel.pin - ctrlsel = self._hw_tables.lookup_ctrlsel_for_pinctrl(pinctrl, psel) - self._configure_gpio_pin(gpio_node, num, secure, ctrlsel) - - def _add_nrf_saadc_channel_pin_spu_permissions(self, node: Node) -> None: - """Adds SPU FEATURE.GPIO[n].PIN[m] and GPIO PIN_CNF[n] entries for - pins corresponding to the channel properties on the ADC peripheral node. - """ - saadc_addr = dt_reg_addr(node, secure=True) - if saadc_addr not in self._hw_tables.adc_channel_pin_lookup: - return - - channel_pins = self._hw_tables.adc_channel_pin_lookup[saadc_addr] - secure = dt_node_is_secure(node) - - for name, child in node.children.items(): - if not name.startswith("channel"): - continue - - for prop_name in ["zephyr,input-positive", "zephyr,input-negative"]: - prop_val = dt_prop(child, prop_name, None) - if prop_val in channel_pins: - port, num = channel_pins[prop_val] - gpio_node = find_gpio_node_by_port(node.edt, port) - self._configure_gpio_pin(gpio_node, num, secure, CTRLSEL_DEFAULT) - - def _add_nrf_comp_lpcomp_channel_pin_spu_permissions(self, node: Node) -> None: - """Adds SPU FEATURE.GPIO[n].PIN[m] and GPIO PIN_CNF[n] entries for - pins corresponding to the channel properties on the COMP/LPCOMP peripheral node. - """ - comp_addr = dt_reg_addr(node, secure=True) - if comp_addr not in self._hw_tables.comp_channel_pin_lookup: - return - - channel_pins = self._hw_tables.comp_channel_pin_lookup[comp_addr] - secure = dt_node_is_secure(node) - - for prop_name in ["psel", "extrefsel"]: - prop_val = dt_prop(node, prop_name, None) - if prop_val in channel_pins: - port, num = channel_pins[prop_val] - gpio_node = find_gpio_node_by_port(node.edt, port) - self._configure_gpio_pin(gpio_node, num, secure, CTRLSEL_DEFAULT) - - def _configure_gpio_pin( - self, - gpio_node: Node, - num: int, - secure: bool, - ctrlsel: int | None, - ) -> None: - gpio_addr = dt_reg_addr(gpio_node) - gpio_port = dt_prop(gpio_node, "port") - spu_address = get_spu_addr_for_periph(gpio_addr) - spu_name = self._hw_tables.spu_addr_to_name[spu_address] - - self._macros.append( - MacroCall( - "UICR_SPU_FEATURE_GPIO_PIN_SET", - [ - Address(spu_address), - gpio_port, - num, - secure, - self._owner_id.c_enum, - ], - comment=f"{spu_name}: P{gpio_port}.{num} permissions", - ) - ) - - if ctrlsel is not None: - ctrlsel_int = int(ctrlsel) - self._macros.append( - MacroCall( - "UICR_GPIO_PIN_CNF_CTRLSEL_SET", - [ - Address(gpio_addr), - num, - ctrlsel_int, - ], - comment=f"P{gpio_port}.{num} CTRLSEL = {ctrlsel_int}", - ) - ) - - -def find_gpio_node_by_port(dt: EDT, port: int, err_suffix: str = "") -> Node: - """Find the GPIO node in the devicetree with the given port.""" - for gpio_node in dt.compat2nodes["nordic,nrf-gpio"]: - if gpio_node.props["port"].val == port: - return gpio_node - raise BadDevicetreeError(f"Failed to find Nordic GPIO node with port {port}{err_suffix}") - - -@dataclass(order=True) -class MacroCall: - name: str - args: list - comment: str | None = None - - def c_render(self, nodelabel_lookup: dict[int, str]) -> str: - """Render the macro as C code""" - str_args = [] - for arg in self.args: - if isinstance(arg, Address): - if int(arg) in nodelabel_lookup: - str_args.append(c_dt_reg_addr_by_label(nodelabel_lookup[int(arg)])) - else: - str_args.append(c_hex_addr(int(arg))) - elif isinstance(arg, bool): - str_args.append(c_bool(arg)) - elif hasattr(arg, "c_enum"): - str_args.append(arg.c_enum) - else: - str_args.append(str(arg)) - - comment = f"/* {self.comment} */\n" if self.comment else "" - return f"{comment}{self.name}({', '.join(str_args)});" - - -def c_hex_addr(address: int) -> str: - """Format address as a C 32-bit hex literal.""" - return f"0x{address:08x}UL" - - -def c_bool(value: bool) -> str: - """Format value as a C bool literal.""" - return "true" if value else "false" - - -def c_dt_reg_addr_by_label(nodelabel: str) -> str: - """Format a peripheral address using devicetree macros to get the address based on node label""" - return f"DT_REG_ADDR(DT_NODELABEL({nodelabel}))" - - -# Equivalent to itertools.batched(), using the recipe provided in the docs. -def batched(iterable: Iterable, n: int, *, strict: bool = False) -> Iterator: - if n < 1: - raise ValueError("n must be at least one") - iterator = iter(iterable) - while batch := tuple(islice(iterator, n)): - if strict and len(batch) != n: - raise ValueError("batched(): incomplete batch") - yield batch - - -# Sentinel used to represent no provided default value in the functions below -class NoDefault: ... - - -NO_DEFAULT = NoDefault - - -def dt_reg_addr( - node: Node, - index: int = 0, - secure: bool = False, - default: int | type[NoDefault] = NO_DEFAULT, -) -> int: - """Get a register address and property identifier for a node.""" - try: - addr = node.regs[index].addr - except IndexError: - if isinstance(default, int): - addr = default - else: - raise - if secure: - return int(Address(addr).as_secure()) - return addr - - -def dt_reg_size(node: Node, index: int = 0) -> int: - """Get a register size and property identifier for a node.""" - return node.regs[index].size - - -def dt_prop(node: Node, name: str, default: Any = NO_DEFAULT) -> Any: - """Get the property value and identfier of a property. - Optionally returns a default value. - """ - try: - prop = node.props[name] - except KeyError: - if default != NO_DEFAULT: - return default - raise - - return prop.val - - -def dt_node_identifier(node: Node, default_to_path: bool = True) -> str: - """Get a string that identifies the node. - Returns the first nodelabel if it exists, otherwise defaults to the node path. - If default_to_path is False, exits with an error instead of defaulting. - """ - if node.labels: - return node.labels[0] - elif default_to_path: - return node.path - raise BuilderError(f"Expected a nodelabel on {node}, but the node has no label") - - -def dt_array_prop( - node: Node, - name: str, - default: list[Any] | type[NO_DEFAULT] = NO_DEFAULT, -) -> list[Any]: - """Get the member values and identifiers of an array property. - Optionally returns a default value. - """ - try: - prop = node.props[name] - except KeyError: - if not isinstance(default, type): - return list(default) - raise - - return list(prop.val) - - -def dt_node_processors_from_labels(node: Node) -> list[ProcessorId]: - """Deduce a processor ID from a list of devicetree nodelabels.""" - substring_processor = {cpu.zephyr_name: cpu for cpu in ProcessorId.__members__.values()} - processors = set() - for substring, processor_id in substring_processor.items(): - if any(substring in label for label in node.labels): - processors.add(processor_id) - return list(processors) - - -def dt_split_channels_get( - node: Node, - owned_name: str = "owned-channels", - nonsecure_name: str = "nonsecure-channels", -) -> list[tuple[int, bool]]: - """Parse 'split channels' properties.""" - owned = [] - owned.extend(dt_array_prop(node, owned_name, default=[])) - owned.extend(dt_array_prop(node, f"child-{owned_name}", default=[])) - - sec_lookup = {} - if nonsecure_name in node.props: - nonsecure = dt_array_prop(node, nonsecure_name) - sec_lookup.update(dict.fromkeys(nonsecure, False)) - - default_sec = dt_node_is_secure(node) - channels = [] - for ch in owned: - sec = sec_lookup.setdefault(ch, default_sec) - channels.append((ch, sec)) - - return channels - - -def dt_node_is_secure(node: Node) -> bool: - if node.bus_node is not None and node.bus_node.regs: - addr = dt_reg_addr(node.bus_node) - elif node.regs: - addr = dt_reg_addr(node) - else: - raise ValueError( - f"Failed to determine security of {node.path} " - "from the address of its bus node or itself" - ) - return Address(addr).security - - -def dt_processor_id(devicetree: EDT) -> ProcessorId: - """Get processor information from a domain's devicetree.""" - cpus = [ - node - for node in devicetree.get_node("/cpus").children.values() - if node.name.startswith("cpu@") - ] - if len(cpus) != 1: - raise RuntimeError( - f"Expected exactly 1 'cpu' node, but devicetree contained {len(cpus)} nodes" - ) - - try: - return ProcessorId(cpus[0].regs[0].addr) - except Exception as e: - raise RuntimeError( - f"Devicetree 'cpu' node has invalid Processor ID {cpus[0].regs[0].addr}" - ) from e - - -@dataclass(frozen=True) -class NrfPsel: - """Decoded NRF_PSEL values.""" - - fun: NrfFun - port: int - pin: int - - @classmethod - def from_raw(cls, psel_value: int) -> NrfPsel: - """Decode a raw NRF_PSEL encoded int value to its individual parts.""" - port, pin = divmod(psel_value & (~NRF_PSEL_FUN_MASK), NRF_PSEL_GPIO_PIN_COUNT) - fun = (psel_value & NRF_PSEL_FUN_MASK) >> NRF_PSEL_FUN_POS - return NrfPsel(fun=NrfFun(fun), port=port, pin=pin) - - def is_disconnected(self) -> bool: - """True if the value represents a disconnected pin""" - return (self.port * NRF_PSEL_GPIO_PIN_COUNT + self.pin) == NRF_PSEL_PIN_MASK - - -# # Bit position of the function bits in the pinctrl pin value encoded from NRF_PSEL() -NRF_PSEL_FUN_POS = 24 -# # Mask for the function bits in the pinctrl pin value encoded from NRF_PSEL() -NRF_PSEL_FUN_MASK = 0xFF << NRF_PSEL_FUN_POS -# Number of pins per port used in NRF_PSEL() -NRF_PSEL_GPIO_PIN_COUNT = 32 -# Mask for the port, pin bits in the pinctrl pin value encoded from NRF_PSEL() -NRF_PSEL_PIN_MASK = 0x1FF - - -@dataclass(frozen=True) -class GpiosProp: - """CTRLSEL lookup table entry for special *-gpios properties used in some peripheral - bindings, which are in some cases used instead of pinctrl. - """ - - name: str - port: int - pin: int - - -@enum.unique -class Ctrlsel(int, enum.Enum): - """ - Enumeration of GPIO.PIN_CNF[n].CTRLSEL values. - The list here may not be exhaustive. - """ - - GPIO = 0 - VPR_GRC = 1 - CAN_PWM_I3C = 2 - SERIAL0 = 3 - EXMIF_RADIO_SERIAL1 = 4 - CAN_TDM_SERIAL2 = 5 - CAN = 6 - TND = 7 - - -# Default CTRLSEL value indicating that CTRLSEL should not be used -CTRLSEL_DEFAULT = Ctrlsel.GPIO - - -class NrfFun(int, enum.Enum): - """Pin functions used with pinctrl, see include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h - Only the functions relevant for CTRLSEL deduction have been included. - """ - - UART_TX = 0 - UART_RX = 1 - UART_RTS = 2 - UART_CTS = 3 - SPIM_SCK = 4 - SPIM_MOSI = 5 - SPIM_MISO = 6 - SPIS_SCK = 7 - SPIS_MOSI = 8 - SPIS_MISO = 9 - SPIS_CSN = 10 - TWIM_SCL = 11 - TWIM_SDA = 12 - PWM_OUT0 = 22 - PWM_OUT1 = 23 - PWM_OUT2 = 24 - PWM_OUT3 = 25 - EXMIF_CK = 35 - EXMIF_DQ0 = 36 - EXMIF_DQ1 = 37 - EXMIF_DQ2 = 38 - EXMIF_DQ3 = 39 - EXMIF_DQ4 = 40 - EXMIF_DQ5 = 41 - EXMIF_DQ6 = 42 - EXMIF_DQ7 = 43 - EXMIF_CS0 = 44 - EXMIF_CS1 = 45 - CAN_TX = 46 - CAN_RX = 47 - TWIS_SCL = 48 - TWIS_SDA = 49 - EXMIF_RWDS = 50 - GRTC_CLKOUT_FAST = 55 - GRTC_CLKOUT_32K = 56 - TDM_SCK_M = 71 - TDM_SCK_S = 72 - TDM_FSYNC_M = 73 - TDM_FSYNC_S = 74 - TDM_SDIN = 75 - TDM_SDOUT = 76 - TDM_MCK = 77 - - # Value used to ignore the function field and only check (port, pin) - IGNORE = -1 - # Fallback for unknown NrfFun values, assumes that pin CTRLSEL should be set to GPIO - ASSUMED_GPIO = -2 - - @classmethod - def _missing_(cls, value: Any) -> NrfFun: - return cls.ASSUMED_GPIO - - -class NrfSaadcChannel(int, enum.Enum): - """Identifiers representing SAADC channels. - See include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h. - """ - - AIN0 = 1 - AIN1 = 2 - AIN2 = 3 - AIN3 = 4 - AIN4 = 5 - AIN5 = 6 - AIN6 = 7 - AIN7 = 8 - AIN8 = 9 - AIN9 = 10 - AIN10 = 11 - AIN11 = 12 - AIN12 = 13 - AIN13 = 14 - - -class NrfCompChannel(str, enum.Enum): - """Identifiers representing COMP/LPCOMP channels. - See dts/bindings/comparator/nordic,nrf-comp.yaml. - """ - - AIN0 = "AIN0" - AIN1 = "AIN1" - AIN2 = "AIN2" - AIN3 = "AIN3" - AIN4 = "AIN4" - AIN5 = "AIN5" - AIN6 = "AIN6" - AIN7 = "AIN7" - AIN8 = "AIN8" - AIN9 = "AIN9" - - -class FixedPPIMap(NamedTuple): - """A DPPIC-PPIB or PPIB-PPIB channel mapping. - These connections are fixed in the hardware. - """ - - connected_to: int - channel_map: range - - -@dataclass -class SocLookupTables: - """Container for various hardware info needed to generate PERIPHCONF.""" - - ctrlsel_lookup: dict[int, dict[NrfPsel | GpiosProp, Ctrlsel]] - adc_channel_pin_lookup: dict[int, dict[NrfSaadcChannel, tuple[int, int]]] - comp_channel_pin_lookup: dict[int, dict[NrfCompChannel, tuple[int, int]]] - dppic_to_ppib_connections: dict[int, FixedPPIMap] - ppib_to_ppib_connections: dict[int, FixedPPIMap] - spu_instances: list[tuple[str, int]] - ppib_instances: list[tuple[str, int]] - - @cached_property - def spu_addr_to_name(self) -> Mapping[int, str]: - return {addr: name for name, addr in self.spu_instances} - - @cached_property - def ppib_addr_to_name(self) -> Mapping[int, str]: - return {addr: name for name, addr in self.ppib_instances} - - def lookup_ctrlsel_for_property(self, prop: Property, psel: tuple[int, int]) -> Ctrlsel | None: - """Find the appopriate CTRLSEL value for a given gpios property.""" - if not prop.node.regs: - # Only nodes with registers can be looked up - return None - - periph_addr = dt_reg_addr(prop.node, secure=True) - gpios_prop = GpiosProp(name=prop.name, port=psel[0], pin=psel[1]) - return self._lookup_ctrlsel(periph_addr, gpios_prop) - - def lookup_ctrlsel_for_pinctrl(self, prop: PinCtrl, psel: NrfPsel) -> Ctrlsel | None: - """Find the appopriate CTRLSEL value for a given pinctrl.""" - if psel.fun == NrfFun.ASSUMED_GPIO: - # We map unsupported values to GPIO CTRLSEL - return CTRLSEL_DEFAULT - - periph_addr = dt_reg_addr(prop.node, secure=True) - return self._lookup_ctrlsel(periph_addr, psel) - - def _lookup_ctrlsel( - self, - periph_addr: int, - prop_or_psel: NrfPsel | GpiosProp, - ) -> Ctrlsel | None: - ctrlsel = None - - if periph_addr in self.ctrlsel_lookup: - ident_lut = self.ctrlsel_lookup[periph_addr] - if prop_or_psel in ident_lut: - ctrlsel = ident_lut[prop_or_psel] - elif isinstance(prop_or_psel, NrfPsel): - # Check if this entry is enumerated with "ignored" function - sub_entry_no_fun = NrfPsel( - fun=NrfFun.IGNORE, port=prop_or_psel.port, pin=prop_or_psel.pin - ) - ctrlsel = ident_lut.get(sub_entry_no_fun, None) - - log.debug(f"periph_addr=0x{periph_addr:09_x}, {prop_or_psel=} -> {ctrlsel=}") - - return ctrlsel - - -def get_spu_addr_for_periph(periph_addr: int) -> int: - """Get the address of the SPU instance governing the permissions for the peripheral - at the given address. - """ - address = Address(periph_addr) - - # The common rule is that the SPU instance sits at the start of the address space for - # the bus of the peripheral. - address.security = True - address.slave_index = 0 - address.address_space = 0 - - # However, some buses are special due to having > 16 slaves and need special handling. - address.bus = SPU_ADDRESS_BUS_REMAPPING.get(address.bus, address.bus) - - return int(address) - - -SPU_ADDRESS_BUS_REMAPPING = { - # Both of these bus IDs represent APB32 and should use the same SPU instance with bus ID 146. - 147: 146, -} - - -@enum.unique -class DomainId(enum.IntEnum): - """Domain IDs.""" - - RESERVED = 0 - SECURE = 1 - APPLICATION = 2 - RADIOCORE = 3 - CELLCORE = 4 - GLOBALFAST = 12 - GLOBALSLOW = 13 - GLOBAL_ = 14 - GLOBAL = 15 - - @property - def c_enum(self) -> str: - return f"NRF_DOMAIN_{self.name.upper()}" - - -@enum.unique -class OwnerId(enum.IntEnum): - """Owner IDs.""" - - NONE = 0 - SECURE = 1 - APPLICATION = 2 - RADIOCORE = 3 - CELL = 4 - SYSCTRL = 8 - - @property - def c_enum(self) -> str: - return f"NRF_OWNER_{self.name.upper()}" - - -@enum.unique -class ProcessorId(enum.IntEnum): - """Processor IDs.""" - - SECURE = 1 - APPLICATION = 2 - RADIOCORE = 3 - CELLCORE = 4 - SYSCTRL = 12 - PPR = 13 - FLPR = 14 - - @property - def zephyr_name(self) -> str: - """Name used in zephyr to denote the processor with this ID.""" - match self: - case ProcessorId.SECURE: - return "cpusec" - case ProcessorId.APPLICATION: - return "cpuapp" - case ProcessorId.RADIOCORE: - return "cpurad" - case ProcessorId.CELLCORE: - return "cpucell" - case ProcessorId.SYSCTRL: - return "cpusys" - case ProcessorId.PPR: - return "cpuppr" - case ProcessorId.FLPR: - return "cpuflpr" - - @property - def default_owner_id(self) -> OwnerId: - """Default owner ID associated with this ID (the ID used by accesses from the processor).""" - match self: - case ProcessorId.SECURE: - return OwnerId.SECURE - case ProcessorId.APPLICATION: - return OwnerId.APPLICATION - case ProcessorId.RADIOCORE: - return OwnerId.RADIOCORE - case ProcessorId.CELLCORE: - return OwnerId.CELL - case ProcessorId.SYSCTRL: - return OwnerId.SYSCTRL - case ProcessorId.PPR: - return OwnerId.APPLICATION - case ProcessorId.FLPR: - return OwnerId.APPLICATION - - @property - def c_enum(self) -> str: - return f"NRF_PROCESSOR_{self.name.upper()}" - - -@enum.unique -class AddressRegion(enum.IntEnum): - """Address regions, defined by Address Format of the data sheet.""" - - PROGRAM = 0 - DATA = 1 - PERIPHERAL = 2 - EXT_XIP = 3 - EXT_XIP_ENCRYPTED = 4 - STM = 5 - CPU = 7 - - @classmethod - def from_address(cls, address: int) -> AddressRegion: - """Get the address region of an address.""" - return Address(address).region - - -# Regions that have domain ID and security fields -HAS_DOMAIN_SECURITY = [ - AddressRegion.PROGRAM, - AddressRegion.DATA, - AddressRegion.PERIPHERAL, - AddressRegion.STM, -] - -# Regions that have the peripheral address format -HAS_PERIPH_BITS = [ - AddressRegion.PERIPHERAL, - AddressRegion.STM, -] - - -class Address: - """Helper for working with addresses.""" - - def __init__(self, value: int | Address = 0) -> None: - self._val = int(value) - - def __repr__(self) -> str: - if self.region in HAS_DOMAIN_SECURITY: - domain_sec_str = ( - f", domain={self.domain.name} ({int(self.domain)}), security={self.security}" - ) - else: - domain_sec_str = "" - - if self.region in HAS_PERIPH_BITS: - periph_bits_str = ( - f", bus={self.bus} (0b{self.bus:09_b}), " - f"slave_index={self.slave_index} (0b{self.slave_index:09_b})" - ) - else: - periph_bits_str = "" - - field_str = ( - f"region={self.region.name} ({int(self.region)}){domain_sec_str}{periph_bits_str}, " - f"address_space=0x{self.address_space:_x}" - ) - - return f"{type(self).__name__}({field_str})" - - def __str__(self) -> str: - return repr(self) - - def as_secure(self) -> Address: - addr = Address(self) - addr.security = True - return addr - - @property - def region(self) -> AddressRegion: - """Address region.""" - return AddressRegion(get_field(self._val, ADDRESS_REGION_POS, ADDRESS_REGION_MASK)) - - @region.setter - def region(self, new: int) -> None: - self._val = update_field(self._val, new, ADDRESS_REGION_POS, ADDRESS_REGION_MASK) - - @property - def security(self) -> bool: - """Address security (only present in some regions).""" - self._check_has_security() - return bool(get_field(self._val, ADDRESS_SECURITY_POS, ADDRESS_SECURITY_MASK)) - - @security.setter - def security(self, new: bool) -> None: - self._check_has_security() - self._val = update_field(self._val, int(new), ADDRESS_SECURITY_POS, ADDRESS_SECURITY_MASK) - - def _check_has_security(self) -> None: - self._check_region_has_field(HAS_DOMAIN_SECURITY, "security bit") - - @property - def domain(self) -> DomainId: - """Address domain ID (only present in some regions).""" - self._check_has_domain_id() - return DomainId(get_field(self._val, ADDRESS_DOMAIN_POS, ADDRESS_DOMAIN_MASK)) - - @domain.setter - def domain(self, new: DomainId | int) -> None: - self._check_has_domain_id() - self._val = update_field(self._val, new, ADDRESS_DOMAIN_POS, ADDRESS_DOMAIN_MASK) - - def _check_has_domain_id(self) -> None: - self._check_region_has_field(HAS_DOMAIN_SECURITY, "domain ID") - - @property - def bus(self) -> int: - """Bus ID (only present in some regions).""" - self._check_has_bus() - return get_field(self._val, ADDRESS_BUS_POS, ADDRESS_BUS_MASK) - - @bus.setter - def bus(self, new: int) -> None: - self._check_has_bus() - self._val = update_field(self._val, new, ADDRESS_BUS_POS, ADDRESS_BUS_MASK) - - def _check_has_bus(self) -> None: - self._check_region_has_field(HAS_PERIPH_BITS, "Peripheral/APB bus number") - - @property - def slave_index(self) -> int: - """Slave index (only present in some regions).""" - self._check_has_slave_index() - return get_field(self._val, ADDRESS_SLAVE_POS, ADDRESS_SLAVE_MASK) - - @slave_index.setter - def slave_index(self, new: int) -> None: - self._check_has_slave_index() - self._val = update_field(self._val, new, ADDRESS_SLAVE_POS, ADDRESS_SLAVE_MASK) - - def _check_has_slave_index(self) -> None: - self._check_region_has_field(HAS_PERIPH_BITS, "Peripheral/APB slave index") - - @property - def address_space(self) -> int: - """Internal address space address (semantics depend on the region).""" - match self.region: - case AddressRegion.PROGRAM | AddressRegion.DATA: - return get_field(self._val, ADDRESS_SPACE_POS, ADDRESS_PROGRAM_DATA_SPACE_MASK) - case AddressRegion.PERIPHERAL | AddressRegion.STM: - return get_field(self._val, ADDRESS_SPACE_POS, ADDRESS_PERIPHERAL_SPACE_MASK) - case _: - return get_field(self._val, ADDRESS_SPACE_POS, ADDRESS_DEFAULT_SPACE_MASK) - - @address_space.setter - def address_space(self, new: int) -> None: - match self.region: - case AddressRegion.PROGRAM | AddressRegion.DATA: - self._val = update_field( - self._val, new, ADDRESS_SPACE_POS, ADDRESS_PROGRAM_DATA_SPACE_MASK - ) - case AddressRegion.PERIPHERAL | AddressRegion.STM: - self._val = update_field( - self._val, new, ADDRESS_SPACE_POS, ADDRESS_PERIPHERAL_SPACE_MASK - ) - case _: - self._val = update_field( - self._val, new, ADDRESS_SPACE_POS, ADDRESS_DEFAULT_SPACE_MASK - ) - - def _check_region_has_field(self, valid_regions: list[AddressRegion], field_name: str) -> None: - if self.region not in valid_regions: - raise ValueError(f"{field_name} is not defined for address region {self.region.name}") - - def __eq__(self, other) -> bool: - return int(self) == int(other) - - def __lt__(self, other: Address | int) -> bool: - return int(self) < int(other) - - def __int__(self) -> int: - return self._val - - -ADDRESS_REGION_POS = 29 -ADDRESS_REGION_MASK = 0x7 << ADDRESS_REGION_POS -ADDRESS_SECURITY_POS = 28 -ADDRESS_SECURITY_MASK = 0x1 << ADDRESS_SECURITY_POS -ADDRESS_DOMAIN_POS = 24 -ADDRESS_DOMAIN_MASK = 0xF << ADDRESS_DOMAIN_POS -ADDRESS_BUS_POS = 16 -ADDRESS_BUS_MASK = 0xFF << ADDRESS_BUS_POS -ADDRESS_SLAVE_POS = 12 -ADDRESS_SLAVE_MASK = 0xF << ADDRESS_SLAVE_POS -ADDRESS_PERIPHID_POS = 12 -ADDRESS_PERIPHID_MASK = 0x7FF << ADDRESS_PERIPHID_POS -ADDRESS_SPACE_POS = 0 -ADDRESS_PROGRAM_DATA_SPACE_MASK = 0xFF_FFFF -ADDRESS_PERIPHERAL_SPACE_MASK = 0xFFF -ADDRESS_DEFAULT_SPACE_MASK = 0x1FFF_FFFF - - -def peripheral_id_get(periph_address: int) -> int: - """Get the peripheral ID of a peripheral address.""" - return get_field(periph_address, ADDRESS_PERIPHID_POS, ADDRESS_PERIPHID_MASK) - - -def get_field(value: int, field_pos: int, field_mask: int) -> int: - """Get the value of a field in a bitfield.""" - return (value & field_mask) >> field_pos - - -def update_field(value: int, field_new: int, field_pos: int, field_mask: int) -> int: - """Update a field in a bitfield.""" - return (value & ~field_mask) | ((field_new << field_pos) & field_mask) From 9adae2c3b4aec00ff5089d0064154b68ea5074fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1493/3334] Revert "[nrf fromtree] drivers: audio: Fix nrfx_pdm compilation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 89948709e8fd6f0a05c41762d4c886efd03f4f9e. Signed-off-by: Tomasz Moń --- drivers/audio/dmic_nrfx_pdm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index c2c80a7414c1..f0162fc5ef8b 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -668,12 +668,11 @@ static int dmic_nrfx_pdm_read(const struct device *dev, static void init_clock_manager(const struct device *dev) { -#if DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) struct dmic_nrfx_pdm_drv_data *drv_data = dev->data; +#if DT_NODE_HAS_STATUS_OKAY(NODE_AUDIO_AUXPLL) drv_data->audiopll_dev = DEVICE_DT_GET(NODE_AUDIO_AUXPLL); #elif CONFIG_CLOCK_CONTROL_NRF clock_control_subsys_t subsys; - struct dmic_nrfx_pdm_drv_data *drv_data = dev->data; #if NRF_CLOCK_HAS_HFCLKAUDIO const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; From 3f1fe16740fb4e9275d78ae23a5dd37cf74a9f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1494/3334] Revert "[nrf fromtree] soc: nordic: uicr: Fix dependency issue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cc061607c4c100e224cf6ae1e5da5bbab69f9ff5. Signed-off-by: Tomasz Moń --- soc/nordic/common/uicr/sysbuild.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/soc/nordic/common/uicr/sysbuild.cmake b/soc/nordic/common/uicr/sysbuild.cmake index 9cafd261036d..167ac7c64a2d 100644 --- a/soc/nordic/common/uicr/sysbuild.cmake +++ b/soc/nordic/common/uicr/sysbuild.cmake @@ -8,8 +8,4 @@ ExternalZephyrProject_Add( # Ensure UICR is configured and built after the default image so EDT/ELFs exist. sysbuild_add_dependencies(CONFIGURE uicr ${DEFAULT_IMAGE}) - add_dependencies(uicr ${DEFAULT_IMAGE}) -if(DEFINED image) - add_dependencies(uicr ${image}) -endif() From 7924944122dfa62e31bcde4020398421012e2762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1495/3334] Revert "[nrf fromtree] net: websocket: Allow using PSA APIs to calculate SHA1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit eb3d6f1faa564cc214a88f22f1f6b14c5f103882. Signed-off-by: Tomasz Moń --- subsys/net/lib/websocket/websocket.c | 45 ++-------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/subsys/net/lib/websocket/websocket.c b/subsys/net/lib/websocket/websocket.c index d682fd4b5dc2..2efb16bfac89 100644 --- a/subsys/net/lib/websocket/websocket.c +++ b/subsys/net/lib/websocket/websocket.c @@ -34,12 +34,7 @@ LOG_MODULE_REGISTER(net_websocket, CONFIG_NET_WEBSOCKET_LOG_LEVEL); #include #include #include - -#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT -#include -#else #include -#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT */ #include "net_private.h" #include "sockets_internal.h" @@ -258,10 +253,6 @@ int websocket_connect(int sock, struct websocket_request *wreq, "Sec-WebSocket-Version: 13\r\n", NULL }; -#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT - psa_status_t psa_status; - size_t hash_length; -#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT */ fd = -1; @@ -289,23 +280,8 @@ int websocket_connect(int sock, struct websocket_request *wreq, ctx->http_cb = wreq->http_cb; ctx->is_client = 1; -#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT - psa_status = psa_hash_compute(PSA_ALG_SHA_1, (const uint8_t *)&rnd_value, sizeof(rnd_value), - sec_accept_key, sizeof(sec_accept_key), &hash_length); - if (psa_status != PSA_SUCCESS) { - NET_DBG("[%p] Cannot calculate sha1 (%d)", ctx, psa_status); - ret = -EPROTO; - goto out; - } -#else - ret = mbedtls_sha1((const unsigned char *)&rnd_value, sizeof(rnd_value), sec_accept_key); - if (ret != 0) { - NET_DBG("[%p] Cannot calculate sha1 (%d)", ctx, ret); - ret = -EPROTO; - goto out; - } -#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT */ - + mbedtls_sha1((const unsigned char *)&rnd_value, sizeof(rnd_value), + sec_accept_key); ret = base64_encode(sec_ws_key + sizeof("Sec-Websocket-Key: ") - 1, sizeof(sec_ws_key) - @@ -368,22 +344,7 @@ int websocket_connect(int sock, struct websocket_request *wreq, strncpy(key_accept + key_len, WS_MAGIC, olen); /* This SHA-1 value is then checked when we receive the response */ -#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT - psa_status = psa_hash_compute(PSA_ALG_SHA_1, (const uint8_t *)key_accept, olen + key_len, - sec_accept_key, sizeof(sec_accept_key), &hash_length); - if (psa_status != PSA_SUCCESS) { - NET_DBG("[%p] Cannot calculate sha1 (%d)", ctx, psa_status); - ret = -EPROTO; - goto out; - } -#else - ret = mbedtls_sha1(key_accept, olen + key_len, sec_accept_key); - if (ret != 0) { - NET_DBG("[%p] Cannot calculate sha1 (%d)", ctx, ret); - ret = -EPROTO; - goto out; - } -#endif /* CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT */ + mbedtls_sha1(key_accept, olen + key_len, sec_accept_key); ret = http_client_req(sock, &req, timeout, ctx); if (ret < 0) { From fa9ac37481ab24969d76f241f61541321af48376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1496/3334] Revert "[nrf fromtree] lib: os: clock: Fix possibly unitialized variable warning" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fbb5f210badc7b4bc4902c83d362778683054ba4. Signed-off-by: Tomasz Moń --- lib/os/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/os/clock.c b/lib/os/clock.c index 2b9968b2eeb4..0d5813f49fef 100644 --- a/lib/os/clock.c +++ b/lib/os/clock.c @@ -158,7 +158,7 @@ int z_impl_sys_clock_nanosleep(int clock_id, int flags, const struct timespec *r { k_timepoint_t end; k_timeout_t timeout; - struct timespec duration = {0, 0}; + struct timespec duration; const bool update_rmtp = rmtp != NULL; const bool abstime = (flags & SYS_TIMER_ABSTIME) != 0; From 5256bcfd45997d9c579b08e6e7f3242f7029fa82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1497/3334] Revert "[nrf fromtree] tests: kernel: sleep: Adjustments for NRF54H20 PPR" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aae81ddfaa2a7a76c9ecd9541673a6c6329c6cb0. Signed-off-by: Tomasz Moń --- tests/kernel/sleep/src/usleep.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/kernel/sleep/src/usleep.c b/tests/kernel/sleep/src/usleep.c index a7c212e59b96..8a234a27a199 100644 --- a/tests/kernel/sleep/src/usleep.c +++ b/tests/kernel/sleep/src/usleep.c @@ -42,11 +42,6 @@ * loaded to its comparator. */ #define MAXIMUM_SHORTEST_TICKS 2 -#elif defined(CONFIG_SOC_NRF54H20_CPUPPR) && (CONFIG_SYS_CLOCK_TICKS_PER_SEC > 16384) -/* Similar for nRF54H20 cpuppr (RISC-V core), it has a slow CPU clock - * compared to other cores, causing the increased overhead. - */ -#define MAXIMUM_SHORTEST_TICKS 4 #else #define MAXIMUM_SHORTEST_TICKS 1 #endif From cf03aa267688329edb2104b7757b5e5f7b3f605e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1498/3334] Revert "[nrf fromlist] manifest: update hal_nordic revision to integrate MDK 8.72.3" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3fb675414a29edceaa3d7f672df23c1d1fb9f740. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index d0e76dbc5760..bcef02412e50 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: d0cef2363e572679deba0e796ef6c77f1188bb04 + revision: 54f33f10a0b826174fb145f155afa61ce5a44b93 path: modules/hal/nordic groups: - hal From 763c3cfdbb43fbc9ece9164797bbc716e892ccc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1499/3334] Revert "[nrf fromtree] dts: nrf54h20: Add zephyr,pm-device-runtime-auto; to uart instances" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 69a3093a3040cbae127c78a4721226c5c2f6e8b3. Signed-off-by: Tomasz Moń --- dts/vendor/nordic/nrf54h20.dtsi | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 70dd5809ba0b..b6bf93238b49 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -733,7 +733,6 @@ power-domains = <&gdpwr_fast_active_1>; endtx-stoptx-supported; frame-timeout-supported; - zephyr,pm-device-runtime-auto; }; spi121: spi@8e7000 { @@ -1142,7 +1141,6 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; - zephyr,pm-device-runtime-auto; }; i2c131: i2c@9a6000 { @@ -1278,7 +1276,6 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; - zephyr,pm-device-runtime-auto; }; i2c133: i2c@9b6000 { @@ -1325,7 +1322,6 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; - zephyr,pm-device-runtime-auto; }; dppic135: dppic@9c1000 { @@ -1414,7 +1410,6 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; - zephyr,pm-device-runtime-auto; }; i2c135: i2c@9c6000 { @@ -1461,7 +1456,6 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; - zephyr,pm-device-runtime-auto; }; dppic136: dppic@9d1000 { @@ -1597,7 +1591,6 @@ nordic,clockpin-enable = ; endtx-stoptx-supported; frame-timeout-supported; - zephyr,pm-device-runtime-auto; }; tdm130: tdm@992000 { From c88057bdbcb37d833acaa80d2ad6747920ffb668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1500/3334] Revert "[nrf fromlist] tests: drivers: timer: nrf_grtc_timer: wait for coverage dump" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 69358d4fc1eb7d548bb45d77351321e4aefee09e. Signed-off-by: Tomasz Moń --- tests/drivers/timer/nrf_grtc_timer/src/main.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index bcb57519f3b4..e411eba83a0b 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -393,13 +393,6 @@ static void grtc_stress_test(bool busy_sim_en) if (counter_dev) { counter_stop(counter_dev); } - -#ifdef CONFIG_COVERAGE - /* Wait a few seconds before exit, giving the test the - * opportunity to dump some output before coverage data gets emitted - */ - k_sleep(K_MSEC(5000)); -#endif } ZTEST(nrf_grtc_timer, test_stress) From a33fc7c74738779a25b1ecb0d4a4c94ad4fd60c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1501/3334] Revert "[nrf fromlist] tests: drivers: timer: nrf_grtc_timer: Add stress test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e2e8824c04b0a4bb842e5593e3fc350311fadc1a. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 17 -- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 32 --- .../nrf54l15dk_nrf54l15_cpuflpr.overlay | 32 --- tests/drivers/timer/nrf_grtc_timer/prj.conf | 6 - tests/drivers/timer/nrf_grtc_timer/src/main.c | 247 ------------------ .../timer/nrf_grtc_timer/testcase.yaml | 37 ++- 6 files changed, 16 insertions(+), 355 deletions(-) delete mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 7ae959267039..04580b71480b 100644 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -2,21 +2,4 @@ &grtc { /delete-property/ child-owned-channels; - interrupts = <109 2>; -}; - -test_timer: &timer131 { - status = "okay"; - interrupts = <419 1>; -}; - -&timer130 { - status = "okay"; - prescaler = <0>; -}; - -/ { - chosen { - zephyr,cpu-load-counter = &timer130; - }; }; diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 7bcede529b0e..000000000000 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&grtc { - interrupts = <228 2>; -}; - -test_timer: &timer21 { - status = "okay"; - interrupts = <203 1>; -}; - -&timer20 { - status = "okay"; - interrupts = <202 0>; -}; - -&timer00 { - status = "okay"; - prescaler = <0>; -}; - -/ { - chosen { - zephyr,cpu-load-counter = &timer00; - }; - - busy-sim { - compatible = "vnd,busy-sim"; - status = "okay"; - counter = <&timer20>; - }; -}; diff --git a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay deleted file mode 100644 index cfa72ed02736..000000000000 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&grtc { - /*interrupts = <226 2>;*/ -}; - -test_timer: &timer21 { - status = "okay"; - /*interrupts = <203 2>;*/ -}; - -&timer20 { - status = "okay"; - interrupts = <202 0>; -}; - -&timer00 { - status = "okay"; - prescaler = <0>; -}; - -/ { - chosen { - zephyr,cpu-load-counter = &timer00; - }; - - busy-sim { - compatible = "vnd,busy-sim"; - status = "okay"; - counter = <&timer20>; - }; -}; diff --git a/tests/drivers/timer/nrf_grtc_timer/prj.conf b/tests/drivers/timer/nrf_grtc_timer/prj.conf index 93926f090b7e..dea03477519d 100644 --- a/tests/drivers/timer/nrf_grtc_timer/prj.conf +++ b/tests/drivers/timer/nrf_grtc_timer/prj.conf @@ -1,8 +1,2 @@ CONFIG_ZTEST=y CONFIG_NRF_GRTC_TIMER=y -CONFIG_COUNTER=y -CONFIG_TEST_RANDOM_GENERATOR=y -CONFIG_XOSHIRO_RANDOM_GENERATOR=y -CONFIG_LOG_PRINTK=y -CONFIG_CPU_LOAD=y -CONFIG_CPU_LOAD_USE_COUNTER=y diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index e411eba83a0b..cede54f026f1 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -5,15 +5,7 @@ */ #include #include -#include -#include -#include -#include -#include -#include -#include #include -LOG_MODULE_REGISTER(test, 1); #define GRTC_SLEW_TICKS 10 #define NUMBER_OF_TRIES 2000 @@ -161,243 +153,4 @@ ZTEST(nrf_grtc_timer, test_timer_abort_in_compare_mode) z_nrf_grtc_timer_chan_free(channel); } -enum test_timer_state { - TIMER_IDLE, - TIMER_PREPARE, - TIMER_ACTIVE -}; - -enum test_ctx { - TEST_HIGH_PRI, - TEST_TIMER_CB, - TEST_THREAD -}; - -struct test_grtc_timer { - struct k_timer timer; - uint32_t ticks; - uint32_t expire; - uint32_t start_cnt; - uint32_t expire_cnt; - uint32_t abort_cnt; - uint32_t exp_expire; - int max_late; - int min_late; - int avg_late; - uint32_t early_cnt; - enum test_timer_state state; -}; - -static atomic_t test_active_cnt; -static struct test_grtc_timer timers[8]; -static uint32_t test_end; -static k_tid_t test_tid; -static volatile bool test_run; -static uint32_t ctx_cnt[3]; -static const char *const ctx_name[] = { "HIGH PRIO ISR", "TIMER CALLBACK", "THREAD" }; - -static bool stress_test_action(int ctx, int id) -{ - struct test_grtc_timer *timer = &timers[id]; - - ctx_cnt[ctx]++; - if (timer->state == TIMER_ACTIVE) { - /* Aborting soon to expire timers from higher interrupt priority may lead - * to test failures. - */ - if (ctx == 0 && (k_timer_remaining_get(&timer->timer) < 5)) { - return true; - } - - if (timer->abort_cnt < timer->expire_cnt / 2) { - bool any_active; - - timer->state = TIMER_PREPARE; - k_timer_stop(&timer->timer); - timer->abort_cnt++; - any_active = atomic_dec(&test_active_cnt) > 1; - timer->state = TIMER_IDLE; - - return any_active; - } - } else if (timer->state == TIMER_IDLE) { - int ticks = 10 + (sys_rand32_get() & 0x3F); - k_timeout_t t = K_TICKS(ticks); - - timer->state = TIMER_PREPARE; - timer->exp_expire = k_ticks_to_cyc_floor32(sys_clock_tick_get_32() + ticks); - timer->ticks = ticks; - k_timer_start(&timer->timer, t, K_NO_WAIT); - atomic_inc(&test_active_cnt); - timer->start_cnt++; - timer->state = TIMER_ACTIVE; - } - - return true; -} - -static void stress_test_actions(int ctx) -{ - uint32_t r = sys_rand32_get(); - int action_cnt = Z_MAX(r & 0x3, 1); - int tmr_id = (r >> 8) % ARRAY_SIZE(timers); - - /* Occasionally wake thread context from which timer actions are also executed. */ - if ((((r >> 2) & 0x3) == 0) || test_active_cnt < 2) { - LOG_DBG("ctx:%d thread wakeup", ctx); - k_wakeup(test_tid); - } - - for (int i = 0; i < action_cnt; i++) { - if (stress_test_action(ctx, tmr_id) == false) { - stress_test_action(ctx, tmr_id); - } - } -} - -static void timer_cb(struct k_timer *timer) -{ - struct test_grtc_timer *test_timer = CONTAINER_OF(timer, struct test_grtc_timer, timer); - uint32_t now = k_cycle_get_32(); - int diff = now - test_timer->exp_expire; - - atomic_dec(&test_active_cnt); - zassert_true(diff >= 0); - test_timer->max_late = MAX(diff, test_timer->max_late); - test_timer->min_late = MIN(diff, test_timer->min_late); - - if (test_timer->expire_cnt == 0) { - test_timer->avg_late = diff; - } else { - test_timer->avg_late = (test_timer->avg_late * test_timer->expire_cnt + diff) / - (test_timer->expire_cnt + 1); - } - - test_timer->expire_cnt++; - test_timer->state = TIMER_IDLE; - - if (test_run) { - stress_test_actions(TEST_TIMER_CB); - } -} - -static void counter_set(const struct device *dev, struct counter_alarm_cfg *cfg) -{ - int err; - uint32_t us = 150 + (sys_rand32_get() & 0x3F); - - cfg->ticks = counter_us_to_ticks(dev, us); - err = counter_set_channel_alarm(dev, 0, cfg); - zassert_equal(err, 0); -} - -static void counter_cb(const struct device *dev, uint8_t chan_id, uint32_t ticks, void *user_data) -{ - struct counter_alarm_cfg *config = user_data; - - if (test_run) { - stress_test_actions(TEST_HIGH_PRI); - counter_set(dev, config); - } -} - -static void report_progress(uint32_t start, uint32_t end) -{ - static uint32_t next_report; - static uint32_t step; - static uint32_t progress; - - if (next_report == 0) { - step = (end - start) / 10; - next_report = start + step; - } - - if (k_uptime_get_32() > next_report) { - next_report += step; - progress += 10; - printk("%d%%\r", progress); - } -} - -static void grtc_stress_test(bool busy_sim_en) -{ - static struct counter_alarm_cfg alarm_cfg; -#if DT_NODE_EXISTS(DT_NODELABEL(test_timer)) && DT_NODE_HAS_STATUS(DT_NODELABEL(test_timer), okay) - const struct device *const counter_dev = DEVICE_DT_GET(DT_NODELABEL(test_timer)); -#else - const struct device *const counter_dev = NULL; -#endif - uint32_t test_ms = 5000; - uint32_t test_start = k_uptime_get_32(); - uint32_t load; - - test_end = k_cycle_get_32() + k_ms_to_cyc_floor32(test_ms); - test_tid = k_current_get(); - - for (size_t i = 0; i < ARRAY_SIZE(timers); i++) { - k_timer_init(&timers[i].timer, timer_cb, NULL); - } - - if (IS_ENABLED(CONFIG_CPU_LOAD)) { - (void)cpu_load_get(true); - } - - if (counter_dev) { - counter_start(counter_dev); - } - - alarm_cfg.callback = counter_cb; - alarm_cfg.user_data = &alarm_cfg; - test_run = true; - - if (counter_dev) { - counter_set(counter_dev, &alarm_cfg); - } - - if (busy_sim_en) { - busy_sim_start(500, 200, 1000, 400, NULL); - } - - LOG_DBG("Starting test, will end at %d", test_end); - while (k_cycle_get_32() < test_end) { - report_progress(test_start, test_start + test_ms); - stress_test_actions(TEST_THREAD); - k_sleep(K_MSEC(test_ms)); - } - - load = IS_ENABLED(CONFIG_CPU_LOAD) ? cpu_load_get(true) : 0; - - test_run = false; - k_msleep(50); - - for (size_t i = 0; i < ARRAY_SIZE(timers); i++) { - zassert_equal(timers[i].state, TIMER_IDLE, "Unexpected timer %d state:%d", - i, timers[i].state); - TC_PRINT("Timer%d (%p)\r\n\tstart_cnt:%d abort_cnt:%d expire_cnt:%d\n", - i, &timers[i], timers[i].start_cnt, timers[i].abort_cnt, - timers[i].expire_cnt); - TC_PRINT("\tavarage late:%d ticks, max late:%d, min late:%d early:%d\n", - timers[i].avg_late, timers[i].max_late, timers[i].min_late, - timers[i].early_cnt); - } - - for (size_t i = 0; i < ARRAY_SIZE(ctx_cnt); i++) { - TC_PRINT("Context: %s executed %d times\n", ctx_name[i], ctx_cnt[i]); - } - TC_PRINT("CPU load during test:%d.%d\n", load / 10, load % 10); - - if (busy_sim_en) { - busy_sim_stop(); - } - - if (counter_dev) { - counter_stop(counter_dev); - } -} - -ZTEST(nrf_grtc_timer, test_stress) -{ - grtc_stress_test(false); -} - ZTEST_SUITE(nrf_grtc_timer, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index 140d9b222599..6f4486de913c 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -1,22 +1,17 @@ -common: - tags: - - drivers - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr - - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuflpr - - nrf54l15bsim/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuflpr - - ophelia4ev/nrf54l15/cpuapp - - ophelia4ev/nrf54l15/cpuflpr - integration_platforms: - - nrf54lm20dk/nrf54lm20a/cpuapp - timeout: 30 tests: - drivers.timer.nrf_grtc_timer: {} - drivers.timer.nrf_grtc_timer.no_assert: - extra_configs: - - CONFIG_ASSERT=n + drivers.timer.nrf_grtc_timer: + tags: drivers + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad + - nrf54h20dk/nrf54h20/cpuppr + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuflpr + - nrf54l15bsim/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuflpr + - ophelia4ev/nrf54l15/cpuapp + - ophelia4ev/nrf54l15/cpuflpr + integration_platforms: + - nrf54lm20dk/nrf54lm20a/cpuapp + timeout: 30 From a8f0c2dd63347bda02c97024731f24e03046fbe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:06 +0100 Subject: [PATCH 1502/3334] Revert "[nrf fromlist] kconfig: Load Kconfig env file better" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b7c545c96c691b039641be3349b96ba1e2eedda7. Signed-off-by: Tomasz Moń --- Kconfig.zephyr | 1 + cmake/modules/kconfig.cmake | 5 +---- doc/_extensions/zephyr/kconfig/__init__.py | 6 ++---- scripts/ci/check_compliance.py | 8 ++------ scripts/zephyr_module.py | 18 +++--------------- share/sysbuild/Kconfig | 2 ++ 6 files changed, 11 insertions(+), 29 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index d758a03baff4..d8df86add4d3 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -6,6 +6,7 @@ # SPDX-License-Identifier: Apache-2.0 source "Kconfig.constants" +source "$(KCONFIG_ENV_FILE)" osource "$(APPLICATION_SOURCE_DIR)/VERSION" diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index 60667eb6444b..de87abfdc1d3 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -132,13 +132,10 @@ endif() # APP_DIR: Path to the main image (sysbuild) or synonym for APPLICATION_SOURCE_DIR (non-sysbuild) zephyr_get(APP_DIR VAR APP_DIR APPLICATION_SOURCE_DIR) -# Load the module Kconfig file into CMake -include("${KCONFIG_BINARY_DIR}/kconfig_module_dirs.cmake") - set(COMMON_KCONFIG_ENV_SETTINGS PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + KCONFIG_ENV_FILE=${KCONFIG_BINARY_DIR}/kconfig_module_dirs.env srctree=${ZEPHYR_BASE} - ${kconfig_env_dirs} KERNELVERSION=${KERNELVERSION} APPVERSION=${APP_VERSION_STRING} APP_VERSION_EXTENDED_STRING=${APP_VERSION_EXTENDED_STRING} diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index 704415eac101..cda7430d7ab8 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -44,7 +44,6 @@ from typing import Any from docutils import nodes -from dotenv import load_dotenv from sphinx.addnodes import pending_xref from sphinx.application import Sphinx from sphinx.builders import Builder @@ -82,8 +81,7 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d sysbuild_kconfig = "" for module in modules: kconfig_module_dirs += zephyr_module.process_kconfig_module_dir(module.project, - module.meta, - False) + module.meta) kconfig += zephyr_module.process_kconfig(module.project, module.meta) sysbuild_kconfig += zephyr_module.process_sysbuildkconfig(module.project, module.meta) @@ -157,7 +155,7 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d os.environ["BOARD"] = "boards" os.environ["KCONFIG_BOARD_DIR"] = str(Path(td) / "boards") - load_dotenv(str(Path(td) / "kconfig_module_dirs.env")) + os.environ["KCONFIG_ENV_FILE"] = str(Path(td) / "kconfig_module_dirs.env") # Sysbuild runs first os.environ["CONFIG_"] = "SB_CONFIG_" diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 540744d7e122..a600004aae7a 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -23,8 +23,6 @@ import unidiff import yaml -from dotenv import load_dotenv - from yamllint import config, linter from junitparser import TestCase, TestSuite, JUnitXml, Skipped, Error, Failure @@ -702,14 +700,14 @@ def parse_kconfig(self): os.environ["KCONFIG_BINARY_DIR"] = kconfiglib_dir os.environ['DEVICETREE_CONF'] = "dummy" os.environ['TOOLCHAIN_HAS_NEWLIB'] = "y" - kconfig_env_file = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") + os.environ['KCONFIG_ENV_FILE'] = os.path.join(kconfiglib_dir, "kconfig_module_dirs.env") # Older name for DEVICETREE_CONF, for compatibility with older Zephyr # versions that don't have the renaming os.environ["GENERATED_DTS_BOARD_CONF"] = "dummy" # For multi repo support - self.get_modules(kconfig_env_file, + self.get_modules(os.environ['KCONFIG_ENV_FILE'], os.path.join(kconfiglib_dir, "Kconfig.modules"), os.path.join(kconfiglib_dir, "Kconfig.sysbuild.modules"), os.path.join(kconfiglib_dir, "settings_file.txt")) @@ -723,8 +721,6 @@ def parse_kconfig(self): # symbols within Kconfig files os.environ["KCONFIG_WARN_UNDEF"] = "y" - load_dotenv(kconfig_env_file) - try: # Note this will both print warnings to stderr _and_ return # them: so some warnings might get printed diff --git a/scripts/zephyr_module.py b/scripts/zephyr_module.py index 6606af52ba0f..c214f51704c8 100755 --- a/scripts/zephyr_module.py +++ b/scripts/zephyr_module.py @@ -386,13 +386,10 @@ def kconfig_snippet(meta, path, kconfig_file=None, blobs=False, taint_blobs=Fals return '\n'.join(snippet) -def process_kconfig_module_dir(module, meta, cmake_output): +def process_kconfig_module_dir(module, meta): module_path = PurePath(module) name_sanitized = meta['name-sanitized'] - - if cmake_output is False: - return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' - return f'list(APPEND kconfig_env_dirs ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()})\n' + return f'ZEPHYR_{name_sanitized.upper()}_MODULE_DIR={module_path.as_posix()}\n' def process_kconfig(module, meta): @@ -873,7 +870,6 @@ def main(): args = parser.parse_args() kconfig_module_dirs = "" - kconfig_module_dirs_cmake = "set(kconfig_env_dirs)\n" kconfig = "" cmake = "" sysbuild_kconfig = "" @@ -886,8 +882,7 @@ def main(): args.modules, args.extra_modules) for module in modules: - kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta, False) - kconfig_module_dirs_cmake += process_kconfig_module_dir(module.project, module.meta, True) + kconfig_module_dirs += process_kconfig_module_dir(module.project, module.meta) kconfig += process_kconfig(module.project, module.meta) cmake += process_cmake(module.project, module.meta) sysbuild_kconfig += process_sysbuildkconfig( @@ -899,20 +894,13 @@ def main(): if args.kconfig_out or args.sysbuild_kconfig_out: if args.kconfig_out: kconfig_module_dirs_out = PurePath(args.kconfig_out).parent / 'kconfig_module_dirs.env' - kconfig_module_dirs_cmake_out = PurePath(args.kconfig_out).parent / \ - 'kconfig_module_dirs.cmake' elif args.sysbuild_kconfig_out: kconfig_module_dirs_out = PurePath(args.sysbuild_kconfig_out).parent / \ 'kconfig_module_dirs.env' - kconfig_module_dirs_cmake_out = PurePath(args.sysbuild_kconfig_out).parent / \ - 'kconfig_module_dirs.cmake' with open(kconfig_module_dirs_out, 'w', encoding="utf-8") as fp: fp.write(kconfig_module_dirs) - with open(kconfig_module_dirs_cmake_out, 'w', encoding="utf-8") as fp: - fp.write(kconfig_module_dirs_cmake) - if args.kconfig_out: with open(args.kconfig_out, 'w', encoding="utf-8") as fp: fp.write(kconfig) diff --git a/share/sysbuild/Kconfig b/share/sysbuild/Kconfig index b9cec010dd9d..1a9f36ac7779 100644 --- a/share/sysbuild/Kconfig +++ b/share/sysbuild/Kconfig @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 +source "$(KCONFIG_ENV_FILE)" + config BOARD string default "$(BOARD)" From dc50382766c038ea1b22bc23ec95a3f37d9ef351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1503/3334] Revert "[nrf fromlist] scripts: requirements: Add python-dotenv" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5efb3056747b32780daf7d3a459d74be28442cc4. Signed-off-by: Tomasz Moń --- scripts/requirements-actions.in | 1 - scripts/requirements-actions.txt | 4 ---- scripts/requirements-build-test.txt | 2 -- scripts/requirements-compliance.txt | 1 - 4 files changed, 8 deletions(-) diff --git a/scripts/requirements-actions.in b/scripts/requirements-actions.in index 6baf9dc9e3f4..997afed38712 100644 --- a/scripts/requirements-actions.in +++ b/scripts/requirements-actions.in @@ -22,7 +22,6 @@ pykwalify pylint>=3 pyserial pytest -python-dotenv python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" pyyaml diff --git a/scripts/requirements-actions.txt b/scripts/requirements-actions.txt index 21505203bfa6..8c28b2d22f77 100644 --- a/scripts/requirements-actions.txt +++ b/scripts/requirements-actions.txt @@ -880,10 +880,6 @@ python-debian==1.0.1 \ --hash=sha256:3ada9b83a3d671b58081782c0969cffa0102f6ce433fbbc7cf21275b8b5cc771 \ --hash=sha256:8f137c230c1d9279c2ac892b35915068b2aca090c9fd3da5671ff87af32af12c # via reuse -python-dotenv==1.1.1 \ - --hash=sha256:31f23644fe2602f88ff55e1f5c79ba497e01224ee7737937930c448e4d0e24dc \ - --hash=sha256:a8a6399716257f45be6a007360200409fce5cda2661e3dec71d23dc15f6189ab - # via -r requirements-actions.in python-magic==0.4.27 ; sys_platform != 'win32' \ --hash=sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b \ --hash=sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3 diff --git a/scripts/requirements-build-test.txt b/scripts/requirements-build-test.txt index e6264b11ea5e..2ce1227e3e70 100644 --- a/scripts/requirements-build-test.txt +++ b/scripts/requirements-build-test.txt @@ -19,5 +19,3 @@ mypy # used for JUnit XML parsing in CTest harness junitparser>=3.0.0 - -python-dotenv diff --git a/scripts/requirements-compliance.txt b/scripts/requirements-compliance.txt index 6d90ac4b2587..3c3841cf33ed 100644 --- a/scripts/requirements-compliance.txt +++ b/scripts/requirements-compliance.txt @@ -8,7 +8,6 @@ junitparser>=4.0.1 lxml>=5.3.0 pykwalify pylint>=3 -python-dotenv python-magic-bin; sys_platform == "win32" python-magic; sys_platform != "win32" ruff==0.11.11 From 00eaffb8202ec96be59225a513aae2ba980d17f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1504/3334] Revert "[nrf fromlist] manifest: tf-m-tests: bring in fix for TF-M 2.2.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 30f26bcb40949e7d8ad1dce4ec008cfadbb6e845. Signed-off-by: Tomasz Moń --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 57ad7affdd1c..04bdd669a921 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -35,7 +35,7 @@ manifest: groups: - optional - name: tf-m-tests - revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 + revision: a286347e6a5dd37a9a5e960450ffc0260d63fb27 path: modules/tee/tf-m/tf-m-tests remote: upstream groups: From 6e9d6e94f219fe5394e7ab9afbb49a31113eaa2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1505/3334] Revert "[nrf fromlist] tests: zms: Add test coverage for ZMS_ID_64BIT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ab5b191f2e972d8586ee41023cb3877332800270. Signed-off-by: Tomasz Moń --- tests/subsys/fs/zms/src/main.c | 56 ++++--------------------------- tests/subsys/fs/zms/testcase.yaml | 6 ---- 2 files changed, 6 insertions(+), 56 deletions(-) diff --git a/tests/subsys/fs/zms/src/main.c b/tests/subsys/fs/zms/src/main.c index 80e2d9f9c072..15cdf217c04e 100644 --- a/tests/subsys/fs/zms/src/main.c +++ b/tests/subsys/fs/zms/src/main.c @@ -578,19 +578,17 @@ ZTEST_F(zms, test_zms_gc_corrupt_close_ate) int err; Z_TEST_SKIP_IFNDEF(CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES); - memset(&close_ate, 0xff, sizeof(struct zms_ate)); - close_ate.id = ZMS_HEAD_ID; + close_ate.id = 0xffffffff; close_ate.offset = fixture->fs.sector_size - sizeof(struct zms_ate) * 5; close_ate.len = 0; + close_ate.metadata = 0xffffffff; close_ate.cycle_cnt = 1; close_ate.crc8 = 0xff; /* Incorrect crc8 */ - memset(&empty_ate, 0, sizeof(struct zms_ate)); - empty_ate.id = ZMS_HEAD_ID; + empty_ate.id = 0xffffffff; + empty_ate.offset = 0; empty_ate.len = 0xffff; - empty_ate.metadata = FIELD_PREP(ZMS_VERSION_MASK, ZMS_DEFAULT_VERSION) | - FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | - FIELD_PREP(ZMS_ATE_FORMAT_MASK, ZMS_DEFAULT_ATE_FORMAT); + empty_ate.metadata = 0x4201; empty_ate.cycle_cnt = 1; empty_ate.crc8 = crc8_ccitt(0xff, (uint8_t *)&empty_ate + SIZEOF_FIELD(struct zms_ate, crc8), @@ -651,7 +649,7 @@ ZTEST_F(zms, test_zms_gc_corrupt_ate) struct zms_ate close_ate; int err; - close_ate.id = ZMS_HEAD_ID; + close_ate.id = 0xffffffff; close_ate.offset = fixture->fs.sector_size / 2; close_ate.len = 0; close_ate.crc8 = @@ -957,45 +955,3 @@ ZTEST_F(zms, test_zms_input_validation) err = zms_delete(&fixture->fs, 0); zassert_true(err == -EACCES, "zms_delete call before mount fs failure: %d", err); } - -/* - * Test 64 bit ZMS ID support. - */ -ZTEST_F(zms, test_zms_id_64bit) -{ - int err; - ssize_t len; - uint64_t data; - uint64_t filling_id = 0xdeadbeefULL; - - Z_TEST_SKIP_IFNDEF(CONFIG_ZMS_ID_64BIT); - - err = zms_mount(&fixture->fs); - zassert_true(err == 0, "zms_mount call failure: %d", err); - - /* Fill the first sector with writes of different IDs */ - - while (fixture->fs.data_wra + sizeof(data) + sizeof(struct zms_ate) <= - fixture->fs.ate_wra) { - data = filling_id; - len = zms_write(&fixture->fs, (zms_id_t)filling_id, &data, sizeof(data)); - zassert_true(len == sizeof(data), "zms_write failed: %d", len); - - /* Choose the next ID so that its lower 32 bits stay invariant. - * The purpose is to test that ZMS doesn't mistakenly cast the - * 64 bit ID to a 32 bit one somewhere. - */ - filling_id += BIT64(32); - } - - /* Read back the written entries and check that they're all unique */ - - for (uint64_t id = 0xdeadbeefULL; id < filling_id; id += BIT64(32)) { - len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 0); - zassert_true(len == sizeof(data), "zms_read_hist unexpected failure: %d", len); - zassert_equal(data, id, "read unexpected data: %llx instead of %llx", data, id); - - len = zms_read_hist(&fixture->fs, (zms_id_t)id, &data, sizeof(data), 1); - zassert_true(len == -ENOENT, "zms_read_hist unexpected failure: %d", len); - } -} diff --git a/tests/subsys/fs/zms/testcase.yaml b/tests/subsys/fs/zms/testcase.yaml index 14cb7e9c36a2..4949e1be0c6b 100644 --- a/tests/subsys/fs/zms/testcase.yaml +++ b/tests/subsys/fs/zms/testcase.yaml @@ -27,9 +27,3 @@ tests: platform_allow: - native_sim - qemu_x86 - filesystem.zms.id_64bit: - extra_configs: - - CONFIG_ZMS_ID_64BIT=y - - CONFIG_ZMS_LOOKUP_CACHE=y - - CONFIG_ZMS_LOOKUP_CACHE_SIZE=64 - platform_allow: qemu_x86 From da6ab39ca607686f5a5faef801f4ccc70f2dea0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1506/3334] Revert "[nrf fromlist] zms: Initial support for 64 bit IDs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 51c49770273e47bcd4d723136d22ae14ffeff625. Signed-off-by: Tomasz Moń --- include/zephyr/fs/zms.h | 21 ++------ subsys/fs/zms/Kconfig | 11 ---- subsys/fs/zms/zms.c | 108 ++++++++++++--------------------------- subsys/fs/zms/zms_priv.h | 35 +------------ 4 files changed, 40 insertions(+), 135 deletions(-) diff --git a/include/zephyr/fs/zms.h b/include/zephyr/fs/zms.h index cdaa323e3da9..41ba053c93c0 100644 --- a/include/zephyr/fs/zms.h +++ b/include/zephyr/fs/zms.h @@ -77,17 +77,6 @@ struct zms_fs { * @{ */ -/** - * @brief ID type used in the ZMS API. - * - * @note The width of this type depends on @kconfig{CONFIG_ZMS_ID_64BIT}. - */ -#if CONFIG_ZMS_ID_64BIT -typedef uint64_t zms_id_t; -#else -typedef uint32_t zms_id_t; -#endif - /** * @brief Mount a ZMS file system onto the device specified in `fs`. * @@ -139,7 +128,7 @@ int zms_clear(struct zms_fs *fs); * @retval -EINVAL if `fs` is NULL or `len` is invalid. * @retval -ENOSPC if no space is left on the device. */ -ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len); +ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len); /** * @brief Delete an entry from the file system @@ -153,7 +142,7 @@ ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len); * @retval -EIO if there is a memory read/write error. * @retval -EINVAL if `fs` is NULL. */ -int zms_delete(struct zms_fs *fs, zms_id_t id); +int zms_delete(struct zms_fs *fs, uint32_t id); /** * @brief Read an entry from the file system. @@ -172,7 +161,7 @@ int zms_delete(struct zms_fs *fs, zms_id_t id); * @retval -ENOENT if there is no entry with the given `id`. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len); +ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len); /** * @brief Read a history entry from the file system. @@ -193,7 +182,7 @@ ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len); * @retval -ENOENT if there is no entry with the given `id` and history counter. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt); +ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt); /** * @brief Gets the length of the data that is stored in an entry with a given `id` @@ -209,7 +198,7 @@ ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, ui * @retval -ENOENT if there is no entry with the given id. * @retval -EINVAL if `fs` is NULL. */ -ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id); +ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id); /** * @brief Calculate the available free space in the file system. diff --git a/subsys/fs/zms/Kconfig b/subsys/fs/zms/Kconfig index f20310a87620..9266fada236a 100644 --- a/subsys/fs/zms/Kconfig +++ b/subsys/fs/zms/Kconfig @@ -16,15 +16,6 @@ config ZMS if ZMS -config ZMS_ID_64BIT - bool "64 bit ZMS IDs" - help - When this option is true, the `zms_id_t` values passed to ZMS APIs will be 64 bit, - as opposed to the default 32 bit. - This option will also change the format of allocation table entries (ATEs) in memory - to accommodate larger IDs. Currently, this will make ZMS unable to mount an existing - file system if it has been initialized with a different ATE format. - config ZMS_LOOKUP_CACHE bool "ZMS lookup cache" help @@ -43,7 +34,6 @@ config ZMS_LOOKUP_CACHE_SIZE config ZMS_DATA_CRC bool "ZMS data CRC" - depends on !ZMS_ID_64BIT config ZMS_CUSTOMIZE_BLOCK_SIZE bool "Customize the size of the buffer used internally for reads and writes" @@ -64,7 +54,6 @@ config ZMS_CUSTOM_BLOCK_SIZE config ZMS_LOOKUP_CACHE_FOR_SETTINGS bool "ZMS Storage lookup cache optimized for settings" depends on ZMS_LOOKUP_CACHE && SETTINGS_ZMS - depends on !ZMS_ID_64BIT help Enable usage of lookup cache based on hashes to get, the best ZMS performance, provided that the ZMS is used only for the purpose of providing the settings diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index d3bc9275479d..b4b11aa6923e 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -29,8 +29,10 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at #ifdef CONFIG_ZMS_LOOKUP_CACHE -static inline size_t zms_lookup_cache_pos(zms_id_t id) +static inline size_t zms_lookup_cache_pos(uint32_t id) { + uint32_t hash = id; + #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS /* * 1. Settings subsystem is storing the name ID and the linked list node ID @@ -50,27 +52,14 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) uint32_t key_value_bit; uint32_t key_value_hash; uint32_t key_value_ll; - uint32_t hash; key_value_bit = (id >> LOG2(ZMS_DATA_ID_OFFSET)) & 1; key_value_hash = (id & ZMS_HASH_MASK) >> (CONFIG_SETTINGS_ZMS_MAX_COLLISIONS_BITS + 1); key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; - -#elif defined(CONFIG_ZMS_ID_64BIT) - /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ - uint64_t hash = id; - - hash ^= hash >> 32; - hash *= 0x42ab4abe4c475039ULL; - hash ^= hash >> 31; - hash *= 0xfa90c4424c537791ULL; - hash ^= hash >> 32; #else /* 32-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ - uint32_t hash = id; - hash ^= hash >> 16; hash *= 0x7feb352dU; hash ^= hash >> 15; @@ -250,7 +239,7 @@ static int zms_flash_ate_wrt(struct zms_fs *fs, const struct zms_ate *entry) goto end; } #ifdef CONFIG_ZMS_LOOKUP_CACHE - /* ZMS_HEAD_ID is a special-purpose identifier. Exclude it from the cache */ + /* 0xFFFFFFFF is a special-purpose identifier. Exclude it from the cache */ if (entry->id != ZMS_HEAD_ID) { fs->lookup_cache[zms_lookup_cache_pos(entry->id)] = fs->ate_wra; } @@ -498,7 +487,7 @@ static bool zms_close_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) /* zms_empty_ate_valid validates an sector empty ate. * A valid sector empty ate should be: * - a valid ate - * - with len = 0xffff and id = ZMS_HEAD_ID + * - with len = 0xffff and id = 0xffffffff * return true if valid, false otherwise */ static bool zms_empty_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) @@ -511,7 +500,7 @@ static bool zms_empty_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) * Valid gc_done_ate: * - valid ate * - len = 0 - * - id = ZMS_HEAD_ID + * - id = 0xffffffff * return true if valid, false otherwise */ static bool zms_gc_done_ate_valid(struct zms_fs *fs, const struct zms_ate *entry) @@ -520,18 +509,6 @@ static bool zms_gc_done_ate_valid(struct zms_fs *fs, const struct zms_ate *entry (entry->id == ZMS_HEAD_ID)); } -/* zms_sector_closed checks whether the current sector is closed, which would imply - * that the empty ATE and close ATE are both valid and have matching cycle counters - * - * return true if closed, false otherwise - */ -static bool zms_sector_closed(struct zms_fs *fs, struct zms_ate *empty_ate, - struct zms_ate *close_ate) -{ - return (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && - (empty_ate->cycle_cnt == close_ate->cycle_cnt)); -} - /* Read empty and close ATE of the sector where belongs address "addr" and * validates that the sector is closed. * retval: 0 if sector is not close @@ -549,7 +526,8 @@ static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct z return rc; } - if (zms_sector_closed(fs, empty_ate, close_ate)) { + if (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && + (empty_ate->cycle_cnt == close_ate->cycle_cnt)) { /* Closed sector validated */ return 1; } @@ -558,7 +536,7 @@ static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct z } /* store an entry in flash */ -static int zms_flash_write_entry(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) +static int zms_flash_write_entry(struct zms_fs *fs, uint32_t id, const void *data, size_t len) { int rc; struct zms_ate entry; @@ -571,13 +549,13 @@ static int zms_flash_write_entry(struct zms_fs *fs, zms_id_t id, const void *dat entry.cycle_cnt = fs->sector_cycle; if (len > ZMS_DATA_IN_ATE_SIZE) { -#ifdef CONFIG_ZMS_DATA_CRC - /* only compute CRC if data is to be stored outside of entry */ - entry.data_crc = crc32_ieee(data, len); -#endif + /* only compute CRC if len is greater than 8 bytes */ + if (IS_ENABLED(CONFIG_ZMS_DATA_CRC)) { + entry.data_crc = crc32_ieee(data, len); + } entry.offset = (uint32_t)SECTOR_OFFSET(fs->data_wra); } else if ((len > 0) && (len <= ZMS_DATA_IN_ATE_SIZE)) { - /* Copy data into entry for small data (at most ZMS_DATA_IN_ATE_SIZE bytes) */ + /* Copy data into entry for small data ( < 8B) */ memcpy(&entry.data, data, len); } @@ -710,12 +688,10 @@ static int zms_sector_close(struct zms_fs *fs) struct zms_ate close_ate; struct zms_ate garbage_ate; - /* Initialize all members to 0xff */ - memset(&close_ate, 0xff, sizeof(struct zms_ate)); - close_ate.id = ZMS_HEAD_ID; close_ate.len = 0U; close_ate.offset = (uint32_t)SECTOR_OFFSET(fs->ate_wra + fs->ate_size); + close_ate.metadata = 0xffffffff; close_ate.cycle_cnt = fs->sector_cycle; /* When we close the sector, we must write all non used ATE with @@ -764,13 +740,11 @@ static int zms_add_gc_done_ate(struct zms_fs *fs) { struct zms_ate gc_done_ate; - /* Initialize all members to 0xff */ - memset(&gc_done_ate, 0xff, sizeof(struct zms_ate)); - LOG_DBG("Adding gc done ate at %llx", fs->ate_wra); gc_done_ate.id = ZMS_HEAD_ID; gc_done_ate.len = 0U; gc_done_ate.offset = (uint32_t)SECTOR_OFFSET(fs->data_wra); + gc_done_ate.metadata = 0xffffffff; gc_done_ate.cycle_cnt = fs->sector_cycle; zms_ate_crc8_update(&gc_done_ate); @@ -819,17 +793,14 @@ static int zms_add_empty_ate(struct zms_fs *fs, uint64_t addr) int rc = 0; uint64_t previous_ate_wra; - /* Initialize all members to 0 */ - memset(&empty_ate, 0, sizeof(struct zms_ate)); - addr &= ADDR_SECT_MASK; LOG_DBG("Adding empty ate at %llx", (uint64_t)(addr + fs->sector_size - fs->ate_size)); empty_ate.id = ZMS_HEAD_ID; empty_ate.len = 0xffff; - empty_ate.metadata = FIELD_PREP(ZMS_VERSION_MASK, ZMS_DEFAULT_VERSION) | - FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | - FIELD_PREP(ZMS_ATE_FORMAT_MASK, ZMS_DEFAULT_ATE_FORMAT); + empty_ate.offset = 0U; + empty_ate.metadata = + FIELD_PREP(ZMS_MAGIC_NUMBER_MASK, ZMS_MAGIC_NUMBER) | ZMS_DEFAULT_VERSION; rc = zms_get_sector_cycle(fs, addr, &cycle_cnt); if (rc == -ENOENT) { @@ -922,7 +893,7 @@ static int zms_get_sector_header(struct zms_fs *fs, uint64_t addr, struct zms_at * @retval 1 valid ATE with same ID found * @retval < 0 An error happened */ -static int zms_find_ate_with_id(struct zms_fs *fs, zms_id_t id, uint64_t start_addr, +static int zms_find_ate_with_id(struct zms_fs *fs, uint32_t id, uint64_t start_addr, uint64_t end_addr, struct zms_ate *ate, uint64_t *ate_addr) { int rc; @@ -1073,10 +1044,10 @@ static int zms_gc(struct zms_fs *fs) */ if (wlk_prev_addr == gc_prev_addr) { /* copy needed */ - LOG_DBG("Moving %lld, len %d", (long long)gc_ate.id, gc_ate.len); + LOG_DBG("Moving %d, len %d", gc_ate.id, gc_ate.len); if (gc_ate.len > ZMS_DATA_IN_ATE_SIZE) { - /* Copy Data only when len > ZMS_DATA_IN_ATE_SIZE + /* Copy Data only when len > 8 * Otherwise, Data is already inside ATE */ data_addr = (gc_prev_addr & ADDR_SECT_MASK); @@ -1185,28 +1156,16 @@ static int zms_init(struct zms_fs *fs) for (i = 0; i < fs->sector_count; i++) { addr = zms_close_ate_addr(fs, ((uint64_t)i << ADDR_SECT_SHIFT)); - /* read the header ATEs */ - rc = zms_get_sector_header(fs, addr, &empty_ate, &close_ate); - if (rc) { + /* verify if the sector is closed */ + sec_closed = zms_validate_closed_sector(fs, addr, &empty_ate, &close_ate); + if (sec_closed < 0) { + rc = sec_closed; goto end; } /* update cycle count */ fs->sector_cycle = empty_ate.cycle_cnt; - /* Check the ATE format indicator so that we know how to validate ATEs. - * The metadata field has the same offset and size in all ATE formats - * (the same is guaranteed for crc8 and cycle_cnt). - * Currently, ZMS can only recognize one of its supported ATE formats - * (the one chosen at build time), so their indicators are defined for - * the possibility of a future extension. - * If this indicator is unknown, then consider the header ATEs invalid, - * because we might not be dealing with ZMS contents at all. - */ - if (ZMS_GET_ATE_FORMAT(empty_ate.metadata) != ZMS_DEFAULT_ATE_FORMAT) { - continue; - } - - if (zms_sector_closed(fs, &empty_ate, &close_ate)) { + if (sec_closed == 1) { /* closed sector */ closed_sectors++; /* Let's verify that this is a ZMS storage system */ @@ -1264,8 +1223,7 @@ static int zms_init(struct zms_fs *fs) goto end; } - if ((ZMS_GET_ATE_FORMAT(empty_ate.metadata) == ZMS_DEFAULT_ATE_FORMAT) && - zms_empty_ate_valid(fs, &empty_ate)) { + if (zms_empty_ate_valid(fs, &empty_ate)) { /* Empty ATE is valid, let's verify that this is a ZMS storage system */ if (ZMS_GET_MAGIC_NUMBER(empty_ate.metadata) == ZMS_MAGIC_NUMBER) { zms_magic_exist = true; @@ -1510,7 +1468,7 @@ int zms_mount(struct zms_fs *fs) return 0; } -ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) +ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len) { int rc; size_t data_size; @@ -1655,12 +1613,12 @@ ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len) return rc; } -int zms_delete(struct zms_fs *fs, zms_id_t id) +int zms_delete(struct zms_fs *fs, uint32_t id) { return zms_write(fs, id, NULL, 0); } -ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt) +ssize_t zms_read_hist(struct zms_fs *fs, uint32_t id, void *data, size_t len, uint32_t cnt) { int rc; int prev_found = 0; @@ -1761,7 +1719,7 @@ ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, ui return rc; } -ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len) +ssize_t zms_read(struct zms_fs *fs, uint32_t id, void *data, size_t len) { int rc; @@ -1774,7 +1732,7 @@ ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len) return MIN(rc, len); } -ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id) +ssize_t zms_get_data_length(struct zms_fs *fs, uint32_t id) { int rc; diff --git a/subsys/fs/zms/zms_priv.h b/subsys/fs/zms/zms_priv.h index 44cfb2f3d280..84f77296f4f3 100644 --- a/subsys/fs/zms/zms_priv.h +++ b/subsys/fs/zms/zms_priv.h @@ -28,6 +28,7 @@ #endif #define ZMS_LOOKUP_CACHE_NO_ADDR GENMASK64(63, 0) +#define ZMS_HEAD_ID GENMASK(31, 0) #define ZMS_VERSION_MASK GENMASK(7, 0) #define ZMS_GET_VERSION(x) FIELD_GET(ZMS_VERSION_MASK, x) @@ -35,28 +36,14 @@ #define ZMS_MAGIC_NUMBER 0x42 /* murmur3a hash of "ZMS" (MSB) */ #define ZMS_MAGIC_NUMBER_MASK GENMASK(15, 8) #define ZMS_GET_MAGIC_NUMBER(x) FIELD_GET(ZMS_MAGIC_NUMBER_MASK, x) -#define ZMS_ATE_FORMAT_MASK GENMASK(19, 16) -#define ZMS_GET_ATE_FORMAT(x) FIELD_GET(ZMS_ATE_FORMAT_MASK, x) #define ZMS_MIN_ATE_NUM 5 #define ZMS_INVALID_SECTOR_NUM -1 - -#define ZMS_ATE_FORMAT_ID_32BIT 0 -#define ZMS_ATE_FORMAT_ID_64BIT 1 - -#if !defined(CONFIG_ZMS_ID_64BIT) -#define ZMS_DEFAULT_ATE_FORMAT ZMS_ATE_FORMAT_ID_32BIT -#define ZMS_HEAD_ID GENMASK(31, 0) -#else -#define ZMS_DEFAULT_ATE_FORMAT ZMS_ATE_FORMAT_ID_64BIT -#define ZMS_HEAD_ID GENMASK64(63, 0) -#endif /* CONFIG_ZMS_ID_64BIT */ +#define ZMS_DATA_IN_ATE_SIZE 8 /** * @ingroup zms_data_structures * ZMS Allocation Table Entry (ATE) structure - * - * @note This structure depends on @kconfig{CONFIG_ZMS_ID_64BIT}. */ struct zms_ate { /** crc8 check of the entry */ @@ -65,8 +52,6 @@ struct zms_ate { uint8_t cycle_cnt; /** data len within sector */ uint16_t len; - -#if ZMS_DEFAULT_ATE_FORMAT == ZMS_ATE_FORMAT_ID_32BIT /** data id */ uint32_t id; union { @@ -90,22 +75,6 @@ struct zms_ate { }; }; }; - -#elif ZMS_DEFAULT_ATE_FORMAT == ZMS_ATE_FORMAT_ID_64BIT - /** data id */ - uint64_t id; - union { - /** data field used to store small sized data */ - uint8_t data[4]; - /** data offset within sector */ - uint32_t offset; - /** Used to store metadata information such as storage version. */ - uint32_t metadata; - }; -#endif /* ZMS_DEFAULT_ATE_FORMAT */ - } __packed; -#define ZMS_DATA_IN_ATE_SIZE SIZEOF_FIELD(struct zms_ate, data) - #endif /* __ZMS_PRIV_H_ */ From a4c3356a1b280d4b865608fae554d5f17602bbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1507/3334] Revert "[nrf fromlist] tests: zms: Minor improvements" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7200b234870a54735b783bc3fb5970145fb5a31b. Signed-off-by: Tomasz Moń --- tests/subsys/fs/zms/src/main.c | 9 +-------- tests/subsys/fs/zms/testcase.yaml | 9 ++++----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/subsys/fs/zms/src/main.c b/tests/subsys/fs/zms/src/main.c index 15cdf217c04e..a69a2b009537 100644 --- a/tests/subsys/fs/zms/src/main.c +++ b/tests/subsys/fs/zms/src/main.c @@ -752,8 +752,6 @@ ZTEST_F(zms, test_zms_cache_init) num = num_matching_cache_entries(ate_addr, false, &fixture->fs); zassert_equal(num, 1, "invalid cache entry after restart"); -#else - ztest_test_skip(); #endif } @@ -782,8 +780,6 @@ ZTEST_F(zms, test_zms_cache_collission) zassert_equal(err, sizeof(data), "zms_read call failure: %d", err); zassert_equal(data, id, "incorrect data read"); } -#else - ztest_test_skip(); #endif } @@ -833,8 +829,6 @@ ZTEST_F(zms, test_zms_cache_gc) num = num_matching_cache_entries(2ULL << ADDR_SECT_SHIFT, true, &fixture->fs); zassert_equal(num, 2, "invalid cache content after gc"); -#else - ztest_test_skip(); #endif } @@ -892,8 +886,7 @@ ZTEST_F(zms, test_zms_cache_hash_quality) TC_PRINT("Cache occupancy: %u\n", (unsigned int)num); zassert_between_inclusive(num, MIN_CACHE_OCCUPANCY, CONFIG_ZMS_LOOKUP_CACHE_SIZE, "too low cache occupancy - poor hash quality"); -#else - ztest_test_skip(); + #endif } diff --git a/tests/subsys/fs/zms/testcase.yaml b/tests/subsys/fs/zms/testcase.yaml index 4949e1be0c6b..bdee4529f2af 100644 --- a/tests/subsys/fs/zms/testcase.yaml +++ b/tests/subsys/fs/zms/testcase.yaml @@ -8,21 +8,20 @@ tests: extra_args: DTC_OVERLAY_FILE=boards/qemu_x86_ev_0x00.overlay platform_allow: qemu_x86 filesystem.zms.sim.no_erase: - extra_configs: - - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n + extra_args: CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n platform_allow: qemu_x86 filesystem.zms.sim.corrupt_close: - extra_configs: + extra_args: - CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=y - CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y platform_allow: qemu_x86 filesystem.zms.cache: - extra_configs: + extra_args: - CONFIG_ZMS_LOOKUP_CACHE=y - CONFIG_ZMS_LOOKUP_CACHE_SIZE=64 platform_allow: native_sim filesystem.zms.data_crc: - extra_configs: + extra_args: - CONFIG_ZMS_DATA_CRC=y platform_allow: - native_sim From 621840d6bf86b6ff1423e3917826ccaa665b5765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1508/3334] Revert "[nrf fromlist] tests: boards: nrf: qdec: Fix test for nRF54L15" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1b88077f0b4adc5927f533a469bc04c30f62a166. Signed-off-by: Tomasz Moń --- tests/boards/nrf/qdec/src/main.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 6bc867f8aa9c..9d138d325fb5 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -60,11 +60,6 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t static void qenc_emulate_work_handler(struct k_work *work) { - /* Check if emulation has been stopped after submitting this work item. */ - if (loopback_currently_under_test == NULL) { - return; - } - if (toggle_a) { gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_a); } else { @@ -118,8 +113,6 @@ static void qenc_emulate_stop(void) k_timer_stop(&qenc_emulate_timer); qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_a); qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_b); - - loopback_currently_under_test = NULL; } } @@ -225,9 +218,6 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { pm_device_runtime_put(loopback->qdec); } - - qenc_emulate_stop(); - k_sem_reset(&sem); } /** @@ -280,7 +270,8 @@ static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) } qenc_emulate_stop(); - k_sem_reset(&sem); + /* emulation not working, but there may be old trigger which needs to be cleaned up */ + rc = k_sem_take(&sem, K_MSEC(200)); } /** @@ -580,7 +571,6 @@ static void after(void *fixture) ARG_UNUSED(fixture); qenc_emulate_stop(); - k_sem_reset(&sem); } ZTEST_SUITE(qdec_sensor, NULL, setup, before, after, NULL); From 685d26d7b4b9080d3a2b74aa6fef832a7994e3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1509/3334] Revert "[nrf fromlist] tests: boards: nrf: qdec: Fix test for multiple instances" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5581970d59246579056e3f927e05ea5152da04fc. Signed-off-by: Tomasz Moń --- .../boards/bl54l15_dvk_nrf54l15_common.dtsi | 14 +- .../boards/bl54l15u_dvk_nrf54l15_common.dtsi | 14 +- .../qdec/boards/nrf52840dk_nrf52840.overlay | 8 - .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 14 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 25 +- .../boards/nrf54l15dk_nrf54l15_common.dtsi | 45 ++- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 14 +- .../qdec/dts/bindings/test-qdec-loopback.yaml | 20 -- tests/boards/nrf/qdec/src/main.c | 313 ++++++++++-------- 9 files changed, 229 insertions(+), 238 deletions(-) delete mode 100644 tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml diff --git a/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi index 19ca5e83647f..4db67a49a5e0 100644 --- a/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi @@ -5,6 +5,12 @@ */ / { + aliases { + qdec0 = &qdec20; + qenca = &phase_a; + qencb = &phase_b; + }; + encoder-emulate { compatible = "gpio-leds"; @@ -16,14 +22,6 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi index 19ca5e83647f..4db67a49a5e0 100644 --- a/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi @@ -5,6 +5,12 @@ */ / { + aliases { + qdec0 = &qdec20; + qenca = &phase_a; + qencb = &phase_b; + }; + encoder-emulate { compatible = "gpio-leds"; @@ -16,14 +22,6 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay b/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay index 0c098f238bd0..9ee3749b4ff8 100644 --- a/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay @@ -21,14 +21,6 @@ gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec0>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay index 04872e1de5c7..22f5307a760a 100644 --- a/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -4,6 +4,12 @@ */ / { + aliases { + qdec0 = &qdec1; + qenca = &phase_a; + qencb = &phase_b; + }; + encoder-emulate { compatible = "gpio-leds"; phase_a: phase_a { @@ -15,14 +21,6 @@ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec1>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 7e43c70dac0f..78f3aa09ace4 100644 --- a/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -11,12 +11,21 @@ */ / { + aliases { + qdec0 = &qdec130; + qdec1 = &qdec131; + qenca = &phase_a; + qencb = &phase_b; + qenca1 = &phase_a1; + qencb1 = &phase_b1; + }; + encoder-emulate { compatible = "gpio-leds"; - phase_a0: phase_a0 { + phase_a: phase_a { gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; }; - phase_b0: phase_b0 { + phase_b: phase_b { gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; }; phase_a1: phase_a1 { @@ -26,18 +35,6 @@ gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec130>; - qenc-emul-gpios = <&phase_a0 &phase_b0>; - }; - loopback1 { - qdec = <&qdec131>; - qenc-emul-gpios = <&phase_a1 &phase_b1>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi index f27294146527..06a490d1da08 100644 --- a/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi @@ -4,38 +4,35 @@ */ /* Required loopbacks - * P1.8 <-> P1.9 - * P1.10 <-> P1.11 - * P1.12 <-> P1.13 - * P1.14 <-> P2.10 + * P1.8 <-> P1.9 + * P1.10 >-> P1.11 + * P2.8 <-> P2.9 + * P2.10 <-> P1.14 */ / { + aliases { + qdec0 = &qdec20; + qdec1 = &qdec21; + qenca = &phase_a; + qencb = &phase_b; + qenca1 = &phase_a1; + qencb1 = &phase_b1; + }; + encoder-emulate { compatible = "gpio-leds"; - phase_a0: phase_a0 { + phase_a: phase_a { gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; - phase_b0: phase_b0 { + phase_b: phase_b { gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; phase_a1: phase_a1 { - gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; }; phase_b1: phase_b1 { - gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; - }; - }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a0 &phase_b0>; - }; - loopback1 { - qdec = <&qdec21>; - qenc-emul-gpios = <&phase_a1 &phase_b1>; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; }; }; }; @@ -58,15 +55,15 @@ qdec_21_pinctrl: qdec_21_pinctrl { group1 { - psels = , - ; + psels = , + ; }; }; qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl { group1 { - psels = , - ; + psels = , + ; low-power-enable; }; }; diff --git a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi index 6f8f3a184312..84e7b1dbc30f 100644 --- a/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ b/tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -11,6 +11,12 @@ */ / { + aliases { + qdec0 = &qdec20; + qenca = &phase_a; + qencb = &phase_b; + }; + encoder-emulate { compatible = "gpio-leds"; phase_a: phase_a { @@ -20,14 +26,6 @@ gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; }; }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a &phase_b>; - }; - }; }; &pinctrl { diff --git a/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml b/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml deleted file mode 100644 index e03b2ff3bc32..000000000000 --- a/tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml +++ /dev/null @@ -1,20 +0,0 @@ -description: | - Binding describing loopbacks required to run tests/boards/nrf/qdec test in Zephyr. - -compatible: "test-qdec-loopbacks" - -child-binding: - description: | - Binding describing a single loopback pair consisting of a QDEC device and two "gpio-leds" pins - working as a quadrature encoder for the test. - properties: - qdec: - type: phandle - required: true - description: Node of the QDEC device used to capture quadrature signal in the loopback. - qenc-emul-gpios: - type: phandles - required: true - description: | - Children nodes of "gpio-leds" compatible used to generate quadrature signal. The first - phandles outputs phase A signal, the second one outputs phase B signal. diff --git a/tests/boards/nrf/qdec/src/main.c b/tests/boards/nrf/qdec/src/main.c index 9d138d325fb5..7df97be2a432 100644 --- a/tests/boards/nrf/qdec/src/main.c +++ b/tests/boards/nrf/qdec/src/main.c @@ -11,40 +11,27 @@ #include #include -/** - * Structure grouping gpio pins used for QENC emulation connected with a QDEC device - * with a loopback. - */ -struct qdec_qenc_loopback { - struct gpio_dt_spec qenc_phase_a; - struct gpio_dt_spec qenc_phase_b; - - const struct device *qdec; - uint32_t qdec_config_step; -}; - static K_SEM_DEFINE(sem, 0, 1); - -#define GET_QDEC_QENC_LOOPBACK(x) \ - { \ - .qenc_phase_a = GPIO_DT_SPEC_GET(DT_PHANDLE_BY_IDX(x, qenc_emul_gpios, 0), gpios), \ - .qenc_phase_b = GPIO_DT_SPEC_GET(DT_PHANDLE_BY_IDX(x, qenc_emul_gpios, 1), gpios), \ - .qdec = DEVICE_DT_GET(DT_PHANDLE(x, qdec)), \ - .qdec_config_step = DT_PROP_BY_PHANDLE(x, qdec, steps) \ - } - - -struct qdec_qenc_loopback loopbacks[] = { - DT_FOREACH_CHILD_SEP(DT_NODELABEL(qdec_loopbacks), GET_QDEC_QENC_LOOPBACK, (,)) -}; - -#define TESTED_QDEC_COUNT ARRAY_SIZE(loopbacks) - +static const struct gpio_dt_spec phase_a = GPIO_DT_SPEC_GET(DT_ALIAS(qenca), gpios); +static const struct gpio_dt_spec phase_b = GPIO_DT_SPEC_GET(DT_ALIAS(qencb), gpios); +static const struct device *const qdec_dev = DEVICE_DT_GET(DT_ALIAS(qdec0)); +static const uint32_t qdec_config_step = DT_PROP(DT_ALIAS(qdec0), steps); + +/* Disable testing second QDEC instance + * until the issue with multiple + * QDEC instances support is resolved + */ +#if DT_NODE_EXISTS(DT_ALIAS(qdecX)) +#define SECOND_QDEC_INSTANCE + +static const struct gpio_dt_spec phase_a1 = GPIO_DT_SPEC_GET(DT_ALIAS(qenca1), gpios); +static const struct gpio_dt_spec phase_b1 = GPIO_DT_SPEC_GET(DT_ALIAS(qencb1), gpios); +static const struct device *const qdec_1_dev = DEVICE_DT_GET(DT_ALIAS(qdec1)); +static const uint32_t qdec_1_config_step = DT_PROP(DT_ALIAS(qdec1), steps); +#endif static struct sensor_trigger qdec_trigger = {.type = SENSOR_TRIG_DATA_READY, .chan = SENSOR_CHAN_ROTATION}; - static bool toggle_a = true; -static struct qdec_qenc_loopback *loopback_currently_under_test; static void qdec_trigger_handler(const struct device *dev, const struct sensor_trigger *trigger) { @@ -61,9 +48,15 @@ static void qdec_trigger_handler(const struct device *dev, const struct sensor_t static void qenc_emulate_work_handler(struct k_work *work) { if (toggle_a) { - gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_a); + gpio_pin_toggle_dt(&phase_a); +#if defined(SECOND_QDEC_INSTANCE) + gpio_pin_toggle_dt(&phase_a1); +#endif } else { - gpio_pin_toggle_dt(&loopback_currently_under_test->qenc_phase_b); + gpio_pin_toggle_dt(&phase_b); +#if defined(SECOND_QDEC_INSTANCE) + gpio_pin_toggle_dt(&phase_b1); +#endif } toggle_a = !toggle_a; } @@ -96,46 +89,52 @@ static void qenc_emulate_setup_pin(const struct gpio_dt_spec *gpio_dt) zassert_true(rc == 0, "%s: pin configure failed: %d", gpio_dt->port->name, rc); } -static void qenc_emulate_start(struct qdec_qenc_loopback *loopback, k_timeout_t period, - bool forward) +static void qenc_emulate_start(k_timeout_t period, bool forward) { - qenc_emulate_reset_pin(&loopback->qenc_phase_a); - qenc_emulate_reset_pin(&loopback->qenc_phase_b); + qenc_emulate_reset_pin(&phase_a); + qenc_emulate_reset_pin(&phase_b); +#if defined(SECOND_QDEC_INSTANCE) + qenc_emulate_reset_pin(&phase_a1); + qenc_emulate_reset_pin(&phase_b1); +#endif toggle_a = !forward; - loopback_currently_under_test = loopback; + k_timer_start(&qenc_emulate_timer, period, period); } static void qenc_emulate_stop(void) { - if (loopback_currently_under_test) { - k_timer_stop(&qenc_emulate_timer); - qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_a); - qenc_emulate_reset_pin(&loopback_currently_under_test->qenc_phase_b); - } + k_timer_stop(&qenc_emulate_timer); + + qenc_emulate_reset_pin(&phase_a); + qenc_emulate_reset_pin(&phase_b); +#if defined(SECOND_QDEC_INSTANCE) + qenc_emulate_reset_pin(&phase_a1); + qenc_emulate_reset_pin(&phase_b1); +#endif } -static void qenc_emulate_verify_reading(struct qdec_qenc_loopback *loopback, - int emulator_period_ms, int emulation_duration_ms, bool forward, - bool overflow_expected) +static void qenc_emulate_verify_reading(const struct device *const dev, int emulator_period_ms, + int emulation_duration_ms, bool forward, bool overflow_expected, + const uint32_t config_step) { int rc; struct sensor_value val = {0}; int32_t expected_steps = emulation_duration_ms / emulator_period_ms; - int32_t expected_reading = 360 * expected_steps / loopback->qdec_config_step; - int32_t delta = expected_reading / 4; + int32_t expected_reading = 360 * expected_steps / config_step; + int32_t delta = expected_reading / 5; if (!forward) { expected_reading *= -1; } - qenc_emulate_start(loopback, K_MSEC(emulator_period_ms), forward); + qenc_emulate_start(K_MSEC(emulator_period_ms), forward); /* wait for some readings */ k_msleep(emulation_duration_ms); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(dev); if (!overflow_expected) { zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); @@ -143,7 +142,7 @@ static void qenc_emulate_verify_reading(struct qdec_qenc_loopback *loopback, zassert_true(rc == -EOVERFLOW, "Failed to detect overflow"); } - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); TC_PRINT("Expected reading: %d, actual value: %d, delta: %d\n", @@ -158,31 +157,31 @@ static void qenc_emulate_verify_reading(struct qdec_qenc_loopback *loopback, /* wait and get readings to clear state */ k_msleep(100); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to get sample (%d)", rc); } -static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) +static void sensor_trigger_set_and_disable(const struct device *const dev) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } k_sem_give(&sem); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ALL; - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* emulation working, handler should be called */ rc = k_sem_take(&sem, K_MSEC(200)); @@ -194,7 +193,7 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) rc = k_sem_take(&sem, K_MSEC(200)); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } /* there should be no triggers now*/ @@ -202,21 +201,21 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } /* register empty trigger - disable trigger */ - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, NULL); + rc = sensor_trigger_set(dev, &qdec_trigger, NULL); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* emulation working, but handler not set, thus should not be called */ rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == -EAGAIN, "qdec handler should not be triggered (%d)", rc); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } } @@ -228,50 +227,49 @@ static void sensor_trigger_set_and_disable(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_trigger_set_and_disable) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_trigger_set_and_disable(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_trigger_set_and_disable(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_trigger_set_and_disable(qdec_1_dev); +#endif + } -static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) +static void sensor_trigger_set_test(const struct device *const dev) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); zassert_true(rc == 0, "sensor_trigger_set failed: %d", rc); - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* emulation working now */ rc = k_sem_take(&sem, K_MSEC(200)); zassert_true(rc == 0, "qdec handler should be triggered (%d)", rc); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val); + rc = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &val); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); TC_PRINT("QDEC reading: %d\n", val.val1); zassert_true(val.val1 != 0, "No readings from QDEC"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } - - qenc_emulate_stop(); - /* emulation not working, but there may be old trigger which needs to be cleaned up */ - rc = k_sem_take(&sem, K_MSEC(200)); } /** @@ -282,37 +280,39 @@ static void sensor_trigger_set_test(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_trigger_set) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_trigger_set_test(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_trigger_set_test(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_trigger_set_test(qdec_1_dev); +#endif } -static void sensor_trigger_set_negative(struct qdec_qenc_loopback *loopback) +static void sensor_trigger_set_negative(const struct device *const dev) { int rc; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc != -ENOSYS, "sensor_trigger_set not supported"); qdec_trigger.type = SENSOR_TRIG_MAX; qdec_trigger.chan = SENSOR_CHAN_ROTATION; - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid trigger type"); qdec_trigger.type = SENSOR_TRIG_DATA_READY; qdec_trigger.chan = SENSOR_CHAN_MAX; - rc = sensor_trigger_set(loopback->qdec, &qdec_trigger, qdec_trigger_handler); + rc = sensor_trigger_set(dev, &qdec_trigger, qdec_trigger_handler); zassume_true(rc < 0, "sensor_trigger_set should fail due to invalid channel"); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } } @@ -324,10 +324,12 @@ static void sensor_trigger_set_negative(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_trigger_set_negative) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_trigger_set_negative(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_trigger_set_negative(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_trigger_set_negative(qdec_1_dev); +#endif } /** @@ -338,22 +340,37 @@ ZTEST(qdec_sensor, test_sensor_trigger_set_negative) */ ZTEST(qdec_sensor, test_qdec_readings) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopbacks[i].qdec); - } - - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - qenc_emulate_verify_reading(&loopbacks[i], 10, 100, true, false); - qenc_emulate_verify_reading(&loopbacks[i], 2, 500, true, false); - qenc_emulate_verify_reading(&loopbacks[i], 10, 200, false, false); - qenc_emulate_verify_reading(&loopbacks[i], 1, 1000, false, true); - qenc_emulate_verify_reading(&loopbacks[i], 1, 1000, true, true); - - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopbacks[i].qdec); - } + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_get(qdec_dev); } + + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + qenc_emulate_verify_reading(qdec_dev, 10, 100, true, false, qdec_config_step); + qenc_emulate_verify_reading(qdec_dev, 2, 500, true, false, qdec_config_step); + qenc_emulate_verify_reading(qdec_dev, 10, 200, false, false, qdec_config_step); + qenc_emulate_verify_reading(qdec_dev, 1, 1000, false, true, qdec_config_step); + qenc_emulate_verify_reading(qdec_dev, 1, 1000, true, true, qdec_config_step); + + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put(qdec_dev); + } + +#if defined(SECOND_QDEC_INSTANCE) + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_get(qdec_1_dev); + } + + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + qenc_emulate_verify_reading(qdec_1_dev, 10, 100, true, false, qdec_1_config_step); + qenc_emulate_verify_reading(qdec_1_dev, 2, 500, true, false, qdec_1_config_step); + qenc_emulate_verify_reading(qdec_1_dev, 10, 200, false, false, qdec_1_config_step); + qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, false, true, qdec_1_config_step); + qenc_emulate_verify_reading(qdec_1_dev, 1, 1000, true, true, qdec_1_config_step); + + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put(qdec_1_dev); + } +#endif } static void sensor_channel_get_empty(const struct device *const dev) @@ -402,38 +419,40 @@ static void sensor_channel_get_empty(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_channel_get_empty) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_channel_get_empty(loopbacks[i].qdec); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_channel_get_empty(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_channel_get_empty(qdec_1_dev); +#endif } -static void sensor_channel_get_test(struct qdec_qenc_loopback *loopback) +static void sensor_channel_get_test(const struct device *const dev) { int rc; struct sensor_value val_first = {0}; struct sensor_value val_second = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(qdec_dev); } - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(qdec_dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val_first); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val_first); zassert_true(rc == 0, "Failed to get sample (%d)", rc); zassert_true(val_first.val1 != 0, "No readings from QDEC"); /* wait for more readings*/ k_msleep(200); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_ROTATION, &val_second); + rc = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &val_second); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); zassert_true(val_second.val1 != 0, "No readings from QDEC"); @@ -451,7 +470,7 @@ static void sensor_channel_get_test(struct qdec_qenc_loopback *loopback) val_second.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(qdec_dev); } } @@ -463,36 +482,38 @@ static void sensor_channel_get_test(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_channel_get) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_channel_get_test(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_channel_get_test(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_channel_get_test(qdec_1_dev); +#endif } -static void sensor_channel_get_negative(struct qdec_qenc_loopback *loopback) +static void sensor_channel_get_negative(const struct device *const dev) { int rc; struct sensor_value val = {0}; if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_get(loopback->qdec); + pm_device_runtime_get(dev); } - qenc_emulate_start(loopback, K_MSEC(10), true); + qenc_emulate_start(K_MSEC(10), true); /* wait for some readings*/ k_msleep(100); - rc = sensor_sample_fetch(loopback->qdec); + rc = sensor_sample_fetch(dev); zassert_true(rc == 0, "Failed to fetch sample (%d)", rc); - rc = sensor_channel_get(loopback->qdec, SENSOR_CHAN_MAX, &val); + rc = sensor_channel_get(dev, SENSOR_CHAN_MAX, &val); zassert_true(rc < 0, "Should failed to get sample (%d)", rc); zassert_true(val.val1 == 0, "Some readings from QDEC: %d", val.val1); zassert_true(val.val2 == 0, "Some readings from QDEC: %d", val.val2); if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put(loopback->qdec); + pm_device_runtime_put(dev); } } @@ -504,10 +525,12 @@ static void sensor_channel_get_negative(struct qdec_qenc_loopback *loopback) */ ZTEST(qdec_sensor, test_sensor_channel_get_negative) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_channel_get_negative(&loopbacks[i]); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_channel_get_negative(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_channel_get_negative(qdec_1_dev); +#endif } static void sensor_sample_fetch_test(const struct device *const dev) @@ -540,22 +563,32 @@ static void sensor_sample_fetch_test(const struct device *const dev) */ ZTEST(qdec_sensor, test_sensor_sample_fetch) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - TC_PRINT("Testing QDEC index %d, address: %p\n", i, loopbacks[i].qdec); - sensor_sample_fetch_test(loopbacks[i].qdec); - } + TC_PRINT("Testing QDEC-0, address: %p\n", qdec_dev); + sensor_sample_fetch_test(qdec_dev); +#if defined(SECOND_QDEC_INSTANCE) + TC_PRINT("Testing QDEC-1, address: %p\n", qdec_1_dev); + sensor_sample_fetch_test(qdec_1_dev); +#endif } static void *setup(void) { - for (size_t i = 0; i < TESTED_QDEC_COUNT; i++) { - int rc = device_is_ready(loopbacks[i].qdec); + int rc; - zassert_true(rc, "QDEC index %d not ready: %d", i, rc); + rc = device_is_ready(qdec_dev); + zassert_true(rc, "QDEC device not ready: %d", rc); + + qenc_emulate_setup_pin(&phase_a); + qenc_emulate_setup_pin(&phase_b); + +#if defined(SECOND_QDEC_INSTANCE) + rc = device_is_ready(qdec_1_dev); + zassert_true(rc, "QDEC 1 device not ready: %d", rc); + + qenc_emulate_setup_pin(&phase_a1); + qenc_emulate_setup_pin(&phase_b1); +#endif - qenc_emulate_setup_pin(&loopbacks[i].qenc_phase_a); - qenc_emulate_setup_pin(&loopbacks[i].qenc_phase_b); - } return NULL; } From f5e1a7162ff826538e83a035b3968ae7b07b053e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1510/3334] Revert "[nrf fromlist] drivers: serial: nrfx_uarte: Add mode with TIMER byte counting" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f94a2b57372be17b8dcefc8ad12ad12965241867. Signed-off-by: Tomasz Moń --- drivers/serial/Kconfig.nrfx | 26 - drivers/serial/Kconfig.nrfx_uart_instance | 7 - drivers/serial/uart_nrfx_uarte.c | 1026 ++------------------- 3 files changed, 88 insertions(+), 971 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index a39f882f644a..647e8cbb2e6f 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -79,32 +79,6 @@ config UART_ASYNC_TX_CACHE_SIZE in RAM, because EasyDMA in UARTE peripherals can only transfer data from RAM. -config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - bool "Use TIMER to count RX bytes" - depends on UART_ASYNC_API - depends on UART_NRFX_UARTE_LEGACY_SHIM - depends on !ARCH_POSIX # Mode not supported on BSIM target - select NRFX_GPPI - -config UART_NRFX_UARTE_BOUNCE_BUF_LEN - int "RX bounce buffer size" - depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - default 256 - range 64 1024 - help - Buffer is used when workaround with bounce buffers is applied - -config UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY - int "RX bounce buffer swap latency (in microseconds)" - depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - default 300 - help - Option decides how long before current bounce buffer is filled driver - attempts to swap the buffer. It must be long enough to ensure that - space following the buffer is not overwritten. Too high value results - in more frequent buffer swaps so it impacts performance. Setting should - take into account potential interrupt handling latency. - config UART_NRFX_UARTE_DIRECT_ISR bool "Use direct ISR" diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index 82ffaa10fcb9..b1a68d691c45 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -18,13 +18,6 @@ config UART_$(nrfx_uart_num)_ASYNC help This option enables UART Asynchronous API support on port $(nrfx_uart_num). -config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER - bool - depends on $(dt_nodelabel_has_prop,uart$(nrfx_uart_num),timer) - depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) - default y - imply UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - config UART_$(nrfx_uart_num)_ENHANCED_POLL_OUT bool "Efficient poll out on port $(nrfx_uart_num)" depends on !$(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),endtx-stoptx-supported) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 00489e7d8856..5196b21a082b 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -188,16 +188,6 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); /* Size of hardware fifo in RX path. */ #define UARTE_HW_RX_FIFO_SIZE 5 -/* TIMER CC channels for counting bytes with TIMER. */ -/* Channel used for capturing current counter value. */ -#define UARTE_TIMER_CAPTURE_CH 0 -/* Channel used to get compare event when number of received bytes reaches user buffer size. */ -#define UARTE_TIMER_USR_CNT_CH 1 -/* Channel used to get compare event when bounce buffer need to be switched. */ -#define UARTE_TIMER_BUF_SWITCH_CH 2 -/* Magic byte that is used to fill the buffer. */ -#define UARTE_MAGIC_BYTE 0xAA - #ifdef UARTE_ANY_ASYNC struct uarte_async_tx { @@ -211,30 +201,6 @@ struct uarte_async_tx { bool pending; }; -/* Structure with data for Count Bytes With Timer receiver mode (cbwt). */ -struct uarte_async_rx_cbwt { - uint8_t *curr_bounce_buf; - uint8_t *anomaly_byte_addr; - uint32_t usr_rd_off; - uint32_t usr_wr_off; - uint32_t bounce_off; - uint32_t bounce_limit; - uint32_t last_cnt; - uint32_t cc_usr; - uint32_t cc_swap; -#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE - size_t bounce_buf_swap_len; -#endif -#ifdef UARTE_ANY_CACHE - uint8_t *anomaly_byte_dst; - uint8_t anomaly_byte; -#endif - uint8_t bounce_idx; - uint8_t ppi_ch; - bool in_irq; - bool discard_fifo; -}; - struct uarte_async_rx { struct k_timer timer; #ifdef CONFIG_HAS_NORDIC_DMM @@ -246,9 +212,8 @@ struct uarte_async_rx { size_t offset; uint8_t *next_buf; size_t next_buf_len; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) +#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX +#if !defined(UARTE_HAS_FRAME_TIMEOUT) uint32_t idle_cnt; #endif k_timeout_t timeout; @@ -321,10 +286,6 @@ struct uarte_nrfx_data { #define UARTE_FLAG_POLL_OUT BIT(3) /* Flag indicating that a workaround for not working frame timeout is active. */ #define UARTE_FLAG_FTIMEOUT_WATCH BIT(4) -/* Flag indicating that UART_RX_BUF_REQUEST event need to be called from the interrupt context. */ -#define UARTE_FLAG_RX_BUF_REQ BIT(5) -/* Flag indicating that CC value in TIMER was set too late. */ -#define UARTE_FLAG_LATE_CC BIT(6) /* If enabled then ENDTX is PPI'ed to TXSTOP */ #define UARTE_CFG_FLAG_PPI_ENDTX BIT(0) @@ -343,12 +304,6 @@ struct uarte_nrfx_data { /* Indicates that workaround for spurious RXTO during restart shall be applied. */ #define UARTE_CFG_FLAG_SPURIOUS_RXTO BIT(3) -/* Indicates that UARTE/TIMER interrupt priority differs from system clock (GRTC/RTC). */ -#define UARTE_CFG_FLAG_VAR_IRQ BIT(4) - -/* Indicates that instance needs special handling of BAUDRATE register. */ -#define UARTE_CFG_FLAG_VOLATILE_BAUDRATE BIT(5) - /* Formula for getting the baudrate settings is following: * 2^12 * (2^20 / (f_PCLK / desired_baudrate)) where f_PCLK is a frequency that * drives the UARTE. @@ -385,14 +340,6 @@ struct uarte_nrfx_data { (baudrate) == 921600 ? NRF_UARTE_BAUDRATE_921600 : \ (baudrate) == 1000000 ? NRF_UARTE_BAUDRATE_1000000 : 0) -#define UARTE_MIN_BUF_SWAP_LEN 10 - -#define UARTE_US_TO_BYTES(baudrate) \ - DIV_ROUND_UP((CONFIG_UART_NRFX_UARTE_BOUNCE_BUF_SWAP_LATENCY * baudrate), 10000000) - -#define UARTE_BUF_SWAP_LEN(bounce_buf_len, baudrate) \ - ((bounce_buf_len) - MAX(UARTE_MIN_BUF_SWAP_LEN, UARTE_US_TO_BYTES(baudrate))) - #define LOW_POWER_ENABLED(_config) \ (IS_ENABLED(UARTE_ANY_LOW_POWER) && \ !IS_ENABLED(CONFIG_PM_DEVICE) && \ @@ -439,15 +386,6 @@ struct uarte_nrfx_config { #endif /* CONFIG_UART_USE_RUNTIME_CONFIGURE */ #ifdef UARTE_ANY_ASYNC -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - NRF_TIMER_Type * timer_regs; - IRQn_Type timer_irqn; - IRQn_Type uarte_irqn; - uint8_t *bounce_buf[2]; - size_t bounce_buf_len; - size_t bounce_buf_swap_len; - struct uarte_async_rx_cbwt *cbwt_data; -#endif nrfx_timer_t timer; uint8_t *tx_cache; uint8_t *rx_flush_buf; @@ -467,12 +405,6 @@ struct uarte_nrfx_config { (IS_ENABLED(UARTE_ANY_HW_ASYNC) ? \ (config->flags & UARTE_CFG_FLAG_HW_BYTE_COUNTING) : false) -/* Determine if instance is using an approach with counting bytes with TIMER (cbwt). */ -#define IS_CBWT(dev) \ - COND_CODE_1(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ - ((((const struct uarte_nrfx_config *)dev->config)->cbwt_data != NULL)), \ - (false)) - static inline NRF_UARTE_Type *get_uarte_instance(const struct device *dev) { const struct uarte_nrfx_config *config = dev->config; @@ -664,23 +596,10 @@ static int baudrate_set(const struct device *dev, uint32_t baudrate) return -EINVAL; } -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - struct uarte_async_rx_cbwt *cbwt_data = config->cbwt_data; - - cbwt_data->bounce_buf_swap_len = UARTE_BUF_SWAP_LEN(config->bounce_buf_len, - baudrate); - } -#endif - #ifdef UARTE_BAUDRATE_RETENTION_WORKAROUND - if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { - struct uarte_nrfx_data *data = dev->data; + struct uarte_nrfx_data *data = dev->data; - data->nrf_baudrate = nrf_baudrate; - } else { - nrf_uarte_baudrate_set(get_uarte_instance(dev), nrf_baudrate); - } + data->nrf_baudrate = nrf_baudrate; #else nrf_uarte_baudrate_set(get_uarte_instance(dev), nrf_baudrate); #endif @@ -868,11 +787,9 @@ static void uarte_periph_enable(const struct device *dev) #endif #if UARTE_BAUDRATE_RETENTION_WORKAROUND - if (config->flags & UARTE_CFG_FLAG_VOLATILE_BAUDRATE) { - nrf_uarte_baudrate_set(uarte, - COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, - (data->nrf_baudrate), (config->nrf_baudrate))); - } + nrf_uarte_baudrate_set(uarte, + COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, + (data->nrf_baudrate), (config->nrf_baudrate))); #endif #ifdef UARTE_ANY_ASYNC @@ -972,17 +889,13 @@ static void rx_buf_release(const struct device *dev, uint8_t *buf) user_callback(dev, &evt); } -static void rx_disable_finalize(const struct device *dev) +static void notify_rx_disable(const struct device *dev) { const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; struct uart_event evt = { .type = UART_RX_DISABLED, }; - async_rx->enabled = false; - if (LOW_POWER_ENABLED(cfg)) { uint32_t key = irq_lock(); @@ -1000,42 +913,28 @@ static void rx_disable_finalize(const struct device *dev) } } -static int rx_disable(const struct device *dev, bool api) +static int uarte_nrfx_rx_disable(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); int key; + if (async_rx->buf == NULL) { + return -EFAULT; + } + k_timer_stop(&async_rx->timer); key = irq_lock(); -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - if (cbwt_data) { - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_BUF_SWITCH_CH)); - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); - nrf_timer_int_disable(cfg->timer_regs, - nrf_timer_compare_int_get(UARTE_TIMER_BUF_SWITCH_CH) | - nrf_timer_compare_int_get(UARTE_TIMER_USR_CNT_CH)); - nrf_uarte_shorts_disable(cfg->uarte_regs, NRF_UARTE_SHORT_ENDRX_STARTRX); - } -#endif - if (async_rx->next_buf != NULL) { nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); } async_rx->enabled = false; - if (api) { - async_rx->discard_fifo = true; - } + async_rx->discard_fifo = true; nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); irq_unlock(key); @@ -1043,18 +942,6 @@ static int rx_disable(const struct device *dev, bool api) return 0; } -static int uarte_nrfx_rx_disable(const struct device *dev) -{ - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - - if (async_rx->buf == NULL) { - return -EFAULT; - } - - return rx_disable(dev, true); -} - #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -1079,10 +966,10 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) if (ret != NRFX_SUCCESS) { LOG_ERR("Timer already initialized"); return -EINVAL; + } else { + nrfx_timer_clear(&cfg->timer); } - nrfx_timer_clear(&cfg->timer); - ret = nrfx_gppi_channel_alloc(&data->async->rx.cnt.ppi); if (ret != NRFX_SUCCESS) { LOG_ERR("Failed to allocate PPI Channel"); @@ -1100,653 +987,6 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) } #endif /* !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) */ -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - -static uint32_t get_byte_cnt(NRF_TIMER_Type *timer) -{ - nrf_timer_task_trigger(timer, nrf_timer_capture_task_get(UARTE_TIMER_CAPTURE_CH)); - - nrf_barrier_w(); - - return nrf_timer_cc_get(timer, UARTE_TIMER_CAPTURE_CH); -} - -static void rx_buf_req(const struct device *dev) -{ - struct uart_event evt = { - .type = UART_RX_BUF_REQUEST, - }; - - user_callback(dev, &evt); -} - -static bool notify_rx_rdy(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - size_t len = cbwt_data->usr_wr_off - cbwt_data->usr_rd_off; - - if (len == 0) { - return async_rx->buf != NULL; - } - - struct uart_event evt = { - .type = UART_RX_RDY, - .data.rx.buf = async_rx->buf, - .data.rx.len = len, - .data.rx.offset = cbwt_data->usr_rd_off - }; - user_callback(dev, &evt); - cbwt_data->usr_rd_off += len; - - if (cbwt_data->usr_rd_off == async_rx->buf_len) { - rx_buf_release(dev, async_rx->buf); - async_rx->buf = async_rx->next_buf; - async_rx->buf_len = async_rx->next_buf_len; - async_rx->next_buf_len = 0; - async_rx->next_buf = 0; - cbwt_data->usr_rd_off = 0; - cbwt_data->usr_wr_off = 0; - - if (async_rx->buf_len == 0) { - return false; - } - - /* Set past value to ensure that event will not expire after clearing but - * before setting the new value. - */ - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, cbwt_data->cc_usr - 1); - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); - cbwt_data->cc_usr += async_rx->buf_len; - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, cbwt_data->cc_usr); - - /* Check if CC is already in the past. In that case trigger CC handling.*/ - if (cbwt_data->cc_usr <= get_byte_cnt(cfg->timer_regs)) { - atomic_or(&data->flags, UARTE_FLAG_LATE_CC); - NRFX_IRQ_PENDING_SET(cfg->timer_irqn); - } else { - atomic_and(&data->flags, ~UARTE_FLAG_LATE_CC); - } - } - - return true; -} - -static void anomaly_byte_handle(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint8_t curr_byte, anomaly_byte; - uint32_t diff; - - if (cbwt_data->anomaly_byte_addr == NULL) { - return; - } - - diff = cfg->uarte_regs->DMA.RX.PTR - (uint32_t)cbwt_data->curr_bounce_buf; - /* Anomaly can be checked only if more than 1 byte is received to the current buffer. */ - if (diff < 2) { - return; - } - - if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { - sys_cache_data_invd_range(cbwt_data->curr_bounce_buf, 1); - sys_cache_data_invd_range(cbwt_data->anomaly_byte_addr, 1); - } - - curr_byte = cbwt_data->curr_bounce_buf[0]; - anomaly_byte = *cbwt_data->anomaly_byte_addr; - if ((curr_byte == UARTE_MAGIC_BYTE) && (anomaly_byte != UARTE_MAGIC_BYTE)) { -#ifdef UARTE_ANY_CACHE - if (cfg->flags & UARTE_CFG_FLAG_CACHEABLE) { - /* We cannot write directly to curr_bounce_buf as it is written by - * DMA and with cache operations data may be overwritten. Copying - * need to be postponed to the moment when user buffer is filled. - */ - cbwt_data->anomaly_byte = anomaly_byte; - cbwt_data->anomaly_byte_dst = &cbwt_data->curr_bounce_buf[0]; - } else { - cbwt_data->curr_bounce_buf[0] = anomaly_byte; - } -#else - cbwt_data->curr_bounce_buf[0] = anomaly_byte; -#endif - } - - cbwt_data->anomaly_byte_addr = NULL; -} - -static uint32_t fill_usr_buf(const struct device *dev, uint32_t len) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - uint8_t *buf = cfg->bounce_buf[cbwt_data->bounce_idx]; - uint32_t usr_rem = async_rx->buf_len - cbwt_data->usr_wr_off; - uint32_t bounce_rem = cbwt_data->bounce_limit - cbwt_data->bounce_off; - uint32_t cpy_len = MIN(bounce_rem, MIN(usr_rem, len)); - - __ASSERT(cpy_len + cbwt_data->bounce_off <= cfg->bounce_buf_len, - "Exceeding the buffer cpy_len:%d off:%d limit:%d", - cpy_len, cbwt_data->bounce_off, cbwt_data->bounce_limit); - - if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { - sys_cache_data_invd_range(&buf[cbwt_data->bounce_off], cpy_len); - } - - memcpy(&async_rx->buf[cbwt_data->usr_wr_off], &buf[cbwt_data->bounce_off], cpy_len); -#ifdef UARTE_ANY_CACHE - if ((buf == cbwt_data->anomaly_byte_dst) && (cbwt_data->bounce_off == 0)) { - async_rx->buf[cbwt_data->usr_wr_off] = cbwt_data->anomaly_byte; - cbwt_data->anomaly_byte_dst = NULL; - } -#endif - cbwt_data->bounce_off += cpy_len; - cbwt_data->usr_wr_off += cpy_len; - cbwt_data->last_cnt += cpy_len; - if (cbwt_data->bounce_off == cbwt_data->bounce_limit) { - /* Bounce buffer drained */ - cbwt_data->bounce_idx = cbwt_data->bounce_idx == 0 ? 1 : 0; - cbwt_data->bounce_off = 0; - cbwt_data->bounce_limit = cfg->bounce_buf_len; - } - - return cpy_len; -} - -static bool update_usr_buf(const struct device *dev, uint32_t len, bool notify_any, bool buf_req) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - anomaly_byte_handle(dev); - - do { - uint32_t cpy_len = len ? fill_usr_buf(dev, len) : 0; - bool usr_buf_full = cbwt_data->usr_wr_off == async_rx->buf_len; - - len -= cpy_len; - if (((len == 0) && notify_any) || usr_buf_full) { - if (!notify_rx_rdy(dev)) { - return false; - } - - if (usr_buf_full && buf_req) { - rx_buf_req(dev); - } - } - } while (len > 0); - - return true; -} - -static void prepare_bounce_buf(const struct device *dev, uint8_t *buf, - size_t swap_len, size_t len) -{ - const struct uarte_nrfx_config *cfg = dev->config; - - buf[0] = UARTE_MAGIC_BYTE; - for (size_t i = swap_len; i < len; i++) { - buf[i] = UARTE_MAGIC_BYTE; - } - - if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { - sys_cache_data_flush_range(buf, 1); - sys_cache_data_flush_range(&buf[swap_len], len); - } -} - -/* This function is responsible for swapping the bounce buffer and it is the most - * tricky part of the solution. Receiver is continuously working and we want to - * change DMA pointer on the fly. DMA is also incrementing that pointer so there are - * moments in the reception when updating the pointer will result in different behavior. - * - * There are two main cases that need to be handled: - * 1. PTR is updated and there was no byte boundary (in the middle of a byte or there is - * no byte on the line). It is a safe spot. - * - * The most common and simplest case. PTR is update but since - * DMA already started the reception of the previous byte it means that next byte will - * be stored in the previous PTR and bytes following that byte will be stored to the - * new bounce buffer - * - * 2. Updating the pointer collided with byte boundary. - * - * RXDRDY and RXSTARTED events are used to detect if collision occurred. - * There are few scenarios that may happen and the driver must detect which one occurred. - * Detection is done by reading back the PTR register. Following cases are considered: - * - * - PTR did not change. It means that it was written after byte boundary. It is the same - * case as if PTR was updated in the safe spot. - * - * - PTR is updated by 1. There is an anomaly and it is unclear where next byte will be - * copied. PTR state indicates that it should be copied to the beginning of the new - * bounce buffer but it might be copied to the previous bounce buffer. Both locations - * are written with a magic byte (0xAA) and later on it is checked which location has - * changed and if byte was written to the previous bounce buffer it is copied to the - * start of the new bounce buffer. - * - * - PTR is not updated with the new bounce buffer location. DMA is incrementing PTR content - * and it is possible that SW writes new value between read and modify and DMA may - * overwrite value written by the driver. In that case reception continuous to the - * previous bounce buffer and swap procedure need to be repeated. - */ -static int bounce_buf_swap(const struct device *dev, uint8_t *prev_bounce_buf) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t prev_buf_cnt, new_cnt, cnt, ptr; - uint32_t prev_buf_inc = 1; - int key; - - key = irq_lock(); - /* Clear events that indicates byte boundary and set PTR. If events are set - * after PTR is set then we know that setting PTR collided with byte boundary. - */ - nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED); - nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); - cfg->uarte_regs->DMA.RX.PTR = (uint32_t)cbwt_data->curr_bounce_buf; - cnt = get_byte_cnt(cfg->timer_regs); - - if (!nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY) && - !nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED)) { - /* RXDRDY did not happen when PTR was set. Safest case. PTR was updated - * correctly. Last byte will be received to the previous buffer. - */ - new_cnt = 0; - prev_buf_cnt = cnt - cbwt_data->last_cnt; - goto no_collision; - } - - /* Setting PTR collided with byte boundary we need to detect what happened. */ - while (!nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXSTARTED)) { - } - - /* Read pointer when there is no new byte coming. */ - do { - cnt = get_byte_cnt(cfg->timer_regs); - ptr = cfg->uarte_regs->DMA.RX.PTR; - } while (cnt != get_byte_cnt(cfg->timer_regs)); - - new_cnt = ptr - (uint32_t)cbwt_data->curr_bounce_buf; - prev_buf_cnt = cnt - cbwt_data->last_cnt; - - if (new_cnt == 0) { - /* New PTR is not incremented. It was written after LIST post ENDRX - * incrementation. - */ - } else if (new_cnt == 1) { - /* new_cnt == 1. New PTR incremented. It's possible that data is already - * copied to that new location or it is written to the tail of the previous - * bounce buffer. We try to detect what happens. - */ - prev_buf_inc = 0; - cbwt_data->anomaly_byte_addr = - &prev_bounce_buf[cbwt_data->bounce_off + prev_buf_cnt]; - } else if (new_cnt <= cfg->bounce_buf_len) { - prev_buf_inc = 0; - prev_buf_cnt = cnt - cbwt_data->last_cnt - (new_cnt - 1); - } else { - /* New PTR value is not set. Re-set PTR is needed. Transfer continues to - * previous buffer whole buffer swapping need to be repeat. - */ - irq_unlock(key); - return -EAGAIN; - } - -no_collision: - cbwt_data->bounce_limit = cbwt_data->bounce_off + prev_buf_cnt + prev_buf_inc; - __ASSERT(cbwt_data->bounce_limit < cfg->bounce_buf_len, - "Too high limit (%d, max:%d), increase latency", - cbwt_data->bounce_limit, cfg->bounce_buf_len); - irq_unlock(key); - - return prev_buf_cnt; -} - -static size_t get_swap_len(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; -#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - return cbwt_data->bounce_buf_swap_len; -#else - return cfg->bounce_buf_swap_len; -#endif -} - -static void bounce_buf_switch(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - int new_data = cbwt_data->cc_swap - cbwt_data->last_cnt; - uint8_t *prev_bounce_buf = cbwt_data->curr_bounce_buf; - int prev_cnt; - - /* Fill user buffer with all pending data. */ - if (!update_usr_buf(dev, new_data < 0 ? 0 : new_data, false, true)) { - rx_disable(dev, false); - return; - } - - cbwt_data->curr_bounce_buf = (cbwt_data->curr_bounce_buf == cfg->bounce_buf[0]) ? - cfg->bounce_buf[1] : cfg->bounce_buf[0]; - prepare_bounce_buf(dev, cbwt_data->curr_bounce_buf, get_swap_len(dev), - cfg->bounce_buf_len); - - /* Swapping may need retry. */ - while ((prev_cnt = bounce_buf_swap(dev, prev_bounce_buf)) < 0) { - } - - /* Update user buffer with data that was received during swapping. */ - if (update_usr_buf(dev, prev_cnt, false, true)) { - /* Set compare event for next moment when bounce buffers need to be swapped. */ - cbwt_data->cc_swap += get_swap_len(dev); - __ASSERT(cbwt_data->cc_swap > get_byte_cnt(cfg->timer_regs), - "Setting CC too late next:%d cnt:%d", - cbwt_data->cc_swap, get_byte_cnt(cfg->timer_regs)); - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH, cbwt_data->cc_swap); - } else { - /* Stop RX. */ - rx_disable(dev, false); - } -} - -static void usr_buf_complete(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t rem = async_rx->buf_len - cbwt_data->usr_wr_off; - - __ASSERT_NO_MSG(rem <= (get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt)); - - if (!update_usr_buf(dev, rem, true, true)) { - /* Stop RX if there is no next buffer. */ - rx_disable(dev, false); - } -} - -static void notify_new_data(const struct device *dev, bool buf_req) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t cnt = get_byte_cnt(cfg->timer_regs); - uint32_t new_data = cnt - cbwt_data->last_cnt; - - (void)update_usr_buf(dev, new_data, true, buf_req); -} - -static void cbwt_rx_timeout(struct k_timer *timer) -{ - const struct device *dev = k_timer_user_data_get(timer); - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - struct uarte_async_rx *async_rx = &data->async->rx; - - if (nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY)) { - nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); - async_rx->idle_cnt = 0; - } else { - async_rx->idle_cnt++; - if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { - if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { - if (cbwt_data->in_irq) { - /* TIMER or UARTE interrupt preempted. Lets try again - * later. - */ - k_timer_start(timer, async_rx->timeout, K_NO_WAIT); - return; - } - irq_disable(cfg->uarte_irqn); - irq_disable(cfg->timer_irqn); - } - - nrf_uarte_int_enable(cfg->uarte_regs, NRF_UARTE_INT_RXDRDY_MASK); - notify_new_data(dev, true); - - if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { - irq_enable(cfg->uarte_irqn); - irq_enable(cfg->timer_irqn); - } - return; - } - } - - k_timer_start(timer, async_rx->timeout, K_NO_WAIT); -} - -static void cbwt_rx_flush_handle(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t rem_data = get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt; - uint32_t bbuf_rem_data = cbwt_data->bounce_limit - cbwt_data->bounce_off; - uint32_t amount; - uint8_t *dst; - - nrf_uarte_rx_buffer_set(uarte, cfg->rx_flush_buf, UARTE_HW_RX_FIFO_SIZE); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_FLUSHRX); - while (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) { - /* empty */ - } - - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); - if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED)) { - /* FIFO is empty. */ - return; - } - - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - amount = nrf_uarte_rx_amount_get(uarte); - - if (rem_data <= bbuf_rem_data) { - /* instead of -1 it should be -amount but RXDRDY event is not generated - * for bytes following first that goes to FIFO they are generated during flushing. - */ - dst = &cfg->bounce_buf[cbwt_data->bounce_idx][cbwt_data->bounce_off + rem_data - 1]; - } else { - /* See comment in if clause. */ - dst = &cbwt_data->curr_bounce_buf[rem_data - bbuf_rem_data - 1]; - } - - if (IS_ENABLED(UARTE_ANY_CACHE) && (cfg->flags & UARTE_CFG_FLAG_CACHEABLE)) { - sys_cache_data_invd_range(cfg->rx_flush_buf, amount); - sys_cache_data_invd_range(dst, amount); - } - - memcpy(dst, cfg->rx_flush_buf, amount); -} - -static void cbwt_rxto_isr(const struct device *dev, bool do_flush) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - - if (async_rx->buf) { - notify_new_data(dev, false); - } - - if (async_rx->buf) { - rx_buf_release(dev, async_rx->buf); - async_rx->buf = NULL; - } - - if (async_rx->next_buf) { - rx_buf_release(dev, async_rx->next_buf); - async_rx->next_buf = NULL; - } - - if (do_flush) { - cbwt_rx_flush_handle(dev); - } - - if (async_rx->discard_fifo) { - cbwt_data->discard_fifo = async_rx->discard_fifo; - async_rx->discard_fifo = false; - } - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_STOP); - rx_disable_finalize(dev); -} - -static bool timer_ch_evt_check_clear(NRF_TIMER_Type *timer, uint32_t ch) -{ - nrf_timer_event_t evt = nrf_timer_compare_event_get(ch); - - if (nrf_timer_event_check(timer, evt)) { - nrf_timer_event_clear(timer, evt); - return true; - } - - return false; -} - -static void timer_isr(const void *arg) -{ - const struct device *dev = arg; - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - static const uint32_t flags_to_check = UARTE_FLAG_RX_BUF_REQ | - UARTE_FLAG_TRIG_RXTO | - UARTE_FLAG_LATE_CC; - uint32_t flags = atomic_and(&data->flags, ~flags_to_check); - - cbwt_data->in_irq = true; - - if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH) || - (flags & UARTE_FLAG_LATE_CC)) { - usr_buf_complete(dev); - } - - /* Must be after user buf complet CC handling. */ - if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH)) { - bounce_buf_switch(dev); - } - - if (flags & UARTE_FLAG_RX_BUF_REQ) { - rx_buf_req(dev); - } - - if (flags & UARTE_FLAG_TRIG_RXTO) { - cbwt_rxto_isr(dev, false); - } - - cbwt_data->in_irq = false; -} - -static void cbwt_rx_enable(const struct device *dev, bool with_timeout) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - uint32_t rem_data; - uint32_t len = async_rx->buf_len; - uint32_t rx_int_mask = NRF_UARTE_INT_RXTO_MASK | - (with_timeout ? NRF_UARTE_INT_RXDRDY_MASK : 0); - - if (cbwt_data->discard_fifo) { - rem_data = 0; - cbwt_data->discard_fifo = false; - } else { - rem_data = get_byte_cnt(cfg->timer_regs) - cbwt_data->last_cnt; - } - - cbwt_data->usr_rd_off = 0; - cbwt_data->usr_wr_off = 0; - - if (rem_data >= len) { - atomic_or(&data->flags, UARTE_FLAG_TRIG_RXTO); - NRFX_IRQ_PENDING_SET(cfg->timer_irqn); - return; - } else if (rem_data) { - (void)update_usr_buf(dev, rem_data, false, true); - len -= rem_data; - } - - prepare_bounce_buf(dev, cfg->bounce_buf[0], get_swap_len(dev), cfg->bounce_buf_len); - - cbwt_data->last_cnt = 0; - cbwt_data->bounce_off = 0; - cbwt_data->bounce_idx = 0; - cbwt_data->curr_bounce_buf = cfg->bounce_buf[0]; - cbwt_data->bounce_limit = cfg->bounce_buf_len; - /* Enable ArrayList. */ - nrf_uarte_shorts_enable(cfg->uarte_regs, NRF_UARTE_SHORT_ENDRX_STARTRX); - nrf_uarte_event_clear(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); - nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); - nrf_uarte_rx_buffer_set(cfg->uarte_regs, cbwt_data->curr_bounce_buf, 1); - - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_BUF_SWITCH_CH)); - nrf_timer_event_clear(cfg->timer_regs, - nrf_timer_compare_event_get(UARTE_TIMER_USR_CNT_CH)); - nrf_timer_int_enable(cfg->timer_regs, - nrf_timer_compare_int_get(UARTE_TIMER_BUF_SWITCH_CH) | - nrf_timer_compare_int_get(UARTE_TIMER_USR_CNT_CH)); - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_CLEAR); - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_START); - cbwt_data->cc_usr = len; - cbwt_data->cc_swap = get_swap_len(dev); - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_BUF_SWITCH_CH, get_swap_len(dev)); - nrf_timer_cc_set(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH, len); - - atomic_or(&data->flags, UARTE_FLAG_RX_BUF_REQ); - nrf_uarte_task_trigger(cfg->uarte_regs, NRF_UARTE_TASK_STARTRX); - NRFX_IRQ_PENDING_SET(cfg->timer_irqn); -} - -static int cbwt_uarte_async_init(const struct device *dev) -{ - /* As this approach does not use nrfx_timer driver but only HAL special setup - * function is used. - */ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; - static const uint32_t rx_int_mask = NRF_UARTE_INT_ERROR_MASK | - NRF_UARTE_INT_RXTO_MASK; - uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); - uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT); - nrfx_err_t ret; - - nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER); - nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32); - - ret = nrfx_gppi_channel_alloc(&cbwt_data->ppi_ch); - if (ret != NRFX_SUCCESS) { - return -ENOMEM; - } - - nrfx_gppi_channel_endpoints_setup(cbwt_data->ppi_ch, evt, tsk); - nrfx_gppi_channels_enable(BIT(cbwt_data->ppi_ch)); - -#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE - cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; -#endif - - /* Enable EasyDMA LIST feature (it is exposed in SPIM but not in UARTE). */ - *(volatile uint32_t *)((uint32_t)cfg->uarte_regs + 0x714) = 1; - nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); - - return 0; -} -#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER */ - static int uarte_async_init(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; @@ -1759,17 +999,6 @@ static int uarte_async_init(const struct device *dev) ((IS_ENABLED(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && !IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) ? NRF_UARTE_INT_RXDRDY_MASK : 0); - k_timer_init(&data->async->rx.timer, rx_timeout, NULL); - k_timer_user_data_set(&data->async->rx.timer, (void *)dev); - k_timer_init(&data->async->tx.timer, tx_timeout, NULL); - k_timer_user_data_set(&data->async->tx.timer, (void *)dev); - -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - return cbwt_uarte_async_init(dev); - } -#endif - #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) int ret = uarte_nrfx_rx_counting_init(dev); @@ -1780,6 +1009,11 @@ static int uarte_async_init(const struct device *dev) nrf_uarte_int_enable(uarte, rx_int_mask); + k_timer_init(&data->async->rx.timer, rx_timeout, NULL); + k_timer_user_data_set(&data->async->rx.timer, (void *)dev); + k_timer_init(&data->async->tx.timer, tx_timeout, NULL); + k_timer_user_data_set(&data->async->tx.timer, (void *)dev); + return 0; } @@ -1928,7 +1162,6 @@ static uint32_t us_to_bauds(uint32_t baudrate, int32_t timeout) } #endif - static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, size_t len, int32_t timeout) @@ -1938,11 +1171,6 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, const struct uarte_nrfx_config *cfg = dev->config; NRF_UARTE_Type *uarte = get_uarte_instance(dev); -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - bool with_timeout = timeout != SYS_FOREVER_US; -#endif - if (cfg->disable_rx) { __ASSERT(false, "TX only UARTE instance"); return -ENOTSUP; @@ -1957,45 +1185,35 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } #ifdef CONFIG_HAS_NORDIC_DMM - if (!IS_CBWT(dev)) { - void *dma_buf; - int ret = 0; + uint8_t *dma_buf; + int ret = 0; - ret = dmm_buffer_in_prepare(cfg->mem_reg, buf, len, &dma_buf); - if (ret < 0) { - return ret; - } - - async_rx->usr_buf = buf; - buf = dma_buf; + ret = dmm_buffer_in_prepare(cfg->mem_reg, buf, len, (void **)&dma_buf); + if (ret < 0) { + return ret; } -#endif -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + async_rx->usr_buf = buf; + buf = dma_buf; +#endif +#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX #ifdef UARTE_HAS_FRAME_TIMEOUT - if (!IS_CBWT(dev) && with_timeout) { + if (timeout != SYS_FOREVER_US) { uint32_t baudrate = COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, - (data->uart_config.baudrate), (cfg->baudrate)); + (data->uart_config.baudrate), (cfg->baudrate)); + + async_rx->timeout = K_USEC(timeout); nrf_uarte_frame_timeout_set(uarte, us_to_bauds(baudrate, timeout)); nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_FRAME_TIMEOUT_STOPRX); - } -#endif -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - async_rx->idle_cnt = 0; -#endif - - if (with_timeout) { - if (!IS_CBWT(dev) && IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) { - async_rx->timeout = K_USEC(timeout); - } else { - async_rx->timeout = with_timeout ? - K_USEC(timeout / RX_TIMEOUT_DIV) : K_NO_WAIT; - } } else { async_rx->timeout = K_NO_WAIT; } +#else + async_rx->timeout = (timeout == SYS_FOREVER_US) ? + K_NO_WAIT : K_USEC(timeout / RX_TIMEOUT_DIV); + async_rx->idle_cnt = 0; +#endif /* UARTE_HAS_FRAME_TIMEOUT */ #else async_rx->timeout_us = timeout; async_rx->timeout_slab = timeout / RX_TIMEOUT_DIV; @@ -2023,20 +1241,8 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } } pm_device_runtime_get(dev); - } else if (LOW_POWER_ENABLED(cfg)) { - unsigned int key = irq_lock(); - - uarte_enable_locked(dev, UARTE_FLAG_LOW_POWER_RX); - irq_unlock(key); } -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - cbwt_rx_enable(dev, with_timeout); - return 0; - } -#endif - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) || LOW_POWER_ENABLED(cfg)) { if (async_rx->flush_cnt) { int cpy_len = MIN(len, async_rx->flush_cnt); @@ -2073,7 +1279,7 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, return 0; } else { #ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX - if (with_timeout) { + if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); @@ -2098,6 +1304,13 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, async_rx->enabled = true; + if (LOW_POWER_ENABLED(cfg)) { + unsigned int key = irq_lock(); + + uarte_enable_locked(dev, UARTE_FLAG_LOW_POWER_RX); + irq_unlock(key); + } + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); return 0; @@ -2116,33 +1329,29 @@ static int uarte_nrfx_rx_buf_rsp(const struct device *dev, uint8_t *buf, err = -EACCES; } else if (async_rx->next_buf == NULL) { #ifdef CONFIG_HAS_NORDIC_DMM - if (!IS_CBWT(dev)) { - uint8_t *dma_buf; - const struct uarte_nrfx_config *config = dev->config; + uint8_t *dma_buf; + const struct uarte_nrfx_config *config = dev->config; - err = dmm_buffer_in_prepare(config->mem_reg, buf, len, (void **)&dma_buf); - if (err < 0) { - return err; - } - async_rx->next_usr_buf = buf; - buf = dma_buf; + err = dmm_buffer_in_prepare(config->mem_reg, buf, len, (void **)&dma_buf); + if (err < 0) { + return err; } + async_rx->next_usr_buf = buf; + buf = dma_buf; #endif async_rx->next_buf = buf; async_rx->next_buf_len = len; - if (!IS_CBWT(dev)) { - nrf_uarte_rx_buffer_set(uarte, buf, len); - /* If buffer is shorter than RX FIFO then there is a risk that due - * to interrupt handling latency ENDRX event is not handled on time - * and due to ENDRX_STARTRX short data will start to be overwritten. - * In that case short is not enabled and ENDRX event handler will - * manually start RX for that buffer. Thanks to RX FIFO there is - * 5 byte time for doing that. If interrupt latency is higher and - * there is no HWFC in both cases data will be lost or corrupted. - */ - if (len >= UARTE_HW_RX_FIFO_SIZE) { - nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); - } + nrf_uarte_rx_buffer_set(uarte, buf, len); + /* If buffer is shorter than RX FIFO then there is a risk that due + * to interrupt handling latency ENDRX event is not handled on time + * and due to ENDRX_STARTRX short data will start to be overwritten. + * In that case short is not enabled and ENDRX event handler will + * manually start RX for that buffer. Thanks to RX FIFO there is + * 5 byte time for doing that. If interrupt latency is higher and + * there is no HWFC in both cases data will be lost or corrupted. + */ + if (len >= UARTE_HW_RX_FIFO_SIZE) { + nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); } err = 0; } else { @@ -2192,13 +1401,6 @@ static void rx_timeout(struct k_timer *timer) NRF_UARTE_Type *uarte = get_uarte_instance(dev); #ifdef UARTE_HAS_FRAME_TIMEOUT -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - cbwt_rx_timeout(timer); - return; - } -#endif - struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; bool rxdrdy = nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY); @@ -2345,7 +1547,7 @@ static void error_isr(const struct device *dev) nrf_uarte_errorsrc_clear(uarte, err); user_callback(dev, &evt); - (void)rx_disable(dev, false); + (void) uarte_nrfx_rx_disable(dev); } static void rxstarted_isr(const struct device *dev) @@ -2564,6 +1766,7 @@ static void rxto_isr(const struct device *dev) * In the second case, additionally, data from the UARTE internal RX * FIFO need to be discarded. */ + async_rx->enabled = false; if (async_rx->discard_fifo) { async_rx->discard_fifo = false; #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) @@ -2591,7 +1794,15 @@ static void rxto_isr(const struct device *dev) #endif nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); #endif - rx_disable_finalize(dev); + + if (LOW_POWER_ENABLED(config)) { + uint32_t key = irq_lock(); + + uarte_disable_locked(dev, UARTE_FLAG_LOW_POWER_RX); + irq_unlock(key); + } + + notify_rx_disable(dev); } static void txstopped_isr(const struct device *dev) @@ -2681,12 +1892,10 @@ static void txstopped_isr(const struct device *dev) static void rxdrdy_isr(const struct device *dev) { -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) struct uarte_nrfx_data *data = dev->data; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) NRF_UARTE_Type *uarte = get_uarte_instance(dev); data->async->rx.idle_cnt = 0; @@ -2718,9 +1927,8 @@ static void uarte_nrfx_isr_async(const void *arg) struct uarte_async_rx *async_rx = &data->async->rx; uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); - if ((IS_CBWT(dev) || - !(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT))) && - event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { + if (!(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) + && event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { rxdrdy_isr(dev); } @@ -2748,12 +1956,6 @@ static void uarte_nrfx_isr_async(const void *arg) rxstarted_isr(dev); } -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev) && - event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask)) { - cbwt_rxto_isr(dev, true); - } else -#endif /* RXTO must be handled after ENDRX which should notify the buffer. * Skip if ENDRX is set when RXTO is set. It means that * ENDRX occurred after check for ENDRX in isr which may happen when @@ -2778,8 +1980,7 @@ static void uarte_nrfx_isr_async(const void *arg) txstopped_isr(dev); } - if (!IS_CBWT(dev) && - (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO)) { + if (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO) { #ifdef CONFIG_HAS_NORDIC_DMM int ret; @@ -2794,7 +1995,7 @@ static void uarte_nrfx_isr_async(const void *arg) rx_buf_release(dev, async_rx->buf); async_rx->buf_len = 0; async_rx->buf = NULL; - rx_disable_finalize(dev); + notify_rx_disable(dev); } } @@ -3408,44 +2609,6 @@ static int uarte_instance_deinit(const struct device *dev) return pm_device_driver_deinit(dev, uarte_nrfx_pm_action); } -#define UARTE_TIMER_REG(idx) (NRF_TIMER_Type *)DT_REG_ADDR(DT_PHANDLE(UARTE(idx), timer)) - -#define UARTE_TIMER_IRQN(idx) DT_IRQN(DT_PHANDLE(UARTE(idx), timer)) - -#define UARTE_TIMER_IRQ_PRIO(idx) DT_IRQ(DT_PHANDLE(UARTE(idx), timer), priority) - -#define UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx) \ - IF_ENABLED(UARTE_HAS_PROP(idx, timer), \ - (.timer_regs = UARTE_TIMER_REG(idx), \ - .timer_irqn = UARTE_TIMER_IRQN(idx), \ - .uarte_irqn = DT_IRQN(UARTE(idx)), \ - .bounce_buf = { \ - uart##idx##_bounce_buf, \ - &uart##idx##_bounce_buf[sizeof(uart##idx##_bounce_buf) / 2] \ - }, \ - .bounce_buf_len = sizeof(uart##idx##_bounce_buf) / 2, \ - .bounce_buf_swap_len = UARTE_BUF_SWAP_LEN(sizeof(uart##idx##_bounce_buf) / 2,\ - UARTE_US_TO_BYTES(UARTE_PROP(idx, current_speed))), \ - .cbwt_data = &uart##idx##_bounce_data,)) - -#define UARTE_COUNT_BYTES_WITH_TIMER_VALIDATE_CONFIG(idx) \ - __ASSERT_NO_MSG(UARTE_TIMER_IRQ_PRIO(idx) == DT_IRQ(UARTE(idx), priority)) - -#define UARTE_TIMER_IRQ_CONNECT(idx, func) \ - IF_ENABLED(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ - UARTE_HAS_PROP(idx, timer)), \ - (UARTE_COUNT_BYTES_WITH_TIMER_VALIDATE_CONFIG(idx); \ - IRQ_CONNECT(UARTE_TIMER_IRQN(idx), UARTE_TIMER_IRQ_PRIO(idx), func, \ - DEVICE_DT_GET(UARTE(idx)), 0); \ - irq_enable(UARTE_TIMER_IRQN(idx));)) - -/* Macro sets flag to indicate that uart use different interrupt priority than the system clock. */ -#define UARTE_HAS_VAR_PRIO(idx) \ - COND_CODE_1(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ - UARTE_HAS_PROP(idx, timer)), \ - ((DT_IRQ(UARTE(idx), priority) != DT_IRQ(DT_NODELABEL(grtc), priority)) ? \ - UARTE_CFG_FLAG_VAR_IRQ : 0), (0)) - #define UARTE_GET_ISR(idx) \ COND_CODE_1(CONFIG_UART_##idx##_ASYNC, (uarte_nrfx_isr_async), (uarte_nrfx_isr_int)) @@ -3461,18 +2624,16 @@ static int uarte_instance_deinit(const struct device *dev) )) /* Depending on configuration standard or direct IRQ is connected. */ -#define UARTE_IRQ_CONNECT(idx, irqn, prio) \ - COND_CODE_1(CONFIG_UART_NRFX_UARTE_NO_IRQ, (), \ - (COND_CODE_1(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, \ - (IRQ_DIRECT_CONNECT(irqn, prio, uarte_##idx##_direct_isr, 0)), \ - (IRQ_CONNECT(irqn, prio, UARTE_GET_ISR(idx), \ - DEVICE_DT_GET(UARTE(idx)), 0))))) +#define UARTE_IRQ_CONNECT(idx, irqn, prio) \ + COND_CODE_1(CONFIG_UART_NRFX_UARTE_NO_IRQ, (), \ + (COND_CODE_1(CONFIG_UART_NRFX_UARTE_DIRECT_ISR, \ + (IRQ_DIRECT_CONNECT(irqn, prio, uarte_##idx##_direct_isr, 0)), \ + (IRQ_CONNECT(irqn, prio, UARTE_GET_ISR(idx), DEVICE_DT_GET(UARTE(idx)), 0))))) #define UARTE_IRQ_CONFIGURE(idx) \ do { \ UARTE_IRQ_CONNECT(idx, DT_IRQN(UARTE(idx)), DT_IRQ(UARTE(idx), priority)); \ irq_enable(DT_IRQN(UARTE(idx))); \ - UARTE_TIMER_IRQ_CONNECT(idx, timer_isr) \ } while (false) /* Low power mode is used when disable_rx is not defined or in async mode if @@ -3579,12 +2740,6 @@ static int uarte_instance_deinit(const struct device *dev) UARTE_INT_DRIVEN(idx); \ PINCTRL_DT_DEFINE(UARTE(idx)); \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, ( \ - IF_ENABLED(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ - UARTE_HAS_PROP(idx, timer)), \ - (static uint8_t uart##idx##_bounce_buf[CONFIG_UART_NRFX_UARTE_BOUNCE_BUF_LEN] \ - DMM_MEMORY_SECTION(UARTE(idx)); \ - static struct uarte_async_rx_cbwt uart##idx##_bounce_data; \ - )) \ static uint8_t \ uarte##idx##_tx_cache[CONFIG_UART_ASYNC_TX_CACHE_SIZE] \ DMM_MEMORY_SECTION(UARTE(idx)); \ @@ -3626,10 +2781,6 @@ static int uarte_instance_deinit(const struct device *dev) (IS_ENABLED(CONFIG_UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND) && \ INSTANCE_IS_HIGH_SPEED(_, /*empty*/, idx, _) ? \ UARTE_CFG_FLAG_SPURIOUS_RXTO : 0) | \ - ((IS_ENABLED(UARTE_BAUDRATE_RETENTION_WORKAROUND) && \ - UARTE_IS_CACHEABLE(idx)) ? \ - UARTE_CFG_FLAG_VOLATILE_BAUDRATE : 0) | \ - UARTE_HAS_VAR_PRIO(idx) | \ USE_LOW_POWER(idx), \ UARTE_DISABLE_RX_INIT(UARTE(idx)), \ .poll_out_byte = &uarte##idx##_poll_out_byte, \ @@ -3637,8 +2788,6 @@ static int uarte_instance_deinit(const struct device *dev) IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ (.tx_cache = uarte##idx##_tx_cache, \ .rx_flush_buf = uarte##idx##_flush_buf,)) \ - IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ - (UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx))) \ IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ (.timer = NRFX_TIMER_INSTANCE( \ CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),)) \ @@ -3691,4 +2840,5 @@ static int uarte_instance_deinit(const struct device *dev) #define COND_UART_NRF_UARTE_DEVICE(unused, prefix, i, _) \ IF_ENABLED(CONFIG_HAS_HW_NRF_UARTE##prefix##i, (UART_NRF_UARTE_DEVICE(prefix##i);)) + UARTE_FOR_EACH_INSTANCE(COND_UART_NRF_UARTE_DEVICE, (), ()) From 3b6783cbde159d7df36afc73abd98a3d47d07cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1511/3334] Revert "[nrf fromlist] drivers: serial: nrfx_uarte: Prepare code for extension" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f2141e4d869398da6aefdc7a7506c1e21ca79f80. Signed-off-by: Tomasz Moń --- drivers/serial/uart_nrfx_uarte.c | 133 ++++++++++++++----------------- 1 file changed, 61 insertions(+), 72 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 5196b21a082b..a5436eb0ec62 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -870,78 +870,6 @@ static void tx_start(const struct device *dev, const uint8_t *buf, size_t len) static void rx_timeout(struct k_timer *timer); static void tx_timeout(struct k_timer *timer); -static void user_callback(const struct device *dev, struct uart_event *evt) -{ - struct uarte_nrfx_data *data = dev->data; - - if (data->async->user_callback) { - data->async->user_callback(dev, evt, data->async->user_data); - } -} - -static void rx_buf_release(const struct device *dev, uint8_t *buf) -{ - struct uart_event evt = { - .type = UART_RX_BUF_RELEASED, - .data.rx_buf.buf = buf, - }; - - user_callback(dev, &evt); -} - -static void notify_rx_disable(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uart_event evt = { - .type = UART_RX_DISABLED, - }; - - if (LOW_POWER_ENABLED(cfg)) { - uint32_t key = irq_lock(); - - uarte_disable_locked(dev, UARTE_FLAG_LOW_POWER_RX); - irq_unlock(key); - } - - user_callback(dev, (struct uart_event *)&evt); - - /* runtime PM is put after the callback. In case uart is re-enabled from that - * callback we avoid suspending/resuming the device. - */ - if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { - pm_device_runtime_put_async(dev, K_NO_WAIT); - } -} - -static int uarte_nrfx_rx_disable(const struct device *dev) -{ - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - int key; - - if (async_rx->buf == NULL) { - return -EFAULT; - } - - k_timer_stop(&async_rx->timer); - - key = irq_lock(); - - if (async_rx->next_buf != NULL) { - nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - } - - async_rx->enabled = false; - async_rx->discard_fifo = true; - - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - irq_unlock(key); - - return 0; -} - #if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } @@ -1140,6 +1068,15 @@ static int uarte_nrfx_tx_abort(const struct device *dev) return 0; } +static void user_callback(const struct device *dev, struct uart_event *evt) +{ + struct uarte_nrfx_data *data = dev->data; + + if (data->async->user_callback) { + data->async->user_callback(dev, evt, data->async->user_data); + } +} + static void notify_uart_rx_rdy(const struct device *dev, size_t len) { struct uarte_nrfx_data *data = dev->data; @@ -1153,6 +1090,29 @@ static void notify_uart_rx_rdy(const struct device *dev, size_t len) user_callback(dev, &evt); } +static void rx_buf_release(const struct device *dev, uint8_t *buf) +{ + struct uart_event evt = { + .type = UART_RX_BUF_RELEASED, + .data.rx_buf.buf = buf, + }; + + user_callback(dev, &evt); +} + +static void notify_rx_disable(const struct device *dev) +{ + struct uart_event evt = { + .type = UART_RX_DISABLED, + }; + + user_callback(dev, (struct uart_event *)&evt); + + if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) { + pm_device_runtime_put_async(dev, K_NO_WAIT); + } +} + #ifdef UARTE_HAS_FRAME_TIMEOUT static uint32_t us_to_bauds(uint32_t baudrate, int32_t timeout) { @@ -1379,6 +1339,35 @@ static int uarte_nrfx_callback_set(const struct device *dev, return 0; } +static int uarte_nrfx_rx_disable(const struct device *dev) +{ + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + int key; + + if (async_rx->buf == NULL) { + return -EFAULT; + } + + k_timer_stop(&async_rx->timer); + + key = irq_lock(); + + if (async_rx->next_buf != NULL) { + nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + } + + async_rx->enabled = false; + async_rx->discard_fifo = true; + + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + irq_unlock(key); + + return 0; +} + static void tx_timeout(struct k_timer *timer) { const struct device *dev = k_timer_user_data_get(timer); From fbaea89145be4653eaef52d674e90367614fab70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1512/3334] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Optimize test data handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 90d6461fde529941e2794291bc82c64948366f09. Signed-off-by: Tomasz Moń --- tests/drivers/uart/uart_async_dual/src/main.c | 152 +++++++----------- 1 file changed, 58 insertions(+), 94 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index 160d8c761040..c2ad5d8a0a0c 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -61,25 +61,6 @@ ZTEST_DMEM struct dut_data duts[] = { #endif }; -/* Array that contains potential payload. It is used to memcmp against incoming packets. */ -static const uint8_t test_buf[256] = { - 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, - 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, - 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, - 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, - 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, - 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, - 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, - 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, - 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, - 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, - 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, - 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, - 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, - 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, - 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, - 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; - static void pm_check(const struct device *dev, const struct device *second_dev, bool exp_on, int line) { @@ -147,8 +128,6 @@ enum test_rx_mode { RX_ALL, }; -typedef bool (*test_on_rx_rdy_t)(const struct device *dev, uint8_t *buf, size_t len); - struct test_rx_data { uint8_t hdr[1]; uint8_t buf[256]; @@ -161,7 +140,6 @@ struct test_rx_data { struct k_sem sem; uint32_t timeout; uint32_t buf_idx; - test_on_rx_rdy_t on_rx_rdy; }; static struct test_tx_data tx_data; @@ -299,86 +277,75 @@ static void on_tx_done(const struct device *dev, struct uart_event *evt) try_tx(dev, true); } -static bool on_rx_rdy_rx_all(const struct device *dev, uint8_t *buf, size_t len) +static void on_rx_rdy(const struct device *dev, struct uart_event *evt) { - bool ok; - - if (rx_data.payload_idx == 0) { - rx_data.payload_idx = buf[0] - 1; - buf++; - len--; - } - - ok = memcmp(buf, &test_buf[256 - rx_data.payload_idx], len) == 0; - rx_data.payload_idx -= len; - - return ok; -} - -static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len); - -static bool on_rx_rdy_payload(const struct device *dev, uint8_t *buf, size_t len) -{ - bool ok; + uint32_t len = evt->data.rx.len; + uint32_t off = evt->data.rx.offset; int err; - ok = memcmp(buf, &test_buf[255 - rx_data.payload_idx], len) == 0; - if (!ok) { - for (int i = 0; i < len; i++) { - if (buf[i] != test_buf[255 - rx_data.payload_idx + i]) { - zassert_true(false, "Byte %d expected: %02x got: %02x", - i, buf[i], test_buf[255 - rx_data.payload_idx + i]); - } - } - rx_data.cont = false; - tx_data.cont = false; - zassert_true(ok); - return false; + if (!rx_data.cont) { + return; } - rx_data.payload_idx -= len; - - if (rx_data.payload_idx == 0) { - rx_data.state = RX_HDR; - rx_data.on_rx_rdy = on_rx_rdy_hdr; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - rx_data.buf_req = false; + rx_data.rx_cnt += evt->data.rx.len; + if (evt->data.rx.buf == rx_data.hdr) { + if (rx_data.hdr[0] == 1) { + /* single byte packet. */ err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); zassert_equal(err, 0); + return; } - } - - return true; -} - -static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) -{ - int err; - zassert_equal(buf, rx_data.hdr); - zassert_equal(len, 1); - if (rx_data.hdr[0] == 1) { - /* single byte packet. */ + zassert_equal(rx_data.payload_idx, 0); + rx_data.state = RX_PAYLOAD; + rx_data.payload_idx = rx_data.hdr[0] - 1; if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); + size_t l = rx_data.hdr[0] - 1; + + zassert_true(l > 0); + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.buf, rx_data.hdr[0] - 1); } - return true; - } + } else { + for (int i = 0; i < len; i++) { + bool ok; - zassert_equal(rx_data.payload_idx, 0); - rx_data.on_rx_rdy = on_rx_rdy_payload; - rx_data.payload_idx = rx_data.hdr[0] - 1; - rx_data.state = RX_PAYLOAD; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - size_t l = rx_data.hdr[0] - 1; + if ((rx_data.mode == RX_ALL) && (rx_data.payload_idx == 0)) { + rx_data.payload_idx = evt->data.rx.buf[off + i]; + ok = true; + } else { + ok = evt->data.rx.buf[off + i] == (uint8_t)rx_data.payload_idx; + } - zassert_true(l > 0); - rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.buf, buf[0] - 1); - } + if (!ok) { + LOG_ERR("Unexpected data at %d, exp:%02x got:%02x", + i, rx_data.payload_idx, evt->data.rx.buf[off + i]); + } - return true; + zassert_true(ok, "Unexpected data at %d, exp:%02x got:%02x", + i, len - i, evt->data.rx.buf[off + i]); + if (!ok) { + rx_data.cont = false; + tx_data.cont = false; + /* Avoid flood of errors as we are in the interrupt and ztest + * cannot abort from here. + */ + return; + } + rx_data.payload_idx--; + if (rx_data.payload_idx == 0) { + if (rx_data.mode != RX_ALL) { + zassert_equal(i + 1, len, "len:%d i:%d", len, i); + } + rx_data.state = RX_HDR; + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); + zassert_equal(err, 0); + } + } + } + } } static void on_rx_buf_req(const struct device *dev) @@ -418,6 +385,7 @@ static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *us return; } + zassert_true(len > 0); err = uart_rx_enable(dev, buf, len, data->timeout); zassert_equal(err, 0, "Unexpected err:%d", err); @@ -449,11 +417,7 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void break; case UART_RX_RDY: zassert_true(dev == rx_dev); - if (rx_data.cont) { - rx_data.on_rx_rdy(dev, &evt->data.rx.buf[evt->data.rx.offset], - evt->data.rx.len); - rx_data.rx_cnt += evt->data.rx.len; - } + on_rx_rdy(dev, evt); break; case UART_RX_BUF_RELEASED: zassert_true(dev == rx_dev); @@ -552,7 +516,7 @@ static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, tx_data.rx_timeout = rx_data.timeout; rx_data.cont = true; rx_data.rx_cnt = 0; - rx_data.on_rx_rdy = rx_mode == RX_ALL ? on_rx_rdy_rx_all : on_rx_rdy_hdr; + rx_data.state = RX_HDR; rx_data.mode = rx_mode; ring_buf_init(&tx_data.rbuf, sizeof(tx_data.buf), tx_data.buf); From a9b93598e6bc72f44193f47040ac81883820c235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1513/3334] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Extend nrf54h20dk configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 80e400c6ffd64281e48baa666b6fd86a6e843944. Signed-off-by: Tomasz Moń --- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 22 ------------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 12 ---------- 2 files changed, 34 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi index 1ca0775f629e..e651cf5399ed 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -60,16 +60,6 @@ }; }; -&timer134 { - status = "reserved"; -}; - -&dppic135 { - owned-channels = <0>; - source-channels = <0>; - status = "okay"; -}; - dut: &uart134 { status = "okay"; current-speed = <115200>; @@ -77,7 +67,6 @@ dut: &uart134 { pinctrl-1 = <&uart134_alt_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; - timer = <&timer134>; zephyr,pm-device-runtime-auto; }; @@ -91,23 +80,12 @@ dut_aux: &uart137 { zephyr,pm-device-runtime-auto; }; -&dppic120 { - owned-channels = <0>; - source-channels = <0>; - status = "okay"; -}; - -&timer120 { - status = "reserved"; -}; - dut2: &uart120 { pinctrl-0 = <&uart120_default_alt>; pinctrl-1 = <&uart120_sleep_alt>; pinctrl-names = "default", "sleep"; current-speed = <115200>; hw-flow-control; - timer = <&timer120>; zephyr,pm-device-runtime-auto; }; diff --git a/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 65a2c52016e6..fcdc838a54e4 100644 --- a/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -9,15 +9,3 @@ status = "reserved"; interrupt-parent = <&cpuppr_clic>; }; - -&timer134 { - interrupt-parent = <&cpuppr_clic>; -}; - -&dppic135 { - child-owned-channels = <0>; -}; - -&uart136 { - current-speed = <1000000>; -}; From 1ea308e5eca36e4bb664fb2c03f9050c0c7e4352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1514/3334] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Update configuration for nrf54l" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 07f39d03f36324750b9f338ceaf402adf515b29f. Signed-off-by: Tomasz Moń --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 7 ------- 2 files changed, 8 deletions(-) diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index d8995e369711..a1e29cbf0ffc 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -42,7 +42,6 @@ dut: &uart21 { pinctrl-1 = <&uart21_sleep_alt>; pinctrl-names = "default", "sleep"; current-speed = <115200>; - timer = <&timer21>; }; dut2: &uart00 { diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 224399ccaa95..93ad73f3b373 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -38,10 +38,6 @@ }; }; -&timer21 { - status = "reserved"; -}; - dut: &uart21 { status = "okay"; current-speed = <115200>; @@ -49,8 +45,6 @@ dut: &uart21 { pinctrl-1 = <&uart21_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; - timer = <&timer21>; - zephyr,pm-device-runtime-auto; }; dut_aux: &uart22 { @@ -60,7 +54,6 @@ dut_aux: &uart22 { pinctrl-1 = <&uart22_sleep>; pinctrl-names = "default", "sleep"; hw-flow-control; - zephyr,pm-device-runtime-auto; }; &timer20 { From d3086ad256d412307133562ba3afdd4f91ce7510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1515/3334] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Extend testing" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1b2584c476e710cce12596d7380a6e227c062782. Signed-off-by: Tomasz Moń --- tests/drivers/uart/uart_async_dual/Kconfig | 8 - tests/drivers/uart/uart_async_dual/src/main.c | 218 ++++-------------- .../uart/uart_async_dual/testcase.yaml | 15 -- 3 files changed, 50 insertions(+), 191 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/Kconfig b/tests/drivers/uart/uart_async_dual/Kconfig index f0087aa48e3b..6e80ec3a7957 100644 --- a/tests/drivers/uart/uart_async_dual/Kconfig +++ b/tests/drivers/uart/uart_async_dual/Kconfig @@ -16,13 +16,5 @@ config PM_RUNTIME_IN_TEST select PM_DEVICE select PM_DEVICE_RUNTIME -config TEST_CHOPPED_TX - bool "Test chopped TX data" - default y - help - When enabled then test cases that transmits TX packets in random chunks are - performed. Some driver implementation do not support case when new TX data - collides with handling of the RX timeout. - # Include Zephyr's Kconfig source "Kconfig" diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index c2ad5d8a0a0c..d14e0f88a11e 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -28,10 +28,9 @@ LOG_MODULE_REGISTER(test); #endif #define TX_TIMEOUT 100000 -#define RX_TIMEOUT_BYTES 50 +#define RX_TIMEOUT 2000 #define MAX_PACKET_LEN 128 -#define MIN_PACKET_LEN 10 struct dut_data { const struct device *dev; @@ -101,7 +100,6 @@ static const struct device *tx_dev; enum test_tx_mode { TX_BULK, TX_PACKETS, - TX_CHOPPED, }; struct test_tx_data { @@ -113,8 +111,6 @@ struct test_tx_data { volatile bool cont; volatile enum test_tx_mode mode; struct k_sem sem; - uint32_t idx; - uint32_t rx_timeout; }; enum test_rx_state { @@ -125,21 +121,17 @@ enum test_rx_state { enum test_rx_mode { RX_CONT, RX_DIS, - RX_ALL, }; struct test_rx_data { uint8_t hdr[1]; uint8_t buf[256]; uint32_t rx_cnt; - uint32_t payload_idx; enum test_rx_state state; enum test_rx_mode mode; volatile bool cont; bool buf_req; struct k_sem sem; - uint32_t timeout; - uint32_t buf_idx; }; static struct test_tx_data tx_data; @@ -151,8 +143,8 @@ static void fill_tx(struct test_tx_data *data) uint32_t len; int err; - if (data->mode != TX_BULK) { - err = k_sem_take(&data->sem, K_MSEC(200)); + if (data->mode == TX_PACKETS) { + err = k_sem_take(&data->sem, K_MSEC(100)); if (err < 0 && !data->cont) { return; } @@ -161,10 +153,9 @@ static void fill_tx(struct test_tx_data *data) uint8_t len = sys_rand8_get(); len = len % MAX_PACKET_LEN; - len = MAX(MIN_PACKET_LEN, len); + len = MAX(2, len); data->packet_len = len; - data->idx = 0; for (int i = 0; i < len; i++) { data->buf[i] = len - i; } @@ -172,11 +163,12 @@ static void fill_tx(struct test_tx_data *data) return; } - while ((len = ring_buf_put_claim(&data->rbuf, &buf, 255)) > 0) { + while ((len = ring_buf_put_claim(&data->rbuf, &buf, 255)) > 1) { uint8_t r = (sys_rand8_get() % MAX_PACKET_LEN) % len; - uint8_t packet_len = MAX(r, MIN_PACKET_LEN); + uint8_t packet_len = MAX(r, 2); + uint8_t rem = len - packet_len; - packet_len = (len <= MIN_PACKET_LEN) ? len : packet_len; + packet_len = (rem < 3) ? len : packet_len; buf[0] = packet_len; for (int i = 1; i < packet_len; i++) { buf[i] = packet_len - i; @@ -197,7 +189,7 @@ static void try_tx(const struct device *dev, bool irq) return; } - if (tx_data.mode == TX_PACKETS) { + if ((tx_data.mode == TX_PACKETS) && (tx_data.packet_len > 0)) { uint8_t len = tx_data.packet_len; tx_data.packet_len = 0; @@ -207,50 +199,19 @@ static void try_tx(const struct device *dev, bool irq) err, irq, tx_data.cont); return; } + zassert_true(tx_data.mode == TX_BULK); - if (tx_data.mode == TX_BULK) { - if (!atomic_cas(&tx_data.busy, 0, 1)) { - return; - } - - len = ring_buf_get_claim(&tx_data.rbuf, &buf, 255); - if (len > 0) { - err = uart_tx(dev, buf, len, TX_TIMEOUT); - zassert_equal(err, 0, - "Unexpected err:%d irq:%d cont:%d\n", - err, irq, tx_data.cont); - } else { - tx_data.busy = 0; - } + if (!atomic_cas(&tx_data.busy, 0, 1)) { return; } - zassert_true(tx_data.mode == TX_CHOPPED); - - uint32_t rem = tx_data.packet_len - tx_data.idx; - - if (tx_data.packet_len > 12) { - len = sys_rand8_get() % (tx_data.packet_len / 4); - } else { - len = 0; + len = ring_buf_get_claim(&tx_data.rbuf, &buf, 255); + if (len > 0) { + err = uart_tx(dev, buf, len, TX_TIMEOUT); + zassert_equal(err, 0, + "Unexpected err:%d irq:%d cont:%d\n", + err, irq, tx_data.cont); } - len = MAX(3, len); - len = MIN(rem, len); - - buf = &tx_data.buf[tx_data.idx]; - tx_data.idx += len; - - err = uart_tx(dev, buf, len, TX_TIMEOUT); - zassert_equal(err, 0, - "Unexpected err:%d irq:%d cont:%d\n", - err, irq, tx_data.cont); -} - -static void tx_backoff(uint32_t rx_timeout) -{ - uint32_t delay = (rx_timeout / 2) + (sys_rand32_get() % rx_timeout); - - k_busy_wait(delay); } static void on_tx_done(const struct device *dev, struct uart_event *evt) @@ -260,17 +221,6 @@ static void on_tx_done(const struct device *dev, struct uart_event *evt) return; } - if (tx_data.mode == TX_CHOPPED) { - if (tx_data.idx == tx_data.packet_len) { - k_sem_give(&tx_data.sem); - } else { - - tx_backoff(tx_data.rx_timeout); - try_tx(dev, true); - } - return; - } - /* Finish previous data chunk and start new if any pending. */ ring_buf_get_finish(&tx_data.rbuf, evt->data.tx.len); atomic_set(&tx_data.busy, 0); @@ -289,16 +239,7 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) rx_data.rx_cnt += evt->data.rx.len; if (evt->data.rx.buf == rx_data.hdr) { - if (rx_data.hdr[0] == 1) { - /* single byte packet. */ - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); - return; - } - - zassert_equal(rx_data.payload_idx, 0); rx_data.state = RX_PAYLOAD; - rx_data.payload_idx = rx_data.hdr[0] - 1; if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { size_t l = rx_data.hdr[0] - 1; @@ -307,19 +248,16 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) err = uart_rx_buf_rsp(dev, rx_data.buf, rx_data.hdr[0] - 1); } } else { - for (int i = 0; i < len; i++) { - bool ok; + /* Payload received */ + rx_data.state = RX_HDR; + zassert_equal(len, rx_data.hdr[0] - 1); - if ((rx_data.mode == RX_ALL) && (rx_data.payload_idx == 0)) { - rx_data.payload_idx = evt->data.rx.buf[off + i]; - ok = true; - } else { - ok = evt->data.rx.buf[off + i] == (uint8_t)rx_data.payload_idx; - } + for (int i = 0; i < len; i++) { + bool ok = evt->data.rx.buf[off + i] == (uint8_t)(len - i); if (!ok) { LOG_ERR("Unexpected data at %d, exp:%02x got:%02x", - i, rx_data.payload_idx, evt->data.rx.buf[off + i]); + i, len - i, evt->data.rx.buf[off + i]); } zassert_true(ok, "Unexpected data at %d, exp:%02x got:%02x", @@ -332,52 +270,21 @@ static void on_rx_rdy(const struct device *dev, struct uart_event *evt) */ return; } - rx_data.payload_idx--; - if (rx_data.payload_idx == 0) { - if (rx_data.mode != RX_ALL) { - zassert_equal(i + 1, len, "len:%d i:%d", len, i); - } - rx_data.state = RX_HDR; - if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - rx_data.buf_req = false; - err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); - zassert_equal(err, 0); - } - } + } + if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { + rx_data.buf_req = false; + err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); } } } -static void on_rx_buf_req(const struct device *dev) -{ - if (rx_data.mode != RX_ALL) { - rx_data.buf_req = true; - return; - } - - size_t len = sizeof(rx_data.buf) / 2; - uint8_t *buf = &rx_data.buf[len * rx_data.buf_idx]; - - rx_data.buf_idx = (rx_data.buf_idx + 1) & 0x1; - uart_rx_buf_rsp(dev, buf, len); -} - static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *user_data) { ARG_UNUSED(evt); struct test_rx_data *data = user_data; int err; - uint8_t *buf; - uint32_t len; - - if (data->mode == RX_ALL) { - buf = data->buf; - len = sizeof(data->buf) / 2; - } else { - buf = (data->state == RX_HDR) ? data->hdr : data->buf; - len = (data->state == RX_HDR) ? 1 : (data->hdr[0] - 1); - data->buf_idx = 1; - } + uint8_t *buf = (data->state == RX_HDR) ? data->hdr : data->buf; + uint32_t len = (data->state == RX_HDR) ? 1 : (data->hdr[0] - 1); data->buf_req = false; @@ -387,7 +294,7 @@ static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *us zassert_true(len > 0); - err = uart_rx_enable(dev, buf, len, data->timeout); + err = uart_rx_enable(dev, buf, len, RX_TIMEOUT); zassert_equal(err, 0, "Unexpected err:%d", err); } @@ -423,8 +330,8 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void zassert_true(dev == rx_dev); break; case UART_RX_BUF_REQUEST: + rx_data.buf_req = true; zassert_true(dev == rx_dev); - on_rx_buf_req(dev); break; case UART_RX_DISABLED: zassert_true(dev == rx_dev); @@ -439,7 +346,7 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void } } -static void config_baudrate(uint32_t rate, bool hwfc) +static void config_baudrate(uint32_t rate) { struct uart_config config; int err; @@ -447,7 +354,6 @@ static void config_baudrate(uint32_t rate, bool hwfc) err = uart_config_get(rx_dev, &config); zassert_equal(err, 0, "Unexpected err:%d", err); - config.flow_ctrl = hwfc ? UART_CFG_FLOW_CTRL_RTS_CTS : UART_CFG_FLOW_CTRL_NONE; config.baudrate = rate; err = uart_configure(rx_dev, &config); @@ -490,14 +396,13 @@ static void report_progress(uint32_t start) * * Test has busy simulator running if it is enabled in the configuration. */ -static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, - enum test_rx_mode rx_mode, bool hwfc) +static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) { int err; uint32_t load = 0; uint32_t start = k_uptime_get_32(); - config_baudrate(baudrate, hwfc); + config_baudrate(baudrate); if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { uint32_t active_avg = (baudrate == 1000000) ? 5 : 30; @@ -509,15 +414,13 @@ static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, memset(&tx_data, 0, sizeof(tx_data)); memset(&rx_data, 0, sizeof(rx_data)); tx_data.cont = true; - tx_data.mode = tx_mode; - k_sem_init(&tx_data.sem, (tx_mode != TX_BULK) ? 1 : 0, 1); + tx_data.mode = tx_packets ? TX_PACKETS : TX_BULK; + k_sem_init(&tx_data.sem, tx_packets ? 1 : 0, 1); - rx_data.timeout = (RX_TIMEOUT_BYTES * 1000000 * 10) / baudrate; - tx_data.rx_timeout = rx_data.timeout; rx_data.cont = true; rx_data.rx_cnt = 0; rx_data.state = RX_HDR; - rx_data.mode = rx_mode; + rx_data.mode = cont ? RX_CONT : RX_DIS; ring_buf_init(&tx_data.rbuf, sizeof(tx_data.buf), tx_data.buf); @@ -556,82 +459,62 @@ static void var_packet(uint32_t baudrate, enum test_tx_mode tx_mode, /* Flush all TX data that may be already started. */ k_msleep(10); - (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); + (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), RX_TIMEOUT); k_msleep(10); (void)uart_rx_disable(rx_dev); k_msleep(10); TC_PRINT("Received %d bytes for %d ms, CPU load:%d.%d\n", rx_data.rx_cnt, CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT, load / 10, load % 10); - zassert_true(rx_data.rx_cnt > 1000, "Unexpected RX cnt: %d", rx_data.rx_cnt); + zassert_true(rx_data.rx_cnt > 1000, "Unexected RX cnt: %d", rx_data.rx_cnt); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_dis_hwfc) { /* TX in bulk mode, RX in DIS mode, 115k2 */ - var_packet(115200, TX_BULK, RX_DIS, true); + var_packet_hwfc(115200, false, false); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_cont_hwfc) { /* TX in bulk mode, RX in CONT mode, 115k2 */ - var_packet(115200, TX_BULK, RX_CONT, true); + var_packet_hwfc(115200, false, true); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_dis_hwfc_1m) { /* TX in bulk mode, RX in DIS mode, 1M */ - var_packet(1000000, TX_BULK, RX_DIS, true); + var_packet_hwfc(1000000, false, false); } ZTEST(uart_async_dual, test_var_packets_tx_bulk_cont_hwfc_1m) { /* TX in bulk mode, RX in CONT mode, 1M */ - var_packet(1000000, TX_BULK, RX_CONT, true); + var_packet_hwfc(1000000, false, true); } ZTEST(uart_async_dual, test_var_packets_dis_hwfc) { /* TX in packet mode, RX in DIS mode, 115k2 */ - var_packet(115200, TX_PACKETS, RX_DIS, true); + var_packet_hwfc(115200, true, false); } ZTEST(uart_async_dual, test_var_packets_cont_hwfc) { /* TX in packet mode, RX in CONT mode, 115k2 */ - var_packet(115200, TX_PACKETS, RX_CONT, true); + var_packet_hwfc(115200, true, true); } ZTEST(uart_async_dual, test_var_packets_dis_hwfc_1m) { /* TX in packet mode, RX in DIS mode, 1M */ - var_packet(1000000, TX_PACKETS, RX_DIS, true); + var_packet_hwfc(1000000, true, false); } ZTEST(uart_async_dual, test_var_packets_cont_hwfc_1m) { /* TX in packet mode, RX in CONT mode, 1M */ - var_packet(1000000, TX_PACKETS, RX_CONT, true); -} - -ZTEST(uart_async_dual, test_var_packets_chopped_all) -{ - if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { - ztest_test_skip(); - } - - /* TX in chopped mode, RX in receive ALL mode, 115k2 */ - var_packet(115200, TX_CHOPPED, RX_ALL, false); -} - -ZTEST(uart_async_dual, test_var_packets_chopped_all_1m) -{ - if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { - ztest_test_skip(); - } - - /* TX in chopped mode, RX in receive ALL mode, 1M */ - var_packet(1000000, TX_CHOPPED, RX_ALL, false); + var_packet_hwfc(1000000, true, true); } static void hci_like_callback(const struct device *dev, struct uart_event *evt, void *user_data) @@ -680,7 +563,7 @@ static bool rx(uint8_t *buf, size_t len) { int err; - err = uart_rx_enable(rx_dev, buf, len, rx_data.timeout); + err = uart_rx_enable(rx_dev, buf, len, RX_TIMEOUT); zassert_equal(err, 0, "Unexpected err:%d", err); err = k_sem_take(&rx_data.sem, K_MSEC(100)); @@ -868,7 +751,7 @@ static void hci_like_test(uint32_t baudrate) int err; uint32_t load = 0; - config_baudrate(baudrate, true); + config_baudrate(baudrate); if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { uint32_t active_avg = (baudrate == 1000000) ? 10 : 50; @@ -882,7 +765,6 @@ static void hci_like_test(uint32_t baudrate) tx_data.cnt = 0; tx_data.cont = true; rx_data.cont = true; - rx_data.timeout = (RX_TIMEOUT_BYTES * 1000000 * 10) / baudrate; k_sem_init(&tx_data.sem, 1, 1); k_sem_init(&rx_data.sem, 0, 1); @@ -920,7 +802,7 @@ static void hci_like_test(uint32_t baudrate) k_msleep(10); PM_CHECK(tx_dev, rx_dev, false); - (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); + (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), RX_TIMEOUT); k_msleep(1); (void)uart_rx_disable(rx_dev); diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index 1722d5e5e7d1..1a2d811bbfe9 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -73,18 +73,3 @@ tests: - nrf52_bsim extra_configs: - CONFIG_PM_RUNTIME_IN_TEST=y - drivers.uart.async_dual.no_tx_chopped: - harness: ztest - harness_config: - fixture: uart_loopback - depends_on: gpio - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr - - nrf9160dk/nrf9160 - - nrf52_bsim - extra_configs: - - CONFIG_TEST_CHOPPED_TX=n - - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER=n From 52cec2c4ef7ba6cebee3405b24426b3453b6a49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1516/3334] Revert "[nrf fromlist] tests: drivers: uart: async_dual: Add progress report" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0285066a86af150212952ce55f18e00fc1f3e2ff. Signed-off-by: Tomasz Moń --- tests/drivers/uart/uart_async_dual/src/main.c | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index d14e0f88a11e..37ce73120acb 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -365,26 +365,6 @@ static void config_baudrate(uint32_t rate) } } -static void report_progress(uint32_t start) -{ - static const uint32_t inc = CONFIG_UART_ASYNC_DUAL_TEST_TIMEOUT / 20; - static uint32_t next; - static uint32_t progress; - - if ((k_uptime_get_32() - start < inc) && progress) { - /* Reset state. */ - next = inc; - progress = 0; - } - - if (k_uptime_get_32() > (start + next)) { - progress += 5; - TC_PRINT("\r%d%%", progress); - next += inc; - } -} - - /* Test is running following scenario. Transmitter is sending packets which * has 1 byte header with length followed by the payload. Transmitter can send * packets in two modes: bulk where data is send in chunks without gaps between @@ -400,7 +380,6 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) { int err; uint32_t load = 0; - uint32_t start = k_uptime_get_32(); config_baudrate(baudrate); @@ -441,10 +420,8 @@ static void var_packet_hwfc(uint32_t baudrate, bool tx_packets, bool cont) while (tx_data.cont || rx_data.cont) { fill_tx(&tx_data); k_msleep(1); - report_progress(start); try_tx(tx_dev, false); } - TC_PRINT("\n"); if (IS_ENABLED(CONFIG_CPU_LOAD)) { load = cpu_load_get(true); @@ -676,7 +653,6 @@ static void hci_like_rx(void) uint8_t len; bool cont; bool explicit_pm = IS_ENABLED(CONFIG_PM_RUNTIME_IN_TEST); - uint32_t start = k_uptime_get_32(); while (1) { if (explicit_pm) { @@ -728,9 +704,7 @@ static void hci_like_rx(void) PM_CHECK(rx_dev, tx_dev, false); check_payload(rx_data.buf, len); - report_progress(start); } - TC_PRINT("\n"); } #define HCI_LIKE_TX_STACK_SIZE 2048 From 55777ee8cfd069c54efbe0b05ba6695491221888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1517/3334] Revert "[nrf fromlist] dts: bindings: serial: nrf-uarte: Add timer property" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2b0ac9d9861fd94253c6d933cf9d308b9827b0f2. Signed-off-by: Tomasz Moń --- dts/bindings/serial/nordic,nrf-uarte.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dts/bindings/serial/nordic,nrf-uarte.yaml b/dts/bindings/serial/nordic,nrf-uarte.yaml index c8eb2bbc758d..4e9ccb0dd400 100644 --- a/dts/bindings/serial/nordic,nrf-uarte.yaml +++ b/dts/bindings/serial/nordic,nrf-uarte.yaml @@ -24,11 +24,3 @@ properties: type: boolean description: | UARTE allows usage of cross domain pins with constant latency mode required. - - timer: - type: phandle - description: | - Timer instance used to count received bytes. Due to issues with frame timeout - feature it is required to reliably receive data in cases where flow control - is not used and new byte can appear on the line when frame timeout expires - but before it is handled. From cd7a6200be3bfc30288e57280a1cec1012bff2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:02:07 +0100 Subject: [PATCH 1518/3334] Revert "[nrf fromtree] tests: kernel: gen_isr_table: Add ISR offset definitions for nrf9280" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 126161352d924fcc389da09fdd149f9aaddfb08f. Signed-off-by: Tomasz Moń --- tests/arch/common/gen_isr_table/src/main.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/arch/common/gen_isr_table/src/main.c b/tests/arch/common/gen_isr_table/src/main.c index ed764e05b4bf..e716f0ddf4b6 100644 --- a/tests/arch/common/gen_isr_table/src/main.c +++ b/tests/arch/common/gen_isr_table/src/main.c @@ -42,11 +42,6 @@ extern const uintptr_t _irq_vector_table[]; #define ISR3_OFFSET 15 #define ISR5_OFFSET 16 #define TRIG_CHECK_SIZE 17 -#elif defined(CONFIG_SOC_NRF9280_CPUPPR) -#define ISR1_OFFSET 14 -#define ISR3_OFFSET 15 -#define ISR5_OFFSET 16 -#define TRIG_CHECK_SIZE 17 #else #error "Target not supported" #endif From 30e423a7b8352037c0ea7e0cb211aa8a2317f952 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 26 Jan 2021 15:43:08 +0100 Subject: [PATCH 1519/3334] [nrf noup] ci: set `ZEPHYR__KCONFIG` for NCS modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit sets `ZEPHYR__KCONFIG` variable for each Kconfig file discovered in `nrf/modules//Kconfig`. This is not meant as a permanent solution; we should do more careful consideration on the optimal approach forward that will allow compliance_check.py to be used downstream with custom module_ext_roots, and at the same time keep current flexibility for module glue code handling intact. Adds a static path for the NRF Kconfig variable in the check compliance script, this is a temporary workaround due to supporting an external root for NCS that should be reworked to use package helper in future Signed-off-by: Torsten Rasmussen Signed-off-by: Martí Bolívar Signed-off-by: Carles Cufi Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Moń (cherry picked from commit 0c00b1800accb3538c3fa7b8787044af9620c54f) --- scripts/ci/check_compliance.py | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 701fc1fce02a..1db5b2e9cfc8 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -722,6 +722,13 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir = ZEPHYR_BASE / 'modules' modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] + nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') + nrf_modules = [] + if os.path.exists(nrf_modules_dir): + nrf_modules = [name for name in os.listdir(nrf_modules_dir) if + os.path.exists(os.path.join(nrf_modules_dir, name, + 'Kconfig'))] + with open(modules_file) as fp_module_file: content = fp_module_file.read() @@ -733,8 +740,39 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir / module / 'Kconfig', ) ) + for module in nrf_modules: + fp_module_file.write( + "ZEPHYR_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + nrf_modules_dir / module / 'Kconfig', + ) + ) + fp_module_file.write( + "NCS_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + modules_dir / module / 'Kconfig', + ) + ) + # Add NRF as static entry as workaround for ext Kconfig root support + fp_module_file.write( + "ZEPHYR_NRF_KCONFIG = {}\n".format( + nrf_modules_dir / '..' / 'Kconfig.nrf', + ) + ) fp_module_file.write(content) + with open(sysbuild_modules_file) as fp_sysbuild_module_file: + content = fp_sysbuild_module_file.read() + + with open(sysbuild_modules_file, 'w') as fp_sysbuild_module_file: + # Add NRF as static entry as workaround for ext Kconfig root support + fp_sysbuild_module_file.write( + "SYSBUILD_NRF_KCONFIG = {}\n".format( + nrf_modules_dir / '..' / 'sysbuild' / 'Kconfig.sysbuild', + ) + ) + fp_sysbuild_module_file.write(content) + def get_kconfig_dts(self, kconfig_dts_file, settings_file): """ Generate the Kconfig.dts using dts/bindings as the source. From 960f89b397ee92b5b36ca044b8a2b78193e1ac88 Mon Sep 17 00:00:00 2001 From: Piotr Golyzniak Date: Mon, 1 Aug 2022 13:06:01 +0200 Subject: [PATCH 1520/3334] [nrf noup] ci: scripts: add quarantine file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add scripts/quarantine.yaml file, which will be used in CI. Signed-off-by: Piotr Golyzniak Signed-off-by: Andrzej Głąbek Signed-off-by: Maciej Perkowski Signed-off-by: Robert Lubos (cherry picked from commit 5a9b99de0317d7f59acb74c988e6a47ed86b815c) --- scripts/quarantine.yaml | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 scripts/quarantine.yaml diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml new file mode 100644 index 000000000000..20c4f9248ea9 --- /dev/null +++ b/scripts/quarantine.yaml @@ -0,0 +1,88 @@ +# The configurations resulting as a product of scenarios and platforms +# will be skipped if quarantine is used. More details here: +# https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine + +- scenarios: + - testing.ztest.busy_sim + - testing.ztest.busy_sim_nrf52840dk_pin + platforms: + - nrf52840dk_nrf52840 + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.unary_f64 + platforms: + - nrf5340dk_nrf5340_cpunet + - qemu_cortex_m3 + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_f16 + - libraries.cmsis_dsp.matrix.binary_f16.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_q15 + - libraries.cmsis_dsp.matrix.binary_q15.fpu + - libraries.cmsis_dsp.matrix.unary_f32 + - libraries.cmsis_dsp.matrix.unary_f32.fpu + - libraries.cmsis_dsp.matrix.unary_f64 + - libraries.cmsis_dsp.matrix.unary_f64.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Flash overflows" + +# libsdl2-dev package should be added into docker image +- scenarios: + - sample.boards.nrf.nrf_led_matrix + - sample.display.lvgl.gui + platforms: + - native_posix + comment: "libsdl2-dev package not available" + +- scenarios: + - sample.net.sockets.echo_server.usbnet + - sample.net.sockets.echo_server.usbnet_composite + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - sample.net.zperf.netusb_ecm + - sample.net.zperf.netusb_eem + - sample.net.zperf.netusb_rndis + platforms: + - nrf52833dk_nrf52833 + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - net.mqtt.tls + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - kernel.common.picolibc + - libraries.picolibc + - libraries.libc.picolibc.mem_alloc + - libraries.picolibc.sprintf_new + platforms: + - nrf52dk_nrf52832 + comment: "Ram overflows, also in the upstream" + +- scenarios: + - sample.psa_crypto + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Due to using sdk-zephyr manifest instead of nrf. Should be fixed after the change" From c660bc0206a2bd155c6de832ff32a5df72ebbc7a Mon Sep 17 00:00:00 2001 From: Sebastian Wezel Date: Tue, 15 Mar 2022 13:12:25 +0100 Subject: [PATCH 1521/3334] [nrf noup] ci: add .github/test-spec.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file is used for NCS-specific testing configuration based on modifications to files in this repository. Signed-off-by: Alperen Sener Signed-off-by: Elisabeth Solheim Klakken Signed-off-by: Mariusz Poslinski Signed-off-by: Markus Swarowsky Signed-off-by: Robert Lubos Signed-off-by: Sebastian Wezel Signed-off-by: Tomasz Tyzenhauz Signed-off-by: Fredrik Ås Signed-off-by: Michał Szablowski Signed-off-by: Tony Le Signed-off-by: Krishna T Signed-off-by: Dawid Przybylo Signed-off-by: Rubin Gerritsen Signed-off-by: Jørgen Kvalvaag Signed-off-by: Magne Værnes Signed-off-by: Lang Xie Signed-off-by: Alexander Svensen Signed-off-by: Jan Gałda Signed-off-by: Vladislav Litvinov Signed-off-by: Guojun Wang Signed-off-by: Piotr Kosycarz Signed-off-by: Thomas Stilwell Signed-off-by: Krzysztof Szromek Signed-off-by: Grzegorz Chwierut Signed-off-by: Eduardo Montoya Signed-off-by: Pavel Vasilyev (cherry picked from commit 2572bde23c16a9dd0eede529c6e24226d8930d9f) --- .github/test-spec.yml | 392 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 .github/test-spec.yml diff --git a/.github/test-spec.yml b/.github/test-spec.yml new file mode 100644 index 000000000000..6da6bdbaa87d --- /dev/null +++ b/.github/test-spec.yml @@ -0,0 +1,392 @@ +# This is the Jenkins ci variant of the .github/labler.yaml + +"CI-run-zephyr-twister": + - any: + - "!.github/**/*" + - "!doc/**/*" + - "!CODEOWNERS" + - "!LICENSE" + - "!**/*.rst" + - "!VERSION" + - "!submanifests/**/*" + - "!MAINTAINERS.yml" + - "!version.h.in" + - "!Jenkinsfile" + - "!**/*.md" + +"CI-iot-zephyr-lwm2m-test": + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "subsys/dfu/boot/**/*" + - "subsys/net/ip/**/*" + - "subsys/net/lib/http/**/*" + - "subsys/net/lib/lwm2m//**/*" + - "subsys/net/**/*" + +"CI-iot-samples-test": + - "boards/nordic/nrf9160dk/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/**/*" + - "subsys/net/lib/**/*" + +"CI-iot-libraries-test": + - "boards/nordic/nrf9160dk/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/socket_ncs.h" + - "subsys/testsuite/ztest/**/*" + +"CI-lwm2m-test": null +# Not necessary to run tests on changes to this repo. + +"CI-boot-test": + - "subsys/mgmt/mcumgr/**/*" + - "subsys/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/dfu/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "tests/boot/**/*" + - "tests/subsys/dfu/**/*" + - "tests/subsys/mgmt/mcumgr/**/*" + +"CI-tfm-test": + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf9160dk/**/*" + - "drivers/entropy/*" + - "dts/arm/nordic/nrf5340*" + - "dts/arm/nordic/nrf9160*" + - "modules/trusted-firmware-m/**/*" + - "samples/tfm_integration/**/*" + +"CI-ble-test": + - any: + - "drivers/bluetooth/**/*" + - any: + - "dts/arm/nordic/nrf5*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + - any: + - "include/zephyr/bluetooth/**/*" + - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/hci_ipc/**/*" + +"CI-ble-samples-test": + - any: + - "drivers/bluetooth/**/*" + - any: + - "dts/arm/nordic/nrf5*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + - any: + - "include/zephyr/bluetooth/**/*" + - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/**/*" + +"CI-mesh-test": + - "subsys/bluetooth/mesh/**/*" + - "include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh_demo/**/*" + - "samples/bluetooth/mesh_provisioner/**/*" + - "tests/bluetooth/mesh/**/*" + - "tests/bluetooth/mesh_shell/**/*" + +"CI-thingy91-test": + - "boards/nordic/nrf9160dk/**/*" + - "arch/x86/core/**/*" + - "arch/x86/include/**/*" + - "drivers/console/**/*" + - "drivers/ethernet/**/*" + - "drivers/flash/**/*" + - "drivers/hwinfo/**/*" + - "drivers/interrupt_controller/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/timer/**/*" + - "include/**/*" + - "kernel/**/*" + - "lib/libc/common/source/stdlib/**/*" + - "lib/libc/newlib/**/*" + - "lib/libc/picolibc/**/*" + - "lib/os/**/*" + - "lib/posix/**/*" + - "misc/**/*" + - "modules/mbedtls/**/*" + - "soc/x86/ia32/**/*" + - "subsys/fs/fcb/**/*" + - "subsys/logging/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/include/**/*" + - "subsys/settings/src/**/*" + - "subsys/stats/**/*" + - "subsys/storage/flash_map/**/*" + - "subsys/storage/stream/**/*" + - "subsys/tracing/**/*" + +"CI-desktop-test": + - "drivers/bluetooth/*" + - "subsys/bluetooth/*" + - "include/zephyr/bluetooth/*" + +"CI-crypto-test": + - "boards/nordic/nrf52840dk/**/*" + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf9160dk/**/*" + - "drivers/entropy/*" + - "drivers/serial/**/*" + - "dts/arm/nordic/nrf52840*" + - "dts/arm/nordic/nrf5340*" + - "dts/arm/nordic/nrf9160*" + - "include/drivers/serial/**/*" + - "modules/mbedtls/**/*" + +"CI-fem-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "dts/bindings/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/arch/**/*" + - "lib/libc/**/*" + - "lib/open-amp/**/*" + - "modules/hal_nordic/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "modules/trusted-firmware-m/**/*" + - "samples/net/sockets/echo_*/**/*" + - "share/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + - "subsys/bluetooth/shell/**/*" + - "subsys/ipc/**/*" + - "Kconfig" + - "CMakeLists.txt" + +"CI-rs-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "dts/bindings/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/arch/**/*" + - "lib/libc/**/*" + - "lib/open-amp/**/*" + - "modules/hal_nordic/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "modules/trusted-firmware-m/**/*" + - "samples/net/sockets/echo_*/**/*" + - "share/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + - "subsys/bluetooth/shell/**/*" + - "subsys/ipc/**/*" + - "Kconfig" + - "CMakeLists.txt" + +"CI-thread-test": + - "include/zephyr/net/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "samples/net/openthread/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-nfc-test": + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "drivers/flash/**/*" + - "drivers/mbox/**/*" + - "drivers/spi/**/*" + - "lib/crc/**/*" + - "modules/hal_nordic/**/*" + - "soc/nordic/**/*" + - "subsys/ipc/ipc_service/**/*" + - "subsys/fs/**/*" + - "subsys/mem_mgmt/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/**/*" + - "subsys/shell/**/*" + - "subsys/storage/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-matter-test": + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/settings/**/*" + - "subsys/net/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "drivers/net/**/*" + - "samples/bluetooth/hci_ipc/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + +"CI-find-my-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/**/*" + - "drivers/entropy/**/*" + - "drivers/flash/**/*" + - "drivers/usb/**/*" + - "drivers/regulator/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/fs/**/*" + - "subsys/ipc/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/**/*" + - "subsys/storage/**/*" + - "subsys/tracing/**/*" + - "subsys/usb/device/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-rpc-test": + - "subsys/ipc/ipc_service/**/*" + - "subsys/random/**/*" + - "soc/nordic/nrf53/**/*" + +"CI-modemshell-test": + - "include/net/**/*" + - "include/posix/**/*" + - "include/shell/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "subsys/shell/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-positioning-test": + - "include/net/**/*" + - "include/posix/**/*" + - "drivers/net/**/*" + - "drivers/wifi/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-cloud-test": + - "include/zephyr/dfu/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/posix/**/*" + - "include/zephyr/settings/**/*" + - "drivers/led/**/*" + - "drivers/net/**/*" + - "drivers/sensor/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "lib/posix/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-wifi": + - "subsys/net/l2/wifi/**/*" + - "subsys/net/l2/ethernet/**/*" + +"CI-audio-test": + - "boards/nordic/nrf5340_audio_dk/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/gpio/**/*" + - "drivers/i2c/**/*" + - "drivers/watchdog/**/*" + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/bluetooth/hci_ipc/**/*" + - "soc/nordic/**/*" + - "subsys/bluetooth/audio/**/*" + - "subsys/bluetooth/host/**/*" + - "subsys/dfu/**/*" + - "subsys/fs/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "subsys/sd/**/*" + - "subsys/storage/**/*" + - "subsys/task_wdt/**/*" + - "subsys/usb/**/*" + - "subsys/zbus/**/*" + +"CI-pmic-samples-test": + - "samples/shields/npm1300_ek/**/*" + - "boards/shields/npm1300_ek/**/*" + - "**/**npm1300**/**" + - "drivers/regulator/regulator_common.c" + - "drivers/regulator/regulator_shell.c" + - "drivers/gpio/gpio_shell.c" + - "drivers/sensor/sensor_shell.c" + +"CI-test-low-level": + - "arch/**/*" + - "boards/nordic/nrf54*/**/*" + - "drivers/**/*" + - "dts/**/*" + - "include/zephyr/**/*" + - "kernel/**/*" + - "modules/hal_nordic/**/*" + - "samples/basic/blinky_pwm/**/*" + - "samples/basic/fade_led/**/*" + - "samples/boards/nrf/**/*" + - "samples/boards/nordic/**/*" + - "samples/drivers/adc/**/*" + - "samples/drivers/jesd216/**/*" + - "samples/drivers/mbox/**/*" + - "samples/drivers/soc_flash_nrf/**/*" + - "samples/drivers/spi_flash/**/*" + - "samples/drivers/watchdog/**/*" + - "samples/hello_world/**/*" + - "samples/sensor/**/*" + - "samples/subsys/ipc/**/*" + - "samples/subsys/logging/**/*" + - "samples/subsys/settings/**/*" + - "samples/subsys/usb/cdc_acm/**/*" + - "samples/subsys/usb/mass/**/*" + - "samples/synchronization/**/*" + - "subsys/logging/**/*" + - "subsys/settings/**/*" + - "tests/arch/**/*" + - "tests/boards/nrf/**/*" + - "tests/boards/nordic/**/*" + - "tests/drivers/**/*" + - "tests/kernel/**/*" + +"CI-suit-dfu-test": + - "subsys/mgmt/mcumgr/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "subsys/bluetooth/**/*" + - "drivers/bluetooth/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/console/**/*" + - "drivers/gpio/**/*" + - "dts/common/nordic/*" + - "dts/arm/nordic/nrf54h*/**/*" + - "dts/riscv/nordic/nrf54h*/**/*" + - "boards/nordic/nrf54h*/**/*" + - "soc/nordic/nrf54h/**/*" + - "include/zephyr/**/*" + - "subsys/logging/**/*" + - "subsys/tracing/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/nrfutil.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" From f76435ad17df3335784224e252759fb121416fff Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 19 Jun 2023 12:19:05 +0200 Subject: [PATCH 1522/3334] [nrf noup] Revert "twister: Use natural sort when generating hardware map" This reverts commit c37deeb0c4602dc3eeb700a7dc3ed317283fff17. This is only a temporary change, until we align our CI. To be removed once natsort is avaialble in the NCS CI. Signed-off-by: Robert Lubos (cherry picked from commit 6fde6cdb57c8db387e3277d2dcd69c59ee576615) --- scripts/pylib/twister/twisterlib/hardwaremap.py | 2 +- scripts/requirements-run-test.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 6bbf22099c32..ed8eced167ac 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -399,7 +399,7 @@ def save(self, hwm_file): boot_ids = [] # use existing map - self.detected = natsorted(self.detected, key=lambda x: x.serial or '') + self.detected.sort(key=lambda x: x.serial or '') if os.path.exists(hwm_file): with open(hwm_file) as yaml_file: hwm = yaml.load(yaml_file, Loader=SafeLoader) diff --git a/scripts/requirements-run-test.txt b/scripts/requirements-run-test.txt index 32b6e06bff06..495d9a817876 100644 --- a/scripts/requirements-run-test.txt +++ b/scripts/requirements-run-test.txt @@ -7,7 +7,6 @@ pyocd>=0.36.0 # used by twister for board/hardware map tabulate -natsort # used by mcuboot cbor>=1.0.0 From 433fa6a009070e37c42804a85789fa966214dec1 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 3 Mar 2022 15:28:16 +0100 Subject: [PATCH 1523/3334] [nrf noup] doc: remove Kconfig search Kconfig search is handled in a separate docset in NCS, so remove the page. This is a long-term noup patch. Signed-off-by: Gerard Marull-Paretas Signed-off-by: Krishna T (cherry picked from commit ae54dd0dd72cb3887de9542242c78eb8706848d5) --- MAINTAINERS.yml | 1 - doc/build/kconfig/setting.rst | 6 ++---- doc/develop/application/index.rst | 5 ++--- doc/kconfig.rst | 8 -------- 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 doc/kconfig.rst diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 0aff172eb1e8..dc801509a465 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1227,7 +1227,6 @@ Documentation: - doc/index-tex.rst - doc/index.html - doc/index.rst - - doc/kconfig.rst - doc/templates/sample.tmpl - doc/templates/board.tmpl - boards/index.rst diff --git a/doc/build/kconfig/setting.rst b/doc/build/kconfig/setting.rst index 17eafc95a3be..cbaf9c5b3897 100644 --- a/doc/build/kconfig/setting.rst +++ b/doc/build/kconfig/setting.rst @@ -7,8 +7,7 @@ The :ref:`menuconfig and guiconfig interfaces ` can be used to test out configurations during application development. This page explains how to make settings permanent. -All Kconfig options can be searched in the :ref:`Kconfig search page -`. +All Kconfig options can be searched in the Kconfig search page. .. note:: @@ -115,8 +114,7 @@ Assignments in configuration files are only respected if the dependencies for the symbol are satisfied. A warning is printed otherwise. To figure out what the dependencies of a symbol are, use one of the :ref:`interactive configuration interfaces ` (you can jump directly to a symbol with -:kbd:`/`), or look up the symbol in the :ref:`Kconfig search page -`. +:kbd:`/`), or look up the symbol in the Kconfig search page. .. _initial-conf: diff --git a/doc/develop/application/index.rst b/doc/develop/application/index.rst index cc1b49fa3812..2f1fae6ebcbb 100644 --- a/doc/develop/application/index.rst +++ b/doc/develop/application/index.rst @@ -649,9 +649,8 @@ started. See :ref:`setting_configuration_values` for detailed documentation on setting Kconfig configuration values. The :ref:`initial-conf` section on the same page -explains how the initial configuration is derived. See :ref:`kconfig-search` -for a complete list of configuration options. -See :ref:`hardening` for security information related with Kconfig options. +explains how the initial configuration is derived. See :ref:`hardening` for +security information related with Kconfig options. The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration diff --git a/doc/kconfig.rst b/doc/kconfig.rst deleted file mode 100644 index 1123de2adbd9..000000000000 --- a/doc/kconfig.rst +++ /dev/null @@ -1,8 +0,0 @@ -:orphan: - -.. _kconfig-search: - -Kconfig Search -============== - -.. kconfig:search:: From bac94d557eb647a0a8ba6b21e81bc31dbd724eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 13 Jan 2022 11:37:18 +0100 Subject: [PATCH 1524/3334] [nrf noup] modules: tf-m: use of PSA_HAS_XXXX_SUPPORT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This allows configurations enabled by PSA_WANTS_ALG_XXXX to be used to control which TF-M module is enabled -If the TF-M image doesn't support e.g. the MAC APIs, then the MAC interface is not enabled Note: This functionality requires that nrf_security is enabled ref: NCSDK-11689 Make TF-M crypto module depend on PSA_WANT_GENERATE_RANDOM, same as all other crypto modules, which have PSA_HAS to group all PSA features that require the module. This makes TF-M by default exclude the RNG module when not needed. Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Joakim Andersson (cherry picked from commit 8dafdf6cf30f17668414d98af39a882cb5b36c3e) --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 1d70a2c44d29..02d3580c22f3 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -10,6 +10,7 @@ if TFM_PARTITION_CRYPTO config TFM_CRYPTO_RNG_MODULE_ENABLED bool "Random number generator crypto module" default y + depends on PSA_WANT_GENERATE_RANDOM && NRF_SECURITY help Enables the random number generator module within the crypto partition. Unset this option if 'psa_generate_random' is not used. @@ -17,6 +18,7 @@ config TFM_CRYPTO_RNG_MODULE_ENABLED config TFM_CRYPTO_KEY_MODULE_ENABLED bool "KEY crypto module" default y + depends on PSA_HAS_KEY_SUPPORT && NRF_SECURITY help Enables the KEY crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_management.c' @@ -25,6 +27,7 @@ config TFM_CRYPTO_KEY_MODULE_ENABLED config TFM_CRYPTO_AEAD_MODULE_ENABLED bool "AEAD crypto module" default y + depends on PSA_HAS_AEAD_SUPPORT && NRF_SECURITY help Enables the AEAD crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_aead.c' @@ -33,6 +36,7 @@ config TFM_CRYPTO_AEAD_MODULE_ENABLED config TFM_CRYPTO_MAC_MODULE_ENABLED bool "MAC crypto module" default y + depends on PSA_HAS_MAC_SUPPORT && NRF_SECURITY help Enables the MAC crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_mac.c' @@ -41,6 +45,7 @@ config TFM_CRYPTO_MAC_MODULE_ENABLED config TFM_CRYPTO_HASH_MODULE_ENABLED bool "HASH crypto module" default y + depends on PSA_HAS_HASH_SUPPORT && NRF_SECURITY help Enables the HASH crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_hash.c' @@ -49,6 +54,7 @@ config TFM_CRYPTO_HASH_MODULE_ENABLED config TFM_CRYPTO_CIPHER_MODULE_ENABLED bool "CIPHER crypto module" default y + depends on PSA_HAS_CIPHER_SUPPORT && NRF_SECURITY help Enables the CIPHER crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_cipher.c' @@ -57,6 +63,7 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED bool "ASYM ENCRYPT crypto module" default y + depends on PSA_HAS_ASYM_ENCRYPT_SUPPORT && NRF_SECURITY help Enables the ASYM ENCRYPT crypto module within the crypto partition. Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' @@ -65,6 +72,7 @@ config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED bool "ASYM SIGN crypto module" default y + depends on PSA_HAS_ASYM_SIGN_SUPPORT && NRF_SECURITY help Enables the ASYM SIGN crypto module within the crypto partition. Unset this option if the sign functionality provided by 'crypto_asymmetric.c' @@ -73,10 +81,12 @@ config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED bool "KEY DERIVATION crypto module" default y + depends on (PSA_HAS_KEY_DERIVATION || PSA_HAS_KEY_AGREEMENT) && NRF_SECURITY help Enables the KEY_DERIVATION crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_derivation.c' is not used. + Note that key agreement is under key derivation in the current implementation. endif # TFM_PARTITION_CRYPTO From 318d729f181f4303a6d72a02ae1b1e76dff835e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Sat, 29 Jan 2022 13:03:08 +0100 Subject: [PATCH 1525/3334] [nrf noup] modules: mbedtls: Allow MBEDTLS_BUILTIN to be deselected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Out-of-tree crypto subsystems need to deselect MBEDTLS_BUILTIN, but deselection is not supported. It is however supported to select a dependency in a ! expression. Signed-off-by: Sebastian Bøe (cherry picked from commit 2416c4da0bcb676c42c42d68030a394a79ca1cbe) --- modules/mbedtls/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index 96d176c1ebde..d99e0f08c5b4 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -29,6 +29,7 @@ choice MBEDTLS_IMPLEMENTATION config MBEDTLS_BUILTIN bool "Use Zephyr in-tree mbedTLS version" + depends on ! DISABLE_MBEDTLS_BUILTIN help Link with mbedTLS sources included with Zephyr distribution. Included mbedTLS version is well integrated with and supported @@ -42,6 +43,11 @@ config MBEDTLS_LIBRARY endchoice +# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select +# DISABLE_MBEDTLS_BUILTIN. +config DISABLE_MBEDTLS_BUILTIN + bool + config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" help From 82142dbc3767a4b05b1877f8a35dcc2606063ccb Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Mon, 12 Feb 2024 14:30:23 +0100 Subject: [PATCH 1526/3334] [nrf noup] modules: mbedtls: Add include folders We moved the header files in sdk-mbedtls from the library folder to the include/library folder. This was done to avoid issues when building MbedTLS with the nrf_security module and the Oberon PSA core. The Oberon PSA core provides a subset of these header files and since they are included with quotes we cannot have them in the same directory. This change make the needed adaptions in CMake for the applications that don't use nrf_security. Signed-off-by: Georgios Vasilakis Signed-off-by: Markus Swarowsky (cherry picked from commit bec38cb4ce8470154d09ad6fb7cac72b7ae4ca3a) --- modules/mbedtls/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index b75822441968..ddeb62a65182 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -40,6 +40,8 @@ zephyr_interface_library_named(mbedTLS) # Add regular includes target_include_directories(mbedTLS INTERFACE ${ZEPHYR_CURRENT_MODULE_DIR}/include + ${ZEPHYR_CURRENT_MODULE_DIR}/include/library + ${ZEPHYR_CURRENT_MODULE_DIR}/library configs include ) From 97649f1cba744554f06675f4fa1aeabd2665852a Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 13 Jul 2023 13:42:10 +0000 Subject: [PATCH 1527/3334] [nrf noup] drivers/flashdisk: Add support for Partition Manager The commits adds support for generating flash disks from Partition Manager defined partitions. Signed-off-by: Dominik Ermel (cherry picked from commit 80eff8d743a831977cb4caab3a07b288362618a0) --- drivers/disk/flashdisk.c | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index 1959f94b0ed3..bd5dc6a8f76a 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -504,6 +504,8 @@ static const struct disk_operations flash_disk_ops = { .ioctl = disk_flash_access_ioctl, }; +#ifndef USE_PARTITION_MANAGER +/* The non-Partition manager, DTS based generators below */ #define DT_DRV_COMPAT zephyr_flash_disk #define PARTITION_PHANDLE(n) DT_PHANDLE_BY_IDX(DT_DRV_INST(n), partition, 0) @@ -545,6 +547,82 @@ DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) "Devicetree node " DT_NODE_PATH(DT_DRV_INST(n)) \ " has cache size which is not a multiple of its sector size"); DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) +#else /* ifndef USE_PARTITION_MANAGER */ +/* Partition Manager based generators below */ + +/* Gets the PM_..._EXTRA_PARAM_##param value */ +#define PM_FLASH_DISK_ENTRY_EXTRA_PARAM(name, param) PM_##name##_EXTRA_PARAM_disk_##param + +/* Gets the PM_..._NAME value which is originally cased, as in yaml, partition name */ +#define PM_FLASH_DISK_ENTRY_PARTITION_NAME(name) PM_##name##_NAME + +/* Generates flashdiskN_cache variable name, where N is partition ID */ +#define PM_FLASH_DISK_CACHE_VARIABLE(n) UTIL_CAT(flashdisk, UTIL_CAT(FIXED_PARTITION_ID(n), _cache)) + +/* Generate cache buffers */ +#define CACHE_SIZE(n) (COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), (0), (1)) * \ + PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size)) +#define DEFINE_FLASHDISKS_CACHE(n) \ + static uint8_t __aligned(4) PM_FLASH_DISK_CACHE_VARIABLE(n)[CACHE_SIZE(n)]; + +PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) + +/* Generated single Flash Disk device data from Partition Manager partition. + * Partition is required to have type set to disk in partition definitions: + * type: disk + * and following extra params can be provided: + * extra_params: { + * name = "", + * cache_size = , + * sector_size = , + * read_only = + * } + * where: + * is mandatory device name that will be used by Disk Access and FAT FS to mount device; + * is cache r/w cache size, which is mandatory if read_only = 0 or not present, + * and should be multiple of ; + * is mandatory device sector size information, usually should be erase page size, + * for flash devices, for example 4096 bytes; + * read_only is optional, if not present then assumed false; can be 0(false) or 1(true). + */ +#define DEFINE_FLASHDISKS_DEVICE(n) \ +{ \ + .info = { \ + .ops = &flash_disk_ops, \ + .name = STRINGIFY(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, name)), \ + }, \ + .area_id = FIXED_PARTITION_ID(n), \ + .offset = FIXED_PARTITION_OFFSET(n), \ + .cache = PM_FLASH_DISK_CACHE_VARIABLE(n), \ + .cache_size = sizeof(PM_FLASH_DISK_CACHE_VARIABLE(n)), \ + .size = FIXED_PARTITION_SIZE(n), \ + .sector_size = PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size), \ +}, + +/* The bellow used PM_FOREACH_TYPE_disk is generated by Partition Manager foreach + * loop macro. The lower case _disk is type name for which the macro has been generated; + * partition entry can have multiple types set and foreach macro will be generated + * for every type found across partition definitions. + */ +static struct flashdisk_data flash_disks[] = { + PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE) +}; + +#define VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY(n) \ + COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), \ + (/* cache-size is not used for read-only disks */), \ + (BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) != 0, \ + "Flash disk partition " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n))\ + " must have non-zero cache-size");)) +PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) + +#define VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE(n) \ + BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) % \ + PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size) == 0, \ + "Devicetree node " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n)) \ + " has cache size which is not a multiple of its sector size"); +PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) +#endif /* USE_PARTITION_MANAGER */ static int disk_flash_init(void) { From 4d3a054bee760c70509d61775d2f51eac73ce605 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 23 Jun 2022 14:10:01 +0000 Subject: [PATCH 1528/3334] [nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit adds bootutil hook, for nrf5340, to allow it handling the non-accessible image-1/primary slot. Signed-off-by: Andrzej Głąbek Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Johann Fischer Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit ad57346bf7605728baf1c05c0f4525e43c81cc4f) --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 +++++ subsys/mgmt/mcumgr/Kconfig | 1 + .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 35 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 39d4a4ca8ce0..ad088eca0677 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -16,3 +16,11 @@ add_subdirectory(transport) add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) + +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index c917b1e55e0a..5a7314ad57ed 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,6 +6,7 @@ menuconfig MCUMGR bool "MCUmgr Support" depends on NET_BUF depends on ZCBOR + imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the MCUmgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c new file mode 100644 index 000000000000..f1ac8a168e65 --- /dev/null +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "bootutil/bootutil_public.h" + +#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 +/* Sysbuild */ +#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER +#else +/* Legacy child/parent */ +#define NET_CORE_IMAGE 1 +#endif + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) +{ + if (image_index == NET_CORE_IMAGE) { + /* Pretend that primary slot of image 1 unpopulated */ + state->magic = BOOT_MAGIC_UNSET; + state->swap_type = BOOT_SWAP_TYPE_NONE; + state->image_num = image_index; + state->copy_done = BOOT_FLAG_UNSET; + state->image_ok = BOOT_FLAG_UNSET; + + /* Prevent bootutil from trying to obtain true info */ + return 0; + } + + return BOOT_HOOK_REGULAR; +} From ffc0901fd6d92dff0cb889ada2b5d740b37eb35d Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 16 Oct 2023 08:40:38 +0100 Subject: [PATCH 1529/3334] [nrf noup] samples: bluetooth: hci_pow_ctrl: Migrate child image config Migrates child image configuration for this sample over to sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit 2919de8fa0bfd33d74b6e8ec762aa0f43055a8dc) --- samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf new file mode 100644 index 000000000000..e6749ae63990 --- /dev/null +++ b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf @@ -0,0 +1 @@ +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From 8c39a5f75aa0ae22e66b20b1027d6636dac9dd16 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 16 Oct 2023 08:41:27 +0100 Subject: [PATCH 1530/3334] [nrf noup] samples: mgmt: mcumgr smp_svr: Migrate child image config Migrates child image configuration for this sample over to sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit b110ac811ea2cf695a72431aa14f8010f7fcf0c6) --- .../subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf new file mode 100644 index 000000000000..98260877332f --- /dev/null +++ b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2022 Nordic Semiconductor +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_BT_MAX_CONN=2 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=502 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 From 56c7896a6e65c8d8ae8e2a44b8afd10faa239770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 1 Dec 2022 14:41:13 +0100 Subject: [PATCH 1531/3334] [nrf noup] samples&tests: Restore a few CONFIG_NEWLIB_LIBC_NANO=n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit 9dd570f8a2207a02c886480b0065cd5a0e3a2e94. Since in NCS, unlike in vanilla Zephyr, the nano variant of newlib is the default one, restore entries that disable the nano variant in one sample and one test that require the full newlib variant. This patch is supposed to be removed when picolibc becomes the default. Signed-off-by: Andrzej Głąbek Signed-off-by: Dominik Ermel (cherry picked from commit 9785674003ca9f90958e8895b5f9e70c21a6ec8f) --- tests/lib/newlib/heap_listener/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib/newlib/heap_listener/prj.conf b/tests/lib/newlib/heap_listener/prj.conf index e5a5dc6df4c1..7282777ff1ca 100644 --- a/tests/lib/newlib/heap_listener/prj.conf +++ b/tests/lib/newlib/heap_listener/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y +CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y From 413fef8340aee7a882dd0fe82a5c76d72da54fa8 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 15 Dec 2023 07:57:14 +0000 Subject: [PATCH 1532/3334] [nrf noup] samples/tests: Disable PM for some sysbuild builds Disables partition manager when building some samples and tests which use sysbuild to prevent build issues Signed-off-by: Jamie McCrae (cherry picked from commit e99379d6a289797fe4361658f4a04e44b651d705) --- samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf | 1 + samples/drivers/mbox/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf | 1 + samples/subsys/logging/multidomain/sysbuild.conf | 1 + tests/boot/mcuboot_recovery_retention/sysbuild.conf | 1 + tests/boot/test_mcuboot/sysbuild.conf | 1 + tests/drivers/flash/common/sysbuild.conf | 1 + tests/drivers/flash/negative_tests/sysbuild.conf | 1 + tests/subsys/fs/fcb/sysbuild.conf | 1 + tests/subsys/fs/littlefs/sysbuild.conf | 1 + 12 files changed, 12 insertions(+) create mode 100644 samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf create mode 100644 samples/drivers/mbox/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf create mode 100644 samples/subsys/logging/multidomain/sysbuild.conf create mode 100644 tests/drivers/flash/common/sysbuild.conf create mode 100644 tests/drivers/flash/negative_tests/sysbuild.conf create mode 100644 tests/subsys/fs/fcb/sysbuild.conf create mode 100644 tests/subsys/fs/littlefs/sysbuild.conf diff --git a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/drivers/mbox/sysbuild.conf b/samples/drivers/mbox/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/drivers/mbox/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/logging/multidomain/sysbuild.conf b/samples/subsys/logging/multidomain/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/logging/multidomain/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/mcuboot_recovery_retention/sysbuild.conf b/tests/boot/mcuboot_recovery_retention/sysbuild.conf index 47f00ff3cff8..3b5b3c963800 100644 --- a/tests/boot/mcuboot_recovery_retention/sysbuild.conf +++ b/tests/boot/mcuboot_recovery_retention/sysbuild.conf @@ -1 +1,2 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/test_mcuboot/sysbuild.conf b/tests/boot/test_mcuboot/sysbuild.conf index 47f00ff3cff8..3b5b3c963800 100644 --- a/tests/boot/test_mcuboot/sysbuild.conf +++ b/tests/boot/test_mcuboot/sysbuild.conf @@ -1 +1,2 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/drivers/flash/common/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/negative_tests/sysbuild.conf b/tests/drivers/flash/negative_tests/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/drivers/flash/negative_tests/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/fcb/sysbuild.conf b/tests/subsys/fs/fcb/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/subsys/fs/fcb/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/littlefs/sysbuild.conf b/tests/subsys/fs/littlefs/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/subsys/fs/littlefs/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n From ce55bc3c10a65a47b26697d9d59bb12e244603cc Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Thu, 29 Feb 2024 13:38:48 +0100 Subject: [PATCH 1533/3334] [nrf noup] modules: tfm: Add Kconfig for CRYPTO_PAKE_MODULE_ENABLED Add a Kconfig for th TFM_CRYPTO_PAKE_MODULE_ENABLED to support the PAKE APIs. noup as the PAKE support including the PAKE module doesn't exist yet in upstream TF-M as they depend on mbed TLS support for it Ref: NCSDK-22416 Signed-off-by: Markus Swarowsky (cherry picked from commit 99f08ef8acdcea41299f1b91a6bb9221c1427a47) --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 02d3580c22f3..9604319ca012 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -88,6 +88,17 @@ config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED is not used. Note that key agreement is under key derivation in the current implementation. +config TFM_CRYPTO_PAKE_MODULE_ENABLED + bool "PAKE crypto module" + default y + depends on PSA_HAS_PAKE_SUPPORT + depends on NRF_SECURITY + depends on PSA_CRYPTO_DRIVER_OBERON || PSA_CRYPTO_DRIVER_CRACEN + help + Enables the PAKE crypto module within the crypto partition. + Unset this option if the functionality provided by 'crypto_pake.c' + is not used. + endif # TFM_PARTITION_CRYPTO endif # BUILD_WITH_TFM From c14cef2282f624d031910b7affa6417a2327f7de Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 7 Feb 2023 12:39:12 +0100 Subject: [PATCH 1534/3334] [nrf noup] Bluetooth: Mesh: zero randomization for friend's adv Friend's replies on LPN's polls do not assume randomization in advertiser. Zero randomization will help to optimize time when LPN keeps receiving window open and save power. Signed-off-by: Aleksandr Khromykh Signed-off-by: Olivier Lesage (cherry picked from commit b106f44581674207cdc1c3352f04658ec6756199) --- subsys/bluetooth/mesh/Kconfig | 2 +- subsys/bluetooth/mesh/adv_ext.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index c37c3e03129a..cd9844eeef6a 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1705,7 +1705,7 @@ config BT_MESH_LPN_INIT_POLL_TIMEOUT config BT_MESH_LPN_SCAN_LATENCY int "Latency for enabling scanning" range 0 50 - default 15 + default 2 help Latency in milliseconds that it takes to enable scanning. This is in practice how much time in advance before the Receive Window diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 0ff0bc5e9fe7..2382b01bd182 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -13,6 +13,9 @@ #include #include #include +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#endif #include "common/bt_str.h" @@ -149,6 +152,28 @@ static inline struct bt_mesh_ext_adv *gatt_adv_get(void) } } +static int set_adv_randomness(uint8_t handle, int rand_us) +{ +#if defined(CONFIG_BT_LL_SOFTDEVICE) + struct net_buf *buf; + sdc_hci_cmd_vs_set_adv_randomness_t *cmd_params; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (!buf) { + LOG_ERR("Could not allocate command buffer"); + return -ENOMEM; + } + + cmd_params = net_buf_add(buf, sizeof(*cmd_params)); + cmd_params->adv_handle = handle; + cmd_params->rand_us = rand_us; + + return bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_SET_ADV_RANDOMNESS, buf, NULL); +#else + return 0; +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ +} + static int adv_start(struct bt_mesh_ext_adv *ext_adv, const struct bt_le_adv_param *param, struct bt_le_ext_adv_start_param *start, @@ -552,6 +577,13 @@ int bt_mesh_adv_enable(void) if (err) { return err; } + + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { + err = set_adv_randomness(adv->instance->handle, 0); + if (err) { + LOG_ERR("Failed to set zero randomness: %d", err); + } + } } return 0; From daf9a6a61e2bb4300e2374f0befd0e0b81c1f2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Storr=C3=B8?= Date: Wed, 8 Mar 2023 12:17:09 +0100 Subject: [PATCH 1535/3334] [nrf noup] Bluetooth: Mesh: Fix adv randomness bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue where randomness can be removed for advertising sets that have to handle other adv types than the BT_MESH_FRIEND_ADV tag type. Signed-off-by: Anders Storrø Signed-off-by: Aleksandr Khromykh Signed-off-by: Dominik Ermel (cherry picked from commit 61a77f407e84b60ce59c46ea0bf77ceda8bfa977) --- subsys/bluetooth/mesh/adv_ext.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 2382b01bd182..68a6c27beebf 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -578,8 +578,10 @@ int bt_mesh_adv_enable(void) return err; } - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { - err = set_adv_randomness(adv->instance->handle, 0); + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && + IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_FRIEND_SEPARATE) && + advs[i].tags == BT_MESH_ADV_TAG_BIT_FRIEND) { + err = set_adv_randomness(advs[i].instance->handle, 0); if (err) { LOG_ERR("Failed to set zero randomness: %d", err); } From e48546d45e19b993b8f83c36accea60d6a9291e1 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Thu, 28 Mar 2024 15:04:41 +0100 Subject: [PATCH 1536/3334] [nrf noup] dfu/boot/mcuboot: fix confirmation in case of USE_PARTITION_MANAGER Active partition ID need to be extracted basing on PARTITION_MANAGER products. ref.:NCSDK-26693 Signed-off-by: Andrzej Puzdrowski Signed-off-by: Jamie McCrae (cherry picked from commit aef36004d5a7bb90f0860caebe4d2b498c829950) --- subsys/dfu/boot/mcuboot.c | 47 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/subsys/dfu/boot/mcuboot.c b/subsys/dfu/boot/mcuboot.c index f6122e3c04d9..3750e44ac6b0 100644 --- a/subsys/dfu/boot/mcuboot.c +++ b/subsys/dfu/boot/mcuboot.c @@ -73,8 +73,49 @@ enum IMAGE_INDEXES { IMAGE_INDEX_7, }; -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \ - defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) +#if USE_PARTITION_MANAGER +#include + +#if CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 +/* Sysbuild */ +#ifdef CONFIG_MCUBOOT +/* lib is part of MCUboot -> operate on the primary application slot */ +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#else +/* TODO: Add firmware loader support */ +/* lib is part of the app -> operate on active slot */ +#if defined(CONFIG_NCS_IS_VARIANT_IMAGE) +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif /* CONFIG_MCUBOOT */ +#else +/* Legacy child/parent */ +#if CONFIG_BUILD_WITH_TFM + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) +#else + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) +#endif + +#ifdef CONFIG_MCUBOOT + /* lib is part of MCUboot -> operate on the primary application slot */ + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#else + /* lib is part of the App -> operate on active slot */ +#if (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_PRIMARY_ADDRESS + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#elif (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_SECONDARY_ADDRESS + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID +#else + #error Missing partition definitions. +#endif +#endif /* CONFIG_MCUBOOT */ +#endif /* CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 */ + +#else + +#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) /* For RAM LOAD mode, the active image must be fetched from the bootloader */ #define ACTIVE_SLOT_FLASH_AREA_ID boot_fetch_active_slot() #define INVALID_SLOT_ID 255 @@ -83,6 +124,8 @@ enum IMAGE_INDEXES { #define ACTIVE_SLOT_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_code_partition)) #endif +#endif /* USE_PARTITION_MANAGER */ + /* * Raw (on-flash) representation of the v1 image header. */ From 5fa8c3c53e21ed158df2805b0ac9121bae3d1617 Mon Sep 17 00:00:00 2001 From: Sigurd Hellesvik Date: Tue, 26 Mar 2024 16:35:05 +0100 Subject: [PATCH 1537/3334] [nrf noup] modules: mbedtls: Use help for DISABLE_MBEDTLS_BUILTIN info Using a comment to explain Kconfig options make them invisible to Kconfig search. Use help instead. Signed-off-by: Sigurd Hellesvik (cherry picked from commit 5992ed018de716e4d2fb868c58901534a888802b) --- modules/mbedtls/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index d99e0f08c5b4..a1faae4ad82d 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -43,10 +43,11 @@ config MBEDTLS_LIBRARY endchoice -# subsystems cannot deselect MBEDTLS_BUILTIN, but they can select -# DISABLE_MBEDTLS_BUILTIN. config DISABLE_MBEDTLS_BUILTIN bool + help + Subsystems cannot deselect MBEDTLS_BUILTIN, but they can select + DISABLE_MBEDTLS_BUILTIN. config CUSTOM_MBEDTLS_CFG_FILE bool "Custom mbed TLS configuration file" From 17a2a8c3f7279bae5d9025c83c0eaf118afda8cb Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Wed, 27 Sep 2023 09:41:10 +0000 Subject: [PATCH 1538/3334] [nrf noup] test: schedule_api: Use Minimal C library There is no point to use PICOLIB here as it bloats the tests. Signed-off-by: Dominik Ermel (cherry picked from commit 42834a97d953e02dbd4c87b89d55138499c0d415) --- tests/kernel/pipe/deprecated/pipe_api/prj.conf | 9 +++++++++ tests/kernel/sched/schedule_api/prj.conf | 1 + tests/kernel/sched/schedule_api/prj_multiq.conf | 1 + 3 files changed, 11 insertions(+) create mode 100644 tests/kernel/pipe/deprecated/pipe_api/prj.conf diff --git a/tests/kernel/pipe/deprecated/pipe_api/prj.conf b/tests/kernel/pipe/deprecated/pipe_api/prj.conf new file mode 100644 index 000000000000..df3270adfdf8 --- /dev/null +++ b/tests/kernel/pipe/deprecated/pipe_api/prj.conf @@ -0,0 +1,9 @@ +CONFIG_ZTEST=y +CONFIG_IRQ_OFFLOAD=y +CONFIG_TEST_USERSPACE=y +CONFIG_DYNAMIC_OBJECTS=y +CONFIG_MP_MAX_NUM_CPUS=1 +CONFIG_ZTEST_FATAL_HOOK=y +CONFIG_PIPES=y +CONFIG_DEPRECATION_TEST=y +CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj.conf b/tests/kernel/sched/schedule_api/prj.conf index a5ceef694331..8b649a3b7fca 100644 --- a/tests/kernel/sched/schedule_api/prj.conf +++ b/tests/kernel/sched/schedule_api/prj.conf @@ -7,3 +7,4 @@ CONFIG_MAX_THREAD_BYTES=6 CONFIG_TEST_USERSPACE=y CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y +CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index c8dd4bf786bc..84c9d80ac619 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -7,3 +7,4 @@ CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y CONFIG_NUM_COOP_PRIORITIES=30 CONFIG_NUM_PREEMPT_PRIORITIES=40 +CONFIG_MINIMAL_LIBC=y From 270cc3fbdaf5af33b2e012bad4c22275fe56960c Mon Sep 17 00:00:00 2001 From: Jan Tore Guggedal Date: Mon, 18 May 2020 20:50:13 +0200 Subject: [PATCH 1539/3334] [nrf noup] net: mqtt: Provide option to enable TLS session caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provides an option to enable TLS session caching for an MQTT client's secure socket. Signed-off-by: Jan Tore Guggedal Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Johann Fischer Signed-off-by: Tomasz Moń (cherry picked from commit d593127ffbd013894b1d5afc89bdb7f7fd9a2c07) --- include/zephyr/net/mqtt.h | 3 +++ subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index a4d961a502ef..c1f3b9924133 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -763,6 +763,9 @@ struct mqtt_sec_config { uint32_t alpn_protocol_name_count; #endif + /** Indicates the preference for enabling TLS session caching. */ + int session_cache; + /** Peer hostname for certificate verification. */ const char *hostname; diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 8565d227f858..fa854c5505f9 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -121,6 +121,16 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } + if (tls_config->session_cache == ZSOCK_TLS_SESSION_CACHE_ENABLED) { + ret = zsock_setsockopt(client->transport.tls.sock, ZSOCK_SOL_TLS, + ZSOCK_TLS_SESSION_CACHE, + &tls_config->session_cache, + sizeof(tls_config->session_cache)); + if (ret < 0) { + goto error; + } + } + if (tls_config->cert_nocopy != ZSOCK_TLS_CERT_NOCOPY_NONE) { ret = zsock_setsockopt(client->transport.tls.sock, ZSOCK_SOL_TLS, ZSOCK_TLS_CERT_NOCOPY, &tls_config->cert_nocopy, From 4cd49f9fcd036df82a4346f5b572e6e7c5e4de33 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Mon, 4 Dec 2023 15:27:08 +0100 Subject: [PATCH 1540/3334] [nrf noup] soc: arm: nRF53: Add SPU Flash/RAM alignment TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF53 Signed-off-by: Markus Swarowsky (cherry picked from commit 1fc5b04e051f1702c7138cbe9739d86de08d9748) --- soc/nordic/nrf53/Kconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 7794fba63ba1..186fb547a7b3 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -170,12 +170,26 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral +config NRF_SPU_FLASH_REGION_ALIGNMENT + hex + default 0x4000 + help + FLASH regions must be aligned to this value due to SPU HW + limitations. + config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 help RAM region size for the NRF_SPU peripheral +config NRF_SPU_RAM_REGION_ALIGNMENT + hex + default 0x2000 + help + RAM regions must be aligned to this value due to SPU HW + limitations. + config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" depends on NRF_SOC_SECURE_SUPPORTED From 558978ffbc021a807b2dcf8f1b1da2dab5a68249 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Mon, 4 Dec 2023 15:27:14 +0100 Subject: [PATCH 1541/3334] [nrf noup] soc: arm: nRF91: Add SPU Flash/RAM alignment TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF91 The nRF54L15 doesn't use the SPU for setting the security attributes for flash/RAM regions. In order to avoid having multiple Kconfigs with similar meaning renamed the alignment Kconfig option to something more generic in order to use the same symbol for all the TrustZone enabled devices. Ref: NCSDK-25023 Signed-off-by: Markus Swarowsky Signed-off-by: Georgios Vasilakis (cherry picked from commit dcb4dc934d2171922c14d1c6417744c494baf297) --- soc/nordic/nrf53/Kconfig | 22 ++++++++++++++-------- soc/nordic/nrf91/Kconfig | 22 +++++++++++++++++++++- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 186fb547a7b3..3b82cb23b4a6 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -170,12 +170,15 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_SPU_FLASH_REGION_ALIGNMENT +config NRF_TRUSTZONE_FLASH_REGION_SIZE hex - default 0x4000 + default NRF_SPU_FLASH_REGION_SIZE help - FLASH regions must be aligned to this value due to SPU HW - limitations. + Define the flash region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. config NRF_SPU_RAM_REGION_SIZE hex @@ -183,12 +186,15 @@ config NRF_SPU_RAM_REGION_SIZE help RAM region size for the NRF_SPU peripheral -config NRF_SPU_RAM_REGION_ALIGNMENT +config NRF_TRUSTZONE_RAM_REGION_SIZE hex - default 0x2000 + default NRF_SPU_RAM_REGION_SIZE help - RAM regions must be aligned to this value due to SPU HW - limitations. + Define the RAM region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" diff --git a/soc/nordic/nrf91/Kconfig b/soc/nordic/nrf91/Kconfig index 1af0e06c87dc..ab93f8cbf626 100644 --- a/soc/nordic/nrf91/Kconfig +++ b/soc/nordic/nrf91/Kconfig @@ -27,6 +27,16 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default NRF_SPU_FLASH_REGION_SIZE + help + Define the flash region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. + config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 @@ -37,4 +47,14 @@ config NRF_ENABLE_ICACHE bool "Instruction cache (I-Cache)" default y -endif # SOC_SERIES_NRF91 +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default NRF_SPU_RAM_REGION_SIZE + help + Define the RAM region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. + +endif # SOC_SERIES_NRF91 \ No newline at end of file From 6b3aadd69c890713c027373cf10c0da0732ca196 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 14 Nov 2022 11:22:06 +0100 Subject: [PATCH 1542/3334] [nrf noup] boards: thingy53_nrf5340: Add common partition map Change introduces common static Partition Manager configuration. The tfm_nonsecure partition must be SPU region aligned. Ref: NCSDK-18033 Ref: NCSDK-19515 Signed-off-by: Marek Pieta Signed-off-by: Markus Swarowsky (cherry picked from commit 01ff6eb18aee45d3d7857682f108f05cbab0afe4) --- .../pm_static_thingy53_nrf5340_cpuapp.yml | 55 ++++++++++++++ .../pm_static_thingy53_nrf5340_cpuapp_ns.yml | 73 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml create mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..7a48d51ec334 --- /dev/null +++ b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml @@ -0,0 +1,55 @@ +app: + address: 0x10200 + region: flash_primary + size: 0xdfe00 +mcuboot: + address: 0x0 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + region: flash_primary + size: 0x200 +mcuboot_primary: + address: 0x10000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0xe0000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + orig_span: &id002 + - app + region: flash_primary + size: 0xdfe00 + span: *id002 +settings_storage: + address: 0xf0000 + region: flash_primary + size: 0x10000 +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x00000 + size: 0xe0000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xe0000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x120000 + size: 0x6e0000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml new file mode 100644 index 000000000000..70ffe6d9c124 --- /dev/null +++ b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml @@ -0,0 +1,73 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + region: flash_primary + size: 0x200 +tfm_secure: + address: 0x10000 + size: 0xc000 + span: [mcuboot_pad, tfm] +tfm_nonsecure: + address: 0x1c000 + size: 0xd4000 + span: [app] +tfm: + address: 0x10200 + region: flash_primary + size: 0xbe00 +app: + address: 0x1c000 + region: flash_primary + size: 0xd4000 +mcuboot_primary: + address: 0x10000 + orig_span: &id001 + - mcuboot_pad + - tfm + - app + region: flash_primary + size: 0xe0000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + orig_span: &id002 + - tfm + - app + region: flash_primary + size: 0xdfe00 + span: *id002 +nonsecure_storage: + address: 0xf0000 + size: 0x10000 + span: [settings_storage] +settings_storage: + address: 0xf0000 + region: flash_primary + size: 0x10000 +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x00000 + size: 0xe0000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xe0000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x120000 + size: 0x6e0000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary From 683b8fe80e94f8601003db5dd2f744b566ba649d Mon Sep 17 00:00:00 2001 From: Mateusz Kapala Date: Thu, 2 Feb 2023 11:04:23 +0100 Subject: [PATCH 1543/3334] [nrf noup] boards: arm: thingy53: Disable USB CDC added by MCUBoot Enabling USB CDC by default in Thingy:53 board configuration caused that there were two instances of USB CDC in MCUBoot. Change disables one instance which was added automatically by NCS if MCUBoot bootloader was built as a child image. Jira: NCSDK-18596 Signed-off-by: Mateusz Kapala Signed-off-by: Johann Fischer (cherry picked from commit 7a668858c52a1bedd8b635105982b21c1c477ca6) --- boards/nordic/thingy53/Kconfig.defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index c5b54f30cb79..f90f267ba2e0 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -91,6 +91,13 @@ endif # !TRUSTED_EXECUTION_SECURE source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" +# By default, a USB CDC ACM instance is already enabled in the board's DTS. +# It is not necessary for nRF Connect SDK to add another instance if MCUBoot +# bootloader is built as a child image. +config MCUBOOT_USB_SUPPORT + bool + default n + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From 832056890e822a62eaaa29a93c416fb7c29eae84 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 28 Nov 2022 15:31:33 +0100 Subject: [PATCH 1544/3334] [nrf noup] boards: thingy53_nrf5340: Enable MCUboot by default Change enables MCUboot bootloader by default to allow programming samples and applications without external programmer (using MCUboot serial recovery). Change also enables network core to prevent build failures when building MCUboot with nRF53 multi image DFU. Jira: NCSDK-18263 Signed-off-by: Marek Pieta Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Johann Fischer Signed-off-by: Joakim Andersson (cherry picked from commit 223923a02a5759befedc3f6442ebafd8b57d60d7) --- boards/nordic/thingy53/Kconfig.defconfig | 6 ++++++ boards/nordic/thingy53/thingy53_nrf5340_common.dtsi | 1 + 2 files changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index f90f267ba2e0..65d6f3dad1aa 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -15,6 +15,12 @@ endif # NORDIC_QSPI_NOR if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS +config BOOTLOADER_MCUBOOT + default y if !MCUBOOT + +config BOARD_ENABLE_CPUNET + default y if !MCUBOOT + # Code Partition: # # For the secure version of the board the firmware is linked at the beginning diff --git a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi index 828b710c1ad4..fef36ec84f57 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi +++ b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi @@ -13,6 +13,7 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; + nordic,pm-ext-flash = &mx25r64; }; buttons { From 5ce34aae05be9c66e45ca4ac3d160c21f1f5bcb8 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Fri, 19 Apr 2024 12:58:47 +0200 Subject: [PATCH 1545/3334] [nrf noup] samples: psa_crypto: Remove support for Nordic boards We have our own psa crypto samples to show how to used PSA crypto with NCS. This sample still uses CONFIG_MBEDTLS_BUILTIN which is not supported anymore, therefore removing the support for it in NCS. Ref: NCSDK-17944 Signed-off-by: Markus Swarowsky (cherry picked from commit e3ec025a735de3f6fc67d84ce20168959cb6f3d1) --- samples/tfm_integration/psa_crypto/sample.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/tfm_integration/psa_crypto/sample.yaml b/samples/tfm_integration/psa_crypto/sample.yaml index 545b2337e578..442f20163940 100644 --- a/samples/tfm_integration/psa_crypto/sample.yaml +++ b/samples/tfm_integration/psa_crypto/sample.yaml @@ -16,8 +16,6 @@ tests: platform_allow: - mps2/an521/cpu0/ns - v2m_musca_s1/musca_s1/ns - - nrf5340dk/nrf5340/cpuapp/ns - - nrf9160dk/nrf9160/ns - stm32l562e_dk/stm32l562xx/ns - bl5340_dvk/nrf5340/cpuapp/ns - max32657evkit/max32657/ns From 4eeba095b882fd5b0c556d03420787252530e3e8 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 9 May 2024 09:34:06 +0100 Subject: [PATCH 1546/3334] [nrf noup] boards: nordic: thingy53: Add sysbuild Kconfig file Adds a sysbuild Kconfig file which enables external flash when partition manager is enabled Signed-off-by: Jamie McCrae (cherry picked from commit ce294a1bceb8f3852fa64b16e425b71928710ce5) --- boards/nordic/thingy53/Kconfig.sysbuild | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 boards/nordic/thingy53/Kconfig.sysbuild diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild new file mode 100644 index 000000000000..2110f226e6b1 --- /dev/null +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY + default y if BOOTLOADER_MCUBOOT From 6914e76bc3ce34570f0fdccc64aa31c40ab35230 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 14 May 2024 12:22:51 +0100 Subject: [PATCH 1547/3334] [nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses sysbuild by default when building an application which resides in an allowed NCS-based directory when the sysbuild config key is not set. Do not use sysbuild if the mps2 board is being used to avoid problems with CI testing. Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Moń (cherry picked from commit 3d69ff980c3c97218595c492ebf13feb2e95b739) --- scripts/west_commands/build.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index f7aab1adb147..819805aa49e7 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -664,7 +664,12 @@ def _run_cmake(self, board, origin): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', False) + config_sysbuild = config_getboolean('sysbuild', None) + + if config_sysbuild is None: + # If no option is set, then enable sysbuild globally + config_sysbuild = True + if self.args.sysbuild is True or (config_sysbuild and self.args.sysbuild is not False): cmake_opts.extend([f'-S{SYSBUILD_PROJ_DIR}']) cmake_env = os.environ.copy() From a05d733d37bd95a1d12c33142a523913bf0d3e12 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 17 May 2024 10:15:33 +0100 Subject: [PATCH 1548/3334] [nrf noup] board: nordic: thingy53: Enable default images for sysbuild Enables MCUboot, empty network core and network core updates by default when building for the thingy53 Signed-off-by: Jamie McCrae (cherry picked from commit 69261560e778e70cc8b22648b158a011a7d10c9d) --- boards/nordic/thingy53/Kconfig.sysbuild | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index 2110f226e6b1..c03d191b3708 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -1,5 +1,22 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +config SECURE_BOOT_NETCORE + default y + +config NETCORE_APP_UPDATE + default y if SECURE_BOOT_NETCORE + +config NRF_DEFAULT_EMPTY + default y if SECURE_BOOT_NETCORE + +endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY default y if BOOTLOADER_MCUBOOT From b82e432c73348b2cdf3a9862d65d89a917e2060c Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 1 Oct 2018 10:27:32 +0200 Subject: [PATCH 1549/3334] [nrf noup] include: net: add NCS extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add some socket options and address family extensions to Zephyr headers, which will be useful for nRF Connect SDK. Add secure socket options: * Add CID socket options to NCS specific options. * Add TLS/DTLS tls ciphersuite chosen socket option to NCS specific options. * Add TLS/DTLS connection save/load socket options to NCS specific options. * Add TLS/DTLS handshake status socket option to NCS specific options. * Add SO_KEEPOPEN socket option. * Add SO_RAI socket options. * Add SO_IPV6_DELAYED_ADDR_REFRESH socket option. * Add SO_SENDCB socket option. The "author" of this commit is a contact person; various people with s-o-b lines following here have contributed to the maintenance of this patch. Signed-off-by: Andreas Moltumyr Signed-off-by: Andrzej Głąbek Signed-off-by: Christopher Métrailler Signed-off-by: Emanuele Di Santo Signed-off-by: Glenn Ruben Bakke Signed-off-by: Håkon Alseth Signed-off-by: Ioannis Glaropoulos Signed-off-by: Jan Tore Guggedal Signed-off-by: Joakim Andersson Signed-off-by: Martí Bolívar Signed-off-by: Mirko Covizzi Signed-off-by: Petri Honkala Signed-off-by: Robert Lubos Signed-off-by: Tommi Mammela Signed-off-by: Trond Einar Snekvik Signed-off-by: Torsten Rasmussen Signed-off-by: Eivind Jølsgard Signed-off-by: Dominik Ermel Signed-off-by: Kacper Radoszewski (cherry picked from commit e99b3428e85466a8034c52c4d67542e7b8e19fe0) --- include/zephyr/net/socket.h | 1 + include/zephyr/net/socket_ncs.h | 207 ++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+) create mode 100644 include/zephyr/net/socket_ncs.h diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index f21a7fd764cc..b460fc910ac5 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #ifdef __cplusplus diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h new file mode 100644 index 000000000000..6a77d6c41f13 --- /dev/null +++ b/include/zephyr/net/socket_ncs.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ +#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ + +/** + * @file + * @brief NCS specific additions to the BSD sockets API definitions + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence + * when creating a new socket. Combine this flag with a socket type when + * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). + * If it's desired to create a native TLS socket, but still offload the + * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. + */ +#define SOCK_NATIVE 0x80000000 +#define SOCK_NATIVE_TLS 0x40000000 + +/** Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options. + */ +#define NET_SOCKET_NCS_BASE 1000 + +/* NCS specific TLS level socket options */ + +/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. + * The option accepts an integer, indicating the total handshake timeout, + * including retransmissions, in seconds. + * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. + */ +#define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) + +/** Socket option to save DTLS connection, specifically for nRF sockets. + */ +#define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) + +/** Socket option to load DTLS connection, specifically for nRF sockets. + */ +#define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) + +/** Socket option to get result of latest TLS/DTLS completed handshakes end status, + * specifically for nRF sockets. + * The option accepts an integer, indicating the setting. + * Accepted vaules for the option are: 0 and 1. + */ +#define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) + +/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ +#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */ +#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ +#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ + +/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */ +#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 +#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 + +/* NCS specific socket options */ + +/** sockopt: enable sending data as part of exceptional events */ +#define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) +/** sockopt: Keep socket open when its PDN connection is lost + * or the device is put into flight mode. + */ +#define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) +/** sockopt: bind to PDN */ +#define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) + +/** sockopt: Release assistance indication (RAI). + * The option accepts an integer, indicating the type of RAI. + * Accepted values for the option are: @ref RAI_NO_DATA, @ref RAI_LAST, @ref RAI_ONE_RESP, + * @ref RAI_ONGOING, @ref RAI_WAIT_MORE. + */ +#define SO_RAI (NET_SOCKET_NCS_BASE + 61) + +/** Release assistance indication (RAI). + * Indicate that the application does not intend to send more data. + * This applies immediately and lets the modem exit connected mode more + * quickly. + * + * @note This requires the socket to be connected. + */ +#define RAI_NO_DATA 1 +/** Release assistance indication (RAI). + * Indicate that the application does not intend to send more data + * after the next call to send() or sendto(). + * This lets the modem exit connected mode more quickly after sending the data. + */ +#define RAI_LAST 2 +/** Release assistance indication (RAI). + * Indicate that the application is expecting to receive just one data packet + * after the next call to send() or sendto(). + * This lets the modem exit connected mode more quickly after having received the data. + */ +#define RAI_ONE_RESP 3 +/** Release assistance indication (RAI). + * Indicate that the socket is in active use by a client application. + * This lets the modem stay in connected mode longer. + */ +#define RAI_ONGOING 4 +/** Release assistance indication (RAI). + * Indicate that the socket is in active use by a server application. + * This lets the modem stay in connected mode longer. + */ +#define RAI_WAIT_MORE 5 + +/** sockopt: set a callback to be called when a send request is acknowledged by the network and + * the data has been acknowledged by the peer, if required by the network protocol, or until the + * timeout, given by the SO_SNDTIMEO socket option, is reached. Valid timeout values are + * 1 to 600 seconds. + * This option takes a @ref socket_ncs_sendcb structure. + * + * @note The callback is executed in an interrupt context. + * Take care to offload any processing as appropriate. + * + * @note This is only supported by the following modem firmware: + * - mfw_nrf9151-ntn + * + * This socket option cannot be used along with the @ref MSG_WAITACK send flag. + */ +#define SO_SENDCB (NET_SOCKET_NCS_BASE + 63) + +/** Parameters returned in the @ref socket_ncs_sendcb_t callback. */ +struct socket_ncs_sendcb_params { + /** Socket handle. */ + int fd; + /** Status. Can be 0 on successful send or EAGAIN on timeout. */ + int status; + /** Number of bytes that was sent. */ + size_t bytes_sent; +}; + +/** Callback type in the @ref socket_ncs_sendcb structure. */ +typedef void (*socket_ncs_sendcb_t)(const struct socket_ncs_sendcb_params *params); + +/** Option value for the @ref SO_SENDCB socket option. */ +struct socket_ncs_sendcb { + /** Callback function. */ + socket_ncs_sendcb_t callback; +}; + +/* NCS specific IPPROTO_ALL level socket options */ + +/** IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. */ +#define IPPROTO_ALL 512 +/** sockopt: disable all replies to unexpected traffics */ +#define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) + +/* NCS specific IPPROTO_IP level socket options */ + +/** sockopt: enable IPv4 ICMP replies */ +#define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) + +/* NCS specific IPPROTO_IPV6 level socket options */ + +/** sockopt: enable IPv6 ICMP replies */ +#define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) + +/** sockopt: Delay IPv6 address refresh during power saving mode */ +#define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) + +/* NCS specific TCP level socket options */ + +/** sockopt: Configurable TCP server session timeout in minutes. + * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). + */ +#define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) + +/* NCS specific gettaddrinfo() flags */ + +/** Assume `service` contains a Packet Data Network (PDN) ID. + * When specified together with the AI_NUMERICSERV flag, + * `service` shall be formatted as follows: "port:pdn_id" + * where "port" is the port number and "pdn_id" is the PDN ID. + * Example: "8080:1", port 8080 PDN ID 1. + * Example: "42:0", port 42 PDN ID 0. + */ +#define AI_PDNSERV 0x1000 + +/* NCS specific send() and sendto() flags */ + +/** Request a blocking send operation until the request is acknowledged. + * When used in send() or sendto(), the request will not return until the + * send operation is completed by lower layers, or until the timeout, given by the SO_SNDTIMEO + * socket option, is reached. Valid timeout values are 1 to 600 seconds. + */ +#define MSG_WAITACK 0x200 + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ From a8cb6e26828c238cb4f46f81c1f45215f6a83deb Mon Sep 17 00:00:00 2001 From: Sigvart Hovland Date: Fri, 3 May 2019 14:21:52 +0200 Subject: [PATCH 1550/3334] [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition Manager (PM) is a component of the nRF Connect SDK (NCS) which uses yaml files to resolve flash partition placement with a holistic view of the entire device, including each firmware image present on the flash device, and various subsystems, such as settings and NFFS. When this NCS extension is used, various source files which would use partition information from devicetree in "vanilla" zephyr instead use defines generated by PM instead. This commit removes support for HEX_FILES_TO_MERGE, as it conflicts with PM. The settings subsystem pm.yml defines a partition 'settings_storage'. The nffs subsystem pm.yml defines 'nffs_storage'. Leverage label translation to avoid patching partition names. Refer to the NCS documentation page for this feature for more details. This is a long-running out of tree patch which has been worked on by several people. The following sign-offs are in alphabetical order by first name. Signed-off-by: Andrzej Głąbek Signed-off-by: Andrzej Puzdrowski Signed-off-by: Håkon Øye Amundsen Signed-off-by: Ioannis Glaropoulos Signed-off-by: Joakim Andersson Signed-off-by: Johann Fischer Signed-off-by: Martí Bolívar Signed-off-by: Ole Sæther Signed-off-by: Robert Lubos Signed-off-by: Sebastian Bøe Signed-off-by: Sigvart Hovland Signed-off-by: Thomas Stenersen Signed-off-by: Torsten Rasmussen Signed-off-by: Øyvind Rønningstad Signed-off-by: Trond Einar Snekvik Signed-off-by: Gerard Marull-Paretas Signed-off-by: Tomasz Moń Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit 19efc58959be53320f4de816d0b74c1d49d80485) --- arch/arm/core/mpu/arm_mpu_regions.c | 13 +++++ cmake/linker/ld/target.cmake | 1 + cmake/linker/lld/target.cmake | 1 + cmake/modules/kernel.cmake | 4 ++ drivers/flash/soc_flash_nrf.c | 11 ++++ drivers/flash/soc_flash_nrf_rram.c | 11 ++++ .../arch/arm/cortex_m/scripts/linker.ld | 50 +++++++++++++++++++ include/zephyr/storage/flash_map.h | 6 +++ lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 18 ++++++- subsys/dfu/boot/mcuboot_shell.c | 40 +++++++++++++++ subsys/fs/littlefs_fs.c | 7 ++- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ++++++++++ 13 files changed, 187 insertions(+), 4 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 4771c5914ce6..71c0a9a2b739 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,6 +8,9 @@ #include #include +#if USE_PARTITION_MANAGER +#include +#endif #ifdef CONFIG_ARM_MPU_SRAM_WRITE_THROUGH #define ARM_MPU_SRAM_REGION_ATTR REGION_RAM_WT_ATTR @@ -30,6 +33,14 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) ARM_MPU_SRAM_REGION_ATTR(CONFIG_SRAM_BASE_ADDRESS, @@ -37,6 +48,8 @@ static const struct arm_mpu_region mpu_regions[] = { #else ARM_MPU_SRAM_REGION_ATTR(REGION_SRAM_SIZE)), #endif + +#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index 592596576d11..ccf6a1903162 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,6 +80,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index 96df1c123796..fe8aad62c73d 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,6 +52,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index af9c85d80e35..83c3e4bcb846 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -256,3 +256,7 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() + +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index f6b8a6f5eef3..27fda598be20 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -36,6 +36,11 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -165,6 +170,12 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index 9f0e24dc33d5..84c7e958f3cd 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,6 +54,11 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -292,6 +297,12 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index 288e0d0dc647..82e417900ff0 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,6 +34,39 @@ #define ROMSTART_REGION ROMABLE_REGION #endif +#if USE_PARTITION_MANAGER + +#include + +#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ + +#define ROM_ADDR PM_ADDRESS +#define ROM_SIZE PM_SIZE + +#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) +#define RAM_SIZE CONFIG_PM_SRAM_SIZE +#else +#define RAM_SIZE PM_SRAM_SIZE +#endif +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -55,6 +88,23 @@ #define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 7771e14a0e7b..558a0a0b7e72 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -348,6 +348,10 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + /** * Returns non-0 value if fixed-partition or fixed-subpartition of given * DTS node label exists. @@ -543,6 +547,8 @@ DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) #undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index 0d97da3e340b..9a39ab8ad73b 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -81,7 +81,7 @@ config HEAP_LISTENER choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) + default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) && !PARTITION_MANAGER_ENABLED default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 2b01e152f009..2821ae8173ac 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,6 +25,20 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); +#if USE_PARTITION_MANAGER + +#include + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + +#define RAM_SIZE (KB((size_t) CONFIG_SRAM_SIZE)) +#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS + +#endif /* USE_PARTITION_MANAGER */ + #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -106,8 +120,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ - ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((RAM_SIZE - \ + ((size_t) HEAP_BASE - (size_t) RAM_ADDR)), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index be4e558713f1..e167bc1e39b8 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,6 +20,16 @@ #endif #endif +#if USE_PARTITION_MANAGER +#include + +#ifdef CONFIG_NCS_IS_VARIANT_IMAGE +#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif + struct area_desc { const char *name; unsigned int id; @@ -93,6 +103,35 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ +#if USE_PARTITION_MANAGER +#ifdef PM_MCUBOOT_ID + if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { + shell_error(sh, "Cannot erase boot partition"); + return -EACCES; + } +#endif + +#ifdef PM_APP_ID + if (id == PM_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef PM_MCUBOOT_PRIMARY_APP_ID + if (id == PM_MCUBOOT_PRIMARY_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef ACTIVE_IMAGE_ID + if (id == ACTIVE_IMAGE_ID) { + shell_error(sh, "Cannot erase active partitions"); + return -EACCES; + } +#endif +#else #if FIXED_PARTITION_EXISTS(boot_partition) if (id == FIXED_PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -105,6 +144,7 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } +#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index bf60649e9b95..a31e01836a9c 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1133,7 +1133,12 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = FSTAB_ENTRY_DT_INST_MOUNT_POINT(inst), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ + .storage_dev = (void *) \ + COND_CODE_1(USE_PARTITION_MANAGER, \ + (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ + (FIXED_PARTITION_ID(littlefs_storage)), \ + (FIXED_PARTITION_ID(storage)))), \ + (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index a74e46b85207..9996e1d74d9b 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,8 +13,35 @@ extern "C" { #endif +#if CONFIG_PARTITION_MANAGER_ENABLED + +#include "pm_config.h" + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) +#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE +#else +/* The current image is a child image in a different domain than the image + * which defined the required values. To reach the values of the parent domain + * we use the 'PM__' variant of the define. + */ +#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ + +#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ + +#else + +#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) +#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) + +#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From f6c88a812e52fa650423b7a3af633d4648da143a Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Fri, 17 May 2024 14:10:51 +0200 Subject: [PATCH 1551/3334] [nrf noup] kernel: Disable boot banner if NCS_BOOT_BANNER is enabled Zephyr's boot banner should not be used if NCS boot banner is enabled. Signed-off-by: Robert Lubos (cherry picked from commit 88523835cd867c28c27dfd933b19eb3e59b6b086) --- kernel/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/Kconfig b/kernel/Kconfig index 52ef3d531aae..5de8a1f097c1 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -457,6 +457,7 @@ config SKIP_BSS_CLEAR config BOOT_BANNER bool "Boot banner" default y + depends on !NCS_BOOT_BANNER select PRINTK select EARLY_CONSOLE help From c6241a49d34b61fdd0fde58612aaec1fb6cefc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Fri, 31 May 2024 08:21:51 +0200 Subject: [PATCH 1552/3334] =?UTF-8?q?[nrf=20noup]=C2=A0Bluetooth:=20Mesh:?= =?UTF-8?q?=20remove=20legacy=20adv=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes explicit support for the legacy advertiser due to incompatibility with SDC. The legacy advertiser can be used (experimentally) with the Zephyr Link Layer enabled, but is not recommended. Signed-off-by: Håvard Reierstad (cherry picked from commit 11670b5620de6d0b7496c70527032ac9331e8667) --- subsys/bluetooth/mesh/Kconfig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index cd9844eeef6a..722bf0bedafb 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -59,12 +59,16 @@ choice BT_MESH_ADV menuconfig BT_MESH_ADV_LEGACY bool "Legacy advertising" + depends on BT_LL_SW_SPLIT help Use legacy advertising commands for mesh sending. Legacy - advertising is significantly slower than the extended advertising, but - is supported by all controllers. + advertising is significantly slower than the extended advertising. - WARNING: The legacy advertiser can occasionally do more message + WARNING: This feature is not supported in NCS. The legacy advertiser will not work + with SDC, as attempting to start an advertisement during the scanner duty cycle + will result in an error. The Zephyr Link Layer can be used experimentally as an + alternative. + The legacy advertiser can occasionally do more message retransmissions than requested because of limitations of HCI interface API. From fb75570475499ef69fdc3f463808f337b6d2d14d Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 5 Jun 2024 13:37:34 +0100 Subject: [PATCH 1553/3334] [nrf noup] board: nordic: thingy53: Default to update only MCUboot type Changes the default MCUboot mode to update only for the thingy53, to align with previous bootloader builds Changes the thingy53 default configuration for sysbuild to enable using all RAM in the MCUboot image Signed-off-by: Jamie McCrae (cherry picked from commit dc6ba5504883223dffaa0a96f4b99a5b0f83a778) --- boards/nordic/thingy53/Kconfig.sysbuild | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index c03d191b3708..df489c1dd546 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -7,6 +7,10 @@ choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice +choice MCUBOOT_MODE + default MCUBOOT_MODE_OVERWRITE_ONLY +endchoice + config SECURE_BOOT_NETCORE default y @@ -16,6 +20,9 @@ config NETCORE_APP_UPDATE config NRF_DEFAULT_EMPTY default y if SECURE_BOOT_NETCORE +config MCUBOOT_USE_ALL_AVAILABLE_RAM + default y if BOARD_THINGY53_NRF5340_CPUAPP_NS && BOOTLOADER_MCUBOOT + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY From 7784106ebe3c7bf12b36008bd0be209cb6f2e6ac Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 12 Jun 2024 16:15:29 +0200 Subject: [PATCH 1554/3334] [nrf noup] samples: sysbuild: hello_world: support PM on nRF53 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PM support is still required for nRF53/nRF54l15 in the context of NCS. Signed-off-by: Gerard Marull-Paretas Signed-off-by: Tomasz Moń (cherry picked from commit 166df2e6a793043ee6e275b8d526768944c7410b) --- samples/sysbuild/hello_world/sysbuild.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index fa0599c6a621..654c4175faac 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -9,6 +9,18 @@ if(DEFINED SB_CONFIG_REMOTE_BOARD) BOARD_REVISION ${BOARD_REVISION} ) + if(SB_CONFIG_SOC_SERIES_NRF53X) + set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) + set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) + set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) + set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") + else(SB_CONFIG_SOC_SERIES_NRF54LX) + set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) + set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) + set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) + set(CPUFLPR_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") + endif() + add_dependencies(${DEFAULT_IMAGE} remote) sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote) endif() From c7c73c12195d5f108e985022feaf5b857e6bfad1 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Mon, 25 Sep 2023 16:41:15 +0200 Subject: [PATCH 1555/3334] [nrf noup] settings: nvs: use dedicated lookup cache hash function Introduce NVS_LOOKUP_CACHE_FOR_SETTINGS Kconfig option that enables a dedicated hash function for the NVS lookup cache that takes advantage of the NVS ID allocation scheme used by the NVS settings backend. As such, this option should only be used if an application uses NVS via the settings layer. Signed-off-by: Damian Krolik (cherry picked from commit 726425bfc28f2408dcc66417939bb5e3e97ffca7) --- subsys/fs/nvs/Kconfig | 9 +++++++++ subsys/fs/nvs/nvs.c | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/subsys/fs/nvs/Kconfig b/subsys/fs/nvs/Kconfig index 48915c2f048e..21798932f521 100644 --- a/subsys/fs/nvs/Kconfig +++ b/subsys/fs/nvs/Kconfig @@ -29,6 +29,15 @@ config NVS_LOOKUP_CACHE_SIZE Number of entries in Non-volatile Storage lookup cache. It is recommended that it be a power of 2. +config NVS_LOOKUP_CACHE_FOR_SETTINGS + bool "Non-volatile Storage lookup cache optimized for settings" + depends on NVS_LOOKUP_CACHE + help + Use the lookup cache hash function that results in the least number of + collissions and, in turn, the best NVS performance provided that the NVS + is used as the settings backend only. This option should NOT be enabled + if the NVS is also written to directly, outside the settings layer. + config NVS_DATA_CRC bool "Non-volatile Storage CRC protection on the data" help diff --git a/subsys/fs/nvs/nvs.c b/subsys/fs/nvs/nvs.c index 8a710d570fb1..f36d5b76dd56 100644 --- a/subsys/fs/nvs/nvs.c +++ b/subsys/fs/nvs/nvs.c @@ -13,6 +13,11 @@ #include #include "nvs_priv.h" +#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS +#include +#include +#endif + #include LOG_MODULE_REGISTER(fs_nvs, CONFIG_NVS_LOG_LEVEL); @@ -21,6 +26,45 @@ static int nvs_ate_valid(struct nvs_fs *fs, const struct nvs_ate *entry); #ifdef CONFIG_NVS_LOOKUP_CACHE +#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS + +static inline size_t nvs_lookup_cache_pos(uint16_t id) +{ + /* + * 1. The NVS settings backend uses up to (NVS_NAME_ID_OFFSET - 1) NVS IDs to + store keys and equal number of NVS IDs to store values. + * 2. For each key-value pair, the value is stored at NVS ID greater by exactly + * NVS_NAME_ID_OFFSET than NVS ID that holds the key. + * 3. The backend tries to minimize the range of NVS IDs used to store keys. + * That is, NVS IDs are allocated sequentially, and freed NVS IDs are reused + * before allocating new ones. + * + * Therefore, to assure the least number of collisions in the lookup cache, + * the least significant bit of the hash indicates whether the given NVS ID + * represents a key or a value, and remaining bits of the hash are set to + * the ordinal number of the key-value pair. Consequently, the hash function + * provides the following mapping: + * + * 1st settings key => hash 0 + * 1st settings value => hash 1 + * 2nd settings key => hash 2 + * 2nd settings value => hash 3 + * ... + */ + BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAMECNT_ID), "NVS_NAMECNT_ID is not power of 2"); + BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAME_ID_OFFSET), "NVS_NAME_ID_OFFSET is not power of 2"); + + uint16_t key_value_bit; + uint16_t key_value_ord; + + key_value_bit = (id >> LOG2(NVS_NAME_ID_OFFSET)) & 1; + key_value_ord = id & (NVS_NAME_ID_OFFSET - 1); + + return ((key_value_ord << 1) | key_value_bit) % CONFIG_NVS_LOOKUP_CACHE_SIZE; +} + +#else /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ + static inline size_t nvs_lookup_cache_pos(uint16_t id) { uint16_t hash; @@ -36,6 +80,8 @@ static inline size_t nvs_lookup_cache_pos(uint16_t id) return hash % CONFIG_NVS_LOOKUP_CACHE_SIZE; } +#endif /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ + static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) { int rc; From a0d974eaacd3fc8042cba8ef5044be2dd5d50d6e Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Mon, 8 Jul 2024 10:08:10 +0200 Subject: [PATCH 1556/3334] [nrf noup] ci: Enable action-manifest-pr This action will automatically manage a PR to sdk-nrf once a PR to sdk-zephyr is created. This includes: - Creating an initial PR - Updating and (optionally) rebase it once the PR to sdk-nrf is merged. The action can be disabled by adding the string "manifest-pr-skip" to the title or body of the PR. This will simplify cherry-picking changes from upstream zephyr. Signed-off-by: Rubin Gerritsen (cherry picked from commit d20c47b85b2ded6bb902954f18b4daded254dbe0) --- .github/workflows/manifest-PR.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/manifest-PR.yml diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml new file mode 100644 index 000000000000..a871aa381ded --- /dev/null +++ b/.github/workflows/manifest-PR.yml @@ -0,0 +1,17 @@ +name: handle manifest PR +on: + pull_request_target: + types: [opened, synchronize, closed] + branches: + - main + + +jobs: + call-manifest-pr-action: + runs-on: ubuntu-latest + steps: + - name: handle manifest PR + uses: nrfconnect/action-manifest-pr@main + with: + token: ${{ secrets.NCS_GITHUB_TOKEN }} + manifest-pr-title-details: ${{ github.event.pull_request.title }} From 9417c294345bc6e2666f92c61dff1bf67e7c7c67 Mon Sep 17 00:00:00 2001 From: Mateusz Michalek Date: Mon, 17 Jun 2024 14:57:09 +0200 Subject: [PATCH 1557/3334] [nrf noup] drivers: flash: kconfig: nrf_rram region resolution adjusting region resolution to match erase-block-size Signed-off-by: Mateusz Michalek (cherry picked from commit ffd7e53f74c26648be3fa6320f8b3a544f010f94) --- 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 b40bb16968bf..d8a5abf64b2e 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -77,14 +77,14 @@ config SOC_FLASH_NRF_TIMEOUT_MULTIPLIER config NRF_RRAM_REGION_ADDRESS_RESOLUTION hex - default 0x400 + default 0x1000 help RRAMC's region protection address resolution. Applies to region with configurable start address. config NRF_RRAM_REGION_SIZE_UNIT hex - default 0x400 + default 0x1000 help Base unit for the size of RRAMC's region protection. From 08d091ea39b2bfbe279860edacacd12a1107f163 Mon Sep 17 00:00:00 2001 From: Sigurd Hellesvik Date: Fri, 23 Aug 2024 11:24:06 +0200 Subject: [PATCH 1558/3334] [nrf noup] board: nordic_ thingy53: Enable QSPI by default The Thingy:53 enabled MCUboot and external flash by default. Therefore, it should also enable drivers for its external flash by default. Signed-off-by: Sigurd Hellesvik (cherry picked from commit f65b03997a63031a1393f7c4612aa099d2297d70) --- boards/nordic/thingy53/Kconfig.defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 65d6f3dad1aa..2809fd1eafc9 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -104,6 +104,9 @@ config MCUBOOT_USB_SUPPORT bool default n +config NORDIC_QSPI_NOR + default y + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From 8b6614f59e6d9b8ad1e6f6861738716af3c27f6b Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 26 Sep 2024 12:40:33 +0200 Subject: [PATCH 1559/3334] [nrf noup] samples: basic: blinky: add eGPIO tests configuration Add overlay for nrf54l15dk to enable eGPIO tests. Signed-off-by: Jakub Zymelka Signed-off-by: Marcin Szymczyk (cherry picked from commit f7c0fe841bc5c675f28daf3df5b774471b810fcf) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay diff --git a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay new file mode 100644 index 000000000000..bd1ceb2f8945 --- /dev/null +++ b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&led0 { + gpios = <&hpf_gpio 9 GPIO_ACTIVE_HIGH>; +}; From b0c0460cac3b75a4e345b77473f393a2a0c14775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 11 Sep 2024 10:17:28 +0200 Subject: [PATCH 1560/3334] [nrf noup] modules: mbedtls: Disable configurations in Kconfig.tls-generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit prevents legacy mbed TLS configurations from being in conflict with PSA Configurations while using nrf_security. -This [nrf noup] is reworked from an earlier cherry-pick of commit d8c96cfab37d3738dac933075780f6ca24593447, but has the following changes: - Endif's relevant that is using our pattern for masking configs duplicated or in conflict in nrf_security (by using if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)) is made clearer by adding a comment at their corresponding endif (# !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)) - Changes to zephyr_init.c for entropy_dev checking for CONFIG_NRF_CC3XX_PLATFORM is removed as the symbol entropy_dev doesn't exist in this file anymore ref: NCSDK-13503 Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Tomasz Moń (cherry picked from commit 82cb1d57ad9bb855515f932534c6bd112d999919) --- modules/mbedtls/Kconfig.mbedtls | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 7c66b58f768f..84c285af45f7 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -7,6 +7,8 @@ menu "Mbed TLS configuration" depends on MBEDTLS_BUILTIN && MBEDTLS_CFG_FILE = "config-mbedtls.h" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + menu "TLS" config MBEDTLS_SSL_PROTO_TLS1_2 @@ -40,6 +42,8 @@ endif # MBEDTLS_SSL_PROTO_TLS1_2 || MBEDTLS_SSL_PROTO_TLS1_3 endmenu # TLS +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + menu "Ciphersuite configuration" comment "Supported key exchange modes" @@ -60,6 +64,8 @@ config MBEDTLS_GENPRIME_ENABLED endif # MBEDTLS_RSA_C +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_MD_C @@ -92,6 +98,8 @@ config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED bool "RSA-PSK based ciphersuite modes" depends on MBEDTLS_PKCS1_V15 || MBEDTLS_PKCS1_V21 +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -99,6 +107,8 @@ config MBEDTLS_PSK_MAX_LEN Max size of TLS pre-shared keys, in bytes. It has no effect if no PSK key exchange is used. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED bool "RSA-only based ciphersuite modes" depends on MBEDTLS_MD_C @@ -239,8 +249,12 @@ config MBEDTLS_ECP_NIST_OPTIM endif +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Supported ciphers and cipher modes" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers and modes" select MBEDTLS_CIPHER_AES_ENABLED @@ -331,8 +345,12 @@ config MBEDTLS_CMAC bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers" depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Supported hash algorithms" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_HASH_ALL_ENABLED bool "All available MAC methods" select MBEDTLS_MD5 @@ -373,10 +391,14 @@ config MBEDTLS_SHA512 config MBEDTLS_POLY1305 bool "Poly1305 hash family" +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + endmenu comment "Random number generators" +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_CTR_DRBG_C bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED @@ -386,15 +408,21 @@ config MBEDTLS_HMAC_DRBG_C bool "HMAC_DRBG random generator" select MBEDTLS_MD_C +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + comment "Other configurations" config MBEDTLS_CIPHER bool "Generic cipher layer" default y if PSA_WANT_ALG_CMAC +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_MD_C bool "Generic message digest layer" +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ASN1_PARSE_C bool "Support for ASN1 parser functions" @@ -434,6 +462,8 @@ config MBEDTLS_HAVE_ASM of asymmetric cryptography, however this might have an impact on the code size. +if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ENTROPY_C bool "Mbed TLS entropy accumulator" depends on MBEDTLS_SHA256 || MBEDTLS_SHA384 || MBEDTLS_SHA512 @@ -442,6 +472,8 @@ config MBEDTLS_ENTROPY_C mostly used in conjunction with CTR_DRBG or HMAC_DRBG to create a deterministic random number generator. +endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND) + config MBEDTLS_ENTROPY_POLL_ZEPHYR bool "Provide entropy data to Mbed TLS through entropy driver or random generator" default y From b3f3a15be778db47df9ff62c91e2c2511be24345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Mon, 9 Sep 2024 14:55:05 +0200 Subject: [PATCH 1561/3334] [nrf noup] mbedtls: Enable PSA_WANT_GENERATE_RANDOM for PSA RNG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] because PSA_WANT_GENERATE_RANDOM is a Nordic configuration that is not found upstream. This was previously in commit 5cfe5750b622efff77427425bf61854a95ade9fb but has been split out Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 61ce2d882c57bb597a46dc04ec73d24a99402760) --- drivers/entropy/Kconfig.psa_crypto | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/entropy/Kconfig.psa_crypto b/drivers/entropy/Kconfig.psa_crypto index d06001225b05..18514a071d1c 100644 --- a/drivers/entropy/Kconfig.psa_crypto +++ b/drivers/entropy/Kconfig.psa_crypto @@ -7,6 +7,7 @@ config ENTROPY_PSA_CRYPTO_RNG bool "PSA Crypto Random source Entropy driver" depends on DT_HAS_ZEPHYR_PSA_CRYPTO_RNG_ENABLED select ENTROPY_HAS_DRIVER + select PSA_WANT_GENERATE_RANDOM default y help Enable the PSA Crypto source Entropy driver. From aa49bd203c70254b6e55ba917b1b04f9e4140fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:35:25 +0200 Subject: [PATCH 1562/3334] [nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit is a [nrf noup] because it removes configuration options for cryptographic algortihms available in Mbed TLS but which is not actively supported in nRF Connect SDK. The list of algorithms removed: - AES CFB - Cipher Feedback block cipher - AES OFB - Output Feedback block cipher - FFDH - RIPEMD160 - Aria - Camellia - DES The removal of these algorithms is based both on a wish to remove weaker cryptography and unsupported features in the products we have today. Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit f6c0e6227ff71f6a0dddfbd086f4d90306ceca39) --- modules/mbedtls/Kconfig.psa.auto | 61 ------------------------------- modules/mbedtls/Kconfig.psa.logic | 7 ---- 2 files changed, 68 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 08b1bbc02410..56a81dd6efda 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -36,10 +36,6 @@ config PSA_WANT_ALG_CMAC bool "PSA_WANT_ALG_CMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_CFB - bool "PSA_WANT_ALG_CFB" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_ALG_CHACHA20_POLY1305 bool "PSA_WANT_ALG_CHACHA20_POLY1305" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -60,10 +56,6 @@ config PSA_WANT_ALG_ECDH bool "PSA_WANT_ALG_ECDH" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_FFDH - bool "PSA_WANT_ALG_FFDH" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_ALG_ECDSA bool "PSA_WANT_ALG_ECDSA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -96,9 +88,6 @@ config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_OFB - bool "PSA_WANT_ALG_OFB" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -108,9 +97,6 @@ config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_RIPEMD160 - bool "PSA_WANT_ALG_RIPEMD160" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -228,26 +214,6 @@ config PSA_WANT_ECC_SECP_R1_521 bool "PSA_WANT_ECC_SECP_R1_521" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_DH_RFC7919_2048 - bool "PSA_WANT_DH_RFC7919_2048" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_3072 - bool "PSA_WANT_DH_RFC7919_3072" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_4096 - bool "PSA_WANT_DH_RFC7919_4096" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_6144 - bool "PSA_WANT_DH_RFC7919_6144" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_8192 - bool "PSA_WANT_DH_RFC7919_8192" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_DERIVE bool "PSA_WANT_KEY_TYPE_DERIVE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -268,30 +234,15 @@ config PSA_WANT_KEY_TYPE_AES bool "PSA_WANT_KEY_TYPE_AES" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_ARIA - bool "PSA_WANT_KEY_TYPE_ARIA" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_CAMELLIA - bool "PSA_WANT_KEY_TYPE_CAMELLIA" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DES - bool "PSA_WANT_KEY_TYPE_DES" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY - bool "PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_RAW_DATA bool "PSA_WANT_KEY_TYPE_RAW_DATA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -328,16 +279,4 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - endif # PSA_CRYPTO_CLIENT diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index 972054e105b0..9c3a55ea3191 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -47,10 +47,3 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC - bool - default y - depends on PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT || \ - PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT || \ - PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE From e9b99eb333d00f006550bcca1e336c774839d218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:49:58 +0200 Subject: [PATCH 1563/3334] [nrf noup] mbedtls: Add dependency logic for PSA crypto configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] as this the upstream version of PSA crypto configs is generated by tooling, and there is no mechanisms to qualify that dependent configurations are enabled (by depends or select). -This adds dependency-mapping between configurations in the Kconfigs added for PSA crypto in upstream. -Selecting CHACHA20 key type if PSA_WANT_ALG_STREAM_CIPHER is enabled Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 7b3b6f1e251be8f3c0cbeef0418ef83f541f65af) --- modules/mbedtls/Kconfig.psa.auto | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 56a81dd6efda..fa8cdbc7b536 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -71,6 +71,7 @@ config PSA_WANT_ALG_GCM config PSA_WANT_ALG_HKDF bool "PSA_WANT_ALG_HKDF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_HKDF_EXTRACT bool "PSA_WANT_ALG_HKDF_EXTRACT" if !MBEDTLS_PROMPTLESS @@ -92,11 +93,12 @@ config PSA_WANT_ALG_MD5 config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + depends on PSA_WANT_ALG_CMAC config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -153,18 +155,22 @@ config PSA_WANT_ALG_SHA3_512 config PSA_WANT_ALG_STREAM_CIPHER bool "PSA_WANT_ALG_STREAM_CIPHER" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + select PSA_WANT_KEY_TYPE_CHACHA20 config PSA_WANT_ALG_TLS12_PRF bool "PSA_WANT_ALG_TLS12_PRF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_PSK_TO_MS bool "PSA_WANT_ALG_TLS12_PSK_TO_MS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS bool "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_SHA_256 config PSA_WANT_ECC_BRAINPOOL_P_R1_256 bool "PSA_WANT_ECC_BRAINPOOL_P_R1_256" if !MBEDTLS_PROMPTLESS @@ -237,7 +243,8 @@ config PSA_WANT_KEY_TYPE_AES config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + depends on PSA_WANT_ALG_CHACHA20_POLY1305 || \ + PSA_WANT_ALG_STREAM_CIPHER config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS @@ -253,30 +260,37 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL endif # PSA_CRYPTO_CLIENT From 6acd8bf86f07042e355511939cc8594d65be561c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:53:27 +0200 Subject: [PATCH 1564/3334] [nrf noup] mbedtls: Adding helptext warnings for weak crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit is a [nrf noup] because PSA crypto configs in upstream Zephyr doesn't have help-text in their configurations and we don't want to duplicate configurations to control the value -This adds warning for SHA-1 and MD5 usage Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit c85ef306b1a58c9ed57b0ee3185b025401773df6) --- modules/mbedtls/Kconfig.psa.auto | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index fa8cdbc7b536..834252432b52 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -88,7 +88,9 @@ config PSA_WANT_ALG_HMAC config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + help + Warning: The MD5 hash is weak and deprecated and is only recommended + for use in legacy protocols. config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -119,6 +121,9 @@ config PSA_WANT_ALG_RSA_PSS config PSA_WANT_ALG_SHA_1 bool "PSA_WANT_ALG_SHA_1" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + help + Warning: The SHA-1 hash is weak and deprecated and is only recommended + for use in legacy protocols. config PSA_WANT_ALG_SHA_224 bool "PSA_WANT_ALG_SHA_224" if !MBEDTLS_PROMPTLESS From 2d6042685472d1c8e211333a35a8679b04ea46c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:56:48 +0200 Subject: [PATCH 1565/3334] [nrf noup] mbedtls: Adding missing configuration for RSA key type derive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] because the upstream Zephyr is generated using a script and is not committed as-is as source-code. The relevant responsible person for this feature has received information about the missing configuration and this will be resolved upstream in Mbed TLS and will propagate down to zephyr. Once this has happened, this [nrf noup] can be dropped. -Add missing PSA_WANT_KEY_TYPE_RSA_KEY_DERIVE Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 2c73db0cf52ab4670770061de00485acca9af2ee) --- modules/mbedtls/Kconfig.psa.auto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 834252432b52..b235c30380fb 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -298,4 +298,9 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE + bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + default y if PSA_CRYPTO_ENABLE_ALL + endif # PSA_CRYPTO_CLIENT From 221fb83698730553bd2bc1c47fa094d60561ba4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 5 Sep 2024 15:05:43 +0200 Subject: [PATCH 1566/3334] [nrf noup] mbedtls: Don't select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC is internally resolved by Mbed TLS. It has been made promptless in a previous commit. Keeping this change separated since the Kconfig.psa is auto-generated and it would likely be a bit more complex to handle this in a single commit. Upstream maintainers have been notified about this mismatch in configurations. Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit 2579412c828f02d1e40424e4698590c91d185f3c) --- modules/mbedtls/Kconfig.mbedtls | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 84c285af45f7..03833b20063d 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -117,6 +117,7 @@ config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT if PSA_CRYPTO_CLIENT select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE if PSA_CRYPTO_CLIENT + select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE if PSA_CRYPTO_CLIENT config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED bool "DHE-RSA based ciphersuite modes" From 40e3a644f6bd47d0cdccfcb0897f60ed5ab35a5a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 7 May 2024 08:27:09 +0100 Subject: [PATCH 1567/3334] [nrf noup] kernel: banner: Make function weak Makes the boot banner function weak, this resolves an issue when building with llext enabled which uses different build options than a normal zephyr build Signed-off-by: Jamie McCrae (cherry picked from commit 19fcc84b983e4d184492e3f4e97654acab089fec) --- kernel/banner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/banner.c b/kernel/banner.c index 5cadda0a5e98..a16784cb975c 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 8cb052488688da59da7d4fab4f75cd193697338c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 20 Sep 2024 14:48:37 +0200 Subject: [PATCH 1568/3334] [nrf noup] lib: os: zvfs: Remove EXPERIMENTAL from ZVFS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Tomasz Moń (cherry picked from commit 2aa414a3ac39577a553c4ab2b7a0ded8558ab9a6) --- lib/os/zvfs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index d7b6914cb5d8..420d6bc41333 100644 --- a/lib/os/zvfs/Kconfig +++ b/lib/os/zvfs/Kconfig @@ -5,7 +5,6 @@ menuconfig ZVFS bool "Zephyr virtual filesystem (ZVFS) support [EXPERIMENTAL]" - 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 13946e4ba178943b25d748338156ade2f2ef0a17 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 7 Oct 2024 15:36:43 +0200 Subject: [PATCH 1569/3334] [nrf noup] samples: net: Enable Wi-Fi driver in sysbuild builds Make sure Wi-Fi driver is enabled in networking samples supporting Wi-Fi when sysbuild is used. For shields we cannot automate this, as sysbuild doesn't recognize shields, so, Wi-Fi has to be explicitly enabled, this is done for twister in Wi-Fi sample. Signed-off-by: Robert Lubos Signed-off-by: Chaitanya Tata (cherry picked from commit 4a986ba1947915c34d1127c823c529b6b52e2c0b) --- samples/net/dns_resolve/Kconfig.sysbuild | 13 +++++++++++++ samples/net/ipv4_autoconf/Kconfig.sysbuild | 13 +++++++++++++ samples/net/lwm2m_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mdns_responder/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mqtt_publisher/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mqtt_sn_publisher/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/coap_server/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_async/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_server/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/http_get/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/sntp_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/syslog_net/Kconfig.sysbuild | 13 +++++++++++++ samples/net/telnet/Kconfig.sysbuild | 13 +++++++++++++ samples/net/wifi/Kconfig.sysbuild | 13 +++++++++++++ samples/net/wifi/shell/sample.yaml | 2 ++ 16 files changed, 197 insertions(+) create mode 100644 samples/net/dns_resolve/Kconfig.sysbuild create mode 100644 samples/net/ipv4_autoconf/Kconfig.sysbuild create mode 100644 samples/net/lwm2m_client/Kconfig.sysbuild create mode 100644 samples/net/mdns_responder/Kconfig.sysbuild create mode 100644 samples/net/mqtt_publisher/Kconfig.sysbuild create mode 100644 samples/net/mqtt_sn_publisher/Kconfig.sysbuild create mode 100644 samples/net/sockets/coap_server/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_async/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_client/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_server/Kconfig.sysbuild create mode 100644 samples/net/sockets/http_get/Kconfig.sysbuild create mode 100644 samples/net/sockets/sntp_client/Kconfig.sysbuild create mode 100644 samples/net/syslog_net/Kconfig.sysbuild create mode 100644 samples/net/telnet/Kconfig.sysbuild create mode 100644 samples/net/wifi/Kconfig.sysbuild diff --git a/samples/net/dns_resolve/Kconfig.sysbuild b/samples/net/dns_resolve/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/dns_resolve/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/ipv4_autoconf/Kconfig.sysbuild b/samples/net/ipv4_autoconf/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/ipv4_autoconf/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/lwm2m_client/Kconfig.sysbuild b/samples/net/lwm2m_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/lwm2m_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mdns_responder/Kconfig.sysbuild b/samples/net/mdns_responder/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mdns_responder/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_publisher/Kconfig.sysbuild b/samples/net/mqtt_publisher/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mqtt_publisher/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/coap_server/Kconfig.sysbuild b/samples/net/sockets/coap_server/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/coap_server/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_async/Kconfig.sysbuild b/samples/net/sockets/echo_async/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_async/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_client/Kconfig.sysbuild b/samples/net/sockets/echo_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_server/Kconfig.sysbuild b/samples/net/sockets/echo_server/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_server/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/http_get/Kconfig.sysbuild b/samples/net/sockets/http_get/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/http_get/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/sntp_client/Kconfig.sysbuild b/samples/net/sockets/sntp_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/sntp_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/syslog_net/Kconfig.sysbuild b/samples/net/syslog_net/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/syslog_net/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/telnet/Kconfig.sysbuild b/samples/net/telnet/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/telnet/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/Kconfig.sysbuild b/samples/net/wifi/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/wifi/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index 1121b4fa6cef..ce8ec12b1441 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -58,6 +58,7 @@ tests: - nrf7002dk/nrf5340/cpuapp/nrf7001 sample.net.wifi.nrf7002ek: extra_args: + - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002ek platform_allow: @@ -69,6 +70,7 @@ tests: sample.net.wifi.nrf7002eb: extra_args: - CONFIG_NRF70_UTIL=y + - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002eb platform_allow: From dc583bac9e76382f5171a3db86e856aa6fe72c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 14:05:41 +0200 Subject: [PATCH 1570/3334] [nrf noup] net: tests: Add legacy crypto API support for big_http_download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -We handle legacy Crypto API support specially (favoring PSA crypto) the tests here require MD interface to build, which needs the config MBEDTLS_LEGACY_CRYPTO_C to be enable to get access to Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Tomasz Moń (cherry picked from commit b3b8a6d583656f514d3c8906bf29f5b26eb66842) --- samples/net/sockets/big_http_download/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/net/sockets/big_http_download/prj.conf b/samples/net/sockets/big_http_download/prj.conf index c623d3b763bf..661ff62e9d92 100644 --- a/samples/net/sockets/big_http_download/prj.conf +++ b/samples/net/sockets/big_http_download/prj.conf @@ -3,6 +3,7 @@ CONFIG_REQUIRES_FULL_LIBC=y CONFIG_PSA_CRYPTO=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_PSA_WANT_ALG_SHA_256=y +CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y CONFIG_MAIN_STACK_SIZE=2536 # Networking config From d04c0070d2afe69dc8b69d2f1ea1b3cce07a8eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 14:31:02 +0200 Subject: [PATCH 1571/3334] [nrf noup] net: tests: crypto: Adding legacy Crypto support ipv6 tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This adds crypto support for ipv6 tests by enabling CONFIG_MBEDTLS_LEGACY_CRYPTO_C Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit d362d275f37ae7526714a3b715575a6870848acd) --- tests/net/ipv6/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index 9f9f21d59050..6a6be5dba36a 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -33,6 +33,7 @@ CONFIG_NET_IF_MAX_IPV6_COUNT=2 CONFIG_NET_IPV6_PE=y CONFIG_NET_IPV6_PE_FILTER_PREFIX_COUNT=2 CONFIG_NET_IPV6_PE_PREFER_PUBLIC_ADDRESSES=n +CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y # Increase the stack a bit for mps2/an385 CONFIG_NET_RX_STACK_SIZE=1700 From 3765002bf40d5499b4491d69f060457bddece076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayt=C3=BCrk=20D=C3=BCzen?= Date: Wed, 20 Nov 2024 13:06:23 +0100 Subject: [PATCH 1572/3334] [nrf noup] tests: bluetooth: tester: sysbuild configurable 53/54H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for sysbuild 54h20 building added nrf54h20 cpurad configuration to hci_ipc sample. Signed-off-by: Aytürk Düzen Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Tomasz Moń (cherry picked from commit 2527560672fbbee00d6fcb7a4f8e78069293368b) --- .../nrf54h20_cpurad-bt_ll_softdevice.conf | 33 +++++++++++++++++++ tests/bluetooth/tester/Kconfig.sysbuild | 1 + tests/bluetooth/tester/sysbuild.cmake | 16 +++++++-- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf diff --git a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf new file mode 100644 index 000000000000..1f7748e5cd7d --- /dev/null +++ b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf @@ -0,0 +1,33 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_ISR_STACK_SIZE=1024 +CONFIG_IDLE_STACK_SIZE=256 +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 +CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y + +CONFIG_BT_BUF_EVT_RX_COUNT=16 +CONFIG_BT_BUF_EVT_RX_SIZE=255 +CONFIG_BT_BUF_ACL_RX_SIZE=255 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_BUF_CMD_TX_SIZE=255 + +# Host +CONFIG_BT_BROADCASTER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_PER_ADV=y +CONFIG_BT_PER_ADV_SYNC=y + +# Controller +CONFIG_BT_LL_SW_SPLIT=n +CONFIG_BT_LL_SOFTDEVICE=y +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/tests/bluetooth/tester/Kconfig.sysbuild b/tests/bluetooth/tester/Kconfig.sysbuild index 69e4d5a97fbe..e14a6e1aa8e0 100644 --- a/tests/bluetooth/tester/Kconfig.sysbuild +++ b/tests/bluetooth/tester/Kconfig.sysbuild @@ -5,6 +5,7 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string + default "nrf54h20dk/nrf54h20/cpurad" if "$(BOARD)" = "nrf54h20dk" default "nrf5340dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340dk" default "nrf5340_audio_dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340_audio_dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP" diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index b0bb228ab997..b480fa4ee449 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) - # For builds in the nrf5340, we build the netcore image with the controller - set(NET_APP hci_ipc) set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP}) @@ -13,6 +11,20 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) BOARD ${SB_CONFIG_NET_CORE_BOARD} ) + if(SB_CONFIG_SOC_NRF5340_CPUAPP) + set(${NET_APP}_SNIPPET + "bt-ll-sw-split" + CACHE INTERNAL "" + ) + endif() + + if(SB_CONFIG_SOC_NRF54H20_CPUAPP) + set(${NET_APP}_CONF_FILE + ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf + CACHE INTERNAL "" + ) + endif() + set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" From 6a6f1e49672e1d80594843386f8052e95304ccc3 Mon Sep 17 00:00:00 2001 From: Ingar Kulbrandstad Date: Tue, 21 May 2024 13:59:58 +0200 Subject: [PATCH 1573/3334] [nrf noup] Bluetooth: Mesh: Disable processing of ext ADV packets Disable processing of extended ADV packets by mesh scanner. This is done to prevent loss of scan time due to reception of pointer packets while scanning for mesh packets. Signed-off-by: Ingar Kulbrandstad (cherry picked from commit cff0f47ccddabd30b041f88027047598ca39dea9) --- subsys/bluetooth/mesh/Kconfig | 11 +++++++++++ subsys/bluetooth/mesh/adv_ext.c | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 722bf0bedafb..903bd485b8a5 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -215,6 +215,17 @@ config BT_MESH_ADV_EXT_FRIEND_SEPARATE messages as close to the start of the ReceiveWindow as possible, thus reducing the scanning time on the Low Power node. +config BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS + bool "Reject or accept extended advertising packets" + depends on BT_LL_SOFTDEVICE + help + Configure the scanner and initiator to either reject or accept extended + advertising packets by the SoftDevice Controller. This is set to false + by default, to prevent loss of scan time when receiving a pointer packet + while scanning for Bluetooth Mesh packets. Set to true if extended + advertising packets are to be received by the SoftDevice Controller for + purposes other than Bluetooth Mesh. + endif # BT_MESH_ADV_EXT endchoice diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 68a6c27beebf..0cfaec39fdb7 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -529,6 +529,18 @@ void bt_mesh_adv_init(void) K_PRIO_COOP(MESH_WORKQ_PRIORITY), NULL); k_thread_name_set(&bt_mesh_workq.thread, "BT MESH WQ"); } + +#if defined(CONFIG_BT_LL_SOFTDEVICE) + const sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t cmd_params = { + .accept_ext_adv_packets = IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS), + }; + + int err = sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set(&cmd_params); + + if (err) { + LOG_ERR("Failed to set accept_ext_adv_packets: %d", err); + } +#endif } static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance) From 2cd9fbbf078302bc397552fa8891570611f4c04a Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Mon, 16 Jan 2023 14:15:22 +0100 Subject: [PATCH 1574/3334] [nrf noup] dts: choose a crypto accelerator for entropy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a long-term noup patch because crypto driver support is NCS-only for both cryptocell and CRACEN. Set HAS_HW_NRF_CC3XX to be defined in NS build when cryptocell is accessed through the PSA API. We need to know which CC3XX features are available. Set PSA as the entropy source for 54L. PSA is the only NCS-supported interface to CRACEN. Signed-off-by: Georgios Vasilakis Signed-off-by: Joakim Andersson Signed-off-by: Dominik Ermel Signed-off-by: Sebastian Bøe Signed-off-by: Robert Lubos Signed-off-by: Rubin Gerritsen (cherry picked from commit 6468c47d8ff7eb39c96b7893f33978db1b90991c) --- dts/arm/nordic/nrf52840.dtsi | 4 ++-- dts/arm/nordic/nrf5340_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf91.dtsi | 3 ++- soc/nordic/common/Kconfig.peripherals | 6 ++++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 78fa17809ec6..324f06d0fba9 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -12,7 +12,7 @@ / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -577,7 +577,7 @@ reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>; reg-names = "wrapper", "core"; interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 36a44029cfbd..cca54846a8a7 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -34,7 +34,7 @@ }; chosen { - zephyr,entropy = &rng_hci; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -107,7 +107,7 @@ reg = <0x50844000 0x1000>, <0x50845000 0x1000>; reg-names = "wrapper", "core"; interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 8bbd9bcc892d..b29562185846 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -21,7 +21,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -37,7 +37,7 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 3813c49f38ec..6baf06e3d4e4 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -28,6 +28,7 @@ }; chosen { + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -53,7 +54,7 @@ reg = <0x50840000 0x1000>, <0x50841000 0x1000>; reg-names = "wrapper", "core"; interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; ctrlap: ctrlap@50006000 { diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 049c3b18afa8..8706c650e0d1 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -13,10 +13,12 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) || \ + ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91X) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \ + ($(dt_nodelabel_enabled,psa_rng) && SOC_NRF5340_CPUAPP) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM)) From fbc20243ec195fce829e1355c3bbd9eb1da192d8 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 21 Jun 2024 13:25:22 +0200 Subject: [PATCH 1575/3334] [nrf noup] soc: nrf54l: Add custom section for KMU Add a custom section in the linker which should always be placed in the top of RAM. This will be used by the KMU to push keys into it. Since when you provision a key into the KMU you need to set specific a memory location for the PUSH operation we need to keep this memory location static across images/dfus. The linker script inclusion which places the KMU reserved buffer on the top of RAM doesn't work for non-XIP builds. The Zephyr linker script will firstly load the code for an non-XIP build in RAM and then include this KMU related linker script which results in an unpredictable placement of the KMU reserved area and a failed build. In order to support non-XIP builds the linker file is not included and the a DTS reserved-memory entry should be used. To limit the scope, the DTS reserved memory region is currently only supported for non-XIP builds. This is a noup since the KMU is not supported upstream. Ref: NCSDK-25121 Signed-off-by: Georgios Vasilakis Signed-off-by: Robin Kastberg (cherry picked from commit db894542538d1c8afe8a8f5416c2f2472a9a5f79) --- soc/nordic/nrf54l/CMakeLists.txt | 13 +++++++++++++ soc/nordic/nrf54l/kmu_push_area_section.ld | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 soc/nordic/nrf54l/kmu_push_area_section.ld diff --git a/soc/nordic/nrf54l/CMakeLists.txt b/soc/nordic/nrf54l/CMakeLists.txt index cebbda571b68..b220b9d2a7a2 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -6,3 +6,16 @@ zephyr_library_sources( ../validate_rram_partitions.c ) zephyr_include_directories(.) + +dt_nodelabel(kmu_push_area_node NODELABEL nrf_kmu_reserved_push_area) + +# We need a buffer in memory in a static location which can be used by +# the KMU peripheral. The KMU has a static destination address, we chose +# this address to be 0x20000000, which is the first address in the SRAM. +if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND NOT kmu_push_area_node) +# 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) + +zephyr_linker_section(NAME ".nrf_kmu_reserved_push_area" ADDRESS "${RAM_ADDR}" GROUP RAM_REGION NOINIT) +endif() diff --git a/soc/nordic/nrf54l/kmu_push_area_section.ld b/soc/nordic/nrf54l/kmu_push_area_section.ld new file mode 100644 index 000000000000..e8c8cd9f09ad --- /dev/null +++ b/soc/nordic/nrf54l/kmu_push_area_section.ld @@ -0,0 +1,19 @@ +# This section must be loaded first of all the +# custom sections because we want it to be placed +# at the top address of RAM. +SECTION_PROLOGUE(NRF_KMU_RESERVED_PUSH_SECTION,(NOLOAD) ,) +{ + __nrf_kmu_reserved_push_area = .; + *(.nrf_kmu_reserved_push_area) + __nrf_kmu_reserved_push_area_end = .; +} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) + +# It doesn't seem to be possible to enforce placing a section +# at a specific address in memory using the Zephyr SECTION macros. +# So this assert is necessary to avoid accidentatly moving this +# section to a different address. +ASSERT(__nrf_kmu_reserved_push_area == RAM_ADDR, "Error: \ + The section NRF_KMU_RESERVED_PUSH_SECTION needs to be \ + placed on the top RAM address but it is not, please edit \ + your linker scripts to make sure that it is placed on \ + the to RAM address.") From 20d3749d7abf116dbe240f28a310971f37b30f23 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 12 Dec 2024 07:58:06 +0000 Subject: [PATCH 1576/3334] [nrf noup] samples/tests: Add TF-M sysbuild config files Fixes some issues with samples/tests by adding configuration files to satisfy TF-M requirements Signed-off-by: Jamie McCrae (cherry picked from commit e404d8bae28549eb35fc207141e3037219213194) --- samples/subsys/usb/dfu/sysbuild.conf | 1 + tests/drivers/flash/common/sysbuild.conf | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 samples/subsys/usb/dfu/sysbuild.conf delete mode 100644 tests/drivers/flash/common/sysbuild.conf diff --git a/samples/subsys/usb/dfu/sysbuild.conf b/samples/subsys/usb/dfu/sysbuild.conf new file mode 100644 index 000000000000..47f00ff3cff8 --- /dev/null +++ b/samples/subsys/usb/dfu/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/drivers/flash/common/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n From b1e5e0e36555f53543a7136e7a441e9697592d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 10:48:30 +0100 Subject: [PATCH 1577/3334] [nrf noup] Revert "mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ac6d8342728c8a63f9fea965ce41610618aeed5a. Temporarily revert an upstream change that leads to a Kconfig dependency loop with MBEDTLS_CIPHER_AES_ENABLED. This is supposed to be replaced with a better fix later. Signed-off-by: Andrzej Głąbek (cherry picked from commit 83ee44f5f9f464c472c150e59c889499744ff3aa) --- modules/mbedtls/Kconfig.mbedtls | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 03833b20063d..9790b60b372e 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -286,7 +286,6 @@ config MBEDTLS_SOME_CIPHER_ENABLED config MBEDTLS_CIPHER_AES_ENABLED bool "AES block cipher" - default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C if MBEDTLS_CIPHER_AES_ENABLED From a87ca4c92469a6ef8118c29785e8f5ac36111b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grochala?= Date: Fri, 31 Jan 2025 16:09:26 +0000 Subject: [PATCH 1578/3334] [nrf noup] bluetooth: Temporary Kconfig fix for BT RPC configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The BT_DRIVERS symbol default value 'y' used to depend on !BT_CTLR but now it is always on when BT is set. For BT_RPC the BT_DRIVERS symbol must not be enabled on the client side as no driver is used. The temporary solution is to set BT_DRIVERS to 'y' by default only when BT_HCI stack selection is enabled. It will be 'n' when BT_RPC_STACK is enabled. The fix should be fine as NCS uses either HCI or RPC stack. Signed-off-by: Michał Grochala (cherry picked from commit 97662003001131768dffc7ec052ade4142ebbb90) --- drivers/bluetooth/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index a1680af6583d..e64a33f663ce 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -12,7 +12,7 @@ menuconfig BT_DRIVERS bool "Bluetooth drivers" default y - depends on BT + depends on BT && BT_HCI if BT_DRIVERS From e7b3779b58584ab4c9badbafda32b2c21d6fc50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Tue, 4 Feb 2025 14:55:58 +0100 Subject: [PATCH 1579/3334] [nrf noup] ble: Adding missing AES config for BT_CRYPTO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Adding imply MBEDTLS_CIPHER_AES_ENABLED if not TF-M build in BT_CRYPTO -Needed to set a specific symbol for MBEDTLS + MBEDTLS_BUILTIN to work on network core build. -This [nrf noup] can be removed once PSA crypto is fully supported in network core, or PSA crypto is not compiled in at all and is provided as a RPC-mechanism via the app-core Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit a21f2c7449457ad53ef9ed60f3a4783efe9cfca9) --- subsys/bluetooth/crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/crypto/Kconfig b/subsys/bluetooth/crypto/Kconfig index e9234e4157b3..0e382060278a 100644 --- a/subsys/bluetooth/crypto/Kconfig +++ b/subsys/bluetooth/crypto/Kconfig @@ -7,6 +7,7 @@ config BT_CRYPTO select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_CMAC select PSA_WANT_ALG_ECB_NO_PADDING + imply MBEDTLS_CIPHER_AES_ENABLED if !BUILD_WITH_TFM imply MBEDTLS_AES_ROM_TABLES if MBEDTLS_PSA_CRYPTO_C help This option enables the Bluetooth Cryptographic Toolbox. From 5566637e963e25bdba81508558f780d4f9e1470d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 22 Oct 2024 08:55:47 +0200 Subject: [PATCH 1580/3334] [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added ncs-specific modules to nrfx_config_reserved_resources. The modules are: - mpsl - nrfe Signed-off-by: Rafał Kuźnia Signed-off-by: Nikodem Kastelik Co-authored-by: Krzysztof Chruściński Signed-off-by: Eivind Jølsgard Signed-off-by: Aleksandar Stanoev Signed-off-by: Piotr Pryga (cherry picked from commit fe3a3d0941063e3b4207b3593f5165ce12449474) --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ++++++++++++++++++ 2 files changed, 949 insertions(+), 1 deletion(-) create mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 3c410d8af208..98dacdcfede4 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -386,6 +386,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_reserved_resources.h" + default "nrfx_config_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h new file mode 100644 index 000000000000..ec8a9acaf7b5 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h @@ -0,0 +1,948 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ +#define NRFX_CONFIG_RESERVED_RESOURCES_H__ + +/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE130_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) + +/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE131_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) + +/** @brief Bitmask that defines EGU instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_EGUS_USED 0 + +/** @brief Bitmask that defines TIMER instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_TIMERS_USED 0 + +/* If the GRTC system timer driver is to be used, prepare definitions required + * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and + * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. + */ +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) +#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ + (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ + ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) +#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ + (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ + DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ + +/* + * The enabled Bluetooth controller subsystem is responsible for providing + * definitions of the BT_CTLR_USED_* symbols used below in a file named + * bt_ctlr_used_resources.h and for adding its location to global include + * paths so that the file can be included here for all Zephyr libraries that + * are to be built. + */ +#if defined(CONFIG_BT_LL_SW_SPLIT) +#include +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#endif +#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +/* Define auxiliary symbols needed for SDC device dispatch. */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRF52_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRF53_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRF54L_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF71X) +#define NRF71_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRF54H_SERIES +#endif +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_NRF_802154_RADIO_DRIVER) +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#include <../src/nrf_802154_peripherals_nrf52.h> +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#include <../src/nrf_802154_peripherals_nrf53.h> +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#include <../src/nrf_802154_peripherals_nrf54l.h> +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#include <../src/nrf_802154_peripherals_nrf54h.h> +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL +#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL +#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL +#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL +#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL +#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL +#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL +#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL +#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL +#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL +#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL +#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL +#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL +#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL +#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL +#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL +#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL +#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 +#endif + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_CHANNELS_USED \ + (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI0_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_GROUPS_USED \ + (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI0_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_CHANNELS_USED \ + (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI00_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_GROUPS_USED \ + (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI00_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_CHANNELS_USED \ + (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI10_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_GROUPS_USED \ + (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI10_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_CHANNELS_USED \ + (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI20_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_GROUPS_USED \ + (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI20_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_CHANNELS_USED \ + (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI30_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_GROUPS_USED \ + (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI30_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_CHANNELS_USED \ + (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI020_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_GROUPS_USED \ + (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI020_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_CHANNELS_USED \ + (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI030_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_GROUPS_USED \ + (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI030_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_CHANNELS_USED \ + (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI120_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_GROUPS_USED \ + (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI120_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_CHANNELS_USED \ + (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI130_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_GROUPS_USED \ + (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI130_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_CHANNELS_USED \ + (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI131_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_GROUPS_USED \ + (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI131_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_CHANNELS_USED \ + (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI132_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_GROUPS_USED \ + (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI132_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_CHANNELS_USED \ + (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI133_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_GROUPS_USED \ + (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI133_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_CHANNELS_USED \ + (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI134_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_GROUPS_USED \ + (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI134_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_CHANNELS_USED \ + (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI135_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_GROUPS_USED \ + (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI135_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_CHANNELS_USED \ + (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI136_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_GROUPS_USED \ + (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI136_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines PPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_CHANNELS_USED \ + (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) + +#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED +#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED + +/** @brief Bitmask that defines PPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_GROUPS_USED \ + (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ + NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) + +#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ + (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ + (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ + (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ + (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ + (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ + (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ + (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ + NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) + +#if defined(CONFIG_SOFTDEVICE) +#include +#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED +#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED +#else +#define NRFX_PPI_CHANNELS_USED_BY_SD 0 +#define NRFX_PPI_GROUPS_USED_BY_SD 0 +#endif + +#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ From 35fcd6ef1e872b5b5549049e9a702904abcd9377 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 25 Feb 2025 10:35:24 +0100 Subject: [PATCH 1581/3334] [nrf noup] samples: bluetooth: mesh: Disable secure storage for real targets. Mesh currently works with trusted storage on real targets. Until secure storage is supported by default disable it. Signed-off-by: Aleksandr Khromykh (cherry picked from commit c503c44c0604383f0b486cde3d92e128a343ee50) --- samples/bluetooth/mesh/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh/prj.conf | 2 +- samples/bluetooth/mesh_demo/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh_demo/prj.conf | 2 +- samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh_provisioner/prj.conf | 2 +- samples/boards/nordic/mesh/onoff-app/prj.conf | 2 +- .../nordic/mesh/onoff_level_lighting_vnd_app/prj.conf | 2 +- tests/bluetooth/mesh_shell/boards/qemu_x86.conf | 6 ++++++ tests/bluetooth/mesh_shell/prj.conf | 2 +- 10 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 samples/bluetooth/mesh/boards/qemu_x86.conf create mode 100644 samples/bluetooth/mesh_demo/boards/qemu_x86.conf create mode 100644 samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf create mode 100644 tests/bluetooth/mesh_shell/boards/qemu_x86.conf diff --git a/samples/bluetooth/mesh/boards/qemu_x86.conf b/samples/bluetooth/mesh/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh/prj.conf b/samples/bluetooth/mesh/prj.conf index 14b19316a866..cd7d6532b614 100644 --- a/samples/bluetooth/mesh/prj.conf +++ b/samples/bluetooth/mesh/prj.conf @@ -5,7 +5,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_HWINFO=y CONFIG_BT=y diff --git a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_demo/prj.conf b/samples/bluetooth/mesh_demo/prj.conf index bcb738ae5bd1..b7016b02c65b 100644 --- a/samples/bluetooth/mesh_demo/prj.conf +++ b/samples/bluetooth/mesh_demo/prj.conf @@ -31,7 +31,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y # Limit the number of key slots in PSA Crypto core to reduce # RAM footprint diff --git a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 0fb814adcd4c..3eb40c7112ce 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -46,7 +46,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y #CONFIG_BT_MESH_LOG_LEVEL_DBG=y #CONFIG_BT_MESH_SETTINGS_LOG_LEVEL_DBG=y diff --git a/samples/boards/nordic/mesh/onoff-app/prj.conf b/samples/boards/nordic/mesh/onoff-app/prj.conf index 0e67042b2653..0783579e795e 100644 --- a/samples/boards/nordic/mesh/onoff-app/prj.conf +++ b/samples/boards/nordic/mesh/onoff-app/prj.conf @@ -9,7 +9,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf index 3bb984208c70..96b5466b4a16 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf @@ -7,7 +7,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT_OBSERVER=y CONFIG_BT_BROADCASTER=y diff --git a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index 2af600295680..aab2745d359f 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT=y CONFIG_BT_OBSERVER=y From 4797b5f214fcd753d3f955c6df083dd67ceb4ec7 Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Fri, 28 Feb 2025 12:27:22 +0100 Subject: [PATCH 1582/3334] [nrf noup] samples: bluetooth: hci_ipc: increase main stack size for Cracen driver on nRF54H20 A larger stack is needed to accomodate the Cracen driver. Signed-off-by: Gordon Klaus (cherry picked from commit 87b955d64661b0e5a3b8637a6c87bc91f6329bb7) --- .../bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..296e68366389 --- /dev/null +++ b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,2 @@ +# Increase stack size for Cracen driver. +CONFIG_MAIN_STACK_SIZE=1024 From 5878b1b0004b5b86e4b3c54bef9b0071cdca4554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Tue, 17 Dec 2024 21:45:47 +0100 Subject: [PATCH 1583/3334] [nrf noup] drivers: spi_dw: Bring back custom EXMIF peripheral handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit brings back modifications from these reverted commits: - f68b2edaa2233cde29d955bc3d3b3dd75ff50334 - e606246f0fc3e9299cb5bdd3c1e34a091e5d85a1 slightly adjusted so that the EXMIF peripheral is still by default handled by the mspi_dw driver, and in cases where this driver cannot be used because something still does not work correctly, one can switch to the old solution based on the tweaked spi_dw driver. Signed-off-by: Andrzej Głąbek (cherry picked from commit dd107c19620f0a70d83848bc3928d2eb8b9e6f50) --- drivers/pinctrl/pinctrl_nrf.c | 3 +- drivers/spi/spi_dw.c | 32 +++++++++++++++++++++- dts/bindings/spi/nordic,nrf-exmif-spi.yaml | 8 ++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 dts/bindings/spi/nordic,nrf-exmif-spi.yaml diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index a9902d33f801..b052e61eb803 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -468,7 +468,8 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) || \ + DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif_spi) /* Pin routing is controlled by secure domain, via UICR */ case NRF_FUN_EXMIF_CK: case NRF_FUN_EXMIF_DQ0: diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index 9f00905a3f02..ac703af10f91 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -41,6 +41,14 @@ LOG_MODULE_REGISTER(spi_dw); #include #endif +#ifdef CONFIG_HAS_NRFX +#include +#endif + +#ifdef CONFIG_SOC_NRF54H20_GPD +#include +#endif + static inline bool spi_dw_is_slave(struct spi_dw_data *spi) { return (IS_ENABLED(CONFIG_SPI_SLAVE) && @@ -258,6 +266,7 @@ static int spi_dw_configure(const struct device *dev, /* Baud rate and Slave select, for master only */ write_baudr(dev, SPI_DW_CLK_DIVIDER(info->clock_frequency, config->frequency)); + write_ser(dev, BIT(config->slave)); } if (spi_dw_is_slave(spi)) { @@ -512,6 +521,10 @@ void spi_dw_isr(const struct device *dev) uint32_t int_status; int error; +#ifdef CONFIG_HAS_NRFX + NRF_EXMIF->EVENTS_CORE = 0; +#endif + int_status = read_isr(dev); LOG_DBG("SPI %p int_status 0x%x - (tx: %d, rx: %d)", dev, int_status, @@ -560,6 +573,18 @@ int spi_dw_init(const struct device *dev) DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); +#ifdef CONFIG_HAS_NRFX + NRF_EXMIF->INTENSET = BIT(0); + NRF_EXMIF->TASKS_START = 1; + +#ifdef CONFIG_SOC_NRF54H20_GPD + err = nrf_gpd_request(NRF_GPD_FAST_ACTIVE1); + if (err < 0) { + return err; + } +#endif +#endif + info->config_func(); /* Masking interrupt and making sure controller is disabled */ @@ -586,6 +611,11 @@ int spi_dw_init(const struct device *dev) return 0; } +#define REG_ADDR(inst) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), nordic_nrf_exmif_spi), \ + (Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(core, DT_DRV_INST(inst))), \ + (DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)))) + #define SPI_CFG_IRQS_SINGLE_ERR_LINE(inst) \ IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, rx_avail, irq), \ DT_INST_IRQ_BY_NAME(inst, rx_avail, priority), \ @@ -658,7 +688,7 @@ COND_CODE_1(IS_EQ(DT_NUM_IRQS(DT_DRV_INST(inst)), 1), \ SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ }; \ static const struct spi_dw_config spi_dw_config_##inst = { \ - DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ + REG_ADDR(inst), \ .clock_frequency = COND_CODE_1( \ DT_NODE_HAS_PROP(DT_INST_PHANDLE(inst, clocks), clock_frequency), \ (DT_INST_PROP_BY_PHANDLE(inst, clocks, clock_frequency)), \ diff --git a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml new file mode 100644 index 000000000000..d988b4146878 --- /dev/null +++ b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic External Memory Interface (EXMIF) used in SPI mode only + +compatible: "nordic,nrf-exmif-spi" + +include: snps,designware-spi.yaml From f23942a502af928620fe745e9d0ae23b68e1e9c8 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 20 Nov 2020 14:44:03 +0100 Subject: [PATCH 1584/3334] [nrf noup] Bluetooth: update experimental for qualification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Kconfig options for qualification: - Remove experimental on qualified feature. - Add experimental on unqualified feature. - BT_L2CAP_ECRED is not marked as experimental upstream and we qualify it downstream. Signed-off-by: Joakim Andersson Signed-off-by: Trond Einar Snekvik Signed-off-by: Martí Bolívar Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Ingar Kulbrandstad Signed-off-by: Torsten Rasmussen Signed-off-by: Herman Berget Signed-off-by: Tomasz Moń Signed-off-by: Théo Battrel (cherry picked from commit 61fb90cffe6b7f097c4250adcc35ec2411d6514d) --- subsys/bluetooth/controller/Kconfig | 4 +++- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 0d5cba824162..abffc5faa164 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -141,10 +141,12 @@ config HAS_BT_CTLR bool config BT_LL_SW_SPLIT - bool "Software-based Bluetooth LE Link Layer" + bool "Software-based Bluetooth LE Link Layer [EXPERIMENTAL]" default y depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED select HAS_BT_CTLR + select EXPERIMENTAL + select ENTROPY_GENERATOR help Use Zephyr software Bluetooth LE Link Layer ULL LLL split implementation. diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index 2841e7d8a129..34e862378c5e 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -52,7 +52,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support" + bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From 60e3e915b4e664e0724ae4a83f10f8c73de0d268 Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Tue, 8 Apr 2025 17:56:00 +0200 Subject: [PATCH 1585/3334] [nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PSA is a cryptographically secure random number generator. It will be enabled by default, eventually, For now, enable it manually. Signed-off-by: Gordon Klaus Signed-off-by: Tomasz Moń (cherry picked from commit 941e975e39b65ae6eb9c0eca9354b73d18a16a3d) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 ++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 +++++++ tests/bluetooth/tester/sysbuild.cmake | 7 ---- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 40 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 13 ++++++ .../tester/sysbuild/hci_ipc/prj.conf | 23 +++++++++++ 6 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 5bb1c4d82846..51b0ef5fa8d4 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -22,3 +22,10 @@ CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_BTTESTER_LOG_LEVEL_DBG=y CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable PSA RNG +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index e6d4f675f57a..4f9de686b7e5 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,3 +12,17 @@ status = "okay"; hw-flow-control; }; + +// Enable PSA RNG +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; + + /delete-node/ prng; +}; diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index b480fa4ee449..b4c05e1ee4aa 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -18,13 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) ) endif() - if(SB_CONFIG_SOC_NRF54H20_CPUAPP) - set(${NET_APP}_CONF_FILE - ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf - CACHE INTERNAL "" - ) - endif() - set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..b7d64a9e6a08 --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,40 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_ISR_STACK_SIZE=1024 +CONFIG_IDLE_STACK_SIZE=256 +CONFIG_MAIN_STACK_SIZE=1024 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 +CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y + +CONFIG_BT_BUF_EVT_RX_COUNT=16 +CONFIG_BT_BUF_EVT_RX_SIZE=255 +CONFIG_BT_BUF_ACL_RX_SIZE=255 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_BUF_CMD_TX_SIZE=255 + +# Host +CONFIG_BT_BROADCASTER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_PER_ADV=y +CONFIG_BT_PER_ADV_SYNC=y + +# Controller +CONFIG_BT_LL_SW_SPLIT=n +CONFIG_BT_LL_SOFTDEVICE=y +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 + +# Enable PSA RNG +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..e34567fe834a --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,13 @@ +// Enable PSA RNG +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; + + /delete-node/ prng; +}; diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf new file mode 100644 index 000000000000..08b1aed9e7f6 --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf @@ -0,0 +1,23 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_HEAP_MEM_POOL_SIZE=4096 + +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y +CONFIG_BT_MAX_CONN=16 + + +# Workaround: Unable to allocate command buffer when using K_NO_WAIT since +# Host number of completed commands does not follow normal flow control. +CONFIG_BT_BUF_CMD_TX_COUNT=10 + +# Enable and adjust the below value as necessary +# CONFIG_BT_BUF_EVT_RX_COUNT=16 +# CONFIG_BT_BUF_EVT_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_TX_SIZE=251 +# CONFIG_BT_BUF_CMD_TX_SIZE=255 From 7de0c8423dee010ff70a411f5788bd9a9149b4d7 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 30 Nov 2018 14:07:56 +0100 Subject: [PATCH 1586/3334] [nrf noup] ci: NCS-specific CI tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Necessary changes for NCS CI. - Add a Jenkinsfile - Add a commit-tags workflow: This enables sauce tag checking in sdk-zephyr - compliance.yml: Disable check for merge commits, since we have upmerges downstream. Also, since in the code we refer to Kconfig symbols that are defined in the sdk-nrf repository, the Kconfig checks ((SysBuild)Kconfig, (SysBuild)KconfigBasic and (SysBuild)KconfigBasicNoModules) will not pass so exclude them. Also, disable any maintainers-related checks - scripts/gitlint: Extend the max commit line lengths for Gitlint to account for sauce tags - Adapt to the changes in: https://github.com/nrfconnect/action-commit-tags/pull/4 Signed-off-by: Carles Cufi Signed-off-by: Dominik Ermel Signed-off-by: Martí Bolívar Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Krishna T Signed-off-by: Dominik Ermel (cherry picked from commit b40cd57e43af44bba3585aced15cda9370a1a660) --- .github/workflows/commit-tags.yml | 28 ++++++++++++++++++++++++++ .github/workflows/compliance.yml | 13 +++++------- Jenkinsfile | 5 +++++ scripts/gitlint/zephyr_commit_rules.py | 4 ++-- 4 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/commit-tags.yml create mode 100644 Jenkinsfile diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml new file mode 100644 index 000000000000..828f02971678 --- /dev/null +++ b/.github/workflows/commit-tags.yml @@ -0,0 +1,28 @@ +name: Commit tags + +on: + pull_request: + types: [synchronize, opened, reopened, edited, labeled, unlabeled, + milestoned, demilestoned, assigned, unassigned, ready_for_review, + review_requested] + +jobs: + commit_tags: + runs-on: ubuntu-22.04 + name: Run commit tags checks on patch series (PR) + steps: + - name: Update PATH for west + run: | + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Checkout the code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Run the commit tags + uses: nrfconnect/action-commit-tags@main + with: + target: . + upstream: zephyrproject-rtos/zephyr/main diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 26e41485ef67..31b87304960f 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -34,8 +34,8 @@ jobs: git config --global user.name "Your Name" git remote -v # Ensure there's no merge commits in the PR - [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ - (echo "::error ::Merge commits not allowed, rebase instead";false) + #[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ + #(echo "::error ::Merge commits not allowed, rebase instead";false) rm -fr ".git/rebase-apply" rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} @@ -83,12 +83,9 @@ jobs: git log --pretty=oneline | head -n 10 # Increase rename limit to allow for large PRs git config diff.renameLimit 10000 - excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat" - # The signed-off-by check for dependabot should be skipped - if [ "${{ github.actor }}" == "dependabot[bot]" ]; then - excludes="$excludes -e Identity" - fi - ./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}.. + ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic \ + -e Kconfig -e SysbuildKconfig -e KconfigBasicNoModules -e SysbuildKconfigBasicNoModules \ + -e ModulesMaintainers -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000000..3b9cf0022399 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,5 @@ +@Library("CI_LIB") _ + +def pipeline = new ncs.sdk_zephyr.Main() + +pipeline.run(JOB_NAME) diff --git a/scripts/gitlint/zephyr_commit_rules.py b/scripts/gitlint/zephyr_commit_rules.py index a2c9cd3cb7fe..ef317e22684c 100644 --- a/scripts/gitlint/zephyr_commit_rules.py +++ b/scripts/gitlint/zephyr_commit_rules.py @@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule): name = "title-max-length-no-revert" id = "UC5" target = CommitMessageTitle - options_spec = [IntOption('line-length', 75, "Max line length")] + options_spec = [IntOption('line-length', 120, "Max line length")] violation_message = "Commit title exceeds max length ({0}>{1})" def validate(self, line, _commit): @@ -103,7 +103,7 @@ class MaxLineLengthExceptions(LineRule): name = "max-line-length-with-exceptions" id = "UC4" target = CommitMessageBody - options_spec = [IntOption('line-length', 75, "Max line length")] + options_spec = [IntOption('line-length', 120, "Max line length")] violation_message = "Commit message body line exceeds max length ({0}>{1})" def validate(self, line, _commit): From 666ffc1eb2120511c224e3cbceb349572d74adb1 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 12 May 2025 08:47:55 +0100 Subject: [PATCH 1587/3334] [nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs Adds symbols used in NCS to the sysbuild Kconfig allow list Signed-off-by: Jamie McCrae (cherry picked from commit 1b4e0ff6ab4bbf17cd8af3d22a662ab959e9b7dd) --- scripts/ci/check_compliance.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 1db5b2e9cfc8..508915ce0ede 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1741,6 +1741,32 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop + + # NCS-specific allowlist + # zephyr-keep-sorted-start re(^\s+") + "APP_CPUNET_RUN", # Used by sample + "APP_DFU", # Used by sample + "BT_FAST_PAIR", # Legacy/removed, used in migration documentation + "COMP_DATA_LAYOUT_ARRAY", # Used by test + "COMP_DATA_LAYOUT_MULTIPLE", # Used by test + "COMP_DATA_LAYOUT_SINGLE", # Used by test + "DTM_NO_DFE", # Used by DTM application + "DTM_TRANSPORT_HCI", # Used by DTM application + "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation + "INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation + "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "ML_APP_REMOTE_BOARD", # Used by machine learning application + "MY_APP_IMAGE_ABC", # Used in documentation + "NETCORE_ABC", # Used in documentation + "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests + "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation + "SUIT_ENVELOPE_", # Used by jinja + "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation + "SUIT_MPI_", # Used by jinja + "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation + "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample + # zephyr-keep-sorted-stop } From f2b86e03f7a4c9d7d2a0d066f2fa719300e70dcf Mon Sep 17 00:00:00 2001 From: Robert Stypa Date: Wed, 18 Jun 2025 07:45:47 +0200 Subject: [PATCH 1588/3334] [nrf noup] ci: Update CI-boot-test patterns and remove SUIT labels Add boards/nordic/**/* to the CI-boot-test scope and remove SUIT labels. Signed-off-by: Robert Stypa (cherry picked from commit 00f3f51c8ca6c1d8a51fd6f20f90c949071020c5) --- .github/test-spec.yml | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 6da6bdbaa87d..5337249f7dab 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,6 +39,7 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": + - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" @@ -364,29 +365,3 @@ - "tests/boards/nordic/**/*" - "tests/drivers/**/*" - "tests/kernel/**/*" - -"CI-suit-dfu-test": - - "subsys/mgmt/mcumgr/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "subsys/bluetooth/**/*" - - "drivers/bluetooth/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/console/**/*" - - "drivers/gpio/**/*" - - "dts/common/nordic/*" - - "dts/arm/nordic/nrf54h*/**/*" - - "dts/riscv/nordic/nrf54h*/**/*" - - "boards/nordic/nrf54h*/**/*" - - "soc/nordic/nrf54h/**/*" - - "include/zephyr/**/*" - - "subsys/logging/**/*" - - "subsys/tracing/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/nrfutil.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" From 3b01d333a7e135b5dfda4f8c48a050e68543d627 Mon Sep 17 00:00:00 2001 From: Richa Pandey Date: Thu, 19 Jun 2025 11:07:37 +0200 Subject: [PATCH 1589/3334] [nrf noup] zephyr: doc: fix board page Fixed board page in zephyr. Signed-off-by: Richa Pandey (cherry picked from commit 1bf617dae64055105957d594f872d9f56f975cc0) --- boards/index.rst | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/boards/index.rst b/boards/index.rst index 3cc92770cfeb..2ffe426fc24b 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -12,33 +12,8 @@ template available under :zephyr_file:`doc/templates/board.tmpl`. Shields are hardware add-ons that can be stacked on top of a board to add extra functionality. Refer to the :ref:`shield_porting_guide` for more information on how to port a shield. -.. admonition:: Search Tips - :class: dropdown - - * Use the form below to filter the list of supported boards and shields. If a field is left - empty, it will not be used in the filtering process. - - * Filtering by name and vendor is available for both boards and shields. The rest of the fields - apply only to boards. - - * A board/shield must meet **all** criteria selected across different fields. For example, if you - select both a vendor and an architecture, only boards that match both will be displayed. Within - a single field, selecting multiple options (such as two architectures) will show boards - matching **either** option. - - * The list of supported hardware features for each board is automatically generated using - information from the Devicetree. It may not be reflecting the full list of supported features - since some of them may not be enabled by default. - - * Can't find your exact board? Don't worry! If a similar board with the same or a closely related - MCU exists, you can use it as a :ref:`starting point ` for adding - support for your own board. - .. toctree:: :maxdepth: 2 :glob: - :hidden: */index - -.. zephyr:board-catalog:: From bc0141cf74fe34a34dc5bde3e533bb3b4131669b Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 12 Jun 2025 13:09:23 +0200 Subject: [PATCH 1590/3334] [nrf noup] boards: nrf54h20dk: Enable default images for sysbuild Enable the `empty_app_core` image when building for `cpurad`. Signed-off-by: Grzegorz Swiderski (cherry picked from commit a16995681bbde172a64087d300229a4df6259bf6) --- boards/nordic/nrf54h20dk/Kconfig.sysbuild | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 boards/nordic/nrf54h20dk/Kconfig.sysbuild diff --git a/boards/nordic/nrf54h20dk/Kconfig.sysbuild b/boards/nordic/nrf54h20dk/Kconfig.sysbuild new file mode 100644 index 000000000000..29bd62b49927 --- /dev/null +++ b/boards/nordic/nrf54h20dk/Kconfig.sysbuild @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_NRF54H20DK_NRF54H20_CPURAD + +config NRF_DEFAULT_EMPTY + default y + +endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From 0128a91146232d6337b6c9cbe16b3039dc629139 Mon Sep 17 00:00:00 2001 From: Aleksandar Stanoev Date: Thu, 3 Jul 2025 15:37:01 +0100 Subject: [PATCH 1591/3334] [nrf noup] boards: xiao_ble: Add static partition manager configuration The xiao_ble boards ship with a bootloader requiring an app offset of 0x27000. The upstream board defines this via DT partitions, which will not be used if partition manager is enabled. Add a static partition configuration to allow binaries built for this board to work out-of-the-box in NCS, and match the behavior with sysbuild disabled. Signed-off-by: Aleksandar Stanoev (cherry picked from commit 96c7186a4f653b250f461d162b01bcb3b615e534) --- boards/seeed/xiao_ble/pm_static.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 boards/seeed/xiao_ble/pm_static.yml diff --git a/boards/seeed/xiao_ble/pm_static.yml b/boards/seeed/xiao_ble/pm_static.yml new file mode 100644 index 000000000000..02915293177c --- /dev/null +++ b/boards/seeed/xiao_ble/pm_static.yml @@ -0,0 +1,18 @@ +# Mirror of partitions defined in nrf52840_partition_uf2_sdv7.dtsi +# Default flash layout for nrf52840 using UF2 and SoftDevice s140 v7 + +softdevice_reserved: + address: 0x00 + size: 0x27000 + +app: + address: 0x27000 + size: 0xC5000 + +settings_storage: + address: 0xEC000 + size: 0x8000 + +uf2_partition: + address: 0xF4000 + size: 0xC000 From 23af03a7bc8c90df329a7aa907c7f4c96311a3ab Mon Sep 17 00:00:00 2001 From: Krzysztof Szromek Date: Fri, 18 Jul 2025 08:05:27 +0200 Subject: [PATCH 1592/3334] [nrf noup] ci: update test_spec label for E2E DFU tests Ref: NCSDK-34052 Signed-off-by: Krzysztof Szromek (cherry picked from commit 0c8ea11856bfe33fb443b2a18c2e156c7d93b288) --- .github/test-spec.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5337249f7dab..76def875e0be 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -49,6 +49,33 @@ - "tests/subsys/dfu/**/*" - "tests/subsys/mgmt/mcumgr/**/*" +"CI-dfu-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/**/*" + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/spi/**/*" + - "dts/arm/nordic/nrf54h*" + - "dts/common/nordic/*" + - "dts/riscv/nordic/nrf54h*" + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/zephyr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" + - "scripts/west_commands/runners/nrfutil.py" + - "soc/nordic/nrf54h/**/*" + - "subsys/bluetooth/**/*" + - "subsys/dfu/**/*" + - "subsys/logging/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "subsys/tracing/**/*" + "CI-tfm-test": - "boards/nordic/nrf5340dk/**/*" - "boards/nordic/nrf9160dk/**/*" From 3f93b67ecb00dc744fa3cc7fe048640ad0470f05 Mon Sep 17 00:00:00 2001 From: Juha Ylinen Date: Fri, 19 Jan 2024 15:26:33 +0200 Subject: [PATCH 1593/3334] [nrf noup] samples: lwm2m_client: Add support for nRF91x Add support for nRF91x by providing overlay configuration file. Signed-off-by: Juha Ylinen Signed-off-by: Robert Lubos (cherry picked from commit 901f81ef30e11f809740f5e90840eaadcd1a1f60) --- samples/net/lwm2m_client/overlay-nrf91x.conf | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 samples/net/lwm2m_client/overlay-nrf91x.conf diff --git a/samples/net/lwm2m_client/overlay-nrf91x.conf b/samples/net/lwm2m_client/overlay-nrf91x.conf new file mode 100644 index 000000000000..7b902178e078 --- /dev/null +++ b/samples/net/lwm2m_client/overlay-nrf91x.conf @@ -0,0 +1,53 @@ +# Configuration file for nRF91x +# This file is merged with prj.conf in the application folder, and options +# set here will take precedence if they are present in both files. + +# General +CONFIG_MAIN_STACK_SIZE=4096 + +CONFIG_NET_SOCKETS=y +CONFIG_NET_NATIVE=y +CONFIG_NET_SOCKETS_OFFLOAD=y + +CONFIG_NET_CONFIG_MY_IPV6_ADDR="" +CONFIG_NET_CONFIG_PEER_IPV6_ADDR="" +CONFIG_NET_CONFIG_MY_IPV4_ADDR="" +CONFIG_NET_CONFIG_MY_IPV4_GW="" + +CONFIG_NET_CONFIG_NEED_IPV6=n +CONFIG_NET_CONFIG_NEED_IPV4=n +CONFIG_NET_CONFIG_AUTO_INIT=n + +# Modem related configurations +CONFIG_NRF_MODEM_LIB_NET_IF=y +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_DOWN=n +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=n +CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y + +CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=n +CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=n + +# Disable Duplicate Address Detection (DAD) +# due to not being properly implemented for offloaded interfaces. +CONFIG_NET_IPV6_NBR_CACHE=n +CONFIG_NET_IPV6_MLD=n + +# Zephyr NET Connection Manager and Connectivity layer. +CONFIG_NET_CONNECTION_MANAGER=y +CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024 + +CONFIG_NET_SAMPLE_LWM2M_ID="nrf91x" +CONFIG_NET_SAMPLE_LWM2M_SERVER="coaps://leshan.eclipseprojects.io:5684" +CONFIG_LWM2M_DNS_SUPPORT=y + +## Enable DTLS support +CONFIG_LWM2M_DTLS_SUPPORT=y +CONFIG_LWM2M_TLS_SESSION_CACHING=y +CONFIG_LWM2M_DTLS_CID=y +CONFIG_TLS_CREDENTIALS=y + +## Crypto +CONFIG_OBERON_BACKEND=y +CONFIG_NORDIC_SECURITY_BACKEND=y +CONFIG_MBEDTLS_SHA256_C=y From c4820ccff3ca439ed5b3ead210f9f08d476372cd Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Tue, 22 Apr 2025 14:34:11 +0200 Subject: [PATCH 1594/3334] [nrf noup] modules: hal_nordic: require nrf-regtool Same as commit 6ec9d10 but with the REQUIRED keyword on its own line to attempt to avoid a merge conflict when reverting/reapplying this patch. Signed-off-by: Jonathan Nilsen (cherry picked from commit e8250a96ea58026ef672b999a308745323bbc0c4) --- modules/hal_nordic/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index a49aec6406fa..83354b9d2f64 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -14,6 +14,7 @@ if(CONFIG_NRF_REGTOOL_GENERATE_UICR) endif() if(DEFINED nrf_regtool_components) find_package(nrf-regtool 9.2.0 + REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From 3f9d391279f88fdbd61da6b63e83c1d9d9259479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 11:15:56 +0100 Subject: [PATCH 1595/3334] [nrf noup] boards: nordic: nrf7002dk: Bring back NS variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Non-secure variants for nRF7002 DK were removed from upstream in commit 10d49736cffa14d3798e615e70d58b3be8ee2cfc. Revert these changes downstream, so that the NS variants are still available. Signed-off-by: Andrzej Głąbek Signed-off-by: Johann Fischer (cherry picked from commit 15aa9fd61e8e96d6254fed5e238f300fd5ee3f9a) --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 +++ boards/nordic/nrf7002dk/Kconfig | 4 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 72 +++++++++++++++++++ boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 18 ++++- boards/nordic/nrf7002dk/board.yml | 4 ++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ++++++++++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 +++++ ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 24 +++++++ .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 +++++++++++ .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 +++++ .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 23 ++++++ 12 files changed, 273 insertions(+), 4 deletions(-) create mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt new file mode 100644 index 000000000000..db20255712bc --- /dev/null +++ b/boards/nordic/nrf7002dk/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND + CONFIG_BOARD_ENABLE_CPUNET) + zephyr_library() + zephyr_library_sources(nrf5340_cpunet_reset.c) +endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index fa6c8097ae32..d4b7030a65ab 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,7 +10,9 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS config BT_HCI_IPC default y if BT diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig index a6cf1d7fbca1..8eee0dcdf3da 100644 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -16,3 +16,75 @@ config SPI_NOR_FLASH_LAYOUT_PAGE_SIZE endif # SPI_NOR endif # BOARD_NRF7002DK + +if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +# By default, if we build for a Non-Secure version of the board, +# force building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +# Code Partition: +# +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# SRAM Partition: +# +# If the secure firmware is to be combined with a non-secure image +# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always +# be restricted to the secure image SRAM partition (sram-secure-partition). +# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram +# may be used by the image. +# +# For the non-secure version of the board, the firmware image SRAM is +# always restricted to the allocated non-secure SRAM partition. +# +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ + TRUSTED_EXECUTION_SECURE + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config SRAM_SIZE + default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) + +endif + +if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif + +endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 61b9e818f367..91f52ee6f08c 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,4 +4,6 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index f85bbc86f485..11a27910eebc 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,10 +1,24 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 4f41341e4423..39db5dcfa3a7 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,5 +5,9 @@ board: socs: - name: nrf5340 variants: + - name: ns + cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp + variants: + - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts new file mode 100644 index 000000000000..5ff28accf3fc --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7001@1 { + compatible = "nordic,nrf7001-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml new file mode 100644 index 000000000000..165759691260 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns +name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig new file mode 100644 index 000000000000..2c435653140a --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig @@ -0,0 +1,24 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts new file mode 100644 index 000000000000..0deb8ccc1bf5 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns_app; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7002@1 { + compatible = "nordic,nrf7002-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + #include "nrf70_common_5g.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml new file mode 100644 index 000000000000..ea43785b4559 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/ns +name: NRF7002-DK-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig new file mode 100644 index 000000000000..1886b926bfd5 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y From 91df299acf7cce694bd396ae6cf028879c139e27 Mon Sep 17 00:00:00 2001 From: Maximilian Deubel Date: Wed, 15 Nov 2023 12:55:40 +0100 Subject: [PATCH 1596/3334] [nrf noup] boards: arm: nrf9131ek: enable tfm This patch backports the nrf9131ek to a time before tfm was refactored. To be reverted when TF-M is updated. Signed-off-by: Maximilian Deubel (cherry picked from commit bf4371e95d59ea33d53f5419548c9b618baab547) --- boards/nordic/nrf9131ek/Kconfig.defconfig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index e1d8de241c0a..1a30d006b4c6 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -8,3 +8,22 @@ config HW_STACK_PROTECTION config BOARD_NRF9131EK select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS + +if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF9131EK_NRF9131_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS From abe30cf858dbc18e3fc91951efe7465757dadab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stine=20=C3=85kredalen?= Date: Mon, 4 Aug 2025 01:26:12 +0200 Subject: [PATCH 1597/3334] [nrf noup] samples: bluetooth: mesh: update stack sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increased stack sizes for mesh provisoner sample. Values are based of thread analysis, plus added margin. Signed-off-by: Stine Åkredalen (cherry picked from commit 6c4ef51aea7818ffa0ef30ff09c906e5dc87ae87) --- samples/bluetooth/mesh_provisioner/prj.conf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 3eb40c7112ce..ba3520610f60 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -1,6 +1,10 @@ #CONFIG_INIT_STACKS=y -CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 +# Stack sizes from thread analysis + 50% margin, rounded to nearest 100 +CONFIG_MAIN_STACK_SIZE=4400 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4800 +CONFIG_BT_MESH_SETTINGS_WORKQ_STACK_SIZE=1700 +CONFIG_BT_MESH_ADV_STACK_SIZE=4000 +CONFIG_BT_RX_STACK_SIZE=3300 # The Bluetooth API should not be used from a preemptive thread: CONFIG_MAIN_THREAD_PRIORITY=-2 From 5fe83a2e79854570859ffaa2cbe343a285c22859 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Fri, 31 Jan 2025 14:47:05 +0200 Subject: [PATCH 1598/3334] [nrf noup] tests: secure_storage: fix test w/ ZMS backend on 54L15 noup because it's about partition manager. Fix the build of secure_storage.psa.its.secure_storage.store.zms on nrf54l15dk/nrf54l15/cpuapp by disabling partition manager, which is incompatible with the ZMS implementation of the ITS store module. Disabling it only for that test as it's not needed for the others and even makes the NS board targets fail if disabling PM. Signed-off-by: Tomi Fontanilles (cherry picked from commit cf3f710cf383235fb5b398deb1639535a3107017) --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index 6b244a065b65..c794ea1797e5 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -29,6 +29,7 @@ tests: - EXTRA_DTC_OVERLAY_FILE=zms.overlay - EXTRA_CONF_FILE=\ overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf + - SB_CONFIG_PARTITION_MANAGER=n secure_storage.psa.its.secure_storage.store.zms.64-bit_uids: platform_allow: *zms_platform_allow From a3ea67716178769c447c026b8032fdb65d01029a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Mon, 18 Aug 2025 14:25:53 +0200 Subject: [PATCH 1599/3334] [nrf noup] tests: crypto: Add ENTROPY_GENERATOR in overlays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ENTROPY_GENERATOR=y in overlays for l series devices. This fixes an error where a trng source is not included in ncs. Signed-off-by: Dag Erik Gjørvad (cherry picked from commit bb410b1f8feda5b6f72e8f4216be28f87a9cf401) --- .../mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ++++++ .../mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ++++++ 5 files changed, 30 insertions(+) create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf create mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf new file mode 100644 index 000000000000..70c601183ddf --- /dev/null +++ b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_ENTROPY_GENERATOR=y From 56d74c7289c6ac082d95739096a87f7b8f0dbc3c Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Tue, 3 Jun 2025 16:07:48 +0200 Subject: [PATCH 1600/3334] [nrf noup] zms: add lookup cache hash function for legacy ZMS ZMS legacy enabled by CONFIG_SETTINGS_ZMS_LEGACY uses a different lookup cache function that is optimized for Settings subsystem. Signed-off-by: Riadh Ghaddab (cherry picked from commit 02ee30e22ffc3e061a4a9fbd16f6da19bda4c81b) --- subsys/fs/zms/zms.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index 693a7c165e5d..80caedca387e 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -13,8 +13,12 @@ #include #include "zms_priv.h" #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS +#ifdef CONFIG_SETTINGS_ZMS_LEGACY +#include +#else #include #endif +#endif #include LOG_MODULE_REGISTER(fs_zms, CONFIG_ZMS_LOG_LEVEL); @@ -32,6 +36,40 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at static inline size_t zms_lookup_cache_pos(zms_id_t id) { #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS +#ifdef CONFIG_SETTINGS_ZMS_LEGACY + /* + * 1. The ZMS settings backend uses up to (ZMS_NAME_ID_OFFSET - 1) ZMS IDs to + store keys and equal number of ZMS IDs to store values. + * 2. For each key-value pair, the value is stored at ZMS ID greater by exactly + * ZMS_NAME_ID_OFFSET than ZMS ID that holds the key. + * 3. The backend tries to minimize the range of ZMS IDs used to store keys. + * That is, ZMS IDs are allocated sequentially, and freed ZMS IDs are reused + * before allocating new ones. + * + * Therefore, to assure the least number of collisions in the lookup cache, + * the least significant bit of the hash indicates whether the given ZMS ID + * represents a key or a value, and remaining bits of the hash are set to + * the ordinal number of the key-value pair. Consequently, the hash function + * provides the following mapping: + * + * 1st settings key => hash 0 + * 1st settings value => hash 1 + * 2nd settings key => hash 2 + * 2nd settings value => hash 3 + * ... + */ + BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAMECNT_ID), "ZMS_NAMECNT_ID is not power of 2"); + BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAME_ID_OFFSET), "ZMS_NAME_ID_OFFSET is not power of 2"); + + uint32_t key_value_bit; + uint32_t key_value_ord; + uint32_t hash; + + key_value_bit = (id >> LOG2(ZMS_NAME_ID_OFFSET)) & 1; + key_value_ord = id & (ZMS_NAME_ID_OFFSET - 1); + + hash = ((key_value_ord << 1) | key_value_bit); +#else /* * 1. Settings subsystem is storing the name ID and the linked list node ID * with only one bit difference at BIT(0). @@ -57,6 +95,7 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; +#endif /* CONFIG_SETTINGS_ZMS_LEGACY */ #elif defined(CONFIG_ZMS_ID_64BIT) /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ From fa2b950dcb37884bf5109f15ebf9e4839895d771 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Thu, 28 Aug 2025 08:26:23 +0200 Subject: [PATCH 1601/3334] [nrf noup] soc: nrf54h: work around missing power domain handling This patch should be dropped as part of the next upmerge. The upcoming release of IronSide SE no longer disables RETAIN in all GPIO instances on boot, so the application must be able to handle the hardware default state of RETAIN being enabled. The GPIO retention is properly handled by changes that are currently only upstream and will be pulled in by the next upmerge. This patch exists a workaround to be able to integrate IronSide SE before the proper solution is pulled in. Signed-off-by: Jonathan Nilsen (cherry picked from commit ea96b5cb7e2294b808d59f81a5103f25d101c288) --- soc/nordic/nrf54h/Kconfig | 5 +++++ soc/nordic/nrf54h/soc.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index b23ee3f22a0a..189bb117ebf5 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -99,6 +99,11 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT endif # SOC_NRF54H20_CPURAD_ENABLE +config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND + bool "Disable all GPIO pin retention on boot" + default y + depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 42a99ab6b246..fe664dce6c0d 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -14,6 +14,7 @@ #include #endif +#include #include #include #include @@ -186,6 +187,17 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } + + /* This is a workaround for not yet having upstream patches for properly handling + * pin retention. It should be removed as part of the next upmerge. + */ + if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) { + NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST; + + for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) { + nrf_gpio_port_retain_set(gpio_regs[i], 0); + } + } } #if defined(CONFIG_SOC_LATE_INIT_HOOK) From 488c9ff3113181f7ba1826859244f18aae016241 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 2 Sep 2025 10:48:14 +0100 Subject: [PATCH 1602/3334] [nrf noup] doc: extensions: kconfig: Add SoC sysbuild Kconfigs Allows listing sysbuild Kconfigs for SoCs Signed-off-by: Jamie McCrae (cherry picked from commit ae076725d0a55ca8ce01f17feea2dd68e0ee8e2a) --- doc/_extensions/zephyr/kconfig/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index e977a3b734a8..98422c8ba2fc 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -114,6 +114,9 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d for folder in soc_folders: f.write('source "' + (Path(folder) / 'Kconfig.soc').as_posix() + '"\n') + if "nordic" in folder: + f.write('osource "' + (Path(folder) / 'Kconfig.sysbuild').as_posix() + '"\n') + with open(Path(td) / "soc" / "Kconfig", "w") as f: for folder in soc_folders: f.write('osource "' + (Path(folder) / 'Kconfig').as_posix() + '"\n') From 473385a2525eded8462da11820386c6411936c13 Mon Sep 17 00:00:00 2001 From: Kari Hamalainen Date: Fri, 12 Sep 2025 10:46:10 +0300 Subject: [PATCH 1603/3334] [nrf noup] ci: add reopen for manifest-pr action Previously reopening of PR did not reopen manifest PR. This commit will enable reopening of manifest PR in such case. Signed-off-by: Kari Hamalainen (cherry picked from commit e6d20a77781cd52c546e053d0ae427ebf0669800) --- .github/workflows/manifest-PR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index a871aa381ded..473301146527 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -1,7 +1,7 @@ name: handle manifest PR on: pull_request_target: - types: [opened, synchronize, closed] + types: [opened, synchronize, closed, reopened] branches: - main From eae590fd05121a00ef267c7837957f04fa849e36 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 5 Sep 2025 18:09:52 +0200 Subject: [PATCH 1604/3334] [nrf noup] soc/nordic/nrf54h: Add extension to define custom s2ram implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Kconfig entries to allow compile own s2ram implementation. Signed-off-by: Karol Lasończyk Signed-off-by: Andrzej Puzdrowski (cherry picked from commit 52d649275f12b9b275acb742e514ce216cc48a5c) --- soc/nordic/nrf54h/CMakeLists.txt | 4 +++- soc/nordic/nrf54h/Kconfig | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index a4db05c9e643..25e4796a4169 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -13,7 +13,9 @@ if(CONFIG_ARM) endif() endif() -zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) +if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) + zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) +endif() zephyr_include_directories(.) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 189bb117ebf5..1c5f703ae713 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -104,6 +104,11 @@ config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND default y depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD +config SOC_NRF54H20_PM_S2RAM_OVERRIDE + bool "Override `pm_s2ram` implementation" + help + Override Nordic s2ram implementation. + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON From e6ba1bc19db2ecd0bd245a0a27ec9eae9d44ea81 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 12:17:00 +0200 Subject: [PATCH 1605/3334] [nrf noup] dts: choose a psa-rng for entropy for 54lm20a Set PSA as the entropy source for nRF54lm20a target. PSA is the only NCS-supported interface to CRACEN. There is no other entropy source in 54lm20a than CRACEN. The commit also disables `rng` compatible with `nrf-cracen-ctrdrbg`, the nrfx based interface to CRACEN that is used in upstream Zephyr. Only one CRACEN interface may be enabled. Signed-off-by: Piotr Pryga (cherry picked from commit ae18200a608e1cfc048e58bde0e5e1da859cf63c) --- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index b29562185846..2947c7554ad0 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -31,7 +31,7 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index d74a33745c01..68d08e7cbd8b 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -22,7 +22,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -33,11 +33,11 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; }; From 22acc285ac9f7a512b47a124f41707893f2e5bc8 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 07:48:52 +0200 Subject: [PATCH 1606/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding as default The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. The SoftDevice Controller is a default BT controller in nRF Connect SDK context, therefore it should be enabled by default instead of open source link layer. The commit changes the default BT controller for nRF54lm20a SoC. Signed-off-by: Piotr Pryga (cherry picked from commit 39166353a40830e5d1bf02cfa4d4c99040adbfc8) --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 ----- boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts | 4 ---- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 5 +++++ dts/vendor/nordic/nrf54lm20a.dtsi | 5 +++++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index f0946efb543f..6ab124d0fb84 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -18,7 +18,6 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; - zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; @@ -98,10 +97,6 @@ status = "okay"; }; -&bt_hci_controller { - status = "okay"; -}; - &ieee802154 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index a5d1600de247..ef47e866e4c4 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -19,9 +19,5 @@ }; }; -&bt_hci_controller { - status = "okay"; -}; - /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index 68d08e7cbd8b..a8a384636151 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -22,6 +22,7 @@ nvic: &cpuapp_nvic {}; / { chosen { + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -42,6 +43,10 @@ nvic: &cpuapp_nvic {}; }; }; +&bt_hci_sdc { + status = "okay"; +}; + &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index f09ca573f56f..5f7c3087a714 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -301,6 +301,11 @@ /* Note: In the nRF Connect SDK the SoftDevice Controller * is added and set as the default Bluetooth Controller. */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From c82c4284bab25b8948ace32edb92e54d04575cd6 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 11 Sep 2025 16:07:03 +0530 Subject: [PATCH 1607/3334] [nrf noup] boards: nordic: nrf7002: Include required headers The definitions of slot partitions and sram partition has been moved. Include corresponding headers. Signed-off-by: Ravi Dondaputi (cherry picked from commit ed1c8ef56abc767d48b4e2901a948886f0b0b1b0) --- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 0deb8ccc1bf5..9c06a17ad7bf 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -7,6 +7,8 @@ /dts-v1/; #include #include "nrf5340_cpuapp_common.dtsi" +#include "nordic/nrf5340_sram_partition.dtsi" +#include "nordic/nrf5340_cpuapp_ns_partition.dtsi" / { model = "Nordic NRF5340 DK NRF5340 Application"; From cf7c4d33918ef1a43ba573ba6ba5bbc20c8c2a51 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 25 Sep 2025 09:44:35 +0100 Subject: [PATCH 1608/3334] [nrf noup] soc: nordic: nrf54l: Add ROM start offset PM override Adds an override to force this Kconfig to 0 when partition manager is enabled Signed-off-by: Jamie McCrae (cherry picked from commit ba72a55d65c4e4de93ccd1a931b478ca96cc0f49) --- soc/nordic/nrf54l/Kconfig.defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index 2cd38dca0e95..bc7577b7c55e 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -33,6 +33,7 @@ choice NULL_POINTER_EXCEPTION_DETECTION endchoice config ROM_START_OFFSET + default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # ARM From fe5d6adc277a9078d56591128898a1c16eb2f751 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 8 Jul 2025 13:59:15 +0100 Subject: [PATCH 1609/3334] [nrf noup] scripts: ci: check_compliance: Add undefined Kconfigs Adds undefined Kconfigs used in NCS to the allow list for Kconfig compliance checks Signed-off-by: Jamie McCrae (cherry picked from commit e0c9e903ca64058c689d41d2ef917d7f0883d433) --- scripts/ci/check_compliance.py | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 508915ce0ede..16abcab9c6fc 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1667,6 +1667,81 @@ def check_no_undef_outside_kconfig(self, kconf): "ZTEST_FAIL_TEST_", # regex in tests/ztest/fail/CMakeLists.txt "ZVFS_OPEN_ADD_SIZE_", # Used as an option matching prefix # zephyr-keep-sorted-stop + + # NCS-specific allow list + # zephyr-keep-sorted-start re(^\s+") + "APPLICATION", # Example documentation + "BAR", # Example documentation + "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation + "BT_ADV_PROV_", # Documentation + "BT_CTLR_TX_PWR_MINUS", # CHIP documentation + "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation + "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo + "CHANNEL", # NRF desktop + "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop + "CHANNEL_TRANSPORT_DISABLED", # NRF desktop + "CHANNEL_TRANSPORT_IDLE", # NRF desktop + "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop + "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop + "CHIP_DFU_OVER_BT_SMP", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module + "CHIP_MEMORY_PROFILING", # CHIP module + "CHIP_NUS", # CHIP module + "CHIP_NUS_FIXED_PASSKEY", # CHIP module + "CHIP_NUS_MAX_COMMANDS", # CHIP module + "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module + "CHIP_QSPI_NOR", # CHIP module + "CHIP_SPI_NOR", # CHIP module + "CHIP_WIFI", # CHIP module + "DESKTOP_DVFS_STATE_", # NRF desktop + "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop + "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module + "MEMFAULT_", # Documentation + "MEMFAULT_NCS", # Documentation + "MEMFAULT_NCS_", # Documentation + "MY_CUSTOM_CONFIG", # Example documentation + "MY_EXT_API_ENABLED", # Example documentation + "MY_EXT_API_REQUIRED", # Example documentation + "NCS_IS_VARIANT_IMAGE", # Build system defined symbol + "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot + "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot + "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol + "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation + "PM_PARTITION_SIZE", # Used in search link + "PM_PARTITION_SIZE_", # Used in documentation + "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template + "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template + "SOC_NRF54H20_CPUSEC", # Internal + "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal + "STATUS_", # NRF desktop + "STATUS_COUNT", # NRF desktop + "STATUS_DISCONNECTED", # NRF desktop + "STATUS_FETCH", # NRF desktop + "STATUS_GET_BOARD_NAME", # NRF desktop + "STATUS_GET_HWID", # NRF desktop + "STATUS_GET_MAX_MOD_ID", # NRF desktop + "STATUS_GET_PEER", # NRF desktop + "STATUS_GET_PEERS_CACHE", # NRF desktop + "STATUS_INDEX_PEERS", # NRF desktop + "STATUS_LIST", # NRF desktop + "STATUS_PENDING", # NRF desktop + "STATUS_POS", # NRF desktop + "STATUS_REJECT", # NRF desktop + "STATUS_SET", # NRF desktop + "STATUS_SUCCESS", # NRF desktop + "STATUS_TIMEOUT", # NRF desktop + "STATUS_WRITE_FAIL", # NRF desktop + # zephyr-keep-sorted-stop } From 74ca5f8e85863415b4a3f8c1cbf8c62e6e2e3ae1 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 7 Jul 2025 09:02:08 +0100 Subject: [PATCH 1610/3334] [nrf noup] scripts: ci: check_compliance: Exclude some docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the NCS release notes folder to the exclusion list for undefined Kconfigs so that old Kconfigs can be used e.g. for old release notes, and lwm2m carrier library changelog. Also adds a nrf7x page which details setup instructions for software on Linux Excludes bare metal release docs from the invalid Kconfig check as these will have old Kconfigs that have been removed Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Moń (cherry picked from commit 02cb82717a2217cb35833ff1c1100f8c4e865e3c) --- scripts/ci/check_compliance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 16abcab9c6fc..fc4c73e7285b 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1457,6 +1457,10 @@ def check_no_undef_outside_kconfig(self, kconf): "--", ":!/doc/releases", ":!/doc/security/vulnerabilities.rst", + ":!/doc/nrf/releases_and_maturity", + ":!/doc/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.rst", + ":!/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst", + ":!/doc/nrf-bm/release_notes", cwd=GIT_TOP, ) From 8b6ec77050bf145329f52f51417fe53940dbcf95 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 5 Sep 2025 18:11:52 +0200 Subject: [PATCH 1611/3334] [nrf noup] soc/nordic/nrf54h/pm_s2ram: S2RAM resume hardening MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for hardening decision on resume from S2RAM by MCUboot bootloader. Application sets additional variable to MCUBOOT_S2RAM_RESUME_MAGIC which allows the bootloader to doublecheck. Extended mcuboot_resume_s suture by slot_info field intended to be used by MCUboot for recognize proper boot slot in direct-xp mode. Signed-off-by: Andrzej Puzdrowski Signed-off-by: Tomasz Moń (cherry picked from commit d68235ee707134c90af942ec848fe91c49efedf9) --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 14 ++++++++++++++ soc/nordic/nrf54h/pm_s2ram.c | 14 ++++++++++++++ soc/nordic/nrf54h/pm_s2ram.h | 7 +++++++ 3 files changed, 35 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index c534e1bd91c8..da4dbf236406 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -358,6 +358,20 @@ zephyr_udc0: &usbhs { zephyr,memory-region = "PMLocalRamfunc"; }; + /* temporary stack for S2RAM resume logic */ + pm_s2ram_stack: cpuapp_s2ram_stack@22007fc8 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x22007fc8 16>; + zephyr,memory-region = "pm_s2ram_stack"; + }; + + /* run-time common mcuboot S2RAM support section */ + mcuboot_s2ram: cpuapp_s2ram@22007fd8 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x22007fd8 8>; + zephyr,memory-region = "mcuboot_s2ram_context"; + }; + /* run-time common S2RAM cpu context RAM */ pm_s2ram: cpuapp_s2ram@7fe0 { compatible = "zephyr,memory-region", "mmio-sram"; diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index d8bb0fc4cd54..08be128ac432 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -77,10 +77,24 @@ static void fpu_power_up(void) } #endif /* defined(CONFIG_FPU) */ +#if DT_NODE_EXISTS(DT_NODELABEL(mcuboot_s2ram)) &&\ + DT_NODE_HAS_COMPAT(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region) +/* Linker section name is given by `zephyr,memory-region` property of + * `zephyr,memory-region` compatible DT node with nodelabel `mcuboot_s2ram`. + */ +__attribute__((section(DT_PROP(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region)))) +volatile struct mcuboot_resume_s _mcuboot_resume; + +#define SET_MCUBOOT_RESUME_MAGIC() _mcuboot_resume.magic = MCUBOOT_S2RAM_RESUME_MAGIC +#else +#define SET_MCUBOOT_RESUME_MAGIC() +#endif + int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) { int ret; + SET_MCUBOOT_RESUME_MAGIC(); z_arm_save_scb_context(&backup_data.scb_context); #if defined(CONFIG_FPU) #if !defined(CONFIG_FPU_SHARING) diff --git a/soc/nordic/nrf54h/pm_s2ram.h b/soc/nordic/nrf54h/pm_s2ram.h index 565afad6ca10..01c098ea4310 100644 --- a/soc/nordic/nrf54h/pm_s2ram.h +++ b/soc/nordic/nrf54h/pm_s2ram.h @@ -10,6 +10,13 @@ #ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ #define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ +#define MCUBOOT_S2RAM_RESUME_MAGIC 0x75832419 + +struct mcuboot_resume_s { + uint32_t magic; /* magic value to identify valid structure */ + uint32_t slot_info; +}; + /** * @brief Save CPU state on suspend * From 44a465970de240fae2260ea11dec67456ab6de16 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Fri, 14 Jun 2024 09:13:48 +0200 Subject: [PATCH 1612/3334] [nrf noup] bluetooth: att: Allow ATT sent callback after data TX is done By default, the BLE stack calls sent callback for ATT data when the data is passed to BLE controller for transmission. Enabling this Kconfig option delays calling the sent callback until data transmission is finished by BLE controller (the callback is delayed until receiving the Number of Completed Packets HCI Event). If the 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. Jira: NCSDK-27422 Jira: NCSDK-28624 Jira: NCSDK-35650 Signed-off-by: Marek Pieta (cherry picked from commit 64ec75ff36924adfe3399c25c0f7618fa23cbe16) --- subsys/bluetooth/host/Kconfig.gatt | 14 ++++++++++++++ subsys/bluetooth/host/att.c | 17 ++++++++++++++++- subsys/bluetooth/host/conn.c | 27 ++++++++++++++++++++++----- subsys/bluetooth/host/l2cap.c | 10 ++++++++-- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index a04241a3e94f..3403e8d308b8 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -38,6 +38,20 @@ 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. + 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 eed079b08fc7..ad1d407b71b8 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -396,6 +396,13 @@ static void att_disconnect(struct bt_att_chan *chan) } } +static void chan_sent_cb(struct bt_conn *conn, void *user_data, int err) +{ + struct net_buf *nb = user_data; + + net_buf_unref(nb); +} + /* In case of success the ownership of the buffer is transferred to the stack * which takes care of releasing it when it completes transmitting to the * controller. @@ -489,7 +496,15 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf) data->att_chan = chan; - err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); + if (IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX)) { + err = bt_l2cap_send_pdu(&chan->chan, buf, chan_sent_cb, net_buf_ref(buf)); + if (err) { + net_buf_unref(buf); + } + } else { + err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); + } + if (err) { if (err == -ENOBUFS) { LOG_ERR("Ran out of TX buffers or contexts."); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 3bb442e3f185..ff4dba086e1c 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -699,12 +699,29 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - /* Check that buf->ref is 1 or 2. It would be 1 if this - * was the only reference (e.g. buf was removed - * from the conn tx_queue). It would be 2 if the - * tx_data_pull kept it on the tx_queue for segmentation. + /* If ATT sent callback is delayed until data transmission + * is done by BLE controller (CONFIG_BT_ATT_SENT_CB_AFTER_TX), + * the `chan_send` function from `att.c` introduces 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 (the reference is removed when the TX callback passed + * to `bt_l2cap_send_pdu` is called). + * + * send_buf function can be called multiple times, if buffer + * has to be fragmented over HCI. In that case, the callback + * is provided as an argument only for the last transmitted + * fragment. The `buf->ref == 1` (or 2) check is skipped + * because it's impossible to properly validate number of + * references for the sent fragments if buffers may have the + * additional reference. + * + * Otherwise, check that buf->ref is 1 or 2. It would be 1 + * if this was the only reference (e.g. buf was removed from + * the conn tx_queue). It would be 2 if the tx_data_pull + * kept it on the tx_queue for segmentation. */ - __ASSERT_NO_MSG((buf->ref == 1) || (buf->ref == 2)); + __ASSERT_NO_MSG(IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX) || (buf->ref == 1) || + (buf->ref == 2)); /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 3727345e4ee6..3e8e0da251c4 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -778,13 +778,19 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, return -ENOTCONN; } - if (pdu->ref != 1) { + /* If ATT sent callback is delayed until data transmission is done by BLE controller + * (CONFIG_BT_ATT_SENT_CB_AFTER_TX), the `chan_send` function from `att.c` introduces 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 (the reference is removed when + * the TX callback passed to `bt_l2cap_send_pdu` is called). + */ + if (pdu->ref > 1 + (cb ? 1 : 0)) { /* The host may alter the buf contents when fragmenting. Higher * layers cannot expect the buf contents to stay intact. Extra * refs suggests a silent data corruption would occur if not for * this error. */ - LOG_ERR("Expecting 1 ref, got %d", pdu->ref); + LOG_ERR("Expecting up to %d refs, got %d", cb ? 2 : 1, pdu->ref); return -EINVAL; } From 38f7a5f684e8fb0bf7aca909939483ca1339149e Mon Sep 17 00:00:00 2001 From: Kari Hamalainen Date: Mon, 13 Oct 2025 14:30:13 +0300 Subject: [PATCH 1613/3334] [nrf noup] ci: add default permissions Scanners report these as missing so lets add them. Signed-off-by: Kari Hamalainen (cherry picked from commit 94b4cf09b6f3a4ae048b8a8318c9f00b0430fbd7) --- .github/workflows/commit-tags.yml | 5 ++++- .github/workflows/manifest-PR.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml index 828f02971678..61fc3a6c5bd3 100644 --- a/.github/workflows/commit-tags.yml +++ b/.github/workflows/commit-tags.yml @@ -6,6 +6,9 @@ on: milestoned, demilestoned, assigned, unassigned, ready_for_review, review_requested] +permissions: + contents: read + jobs: commit_tags: runs-on: ubuntu-22.04 @@ -16,7 +19,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 473301146527..0f3bd738a36c 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -5,6 +5,8 @@ on: branches: - main +permissions: + contents: read jobs: call-manifest-pr-action: From f760d80ecf124aa58869e4bfa7f0ac7924996101 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Mon, 25 Nov 2024 14:14:40 +0100 Subject: [PATCH 1614/3334] [nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure SDP MSPI pins to switch their control to VPR core Signed-off-by: Jakub Zymelka Signed-off-by: Andrzej Głąbek Signed-off-by: Magdalena Pastula Signed-off-by: Karsten Koenig (cherry picked from commit 41aa006934fc11442d82055cfde2284daca54489) --- drivers/pinctrl/pinctrl_nrf.c | 32 +++++++++++ .../zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 56 +++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index b052e61eb803..3ad358158a80 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -148,6 +148,18 @@ static void port_pin_clock_set(uint16_t pin_number, bool enable) #endif +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || \ + defined(CONFIG_MSPI_HPF) || \ + DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(nordic_nrf_vpr_coprocessor, pinctrl_0) +#if defined(CONFIG_SOC_SERIES_NRF54LX) +#define NRF_PSEL_SDP_MSPI(psel) \ + nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_VPR); +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +/* On nRF54H, pin routing is controlled by secure domain, via UICR. */ +#define NRF_PSEL_SDP_MSPI(psel) +#endif +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || ... */ + int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg) { @@ -529,6 +541,26 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_DISCONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_coresight_nrf) */ +#if defined(NRF_PSEL_SDP_MSPI) + case NRF_FUN_SDP_MSPI_CS0: + case NRF_FUN_SDP_MSPI_CS1: + case NRF_FUN_SDP_MSPI_CS2: + case NRF_FUN_SDP_MSPI_CS3: + case NRF_FUN_SDP_MSPI_CS4: + case NRF_FUN_SDP_MSPI_SCK: + case NRF_FUN_SDP_MSPI_DQ0: + case NRF_FUN_SDP_MSPI_DQ1: + case NRF_FUN_SDP_MSPI_DQ2: + case NRF_FUN_SDP_MSPI_DQ3: + case NRF_FUN_SDP_MSPI_DQ4: + case NRF_FUN_SDP_MSPI_DQ5: + case NRF_FUN_SDP_MSPI_DQ6: + case NRF_FUN_SDP_MSPI_DQ7: + NRF_PSEL_SDP_MSPI(psel); + dir = NRF_GPIO_PIN_DIR_OUTPUT; + input = NRF_GPIO_PIN_INPUT_CONNECT; + break; +#endif /* defined(NRF_PSEL_SDP_MSPI) */ default: return -ENOTSUP; } diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 92e62a9a6bed..4c7f1d3145dd 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -172,6 +172,62 @@ #define NRF_FUN_GRTC_CLKOUT_FAST 55U /** GRTC slow clock output */ #define NRF_FUN_GRTC_CLKOUT_32K 56U +/** SDP_MSPI clock pin */ +#define NRF_FUN_SDP_MSPI_SCK 57U +/** SDP_MSPI data pin 0 */ +#define NRF_FUN_SDP_MSPI_DQ0 58U +/** SDP_MSPI data pin 1 */ +#define NRF_FUN_SDP_MSPI_DQ1 59U +/** SDP_MSPI data pin 2 */ +#define NRF_FUN_SDP_MSPI_DQ2 60U +/** SDP_MSPI data pin 3 */ +#define NRF_FUN_SDP_MSPI_DQ3 61U +/** SDP_MSPI data pin 4 */ +#define NRF_FUN_SDP_MSPI_DQ4 62U +/** SDP_MSPI data pin 5 */ +#define NRF_FUN_SDP_MSPI_DQ5 63U +/** SDP_MSPI data pin 6 */ +#define NRF_FUN_SDP_MSPI_DQ6 64U +/** SDP_MSPI data pin 7 */ +#define NRF_FUN_SDP_MSPI_DQ7 65U +/** SDP_MSPI chip select 0 */ +#define NRF_FUN_SDP_MSPI_CS0 66U +/** SDP_MSPI chip select 1 */ +#define NRF_FUN_SDP_MSPI_CS1 67U +/** SDP_MSPI chip select 2 */ +#define NRF_FUN_SDP_MSPI_CS2 68U +/** SDP_MSPI chip select 3 */ +#define NRF_FUN_SDP_MSPI_CS3 69U +/** SDP_MSPI chip select 4 */ +#define NRF_FUN_SDP_MSPI_CS4 70U +/** High-Performance Framework MSPI clock pin */ +#define NRF_FUN_HPF_MSPI_SCK NRF_FUN_SDP_MSPI_SCK +/** High-Performance Framework MSPI data pin 0 */ +#define NRF_FUN_HPF_MSPI_DQ0 NRF_FUN_SDP_MSPI_DQ0 +/** High-Performance Framework MSPI data pin 1 */ +#define NRF_FUN_HPF_MSPI_DQ1 NRF_FUN_SDP_MSPI_DQ1 +/** High-Performance Framework MSPI data pin 2 */ +#define NRF_FUN_HPF_MSPI_DQ2 NRF_FUN_SDP_MSPI_DQ2 +/** High-Performance Framework MSPI data pin 3 */ +#define NRF_FUN_HPF_MSPI_DQ3 NRF_FUN_SDP_MSPI_DQ3 +/** High-Performance Framework MSPI data pin 4 */ +#define NRF_FUN_HPF_MSPI_DQ4 NRF_FUN_SDP_MSPI_DQ4 +/** High-Performance Framework MSPI data pin 5 */ +#define NRF_FUN_HPF_MSPI_DQ5 NRF_FUN_SDP_MSPI_DQ5 +/** High-Performance Framework MSPI data pin 6 */ +#define NRF_FUN_HPF_MSPI_DQ6 NRF_FUN_SDP_MSPI_DQ6 +/** High-Performance Framework MSPI data pin 7 */ +#define NRF_FUN_HPF_MSPI_DQ7 NRF_FUN_SDP_MSPI_DQ7 +/** High-Performance Framework MSPI chip select pin 0 */ +#define NRF_FUN_HPF_MSPI_CS0 NRF_FUN_SDP_MSPI_CS0 +/** High-Performance Framework MSPI chip select pin 1 */ +#define NRF_FUN_HPF_MSPI_CS1 NRF_FUN_SDP_MSPI_CS1 +/** High-Performance Framework MSPI chip select pin 2 */ +#define NRF_FUN_HPF_MSPI_CS2 NRF_FUN_SDP_MSPI_CS2 +/** High-Performance Framework MSPI chip select pin 3 */ +#define NRF_FUN_HPF_MSPI_CS3 NRF_FUN_SDP_MSPI_CS3 +/** High-Performance Framework MSPI chip select pin 4 */ +#define NRF_FUN_HPF_MSPI_CS4 NRF_FUN_SDP_MSPI_CS4 /** TDM SCK in master mode */ #define NRF_FUN_TDM_SCK_M 71U /** TDM SCK in slave mode */ From 9f8e4ede3aaa409b959148d05e8c7fe6c139dc24 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 25 Sep 2025 16:15:45 +0200 Subject: [PATCH 1615/3334] [nrf noup] boards: nordic: Skip offsets in merged slot In the merged slot approach, the memory reservation for the MCUboot header is done in CMake, as it is not obvious, which image includes the (merged) MCUboot header. This change will remove the unnecessary gap between images. Ref: NCSDK-35612 Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 552993e42de89af3f9fb9edf8a7697fdd864e0f1) --- boards/nordic/nrf54h20dk/Kconfig.defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 069ed7b6eba6..c11d3ef63e1f 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -13,6 +13,7 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET + default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT if !USE_DT_CODE_PARTITION @@ -39,6 +40,7 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET + default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From df055b3eb59af0bf18b7ceb4427ddceb60648421 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 6 Oct 2025 08:43:55 +0100 Subject: [PATCH 1616/3334] [nrf noup] scripts: ci: check_compliance: Check Kconfigs for enable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows checking sdk-nrf for Kconfig prompts that start with "Enable" as these should not be allowed Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Moń (cherry picked from commit 26f650948186971ad8066d4126208cd6460cf9f2) --- scripts/ci/check_compliance.py | 57 ++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index fc4c73e7285b..439c82508c20 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -681,6 +681,22 @@ class KconfigCheck(ComplianceTest): # Kconfig symbol prefix/namespace. CONFIG_ = "CONFIG_" + # If modules should be excluded from checks. + EXCLUDE_MODULES = False + + # This block list contains a list of upstream Zephyr modules that should not be checked + # DO NOT MERGE CHANGES TO THIS WITHOUT BUILD SYSTEM AND CODE OWNER APPROVAL! + external_module_name_block_list = ['canopennode', 'chre', 'cmsis', 'cmsis-dsp', 'cmsis-nn', + 'cmsis_6', 'edtt', 'fatfs', 'hal_st', 'hal_tdk', + 'hal_wurthelektronik', 'liblc3', 'libmetal', 'littlefs', + 'loramac-node', 'lvgl', 'lz4', 'mipi-sys-t', 'nanopb', + 'net-tools', 'nrf_hw_models', 'open-amp', 'percepio', + 'picolibc', 'segger', 'tf-m-tests', 'tinycrypt', + 'uoscore-uedhoc', 'zscilib'] + + # Holds a list or directories/files which should not be checked + blocked_module_dirs = [] + def run(self): kconf = self.parse_kconfig() @@ -722,13 +738,22 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir = ZEPHYR_BASE / 'modules' modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] - nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') + nrf_modules_dir = (Path(ZEPHYR_BASE) / '..' / 'nrf' / 'modules').resolve() nrf_modules = [] + + for module in modules: + if module in self.external_module_name_block_list: + self.blocked_module_dirs.append(modules_dir / module / 'Kconfig') + if os.path.exists(nrf_modules_dir): nrf_modules = [name for name in os.listdir(nrf_modules_dir) if os.path.exists(os.path.join(nrf_modules_dir, name, 'Kconfig'))] + for module in nrf_modules: + if module in self.external_module_name_block_list: + self.blocked_module_dirs.append(nrf_modules_dir / module / 'Kconfig') + with open(modules_file) as fp_module_file: content = fp_module_file.read() @@ -753,6 +778,7 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir / module / 'Kconfig', ) ) + # Add NRF as static entry as workaround for ext Kconfig root support fp_module_file.write( "ZEPHYR_NRF_KCONFIG = {}\n".format( @@ -1317,9 +1343,32 @@ def check_no_enable_in_boolean_prompt(self, kconf): # Checks that boolean's prompt does not start with "Enable...". for node in kconf.node_iter(): - # skip Kconfig nodes not in-tree (will present an absolute path) + skip_node = False + + # skip Kconfig nodes not in-tree when set to (will present an absolute path) if os.path.isabs(node.filename): - continue + if self.EXCLUDE_MODULES is True: + continue + + normalised_file_name = Path(node.filename).resolve() + + for module_name in self.external_module_name_block_list: + # Workaround for being unable to use full_match() due to python version + if '/modules/' in str(normalised_file_name) and \ + ('/' + module_name + '/') in str(normalised_file_name): + skip_node = True + break + + if skip_node: + continue + + for blocked_dir in self.blocked_module_dirs: + if normalised_file_name.match(blocked_dir, case_sensitive=True): + skip_node = True + break + + if skip_node: + continue # 'kconfiglib' is global # pylint: disable=undefined-variable @@ -1773,6 +1822,7 @@ class KconfigBasicNoModulesCheck(KconfigBasicCheck): name = "KconfigBasicNoModules" path_hint = "" EMPTY_FILE_CONTENTS = "# Empty\n" + EXCLUDE_MODULES = True def get_modules(self, module_dirs_file, modules_file, sysbuild_modules_file, settings_file): with open(module_dirs_file, 'w') as fp_module_file: @@ -1869,6 +1919,7 @@ class SysbuildKconfigBasicNoModulesCheck(SysbuildKconfigCheck, KconfigBasicNoMod name = "SysbuildKconfigBasicNoModules" path_hint = "" + EXCLUDE_MODULES = True class Nits(ComplianceTest): From 9a1090dbe899a8ca3e7e64f9044a00ac9414aac5 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Tue, 16 Jul 2024 14:43:30 +0200 Subject: [PATCH 1617/3334] [nrf noup] dts: Add Bluetooth Controller to nRF54H20 The nRF54H20 supports a Bluetooth controller. The HCI driver interface has changed upstream in https://github.com/zephyrproject-rtos/zephyr/pull/72323 so now we need to add it to device tree. Signed-off-by: Rubin Gerritsen (cherry picked from commit 87b051f5d2fb0d3e7839ae511f96ce073ae8f1e7) --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 8 ++++++++ dts/vendor/nordic/nrf54h20.dtsi | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index b910e42789b0..eac16a3c14f3 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -31,6 +31,10 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &s2ram; / { + chosen { + zephyr,bt-hci = &bt_hci_controller; + }; + soc { compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; @@ -131,3 +135,7 @@ wdt011: &cpurad_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; + +&bt_hci_controller { + status = "okay"; +}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index c53ba69a9edf..94b45b297cc3 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -497,6 +497,14 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; + + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; }; ccm030: ccm@3a000 { From e89fd5f868c584dbda3d140ca7ff062c8a942968 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Thu, 5 Sep 2024 08:04:15 +0200 Subject: [PATCH 1618/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding as default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. It should therefore have its own device tree binding. This commit converts the SoftDevice Controller driver to use this new DTS binding instead of reusing the existing one. This commit updates or adds additional overlays for existing samples, applications and tests that were using the open source link layer. Signed-off-by: Rubin Gerritsen Signed-off-by: Kristoffer Rist Skøien Signed-off-by: Rafał Kuźnia Signed-off-by: Tomasz Moń (cherry picked from commit 2dcdc2cbe53ac468f10e75ce9f8b0954397e959e) --- dts/arm/nordic/nrf52805.dtsi | 11 +- dts/arm/nordic/nrf52810.dtsi | 11 +- dts/arm/nordic/nrf52811.dtsi | 11 +- dts/arm/nordic/nrf52820.dtsi | 11 +- dts/arm/nordic/nrf52832.dtsi | 11 +- dts/arm/nordic/nrf52833.dtsi | 11 +- dts/arm/nordic/nrf52840.dtsi | 11 +- dts/arm/nordic/nrf5340_cpunet.dtsi | 11 +- dts/arm/nordic/nrf54h20_cpurad.dtsi | 4 +- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +- dts/vendor/nordic/nrf54h20.dtsi | 7 +- dts/vendor/nordic/nrf54l20.dtsi | 852 ++++++++++++++++++ dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 +- .../bluetooth/bap_broadcast_sink/sample.yaml | 4 +- .../bap_broadcast_sink/sysbuild.cmake | 4 + .../bap_broadcast_source/sample.yaml | 4 +- .../bap_broadcast_source/sysbuild.cmake | 4 + .../bluetooth/bap_unicast_client/sample.yaml | 4 +- .../bap_unicast_client/sysbuild.cmake | 4 + .../bluetooth/bap_unicast_server/sample.yaml | 4 +- .../bap_unicast_server/sysbuild.cmake | 4 + samples/bluetooth/beacon/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sysbuild.cmake | 4 + samples/bluetooth/cap_initiator/sample.yaml | 4 +- .../bluetooth/cap_initiator/sysbuild.cmake | 4 + .../direction_finding_central/sample.yaml | 15 +- .../sample.yaml | 14 +- .../sample.yaml | 14 +- .../direction_finding_peripheral/sample.yaml | 15 +- samples/bluetooth/hci_ipc/sample.yaml | 34 +- samples/bluetooth/hci_uart/sample.yaml | 18 +- samples/bluetooth/hci_vs_scan_req/sample.yaml | 2 + samples/bluetooth/iso_central/sample.yaml | 6 +- .../pbp_public_broadcast_sink/sample.yaml | 4 +- .../pbp_public_broadcast_sink/sysbuild.cmake | 4 + .../pbp_public_broadcast_source/sample.yaml | 4 +- .../sysbuild.cmake | 4 + .../bt-ll-sw-split/bt-ll-sw-split.overlay | 4 + .../controller/ll_sw/nordic/lll/lll.c | 2 +- .../controller/ctrl_api/testcase.yaml | 2 + .../controller/ctrl_chmu/testcase.yaml | 2 + .../controller/ctrl_cis_create/testcase.yaml | 2 + .../ctrl_cis_terminate/testcase.yaml | 2 + .../controller/ctrl_collision/testcase.yaml | 2 + .../controller/ctrl_conn_update/testcase.yaml | 11 +- .../controller/ctrl_cte_req/testcase.yaml | 2 + .../ctrl_data_length_update/testcase.yaml | 10 +- .../controller/ctrl_encrypt/testcase.yaml | 2 + .../ctrl_feature_exchange/testcase.yaml | 2 + .../controller/ctrl_hci/testcase.yaml | 2 + .../controller/ctrl_invalid/testcase.yaml | 2 + .../controller/ctrl_le_ping/testcase.yaml | 2 + .../ctrl_min_used_chans/testcase.yaml | 2 + .../controller/ctrl_phy_update/testcase.yaml | 6 +- .../controller/ctrl_sca_update/testcase.yaml | 2 + .../controller/ctrl_sw_privacy/testcase.yaml | 2 + .../controller/ctrl_terminate/testcase.yaml | 2 + .../ctrl_tx_buffer_alloc/testcase.yaml | 22 +- .../controller/ctrl_tx_queue/testcase.yaml | 2 + .../controller/ctrl_unsupported/testcase.yaml | 6 +- .../controller/ctrl_user_ext/testcase.yaml | 2 + .../controller/ctrl_version/testcase.yaml | 2 + .../df/connection_cte_req/testcase.yaml | 2 + .../df/connection_cte_tx_params/testcase.yaml | 2 + .../connectionless_cte_chains/testcase.yaml | 2 + .../df/connectionless_cte_rx/testcase.yaml | 2 + .../df/connectionless_cte_tx/testcase.yaml | 2 + tests/bluetooth/init/testcase.yaml | 101 ++- 69 files changed, 1235 insertions(+), 122 deletions(-) create mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 3355f3918c87..0d564955f8c1 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -108,12 +108,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 0c61d6700c71..d95751752109 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -116,12 +116,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 2e785877ca97..5c55cf44edcf 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -124,12 +124,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index d95a47943acb..d67d81686a4a 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -10,7 +10,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -125,12 +125,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK another Bluetooth controller - * is added and set as the default. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index 1be9885a756b..a127ffb194d9 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -116,12 +116,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index daee86d5c244..33df68336231 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -126,12 +126,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 324f06d0fba9..15052e2e82a4 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -118,12 +118,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 94e93782fe31..b7b00c4feeda 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -9,7 +9,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -106,12 +106,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index eac16a3c14f3..2cde225beb01 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -32,7 +32,7 @@ wdt011: &cpurad_wdt011 {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; }; soc { @@ -136,6 +136,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 2947c7554ad0..6e0b57f0f0d4 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -20,7 +20,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -41,7 +41,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 94b45b297cc3..7c569e2bf104 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -498,9 +498,10 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi new file mode 100644 index 000000000000..bee70effa0e8 --- /dev/null +++ b/dts/vendor/nordic/nrf54l20.dtsi @@ -0,0 +1,852 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr"; + reg = <1>; + device_type = "cpu"; + riscv,isa = "rv32emc"; + nordic,bus-width = <64>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + pclk32m: pclk32m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + aclk: aclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; + + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(447)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 0x6fc00>; + }; + + cpuflpr_sram: memory@2006fc00 { + compatible = "mmio-sram"; + reg = <0x2006fc00 DT_SIZE_K(64)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2006fc00 0x10000>; + }; + + global_peripherals: peripheral@50000000 { + ranges = <0x0 0x50000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x143c>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + spi00: spi@4d000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart00: uart@4d000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + pdm20: pdm@d0000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd0000 0x1000>; + interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pdm21: pdm@d1000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd1000 0x1000>; + interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pwm20: pwm@d2000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd2000 0x1000>; + interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm21: pwm@d3000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd3000 0x1000>; + interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm22: pwm@d4000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd4000 0x1000>; + interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <16>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + tdm: tdm@e8000 { + compatible = "nordic,nrf-tdm"; + easydma-maxcnt-bits = <15>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xe8000 0x1000>; + interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + clocks = <&pclk32m>; + }; + + i2c23: i2c@ed000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi23: spi@ed000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart23: uart@ed000 { + compatible = "nordic,nrf-uarte"; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c24: i2c@ee000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi24: spi@ee000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart24: uart@ee000 { + compatible = "nordic,nrf-uarte"; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <5>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@51c { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x51c 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@520 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x520 0x1>; + status = "disabled"; + }; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1972)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + + cpuflpr_rram: rram@1ed000 { + compatible = "soc-nv-flash"; + reg = <0x1ed000 DT_SIZE_K(64)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index bbd9e135e3d7..4dea8277169f 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -253,9 +253,11 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/samples/bluetooth/bap_broadcast_sink/sample.yaml b/samples/bluetooth/bap_broadcast_sink/sample.yaml index e6739dc10242..3eb1acd40762 100644 --- a/samples/bluetooth/bap_broadcast_sink/sample.yaml +++ b/samples/bluetooth/bap_broadcast_sink/sample.yaml @@ -25,5 +25,7 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake index f030ce94ef20..f969f05ecffd 100644 --- a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_broadcast_source/sample.yaml b/samples/bluetooth/bap_broadcast_source/sample.yaml index 5e5b01d942d0..5f745cd08950 100644 --- a/samples/bluetooth/bap_broadcast_source/sample.yaml +++ b/samples/bluetooth/bap_broadcast_source/sample.yaml @@ -36,5 +36,7 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_client/sample.yaml b/samples/bluetooth/bap_unicast_client/sample.yaml index 7283090b8781..44f32934ce99 100644 --- a/samples/bluetooth/bap_unicast_client/sample.yaml +++ b/samples/bluetooth/bap_unicast_client/sample.yaml @@ -22,5 +22,7 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_client/sysbuild.cmake b/samples/bluetooth/bap_unicast_client/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/bap_unicast_client/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_client/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_server/sample.yaml b/samples/bluetooth/bap_unicast_server/sample.yaml index 068f752b626b..266ced73f66d 100644 --- a/samples/bluetooth/bap_unicast_server/sample.yaml +++ b/samples/bluetooth/bap_unicast_server/sample.yaml @@ -22,5 +22,7 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_server/sysbuild.cmake b/samples/bluetooth/bap_unicast_server/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/bap_unicast_server/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_server/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index 1cbfc7da36f7..fe90b5952f92 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -21,7 +21,9 @@ tests: - ophelia4ev/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp sample.bluetooth.beacon-coex: - extra_args: CONF_FILE="prj-coex.conf" + extra_args: + - CONF_FILE="prj-coex.conf" + - SNIPPET="bt-ll-sw-split" harness: bluetooth platform_allow: - nrf52840dk/nrf52840 diff --git a/samples/bluetooth/cap_acceptor/sample.yaml b/samples/bluetooth/cap_acceptor/sample.yaml index 824e744eecaf..9061f44679fb 100644 --- a/samples/bluetooth/cap_acceptor/sample.yaml +++ b/samples/bluetooth/cap_acceptor/sample.yaml @@ -26,5 +26,7 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/cap_acceptor/sysbuild.cmake b/samples/bluetooth/cap_acceptor/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/cap_acceptor/sysbuild.cmake +++ b/samples/bluetooth/cap_acceptor/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/cap_initiator/sample.yaml b/samples/bluetooth/cap_initiator/sample.yaml index b4f593c99129..e3e557f48301 100644 --- a/samples/bluetooth/cap_initiator/sample.yaml +++ b/samples/bluetooth/cap_initiator/sample.yaml @@ -26,5 +26,7 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/cap_initiator/sysbuild.cmake b/samples/bluetooth/cap_initiator/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/cap_initiator/sysbuild.cmake +++ b/samples/bluetooth/cap_initiator/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index b7a118e6cdc8..ffdf634c6e3e 100644 --- a/samples/bluetooth/direction_finding_central/sample.yaml +++ b/samples/bluetooth/direction_finding_central/sample.yaml @@ -14,15 +14,24 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.central.aod: + sample.bluetooth.direction_finding.central.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aod.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aod.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding.central.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aod.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml index 8e6097de58ae..c500cc80dcec 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml @@ -12,14 +12,22 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless_rx.aod: + sample.bluetooth.direction_finding_connectionless_rx.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aod.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aod.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless_rx.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aod.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 78d21b2c95f5..2a4fa93d19d5 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -12,14 +12,22 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless.aoa: + sample.bluetooth.direction_finding_connectionless.aoa_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aoa.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless.aoa_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_peripheral/sample.yaml b/samples/bluetooth/direction_finding_peripheral/sample.yaml index f300cb415cc5..01f612ad08a0 100644 --- a/samples/bluetooth/direction_finding_peripheral/sample.yaml +++ b/samples/bluetooth/direction_finding_peripheral/sample.yaml @@ -14,15 +14,24 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.peripheral.aod: + sample.bluetooth.direction_finding.peripheral.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aoa.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding.peripheral.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/hci_ipc/sample.yaml b/samples/bluetooth/hci_ipc/sample.yaml index b758b2547688..3763478b6b33 100644 --- a/samples/bluetooth/hci_ipc/sample.yaml +++ b/samples/bluetooth/hci_ipc/sample.yaml @@ -15,7 +15,9 @@ tests: sample.bluetooth.hci_ipc.iso_broadcast.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -25,7 +27,9 @@ tests: sample.bluetooth.hci_ipc.iso_receive.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -35,7 +39,9 @@ tests: sample.bluetooth.hci_ipc.bis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -45,7 +51,9 @@ tests: sample.bluetooth.hci_ipc.iso_central.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -55,7 +63,9 @@ tests: sample.bluetooth.hci_ipc.iso_peripheral.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -65,7 +75,9 @@ tests: sample.bluetooth.hci_ipc.cis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -75,7 +87,9 @@ tests: sample.bluetooth.hci_ipc.iso.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -99,6 +113,7 @@ tests: extra_args: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet @@ -109,13 +124,16 @@ tests: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - CONFIG_BT_CTLR_PHY_CODED=n + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet sample.bluetooth.hci_ipc.mesh.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet diff --git a/samples/bluetooth/hci_uart/sample.yaml b/samples/bluetooth/hci_uart/sample.yaml index df2b40135c67..8555c65cf0df 100644 --- a/samples/bluetooth/hci_uart/sample.yaml +++ b/samples/bluetooth/hci_uart/sample.yaml @@ -24,7 +24,9 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -33,7 +35,9 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -44,7 +48,9 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -54,7 +60,9 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df.iq_report: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -88,6 +96,7 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth @@ -99,6 +108,7 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf54l15dk_nrf54l15_cpuapp_df.overlay + - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth diff --git a/samples/bluetooth/hci_vs_scan_req/sample.yaml b/samples/bluetooth/hci_vs_scan_req/sample.yaml index 245a83aa0d96..49526522d16e 100644 --- a/samples/bluetooth/hci_vs_scan_req/sample.yaml +++ b/samples/bluetooth/hci_vs_scan_req/sample.yaml @@ -9,4 +9,6 @@ tests: - nrf52dk/nrf52832 extra_configs: - CONFIG_BT_LL_SW_SPLIT=y + extra_args: + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/iso_central/sample.yaml b/samples/bluetooth/iso_central/sample.yaml index 3a7dedd404ae..57254ee809ab 100644 --- a/samples/bluetooth/iso_central/sample.yaml +++ b/samples/bluetooth/iso_central/sample.yaml @@ -11,11 +11,11 @@ tests: sample.bluetooth.iso_central.bt_ll_sw_split: harness: bluetooth platform_allow: - - qemu_cortex_m3 - - qemu_x86 - nrf52_bsim - nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml index d7c816ee5b76..901d40b00d4f 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml @@ -23,5 +23,7 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml index 80c907042119..1d2e31306e29 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml @@ -23,5 +23,7 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake index f0aa34b7ad4a..fa62c31f7b3b 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake @@ -18,6 +18,10 @@ if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay index 04bf83ef44d4..a57a0e82ba6e 100644 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay +++ b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay @@ -2,6 +2,10 @@ status = "okay"; }; +&bt_hci_sdc { + status = "disabled"; +}; + / { chosen { zephyr,bt-hci = &bt_hci_controller; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 9ff7e9007285..37c6b29a0582 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -62,7 +62,7 @@ static struct { /* FIXME: This could probably use a chosen entropy device instead on relying on * the nodelabel being the same as for the old nrf rng. */ -static const struct device *const dev_entropy = DEVICE_DT_GET(DT_NODELABEL(rng)); +static const struct device *const dev_entropy = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy)); #endif /* CONFIG_ENTROPY_HAS_DRIVER */ static int init_reset(void); diff --git a/tests/bluetooth/controller/ctrl_api/testcase.yaml b/tests/bluetooth/controller/ctrl_api/testcase.yaml index 19bf6c9ab490..21f178bf9b2b 100644 --- a/tests/bluetooth/controller/ctrl_api/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_api/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_api.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml index f7e8068d60ec..9c3ee6264335 100644 --- a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_chmu.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml index 99612a89bc31..2371d7063eb7 100644 --- a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cis_create.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml index 956172a89b20..a98229ba45f3 100644 --- a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cis_terminate.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_collision/testcase.yaml b/tests/bluetooth/controller/ctrl_collision/testcase.yaml index 6086a9a4ebc8..daa8f3bc6c3d 100644 --- a/tests/bluetooth/controller/ctrl_collision/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_collision/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_collision.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml index 5b0bda4b9088..fc4ecb0b647d 100644 --- a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml @@ -7,11 +7,18 @@ common: tests: bluetooth.controller.ctrl_conn_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_conn_update.apm_test: type: unit - extra_args: CONF_FILE=prj_apm.conf + extra_args: + - CONF_FILE=prj_apm.conf + - SNIPPET="bt-ll-sw-split" + bluetooth.controller.ctrl_conn_update.no_param_req_test: type: unit - extra_args: CONF_FILE=prj_no_param_req.conf + extra_args: + - CONF_FILE=prj_no_param_req.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml index fd6ff51118d9..c6288aecc433 100644 --- a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cte_req.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml index 9778af435b4a..c7d1174e12bf 100644 --- a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml @@ -6,11 +6,17 @@ common: tests: bluetooth.controller.ctrl_data_length_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nocodedphy: type: unit - extra_args: CONF_FILE=prj_nocoded.conf + extra_args: + - CONF_FILE=prj_nocoded.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nophy: type: unit - extra_args: CONF_FILE=prj_nophy.conf + extra_args: + - CONF_FILE=prj_nophy.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml index d5bb2cb8b110..86dd5bfe4d30 100644 --- a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_encrypt.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml index 257542f36120..087e49575ff7 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_feature_exchange.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_hci/testcase.yaml b/tests/bluetooth/controller/ctrl_hci/testcase.yaml index d7f7ce7168d1..e0735bae6962 100644 --- a/tests/bluetooth/controller/ctrl_hci/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_hci/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_hci.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml index 2d1741931e37..cee54e6b09ed 100644 --- a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_invalid.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml index b6a77528f32d..54178905da17 100644 --- a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_le_ping.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml index 0991b0cdd43c..a9445cbf8c4d 100644 --- a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_min_used_chans.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml index 1d7da169f1d8..d5c49d587a8f 100644 --- a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml @@ -6,6 +6,10 @@ common: tests: bluetooth.controller.ctrl_phy_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_phy_update.test_reduced_buf: type: unit - extra_args: CONF_FILE=prj_rx_cnt.conf + extra_args: + - CONF_FILE=prj_rx_cnt.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml index cbf63aa1b575..cbc3c3faf720 100644 --- a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_sca_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml index 778606d69549..ac5dd6e957eb 100644 --- a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml @@ -4,3 +4,5 @@ common: tests: bluetooth.ctrl_sw_privacy.test: platform_allow: nrf52_bsim + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml index cbe639401ea3..6b1409e9653e 100644 --- a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_terminate.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml index 614eb7fe94c0..363986bd3d35 100644 --- a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml @@ -6,23 +6,35 @@ common: tests: bluetooth.controller.ctrl_tx_buffer_alloc.test_0_per_conn: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_1_per_conn: type: unit - extra_args: CONF_FILE=prj_1.conf + extra_args: + - CONF_FILE=prj_1.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_2_per_conn: type: unit - extra_args: CONF_FILE=prj_2.conf + extra_args: + - CONF_FILE=prj_2.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_3_per_conn: type: unit - extra_args: CONF_FILE=prj_3.conf + extra_args: + - CONF_FILE=prj_3.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_max_per_conn_alloc: type: unit - extra_args: CONF_FILE=prj_max.conf + extra_args: + - CONF_FILE=prj_max.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_max_common_alloc: type: unit - extra_args: CONF_FILE=prj_max_common.conf + extra_args: + - CONF_FILE=prj_max_common.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml index 295ad891a630..282b620b317a 100644 --- a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml @@ -5,3 +5,5 @@ common: tests: bluetooth.ctrl_tx_queue.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml index 28aba1a752a8..48b18af93536 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml @@ -6,7 +6,11 @@ common: tests: bluetooth.controller.ctrl_unsupported.default.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_unsupported.test: type: unit - extra_args: CONF_FILE=prj_unsupported.conf + extra_args: + - CONF_FILE=prj_unsupported.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml index af319a7a7191..be963df24a8a 100644 --- a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml @@ -4,3 +4,5 @@ common: tests: bluetooth.ctrl_user_ext.test: platform_allow: nrf52_bsim + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_version/testcase.yaml b/tests/bluetooth/controller/ctrl_version/testcase.yaml index 6badcbc72547..5df86b9bca9f 100644 --- a/tests/bluetooth/controller/ctrl_version/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_version/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_version.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_req/testcase.yaml b/tests/bluetooth/df/connection_cte_req/testcase.yaml index 768aba4a51f5..fbfe4b0d9a1a 100644 --- a/tests/bluetooth/df/connection_cte_req/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_req/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.conection_cte_req: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml index 38a23b0950e3..a9986c5b0e53 100644 --- a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.conection_cte_tx_params: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml index 6aa5bb0f0c1c..844a7bbb524e 100644 --- a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_chains: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml index f839b1910eb2..c8f08a908436 100644 --- a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_rx: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml index 77d651d0cbc2..491cc0e7e599 100644 --- a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_tx: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/init/testcase.yaml b/tests/bluetooth/init/testcase.yaml index 120b6a3d81bd..bbefd93265c1 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -62,7 +62,9 @@ tests: extra_args: CONF_FILE=prj_6.conf platform_allow: qemu_cortex_m3 bluetooth.init.test_ctlr: - extra_args: CONF_FILE=prj_ctlr.conf + extra_args: + - CONF_FILE=prj_ctlr.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -74,7 +76,9 @@ tests: - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_4_0: - extra_args: CONF_FILE=prj_ctlr_4_0.conf + extra_args: + - CONF_FILE=prj_ctlr_4_0.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -83,7 +87,9 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_4_0_dbg: - extra_args: CONF_FILE=prj_ctlr_4_0_dbg.conf + extra_args: + - CONF_FILE=prj_ctlr_4_0_dbg.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -92,7 +98,9 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_tiny: - extra_args: CONF_FILE=prj_ctlr_tiny.conf + extra_args: + - CONF_FILE=prj_ctlr_tiny.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -104,6 +112,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -114,6 +123,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr_5_x_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -125,6 +135,7 @@ tests: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_CTLR_ADVANCED_FEATURES=y - CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf52840dk/nrf52840 @@ -134,13 +145,16 @@ tests: bluetooth.init.test_ctlr_ticker: extra_args: - CONF_FILE=prj_ctlr_ticker.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_broadcaster: - extra_args: CONF_FILE=prj_ctlr_broadcaster.conf + extra_args: + - CONF_FILE=prj_ctlr_broadcaster.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -149,7 +163,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral: - extra_args: CONF_FILE=prj_ctlr_peripheral.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -158,7 +174,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral_priv: - extra_args: CONF_FILE=prj_ctlr_peripheral_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -167,7 +185,9 @@ tests: integration_platforms: - nrf52840dk/nrf52840 bluetooth.init.test_ctlr_observer: - extra_args: CONF_FILE=prj_ctlr_observer.conf + extra_args: + - CONF_FILE=prj_ctlr_observer.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -176,7 +196,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_central: - extra_args: CONF_FILE=prj_ctlr_central.conf + extra_args: + - CONF_FILE=prj_ctlr_central.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -186,7 +208,9 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_central_priv: - extra_args: CONF_FILE=prj_ctlr_central_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_central_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -196,7 +220,9 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_broadcaster_ext: - extra_args: CONF_FILE=prj_ctlr_broadcaster_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_broadcaster_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -205,7 +231,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext: - extra_args: CONF_FILE=prj_ctlr_peripheral_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -214,7 +242,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext_priv: - extra_args: CONF_FILE=prj_ctlr_peripheral_ext_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_ext_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -223,7 +253,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_oberver_ext: - extra_args: CONF_FILE=prj_ctlr_observer_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_observer_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -232,7 +264,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext: - extra_args: CONF_FILE=prj_ctlr_central_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_central_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -241,7 +275,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext_priv: - extra_args: CONF_FILE=prj_ctlr_central_ext_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_central_ext_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -250,7 +286,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv: - extra_args: CONF_FILE=prj_ctlr_per_adv.conf + extra_args: + - CONF_FILE=prj_ctlr_per_adv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -259,7 +297,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv_no_adi: - extra_args: CONF_FILE=prj_ctlr_per_adv_no_adi.conf + extra_args: + - CONF_FILE=prj_ctlr_per_adv_no_adi.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -268,7 +308,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync: - extra_args: CONF_FILE=prj_ctlr_per_sync.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -277,7 +319,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_adi: - extra_args: CONF_FILE=prj_ctlr_per_sync_no_adi.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync_no_adi.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -286,7 +330,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_filter: - extra_args: CONF_FILE=prj_ctlr_per_sync_no_filter.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync_no_filter.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -295,7 +341,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_iso: - extra_args: CONF_FILE=prj_ctlr_peripheral_iso.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_iso.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -304,7 +352,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_iso: - extra_args: CONF_FILE=prj_ctlr_central_iso.conf + extra_args: + - CONF_FILE=prj_ctlr_central_iso.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -323,7 +373,9 @@ tests: - DTC_OVERLAY_FILE=h5.overlay platform_allow: qemu_cortex_m3 bluetooth.init.test_llcp: - extra_args: CONF_FILE=prj_llcp.conf + extra_args: + - CONF_FILE=prj_llcp.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -335,6 +387,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_RECV_WORKQ_BT=y + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 bluetooth.init.test_host_6_x: From 30cd6282e2016ce77738427809249fe963d76273 Mon Sep 17 00:00:00 2001 From: alperen sener Date: Fri, 24 Oct 2025 15:25:55 +0200 Subject: [PATCH 1619/3334] [nrf noup] tests: bluetooth: tester: Remove deprecated configs Removing the deprecated kconfigs for nrf54h20 target. Signed-off-by: alperen sener (cherry picked from commit 6aca382718d00391c234d2e4a5eed3886e7c7d7d) --- tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 51b0ef5fa8d4..0f16f6ea7b4c 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -26,6 +26,5 @@ CONFIG_UART_INTERRUPT_DRIVEN=y # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf index b7d64a9e6a08..24e3d84ecf96 100644 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -35,6 +35,5 @@ CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y From b9d5d9f655bfb8ca7438af16d0e9111043639222 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Thu, 5 Sep 2024 10:41:36 +0200 Subject: [PATCH 1620/3334] [nrf noup] boards: nordic: Enable PSA RNG for nrf54h20 Noup since Ironside not available upstream and it is required for PSA RNG. This enables the PSA RNG as the default Zephyr entropy provider for the nrf54h20dk cpuapp and cpurad targets. Signed-off-by: Georgios Vasilakis Signed-off-by: Sergey Korotkov (cherry picked from commit 8f80253e7ad61207e91412fad4f830cdc1e4288f) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 6 ++++++ boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index da4dbf236406..42ab67eda189 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -27,6 +27,7 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; + zephyr,entropy = &psa_rng; }; aliases { @@ -111,6 +112,11 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_bellboard { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index cf88e536d43c..0c46f46b7249 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -28,12 +28,18 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpurad_bellboard { From 8e1b36318165056872f2e7719ef29bc9fa45e5aa Mon Sep 17 00:00:00 2001 From: Sergey Korotkov Date: Fri, 31 Oct 2025 13:02:15 +0100 Subject: [PATCH 1621/3334] [nrf noup] boards: nordic: Enable PSA RNG for nrf9280 Noup since Ironside not available upstream and it is required for PSA RNG. This enables the PSA RNG as the default Zephyr entropy provider for the nrf9280pdk cpuapp and cpurad targets. Signed-off-by: Sergey Korotkov (cherry picked from commit 0d220f23e4eb1c5e9e306879b0b42502b5c148be) --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 6 ++++++ boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index ee8588622a52..12ef4b4bb828 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -27,6 +27,7 @@ zephyr,uart-mcumgr = &uart136; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { @@ -108,6 +109,11 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_ram0x_region { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index 45fd620c37a1..17c482e7865c 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -29,12 +29,18 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_cpurad_ram0x_region { From f1d901d629baa1d1bb58d8772425f59e9a403fc7 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Wed, 5 Nov 2025 14:16:33 +0100 Subject: [PATCH 1622/3334] [nrf noup] ci: Extend test spec for CI-ble-test We want to run CI when Nordic specific arch, soc, or board changes are done. Running CI on such changes would have prevented that https://github.com/nrfconnect/sdk-nrf/pull/25230 broke this CI plan. Signed-off-by: Rubin Gerritsen (cherry picked from commit 2b643c4531d760220a27d9cebb1296b502afcc65) --- .github/test-spec.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 76def875e0be..5fdf9c0ca782 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -86,6 +86,8 @@ - "samples/tfm_integration/**/*" "CI-ble-test": + - any: + - "arch/arm/**/*" - any: - "drivers/bluetooth/**/*" - any: @@ -97,7 +99,12 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/hci_ipc/**/*" + - any: + - "boards/nordic/nrf5*" + - any: + - "soc/nordic/**/*" + - any: + - "subsys/pm/**/*" "CI-ble-samples-test": - any: From 4c7aba3df46ce8b5755d56643e2fe59373542c26 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 6 Nov 2025 12:51:08 +0100 Subject: [PATCH 1623/3334] [nrf noup] tests: drivers: mspi: flash: disable psa_rng Not needed for this test and prevents from building with CONFIG_MULTITHREADING=n. Changes for h20 rad are similar, but needed to test cases filtering working only. Signed-off-by: Piotr Kosycarz (cherry picked from commit e471dafe200d726897d7573d76b4e91204130e9f) --- .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 ++++ .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 + .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 6e0d84e07cdb..2e6b6cf5eacc 100644 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -8,6 +8,10 @@ aliases { mspi0 = &exmif; }; + + psa_rng: psa-rng { + status = "disabled"; + }; }; &gpio6 { diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..a026df97a458 --- /dev/null +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +CONFIG_PM=n diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..09b4edc100a4 --- /dev/null +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,5 @@ +/ { + psa_rng: psa-rng { + status = "disabled"; + }; +}; From 258c7573e918d2602ab20ee78fb64d4f04240a8d Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 8 Apr 2025 10:16:33 +0100 Subject: [PATCH 1624/3334] [nrf noup] mgmt: mcumgr: Fix nRF5340 network core hook Fixes an issue whereby just enabling hooks would enable the nrf5340 network core hook despite lacking other requirements Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 6d5efe3b80df4e7caf632647841d8ea4cc25881e) --- subsys/mgmt/mcumgr/CMakeLists.txt | 13 +++++++------ subsys/mgmt/mcumgr/Kconfig | 2 +- subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 15 +++------------ subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 ++++++++ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index ad088eca0677..3bb21e16f798 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -17,10 +17,11 @@ add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) -if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +if(CONFIG_MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 5a7314ad57ed..be48e2f4fb7e 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,7 @@ menuconfig MCUMGR bool "MCUmgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) + imply BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP && MCUMGR_GRP_IMG && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 help This option enables the MCUmgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c index f1ac8a168e65..b372ce4e4945 100644 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -8,19 +8,10 @@ #include #include "bootutil/bootutil_public.h" -#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 -/* Sysbuild */ -#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER -#else -/* Legacy child/parent */ -#define NET_CORE_IMAGE 1 -#endif - -int boot_read_swap_state_primary_slot_hook(int image_index, - struct boot_swap_state *state) +int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state) { - if (image_index == NET_CORE_IMAGE) { - /* Pretend that primary slot of image 1 unpopulated */ + if (image_index == CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER) { + /* Pretend that primary slot of the network core update image is unpopulated */ state->magic = BOOT_MAGIC_UNSET; state->swap_type = BOOT_SWAP_TYPE_NONE; state->image_num = image_index; diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index ca5362f1fd68..b3a7410d6408 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -231,6 +231,14 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS This will enable the slot info function hooks which can be used to add additional information to responses. +config MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK + bool "nRF5340 network core bootutil hook" + depends on SOC_NRF5340_CPUAPP && BOOT_IMAGE_ACCESS_HOOKS && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 + default y + help + This option will enable a bootutil hook that populates the network core update image + slot with dummy data to allow for uploading a firmware update to the network core. + module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" From 93d8bf56fc746116ad6075e6ce2df76cb91b70d6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Thu, 6 Nov 2025 20:37:33 +0100 Subject: [PATCH 1625/3334] [nrf noup] drivers: can: mcan: implement CAN_MODE_ONE_SHOT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement CAN_MODE_ONE_SHOT in MCAN impementation. The implementation contains a workaround for a bug in the MCAN IP which prevents an IRQ from triggering. This is a noup as the workaround is too complicated and the feature is too niche to be accepted it upstream. Signed-off-by: Bjarki Arge Andreasen Signed-off-by: Tomasz Moń (cherry picked from commit efadad5f9c1cca4ccfb6903cca8897558f1b1e2e) --- drivers/can/Kconfig.mcan | 15 ++++ drivers/can/can_mcan.c | 114 +++++++++++++++++++++++++- include/zephyr/drivers/can/can_mcan.h | 1 + 3 files changed, 128 insertions(+), 2 deletions(-) diff --git a/drivers/can/Kconfig.mcan b/drivers/can/Kconfig.mcan index db09fc800c11..96c5f22446f6 100644 --- a/drivers/can/Kconfig.mcan +++ b/drivers/can/Kconfig.mcan @@ -7,3 +7,18 @@ config CAN_MCAN bool help Enable the Bosch M_CAN CAN IP module driver backend. + +if CAN_MCAN + +config CAN_MCAN_TXBCF_POLL_INTERVAL_MS + int "Polling interval in milliseconds of TXBCF register if DAR is enabled" + default 75 + help + When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, + is enabled, and a transmission fails, a bug in the MCAN IP prevents the + TCF (Transmission Cancellation Finalized) interrupt from triggering, + despite the correct bit being set in the TXBCF register. It is thus + necessary to poll TXBCF register to detect when a transmission failed if + DAR is enabled. + +endif # CAN_MCAN diff --git a/drivers/can/can_mcan.c b/drivers/can/can_mcan.c index 513daad82199..351423d16ac5 100644 --- a/drivers/can/can_mcan.c +++ b/drivers/can/can_mcan.c @@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(can_mcan, CONFIG_CAN_LOG_LEVEL); #define CAN_INIT_TIMEOUT_MS 100 +#define TXBCF_TIMER_TIMEOUT K_MSEC(CONFIG_CAN_MCAN_TXBCF_POLL_INTERVAL_MS) int can_mcan_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) { @@ -276,7 +277,7 @@ int can_mcan_get_capabilities(const struct device *dev, can_mode_t *cap) { ARG_UNUSED(dev); - *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; + *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; if (IS_ENABLED(CONFIG_CAN_MANUAL_RECOVERY_MODE)) { *cap |= CAN_MODE_MANUAL_RECOVERY; @@ -322,12 +323,78 @@ int can_mcan_start(const struct device *dev) return err; } + uint32_t cccr; + + err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); + if (err != 0) { + return err; + } + + if (cccr & CAN_MCAN_CCCR_DAR) { + /* + * When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, + * is enabled, and a transmission fails, a bug in the MCAN IP prevents the + * TCF (Transmission Cancellation Finalized) interrupt from triggering, + * despite the correct bit being set in the TXBCF register. It is thus + * necessary to poll TXBCF register to detect when a transmission failed if + * DAR is enabled. + */ + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + data->common.started = true; pm_device_busy_set(dev); return err; } +static int can_mcan_read_txbcf(const struct device *dev) +{ + const struct can_mcan_config *config = dev->config; + const struct can_mcan_callbacks *cbs = config->callbacks; + struct can_mcan_data *data = dev->data; + uint32_t txbcfs; + int err; + can_tx_callback_t tx_cb; + void *user_data; + + err = can_mcan_read_reg(dev, CAN_MCAN_TXBCF, &txbcfs); + if (err != 0) { + LOG_ERR("failed to read tx cancellation finished (err %d)", err); + return err; + } + + if (txbcfs == 0) { + return 0; + } + + for (size_t tx_idx = 0; tx_idx < cbs->num_tx; tx_idx++) { + if ((txbcfs & BIT(tx_idx)) == 0) { + continue; + } + + if (cbs->tx[tx_idx].function == NULL) { + continue; + } + + tx_cb = cbs->tx[tx_idx].function; + user_data = cbs->tx[tx_idx].user_data; + cbs->tx[tx_idx].function = NULL; + LOG_DBG("tx buffer cancellation finished (idx %u)", tx_idx); + k_sem_give(&data->tx_sem); + tx_cb(dev, -EIO, user_data); + } + + return 0; +} + +static void can_mcan_txbcf_timer_handler(struct k_timer *timer_id) +{ + const struct device *dev = k_timer_user_data_get(timer_id); + + can_mcan_read_txbcf(dev); +} + static bool can_mcan_rx_filters_exist(const struct device *dev) { const struct can_mcan_config *config = dev->config; @@ -362,6 +429,8 @@ int can_mcan_stop(const struct device *dev) return -EALREADY; } + k_timer_stop(&data->txbcf_timer); + /* CAN transmissions are automatically stopped when entering init mode */ err = can_mcan_enter_init_mode(dev, K_MSEC(CAN_INIT_TIMEOUT_MS)); if (err != 0) { @@ -402,7 +471,7 @@ int can_mcan_stop(const struct device *dev) int can_mcan_set_mode(const struct device *dev, can_mode_t mode) { - can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; + can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; struct can_mcan_data *data = dev->data; uint32_t cccr; uint32_t test; @@ -460,6 +529,13 @@ int can_mcan_set_mode(const struct device *dev, can_mode_t mode) } #endif /* CONFIG_CAN_FD_MODE */ + if ((mode & CAN_MODE_ONE_SHOT) != 0) { + /* Disable Automatic Retransmission */ + cccr |= CAN_MCAN_CCCR_DAR; + } else { + cccr &= ~CAN_MCAN_CCCR_DAR; + } + err = can_mcan_write_reg(dev, CAN_MCAN_CCCR, cccr); if (err != 0) { goto unlock; @@ -1055,6 +1131,21 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim } } + uint32_t cccr; + + err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); + if (err != 0) { + return err; + } + + if (cccr & CAN_MCAN_CCCR_DAR) { + /* + * TXBCR is cleared after TXBAR is set. Stop timer to ensure + * TXBCR is not read before TXBAR has been set. + */ + k_timer_stop(&data->txbcf_timer); + } + cbs->tx[put_idx].function = callback; cbs->tx[put_idx].user_data = user_data; @@ -1064,10 +1155,18 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim goto err_unlock; } + if (cccr & CAN_MCAN_CCCR_DAR) { + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + k_mutex_unlock(&data->tx_mtx); return 0; err_unlock: + if (cccr & CAN_MCAN_CCCR_DAR) { + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + k_mutex_unlock(&data->tx_mtx); k_sem_give(&data->tx_sem); @@ -1420,6 +1519,8 @@ int can_mcan_init(const struct device *dev) k_mutex_init(&data->lock); k_mutex_init(&data->tx_mtx); k_sem_init(&data->tx_sem, cbs->num_tx, cbs->num_tx); + k_timer_init(&data->txbcf_timer, can_mcan_txbcf_timer_handler, NULL); + k_timer_user_data_set(&data->txbcf_timer, (void *)dev); if (config->common.phy != NULL && !device_is_ready(config->common.phy)) { LOG_ERR("CAN transceiver not ready"); @@ -1578,5 +1679,14 @@ int can_mcan_init(const struct device *dev) return err; } + /* + * Interrupt on every TX buffer cancellation finished event. + */ + reg = CAN_MCAN_TXBCIE_CFIE; + err = can_mcan_write_reg(dev, CAN_MCAN_TXBCIE, reg); + if (err != 0) { + return err; + } + return can_mcan_clear_mram(dev, 0, config->mram_size); } diff --git a/include/zephyr/drivers/can/can_mcan.h b/include/zephyr/drivers/can/can_mcan.h index c064cc87d0c1..c62b4009526c 100644 --- a/include/zephyr/drivers/can/can_mcan.h +++ b/include/zephyr/drivers/can/can_mcan.h @@ -1065,6 +1065,7 @@ struct can_mcan_data { struct k_mutex lock; struct k_sem tx_sem; struct k_mutex tx_mtx; + struct k_timer txbcf_timer; void *custom; } __aligned(4); From 206c0efa9be0b49e1ab7bffb09978da18368ba40 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 12 Sep 2025 12:38:25 +0200 Subject: [PATCH 1626/3334] [nrf noup] tests: ram_context_for_isr: Disable KMU by default Disable the KMU by default for all the NRF54L and NRF71 devices for this test. With the current configuration this test is incompatible with the KMU because it changes the placement of the RAM in the linker files and this collides with the KMU logic. But it also does not need the KMU so there is no need to be there. This is a noup because the configuration (and KMU support) is only placed in ncs. Reverted and reapplied noup to maintain all changes in a single commit. The KMU dependency to reserve the top RAM address is planned to be done in dts (NCSDK-31980). Hopefully when this is done this noup can be removed. Signed-off-by: Georgios Vasilakis Signed-off-by: Robert Robinson (cherry picked from commit 8116dbcc6173ae9a1d6c526ec39f6c9b8c09de8d) --- .../boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ++++++ .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ++++++ .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ++++++ .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ++++++ .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ++++++ .../boards/nrf7120pdk_nrf7120_cpuapp.conf | 6 ++++++ 6 files changed, 36 insertions(+) create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n From 63e52b8a603485ca7d5cbaf6ec9633aa93001b5f Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 10 Jun 2025 23:20:32 +0200 Subject: [PATCH 1627/3334] [nrf noup] bluetooth: host: Add support for bonding with same peer This commit adds a new Kconfig option by enabling which Host will keep bonding with the same Central instead of rejecting pairing. Brief implementation details: This implementation adds a new flag to bt_keys struct: BT_KEYS_ID_CONFLICT. The flag is set, when: - bonding with the same peer and conflict identified - when loading conflicting keys from persistent storage. When bonding and conflict is identified, the new keys aren't added to the Resolving List immediately. Instead, the old keys stay in the Resolving List. When start advertising, Host finds conflicting keys that are already added to the Resolving List and substitues them. If, however, there is another advertiser already started for the added keys, the new request is reject and advertising start function returns -EPERM. This is supported by Peripheral role only for now. Allow to use CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS Kconfig option even if CONFIG_BT_PRIVACY is disabled. This is because CONFIG_BT_PRIVACY configures privacy of local device will still allows to resolve peer address. During pairing, peer device may send its Identity Address and IRK which then can be used for address resolution. This doesn't require CONFIG_BT_PRIVACY be enabled. Signed-off-by: Pavel Vasilyev (cherry picked from commit 71ebd2b14110f5d9fa3cd23873df0d25c276611b) --- include/zephyr/bluetooth/bluetooth.h | 10 ++ subsys/bluetooth/host/Kconfig | 18 +++ subsys/bluetooth/host/adv.c | 52 +++++++ subsys/bluetooth/host/adv.h | 1 + subsys/bluetooth/host/hci_core.h | 23 ++- subsys/bluetooth/host/id.c | 219 ++++++++++++++++++++++++--- subsys/bluetooth/host/id.h | 23 +++ subsys/bluetooth/host/keys.c | 79 +++++++++- subsys/bluetooth/host/keys.h | 6 + subsys/bluetooth/host/smp.c | 18 ++- tests/bluetooth/host/id/mocks/adv.c | 1 + tests/bluetooth/host/id/mocks/adv.h | 4 +- tests/bluetooth/host/id/mocks/keys.c | 1 + tests/bluetooth/host/id/mocks/keys.h | 4 +- 14 files changed, 427 insertions(+), 32 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 82d1a08e0dc6..bd7f58ae7397 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1295,6 +1295,10 @@ struct bt_le_per_adv_param { * This error code is only guaranteed when using Zephyr * controller, for other controllers code returned in * this case may be -EIO. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_adv_start(const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, @@ -1422,6 +1426,12 @@ struct bt_le_ext_adv_start_param { * * @param adv Advertising set object. * @param param Advertise start parameters. + * + * @return Zero on success or (negative) error code otherwise. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, const struct bt_le_ext_adv_start_param *param); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index ea8b2f79e558..9d398c560db0 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -726,6 +726,24 @@ config BT_ID_UNPAIR_MATCHING_BONDS link-layer. The Host does not have control over this acknowledgment, and the order of distribution is fixed by the specification. +config BT_ID_AUTO_SWAP_MATCHING_BONDS + bool "Automatically swap conflicting entries in the Resolving List" + depends on !BT_ID_UNPAIR_MATCHING_BONDS + depends on BT_SMP && BT_PERIPHERAL && !BT_CENTRAL + help + If this option is enabled, the Host will not add a new bond with + the same peer address (or IRK) to the Resolving List if there is + already a bond with the same peer address (or IRK) on another local + identity. + + In case of Peripheral, the Host will swap the existing entry in the + Resolving List with the new one, so that the new bond will be used for + address resolution for the new local identity if the device starts + advertising with the new local identity. + + Important: this option is supported exclusively in the Peripheral + role. Excluding the Central role. + config BT_ID_ALLOW_UNAUTH_OVERWRITE bool "Allow unauthenticated pairing with same peer with other local identity" depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 1a8c94aba30f..4c8ed649fa91 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -234,6 +234,25 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) #endif /* CONFIG_BT_BROADCASTER */ #endif /* defined(CONFIG_BT_EXT_ADV) */ +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id) +{ +#if defined(CONFIG_BT_EXT_ADV) + for (size_t i = 0; i < ARRAY_SIZE(adv_pool); i++) { + if (atomic_test_bit(adv_pool[i].flags, BT_ADV_CREATED) && + adv_pool[i].id == id) { + return &adv_pool[i]; + } + } +#else + if (atomic_test_bit(bt_dev.adv.flags, BT_ADV_CREATED) && bt_dev.adv.id == id) { + return &bt_dev.adv; + } +#endif + + return NULL; +} + + void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), void *data) { @@ -929,6 +948,14 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, adv->id = param->id; bt_dev.adv_conn_id = adv->id; + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = bt_id_set_adv_own_addr(adv, param->options, dir_adv, &set_param.own_addr_type); if (err) { @@ -1212,6 +1239,15 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } adv->id = param->id; + + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = le_ext_adv_param_set(adv, param, sd != NULL); if (err) { return err; @@ -1499,6 +1535,22 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, return -EALREADY; } + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + const bt_addr_le_t *peer; + + if (bt_addr_le_eq(&adv->target_addr, BT_ADDR_LE_ANY)) { + peer = NULL; + } else { + peer = &adv->target_addr; + } + + err = bt_id_resolving_list_check_and_update(adv->id, peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index 6cc950fe8e7f..a6f7007f64b4 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -23,3 +23,4 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable); int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv); void bt_adv_reset_adv_pool(void); +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index b9434e88c12a..dacc51d20fa2 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -497,7 +497,28 @@ struct bt_keys; void bt_id_add(struct bt_keys *keys); void bt_id_del(struct bt_keys *keys); -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate); +/** @brief Find a conflict in the resolving list for a candidate IRK. + * + * @param candidate The candidate keys to check for conflicts. + * @param all If true, check all IRKs, otherwise check only added keys. + * + * @return The conflicting key if there is one, or NULL if no conflict was found. + */ +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool all); + +/** * @brief Find multiple conflicts in the resolving list for a candidate IRK. + * + * This function iterates over all keys (added and not added to the Resolving List). If there are + * multiple conflicts, this function will return true. Otherwise, it will return false. + * + * If @c firt_conflict is not NULL, it will be set to the first found conflict. + * + * @param candidate The candidate key to check for conflicts. + * @param first_conflict Pointer to store the first found conflict, if any. Can be NULL. + * + * @return True if there are multiple conflicts, otherwise it returns false. + */ +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict); int bt_setup_random_id_addr(void); int bt_setup_public_id_addr(void); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 0ed84dff7331..4c54460ab4df 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -941,9 +941,33 @@ void bt_id_pending_keys_update(void) } } +static bool keys_conflict_check(const struct bt_keys *candidate, const struct bt_keys *resident) +{ + bool addr_conflict; + bool irk_conflict; + + addr_conflict = bt_addr_le_eq(&candidate->addr, &resident->addr); + + /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ + irk_conflict = (!bt_irk_eq(&candidate->irk, &(struct bt_irk){}) && + bt_irk_eq(&candidate->irk, &resident->irk)); + + if (addr_conflict || irk_conflict) { + LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&candidate->addr), + bt_hex(candidate->irk.val, sizeof(candidate->irk.val))); + + return true; + } + + return false; +} + struct bt_id_conflict { struct bt_keys *candidate; struct bt_keys *found; + bool check_all_irk; }; /* The Controller Resolve List is constrained by 7.8.38 "LE Add Device To @@ -955,8 +979,6 @@ struct bt_id_conflict { static void find_rl_conflict(struct bt_keys *resident, void *user_data) { struct bt_id_conflict *conflict = user_data; - bool addr_conflict; - bool irk_conflict; __ASSERT_NO_MSG(conflict != NULL); __ASSERT_NO_MSG(conflict->candidate != NULL); @@ -969,32 +991,26 @@ static void find_rl_conflict(struct bt_keys *resident, void *user_data) } /* Test against committed bonds only. */ - if ((resident->state & BT_KEYS_ID_ADDED) == 0) { + if (!conflict->check_all_irk && (resident->state & BT_KEYS_ID_ADDED) == 0) { + /* If the resident bond is not committed, we cannot have a conflict. */ return; } - addr_conflict = bt_addr_le_eq(&conflict->candidate->addr, &resident->addr); - - /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ - irk_conflict = (!bt_irk_eq(&conflict->candidate->irk, &(struct bt_irk){}) && - bt_irk_eq(&conflict->candidate->irk, &resident->irk)); - - if (addr_conflict || irk_conflict) { - LOG_DBG("Resident : addr %s and IRK %s, id: %d", bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val)), resident->id); - LOG_DBG("Candidate: addr %s and IRK %s, id: %d", - bt_addr_le_str(&conflict->candidate->addr), - bt_hex(conflict->candidate->irk.val, sizeof(conflict->candidate->irk.val)), - conflict->candidate->id); + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + if (keys_conflict_check(conflict->candidate, resident)) { conflict->found = resident; } } -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_irk) { struct bt_id_conflict conflict = { .candidate = candidate, + .check_all_irk = check_all_irk, }; bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict, &conflict); @@ -1002,6 +1018,59 @@ struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) return conflict.found; } +struct bt_id_conflict_multiple { + struct bt_keys *candidate; + struct bt_keys *found; + bool found_multiple; +}; + +void find_rl_conflict_multiple(struct bt_keys *resident, void *user_data) +{ + struct bt_id_conflict_multiple *conflict = user_data; + + __ASSERT_NO_MSG(conflict != NULL); + __ASSERT_NO_MSG(conflict->candidate != NULL); + __ASSERT_NO_MSG(resident != NULL); + + if (conflict->found_multiple) { + /* If we already found enough conflicts, we can stop searching. */ + return; + } + + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + + if (keys_conflict_check(conflict->candidate, resident)) { + if (conflict->found) { + conflict->found_multiple = true; + + LOG_WRN("Found multiple conflicts for %s: addr %s and IRK %s", + bt_addr_le_str(&conflict->candidate->addr), + bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + } else { + conflict->found = resident; + } + } +} + +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict) +{ + struct bt_id_conflict_multiple conflict = { + .candidate = candidate, + }; + + bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict_multiple, &conflict); + + if (first_conflict != NULL) { + *first_conflict = conflict.found; + } + + return conflict.found_multiple; +} + void bt_id_add(struct bt_keys *keys) { CHECKIF(keys == NULL) { @@ -1264,6 +1333,122 @@ void bt_id_del(struct bt_keys *keys) bt_le_ext_adv_foreach(adv_unpause_enabled, NULL); } } + +static int conflict_check_and_replace(uint8_t id, struct bt_keys *keys) +{ + /* For the given key check if it has conflicts with other keys in the Resolving List + * (such keys have BT_KEYS_ID_ADDED state and BT_KEYS_ID_CONFLICT flag set). If it does, we + * need to remove the conflicting key from the Resolving List and add the new key. + * + * If the key is not in the Resolving List, we can add the new key right away. + * + * If advertiser for the conflicting key is enabled, we cannot remove the key from the + * Resolving List, so we return an error. + */ + + struct bt_keys *conflict; + const struct bt_le_ext_adv *adv; + + if (!(keys->flags & BT_KEYS_ID_CONFLICT)) { + LOG_DBG("Key has no conflicts for id %u addr %s", id, bt_addr_le_str(&keys->addr)); + return 0; + } + + if (keys->state & BT_KEYS_ID_ADDED) { + LOG_DBG("Key is already added to resolving list for id %u addr %s", id, + bt_addr_le_str(&keys->addr)); + return 0; + } + + /* bt_id_find_conflict returns only keys added to the Resolving List (state is + * BT_KEYS_ID_ADDED). If the key has conflict, but no keys were added (for example, if the + * last added key was removed after bt_unpair()), then this function will return NULL. Then, + * we don't need to remove a conflicting key from the Resolving List. Otherwise, we need to + * remove the conflicting key from the Resolving List before adding the new key. + */ + conflict = bt_id_find_conflict(keys, false); + if (conflict != NULL) { + __ASSERT_NO_MSG((conflict->flags & BT_KEYS_ID_CONFLICT) != 0); + + LOG_DBG("Found conflicting key with id %u addr %s", conflict->id, + bt_addr_le_str(&conflict->addr)); + + adv = bt_adv_lookup_by_id(conflict->id); + if (adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { + LOG_WRN("Cannot remove the conflicting key from the Resolving List while" + " advertising"); + return -EPERM; + } + + /* Drop BT_KEYS_ID_PENDING_DEL flag if we were about to delete the keys since we + * delete it here. + */ + conflict->state &= ~BT_KEYS_ID_PENDING_DEL; + bt_id_del(conflict); + } + + bt_id_add(keys); + + return 0; +} + +struct bt_id_resolve { + uint8_t id; + int err; +}; + +static void check_and_add_keys_for_id(struct bt_keys *keys, void *data) +{ + struct bt_id_resolve *resolve = data; + + if (resolve->err) { + /* Skipping other keys because we got error. */ + return; + } + + if (resolve->id != keys->id) { + /* We are only interested in keys for the given id */ + return; + } + + resolve->err = conflict_check_and_replace(resolve->id, keys); +} + +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer) +{ + int err; + + if (peer == NULL) { + struct bt_id_resolve resolve = { + .id = id, + }; + + LOG_DBG("Updating resolving list for id %u without peer address", id); + + bt_keys_foreach_type(BT_KEYS_IRK, check_and_add_keys_for_id, &resolve); + err = resolve.err; + } else { + struct bt_keys *keys; + + LOG_DBG("Updating resolving list for id %u addr %s", id, bt_addr_le_str(peer)); + + keys = bt_keys_get_addr(id, peer); + if (!keys) { + LOG_DBG("No keys found for id %u addr %s", id, bt_addr_le_str(peer)); + return -ENOENT; + } + + err = conflict_check_and_replace(id, keys); + } + + if (err) { + LOG_ERR("Failed to update resolving list for id %u addr %s (err %d)", id, + peer ? bt_addr_le_str(peer) : "NULL", err); + return err; + } + + return err; +} #endif /* defined(CONFIG_BT_SMP) */ void bt_id_get(bt_addr_le_t *addrs, size_t *count) diff --git a/subsys/bluetooth/host/id.h b/subsys/bluetooth/host/id.h index 8824d3bb496b..cd66784a5037 100644 --- a/subsys/bluetooth/host/id.h +++ b/subsys/bluetooth/host/id.h @@ -60,3 +60,26 @@ void bt_id_pending_keys_update(void); void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag); void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv); + +/** + * @brief Check and update the resolving list for a given identity. + * + * This function checks if the resolving list contains the keys for the given + * identity and peer address. If the keys are not present, it adds them to the + * resolving list. If the keys are present, it checks for conflicts with + * existing keys in the resolving list. If a conflict is found, it replaces + * the conflicting key with the new key. + * + * If the peer address is NULL, it updates the resolving list for all keys that belong to the given + * identity. + * + * If for any of the keys belonging to the given identity a conflict is found and the advertiser for + * that key is enabled, the function returns an error. + * + * @param id The identity ID to check and update. + * @param peer The peer address to check against the resolving list. + * + * @return 0 on success, or a negative error code on failure. + * @return -EPERM if a conflict is found and the advertiser for the conflicting key is enabled. + */ +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer); diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index d7fc881eb81e..0f214687d3b6 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -324,16 +324,57 @@ void bt_keys_add_type(struct bt_keys *keys, enum bt_keys_type type) keys->keys |= type; } +static void add_id_cb(struct k_work *work) +{ + bt_id_pending_keys_update(); +} + +static K_WORK_DEFINE(add_id_work, add_id_cb); + void bt_keys_clear(struct bt_keys *keys) { + struct bt_keys *conflict = NULL; + __ASSERT_NO_MSG(keys != NULL); LOG_DBG("%s (keys 0x%04x)", bt_addr_le_str(&keys->addr), keys->keys); + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + (keys->flags & BT_KEYS_ID_CONFLICT) != 0) { + /* We need to check how many conflicting keys left. If there is only one conflicting + * key left, we can remove the BT_KEYS_ID_CONFLICT flag from it so that Host don't + * need to check and update the Resolving List whenever this is needed. The key + * should be re-added to the Resolving List. + */ + bool found_multiple; + + found_multiple = bt_id_find_conflict_multiple(keys, &conflict); + if (conflict) { + if (found_multiple || (conflict->state & BT_KEYS_ID_ADDED) != 0) { + /* If we found multiple conflicting keys or the conflicting key + * is already added to the ID list, we don't need to clear the + * conflict flag for it and re-add it to the Resolving List. + */ + conflict = NULL; + } else { + /* Clear the conflict flag for the conflicting key */ + conflict->flags &= ~BT_KEYS_ID_CONFLICT; + } + } + } + if (keys->state & BT_KEYS_ID_ADDED) { bt_id_del(keys); } + if (conflict) { + /* Re-add the conflicting key to the Resolving List if it was the last conflicting + * key. + */ + bt_id_pending_keys_update_set(conflict, BT_KEYS_ID_PENDING_ADD); + k_work_submit(&add_id_work); + } + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { /* Delete stored keys from flash */ bt_settings_delete_keys(keys->id, &keys->addr); @@ -361,6 +402,28 @@ int bt_keys_store(struct bt_keys *keys) return 0; } +static void check_and_set_id_conflict_flag(struct bt_keys *keys) +{ + struct bt_keys *conflict; + + if (!IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + /* If auto-swap is not enabled, we don't need to check for conflicts */ + return; + } + + /* Use bt_id_find_conflict() to check if there are any conflicting keys for the given keys. + * If there is at least one, set the BT_KEYS_ID_CONFLICT flag for both the keys and the + * conflicting key. + */ + conflict = bt_id_find_conflict(keys, true); + if (conflict != NULL) { + LOG_DBG("Found conflicting key %p.", conflict); + + keys->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + } +} + static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { @@ -475,6 +538,8 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, keys->flags &= ~BT_KEYS_AUTHENTICATED; } + check_and_set_id_conflict_flag(keys); + LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { @@ -484,17 +549,17 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return 0; } -static void add_id_cb(struct k_work *work) -{ - bt_id_pending_keys_update(); -} - -static K_WORK_DEFINE(add_id_work, add_id_cb); - static void id_add(struct bt_keys *keys, void *user_data) { __ASSERT_NO_MSG(keys != NULL); + if (keys->flags & BT_KEYS_ID_CONFLICT) { + /* If the keys have the conflict flag set, we don't want to add them to the ID list, + * as this will cause issues with resolving list. + */ + return; + } + bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD); k_work_submit(&add_id_work); } diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index 4fd0f38cb5d3..84f0c8e6c7ff 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -45,6 +45,12 @@ enum { /* Bit 2 and 3 might accidentally exist in old stored keys */ BT_KEYS_SC = BIT(4), BT_KEYS_OOB = BIT(5), + /** Indicates that the keys are in conflict with existing keys. + * + * This is used to indicate that the keys being added conflict with + * existing keys from different identity. + */ + BT_KEYS_ID_CONFLICT = BIT(6), }; enum bt_keys_cfg_flags { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index fffdc7047d67..6d52137ccf6a 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -925,7 +925,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) bt_id_del(keys); } - conflict = bt_id_find_conflict(keys); + conflict = bt_id_find_conflict(keys, false); if (conflict != NULL) { int err; @@ -935,7 +935,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) __ASSERT_NO_MSG(!err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(keys)); + __ASSERT_NO_MSG(!bt_id_find_conflict(keys, false)); bt_id_add(keys); } @@ -4136,16 +4136,24 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) */ __ASSERT_NO_MSG(!(smp->remote_dist & BT_SMP_DIST_ID_KEY)); - conflict = bt_id_find_conflict(new_bond); + conflict = bt_id_find_conflict(new_bond, IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)); if (conflict) { LOG_DBG("New bond conflicts with a bond on id %d.", conflict->id); } - if (conflict && !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { + if (conflict && !IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { LOG_WRN("Refusing new pairing. The old bond must be unpaired first."); return BT_SMP_ERR_AUTH_REQUIREMENTS; } + if (conflict && IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + LOG_WRN("Conflict detected with %p. Don't add key to Resolve List.", conflict); + new_bond->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + return 0; + } + if (conflict && IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { bool trust_ok; int unpair_err; @@ -4162,7 +4170,7 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) __ASSERT_NO_MSG(!unpair_err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond)); + __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond, false)); bt_id_add(new_bond); return 0; } diff --git a/tests/bluetooth/host/id/mocks/adv.c b/tests/bluetooth/host/id/mocks/adv.c index 2c2d4f3f3c7a..a22123dea3da 100644 --- a/tests/bluetooth/host/id/mocks/adv.c +++ b/tests/bluetooth/host/id/mocks/adv.c @@ -15,3 +15,4 @@ DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv *, DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DEFINE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/adv.h b/tests/bluetooth/host/id/mocks/adv.h index bfb744001596..1602ddf47185 100644 --- a/tests/bluetooth/host/id/mocks/adv.h +++ b/tests/bluetooth/host/id/mocks/adv.h @@ -18,7 +18,8 @@ typedef void (*bt_le_ext_adv_foreach_cb)(struct bt_le_ext_adv *adv, void *data); FAKE(bt_le_adv_lookup_legacy) \ FAKE(bt_le_ext_adv_get_index) \ FAKE(bt_le_adv_set_enable_ext) \ - FAKE(bt_le_ext_adv_foreach) + FAKE(bt_le_ext_adv_foreach) \ + FAKE(bt_adv_lookup_by_id) DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable, struct bt_le_ext_adv *, bool); DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_le_adv_lookup_legacy); @@ -27,3 +28,4 @@ DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv * DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DECLARE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/keys.c b/tests/bluetooth/host/id/mocks/keys.c index f885ab875c0f..61f73569c469 100644 --- a/tests/bluetooth/host/id/mocks/keys.c +++ b/tests/bluetooth/host/id/mocks/keys.c @@ -10,3 +10,4 @@ DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DEFINE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); diff --git a/tests/bluetooth/host/id/mocks/keys.h b/tests/bluetooth/host/id/mocks/keys.h index b6901e315ab9..1912472b78de 100644 --- a/tests/bluetooth/host/id/mocks/keys.h +++ b/tests/bluetooth/host/id/mocks/keys.h @@ -15,7 +15,9 @@ typedef void (*bt_keys_foreach_type_cb)(struct bt_keys *keys, void *data); /* List of fakes used by this unit tester */ #define KEYS_FFF_FAKES_LIST(FAKE) \ FAKE(bt_keys_find_irk) \ - FAKE(bt_keys_foreach_type) + FAKE(bt_keys_foreach_type) \ + FAKE(bt_keys_get_addr) DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DECLARE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); From 81578337195c95dad6eccc88599f07e2e8bcc2bd Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Fri, 21 Feb 2025 16:59:33 +0100 Subject: [PATCH 1628/3334] [nrf noup] modules: hal_nordic: cleanup nrfx_config nrf-squash! [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS - Remove temporary workaround for SDC in nrfx's reserved resources. - Modify NCS reserved resources to use upstream version with additions instead of creating new file - Align filename Signed-off-by: Marcin Szymczyk (cherry picked from commit 9f426c320d6f163ac60b4bd4c323413f032b8369) --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ------------------ .../nrfx/nrfx_reserved_resources_ncs.h | 217 ++++ 3 files changed, 218 insertions(+), 949 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h create mode 100644 modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 98dacdcfede4..06bce944b449 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -386,6 +386,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_config_reserved_resources_ncs.h" + default "nrfx_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h deleted file mode 100644 index ec8a9acaf7b5..000000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h +++ /dev/null @@ -1,948 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ -#define NRFX_CONFIG_RESERVED_RESOURCES_H__ - -/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE130_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) - -/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE131_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) - -/** @brief Bitmask that defines EGU instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_EGUS_USED 0 - -/** @brief Bitmask that defines TIMER instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_TIMERS_USED 0 - -/* If the GRTC system timer driver is to be used, prepare definitions required - * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and - * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. - */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ - (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ - ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ - (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ - DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ - -/* - * The enabled Bluetooth controller subsystem is responsible for providing - * definitions of the BT_CTLR_USED_* symbols used below in a file named - * bt_ctlr_used_resources.h and for adding its location to global include - * paths so that the file can be included here for all Zephyr libraries that - * are to be built. - */ -#if defined(CONFIG_BT_LL_SW_SPLIT) -#include -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#endif -#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ - -#if defined(CONFIG_BT_LL_SOFTDEVICE) -/* Define auxiliary symbols needed for SDC device dispatch. */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRF52_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRF53_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRF54L_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF71X) -#define NRF71_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRF54H_SERIES -#endif -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) -#else -#error Unsupported chip family -#endif -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ - -#if defined(CONFIG_NRF_802154_RADIO_DRIVER) -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#include <../src/nrf_802154_peripherals_nrf52.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#include <../src/nrf_802154_peripherals_nrf53.h> -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#include <../src/nrf_802154_peripherals_nrf54l.h> -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#include <../src/nrf_802154_peripherals_nrf54h.h> -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ - -#if defined(CONFIG_MPSL) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ - (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif - -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL -#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL -#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL -#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL -#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL -#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL -#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL -#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL -#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL -#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL -#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL -#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL -#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL -#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL -#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL -#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL -#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL -#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 -#endif - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) - -BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_CHANNELS_USED \ - (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI0_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_GROUPS_USED \ - (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI0_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_CHANNELS_USED \ - (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI00_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_GROUPS_USED \ - (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI00_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_CHANNELS_USED \ - (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI10_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_GROUPS_USED \ - (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI10_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_CHANNELS_USED \ - (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI20_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_GROUPS_USED \ - (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI20_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_CHANNELS_USED \ - (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI30_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_GROUPS_USED \ - (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI30_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_CHANNELS_USED \ - (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI020_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_GROUPS_USED \ - (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI020_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_CHANNELS_USED \ - (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI030_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_GROUPS_USED \ - (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI030_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_CHANNELS_USED \ - (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI120_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_GROUPS_USED \ - (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI120_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_CHANNELS_USED \ - (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI130_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_GROUPS_USED \ - (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI130_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_CHANNELS_USED \ - (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI131_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_GROUPS_USED \ - (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI131_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_CHANNELS_USED \ - (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI132_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_GROUPS_USED \ - (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI132_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_CHANNELS_USED \ - (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI133_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_GROUPS_USED \ - (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI133_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_CHANNELS_USED \ - (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI134_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_GROUPS_USED \ - (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI134_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_CHANNELS_USED \ - (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI135_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_GROUPS_USED \ - (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI135_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_CHANNELS_USED \ - (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI136_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_GROUPS_USED \ - (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI136_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines PPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_CHANNELS_USED \ - (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) - -#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED -#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED - -/** @brief Bitmask that defines PPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_GROUPS_USED \ - (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) - -#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ - (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ - (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ - (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ - (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ - (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ - (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ - (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ - NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) - -#if defined(CONFIG_SOFTDEVICE) -#include -#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED -#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED -#else -#define NRFX_PPI_CHANNELS_USED_BY_SD 0 -#define NRFX_PPI_GROUPS_USED_BY_SD 0 -#endif - -#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h new file mode 100644 index 000000000000..2c1fe3640493 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_RESERVED_RESOURCES_NCS_H__ +#define NRFX_RESERVED_RESOURCES_NCS_H__ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#include "nrfx_reserved_resources.h" + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ +#endif /* NRFX_RESERVED_RESOURCES_NCS_H__ */ From db78578bfdd2da618d9de8ca82a56c775725adf9 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Wed, 19 Nov 2025 11:37:26 +0100 Subject: [PATCH 1629/3334] [nrf noup] dts: nordic: remove leftover file File no longer needed, can be removed. Signed-off-by: Jakub Zymelka (cherry picked from commit c955bb5ea15584ffcd3c22d1347ceff352548954) --- dts/vendor/nordic/nrf54l20.dtsi | 852 -------------------------------- 1 file changed, 852 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi deleted file mode 100644 index bee70effa0e8..000000000000 --- a/dts/vendor/nordic/nrf54l20.dtsi +++ /dev/null @@ -1,852 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -/delete-node/ &sw_pwm; - -/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ -#define NRF_DOMAIN_ID_APPLICATION 0 -#define NRF_DOMAIN_ID_FLPR 1 - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@0 { - compatible = "arm,cortex-m33f"; - reg = <0>; - device_type = "cpu"; - clocks = <&hfpll>; - #address-cells = <1>; - #size-cells = <1>; - - itm: itm@e0000000 { - compatible = "arm,armv8m-itm"; - reg = <0xe0000000 0x1000>; - swo-ref-frequency = ; - }; - }; - - cpuflpr: cpu@1 { - compatible = "nordic,vpr"; - reg = <1>; - device_type = "cpu"; - riscv,isa = "rv32emc"; - nordic,bus-width = <64>; - }; - }; - - clocks { - pclk: pclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - pclk32m: pclk32m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfxo: lfxo { - compatible = "nordic,nrf54l-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf54l-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1650>; - }; - - hfpll: hfpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - aclk: aclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - ficr: ficr@ffc000 { - compatible = "nordic,nrf-ficr"; - reg = <0xffc000 0x1000>; - #nordic,ficr-cells = <1>; - }; - - uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; - reg = <0xffd000 0x1000>; - }; - - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(447)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 0x6fc00>; - }; - - cpuflpr_sram: memory@2006fc00 { - compatible = "mmio-sram"; - reg = <0x2006fc00 DT_SIZE_K(64)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2006fc00 0x10000>; - }; - - global_peripherals: peripheral@50000000 { - ranges = <0x0 0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - - dppic00: dppic@42000 { - compatible = "nordic,nrf-dppic"; - reg = <0x42000 0x808>; - status = "disabled"; - }; - - ppib00: ppib@44000 { - compatible = "nordic,nrf-ppib"; - reg = <0x44000 0x1000>; - status = "disabled"; - }; - - ppib01: ppib@45000 { - compatible = "nordic,nrf-ppib"; - reg = <0x45000 0x1000>; - status = "disabled"; - }; - - cpuflpr_vpr: vpr@4c000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x4c000 0x1000>; - ranges = <0x0 0x4c000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - status = "disabled"; - enable-secure; - - cpuflpr_clic: interrupt-controller@f0000000 { - compatible = "nordic,nrf-clic"; - reg = <0xf0000000 0x143c>; - interrupt-controller; - #interrupt-cells = <2>; - #address-cells = <1>; - status = "disabled"; - }; - }; - - spi00: spi@4d000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart00: uart@4d000 { - compatible = "nordic,nrf-uarte"; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - gpio2: gpio@50400 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x50400 0x300>; - #gpio-cells = <2>; - ngpios = <11>; - status = "disabled"; - port = <2>; - }; - - timer00: timer@55000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x55000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - prescaler = <0>; - }; - - dppic10: dppic@82000 { - compatible = "nordic,nrf-dppic"; - reg = <0x82000 0x808>; - status = "disabled"; - }; - - ppib10: ppib@83000 { - compatible = "nordic,nrf-ppib"; - reg = <0x83000 0x1000>; - status = "disabled"; - }; - - ppib11: ppib@84000 { - compatible = "nordic,nrf-ppib"; - reg = <0x84000 0x1000>; - status = "disabled"; - }; - - timer10: timer@85000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x85000 0x1000>; - cc-num = <8>; - max-bit-width = <32>; - interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - prescaler = <0>; - }; - - egu10: egu@87000 { - compatible = "nordic,nrf-egu"; - reg = <0x87000 0x1000>; - interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - radio: radio@8a000 { - compatible = "nordic,nrf-radio"; - reg = <0x8a000 0x1000>; - interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - dfe-supported; - ieee802154-supported; - ble-2mbps-supported; - ble-coded-phy-supported; - cs-supported; - - ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; - }; - - dppic20: dppic@c2000 { - compatible = "nordic,nrf-dppic"; - reg = <0xc2000 0x808>; - status = "disabled"; - }; - - ppib20: ppib@c3000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc3000 0x1000>; - status = "disabled"; - }; - - ppib21: ppib@c4000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc4000 0x1000>; - status = "disabled"; - }; - - ppib22: ppib@c5000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc5000 0x1000>; - status = "disabled"; - }; - - i2c20: i2c@c6000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi20: spi@c6000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart20: uart@c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c21: i2c@c7000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi21: spi@c7000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart21: uart@c7000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c22: i2c@c8000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi22: spi@c8000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart22: uart@c8000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - egu20: egu@c9000 { - compatible = "nordic,nrf-egu"; - reg = <0xc9000 0x1000>; - interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - timer20: timer@ca000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xca000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer21: timer@cb000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcb000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer22: timer@cc000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcc000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer23: timer@cd000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcd000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer24: timer@ce000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xce000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - pdm20: pdm@d0000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd0000 0x1000>; - interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pdm21: pdm@d1000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd1000 0x1000>; - interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pwm20: pwm@d2000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd2000 0x1000>; - interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm21: pwm@d3000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd3000 0x1000>; - interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm22: pwm@d4000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd4000 0x1000>; - interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - adc: adc@d5000 { - compatible = "nordic,nrf-saadc"; - reg = <0xd5000 0x1000>; - interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - zephyr,pm-device-runtime-auto; - }; - - nfct: nfct@d6000 { - compatible = "nordic,nrf-nfct"; - reg = <0xd6000 0x1000>; - interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - temp: temp@d7000 { - compatible = "nordic,nrf-temp"; - reg = <0xd7000 0x1000>; - interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio1: gpio@d8200 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8200 0x300>; - #gpio-cells = <2>; - ngpios = <16>; - status = "disabled"; - port = <1>; - gpiote-instance = <&gpiote20>; - }; - - gpiote20: gpiote@da000 { - compatible = "nordic,nrf-gpiote"; - reg = <0xda000 0x1000>; - status = "disabled"; - instance = <20>; - }; - - qdec20: qdec@e0000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe0000 0x1000>; - interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - qdec21: qdec@e1000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe1000 0x1000>; - interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - grtc: grtc@e2000 { - compatible = "nordic,nrf-grtc"; - reg = <0xe2000 0x1000>; - cc-num = <12>; - clocks = <&lfxo>, <&pclk>; - clock-names = "lfclock", "hfclock"; - status = "disabled"; - }; - - tdm: tdm@e8000 { - compatible = "nordic,nrf-tdm"; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xe8000 0x1000>; - interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - clocks = <&pclk32m>; - }; - - i2c23: i2c@ed000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi23: spi@ed000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart23: uart@ed000 { - compatible = "nordic,nrf-uarte"; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c24: i2c@ee000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi24: spi@ee000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart24: uart@ee000 { - compatible = "nordic,nrf-uarte"; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - dppic30: dppic@102000 { - compatible = "nordic,nrf-dppic"; - reg = <0x102000 0x808>; - status = "disabled"; - }; - - ppib30: ppib@103000 { - compatible = "nordic,nrf-ppib"; - reg = <0x103000 0x1000>; - status = "disabled"; - }; - - i2c30: i2c@104000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi30: spi@104000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart30: uart@104000 { - compatible = "nordic,nrf-uarte"; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - comp: comparator@106000 { - /* - * Use compatible "nordic,nrf-comp" to configure as COMP - * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP - */ - compatible = "nordic,nrf-comp"; - reg = <0x106000 0x1000>; - status = "disabled"; - interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - wdt30: watchdog@108000 { - compatible = "nordic,nrf-wdt"; - reg = <0x108000 0x620>; - interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - wdt31: watchdog@109000 { - compatible = "nordic,nrf-wdt"; - reg = <0x109000 0x620>; - interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio0: gpio@10a000 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x10a000 0x300>; - #gpio-cells = <2>; - ngpios = <5>; - status = "disabled"; - port = <0>; - gpiote-instance = <&gpiote30>; - }; - - gpiote30: gpiote@10c000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x10c000 0x1000>; - status = "disabled"; - instance = <30>; - }; - - clock: clock@10e000 { - compatible = "nordic,nrf-clock"; - reg = <0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@51c { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x51c 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@520 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x520 0x1>; - status = "disabled"; - }; - }; - - regulators: regulator@120000 { - compatible = "nordic,nrf54l-regulators"; - reg = <0x120000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - vregmain: regulator@120600 { - compatible = "nordic,nrf5x-regulator"; - reg = <0x120600 0x1>; - status = "disabled"; - regulator-name = "VREGMAIN"; - regulator-initial-mode = ; - }; - }; - }; - - rram_controller: rram-controller@5004e000 { - compatible = "nordic,rram-controller"; - reg = <0x5004e000 0x1000>; - interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(1972)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - - cpuflpr_rram: rram@1ed000 { - compatible = "soc-nv-flash"; - reg = <0x1ed000 DT_SIZE_K(64)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_nvic: interrupt-controller@e000e100 { - #address-cells = <1>; - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - }; - }; -}; From b3e6816fa807b57dca1ffa0c95bd9076c5ffb37a Mon Sep 17 00:00:00 2001 From: Kacper Radoszewski Date: Thu, 27 Nov 2025 08:57:56 +0100 Subject: [PATCH 1630/3334] [nrf noup] include: net: add TLS_DTLS_FRAG_EXT to NCS extensions nrf-squash! [nrf noup] include: net: add NCS extensions The TLS_DTLS_FRAG_EXT socket option is used to enable and disable the DTLS fragmentation extension. Signed-off-by: Kacper Radoszewski (cherry picked from commit a5a08497515f17ef850dd6884e010f4ffc338483) --- include/zephyr/net/socket_ncs.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h index 6a77d6c41f13..7c8bae645f6c 100644 --- a/include/zephyr/net/socket_ncs.h +++ b/include/zephyr/net/socket_ncs.h @@ -69,6 +69,27 @@ extern "C" { #define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 #define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 +/** Socket option to enable the DTLS fragmentation extension. + * Accepted values for the option are: @ref DTLS_FRAG_EXT_DISABLED, + * @ref DTLS_FRAG_EXT_512_ENABLED, @ref DTLS_FRAG_EXT_1024_ENABLED. + */ +#define TLS_DTLS_FRAG_EXT (NET_SOCKET_NCS_BASE + 22) + +/** Disabled - The DTLS fragmentation extension is not included in the Client Hello. */ +#define DTLS_FRAG_EXT_DISABLED 0 +/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment + * size of 512 bytes. + * + * @note The user data size in send requests also becomes limited to a maximum of 512 bytes. + */ +#define DTLS_FRAG_EXT_512_ENABLED 1 +/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment + * size of 1024 bytes. + * + * @note The user data size in send requests also becomes limited to a maximum of 1024 bytes. + */ +#define DTLS_FRAG_EXT_1024_ENABLED 2 + /* NCS specific socket options */ /** sockopt: enable sending data as part of exceptional events */ From 71e8ec66300fe58fc5212f5708f5a32b3e151325 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 19 Nov 2025 11:36:53 +0530 Subject: [PATCH 1631/3334] [nrf fromlist] boards: shields: Add nRF7002 EB-II shield This is primarily intended for providing Wi-Fi capabilities for the nRF54L Series hosts using SPI. Upstream PR #: 100121 Signed-off-by: Chaitanya Tata (cherry picked from commit 95ad0eb429a1a17809e5a5594fd8160264233c6e) --- boards/shields/nrf7002eb2/Kconfig.shield | 14 +++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 54 +++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 89 ++++++++++++++++++ boards/shields/nrf7002eb2/doc/index.rst | 72 ++++++++++++++ boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg | Bin 0 -> 49527 bytes boards/shields/nrf7002eb2/nrf7002eb2.overlay | 24 +++++ .../nrf7002eb2/nrf7002eb2_coex.overlay | 15 +++ .../shields/nrf7002eb2/nrf7002eb2_common.dtsi | 20 ++++ .../nrf7002eb2/nrf7002eb2_common_5g.dtsi | 12 +++ .../nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi | 25 +++++ .../nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi | 15 +++ .../nrf7002eb2/nrf7002eb2_nrf7000.overlay | 24 +++++ .../nrf7002eb2/nrf7002eb2_nrf7001.overlay | 23 +++++ boards/shields/nrf7002eb2/shield.yml | 26 +++++ 14 files changed, 413 insertions(+) create mode 100644 boards/shields/nrf7002eb2/Kconfig.shield create mode 100644 boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay create mode 100644 boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay create mode 100644 boards/shields/nrf7002eb2/doc/index.rst create mode 100644 boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay create mode 100644 boards/shields/nrf7002eb2/shield.yml diff --git a/boards/shields/nrf7002eb2/Kconfig.shield b/boards/shields/nrf7002eb2/Kconfig.shield new file mode 100644 index 000000000000..3a6309b39148 --- /dev/null +++ b/boards/shields/nrf7002eb2/Kconfig.shield @@ -0,0 +1,14 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_NRF7002EB2 + def_bool $(shields_list_contains,nrf7002eb2) + +config SHIELD_NRF7002EB2_NRF7001 + def_bool $(shields_list_contains,nrf7002eb2_nrf7001) + +config SHIELD_NRF7002EB2_NRF7000 + def_bool $(shields_list_contains,nrf7002eb2_nrf7000) + +config SHIELD_NRF7002EB2_COEX + def_bool $(shields_list_contains,nrf7002eb2_coex) diff --git a/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..912d806b5f47 --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../nrf7002eb2_gpio_pins_1.dtsi" + +/ { + chosen { + zephyr,wifi = &wlan0; + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,uart-mcumgr = &uart30; + zephyr,bt-mon-uart = &uart30; + zephyr,bt-c2h-uart = &uart30; + }; +}; + +&pinctrl { + spi22_default: spi22_default { + group1 { + psels = , + , + ; + bias-pull-down; + }; + }; + + spi22_sleep: spi22_sleep { + group1 { + psels = , + , + ; + bias-pull-down; + low-power-enable; + }; + }; +}; + +&spi22 { + cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..dcc759345bad --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../nrf7002eb2_gpio_pins_2.dtsi" + +/ { + chosen { + zephyr,wifi = &wlan0; + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,uart-mcumgr = &uart30; + zephyr,bt-mon-uart = &uart30; + zephyr,bt-c2h-uart = &uart30; + }; + + buttons { + /delete-node/ button_3; + }; + + aliases { + /delete-property/ sw3; + }; +}; + +&gpio3 { + status = "okay"; +}; + +&pinctrl { + spi22_default: spi22_default { + group1 { + psels = , + , + ; + bias-pull-down; + }; + }; + + spi22_sleep: spi22_sleep { + group1 { + psels = , + , + ; + bias-pull-down; + low-power-enable; + }; + }; + + uart30_default: uart30_default { + group1 { + psels = ; + }; + + group2 { + psels = ; + bias-pull-up; + }; + }; + + uart30_sleep: uart30_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&spi22 { + status = "okay"; + cs-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; +}; + +/* uart20 has pin conflicts with EB-II shield hence disabling that + * and enabling uart30 as console port. + */ +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/doc/index.rst b/boards/shields/nrf7002eb2/doc/index.rst new file mode 100644 index 000000000000..6fe033c21221 --- /dev/null +++ b/boards/shields/nrf7002eb2/doc/index.rst @@ -0,0 +1,72 @@ +.. _nrf7002eb2: + +nRF7002 EB II +############# + +Overview +******** + +The nRF7002 EB II is a versatile evaluation kit in the form of a thumbstick shield which connects to +compatible Nordic host boards using the Nordic edge-connector. + +The nRF7002 EB II unlocks low-power Wi-Fi 6 capabilities for your host device. It supports dual-band Wi-Fi +2.4GHz and 5GHz, and is based on the nRF7002 SoC. The shield also supports nRF7001 and nRF7000 SoCs +through variant overlays. +Seamlessly connect to Wi-Fi networks and leverage Wi-Fi-based locationing, enabling advanced +features such as SSID sniffing of local Wi-Fi hubs. + +.. figure:: nrf7002eb2.jpg + :alt: nRF7002 EB II + :align: center + + nRF7002 EB II + +Requirements +************ + +The nRF7002 EB II board is designed to fit straight into a Nordic edge-connector and uses SPI as the +communication interface. Any host board that supports the Nordic edge-connector can be used with +the nRF7002 EB II. + +Prerequisites +------------- + +The nRF70 driver requires firmware binary blobs for Wi-Fi operation. Run the command +below to retrieve those files. + +.. code-block:: console + + west update + west blobs fetch nrf_wifi + +Usage +***** + +The shield can be used in any application by setting ``--shield nrf7002eb2`` when invoking ``west build``. + +Shield Variants +*************** + +The nRF7002 EB II has several variants to support different nRF70 SoCs and features: + +- ``nrf7002eb2``: The default variant using the nRF7002 SoC. +- ``nrf7002eb2_nrf7001``: Variant using the nRF7001 SoC. +- ``nrf7002eb2_nrf7000``: Variant using the nRF7000 SoC. +- ``nrf7002eb2_coex``: Variant which includes the COEX pins. These pins are not routed to the + edge-connector on some boards, like earlier revisions of the Thingy53 than v1.0.0. + +SR Co-existence +*************** + +The nRF7002 EB II supports SR co-existence provided the host board supports it. The SR co-existence +pins are connected to the host board's GPIO pins. + +Two Kconfig options are available to enable SR co-existence: + +- :kconfig:option:`CONFIG_NRF70_SR_COEX`: Enables SR co-existence. +- :kconfig:option:`CONFIG_NRF70_SR_COEX_RF_SWITCH`: Control SR side RF switch. + +References +********** + +- `Developing with nRF7002 EB II `_ diff --git a/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg b/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..458093f1662041123b3afae0d83a1aa9e8564ec3 GIT binary patch literal 49527 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 z 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
~l&H-kwc|!9JUih>$ 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 bi4kLg0)r;$UqfF0JMo17SNgvAYwCXh^nayi literal 0 HcmV?d00001 diff --git a/boards/shields/nrf7002eb2/nrf7002eb2.overlay b/boards/shields/nrf7002eb2/nrf7002eb2.overlay new file mode 100644 index 000000000000..304814fa3040 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&wifi_spi { + status = "okay"; + + nrf70: nrf7002-spi@0 { + compatible = "nordic,nrf7002-spi"; + status = "okay"; + + /* Include common nRF70 overlays */ + #include "nrf7002eb2_common.dtsi" + #include "nrf7002eb2_common_5g.dtsi" + }; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay new file mode 100644 index 000000000000..36f352bc6a5e --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + nrf_radio_coex: coex { + compatible = "nordic,nrf7002-coex"; + status = "okay"; + status0-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + req-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + grant-gpios = <&gpio1 7 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; + }; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi new file mode 100644 index 000000000000..efe0703ac9dd --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include + +/* Common assignments for nRF70 EB-II shield */ +reg = <0>; +spi-max-frequency = ; + +/* Maximum TX power limits for 2.4 GHz */ +wifi-max-tx-pwr-2g-dsss = <21>; +wifi-max-tx-pwr-2g-mcs0 = <16>; +wifi-max-tx-pwr-2g-mcs7 = <16>; + +/* List of interfaces */ +wlan0: wlan0 { + compatible = "nordic,wlan"; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi new file mode 100644 index 000000000000..05a472a32bd5 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +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/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi new file mode 100644 index 000000000000..95ad1ed44221 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + nrf_radio_coex: coex { + compatible = "nordic,nrf7002-coex"; + status = "disabled"; + status0-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + req-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + grant-gpios = <&gpio1 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; + }; +}; + +&nrf70 { + iovdd-ctrl-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + bucken-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + host-irq-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi new file mode 100644 index 000000000000..dc59273a0314 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&nrf70 { + iovdd-ctrl-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + bucken-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + host-irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay new file mode 100644 index 000000000000..22b36e7b27fc --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&wifi_spi { + status = "okay"; + + nrf70: nrf7000-spi@0 { + compatible = "nordic,nrf7000-spi"; + status = "okay"; + + /* Include common nRF70 overlays */ + #include "nrf7002eb2_common.dtsi" + #include "nrf7002eb2_common_5g.dtsi" + }; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay new file mode 100644 index 000000000000..9a9243063a98 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&wifi_spi { + status = "okay"; + + nrf70: nrf7001-spi@0 { + compatible = "nordic,nrf7001-spi"; + status = "okay"; + + /* Include common nRF70 overlays */ + #include "nrf7002eb2_common.dtsi" + }; +}; diff --git a/boards/shields/nrf7002eb2/shield.yml b/boards/shields/nrf7002eb2/shield.yml new file mode 100644 index 000000000000..60349b0a3cb7 --- /dev/null +++ b/boards/shields/nrf7002eb2/shield.yml @@ -0,0 +1,26 @@ +# @Kconfig.shield + +shields: + - name: nrf7002eb2 + full_name: nRF7002 EB-II Shield + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_nrf7001 + full_name: nRF7002 EB-II Shield (nRF7001) + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_nrf7000 + full_name: nRF7002 EB-II Shield (nRF7000) + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_coex + full_name: nRF7002 EB-II Shield (SR Co-Existence) + vendor: nordic + supported_features: + - wifi From 1ccd687ded0cc174e6329fbaf5dda7af5f489a2c Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Tue, 30 Sep 2025 10:48:18 +0200 Subject: [PATCH 1632/3334] [nrf noup] soc: nordic: Support TF-M for poweroff Enable going to system off when the TF-M API is available. This calls the relevant TF-M platform API to enter system off mode using TF-M. This is a noup because the TF-M service for system off is currently located in sdk-nrf only. This is meant to be a short lived commit, work is already ongoing to upstream an official TF-M system off solution that can be be added to upstream Zephyr. Signed-off-by: Georgios Vasilakis (cherry picked from commit 987aaa43680d12d4b6bfff15973da506c302cc3c) --- soc/nordic/common/poweroff.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/soc/nordic/common/poweroff.c b/soc/nordic/common/poweroff.c index eae8341c3e69..e75636b737bb 100644 --- a/soc/nordic/common/poweroff.c +++ b/soc/nordic/common/poweroff.c @@ -7,7 +7,9 @@ #include #include -#if defined(CONFIG_SOC_SERIES_NRF51) || defined(CONFIG_SOC_SERIES_NRF52) +#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) +#include "tfm_platform_api.h" +#elif defined(CONFIG_SOC_SERIES_NRF51) || defined(CONFIG_SOC_SERIES_NRF52) #include #elif defined(CONFIG_SOC_SERIES_NRF54H) #include @@ -30,6 +32,10 @@ void z_sys_poweroff(void) { +#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) + tfm_platform_system_off(); +#else + #if defined(CONFIG_HAS_NORDIC_RAM_CTRL) uint8_t *ram_start; size_t ram_size; @@ -78,5 +84,7 @@ void z_sys_poweroff(void) nrf_regulators_system_off(NRF_REGULATORS); #endif +#endif /* CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE */ + CODE_UNREACHABLE; } From a16d8d63e58874e03bef6a5d7d19b18aac3166a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 2 Dec 2025 12:04:21 +0100 Subject: [PATCH 1633/3334] [nrf fromlist] soc: nordic: nrf54h: Add support for local cpurad GPPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for handling connections within the radio domain using the new GPPI helper. Upstream PR #: 100437 Signed-off-by: Krzysztof Chruściński (cherry picked from commit a8d610e99d8c00cad9d00b9ce52bf71fd08e430b) --- soc/nordic/common/Kconfig.peripherals | 3 +- soc/nordic/common/gppi_init.c | 17 ++++++ soc/nordic/nrf54h/CMakeLists.txt | 4 ++ soc/nordic/nrf54h/nrfx_gppi_cpurad.c | 83 +++++++++++++++++++++++++++ soc/nordic/nrf54h/nrfx_gppi_cpurad.h | 26 +++++++++ 5 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 soc/nordic/nrf54h/nrfx_gppi_cpurad.c create mode 100644 soc/nordic/nrf54h/nrfx_gppi_cpurad.h diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 8706c650e0d1..248f490dce59 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -42,7 +42,8 @@ config HAS_HW_NRF_DCNF def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DCNF)) config HAS_HW_NRF_DPPIC - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC)) || \ + $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_DPPIC_LOCAL)) config HAS_HW_NRF_ECB def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_ECB)) diff --git a/soc/nordic/common/gppi_init.c b/soc/nordic/common/gppi_init.c index e11790094868..8a36cc5b62d0 100644 --- a/soc/nordic/common/gppi_init.c +++ b/soc/nordic/common/gppi_init.c @@ -7,6 +7,8 @@ #include #if defined(NRFX_GPPI_MULTI_DOMAIN) && !defined(NRFX_GPPI_FIXED_CONNECTIONS) #include +#elif defined(CONFIG_SOC_NRF54H20_CPURAD) +#include #endif static int _gppi_init(void) @@ -47,6 +49,21 @@ static int _gppi_init(void) NRFX_BIT_MASK(DPPIC20_GROUP_NUM_SIZE) & ~NRFX_DPPI20_GROUPS_USED); nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC30, NRFX_BIT_MASK(DPPIC30_GROUP_NUM_SIZE) & ~NRFX_DPPI30_GROUPS_USED); +#elif defined(CONFIG_SOC_NRF54H20_CPURAD) + gppi_instance.routes = nrfx_gppi_routes_get(); + gppi_instance.route_map = nrfx_gppi_route_map_get(); + gppi_instance.nodes = nrfx_gppi_nodes_get(); + + nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC020, + NRFX_BIT_MASK(DPPIC020_CH_NUM_SIZE) & ~NRFX_DPPI020_CHANNELS_USED); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC030, + NRFX_BIT_MASK(DPPIC030_CH_NUM_SIZE) & ~NRFX_DPPI030_CHANNELS_USED); + nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB020_030, + NRFX_BIT_MASK(PPIB020_NTASKSEVENTS_SIZE)); + nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC020, + NRFX_BIT_MASK(DPPIC020_GROUP_NUM_SIZE) & ~NRFX_DPPI020_GROUPS_USED); + nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC030, + NRFX_BIT_MASK(DPPIC030_GROUP_NUM_SIZE) & ~NRFX_DPPI030_GROUPS_USED); #else #error "Not supported" #endif diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 25e4796a4169..59c62b0b48a3 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -17,6 +17,10 @@ if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) endif() +if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) + zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_CPURAD nrfx_gppi_cpurad.c) +endif() + zephyr_include_directories(.) # Ensure that image size aligns with 16 bytes so that MRAMC finalizes all writes diff --git a/soc/nordic/nrf54h/nrfx_gppi_cpurad.c b/soc/nordic/nrf54h/nrfx_gppi_cpurad.c new file mode 100644 index 000000000000..44bda829f8c3 --- /dev/null +++ b/soc/nordic/nrf54h/nrfx_gppi_cpurad.c @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include "nrfx_gppi_cpurad.h" + +static nrfx_atomic_t channels[NRFX_GPPI_NODE_COUNT]; +static nrfx_atomic_t group_channels[NRFX_GPPI_NODE_DPPI_COUNT]; + +static const nrfx_gppi_node_t nodes[] = { + NRFX_GPPI_DPPI_NODE_DEFINE(020, NRFX_GPPI_NODE_DPPIC020), + NRFX_GPPI_DPPI_NODE_DEFINE(030, NRFX_GPPI_NODE_DPPIC030), + NRFX_GPPI_PPIB_NODE_DEFINE(020, 030), +}; + +static const nrfx_gppi_route_t dppi_routes[] = { + NRFX_GPPI_ROUTE_DEFINE("slow_rad", (&nodes[NRFX_GPPI_NODE_DPPIC020])), + NRFX_GPPI_ROUTE_DEFINE("fast_rad", (&nodes[NRFX_GPPI_NODE_DPPIC030])), + NRFX_GPPI_ROUTE_DEFINE("slow_fast_rad", + (&nodes[NRFX_GPPI_NODE_DPPIC020], + &nodes[NRFX_GPPI_NODE_PPIB020_030], + &nodes[NRFX_GPPI_NODE_DPPIC030])), +}; + +static const nrfx_gppi_route_t *slow_rad_routes[] = { + &dppi_routes[0], &dppi_routes[2] +}; + +static const nrfx_gppi_route_t *fast_rad_routes[] = { + &dppi_routes[1] +}; + +static const nrfx_gppi_route_t **dppi_route_map[] = { + slow_rad_routes, fast_rad_routes +}; + +uint32_t nrfx_gppi_domain_id_get(uint32_t addr) +{ + uint32_t domain = (addr >> 24) & BIT_MASK(3); + uint32_t bus = (addr >> 16) & BIT_MASK(8); + + (void)domain; + __ASSERT_NO_MSG(domain == 3); + switch (bus) { + case 2: + return NRFX_GPPI_NODE_DPPIC020; + case 3: + return NRFX_GPPI_NODE_DPPIC030; + default: + __ASSERT_NO_MSG(0); + return 0; + } +} + +const nrfx_gppi_route_t ***nrfx_gppi_route_map_get(void) +{ + return dppi_route_map; +} + +const nrfx_gppi_route_t *nrfx_gppi_routes_get(void) +{ + return dppi_routes; +} + +const nrfx_gppi_node_t *nrfx_gppi_nodes_get(void) +{ + return nodes; +} + +void nrfx_gppi_channel_init(nrfx_gppi_node_id_t node_id, uint32_t ch_mask) +{ + NRFX_ASSERT(node_id < NRFX_GPPI_NODE_COUNT); + + *nodes[node_id].generic.p_channels = ch_mask; +} + +void nrfx_gppi_groups_init(nrfx_gppi_node_id_t node_id, uint32_t group_mask) +{ + NRFX_ASSERT(node_id < NRFX_GPPI_NODE_DPPI_COUNT); + + *nodes[node_id].dppi.p_group_channels = group_mask; +} diff --git a/soc/nordic/nrf54h/nrfx_gppi_cpurad.h b/soc/nordic/nrf54h/nrfx_gppi_cpurad.h new file mode 100644 index 000000000000..3d3076b5cafd --- /dev/null +++ b/soc/nordic/nrf54h/nrfx_gppi_cpurad.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ +#define SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ + +#include + +typedef enum { + NRFX_GPPI_NODE_DPPIC020, + NRFX_GPPI_NODE_DPPIC030, + NRFX_GPPI_NODE_DPPI_COUNT, + NRFX_GPPI_NODE_PPIB020_030 = NRFX_GPPI_NODE_DPPI_COUNT, + NRFX_GPPI_NODE_COUNT +} nrfx_gppi_node_id_t; + +const nrfx_gppi_route_t ***nrfx_gppi_route_map_get(void); +const nrfx_gppi_route_t *nrfx_gppi_routes_get(void); +const nrfx_gppi_node_t *nrfx_gppi_nodes_get(void); +void nrfx_gppi_channel_init(nrfx_gppi_node_id_t node_id, uint32_t ch_mask); +void nrfx_gppi_groups_init(nrfx_gppi_node_id_t node_id, uint32_t group_mask); + +#endif /* SOC_NORDIC_NRF54H_NRFX_GPPI_CPURAD_H_ */ From e3a52be45cf5b225379e26bc30ac24ae449e8edb Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 14:30:18 +0100 Subject: [PATCH 1634/3334] [nrf noup] test-spec: update CI-test-low-level nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular folder selection. Signed-off-by: Piotr Kosycarz (cherry picked from commit 7cf858621a7780dc5ca8b9fa07592a98ca8d9514) --- .github/test-spec.yml | 92 ++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 28 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5fdf9c0ca782..14519ac3a149 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -367,35 +367,71 @@ - "drivers/sensor/sensor_shell.c" "CI-test-low-level": - - "arch/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf53*" + - "!soc/nordic/nrf9*" + - "arch/arm/**/*" + - "arch/riscv/**/*" - "boards/nordic/nrf54*/**/*" - - "drivers/**/*" - - "dts/**/*" - - "include/zephyr/**/*" - - "kernel/**/*" + - "drivers/adc/**/*" + - "drivers/cache/**/*" + - "drivers/clock_control/**/*" + - "drivers/comparator/**/*" + - "drivers/counter/**/*" + - "drivers/flash/**/*" + - "drivers/gpio/**/*" + - "drivers/hwinfo/**/*" + - "drivers/i2c/**/*" + - "drivers/i2s/**/*" + - "drivers/interrupt_controller/**/*" + - "drivers/mbox/**/*" + - "drivers/mspi/**/*" + - "drivers/pinctrl/**/*" + - "drivers/power_domain/**/*" + - "drivers/pwm/**/*" + - "drivers/retained_mem/**/*" + - "drivers/rtc/**/*" + - "drivers/serial/**/*" + - "drivers/spi/**/*" + - "drivers/timer/**/*" + - "drivers/usb/**/*" + - "drivers/watchdog/**/*" + - any: + - "dts/vendor/nordic/**/*" + - "!dts/vendor/nordic/nrf52*" + - "!dts/vendor/nordic/nrf53*" + - "!dts/vendor/nordic/nrf9*" - "modules/hal_nordic/**/*" - - "samples/basic/blinky_pwm/**/*" - - "samples/basic/fade_led/**/*" - - "samples/boards/nrf/**/*" - "samples/boards/nordic/**/*" - - "samples/drivers/adc/**/*" - - "samples/drivers/jesd216/**/*" - - "samples/drivers/mbox/**/*" - - "samples/drivers/soc_flash_nrf/**/*" - - "samples/drivers/spi_flash/**/*" - - "samples/drivers/watchdog/**/*" - - "samples/hello_world/**/*" - - "samples/sensor/**/*" - - "samples/subsys/ipc/**/*" - - "samples/subsys/logging/**/*" - - "samples/subsys/settings/**/*" - - "samples/subsys/usb/cdc_acm/**/*" - - "samples/subsys/usb/mass/**/*" - - "samples/synchronization/**/*" - - "subsys/logging/**/*" - - "subsys/settings/**/*" - - "tests/arch/**/*" + - "tests/arch/arm/**/*" - "tests/boards/nrf/**/*" - - "tests/boards/nordic/**/*" - - "tests/drivers/**/*" - - "tests/kernel/**/*" + - "tests/drivers/adc/**/*" + - "tests/drivers/clock_control/**/*" + - "tests/drivers/comparator/**/*" + - "tests/drivers/counter/**/*" + - "tests/drivers/flash/**/*" + - "tests/drivers/gpio/**/*" + - "tests/drivers/hwinfo/**/*" + - "tests/drivers/i2c/**/*" + - "tests/drivers/i2s/**/*" + - "tests/drivers/interrupt_controller/**/*" + - "tests/drivers/mbox/**/*" + - "tests/drivers/mspi/**/*" + - "tests/drivers/pinctrl/**/*" + - "tests/drivers/pwm/**/*" + - "tests/drivers/retained_mem/**/*" + - "tests/drivers/rtc/**/*" + - "tests/drivers/spi/**/*" + - "tests/drivers/timer/**/*" + - "tests/drivers/uart/**/*" + - "tests/drivers/watchdog/**/*" + - "tests/kernel/common/**/*" + - "tests/kernel/context/**/*" + - "tests/kernel/fatal/**/*" + - "tests/kernel/fpu_sharing/**/*" + - "tests/kernel/gen_isr_table/**/*" + - "tests/kernel/interrupt/**/*" + - "tests/kernel/sched/preempt/**/*" From 652f1554c75ac14de8a81092b6e5b118fd04a41e Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 14:38:41 +0100 Subject: [PATCH 1635/3334] [nrf noup] test-spec: update CI-audio-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml CI-audio-test more specific at soc/nordic. Signed-off-by: Piotr Kosycarz (cherry picked from commit 9e650a033fec9dc8dbcf7244854d3d758bcf0f51) --- .github/test-spec.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 14519ac3a149..483f135b03e2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -345,7 +345,12 @@ - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - "samples/bluetooth/hci_ipc/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf54*" + - "!soc/nordic/nrf9*" - "subsys/bluetooth/audio/**/*" - "subsys/bluetooth/host/**/*" - "subsys/dfu/**/*" From 01485da73ae12e94edd4f472cac3798dc832a4db Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:12:06 +0100 Subject: [PATCH 1636/3334] [nrf noup] test-spec: update CI-find-my-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular for soc and boards. Signed-off-by: Piotr Kosycarz (cherry picked from commit 4f11c2e93c3de15b754da84000727d862afd1b64) --- .github/test-spec.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 483f135b03e2..db9cac90e17f 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -271,13 +271,19 @@ - "!subsys/bluetooth/audio/**/*" "CI-find-my-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf52840dk/**/*" + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf54l15dk/**/*" - "drivers/bluetooth/**/*" - "drivers/entropy/**/*" - "drivers/flash/**/*" - "drivers/usb/**/*" - "drivers/regulator/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/dfu/**/*" - "subsys/fs/**/*" - "subsys/ipc/**/*" From f481af0553fcd55e0e7b129e7ec4ed96f6959a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ga=C5=82da?= Date: Wed, 3 Dec 2025 12:57:48 +0100 Subject: [PATCH 1637/3334] [nrf noup] ci: Dynamically set target branch for manifest PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrf-squash! [nrf noup] ci: add default permissions nrf-squash! [nrf noup] ci: add reopen for manifest-pr action nrf-squash! [nrf noup] ci: Enable action-manifest-pr Dynamically set target branch for manifest PRs Signed-off-by: Jan Gałda (cherry picked from commit b7daf22c5d53bbb19943cecc4a9ea742c635682c) --- .github/workflows/manifest-PR.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 0f3bd738a36c..6e2430ec901e 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -4,6 +4,7 @@ on: types: [opened, synchronize, closed, reopened] branches: - main + - ncs-v*-branch permissions: contents: read @@ -11,9 +12,28 @@ permissions: jobs: call-manifest-pr-action: runs-on: ubuntu-latest + outputs: + base-branch: ${{ steps.set-base-branch.outputs.base_branch }} steps: + # Determine the base branch: + # * sdk-zephyr/main -> sdk-nrf/main + # * sdk-zephyr/ncs-vX.Y-branch -> sdk-nrf/vX.Y-branch + - name: Set base branch + id: set-base-branch + run: | + if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then + echo "base_branch=main" >> "$GITHUB_OUTPUT" + elif [[ "${{ github.event.pull_request.base.ref }}" =~ ^ncs-(v[0-9]+\.[0-9]+-branch)$ ]]; then + branch_name="${{ github.event.pull_request.base.ref }}" + branch_name="${branch_name#ncs-}" + echo "base_branch=${branch_name}" >> "$GITHUB_OUTPUT" + else + echo "Error: Unsupported base branch: ${{ github.event.pull_request.base.ref }}" >&2 + exit 1 + fi - name: handle manifest PR uses: nrfconnect/action-manifest-pr@main with: token: ${{ secrets.NCS_GITHUB_TOKEN }} manifest-pr-title-details: ${{ github.event.pull_request.title }} + base-branch: ${{ steps.set-base-branch.outputs.base_branch }} From 1075a7ab701cf1dff1fbfe4307e8e289277cd3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ga=C5=82da?= Date: Fri, 5 Dec 2025 16:04:23 +0100 Subject: [PATCH 1638/3334] [nrf noup] ci: Use NordicBuilder to open backport PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport PRs opened by github-actions[bot] do not trigger action which opens sdk-nrf PR with manifest update Signed-off-by: Jan Gałda (cherry picked from commit f725df43b7e624b229696b669a9762317e3479bf) --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 3ecf66b17da9..402341a9c389 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -33,6 +33,6 @@ jobs: - name: Backport uses: zephyrproject-rtos/action-backport@7e74f601d11eaca577742445e87775b5651a965f # v2.0.3-3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.NCS_GITHUB_TOKEN }} issue_labels: Backport labels_template: '["Backport"]' From 0b57fe968cecd3a1f66f1fa01d0bf534e6d15755 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:16:14 +0100 Subject: [PATCH 1639/3334] [nrf noup] test-spec: update CI-cloud-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit 1c3fc7fb2f4e25e9fa1320fd7c135421ac3b4f7c) --- .github/test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index db9cac90e17f..00a75b24d829 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -332,7 +332,7 @@ - "drivers/serial/**/*" - "drivers/wifi/**/*" - "lib/posix/**/*" - - "soc/nordic/**/*" + - "soc/nordic/nrf9*/*" - "subsys/dfu/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" From f590e77e111b0e4e01decb33527e1a226a890501 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:20:23 +0100 Subject: [PATCH 1640/3334] [nrf noup] test-spec: update CI-nfc-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit 46ce70cb5f92d3c4f390f6f6677ed46c612fd2fa) --- .github/test-spec.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 00a75b24d829..09d7b372bfca 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -242,7 +242,10 @@ - "drivers/spi/**/*" - "lib/crc/**/*" - "modules/hal_nordic/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf9*" - "subsys/ipc/ipc_service/**/*" - "subsys/fs/**/*" - "subsys/mem_mgmt/**/*" From 3eb6d829f7c066b7f5a2a1b0a2e4d07b1d7014e5 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:49:13 +0100 Subject: [PATCH 1641/3334] [nrf noup] test-spec: update CI-rs-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at board. Signed-off-by: Piotr Kosycarz (cherry picked from commit b944a50b18fb5a2adc705ca4dedd5f1a81db77d2) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 09d7b372bfca..554b15bc2476 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -203,7 +203,11 @@ - "CMakeLists.txt" "CI-rs-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf21540dk*" + - "boards/nordic/nrf52833dk*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From 16b0fe1edb2fb7f05bd7c881a3945edc575c2e9c Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:51:19 +0100 Subject: [PATCH 1642/3334] [nrf noup] test-spec: update CI-fem-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz (cherry picked from commit ade912c31368c04f1ff3458a6385a969d426bff7) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 554b15bc2476..27e81cd357e7 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -180,7 +180,11 @@ - "modules/mbedtls/**/*" "CI-fem-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf21540dk*" + - "boards/nordic/nrf52833dk*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From 01db4e609927e92b4a77c2396d286a41cfbd9838 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:58:09 +0100 Subject: [PATCH 1643/3334] [nrf noup] test-spec: update CI-boot-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz (cherry picked from commit dc60f67fdd2f9c79a08a15161e53934c0c79112d) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 27e81cd357e7..1c45698e423d 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,7 +39,11 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54h20dk*" + - "boards/nordic/nrf54l*" + - "boards/nordic/nrf9160dk*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" From ddf21391242f21c6faeabd00ed9e2b10cfc35301 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:58:38 +0100 Subject: [PATCH 1644/3334] [nrf noup] test-spec: update CI-dfu-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz (cherry picked from commit f381002023190d1715400a50fc39672b7150fc1b) --- .github/test-spec.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 1c45698e423d..af7db8adce71 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -54,7 +54,8 @@ - "tests/subsys/mgmt/mcumgr/**/*" "CI-dfu-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf54h20dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/**/*" - "drivers/console/**/*" - "drivers/flash/**/*" From 001f6d37d5cb33fa9cd29b0c0da521ec36e954f1 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Fri, 9 Jan 2026 11:35:33 +0100 Subject: [PATCH 1645/3334] [nrf noup] test-spec: update CI-ble-samples-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml Depend on actual used socs. Zephyr ble samples are not executed at all. Signed-off-by: Piotr Kosycarz (cherry picked from commit ceabc540fed74d3e1969b78f92dc0fbd7e815a3e) --- .github/test-spec.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index af7db8adce71..7588b157337a 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -115,7 +115,9 @@ - any: - "drivers/bluetooth/**/*" - any: - - "dts/arm/nordic/nrf5*" + - "dts/arm/nordic/nrf52*" + - "dts/arm/nordic/nrf53*" + - "dts/arm/nordic/nrf54*" - any: - "subsys/bluetooth/**/*" - "!subsys/bluetooth/mesh/**/*" @@ -123,7 +125,6 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/**/*" "CI-mesh-test": - "subsys/bluetooth/mesh/**/*" From f3f1f1664f30a33bf176e35bba0f91f5d5f5d5ce Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:29:12 +0100 Subject: [PATCH 1646/3334] [nrf noup] test-spec: update CI-rs-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit 59e3ced7c567e0b25c2513e49b11ac5a68299a6c) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 7588b157337a..79064e3febd0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -231,7 +231,11 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 28c3c0e4507b7cd7f9f38ad7e69eb8f182d6c1e2 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:30:48 +0100 Subject: [PATCH 1647/3334] [nrf noup] test-spec: update CI-thread-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit e77279a09ef4adbb6affd4f735a7e10644c7facc) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 79064e3febd0..df4166d8e6b0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -248,7 +248,11 @@ - "modules/mbedtls/**/*" - "modules/openthread/**/*" - "samples/net/openthread/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" From de24a82dab8f31b68d1405a9524d8f1325a61ca0 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:32:37 +0100 Subject: [PATCH 1648/3334] [nrf noup] test-spec: update CI-matter-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit a33f32a96e1fbcbff99ef8e0a4f8909018f218ed) --- .github/test-spec.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index df4166d8e6b0..aac297f11412 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -283,7 +283,12 @@ "CI-matter-test": - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/dfu/**/*" - "subsys/settings/**/*" - "subsys/net/**/*" From 7ed22d94fee4cd8c02c9a80697488c4bc0548130 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:34:16 +0100 Subject: [PATCH 1649/3334] [nrf noup] test-spec: update CI-fem-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit 338f4a025967dfe67242ebc8fc01706fb89697e5) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index aac297f11412..d91e0f0bd3a2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -204,7 +204,11 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 1ec4eaf22f2c3b21a9dc21f066d8e12ac5bfe0af Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:37:20 +0100 Subject: [PATCH 1650/3334] [nrf noup] test-spec: update CI-ble-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. test-ble is not validating nrf51 and nrf91, so it does not make sense to trigger ci on these changes. Signed-off-by: Piotr Kosycarz (cherry picked from commit 365da0027ced3963b5c7d8906a99c02d71fb4993) --- .github/test-spec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index d91e0f0bd3a2..ecf8102649dc 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -108,6 +108,8 @@ - "boards/nordic/nrf5*" - any: - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf9*" - any: - "subsys/pm/**/*" From 625f5ace806127b0c0674174b6dc945064ef17d5 Mon Sep 17 00:00:00 2001 From: Jorgen Kvalvaag Date: Fri, 9 Jan 2026 12:13:21 +0100 Subject: [PATCH 1651/3334] [nrf noup] test-spec: Reduce thingy91 scope Reduce thingy91 test scope. Signed-off-by: Jorgen Kvalvaag (cherry picked from commit 3fa188c6bf471d851b57537e1433aa8a31e15821) --- .github/test-spec.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index ecf8102649dc..fc74207ebd5f 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -149,14 +149,9 @@ - "drivers/net/**/*" - "drivers/serial/**/*" - "drivers/timer/**/*" - - "include/**/*" - - "kernel/**/*" - "lib/libc/common/source/stdlib/**/*" - "lib/libc/newlib/**/*" - "lib/libc/picolibc/**/*" - - "lib/os/**/*" - - "lib/posix/**/*" - - "misc/**/*" - "modules/mbedtls/**/*" - "soc/x86/ia32/**/*" - "subsys/fs/fcb/**/*" From 6dc1641e50fd4109ca79877baadf0de3e89d17e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magne=20V=C3=A6rnes?= Date: Mon, 19 Jan 2026 13:36:30 +0100 Subject: [PATCH 1652/3334] [nrf fromlist] lib: posix: add missing getopt_long guard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added ifdef guard (CONFIG_GETOPT_LONG) around the functions in getopt_shim.c that requires getopt_long implementation. Upstream PR #: 102505 Signed-off-by: Magne Værnes Signed-off-by: Tomasz Moń --- lib/posix/c_lib_ext/getopt_shim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/posix/c_lib_ext/getopt_shim.c b/lib/posix/c_lib_ext/getopt_shim.c index 1187c53440ab..251029b51cf2 100644 --- a/lib/posix/c_lib_ext/getopt_shim.c +++ b/lib/posix/c_lib_ext/getopt_shim.c @@ -34,6 +34,7 @@ void z_getopt_global_state_update_shim(struct sys_getopt_state *state) optarg = state->optarg; } +#if CONFIG_GETOPT_LONG int getopt_long(int argc, char *const argv[], const char *shortopts, const struct option *longopts, int *longind) { @@ -45,3 +46,4 @@ int getopt_long_only(int argc, char *const argv[], const char *shortopts, { return sys_getopt_long_only(argc, argv, shortopts, longopts, longind); } +#endif From 75fd7d271bc35e901e9041f60b1798386288cf8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 20 Jan 2026 08:33:43 +0100 Subject: [PATCH 1653/3334] [nrf fromlist] soc: nordic: common: nrf_sys_event: Fix missing return MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrf_sys_event_unregister was missing an immediate return when PPI was used by the handle. It was stepping into non-PPI case where an assert might have been triggered. Upstream PR #: 102549 Signed-off-by: Krzysztof Chruściński --- soc/nordic/common/nrf_sys_event.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 809ad2e71005..99c486f55410 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -112,6 +112,12 @@ BUILD_ASSERT(IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY_MANUAL) || static uint32_t event_ref_cnt; static uint32_t chan_mask; +/* Handle returned by the registering function can be a GRTC channel that was used which indicates + * that PPI RRAMC wake up is used. If manual mode is used (changing RRAMC power mode) than that + * handle value is used which exceeds any potential GRTC channel number. + */ +#define NRF_SYS_EVENT_MANUAL_HANDLE 32 + #define NVM_HW_WAKEUP_US 16 #define NVM_MANUAL_SUPPORT IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY_MANUAL) /* Due to software performance and risk of waking up too early (then RRAMC may go @@ -181,7 +187,7 @@ int event_register(union nrf_sys_evt_us us, bool force, bool abs) irq_low_latency_on(true); } event_ref_cnt++; - rv = 32; + rv = NRF_SYS_EVENT_MANUAL_HANDLE; } } @@ -203,11 +209,12 @@ int nrf_sys_event_unregister(int handle, bool cancel) __ASSERT_NO_MSG(handle >= 0); int rv = 0; - if (handle < 32) { + if (handle != NRF_SYS_EVENT_MANUAL_HANDLE) { if (cancel) { nrf_grtc_sys_counter_compare_event_disable(NRF_GRTC, handle); } atomic_or((atomic_t *)&chan_mask, BIT(handle)); + return rv; } LOCKED() { From 7695db46f30eb72c64feb7fd21a5a7565538b301 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 20 Jan 2026 11:39:47 +0200 Subject: [PATCH 1654/3334] [nrf noup] tests: benchmark: mbedtls: remove ARIA/Camellia ciphers nrf-squash! [nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto They are not supported in NCS. Remove their use from the test. Signed-off-by: Tomi Fontanilles --- tests/benchmarks/mbedtls/prj.conf | 2 -- tests/benchmarks/mbedtls/src/benchmark.c | 24 ------------------------ 2 files changed, 26 deletions(-) diff --git a/tests/benchmarks/mbedtls/prj.conf b/tests/benchmarks/mbedtls/prj.conf index ba24d6663924..944544eed5a3 100644 --- a/tests/benchmarks/mbedtls/prj.conf +++ b/tests/benchmarks/mbedtls/prj.conf @@ -11,8 +11,6 @@ CONFIG_PSA_WANT_ALG_SHA_384=y CONFIG_PSA_WANT_ALG_SHA_512=y CONFIG_PSA_WANT_KEY_TYPE_AES=y -CONFIG_PSA_WANT_KEY_TYPE_ARIA=y -CONFIG_PSA_WANT_KEY_TYPE_CAMELLIA=y CONFIG_PSA_WANT_ALG_ECB_NO_PADDING=y CONFIG_MAIN_STACK_SIZE=4096 diff --git a/tests/benchmarks/mbedtls/src/benchmark.c b/tests/benchmarks/mbedtls/src/benchmark.c index 890652d14a4e..02e9ec2171c2 100644 --- a/tests/benchmarks/mbedtls/src/benchmark.c +++ b/tests/benchmarks/mbedtls/src/benchmark.c @@ -112,30 +112,6 @@ int main(void) printk("Failed to import AES key (%d)", status); } - status = make_cipher_key(PSA_KEY_TYPE_ARIA, PSA_ALG_ECB_NO_PADDING, &key_id); - if (status == PSA_SUCCESS) { - COMPUTE_THROUGHPUT("ARIA-256-ECB", - psa_cipher_encrypt(key_id, PSA_ALG_ECB_NO_PADDING, - in_buf, sizeof(in_buf), - out_buf, sizeof(out_buf), &out_len) - ); - psa_destroy_key(key_id); - } else { - printk("Failed to import ARIA key (%d)", status); - } - - status = make_cipher_key(PSA_KEY_TYPE_CAMELLIA, PSA_ALG_ECB_NO_PADDING, &key_id); - if (status == PSA_SUCCESS) { - COMPUTE_THROUGHPUT("CAMELLIA-256-ECB", - psa_cipher_encrypt(key_id, PSA_ALG_ECB_NO_PADDING, - in_buf, sizeof(in_buf), - out_buf, sizeof(out_buf), &out_len) - ); - psa_destroy_key(key_id); - } else { - printk("Failed to import Camellia key (%d)", status); - } - printk("Benchmark completed\n"); return 0; } From d340a91cc52ec4e74b2384bfcf6e25d3b3104863 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Tue, 20 Jan 2026 15:44:37 +0100 Subject: [PATCH 1655/3334] [nrf fromlist] tests/subsys/dfu/img_util: DTS overlay for nRF52840dk Upstream PR #: 102583 Test scenarios assume that application fits into the boot_partition. Observed that application is too big now, which implies faliures. Added overlay with the increased size so tests can pass. Signed-off-by: Andrzej Puzdrowski --- .../boards/nrf52840dk_nrf52840.overlay | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/subsys/dfu/img_util/boards/nrf52840dk_nrf52840.overlay diff --git a/tests/subsys/dfu/img_util/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/dfu/img_util/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..d3fca8743776 --- /dev/null +++ b/tests/subsys/dfu/img_util/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,32 @@ +/* + * Copyright 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x10000>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 0x74000>; + }; + + slot1_partition: partition@84000 { + label = "image-1"; + reg = <0x00084000 0x74000>; + }; + }; +}; From d373b7dfa2ff013793bd37837616108a29c40250 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 21 Jan 2026 11:06:45 +0200 Subject: [PATCH 1656/3334] [nrf fromlist] net: posix: Avoid multiple definitions of IFNAMSIZ symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One might see this compile error depending on what order the POSIX headers are included include/zephyr/net/net_compat.h:143: error: "IFNAMSIZ" redefined .../zephyr/include/zephyr/net/net_compat.h:143: error: "IFNAMSIZ" redefined [-Werror] 143 | #define IFNAMSIZ NET_IFNAMSIZ | In file included from ... .../zephyr/include/zephyr/posix/net/if.h:16: note: this is the location of the previous definition 16 | #define IFNAMSIZ IF_NAMESIZE | Upstream PR #: 102622 Signed-off-by: Jukka Rissanen Signed-off-by: Tomasz Moń --- include/zephyr/net/net_compat.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/zephyr/net/net_compat.h b/include/zephyr/net/net_compat.h index c044d86cfa87..927c8d5087e9 100644 --- a/include/zephyr/net/net_compat.h +++ b/include/zephyr/net/net_compat.h @@ -140,7 +140,9 @@ extern "C" { #define IN6ADDR_ANY_INIT NET_IN6ADDR_ANY_INIT #define IN6ADDR_LOOPBACK_INIT NET_IN6ADDR_LOOPBACK_INIT +#if !defined(IFNAMSIZ) #define IFNAMSIZ NET_IFNAMSIZ +#endif /* IFNAMSIZ */ #define in_pktinfo net_in_pktinfo #define ip_mreqn net_ip_mreqn From 98fa3d82d5f21b5d4e4f179e85ed7ef8687d7513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 21 Jan 2026 08:55:41 +0100 Subject: [PATCH 1657/3334] [nrf fromlist] dts: bindings: clock: fix reference audio frequencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reference audio clock frequencies are supposed to be integer multiplies of sampling frequency (44100 * 256 = 11289600, 48000 * 256 = 12288000) and not some arbitrary numbers. Upstream PR #: 102619 Signed-off-by: Tomasz Moń --- include/zephyr/dt-bindings/clock/nrfs-audiopll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/dt-bindings/clock/nrfs-audiopll.h b/include/zephyr/dt-bindings/clock/nrfs-audiopll.h index b4c3975b5e15..a79a4061f266 100644 --- a/include/zephyr/dt-bindings/clock/nrfs-audiopll.h +++ b/include/zephyr/dt-bindings/clock/nrfs-audiopll.h @@ -8,8 +8,8 @@ #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRFS_AUDIOPLL_H_ #define NRFS_AUDIOPLL_FREQ_MIN 10666707 -#define NRFS_AUDIOPLL_FREQ_AUDIO_44K1 11289591 -#define NRFS_AUDIOPLL_FREQ_AUDIO_48K 12287963 +#define NRFS_AUDIOPLL_FREQ_AUDIO_44K1 11289600 +#define NRFS_AUDIOPLL_FREQ_AUDIO_48K 12288000 #define NRFS_AUDIOPLL_FREQ_MAX 13333292 #endif /* #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRFS_AUDIOPLL_H_ */ From dc70fe434fd4e2ee9ad0cdb0b990f97651856ec8 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Fri, 23 Jan 2026 11:01:06 +0200 Subject: [PATCH 1658/3334] [nrf fromlist] modules: mbedtls: remove extra spaces in config-mbedtls.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Title. Upstream PR #: 102629 Signed-off-by: Tomi Fontanilles Signed-off-by: Tomasz Moń --- modules/mbedtls/configs/config-mbedtls.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mbedtls/configs/config-mbedtls.h b/modules/mbedtls/configs/config-mbedtls.h index d574071885fe..d241031ddfb7 100644 --- a/modules/mbedtls/configs/config-mbedtls.h +++ b/modules/mbedtls/configs/config-mbedtls.h @@ -462,8 +462,8 @@ #define MBEDTLS_PKCS5_C #endif -#define MBEDTLS_SSL_IN_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN -#define MBEDTLS_SSL_OUT_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN +#define MBEDTLS_SSL_IN_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN +#define MBEDTLS_SSL_OUT_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN /* Enable OpenThread optimizations. */ #if defined(CONFIG_MBEDTLS_OPENTHREAD_OPTIMIZATIONS_ENABLED) @@ -525,7 +525,7 @@ #if defined(CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT) #define MBEDTLS_PSA_CRYPTO_CLIENT #define MBEDTLS_PSA_CRYPTO_CONFIG -#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "config-psa.h" +#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "config-psa.h" #endif #if defined(CONFIG_MBEDTLS_SSL_PROTO_TLS1_2) && defined(CONFIG_MBEDTLS_PSA_CRYPTO_C) From e03f98f4a28abe14377f729a40b1c1350d162f24 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Wed, 21 Jan 2026 12:07:34 +0200 Subject: [PATCH 1659/3334] [nrf fromlist] tests: crypto: mbedtls_psa: use static key slots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To avoid needing heap for PSA key slots. Upstream PR #: 102629 Signed-off-by: Tomi Fontanilles Signed-off-by: Tomasz Moń --- tests/crypto/mbedtls_psa/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/crypto/mbedtls_psa/prj.conf b/tests/crypto/mbedtls_psa/prj.conf index 233742c1d30f..9b66a86493f6 100644 --- a/tests/crypto/mbedtls_psa/prj.conf +++ b/tests/crypto/mbedtls_psa/prj.conf @@ -3,6 +3,7 @@ CONFIG_ZTEST=y CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y CONFIG_PSA_WANT_ALG_MD5=y CONFIG_PSA_WANT_ALG_SHA_1=y From 2eb8603cc6f617f3b49407be935470138f6f3d4e Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Wed, 21 Jan 2026 12:15:53 +0200 Subject: [PATCH 1660/3334] [nrf fromlist] tests: crypto: mbedtls_psa: remove MD5 test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MD5 is a weak hash algorithm that is not supported by all PSA Crypto implementations. Remove its usage for compatibility. Upstream PR #: 102629 Signed-off-by: Tomi Fontanilles Signed-off-by: Tomasz Moń --- tests/crypto/mbedtls_psa/prj.conf | 1 - tests/crypto/mbedtls_psa/src/main.c | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/tests/crypto/mbedtls_psa/prj.conf b/tests/crypto/mbedtls_psa/prj.conf index 9b66a86493f6..fcc619fbcf74 100644 --- a/tests/crypto/mbedtls_psa/prj.conf +++ b/tests/crypto/mbedtls_psa/prj.conf @@ -5,7 +5,6 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y -CONFIG_PSA_WANT_ALG_MD5=y CONFIG_PSA_WANT_ALG_SHA_1=y CONFIG_PSA_WANT_ALG_SHA_224=y CONFIG_PSA_WANT_ALG_SHA_256=y diff --git a/tests/crypto/mbedtls_psa/src/main.c b/tests/crypto/mbedtls_psa/src/main.c index 449db10e17d0..74da439b0a5d 100644 --- a/tests/crypto/mbedtls_psa/src/main.c +++ b/tests/crypto/mbedtls_psa/src/main.c @@ -22,23 +22,6 @@ ZTEST_USER(test_mbedtls_psa, test_generate_random) zassert_equal(status, PSA_SUCCESS); } -ZTEST_USER(test_mbedtls_psa, test_md5) -{ - uint8_t in_buf[] = { 'a' }; - uint8_t out_buf[PSA_HASH_LENGTH(PSA_ALG_MD5)] = { 0 }; - uint8_t out_buf_ref[PSA_HASH_LENGTH(PSA_ALG_MD5)] = { - 0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8, - 0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 - }; - size_t out_len; - psa_status_t status; - - status = psa_hash_compute(PSA_ALG_MD5, in_buf, sizeof(in_buf), - out_buf, sizeof(out_buf), &out_len); - zassert_equal(status, PSA_SUCCESS); - zassert_mem_equal(out_buf, out_buf_ref, sizeof(out_buf_ref)); -} - ZTEST_USER(test_mbedtls_psa, test_sha1) { uint8_t in_buf[] = { 'a' }; From 43618e9a32b9aa9b125b26e52bbf8964f6ebe99d Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 22 Jan 2026 07:31:24 +0100 Subject: [PATCH 1661/3334] [nrf noup] drivers: pinctrl: Update SOC_SERIES_NRF*X Kconfig to remove X nrf-squash! [nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration The Kconfig was changed upstream. Align usage in our noups. Signed-off-by: Grzegorz Swiderski --- drivers/pinctrl/pinctrl_nrf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 3ad358158a80..a7a36410769c 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -151,10 +151,10 @@ static void port_pin_clock_set(uint16_t pin_number, bool enable) #if DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || \ defined(CONFIG_MSPI_HPF) || \ DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(nordic_nrf_vpr_coprocessor, pinctrl_0) -#if defined(CONFIG_SOC_SERIES_NRF54LX) +#if defined(CONFIG_SOC_SERIES_NRF54L) #define NRF_PSEL_SDP_MSPI(psel) \ nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_VPR); -#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#elif defined(CONFIG_SOC_SERIES_NRF54H) /* On nRF54H, pin routing is controlled by secure domain, via UICR. */ #define NRF_PSEL_SDP_MSPI(psel) #endif From 8f08a9a21c56b8ff3e7b6c1bfdbabb370c90392d Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 22 Jan 2026 07:31:24 +0100 Subject: [PATCH 1662/3334] [nrf noup] modules: hal_nordic: Update SOC_SERIES_NRF*X Kconfig to remove X nrf-squash! [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS The Kconfig was changed upstream. Align usage in our noups. Signed-off-by: Grzegorz Swiderski --- modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h index 2c1fe3640493..26e8ea67cbea 100644 --- a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h +++ b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h @@ -13,12 +13,12 @@ #define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK #elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) #define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71) #define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK #define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK #define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#elif defined(CONFIG_SOC_SERIES_NRF54H) #define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK #define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK #define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ @@ -34,12 +34,12 @@ #define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK #elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) #define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71) #define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK #define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK #define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#elif defined(CONFIG_SOC_SERIES_NRF54H) #define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK #else #error Unsupported chip family From 4d28ae74aaada42e84c63fa53e4ab12094a007cb Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 22 Jan 2026 07:31:24 +0100 Subject: [PATCH 1663/3334] [nrf noup] samples: sysbuild: Update SOC_SERIES_NRF*X Kconfig to remove X nrf-squash! [nrf noup] samples: sysbuild: hello_world: support PM on nRF53 The Kconfig was changed upstream. Align usage in our noups. Signed-off-by: Grzegorz Swiderski --- samples/sysbuild/hello_world/sysbuild.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index 654c4175faac..b86a7659fdd6 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -9,12 +9,12 @@ if(DEFINED SB_CONFIG_REMOTE_BOARD) BOARD_REVISION ${BOARD_REVISION} ) - if(SB_CONFIG_SOC_SERIES_NRF53X) + if(SB_CONFIG_SOC_SERIES_NRF53) set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") - else(SB_CONFIG_SOC_SERIES_NRF54LX) + else(SB_CONFIG_SOC_SERIES_NRF54L) set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) From 9a111ef8fb1a615996e69833bbd9468a150bd28a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 22 Jan 2026 07:31:16 +0000 Subject: [PATCH 1664/3334] [nrf noup] sysbuild: Disable slot1 variant when PM is used nrf-squash! [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions This feature conflicts with PM, prevent it being used when PM is enabled Signed-off-by: Jamie McCrae --- share/sysbuild/images/bootloader/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/share/sysbuild/images/bootloader/Kconfig b/share/sysbuild/images/bootloader/Kconfig index 40790490cda6..01849e54210e 100644 --- a/share/sysbuild/images/bootloader/Kconfig +++ b/share/sysbuild/images/bootloader/Kconfig @@ -153,6 +153,7 @@ endchoice config MCUBOOT_DIRECT_XIP_GENERATE_VARIANT bool "Generate slot 1 variant image [EXPERIMENTAL]" depends on MCUBOOT_MODE_DIRECT_XIP || MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT + depends on !PARTITION_MANAGER select EXPERIMENTAL default y help From aeccbe456ff7cd83e54841681a3a31d6c2b1feb9 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 22 Jan 2026 07:59:43 +0000 Subject: [PATCH 1665/3334] [nrf noup] soc: nordic: common: Fix updated SoC series Kconfig nrf-squash! [nrf noup] dts: choose a crypto accelerator for entropy Also the underlying patch should never have been added to sdk-zephyr Signed-off-by: Jamie McCrae --- soc/nordic/common/Kconfig.peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 248f490dce59..77c4f3b98399 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -14,7 +14,7 @@ config HAS_HW_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) + ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91) config HAS_HW_NRF_CC312 def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \ From bdb7f070b09962ededeb0377aa95b6cdc19e3be7 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 22 Jan 2026 11:24:08 +0200 Subject: [PATCH 1666/3334] [nrf fromlist] samples: drivers: crypto: fix failing test on qemu_cortex_m3/ti_lm3s6965 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PSA setup functions would return -141 (`PSA_ERROR_INSUFFICIENT_MEMORY`). Increasing the heap size makes the test run successfully. Upstream PR #: 102702 Signed-off-by: Tomi Fontanilles Signed-off-by: Tomasz Moń --- samples/drivers/crypto/prj_mtls_shim.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/drivers/crypto/prj_mtls_shim.conf b/samples/drivers/crypto/prj_mtls_shim.conf index 5954fe5f9f3c..a8a088c88be9 100644 --- a/samples/drivers/crypto/prj_mtls_shim.conf +++ b/samples/drivers/crypto/prj_mtls_shim.conf @@ -1,5 +1,5 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_BUILTIN=y -CONFIG_MBEDTLS_HEAP_SIZE=1024 +CONFIG_MBEDTLS_HEAP_SIZE=2048 CONFIG_CRYPTO_MBEDTLS_SHIM=y From 529a26dc1884a96a687035f781007b0fab333af2 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 22 Jan 2026 14:48:31 +0000 Subject: [PATCH 1667/3334] [nrf noup] boards: nordic: nrf7002dk: Fix include files nrf-squash! [nrf noup] boards: nordic: nrf7002dk: Bring back NS variants Fixes include files so that they use the new updated paths Signed-off-by: Jamie McCrae --- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 2 +- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts index 5ff28accf3fc..ac863872d55d 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "nrf5340_cpuapp_common.dtsi" / { diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 9c06a17ad7bf..8225e992bb82 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "nrf5340_cpuapp_common.dtsi" #include "nordic/nrf5340_sram_partition.dtsi" #include "nordic/nrf5340_cpuapp_ns_partition.dtsi" From 8025e2ec04a513acfae96d0561486b0d278ec53b Mon Sep 17 00:00:00 2001 From: Mirko Covizzi Date: Thu, 10 Mar 2022 00:25:50 -0800 Subject: [PATCH 1668/3334] [nrf noup] net: mqtt: add native TLS support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make MQTT `set_native_tls` option work w/o socket dispatcher enabled. Signed-off-by: Mirko Covizzi Signed-off-by: Robert Lubos Signed-off-by: Tomasz Moń (cherry picked from commit bc094738b4385dca505a5afe63d8152c348dd029) --- subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index fa854c5505f9..6a08497ee7ba 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -22,10 +22,15 @@ int mqtt_client_tls_connect(struct mqtt_client *client) { const struct net_sockaddr *broker = client->broker; struct mqtt_sec_config *tls_config = &client->transport.tls.config; + int type = NET_SOCK_STREAM; int ret; + if (!IS_ENABLED(CONFIG_NET_SOCKETS_OFFLOAD_DISPATCHER) && tls_config->set_native_tls) { + type |= SOCK_NATIVE_TLS; + } + client->transport.tls.sock = zsock_socket(broker->sa_family, - NET_SOCK_STREAM, NET_IPPROTO_TLS_1_2); + type, NET_IPPROTO_TLS_1_2); if (client->transport.tls.sock < 0) { return -errno; } From aa7b0fab11bc88edf7ab7c93cf024419a73a52d2 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Tue, 27 Jan 2026 10:38:49 +0100 Subject: [PATCH 1669/3334] [nrf fromlist] doc: domain: Disable warnings when board catalog not present With the introduction of the board-catalog role in cd6b1f5c61a0beb98331614a77262fecbf9bff5e, using the Zephyr doc infrastructure without a board catalog instantiated leads to a warning. Avoid this by disabling the warnings for this role. Upstream PR #: 102959 Signed-off-by: Carles Cufi (cherry picked from commit c0132674cdc153f2e7fa372edccbd89a79ac286c) --- doc/_extensions/zephyr/domain/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_extensions/zephyr/domain/__init__.py b/doc/_extensions/zephyr/domain/__init__.py index ece106a0c430..ce745a75683d 100644 --- a/doc/_extensions/zephyr/domain/__init__.py +++ b/doc/_extensions/zephyr/domain/__init__.py @@ -1155,7 +1155,7 @@ class ZephyrDomain(Domain): "code-sample": XRefRole(innernodeclass=nodes.inline, warn_dangling=True), "code-sample-category": XRefRole(innernodeclass=nodes.inline, warn_dangling=True), "board": XRefRole(innernodeclass=nodes.inline, warn_dangling=True), - "board-catalog": XRefRole(innernodeclass=nodes.inline, warn_dangling=True), + "board-catalog": XRefRole(innernodeclass=nodes.inline, warn_dangling=False), } directives = { From 3c36fcd3cdccb4d417e86452ffc686e84e6d03f7 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Fri, 21 Nov 2025 15:18:14 +0000 Subject: [PATCH 1670/3334] [nrf fromtree] drivers: mspi_dw: fix DMA transfer size logic Fixing of erroneous RXTRANSFERLENGTH and number of transfer frames calculation. Signed-off-by: David Jewsbury (cherry picked from commit a2b583081a85022bf0bf93ff9ae5b6170f828633) --- drivers/mspi/mspi_dw.c | 15 +++++++++------ drivers/mspi/mspi_dw_vendor_specific.h | 5 ++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index d26a537e8af9..bb91ec984d35 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -160,6 +160,9 @@ DEFINE_MM_REG_WR(xip_write_wrap_inst, 0x144) DEFINE_MM_REG_WR(xip_write_ctrl, 0x148) #endif +/* Ceiling division by 32 */ +#define CEIL_DIV_32(x) (((x) + 31U) >> 5) + #include "mspi_dw_vendor_specific.h" static int start_next_packet(const struct device *dev); @@ -1274,16 +1277,16 @@ static int start_next_packet(const struct device *dev) #if defined(CONFIG_MSPI_DMA) if (dev_data->xfer.xfer_mode == MSPI_DMA) { /* For DMA mode, set start level based on transfer length to prevent underflow */ - uint32_t total_transfer_bytes = packet->num_bytes + dev_data->xfer.addr_length + - dev_data->xfer.cmd_length; - uint32_t transfer_frames = total_transfer_bytes >> dev_data->bytes_per_frame_exp; + uint32_t transfer_frames = (packet->num_bytes >> dev_data->bytes_per_frame_exp) + + CEIL_DIV_32(dev_data->xfer.addr_length) + + CEIL_DIV_32(dev_data->xfer.cmd_length); - /* Use minimum of transfer length or FIFO depth, but at least 1 */ + /* Above dma_start_level, the transfer will start. + * Use minimum of transfer length and FIFO depth. + */ uint8_t dma_start_level = MIN(transfer_frames - 1, dev_config->tx_fifo_depth_minus_1); - dma_start_level = (dma_start_level > 0 ? dma_start_level : 1); - /* Only TXFTHR needs to be set to the minimum number of frames */ write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, dma_start_level)); write_dmatdlr(dev, FIELD_PREP(DMATDLR_DMATDL_MASK, dev_config->dma_tx_data_level)); diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index d994f579ad8e..2c26cfa1b1ee 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -251,9 +251,8 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) transfer_list->rx_job = &joblist[job_idx]; tmod = QSPI_TMOD_TX_ONLY; } else { - preg->CONFIG.RXTRANSFERLENGTH = ((packet->num_bytes + dev_data->xfer.addr_length + - dev_data->xfer.cmd_length) >> - dev_data->bytes_per_frame_exp) - 1; + preg->CONFIG.RXTRANSFERLENGTH = ((packet->num_bytes) >> + dev_data->bytes_per_frame_exp); /* If sending address or command while being configured as controller */ if (job_idx > 0 && config->op_mode == MSPI_OP_MODE_CONTROLLER) { From 3a1ec57a78889643bbde01b31c4ced3be369e467 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Fri, 21 Nov 2025 15:27:02 +0000 Subject: [PATCH 1671/3334] [nrf fromtree] drivers: mspi_dw: nrf_qspi_v2: Add ifdef to include DMA code if enabled DMA functions will not only be included if enabled for the nrf_qspi_v2 peripheral Signed-off-by: David Jewsbury (cherry picked from commit 2043119bcc346a4f60c1a2bc516d8103d2b1f6b5) --- drivers/mspi/mspi_dw_vendor_specific.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index 2c26cfa1b1ee..fbdd0119d383 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -138,6 +138,7 @@ static inline void vendor_specific_irq_clear(const struct device *dev) preg->EVENTS_DMA.DONE = 0; } +#if defined(CONFIG_MSPI_DMA) /* DMA support */ #define EVDMA_ATTR_LEN_Pos (0UL) @@ -308,6 +309,7 @@ static inline bool vendor_specific_read_dma_irq(const struct device *dev) return (bool) preg->EVENTS_DMA.DONE; } +#endif /*defined(CONFIG_MSPI_DMA)*/ #else /* Supply empty vendor specific macros for generic case */ From 02597955642fc2f435ec99485163f831af545e55 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Mon, 24 Nov 2025 17:59:41 +0000 Subject: [PATCH 1672/3334] [nrf fromtree] drivers: mspi_dw: nrf_qspi_v2: Remove redundant EVDMA definitions EVDMA register access has been cleaned up to remove redundant macros. EVDMA_PLAIN_DATA enum has also been added of value 0x3F which previously had been assumed to be a masking of all the other values but isn't, it's its own distinct value. Other enums still exist for future use. Signed-off-by: David Jewsbury (cherry picked from commit 1cbaa5f3f516ece44d7ce8d4c95633d1ff7273bc) --- drivers/mspi/mspi_dw_vendor_specific.h | 29 +++++++------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index fbdd0119d383..f3627132f669 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -140,19 +140,9 @@ static inline void vendor_specific_irq_clear(const struct device *dev) #if defined(CONFIG_MSPI_DMA) /* DMA support */ - -#define EVDMA_ATTR_LEN_Pos (0UL) -#define EVDMA_ATTR_LEN_Msk (0x00FFFFFFUL) - #define EVDMA_ATTR_ATTR_Pos (24UL) #define EVDMA_ATTR_ATTR_Msk (0x3FUL << EVDMA_ATTR_ATTR_Pos) -#define EVDMA_ATTR_32AXI_Pos (30UL) -#define EVDMA_ATTR_32AXI_Msk (0x1UL << EVDMA_ATTR_32AXI_Pos) - -#define EVDMA_ATTR_EVENTS_Pos (31UL) -#define EVDMA_ATTR_EVENTS_Msk (0x1UL << EVDMA_ATTR_EVENTS_Pos) - typedef enum { EVDMA_BYTE_SWAP = 0, EVDMA_JOBLIST = 1, @@ -160,13 +150,9 @@ typedef enum { EVDMA_FIXED_ATTR = 3, EVDMA_STATIC_ADDR = 4, EVDMA_PLAIN_DATA_BUF_WR = 5, + EVDMA_PLAIN_DATA = 0x3f, } EVDMA_ATTR_Type; -/* Setup EVDMA attribute with the following configuratrion */ -#define EVDMA_ATTRIBUTE (BIT(EVDMA_BYTE_SWAP) | BIT(EVDMA_JOBLIST) | \ - BIT(EVDMA_BUFFER_FILL) | BIT(EVDMA_FIXED_ATTR) | \ - BIT(EVDMA_STATIC_ADDR) | BIT(EVDMA_PLAIN_DATA_BUF_WR)) - typedef struct { uint8_t *addr; uint32_t attr; @@ -229,13 +215,14 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) /* * The Command and Address will always have a length of 4 from the DMA's - * perspective. QSPI peripheral will use length of data specified in core registers + * perspective. QSPI peripheral will use length of data specified in core registers. + * Since the cmd and address are stored as uint32_t, byte swap is never needed. */ if (dev_data->xfer.cmd_length > 0) { - joblist[job_idx++] = EVDMA_JOB(&packet->cmd, 4, EVDMA_ATTRIBUTE); + joblist[job_idx++] = EVDMA_JOB(&packet->cmd, 4, EVDMA_PLAIN_DATA); } if (dev_data->xfer.addr_length > 0) { - joblist[job_idx++] = EVDMA_JOB(&packet->address, 4, EVDMA_ATTRIBUTE); + joblist[job_idx++] = EVDMA_JOB(&packet->address, 4, EVDMA_PLAIN_DATA); } if (packet->dir == MSPI_TX) { @@ -243,7 +230,7 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) if (packet->num_bytes > 0) { joblist[job_idx++] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_ATTRIBUTE); + EVDMA_PLAIN_DATA); } /* Always terminate with null job */ @@ -263,7 +250,7 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) joblist[job_idx++] = EVDMA_NULL_JOB(); transfer_list->rx_job = &joblist[job_idx]; joblist[job_idx++] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_ATTRIBUTE); + EVDMA_PLAIN_DATA); joblist[job_idx] = EVDMA_NULL_JOB(); } else { /* Sending command or address while configured as target isn't supported */ @@ -271,7 +258,7 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) transfer_list->rx_job = &joblist[0]; joblist[0] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_ATTRIBUTE); + EVDMA_PLAIN_DATA); joblist[1] = EVDMA_NULL_JOB(); transfer_list->tx_job = &joblist[1]; } From 86faecec4d17a7b2a61f77ba0e47aef13a6ed63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 22 Jan 2026 11:50:01 +0100 Subject: [PATCH 1673/3334] [nrf fromlist] tests: arch: arm_irq_advanced_features: allow overriding IRQ offset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default (CONFIG_NUM_IRQS - 1) does not always work, as proven in other cases in this test. Finding the free IRQ during runtime is not possible, as DIRECT_DYNAMIC_CONNECT requires constant value. Thus, added Kconfig option to override the maximum IRQ offset at build time. Upstream PR #: 102712 Signed-off-by: Michał Stasiak --- tests/arch/arm/arm_irq_advanced_features/Kconfig | 8 ++++++++ .../src/arm_dynamic_direct_interrupts.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/arch/arm/arm_irq_advanced_features/Kconfig diff --git a/tests/arch/arm/arm_irq_advanced_features/Kconfig b/tests/arch/arm/arm_irq_advanced_features/Kconfig new file mode 100644 index 000000000000..8efcea753559 --- /dev/null +++ b/tests/arch/arm/arm_irq_advanced_features/Kconfig @@ -0,0 +1,8 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config TEST_DIRECT_IRQ_MAX + int "Max offset of direct IRQ used for the test" + default NUM_IRQS + +source "Kconfig.zephyr" diff --git a/tests/arch/arm/arm_irq_advanced_features/src/arm_dynamic_direct_interrupts.c b/tests/arch/arm/arm_irq_advanced_features/src/arm_dynamic_direct_interrupts.c index fc64cb3fb3fb..9bbc618f26f8 100644 --- a/tests/arch/arm/arm_irq_advanced_features/src/arm_dynamic_direct_interrupts.c +++ b/tests/arch/arm/arm_irq_advanced_features/src/arm_dynamic_direct_interrupts.c @@ -13,7 +13,7 @@ #ifdef CONFIG_2ND_LVL_ISR_TBL_OFFSET #define DIRECT_ISR_OFFSET (CONFIG_2ND_LVL_ISR_TBL_OFFSET - 1) #else -#define DIRECT_ISR_OFFSET (CONFIG_NUM_IRQS - 1) +#define DIRECT_ISR_OFFSET (CONFIG_TEST_DIRECT_IRQ_MAX - 1) #endif static volatile int test_flag; From a30979d44c81b6cf232090f501b18a78f890ad55 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Wed, 28 Jan 2026 12:06:38 +0100 Subject: [PATCH 1674/3334] Revert "[nrf noup] Revert "twister: Use natural sort when generating hardware map"" This reverts commit f76435ad17df3335784224e252759fb121416fff. Signed-off-by: Robert Lubos --- scripts/pylib/twister/twisterlib/hardwaremap.py | 2 +- scripts/requirements-run-test.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index ed8eced167ac..6bbf22099c32 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -399,7 +399,7 @@ def save(self, hwm_file): boot_ids = [] # use existing map - self.detected.sort(key=lambda x: x.serial or '') + self.detected = natsorted(self.detected, key=lambda x: x.serial or '') if os.path.exists(hwm_file): with open(hwm_file) as yaml_file: hwm = yaml.load(yaml_file, Loader=SafeLoader) diff --git a/scripts/requirements-run-test.txt b/scripts/requirements-run-test.txt index 495d9a817876..32b6e06bff06 100644 --- a/scripts/requirements-run-test.txt +++ b/scripts/requirements-run-test.txt @@ -7,6 +7,7 @@ pyocd>=0.36.0 # used by twister for board/hardware map tabulate +natsort # used by mcuboot cbor>=1.0.0 From 67058a75c356b8ef6bcba6f8179e9843090d509c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 28 Jan 2026 12:07:29 +0000 Subject: [PATCH 1675/3334] Revert "[nrf noup] kernel: banner: Make function weak" This reverts commit 40e3a644f6bd47d0cdccfcb0897f60ed5ab35a5a. 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 a16784cb975c..5cadda0a5e98 100644 --- a/kernel/banner.c +++ b/kernel/banner.c @@ -24,7 +24,7 @@ #endif /* BUILD_VERSION */ #endif /* !BANNER_VERSION */ -__weak void boot_banner(void) +void boot_banner(void) { #if defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0) #ifdef CONFIG_BOOT_BANNER From 3994b45b4e8f59d75108a3a6ead95a78ee889e09 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 08:34:56 +0000 Subject: [PATCH 1676/3334] Revert "[nrf noup] kernel: Disable boot banner if NCS_BOOT_BANNER is enabled" This reverts commit f6c88a812e52fa650423b7a3af633d4648da143a. Signed-off-by: Jamie McCrae --- kernel/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/Kconfig b/kernel/Kconfig index 5de8a1f097c1..52ef3d531aae 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -457,7 +457,6 @@ config SKIP_BSS_CLEAR config BOOT_BANNER bool "Boot banner" default y - depends on !NCS_BOOT_BANNER select PRINTK select EARLY_CONSOLE help From d1d515d38b1981dfc0e6fad1d4f7d5a53d8ae743 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Thu, 15 Jan 2026 13:45:51 +0100 Subject: [PATCH 1677/3334] [nrf fromtree] dts: bindings: misc: add model for skyworks sky13348 antenna switch Add devicetree model for skyworks sky13348 antenna switch. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit fe971ddeb4e1c90112a80fcb3585a652d6b51632) --- dts/bindings/misc/skyworks,sky13348.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 dts/bindings/misc/skyworks,sky13348.yaml diff --git a/dts/bindings/misc/skyworks,sky13348.yaml b/dts/bindings/misc/skyworks,sky13348.yaml new file mode 100644 index 000000000000..000e50a3ae63 --- /dev/null +++ b/dts/bindings/misc/skyworks,sky13348.yaml @@ -0,0 +1,18 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Output selectors on the SKY13348 GaAs SPDT FET I/C switch + +compatible: "skyworks,sky13348" + +include: base.yaml + +properties: + v1-gpios: + type: phandle-array + required: true + description: V1 pin + v2-gpios: + type: phandle-array + required: true + description: V2 pin From a7f9ca07bafd12d13f5610d801c104244cc88834 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Thu, 15 Jan 2026 13:47:05 +0100 Subject: [PATCH 1678/3334] [nrf fromtree] boards: nordic: introduce nrf54l15tag Introduce the nrf54l15tag board which is a hardware platform for designing and developing applications with the nrf54l15 soc. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 453667691f92e51a9607801c6f97fcce49ada857) --- boards/nordic/nrf54l15tag/Kconfig | 30 +++ boards/nordic/nrf54l15tag/Kconfig.defconfig | 27 +++ boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag | 8 + boards/nordic/nrf54l15tag/board.cmake | 19 ++ boards/nordic/nrf54l15tag/board.yml | 48 +++++ .../nrf54l15tag/doc/img/nrf54l15tag.webp | Bin 0 -> 31422 bytes .../doc/img/nrf54l15tag_debug.webp | Bin 0 -> 28458 bytes boards/nordic/nrf54l15tag/doc/index.rst | 85 ++++++++ .../nrf54l15tag/nrf54l15tag_common.dtsi | 190 ++++++++++++++++++ .../nrf54l15tag_cpuapp_common.dtsi | 114 +++++++++++ .../nrf54l15tag_cpuflpr_common.dtsi | 22 ++ .../nrf54l15tag_nrf54l15_cpuapp.dts | 27 +++ .../nrf54l15tag_nrf54l15_cpuapp.yaml | 24 +++ .../nrf54l15tag_nrf54l15_cpuapp_defconfig | 5 + .../nrf54l15tag_nrf54l15_cpuapp_ns.dts | 31 +++ .../nrf54l15tag_nrf54l15_cpuapp_ns.yaml | 23 +++ .../nrf54l15tag_nrf54l15_cpuapp_ns_defconfig | 31 +++ .../nrf54l15tag_nrf54l15_cpuflpr.dts | 40 ++++ .../nrf54l15tag_nrf54l15_cpuflpr.yaml | 17 ++ .../nrf54l15tag_nrf54l15_cpuflpr_defconfig | 8 + .../nrf54l15tag_nrf54l15_cpuflpr_xip.dts | 27 +++ .../nrf54l15tag_nrf54l15_cpuflpr_xip.yaml | 17 ++ ...nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig | 7 + 23 files changed, 800 insertions(+) create mode 100644 boards/nordic/nrf54l15tag/Kconfig create mode 100644 boards/nordic/nrf54l15tag/Kconfig.defconfig create mode 100644 boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag create mode 100644 boards/nordic/nrf54l15tag/board.cmake create mode 100644 boards/nordic/nrf54l15tag/board.yml create mode 100644 boards/nordic/nrf54l15tag/doc/img/nrf54l15tag.webp create mode 100644 boards/nordic/nrf54l15tag/doc/img/nrf54l15tag_debug.webp create mode 100644 boards/nordic/nrf54l15tag/doc/index.rst create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_common.dtsi create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_cpuapp_common.dtsi create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_cpuflpr_common.dtsi create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.dts create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.yaml create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_defconfig create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.dts create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.yaml create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns_defconfig create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.yaml create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_defconfig create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.yaml create mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig diff --git a/boards/nordic/nrf54l15tag/Kconfig b/boards/nordic/nrf54l15tag/Kconfig new file mode 100644 index 000000000000..e2f267bb829e --- /dev/null +++ b/boards/nordic/nrf54l15tag/Kconfig @@ -0,0 +1,30 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# nRF54L15 TAG board configuration + +if BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS diff --git a/boards/nordic/nrf54l15tag/Kconfig.defconfig b/boards/nordic/nrf54l15tag/Kconfig.defconfig new file mode 100644 index 000000000000..20fad4b04be6 --- /dev/null +++ b/boards/nordic/nrf54l15tag/Kconfig.defconfig @@ -0,0 +1,27 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +if SPI_NOR + +config SPI_NOR_FLASH_LAYOUT_PAGE_SIZE + default 4096 if MCUBOOT || BOOTLOADER_MCUBOOT + +endif # SPI_NOR + +if BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS + +config BOARD_NRF54L15TAG + select USE_DT_CODE_PARTITION + +config HAS_BT_CTLR + default BT + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y + +endif # BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS diff --git a/boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag b/boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag new file mode 100644 index 000000000000..48a6fb2c79f0 --- /dev/null +++ b/boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_NRF54L15TAG + select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15TAG_NRF54L15_CPUAPP || \ + BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS + select SOC_NRF54L15_CPUFLPR if BOARD_NRF54L15TAG_NRF54L15_CPUFLPR || \ + BOARD_NRF54L15TAG_NRF54L15_CPUFLPR_XIP diff --git a/boards/nordic/nrf54l15tag/board.cmake b/boards/nordic/nrf54l15tag/board.cmake new file mode 100644 index 000000000000..8750e32d0bb4 --- /dev/null +++ b/boards/nordic/nrf54l15tag/board.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if(CONFIG_SOC_NRF54L15_CPUAPP) + board_runner_args(jlink "--device=nRF54L15_M33" "--speed=4000") +elseif(CONFIG_SOC_NRF54L15_CPUFLPR) + board_runner_args(jlink "--device=nRF54L15_RV32") +endif() + +if(CONFIG_TRUSTED_EXECUTION_NONSECURE) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) +endif() + +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nordic/nrf54l15tag/board.yml b/boards/nordic/nrf54l15tag/board.yml new file mode 100644 index 000000000000..c482665487be --- /dev/null +++ b/boards/nordic/nrf54l15tag/board.yml @@ -0,0 +1,48 @@ +board: + name: nrf54l15tag + full_name: nRF54L15 TAG + vendor: nordic + socs: + - name: nrf54l15 + variants: + - name: xip + cpucluster: cpuflpr + - name: ns + cpucluster: cpuapp +runners: + run_once: + '--recover': + - runners: + - nrfjprog + - nrfutil + run: first + groups: + - boards: + - nrf54l15tag/nrf54l15/cpuapp + - nrf54l15tag/nrf54l15/cpuapp/ns + - nrf54l15tag/nrf54l15/cpuflpr + - nrf54l15tag/nrf54l15/cpuflpr/xip + '--erase': + - runners: + - nrfjprog + - jlink + - nrfutil + run: first + groups: + - boards: + - nrf54l15tag/nrf54l15/cpuapp + - nrf54l15tag/nrf54l15/cpuapp/ns + - nrf54l15tag/nrf54l15/cpuflpr + - nrf54l15tag/nrf54l15/cpuflpr/xip + '--reset': + - runners: + - nrfjprog + - jlink + - nrfutil + run: last + groups: + - boards: + - nrf54l15tag/nrf54l15/cpuapp + - nrf54l15tag/nrf54l15/cpuapp/ns + - nrf54l15tag/nrf54l15/cpuflpr + - nrf54l15tag/nrf54l15/cpuflpr/xip diff --git a/boards/nordic/nrf54l15tag/doc/img/nrf54l15tag.webp b/boards/nordic/nrf54l15tag/doc/img/nrf54l15tag.webp new file mode 100644 index 0000000000000000000000000000000000000000..49e4ab27d06e2659d1d6b1a2ba154512d1a533ab GIT binary patch literal 31422 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 literal 0 HcmV?d00001 diff --git a/boards/nordic/nrf54l15tag/doc/img/nrf54l15tag_debug.webp b/boards/nordic/nrf54l15tag/doc/img/nrf54l15tag_debug.webp new file mode 100644 index 0000000000000000000000000000000000000000..a3a0ce478f494e001ba5fca67ebbc42ae0760146 GIT binary patch literal 28458 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 literal 0 HcmV?d00001 diff --git a/boards/nordic/nrf54l15tag/doc/index.rst b/boards/nordic/nrf54l15tag/doc/index.rst new file mode 100644 index 000000000000..7fa73f5346a8 --- /dev/null +++ b/boards/nordic/nrf54l15tag/doc/index.rst @@ -0,0 +1,85 @@ +.. zephyr:board:: nrf54l15tag + +Overview +******** + +The nRF54L15 TAG is a hardware development platform used to design and develop applications for the +nrf54L15 SoC. + +Hardware +******** + +The nRF54L15 TAG has a number of exposed pins which can be used for application specific purposes. +The following is the default availability (no optional components mounted by user). + +* P0.01 Available +* P0.02 Available +* P0.04 Available +* P1.02 Available +* P1.03 Available +* P1.11 SCL (i2c21) +* P1.12 SDA (i2c21) +* P1.13 Available +* P1.14 Available +* P2.05 Reserved +* P2.06 Available +* P2.07 Available + +.. note:: By default the ANT1 antenna is connected to the SoC using GPIO Hogs. + +Supported Features +****************** + +.. zephyr:board-supported-hw:: + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +The nRF54L15 TAG is programmed and debugged using the onboard debugger of an nRF54L DK as +depicted below: + +.. figure:: img/nrf54l15tag_debug.webp + :align: center + :alt: nRF54L15 TAG debugging + + nRF54L15 TAG debugging (Credit: Nordic Semiconductor) + +Once the nRF54L15 TAG is inserted into the DK's ``DEBUG OUT`` header, the nRF54L DK's onboard +debugger is rerouted from the DK's nRF54L15 SoC to the TAG's nRF54L15 SoC. Once powered, the TAG's +nRF54L15 SoC is then programmed and debugged just like the nRF54L15 SoC of an nRF54L DK, see +:zephyr:board:`nrf54l15dk`. + +.. warning:: + + Do not apply 3.3V to ``VDD SWD0`` or the ``VDD`` on the TAG in general if a coin cell battery + is inserted. + +The nRF54L15 TAG is not powered from the ``DEBUG OUT`` header by default. To power the nRF54L15 +TAG, either insert a CR2032 coin cell battery into its battery holder, **OR** apply 3.3V to the +``VDD SWD0`` pin on the nRF54L DK to power the TAG externally. + +Using an nRF54L15 DK, the DK can be configured to set VDD to 3.3V, and a jumper between any +of the DK's ``VDDIO`` pins and the ``VDD SWD0`` pin can be connected. + +Console and logging +******************* + +To get console and logging output, enable Segger RTT using the :ref:`snippet-rtt-console` snippet: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: nrf54l15tag/nrf54l15/cpuapp + :goals: build flash + :west-args: --snippet rtt-console + :compact: + +or enable the NUS service using the :ref:`snippet-nus-console` snippet: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: nrf54l15tag/nrf54l15/cpuapp + :goals: build flash + :west-args: --snippet nus-console + :compact: diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_common.dtsi b/boards/nordic/nrf54l15tag/nrf54l15tag_common.dtsi new file mode 100644 index 000000000000..f197704373cb --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_common.dtsi @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +/ { + aliases { + led0 = &led1_blue; + sw0 = &button0; + }; + + leds { + compatible = "gpio-leds"; + + led1_red: led1_red { + gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; + label = "LED 1 red"; + }; + + led1_green: led1_green { + gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; + label = "LED 1 green"; + }; + + led1_blue: led1_blue { + gpios = <&gpio2 9 GPIO_ACTIVE_LOW>; + label = "LED 1 blue"; + }; + + led2_red: led2_red { + status = "disabled"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + label = "LED 2 red"; + }; + + led2_green: led2_green { + status = "disabled"; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + label = "LED 2 green"; + }; + + led2_blue: led2_blue { + status = "disabled"; + gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; + label = "LED 2 blue"; + }; + }; + + rgb_led_1: rgb_led_1 { + compatible = "leds-group-multicolor"; + + leds = <&led1_red>, + <&led1_green>, + <&led1_blue>; + + color-mapping = , + , + ; + }; + + rgb_led_2: rgb_led_2 { + status = "disabled"; + compatible = "leds-group-multicolor"; + + leds = <&led2_red>, + <&led2_green>, + <&led2_blue>; + + color-mapping = , + , + ; + }; + + buttons { + compatible = "gpio-keys"; + + button0: button0 { + gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 0"; + zephyr,code = ; + }; + + button1: button1 { + status = "disabled"; + gpios = <&gpio0 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 1"; + zephyr,code = ; + }; + }; + + sky13348: sky13348 { + compatible = "skyworks,sky13348"; + v1-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + v2-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + }; +}; + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + spi22_default: spi22_default { + group1 { + psels = , + , + ; + }; + }; + + spi22_sleep: spi22_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + clock-frequency = ; + + bme688: bme688@76 { + status = "disabled"; + compatible = "bosch,bme680"; + reg = <0x76>; + }; + + adxl367: adxl367@1d { + status = "disabled"; + compatible = "adi,adxl367"; + reg = <0x1d>; + }; +}; + +&spi22 { + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + + bmi270: bmi270@0 { + status = "disabled"; + compatible = "bosch,bmi270"; + reg = <0>; + spi-max-frequency = ; + irq-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpiote30 { + status = "okay"; +}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_cpuapp_common.dtsi b/boards/nordic/nrf54l15tag/nrf54l15tag_cpuapp_common.dtsi new file mode 100644 index 000000000000..592a84ee751c --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_cpuapp_common.dtsi @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15tag_common.dtsi" + +/ { + chosen { + zephyr,flash-controller = &rram_controller; + zephyr,flash = &cpuapp_rram; + zephyr,ieee802154 = &ieee802154; + zephyr,boot-mode = &boot_mode0; + }; + + aliases { + mcuboot-led0 = &led1_blue; + mcuboot-button0 = &button0; + }; +}; + +&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"; +}; + +&lfxo { + status = "okay"; + load-capacitors = "internal"; + load-capacitance-femtofarad = <9000>; +}; + +&hfxo { + status = "okay"; + load-capacitors = "internal"; + load-capacitance-femtofarad = <8000>; +}; + +&radio { + status = "okay"; +}; + +&ieee802154 { + status = "okay"; +}; + +&temp { + status = "okay"; +}; + +&clock { + status = "okay"; +}; + +®ulators { + status = "okay"; +}; + +&vregmain { + status = "okay"; + regulator-initial-mode = ; +}; + +&gpregret1 { + status = "okay"; + + boot_mode0: boot_mode@0 { + compatible = "zephyr,retention"; + status = "okay"; + reg = <0x0 0x1>; + }; +}; + +&adc { + status = "okay"; +}; + +&i2c21 { + status = "okay"; +}; + +&bme688 { + status = "okay"; +}; + +&adxl367 { + status = "okay"; +}; + +&spi22 { + status = "okay"; +}; + +&bmi270 { + status = "okay"; +}; + +/* Initially connect ANT1 to SoC */ +&gpio1 { + antenna_switch_v1 { + gpio-hog; + gpios = <9 GPIO_ACTIVE_HIGH>; + output-high; + }; + + antenna_switch_v2 { + gpio-hog; + gpios = <10 GPIO_ACTIVE_HIGH>; + output-low; + }; +}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_cpuflpr_common.dtsi b/boards/nordic/nrf54l15tag/nrf54l15tag_cpuflpr_common.dtsi new file mode 100644 index 000000000000..96c440092450 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_cpuflpr_common.dtsi @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include "nrf54l15tag_common.dtsi" + +/ { + chosen { + zephyr,code-partition = &cpuflpr_code_partition; + zephyr,flash = &cpuflpr_rram; + zephyr,sram = &cpuflpr_sram; + }; +}; + +&grtc { + owned-channels = <3 4>; + status = "okay"; +}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.dts new file mode 100644 index 000000000000..e1ef8ccb4069 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.dts @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include + +#include "nrf54l15tag_cpuapp_common.dtsi" + +/ { + compatible = "nordic,nrf54l15tag_nrf54l15_cpuapp"; + model = "Nordic nRF54L15 TAG nRF54L15 Application MCU"; + + chosen { + zephyr,flash = &cpuapp_rram; + zephyr,sram = &cpuapp_sram; + zephyr,code-partition = &slot0_partition; + }; +}; + +&uicr { + nfct-pins-as-gpios; +}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.yaml b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.yaml new file mode 100644 index 000000000000..7e6152eb79f1 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.yaml @@ -0,0 +1,24 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54l15tag/nrf54l15/cpuapp +name: nRF54l15-TAG-nRF54l15-Application +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +sysbuild: true +ram: 188 +flash: 664 +supported: + - adc + - counter + - dmic + - gpio + - i2c + - i2s + - pwm + - retained_mem + - spi + - watchdog diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_defconfig b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_defconfig new file mode 100644 index 000000000000..5d5bca8f9693 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_defconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_GPIO=y +CONFIG_ARM_MPU=y diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.dts new file mode 100644 index 000000000000..9d17ea870c5c --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.dts @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#define USE_NON_SECURE_ADDRESS_MAP 1 + +#include +#include + +#include "nrf54l15tag_cpuapp_common.dtsi" + +/ { + compatible = "nordic,nrf54l15tag_nrf54l15-cpuapp"; + model = "Nordic nRF54L15 TAG nRF54L15 Application MCU"; + + /delete-node/ rng; + + psa_rng: psa-rng { + status = "okay"; + }; + + chosen { + zephyr,sram = &sram0_ns; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + }; +}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.yaml b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.yaml new file mode 100644 index 000000000000..dd1315aaeac2 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54l15tag/nrf54l15/cpuapp/ns +name: nRF54l15-TAG-nRF54l15-Application-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +ram: 128 +flash: 512 +supported: + - adc + - counter + - gpio + - i2c + - i2s + - pwm + - spi + - watchdog +vendor: nordic +sysbuild: true diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns_defconfig b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns_defconfig new file mode 100644 index 000000000000..b1d9e1219343 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns_defconfig @@ -0,0 +1,31 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_ARM_MPU=y +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# Don't enable the cache in the non-secure image as it is a +# secure-only peripheral on 54l +CONFIG_CACHE_MANAGEMENT=n +CONFIG_EXTERNAL_CACHE=n + +CONFIG_GPIO=y + +# Start SYSCOUNTER on driver init +CONFIG_NRF_GRTC_START_SYSCOUNTER=y + +# Disable TFM BL2 since it is not supported +CONFIG_TFM_BL2=n + +# No UART available for TF-M log output +CONFIG_TFM_LOG_LEVEL_SILENCE=y + +# The oscillators are configured as secure and cannot be configured +# from the non secure application directly. This needs to be set +# otherwise nrfx will try to configure them, resulting in a bus +# fault. +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts new file mode 100644 index 000000000000..6cdf34ddc663 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include "nrf54l15tag_cpuflpr_common.dtsi" + +/ { + model = "Nordic nRF54L15 TAG nRF54L15 FLPR MCU"; + compatible = "nordic,nrf54l15tag_nrf54l15-cpuflpr"; + + soc { + /* Resize SRAM partition */ + /delete-node/ memory@2002f000; + + cpuflpr_sram: memory@20028000 { + compatible = "mmio-sram"; + reg = <0x20028000 DT_SIZE_K(96)>; + #address-cells = <1>; + #size-cells = <1>; + 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)>; + }; + }; +}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.yaml b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.yaml new file mode 100644 index 000000000000..02dffd2f5162 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54l15tag/nrf54l15/cpuflpr +name: nRF54L15-TAG-nRF54L15-Fast-Lightweight-Peripheral-Processor +type: mcu +arch: riscv +toolchain: + - zephyr +sysbuild: true +ram: 96 +flash: 96 +supported: + - counter + - gpio + - i2c + - spi diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_defconfig b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_defconfig new file mode 100644 index 000000000000..706e58db3f28 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_defconfig @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_GPIO=y +CONFIG_USE_DT_CODE_PARTITION=y + +# Execute from SRAM +CONFIG_XIP=n diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts new file mode 100644 index 000000000000..2f98d5ffc28f --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include "nrf54l15tag_cpuflpr_common.dtsi" + +/ { + model = "Nordic nRF54L15 TAG nRF54L15 FLPR MCU"; + compatible = "nordic,nrf54l15tag_nrf54l15-cpuflpr"; +}; + +&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)>; + }; + }; +}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.yaml b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.yaml new file mode 100644 index 000000000000..ccf6a310a637 --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.yaml @@ -0,0 +1,17 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54l15tag/nrf54l15/cpuflpr/xip +name: nRF54L15-TAG-nRF54L15-Fast-Lightweight-Peripheral-Processor (RRAM XIP) +type: mcu +arch: riscv +toolchain: + - zephyr +sysbuild: true +ram: 68 +flash: 96 +supported: + - counter + - gpio + - i2c + - spi diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig new file mode 100644 index 000000000000..36b6c6c6fc1d --- /dev/null +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig @@ -0,0 +1,7 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_GPIO=y + +# Execute from RRAM +CONFIG_XIP=y From 2cef306d846b166ed05ed862eb839ea820a58770 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 16 Jan 2026 13:15:15 +0100 Subject: [PATCH 1679/3334] [nrf fromtree] tests: drivers: pinctrl: nrf: enable PINCTRL The nrf PINCTRL test suite does not enable PINCTRL. This has worked until now since the UART driver used for the console typically is enabled by default, selecting PINCTRL. This is not the case always however, and the test suite does not require any "real" device being enabled to test pinctrl. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit c0dd6eb9fc030799fb53141146708d54c55c4295) --- tests/drivers/pinctrl/nrf/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/pinctrl/nrf/prj.conf b/tests/drivers/pinctrl/nrf/prj.conf index 5e341d7d3873..311b1dbbc841 100644 --- a/tests/drivers/pinctrl/nrf/prj.conf +++ b/tests/drivers/pinctrl/nrf/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y +CONFIG_PINCTRL=y CONFIG_PINCTRL_TEST_NON_STATIC=y From 47417afd7141e6fb445e745b54d932a1303a2e55 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 16 Jan 2026 13:24:09 +0100 Subject: [PATCH 1680/3334] [nrf fromtree] samples: tests: drivers: watchdog: exclude nrf54l15tag The nrf54l15 SoC is already present and tested through the nrf54l15dk. Exclude from sample to save CI time. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit d05a4fbbc80441d9d44a94adef39fb3b999f5d7f) --- samples/drivers/watchdog/sample.yaml | 4 ++++ tests/drivers/watchdog/wdt_basic_api/testcase.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/samples/drivers/watchdog/sample.yaml b/samples/drivers/watchdog/sample.yaml index c7fffc99001a..7fd53d18762c 100644 --- a/samples/drivers/watchdog/sample.yaml +++ b/samples/drivers/watchdog/sample.yaml @@ -29,6 +29,10 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns + - nrf54l15tag/nrf54l15/cpuapp + - nrf54l15tag/nrf54l15/cpuapp/ns + - nrf54l15tag/nrf54l15/cpuflpr + - nrf54l15tag/nrf54l15/cpuflpr/xip - nrf7120dk/nrf7120/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml index 75cdc5da40e3..9551d3b8503f 100644 --- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml +++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml @@ -28,6 +28,10 @@ tests: - panb611evb/nrf54l15/cpuflpr/xip - mimxrt700_evk/mimxrt798s/cm33_cpu1 - nrf54l15dk/nrf54l10/cpuapp/ns + - nrf54l15tag/nrf54l15/cpuapp + - nrf54l15tag/nrf54l15/cpuapp/ns + - nrf54l15tag/nrf54l15/cpuflpr + - nrf54l15tag/nrf54l15/cpuflpr/xip - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns From 4b9ff7f299d33df38dd0bf33d3e6da01e67e9691 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 28 Jan 2026 10:35:04 +0000 Subject: [PATCH 1681/3334] [nrf fromtree] boards: nordic: nrf54l15tag: Fix missing ranges Fixes an issue with a missing ranges in the flpr dts files Signed-off-by: Jamie McCrae (cherry picked from commit 6692d8d202ba2652c6e7b2c61db9fd955f1376f7) --- boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts | 1 + boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts | 1 + 2 files changed, 2 insertions(+) diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts index 6cdf34ddc663..d1e39d3e5d96 100644 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts @@ -31,6 +31,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts index 2f98d5ffc28f..26bdbe51a22d 100644 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts @@ -18,6 +18,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; From 74b7483eb21c705df9f2c607a9085d9f440b9528 Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Wed, 21 Jan 2026 16:29:23 +0100 Subject: [PATCH 1682/3334] [nrf fromtree] tests: nrf: add integration platform for rram_throttling Add the target nrf54l15dk/nrf54l15/cpuapp as the integration platform in the testcase yaml file. Signed-off-by: Riadh Ghaddab (cherry picked from commit 4a30049073a6704f378d028b630842e11b6a4f39) --- tests/boards/nrf/rram_throttling/testcase.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/boards/nrf/rram_throttling/testcase.yaml b/tests/boards/nrf/rram_throttling/testcase.yaml index 4ed53aac8c7b..4aee70d034b4 100644 --- a/tests/boards/nrf/rram_throttling/testcase.yaml +++ b/tests/boards/nrf/rram_throttling/testcase.yaml @@ -13,3 +13,5 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l10/cpuapp + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp From 802d91c869325a28f3f5be564ec4c8eefb6a0c8b Mon Sep 17 00:00:00 2001 From: Kyle Micallef Bonnici Date: Thu, 29 Jan 2026 12:37:56 +0100 Subject: [PATCH 1683/3334] [nrf fromlist] CI: Add prefix to dts-linter npx commands When running check_compliance downstream the prefix path is not correct. This need to be relative to zephyr base. This PR ensure that the prefix is set correctly when invoking dts-linter Upstream PR #: 103142 Signed-off-by: Kyle Micallef Bonnici --- scripts/ci/check_compliance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 439c82508c20..a4f134944840 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -536,6 +536,7 @@ class DevicetreeLintingCheck(ComplianceTest): name = "DevicetreeLinting" doc = zephyr_doc_detail_builder("/contribute/style/devicetree.html") NPX_EXECUTABLE = "npx" + prefix = ZEPHYR_BASE / "scripts" / "ci" def ensure_npx(self) -> bool: if not (npx_executable := shutil.which(self.NPX_EXECUTABLE)): @@ -544,7 +545,7 @@ def ensure_npx(self) -> bool: self.npx_exe = npx_executable # --no prevents npx from fetching from registry subprocess.run( - [self.npx_exe, "--prefix", "./scripts/ci", "--no", 'dts-linter', "--", "--version"], + [self.npx_exe, "--prefix", self.prefix, "--no", 'dts-linter', "--", "--version"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True, @@ -625,7 +626,7 @@ def run(self): cmd = [ self.npx_exe, "--prefix", - "./scripts/ci", + self.prefix, "--no", "dts-linter", "--", From 6e235065f405d60ab6ce3bf258280f57e2ec31b1 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 14:14:39 +0000 Subject: [PATCH 1684/3334] [nrf noup] scripts: ci: check_compliance: Fix ruff issues part 1 nrf-squash! [nrf noup] scripts: ci: check_compliance: Check Kconfigs for enable Fixes some issues that ruff is now showing Signed-off-by: Jamie McCrae --- scripts/ci/check_compliance.py | 43 +++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index a4f134944840..e7ae38f28e0f 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -687,13 +687,37 @@ class KconfigCheck(ComplianceTest): # This block list contains a list of upstream Zephyr modules that should not be checked # DO NOT MERGE CHANGES TO THIS WITHOUT BUILD SYSTEM AND CODE OWNER APPROVAL! - external_module_name_block_list = ['canopennode', 'chre', 'cmsis', 'cmsis-dsp', 'cmsis-nn', - 'cmsis_6', 'edtt', 'fatfs', 'hal_st', 'hal_tdk', - 'hal_wurthelektronik', 'liblc3', 'libmetal', 'littlefs', - 'loramac-node', 'lvgl', 'lz4', 'mipi-sys-t', 'nanopb', - 'net-tools', 'nrf_hw_models', 'open-amp', 'percepio', - 'picolibc', 'segger', 'tf-m-tests', 'tinycrypt', - 'uoscore-uedhoc', 'zscilib'] + external_module_name_block_list = [ + 'canopennode', + 'chre', + 'cmsis', + 'cmsis-dsp', + 'cmsis-nn', + 'cmsis_6', + 'edtt', + 'fatfs', + 'hal_st', + 'hal_tdk', + 'hal_wurthelektronik', + 'liblc3', + 'libmetal', + 'littlefs', + 'loramac-node', + 'lvgl', + 'lz4', + 'mipi-sys-t', + 'nanopb', + 'net-tools', + 'nrf_hw_models', + 'open-amp', + 'percepio', + 'picolibc', + 'segger', + 'tf-m-tests', + 'tinycrypt', + 'uoscore-uedhoc', + 'zscilib', + ] # Holds a list or directories/files which should not be checked blocked_module_dirs = [] @@ -1355,8 +1379,9 @@ def check_no_enable_in_boolean_prompt(self, kconf): for module_name in self.external_module_name_block_list: # Workaround for being unable to use full_match() due to python version - if '/modules/' in str(normalised_file_name) and \ - ('/' + module_name + '/') in str(normalised_file_name): + if '/modules/' in str(normalised_file_name) and ( + '/' + module_name + '/' + ) in str(normalised_file_name): skip_node = True break From 62c751a8046b47bbad0e816bd82c753c4293c662 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 14:16:08 +0000 Subject: [PATCH 1685/3334] [nrf noup] scripts: ci: check_compliance: Fix ruff issues part 2 nrf-squash! [nrf noup] ci: set ZEPHYR__KCONFIG for NCS modules Fixes some issues that ruff is now showing Signed-off-by: Jamie McCrae --- scripts/ci/check_compliance.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index e7ae38f28e0f..3ad714667158 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -771,9 +771,11 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se self.blocked_module_dirs.append(modules_dir / module / 'Kconfig') if os.path.exists(nrf_modules_dir): - nrf_modules = [name for name in os.listdir(nrf_modules_dir) if - os.path.exists(os.path.join(nrf_modules_dir, name, - 'Kconfig'))] + nrf_modules = [ + name + for name in os.listdir(nrf_modules_dir) + if os.path.exists(os.path.join(nrf_modules_dir, name, 'Kconfig')) + ] for module in nrf_modules: if module in self.external_module_name_block_list: From 78357fa2d1320ac843dfbfa60e1a830ddd8128bf Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 14:19:52 +0000 Subject: [PATCH 1686/3334] [nrf noup] scripts: ci: check_compliance: Fix ruff issues part 3 nrf-squash! [nrf noup] scripts: ci: check_compliance: Add undefined Kconfigs Fixes some issues that ruff is now showing Signed-off-by: Jamie McCrae --- scripts/ci/check_compliance.py | 143 ++++++++++++++++----------------- 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 3ad714667158..0962de488739 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1748,80 +1748,79 @@ def check_no_undef_outside_kconfig(self, kconf): "ZTEST_FAIL_TEST_", # regex in tests/ztest/fail/CMakeLists.txt "ZVFS_OPEN_ADD_SIZE_", # Used as an option matching prefix # zephyr-keep-sorted-stop - # NCS-specific allow list # zephyr-keep-sorted-start re(^\s+") - "APPLICATION", # Example documentation - "BAR", # Example documentation - "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation - "BT_ADV_PROV_", # Documentation - "BT_CTLR_TX_PWR_MINUS", # CHIP documentation - "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation - "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo - "CHANNEL", # NRF desktop - "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop - "CHANNEL_TRANSPORT_DISABLED", # NRF desktop - "CHANNEL_TRANSPORT_IDLE", # NRF desktop - "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop - "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop - "CHIP_DFU_OVER_BT_SMP", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module - "CHIP_MEMORY_PROFILING", # CHIP module - "CHIP_NUS", # CHIP module - "CHIP_NUS_FIXED_PASSKEY", # CHIP module - "CHIP_NUS_MAX_COMMANDS", # CHIP module - "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module - "CHIP_QSPI_NOR", # CHIP module - "CHIP_SPI_NOR", # CHIP module - "CHIP_WIFI", # CHIP module - "DESKTOP_DVFS_STATE_", # NRF desktop - "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop - "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module - "MEMFAULT_", # Documentation - "MEMFAULT_NCS", # Documentation - "MEMFAULT_NCS_", # Documentation - "MY_CUSTOM_CONFIG", # Example documentation - "MY_EXT_API_ENABLED", # Example documentation - "MY_EXT_API_REQUIRED", # Example documentation - "NCS_IS_VARIANT_IMAGE", # Build system defined symbol - "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot - "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot - "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol - "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation - "PM_PARTITION_SIZE", # Used in search link - "PM_PARTITION_SIZE_", # Used in documentation - "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template - "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template - "SOC_NRF54H20_CPUSEC", # Internal - "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal - "STATUS_", # NRF desktop - "STATUS_COUNT", # NRF desktop - "STATUS_DISCONNECTED", # NRF desktop - "STATUS_FETCH", # NRF desktop - "STATUS_GET_BOARD_NAME", # NRF desktop - "STATUS_GET_HWID", # NRF desktop - "STATUS_GET_MAX_MOD_ID", # NRF desktop - "STATUS_GET_PEER", # NRF desktop - "STATUS_GET_PEERS_CACHE", # NRF desktop - "STATUS_INDEX_PEERS", # NRF desktop - "STATUS_LIST", # NRF desktop - "STATUS_PENDING", # NRF desktop - "STATUS_POS", # NRF desktop - "STATUS_REJECT", # NRF desktop - "STATUS_SET", # NRF desktop - "STATUS_SUCCESS", # NRF desktop - "STATUS_TIMEOUT", # NRF desktop - "STATUS_WRITE_FAIL", # NRF desktop + "APPLICATION", # Example documentation + "BAR", # Example documentation + "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation + "BT_ADV_PROV_", # Documentation + "BT_CTLR_TX_PWR_MINUS", # CHIP documentation + "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation + "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo + "CHANNEL", # NRF desktop + "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop + "CHANNEL_TRANSPORT_DISABLED", # NRF desktop + "CHANNEL_TRANSPORT_IDLE", # NRF desktop + "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop + "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop + "CHIP_DFU_OVER_BT_SMP", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module + "CHIP_MEMORY_PROFILING", # CHIP module + "CHIP_NUS", # CHIP module + "CHIP_NUS_FIXED_PASSKEY", # CHIP module + "CHIP_NUS_MAX_COMMANDS", # CHIP module + "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module + "CHIP_QSPI_NOR", # CHIP module + "CHIP_SPI_NOR", # CHIP module + "CHIP_WIFI", # CHIP module + "DESKTOP_DVFS_STATE_", # NRF desktop + "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop + "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module + "MEMFAULT_", # Documentation + "MEMFAULT_NCS", # Documentation + "MEMFAULT_NCS_", # Documentation + "MY_CUSTOM_CONFIG", # Example documentation + "MY_EXT_API_ENABLED", # Example documentation + "MY_EXT_API_REQUIRED", # Example documentation + "NCS_IS_VARIANT_IMAGE", # Build system defined symbol + "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot + "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot + "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol + "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation + "PM_PARTITION_SIZE", # Used in search link + "PM_PARTITION_SIZE_", # Used in documentation + "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template + "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template + "SOC_NRF54H20_CPUSEC", # Internal + "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal + "STATUS_", # NRF desktop + "STATUS_COUNT", # NRF desktop + "STATUS_DISCONNECTED", # NRF desktop + "STATUS_FETCH", # NRF desktop + "STATUS_GET_BOARD_NAME", # NRF desktop + "STATUS_GET_HWID", # NRF desktop + "STATUS_GET_MAX_MOD_ID", # NRF desktop + "STATUS_GET_PEER", # NRF desktop + "STATUS_GET_PEERS_CACHE", # NRF desktop + "STATUS_INDEX_PEERS", # NRF desktop + "STATUS_LIST", # NRF desktop + "STATUS_PENDING", # NRF desktop + "STATUS_POS", # NRF desktop + "STATUS_REJECT", # NRF desktop + "STATUS_SET", # NRF desktop + "STATUS_SUCCESS", # NRF desktop + "STATUS_TIMEOUT", # NRF desktop + "STATUS_WRITE_FAIL", # NRF desktop # zephyr-keep-sorted-stop } From 9749b5cfd4a61b2c7bfc666fbbc69110eb0b2f0b Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 14:21:28 +0000 Subject: [PATCH 1687/3334] [nrf noup] scripts: ci: check_compliance: Fix ruff issues part 4 nrf-squash! [nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs Fixes some issues that ruff is now showing Signed-off-by: Jamie McCrae --- scripts/ci/check_compliance.py | 45 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 0962de488739..f0fa9747d364 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1897,31 +1897,30 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop - # NCS-specific allowlist # zephyr-keep-sorted-start re(^\s+") - "APP_CPUNET_RUN", # Used by sample - "APP_DFU", # Used by sample - "BT_FAST_PAIR", # Legacy/removed, used in migration documentation - "COMP_DATA_LAYOUT_ARRAY", # Used by test - "COMP_DATA_LAYOUT_MULTIPLE", # Used by test - "COMP_DATA_LAYOUT_SINGLE", # Used by test - "DTM_NO_DFE", # Used by DTM application - "DTM_TRANSPORT_HCI", # Used by DTM application - "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation - "INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation - "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "ML_APP_REMOTE_BOARD", # Used by machine learning application - "MY_APP_IMAGE_ABC", # Used in documentation - "NETCORE_ABC", # Used in documentation - "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests - "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation - "SUIT_ENVELOPE_", # Used by jinja - "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation - "SUIT_MPI_", # Used by jinja - "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation - "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample + "APP_CPUNET_RUN", # Used by sample + "APP_DFU", # Used by sample + "BT_FAST_PAIR", # Legacy/removed, used in migration documentation + "COMP_DATA_LAYOUT_ARRAY", # Used by test + "COMP_DATA_LAYOUT_MULTIPLE", # Used by test + "COMP_DATA_LAYOUT_SINGLE", # Used by test + "DTM_NO_DFE", # Used by DTM application + "DTM_TRANSPORT_HCI", # Used by DTM application + "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation + "INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation + "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "ML_APP_REMOTE_BOARD", # Used by machine learning application + "MY_APP_IMAGE_ABC", # Used in documentation + "NETCORE_ABC", # Used in documentation + "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests + "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation + "SUIT_ENVELOPE_", # Used by jinja + "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation + "SUIT_MPI_", # Used by jinja + "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation + "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample # zephyr-keep-sorted-stop } From f366739563d124466d2e91386941d4be7e267379 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Thu, 29 Jan 2026 12:46:16 +0100 Subject: [PATCH 1688/3334] [nrf fromlist] tests: clock_control: onoff: Fix test when RC is used Add wait for the calibration process to complete when releasing the clock if an RC oscillator is used. Upstream PR #: 103141 Signed-off-by: Adam Kondraciuk --- .../clock_control/onoff/src/test_clock_control_onoff.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/drivers/clock_control/onoff/src/test_clock_control_onoff.c b/tests/drivers/clock_control/onoff/src/test_clock_control_onoff.c index 29b235d2b5ec..2ce5585c38e1 100644 --- a/tests/drivers/clock_control/onoff/src/test_clock_control_onoff.c +++ b/tests/drivers/clock_control/onoff/src/test_clock_control_onoff.c @@ -29,6 +29,11 @@ static void clock_off(void) { struct onoff_manager *mgr = get_mgr(); +#if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC) + while (z_nrf_clock_calibration_is_in_progress()) { + /* empty */ + } +#endif do { (void)onoff_release(mgr); From 97bcab454d515df15f6e9e4c1650ad5f3b96f474 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Thu, 29 Jan 2026 11:18:49 +0100 Subject: [PATCH 1689/3334] [nrf fromlist] tests: retained_mem: Fix overlay for nRF54H20dk Remove `cpux_ram0` node from overlay file as it is already defined in DTS. Upstream PR #: 103134 Signed-off-by: Adam Kondraciuk --- .../api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 5 ----- .../api/boards/nrf54h20dk_nrf54h20_cpurad.overlay | 5 ----- 2 files changed, 10 deletions(-) diff --git a/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 672a49379e76..5e13cc069c53 100644 --- a/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -15,8 +15,3 @@ retainedmemtestdevice = &retainedmem0; }; }; - -&cpuapp_ram0 { - reg = <0x22000000 DT_SIZE_K(16)>; - ranges = <0x0 0x22000000 0x4000>; -}; diff --git a/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpurad.overlay index c824df8b74e4..ee3754076532 100644 --- a/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ b/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -15,8 +15,3 @@ retainedmemtestdevice = &retainedmem0; }; }; - -&cpurad_ram0 { - reg = <0x23000000 DT_SIZE_K(176)>; - ranges = <0x0 0x23000000 0x2c000>; -}; From bdaa2b9522fb225cd5575144316be5cb5ccd26eb Mon Sep 17 00:00:00 2001 From: Timothy Keys Date: Tue, 27 Jan 2026 09:02:41 +0000 Subject: [PATCH 1690/3334] [nrf fromtree] manifest: Update Segger debug monitor files. Add support for Cortex-M23 / M33 / M55 / M85 Cores. Signed-off-by: Timothy Keys (cherry picked from commit f2e28f7420e8336267bcb7d39646dfe5fbeeda64) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f3a744910910..6cc9d5a80089 100644 --- a/west.yml +++ b/west.yml @@ -370,7 +370,7 @@ manifest: - testing - tee - name: segger - revision: 7c843ea24b9b4f100c226bce0b4eb807e50a42ac + revision: 50892fdbcf2f570e67baa72b8894a66b16946f72 path: modules/debug/segger groups: - debug From 60f66447ed847208e80dc5a53618e4d2d050b8e0 Mon Sep 17 00:00:00 2001 From: Victor Luque Date: Wed, 21 Jan 2026 17:21:28 +0100 Subject: [PATCH 1691/3334] [nrf fromtree] manifest: update hal_nordic to fix TWIM instance in samples Manifest update to pull fix for TWIM instance in TX-RX and TX-TX samples. Signed-off-by: Victor Luque (cherry picked from commit f7d444bf26ef5e9c4a9caf56399577f04403153c) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 6cc9d5a80089..728d9d165845 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: a83db66acbeca0bfef157a0c3482c07ddbb82555 + revision: daad38f2e9f6c641849010d74fe02ea736d4d921 path: modules/hal/nordic groups: - hal From e7c87bd46d6c0f9798acff02b19697eb4a501cd4 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 29 Jan 2026 13:16:14 +0100 Subject: [PATCH 1692/3334] [nrf fromlist] manifest: update hal_nordic to have nrfx_nfct RXERROR fix Updated nrfx_nfct contains a fix to poll RXERROR event register on RXFRAMEEND instead of handling it as a separate interrupt. This fixes a race condition where parity errors were not propagated to the NFC stack due to the RXERROR event being cleared before RXFRAMEEND was processed. Upstream PR #: 103143 Signed-off-by: Nikodem Kastelik --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 728d9d165845..deeb59229390 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: daad38f2e9f6c641849010d74fe02ea736d4d921 + revision: d7dc801ab175e286205fd6229b0c05ec7886e2ac path: modules/hal/nordic groups: - hal From d95178d351f256373ff560e54afe1dca7e343c62 Mon Sep 17 00:00:00 2001 From: Markus Lassila Date: Wed, 21 Jan 2026 14:20:24 +0200 Subject: [PATCH 1693/3334] [nrf fromtree] net: ppp: Fixes to peer LCP_OPTION_MRU handling - Use the minimum of our and peer MRU as the MTU of the link. Allows for cases where our MRU is < 1500. - Move all of the MRU handling under CONFIG_NET_L2_PPP_OPTION_MRU. So that we handle both sending the LCP_OPTION_MRU in Configure-Request and receiving it in Configure-Request. - Remove CONFIG_NET_L2_PPP_OPTION_MAX_MRU. From RFC 1661, 6.1 Implementation note: ... The peer need not Configure-Nak to indicate that it will only send smaller packets, since the implementation will always require support for at least 1500 octets. - Set ppp_my_options_parse_conf_ack so that ack's are parsed. Signed-off-by: Markus Lassila (cherry picked from commit 7a26b751c13b5589f3a8bcabec4e9467f78ce627) --- subsys/net/l2/ppp/Kconfig | 7 ------- subsys/net/l2/ppp/lcp.c | 44 +++++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/subsys/net/l2/ppp/Kconfig b/subsys/net/l2/ppp/Kconfig index d5dae67f99c8..1dc6baf601aa 100644 --- a/subsys/net/l2/ppp/Kconfig +++ b/subsys/net/l2/ppp/Kconfig @@ -60,13 +60,6 @@ config NET_L2_PPP_OPTION_MRU help Enable support for LCP MRU option. -config NET_L2_PPP_OPTION_MAX_MRU - int "LCP MRU maximum size" - default 1500 - help - Set the maximal MRU size which is allowed while negotiation with peer over LCP. - The default value is defined by RFC 1661. - config NET_L2_PPP_OPTION_SERVE_IP bool "Serve IP address to peer" help diff --git a/subsys/net/l2/ppp/lcp.c b/subsys/net/l2/ppp/lcp.c index 9c664d006021..7a25e47b923b 100644 --- a/subsys/net/l2/ppp/lcp.c +++ b/subsys/net/l2/ppp/lcp.c @@ -122,8 +122,9 @@ static int lcp_async_ctrl_char_map_parse(struct ppp_fsm *fsm, struct net_pkt *pk return 0; } +#if defined(CONFIG_NET_L2_PPP_OPTION_MRU) static int lcp_peer_mru_parse(struct ppp_fsm *fsm, struct net_pkt *pkt, - void *user_data) + void *user_data) { struct lcp_option_data *data = user_data; uint16_t peer_mru; @@ -137,19 +138,13 @@ static int lcp_peer_mru_parse(struct ppp_fsm *fsm, struct net_pkt *pkt, NET_DBG("[LCP] Received peer MRU %u", peer_mru); - if (peer_mru > CONFIG_NET_L2_PPP_OPTION_MAX_MRU) { - LOG_WRN("[LCP] Received peer MRU is too big. %u > %u.", - peer_mru, CONFIG_NET_L2_PPP_OPTION_MAX_MRU); - return -EINVAL; - } - data->mru = peer_mru; return 0; } static int lcp_peer_mru_nack(struct ppp_fsm *fsm, struct net_pkt *ret_pkt, - void *user_data) + void *user_data) { struct ppp_context *ctx = ppp_fsm_ctx(fsm); @@ -157,14 +152,16 @@ static int lcp_peer_mru_nack(struct ppp_fsm *fsm, struct net_pkt *ret_pkt, (void)net_pkt_write_u8(ret_pkt, 4); return net_pkt_write_be16(ret_pkt, ctx->lcp.my_options.mru); } +#endif static const struct ppp_peer_option_info lcp_peer_options[] = { PPP_PEER_OPTION(LCP_OPTION_AUTH_PROTO, lcp_auth_proto_parse, lcp_auth_proto_nack), PPP_PEER_OPTION(LCP_OPTION_ASYNC_CTRL_CHAR_MAP, lcp_async_ctrl_char_map_parse, NULL), - PPP_PEER_OPTION(LCP_OPTION_MRU, lcp_peer_mru_parse, - lcp_peer_mru_nack), +#if defined(CONFIG_NET_L2_PPP_OPTION_MRU) + PPP_PEER_OPTION(LCP_OPTION_MRU, lcp_peer_mru_parse, lcp_peer_mru_nack), +#endif }; static int lcp_config_info_req(struct ppp_fsm *fsm, @@ -191,6 +188,9 @@ static int lcp_config_info_req(struct ppp_fsm *fsm, ctx->lcp.peer_options.auth_proto = data.auth_proto; ctx->lcp.peer_options.async_map = data.async_ctrl_char_map; +#if defined(CONFIG_NET_L2_PPP_OPTION_MRU) + ctx->lcp.peer_options.mru = data.mru; +#endif NET_DBG("Asynchronous Control Character Map: %08X", data.async_ctrl_char_map); if (data.auth_proto_present) { @@ -259,12 +259,23 @@ static void lcp_up(struct ppp_fsm *fsm) struct ppp_context *ctx = CONTAINER_OF(fsm, struct ppp_context, lcp.fsm); - if (ctx->lcp.peer_options.mru > 0) { - NET_DBG("Set MTU size from peer options: %u -> %u", - net_if_get_mtu(ctx->iface), ctx->lcp.peer_options.mru); - net_if_set_mtu(ctx->iface, ctx->lcp.peer_options.mru); +#if defined(CONFIG_NET_L2_PPP_OPTION_MRU) + /* Set MTU based on negotiated MRU values. + * Use the minimum of our MRU and peer's MRU to ensure both sides + * can handle the packet size. + */ + uint16_t mtu = ctx->lcp.my_options.mru; + + if (ctx->lcp.peer_options.mru > 0 && + ctx->lcp.peer_options.mru < mtu) { + mtu = ctx->lcp.peer_options.mru; } + NET_DBG("PPP MTU set to %d (mru=%d, peer_mru=%d)", + mtu, ctx->lcp.my_options.mru, ctx->lcp.peer_options.mru); + net_if_set_mtu(ctx->iface, mtu); +#endif + ppp_link_established(ctx, fsm); } @@ -305,7 +316,7 @@ static int lcp_ack_mru(struct ppp_context *ctx, struct net_pkt *pkt, return -EINVAL; } - ret = net_pkt_read(pkt, &mru, sizeof(mru)); + ret = net_pkt_read_be16(pkt, &mru); if (ret) { return ret; } @@ -328,7 +339,7 @@ static int lcp_nak_mru(struct ppp_context *ctx, struct net_pkt *pkt, return -EINVAL; } - ret = net_pkt_read(pkt, &mru, sizeof(mru)); + ret = net_pkt_read_be16(pkt, &mru); if (ret) { return ret; } @@ -456,6 +467,7 @@ static void lcp_init(struct ppp_context *ctx) ctx->lcp.fsm.cb.config_info_add = lcp_config_info_add; ctx->lcp.fsm.cb.config_info_req = lcp_config_info_req; + ctx->lcp.fsm.cb.config_info_ack = ppp_my_options_parse_conf_ack; ctx->lcp.fsm.cb.config_info_nack = lcp_config_info_nack; ctx->lcp.fsm.cb.config_info_rej = ppp_my_options_parse_conf_rej; From 42dc8df2ee97ae2696c74a5c01de440589646ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Mon, 26 Jan 2026 14:11:45 +0100 Subject: [PATCH 1694/3334] [nrf fromtree] dts: vendor: nordic: Update nRF54LM20A SRAM layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only 511 kB of RAM is available for usage currently on nRF54LM20A. The non-secure variant used the full 512 which causes boot loops. Reduce the non-secure ram down to 252 to reduce below the 511 kB while still following the 4 kB page alignment requirements in TF-m Signed-off-by: Dag Erik Gjørvad (cherry picked from commit e09cf76f6029d19c5e532fbb62f46a26703b6d09) --- dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi index 6fb92c1bbaed..38f4addb5184 100644 --- a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi @@ -7,9 +7,10 @@ /* * Default SRAM planning when building for nRF54LM20A with ARM TrustZone-M support * - Lowest 256 kB SRAM allocated to Secure image (sram0_s). - * - Upper 256 kB SRAM allocated to Non-Secure image (sram0_ns). + * - Upper 252 kB SRAM allocated to Non-Secure image (sram0_ns). * - * nRF54LM20A has 512 kB of volatile memory (SRAM). + * nRF54LM20A has 512 kB of volatile memory (SRAM), but only 511 kB is available to use. + * Since TF-m requires 4kB page alignment we can only use a total of 508 kB. * This static layout needs to be the same with the upstream TF-M layout in the * header flash_layout.h of the relevant platform. Any updates in the layout * needs to happen both in the flash_layout.h and in this file at the same time. @@ -27,8 +28,8 @@ #address-cells = <1>; #size-cells = <1>; /* Non-Secure image memory */ - reg = <0x40000 0x7FE40>; - ranges = <0x0 0x40000 0x7FE40>; + reg = <0x40000 DT_SIZE_K(252)>; + ranges = <0x0 0x40000 DT_SIZE_K(252)>; }; }; From 32c5ef783101805970fa2dd8157a01081cbfc5e1 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Wed, 28 Jan 2026 11:02:04 +0100 Subject: [PATCH 1695/3334] [nrf fromtree] scripts: pylib: twister: twisterlib: coverage: catch hex parsing As parsing hex was moved, move also catching its possible errors. Signed-off-by: Piotr Kosycarz (cherry picked from commit aedada06c6d185bf3bbbe288f50ca4afe7ba2e1f) --- scripts/pylib/twister/twisterlib/coverage.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/coverage.py b/scripts/pylib/twister/twisterlib/coverage.py index ed3413fa9b82..4529f0cf0166 100644 --- a/scripts/pylib/twister/twisterlib/coverage.py +++ b/scripts/pylib/twister/twisterlib/coverage.py @@ -79,8 +79,11 @@ def retrieve_gcov_data(input_file): continue else: continue - hex_bytes = bytes.fromhex(hex_dump) - extracted_coverage_info[file_name].append(hex_bytes) + try: + hex_bytes = bytes.fromhex(hex_dump) + extracted_coverage_info[file_name].append(hex_bytes) + except ValueError: + logger.exception(f"Unable to convert hex data for file: {file_name}") if not capture_data: capture_complete = True return {'complete': capture_complete, 'data': extracted_coverage_info} @@ -126,9 +129,6 @@ def create_gcda_files(self, extracted_coverage_info): hexdump_val = self.merge_hexdumps(hexdumps) with open(filename, 'wb') as fp: fp.write(hexdump_val) - except ValueError: - logger.exception(f"Unable to convert hex data for file: {filename}") - gcda_created = False except FileNotFoundError: logger.exception(f"Unable to create gcda file: {filename}") gcda_created = False From ba740b914e7f6ded691a5d73a14ae37e6abcfc8e Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Fri, 30 Jan 2026 14:49:50 +0000 Subject: [PATCH 1696/3334] [nrf noup] scripts: west: Resolve cmake-opt conflict from upmerge nrf-squash! [nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir New feature Supports cmake options specified via arguments changed default sysbuiild from None to []. Noup commit to use sysbuild by default if in NCS dir requires changes to accommodate this. Signed-off-by: Robert Robinson --- scripts/west_commands/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index 819805aa49e7..4426580c4f3d 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -664,9 +664,9 @@ def _run_cmake(self, board, origin): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', None) + config_sysbuild = config_getboolean('sysbuild', []) - if config_sysbuild is None: + if config_sysbuild == []: # If no option is set, then enable sysbuild globally config_sysbuild = True From 74780c2e6fdf55cfaa9f640b0e7dcd34691f72c8 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 26 Jan 2026 16:23:56 +0000 Subject: [PATCH 1697/3334] [nrf fromtree] scripts: runners: nrf: Add support for nRF7120 Add support for nrf7120 to use nrfutil runner in upstream zephyr. Signed-off-by: Robert Robinson (cherry picked from commit ccf98f74bfa76be9669825792c88332588416334) --- scripts/west_commands/runners/nrf_common.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index 212b22e83bf7..c236eff5ad15 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -39,6 +39,9 @@ 'nrf54l': { 'Application': (0x00FFD000, 0x00FFDA00), }, + 'nrf71': { + 'Application': (0x00FFD000, 0x00FFDA00) + }, 'nrf91': { 'Application': (0x00FF8000, 0x00FF8800), }, @@ -90,7 +93,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', 'NRF71', 'NRF91', 'NRF92'], help='''MCU family; still accepted for compatibility only''') # Not using a mutual exclusive group for softreset and pinreset due to @@ -226,6 +229,8 @@ def ensure_family(self): self.family = 'nrf54l' elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF54H'): self.family = 'nrf54h' + elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF71'): + self.family = 'nrf71' elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF91'): self.family = 'nrf91' elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF92'): From a16a0de16b8e5bee2895c44892a7945d292daa48 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 2 Feb 2026 12:29:47 +0000 Subject: [PATCH 1698/3334] [nrf noup] dts: choose a psa-rng for entropy for nRF7120 Set PSA as the entropy source for nRF7120 target. PSA is the only NCS-supported interface to CRACEN. Disables `rng` compatible with `nrf-cracen-ctrdrbg`, the nrfx based interface to CRACEN that is used in upstream Zephyr. Only one CRACEN interface may be enabled. Signed-off-by: Robert Robinson --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 829836660cad..39e815afc199 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -27,13 +27,13 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; }; From ba1fe7dc8aef8a8165fe2a0dd3b8de4ceedabedb Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 2 Feb 2026 12:48:15 +0000 Subject: [PATCH 1699/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding for nRF7120 nrf-squash! [nrf noup] dts: Select SoftDevice Controller DTS binding as default Sets bt_hci_sdc as default for nRF7120. Signed-off-by: Robert Robinson --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 39e815afc199..256f2d8f43b8 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,6 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -37,6 +38,10 @@ nvic: &cpuapp_nvic {}; }; }; +&bt_hci_sdc { + status = "okay"; +}; + &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; From 8896326defedb02d445d39ee554ea71c5249395b Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Wed, 14 Jan 2026 18:57:30 +0100 Subject: [PATCH 1700/3334] [nrf fromtree] doc: bluetooth: mesh: add cdb documentation Commit adds cdb usage guide. Signed-off-by: Aleksandr Khromykh (cherry picked from commit 95502e177886d1ed7eb675dab4ff3d94b05d7bea) --- doc/connectivity/bluetooth/api/mesh.rst | 1 + .../bluetooth/api/mesh/cdb_usage.rst | 899 ++++++++++++++++++ include/zephyr/bluetooth/mesh/cdb.h | 33 +- 3 files changed, 927 insertions(+), 6 deletions(-) create mode 100644 doc/connectivity/bluetooth/api/mesh/cdb_usage.rst diff --git a/doc/connectivity/bluetooth/api/mesh.rst b/doc/connectivity/bluetooth/api/mesh.rst index 45b3563fc758..0fd11c335dc9 100644 --- a/doc/connectivity/bluetooth/api/mesh.rst +++ b/doc/connectivity/bluetooth/api/mesh.rst @@ -25,3 +25,4 @@ Read more about Bluetooth Mesh on the mesh/statistic.rst mesh/shell.rst mesh/brg_cfg.rst + mesh/cdb_usage.rst diff --git a/doc/connectivity/bluetooth/api/mesh/cdb_usage.rst b/doc/connectivity/bluetooth/api/mesh/cdb_usage.rst new file mode 100644 index 000000000000..ad19674e1fb2 --- /dev/null +++ b/doc/connectivity/bluetooth/api/mesh/cdb_usage.rst @@ -0,0 +1,899 @@ +.. _bluetooth_mesh_cdb_usage: + +Configuration Database (CDB) +############################ + +.. contents:: + :local: + :depth: 2 + +Overview +******** + +The Configuration Database (CDB) is the subsystem for Bluetooth® Mesh provisioner devices. +It stores and manages information about the mesh network, including provisioned nodes, network keys, and application keys. +The CDB enables a provisioner to track the network topology, assign addresses, and configure nodes systematically. + +.. note:: + + The CDB implementation has proprietary design and does not follow the Bluetooth SIG specification. + +The CDB is enabled with the :kconfig:option:`CONFIG_BT_MESH_CDB` configuration option and is typically used only on the provisioner device in the network. +There should be only one device in the mesh network with CDB enabled to avoid conflicts. + +Key features +============ + +* **Persistent Storage**: All CDB data is stored persistently when :kconfig:option:`CONFIG_BT_SETTINGS` is enabled, allowing the provisioner to recover network state across reboots. +* **Address Management**: Automatic allocation and tracking of unicast addresses for provisioned nodes. +* **Key Management**: Storage and synchronization of network keys and application keys. +* **Node Tracking**: Maintains information about each provisioned node including UUID, address, element count, device key, and configuration status. +* **IV Index Management**: Tracks the network's IV Index and IV Update state. + +Configuration options +********************* + +The following Kconfig options control the CDB capacity: + +* :kconfig:option:`CONFIG_BT_MESH_CDB_NODE_COUNT` - Maximum number of nodes the CDB can handle. +* :kconfig:option:`CONFIG_BT_MESH_CDB_SUBNET_COUNT` - Maximum number of subnets the CDB can handle. +* :kconfig:option:`CONFIG_BT_MESH_CDB_APP_KEY_COUNT` - Maximum number of application keys the CDB can handle. + +Additional options: + +* :kconfig:option:`CONFIG_BT_MESH_CDB_KEY_SYNC` - Enables automatic synchronization between mesh keys on the provisioner node and the CDB keys. + If option is enabled then operations with keys performed through the :ref:`bluetooth_mesh_models_cfg_srv` are automatically mirrored to the CDB. + +Data Structures +*************** + +The CDB was designed to handle data collected in several data structures. +The structures represent nodes, subnets, application keys, and the overall database state. + +Node structure +============== + +.. literalinclude:: ../../../../../include/zephyr/bluetooth/mesh/cdb.h + :language: c + :dedent: + :start-after: doc string cdb node start + :end-before: doc string cdb node end + +Node flags: + +* ``BT_MESH_CDB_NODE_CONFIGURED`` - Set when the node has been configured with keys and bindings. + +Subnet structure +================ + +.. literalinclude:: ../../../../../include/zephyr/bluetooth/mesh/cdb.h + :language: c + :dedent: + :start-after: doc string cdb subnet start + :end-before: doc string cdb subnet end + +Application Key structure +========================== + +.. literalinclude:: ../../../../../include/zephyr/bluetooth/mesh/cdb.h + :language: c + :dedent: + :start-after: doc string cdb app key start + :end-before: doc string cdb app key end + +Main CDB structure +================== + +.. literalinclude:: ../../../../../include/zephyr/bluetooth/mesh/cdb.h + :language: c + :dedent: + :start-after: doc string cdb start + :end-before: doc string cdb end + +Usage scenarios +*************** + +The following patterns demonstrate common CDB usage scenarios: + +* :ref:`cdb_pattern_1` - Creating and initializing the CDB +* :ref:`cdb_pattern_2` - Managing node provisioning and addresses +* :ref:`cdb_pattern_3` - Managing network keys and subnets +* :ref:`cdb_pattern_4` - Finding and removing subnets +* :ref:`cdb_pattern_5` - Adding application keys to the CDB +* :ref:`cdb_pattern_6` - Finding and removing application keys +* :ref:`cdb_pattern_7` - Configuring provisioned nodes +* :ref:`cdb_pattern_8` - Processing nodes with callbacks +* :ref:`cdb_pattern_9` - Finding and removing nodes +* :ref:`cdb_pattern_10` - Managing IV Index updates +* :ref:`cdb_pattern_11` - Importing/exporting device keys +* :ref:`cdb_pattern_12` - Resetting the database + +.. note:: + + The provided below source code of scenarios should be treated as conceptual patterns rather than exact implementations. + They require adaptation to fit into an application context and testing. + Please read the CDB API description for correct usage. + +.. _cdb_pattern_1: + +Provisioner initialization +========================== + +On the embedded provisioner node, the CDB must be initialized before the mesh stack is provisioned and the application can use it for key storage, node tracking, and configuration. +This step establishes the primary network key, the initial subnet, and the starting IV Index and address space, so that all later CDB operations work on a well‑defined network context and can be persisted across reboots. + +A typical provisioner initializes the CDB during startup: + +.. code-block:: c + + #include + + static int provisioner_init(void) + { + uint8_t net_key[16]; + int err; + + /* Initialize Bluetooth Mesh */ + err = bt_mesh_init(&prov, &comp); + if (err) { + return err; + } + + /* Load settings if persistent storage is enabled */ + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + settings_load(); + } + + /* Generate or use predefined network key */ + bt_rand(net_key, 16); + + /* Create CDB with primary network key */ + err = bt_mesh_cdb_create(net_key); + if (err == -EALREADY) { + printk("Using stored CDB\n"); + } else if (err) { + printk("Failed to create CDB (err %d)\n", err); + return err; + } else { + printk("Created new CDB\n"); + } + + return 0; + } + +Key points: + +* Call the :c:func:`bt_mesh_cdb_create` function with the primary network key. +* Returns error code if CDB already exists (loaded from persistent storage). +* The function automatically creates a subnet with ``NetIdx = 0``. +* Sets the IV Index to ``0`` and lowest available address to ``1``. + +.. _cdb_pattern_2: + +Provisioning and node allocation +================================ + +When you add new devices to the mesh, their addresses, device keys, and basic metadata must be recorded consistently in the provisioner’s database. +Automatic node allocation during PB‑ADV/PB‑GATT provisioning keeps CDB and the actual network in sync. +When provisioning a new device, the CDB automatically allocates the node during the provisioning process. + +However, you can also manually allocate nodes or check allocation. +Manual node allocation is useful for advanced scenarios such as importing nodes from an external source, pre‑allocating address ranges, or recovering a network from known information. + +.. code-block:: c + + /* Provisioning callback - node is automatically added to CDB */ + static void node_added(uint16_t idx, uint8_t uuid[16], uint16_t addr, + uint8_t num_elem) + { + printk("Node added: addr=0x%04x, elements=%d\n", addr, num_elem); + /* The CDB node is created automatically by the provisioning subsystem */ + } + + static const struct bt_mesh_prov prov = { + .uuid = dev_uuid, + .node_added = node_added, + /* ... other callbacks ... */ + }; + + /* Manual node allocation (if needed) */ + static struct bt_mesh_cdb_node *allocate_node(const uint8_t uuid[16], + uint8_t num_elem) + { + struct bt_mesh_cdb_node *node; + uint16_t addr; + + /* Get free address or specify one (0 = auto-allocate) */ + addr = bt_mesh_cdb_free_addr_get(num_elem); + if (addr == BT_MESH_ADDR_UNASSIGNED) { + printk("No free addresses available\n"); + return NULL; + } + + /* Allocate node in CDB */ + node = bt_mesh_cdb_node_alloc(uuid, addr, num_elem, net_idx); + if (node == NULL) { + printk("Failed to allocate node\n"); + return NULL; + } + + return node; + } + +Key points: + +* During normal PB-ADV/PB-GATT provisioning, nodes are automatically added to the CDB. +* The :c:func:`bt_mesh_cdb_node_alloc` function creates a CDB entry with the specified parameters. +* Pass :c:macro:`BT_MESH_ADDR_UNASSIGNED` as the address to let the CDB auto-assign the lowest available address. +* The :c:func:`bt_mesh_cdb_free_addr_get` function finds a free address range for a given element count. +* Address allocation checks for conflicts and ensures the unicast address validity. + +.. _cdb_pattern_3: + +Subnet and key management +========================= + +Large or segmented mesh networks often use multiple subnets to separate traffic domains, enable secure migration, or support the Key Refresh procedure. +Managing subnets and their network keys in the CDB allows the provisioner to create new subnets, rotate keys, and derive the correct flags and IV Index when provisioning and configuring nodes. + +Manage network keys and subnets in the CDB: + +.. code-block:: c + + /* Add a new subnet */ + static int add_subnet(uint16_t net_idx) + { + struct bt_mesh_cdb_subnet *sub; + uint8_t net_key[16]; + int err; + + /* Allocate subnet in CDB */ + sub = bt_mesh_cdb_subnet_alloc(net_idx); + if (sub == NULL) { + printk("Failed to allocate subnet\n"); + return -ENOMEM; + } + + /* Generate network key */ + bt_rand(net_key, 16); + + /* Import key value */ + err = bt_mesh_cdb_subnet_key_import(sub, 0, net_key); + if (err) { + bt_mesh_cdb_subnet_del(sub, false); + return err; + } + + /* Store subnet */ + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + bt_mesh_cdb_subnet_store(sub); + } + + return 0; + } + + /* Get subnet for provisioning */ + static int get_subnet_flags(uint16_t net_idx) + { + struct bt_mesh_cdb_subnet *sub; + uint8_t flags; + + sub = bt_mesh_cdb_subnet_get(net_idx); + if (sub == NULL) { + return -ENOENT; + } + + flags = bt_mesh_cdb_subnet_flags(sub); + printk("Subnet flags: KR=%d IVU=%d\n", + !!(flags & BT_MESH_NET_FLAG_KR), + !!(flags & BT_MESH_NET_FLAG_IVU)); + + return 0; + } + +Key points: + +* The :c:func:`bt_mesh_cdb_subnet_alloc` function allocates a subnet by NetIdx. +* The :c:func:`bt_mesh_cdb_subnet_key_import` function sets the actual key value. +* The :c:func:`bt_mesh_cdb_subnet_flags` function returns flags needed for provisioning data. +* The flags include Key Refresh and IV Update state from the CDB. + +.. _cdb_pattern_4: + +Subnet lookup and removal +========================= + +At some point you may need to inspect an existing subnet (for diagnostics or tooling) or remove it entirely (for example when decommissioning a segment, rotating to a new subnet, or cleaning up after experimentation). +The CDB provides lookup and deletion helpers so that the provisioner can keep its view of active subnets consistent with what nodes actually use. + +Find and manage subnets in the CDB: + +.. code-block:: c + + /* Get subnet by NetIdx */ + static void lookup_subnet(uint16_t net_idx) + { + struct bt_mesh_cdb_subnet *sub; + + sub = bt_mesh_cdb_subnet_get(net_idx); + if (sub == NULL) { + printk("Subnet 0x%03x not found\n", net_idx); + return; + } + + printk("Subnet 0x%03x: kr_phase=%d\n", net_idx, sub->kr_phase); + } + + /* Remove a subnet from the CDB */ + static void remove_subnet(uint16_t net_idx) + { + struct bt_mesh_cdb_subnet *sub; + + sub = bt_mesh_cdb_subnet_get(net_idx); + if (sub == NULL) { + printk("Subnet not found\n"); + return; + } + + /* First, remove the subnet from all nodes in the network */ + /* ... send NetKey Delete to all nodes using Config Client ... */ + + /* Delete subnet from CDB */ + bt_mesh_cdb_subnet_del(sub, true); + + printk("Subnet 0x%03x removed\n", net_idx); + } + + /* Export subnet key for external use */ + static int export_subnet_key(uint16_t net_idx, int key_idx) + { + struct bt_mesh_cdb_subnet *sub; + uint8_t net_key[16]; + int err; + + sub = bt_mesh_cdb_subnet_get(net_idx); + if (sub == NULL) { + return -ENOENT; + } + + err = bt_mesh_cdb_subnet_key_export(sub, key_idx, net_key); + if (err) { + printk("Failed to export subnet key (err %d)\n", err); + return err; + } + + printk("NetKey[%d] for subnet 0x%03x: ", key_idx, net_idx); + for (int i = 0; i < 16; i++) { + printk("%02x", net_key[i]); + } + printk("\n"); + + return 0; + } + +Key points: + +* The :c:func:`bt_mesh_cdb_subnet_get` function retrieves a subnet by its NetKeyIndex. +* Pass ``true`` to the :c:func:`bt_mesh_cdb_subnet_del` function to clear persistent storage. +* Always remove the subnet from all nodes before deleting it from the CDB. +* Use the :c:func:`bt_mesh_cdb_subnet_key_export` function to retrieve key material securely. +* The ``key_idx`` parameter (``0`` or ``1``) selects between old and new keys during the Key Refresh procedure. + +.. _cdb_pattern_5: + +Setting up application keys +=========================== + +Application keys define which application traffic can be encrypted and where it can be bound. +After the CDB is initialized, the provisioner must create one or more application keys so that it can bind models on nodes and enable real application‑level communication (for example, lighting or sensor data). + +After creating the CDB, add application keys for node configuration: + +.. code-block:: c + + static void setup_cdb_keys(void) + { + struct bt_mesh_cdb_app_key *key; + uint8_t app_key[16]; + int err; + + /* Allocate application key in CDB */ + key = bt_mesh_cdb_app_key_alloc(net_idx, app_idx); + if (key == NULL) { + printk("Failed to allocate app-key\n"); + return; + } + + /* Generate random key value */ + bt_rand(app_key, 16); + + /* Import the key into CDB */ + err = bt_mesh_cdb_app_key_import(key, 0, app_key); + if (err) { + printk("Failed to import appkey (err %d)\n", err); + return; + } + + /* Store to persistent storage */ + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + bt_mesh_cdb_app_key_store(key); + } + } + +Key points: + +* The :c:func:`bt_mesh_cdb_app_key_alloc` function allocates a slot in the CDB. +* The :c:func:`bt_mesh_cdb_app_key_import` function sets the actual key value. +* The second parameter to import (``0``) is the key index for the Key Refresh procedure (``0`` = current key). +* Always store keys after creation when using persistent storage. + +.. _cdb_pattern_6: + +Application keys lookup and removal +=================================== + +Over time, you may need to inspect which network key an application key is bound to, rotate or revoke application keys, or clean up keys that are no longer used. +Proper lookup and removal through the CDB helps avoid dangling bindings and ensures that nodes and the provisioner share the same view of usable application keys. + +Find and manage application keys in the CDB: + +.. code-block:: c + + /* Get application key by AppIdx */ + static void lookup_app_key(uint16_t app_idx) + { + struct bt_mesh_cdb_app_key *key; + + key = bt_mesh_cdb_app_key_get(app_idx); + if (key == NULL) { + printk("AppKey 0x%03x not found\n", app_idx); + return; + } + + printk("AppKey 0x%03x: bound to NetIdx 0x%03x\n", + app_idx, key->net_idx); + } + + /* Remove an application key from the CDB */ + static void remove_app_key(uint16_t app_idx) + { + struct bt_mesh_cdb_app_key *key; + + key = bt_mesh_cdb_app_key_get(app_idx); + if (key == NULL) { + printk("AppKey not found\n"); + return; + } + + /* First, remove the app key from all nodes in the network */ + /* ... send AppKey Delete to all nodes using Config Client ... */ + + /* Delete app key from CDB */ + bt_mesh_cdb_app_key_del(key, true); + + printk("AppKey 0x%03x removed\n", app_idx); + } + + /* Export application key for external use */ + static int export_app_key(uint16_t app_idx, int key_idx) + { + struct bt_mesh_cdb_app_key *key; + uint8_t app_key[16]; + int err; + + key = bt_mesh_cdb_app_key_get(app_idx); + if (key == NULL) { + return -ENOENT; + } + + err = bt_mesh_cdb_app_key_export(key, key_idx, app_key); + if (err) { + printk("Failed to export app key (err %d)\n", err); + return err; + } + + printk("AppKey[%d] 0x%03x: ", key_idx, app_idx); + for (int i = 0; i < 16; i++) { + printk("%02x", app_key[i]); + } + printk("\n"); + + return 0; + } + + /* Update application key binding */ + static int update_app_key_binding(uint16_t app_idx, uint16_t new_net_idx) + { + struct bt_mesh_cdb_app_key *key; + + key = bt_mesh_cdb_app_key_get(app_idx); + if (key == NULL) { + return -ENOENT; + } + + /* Verify the new subnet exists */ + if (bt_mesh_cdb_subnet_get(new_net_idx) == NULL) { + printk("Target subnet 0x%03x not found\n", new_net_idx); + return -ENOENT; + } + + key->net_idx = new_net_idx; + + /* Store updated binding */ + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + bt_mesh_cdb_app_key_store(key); + } + + printk("AppKey 0x%03x rebound to NetIdx 0x%03x\n", + app_idx, new_net_idx); + + return 0; + } + +Key points: + +* The :c:func:`bt_mesh_cdb_app_key_get` function retrieves an application key by its AppKeyIndex. +* Pass ``true`` to the :c:func:`bt_mesh_cdb_app_key_del` function to clear persistent storage. +* Always remove the app key from all nodes before deleting it from the CDB. +* Use the :c:func:`bt_mesh_cdb_app_key_export` function to retrieve key material securely. +* The ``key_idx`` parameter (``0`` or ``1``) selects between old and new keys during the Key Refresh procedure. +* Application keys are bound to a network key through the ``net_idx`` field. + +.. _cdb_pattern_7: + +Node configuration +================== + +Provisioning only adds a node to the network; it does not make it participate in your application. +After provisioning, you must configure nodes—add network/app keys, bind models, and set subscriptions/publications. +The CDB stores the keys and configuration status so the provisioner can resume configuration after a reboot and avoid re‑configuring already finished nodes. + +After provisioning, configure the node by adding keys and binding models: + +.. code-block:: c + + static void configure_node(struct bt_mesh_cdb_node *node) + { + NET_BUF_SIMPLE_DEFINE(buf, BT_MESH_RX_SDU_MAX); + struct bt_mesh_cdb_app_key *key; + uint8_t app_key[16]; + uint8_t status; + int err; + + printk("Configuring node 0x%04x\n", node->addr); + + /* Get application key from CDB */ + key = bt_mesh_cdb_app_key_get(app_idx); + if (key == NULL) { + printk("App-key not found\n"); + return; + } + + /* Export key value from CDB */ + err = bt_mesh_cdb_app_key_export(key, 0, app_key); + if (err) { + printk("Failed to export key (err %d)\n", err); + return; + } + + /* Add application key to the node */ + err = bt_mesh_cfg_cli_app_key_add(net_idx, node->addr, + net_idx, app_idx, + app_key, &status); + if (err || status) { + printk("Failed to add app-key (err %d, status %d)\n", + err, status); + return; + } + + /* Get composition data and bind models */ + err = bt_mesh_cfg_cli_comp_data_get(net_idx, node->addr, 0, + &status, &buf); + if (err || status) { + printk("Failed to get composition data\n"); + return; + } + + /* Parse composition and bind models to app key */ + /* ... model binding code ... */ + + /* Mark node as configured */ + atomic_set_bit(node->flags, BT_MESH_CDB_NODE_CONFIGURED); + + /* Persist configuration status */ + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + bt_mesh_cdb_node_store(node); + } + } + +Key points: + +* Use the :c:func:`bt_mesh_cdb_app_key_get` and the :c:func:`bt_mesh_cdb_app_key_export` functions to retrieve keys. +* The Configuration Client model is used to configure remote nodes. +* Set the ``BT_MESH_CDB_NODE_CONFIGURED`` flag after successful configuration. +* Always call the :c:func:`bt_mesh_cdb_node_store` function to persist the configured state. + +.. _cdb_pattern_8: + +Iterating over nodes +==================== + +Many management tasks involve acting on all (or a filtered subset of) nodes: checking which ones still need configuration, generating statistics, or performing bulk operations. +The CDB iterator lets the provisioner traverse all known nodes in a safe, abstract way without relying on internal storage details. + +The CDB provides an iterator to process all allocated nodes: + +.. code-block:: c + + /* Check for unconfigured nodes */ + static uint8_t check_unconfigured(struct bt_mesh_cdb_node *node, + void *user_data) + { + if (!atomic_test_bit(node->flags, BT_MESH_CDB_NODE_CONFIGURED)) { + printk("Node 0x%04x needs configuration\n", node->addr); + configure_node(node); + } + + return BT_MESH_CDB_ITER_CONTINUE; + } + + static void process_nodes(void) + { + bt_mesh_cdb_node_foreach(check_unconfigured, NULL); + } + + /* Example: Count nodes on a specific subnet */ + static uint8_t count_subnet_nodes(struct bt_mesh_cdb_node *node, + void *user_data) + { + uint16_t *net_idx = user_data; + static int count = 0; + + if (node->net_idx == *net_idx) { + count++; + } + + return BT_MESH_CDB_ITER_CONTINUE; + } + +Key points: + +* The :c:func:`bt_mesh_cdb_node_foreach` function calls the callback for each allocated node. +* Return ``BT_MESH_CDB_ITER_CONTINUE`` to continue iteration. +* Return ``BT_MESH_CDB_ITER_STOP`` to stop iteration early. +* The callback is only called for nodes with ``addr != BT_MESH_ADDR_UNASSIGNED``. + +.. _cdb_pattern_9: + +Node lookup and removal +======================= + +Sometimes a single node must be inspected (for example, when debugging) or removed from the network (for example, when it is physically decommissioned or replaced). +Using CDB node lookup and deletion keeps the logical view of the mesh consistent with the actual devices and prevents address reuse conflicts. + +Find and manage nodes in the CDB: + +.. code-block:: c + + /* Get node by address */ + static void lookup_node(uint16_t addr) + { + struct bt_mesh_cdb_node *node; + + node = bt_mesh_cdb_node_get(addr); + if (node == NULL) { + printk("Node 0x%04x not found\n", addr); + return; + } + + printk("Node 0x%04x: %d elements, net_idx=0x%03x\n", + node->addr, node->num_elem, node->net_idx); + } + + /* Remove a node from the network */ + static void remove_node(uint16_t addr) + { + struct bt_mesh_cdb_node *node; + + node = bt_mesh_cdb_node_get(addr); + if (node == NULL) { + printk("Node not found\n"); + return; + } + + /* First, send Node Reset to the device (recommended) */ + /* ... send reset command using Config Client ... */ + + /* Delete node from CDB */ + bt_mesh_cdb_node_del(node, true); + + printk("Node 0x%04x removed\n", addr); + } + +Key points: + +* The :c:func:`bt_mesh_cdb_node_get` function searches by element address (works for any element address). +* Always send a ``Node Reset`` command before removing a node to avoid orphaned devices. +* Pass ``true`` to the :c:func:`bt_mesh_cdb_node_del` function to clear persistent storage. +* Deleting a node might update the ``lowest_avail_addr`` if appropriate (please read CDB API for details). + +.. _cdb_pattern_10: + +IV Index management +=================== + +The IV Index is a core part of Bluetooth Mesh security and replay protection. +When IV Update procedures occur, the provisioner must update its stored IV Index so that future provisioning and configuration use the correct value and address space. +Storing this in the CDB keeps the network state coherent across reboots and between provisioning actions. + +Update the network's IV Index: + +.. code-block:: c + + /* Update IV Index when IV Update procedure occurs */ + static void handle_iv_update(uint32_t iv_index, bool iv_update) + { + bt_mesh_cdb_iv_update(iv_index, iv_update); + + printk("IV Index updated: %u (IV Update: %s)\n", + iv_index, iv_update ? "in progress" : "normal"); + } + + /* The IV Index is automatically used during provisioning */ + static void provision_with_current_iv(void) + { + /* The provisioner automatically uses bt_mesh_cdb.iv_index + * and bt_mesh_cdb_subnet_flags() when sending provisioning data + */ + } + +Key points: + +* The :c:func:`bt_mesh_cdb_iv_update` function updates both the IV Index and IV Update flag. +* The CDB automatically resets ``lowest_avail_addr`` during IV Index updates. +* The provisioner subsystem automatically uses CDB's IV Index for new nodes. + +.. _cdb_pattern_11: + +Working with device keys +======================== + +Device keys are sensitive information and often handled through secure key storage (for example, PSA crypto). +The CDB’s key import/export APIs abstract how keys are stored, allowing the application to use device keys when needed (for configuration or external tooling) without breaking the security model or relying on direct pointers into key storage. + +Import and export device keys using the key management API: + +.. code-block:: c + + /* Import a known device key */ + static int import_dev_key(struct bt_mesh_cdb_node *node, + const uint8_t dev_key[16]) + { + int err; + + err = bt_mesh_cdb_node_key_import(node, dev_key); + if (err) { + printk("Failed to import device key (err %d)\n", err); + return err; + } + + /* Store updated node */ + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + bt_mesh_cdb_node_store(node); + } + + return 0; + } + + /* Export device key for external use */ + static int export_dev_key(struct bt_mesh_cdb_node *node) + { + uint8_t dev_key[16]; + int err; + + err = bt_mesh_cdb_node_key_export(node, dev_key); + if (err) { + printk("Failed to export device key (err %d)\n", err); + return err; + } + + /* Use the exported key */ + printk("Device key: "); + for (int i = 0; i < 16; i++) { + printk("%02x", dev_key[i]); + } + printk("\n"); + + return 0; + } + +Key points: + +* Always use import/export functions when working with keys (required for PSA crypto). +* Keys are stored securely and are not be directly accessible through pointers. +* The provisioner automatically generates and imports device keys during provisioning. + +.. _cdb_pattern_12: + +Clearing the CDB +================ + +For factory reset, testing, or starting a completely new network, you may need to wipe all provisioning and configuration data. +Clearing the CDB resets the logical network state so you can safely recreate it from scratch, while avoiding inconsistencies with stale keys or node entries. + +Reset the entire configuration database: + +.. code-block:: c + + static void reset_network(void) + { + printk("Clearing CDB...\n"); + + /* Clear all CDB data */ + bt_mesh_cdb_clear(); + + printk("CDB cleared\n"); + } + +Key points: + +* The :c:func:`bt_mesh_cdb_clear` function removes all nodes, subnets, and app keys. +* Clears persistent storage if the :kconfig:option:`CONFIG_BT_SETTINGS` Kconfig option is enabled. +* Marks the CDB as invalid (must call the :c:func:`bt_mesh_cdb_create` function to use again). + +Best practices +************** + +* **Error handling** - Check return values from all CDB functions, especially allocation functions which can fail when capacity is reached. + +* **Address management** - Let the CDB manage address allocation by passing ``0`` to the :c:func:`bt_mesh_cdb_node_alloc` function unless you have specific addressing requirements. + +* **Configuration tracking** - Always set the ``BT_MESH_CDB_NODE_CONFIGURED`` flag and store the node after successful configuration to avoid reconfiguring nodes unnecessarily. + +* **Key security** - Never log or expose keys in production code. + Use import/export functions to handle key material securely. + +* **Iteration safety** - Do not modify the CDB (add/remove nodes) during :c:func:`bt_mesh_cdb_node_foreach` iteration. + Collect addresses first, then modify. + +Common pitfalls +*************** + +CDB synchronization among multiple provisioners + If there are multiple provisioners in the network, ensure they synchronize their CDBs to avoid conflicts. + Use application-level mechanisms to share CDB among multiple provisioners. + There is no built-in mechanism for CDB synchronization. + +Forgetting to store + CDB modifications are not automatically persisted. + Always call the appropriate ``_store()`` function after making changes when using persistent storage. + +Incorrect key index + When importing/exporting keys, the key index parameter (``0`` or ``1``) refers to the position in the Key Refresh key array, not the NetIdx or AppIdx. + +Address conflicts + If manually specifying addresses, ensure they do not conflict with existing nodes. + Use the :c:func:`bt_mesh_cdb_free_addr_get` function to find available addresses. + +Over-capacity + CDB has fixed capacity defined by Kconfig. + Exceeding capacity causes allocation failures. + Monitor CDB usage and increase capacity if needed. + +Accessing invalid nodes + Always check if returned pointers from ``_get()`` or ``_alloc()`` functions are ``NULL`` before dereferencing. + +API reference +************* + +For complete API documentation, refer to: + +* Header file: :file:`include/zephyr/bluetooth/mesh/cdb.h` +* Implementation: :file:`subsys/bluetooth/mesh/cdb.c` + +Related documentation +********************* + +* :ref:`bluetooth_mesh` +* :ref:`bluetooth_mesh_provisioning` +* Mesh Shell commands: :ref:`bluetooth_mesh_shell` diff --git a/include/zephyr/bluetooth/mesh/cdb.h b/include/zephyr/bluetooth/mesh/cdb.h index 9b7fbf4af796..887fe8a54393 100644 --- a/include/zephyr/bluetooth/mesh/cdb.h +++ b/include/zephyr/bluetooth/mesh/cdb.h @@ -32,34 +32,48 @@ enum { BT_MESH_CDB_NODE_FLAG_COUNT }; +/* doc string cdb node start */ struct bt_mesh_cdb_node { + /** Node UUID */ uint8_t uuid[16]; + /** Primary element address */ uint16_t addr; + /** Network key index used during provisioning */ uint16_t net_idx; + /** Number of elements */ uint8_t num_elem; + /** Device key */ struct bt_mesh_key dev_key; - + /** Node flags */ ATOMIC_DEFINE(flags, BT_MESH_CDB_NODE_FLAG_COUNT); }; +/* doc string cdb node end */ +/* doc string cdb subnet start */ struct bt_mesh_cdb_subnet { + /** Network key index */ uint16_t net_idx; - + /** Key Refresh phase */ uint8_t kr_phase; - + /** Old and new keys for Key Refresh */ struct { struct bt_mesh_key net_key; } keys[2]; }; +/* doc string cdb subnet end */ +/* doc string cdb app key start */ struct bt_mesh_cdb_app_key { + /** Bound network key index */ uint16_t net_idx; + /** Application key index */ uint16_t app_idx; - + /** Old and new keys for Key Refresh */ struct { struct bt_mesh_key app_key; } keys[2]; }; +/* doc string cdb app key end */ enum { BT_MESH_CDB_VALID, @@ -71,18 +85,25 @@ enum { BT_MESH_CDB_FLAG_COUNT, }; +/* doc string cdb start */ struct bt_mesh_cdb { + /** Network IV Index */ uint32_t iv_index; + /** Lowest available unicast address for provisioning */ uint16_t lowest_avail_addr; - + /** Flags for CDB state (private) */ ATOMIC_DEFINE(flags, BT_MESH_CDB_FLAG_COUNT); - + /** Nodes in the mesh network */ struct bt_mesh_cdb_node nodes[NODE_COUNT]; + /** Subnets in the mesh network */ struct bt_mesh_cdb_subnet subnets[SUBNET_COUNT]; + /** Application keys in the mesh network */ struct bt_mesh_cdb_app_key app_keys[APP_KEY_COUNT]; }; +/** The global CDB instance is accessible through this variable. */ extern struct bt_mesh_cdb bt_mesh_cdb; +/* doc string cdb end */ /** @brief Create the Mesh Configuration Database. * From c683bd97f95cb609be5818ba34bccbd616f11f2f Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 19 Jan 2026 12:33:23 +0100 Subject: [PATCH 1701/3334] [nrf fromtree] net: dns: Don't report CNAME records via callback Don't report CNAME records via application callback (as it used to be done). They don't carry any data in the info struct and are only used internally to redirect DNS queries. Signed-off-by: Robert Lubos (cherry picked from commit 2a1b814f7bfa5fb13a4f2e246027c1cff2db3938) --- subsys/net/lib/dns/resolve.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index 408a694a5ef8..f5c469d883bd 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -1395,6 +1395,14 @@ int dns_validate_msg(struct dns_resolve_context *ctx, goto quit; } + + if (answer_type == DNS_RR_TYPE_CNAME) { + /* Don't report CNAME records to the application, they're used internally + * for query redirection. + */ + continue; + } + invoke_query_callback(DNS_EAI_INPROGRESS, &info, &ctx->queries[*query_idx]); if (dns_msg->response_type == DNS_RESPONSE_IP || From 1bace8b099c73ff77bcfca9cf53356c6da9e0ef4 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 19 Jan 2026 14:07:40 +0100 Subject: [PATCH 1702/3334] [nrf fromtree] net: dns: Fix query redirection in case of CNAME result In case CNAME record is received with no IP addresses, DNS resolver will attempt to re-send the query for the name indicated by the CNAME record. The logic for scheduling the new query was inconsistent though: dispatcher_cb() assumes that it'll reuse the query context with the same query id, while dns_read() cancelled the query, which shouldn't really happen, as that would cause an error to be reported to the application via callback. Fix that by skipping the query cancel in case of DNS_EAI_AGAIN result. The query context will be properly reused then, and freed either when reply for another query arrives, or the query times out. Signed-off-by: Robert Lubos (cherry picked from commit 38d9c632d691616a138e1426217874333b333e6c) --- subsys/net/lib/dns/resolve.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index f5c469d883bd..0e1d04dd5733 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -1490,12 +1490,12 @@ static int dns_read(struct dns_resolve_context *ctx, ret = dns_validate_msg(ctx, &dns_msg, dns_id, &query_idx, dns_cname, query_hash); if (ret == DNS_EAI_AGAIN) { - goto finished; + return ret; } if ((ret < 0 && ret != DNS_EAI_ALLDONE) || query_idx < 0 || query_idx > CONFIG_DNS_NUM_CONCUR_QUERIES) { - goto quit; + return ret; } #if defined(CONFIG_DNS_RESOLVER_PACKET_FORWARDING) @@ -1518,13 +1518,6 @@ static int dns_read(struct dns_resolve_context *ctx, } return 0; - -finished: - dns_resolve_cancel_with_name(ctx, *dns_id, - ctx->queries[query_idx].query, - ctx->queries[query_idx].query_type); -quit: - return ret; } static int set_ttl_hop_limit(int sock, int level, int option, int new_limit) From b5b3cbcab0e060bace38deb27b27337db6071c8c Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 19 Jan 2026 14:50:15 +0100 Subject: [PATCH 1703/3334] [nrf fromtree] net: dns: Implement CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES There was a Kconfig option defined to limit the number of additional DNS queries sent for aliases received in CNAME records (to avoid potential query loops), however it was not implemented. This commit implements the feature - the resolver will now only send up to CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES follow-up queries after receiving CNAME record with an alias w/o any IP addresses. Signed-off-by: Robert Lubos (cherry picked from commit fbd9079148975b0f45170611c4cbf10e4bacaadd) --- include/zephyr/net/dns_resolve.h | 5 +++++ subsys/net/lib/dns/resolve.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/include/zephyr/net/dns_resolve.h b/include/zephyr/net/dns_resolve.h index eeaa1adf2db8..9af09951dfbf 100644 --- a/include/zephyr/net/dns_resolve.h +++ b/include/zephyr/net/dns_resolve.h @@ -530,6 +530,11 @@ struct dns_resolve_context { */ uint16_t query_hash; + /* Number of additional queries sent to resolve CNAME record + * name aliases. + */ + uint8_t additional_queries; + /** Flag to indicate that the callback has been called at least once. */ bool cb_called; } queries[DNS_NUM_CONCUR_QUERIES]; diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index 0e1d04dd5733..a8a853b78213 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -318,6 +318,11 @@ static int dispatcher_cb(struct dns_socket_dispatcher *my_ctx, int sock, goto free_buf; } + if (ctx->queries[i].additional_queries >= CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES) { + ret = DNS_EAI_FAIL; + goto quit; + } + for (j = 0; j < SERVER_COUNT; j++) { if (ctx->servers[j].sock < 0) { continue; @@ -332,6 +337,8 @@ static int dispatcher_cb(struct dns_socket_dispatcher *my_ctx, int sock, } } + ctx->queries[i].additional_queries++; + if (nfail > 0) { NET_DBG("DNS cname query %d fails on %d attempts", nfail, ntry); @@ -2041,6 +2048,7 @@ int dns_resolve_name_internal(struct dns_resolve_context *ctx, ctx->queries[i].user_data = user_data; ctx->queries[i].ctx = ctx; ctx->queries[i].query_hash = 0; + ctx->queries[i].additional_queries = 0; ctx->queries[i].cb_called = false; k_work_init_delayable(&ctx->queries[i].timer, query_timeout); From bbc95b524e6deb64f4df6185f2b2bd1499218343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Amundsen?= Date: Mon, 26 Jan 2026 08:06:28 +0100 Subject: [PATCH 1704/3334] [nrf fromtree] modules: hal_nordic: fix enumeration of SAADC channels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The enumeration was off by 1, fix to align with with the binding. Also fix an incorrect file name in a comment. Signed-off-by: Håkon Amundsen (cherry picked from commit d58d67bc6d0ac46070aeba295ebff06c85cc289c) --- .../ironside/se/scripts/periphconf/builder.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py index f749a8ea277d..7c214b46ff09 100644 --- a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py +++ b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py @@ -1049,23 +1049,23 @@ def _missing_(cls, value: Any) -> NrfFun: class NrfSaadcChannel(int, enum.Enum): """Identifiers representing SAADC channels. - See include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h. + See include/zephyr/dt-bindings/adc/nrf-saadc.h. """ - AIN0 = 1 - AIN1 = 2 - AIN2 = 3 - AIN3 = 4 - AIN4 = 5 - AIN5 = 6 - AIN6 = 7 - AIN7 = 8 - AIN8 = 9 - AIN9 = 10 - AIN10 = 11 - AIN11 = 12 - AIN12 = 13 - AIN13 = 14 + AIN0 = 0 + AIN1 = 1 + AIN2 = 2 + AIN3 = 3 + AIN4 = 4 + AIN5 = 5 + AIN6 = 6 + AIN7 = 7 + AIN8 = 8 + AIN9 = 9 + AIN10 = 10 + AIN11 = 11 + AIN12 = 12 + AIN13 = 13 class NrfCompChannel(str, enum.Enum): From a7c2a12b91342b106c6a0697cf11337105c81b13 Mon Sep 17 00:00:00 2001 From: Gillian Minnehan Date: Thu, 15 Jan 2026 10:45:19 -0500 Subject: [PATCH 1705/3334] [nrf fromtree] doc: develop: manifests: external: add memfault Add documentation to external module section for adding the Memfault firmware SDK to a Zephyr project. Additionally, refer to the module in OTA docs. Signed-off-by: Gillian Minnehan (cherry picked from commit edc952e6410fac3add8807e95122cf6897f28d7e) --- .../external/memfault-firmware-sdk.rst | 70 +++++++++++++++++++ doc/services/device_mgmt/ota.rst | 11 +++ 2 files changed, 81 insertions(+) create mode 100644 doc/develop/manifest/external/memfault-firmware-sdk.rst diff --git a/doc/develop/manifest/external/memfault-firmware-sdk.rst b/doc/develop/manifest/external/memfault-firmware-sdk.rst new file mode 100644 index 000000000000..d872f3a16d3a --- /dev/null +++ b/doc/develop/manifest/external/memfault-firmware-sdk.rst @@ -0,0 +1,70 @@ +.. _external_module_memfault_firmware_sdk: + +memfault-firmware-sdk +##################### + +Introduction +************ + +`memfault-firmware-sdk`_ provides embedded developers with built-in remote debugging, performance +monitoring, and OTA update capabilities for MCU-based devices. It automatically captures crash +reports, logs, and stack traces from devices in the field, making it easier to diagnose issues +without physical access. The SDK also collects lightweight performance metrics such as memory usage, +battery life, connectivity, and firmware stability to track fleet reliability over time. + +The SDK communicates with the `Memfault`_ platform, which aggregates this data so teams can +prioritize and resolve issues faster. In addition, the SDK supports over-the-air firmware updates, +enabling controlled rollouts and remote deployment of new releases. + +The SDK is protected under a custom BSD-style license with service-specific use restrictions. See +the `Memfault Firmware SDK License`_ for more details. + +Usage with Zephyr +***************** + +To pull in ``memfault-firmware-sdk`` as a Zephyr :ref:`module `, add it as a West project +in the :file:`west.yaml` file with the following content and run :command:`west update`: + +.. code-block:: yaml + + manifest: + remotes: + # Add the Memfault GitHub repo + - name: memfault + url-base: https://github.com/memfault + projects: + # Add the Memfault SDK + - name: memfault-firmware-sdk + path: modules/lib/memfault-firmware-sdk + revision: 1.33.0 + remote: memfault + +.. note:: + + The revision shown above is an example. Check the `memfault-firmware-sdk`_ + releases page for the latest release tag to ensure you are using the desired + version. + +For more detailed instructions and API documentation, refer to the +`memfault-firmware-sdk documentation`_ as well as the provided `memfault-firmware-sdk examples`_. + +Reference +********* + +.. _memfault-firmware-sdk: + https://github.com/memfault/memfault-firmware-sdk + +.. _Memfault Firmware SDK License: + https://github.com/memfault/memfault-firmware-sdk/blob/master/LICENSE + +.. _memfault-firmware-sdk documentation: + https://docs.memfault.com/docs/mcu/introduction + +.. _memfault-firmware-sdk Zephyr guide: + https://docs.memfault.com/docs/mcu/zephyr-guide + +.. _memfault-firmware-sdk examples: + https://github.com/memfault/memfault-firmware-sdk/tree/master/examples + +.. _Memfault: + https://memfault.com/ diff --git a/doc/services/device_mgmt/ota.rst b/doc/services/device_mgmt/ota.rst index aebe3d36d82d..73df5554c675 100644 --- a/doc/services/device_mgmt/ota.rst +++ b/doc/services/device_mgmt/ota.rst @@ -88,6 +88,16 @@ updates with automatic rollback on failure. See :ref:`external_module_mender_mcu` for integration details and examples. +Memfault and nRF Cloud powered by Memfault +========================================== + +`Memfault`_ is a IoT observability platform that includes OTA management. Devices check-in with +Memfault's service periodically for an OTA update, and when an update is available, download and +install the binary. + +See :ref:`external_module_memfault_firmware_sdk` for overall integration details and +examples. + .. _MCUboot bootloader: https://mcuboot.com/ .. _Golioth: https://golioth.io/ .. _Golioth Firmware SDK repository: https://github.com/golioth/golioth-firmware-sdk/tree/main/examples/zephyr/fw_update @@ -95,3 +105,4 @@ See :ref:`external_module_mender_mcu` for integration details and examples. .. _Eclipse hawkBit: https://www.eclipse.org/hawkbit/ .. _UpdateHub: https://updatehub.io/ .. _mender-mcu: https://github.com/mendersoftware/mender-mcu +.. _Memfault: https://memfault.com/ From 5a157b38198d0c7e2d1f8e6a754c3832770ccde2 Mon Sep 17 00:00:00 2001 From: Uma Praseeda Date: Tue, 27 Jan 2026 16:00:00 +0100 Subject: [PATCH 1706/3334] [nrf noup] zephyr: doc: Update OTA documentation update OTA documentation Signed-off-by: Uma Praseeda --- doc/services/device_mgmt/ota.rst | 119 +++++++++---------------------- 1 file changed, 35 insertions(+), 84 deletions(-) diff --git a/doc/services/device_mgmt/ota.rst b/doc/services/device_mgmt/ota.rst index 73df5554c675..6cf6e67a26e4 100644 --- a/doc/services/device_mgmt/ota.rst +++ b/doc/services/device_mgmt/ota.rst @@ -19,90 +19,41 @@ same method can be used as part of OTA. The binary is first downloaded into an unoccupied code partition, usually named ``slot1_partition``, then upgraded using the :ref:`mcuboot` process. -Examples of OTA -*************** - -Golioth -======= - -`Golioth`_ is an IoT management platform that includes OTA updates. Devices are -configured to observe your available firmware revisions on the Golioth Cloud. -When a new version is available, the device downloads and flashes the binary. In -this implementation, the connection between cloud and device is secured using -TLS/DTLS, and the signed firmware binary is confirmed by MCUboot before the -upgrade occurs. - -1. A working sample can be found on the `Golioth Firmware SDK repository`_ -2. The `Golioth OTA documentation`_ includes complete information about the - versioning process - -Eclipse hawkBit |trade| -======================= - -`Eclipse hawkBit`_ |trade| is an update server framework that uses polling on a -REST api to detect firmware updates. When a new update is detected, the binary -is downloaded and installed. MCUboot can be used to verify the signature before -upgrading the firmware. - -There is a :zephyr:code-sample:`hawkbit-api` sample included in the -Zephyr :zephyr:code-sample-category:`mgmt` section. - -UpdateHub -========= - -`UpdateHub`_ is a platform for remotely updating embedded devices. Updates can -be manually triggered or monitored via polling. When a new update is detected, -the binary is downloaded and installed. MCUboot can be used to verify the -signature before upgrading the firmware. - -There is an :zephyr:code-sample:`updatehub-fota` sample included in the Zephyr -:zephyr:code-sample-category:`mgmt` section. - -SMP Server -========== - -A Simple Management Protocol (SMP) server can be used to update firmware via -Bluetooth Low Energy (LE) or UDP. :ref:`mcu_mgr` is used to send a signed -firmware binary to the remote device where it is verified by MCUboot before the -upgrade occurs. - -There is an :zephyr:code-sample:`smp-svr` sample included in the Zephyr -:zephyr:code-sample-category:`mgmt` section. - -Lightweight M2M (LWM2M) -======================= - -The :ref:`lwm2m_interface` protocol includes support for firmware update via -:kconfig:option:`CONFIG_LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT`. Devices securely -connect to an LwM2M server using DTLS. A :zephyr:code-sample:`lwm2m-client` sample is -available but it does not demonstrate the firmware update feature. - -mender-mcu -========== - -`mender-mcu`_ enables robust firmware updates on resource-constrained devices by -integrating with Zephyr. It implements an Update Module interface and provides -a default Update Module that integrates with MCUboot to provide A/B updates. -This allows microcontroller units (MCUs) to perform atomic, fail-safe OTA -updates with automatic rollback on failure. - -See :ref:`external_module_mender_mcu` for integration details and examples. - Memfault and nRF Cloud powered by Memfault -========================================== - -`Memfault`_ is a IoT observability platform that includes OTA management. Devices check-in with -Memfault's service periodically for an OTA update, and when an update is available, download and -install the binary. - -See :ref:`external_module_memfault_firmware_sdk` for overall integration details and -examples. +****************************************** + +`Memfault`_ is an IoT observability platform that includes OTA management. +Devices check in with Memfault's service periodically for an OTA update, and +when an update is available, download and install the binary. + +Zephyr projects that use MCUboot and have a direct Internet connection can +leverage the `Memfault Firmware SDK's `_ OTA client to +download a payload from Memfault's OTA service, load it into the secondary +partition, and then reboot into the new image. +See `Memfault OTA for Zephyr documentation`_ for more details on this support +for Zephyr projects. + +For Nordic Semiconductor cellular chip users, the Memfault +Firmware SDK includes support for downloading the payload over a cellular +connection using nRF Connect SDK's FOTA and downloader libraries. +See the `Memfault Quickstart for the nRF91 Series`_ for more +information. Zephyr projects with a Bluetooth Low Energy connection can +leverage the `Memfault Diagnostic Service`_ (MDS) with the `Memfault iOS SDK`_ +and `Memfault Android SDK`_ to deliver the update payload to the device. For +Nordic Semiconductor's Bluetooth Low Energy chip users, the Zephyr-based +nRF Connect SDK provides an implementation of MDS. See the +`nRF Connect SDK documentation on MDS`_ for more information as well as +`nRF Cloud powered by Memfault`_ for detail on using the Memfault platform with +Nordic Semiconductor Bluetooth Low Energy chips. +See :ref:`external_module_memfault_firmware_sdk` for overall integration +details and examples. -.. _MCUboot bootloader: https://mcuboot.com/ -.. _Golioth: https://golioth.io/ -.. _Golioth Firmware SDK repository: https://github.com/golioth/golioth-firmware-sdk/tree/main/examples/zephyr/fw_update -.. _Golioth OTA documentation: https://docs.golioth.io/device-management/ota -.. _Eclipse hawkBit: https://www.eclipse.org/hawkbit/ -.. _UpdateHub: https://updatehub.io/ -.. _mender-mcu: https://github.com/mendersoftware/mender-mcu .. _Memfault: https://memfault.com/ +.. _Memfault Firmware SDK: https://github.com/memfault/memfault-firmware-sdk +.. _Memfault OTA for Zephyr documentation: https://docs.memfault.com/docs/mcu/zephyr-guide#ota +.. _Memfault Quickstart for the nRF91 Series: https://docs.memfault.com/docs/mcu/quickstart-nrf9160 +.. _Memfault Diagnostic Service: https://docs.memfault.com/docs/mcu/mds +.. _Memfault iOS SDK: https://github.com/memfault/memfault-cloud-ios +.. _Memfault Android SDK: https://github.com/memfault/memfault-cloud-android +.. _nRF Connect SDK documentation on MDS: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/bluetooth/services/mds.html +.. _nRF Cloud powered by Memfault: https://nrfcloud.com/#/ From 26dcedd1a938d00825c08046d9ccca62336e6ad1 Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Fri, 30 Jan 2026 02:41:48 +0100 Subject: [PATCH 1707/3334] [nrf fromtree] soc: nordic: nrf7120 fix missing tfm support Add NRF_TRUSTZONE_X_REGION_SIZE for mpc region size alignment. fix missing include of soc header file. Signed-off-by: Travis Lam (cherry picked from commit 4a2f56bb8e550bdb6407f9a709ed21ccb8786a6a) --- boards/nordic/nrf7120dk/Kconfig | 30 +++++++++++++++++++ .../nordic/nrf7120_cpuapp_ns_partition.dtsi | 28 +++++++++++++++++ soc/nordic/nrf71/soc.c | 1 + soc/nordic/nrf71/soc.h | 2 +- 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 boards/nordic/nrf7120dk/Kconfig diff --git a/boards/nordic/nrf7120dk/Kconfig b/boards/nordic/nrf7120dk/Kconfig new file mode 100644 index 000000000000..7232ebc06d2e --- /dev/null +++ b/boards/nordic/nrf7120dk/Kconfig @@ -0,0 +1,30 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# nRF7120 DK board configuration + +if BOARD_NRF7120DK_NRF7120_CPUAPP_NS + +DT_NRF_MPC_REGION := $(dt_nodelabel_path,nrf_mpc_region) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC_REGION),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC_REGION),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_NRF7120DK_NRF7120_CPUAPP_NS diff --git a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi index f2bf6feec045..dcb5f7563140 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi @@ -6,6 +6,34 @@ * Default memory partitioning for nRF7120 application CPU. */ +/* + * Default SRAM planning when building for nRF7120 with ARM TrustZone-M support + * - Lowest 256 kB SRAM allocated to Secure image (sram0_s). + * - Upper 256 kB SRAM allocated to Non-Secure image (sram0_ns). + * + * cpuapp_sram has 512 kB of volatile memory (SRAM). + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ +&cpuapp_sram { + sram0_s: image_s@0 { + #address-cells = <1>; + #size-cells = <1>; + /* Secure image memory */ + reg = <0x0 DT_SIZE_K(256)>; + ranges = <0x0 0x0 DT_SIZE_K(256)>; + }; + + sram0_ns: image_ns@20000 { + #address-cells = <1>; + #size-cells = <1>; + /* Non-Secure image memory */ + reg = <0x20000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000 DT_SIZE_K(256)>; + }; +}; + &cpuapp_mram { /* * Default NVM layout on NRF7120 Application MCU without BL2: diff --git a/soc/nordic/nrf71/soc.c b/soc/nordic/nrf71/soc.c index a71cd26367e1..9018bc99e482 100644 --- a/soc/nordic/nrf71/soc.c +++ b/soc/nordic/nrf71/soc.c @@ -30,6 +30,7 @@ #include #endif +#include #include #include diff --git a/soc/nordic/nrf71/soc.h b/soc/nordic/nrf71/soc.h index 28ff81c8265e..91456f4ac94d 100644 --- a/soc/nordic/nrf71/soc.h +++ b/soc/nordic/nrf71/soc.h @@ -18,7 +18,7 @@ #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc) -#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && !defined(__NRF_TFM__) #define PWR_ANTSWC_REG (0x4010F780UL) #else /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ #define PWR_ANTSWC_REG (0x5010F780UL) From d4bad14527d318c035063f3780d66df7817a6d15 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 26 Jan 2026 16:01:32 +0000 Subject: [PATCH 1708/3334] [nrf fromtree] dts: Fix incorrect/invalid usage of RAM/NVM nodes for nRF54L* Fixes various issues with how these have been used: - Reserved memory was wrongfully used to describe an RRAM area for a CPU - Reserved memory was wrongfully used to describe an SRAM area for a CPU - A partition described using reserved memory did not have the required NVM erase size and write size parameters set for it - RRAM partitions were not correctly setting ranges properties - RRAM validation wrongly took the "base flash controller" into considering because it was not using unit addresses - RRAM partitions incorrect set up so that they collided with one another for different cores Signed-off-by: Jamie McCrae (cherry picked from commit b8ab27aa401ebb3a7e05ee130b8856eb7a084405) --- .../bl54l15_dvk_nrf54l15_cpuflpr.dts | 1 + .../bl54l15u_dvk_nrf54l15_cpuflpr.dts | 1 + .../nrf54l15dk_nrf54l15_cpuflpr.dts | 1 + .../nrf54lm20dk_nrf54lm20a_cpuflpr.dts | 1 + .../panb611evb_nrf54l15_cpuflpr.dts | 1 + .../raytac_an54lq_db_15_nrf54l15_cpuflpr.dts | 1 + .../xiao_nrf54l15_nrf54l15_cpuflpr.dts | 1 + .../ophelia4ev_nrf54l15_cpuflpr.dts | 2 +- dts/vendor/nordic/nrf54l05.dtsi | 3 +++ dts/vendor/nordic/nrf54l10.dtsi | 3 +++ dts/vendor/nordic/nrf54l15.dtsi | 3 +++ dts/vendor/nordic/nrf54lm20a.dtsi | 18 ++++++++++++- .../soc/nrf54l15_cpuapp.overlay | 22 +++++++-------- .../nordic-flpr/soc/nrf54l15_cpuapp.overlay | 27 ++++++++++--------- .../nordic-flpr/soc/nrf54lm20a_cpuapp.overlay | 27 ++++++++++--------- soc/nordic/validate_rram_partitions.c | 7 +++-- .../gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay | 1 + 17 files changed, 78 insertions(+), 42 deletions(-) diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts index 0e00b2d1e5e4..c0584b08c98c 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts @@ -34,6 +34,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts index 12e280a9a90e..2211743673c0 100644 --- a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts @@ -34,6 +34,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts index eae0b605eb4b..58bdd2bf59bf 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts @@ -38,6 +38,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts index 3097d3f2775e..11d72c63dfe8 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts @@ -30,6 +30,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuflpr.dts b/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuflpr.dts index bd40a2f837be..3dc55b73513d 100644 --- a/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuflpr.dts +++ b/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuflpr.dts @@ -33,6 +33,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/raytac/an54lq_db_15/raytac_an54lq_db_15_nrf54l15_cpuflpr.dts b/boards/raytac/an54lq_db_15/raytac_an54lq_db_15_nrf54l15_cpuflpr.dts index 582bbf6d7c3a..76a52b128622 100644 --- a/boards/raytac/an54lq_db_15/raytac_an54lq_db_15_nrf54l15_cpuflpr.dts +++ b/boards/raytac/an54lq_db_15/raytac_an54lq_db_15_nrf54l15_cpuflpr.dts @@ -34,6 +34,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/seeed/xiao_nrf54l15/xiao_nrf54l15_nrf54l15_cpuflpr.dts b/boards/seeed/xiao_nrf54l15/xiao_nrf54l15_nrf54l15_cpuflpr.dts index 42d316aaa485..20a7b22e46c0 100644 --- a/boards/seeed/xiao_nrf54l15/xiao_nrf54l15_nrf54l15_cpuflpr.dts +++ b/boards/seeed/xiao_nrf54l15/xiao_nrf54l15_nrf54l15_cpuflpr.dts @@ -31,6 +31,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.dts b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.dts index b47b81affc44..a22b84bc102c 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.dts +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.dts @@ -33,9 +33,9 @@ &cpuflpr_rram { partitions { compatible = "fixed-partitions"; - #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/dts/vendor/nordic/nrf54l05.dtsi b/dts/vendor/nordic/nrf54l05.dtsi index 747fea0c5498..8213db7612db 100644 --- a/dts/vendor/nordic/nrf54l05.dtsi +++ b/dts/vendor/nordic/nrf54l05.dtsi @@ -33,6 +33,9 @@ cpuflpr_rram: rram@75800 { compatible = "soc-nv-flash"; reg = <0x75800 DT_SIZE_K(30)>; + ranges = <0x0 0x75800 DT_SIZE_K(30)>; + #address-cells = <1>; + #size-cells = <1>; erase-block-size = <4096>; write-block-size = <16>; }; diff --git a/dts/vendor/nordic/nrf54l10.dtsi b/dts/vendor/nordic/nrf54l10.dtsi index 800c4081f283..1ef1e5fbba0c 100644 --- a/dts/vendor/nordic/nrf54l10.dtsi +++ b/dts/vendor/nordic/nrf54l10.dtsi @@ -33,6 +33,9 @@ cpuflpr_rram: rram@ed800 { compatible = "soc-nv-flash"; reg = <0xed800 DT_SIZE_K(62)>; + ranges = <0x0 0xed800 DT_SIZE_K(62)>; + #address-cells = <1>; + #size-cells = <1>; erase-block-size = <4096>; write-block-size = <16>; }; diff --git a/dts/vendor/nordic/nrf54l15.dtsi b/dts/vendor/nordic/nrf54l15.dtsi index 56c97ae87acf..d6af3f385f60 100644 --- a/dts/vendor/nordic/nrf54l15.dtsi +++ b/dts/vendor/nordic/nrf54l15.dtsi @@ -33,6 +33,9 @@ cpuflpr_rram: rram@165000 { compatible = "soc-nv-flash"; reg = <0x165000 DT_SIZE_K(96)>; + ranges = <0x0 0x165000 DT_SIZE_K(96)>; + #address-cells = <1>; + #size-cells = <1>; erase-block-size = <4096>; write-block-size = <16>; }; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 5f7c3087a714..af4e69d4648b 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -867,19 +867,35 @@ #address-cells = <1>; #size-cells = <1>; +#ifdef USE_NON_SECURE_ADDRESS_MAP cpuapp_rram: rram@0 { compatible = "soc-nv-flash"; reg = <0x0 DT_SIZE_K(2036)>; + ranges = <0x0 0x0 DT_SIZE_K(2036)>; erase-block-size = <4096>; write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; + }; +#else + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1940)>; + ranges = <0x0 0x0 DT_SIZE_K(1940)>; + erase-block-size = <4096>; + write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; }; -#ifndef USE_NON_SECURE_ADDRESS_MAP cpuflpr_rram: rram@1e5000 { compatible = "soc-nv-flash"; reg = <0x1e5000 DT_SIZE_K(96)>; + ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; erase-block-size = <4096>; write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; }; #endif }; diff --git a/snippets/nordic/nordic-flpr-xip/soc/nrf54l15_cpuapp.overlay b/snippets/nordic/nordic-flpr-xip/soc/nrf54l15_cpuapp.overlay index 031f9ac86cf5..74d9d477b19d 100644 --- a/snippets/nordic/nordic-flpr-xip/soc/nrf54l15_cpuapp.overlay +++ b/snippets/nordic/nordic-flpr-xip/soc/nrf54l15_cpuapp.overlay @@ -3,17 +3,15 @@ * 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)>; - }; - }; +&rram_controller { + cpuflpr_rram: rram@165000 { + compatible = "soc-nv-flash"; + reg = <0x165000 DT_SIZE_K(96)>; + ranges = <0x0 0x165000 DT_SIZE_K(96)>; + erase-block-size = <0x1000>; + write-block-size = <0x10>; + #address-cells = <1>; + #size-cells = <1>; }; }; @@ -22,7 +20,7 @@ }; &cpuflpr_vpr { - execution-memory = <&cpuflpr_code_partition>; + execution-memory = <&cpuflpr_rram>; }; &cpuapp_vevif_tx { diff --git a/snippets/nordic/nordic-flpr/soc/nrf54l15_cpuapp.overlay b/snippets/nordic/nordic-flpr/soc/nrf54l15_cpuapp.overlay index 2d608fc8a6b7..f429def60040 100644 --- a/snippets/nordic/nordic-flpr/soc/nrf54l15_cpuapp.overlay +++ b/snippets/nordic/nordic-flpr/soc/nrf54l15_cpuapp.overlay @@ -5,22 +5,13 @@ / { 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)>; + ranges = <0x0 0x20028000 0x18000>; + status = "reserved"; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20028000 0x18000>; }; }; }; @@ -34,9 +25,21 @@ ranges = <0x0 0x20000000 0x28000>; }; +&rram_controller { + cpuflpr_rram: rram@165000 { + compatible = "soc-nv-flash"; + reg = <0x165000 DT_SIZE_K(96)>; + ranges = <0x0 0x165000 DT_SIZE_K(96)>; + erase-block-size = <0x1000>; + write-block-size = <0x10>; + #address-cells = <1>; + #size-cells = <1>; + }; +}; + &cpuflpr_vpr { execution-memory = <&cpuflpr_sram_code_data>; - source-memory = <&cpuflpr_code_partition>; + source-memory = <&cpuflpr_rram>; }; &cpuapp_vevif_tx { diff --git a/snippets/nordic/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay b/snippets/nordic/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay index 071241cf03d7..4f00889891d1 100644 --- a/snippets/nordic/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay +++ b/snippets/nordic/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay @@ -5,22 +5,13 @@ / { soc { - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - - cpuflpr_code_partition: image@1e5000 { - /* FLPR core code partition */ - reg = <0x1e5000 DT_SIZE_K(96)>; - }; - }; - cpuflpr_sram_code_data: memory@20067c00 { compatible = "mmio-sram"; reg = <0x20067c00 DT_SIZE_K(96)>; + ranges = <0x0 0x20067c00 0x18000>; + status = "reserved"; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; }; }; }; @@ -30,13 +21,25 @@ ranges = <0x0 0x20000000 DT_SIZE_K(415)>; }; +&rram_controller { + cpuflpr_rram: rram@1e5000 { + compatible = "soc-nv-flash"; + reg = <0x1e5000 DT_SIZE_K(96)>; + ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; + erase-block-size = <0x1000>; + write-block-size = <0x10>; + #address-cells = <1>; + #size-cells = <1>; + }; +}; + &uart30 { status = "reserved"; }; &cpuflpr_vpr { execution-memory = <&cpuflpr_sram_code_data>; - source-memory = <&cpuflpr_code_partition>; + source-memory = <&cpuflpr_rram>; }; &cpuapp_vevif_tx { diff --git a/soc/nordic/validate_rram_partitions.c b/soc/nordic/validate_rram_partitions.c index 99f75f291af9..fe555b4249fc 100644 --- a/soc/nordic/validate_rram_partitions.c +++ b/soc/nordic/validate_rram_partitions.c @@ -43,7 +43,6 @@ /* clang-format off */ -#define RRAM_BASE REG_ADDR_NS(DT_CHOSEN(zephyr_flash)) #define RRAM_CONTROLLER DT_NODELABEL(rram_controller) #if !DT_NODE_EXISTS(RRAM_CONTROLLER) @@ -56,9 +55,9 @@ " (required for all children of " DT_NODE_PATH(RRAM_CONTROLLER) ")") #define CHECK_RRAM_PARTITION_WITHIN_PARENT(node_id) \ - BUILD_ASSERT(RRAM_BASE + REG_ADDR_NS(node_id) >= REG_ADDR_NS(DT_GPARENT(node_id)) && \ - RRAM_BASE + REG_END_NS(node_id) <= REG_END_NS(DT_GPARENT(node_id)), \ - DT_NODE_FULL_NAME(node_id) " is not fully contained within its parent " \ + BUILD_ASSERT(REG_ADDR_NS(node_id) >= REG_ADDR_NS(DT_GPARENT(node_id)) && \ + REG_END_NS(node_id) <= REG_END_NS(DT_GPARENT(node_id)), \ + DT_NODE_FULL_NAME(node_id) " is not fully contained within its parent " \ DT_NODE_PATH(DT_GPARENT(node_id))) #define CHECK_NODES_NON_OVERLAPPING(node_id_1, node_id_2) \ diff --git a/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay index 621ec9da86b4..4e1ee5de62cb 100644 --- a/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ b/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -6,6 +6,7 @@ &cpuflpr_rram { reg = <0x15D000 DT_SIZE_K(128)>; + ranges = <0x0 0x15D000 DT_SIZE_K(128)>; }; &cpuflpr_code_partition { From cf62d2ac3ead0d0e16f0ce839c00cb0a8769deb8 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 23 Jan 2026 12:33:33 +0000 Subject: [PATCH 1709/3334] [nrf fromtree] scripts: kconfig: Fix dt_chosen_partition_addr function Fixes this function so that it returns the unit address of the node, without having to rely on odd tricks to locate various parent nodes and check that they have reg addresses and perform additions Signed-off-by: Jamie McCrae (cherry picked from commit 27a91104c65bad1fca8f1416bd48f9b44d0c0ee3) --- scripts/kconfig/kconfigfunctions.py | 33 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index d92017853a67..3c66066b4457 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -192,6 +192,16 @@ def _node_reg_addr(node, index, unit): return node.regs[int(index)].addr >> _dt_units_to_scale(unit) +def _node_unit_addr(node, unit): + if not node: + return 0 + + if not node.unit_addr: + return 0 + + return node.unit_addr >> _dt_units_to_scale(unit) + + def _node_reg_addr_by_name(node, name, unit): if not node: return 0 @@ -374,13 +384,10 @@ def dt_chosen_reg(kconf, name, chosen, index=0, unit=None): return hex(_dt_chosen_reg_addr(kconf, chosen, index, unit)) -def _dt_chosen_partition_addr(kconf, chosen, index=0, unit=None): +def _dt_chosen_partition_addr(kconf, chosen, unit=None): """ - This function takes a 'chosen' property and treats that property as a path - to an EDT node. If it finds an EDT node, it will look to see if that - node has a register, and if that node has a grandparent that has a register - at the given 'index'. The addition of both addresses will be returned, if - not, we return 0. + This function takes a 'chosen' property and treats that property as a path to an EDT node. + If it finds an EDT node, it will return the unit address of that node, and if not, we return 0. The function will divide the value based on 'unit': None No division @@ -395,25 +402,19 @@ def _dt_chosen_partition_addr(kconf, chosen, index=0, unit=None): return 0 node = edt.chosen_node(chosen) - if not node: - return 0 - p_node = node.parent - if not p_node: - return 0 - - return _node_reg_addr(p_node.parent, index, unit) + _node_reg_addr(node, 0, unit) + return _node_unit_addr(node, unit) def dt_chosen_partition_addr(kconf, name, chosen, index=0, unit=None): """ This function just routes to the proper function and converts - the result to either a string int or string hex value. + the result to either a string int or string hex value. The index value is not used. """ if name == "dt_chosen_partition_addr_int": - return str(_dt_chosen_partition_addr(kconf, chosen, index, unit)) + return str(_dt_chosen_partition_addr(kconf, chosen, unit)) if name == "dt_chosen_partition_addr_hex": - return hex(_dt_chosen_partition_addr(kconf, chosen, index, unit)) + return hex(_dt_chosen_partition_addr(kconf, chosen, unit)) def _dt_node_reg_addr(kconf, path, index=0, unit=None): From 582294fee02c5a7ffa72295d914445c28699a9c8 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 2 Feb 2026 09:50:27 +0000 Subject: [PATCH 1710/3334] [nrf fromtree] kconfig: Fix CONFIG_FLASH_LOAD_OFFSET for non-0 starting addresses Fixes an issue introduced recently whereby this would now wrongly become an absolute address when it should be a relative address for devices that have flash that does not start from an offset of 0. A deprecated Kconfig has been added which will be set in devices that are wrong and need their files updating, to allow users to fix these issues. Signed-off-by: Jamie McCrae (cherry picked from commit 2f7d13840f6d47d5704efa1ef91a5abfcd3f4127) --- Kconfig.zephyr | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 8e3934ac7461..2df77507f123 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -98,11 +98,30 @@ config USE_DT_CODE_PARTITION # Workaround for not being able to have commas in macro arguments DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_FLASH := zephyr,flash + +config FLASH_CODE_PARTITION_ADDRESS_INVALID + bool + default y if XIP && $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) < FLASH_BASE_ADDRESS + select DEPRECATED + help + If this item is selected, it is likely selected because your board/SoC/base DTS files + are wrong and have a flash memory that does not start at absolute address 0x0 and: + * Do not have a ``ranges <>;`` property in the flash node passing down the address + and size to child nodes + * Do not have a ``ranges;`` property in the partitions node passing down the previous + ranges to child nodes + + Support for this will be removed and required that your files be updated correctly for + a future release, check the Zephyr 4.4 migration notes. config FLASH_LOAD_OFFSET # Only user-configurable when USE_DT_CODE_PARTITION is disabled hex "Kernel load offset" if !USE_DT_CODE_PARTITION - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION + default $(sub_hex, $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)), \ + $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if USE_DT_CODE_PARTITION && \ + !FLASH_CODE_PARTITION_ADDRESS_INVALID + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) if USE_DT_CODE_PARTITION default 0 help This option specifies the byte offset from the beginning of flash that From 779ca3ab1785a632bd4c76c86220b98600f0fcbf Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 2 Feb 2026 11:42:02 +0000 Subject: [PATCH 1711/3334] [nrf fromtree] storage: flash_map: Fix macros for offset/address Fixes macros that broke after changes were merged which started using the unit address of partition nodes. This also fixes the test to ensure devices not starting at 0x0 are properly checked which previously would silently be unknown Signed-off-by: Jamie McCrae (cherry picked from commit 861079f1febbd830085ed265d77ec0230eb690fc) --- include/zephyr/storage/flash_map.h | 31 +++++++++++++------ subsys/dfu/img_util/flash_img.c | 7 +++-- .../mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 7 +++-- subsys/storage/flash_map/flash_map_default.c | 8 ++--- tests/subsys/storage/flash_map/app.overlay | 8 +++-- 5 files changed, 39 insertions(+), 22 deletions(-) diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 558a0a0b7e72..bfd86e7771f2 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -377,11 +377,20 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); /** * Get fixed-partition or fixed-subpartition offset from DTS node label * + * Note: This only works from a top level ``fixed-partitions`` node, top level + * ``fixed-subpartitions`` node or ``fixed-partitions`` node inside of 1 layer of a + * ``fixed-subpartitions`` node, it will not work for multiple layers of ``fixed-subpartitions`` + * nodes. + * * @param label DTS node label of a partition * * @return fixed-partition offset, as defined for the partition in DTS. */ -#define FIXED_PARTITION_OFFSET(label) DT_REG_ADDR(DT_NODELABEL(label)) +#define FIXED_PARTITION_OFFSET(label) \ + COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ + (DT_PROP_BY_IDX(DT_PARENT(DT_NODELABEL(label)), reg, 0) + \ + DT_PROP_BY_IDX(DT_NODELABEL(label), reg, 0)), \ + (DT_PROP_BY_IDX(DT_NODELABEL(label), reg, 0))) /** * Get fixed-partition or fixed-subpartition address from DTS node label @@ -390,10 +399,7 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); * * @return fixed-partition address, as defined for the partition in DTS. */ -#define FIXED_PARTITION_ADDRESS(label) \ - (COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ - (DT_FIXED_SUBPARTITION_ADDR(DT_NODELABEL(label))), \ - (DT_FIXED_PARTITION_ADDR(DT_NODELABEL(label))))) +#define FIXED_PARTITION_ADDRESS(label) DT_REG_ADDR(DT_NODELABEL(label)) /** * Get fixed-partition or fixed-subpartition address from DTS node @@ -402,19 +408,24 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); * * @return fixed-partition address, as defined for the partition in DTS. */ -#define FIXED_PARTITION_NODE_ADDRESS(node) \ - (COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(node), \ - (DT_FIXED_SUBPARTITION_ADDR(node)), \ - (DT_FIXED_PARTITION_ADDR(node)))) +#define FIXED_PARTITION_NODE_ADDRESS(node) DT_REG_ADDR(node) /** * Get fixed-partition offset from DTS node * + * Note: This only works from a top level ``fixed-partitions`` node, top level + * ``fixed-subpartitions`` node or ``fixed-partitions`` node inside of 1 layer of a + * ``fixed-subpartitions`` node, it will not work for multiple layers of ``fixed-subpartitions`` + * nodes. + * * @param node DTS node of a partition * * @return fixed-partition offset, as defined for the partition in DTS. */ -#define FIXED_PARTITION_NODE_OFFSET(node) DT_REG_ADDR(node) +#define FIXED_PARTITION_NODE_OFFSET(node) \ + COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(node), \ + (DT_PROP_BY_IDX(DT_PARENT(node), reg, 0) + DT_PROP_BY_IDX(node, reg, 0)), \ + (DT_PROP_BY_IDX(node, reg, 0))) /** * Get fixed-partition size for DTS node label diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index 8c597b77129a..2e6a5e7485fb 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -25,9 +25,10 @@ LOG_MODULE_REGISTER(flash_img, CONFIG_IMG_MANAGER_LOG_LEVEL); #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && \ - (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ - FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) + FIXED_PARTITION_MTD(label)) && (FIXED_PARTITION_ADDRESS(label) <= \ + (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET) && \ + FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ + (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET)) #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && (CONFIG_TFM_MCUBOOT_IMAGE_NUMBER == 2) #define UPLOAD_FLASH_AREA_LABEL slot1_ns_partition 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 7947b89bcdaf..edcacd4cfd8c 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -50,9 +50,10 @@ #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && \ - (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ - FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) + FIXED_PARTITION_MTD(label)) && (FIXED_PARTITION_ADDRESS(label) <= \ + (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET) && \ + FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ + (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET)) BUILD_ASSERT(sizeof(struct image_header) == IMAGE_HEADER_SIZE, "struct image_header not required size"); diff --git a/subsys/storage/flash_map/flash_map_default.c b/subsys/storage/flash_map/flash_map_default.c index 6b1edfbbaef5..c5ba79af2340 100644 --- a/subsys/storage/flash_map/flash_map_default.c +++ b/subsys/storage/flash_map/flash_map_default.c @@ -13,14 +13,14 @@ #if CONFIG_FLASH_MAP_LABELS #define FLASH_AREA_FOO(part, mtd_from_partition) \ {.fa_id = DT_FIXED_PARTITION_ID(part), \ - .fa_off = DT_REG_ADDR(part), \ + .fa_off = FIXED_PARTITION_NODE_OFFSET(part), \ .fa_dev = DEVICE_DT_GET(mtd_from_partition(part)), \ .fa_size = DT_REG_SIZE(part), \ .fa_label = DT_PROP_OR(part, label, NULL), }, #else #define FLASH_AREA_FOO(part, mtd_from_partition) \ {.fa_id = DT_FIXED_PARTITION_ID(part), \ - .fa_off = DT_REG_ADDR(part), \ + .fa_off = FIXED_PARTITION_NODE_OFFSET(part), \ .fa_dev = DEVICE_DT_GET(mtd_from_partition(part)), \ .fa_size = DT_REG_SIZE(part), }, #endif @@ -56,7 +56,7 @@ const struct flash_area *flash_map = default_flash_map; #define DEFINE_PARTITION_0(part, ord) \ const struct flash_area DT_CAT(global_fixed_partition_ORD_, ord) = { \ .fa_id = DT_FIXED_PARTITION_ID(part), \ - .fa_off = DT_REG_ADDR(part), \ + .fa_off = FIXED_PARTITION_NODE_OFFSET(part), \ .fa_dev = DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(part)), \ .fa_size = DT_REG_SIZE(part), \ }; @@ -71,7 +71,7 @@ DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) #define DEFINE_SUBPARTITION_0(part, ord) \ const struct flash_area DT_CAT(global_fixed_subpartition_ORD_, ord) = { \ .fa_id = DT_FIXED_PARTITION_ID(part), \ - .fa_off = DT_REG_ADDR(part), \ + .fa_off = FIXED_PARTITION_NODE_OFFSET(part), \ .fa_dev = DEVICE_DT_GET(DT_MTD_FROM_FIXED_SUBPARTITION(part)), \ .fa_size = DT_REG_SIZE(part), \ }; diff --git a/tests/subsys/storage/flash_map/app.overlay b/tests/subsys/storage/flash_map/app.overlay index c03a9c54ff0c..72875fff32b8 100644 --- a/tests/subsys/storage/flash_map/app.overlay +++ b/tests/subsys/storage/flash_map/app.overlay @@ -8,13 +8,17 @@ */ / { - disabled_flash@0 { + disabled_flash@4000 { compatible = "vnd,flash"; - reg = <0x00 0x1000>; + reg = <0x4000 0x1000>; + ranges = <0x0 0x4000 0x1000>; status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; partitions { compatible = "fixed-partitions"; + ranges; #address-cells = <1>; #size-cells = <1>; From 2238c33132cb0f0fb20858bec438a2b93228b3ba Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 30 Jan 2026 12:12:52 +0000 Subject: [PATCH 1712/3334] [nrf fromtree] dts: arm: nordic: nrf91: Fix missing reg property Fixes a missing reg property Signed-off-by: Jamie McCrae (cherry picked from commit caadc748fe37d786643aa773d83061887c1e5747) --- dts/arm/nordic/nrf91.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 6baf06e3d4e4..74afa25f76a7 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -42,6 +42,7 @@ peripheral@50000000 { #address-cells = <1>; #size-cells = <1>; + reg = <0x50000000 0x10000000>; ranges = <0x0 0x50000000 0x10000000>; /* Common nRF91 peripherals description. */ From f85c79a52e8ac1b97259fd08e6ab4f7423b348dd Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 30 Jan 2026 12:15:17 +0000 Subject: [PATCH 1713/3334] [nrf fromtree] dts: nordic: Fix missing ranges properties and relative addresses Adds these properties which are missing, and fixes instances of wrongly using relative addresses when they are already absolute Signed-off-by: Jamie McCrae (cherry picked from commit ff212ba22e134b3b0cc952675ab48c48cb8b0904) --- .../bl5340_dvk_nrf5340_cpunet_common.dtsi | 1 + .../nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts | 2 ++ .../nrf5340_audio_dk_nrf5340_cpunet.dts | 1 + .../nrf5340dk/nrf5340dk_nrf5340_cpunet.dts | 1 + boards/nordic/nrf54h20dk/Kconfig.defconfig | 5 +++- .../nrf54h20dk_nrf54h20-memory_map.dtsi | 1 + .../nrf7002dk/nrf7002dk_nrf5340_cpunet.dts | 1 + .../nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts | 1 + .../nrf9280pdk_nrf9280-memory_map.dtsi | 1 + .../thingy53/thingy53_nrf5340_cpunet.dts | 1 + .../pan1783_nrf5340_cpunet_common.dtsi | 1 + .../raytac_an7002q_db_nrf5340_cpunet.dts | 1 + ...tac_mdbt53_db_40_nrf5340_cpunet_common.dts | 1 + ...ac_mdbt53v_db_40_nrf5340_cpunet_common.dts | 1 + .../nordic_vpr_launcher/nordic_vpr_launcher.c | 9 ++---- dts/arm/nordic/nrf5340_cpunet.dtsi | 2 ++ dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi | 1 + dts/vendor/nordic/nrf54h20.dtsi | 3 ++ .../nordic/nrf7120_cpuapp_ns_partition.dtsi | 1 + .../nordic/nrf7120_cpuapp_partition.dtsi | 1 + dts/vendor/nordic/nrf7120_enga.dtsi | 3 ++ dts/vendor/nordic/nrf9280.dtsi | 3 ++ .../common/uicr/gen_uicr/CMakeLists.txt | 5 +--- soc/nordic/nrf54h/soc.c | 29 ++++++------------- 24 files changed, 44 insertions(+), 32 deletions(-) diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi index 8f6785d97733..f20e1909f792 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi @@ -39,6 +39,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; /* 48K */ boot_partition: partition@0 { diff --git a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts index 567e87869d39..94f1ee0ccbbd 100644 --- a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts +++ b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts @@ -55,11 +55,13 @@ &flash1 { reg = <0x01000000 DT_SIZE_K(256)>; + ranges = <0x0 0x01000000 DT_SIZE_K(256)>; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; storage_partition: partition@0 { label = "storage"; diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts index 71c19f48e09a..8d578efde1b2 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts @@ -61,6 +61,7 @@ arduino_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts index e3899d435d7f..980348a849a3 100644 --- a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts @@ -80,6 +80,7 @@ arduino_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index c11d3ef63e1f..8c532b093c97 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -18,10 +18,13 @@ config ROM_START_OFFSET if !USE_DT_CODE_PARTITION +DT_CHOSEN_Z_FLASH := zephyr,flash + # Application core firmware must start at this offset when not using MCUboot. # However, the default 'zephyr,code-partition' in DT is set for MCUboot. config FLASH_LOAD_OFFSET - default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) + default $(sub_hex, $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition), \ + $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) # This is meant to span 'cpuapp_boot_partition' and 'cpuapp_slot0_partition' # in the default memory map. diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index fa1b601974b0..675e4555ac26 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -130,6 +130,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuapp_boot_partition: partition@30000 { reg = <0x30000 DT_SIZE_K(64)>; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts index 5e4fd288089b..d15594a7d374 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts @@ -154,6 +154,7 @@ arduino_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts index 87e7f03dc79e..0497918a3195 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts @@ -34,6 +34,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi index 75ef062c1024..4c082ecb7be3 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi @@ -189,6 +189,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; cpuapp_boot_partition: partition@312000 { reg = <0x312000 DT_SIZE_K(64)>; diff --git a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts index 6da36791d5ec..e3b4465b0751 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts +++ b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts @@ -145,6 +145,7 @@ fem_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi b/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi index f75e5aa0ea7c..4fc10e6f8147 100644 --- a/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi +++ b/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi @@ -185,6 +185,7 @@ arduino_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts b/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts index 8a4a4f65ab62..b6893a916f70 100644 --- a/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts +++ b/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts @@ -125,6 +125,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts index 6e8e5183d8aa..6b4aa354bb91 100644 --- a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts +++ b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts @@ -35,6 +35,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts index 6e8e5183d8aa..6b4aa354bb91 100644 --- a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts +++ b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts @@ -35,6 +35,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c index bf7462c5e05c..4e2abc52427a 100644 --- a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c +++ b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c @@ -79,11 +79,6 @@ static int nordic_vpr_launcher_init(const struct device *dev) return 0; } -/* obtain VPR address either from memory or partition */ -#define VPR_ADDR(node_id) \ - (DT_REG_ADDR(node_id) + \ - COND_CODE_0(DT_FIXED_PARTITION_EXISTS(node_id), (0), (DT_REG_ADDR(DT_GPARENT(node_id))))) - #define NEEDS_COPYING(inst) UTIL_AND(DT_INST_NODE_HAS_PROP(inst, execution_memory), \ DT_INST_NODE_HAS_PROP(inst, source_memory)) @@ -96,11 +91,11 @@ static int nordic_vpr_launcher_init(const struct device *dev) static const struct nordic_vpr_launcher_config config##inst = { \ .vpr = (NRF_VPR_Type *)DT_INST_REG_ADDR(inst), \ IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, execution_memory), \ - (.exec_addr = VPR_ADDR(DT_INST_PHANDLE(inst, execution_memory)),)) \ + (.exec_addr = DT_REG_ADDR(DT_INST_PHANDLE(inst, execution_memory)),)) \ .enable_secure = DT_INST_PROP(inst, enable_secure), \ .enable_dma_secure = DT_INST_PROP(inst, enable_dma_secure), \ IF_ENABLED(NEEDS_COPYING(inst), \ - (.src_addr = VPR_ADDR(DT_INST_PHANDLE(inst, source_memory)), \ + (.src_addr = DT_REG_ADDR(DT_INST_PHANDLE(inst, source_memory)), \ .size = DT_REG_SIZE(DT_INST_PHANDLE(inst, execution_memory)),))}; \ \ DEVICE_DT_INST_DEFINE(inst, nordic_vpr_launcher_init, NULL, NULL, &config##inst, \ diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index b7b00c4feeda..7ad64233bc77 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -318,6 +318,8 @@ compatible = "soc-nv-flash"; erase-block-size = <2048>; write-block-size = <4>; + #address-cells = <1>; + #size-cells = <1>; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi index be16eedfc529..6c06e3479927 100644 --- a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi @@ -9,6 +9,7 @@ &flash1 { reg = <0x01000000 DT_SIZE_K(256)>; + ranges = <0x0 0x01000000 DT_SIZE_K(256)>; }; &sram0 { diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 7c569e2bf104..84fced0f1bcf 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -269,8 +269,11 @@ mram1x: mram@e000000 { compatible = "nordic,mram"; reg = <0xe000000 DT_SIZE_K(2048)>; + ranges = <0x0 0xe000000 DT_SIZE_K(2048)>; erase-block-size = <4096>; write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; }; uicr: uicr@fff8000 { diff --git a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi index dcb5f7563140..5e93a13c0c5e 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi @@ -51,6 +51,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; /* This static layout needs to be the same with the upstream TF-M layout in the * header flash_layout.h of the relevant platform. Any updates in the layout diff --git a/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi index a508d3760381..4783e495b3ea 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi @@ -16,6 +16,7 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index 9f310aa00619..d2e4b273a2a4 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -933,8 +933,11 @@ cpuapp_mram: mram@0 { compatible = "soc-nv-flash"; reg = <0 DT_SIZE_K(4084)>; + ranges = <0x0 0 DT_SIZE_K(4084)>; erase-block-size = <4096>; write-block-size = <4>; + #address-cells = <1>; + #size-cells = <1>; }; }; }; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index df0a57d99a9b..a4dd3e2ea2b9 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -113,8 +113,11 @@ mram1x: mram@e000000 { compatible = "nordic,mram"; reg = <0xe000000 DT_SIZE_K(8192)>; + ranges = <0x0 0xe000000 DT_SIZE_K(8192)>; erase-block-size = <4096>; write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; }; uicr: uicr@fff8000 { diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 9c5111717c6c..d6af0c6cbb33 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -41,12 +41,9 @@ endfunction() # Function to compute partition absolute address and size from devicetree function(compute_partition_address_and_size partition_nodelabel output_address_var output_size_var) dt_nodelabel(partition_path NODELABEL ${partition_nodelabel} REQUIRED) - dt_reg_addr(partition_offset PATH ${partition_path} REQUIRED) + dt_reg_addr(partition_address PATH ${partition_path} REQUIRED) dt_reg_size(partition_size PATH ${partition_path} REQUIRED) - # Calculate absolute partition address - math(EXPR partition_address "${CONFIG_FLASH_BASE_ADDRESS} + ${partition_offset}" OUTPUT_FORMAT HEXADECIMAL) - # Set output variables in parent scope set(${output_address_var} ${partition_address} PARENT_SCOPE) set(${output_size_var} ${partition_size} PARENT_SCOPE) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index fe664dce6c0d..8262877b537e 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -36,27 +37,18 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #define HSFLL_NODE DT_NODELABEL(cpurad_hsfll) #endif -#define FIXED_PARTITION_ADDRESS(label) \ - (DT_REG_ADDR(DT_NODELABEL(label)) + \ - DT_REG_ADDR(COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ - (DT_GPARENT(DT_PARENT(DT_NODELABEL(label)))), \ - (DT_GPARENT(DT_NODELABEL(label)))))) -#define FIXED_PARTITION_NODE_MTD(node) \ - COND_CODE_1( \ - DT_FIXED_SUBPARTITION_EXISTS(node), \ - (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ - (DT_MTD_FROM_FIXED_PARTITION(node))) - #ifdef CONFIG_USE_DT_CODE_PARTITION #define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) #elif defined(CONFIG_FLASH_LOAD_OFFSET) #define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET #endif + #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_NODE_MTD(DT_NODELABEL(label))) && \ - (DT_REG_ADDR(DT_NODELABEL(label)) <= FLASH_LOAD_OFFSET && \ - DT_REG_ADDR(DT_NODELABEL(label)) + DT_REG_SIZE(DT_NODELABEL(label)) > FLASH_LOAD_OFFSET) + FIXED_PARTITION_MTD(label)) && (FIXED_PARTITION_ADDRESS(label) <= \ + (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET) && \ + FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ + (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET)) sys_snode_t soc_node; @@ -217,15 +209,12 @@ void soc_late_init_hook(void) #if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition) + - CONFIG_ROM_START_OFFSET); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition)); } else { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + - CONFIG_ROM_START_OFFSET); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition)); } #else - radiocore_address = - (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + CONFIG_ROM_START_OFFSET); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition)); #endif if (IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR) && From 5ec3d56c866555e8842ecb29b784fbc4c3101102 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 3 Feb 2026 08:11:44 +0000 Subject: [PATCH 1714/3334] [nrf fromtree] doc: release: migration_guide: 4.4: Add note on NVM change Adds a note about required changes to NVM partitions Signed-off-by: Jamie McCrae (cherry picked from commit e2773bc78af393266ea04b914fbd1c2c0f0ae15d) --- doc/releases/migration-guide-4.4.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 11498e15a83c..21d580984f10 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -96,6 +96,17 @@ Boards * ITE ``it515xx_evb`` is renamed to ``it51xxx_evb``. +* Boards that have NVM devices must now correctly have their addresses set or inheritied when they + do not start at address 0x0. In previous zephyr releases, a ``partitions`` entry in DTS was + wrongly interpreted as starting in the flash device's address range even though the DTS file + does not describe this and instead describes flash partitions starting at absolute addresses + e.g. 0x0. If you build and get the deprecated Kconfig + :kconfig:option:`CONFIG_FLASH_CODE_PARTITION_ADDRESS_INVALID` being set then this means your + board, SoC or DTS files are wrong and need updating, a ``ranges <>;`` property should be used + by the flash nodes to specify the base address and size for child nodes, and + ``fixed-partitions``/``fixed-subpartitions`` nodes must have a ``ranges;`` property to pass the + parent's ranges on to child nodes. + Device Drivers and Devicetree ***************************** From df173561e15bd20b2ee6c39c36d0d38a6ef9bdee Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 5 Feb 2026 12:24:45 +0100 Subject: [PATCH 1715/3334] [nrf fromlist] soc: nrf54h: Fix mcuboot-enabled booting If MCUboot is enabled, the start address of the radio core firmware is offset by MCUboot header. Normally, the header is accounted for by setting the CONFIG_ROM_START_OFFSET value to match the header size. Upstream PR #: 103569 Signed-off-by: Tomasz Chyrowicz --- soc/nordic/nrf54h/soc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 8262877b537e..5e35cbcdbae0 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -209,12 +209,15 @@ void soc_late_init_hook(void) #if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition)); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition) + + CONFIG_ROM_START_OFFSET); } else { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition)); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + + CONFIG_ROM_START_OFFSET); } #else - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition)); + radiocore_address = + (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + CONFIG_ROM_START_OFFSET); #endif if (IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR) && From 24347c1e9b3a1c2fbffb49709301ed6b7b50bc28 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 5 Feb 2026 18:42:25 +0100 Subject: [PATCH 1716/3334] [nrf fromlist] soc: nrf54h: Fix active partition detection Change logic from the offset to the absolute address as the DT_REG_ADDR(..) macro now returns the absolute address and cannot be compared with the value of the CONFIG_FLASH_LOAD_ADDRESS. Upstream PR #: 103569 Signed-off-by: Tomasz Chyrowicz --- soc/nordic/nrf54h/soc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 5e35cbcdbae0..0d3c7c4a959e 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -38,17 +38,17 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #endif #ifdef CONFIG_USE_DT_CODE_PARTITION -#define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) +#define FLASH_LOAD_ADDRESS DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) #elif defined(CONFIG_FLASH_LOAD_OFFSET) -#define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET +#define FLASH_LOAD_ADDRESS (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET) #endif #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && (FIXED_PARTITION_ADDRESS(label) <= \ - (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET) && \ - FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ - (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET)) + FIXED_PARTITION_MTD(label)) && \ + (FIXED_PARTITION_ADDRESS(label) <= FLASH_LOAD_ADDRESS && \ + FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ + FLASH_LOAD_ADDRESS) sys_snode_t soc_node; From eccca0302aa2990529b65f2cf6b2138dc5f6c072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 29 Jan 2026 15:11:05 +0100 Subject: [PATCH 1717/3334] Revert "[nrf fromlist] soc: nordic: common: nrf_sys_event: Fix missing return" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 75fd7d271bc35e901e9041f60b1798386288cf8f. Signed-off-by: Krzysztof Chruściński --- soc/nordic/common/nrf_sys_event.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 99c486f55410..809ad2e71005 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -112,12 +112,6 @@ BUILD_ASSERT(IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY_MANUAL) || static uint32_t event_ref_cnt; static uint32_t chan_mask; -/* Handle returned by the registering function can be a GRTC channel that was used which indicates - * that PPI RRAMC wake up is used. If manual mode is used (changing RRAMC power mode) than that - * handle value is used which exceeds any potential GRTC channel number. - */ -#define NRF_SYS_EVENT_MANUAL_HANDLE 32 - #define NVM_HW_WAKEUP_US 16 #define NVM_MANUAL_SUPPORT IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY_MANUAL) /* Due to software performance and risk of waking up too early (then RRAMC may go @@ -187,7 +181,7 @@ int event_register(union nrf_sys_evt_us us, bool force, bool abs) irq_low_latency_on(true); } event_ref_cnt++; - rv = NRF_SYS_EVENT_MANUAL_HANDLE; + rv = 32; } } @@ -209,12 +203,11 @@ int nrf_sys_event_unregister(int handle, bool cancel) __ASSERT_NO_MSG(handle >= 0); int rv = 0; - if (handle != NRF_SYS_EVENT_MANUAL_HANDLE) { + if (handle < 32) { if (cancel) { nrf_grtc_sys_counter_compare_event_disable(NRF_GRTC, handle); } atomic_or((atomic_t *)&chan_mask, BIT(handle)); - return rv; } LOCKED() { From 9c76806de718b3bc3d1e84eec59f20371876d66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 20 Jan 2026 08:33:43 +0100 Subject: [PATCH 1718/3334] [nrf fromtree] soc: nordic: common: nrf_sys_event: Fix missing return MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrf_sys_event_unregister was missing an immediate return when PPI was used by the handle. It was stepping into non-PPI case where an assert might have been triggered. Signed-off-by: Krzysztof Chruściński (cherry picked from commit b0ab79429a233f1def3012c8271d6b2b3d065afe) --- soc/nordic/common/nrf_sys_event.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 809ad2e71005..0eff17f3d69a 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -112,6 +112,12 @@ BUILD_ASSERT(IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY_MANUAL) || static uint32_t event_ref_cnt; static uint32_t chan_mask; +/* Handle returned by the registering function can be a GRTC channel that was used which indicates + * that PPI RRAMC wake up is used. If manual mode is used (changing RRAMC power mode) than that + * handle value is used which exceeds any potential GRTC channel number. + */ +#define NRF_SYS_EVENT_MANUAL_HANDLE 32 + #define NVM_HW_WAKEUP_US 16 #define NVM_MANUAL_SUPPORT IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY_MANUAL) /* Due to software performance and risk of waking up too early (then RRAMC may go @@ -154,7 +160,7 @@ union nrf_sys_evt_us { uint64_t abs; }; -int event_register(union nrf_sys_evt_us us, bool force, bool abs) +static int event_register(union nrf_sys_evt_us us, bool force, bool abs) { int rv; @@ -181,7 +187,7 @@ int event_register(union nrf_sys_evt_us us, bool force, bool abs) irq_low_latency_on(true); } event_ref_cnt++; - rv = 32; + rv = NRF_SYS_EVENT_MANUAL_HANDLE; } } @@ -203,11 +209,12 @@ int nrf_sys_event_unregister(int handle, bool cancel) __ASSERT_NO_MSG(handle >= 0); int rv = 0; - if (handle < 32) { + if (handle != NRF_SYS_EVENT_MANUAL_HANDLE) { if (cancel) { nrf_grtc_sys_counter_compare_event_disable(NRF_GRTC, handle); } atomic_or((atomic_t *)&chan_mask, BIT(handle)); + return rv; } LOCKED() { From f645af0f8e84ec5d5821b722a9739f550e769856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 29 Jan 2026 13:51:16 +0100 Subject: [PATCH 1719/3334] [nrf fromtree] samples: boards: nordic: nrf_sys_event: Rework RRAMC latency part MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rework RRAMC latency part to use only a single configuration. In that configuration there are 3 runs of the same code using 3 different RRAMC modes. This approach does not require to recompile the sample to see the results for different RRAMC configuration. Signed-off-by: Krzysztof Chruściński (cherry picked from commit bdc5d8c77b6c740b44c1f1b71b72b30406dd354e) --- .../boards/nordic/nrf_sys_event/sample.yaml | 9 --- .../boards/nordic/nrf_sys_event/src/main.c | 62 ++++++++++++------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index 4651f21542aa..1e34b4233fc2 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -56,16 +56,7 @@ tests: sample.boards.nordic.nrf_sys_event.rramc_wakeup: extra_configs: - CONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y - - CONFIG_NRF_SYS_EVENT_GRTC_CHAN_CNT=0 platform_allow: - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - sample.boards.nordic.nrf_sys_event.rramc_wakeup.ppi: - extra_configs: - - CONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuflpr/xip - integration_platforms: - - nrf54l15dk/nrf54l15/cpuapp diff --git a/samples/boards/nordic/nrf_sys_event/src/main.c b/samples/boards/nordic/nrf_sys_event/src/main.c index 74d78bd2f2fd..b69dd0b7db23 100644 --- a/samples/boards/nordic/nrf_sys_event/src/main.c +++ b/samples/boards/nordic/nrf_sys_event/src/main.c @@ -10,6 +10,18 @@ #include #ifdef CONFIG_NRF_SYS_EVENT_IRQ_LATENCY +#define ALARM_CH 0 +#define TIMEOUT_US 100 + +enum rramc_mode { + /* Default mode where RRAMC goes to low power state and had approx.15 us wake up time. */ + RRAMC_DEFAULT, + /* Using nrf_sys_event API to schedule a PPI wake up before expected interrupt. */ + RRAMC_PPI_WAKEUP, + /* Using nrf_sys_event API to change the power mode of RRAMC to 0 us wake up time. */ + RRAMC_POWER_MODE, +}; + static void counter_handler(const struct device *counter_dev, uint8_t ch_id, uint32_t ticks, void *user_data) { @@ -27,7 +39,7 @@ static uint32_t counter_alarm_execute(const struct device *counter_dev, alarm_cfg->user_data = &sem; now = k_cycle_get_32(); - err = counter_set_channel_alarm(counter_dev, 0, alarm_cfg); + err = counter_set_channel_alarm(counter_dev, ALARM_CH, alarm_cfg); if (err < 0) { printf("Failed to set the counter alarm.\n"); return 0; @@ -41,15 +53,17 @@ static uint32_t counter_alarm_execute(const struct device *counter_dev, return k_cycle_get_32() - now; } -static void sys_event_irq_latency(void) +static void sys_event_irq_latency_run(enum rramc_mode mode) { const struct device *counter = DEVICE_DT_GET(DT_NODELABEL(sample_counter)); struct counter_alarm_cfg alarm_cfg; - uint32_t delay = 1000; - uint32_t delay_adj = 8; - uint32_t rpt = 100; + uint32_t delay = TIMEOUT_US; + uint32_t delay_adj = 4; + uint32_t rpt = 10; uint32_t cyc; int event_handle; + const char *mode_str = (mode == RRAMC_DEFAULT) ? "default RRAMC mode" : + (mode == RRAMC_PPI_WAKEUP) ? "RRAMC waken by PPI" : "RRAMC Standby mode"; counter_start(counter); alarm_cfg.flags = 0; @@ -59,30 +73,32 @@ static void sys_event_irq_latency(void) cyc = 0; for (int i = 0; i < rpt; i++) { sys_cache_instr_invd_all(); - cyc += counter_alarm_execute(counter, &alarm_cfg, K_USEC(delay + 100)); - } + if (mode != RRAMC_DEFAULT) { + uint32_t t = (mode == RRAMC_PPI_WAKEUP) ? (delay + delay_adj) : 0; - cyc /= rpt; - printf("Alarm set for %d us, execution took:%d (no event registered)\n", delay, cyc); - - cyc = 0; - for (int i = 0; i < rpt; i++) { - sys_cache_instr_invd_all(); - /* Event is delayed because it is registered early and not as it should just - * before starting. Triggering event too early may result in RRAMC going back - * to sleep before actual event wakes up the CPU. - */ - event_handle = nrf_sys_event_register(delay + delay_adj, true); - if (event_handle < 0) { - printf("Failed to register an event:%d\n", event_handle); - return; + event_handle = nrf_sys_event_register(t, true); + if (mode == RRAMC_PPI_WAKEUP && event_handle == 32) { + printk("err\n"); + } } + cyc += counter_alarm_execute(counter, &alarm_cfg, K_USEC(delay + 100)); - (void)nrf_sys_event_unregister(event_handle, false); + if (mode != RRAMC_DEFAULT) { + (void)nrf_sys_event_unregister(event_handle, false); + } } cyc /= rpt; - printf("Alarm set for %d us, execution took:%d\n", delay, cyc); + printf("Alarm set for %d us, execution took:%d (%s)\n", delay, cyc, mode_str); + + counter_stop(counter); +} + +static void sys_event_irq_latency(void) +{ + sys_event_irq_latency_run(RRAMC_DEFAULT); + sys_event_irq_latency_run(RRAMC_POWER_MODE); + sys_event_irq_latency_run(RRAMC_PPI_WAKEUP); } #endif /* CONFIG_NRF_SYS_EVENT_IRQ_LATENCY */ From ef14bbf6705ebe25f21204e7af1877de402b614b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 29 Jan 2026 14:09:53 +0100 Subject: [PATCH 1720/3334] [nrf fromtree] samples: boards: nordic: nrf_sys_event: Add nrf54lm20dk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay for nrf54lm20dk. Manual configuration for RRAMC is currently disabled for that target. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 1ff5d9048e9a80976f0a02f3007d38e3a0d03908) --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 8 ++++++++ samples/boards/nordic/nrf_sys_event/src/main.c | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..246efa029ede --- /dev/null +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +sample_counter: &timer20 { + status = "okay"; +}; diff --git a/samples/boards/nordic/nrf_sys_event/src/main.c b/samples/boards/nordic/nrf_sys_event/src/main.c index b69dd0b7db23..57be33a9ad2c 100644 --- a/samples/boards/nordic/nrf_sys_event/src/main.c +++ b/samples/boards/nordic/nrf_sys_event/src/main.c @@ -97,7 +97,9 @@ static void sys_event_irq_latency_run(enum rramc_mode mode) static void sys_event_irq_latency(void) { sys_event_irq_latency_run(RRAMC_DEFAULT); +#if !defined(CONFIG_SOC_NRF54LM20A) sys_event_irq_latency_run(RRAMC_POWER_MODE); +#endif sys_event_irq_latency_run(RRAMC_PPI_WAKEUP); } #endif /* CONFIG_NRF_SYS_EVENT_IRQ_LATENCY */ From bcf21d48850c2632dd09e6e799580d12378ef4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 29 Jan 2026 14:19:59 +0100 Subject: [PATCH 1721/3334] [nrf fromtree] soc: nordic: common: nrf_sys_event: Fix absolute event register MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix case where absolute event was registered. In that case PPI wake up was never used. Signed-off-by: Krzysztof Chruściński (cherry picked from commit fe31b2a7e6109928b6fff9f4f3bff512c32f87bc) --- soc/nordic/common/nrf_sys_event.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 0eff17f3d69a..d455e99da6e0 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -166,13 +166,12 @@ static int event_register(union nrf_sys_evt_us us, bool force, bool abs) LOCKED() { if ((CONFIG_NRF_SYS_EVENT_GRTC_CHAN_CNT > 0) && - ((abs == false) && ((us.rel >= NVM_WAKEUP_US) || !NVM_MANUAL_SUPPORT)) && + ((abs == true) || ((us.rel >= NVM_WAKEUP_US) || !NVM_MANUAL_SUPPORT)) && (chan_mask != 0)) { rv = __builtin_ctz(chan_mask); chan_mask &= ~BIT(rv); if (abs) { - nrfy_grtc_sys_counter_cc_set(NRF_GRTC, rv, - us.abs - NVM_WAKEUP_US); + nrfy_grtc_sys_counter_cc_set(NRF_GRTC, rv, us.abs - NVM_WAKEUP_US); } else { uint32_t val = (NVM_MANUAL_SUPPORT || (us.rel >= NVM_WAKEUP_US)) ? (us.rel - NVM_WAKEUP_US) : 1; From 304c7db23b2baee83d626f49fdf068af5621a3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 28 Jan 2026 12:23:07 +0100 Subject: [PATCH 1722/3334] [nrf fromtree] samples: boards: nordic: Check if register event sample works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend sample configuration with check that confirms correct use of register event API. Use PyTes to validate that code executes faster when event is registered. Signed-off-by: Sebastian Głąb Signed-off-by: Krzysztof Chruściński (cherry picked from commit 1132ffc739f7bab8669714957907ea5365e494a1) --- .../nrf_sys_event/pytest/test_reg_event.py | 59 +++++++++++++++++++ .../boards/nordic/nrf_sys_event/sample.yaml | 4 ++ .../boards/nordic/nrf_sys_event/src/main.c | 2 + 3 files changed, 65 insertions(+) create mode 100644 samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py diff --git a/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py b/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py new file mode 100644 index 000000000000..01377f916f24 --- /dev/null +++ b/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py @@ -0,0 +1,59 @@ +# +# Copyright (c) 2026 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +import re + +from twister_harness import DeviceAdapter + + +def test_rramc_wakeup(dut: DeviceAdapter): + """ + PyTest code for samples/boards/nordic/nrf_sys_event, sample configurations: + - sample.boards.nordic.nrf_sys_event.rramc_wakeup, + - sample.boards.nordic.nrf_sys_event.rramc_wakeup.ppi. + Parse logs from serial port. If the Register Event API was used correctly, + code execution shall be faster by ~14 us when event was registered. + If the API works correctly, RRAMC is woken up just before event occures. + Thus, there is no delay resulting from RRAMC getting ready. + """ + + TIMEOUT = 5 + MIN_DIFF = 10 # Minimal difference to pass the check + + # Get output from serial port + output = "\n".join( + dut.readlines_until( + regex="All done", + print_output=True, + timeout=TIMEOUT, + ) + ) + + # Get execution times + t_default_str = re.search( + r"Alarm set for 100 us, execution took:(.+) \(default RRAMC mode\)", output + ).group(1) + assert t_default_str is not None, "Timing for the default RRAMC mode was NOT found" + t_default = int(t_default_str) + + t_standby_str = re.search( + r"Alarm set for 100 us, execution took:(.+) \(RRAMC Standby mode\)", output + ).group(1) + assert t_standby_str is not None, "Timing for RRAMC Standby mode was NOT found" + t_standby = int(t_standby_str) + + t_ppi_str = re.search( + r"Alarm set for 100 us, execution took:(.+) \(RRAMC waken by PPI\)", output + ).group(1) + assert t_ppi_str is not None, "Timing for RRAMC Standby mode was NOT found" + t_ppi = int(t_ppi_str) + + # Check if RRAMC standby mode results in faster code execution + assert t_default > t_standby + MIN_DIFF, ( + f"{t_default} is NOT larger than {t_standby} + {MIN_DIFF}" + ) + # Check if RRAMC waken by PPI results in faster code execution + assert t_default > t_ppi + MIN_DIFF, f"{t_default} is NOT larger than {t_ppi} + {MIN_DIFF}" diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index 1e34b4233fc2..b7025bb4731e 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -54,6 +54,10 @@ tests: extra_configs: - CONFIG_SOC_NRF_FORCE_CONSTLAT=y sample.boards.nordic.nrf_sys_event.rramc_wakeup: + harness: pytest + harness_config: + pytest_root: + - "pytest/test_reg_event.py::test_rramc_wakeup" extra_configs: - CONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y platform_allow: diff --git a/samples/boards/nordic/nrf_sys_event/src/main.c b/samples/boards/nordic/nrf_sys_event/src/main.c index 57be33a9ad2c..feb257f360b2 100644 --- a/samples/boards/nordic/nrf_sys_event/src/main.c +++ b/samples/boards/nordic/nrf_sys_event/src/main.c @@ -137,6 +137,8 @@ int main(void) #ifdef CONFIG_NRF_SYS_EVENT_IRQ_LATENCY sys_event_irq_latency(); + + printf("All done\n"); #endif return 0; } From 8faa9cbdfc9eb4c355f1bbda75440da34d8df2ee Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Wed, 28 Jan 2026 17:53:14 +0000 Subject: [PATCH 1723/3334] [nrf fromtree] boards: nrf7120dk: Update UART00 and SPI00 pin mappings Hardware assignments for UART00 and SPI00 have changed so SPI00 can align with QSPI00. Signed-off-by: David Jewsbury (cherry picked from commit a6582cf974a4e8c1e1ea449a9e808606458b3bbf) --- .../nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi index 6538af10f840..4e307df24894 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi @@ -53,16 +53,16 @@ /omit-if-no-ref/ spi00_default: spi00_default { group1 { psels = , - , - ; + , + ; }; }; /omit-if-no-ref/ spi00_sleep: spi00_sleep { group1 { psels = , - , - ; + , + ; low-power-enable; }; }; @@ -82,23 +82,23 @@ /omit-if-no-ref/ uart00_default: uart00_default { group1 { - psels = , + psels = , ; }; group2 { - psels = , - ; + psels = , + ; bias-pull-up; }; }; /omit-if-no-ref/ uart00_sleep: uart00_sleep { group1 { - psels = , - , + psels = , + , , - ; + ; low-power-enable; }; }; From d9e419d8c7382e596229078ea905e4f1cf726b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 30 Jan 2026 10:47:18 +0100 Subject: [PATCH 1724/3334] [nrf noup] boards: nordic: nrf54h20: Fix addresses in cpuapp_ram0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrf-squash! [nrf noup] soc/nordic/nrf54h/pm_s2ram: S2RAM resume hardening Use only offsets to the base and not the full address. Signed-off-by: Krzysztof Chruściński --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 42ab67eda189..c5dd7a124d1d 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -365,16 +365,16 @@ zephyr_udc0: &usbhs { }; /* temporary stack for S2RAM resume logic */ - pm_s2ram_stack: cpuapp_s2ram_stack@22007fc8 { + pm_s2ram_stack: cpuapp_s2ram_stack@7fc8 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fc8 16>; + reg = <0x00007fc8 16>; zephyr,memory-region = "pm_s2ram_stack"; }; /* run-time common mcuboot S2RAM support section */ - mcuboot_s2ram: cpuapp_s2ram@22007fd8 { + mcuboot_s2ram: cpuapp_s2ram@7fd8 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fd8 8>; + reg = <0x00007fd8 8>; zephyr,memory-region = "mcuboot_s2ram_context"; }; From 8cc212e3cde152bc4d23bbcc8e92f34a0d00aff5 Mon Sep 17 00:00:00 2001 From: Camille BAUD Date: Mon, 12 Jan 2026 02:20:58 +0100 Subject: [PATCH 1725/3334] [nrf fromtree] boards: aithinker: bflb: ai_m61_32s demonstrates overclocking Provide example configuration for overclocking BL61x using this board Signed-off-by: Camille BAUD (cherry picked from commit 478804de5ed77293cb780e549b8e2c7efce86918) Signed-off-by: Robert Lubos --- .../ai_m61_32s_kit/Kconfig.ai_m61_32s_kit | 32 +++++- .../aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi | 7 +- .../ai_m61_32s_kit/ai_m61_32s_kit.dts | 97 +---------------- .../ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay | 12 +++ ...m61_32s_kit_bl618m05q2i_safe_overclock.dts | 27 +++++ ...kit_bl618m05q2i_safe_overclock_ALL.overlay | 18 ++++ ...1_32s_kit_bl618m05q2i_unsafe_overclock.dts | 35 ++++++ ...t_bl618m05q2i_unsafe_overclock_ALL.overlay | 27 +++++ .../ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi | 100 ++++++++++++++++++ .../ai_m61_32s_kit/ai_m61_32s_kit_defconfig | 10 -- boards/aithinker/ai_m61_32s_kit/board.yml | 12 ++- boards/aithinker/ai_m61_32s_kit/doc/index.rst | 11 +- .../aithinker/ai_m61_32s_kit/revision.cmake | 8 ++ 13 files changed, 282 insertions(+), 114 deletions(-) create mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay create mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock.dts create mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock_ALL.overlay create mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock.dts create mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock_ALL.overlay create mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi delete mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_defconfig create mode 100644 boards/aithinker/ai_m61_32s_kit/revision.cmake diff --git a/boards/aithinker/ai_m61_32s_kit/Kconfig.ai_m61_32s_kit b/boards/aithinker/ai_m61_32s_kit/Kconfig.ai_m61_32s_kit index 318e560e4e8e..2cc4ccde0155 100644 --- a/boards/aithinker/ai_m61_32s_kit/Kconfig.ai_m61_32s_kit +++ b/boards/aithinker/ai_m61_32s_kit/Kconfig.ai_m61_32s_kit @@ -1,6 +1,34 @@ -# Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space) +# Copyright (c) 2024-2026 MASSDRIVER EI (massdriver.space) # # SPDX-License-Identifier: Apache-2.0 config BOARD_AI_M61_32S_KIT - select SOC_BL618M65Q2I + select SOC_BL618M05Q2I if BOARD_REVISION_DEFAULT + select SOC_BL618M65Q2I if BOARD_REVISION_ALL + +if BOARD_AI_M61_32S_KIT + +config BOARD_REVISION_DEFAULT + bool + +config BOARD_REVISION_ALL + bool + +# Avoid adding 8 identical files +config CONSOLE + bool + default y + +config SERIAL + bool + default y + +config UART_CONSOLE + bool + default y + +config MEMC + bool + default y + +endif diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi index d9f20cbd6867..75c4225ab31c 100644 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2025-2026 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -27,10 +27,7 @@ &flashctrl { flash0: flash@A0000000 { - /* in-chip xmc flash die on ALL variant, NC pins noneffective - * in-module SOIC-8 gigadevice flash on non-ALL variant, NC pins effective - */ - compatible = "soc-nv-flash", "xmc,xm25qw64", "gd,gd25q64e"; + compatible = "soc-nv-flash", "gd,gd25q64e"; reg = <0xA0000000 (0x800000 - 0x2000)>; write-block-size = <256>; erase-block-size = ; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit.dts b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit.dts index 080f7ec40f88..b7f8551f6720 100644 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit.dts +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2025-2026 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -7,97 +7,4 @@ /dts-v1/; #include "ai_m61_32s.dtsi" -#include "ai_m61_32s_kit-pinctrl.dtsi" - -/ { - model = "Ai-Thinker M61-32S development board"; - - aliases { - led0 = &blue_led; - sw0 = &button_0; - pwm-led0 = &blue_pwm_led; - }; - - leds { - compatible = "gpio-leds"; - - blue_led: led_0 { - gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; - label = "Blue - LED0"; - }; - - green_led: led_1 { - gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; - label = "Green - LED1"; - }; - - red_led: led_2 { - gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; - label = "Red - LED2"; - }; - - white_led: led_3 { - gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; - label = "White - LED3"; - }; - - warmwhite_led: led_4 { - gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; - label = "Warm White - LED4"; - }; - }; - - pwmleds: pwmleds { - compatible = "pwm-leds"; - status = "disabled"; - - blue_pwm_led: led_pwm_0 { - pwms = <&pwm0 3 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "Blue - LED0 PWM"; - }; - - green_pwm_led: led_pwm_1 { - pwms = <&pwm0 2 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "Green - LED1 PWM"; - }; - - red_pwm_led: led_pwm_2 { - pwms = <&pwm0 0 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "Red - LED2 PWM"; - }; - - white_pwm_led: led_pwm_3 { - pwms = <&pwm0 1 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "White - LED3 PWM"; - }; - - warmwhite_pwm_led: led_pwm_4 { - pwms = <&pwm0 3 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "Warm White - LED4 PWM"; - }; - }; - - buttons { - compatible = "gpio-keys"; - - button_0: sw0 { - gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; - zephyr,code = ; - }; - }; -}; - -&i2c0 { - status = "okay"; - clock-frequency = ; - - pinctrl-0 = <&i2c0_default>; - pinctrl-names = "default"; -}; - -&spi0 { - status = "okay"; - - pinctrl-0 = <&spi0_default>; - pinctrl-names = "default"; -}; +#include "ai_m61_32s_kit_common.dtsi" diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay new file mode 100644 index 000000000000..78ca5ad05c18 --- /dev/null +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flash0 { + /* ALL revision is BL618M65, which has an internal XMC Flash die + * instead of an external SOIC Flash. + */ + compatible = "soc-nv-flash", "xmc,xm25qw64"; +}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock.dts b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock.dts new file mode 100644 index 000000000000..31c58b656440 --- /dev/null +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock.dts @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include "ai_m61_32s.dtsi" +#include "ai_m61_32s_kit_common.dtsi" + +&clk_root { + /* Increased PLL speed used as FCLK */ + clocks = <&clk_wifipll BL61X_WIFIPLL_OC_480MHz>; +}; + +&clk_bclk { + /* 120 MHz BCLK and so Flash clock at this FCLK works for both revisions */ + divider = <4>; +}; + +&clk_flash { + /* 0 Units of delay for GD Flash but inverted RX */ + read-delay = <0>; + rx-clock-invert; + divider = <1>; +}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock_ALL.overlay b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock_ALL.overlay new file mode 100644 index 000000000000..34665912841b --- /dev/null +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock_ALL.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flash0 { + /* ALL revision is BL618M65, which has an internal XMC Flash die + * instead of an external SOIC Flash. + */ + compatible = "soc-nv-flash", "xmc,xm25qw64"; +}; + +&clk_flash { + /* 1 Unit of delay (4 Cycles) for XMC Flash at 120 MHz Flash clock */ + read-delay = <1>; + /delete-property/ rx-clock-invert; +}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock.dts b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock.dts new file mode 100644 index 000000000000..32973b217c07 --- /dev/null +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock.dts @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include "ai_m61_32s.dtsi" +#include "ai_m61_32s_kit_common.dtsi" + +&clk_root { + /* Increased PLL speed used as FCLK */ + clocks = <&clk_wifipll BL61X_WIFIPLL_OCMAX_640MHz>; +}; + +®_soc { + /* SoC LDO at 1.25v to handle 640MHz FCLK*/ + regulator-init-microvolt = <1250000>; +}; + +/* With the settings used for their flash (Dual Out mode), the ALL and non-ALL revisions + * need different flash clock settings to work properly at 640MHz FCLK. + */ +&clk_bclk { + /* 120MHz BCLK */ + divider = <5>; +}; + +&clk_flash { + /* 0 Units of delay for GD Flash but inverted RX */ + read-delay = <0>; + rx-clock-invert; + divider = <1>; +}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock_ALL.overlay b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock_ALL.overlay new file mode 100644 index 000000000000..ce7067e85702 --- /dev/null +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock_ALL.overlay @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flash0 { + /* ALL revision is BL618M65, which has an internal XMC Flash die + * instead of an external SOIC Flash. + */ + compatible = "soc-nv-flash", "xmc,xm25qw64"; +}; + +/* With the settings used for their flash (Dual Out mode), the ALL and non-ALL revisions + * need different flash clock settings to work properly at 640MHz FCLK. + */ + +&clk_bclk { + /* 100 + 20/3 (106.66...) MHz BCLK */ + divider = <6>; +}; + +&clk_flash { + /* 1 Unit of delay (4 Cycles) for XMC Flash at 100 + 20/3 (106.66...) MHz Flash clock */ + read-delay = <1>; + /delete-property/ rx-clock-invert; +}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi new file mode 100644 index 000000000000..b16900e47073 --- /dev/null +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2025-2026 MASSDRIVER EI (massdriver.space) + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "ai_m61_32s_kit-pinctrl.dtsi" + +/ { + model = "Ai-Thinker M61-32S development board"; + + aliases { + led0 = &blue_led; + sw0 = &button_0; + pwm-led0 = &blue_pwm_led; + }; + + leds { + compatible = "gpio-leds"; + + blue_led: led_0 { + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + label = "Blue - LED0"; + }; + + green_led: led_1 { + gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; + label = "Green - LED1"; + }; + + red_led: led_2 { + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + label = "Red - LED2"; + }; + + white_led: led_3 { + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + label = "White - LED3"; + }; + + warmwhite_led: led_4 { + gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; + label = "Warm White - LED4"; + }; + }; + + pwmleds: pwmleds { + compatible = "pwm-leds"; + status = "disabled"; + + blue_pwm_led: led_pwm_0 { + pwms = <&pwm0 3 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "Blue - LED0 PWM"; + }; + + green_pwm_led: led_pwm_1 { + pwms = <&pwm0 2 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "Green - LED1 PWM"; + }; + + red_pwm_led: led_pwm_2 { + pwms = <&pwm0 0 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "Red - LED2 PWM"; + }; + + white_pwm_led: led_pwm_3 { + pwms = <&pwm0 1 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "White - LED3 PWM"; + }; + + warmwhite_pwm_led: led_pwm_4 { + pwms = <&pwm0 3 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "Warm White - LED4 PWM"; + }; + }; + + buttons { + compatible = "gpio-keys"; + + button_0: sw0 { + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + zephyr,code = ; + }; + }; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&spi0 { + status = "okay"; + + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; +}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_defconfig b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_defconfig deleted file mode 100644 index f55755ffde6f..000000000000 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_defconfig +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) -# -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_CONSOLE=y -CONFIG_SERIAL=y - -CONFIG_UART_CONSOLE=y - -CONFIG_MEMC=y diff --git a/boards/aithinker/ai_m61_32s_kit/board.yml b/boards/aithinker/ai_m61_32s_kit/board.yml index 911910b4e4f9..40d0cd2f6d85 100644 --- a/boards/aithinker/ai_m61_32s_kit/board.yml +++ b/boards/aithinker/ai_m61_32s_kit/board.yml @@ -2,5 +2,15 @@ board: name: ai_m61_32s_kit full_name: Ai-Thinker M61-32S development board vendor: aithinker + revision: + format: custom + default: "DEFAULT" + exact: true + revisions: + - name: "ALL" + - name: "DEFAULT" socs: - - name: bl618m65q2i + - name: bl618m05q2i # ALL revision is bl618m65q2i, Kconfig repairs this 'error' + variants: + - name: "safe_overclock" + - name: "unsafe_overclock" diff --git a/boards/aithinker/ai_m61_32s_kit/doc/index.rst b/boards/aithinker/ai_m61_32s_kit/doc/index.rst index cd67db06aca5..678bc0363ab7 100644 --- a/boards/aithinker/ai_m61_32s_kit/doc/index.rst +++ b/boards/aithinker/ai_m61_32s_kit/doc/index.rst @@ -29,6 +29,15 @@ System Clock The M61 (BL618) Development Board is configured to run at maximum speed (320MHz) and can be overclocked to 480 MHz. +This board provides demonstration configurations for the overclocking of the BL618 SoC clocks: + +- ``ai_m61_32s_kit/bl618m05q2i/safe_overclock`` demonstrates 120MHz BCLK and 480MHz core clock on both variants. This nets a Coremark score up to 1600. +- ``ai_m61_32s_kit/bl618m05q2i/unsafe_overclock`` demonstrates 120MHz or 106MHz BCLK and 640MHz core clock with higher core voltages. This nets a Coremark score up to 2100. + +If you are using the ALL variant, please use :``ai_m61_32s_kit@ALL``. + +When overclocking, DMA and DMA-using drivers will not work properly. + Serial Port =========== @@ -69,7 +78,7 @@ Samples .. code-block:: console *** Booting Zephyr OS build v4.3.0 *** - Hello World! ai_m61_32s_kit/bl618m65q2i + Hello World! ai_m61_32s_kit/bl618m05q2i Congratulations, you have ``ai_m61_32s_kit`` configured and running Zephyr. diff --git a/boards/aithinker/ai_m61_32s_kit/revision.cmake b/boards/aithinker/ai_m61_32s_kit/revision.cmake new file mode 100644 index 000000000000..f6d6fc64e4df --- /dev/null +++ b/boards/aithinker/ai_m61_32s_kit/revision.cmake @@ -0,0 +1,8 @@ +set(BOARD_REVISIONS "ALL" "DEFAULT") +if(NOT DEFINED BOARD_REVISION) + set(BOARD_REVISION "DEFAULT") +else() + if(NOT BOARD_REVISION IN_LIST BOARD_REVISIONS) + message(FATAL_ERROR "${BOARD_REVISION} is not a valid revision for ai_m61_32s_kit Accepted revisions: ${BOARD_REVISIONS}") + endif() +endif() From 1514a19721ba9c1461ab39deb37bf9adafb478c0 Mon Sep 17 00:00:00 2001 From: Waqar Tahir Date: Fri, 16 Jan 2026 12:25:02 +0100 Subject: [PATCH 1726/3334] [nrf fromtree] boards: nxp: mcxn947: updated partitions - Updated partitions in non-secure device tree files as tfm now supports Bl2. - Flash_base address updated for ns-app as tfm apps are now using bl2 by default. Signed-off-by: Waqar Tahir (cherry picked from commit bdcb5c6b4b9a319a6165219e8acf96cd2865c09f) Signed-off-by: Robert Lubos --- .../frdm_mcxn947_mcxn947_cpu0_ns.dts | 55 +++++++++++++++++-- .../frdm_mcxn947_mcxn947_cpu0_ns_defconfig | 6 +- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts index 71cb3a93dc9c..7e4ac87cb46a 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts @@ -56,12 +56,59 @@ #size-cells = <1>; /* - * Partition sizes must be aligned - * to the flash memory sector size of 8KB. + * All partition sizes must be aligned to the flash memory sector size (8 KB). + * + * This flash layout must exactly match the upstream TF-M layout defined in + * the platform-specific `flash_layout.h`. Any modification to the layout + * must be applied consistently in both `flash_layout.h` and this file. + * + * BL2 / MCUBoot */ - slot0_ns_partition: partition@80000 { + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(64)>; /* 64 KB */ + }; + + /* Secure image - primary */ + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 DT_SIZE_K(288)>; /* 288 KB */ + }; + + /* Non-secure image - primary */ + slot0_ns_partition: partition@58000 { label = "image-0-nonsecure"; - reg = <0x00080000 DT_SIZE_K(512)>; + reg = <0x00058000 DT_SIZE_K(256)>; /* 256 KB */ + }; + + /* Secure image - secondary */ + slot1_partition: partition@98000 { + label = "image-1-secondary"; + reg = <0x00098000 DT_SIZE_K(288)>; /* 288 KB */ + }; + + /* Non-secure image - secondary */ + slot1_ns_partition: partition@E0000 { + label = "image-1-non-secure"; + reg = <0x000E0000 DT_SIZE_K(256)>; /* 256 KB */ + }; + + /* Protected Storage (PS) */ + tfm_ps_partition: partition@120000 { + label = "tfm-ps"; + reg = <0x00120000 DT_SIZE_K(16)>; /* 16 KB */ + }; + + /* Internal Trusted Storage (ITS) */ + tfm_its_partition: partition@124000 { + label = "tfm-its"; + reg = <0x00124000 DT_SIZE_K(16)>; /* 16 KB */ + }; + + /* OTP / NV counters */ + tfm_otp_partition: partition@128000 { + label = "tfm-otp"; + reg = <0x00128000 DT_SIZE_K(8)>; /* 8 KB */ }; }; }; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns_defconfig b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns_defconfig index 9f421c6b50bb..66adee8f206b 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns_defconfig +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns_defconfig @@ -1,5 +1,5 @@ # -# Copyright 2025 NXP +# Copyright 2025-2026 NXP # # SPDX-License-Identifier: Apache-2.0 # @@ -14,6 +14,6 @@ CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y CONFIG_TRUSTED_EXECUTION_NONSECURE=y -CONFIG_TFM_BL2=n +CONFIG_TFM_BL2=y CONFIG_BUILD_WITH_TFM=y -CONFIG_FLASH_BASE_ADDRESS=0x80000 +CONFIG_FLASH_BASE_ADDRESS=0x58000 From 68f4031b4f177540ef01c190a357a2793fd07970 Mon Sep 17 00:00:00 2001 From: Lucien Zhao Date: Mon, 19 Jan 2026 18:04:05 +0800 Subject: [PATCH 1727/3334] [nrf fromtree] dts: arm: nxp: Add specific compatible strings for RCM and SIM Add vendor-specific compatible strings to RCM and SIM nodes: - "nxp,rcm-hwinfo" for Reset Control Module (hwinfo-reset functionality) - "nxp,sim-uuid" for System Integration Module (hwinfo-UUID functionality) Signed-off-by: Lucien Zhao (cherry picked from commit eb43ffc6b801a7661e3789c81d309113349c3ebe) Signed-off-by: Robert Lubos --- dts/arm/nxp/nxp_k2x.dtsi | 7 ++++++- dts/arm/nxp/nxp_k32l2b3.dtsi | 7 ++++++- dts/arm/nxp/nxp_k6x.dtsi | 7 ++++++- dts/arm/nxp/nxp_k8x.dtsi | 7 ++++++- dts/arm/nxp/nxp_kl25z.dtsi | 7 ++++++- dts/arm/nxp/nxp_kv5x.dtsi | 7 ++++++- dts/arm/nxp/nxp_kw2xd.dtsi | 13 +++++++++++-- dts/arm/nxp/nxp_kw40z.dtsi | 13 +++++++++++-- dts/arm/nxp/nxp_kw41z.dtsi | 7 ++++++- dts/arm/nxp/nxp_mcxc_common.dtsi | 7 ++++++- 10 files changed, 70 insertions(+), 12 deletions(-) diff --git a/dts/arm/nxp/nxp_k2x.dtsi b/dts/arm/nxp/nxp_k2x.dtsi index c56eec74a558..9b6850a5003f 100644 --- a/dts/arm/nxp/nxp_k2x.dtsi +++ b/dts/arm/nxp/nxp_k2x.dtsi @@ -81,8 +81,13 @@ clock-frequency = <32768>; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_k32l2b3.dtsi b/dts/arm/nxp/nxp_k32l2b3.dtsi index 223c419dce4b..0c2ced6dc83f 100644 --- a/dts/arm/nxp/nxp_k32l2b3.dtsi +++ b/dts/arm/nxp/nxp_k32l2b3.dtsi @@ -87,8 +87,13 @@ #clock-cells = <1>; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_k6x.dtsi b/dts/arm/nxp/nxp_k6x.dtsi index bd8a859aebb1..0f186f705399 100644 --- a/dts/arm/nxp/nxp_k6x.dtsi +++ b/dts/arm/nxp/nxp_k6x.dtsi @@ -112,8 +112,13 @@ prescaler = <32768>; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_k8x.dtsi b/dts/arm/nxp/nxp_k8x.dtsi index 351a6f750efc..38ae65795291 100644 --- a/dts/arm/nxp/nxp_k8x.dtsi +++ b/dts/arm/nxp/nxp_k8x.dtsi @@ -45,8 +45,13 @@ status = "disabled"; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x2000>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kl25z.dtsi b/dts/arm/nxp/nxp_kl25z.dtsi index 068071fbf514..af4091f9b28e 100644 --- a/dts/arm/nxp/nxp_kl25z.dtsi +++ b/dts/arm/nxp/nxp_kl25z.dtsi @@ -82,8 +82,13 @@ status = "disabled"; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kv5x.dtsi b/dts/arm/nxp/nxp_kv5x.dtsi index ae2107303435..82d8c9d16f35 100644 --- a/dts/arm/nxp/nxp_kv5x.dtsi +++ b/dts/arm/nxp/nxp_kv5x.dtsi @@ -40,8 +40,13 @@ status = "disabled"; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x2000>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kw2xd.dtsi b/dts/arm/nxp/nxp_kw2xd.dtsi index f1fedeb61269..bf0ce0335adf 100644 --- a/dts/arm/nxp/nxp_kw2xd.dtsi +++ b/dts/arm/nxp/nxp_kw2xd.dtsi @@ -1,4 +1,8 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright 2026 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -79,8 +83,13 @@ clock-frequency = <32768>; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kw40z.dtsi b/dts/arm/nxp/nxp_kw40z.dtsi index cd89adf080ce..88feb64b3dbb 100644 --- a/dts/arm/nxp/nxp_kw40z.dtsi +++ b/dts/arm/nxp/nxp_kw40z.dtsi @@ -1,4 +1,8 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright 2026 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -56,8 +60,13 @@ clock-frequency = <32768>; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kw41z.dtsi b/dts/arm/nxp/nxp_kw41z.dtsi index 3896629aa55e..19680e26d6b8 100644 --- a/dts/arm/nxp/nxp_kw41z.dtsi +++ b/dts/arm/nxp/nxp_kw41z.dtsi @@ -63,8 +63,13 @@ prescaler = <32768>; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_mcxc_common.dtsi b/dts/arm/nxp/nxp_mcxc_common.dtsi index 2756aa6b7721..90a68cd8e058 100644 --- a/dts/arm/nxp/nxp_mcxc_common.dtsi +++ b/dts/arm/nxp/nxp_mcxc_common.dtsi @@ -92,8 +92,13 @@ #clock-cells = <1>; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + sim: sim@40047000 { - compatible = "nxp,kinetis-sim"; + compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; reg = <0x40047000 0x1060>; #clock-cells = <3>; From 44bfa10b3fd6efd1726f492e5c0e728c2f210f1e Mon Sep 17 00:00:00 2001 From: Phuc Pham Date: Thu, 4 Dec 2025 16:31:20 +0700 Subject: [PATCH 1728/3334] [nrf fromtree] dts: renesas: Add ADC support for Renesas RZ SoCs Add ADC nodes for devicetree of - RZ/G2L, G2UL - RZ/T2L - RZ/V2H (CR8 & CM33), RZ/V2N Signed-off-by: Phuc Pham Signed-off-by: Tien Nguyen (cherry picked from commit 3a092e3e873d867c93c93164d23886afef395e64) Signed-off-by: Robert Lubos --- dts/arm/renesas/rz/rzg/r9a07g043.dtsi | 12 +++++++ dts/arm/renesas/rz/rzg/r9a07g044.dtsi | 12 +++++++ dts/arm/renesas/rz/rzt/r9a07g074.dtsi | 25 +++++++++++++++ dts/arm/renesas/rz/rzv/r9a09g056.dtsi | 37 ++++++++++++++++++++++ dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi | 13 ++++++++ dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi | 13 ++++++++ 6 files changed, 112 insertions(+) diff --git a/dts/arm/renesas/rz/rzg/r9a07g043.dtsi b/dts/arm/renesas/rz/rzg/r9a07g043.dtsi index f40b425f9338..de045977f24d 100644 --- a/dts/arm/renesas/rz/rzg/r9a07g043.dtsi +++ b/dts/arm/renesas/rz/rzg/r9a07g043.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include #include / { @@ -220,6 +221,17 @@ }; }; + adc: adc@40059000 { + compatible = "renesas,rz-adc-c"; + reg = <0x40059000 DT_SIZE_K(1)>; + interrupts = <347 3>; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0x3>; + status = "disabled"; + }; + scif0: serial@4004b800 { compatible = "renesas,rz-scif-uart"; channel = <0>; diff --git a/dts/arm/renesas/rz/rzg/r9a07g044.dtsi b/dts/arm/renesas/rz/rzg/r9a07g044.dtsi index f4c0d9e1cee7..e1567177e7c4 100644 --- a/dts/arm/renesas/rz/rzg/r9a07g044.dtsi +++ b/dts/arm/renesas/rz/rzg/r9a07g044.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include #include / { @@ -490,6 +491,17 @@ }; }; + adc: adc@40059000 { + compatible = "renesas,rz-adc-c"; + reg = <0x40059000 DT_SIZE_K(1)>; + interrupts = <347 3>; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0xFF>; + status = "disabled"; + }; + scif0: serial@4004b800 { compatible = "renesas,rz-scif-uart"; channel = <0>; diff --git a/dts/arm/renesas/rz/rzt/r9a07g074.dtsi b/dts/arm/renesas/rz/rzt/r9a07g074.dtsi index abe232f261a8..518da4dd89ba 100644 --- a/dts/arm/renesas/rz/rzt/r9a07g074.dtsi +++ b/dts/arm/renesas/rz/rzt/r9a07g074.dtsi @@ -7,6 +7,7 @@ #include #include #include +#include #include / { @@ -478,6 +479,30 @@ }; }; + adc0: adc0@90004000 { + compatible = "renesas,rz-adc"; + reg = <0x90004000 0x800>; + unit = <0>; + interrupts = ; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0xF>; + status = "disabled"; + }; + + adc1: adc1@90004800 { + compatible = "renesas,rz-adc"; + reg = <0x90004800 0x800>; + unit = <1>; + interrupts = ; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0xF>; + status = "disabled"; + }; + sci0: sci0@80001000 { compatible = "renesas,rz-sci"; reg = <0x80001000 0x400>; diff --git a/dts/arm/renesas/rz/rzv/r9a09g056.dtsi b/dts/arm/renesas/rz/rzv/r9a09g056.dtsi index 4dbe6691befc..8af64a2690b3 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g056.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g056.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include #include / { @@ -157,6 +158,42 @@ }; }; + adc0: adc0@41c00000 { + compatible = "renesas,rz-adc-e"; + reg = <0x41c00000 0x400>; + unit = <0>; + interrupts = <403 3>; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0xFF>; + status = "disabled"; + }; + + adc1: adc1@41c02800 { + compatible = "renesas,rz-adc-e"; + reg = <0x41c02800 0x400>; + unit = <1>; + interrupts = <404 3>; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0xFF>; + status = "disabled"; + }; + + adc2: adc2@41c02c00 { + compatible = "renesas,rz-adc-e"; + reg = <0x41c02c00 0x400>; + unit = <2>; + interrupts = <405 3>; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0xFF>; + status = "disabled"; + }; + gpt0: gpt@43010000 { compatible = "renesas,rz-gpt"; reg = <0x43010000 0x100>; diff --git a/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi b/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi index 5b919bb56634..5dad51d7aff4 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include #include / { @@ -716,6 +717,18 @@ }; }; + adc0: adc0@41c00000 { + compatible = "renesas,rz-adc-e"; + reg = <0x41c00000 0x400>; + unit = <0>; + interrupts = <403 3>; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0xFF>; + status = "disabled"; + }; + sci0: sci0@42800c00 { compatible = "renesas,rz-sci-b"; reg = <0x42800c00 0x400>; diff --git a/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi b/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi index 9127fd27de52..5e61653c3d59 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -196,6 +197,18 @@ }; }; + adc0: adc0@11c00000 { + compatible = "renesas,rz-adc-e"; + reg = <0x11c00000 0x400>; + unit = <0>; + interrupts = ; + interrupt-names = "scanend"; + #io-channel-cells = <1>; + vref-mv = <1800>; + channel-available-mask = <0xFF>; + status = "disabled"; + }; + gpt0: gpt@13010000 { compatible = "renesas,rz-gpt"; reg = <0x13010000 0x100>; From 7a276854dc77d01e2eeae438d6c9e0bc9b542833 Mon Sep 17 00:00:00 2001 From: Tarang Patel Date: Wed, 14 Jan 2026 11:34:31 +0000 Subject: [PATCH 1729/3334] [nrf fromtree] boards: u-blox: ubx_evkninab5: add new board Add basic board definition of the u-blox EVK-NINA-B5 board Signed-off-by: Tarang Patel (cherry picked from commit 7ee4cb99b9882c2043cf62141323d281174dd7cd) Signed-off-by: Robert Lubos --- .../ubx_evkninab5/Kconfig.ubx_evkninab5 | 7 + boards/u-blox/ubx_evkninab5/board.cmake | 8 + boards/u-blox/ubx_evkninab5/board.yml | 6 + boards/u-blox/ubx_evkninab5/doc/index.rst | 162 ++++++++++++++++++ .../ubx_evkninab5/doc/ubx_evkninab5.webp | Bin 0 -> 70150 bytes .../ubx_evkninab5_mcxw716c-pinctrl.dtsi | 35 ++++ .../ubx_evkninab5/ubx_evkninab5_mcxw716c.dts | 158 +++++++++++++++++ .../ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml | 22 +++ .../ubx_evkninab5_mcxw716c_defconfig | 11 ++ 9 files changed, 409 insertions(+) create mode 100644 boards/u-blox/ubx_evkninab5/Kconfig.ubx_evkninab5 create mode 100644 boards/u-blox/ubx_evkninab5/board.cmake create mode 100644 boards/u-blox/ubx_evkninab5/board.yml create mode 100644 boards/u-blox/ubx_evkninab5/doc/index.rst create mode 100644 boards/u-blox/ubx_evkninab5/doc/ubx_evkninab5.webp create mode 100644 boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c-pinctrl.dtsi create mode 100644 boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts create mode 100644 boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml create mode 100644 boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c_defconfig diff --git a/boards/u-blox/ubx_evkninab5/Kconfig.ubx_evkninab5 b/boards/u-blox/ubx_evkninab5/Kconfig.ubx_evkninab5 new file mode 100644 index 000000000000..f55fee1c1cf1 --- /dev/null +++ b/boards/u-blox/ubx_evkninab5/Kconfig.ubx_evkninab5 @@ -0,0 +1,7 @@ +# Copyright 2026 NXP +# Copyright 2026 u-blox +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_UBX_EVKNINAB5 + select SOC_MCXW716C + select SOC_PART_NUMBER_MCXW716CMFTA diff --git a/boards/u-blox/ubx_evkninab5/board.cmake b/boards/u-blox/ubx_evkninab5/board.cmake new file mode 100644 index 000000000000..a815f9608c33 --- /dev/null +++ b/boards/u-blox/ubx_evkninab5/board.cmake @@ -0,0 +1,8 @@ +# Copyright 2026 u-blox +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(linkserver "--device=MCXW716CxxxA:UBX_EVKNINAB5") +board_runner_args(jlink "--device=mcxw716" "--reset-after-load") + +include(${ZEPHYR_BASE}/boards/common/linkserver.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/u-blox/ubx_evkninab5/board.yml b/boards/u-blox/ubx_evkninab5/board.yml new file mode 100644 index 000000000000..99aa257ea084 --- /dev/null +++ b/boards/u-blox/ubx_evkninab5/board.yml @@ -0,0 +1,6 @@ +board: + name: ubx_evkninab5 + full_name: EVK-NINA-B5-MCXW716C + vendor: u-blox + socs: + - name: mcxw716c diff --git a/boards/u-blox/ubx_evkninab5/doc/index.rst b/boards/u-blox/ubx_evkninab5/doc/index.rst new file mode 100644 index 000000000000..b38241b96d51 --- /dev/null +++ b/boards/u-blox/ubx_evkninab5/doc/index.rst @@ -0,0 +1,162 @@ +.. zephyr:board:: ubx_evkninab5 + +Overview +******** + +The EVK-NINA-B5 is a compact and scalable development board for rapid +prototyping of the NINA-B5 wireless module. It offers easy evaluation of the +NINA-B5's multiprotocol wireless support for Bluetooth LE, Zigbee, Thread and +Matter. The board includes an on-board J-link-Link debugger and industry +standard headers for easy access to the MCU’s I/Os. + +The NINA-B5 module is built on the MCX W71x 96 MHz Arm® Cortex®-M33 from NXP. + +Hardware +******** + +- MCXW71 Arm Cortex-M33 microcontroller running up to 96 MHz +- 1MB on-chip Flash memory unit +- 128 KB TCM RAM +- On-board MCU-Link debugger with CMSIS-DAP + +For more information about the NINA-B5 module and EVK-NINA-B5 board, see: + +- `NINA-B5 product page`_ +- `EVK-NINA-B5 product page`_ + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Fetch Binary Blobs +****************** + +To support Bluetooth, ubx_evkninab5 requires fetching binary blobs, which can be +achieved by running the following command: + +.. code-block:: console + + west blobs fetch hal_nxp + +Note: The EVK-NINA-B5 is preflashed with NBU files. + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Build and flash applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +Configuring a Debug Probe +========================= + +A debug probe is used for both flashing and debugging the board. This board is +configured by default to use the MCU-Link CMSIS-DAP Onboard Debug Probe. + + +Using J-Link +------------ + +The onboard debug circuit is a Segger J-Link debugger + +The second option is to attach a :ref:`jlink-external-debug-probe` to the +10-pin SWD connector (J12) of the board. + +For both options use the ``-r jlink`` option with west to use the jlink runner. + +.. code-block:: console + + west flash -r jlink + +Configuring a Console +===================== + +Connect a USB cable from your PC to the USB port, and use the serial terminal +of your choice (minicom, putty, etc.) with the following settings: + +- Speed: 115200 +- Data: 8 bits +- Parity: None +- Stop bits: 1 + +Application Building +==================== + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/button + :board: ubx_evkninab5 + :goals: build + :gen-args: + + +Application Flashing +==================== + +Here is an example for the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: ubx_evkninab5 + :goals: flash + +Open a serial terminal, reset the board (press the RESET button), and you should +see the following message in the terminal: + +.. code-block:: console + + *** Booting Zephyr OS build v3.7.0-xxx-xxxx *** + Hello World! ubx_evkninab5 + +Debugging +========= + +Here is an example for the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: ubx_evkninab5 + :goals: debug + +Open a serial terminal, step through the application in your debugger, and you +should see the following message in the terminal: + +.. code-block:: console + + *** Booting Zephyr OS build v3.7.0-xxx-xxxx *** + Hello World! ubx_evkninab5 + +NBU Flashing +============ + +BLE functionality requires to fetch binary blobs, so make sure to follow +the ``Fetch Binary Blobs`` section first. + +Two images must be written to the board: one for the host (CM33) and one for the NBU (CM3). + +- To flash the application (CM33) refer to the ``Application Flashing`` section above. + +- To flash the ``NBU Flashing``, follow the instructions below in the NINA-B5 system + integration manual available on the `NINA-B5 product page`_. + +The NBU files can be found in : ``/modules/hal/nxp/zephyr/blobs/mcxw71/`` folder. + +For more details: + +.. _MCXW71 In-System Programming Utility: + https://docs.nxp.com/bundle/AN14427/page/topics/introduction.html + +.. _blhost Website: + https://www.nxp.com/search?keyword=blhost&start=0 + +References +********** + +.. target-notes:: + +.. _NINA-B5 product page: + https://www.u-blox.com/en/product/nina-b50-series-open-cpu + +.. _EVK-NINA-B5 product page: + https://www.u-blox.com/en/product/evk-nina-b5?legacy=Current#Documentation-&-resources diff --git a/boards/u-blox/ubx_evkninab5/doc/ubx_evkninab5.webp b/boards/u-blox/ubx_evkninab5/doc/ubx_evkninab5.webp new file mode 100644 index 0000000000000000000000000000000000000000..b870bdd4f2a9f62aa33507ef55e85ffe97fa12d5 GIT binary patch literal 70150 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 + +&pinctrl { + pinmux_lpuart0: pinmux_lpuart0 { + group0 { + pinmux = , ; + drive-strength = "low"; + slew-rate = "fast"; + }; + }; + + pinmux_lpuart1: pinmux_lpuart1 { + group0 { + pinmux = , ; + drive-strength = "low"; + slew-rate = "fast"; + }; + }; + + pinmux_lpadc0: pinmux_lpadc0 { + group0 { + pinmux = , + , + ; + drive-strength = "low"; + slew-rate = "fast"; + }; + }; +}; diff --git a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts new file mode 100644 index 000000000000..7c3fa4fa51b8 --- /dev/null +++ b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts @@ -0,0 +1,158 @@ +/* + * Copyright 2026 u-blox + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "ubx_evkninab5_mcxw716c-pinctrl.dtsi" +#include +#include + +/ { + model = "u-blox EVK-NINA-B5 mcxw71"; + compatible = "u-blox,ubx_evkninab5_mcxw716c"; + + aliases { + led0 = &blue_led; + sw0 = &user_button_0; + }; + + chosen { + zephyr,flash = &flash; + zephyr,flash-controller = &fmu; + zephyr,code-partition = &slot0_partition; + zephyr,sram = &stcm0; + zephyr,console = &lpuart1; + zephyr,shell-uart = &lpuart1; + zephyr,uart-pipe = &lpuart0; + zephyr,uart-mcumgr = &lpuart0; + zephyr,bt-c2h-uart = &lpuart0; + }; + + user_led { + compatible = "gpio-leds"; + + blue_led: led { + gpios = <&gpioc 5 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + user_button_0: button_0 { + label = "User SW2"; + gpios = <&gpiod 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + zephyr,code = ; + status = "okay"; + }; + }; + + arduino_header: arduino-connector { + compatible = "arduino-header-r3"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + }; +}; + +&vref { + status = "okay"; +}; + +&gpiob { + status = "okay"; +}; + +&gpioc { + status = "okay"; +}; + +&gpiod { + status = "okay"; +}; + +&lpuart0 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&pinmux_lpuart0>; + pinctrl-names = "default"; +}; + +&lpuart1 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&pinmux_lpuart1>; + pinctrl-names = "default"; +}; + +&flash { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * Partition sizes must be aligned + * to the flash memory sector size of 8KB. + */ + boot_partition: partition@0 { + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + reg = <0x10000 DT_SIZE_K(424)>; + }; + + slot1_partition: partition@7A000 { + reg = <0x7A000 DT_SIZE_K(424)>; + }; + + storage_partition: partition@E4000 { + reg = <0xE4000 DT_SIZE_K(112)>; + }; + }; +}; + +&fmu { + status = "okay"; +}; + +&lptmr0 { + status = "okay"; +}; + +&adc0 { + pinctrl-0 = <&pinmux_lpadc0>; + pinctrl-names = "default"; + status = "okay"; +}; + +&nbu { + status = "okay"; + wakeup-source; +}; + +&rtc { + status = "okay"; +}; diff --git a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml new file mode 100644 index 000000000000..b09c63aea81c --- /dev/null +++ b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml @@ -0,0 +1,22 @@ +identifier: ubx_evkninab5 +name: u-blox EVK-NINA-B5 +type: mcu +arch: arm +ram: 64 +flash: 1024 +toolchain: + - zephyr + - gnuarmemb +supported: + - adc + - can + - counter + - flash + - flexio + - gpio + - pinctrl + - pwm + - regulator + - uart + - watchdog +vendor: u-blox diff --git a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c_defconfig b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c_defconfig new file mode 100644 index 000000000000..73fbe1834b5b --- /dev/null +++ b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c_defconfig @@ -0,0 +1,11 @@ +# +# Copyright 2026 u-blox +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_ARM_MPU=y +CONFIG_TRUSTED_EXECUTION_SECURE=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y From 65548dfb38d52547d170b0badd08d8e32476c8e9 Mon Sep 17 00:00:00 2001 From: Lucien Zhao Date: Sun, 4 Jan 2026 16:48:27 +0800 Subject: [PATCH 1730/3334] [nrf fromtree] dts: nxp: nxp_mcxe24x_common.dtsi: add uuid/hwinfo feature - add uuid and rcm-hwinfo feature - test passed for hwinfo_api case on mcxe24x platform Signed-off-by: Lucien Zhao (cherry picked from commit 663961321393322208a79fb5680952cf66fa25d3) Signed-off-by: Robert Lubos --- dts/arm/nxp/nxp_mcxe24x_common.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dts/arm/nxp/nxp_mcxe24x_common.dtsi b/dts/arm/nxp/nxp_mcxe24x_common.dtsi index feff15d88f65..36ab6c38185a 100644 --- a/dts/arm/nxp/nxp_mcxe24x_common.dtsi +++ b/dts/arm/nxp/nxp_mcxe24x_common.dtsi @@ -643,6 +643,11 @@ clocks = <&pcc 0x134 KINETIS_PCC_SRC_NONE_OR_EXT>; }; + rcm: rcm@4007F000 { + compatible = "nxp,rcm-hwinfo"; + reg = <0x4007F000 0x1000>; + }; + rtc: rtc@4003d000 { compatible = "nxp,rtc"; reg = <0x4003d000 0x1000>; @@ -705,6 +710,11 @@ reg = <0x40032000 0x1000>; status = "disabled"; }; + + uuid: uuid@40048000 { + compatible = "nxp,sim-uuid"; + reg = <0x40048000 0x1000>; + }; }; }; From d45a420465699d1896d92a58e73f0ff74e0fc37e Mon Sep 17 00:00:00 2001 From: Camille BAUD Date: Fri, 31 Oct 2025 02:06:29 +0100 Subject: [PATCH 1731/3334] [nrf fromtree] dts: adc: add bindings for bflb adc Adds the bindings for the GPADC Signed-off-by: Camille BAUD (cherry picked from commit 33196ff3cdd973248c0a277fd99eb125dc53eece) Signed-off-by: Robert Lubos --- dts/bindings/adc/bflb,adc.yaml | 23 +++++++++++++++++++++++ dts/riscv/bflb/bl60x.dtsi | 15 ++++++++++++++- dts/riscv/bflb/bl61x.dtsi | 15 ++++++++++++++- dts/riscv/bflb/bl70x.dtsi | 15 ++++++++++++++- 4 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 dts/bindings/adc/bflb,adc.yaml diff --git a/dts/bindings/adc/bflb,adc.yaml b/dts/bindings/adc/bflb,adc.yaml new file mode 100644 index 000000000000..b4a8388ece72 --- /dev/null +++ b/dts/bindings/adc/bflb,adc.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) +# +# SPDX-License-Identifier: Apache-2.0 + +description: | + Bouffalolab ADC + +compatible: "bflb,adc" + +include: [adc-controller.yaml, pinctrl-device.yaml] + +properties: + reg: + required: true + + interrupts: + required: true + + "#io-channel-cells": + const: 1 + +io-channel-cells: + - input diff --git a/dts/riscv/bflb/bl60x.dtsi b/dts/riscv/bflb/bl60x.dtsi index d6f8429c7987..4ab191e8d149 100644 --- a/dts/riscv/bflb/bl60x.dtsi +++ b/dts/riscv/bflb/bl60x.dtsi @@ -1,6 +1,6 @@ /* * Copyright (c) 2021-2025 ATL Electronics - * Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2024-2026 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -15,6 +15,7 @@ #include #include #include +#include / { #address-cells = <1>; @@ -145,6 +146,18 @@ "pll_120", "pll_48"; }; + adc0: adc@40002000 { + compatible = "bflb,adc"; + reg = <0x40002000 0x1000 0x4000F000 0x1000>; + #io-channel-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + interrupts = <41 0>; + interrupt-parent = <&clic>; + }; + efuse: efuse@40007000 { compatible = "bflb,efuse"; reg = <0x40007000 0x1000>; diff --git a/dts/riscv/bflb/bl61x.dtsi b/dts/riscv/bflb/bl61x.dtsi index be944d11a907..f63d472ec28a 100644 --- a/dts/riscv/bflb/bl61x.dtsi +++ b/dts/riscv/bflb/bl61x.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2024-2026 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -14,6 +14,7 @@ #include #include #include +#include / { #address-cells = <1>; @@ -160,6 +161,18 @@ "root", "bclk", "flash"; }; + adc0: adc@20002000 { + compatible = "bflb,adc"; + reg = <0x20002000 0x400 0x2000F000 0x1000>; + #io-channel-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + interrupts = <41 1>; + interrupt-parent = <&clic>; + }; + uart0: uart@2000a000 { compatible = "bflb,uart"; reg = <0x2000a000 0x100>; diff --git a/dts/riscv/bflb/bl70x.dtsi b/dts/riscv/bflb/bl70x.dtsi index 4956750ea14a..1e6aadac74cf 100644 --- a/dts/riscv/bflb/bl70x.dtsi +++ b/dts/riscv/bflb/bl70x.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2024-2026 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -14,6 +14,7 @@ #include #include #include +#include / { #address-cells = <1>; @@ -150,6 +151,18 @@ "dll_120", "dll_57"; }; + adc0: adc@40002000 { + compatible = "bflb,adc"; + reg = <0x40002000 0x1000 0x4000F000 0x1000>; + #io-channel-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + interrupts = <41 0>; + interrupt-parent = <&clic>; + }; + efuse: efuse@40007000 { compatible = "bflb,efuse"; reg = <0x40007000 0x1000>; From a1fc171a6fece30aff57bcbf5b7b784b19993094 Mon Sep 17 00:00:00 2001 From: Kyle Bonnici Date: Tue, 16 Dec 2025 13:36:04 +0100 Subject: [PATCH 1732/3334] [nrf fromtree] dts: use lowercase hex values in DTS files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply chnages from dts-linter 0.3.9. Improve compliance with DTS Coding Style which says that: 4) Hex values in properties, e.g. “reg”, shall use lowercase hex. The address part can be padded with leading zeros. Signed-off-by: Kyle Bonnici (cherry picked from commit f55358bcbfcfc4e7bd7d5c00bf6a16a13f01e8f6) Signed-off-by: Robert Lubos --- .../adafruit_feather_esp32s2_tft.dts | 6 +- .../adafruit_feather_esp32s2_tft_reverse.dts | 6 +- .../adafruit_feather_esp32s3_tft_procpu.dts | 6 +- ...uit_feather_esp32s3_tft_reverse_procpu.dts | 6 +- .../adafruit_macropad_rp2040.dts | 2 +- .../nrf52_adafruit_feather.dts | 4 +- .../trinket_m0/adafruit_trinket_m0.dts | 2 +- .../adi/apard32690/apard32690_max32690_m4.dts | 6 +- .../eval_adin1110ebz/adi_eval_adin1110ebz.dts | 6 +- .../eval_adin2111ebz/adi_eval_adin2111ebz.dts | 8 +- .../aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi | 4 +- .../aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi | 4 +- .../alientek/dnesp32s3b/dnesp32s3b_procpu.dts | 2 +- boards/ambiq/apollo510_evb/apollo510_evb.dts | 6 +- boards/amd/versal2_rpu/versal2_rpu-qemu.dts | 42 +-- .../amd/versalnet_apu/versalnet_apu-qemu.dts | 28 +- boards/arduino/mkrzero/arduino_mkrzero.dts | 2 +- .../nano_33_iot/arduino_nano_33_iot.dts | 2 +- .../nano_matter/arduino_nano_matter.dts | 6 +- .../portenta_c33/arduino_portenta_c33.dts | 4 +- .../arduino_portenta_h7_stm32h747xx_m7.dts | 4 +- boards/arduino/uno_r4/arduino_uno_r4.dts | 2 +- boards/arm/mps2/mps2_an521_cpu1.dts | 4 +- boards/bbc/microbit_v2/bbc_microbit_v2.dts | 10 +- .../blueclover_plt_demo_v2_nrf52832.dts | 4 +- .../beagleconnect_freedom.dts | 2 +- boards/blues/swan_r5/swan_r5.dts | 4 +- .../bytesatwork/bytesensi_l/bytesensi_l.dts | 4 +- .../croxel_cx1825/croxel_cx1825_nrf52840.dts | 4 +- .../ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts | 4 +- .../esp32s3_eye/esp32s3_eye_procpu.dts | 8 +- .../bl5340_dvk_nrf5340_cpuapp_common.dtsi | 2 +- .../bl5340_dvk_nrf5340_cpunet_common.dtsi | 2 +- boards/ezurio/bl652_dvk/bl652_dvk.dts | 4 +- boards/ezurio/bl653_dvk/bl653_dvk.dts | 10 +- boards/ezurio/bt610/bt610.dts | 12 +- boards/ezurio/mg100/mg100.dts | 8 +- .../pinnacle_100_dvk/pinnacle_100_dvk.dts | 8 +- boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts | 6 +- boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts | 8 +- .../quill_nrf52840_mesh_common.dtsi | 16 +- boards/focaltech/ft9001_eval/ft9001_eval.dts | 2 +- .../heltec_wireless_tracker_procpu.dts | 28 +- boards/holyiot/yj17095/holyiot_yj17095.dts | 2 +- .../cyw920829m2evk_02-memory_map.dtsi | 4 +- .../kit_pse84_ai/kit_pse84_ai_memory_map.dtsi | 2 +- boards/kws/pico2_spe/pico2_spe.dtsi | 2 +- boards/kws/pico_spe/pico_spe.dts | 2 +- .../lilygo/tdongle_s3/tdongle_s3_procpu.dts | 12 +- .../m5stack_atoms3/m5stack_atoms3_procpu.dts | 2 +- .../m5stickc_plus/m5stickc_plus_procpu.dts | 2 +- .../makerdiary/nrf52832_mdk/nrf52832_mdk.dts | 4 +- boards/native/native_sim/native_sim.dts | 4 +- .../nordic/nrf21540dk/nrf21540dk_nrf52840.dts | 4 +- .../nordic/nrf52833dk/nrf52833dk_nrf52820.dts | 6 +- .../nordic/nrf52833dk/nrf52833dk_nrf52833.dts | 6 +- .../nordic/nrf52840dk/nrf52840dk_nrf52811.dts | 2 +- boards/nordic/nrf52dk/nrf52dk_nrf52805.dts | 2 +- boards/nordic/nrf52dk/nrf52dk_nrf52810.dts | 2 +- boards/nordic/nrf52dk/nrf52dk_nrf52832.dts | 2 +- .../nrf5340_audio_dk_nrf5340_cpunet.dts | 4 +- .../nrf5340dk/nrf5340dk_nrf5340_cpunet.dts | 2 +- .../nrf7002dk/nrf7002dk_nrf5340_cpunet.dts | 2 +- .../nrf7120dk/nrf7120_cpuapp_common.dtsi | 6 +- .../nrf9280pdk_nrf9280-memory_map.dtsi | 8 +- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 2 +- boards/nordic/thingy52/thingy52_nrf52832.dts | 4 +- .../thingy53/thingy53_nrf5340_cpunet.dts | 2 +- boards/nxp/frdm_k22f/frdm_k22f.dts | 8 +- boards/nxp/frdm_mcxa153/frdm_mcxa153.dts | 4 +- boards/nxp/frdm_mcxa344/frdm_mcxa344.dts | 4 +- boards/nxp/frdm_mcxa577/frdm_mcxa577.dts | 4 +- boards/nxp/frdm_mcxc444/frdm_mcxc444.dts | 2 +- boards/nxp/frdm_mcxn236/frdm_mcxn236.dts | 4 +- boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi | 4 +- .../frdm_mcxn947_mcxn947_cpu0_ns.dts | 4 +- .../frdm_mcxw23/dts/bypass_first_32k.overlay | 2 +- boards/nxp/frdm_mcxw71/frdm_mcxw71.dts | 12 +- .../frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts | 8 +- .../nxp/imx95_evk/imx95_evk_mimx9596_m7.dts | 4 +- .../nxp/lpcxpresso55s28/lpcxpresso55s28.dts | 4 +- boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi | 4 +- .../mcxw23_evk/dts/bypass_first_32k.overlay | 2 +- .../mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts | 8 +- boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts | 4 +- boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts | 4 +- boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts | 4 +- .../mimxrt1060_evk_mimxrt1062_qspi_C.overlay | 6 +- boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi | 4 +- boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi | 4 +- .../mimxrt1170_evk_mimxrt1176_cm4_B.overlay | 4 +- .../mimxrt1170_evk_mimxrt1176_cm7_B.overlay | 4 +- boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi | 4 +- .../mimxrt700_evk_mimxrt798s_cm33_cpu0.dts | 4 +- .../dts/goworld_16880_lcm.overlay | 12 +- boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts | 8 +- boards/nxp/twr_kv58f220m/twr_kv58f220m.dts | 8 +- .../rv32m1_vega_openisa_rv32m1_ri5cy.dts | 2 +- boards/panasonic/pan1770_evb/pan1770_evb.dts | 4 +- boards/panasonic/pan1780_evb/pan1780_evb.dts | 4 +- boards/panasonic/pan1782_evb/pan1782_evb.dts | 10 +- .../pan1783_nrf5340_cpunet_common.dtsi | 2 +- boards/phytec/reel_board/reel_board.dts | 6 +- .../reel_board/reel_board_nrf52840_2.overlay | 2 +- .../pinetime_devkit0/pinetime_devkit0.dts | 10 +- .../decawave_dwm1001_dev.dts | 4 +- .../decawave_dwm3001cdk.dts | 6 +- .../raytac_an7002q_db_nrf5340_cpunet.dts | 2 +- ...tac_mdbt53_db_40_nrf5340_cpunet_common.dts | 2 +- ...ac_mdbt53v_db_40_nrf5340_cpunet_common.dts | 2 +- .../renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts | 2 +- .../dts/da14695_dk_usb_psram.overlay | 8 +- .../dts/da1469x_dk_pro_psram.overlay | 8 +- boards/renesas/ek_ra2a1/ek_ra2a1.dts | 2 +- boards/renesas/ek_ra4e2/ek_ra4e2.dts | 2 +- boards/renesas/ek_ra4m2/ek_ra4m2.dts | 2 +- boards/renesas/ek_ra4m3/ek_ra4m3.dts | 2 +- boards/renesas/ek_ra6e2/ek_ra6e2.dts | 2 +- boards/renesas/ek_ra6m1/ek_ra6m1.dts | 2 +- boards/renesas/ek_ra6m2/ek_ra6m2.dts | 2 +- boards/renesas/ek_ra6m3/ek_ra6m3.dts | 2 +- boards/renesas/ek_ra6m4/ek_ra6m4.dts | 4 +- boards/renesas/ek_ra6m5/ek_ra6m5.dts | 4 +- boards/renesas/ek_ra8d1/ek_ra8d1.dts | 4 +- boards/renesas/ek_ra8m1/ek_ra8m1.dts | 4 +- boards/renesas/ek_rx261/ek_rx261.dts | 2 +- boards/renesas/fpb_ra4e1/fpb_ra4e1.dts | 2 +- boards/renesas/fpb_ra6e1/fpb_ra6e1.dts | 2 +- boards/renesas/fpb_ra6e2/fpb_ra6e2.dts | 2 +- boards/renesas/fpb_rx261/fpb_rx261.dts | 2 +- boards/renesas/mck_ra8t1/mck_ra8t1.dts | 4 +- boards/renesas/rsk_rx130/rsk_rx130.dts | 2 +- boards/renesas/rza2m_evk/rza2m_evk.dts | 4 +- boards/renesas/voice_ra4e1/voice_ra4e1.dts | 2 +- boards/ruiside/art_pi/art_pi.dts | 10 +- .../ra8d1_vision_board/ra8d1_vision_board.dts | 2 +- boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts | 4 +- boards/seeed/xiao_mg24/xiao_mg24.dts | 6 +- .../abrobot_sh1106_72x40.overlay | 2 +- .../arduino_giga_display_shield.overlay | 30 +-- .../mimxrt595_evk_mimxrt595s_cm33.overlay | 4 +- .../lcd_par_s035/lcd_par_s035_8080.overlay | 12 +- .../lcd_par_s035/lcd_par_s035_spi.overlay | 12 +- .../m5stack_cardputer.overlay | 2 +- .../boards/rssk_ra2l1.overlay | 10 +- .../rtk0eg0019b01002bj.overlay | 6 +- .../st7789v_tl019fqv01.overlay | 8 +- .../st7789v_waveshare_240x240.overlay | 8 +- .../waveshare_epaper_gdeh0213b1.overlay | 6 +- .../waveshare_epaper_gdeh0213b72.overlay | 2 +- .../waveshare_epaper_gdeh029a1.overlay | 4 +- .../waveshare_epaper_gdew042t2-p.overlay | 10 +- .../waveshare_pico_lcd_1_14_display.overlay | 2 +- .../bg29_rb4420a/bg29_rb4420a.dts | 6 +- .../radio_boards/slwrb4180b/slwrb4180b.dts | 6 +- .../xg29_rb4412a/xg29_rb4412a.dts | 6 +- .../longan_nano/longan_nano-common.dtsi | 18 +- boards/sipeed/maix_m0s_dock/maix_m0s.dtsi | 4 +- .../sparkfun/micromod/micromod_nrf52840.dts | 4 +- .../st/stm32f429i_disc1/stm32f429i_disc1.dts | 2 +- .../stm32h573i_dk/stm32h573i_dk-common.dtsi | 6 +- .../stm32l562e_dk/stm32l562e_dk_common.dtsi | 6 +- boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts | 4 +- .../ubx_bmd300eval_nrf52832.dts | 4 +- .../ubx_bmd330eval_nrf52810.dts | 2 +- .../ubx_bmd360eval_nrf52811.dts | 2 +- .../ubx_evkannab1/ubx_evkannab1_nrf52832.dts | 4 +- .../ubx_evkninab1/ubx_evkninab1_nrf52832.dts | 4 +- .../ubx_evkninab4/ubx_evkninab4_nrf52833.dts | 10 +- .../ubx_evkninab5/ubx_evkninab5_mcxw716c.dts | 8 +- boards/waveshare/rp2040_geek/rp2040_geek.dts | 8 +- .../we/ophelia1ev/we_ophelia1ev_nrf52805.dts | 2 +- .../we/proteus2ev/we_proteus2ev_nrf52832.dts | 4 +- .../weact/mini_stm32h743/mini_stm32h743.dts | 20 +- .../weact/mini_stm32h7b0/mini_stm32h7b0.dts | 20 +- boards/witte/linum/linum.dts | 6 +- doc/contribute/style/style-example.dts | 16 +- dts/arc/synopsys/emsk.dtsi | 4 +- dts/arm/ambiq/ambiq_apollo3_blue.dtsi | 8 +- dts/arm/ambiq/ambiq_apollo3p_blue.dtsi | 10 +- dts/arm/ambiq/ambiq_apollo4p.dtsi | 16 +- dts/arm/ambiq/ambiq_apollo4p_blue.dtsi | 16 +- dts/arm/ambiq/ambiq_apollo510.dtsi | 4 +- dts/arm/atmel/samc2x.dtsi | 10 +- dts/arm/atmel/samd2x.dtsi | 14 +- dts/arm/atmel/samd5x.dtsi | 12 +- dts/arm/atmel/saml21.dtsi | 2 +- dts/arm/atmel/saml2x.dtsi | 10 +- dts/arm/atmel/samx7x.dtsi | 6 +- dts/arm/elan/em32fxxx.dtsi | 4 +- dts/arm/ene/kb106x/kb1064.dtsi | 12 +- dts/arm/ene/kb106x/kb106x.dtsi | 2 +- dts/arm/ene/kb1200.dtsi | 2 +- dts/arm/gd/gd32a50x/gd32a50x.dtsi | 2 +- dts/arm/gd/gd32e10x/gd32e10x.dtsi | 2 +- dts/arm/gd/gd32e50x/gd32e50x.dtsi | 2 +- dts/arm/gd/gd32f3x0/gd32f3x0.dtsi | 2 +- dts/arm/gd/gd32f403/gd32f403.dtsi | 2 +- dts/arm/gd/gd32f4xx/gd32f4xx.dtsi | 2 +- dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi | 4 +- dts/arm/intel_socfpga_std/socfpga.dtsi | 2 +- dts/arm/microchip/mec/mec1501hsz.dtsi | 12 +- dts/arm/microchip/mec/mec1727nsz.dtsi | 2 +- dts/arm/microchip/mec/mec172x_common.dtsi | 14 +- dts/arm/microchip/mec/mec172xnlj.dtsi | 2 +- dts/arm/microchip/mec/mec172xnsz.dtsi | 2 +- dts/arm/microchip/mec/mec5.dtsi | 2 +- .../pic32c/pic32cx_sg/common/pic32cx_sg.dtsi | 2 +- .../sam/sam_d5x_e5x/common/samd5xe5x.dtsi | 2 +- dts/arm/nuvoton/m46x.dtsi | 2 +- dts/arm/nuvoton/npck/npck-alts-map.dtsi | 8 +- dts/arm/nuvoton/npck/npck.dtsi | 12 +- dts/arm/nuvoton/npck/npck3.dtsi | 4 +- dts/arm/nuvoton/npck3m8k.dtsi | 4 +- dts/arm/nuvoton/npcx/npcx-alts-map.dtsi | 66 ++--- dts/arm/nuvoton/npcx/npcx.dtsi | 14 +- dts/arm/nuvoton/npcx/npcx4.dtsi | 14 +- .../nuvoton/npcx/npcx4/npcx4-alts-map.dtsi | 14 +- dts/arm/nuvoton/npcx/npcx7.dtsi | 6 +- .../nuvoton/npcx/npcx7/npcx7-alts-map.dtsi | 12 +- .../npcx/npcx7/npcx7-miwus-int-map.dtsi | 2 +- dts/arm/nuvoton/npcx/npcx9.dtsi | 10 +- .../nuvoton/npcx/npcx9/npcx9-alts-map.dtsi | 8 +- dts/arm/nuvoton/npcx4m3f.dtsi | 2 +- dts/arm/nuvoton/npcx4m8f.dtsi | 2 +- dts/arm/nuvoton/npcx7m6fb.dtsi | 4 +- dts/arm/nuvoton/npcx7m6fc.dtsi | 4 +- dts/arm/nuvoton/npcx7m7fc.dtsi | 4 +- dts/arm/nuvoton/npcx9m3f.dtsi | 2 +- dts/arm/nuvoton/npcx9m6f.dtsi | 2 +- dts/arm/nuvoton/npcx9m7f.dtsi | 2 +- dts/arm/nuvoton/npcx9m7fb.dtsi | 4 +- dts/arm/nuvoton/npcx9mfp.dtsi | 4 +- dts/arm/nxp/nxp_imx95_m7.dtsi | 2 +- dts/arm/nxp/nxp_k2x.dtsi | 16 +- dts/arm/nxp/nxp_k32l2b3.dtsi | 10 +- dts/arm/nxp/nxp_k6x.dtsi | 18 +- dts/arm/nxp/nxp_k8x.dtsi | 8 +- dts/arm/nxp/nxp_ke1xz.dtsi | 2 +- dts/arm/nxp/nxp_kl25z.dtsi | 8 +- dts/arm/nxp/nxp_kv5x.dtsi | 4 +- dts/arm/nxp/nxp_kw2xd.dtsi | 8 +- dts/arm/nxp/nxp_kw40z.dtsi | 12 +- dts/arm/nxp/nxp_kw41z.dtsi | 20 +- dts/arm/nxp/nxp_lpc11u6x.dtsi | 6 +- dts/arm/nxp/nxp_lpc54xxx.dtsi | 2 +- dts/arm/nxp/nxp_lpc55S0x_common.dtsi | 4 +- dts/arm/nxp/nxp_lpc55S1x_common.dtsi | 4 +- dts/arm/nxp/nxp_lpc55S2x_common.dtsi | 4 +- dts/arm/nxp/nxp_lpc55S3x_common.dtsi | 12 +- dts/arm/nxp/nxp_lpc55S6x_common.dtsi | 22 +- dts/arm/nxp/nxp_mcxa153.dtsi | 4 +- dts/arm/nxp/nxp_mcxa156.dtsi | 4 +- dts/arm/nxp/nxp_mcxa344.dtsi | 4 +- dts/arm/nxp/nxp_mcxaxx6_common.dtsi | 4 +- dts/arm/nxp/nxp_mcxc141.dtsi | 2 +- dts/arm/nxp/nxp_mcxc142.dtsi | 2 +- dts/arm/nxp/nxp_mcxc242.dtsi | 2 +- dts/arm/nxp/nxp_mcxc444.dtsi | 2 +- dts/arm/nxp/nxp_mcxc_common.dtsi | 12 +- dts/arm/nxp/nxp_mcxe24x_common.dtsi | 4 +- dts/arm/nxp/nxp_mcxn23x_common.dtsi | 4 +- dts/arm/nxp/nxp_mcxw72.dtsi | 8 +- dts/arm/nxp/nxp_rt1010.dtsi | 22 +- dts/arm/nxp/nxp_rt10xx.dtsi | 66 ++--- dts/arm/nxp/nxp_rt118x.dtsi | 54 ++-- dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi | 4 +- dts/arm/nxp/nxp_rt11xx.dtsi | 6 +- dts/arm/nxp/nxp_rt5xx_common.dtsi | 4 +- dts/arm/nxp/nxp_rt7xx_common.dtsi | 4 +- dts/arm/nxp/nxp_rw6xx_common.dtsi | 4 +- dts/arm/nxp/nxp_s32k344_m7.dtsi | 36 +-- dts/arm/nxp/nxp_s32k566.dtsi | 36 +-- dts/arm/nxp/nxp_s32z27x_r52.dtsi | 26 +- dts/arm/realtek/amebad/amebad.dtsi | 2 +- dts/arm/realtek/ec/rts5912.dtsi | 36 +-- dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi | 4 +- dts/arm/renesas/ra/ra8/ra8x1.dtsi | 4 +- dts/arm/renesas/ra/ra8/ra8x2.dtsi | 6 +- dts/arm/renesas/rz/rza/r7s9210.dtsi | 2 +- dts/arm/renesas/rz/rzg/r9a07g044.dtsi | 2 +- dts/arm/renesas/rz/rzg/r9a08g045.dtsi | 6 +- dts/arm/renesas/rz/rzn/r9a07g084.dtsi | 14 +- dts/arm/renesas/rz/rzt/r9a07g074.dtsi | 14 +- dts/arm/renesas/rz/rzt/r9a07g075.dtsi | 14 +- dts/arm/renesas/rz/rzv/r9a07g054.dtsi | 2 +- dts/arm/renesas/rz/rzv/r9a09g056.dtsi | 6 +- dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi | 2 +- dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi | 4 +- dts/arm/renesas/smartbond/da1469x.dtsi | 10 +- dts/arm/silabs/gg11/efm32gg11.dtsi | 4 +- .../silabs/gg11/efm32gg11b820f2048gl192.dtsi | 2 +- dts/arm/silabs/gg12/efm32gg12.dtsi | 4 +- dts/arm/silabs/siwg917.dtsi | 12 +- dts/arm/silabs/xg12/xg12.dtsi | 4 +- dts/arm/silabs/xg13/efr32xg13.dtsi | 4 +- dts/arm/st/f1/stm32f103Xc.dtsi | 2 +- dts/arm/st/f3/stm32f302.dtsi | 2 +- dts/arm/ti/cc32xx.dtsi | 2 +- dts/arm/ti/mspm0/g/mspm0g1518.dtsi | 2 +- dts/arm/ti/mspm0/g/mspm0g1519.dtsi | 2 +- dts/arm/ti/mspm0/g/mspm0g3518.dtsi | 2 +- dts/arm/ti/mspm0/g/mspm0g3519.dtsi | 2 +- dts/arm/xilinx/zynq7000.dtsi | 4 +- dts/arm64/intel/intel_socfpga_agilex5.dtsi | 30 +-- dts/arm64/nxp/nxp_mimx8mm_a53.dtsi | 2 +- dts/arm64/nxp/nxp_mimx8mn_a53.dtsi | 2 +- dts/arm64/nxp/nxp_mimx8mp_a53.dtsi | 2 +- dts/riscv/andes/andes_v5_ae350.dtsi | 6 +- dts/riscv/bflb/bl60x.dtsi | 2 +- dts/riscv/bflb/bl61x.dtsi | 6 +- dts/riscv/bflb/bl70x.dtsi | 2 +- dts/riscv/efinix/sapphire_soc.dtsi | 4 +- .../espressif/esp32c2/esp32c2_common.dtsi | 6 +- .../espressif/esp32c3/esp32c3_common.dtsi | 6 +- .../espressif/esp32c6/esp32c6_common.dtsi | 16 +- .../espressif/esp32h2/esp32h2_common.dtsi | 18 +- dts/riscv/gd/gd32vf103.dtsi | 2 +- dts/riscv/ite/it81xx2.dtsi | 2 +- dts/riscv/ite/it82xx2.dtsi | 6 +- dts/riscv/microchip/mpfs.dtsi | 2 +- dts/riscv/telink/telink_b91.dtsi | 10 +- dts/riscv/wch/ch32v0/ch32v006.dtsi | 4 +- dts/riscv/wch/ch32v203/ch32v203.dtsi | 4 +- dts/riscv/wch/ch32v203/ch32v203c8t.dtsi | 2 +- dts/riscv/wch/ch32v203/ch32v203rbt.dtsi | 2 +- dts/riscv/wch/ch32v208/ch32v208.dtsi | 6 +- dts/riscv/wch/ch32v303/ch32v303.dtsi | 6 +- dts/riscv/wch/ch32v307/ch32v307.dtsi | 6 +- dts/rx/renesas/r5f51308axfp.dtsi | 2 +- dts/rx/renesas/r5f52618bgfp.dtsi | 2 +- dts/rx/renesas/r5f526tfddfp.dtsi | 2 +- dts/rx/renesas/rx-qemu.dtsi | 6 +- dts/rx/renesas/rx130-common.dtsi | 208 +++++++-------- dts/rx/renesas/rx261-common.dtsi | 182 ++++++------- dts/rx/renesas/rx26t-common.dtsi | 252 +++++++++--------- .../espressif/partitions_0x0_amp_128M.dtsi | 16 +- .../espressif/partitions_0x0_amp_16M.dtsi | 16 +- .../espressif/partitions_0x0_amp_2M.dtsi | 12 +- .../espressif/partitions_0x0_amp_32M.dtsi | 16 +- .../espressif/partitions_0x0_amp_4M.dtsi | 12 +- .../espressif/partitions_0x0_amp_64M.dtsi | 16 +- .../espressif/partitions_0x0_amp_8M.dtsi | 16 +- .../partitions_0x0_default_128M.dtsi | 12 +- .../espressif/partitions_0x0_default_16M.dtsi | 12 +- .../espressif/partitions_0x0_default_2M.dtsi | 12 +- .../espressif/partitions_0x0_default_32M.dtsi | 12 +- .../espressif/partitions_0x0_default_4M.dtsi | 12 +- .../espressif/partitions_0x0_default_64M.dtsi | 12 +- .../espressif/partitions_0x0_default_8M.dtsi | 12 +- .../espressif/partitions_0x1000_amp_128M.dtsi | 16 +- .../espressif/partitions_0x1000_amp_16M.dtsi | 16 +- .../espressif/partitions_0x1000_amp_2M.dtsi | 12 +- .../espressif/partitions_0x1000_amp_32M.dtsi | 16 +- .../espressif/partitions_0x1000_amp_4M.dtsi | 12 +- .../espressif/partitions_0x1000_amp_64M.dtsi | 16 +- .../espressif/partitions_0x1000_amp_8M.dtsi | 16 +- .../partitions_0x1000_default_128M.dtsi | 12 +- .../partitions_0x1000_default_16M.dtsi | 12 +- .../partitions_0x1000_default_2M.dtsi | 12 +- .../partitions_0x1000_default_32M.dtsi | 12 +- .../partitions_0x1000_default_4M.dtsi | 12 +- .../partitions_0x1000_default_64M.dtsi | 12 +- .../partitions_0x1000_default_8M.dtsi | 12 +- dts/vendor/nordic/nrf52840_partition.dtsi | 4 +- .../nordic/nrf52840_partition_uf2_sdv6.dtsi | 2 +- .../nordic/nrf52840_partition_uf2_sdv7.dtsi | 2 +- dts/vendor/nordic/nrf54h20.dtsi | 24 +- .../nordic/nrf54l10_cpuapp_ns_partition.dtsi | 8 +- .../nordic/nrf54l15_cpuapp_ns_partition.dtsi | 4 +- dts/vendor/nordic/nrf54lm20a.dtsi | 4 +- .../nrf54lm20a_cpuapp_ns_partition.dtsi | 8 +- .../nordic/nrf7120_cpuapp_ns_partition.dtsi | 8 +- .../raspberrypi/partitions_2M_sysbuild.dtsi | 4 +- dts/x86/intel/alder_lake.dtsi | 14 +- dts/x86/intel/raptor_lake_p.dtsi | 2 +- dts/xtensa/espressif/esp32/esp32_common.dtsi | 6 +- .../espressif/esp32s2/esp32s2_common.dtsi | 2 +- .../espressif/esp32s3/esp32s3_common.dtsi | 2 +- dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi | 14 +- dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi | 18 +- dts/xtensa/intel/intel_adsp_ace30.dtsi | 18 +- dts/xtensa/intel/intel_adsp_ace40.dtsi | 18 +- dts/xtensa/intel/intel_adsp_cavs.dtsi | 2 +- dts/xtensa/intel/intel_adsp_cavs25.dtsi | 26 +- dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi | 16 +- .../blinky_pwm/boards/frdm_mcxc242.overlay | 4 +- .../rzg3s_smarc_r9a08g045s33gbg_cm33.overlay | 24 +- .../rzv2l_smarc_r9a07g054l23gbg_cm33.overlay | 24 +- .../adc_sequence/boards/stm32f3_disco.overlay | 4 +- .../boards/qemu_cortex_a53.overlay | 6 +- .../led/pwm/boards/frdm_mcxc242.overlay | 4 +- .../lpcxpresso55s69_lpc55s69_cpu0.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu1.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu0.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu1.overlay | 2 +- .../drivers/memc/boards/apollo3p_evb.overlay | 2 +- .../mspi_async/boards/apollo3p_evb.overlay | 2 +- .../mspi_flash/boards/apollo3p_evb.overlay | 4 +- .../mspi_flash/boards/b_u585i_iot02a.overlay | 4 +- .../mspi_flash/boards/stm32h573i_dk.overlay | 4 +- .../boards/stm32h735g_disco.overlay | 4 +- .../boards/stm32l496g_disco.overlay | 2 +- .../pwm/capture/boards/lp_mspm0g3507.overlay | 2 +- .../fdc2x1x/boards/nrf9160dk_nrf9160.overlay | 4 +- .../tmp11x/boards/nucleo_f401re.overlay | 2 +- .../boards/nrf52840dk_nrf52840.overlay | 2 +- .../instrumentation/boards/mps2_an385.overlay | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 4 +- .../nrf5340dk_nrf5340_cpuapp_icbmsg.overlay | 4 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 +- .../boards/nrf5340dk_nrf5340_cpunet.overlay | 4 +- .../nrf5340dk_nrf5340_cpunet_icbmsg.overlay | 4 +- .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 4 +- .../lpcxpresso55s69_lpc55s69_cpu0.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu1.overlay | 2 +- .../boards/frdm_mcxn947_mcxn947_cpu0.overlay | 2 +- .../boards/mcx_n9xx_evk_mcxn947_cpu0.overlay | 2 +- .../openamp/boards/mps2_an521_cpu0.overlay | 4 +- .../boards/frdm_mcxn947_mcxn947_cpu1.overlay | 2 +- .../boards/mcx_n9xx_evk_mcxn947_cpu1.overlay | 2 +- .../remote/boards/mps2_an521_cpu1.overlay | 4 +- .../boards/mps2_an521_cpu0.overlay | 4 +- .../remote/boards/mps2_an521_cpu1.overlay | 4 +- ...mimxrt1050_evk_hyperflash_ram_load.overlay | 4 +- .../nrf52840dk_nrf52840_ram_load.overlay | 4 +- .../audio_headphones_microphone/app.overlay | 2 +- .../usb/legacy/audio_headset/app.overlay | 2 +- .../nucleo_l552ze_q_stm32l552xx_ns.overlay | 2 +- scripts/dts/python-devicetree/tests/test.dts | 56 ++-- .../ram_context_for_isr/app.overlay | 4 +- .../nucleo_l552ze_q_stm32l552xx_ns.overlay | 4 +- .../boards/nrf52840dk_nrf52840.overlay | 4 +- .../boards/nrf52840dk_nrf52840_mem.overlay | 4 +- .../native_sim_native_one.dts | 4 +- .../comparator/nxp_cmp/frdm_mcxc242.overlay | 2 +- tests/drivers/build_all/dac/app.overlay | 12 +- tests/drivers/build_all/display/app.overlay | 16 +- .../build_all/ethernet/spi_devices.overlay | 6 +- .../gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay | 4 +- .../i2c/boards/qemu_cortex_m3.overlay | 4 +- tests/drivers/build_all/sensor/i2c.dtsi | 2 +- tests/drivers/build_all/sensor/i3c.dtsi | 28 +- tests/drivers/build_all/sensor/spi.dtsi | 2 +- .../sbs_charger/boards/emulated_board.overlay | 2 +- .../boards/qemu_cortex_a53.overlay | 2 +- .../coredump_api/boards/qemu_riscv32.overlay | 2 +- .../boards/intel_btl_s_crb.overlay | 2 +- .../boards/intel_ptl_h_crb.overlay | 2 +- .../disk_access/boards/qemu_x86_64.overlay | 2 +- .../boards/intel_btl_s_crb.overlay | 2 +- .../boards/qemu_x86_64.overlay | 2 +- .../flash/common/boards/ek_ra6m2.overlay | 4 +- .../flash/common/boards/ek_ra6m3.overlay | 4 +- .../flash/common/boards/ek_ra6m4.overlay | 4 +- .../flash/common/boards/ek_ra6m5.overlay | 4 +- .../flash/common/boards/ek_ra8d1.overlay | 4 +- .../flash/common/boards/ek_ra8m1.overlay | 4 +- .../flash/common/boards/fpb_ra6e1.overlay | 4 +- .../flash/common/boards/mck_ra8t1.overlay | 4 +- .../boards/nrf52840dk_mx25l51245g.overlay | 2 +- .../common/boards/nrf52840dk_spi_nor.overlay | 2 +- .../boards/nrf52840dk_spi_nor_wp_hold.overlay | 2 +- .../boards/nucleo_f411re.overlay | 4 +- .../boards/mps2_an385.overlay | 4 +- .../sbs_gauge/boards/emulated_board.overlay | 2 +- .../sbs_gauge/boards/qemu_cortex_a53.overlay | 2 +- .../boards/nrf54l_sense_edge.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu0.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu1.overlay | 2 +- .../rzg3s_smarc_r9a08g045s33gbg_cm33.overlay | 20 +- .../rzv2l_smarc_r9a07g054l23gbg_cm33.overlay | 20 +- .../mspi/flash/boards/apollo3p_evb.overlay | 2 +- .../mspi/flash/boards/native_sim.overlay | 4 +- .../boards/nrf52840dk_nrf52840_ram.overlay | 4 +- .../api/boards/qemu_cortex_m3.overlay | 4 +- .../sbs_gauge/boards/native_sim.overlay | 2 +- .../sbs_gauge/boards/nucleo_f070rb.overlay | 4 +- .../boards/qemu_arc_qemu_arc_hs.overlay | 2 +- .../sbs_gauge/boards/qemu_cortex_a9.overlay | 2 +- .../boards/samc21n_xpro.overlay | 2 +- .../uart_errors/boards/sam_e54_xpro.overlay | 2 +- tests/kernel/device/app.overlay | 38 +-- .../boards/hifive_unmatched_fu740_s7.overlay | 38 +-- .../boards/hifive_unmatched_fu740_u74.overlay | 38 +-- tests/lib/devicetree/api/app.overlay | 4 +- tests/lib/devicetree/devices/app.overlay | 4 +- .../dfu/mcuboot_multi/native_sim.overlay | 8 +- .../mcuboot_multi/nrf52840dk_nrf52840.overlay | 12 +- .../fs/littlefs/boards/frdm_mcxa156.overlay | 4 +- .../fs/littlefs/boards/frdm_mcxn236.overlay | 4 +- .../boards/frdm_mcxn947_mcxn947_cpu0.overlay | 4 +- .../fs/littlefs/boards/frdm_mcxw71.overlay | 4 +- .../fs/littlefs/boards/frdm_rw612.overlay | 12 +- .../littlefs/boards/lpcxpresso55s06.overlay | 4 +- .../littlefs/boards/lpcxpresso55s16.overlay | 4 +- .../littlefs/boards/lpcxpresso55s28.overlay | 4 +- .../littlefs/boards/lpcxpresso55s36.overlay | 4 +- .../fs/littlefs/boards/mimxrt1010_evk.overlay | 12 +- .../fs/littlefs/boards/mimxrt1015_evk.overlay | 12 +- .../fs/littlefs/boards/mimxrt1020_evk.overlay | 4 +- .../fs/littlefs/boards/mimxrt1024_evk.overlay | 4 +- .../fs/littlefs/boards/mimxrt1040_evk.overlay | 4 +- ...mxrt1050_evk_mimxrt1052_hyperflash.overlay | 4 +- .../mimxrt1060_evk_mimxrt1062_qspi_C.overlay | 12 +- .../fs/littlefs/boards/mimxrt1064_evk.overlay | 4 +- .../mimxrt1160_evk_mimxrt1166_cm7.overlay | 12 +- .../mimxrt1170_evk_mimxrt1176_cm7.overlay | 12 +- .../mimxrt1180_evk_mimxrt1189_cm33.overlay | 12 +- .../mimxrt595_evk_mimxrt595s_cm33.overlay | 12 +- .../mimxrt685_evk_mimxrt685s_cm33.overlay | 12 +- .../fs/littlefs/boards/mr_canhubk3.overlay | 2 +- .../fs/littlefs/boards/native_sim.overlay | 2 +- .../boards/nrf52840dk_nrf52840.overlay | 2 +- .../boards/s32z2xxdc2_s32z270_rtu0.overlay | 2 +- .../boards/s32z2xxdc2_s32z270_rtu1.overlay | 2 +- .../boards/qemu_cortex_m3.overlay | 16 +- ...arduino_portenta_h7_stm32h747xx_m7.overlay | 4 +- .../boards/nrf52840dk_nrf52840.overlay | 4 +- .../retention/boards/qemu_cortex_m3.overlay | 4 +- tests/subsys/storage/flash_map/app.overlay | 4 +- 521 files changed, 2116 insertions(+), 2116 deletions(-) diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts index 114a2d9cb91d..75e2fc860288 100644 --- a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts @@ -76,9 +76,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; - nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; - ram-param = [00 F0]; + pvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; + nvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; + ram-param = [00 f0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts index fe6a7eba826d..ebf57c840054 100644 --- a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts @@ -90,9 +90,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; - nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; - ram-param = [00 F0]; + pvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; + nvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; + ram-param = [00 f0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts index 3f7971fce669..3295356dbf66 100644 --- a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts @@ -115,9 +115,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; - nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; - ram-param = [00 F0]; + pvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; + nvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; + ram-param = [00 f0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/adafruit/feather_esp32s3_tft_reverse/adafruit_feather_esp32s3_tft_reverse_procpu.dts b/boards/adafruit/feather_esp32s3_tft_reverse/adafruit_feather_esp32s3_tft_reverse_procpu.dts index 841e85761a15..52839c64a7b2 100644 --- a/boards/adafruit/feather_esp32s3_tft_reverse/adafruit_feather_esp32s3_tft_reverse_procpu.dts +++ b/boards/adafruit/feather_esp32s3_tft_reverse/adafruit_feather_esp32s3_tft_reverse_procpu.dts @@ -133,9 +133,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; - nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; - ram-param = [00 F0]; + pvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; + nvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; + ram-param = [00 f0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts index 13e4435f03bd..59025fb656f5 100644 --- a/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts +++ b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts @@ -187,7 +187,7 @@ page-offset = <0>; display-offset = <0>; multiplex-ratio = <63>; - prechargep = <0x1F>; + prechargep = <0x1f>; segment-remap; com-invdir; inversion-on; diff --git a/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.dts b/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.dts index 7c3694986705..05dbca9884db 100644 --- a/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.dts +++ b/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.dts @@ -120,12 +120,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/adafruit/trinket_m0/adafruit_trinket_m0.dts b/boards/adafruit/trinket_m0/adafruit_trinket_m0.dts index e130368f5d3d..d557aff3a79e 100644 --- a/boards/adafruit/trinket_m0/adafruit_trinket_m0.dts +++ b/boards/adafruit/trinket_m0/adafruit_trinket_m0.dts @@ -121,7 +121,7 @@ code_partition: partition@2000 { label = "code"; - reg = <0x2000 0x3A000>; + reg = <0x2000 0x3a000>; read-only; }; diff --git a/boards/adi/apard32690/apard32690_max32690_m4.dts b/boards/adi/apard32690/apard32690_max32690_m4.dts index 43575a724ac7..beff42273c6d 100644 --- a/boards/adi/apard32690/apard32690_max32690_m4.dts +++ b/boards/adi/apard32690/apard32690_max32690_m4.dts @@ -259,7 +259,7 @@ pmod_spi: &spi4 { status = "okay"; port1 { - local-mac-address = [00 E0 22 FE DA C9]; + local-mac-address = [00 e0 22 fe da c9]; }; mdio { @@ -305,7 +305,7 @@ pmod_spi: &spi4 { * HPB doesn't support 7-clock latency which is default */ config-regs = <0x1000>; - config-reg-vals = <0x801F>; + config-reg-vals = <0x801f>; }; mem@1 { @@ -325,7 +325,7 @@ pmod_spi: &spi4 { * HPB doesn't support 7-clock latency which is default */ config-regs = <0x1000>; - config-reg-vals = <0x801F>; + config-reg-vals = <0x801f>; }; }; diff --git a/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.dts b/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.dts index b8acb6ad6bf7..4358027c8494 100644 --- a/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.dts +++ b/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.dts @@ -130,12 +130,12 @@ slot1_partition: partition@8c000 { label = "image-1"; - reg = <0x0008C000 DT_SIZE_K(432)>; + reg = <0x0008c000 DT_SIZE_K(432)>; }; scratch_partition: partition@f8000 { label = "image-scratch"; - reg = <0x000F8000 DT_SIZE_K(16)>; + reg = <0x000f8000 DT_SIZE_K(16)>; }; storage_partition: partition@fc000 { @@ -221,7 +221,7 @@ spi-oa-protection; port1 { - local-mac-address = [00 E0 22 FE DA C8]; + local-mac-address = [00 e0 22 fe da c8]; }; mdio { diff --git a/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.dts b/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.dts index 1e64014618af..245ac4af8f0a 100644 --- a/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.dts +++ b/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.dts @@ -109,12 +109,12 @@ slot1_partition: partition@8c000 { label = "image-1"; - reg = <0x0008C000 DT_SIZE_K(432)>; + reg = <0x0008c000 DT_SIZE_K(432)>; }; scratch_partition: partition@f8000 { label = "image-scratch"; - reg = <0x000F8000 DT_SIZE_K(16)>; + reg = <0x000f8000 DT_SIZE_K(16)>; }; storage_partition: partition@fc000 { @@ -184,11 +184,11 @@ spi-oa-protection; port1 { - local-mac-address = [00 E0 22 FE DA C9]; + local-mac-address = [00 e0 22 fe da c9]; }; port2 { - local-mac-address = [00 E0 22 FE DA D9]; + local-mac-address = [00 e0 22 fe da d9]; }; mdio { diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi index 75c4225ab31c..ff7eee912de1 100644 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi @@ -26,9 +26,9 @@ }; &flashctrl { - flash0: flash@A0000000 { + flash0: flash@a0000000 { compatible = "soc-nv-flash", "gd,gd25q64e"; - reg = <0xA0000000 (0x800000 - 0x2000)>; + reg = <0xa0000000 (0x800000 - 0x2000)>; write-block-size = <256>; erase-block-size = ; diff --git a/boards/aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi b/boards/aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi index 0c861700cdba..8ac9e3eb7ea8 100644 --- a/boards/aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi +++ b/boards/aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi @@ -26,9 +26,9 @@ }; &flashctrl { - flash0: flash@A0000000 { + flash0: flash@a0000000 { compatible = "soc-nv-flash", "gd,gd25lq32d"; - reg = <0xA0000000 (0x400000 - 0x2000)>; + reg = <0xa0000000 (0x400000 - 0x2000)>; write-block-size = <256>; erase-block-size = ; diff --git a/boards/alientek/dnesp32s3b/dnesp32s3b_procpu.dts b/boards/alientek/dnesp32s3b/dnesp32s3b_procpu.dts index cae7f11d2160..834e7658e68c 100644 --- a/boards/alientek/dnesp32s3b/dnesp32s3b_procpu.dts +++ b/boards/alientek/dnesp32s3b/dnesp32s3b_procpu.dts @@ -163,7 +163,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 F0]; + ram-param = [00 f0]; rgb-param = [40 02 14]; }; }; diff --git a/boards/ambiq/apollo510_evb/apollo510_evb.dts b/boards/ambiq/apollo510_evb/apollo510_evb.dts index 0be49ee6784b..869b1d0463c5 100644 --- a/boards/ambiq/apollo510_evb/apollo510_evb.dts +++ b/boards/ambiq/apollo510_evb/apollo510_evb.dts @@ -175,7 +175,7 @@ mspi-hardware-ce-num = <0>; mspi-dqs-enable; read-command = <0x20>; - write-command = <0xA0>; + write-command = <0xa0>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; rx-dummy = <7>; @@ -213,8 +213,8 @@ mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-dqs-enable; mspi-hardware-ce-num = <0>; - read-command = <0xCC>; - write-command = <0x8E>; + read-command = <0xcc>; + write-command = <0x8e>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; /* Avoid use of 3 byte address if Ambiq MSPI */ rx-dummy = <16>; diff --git a/boards/amd/versal2_rpu/versal2_rpu-qemu.dts b/boards/amd/versal2_rpu/versal2_rpu-qemu.dts index d2b4dac5de1f..26d57c783cc8 100644 --- a/boards/amd/versal2_rpu/versal2_rpu-qemu.dts +++ b/boards/amd/versal2_rpu/versal2_rpu-qemu.dts @@ -960,7 +960,7 @@ phandle = <0x10f>; }; - loader_write_cpu0_0x1@0xF1110880 { + loader_write_cpu0_0x1@0xf1110880 { compatible = "loader"; addr = <0xf1110880>; data = <0x01>; @@ -972,7 +972,7 @@ phandle = <0x110>; }; - loader_write_cpu0_0x5@0xFD1A0050 { + loader_write_cpu0_0x5@0xfd1a0050 { compatible = "loader"; addr = <0xfd1a0050>; data = <0x05>; @@ -984,7 +984,7 @@ phandle = <0x111>; }; - loader_write_cpu0_0xFF@0xF111010C { + loader_write_cpu0_0xFF@0xf111010c { compatible = "loader"; addr = <0xf111010c>; data = <0xff>; @@ -1031,7 +1031,7 @@ phandle = <0x44>; }; - loader_write_cpu0_0x80C@0xF12B0100 { + loader_write_cpu0_0x80C@0xf12b0100 { compatible = "loader"; addr = <0xf12b0100>; data = <0x80c>; @@ -1043,7 +1043,7 @@ phandle = <0x113>; }; - loader_write_cpu0_0x77@0xF1260320 { + loader_write_cpu0_0x77@0xf1260320 { compatible = "loader"; addr = <0xf1260320>; data = <0x77>; @@ -2488,7 +2488,7 @@ phandle = <0x165>; }; - loader_write_cpu0_0x1@0xEDC30440 { + loader_write_cpu0_0x1@0xedc30440 { compatible = "loader"; addr = <0xedc30440>; data = <0x01>; @@ -2500,7 +2500,7 @@ phandle = <0x166>; }; - loader_write_cpu0_0x7F@0xEDC30444 { + loader_write_cpu0_0x7F@0xedc30444 { compatible = "loader"; addr = <0xedc30444>; data = <0x7f>; @@ -2512,7 +2512,7 @@ phandle = <0x167>; }; - loader_write_cpu0_0x1@0xEDC3044c { + loader_write_cpu0_0x1@0xedc3044c { compatible = "loader"; addr = <0xedc3044c>; data = <0x01>; @@ -2524,7 +2524,7 @@ phandle = <0x168>; }; - loader_write_cpu0_0x1@0xEDC30450 { + loader_write_cpu0_0x1@0xedc30450 { compatible = "loader"; addr = <0xedc30450>; data = <0x01>; @@ -2536,7 +2536,7 @@ phandle = <0x169>; }; - loader_write_cpu0_0x1@0xEDC30460 { + loader_write_cpu0_0x1@0xedc30460 { compatible = "loader"; addr = <0xedc30460>; data = <0x01>; @@ -2548,7 +2548,7 @@ phandle = <0x16a>; }; - loader_write_cpu0_0x7f@0xEDC30464 { + loader_write_cpu0_0x7f@0xedc30464 { compatible = "loader"; addr = <0xedc30464>; data = <0x7f>; @@ -2560,7 +2560,7 @@ phandle = <0x16b>; }; - loader_write_cpu0_0x1@0xEDC3046c { + loader_write_cpu0_0x1@0xedc3046c { compatible = "loader"; addr = <0xedc3046c>; data = <0x01>; @@ -2572,7 +2572,7 @@ phandle = <0x16c>; }; - loader_write_cpu0_0x1@0xEDC30470 { + loader_write_cpu0_0x1@0xedc30470 { compatible = "loader"; addr = <0xedc30470>; data = <0x01>; @@ -2584,7 +2584,7 @@ phandle = <0x16d>; }; - loader_write_cpu0_0x3@0xED0A0098 { + loader_write_cpu0_0x3@0xed0a0098 { compatible = "loader"; addr = <0xed0a0098>; data = <0x03>; @@ -3289,7 +3289,7 @@ Cannot continue.\nTry installing libgcrypt."; phandle = <0x91>; }; - pmc_sha1@0xF1800000 { + pmc_sha1@0xf1800000 { doc-status = "complete"; compatible = "xlnx,asu_sha2"; reg = <0x00 0xf1800000 0x00 0x10000 0x00>; @@ -3941,7 +3941,7 @@ Cannot continue.\nTry installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x1a4>; - asu_io_intc@0C { + asu_io_intc@0c { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -4268,7 +4268,7 @@ Cannot continue.\nTry installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x1b5>; - pmc_ppu0_intc@0C { + pmc_ppu0_intc@0c { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -4484,7 +4484,7 @@ Cannot continue.\nTry installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x1bf>; - pmc_ppu1_intc@0C { + pmc_ppu1_intc@0c { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -4730,7 +4730,7 @@ Cannot continue.\nTry installing libgcrypt."; priority = <0xffffffff>; phandle = <0x1cd>; - ddrmc0_intc@0C { + ddrmc0_intc@0c { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -5062,7 +5062,7 @@ Cannot continue.\nTry installing libgcrypt."; phandle = <0x103>; }; - memory@0x50000000000ULL { + memory@0x50000000000ull { compatible = "qemu:memory-region"; device_type = "memory"; container = <0x0d>; @@ -5797,7 +5797,7 @@ Cannot continue.\nTry installing libgcrypt."; phandle = <0xa2>; }; - ddr_2@0x800000000ULL { + ddr_2@0x800000000ull { compatible = "qemu:memory-region-spec"; container = <0x103>; qemu,ram = <0x01>; diff --git a/boards/amd/versalnet_apu/versalnet_apu-qemu.dts b/boards/amd/versalnet_apu/versalnet_apu-qemu.dts index f011af0cdd63..881f0d9fe5c1 100644 --- a/boards/amd/versalnet_apu/versalnet_apu-qemu.dts +++ b/boards/amd/versalnet_apu/versalnet_apu-qemu.dts @@ -694,7 +694,7 @@ phandle = <0xc9>; }; - loader_write_cpu0_0x1@0xF1110880 { + loader_write_cpu0_0x1@0xf1110880 { compatible = "loader"; addr = <0xf1110880>; data = <0x01>; @@ -706,7 +706,7 @@ phandle = <0xca>; }; - loader_write_cpu0_0x5@0xFD1A0050 { + loader_write_cpu0_0x5@0xfd1a0050 { compatible = "loader"; addr = <0xfd1a0050>; data = <0x05>; @@ -718,7 +718,7 @@ phandle = <0xcb>; }; - loader_write_cpu0_0xFF@0xF111010C { + loader_write_cpu0_0xFF@0xf111010c { compatible = "loader"; addr = <0xf111010c>; data = <0xff>; @@ -744,7 +744,7 @@ phandle = <0x2c>; }; - loader_write_cpu0_0x80C@0xF12B0100 { + loader_write_cpu0_0x80C@0xf12b0100 { compatible = "loader"; addr = <0xf12b0100>; data = <0x80c>; @@ -1394,7 +1394,7 @@ phandle = <0xb7>; }; - rpu_pcil@0xEB420000 { + rpu_pcil@0xeb420000 { compatible = "xlnx,rpu_pcil"; reg = <0x00 0xeb420000 0x00 0x10000 0x00>; gpio-controller; @@ -1564,7 +1564,7 @@ phandle = <0x4e>; }; - pki_rng@0x20400040000ULL { + pki_rng@0x20400040000ull { compatible = "xlnx,psx-pki-rng"; reg = <0x204 0x40000 0x00 0x20000 0x00>; interrupts = <0x9c>; @@ -2143,7 +2143,7 @@ Cannot continue.Try installing libgcrypt."; phandle = <0x6e>; }; - pmc_sha1@0xF1800000 { + pmc_sha1@0xf1800000 { doc-status = "complete"; compatible = "zynqmp,csu-sha3"; reg = <0x00 0xf1800000 0x00 0x10000 0x00>; @@ -2224,7 +2224,7 @@ Cannot continue.Try installing libgcrypt."; phandle = <0x76>; }; - pmc_err_mng@0xF1130000 { + pmc_err_mng@0xf1130000 { compatible = "xlnx,PmcErrMngmnt"; reg = <0x00 0xf1130000 0x00 0x10000 0x00>; interrupts = <0xbca>; @@ -2975,7 +2975,7 @@ Cannot continue.Try installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x139>; - pmc_ppu0_intc@0C { + pmc_ppu0_intc@0c { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -3191,7 +3191,7 @@ Cannot continue.Try installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x143>; - pmc_ppu1_intc@0C { + pmc_ppu1_intc@0c { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -3407,7 +3407,7 @@ Cannot continue.Try installing libgcrypt."; container = <0x92>; phandle = <0x14d>; - psm0_intc@0C { + psm0_intc@0c { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -3554,7 +3554,7 @@ Cannot continue.Try installing libgcrypt."; priority = <0xffffffff>; phandle = <0x153>; - ddrmc0_intc@0C { + ddrmc0_intc@0c { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -3865,7 +3865,7 @@ Cannot continue.Try installing libgcrypt."; phandle = <0xba>; }; - memory@0x50000000000ULL { + memory@0x50000000000ull { compatible = "qemu:memory-region"; device_type = "memory"; container = <0x0b>; @@ -4668,7 +4668,7 @@ Cannot continue.Try installing libgcrypt."; phandle = <0x7f>; }; - ddr_2@0x800000000ULL { + ddr_2@0x800000000ull { compatible = "qemu:memory-region-spec"; container = <0xba>; qemu,ram = <0x01>; diff --git a/boards/arduino/mkrzero/arduino_mkrzero.dts b/boards/arduino/mkrzero/arduino_mkrzero.dts index 3fbf38268d79..aa98de5d00c5 100644 --- a/boards/arduino/mkrzero/arduino_mkrzero.dts +++ b/boards/arduino/mkrzero/arduino_mkrzero.dts @@ -135,7 +135,7 @@ zephyr_i2c: &sercom0 { code_partition: partition@2000 { label = "code"; - reg = <0x2000 0x3A000>; + reg = <0x2000 0x3a000>; read-only; }; diff --git a/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts b/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts index fed0ec2dd2b8..cdd79bddff46 100644 --- a/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts +++ b/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts @@ -163,7 +163,7 @@ code_partition: partition@2000 { label = "code"; - reg = <0x2000 0x3A000>; + reg = <0x2000 0x3a000>; read-only; }; diff --git a/boards/arduino/nano_matter/arduino_nano_matter.dts b/boards/arduino/nano_matter/arduino_nano_matter.dts index 9e20e508805d..dd108d99189a 100644 --- a/boards/arduino/nano_matter/arduino_nano_matter.dts +++ b/boards/arduino/nano_matter/arduino_nano_matter.dts @@ -327,13 +327,13 @@ /* Reserve 736 kB for the application in slot 0 */ slot0_partition: partition@c000 { - reg = <0x0000c000 0x000B8000>; + reg = <0x0000c000 0x000b8000>; label = "image-0"; }; /* Reserve 736 kB for the application in slot 1 */ - slot1_partition: partition@C4000 { - reg = <0x000C4000 0x000B8000>; + slot1_partition: partition@c4000 { + reg = <0x000c4000 0x000b8000>; label = "image-1"; }; diff --git a/boards/arduino/portenta_c33/arduino_portenta_c33.dts b/boards/arduino/portenta_c33/arduino_portenta_c33.dts index 3dda993399e8..dbf6e0b53eb1 100644 --- a/boards/arduino/portenta_c33/arduino_portenta_c33.dts +++ b/boards/arduino/portenta_c33/arduino_portenta_c33.dts @@ -308,7 +308,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; @@ -318,7 +318,7 @@ }; ð { - local-mac-address = [74 90 50 B0 5D E9]; + local-mac-address = [74 90 50 b0 5d e9]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts index afc4ca90fc9c..7a6bd8f91a81 100644 --- a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts +++ b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts @@ -203,9 +203,9 @@ zephyr_udc0: &usbotg_hs { reg = <0x00040000 0x00060000>; }; - slot1_partition: partition@A0000 { + slot1_partition: partition@a0000 { label = "image-1"; - reg = <0x000A0000 0x00060000>; + reg = <0x000a0000 0x00060000>; }; }; }; diff --git a/boards/arduino/uno_r4/arduino_uno_r4.dts b/boards/arduino/uno_r4/arduino_uno_r4.dts index 7119ad6d049c..e369914bc4da 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4.dts +++ b/boards/arduino/uno_r4/arduino_uno_r4.dts @@ -103,7 +103,7 @@ code_partition: partition@4000 { label = "code"; - reg = <0x4000 0x3C000>; + reg = <0x4000 0x3c000>; read-only; }; }; diff --git a/boards/arm/mps2/mps2_an521_cpu1.dts b/boards/arm/mps2/mps2_an521_cpu1.dts index acc956c42a3e..72f5d6a8e107 100644 --- a/boards/arm/mps2/mps2_an521_cpu1.dts +++ b/boards/arm/mps2/mps2_an521_cpu1.dts @@ -120,8 +120,8 @@ * https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/master/platform/ext/target/arm/mps2/an521/partition/flash_layout.h */ - code: memory@38B000 { - reg = <0x0038B000 DT_SIZE_K(468)>; + code: memory@38b000 { + reg = <0x0038b000 DT_SIZE_K(468)>; }; /* This ram memory region's base address is chosen to avoid diff --git a/boards/bbc/microbit_v2/bbc_microbit_v2.dts b/boards/bbc/microbit_v2/bbc_microbit_v2.dts index 112e857df51a..2ec032af8132 100644 --- a/boards/bbc/microbit_v2/bbc_microbit_v2.dts +++ b/boards/bbc/microbit_v2/bbc_microbit_v2.dts @@ -165,27 +165,27 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xC000>; + reg = <0x00000000 0xc000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { label = "image-scratch"; - reg = <0x00070000 0xA000>; + reg = <0x00070000 0xa000>; }; storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007A000 0x00006000>; + reg = <0x0007a000 0x00006000>; }; }; }; diff --git a/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.dts b/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.dts index f712184c3444..fa889b01c4e2 100644 --- a/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.dts +++ b/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.dts @@ -136,12 +136,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts b/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts index 3187a51aceeb..5ec74a28f536 100644 --- a/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts +++ b/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts @@ -194,7 +194,7 @@ }; /* Allocate 128 KiB scratch for image swap */ - scratch_partition: partition@A0000 { + scratch_partition: partition@a0000 { label = "image-scratch"; reg = <0x000a0000 DT_SIZE_K(128)>; }; diff --git a/boards/blues/swan_r5/swan_r5.dts b/boards/blues/swan_r5/swan_r5.dts index 795751591c33..95e8c1f6981c 100644 --- a/boards/blues/swan_r5/swan_r5.dts +++ b/boards/blues/swan_r5/swan_r5.dts @@ -188,9 +188,9 @@ zephyr_udc0: &usbotg_fs { #size-cells = <1>; /* Reserve last 16KiB for property storage */ - storage_partition: partition@1FB000 { + storage_partition: partition@1fb000 { label = "storage"; - reg = <0x001FB000 0x00004000>; + reg = <0x001fb000 0x00004000>; }; }; }; diff --git a/boards/bytesatwork/bytesensi_l/bytesensi_l.dts b/boards/bytesatwork/bytesensi_l/bytesensi_l.dts index baf7b0209d6c..f68e66c7d5fd 100644 --- a/boards/bytesatwork/bytesensi_l/bytesensi_l.dts +++ b/boards/bytesatwork/bytesensi_l/bytesensi_l.dts @@ -43,12 +43,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.dts b/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.dts index ebcb17d6f61f..709998ba107d 100644 --- a/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.dts +++ b/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.dts @@ -142,12 +142,12 @@ zephyr_udc0: &usbd { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000C000>; + reg = <0x00000000 0x0000c000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00076000>; + reg = <0x0000c000 0x00076000>; }; slot1_partition: partition@82000 { diff --git a/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts b/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts index cb06d4ef06c2..7ccae16ec375 100644 --- a/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts +++ b/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts @@ -121,12 +121,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts index 257a85373eb6..9d9e0f6d3434 100644 --- a/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts +++ b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts @@ -109,10 +109,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; - nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; - ram-param = [00 F0]; - rgb-param = [CD 08 14]; + pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; + nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; + ram-param = [00 f0]; + rgb-param = [cd 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi index 6af62971ef80..3389ad997124 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi @@ -375,7 +375,7 @@ }; /* 256K */ - slot1_ns_partition: partition@A0000 { + slot1_ns_partition: partition@a0000 { label = "image-1-nonsecure"; }; diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi index f20e1909f792..b73f177a8d79 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi @@ -50,7 +50,7 @@ /* 88K */ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x16000>; + reg = <0x0000c000 0x16000>; }; /* 88K */ diff --git a/boards/ezurio/bl652_dvk/bl652_dvk.dts b/boards/ezurio/bl652_dvk/bl652_dvk.dts index 23f61e4e80a5..2a42758f812e 100644 --- a/boards/ezurio/bl652_dvk/bl652_dvk.dts +++ b/boards/ezurio/bl652_dvk/bl652_dvk.dts @@ -160,12 +160,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/ezurio/bl653_dvk/bl653_dvk.dts b/boards/ezurio/bl653_dvk/bl653_dvk.dts index 5279f263c362..bcf0896eb207 100644 --- a/boards/ezurio/bl653_dvk/bl653_dvk.dts +++ b/boards/ezurio/bl653_dvk/bl653_dvk.dts @@ -176,27 +176,27 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xC000>; + reg = <0x00000000 0xc000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { label = "image-scratch"; - reg = <0x00070000 0xA000>; + reg = <0x00070000 0xa000>; }; storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007A000 0x00006000>; + reg = <0x0007a000 0x00006000>; }; }; }; diff --git a/boards/ezurio/bt610/bt610.dts b/boards/ezurio/bt610/bt610.dts index 791e6c75421a..b7dd129c8be9 100644 --- a/boards/ezurio/bt610/bt610.dts +++ b/boards/ezurio/bt610/bt610.dts @@ -254,7 +254,7 @@ /* 896K */ slot0_partition: partition@18000 { label = "image-0"; - reg = <0x00018000 0x000E0000>; + reg = <0x00018000 0x000e0000>; }; /* @@ -282,19 +282,19 @@ /* 896K */ slot1_partition: partition@0 { label = "image-1"; - reg = <0x00000000 0x000E0000>; + reg = <0x00000000 0x000e0000>; }; /* 16K */ - scratch_partition: partition@E0000 { + scratch_partition: partition@e0000 { label = "image-scratch"; - reg = <0x000E0000 0x00004000>; + reg = <0x000e0000 0x00004000>; }; /* 112K */ - customer_partition: partition@E4000 { + customer_partition: partition@e4000 { label = "customer-storage"; - reg = <0x000E4000 0x0001C000>; + reg = <0x000e4000 0x0001c000>; }; /* 7MB */ diff --git a/boards/ezurio/mg100/mg100.dts b/boards/ezurio/mg100/mg100.dts index f7505e18fb79..3a46456d5425 100644 --- a/boards/ezurio/mg100/mg100.dts +++ b/boards/ezurio/mg100/mg100.dts @@ -207,7 +207,7 @@ /* 896K */ slot0_partition: partition@18000 { label = "image-0"; - reg = <0x00018000 0x000E0000>; + reg = <0x00018000 0x000e0000>; }; /* @@ -235,13 +235,13 @@ /* 896K */ slot1_partition: partition@0 { label = "image-1"; - reg = <0x00000000 0x000E0000>; + reg = <0x00000000 0x000e0000>; }; /* 128K */ - scratch_partition: partition@E0000 { + scratch_partition: partition@e0000 { label = "image-scratch"; - reg = <0x000E0000 0x00020000>; + reg = <0x000e0000 0x00020000>; }; /* 7MB */ diff --git a/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.dts b/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.dts index 5660a0624d8f..f5b58ea54a9f 100644 --- a/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.dts +++ b/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.dts @@ -220,7 +220,7 @@ /* 896K */ slot0_partition: partition@18000 { label = "image-0"; - reg = <0x00018000 0x000E0000>; + reg = <0x00018000 0x000e0000>; }; /* @@ -248,13 +248,13 @@ /* 896K */ slot1_partition: partition@0 { label = "image-1"; - reg = <0x00000000 0x000E0000>; + reg = <0x00000000 0x000e0000>; }; /* 128K */ - scratch_partition: partition@E0000 { + scratch_partition: partition@e0000 { label = "image-scratch"; - reg = <0x000E0000 0x00020000>; + reg = <0x000e0000 0x00020000>; }; /* 7MB */ diff --git a/boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts b/boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts index dddb743cf092..44a8066baa1c 100644 --- a/boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts +++ b/boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts @@ -124,13 +124,13 @@ /* 52K */ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000C000>; + reg = <0x00000000 0x0000c000>; }; /* 188K */ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00030000>; + reg = <0x0000c000 0x00030000>; }; /* @@ -139,7 +139,7 @@ */ storage_partition: partition@3c000 { label = "storage"; - reg = <0x0003C000 0x00004000>; + reg = <0x0003c000 0x00004000>; }; }; }; diff --git a/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts b/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts index 10e8798731b9..7792ea0dfdd6 100644 --- a/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts +++ b/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts @@ -62,10 +62,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; - nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; - ram-param = [00 F0]; - rgb-param = [CD 08 14]; + pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; + nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; + ram-param = [00 f0]; + rgb-param = [cd 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/fobe/quill_nrf52840_mesh/quill_nrf52840_mesh_common.dtsi b/boards/fobe/quill_nrf52840_mesh/quill_nrf52840_mesh_common.dtsi index aac440914bdf..b9470bd9f8c8 100644 --- a/boards/fobe/quill_nrf52840_mesh/quill_nrf52840_mesh_common.dtsi +++ b/boards/fobe/quill_nrf52840_mesh/quill_nrf52840_mesh_common.dtsi @@ -75,20 +75,20 @@ height = <240>; x-offset = <52>; y-offset = <40>; - vcom = <0x3F>; + vcom = <0x3f>; gctrl = <0x05>; - vrhs = <0x0F>; + vrhs = <0x0f>; vdvs = <0x20>; mdac = <0x00>; gamma = <0x01>; colmod = <0x05>; - lcm = <0x2C>; + lcm = <0x2c>; porch-param = [05 05 00 33 33]; - cmd2en-param = [5A 69 02 00]; - pwctrl1-param = [A4 A1]; - pvgam-param = [D0 05 09 09 08 14 28 33 3F 07 13 14 28 30]; - nvgam-param = [D0 05 09 09 08 03 24 32 32 3B 14 13 28 2F]; - ram-param = [00 F0]; + cmd2en-param = [5a 69 02 00]; + pwctrl1-param = [a4 a1]; + pvgam-param = [d0 05 09 09 08 14 28 33 3f 07 13 14 28 30]; + nvgam-param = [d0 05 09 09 08 03 24 32 32 3b 14 13 28 2f]; + ram-param = [00 f0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/focaltech/ft9001_eval/ft9001_eval.dts b/boards/focaltech/ft9001_eval/ft9001_eval.dts index 64fca08709be..bd24ffb00ad7 100644 --- a/boards/focaltech/ft9001_eval/ft9001_eval.dts +++ b/boards/focaltech/ft9001_eval/ft9001_eval.dts @@ -39,7 +39,7 @@ app_partition: partition@1000 { label = "app"; - reg = <0x00001000 0x001FF000>; + reg = <0x00001000 0x001ff000>; }; }; }; diff --git a/boards/heltec/heltec_wireless_tracker/heltec_wireless_tracker_procpu.dts b/boards/heltec/heltec_wireless_tracker/heltec_wireless_tracker_procpu.dts index 23c058bce044..b70fcb66b7fb 100644 --- a/boards/heltec/heltec_wireless_tracker/heltec_wireless_tracker_procpu.dts +++ b/boards/heltec/heltec_wireless_tracker/heltec_wireless_tracker_procpu.dts @@ -81,22 +81,22 @@ inversion-on; x-offset = <1>; y-offset = <26>; - madctl = <0xA8>; + madctl = <0xa8>; colmod = <0x05>; invctr = <7>; - vmctr1 = <0x0E>; - pwctr1 = [A2 02 84]; - pwctr2 = [C1]; - pwctr3 = [0A 00]; - pwctr4 = [8A 2A]; - pwctr5 = [8A EE]; - frmctr1 = [01 26 2E]; - frmctr2 = [01 26 2E]; - frmctr3 = [01 26 2E 01 26 2E]; - gamctrp1 = [0F 1A 0F 18 2F 28 20 22 1F 1B 23 37 00 07 02 10]; - gamctrn1 = [0F 1B 0F 17 33 2C 29 2E 30 2E 30 3B 00 07 03 10]; - caset = [00 01 00 A0]; - raset = [00 1A 00 69]; + vmctr1 = <0x0e>; + pwctr1 = [a2 02 84]; + pwctr2 = [c1]; + pwctr3 = [0a 00]; + pwctr4 = [8a 2a]; + pwctr5 = [8a ee]; + frmctr1 = [01 26 2e]; + frmctr2 = [01 26 2e]; + frmctr3 = [01 26 2e 01 26 2e]; + gamctrp1 = [0f 1a 0f 18 2f 28 20 22 1f 1b 23 37 00 07 02 10]; + gamctrn1 = [0f 1b 0f 17 33 2c 29 2e 30 2e 30 3b 00 07 03 10]; + caset = [00 01 00 a0]; + raset = [00 1a 00 69]; }; }; }; diff --git a/boards/holyiot/yj17095/holyiot_yj17095.dts b/boards/holyiot/yj17095/holyiot_yj17095.dts index c6a396fdc989..3cb3083c6ac1 100644 --- a/boards/holyiot/yj17095/holyiot_yj17095.dts +++ b/boards/holyiot/yj17095/holyiot_yj17095.dts @@ -56,7 +56,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x37000>; + reg = <0x0000c000 0x37000>; }; slot1_partition: partition@43000 { diff --git a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02-memory_map.dtsi b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02-memory_map.dtsi index 7f0454ae4d59..bbe94a64160d 100644 --- a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02-memory_map.dtsi +++ b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02-memory_map.dtsi @@ -88,9 +88,9 @@ reg = <0x80000 0x60000>; }; - storage_partition: storage_partition@E0000 { + storage_partition: storage_partition@e0000 { compatible = "soc-nv-flash"; - reg = <0xE0000 DT_SIZE_K(64)>; + reg = <0xe0000 DT_SIZE_K(64)>; }; }; }; diff --git a/boards/infineon/kit_pse84_ai/kit_pse84_ai_memory_map.dtsi b/boards/infineon/kit_pse84_ai/kit_pse84_ai_memory_map.dtsi index cf0024ff9c2c..4e315583bf10 100644 --- a/boards/infineon/kit_pse84_ai/kit_pse84_ai_memory_map.dtsi +++ b/boards/infineon/kit_pse84_ai/kit_pse84_ai_memory_map.dtsi @@ -96,7 +96,7 @@ }; m33s_xip: m33s_xip@70100400 { - reg = <0x70100400 0x1FFC00>; + reg = <0x70100400 0x1ffc00>; }; m33_xip: m33_xip@8300000 { diff --git a/boards/kws/pico2_spe/pico2_spe.dtsi b/boards/kws/pico2_spe/pico2_spe.dtsi index f99ec6f98aa7..b4f3db7021e9 100644 --- a/boards/kws/pico2_spe/pico2_spe.dtsi +++ b/boards/kws/pico2_spe/pico2_spe.dtsi @@ -86,7 +86,7 @@ rst-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; status = "okay"; - local-mac-address = [CA 2F B7 10 23 79]; + local-mac-address = [ca 2f b7 10 23 79]; lan865x_mdio: lan865x_mdio { compatible = "microchip,lan865x-mdio"; diff --git a/boards/kws/pico_spe/pico_spe.dts b/boards/kws/pico_spe/pico_spe.dts index 1b333f69e9fe..048c18ea6276 100644 --- a/boards/kws/pico_spe/pico_spe.dts +++ b/boards/kws/pico_spe/pico_spe.dts @@ -150,7 +150,7 @@ int-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; rst-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; status = "okay"; - local-mac-address = [CA 2F B7 10 23 78]; + local-mac-address = [ca 2f b7 10 23 78]; lan865x_mdio: lan865x_mdio { compatible = "microchip,lan865x-mdio"; diff --git a/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts b/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts index 542781c515cf..f2afc45fef85 100644 --- a/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts +++ b/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts @@ -70,16 +70,16 @@ height = <80>; inversion-on; rgb-is-inverted; - madctl = <0xBE>; + madctl = <0xbe>; x-offset = <1>; y-offset = <26>; - gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2B 39 00 01 03 10]; - gamctrn1 = [03 1d 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10]; - te-delay = <0x0A>; - vmctr1 = <0x0E>; + gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2b 39 00 01 03 10]; + gamctrn1 = [03 1d 07 06 2e 2c 29 2d 2e 2e 37 3f 00 00 02 10]; + te-delay = <0x0a>; + vmctr1 = <0x0e>; colmod = <0x05>; caset = [00 02 00 81]; - raset = [00 01 00 A0]; + raset = [00 01 00 a0]; status = "okay"; }; }; diff --git a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts index cbc697bcdf34..5d8684322f93 100644 --- a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts +++ b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts @@ -83,7 +83,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 E0]; + ram-param = [00 e0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts index e9c090eec51e..426cb6973a3c 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts @@ -95,7 +95,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 F0]; + ram-param = [00 f0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.dts b/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.dts index 9cc34be37cf5..6dd7f134a595 100644 --- a/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.dts +++ b/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.dts @@ -153,12 +153,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/native/native_sim/native_sim.dts b/boards/native/native_sim/native_sim.dts index 1d2b1bde46ca..128562a7f506 100644 --- a/boards/native/native_sim/native_sim.dts +++ b/boards/native/native_sim/native_sim.dts @@ -77,12 +77,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000C000>; + reg = <0x00000000 0x0000c000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00069000>; + reg = <0x0000c000 0x00069000>; }; slot1_partition: partition@75000 { diff --git a/boards/nordic/nrf21540dk/nrf21540dk_nrf52840.dts b/boards/nordic/nrf21540dk/nrf21540dk_nrf52840.dts index 7368127a72a6..801782c35efe 100644 --- a/boards/nordic/nrf21540dk/nrf21540dk_nrf52840.dts +++ b/boards/nordic/nrf21540dk/nrf21540dk_nrf52840.dts @@ -279,12 +279,12 @@ fem_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000C000>; + reg = <0x00000000 0x0000c000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00076000>; + reg = <0x0000c000 0x00076000>; }; slot1_partition: partition@82000 { diff --git a/boards/nordic/nrf52833dk/nrf52833dk_nrf52820.dts b/boards/nordic/nrf52833dk/nrf52833dk_nrf52820.dts index 04c90fbbb017..6516a779928f 100644 --- a/boards/nordic/nrf52833dk/nrf52833dk_nrf52820.dts +++ b/boards/nordic/nrf52833dk/nrf52833dk_nrf52820.dts @@ -167,12 +167,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xC000>; + reg = <0x00000000 0xc000>; }; - slot0_partition: partition@C000 { + slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x17000>; + reg = <0x0000c000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts b/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts index d7f5b3ba0b92..098632f622b5 100644 --- a/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts +++ b/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts @@ -237,12 +237,12 @@ arduino_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xC000>; + reg = <0x00000000 0xc000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x37000>; + reg = <0x0000c000 0x37000>; }; slot1_partition: partition@43000 { @@ -252,7 +252,7 @@ arduino_spi: &spi3 { storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007A000 0x00006000>; + reg = <0x0007a000 0x00006000>; }; }; }; diff --git a/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts b/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts index 35a9e6403012..6dc7731389f8 100644 --- a/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts +++ b/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts @@ -175,7 +175,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0xe000>; + reg = <0x0000c000 0xe000>; }; slot1_partition: partition@1a000 { diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52805.dts b/boards/nordic/nrf52dk/nrf52dk_nrf52805.dts index 8f1ff01454dd..a27bae1c72cf 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52805.dts +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52805.dts @@ -150,7 +150,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0xe000>; + reg = <0x0000c000 0xe000>; }; slot1_partition: partition@1a000 { diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts b/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts index e9a50ea9ac50..8c72a1b5fa30 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts @@ -152,7 +152,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0xe000>; + reg = <0x0000c000 0xe000>; }; slot1_partition: partition@1a000 { diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts b/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts index 2f7a08013580..9f1b167c2165 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts @@ -239,7 +239,7 @@ arduino_spi: &spi2 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x37000>; + reg = <0x0000c000 0x37000>; }; slot1_partition: partition@43000 { diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts index 8d578efde1b2..11d75635e32e 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts @@ -70,12 +70,12 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x12000>; + reg = <0x0000c000 0x12000>; }; slot1_partition: partition@1e000 { label = "image-1"; - reg = <0x0001E000 0x12000>; + reg = <0x0001e000 0x12000>; }; storage_partition: partition@3a000 { diff --git a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts index 980348a849a3..69c9cd860730 100644 --- a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts @@ -89,7 +89,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x17000>; + reg = <0x0000c000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts index d15594a7d374..044e38e497e8 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts @@ -163,7 +163,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x17000>; + reg = <0x0000c000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi b/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi index 41c76e48433b..71e1ed593ec0 100644 --- a/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi +++ b/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi @@ -27,10 +27,10 @@ #size-cells = <1>; ranges; - ipc_shm_area_cpuapp_cpuuma: memory@200C0000 { + ipc_shm_area_cpuapp_cpuuma: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 0x2000>; - ranges = <0x0 0x200C0000 0x2000>; + reg = <0x200c0000 0x2000>; + ranges = <0x0 0x200c0000 0x2000>; #address-cells = <1>; #size-cells = <1>; status = "okay"; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi index 4c082ecb7be3..4be968ed3df2 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi @@ -203,12 +203,12 @@ reg = <0x376000 DT_SIZE_K(440)>; }; - cpuppr_code_partition: partition@3E4000 { - reg = <0x3E4000 DT_SIZE_K(64)>; + cpuppr_code_partition: partition@3e4000 { + reg = <0x3e4000 DT_SIZE_K(64)>; }; - cpuflpr_code_partition: partition@3F4000 { - reg = <0x3F4000 DT_SIZE_K(48)>; + cpuflpr_code_partition: partition@3f4000 { + reg = <0x3f4000 DT_SIZE_K(48)>; }; cpurad_slot0_partition: partition@400000 { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 12ef4b4bb828..7ae6e8ca81a2 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -139,7 +139,7 @@ * - Bell 18: cpurad * - Bells 24, 25, 29, 31: cpucell */ - nordic,interrupt-mapping = <0xA3042041 0>; + nordic,interrupt-mapping = <0xa3042041 0>; }; &cpurad_bellboard { diff --git a/boards/nordic/thingy52/thingy52_nrf52832.dts b/boards/nordic/thingy52/thingy52_nrf52832.dts index e081ae877ce2..a023b06e55b9 100644 --- a/boards/nordic/thingy52/thingy52_nrf52832.dts +++ b/boards/nordic/thingy52/thingy52_nrf52832.dts @@ -206,12 +206,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts index e3b4465b0751..d74952119839 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts +++ b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts @@ -154,7 +154,7 @@ fem_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x17000>; + reg = <0x0000c000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/nxp/frdm_k22f/frdm_k22f.dts b/boards/nxp/frdm_k22f/frdm_k22f.dts index 0ca83d4f905c..0a6d810ad8ff 100644 --- a/boards/nxp/frdm_k22f/frdm_k22f.dts +++ b/boards/nxp/frdm_k22f/frdm_k22f.dts @@ -231,14 +231,14 @@ zephyr_uhc0: &usbh { reg = <0x00010000 DT_SIZE_K(182)>; }; - slot1_partition: partition@3D800 { + slot1_partition: partition@3d800 { label = "image-1"; - reg = <0x0003D800 DT_SIZE_K(182)>; + reg = <0x0003d800 DT_SIZE_K(182)>; }; - storage_partition: partition@6B000 { + storage_partition: partition@6b000 { label = "storage"; - reg = <0x0006B000 DT_SIZE_K(84)>; + reg = <0x0006b000 DT_SIZE_K(84)>; }; }; }; diff --git a/boards/nxp/frdm_mcxa153/frdm_mcxa153.dts b/boards/nxp/frdm_mcxa153/frdm_mcxa153.dts index 8f568d40ddbd..4219f02b8447 100644 --- a/boards/nxp/frdm_mcxa153/frdm_mcxa153.dts +++ b/boards/nxp/frdm_mcxa153/frdm_mcxa153.dts @@ -169,9 +169,9 @@ reg = <0x00012000 DT_SIZE_K(40)>; }; - storage_partition: partition@1C000 { + storage_partition: partition@1c000 { label = "storage"; - reg = <0x0001C000 DT_SIZE_K(16)>; + reg = <0x0001c000 DT_SIZE_K(16)>; }; }; }; diff --git a/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts b/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts index 9e6433e974d7..069c3a06ee21 100644 --- a/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts +++ b/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts @@ -127,9 +127,9 @@ reg = <0x00004000 DT_SIZE_K(100)>; }; - slot1_partition: partition@1D000 { + slot1_partition: partition@1d000 { label = "image-1"; - reg = <0x0001D000 DT_SIZE_K(100)>; + reg = <0x0001d000 DT_SIZE_K(100)>; }; storage_partition: partition@36000 { diff --git a/boards/nxp/frdm_mcxa577/frdm_mcxa577.dts b/boards/nxp/frdm_mcxa577/frdm_mcxa577.dts index d395e97c3e2a..e47bb5fe58c9 100644 --- a/boards/nxp/frdm_mcxa577/frdm_mcxa577.dts +++ b/boards/nxp/frdm_mcxa577/frdm_mcxa577.dts @@ -148,9 +148,9 @@ reg = <0x00100000 DT_SIZE_K(896)>; }; - storage_partition: partition@1E0000 { + storage_partition: partition@1e0000 { label = "storage"; - reg = <0x001E0000 DT_SIZE_K(128)>; + reg = <0x001e0000 DT_SIZE_K(128)>; }; }; }; diff --git a/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts b/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts index b120147eb273..fcd50f6e129f 100644 --- a/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts +++ b/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts @@ -188,7 +188,7 @@ i2c0: &i2c0 { status = "okay"; pinctrl-0 = <&pinmux_tpm0>; pinctrl-names = "default"; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 24>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 24>; }; zephyr_udc0: &usb { diff --git a/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts b/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts index b5e83a71fb5a..0f24cc60cf73 100644 --- a/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts +++ b/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts @@ -381,9 +381,9 @@ nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 { reg = <0x0084000 DT_SIZE_K(440)>; }; - storage_partition: partition@F0000 { + storage_partition: partition@f0000 { label = "storage"; - reg = <0x000F0000 DT_SIZE_K(64)>; + reg = <0x000f0000 DT_SIZE_K(64)>; }; }; }; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi b/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi index a02998337b55..908f5f209d7f 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi @@ -278,9 +278,9 @@ arduino_serial: &flexcomm2_lpuart2 {}; reg = <0x00014000 DT_SIZE_K(984)>; }; - slot1_partition: partition@10A000 { + slot1_partition: partition@10a000 { label = "image-1"; - reg = <0x0010A000 DT_SIZE_K(984)>; + reg = <0x0010a000 DT_SIZE_K(984)>; }; /* storage_partition is placed in WINBOND flash memory*/ }; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts index 7e4ac87cb46a..562c73a76ce0 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts @@ -88,9 +88,9 @@ }; /* Non-secure image - secondary */ - slot1_ns_partition: partition@E0000 { + slot1_ns_partition: partition@e0000 { label = "image-1-non-secure"; - reg = <0x000E0000 DT_SIZE_K(256)>; /* 256 KB */ + reg = <0x000e0000 DT_SIZE_K(256)>; /* 256 KB */ }; /* Protected Storage (PS) */ diff --git a/boards/nxp/frdm_mcxw23/dts/bypass_first_32k.overlay b/boards/nxp/frdm_mcxw23/dts/bypass_first_32k.overlay index 7b61d0957bab..51d95fefdacd 100644 --- a/boards/nxp/frdm_mcxw23/dts/bypass_first_32k.overlay +++ b/boards/nxp/frdm_mcxw23/dts/bypass_first_32k.overlay @@ -5,5 +5,5 @@ */ &sram0 { - reg = <0x2000C000 DT_SIZE_K(80)>; + reg = <0x2000c000 DT_SIZE_K(80)>; }; diff --git a/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts b/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts index 7edb77a0eda9..7c5301729855 100644 --- a/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts +++ b/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts @@ -186,17 +186,17 @@ arduino_i2c: &lpi2c1 {}; reg = <0x10000 DT_SIZE_K(424)>; }; - slot1_partition: partition@7A000 { - reg = <0x7A000 DT_SIZE_K(424)>; + slot1_partition: partition@7a000 { + reg = <0x7a000 DT_SIZE_K(424)>; }; - storage_partition: partition@E4000 { - reg = <0xE4000 DT_SIZE_K(104)>; + storage_partition: partition@e4000 { + reg = <0xe4000 DT_SIZE_K(104)>; }; - hw_params_partition: partition@FE000 { + hw_params_partition: partition@fe000 { label = "hw-parameters"; - reg = <0xFE000 DT_SIZE_K(8)>; + reg = <0xfe000 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/nxp/frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts b/boards/nxp/frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts index cf753867af50..29d78a02faa7 100644 --- a/boards/nxp/frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts +++ b/boards/nxp/frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts @@ -134,13 +134,13 @@ reg = <0x0 DT_SIZE_K(2024)>; }; - storage_partition: partition@1FA000 { - reg = <0x1FA000 DT_SIZE_K(16)>; + storage_partition: partition@1fa000 { + reg = <0x1fa000 DT_SIZE_K(16)>; }; - hw_params_partition: partition@1FE000 { + hw_params_partition: partition@1fe000 { label = "hw-parameters"; - reg = <0x1FE000 DT_SIZE_K(8)>; + reg = <0x1fe000 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/nxp/imx95_evk/imx95_evk_mimx9596_m7.dts b/boards/nxp/imx95_evk/imx95_evk_mimx9596_m7.dts index 7e513f583660..ff220f6ad5c5 100644 --- a/boards/nxp/imx95_evk/imx95_evk_mimx9596_m7.dts +++ b/boards/nxp/imx95_evk/imx95_evk_mimx9596_m7.dts @@ -91,9 +91,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts b/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts index 973570648784..d5b5cb3e7eed 100644 --- a/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts +++ b/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts @@ -119,9 +119,9 @@ reg = <0x00008000 DT_SIZE_K(208)>; }; - slot1_partition: partition@3C000 { + slot1_partition: partition@3c000 { label = "image-1"; - reg = <0x0003C000 DT_SIZE_K(208)>; + reg = <0x0003c000 DT_SIZE_K(208)>; }; storage_partition: partition@70000 { diff --git a/boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi b/boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi index 8332a3eea471..3862ffa98e30 100644 --- a/boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi +++ b/boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi @@ -146,9 +146,9 @@ nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 { reg = <0x00014000 DT_SIZE_K(984)>; }; - slot1_partition: partition@10A000 { + slot1_partition: partition@10a000 { label = "image-1"; - reg = <0x0010A000 DT_SIZE_K(984)>; + reg = <0x0010a000 DT_SIZE_K(984)>; }; /* storage_partition is placed in WINBOND flash memory*/ diff --git a/boards/nxp/mcxw23_evk/dts/bypass_first_32k.overlay b/boards/nxp/mcxw23_evk/dts/bypass_first_32k.overlay index 7b61d0957bab..51d95fefdacd 100644 --- a/boards/nxp/mcxw23_evk/dts/bypass_first_32k.overlay +++ b/boards/nxp/mcxw23_evk/dts/bypass_first_32k.overlay @@ -5,5 +5,5 @@ */ &sram0 { - reg = <0x2000C000 DT_SIZE_K(80)>; + reg = <0x2000c000 DT_SIZE_K(80)>; }; diff --git a/boards/nxp/mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts b/boards/nxp/mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts index 672f7712c6cf..0164309e733f 100644 --- a/boards/nxp/mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts +++ b/boards/nxp/mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts @@ -134,13 +134,13 @@ reg = <0x0 DT_SIZE_K(2024)>; }; - storage_partition: partition@1FA000 { - reg = <0x1FA000 DT_SIZE_K(16)>; + storage_partition: partition@1fa000 { + reg = <0x1fa000 DT_SIZE_K(16)>; }; - hw_params_partition: partition@1FE000 { + hw_params_partition: partition@1fe000 { label = "hw-parameters"; - reg = <0x1FE000 DT_SIZE_K(8)>; + reg = <0x1fe000 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts b/boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts index bf416dae98e7..f08a6d2c005b 100644 --- a/boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts +++ b/boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts @@ -130,9 +130,9 @@ arduino_serial: &lpuart1 {}; reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts b/boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts index 22f2cab4767d..ef36e75c99e8 100644 --- a/boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts +++ b/boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts @@ -127,9 +127,9 @@ arduino_serial: &lpuart4 { reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts b/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts index 07a86e4e8588..bca1718913be 100644 --- a/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts +++ b/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts @@ -127,9 +127,9 @@ arduino_serial: &lpuart2 { reg = <0x00201000 DT_SIZE_K(1924)>; }; - storage_partition: partition@3E2000 { + storage_partition: partition@3e2000 { label = "storage"; - reg = <0x003E2000 DT_SIZE_K(120)>; + reg = <0x003e2000 DT_SIZE_K(120)>; }; }; }; diff --git a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk_mimxrt1062_qspi_C.overlay b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk_mimxrt1062_qspi_C.overlay index 63862a724c02..c4d2f4a4ba1f 100644 --- a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk_mimxrt1062_qspi_C.overlay +++ b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk_mimxrt1062_qspi_C.overlay @@ -40,7 +40,7 @@ audio_codec: wm8962@1a { compatible = "wolfson,wm8962"; reg = <0x1a>; - clocks = <&ccm IMX_CCM_SAI1_CLK 0x7C 18>; + clocks = <&ccm IMX_CCM_SAI1_CLK 0x7c 18>; clock-names = "mclk"; }; }; @@ -86,9 +86,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi b/boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi index ac1b5c6af4c6..8a1d8af112ed 100644 --- a/boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi +++ b/boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi @@ -128,9 +128,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi index 5059c202dd5f..45541035e5f3 100644 --- a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi +++ b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi @@ -298,9 +298,9 @@ arduino_spi: &lpspi1 { reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm4_B.overlay b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm4_B.overlay index 64236b4ce536..44e4487c78f5 100644 --- a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm4_B.overlay +++ b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm4_B.overlay @@ -57,9 +57,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(50) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(50) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay index a073a86d6a83..27d5325b0f77 100644 --- a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay +++ b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay @@ -60,9 +60,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(50) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(50) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi b/boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi index 5b21283a7041..220216046328 100644 --- a/boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi +++ b/boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi @@ -232,9 +232,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts b/boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts index 2bf7fa89d26a..694d2fb80c00 100644 --- a/boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts +++ b/boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts @@ -395,9 +395,9 @@ zephyr_lcdif: &lcdif {}; reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@E20000 { + storage_partition: partition@e20000 { label = "storage"; - reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/rd_rw612_bga/dts/goworld_16880_lcm.overlay b/boards/nxp/rd_rw612_bga/dts/goworld_16880_lcm.overlay index 3f338f241a3a..5085022b4fad 100644 --- a/boards/nxp/rd_rw612_bga/dts/goworld_16880_lcm.overlay +++ b/boards/nxp/rd_rw612_bga/dts/goworld_16880_lcm.overlay @@ -46,15 +46,15 @@ width = <480>; invert-mode = "1-dot"; frmctl1 = [80 10]; - bpc = [1F 50 00 20]; - dfc = [8A 07 3B]; + bpc = [1f 50 00 20]; + dfc = [8a 07 3b]; pwr1 = [80 64]; pwr2 = <0x13>; - pwr3 = <0xA7>; + pwr3 = <0xa7>; vcmpctl = <0x09>; - doca = [40 8A 00 00 29 19 A5 38]; - pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31]; - ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32]; + doca = [40 8a 00 00 29 19 a5 38]; + pgc = [f0 06 0b 07 06 05 2e 33 47 3a 17 16 2e 31]; + ngc = [f0 09 0d 09 08 23 2e 33 46 38 13 13 2c 32]; madctl = <0x28>; }; }; diff --git a/boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts b/boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts index ebd2cd80cee8..c98192a4cd81 100644 --- a/boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts +++ b/boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts @@ -253,14 +253,14 @@ zephyr_udc0: &usbotg { reg = <0x00010000 DT_SIZE_K(932)>; }; - slot1_partition: partition@F9000 { + slot1_partition: partition@f9000 { label = "image-1"; - reg = <0x000F9000 DT_SIZE_K(932)>; + reg = <0x000f9000 DT_SIZE_K(932)>; }; - storage_partition: partition@1E2000 { + storage_partition: partition@1e2000 { label = "storage"; - reg = <0x001E2000 DT_SIZE_K(120)>; + reg = <0x001e2000 DT_SIZE_K(120)>; }; }; }; diff --git a/boards/nxp/twr_kv58f220m/twr_kv58f220m.dts b/boards/nxp/twr_kv58f220m/twr_kv58f220m.dts index 4af2188aef3a..b886da936808 100644 --- a/boards/nxp/twr_kv58f220m/twr_kv58f220m.dts +++ b/boards/nxp/twr_kv58f220m/twr_kv58f220m.dts @@ -137,14 +137,14 @@ reg = <0x00010000 DT_SIZE_K(424)>; }; - slot1_partition: partition@7A000 { + slot1_partition: partition@7a000 { label = "image-1"; - reg = <0x0007A000 DT_SIZE_K(424)>; + reg = <0x0007a000 DT_SIZE_K(424)>; }; - storage_partition: partition@E4000 { + storage_partition: partition@e4000 { label = "storage"; - reg = <0x000E4000 DT_SIZE_K(112)>; + reg = <0x000e4000 DT_SIZE_K(112)>; }; }; }; 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 e3c4f20166f5..a2aa5736737d 100644 --- a/boards/openisa/rv32m1_vega/rv32m1_vega_openisa_rv32m1_ri5cy.dts +++ b/boards/openisa/rv32m1_vega/rv32m1_vega_openisa_rv32m1_ri5cy.dts @@ -59,7 +59,7 @@ boot_partition: partition@f4000 { label = "mcuboot"; - reg = <0x000f4000 0x0000C000>; + reg = <0x000f4000 0x0000c000>; }; }; }; diff --git a/boards/panasonic/pan1770_evb/pan1770_evb.dts b/boards/panasonic/pan1770_evb/pan1770_evb.dts index fa2fd75e6cc5..9ce07b12ac45 100644 --- a/boards/panasonic/pan1770_evb/pan1770_evb.dts +++ b/boards/panasonic/pan1770_evb/pan1770_evb.dts @@ -265,12 +265,12 @@ arduino_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x000000000 0x0000C000>; + reg = <0x000000000 0x0000c000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00067000>; + reg = <0x0000c000 0x00067000>; }; slot1_partition: partition@73000 { diff --git a/boards/panasonic/pan1780_evb/pan1780_evb.dts b/boards/panasonic/pan1780_evb/pan1780_evb.dts index 27cfc4208e31..72585a723f36 100644 --- a/boards/panasonic/pan1780_evb/pan1780_evb.dts +++ b/boards/panasonic/pan1780_evb/pan1780_evb.dts @@ -265,12 +265,12 @@ arduino_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x000000000 0x0000C000>; + reg = <0x000000000 0x0000c000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00067000>; + reg = <0x0000c000 0x00067000>; }; slot1_partition: partition@73000 { diff --git a/boards/panasonic/pan1782_evb/pan1782_evb.dts b/boards/panasonic/pan1782_evb/pan1782_evb.dts index 7186348edd5a..f9b027606ef5 100644 --- a/boards/panasonic/pan1782_evb/pan1782_evb.dts +++ b/boards/panasonic/pan1782_evb/pan1782_evb.dts @@ -191,27 +191,27 @@ arduino_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x000000000 0xC000>; + reg = <0x000000000 0xc000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { label = "image-scratch"; - reg = <0x00070000 0xA000>; + reg = <0x00070000 0xa000>; }; storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007A000 0x00006000>; + reg = <0x0007a000 0x00006000>; }; }; }; diff --git a/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi b/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi index 4fc10e6f8147..f25de361d20c 100644 --- a/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi +++ b/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi @@ -194,7 +194,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x17000>; + reg = <0x0000c000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/phytec/reel_board/reel_board.dts b/boards/phytec/reel_board/reel_board.dts index 4c8997a1c4e4..b819d372cdc9 100644 --- a/boards/phytec/reel_board/reel_board.dts +++ b/boards/phytec/reel_board/reel_board.dts @@ -72,9 +72,9 @@ border-waveform = <0x71>; dummy-line = <0x1a>; gate-line-width = <0x08>; - lut = [22 55 AA 55 AA 55 AA 11 + lut = [22 55 aa 55 aa 55 aa 11 00 00 00 00 00 00 00 00 - 1E 1E 1E 1E 1E 1E 1E 1E + 1e 1e 1e 1e 1e 1e 1e 1e 01 00 00 00 00]; }; @@ -87,7 +87,7 @@ gate-line-width = <0x08>; lut = [18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0F 01 00 00 00 00 00 00 + 0f 01 00 00 00 00 00 00 00 00 00 00 00]; }; }; diff --git a/boards/phytec/reel_board/reel_board_nrf52840_2.overlay b/boards/phytec/reel_board/reel_board_nrf52840_2.overlay index d2766240872b..f2749f66f205 100644 --- a/boards/phytec/reel_board/reel_board_nrf52840_2.overlay +++ b/boards/phytec/reel_board/reel_board_nrf52840_2.overlay @@ -99,7 +99,7 @@ 40 00 00 00 00 00 00 /* LUT2: WB: VS0..6 */ 80 00 00 00 00 00 00 /* LUT3: WW: VS0..6 */ 00 00 00 00 00 00 00 /* LUT4: VCOM: VS0..6 */ - 0A 00 00 00 04 /* TP0A TP0B TP0C TP0D RP0 */ + 0a 00 00 00 04 /* TP0A TP0B TP0C TP0D RP0 */ 00 00 00 00 00 /* TP1A TP1B TP1C TP1D RP1 */ 00 00 00 00 00 /* TP2A TP2B TP2C TP2D RP2 */ 00 00 00 00 00 /* TP3A TP3B TP3C TP3D RP3 */ diff --git a/boards/pine64/pinetime_devkit0/pinetime_devkit0.dts b/boards/pine64/pinetime_devkit0/pinetime_devkit0.dts index e5a3cd0473f6..b69c5ddfb328 100644 --- a/boards/pine64/pinetime_devkit0/pinetime_devkit0.dts +++ b/boards/pine64/pinetime_devkit0/pinetime_devkit0.dts @@ -109,10 +109,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; - nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; - ram-param = [00 F0]; - rgb-param = [CD 08 14]; + pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; + nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; + ram-param = [00 f0]; + rgb-param = [cd 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; @@ -236,7 +236,7 @@ /* main firmware partition */ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x74000>; + reg = <0x0000c000 0x74000>; }; }; }; diff --git a/boards/qorvo/decawave_dwm1001_dev/decawave_dwm1001_dev.dts b/boards/qorvo/decawave_dwm1001_dev/decawave_dwm1001_dev.dts index d78f4df1f20f..ea8021b88644 100644 --- a/boards/qorvo/decawave_dwm1001_dev/decawave_dwm1001_dev.dts +++ b/boards/qorvo/decawave_dwm1001_dev/decawave_dwm1001_dev.dts @@ -178,12 +178,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts index 9ce633a01c63..44481be48bd6 100644 --- a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts +++ b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts @@ -139,12 +139,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xC000>; + reg = <0x00000000 0xc000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x38000>; + reg = <0x0000c000 0x38000>; }; slot1_partition: partition@44000 { @@ -154,7 +154,7 @@ storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007A000 0x00006000>; + reg = <0x0007a000 0x00006000>; }; }; }; diff --git a/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts b/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts index b6893a916f70..cd362309e198 100644 --- a/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts +++ b/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts @@ -134,7 +134,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x17000>; + reg = <0x0000c000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts index 6b4aa354bb91..85802f9c8766 100644 --- a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts +++ b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts @@ -44,7 +44,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x17000>; + reg = <0x0000c000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts index 6b4aa354bb91..85802f9c8766 100644 --- a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts +++ b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts @@ -44,7 +44,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x17000>; + reg = <0x0000c000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts b/boards/renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts index 9d1efcd347ea..1ddc19d6b15d 100644 --- a/boards/renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts +++ b/boards/renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts @@ -151,7 +151,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(12)>; + reg = <0x0 DT_SIZE_K(12)>; }; }; }; diff --git a/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_psram.overlay b/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_psram.overlay index e44f1484bc5c..f1e0f2ed807f 100644 --- a/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_psram.overlay +++ b/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_psram.overlay @@ -19,9 +19,9 @@ status = "okay"; is-ram; dev-size = ; - dev-type = <0x5D>; - dev-id = <0x0D>; - dev-density = <0xE040>; + dev-type = <0x5d>; + dev-id = <0x0d>; + dev-density = <0xe040>; reset-delay-us = <50>; read-cs-idle-min-ns = <18>; tcem-max-us = <2>; @@ -30,7 +30,7 @@ extra-byte-enable; extra-byte = <0x0>; dummy-bytes-count = "dummy-bytes-count2"; - read-cmd = <0xEB>; + read-cmd = <0xeb>; write-cmd = <0x38>; rx-inst-mode = "quad-spi"; rx-addr-mode = "quad-spi"; diff --git a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_psram.overlay b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_psram.overlay index e44f1484bc5c..f1e0f2ed807f 100644 --- a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_psram.overlay +++ b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_psram.overlay @@ -19,9 +19,9 @@ status = "okay"; is-ram; dev-size = ; - dev-type = <0x5D>; - dev-id = <0x0D>; - dev-density = <0xE040>; + dev-type = <0x5d>; + dev-id = <0x0d>; + dev-density = <0xe040>; reset-delay-us = <50>; read-cs-idle-min-ns = <18>; tcem-max-us = <2>; @@ -30,7 +30,7 @@ extra-byte-enable; extra-byte = <0x0>; dummy-bytes-count = "dummy-bytes-count2"; - read-cmd = <0xEB>; + read-cmd = <0xeb>; write-cmd = <0x38>; rx-inst-mode = "quad-spi"; rx-addr-mode = "quad-spi"; diff --git a/boards/renesas/ek_ra2a1/ek_ra2a1.dts b/boards/renesas/ek_ra2a1/ek_ra2a1.dts index 48e422257383..22315fb8e653 100644 --- a/boards/renesas/ek_ra2a1/ek_ra2a1.dts +++ b/boards/renesas/ek_ra2a1/ek_ra2a1.dts @@ -159,7 +159,7 @@ ssdiv = "1.00"; so = <0x108>; snum = <0x01>; - sdpa = <0x0B>; + sdpa = <0x0b>; on-freq = <3>; off-freq = <3>; drift-freq = <255>; diff --git a/boards/renesas/ek_ra4e2/ek_ra4e2.dts b/boards/renesas/ek_ra4e2/ek_ra4e2.dts index 75643d16b91c..22d3f66185d8 100644 --- a/boards/renesas/ek_ra4e2/ek_ra4e2.dts +++ b/boards/renesas/ek_ra4e2/ek_ra4e2.dts @@ -213,7 +213,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(4)>; + reg = <0x0 DT_SIZE_K(4)>; }; }; }; diff --git a/boards/renesas/ek_ra4m2/ek_ra4m2.dts b/boards/renesas/ek_ra4m2/ek_ra4m2.dts index 04bfe461a2fc..486d9411116d 100644 --- a/boards/renesas/ek_ra4m2/ek_ra4m2.dts +++ b/boards/renesas/ek_ra4m2/ek_ra4m2.dts @@ -175,7 +175,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/ek_ra4m3/ek_ra4m3.dts b/boards/renesas/ek_ra4m3/ek_ra4m3.dts index 0d00778baa37..5b7db6c3becc 100644 --- a/boards/renesas/ek_ra4m3/ek_ra4m3.dts +++ b/boards/renesas/ek_ra4m3/ek_ra4m3.dts @@ -173,7 +173,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/ek_ra6e2/ek_ra6e2.dts b/boards/renesas/ek_ra6e2/ek_ra6e2.dts index 2b806a5dce7f..ac5e1e64e7eb 100644 --- a/boards/renesas/ek_ra6e2/ek_ra6e2.dts +++ b/boards/renesas/ek_ra6e2/ek_ra6e2.dts @@ -189,7 +189,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(4)>; + reg = <0x0 DT_SIZE_K(4)>; }; }; }; diff --git a/boards/renesas/ek_ra6m1/ek_ra6m1.dts b/boards/renesas/ek_ra6m1/ek_ra6m1.dts index ce09e71c8afb..9b429c7a5308 100644 --- a/boards/renesas/ek_ra6m1/ek_ra6m1.dts +++ b/boards/renesas/ek_ra6m1/ek_ra6m1.dts @@ -143,7 +143,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/ek_ra6m2/ek_ra6m2.dts b/boards/renesas/ek_ra6m2/ek_ra6m2.dts index 3de37950b8e9..73ea49c3d956 100644 --- a/boards/renesas/ek_ra6m2/ek_ra6m2.dts +++ b/boards/renesas/ek_ra6m2/ek_ra6m2.dts @@ -139,7 +139,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(32)>; + reg = <0x0 DT_SIZE_K(32)>; }; }; }; diff --git a/boards/renesas/ek_ra6m3/ek_ra6m3.dts b/boards/renesas/ek_ra6m3/ek_ra6m3.dts index ce22f083a3fe..44eb89fd38b9 100644 --- a/boards/renesas/ek_ra6m3/ek_ra6m3.dts +++ b/boards/renesas/ek_ra6m3/ek_ra6m3.dts @@ -190,7 +190,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(64)>; + reg = <0x0 DT_SIZE_K(64)>; }; }; }; diff --git a/boards/renesas/ek_ra6m4/ek_ra6m4.dts b/boards/renesas/ek_ra6m4/ek_ra6m4.dts index 5b664eee0021..4b4a6db6cb9c 100644 --- a/boards/renesas/ek_ra6m4/ek_ra6m4.dts +++ b/boards/renesas/ek_ra6m4/ek_ra6m4.dts @@ -313,7 +313,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; @@ -362,7 +362,7 @@ pmod_header: &pmod2_header {}; }; ð { - local-mac-address = [74 90 50 B0 6D 5D]; + local-mac-address = [74 90 50 b0 6d 5d]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/ek_ra6m5/ek_ra6m5.dts b/boards/renesas/ek_ra6m5/ek_ra6m5.dts index 28e844b3a1fb..6f63b055b1f4 100644 --- a/boards/renesas/ek_ra6m5/ek_ra6m5.dts +++ b/boards/renesas/ek_ra6m5/ek_ra6m5.dts @@ -284,7 +284,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; @@ -316,7 +316,7 @@ arduino_spi: &spi0 {}; }; ð { - local-mac-address = [74 90 50 B0 6D 5C]; + local-mac-address = [74 90 50 b0 6d 5c]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/ek_ra8d1/ek_ra8d1.dts b/boards/renesas/ek_ra8d1/ek_ra8d1.dts index e941eaa577c9..83be7187b5f2 100644 --- a/boards/renesas/ek_ra8d1/ek_ra8d1.dts +++ b/boards/renesas/ek_ra8d1/ek_ra8d1.dts @@ -319,7 +319,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(12)>; + reg = <0x0 DT_SIZE_K(12)>; }; }; }; @@ -367,7 +367,7 @@ }; ð { - local-mac-address = [74 90 50 B0 5D E9]; + local-mac-address = [74 90 50 b0 5d e9]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/ek_ra8m1/ek_ra8m1.dts b/boards/renesas/ek_ra8m1/ek_ra8m1.dts index 9cec8fe638dc..de68c6933123 100644 --- a/boards/renesas/ek_ra8m1/ek_ra8m1.dts +++ b/boards/renesas/ek_ra8m1/ek_ra8m1.dts @@ -371,7 +371,7 @@ mikrobus_spi: &spi1 {}; storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(12)>; + reg = <0x0 DT_SIZE_K(12)>; }; }; }; @@ -397,7 +397,7 @@ pmod_serial: &pmod1_serial {}; pmod_header: &pmod1_header {}; ð { - local-mac-address = [74 90 50 B0 6D 5A]; + local-mac-address = [74 90 50 b0 6d 5a]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/ek_rx261/ek_rx261.dts b/boards/renesas/ek_rx261/ek_rx261.dts index e7841dd2dfc3..9ef757f9ed40 100644 --- a/boards/renesas/ek_rx261/ek_rx261.dts +++ b/boards/renesas/ek_rx261/ek_rx261.dts @@ -133,7 +133,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/fpb_ra4e1/fpb_ra4e1.dts b/boards/renesas/fpb_ra4e1/fpb_ra4e1.dts index 4f62f92bc014..d01787531b91 100644 --- a/boards/renesas/fpb_ra4e1/fpb_ra4e1.dts +++ b/boards/renesas/fpb_ra4e1/fpb_ra4e1.dts @@ -152,7 +152,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/fpb_ra6e1/fpb_ra6e1.dts b/boards/renesas/fpb_ra6e1/fpb_ra6e1.dts index 61a1bc73235c..494bffd04350 100644 --- a/boards/renesas/fpb_ra6e1/fpb_ra6e1.dts +++ b/boards/renesas/fpb_ra6e1/fpb_ra6e1.dts @@ -112,7 +112,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts b/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts index e5965dd83c49..26dd38f38bb3 100644 --- a/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts +++ b/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts @@ -90,7 +90,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(4)>; + reg = <0x0 DT_SIZE_K(4)>; }; }; }; diff --git a/boards/renesas/fpb_rx261/fpb_rx261.dts b/boards/renesas/fpb_rx261/fpb_rx261.dts index d735a73f4585..d9877e56c4be 100644 --- a/boards/renesas/fpb_rx261/fpb_rx261.dts +++ b/boards/renesas/fpb_rx261/fpb_rx261.dts @@ -115,7 +115,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/mck_ra8t1/mck_ra8t1.dts b/boards/renesas/mck_ra8t1/mck_ra8t1.dts index 90528485d355..aeedfd02a436 100644 --- a/boards/renesas/mck_ra8t1/mck_ra8t1.dts +++ b/boards/renesas/mck_ra8t1/mck_ra8t1.dts @@ -171,7 +171,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(12)>; + reg = <0x0 DT_SIZE_K(12)>; }; }; }; @@ -204,7 +204,7 @@ }; ð { - local-mac-address = [74 90 50 6D 81 75]; + local-mac-address = [74 90 50 6d 81 75]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/rsk_rx130/rsk_rx130.dts b/boards/renesas/rsk_rx130/rsk_rx130.dts index 92b04bcf6ec0..6c15d97e411a 100644 --- a/boards/renesas/rsk_rx130/rsk_rx130.dts +++ b/boards/renesas/rsk_rx130/rsk_rx130.dts @@ -196,7 +196,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/rza2m_evk/rza2m_evk.dts b/boards/renesas/rza2m_evk/rza2m_evk.dts index 3db33997c522..8f1673aa1836 100644 --- a/boards/renesas/rza2m_evk/rza2m_evk.dts +++ b/boards/renesas/rza2m_evk/rza2m_evk.dts @@ -52,9 +52,9 @@ read-only; }; - slot0_partition: partition@E000 { + slot0_partition: partition@e000 { label = "image-0"; - reg = <0x0000E000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; + reg = <0x0000e000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; read-only; }; }; diff --git a/boards/renesas/voice_ra4e1/voice_ra4e1.dts b/boards/renesas/voice_ra4e1/voice_ra4e1.dts index 5e616c0933aa..46a6de50b45a 100644 --- a/boards/renesas/voice_ra4e1/voice_ra4e1.dts +++ b/boards/renesas/voice_ra4e1/voice_ra4e1.dts @@ -121,7 +121,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(8)>; + reg = <0x0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/ruiside/art_pi/art_pi.dts b/boards/ruiside/art_pi/art_pi.dts index 64d71fb2a341..c1ae16b23da4 100644 --- a/boards/ruiside/art_pi/art_pi.dts +++ b/boards/ruiside/art_pi/art_pi.dts @@ -30,7 +30,7 @@ sdram1: memory@c0000000 { compatible = "zephyr,memory-region", "mmio-sram"; device_type = "memory"; - reg = <0xC0000000 0x00600000>; /* Use 6 MB MAX 32MB */ + reg = <0xc0000000 0x00600000>; /* Use 6 MB MAX 32MB */ zephyr,memory-region = "SDRAM1"; zephyr,memory-attr = ; }; @@ -196,9 +196,9 @@ width = <800>; height = <480>; pixel-format = ; - def-back-color-red = <0X00>; - def-back-color-green = <0X00>; - def-back-color-blue = <0X00>; + def-back-color-red = <0x00>; + def-back-color-green = <0x00>; + def-back-color-blue = <0x00>; display-timings { compatible = "zephyr,panel-timing"; @@ -352,7 +352,7 @@ zephyr_udc0: &usbotg_fs { status = "okay"; phy-connection-type = "rmii"; phy-handle = <ð_phy>; - local-mac-address = [00 80 E1 2A 75 01]; + local-mac-address = [00 80 e1 2a 75 01]; pinctrl-0 = <ð_ref_clk_pa1 ð_crs_dv_pa7 ð_rxd0_pc4 diff --git a/boards/ruiside/ra8d1_vision_board/ra8d1_vision_board.dts b/boards/ruiside/ra8d1_vision_board/ra8d1_vision_board.dts index 6ee870de5e8c..2c4079c6e9d0 100644 --- a/boards/ruiside/ra8d1_vision_board/ra8d1_vision_board.dts +++ b/boards/ruiside/ra8d1_vision_board/ra8d1_vision_board.dts @@ -165,7 +165,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0X0 DT_SIZE_K(12)>; + reg = <0x0 DT_SIZE_K(12)>; }; }; }; diff --git a/boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts b/boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts index ef8188bc607c..c66c02e06ef9 100644 --- a/boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts +++ b/boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts @@ -119,12 +119,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/seeed/xiao_mg24/xiao_mg24.dts b/boards/seeed/xiao_mg24/xiao_mg24.dts index 0cf0e6cd0aa6..233a28e0d3ea 100644 --- a/boards/seeed/xiao_mg24/xiao_mg24.dts +++ b/boards/seeed/xiao_mg24/xiao_mg24.dts @@ -292,13 +292,13 @@ /* Reserve 736 kB for the application in slot 0 */ slot0_partition: partition@c000 { - reg = <0x0000c000 0x000B8000>; + reg = <0x0000c000 0x000b8000>; label = "image-0"; }; /* Reserve 736 kB for the application in slot 1 */ - slot1_partition: partition@C4000 { - reg = <0x000C4000 0x000B8000>; + slot1_partition: partition@c4000 { + reg = <0x000c4000 0x000b8000>; label = "image-1"; }; diff --git a/boards/shields/abrobot_esp32c3_oled/abrobot_sh1106_72x40.overlay b/boards/shields/abrobot_esp32c3_oled/abrobot_sh1106_72x40.overlay index 7160e706c87f..109befad278f 100644 --- a/boards/shields/abrobot_esp32c3_oled/abrobot_sh1106_72x40.overlay +++ b/boards/shields/abrobot_esp32c3_oled/abrobot_sh1106_72x40.overlay @@ -23,7 +23,7 @@ height = <40>; segment-offset = <30>; page-offset = <0>; - display-offset = <0xC>; + display-offset = <0xc>; multiplex-ratio = <0x27>; prechargep = <0x22>; ready-time-ms = <10>; diff --git a/boards/shields/arduino_giga_display_shield/arduino_giga_display_shield.overlay b/boards/shields/arduino_giga_display_shield/arduino_giga_display_shield.overlay index 5da125332dbd..0c74cc361b8d 100644 --- a/boards/shields/arduino_giga_display_shield/arduino_giga_display_shield.overlay +++ b/boards/shields/arduino_giga_display_shield/arduino_giga_display_shield.overlay @@ -14,21 +14,21 @@ data-lanes = <2>; pixel-format = ; rotation = <0>; - gip-e0 = [E0 00 00 02]; - gip-e1 = [E1 08 00 0A 00 07 00 09 00 00 33 33]; - gip-e2 = [E2 00 00 00 00 00 00 00 00 00 00 00 00 00]; - gip-e3 = [E3 00 00 33 33]; - gip-e4 = [E4 44 44]; - gip-e5 = [E5 0E 60 A0 A0 10 60 A0 A0 0A 60 A0 A0 0C 60 A0 A0]; - gip-e6 = [E6 00 00 33 33]; - gip-e7 = [E7 44 44]; - gip-e8 = [E8 0D 60 A0 A0 0F 60 A0 A0 09 60 A0 A0 0B 60 A0 A0]; - gip-eb = [EB 02 01 E4 E4 44 00 40]; - gip-ec = [EC 02 01]; - gip-ed = [ED AB 89 76 54 01 FF FF FF FF FF FF 10 45 67 98 BA]; - gip-ed = [ED AB 89 76 54 01 FF FF FF FF FF FF 10 45 67 98 BA]; - pvgamctrl = [B0 40 C9 91 0D 12 07 02 09 09 1F 04 50 0F E4 29 DF]; - nvgamctrl = [B1 40 CB D0 11 92 07 00 08 07 1C 06 53 12 63 EB DF]; + gip-e0 = [e0 00 00 02]; + gip-e1 = [e1 08 00 0a 00 07 00 09 00 00 33 33]; + gip-e2 = [e2 00 00 00 00 00 00 00 00 00 00 00 00 00]; + gip-e3 = [e3 00 00 33 33]; + gip-e4 = [e4 44 44]; + gip-e5 = [e5 0e 60 a0 a0 10 60 a0 a0 0a 60 a0 a0 0c 60 a0 a0]; + gip-e6 = [e6 00 00 33 33]; + gip-e7 = [e7 44 44]; + gip-e8 = [e8 0d 60 a0 a0 0f 60 a0 a0 09 60 a0 a0 0b 60 a0 a0]; + gip-eb = [eb 02 01 e4 e4 44 00 40]; + gip-ec = [ec 02 01]; + gip-ed = [ed ab 89 76 54 01 ff ff ff ff ff ff 10 45 67 98 ba]; + gip-ed = [ed ab 89 76 54 01 ff ff ff ff ff ff 10 45 67 98 ba]; + pvgamctrl = [b0 40 c9 91 0d 12 07 02 09 09 1f 04 50 0f e4 29 df]; + nvgamctrl = [b1 40 cb d0 11 92 07 00 08 07 1c 06 53 12 63 eb df]; display-timings { compatible = "zephyr,panel-timing"; diff --git a/boards/shields/g1120b0mipi/boards/mimxrt595_evk_mimxrt595s_cm33.overlay b/boards/shields/g1120b0mipi/boards/mimxrt595_evk_mimxrt595s_cm33.overlay index 7e9a98e68b96..94797404c03d 100644 --- a/boards/shields/g1120b0mipi/boards/mimxrt595_evk_mimxrt595s_cm33.overlay +++ b/boards/shields/g1120b0mipi/boards/mimxrt595_evk_mimxrt595s_cm33.overlay @@ -8,8 +8,8 @@ * so the SMARTDMA will continue functioning after deep sleep */ &suspend { - deep-sleep-config = <0xC800>, + deep-sleep-config = <0xc800>, <0x80030004>, - <0xFFFFFFFF>, + <0xffffffff>, <0>; }; diff --git a/boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay b/boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay index 8aa3ecd780d0..7d006f661f8a 100644 --- a/boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay +++ b/boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay @@ -51,15 +51,15 @@ width = <480>; invert-mode = "1-dot"; frmctl1 = [80 10]; - bpc = [1F 50 00 20]; - dfc = [8A 07 3B]; + bpc = [1f 50 00 20]; + dfc = [8a 07 3b]; pwr1 = [80 64]; pwr2 = <0x13>; - pwr3 = <0xA7>; + pwr3 = <0xa7>; vcmpctl = <0x09>; - doca = [40 8A 00 00 29 19 A5 33]; - pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31]; - ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32]; + doca = [40 8a 00 00 29 19 a5 33]; + pgc = [f0 06 0b 07 06 05 2e 33 47 3a 17 16 2e 31]; + ngc = [f0 09 0d 09 08 23 2e 33 46 38 13 13 2c 32]; madctl = <0x28>; color-invert; zephyr,deferred-init; diff --git a/boards/shields/lcd_par_s035/lcd_par_s035_spi.overlay b/boards/shields/lcd_par_s035/lcd_par_s035_spi.overlay index 902222860c83..7ac70db8252d 100644 --- a/boards/shields/lcd_par_s035/lcd_par_s035_spi.overlay +++ b/boards/shields/lcd_par_s035/lcd_par_s035_spi.overlay @@ -59,15 +59,15 @@ width = <480>; invert-mode = "1-dot"; frmctl1 = [80 10]; - bpc = [1F 50 00 20]; - dfc = [8A 07 3B]; + bpc = [1f 50 00 20]; + dfc = [8a 07 3b]; pwr1 = [80 64]; pwr2 = <0x13>; - pwr3 = <0xA7>; + pwr3 = <0xa7>; vcmpctl = <0x09>; - doca = [40 8A 00 00 29 19 A5 33]; - pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31]; - ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32]; + doca = [40 8a 00 00 29 19 a5 33]; + pgc = [f0 06 0b 07 06 05 2e 33 47 3a 17 16 2e 31]; + ngc = [f0 09 0d 09 08 23 2e 33 46 38 13 13 2c 32]; madctl = <0x28>; color-invert; zephyr,deferred-init; diff --git a/boards/shields/m5stack_cardputer/m5stack_cardputer.overlay b/boards/shields/m5stack_cardputer/m5stack_cardputer.overlay index 8befb2a66f29..d546518607be 100644 --- a/boards/shields/m5stack_cardputer/m5stack_cardputer.overlay +++ b/boards/shields/m5stack_cardputer/m5stack_cardputer.overlay @@ -49,7 +49,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 F0]; + ram-param = [00 f0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/shields/rtk0eg0019b01002bj/boards/rssk_ra2l1.overlay b/boards/shields/rtk0eg0019b01002bj/boards/rssk_ra2l1.overlay index f33505d135e1..570796e4afb3 100644 --- a/boards/shields/rtk0eg0019b01002bj/boards/rssk_ra2l1.overlay +++ b/boards/shields/rtk0eg0019b01002bj/boards/rssk_ra2l1.overlay @@ -16,9 +16,9 @@ group1 { ssdiv = "4.00", "4.00", "4.00"; - so = <0x03B>, <0x059>, <0x049>; + so = <0x03b>, <0x059>, <0x049>; snum = <0x07>, <0x07>, <0x07>; - sdpa = <0x0F>, <0x0F>, <0x0F>; + sdpa = <0x0f>, <0x0f>, <0x0f>; num-moving-avg = <4>; on-freq = <3>; off-freq = <3>; @@ -47,9 +47,9 @@ group2 { ssdiv = "4.00", "4.00", "4.00", "4.00", "4.00"; - so = <0x02B>, <0x03B>, <0x036>, <0x03B>, <0x03A>; + so = <0x02b>, <0x03b>, <0x036>, <0x03b>, <0x03a>; snum = <0x07>, <0x07>, <0x07>, <0x07>, <0x07>; - sdpa = <0x0F>, <0x0F>, <0x0F>, <0x0F>, <0x0F>; + sdpa = <0x0f>, <0x0f>, <0x0f>, <0x0f>, <0x0f>; num-moving-avg = <4>; on-freq = <3>; off-freq = <3>; @@ -67,7 +67,7 @@ ssdiv = "4.00", "4.00", "4.00", "4.00"; so = <0x047>, <0x046>, <0x049>, <0x040>; snum = <0x07>, <0x07>, <0x07>, <0x07>; - sdpa = <0x0F>, <0x0F>, <0x0F>, <0x0F>; + sdpa = <0x0f>, <0x0f>, <0x0f>, <0x0f>; num-moving-avg = <4>; on-freq = <3>; off-freq = <3>; diff --git a/boards/shields/rtk0eg0019b01002bj/rtk0eg0019b01002bj.overlay b/boards/shields/rtk0eg0019b01002bj/rtk0eg0019b01002bj.overlay index 5685903a6a78..0dd852974020 100644 --- a/boards/shields/rtk0eg0019b01002bj/rtk0eg0019b01002bj.overlay +++ b/boards/shields/rtk0eg0019b01002bj/rtk0eg0019b01002bj.overlay @@ -45,7 +45,7 @@ status = "okay"; group1 { - ctsuchac = <0x01 0x0E 0x00 0x00 0x00>; + ctsuchac = <0x01 0x0e 0x00 0x00 0x00>; ctsuchtrc = <0x01 0x00 0x00 0x00 0x00>; rx-count = <3>; tx-count = <0>; @@ -74,7 +74,7 @@ }; group2 { - ctsuchac = <0xF4 0x01 0x00 0x00 0x00>; + ctsuchac = <0xf4 0x01 0x00 0x00 0x00>; ctsuchtrc = <0x00 0x01 0x00 0x00 0x00>; rx-count = <5>; tx-count = <0>; @@ -90,7 +90,7 @@ }; group3 { - ctsuchac = <0x00 0x40 0xA4 0x00 0x01>; + ctsuchac = <0x00 0x40 0xa4 0x00 0x01>; ctsuchtrc = <0x00 0x40 0x00 0x00 0x00>; rx-count = <4>; tx-count = <0>; diff --git a/boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay b/boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay index 09f65e682343..64ad7436769a 100644 --- a/boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay +++ b/boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay @@ -39,10 +39,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [52 a1]; - pvgam-param = [D0 00 02 07 0B 1A 31 54 40 29 12 12 12 17]; - nvgam-param = [D0 00 02 07 05 15 2D 44 44 1C 18 16 1C 1D]; - ram-param = [00 F8]; - rgb-param = [CD 08 14]; + pvgam-param = [d0 00 02 07 0b 1a 31 54 40 29 12 12 12 17]; + nvgam-param = [d0 00 02 07 05 15 2d 44 44 1c 18 16 1c 1d]; + ram-param = [00 f8]; + rgb-param = [cd 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay b/boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay index bed545e1cc7f..93f9e0d76406 100644 --- a/boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay +++ b/boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay @@ -41,10 +41,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; - nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; - ram-param = [00 F0]; - rgb-param = [CD 08 14]; + pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; + nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; + ram-param = [00 f0]; + rgb-param = [cd 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b1.overlay b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b1.overlay index 0bd9a4a276c5..e0de86115606 100644 --- a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b1.overlay +++ b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b1.overlay @@ -35,9 +35,9 @@ border-waveform = <0x71>; dummy-line = <0x1a>; gate-line-width = <0x08>; - lut = [22 55 AA 55 AA 55 AA 11 + lut = [22 55 aa 55 aa 55 aa 11 00 00 00 00 00 00 00 00 - 1E 1E 1E 1E 1E 1E 1E 1E + 1e 1e 1e 1e 1e 1e 1e 1e 01 00 00 00 00]; }; @@ -50,7 +50,7 @@ gate-line-width = <0x08>; lut = [18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0F 01 00 00 00 00 00 00 + 0f 01 00 00 00 00 00 00 00 00 00 00 00]; }; }; diff --git a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b72.overlay b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b72.overlay index 247ab55152e3..69c1d1941531 100644 --- a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b72.overlay +++ b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b72.overlay @@ -61,7 +61,7 @@ 40 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0A 00 00 00 04 + 0a 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh029a1.overlay b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh029a1.overlay index 6dcfc0615ada..08a3cf7c96ed 100644 --- a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh029a1.overlay +++ b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh029a1.overlay @@ -35,9 +35,9 @@ border-waveform = <0x33>; dummy-line = <0x1a>; gate-line-width = <0x08>; - lut = [50 AA 55 AA 11 00 00 00 + lut = [50 aa 55 aa 11 00 00 00 00 00 00 00 00 00 00 00 - 00 00 00 00 FF FF 1F 00 + 00 00 00 00 ff ff 1f 00 00 00 00 00 00 00]; }; diff --git a/boards/shields/waveshare_epaper/waveshare_epaper_gdew042t2-p.overlay b/boards/shields/waveshare_epaper/waveshare_epaper_gdew042t2-p.overlay index 7cdc0d8611e4..7175bacfb5a4 100644 --- a/boards/shields/waveshare_epaper/waveshare_epaper_gdew042t2-p.overlay +++ b/boards/shields/waveshare_epaper/waveshare_epaper_gdew042t2-p.overlay @@ -45,7 +45,7 @@ pll = <0x3c>; vdcs = <0x08>; - lutc = [00 01 0E 00 00 01 + lutc = [00 01 0e 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -54,7 +54,7 @@ 00 00 00 00 00 00 00 00]; - lutww = [00 01 0E 00 00 01 + lutww = [00 01 0e 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -62,7 +62,7 @@ 00 00 00 00 00 00 00 00 00 00 00 00]; - lutkw = [20 01 0E 00 00 01 + lutkw = [20 01 0e 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -70,7 +70,7 @@ 00 00 00 00 00 00 00 00 00 00 00 00]; - lutwk = [10 01 0E 00 00 01 + lutwk = [10 01 0e 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -78,7 +78,7 @@ 00 00 00 00 00 00 00 00 00 00 00 00]; - lutkk = [00 01 0E 00 00 01 + lutkk = [00 01 0e 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/boards/shields/waveshare_pico_lcd_1_14/waveshare_pico_lcd_1_14_display.overlay b/boards/shields/waveshare_pico_lcd_1_14/waveshare_pico_lcd_1_14_display.overlay index eb027f772bba..674101776aa7 100644 --- a/boards/shields/waveshare_pico_lcd_1_14/waveshare_pico_lcd_1_14_display.overlay +++ b/boards/shields/waveshare_pico_lcd_1_14/waveshare_pico_lcd_1_14_display.overlay @@ -45,7 +45,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; - ram-param = [00 F0]; + ram-param = [00 f0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; status = "okay"; diff --git a/boards/silabs/radio_boards/bg29_rb4420a/bg29_rb4420a.dts b/boards/silabs/radio_boards/bg29_rb4420a/bg29_rb4420a.dts index 7b7b11e774de..b02ec2241caa 100644 --- a/boards/silabs/radio_boards/bg29_rb4420a/bg29_rb4420a.dts +++ b/boards/silabs/radio_boards/bg29_rb4420a/bg29_rb4420a.dts @@ -240,7 +240,7 @@ }; slot0_partition: partition@c000 { - reg = <0x0000C000 DT_SIZE_K(472)>; + reg = <0x0000c000 DT_SIZE_K(472)>; label = "image-0"; }; @@ -249,8 +249,8 @@ label = "image-1"; }; - storage_partition: partition@F8000 { - reg = <0x000F8000 DT_SIZE_K(32)>; + storage_partition: partition@f8000 { + reg = <0x000f8000 DT_SIZE_K(32)>; label = "storage"; }; }; diff --git a/boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts b/boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts index 2e12da2e7209..5a9b366ac57a 100644 --- a/boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts +++ b/boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts @@ -247,7 +247,7 @@ }; slot0_partition: partition@c000 { - reg = <0x0000C000 DT_SIZE_K(472)>; + reg = <0x0000c000 DT_SIZE_K(472)>; label = "image-0"; }; @@ -256,8 +256,8 @@ label = "image-1"; }; - storage_partition: partition@F8000 { - reg = <0x000F8000 DT_SIZE_K(32)>; + storage_partition: partition@f8000 { + reg = <0x000f8000 DT_SIZE_K(32)>; label = "storage"; }; }; diff --git a/boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts b/boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts index 84d1aa616066..f5406988423d 100644 --- a/boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts +++ b/boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts @@ -329,7 +329,7 @@ }; slot0_partition: partition@c000 { - reg = <0x0000C000 DT_SIZE_K(472)>; + reg = <0x0000c000 DT_SIZE_K(472)>; label = "image-0"; }; @@ -338,8 +338,8 @@ label = "image-1"; }; - storage_partition: partition@F8000 { - reg = <0x000F8000 DT_SIZE_K(32)>; + storage_partition: partition@f8000 { + reg = <0x000f8000 DT_SIZE_K(32)>; label = "storage"; }; }; diff --git a/boards/sipeed/longan_nano/longan_nano-common.dtsi b/boards/sipeed/longan_nano/longan_nano-common.dtsi index ddbfb71cfddf..71b184920c98 100644 --- a/boards/sipeed/longan_nano/longan_nano-common.dtsi +++ b/boards/sipeed/longan_nano/longan_nano-common.dtsi @@ -95,17 +95,17 @@ x-offset = <1>; y-offset = <26>; pwctr1 = [62 02 04]; - pwctr2 = [C0]; - pwctr3 = [0D 00]; - pwctr4 = [8D 6A]; - pwctr5 = [8D EE]; + pwctr2 = [c0]; + pwctr3 = [0d 00]; + pwctr4 = [8d 6a]; + pwctr5 = [8d ee]; invctr = <3>; - frmctr1 = [05 3A 3A]; - frmctr2 = [05 3A 3A]; - frmctr3 = [05 3A 3A 05 3A 3A]; + frmctr1 = [05 3a 3a]; + frmctr2 = [05 3a 3a]; + frmctr3 = [05 3a 3a 05 3a 3a]; vmctr1 = <14>; - gamctrp1 = [10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10]; - gamctrn1 = [10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10]; + gamctrp1 = [10 0e 02 03 0e 07 02 07 0a 12 27 37 00 0d 0e 10]; + gamctrn1 = [10 0e 03 03 0f 06 02 08 0a 13 26 36 00 0d 0e 10]; colmod = <5>; madctl = <120>; caset = [00 01 00 a0]; diff --git a/boards/sipeed/maix_m0s_dock/maix_m0s.dtsi b/boards/sipeed/maix_m0s_dock/maix_m0s.dtsi index c3b693ca02fe..d519e51590d5 100644 --- a/boards/sipeed/maix_m0s_dock/maix_m0s.dtsi +++ b/boards/sipeed/maix_m0s_dock/maix_m0s.dtsi @@ -28,9 +28,9 @@ }; &flashctrl { - flash0: flash@A0000000 { + flash0: flash@a0000000 { compatible = "soc-nv-flash", "gd,25lq32d"; - reg = <0xA0000000 (0x400000 - 0x2000)>; + reg = <0xa0000000 (0x400000 - 0x2000)>; write-block-size = <256>; erase-block-size = ; diff --git a/boards/sparkfun/micromod/micromod_nrf52840.dts b/boards/sparkfun/micromod/micromod_nrf52840.dts index a8b680f2b7f8..12ad64a582ab 100644 --- a/boards/sparkfun/micromod/micromod_nrf52840.dts +++ b/boards/sparkfun/micromod/micromod_nrf52840.dts @@ -190,9 +190,9 @@ * if enabled. */ - storage_partition: partition@fA000 { + storage_partition: partition@fa000 { label = "storage"; - reg = <0x000fA000 0x00006000>; + reg = <0x000fa000 0x00006000>; }; }; }; diff --git a/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts b/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts index b94606c56343..417c55339142 100644 --- a/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts +++ b/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts @@ -93,7 +93,7 @@ frmctr1 = [00 1b]; pwctrl1 = [10]; pwctrl2 = [10]; - pgamctrl = [0F 29 24 0c 0e 09 4e 78 3c 09 13 05 17 11 00]; + pgamctrl = [0f 29 24 0c 0e 09 4e 78 3c 09 13 05 17 11 00]; ngamctrl = [00 16 1b 04 11 07 31 33 42 05 0c 0a 28 2f 0f]; }; }; diff --git a/boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi b/boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi index cc992733ee62..270e177bd25d 100644 --- a/boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi +++ b/boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi @@ -147,9 +147,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 00]; pwctrl1-param = [a4 a1]; - pvgam-param = [D0 08 11 08 0C 15 39 33 50 36 13 14 29 2D]; - nvgam-param = [D0 08 10 08 06 06 39 44 51 0B 16 14 2F 31]; - ram-param = [00 F0]; + pvgam-param = [d0 08 11 08 0c 15 39 33 50 36 13 14 29 2d]; + nvgam-param = [d0 08 10 08 06 06 39 44 51 0b 16 14 2f 31]; + ram-param = [00 f0]; rgb-param = [40 02 14]; }; }; diff --git a/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi b/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi index 2e1c97da5a20..7bc9f456a194 100644 --- a/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi +++ b/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi @@ -108,9 +108,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 00]; pwctrl1-param = [a4 a1]; - pvgam-param = [D0 08 11 08 0C 15 39 33 50 36 13 14 29 2D]; - nvgam-param = [D0 08 10 08 06 06 39 44 51 0B 16 14 2F 31]; - ram-param = [00 F0]; + pvgam-param = [d0 08 11 08 0c 15 39 33 50 36 13 14 29 2d]; + nvgam-param = [d0 08 10 08 06 06 39 44 51 0b 16 14 2f 31]; + ram-param = [00 f0]; rgb-param = [40 02 14]; }; }; diff --git a/boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts b/boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts index 0882a8ed1b82..94d0b88b129f 100644 --- a/boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts +++ b/boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts @@ -77,12 +77,12 @@ slot0_partition: partition@8000 { label = "image-0"; - reg = <0x00008000 0xC000>; + reg = <0x00008000 0xc000>; }; slot1_partition: partition@14000 { label = "image-1"; - reg = <0x00014000 0xC000>; + reg = <0x00014000 0xc000>; }; }; }; diff --git a/boards/u-blox/ubx_bmd300eval/ubx_bmd300eval_nrf52832.dts b/boards/u-blox/ubx_bmd300eval/ubx_bmd300eval_nrf52832.dts index 83d789477c52..31e0366c2904 100644 --- a/boards/u-blox/ubx_bmd300eval/ubx_bmd300eval_nrf52832.dts +++ b/boards/u-blox/ubx_bmd300eval/ubx_bmd300eval_nrf52832.dts @@ -234,12 +234,12 @@ arduino_spi: &spi2 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/u-blox/ubx_bmd330eval/ubx_bmd330eval_nrf52810.dts b/boards/u-blox/ubx_bmd330eval/ubx_bmd330eval_nrf52810.dts index bc92435166ab..3c6dc6ae5e0c 100644 --- a/boards/u-blox/ubx_bmd330eval/ubx_bmd330eval_nrf52810.dts +++ b/boards/u-blox/ubx_bmd330eval/ubx_bmd330eval_nrf52810.dts @@ -208,7 +208,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0xd000>; + reg = <0x0000c000 0xd000>; }; slot1_partition: partition@19000 { diff --git a/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts b/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts index 1f2e2a1811a8..5a9367ca2463 100644 --- a/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts +++ b/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts @@ -209,7 +209,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0xd000>; + reg = <0x0000c000 0xd000>; }; slot1_partition: partition@19000 { diff --git a/boards/u-blox/ubx_evkannab1/ubx_evkannab1_nrf52832.dts b/boards/u-blox/ubx_evkannab1/ubx_evkannab1_nrf52832.dts index 00bf3657e8c9..f8a100549241 100644 --- a/boards/u-blox/ubx_evkannab1/ubx_evkannab1_nrf52832.dts +++ b/boards/u-blox/ubx_evkannab1/ubx_evkannab1_nrf52832.dts @@ -222,12 +222,12 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/u-blox/ubx_evkninab1/ubx_evkninab1_nrf52832.dts b/boards/u-blox/ubx_evkninab1/ubx_evkninab1_nrf52832.dts index 5a9100fd3366..a4cfec889240 100644 --- a/boards/u-blox/ubx_evkninab1/ubx_evkninab1_nrf52832.dts +++ b/boards/u-blox/ubx_evkninab1/ubx_evkninab1_nrf52832.dts @@ -222,12 +222,12 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/u-blox/ubx_evkninab4/ubx_evkninab4_nrf52833.dts b/boards/u-blox/ubx_evkninab4/ubx_evkninab4_nrf52833.dts index e74f3315deb1..6b286aa67913 100644 --- a/boards/u-blox/ubx_evkninab4/ubx_evkninab4_nrf52833.dts +++ b/boards/u-blox/ubx_evkninab4/ubx_evkninab4_nrf52833.dts @@ -227,27 +227,27 @@ arduino_spi: &spi2 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xC000>; + reg = <0x00000000 0xc000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { label = "image-scratch"; - reg = <0x00070000 0xA000>; + reg = <0x00070000 0xa000>; }; storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007A000 0x00006000>; + reg = <0x0007a000 0x00006000>; }; }; }; diff --git a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts index 7c3fa4fa51b8..c29e5c3cdf49 100644 --- a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts +++ b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts @@ -124,12 +124,12 @@ reg = <0x10000 DT_SIZE_K(424)>; }; - slot1_partition: partition@7A000 { - reg = <0x7A000 DT_SIZE_K(424)>; + slot1_partition: partition@7a000 { + reg = <0x7a000 DT_SIZE_K(424)>; }; - storage_partition: partition@E4000 { - reg = <0xE4000 DT_SIZE_K(112)>; + storage_partition: partition@e4000 { + reg = <0xe4000 DT_SIZE_K(112)>; }; }; }; diff --git a/boards/waveshare/rp2040_geek/rp2040_geek.dts b/boards/waveshare/rp2040_geek/rp2040_geek.dts index 488a176a92d6..89cbed0e5036 100644 --- a/boards/waveshare/rp2040_geek/rp2040_geek.dts +++ b/boards/waveshare/rp2040_geek/rp2040_geek.dts @@ -63,10 +63,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; - nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; - ram-param = [00 F0]; - rgb-param = [CD 08 14]; + pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; + nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; + ram-param = [00 f0]; + rgb-param = [cd 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/we/ophelia1ev/we_ophelia1ev_nrf52805.dts b/boards/we/ophelia1ev/we_ophelia1ev_nrf52805.dts index a200f645463c..2d68e7bd67f0 100644 --- a/boards/we/ophelia1ev/we_ophelia1ev_nrf52805.dts +++ b/boards/we/ophelia1ev/we_ophelia1ev_nrf52805.dts @@ -117,7 +117,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0xd000>; + reg = <0x0000c000 0xd000>; }; slot1_partition: partition@19000 { diff --git a/boards/we/proteus2ev/we_proteus2ev_nrf52832.dts b/boards/we/proteus2ev/we_proteus2ev_nrf52832.dts index b8dd6150ea6e..1628cfce73cd 100644 --- a/boards/we/proteus2ev/we_proteus2ev_nrf52832.dts +++ b/boards/we/proteus2ev/we_proteus2ev_nrf52832.dts @@ -115,12 +115,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x32000>; + reg = <0x0000c000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003E000 0x32000>; + reg = <0x0003e000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/weact/mini_stm32h743/mini_stm32h743.dts b/boards/weact/mini_stm32h743/mini_stm32h743.dts index 030369008a86..7e55c6457ba7 100644 --- a/boards/weact/mini_stm32h743/mini_stm32h743.dts +++ b/boards/weact/mini_stm32h743/mini_stm32h743.dts @@ -57,18 +57,18 @@ rgb-is-inverted; x-offset = <1>; y-offset = <26>; - pwctr1 = [A2 02 84]; - pwctr2 = [C5]; - pwctr3 = [0A 00]; - pwctr4 = [8A 2A]; - pwctr5 = [8A EE]; + pwctr1 = [a2 02 84]; + pwctr2 = [c5]; + pwctr3 = [0a 00]; + pwctr4 = [8a 2a]; + pwctr5 = [8a ee]; invctr = <7>; - frmctr1 = [01 2C 2D]; - frmctr2 = [01 2C 2D]; - frmctr3 = [01 2C 2D 01 2C 2D]; + frmctr1 = [01 2c 2d]; + frmctr2 = [01 2c 2d]; + frmctr3 = [01 2c 2d 01 2c 2d]; vmctr1 = <14>; - gamctrp1 = [02 1C 07 12 37 32 29 2D 29 25 2B 39 00 01 03 10]; - gamctrn1 = [03 1D 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10]; + gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2b 39 00 01 03 10]; + gamctrn1 = [03 1d 07 06 2e 2c 29 2d 2e 2e 37 3f 00 00 02 10]; colmod = <5>; /* Set D3 (RGB) bit to 1. LV_COLOR_16_SWAP is enabled by default */ madctl = <120>; /* Set to <184> to rotate the image 180 degrees. */ diff --git a/boards/weact/mini_stm32h7b0/mini_stm32h7b0.dts b/boards/weact/mini_stm32h7b0/mini_stm32h7b0.dts index a7093d8eadc2..b439dc2525e7 100644 --- a/boards/weact/mini_stm32h7b0/mini_stm32h7b0.dts +++ b/boards/weact/mini_stm32h7b0/mini_stm32h7b0.dts @@ -57,18 +57,18 @@ rgb-is-inverted; x-offset = <1>; y-offset = <26>; - pwctr1 = [A2 02 84]; - pwctr2 = [C5]; - pwctr3 = [0A 00]; - pwctr4 = [8A 2A]; - pwctr5 = [8A EE]; + pwctr1 = [a2 02 84]; + pwctr2 = [c5]; + pwctr3 = [0a 00]; + pwctr4 = [8a 2a]; + pwctr5 = [8a ee]; invctr = <7>; - frmctr1 = [01 2C 2D]; - frmctr2 = [01 2C 2D]; - frmctr3 = [01 2C 2D 01 2C 2D]; + frmctr1 = [01 2c 2d]; + frmctr2 = [01 2c 2d]; + frmctr3 = [01 2c 2d 01 2c 2d]; vmctr1 = <14>; - gamctrp1 = [02 1C 07 12 37 32 29 2D 29 25 2B 39 00 01 03 10]; - gamctrn1 = [03 1D 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10]; + gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2b 39 00 01 03 10]; + gamctrn1 = [03 1d 07 06 2e 2c 29 2d 2e 2e 37 3f 00 00 02 10]; colmod = <5>; /* Set D3 (RGB) bit to 1. LV_COLOR_16_SWAP is enabled by default */ madctl = <120>; /* Set to <184> to rotate the image 180 degrees. */ diff --git a/boards/witte/linum/linum.dts b/boards/witte/linum/linum.dts index 3254cdc078cb..f25e336a70aa 100644 --- a/boards/witte/linum/linum.dts +++ b/boards/witte/linum/linum.dts @@ -405,9 +405,9 @@ zephyr_udc0: &usbotg_fs { vfront-porch = <12>; }; - def-back-color-red = <0xFF>; - def-back-color-green = <0xFF>; - def-back-color-blue = <0xFF>; + def-back-color-red = <0xff>; + def-back-color-green = <0xff>; + def-back-color-blue = <0xff>; }; &sdmmc1 { diff --git a/doc/contribute/style/style-example.dts b/doc/contribute/style/style-example.dts index 9648b8e61ee2..4875e28b77ca 100644 --- a/doc/contribute/style/style-example.dts +++ b/doc/contribute/style/style-example.dts @@ -40,14 +40,14 @@ lcd0: lcd@0 { compatible = "sitronix,st7735r"; /* Split array values across multiple lines to help readability. */ - gamctrp1 = [10 0E 02 03 - 0E 07 02 07 - 0A 12 27 37 - 00 0D 0E 10]; - gamctrn1 = [10 0E 03 03 - 0F 06 02 08 - 0A 13 26 36 - 00 0D 0E 10]; + gamctrp1 = [10 0e 02 03 + 0e 07 02 07 + 0a 12 27 37 + 00 0d 0e 10]; + gamctrn1 = [10 0e 03 03 + 0f 06 02 08 + 0a 13 26 36 + 00 0d 0e 10]; }; }; }; diff --git a/dts/arc/synopsys/emsk.dtsi b/dts/arc/synopsys/emsk.dtsi index 212df83b3a36..f426ba311178 100644 --- a/dts/arc/synopsys/emsk.dtsi +++ b/dts/arc/synopsys/emsk.dtsi @@ -121,7 +121,7 @@ gpio2: gpio@f0002018 { compatible = "snps,designware-gpio"; - reg = <0xF0002018 0xc>; + reg = <0xf0002018 0xc>; ngpios = <32>; interrupt-parent = <&intc>; @@ -132,7 +132,7 @@ gpio3: gpio@f0002024 { compatible = "snps,designware-gpio"; - reg = <0xF0002024 0xc>; + reg = <0xf0002024 0xc>; ngpios = <12>; interrupt-parent = <&intc>; diff --git a/dts/arm/ambiq/ambiq_apollo3_blue.dtsi b/dts/arm/ambiq/ambiq_apollo3_blue.dtsi index a8829447951a..df6a5353ea8b 100644 --- a/dts/arm/ambiq/ambiq_apollo3_blue.dtsi +++ b/dts/arm/ambiq/ambiq_apollo3_blue.dtsi @@ -195,7 +195,7 @@ timer5: timer@400080a0 { compatible = "ambiq,ctimer"; - reg = <0x400080A0 0x20>; + reg = <0x400080a0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -214,7 +214,7 @@ timer6: timer@400080c0 { compatible = "ambiq,ctimer"; - reg = <0x400080C0 0x20>; + reg = <0x400080c0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -233,7 +233,7 @@ timer7: timer@400080e0 { compatible = "ambiq,ctimer"; - reg = <0x400080E0 0x20>; + reg = <0x400080e0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -434,7 +434,7 @@ rtc0: rtc@40004240 { compatible = "ambiq,rtc"; - reg = <0x40004240 0xD0>; + reg = <0x40004240 0xd0>; interrupts = <2 0>; alarms-count = <1>; status = "disabled"; diff --git a/dts/arm/ambiq/ambiq_apollo3p_blue.dtsi b/dts/arm/ambiq/ambiq_apollo3p_blue.dtsi index 541b306387c7..7f87afae83ce 100644 --- a/dts/arm/ambiq/ambiq_apollo3p_blue.dtsi +++ b/dts/arm/ambiq/ambiq_apollo3p_blue.dtsi @@ -71,7 +71,7 @@ /* SRAM */ sram0: memory@10010000 { compatible = "mmio-sram"; - reg = <0x10010000 0xB0000>; + reg = <0x10010000 0xb0000>; }; xip0: memory@52000000 { @@ -213,7 +213,7 @@ timer5: timer@400080a0 { compatible = "ambiq,ctimer"; - reg = <0x400080A0 0x20>; + reg = <0x400080a0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -232,7 +232,7 @@ timer6: timer@400080c0 { compatible = "ambiq,ctimer"; - reg = <0x400080C0 0x20>; + reg = <0x400080c0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -251,7 +251,7 @@ timer7: timer@400080e0 { compatible = "ambiq,ctimer"; - reg = <0x400080E0 0x20>; + reg = <0x400080e0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -473,7 +473,7 @@ rtc0: rtc@40004240 { compatible = "ambiq,rtc"; - reg = <0x40004240 0xD0>; + reg = <0x40004240 0xd0>; interrupts = <2 0>; alarms-count = <1>; status = "disabled"; diff --git a/dts/arm/ambiq/ambiq_apollo4p.dtsi b/dts/arm/ambiq/ambiq_apollo4p.dtsi index 9b39950a34c7..20192058d072 100644 --- a/dts/arm/ambiq/ambiq_apollo4p.dtsi +++ b/dts/arm/ambiq/ambiq_apollo4p.dtsi @@ -70,7 +70,7 @@ /* SRAM */ sram0: memory@10010000 { compatible = "mmio-sram"; - reg = <0x10010000 0x2B0000>; + reg = <0x10010000 0x2b0000>; }; soc { @@ -189,7 +189,7 @@ timer5: timer@400080a0 { compatible = "ambiq,timer"; - reg = <0x400080A0 0x20>; + reg = <0x400080a0 0x20>; interrupts = <72 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -207,7 +207,7 @@ timer6: timer@400080c0 { compatible = "ambiq,timer"; - reg = <0x400080C0 0x20>; + reg = <0x400080c0 0x20>; interrupts = <73 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -225,7 +225,7 @@ timer7: timer@400080e0 { compatible = "ambiq,timer"; - reg = <0x400080E0 0x20>; + reg = <0x400080e0 0x20>; interrupts = <74 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -333,7 +333,7 @@ timer13: timer@400081a0 { compatible = "ambiq,timer"; - reg = <0x400081A0 0x20>; + reg = <0x400081a0 0x20>; interrupts = <80 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -351,7 +351,7 @@ timer14: timer@400081c0 { compatible = "ambiq,timer"; - reg = <0x400081C0 0x20>; + reg = <0x400081c0 0x20>; interrupts = <81 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -369,7 +369,7 @@ timer15: timer@400081e0 { compatible = "ambiq,timer"; - reg = <0x400081E0 0x20>; + reg = <0x400081e0 0x20>; interrupts = <82 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -652,7 +652,7 @@ usb: usb@400b0000 { compatible = "ambiq,usb"; - reg = <0x400B0000 0x4100>; + reg = <0x400b0000 0x4100>; interrupts = <27 0>; num-bidir-endpoints = <6>; maximum-speed = "full-speed"; diff --git a/dts/arm/ambiq/ambiq_apollo4p_blue.dtsi b/dts/arm/ambiq/ambiq_apollo4p_blue.dtsi index e1f4ba71090e..113d1adf930d 100644 --- a/dts/arm/ambiq/ambiq_apollo4p_blue.dtsi +++ b/dts/arm/ambiq/ambiq_apollo4p_blue.dtsi @@ -84,7 +84,7 @@ /* SRAM */ sram0: memory@10010000 { compatible = "mmio-sram"; - reg = <0x10010000 0x2B0000>; + reg = <0x10010000 0x2b0000>; }; soc { @@ -203,7 +203,7 @@ timer5: timer@400080a0 { compatible = "ambiq,timer"; - reg = <0x400080A0 0x20>; + reg = <0x400080a0 0x20>; interrupts = <72 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -221,7 +221,7 @@ timer6: timer@400080c0 { compatible = "ambiq,timer"; - reg = <0x400080C0 0x20>; + reg = <0x400080c0 0x20>; interrupts = <73 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -239,7 +239,7 @@ timer7: timer@400080e0 { compatible = "ambiq,timer"; - reg = <0x400080E0 0x20>; + reg = <0x400080e0 0x20>; interrupts = <74 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -347,7 +347,7 @@ timer13: timer@400081a0 { compatible = "ambiq,timer"; - reg = <0x400081A0 0x20>; + reg = <0x400081a0 0x20>; interrupts = <80 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -365,7 +365,7 @@ timer14: timer@400081c0 { compatible = "ambiq,timer"; - reg = <0x400081C0 0x20>; + reg = <0x400081c0 0x20>; interrupts = <81 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -383,7 +383,7 @@ timer15: timer@400081e0 { compatible = "ambiq,timer"; - reg = <0x400081E0 0x20>; + reg = <0x400081e0 0x20>; interrupts = <82 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -651,7 +651,7 @@ usb: usb@400b0000 { compatible = "ambiq,usb"; - reg = <0x400B0000 0x4100>; + reg = <0x400b0000 0x4100>; interrupts = <27 0>; num-bidir-endpoints = <6>; maximum-speed = "full-speed"; diff --git a/dts/arm/ambiq/ambiq_apollo510.dtsi b/dts/arm/ambiq/ambiq_apollo510.dtsi index 8d60b8bf9d8a..d232b92f821a 100644 --- a/dts/arm/ambiq/ambiq_apollo510.dtsi +++ b/dts/arm/ambiq/ambiq_apollo510.dtsi @@ -758,8 +758,8 @@ 0x40 0x0 &gpio64_95 0x0 0x0 0x60 0x0 &gpio96_127 0x0 0x0 0x80 0x0 &gpio128_159 0x0 0x0 - 0xA0 0x0 &gpio160_191 0x0 0x0 - 0xC0 0x0 &gpio192_223 0x0 0x0>; + 0xa0 0x0 &gpio160_191 0x0 0x0 + 0xc0 0x0 &gpio192_223 0x0 0x0>; reg = ; #gpio-cells = <2>; #address-cells = <1>; diff --git a/dts/arm/atmel/samc2x.dtsi b/dts/arm/atmel/samc2x.dtsi index 4bdea798c2f0..bfc55053bd50 100644 --- a/dts/arm/atmel/samc2x.dtsi +++ b/dts/arm/atmel/samc2x.dtsi @@ -56,10 +56,10 @@ id: device_id@80a00c { compatible = "atmel,sam0-id"; - reg = <0x0080A00C 0x4>, - <0x0080A040 0x4>, - <0x0080A044 0x4>, - <0x0080A048 0x4>; + reg = <0x0080a00c 0x4>, + <0x0080a040 0x4>, + <0x0080a044 0x4>, + <0x0080a048 0x4>; }; soc { @@ -103,7 +103,7 @@ eic: eic@40002800 { compatible = "atmel,sam0-eic"; - reg = <0x40002800 0x1C>; + reg = <0x40002800 0x1c>; interrupts = <3 0>; }; diff --git a/dts/arm/atmel/samd2x.dtsi b/dts/arm/atmel/samd2x.dtsi index 437085d93c68..036d7d832676 100644 --- a/dts/arm/atmel/samd2x.dtsi +++ b/dts/arm/atmel/samd2x.dtsi @@ -55,10 +55,10 @@ id: device_id@80a00c { compatible = "atmel,sam0-id"; - reg = <0x0080A00C 0x4>, - <0x0080A040 0x4>, - <0x0080A044 0x4>, - <0x0080A048 0x4>; + reg = <0x0080a00c 0x4>, + <0x0080a040 0x4>, + <0x0080a044 0x4>, + <0x0080a048 0x4>; }; soc { @@ -97,7 +97,7 @@ eic: eic@40001800 { compatible = "atmel,sam0-eic"; - reg = <0x40001800 0x1C>; + reg = <0x40001800 0x1c>; interrupts = <4 0>; }; @@ -189,7 +189,7 @@ rtc: rtc@40001400 { compatible = "atmel,sam0-rtc"; - reg = <0x40001400 0x1C>; + reg = <0x40001400 0x1c>; interrupts = <3 0>; clocks = <&gclk 4 4>, <&pm 0x18 5>; clock-names = "GCLK", "PM"; @@ -201,7 +201,7 @@ adc: adc@42004000 { compatible = "atmel,sam0-adc"; - reg = <0x42004000 0x2B>; + reg = <0x42004000 0x2b>; status = "disabled"; #io-channel-cells = <1>; diff --git a/dts/arm/atmel/samd5x.dtsi b/dts/arm/atmel/samd5x.dtsi index 48092d2f9981..2e8d3f7713ea 100644 --- a/dts/arm/atmel/samd5x.dtsi +++ b/dts/arm/atmel/samd5x.dtsi @@ -85,7 +85,7 @@ id: device_id@8061fc { compatible = "atmel,sam0-id"; - reg = <0x008061FC 0x4>, + reg = <0x008061fc 0x4>, <0x00806010 0x4>, <0x00806014 0x4>, <0x00806018 0x4>; @@ -132,7 +132,7 @@ dmac: dmac@4100a000 { compatible = "atmel,sam0-dmac"; - reg = <0x4100A000 0x50>; + reg = <0x4100a000 0x50>; interrupts = <31 0>, <32 0>, <33 0>, <34 0>, <35 0>; status = "disabled"; @@ -253,7 +253,7 @@ sercom7: sercom@43000c00 { compatible = "atmel,sam0-sercom"; - reg = <0x43000C00 0x40>; + reg = <0x43000c00 0x40>; interrupts = <74 0>, <75 0>, <76 0>, <77 0>; clocks = <&gclk 37>, <&mclk 0x20 3>; clock-names = "GCLK", "MCLK"; @@ -341,7 +341,7 @@ adc0: adc@43001c00 { compatible = "atmel,sam0-adc"; - reg = <0x43001C00 0x4A>; + reg = <0x43001c00 0x4a>; interrupts = <118 0>, <119 0>; interrupt-names = "overrun", "resrdy"; clocks = <&gclk 40>, <&mclk 0x20 7>; @@ -366,7 +366,7 @@ adc1: adc@43002000 { compatible = "atmel,sam0-adc"; - reg = <0x43002000 0x4A>; + reg = <0x43002000 0x4a>; interrupts = <120 0>, <121 0>; interrupt-names = "overrun", "resrdy"; clocks = <&gclk 41>, <&mclk 0x20 8>; @@ -414,7 +414,7 @@ tc2: tc@4101a000 { compatible = "atmel,sam0-tc32"; - reg = <0x4101A000 0x34>; + reg = <0x4101a000 0x34>; interrupts = <109 0>; clocks = <&gclk 26>, <&mclk 0x18 13>; clock-names = "GCLK", "MCLK"; diff --git a/dts/arm/atmel/saml21.dtsi b/dts/arm/atmel/saml21.dtsi index de2f456e200a..da9b47dcb4b8 100644 --- a/dts/arm/atmel/saml21.dtsi +++ b/dts/arm/atmel/saml21.dtsi @@ -45,7 +45,7 @@ tcc2: tcc@42001c00 { compatible = "atmel,sam0-tcc"; - reg = <0x42001C00 0x80>; + reg = <0x42001c00 0x80>; interrupts = <16 0>; clocks = <&gclk 26>, <&mclk 0x1c 7>; clock-names = "GCLK", "MCLK"; diff --git a/dts/arm/atmel/saml2x.dtsi b/dts/arm/atmel/saml2x.dtsi index e2cb9bd11552..89149280fa6d 100644 --- a/dts/arm/atmel/saml2x.dtsi +++ b/dts/arm/atmel/saml2x.dtsi @@ -57,10 +57,10 @@ id: device_id@80a00c { compatible = "atmel,sam0-id"; - reg = <0x0080A00C 0x4>, - <0x0080A040 0x4>, - <0x0080A044 0x4>, - <0x0080A048 0x4>; + reg = <0x0080a00c 0x4>, + <0x0080a040 0x4>, + <0x0080a044 0x4>, + <0x0080a048 0x4>; }; soc { @@ -146,7 +146,7 @@ sercom3: sercom@42000c00 { compatible = "atmel,sam0-sercom"; - reg = <0x42000C00 0x40>; + reg = <0x42000c00 0x40>; status = "disabled"; }; diff --git a/dts/arm/atmel/samx7x.dtsi b/dts/arm/atmel/samx7x.dtsi index 129584f0eb98..88cdccbc6c6e 100644 --- a/dts/arm/atmel/samx7x.dtsi +++ b/dts/arm/atmel/samx7x.dtsi @@ -127,7 +127,7 @@ clock-frequency = ; #address-cells = <1>; #size-cells = <0>; - reg = <0x40018000 0x12B>; + reg = <0x40018000 0x12b>; interrupts = <19 0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 19>; status = "disabled"; @@ -138,7 +138,7 @@ clock-frequency = ; #address-cells = <1>; #size-cells = <0>; - reg = <0x4001c000 0x12B>; + reg = <0x4001c000 0x12b>; interrupts = <20 0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 20>; status = "disabled"; @@ -297,7 +297,7 @@ clock-frequency = ; #address-cells = <1>; #size-cells = <0>; - reg = <0x40060000 0x12B>; + reg = <0x40060000 0x12b>; interrupts = <41 0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 41>; status = "disabled"; diff --git a/dts/arm/elan/em32fxxx.dtsi b/dts/arm/elan/em32fxxx.dtsi index cdc5b0055b81..b88abbe182bb 100644 --- a/dts/arm/elan/em32fxxx.dtsi +++ b/dts/arm/elan/em32fxxx.dtsi @@ -145,8 +145,8 @@ uid: device_uid@40030f00 { compatible = "elan,em32-uid"; reg = <0x40030f00 0x4 /* Chip ID */ - 0x100A6020 0x4 /* Device ID */ - 0x100A6024 0x4 /* IC Version */ >; + 0x100a6020 0x4 /* Device ID */ + 0x100a6024 0x4 /* IC Version */ >; reg-names = "chip_id", "device_id", "ic_version"; status = "disabled"; }; diff --git a/dts/arm/ene/kb106x/kb1064.dtsi b/dts/arm/ene/kb106x/kb1064.dtsi index bce2c6160633..c8e2a7875c5a 100644 --- a/dts/arm/ene/kb106x/kb1064.dtsi +++ b/dts/arm/ene/kb106x/kb1064.dtsi @@ -57,7 +57,7 @@ pwm10: pwm@402100a0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100A0 0x10>; + reg = <0x402100a0 0x10>; pwm-channel = <10>; #pwm-cells = <3>; status = "disabled"; @@ -65,7 +65,7 @@ pwm11: pwm@402100b0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100B0 0x10>; + reg = <0x402100b0 0x10>; pwm-channel = <11>; #pwm-cells = <3>; status = "disabled"; @@ -73,7 +73,7 @@ pwm12: pwm@402100c0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100C0 0x10>; + reg = <0x402100c0 0x10>; pwm-channel = <12>; #pwm-cells = <3>; status = "disabled"; @@ -81,7 +81,7 @@ pwm13: pwm@402100d0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100D0 0x10>; + reg = <0x402100d0 0x10>; pwm-channel = <13>; #pwm-cells = <3>; status = "disabled"; @@ -89,7 +89,7 @@ pwm14: pwm@402100e0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100E0 0x10>; + reg = <0x402100e0 0x10>; pwm-channel = <14>; #pwm-cells = <3>; status = "disabled"; @@ -97,7 +97,7 @@ pwm15: pwm@402100f0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100F0 0x10>; + reg = <0x402100f0 0x10>; pwm-channel = <15>; #pwm-cells = <3>; status = "disabled"; diff --git a/dts/arm/ene/kb106x/kb106x.dtsi b/dts/arm/ene/kb106x/kb106x.dtsi index a95ecc049635..39fcdfd58eb0 100644 --- a/dts/arm/ene/kb106x/kb106x.dtsi +++ b/dts/arm/ene/kb106x/kb106x.dtsi @@ -93,7 +93,7 @@ gpio6x7x: gpio@5000000c { compatible = "ene,kb106x-gpio"; - reg = <0x5000000C 0x04>, <0x5001000C 0x04>; + reg = <0x5000000c 0x04>, <0x5001000c 0x04>; interrupts = <8 3>, <9 3>; gpio-controller; #gpio-cells = <2>; diff --git a/dts/arm/ene/kb1200.dtsi b/dts/arm/ene/kb1200.dtsi index f680de20066e..576046c612f0 100644 --- a/dts/arm/ene/kb1200.dtsi +++ b/dts/arm/ene/kb1200.dtsi @@ -92,7 +92,7 @@ gpio6x7x: gpio@5000000c { compatible = "ene,kb1200-gpio"; - reg = <0x5000000C 0x04>, <0x5001000C 0x04>; + reg = <0x5000000c 0x04>, <0x5001000c 0x04>; interrupts = <8 3>, <9 3>; gpio-controller; #gpio-cells = <2>; diff --git a/dts/arm/gd/gd32a50x/gd32a50x.dtsi b/dts/arm/gd/gd32a50x/gd32a50x.dtsi index 6fd4e0c5c83d..e9e95a1e2fe0 100644 --- a/dts/arm/gd/gd32a50x/gd32a50x.dtsi +++ b/dts/arm/gd/gd32a50x/gd32a50x.dtsi @@ -205,7 +205,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002C00 0x400>; + reg = <0x40002c00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32e10x/gd32e10x.dtsi b/dts/arm/gd/gd32e10x/gd32e10x.dtsi index 4d4adba3e95e..e1065e5ea116 100644 --- a/dts/arm/gd/gd32e10x/gd32e10x.dtsi +++ b/dts/arm/gd/gd32e10x/gd32e10x.dtsi @@ -172,7 +172,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002C00 0x400>; + reg = <0x40002c00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32e50x/gd32e50x.dtsi b/dts/arm/gd/gd32e50x/gd32e50x.dtsi index a02dd5df866b..ac50b013e178 100644 --- a/dts/arm/gd/gd32e50x/gd32e50x.dtsi +++ b/dts/arm/gd/gd32e50x/gd32e50x.dtsi @@ -208,7 +208,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002C00 0x400>; + reg = <0x40002c00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32f3x0/gd32f3x0.dtsi b/dts/arm/gd/gd32f3x0/gd32f3x0.dtsi index 95c56e3de0aa..daa27e011089 100644 --- a/dts/arm/gd/gd32f3x0/gd32f3x0.dtsi +++ b/dts/arm/gd/gd32f3x0/gd32f3x0.dtsi @@ -110,7 +110,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002C00 0x400>; + reg = <0x40002c00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32f403/gd32f403.dtsi b/dts/arm/gd/gd32f403/gd32f403.dtsi index 0b6ac33245c5..070d0a73f297 100644 --- a/dts/arm/gd/gd32f403/gd32f403.dtsi +++ b/dts/arm/gd/gd32f403/gd32f403.dtsi @@ -210,7 +210,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002C00 0x400>; + reg = <0x40002c00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32f4xx/gd32f4xx.dtsi b/dts/arm/gd/gd32f4xx/gd32f4xx.dtsi index f94ddc4e38e7..830f261d2ddc 100644 --- a/dts/arm/gd/gd32f4xx/gd32f4xx.dtsi +++ b/dts/arm/gd/gd32f4xx/gd32f4xx.dtsi @@ -294,7 +294,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002C00 0x400>; + reg = <0x40002c00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi b/dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi index 33f1a0b6a489..87c691a7de1a 100644 --- a/dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi +++ b/dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi @@ -169,7 +169,7 @@ adc2: adc@40004c00 { compatible = "infineon,xmc4xxx-adc"; - reg = <0x40004C00 0x400>; + reg = <0x40004c00 0x400>; interrupts = <26 62>; #io-channel-cells = <1>; status = "disabled"; @@ -247,7 +247,7 @@ }; ethernet@5000c000 { - reg = <0x5000C000 0x3FFF>; + reg = <0x5000c000 0x3fff>; eth: ethernet { compatible = "infineon,xmc4xxx-ethernet"; diff --git a/dts/arm/intel_socfpga_std/socfpga.dtsi b/dts/arm/intel_socfpga_std/socfpga.dtsi index accf63c8acfa..5575f44c894a 100644 --- a/dts/arm/intel_socfpga_std/socfpga.dtsi +++ b/dts/arm/intel_socfpga_std/socfpga.dtsi @@ -116,7 +116,7 @@ IRQ_DEFAULT_PRIORITY>, ; - reg = <0xfffec200 0x1C>; + reg = <0xfffec200 0x1c>; clocks = <&osc1>; }; diff --git a/dts/arm/microchip/mec/mec1501hsz.dtsi b/dts/arm/microchip/mec/mec1501hsz.dtsi index 5815a8859e69..460c81c234e0 100644 --- a/dts/arm/microchip/mec/mec1501hsz.dtsi +++ b/dts/arm/microchip/mec/mec1501hsz.dtsi @@ -41,7 +41,7 @@ }; flash0: flash@e0000 { - reg = <0x000E0000 0x38000>; + reg = <0x000e0000 0x38000>; }; sram0: memory@118000 { @@ -261,7 +261,7 @@ i2c_smb_3: i2c@40004c00 { compatible = "microchip,xec-i2c"; - reg = <0x40004C00 0x80>; + reg = <0x40004c00 0x80>; clock-frequency = ; interrupts = <23 1>; pcrs = <3 15>; @@ -309,7 +309,7 @@ clock-frequency = <48000000>; reg = <0x40000c00 0x20>; interrupts = <136 0>; - max-value = <0xFFFF>; + max-value = <0xffff>; prescaler = <0>; status = "disabled"; girqs = <23 0>; @@ -321,7 +321,7 @@ clock-frequency = <48000000>; reg = <0x40000c20 0x20>; interrupts = <137 0>; - max-value = <0xFFFF>; + max-value = <0xffff>; prescaler = <0>; status = "disabled"; girqs = <23 1>; @@ -339,7 +339,7 @@ clock-frequency = <48000000>; reg = <0x40000c80 0x20>; interrupts = <140 0>; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; prescaler = <0>; girqs = <23 4>; pcrs = <3 23>; @@ -351,7 +351,7 @@ clock-frequency = <48000000>; reg = <0x40000ca0 0x20>; interrupts = <141 0>; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; prescaler = <0>; girqs = <23 5>; pcrs = <3 24>; diff --git a/dts/arm/microchip/mec/mec1727nsz.dtsi b/dts/arm/microchip/mec/mec1727nsz.dtsi index fd3e7adabdea..32135ed7b412 100644 --- a/dts/arm/microchip/mec/mec1727nsz.dtsi +++ b/dts/arm/microchip/mec/mec1727nsz.dtsi @@ -44,7 +44,7 @@ }; flash0: flash@c0000 { - reg = <0x000C0000 0x58000>; + reg = <0x000c0000 0x58000>; }; flash1: flash@60000000 { diff --git a/dts/arm/microchip/mec/mec172x_common.dtsi b/dts/arm/microchip/mec/mec172x_common.dtsi index ba87bccd832a..9e07a70fc9ea 100644 --- a/dts/arm/microchip/mec/mec172x_common.dtsi +++ b/dts/arm/microchip/mec/mec172x_common.dtsi @@ -324,7 +324,7 @@ timer0: timer@40000c00 { interrupts = <136 0>; girqs = <23 0>; pcrs = <1 30>; - max-value = <0xFFFF>; + max-value = <0xffff>; prescaler = <0>; status = "disabled"; }; @@ -336,7 +336,7 @@ timer1: timer@40000c20 { interrupts = <137 0>; girqs = <23 1>; pcrs = <1 31>; - max-value = <0xFFFF>; + max-value = <0xffff>; prescaler = <0>; status = "disabled"; }; @@ -348,7 +348,7 @@ timer2: timer@40000c40 { interrupts = <138 0>; girqs = <23 2>; pcrs = <3 21>; - max-value = <0xFFFF>; + max-value = <0xffff>; prescaler = <0>; status = "disabled"; }; @@ -360,7 +360,7 @@ timer3: timer@40000c60 { interrupts = <139 0>; girqs = <23 3>; pcrs = <3 22>; - max-value = <0xFFFF>; + max-value = <0xffff>; prescaler = <0>; status = "disabled"; }; @@ -377,7 +377,7 @@ timer4: timer@40000c80 { interrupts = <140 0>; girqs = <23 4>; pcrs = <3 23>; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; prescaler = <0>; status = "disabled"; }; @@ -389,7 +389,7 @@ timer5: timer@40000ca0 { interrupts = <141 0>; girqs = <23 5>; pcrs = <3 24>; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; prescaler = <0>; status = "disabled"; }; @@ -539,7 +539,7 @@ i2c_smb_2: i2c@40004800 { i2c_smb_3: i2c@40004c00 { compatible = "microchip,xec-i2c-v2"; - reg = <0x40004C00 0x80>; + reg = <0x40004c00 0x80>; clock-frequency = ; interrupts = <23 1>; girqs = <13 3>; diff --git a/dts/arm/microchip/mec/mec172xnlj.dtsi b/dts/arm/microchip/mec/mec172xnlj.dtsi index 95b3b2e47b80..ff003ee9645d 100644 --- a/dts/arm/microchip/mec/mec172xnlj.dtsi +++ b/dts/arm/microchip/mec/mec172xnlj.dtsi @@ -46,7 +46,7 @@ }; flash0: flash@c0000 { - reg = <0x000C0000 0x58000>; + reg = <0x000c0000 0x58000>; }; sram0: memory@118000 { diff --git a/dts/arm/microchip/mec/mec172xnsz.dtsi b/dts/arm/microchip/mec/mec172xnsz.dtsi index 817e22361b8d..dc057238d914 100644 --- a/dts/arm/microchip/mec/mec172xnsz.dtsi +++ b/dts/arm/microchip/mec/mec172xnsz.dtsi @@ -46,7 +46,7 @@ }; flash0: flash@c0000 { - reg = <0x000C0000 0x58000>; + reg = <0x000c0000 0x58000>; }; sram0: memory@118000 { diff --git a/dts/arm/microchip/mec/mec5.dtsi b/dts/arm/microchip/mec/mec5.dtsi index 60de7b7afa6e..205ade2b642a 100644 --- a/dts/arm/microchip/mec/mec5.dtsi +++ b/dts/arm/microchip/mec/mec5.dtsi @@ -446,7 +446,7 @@ }; i2c_smb_3: i2c@40004c00 { - reg = <0x40004C00 0x80>; + reg = <0x40004c00 0x80>; clock-frequency = ; interrupts = <23 2>; girqs = <13 3>; diff --git a/dts/arm/microchip/pic32c/pic32cx_sg/common/pic32cx_sg.dtsi b/dts/arm/microchip/pic32c/pic32cx_sg/common/pic32cx_sg.dtsi index 8229fc230cf8..a4baa8623b65 100644 --- a/dts/arm/microchip/pic32c/pic32cx_sg/common/pic32cx_sg.dtsi +++ b/dts/arm/microchip/pic32c/pic32cx_sg/common/pic32cx_sg.dtsi @@ -234,7 +234,7 @@ dmac: dmac@4100a000 { compatible = "microchip,dmac-g1-dma"; - reg = <0x4100A000 0x50>; + reg = <0x4100a000 0x50>; interrupts = <31 0>, <32 0>, <33 0>, <34 0>, <35 0>; clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_AHB_DMAC>; clock-names = "mclk"; diff --git a/dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi b/dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi index 7edd0b21b5a3..8a6a753dbeb5 100644 --- a/dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi +++ b/dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi @@ -232,7 +232,7 @@ dmac: dmac@4100a000 { compatible = "microchip,dmac-g1-dma"; - reg = <0x4100A000 0x50>; + reg = <0x4100a000 0x50>; interrupts = <31 0>, <32 0>, <33 0>, <34 0>, <35 0>; clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_AHB_DMAC>; clock-names = "mclk"; diff --git a/dts/arm/nuvoton/m46x.dtsi b/dts/arm/nuvoton/m46x.dtsi index eef431800874..9c7ef77ce1f5 100644 --- a/dts/arm/nuvoton/m46x.dtsi +++ b/dts/arm/nuvoton/m46x.dtsi @@ -495,7 +495,7 @@ emac: ethernet@40012000 { compatible = "nuvoton,numaker-ethernet"; - reg = <0x40012000 0x105C>; + reg = <0x40012000 0x105c>; interrupts = <66 0>; resets = <&rst NUMAKER_EMAC0_RST>; phy-addr = <1>; diff --git a/dts/arm/nuvoton/npck/npck-alts-map.dtsi b/dts/arm/nuvoton/npck/npck-alts-map.dtsi index e702ef1b5413..71f00529dd66 100644 --- a/dts/arm/nuvoton/npck/npck-alts-map.dtsi +++ b/dts/arm/nuvoton/npck/npck-alts-map.dtsi @@ -359,19 +359,19 @@ /* SCFG DEVALT C */ altc_smb4b_sl: altc4 { - alts = <&scfg 0x0C 0x4 0>; + alts = <&scfg 0x0c 0x4 0>; }; altc_smb3b_sl: altc5 { - alts = <&scfg 0x0C 0x5 0>; + alts = <&scfg 0x0c 0x5 0>; }; altc_smb2b_sl: altc6 { - alts = <&scfg 0x0C 0x6 0>; + alts = <&scfg 0x0c 0x6 0>; }; altc_smb2a_sl: altc7 { - alts = <&scfg 0x0C 0x7 0>; + alts = <&scfg 0x0c 0x7 0>; }; /* SCFG DEVALT D */ diff --git a/dts/arm/nuvoton/npck/npck.dtsi b/dts/arm/nuvoton/npck/npck.dtsi index d64a3af5782b..a0003fb8fc4d 100644 --- a/dts/arm/nuvoton/npck/npck.dtsi +++ b/dts/arm/nuvoton/npck/npck.dtsi @@ -218,7 +218,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40095000 0x2000>; gpio-controller; - index = <0xA>; + index = <0xa>; #gpio-cells = <2>; }; @@ -226,7 +226,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40097000 0x2000>; gpio-controller; - index = <0xB>; + index = <0xb>; #gpio-cells = <2>; }; @@ -234,7 +234,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40099000 0x2000>; gpio-controller; - index = <0xC>; + index = <0xc>; #gpio-cells = <2>; }; @@ -242,7 +242,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009b000 0x2000>; gpio-controller; - index = <0xD>; + index = <0xd>; #gpio-cells = <2>; }; @@ -250,7 +250,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009d000 0x2000>; gpio-controller; - index = <0xE>; + index = <0xe>; #gpio-cells = <2>; }; @@ -258,7 +258,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009f000 0x2000>; gpio-controller; - index = <0xF>; + index = <0xf>; #gpio-cells = <2>; }; diff --git a/dts/arm/nuvoton/npck/npck3.dtsi b/dts/arm/nuvoton/npck/npck3.dtsi index 6de99add419a..8d31caa6babb 100644 --- a/dts/arm/nuvoton/npck/npck3.dtsi +++ b/dts/arm/nuvoton/npck/npck3.dtsi @@ -55,7 +55,7 @@ uart1: serial@400c4000 { compatible = "nuvoton,npcx-uart", "nuvoton,npcx-uart-npckn"; - reg = <0x400C4000 0x2000>; + reg = <0x400c4000 0x2000>; interrupts = <23 3>; clocks = <&pcc NPCX_CLOCK_BUS_APB2 NPCX_PWDWN_CTL1 4>; uart-rx = <&wui_cr_sin1>; @@ -279,6 +279,6 @@ soc-id { chip-id = <0x09>; - revision-reg = <0x0000FFFC 4>; + revision-reg = <0x0000fffc 4>; }; }; diff --git a/dts/arm/nuvoton/npck3m8k.dtsi b/dts/arm/nuvoton/npck3m8k.dtsi index fdd860b9495b..e07f97d1f0f4 100644 --- a/dts/arm/nuvoton/npck3m8k.dtsi +++ b/dts/arm/nuvoton/npck3m8k.dtsi @@ -18,13 +18,13 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(62)>; + reg = <0x200c0000 DT_SIZE_K(62)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200c7800 { compatible = "mmio-sram"; - reg = <0x200C7800 DT_SIZE_K(2)>; + reg = <0x200c7800 DT_SIZE_K(2)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx/npcx-alts-map.dtsi b/dts/arm/nuvoton/npcx/npcx-alts-map.dtsi index f5f71d6aed0e..f81686b30bb1 100644 --- a/dts/arm/nuvoton/npcx/npcx-alts-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx-alts-map.dtsi @@ -282,141 +282,141 @@ /* SCFG DEVALT A */ alta_no_kso16_sl: alta0-inv { - alts = <&scfg 0x0A 0x0 1>; + alts = <&scfg 0x0a 0x0 1>; }; alta_no_kso17_sl: alta1-inv { - alts = <&scfg 0x0A 0x1 1>; + alts = <&scfg 0x0a 0x1 1>; }; alta_32k_out_sl: alta2 { - alts = <&scfg 0x0A 0x2 0>; + alts = <&scfg 0x0a 0x2 0>; }; alta_no_vcc1_rst: alta4-inv { - alts = <&scfg 0x0A 0x4 1>; + alts = <&scfg 0x0a 0x4 1>; }; alta_no_peci_en: alta6-inv { - alts = <&scfg 0x0A 0x6 1>; + alts = <&scfg 0x0a 0x6 1>; }; /* SCFG DEVALT B */ altb_rxd_sl: altb0 { - alts = <&scfg 0x0B 0x0 0>; + alts = <&scfg 0x0b 0x0 0>; }; altb_txd_sl: altb1 { - alts = <&scfg 0x0B 0x1 0>; + alts = <&scfg 0x0b 0x1 0>; }; altb_rts_sl: altb2 { - alts = <&scfg 0x0B 0x2 0>; + alts = <&scfg 0x0b 0x2 0>; }; altb_cts_sl: altb3 { - alts = <&scfg 0x0B 0x3 0>; + alts = <&scfg 0x0b 0x3 0>; }; altb_ri_sl: altb4 { - alts = <&scfg 0x0B 0x4 0>; + alts = <&scfg 0x0b 0x4 0>; }; altb_dtr_bout_sl: altb5 { - alts = <&scfg 0x0B 0x5 0>; + alts = <&scfg 0x0b 0x5 0>; }; altb_dcd_sl: altb6 { - alts = <&scfg 0x0B 0x6 0>; + alts = <&scfg 0x0b 0x6 0>; }; altb_dsr_sl: altb7 { - alts = <&scfg 0x0B 0x7 0>; + alts = <&scfg 0x0b 0x7 0>; }; /* SCFG DEVALT C */ altc_shi_sl: altc1 { - alts = <&scfg 0x0C 0x1 0>; + alts = <&scfg 0x0c 0x1 0>; }; altc_ps2_3_sl2: altc3 { - alts = <&scfg 0x0C 0x3 0>; + alts = <&scfg 0x0c 0x3 0>; }; altc_ta1_sl2: altc4 { - alts = <&scfg 0x0C 0x4 0>; + alts = <&scfg 0x0c 0x4 0>; }; altc_tb1_sl2: altc5 { - alts = <&scfg 0x0C 0x5 0>; + alts = <&scfg 0x0c 0x5 0>; }; altc_ta2_sl2: altc6 { - alts = <&scfg 0x0C 0x6 0>; + alts = <&scfg 0x0c 0x6 0>; }; altc_tb2_sl2: altc7 { - alts = <&scfg 0x0C 0x7 0>; + alts = <&scfg 0x0c 0x7 0>; }; /* SCFG DEVALT D */ altd_psl_in1_ahi: altd0 { - alts = <&scfg 0x0D 0x0 0>; + alts = <&scfg 0x0d 0x0 0>; }; altd_npsl_in1_sl: altd1-inv { - alts = <&scfg 0x0D 0x1 1>; + alts = <&scfg 0x0d 0x1 1>; }; altd_psl_in2_ahi: altd2 { - alts = <&scfg 0x0D 0x2 0>; + alts = <&scfg 0x0d 0x2 0>; }; altd_npsl_in2_sl: altd3-inv { - alts = <&scfg 0x0D 0x3 1>; + alts = <&scfg 0x0d 0x3 1>; }; altd_psl_in3_ahi: altd4 { - alts = <&scfg 0x0D 0x4 0>; + alts = <&scfg 0x0d 0x4 0>; }; altd_psl_in3_sl: altd5 { - alts = <&scfg 0x0D 0x5 0>; + alts = <&scfg 0x0d 0x5 0>; }; altd_psl_in4_ahi: altd6 { - alts = <&scfg 0x0D 0x6 0>; + alts = <&scfg 0x0d 0x6 0>; }; altd_psl_in4_sl: altd7 { - alts = <&scfg 0x0D 0x7 0>; + alts = <&scfg 0x0d 0x7 0>; }; /* SCFG DEVALT E */ /* SCFG DEVALT F */ altf_adc5_sl: altf0 { - alts = <&scfg 0x0F 0x0 0>; + alts = <&scfg 0x0f 0x0 0>; }; altf_adc6_sl: altf1 { - alts = <&scfg 0x0F 0x1 0>; + alts = <&scfg 0x0f 0x1 0>; }; altf_adc7_sl: altf2 { - alts = <&scfg 0x0F 0x2 0>; + alts = <&scfg 0x0f 0x2 0>; }; altf_adc8_sl: altf3 { - alts = <&scfg 0x0F 0x3 0>; + alts = <&scfg 0x0f 0x3 0>; }; altf_adc9_sl: altf4 { - alts = <&scfg 0x0F 0x4 0>; + alts = <&scfg 0x0f 0x4 0>; }; altf_shi_new: altf7 { - alts = <&scfg 0x0F 0x7 0>; + alts = <&scfg 0x0f 0x7 0>; }; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx.dtsi b/dts/arm/nuvoton/npcx/npcx.dtsi index 4268c7f95ce5..27bc21e6909a 100644 --- a/dts/arm/nuvoton/npcx/npcx.dtsi +++ b/dts/arm/nuvoton/npcx/npcx.dtsi @@ -205,7 +205,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40095000 0x2000>; gpio-controller; - index = <0xA>; + index = <0xa>; #gpio-cells = <2>; }; @@ -213,7 +213,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40097000 0x2000>; gpio-controller; - index = <0xB>; + index = <0xb>; #gpio-cells = <2>; }; @@ -221,7 +221,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40099000 0x2000>; gpio-controller; - index = <0xC>; + index = <0xc>; #gpio-cells = <2>; }; @@ -229,7 +229,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009b000 0x2000>; gpio-controller; - index = <0xD>; + index = <0xd>; #gpio-cells = <2>; }; @@ -237,7 +237,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009d000 0x2000>; gpio-controller; - index = <0xE>; + index = <0xe>; #gpio-cells = <2>; }; @@ -245,7 +245,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009f000 0x2000>; gpio-controller; - index = <0xF>; + index = <0xf>; #gpio-cells = <2>; }; @@ -328,7 +328,7 @@ interrupts = <10 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB1 NPCX_PWDWN_CTL4 4>; vref-mv = <2816>; - speed-conf = <0x03 0x8B07 0x0100 0x0001>; + speed-conf = <0x03 0x8b07 0x0100 0x0001>; status = "disabled"; }; diff --git a/dts/arm/nuvoton/npcx/npcx4.dtsi b/dts/arm/nuvoton/npcx/npcx4.dtsi index a23ec0ddd7ff..674319121973 100644 --- a/dts/arm/nuvoton/npcx/npcx4.dtsi +++ b/dts/arm/nuvoton/npcx/npcx4.dtsi @@ -86,7 +86,7 @@ */ bbram: bb-ram@400af001 { compatible = "nuvoton,npcx-bbram"; - reg = <0x400af001 0x7F + reg = <0x400af001 0x7f 0x400af100 0x1>; reg-names = "memory", "status"; }; @@ -106,7 +106,7 @@ uart1: serial@400e0000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART1 register, Index 1: MDMA1 register */ - reg = <0x400E0000 0x2000 0x40011100 0x100>; + reg = <0x400e0000 0x2000 0x40011100 0x100>; interrupts = <33 4>; /* Index 0: UART1 clock, Index 1: MDMA1 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL1 4 @@ -118,7 +118,7 @@ uart2: serial@400e2000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART2 register, Index 1: MDMA2 register */ - reg = <0x400E2000 0x2000 0x40011200 0x100>; + reg = <0x400e2000 0x2000 0x40011200 0x100>; interrupts = <32 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 6 &pcc NPCX_CLOCK_BUS_CORE NPCX_PWDWN_CTL9 1>; @@ -129,7 +129,7 @@ uart3: serial@400e4000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART3 register, Index 1: MDMA3 register */ - reg = <0x400E4000 0x2000 0x40011300 0x100>; + reg = <0x400e4000 0x2000 0x40011300 0x100>; interrupts = <38 4>; /* Index 0: UART3 clock, Index 1: MDMA3 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 4 @@ -141,7 +141,7 @@ uart4: serial@400e6000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART4 register, Index 1: MDMA4 register */ - reg = <0x400E6000 0x2000 0x40011400 0x100>; + reg = <0x400e6000 0x2000 0x40011400 0x100>; interrupts = <39 4>; /* Index 0: UART4 clock, Index 1: MDMA4 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 3 @@ -386,7 +386,7 @@ interrupts = <22 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB1 NPCX_PWDWN_CTL4 3>; vref-mv = <3300>; - speed-conf = <0x03 0x8B07 0x0100 0x0001>; + speed-conf = <0x03 0x8b07 0x0100 0x0001>; channel-count = <26>; threshold-count = <6>; status = "disabled"; @@ -582,6 +582,6 @@ soc-id { family-id = <0x23>; chip-id = <0x0a>; - revision-reg = <0x0000FFFC 4>; + revision-reg = <0x0000fffc 4>; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx4/npcx4-alts-map.dtsi b/dts/arm/nuvoton/npcx/npcx4/npcx4-alts-map.dtsi index 731fed2cf1b4..0256890453b8 100644 --- a/dts/arm/nuvoton/npcx/npcx4/npcx4-alts-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx4/npcx4-alts-map.dtsi @@ -37,35 +37,35 @@ /* SCFG DEVALT E */ alte_cr_sin4_sl: alte6 { - alts = <&scfg 0x0E 0x6 0>; + alts = <&scfg 0x0e 0x6 0>; }; alte_cr_sout4_sl: alte7 { - alts = <&scfg 0x0E 0x7 0>; + alts = <&scfg 0x0e 0x7 0>; }; /* SCFG DEVALT F */ altf_adc10_sl: altf5 { - alts = <&scfg 0x0F 0x5 0>; + alts = <&scfg 0x0f 0x5 0>; }; altf_adc11_sl: altf6 { - alts = <&scfg 0x0F 0x6 0>; + alts = <&scfg 0x0f 0x6 0>; }; /* SCFG DEVALT A */ alta_32kclkin_sl: alta3 { - alts = <&scfg 0x0A 0x3 0>; + alts = <&scfg 0x0a 0x3 0>; }; /* SCFG DEVALT C */ altc_gpio97_sl_inv: altc2-inv { - alts = <&scfg 0x0C 0x2 1>; + alts = <&scfg 0x0c 0x2 1>; }; /* SCFG DEVALT F */ altf_adc12_sl: altf7 { - alts = <&scfg 0x0F 0x7 0>; + alts = <&scfg 0x0f 0x7 0>; }; /* SCFG DEVALT G */ diff --git a/dts/arm/nuvoton/npcx/npcx7.dtsi b/dts/arm/nuvoton/npcx/npcx7.dtsi index 8bd51870398c..63947cf0c090 100644 --- a/dts/arm/nuvoton/npcx/npcx7.dtsi +++ b/dts/arm/nuvoton/npcx/npcx7.dtsi @@ -102,7 +102,7 @@ uart1: serial@400c4000 { compatible = "nuvoton,npcx-uart"; - reg = <0x400C4000 0x2000>; + reg = <0x400c4000 0x2000>; interrupts = <33 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB2 NPCX_PWDWN_CTL1 4>; uart-rx = <&wui_cr_sin1>; @@ -111,7 +111,7 @@ uart2: serial@400c6000 { compatible = "nuvoton,npcx-uart"; - reg = <0x400C6000 0x2000>; + reg = <0x400c6000 0x2000>; interrupts = <32 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB2 NPCX_PWDWN_CTL7 6>; uart-rx = <&wui_cr_sin2>; @@ -377,7 +377,7 @@ soc-id { chip-id = <0x07>; - revision-reg = <0x00007FFC 1>; + revision-reg = <0x00007ffc 1>; }; booter-variant { diff --git a/dts/arm/nuvoton/npcx/npcx7/npcx7-alts-map.dtsi b/dts/arm/nuvoton/npcx/npcx7/npcx7-alts-map.dtsi index 173b7fb14424..e928abb1af38 100644 --- a/dts/arm/nuvoton/npcx/npcx7/npcx7-alts-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx7/npcx7-alts-map.dtsi @@ -28,29 +28,29 @@ /* SCFG DEVALT A */ alta_uart2_sl: alta5 { - alts = <&scfg 0x0A 0x5 0>; + alts = <&scfg 0x0a 0x5 0>; }; alta_uart1_sl1: alta7 { - alts = <&scfg 0x0A 0x7 0>; + alts = <&scfg 0x0a 0x7 0>; }; /* SCFG DEVALT C */ altc_uart1_sl2: altc0 { - alts = <&scfg 0x0C 0x0 0>; + alts = <&scfg 0x0c 0x0 0>; }; /* SCFG DEVALT E */ alte_wov_sl: alte0 { - alts = <&scfg 0x0E 0x0 0>; + alts = <&scfg 0x0e 0x0 0>; }; alte_i2s_sl: alte1 { - alts = <&scfg 0x0E 0x1 0>; + alts = <&scfg 0x0e 0x1 0>; }; alte_dmclk_fast: alte2 { - alts = <&scfg 0x0E 0x2 0>; + alts = <&scfg 0x0e 0x2 0>; }; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx7/npcx7-miwus-int-map.dtsi b/dts/arm/nuvoton/npcx/npcx7/npcx7-miwus-int-map.dtsi index 806d6f0a24f7..13ed889e0285 100644 --- a/dts/arm/nuvoton/npcx/npcx7/npcx7-miwus-int-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx7/npcx7-miwus-int-map.dtsi @@ -24,7 +24,7 @@ group_efgh0: group-efgh0-map { irq = <11>; irq-prio = <3>; - group-mask = <0xF0>; + group-mask = <0xf0>; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx9.dtsi b/dts/arm/nuvoton/npcx/npcx9.dtsi index b9c0190e0d31..2f0845d0c894 100644 --- a/dts/arm/nuvoton/npcx/npcx9.dtsi +++ b/dts/arm/nuvoton/npcx/npcx9.dtsi @@ -104,7 +104,7 @@ uart1: serial@400e0000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART1 register, Index 1: MDMA1 register */ - reg = <0x400E0000 0x2000 0x40011100 0x100>; + reg = <0x400e0000 0x2000 0x40011100 0x100>; interrupts = <33 4>; /* Index 0: UART1 clock, Index 1: MDMA1 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL1 4 @@ -116,7 +116,7 @@ uart2: serial@400e2000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART2 register, Index 1: MDMA2 register */ - reg = <0x400E2000 0x2000 0x40011200 0x100>; + reg = <0x400e2000 0x2000 0x40011200 0x100>; interrupts = <32 4>; /* Index 0: UART2 clock, Index 1: MDMA2 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 6 @@ -128,7 +128,7 @@ uart3: serial@400e4000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART3 register, Index 1: MDMA3 register */ - reg = <0x400E4000 0x2000 0x40011300 0x100>; + reg = <0x400e4000 0x2000 0x40011300 0x100>; interrupts = <38 4>; /* Index 0: UART3 clock, Index 1: MDMA3 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 4 @@ -140,7 +140,7 @@ uart4: serial@400e6000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART4 register, Index 1: MDMA4 register */ - reg = <0x400E6000 0x2000 0x40011400 0x100>; + reg = <0x400e6000 0x2000 0x40011400 0x100>; interrupts = <39 4>; /* Index 0: UART4 clock, Index 1: MDMA4 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 3 @@ -435,6 +435,6 @@ soc-id { chip-id = <0x09>; - revision-reg = <0x0000FFFC 4>; + revision-reg = <0x0000fffc 4>; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx9/npcx9-alts-map.dtsi b/dts/arm/nuvoton/npcx/npcx9/npcx9-alts-map.dtsi index bdfd7c47f93f..1438ad12780b 100644 --- a/dts/arm/nuvoton/npcx/npcx9/npcx9-alts-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx9/npcx9-alts-map.dtsi @@ -28,20 +28,20 @@ /* SCFG DEVALT E */ alte_cr_sin4_sl: alte6 { - alts = <&scfg 0x0E 0x6 0>; + alts = <&scfg 0x0e 0x6 0>; }; alte_cr_sout4_sl: alte7 { - alts = <&scfg 0x0E 0x7 0>; + alts = <&scfg 0x0e 0x7 0>; }; /* SCFG DEVALT F */ altf_adc10_sl: altf5 { - alts = <&scfg 0x0F 0x5 0>; + alts = <&scfg 0x0f 0x5 0>; }; altf_adc11_sl: altf6 { - alts = <&scfg 0x0F 0x6 0>; + alts = <&scfg 0x0f 0x6 0>; }; /* SCFG DEVALT G */ diff --git a/dts/arm/nuvoton/npcx4m3f.dtsi b/dts/arm/nuvoton/npcx4m3f.dtsi index 9f1792452b44..e0cb1ad17331 100644 --- a/dts/arm/nuvoton/npcx4m3f.dtsi +++ b/dts/arm/nuvoton/npcx4m3f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(96)>; + reg = <0x200c0000 DT_SIZE_K(96)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx4m8f.dtsi b/dts/arm/nuvoton/npcx4m8f.dtsi index ee427af47058..fc6789daf9ca 100644 --- a/dts/arm/nuvoton/npcx4m8f.dtsi +++ b/dts/arm/nuvoton/npcx4m8f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(114)>; + reg = <0x200c0000 DT_SIZE_K(114)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx7m6fb.dtsi b/dts/arm/nuvoton/npcx7m6fb.dtsi index 9c2b2e757efa..3a319dcc1beb 100644 --- a/dts/arm/nuvoton/npcx7m6fb.dtsi +++ b/dts/arm/nuvoton/npcx7m6fb.dtsi @@ -18,13 +18,13 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(62)>; + reg = <0x200c0000 DT_SIZE_K(62)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200cf800 { compatible = "mmio-sram"; - reg = <0x200CF800 DT_SIZE_K(2)>; + reg = <0x200cf800 DT_SIZE_K(2)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx7m6fc.dtsi b/dts/arm/nuvoton/npcx7m6fc.dtsi index 15d1b3c6b1df..7e31b5a3e62f 100644 --- a/dts/arm/nuvoton/npcx7m6fc.dtsi +++ b/dts/arm/nuvoton/npcx7m6fc.dtsi @@ -18,13 +18,13 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(62)>; + reg = <0x200c0000 DT_SIZE_K(62)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200cf800 { compatible = "mmio-sram"; - reg = <0x200CF800 DT_SIZE_K(2)>; + reg = <0x200cf800 DT_SIZE_K(2)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx7m7fc.dtsi b/dts/arm/nuvoton/npcx7m7fc.dtsi index 72aa5d17cea9..d89a8cb6eb9c 100644 --- a/dts/arm/nuvoton/npcx7m7fc.dtsi +++ b/dts/arm/nuvoton/npcx7m7fc.dtsi @@ -22,13 +22,13 @@ sram0: memory@200b0000 { compatible = "mmio-sram"; - reg = <0x200B0000 DT_SIZE_K(126)>; + reg = <0x200b0000 DT_SIZE_K(126)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200cf800 { compatible = "mmio-sram"; - reg = <0x200CF800 DT_SIZE_K(2)>; + reg = <0x200cf800 DT_SIZE_K(2)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx9m3f.dtsi b/dts/arm/nuvoton/npcx9m3f.dtsi index a82c33589ea0..d11039eeede6 100644 --- a/dts/arm/nuvoton/npcx9m3f.dtsi +++ b/dts/arm/nuvoton/npcx9m3f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(64)>; + reg = <0x200c0000 DT_SIZE_K(64)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx9m6f.dtsi b/dts/arm/nuvoton/npcx9m6f.dtsi index e0adaf8b0a56..15bb9c63332e 100644 --- a/dts/arm/nuvoton/npcx9m6f.dtsi +++ b/dts/arm/nuvoton/npcx9m6f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(64)>; + reg = <0x200c0000 DT_SIZE_K(64)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx9m7f.dtsi b/dts/arm/nuvoton/npcx9m7f.dtsi index 3d8f8d33330c..f73ab976826b 100644 --- a/dts/arm/nuvoton/npcx9m7f.dtsi +++ b/dts/arm/nuvoton/npcx9m7f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(64)>; + reg = <0x200c0000 DT_SIZE_K(64)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx9m7fb.dtsi b/dts/arm/nuvoton/npcx9m7fb.dtsi index c025c646d480..0b331db2bb69 100644 --- a/dts/arm/nuvoton/npcx9m7fb.dtsi +++ b/dts/arm/nuvoton/npcx9m7fb.dtsi @@ -18,12 +18,12 @@ sram0: memory@200b0000 { compatible = "mmio-sram"; - reg = <0x200B0000 DT_SIZE_K(128)>; + reg = <0x200b0000 DT_SIZE_K(128)>; }; soc-id { device-id = <0x62>; - revision-reg = <0x00017FFC 4>; + revision-reg = <0x00017ffc 4>; }; }; diff --git a/dts/arm/nuvoton/npcx9mfp.dtsi b/dts/arm/nuvoton/npcx9mfp.dtsi index a4b1fef4b414..26e126904793 100644 --- a/dts/arm/nuvoton/npcx9mfp.dtsi +++ b/dts/arm/nuvoton/npcx9mfp.dtsi @@ -22,13 +22,13 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200C0000 DT_SIZE_K(92)>; + reg = <0x200c0000 DT_SIZE_K(92)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200d7000 { compatible = "mmio-sram"; - reg = <0x200D7000 DT_SIZE_K(4)>; + reg = <0x200d7000 DT_SIZE_K(4)>; }; soc { diff --git a/dts/arm/nxp/nxp_imx95_m7.dtsi b/dts/arm/nxp/nxp_imx95_m7.dtsi index 7937ab7ab01d..6b1eeb3ac815 100644 --- a/dts/arm/nxp/nxp_imx95_m7.dtsi +++ b/dts/arm/nxp/nxp_imx95_m7.dtsi @@ -216,7 +216,7 @@ dma-requests = <92>; no-error-irq; interrupts = <128 0>, <129 0>, <143 0>; - channels-shared-irq-mask = <0x00000003 0x00000000 0x0000000C 0x00000000 + channels-shared-irq-mask = <0x00000003 0x00000000 0x0000000c 0x00000000 0x00000030 0x00000000>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_k2x.dtsi b/dts/arm/nxp/nxp_k2x.dtsi index 9b6850a5003f..ba4eb0422aec 100644 --- a/dts/arm/nxp/nxp_k2x.dtsi +++ b/dts/arm/nxp/nxp_k2x.dtsi @@ -81,9 +81,9 @@ clock-frequency = <32768>; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { @@ -284,7 +284,7 @@ compatible = "nxp,dspi"; reg = <0x4002c000 0x88>; interrupts = <26 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -294,7 +294,7 @@ compatible = "nxp,dspi"; reg = <0x4002d000 0x88>; interrupts = <27 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -312,7 +312,7 @@ reg = <0x40038000 0x98>; interrupts = <42 0>; clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>, - <&sim KINETIS_SIM_BUS_CLK 0x103C 24>; + <&sim KINETIS_SIM_BUS_CLK 0x103c 24>; prescaler = <16>; status = "disabled"; }; @@ -322,7 +322,7 @@ reg = <0x40039000 0x98>; interrupts = <43 0>; clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>, - <&sim KINETIS_SIM_BUS_CLK 0x103C 25>; + <&sim KINETIS_SIM_BUS_CLK 0x103c 25>; prescaler = <16>; status = "disabled"; }; @@ -332,7 +332,7 @@ reg = <0x4003a000 0x98>; interrupts = <44 0>; clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>, - <&sim KINETIS_SIM_BUS_CLK 0x103C 26>; + <&sim KINETIS_SIM_BUS_CLK 0x103c 26>; prescaler = <16>; status = "disabled"; }; @@ -342,7 +342,7 @@ reg = <0x400b9000 0x98>; interrupts = <71 0>; clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>, - <&sim KINETIS_SIM_BUS_CLK 0x103C 6>; + <&sim KINETIS_SIM_BUS_CLK 0x103c 6>; prescaler = <16>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_k32l2b3.dtsi b/dts/arm/nxp/nxp_k32l2b3.dtsi index 0c2ced6dc83f..2d8627e80d85 100644 --- a/dts/arm/nxp/nxp_k32l2b3.dtsi +++ b/dts/arm/nxp/nxp_k32l2b3.dtsi @@ -87,9 +87,9 @@ #clock-cells = <1>; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { @@ -257,7 +257,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x40038000 0x88>; interrupts = <17 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 24>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 24>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -267,7 +267,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x40039000 0x88>; interrupts = <18 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 25>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 25>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -277,7 +277,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x4003a000 0x88>; interrupts = <19 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 26>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 26>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; diff --git a/dts/arm/nxp/nxp_k6x.dtsi b/dts/arm/nxp/nxp_k6x.dtsi index 0f186f705399..340fa3554a2a 100644 --- a/dts/arm/nxp/nxp_k6x.dtsi +++ b/dts/arm/nxp/nxp_k6x.dtsi @@ -112,9 +112,9 @@ prescaler = <32768>; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { @@ -350,7 +350,7 @@ dma-names = "rx", "tx"; rx-fifo-size = <4>; tx-fifo-size = <4>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -365,7 +365,7 @@ rx-fifo-size = <1>; tx-fifo-size = <1>; nxp,rx-tx-chn-share; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -432,7 +432,7 @@ adc0: adc@4003b000 { compatible = "nxp,kinetis-adc16"; reg = <0x4003b000 0x70>; - clocks = <&sim KINETIS_SIM_SIM_SOPT7 0 0xF>, + clocks = <&sim KINETIS_SIM_SIM_SOPT7 0 0xf>, <&sim KINETIS_SIM_SIM_SOPT7 7 0x80>; dmas = <&edma0 0 40>; dma-names = "adc0"; @@ -445,7 +445,7 @@ adc1: adc@400bb000 { compatible = "nxp,kinetis-adc16"; reg = <0x400bb000 0x70>; - clocks = <&sim KINETIS_SIM_SIM_SOPT7 8 0xF00>, + clocks = <&sim KINETIS_SIM_SIM_SOPT7 8 0xf00>, <&sim KINETIS_SIM_SIM_SOPT7 15 0x8000>; dmas = <&edma0 0 41>; dma-names = "adc1"; @@ -526,8 +526,8 @@ interrupts = <75 0>, <76 0>, <77 0>, <78 0>, <79 0>, <80 0>; interrupt-names = "mb-0-15", "bus-off", "error", "tx-warning", "rx-warning", "wake-up"; - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 4>, - <&sim KINETIS_SIM_BUS_CLK 0x103C 4>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 4>, + <&sim KINETIS_SIM_BUS_CLK 0x103c 4>; clock-names = "clksrc0", "clksrc1"; clk-source = <1>; number-of-mb = <16>; @@ -549,7 +549,7 @@ <12 0>, <13 0>, <14 0>, <15 0>, <16 0>; clocks = <&sim KINETIS_SIM_DMA_CLK 0x1040 0x00000002>, - <&sim KINETIS_SIM_DMAMUX_CLK 0x103C 0x00000002>; + <&sim KINETIS_SIM_DMAMUX_CLK 0x103c 0x00000002>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_k8x.dtsi b/dts/arm/nxp/nxp_k8x.dtsi index 38ae65795291..e9afbb63bf50 100644 --- a/dts/arm/nxp/nxp_k8x.dtsi +++ b/dts/arm/nxp/nxp_k8x.dtsi @@ -45,9 +45,9 @@ status = "disabled"; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { @@ -110,7 +110,7 @@ adc0: adc@4003b000 { compatible = "nxp,kinetis-adc16"; reg = <0x4003b000 0x1000>; - clocks = <&sim KINETIS_SIM_SIM_SOPT7 0 0xF>, + clocks = <&sim KINETIS_SIM_SIM_SOPT7 0 0xf>, <&sim KINETIS_SIM_SIM_SOPT7 7 0x80>; interrupts = <39 0>; dmas = <&edma0 0 40>; @@ -444,7 +444,7 @@ <12 0>, <13 0>, <14 0>, <15 0>, <16 0>; clocks = <&sim KINETIS_SIM_DMA_CLK 0x1040 0x00000002>, - <&sim KINETIS_SIM_DMAMUX_CLK 0x103C 0x00000002>; + <&sim KINETIS_SIM_DMAMUX_CLK 0x103c 0x00000002>; status = "disabled"; }; }; diff --git a/dts/arm/nxp/nxp_ke1xz.dtsi b/dts/arm/nxp/nxp_ke1xz.dtsi index fcc65090a08b..e70be4c5f74a 100644 --- a/dts/arm/nxp/nxp_ke1xz.dtsi +++ b/dts/arm/nxp/nxp_ke1xz.dtsi @@ -66,7 +66,7 @@ sram_l: memory@1fffe000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x1FFFE000 DT_SIZE_K(8)>; + reg = <0x1fffe000 DT_SIZE_K(8)>; zephyr,memory-region = "SRAML"; }; diff --git a/dts/arm/nxp/nxp_kl25z.dtsi b/dts/arm/nxp/nxp_kl25z.dtsi index af4091f9b28e..5198c339cb8b 100644 --- a/dts/arm/nxp/nxp_kl25z.dtsi +++ b/dts/arm/nxp/nxp_kl25z.dtsi @@ -25,9 +25,9 @@ }; }; - sram0: memory@1FFFF000 { + sram0: memory@1ffff000 { compatible = "mmio-sram"; - reg = <0x1FFFF000 DT_SIZE_K(16)>; + reg = <0x1ffff000 DT_SIZE_K(16)>; }; /* Dummy pinctrl node, filled with pin mux options at board level */ @@ -82,9 +82,9 @@ status = "disabled"; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { diff --git a/dts/arm/nxp/nxp_kv5x.dtsi b/dts/arm/nxp/nxp_kv5x.dtsi index 82d8c9d16f35..956081b6c86b 100644 --- a/dts/arm/nxp/nxp_kv5x.dtsi +++ b/dts/arm/nxp/nxp_kv5x.dtsi @@ -40,9 +40,9 @@ status = "disabled"; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { diff --git a/dts/arm/nxp/nxp_kw2xd.dtsi b/dts/arm/nxp/nxp_kw2xd.dtsi index bf0ce0335adf..2b2a7fe00342 100644 --- a/dts/arm/nxp/nxp_kw2xd.dtsi +++ b/dts/arm/nxp/nxp_kw2xd.dtsi @@ -83,9 +83,9 @@ clock-frequency = <32768>; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { @@ -269,7 +269,7 @@ compatible = "nxp,dspi"; reg = <0x4002c000 0x88>; interrupts = <26 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; status = "disabled"; #address-cells = <1>; #size-cells = <0>; @@ -279,7 +279,7 @@ compatible = "nxp,dspi"; reg = <0x4002d000 0x88>; interrupts = <27 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/arm/nxp/nxp_kw40z.dtsi b/dts/arm/nxp/nxp_kw40z.dtsi index 88feb64b3dbb..1e8c98ad8b65 100644 --- a/dts/arm/nxp/nxp_kw40z.dtsi +++ b/dts/arm/nxp/nxp_kw40z.dtsi @@ -60,9 +60,9 @@ clock-frequency = <32768>; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { @@ -182,9 +182,9 @@ spi0: spi@4002c000 { compatible = "nxp,dspi"; - reg = <0x4002c000 0x9C>; + reg = <0x4002c000 0x9c>; interrupts = <10 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; status = "disabled"; #address-cells = <1>; @@ -193,9 +193,9 @@ spi1: spi@4002d000 { compatible = "nxp,dspi"; - reg = <0x4002d000 0x9C>; + reg = <0x4002d000 0x9c>; interrupts = <29 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; status = "disabled"; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/arm/nxp/nxp_kw41z.dtsi b/dts/arm/nxp/nxp_kw41z.dtsi index 19680e26d6b8..63b7ad8e911f 100644 --- a/dts/arm/nxp/nxp_kw41z.dtsi +++ b/dts/arm/nxp/nxp_kw41z.dtsi @@ -63,9 +63,9 @@ prescaler = <32768>; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { @@ -185,9 +185,9 @@ spi0: spi@4002c000 { compatible = "nxp,dspi"; - reg = <0x4002c000 0x9C>; + reg = <0x4002c000 0x9c>; interrupts = <10 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; status = "disabled"; #address-cells = <1>; @@ -196,9 +196,9 @@ spi1: spi@4002d000 { compatible = "nxp,dspi"; - reg = <0x4002d000 0x9C>; + reg = <0x4002d000 0x9c>; interrupts = <29 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; status = "disabled"; #address-cells = <1>; #size-cells = <0>; @@ -209,7 +209,7 @@ reg = <0x40038000 0x88>; interrupts = <0x84 0>; /* channel information needed - fixme */ - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 24>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 24>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -220,7 +220,7 @@ reg = <0x40039000 0x88>; interrupts = <0x88 0>; /* channel information needed - fixme */ - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 25>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 25>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -229,9 +229,9 @@ tpm2: pwm@4003a000 { compatible = "nxp,kinetis-tpm"; reg = <0x4003a000 0x88>; - interrupts = <0x8C 0>; + interrupts = <0x8c 0>; /* channel information needed - fixme */ - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 26>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 26>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; diff --git a/dts/arm/nxp/nxp_lpc11u6x.dtsi b/dts/arm/nxp/nxp_lpc11u6x.dtsi index cbc834eb1311..9ca4778519d9 100644 --- a/dts/arm/nxp/nxp_lpc11u6x.dtsi +++ b/dts/arm/nxp/nxp_lpc11u6x.dtsi @@ -72,7 +72,7 @@ /* PIO1_0 to PIO1_31. */ pio1: pio1@60 { compatible = "nxp,lpc-iocon-pio"; - reg = <0x60 0x7C>; + reg = <0x60 0x7c>; }; /* PIO2_0 to PIO2_23. */ @@ -151,7 +151,7 @@ compatible = "nxp,lpc11u6x-uart"; clocks = <&syscon LPC11U6X_CLOCK_USART1>; interrupts = <11 0>; - reg = <0x4006C000 0x30>; + reg = <0x4006c000 0x30>; status = "disabled"; }; @@ -175,7 +175,7 @@ compatible = "nxp,lpc11u6x-uart"; clocks = <&syscon LPC11U6X_CLOCK_USART4>; interrupts = <11 0>; - reg = <0x4004C000 0x30>; + reg = <0x4004c000 0x30>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_lpc54xxx.dtsi b/dts/arm/nxp/nxp_lpc54xxx.dtsi index 439e837bed03..597eefdc264b 100644 --- a/dts/arm/nxp/nxp_lpc54xxx.dtsi +++ b/dts/arm/nxp/nxp_lpc54xxx.dtsi @@ -154,7 +154,7 @@ mailbox0: mailbox@4008b000 { compatible = "nxp,lpc-mailbox"; - reg = <0x4008b000 0xEC>; + reg = <0x4008b000 0xec>; interrupts = <31 0>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_lpc55S0x_common.dtsi b/dts/arm/nxp/nxp_lpc55S0x_common.dtsi index 97356ebe561d..79c9129a0b12 100644 --- a/dts/arm/nxp/nxp_lpc55S0x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S0x_common.dtsi @@ -55,9 +55,9 @@ reg = <0x20008000 DT_SIZE_K(16)>; }; - sram2: memory@2000C000 { + sram2: memory@2000c000 { compatible = "mmio-sram"; - reg = <0x2000C000 DT_SIZE_K(16)>; + reg = <0x2000c000 DT_SIZE_K(16)>; }; sram3: memory@20010000 { diff --git a/dts/arm/nxp/nxp_lpc55S1x_common.dtsi b/dts/arm/nxp/nxp_lpc55S1x_common.dtsi index 61c368f172c3..15cdd1cd8c28 100644 --- a/dts/arm/nxp/nxp_lpc55S1x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S1x_common.dtsi @@ -210,9 +210,9 @@ prescale = <0>; }; - ctimer4: ctimer@2A000 { + ctimer4: ctimer@2a000 { compatible = "nxp,lpc-ctimer"; - reg = <0x2A000 0x1000>; + reg = <0x2a000 0x1000>; interrupts = <37 0>; status = "disabled"; clk-source = <3>; diff --git a/dts/arm/nxp/nxp_lpc55S2x_common.dtsi b/dts/arm/nxp/nxp_lpc55S2x_common.dtsi index 2774016e90ae..6c4d9184e98a 100644 --- a/dts/arm/nxp/nxp_lpc55S2x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S2x_common.dtsi @@ -339,7 +339,7 @@ status = "disabled"; }; - usbhfs: usbhfs@A2000 { + usbhfs: usbhfs@a2000 { compatible = "nxp,uhc-ohci"; reg = <0xa2000 0x1000>; interrupts = <28 1>; @@ -347,7 +347,7 @@ status = "disabled"; }; - usbhhs: usbhhs@A3000 { + usbhhs: usbhhs@a3000 { compatible = "nxp,uhc-ip3516hs"; reg = <0xa3000 0x1000>; interrupts = <47 1>; diff --git a/dts/arm/nxp/nxp_lpc55S3x_common.dtsi b/dts/arm/nxp/nxp_lpc55S3x_common.dtsi index 8c70c28551d9..0208c6969d17 100644 --- a/dts/arm/nxp/nxp_lpc55S3x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S3x_common.dtsi @@ -293,9 +293,9 @@ #size-cells = <0>; }; - adc0: adc@A0000 { + adc0: adc@a0000 { compatible = "nxp,lpc-lpadc"; - reg = <0xA0000 0x1000>; + reg = <0xa0000 0x1000>; interrupts = <22 0>; status = "disabled"; clk-divider = <8>; @@ -410,9 +410,9 @@ status = "disabled"; }; - flexpwm0: flexpwm@400C3000 { + flexpwm0: flexpwm@400c3000 { compatible = "nxp,flexpwm"; - reg = <0x400C3000 0x1000>; + reg = <0x400c3000 0x1000>; interrupt-names = "INPUT-CAPTURE", "FAULT", "RELOAD-ERROR"; interrupts = <80 0>, <81 0>, <82 0>; @@ -465,9 +465,9 @@ }; }; - flexpwm1: flexpwm@400C5000 { + flexpwm1: flexpwm@400c5000 { compatible = "nxp,flexpwm"; - reg = <0x400C5000 0x1000>; + reg = <0x400c5000 0x1000>; interrupt-names = "INPUT-CAPTURE", "FAULT", "RELOAD-ERROR"; interrupts = <91 0>, <92 0>, <93 0>; diff --git a/dts/arm/nxp/nxp_lpc55S6x_common.dtsi b/dts/arm/nxp/nxp_lpc55S6x_common.dtsi index 59ee736098c5..e5965bd1e0bd 100644 --- a/dts/arm/nxp/nxp_lpc55S6x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S6x_common.dtsi @@ -137,9 +137,9 @@ write-block-size = <512>; }; - flash_reserved: flash@9D800 { + flash_reserved: flash@9d800 { compatible = "soc-nv-flash"; - reg = <0x9D800 DT_SIZE_K(9)>; + reg = <0x9d800 DT_SIZE_K(9)>; status = "disabled"; }; @@ -227,7 +227,7 @@ mailbox0: mailbox@8b000 { compatible = "nxp,lpc-mailbox"; - reg = <0x8b000 0xEC>; + reg = <0x8b000 0xec>; interrupts = <31 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "disabled"; @@ -364,9 +364,9 @@ clk-divider = <1>; }; - adc0: adc@A0000 { + adc0: adc@a0000 { compatible = "nxp,lpc-lpadc"; - reg = <0xA0000 0x1000>; + reg = <0xa0000 0x1000>; interrupts = <22 0>; status = "disabled"; clk-divider = <8>; @@ -397,7 +397,7 @@ status = "disabled"; }; - usbhfs: usbhfs@A2000 { + usbhfs: usbhfs@a2000 { compatible = "nxp,uhc-ohci"; reg = <0xa2000 0x1000>; interrupts = <28 1>; @@ -405,7 +405,7 @@ status = "disabled"; }; - usbhhs: usbhhs@A3000 { + usbhhs: usbhhs@a3000 { compatible = "nxp,uhc-ip3516hs"; reg = <0xa3000 0x1000>; interrupts = <47 1>; @@ -466,9 +466,9 @@ prescale = <0>; }; - ctimer4: ctimer@2A000 { + ctimer4: ctimer@2a000 { compatible = "nxp,lpc-ctimer"; - reg = <0x2A000 0x1000>; + reg = <0x2a000 0x1000>; interrupts = <37 0>; status = "disabled"; clk-source = <3>; @@ -488,9 +488,9 @@ #pwm-cells = <3>; }; - rtc: rtc@2C000 { + rtc: rtc@2c000 { compatible = "nxp,lpc-rtc"; - reg = <0x2C000 0x1000>; + reg = <0x2c000 0x1000>; interrupts = <29 0>; status = "disabled"; diff --git a/dts/arm/nxp/nxp_mcxa153.dtsi b/dts/arm/nxp/nxp_mcxa153.dtsi index 1138680ccd95..bec39ff7e4fd 100644 --- a/dts/arm/nxp/nxp_mcxa153.dtsi +++ b/dts/arm/nxp/nxp_mcxa153.dtsi @@ -451,9 +451,9 @@ interrupts = <18 0>; }; - cmc: system-modules@4008B000 { + cmc: system-modules@4008b000 { compatible = "nxp,cmc", "nxp,cmc-reset-cause"; - reg = <0x4008B000 0x1000>; + reg = <0x4008b000 0x1000>; interrupts = <1 0>; }; diff --git a/dts/arm/nxp/nxp_mcxa156.dtsi b/dts/arm/nxp/nxp_mcxa156.dtsi index 4b4bf059c01b..ded2feb9885c 100644 --- a/dts/arm/nxp/nxp_mcxa156.dtsi +++ b/dts/arm/nxp/nxp_mcxa156.dtsi @@ -587,9 +587,9 @@ interrupts = <18 0>; }; - cmc: system-modules@4008B000 { + cmc: system-modules@4008b000 { compatible = "nxp,cmc", "nxp,cmc-reset-cause"; - reg = <0x4008B000 0x1000>; + reg = <0x4008b000 0x1000>; interrupts = <1 0>; }; diff --git a/dts/arm/nxp/nxp_mcxa344.dtsi b/dts/arm/nxp/nxp_mcxa344.dtsi index 36a845afcfd6..b435a3ceab85 100644 --- a/dts/arm/nxp/nxp_mcxa344.dtsi +++ b/dts/arm/nxp/nxp_mcxa344.dtsi @@ -519,9 +519,9 @@ interrupts = <18 0>; }; - cmc: system-modules@4008B000 { + cmc: system-modules@4008b000 { compatible = "nxp,cmc"; - reg = <0x4008B000 0x1000>; + reg = <0x4008b000 0x1000>; interrupts = <1 0>; }; diff --git a/dts/arm/nxp/nxp_mcxaxx6_common.dtsi b/dts/arm/nxp/nxp_mcxaxx6_common.dtsi index fd03815c9c4e..bfa79d47afe6 100644 --- a/dts/arm/nxp/nxp_mcxaxx6_common.dtsi +++ b/dts/arm/nxp/nxp_mcxaxx6_common.dtsi @@ -544,9 +544,9 @@ interrupts = <18 0>; }; - cmc: system-modules@4008B000 { + cmc: system-modules@4008b000 { compatible = "nxp,cmc", "nxp,cmc-reset-cause"; - reg = <0x4008B000 0x1000>; + reg = <0x4008b000 0x1000>; interrupts = <1 0>; }; diff --git a/dts/arm/nxp/nxp_mcxc141.dtsi b/dts/arm/nxp/nxp_mcxc141.dtsi index 7518beaa4713..2fcaad459b94 100644 --- a/dts/arm/nxp/nxp_mcxc141.dtsi +++ b/dts/arm/nxp/nxp_mcxc141.dtsi @@ -7,7 +7,7 @@ #include &sram0 { - reg = <0x1FFFF800 DT_SIZE_K(8)>; + reg = <0x1ffff800 DT_SIZE_K(8)>; }; &flash0 { diff --git a/dts/arm/nxp/nxp_mcxc142.dtsi b/dts/arm/nxp/nxp_mcxc142.dtsi index ae7f90eb066c..41c6815de66b 100644 --- a/dts/arm/nxp/nxp_mcxc142.dtsi +++ b/dts/arm/nxp/nxp_mcxc142.dtsi @@ -7,7 +7,7 @@ #include &sram0 { - reg = <0x1FFFF000 DT_SIZE_K(16)>; + reg = <0x1ffff000 DT_SIZE_K(16)>; }; &flash0 { diff --git a/dts/arm/nxp/nxp_mcxc242.dtsi b/dts/arm/nxp/nxp_mcxc242.dtsi index 1e493364e734..af8075e38243 100644 --- a/dts/arm/nxp/nxp_mcxc242.dtsi +++ b/dts/arm/nxp/nxp_mcxc242.dtsi @@ -7,7 +7,7 @@ #include &sram0 { - reg = <0x1FFFF000 DT_SIZE_K(16)>; + reg = <0x1ffff000 DT_SIZE_K(16)>; }; &flash0 { diff --git a/dts/arm/nxp/nxp_mcxc444.dtsi b/dts/arm/nxp/nxp_mcxc444.dtsi index bdbe4e6cf24c..3e2aa2ab4654 100644 --- a/dts/arm/nxp/nxp_mcxc444.dtsi +++ b/dts/arm/nxp/nxp_mcxc444.dtsi @@ -7,7 +7,7 @@ #include &sram0 { - reg = <0x1FFFE000 DT_SIZE_K(32)>; + reg = <0x1fffe000 DT_SIZE_K(32)>; }; &flash0 { diff --git a/dts/arm/nxp/nxp_mcxc_common.dtsi b/dts/arm/nxp/nxp_mcxc_common.dtsi index 90a68cd8e058..12413709ed33 100644 --- a/dts/arm/nxp/nxp_mcxc_common.dtsi +++ b/dts/arm/nxp/nxp_mcxc_common.dtsi @@ -35,7 +35,7 @@ }; }; - sram0: memory@1FFFF000 { + sram0: memory@1ffff000 { compatible = "mmio-sram"; }; @@ -92,9 +92,9 @@ #clock-cells = <1>; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; sim: sim@40047000 { @@ -271,7 +271,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x40038000 0x88>; interrupts = <17 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 24>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 24>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -281,7 +281,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x40039000 0x88>; interrupts = <18 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 25>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 25>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -291,7 +291,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x4003a000 0x88>; interrupts = <19 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 26>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 26>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; diff --git a/dts/arm/nxp/nxp_mcxe24x_common.dtsi b/dts/arm/nxp/nxp_mcxe24x_common.dtsi index 36ab6c38185a..21c71aa1c2ec 100644 --- a/dts/arm/nxp/nxp_mcxe24x_common.dtsi +++ b/dts/arm/nxp/nxp_mcxe24x_common.dtsi @@ -643,9 +643,9 @@ clocks = <&pcc 0x134 KINETIS_PCC_SRC_NONE_OR_EXT>; }; - rcm: rcm@4007F000 { + rcm: rcm@4007f000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; + reg = <0x4007f000 0x1000>; }; rtc: rtc@4003d000 { diff --git a/dts/arm/nxp/nxp_mcxn23x_common.dtsi b/dts/arm/nxp/nxp_mcxn23x_common.dtsi index 8179afe26253..8970667e9cdd 100644 --- a/dts/arm/nxp/nxp_mcxn23x_common.dtsi +++ b/dts/arm/nxp/nxp_mcxn23x_common.dtsi @@ -1054,9 +1054,9 @@ #dma-cells = <0>; }; - ewm0: ewm@C0000 { + ewm0: ewm@c0000 { compatible = "nxp,ewm"; - reg = <0xC0000 0x6>; + reg = <0xc0000 0x6>; status = "disabled"; interrupts = <100 0>; clk-divider = <0x0>; diff --git a/dts/arm/nxp/nxp_mcxw72.dtsi b/dts/arm/nxp/nxp_mcxw72.dtsi index e99f032655f7..5fb13854b1f7 100644 --- a/dts/arm/nxp/nxp_mcxw72.dtsi +++ b/dts/arm/nxp/nxp_mcxw72.dtsi @@ -49,19 +49,19 @@ }; &porta { - reg = <0x42000 0xF0>; + reg = <0x42000 0xf0>; }; &portb { - reg = <0x43000 0xF0>; + reg = <0x43000 0xf0>; }; &portc { - reg = <0x44000 0xF0>; + reg = <0x44000 0xf0>; }; &portd { - reg = <0x45000 0xF0>; + reg = <0x45000 0xf0>; }; &smu2 { diff --git a/dts/arm/nxp/nxp_rt1010.dtsi b/dts/arm/nxp/nxp_rt1010.dtsi index b49d8212fb40..76eebe6d75c2 100644 --- a/dts/arm/nxp/nxp_rt1010.dtsi +++ b/dts/arm/nxp/nxp_rt1010.dtsi @@ -286,18 +286,18 @@ #size-cells = <0>; #pinmux-cells = <2>; reg = <0x401e0000 0x4000>; - clocks = <&ccm IMX_CCM_SAI1_CLK 0x7C 18>; + clocks = <&ccm IMX_CCM_SAI1_CLK 0x7c 18>; /* Source clock from Audio PLL */ clock-mux = <2>; /* Audio PLL Output Frequency is determined by: * (Fref * (DIV_SELECT + NUM/DENOM)) / POST_DIV * = (24MHz * (32 + 77 / 100)) / 1 = 786.48 MHz */ - pll-clocks = <&anatop 0x70 0xC000 0>, - <&anatop 0x70 0x7F 32>, + pll-clocks = <&anatop 0x70 0xc000 0>, + <&anatop 0x70 0x7f 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3FFFFFFF 77>, - <&anatop 0x90 0x3FFFFFFF 100>; + <&anatop 0x80 0x3fffffff 77>, + <&anatop 0x90 0x3fffffff 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; /* The maximum input frequency into the SAI mclk input is 300MHz * Based on this requirement, pre-div must be at least 3 @@ -306,7 +306,7 @@ * (1+1) = 2 */ pre-div = <0x3>; - podf = <0x0F>; + podf = <0x0f>; pinmuxes = <&iomuxcgpr 0x4 0x80000>; interrupts = <56 0>; dmas = <&edma0 0 19>, <&edma0 0 20>; @@ -326,16 +326,16 @@ #size-cells = <0>; #pinmux-cells = <2>; reg = <0x401e8000 0x4000>; - clocks = <&ccm IMX_CCM_SAI3_CLK 0x7C 22>; + clocks = <&ccm IMX_CCM_SAI3_CLK 0x7c 22>; /* Source clock from Audio PLL */ clock-mux = <2>; pre-div = <0>; podf = <63>; - pll-clocks = <&anatop 0x70 0xC000 0>, - <&anatop 0x70 0x7F 32>, + pll-clocks = <&anatop 0x70 0xc000 0>, + <&anatop 0x70 0x7f 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3FFFFFFF 77>, - <&anatop 0x90 0x3FFFFFFF 100>; + <&anatop 0x80 0x3fffffff 77>, + <&anatop 0x90 0x3fffffff 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; pinmuxes = <&iomuxcgpr 0x4 0x200000>; interrupts = <58 0>, <59 0>; diff --git a/dts/arm/nxp/nxp_rt10xx.dtsi b/dts/arm/nxp/nxp_rt10xx.dtsi index 5a14b50017a2..95f64e872836 100644 --- a/dts/arm/nxp/nxp_rt10xx.dtsi +++ b/dts/arm/nxp/nxp_rt10xx.dtsi @@ -619,7 +619,7 @@ adc1: adc@400c4000 { compatible = "nxp,mcux-12b1msps-sar"; - reg = <0x400C4000 0x1000>; + reg = <0x400c4000 0x1000>; interrupts = <67 0>; clk-divider = <1>; sample-period-mode = <0>; @@ -629,7 +629,7 @@ adc2: adc@400c8000 { compatible = "nxp,mcux-12b1msps-sar"; - reg = <0x400C8000 0x1000>; + reg = <0x400c8000 0x1000>; interrupts = <68 0>; clk-divider = <1>; sample-period-mode = <0>; @@ -823,7 +823,7 @@ enet: enet@402d8000 { compatible = "nxp,enet"; - reg = <0x402D8000 0x628>; + reg = <0x402d8000 0x628>; clocks = <&ccm IMX_CCM_ENET_CLK 0 0>; enet_mac: ethernet { @@ -865,7 +865,7 @@ usb1: usbd@402e0000 { compatible = "nxp,ehci"; - reg = <0x402E0000 0x200>; + reg = <0x402e0000 0x200>; interrupts = <113 1>; interrupt-names = "usb_otg"; clocks = <&usbclk>; @@ -875,7 +875,7 @@ usb2: usbd@402e0200 { compatible = "nxp,ehci"; - reg = <0x402E0200 0x200>; + reg = <0x402e0200 0x200>; interrupts = <112 1>; interrupt-names = "usb_otg"; clocks = <&usbclk>; @@ -885,7 +885,7 @@ usbh1: usbh@402e0000 { compatible = "nxp,uhc-ehci"; - reg = <0x402E0000 0x200>; + reg = <0x402e0000 0x200>; interrupts = <113 1>; interrupt-names = "usb_otg"; clocks = <&usbclk>; @@ -894,7 +894,7 @@ usbh2: usbh@402e0200 { compatible = "nxp,uhc-ehci"; - reg = <0x402E0200 0x200>; + reg = <0x402e0200 0x200>; interrupts = <112 1>; interrupt-names = "usb_otg"; clocks = <&usbclk>; @@ -903,13 +903,13 @@ usbphy1: usbphy@400d9000 { compatible = "nxp,usbphy"; - reg = <0x400D9000 0x1000>; + reg = <0x400d9000 0x1000>; status = "disabled"; }; usbphy2: usbphy@400da000 { compatible = "nxp,usbphy"; - reg = <0x400DA000 0x1000>; + reg = <0x400da000 0x1000>; status = "disabled"; }; @@ -939,7 +939,7 @@ csi: csi@402bc000 { compatible = "nxp,imx-csi"; - reg = <0x402BC000 0x4000>; + reg = <0x402bc000 0x4000>; interrupts = <43 1>; status = "disabled"; }; @@ -952,14 +952,14 @@ dma-requests = <128>; nxp,mem2mem; nxp,a-on; - reg = <0x400E8000 0x4000>, - <0x400EC000 0x4000>; + reg = <0x400e8000 0x4000>, + <0x400ec000 0x4000>; interrupts = <0 0>, <1 0>, <2 0>, <3 0>, <4 0>, <5 0>, <6 0>, <7 0>, <8 0>, <9 0>, <10 0>, <11 0>, <12 0>, <13 0>, <14 0>, <15 0>; irq-shared-offset = <16>; - clocks = <&ccm IMX_CCM_EDMA_CLK 0x7C 0x000000C0>; + clocks = <&ccm IMX_CCM_EDMA_CLK 0x7c 0x000000c0>; status = "disabled"; }; @@ -996,14 +996,14 @@ wdog0: wdog@400b8000 { compatible = "nxp,imx-wdog"; - reg = <0x400b8000 0xA>; + reg = <0x400b8000 0xa>; status = "disabled"; interrupts = <92 0>; }; wdog1: wdog@400d0000 { compatible = "nxp,imx-wdog"; - reg = <0x400d0000 0xA>; + reg = <0x400d0000 0xa>; status = "disabled"; interrupts = <45 0>; }; @@ -1017,7 +1017,7 @@ iomuxcgpr: iomuxcgpr@400ac000 { compatible = "nxp,imx-gpr"; - reg = <0x400AC000 0x4000>; + reg = <0x400ac000 0x4000>; #pinmux-cells = <2>; }; @@ -1035,18 +1035,18 @@ #size-cells = <0>; #pinmux-cells = <2>; reg = <0x40384000 0x4000>; - clocks = <&ccm IMX_CCM_SAI1_CLK 0x7C 18>; + clocks = <&ccm IMX_CCM_SAI1_CLK 0x7c 18>; /* Source clock from Audio PLL */ clock-mux = <2>; /* Audio PLL Output Frequency is determined by: * (Fref * (DIV_SELECT + NUM/DENOM)) / POST_DIV * = (24MHz * (32 + 77 / 100)) / 1 = 786.48 MHz */ - pll-clocks = <&anatop 0x70 0xC000 0>, - <&anatop 0x70 0x7F 32>, + pll-clocks = <&anatop 0x70 0xc000 0>, + <&anatop 0x70 0x7f 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3FFFFFFF 77>, - <&anatop 0x90 0x3FFFFFFF 100>; + <&anatop 0x80 0x3fffffff 77>, + <&anatop 0x90 0x3fffffff 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; /* The maximum input frequency into the SAI mclk input is 300MHz * Based on this requirement, pre-div must be at least 3 @@ -1055,7 +1055,7 @@ * (1+1) = 2 */ pre-div = <0x3>; - podf = <0x0F>; + podf = <0x0f>; pinmuxes = <&iomuxcgpr 0x4 0x80000>; interrupts = <56 0>; dmas = <&edma0 0 19>, <&edma0 0 20>; @@ -1075,16 +1075,16 @@ #size-cells = <0>; #pinmux-cells = <2>; reg = <0x40388000 0x4000>; - clocks = <&ccm IMX_CCM_SAI2_CLK 0x7C 20>; + clocks = <&ccm IMX_CCM_SAI2_CLK 0x7c 20>; /* Source clock from Audio PLL */ clock-mux = <2>; pre-div = <0>; podf = <63>; - pll-clocks = <&anatop 0x70 0xC000 0x0>, - <&anatop 0x70 0x7F 32>, + pll-clocks = <&anatop 0x70 0xc000 0x0>, + <&anatop 0x70 0x7f 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3FFFFFFF 77>, - <&anatop 0x90 0x3FFFFFFF 100>; + <&anatop 0x80 0x3fffffff 77>, + <&anatop 0x90 0x3fffffff 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; pinmuxes = <&iomuxcgpr 0x4 0x100000>; interrupts = <57 0>; @@ -1101,17 +1101,17 @@ #address-cells = <1>; #size-cells = <0>; #pinmux-cells = <2>; - reg = <0x4038C000 0x4000>; - clocks = <&ccm IMX_CCM_SAI3_CLK 0x7C 22>; + reg = <0x4038c000 0x4000>; + clocks = <&ccm IMX_CCM_SAI3_CLK 0x7c 22>; /* Source clock from Audio PLL */ clock-mux = <2>; pre-div = <0>; podf = <63>; - pll-clocks = <&anatop 0x70 0xC000 0>, - <&anatop 0x70 0x7F 32>, + pll-clocks = <&anatop 0x70 0xc000 0>, + <&anatop 0x70 0x7f 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3FFFFFFF 77>, - <&anatop 0x90 0x3FFFFFFF 100>; + <&anatop 0x80 0x3fffffff 77>, + <&anatop 0x90 0x3fffffff 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; pinmuxes = <&iomuxcgpr 0x4 0x200000>; interrupts = <58 0>, <59 0>; diff --git a/dts/arm/nxp/nxp_rt118x.dtsi b/dts/arm/nxp/nxp_rt118x.dtsi index 6abc73028713..1aae388dcff8 100644 --- a/dts/arm/nxp/nxp_rt118x.dtsi +++ b/dts/arm/nxp/nxp_rt118x.dtsi @@ -76,9 +76,9 @@ * or nxp_rt118x_cm7.dtsi. The base addresses on cm33 core differ * between non-secure (0x40000000) and secure modes (0x50000000). */ - iomuxc: pinctrl@2A10000 { + iomuxc: pinctrl@2a10000 { compatible = "nxp,imx-iomuxc"; - reg = <0x2A10000 0x4000>; + reg = <0x2a10000 0x4000>; pinctrl: pinctrl { status = "okay"; @@ -86,9 +86,9 @@ }; }; - iomuxc_aon: pinctrl@43C0000 { + iomuxc_aon: pinctrl@43c0000 { compatible = "nxp,mcux-rt-pinctrl"; - reg = <0x43C0000 0x4000>; + reg = <0x43c0000 0x4000>; status = "okay"; }; @@ -168,9 +168,9 @@ status = "disabled"; }; - lpuart6: serial@25A0000 { + lpuart6: serial@25a0000 { compatible = "nxp,lpuart"; - reg = <0x25A0000 0x4000>; + reg = <0x25a0000 0x4000>; interrupts = <71 0>; clocks = <&ccm IMX_CCM_LPUART0506_CLK 0x74 6>; dmas = <&edma4 6 23>, <&edma4 7 24>; @@ -188,9 +188,9 @@ status = "disabled"; }; - lpuart8: serial@2DA0000 { + lpuart8: serial@2da0000 { compatible = "nxp,lpuart"; - reg = <0x2DA0000 0x4000>; + reg = <0x2da0000 0x4000>; interrupts = <197 0>; clocks = <&ccm IMX_CCM_LPUART0708_CLK 0x80 14>; dmas = <&edma4 8 178>, <&edma4 9 179>; @@ -198,9 +198,9 @@ status = "disabled"; }; - lpuart9: serial@2D70000 { + lpuart9: serial@2d70000 { compatible = "nxp,lpuart"; - reg = <0x2D70000 0x4000>; + reg = <0x2d70000 0x4000>; interrupts = <156 0>; clocks = <&ccm IMX_CCM_LPUART0910_CLK 0x80 14>; dmas = <&edma4 10 172>, <&edma4 11 173>; @@ -208,9 +208,9 @@ status = "disabled"; }; - lpuart10: serial@2D80000 { + lpuart10: serial@2d80000 { compatible = "nxp,lpuart"; - reg = <0x2D80000 0x4000>; + reg = <0x2d80000 0x4000>; interrupts = <157 0>; clocks = <&ccm IMX_CCM_LPUART0910_CLK 0x80 14>; dmas = <&edma4 12 174>, <&edma4 13 175>; @@ -218,9 +218,9 @@ status = "disabled"; }; - lpuart11: serial@2D90000 { + lpuart11: serial@2d90000 { compatible = "nxp,lpuart"; - reg = <0x2D90000 0x4000>; + reg = <0x2d90000 0x4000>; interrupts = <158 0>; clocks = <&ccm IMX_CCM_LPUART1112_CLK 0x80 14>; dmas = <&edma4 14 176>, <&edma4 15 177>; @@ -1182,9 +1182,9 @@ #pwm-cells = <3>; }; - tpm3: pwm@24E0000 { + tpm3: pwm@24e0000 { compatible = "nxp,kinetis-tpm"; - reg = <0x24E0000 0x88>; + reg = <0x24e0000 0x88>; interrupts = <75 0>; clocks = <&ccm IMX_CCM_TPM3_CLK 0x3d 0>; prescaler = <16>; @@ -1192,9 +1192,9 @@ #pwm-cells = <3>; }; - tpm4: pwm@24F0000 { + tpm4: pwm@24f0000 { compatible = "nxp,kinetis-tpm"; - reg = <0x24F0000 0x88>; + reg = <0x24f0000 0x88>; interrupts = <76 0>; clocks = <&ccm IMX_CCM_TPM4_CLK 0x3e 0>; prescaler = <16>; @@ -1306,14 +1306,14 @@ <139 0>, <140 0>, <141 0>, <142 0>, <143 0>, <127 0>; channels-shared-irq-mask = <0x00000003 0x00000003 - 0x0000000C 0x0000000C 0x00000030 0x00000030 - 0x000000C0 0x000000C0 0x00000300 0x00000300 - 0x00000C00 0x00000C00 0x00003000 0x00003000 - 0x0000C000 0x0000C000 0x00030000 0x00030000 - 0x000C0000 0x000C0000 0x00300000 0x00300000 - 0x00C00000 0x00C00000 0x03000000 0x03000000 - 0x0C000000 0x0C000000 0x30000000 0x30000000 - 0xC0000000 0xC0000000>; + 0x0000000c 0x0000000c 0x00000030 0x00000030 + 0x000000c0 0x000000c0 0x00000300 0x00000300 + 0x00000c00 0x00000c00 0x00003000 0x00003000 + 0x0000c000 0x0000c000 0x00030000 0x00030000 + 0x000c0000 0x000c0000 0x00300000 0x00300000 + 0x00c00000 0x00c00000 0x03000000 0x03000000 + 0x0c000000 0x0c000000 0x30000000 0x30000000 + 0xc0000000 0xc0000000>; status = "disabled"; }; @@ -1340,7 +1340,7 @@ kpp: kpp@2a00000 { compatible = "nxp,mcux-kpp"; - reg = <0x2A00000 0x1000>; + reg = <0x2a00000 0x1000>; interrupts = <211 0>; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi b/dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi index 35df8b101e80..b2d7a7b6a8a2 100644 --- a/dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi +++ b/dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi @@ -11,9 +11,9 @@ / { soc { - itcm: itcm@FFE0000 { + itcm: itcm@ffe0000 { compatible = "zephyr,memory-region", "nxp,imx-itcm"; - reg = <0xFFE0000 DT_SIZE_K(128)>; + reg = <0xffe0000 DT_SIZE_K(128)>; zephyr,memory-region = "ITCM"; }; diff --git a/dts/arm/nxp/nxp_rt11xx.dtsi b/dts/arm/nxp/nxp_rt11xx.dtsi index c962666e6c97..d794f5d4039a 100644 --- a/dts/arm/nxp/nxp_rt11xx.dtsi +++ b/dts/arm/nxp/nxp_rt11xx.dtsi @@ -960,7 +960,7 @@ wdog1: wdog@40030000 { compatible = "nxp,imx-wdog"; - reg = <0x40030000 0xA>; + reg = <0x40030000 0xa>; status = "disabled"; interrupts = <112 0>; }; @@ -1062,7 +1062,7 @@ nxp,a-on; reg = <0x40070000 0x4000>, <0x40074000 0x4000>; - clocks = <&ccm IMX_CCM_EDMA_CLK 0x7C 0x000000C0>; + clocks = <&ccm IMX_CCM_EDMA_CLK 0x7c 0x000000c0>; status = "disabled"; interrupts = <0 0>, <1 0>, <2 0>, <3 0>, <4 0>, <5 0>, <6 0>, <7 0>, @@ -1081,7 +1081,7 @@ nxp,a-on; reg = <0x40c14000 0x4000>, <0x40c18000 0x4000>; - clocks = <&ccm IMX_CCM_EDMA_LPSR_CLK 0x7C 0x000000C0>; + clocks = <&ccm IMX_CCM_EDMA_LPSR_CLK 0x7c 0x000000c0>; status = "disabled"; interrupts = <0 0>, <1 0>, <2 0>, <3 0>, <4 0>, <5 0>, <6 0>, <7 0>, diff --git a/dts/arm/nxp/nxp_rt5xx_common.dtsi b/dts/arm/nxp/nxp_rt5xx_common.dtsi index f9f88c52814c..661056af7915 100644 --- a/dts/arm/nxp/nxp_rt5xx_common.dtsi +++ b/dts/arm/nxp/nxp_rt5xx_common.dtsi @@ -59,9 +59,9 @@ * LPOSC, SRAM's, FlexSPI0 SRAM powered on * during deep sleep mode. */ - deep-sleep-config = <0xC800>, + deep-sleep-config = <0xc800>, <0x80000004>, - <0xFFFFFFFF>, + <0xffffffff>, <0>; }; }; diff --git a/dts/arm/nxp/nxp_rt7xx_common.dtsi b/dts/arm/nxp/nxp_rt7xx_common.dtsi index 70642103d368..3072fa27ebcc 100644 --- a/dts/arm/nxp/nxp_rt7xx_common.dtsi +++ b/dts/arm/nxp/nxp_rt7xx_common.dtsi @@ -88,10 +88,10 @@ zephyr,memory-region = "SRAM1"; }; - sram3: memory@205C0000 { + sram3: memory@205c0000 { compatible = "mmio-sram"; /* Only use 256K, align with SDK */ - reg = <0x205C0000 DT_SIZE_K(256)>; + reg = <0x205c0000 DT_SIZE_K(256)>; }; sram4: memory@20600000 { diff --git a/dts/arm/nxp/nxp_rw6xx_common.dtsi b/dts/arm/nxp/nxp_rw6xx_common.dtsi index 6015ac85275b..017eb93daf96 100644 --- a/dts/arm/nxp/nxp_rw6xx_common.dtsi +++ b/dts/arm/nxp/nxp_rw6xx_common.dtsi @@ -80,8 +80,8 @@ ranges = <0x0 0x41380000 DT_SIZE_K(510)>; }; - smu2: sram@443C0000 { - ranges = <0x0 0x443C0000 DT_SIZE_K(140)>; + smu2: sram@443c0000 { + ranges = <0x0 0x443c0000 DT_SIZE_K(140)>; }; peripheral_domain: peripheral-domain { diff --git a/dts/arm/nxp/nxp_s32k344_m7.dtsi b/dts/arm/nxp/nxp_s32k344_m7.dtsi index 1f7e6cdd6664..467cee0233ef 100644 --- a/dts/arm/nxp/nxp_s32k344_m7.dtsi +++ b/dts/arm/nxp/nxp_s32k344_m7.dtsi @@ -701,42 +701,42 @@ <64 0>, <65 0>, <66 0>; interrupt-names = "0_0", "0_1", "0_2", "0_3", "0_4", "0_5"; - internal-cnt = <0xC101FF>; + internal-cnt = <0xc101ff>; status = "disabled"; master_bus { emios0_bus_a: emios0_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07FFFFF>; + channel-mask = <0x07fffff>; status = "disabled"; }; emios0_bus_b: emios0_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000FE>; + channel-mask = <0x00000fe>; status = "disabled"; }; emios0_bus_c: emios0_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000FE00>; + channel-mask = <0x0000fe00>; status = "disabled"; }; emios0_bus_d: emios0_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00FE0000>; + channel-mask = <0x00fe0000>; status = "disabled"; }; emios0_bus_f: emios0_bus_f { channel = <22>; bus-type = "BUS_F"; - channel-mask = <0x0BFFFFF>; + channel-mask = <0x0bfffff>; status = "disabled"; }; }; @@ -756,41 +756,41 @@ <72 0>, <73 0>, <74 0>; interrupt-names = "1_0", "1_1", "1_2", "1_3", "1_4", "1_5"; - internal-cnt = <0xC10101>; + internal-cnt = <0xc10101>; status = "disabled"; master_bus { emios1_bus_a: emios1_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07FFFFF>; + channel-mask = <0x07fffff>; status = "disabled"; }; emios1_bus_b: emios1_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000FE>; + channel-mask = <0x00000fe>; status = "disabled"; }; emios1_bus_c: emios1_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000FE00>; + channel-mask = <0x0000fe00>; status = "disabled"; }; emios1_bus_d: emios1_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00FE0000>; + channel-mask = <0x00fe0000>; status = "disabled"; }; emios1_bus_f: emios1_bus_f { channel = <22>; - channel-mask = <0x0BFFFFF>; + channel-mask = <0x0bfffff>; bus-type = "BUS_F"; status = "disabled"; }; @@ -811,42 +811,42 @@ <80 0>, <81 0>, <82 0>; interrupt-names = "2_0", "2_1", "2_2", "2_3", "2_4", "2_5"; - internal-cnt = <0xC10101>; + internal-cnt = <0xc10101>; status = "disabled"; master_bus { emios2_bus_a: emios2_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07FFFFF>; + channel-mask = <0x07fffff>; status = "disabled"; }; emios2_bus_b: emios2_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000FE>; + channel-mask = <0x00000fe>; status = "disabled"; }; emios2_bus_c: emios2_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000FE00>; + channel-mask = <0x0000fe00>; status = "disabled"; }; emios2_bus_d: emios2_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00FE0000>; + channel-mask = <0x00fe0000>; status = "disabled"; }; emios2_bus_f: emios2_bus_f { channel = <22>; bus-type = "BUS_F"; - channel-mask = <0x0BFFFFF>; + channel-mask = <0x0bfffff>; status = "disabled"; }; }; diff --git a/dts/arm/nxp/nxp_s32k566.dtsi b/dts/arm/nxp/nxp_s32k566.dtsi index 201148656739..23f990784006 100644 --- a/dts/arm/nxp/nxp_s32k566.dtsi +++ b/dts/arm/nxp/nxp_s32k566.dtsi @@ -807,7 +807,7 @@ clocks = <&clock NXP_S32_EMIOS0_IPG_CLK>; interrupt-names = "0_5", "0_4", "0_3", "0_2", "0_1", "0_0"; - internal-cnt = <0xFFFFFF>; + internal-cnt = <0xffffff>; global-timebase-provider = <&emios0>; status = "disabled"; @@ -815,35 +815,35 @@ emios0_bus_a: emios0_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07FFFFF>; + channel-mask = <0x07fffff>; status = "disabled"; }; emios0_bus_b: emios0_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000FE>; + channel-mask = <0x00000fe>; status = "disabled"; }; emios0_bus_c: emios0_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000FE00>; + channel-mask = <0x0000fe00>; status = "disabled"; }; emios0_bus_d: emios0_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00FE0000>; + channel-mask = <0x00fe0000>; status = "disabled"; }; emios0_bus_f: emios0_bus_f { channel = <22>; bus-type = "BUS_F"; - channel-mask = <0x0BFFFFF>; + channel-mask = <0x0bfffff>; status = "disabled"; }; }; @@ -861,7 +861,7 @@ clocks = <&clock NXP_S32_EMIOS1_IPG_CLK>; interrupt-names = "0_5", "0_4", "0_3", "0_2", "0_1", "0_0"; - internal-cnt = <0xFFFFFF>; + internal-cnt = <0xffffff>; global-timebase-provider = <&emios1>; status = "disabled"; @@ -869,34 +869,34 @@ emios1_bus_a: emios1_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07FFFFF>; + channel-mask = <0x07fffff>; status = "disabled"; }; emios1_bus_b: emios1_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000FE>; + channel-mask = <0x00000fe>; status = "disabled"; }; emios1_bus_c: emios1_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000FE00>; + channel-mask = <0x0000fe00>; status = "disabled"; }; emios1_bus_d: emios1_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00FE0000>; + channel-mask = <0x00fe0000>; status = "disabled"; }; emios1_bus_f: emios1_bus_f { channel = <22>; - channel-mask = <0x0BFFFFF>; + channel-mask = <0x0bfffff>; bus-type = "BUS_F"; status = "disabled"; }; @@ -915,7 +915,7 @@ clocks = <&clock NXP_S32_EMIOS2_IPG_CLK>; interrupt-names = "0_5", "0_4", "0_3", "0_2", "0_1", "0_0"; - internal-cnt = <0xFFFFFF>; + internal-cnt = <0xffffff>; global-timebase-provider = <&emios2>; status = "disabled"; @@ -923,35 +923,35 @@ emios2_bus_a: emios2_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07FFFFF>; + channel-mask = <0x07fffff>; status = "disabled"; }; emios2_bus_b: emios2_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000FE>; + channel-mask = <0x00000fe>; status = "disabled"; }; emios2_bus_c: emios2_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000FE00>; + channel-mask = <0x0000fe00>; status = "disabled"; }; emios2_bus_d: emios2_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00FE0000>; + channel-mask = <0x00fe0000>; status = "disabled"; }; emios2_bus_f: emios2_bus_f { channel = <22>; bus-type = "BUS_F"; - channel-mask = <0x0BFFFFF>; + channel-mask = <0x0bfffff>; status = "disabled"; }; }; diff --git a/dts/arm/nxp/nxp_s32z27x_r52.dtsi b/dts/arm/nxp/nxp_s32z27x_r52.dtsi index 8a4634610418..1956dcc3cd76 100644 --- a/dts/arm/nxp/nxp_s32z27x_r52.dtsi +++ b/dts/arm/nxp/nxp_s32z27x_r52.dtsi @@ -1130,7 +1130,7 @@ sar_adc0: adc@402c0000 { compatible = "nxp,s32-adc-sar"; - reg = <0x402C0000 0x1000>; + reg = <0x402c0000 0x1000>; interrupts = , , ; @@ -1306,7 +1306,7 @@ compatible = "nxp,s32-emios"; reg = <0x420b0000 0x4000>; clocks = <&clock NXP_S32_P4_REG_INTF_CLK>; - internal-cnt = <0xFFFFFFFF>; + internal-cnt = <0xffffffff>; interrupts = , , , @@ -1349,35 +1349,35 @@ emios0_bus_a: emios0_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0xFF7FFFFF>; + channel-mask = <0xff7fffff>; status = "disabled"; }; emios0_bus_b: emios0_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x000000FE>; + channel-mask = <0x000000fe>; status = "disabled"; }; emios0_bus_c: emios0_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000FE00>; + channel-mask = <0x0000fe00>; status = "disabled"; }; emios0_bus_d: emios0_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00FE0000>; + channel-mask = <0x00fe0000>; status = "disabled"; }; emios0_bus_e: emios0_bus_e { channel = <24>; bus-type = "BUS_E"; - channel-mask = <0xFE000000>; + channel-mask = <0xfe000000>; status = "disabled"; }; }; @@ -1393,7 +1393,7 @@ compatible = "nxp,s32-emios"; reg = <0x400b0000 0x4000>; clocks = <&clock NXP_S32_P0_REG_INTF_CLK>; - internal-cnt = <0xFFFFFFFF>; + internal-cnt = <0xffffffff>; interrupts = , , , @@ -1435,34 +1435,34 @@ emios1_bus_a: emios1_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0xFF7FFFFF>; + channel-mask = <0xff7fffff>; status = "disabled"; }; emios1_bus_b: emios1_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x000000FE>; + channel-mask = <0x000000fe>; status = "disabled"; }; emios1_bus_c: emios1_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000FE00>; + channel-mask = <0x0000fe00>; status = "disabled"; }; emios1_bus_d: emios1_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00FE0000>; + channel-mask = <0x00fe0000>; status = "disabled"; }; emios1_bus_e: emios1_bus_e { channel = <24>; - channel-mask = <0xFE000000>; + channel-mask = <0xfe000000>; bus-type = "BUS_E"; status = "disabled"; }; diff --git a/dts/arm/realtek/amebad/amebad.dtsi b/dts/arm/realtek/amebad/amebad.dtsi index 0ec2d9324c03..45b6b010562d 100644 --- a/dts/arm/realtek/amebad/amebad.dtsi +++ b/dts/arm/realtek/amebad/amebad.dtsi @@ -64,7 +64,7 @@ #size-cells = <1>; status = "disabled"; - flash0: flash@E000020 { + flash0: flash@e000020 { compatible = "soc-nv-flash"; erase-block-size = ; write-block-size = <4>; diff --git a/dts/arm/realtek/ec/rts5912.dtsi b/dts/arm/realtek/ec/rts5912.dtsi index bd1c32bf75e2..cabf52168165 100644 --- a/dts/arm/realtek/ec/rts5912.dtsi +++ b/dts/arm/realtek/ec/rts5912.dtsi @@ -35,8 +35,8 @@ }; }; - flash0: flash@2000B400 { - reg = <0x2000B400 0x40000>; + flash0: flash@2000b400 { + reg = <0x2000b400 0x40000>; }; sram0: memory@20050000 { @@ -94,7 +94,7 @@ interrupts = <196 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR0_CLKPWR>; clock-names = "tmr32"; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -107,7 +107,7 @@ interrupts = <197 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR1_CLKPWR>; clock-names = "tmr32"; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -120,7 +120,7 @@ interrupts = <198 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR2_CLKPWR>; clock-names = "tmr32"; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -133,7 +133,7 @@ interrupts = <199 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR3_CLKPWR>; clock-names = "tmr32"; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -146,7 +146,7 @@ interrupts = <200 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR4_CLKPWR>; clock-names = "tmr32"; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -159,7 +159,7 @@ interrupts = <201 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR5_CLKPWR>; clock-names = "tmr32"; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -173,20 +173,20 @@ reg = <0x400b1000 0x200 /* espi target */ 0x400a0400 0x01c /* port80 */ 0x400a0200 0x1c /* ACPI */ - 0x400A021C 0x1C /* PROMT0 */ - 0x400A0238 0x1C /* PROMT1 */ - 0x400A0254 0x1C /* PROMT2 */ - 0x400A0270 0x1C /* PROMT3 */ + 0x400a021c 0x1c /* PROMT0 */ + 0x400a0238 0x1c /* PROMT1 */ + 0x400a0254 0x1c /* PROMT2 */ + 0x400a0270 0x1c /* PROMT3 */ 0x40082000 0x14 /* EMI0 */ 0x40082020 0x14 /* EMI1 */ 0x40082040 0x14 /* EMI2 */ 0x40082060 0x14 /* EMI3 */ 0x40082080 0x14 /* EMI4 */ - 0x400820A0 0x14 /* EMI5 */ - 0x400820C0 0x14 /* EMI6 */ - 0x400820E0 0x14 /* EMI7 */ + 0x400820a0 0x14 /* EMI5 */ + 0x400820c0 0x14 /* EMI6 */ + 0x400820e0 0x14 /* EMI7 */ 0x400a0100 0x1c /* KBC */ - 0x400B1600 0xd0>; /* MBX */ + 0x400b1600 0xd0>; /* MBX */ reg-names = "espi_target", "port80", "acpi", "promt0", "promt1", "promt2", "promt3", "emi0", "emi1", "emi2", "emi3", "emi4", "emi5", @@ -250,7 +250,7 @@ interrupts = <202 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_SLWTMR0_CLKPWR>; clock-names = "slwtmr"; - max-value = <0xFFFFFFFF>; + max-value = <0xffffffff>; clock-frequency = <1000000>; prescaler = <0>; status = "disabled"; @@ -277,7 +277,7 @@ #size-cells = <0>; compatible = "realtek,rts5912-spi"; clocks = <&sccon RTS5912_SCCON_SYS 0>; - reg = <0x40010400 0x3C>; + reg = <0x40010400 0x3c>; status = "disabled"; }; diff --git a/dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi b/dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi index a22606f22921..e9ee71eac017 100644 --- a/dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi +++ b/dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi @@ -153,9 +153,9 @@ status = "disabled"; }; - pinctrl: pin-controller@4001F800 { + pinctrl: pin-controller@4001f800 { compatible = "renesas,ra-pinctrl-pfs"; - reg = <0x4001F800 0x3c0>; + reg = <0x4001f800 0x3c0>; status = "okay"; }; diff --git a/dts/arm/renesas/ra/ra8/ra8x1.dtsi b/dts/arm/renesas/ra/ra8/ra8x1.dtsi index 9774b1c95852..5a2c0b006268 100644 --- a/dts/arm/renesas/ra/ra8/ra8x1.dtsi +++ b/dts/arm/renesas/ra/ra8/ra8x1.dtsi @@ -230,7 +230,7 @@ iic0: iic0@4025e000 { compatible = "renesas,ra-iic"; channel = <0>; - reg = <0x4025E000 0x100>; + reg = <0x4025e000 0x100>; status = "disabled"; }; @@ -239,7 +239,7 @@ channel = <1>; interrupts = <91 1>, <92 1>, <93 1>, <94 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x4025E100 0x100>; + reg = <0x4025e100 0x100>; status = "disabled"; }; diff --git a/dts/arm/renesas/ra/ra8/ra8x2.dtsi b/dts/arm/renesas/ra/ra8/ra8x2.dtsi index 936bf4d669b1..afc8c09da1ab 100644 --- a/dts/arm/renesas/ra/ra8/ra8x2.dtsi +++ b/dts/arm/renesas/ra/ra8/ra8x2.dtsi @@ -247,21 +247,21 @@ iic0: iic0@4025e000 { compatible = "renesas,ra-iic"; channel = <0>; - reg = <0x4025E000 0x100>; + reg = <0x4025e000 0x100>; status = "disabled"; }; iic1: iic1@4025e100 { compatible = "renesas,ra-iic"; channel = <1>; - reg = <0x4025E100 0x100>; + reg = <0x4025e100 0x100>; status = "disabled"; }; iic2: iic2@4025e200 { compatible = "renesas,ra-iic"; channel = <2>; - reg = <0x4025E200 0x100>; + reg = <0x4025e200 0x100>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rza/r7s9210.dtsi b/dts/arm/renesas/rz/rza/r7s9210.dtsi index 5e6f1bc9b6ae..0eb81524057c 100644 --- a/dts/arm/renesas/rz/rza/r7s9210.dtsi +++ b/dts/arm/renesas/rz/rza/r7s9210.dtsi @@ -327,7 +327,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <3300>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; clocks = <&cpg RZA2M_CLOCK(RZA2M_MODULE_ADC, RZA2M_CLK_P1C)>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzg/r9a07g044.dtsi b/dts/arm/renesas/rz/rzg/r9a07g044.dtsi index e1567177e7c4..df98751af445 100644 --- a/dts/arm/renesas/rz/rzg/r9a07g044.dtsi +++ b/dts/arm/renesas/rz/rzg/r9a07g044.dtsi @@ -498,7 +498,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzg/r9a08g045.dtsi b/dts/arm/renesas/rz/rzg/r9a08g045.dtsi index 050644aaa40a..051120ea0d91 100644 --- a/dts/arm/renesas/rz/rzg/r9a08g045.dtsi +++ b/dts/arm/renesas/rz/rzg/r9a08g045.dtsi @@ -215,7 +215,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0x01FF>; + channel-available-mask = <0x01ff>; status = "disabled"; }; @@ -391,12 +391,12 @@ status = "disabled"; }; - gpio18: gpio@A00 { + gpio18: gpio@a00 { compatible = "renesas,rz-gpio"; gpio-controller; #gpio-cells = <2>; ngpios = <6>; - reg = <0xA00>; + reg = <0xa00>; status = "disabled"; }; }; diff --git a/dts/arm/renesas/rz/rzn/r9a07g084.dtsi b/dts/arm/renesas/rz/rzn/r9a07g084.dtsi index e7a48f2e9743..f019c614ccaf 100644 --- a/dts/arm/renesas/rz/rzn/r9a07g084.dtsi +++ b/dts/arm/renesas/rz/rzn/r9a07g084.dtsi @@ -87,19 +87,19 @@ loader_param: partition@0 { label = "loader-param"; - reg = <0x00000000 0x4C>; + reg = <0x00000000 0x4c>; read-only; }; - loader_program: partition@4C { + loader_program: partition@4c { label = "loader-program"; - reg = <0x0000004C (DT_SIZE_K(56) - 0x4C)>; + reg = <0x0000004c (DT_SIZE_K(56) - 0x4C)>; read-only; }; - slot0_partition: partition@E000 { + slot0_partition: partition@e000 { label = "image-0"; - reg = <0x0000E000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; + reg = <0x0000e000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; read-only; }; }; @@ -218,7 +218,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xF>; + channel-available-mask = <0xf>; status = "disabled"; }; @@ -230,7 +230,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzt/r9a07g074.dtsi b/dts/arm/renesas/rz/rzt/r9a07g074.dtsi index 518da4dd89ba..48b8f93c056e 100644 --- a/dts/arm/renesas/rz/rzt/r9a07g074.dtsi +++ b/dts/arm/renesas/rz/rzt/r9a07g074.dtsi @@ -78,19 +78,19 @@ loader_param: partition@0 { label = "loader-param"; - reg = <0x00000000 0x4C>; + reg = <0x00000000 0x4c>; read-only; }; - loader_program: partition@4C { + loader_program: partition@4c { label = "loader-program"; - reg = <0x0000004C (DT_SIZE_K(56) - 0x4C)>; + reg = <0x0000004c (DT_SIZE_K(56) - 0x4C)>; read-only; }; - slot0_partition: partition@E000 { + slot0_partition: partition@e000 { label = "image-0"; - reg = <0x0000E000 (DT_SIZE_M(16) - DT_SIZE_K(56))>; + reg = <0x0000e000 (DT_SIZE_M(16) - DT_SIZE_K(56))>; read-only; }; }; @@ -487,7 +487,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xF>; + channel-available-mask = <0xf>; status = "disabled"; }; @@ -499,7 +499,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xF>; + channel-available-mask = <0xf>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzt/r9a07g075.dtsi b/dts/arm/renesas/rz/rzt/r9a07g075.dtsi index c9962c5a51eb..247b36996ca8 100644 --- a/dts/arm/renesas/rz/rzt/r9a07g075.dtsi +++ b/dts/arm/renesas/rz/rzt/r9a07g075.dtsi @@ -95,19 +95,19 @@ loader_param: partition@0 { label = "loader-param"; - reg = <0x00000000 0x4C>; + reg = <0x00000000 0x4c>; read-only; }; - loader_program: partition@4C { + loader_program: partition@4c { label = "loader-program"; - reg = <0x0000004C (DT_SIZE_K(56) - 0x4C)>; + reg = <0x0000004c (DT_SIZE_K(56) - 0x4C)>; read-only; }; - slot0_partition: partition@E000 { + slot0_partition: partition@e000 { label = "image-0"; - reg = <0x0000E000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; + reg = <0x0000e000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; read-only; }; }; @@ -231,7 +231,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; @@ -243,7 +243,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFFFF>; + channel-available-mask = <0xffff>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzv/r9a07g054.dtsi b/dts/arm/renesas/rz/rzv/r9a07g054.dtsi index b0a357baca56..83c03134ff67 100644 --- a/dts/arm/renesas/rz/rzv/r9a07g054.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a07g054.dtsi @@ -55,7 +55,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzv/r9a09g056.dtsi b/dts/arm/renesas/rz/rzv/r9a09g056.dtsi index 8af64a2690b3..a9fce7823bd1 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g056.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g056.dtsi @@ -166,7 +166,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; @@ -178,7 +178,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; @@ -190,7 +190,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi b/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi index 5dad51d7aff4..4ff49a0ba424 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi @@ -725,7 +725,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi b/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi index 5e61653c3d59..be77fa1187ed 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi @@ -48,7 +48,7 @@ , , ; - reg = <0x12c10200 0x1C>; + reg = <0x12c10200 0x1c>; label = "arch_timer"; }; @@ -205,7 +205,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xFF>; + channel-available-mask = <0xff>; status = "disabled"; }; diff --git a/dts/arm/renesas/smartbond/da1469x.dtsi b/dts/arm/renesas/smartbond/da1469x.dtsi index df52ffab55ed..fd27e839b58d 100644 --- a/dts/arm/renesas/smartbond/da1469x.dtsi +++ b/dts/arm/renesas/smartbond/da1469x.dtsi @@ -321,7 +321,7 @@ adc: adc@50030900 { compatible = "renesas,smartbond-adc"; - reg = <0x50030900 0x1C>; + reg = <0x50030900 0x1c>; interrupts = <27 0>; status = "disabled"; #io-channel-cells = <1>; @@ -329,7 +329,7 @@ sdadc: sdadc@50020800 { compatible = "renesas,smartbond-sdadc"; - reg = <0x50020800 0x1C>; + reg = <0x50020800 0x1c>; interrupts = <28 0>; clock-freq = <2>; status = "disabled"; @@ -345,7 +345,7 @@ trng: trng@50040c00 { compatible = "renesas,smartbond-trng"; - reg = <0x50040c00 0x0C>; + reg = <0x50040c00 0x0c>; interrupts = <24 0>; status = "okay"; }; @@ -372,7 +372,7 @@ lcdc: lcdc@30030000 { compatible = "renesas,smartbond-display"; - reg = <0x30030000 0x18C>; + reg = <0x30030000 0x18c>; interrupts = <32 0>; status = "disabled"; }; @@ -399,7 +399,7 @@ usbd: usb@50040000 { compatible = "renesas,smartbond-usbd"; - reg = <0x50040000 0x1B0>; + reg = <0x50040000 0x1b0>; dmas = <&dma 0 DMA_SMARTBOND_TRIG_MUX_USB>, <&dma 1 DMA_SMARTBOND_TRIG_MUX_USB>; dma-names = "rx", "tx"; diff --git a/dts/arm/silabs/gg11/efm32gg11.dtsi b/dts/arm/silabs/gg11/efm32gg11.dtsi index 529b3e90587d..f88d98a0c1f4 100644 --- a/dts/arm/silabs/gg11/efm32gg11.dtsi +++ b/dts/arm/silabs/gg11/efm32gg11.dtsi @@ -273,7 +273,7 @@ wdog0: wdog@40052000 { compatible = "silabs,gecko-wdog"; - reg = <0x40052000 0x2C>; + reg = <0x40052000 0x2c>; peripheral-id = <0>; interrupts = <1 0>; status = "disabled"; @@ -281,7 +281,7 @@ wdog1: wdog@40052400 { compatible = "silabs,gecko-wdog"; - reg = <0x40052400 0x2C>; + reg = <0x40052400 0x2c>; peripheral-id = <1>; interrupts = <64 0>; status = "disabled"; diff --git a/dts/arm/silabs/gg11/efm32gg11b820f2048gl192.dtsi b/dts/arm/silabs/gg11/efm32gg11b820f2048gl192.dtsi index 4f17b7fbb21d..b682d2f5b383 100644 --- a/dts/arm/silabs/gg11/efm32gg11b820f2048gl192.dtsi +++ b/dts/arm/silabs/gg11/efm32gg11b820f2048gl192.dtsi @@ -15,7 +15,7 @@ eth0: eth@40024000 { /* ETH0 */ compatible = "silabs,gecko-ethernet"; - reg = <0x40024000 0xC14>; + reg = <0x40024000 0xc14>; interrupts = <59 0>; status = "disabled"; }; diff --git a/dts/arm/silabs/gg12/efm32gg12.dtsi b/dts/arm/silabs/gg12/efm32gg12.dtsi index 5938baab5c24..5ba11750cf86 100644 --- a/dts/arm/silabs/gg12/efm32gg12.dtsi +++ b/dts/arm/silabs/gg12/efm32gg12.dtsi @@ -226,7 +226,7 @@ wdog0: wdog@40052000 { compatible = "silabs,gecko-wdog"; - reg = <0x40052000 0x2C>; + reg = <0x40052000 0x2c>; peripheral-id = <0>; interrupts = <1 0>; status = "disabled"; @@ -234,7 +234,7 @@ wdog1: wdog@40052400 { compatible = "silabs,gecko-wdog"; - reg = <0x40052400 0x2C>; + reg = <0x40052400 0x2c>; peripheral-id = <1>; interrupts = <55 0>; status = "disabled"; diff --git a/dts/arm/silabs/siwg917.dtsi b/dts/arm/silabs/siwg917.dtsi index b8c365cb5db2..4c5f0bfaca68 100644 --- a/dts/arm/silabs/siwg917.dtsi +++ b/dts/arm/silabs/siwg917.dtsi @@ -245,7 +245,7 @@ egpio1: egpio@2404c000 { compatible = "silabs,siwx91x-gpio"; - reg = <0x2404C000 0x1260>; + reg = <0x2404c000 0x1260>; interrupts = <18 0>; interrupt-names = "ULP"; silabs,ulp; @@ -318,7 +318,7 @@ compatible = "silabs,siwx91x-dma"; #address-cells = <1>; #size-cells = <0>; - reg = <0x24078000 0x82C>; + reg = <0x24078000 0x82c>; interrupts = <10 0>; interrupt-names = "ulpdma"; clocks = <&clock0 SIWX91X_CLK_ULP_DMA>; @@ -334,7 +334,7 @@ compatible = "silabs,siwx91x-dma"; #address-cells = <1>; #size-cells = <0>; - reg = <0x44030000 0x82C>; + reg = <0x44030000 0x82c>; interrupts = <33 0>; interrupt-names = "dma0"; clocks = <&clock0 SIWX91X_CLK_DMA0>; @@ -365,7 +365,7 @@ compatible = "silabs,siwx91x-pwm"; #address-cells = <1>; #size-cells = <0>; - reg = <0x47070000 0x14C>; + reg = <0x47070000 0x14c>; interrupts = <48 0>; interrupt-names = "pwm"; clocks = <&clock0 SIWX91X_CLK_PWM>; @@ -389,7 +389,7 @@ compatible = "silabs,siwx91x-wdt"; #address-cells = <1>; #size-cells = <0>; - reg = <0x24048300 0x1C>; + reg = <0x24048300 0x1c>; interrupts = <20 0>; interrupt-names = "watchdog"; clocks = <&clock0 SIWX91X_CLK_WATCHDOG>; @@ -410,7 +410,7 @@ compatible = "silabs,gspi"; #address-cells = <1>; #size-cells = <0>; - reg = <0x45030000 0xBC>; + reg = <0x45030000 0xbc>; interrupts = <46 0>; interrupt-names = "gspi"; clocks = <&clock0 SIWX91X_CLK_GSPI>; diff --git a/dts/arm/silabs/xg12/xg12.dtsi b/dts/arm/silabs/xg12/xg12.dtsi index f0f6b2401353..7a0ded78a2dc 100644 --- a/dts/arm/silabs/xg12/xg12.dtsi +++ b/dts/arm/silabs/xg12/xg12.dtsi @@ -213,7 +213,7 @@ wdog0: wdog@40052000 { compatible = "silabs,gecko-wdog"; - reg = <0x40052000 0x2C>; + reg = <0x40052000 0x2c>; peripheral-id = <0>; interrupts = <2 0>; status = "disabled"; @@ -221,7 +221,7 @@ wdog1: wdog@40052400 { compatible = "silabs,gecko-wdog"; - reg = <0x40052400 0x2C>; + reg = <0x40052400 0x2c>; peripheral-id = <1>; interrupts = <3 0>; status = "disabled"; diff --git a/dts/arm/silabs/xg13/efr32xg13.dtsi b/dts/arm/silabs/xg13/efr32xg13.dtsi index e3dd0e6fd1ac..5ea50101d1b5 100644 --- a/dts/arm/silabs/xg13/efr32xg13.dtsi +++ b/dts/arm/silabs/xg13/efr32xg13.dtsi @@ -165,7 +165,7 @@ wdog0: wdog@40052000 { compatible = "silabs,gecko-wdog"; - reg = <0x40052000 0x2C>; + reg = <0x40052000 0x2c>; peripheral-id = <0>; interrupts = <2 0>; status = "disabled"; @@ -173,7 +173,7 @@ wdog1: wdog@40052400 { compatible = "silabs,gecko-wdog"; - reg = <0x40052400 0x2C>; + reg = <0x40052400 0x2c>; peripheral-id = <1>; interrupts = <3 0>; status = "disabled"; diff --git a/dts/arm/st/f1/stm32f103Xc.dtsi b/dts/arm/st/f1/stm32f103Xc.dtsi index cec1209fc6c7..63cecfafef17 100644 --- a/dts/arm/st/f1/stm32f103Xc.dtsi +++ b/dts/arm/st/f1/stm32f103Xc.dtsi @@ -108,7 +108,7 @@ compatible = "st,stm32-spi"; #address-cells = <1>; #size-cells = <0>; - reg = <0X40003c00 0x400>; + reg = <0x40003c00 0x400>; clocks = <&rcc STM32_CLOCK(APB1, 15)>; interrupts = <51 5>; st,spi-data-width = "limited-8-16-bit"; diff --git a/dts/arm/st/f3/stm32f302.dtsi b/dts/arm/st/f3/stm32f302.dtsi index 2fa6ee84d76d..e8adf9bf2f89 100644 --- a/dts/arm/st/f3/stm32f302.dtsi +++ b/dts/arm/st/f3/stm32f302.dtsi @@ -62,7 +62,7 @@ compatible = "st,stm32-spi-fifo", "st,stm32-spi"; #address-cells = <1>; #size-cells = <0>; - reg = <0X40003c00 0x400>; + reg = <0x40003c00 0x400>; clocks = <&rcc STM32_CLOCK(APB1, 15)>; interrupts = <51 5>; st,spi-data-width = "full-4-to-16-bit"; diff --git a/dts/arm/ti/cc32xx.dtsi b/dts/arm/ti/cc32xx.dtsi index c2e7cfc598e4..bc7c3c460ccb 100644 --- a/dts/arm/ti/cc32xx.dtsi +++ b/dts/arm/ti/cc32xx.dtsi @@ -118,7 +118,7 @@ adc0: adc@4402e800 { compatible = "ti,cc32xx-adc"; - reg = <0x4402E800 0x100>; + reg = <0x4402e800 0x100>; interrupts = , , , ; status = "disabled"; #io-channel-cells = <1>; diff --git a/dts/arm/ti/mspm0/g/mspm0g1518.dtsi b/dts/arm/ti/mspm0/g/mspm0g1518.dtsi index 19512820ab28..47dbd32a339e 100644 --- a/dts/arm/ti/mspm0/g/mspm0g1518.dtsi +++ b/dts/arm/ti/mspm0/g/mspm0g1518.dtsi @@ -26,7 +26,7 @@ }; flash2: serial-flash@41e00000 { - reg = <0x41E00000 DT_SIZE_K(16)>; + reg = <0x41e00000 DT_SIZE_K(16)>; }; }; }; diff --git a/dts/arm/ti/mspm0/g/mspm0g1519.dtsi b/dts/arm/ti/mspm0/g/mspm0g1519.dtsi index 2d85d1c24b58..7da6a6f4b3dd 100644 --- a/dts/arm/ti/mspm0/g/mspm0g1519.dtsi +++ b/dts/arm/ti/mspm0/g/mspm0g1519.dtsi @@ -26,7 +26,7 @@ }; flash2: serial-flash@41e00000 { - reg = <0x41E00000 DT_SIZE_K(16)>; + reg = <0x41e00000 DT_SIZE_K(16)>; }; }; }; diff --git a/dts/arm/ti/mspm0/g/mspm0g3518.dtsi b/dts/arm/ti/mspm0/g/mspm0g3518.dtsi index 19512820ab28..47dbd32a339e 100644 --- a/dts/arm/ti/mspm0/g/mspm0g3518.dtsi +++ b/dts/arm/ti/mspm0/g/mspm0g3518.dtsi @@ -26,7 +26,7 @@ }; flash2: serial-flash@41e00000 { - reg = <0x41E00000 DT_SIZE_K(16)>; + reg = <0x41e00000 DT_SIZE_K(16)>; }; }; }; diff --git a/dts/arm/ti/mspm0/g/mspm0g3519.dtsi b/dts/arm/ti/mspm0/g/mspm0g3519.dtsi index 2d85d1c24b58..7da6a6f4b3dd 100644 --- a/dts/arm/ti/mspm0/g/mspm0g3519.dtsi +++ b/dts/arm/ti/mspm0/g/mspm0g3519.dtsi @@ -26,7 +26,7 @@ }; flash2: serial-flash@41e00000 { - reg = <0x41E00000 DT_SIZE_K(16)>; + reg = <0x41e00000 DT_SIZE_K(16)>; }; }; }; diff --git a/dts/arm/xilinx/zynq7000.dtsi b/dts/arm/xilinx/zynq7000.dtsi index 1e62ac2e1660..40ddf50f50dd 100644 --- a/dts/arm/xilinx/zynq7000.dtsi +++ b/dts/arm/xilinx/zynq7000.dtsi @@ -20,7 +20,7 @@ ocm_high: memory@fffc0000 { compatible = "zephyr,memory-region", "xlnx,zynq-ocm"; - reg = <0xFFFC0000 DT_SIZE_K(256)>; + reg = <0xfffc0000 DT_SIZE_K(256)>; zephyr,memory-region = "OCM_HIGH"; }; @@ -36,7 +36,7 @@ IRQ_DEFAULT_PRIORITY>, ; - reg = <0xf8f00200 0x1C>; + reg = <0xf8f00200 0x1c>; }; gic: interrupt-controller@f8f01000 { diff --git a/dts/arm64/intel/intel_socfpga_agilex5.dtsi b/dts/arm64/intel/intel_socfpga_agilex5.dtsi index ade3e5caba59..4df5faf2aa35 100644 --- a/dts/arm64/intel/intel_socfpga_agilex5.dtsi +++ b/dts/arm64/intel/intel_socfpga_agilex5.dtsi @@ -114,9 +114,9 @@ status = "disabled"; }; - reset: reset-controller@10D11000 { + reset: reset-controller@10d11000 { compatible = "intel,socfpga-reset"; - reg = <0x10D11000 0x100>; + reg = <0x10d11000 0x100>; active-low; #reset-cells = <1>; status = "okay"; @@ -125,7 +125,7 @@ sdmmc: sdmmc@10808000 { compatible = "cdns,sdhc"; reg = <0x10808000 0x1000>, - <0x10B92000 0x1000>; + <0x10b92000 0x1000>; reg-names = "reg_base", "combo_phy"; clock-frequency = <200000000>; power-delay-ms = <1000>; @@ -135,7 +135,7 @@ status = "disabled"; }; - timer0: timer@10C03000 { + timer0: timer@10c03000 { compatible = "snps,dw-timers"; interrupt-parent = <&gic>; interrupts = ; interrupts = ; interrupts = ; - reg = <0x10D00000 0x100>; + reg = <0x10d00000 0x100>; clocks = <&clock INTEL_SOCFPGA_CLOCK_TIMER>; resets = <&reset RSTMGR_L4SYSTIMER0_RSTLINE>; status = "disabled"; }; - timer3: timer@10D00100 { + timer3: timer@10d00100 { compatible = "snps,dw-timers"; interrupt-parent = <&gic>; interrupts = ; - reg = <0x10D00100 0x100>; + reg = <0x10d00100 0x100>; clocks = <&clock INTEL_SOCFPGA_CLOCK_TIMER>; resets = <&reset RSTMGR_L4SYSTIMER1_RSTLINE>; }; @@ -226,9 +226,9 @@ }; /* cadence Nand Flash controller*/ - nand: nand@10B80000 { + nand: nand@10b80000 { compatible = "cdns,nand"; - reg = <0x10B80000 0X10000>, + reg = <0x10b80000 0x10000>, <0x10840000 0x10000>; reg-names = "nand_reg", "sdma"; interrupt-parent = <&gic>; @@ -240,10 +240,10 @@ status = "disabled"; }; - dma0: dma@10DB0000 { + dma0: dma@10db0000 { compatible = "snps,designware-dma-axi"; #dma-cells = <1>; - reg = <0x10DB0000 0x1000>; + reg = <0x10db0000 0x1000>; interrupt-parent = <&gic>; interrupts = , @@ -258,10 +258,10 @@ status = "disabled"; }; - dma1: dma@10DC0000 { + dma1: dma@10dc0000 { compatible = "snps,designware-dma-axi"; #dma-cells = <1>; - reg = <0x10DC0000 0x1000>; + reg = <0x10dc0000 0x1000>; interrupt-parent = <&gic>; interrupts = , diff --git a/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi b/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi index d2043a2acf98..4061d64ad322 100644 --- a/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi +++ b/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi @@ -148,7 +148,7 @@ interrupts = ; gptfreq = <24000000>; - clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6C 20>; + clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6c 20>; status = "disabled"; }; diff --git a/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi b/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi index 9bed8892a4d7..3b4eba5ea151 100644 --- a/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi +++ b/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi @@ -149,7 +149,7 @@ interrupts = ; gptfreq = <24000000>; - clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6C 20>; + clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6c 20>; status = "disabled"; }; diff --git a/dts/arm64/nxp/nxp_mimx8mp_a53.dtsi b/dts/arm64/nxp/nxp_mimx8mp_a53.dtsi index f16388707582..0092d9fb72ec 100644 --- a/dts/arm64/nxp/nxp_mimx8mp_a53.dtsi +++ b/dts/arm64/nxp/nxp_mimx8mp_a53.dtsi @@ -150,7 +150,7 @@ interrupts = ; gptfreq = <24000000>; - clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6C 20>; + clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6c 20>; status = "disabled"; }; diff --git a/dts/riscv/andes/andes_v5_ae350.dtsi b/dts/riscv/andes/andes_v5_ae350.dtsi index 5ba45d146522..6f0ccdb37ae7 100644 --- a/dts/riscv/andes/andes_v5_ae350.dtsi +++ b/dts/riscv/andes/andes_v5_ae350.dtsi @@ -319,7 +319,7 @@ interrupts = <4 1>; interrupt-parent = <&plic0>; dmas = <&dma0 0 0 0x009>, - <&dma0 1 1 0x00A>; + <&dma0 1 1 0x00a>; dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; @@ -334,7 +334,7 @@ interrupts = <5 1>; interrupt-parent = <&plic0>; dmas = <&dma0 2 2 0x009>, - <&dma0 3 3 0x00A>; + <&dma0 3 3 0x00a>; dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; @@ -360,7 +360,7 @@ reg = <0xe0100000 0x1000>; interrupts = <19 2>; interrupt-parent = <&plic0>; - local-mac-address = [FC 8C EB 9B A6 51]; + local-mac-address = [fc 8c eb 9b a6 51]; status = "disabled"; }; diff --git a/dts/riscv/bflb/bl60x.dtsi b/dts/riscv/bflb/bl60x.dtsi index 4ab191e8d149..625675bdf029 100644 --- a/dts/riscv/bflb/bl60x.dtsi +++ b/dts/riscv/bflb/bl60x.dtsi @@ -148,7 +148,7 @@ adc0: adc@40002000 { compatible = "bflb,adc"; - reg = <0x40002000 0x1000 0x4000F000 0x1000>; + reg = <0x40002000 0x1000 0x4000f000 0x1000>; #io-channel-cells = <1>; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/riscv/bflb/bl61x.dtsi b/dts/riscv/bflb/bl61x.dtsi index f63d472ec28a..1de40dc2150c 100644 --- a/dts/riscv/bflb/bl61x.dtsi +++ b/dts/riscv/bflb/bl61x.dtsi @@ -113,7 +113,7 @@ mtimer: timer@e000bff8 { compatible = "riscv,machine-timer"; - reg = <0xE000BFF8 0x8 0xE0004000 0x8>; + reg = <0xe000bff8 0x8 0xe0004000 0x8>; reg-names = "mtime", "mtimecmp"; interrupts-extended = <&clic 7 1>; @@ -163,7 +163,7 @@ adc0: adc@20002000 { compatible = "bflb,adc"; - reg = <0x20002000 0x400 0x2000F000 0x1000>; + reg = <0x20002000 0x400 0x2000f000 0x1000>; #io-channel-cells = <1>; #address-cells = <1>; #size-cells = <0>; @@ -296,7 +296,7 @@ sram0: memory@62fc0000 { compatible = "mmio-sram"; - reg = <0x62FC0000 DT_SIZE_K(320)>; + reg = <0x62fc0000 DT_SIZE_K(320)>; }; sram1: memory@63010000 { diff --git a/dts/riscv/bflb/bl70x.dtsi b/dts/riscv/bflb/bl70x.dtsi index 1e6aadac74cf..92546b02a399 100644 --- a/dts/riscv/bflb/bl70x.dtsi +++ b/dts/riscv/bflb/bl70x.dtsi @@ -153,7 +153,7 @@ adc0: adc@40002000 { compatible = "bflb,adc"; - reg = <0x40002000 0x1000 0x4000F000 0x1000>; + reg = <0x40002000 0x1000 0x4000f000 0x1000>; #io-channel-cells = <1>; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/riscv/efinix/sapphire_soc.dtsi b/dts/riscv/efinix/sapphire_soc.dtsi index 289fd4f83a16..3e50d8d7a208 100644 --- a/dts/riscv/efinix/sapphire_soc.dtsi +++ b/dts/riscv/efinix/sapphire_soc.dtsi @@ -17,9 +17,9 @@ zephyr,sram = &ram0; }; - ram0: memory@F9000000 { + ram0: memory@f9000000 { device_type = "memory"; - reg = <0xF9000000 DT_SIZE_K(192)>; + reg = <0xf9000000 DT_SIZE_K(192)>; }; cpus { diff --git a/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi b/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi index b85de18fa025..af44efa41174 100644 --- a/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi +++ b/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi @@ -101,7 +101,7 @@ }; rtc_timer: rtc_timer@60008004 { - reg = <0x60008004 0xC>; + reg = <0x60008004 0xc>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; @@ -180,7 +180,7 @@ timer0: counter@6001f000 { compatible = "espressif,esp32-timer"; - reg = <0x6001F000 DT_SIZE_K(4)>; + reg = <0x6001f000 DT_SIZE_K(4)>; clocks = <&clock ESP32_TIMG0_MODULE>; group = <0>; index = <0>; @@ -196,7 +196,7 @@ trng0: trng@3ff700b0 { compatible = "espressif,esp32-trng"; - reg = <0x3FF700B0 0x4>; + reg = <0x3ff700b0 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; diff --git a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi index d60b3837c74c..75719bd14917 100644 --- a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi +++ b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi @@ -134,7 +134,7 @@ }; rtc_timer: rtc_timer@60008004 { - reg = <0x60008004 0xC>; + reg = <0x60008004 0xc>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; @@ -236,7 +236,7 @@ timer0: counter@6001f000 { compatible = "espressif,esp32-timer"; - reg = <0x6001F000 DT_SIZE_K(4)>; + reg = <0x6001f000 DT_SIZE_K(4)>; clocks = <&clock ESP32_TIMG0_MODULE>; group = <0>; index = <0>; @@ -268,7 +268,7 @@ trng0: trng@3ff700b0 { compatible = "espressif,esp32-trng"; - reg = <0x3FF700B0 0x4>; + reg = <0x3ff700b0 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi index 727f712820c5..7cfd23bb683c 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi @@ -147,7 +147,7 @@ systimer0: systimer@6000a000 { compatible = "espressif,esp32-systimer"; - reg = <0x6000A000 DT_SIZE_K(4)>; + reg = <0x6000a000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; status = "okay"; @@ -187,7 +187,7 @@ rtc_timer: rtc_timer@600b0c00 { compatible = "espressif,esp32-rtc-timer"; - reg = <0x600B0C00 DT_SIZE_K(1)>; + reg = <0x600b0c00 DT_SIZE_K(1)>; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; interrupt-parent = <&intc>; @@ -196,14 +196,14 @@ trng0: trng@600b2808 { compatible = "espressif,esp32-trng"; - reg = <0x600B2808 0x4>; + reg = <0x600b2808 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; twai0: can@6000b000 { compatible = "espressif,esp32-twai"; - reg = <0x6000B000 DT_SIZE_K(4)>; + reg = <0x6000b000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_TWAI0_MODULE>; @@ -212,7 +212,7 @@ twai1: can@6000d000 { compatible = "espressif,esp32-twai"; - reg = <0x6000D000 DT_SIZE_K(4)>; + reg = <0x6000d000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_TWAI1_MODULE>; @@ -265,13 +265,13 @@ coretemp: coretemp@6000e058 { compatible = "espressif,esp32-temp"; friendly-name = "coretemp"; - reg = <0x6000E058 0x4>; + reg = <0x6000e058 0x4>; status = "disabled"; }; adc0: adc@6000e000 { compatible = "espressif,esp32-adc"; - reg = <0x6000E000 4>; + reg = <0x6000e000 4>; clocks = <&clock ESP32_SARADC_MODULE>; unit = <1>; channel-count = <7>; @@ -359,7 +359,7 @@ usb_serial: uart@6000f000 { compatible = "espressif,esp32-usb-serial"; - reg = <0x6000F000 0x1000>; + reg = <0x6000f000 0x1000>; status = "disabled"; interrupts = ; interrupt-parent = <&intc>; diff --git a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi index 5c88040baecf..5353e91bdb38 100644 --- a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi +++ b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi @@ -114,7 +114,7 @@ systimer0: systimer@6000b000 { compatible = "espressif,esp32-systimer"; - reg = <0x6000B000 DT_SIZE_K(4)>; + reg = <0x6000b000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; status = "okay"; @@ -138,7 +138,7 @@ timer1: counter@6000a000 { compatible = "espressif,esp32-timer"; - reg = <0x6000A000 DT_SIZE_K(4)>; + reg = <0x6000a000 DT_SIZE_K(4)>; clocks = <&clock ESP32_TIMG1_MODULE>; group = <1>; index = <0>; @@ -154,7 +154,7 @@ rtc_timer: rtc_timer@600b0c00 { compatible = "espressif,esp32-rtc-timer"; - reg = <0x600B0C00 DT_SIZE_K(1)>; + reg = <0x600b0c00 DT_SIZE_K(1)>; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; interrupt-parent = <&intc>; @@ -163,7 +163,7 @@ trng0: trng@600b2808 { compatible = "espressif,esp32-trng"; - reg = <0x600B2808 0x4>; + reg = <0x600b2808 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; @@ -179,7 +179,7 @@ wdt1: watchdog@6000a048 { compatible = "espressif,esp32-watchdog"; - reg = <0x6000A048 0x20>; + reg = <0x6000a048 0x20>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_TIMG1_MODULE>; @@ -204,7 +204,7 @@ coretemp: coretemp@6000e058 { compatible = "espressif,esp32-temp"; friendly-name = "coretemp"; - reg = <0x6000E058 0x4>; + reg = <0x6000e058 0x4>; status = "disabled"; }; @@ -241,7 +241,7 @@ usb_serial: uart@6000f000 { compatible = "espressif,esp32-usb-serial"; - reg = <0x6000F000 DT_SIZE_K(4)>; + reg = <0x6000f000 DT_SIZE_K(4)>; status = "disabled"; interrupts = ; interrupt-parent = <&intc>; @@ -301,7 +301,7 @@ compatible = "espressif,esp32-i2s"; #address-cells = <1>; #size-cells = <0>; - reg = <0x6000D000 DT_SIZE_K(4)>; + reg = <0x6000d000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_I2S1_MODULE>; @@ -313,7 +313,7 @@ adc0: adc@6000e000 { compatible = "espressif,esp32-adc"; - reg = <0x6000E000 0x4>; + reg = <0x6000e000 0x4>; clocks = <&clock ESP32_SARADC_MODULE>; unit = <1>; channel-count = <5>; diff --git a/dts/riscv/gd/gd32vf103.dtsi b/dts/riscv/gd/gd32vf103.dtsi index 871531267d42..714a2020011d 100644 --- a/dts/riscv/gd/gd32vf103.dtsi +++ b/dts/riscv/gd/gd32vf103.dtsi @@ -229,7 +229,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002C00 0x400>; + reg = <0x40002c00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/riscv/ite/it81xx2.dtsi b/dts/riscv/ite/it81xx2.dtsi index 770e986e477e..11ebc0219ee6 100644 --- a/dts/riscv/ite/it81xx2.dtsi +++ b/dts/riscv/ite/it81xx2.dtsi @@ -66,7 +66,7 @@ func3-gcr = ; func3-en-mask = <0 0 0 0 - 0x02 0x02 0x10 0x0C>; + 0x02 0x02 0x10 0x0c>; func4-gcr = ; func4-en-mask = <0 0 0 0 diff --git a/dts/riscv/ite/it82xx2.dtsi b/dts/riscv/ite/it82xx2.dtsi index c9dcb5e97252..7f057bfbc020 100644 --- a/dts/riscv/ite/it82xx2.dtsi +++ b/dts/riscv/ite/it82xx2.dtsi @@ -452,7 +452,7 @@ func3-gcr = ; func3-en-mask = <0 0 0 0 - 0x02 0x02 0x10 0x0C>; + 0x02 0x02 0x10 0x0c>; func4-gcr = ; func4-en-mask = <0 0 0 0 @@ -656,7 +656,7 @@ pinctrlk: pinctrl@f016b0 { compatible = "ite,it8xxx2-pinctrl-func"; reg = <0x00f016b0 8 /* GPCR */ - 0x00f03e3A 1>; /* PDSCK */ + 0x00f03e3a 1>; /* PDSCK */ func3-gcr = ; func3-en-mask = <0 0 0 0 @@ -676,7 +676,7 @@ pinctrll: pinctrl@f016b8 { compatible = "ite,it8xxx2-pinctrl-func"; reg = <0x00f016b8 8 /* GPCR */ - 0x00f03e3B 1>; /* PDSCL */ + 0x00f03e3b 1>; /* PDSCL */ func3-gcr = ; func3-en-mask = <0 0 0 0 diff --git a/dts/riscv/microchip/mpfs.dtsi b/dts/riscv/microchip/mpfs.dtsi index 78c421168a0f..6bdcff412469 100644 --- a/dts/riscv/microchip/mpfs.dtsi +++ b/dts/riscv/microchip/mpfs.dtsi @@ -149,7 +149,7 @@ mbox: mailbox@37020000 { compatible = "microchip,mpfs-mailbox"; - reg = <0x37020000 0x58>, <0x2000318C 0x40>, + reg = <0x37020000 0x58>, <0x2000318c 0x40>, <0x37020800 0x100>; interrupt-parent = <&plic>; interrupts = <96 1>; diff --git a/dts/riscv/telink/telink_b91.dtsi b/dts/riscv/telink/telink_b91.dtsi index d572eace65b1..c9bd546a2e94 100644 --- a/dts/riscv/telink/telink_b91.dtsi +++ b/dts/riscv/telink/telink_b91.dtsi @@ -147,9 +147,9 @@ status = "disabled"; }; - uart1: serial@801400C0 { + uart1: serial@801400c0 { compatible = "telink,b91-uart"; - reg = <0x801400C0 0x40>; + reg = <0x801400c0 0x40>; interrupts = <18 1>; interrupt-parent = <&plic0>; status = "disabled"; @@ -177,9 +177,9 @@ #pwm-cells = <3>; }; - hspi: spi@81FFFFC0 { + hspi: spi@81ffffc0 { compatible = "telink,b91-spi"; - reg = <0x81FFFFC0 0x40>; + reg = <0x81ffffc0 0x40>; peripheral-id = "HSPI_MODULE"; cs0-pin = "0"; cs1-pin = "0"; @@ -221,7 +221,7 @@ compatible = "telink,b91-pinctrl"; reg = <0x80140330 0x28 0x80140306 0x28 - 0x0000000e 0x0C>; + 0x0000000e 0x0c>; reg-names = "pin_mux", "gpio_en", "pull_up_en"; diff --git a/dts/riscv/wch/ch32v0/ch32v006.dtsi b/dts/riscv/wch/ch32v0/ch32v006.dtsi index 7aa311886536..c6edacdb5b2b 100644 --- a/dts/riscv/wch/ch32v0/ch32v006.dtsi +++ b/dts/riscv/wch/ch32v0/ch32v006.dtsi @@ -102,9 +102,9 @@ clocks = <&rcc CH32V00X_CLOCK_IOPA>; }; - gpiob: gpio@40010C00 { + gpiob: gpio@40010c00 { compatible = "wch,gpio"; - reg = <0x40010C00 0x20>; + reg = <0x40010c00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <7>; diff --git a/dts/riscv/wch/ch32v203/ch32v203.dtsi b/dts/riscv/wch/ch32v203/ch32v203.dtsi index d8994503586c..32d334f0f3d5 100644 --- a/dts/riscv/wch/ch32v203/ch32v203.dtsi +++ b/dts/riscv/wch/ch32v203/ch32v203.dtsi @@ -80,9 +80,9 @@ clocks = <&rcc CH32V20X_V30X_CLOCK_IOPA>; }; - gpiob: gpio@40010C00 { + gpiob: gpio@40010c00 { compatible = "wch,gpio"; - reg = <0x40010C00 0x20>; + reg = <0x40010c00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <16>; diff --git a/dts/riscv/wch/ch32v203/ch32v203c8t.dtsi b/dts/riscv/wch/ch32v203/ch32v203c8t.dtsi index b0e3e57c5723..664273e81b0a 100644 --- a/dts/riscv/wch/ch32v203/ch32v203c8t.dtsi +++ b/dts/riscv/wch/ch32v203/ch32v203c8t.dtsi @@ -31,7 +31,7 @@ usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004C00 0x20>; + reg = <0x40004c00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/riscv/wch/ch32v203/ch32v203rbt.dtsi b/dts/riscv/wch/ch32v203/ch32v203rbt.dtsi index 465c5b1b88af..232545e15827 100644 --- a/dts/riscv/wch/ch32v203/ch32v203rbt.dtsi +++ b/dts/riscv/wch/ch32v203/ch32v203rbt.dtsi @@ -26,7 +26,7 @@ soc { usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004C00 0x20>; + reg = <0x40004c00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/riscv/wch/ch32v208/ch32v208.dtsi b/dts/riscv/wch/ch32v208/ch32v208.dtsi index 1595d6114d98..5e499a951518 100644 --- a/dts/riscv/wch/ch32v208/ch32v208.dtsi +++ b/dts/riscv/wch/ch32v208/ch32v208.dtsi @@ -102,9 +102,9 @@ clocks = <&rcc CH32V20X_V30X_CLOCK_IOPA>; }; - gpiob: gpio@40010C00 { + gpiob: gpio@40010c00 { compatible = "wch,gpio"; - reg = <0x40010C00 0x20>; + reg = <0x40010c00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <16>; @@ -159,7 +159,7 @@ usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004C00 0x20>; + reg = <0x40004c00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/riscv/wch/ch32v303/ch32v303.dtsi b/dts/riscv/wch/ch32v303/ch32v303.dtsi index 57542d433b11..fec38a4eece1 100644 --- a/dts/riscv/wch/ch32v303/ch32v303.dtsi +++ b/dts/riscv/wch/ch32v303/ch32v303.dtsi @@ -82,9 +82,9 @@ clocks = <&rcc CH32V20X_V30X_CLOCK_IOPA>; }; - gpiob: gpio@40010C00 { + gpiob: gpio@40010c00 { compatible = "wch,gpio"; - reg = <0x40010C00 0x20>; + reg = <0x40010c00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <16>; @@ -148,7 +148,7 @@ usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004C00 0x20>; + reg = <0x40004c00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/riscv/wch/ch32v307/ch32v307.dtsi b/dts/riscv/wch/ch32v307/ch32v307.dtsi index 31e8c8014179..c816231dc2f9 100644 --- a/dts/riscv/wch/ch32v307/ch32v307.dtsi +++ b/dts/riscv/wch/ch32v307/ch32v307.dtsi @@ -82,9 +82,9 @@ clocks = <&rcc CH32V20X_V30X_CLOCK_IOPA>; }; - gpiob: gpio@40010C00 { + gpiob: gpio@40010c00 { compatible = "wch,gpio"; - reg = <0x40010C00 0x20>; + reg = <0x40010c00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <8>; @@ -148,7 +148,7 @@ usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004C00 0x20>; + reg = <0x40004c00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/rx/renesas/r5f51308axfp.dtsi b/dts/rx/renesas/r5f51308axfp.dtsi index 12376d2391ce..15054c7e3438 100644 --- a/dts/rx/renesas/r5f51308axfp.dtsi +++ b/dts/rx/renesas/r5f51308axfp.dtsi @@ -62,7 +62,7 @@ pclkblock: pclkblock@80010 { compatible = "renesas,rx-cgc-pclk-block"; reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, - <0x0008001C 4>; + <0x0008001c 4>; reg-names = "MSTPA", "MSTPB", "MSTPC", "MSTPD"; #clock-cells = <0>; clocks = <&pll>; diff --git a/dts/rx/renesas/r5f52618bgfp.dtsi b/dts/rx/renesas/r5f52618bgfp.dtsi index c36fc4dce31c..4ee783bd7cff 100644 --- a/dts/rx/renesas/r5f52618bgfp.dtsi +++ b/dts/rx/renesas/r5f52618bgfp.dtsi @@ -75,7 +75,7 @@ reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, - <0x0008001C 4>; + <0x0008001c 4>; reg-names = "MSTPA", "MSTPB", "MSTPC", "MSTPD"; #clock-cells = <0>; clocks = <&pll>; diff --git a/dts/rx/renesas/r5f526tfddfp.dtsi b/dts/rx/renesas/r5f526tfddfp.dtsi index b07576b690b4..077ce0a3d7ef 100644 --- a/dts/rx/renesas/r5f526tfddfp.dtsi +++ b/dts/rx/renesas/r5f526tfddfp.dtsi @@ -61,7 +61,7 @@ pclkblock: pclkblock@80010 { compatible = "renesas,rx-cgc-pclk-block"; - reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, <0x0008001C 4>; + reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, <0x0008001c 4>; reg-names = "MSTPA", "MSTPB", "MSTPC", "MSTPD"; #clock-cells = <0>; clocks = <&pll>; diff --git a/dts/rx/renesas/rx-qemu.dtsi b/dts/rx/renesas/rx-qemu.dtsi index 27ef92faf950..da5af2cc96a5 100644 --- a/dts/rx/renesas/rx-qemu.dtsi +++ b/dts/rx/renesas/rx-qemu.dtsi @@ -111,7 +111,7 @@ pclkblock: pclkblock@80010 { compatible = "renesas,rx-cgc-pclk-block"; reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, - <0x0008001C 4>; + <0x0008001c 4>; reg-names = "MSTPA", "MSTPB", "MSTPC", "MSTPD"; #clock-cells = <0>; clocks = <&pll>; @@ -209,8 +209,8 @@ cmt1: timer@88008 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088008 0x02>, - <0x0008800A 0x02>, - <0x0008800C 0x02>; + <0x0008800a 0x02>, + <0x0008800c 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <29 1>; interrupt-names = "cmi"; diff --git a/dts/rx/renesas/rx130-common.dtsi b/dts/rx/renesas/rx130-common.dtsi index ddb5f68e9ad7..92e0f45e2643 100644 --- a/dts/rx/renesas/rx130-common.dtsi +++ b/dts/rx/renesas/rx130-common.dtsi @@ -89,7 +89,7 @@ pinctrl: pin-controller@8c11f { compatible = "renesas,rx-pinctrl"; - reg = <0x0008C11F 0x3c0>; + reg = <0x0008c11f 0x3c0>; status = "okay"; }; @@ -270,11 +270,11 @@ #gpio-cells = <0x02>; ngpios = <8>; port = <0>; - reg = <0x0008C000 0x01>, - <0x0008C020 0x01>, - <0x0008C040 0x01>, - <0x0008C060 0x01>, - <0x0008C0C0 0x01>; + reg = <0x0008c000 0x01>, + <0x0008c020 0x01>, + <0x0008c040 0x01>, + <0x0008c060 0x01>, + <0x0008c0c0 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmux0>; status = "disabled"; @@ -286,14 +286,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <1>; - reg = <0x0008C001 0x01>, - <0x0008C021 0x01>, - <0x0008C041 0x01>, - <0x0008C061 0x01>, - <0x0008C082 0x01>, - <0x0008C083 0x01>, - <0x0008C0C1 0x01>, - <0x0008C0E1 0x01>; + reg = <0x0008c001 0x01>, + <0x0008c021 0x01>, + <0x0008c041 0x01>, + <0x0008c061 0x01>, + <0x0008c082 0x01>, + <0x0008c083 0x01>, + <0x0008c0c1 0x01>, + <0x0008c0e1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux1>; port-irqs = <&port_irq2 &port_irq3 &port_irq4 @@ -319,14 +319,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <2>; - reg = <0x0008C002 0x01>, - <0x0008C022 0x01>, - <0x0008C042 0x01>, - <0x0008C062 0x01>, - <0x0008C084 0x01>, - <0x0008C085 0x01>, - <0x0008C0C2 0x01>, - <0x0008C0E2 0x01>; + reg = <0x0008c002 0x01>, + <0x0008c022 0x01>, + <0x0008c042 0x01>, + <0x0008c062 0x01>, + <0x0008c084 0x01>, + <0x0008c085 0x01>, + <0x0008c0c2 0x01>, + <0x0008c0e2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux2>; status = "disabled"; @@ -338,14 +338,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <3>; - reg = <0x0008C003 0x01>, - <0x0008C023 0x01>, - <0x0008C043 0x01>, - <0x0008C063 0x01>, - <0x0008C086 0x01>, - <0x0008C087 0x01>, - <0x0008C0C3 0x01>, - <0x0008C0E3 0x01>; + reg = <0x0008c003 0x01>, + <0x0008c023 0x01>, + <0x0008c043 0x01>, + <0x0008c063 0x01>, + <0x0008c086 0x01>, + <0x0008c087 0x01>, + <0x0008c0c3 0x01>, + <0x0008c0e3 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux3>; port-irqs = <&port_irq0 &port_irq1 &port_irq2 &port_irq3 &port_irq4>; @@ -368,11 +368,11 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <4>; - reg = <0x0008C004 0x01>, - <0x0008C024 0x01>, - <0x0008C044 0x01>, - <0x0008C064 0x01>, - <0x0008C0C4 0x01>; + reg = <0x0008c004 0x01>, + <0x0008c024 0x01>, + <0x0008c044 0x01>, + <0x0008c064 0x01>, + <0x0008c0c4 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmux4>; status = "disabled"; @@ -384,12 +384,12 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <5>; - reg = <0x0008C005 0x01>, - <0x0008C025 0x01>, - <0x0008C045 0x01>, - <0x0008C065 0x01>, - <0x0008C0C5 0x01>, - <0x0008C0E5 0x01>; + reg = <0x0008c005 0x01>, + <0x0008c025 0x01>, + <0x0008c045 0x01>, + <0x0008c065 0x01>, + <0x0008c0c5 0x01>, + <0x0008c0e5 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR", "DSCR"; pinmux = <&pinmux5>; status = "disabled"; @@ -401,14 +401,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <10>; - reg = <0x0008C00A 0x01>, - <0x0008C02A 0x01>, - <0x0008C04A 0x01>, - <0x0008C06A 0x01>, - <0x0008C094 0x01>, - <0x0008C095 0x01>, - <0x0008C0CA 0x01>, - <0x0008C0EA 0x01>; + reg = <0x0008c00a 0x01>, + <0x0008c02a 0x01>, + <0x0008c04a 0x01>, + <0x0008c06a 0x01>, + <0x0008c094 0x01>, + <0x0008c095 0x01>, + <0x0008c0ca 0x01>, + <0x0008c0ea 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxa>; port-irqs = <&port_irq5 &port_irq6>; @@ -425,14 +425,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <11>; - reg = <0x0008C00B 0x01>, - <0x0008C02B 0x01>, - <0x0008C04B 0x01>, - <0x0008C06B 0x01>, - <0x0008C096 0x01>, - <0x0008C097 0x01>, - <0x0008C0CB 0x01>, - <0x0008C0EB 0x01>; + reg = <0x0008c00b 0x01>, + <0x0008c02b 0x01>, + <0x0008c04b 0x01>, + <0x0008c06b 0x01>, + <0x0008c096 0x01>, + <0x0008c097 0x01>, + <0x0008c0cb 0x01>, + <0x0008c0eb 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxb>; port-irqs = <&port_irq4>; @@ -447,14 +447,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <12>; - reg = <0x0008C00C 0x01>, - <0x0008C02C 0x01>, - <0x0008C04C 0x01>, - <0x0008C06C 0x01>, - <0x0008C098 0x01>, - <0x0008C099 0x01>, - <0x0008C0CC 0x01>, - <0x0008C0EC 0x01>; + reg = <0x0008c00c 0x01>, + <0x0008c02c 0x01>, + <0x0008c04c 0x01>, + <0x0008c06c 0x01>, + <0x0008c098 0x01>, + <0x0008c099 0x01>, + <0x0008c0cc 0x01>, + <0x0008c0ec 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxc>; status = "disabled"; @@ -466,13 +466,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <13>; - reg = <0x0008C00D 0x01>, - <0x0008C02D 0x01>, - <0x0008C04D 0x01>, - <0x0008C06D 0x01>, - <0x0008C09A 0x01>, - <0x0008C0CD 0x01>, - <0x0008C0ED 0x01>; + reg = <0x0008c00d 0x01>, + <0x0008c02d 0x01>, + <0x0008c04d 0x01>, + <0x0008c06d 0x01>, + <0x0008c09a 0x01>, + <0x0008c0cd 0x01>, + <0x0008c0ed 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmuxd>; port-irqs = <&port_irq0 &port_irq1 &port_irq2 @@ -503,13 +503,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <14>; - reg = <0x0008C00E 0x01>, - <0x0008C02E 0x01>, - <0x0008C04E 0x01>, - <0x0008C06E 0x01>, - <0x0008C09C 0x01>, - <0x0008C0CE 0x01>, - <0x0008C0EE 0x01>; + reg = <0x0008c00e 0x01>, + <0x0008c02e 0x01>, + <0x0008c04e 0x01>, + <0x0008c06e 0x01>, + <0x0008c09c 0x01>, + <0x0008c0ce 0x01>, + <0x0008c0ee 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmuxe>; port-irqs = <&port_irq5 &port_irq6 &port_irq7>; @@ -528,12 +528,12 @@ #gpio-cells = <2>; ngpios = <8>; port = <17>; - reg = <0x0008C011 0x01>, - <0x0008C031 0x01>, - <0x0008C051 0x01>, - <0x0008C071 0x01>, - <0x0008C0D1 0x01>, - <0x0008C0F1 0x01>; + reg = <0x0008c011 0x01>, + <0x0008c031 0x01>, + <0x0008c051 0x01>, + <0x0008c071 0x01>, + <0x0008c0d1 0x01>, + <0x0008c0f1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR", "DSCR"; pinmux = <&pinmuxh>; port-irqs = <&port_irq0 &port_irq1>; @@ -550,13 +550,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <18>; - reg = <0x0008C012 0x01>, - <0x0008C032 0x01>, - <0x0008C052 0x01>, - <0x0008C072 0x01>, - <0x0008C0A4 0x01>, - <0x0008C0D2 0x01>, - <0x0008C0F2 0x01>; + reg = <0x0008c012 0x01>, + <0x0008c032 0x01>, + <0x0008c052 0x01>, + <0x0008c072 0x01>, + <0x0008c0a4 0x01>, + <0x0008c0d2 0x01>, + <0x0008c0f2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmuxj>; status = "disabled"; @@ -566,7 +566,7 @@ compatible = "renesas,rx-sci"; interrupts = <215 1>, <216 1>, <217 1>, <214 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A000 0x20>; + reg = <0x8a000 0x20>; clocks = <&pclkb MSTPB 31>; channel = <0>; dtc = <&dtc>; @@ -582,7 +582,7 @@ compatible = "renesas,rx-sci"; interrupts = <219 1>, <220 1>, <221 1>, <218 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A020 0x20>; + reg = <0x8a020 0x20>; clocks = <&pclkb MSTPB 30>; channel = <1>; dtc = <&dtc>; @@ -598,7 +598,7 @@ compatible = "renesas,rx-sci"; interrupts = <223 1>, <224 1>, <225 1>, <222 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A0A0 0x20>; + reg = <0x8a0a0 0x20>; clocks = <&pclkb MSTPB 26>; channel = <5>; dtc = <&dtc>; @@ -614,7 +614,7 @@ compatible = "renesas,rx-sci"; interrupts = <227 1>, <228 1>, <229 1>, <226 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A0C0 0x20>; + reg = <0x8a0c0 0x20>; clocks = <&pclkb MSTPB 25>; channel = <6>; dtc = <&dtc>; @@ -630,7 +630,7 @@ compatible = "renesas,rx-sci"; interrupts = <231 1>, <232 1>, <233 1>, <230 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A100 0x20>; + reg = <0x8a100 0x20>; clocks = <&pclkb MSTPC 27>; channel = <8>; dtc = <&dtc>; @@ -785,7 +785,7 @@ compatible = "renesas,rx-sci"; interrupts = <235 1>, <236 1>, <237 1>, <234 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A120 0x20>; + reg = <0x8a120 0x20>; clocks = <&pclkb MSTPC 26>; status = "disabled"; channel = <9>; @@ -832,8 +832,8 @@ cmt1: timer@88008 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088008 0x02>, - <0x0008800A 0x02>, - <0x0008800C 0x02>; + <0x0008800a 0x02>, + <0x0008800c 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <29 1>; interrupt-names = "cmi"; @@ -867,7 +867,7 @@ ctsu: ctsu@a0900 { compatible = "renesas,rx-ctsu"; - reg = <0x000A0900 0x100>; + reg = <0x000a0900 0x100>; clocks = <&pclkb MSTPD 10>; interrupts = <60 1>, <61 1>, <62 1>; interrupt-names = "ctsuwr", "ctsurd", "ctsufn"; @@ -876,7 +876,7 @@ lvd0: lvd@800e0 { compatible = "renesas,rx-lvd"; - reg = <0x000800E0 0x02>; + reg = <0x000800e0 0x02>; channel = <0>; interrupts = <88 1>; interrupt-names = "lvd"; @@ -885,7 +885,7 @@ lvd1: lvd@800e2 { compatible = "renesas,rx-lvd"; - reg = <0x000800E2 0x02>; + reg = <0x000800e2 0x02>; channel = <1>; interrupts = <89 1>; interrupt-names = "lvd"; @@ -895,7 +895,7 @@ ofsm: ofsm@ffffff80 { compatible = "zephyr,memory-region"; - reg = <0xFFFFFF80 0x0F>; + reg = <0xffffff80 0x0f>; zephyr,memory-region = "OFSM"; status = "okay"; }; diff --git a/dts/rx/renesas/rx261-common.dtsi b/dts/rx/renesas/rx261-common.dtsi index e7e95e019d46..edfd3e3e1122 100644 --- a/dts/rx/renesas/rx261-common.dtsi +++ b/dts/rx/renesas/rx261-common.dtsi @@ -72,7 +72,7 @@ pinctrl: pin-controller@8c11f { compatible = "renesas,rx-pinctrl"; - reg = <0x0008C11F 0xb8>; + reg = <0x0008c11f 0xb8>; status = "okay"; }; @@ -253,11 +253,11 @@ #gpio-cells = <2>; ngpios = <5>; port = <0>; - reg = <0x0008C000 0x01>, - <0x0008C020 0x01>, - <0x0008C040 0x01>, - <0x0008C060 0x01>, - <0x0008C0C0 0x01>; + reg = <0x0008c000 0x01>, + <0x0008c020 0x01>, + <0x0008c040 0x01>, + <0x0008c060 0x01>, + <0x0008c0c0 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmux0>; status = "disabled"; @@ -269,13 +269,13 @@ #gpio-cells = <2>; ngpios = <8>; port = <1>; - reg = <0x0008C001 0x01>, - <0x0008C021 0x01>, - <0x0008C041 0x01>, - <0x0008C061 0x01>, - <0x0008C082 0x01>, - <0x0008C083 0x01>, - <0x0008C0C1 0x01>; + reg = <0x0008c001 0x01>, + <0x0008c021 0x01>, + <0x0008c041 0x01>, + <0x0008c061 0x01>, + <0x0008c082 0x01>, + <0x0008c083 0x01>, + <0x0008c0c1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux1>; port-irqs = <&port_irq2 &port_irq3 &port_irq4 @@ -301,13 +301,13 @@ #gpio-cells = <2>; ngpios = <8>; port = <2>; - reg = <0x0008C002 0x01>, - <0x0008C022 0x01>, - <0x0008C042 0x01>, - <0x0008C062 0x01>, - <0x0008C084 0x01>, - <0x0008C085 0x01>, - <0x0008C0C2 0x01>; + reg = <0x0008c002 0x01>, + <0x0008c022 0x01>, + <0x0008c042 0x01>, + <0x0008c062 0x01>, + <0x0008c084 0x01>, + <0x0008c085 0x01>, + <0x0008c0c2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux2>; status = "disabled"; @@ -319,13 +319,13 @@ #gpio-cells = <2>; ngpios = <8>; port = <3>; - reg = <0x0008C003 0x01>, - <0x0008C023 0x01>, - <0x0008C043 0x01>, - <0x0008C063 0x01>, - <0x0008C086 0x01>, - <0x0008C087 0x01>, - <0x0008C0C3 0x01>; + reg = <0x0008c003 0x01>, + <0x0008c023 0x01>, + <0x0008c043 0x01>, + <0x0008c063 0x01>, + <0x0008c086 0x01>, + <0x0008c087 0x01>, + <0x0008c0c3 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux3>; port-irqs = <&port_irq0 &port_irq1 &port_irq2 &port_irq3 &port_irq4>; @@ -348,11 +348,11 @@ #gpio-cells = <2>; ngpios = <8>; port = <4>; - reg = <0x0008C004 0x01>, - <0x0008C024 0x01>, - <0x0008C044 0x01>, - <0x0008C064 0x01>, - <0x0008C0C4 0x01>; + reg = <0x0008c004 0x01>, + <0x0008c024 0x01>, + <0x0008c044 0x01>, + <0x0008c064 0x01>, + <0x0008c0c4 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmux4>; status = "disabled"; @@ -364,13 +364,13 @@ #gpio-cells = <2>; ngpios = <8>; port = <5>; - reg = <0x0008C005 0x01>, - <0x0008C025 0x01>, - <0x0008C045 0x01>, - <0x0008C065 0x01>, - <0x0008C08A 0x01>, - <0x0008C08B 0x01>, - <0x0008C0C5 0x01>; + reg = <0x0008c005 0x01>, + <0x0008c025 0x01>, + <0x0008c045 0x01>, + <0x0008c065 0x01>, + <0x0008c08a 0x01>, + <0x0008c08b 0x01>, + <0x0008c0c5 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux5>; status = "disabled"; @@ -382,13 +382,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <10>; - reg = <0x0008C00A 0x01>, - <0x0008C02A 0x01>, - <0x0008C04A 0x01>, - <0x0008C06A 0x01>, - <0x0008C094 0x01>, - <0x0008C095 0x01>, - <0x0008C0CA 0x01>; + reg = <0x0008c00a 0x01>, + <0x0008c02a 0x01>, + <0x0008c04a 0x01>, + <0x0008c06a 0x01>, + <0x0008c094 0x01>, + <0x0008c095 0x01>, + <0x0008c0ca 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmuxa>; port-irqs = <&port_irq5 &port_irq6>; @@ -405,13 +405,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <11>; - reg = <0x0008C00B 0x01>, - <0x0008C02B 0x01>, - <0x0008C04B 0x01>, - <0x0008C06B 0x01>, - <0x0008C096 0x01>, - <0x0008C097 0x01>, - <0x0008C0CB 0x01>; + reg = <0x0008c00b 0x01>, + <0x0008c02b 0x01>, + <0x0008c04b 0x01>, + <0x0008c06b 0x01>, + <0x0008c096 0x01>, + <0x0008c097 0x01>, + <0x0008c0cb 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmuxb>; port-irqs = <&port_irq4>; @@ -426,13 +426,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <12>; - reg = <0x0008C00C 0x01>, - <0x0008C02C 0x01>, - <0x0008C04C 0x01>, - <0x0008C06C 0x01>, - <0x0008C098 0x01>, - <0x0008C099 0x01>, - <0x0008C0CC 0x01>; + reg = <0x0008c00c 0x01>, + <0x0008c02c 0x01>, + <0x0008c04c 0x01>, + <0x0008c06c 0x01>, + <0x0008c098 0x01>, + <0x0008c099 0x01>, + <0x0008c0cc 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmuxc>; status = "disabled"; @@ -444,12 +444,12 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <13>; - reg = <0x0008C00D 0x01>, - <0x0008C02D 0x01>, - <0x0008C04D 0x01>, - <0x0008C06D 0x01>, - <0x0008C09A 0x01>, - <0x0008C0CD 0x01>; + reg = <0x0008c00d 0x01>, + <0x0008c02d 0x01>, + <0x0008c04d 0x01>, + <0x0008c06d 0x01>, + <0x0008c09a 0x01>, + <0x0008c0cd 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR"; pinmux = <&pinmuxd>; port-irqs = <&port_irq0 &port_irq1 &port_irq2 @@ -480,12 +480,12 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <14>; - reg = <0x0008C00E 0x01>, - <0x0008C02E 0x01>, - <0x0008C04E 0x01>, - <0x0008C06E 0x01>, - <0x0008C09C 0x01>, - <0x0008C0CE 0x01>; + reg = <0x0008c00e 0x01>, + <0x0008c02e 0x01>, + <0x0008c04e 0x01>, + <0x0008c06e 0x01>, + <0x0008c09c 0x01>, + <0x0008c0ce 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR"; pinmux = <&pinmuxe>; port-irqs = <&port_irq5 &port_irq6 &port_irq7>; @@ -504,11 +504,11 @@ #gpio-cells = <2>; ngpios = <8>; port = <17>; - reg = <0x0008C011 0x01>, - <0x0008C031 0x01>, - <0x0008C051 0x01>, - <0x0008C071 0x01>, - <0x0008C0D1 0x01>; + reg = <0x0008c011 0x01>, + <0x0008c031 0x01>, + <0x0008c051 0x01>, + <0x0008c071 0x01>, + <0x0008c0d1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmuxh>; port-irqs = <&port_irq0 &port_irq1>; @@ -525,11 +525,11 @@ #gpio-cells = <2>; ngpios = <8>; port = <18>; - reg = <0x0008C012 0x01>, - <0x0008C032 0x01>, - <0x0008C052 0x01>, - <0x0008C072 0x01>, - <0x0008C0D2 0x01>; + reg = <0x0008c012 0x01>, + <0x0008c032 0x01>, + <0x0008c052 0x01>, + <0x0008c072 0x01>, + <0x0008c0d2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmuxj>; status = "disabled"; @@ -539,7 +539,7 @@ compatible = "renesas,rx-sci"; interrupts = <219 1>, <220 1>, <221 1>, <218 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A020 0x20>; + reg = <0x8a020 0x20>; clocks = <&pclkb MSTPB 30>; dtc = <&dtc>; channel = <1>; @@ -555,7 +555,7 @@ compatible = "renesas,rx-sci"; interrupts = <223 1>, <224 1>, <225 1>, <222 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A0A0 0x20>; + reg = <0x8a0a0 0x20>; clocks = <&pclkb MSTPB 26>; dtc = <&dtc>; channel = <5>; @@ -571,7 +571,7 @@ compatible = "renesas,rx-sci"; interrupts = <227 1>, <228 1>, <229 1>, <226 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8A0C0 0x20>; + reg = <0x8a0c0 0x20>; clocks = <&pclkb MSTPB 25>; dtc = <&dtc>; channel = <6>; @@ -587,7 +587,7 @@ compatible = "renesas,rx-sci"; interrupts = <239 1>, <240 1>, <241 1>, <238 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8B300 0x20>; + reg = <0x8b300 0x20>; clocks = <&pclkb MSTPB 4>; dtc = <&dtc>; channel = <12>; @@ -636,8 +636,8 @@ cmt1: timer@88008 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088008 0x02>, - <0x0008800A 0x02>, - <0x0008800C 0x02>; + <0x0008800a 0x02>, + <0x0008800c 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <29 1>; interrupt-names = "cmi"; @@ -658,8 +658,8 @@ cmt3: timer@88018 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088018 0x02>, - <0x0008801A 0x02>, - <0x0008801C 0x02>; + <0x0008801a 0x02>, + <0x0008801c 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <31 1>; interrupt-names = "cmi"; @@ -693,7 +693,7 @@ ofsm: ofsm@ffffff80 { compatible = "zephyr,memory-region"; - reg = <0xFFFFFF80 0x0F>; + reg = <0xffffff80 0x0f>; zephyr,memory-region = "OFSM"; status = "okay"; }; diff --git a/dts/rx/renesas/rx26t-common.dtsi b/dts/rx/renesas/rx26t-common.dtsi index 3bd3118a7ccc..459e93001dda 100644 --- a/dts/rx/renesas/rx26t-common.dtsi +++ b/dts/rx/renesas/rx26t-common.dtsi @@ -65,7 +65,7 @@ pinctrl: pin-controller@8c11f { compatible = "renesas,rx-pinctrl"; - reg = <0x0008C11F 0x3c0>; + reg = <0x0008c11f 0x3c0>; status = "okay"; }; @@ -180,13 +180,13 @@ #gpio-cells = <0x02>; ngpios = <2>; port = <0>; - reg = <0x0008C000 0x01>, - <0x0008C020 0x01>, - <0x0008C040 0x01>, - <0x0008C060 0x01>, - <0x0008C080 0x01>, - <0x0008C0C0 0x01>, - <0x0008C0E0 0x01>; + reg = <0x0008c000 0x01>, + <0x0008c020 0x01>, + <0x0008c040 0x01>, + <0x0008c060 0x01>, + <0x0008c080 0x01>, + <0x0008c0c0 0x01>, + <0x0008c0e0 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmux0>; status = "disabled"; @@ -198,13 +198,13 @@ #gpio-cells = <0x2>; ngpios = <2>; port = <1>; - reg = <0x0008C001 0x01>, - <0x0008C021 0x01>, - <0x0008C041 0x01>, - <0x0008C061 0x01>, - <0x0008C082 0x01>, - <0x0008C0C1 0x01>, - <0x0008C0E1 0x01>; + reg = <0x0008c001 0x01>, + <0x0008c021 0x01>, + <0x0008c041 0x01>, + <0x0008c061 0x01>, + <0x0008c082 0x01>, + <0x0008c0c1 0x01>, + <0x0008c0e1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmux1>; status = "disabled"; @@ -216,14 +216,14 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <2>; - reg = <0x0008C002 0x01>, - <0x0008C022 0x01>, - <0x0008C042 0x01>, - <0x0008C062 0x01>, - <0x0008C084 0x01>, - <0x0008C085 0x01>, - <0x0008C0C2 0x01>, - <0x0008C0E2 0x01>; + reg = <0x0008c002 0x01>, + <0x0008c022 0x01>, + <0x0008c042 0x01>, + <0x0008c062 0x01>, + <0x0008c084 0x01>, + <0x0008c085 0x01>, + <0x0008c0c2 0x01>, + <0x0008c0e2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux2>; status = "disabled"; @@ -235,14 +235,14 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <3>; - reg = <0x0008C003 0x01>, - <0x0008C023 0x01>, - <0x0008C043 0x01>, - <0x0008C063 0x01>, - <0x0008C086 0x01>, - <0x0008C087 0x01>, - <0x0008C0C3 0x01>, - <0x0008C0E3 0x01>; + reg = <0x0008c003 0x01>, + <0x0008c023 0x01>, + <0x0008c043 0x01>, + <0x0008c063 0x01>, + <0x0008c086 0x01>, + <0x0008c087 0x01>, + <0x0008c0c3 0x01>, + <0x0008c0e3 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux3>; status = "disabled"; @@ -254,13 +254,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <4>; - reg = <0x0008C004 0x01>, - <0x0008C024 0x01>, - <0x0008C044 0x01>, - <0x0008C064 0x01>, - <0x0008C088 0x01>, - <0x0008C089 0x01>, - <0x0008C0C4 0x01>; + reg = <0x0008c004 0x01>, + <0x0008c024 0x01>, + <0x0008c044 0x01>, + <0x0008c064 0x01>, + <0x0008c088 0x01>, + <0x0008c089 0x01>, + <0x0008c0c4 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux4>; status = "disabled"; @@ -272,13 +272,13 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <5>; - reg = <0x0008C005 0x01>, - <0x0008C025 0x01>, - <0x0008C045 0x01>, - <0x0008C065 0x01>, - <0x0008C08A 0x01>, - <0x0008C08B 0x01>, - <0x0008C0C5 0x01>; + reg = <0x0008c005 0x01>, + <0x0008c025 0x01>, + <0x0008c045 0x01>, + <0x0008c065 0x01>, + <0x0008c08a 0x01>, + <0x0008c08b 0x01>, + <0x0008c0c5 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux5>; status = "disabled"; @@ -290,13 +290,13 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <6>; - reg = <0x0008C006 0x01>, - <0x0008C026 0x01>, - <0x0008C046 0x01>, - <0x0008C066 0x01>, - <0x0008C08C 0x01>, - <0x0008C08D 0x01>, - <0x0008C0C6 0x01>; + reg = <0x0008c006 0x01>, + <0x0008c026 0x01>, + <0x0008c046 0x01>, + <0x0008c066 0x01>, + <0x0008c08c 0x01>, + <0x0008c08d 0x01>, + <0x0008c0c6 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux5>; status = "disabled"; @@ -308,15 +308,15 @@ #gpio-cells = <0x2>; ngpios = <7>; port = <7>; - reg = <0x0008C007 0x01>, - <0x0008C027 0x01>, - <0x0008C047 0x01>, - <0x0008C067 0x01>, - <0x0008C08E 0x01>, - <0x0008C08F 0x01>, - <0x0008C0C7 0x01>, - <0x0008C0E7 0x01>, - <0x0008C12F 0x01>; + reg = <0x0008c007 0x01>, + <0x0008c027 0x01>, + <0x0008c047 0x01>, + <0x0008c067 0x01>, + <0x0008c08e 0x01>, + <0x0008c08f 0x01>, + <0x0008c0c7 0x01>, + <0x0008c0e7 0x01>, + <0x0008c12f 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmux7>; @@ -329,14 +329,14 @@ #gpio-cells = <0x2>; ngpios = <3>; port = <8>; - reg = <0x0008C008 0x01>, - <0x0008C028 0x01>, - <0x0008C048 0x01>, - <0x0008C068 0x01>, - <0x0008C090 0x01>, - <0x0008C0C8 0x01>, - <0x0008C0E8 0x01>, - <0x0008C130 0x01>; + reg = <0x0008c008 0x01>, + <0x0008c028 0x01>, + <0x0008c048 0x01>, + <0x0008c068 0x01>, + <0x0008c090 0x01>, + <0x0008c0c8 0x01>, + <0x0008c0e8 0x01>, + <0x0008c130 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmux8>; @@ -349,15 +349,15 @@ #gpio-cells = <0x2>; ngpios = <7>; port = <9>; - reg = <0x0008C009 0x01>, - <0x0008C029 0x01>, - <0x0008C049 0x01>, - <0x0008C069 0x01>, - <0x0008C092 0x01>, - <0x0008C093 0x01>, - <0x0008C0C9 0x01>, - <0x0008C0E9 0x01>, - <0x0008C131 0x01>; + reg = <0x0008c009 0x01>, + <0x0008c029 0x01>, + <0x0008c049 0x01>, + <0x0008c069 0x01>, + <0x0008c092 0x01>, + <0x0008c093 0x01>, + <0x0008c0c9 0x01>, + <0x0008c0e9 0x01>, + <0x0008c131 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmux9>; @@ -370,14 +370,14 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <10>; - reg = <0x0008C00A 0x01>, - <0x0008C02A 0x01>, - <0x0008C04A 0x01>, - <0x0008C06A 0x01>, - <0x0008C094 0x01>, - <0x0008C095 0x01>, - <0x0008C0CA 0x01>, - <0x0008C0EA 0x01>; + reg = <0x0008c00a 0x01>, + <0x0008c02a 0x01>, + <0x0008c04a 0x01>, + <0x0008c06a 0x01>, + <0x0008c094 0x01>, + <0x0008c095 0x01>, + <0x0008c0ca 0x01>, + <0x0008c0ea 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxa>; @@ -390,15 +390,15 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <11>; - reg = <0x0008C00B 0x01>, - <0x0008C02B 0x01>, - <0x0008C04B 0x01>, - <0x0008C06B 0x01>, - <0x0008C096 0x01>, - <0x0008C097 0x01>, - <0x0008C0CB 0x01>, - <0x0008C0EB 0x01>, - <0x0008C133 0x01>; + reg = <0x0008c00b 0x01>, + <0x0008c02b 0x01>, + <0x0008c04b 0x01>, + <0x0008c06b 0x01>, + <0x0008c096 0x01>, + <0x0008c097 0x01>, + <0x0008c0cb 0x01>, + <0x0008c0eb 0x01>, + <0x0008c133 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmuxb>; @@ -411,15 +411,15 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <13>; - reg = <0x0008C00D 0x01>, - <0x0008C02D 0x01>, - <0x0008C04D 0x01>, - <0x0008C06D 0x01>, - <0x0008C09A 0x01>, - <0x0008C09B 0x01>, - <0x0008C0CD 0x01>, - <0x0008C0ED 0x01>, - <0x0008C135 0x01>; + reg = <0x0008c00d 0x01>, + <0x0008c02d 0x01>, + <0x0008c04d 0x01>, + <0x0008c06d 0x01>, + <0x0008c09a 0x01>, + <0x0008c09b 0x01>, + <0x0008c0cd 0x01>, + <0x0008c0ed 0x01>, + <0x0008c135 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmuxd>; @@ -432,14 +432,14 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <14>; - reg = <0x0008C00E 0x01>, - <0x0008C02E 0x01>, - <0x0008C04E 0x01>, - <0x0008C06E 0x01>, - <0x0008C09C 0x01>, - <0x0008C09D 0x01>, - <0x0008C0CE 0x01>, - <0x0008C0EE 0x01>; + reg = <0x0008c00e 0x01>, + <0x0008c02e 0x01>, + <0x0008c04e 0x01>, + <0x0008c06e 0x01>, + <0x0008c09c 0x01>, + <0x0008c09d 0x01>, + <0x0008c0ce 0x01>, + <0x0008c0ee 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxe>; status = "disabled"; @@ -451,13 +451,13 @@ #gpio-cells = <0x2>; ngpios = <2>; port = <23>; - reg = <0x0008C016 0x01>, - <0x0008C036 0x01>, - <0x0008C056 0x01>, - <0x0008C076 0x01>, - <0x0008C0D6 0x01>, - <0x0008C0F6 0x01>, - <0x0008C0AD 0x01>; + reg = <0x0008c016 0x01>, + <0x0008c036 0x01>, + <0x0008c056 0x01>, + <0x0008c076 0x01>, + <0x0008c0d6 0x01>, + <0x0008c0f6 0x01>, + <0x0008c0ad 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR", "DSCR", "ODR1"; pinmux = <&pinmuxn>; status = "disabled"; @@ -467,7 +467,7 @@ compatible = "renesas,rx-sci"; interrupts = <60 1>, <61 1>; interrupt-names = "rxi", "txi"; - reg = <0x8A020 0x20>; + reg = <0x8a020 0x20>; clocks = <&pclkb MSTPB 30>; status = "disabled"; channel = <1>; @@ -482,7 +482,7 @@ compatible = "renesas,rx-sci"; interrupts = <84 1>, <85 1>; interrupt-names = "rxi", "txi"; - reg = <0x8A0A0 0x20>; + reg = <0x8a0a0 0x20>; clocks = <&pclkb MSTPB 26>; status = "disabled"; channel = <5>; @@ -497,7 +497,7 @@ compatible = "renesas,rx-sci"; interrupts = <86 1>, <87 1>; interrupt-names = "rxi", "txi"; - reg = <0x8A0C0 0x20>; + reg = <0x8a0c0 0x20>; clocks = <&pclkb MSTPB 25>; status = "disabled"; channel = <6>; @@ -512,7 +512,7 @@ compatible = "renesas,rx-sci"; interrupts = <116 1>, <117 1>; interrupt-names = "rxi", "txi"; - reg = <0x8B300 0x20>; + reg = <0x8b300 0x20>; clocks = <&pclkb MSTPB 4>; status = "disabled"; channel = <12>; @@ -548,8 +548,8 @@ cmt1: timer@88008 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088008 0x02>, - <0x0008800A 0x02>, - <0x0008800C 0x02>; + <0x0008800a 0x02>, + <0x0008800c 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <29 1>; interrupt-names = "cmi"; @@ -559,7 +559,7 @@ ofsm: ofsm@120040 { compatible = "zephyr,memory-region"; - reg = <0x00120040 0xBF>; + reg = <0x00120040 0xbf>; zephyr,memory-region = "OFSM"; status = "okay"; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_128M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_128M.dtsi index 2e90bd55286c..e536f10d5967 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_128M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_128M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@2ff0000 { label = "image-1"; - reg = <0x2FF0000 DT_SIZE_K(48960)>; + reg = <0x2ff0000 DT_SIZE_K(48960)>; }; slot0_appcpu_partition: partition@5fc0000 { label = "image-0-appcpu"; - reg = <0x5FC0000 DT_SIZE_K(16320)>; + reg = <0x5fc0000 DT_SIZE_K(16320)>; }; slot1_appcpu_partition: partition@6fb0000 { label = "image-1-appcpu"; - reg = <0x6FB0000 DT_SIZE_K(16320)>; + reg = <0x6fb0000 DT_SIZE_K(16320)>; }; slot0_lpcore_partition: partition@7fa0000 { label = "image-0-lpcore"; - reg = <0x7FA0000 DT_SIZE_K(32)>; + reg = <0x7fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7fa8000 { label = "image-1-lpcore"; - reg = <0x7FA8000 DT_SIZE_K(32)>; + reg = <0x7fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@7fb0000 { label = "storage"; - reg = <0x7FB0000 DT_SIZE_K(192)>; + reg = <0x7fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7fe0000 { label = "image-scratch"; - reg = <0x7FE0000 DT_SIZE_K(124)>; + reg = <0x7fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7fff000 { label = "coredump"; - reg = <0x7FFF000 DT_SIZE_K(4)>; + reg = <0x7fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_16M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_16M.dtsi index e47801b34151..5fbec8596ffb 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_16M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_16M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@5f0000 { label = "image-1"; - reg = <0x5F0000 DT_SIZE_K(5952)>; + reg = <0x5f0000 DT_SIZE_K(5952)>; }; slot0_appcpu_partition: partition@bc0000 { label = "image-0-appcpu"; - reg = <0xBC0000 DT_SIZE_K(1984)>; + reg = <0xbc0000 DT_SIZE_K(1984)>; }; slot1_appcpu_partition: partition@db0000 { label = "image-1-appcpu"; - reg = <0xDB0000 DT_SIZE_K(1984)>; + reg = <0xdb0000 DT_SIZE_K(1984)>; }; slot0_lpcore_partition: partition@fa0000 { label = "image-0-lpcore"; - reg = <0xFA0000 DT_SIZE_K(32)>; + reg = <0xfa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@fa8000 { label = "image-1-lpcore"; - reg = <0xFA8000 DT_SIZE_K(32)>; + reg = <0xfa8000 DT_SIZE_K(32)>; }; storage_partition: partition@fb0000 { label = "storage"; - reg = <0xFB0000 DT_SIZE_K(192)>; + reg = <0xfb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@fe0000 { label = "image-scratch"; - reg = <0xFE0000 DT_SIZE_K(124)>; + reg = <0xfe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@fff000 { label = "coredump"; - reg = <0xFFF000 DT_SIZE_K(4)>; + reg = <0xfff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_2M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_2M.dtsi index 4a956952e0a9..91cadab3b802 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_2M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_2M.dtsi @@ -27,7 +27,7 @@ slot1_partition: partition@b0000 { label = "image-1"; - reg = <0xB0000 DT_SIZE_K(576)>; + reg = <0xb0000 DT_SIZE_K(576)>; }; slot0_appcpu_partition: partition@140000 { @@ -42,27 +42,27 @@ slot0_lpcore_partition: partition@1a0000 { label = "image-0-lpcore"; - reg = <0x1A0000 DT_SIZE_K(32)>; + reg = <0x1a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1a8000 { label = "image-1-lpcore"; - reg = <0x1A8000 DT_SIZE_K(32)>; + reg = <0x1a8000 DT_SIZE_K(32)>; }; storage_partition: partition@1b0000 { label = "storage"; - reg = <0x1B0000 DT_SIZE_K(192)>; + reg = <0x1b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1e0000 { label = "image-scratch"; - reg = <0x1E0000 DT_SIZE_K(124)>; + reg = <0x1e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1ff000 { label = "coredump"; - reg = <0x1FF000 DT_SIZE_K(4)>; + reg = <0x1ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_32M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_32M.dtsi index 81e7fdc5800b..ad488fe45f30 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_32M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_32M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@bf0000 { label = "image-1"; - reg = <0xBF0000 DT_SIZE_K(12096)>; + reg = <0xbf0000 DT_SIZE_K(12096)>; }; slot0_appcpu_partition: partition@17c0000 { label = "image-0-appcpu"; - reg = <0x17C0000 DT_SIZE_K(4032)>; + reg = <0x17c0000 DT_SIZE_K(4032)>; }; slot1_appcpu_partition: partition@1bb0000 { label = "image-1-appcpu"; - reg = <0x1BB0000 DT_SIZE_K(4032)>; + reg = <0x1bb0000 DT_SIZE_K(4032)>; }; slot0_lpcore_partition: partition@1fa0000 { label = "image-0-lpcore"; - reg = <0x1FA0000 DT_SIZE_K(32)>; + reg = <0x1fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1fa8000 { label = "image-1-lpcore"; - reg = <0x1FA8000 DT_SIZE_K(32)>; + reg = <0x1fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@1fb0000 { label = "storage"; - reg = <0x1FB0000 DT_SIZE_K(192)>; + reg = <0x1fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1fe0000 { label = "image-scratch"; - reg = <0x1FE0000 DT_SIZE_K(124)>; + reg = <0x1fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1fff000 { label = "coredump"; - reg = <0x1FFF000 DT_SIZE_K(4)>; + reg = <0x1fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_4M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_4M.dtsi index 0d7b86bac8bd..0b77ccf9ee45 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_4M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_4M.dtsi @@ -32,7 +32,7 @@ slot0_appcpu_partition: partition@2c0000 { label = "image-0-appcpu"; - reg = <0x2C0000 DT_SIZE_K(448)>; + reg = <0x2c0000 DT_SIZE_K(448)>; }; slot1_appcpu_partition: partition@330000 { @@ -42,27 +42,27 @@ slot0_lpcore_partition: partition@3a0000 { label = "image-0-lpcore"; - reg = <0x3A0000 DT_SIZE_K(32)>; + reg = <0x3a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3a8000 { label = "image-1-lpcore"; - reg = <0x3A8000 DT_SIZE_K(32)>; + reg = <0x3a8000 DT_SIZE_K(32)>; }; storage_partition: partition@3b0000 { label = "storage"; - reg = <0x3B0000 DT_SIZE_K(192)>; + reg = <0x3b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3e0000 { label = "image-scratch"; - reg = <0x3E0000 DT_SIZE_K(124)>; + reg = <0x3e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3ff000 { label = "coredump"; - reg = <0x3FF000 DT_SIZE_K(4)>; + reg = <0x3ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_64M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_64M.dtsi index 0538f0f90653..882ceead6ed7 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_64M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_64M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@17f0000 { label = "image-1"; - reg = <0x17F0000 DT_SIZE_K(24384)>; + reg = <0x17f0000 DT_SIZE_K(24384)>; }; slot0_appcpu_partition: partition@2fc0000 { label = "image-0-appcpu"; - reg = <0x2FC0000 DT_SIZE_K(8128)>; + reg = <0x2fc0000 DT_SIZE_K(8128)>; }; slot1_appcpu_partition: partition@37b0000 { label = "image-1-appcpu"; - reg = <0x37B0000 DT_SIZE_K(8128)>; + reg = <0x37b0000 DT_SIZE_K(8128)>; }; slot0_lpcore_partition: partition@3fa0000 { label = "image-0-lpcore"; - reg = <0x3FA0000 DT_SIZE_K(32)>; + reg = <0x3fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3fa8000 { label = "image-1-lpcore"; - reg = <0x3FA8000 DT_SIZE_K(32)>; + reg = <0x3fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@3fb0000 { label = "storage"; - reg = <0x3FB0000 DT_SIZE_K(192)>; + reg = <0x3fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3fe0000 { label = "image-scratch"; - reg = <0x3FE0000 DT_SIZE_K(124)>; + reg = <0x3fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3fff000 { label = "coredump"; - reg = <0x3FFF000 DT_SIZE_K(4)>; + reg = <0x3fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_8M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_8M.dtsi index ef8289c49ab8..e84cf2d8df57 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_8M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_8M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@2f0000 { label = "image-1"; - reg = <0x2F0000 DT_SIZE_K(2880)>; + reg = <0x2f0000 DT_SIZE_K(2880)>; }; slot0_appcpu_partition: partition@5c0000 { label = "image-0-appcpu"; - reg = <0x5C0000 DT_SIZE_K(960)>; + reg = <0x5c0000 DT_SIZE_K(960)>; }; slot1_appcpu_partition: partition@6b0000 { label = "image-1-appcpu"; - reg = <0x6B0000 DT_SIZE_K(960)>; + reg = <0x6b0000 DT_SIZE_K(960)>; }; slot0_lpcore_partition: partition@7a0000 { label = "image-0-lpcore"; - reg = <0x7A0000 DT_SIZE_K(32)>; + reg = <0x7a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7a8000 { label = "image-1-lpcore"; - reg = <0x7A8000 DT_SIZE_K(32)>; + reg = <0x7a8000 DT_SIZE_K(32)>; }; storage_partition: partition@7b0000 { label = "storage"; - reg = <0x7B0000 DT_SIZE_K(192)>; + reg = <0x7b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7e0000 { label = "image-scratch"; - reg = <0x7E0000 DT_SIZE_K(124)>; + reg = <0x7e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7ff000 { label = "coredump"; - reg = <0x7FF000 DT_SIZE_K(4)>; + reg = <0x7ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_128M.dtsi b/dts/vendor/espressif/partitions_0x0_default_128M.dtsi index df41ed75d9cb..25da18a0fef9 100644 --- a/dts/vendor/espressif/partitions_0x0_default_128M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_128M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@3fe0000 { label = "image-1"; - reg = <0x3FE0000 DT_SIZE_K(65280)>; + reg = <0x3fe0000 DT_SIZE_K(65280)>; }; slot0_lpcore_partition: partition@7fa0000 { label = "image-0-lpcore"; - reg = <0x7FA0000 DT_SIZE_K(32)>; + reg = <0x7fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7fa8000 { label = "image-1-lpcore"; - reg = <0x7FA8000 DT_SIZE_K(32)>; + reg = <0x7fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@7fb0000 { label = "storage"; - reg = <0x7FB0000 DT_SIZE_K(192)>; + reg = <0x7fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7fe0000 { label = "image-scratch"; - reg = <0x7FE0000 DT_SIZE_K(124)>; + reg = <0x7fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7fff000 { label = "coredump"; - reg = <0x7FFF000 DT_SIZE_K(4)>; + reg = <0x7fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_16M.dtsi b/dts/vendor/espressif/partitions_0x0_default_16M.dtsi index fd333e90165d..ccc1e4cbbd13 100644 --- a/dts/vendor/espressif/partitions_0x0_default_16M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_16M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@7e0000 { label = "image-1"; - reg = <0x7E0000 DT_SIZE_K(7936)>; + reg = <0x7e0000 DT_SIZE_K(7936)>; }; slot0_lpcore_partition: partition@fa0000 { label = "image-0-lpcore"; - reg = <0xFA0000 DT_SIZE_K(32)>; + reg = <0xfa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@fa8000 { label = "image-1-lpcore"; - reg = <0xFA8000 DT_SIZE_K(32)>; + reg = <0xfa8000 DT_SIZE_K(32)>; }; storage_partition: partition@fb0000 { label = "storage"; - reg = <0xFB0000 DT_SIZE_K(192)>; + reg = <0xfb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@fe0000 { label = "image-scratch"; - reg = <0xFE0000 DT_SIZE_K(124)>; + reg = <0xfe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@fff000 { label = "coredump"; - reg = <0xFFF000 DT_SIZE_K(4)>; + reg = <0xfff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_2M.dtsi b/dts/vendor/espressif/partitions_0x0_default_2M.dtsi index 974e180df092..5923faef4e47 100644 --- a/dts/vendor/espressif/partitions_0x0_default_2M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_2M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@e0000 { label = "image-1"; - reg = <0xE0000 DT_SIZE_K(768)>; + reg = <0xe0000 DT_SIZE_K(768)>; }; slot0_lpcore_partition: partition@1a0000 { label = "image-0-lpcore"; - reg = <0x1A0000 DT_SIZE_K(32)>; + reg = <0x1a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1a8000 { label = "image-1-lpcore"; - reg = <0x1A8000 DT_SIZE_K(32)>; + reg = <0x1a8000 DT_SIZE_K(32)>; }; storage_partition: partition@1b0000 { label = "storage"; - reg = <0x1B0000 DT_SIZE_K(192)>; + reg = <0x1b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1e0000 { label = "image-scratch"; - reg = <0x1E0000 DT_SIZE_K(124)>; + reg = <0x1e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1ff000 { label = "coredump"; - reg = <0x1FF000 DT_SIZE_K(4)>; + reg = <0x1ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_32M.dtsi b/dts/vendor/espressif/partitions_0x0_default_32M.dtsi index 5cb8a5ebec76..6953e8cd91d8 100644 --- a/dts/vendor/espressif/partitions_0x0_default_32M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_32M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@fe0000 { label = "image-1"; - reg = <0xFE0000 DT_SIZE_K(16128)>; + reg = <0xfe0000 DT_SIZE_K(16128)>; }; slot0_lpcore_partition: partition@1fa0000 { label = "image-0-lpcore"; - reg = <0x1FA0000 DT_SIZE_K(32)>; + reg = <0x1fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1fa8000 { label = "image-1-lpcore"; - reg = <0x1FA8000 DT_SIZE_K(32)>; + reg = <0x1fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@1fb0000 { label = "storage"; - reg = <0x1FB0000 DT_SIZE_K(192)>; + reg = <0x1fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1fe0000 { label = "image-scratch"; - reg = <0x1FE0000 DT_SIZE_K(124)>; + reg = <0x1fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1fff000 { label = "coredump"; - reg = <0x1FFF000 DT_SIZE_K(4)>; + reg = <0x1fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_4M.dtsi b/dts/vendor/espressif/partitions_0x0_default_4M.dtsi index c4e1d5c52b70..c8e9fc9797b2 100644 --- a/dts/vendor/espressif/partitions_0x0_default_4M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_4M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@1e0000 { label = "image-1"; - reg = <0x1E0000 DT_SIZE_K(1792)>; + reg = <0x1e0000 DT_SIZE_K(1792)>; }; slot0_lpcore_partition: partition@3a0000 { label = "image-0-lpcore"; - reg = <0x3A0000 DT_SIZE_K(32)>; + reg = <0x3a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3a8000 { label = "image-1-lpcore"; - reg = <0x3A8000 DT_SIZE_K(32)>; + reg = <0x3a8000 DT_SIZE_K(32)>; }; storage_partition: partition@3b0000 { label = "storage"; - reg = <0x3B0000 DT_SIZE_K(192)>; + reg = <0x3b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3e0000 { label = "image-scratch"; - reg = <0x3E0000 DT_SIZE_K(124)>; + reg = <0x3e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3ff000 { label = "coredump"; - reg = <0x3FF000 DT_SIZE_K(4)>; + reg = <0x3ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_64M.dtsi b/dts/vendor/espressif/partitions_0x0_default_64M.dtsi index d5f26660431d..69cbe315c050 100644 --- a/dts/vendor/espressif/partitions_0x0_default_64M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_64M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@1fe0000 { label = "image-1"; - reg = <0x1FE0000 DT_SIZE_K(32512)>; + reg = <0x1fe0000 DT_SIZE_K(32512)>; }; slot0_lpcore_partition: partition@3fa0000 { label = "image-0-lpcore"; - reg = <0x3FA0000 DT_SIZE_K(32)>; + reg = <0x3fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3fa8000 { label = "image-1-lpcore"; - reg = <0x3FA8000 DT_SIZE_K(32)>; + reg = <0x3fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@3fb0000 { label = "storage"; - reg = <0x3FB0000 DT_SIZE_K(192)>; + reg = <0x3fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3fe0000 { label = "image-scratch"; - reg = <0x3FE0000 DT_SIZE_K(124)>; + reg = <0x3fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3fff000 { label = "coredump"; - reg = <0x3FFF000 DT_SIZE_K(4)>; + reg = <0x3fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_8M.dtsi b/dts/vendor/espressif/partitions_0x0_default_8M.dtsi index c316321ed392..e38bec829edb 100644 --- a/dts/vendor/espressif/partitions_0x0_default_8M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_8M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@3e0000 { label = "image-1"; - reg = <0x3E0000 DT_SIZE_K(3840)>; + reg = <0x3e0000 DT_SIZE_K(3840)>; }; slot0_lpcore_partition: partition@7a0000 { label = "image-0-lpcore"; - reg = <0x7A0000 DT_SIZE_K(32)>; + reg = <0x7a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7a8000 { label = "image-1-lpcore"; - reg = <0x7A8000 DT_SIZE_K(32)>; + reg = <0x7a8000 DT_SIZE_K(32)>; }; storage_partition: partition@7b0000 { label = "storage"; - reg = <0x7B0000 DT_SIZE_K(192)>; + reg = <0x7b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7e0000 { label = "image-scratch"; - reg = <0x7E0000 DT_SIZE_K(124)>; + reg = <0x7e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7ff000 { label = "coredump"; - reg = <0x7FF000 DT_SIZE_K(4)>; + reg = <0x7ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_128M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_128M.dtsi index aec4d88840f5..3607a7f06ba6 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_128M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_128M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@2ff0000 { label = "image-1"; - reg = <0x2FF0000 DT_SIZE_K(48960)>; + reg = <0x2ff0000 DT_SIZE_K(48960)>; }; slot0_appcpu_partition: partition@5fc0000 { label = "image-0-appcpu"; - reg = <0x5FC0000 DT_SIZE_K(16320)>; + reg = <0x5fc0000 DT_SIZE_K(16320)>; }; slot1_appcpu_partition: partition@6fb0000 { label = "image-1-appcpu"; - reg = <0x6FB0000 DT_SIZE_K(16320)>; + reg = <0x6fb0000 DT_SIZE_K(16320)>; }; slot0_lpcore_partition: partition@7fa0000 { label = "image-0-lpcore"; - reg = <0x7FA0000 DT_SIZE_K(32)>; + reg = <0x7fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7fa8000 { label = "image-1-lpcore"; - reg = <0x7FA8000 DT_SIZE_K(32)>; + reg = <0x7fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@7fb0000 { label = "storage"; - reg = <0x7FB0000 DT_SIZE_K(192)>; + reg = <0x7fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7fe0000 { label = "image-scratch"; - reg = <0x7FE0000 DT_SIZE_K(124)>; + reg = <0x7fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7fff000 { label = "coredump"; - reg = <0x7FFF000 DT_SIZE_K(4)>; + reg = <0x7fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_16M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_16M.dtsi index 0fcbf5abd3cd..19b1b0ee9027 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_16M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_16M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@5f0000 { label = "image-1"; - reg = <0x5F0000 DT_SIZE_K(5952)>; + reg = <0x5f0000 DT_SIZE_K(5952)>; }; slot0_appcpu_partition: partition@bc0000 { label = "image-0-appcpu"; - reg = <0xBC0000 DT_SIZE_K(1984)>; + reg = <0xbc0000 DT_SIZE_K(1984)>; }; slot1_appcpu_partition: partition@db0000 { label = "image-1-appcpu"; - reg = <0xDB0000 DT_SIZE_K(1984)>; + reg = <0xdb0000 DT_SIZE_K(1984)>; }; slot0_lpcore_partition: partition@fa0000 { label = "image-0-lpcore"; - reg = <0xFA0000 DT_SIZE_K(32)>; + reg = <0xfa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@fa8000 { label = "image-1-lpcore"; - reg = <0xFA8000 DT_SIZE_K(32)>; + reg = <0xfa8000 DT_SIZE_K(32)>; }; storage_partition: partition@fb0000 { label = "storage"; - reg = <0xFB0000 DT_SIZE_K(192)>; + reg = <0xfb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@fe0000 { label = "image-scratch"; - reg = <0xFE0000 DT_SIZE_K(124)>; + reg = <0xfe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@fff000 { label = "coredump"; - reg = <0xFFF000 DT_SIZE_K(4)>; + reg = <0xfff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_2M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_2M.dtsi index 54e8fdaf46c6..522ca070f168 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_2M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_2M.dtsi @@ -27,7 +27,7 @@ slot1_partition: partition@b0000 { label = "image-1"; - reg = <0xB0000 DT_SIZE_K(576)>; + reg = <0xb0000 DT_SIZE_K(576)>; }; slot0_appcpu_partition: partition@140000 { @@ -42,27 +42,27 @@ slot0_lpcore_partition: partition@1a0000 { label = "image-0-lpcore"; - reg = <0x1A0000 DT_SIZE_K(32)>; + reg = <0x1a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1a8000 { label = "image-1-lpcore"; - reg = <0x1A8000 DT_SIZE_K(32)>; + reg = <0x1a8000 DT_SIZE_K(32)>; }; storage_partition: partition@1b0000 { label = "storage"; - reg = <0x1B0000 DT_SIZE_K(192)>; + reg = <0x1b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1e0000 { label = "image-scratch"; - reg = <0x1E0000 DT_SIZE_K(124)>; + reg = <0x1e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1ff000 { label = "coredump"; - reg = <0x1FF000 DT_SIZE_K(4)>; + reg = <0x1ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_32M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_32M.dtsi index 4c36ae7f954c..96704fba5fee 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_32M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_32M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@bf0000 { label = "image-1"; - reg = <0xBF0000 DT_SIZE_K(12096)>; + reg = <0xbf0000 DT_SIZE_K(12096)>; }; slot0_appcpu_partition: partition@17c0000 { label = "image-0-appcpu"; - reg = <0x17C0000 DT_SIZE_K(4032)>; + reg = <0x17c0000 DT_SIZE_K(4032)>; }; slot1_appcpu_partition: partition@1bb0000 { label = "image-1-appcpu"; - reg = <0x1BB0000 DT_SIZE_K(4032)>; + reg = <0x1bb0000 DT_SIZE_K(4032)>; }; slot0_lpcore_partition: partition@1fa0000 { label = "image-0-lpcore"; - reg = <0x1FA0000 DT_SIZE_K(32)>; + reg = <0x1fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1fa8000 { label = "image-1-lpcore"; - reg = <0x1FA8000 DT_SIZE_K(32)>; + reg = <0x1fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@1fb0000 { label = "storage"; - reg = <0x1FB0000 DT_SIZE_K(192)>; + reg = <0x1fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1fe0000 { label = "image-scratch"; - reg = <0x1FE0000 DT_SIZE_K(124)>; + reg = <0x1fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1fff000 { label = "coredump"; - reg = <0x1FFF000 DT_SIZE_K(4)>; + reg = <0x1fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_4M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_4M.dtsi index c3d3d28546f9..f6f7ff2ac0c0 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_4M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_4M.dtsi @@ -32,7 +32,7 @@ slot0_appcpu_partition: partition@2c0000 { label = "image-0-appcpu"; - reg = <0x2C0000 DT_SIZE_K(448)>; + reg = <0x2c0000 DT_SIZE_K(448)>; }; slot1_appcpu_partition: partition@330000 { @@ -42,27 +42,27 @@ slot0_lpcore_partition: partition@3a0000 { label = "image-0-lpcore"; - reg = <0x3A0000 DT_SIZE_K(32)>; + reg = <0x3a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3a8000 { label = "image-1-lpcore"; - reg = <0x3A8000 DT_SIZE_K(32)>; + reg = <0x3a8000 DT_SIZE_K(32)>; }; storage_partition: partition@3b0000 { label = "storage"; - reg = <0x3B0000 DT_SIZE_K(192)>; + reg = <0x3b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3e0000 { label = "image-scratch"; - reg = <0x3E0000 DT_SIZE_K(124)>; + reg = <0x3e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3ff000 { label = "coredump"; - reg = <0x3FF000 DT_SIZE_K(4)>; + reg = <0x3ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_64M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_64M.dtsi index d40da4e014c7..a580f63762c3 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_64M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_64M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@17f0000 { label = "image-1"; - reg = <0x17F0000 DT_SIZE_K(24384)>; + reg = <0x17f0000 DT_SIZE_K(24384)>; }; slot0_appcpu_partition: partition@2fc0000 { label = "image-0-appcpu"; - reg = <0x2FC0000 DT_SIZE_K(8128)>; + reg = <0x2fc0000 DT_SIZE_K(8128)>; }; slot1_appcpu_partition: partition@37b0000 { label = "image-1-appcpu"; - reg = <0x37B0000 DT_SIZE_K(8128)>; + reg = <0x37b0000 DT_SIZE_K(8128)>; }; slot0_lpcore_partition: partition@3fa0000 { label = "image-0-lpcore"; - reg = <0x3FA0000 DT_SIZE_K(32)>; + reg = <0x3fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3fa8000 { label = "image-1-lpcore"; - reg = <0x3FA8000 DT_SIZE_K(32)>; + reg = <0x3fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@3fb0000 { label = "storage"; - reg = <0x3FB0000 DT_SIZE_K(192)>; + reg = <0x3fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3fe0000 { label = "image-scratch"; - reg = <0x3FE0000 DT_SIZE_K(124)>; + reg = <0x3fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3fff000 { label = "coredump"; - reg = <0x3FFF000 DT_SIZE_K(4)>; + reg = <0x3fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_8M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_8M.dtsi index 77526fe6068d..53410e708f9d 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_8M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_8M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@2f0000 { label = "image-1"; - reg = <0x2F0000 DT_SIZE_K(2880)>; + reg = <0x2f0000 DT_SIZE_K(2880)>; }; slot0_appcpu_partition: partition@5c0000 { label = "image-0-appcpu"; - reg = <0x5C0000 DT_SIZE_K(960)>; + reg = <0x5c0000 DT_SIZE_K(960)>; }; slot1_appcpu_partition: partition@6b0000 { label = "image-1-appcpu"; - reg = <0x6B0000 DT_SIZE_K(960)>; + reg = <0x6b0000 DT_SIZE_K(960)>; }; slot0_lpcore_partition: partition@7a0000 { label = "image-0-lpcore"; - reg = <0x7A0000 DT_SIZE_K(32)>; + reg = <0x7a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7a8000 { label = "image-1-lpcore"; - reg = <0x7A8000 DT_SIZE_K(32)>; + reg = <0x7a8000 DT_SIZE_K(32)>; }; storage_partition: partition@7b0000 { label = "storage"; - reg = <0x7B0000 DT_SIZE_K(192)>; + reg = <0x7b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7e0000 { label = "image-scratch"; - reg = <0x7E0000 DT_SIZE_K(124)>; + reg = <0x7e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7ff000 { label = "coredump"; - reg = <0x7FF000 DT_SIZE_K(4)>; + reg = <0x7ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_128M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_128M.dtsi index 4836b5a6397a..2aad8ffd2064 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_128M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_128M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@3fe0000 { label = "image-1"; - reg = <0x3FE0000 DT_SIZE_K(65280)>; + reg = <0x3fe0000 DT_SIZE_K(65280)>; }; slot0_lpcore_partition: partition@7fa0000 { label = "image-0-lpcore"; - reg = <0x7FA0000 DT_SIZE_K(32)>; + reg = <0x7fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7fa8000 { label = "image-1-lpcore"; - reg = <0x7FA8000 DT_SIZE_K(32)>; + reg = <0x7fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@7fb0000 { label = "storage"; - reg = <0x7FB0000 DT_SIZE_K(192)>; + reg = <0x7fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7fe0000 { label = "image-scratch"; - reg = <0x7FE0000 DT_SIZE_K(124)>; + reg = <0x7fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7fff000 { label = "coredump"; - reg = <0x7FFF000 DT_SIZE_K(4)>; + reg = <0x7fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_16M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_16M.dtsi index e29c1f83e413..dc36e726b673 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_16M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_16M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@7e0000 { label = "image-1"; - reg = <0x7E0000 DT_SIZE_K(7936)>; + reg = <0x7e0000 DT_SIZE_K(7936)>; }; slot0_lpcore_partition: partition@fa0000 { label = "image-0-lpcore"; - reg = <0xFA0000 DT_SIZE_K(32)>; + reg = <0xfa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@fa8000 { label = "image-1-lpcore"; - reg = <0xFA8000 DT_SIZE_K(32)>; + reg = <0xfa8000 DT_SIZE_K(32)>; }; storage_partition: partition@fb0000 { label = "storage"; - reg = <0xFB0000 DT_SIZE_K(192)>; + reg = <0xfb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@fe0000 { label = "image-scratch"; - reg = <0xFE0000 DT_SIZE_K(124)>; + reg = <0xfe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@fff000 { label = "coredump"; - reg = <0xFFF000 DT_SIZE_K(4)>; + reg = <0xfff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_2M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_2M.dtsi index c290dbd18f55..fd1c018f94f1 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_2M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_2M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@e0000 { label = "image-1"; - reg = <0xE0000 DT_SIZE_K(768)>; + reg = <0xe0000 DT_SIZE_K(768)>; }; slot0_lpcore_partition: partition@1a0000 { label = "image-0-lpcore"; - reg = <0x1A0000 DT_SIZE_K(32)>; + reg = <0x1a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1a8000 { label = "image-1-lpcore"; - reg = <0x1A8000 DT_SIZE_K(32)>; + reg = <0x1a8000 DT_SIZE_K(32)>; }; storage_partition: partition@1b0000 { label = "storage"; - reg = <0x1B0000 DT_SIZE_K(192)>; + reg = <0x1b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1e0000 { label = "image-scratch"; - reg = <0x1E0000 DT_SIZE_K(124)>; + reg = <0x1e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1ff000 { label = "coredump"; - reg = <0x1FF000 DT_SIZE_K(4)>; + reg = <0x1ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_32M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_32M.dtsi index a6ecdffb8d9c..eec77c2d0f13 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_32M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_32M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@fe0000 { label = "image-1"; - reg = <0xFE0000 DT_SIZE_K(16128)>; + reg = <0xfe0000 DT_SIZE_K(16128)>; }; slot0_lpcore_partition: partition@1fa0000 { label = "image-0-lpcore"; - reg = <0x1FA0000 DT_SIZE_K(32)>; + reg = <0x1fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1fa8000 { label = "image-1-lpcore"; - reg = <0x1FA8000 DT_SIZE_K(32)>; + reg = <0x1fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@1fb0000 { label = "storage"; - reg = <0x1FB0000 DT_SIZE_K(192)>; + reg = <0x1fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1fe0000 { label = "image-scratch"; - reg = <0x1FE0000 DT_SIZE_K(124)>; + reg = <0x1fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1fff000 { label = "coredump"; - reg = <0x1FFF000 DT_SIZE_K(4)>; + reg = <0x1fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_4M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_4M.dtsi index 7011c48f7b81..21f17985a83e 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_4M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_4M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@1e0000 { label = "image-1"; - reg = <0x1E0000 DT_SIZE_K(1792)>; + reg = <0x1e0000 DT_SIZE_K(1792)>; }; slot0_lpcore_partition: partition@3a0000 { label = "image-0-lpcore"; - reg = <0x3A0000 DT_SIZE_K(32)>; + reg = <0x3a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3a8000 { label = "image-1-lpcore"; - reg = <0x3A8000 DT_SIZE_K(32)>; + reg = <0x3a8000 DT_SIZE_K(32)>; }; storage_partition: partition@3b0000 { label = "storage"; - reg = <0x3B0000 DT_SIZE_K(192)>; + reg = <0x3b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3e0000 { label = "image-scratch"; - reg = <0x3E0000 DT_SIZE_K(124)>; + reg = <0x3e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3ff000 { label = "coredump"; - reg = <0x3FF000 DT_SIZE_K(4)>; + reg = <0x3ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_64M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_64M.dtsi index 9e6a24e3a107..618f93653407 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_64M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_64M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@1fe0000 { label = "image-1"; - reg = <0x1FE0000 DT_SIZE_K(32512)>; + reg = <0x1fe0000 DT_SIZE_K(32512)>; }; slot0_lpcore_partition: partition@3fa0000 { label = "image-0-lpcore"; - reg = <0x3FA0000 DT_SIZE_K(32)>; + reg = <0x3fa0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3fa8000 { label = "image-1-lpcore"; - reg = <0x3FA8000 DT_SIZE_K(32)>; + reg = <0x3fa8000 DT_SIZE_K(32)>; }; storage_partition: partition@3fb0000 { label = "storage"; - reg = <0x3FB0000 DT_SIZE_K(192)>; + reg = <0x3fb0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3fe0000 { label = "image-scratch"; - reg = <0x3FE0000 DT_SIZE_K(124)>; + reg = <0x3fe0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3fff000 { label = "coredump"; - reg = <0x3FFF000 DT_SIZE_K(4)>; + reg = <0x3fff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_8M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_8M.dtsi index 9b8810573edb..29f6b3e4a87e 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_8M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_8M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@3e0000 { label = "image-1"; - reg = <0x3E0000 DT_SIZE_K(3840)>; + reg = <0x3e0000 DT_SIZE_K(3840)>; }; slot0_lpcore_partition: partition@7a0000 { label = "image-0-lpcore"; - reg = <0x7A0000 DT_SIZE_K(32)>; + reg = <0x7a0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7a8000 { label = "image-1-lpcore"; - reg = <0x7A8000 DT_SIZE_K(32)>; + reg = <0x7a8000 DT_SIZE_K(32)>; }; storage_partition: partition@7b0000 { label = "storage"; - reg = <0x7B0000 DT_SIZE_K(192)>; + reg = <0x7b0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7e0000 { label = "image-scratch"; - reg = <0x7E0000 DT_SIZE_K(124)>; + reg = <0x7e0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7ff000 { label = "coredump"; - reg = <0x7FF000 DT_SIZE_K(4)>; + reg = <0x7ff000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/nordic/nrf52840_partition.dtsi b/dts/vendor/nordic/nrf52840_partition.dtsi index 1fa90a3ed714..8b5df504d422 100644 --- a/dts/vendor/nordic/nrf52840_partition.dtsi +++ b/dts/vendor/nordic/nrf52840_partition.dtsi @@ -20,12 +20,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000C000>; + reg = <0x00000000 0x0000c000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00076000>; + reg = <0x0000c000 0x00076000>; }; slot1_partition: partition@82000 { diff --git a/dts/vendor/nordic/nrf52840_partition_uf2_sdv6.dtsi b/dts/vendor/nordic/nrf52840_partition_uf2_sdv6.dtsi index 9c12d7f82f59..6acdb0e690ab 100644 --- a/dts/vendor/nordic/nrf52840_partition_uf2_sdv6.dtsi +++ b/dts/vendor/nordic/nrf52840_partition_uf2_sdv6.dtsi @@ -38,7 +38,7 @@ code_partition: partition@26000 { label = "Application"; - reg = <0x00026000 0x000C6000>; + reg = <0x00026000 0x000c6000>; }; storage_partition: partition@ec000 { diff --git a/dts/vendor/nordic/nrf52840_partition_uf2_sdv7.dtsi b/dts/vendor/nordic/nrf52840_partition_uf2_sdv7.dtsi index c7f5e0d5e20e..72530f7f4be4 100644 --- a/dts/vendor/nordic/nrf52840_partition_uf2_sdv7.dtsi +++ b/dts/vendor/nordic/nrf52840_partition_uf2_sdv7.dtsi @@ -36,7 +36,7 @@ code_partition: partition@27000 { label = "Application"; - reg = <0x00027000 0x000C5000>; + reg = <0x00027000 0x000c5000>; }; storage_partition: partition@ec000 { diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 84fced0f1bcf..f40b202fbba2 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -606,28 +606,28 @@ reg = <0x9000 0x1000>; }; - atbreplicator212: atbreplicator@A000 { - reg = <0xA000 0x1000>; + atbreplicator212: atbreplicator@a000 { + reg = <0xa000 0x1000>; }; - atbreplicator213: atbreplicator@B000 { - reg = <0xB000 0x1000>; + atbreplicator213: atbreplicator@b000 { + reg = <0xb000 0x1000>; }; - atbfunnel210: atbfunnel@C000 { - reg = <0xC000 0x1000>; + atbfunnel210: atbfunnel@c000 { + reg = <0xc000 0x1000>; }; - atbfunnel211: atbfunnel@D000 { - reg = <0xD000 0x1000>; + atbfunnel211: atbfunnel@d000 { + reg = <0xd000 0x1000>; }; - atbfunnel212: atbfunnel@E000 { - reg = <0xE000 0x1000>; + atbfunnel212: atbfunnel@e000 { + reg = <0xe000 0x1000>; }; - atbfunnel213: atbfunnel@F000 { - reg = <0xF000 0x1000>; + atbfunnel213: atbfunnel@f000 { + reg = <0xf000 0x1000>; }; }; }; diff --git a/dts/vendor/nordic/nrf54l10_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54l10_cpuapp_ns_partition.dtsi index b7b976463de0..92bcd8bb8a30 100644 --- a/dts/vendor/nordic/nrf54l10_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54l10_cpuapp_ns_partition.dtsi @@ -65,14 +65,14 @@ reg = <0x00068000 DT_SIZE_K(8)>; }; - slot0_ns_partition: partition@6A000 { + slot0_ns_partition: partition@6a000 { label = "image-0-nonsecure"; - reg = <0x0006A000 DT_SIZE_K(556)>; + reg = <0x0006a000 DT_SIZE_K(556)>; }; - storage_partition: partition@F5000 { + storage_partition: partition@f5000 { label = "storage"; - reg = <0x000F5000 DT_SIZE_K(32)>; + reg = <0x000f5000 DT_SIZE_K(32)>; }; }; }; diff --git a/dts/vendor/nordic/nrf54l15_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54l15_cpuapp_ns_partition.dtsi index 2586516cfefb..ab1f686caa24 100644 --- a/dts/vendor/nordic/nrf54l15_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54l15_cpuapp_ns_partition.dtsi @@ -76,9 +76,9 @@ reg = <0x00088000 DT_SIZE_K(8)>; }; - slot0_ns_partition: partition@8A000 { + slot0_ns_partition: partition@8a000 { label = "image-0-nonsecure"; - reg = <0x0008A000 DT_SIZE_K(940)>; + reg = <0x0008a000 DT_SIZE_K(940)>; }; storage_partition: partition@175000 { diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index af4e69d4648b..73f7251d7a29 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -109,10 +109,10 @@ /* FLPR/VPR is not used with TF-M so NS can use its memory */ cpuapp_sram: memory@20000000 { compatible = "mmio-sram"; - reg = <0x20000000 0x2007FE40>; + reg = <0x20000000 0x2007fe40>; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20000000 0x2007FE40>; + ranges = <0x0 0x20000000 0x2007fe40>; }; #else cpuapp_sram: memory@20000000 { diff --git a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi index 38f4addb5184..5f5f974db565 100644 --- a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi @@ -77,14 +77,14 @@ reg = <0x00088000 DT_SIZE_K(8)>; }; - slot0_ns_partition: partition@8A000 { + slot0_ns_partition: partition@8a000 { label = "image-0-nonsecure"; - reg = <0x0008A000 DT_SIZE_K(1452)>; + reg = <0x0008a000 DT_SIZE_K(1452)>; }; - storage_partition: partition@1F5000 { + storage_partition: partition@1f5000 { label = "storage"; - reg = <0x001F5000 DT_SIZE_K(32)>; + reg = <0x001f5000 DT_SIZE_K(32)>; }; }; }; diff --git a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi index 5e93a13c0c5e..d8744c85db24 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi @@ -78,14 +78,14 @@ reg = <0x00088000 DT_SIZE_K(8)>; }; - slot0_ns_partition: partition@8A000 { + slot0_ns_partition: partition@8a000 { label = "image-0-nonsecure"; - reg = <0x0008A000 DT_SIZE_K(844)>; + reg = <0x0008a000 DT_SIZE_K(844)>; }; - storage_partition: partition@15D000 { + storage_partition: partition@15d000 { label = "storage"; - reg = <0x00015D000 DT_SIZE_K(32)>; + reg = <0x00015d000 DT_SIZE_K(32)>; }; }; }; diff --git a/dts/vendor/raspberrypi/partitions_2M_sysbuild.dtsi b/dts/vendor/raspberrypi/partitions_2M_sysbuild.dtsi index 5172fb980a73..105bef5d5ce9 100644 --- a/dts/vendor/raspberrypi/partitions_2M_sysbuild.dtsi +++ b/dts/vendor/raspberrypi/partitions_2M_sysbuild.dtsi @@ -28,12 +28,12 @@ reg = <0x10000 0xd0000>; }; - slot1_partition: partition@E0000 { + slot1_partition: partition@e0000 { label = "image-1"; reg = <0xe0000 0xd0000>; }; - storage_partition: partition@1B0000 { + storage_partition: partition@1b0000 { label = "storage"; reg = <0x1b0000 0x50000>; }; diff --git a/dts/x86/intel/alder_lake.dtsi b/dts/x86/intel/alder_lake.dtsi index f3455e7b8b22..825026523aad 100644 --- a/dts/x86/intel/alder_lake.dtsi +++ b/dts/x86/intel/alder_lake.dtsi @@ -74,7 +74,7 @@ gpio_c: gpio_c { acpi-hid = "INTC1057"; acpi-uid = "0"; - group-index = <0x0B>; + group-index = <0x0b>; int-stat-offset = <0x40>; int-en-offset = <0x20>; status = "okay"; @@ -92,7 +92,7 @@ gpio_e: gpio_e { acpi-hid = "INTC1057"; acpi-uid = "0"; - group-index = <0xE>; + group-index = <0xe>; int-stat-offset = <0x40>; int-en-offset = <0x20>; status = "okay"; @@ -101,7 +101,7 @@ gpio_f: gpio_f { acpi-hid = "INTC1057"; acpi-uid = "0"; - group-index = <0xC>; + group-index = <0xc>; int-stat-offset = <0x40>; int-en-offset = <0x20>; status = "okay"; @@ -155,7 +155,7 @@ gpio_v: gpio_v { acpi-hid = "INTC1057"; acpi-uid = "0"; - group-index = <0xA>; + group-index = <0xa>; int-stat-offset = <0x40>; int-en-offset = <0x20>; status = "okay"; @@ -205,7 +205,7 @@ uart1: uart1 { compatible = "ns16550"; vendor-id = <0x8086>; - device-id = <0x54A9>; + device-id = <0x54a9>; clock-frequency = <1843200>; current-speed = <115200>; reg-shift = <2>; @@ -225,7 +225,7 @@ uart2: uart2 { compatible = "ns16550"; vendor-id = <0x8086>; - device-id = <0x54C7>; + device-id = <0x54c7>; clock-frequency = <1843200>; current-speed = <115200>; reg-shift = <2>; @@ -366,7 +366,7 @@ emmc: emmc0 { compatible = "intel,emmc-host"; vendor-id = <0x8086>; - device-id = <0x54C4>; + device-id = <0x54c4>; interrupts = ; interrupt-parent = <&intc>; diff --git a/dts/x86/intel/raptor_lake_p.dtsi b/dts/x86/intel/raptor_lake_p.dtsi index 38b400baccd6..bcd780cd9361 100644 --- a/dts/x86/intel/raptor_lake_p.dtsi +++ b/dts/x86/intel/raptor_lake_p.dtsi @@ -77,7 +77,7 @@ uart1: uart1 { compatible = "ns16550"; vendor-id = <0x8086>; - device-id = <0x51A9>; + device-id = <0x51a9>; reg-shift = <2>; clock-frequency = <1843200>; interrupts = ; diff --git a/dts/xtensa/espressif/esp32/esp32_common.dtsi b/dts/xtensa/espressif/esp32/esp32_common.dtsi index 0d44c6aa396d..b3dc237ae0ea 100644 --- a/dts/xtensa/espressif/esp32/esp32_common.dtsi +++ b/dts/xtensa/espressif/esp32/esp32_common.dtsi @@ -200,7 +200,7 @@ }; rtc_timer: rtc_timer@3ff48004 { - reg = <0x3ff48004 0xC>; + reg = <0x3ff48004 0xc>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; @@ -256,7 +256,7 @@ uart2: uart@3ff6e000 { compatible = "espressif,esp32-uart"; - reg = <0x3ff6E000 0x400>; + reg = <0x3ff6e000 0x400>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_UART2_MODULE>; @@ -397,7 +397,7 @@ trng0: trng@3ff75144 { compatible = "espressif,esp32-trng"; - reg = <0x3FF75144 0x4>; + reg = <0x3ff75144 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi index 3b337d9089e5..8e91cc3a02ee 100644 --- a/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi +++ b/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi @@ -153,7 +153,7 @@ }; rtc_timer: rtc_timer@3f408004 { - reg = <0x3f408004 0xC>; + reg = <0x3f408004 0xc>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi index 2b9f09fb5885..528c212c4065 100644 --- a/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi +++ b/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi @@ -194,7 +194,7 @@ }; rtc_timer: rtc_timer@60008004 { - reg = <0x60008004 0xC>; + reg = <0x60008004 0xc>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; diff --git a/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi b/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi index 3c7b58089ec3..e70edd5b04b5 100644 --- a/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi @@ -103,9 +103,9 @@ #clock-cells = <0>; }; - IMR1: memory@A1000000 { + IMR1: memory@a1000000 { compatible = "intel,adsp-imr"; - reg = <0xA1000000 DT_SIZE_M(16)>; + reg = <0xa1000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -156,7 +156,7 @@ dmic0: dmic0@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0xC000>; + shim = <0xc000>; fifo = <0x0008>; interrupts = <0x08 0 0>; interrupt-parent = <&ace_intc>; @@ -167,7 +167,7 @@ dmic1: dmic1@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0xC000>; + shim = <0xc000>; fifo = <0x0108>; interrupts = <0x09 0 0>; interrupt-parent = <&ace_intc>; @@ -291,7 +291,7 @@ #size-cells = <0>; compatible = "intel,ssp"; reg = <0x00028000 0x1000 - 0x00079C00 0x200>; + 0x00079c00 0x200>; interrupts = <0x00 0 0>; interrupt-parent = <&ace_intc>; dmas = <&lpgpdma0 2 @@ -314,7 +314,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00029000 0x1000 - 0x00079C00 0x200>; + 0x00079c00 0x200>; interrupts = <0x01 0 0>; interrupt-parent = <&ace_intc>; dmas = <&lpgpdma0 4 @@ -337,7 +337,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x0002a000 0x1000 - 0x00079C00 0x200>; + 0x00079c00 0x200>; interrupts = <0x02 0 0>; interrupt-parent = <&ace_intc>; dmas = <&lpgpdma0 6 diff --git a/dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi b/dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi index 8a0c593a5646..a59247f55355 100644 --- a/dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi @@ -117,9 +117,9 @@ #clock-cells = <0>; }; - IMR1: memory@A1000000 { + IMR1: memory@a1000000 { compatible = "intel,adsp-imr"; - reg = <0xA1000000 DT_SIZE_M(16)>; + reg = <0xa1000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -211,7 +211,7 @@ hdamlssp: hdamlssp@d00 { compatible = "intel,adsp-hda-ssp-cap"; - reg = <0xD00 0x40>; + reg = <0xd00 0x40>; status = "okay"; }; @@ -220,8 +220,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00028100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x00028C00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x00028c00 0x1000>; interrupts = <0x00 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 1 @@ -244,8 +244,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00029100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x00029C00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x00029c00 0x1000>; interrupts = <0x01 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 2 @@ -268,8 +268,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x0002a100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x0002AC00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x0002ac00 0x1000>; interrupts = <0x02 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 3 diff --git a/dts/xtensa/intel/intel_adsp_ace30.dtsi b/dts/xtensa/intel/intel_adsp_ace30.dtsi index 16f38b8b81be..38470e583a4f 100644 --- a/dts/xtensa/intel/intel_adsp_ace30.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace30.dtsi @@ -97,9 +97,9 @@ #clock-cells = <0>; }; - IMR1: memory@A1000000 { + IMR1: memory@a1000000 { compatible = "intel,adsp-imr"; - reg = <0xA1000000 DT_SIZE_M(16)>; + reg = <0xa1000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -188,7 +188,7 @@ hdamlssp: hdamlssp@d00 { compatible = "intel,adsp-hda-ssp-cap"; - reg = <0xD00 0x40>; + reg = <0xd00 0x40>; status = "okay"; }; @@ -197,8 +197,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00028100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x00028C00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x00028c00 0x1000>; interrupts = <0x00 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 1 @@ -277,8 +277,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00029100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x00029C00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x00029c00 0x1000>; interrupts = <0x01 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 2 @@ -357,8 +357,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x0002a100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x0002AC00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x0002ac00 0x1000>; interrupts = <0x02 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 3 diff --git a/dts/xtensa/intel/intel_adsp_ace40.dtsi b/dts/xtensa/intel/intel_adsp_ace40.dtsi index 4d16803d6b90..81726d5d2307 100644 --- a/dts/xtensa/intel/intel_adsp_ace40.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace40.dtsi @@ -90,9 +90,9 @@ #clock-cells = <0>; }; - IMR1: memory@A1000000 { + IMR1: memory@a1000000 { compatible = "intel,adsp-imr"; - reg = <0xA1000000 DT_SIZE_M(16)>; + reg = <0xa1000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -181,7 +181,7 @@ hdamlssp: hdamlssp@d00 { compatible = "intel,adsp-hda-ssp-cap"; - reg = <0xD00 0x40>; + reg = <0xd00 0x40>; status = "okay"; }; @@ -190,8 +190,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00028100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x00028C00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x00028c00 0x1000>; interrupts = <0x00 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 1 @@ -270,8 +270,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00029100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x00029C00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x00029c00 0x1000>; interrupts = <0x01 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 2 @@ -350,8 +350,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x0002a100 0x1000 - 0x00079C00 0x200>; - i2svss = <0x0002AC00 0x1000>; + 0x00079c00 0x200>; + i2svss = <0x0002ac00 0x1000>; interrupts = <0x02 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 3 diff --git a/dts/xtensa/intel/intel_adsp_cavs.dtsi b/dts/xtensa/intel/intel_adsp_cavs.dtsi index b7b3e145961e..1188ef891427 100644 --- a/dts/xtensa/intel/intel_adsp_cavs.dtsi +++ b/dts/xtensa/intel/intel_adsp_cavs.dtsi @@ -26,7 +26,7 @@ #dma-cells = <1>; reg = <0x0007d000 0x1000>; shim = <0x00078500 0x100>; - interrupts = <0x0F 0 0>; + interrupts = <0x0f 0 0>; interrupt-parent = <&cavs_intc3>; dma-buf-size-alignment = <4>; dma-copy-alignment = <4>; diff --git a/dts/xtensa/intel/intel_adsp_cavs25.dtsi b/dts/xtensa/intel/intel_adsp_cavs25.dtsi index 55be6d267bdf..fe95613e9fca 100644 --- a/dts/xtensa/intel/intel_adsp_cavs25.dtsi +++ b/dts/xtensa/intel/intel_adsp_cavs25.dtsi @@ -101,7 +101,7 @@ IMR1: memory@b0000000 { compatible = "intel,adsp-imr"; - reg = <0xB0000000 DT_SIZE_M(16)>; + reg = <0xb0000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -157,7 +157,7 @@ sspbase: ssp_base@71c00 { compatible = "intel,cavs-sspbase"; - reg = <0x71C00 0x100>; + reg = <0x71c00 0x100>; }; l2lm: l2lm@71d00 { @@ -193,7 +193,7 @@ reg = <0x78810 0x10>; interrupt-controller; #interrupt-cells = <3>; - interrupts = <0xA 0 0>; + interrupts = <0xa 0 0>; interrupt-parent = <&core_intc>; }; @@ -202,7 +202,7 @@ reg = <0x78820 0x10>; interrupt-controller; #interrupt-cells = <3>; - interrupts = <0XD 0 0>; + interrupts = <0xd 0 0>; interrupt-parent = <&core_intc>; }; @@ -233,7 +233,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077000 0x200 - 0x00078C00 0x008>; + 0x00078c00 0x008>; interrupts = <0x01 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 2 @@ -254,7 +254,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077200 0x200 - 0x00078C00 0x008>; + 0x00078c00 0x008>; interrupts = <0x01 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 4 @@ -275,7 +275,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077400 0x200 - 0x00078C00 0x008>; + 0x00078c00 0x008>; interrupts = <0x02 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 6 @@ -296,7 +296,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077600 0x200 - 0x00078C00 0x008>; + 0x00078c00 0x008>; interrupts = <0x03 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 8 @@ -317,7 +317,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077800 0x200 - 0x00078C00 0x008>; + 0x00078c00 0x008>; interrupts = <0x03 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 10 @@ -337,8 +337,8 @@ compatible = "intel,ssp"; #address-cells = <1>; #size-cells = <0>; - reg = <0x00077A00 0x200 - 0x00078C00 0x008>; + reg = <0x00077a00 0x200 + 0x00078c00 0x008>; interrupts = <0x03 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 12 @@ -460,7 +460,7 @@ dmic0: dmic0@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0x71E80>; + shim = <0x71e80>; fifo = <0x0008>; interrupts = <0x08 0 0>; interrupt-parent = <&cavs_intc3>; @@ -469,7 +469,7 @@ dmic1: dmic1@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0x71E80>; + shim = <0x71e80>; fifo = <0x0108>; interrupts = <0x09 0 0>; interrupt-parent = <&cavs_intc3>; diff --git a/dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi b/dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi index d1dfd067f44d..4a50211f11d1 100644 --- a/dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi +++ b/dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi @@ -86,7 +86,7 @@ IMR1: memory@b0000000 { compatible = "intel,adsp-imr"; - reg = <0xB0000000 DT_SIZE_M(16)>; + reg = <0xb0000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -178,7 +178,7 @@ reg = <0x78810 0x10>; interrupt-controller; #interrupt-cells = <3>; - interrupts = <0xA 0 0>; + interrupts = <0xa 0 0>; interrupt-parent = <&core_intc>; }; @@ -187,7 +187,7 @@ reg = <0x78820 0x10>; interrupt-controller; #interrupt-cells = <3>; - interrupts = <0XD 0 0>; + interrupts = <0xd 0 0>; interrupt-parent = <&core_intc>; }; @@ -216,7 +216,7 @@ dmic0: dmic0@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0x71E80>; + shim = <0x71e80>; fifo = <0x0008>; interrupts = <0x08 0 0>; interrupt-parent = <&cavs_intc3>; @@ -225,7 +225,7 @@ dmic1: dmic1@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0x71E80>; + shim = <0x71e80>; fifo = <0x0108>; interrupts = <0x09 0 0>; interrupt-parent = <&cavs_intc3>; @@ -257,7 +257,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077000 0x200 - 0x00078C00 0x008>; + 0x00078c00 0x008>; interrupts = <0x01 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 2 @@ -278,7 +278,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077200 0x200 - 0x00078C00 0x008>; + 0x00078c00 0x008>; interrupts = <0x01 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 4 @@ -299,7 +299,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077400 0x200 - 0x00078C00 0x008>; + 0x00078c00 0x008>; interrupts = <0x02 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 6 diff --git a/samples/basic/blinky_pwm/boards/frdm_mcxc242.overlay b/samples/basic/blinky_pwm/boards/frdm_mcxc242.overlay index 09c1ccb22ad9..57dad865deff 100644 --- a/samples/basic/blinky_pwm/boards/frdm_mcxc242.overlay +++ b/samples/basic/blinky_pwm/boards/frdm_mcxc242.overlay @@ -5,9 +5,9 @@ */ &tpm1 { - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 25>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 25>; }; &tpm2 { - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 26>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 26>; }; diff --git a/samples/boards/renesas/openamp_linux_zephyr/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay b/samples/boards/renesas/openamp_linux_zephyr/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay index cc545f79b7e5..a38830ce789a 100644 --- a/samples/boards/renesas/openamp_linux_zephyr/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay +++ b/samples/boards/renesas/openamp_linux_zephyr/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay @@ -14,9 +14,9 @@ #size-cells = <1>; ranges; - openamp_shm: memory-region@62F00000 { + openamp_shm: memory-region@62f00000 { compatible = "zephyr,memory-region"; - reg = <0x62F00000 0x600000>; + reg = <0x62f00000 0x600000>; zephyr,memory-region = "openamp_memory"; zephyr,memory-attr = ; }; @@ -42,29 +42,29 @@ reg = <0x63200000 0x300000>; }; - rsctbl: memory@62F00000 { + rsctbl: memory@62f00000 { compatible = "mmio-sram"; - reg = <0x62F00000 0x1000>; + reg = <0x62f00000 0x1000>; }; - mhu1_shm: memory@62F01008 { + mhu1_shm: memory@62f01008 { compatible = "mmio-sram"; - reg = <0x62F01008 0x8>; + reg = <0x62f01008 0x8>; }; - mhu3_shm: memory@62F01018 { + mhu3_shm: memory@62f01018 { compatible = "mmio-sram"; - reg = <0x62F01018 0x8>; + reg = <0x62f01018 0x8>; }; - mhu4_shm: memory@62F01020 { + mhu4_shm: memory@62f01020 { compatible = "mmio-sram"; - reg = <0x62F01020 0x8>; + reg = <0x62f01020 0x8>; }; - mhu5_shm: memory@62F01028 { + mhu5_shm: memory@62f01028 { compatible = "mmio-sram"; - reg = <0x62F01028 0x8>; + reg = <0x62f01028 0x8>; }; mbox_consumer: mbox-consumer { diff --git a/samples/boards/renesas/openamp_linux_zephyr/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay b/samples/boards/renesas/openamp_linux_zephyr/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay index e4176fc9f3a7..fb7908b31685 100644 --- a/samples/boards/renesas/openamp_linux_zephyr/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay +++ b/samples/boards/renesas/openamp_linux_zephyr/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay @@ -13,9 +13,9 @@ #size-cells = <1>; ranges; - openamp_shm: memory-region@62F00000 { + openamp_shm: memory-region@62f00000 { compatible = "zephyr,memory-region"; - reg = <0x62F00000 0x900000>; + reg = <0x62f00000 0x900000>; zephyr,memory-region = "openamp_memory"; zephyr,memory-attr = ; }; @@ -41,29 +41,29 @@ reg = <0x63200000 0x300000>; }; - rsctbl: memory@62F00000 { + rsctbl: memory@62f00000 { compatible = "mmio-sram"; - reg = <0x62F00000 0x1000>; + reg = <0x62f00000 0x1000>; }; - mhu1_shm: memory@62F01008 { + mhu1_shm: memory@62f01008 { compatible = "mmio-sram"; - reg = <0x62F01008 0x8>; + reg = <0x62f01008 0x8>; }; - mhu3_shm: memory@62F01018 { + mhu3_shm: memory@62f01018 { compatible = "mmio-sram"; - reg = <0x62F01018 0x8>; + reg = <0x62f01018 0x8>; }; - mhu4_shm: memory@62F01020 { + mhu4_shm: memory@62f01020 { compatible = "mmio-sram"; - reg = <0x62F01020 0x8>; + reg = <0x62f01020 0x8>; }; - mhu5_shm: memory@62F01028 { + mhu5_shm: memory@62f01028 { compatible = "mmio-sram"; - reg = <0x62F01028 0x8>; + reg = <0x62f01028 0x8>; }; mbox_consumer: mbox-consumer { diff --git a/samples/drivers/adc/adc_sequence/boards/stm32f3_disco.overlay b/samples/drivers/adc/adc_sequence/boards/stm32f3_disco.overlay index 84a8957c6500..89a595aefc88 100644 --- a/samples/drivers/adc/adc_sequence/boards/stm32f3_disco.overlay +++ b/samples/drivers/adc/adc_sequence/boards/stm32f3_disco.overlay @@ -26,8 +26,8 @@ #size-cells = <0>; /* INPUTx mapping bits [9:0] for CH0 to CH15 */ - map-inputs = <0x10 0x30 0x50 0x70 0x90 0xB0 0xD0 0xF0 0x110 - 0x130 0x150 0x170 0x190 0x1B0 0x1D0 0x1F0>; + map-inputs = <0x10 0x30 0x50 0x70 0x90 0xb0 0xd0 0xf0 0x110 + 0x130 0x150 0x170 0x190 0x1b0 0x1d0 0x1f0>; channel@0 { reg = <0x0>; diff --git a/samples/drivers/ethernet/eth_ivshmem/boards/qemu_cortex_a53.overlay b/samples/drivers/ethernet/eth_ivshmem/boards/qemu_cortex_a53.overlay index 775ffa3b48f1..17aaa71db3d2 100644 --- a/samples/drivers/ethernet/eth_ivshmem/boards/qemu_cortex_a53.overlay +++ b/samples/drivers/ethernet/eth_ivshmem/boards/qemu_cortex_a53.overlay @@ -48,10 +48,10 @@ ivshmem0: ivshmem@0 { compatible = "qemu,ivshmem"; ivshmem-v2; - vendor-id = <0x110A>; /* Siemens */ + vendor-id = <0x110a>; /* Siemens */ device-id = <0x4106>; /* IVSHMEM */ - class-rev = <0xFF000100>; /* PCI_CLASS_OTHERS | IVSHMEM_PROTO_NET */ - class-rev-mask = <0xFFFFFF00>; /* PCI_CLASS_MASK | IVSHMEM_PROTO_MASK */ + class-rev = <0xff000100>; /* PCI_CLASS_OTHERS | IVSHMEM_PROTO_NET */ + class-rev-mask = <0xffffff00>; /* PCI_CLASS_MASK | IVSHMEM_PROTO_MASK */ interrupt-parent = <&pcie>; interrupts = <1 2 3 4>; reg = <0x00 0x00 0x00 0x00 0x01>; diff --git a/samples/drivers/led/pwm/boards/frdm_mcxc242.overlay b/samples/drivers/led/pwm/boards/frdm_mcxc242.overlay index eaee9d6959b0..8ad1757a6bee 100644 --- a/samples/drivers/led/pwm/boards/frdm_mcxc242.overlay +++ b/samples/drivers/led/pwm/boards/frdm_mcxc242.overlay @@ -15,9 +15,9 @@ }; &tpm1 { - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 25>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 25>; }; &tpm2 { - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 26>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 26>; }; diff --git a/samples/drivers/mbox/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay b/samples/drivers/mbox/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay index e02fb726cb9a..233dcff5e042 100644 --- a/samples/drivers/mbox/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay +++ b/samples/drivers/mbox/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xEC>; + reg = <0x5008b000 0xec>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/drivers/mbox/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay b/samples/drivers/mbox/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay index 6c40b6b4e286..a0474c44c6ef 100644 --- a/samples/drivers/mbox/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay +++ b/samples/drivers/mbox/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay @@ -21,7 +21,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mbox@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xEC>; + reg = <0x5008b000 0xec>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/drivers/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay b/samples/drivers/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay index df5656467da2..9e5b871b78e4 100644 --- a/samples/drivers/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay +++ b/samples/drivers/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xEC>; + reg = <0x5008b000 0xec>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/drivers/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay b/samples/drivers/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay index 2b183cbb148a..d3667fefd307 100644 --- a/samples/drivers/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay +++ b/samples/drivers/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mbox@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xEC>; + reg = <0x5008b000 0xec>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/drivers/memc/boards/apollo3p_evb.overlay b/samples/drivers/memc/boards/apollo3p_evb.overlay index 8694986e7a7b..10e6a757d5d5 100644 --- a/samples/drivers/memc/boards/apollo3p_evb.overlay +++ b/samples/drivers/memc/boards/apollo3p_evb.overlay @@ -40,7 +40,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xEB>; + read-command = <0xeb>; write-command = <0x38>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_3_BYTE"; diff --git a/samples/drivers/mspi/mspi_async/boards/apollo3p_evb.overlay b/samples/drivers/mspi/mspi_async/boards/apollo3p_evb.overlay index 5f1213f38e83..a3e7177799c5 100644 --- a/samples/drivers/mspi/mspi_async/boards/apollo3p_evb.overlay +++ b/samples/drivers/mspi/mspi_async/boards/apollo3p_evb.overlay @@ -40,7 +40,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xEB>; + read-command = <0xeb>; write-command = <0x38>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_3_BYTE"; diff --git a/samples/drivers/mspi/mspi_flash/boards/apollo3p_evb.overlay b/samples/drivers/mspi/mspi_flash/boards/apollo3p_evb.overlay index b1314b49e65b..190f63e2e159 100644 --- a/samples/drivers/mspi/mspi_flash/boards/apollo3p_evb.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/apollo3p_evb.overlay @@ -41,7 +41,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xEB>; + read-command = <0xeb>; write-command = <0x38>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_3_BYTE"; @@ -62,7 +62,7 @@ mspi-io-mode = "MSPI_IO_MODE_OCTAL"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0x0B>; + read-command = <0x0b>; write-command = <0x02>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; diff --git a/samples/drivers/mspi/mspi_flash/boards/b_u585i_iot02a.overlay b/samples/drivers/mspi/mspi_flash/boards/b_u585i_iot02a.overlay index eeb536a00f37..e84050df2281 100644 --- a/samples/drivers/mspi/mspi_flash/boards/b_u585i_iot02a.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/b_u585i_iot02a.overlay @@ -45,9 +45,9 @@ mspi-io-mode = "MSPI_IO_MODE_OCTAL"; mspi-data-rate = "MSPI_DATA_RATE_DUAL"; /* as first step */ mspi-hardware-ce-num = <0>; - read-command = <0xEE11>; /* ReaD 4Bytes */ + read-command = <0xee11>; /* ReaD 4Bytes */ command-length = "INSTR_2_BYTE"; - write-command = <0x12ED>; /* WRite 4Bytes */ + write-command = <0x12ed>; /* WRite 4Bytes */ rx-dummy = <20>; jedec-id = [c2 85 3a]; status = "okay"; diff --git a/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay b/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay index cd37ec69d24c..3ac04886111a 100644 --- a/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay @@ -42,8 +42,8 @@ reg = <0>; size = ; /* 512 Mbits */ status = "okay"; - read-command = <0xEE11>; - write-command = <0x12ED>; + read-command = <0xee11>; + write-command = <0x12ed>; rx-dummy = <20>; mspi-max-frequency = ; mspi-io-mode = "MSPI_IO_MODE_OCTAL"; diff --git a/samples/drivers/mspi/mspi_flash/boards/stm32h735g_disco.overlay b/samples/drivers/mspi/mspi_flash/boards/stm32h735g_disco.overlay index 5f4ad6c0d6ce..21435902a9e2 100644 --- a/samples/drivers/mspi/mspi_flash/boards/stm32h735g_disco.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/stm32h735g_disco.overlay @@ -42,8 +42,8 @@ mspi-io-mode = "MSPI_IO_MODE_OCTAL"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xEC13>; - write-command = <0x12ED>; + read-command = <0xec13>; + write-command = <0x12ed>; command-length = "INSTR_2_BYTE"; rx-dummy = <20>; jedec-id = [c2 85 3a]; diff --git a/samples/drivers/mspi/mspi_flash/boards/stm32l496g_disco.overlay b/samples/drivers/mspi/mspi_flash/boards/stm32l496g_disco.overlay index 8a711b4109b8..4fbe529b72d1 100644 --- a/samples/drivers/mspi/mspi_flash/boards/stm32l496g_disco.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/stm32l496g_disco.overlay @@ -44,7 +44,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD_1_4_4"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xEB>; + read-command = <0xeb>; write-command = <0x38>; /* PP_1_4_4 */ mspi-hardware-ce-num = <0>; command-length = "INSTR_1_BYTE"; diff --git a/samples/drivers/pwm/capture/boards/lp_mspm0g3507.overlay b/samples/drivers/pwm/capture/boards/lp_mspm0g3507.overlay index 0e1422ab2d62..05b944c33c59 100644 --- a/samples/drivers/pwm/capture/boards/lp_mspm0g3507.overlay +++ b/samples/drivers/pwm/capture/boards/lp_mspm0g3507.overlay @@ -25,7 +25,7 @@ pinctrl-names = "default"; ti,cc-index = <0>; ti,cc-mode = "PULSE_WIDTH"; - ti,period = <0xFFFF>; + ti,period = <0xffff>; status = "okay"; }; }; diff --git a/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay b/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay index 2ecd7e172c64..bbdf36d6eeca 100644 --- a/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay +++ b/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay @@ -7,9 +7,9 @@ &i2c2 { clock-frequency = ; - fdc2x1x@2A { + fdc2x1x@2a { compatible = "ti,fdc2x1x"; - reg = <0x2A>; + reg = <0x2a>; sd-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; intb-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; diff --git a/samples/sensor/tmp11x/boards/nucleo_f401re.overlay b/samples/sensor/tmp11x/boards/nucleo_f401re.overlay index 3a7b18daeed7..85840214f403 100644 --- a/samples/sensor/tmp11x/boards/nucleo_f401re.overlay +++ b/samples/sensor/tmp11x/boards/nucleo_f401re.overlay @@ -7,7 +7,7 @@ &i2c1 { ti_tmp11x: ti_tmp11x@4b { compatible = "ti,tmp11x"; - reg = <0x4B>; + reg = <0x4b>; #address-cells = <1>; #size-cells = <0>; diff --git a/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay b/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay index 28d54e79132d..fe4e532b471c 100644 --- a/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay +++ b/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay @@ -22,7 +22,7 @@ #size-cells = <1>; slot0_partition: partition@c000 { - reg = <0x0000C000 0x00066000>; + reg = <0x0000c000 0x00066000>; }; slot1_partition: partition@72000 { diff --git a/samples/subsys/instrumentation/boards/mps2_an385.overlay b/samples/subsys/instrumentation/boards/mps2_an385.overlay index adccb6d44909..8fa07f12b577 100644 --- a/samples/subsys/instrumentation/boards/mps2_an385.overlay +++ b/samples/subsys/instrumentation/boards/mps2_an385.overlay @@ -30,5 +30,5 @@ }; &sram0 { - reg = <0x20000000 0x3FFFE0>; + reg = <0x20000000 0x3fffe0>; }; 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 c0381229f999..d43b27afd242 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 @@ -27,8 +27,8 @@ reg = <0x20078000 0x4000>; }; - sram_ipc1_rx: memory@2007C000 { - reg = <0x2007C000 0x4000>; + sram_ipc1_rx: memory@2007c000 { + reg = <0x2007c000 0x4000>; }; }; 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 bf5df3e3881d..9cc591856ebd 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 @@ -27,8 +27,8 @@ reg = <0x20078000 0x4000>; }; - sram_ipc1_rx: memory@2007C000 { - reg = <0x2007C000 0x4000>; + sram_ipc1_rx: memory@2007c000 { + reg = <0x2007c000 0x4000>; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 812f3bdb1e12..acb7ec4356c0 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -15,8 +15,8 @@ reg = <0x2f0bf800 DT_SIZE_K(1)>; }; - cpurad_cpuapp_ipc_shm_b: memory@2f0bfC00 { - reg = <0x2f0bfC00 DT_SIZE_K(1)>; + cpurad_cpuapp_ipc_shm_b: memory@2f0bfc00 { + reg = <0x2f0bfc00 DT_SIZE_K(1)>; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay index 63e1d6a03a08..b5efc051c0ba 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -27,8 +27,8 @@ reg = <0x20078000 0x4000>; }; - sram_ipc1_tx: memory@2007C000 { - reg = <0x2007C000 0x4000>; + sram_ipc1_tx: memory@2007c000 { + reg = <0x2007c000 0x4000>; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay index 39f513954ffb..97b89152ffdf 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay @@ -27,8 +27,8 @@ reg = <0x20078000 0x4000>; }; - sram_ipc1_tx: memory@2007C000 { - reg = <0x2007C000 0x4000>; + sram_ipc1_tx: memory@2007c000 { + reg = <0x2007c000 0x4000>; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay index 74ffd9ab56e1..11fbaa605fee 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -15,8 +15,8 @@ reg = <0x2f0bf800 DT_SIZE_K(1)>; }; - cpurad_cpuapp_ipc_shm_b: memory@2f0bfC00 { - reg = <0x2f0bfC00 DT_SIZE_K(1)>; + cpurad_cpuapp_ipc_shm_b: memory@2f0bfc00 { + reg = <0x2f0bfc00 DT_SIZE_K(1)>; }; }; diff --git a/samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay b/samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay index 45f164e26df1..4806a4123046 100644 --- a/samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay +++ b/samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay @@ -40,7 +40,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xEC>; + reg = <0x5008b000 0xec>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay b/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay index 513a78be7711..9df3b6bf78e1 100644 --- a/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay +++ b/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay @@ -40,7 +40,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xEC>; + reg = <0x5008b000 0xec>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/subsys/ipc/openamp/boards/frdm_mcxn947_mcxn947_cpu0.overlay b/samples/subsys/ipc/openamp/boards/frdm_mcxn947_mcxn947_cpu0.overlay index ec9bbbc46525..e2acdcdacf8f 100644 --- a/samples/subsys/ipc/openamp/boards/frdm_mcxn947_mcxn947_cpu0.overlay +++ b/samples/subsys/ipc/openamp/boards/frdm_mcxn947_mcxn947_cpu0.overlay @@ -20,7 +20,7 @@ soc { mailbox0: mailbox@400b2000 { compatible = "nxp,lpc-mailbox"; - reg = <0x400b2000 0xEC>; + reg = <0x400b2000 0xec>; interrupts = <54 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "okay"; diff --git a/samples/subsys/ipc/openamp/boards/mcx_n9xx_evk_mcxn947_cpu0.overlay b/samples/subsys/ipc/openamp/boards/mcx_n9xx_evk_mcxn947_cpu0.overlay index ec9bbbc46525..e2acdcdacf8f 100644 --- a/samples/subsys/ipc/openamp/boards/mcx_n9xx_evk_mcxn947_cpu0.overlay +++ b/samples/subsys/ipc/openamp/boards/mcx_n9xx_evk_mcxn947_cpu0.overlay @@ -20,7 +20,7 @@ soc { mailbox0: mailbox@400b2000 { compatible = "nxp,lpc-mailbox"; - reg = <0x400b2000 0xEC>; + reg = <0x400b2000 0xec>; interrupts = <54 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "okay"; diff --git a/samples/subsys/ipc/openamp/boards/mps2_an521_cpu0.overlay b/samples/subsys/ipc/openamp/boards/mps2_an521_cpu0.overlay index ea8b8d6a0c71..3e50ce23c8b1 100644 --- a/samples/subsys/ipc/openamp/boards/mps2_an521_cpu0.overlay +++ b/samples/subsys/ipc/openamp/boards/mps2_an521_cpu0.overlay @@ -13,8 +13,8 @@ zephyr,ipc = &mhu0; }; - sramx: memory@281F8000 { + sramx: memory@281f8000 { compatible = "mmio-sram"; - reg = <0x281F8000 0x8000>; + reg = <0x281f8000 0x8000>; }; }; diff --git a/samples/subsys/ipc/openamp/remote/boards/frdm_mcxn947_mcxn947_cpu1.overlay b/samples/subsys/ipc/openamp/remote/boards/frdm_mcxn947_mcxn947_cpu1.overlay index ec9bbbc46525..e2acdcdacf8f 100644 --- a/samples/subsys/ipc/openamp/remote/boards/frdm_mcxn947_mcxn947_cpu1.overlay +++ b/samples/subsys/ipc/openamp/remote/boards/frdm_mcxn947_mcxn947_cpu1.overlay @@ -20,7 +20,7 @@ soc { mailbox0: mailbox@400b2000 { compatible = "nxp,lpc-mailbox"; - reg = <0x400b2000 0xEC>; + reg = <0x400b2000 0xec>; interrupts = <54 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "okay"; diff --git a/samples/subsys/ipc/openamp/remote/boards/mcx_n9xx_evk_mcxn947_cpu1.overlay b/samples/subsys/ipc/openamp/remote/boards/mcx_n9xx_evk_mcxn947_cpu1.overlay index ec9bbbc46525..e2acdcdacf8f 100644 --- a/samples/subsys/ipc/openamp/remote/boards/mcx_n9xx_evk_mcxn947_cpu1.overlay +++ b/samples/subsys/ipc/openamp/remote/boards/mcx_n9xx_evk_mcxn947_cpu1.overlay @@ -20,7 +20,7 @@ soc { mailbox0: mailbox@400b2000 { compatible = "nxp,lpc-mailbox"; - reg = <0x400b2000 0xEC>; + reg = <0x400b2000 0xec>; interrupts = <54 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "okay"; diff --git a/samples/subsys/ipc/openamp/remote/boards/mps2_an521_cpu1.overlay b/samples/subsys/ipc/openamp/remote/boards/mps2_an521_cpu1.overlay index ea8b8d6a0c71..3e50ce23c8b1 100644 --- a/samples/subsys/ipc/openamp/remote/boards/mps2_an521_cpu1.overlay +++ b/samples/subsys/ipc/openamp/remote/boards/mps2_an521_cpu1.overlay @@ -13,8 +13,8 @@ zephyr,ipc = &mhu0; }; - sramx: memory@281F8000 { + sramx: memory@281f8000 { compatible = "mmio-sram"; - reg = <0x281F8000 0x8000>; + reg = <0x281f8000 0x8000>; }; }; diff --git a/samples/subsys/ipc/rpmsg_service/boards/mps2_an521_cpu0.overlay b/samples/subsys/ipc/rpmsg_service/boards/mps2_an521_cpu0.overlay index ea8b8d6a0c71..3e50ce23c8b1 100644 --- a/samples/subsys/ipc/rpmsg_service/boards/mps2_an521_cpu0.overlay +++ b/samples/subsys/ipc/rpmsg_service/boards/mps2_an521_cpu0.overlay @@ -13,8 +13,8 @@ zephyr,ipc = &mhu0; }; - sramx: memory@281F8000 { + sramx: memory@281f8000 { compatible = "mmio-sram"; - reg = <0x281F8000 0x8000>; + reg = <0x281f8000 0x8000>; }; }; diff --git a/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_cpu1.overlay b/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_cpu1.overlay index 64ee92afb990..0b332033d2e6 100644 --- a/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_cpu1.overlay +++ b/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_cpu1.overlay @@ -13,8 +13,8 @@ zephyr,ipc = &mhu0; }; - sramx: memory@281F8000 { + sramx: memory@281f8000 { compatible = "mmio-sram"; - reg = <0x281F8000 0x8000>; + reg = <0x281f8000 0x8000>; }; }; diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/boards/mimxrt1050_evk_hyperflash_ram_load.overlay b/samples/subsys/mgmt/mcumgr/smp_svr/boards/mimxrt1050_evk_hyperflash_ram_load.overlay index 7e78f22e078c..81d3a3e23ebc 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/boards/mimxrt1050_evk_hyperflash_ram_load.overlay +++ b/samples/subsys/mgmt/mcumgr/smp_svr/boards/mimxrt1050_evk_hyperflash_ram_load.overlay @@ -12,9 +12,9 @@ /delete-node/ &sdram0; / { - sram@80007F00 { + sram@80007f00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x80007F00 0x100>; + reg = <0x80007f00 0x100>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/boards/nrf52840dk_nrf52840_ram_load.overlay b/samples/subsys/mgmt/mcumgr/smp_svr/boards/nrf52840dk_nrf52840_ram_load.overlay index aefc7bf148f6..8607c157de60 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/boards/nrf52840dk_nrf52840_ram_load.overlay +++ b/samples/subsys/mgmt/mcumgr/smp_svr/boards/nrf52840dk_nrf52840_ram_load.overlay @@ -10,9 +10,9 @@ }; / { - sram@2003FC00 { + sram@2003fc00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003FC00 DT_SIZE_K(1)>; + reg = <0x2003fc00 DT_SIZE_K(1)>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/samples/subsys/usb/legacy/audio_headphones_microphone/app.overlay b/samples/subsys/usb/legacy/audio_headphones_microphone/app.overlay index f8c62efb775d..2f743ffd6851 100644 --- a/samples/subsys/usb/legacy/audio_headphones_microphone/app.overlay +++ b/samples/subsys/usb/legacy/audio_headphones_microphone/app.overlay @@ -13,7 +13,7 @@ feature-volume; volume-max = <0x0500>; - volume-min = <0xBA00>; + volume-min = <0xba00>; volume-res = <0x100>; }; diff --git a/samples/subsys/usb/legacy/audio_headset/app.overlay b/samples/subsys/usb/legacy/audio_headset/app.overlay index 91c153cd13ba..a411f1cf7d16 100644 --- a/samples/subsys/usb/legacy/audio_headset/app.overlay +++ b/samples/subsys/usb/legacy/audio_headset/app.overlay @@ -17,7 +17,7 @@ hp-feature-volume; volume-max = <0x0500>; - volume-min = <0xBA00>; + volume-min = <0xba00>; volume-res = <0x100>; }; }; diff --git a/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay b/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay index 1e481042ddf8..2760c3f22ca8 100644 --- a/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay +++ b/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay @@ -49,7 +49,7 @@ */ storage_partition: partition@77000 { label = "storage"; - reg = <0x0007F000 DT_SIZE_K(40)>; + reg = <0x0007f000 DT_SIZE_K(40)>; }; }; }; diff --git a/scripts/dts/python-devicetree/tests/test.dts b/scripts/dts/python-devicetree/tests/test.dts index 7a3ab8eb631e..0a6b5ecfbc13 100644 --- a/scripts/dts/python-devicetree/tests/test.dts +++ b/scripts/dts/python-devicetree/tests/test.dts @@ -159,7 +159,7 @@ nexus { #interrupt-cells = <2>; interrupt-map = <6 6 6 6 &{/interrupt-map-bitops-test/controller} 2 1>; - interrupt-map-mask = <0xE 0x7 0xE 0x7>; + interrupt-map-mask = <0xe 0x7 0xe 0x7>; // Not specified in the DT spec., but shows up due to // common code with GPIO. Might as well test it here. interrupt-map-pass-thru = <1 2 3 3>; @@ -168,10 +168,10 @@ // Child unit specifier: 00000007 0000000E 00000007 0000000E // Mask: 0000000E 00000007 0000000E 00000007 // Pass-thru: 00000001 00000002 00000003 00000003 - node@70000000E { - reg = <0x7 0xE>; + node@70000000e { + reg = <0x7 0xe>; interrupt-parent = <&{/interrupt-map-bitops-test/nexus}>; - interrupts = <0x7 0xE>; + interrupts = <0x7 0xe>; }; }; @@ -197,9 +197,9 @@ #address-cells = <1>; #size-cells = <0>; - ranges = <0xA>, - <0x1A>, - <0x2A>; + ranges = <0xa>, + <0x1a>, + <0x2a>; }; }; @@ -210,9 +210,9 @@ reg = <1>; #address-cells = <1>; - ranges = <0xA 0xB>, - <0x1A 0x1B>, - <0x2A 0x2B>; + ranges = <0xa 0xb>, + <0x1a 0x1b>, + <0x2a 0x2b>; }; }; @@ -224,9 +224,9 @@ #address-cells = <1>; #size-cells = <2>; - ranges = <0xA 0xB 0xC>, - <0x1A 0x1B 0x1C>, - <0x2A 0x2B 0x2C>; + ranges = <0xa 0xb 0xc>, + <0x1a 0x1b 0x1c>, + <0x2a 0x2b 0x2c>; }; }; @@ -236,9 +236,9 @@ node@1 { reg = <1 2>; - ranges = <0xA 0xB 0xC 0xD>, - <0x1A 0x1B 0x1C 0x1D>, - <0x2A 0x2B 0x2C 0x2D>; + ranges = <0xa 0xb 0xc 0xd>, + <0x1a 0x1b 0x1c 0x1d>, + <0x2a 0x2b 0x2c 0x2d>; }; }; @@ -249,9 +249,9 @@ reg = <1 2>; #size-cells = <2>; - ranges = <0xA 0xB 0xC 0xD 0xE>, - <0x1A 0x1B 0x1C 0x1D 0x1E>, - <0x2A 0x2B 0x2C 0x2D 0x1D>; + ranges = <0xa 0xb 0xc 0xd 0xe>, + <0x1a 0x1b 0x1c 0x1d 0x1e>, + <0x2a 0x2b 0x2c 0x2d 0x1d>; }; }; @@ -260,9 +260,9 @@ reg = <0 1 2>; #address-cells = <3>; - ranges = <0xA 0xB 0xC 0xD 0xE 0xF>, - <0x1A 0x1B 0x1C 0x1D 0x1E 0x1F>, - <0x2A 0x2B 0x2C 0x2D 0x2E 0x2F>; + ranges = <0xa 0xb 0xc 0xd 0xe 0xf>, + <0x1a 0x1b 0x1c 0x1d 0x1e 0x1f>, + <0x2a 0x2b 0x2c 0x2d 0x2e 0x2f>; }; }; @@ -272,9 +272,9 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0xA 0xB 0xC 0xD 0xE 0xF 0x10>, - <0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x110>, - <0x2A 0x2B 0x2C 0x2D 0x2E 0x2F 0x210>; + ranges = <0xa 0xb 0xc 0xd 0xe 0xf 0x10>, + <0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x110>, + <0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x210>; }; }; @@ -307,9 +307,9 @@ parent { #address-cells = <1>; - ranges = <1 0xA 0xB 1 /* 1 -> 0xA 0xB */ - 2 0xC 0xD 2 /* 2..3 -> 0xC 0xD */ - 4 0xE 0xF 1 /* 4 -> 0xE 0xF */ >; + ranges = <1 0xa 0xb 1 /* 1 -> 0xA 0xB */ + 2 0xc 0xd 2 /* 2..3 -> 0xC 0xD */ + 4 0xe 0xf 1 /* 4 -> 0xE 0xF */ >; node { reg = <5 1 /* Matches no range */ diff --git a/tests/application_development/ram_context_for_isr/app.overlay b/tests/application_development/ram_context_for_isr/app.overlay index 15899c033044..8d4a9e8af331 100644 --- a/tests/application_development/ram_context_for_isr/app.overlay +++ b/tests/application_development/ram_context_for_isr/app.overlay @@ -8,9 +8,9 @@ #address-cells = <1>; #size-cells = <1>; - fakedriver: fakedriver@E0000000 { + fakedriver: fakedriver@e0000000 { compatible = "fakedriver"; - reg = <0xE0000000 0x2000>; + reg = <0xe0000000 0x2000>; zephyr,mutable; status = "okay"; }; diff --git a/tests/arch/arm/arm_thread_swap_tz/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay b/tests/arch/arm/arm_thread_swap_tz/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay index 6bab3bd65501..35b2bd51887f 100644 --- a/tests/arch/arm/arm_thread_swap_tz/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay +++ b/tests/arch/arm/arm_thread_swap_tz/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay @@ -45,9 +45,9 @@ * The flash starting at 0x7F000 and ending at * 0x80000 is reserved for the application. */ - storage_partition: partition@7F000 { + storage_partition: partition@7f000 { label = "storage"; - reg = <0x0007F000 DT_SIZE_K(4)>; + reg = <0x0007f000 DT_SIZE_K(4)>; }; }; }; diff --git a/tests/boot/mcuboot_data_sharing/boards/nrf52840dk_nrf52840.overlay b/tests/boot/mcuboot_data_sharing/boards/nrf52840dk_nrf52840.overlay index a78f393b9ff3..307d2b890fb0 100644 --- a/tests/boot/mcuboot_data_sharing/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boot/mcuboot_data_sharing/boards/nrf52840dk_nrf52840.overlay @@ -5,9 +5,9 @@ /delete-property/ zephyr,boot-mode; }; - sram@2003FC00 { + sram@2003fc00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003FC00 DT_SIZE_K(1)>; + reg = <0x2003fc00 DT_SIZE_K(1)>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/boot/mcuboot_recovery_retention/boards/nrf52840dk_nrf52840_mem.overlay b/tests/boot/mcuboot_recovery_retention/boards/nrf52840dk_nrf52840_mem.overlay index c7bd352f67f0..a61ee5db8746 100644 --- a/tests/boot/mcuboot_recovery_retention/boards/nrf52840dk_nrf52840_mem.overlay +++ b/tests/boot/mcuboot_recovery_retention/boards/nrf52840dk_nrf52840_mem.overlay @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ / { - sram@2003FC00 { + sram@2003fc00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003FC00 DT_SIZE_K(1)>; + reg = <0x2003fc00 DT_SIZE_K(1)>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts index 8ae80025ee18..4df61070c6c9 100644 --- a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts +++ b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts @@ -75,12 +75,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000C000>; + reg = <0x00000000 0x0000c000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00069000>; + reg = <0x0000c000 0x00069000>; }; slot1_partition: partition@75000 { diff --git a/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.overlay b/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.overlay index 93dc828c7a03..a8f628978210 100644 --- a/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.overlay +++ b/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.overlay @@ -10,7 +10,7 @@ dac-vref-source = "VIN2"; dac-value = <31>; filter-count = <0x3>; - filter-period = <0xF>; + filter-period = <0xf>; hysteresis-mode = "LEVEL2"; enable-high-speed-mode; invert-output; diff --git a/tests/drivers/build_all/dac/app.overlay b/tests/drivers/build_all/dac/app.overlay index 03fc52b3e4ec..7f3ab6fb9c8f 100644 --- a/tests/drivers/build_all/dac/app.overlay +++ b/tests/drivers/build_all/dac/app.overlay @@ -231,7 +231,7 @@ test_spi_ad5676: ad5676@a { compatible = "adi,ad5676"; - reg = <0xA>; + reg = <0xa>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -239,7 +239,7 @@ test_spi_ad5679: ad5679@b { compatible = "adi,ad5679"; - reg = <0xB>; + reg = <0xb>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -247,7 +247,7 @@ test_spi_ad5684: ad5684@c { compatible = "adi,ad5684"; - reg = <0xC>; + reg = <0xc>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -255,7 +255,7 @@ test_spi_ad5686: ad5686@d { compatible = "adi,ad5686"; - reg = <0xD>; + reg = <0xd>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -263,7 +263,7 @@ test_spi_ad5687: ad5687@e { compatible = "adi,ad5687"; - reg = <0xE>; + reg = <0xe>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -271,7 +271,7 @@ test_spi_ad5689: ad5689@f { compatible = "adi,ad5689"; - reg = <0xF>; + reg = <0xf>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; diff --git a/tests/drivers/build_all/display/app.overlay b/tests/drivers/build_all/display/app.overlay index f87b736713d4..60e11d085049 100644 --- a/tests/drivers/build_all/display/app.overlay +++ b/tests/drivers/build_all/display/app.overlay @@ -53,8 +53,8 @@ /* Use dummy values for PCG and NGC, * As this won't drive a real panel */ - pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31]; - ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32]; + pgc = [f0 06 0b 07 06 05 2e 33 47 3a 17 16 2e 31]; + ngc = [f0 09 0d 09 08 23 2e 33 46 38 13 13 2c 32]; }; test_mipi_dbi_st7735r: st7735t@2 { @@ -65,8 +65,8 @@ /* Arbitrary values */ x-offset = <0>; y-offset = <0>; - gamctrp1 = [10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10]; - gamctrn1 = [10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10]; + gamctrp1 = [10 0e 02 03 0e 07 02 07 0a 12 27 37 00 0d 0e 10]; + gamctrn1 = [10 0e 03 03 0f 06 02 08 0a 13 26 36 00 0d 0e 10]; width = <160>; height = <128>; }; @@ -94,7 +94,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 E0]; + ram-param = [00 e0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; @@ -328,7 +328,7 @@ vsl = [19 19 19 19]; vshn = [41 41 41 41]; vsln = [19 19 19 19]; - osc-settings = <0xA6>; + osc-settings = <0xa6>; framerate = <0x5>; multiplex-ratio = <0x64>; source-voltage = <0x0>; @@ -470,8 +470,8 @@ data-lanes = <2>; pixel-format = <0>; rotation = <0>; - pvgamctrl = [00 10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10]; - nvgamctrl = [00 10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10]; + pvgamctrl = [00 10 0e 02 03 0e 07 02 07 0a 12 27 37 00 0d 0e 10]; + nvgamctrl = [00 10 0e 03 03 0f 06 02 08 0a 13 26 36 00 0d 0e 10]; display-timings { compatible = "zephyr,panel-timing"; diff --git a/tests/drivers/build_all/ethernet/spi_devices.overlay b/tests/drivers/build_all/ethernet/spi_devices.overlay index 4305dbb8a809..1d0f6944b790 100644 --- a/tests/drivers/build_all/ethernet/spi_devices.overlay +++ b/tests/drivers/build_all/ethernet/spi_devices.overlay @@ -73,7 +73,7 @@ reset-gpios = <&test_gpio 0 0>; port1 { - local-mac-address = [CA 2F B7 10 23 63]; + local-mac-address = [ca 2f b7 10 23 63]; }; mdio { @@ -98,11 +98,11 @@ reset-gpios = <&test_gpio 0 0>; port1 { - local-mac-address = [CA 2F B7 10 23 63]; + local-mac-address = [ca 2f b7 10 23 63]; }; port2 { - local-mac-address = [3C 82 D4 A2 29 8E]; + local-mac-address = [3c 82 d4 a2 29 8e]; }; mdio { diff --git a/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay index 4e1ee5de62cb..63903dbc6017 100644 --- a/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ b/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -5,8 +5,8 @@ */ &cpuflpr_rram { - reg = <0x15D000 DT_SIZE_K(128)>; - ranges = <0x0 0x15D000 DT_SIZE_K(128)>; + reg = <0x15d000 DT_SIZE_K(128)>; + ranges = <0x0 0x15d000 DT_SIZE_K(128)>; }; &cpuflpr_code_partition { diff --git a/tests/drivers/build_all/i2c/boards/qemu_cortex_m3.overlay b/tests/drivers/build_all/i2c/boards/qemu_cortex_m3.overlay index 6060194486ce..72a6f8354252 100644 --- a/tests/drivers/build_all/i2c/boards/qemu_cortex_m3.overlay +++ b/tests/drivers/build_all/i2c/boards/qemu_cortex_m3.overlay @@ -25,12 +25,12 @@ interrupts = <5 1>; }; - i2c2: i2c@888A8888 { + i2c2: i2c@888a8888 { compatible = "brcm,iproc-i2c"; clock-frequency = ; #address-cells = <1>; #size-cells = <0>; - reg = <0x888A8888 0x100>; + reg = <0x888a8888 0x100>; interrupt-parent = <&nvic>; interrupts = <6 1>; }; diff --git a/tests/drivers/build_all/sensor/i2c.dtsi b/tests/drivers/build_all/sensor/i2c.dtsi index 5c47fbf01d01..28af7470cf43 100644 --- a/tests/drivers/build_all/sensor/i2c.dtsi +++ b/tests/drivers/build_all/sensor/i2c.dtsi @@ -788,7 +788,7 @@ test_i2c_bmi08x_accel: bmi08x@6d { int-gpios = <&test_gpio 0 0>; int1-map-io = <0x01>; int2-map-io = <0x00>; - int1-conf-io = <0x0A>; + int1-conf-io = <0x0a>; int2-conf-io = <0x17>; accel-hz = "800"; accel-fs = <4>; diff --git a/tests/drivers/build_all/sensor/i3c.dtsi b/tests/drivers/build_all/sensor/i3c.dtsi index 7118f1d4b717..cfd41e820d32 100644 --- a/tests/drivers/build_all/sensor/i3c.dtsi +++ b/tests/drivers/build_all/sensor/i3c.dtsi @@ -11,36 +11,36 @@ ************************************** */ -test_i3c_lps22hh: lps22hh@100000803E0000001 { +test_i3c_lps22hh: lps22hh@100000803e0000001 { compatible = "st,lps22hh"; - reg = <0x1 0x00000803 0xE0000001>; + reg = <0x1 0x00000803 0xe0000001>; assigned-address = <0x1>; drdy-gpios = <&test_gpio 0 0>; }; -test_i3c_lps22df: lps22df@200000803E0000002 { +test_i3c_lps22df: lps22df@200000803e0000002 { compatible = "st,lps22df"; - reg = <0x2 0x00000803 0xE0000002>; + reg = <0x2 0x00000803 0xe0000002>; assigned-address = <0x2>; drdy-gpios = <&test_gpio 0 0>; }; -test_i3c_lps28dfw: lps28dfw@300000803E0000003 { +test_i3c_lps28dfw: lps28dfw@300000803e0000003 { compatible = "st,lps28dfw"; - reg = <0x3 0x00000803 0xE0000003>; + reg = <0x3 0x00000803 0xe0000003>; assigned-address = <0x3>; drdy-gpios = <&test_gpio 0 0>; }; -test_i3c_ilps22qs: ilps22qs@400000803E0000004 { +test_i3c_ilps22qs: ilps22qs@400000803e0000004 { compatible = "st,ilps22qs"; - reg = <0x3 0x00000803 0xE0000004>; + reg = <0x3 0x00000803 0xe0000004>; assigned-address = <0x4>; }; -test_i3c_lsm6dsv16x: lsm6dsv16x@500000803E0000004 { +test_i3c_lsm6dsv16x: lsm6dsv16x@500000803e0000004 { compatible = "st,lsm6dsv16x"; - reg = <0x5 0x00000803 0xE0000004>; + reg = <0x5 0x00000803 0xe0000004>; assigned-address = <0x5>; int1-gpios = <&test_gpio 0 0>; int2-gpios = <&test_gpio 0 0>; @@ -50,9 +50,9 @@ test_i3c_lsm6dsv16x: lsm6dsv16x@500000803E0000004 { gyro-odr = ; }; -test_i3c_lsm6dsv32x: lsm6dsv32x@600000803E0000004 { +test_i3c_lsm6dsv32x: lsm6dsv32x@600000803e0000004 { compatible = "st,lsm6dsv32x"; - reg = <0x6 0x00000803 0xE0000004>; + reg = <0x6 0x00000803 0xe0000004>; assigned-address = <0x6>; int1-gpios = <&test_gpio 0 0>; int2-gpios = <&test_gpio 0 0>; @@ -62,9 +62,9 @@ test_i3c_lsm6dsv32x: lsm6dsv32x@600000803E0000004 { gyro-odr = ; }; -test_i3c_icm45686: icm45686@700000803E0000004 { +test_i3c_icm45686: icm45686@700000803e0000004 { compatible = "invensense,icm45686"; - reg = <0x7 0x00000803 0xE0000004>; + reg = <0x7 0x00000803 0xe0000004>; assigned-address = <0x7>; int-gpios = <&test_gpio 0 0>; }; diff --git a/tests/drivers/build_all/sensor/spi.dtsi b/tests/drivers/build_all/sensor/spi.dtsi index 2f22e7a09f17..6dc2b6f0c91e 100644 --- a/tests/drivers/build_all/sensor/spi.dtsi +++ b/tests/drivers/build_all/sensor/spi.dtsi @@ -273,7 +273,7 @@ test_spi_bmi08x_accel: bmi08x@23 { int-gpios = <&test_gpio 0 0>; int1-map-io = <0x01>; int2-map-io = <0x00>; - int1-conf-io = <0x0A>; + int1-conf-io = <0x0a>; int2-conf-io = <0x17>; accel-hz = "800"; accel-fs = <4>; diff --git a/tests/drivers/charger/sbs_charger/boards/emulated_board.overlay b/tests/drivers/charger/sbs_charger/boards/emulated_board.overlay index 6d3279753673..becd3eceb54e 100644 --- a/tests/drivers/charger/sbs_charger/boards/emulated_board.overlay +++ b/tests/drivers/charger/sbs_charger/boards/emulated_board.overlay @@ -23,7 +23,7 @@ smartcharger0: smartcharger@b { compatible = "sbs,sbs-charger"; - reg = <0x0B>; + reg = <0x0b>; status = "okay"; }; }; diff --git a/tests/drivers/charger/sbs_charger/boards/qemu_cortex_a53.overlay b/tests/drivers/charger/sbs_charger/boards/qemu_cortex_a53.overlay index 05bec8d88b58..fe22ab8793b0 100644 --- a/tests/drivers/charger/sbs_charger/boards/qemu_cortex_a53.overlay +++ b/tests/drivers/charger/sbs_charger/boards/qemu_cortex_a53.overlay @@ -27,7 +27,7 @@ smartcharger0: smartcharger@b { compatible = "sbs,sbs-charger"; - reg = <0x0B>; + reg = <0x0b>; status = "okay"; }; }; diff --git a/tests/drivers/coredump/coredump_api/boards/qemu_riscv32.overlay b/tests/drivers/coredump/coredump_api/boards/qemu_riscv32.overlay index 696e941f55e7..c410cc992e5e 100644 --- a/tests/drivers/coredump/coredump_api/boards/qemu_riscv32.overlay +++ b/tests/drivers/coredump/coredump_api/boards/qemu_riscv32.overlay @@ -19,7 +19,7 @@ coredump-type = "COREDUMP_TYPE_MEMCPY"; status = "okay"; - memory-regions = <0x86000000 0xC>; + memory-regions = <0x86000000 0xc>; }; coredump_devicecb: coredump-device-cb { diff --git a/tests/drivers/disk/disk_access/boards/intel_btl_s_crb.overlay b/tests/drivers/disk/disk_access/boards/intel_btl_s_crb.overlay index f6e8f28f0856..cc2daa2cdb08 100644 --- a/tests/drivers/disk/disk_access/boards/intel_btl_s_crb.overlay +++ b/tests/drivers/disk/disk_access/boards/intel_btl_s_crb.overlay @@ -9,7 +9,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1B36>; /* Subjected to change base on Hardware used */ + vendor-id = <0x1b36>; /* Subjected to change base on Hardware used */ device-id = <0x0010>; /* Subjected to change base on Hardware used */ status = "okay"; diff --git a/tests/drivers/disk/disk_access/boards/intel_ptl_h_crb.overlay b/tests/drivers/disk/disk_access/boards/intel_ptl_h_crb.overlay index ae455bdffbb3..ff3415c7b16d 100644 --- a/tests/drivers/disk/disk_access/boards/intel_ptl_h_crb.overlay +++ b/tests/drivers/disk/disk_access/boards/intel_ptl_h_crb.overlay @@ -9,7 +9,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1B36>; /* Subject to change based on hardware used */ + vendor-id = <0x1b36>; /* Subject to change based on hardware used */ device-id = <0x0010>; /* Subject to change based on hardware used */ status = "okay"; diff --git a/tests/drivers/disk/disk_access/boards/qemu_x86_64.overlay b/tests/drivers/disk/disk_access/boards/qemu_x86_64.overlay index 85b9b28246fe..e5aecf7458ea 100644 --- a/tests/drivers/disk/disk_access/boards/qemu_x86_64.overlay +++ b/tests/drivers/disk/disk_access/boards/qemu_x86_64.overlay @@ -7,7 +7,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1B36>; + vendor-id = <0x1b36>; device-id = <0x0010>; status = "okay"; diff --git a/tests/drivers/disk/disk_performance/boards/intel_btl_s_crb.overlay b/tests/drivers/disk/disk_performance/boards/intel_btl_s_crb.overlay index f6e8f28f0856..cc2daa2cdb08 100644 --- a/tests/drivers/disk/disk_performance/boards/intel_btl_s_crb.overlay +++ b/tests/drivers/disk/disk_performance/boards/intel_btl_s_crb.overlay @@ -9,7 +9,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1B36>; /* Subjected to change base on Hardware used */ + vendor-id = <0x1b36>; /* Subjected to change base on Hardware used */ device-id = <0x0010>; /* Subjected to change base on Hardware used */ status = "okay"; diff --git a/tests/drivers/disk/disk_performance/boards/qemu_x86_64.overlay b/tests/drivers/disk/disk_performance/boards/qemu_x86_64.overlay index 037b2528d8ce..e2826b326b40 100644 --- a/tests/drivers/disk/disk_performance/boards/qemu_x86_64.overlay +++ b/tests/drivers/disk/disk_performance/boards/qemu_x86_64.overlay @@ -7,7 +7,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1B36>; + vendor-id = <0x1b36>; device-id = <0x0010>; status = "okay"; diff --git a/tests/drivers/flash/common/boards/ek_ra6m2.overlay b/tests/drivers/flash/common/boards/ek_ra6m2.overlay index a910732a53a2..6d224ad7c879 100644 --- a/tests/drivers/flash/common/boards/ek_ra6m2.overlay +++ b/tests/drivers/flash/common/boards/ek_ra6m2.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@F0000 { + storage_partition: partition@f0000 { label = "storage"; - reg = <0xF0000 DT_SIZE_K(64)>; + reg = <0xf0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra6m3.overlay b/tests/drivers/flash/common/boards/ek_ra6m3.overlay index 5692054a716b..8d2004a383b9 100644 --- a/tests/drivers/flash/common/boards/ek_ra6m3.overlay +++ b/tests/drivers/flash/common/boards/ek_ra6m3.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@1F0000 { + storage_partition: partition@1f0000 { label = "storage"; - reg = <0x1F0000 DT_SIZE_K(64)>; + reg = <0x1f0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra6m4.overlay b/tests/drivers/flash/common/boards/ek_ra6m4.overlay index cc09229e41e2..749b350261c6 100644 --- a/tests/drivers/flash/common/boards/ek_ra6m4.overlay +++ b/tests/drivers/flash/common/boards/ek_ra6m4.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@F0000 { + storage_partition: partition@f0000 { label = "storage"; - reg = <0xF0000 DT_SIZE_K(64)>; + reg = <0xf0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra6m5.overlay b/tests/drivers/flash/common/boards/ek_ra6m5.overlay index 8d36cc7d2caa..f168086c7aec 100644 --- a/tests/drivers/flash/common/boards/ek_ra6m5.overlay +++ b/tests/drivers/flash/common/boards/ek_ra6m5.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@1F0000 { + storage_partition: partition@1f0000 { label = "storage"; - reg = <0x1F0000 DT_SIZE_K(64)>; + reg = <0x1f0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra8d1.overlay b/tests/drivers/flash/common/boards/ek_ra8d1.overlay index ee45617b0097..460286808cb4 100644 --- a/tests/drivers/flash/common/boards/ek_ra8d1.overlay +++ b/tests/drivers/flash/common/boards/ek_ra8d1.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set the 2 last block of storage. */ - storage_partition: partition@1E8000 { + storage_partition: partition@1e8000 { label = "storage"; - reg = <0x1E8000 DT_SIZE_K(64)>; + reg = <0x1e8000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra8m1.overlay b/tests/drivers/flash/common/boards/ek_ra8m1.overlay index ee45617b0097..460286808cb4 100644 --- a/tests/drivers/flash/common/boards/ek_ra8m1.overlay +++ b/tests/drivers/flash/common/boards/ek_ra8m1.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set the 2 last block of storage. */ - storage_partition: partition@1E8000 { + storage_partition: partition@1e8000 { label = "storage"; - reg = <0x1E8000 DT_SIZE_K(64)>; + reg = <0x1e8000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/fpb_ra6e1.overlay b/tests/drivers/flash/common/boards/fpb_ra6e1.overlay index a910732a53a2..6d224ad7c879 100644 --- a/tests/drivers/flash/common/boards/fpb_ra6e1.overlay +++ b/tests/drivers/flash/common/boards/fpb_ra6e1.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@F0000 { + storage_partition: partition@f0000 { label = "storage"; - reg = <0xF0000 DT_SIZE_K(64)>; + reg = <0xf0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/mck_ra8t1.overlay b/tests/drivers/flash/common/boards/mck_ra8t1.overlay index 8e42c66387c7..b56f8c5af307 100644 --- a/tests/drivers/flash/common/boards/mck_ra8t1.overlay +++ b/tests/drivers/flash/common/boards/mck_ra8t1.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set the 2 last block of storage. */ - storage_partition: partition@1E8000 { + storage_partition: partition@1e8000 { label = "storage"; - reg = <0x1E8000 DT_SIZE_K(64)>; + reg = <0x1e8000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/nrf52840dk_mx25l51245g.overlay b/tests/drivers/flash/common/boards/nrf52840dk_mx25l51245g.overlay index 4b38cce55071..47f2cbe5130b 100644 --- a/tests/drivers/flash/common/boards/nrf52840dk_mx25l51245g.overlay +++ b/tests/drivers/flash/common/boards/nrf52840dk_mx25l51245g.overlay @@ -49,7 +49,7 @@ /* MX25L5145G supports all readoc options */ readoc = "read4io"; sck-frequency = <2000000>; - jedec-id = [c2 20 1A]; + jedec-id = [c2 20 1a]; sfdp-bfp = [e5 20 fb ff 1f ff ff ff 44 eb 08 6b 08 3b 04 bb fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 10 d8 00 ff d6 49 c5 00 81 df 04 e3 44 03 67 38 diff --git a/tests/drivers/flash/common/boards/nrf52840dk_spi_nor.overlay b/tests/drivers/flash/common/boards/nrf52840dk_spi_nor.overlay index 1658c1dab59c..87e571300114 100644 --- a/tests/drivers/flash/common/boards/nrf52840dk_spi_nor.overlay +++ b/tests/drivers/flash/common/boards/nrf52840dk_spi_nor.overlay @@ -44,7 +44,7 @@ has-dpd; t-enter-dpd = <10000>; t-exit-dpd = <45000>; - jedec-id = [C2 23 15]; + jedec-id = [c2 23 15]; sfdp-bfp = [e5 20 f1 ff ff ff ff 00 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 f1 00 82 ec 04 c2 44 83 48 44 diff --git a/tests/drivers/flash/common/boards/nrf52840dk_spi_nor_wp_hold.overlay b/tests/drivers/flash/common/boards/nrf52840dk_spi_nor_wp_hold.overlay index bb876888320f..c5bc85174e97 100644 --- a/tests/drivers/flash/common/boards/nrf52840dk_spi_nor_wp_hold.overlay +++ b/tests/drivers/flash/common/boards/nrf52840dk_spi_nor_wp_hold.overlay @@ -46,7 +46,7 @@ has-dpd; t-enter-dpd = <10000>; t-exit-dpd = <45000>; - jedec-id = [C2 23 15]; + jedec-id = [c2 23 15]; sfdp-bfp = [e5 20 f1 ff ff ff ff 00 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 f1 00 82 ec 04 c2 44 83 48 44 diff --git a/tests/drivers/flash_simulator/flash_sim_impl/boards/nucleo_f411re.overlay b/tests/drivers/flash_simulator/flash_sim_impl/boards/nucleo_f411re.overlay index d8b0071c94c0..6c3b163298a2 100644 --- a/tests/drivers/flash_simulator/flash_sim_impl/boards/nucleo_f411re.overlay +++ b/tests/drivers/flash_simulator/flash_sim_impl/boards/nucleo_f411re.overlay @@ -5,9 +5,9 @@ */ / { - sram_2001C000: sram@2001C000 { + sram_2001C000: sram@2001c000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2001C000 0x4000>; + reg = <0x2001c000 0x4000>; zephyr,memory-region = "FlashSim"; status = "okay"; }; diff --git a/tests/drivers/flash_simulator/flash_sim_reboot/boards/mps2_an385.overlay b/tests/drivers/flash_simulator/flash_sim_reboot/boards/mps2_an385.overlay index 77623e89347f..59fc8c37271a 100644 --- a/tests/drivers/flash_simulator/flash_sim_reboot/boards/mps2_an385.overlay +++ b/tests/drivers/flash_simulator/flash_sim_reboot/boards/mps2_an385.overlay @@ -1,9 +1,9 @@ #include / { - sram_203F0000: sram@203F0000 { + sram_203F0000: sram@203f0000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x203F0000 0x10000>; + reg = <0x203f0000 0x10000>; zephyr,memory-region = "FlashSim"; status = "okay"; }; diff --git a/tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.overlay b/tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.overlay index 14334b8c3780..27e58000b19b 100644 --- a/tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.overlay +++ b/tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.overlay @@ -23,7 +23,7 @@ smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge-new-api"; - reg = <0x0B>; + reg = <0x0b>; status = "okay"; }; }; diff --git a/tests/drivers/fuel_gauge/sbs_gauge/boards/qemu_cortex_a53.overlay b/tests/drivers/fuel_gauge/sbs_gauge/boards/qemu_cortex_a53.overlay index 8c216c01cd25..f975f6d3af9e 100644 --- a/tests/drivers/fuel_gauge/sbs_gauge/boards/qemu_cortex_a53.overlay +++ b/tests/drivers/fuel_gauge/sbs_gauge/boards/qemu_cortex_a53.overlay @@ -27,7 +27,7 @@ smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge-new-api"; - reg = <0x0B>; + reg = <0x0b>; status = "okay"; }; }; diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay index 59839fa9265b..9845244852c0 100644 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay @@ -5,5 +5,5 @@ */ &gpio1 { - sense-edge-mask = <0xC00>; + sense-edge-mask = <0xc00>; }; diff --git a/tests/drivers/mbox/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay b/tests/drivers/mbox/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay index 56452fc4936b..2da7632140c0 100644 --- a/tests/drivers/mbox/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay +++ b/tests/drivers/mbox/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xEC>; + reg = <0x5008b000 0xec>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/tests/drivers/mbox/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay b/tests/drivers/mbox/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay index eb20ff9a1dd6..4146d6b34a90 100644 --- a/tests/drivers/mbox/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay +++ b/tests/drivers/mbox/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mbox@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xEC>; + reg = <0x5008b000 0xec>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/tests/drivers/mbox/mbox_error_cases/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay b/tests/drivers/mbox/mbox_error_cases/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay index f1e60dfaa6a6..16dab060c56b 100644 --- a/tests/drivers/mbox/mbox_error_cases/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay +++ b/tests/drivers/mbox/mbox_error_cases/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay @@ -14,32 +14,32 @@ #size-cells = <1>; ranges; - openamp_shm: memory-region@62F00000 { + openamp_shm: memory-region@62f00000 { compatible = "zephyr,memory-region"; - reg = <0x62F00000 0x600000>; + reg = <0x62f00000 0x600000>; zephyr,memory-region = "openamp_memory"; zephyr,memory-attr = ; }; }; - mhu1_shm: memory@62F01008 { + mhu1_shm: memory@62f01008 { compatible = "mmio-sram"; - reg = <0x62F01008 0x8>; + reg = <0x62f01008 0x8>; }; - mhu3_shm: memory@62F01018 { + mhu3_shm: memory@62f01018 { compatible = "mmio-sram"; - reg = <0x62F01018 0x8>; + reg = <0x62f01018 0x8>; }; - mhu4_shm: memory@62F01020 { + mhu4_shm: memory@62f01020 { compatible = "mmio-sram"; - reg = <0x62F01020 0x8>; + reg = <0x62f01020 0x8>; }; - mhu5_shm: memory@62F01028 { + mhu5_shm: memory@62f01028 { compatible = "mmio-sram"; - reg = <0x62F01028 0x8>; + reg = <0x62f01028 0x8>; }; mbox-consumer { diff --git a/tests/drivers/mbox/mbox_error_cases/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay b/tests/drivers/mbox/mbox_error_cases/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay index 1f65f3cafc56..7f64051d3fc1 100644 --- a/tests/drivers/mbox/mbox_error_cases/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay +++ b/tests/drivers/mbox/mbox_error_cases/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay @@ -13,32 +13,32 @@ #size-cells = <1>; ranges; - openamp_shm: memory-region@62F00000 { + openamp_shm: memory-region@62f00000 { compatible = "zephyr,memory-region"; - reg = <0x62F00000 0x900000>; + reg = <0x62f00000 0x900000>; zephyr,memory-region = "openamp_memory"; zephyr,memory-attr = ; }; }; - mhu1_shm: memory@62F01008 { + mhu1_shm: memory@62f01008 { compatible = "mmio-sram"; - reg = <0x62F01008 0x8>; + reg = <0x62f01008 0x8>; }; - mhu3_shm: memory@62F01018 { + mhu3_shm: memory@62f01018 { compatible = "mmio-sram"; - reg = <0x62F01018 0x8>; + reg = <0x62f01018 0x8>; }; - mhu4_shm: memory@62F01020 { + mhu4_shm: memory@62f01020 { compatible = "mmio-sram"; - reg = <0x62F01020 0x8>; + reg = <0x62f01020 0x8>; }; - mhu5_shm: memory@62F01028 { + mhu5_shm: memory@62f01028 { compatible = "mmio-sram"; - reg = <0x62F01028 0x8>; + reg = <0x62f01028 0x8>; }; mbox-consumer { diff --git a/tests/drivers/mspi/flash/boards/apollo3p_evb.overlay b/tests/drivers/mspi/flash/boards/apollo3p_evb.overlay index c625137f79e2..eede73ada1df 100644 --- a/tests/drivers/mspi/flash/boards/apollo3p_evb.overlay +++ b/tests/drivers/mspi/flash/boards/apollo3p_evb.overlay @@ -35,7 +35,7 @@ mspi-io-mode = "MSPI_IO_MODE_OCTAL"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0x0B>; + read-command = <0x0b>; write-command = <0x02>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; diff --git a/tests/drivers/mspi/flash/boards/native_sim.overlay b/tests/drivers/mspi/flash/boards/native_sim.overlay index 41544316bc84..9ee245966604 100644 --- a/tests/drivers/mspi/flash/boards/native_sim.overlay +++ b/tests/drivers/mspi/flash/boards/native_sim.overlay @@ -25,7 +25,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0x0B>; + read-command = <0x0b>; write-command = <0x02>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; @@ -44,7 +44,7 @@ mspi-hardware-ce-num = <1>; mspi-dqs-enable; read-command = <0x20>; - write-command = <0xAA>; + write-command = <0xaa>; command-length = "INSTR_2_BYTE"; address-length = "ADDR_3_BYTE"; rx-dummy = <6>; diff --git a/tests/drivers/retained_mem/api/boards/nrf52840dk_nrf52840_ram.overlay b/tests/drivers/retained_mem/api/boards/nrf52840dk_nrf52840_ram.overlay index 0e69d3424568..061e57b5dd52 100644 --- a/tests/drivers/retained_mem/api/boards/nrf52840dk_nrf52840_ram.overlay +++ b/tests/drivers/retained_mem/api/boards/nrf52840dk_nrf52840_ram.overlay @@ -1,7 +1,7 @@ / { - sram@2003FFE0 { + sram@2003ffe0 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003FFE0 0x20>; + reg = <0x2003ffe0 0x20>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/drivers/retained_mem/api/boards/qemu_cortex_m3.overlay b/tests/drivers/retained_mem/api/boards/qemu_cortex_m3.overlay index 32cab58a74f4..27e7d4a0e7ad 100644 --- a/tests/drivers/retained_mem/api/boards/qemu_cortex_m3.overlay +++ b/tests/drivers/retained_mem/api/boards/qemu_cortex_m3.overlay @@ -1,9 +1,9 @@ #include / { - sram@2000FFE0 { + sram@2000ffe0 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000FFE0 0x20>; + reg = <0x2000ffe0 0x20>; zephyr,memory-region = "Retention"; status = "okay"; diff --git a/tests/drivers/sensor/sbs_gauge/boards/native_sim.overlay b/tests/drivers/sensor/sbs_gauge/boards/native_sim.overlay index b28d8b8b3d69..70953bb26be5 100644 --- a/tests/drivers/sensor/sbs_gauge/boards/native_sim.overlay +++ b/tests/drivers/sensor/sbs_gauge/boards/native_sim.overlay @@ -9,7 +9,7 @@ smartbattery: sbs_gauge@b { compatible = "sbs,sbs-gauge"; - reg = <0x0B>; + reg = <0x0b>; status = "okay"; }; }; diff --git a/tests/drivers/sensor/sbs_gauge/boards/nucleo_f070rb.overlay b/tests/drivers/sensor/sbs_gauge/boards/nucleo_f070rb.overlay index c63a3c43cd84..40cfe82e93f8 100644 --- a/tests/drivers/sensor/sbs_gauge/boards/nucleo_f070rb.overlay +++ b/tests/drivers/sensor/sbs_gauge/boards/nucleo_f070rb.overlay @@ -6,11 +6,11 @@ &i2c1 { clock-frequency = ; - timings = <32000000 I2C_BITRATE_STANDARD 0x10E03E52>; + timings = <32000000 I2C_BITRATE_STANDARD 0x10e03e52>; smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge"; - reg = <0x0B>; + reg = <0x0b>; status = "okay"; }; }; diff --git a/tests/drivers/sensor/sbs_gauge/boards/qemu_arc_qemu_arc_hs.overlay b/tests/drivers/sensor/sbs_gauge/boards/qemu_arc_qemu_arc_hs.overlay index 973d682645d0..a0233727329a 100644 --- a/tests/drivers/sensor/sbs_gauge/boards/qemu_arc_qemu_arc_hs.overlay +++ b/tests/drivers/sensor/sbs_gauge/boards/qemu_arc_qemu_arc_hs.overlay @@ -24,7 +24,7 @@ smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge"; - reg = <0x0B>; + reg = <0x0b>; status = "okay"; }; }; diff --git a/tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.overlay b/tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.overlay index 5ccce21056c9..79474c867f02 100644 --- a/tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.overlay +++ b/tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.overlay @@ -24,7 +24,7 @@ smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge"; - reg = <0x0B>; + reg = <0x0b>; status = "okay"; }; }; diff --git a/tests/drivers/uart/uart_async_api/boards/samc21n_xpro.overlay b/tests/drivers/uart/uart_async_api/boards/samc21n_xpro.overlay index 9333f88db6fd..c238f4cd43a5 100644 --- a/tests/drivers/uart/uart_async_api/boards/samc21n_xpro.overlay +++ b/tests/drivers/uart/uart_async_api/boards/samc21n_xpro.overlay @@ -20,6 +20,6 @@ dut: &sercom0 { &sercom4 { /* configure DMA channels for async operation */ - dmas = <&dmac 10 0x0A>, <&dmac 11 0x0B>; + dmas = <&dmac 10 0x0a>, <&dmac 11 0x0b>; dma-names = "rx", "tx"; }; diff --git a/tests/drivers/uart/uart_errors/boards/sam_e54_xpro.overlay b/tests/drivers/uart/uart_errors/boards/sam_e54_xpro.overlay index 75ec055162d9..2cad973a16eb 100644 --- a/tests/drivers/uart/uart_errors/boards/sam_e54_xpro.overlay +++ b/tests/drivers/uart/uart_errors/boards/sam_e54_xpro.overlay @@ -34,7 +34,7 @@ dut_aux: &sercom5 { pinctrl-0 = <&sercom5_uart_default>; pinctrl-names = "default"; - dmas = <&dmac 0x5 0xE>, <&dmac 0x6 0xF>; + dmas = <&dmac 0x5 0xe>, <&dmac 0x6 0xf>; dma-names = "rx", "tx"; }; diff --git a/tests/kernel/device/app.overlay b/tests/kernel/device/app.overlay index 82e59159fd9f..0773813a0137 100644 --- a/tests/kernel/device/app.overlay +++ b/tests/kernel/device/app.overlay @@ -17,62 +17,62 @@ #address-cells = <1>; #size-cells = <1>; - fake_driver_label: fakedriver@E0000000 { + fake_driver_label: fakedriver@e0000000 { compatible = "fakedriver"; - reg = <0xE0000000 0x2000>; + reg = <0xe0000000 0x2000>; status = "okay"; }; - fakedriver@E1000000 { + fakedriver@e1000000 { compatible = "fakedriver"; - reg = <0xE1000000 0x2000>; + reg = <0xe1000000 0x2000>; status = "okay"; }; - fakedriver@E2000000 { + fakedriver@e2000000 { compatible = "fakedriver"; - reg = <0xE2000000 0x2000>; + reg = <0xe2000000 0x2000>; status = "okay"; }; - fakedriver@E3000000 { + fakedriver@e3000000 { compatible = "fakedriver"; - reg = <0xE3000000 0x2000>; + reg = <0xe3000000 0x2000>; status = "okay"; }; - fakedriver@E4000000 { + fakedriver@e4000000 { compatible = "fakedriver"; - reg = <0xE4000000 0x2000>; + reg = <0xe4000000 0x2000>; status = "okay"; }; - fakedriver_multireg@E5000000 { + fakedriver_multireg@e5000000 { compatible = "fakedriver_multireg"; - reg = <0xE5000000 0x1000>, - <0xE6000000 0x1000>; + reg = <0xe5000000 0x1000>, + <0xe6000000 0x1000>; reg-names = "chip", "dale"; status = "okay"; }; - fakedeferdriver@E7000000 { + fakedeferdriver@e7000000 { compatible = "fakedeferdriver"; - reg = <0xE7000000 0x2000>; + reg = <0xe7000000 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@E8000000 { + fakedeferdriver@e8000000 { compatible = "fakedeferdriver"; - reg = <0xE8000000 0x2000>; + reg = <0xe8000000 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@F9000000 { + fakedeferdriver@f9000000 { compatible = "fakedeferdriver"; - reg = <0xF9000000 0x2000>; + reg = <0xf9000000 0x2000>; status = "okay"; zephyr,deferred-init; }; diff --git a/tests/kernel/device/boards/hifive_unmatched_fu740_s7.overlay b/tests/kernel/device/boards/hifive_unmatched_fu740_s7.overlay index d30a5b9af349..ac1655c3b75f 100644 --- a/tests/kernel/device/boards/hifive_unmatched_fu740_s7.overlay +++ b/tests/kernel/device/boards/hifive_unmatched_fu740_s7.overlay @@ -14,62 +14,62 @@ */ / { - fakedriver@E0000000 { + fakedriver@e0000000 { compatible = "fakedriver"; - reg = <0x0 0xE0000000 0x0 0x2000>; + reg = <0x0 0xe0000000 0x0 0x2000>; status = "okay"; }; - fakedriver@E1000000 { + fakedriver@e1000000 { compatible = "fakedriver"; - reg = <0x0 0xE1000000 0x0 0x2000>; + reg = <0x0 0xe1000000 0x0 0x2000>; status = "okay"; }; - fakedriver@E2000000 { + fakedriver@e2000000 { compatible = "fakedriver"; - reg = <0x0 0xE2000000 0x0 0x2000>; + reg = <0x0 0xe2000000 0x0 0x2000>; status = "okay"; }; - fakedriver@E3000000 { + fakedriver@e3000000 { compatible = "fakedriver"; - reg = <0x0 0xE3000000 0x0 0x2000>; + reg = <0x0 0xe3000000 0x0 0x2000>; status = "okay"; }; - fakedriver@E4000000 { + fakedriver@e4000000 { compatible = "fakedriver"; - reg = <0x0 0xE4000000 0x0 0x2000>; + reg = <0x0 0xe4000000 0x0 0x2000>; status = "okay"; }; - fakedriver_multireg@E5000000 { + fakedriver_multireg@e5000000 { compatible = "fakedriver_multireg"; - reg = <0x0 0xE5000000 0x0 0x1000>, - <0x0 0xE6000000 0x0 0x1000>; + reg = <0x0 0xe5000000 0x0 0x1000>, + <0x0 0xe6000000 0x0 0x1000>; reg-names = "chip", "dale"; status = "okay"; }; - fakedeferdriver@E7000000 { + fakedeferdriver@e7000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xE7000000 0x0 0x2000>; + reg = <0x0 0xe7000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@E8000000 { + fakedeferdriver@e8000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xE8000000 0x0 0x2000>; + reg = <0x0 0xe8000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@F9000000 { + fakedeferdriver@f9000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xF9000000 0x0 0x2000>; + reg = <0x0 0xf9000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; diff --git a/tests/kernel/device/boards/hifive_unmatched_fu740_u74.overlay b/tests/kernel/device/boards/hifive_unmatched_fu740_u74.overlay index d30a5b9af349..ac1655c3b75f 100644 --- a/tests/kernel/device/boards/hifive_unmatched_fu740_u74.overlay +++ b/tests/kernel/device/boards/hifive_unmatched_fu740_u74.overlay @@ -14,62 +14,62 @@ */ / { - fakedriver@E0000000 { + fakedriver@e0000000 { compatible = "fakedriver"; - reg = <0x0 0xE0000000 0x0 0x2000>; + reg = <0x0 0xe0000000 0x0 0x2000>; status = "okay"; }; - fakedriver@E1000000 { + fakedriver@e1000000 { compatible = "fakedriver"; - reg = <0x0 0xE1000000 0x0 0x2000>; + reg = <0x0 0xe1000000 0x0 0x2000>; status = "okay"; }; - fakedriver@E2000000 { + fakedriver@e2000000 { compatible = "fakedriver"; - reg = <0x0 0xE2000000 0x0 0x2000>; + reg = <0x0 0xe2000000 0x0 0x2000>; status = "okay"; }; - fakedriver@E3000000 { + fakedriver@e3000000 { compatible = "fakedriver"; - reg = <0x0 0xE3000000 0x0 0x2000>; + reg = <0x0 0xe3000000 0x0 0x2000>; status = "okay"; }; - fakedriver@E4000000 { + fakedriver@e4000000 { compatible = "fakedriver"; - reg = <0x0 0xE4000000 0x0 0x2000>; + reg = <0x0 0xe4000000 0x0 0x2000>; status = "okay"; }; - fakedriver_multireg@E5000000 { + fakedriver_multireg@e5000000 { compatible = "fakedriver_multireg"; - reg = <0x0 0xE5000000 0x0 0x1000>, - <0x0 0xE6000000 0x0 0x1000>; + reg = <0x0 0xe5000000 0x0 0x1000>, + <0x0 0xe6000000 0x0 0x1000>; reg-names = "chip", "dale"; status = "okay"; }; - fakedeferdriver@E7000000 { + fakedeferdriver@e7000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xE7000000 0x0 0x2000>; + reg = <0x0 0xe7000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@E8000000 { + fakedeferdriver@e8000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xE8000000 0x0 0x2000>; + reg = <0x0 0xe8000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@F9000000 { + fakedeferdriver@f9000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xF9000000 0x0 0x2000>; + reg = <0x0 0xf9000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; diff --git a/tests/lib/devicetree/api/app.overlay b/tests/lib/devicetree/api/app.overlay index ae6e4e316a1c..95a073ec8e63 100644 --- a/tests/lib/devicetree/api/app.overlay +++ b/tests/lib/devicetree/api/app.overlay @@ -304,9 +304,9 @@ reg = <0x88889999 0x1000>; status = "okay"; - test-i3c-dev@420000ABCD12345678 { + test-i3c-dev@420000abcd12345678 { compatible = "vnd,i3c-device"; - reg = <0x42 0xABCD 0x12345678>; + reg = <0x42 0xabcd 0x12345678>; }; test-i3c-i2c-dev@380000000000000050 { diff --git a/tests/lib/devicetree/devices/app.overlay b/tests/lib/devicetree/devices/app.overlay index e195256d48c1..7e6b2ec651fd 100644 --- a/tests/lib/devicetree/devices/app.overlay +++ b/tests/lib/devicetree/devices/app.overlay @@ -73,12 +73,12 @@ test_p0: partition@0 { label = "partition-0"; - reg = <0x00000000 0x0000C000>; + reg = <0x00000000 0x0000c000>; }; test_p1: partition@c000 { label = "partition-1"; - reg = <0x0000C000 0x00067000>; + reg = <0x0000c000 0x00067000>; }; }; }; diff --git a/tests/subsys/dfu/mcuboot_multi/native_sim.overlay b/tests/subsys/dfu/mcuboot_multi/native_sim.overlay index 0a6335fea04f..791ea9e7354f 100644 --- a/tests/subsys/dfu/mcuboot_multi/native_sim.overlay +++ b/tests/subsys/dfu/mcuboot_multi/native_sim.overlay @@ -15,12 +15,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000C000>; + reg = <0x00000000 0x0000c000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x00069000>; + reg = <0x0000c000 0x00069000>; }; slot1_partition: partition@75000 { @@ -28,9 +28,9 @@ reg = <0x00075000 0x00069000>; }; - slot2_partition: partition@DE000 { + slot2_partition: partition@de000 { label = "image-2"; - reg = <0x000DE000 0x00069000>; + reg = <0x000de000 0x00069000>; }; slot3_partition: partition@146000 { diff --git a/tests/subsys/dfu/mcuboot_multi/nrf52840dk_nrf52840.overlay b/tests/subsys/dfu/mcuboot_multi/nrf52840dk_nrf52840.overlay index 51010ad0af73..e46c6318792c 100644 --- a/tests/subsys/dfu/mcuboot_multi/nrf52840dk_nrf52840.overlay +++ b/tests/subsys/dfu/mcuboot_multi/nrf52840dk_nrf52840.overlay @@ -21,22 +21,22 @@ slot0_partition: partition@10000 { label = "image-0"; - reg = <0x00010000 0x0000A000>; + reg = <0x00010000 0x0000a000>; }; - slot1_partition: partition@1A000 { + slot1_partition: partition@1a000 { label = "image-1"; - reg = <0x0001A000 0x0000A000>; + reg = <0x0001a000 0x0000a000>; }; slot2_partition: partition@24000 { label = "image-2"; - reg = <0x00024000 0x0000A000>; + reg = <0x00024000 0x0000a000>; }; - slot3_partition: partition@2E000 { + slot3_partition: partition@2e000 { label = "image-3"; - reg = <0x0002E000 0x0000A000>; + reg = <0x0002e000 0x0000a000>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_mcxa156.overlay b/tests/subsys/fs/littlefs/boards/frdm_mcxa156.overlay index c5d1289e8058..9d5efbe24e8c 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_mcxa156.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_mcxa156.overlay @@ -8,9 +8,9 @@ &flash { partitions { - small_partition: partition@E0000 { + small_partition: partition@e0000 { label = "small"; - reg = <0x000E0000 DT_SIZE_K(128)>; + reg = <0x000e0000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_mcxn236.overlay b/tests/subsys/fs/littlefs/boards/frdm_mcxn236.overlay index c5d1289e8058..9d5efbe24e8c 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_mcxn236.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_mcxn236.overlay @@ -8,9 +8,9 @@ &flash { partitions { - small_partition: partition@E0000 { + small_partition: partition@e0000 { label = "small"; - reg = <0x000E0000 DT_SIZE_K(128)>; + reg = <0x000e0000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_mcxn947_mcxn947_cpu0.overlay b/tests/subsys/fs/littlefs/boards/frdm_mcxn947_mcxn947_cpu0.overlay index d6cb83685aaa..703d7ce0e699 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_mcxn947_mcxn947_cpu0.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_mcxn947_mcxn947_cpu0.overlay @@ -18,9 +18,9 @@ reg = <0x00700000 DT_SIZE_K(960)>; }; - small_partition: partition@7F0000 { + small_partition: partition@7f0000 { label = "small"; - reg = <0x007F0000 DT_SIZE_K(64)>; + reg = <0x007f0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_mcxw71.overlay b/tests/subsys/fs/littlefs/boards/frdm_mcxw71.overlay index c5d1289e8058..9d5efbe24e8c 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_mcxw71.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_mcxw71.overlay @@ -8,9 +8,9 @@ &flash { partitions { - small_partition: partition@E0000 { + small_partition: partition@e0000 { label = "small"; - reg = <0x000E0000 DT_SIZE_K(128)>; + reg = <0x000e0000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_rw612.overlay b/tests/subsys/fs/littlefs/boards/frdm_rw612.overlay index 95e334d6fb70..6911f59c2f2a 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_rw612.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_rw612.overlay @@ -8,19 +8,19 @@ &w25q512jvfiq { partitions { - large_partition: partition@3C00000 { + large_partition: partition@3c00000 { label = "large"; - reg = <0x03C00000 DT_SIZE_M(3)>; + reg = <0x03c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@3F00000 { + medium_partition: partition@3f00000 { label = "medium"; - reg = <0x03F00000 DT_SIZE_K(960)>; + reg = <0x03f00000 DT_SIZE_K(960)>; }; - small_partition: partition@3FF0000 { + small_partition: partition@3ff0000 { label = "small"; - reg = <0x03FF0000 DT_SIZE_K(64)>; + reg = <0x03ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/lpcxpresso55s06.overlay b/tests/subsys/fs/littlefs/boards/lpcxpresso55s06.overlay index 7c7b3ca21f8a..8df2ec08b737 100644 --- a/tests/subsys/fs/littlefs/boards/lpcxpresso55s06.overlay +++ b/tests/subsys/fs/littlefs/boards/lpcxpresso55s06.overlay @@ -8,9 +8,9 @@ &flash0 { partitions { - small_partition: partition@1D000 { + small_partition: partition@1d000 { label = "small"; - reg = <0x0001D000 DT_SIZE_K(128)>; + reg = <0x0001d000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/lpcxpresso55s16.overlay b/tests/subsys/fs/littlefs/boards/lpcxpresso55s16.overlay index 7c7b3ca21f8a..8df2ec08b737 100644 --- a/tests/subsys/fs/littlefs/boards/lpcxpresso55s16.overlay +++ b/tests/subsys/fs/littlefs/boards/lpcxpresso55s16.overlay @@ -8,9 +8,9 @@ &flash0 { partitions { - small_partition: partition@1D000 { + small_partition: partition@1d000 { label = "small"; - reg = <0x0001D000 DT_SIZE_K(128)>; + reg = <0x0001d000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/lpcxpresso55s28.overlay b/tests/subsys/fs/littlefs/boards/lpcxpresso55s28.overlay index 56e240a5f429..b54b50c8d263 100644 --- a/tests/subsys/fs/littlefs/boards/lpcxpresso55s28.overlay +++ b/tests/subsys/fs/littlefs/boards/lpcxpresso55s28.overlay @@ -8,9 +8,9 @@ &flash0 { partitions { - small_partition: partition@5D000 { + small_partition: partition@5d000 { label = "small"; - reg = <0x0005D000 DT_SIZE_K(128)>; + reg = <0x0005d000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/lpcxpresso55s36.overlay b/tests/subsys/fs/littlefs/boards/lpcxpresso55s36.overlay index e67dc535faf4..0292d31ca6e6 100644 --- a/tests/subsys/fs/littlefs/boards/lpcxpresso55s36.overlay +++ b/tests/subsys/fs/littlefs/boards/lpcxpresso55s36.overlay @@ -8,9 +8,9 @@ &flash0 { partitions { - small_partition: partition@1D800 { + small_partition: partition@1d800 { label = "small"; - reg = <0x0001D800 DT_SIZE_K(128)>; + reg = <0x0001d800 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1010_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1010_evk.overlay index ab4ee994818e..8be5adc873cd 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1010_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1010_evk.overlay @@ -8,19 +8,19 @@ &at25sf128a { partitions { - large_partition: partition@C00000 { + large_partition: partition@c00000 { label = "large"; - reg = <0x00C00000 DT_SIZE_M(3)>; + reg = <0x00c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@F00000 { + medium_partition: partition@f00000 { label = "medium"; - reg = <0x00F00000 DT_SIZE_K(960)>; + reg = <0x00f00000 DT_SIZE_K(960)>; }; - small_partition: partition@FF0000 { + small_partition: partition@ff0000 { label = "small"; - reg = <0x00FF0000 DT_SIZE_K(64)>; + reg = <0x00ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1015_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1015_evk.overlay index ab4ee994818e..8be5adc873cd 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1015_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1015_evk.overlay @@ -8,19 +8,19 @@ &at25sf128a { partitions { - large_partition: partition@C00000 { + large_partition: partition@c00000 { label = "large"; - reg = <0x00C00000 DT_SIZE_M(3)>; + reg = <0x00c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@F00000 { + medium_partition: partition@f00000 { label = "medium"; - reg = <0x00F00000 DT_SIZE_K(960)>; + reg = <0x00f00000 DT_SIZE_K(960)>; }; - small_partition: partition@FF0000 { + small_partition: partition@ff0000 { label = "small"; - reg = <0x00FF0000 DT_SIZE_K(64)>; + reg = <0x00ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1020_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1020_evk.overlay index ce8f017116e9..5362cdb5bff6 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1020_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1020_evk.overlay @@ -18,9 +18,9 @@ reg = <0x00700000 DT_SIZE_K(960)>; }; - small_partition: partition@7F0000 { + small_partition: partition@7f0000 { label = "small"; - reg = <0x007F0000 DT_SIZE_K(64)>; + reg = <0x007f0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1024_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1024_evk.overlay index f3c2eb901a04..1a607ef2af32 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1024_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1024_evk.overlay @@ -8,9 +8,9 @@ &w25q32jvwj0 { partitions { - small_partition: partition@3F0000 { + small_partition: partition@3f0000 { label = "small"; - reg = <0x003F0000 DT_SIZE_K(64)>; + reg = <0x003f0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1040_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1040_evk.overlay index d6cb83685aaa..703d7ce0e699 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1040_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1040_evk.overlay @@ -18,9 +18,9 @@ reg = <0x00700000 DT_SIZE_K(960)>; }; - small_partition: partition@7F0000 { + small_partition: partition@7f0000 { label = "small"; - reg = <0x007F0000 DT_SIZE_K(64)>; + reg = <0x007f0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1050_evk_mimxrt1052_hyperflash.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1050_evk_mimxrt1052_hyperflash.overlay index 525f805af8df..d2f050371265 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1050_evk_mimxrt1052_hyperflash.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1050_evk_mimxrt1052_hyperflash.overlay @@ -18,9 +18,9 @@ reg = <0x03800000 DT_SIZE_M(4)>; }; - small_partition: partition@3C00000 { + small_partition: partition@3c00000 { label = "small"; - reg = <0x03C00000 DT_SIZE_M(4)>; + reg = <0x03c00000 DT_SIZE_M(4)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay index 1e9297aaf8a5..b9cdfec161a4 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay @@ -8,19 +8,19 @@ &w25q128jw { partitions { - large_partition: partition@C00000 { + large_partition: partition@c00000 { label = "large"; - reg = <0x00C00000 DT_SIZE_M(3)>; + reg = <0x00c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@F00000 { + medium_partition: partition@f00000 { label = "medium"; - reg = <0x00F00000 DT_SIZE_K(960)>; + reg = <0x00f00000 DT_SIZE_K(960)>; }; - small_partition: partition@FF0000 { + small_partition: partition@ff0000 { label = "small"; - reg = <0x00FF0000 DT_SIZE_K(64)>; + reg = <0x00ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1064_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1064_evk.overlay index a96d11885868..ad7041227faa 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1064_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1064_evk.overlay @@ -18,9 +18,9 @@ reg = <0x00700000 DT_SIZE_K(960)>; }; - small_partition: partition@7F0000 { + small_partition: partition@7f0000 { label = "small"; - reg = <0x007F0000 DT_SIZE_K(64)>; + reg = <0x007f0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay index 0853b0c6afc8..daa41b2c5c20 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay @@ -8,19 +8,19 @@ &is25wp128 { partitions { - large_partition: partition@C00000 { + large_partition: partition@c00000 { label = "large"; - reg = <0x00C00000 DT_SIZE_M(3)>; + reg = <0x00c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@F00000 { + medium_partition: partition@f00000 { label = "medium"; - reg = <0x00F00000 DT_SIZE_K(960)>; + reg = <0x00f00000 DT_SIZE_K(960)>; }; - small_partition: partition@FF0000 { + small_partition: partition@ff0000 { label = "small"; - reg = <0x00FF0000 DT_SIZE_K(64)>; + reg = <0x00ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay index 8f4bc077c247..03253f21593e 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay @@ -8,19 +8,19 @@ &w25q512nw { partitions { - large_partition: partition@3C00000 { + large_partition: partition@3c00000 { label = "large"; - reg = <0x03C00000 DT_SIZE_M(3)>; + reg = <0x03c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@3F00000 { + medium_partition: partition@3f00000 { label = "medium"; - reg = <0x03F00000 DT_SIZE_K(960)>; + reg = <0x03f00000 DT_SIZE_K(960)>; }; - small_partition: partition@3FF0000 { + small_partition: partition@3ff0000 { label = "small"; - reg = <0x03FF0000 DT_SIZE_K(64)>; + reg = <0x03ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1180_evk_mimxrt1189_cm33.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1180_evk_mimxrt1189_cm33.overlay index 0712305b3c8e..abd821377986 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1180_evk_mimxrt1189_cm33.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1180_evk_mimxrt1189_cm33.overlay @@ -8,19 +8,19 @@ &w25q128jw { partitions { - large_partition: partition@C00000 { + large_partition: partition@c00000 { label = "large"; - reg = <0x00C00000 DT_SIZE_M(3)>; + reg = <0x00c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@F00000 { + medium_partition: partition@f00000 { label = "medium"; - reg = <0x00F00000 DT_SIZE_K(960)>; + reg = <0x00f00000 DT_SIZE_K(960)>; }; - small_partition: partition@FF0000 { + small_partition: partition@ff0000 { label = "small"; - reg = <0x00FF0000 DT_SIZE_K(64)>; + reg = <0x00ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt595_evk_mimxrt595s_cm33.overlay b/tests/subsys/fs/littlefs/boards/mimxrt595_evk_mimxrt595s_cm33.overlay index 5b02741d577a..410320a5ebbe 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt595_evk_mimxrt595s_cm33.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt595_evk_mimxrt595s_cm33.overlay @@ -8,19 +8,19 @@ &mx25um51345g { partitions { - large_partition: partition@3C00000 { + large_partition: partition@3c00000 { label = "large"; - reg = <0x03C00000 DT_SIZE_M(3)>; + reg = <0x03c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@3F00000 { + medium_partition: partition@3f00000 { label = "medium"; - reg = <0x03F00000 DT_SIZE_K(960)>; + reg = <0x03f00000 DT_SIZE_K(960)>; }; - small_partition: partition@3FF0000 { + small_partition: partition@3ff0000 { label = "small"; - reg = <0x03FF0000 DT_SIZE_K(64)>; + reg = <0x03ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt685_evk_mimxrt685s_cm33.overlay b/tests/subsys/fs/littlefs/boards/mimxrt685_evk_mimxrt685s_cm33.overlay index 5b02741d577a..410320a5ebbe 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt685_evk_mimxrt685s_cm33.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt685_evk_mimxrt685s_cm33.overlay @@ -8,19 +8,19 @@ &mx25um51345g { partitions { - large_partition: partition@3C00000 { + large_partition: partition@3c00000 { label = "large"; - reg = <0x03C00000 DT_SIZE_M(3)>; + reg = <0x03c00000 DT_SIZE_M(3)>; }; - medium_partition: partition@3F00000 { + medium_partition: partition@3f00000 { label = "medium"; - reg = <0x03F00000 DT_SIZE_K(960)>; + reg = <0x03f00000 DT_SIZE_K(960)>; }; - small_partition: partition@3FF0000 { + small_partition: partition@3ff0000 { label = "small"; - reg = <0x03FF0000 DT_SIZE_K(64)>; + reg = <0x03ff0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mr_canhubk3.overlay b/tests/subsys/fs/littlefs/boards/mr_canhubk3.overlay index d1e267e5e7dd..d494402a5fa0 100644 --- a/tests/subsys/fs/littlefs/boards/mr_canhubk3.overlay +++ b/tests/subsys/fs/littlefs/boards/mr_canhubk3.overlay @@ -15,7 +15,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000F0000>; + reg = <0x00010000 0x000f0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/fs/littlefs/boards/native_sim.overlay b/tests/subsys/fs/littlefs/boards/native_sim.overlay index d7789f51e52c..e1ee0717aafd 100644 --- a/tests/subsys/fs/littlefs/boards/native_sim.overlay +++ b/tests/subsys/fs/littlefs/boards/native_sim.overlay @@ -23,7 +23,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000F0000>; + reg = <0x00010000 0x000f0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.overlay index 766906bc2aab..c2ceb26ac379 100644 --- a/tests/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.overlay +++ b/tests/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.overlay @@ -17,7 +17,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000F0000>; + reg = <0x00010000 0x000f0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu0.overlay b/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu0.overlay index 1a81fb2b6ba9..bf936b16046d 100644 --- a/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu0.overlay +++ b/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu0.overlay @@ -15,7 +15,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000F0000>; + reg = <0x00010000 0x000f0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu1.overlay b/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu1.overlay index 1a81fb2b6ba9..bf936b16046d 100644 --- a/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu1.overlay +++ b/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu1.overlay @@ -15,7 +15,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000F0000>; + reg = <0x00010000 0x000f0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/mem_mgmt/mem_attr_heap/boards/qemu_cortex_m3.overlay b/tests/subsys/mem_mgmt/mem_attr_heap/boards/qemu_cortex_m3.overlay index d75f0423a4ea..1d22fb42a6f4 100644 --- a/tests/subsys/mem_mgmt/mem_attr_heap/boards/qemu_cortex_m3.overlay +++ b/tests/subsys/mem_mgmt/mem_attr_heap/boards/qemu_cortex_m3.overlay @@ -17,30 +17,30 @@ zephyr,memory-attr = <(DT_MEM_CACHEABLE | DT_MEM_SW_ALLOC_CACHE)>; }; - mem_noncache_sw: memory@2000A000 { + mem_noncache_sw: memory@2000a000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000A000 0x1000>; + reg = <0x2000a000 0x1000>; zephyr,memory-region = "MEM_NON_CACHEABLE_SW"; zephyr,memory-attr = ; }; - mem_dma_sw: memory@2000B000 { + mem_dma_sw: memory@2000b000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000B000 0x1000>; + reg = <0x2000b000 0x1000>; zephyr,memory-region = "MEM_DMA_SW"; zephyr,memory-attr = <(DT_MEM_DMA | DT_MEM_SW_ALLOC_DMA)>; }; - mem_cache_sw_big: memory@2000C000 { + mem_cache_sw_big: memory@2000c000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000C000 0x2000>; + reg = <0x2000c000 0x2000>; zephyr,memory-region = "MEM_CACHEABLE_SW_BIG"; zephyr,memory-attr = <(DT_MEM_CACHEABLE | DT_MEM_SW_ALLOC_CACHE)>; }; - mem_cache_cache_dma_multi: memory@2000E000 { + mem_cache_cache_dma_multi: memory@2000e000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000E000 0x1000>; + reg = <0x2000e000 0x1000>; zephyr,memory-region = "MEM_CACHEABLE_SW_MULTI_ATTR"; zephyr,memory-attr = <(DT_MEM_CACHEABLE | DT_MEM_DMA | DT_MEM_SW_ALLOC_CACHE | DT_MEM_SW_ALLOC_DMA)>; diff --git a/tests/subsys/sd/sdio/boards/arduino_portenta_h7_stm32h747xx_m7.overlay b/tests/subsys/sd/sdio/boards/arduino_portenta_h7_stm32h747xx_m7.overlay index 2f231124a68c..d2ee3d9bf794 100644 --- a/tests/subsys/sd/sdio/boards/arduino_portenta_h7_stm32h747xx_m7.overlay +++ b/tests/subsys/sd/sdio/boards/arduino_portenta_h7_stm32h747xx_m7.overlay @@ -13,11 +13,11 @@ }; &slot0_partition { - reg = <0x00040000 0x001C0000>; + reg = <0x00040000 0x001c0000>; }; &slot1_partition { - reg = <0x00200000 0x001C0000>; + reg = <0x00200000 0x001c0000>; }; &wifi { diff --git a/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay index e7806a54b853..37bae45ab120 100644 --- a/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay +++ b/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay @@ -9,9 +9,9 @@ /delete-property/ zephyr,boot-mode; }; - sram@2003F000 { + sram@2003f000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003F000 DT_SIZE_K(4)>; + reg = <0x2003f000 DT_SIZE_K(4)>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay b/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay index fe9bab6b727c..348b780c492f 100644 --- a/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay +++ b/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay @@ -5,9 +5,9 @@ */ / { - sram@2000F000 { + sram@2000f000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000F000 0x1000>; + reg = <0x2000f000 0x1000>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/subsys/storage/flash_map/app.overlay b/tests/subsys/storage/flash_map/app.overlay index 72875fff32b8..eed55beedcef 100644 --- a/tests/subsys/storage/flash_map/app.overlay +++ b/tests/subsys/storage/flash_map/app.overlay @@ -37,7 +37,7 @@ disabled_a_b: partition@100 { label = "disabled_a_b"; - reg = <0x00000100 0xF00>; + reg = <0x00000100 0xf00>; }; }; @@ -56,7 +56,7 @@ disabled_b_b: partition@100 { label = "disabled_b_b"; - reg = <0x00000100 0xF00>; + reg = <0x00000100 0xf00>; }; }; }; From 583736dc88828eb84ba0b97b9e5fede016de6199 Mon Sep 17 00:00:00 2001 From: Erdem Simsek Date: Tue, 3 Feb 2026 15:40:23 +0000 Subject: [PATCH 1733/3334] [nrf fromtree] dts: riscv: nordic: add definitions for vevif_rx for nRF7120 Add cpuflpr_vevif_rx for mailbox for nRF7120 Signed-off-by: Erdem Simsek (cherry picked from commit 1e013350b940d105ee618c2112c13115bd76203f) --- dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi b/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi index 2aec31f3a282..7995093515f5 100644 --- a/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi +++ b/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi @@ -32,6 +32,24 @@ clic: &cpuflpr_clic {}; }; }; +&cpuflpr { + cpuflpr_vevif_rx: mailbox { + compatible = "nordic,nrf-vevif-task-rx"; + status = "disabled"; + interrupt-parent = <&cpuflpr_clic>; + interrupts = <16 NRF_DEFAULT_IRQ_PRIORITY>, + <17 NRF_DEFAULT_IRQ_PRIORITY>, + <18 NRF_DEFAULT_IRQ_PRIORITY>, + <19 NRF_DEFAULT_IRQ_PRIORITY>, + <20 NRF_DEFAULT_IRQ_PRIORITY>, + <21 NRF_DEFAULT_IRQ_PRIORITY>, + <22 NRF_DEFAULT_IRQ_PRIORITY>; + #mbox-cells = <1>; + nordic,tasks = <7>; + nordic,tasks-mask = <0x007f0000>; + }; +}; + &cpuflpr_vpr { cpuflpr_vevif_tx: mailbox { compatible = "nordic,nrf-vevif-event-tx"; From 6e1d8263225047eb1d7fb4cf3444e0a166465b9e Mon Sep 17 00:00:00 2001 From: Erdem Simsek Date: Thu, 4 Dec 2025 12:35:23 +0000 Subject: [PATCH 1734/3334] [nrf fromtree] drivers: mbox: nrf_vevif_task_rx: Fix indexing in rx_set_enabled Fixes VEVIF task receiver driver to work correctly on both nRF7120 and nRF54h20 by correcting the mapping between Task IDs and Interrupts. Signed-off-by: Erdem Simsek (cherry picked from commit 1b8d1bb5cbfa63e4f3a6659805b049d066825b64) --- drivers/mbox/mbox_nrf_vevif_task_rx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mbox/mbox_nrf_vevif_task_rx.c b/drivers/mbox/mbox_nrf_vevif_task_rx.c index 8afe9eeb50bb..1ddc023312cd 100644 --- a/drivers/mbox/mbox_nrf_vevif_task_rx.c +++ b/drivers/mbox/mbox_nrf_vevif_task_rx.c @@ -39,7 +39,7 @@ static const uint8_t vevif_irqs[VEVIF_TASKS_NUM] = { static void vevif_task_rx_isr(const void *parameter) { - uint8_t channel = *(uint8_t *)parameter; + uint8_t channel = *(const uint8_t *)parameter; uint8_t idx = channel - TASKS_IDX_MIN; nrf_vpr_csr_vevif_tasks_clear(BIT(channel)); @@ -65,12 +65,13 @@ 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; } + uint8_t idx = id - TASKS_IDX_MIN; + cbs.cb[idx] = cb; cbs.user_data[idx] = user_data; @@ -80,12 +81,13 @@ static int vevif_task_rx_register_callback(const struct device *dev, uint32_t id 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; } + uint8_t idx = id - vevif_irqs[0]; + if (enable) { if ((cbs.enabled_mask & BIT(id)) != 0U) { return -EALREADY; From 0bfdaabb1afe0079e68fedb2800c6cb45005842f Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 6 Feb 2026 09:46:23 +0000 Subject: [PATCH 1735/3334] [nrf fromlist] include: devicetree: fixed-partitions: Fix node handling Fixes issues with handling fixed partitions that use the correct method of inheriting the parent's address. Also updates the test so that it uses this properly, and adds in checks so that invalid (and deprecated) handling is checked to ensure it has not broken Upstream PR #: 103631 Signed-off-by: Jamie McCrae --- include/zephyr/devicetree/fixed-partitions.h | 38 ++++- tests/lib/devicetree/api/app.overlay | 83 ++++++++++- tests/lib/devicetree/api/src/main.c | 146 +++++++++++++++++-- 3 files changed, 247 insertions(+), 20 deletions(-) diff --git a/include/zephyr/devicetree/fixed-partitions.h b/include/zephyr/devicetree/fixed-partitions.h index ff44e07ef644..3a60f960013c 100644 --- a/include/zephyr/devicetree/fixed-partitions.h +++ b/include/zephyr/devicetree/fixed-partitions.h @@ -5,6 +5,7 @@ /* * Copyright (c) 2020, Linaro Ltd. + * Copyright (c) 2026, Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -105,9 +106,15 @@ extern "C" { * &flash_controller { * flash@1000000 { * compatible = "soc-nv-flash"; + * reg = <0x1000000 0x50000> + * ranges = <0x0 0x1000000 0x50000> + * * partitions { * compatible = "fixed-partitions"; + * ranges; + * * storage_partition: partition@3a000 { + * reg = <0x3a000 0x8000> * label = "storage"; * }; * }; @@ -130,8 +137,20 @@ extern "C" { * @return the partition's offset plus the base address of the flash * node containing it. */ -#define DT_FIXED_PARTITION_ADDR(node_id) \ - (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(node_id))) + +/* + * The COND_CODE_0 ranges part handles invalid devices where they wrongly do not inherit the + * parent's address and wrongly start at address 0x0 which was a bug that was fixed post Zephyr + * 4.3, this extra handling can be removed in Zephyr 4.6 or newer + */ +#define DT_FIXED_PARTITION_ADDR(node_id) \ + COND_CODE_0(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ + (COND_CODE_0(DT_NUM_RANGES(DT_GPARENT(node_id)), \ + (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(node_id))), \ + (DT_REG_ADDR(node_id)))), \ + (COND_CODE_0(DT_NUM_RANGES(DT_GPARENT(DT_PARENT(node_id))), \ + (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(node_id))), \ + (DT_REG_ADDR(node_id))))) /** * @brief Test if fixed-subpartitions compatible node exists @@ -170,9 +189,12 @@ extern "C" { * &flash_controller { * flash@1000000 { * compatible = "soc-nv-flash"; + * reg = <0x1000000 0x50000> + * ranges = <0x0 0x1000000 0x50000> * * partitions { * compatible = "fixed-partitions"; + * ranges; * * slot0_partition: partition@10000 { * compatible = "fixed-subpartitions"; @@ -206,8 +228,16 @@ extern "C" { * @return the subpartition's offset plus the base address of the flash * node containing it. */ -#define DT_FIXED_SUBPARTITION_ADDR(node_id) \ - (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(DT_PARENT(node_id)))) + +/* + * The COND_CODE_0 part handles invalid devices where they wrongly do not inherit the parent's + * address and wrongly start at address 0x0 which was a bug that was fixed post Zephyr 4.3, this + * extra handling can be removed in Zephyr 4.6 or newer + */ +#define DT_FIXED_SUBPARTITION_ADDR(node_id) \ + COND_CODE_0(DT_NUM_RANGES(DT_GPARENT(DT_PARENT(node_id))), \ + (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(DT_PARENT(node_id)))), \ + (DT_REG_ADDR(node_id))) /** * @} diff --git a/tests/lib/devicetree/api/app.overlay b/tests/lib/devicetree/api/app.overlay index 95a073ec8e63..ecbe17df3e78 100644 --- a/tests/lib/devicetree/api/app.overlay +++ b/tests/lib/devicetree/api/app.overlay @@ -886,6 +886,14 @@ #address-cells = <1>; #size-cells = <1>; + /* + * The below specifies an invalid setup whereby partitions wrongly do not + * inherit the parent node's address space and specify that the partitions + * start at absolute address 0x0 onwards, this has been fixed post Zephyr + * 4.3 and is only here to ensure macros do not break for out of tree + * users so that they have time to fix their DTS files, it will be removed + * in Zephyr 4.6 or newer. + */ flash@20000000 { compatible = "soc-nv-flash"; reg = <0x20000000 0x100>; @@ -895,6 +903,51 @@ #address-cells = <1>; #size-cells = <1>; + partition@0 { + reg = <0x0 0xc0>; + label = "test-partition-0-deprecated"; + }; + + partition@c0 { + reg = <0xc0 0x40>; + label = "test-partition-1-deprecated"; + }; + + partition@100 { + compatible = "fixed-subpartitions"; + label = "test-subpartitions-deprecated"; + reg = <0x00000100 0x100>; + ranges = <0x0 0x100 0x100>; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "test-subpartition-0-deprecated"; + reg = <0x00000000 0x40>; + }; + + partition@40 { + label = "test-subpartition-1-deprecated"; + reg = <0x00000040 0xc0>; + }; + }; + }; + }; + + /* The below device correctly inherits the parent's address space */ + flash@20001000 { + compatible = "soc-nv-flash"; + reg = <0x20001000 0x200>; + ranges = <0x0 0x20001000 0x200>; + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + partition@0 { reg = <0x0 0xc0>; label = "test-partition-0"; @@ -927,14 +980,42 @@ }; }; + /* + * The below specifies an invalid setup whereby partitions wrongly do not + * inherit the parent node's address space and specify that the partitions + * start at absolute address 0x0 onwards, this has been fixed post Zephyr + * 4.3 and is only here to ensure macros do not break for out of tree + * users so that they have time to fix their DTS files, it will be removed + * in Zephyr 4.6 or newer. + */ test-mtd@33221100 { - reg = <0x33221100 0x1000>; + reg = <0x33221100 0x70000>; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + partition@6ff80 { + reg = <0x6ff80 0x80>; + label = "test-partition-2-deprecated"; + }; + }; + }; + + /* The below device correctly inherits the parent's address space */ + test-mtd@33291100 { + reg = <0x33291100 0x70000>; + ranges = <0x0 0x33291100 0x70000>; + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + partition@6ff80 { reg = <0x6ff80 0x80>; label = "test-partition-2"; diff --git a/tests/lib/devicetree/api/src/main.c b/tests/lib/devicetree/api/src/main.c index fd8bd88085ff..eb06c570e116 100644 --- a/tests/lib/devicetree/api/src/main.c +++ b/tests/lib/devicetree/api/src/main.c @@ -97,19 +97,37 @@ #define TEST_RANGES_EMPTY DT_NODELABEL(test_ranges_empty) #define TEST_MTD_0 DT_PATH(test, test_mtd_ffeeddcc) -#define TEST_MTD_1 DT_PATH(test, test_mtd_33221100) -#define TEST_MEM_0 DT_CHILD(TEST_MTD_0, flash_20000000) +#define TEST_MTD_1_DEPRECATED DT_PATH(test, test_mtd_33221100) -#define TEST_PARTITION_0 DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, partition_0) -#define TEST_PARTITION_1 DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, partition_c0) -#define TEST_PARTITION_2 DT_PATH(test, test_mtd_33221100, partitions, partition_6ff80) +#define TEST_MEM_0_DEPRECATED DT_CHILD(TEST_MTD_0, flash_20000000) -#define TEST_SUBPARTITION_COMBINED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ +#define TEST_PARTITION_0_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ + partition_0) +#define TEST_PARTITION_1_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ + partition_c0) +#define TEST_PARTITION_2_DEPRECATED DT_PATH(test, test_mtd_33221100, partitions, partition_6ff80) + +#define TEST_SUBPARTITION_COMBINED_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, \ + partitions, partition_100) +#define TEST_SUBPARTITION_0_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, \ + partitions, partition_100, partition_0) +#define TEST_SUBPARTITION_1_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, \ + partitions, partition_100, partition_40) + +#define TEST_MTD_1 DT_PATH(test, test_mtd_33291100) + +#define TEST_MEM_0 DT_CHILD(TEST_MTD_0, flash_20001000) + +#define TEST_PARTITION_0 DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, partition_0) +#define TEST_PARTITION_1 DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, partition_c0) +#define TEST_PARTITION_2 DT_PATH(test, test_mtd_33291100, partitions, partition_6ff80) + +#define TEST_SUBPARTITION_COMBINED DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, \ partition_100) -#define TEST_SUBPARTITION_0 DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ +#define TEST_SUBPARTITION_0 DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, \ partition_100, partition_0) -#define TEST_SUBPARTITION_1 DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ +#define TEST_SUBPARTITION_1 DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, \ partition_100, partition_40) #define ZEPHYR_USER DT_PATH(zephyr_user) @@ -3278,13 +3296,107 @@ ZTEST(devicetree_api, test_mbox) DT_NODELABEL(test_mbox_zero_cell)), ""); } +/* + * Tests that invalid but accidentally working behaviour does not break out of tree users, to be + * removed in Zephyr 4.6 or newer + */ +ZTEST(devicetree_api, test_fixed_partitions_deprecated) +{ + /* Test finding fixed partitions by the 'label' property. */ + zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_0_deprecated)); + zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_1_deprecated)); + zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_2_deprecated)); + zassert_true(DT_SAME_NODE(TEST_PARTITION_0_DEPRECATED, + DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_0_deprecated))); + zassert_true(DT_SAME_NODE(TEST_PARTITION_1_DEPRECATED, + DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_1_deprecated))); + zassert_true(DT_SAME_NODE(TEST_PARTITION_2_DEPRECATED, + DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_2_deprecated))); + + zassert_true(DT_FIXED_PARTITION_EXISTS(TEST_PARTITION_0_DEPRECATED)); + zassert_true(DT_FIXED_PARTITION_EXISTS(TEST_PARTITION_1_DEPRECATED)); + zassert_true(DT_FIXED_PARTITION_EXISTS(TEST_PARTITION_2_DEPRECATED)); + + /* There should not be a node with `label = "test_partition_3_deprecated"`. */ + zassert_false(DT_HAS_FIXED_PARTITION_LABEL(test_partition_3_deprecated)); + zassert_false(DT_NODE_EXISTS( + DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_3_deprecated))); + + /* Test DT_MTD_FROM_FIXED_PARTITION. */ + zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION(TEST_PARTITION_0_DEPRECATED))); + zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION(TEST_PARTITION_1_DEPRECATED))); + zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION(TEST_PARTITION_2_DEPRECATED))); + + zassert_true(DT_SAME_NODE(TEST_MTD_0, DT_MTD_FROM_FIXED_PARTITION( + TEST_PARTITION_0_DEPRECATED))); + zassert_true(DT_SAME_NODE(TEST_MTD_0, DT_MTD_FROM_FIXED_PARTITION( + TEST_PARTITION_1_DEPRECATED))); + zassert_true(DT_SAME_NODE(TEST_MTD_1_DEPRECATED, DT_MTD_FROM_FIXED_PARTITION( + TEST_PARTITION_2_DEPRECATED))); + + /* Test DT_MEM_FROM_FIXED_PARTITION. */ + zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_PARTITION(TEST_PARTITION_0_DEPRECATED))); + zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_PARTITION(TEST_PARTITION_1_DEPRECATED))); + zassert_false(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_PARTITION(TEST_PARTITION_2_DEPRECATED))); + + zassert_true(DT_SAME_NODE(TEST_MEM_0_DEPRECATED, DT_MEM_FROM_FIXED_PARTITION( + TEST_PARTITION_0_DEPRECATED))); + zassert_true(DT_SAME_NODE(TEST_MEM_0_DEPRECATED, DT_MEM_FROM_FIXED_PARTITION( + TEST_PARTITION_1_DEPRECATED))); + + /* Test DT_FIXED_PARTITION_ADDR. */ + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_0_DEPRECATED), 0x20000000); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_1_DEPRECATED), 0x200000c0); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2_DEPRECATED), 0x33291080); +} + +ZTEST(devicetree_api, test_fixed_subpartitions_deprecated) +{ + zassert_true(DT_FIXED_PARTITION_EXISTS(TEST_SUBPARTITION_COMBINED_DEPRECATED)); + zassert_true(DT_FIXED_SUBPARTITION_EXISTS(TEST_SUBPARTITION_0_DEPRECATED)); + zassert_true(DT_FIXED_SUBPARTITION_EXISTS(TEST_SUBPARTITION_1_DEPRECATED)); + + /* Test DT_MEM_FROM_FIXED_SUBPARTITION. */ + zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_PARTITION( + TEST_SUBPARTITION_COMBINED_DEPRECATED))); + zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_SUBPARTITION( + TEST_SUBPARTITION_0_DEPRECATED))); + zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_SUBPARTITION( + TEST_SUBPARTITION_1_DEPRECATED))); + + /* Test DT_MTD_FROM_FIXED_SUBPARTITION. */ + zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION( + TEST_SUBPARTITION_COMBINED_DEPRECATED))); + zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_SUBPARTITION( + TEST_SUBPARTITION_0_DEPRECATED))); + zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_SUBPARTITION( + TEST_SUBPARTITION_1_DEPRECATED))); + zassert_true(DT_SAME_NODE( + DT_MTD_FROM_FIXED_PARTITION(TEST_SUBPARTITION_COMBINED_DEPRECATED), + DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_1_DEPRECATED))); + + /* Test DT_FIXED_SUBPARTITION_ADDR. */ + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED_DEPRECATED), 0x20000100); + zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0_DEPRECATED), + DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED_DEPRECATED)); + zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0_DEPRECATED), 0x20000100); + zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_1_DEPRECATED), 0x20000140); + + /* Check sizes match */ + zassert_equal(DT_REG_SIZE(TEST_SUBPARTITION_COMBINED_DEPRECATED), + (DT_REG_SIZE(TEST_SUBPARTITION_0_DEPRECATED) + + DT_REG_SIZE(TEST_SUBPARTITION_1_DEPRECATED))); + zassert_equal(DT_REG_SIZE(TEST_SUBPARTITION_COMBINED_DEPRECATED), + (DT_REG_SIZE(TEST_SUBPARTITION_0_DEPRECATED) + + DT_REG_SIZE(TEST_SUBPARTITION_1_DEPRECATED))); +} + ZTEST(devicetree_api, test_fixed_partitions) { /* Test finding fixed partitions by the 'label' property. */ zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_0)); zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_1)); zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_2)); - zassert_true(DT_SAME_NODE(TEST_PARTITION_0, DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_0))); zassert_true(DT_SAME_NODE(TEST_PARTITION_1, @@ -3322,9 +3434,9 @@ ZTEST(devicetree_api, test_fixed_partitions) zassert_true(DT_SAME_NODE(TEST_MEM_0, DT_MEM_FROM_FIXED_PARTITION(TEST_PARTITION_1))); /* Test DT_FIXED_PARTITION_ADDR. */ - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_0), 0x20000000); - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_1), 0x200000c0); - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2), 0x33291080); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_0), 0x20001000); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_1), 0x200010c0); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2), 0x33301080); /* Test that all DT_FIXED_PARTITION_ID are defined and unique. */ #define FIXED_PARTITION_ID_COMMA(node_id) DT_FIXED_PARTITION_ID(node_id), @@ -3332,6 +3444,8 @@ ZTEST(devicetree_api, test_fixed_partitions) static const int ids[] = { DT_FOREACH_STATUS_OKAY_VARGS(fixed_partitions, DT_FOREACH_CHILD, FIXED_PARTITION_ID_COMMA) + DT_FOREACH_STATUS_OKAY_VARGS(fixed_subpartitions, DT_FOREACH_CHILD, + FIXED_PARTITION_ID_COMMA) }; bool found[ARRAY_SIZE(ids)] = { false }; @@ -3364,15 +3478,17 @@ ZTEST(devicetree_api, test_fixed_subpartitions) DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_1))); /* Test DT_FIXED_SUBPARTITION_ADDR. */ - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED), 0x20000100); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED), 0x20001100); zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0), DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED)); - zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0), 0x20000100); - zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_1), 0x20000140); + zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0), 0x20001100); + zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_1), 0x20001140); /* Check sizes match */ zassert_equal(DT_REG_SIZE(TEST_SUBPARTITION_COMBINED), (DT_REG_SIZE(TEST_SUBPARTITION_0) + DT_REG_SIZE(TEST_SUBPARTITION_1))); + zassert_equal(DT_REG_SIZE(TEST_SUBPARTITION_COMBINED), + (DT_REG_SIZE(TEST_SUBPARTITION_0) + DT_REG_SIZE(TEST_SUBPARTITION_1))); } ZTEST(devicetree_api, test_string_token) From a1bf1cd236a74e8398c6fee65be97df41b1102a5 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 6 Feb 2026 09:29:31 +0000 Subject: [PATCH 1736/3334] [nrf fromlist] tests: drivers: flash: Fix invalid partition handling Fixes wrongly taking the absolute address of the partition when the relative address was needed Upstream PR #: 103631 Signed-off-by: Jamie McCrae --- tests/drivers/flash/erase_blocks/src/main.c | 3 ++- tests/drivers/flash/interface_test/src/main.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/drivers/flash/erase_blocks/src/main.c b/tests/drivers/flash/erase_blocks/src/main.c index 57edfee8fced..d44eed15e4de 100644 --- a/tests/drivers/flash/erase_blocks/src/main.c +++ b/tests/drivers/flash/erase_blocks/src/main.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,7 @@ LOG_MODULE_REGISTER(test_flash); #endif #define TEST_FLASH_PART_OFFSET \ - DT_REG_ADDR(TEST_FLASH_PART_NODE) + FIXED_PARTITION_NODE_OFFSET(TEST_FLASH_PART_NODE) #define TEST_FLASH_PART_SIZE \ DT_REG_SIZE(TEST_FLASH_PART_NODE) diff --git a/tests/drivers/flash/interface_test/src/main.c b/tests/drivers/flash/interface_test/src/main.c index 461323e8863d..8b2627b4f787 100644 --- a/tests/drivers/flash/interface_test/src/main.c +++ b/tests/drivers/flash/interface_test/src/main.c @@ -7,6 +7,7 @@ #include #include #include +#include #ifdef CONFIG_BOOTLOADER_MCUBOOT #define TEST_FLASH_PART_NODE DT_NODELABEL(boot_partition) @@ -14,7 +15,7 @@ #define TEST_FLASH_PART_NODE DT_NODELABEL(slot1_partition) #endif -#define TEST_FLASH_PART_OFFSET DT_REG_ADDR(TEST_FLASH_PART_NODE) +#define TEST_FLASH_PART_OFFSET FIXED_PARTITION_NODE_OFFSET(TEST_FLASH_PART_NODE) #define TEST_FLASH_PART_SIZE DT_REG_SIZE(TEST_FLASH_PART_NODE) #define TEST_FLASH_CONTROLLER_NODE DT_MTD_FROM_FIXED_PARTITION(TEST_FLASH_PART_NODE) From 4cf767dcbd23fbe339914f9ce876e5016eb9762c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 6 Feb 2026 09:30:22 +0000 Subject: [PATCH 1737/3334] [nrf fromlist] tests: drivers: flash_simulator: Fix invalid partition handling Fixes wrongly taking the absolute address of the partition when the relative address was needed Upstream PR #: 103631 Signed-off-by: Jamie McCrae --- tests/drivers/flash_simulator/flash_sim_impl/src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/drivers/flash_simulator/flash_sim_impl/src/main.c b/tests/drivers/flash_simulator/flash_sim_impl/src/main.c index 8fef1927a49a..95dd3d92d92a 100644 --- a/tests/drivers/flash_simulator/flash_sim_impl/src/main.c +++ b/tests/drivers/flash_simulator/flash_sim_impl/src/main.c @@ -7,6 +7,7 @@ #include #include #include +#include /* Warning: The test has been written for testing boards with single * instance of Flash Simulator device only. @@ -18,7 +19,7 @@ #else #define SOC_NV_FLASH_NODE DT_CHILD(DT_INST(0, zephyr_sim_flash), flash_sim_0) #endif /* CONFIG_ARCH_POSIX */ -#define FLASH_SIMULATOR_BASE_OFFSET DT_REG_ADDR(SOC_NV_FLASH_NODE) +#define FLASH_SIMULATOR_BASE_OFFSET FIXED_PARTITION_NODE_OFFSET(SOC_NV_FLASH_NODE) #define FLASH_SIMULATOR_ERASE_UNIT DT_PROP(SOC_NV_FLASH_NODE, erase_block_size) #define FLASH_SIMULATOR_PROG_UNIT DT_PROP(SOC_NV_FLASH_NODE, write_block_size) #define FLASH_SIMULATOR_FLASH_SIZE DT_REG_SIZE(SOC_NV_FLASH_NODE) From 276acc01ab32c8e3be33cb2b75388f8a2faf54a4 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 6 Feb 2026 09:30:44 +0000 Subject: [PATCH 1738/3334] [nrf fromlist] drivers: disk: flashdisk: Fix invalid partition handling Fixes wrongly taking the absolute address of the partition when the relative address was needed Upstream PR #: 103631 Signed-off-by: Jamie McCrae --- drivers/disk/flashdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index bd5dc6a8f76a..73832cdba358 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -523,7 +523,7 @@ DT_INST_FOREACH_STATUS_OKAY(DEFINE_FLASHDISKS_CACHE) .name = DT_INST_PROP(n, disk_name), \ }, \ .area_id = DT_FIXED_PARTITION_ID(PARTITION_PHANDLE(n)), \ - .offset = DT_REG_ADDR(PARTITION_PHANDLE(n)), \ + .offset = FIXED_PARTITION_NODE_OFFSET(PARTITION_PHANDLE(n)), \ .cache = flashdisk##n##_cache, \ .cache_size = sizeof(flashdisk##n##_cache), \ .size = DT_REG_SIZE(PARTITION_PHANDLE(n)), \ From 84262608b556028e028cde61c0b407070fc3796c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 6 Feb 2026 09:31:12 +0000 Subject: [PATCH 1739/3334] [nrf fromlist] tests: shell: shell_flash: Fix invalid partition handling Fixes wrongly taking the absolute address of the partition when the relative address was needed Upstream PR #: 103631 Signed-off-by: Jamie McCrae --- tests/subsys/shell/shell_flash/src/shell_flash_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/subsys/shell/shell_flash/src/shell_flash_test.c b/tests/subsys/shell/shell_flash/src/shell_flash_test.c index f4c51f595146..ff8d1bb0db93 100644 --- a/tests/subsys/shell/shell_flash/src/shell_flash_test.c +++ b/tests/subsys/shell/shell_flash/src/shell_flash_test.c @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -23,7 +24,7 @@ #else #define SOC_NV_FLASH_NODE DT_CHILD(DT_INST(0, zephyr_sim_flash), flash_sim_0) #endif /* CONFIG_ARCH_POSIX */ -#define FLASH_SIMULATOR_BASE_OFFSET DT_REG_ADDR(SOC_NV_FLASH_NODE) +#define FLASH_SIMULATOR_BASE_OFFSET FIXED_PARTITION_NODE_OFFSET(SOC_NV_FLASH_NODE) /* Test 'flash read' shell command */ ZTEST(shell_flash, test_flash_read) From e12a466761eecb74d3e3f1565cbacaa0324cdbc5 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 6 Feb 2026 09:32:19 +0000 Subject: [PATCH 1740/3334] [nrf fromlist] tests: storage: flash_map: Fix testing on sub-partitions Fixes testing on devices that use sub-partitions for the partition Upstream PR #: 103631 Signed-off-by: Jamie McCrae --- tests/subsys/storage/flash_map/src/main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/subsys/storage/flash_map/src/main.c b/tests/subsys/storage/flash_map/src/main.c index 7075110bb0a7..aa47c9e0c70c 100644 --- a/tests/subsys/storage/flash_map/src/main.c +++ b/tests/subsys/storage/flash_map/src/main.c @@ -169,8 +169,17 @@ ZTEST(flash_map, test_fixed_partition_node_macros) */ #if defined(CONFIG_TEST_FLASH_MAP_NODE_MACROS) /* Test against changes in API */ +#if DT_REG_ADDR(DT_PARENT(SLOT1_PARTITION_NODE)) + /* Sub-partition handling */ zassert_equal(FIXED_PARTITION_NODE_OFFSET(SLOT1_PARTITION_NODE), - DT_REG_ADDR(SLOT1_PARTITION_NODE)); + (DT_REG_ADDR(SLOT1_PARTITION_NODE) - DT_REG_ADDR(DT_PARENT(SLOT1_PARTITION_NODE)))); +#else + /* Partition handling */ + zassert_equal(FIXED_PARTITION_NODE_OFFSET(SLOT1_PARTITION_NODE), + (DT_REG_ADDR(SLOT1_PARTITION_NODE) - DT_REG_ADDR(DT_PARENT( + DT_PARENT(SLOT1_PARTITION_NODE))))); +#endif + zassert_equal(FIXED_PARTITION_NODE_SIZE(SLOT1_PARTITION_NODE), DT_REG_SIZE(SLOT1_PARTITION_NODE)); zassert_equal(FIXED_PARTITION_NODE_DEVICE(SLOT1_PARTITION_NODE), From 91ed7632190180867ac3b2d7740454dbad883760 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Thu, 5 Feb 2026 15:17:19 +0100 Subject: [PATCH 1741/3334] [nrf fromlist] kconfig: remove non-applicable build warning on invalid partition address Commit 2f7d13840f6d introduced FLASH_CODE_PARTITION_ADDRESS_INVALID config symbol that emits a "warning: Deprecated symbol ..." build message when enabled. However, this warning is not applicable when flash load address is not fetched from the DT, which happens when CONFIG_USE_DT_CODE_PARTITION is disabled. Add a dependency so prevent the non-applicable warning message to be emitted. Upstream PR #: 103587 Signed-off-by: Etienne Carriere --- Kconfig.zephyr | 1 + 1 file changed, 1 insertion(+) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 2df77507f123..d56bea555aa0 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -103,6 +103,7 @@ DT_CHOSEN_Z_FLASH := zephyr,flash config FLASH_CODE_PARTITION_ADDRESS_INVALID bool default y if XIP && $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) < FLASH_BASE_ADDRESS + depends on USE_DT_CODE_PARTITION select DEPRECATED help If this item is selected, it is likely selected because your board/SoC/base DTS files From 5b80922a4b229a4c0add79d1a2dd239f3070c82b Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Thu, 5 Feb 2026 16:17:42 +0100 Subject: [PATCH 1742/3334] [nrf fromlist] kconfig: fix flash load offset fallback on invalid partition address Fix FLASH_LOAD_OFFSET symbol default when when legacy invalid partition offsets are provided. Commit 2f7d13840f6d allowed so-called invalid partition address (see FLASH_CODE_PARTITION_ADDRESS_INVALID config symbol) to still use their legacy flash offset computation but replaced DT_CHOSEN_Z_CODE_PARTITION with DT_CHOSEN_Z_FLASH as node reference hence using the flash base address instead of the partition offset value. Upstream PR #: 103587 Signed-off-by: Etienne Carriere --- Kconfig.zephyr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index d56bea555aa0..d25bd6ed6ad7 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -122,7 +122,7 @@ config FLASH_LOAD_OFFSET default $(sub_hex, $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)), \ $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if USE_DT_CODE_PARTITION && \ !FLASH_CODE_PARTITION_ADDRESS_INVALID - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) if USE_DT_CODE_PARTITION + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION default 0 help This option specifies the byte offset from the beginning of flash that From aa0c569a452102011ddc282de9e47f3d4c271419 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Fri, 6 Feb 2026 09:21:03 +0100 Subject: [PATCH 1743/3334] [nrf fromlist] kconfig: explicit invalid flash address acts on offset fallback value Swap the logic using FLASH_CODE_PARTITION_ADDRESS_INVALID to fallback to previous computation of flash offset when read from the DT. This change better highlight that the fallback is related to FLASH_CODE_PARTITION_ADDRESS_INVALID instead of showing the new computation relates to NOT(FLASH_CODE_PARTITION_ADDRESS_INVALID). No functional changes. Upstream PR #: 103587 Signed-off-by: Etienne Carriere --- Kconfig.zephyr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index d25bd6ed6ad7..89c45793bdfb 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -119,10 +119,10 @@ config FLASH_CODE_PARTITION_ADDRESS_INVALID config FLASH_LOAD_OFFSET # Only user-configurable when USE_DT_CODE_PARTITION is disabled hex "Kernel load offset" if !USE_DT_CODE_PARTITION + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) \ + if FLASH_CODE_PARTITION_ADDRESS_INVALID default $(sub_hex, $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)), \ - $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if USE_DT_CODE_PARTITION && \ - !FLASH_CODE_PARTITION_ADDRESS_INVALID - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION + $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if USE_DT_CODE_PARTITION default 0 help This option specifies the byte offset from the beginning of flash that From fe2e7d0129fa5d4ab4dbd13e0066e8cf02558ef9 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 9 Feb 2026 13:14:59 +0000 Subject: [PATCH 1744/3334] [nrf fromlist] boards: nordic: nrf54l15dk: Fix missing flash runner groups Fixes missing groups for the nrf54l05 and nrf54l10 emulated board targets Upstream PR #: 103755 Signed-off-by: Jamie McCrae --- boards/nordic/nrf54l15dk/board.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/boards/nordic/nrf54l15dk/board.yml b/boards/nordic/nrf54l15dk/board.yml index 8d97ef356a91..ec33e29bef34 100644 --- a/boards/nordic/nrf54l15dk/board.yml +++ b/boards/nordic/nrf54l15dk/board.yml @@ -23,6 +23,9 @@ runners: run: first groups: - boards: + - nrf54l15dk/nrf54l05/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuflpr @@ -35,6 +38,9 @@ runners: run: first groups: - boards: + - nrf54l15dk/nrf54l05/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuflpr @@ -47,6 +53,9 @@ runners: run: last groups: - boards: + - nrf54l15dk/nrf54l05/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuflpr From cdbac3df84ef91dfe0d384b7bf27dc08d8402c28 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 5 Feb 2026 13:38:09 +0100 Subject: [PATCH 1745/3334] [nrf fromtree] samples: subsys: usb: uvc: fix tags Use yaml list explict, make tags common. Signed-off-by: Piotr Kosycarz (cherry picked from commit 3bd2f123ac9de3780aece3cc4585637a95c28066) --- samples/subsys/usb/uvc/sample.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/samples/subsys/usb/uvc/sample.yaml b/samples/subsys/usb/uvc/sample.yaml index 558c0c8ee219..ea91e0dae139 100644 --- a/samples/subsys/usb/uvc/sample.yaml +++ b/samples/subsys/usb/uvc/sample.yaml @@ -6,11 +6,13 @@ common: type: one_line regex: - "Waiting the host to select the video format" + tags: + - usb + - video tests: sample.subsys.usb.uvc: depends_on: - usbd - tags: usb video extra_args: SNIPPET=video-sw-generator integration_platforms: - nrf52840dk/nrf52840 @@ -23,14 +25,12 @@ tests: sample.subsys.usb.uvc.camera: depends_on: - usbd - tags: usb video filter: dt_chosen_enabled("zephyr,camera") integration_platforms: - arduino_nicla_vision/stm32h747xx/m7 sample.subsys.usb.uvc.encoder.h264: depends_on: - usbd - tags: usb video extra_configs: - CONFIG_VIDEO_ENCODER_H264=y extra_args: @@ -42,7 +42,6 @@ tests: sample.subsys.usb.uvc.encoder.jpeg: depends_on: - usbd - tags: usb video extra_configs: - CONFIG_VIDEO_ENCODER_JPEG=y extra_args: From 725d58a5fc479cb98c3b7a33684d758eef648731 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 5 Feb 2026 13:41:22 +0100 Subject: [PATCH 1746/3334] [nrf fromtree] samples: drivers: display: use common tag This will quarantee that all configuration has some tag. Signed-off-by: Piotr Kosycarz (cherry picked from commit 57432fa59d9e1cac9e7e45c3d01b7a559567b358) --- samples/drivers/display/sample.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/samples/drivers/display/sample.yaml b/samples/drivers/display/sample.yaml index adc5b4b94301..0ec520831c68 100644 --- a/samples/drivers/display/sample.yaml +++ b/samples/drivers/display/sample.yaml @@ -1,12 +1,13 @@ sample: description: Sample application for displays name: display_sample +common: + tags: display tests: sample.display.sdl: build_only: true platform_allow: - native_sim/native/64 - tags: display sample.display.dummy: platform_allow: - native_sim @@ -14,7 +15,6 @@ tests: extra_configs: - CONFIG_SDL_DISPLAY=n - CONFIG_TEST=y - tags: display harness: console harness_config: fixture: fixture_display @@ -25,7 +25,6 @@ tests: platform_allow: - mimxrt595_evk/mimxrt595s/cm33 - mimxrt700_evk/mimxrt798s/cm33_cpu0 - tags: display harness: console extra_args: SHIELD=g1120b0mipi extra_configs: @@ -47,13 +46,11 @@ tests: harness: console harness_config: fixture: fixture_display - tags: display sample.display.st_b_lcd40_dsi1_mb1166_a09: filter: dt_compat_enabled("frida,nt35510") platform_allow: stm32h747i_disco/stm32h747xx/m7 extra_args: SHIELD=st_b_lcd40_dsi1_mb1166_a09 tags: - - display - shield harness: console harness_config: @@ -68,7 +65,6 @@ tests: - mimxrt1040_evk integration_platforms: - mimxrt1040_evk - tags: display harness: console extra_args: SHIELD=rk043fn02h_ct harness_config: From 60370afd41dee0f1becf8b591964ef89bfbb1d3f Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 5 Feb 2026 13:42:57 +0100 Subject: [PATCH 1747/3334] [nrf fromtree] samples: drivers: uart: async_api: make tags common This will quarantee all configuration has tags. Signed-off-by: Piotr Kosycarz (cherry picked from commit 49d01a37f737e2dbf84ab9aae3ea8ccd4d938929) --- samples/drivers/uart/async_api/sample.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/samples/drivers/uart/async_api/sample.yaml b/samples/drivers/uart/async_api/sample.yaml index 74c7c02131a1..410b6d050650 100644 --- a/samples/drivers/uart/async_api/sample.yaml +++ b/samples/drivers/uart/async_api/sample.yaml @@ -1,21 +1,19 @@ sample: name: UART ASYNC API driver sample +common: + tags: + - serial + - uart tests: sample.drivers.uart.async_api: integration_platforms: - nrf52840dk/nrf52840 - tags: - - serial - - uart filter: CONFIG_SERIAL and CONFIG_UART_ASYNC_API and dt_chosen_enabled("zephyr,shell-uart") and not CONFIG_UART_MCUX_LPUART harness: keyboard sample.drivers.uart.async_api.lpuart: - tags: - - serial - - uart filter: CONFIG_SERIAL and CONFIG_UART_ASYNC_API and dt_chosen_enabled("zephyr,shell-uart") and From 65008779d0c166710e97f327ce11c69ff2197da1 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 5 Feb 2026 13:48:38 +0100 Subject: [PATCH 1748/3334] [nrf fromtree] tests: arch: common: interrupt: make tags common This will quarantee all configuration has tag. Signed-off-by: Piotr Kosycarz (cherry picked from commit 06aa8847f072bd563a4121558f95a316e873b895) --- tests/arch/common/interrupt/testcase.yaml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/arch/common/interrupt/testcase.yaml b/tests/arch/common/interrupt/testcase.yaml index b11a688a1cef..ce4e04b9711e 100644 --- a/tests/arch/common/interrupt/testcase.yaml +++ b/tests/arch/common/interrupt/testcase.yaml @@ -1,15 +1,13 @@ +common: + tags: + - kernel + - interrupt tests: arch.interrupt: platform_exclude: qemu_cortex_m0 - tags: - - kernel - - interrupt filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE arch.interrupt.qemu_cortex_m0: platform_allow: qemu_cortex_m0 - tags: - - kernel - - interrupt filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: - CONFIG_QEMU_ICOUNT=y @@ -17,8 +15,6 @@ tests: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_MINIMAL_LIBC_SUPPORTED platform_exclude: qemu_cortex_m0 tags: - - kernel - - interrupt - libc extra_configs: - CONFIG_MINIMAL_LIBC=y @@ -26,8 +22,6 @@ tests: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_MINIMAL_LIBC_SUPPORTED platform_allow: qemu_cortex_m0 tags: - - kernel - - interrupt - libc extra_configs: - CONFIG_QEMU_ICOUNT=y @@ -44,9 +38,6 @@ tests: - xtensa # TODO: make test work on this arch - mips - tags: - - kernel - - interrupt extra_configs: - CONFIG_SHARED_INTERRUPTS=y filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE @@ -62,8 +53,6 @@ tests: # TODO: make test work on this arch - mips tags: - - kernel - - interrupt - lto extra_configs: - CONFIG_SHARED_INTERRUPTS=y From 4a35150931b8639d20701f94d1300dcdaf3010d4 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 5 Feb 2026 13:52:57 +0100 Subject: [PATCH 1749/3334] [nrf fromtree] tests: subsys: ipc: ipc_sessions: fix tags Use yaml list explicit. Signed-off-by: Piotr Kosycarz (cherry picked from commit 7e5c3601c309b3d43b6a419f5bb4b3798fb1993e) --- tests/subsys/ipc/ipc_sessions/testcase.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/subsys/ipc/ipc_sessions/testcase.yaml b/tests/subsys/ipc/ipc_sessions/testcase.yaml index d1dc3e5d5033..fd57a5f83bb4 100644 --- a/tests/subsys/ipc/ipc_sessions/testcase.yaml +++ b/tests/subsys/ipc/ipc_sessions/testcase.yaml @@ -4,7 +4,9 @@ sample: common: sysbuild: true - tags: ipc ipc_sessions + tags: + - ipc + - ipc_sessions harness: ztest tests: From e59011c9077626153883f7ba53c71b79774b497c Mon Sep 17 00:00:00 2001 From: Aksel Skauge Mellbye Date: Wed, 28 Jan 2026 11:19:23 +0100 Subject: [PATCH 1750/3334] [nrf fromtree] tests: drivers: uart: Enable uart_async_dual for xg24_rb4187c Enable two-uart test for xg24_rb4187c. Modify the pinout for the uart_loopback fixture to support two complete UARTs including flow control by connecting pins EXP[4,6,8,10] with EXP[7,9,11,13] on the expansion header. Signed-off-by: Aksel Skauge Mellbye (cherry picked from commit e995e0c10bff10ce163bbc4d20842f535208780a) --- .../boards/xg24_rb4187c.overlay | 4 +- .../boards/xg24_rb4187c.overlay | 93 +++++++++++++++++++ .../uart/uart_async_dual/testcase.yaml | 1 + .../boards/xg24_rb4187c.overlay | 4 +- 4 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 tests/drivers/uart/uart_async_dual/boards/xg24_rb4187c.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/xg24_rb4187c.overlay b/tests/drivers/uart/uart_async_api/boards/xg24_rb4187c.overlay index 79ca9a7e7c22..1dd14881ae14 100644 --- a/tests/drivers/uart/uart_async_api/boards/xg24_rb4187c.overlay +++ b/tests/drivers/uart/uart_async_api/boards/xg24_rb4187c.overlay @@ -5,7 +5,7 @@ */ /* - * Need to connect PC1 and PC2 of the Expension Pin header + * Need to connect PC1 and PA5 of the Expension Pin header */ / { chosen { @@ -24,7 +24,7 @@ }; group1 { - pins = ; + pins = ; input-enable; silabs,input-filter; }; diff --git a/tests/drivers/uart/uart_async_dual/boards/xg24_rb4187c.overlay b/tests/drivers/uart/uart_async_dual/boards/xg24_rb4187c.overlay new file mode 100644 index 000000000000..fb3713605ff8 --- /dev/null +++ b/tests/drivers/uart/uart_async_dual/boards/xg24_rb4187c.overlay @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2026, Silicon Laboratories Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Connect EXP[4,6,8,10] with EXP[7,9,11,13] on the Expension Pin header + */ +/ { + chosen { + zephyr,console = &eusart0; + zephyr,shell-uart = &eusart0; + zephyr,uart-pipe = &eusart0; + }; +}; + +&pinctrl { + usart0_default: usart0_default { + group0 { + pins = , ; + drive-push-pull; + output-high; + }; + + group1 { + pins = , ; + input-enable; + silabs,input-filter; + }; + }; + + eusart1_default: eusart1_default { + group0 { + pins = , ; + drive-push-pull; + output-high; + }; + + group1 { + pins = , ; + input-enable; + silabs,input-filter; + }; + }; + + eusart0_default: eusart0_default { + group0 { + pins = ; + drive-push-pull; + output-high; + }; + + group1 { + pins = ; + input-enable; + silabs,input-filter; + }; + }; +}; + +dut: &usart0 { + dmas = <&dma0 DMA_REQSEL_USART0TXBL>, + <&dma0 DMA_REQSEL_USART0RXDATAV>; + dma-names = "tx", "rx"; + pinctrl-0 = <&usart0_default>; + pinctrl-names = "default"; +}; + +dut_aux: &eusart1 { + compatible = "silabs,eusart-uart"; + current-speed = <115200>; + dmas = <&dma0 DMA_REQSEL_EUSART1TXFL>, + <&dma0 DMA_REQSEL_EUSART1RXFL>; + dma-names = "tx", "rx"; + pinctrl-0 = <&eusart1_default>; + pinctrl-names = "default"; + status = "okay"; + + /delete-property/ cs-gpios; +}; + +&eusart0 { + compatible = "silabs,eusart-uart"; + current-speed = <115200>; + pinctrl-0 = <&eusart0_default>; + pinctrl-names = "default"; + status = "okay"; +}; + +&dma0 { + status = "okay"; +}; diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index 1722d5e5e7d1..c03d6404e178 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -15,6 +15,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf9160dk/nrf9160 - nrf52_bsim + - xg24_rb4187c drivers.uart.async_dual.busy_sim: harness: ztest harness_config: diff --git a/tests/drivers/uart/uart_elementary/boards/xg24_rb4187c.overlay b/tests/drivers/uart/uart_elementary/boards/xg24_rb4187c.overlay index 0824d7f547d6..c166b4ba64a6 100644 --- a/tests/drivers/uart/uart_elementary/boards/xg24_rb4187c.overlay +++ b/tests/drivers/uart/uart_elementary/boards/xg24_rb4187c.overlay @@ -13,7 +13,7 @@ }; /* - * Connect EXP4 (PC1) and EXP6 (PC2) of the Expansion Pin header + * Connect EXP4 (PC1) and EXP7 (PA5) of the Expansion Pin header */ &pinctrl { @@ -39,7 +39,7 @@ }; group1 { - pins = ; /* WPK EXP6 (PC2) */ + pins = ; /* WPK EXP7 (PA5) */ input-enable; silabs,input-filter; }; From 96852355e4503e5e65a5f39b0e26b4404299c8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 25 Nov 2025 13:52:47 +0100 Subject: [PATCH 1751/3334] [nrf fromtree] tests: drivers: uart: async_dual: Fix nrf9160dk configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To pass the test with chopped TX data a dedicated TIMER for byte counting need to be used. Signed-off-by: Krzysztof Chruściński (cherry picked from commit c3d5ff1ad0c0a76f801fd96a5685970c65b3b9df) --- .../drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf | 3 ++- tests/drivers/uart/uart_async_dual/testcase.yaml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf index 4da3788618f3..025b92361475 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf +++ b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf @@ -1 +1,2 @@ -CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index c03d6404e178..3d1c43ed621f 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -89,3 +89,4 @@ tests: extra_configs: - CONFIG_TEST_CHOPPED_TX=n - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER=n + - CONFIG_UART_1_NRF_HW_ASYNC=n From adc8e8f57f77496a35bf229bda36cd5815ceeca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 25 Nov 2025 16:14:14 +0100 Subject: [PATCH 1752/3334] [nrf fromtree] drivers: serial: nrfx_uarte: Cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove parts of implementation which are no longer in use. Signed-off-by: Krzysztof Chruściński (cherry picked from commit dba9997a50ca0bd25951110b5d54c293f0c09615) --- drivers/serial/Kconfig.nrfx | 4 + drivers/serial/uart_nrfx_uarte.c | 292 ++++++------------ .../boards/nrf5340bsim_nrf5340_cpuapp.conf | 1 - 3 files changed, 97 insertions(+), 200 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index f931a30f0f8e..53fa3ab54de6 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -39,7 +39,11 @@ config UART_NRFX_UARTE_ENHANCED_RX depends on UART_ASYNC_API depends on !(UART_0_NRF_HW_ASYNC || UART_1_NRF_HW_ASYNC || UART_2_NRF_HW_ASYNC) default y + select DEPRECATED help + Option is deprecated as it is used as default unless TIMER peripheral is used + for RX byte counting. + Enable RX handling mode which is switching buffers on timeout. This is an enhancement compared to other two modes (default and hardware assisted). Default mode could miscount bytes when interrupt was not handled on time diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 8258aab48255..7da1d8097f9a 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -204,25 +204,14 @@ struct uarte_async_rx { size_t offset; uint8_t *next_buf; size_t next_buf_len; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - uint32_t idle_cnt; -#endif k_timeout_t timeout; -#else - uint32_t total_byte_cnt; /* Total number of bytes received */ +#ifdef UARTE_ANY_HW_ASYNC uint32_t total_user_byte_cnt; /* Total number of bytes passed to user */ - int32_t timeout_us; /* Timeout set by user */ - int32_t timeout_slab; /* rx_timeout divided by RX_TIMEOUT_DIV */ - int32_t timeout_left; /* Current time left until user callback */ - union { - nrfx_gppi_handle_t ppi; - uint32_t cnt; - } cnt; + nrfx_gppi_handle_t ppi; /* Flag to ensure that RX timeout won't be executed during ENDRX ISR */ volatile bool is_in_irq; -#endif /* CONFIG_UART_NRFX_UARTE_ENHANCED_RX */ +#endif /* UARTE_ANY_HW_ASYNC */ + uint8_t idle_cnt; uint8_t flush_cnt; volatile bool enabled; volatile bool discard_fifo; @@ -455,11 +444,10 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) return; } -#if defined(UARTE_ANY_ASYNC) && !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(UARTE_ANY_HW_ASYNC) if (data->async && HW_RX_COUNTING_ENABLED(config)) { nrfx_timer_disable(&data->timer); /* Timer/counter value is reset when disabled. */ - data->async->rx.total_byte_cnt = 0; data->async->rx.total_user_byte_cnt = 0; } #endif @@ -942,7 +930,7 @@ static int uarte_nrfx_rx_disable(const struct device *dev) return rx_disable(dev, true); } -#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(UARTE_ANY_HW_ASYNC) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } static int uarte_nrfx_rx_counting_init(const struct device *dev) @@ -951,40 +939,35 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) const struct uarte_nrfx_config *cfg = dev->config; NRF_UARTE_Type *uarte = get_uarte_instance(dev); int ret; + nrfx_timer_config_t tmr_config = NRFX_TIMER_DEFAULT_CONFIG( + NRF_TIMER_BASE_FREQUENCY_GET(data->timer.p_reg)); + uint32_t evt_addr = nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_RXDRDY); + uint32_t tsk_addr = nrfx_timer_task_address_get(&data->timer, NRF_TIMER_TASK_COUNT); + + tmr_config.mode = NRF_TIMER_MODE_COUNTER; + tmr_config.bit_width = NRF_TIMER_BIT_WIDTH_32; + ret = nrfx_timer_init(&data->timer, + &tmr_config, + timer_handler); + if (ret != 0) { + LOG_ERR("Timer already initialized"); + return -EINVAL; + } - if (HW_RX_COUNTING_ENABLED(cfg)) { - nrfx_timer_config_t tmr_config = NRFX_TIMER_DEFAULT_CONFIG( - NRF_TIMER_BASE_FREQUENCY_GET(data->timer.p_reg)); - uint32_t evt_addr = nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_RXDRDY); - uint32_t tsk_addr = nrfx_timer_task_address_get(&data->timer, NRF_TIMER_TASK_COUNT); - - tmr_config.mode = NRF_TIMER_MODE_COUNTER; - tmr_config.bit_width = NRF_TIMER_BIT_WIDTH_32; - ret = nrfx_timer_init(&data->timer, - &tmr_config, - timer_handler); - if (ret != 0) { - LOG_ERR("Timer already initialized"); - return -EINVAL; - } - - nrfx_timer_clear(&data->timer); - - ret = nrfx_gppi_conn_alloc(evt_addr, tsk_addr, &data->async->rx.cnt.ppi); - if (ret < 0) { - LOG_ERR("Failed to allocate PPI Channel"); - nrfx_timer_uninit(&data->timer); - return ret; - } + nrfx_timer_clear(&cfg->timer); - nrfx_gppi_conn_enable(data->async->rx.cnt.ppi); - } else { - nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); + ret = nrfx_gppi_conn_alloc(evt_addr, tsk_addr, &data->async->rx.cnt.ppi); + if (ret < 0) { + LOG_ERR("Failed to allocate PPI Channel"); + nrfx_timer_uninit(&data->timer); + return ret; } + nrfx_gppi_conn_enable(data->async->rx.cnt.ppi); + return 0; } -#endif /* !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) */ +#endif /* !defined(UARTE_ANY_HW_ASYNC) */ #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER @@ -1391,7 +1374,6 @@ static void cbwt_rx_timeout(struct k_timer *timer) /* TIMER or UARTE interrupt preempted. Lets try again * later. */ - k_timer_start(timer, async_rx->timeout, K_NO_WAIT); return; } irq_disable(cfg->uarte_irqn); @@ -1400,6 +1382,7 @@ static void cbwt_rx_timeout(struct k_timer *timer) nrf_uarte_int_enable(cfg->uarte_regs, NRF_UARTE_INT_RXDRDY_MASK); notify_new_data(dev, true); + k_timer_stop(timer); if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { irq_enable(cfg->uarte_irqn); @@ -1408,8 +1391,6 @@ static void cbwt_rx_timeout(struct k_timer *timer) return; } } - - k_timer_start(timer, async_rx->timeout, K_NO_WAIT); } static void cbwt_rx_flush_handle(const struct device *dev) @@ -1640,9 +1621,7 @@ static int uarte_async_init(const struct device *dev) NRF_UARTE_INT_ENDRX_MASK | NRF_UARTE_INT_RXSTARTED_MASK | NRF_UARTE_INT_ERROR_MASK | - NRF_UARTE_INT_RXTO_MASK | - ((IS_ENABLED(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && - !IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) ? NRF_UARTE_INT_RXDRDY_MASK : 0); + NRF_UARTE_INT_RXTO_MASK; k_timer_init(&data->async->rx.timer, rx_timeout, NULL); k_timer_user_data_set(&data->async->rx.timer, (void *)dev); @@ -1655,11 +1634,15 @@ static int uarte_async_init(const struct device *dev) } #endif -#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) - int ret = uarte_nrfx_rx_counting_init(dev); +#if defined(UARTE_ANY_HW_ASYNC) + const struct uarte_nrfx_config *cfg = dev->config; + int ret; - if (ret != 0) { - return ret; + if (HW_RX_COUNTING_ENABLED(cfg)) { + ret = uarte_nrfx_rx_counting_init(dev); + if (ret != 0) { + return ret; + } } #endif @@ -1674,7 +1657,6 @@ static int uarte_async_init(const struct device *dev) */ static void start_tx_locked(const struct device *dev, struct uarte_nrfx_data *data) { - nrf_uarte_int_enable(get_uarte_instance(dev), NRF_UARTE_INT_TXSTOPPED_MASK); if (!is_tx_ready(dev)) { /* Active poll out, postpone until it is completed. */ data->async->tx.pending = true; @@ -1683,6 +1665,7 @@ static void start_tx_locked(const struct device *dev, struct uarte_nrfx_data *da data->async->tx.amount = -1; tx_start(dev, data->async->tx.xfer_buf, data->async->tx.xfer_len); } + nrf_uarte_int_enable(get_uarte_instance(dev), NRF_UARTE_INT_TXSTOPPED_MASK); } /* Setup cache buffer (used for sending data outside of RAM memory). @@ -1808,11 +1791,7 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, struct uarte_async_rx *async_rx = &data->async->rx; const struct uarte_nrfx_config *cfg = dev->config; NRF_UARTE_Type *uarte = get_uarte_instance(dev); - -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) bool with_timeout = timeout != SYS_FOREVER_US; -#endif if (cfg->disable_rx) { __ASSERT(false, "TX only UARTE instance"); @@ -1842,9 +1821,6 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } #endif -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - #ifdef UARTE_HAS_FRAME_TIMEOUT if (!IS_CBWT(dev) && with_timeout) { uint32_t baudrate = COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, @@ -1853,9 +1829,6 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_FRAME_TIMEOUT_STOPRX); } #endif -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - async_rx->idle_cnt = 0; -#endif if (with_timeout) { if (!IS_CBWT(dev) && IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) { @@ -1867,10 +1840,6 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } else { async_rx->timeout = K_NO_WAIT; } -#else - async_rx->timeout_us = timeout; - async_rx->timeout_slab = timeout / RX_TIMEOUT_DIV; -#endif async_rx->buf = buf; async_rx->buf_len = len; @@ -1929,13 +1898,11 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, NRFX_IRQ_PENDING_SET(nrfx_get_irq_number(uarte)); return 0; } else { -#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX if (with_timeout) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); k_timer_start(&async_rx->timer, async_rx->timeout, - K_NO_WAIT); + async_rx->timeout); } -#endif } } } @@ -2033,6 +2000,36 @@ static void tx_timeout(struct k_timer *timer) (void) uarte_nrfx_tx_abort(dev); } +/** Function is called when idle state is detected on the line. Notify user + * all pending data. + */ +#ifndef UARTE_HAS_FRAME_TIMEOUT +static void hw_count_rx_timeout(const struct device *dev) +{ +#ifdef UARTE_ANY_HW_ASYNC + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + const struct uarte_nrfx_config *cfg = dev->config; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + uint32_t len; + + if (async_rx->is_in_irq == true) { + return; + } + irq_disable(nrfx_get_irq_number(uarte)); + + len = nrfx_timer_capture(&cfg->timer, 0) - async_rx->total_user_byte_cnt; + if ((len > 0) && ((len + async_rx->offset) < async_rx->buf_len)) { + notify_uart_rx_rdy(dev, len); + async_rx->offset += len; + async_rx->total_user_byte_cnt += len; + } + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); + irq_enable(nrfx_get_irq_number(uarte)); +#endif +} +#endif + /** * Whole timeout is divided by RX_TIMEOUT_DIV into smaller units, rx_timeout * is executed periodically every rx_timeout_slab us. If between executions @@ -2044,8 +2041,6 @@ static void tx_timeout(struct k_timer *timer) static void rx_timeout(struct k_timer *timer) { const struct device *dev = k_timer_user_data_get(timer); - -#if CONFIG_UART_NRFX_UARTE_ENHANCED_RX NRF_UARTE_Type *uarte = get_uarte_instance(dev); #ifdef UARTE_HAS_FRAME_TIMEOUT @@ -2063,12 +2058,13 @@ static void rx_timeout(struct k_timer *timer) if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND) && (atomic_and(&data->flags, ~UARTE_FLAG_FTIMEOUT_WATCH) & UARTE_FLAG_FTIMEOUT_WATCH)) { if (rxdrdy) { + k_timer_start(timer, async_rx->timeout, K_NO_WAIT); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); - k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); } } else { if (!rxdrdy) { nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + k_timer_stop(timer); } } @@ -2076,6 +2072,7 @@ static void rx_timeout(struct k_timer *timer) #else /* UARTE_HAS_FRAME_TIMEOUT */ struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; + const struct uarte_nrfx_config *cfg = dev->config; if (nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY)) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); @@ -2091,94 +2088,16 @@ static void rx_timeout(struct k_timer *timer) * then RX notification would come after (RX_TIMEOUT_DIV + 1) * timeout. */ if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + k_timer_stop(timer); + if (HW_RX_COUNTING_ENABLED(cfg)) { + hw_count_rx_timeout(dev); + } else { + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + } return; } } - - k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); #endif /* UARTE_HAS_FRAME_TIMEOUT */ -#else /* CONFIG_UART_NRFX_UARTE_ENHANCED_RX */ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - uint32_t read; - - if (async_rx->is_in_irq) { - return; - } - - /* Disable ENDRX ISR, in case ENDRX event is generated, it will be - * handled after rx_timeout routine is complete. - */ - nrf_uarte_int_disable(get_uarte_instance(dev), - NRF_UARTE_INT_ENDRX_MASK); - - if (HW_RX_COUNTING_ENABLED(cfg)) { - read = nrfx_timer_capture(&data->timer, 0); - } else { - read = async_rx->cnt.cnt; - } - - /* Check if data was received since last function call */ - if (read != async_rx->total_byte_cnt) { - async_rx->total_byte_cnt = read; - async_rx->timeout_left = async_rx->timeout_us; - } - - /* Check if there is data that was not sent to user yet - * Note though that 'len' is a count of data bytes received, but not - * necessarily the amount available in the current buffer - */ - int32_t len = async_rx->total_byte_cnt - async_rx->total_user_byte_cnt; - - if (!HW_RX_COUNTING_ENABLED(cfg) && - (len < 0)) { - /* Prevent too low value of rx_cnt.cnt which may occur due to - * latencies in handling of the RXRDY interrupt. - * At this point, the number of received bytes is at least - * equal to what was reported to the user. - */ - async_rx->cnt.cnt = async_rx->total_user_byte_cnt; - len = 0; - } - - /* Check for current buffer being full. - * if the UART receives characters before the ENDRX is handled - * and the 'next' buffer is set up, then the SHORT between ENDRX and - * STARTRX will mean that data will be going into to the 'next' buffer - * until the ENDRX event gets a chance to be handled. - */ - bool clipped = false; - - if (len + async_rx->offset > async_rx->buf_len) { - len = async_rx->buf_len - async_rx->offset; - clipped = true; - } - - if (len > 0) { - if (clipped || (async_rx->timeout_left < async_rx->timeout_slab)) { - /* rx_timeout us elapsed since last receiving */ - if (async_rx->buf != NULL) { - notify_uart_rx_rdy(dev, len); - async_rx->offset += len; - async_rx->total_user_byte_cnt += len; - } - } else { - async_rx->timeout_left -= async_rx->timeout_slab; - } - - /* If there's nothing left to report until the buffers are - * switched then the timer can be stopped - */ - if (clipped) { - k_timer_stop(&async_rx->timer); - } - } - - nrf_uarte_int_enable(get_uarte_instance(dev), - NRF_UARTE_INT_ENDRX_MASK); -#endif /* CONFIG_UART_NRFX_UARTE_ENHANCED_RX */ } #define UARTE_ERROR_FROM_MASK(mask) \ @@ -2211,24 +2130,14 @@ static void rxstarted_isr(const struct device *dev) .type = UART_RX_BUF_REQUEST, }; -#ifndef UARTE_HAS_FRAME_TIMEOUT +#if !defined(UARTE_HAS_FRAME_TIMEOUT) struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; - -#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX NRF_UARTE_Type *uarte = get_uarte_instance(dev); if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); } -#else - if (async_rx->timeout_us != SYS_FOREVER_US) { - k_timeout_t timeout = K_USEC(async_rx->timeout_slab); - - async_rx->timeout_left = async_rx->timeout_us; - k_timer_start(&async_rx->timer, timeout, timeout); - } -#endif /* CONFIG_UART_NRFX_UARTE_ENHANCED_RX */ #endif /* !UARTE_HAS_FRAME_TIMEOUT */ user_callback(dev, &evt); } @@ -2239,7 +2148,7 @@ static void endrx_isr(const struct device *dev) struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); -#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(UARTE_ANY_HW_ASYNC) async_rx->is_in_irq = true; #endif @@ -2277,7 +2186,7 @@ static void endrx_isr(const struct device *dev) rx_len = 0; } -#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(UARTE_ANY_HW_ASYNC) async_rx->total_user_byte_cnt += rx_len; #endif @@ -2343,7 +2252,7 @@ static void endrx_isr(const struct device *dev) #endif } -#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(UARTE_ANY_HW_ASYNC) async_rx->is_in_irq = false; #endif } @@ -2423,7 +2332,7 @@ static void rxto_isr(const struct device *dev) */ if (async_rx->discard_fifo) { async_rx->discard_fifo = false; -#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(UARTE_ANY_HW_ASYNC) if (HW_RX_COUNTING_ENABLED(config)) { /* It need to be included because TIMER+PPI got RXDRDY events * and counted those flushed bytes. @@ -2435,7 +2344,6 @@ static void rxto_isr(const struct device *dev) async_rx->flush_cnt = rx_flush(dev); } -#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX NRF_UARTE_Type *uarte = get_uarte_instance(dev); if (IS_ENABLED(CONFIG_HAS_HW_NRF_UARTE120) && (config->flags & UARTE_CFG_FLAG_CACHEABLE)) { /* Spurious RXTO event was seen on fast instance (UARTE120) thus @@ -2447,7 +2355,6 @@ static void rxto_isr(const struct device *dev) nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_FRAME_TIMEOUT_STOPRX); #endif nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); -#endif rx_disable_finalize(dev); } @@ -2538,21 +2445,12 @@ static void txstopped_isr(const struct device *dev) static void rxdrdy_isr(const struct device *dev) { -#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) struct uarte_nrfx_data *data = dev->data; - -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) - NRF_UARTE_Type *uarte = get_uarte_instance(dev); data->async->rx.idle_cnt = 0; - k_timer_start(&data->async->rx.timer, data->async->rx.timeout, K_NO_WAIT); + k_timer_start(&data->async->rx.timer, data->async->rx.timeout, data->async->rx.timeout); nrf_uarte_int_disable(uarte, NRF_UARTE_INT_RXDRDY_MASK); -#else - data->async->rx.cnt.cnt++; -#endif -#endif /* !UARTE_HAS_FRAME_TIMEOUT */ } static bool event_check_clear(NRF_UARTE_Type *uarte, nrf_uarte_event_t event, @@ -2570,16 +2468,13 @@ static void uarte_nrfx_isr_async(const void *arg) { const struct device *dev = arg; NRF_UARTE_Type *uarte = get_uarte_instance(dev); - const struct uarte_nrfx_config *config = dev->config; struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); - if ((IS_CBWT(dev) || - !(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT))) && + if ((!IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT) || IS_CBWT(dev)) && event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { rxdrdy_isr(dev); - } if (event_check_clear(uarte, NRF_UARTE_EVENT_ERROR, NRF_UARTE_INT_ERROR_MASK, imask)) { @@ -2736,14 +2631,14 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c) } } + *config->poll_out_byte = c; + tx_start(dev, config->poll_out_byte, 1); + if (!IS_ENABLED(CONFIG_UART_NRFX_UARTE_NO_IRQ) && (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) || LOW_POWER_ENABLED(config))) { nrf_uarte_int_enable(uarte, NRF_UARTE_INT_TXSTOPPED_MASK); } - *config->poll_out_byte = c; - tx_start(dev, config->poll_out_byte, 1); - irq_unlock(key); if (IS_ENABLED(CONFIG_UART_NRFX_UARTE_NO_IRQ)) { @@ -3086,11 +2981,10 @@ static void uarte_pm_suspend(const struct device *dev) wait_for_tx_stopped(dev); } -#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) +#if defined(UARTE_ANY_HW_ASYNC) if (data->async && HW_RX_COUNTING_ENABLED(cfg)) { nrfx_timer_disable(&data->timer); /* Timer/counter value is reset when disabled. */ - data->async->rx.total_byte_cnt = 0; data->async->rx.total_user_byte_cnt = 0; } #endif @@ -3277,8 +3171,8 @@ static int uarte_instance_deinit(const struct device *dev) #define UARTE_HAS_VAR_PRIO(idx) \ COND_CODE_1(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ UARTE_HAS_PROP(idx, timer)), \ - ((DT_IRQ(UARTE(idx), priority) != DT_IRQ(DT_NODELABEL(grtc), priority)) ? \ - UARTE_CFG_FLAG_VAR_IRQ : 0), (0)) + (((DT_IRQ(UARTE(idx), priority) != DT_IRQ(DT_NODELABEL(grtc), priority)) ? \ + UARTE_CFG_FLAG_VAR_IRQ : 0)), (0)) #define UARTE_GET_ISR(idx) \ diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf index e7a460fde6bb..3a15540b2dd5 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -1,2 +1 @@ CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 -CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y From 820d855483faa390a19070f76859782f463c45ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 21 Nov 2025 13:08:21 +0100 Subject: [PATCH 1753/3334] [nrf fromtree] drivers: serial: nrfx_uarte: Fix short RX buffers handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Interrupt handler was handling events in a following order: ENDRX, RXSTARTED, RXTO. This could lead to error if RX buffer is short then with high baudrate RXSTARTED for the current buffer could be handled together with ENDRX and in that case uart_rx_buf_rsp called from RXSTARTED would return error as reception is already finished due to handled ENDRX. Reworking the driver to change that order to RXSTARTED, ENDRX, RXTO. Additionally, driver is optimize to only check HW events for enabled interrupts. To achieve that, RX path interrupts are all disabled then RX is disabled. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 7979d37f42b23e50cf0999fbf714414ab3c54317) --- drivers/serial/uart_nrfx_uarte.c | 124 ++++++++++++++++--------------- 1 file changed, 63 insertions(+), 61 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 7da1d8097f9a..38d70b1dd663 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -855,8 +855,15 @@ static void rx_disable_finalize(const struct device *dev) struct uart_event evt = { .type = UART_RX_DISABLED, }; + static const uint32_t rx_int_mask = + NRF_UARTE_INT_ENDRX_MASK | + NRF_UARTE_INT_RXSTARTED_MASK | + NRF_UARTE_INT_ERROR_MASK | + NRF_UARTE_INT_RXTO_MASK | + NRF_UARTE_INT_RXDRDY_MASK; async_rx->enabled = false; + nrf_uarte_int_disable(get_uarte_instance(dev), rx_int_mask); if (LOW_POWER_ENABLED(cfg)) { uint32_t key = irq_lock(); @@ -1616,12 +1623,6 @@ static int cbwt_uarte_async_init(const struct device *dev) static int uarte_async_init(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - static const uint32_t rx_int_mask = - NRF_UARTE_INT_ENDRX_MASK | - NRF_UARTE_INT_RXSTARTED_MASK | - NRF_UARTE_INT_ERROR_MASK | - NRF_UARTE_INT_RXTO_MASK; k_timer_init(&data->async->rx.timer, rx_timeout, NULL); k_timer_user_data_set(&data->async->rx.timer, (void *)dev); @@ -1646,8 +1647,6 @@ static int uarte_async_init(const struct device *dev) } #endif - nrf_uarte_int_enable(uarte, rx_int_mask); - return 0; } @@ -1914,14 +1913,16 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, * RXTO interrupt is kept enabled only when RX is active. */ nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); - nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXTO_MASK); } - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + static const uint32_t rx_int_mask = + NRF_UARTE_INT_ENDRX_MASK | + NRF_UARTE_INT_RXSTARTED_MASK | + NRF_UARTE_INT_ERROR_MASK | + NRF_UARTE_INT_RXTO_MASK; + nrf_uarte_int_enable(uarte, rx_int_mask); async_rx->enabled = true; - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); return 0; @@ -2130,7 +2131,7 @@ static void rxstarted_isr(const struct device *dev) .type = UART_RX_BUF_REQUEST, }; -#if !defined(UARTE_HAS_FRAME_TIMEOUT) +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && !defined(UARTE_HAS_FRAME_TIMEOUT) struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); @@ -2138,11 +2139,11 @@ static void rxstarted_isr(const struct device *dev) if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); } -#endif /* !UARTE_HAS_FRAME_TIMEOUT */ +#endif user_callback(dev, &evt); } -static void endrx_isr(const struct device *dev) +static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) { struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; @@ -2152,11 +2153,6 @@ static void endrx_isr(const struct device *dev) async_rx->is_in_irq = true; #endif - /* ensure rx timer is stopped - it will be restarted in RXSTARTED - * handler if needed - */ - k_timer_stop(&async_rx->timer); - /* this is the amount that the EasyDMA controller has copied into the * buffer */ @@ -2226,11 +2222,13 @@ static void endrx_isr(const struct device *dev) } #endif - /* Check is based on assumption that ISR handler handles - * ENDRX before RXSTARTED so if short was set on time, RXSTARTED - * event will be set. + /* Remove the short until the subsequent next buffer is setup */ + nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); + + /* If RXSTARTED is not set then it means that second buffer was + * provided not on time. */ - if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED)) { + if (!rxstarted && !rxto) { nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND)) { @@ -2238,9 +2236,10 @@ static void endrx_isr(const struct device *dev) start_timeout = true; } } - /* Remove the short until the subsequent next buffer is setup */ - nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); } else { + if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { + k_timer_stop(&async_rx->timer); + } nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); } @@ -2456,7 +2455,7 @@ static void rxdrdy_isr(const struct device *dev) static bool event_check_clear(NRF_UARTE_Type *uarte, nrf_uarte_event_t event, uint32_t int_mask, uint32_t int_en_mask) { - if (nrf_uarte_event_check(uarte, event) && (int_mask & int_en_mask)) { + if ((int_mask & int_en_mask) && nrf_uarte_event_check(uarte, event)) { nrf_uarte_event_clear(uarte, event); return true; } @@ -2471,52 +2470,54 @@ static void uarte_nrfx_isr_async(const void *arg) struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); + bool rxto, endrx, rxstarted, rxdrdy, error; - if ((!IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT) || IS_CBWT(dev)) && - event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { - rxdrdy_isr(dev); + /* Order of reading those events is important as it must be ensured that processing + * order is maintained. + */ + rxto = event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask); + endrx = event_check_clear(uarte, NRF_UARTE_EVENT_ENDRX, NRF_UARTE_INT_ENDRX_MASK, imask); + rxdrdy = event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask); + rxstarted = event_check_clear(uarte, NRF_UARTE_EVENT_RXSTARTED, + NRF_UARTE_INT_RXSTARTED_MASK, imask); + error = event_check_clear(uarte, NRF_UARTE_EVENT_ERROR, NRF_UARTE_INT_ERROR_MASK, imask); + + if (error) { + error_isr(dev); } - if (event_check_clear(uarte, NRF_UARTE_EVENT_ERROR, NRF_UARTE_INT_ERROR_MASK, imask)) { - error_isr(dev); + if (rxdrdy) { + rxdrdy_isr(dev); } - if (event_check_clear(uarte, NRF_UARTE_EVENT_ENDRX, NRF_UARTE_INT_ENDRX_MASK, imask)) { - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); - endrx_isr(dev); + /* If next buffer is already provided then handle ENDRX before RXSTARTED. */ + if ((endrx || rxstarted) && (async_rx->next_buf != NULL)) { + if (!endrx) { + __ASSERT_NO_MSG(nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); + } + endrx_isr(dev, rxstarted, rxto); + endrx = false; } - /* RXSTARTED must be handled after ENDRX because it starts the RX timeout - * and if order is swapped then ENDRX will stop this timeout. - * Skip if ENDRX is set when RXSTARTED is set. It means that - * ENDRX occurred after check for ENDRX in isr which may happen when - * UARTE interrupt got preempted. Events are not cleared - * and isr will be called again. ENDRX will be handled first. - */ - if ((imask & NRF_UARTE_INT_RXSTARTED_MASK) && - nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED) && - !nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) { - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + if (rxstarted) { rxstarted_isr(dev); } + if (endrx) { + endrx_isr(dev, false, false); + } + + if (rxto) { #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev) && - event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask)) { - cbwt_rxto_isr(dev, true); - } else -#endif - /* RXTO must be handled after ENDRX which should notify the buffer. - * Skip if ENDRX is set when RXTO is set. It means that - * ENDRX occurred after check for ENDRX in isr which may happen when - * UARTE interrupt got preempted. Events are not cleared - * and isr will be called again. ENDRX will be handled first. - */ - if ((imask & NRF_UARTE_INT_RXTO_MASK) && - nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXTO) && - !nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) { - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); + if (IS_CBWT(dev)) { + cbwt_rxto_isr(dev, true); + } else { + rxto_isr(dev); + } +#else rxto_isr(dev); +#endif } if (!IS_ENABLED(UARTE_HAS_ENDTX_STOPTX_SHORT) && @@ -2533,6 +2534,7 @@ static void uarte_nrfx_isr_async(const void *arg) if (!IS_CBWT(dev) && (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO)) { #ifdef CONFIG_HAS_NORDIC_DMM + const struct uarte_nrfx_config *config = dev->config; int ret; ret = dmm_buffer_in_release(config->mem_reg, async_rx->usr_buf, async_rx->buf_len, From 59ff9bfc731b2f0b3730047966ff312d32a87cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 26 Nov 2025 16:16:35 +0100 Subject: [PATCH 1754/3334] [nrf fromtree] tests: drivers: uart: async_dual: Extend test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend test to run a scenario where receiver is continuously providing 1 byte buffers and tries to receive loselessly data to that short buffers. Signed-off-by: Krzysztof Chruściński (cherry picked from commit d19693e865491e534ce8ecc8d1c78839e1fcd3c1) --- tests/drivers/uart/uart_async_dual/prj.conf | 1 + tests/drivers/uart/uart_async_dual/src/main.c | 54 +++++++++++++++---- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/prj.conf b/tests/drivers/uart/uart_async_dual/prj.conf index aaf360d69136..8c838a67e465 100644 --- a/tests/drivers/uart/uart_async_dual/prj.conf +++ b/tests/drivers/uart/uart_async_dual/prj.conf @@ -1,6 +1,7 @@ CONFIG_ZTEST=y CONFIG_RING_BUFFER=y CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_XOSHIRO_RANDOM_GENERATOR=y CONFIG_SERIAL=y CONFIG_UART_ASYNC_API=y CONFIG_UART_USE_RUNTIME_CONFIGURE=y diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index 160d8c761040..d2ef48f83aa4 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -145,6 +145,7 @@ enum test_rx_mode { RX_CONT, RX_DIS, RX_ALL, + RX_CONT_1BYTE_BUF, }; typedef bool (*test_on_rx_rdy_t)(const struct device *dev, uint8_t *buf, size_t len); @@ -355,9 +356,12 @@ static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) { int err; - zassert_equal(buf, rx_data.hdr); + if (rx_data.mode != RX_CONT_1BYTE_BUF) { + zassert_equal(buf, rx_data.hdr); + } zassert_equal(len, 1); - if (rx_data.hdr[0] == 1) { + + if (buf[0] == 1) { /* single byte packet. */ if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); @@ -368,14 +372,15 @@ static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) zassert_equal(rx_data.payload_idx, 0); rx_data.on_rx_rdy = on_rx_rdy_payload; - rx_data.payload_idx = rx_data.hdr[0] - 1; + rx_data.payload_idx = buf[0] - 1; rx_data.state = RX_PAYLOAD; if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - size_t l = rx_data.hdr[0] - 1; + size_t l = buf[0] - 1; zassert_true(l > 0); rx_data.buf_req = false; err = uart_rx_buf_rsp(dev, rx_data.buf, buf[0] - 1); + zassert_equal(err, 0); } return true; @@ -383,16 +388,21 @@ static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) static void on_rx_buf_req(const struct device *dev) { - if (rx_data.mode != RX_ALL) { + uint8_t *buf; + size_t len; + int err; + + if ((rx_data.mode == RX_CONT) || (rx_data.mode == RX_DIS)) { rx_data.buf_req = true; return; } - size_t len = sizeof(rx_data.buf) / 2; - uint8_t *buf = &rx_data.buf[len * rx_data.buf_idx]; - + len = (rx_data.mode == RX_CONT_1BYTE_BUF) ? 1 : sizeof(rx_data.buf) / 2; + buf = &rx_data.buf[len * rx_data.buf_idx]; rx_data.buf_idx = (rx_data.buf_idx + 1) & 0x1; - uart_rx_buf_rsp(dev, buf, len); + + err = uart_rx_buf_rsp(dev, buf, len); + zassert_equal(err, 0); } static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *user_data) @@ -650,6 +660,25 @@ ZTEST(uart_async_dual, test_var_packets_cont_hwfc_1m) var_packet(1000000, TX_PACKETS, RX_CONT, true); } +ZTEST(uart_async_dual, test_var_packets_1byte_rx_hwfc) +{ + /* TX in packet mode, RX in CONT mode, 1M */ + var_packet(115200, TX_PACKETS, RX_CONT_1BYTE_BUF, true); +} + +ZTEST(uart_async_dual, test_var_packets_1byte_rx_hwfc_1m) +{ + if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { + /* Providing 1 byte buffers all the time generates too much cpu load + * to handle with additional busy simulator loading the cpu. + */ + ztest_test_skip(); + } + + /* TX in packet mode, RX in CONT mode, 1M */ + var_packet(1000000, TX_PACKETS, RX_CONT_1BYTE_BUF, true); +} + ZTEST(uart_async_dual, test_var_packets_chopped_all) { if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { @@ -953,7 +982,7 @@ static void hci_like_test(uint32_t baudrate) /* Flush data. */ (void)uart_tx_abort(tx_dev); - k_msleep(10); + k_sleep(K_USEC(TX_TIMEOUT * 12 / 10)); PM_CHECK(tx_dev, rx_dev, false); (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); @@ -983,6 +1012,11 @@ static void *setup(void) { static int idx; + /* First call will initialize the test random generator and it needs to be done + * from a thread context. + */ + (void)sys_rand8_get(); + rx_dev = duts[idx].dev; if (duts[idx].dev_aux == NULL) { TC_PRINT("Single UART test on instance:%s\n", duts[idx].name); From 7ffec3996cdf7629c6c7ba2420cd80ec1bda8b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 24 Nov 2025 10:03:05 +0100 Subject: [PATCH 1755/3334] [nrf fromtree] tests: drivers: uart: async_dual: Add pull-up to sleep state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add pull-ups to all pins when in sleep state. Otherwise, those pins are floating and can lead to test failures. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 0e7e8471110abf9bcf8d9c65b9dccaeb1ca64592) --- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 8 +++++++- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 8 +++++++- .../uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi index c44628969d69..7dbe2caff1ee 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -1,4 +1,8 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ &pinctrl { uart134_alt_default: uart134_alt_default { @@ -17,6 +21,7 @@ psels = , ; low-power-enable; + bias-pull-up; }; }; @@ -36,6 +41,7 @@ psels = , ; low-power-enable; + bias-pull-up; }; }; diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index f0f9fa7667af..555943b3fa69 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -1,4 +1,8 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ &pinctrl { uart21_default: uart21_default { @@ -17,6 +21,7 @@ psels = , ; low-power-enable; + bias-pull-up; }; }; @@ -36,6 +41,7 @@ psels = , ; low-power-enable; + bias-pull-up; }; }; }; diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay index bca1841c6505..2a501b4ee1a1 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay @@ -1,4 +1,8 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ &pinctrl { uart1_default: uart1_default { @@ -17,6 +21,7 @@ psels = , ; low-power-enable; + bias-pull-up; }; }; @@ -36,6 +41,7 @@ psels = , ; low-power-enable; + bias-pull-up; }; }; }; From ba4f624bdfacdaa897a55bafd8e3189867fe532f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 24 Nov 2025 13:56:38 +0100 Subject: [PATCH 1756/3334] [nrf fromtree] tests: drivers: uart: uart_errors: Fix nrf54l overlays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RX pin must have pull-up like in other boards. It is needed because 2 UART instances are connected and order of initialization is unknown so if receiver is initialized before the transmitter then RX pin may float and it can result in the unexpected receiver error. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 6e09370ff2f6167874e65846dd51c8abd49a354a) --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 14 +++++++++++--- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 13 ++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tests/drivers/uart/uart_errors/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_errors/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 12276e58abb7..4e6392f6132c 100644 --- a/tests/drivers/uart/uart_errors/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_errors/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -1,10 +1,18 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ &pinctrl { uart21_default: uart21_default { group1 { - psels = , - ; + psels = ; + bias-pull-up; + }; + + group2 { + psels = ; }; }; diff --git a/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 00a35f9aca84..64e7c2257e66 100644 --- a/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,10 +1,17 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ &pinctrl { uart21_default: uart21_default { group1 { - psels = , - ; + psels = ; + bias-pull-up; + }; + + group2 { + psels = ; }; }; From 78cb11f218dba86460eeae6936e578e2756eb92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 27 Nov 2025 10:37:42 +0100 Subject: [PATCH 1757/3334] [nrf fromtree] samples: modem: Update configuration for nrf9160dk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In sample that is using a cellular modem on nrf9160dk the UART driver feature was enabled to use TIMER peripheral for byte counting. It used to be required to reliably received data even with HWFC. Some time ago default receiver has been changed and UART with HWFC is able to reliably receive data without need of using TIMER and PPI for byte counting. Signed-off-by: Krzysztof Chruściński (cherry picked from commit ce2a264a873ed8207ef860eb16844dee19e5d171) --- .../modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/samples/drivers/modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf b/samples/drivers/modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf index 9e033b1590f9..65fd5d703342 100644 --- a/samples/drivers/modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/drivers/modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf @@ -1,9 +1,6 @@ CONFIG_UART_ASYNC_API=y CONFIG_UART_1_ASYNC=y CONFIG_UART_1_INTERRUPT_DRIVEN=n -# Enable HW RX byte counting. This especially matters at higher baud rates. -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y From cb6cf32d75ae2c6a7c5a26bca272df118c3268b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 27 Nov 2025 12:13:33 +0100 Subject: [PATCH 1758/3334] [nrf fromtree] drivers: serial: nrfx_uarte: Refactor byte counting with TIMER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some time ago a receiver mode for newer SoCs was introduced. It is using TIMER to count RX bytes via PPI. Due to changes in the system behavior it is not the same implementation as the one used on legacy targets (nRF52x, nRF53x and nRF91x). New implementation is using the Device Tree to assign a TIMER instance and old feature was using Kconfig which is now obsolete and error prone since it is easy to get resource usage conflict is some instances are managed in Device Tree and some in Kconfig. As a result to reliably receive data without HWFC user had to use different configuration depending on the target. Legacy implementation was using nrfx_timer and new one used HAL. Patch attempts to align better those two similar but different implementations by: - deprecating Kconfig symbols for selecting TIMER instance in favor of the Device Tree - extracting common part like PPI initialization and some control block fields - Using TIMER HAL in both implementations. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 6e65fbe585a060441bd9a94e66364125fdd8f2de) --- drivers/serial/Kconfig.nrfx | 11 +- drivers/serial/Kconfig.nrfx_uart_instance | 41 +++- drivers/serial/uart_nrfx_uarte.c | 274 +++++++++++----------- 3 files changed, 173 insertions(+), 153 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 53fa3ab54de6..04b682c5bbd6 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -36,9 +36,6 @@ config UART_NRFX_UARTE_NO_IRQ config UART_NRFX_UARTE_ENHANCED_RX bool "Enhanced RX handling" - depends on UART_ASYNC_API - depends on !(UART_0_NRF_HW_ASYNC || UART_1_NRF_HW_ASYNC || UART_2_NRF_HW_ASYNC) - default y select DEPRECATED help Option is deprecated as it is used as default unless TIMER peripheral is used @@ -62,9 +59,17 @@ config UART_ASYNC_TX_CACHE_SIZE config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER bool "Use TIMER to count RX bytes" depends on UART_ASYNC_API + depends on $(dt_compat_any_has_prop,$(DT_COMPAT_NORDIC_NRF_UARTE),frame-timeout-supported) depends on !ARCH_POSIX # Mode not supported on BSIM target select NRFX_GPPI +config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY + bool "Use TIMER to count RX bytes on legacy platforms" + depends on UART_ASYNC_API + select NRFX_GPPI + help + Method used on nRF52x, nRF53x and nRF91x series. + config UART_NRFX_UARTE_BOUNCE_BUF_LEN int "RX bounce buffer size" depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index bcc60a0e0482..023ba4557e70 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -17,12 +17,35 @@ config UART_$(nrfx_uart_num)_ASYNC help This option enables UART Asynchronous API support on port $(nrfx_uart_num). -config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER +config UART_$(nrfx_uart_num)_NRF_USE_TIMER bool + depends on UART_ASYNC_API depends on $(dt_nodelabel_has_prop,uart$(nrfx_uart_num),timer) depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) default y + help + Indicates that TIMER peripheral for RX byte counting is assigned to that instance + in the Device Tree. + +config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER + bool + depends on UART_$(nrfx_uart_num)_NRF_USE_TIMER + depends on $(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),frame-timeout-supported) + default y imply UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + help + Indicates that TIMER peripheral for RX byte counting is assigned to that instance + in the Device Tree. UARTE revision used in the newer targets like nRF54x Series. + +config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER_LEGACY + bool + depends on UART_$(nrfx_uart_num)_NRF_USE_TIMER || UART_$(nrfx_uart_num)_NRF_HW_ASYNC + depends on !$(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),frame-timeout-supported) + default y + imply UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY + help + Indicates that TIMER peripheral for RX byte counting is assigned to that instance + in the Device Tree. UARTE revision used in the legacy targets (nRF52x, nRF53x and nRF91x). config UART_$(nrfx_uart_num)_ENHANCED_POLL_OUT bool "Efficient poll out on port $(nrfx_uart_num)" @@ -52,15 +75,13 @@ config UART_$(nrfx_uart_num)_NRF_TX_BUFFER_SIZE config UART_$(nrfx_uart_num)_NRF_HW_ASYNC bool "Use hardware RX byte counting" - depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) depends on UART_ASYNC_API - depends on HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC - select NRFX_GPPI + depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) + depends on !($(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),frame-timeout-supported)) + select DEPRECATED help - If default driver uses interrupts to count incoming bytes, it is possible - that with higher speeds and/or high cpu load some data can be lost. - It is recommended to use hardware byte counting in such scenarios. - Hardware RX byte counting requires timer instance and one PPI channel. + Option is deprecated. Use Device Tree "timer" property to assign a TIMER peripheral + for reliable reception without HWFC. config UART_$(nrfx_uart_num)_NRF_ASYNC_LOW_POWER bool "Low power mode" @@ -77,4 +98,8 @@ config UART_$(nrfx_uart_num)_NRF_ASYNC_LOW_POWER config UART_$(nrfx_uart_num)_NRF_HW_ASYNC_TIMER int "Timer instance" + depends on !UART_$(nrfx_uart_num)_NRF_USE_TIMER depends on UART_$(nrfx_uart_num)_NRF_HW_ASYNC + help + Option is deprecated. Use Device Tree "timer" property to assign a TIMER peripheral + for reliable reception without HWFC. diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 38d70b1dd663..f106ec26129a 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -26,6 +26,12 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); +#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX) +#define MAYBE_CONST +#else +#define MAYBE_CONST const +#endif + #define RX_FLUSH_WORKAROUND 1 #define UARTE(idx) DT_NODELABEL(uart##idx) @@ -65,11 +71,12 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); #define UARTE_ANY_ASYNC 1 #endif -/* Determine if any instance is using asynchronous API with HW byte counting. */ -#define IS_HW_ASYNC(unused, prefix, i, _) IS_ENABLED(CONFIG_UART_##prefix##i##_NRF_HW_ASYNC) - -#if UARTE_FOR_EACH_INSTANCE(IS_HW_ASYNC, (||), (0)) -#define UARTE_ANY_HW_ASYNC 1 +/* Set a flag that is used for code that is shared between bytes counting methods + * on legacy and new platforms. + */ +#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) +#define COUNT_BYTES_WITH_TIMER_COMMON 1 #endif /* Determine if any instance is using enhanced poll_out feature. */ @@ -187,9 +194,7 @@ struct uarte_async_rx_cbwt { uint8_t *anomaly_byte_dst; uint8_t anomaly_byte; #endif - nrfx_gppi_handle_t ppi_h; uint8_t bounce_idx; - bool in_irq; bool discard_fifo; }; @@ -205,12 +210,14 @@ struct uarte_async_rx { uint8_t *next_buf; size_t next_buf_len; k_timeout_t timeout; -#ifdef UARTE_ANY_HW_ASYNC +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY uint32_t total_user_byte_cnt; /* Total number of bytes passed to user */ - nrfx_gppi_handle_t ppi; +#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY */ +#ifdef COUNT_BYTES_WITH_TIMER_COMMON + nrfx_gppi_handle_t ppi_h; /* Flag to ensure that RX timeout won't be executed during ENDRX ISR */ volatile bool is_in_irq; -#endif /* UARTE_ANY_HW_ASYNC */ +#endif uint8_t idle_cnt; uint8_t flush_cnt; volatile bool enabled; @@ -253,7 +260,6 @@ struct uarte_nrfx_data { #endif #ifdef UARTE_ANY_ASYNC struct uarte_async_cb *async; - nrfx_timer_t timer; #endif atomic_val_t poll_out_lock; atomic_t flags; @@ -277,16 +283,13 @@ struct uarte_nrfx_data { /* If enabled then ENDTX is PPI'ed to TXSTOP */ #define UARTE_CFG_FLAG_PPI_ENDTX BIT(0) -/* If enabled then TIMER and PPI is used for byte counting. */ -#define UARTE_CFG_FLAG_HW_BYTE_COUNTING BIT(1) - /* If enabled then UARTE peripheral is disabled when not used. This allows * to achieve lowest power consumption in idle. */ -#define UARTE_CFG_FLAG_LOW_POWER BIT(2) +#define UARTE_CFG_FLAG_LOW_POWER BIT(1) /* If enabled then UARTE peripheral is using memory which is cacheable. */ -#define UARTE_CFG_FLAG_CACHEABLE BIT(3) +#define UARTE_CFG_FLAG_CACHEABLE BIT(2) /* Indicates that workaround for spurious RXTO during restart shall be applied. */ #define UARTE_CFG_FLAG_SPURIOUS_RXTO BIT(3) @@ -369,10 +372,12 @@ struct uarte_nrfx_config { #endif /* CONFIG_UART_USE_RUNTIME_CONFIGURE */ #ifdef UARTE_ANY_ASYNC -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER +#ifdef COUNT_BYTES_WITH_TIMER_COMMON NRF_TIMER_Type * timer_regs; - IRQn_Type timer_irqn; IRQn_Type uarte_irqn; +#endif +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + IRQn_Type timer_irqn; uint8_t *bounce_buf[2]; size_t bounce_buf_len; size_t bounce_buf_swap_len; @@ -380,22 +385,21 @@ struct uarte_nrfx_config { #endif uint8_t *tx_cache; uint8_t *rx_flush_buf; -#endif +#endif /* UARTE_ANY_ASYNC */ uint8_t *poll_out_byte; uint8_t *poll_in_byte; }; -/* Using Macro instead of static inline function to handle NO_OPTIMIZATIONS case - * where static inline fails on linking. - */ -#define HW_RX_COUNTING_ENABLED(config) \ - (IS_ENABLED(UARTE_ANY_HW_ASYNC) ? \ - (config->flags & UARTE_CFG_FLAG_HW_BYTE_COUNTING) : false) +/* Determine if instance is using an approach with counting bytes with TIMER (legacy). */ +#define IS_CBWT_LEGACY(dev) \ + COND_CODE_1(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY, \ + ((((const struct uarte_nrfx_config *)dev->config)->timer_regs != NULL)),\ + (false)) /* Determine if instance is using an approach with counting bytes with TIMER (cbwt). */ #define IS_CBWT(dev) \ COND_CODE_1(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ - ((((const struct uarte_nrfx_config *)dev->config)->cbwt_data != NULL)), \ + ((((const struct uarte_nrfx_config *)dev->config)->timer_regs != NULL)),\ (false)) static inline NRF_UARTE_Type *get_uarte_instance(const struct device *dev) @@ -444,9 +448,14 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) return; } -#if defined(UARTE_ANY_HW_ASYNC) - if (data->async && HW_RX_COUNTING_ENABLED(config)) { - nrfx_timer_disable(&data->timer); +#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) + if (data->async && IS_CBWT_LEGACY(dev)) { +#if NRF_TIMER_HAS_SHUTDOWN + nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_SHUTDOWN); +#else + nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_STOP); + nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_CLEAR); +#endif /* Timer/counter value is reset when disabled. */ data->async->rx.total_user_byte_cnt = 0; } @@ -752,16 +761,15 @@ static void uarte_periph_enable(const struct device *dev) #ifdef UARTE_ANY_ASYNC if (data->async) { - if (HW_RX_COUNTING_ENABLED(config)) { - nrfx_timer_t *timer = &data->timer; - - nrfx_timer_enable(timer); - +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY + if (IS_CBWT_LEGACY(dev)) { + nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_START); for (int i = 0; i < data->async->rx.flush_cnt; i++) { - nrfx_timer_increment(timer); + nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_COUNT); } } return; +#endif } #endif @@ -937,45 +945,6 @@ static int uarte_nrfx_rx_disable(const struct device *dev) return rx_disable(dev, true); } -#if defined(UARTE_ANY_HW_ASYNC) -static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } - -static int uarte_nrfx_rx_counting_init(const struct device *dev) -{ - struct uarte_nrfx_data *data = dev->data; - const struct uarte_nrfx_config *cfg = dev->config; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - int ret; - nrfx_timer_config_t tmr_config = NRFX_TIMER_DEFAULT_CONFIG( - NRF_TIMER_BASE_FREQUENCY_GET(data->timer.p_reg)); - uint32_t evt_addr = nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_RXDRDY); - uint32_t tsk_addr = nrfx_timer_task_address_get(&data->timer, NRF_TIMER_TASK_COUNT); - - tmr_config.mode = NRF_TIMER_MODE_COUNTER; - tmr_config.bit_width = NRF_TIMER_BIT_WIDTH_32; - ret = nrfx_timer_init(&data->timer, - &tmr_config, - timer_handler); - if (ret != 0) { - LOG_ERR("Timer already initialized"); - return -EINVAL; - } - - nrfx_timer_clear(&cfg->timer); - - ret = nrfx_gppi_conn_alloc(evt_addr, tsk_addr, &data->async->rx.cnt.ppi); - if (ret < 0) { - LOG_ERR("Failed to allocate PPI Channel"); - nrfx_timer_uninit(&data->timer); - return ret; - } - - nrfx_gppi_conn_enable(data->async->rx.cnt.ppi); - - return 0; -} -#endif /* !defined(UARTE_ANY_HW_ASYNC) */ - #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER static uint32_t get_byte_cnt(NRF_TIMER_Type *timer) @@ -1367,7 +1336,6 @@ static void cbwt_rx_timeout(struct k_timer *timer) const struct device *dev = k_timer_user_data_get(timer); const struct uarte_nrfx_config *cfg = dev->config; struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; struct uarte_async_rx *async_rx = &data->async->rx; if (nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY)) { @@ -1377,7 +1345,7 @@ static void cbwt_rx_timeout(struct k_timer *timer) async_rx->idle_cnt++; if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { - if (cbwt_data->in_irq) { + if (async_rx->is_in_irq) { /* TIMER or UARTE interrupt preempted. Lets try again * later. */ @@ -1494,13 +1462,13 @@ static void timer_isr(const void *arg) const struct device *dev = arg; const struct uarte_nrfx_config *cfg = dev->config; struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; + struct uarte_async_rx *async_rx = &data->async->rx; static const uint32_t flags_to_check = UARTE_FLAG_RX_BUF_REQ | UARTE_FLAG_TRIG_RXTO | UARTE_FLAG_LATE_CC; uint32_t flags = atomic_and(&data->flags, ~flags_to_check); - cbwt_data->in_irq = true; + async_rx->is_in_irq = true; if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH) || (flags & UARTE_FLAG_LATE_CC)) { @@ -1520,7 +1488,7 @@ static void timer_isr(const void *arg) cbwt_rxto_isr(dev, false); } - cbwt_data->in_irq = false; + async_rx->is_in_irq = false; } static void cbwt_rx_enable(const struct device *dev, bool with_timeout) @@ -1587,13 +1555,29 @@ static void cbwt_rx_enable(const struct device *dev, bool with_timeout) static int cbwt_uarte_async_init(const struct device *dev) { - /* As this approach does not use nrfx_timer driver but only HAL special setup - * function is used. - */ const struct uarte_nrfx_config *cfg = dev->config; struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; static const uint32_t rx_int_mask = NRF_UARTE_INT_ERROR_MASK | NRF_UARTE_INT_RXTO_MASK; + +#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE + cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; +#endif + + /* Enable EasyDMA LIST feature (it is exposed in SPIM but not in UARTE). */ + *(volatile uint32_t *)((uint32_t)cfg->uarte_regs + 0x714) = 1; + nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); + + return 0; +} +#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER */ + +#ifdef COUNT_BYTES_WITH_TIMER_COMMON +static int count_byte_with_timer_common_init(const struct device *dev) +{ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT); int ret; @@ -1601,24 +1585,15 @@ static int cbwt_uarte_async_init(const struct device *dev) nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER); nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32); - ret = nrfx_gppi_conn_alloc(evt, tsk, &cbwt_data->ppi_h); + ret = nrfx_gppi_conn_alloc(evt, tsk, &async_rx->ppi_h); if (ret < 0) { return ret; } - nrfx_gppi_conn_enable(cbwt_data->ppi_h); - -#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE - cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; -#endif - - /* Enable EasyDMA LIST feature (it is exposed in SPIM but not in UARTE). */ - *(volatile uint32_t *)((uint32_t)cfg->uarte_regs + 0x714) = 1; - nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); - + nrfx_gppi_conn_enable(async_rx->ppi_h); return 0; } -#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER */ +#endif static int uarte_async_init(const struct device *dev) { @@ -1629,24 +1604,21 @@ static int uarte_async_init(const struct device *dev) k_timer_init(&data->async->tx.timer, tx_timeout, NULL); k_timer_user_data_set(&data->async->tx.timer, (void *)dev); -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - return cbwt_uarte_async_init(dev); - } -#endif - -#if defined(UARTE_ANY_HW_ASYNC) - const struct uarte_nrfx_config *cfg = dev->config; - int ret; +#ifdef COUNT_BYTES_WITH_TIMER_COMMON + if (IS_CBWT(dev) || IS_CBWT_LEGACY(dev)) { + int ret = count_byte_with_timer_common_init(dev); - if (HW_RX_COUNTING_ENABLED(cfg)) { - ret = uarte_nrfx_rx_counting_init(dev); - if (ret != 0) { + if (ret < 0) { return ret; } } #endif +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + return cbwt_uarte_async_init(dev); + } +#endif return 0; } @@ -2001,32 +1973,38 @@ static void tx_timeout(struct k_timer *timer) (void) uarte_nrfx_tx_abort(dev); } +#ifndef UARTE_HAS_FRAME_TIMEOUT /** Function is called when idle state is detected on the line. Notify user * all pending data. */ -#ifndef UARTE_HAS_FRAME_TIMEOUT -static void hw_count_rx_timeout(const struct device *dev) +static void rx_idle_line_handle(const struct device *dev) { -#ifdef UARTE_ANY_HW_ASYNC + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + + if (!IS_CBWT_LEGACY(dev)) { + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + return; + } +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY + const struct uarte_nrfx_config *cfg = dev->config; struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; - const struct uarte_nrfx_config *cfg = dev->config; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); uint32_t len; if (async_rx->is_in_irq == true) { return; } - irq_disable(nrfx_get_irq_number(uarte)); + irq_disable(cfg->uarte_irqn); - len = nrfx_timer_capture(&cfg->timer, 0) - async_rx->total_user_byte_cnt; + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_CAPTURE0); + len = nrf_timer_cc_get(cfg->timer_regs, 0) - async_rx->total_user_byte_cnt; if ((len > 0) && ((len + async_rx->offset) < async_rx->buf_len)) { notify_uart_rx_rdy(dev, len); async_rx->offset += len; async_rx->total_user_byte_cnt += len; } nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); - irq_enable(nrfx_get_irq_number(uarte)); + irq_enable(cfg->uarte_irqn); #endif } #endif @@ -2073,7 +2051,6 @@ static void rx_timeout(struct k_timer *timer) #else /* UARTE_HAS_FRAME_TIMEOUT */ struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; - const struct uarte_nrfx_config *cfg = dev->config; if (nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY)) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); @@ -2090,11 +2067,7 @@ static void rx_timeout(struct k_timer *timer) */ if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { k_timer_stop(timer); - if (HW_RX_COUNTING_ENABLED(cfg)) { - hw_count_rx_timeout(dev); - } else { - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - } + rx_idle_line_handle(dev); return; } } @@ -2131,13 +2104,12 @@ static void rxstarted_isr(const struct device *dev) .type = UART_RX_BUF_REQUEST, }; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && !defined(UARTE_HAS_FRAME_TIMEOUT) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { - nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); + nrf_uarte_int_enable(get_uarte_instance(dev), NRF_UARTE_INT_RXDRDY_MASK); } #endif user_callback(dev, &evt); @@ -2149,7 +2121,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); -#if defined(UARTE_ANY_HW_ASYNC) +#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) async_rx->is_in_irq = true; #endif @@ -2182,7 +2154,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) rx_len = 0; } -#if defined(UARTE_ANY_HW_ASYNC) +#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) async_rx->total_user_byte_cnt += rx_len; #endif @@ -2251,7 +2223,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) #endif } -#if defined(UARTE_ANY_HW_ASYNC) +#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) async_rx->is_in_irq = false; #endif } @@ -2331,8 +2303,8 @@ static void rxto_isr(const struct device *dev) */ if (async_rx->discard_fifo) { async_rx->discard_fifo = false; -#if defined(UARTE_ANY_HW_ASYNC) - if (HW_RX_COUNTING_ENABLED(config)) { +#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) + if (IS_CBWT_LEGACY(dev)) { /* It need to be included because TIMER+PPI got RXDRDY events * and counted those flushed bytes. */ @@ -2983,9 +2955,14 @@ static void uarte_pm_suspend(const struct device *dev) wait_for_tx_stopped(dev); } -#if defined(UARTE_ANY_HW_ASYNC) - if (data->async && HW_RX_COUNTING_ENABLED(cfg)) { - nrfx_timer_disable(&data->timer); +#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) + if (data->async && IS_CBWT_LEGACY(dev)) { +#if NRF_TIMER_HAS_SHUTDOWN + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_SHUTDOWN); +#else + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_STOP); + nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_CLEAR); +#endif /* Timer/counter value is reset when disabled. */ data->async->rx.total_user_byte_cnt = 0; } @@ -3090,10 +3067,16 @@ static int uarte_instance_init(const struct device *dev, int err; const struct uarte_nrfx_config *cfg = dev->config; - if (IS_ENABLED(CONFIG_ARCH_POSIX)) { - /* For simulation the DT provided peripheral address needs to be corrected */ - ((struct pinctrl_dev_config *)cfg->pcfg)->reg = (uintptr_t)cfg->uarte_regs; +#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX) + /* For simulation the DT provided peripheral address needs to be corrected */ + ((struct pinctrl_dev_config *)cfg->pcfg)->reg = (uintptr_t)cfg->uarte_regs; +#if defined(COUNT_BYTES_WITH_TIMER_COMMON) + if (cfg->timer_regs != NULL) { + ((struct uarte_nrfx_config *)dev->config)->timer_regs = + nhw_convert_periph_base_addr(cfg->timer_regs); } +#endif +#endif /* Apply sleep state by default. * If PM is disabled, the default state will be applied in pm_device_driver_init. @@ -3144,11 +3127,18 @@ static int uarte_instance_deinit(const struct device *dev) #define UARTE_TIMER_IRQ_PRIO(idx) DT_IRQ(DT_PHANDLE(UARTE(idx), timer), priority) +#define UARTE_COUNT_BYTES_WITH_TIMER_COMMON_CONFIG(idx) \ + .timer_regs = COND_CODE_1(UARTE_HAS_PROP(idx, timer), \ + (UARTE_TIMER_REG(idx)), \ + (COND_CODE_1(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ + (NRFX_CONCAT(NRF_TIMER, CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER)), \ + (NULL)))), \ + .uarte_irqn = DT_IRQN(UARTE(idx)), + + #define UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx) \ IF_ENABLED(UARTE_HAS_PROP(idx, timer), \ - (.timer_regs = UARTE_TIMER_REG(idx), \ - .timer_irqn = UARTE_TIMER_IRQN(idx), \ - .uarte_irqn = DT_IRQN(UARTE(idx)), \ + (.timer_irqn = UARTE_TIMER_IRQN(idx), \ .bounce_buf = { \ uart##idx##_bounce_buf, \ &uart##idx##_bounce_buf[sizeof(uart##idx##_bounce_buf) / 2] \ @@ -3315,9 +3305,9 @@ static int uarte_instance_deinit(const struct device *dev) COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, (), \ (BUILD_ASSERT(UARTE_GET_BAUDRATE(idx) > 0, \ "Unsupported baudrate");)) \ - static const struct uarte_nrfx_config uarte_##idx##z_config = { \ + static MAYBE_CONST struct uarte_nrfx_config uarte_##idx##z_config = { \ COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ - (.clock_freq = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),), \ + (.clock_freq = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),), \ (IF_ENABLED(UARTE_HAS_FRAME_TIMEOUT, \ (.baudrate = UARTE_PROP(idx, current_speed),)) \ .nrf_baudrate = UARTE_GET_BAUDRATE(idx), \ @@ -3329,8 +3319,6 @@ static int uarte_instance_deinit(const struct device *dev) .flags = \ (IS_ENABLED(CONFIG_UART_##idx##_ENHANCED_POLL_OUT) ? \ UARTE_CFG_FLAG_PPI_ENDTX : 0) | \ - (IS_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC) ? \ - UARTE_CFG_FLAG_HW_BYTE_COUNTING : 0) | \ (!IS_ENABLED(CONFIG_HAS_NORDIC_DMM) ? 0 : \ (UARTE_IS_CACHEABLE(idx) ? \ UARTE_CFG_FLAG_CACHEABLE : 0)) | \ @@ -3350,6 +3338,8 @@ static int uarte_instance_deinit(const struct device *dev) .rx_flush_buf = uarte##idx##_flush_buf,)) \ IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ (UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx))) \ + IF_ENABLED(COUNT_BYTES_WITH_TIMER_COMMON, \ + (UARTE_COUNT_BYTES_WITH_TIMER_COMMON_CONFIG(idx))) \ }; \ UARTE_DIRECT_ISR_DECLARE(idx) \ static int uarte_##idx##_init(const struct device *dev) \ From ca289f7c146c9e72f8be42a77c1026a3aeaea82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 27 Nov 2025 12:32:41 +0100 Subject: [PATCH 1759/3334] [nrf fromtree] tests: drivers: uart: Aligning Nordic configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aligning configurations for Nordic targets after changes in the driver. CONFIG_UART_x_NRF_HW_ASYNC_TIMER option is deprecated. Where valid Device Tree configuration is added. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 6bb81db0b49eac0592ae86b930160267e05ca55a) --- .../boards/nrf5340bsim_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 -- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 10 +++++++++- .../boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 2 -- .../uart/uart_async_api/boards/nrf9160dk_nrf9160.conf | 2 -- .../uart_async_api/boards/nrf9160dk_nrf9160_ns.conf | 2 -- .../uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf | 2 -- .../uart_async_dual/boards/nrf9160dk_nrf9160.overlay | 5 +++++ tests/drivers/uart/uart_async_dual/testcase.yaml | 1 + .../uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf | 2 -- tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml | 3 --- tests/drivers/uart/uart_pm/testcase.yaml | 6 ------ 12 files changed, 16 insertions(+), 23 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf delete mode 100644 tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf index 3a15540b2dd5..b83fb4eb08ad 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -1 +1 @@ -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 +CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY=n diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf index 396d23ba5ae3..d70069646c93 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1,3 +1 @@ -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.overlay index 81ae813daf3c..fd0a98896269 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -1,4 +1,8 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ &pinctrl { uart1_default_alt: uart1_default_alt { @@ -17,6 +21,10 @@ }; }; +&timer1 { + status = "reserved"; +}; + dut: &uart1 { compatible = "nordic,nrf-uarte"; current-speed = <115200>; diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf index 396d23ba5ae3..d70069646c93 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -1,3 +1 @@ -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf index 4f738f955e10..83e126780f99 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf @@ -1,4 +1,2 @@ CONFIG_ARM_MPU=n CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf index 4f738f955e10..83e126780f99 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf @@ -1,4 +1,2 @@ CONFIG_ARM_MPU=n CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf deleted file mode 100644 index 025b92361475..000000000000 --- a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay index 2a501b4ee1a1..d34b8fde6240 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay @@ -46,12 +46,17 @@ }; }; +&timer1 { + status = "reserved"; +}; + dut: &uart1 { status = "okay"; current-speed = <115200>; pinctrl-0 = <&uart1_default>; pinctrl-1 = <&uart1_sleep>; pinctrl-names = "default", "sleep"; + timer = <&timer1>; hw-flow-control; }; diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index 3d1c43ed621f..34bd20103ef8 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -89,4 +89,5 @@ tests: extra_configs: - CONFIG_TEST_CHOPPED_TX=n - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER=n + - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY=n - CONFIG_UART_1_NRF_HW_ASYNC=n diff --git a/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index 025b92361475..000000000000 --- a/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index 3fc19af2bd64..3769ea9f1de9 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -76,9 +76,6 @@ tests: - CONFIG_UART_0_INTERRUPT_DRIVEN=n - CONFIG_UART_0_ASYNC=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y - - CONFIG_UART_0_NRF_HW_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER=y platform_allow: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 38da5dca4800..4dec1c51ea01 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -76,9 +76,6 @@ tests: - CONFIG_UART_INTERRUPT_DRIVEN=n - CONFIG_UART_ASYNC_API=y - CONFIG_UART_0_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER=y - CONFIG_UART_0_ENHANCED_POLL_OUT=n drivers.uart.pm.async.enhanced_poll: @@ -86,9 +83,6 @@ tests: - CONFIG_UART_INTERRUPT_DRIVEN=n - CONFIG_UART_ASYNC_API=y - CONFIG_UART_0_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC=y - - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 - - CONFIG_NRFX_TIMER=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y platform_exclude: - nrf54h20dk/nrf54h20/cpuapp From f229c5ac430a68879851a9491eb41b39c38aed1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 3 Feb 2026 09:04:00 +0100 Subject: [PATCH 1760/3334] [nrf fromtree] tests: drivers: uart: async_api: Remove baudrate limit from nRF targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nRF targets no longer need to reconfigure CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT as test is passing with the default settings. Signed-off-by: Krzysztof Chruściński (cherry picked from commit f89b82f19c66ce5a5d85beacbff860eefe184818) --- .../drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf | 1 - .../uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf | 1 - .../uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf | 1 - .../uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 1 - .../uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf | 1 - .../uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf | 1 - .../uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 - .../uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf | 1 - .../uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 1 - .../uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 1 - .../uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 - .../uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf | 1 - .../uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 - .../uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf | 1 - tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf | 1 - .../drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf | 1 - 17 files changed, 17 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf diff --git a/tests/drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf b/tests/drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf deleted file mode 100644 index b83fb4eb08ad..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY=n diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 47f481017118..74cc8d7691e1 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,3 +1,2 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf index 47f481017118..74cc8d7691e1 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf @@ -1,3 +1,2 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf index 47f481017118..74cc8d7691e1 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf @@ -1,3 +1,2 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf index b80531ff3f2e..0eebd15e8a92 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -1,2 +1 @@ CONFIG_TEST_LONG_BUFFER_SIZE=128 -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf index 83e126780f99..b695c18ab28d 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf @@ -1,2 +1 @@ CONFIG_ARM_MPU=n -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf index 83e126780f99..b695c18ab28d 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf @@ -1,2 +1 @@ CONFIG_ARM_MPU=n -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 From 34a4121290f1f2ec0e879b6ba46e3a5cfc9ad7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 3 Feb 2026 13:36:00 +0100 Subject: [PATCH 1761/3334] [nrf fromtree] drivers: serial: nrfx_uarte: Fix compilation with deprecated option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recent changes (6e65fbe585a) deprecated Kconfig configuration for TIMER that is used for bytes counting. In one place code was not cleared correctly which results in compilation failure when deprecated symbol is used. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 53efd4818c134b18dac432bacf0072d7f29b83f1) --- drivers/serial/uart_nrfx_uarte.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index f106ec26129a..54db754e7287 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -3296,9 +3296,6 @@ static int uarte_instance_deinit(const struct device *dev) (.uart_config = UARTE_CONFIG(idx),)) \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ (.async = &uarte##idx##_async,)) \ - IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ - (.timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET( \ - CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER)),)) \ IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \ (.int_driven = &uarte##idx##_int_driven,)) \ }; \ From 434bc87bb1dba8d41782b68e3cbf6174d72caa63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 5 Feb 2026 13:15:59 +0100 Subject: [PATCH 1762/3334] [nrf fromtree] Revert "drivers: serial: nrfx_uarte: Workaround for spurious RXTO during restart" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c58ae7467b0f0b152a1dd430966bbc82058e90bd. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 13e4b7a3ffc23bee34d3c8aaeea3aaf6d98cb993) --- drivers/serial/Kconfig.nrfx | 5 ----- drivers/serial/uart_nrfx_uarte.c | 17 ----------------- 2 files changed, 22 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 04b682c5bbd6..9be3851b1f66 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -93,11 +93,6 @@ config UART_NRFX_UARTE_DIRECT_ISR bool "Use direct ISR" default y if !MULTITHREADING -config UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND - bool - help - Apply workaround for spurious RXTO during restart. - if HAS_HW_NRF_UART0 || HAS_HW_NRF_UARTE0 nrfx_uart_num = 0 rsource "Kconfig.nrfx_uart_instance" diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 54db754e7287..7d245f9a5fa2 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -291,9 +291,6 @@ struct uarte_nrfx_data { /* If enabled then UARTE peripheral is using memory which is cacheable. */ #define UARTE_CFG_FLAG_CACHEABLE BIT(2) -/* Indicates that workaround for spurious RXTO during restart shall be applied. */ -#define UARTE_CFG_FLAG_SPURIOUS_RXTO BIT(3) - /* Indicates that UARTE/TIMER interrupt priority differs from system clock (GRTC/RTC). */ #define UARTE_CFG_FLAG_VAR_IRQ BIT(4) @@ -2183,17 +2180,6 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) unsigned int key = irq_lock(); if (async_rx->buf) { - -#if CONFIG_UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND - /* Check for spurious RXTO event. */ - const struct uarte_nrfx_config *config = dev->config; - - if ((config->flags & UARTE_CFG_FLAG_SPURIOUS_RXTO) && - nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXTO)) { - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); - } -#endif - /* Remove the short until the subsequent next buffer is setup */ nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); @@ -3319,9 +3305,6 @@ static int uarte_instance_deinit(const struct device *dev) (!IS_ENABLED(CONFIG_HAS_NORDIC_DMM) ? 0 : \ (UARTE_IS_CACHEABLE(idx) ? \ UARTE_CFG_FLAG_CACHEABLE : 0)) | \ - (IS_ENABLED(CONFIG_UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND) && \ - INSTANCE_IS_HIGH_SPEED(_, /*empty*/, idx, _) ? \ - UARTE_CFG_FLAG_SPURIOUS_RXTO : 0) | \ ((IS_ENABLED(UARTE_BAUDRATE_RETENTION_WORKAROUND) && \ UARTE_IS_CACHEABLE(idx)) ? \ UARTE_CFG_FLAG_VOLATILE_BAUDRATE : 0) | \ From 237c555d919ddb07a81294cd082aba20506fc263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 5 Feb 2026 13:18:44 +0100 Subject: [PATCH 1763/3334] [nrf fromtree] soc: nordic: nrf54l: Remove UART RXTO workaround Kconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Workaround has been reverted and different approach is taken. Removing UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND from nrf54lm20a Kconfig.defconfig. Signed-off-by: Krzysztof Chruściński (cherry picked from commit c6ea4a77f28131de33ca9bd7a0079de9a6383c01) --- soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp | 3 --- 1 file changed, 3 deletions(-) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp index c6c083bd7e63..a32729e5f40d 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp @@ -9,7 +9,4 @@ if SOC_NRF54LM20A_ENGA_CPUAPP config NUM_IRQS default 290 -config UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND - default y - endif # SOC_NRF54LM20A_ENGA_CPUAPP From d9ac6052ebb7da967dfdcf4db4fdb18378e87373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 4 Feb 2026 16:26:03 +0100 Subject: [PATCH 1764/3334] [nrf fromtree] drivers: serial: nrfx_uarte: Handle unexpected RXTO events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In some cases UARTE peripheral is generating RXTO events together with ENDRX events. Those events are unexpected and should not be handled. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 44bbc13394d334862995bb58a3c64da1bdd6d00d) --- drivers/serial/uart_nrfx_uarte.c | 52 +++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 7d245f9a5fa2..540c456375ab 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -220,6 +220,8 @@ struct uarte_async_rx { #endif uint8_t idle_cnt; uint8_t flush_cnt; + /* Flag indicating that STOPRX is triggered and RXTO is expected. */ + bool stopped; volatile bool enabled; volatile bool discard_fifo; }; @@ -887,6 +889,26 @@ static void rx_disable_finalize(const struct device *dev) } } +/** @brief Trigger RX stop. + * + * Function triggers RX stop and sets the flag if it is expected that RXTO will be generated. + * + * @param dev Device. + * @param force If true then RXTO is expected, if false then it depends on presence of the next + * buffer. + */ +static ALWAYS_INLINE void trigger_stoprx(const struct device *dev, bool force) +{ + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + + /* RXTO is not expected after triggering STOPRX if there is ENDRX_STARTRX short. + * It is enabled if there is a second buffer. + */ + async_rx->stopped = force ? true : (async_rx->next_buf == NULL); + nrf_uarte_task_trigger(get_uarte_instance(dev), NRF_UARTE_TASK_STOPRX); +} + static int rx_disable(const struct device *dev, bool api) { struct uarte_nrfx_data *data = dev->data; @@ -924,7 +946,7 @@ static int rx_disable(const struct device *dev, bool api) async_rx->discard_fifo = true; } - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + trigger_stoprx(dev, true); irq_unlock(key); return 0; @@ -1976,16 +1998,15 @@ static void tx_timeout(struct k_timer *timer) */ static void rx_idle_line_handle(const struct device *dev) { - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - if (!IS_CBWT_LEGACY(dev)) { - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + trigger_stoprx(dev, false); return; } #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY const struct uarte_nrfx_config *cfg = dev->config; struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); uint32_t len; if (async_rx->is_in_irq == true) { @@ -2039,7 +2060,7 @@ static void rx_timeout(struct k_timer *timer) } } else { if (!rxdrdy) { - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + trigger_stoprx(dev, false); k_timer_stop(timer); } } @@ -2189,6 +2210,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) if (!rxstarted && !rxto) { nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); + async_rx->stopped = false; if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND)) { data->flags |= UARTE_FLAG_FTIMEOUT_WATCH; start_timeout = true; @@ -2198,7 +2220,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { k_timer_stop(&async_rx->timer); } - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + trigger_stoprx(dev, true); } irq_unlock(key); @@ -2430,10 +2452,22 @@ static void uarte_nrfx_isr_async(const void *arg) uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); bool rxto, endrx, rxstarted, rxdrdy, error; +#ifdef UARTE_HAS_FRAME_TIMEOUT + /* Frame timeout short may also trigger RX stopping. Detect that case to set + * the flag that RXTO is expected. + */ + if (!IS_CBWT(dev) && + event_check_clear(uarte, NRF_UARTE_EVENT_FRAME_TIMEOUT, + NRF_UARTE_INT_RXTO_MASK, imask) && (async_rx->next_buf == NULL)) { + async_rx->stopped = true; + } +#endif + /* Order of reading those events is important as it must be ensured that processing * order is maintained. */ - rxto = event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask); + rxto = event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask) && + (async_rx->stopped == true); endrx = event_check_clear(uarte, NRF_UARTE_EVENT_ENDRX, NRF_UARTE_INT_ENDRX_MASK, imask); rxdrdy = event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask); rxstarted = event_check_clear(uarte, NRF_UARTE_EVENT_RXSTARTED, @@ -2466,7 +2500,11 @@ static void uarte_nrfx_isr_async(const void *arg) endrx_isr(dev, false, false); } + /* If RXTO is set, check also if STOPRX was triggered as there are cases where RXTO + * is unexpectedly generated with ENDRX and such events shall be discarded. + */ if (rxto) { + async_rx->stopped = false; #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER if (IS_CBWT(dev)) { cbwt_rxto_isr(dev, true); From 4d0e0ea5a77d1d692361b49c7beb199a84f54978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 5 Feb 2026 15:07:47 +0100 Subject: [PATCH 1765/3334] [nrf fromtree] snippets: nordic-ppr: nordic-ppi-xip: Forward UART interrupt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forward console UART interrupt to the PPR core. Signed-off-by: Krzysztof Chruściński (cherry picked from commit a9aa4f2b90f2f42b335cb016fffc8e5cbc1f4350) --- snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay | 1 + snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay | 1 + snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay | 1 + snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay | 1 + 4 files changed, 4 insertions(+) diff --git a/snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay index 2d884a3455a2..dabe6693d9fd 100644 --- a/snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay +++ b/snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay @@ -10,4 +10,5 @@ &uart135 { status = "reserved"; + interrupt-parent = <&cpuppr_clic>; }; diff --git a/snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay b/snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay index 4d02921660b5..077c3528b84e 100644 --- a/snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay +++ b/snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay @@ -14,4 +14,5 @@ &uart135 { status = "reserved"; + interrupt-parent = <&cpuppr_clic>; }; diff --git a/snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay index ae635c9ca9b6..f23767e8d1de 100644 --- a/snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay +++ b/snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay @@ -5,4 +5,5 @@ &uart135 { status = "reserved"; + interrupt-parent = <&cpuppr_clic>; }; diff --git a/snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay b/snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay index 75128f42a13f..1ef2fb78cc32 100644 --- a/snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay +++ b/snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay @@ -9,4 +9,5 @@ &uart135 { status = "reserved"; + interrupt-parent = <&cpuppr_clic>; }; From dccfa0547e91b1d8a1a0eeba112c371fd1a3af05 Mon Sep 17 00:00:00 2001 From: Kyle Bonnici Date: Tue, 16 Dec 2025 13:35:02 +0100 Subject: [PATCH 1766/3334] [nrf fromtree] CI: Update dts-linter dts-linter 0.3.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update DTS linter apply lowercase hex values in DTS files Improve compliance with DTS Coding Style which says that: 4) Hex values in properties, e.g. “reg”, shall use lowercase hex. The address part can be padded with leading zeros. This need dts-linter 0.3.9 Signed-off-by: Kyle Bonnici (cherry picked from commit 3749347e1bcf1002f6b64d4286b432646e645fa6) --- scripts/ci/package-lock.json | 16 ++++++++-------- scripts/ci/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/ci/package-lock.json b/scripts/ci/package-lock.json index 21fe2fdb4147..50efc7dcaaa1 100644 --- a/scripts/ci/package-lock.json +++ b/scripts/ci/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "dts-linter": "^0.3.7-hotfix2" + "dts-linter": "^0.3.9" } }, "node_modules/devicetree-language-server": { - "version": "0.7.2-hotfix1", - "resolved": "https://registry.npmjs.org/devicetree-language-server/-/devicetree-language-server-0.7.2-hotfix1.tgz", - "integrity": "sha512-46UFopMrfO5sNEPZSqCmWfkwVRn370roIUt3W99KwLpF/4rEt2FOxFtp/uZ+T+h09HLx013L3h7jTKnMtTLU4g==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/devicetree-language-server/-/devicetree-language-server-0.7.3.tgz", + "integrity": "sha512-Gzv6hp4Kq7t+tujIq5hqjJW+yrd+1KMCJuNNP5SnKub4HaJZKnbALFhSI/wVbOaOYTAhDJLKyiKPC2M5YE+egQ==", "license": "Apache-2.0", "bin": { "devicetree-language-server": "dist/server.js" @@ -21,12 +21,12 @@ } }, "node_modules/dts-linter": { - "version": "0.3.7-hotfix2", - "resolved": "https://registry.npmjs.org/dts-linter/-/dts-linter-0.3.7-hotfix2.tgz", - "integrity": "sha512-pFR/Zpwsh8djV9Gd9sO8mSvTwOpW3Y4DRKD+Y4Scka+KXVYQQB8Z1uGxNFMjMQVdg9plwYUSLLt9//QkN48ulw==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/dts-linter/-/dts-linter-0.3.9.tgz", + "integrity": "sha512-J+JWuFmr1YUTqWxUjWtMHr7sGHX6Q9jDtFAE4a1ACvtlMP6CRA24F7WCSuUrQnP6hl3BAxJLmdoYIzT6UN9bxw==", "license": "Apache-2.0", "dependencies": { - "devicetree-language-server": "0.7.2-hotfix1" + "devicetree-language-server": "^0.7.3" }, "bin": { "dts-linter": "dist/dts-linter.js" diff --git a/scripts/ci/package.json b/scripts/ci/package.json index c3b12dcbd4e0..98b621977c7b 100644 --- a/scripts/ci/package.json +++ b/scripts/ci/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "dts-linter": "^0.3.7-hotfix2" + "dts-linter": "^0.3.9" } } From bfbd2e5bd1278bd7aa677d03003032dd0c220138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Thu, 5 Feb 2026 15:02:23 +0100 Subject: [PATCH 1767/3334] [nrf fromtree] samples: boards: nordic: nrf_sys_event: Remove unused overlays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove overlay for nrf54l15dk/nrf54l15/cpuflpr/xip target as it is no longer supported. Signed-off-by: Sebastian Głąb (cherry picked from commit 3bb4b92a53a9b152b952d3dfb056d88bfcbd0b47) --- .../nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi | 8 -------- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 4 +++- .../boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay | 6 ------ 3 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi delete mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi deleted file mode 100644 index d6edc1f6f91c..000000000000 --- a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -sample_counter: &timer20 { - status = "okay"; -}; diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 6db12fbcb683..d6edc1f6f91c 100644 --- a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -3,4 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54l15dk_nrf54l15_common.dtsi" +sample_counter: &timer20 { + status = "okay"; +}; diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay deleted file mode 100644 index 6db12fbcb683..000000000000 --- a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_common.dtsi" From 36a7087df6337304aa4f055403588126fd4711e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Thu, 5 Feb 2026 16:37:29 +0100 Subject: [PATCH 1768/3334] [nrf fromtree] samples: boards: nordic: nrf_sys_event: Enable Twister on nrf54lm20dk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add nrf54lm20dk/nrf54lm20a/cpuapp to platform_allow list. Overlay for this target is already there. Remove skipping of RRAMC_POWER_MODE on nrf54lm20dk because PyTest always expects result from this configuration. Signed-off-by: Sebastian Głąb (cherry picked from commit 69cdf5f36c4ff93e622e71cc2350468ba2d62507) --- samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py | 2 +- samples/boards/nordic/nrf_sys_event/sample.yaml | 1 + samples/boards/nordic/nrf_sys_event/src/main.c | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py b/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py index 01377f916f24..4c8c760b3c65 100644 --- a/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py +++ b/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py @@ -16,7 +16,7 @@ def test_rramc_wakeup(dut: DeviceAdapter): - sample.boards.nordic.nrf_sys_event.rramc_wakeup.ppi. Parse logs from serial port. If the Register Event API was used correctly, code execution shall be faster by ~14 us when event was registered. - If the API works correctly, RRAMC is woken up just before event occures. + If the API works correctly, RRAMC is woken up just before event occurs. Thus, there is no delay resulting from RRAMC getting ready. """ diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index b7025bb4731e..5b36f2517b31 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -62,5 +62,6 @@ tests: - CONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp diff --git a/samples/boards/nordic/nrf_sys_event/src/main.c b/samples/boards/nordic/nrf_sys_event/src/main.c index feb257f360b2..8f2f6751806f 100644 --- a/samples/boards/nordic/nrf_sys_event/src/main.c +++ b/samples/boards/nordic/nrf_sys_event/src/main.c @@ -97,9 +97,7 @@ static void sys_event_irq_latency_run(enum rramc_mode mode) static void sys_event_irq_latency(void) { sys_event_irq_latency_run(RRAMC_DEFAULT); -#if !defined(CONFIG_SOC_NRF54LM20A) sys_event_irq_latency_run(RRAMC_POWER_MODE); -#endif sys_event_irq_latency_run(RRAMC_PPI_WAKEUP); } #endif /* CONFIG_NRF_SYS_EVENT_IRQ_LATENCY */ From 5b3b2186201695219204ba05c621102605d2ea57 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Tue, 10 Feb 2026 13:09:43 +0100 Subject: [PATCH 1769/3334] [nrf fromlist] drivers: i2s: Add support for HFCLK24M clock Some devices use a 24 MHz PCLK as the ACLK for the TDM peripheral. Upstream PR #: 103828 Signed-off-by: Adam Kondraciuk --- drivers/i2s/i2s_nrf_tdm.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index eb855dcc38d7..200a9c0b47c5 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -1134,14 +1134,7 @@ static void data_handler(const struct device *dev, const tdm_buffers_t *released static void clock_manager_init(const struct device *dev) { -#if CONFIG_CLOCK_CONTROL_NRF && NRF_CLOCK_HAS_HFCLKAUDIO - clock_control_subsys_t subsys; - struct tdm_drv_data *drv_data = dev->data; - - subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO; - drv_data->clk_mgr = z_nrf_clock_control_get_onoff(subsys); - __ASSERT_NO_MSG(drv_data->clk_mgr != NULL); -#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL +#if DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL struct tdm_drv_data *drv_data = dev->data; drv_data->audiopll = DEVICE_DT_GET(NODE_ACLK); @@ -1151,9 +1144,17 @@ static void clock_manager_init(const struct device *dev) drv_data->audiopll = DEVICE_DT_GET(NODE_AUDIO_AUXPLL); drv_data->aclk_spec.frequency = ACLK_FREQUENCY; +#elif CONFIG_CLOCK_CONTROL_NRF && (NRF_CLOCK_HAS_HFCLKAUDIO || NRF_CLOCK_HAS_HFCLK24M) + clock_control_subsys_t subsys; + struct tdm_drv_data *drv_data = dev->data; + + IF_ENABLED(NRF_CLOCK_HAS_HFCLKAUDIO, (subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO;)) + IF_ENABLED(NRF_CLOCK_HAS_HFCLK24M, (subsys = CLOCK_CONTROL_NRF_SUBSYS_HF24M;)) + drv_data->clk_mgr = z_nrf_clock_control_get_onoff(subsys); + __ASSERT_NO_MSG(drv_data->clk_mgr != NULL); #else (void)dev; -#endif +#endif /* CONFIG_CLOCK_CONTROL_NRF && (NRF_CLOCK_HAS_HFCLKAUDIO || NRF_CLOCK_HAS_HFCLK24M) */ } static int data_init(const struct device *dev) From 221e95232775b6dcca88aaa94c9397ac8d2173c4 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Tue, 10 Feb 2026 13:29:20 +0100 Subject: [PATCH 1770/3334] [nrf fromlist] drivers: audio: dmic_nrfx: Add support for HFCLK24M clock Some devices use a 24 MHz PCLK as the ACLK for the PDM peripheral. Upstream PR #: 103828 Signed-off-by: Adam Kondraciuk --- drivers/audio/dmic_nrfx_pdm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index 661f96e837bd..dabb273a0d74 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -471,11 +471,12 @@ static void init_clock_manager(const struct device *dev) #elif CONFIG_CLOCK_CONTROL_NRF clock_control_subsys_t subsys; struct dmic_nrfx_pdm_drv_data *drv_data = dev->data; -#if NRF_CLOCK_HAS_HFCLKAUDIO +#if NRF_CLOCK_HAS_HFCLKAUDIO || NRF_CLOCK_HAS_HFCLK24M const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; if (drv_cfg->clk_src == ACLK) { - subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO; + IF_ENABLED(NRF_CLOCK_HAS_HFCLKAUDIO, (subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO;)) + IF_ENABLED(NRF_CLOCK_HAS_HFCLK24M, (subsys = CLOCK_CONTROL_NRF_SUBSYS_HF24M;)) } else #endif { From e12eda89530dcefbe4edb57e278437067cfe6e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 11 Feb 2026 12:36:30 +0100 Subject: [PATCH 1771/3334] [nrf fromlist] drivers: serial: nrfx_uarte: Fix wrong endif use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Preprocess endif should be before return so that uarte_periph_enable returns always when asynchronous API is used. It leads to faulty behavior in certain configurations. Upstream PR #: 103903 Signed-off-by: Krzysztof Chruściński --- drivers/serial/uart_nrfx_uarte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 540c456375ab..a0ea6fe31818 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -767,8 +767,8 @@ static void uarte_periph_enable(const struct device *dev) nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_COUNT); } } - return; #endif + return; } #endif From 79657ce30f6f83df9a823af913bd65ded06a7f88 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 14 Jan 2026 16:51:07 +0100 Subject: [PATCH 1772/3334] [nrf fromtree] scripts: dts: gen_dts_cmake.py: Prevent trailing semicolon for lists The generated lists have a trailing semicolon, which for CMake would indicate a trailing empty item. Signed-off-by: Pieter De Gendt (cherry picked from commit 85a6e11bdb6357a46ba128b5970109b54a99193e) --- scripts/dts/gen_dts_cmake.py | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/scripts/dts/gen_dts_cmake.py b/scripts/dts/gen_dts_cmake.py index ef2c9a7f932f..2886e570335e 100755 --- a/scripts/dts/gen_dts_cmake.py +++ b/scripts/dts/gen_dts_cmake.py @@ -124,9 +124,7 @@ def main(): if "phandle" not in node.props[item].type: if "array" in node.props[item].type: # Convert array to CMake list - cmake_value = '' - for val in node.props[item].val: - cmake_value = f'{cmake_value}{val};' + cmake_value = ';'.join(str(val) for val in node.props[item].val) else: cmake_value = node.props[item].val @@ -136,9 +134,8 @@ def main(): cmake_props.append(f'"{cmake_prop}" "{escape(cmake_value)}"') elif node.compats: # Manually output compatibles for nodes that have no properties - cmake_value = '' - for val in node.compats: - cmake_value = f'{cmake_value}{val};' + cmake_value = ';'.join(node.compats) + cmake_prop = f'DT_PROP|{node.path}|compatible' cmake_props.append(f'"{cmake_prop}" "{escape(cmake_value)}"') @@ -147,19 +144,13 @@ def main(): if node.regs is not None: cmake_props.append(f'"DT_REG|{node.path}|NUM" "{len(node.regs)}"') - cmake_addr = '' - cmake_size = '' - - for reg in node.regs: - if reg.addr is None: - cmake_addr = f'{cmake_addr}NONE;' - else: - cmake_addr = f'{cmake_addr}{hex(reg.addr)};' - if reg.size is None: - cmake_size = f'{cmake_size}NONE;' - else: - cmake_size = f'{cmake_size}{hex(reg.size)};' + cmake_addr = ';'.join( + 'NONE' if reg.addr is None else hex(reg.addr) for reg in node.regs + ) + cmake_size = ';'.join( + 'NONE' if reg.size is None else hex(reg.size) for reg in node.regs + ) cmake_props.append(f'"DT_REG|{node.path}|ADDR" "{cmake_addr}"') cmake_props.append(f'"DT_REG|{node.path}|SIZE" "{cmake_size}"') @@ -169,12 +160,7 @@ def main(): cmake_props.append(f'"DT_UNIT_ADDR|{node.path}" "{cmake_unit_addr_int}"') for comp in compatible2paths.keys(): - cmake_path = '' - for path in compatible2paths[comp]: - cmake_path = f'{cmake_path}{path};' - - # Remove the last ';' - cmake_path = cmake_path[:-1] + cmake_path = ';'.join(compatible2paths[comp]) cmake_comp = f'DT_COMP|{comp}' cmake_props.append(f'"{cmake_comp}" "{cmake_path}"') From 17a3e8bd3c6ff883e3a833437e6123013cd7d5d9 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 6 Feb 2026 11:25:27 +0100 Subject: [PATCH 1773/3334] [nrf fromtree] scripts: dts: python-devicetree: Fix failing test with uppercase address Commit f55358bcbfcfc4e7bd7d5c00bf6a16a13f01e8f6 changed all hex values to use lowercase characters. Update the test accordingly. Signed-off-by: Pieter De Gendt (cherry picked from commit 2b57985df11e155ecaada511af27b549535217e2) --- scripts/dts/python-devicetree/tests/test_edtlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dts/python-devicetree/tests/test_edtlib.py b/scripts/dts/python-devicetree/tests/test_edtlib.py index 46c29a597a04..34e7ac81483a 100644 --- a/scripts/dts/python-devicetree/tests/test_edtlib.py +++ b/scripts/dts/python-devicetree/tests/test_edtlib.py @@ -126,7 +126,7 @@ def test_interrupts(): edtlib.ControllerAndData(node=node, controller=controller_2, data={'one': 0, 'two': 0, 'three': 5}, name=None, basename=None) ] - node = edt.get_node("/interrupt-map-bitops-test/node@70000000E") + node = edt.get_node("/interrupt-map-bitops-test/node@70000000e") assert node.interrupts == [ edtlib.ControllerAndData(node=node, controller=edt.get_node('/interrupt-map-bitops-test/controller'), data={'one': 3, 'two': 2}, name=None, basename=None) ] From e62d41a5e4f12778971e0122f31c65865711ef95 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Mon, 2 Feb 2026 19:51:37 +0100 Subject: [PATCH 1774/3334] [nrf fromtree] dts: Handle phandles in cmake Add a possibility to use phandles values in CMake. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 0e99df3ca83eb6e48bccb65061c4cfd9b4fed79d) --- scripts/dts/gen_dts_cmake.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/dts/gen_dts_cmake.py b/scripts/dts/gen_dts_cmake.py index 2886e570335e..3c4b14a65047 100755 --- a/scripts/dts/gen_dts_cmake.py +++ b/scripts/dts/gen_dts_cmake.py @@ -120,8 +120,25 @@ def main(): if node.props: for item in node.props: - # We currently do not support phandles for edt -> cmake conversion. - if "phandle" not in node.props[item].type: + # We currently do not support phandle-arrays for edt -> cmake conversion. + # The code below supports the following phandle types: + # - phandle: which specifies a reference to a single node + # - phandles: which specifies a bare list of references to other nodes + if "phandle" in node.props[item].type: + if "array" in node.props[item].type: + continue # phandle-array not supported + # Convert array to CMake list + if isinstance(node.props[item].val, list): + cmake_value = ';'.join(phandle.path for phandle in node.props[item].val) + else: + cmake_value = node.props[item].val.path + + # Encode node's property 'item' as a CMake target property + # with a name like 'DT_PROP||'. + cmake_prop = f'DT_PROP|{node.path}|{item}' + cmake_props.append(f'"{cmake_prop}" "{escape(cmake_value)}"') + + else: if "array" in node.props[item].type: # Convert array to CMake list cmake_value = ';'.join(str(val) for val in node.props[item].val) From 8726caece27f8a4dbcc46cb5a788af4963347344 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 9 Feb 2026 14:30:40 +0000 Subject: [PATCH 1775/3334] [nrf fromtree] soc: nordic: Add common TF-M Kconfigs instead of duplicate Adds a common-place for Kconfigs needed by TF-M instead of mass-duplicating them in every board that uses these SoCs Signed-off-by: Jamie McCrae (cherry picked from commit ba01b7c3fac757b93e1ec0cded11fef564ba0472) --- boards/ezurio/bl54l15_dvk/Kconfig | 31 ------------------- boards/ezurio/bl54l15u_dvk/Kconfig | 31 ------------------- boards/nordic/nrf54l15dk/Kconfig | 30 ------------------ boards/nordic/nrf54l15tag/Kconfig | 30 ------------------ boards/nordic/nrf7120dk/Kconfig | 30 ------------------ boards/panasonic/panb611evb/Kconfig | 30 ------------------ boards/raytac/an54lq_db_15/Kconfig | 31 ------------------- soc/nordic/common/Kconfig | 1 + .../Kconfig => soc/nordic/common/Kconfig.tfm | 7 ++--- 9 files changed, 3 insertions(+), 218 deletions(-) delete mode 100644 boards/ezurio/bl54l15_dvk/Kconfig delete mode 100644 boards/ezurio/bl54l15u_dvk/Kconfig delete mode 100644 boards/nordic/nrf54l15dk/Kconfig delete mode 100644 boards/nordic/nrf54l15tag/Kconfig delete mode 100644 boards/nordic/nrf7120dk/Kconfig delete mode 100644 boards/panasonic/panb611evb/Kconfig delete mode 100644 boards/raytac/an54lq_db_15/Kconfig rename boards/nordic/nrf54lm20dk/Kconfig => soc/nordic/common/Kconfig.tfm (82%) diff --git a/boards/ezurio/bl54l15_dvk/Kconfig b/boards/ezurio/bl54l15_dvk/Kconfig deleted file mode 100644 index 412d5c5b3dd6..000000000000 --- a/boards/ezurio/bl54l15_dvk/Kconfig +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# Copyright (c) 2025 Ezurio LLC -# SPDX-License-Identifier: Apache-2.0 - -# BL54L15 DVK board configuration - -if BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS - -DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS diff --git a/boards/ezurio/bl54l15u_dvk/Kconfig b/boards/ezurio/bl54l15u_dvk/Kconfig deleted file mode 100644 index b1623fe1b824..000000000000 --- a/boards/ezurio/bl54l15u_dvk/Kconfig +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# Copyright (c) 2025 Ezurio LLC -# SPDX-License-Identifier: Apache-2.0 - -# BL54L15U DVK board configuration - -if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS - -DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS diff --git a/boards/nordic/nrf54l15dk/Kconfig b/boards/nordic/nrf54l15dk/Kconfig deleted file mode 100644 index bf64dd32293d..000000000000 --- a/boards/nordic/nrf54l15dk/Kconfig +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# nRF54L15 DK board configuration - -if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS - -DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS diff --git a/boards/nordic/nrf54l15tag/Kconfig b/boards/nordic/nrf54l15tag/Kconfig deleted file mode 100644 index e2f267bb829e..000000000000 --- a/boards/nordic/nrf54l15tag/Kconfig +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# nRF54L15 TAG board configuration - -if BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS - -DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS diff --git a/boards/nordic/nrf7120dk/Kconfig b/boards/nordic/nrf7120dk/Kconfig deleted file mode 100644 index 7232ebc06d2e..000000000000 --- a/boards/nordic/nrf7120dk/Kconfig +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# nRF7120 DK board configuration - -if BOARD_NRF7120DK_NRF7120_CPUAPP_NS - -DT_NRF_MPC_REGION := $(dt_nodelabel_path,nrf_mpc_region) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC_REGION),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC_REGION),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_NRF7120DK_NRF7120_CPUAPP_NS diff --git a/boards/panasonic/panb611evb/Kconfig b/boards/panasonic/panb611evb/Kconfig deleted file mode 100644 index 93fcd9b78f98..000000000000 --- a/boards/panasonic/panb611evb/Kconfig +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2025 Panasonic Industrial Devices Europe GmbH -# SPDX-License-Identifier: Apache-2.0 - -# PANB611EVB configuration - -if BOARD_PANB611EVB_NRF54L15_CPUAPP_NS - -DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_PANB611EVB_NRF54L15_CPUAPP_NS diff --git a/boards/raytac/an54lq_db_15/Kconfig b/boards/raytac/an54lq_db_15/Kconfig deleted file mode 100644 index 091071d266a1..000000000000 --- a/boards/raytac/an54lq_db_15/Kconfig +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# Copyright (c) 2025 Raytac Corporation. -# SPDX-License-Identifier: Apache-2.0 - -# Raytac AN54LQ-DB-15 board configuration - -if BOARD_RAYTAC_AN54LQ_DB_15_NRF54L15_CPUAPP_NS - -DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_RAYTAC_AN54LQ_DB_15_NRF54L15_CPUAPP_NS diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index f69d50635ab8..f1c31e46551b 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -105,3 +105,4 @@ endif # HAS_NORDIC_DMM rsource "vpr/Kconfig" rsource "uicr/Kconfig" +rsource "Kconfig.tfm" diff --git a/boards/nordic/nrf54lm20dk/Kconfig b/soc/nordic/common/Kconfig.tfm similarity index 82% rename from boards/nordic/nrf54lm20dk/Kconfig rename to soc/nordic/common/Kconfig.tfm index 0b1905a0d8ef..07bdaef7dae7 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig +++ b/soc/nordic/common/Kconfig.tfm @@ -1,10 +1,7 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 +if BUILD_WITH_TFM && (SOC_SERIES_NRF54L || SOC_SERIES_NRF71) DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) -if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS - config NRF_TRUSTZONE_FLASH_REGION_SIZE hex default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) @@ -25,4 +22,4 @@ config NRF_TRUSTZONE_RAM_REGION_SIZE This abstraction allows us to configure TrustZone without depending on peripheral specific symbols. -endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS +endif # BUILD_WITH_TFM From 262d62d746c354ab4b8506025776e5f3d58dd3e9 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 9 Feb 2026 11:38:45 +0000 Subject: [PATCH 1776/3334] [nrf fromtree] doc: contribute: style: kconfig: Add sample/test naming style Adds a naming system for samples and tests, this is picked to avoid conflicts with external modules, e.g. a sample using ``LOCK`` might conflict with a Kconfig that an external module has with the same name, whereas ``SAMPLE_LOCK`` clearly separates it into being for an application Signed-off-by: Jamie McCrae (cherry picked from commit 2217027d23fe567cfb7dc346d6a9d8eafd931a8d) --- doc/contribute/style/kconfig.rst | 18 ++++++++++++++++++ .../style/kconfig_example_sample.txt | 13 +++++++++++++ doc/contribute/style/kconfig_example_test.txt | 11 +++++++++++ 3 files changed, 42 insertions(+) create mode 100644 doc/contribute/style/kconfig_example_sample.txt create mode 100644 doc/contribute/style/kconfig_example_test.txt diff --git a/doc/contribute/style/kconfig.rst b/doc/contribute/style/kconfig.rst index 5c5cf7f0aaef..97c60c6e9cbe 100644 --- a/doc/contribute/style/kconfig.rst +++ b/doc/contribute/style/kconfig.rst @@ -82,6 +82,12 @@ The specific formats by subtree: creating new symbols, check if similar ones already exist in other architectures. +* **Samples (/samples)**: Use ``SAMPLE_`` for symbols, this is to prevent conflicts with external + modules. + +* **Tests (/tests)**: Use ``TEST_`` for symbols, this is to prevent conflicts with external + modules. + Examples ======== @@ -101,6 +107,18 @@ Examples :language: kconfig :start-after: start-after-here +**Sample examples:** + +.. literalinclude:: kconfig_example_sample.txt + :language: kconfig + :start-after: start-after-here + +**Test examples:** + +.. literalinclude:: kconfig_example_test.txt + :language: kconfig + :start-after: start-after-here + Configuration Symbol Organization ********************************* diff --git a/doc/contribute/style/kconfig_example_sample.txt b/doc/contribute/style/kconfig_example_sample.txt new file mode 100644 index 000000000000..08fbfb73ecad --- /dev/null +++ b/doc/contribute/style/kconfig_example_sample.txt @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors +# +# SPDX-License-Identifier: Apache-2.0 +# +# Examples of Kconfig symbols for samples + +# start-after-here + +config SAMPLE_LOCK + bool "Locking feature" + +config SAMPLE_TEMPERATURE_READINGS + bool "Fetch readings from temperature sensor" diff --git a/doc/contribute/style/kconfig_example_test.txt b/doc/contribute/style/kconfig_example_test.txt new file mode 100644 index 000000000000..100aa8beb3ed --- /dev/null +++ b/doc/contribute/style/kconfig_example_test.txt @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors +# +# SPDX-License-Identifier: Apache-2.0 +# +# Examples of Kconfig symbols for tests + +# start-after-here + +config TEST_ITERATIONS + int "Number of times test should run" + default 3 From 65254f2850ba622b59a01ea1f7078190ef7e669a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 9 Feb 2026 13:32:08 +0000 Subject: [PATCH 1777/3334] [nrf fromtree] doc: contribute: style: kconfig: Add board naming style Adds that ``BOARD_`` should be used for board Kconfigs Signed-off-by: Jamie McCrae (cherry picked from commit 0bcbfbc4a7fe17b1e8d96f4553dccf972d06dfa7) --- doc/contribute/style/kconfig.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/contribute/style/kconfig.rst b/doc/contribute/style/kconfig.rst index 97c60c6e9cbe..47f5bfc1d466 100644 --- a/doc/contribute/style/kconfig.rst +++ b/doc/contribute/style/kconfig.rst @@ -88,6 +88,8 @@ The specific formats by subtree: * **Tests (/tests)**: Use ``TEST_`` for symbols, this is to prevent conflicts with external modules. +* **Boards (/boards)**: Use ``BOARD_`` for symbols. + Examples ======== From 136efa18b4843c92066e14f1d89d618ef4ce9c64 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 12 Feb 2026 10:03:43 +0000 Subject: [PATCH 1778/3334] [nrf fromlist] dts: vendor: nordic: nrf7120_enga: Rename DTS node Fixes a name mismatch with nrf54l devices Upstream PR #: 103994 Signed-off-by: Jamie McCrae --- dts/vendor/nordic/nrf7120_enga.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index d2e4b273a2a4..bcbb99be2feb 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -96,7 +96,7 @@ zephyr,memory-region = "NRF_KMU_CRACEN_EXCHANGE"; }; - nrf_mpc_region: memory@50041000 { + nrf_mpc: memory@50041000 { #address-cells = <1>; #size-cells = <1>; compatible = "nordic,nrf-mpc"; From 554b3ebd2f2031c05cf59c71d18b48a8a1ff5008 Mon Sep 17 00:00:00 2001 From: Aymen LAOUINI Date: Mon, 9 Feb 2026 16:51:20 +0200 Subject: [PATCH 1779/3334] [nrf fromtree] boards: nordic: fix flash_load_offset calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dt_nodelabel_reg_addr_hex returns an absolute address. To obtain the partition offset, subtract the parent node’s origin. Signed-off-by: Aymen LAOUINI (cherry picked from commit 032253a8d1c51b2fb02cf4dc27ea5da69b67566e) --- boards/nordic/nrf9280pdk/Kconfig.defconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/boards/nordic/nrf9280pdk/Kconfig.defconfig b/boards/nordic/nrf9280pdk/Kconfig.defconfig index 055c6c8be253..e9dfea8d31ec 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.defconfig +++ b/boards/nordic/nrf9280pdk/Kconfig.defconfig @@ -14,10 +14,13 @@ endif # BOARD_NRF9280PDK_NRF9280_CPUPPR if BOARD_NRF9280PDK_NRF9280_CPUAPP +DT_CHOSEN_Z_FLASH := zephyr,flash + config ROM_START_OFFSET default 0x800 if BOOTLOADER_MCUBOOT config FLASH_LOAD_OFFSET - default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) if !USE_DT_CODE_PARTITION + default $(sub_hex, $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition), \ + $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if !USE_DT_CODE_PARTITION endif # BOARD_NRF9280PDK_NRF9280_CPUAPP From 5a84f0363611e5b0f64f557d7ef088571b168025 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Mon, 9 Feb 2026 14:34:03 +0100 Subject: [PATCH 1780/3334] [nrf fromtree] boards: nrf54h20: Move extemem config Move the external memory chip definition from the CPUAPP-specific to the common DTS. The existence of the external chip is not APP-specific, but a characteristic of the DK itself. Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 2fd6d9ad8d36918d98fd2747a9b4fb8f3c07c971) --- .../nrf54h20dk_nrf54h20-common.dtsi | 37 +++++++++++++++++++ .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 37 ------------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi index 72d78b9c739c..28dbc5a5e329 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi @@ -14,3 +14,40 @@ /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi130 {}; + +&exmif { + pinctrl-0 = <&exmif_default>; + pinctrl-1 = <&exmif_sleep>; + pinctrl-names = "default", "sleep"; + status = "disabled"; + + mx25uw63: mx25uw6345g@0 { + compatible = "mxicy,mx25u", "jedec,mspi-nor"; + status = "disabled"; + reg = <0>; + 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]; + sfdp-ff05 = [00 ee c0 69 72 72 71 71 00 d8 f7 f6 00 0a 00 00 + 14 45 98 80]; + sfdp-ff84 = [43 06 0f 00 21 dc ff ff]; + size = <67108864>; + has-dpd; + t-enter-dpd = <10000>; + t-exit-dpd = <30000>; + reset-gpios = <&gpio6 12 GPIO_ACTIVE_LOW>; + t-reset-pulse = <10000>; + t-reset-recovery = <35000>; + + mspi-max-frequency = ; + mspi-io-mode = "MSPI_IO_MODE_OCTAL"; + mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; + mspi-hardware-ce-num = <1>; + mspi-cpp-mode = "MSPI_CPP_MODE_0"; + mspi-endian = "MSPI_BIG_ENDIAN"; + mspi-ce-polarity = "MSPI_CE_ACTIVE_LOW"; + }; +}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index c5dd7a124d1d..3025a413f498 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -274,43 +274,6 @@ slot3_partition: &cpurad_slot1_partition { status = "disabled"; }; -&exmif { - pinctrl-0 = <&exmif_default>; - pinctrl-1 = <&exmif_sleep>; - pinctrl-names = "default", "sleep"; - status = "disabled"; - - mx25uw63: mx25uw6345g@0 { - compatible = "mxicy,mx25u", "jedec,mspi-nor"; - status = "disabled"; - reg = <0>; - 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]; - sfdp-ff05 = [00 ee c0 69 72 72 71 71 00 d8 f7 f6 00 0a 00 00 - 14 45 98 80]; - sfdp-ff84 = [43 06 0f 00 21 dc ff ff]; - size = <67108864>; - has-dpd; - t-enter-dpd = <10000>; - t-exit-dpd = <30000>; - reset-gpios = <&gpio6 12 GPIO_ACTIVE_LOW>; - t-reset-pulse = <10000>; - t-reset-recovery = <35000>; - - mspi-max-frequency = ; - mspi-io-mode = "MSPI_IO_MODE_OCTAL"; - mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; - mspi-hardware-ce-num = <1>; - mspi-cpp-mode = "MSPI_CPP_MODE_0"; - mspi-endian = "MSPI_BIG_ENDIAN"; - mspi-ce-polarity = "MSPI_CE_ACTIVE_LOW"; - }; -}; - &cpuapp_ieee802154 { status = "okay"; }; From 4776b16d017389d897c62e37b37f0c6b963a5010 Mon Sep 17 00:00:00 2001 From: Waqar Tahir Date: Fri, 16 Jan 2026 12:26:58 +0100 Subject: [PATCH 1781/3334] [nrf fromtree] manifest: tf-m: BL2 support mcxn947 Updated TF-M repo for BL2 support in mcxn947 Signed-off-by: Waqar Tahir (cherry picked from commit 8e7198392a2abb5e977f33a60dd91222080da2f7) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index deeb59229390..542595d3a1c7 100644 --- a/west.yml +++ b/west.yml @@ -386,7 +386,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 677e0565e030cbe4946ac0cbde5603eae7d6392f + revision: 6788687e013733d12f015b5d45b214019dea58f7 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From b63bab7e49aeef167c13e65e5f707a2f9337c8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 27 Jan 2026 09:27:06 +0100 Subject: [PATCH 1782/3334] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding as default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 22acc285ac9f7a512b47a124f41707893f2e5bc8. Signed-off-by: Michał Stasiak --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 +++++ boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts | 4 ++++ dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 5 ----- dts/vendor/nordic/nrf54lm20a.dtsi | 5 ----- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index 6ab124d0fb84..f0946efb543f 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -18,6 +18,7 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; + zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; @@ -97,6 +98,10 @@ status = "okay"; }; +&bt_hci_controller { + status = "okay"; +}; + &ieee802154 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index ef47e866e4c4..a5d1600de247 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -19,5 +19,9 @@ }; }; +&bt_hci_controller { + status = "okay"; +}; + /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index a8a384636151..68d08e7cbd8b 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -22,7 +22,6 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -43,10 +42,6 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { - status = "okay"; -}; - &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 73f7251d7a29..351b4b959886 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -301,11 +301,6 @@ /* Note: In the nRF Connect SDK the SoftDevice Controller * is added and set as the default Bluetooth Controller. */ - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From 9e775d2161467bb3a355cefcc0355cafe1084f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 27 Jan 2026 09:27:11 +0100 Subject: [PATCH 1783/3334] Revert "[nrf noup] dts: choose a psa-rng for entropy for 54lm20a" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e6ba1bc19db2ecd0bd245a0a27ec9eae9d44ea81. Signed-off-by: Michał Stasiak --- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 6e0b57f0f0d4..d4dcee6850d6 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -31,7 +31,7 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "disabled"; + status = "okay"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index 68d08e7cbd8b..d74a33745c01 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -22,7 +22,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &psa_rng; + zephyr,entropy = &rng; }; soc { @@ -33,11 +33,11 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "okay"; + status = "disabled"; }; rng: rng { - status = "disabled"; + status = "okay"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; }; From 48afc0536944715f35ea614f5ae8a3dc453ec3fd Mon Sep 17 00:00:00 2001 From: Andy Lin Date: Wed, 7 Jan 2026 01:42:17 +0800 Subject: [PATCH 1784/3334] [nrf fromtree] arch: riscv: Add the support for Zbkb ISA extension Introduce the missing flag to compile code with Zbkb extension, which has already been supported by the GCC 12 in current SDK. Signed-off-by: Andy Lin (cherry picked from commit d807e39a2cbfa28d5a5b60a663c43ea9b3b95fd2) --- arch/riscv/Kconfig.isa | 8 ++++++++ cmake/compiler/gcc/target_riscv.cmake | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/arch/riscv/Kconfig.isa b/arch/riscv/Kconfig.isa index c5ee324464d8..f5df9b85eef1 100644 --- a/arch/riscv/Kconfig.isa +++ b/arch/riscv/Kconfig.isa @@ -237,6 +237,14 @@ config RISCV_ISA_EXT_ZBC The Zbc instructions can be used for carry-less multiplication that is the multiplication in the polynomial ring over GF(2). +config RISCV_ISA_EXT_ZBKB + bool + help + (Zbkb) - Zbkb BitManip Extension (Bit-manipulation for Cryptography) + + The Zbkb instructions can be used for accelerating cryptography workloads + and contain rotation, reversion, packing and some advanced bit-manipulation. + config RISCV_ISA_EXT_ZBS bool help diff --git a/cmake/compiler/gcc/target_riscv.cmake b/cmake/compiler/gcc/target_riscv.cmake index e440d4e2b158..656b597a393e 100644 --- a/cmake/compiler/gcc/target_riscv.cmake +++ b/cmake/compiler/gcc/target_riscv.cmake @@ -118,6 +118,10 @@ if(CONFIG_RISCV_ISA_EXT_ZBC) string(CONCAT riscv_march ${riscv_march} "_zbc") endif() +if(CONFIG_RISCV_ISA_EXT_ZBKB) + string(CONCAT riscv_march ${riscv_march} "_zbkb") +endif() + if(CONFIG_RISCV_ISA_EXT_ZBS) string(CONCAT riscv_march ${riscv_march} "_zbs") endif() From 6337ad6b0c3823c6bdc934e30bb441ce31268b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 11:50:02 +0100 Subject: [PATCH 1785/3334] [nrf fromtree] scripts: Add list array support for dt_compat_any_has_prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for arrays and string-arrays to dt_compat_any_has_prop kconfig preprocessor function. Signed-off-by: Fin Maaß (cherry picked from commit 8f23fdc74366cdbfa83845ebf8112b0bfaf56342) --- scripts/kconfig/kconfigfunctions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 3c66066b4457..350a278fa46d 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -868,6 +868,9 @@ def dt_compat_any_has_prop(kconf, _, compat, prop, value=None): if prop in node.props: if value is None: return "y" + if isinstance(node.props[prop].val, list): + if value in map(str, node.props[prop].val): + return "y" elif str(node.props[prop].val) == value: return "y" return "n" From d0e1186ef2dc7bb96736e9bddc4e3279c46d73d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 11:55:00 +0100 Subject: [PATCH 1786/3334] [nrf fromtree] scripts: Add dt_compat_all_has_prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the dt_compat_all_has_prop kconfig preprocessor function, simillar to dt_compat_any_has_prop. Signed-off-by: Fin Maaß (cherry picked from commit 3bffe47e3d4cfaa28083fe28b2f7b292aa3cdc39) --- doc/build/kconfig/preprocessor-functions.rst | 1 + scripts/kconfig/kconfigfunctions.py | 28 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/doc/build/kconfig/preprocessor-functions.rst b/doc/build/kconfig/preprocessor-functions.rst index ab7429963409..92287c87a183 100644 --- a/doc/build/kconfig/preprocessor-functions.rst +++ b/doc/build/kconfig/preprocessor-functions.rst @@ -39,6 +39,7 @@ while the ``*_hex`` version returns a hexadecimal value starting with ``0x``. $(dt_chosen_reg_addr_int,[,,]) $(dt_chosen_reg_size_hex,[,,]) $(dt_chosen_reg_size_int,[,,]) + $(dt_compat_all_has_prop,,[,]) $(dt_compat_any_has_prop,,[,]) $(dt_compat_any_on_bus,,) $(dt_compat_enabled,) diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 350a278fa46d..5c54d40f760f 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -851,6 +851,33 @@ def dt_compat_on_bus(kconf, _, compat, bus): return "n" +def dt_compat_all_has_prop(kconf, _, compat, prop, value=None): + """ + This function takes a 'compat', a 'prop', and a 'value'. + If value=None, the function returns "y" if all + enabled node with compatible 'compat' also has a valid property 'prop'. + If value is given, the function returns "y" if all enabled node with compatible 'compat' + also has a valid property 'prop' with value 'value'. + It returns "n" otherwise. + """ + if doc_mode or edt is None: + return "n" + + if compat not in edt.compat2okay or len(edt.compat2okay[compat]) == 0: + return "n" + + for node in edt.compat2okay[compat]: + if prop not in node.props: + return "n" + if value is None: + continue + if isinstance(node.props[prop].val, list): + if value not in map(str, node.props[prop].val): + return "n" + elif str(node.props[prop].val) != value: + return "n" + return "y" + def dt_compat_any_has_prop(kconf, _, compat, prop, value=None): """ This function takes a 'compat', a 'prop', and a 'value'. @@ -1144,6 +1171,7 @@ def inc_dec(kconf, name, *args): "dt_compat_enabled": (dt_compat_enabled, 1, 1), "dt_compat_enabled_num": (dt_compat_enabled_num, 1, 1), "dt_compat_on_bus": (dt_compat_on_bus, 2, 2), + "dt_compat_all_has_prop": (dt_compat_all_has_prop, 2, 3), "dt_compat_any_has_prop": (dt_compat_any_has_prop, 2, 3), "dt_compat_any_not_has_prop": (dt_compat_any_not_has_prop, 2, 2), "dt_chosen_label": (dt_chosen_label, 1, 1), From 7e4d6bcf660d075e5aa836caf4a7700ce95a23ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 12:24:08 +0100 Subject: [PATCH 1787/3334] [nrf fromtree] scripts: Refactor dt_compat_any_has_prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactor dt_compat_any_has_prop to reduce its Cognitive Complexity. Signed-off-by: Fin Maaß (cherry picked from commit c42538600f2127be6b35e24692bbfe6ccb938c44) --- scripts/kconfig/kconfigfunctions.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 5c54d40f760f..87fcc70d4cf5 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -890,16 +890,19 @@ def dt_compat_any_has_prop(kconf, _, compat, prop, value=None): if doc_mode or edt is None: return "n" - if compat in edt.compat2okay: - for node in edt.compat2okay[compat]: - if prop in node.props: - if value is None: - return "y" - if isinstance(node.props[prop].val, list): - if value in map(str, node.props[prop].val): - return "y" - elif str(node.props[prop].val) == value: - return "y" + if compat not in edt.compat2okay: + return "n" + + for node in edt.compat2okay[compat]: + if prop not in node.props: + continue + if value is None: + return "y" + if isinstance(node.props[prop].val, list): + if value in map(str, node.props[prop].val): + return "y" + elif str(node.props[prop].val) == value: + return "y" return "n" def dt_compat_any_not_has_prop(kconf, _, compat, prop): From a2685accb2810e9b5867cb8b31026421a951190e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 14:58:18 +0100 Subject: [PATCH 1788/3334] [nrf fromtree] riscv: dts: add missing "riscv" compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the "riscv" compatible, where it was missing. Signed-off-by: Fin Maaß (cherry picked from commit e5dc87003d6c126492ffffc6e4c0bdc6f9f5b767) --- dts/riscv/aesc/nitrogen.dtsi | 2 +- dts/riscv/espressif/esp32c6/esp32c6_common.dtsi | 2 +- dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi | 2 +- dts/riscv/espressif/esp32h2/esp32h2_common.dtsi | 2 +- dts/riscv/openhwgroup/cv32a6.dtsi | 2 +- dts/riscv/openhwgroup/cv64a6.dtsi | 2 +- dts/riscv/wch/qingke-v2a.dtsi | 2 +- dts/riscv/wch/qingke-v2c.dtsi | 2 +- dts/riscv/wch/qingke-v4b.dtsi | 2 +- dts/riscv/wch/qingke-v4c.dtsi | 2 +- dts/riscv/wch/qingke-v4f.dtsi | 2 +- dts/vendor/nordic/nrf54h20.dtsi | 4 ++-- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 2 +- dts/vendor/nordic/nrf54lm20a.dtsi | 2 +- dts/vendor/nordic/nrf7120_enga.dtsi | 2 +- dts/vendor/nordic/nrf9280.dtsi | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dts/riscv/aesc/nitrogen.dtsi b/dts/riscv/aesc/nitrogen.dtsi index 0babebf5ce1d..b1e3def00bbd 100644 --- a/dts/riscv/aesc/nitrogen.dtsi +++ b/dts/riscv/aesc/nitrogen.dtsi @@ -17,7 +17,7 @@ #size-cells = <0>; cpu0: cpu@0 { - compatible = "litex,vexriscv-standard"; + compatible = "litex,vexriscv-standard", "riscv"; device_type = "cpu"; reg = <0>; riscv,isa = "rv32imc"; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi index 7cfd23bb683c..c0c53314d5a1 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi @@ -34,7 +34,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "espressif,riscv"; + compatible = "espressif,riscv", "riscv"; riscv,isa = "rv32imac_zicsr"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi index d92d8e992b7c..50d2b6592e04 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi @@ -20,7 +20,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "espressif,riscv"; + compatible = "espressif,riscv", "riscv"; riscv,isa = "rv32imac_zicsr_zifencei"; reg = <0>; clock-source = ; diff --git a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi index 5353e91bdb38..631dd14969e2 100644 --- a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi +++ b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi @@ -33,7 +33,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "espressif,riscv"; + compatible = "espressif,riscv", "riscv"; riscv,isa = "rv32imac_zicsr"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; diff --git a/dts/riscv/openhwgroup/cv32a6.dtsi b/dts/riscv/openhwgroup/cv32a6.dtsi index 83ac4bd70fb2..e71571bee118 100644 --- a/dts/riscv/openhwgroup/cv32a6.dtsi +++ b/dts/riscv/openhwgroup/cv32a6.dtsi @@ -21,7 +21,7 @@ clock-frequency = ; timebase-frequency = ; device_type = "cpu"; - compatible = "openhwgroup,cva6"; + compatible = "openhwgroup,cva6", "riscv"; riscv,isa = "rv32ima"; /* overwrite in board configuration if sv32 MMU is enabled */ mmu-type = "riscv,none"; diff --git a/dts/riscv/openhwgroup/cv64a6.dtsi b/dts/riscv/openhwgroup/cv64a6.dtsi index 13fe21399b69..ca3b47523cec 100644 --- a/dts/riscv/openhwgroup/cv64a6.dtsi +++ b/dts/riscv/openhwgroup/cv64a6.dtsi @@ -21,7 +21,7 @@ clock-frequency = ; timebase-frequency = ; device_type = "cpu"; - compatible = "openhwgroup,cva6"; + compatible = "openhwgroup,cva6", "riscv"; riscv,isa = "rv64imafdc"; mmu-type = "riscv,sv39"; reg = <0>; diff --git a/dts/riscv/wch/qingke-v2a.dtsi b/dts/riscv/wch/qingke-v2a.dtsi index a82ce935a53b..b7da8aab9f0d 100644 --- a/dts/riscv/wch/qingke-v2a.dtsi +++ b/dts/riscv/wch/qingke-v2a.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v2"; + compatible = "wch,qingke-v2", "riscv"; reg = <0>; riscv,isa = "rv32ec_zicsr_zifencei"; }; diff --git a/dts/riscv/wch/qingke-v2c.dtsi b/dts/riscv/wch/qingke-v2c.dtsi index dc6b57cdae7a..2a005c5766f3 100644 --- a/dts/riscv/wch/qingke-v2c.dtsi +++ b/dts/riscv/wch/qingke-v2c.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v2"; + compatible = "wch,qingke-v2", "riscv"; reg = <0>; riscv,isa = "rv32ec_zicsr_zifencei_zmmul"; }; diff --git a/dts/riscv/wch/qingke-v4b.dtsi b/dts/riscv/wch/qingke-v4b.dtsi index 0fb20ef7e25f..7ff969ba6f1c 100644 --- a/dts/riscv/wch/qingke-v4b.dtsi +++ b/dts/riscv/wch/qingke-v4b.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v4b"; + compatible = "wch,qingke-v4b", "riscv"; reg = <0>; riscv,isa = "rv32imac_zicsr_zifencei"; }; diff --git a/dts/riscv/wch/qingke-v4c.dtsi b/dts/riscv/wch/qingke-v4c.dtsi index c4b00b5fdd7e..866fc98ab088 100644 --- a/dts/riscv/wch/qingke-v4c.dtsi +++ b/dts/riscv/wch/qingke-v4c.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v4c"; + compatible = "wch,qingke-v4c", "riscv"; reg = <0>; riscv,isa = "rv32imac_zicsr_zifencei"; }; diff --git a/dts/riscv/wch/qingke-v4f.dtsi b/dts/riscv/wch/qingke-v4f.dtsi index 32d70579ba1b..159c215eb251 100644 --- a/dts/riscv/wch/qingke-v4f.dtsi +++ b/dts/riscv/wch/qingke-v4f.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v4f"; + compatible = "wch,qingke-v4f", "riscv"; reg = <0>; riscv,isa = "rv32imacf_zicsr_zifencei"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index f40b202fbba2..eb8df4805a84 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -43,7 +43,7 @@ }; cpuppr: cpu@d { - compatible = "nordic,vpr"; + compatible = "nordic,vpr", "riscv"; reg = <13>; device_type = "cpu"; clocks = <&fll16m>; @@ -78,7 +78,7 @@ }; cpuflpr: cpu@e { - compatible = "nordic,vpr"; + compatible = "nordic,vpr", "riscv"; reg = <14>; device_type = "cpu"; clock-frequency = ; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 4dea8277169f..0f609cbd3a80 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -39,7 +39,7 @@ }; cpuflpr: cpu@1 { - compatible = "nordic,vpr"; + compatible = "nordic,vpr", "riscv"; reg = <1>; device_type = "cpu"; clocks = <&hfpll>; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 351b4b959886..1ba0cf6a813f 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -39,7 +39,7 @@ }; cpuflpr: cpu@1 { - compatible = "nordic,vpr"; + compatible = "nordic,vpr", "riscv"; reg = <1>; device_type = "cpu"; riscv,isa = "rv32emc"; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index bcbb99be2feb..a709b0109f66 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -34,7 +34,7 @@ }; cpuflpr: cpu@1 { - compatible = "nordic,vpr"; + compatible = "nordic,vpr", "riscv"; reg = <1>; device_type = "cpu"; clock-frequency = ; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index a4dd3e2ea2b9..271fcc765f57 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -38,7 +38,7 @@ }; cpuppr: cpu@d { - compatible = "nordic,vpr"; + compatible = "nordic,vpr", "riscv"; reg = <13>; device_type = "cpu"; clock-frequency = ; From 62cb56c299ea268aa4806553d51e4dd3759e61a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 12:46:12 +0100 Subject: [PATCH 1789/3334] [nrf fromtree] starfive: riscv: dts: remove unsupported properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove unsupported properties from the StarFive RISC-V DTS files. Signed-off-by: Fin Maaß (cherry picked from commit 0c07ca7538003eb9117c75199eb5d986022ccb3f) --- dts/riscv/starfive/jh7110-visionfive-v2.dtsi | 48 ------------------- .../starfive/starfive_jh7100_beagle_v.dtsi | 26 ---------- 2 files changed, 74 deletions(-) diff --git a/dts/riscv/starfive/jh7110-visionfive-v2.dtsi b/dts/riscv/starfive/jh7110-visionfive-v2.dtsi index 7803ccd9f649..a1b51d8f9ac3 100644 --- a/dts/riscv/starfive/jh7110-visionfive-v2.dtsi +++ b/dts/riscv/starfive/jh7110-visionfive-v2.dtsi @@ -36,21 +36,9 @@ U74_1: cpu@1 { compatible = "sifive,u74", "riscv"; device_type = "cpu"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <40>; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <40>; mmu-type = "riscv,sv39"; - next-level-cache = <&ccache>; reg = <0x1>; riscv,isa = "rv64imafdcg"; - tlb-spilt; cpu1_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -62,21 +50,9 @@ U74_2: cpu@2 { compatible = "sifive,u74", "riscv"; device_type = "cpu"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <40>; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <40>; mmu-type = "riscv,sv39"; - next-level-cache = <&ccache>; reg = <0x2>; riscv,isa = "rv64imafdcg"; - tlb-split; cpu2_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -88,21 +64,9 @@ U74_3: cpu@3 { compatible = "sifive,u74", "riscv"; device_type = "cpu"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <40>; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <40>; mmu-type = "riscv,sv39"; - next-level-cache = <&ccache>; reg = <0x3>; riscv,isa = "rv64imafdcg"; - tlb-split; cpu3_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -114,21 +78,9 @@ U74_4: cpu@4 { compatible = "sifive,u74", "riscv"; device_type = "cpu"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <40>; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <40>; mmu-type = "riscv,sv39"; - next-level-cache = <&ccache>; reg = <0x4>; riscv,isa = "rv64imafdcg"; - tlb-split; cpu4_intc: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi b/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi index 3e7f55cee028..e2568deb7c19 100644 --- a/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi +++ b/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi @@ -21,24 +21,11 @@ cpu@0 { clock-frequency = <0>; compatible = "starfive,rocket0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <32>; device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <32>; mmu-type = "riscv,sv39"; - next-level-cache = <&cachectrl>; reg = <0>; riscv,isa = "rv64gc"; - starfive,itim = <&itim0>; status = "okay"; - tlb-split; cpu0intctrl: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -51,24 +38,11 @@ cpu@1 { clock-frequency = <0>; compatible = "starfive,rocket0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; - d-tlb-sets = <1>; - d-tlb-size = <32>; device_type = "cpu"; - i-cache-block-size = <64>; - i-cache-sets = <64>; - i-cache-size = <32768>; - i-tlb-sets = <1>; - i-tlb-size = <32>; mmu-type = "riscv,sv39"; - next-level-cache = <&cachectrl>; reg = <1>; riscv,isa = "rv64gc"; - starfive,itim = <&itim1>; status = "okay"; - tlb-split; cpu1intctrl: interrupt-controller { compatible = "riscv,cpu-intc"; From 33036c88cb9dac794c42ac9a28823d232683af45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 15:05:42 +0100 Subject: [PATCH 1790/3334] [nrf fromtree] arch: riscv: require "riscv" compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Require the "riscv" compatible for CONFIG_RISCV. Signed-off-by: Fin Maaß (cherry picked from commit 0da1b7870e77e395b64f62b4f7a61ef1a4150918) --- arch/Kconfig | 1 + dts/bindings/cpu/riscv,cpus.yaml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index 9a08a29cf38e..e14c24119c85 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -122,6 +122,7 @@ config RISCV select ARCH_HAS_DIRECTED_IPIS select BARRIER_OPERATIONS_BUILTIN select ARCH_HAS_THREAD_PRIV_STACK_SPACE_GET if USERSPACE + depends on DT_HAS_RISCV_ENABLED help RISCV architecture diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index 883146d76b2a..ed38bfa69a56 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -1,6 +1,10 @@ # Copyright (c) 2021 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 +description: RISC-V CPU + +compatible: "riscv" + include: cpu.yaml properties: From 131291bacb2df7d3ab07da7413a3a5b892f549be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 15:17:11 +0100 Subject: [PATCH 1791/3334] [nrf fromtree] docs: migration-guide: riscv compatible requirement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mention riscv compatible requirement. Signed-off-by: Fin Maaß (cherry picked from commit 2ab28b2edfa23a7d1c22f6011a373138fd4beef4) --- doc/releases/migration-guide-4.4.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 21d580984f10..0bb6fabcd067 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -802,3 +802,6 @@ Architectures the feature is cache related so move it under cache. * Use :c:func:`sys_cache_is_mem_coherent` instead of :c:func:`arch_mem_coherent`. + +* :kconfig:option:`CONFIG_RISCV` now requires, that the :dtcompatible:`riscv` is present in the + devicetree. From e223c442535b6f65e22c5ec32c56a8692615821c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 14 Oct 2025 13:54:03 +0200 Subject: [PATCH 1792/3334] [nrf fromtree] riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit implement and use riscv,isa-extensions dt prop, like in linux https://www.kernel.org/doc/Documentation/devicetree/bindings/riscv/extensions.yaml to set the riscv extentions. Signed-off-by: Fin Maaß (cherry picked from commit e2fd8e6de742bc40eccdfea1291615a4ddb4c003) --- arch/riscv/Kconfig.isa | 31 +++++++++++++++++++++++++++++++ dts/bindings/cpu/riscv,cpus.yaml | 18 ++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/arch/riscv/Kconfig.isa b/arch/riscv/Kconfig.isa index f5df9b85eef1..c3b3c4044ae1 100644 --- a/arch/riscv/Kconfig.isa +++ b/arch/riscv/Kconfig.isa @@ -1,29 +1,37 @@ # Copyright (c) 2022 Carlo Caione # SPDX-License-Identifier: Apache-2.0 +RISCV_ISA_BASE_PROP := riscv,isa-base +RISCV_ISA_EXT_PROP := riscv,isa-extensions + config RISCV_ISA_RV32I bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_BASE_PROP),rv32i) help RV32I Base Integer Instruction Set - 32bit config RISCV_ISA_RV32E bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_BASE_PROP),rv32e) help RV32E Base Integer Instruction Set (Embedded) - 32bit config RISCV_ISA_RV64I bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_BASE_PROP),rv64i) select 64BIT help RV64I Base Integer Instruction Set - 64bit config RISCV_ISA_RV128I bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_BASE_PROP),rv128i) help RV128I Base Integer Instruction Set - 128bit config RISCV_ISA_EXT_M bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),m) help (M) - Standard Extension for Integer Multiplication and Division @@ -33,6 +41,7 @@ config RISCV_ISA_EXT_M config RISCV_ISA_EXT_A bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),a) imply RISCV_ISA_EXT_ZAAMO imply RISCV_ISA_EXT_ZALRSC help @@ -45,6 +54,7 @@ config RISCV_ISA_EXT_A config RISCV_ISA_EXT_F bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),f) select CPU_HAS_FPU help (F) - Standard Extension for Single-Precision Floating-Point @@ -56,6 +66,7 @@ config RISCV_ISA_EXT_F config RISCV_ISA_EXT_D bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),d) depends on RISCV_ISA_EXT_F select CPU_HAS_FPU_DOUBLE_PRECISION help @@ -79,6 +90,7 @@ config RISCV_ISA_EXT_G config RISCV_ISA_EXT_Q bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),q) depends on RISCV_ISA_RV64I depends on RISCV_ISA_EXT_F depends on RISCV_ISA_EXT_D @@ -91,6 +103,7 @@ config RISCV_ISA_EXT_Q config RISCV_ISA_EXT_C bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),c) select RISCV_ISA_EXT_ZCA select RISCV_ISA_EXT_ZCD if RISCV_ISA_EXT_D select RISCV_ISA_EXT_ZCF if RISCV_ISA_EXT_F && (RISCV_ISA_RV32I || RISCV_ISA_RV32E) @@ -103,6 +116,7 @@ config RISCV_ISA_EXT_C config RISCV_ISA_EXT_ZICNTR bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zicntr) depends on RISCV_ISA_EXT_ZICSR help (Zicntr) - Standard Extension for Base Counters and Timers @@ -113,6 +127,7 @@ config RISCV_ISA_EXT_ZICNTR config RISCV_ISA_EXT_ZICSR bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zicsr) help (Zicsr) - Standard Extension for Control and Status Register (CSR) Instructions @@ -121,6 +136,7 @@ config RISCV_ISA_EXT_ZICSR config RISCV_ISA_EXT_SMCSRIND bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),smcsrind) depends on RISCV_ISA_EXT_ZICSR help (Smcsrind) - Standard Extension for Indirect CSR Access @@ -130,6 +146,7 @@ config RISCV_ISA_EXT_SMCSRIND config RISCV_ISA_EXT_ZIFENCEI bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zifencei) help (Zifencei) - Standard Extension for Instruction-Fetch Fence @@ -139,6 +156,7 @@ config RISCV_ISA_EXT_ZIFENCEI config RISCV_ISA_EXT_ZAAMO bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zaamo) help (Zaamo) - Atomic memory operation subset of the A extension @@ -146,6 +164,7 @@ config RISCV_ISA_EXT_ZAAMO config RISCV_ISA_EXT_ZALRSC bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zalrsc) help (Zalrsc) - Load-Reserved/Store-Conditional subset of the A extension @@ -153,6 +172,7 @@ config RISCV_ISA_EXT_ZALRSC config RISCV_ISA_EXT_ZCA bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zca) help (Zca) - Zba Extension for Compressed Instructions @@ -161,6 +181,7 @@ config RISCV_ISA_EXT_ZCA config RISCV_ISA_EXT_ZCB bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcb) depends on RISCV_ISA_EXT_ZCA help (Zcb) - Zcb Extension for Simple Compressed Instructions @@ -170,6 +191,7 @@ config RISCV_ISA_EXT_ZCB config RISCV_ISA_EXT_ZCD bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcd) depends on RISCV_ISA_EXT_D depends on RISCV_ISA_EXT_ZCA help @@ -180,6 +202,7 @@ config RISCV_ISA_EXT_ZCD config RISCV_ISA_EXT_ZCF bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcf) depends on RISCV_ISA_RV32I || RISCV_ISA_RV32E depends on RISCV_ISA_EXT_F depends on RISCV_ISA_EXT_ZCA @@ -191,6 +214,7 @@ config RISCV_ISA_EXT_ZCF config RISCV_ISA_EXT_ZCMP bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcmp) depends on RISCV_ISA_EXT_ZCA depends on !RISCV_ISA_EXT_ZCD help @@ -201,6 +225,7 @@ config RISCV_ISA_EXT_ZCMP config RISCV_ISA_EXT_ZCMT bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcmt) depends on RISCV_ISA_EXT_ZICSR depends on RISCV_ISA_EXT_ZCA depends on !RISCV_ISA_EXT_ZCD @@ -212,6 +237,7 @@ config RISCV_ISA_EXT_ZCMT config RISCV_ISA_EXT_ZBA bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zba) help (Zba) - Zba BitManip Extension @@ -222,6 +248,7 @@ config RISCV_ISA_EXT_ZBA config RISCV_ISA_EXT_ZBB bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zbb) help (Zbb) - Zbb BitManip Extension (Basic bit-manipulation) @@ -231,6 +258,7 @@ config RISCV_ISA_EXT_ZBB config RISCV_ISA_EXT_ZBC bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zbc) help (Zbc) - Zbc BitManip Extension (Carry-less multiplication) @@ -239,6 +267,7 @@ config RISCV_ISA_EXT_ZBC config RISCV_ISA_EXT_ZBKB bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zbkb) help (Zbkb) - Zbkb BitManip Extension (Bit-manipulation for Cryptography) @@ -247,6 +276,7 @@ config RISCV_ISA_EXT_ZBKB config RISCV_ISA_EXT_ZBS bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zbs) help (Zbs) - Zbs BitManip Extension (Single-bit instructions) @@ -256,6 +286,7 @@ config RISCV_ISA_EXT_ZBS config RISCV_ISA_EXT_ZMMUL bool + default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zmmul) help (Zmmul) - Zmmul Extension for Integer Multiplication diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index ed38bfa69a56..6858a290fc9a 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -21,3 +21,21 @@ properties: description: RISC-V instruction set architecture required: true type: string + + riscv,isa-base: + description: The base ISA implemented by the hart. + type: string + enum: + - rv32i + - rv32e + - rv64i + - rv128i + + riscv,isa-extensions: + description: | + Extensions supported by the hart. Take a look at + https://www.kernel.org/doc/Documentation/devicetree/bindings/riscv/extensions.yaml + and https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html + for a list of possible extensions. Not all options listed there are + necessarily supported by Zephyr. + type: string-array From fcd601a8778b6aaacf409604207aa21e8af7d225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 14 Oct 2025 13:55:53 +0200 Subject: [PATCH 1793/3334] [nrf fromtree] riscv: make riscv,isa dt prop no longer required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit make riscv,isa dt prop no longer required, as it is is not really used by anyrhing in zephyr and we now have a alternative (riscv,isa-base and riscv,isa-extensions). Signed-off-by: Fin Maaß (cherry picked from commit 974d7522939e8d68efa82818c22ed1ef93ca5072) --- dts/bindings/cpu/riscv,cpus.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index 6858a290fc9a..0ff385142e1f 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -19,7 +19,6 @@ properties: riscv,isa: description: RISC-V instruction set architecture - required: true type: string riscv,isa-base: From e933df1a3ea4e1a266a826ccc47a33001ff7b573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 14 Oct 2025 14:04:30 +0200 Subject: [PATCH 1794/3334] [nrf fromtree] litex: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for litex vexriscv soc. Signed-off-by: Fin Maaß (cherry picked from commit 673994458b090fedfa97ed1c1099c9649c934e24) --- dts/riscv/riscv32-litex-vexriscv.dtsi | 3 ++- soc/litex/litex_vexriscv/Kconfig | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dts/riscv/riscv32-litex-vexriscv.dtsi b/dts/riscv/riscv32-litex-vexriscv.dtsi index 0439d2ab3a43..7089bf154521 100644 --- a/dts/riscv/riscv32-litex-vexriscv.dtsi +++ b/dts/riscv/riscv32-litex-vexriscv.dtsi @@ -19,7 +19,8 @@ compatible = "litex,vexriscv-standard", "spinalhdl,vexriscv", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv32im_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "zicsr", "zifencei"; status = "okay"; }; }; diff --git a/soc/litex/litex_vexriscv/Kconfig b/soc/litex/litex_vexriscv/Kconfig index 00d5c6d05bf4..37463c812bff 100644 --- a/soc/litex/litex_vexriscv/Kconfig +++ b/soc/litex/litex_vexriscv/Kconfig @@ -4,10 +4,6 @@ config SOC_LITEX_VEXRISCV select RISCV select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI # There are varriants of the Vexriscv without cache, be able to set it select CPU_HAS_ICACHE if $(dt_node_int_prop_int,/cpus/cpu@0,i-cache-line-size) > 0 select CPU_HAS_DCACHE if $(dt_node_int_prop_int,/cpus/cpu@0,d-cache-line-size) > 0 From 254ccf3f7be792201bfb86ee84dff524dfbc1545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 27 Oct 2025 12:56:42 +0100 Subject: [PATCH 1795/3334] [nrf fromtree] qemu: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for qemu riscv boards. Signed-off-by: Fin Maaß (cherry picked from commit d20d43b63de085eaf2fa97394f773458c302c511) --- boards/qemu/riscv32e/qemu_riscv32e.dts | 2 +- dts/riscv/qemu/virt-riscv32.dtsi | 24 ++++++--- dts/riscv/qemu/virt-riscv32e.dtsi | 53 +++++++++++++++++++ dts/riscv/qemu/virt-riscv64.dtsi | 24 ++++++--- soc/qemu/virt_riscv/Kconfig | 3 -- soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig | 4 -- .../virt_riscv/qemu_virt_riscv32e/Kconfig | 3 -- soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig | 5 -- 8 files changed, 86 insertions(+), 32 deletions(-) create mode 100644 dts/riscv/qemu/virt-riscv32e.dtsi diff --git a/boards/qemu/riscv32e/qemu_riscv32e.dts b/boards/qemu/riscv32e/qemu_riscv32e.dts index 403d75cb7420..0ed55c7a965f 100644 --- a/boards/qemu/riscv32e/qemu_riscv32e.dts +++ b/boards/qemu/riscv32e/qemu_riscv32e.dts @@ -7,7 +7,7 @@ /dts-v1/; -#include +#include / { chosen { diff --git a/dts/riscv/qemu/virt-riscv32.dtsi b/dts/riscv/qemu/virt-riscv32.dtsi index 25d769d5183a..6fa79c639d37 100644 --- a/dts/riscv/qemu/virt-riscv32.dtsi +++ b/dts/riscv/qemu/virt-riscv32.dtsi @@ -11,35 +11,43 @@ / { cpus { cpu@0 { - riscv,isa = "rv32gc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@1 { - riscv,isa = "rv32gc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@2 { - riscv,isa = "rv32gc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@3 { - riscv,isa = "rv32gc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@4 { - riscv,isa = "rv32gc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@5 { - riscv,isa = "rv32gc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@6 { - riscv,isa = "rv32gc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@7 { - riscv,isa = "rv32gc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; }; }; diff --git a/dts/riscv/qemu/virt-riscv32e.dtsi b/dts/riscv/qemu/virt-riscv32e.dtsi new file mode 100644 index 000000000000..e7f79639739e --- /dev/null +++ b/dts/riscv/qemu/virt-riscv32e.dtsi @@ -0,0 +1,53 @@ +/* + * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include + +/ { + cpus { + cpu@0 { + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; + }; + + cpu@1 { + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; + }; + + cpu@2 { + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; + }; + + cpu@3 { + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; + }; + + cpu@4 { + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; + }; + + cpu@5 { + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; + }; + + cpu@6 { + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; + }; + + cpu@7 { + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; + }; + }; +}; diff --git a/dts/riscv/qemu/virt-riscv64.dtsi b/dts/riscv/qemu/virt-riscv64.dtsi index 936f0a188152..0410ee3ec58e 100644 --- a/dts/riscv/qemu/virt-riscv64.dtsi +++ b/dts/riscv/qemu/virt-riscv64.dtsi @@ -11,35 +11,43 @@ / { cpus { cpu@0 { - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@1 { - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@2 { - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@3 { - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@4 { - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@5 { - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@6 { - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; cpu@7 { - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; }; }; }; diff --git a/soc/qemu/virt_riscv/Kconfig b/soc/qemu/virt_riscv/Kconfig index d17ac3296a12..f4f82a7fa07f 100644 --- a/soc/qemu/virt_riscv/Kconfig +++ b/soc/qemu/virt_riscv/Kconfig @@ -3,9 +3,6 @@ config SOC_FAMILY_QEMU_VIRT_RISCV select INCLUDE_RESET_VECTOR - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C select RISCV select RISCV_PRIVILEGED select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING diff --git a/soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig b/soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig index f8f1157f247b..8405adf66d36 100644 --- a/soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig +++ b/soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig @@ -2,8 +2,4 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_QEMU_VIRT_RISCV32 - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_PLIC diff --git a/soc/qemu/virt_riscv/qemu_virt_riscv32e/Kconfig b/soc/qemu/virt_riscv/qemu_virt_riscv32e/Kconfig index 973992ece9bf..94f13a2a4b56 100644 --- a/soc/qemu/virt_riscv/qemu_virt_riscv32e/Kconfig +++ b/soc/qemu/virt_riscv/qemu_virt_riscv32e/Kconfig @@ -3,7 +3,4 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_QEMU_VIRT_RISCV32E - select RISCV_ISA_RV32E - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_PLIC diff --git a/soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig b/soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig index b78e2bf5a980..f130f51207be 100644 --- a/soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig +++ b/soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig @@ -2,9 +2,4 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_QEMU_VIRT_RISCV64 - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_D - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_PLIC From 380fa9cd41fbbfec99fc515ef6fec0d55412ab25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 3 Nov 2025 13:13:51 +0100 Subject: [PATCH 1796/3334] [nrf fromtree] efinix: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for efinix riscv boards. Signed-off-by: Fin Maaß (cherry picked from commit cf921b08d44b0b2c612ed710c6947a84753ba016) --- dts/riscv/efinix/sapphire_soc.dtsi | 3 ++- soc/efinix/sapphire/Kconfig | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dts/riscv/efinix/sapphire_soc.dtsi b/dts/riscv/efinix/sapphire_soc.dtsi index 3e50d8d7a208..5d066c05360a 100644 --- a/dts/riscv/efinix/sapphire_soc.dtsi +++ b/dts/riscv/efinix/sapphire_soc.dtsi @@ -31,7 +31,8 @@ compatible = "efinix,vexriscv-sapphire", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv32ima_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "zicsr", "zifencei"; status = "okay"; hlic: interrupt-controller { diff --git a/soc/efinix/sapphire/Kconfig b/soc/efinix/sapphire/Kconfig index 17406bfe7f71..75a4f4f4c44c 100644 --- a/soc/efinix/sapphire/Kconfig +++ b/soc/efinix/sapphire/Kconfig @@ -3,11 +3,6 @@ config SOC_EFINIX_SAPPHIRE select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV select RISCV_PRIVILEGED select RISCV_HAS_PLIC From 79012188f4698a397588b70b95e1f975eb853a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 3 Nov 2025 13:16:53 +0100 Subject: [PATCH 1797/3334] [nrf fromtree] renode: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for renode riscv boards. Signed-off-by: Fin Maaß (cherry picked from commit 33e5ee9c31d6876f08d11e2c2593dfadef78b45f) --- dts/riscv/renode_riscv32_virt.dtsi | 3 ++- soc/renode/riscv_virtual/Kconfig | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dts/riscv/renode_riscv32_virt.dtsi b/dts/riscv/renode_riscv32_virt.dtsi index 2b8a74ba4198..96c870deba0d 100644 --- a/dts/riscv/renode_riscv32_virt.dtsi +++ b/dts/riscv/renode_riscv32_virt.dtsi @@ -19,7 +19,8 @@ compatible = "renode,virt", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; hlic: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/renode/riscv_virtual/Kconfig b/soc/renode/riscv_virtual/Kconfig index f4fa61a0b11a..6f11befe6e86 100644 --- a/soc/renode/riscv_virtual/Kconfig +++ b/soc/renode/riscv_virtual/Kconfig @@ -5,12 +5,6 @@ config SOC_RISCV_VIRTUAL_RENODE select RISCV select RISCV_PRIVILEGED select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_PLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING imply XIP From 1d2553fe764fdb53ca09b13368ca5d98c33c1983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 16:39:19 +0100 Subject: [PATCH 1798/3334] [nrf fromtree] nordic: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for nordic riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 1ab82c808c09deb878d31242c1536619650407ae) --- dts/vendor/nordic/nrf54h20.dtsi | 6 ++++-- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 3 ++- dts/vendor/nordic/nrf54lm20a.dtsi | 3 ++- dts/vendor/nordic/nrf7120_enga.dtsi | 3 ++- dts/vendor/nordic/nrf9280.dtsi | 3 ++- soc/nordic/common/vpr/Kconfig | 4 ---- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index eb8df4805a84..ca2d475ec00b 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -48,7 +48,8 @@ device_type = "cpu"; clocks = <&fll16m>; clock-frequency = ; - riscv,isa = "rv32emc"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "c", "zicsr"; nordic,bus-width = <32>; cpuppr_vevif_rx: mailbox { @@ -82,7 +83,8 @@ reg = <14>; device_type = "cpu"; clock-frequency = ; - riscv,isa = "rv32emc"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "c", "zicsr"; nordic,bus-width = <32>; cpuflpr_vevif_rx: mailbox { diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 0f609cbd3a80..0919b1347d77 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -43,7 +43,8 @@ reg = <1>; device_type = "cpu"; clocks = <&hfpll>; - riscv,isa = "rv32emc"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "c", "zicsr"; nordic,bus-width = <32>; }; }; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 1ba0cf6a813f..b872dff0f559 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -42,7 +42,8 @@ compatible = "nordic,vpr", "riscv"; reg = <1>; device_type = "cpu"; - riscv,isa = "rv32emc"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "c", "zicsr"; nordic,bus-width = <32>; }; }; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index a709b0109f66..48a2b268317e 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -38,7 +38,8 @@ reg = <1>; device_type = "cpu"; clock-frequency = ; - riscv,isa = "rv32emc"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "c", "zicsr"; nordic,bus-width = <32>; }; }; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 271fcc765f57..97a1bf7495b0 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -42,7 +42,8 @@ reg = <13>; device_type = "cpu"; clock-frequency = ; - riscv,isa = "rv32emc"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "c", "zicsr"; nordic,bus-width = <32>; cpuppr_vevif_rx: mailbox { diff --git a/soc/nordic/common/vpr/Kconfig b/soc/nordic/common/vpr/Kconfig index e3f8a717cba3..5a2ae8e48bf8 100644 --- a/soc/nordic/common/vpr/Kconfig +++ b/soc/nordic/common/vpr/Kconfig @@ -6,10 +6,6 @@ config RISCV_CORE_NORDIC_VPR select RISCV select RISCV_PRIVILEGED select RISCV_VECTORED_MODE - select RISCV_ISA_RV32E - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR select RISCV_SOC_HAS_ISR_STACKING select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select RISCV_HAS_CLIC From b32c2a1b114df361fbcc639117dc95c7ce53e6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 17:09:29 +0100 Subject: [PATCH 1799/3334] [nrf fromtree] espressif: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for espressif riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit a44b46887f743d274763195abf4cd71e29965185) --- dts/riscv/espressif/esp32c2/esp32c2_common.dtsi | 3 ++- dts/riscv/espressif/esp32c3/esp32c3_common.dtsi | 3 ++- dts/riscv/espressif/esp32c6/esp32c6_common.dtsi | 3 ++- dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi | 3 ++- dts/riscv/espressif/esp32h2/esp32h2_common.dtsi | 3 ++- soc/espressif/esp32c2/Kconfig | 4 ---- soc/espressif/esp32c3/Kconfig | 4 ---- soc/espressif/esp32c6/Kconfig | 6 ------ soc/espressif/esp32h2/Kconfig | 6 ------ 9 files changed, 10 insertions(+), 25 deletions(-) diff --git a/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi b/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi index af44efa41174..5271e436f55c 100644 --- a/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi +++ b/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi @@ -33,7 +33,8 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa = "rv32imc_zicsr"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "c", "zicsr"; reg = <0>; clock-source = ; clock-frequency = ; diff --git a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi index 75719bd14917..1129596d6cd5 100644 --- a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi +++ b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi @@ -34,7 +34,8 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa = "rv32imc_zicsr"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "c", "zicsr"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; clock-source = ; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi index c0c53314d5a1..75d7980143f4 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi @@ -35,7 +35,8 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa = "rv32imac_zicsr"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; clock-source = ; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi index 50d2b6592e04..2daf47299a5b 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi @@ -21,7 +21,8 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; reg = <0>; clock-source = ; clock-frequency = ; diff --git a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi index 631dd14969e2..26a5cc0215e3 100644 --- a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi +++ b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi @@ -34,7 +34,8 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa = "rv32imac_zicsr"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; clock-source = ; diff --git a/soc/espressif/esp32c2/Kconfig b/soc/espressif/esp32c2/Kconfig index cfade8c5b900..34716ff5b72c 100644 --- a/soc/espressif/esp32c2/Kconfig +++ b/soc/espressif/esp32c2/Kconfig @@ -7,10 +7,6 @@ config SOC_SERIES_ESP32C2 select DYNAMIC_INTERRUPTS select CLOCK_CONTROL select PINCTRL - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR select HAS_ESPRESSIF_HAL select HAS_PM select HAS_POWEROFF diff --git a/soc/espressif/esp32c3/Kconfig b/soc/espressif/esp32c3/Kconfig index c0dbb8ba8765..605d0a94c1d0 100644 --- a/soc/espressif/esp32c3/Kconfig +++ b/soc/espressif/esp32c3/Kconfig @@ -7,10 +7,6 @@ config SOC_SERIES_ESP32C3 select DYNAMIC_INTERRUPTS select CLOCK_CONTROL select PINCTRL - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR select HAS_ESPRESSIF_HAL select HAS_PM select HAS_POWEROFF diff --git a/soc/espressif/esp32c6/Kconfig b/soc/espressif/esp32c6/Kconfig index bb1b4a752392..fe6db5e4ec0b 100644 --- a/soc/espressif/esp32c6/Kconfig +++ b/soc/espressif/esp32c6/Kconfig @@ -8,12 +8,6 @@ config SOC_SERIES_ESP32C6 select DYNAMIC_INTERRUPTS if SOC_ESP32C6_HPCORE select CLOCK_CONTROL if SOC_ESP32C6_HPCORE select PINCTRL if SOC_ESP32C6_HPCORE - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select HAS_ESPRESSIF_HAL select HAS_PM select HAS_POWEROFF diff --git a/soc/espressif/esp32h2/Kconfig b/soc/espressif/esp32h2/Kconfig index 40ce94bbd682..7c795fe3fe9e 100644 --- a/soc/espressif/esp32h2/Kconfig +++ b/soc/espressif/esp32h2/Kconfig @@ -7,12 +7,6 @@ config SOC_SERIES_ESP32H2 select DYNAMIC_INTERRUPTS select CLOCK_CONTROL select PINCTRL - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select HAS_ESPRESSIF_HAL select HAS_PM select HAS_POWEROFF From 1794d47c17a4b36a709f47014069f99cc4acd741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 17:18:06 +0100 Subject: [PATCH 1800/3334] [nrf fromtree] wch: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for wch riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 95ff5d42474d5973e4133e42ac7148a5fa4d0d82) --- dts/riscv/wch/qingke-v2a.dtsi | 3 ++- dts/riscv/wch/qingke-v2c.dtsi | 3 ++- dts/riscv/wch/qingke-v4b.dtsi | 3 ++- dts/riscv/wch/qingke-v4c.dtsi | 3 ++- dts/riscv/wch/qingke-v4f.dtsi | 3 ++- soc/wch/ch32v/ch32v00x/Kconfig | 5 ----- soc/wch/ch32v/qingke_v2a/Kconfig | 4 ---- soc/wch/ch32v/qingke_v4b/Kconfig | 6 ------ soc/wch/ch32v/qingke_v4c/Kconfig | 6 ------ soc/wch/ch32v/qingke_v4f/Kconfig | 7 ------- 10 files changed, 10 insertions(+), 33 deletions(-) diff --git a/dts/riscv/wch/qingke-v2a.dtsi b/dts/riscv/wch/qingke-v2a.dtsi index b7da8aab9f0d..f6ad3cbaee38 100644 --- a/dts/riscv/wch/qingke-v2a.dtsi +++ b/dts/riscv/wch/qingke-v2a.dtsi @@ -16,7 +16,8 @@ device_type = "cpu"; compatible = "wch,qingke-v2", "riscv"; reg = <0>; - riscv,isa = "rv32ec_zicsr_zifencei"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "c", "zicsr", "zifencei"; }; }; diff --git a/dts/riscv/wch/qingke-v2c.dtsi b/dts/riscv/wch/qingke-v2c.dtsi index 2a005c5766f3..4e397841c97e 100644 --- a/dts/riscv/wch/qingke-v2c.dtsi +++ b/dts/riscv/wch/qingke-v2c.dtsi @@ -16,7 +16,8 @@ device_type = "cpu"; compatible = "wch,qingke-v2", "riscv"; reg = <0>; - riscv,isa = "rv32ec_zicsr_zifencei_zmmul"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "c", "zicsr", "zifencei", "zmmul"; }; }; diff --git a/dts/riscv/wch/qingke-v4b.dtsi b/dts/riscv/wch/qingke-v4b.dtsi index 7ff969ba6f1c..24313efe0fa0 100644 --- a/dts/riscv/wch/qingke-v4b.dtsi +++ b/dts/riscv/wch/qingke-v4b.dtsi @@ -16,7 +16,8 @@ device_type = "cpu"; compatible = "wch,qingke-v4b", "riscv"; reg = <0>; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; }; }; diff --git a/dts/riscv/wch/qingke-v4c.dtsi b/dts/riscv/wch/qingke-v4c.dtsi index 866fc98ab088..182dcd1623c5 100644 --- a/dts/riscv/wch/qingke-v4c.dtsi +++ b/dts/riscv/wch/qingke-v4c.dtsi @@ -16,7 +16,8 @@ device_type = "cpu"; compatible = "wch,qingke-v4c", "riscv"; reg = <0>; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; }; }; diff --git a/dts/riscv/wch/qingke-v4f.dtsi b/dts/riscv/wch/qingke-v4f.dtsi index 159c215eb251..cedda00e21e0 100644 --- a/dts/riscv/wch/qingke-v4f.dtsi +++ b/dts/riscv/wch/qingke-v4f.dtsi @@ -16,7 +16,8 @@ device_type = "cpu"; compatible = "wch,qingke-v4f", "riscv"; reg = <0>; - riscv,isa = "rv32imacf_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "f", "zicsr", "zifencei"; }; }; diff --git a/soc/wch/ch32v/ch32v00x/Kconfig b/soc/wch/ch32v/ch32v00x/Kconfig index 74e07bf1aa70..f32770bbd662 100644 --- a/soc/wch/ch32v/ch32v00x/Kconfig +++ b/soc/wch/ch32v/ch32v00x/Kconfig @@ -2,8 +2,3 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_CH32V00X - select RISCV_ISA_RV32E - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZMMUL diff --git a/soc/wch/ch32v/qingke_v2a/Kconfig b/soc/wch/ch32v/qingke_v2a/Kconfig index de004227a473..b3201ea981fe 100644 --- a/soc/wch/ch32v/qingke_v2a/Kconfig +++ b/soc/wch/ch32v/qingke_v2a/Kconfig @@ -2,7 +2,3 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_QINGKE_V2A - select RISCV_ISA_RV32E - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - select RISCV_ISA_EXT_C diff --git a/soc/wch/ch32v/qingke_v4b/Kconfig b/soc/wch/ch32v/qingke_v4b/Kconfig index 1706900e7cd9..45619d3c9e73 100644 --- a/soc/wch/ch32v/qingke_v4b/Kconfig +++ b/soc/wch/ch32v/qingke_v4b/Kconfig @@ -2,9 +2,3 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_QINGKE_V4B - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI diff --git a/soc/wch/ch32v/qingke_v4c/Kconfig b/soc/wch/ch32v/qingke_v4c/Kconfig index 732a7d8a9ec0..8539c83ef6da 100644 --- a/soc/wch/ch32v/qingke_v4c/Kconfig +++ b/soc/wch/ch32v/qingke_v4c/Kconfig @@ -2,9 +2,3 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_QINGKE_V4C - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI diff --git a/soc/wch/ch32v/qingke_v4f/Kconfig b/soc/wch/ch32v/qingke_v4f/Kconfig index 3f6c61415485..472fcfa45a15 100644 --- a/soc/wch/ch32v/qingke_v4f/Kconfig +++ b/soc/wch/ch32v/qingke_v4f/Kconfig @@ -2,10 +2,3 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_QINGKE_V4F - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI From 3a1e2e2f494e5b2e2f67086ed6e710ec58ba7e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 17:23:11 +0100 Subject: [PATCH 1801/3334] [nrf fromtree] telink: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for telink riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 72bd920bfa6f1f0cf402bba682a2df8402a91a19) --- dts/riscv/telink/telink_b91.dtsi | 3 ++- soc/telink/tlsr/tlsr951x/Kconfig | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/dts/riscv/telink/telink_b91.dtsi b/dts/riscv/telink/telink_b91.dtsi index c9bd546a2e94..149f7ec6e97e 100644 --- a/dts/riscv/telink/telink_b91.dtsi +++ b/dts/riscv/telink/telink_b91.dtsi @@ -24,7 +24,8 @@ reg = <0>; clock-frequency = <24000000>; compatible = "telink,b91", "andestech,andescore-v5", "riscv"; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "f", "zicsr", "zifencei"; hlic: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/telink/tlsr/tlsr951x/Kconfig b/soc/telink/tlsr/tlsr951x/Kconfig index a31aec0a5c65..99191575c4f5 100644 --- a/soc/telink/tlsr/tlsr951x/Kconfig +++ b/soc/telink/tlsr/tlsr951x/Kconfig @@ -4,13 +4,6 @@ config SOC_SERIES_TLSR951X bool select RISCV - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_PRIVILEGED select RISCV_HAS_PLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING From 36de06a3a252eb3af2e6eebb1a02a1f774797030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 17:35:57 +0100 Subject: [PATCH 1802/3334] [nrf fromtree] starfive: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for starfive riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit be7285c08646add07e76cd902e9933e6f89185bd) --- dts/riscv/starfive/jh7110-visionfive-v2.dtsi | 15 ++++++++++----- dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi | 6 ++++-- soc/starfive/jh71xx/Kconfig | 12 ------------ 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/dts/riscv/starfive/jh7110-visionfive-v2.dtsi b/dts/riscv/starfive/jh7110-visionfive-v2.dtsi index a1b51d8f9ac3..1cd042d6c729 100644 --- a/dts/riscv/starfive/jh7110-visionfive-v2.dtsi +++ b/dts/riscv/starfive/jh7110-visionfive-v2.dtsi @@ -23,7 +23,8 @@ compatible = "sifive,s7", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv64imac_zicsr_zifencei"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; status = "okay"; cpu0_intc: interrupt-controller { @@ -38,7 +39,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x1>; - riscv,isa = "rv64imafdcg"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; cpu1_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -52,7 +54,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x2>; - riscv,isa = "rv64imafdcg"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; cpu2_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -66,7 +69,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x3>; - riscv,isa = "rv64imafdcg"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; cpu3_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -80,7 +84,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x4>; - riscv,isa = "rv64imafdcg"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; cpu4_intc: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi b/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi index e2568deb7c19..c6e6ac1c00fd 100644 --- a/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi +++ b/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi @@ -24,7 +24,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; status = "okay"; cpu0intctrl: interrupt-controller { @@ -41,7 +42,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <1>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; status = "okay"; cpu1intctrl: interrupt-controller { diff --git a/soc/starfive/jh71xx/Kconfig b/soc/starfive/jh71xx/Kconfig index 607e6e94f8c6..74421040ed9d 100644 --- a/soc/starfive/jh71xx/Kconfig +++ b/soc/starfive/jh71xx/Kconfig @@ -10,18 +10,6 @@ config SOC_SERIES_STARFIVE_JH71XX config SOC_JH7100 select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI config SOC_JH7110 select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI From 790e112881b8d30e5d8ee863a7b9f469a2743f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 17:38:57 +0100 Subject: [PATCH 1803/3334] [nrf fromtree] snps: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for snps riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 617a9039469a1cfc460bcf2f3f66314d5cee125b) --- boards/snps/nsim/arc_v/rhx1xx.dtsi | 4 +++- boards/snps/nsim/arc_v/rmx1xx.dtsi | 3 ++- soc/snps/nsim/arc_v/rhx/Kconfig | 10 ---------- soc/snps/nsim/arc_v/rmx/Kconfig | 6 ------ 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/boards/snps/nsim/arc_v/rhx1xx.dtsi b/boards/snps/nsim/arc_v/rhx1xx.dtsi index d4889f191933..26318ddb483c 100644 --- a/boards/snps/nsim/arc_v/rhx1xx.dtsi +++ b/boards/snps/nsim/arc_v/rhx1xx.dtsi @@ -12,7 +12,9 @@ device_type = "cpu"; reg = <0>; clock-frequency = <5000000>; - riscv,isa = "rv32imac_zicsr_zifencei_zba_zbb_zbc_zbs"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei", + "zba", "zbb", "zbc", "zbs"; cpu0_intc: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/boards/snps/nsim/arc_v/rmx1xx.dtsi b/boards/snps/nsim/arc_v/rmx1xx.dtsi index 905065870850..2b8553143c97 100644 --- a/boards/snps/nsim/arc_v/rmx1xx.dtsi +++ b/boards/snps/nsim/arc_v/rmx1xx.dtsi @@ -12,7 +12,8 @@ device_type = "cpu"; reg = <0>; clock-frequency = <5000000>; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; cpu0_intc: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/snps/nsim/arc_v/rhx/Kconfig b/soc/snps/nsim/arc_v/rhx/Kconfig index 64e991bf7364..d6f9301947aa 100644 --- a/soc/snps/nsim/arc_v/rhx/Kconfig +++ b/soc/snps/nsim/arc_v/rhx/Kconfig @@ -4,16 +4,6 @@ config SOC_SERIES_RHX select RISCV select RISCV_PRIVILEGED - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - select RISCV_ISA_EXT_ZBA - select RISCV_ISA_EXT_ZBB - select RISCV_ISA_EXT_ZBC - select RISCV_ISA_EXT_ZBS select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select INCLUDE_RESET_VECTOR imply XIP diff --git a/soc/snps/nsim/arc_v/rmx/Kconfig b/soc/snps/nsim/arc_v/rmx/Kconfig index e80cfefa471f..6d3f0c97fbde 100644 --- a/soc/snps/nsim/arc_v/rmx/Kconfig +++ b/soc/snps/nsim/arc_v/rmx/Kconfig @@ -5,12 +5,6 @@ config SOC_SERIES_RMX bool select RISCV select RISCV_PRIVILEGED - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select INCLUDE_RESET_VECTOR imply XIP From 8a72806b1931c7ab105899984a846a6cb2a76029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 17:43:04 +0100 Subject: [PATCH 1804/3334] [nrf fromtree] sifive: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for sifive riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 783ebd98bcad3b598f031c49d754f9ceca87896f) --- dts/riscv/sifive/riscv32-fe310.dtsi | 3 ++- dts/riscv/sifive/riscv64-fu540.dtsi | 15 ++++++++++----- dts/riscv/sifive/riscv64-fu740.dtsi | 15 ++++++++++----- soc/sifive/sifive_freedom/fe300/Kconfig | 7 ------- soc/sifive/sifive_freedom/fu500/Kconfig | 8 -------- soc/sifive/sifive_freedom/fu700/Kconfig | 8 -------- 6 files changed, 22 insertions(+), 34 deletions(-) diff --git a/dts/riscv/sifive/riscv32-fe310.dtsi b/dts/riscv/sifive/riscv32-fe310.dtsi index 6ab404f08680..95f2d286fb13 100644 --- a/dts/riscv/sifive/riscv32-fe310.dtsi +++ b/dts/riscv/sifive/riscv32-fe310.dtsi @@ -33,7 +33,8 @@ compatible = "sifive,e31", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; status = "okay"; hlic: interrupt-controller { diff --git a/dts/riscv/sifive/riscv64-fu540.dtsi b/dts/riscv/sifive/riscv64-fu540.dtsi index ab01193344a2..c75a3a957189 100644 --- a/dts/riscv/sifive/riscv64-fu540.dtsi +++ b/dts/riscv/sifive/riscv64-fu540.dtsi @@ -37,7 +37,8 @@ device_type = "cpu"; i-cache-line-size = <0x4000>; reg = <0x0>; - riscv,isa = "rv64imac_zicsr_zifencei"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; hlic0: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -54,7 +55,8 @@ i-cache-line-size = <0x8000>; d-cache-line-size = <0x8000>; reg = <0x1>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic1: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -72,7 +74,8 @@ i-cache-line-size = <0x8000>; d-cache-line-size = <0x8000>; reg = <0x2>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic2: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -90,7 +93,8 @@ i-cache-line-size = <0x8000>; d-cache-line-size = <0x8000>; reg = <0x3>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic3: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -108,7 +112,8 @@ i-cache-line-size = <0x8000>; d-cache-line-size = <0x8000>; reg = <0x4>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic4: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/sifive/riscv64-fu740.dtsi b/dts/riscv/sifive/riscv64-fu740.dtsi index c4691ae79800..79d2760bf690 100644 --- a/dts/riscv/sifive/riscv64-fu740.dtsi +++ b/dts/riscv/sifive/riscv64-fu740.dtsi @@ -35,7 +35,8 @@ compatible = "sifive,s7", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv64imac_zicsr_zifencei"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; status = "okay"; hlic0: interrupt-controller { @@ -51,7 +52,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x1>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic1: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -66,7 +68,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x2>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic2: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -81,7 +84,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x3>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic3: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -96,7 +100,8 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x4>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic4: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/sifive/sifive_freedom/fe300/Kconfig b/soc/sifive/sifive_freedom/fe300/Kconfig index 027f96e8c3f7..bd49ac7524f7 100644 --- a/soc/sifive/sifive_freedom/fe300/Kconfig +++ b/soc/sifive/sifive_freedom/fe300/Kconfig @@ -11,13 +11,6 @@ config SOC_SERIES_SIFIVE_FREEDOM_FE300 select RISCV_HAS_PLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - select INCLUDE_RESET_VECTOR select SOC_EARLY_INIT_HOOK imply XIP diff --git a/soc/sifive/sifive_freedom/fu500/Kconfig b/soc/sifive/sifive_freedom/fu500/Kconfig index 10761abbf813..ceb034373835 100644 --- a/soc/sifive/sifive_freedom/fu500/Kconfig +++ b/soc/sifive/sifive_freedom/fu500/Kconfig @@ -12,17 +12,9 @@ config SOC_SERIES_SIFIVE_FREEDOM_FU500 select RISCV_PMP select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - select SOC_EARLY_INIT_HOOK select INCLUDE_RESET_VECTOR imply XIP config SOC_SIFIVE_FREEDOM_FU540_U54 bool - select RISCV_ISA_EXT_G diff --git a/soc/sifive/sifive_freedom/fu700/Kconfig b/soc/sifive/sifive_freedom/fu700/Kconfig index 9f981d2f1796..1bab9f933cd0 100644 --- a/soc/sifive/sifive_freedom/fu700/Kconfig +++ b/soc/sifive/sifive_freedom/fu700/Kconfig @@ -11,17 +11,9 @@ config SOC_SERIES_SIFIVE_FREEDOM_FU700 select RISCV_PMP select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - select SOC_EARLY_INIT_HOOK select INCLUDE_RESET_VECTOR imply XIP config SOC_SIFIVE_FREEDOM_FU740_U74 bool - select RISCV_ISA_EXT_G From 15e4f765b4fcd9908152464b8a1f76972c5584d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 18:19:31 +0100 Subject: [PATCH 1805/3334] [nrf fromtree] bflb: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for bflb riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 30ff2d3caeecd70c3041fb41eb08eff6469c8654) --- dts/riscv/bflb/bl60x.dtsi | 3 ++- dts/riscv/bflb/bl61x.dtsi | 3 ++- dts/riscv/bflb/bl70x.dtsi | 3 ++- soc/bflb/bl60x/Kconfig | 7 ------- soc/bflb/bl61x/Kconfig | 1 - soc/bflb/bl70x/Kconfig | 7 ------- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/dts/riscv/bflb/bl60x.dtsi b/dts/riscv/bflb/bl60x.dtsi index 625675bdf029..467e8bc450fd 100644 --- a/dts/riscv/bflb/bl60x.dtsi +++ b/dts/riscv/bflb/bl60x.dtsi @@ -72,7 +72,8 @@ device_type = "cpu"; compatible = "sifive,e24", "riscv"; reg = <0>; - riscv,isa = "rv32imafcb"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "c", "zicsr", "zifencei"; hardware-exec-breakpoint-count = <4>; status = "okay"; diff --git a/dts/riscv/bflb/bl61x.dtsi b/dts/riscv/bflb/bl61x.dtsi index 1de40dc2150c..ccb947ab5ce9 100644 --- a/dts/riscv/bflb/bl61x.dtsi +++ b/dts/riscv/bflb/bl61x.dtsi @@ -86,7 +86,8 @@ device_type = "cpu"; compatible = "xuantie,e907", "riscv"; reg = <0>; - riscv,isa = "rv32imafcp"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "c", "zicsr", "zifencei"; i-cache-line-size = <32>; d-cache-line-size = <32>; hardware-exec-breakpoint-count = <4>; diff --git a/dts/riscv/bflb/bl70x.dtsi b/dts/riscv/bflb/bl70x.dtsi index 92546b02a399..df5b250d4efa 100644 --- a/dts/riscv/bflb/bl70x.dtsi +++ b/dts/riscv/bflb/bl70x.dtsi @@ -71,7 +71,8 @@ device_type = "cpu"; compatible = "sifive,e24", "riscv"; reg = <0>; - riscv,isa = "rv32imafcb"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "c", "zicsr", "zifencei"; hardware-exec-breakpoint-count = <4>; status = "okay"; diff --git a/soc/bflb/bl60x/Kconfig b/soc/bflb/bl60x/Kconfig index debeb6cbee0e..e6c65c4120b4 100644 --- a/soc/bflb/bl60x/Kconfig +++ b/soc/bflb/bl60x/Kconfig @@ -18,13 +18,6 @@ config SOC_SERIES_BL60X select RISCV_HAS_CLIC select RISCV_MACHINE_TIMER select RISCV_PRIVILEGED - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_VECTORED_MODE select SOC_EARLY_INIT_HOOK select SOC_PREP_HOOK diff --git a/soc/bflb/bl61x/Kconfig b/soc/bflb/bl61x/Kconfig index 4fc4dbd4bdca..7cb76798dab6 100644 --- a/soc/bflb/bl61x/Kconfig +++ b/soc/bflb/bl61x/Kconfig @@ -10,7 +10,6 @@ config SOC_SERIES_BL61X select FPU select ICACHE select RISCV - select RISCV_ISA_EXT_F select SOC_EARLY_INIT_HOOK select SYSCON select XIP diff --git a/soc/bflb/bl70x/Kconfig b/soc/bflb/bl70x/Kconfig index c681f08766ef..23e234d99346 100644 --- a/soc/bflb/bl70x/Kconfig +++ b/soc/bflb/bl70x/Kconfig @@ -17,13 +17,6 @@ config SOC_SERIES_BL70X select RISCV_HAS_CLIC select RISCV_MACHINE_TIMER select RISCV_PRIVILEGED - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_VECTORED_MODE select SOC_EARLY_INIT_HOOK select SOC_PREP_HOOK From 9ec1d620127cd0e17d88aa1ffc63e1a9a308acbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 19 Jan 2026 18:20:46 +0100 Subject: [PATCH 1806/3334] [nrf fromtree] sensry: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for sensry riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 1c72c78d5f2c567e8a56cf1767607064b94b4b85) --- dts/riscv/sensry/ganymed-sy1xx.dtsi | 3 ++- soc/sensry/ganymed/sy1xx/Kconfig | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dts/riscv/sensry/ganymed-sy1xx.dtsi b/dts/riscv/sensry/ganymed-sy1xx.dtsi index 996edd062353..d50f6b030ebe 100644 --- a/dts/riscv/sensry/ganymed-sy1xx.dtsi +++ b/dts/riscv/sensry/ganymed-sy1xx.dtsi @@ -20,7 +20,8 @@ cpu0: cpu@0 { compatible = "sensry,sy1xx", "riscv"; reg = <0>; - riscv,isa = "rv32imc_zicsr"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "c", "zicsr"; status = "okay"; }; }; diff --git a/soc/sensry/ganymed/sy1xx/Kconfig b/soc/sensry/ganymed/sy1xx/Kconfig index 548c200ac53d..0eec265e9d2d 100644 --- a/soc/sensry/ganymed/sy1xx/Kconfig +++ b/soc/sensry/ganymed/sy1xx/Kconfig @@ -3,8 +3,4 @@ config SOC_SERIES_SY1XX select RISCV - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR select RISCV_PRIVILEGED From 2b617a3301bdf4cead5a887b0be4bd074f539087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:01:35 +0100 Subject: [PATCH 1807/3334] [nrf fromtree] raspberrypi: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for raspberrypi riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 9b570e90f2b4d3e58c6083ffec6b99f71a5ae921) --- dts/riscv/raspberrypi/hazard3.dtsi | 6 ++++-- soc/raspberrypi/rpi_pico/rp2350/Kconfig | 16 ---------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/dts/riscv/raspberrypi/hazard3.dtsi b/dts/riscv/raspberrypi/hazard3.dtsi index 31f960013454..dcd3bfea2ba0 100644 --- a/dts/riscv/raspberrypi/hazard3.dtsi +++ b/dts/riscv/raspberrypi/hazard3.dtsi @@ -34,10 +34,12 @@ */ &cpu0 { compatible = "riscv"; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei", "zba", "zbs"; }; &cpu1 { compatible = "riscv"; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei", "zba", "zbs"; }; diff --git a/soc/raspberrypi/rpi_pico/rp2350/Kconfig b/soc/raspberrypi/rpi_pico/rp2350/Kconfig index 389f8275e9da..1f5876fcb563 100644 --- a/soc/raspberrypi/rpi_pico/rp2350/Kconfig +++ b/soc/raspberrypi/rpi_pico/rp2350/Kconfig @@ -14,14 +14,6 @@ config SOC_RP2350A_HAZARD3 select HAS_FLASH_LOAD_OFFSET select INCLUDE_RESET_VECTOR select RISCV - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZBA - select RISCV_ISA_EXT_ZBS - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI config SOC_RP2350A_M33 select ARM @@ -39,14 +31,6 @@ config SOC_RP2350B_HAZARD3 select HAS_FLASH_LOAD_OFFSET select INCLUDE_RESET_VECTOR select RISCV - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZBA - select RISCV_ISA_EXT_ZBS - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI config SOC_RP2350B_M33 select ARM From fc2a125d5dc154cfad921c5ce9ee88e2270837b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:02:33 +0100 Subject: [PATCH 1808/3334] [nrf fromtree] openisa: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 6733437c95c29fe18e69861565f0782e446112ac) --- dts/riscv/openisa/rv32m1.dtsi | 6 ++++-- soc/openisa/rv32m1/Kconfig | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dts/riscv/openisa/rv32m1.dtsi b/dts/riscv/openisa/rv32m1.dtsi index 1b730dafec6d..14154754dfb5 100644 --- a/dts/riscv/openisa/rv32m1.dtsi +++ b/dts/riscv/openisa/rv32m1.dtsi @@ -24,14 +24,16 @@ cpu@0 { device_type = "cpu"; compatible = "openisa,ri5cy", "riscv"; - riscv,isa = "rv32imc_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "c", "zicsr", "zifencei"; reg = <0>; }; cpu@1 { device_type = "cpu"; compatible = "openisa,zero-ri5cy", "riscv"; - riscv,isa = "rv32imc_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "c", "zicsr", "zifencei"; reg = <1>; }; }; diff --git a/soc/openisa/rv32m1/Kconfig b/soc/openisa/rv32m1/Kconfig index fcaa650192ed..1f4d08083cd3 100644 --- a/soc/openisa/rv32m1/Kconfig +++ b/soc/openisa/rv32m1/Kconfig @@ -14,9 +14,4 @@ config SOC_OPENISA_RV32M1 select HAS_RV32M1_FTFX select HAS_FLASH_LOAD_OFFSET select BUILD_OUTPUT_HEX - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select SOC_EARLY_INIT_HOOK From 8ff93f5e40a628f39ec963f713e9e248aa808785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:14:02 +0100 Subject: [PATCH 1809/3334] [nrf fromtree] openhwgroup: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. also combines both SOC_CV64A6 variants Signed-off-by: Fin Maaß (cherry picked from commit bbb216584e21e48d4d750c4de8a668daf6044581) --- .../cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 | 2 +- boards/openhwgroup/cv64a6_genesys_2/board.yml | 2 +- .../cv64a6_genesys_2/doc/index.rst | 2 +- dts/riscv/openhwgroup/cv32a6.dtsi | 3 ++- dts/riscv/openhwgroup/cv64a6.dtsi | 3 ++- soc/openhwgroup/cva6/cv32a6/Kconfig | 5 ----- soc/openhwgroup/cva6/cv64a6/Kconfig | 20 ------------------- soc/openhwgroup/cva6/cv64a6/Kconfig.soc | 14 +++---------- soc/openhwgroup/cva6/soc.yml | 3 +-- 9 files changed, 11 insertions(+), 43 deletions(-) diff --git a/boards/openhwgroup/cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 b/boards/openhwgroup/cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 index 1a983093e994..fd698942dcca 100644 --- a/boards/openhwgroup/cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 +++ b/boards/openhwgroup/cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 @@ -1,4 +1,4 @@ # Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH # SPDX-License-Identifier: Apache-2.0 config BOARD_CV64A6_GENESYS_2 - select SOC_CV64A6_IMAFDC + select SOC_CV64A6 diff --git a/boards/openhwgroup/cv64a6_genesys_2/board.yml b/boards/openhwgroup/cv64a6_genesys_2/board.yml index e08ea7e79280..70b0a877748f 100644 --- a/boards/openhwgroup/cv64a6_genesys_2/board.yml +++ b/boards/openhwgroup/cv64a6_genesys_2/board.yml @@ -5,4 +5,4 @@ board: full_name: Digilent CV64A6 on Genesys 2 vendor: openhwgroup socs: - - name: cv64a6_imafdc + - name: cv64a6 diff --git a/boards/openhwgroup/cv64a6_genesys_2/doc/index.rst b/boards/openhwgroup/cv64a6_genesys_2/doc/index.rst index 090332078de7..48acc5f18ac2 100644 --- a/boards/openhwgroup/cv64a6_genesys_2/doc/index.rst +++ b/boards/openhwgroup/cv64a6_genesys_2/doc/index.rst @@ -44,7 +44,7 @@ Loading the FPGA configuration You need to build a bitstream with Xilinx Vivado and load it into the FPGA before you can load zephyr onto the board. Please refer to the CVA6 documentation for the required steps. -This configuration is compatible with the following build target: cv64a6_imafdc_sv39 +This configuration is compatible with the following build target: cv64a6_sv39 Flashing ======== diff --git a/dts/riscv/openhwgroup/cv32a6.dtsi b/dts/riscv/openhwgroup/cv32a6.dtsi index e71571bee118..78860733d2a9 100644 --- a/dts/riscv/openhwgroup/cv32a6.dtsi +++ b/dts/riscv/openhwgroup/cv32a6.dtsi @@ -22,7 +22,8 @@ timebase-frequency = ; device_type = "cpu"; compatible = "openhwgroup,cva6", "riscv"; - riscv,isa = "rv32ima"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "zicsr", "zifencei"; /* overwrite in board configuration if sv32 MMU is enabled */ mmu-type = "riscv,none"; reg = <0>; diff --git a/dts/riscv/openhwgroup/cv64a6.dtsi b/dts/riscv/openhwgroup/cv64a6.dtsi index ca3b47523cec..bc0e431f1bc8 100644 --- a/dts/riscv/openhwgroup/cv64a6.dtsi +++ b/dts/riscv/openhwgroup/cv64a6.dtsi @@ -22,7 +22,8 @@ timebase-frequency = ; device_type = "cpu"; compatible = "openhwgroup,cva6", "riscv"; - riscv,isa = "rv64imafdc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; mmu-type = "riscv,sv39"; reg = <0>; diff --git a/soc/openhwgroup/cva6/cv32a6/Kconfig b/soc/openhwgroup/cva6/cv32a6/Kconfig index b4f184121a56..f4fd6cc0fbcb 100644 --- a/soc/openhwgroup/cva6/cv32a6/Kconfig +++ b/soc/openhwgroup/cva6/cv32a6/Kconfig @@ -9,10 +9,5 @@ config SOC_CV32A6 select USE_SWITCH_SUPPORTED select USE_SWITCH select SCHED_IPI_SUPPORTED - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select CPU_HAS_DCACHE select CPU_HAS_ICACHE diff --git a/soc/openhwgroup/cva6/cv64a6/Kconfig b/soc/openhwgroup/cva6/cv64a6/Kconfig index 94b1ef049a74..c5e321a3d1e7 100644 --- a/soc/openhwgroup/cva6/cv64a6/Kconfig +++ b/soc/openhwgroup/cva6/cv64a6/Kconfig @@ -4,31 +4,11 @@ # Shared properties config SOC_CV64A6 - bool select RISCV select RISCV_PRIVILEGED select RISCV_HAS_PLIC select USE_SWITCH_SUPPORTED select USE_SWITCH select SCHED_IPI_SUPPORTED - select 64BIT - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select CPU_HAS_DCACHE select CPU_HAS_ICACHE - -# Variant with FPU -config SOC_CV64A6_IMAFDC - select SOC_CV64A6 - select CPU_HAS_FPU - select CPU_HAS_FPU_DOUBLE_PRECISION - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_D - -# Variant without FPU -config SOC_CV64A6_IMAC - select SOC_CV64A6 diff --git a/soc/openhwgroup/cva6/cv64a6/Kconfig.soc b/soc/openhwgroup/cva6/cv64a6/Kconfig.soc index c3be28de8346..3719ddf5f149 100644 --- a/soc/openhwgroup/cva6/cv64a6/Kconfig.soc +++ b/soc/openhwgroup/cva6/cv64a6/Kconfig.soc @@ -10,23 +10,15 @@ config SOC_SERIES_CV64A6 as well as the forked project with support for the Xilinx AXI Ethernet Subsystem (https://github.com/cispa/CVA6-Vivado-Project-with-Xilinx-AXI-Ethernet). -config SOC_CV64A6_IMAFDC +config SOC_CV64A6 bool select SOC_SERIES_CV64A6 help Standard CVA6 core in 64-bit configuration: SV39 MMU and SoC with CLINT, PLIC, UART, - SPI, and Ethernet (Xilinx or lowRISC). Supports imafdc instruction sets. - -config SOC_CV64A6_IMAC - bool - select SOC_SERIES_CV64A6 - help - Minimal CVA6 core in 64-bit configuration: SV39 MMU and SoC with CLINT, PLIC, UART, - SPI, and Ethernet (Xilinx or lowRISC). Supports imac instruction sets. + SPI, and Ethernet (Xilinx or lowRISC). config SOC_SERIES default "cv64a6" if SOC_SERIES_CV64A6 config SOC - default "cv64a6_imac" if SOC_CV64A6_IMAC - default "cv64a6_imafdc" if SOC_CV64A6_IMAFDC + default "cv64a6" if SOC_CV64A6 diff --git a/soc/openhwgroup/cva6/soc.yml b/soc/openhwgroup/cva6/soc.yml index bd250f81d4b4..3ce510e7b5fc 100644 --- a/soc/openhwgroup/cva6/soc.yml +++ b/soc/openhwgroup/cva6/soc.yml @@ -5,8 +5,7 @@ family: series: - name: cv64a6 socs: - - name: cv64a6_imafdc - - name: cv64a6_imac + - name: cv64a6 - name: cv32a6 socs: - name: cv32a6 From 0505becd20e3abff51d7504fb03cae0a456e6938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:18:11 +0100 Subject: [PATCH 1810/3334] [nrf fromtree] neorv32: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit e9333dbe2408f43d32ab49f38ab3ec7137afb8a2) --- boards/others/neorv32/Kconfig | 17 ----------------- boards/others/neorv32/doc/index.rst | 4 ++-- .../neorv32/neorv32_neorv32_minimalboot.dts | 3 ++- .../others/neorv32/neorv32_neorv32_up5kdemo.dts | 3 ++- soc/neorv32/Kconfig | 2 -- 5 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 boards/others/neorv32/Kconfig diff --git a/boards/others/neorv32/Kconfig b/boards/others/neorv32/Kconfig deleted file mode 100644 index 816f2ae1543c..000000000000 --- a/boards/others/neorv32/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021,2025 Henrik Brix Andersen -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NEORV32_NEORV32_MINIMALBOOT - -config BOARD_NEORV32 - select RISCV_ISA_RV32I - -endif # BOARD_NEORV32_NEORV32_MINIMALBOOT - -if BOARD_NEORV32_NEORV32_UP5KDEMO - -config BOARD_NEORV32 - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - -endif # BOARD_NEORV32_NEORV32_UP5KDEMO diff --git a/boards/others/neorv32/doc/index.rst b/boards/others/neorv32/doc/index.rst index 62e78d1ef592..731fc5521529 100644 --- a/boards/others/neorv32/doc/index.rst +++ b/boards/others/neorv32/doc/index.rst @@ -53,8 +53,8 @@ enabled: - Zicsr (Control and Status Register (CSR) Instructions, always enabled) - Zifencei (Instruction-fetch fence, always enabled) -Other supported RISC-V ISA extensions must be enabled via Kconfig on the board level, and the -``riscv,isa`` devicetree property of the ``cpu0`` node must be set accordingly. +Other supported RISC-V ISA extensions can be enabled by changing the ``riscv,isa-extensions`` +devicetree property of the ``cpu0`` node accordingly. Core Local Interruptor ====================== diff --git a/boards/others/neorv32/neorv32_neorv32_minimalboot.dts b/boards/others/neorv32/neorv32_neorv32_minimalboot.dts index 690a5b16c465..3f445a12f5bb 100644 --- a/boards/others/neorv32/neorv32_neorv32_minimalboot.dts +++ b/boards/others/neorv32/neorv32_neorv32_minimalboot.dts @@ -109,7 +109,8 @@ }; &cpu0 { - riscv,isa = "rv32i_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "zicsr", "zifencei"; }; &bootrom { diff --git a/boards/others/neorv32/neorv32_neorv32_up5kdemo.dts b/boards/others/neorv32/neorv32_neorv32_up5kdemo.dts index 96f0546bcfae..a40a12715b0a 100644 --- a/boards/others/neorv32/neorv32_neorv32_up5kdemo.dts +++ b/boards/others/neorv32/neorv32_neorv32_up5kdemo.dts @@ -109,7 +109,8 @@ }; &cpu0 { - riscv,isa = "rv32im_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "zicsr", "zifencei"; }; &bootrom { diff --git a/soc/neorv32/Kconfig b/soc/neorv32/Kconfig index c643c942f40c..d92af16eef64 100644 --- a/soc/neorv32/Kconfig +++ b/soc/neorv32/Kconfig @@ -5,8 +5,6 @@ config SOC_NEORV32 select RISCV select RISCV_PRIVILEGED select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI imply XIP if SOC_NEORV32 From 61cae1b7ac13ab521f4e18b2afc3b3bfb141b72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:26:30 +0100 Subject: [PATCH 1811/3334] [nrf fromtree] microchip: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 1773d0538d7d9121411bebdf59fc98927a9e33b6) --- dts/riscv/microchip/microchip-miv.dtsi | 3 ++- dts/riscv/microchip/mpfs.dtsi | 15 ++++++++++----- dts/riscv/microchip/pic64gx.dtsi | 15 ++++++++++----- soc/microchip/miv/miv/Kconfig | 5 ----- soc/microchip/miv/polarfire/Kconfig | 16 ---------------- soc/microchip/pic64/pic64gx/Kconfig | 18 ------------------ 6 files changed, 22 insertions(+), 50 deletions(-) diff --git a/dts/riscv/microchip/microchip-miv.dtsi b/dts/riscv/microchip/microchip-miv.dtsi index 0314ec5f95b0..1a5413903b05 100644 --- a/dts/riscv/microchip/microchip-miv.dtsi +++ b/dts/riscv/microchip/microchip-miv.dtsi @@ -17,7 +17,8 @@ compatible = "microchip,miv", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv32ima_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "zicsr", "zifencei"; hlic: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/microchip/mpfs.dtsi b/dts/riscv/microchip/mpfs.dtsi index 6bdcff412469..98a1f24fbdba 100644 --- a/dts/riscv/microchip/mpfs.dtsi +++ b/dts/riscv/microchip/mpfs.dtsi @@ -21,7 +21,8 @@ compatible = "sifive,e51", "riscv"; device_type = "cpu"; reg = <0x0>; - riscv,isa = "rv64imac_zicsr_zifencei"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; hlic0: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -36,7 +37,8 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x1>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic1: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -51,7 +53,8 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x2>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic2: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -66,7 +69,8 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x3>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic3: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -81,7 +85,8 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x4>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic4: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/microchip/pic64gx.dtsi b/dts/riscv/microchip/pic64gx.dtsi index 7bb3ab39ec80..48f46c461da7 100644 --- a/dts/riscv/microchip/pic64gx.dtsi +++ b/dts/riscv/microchip/pic64gx.dtsi @@ -20,7 +20,8 @@ compatible = "sifive,e51", "riscv"; device_type = "cpu"; reg = <0x0>; - riscv,isa = "rv64imac_zicsr_zifencei"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; hlic0: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -35,7 +36,8 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x1>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic1: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -50,7 +52,8 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x2>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic2: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -65,7 +68,8 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x3>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic3: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -80,7 +84,8 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x4>; - riscv,isa = "rv64gc"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; hlic4: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/microchip/miv/miv/Kconfig b/soc/microchip/miv/miv/Kconfig index 9db954b0de3f..ea0194ed2500 100644 --- a/soc/microchip/miv/miv/Kconfig +++ b/soc/microchip/miv/miv/Kconfig @@ -12,8 +12,3 @@ config SOC_SERIES_MIV config SOC_MIV select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI diff --git a/soc/microchip/miv/polarfire/Kconfig b/soc/microchip/miv/polarfire/Kconfig index 3eb8a33499bb..6dc4a878bd3f 100644 --- a/soc/microchip/miv/polarfire/Kconfig +++ b/soc/microchip/miv/polarfire/Kconfig @@ -11,27 +11,11 @@ config SOC_SERIES_POLARFIRE imply XIP config SOC_POLARFIRE - select 64BIT select SCHED_IPI_SUPPORTED select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select USE_SWITCH_SUPPORTED select USE_SWITCH -config SOC_POLARFIRE_U54 - select CPU_HAS_FPU - select CPU_HAS_FPU_DOUBLE_PRECISION - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_G - select RISCV_ISA_EXT_C - -config SOC_POLARFIRE_E51 - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - config MPFS_HAL depends on SOC_POLARFIRE bool "Microchip Polarfire SOC hardware abstracton layer" diff --git a/soc/microchip/pic64/pic64gx/Kconfig b/soc/microchip/pic64/pic64gx/Kconfig index b8cc439b9367..9ada84dd06cb 100644 --- a/soc/microchip/pic64/pic64gx/Kconfig +++ b/soc/microchip/pic64/pic64gx/Kconfig @@ -13,27 +13,9 @@ config SOC_SERIES_PIC64GX config SOC_PIC64GX1000 bool - select 64BIT select SCHED_IPI_SUPPORTED select ATOMIC_OPERATIONS_BUILTIN select INCLUDE_RESET_VECTOR select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select USE_SWITCH_SUPPORTED select USE_SWITCH - -config SOC_PIC64GX1000_U54 - bool - select CPU_HAS_FPU - select CPU_HAS_FPU_DOUBLE_PRECISION - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_G - select RISCV_ISA_EXT_C - -config SOC_PIC64GX1000_E51 - bool - select RISCV_ISA_RV64I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI From 77486da49f2ccdcbba25cfc12f8062bea742ef4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:29:18 +0100 Subject: [PATCH 1812/3334] [nrf fromtree] lowriscv: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 74e5e8fc137572311e37b0c552496d3ba49a3516) --- dts/riscv/lowrisc/opentitan_earlgrey.dtsi | 4 +++- soc/lowrisc/opentitan/Kconfig | 9 --------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/dts/riscv/lowrisc/opentitan_earlgrey.dtsi b/dts/riscv/lowrisc/opentitan_earlgrey.dtsi index 014101b61264..d0bab22a2ade 100644 --- a/dts/riscv/lowrisc/opentitan_earlgrey.dtsi +++ b/dts/riscv/lowrisc/opentitan_earlgrey.dtsi @@ -18,7 +18,9 @@ reg = <0x00>; status = "okay"; compatible = "lowrisc,ibex", "riscv"; - riscv,isa = "rv32imcb_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "c", "zicsr", "zifencei", + "zba", "zbb", "zbc", "zbs"; hlic: interrupt-controller { #interrupt-cells = <0x01>; diff --git a/soc/lowrisc/opentitan/Kconfig b/soc/lowrisc/opentitan/Kconfig index c76751f6e967..37e498636545 100644 --- a/soc/lowrisc/opentitan/Kconfig +++ b/soc/lowrisc/opentitan/Kconfig @@ -4,15 +4,6 @@ config SOC_OPENTITAN select ATOMIC_OPERATIONS_C select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - select RISCV_ISA_EXT_ZBA - select RISCV_ISA_EXT_ZBB - select RISCV_ISA_EXT_ZBC - select RISCV_ISA_EXT_ZBS select RISCV select RISCV_PRIVILEGED select RISCV_HAS_PLIC From 9d775679389cf97f18d3baea7e851c6865e5eff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:39:33 +0100 Subject: [PATCH 1813/3334] [nrf fromtree] ite: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 5b0a8470988904e150cacf703958a453a5b7e516) --- dts/riscv/ite/it51526aw.dtsi | 3 ++- dts/riscv/ite/it51xxx.dtsi | 4 +++- dts/riscv/ite/it8xxx2.dtsi | 3 ++- soc/ite/ec/it51xxx/Kconfig | 9 --------- soc/ite/ec/it8xxx2/Kconfig | 5 ----- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/dts/riscv/ite/it51526aw.dtsi b/dts/riscv/ite/it51526aw.dtsi index b03cfc22e1b1..a8e730c5b554 100644 --- a/dts/riscv/ite/it51526aw.dtsi +++ b/dts/riscv/ite/it51526aw.dtsi @@ -8,7 +8,8 @@ cpus { cpu0: cpu@0 { compatible = "ite,riscv-ite", "riscv"; - riscv,isa = "rv32imb_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "zba", "zbb", "zbs", "zicsr", "zifencei"; device_type = "cpu"; reg = <0>; clock-frequency = <32768>; diff --git a/dts/riscv/ite/it51xxx.dtsi b/dts/riscv/ite/it51xxx.dtsi index 80045de34acb..267ab05530c9 100644 --- a/dts/riscv/ite/it51xxx.dtsi +++ b/dts/riscv/ite/it51xxx.dtsi @@ -30,7 +30,9 @@ cpu0: cpu@0 { compatible = "ite,riscv-ite", "riscv"; - riscv,isa = "rv32imcb_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "c", "zba", "zbb", "zbs", "zicsr", + "zifencei"; device_type = "cpu"; reg = <0>; clock-frequency = <32768>; diff --git a/dts/riscv/ite/it8xxx2.dtsi b/dts/riscv/ite/it8xxx2.dtsi index 1ba4acf39a27..b127530acc50 100644 --- a/dts/riscv/ite/it8xxx2.dtsi +++ b/dts/riscv/ite/it8xxx2.dtsi @@ -30,7 +30,8 @@ cpu0: cpu@0 { compatible = "ite,riscv-ite", "riscv"; - riscv,isa = "rv32imafc_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "a", "c", "zicsr", "zifencei"; device_type = "cpu"; reg = <0>; cpu-power-states = <&standby>; diff --git a/soc/ite/ec/it51xxx/Kconfig b/soc/ite/ec/it51xxx/Kconfig index 83096116742a..7a0a8a58d1be 100644 --- a/soc/ite/ec/it51xxx/Kconfig +++ b/soc/ite/ec/it51xxx/Kconfig @@ -11,15 +11,6 @@ if SOC_SERIES_IT51XXX config SOC_IT51XXX select RISCV - select ATOMIC_OPERATIONS_C - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C if !SOC_IT51526AW - select RISCV_ISA_EXT_ZBA - select RISCV_ISA_EXT_ZBB - select RISCV_ISA_EXT_ZBS select FLASH imply XIP diff --git a/soc/ite/ec/it8xxx2/Kconfig b/soc/ite/ec/it8xxx2/Kconfig index 12b3aeabd591..13a07447d600 100644 --- a/soc/ite/ec/it8xxx2/Kconfig +++ b/soc/ite/ec/it8xxx2/Kconfig @@ -13,14 +13,9 @@ if SOC_SERIES_IT8XXX2 config SOC_IT8XXX2 select RISCV - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI # Workaround mul instruction bug, see: # https://www.ite.com.tw/uploads/product_download/it81202-bx-chip-errata.pdf select RISCV_ISA_EXT_M if !(SOC_IT81302BX || SOC_IT81202BX) - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C imply XIP config SOC_IT8XXX2_REG_SET_V1 From 7c392b611a93af71f13436adb97748bbc2493732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:42:32 +0100 Subject: [PATCH 1814/3334] [nrf fromtree] intel: niosv: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit fb1aeeb34625844d056abd50a277c9586fde9b52) --- dts/riscv/niosv/niosv-g.dtsi | 3 ++- dts/riscv/niosv/niosv-m.dtsi | 3 ++- soc/intel/intel_niosv/niosv/Kconfig | 5 ----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dts/riscv/niosv/niosv-g.dtsi b/dts/riscv/niosv/niosv-g.dtsi index 1770fe4e3d12..17db4a808ad7 100644 --- a/dts/riscv/niosv/niosv-g.dtsi +++ b/dts/riscv/niosv/niosv-g.dtsi @@ -19,7 +19,8 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "intel,niosv", "riscv"; - riscv,isa = "rv32ima_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "zicsr", "zifencei"; reg = <0>; clock-frequency = <50000000>; diff --git a/dts/riscv/niosv/niosv-m.dtsi b/dts/riscv/niosv/niosv-m.dtsi index eedf425cf0ee..dd683ff2370c 100644 --- a/dts/riscv/niosv/niosv-m.dtsi +++ b/dts/riscv/niosv/niosv-m.dtsi @@ -19,7 +19,8 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "intel,niosv", "riscv"; - riscv,isa = "rv32ia_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "a", "zicsr", "zifencei"; reg = <0>; clock-frequency = <50000000>; diff --git a/soc/intel/intel_niosv/niosv/Kconfig b/soc/intel/intel_niosv/niosv/Kconfig index 28e38894a0f6..46f0140ed73b 100644 --- a/soc/intel/intel_niosv/niosv/Kconfig +++ b/soc/intel/intel_niosv/niosv/Kconfig @@ -6,10 +6,6 @@ config SOC_SERIES_NIOSV select RISCV select RISCV_PRIVILEGED select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING imply XIP @@ -18,6 +14,5 @@ config SOC_NIOSV_M Intel FPGA NIOSV Microcontroller Core Processor config SOC_NIOSV_G - select RISCV_ISA_EXT_M help Intel FPGA NIOSV General Purpose Processor From bdf6a35cd15a46ddd656a2fa021e5cf14c88853e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:43:46 +0100 Subject: [PATCH 1815/3334] [nrf fromtree] gd: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 8f69f660599cad605ece63484ec08adfd6d17af8) --- dts/riscv/gd/gd32vf103.dtsi | 3 ++- soc/gd/gd32/gd32vf103/Kconfig | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dts/riscv/gd/gd32vf103.dtsi b/dts/riscv/gd/gd32vf103.dtsi index 714a2020011d..43e69b60a209 100644 --- a/dts/riscv/gd/gd32vf103.dtsi +++ b/dts/riscv/gd/gd32vf103.dtsi @@ -24,7 +24,8 @@ cpu: cpu@0 { clock-frequency = ; compatible = "nuclei,bumblebee", "riscv"; - riscv,isa = "rv32imac_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; reg = <0>; }; }; diff --git a/soc/gd/gd32/gd32vf103/Kconfig b/soc/gd/gd32/gd32vf103/Kconfig index b9e0aaa45348..e53353c2df47 100644 --- a/soc/gd/gd32/gd32vf103/Kconfig +++ b/soc/gd/gd32/gd32vf103/Kconfig @@ -6,12 +6,6 @@ config SOC_SERIES_GD32VF103 select RISCV select RISCV_PRIVILEGED - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_CLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select RISCV_SOC_CONTEXT_SAVE From 539920ca8b83e08d9b3942804e1f50eff2c72eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:44:34 +0100 Subject: [PATCH 1816/3334] [nrf fromtree] egis: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 01bc8b23510206290e13caa07efb86e8d2a40f6e) --- dts/riscv/egis/egis_et171.dtsi | 3 ++- soc/egis/et171/Kconfig | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/dts/riscv/egis/egis_et171.dtsi b/dts/riscv/egis/egis_et171.dtsi index d83e3c900cde..7c0b09f98b7c 100644 --- a/dts/riscv/egis/egis_et171.dtsi +++ b/dts/riscv/egis/egis_et171.dtsi @@ -20,7 +20,8 @@ compatible = "andestech,andescore-v5", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv32imafc_zicsr_zifencei"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "c", "zicsr", "zifencei"; mmu-type = "riscv,sv32"; i-cache-line-size = <32>; d-cache-line-size = <32>; diff --git a/soc/egis/et171/Kconfig b/soc/egis/et171/Kconfig index 15b1dbb3498d..b51685fa3c78 100644 --- a/soc/egis/et171/Kconfig +++ b/soc/egis/et171/Kconfig @@ -7,13 +7,6 @@ config SOC_EGIS_ET171 select RISCV_PRIVILEGED select RISCV_HAS_PLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select CPU_HAS_DCACHE select CPU_HAS_ICACHE select CPU_HAS_ANDES_EXECIT From 73e9e0706293146c4455edfbfd8a98d1b66eac2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:49:49 +0100 Subject: [PATCH 1817/3334] [nrf fromtree] andestech: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit ed6a9698490d245d62713e9ff3d37083e40ac11d) --- dts/riscv/andes/andes_v5_ae350.dtsi | 32 ++++++++++++++++------ soc/andestech/ae350/Kconfig | 41 ----------------------------- 2 files changed, 24 insertions(+), 49 deletions(-) diff --git a/dts/riscv/andes/andes_v5_ae350.dtsi b/dts/riscv/andes/andes_v5_ae350.dtsi index 6f0ccdb37ae7..23dd62c22e6b 100644 --- a/dts/riscv/andes/andes_v5_ae350.dtsi +++ b/dts/riscv/andes/andes_v5_ae350.dtsi @@ -21,7 +21,9 @@ device_type = "cpu"; reg = <0>; status = "okay"; - riscv,isa = "rv32gc_xandes"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", + "xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -40,7 +42,9 @@ device_type = "cpu"; reg = <1>; status = "okay"; - riscv,isa = "rv32gc_xandes"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", + "xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -59,7 +63,9 @@ device_type = "cpu"; reg = <2>; status = "okay"; - riscv,isa = "rv32gc_xandes"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", + "xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -78,7 +84,9 @@ device_type = "cpu"; reg = <3>; status = "okay"; - riscv,isa = "rv32gc_xandes"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", + "xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -97,7 +105,9 @@ device_type = "cpu"; reg = <4>; status = "okay"; - riscv,isa = "rv32gc_xandes"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", + "xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -116,7 +126,9 @@ device_type = "cpu"; reg = <5>; status = "okay"; - riscv,isa = "rv32gc_xandes"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", + "xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -135,7 +147,9 @@ device_type = "cpu"; reg = <6>; status = "okay"; - riscv,isa = "rv32gc_xandes"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", + "xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -154,7 +168,9 @@ device_type = "cpu"; reg = <7>; status = "okay"; - riscv,isa = "rv32gc_xandes"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", + "xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; diff --git a/soc/andestech/ae350/Kconfig b/soc/andestech/ae350/Kconfig index 109e6a2f8541..b29504c79c55 100644 --- a/soc/andestech/ae350/Kconfig +++ b/soc/andestech/ae350/Kconfig @@ -6,11 +6,6 @@ config SOC_SERIES_AE350 select RISCV_PRIVILEGED select RISCV_PMP select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select CPU_HAS_DCACHE select CPU_HAS_ICACHE select CPU_HAS_ANDES_EXECIT @@ -43,42 +38,6 @@ config SOC_AE350_INTERRUPT_TYPE_CLIC endchoice -choice - prompt "Base CPU ISA options" - default RV32I_CPU - -config RV32I_CPU - bool "RISCV32 CPU ISA" - select RISCV_ISA_RV32I - -config RV32E_CPU - bool "RISCV32E CPU ISA" - select RISCV_ISA_RV32E - -config RV64I_CPU - bool "RISCV64 CPU ISA" - select RISCV_ISA_RV64I - -endchoice - -choice - prompt "FPU options" - default NO_FPU - -config NO_FPU - bool "No FPU" - -config SINGLE_PRECISION_FPU - bool "Single precision FPU" - select RISCV_ISA_EXT_F - -config DOUBLE_PRECISION_FPU - bool "Double precision FPU" - select RISCV_ISA_EXT_F - select RISCV_ISA_EXT_D - -endchoice - config SOC_ANDES_V5_HWDSP bool select DEPRECATED From ec27ec81abe97388ee98e3bc23444be02c35e674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:50:32 +0100 Subject: [PATCH 1818/3334] [nrf fromtree] aesc: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 869845d6ab918fd4e743016412cccbd4ac7e322b) --- dts/riscv/aesc/nitrogen.dtsi | 3 ++- soc/aesc/nitrogen/Kconfig | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dts/riscv/aesc/nitrogen.dtsi b/dts/riscv/aesc/nitrogen.dtsi index b1e3def00bbd..bdaed267cefa 100644 --- a/dts/riscv/aesc/nitrogen.dtsi +++ b/dts/riscv/aesc/nitrogen.dtsi @@ -20,7 +20,8 @@ compatible = "litex,vexriscv-standard", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa = "rv32imc"; + riscv,isa-base = "rv32i"; + riscv,isa-extensions = "i", "m", "c", "zicsr", "zifencei"; status = "okay"; hlic: interrupt-controller { diff --git a/soc/aesc/nitrogen/Kconfig b/soc/aesc/nitrogen/Kconfig index 050a364a3d2c..f19a32bbb2c8 100644 --- a/soc/aesc/nitrogen/Kconfig +++ b/soc/aesc/nitrogen/Kconfig @@ -5,11 +5,6 @@ config SOC_SERIES_NITROGEN select RISCV select RISCV_PRIVILEGED select INCLUDE_RESET_VECTOR - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI config SOC_PART_NUMBER default "elemrv_n" if SOC_ELEMRV_N From 316e00b77caba181224e66503655276d3c0f1893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 09:53:43 +0100 Subject: [PATCH 1819/3334] [nrf fromtree] thead: riscv: use riscv,isa-extensions dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use riscv,isa-extensions dt prop for riscv cpus. Signed-off-by: Fin Maaß (cherry picked from commit 2cea7b05829d8c16cf8bf15d3ab6ea4bd69d14fb) --- arch/riscv/custom/thead/Kconfig.core | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/riscv/custom/thead/Kconfig.core b/arch/riscv/custom/thead/Kconfig.core index 3550e91957fa..453325574767 100644 --- a/arch/riscv/custom/thead/Kconfig.core +++ b/arch/riscv/custom/thead/Kconfig.core @@ -8,12 +8,6 @@ config CPU_XUANTIE_E907 select RISCV_HAS_CLIC select RISCV_MACHINE_TIMER select RISCV_PRIVILEGED - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select RISCV_ISA_EXT_ZIFENCEI select RISCV_VECTORED_MODE select CPU_HAS_ICACHE select CPU_HAS_DCACHE From 3a5685f65fadd230eb4ac311fdf6f0e2bf42a4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 3 Nov 2025 13:04:07 +0100 Subject: [PATCH 1820/3334] [nrf fromtree] riscv: deprecate riscv,isa dt prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit deprecate riscv,isa dt prop Signed-off-by: Fin Maaß (cherry picked from commit 204029f12c8408d8e43e309ee603350dd71f1085) --- dts/bindings/cpu/riscv,cpus.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index 0ff385142e1f..2cf259461cdc 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -20,6 +20,7 @@ properties: riscv,isa: description: RISC-V instruction set architecture type: string + deprecated: true riscv,isa-base: description: The base ISA implemented by the hart. From 1703bcbb163aa053b7ef3be5aa49113fdbec19c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 20 Jan 2026 10:39:45 +0100 Subject: [PATCH 1821/3334] [nrf fromtree] docs: migration-guide: mention riscv changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mention riscv changes. Signed-off-by: Fin Maaß (cherry picked from commit 06027c74fd838d218b67b0a954710854f3ce25c6) --- doc/releases/migration-guide-4.4.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 0bb6fabcd067..d60ed5ae7db4 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -805,3 +805,21 @@ Architectures * :kconfig:option:`CONFIG_RISCV` now requires, that the :dtcompatible:`riscv` is present in the devicetree. + +* The ``riscv,isa-base`` and ``riscv,isa-extensions`` devicetree properties of + :dtcompatible:`riscv` are now used to set the Base Integer Instruction Set and the RISC-V + extensions. They are no longer set by the SoC. The devicetree property ``riscv,isa`` has been + deprecated in favor of the two new properties. (:github:`97540`) + + * ``CONFIG_SOC_CV64A6_IMAFDC`` and ``CONFIG_SOC_CV64A6_IMAC`` are now combined into + :kconfig:option:`CONFIG_SOC_CV64A6`, as the RISC-V extensions are now set by the devicetree. + + * The following options of :kconfig:option:`CONFIG_SOC_SERIES_AE350` had been removed, as they + now can be set via the devicetree: + + * ``CONFIG_RV32I_CPU`` + * ``CONFIG_RV32E_CPU`` + * ``CONFIG_RV64I_CPU`` + * ``CONFIG_NO_FPU`` + * ``CONFIG_SINGLE_PRECISION_FPU`` + * ``CONFIG_DOUBLE_PRECISION_FPU`` From c04e0b5db1d8235a0fa317d289242898194c5cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Wed, 21 Jan 2026 11:09:14 +0100 Subject: [PATCH 1822/3334] [nrf fromtree] riscv: require `riscv,isa-base` and `riscv,isa-extensions` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit require `riscv,isa-base` and `riscv,isa-extensions` dt props to be set. Signed-off-by: Fin Maaß (cherry picked from commit 8cc8239efa9bc97667a3de200344efd49211f328) --- dts/bindings/cpu/riscv,cpus.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index 2cf259461cdc..0e422044ff38 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -25,6 +25,7 @@ properties: riscv,isa-base: description: The base ISA implemented by the hart. type: string + required: true enum: - rv32i - rv32e @@ -39,3 +40,4 @@ properties: for a list of possible extensions. Not all options listed there are necessarily supported by Zephyr. type: string-array + required: true From 09c3bbd35c15e3eae2c5fc8d53b91649759f7801 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Mon, 26 Jan 2026 16:40:57 +0100 Subject: [PATCH 1823/3334] [nrf fromtree] dts: nordic: Move BT controller enable For othre Nordic targets we are chosing and enabling the controller for the dts/arm/nordic DTS files. But this was not how it was added for the nrf54lm20. Let's move these to the same place, for consistency, and so that it is also enabled in the same way for the simulated nrf54lm20bsim (whose board file includes these same dtsi files) Signed-off-by: Alberto Escolar Piedras (cherry picked from commit 3549e80a4e1d3f5660a04a78b0e59a5074de00a0) --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 ----- boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts | 4 ---- dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 5 +++++ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index f0946efb543f..6ab124d0fb84 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -18,7 +18,6 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; - zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; @@ -98,10 +97,6 @@ status = "okay"; }; -&bt_hci_controller { - status = "okay"; -}; - &ieee802154 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index a5d1600de247..ef47e866e4c4 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -19,9 +19,5 @@ }; }; -&bt_hci_controller { - status = "okay"; -}; - /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index d74a33745c01..3c97f8ead421 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -22,6 +22,7 @@ nvic: &cpuapp_nvic {}; / { chosen { + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; }; @@ -42,6 +43,10 @@ nvic: &cpuapp_nvic {}; }; }; +&bt_hci_controller { + status = "okay"; +}; + &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; From e732d146402474eb85338b9527c34da9cb181155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 2 Feb 2026 12:39:24 +0100 Subject: [PATCH 1824/3334] Revert "[nrf fromlist] manifest: update hal_nordic to have nrfx_nfct RXERROR fix" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e7c87bd46d6c0f9798acff02b19697eb4a501cd4. Signed-off-by: Michał Stasiak --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 542595d3a1c7..6ed480e2cffb 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: d7dc801ab175e286205fd6229b0c05ec7886e2ac + revision: daad38f2e9f6c641849010d74fe02ea736d4d921 path: modules/hal/nordic groups: - hal From f23d100fc379851ef65ff70a9d109ff1fd604c70 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Tue, 3 Feb 2026 14:45:34 +0100 Subject: [PATCH 1825/3334] [nrf fromtree] dts: vendor: nordic: fix nrf54lm20a/*[/ns] sram size reg attribute is supposed to hold start address and size instead of start address and end address. This caused a crash in malloc_prepare(). Signed-off-by: Damian Krolik (cherry picked from commit b3078970bb0d6d61cb7217161e9e67a98e99d8cc) --- dts/vendor/nordic/nrf54lm20a.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index b872dff0f559..9522ed31c364 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -110,10 +110,10 @@ /* FLPR/VPR is not used with TF-M so NS can use its memory */ cpuapp_sram: memory@20000000 { compatible = "mmio-sram"; - reg = <0x20000000 0x2007fe40>; + reg = <0x20000000 0x7fe40>; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20000000 0x2007fe40>; + ranges = <0x0 0x20000000 0x7fe40>; }; #else cpuapp_sram: memory@20000000 { From dc8e9b2c71f739a17d16794b419f3d4af99589d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 9 Feb 2026 11:00:58 +0100 Subject: [PATCH 1826/3334] [nrf fromtree] dts: vendor: nordic: Add missing hfpll clock source to peripherals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing clock property to spi00 nodes. Add missing clock property to uart00 node in nrf7120. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 5dd648074b5e16117220ae5672128f81b9bef171) --- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 1 + dts/vendor/nordic/nrf54lm20a.dtsi | 1 + dts/vendor/nordic/nrf7120_enga.dtsi | 2 ++ 3 files changed, 4 insertions(+) diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 0919b1347d77..4f119f4358ac 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -145,6 +145,7 @@ #size-cells = <0>; reg = <0x4a000 0x1000>; interrupts = <74 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; max-frequency = ; easydma-maxcnt-bits = <16>; rx-delay-supported; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 9522ed31c364..454bc446de0a 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -196,6 +196,7 @@ #size-cells = <0>; reg = <0x4d000 0x1000>; interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; max-frequency = ; easydma-maxcnt-bits = <16>; rx-delay-supported; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index 48a2b268317e..d5ba811d2d3e 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -240,6 +240,7 @@ compatible = "nordic,nrf-spim"; reg = <0x4d000 0x1000>; interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; #address-cells = <1>; #size-cells = <0>; max-frequency = ; @@ -253,6 +254,7 @@ compatible = "nordic,nrf-uarte"; reg = <0x4d000 0x1000>; interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; status = "disabled"; endtx-stoptx-supported; frame-timeout-supported; From 30eead2435786b44acafbfdef5e8113f2790dc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 26 Jan 2026 10:32:55 +0100 Subject: [PATCH 1827/3334] [nrf fromtree] manifest: update hal_nordic revision to integrate nrfx 4.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated hal_nordic manifest and trusted-firmware-m manifest with alignment. Signed-off-by: Michał Stasiak (cherry picked from commit 145e0d75e37a6a6827ad06886e168d4618c94c54) --- ..._cpuapp.dtsi => nrf54lm20_a_b_cpuapp.dtsi} | 4 +- dts/arm/nordic/nrf54lm20a_cpuapp.dtsi | 8 + ...puflpr.dtsi => nrf54lm20_a_b_cpuflpr.dtsi} | 2 +- dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi | 8 + dts/vendor/nordic/nrf54lm20_a_b.dtsi | 929 ++++++++++++++++++ .../nrf54lm20_a_b_cpuapp_ns_partition.dtsi | 91 ++ .../nrf54lm20_a_b_cpuapp_partition.dtsi | 37 + dts/vendor/nordic/nrf54lm20a.dtsi | 924 +---------------- .../nrf54lm20a_cpuapp_ns_partition.dtsi | 85 +- .../nordic/nrf54lm20a_cpuapp_partition.dtsi | 32 +- west.yml | 4 +- 11 files changed, 1081 insertions(+), 1043 deletions(-) rename dts/arm/nordic/{nrf54lm20a_enga_cpuapp.dtsi => nrf54lm20_a_b_cpuapp.dtsi} (96%) create mode 100644 dts/arm/nordic/nrf54lm20a_cpuapp.dtsi rename dts/riscv/nordic/{nrf54lm20a_enga_cpuflpr.dtsi => nrf54lm20_a_b_cpuflpr.dtsi} (97%) create mode 100644 dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi create mode 100644 dts/vendor/nordic/nrf54lm20_a_b.dtsi create mode 100644 dts/vendor/nordic/nrf54lm20_a_b_cpuapp_ns_partition.dtsi create mode 100644 dts/vendor/nordic/nrf54lm20_a_b_cpuapp_partition.dtsi diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi similarity index 96% rename from dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi rename to dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi index 3c97f8ead421..484ff2afcfd5 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi @@ -1,10 +1,10 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ -#include +#include cpu: &cpuapp {}; diff --git a/dts/arm/nordic/nrf54lm20a_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_cpuapp.dtsi new file mode 100644 index 000000000000..27be8f894b03 --- /dev/null +++ b/dts/arm/nordic/nrf54lm20a_cpuapp.dtsi @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "nrf54lm20_a_b_cpuapp.dtsi" diff --git a/dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi b/dts/riscv/nordic/nrf54lm20_a_b_cpuflpr.dtsi similarity index 97% rename from dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi rename to dts/riscv/nordic/nrf54lm20_a_b_cpuflpr.dtsi index 83908c4ad242..06db95384172 100644 --- a/dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi +++ b/dts/riscv/nordic/nrf54lm20_a_b_cpuflpr.dtsi @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include cpu: &cpuflpr {}; diff --git a/dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi b/dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi new file mode 100644 index 000000000000..b51a8e69b7f9 --- /dev/null +++ b/dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "nrf54lm20_a_b_cpuflpr.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20_a_b.dtsi b/dts/vendor/nordic/nrf54lm20_a_b.dtsi new file mode 100644 index 000000000000..454bc446de0a --- /dev/null +++ b/dts/vendor/nordic/nrf54lm20_a_b.dtsi @@ -0,0 +1,929 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr", "riscv"; + reg = <1>; + device_type = "cpu"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "c", "zicsr"; + nordic,bus-width = <32>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + pclk32m: pclk32m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + aclk: aclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + +#ifdef USE_NON_SECURE_ADDRESS_MAP + /* intentionally empty because UICR is hardware fixed to Secure */ +#else + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; +#endif + +#ifdef USE_NON_SECURE_ADDRESS_MAP + /* FLPR/VPR is not used with TF-M so NS can use its memory */ + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 0x7fe40>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 0x7fe40>; + }; +#else + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(511)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 DT_SIZE_K(511)>; + }; + + cpuflpr_sram: memory@20067c00 { + compatible = "mmio-sram"; + reg = <0x20067c00 DT_SIZE_K(96)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; + }; +#endif + +#ifdef USE_NON_SECURE_ADDRESS_MAP + global_peripherals: peripheral@40000000 { + reg = <0x40000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x40000000 0x10000000>; +#else + global_peripherals: peripheral@50000000 { + reg = <0x50000000 0x10000000>; + ranges = <0x0 0x50000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; +#endif + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x143c>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + spi00: spi@4d000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart00: uart@4d000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + usbhs: usbhs@5a000 { + compatible = "nordic,nrf-usbhs-nrf54l", "snps,dwc2"; + reg = <0x5a000 0x1000>, <0x20000 0x1a000>; + reg-names = "wrapper", "core"; + interrupts = <90 NRF_DEFAULT_IRQ_PRIORITY>; + num-in-eps = <16>; + num-out-eps = <16>; + ghwcfg1 = <0x0>; + ghwcfg2 = <0x22affc52>; + ghwcfg4 = <0x3e10aa60>; + status = "disabled"; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + ble-cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + pdm20: pdm@d0000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd0000 0x1000>; + interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pdm21: pdm@d1000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd1000 0x1000>; + interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pwm20: pwm@d2000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd2000 0x1000>; + interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + }; + + pwm21: pwm@d3000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd3000 0x1000>; + interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + }; + + pwm22: pwm@d4000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd4000 0x1000>; + interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <32>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpio3: gpio@d8600 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8600 0x300>; + #gpio-cells = <2>; + ngpios = <13>; + status = "disabled"; + port = <3>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + tdm: tdm@e8000 { + compatible = "nordic,nrf-tdm"; + easydma-maxcnt-bits = <15>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xe8000 0x1000>; + interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + clocks = <&pclk32m>; + }; + + i2c23: i2c@ed000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi23: spi@ed000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart23: uart@ed000 { + compatible = "nordic,nrf-uarte"; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c24: i2c@ee000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi24: spi@ee000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart24: uart@ee000 { + compatible = "nordic,nrf-uarte"; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + +#ifdef USE_NON_SECURE_ADDRESS_MAP + /* intentionally empty because WDT30 is hardware fixed to Secure */ +#else + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; +#endif + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <10>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@500 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x500 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@504 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x504 0x1>; + status = "disabled"; + }; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; + #address-cells = <1>; + #size-cells = <1>; + +#ifdef USE_NON_SECURE_ADDRESS_MAP + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(2036)>; + ranges = <0x0 0x0 DT_SIZE_K(2036)>; + erase-block-size = <4096>; + write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; + }; +#else + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1940)>; + ranges = <0x0 0x0 DT_SIZE_K(1940)>; + erase-block-size = <4096>; + write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; + }; + + cpuflpr_rram: rram@1e5000 { + compatible = "soc-nv-flash"; + reg = <0x1e5000 DT_SIZE_K(96)>; + ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; + erase-block-size = <4096>; + write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; + }; +#endif + }; + + nrf_mpc: memory@50041000 { + compatible = "nordic,nrf-mpc"; + reg = <0x50041000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + override-num = <5>; + override-granularity = <4096>; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_ns_partition.dtsi new file mode 100644 index 000000000000..ea354b033632 --- /dev/null +++ b/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_ns_partition.dtsi @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Default SRAM planning when building for nRF54LM20A and nRF54LM20B with ARM TrustZone-M support + * - Lowest 256 kB SRAM allocated to Secure image (sram0_s). + * - Upper 252 kB SRAM allocated to Non-Secure image (sram0_ns). + * + * nRF54LM20A and nRF54LM20B have 512 kB of volatile memory (SRAM), + * but only 511 kB is available to use. + * Since TF-m requires 4kB page alignment we can only use a total of 508 kB. + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ +&cpuapp_sram { + sram0_s: image_s@0 { + #address-cells = <1>; + #size-cells = <1>; + /* Secure image memory */ + reg = <0x0 DT_SIZE_K(256)>; + ranges = <0x0 0x0 DT_SIZE_K(256)>; + }; + + sram0_ns: image_ns@40000 { + #address-cells = <1>; + #size-cells = <1>; + /* Non-Secure image memory */ + reg = <0x40000 DT_SIZE_K(252)>; + ranges = <0x0 0x40000 DT_SIZE_K(252)>; + }; +}; + +&cpuapp_rram { + /* + * Default NVM layout on nRF54LM20A and nRF54LM20B Application MCUs without BL2: + * This layout matches (by necessity) that in the TF-M repository: + * + * 0x0000_0000 Secure image primary (512 KB) + * 0x0008_0000 Protected Storage Area (16 KB) + * 0x0008_4000 Internal Trusted Storage Area (16 KB) + * 0x0008_8000 OTP / NV counters area (8 KB) + * 0x0008_A000 Non-secure image primary (1452 KB) + * 0x001F_5000 Non-secure storage, used when built with NRF_NS_STORAGE=ON, + * otherwise unused (32 KB) + */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54LM20A and nRF54LM20B have 2036 kB of non-volatile memory (RRAM) + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8a000 { + label = "image-0-nonsecure"; + reg = <0x0008a000 DT_SIZE_K(1452)>; + }; + + storage_partition: partition@1f5000 { + label = "storage"; + reg = <0x001f5000 DT_SIZE_K(32)>; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_partition.dtsi new file mode 100644 index 000000000000..cf1a263f32a5 --- /dev/null +++ b/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_partition.dtsi @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54LM20A and nRF54LM20B have 2036 kB of non-volatile memory (RRAM) but the last + * 96 kB are reserved for the FLPR MCU, so we have ~1940 kB available. + */ + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(920)>; + }; + + slot1_partition: partition@f6000 { + label = "image-1"; + reg = <0xf6000 DT_SIZE_K(920)>; + }; + + storage_partition: partition@1dc000 { + label = "storage"; + reg = <0x1dc000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 454bc446de0a..3404287f1bb0 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -4,926 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include -#include -#include -#include - -/delete-node/ &sw_pwm; - -/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ -#define NRF_DOMAIN_ID_APPLICATION 0 -#define NRF_DOMAIN_ID_FLPR 1 - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@0 { - compatible = "arm,cortex-m33f"; - reg = <0>; - device_type = "cpu"; - clocks = <&hfpll>; - #address-cells = <1>; - #size-cells = <1>; - - itm: itm@e0000000 { - compatible = "arm,armv8m-itm"; - reg = <0xe0000000 0x1000>; - swo-ref-frequency = ; - }; - }; - - cpuflpr: cpu@1 { - compatible = "nordic,vpr", "riscv"; - reg = <1>; - device_type = "cpu"; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "c", "zicsr"; - nordic,bus-width = <32>; - }; - }; - - clocks { - pclk: pclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - pclk32m: pclk32m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfxo: lfxo { - compatible = "nordic,nrf54l-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf54l-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1650>; - }; - - hfpll: hfpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - aclk: aclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - ficr: ficr@ffc000 { - compatible = "nordic,nrf-ficr"; - reg = <0xffc000 0x1000>; - #nordic,ficr-cells = <1>; - }; - -#ifdef USE_NON_SECURE_ADDRESS_MAP - /* intentionally empty because UICR is hardware fixed to Secure */ -#else - uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; - reg = <0xffd000 0x1000>; - }; -#endif - -#ifdef USE_NON_SECURE_ADDRESS_MAP - /* FLPR/VPR is not used with TF-M so NS can use its memory */ - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 0x7fe40>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 0x7fe40>; - }; -#else - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(511)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 DT_SIZE_K(511)>; - }; - - cpuflpr_sram: memory@20067c00 { - compatible = "mmio-sram"; - reg = <0x20067c00 DT_SIZE_K(96)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; - }; -#endif - -#ifdef USE_NON_SECURE_ADDRESS_MAP - global_peripherals: peripheral@40000000 { - reg = <0x40000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x40000000 0x10000000>; -#else - global_peripherals: peripheral@50000000 { - reg = <0x50000000 0x10000000>; - ranges = <0x0 0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; -#endif - - dppic00: dppic@42000 { - compatible = "nordic,nrf-dppic"; - reg = <0x42000 0x808>; - status = "disabled"; - }; - - ppib00: ppib@44000 { - compatible = "nordic,nrf-ppib"; - reg = <0x44000 0x1000>; - status = "disabled"; - }; - - ppib01: ppib@45000 { - compatible = "nordic,nrf-ppib"; - reg = <0x45000 0x1000>; - status = "disabled"; - }; - - cpuflpr_vpr: vpr@4c000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x4c000 0x1000>; - ranges = <0x0 0x4c000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - status = "disabled"; - enable-secure; - - cpuflpr_clic: interrupt-controller@f0000000 { - compatible = "nordic,nrf-clic"; - reg = <0xf0000000 0x143c>; - interrupt-controller; - #interrupt-cells = <2>; - #address-cells = <1>; - status = "disabled"; - }; - }; - - spi00: spi@4d000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart00: uart@4d000 { - compatible = "nordic,nrf-uarte"; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - gpio2: gpio@50400 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x50400 0x300>; - #gpio-cells = <2>; - ngpios = <11>; - status = "disabled"; - port = <2>; - }; - - timer00: timer@55000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x55000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - prescaler = <0>; - }; - - usbhs: usbhs@5a000 { - compatible = "nordic,nrf-usbhs-nrf54l", "snps,dwc2"; - reg = <0x5a000 0x1000>, <0x20000 0x1a000>; - reg-names = "wrapper", "core"; - interrupts = <90 NRF_DEFAULT_IRQ_PRIORITY>; - num-in-eps = <16>; - num-out-eps = <16>; - ghwcfg1 = <0x0>; - ghwcfg2 = <0x22affc52>; - ghwcfg4 = <0x3e10aa60>; - status = "disabled"; - }; - - dppic10: dppic@82000 { - compatible = "nordic,nrf-dppic"; - reg = <0x82000 0x808>; - status = "disabled"; - }; - - ppib10: ppib@83000 { - compatible = "nordic,nrf-ppib"; - reg = <0x83000 0x1000>; - status = "disabled"; - }; - - ppib11: ppib@84000 { - compatible = "nordic,nrf-ppib"; - reg = <0x84000 0x1000>; - status = "disabled"; - }; - - timer10: timer@85000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x85000 0x1000>; - cc-num = <8>; - max-bit-width = <32>; - interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - prescaler = <0>; - }; - - egu10: egu@87000 { - compatible = "nordic,nrf-egu"; - reg = <0x87000 0x1000>; - interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - radio: radio@8a000 { - compatible = "nordic,nrf-radio"; - reg = <0x8a000 0x1000>; - interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - dfe-supported; - ieee802154-supported; - ble-2mbps-supported; - ble-coded-phy-supported; - ble-cs-supported; - - ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; - }; - - dppic20: dppic@c2000 { - compatible = "nordic,nrf-dppic"; - reg = <0xc2000 0x808>; - status = "disabled"; - }; - - ppib20: ppib@c3000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc3000 0x1000>; - status = "disabled"; - }; - - ppib21: ppib@c4000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc4000 0x1000>; - status = "disabled"; - }; - - ppib22: ppib@c5000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc5000 0x1000>; - status = "disabled"; - }; - - i2c20: i2c@c6000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi20: spi@c6000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart20: uart@c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c21: i2c@c7000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi21: spi@c7000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart21: uart@c7000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c22: i2c@c8000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi22: spi@c8000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart22: uart@c8000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - egu20: egu@c9000 { - compatible = "nordic,nrf-egu"; - reg = <0xc9000 0x1000>; - interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - timer20: timer@ca000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xca000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer21: timer@cb000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcb000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer22: timer@cc000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcc000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer23: timer@cd000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcd000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer24: timer@ce000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xce000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - pdm20: pdm@d0000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd0000 0x1000>; - interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pdm21: pdm@d1000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd1000 0x1000>; - interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pwm20: pwm@d2000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd2000 0x1000>; - interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - pwm21: pwm@d3000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd3000 0x1000>; - interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - pwm22: pwm@d4000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd4000 0x1000>; - interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - adc: adc@d5000 { - compatible = "nordic,nrf-saadc"; - reg = <0xd5000 0x1000>; - interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - zephyr,pm-device-runtime-auto; - }; - - nfct: nfct@d6000 { - compatible = "nordic,nrf-nfct"; - reg = <0xd6000 0x1000>; - interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - temp: temp@d7000 { - compatible = "nordic,nrf-temp"; - reg = <0xd7000 0x1000>; - interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio1: gpio@d8200 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8200 0x300>; - #gpio-cells = <2>; - ngpios = <32>; - status = "disabled"; - port = <1>; - gpiote-instance = <&gpiote20>; - }; - - gpio3: gpio@d8600 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8600 0x300>; - #gpio-cells = <2>; - ngpios = <13>; - status = "disabled"; - port = <3>; - gpiote-instance = <&gpiote20>; - }; - - gpiote20: gpiote@da000 { - compatible = "nordic,nrf-gpiote"; - reg = <0xda000 0x1000>; - status = "disabled"; - instance = <20>; - }; - - qdec20: qdec@e0000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe0000 0x1000>; - interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - qdec21: qdec@e1000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe1000 0x1000>; - interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - grtc: grtc@e2000 { - compatible = "nordic,nrf-grtc"; - reg = <0xe2000 0x1000>; - cc-num = <12>; - clocks = <&lfxo>, <&pclk>; - clock-names = "lfclock", "hfclock"; - status = "disabled"; - }; - - tdm: tdm@e8000 { - compatible = "nordic,nrf-tdm"; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xe8000 0x1000>; - interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - clocks = <&pclk32m>; - }; - - i2c23: i2c@ed000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi23: spi@ed000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart23: uart@ed000 { - compatible = "nordic,nrf-uarte"; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c24: i2c@ee000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi24: spi@ee000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart24: uart@ee000 { - compatible = "nordic,nrf-uarte"; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - dppic30: dppic@102000 { - compatible = "nordic,nrf-dppic"; - reg = <0x102000 0x808>; - status = "disabled"; - }; - - ppib30: ppib@103000 { - compatible = "nordic,nrf-ppib"; - reg = <0x103000 0x1000>; - status = "disabled"; - }; - - i2c30: i2c@104000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi30: spi@104000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart30: uart@104000 { - compatible = "nordic,nrf-uarte"; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - comp: comparator@106000 { - /* - * Use compatible "nordic,nrf-comp" to configure as COMP - * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP - */ - compatible = "nordic,nrf-comp"; - reg = <0x106000 0x1000>; - status = "disabled"; - interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; - }; - -#ifdef USE_NON_SECURE_ADDRESS_MAP - /* intentionally empty because WDT30 is hardware fixed to Secure */ -#else - wdt30: watchdog@108000 { - compatible = "nordic,nrf-wdt"; - reg = <0x108000 0x620>; - interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; -#endif - - wdt31: watchdog@109000 { - compatible = "nordic,nrf-wdt"; - reg = <0x109000 0x620>; - interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio0: gpio@10a000 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x10a000 0x300>; - #gpio-cells = <2>; - ngpios = <10>; - status = "disabled"; - port = <0>; - gpiote-instance = <&gpiote30>; - }; - - gpiote30: gpiote@10c000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x10c000 0x1000>; - status = "disabled"; - instance = <30>; - }; - - clock: clock@10e000 { - compatible = "nordic,nrf-clock"; - reg = <0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@500 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x500 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@504 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x504 0x1>; - status = "disabled"; - }; - }; - - regulators: regulator@120000 { - compatible = "nordic,nrf54l-regulators"; - reg = <0x120000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - vregmain: regulator@120600 { - compatible = "nordic,nrf5x-regulator"; - reg = <0x120600 0x1>; - status = "disabled"; - regulator-name = "VREGMAIN"; - regulator-initial-mode = ; - }; - }; - }; - - rram_controller: rram-controller@5004e000 { - compatible = "nordic,rram-controller"; - reg = <0x5004e000 0x1000>; - interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; - #address-cells = <1>; - #size-cells = <1>; - -#ifdef USE_NON_SECURE_ADDRESS_MAP - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(2036)>; - ranges = <0x0 0x0 DT_SIZE_K(2036)>; - erase-block-size = <4096>; - write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; - }; -#else - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(1940)>; - ranges = <0x0 0x0 DT_SIZE_K(1940)>; - erase-block-size = <4096>; - write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; - }; - - cpuflpr_rram: rram@1e5000 { - compatible = "soc-nv-flash"; - reg = <0x1e5000 DT_SIZE_K(96)>; - ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; - erase-block-size = <4096>; - write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; - }; -#endif - }; - - nrf_mpc: memory@50041000 { - compatible = "nordic,nrf-mpc"; - reg = <0x50041000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - override-num = <5>; - override-granularity = <4096>; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_nvic: interrupt-controller@e000e100 { - #address-cells = <1>; - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - }; - }; -}; +#include "nrf54lm20_a_b.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi index 5f5f974db565..2625fe11e566 100644 --- a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi @@ -4,87 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * Default SRAM planning when building for nRF54LM20A with ARM TrustZone-M support - * - Lowest 256 kB SRAM allocated to Secure image (sram0_s). - * - Upper 252 kB SRAM allocated to Non-Secure image (sram0_ns). - * - * nRF54LM20A has 512 kB of volatile memory (SRAM), but only 511 kB is available to use. - * Since TF-m requires 4kB page alignment we can only use a total of 508 kB. - * This static layout needs to be the same with the upstream TF-M layout in the - * header flash_layout.h of the relevant platform. Any updates in the layout - * needs to happen both in the flash_layout.h and in this file at the same time. - */ -&cpuapp_sram { - sram0_s: image_s@0 { - #address-cells = <1>; - #size-cells = <1>; - /* Secure image memory */ - reg = <0x0 DT_SIZE_K(256)>; - ranges = <0x0 0x0 DT_SIZE_K(256)>; - }; - - sram0_ns: image_ns@40000 { - #address-cells = <1>; - #size-cells = <1>; - /* Non-Secure image memory */ - reg = <0x40000 DT_SIZE_K(252)>; - ranges = <0x0 0x40000 DT_SIZE_K(252)>; - }; -}; - -&cpuapp_rram { - /* - * Default NVM layout on NRF54LM20A Application MCU without BL2: - * This layout matches (by necessity) that in the TF-M repository: - * - * 0x0000_0000 Secure image primary (512 KB) - * 0x0008_0000 Protected Storage Area (16 KB) - * 0x0008_4000 Internal Trusted Storage Area (16 KB) - * 0x0008_8000 OTP / NV counters area (8 KB) - * 0x0008_A000 Non-secure image primary (1452 KB) - * 0x001F_5000 Non-secure storage, used when built with NRF_NS_STORAGE=ON, - * otherwise unused (32 KB) - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - /* nRF54LM20A has 2036 kB of non-volatile memory (RRAM) - * - * This static layout needs to be the same with the upstream TF-M layout in the - * header flash_layout.h of the relevant platform. Any updates in the layout - * needs to happen both in the flash_layout.h and in this file at the same time. - */ - slot0_partition: partition@0 { - label = "image-0"; - reg = <0x0000000 DT_SIZE_K(512)>; - }; - - tfm_ps_partition: partition@80000 { - label = "tfm-ps"; - reg = <0x00080000 DT_SIZE_K(16)>; - }; - - tfm_its_partition: partition@84000 { - label = "tfm-its"; - reg = <0x00084000 DT_SIZE_K(16)>; - }; - - tfm_otp_partition: partition@88000 { - label = "tfm-otp"; - reg = <0x00088000 DT_SIZE_K(8)>; - }; - - slot0_ns_partition: partition@8a000 { - label = "image-0-nonsecure"; - reg = <0x0008a000 DT_SIZE_K(1452)>; - }; - - storage_partition: partition@1f5000 { - label = "storage"; - reg = <0x001f5000 DT_SIZE_K(32)>; - }; - }; -}; +#include "nrf54lm20_a_b_cpuapp_ns_partition.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20a_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_cpuapp_partition.dtsi index 1bc6991c434a..f25bbe927f0b 100644 --- a/dts/vendor/nordic/nrf54lm20a_cpuapp_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_cpuapp_partition.dtsi @@ -4,34 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - /* nRF54LM20A has 2036 kB of non-volatile memory (RRAM) but the last - * 96 kB are reserved for the FLPR MCU, so we have ~1940 kB available. - */ - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(920)>; - }; - - slot1_partition: partition@f6000 { - label = "image-1"; - reg = <0xf6000 DT_SIZE_K(920)>; - }; - - storage_partition: partition@1dc000 { - label = "storage"; - reg = <0x1dc000 DT_SIZE_K(36)>; - }; - }; -}; +#include "nrf54lm20_a_b_cpuapp_partition.dtsi" diff --git a/west.yml b/west.yml index 6ed480e2cffb..55772b9fc8a0 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: daad38f2e9f6c641849010d74fe02ea736d4d921 + revision: 63f2083ff9bc9c39b39f0a874becc7cf8e011a2a path: modules/hal/nordic groups: - hal @@ -386,7 +386,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 6788687e013733d12f015b5d45b214019dea58f7 + revision: 3a128df2bdebedf5a01726e86de3880991d6bb63 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From cc4f79909c69eb8c835a24cea2791390e7e7d791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 20 Nov 2025 15:53:16 +0100 Subject: [PATCH 1828/3334] [nrf fromtree] soc: nordic: add common files for nrf54lm20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now able to be used both by nRF54LM20A and nRF54LM20B. Also, removed Eng A naming. Signed-off-by: Michał Stasiak (cherry picked from commit 13c987058c39f3b0ff4231cd12b145c7fe23a983) --- soc/nordic/nrf54l/Kconfig | 4 ++-- ...pp => Kconfig.defconfig.nrf54lm20_a_b_cpuapp} | 6 +++--- ...r => Kconfig.defconfig.nrf54lm20_a_b_cpuflpr} | 6 +++--- soc/nordic/nrf54l/Kconfig.soc | 16 +++++----------- soc/nordic/nrf54l/Kconfig.sysbuild | 2 +- 5 files changed, 14 insertions(+), 20 deletions(-) rename soc/nordic/nrf54l/{Kconfig.defconfig.nrf54lm20a_enga_cpuapp => Kconfig.defconfig.nrf54lm20_a_b_cpuapp} (51%) rename soc/nordic/nrf54l/{Kconfig.defconfig.nrf54lm20a_enga_cpuflpr => Kconfig.defconfig.nrf54lm20_a_b_cpuflpr} (51%) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 3d940eaa0540..36d6c69b4a58 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -48,7 +48,7 @@ config SOC_NRF54L15_CPUAPP select CPU_HAS_FPU select HAS_SWO -config SOC_NRF54LM20A_ENGA_CPUAPP +config SOC_NRF54LM20A_CPUAPP select SOC_NRF54L_CPUAPP_COMMON select SOC_COMPATIBLE_NRF54LM20A select SOC_COMPATIBLE_NRF54LM20A_CPUAPP @@ -68,7 +68,7 @@ config SOC_NRF54L15_CPUFLPR select RISCV_CORE_NORDIC_VPR select SOC_COMPATIBLE_NRF54L15 -config SOC_NRF54LM20A_ENGA_CPUFLPR +config SOC_NRF54LM20A_CPUFLPR select RISCV_CORE_NORDIC_VPR if SOC_SERIES_NRF54L diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp similarity index 51% rename from soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp rename to soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp index a32729e5f40d..7e5336e2212a 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp @@ -1,12 +1,12 @@ -# Nordic Semiconductor nRF54LM20A MCU +# Nordic Semiconductor nRF54LM20A and nRF54LM20B MCUs # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54LM20A_ENGA_CPUAPP +if SOC_NRF54LM20A_CPUAPP config NUM_IRQS default 290 -endif # SOC_NRF54LM20A_ENGA_CPUAPP +endif # SOC_NRF54LM20A_CPUAPP diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr similarity index 51% rename from soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr rename to soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr index b8065044a5f5..4b84d1ed8bb9 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr @@ -1,11 +1,11 @@ -# Nordic Semiconductor nRF54LM20A MCU +# Nordic Semiconductor nRF54LM20A and nRF54LM20B MCUs # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54LM20A_ENGA_CPUFLPR +if SOC_NRF54LM20A_CPUFLPR config NUM_IRQS default 287 -endif # SOC_NRF54LM20A_ENGA_CPUFLPR +endif # SOC_NRF54LM20A_CPUFLPR diff --git a/soc/nordic/nrf54l/Kconfig.soc b/soc/nordic/nrf54l/Kconfig.soc index 3363948e6ebb..f550cd557a66 100644 --- a/soc/nordic/nrf54l/Kconfig.soc +++ b/soc/nordic/nrf54l/Kconfig.soc @@ -78,23 +78,17 @@ config SOC_NRF54LM20A help NRF54LM20A -config SOC_NRF54LM20A_ENGA +config SOC_NRF54LM20A_CPUAPP bool select SOC_NRF54LM20A help - NRF54LM20A ENGA + NRF54LM20A CPUAPP -config SOC_NRF54LM20A_ENGA_CPUAPP +config SOC_NRF54LM20A_CPUFLPR bool - select SOC_NRF54LM20A_ENGA - help - NRF54LM20A ENGA CPUAPP - -config SOC_NRF54LM20A_ENGA_CPUFLPR - bool - select SOC_NRF54LM20A_ENGA + select SOC_NRF54LM20A help - NRF54LM20A ENGA CPUFLPR + NRF54LM20A CPUFLPR config SOC default "nrf54l05" if SOC_NRF54L05 diff --git a/soc/nordic/nrf54l/Kconfig.sysbuild b/soc/nordic/nrf54l/Kconfig.sysbuild index 57173a8a5492..b2034be193dd 100644 --- a/soc/nordic/nrf54l/Kconfig.sysbuild +++ b/soc/nordic/nrf54l/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54L15_CPUFLPR || SOC_NRF54LM20A_ENGA_CPUFLPR +if SOC_NRF54L15_CPUFLPR || SOC_NRF54LM20A_CPUFLPR config HAS_NORDIC_VPR_LAUNCHER_IMAGE default y From 95bba3eab8d6b5a32e656e6fa07faa2300872efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 20 Nov 2025 15:30:20 +0100 Subject: [PATCH 1829/3334] [nrf fromtree] boards: nordic: add common files for nrf54lm20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now able to be used both by nRF54LM20A and nRF54LM20B. Also, removed Eng A naming and aligned board.yml to memory described in common DTS. Signed-off-by: Michał Stasiak (cherry picked from commit 702a6eaa0861c4b1ddcb4c6d9ed484737fdf24eb) --- .../nrf54lm20bsim_nrf54lm20a_cpuapp.dts | 4 +- boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk | 4 +- boards/nordic/nrf54lm20dk/board.cmake | 4 +- ....dtsi => nrf54lm20_a_b_cpuapp_common.dtsi} | 7 ++- .../nrf54lm20_a_b_cpuflpr_common.dtsi | 55 +++++++++++++++++++ ...0a-common.dtsi => nrf54lm20dk_common.dtsi} | 2 +- ...=> nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi} | 0 .../nrf54lm20dk_nrf54lm20a_cpuapp.dts | 6 +- .../nrf54lm20dk_nrf54lm20a_cpuapp.yaml | 4 +- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts | 3 +- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml | 4 +- .../nrf54lm20dk_nrf54lm20a_cpuflpr.dts | 52 +----------------- 12 files changed, 78 insertions(+), 67 deletions(-) rename boards/nordic/nrf54lm20dk/{nrf54lm20a_cpuapp_common.dtsi => nrf54lm20_a_b_cpuapp_common.dtsi} (92%) create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi rename boards/nordic/nrf54lm20dk/{nrf54lm20dk_nrf54lm20a-common.dtsi => nrf54lm20dk_common.dtsi} (97%) rename boards/nordic/nrf54lm20dk/{nrf54lm20dk_nrf54lm20a-pinctrl.dtsi => nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi} (100%) diff --git a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts b/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts index 03482e97e260..fcc334014ce9 100644 --- a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts @@ -7,8 +7,8 @@ /dts-v1/; #include -#include -#include <../boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi> +#include +#include <../boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi> / { model = "Nordic NRF54LM20 BSIM NRF54LM20A Application MCU"; diff --git a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk index b311fd9ae87e..8b704357e66a 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk +++ b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk @@ -2,5 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF54LM20DK - select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS - select SOC_NRF54LM20A_ENGA_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR + select SOC_NRF54LM20A_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS + select SOC_NRF54LM20A_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake index f805e0d74112..8e84753dc143 100644 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ b/boards/nordic/nrf54lm20dk/board.cmake @@ -1,9 +1,9 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP) +if(CONFIG_SOC_NRF54LM20A_CPUAPP) board_runner_args(jlink "--device=nRF54LM20A_M33" "--speed=4000") -elseif(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR) +elseif(CONFIG_SOC_NRF54LM20A_CPUFLPR) board_runner_args(jlink "--device=nRF54LM20A_RV32" "--speed=4000") endif() diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi similarity index 92% rename from boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi rename to boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi index 6ab124d0fb84..b097848fe3ee 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi @@ -6,8 +6,8 @@ /* This file is common to the secure and non-secure domain */ -#include -#include "nrf54lm20dk_nrf54lm20a-common.dtsi" +#include +#include "nrf54lm20dk_common.dtsi" / { chosen { @@ -129,3 +129,6 @@ zephyr_udc0: &usbhs { reset-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; }; }; + +/* Get a node label for wi-fi spi to use in shield files */ +wifi_spi: &spi22 {}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi new file mode 100644 index 000000000000..11068b98446c --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "nrf54lm20dk_common.dtsi" + +&cpuflpr_sram { + status = "okay"; +}; + +&cpuflpr_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + cpuflpr_code_partition: partition@0 { + label = "image-0"; + reg = <0x0 DT_SIZE_K(96)>; + }; + }; +}; + +&grtc { + owned-channels = <3 4>; + status = "okay"; +}; + +&uart30 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpiote30 { + status = "okay"; +}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi similarity index 97% rename from boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi rename to boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi index 525a3a5fdc0e..335e04deeebf 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20dk_nrf54lm20a-pinctrl.dtsi" +#include "nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi" / { leds { diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi similarity index 100% rename from boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi rename to boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index ef47e866e4c4..6c06a16f1576 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -6,7 +6,8 @@ /dts-v1/; -#include "nrf54lm20a_cpuapp_common.dtsi" +#include +#include "nrf54lm20_a_b_cpuapp_common.dtsi" #include / { @@ -18,6 +19,3 @@ zephyr,sram = &cpuapp_sram; }; }; - -/* Get a node label for wi-fi spi to use in shield files */ -wifi_spi: &spi22 {}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml index e5a2b89087de..36c37206b219 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml @@ -9,8 +9,8 @@ toolchain: - gnuarmemb - zephyr sysbuild: true -ram: 512 -flash: 449 +ram: 511 +flash: 920 supported: - adc - counter diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts index 78da8edbccd4..47ef49d2debb 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts @@ -8,7 +8,8 @@ #define USE_NON_SECURE_ADDRESS_MAP 1 -#include "nrf54lm20a_cpuapp_common.dtsi" +#include +#include "nrf54lm20_a_b_cpuapp_common.dtsi" / { compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp-ns"; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml index 3f10201892fb..2bd2c023ca71 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml @@ -5,8 +5,8 @@ arch: arm toolchain: - gnuarmemb - zephyr -ram: 208 -flash: 1356 +ram: 252 +flash: 1452 supported: - adc - counter diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts index 11d72c63dfe8..71c0fd0fe72e 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts @@ -5,8 +5,9 @@ */ /dts-v1/; -#include -#include "nrf54lm20dk_nrf54lm20a-common.dtsi" + +#include +#include "nrf54lm20_a_b_cpuflpr_common.dtsi" / { model = "Nordic nRF54LM20 DK nRF54LM20A FLPR MCU"; @@ -20,50 +21,3 @@ zephyr,sram = &cpuflpr_sram; }; }; - -&cpuflpr_sram { - status = "okay"; -}; - -&cpuflpr_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - 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"; -}; From 94938e8c3a4b75b2c26728b713c9ef462717fff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 13 Jan 2026 10:28:21 +0100 Subject: [PATCH 1830/3334] [nrf fromtree] modules: hal_nordic: remove Eng A naming for nRF54LM20A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renamed in MDK. Signed-off-by: Michał Stasiak (cherry picked from commit 04f8b6516c242a27fb51e6a985b8b109a38b13fe) --- modules/hal_nordic/nrfx/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index f2b5265ed2d0..889758af5dbe 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -68,10 +68,10 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L10_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_NRF54L15_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA NRF54LM20A_ENGA_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A NRF54LM20A_ENGA_XXAA) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A NRF54LM20A_XXAA) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP NRF_APPLICATION) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR NRF_FLPR) +zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A NRF54LM20A_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA NRF7120_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP NRF_APPLICATION) @@ -276,8 +276,8 @@ mdk_svd_ifdef(CONFIG_SOC_NRF54L10_CPUAPP nrf54l10_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54L10_CPUFLPR nrf54l10_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_NRF54LM20A_ENGA_CPUAPP nrf54lm20a_enga_application.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR nrf54lm20a_enga_flpr.svd) +mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP nrf54lm20a_application.svd) +mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR nrf54lm20a_flpr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP nrf7120_enga_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUFLPR nrf7120_enga_flpr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF9120 nrf9120.svd) From 711e2664a74308a732914d3aac13801cd46d5965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 13 Jan 2026 11:38:07 +0100 Subject: [PATCH 1831/3334] [nrf fromtree] modules: trusted-firmware-m: remove Eng A naming for nRF54LM20A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SoC symbol changed. Signed-off-by: Michał Stasiak (cherry picked from commit 1d71a8666eb9d1b5e0de7f8156773cdc9e806e2d) --- modules/trusted-firmware-m/Kconfig.tfm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index a62ef049d2d8..8440c823092f 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -34,7 +34,7 @@ config TFM_BOARD default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l15_cpuapp" if SOC_NRF54L15_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp" if SOC_NRF54LM20A_ENGA_CPUAPP + default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp" if SOC_NRF54LM20A_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf7120_cpuapp" if SOC_NRF7120_ENGA_CPUAPP help The board name used for building TFM. Building with TFM requires that From a035e48141e6b137892bc4813d38afa358969dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 12 Jan 2026 16:15:51 +0100 Subject: [PATCH 1832/3334] [nrf fromtree] dts: nordic: add nRF54LM20B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added dts for nRF54LM20B, using common nRF54LM20. Signed-off-by: Michał Stasiak (cherry picked from commit c89c73d316aadd84cb0511c08a01ceee7c94d37f) --- dts/arm/nordic/nrf54lm20b_cpuapp.dtsi | 8 ++++++++ dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi | 8 ++++++++ dts/vendor/nordic/nrf54lm20b.dtsi | 7 +++++++ dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi | 7 +++++++ dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi | 7 +++++++ 5 files changed, 37 insertions(+) create mode 100644 dts/arm/nordic/nrf54lm20b_cpuapp.dtsi create mode 100644 dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi create mode 100644 dts/vendor/nordic/nrf54lm20b.dtsi create mode 100644 dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi create mode 100644 dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi diff --git a/dts/arm/nordic/nrf54lm20b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20b_cpuapp.dtsi new file mode 100644 index 000000000000..7d66c30a4d35 --- /dev/null +++ b/dts/arm/nordic/nrf54lm20b_cpuapp.dtsi @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "nrf54lm20_a_b_cpuapp.dtsi" diff --git a/dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi b/dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi new file mode 100644 index 000000000000..a055194955a1 --- /dev/null +++ b/dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "nrf54lm20_a_b_cpuflpr.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20b.dtsi b/dts/vendor/nordic/nrf54lm20b.dtsi new file mode 100644 index 000000000000..7734f295c2f9 --- /dev/null +++ b/dts/vendor/nordic/nrf54lm20b.dtsi @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20_a_b.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi new file mode 100644 index 000000000000..fe16227f76b2 --- /dev/null +++ b/dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20_a_b_cpuapp_ns_partition.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi new file mode 100644 index 000000000000..6d6cefc88256 --- /dev/null +++ b/dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20_a_b_cpuapp_partition.dtsi" From 180fa28ee0c99184096cce4b32dce3aa4d456d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 13 Jan 2026 08:30:13 +0100 Subject: [PATCH 1833/3334] [nrf fromtree] soc: nordic: nrf54l: add nRF54LM20B SoC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added symbols for new SoC, identical to nRF54LM20A. Signed-off-by: Michał Stasiak (cherry picked from commit 7f4c2329bbd0bd85b422aa56a67b8928cc5e97ae) --- soc/nordic/nrf54l/Kconfig | 13 +++++++++++++ .../Kconfig.defconfig.nrf54lm20_a_b_cpuapp | 4 ++-- .../Kconfig.defconfig.nrf54lm20_a_b_cpuflpr | 4 ++-- soc/nordic/nrf54l/Kconfig.soc | 19 +++++++++++++++++++ soc/nordic/nrf54l/Kconfig.sysbuild | 2 +- soc/nordic/soc.yml | 13 +++++++++++++ 6 files changed, 50 insertions(+), 5 deletions(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 36d6c69b4a58..7c98bf3affd3 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -58,6 +58,16 @@ config SOC_NRF54LM20A_CPUAPP select CPU_HAS_FPU select HAS_SWO +config SOC_NRF54LM20B_CPUAPP + select SOC_NRF54L_CPUAPP_COMMON + select SOC_COMPATIBLE_NRF54LM20A + select SOC_COMPATIBLE_NRF54LM20A_CPUAPP + select ARMV8_M_DSP + select CPU_HAS_ARM_MPU + select CPU_HAS_ARM_SAU + select CPU_HAS_FPU + select HAS_SWO + config SOC_NRF54L05_CPUFLPR select RISCV_CORE_NORDIC_VPR @@ -71,6 +81,9 @@ config SOC_NRF54L15_CPUFLPR config SOC_NRF54LM20A_CPUFLPR select RISCV_CORE_NORDIC_VPR +config SOC_NRF54LM20B_CPUFLPR + select RISCV_CORE_NORDIC_VPR + if SOC_SERIES_NRF54L config SOC_NRF54LX_DISABLE_FICR_TRIMCNF diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp index 7e5336e2212a..c0458ff44258 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp @@ -4,9 +4,9 @@ # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54LM20A_CPUAPP +if SOC_NRF54LM20A_CPUAPP || SOC_NRF54LM20B_CPUAPP config NUM_IRQS default 290 -endif # SOC_NRF54LM20A_CPUAPP +endif # SOC_NRF54LM20A_CPUAPP || SOC_NRF54LM20B_CPUAPP diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr index 4b84d1ed8bb9..e6a2f9775f59 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr @@ -3,9 +3,9 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54LM20A_CPUFLPR +if SOC_NRF54LM20A_CPUFLPR || SOC_NRF54LM20B_CPUFLPR config NUM_IRQS default 287 -endif # SOC_NRF54LM20A_CPUFLPR +endif # SOC_NRF54LM20A_CPUFLPR || SOC_NRF54LM20B_CPUFLPR diff --git a/soc/nordic/nrf54l/Kconfig.soc b/soc/nordic/nrf54l/Kconfig.soc index f550cd557a66..978345c10cc2 100644 --- a/soc/nordic/nrf54l/Kconfig.soc +++ b/soc/nordic/nrf54l/Kconfig.soc @@ -90,8 +90,27 @@ config SOC_NRF54LM20A_CPUFLPR help NRF54LM20A CPUFLPR +config SOC_NRF54LM20B + bool + select SOC_SERIES_NRF54L + help + NRF54LM20B + +config SOC_NRF54LM20B_CPUAPP + bool + select SOC_NRF54LM20B + help + NRF54LM20B CPUAPP + +config SOC_NRF54LM20B_CPUFLPR + bool + select SOC_NRF54LM20B + help + NRF54LM20B CPUFLPR + config SOC default "nrf54l05" if SOC_NRF54L05 default "nrf54l10" if SOC_NRF54L10 default "nrf54l15" if SOC_NRF54L15 default "nrf54lm20a" if SOC_NRF54LM20A + default "nrf54lm20b" if SOC_NRF54LM20B diff --git a/soc/nordic/nrf54l/Kconfig.sysbuild b/soc/nordic/nrf54l/Kconfig.sysbuild index b2034be193dd..38828e2329a4 100644 --- a/soc/nordic/nrf54l/Kconfig.sysbuild +++ b/soc/nordic/nrf54l/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54L15_CPUFLPR || SOC_NRF54LM20A_CPUFLPR +if SOC_NRF54L15_CPUFLPR || SOC_NRF54LM20A_CPUFLPR || SOC_NRF54LM20B_CPUFLPR config HAS_NORDIC_VPR_LAUNCHER_IMAGE default y diff --git a/soc/nordic/soc.yml b/soc/nordic/soc.yml index aab70b717b11..39076d9e4d02 100644 --- a/soc/nordic/soc.yml +++ b/soc/nordic/soc.yml @@ -37,6 +37,10 @@ family: cpuclusters: - name: cpuapp - name: cpuflpr + - name: nrf54lm20b + cpuclusters: + - name: cpuapp + - name: cpuflpr - name: nrf54h socs: - name: nrf54h20 @@ -123,6 +127,9 @@ runners: - qualifiers: - nrf54lm20a/cpuapp - nrf54lm20a/cpuflpr + - qualifiers: + - nrf54lm20b/cpuapp + - nrf54lm20b/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad @@ -186,6 +193,9 @@ runners: - qualifiers: - nrf54lm20a/cpuapp - nrf54lm20a/cpuflpr + - qualifiers: + - nrf54lm20b/cpuapp + - nrf54lm20b/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad @@ -249,6 +259,9 @@ runners: - qualifiers: - nrf54lm20a/cpuapp - nrf54lm20a/cpuflpr + - qualifiers: + - nrf54lm20b/cpuapp + - nrf54lm20b/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad From 949cfd47680e7803d8bbd689e02a070bb344fcb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 13 Jan 2026 10:23:32 +0100 Subject: [PATCH 1834/3334] [nrf fromtree] boards: nordic: nrf54lm20dk: add nRF54LM20B SoC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added board variant with nRF54LM20B SoC. Signed-off-by: Michał Stasiak (cherry picked from commit 2d7455d013bef752aaf1ba68c8572000e1a8f09e) --- boards/nordic/nrf54lm20dk/Kconfig.defconfig | 8 ++-- boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk | 2 + boards/nordic/nrf54lm20dk/board.cmake | 6 +-- boards/nordic/nrf54lm20dk/board.yml | 6 +++ .../nrf54lm20dk_nrf54lm20b_cpuapp.dts | 21 +++++++++ .../nrf54lm20dk_nrf54lm20b_cpuapp.yaml | 24 ++++++++++ .../nrf54lm20dk_nrf54lm20b_cpuapp_defconfig | 26 +++++++++++ .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts | 41 +++++++++++++++++ .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml | 22 +++++++++ ...nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig | 45 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20b_cpuflpr.dts | 23 ++++++++++ .../nrf54lm20dk_nrf54lm20b_cpuflpr.yaml | 15 +++++++ .../nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig | 19 ++++++++ 13 files changed, 251 insertions(+), 7 deletions(-) create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.yaml create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.dts create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.yaml create mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig index c77e844b822c..d7f9c4ead8ea 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54lm20dk/Kconfig.defconfig @@ -1,18 +1,18 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP +if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION -endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP +endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP -if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS +if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP_NS # By default, if we build for a Non-Secure version of the board, # enable building with TF-M as the Secure Execution Environment. config BUILD_WITH_TFM default y -endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS +endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP_NS diff --git a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk index 8b704357e66a..adb6b8167929 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk +++ b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk @@ -4,3 +4,5 @@ config BOARD_NRF54LM20DK select SOC_NRF54LM20A_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS select SOC_NRF54LM20A_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR + select SOC_NRF54LM20B_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP_NS + select SOC_NRF54LM20B_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20B_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake index 8e84753dc143..2f8ad51b8417 100644 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ b/boards/nordic/nrf54lm20dk/board.cmake @@ -1,13 +1,13 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_SOC_NRF54LM20A_CPUAPP) +if(CONFIG_SOC_NRF54LM20A_CPUAPP OR CONFIG_SOC_NRF54LM20B_CPUAPP) board_runner_args(jlink "--device=nRF54LM20A_M33" "--speed=4000") -elseif(CONFIG_SOC_NRF54LM20A_CPUFLPR) +elseif(CONFIG_SOC_NRF54LM20A_CPUFLPR OR CONFIG_SOC_NRF54LM20B_CPUFLPR) board_runner_args(jlink "--device=nRF54LM20A_RV32" "--speed=4000") endif() -if(CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS) +if(CONFIG_TRUSTED_EXECUTION_NONSECURE) set(TFM_PUBLIC_KEY_FORMAT "full") endif() diff --git a/boards/nordic/nrf54lm20dk/board.yml b/boards/nordic/nrf54lm20dk/board.yml index 86decbf7c7cd..73bcd82ecc28 100644 --- a/boards/nordic/nrf54lm20dk/board.yml +++ b/boards/nordic/nrf54lm20dk/board.yml @@ -9,6 +9,12 @@ board: cpucluster: cpuapp - name: xip cpucluster: cpuflpr + - name: nrf54lm20b + variants: + - name: ns + cpucluster: cpuapp + - name: xip + cpucluster: cpuflpr runners: run_once: '--recover': diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts new file mode 100644 index 000000000000..f8f9fb7a9361 --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "nrf54lm20_a_b_cpuapp_common.dtsi" +#include + +/ { + compatible = "nordic,nrf54lm20dk_nrf54lm20b-cpuapp"; + model = "Nordic nRF54LM20 DK nRF54LM20B Application MCU"; + + chosen { + zephyr,code-partition = &slot0_partition; + zephyr,sram = &cpuapp_sram; + }; +}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.yaml new file mode 100644 index 000000000000..6b1a8ed806ae --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.yaml @@ -0,0 +1,24 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54lm20dk/nrf54lm20b/cpuapp +name: nRF54LM20-DK-nRF54LM20B-Application +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +sysbuild: true +ram: 511 +flash: 920 +supported: + - adc + - counter + - dmic + - gpio + - i2c + - i2s + - pwm + - spi + - usbd + - watchdog diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig new file mode 100644 index 000000000000..f9a1fdba322a --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig @@ -0,0 +1,26 @@ +# Copyright (c) 2026 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 + +# MPU-based null-pointer dereferencing detection cannot +# be applied as the (0x0 - 0x400) is unmapped for this target. +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y + +# Enable Cache +CONFIG_CACHE_MANAGEMENT=y +CONFIG_EXTERNAL_CACHE=y + +# Start SYSCOUNTER on driver init +CONFIG_NRF_GRTC_START_SYSCOUNTER=y diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts new file mode 100644 index 000000000000..7a6d3179f551 --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#define USE_NON_SECURE_ADDRESS_MAP 1 + +#include +#include "nrf54lm20_a_b_cpuapp_common.dtsi" + +/ { + compatible = "nordic,nrf54lm20dk_nrf54lm20b-cpuapp-ns"; + model = "Nordic nRF54LM20 DK nRF54LM20B Application MCU Non-Secure"; + + chosen { + zephyr,code-partition = &slot0_ns_partition; + zephyr,sram = &sram0_ns; + zephyr,entropy = &psa_rng; + }; + + /delete-node/ rng; + + psa_rng: psa-rng { + status = "okay"; + }; +}; + +&bt_hci_controller { + status = "disabled"; +}; + +&uart30 { + /* Disable so that TF-M can use this UART */ + status = "disabled"; +}; + +/* Include default memory partition configuration file */ +#include diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml new file mode 100644 index 000000000000..afd7bcf905c0 --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml @@ -0,0 +1,22 @@ +identifier: nrf54lm20dk/nrf54lm20b/cpuapp/ns +name: nRF54lm20-DK-nRF54lm20b-Application-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +ram: 252 +flash: 1452 +supported: + - adc + - counter + - dmic + - gpio + - i2c + - i2s + - pwm + - spi + - usbd + - watchdog +vendor: nordic +sysbuild: true diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig new file mode 100644 index 000000000000..df94a70e6c6d --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig @@ -0,0 +1,45 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# Use devicetree code partition for TF-M +CONFIG_USE_DT_CODE_PARTITION=y + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +# Don't enable the cache in the non-secure image as it is a +# secure-only peripheral on 54l +CONFIG_CACHE_MANAGEMENT=n +CONFIG_EXTERNAL_CACHE=n + +# Start SYSCOUNTER on driver init +CONFIG_NRF_GRTC_START_SYSCOUNTER=y + +# Disable TFM BL2 since it is not supported +CONFIG_TFM_BL2=n +# Support for silence logging is not supported at the moment +# Tracked by: NCSDK-31930 +CONFIG_TFM_LOG_LEVEL_SILENCE=n + +# The oscillators are configured as secure and cannot be configured +# from the non secure application directly. This needs to be set +# otherwise nrfx will try to configure them, resulting in a bus +# fault. +CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.dts new file mode 100644 index 000000000000..3549e6573ca4 --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.dts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "nrf54lm20_a_b_cpuflpr_common.dtsi" + +/ { + model = "Nordic nRF54LM20 DK nRF54LM20B FLPR MCU"; + compatible = "nordic,nrf54lm20dk_nrf54lm20b-cpuflpr"; + + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,code-partition = &cpuflpr_code_partition; + zephyr,flash = &cpuflpr_rram; + zephyr,sram = &cpuflpr_sram; + }; +}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.yaml new file mode 100644 index 000000000000..1f250499a43e --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.yaml @@ -0,0 +1,15 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +identifier: nrf54lm20dk/nrf54lm20b/cpuflpr +name: nRF54LM20-DK-nRF54LM20B-Fast-Lightweight-Peripheral-Processor +type: mcu +arch: riscv +toolchain: + - zephyr +sysbuild: true +ram: 96 +flash: 96 +supported: + - counter + - gpio diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig new file mode 100644 index 000000000000..8a0dee97d159 --- /dev/null +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +CONFIG_USE_DT_CODE_PARTITION=y + +# Execute from SRAM +CONFIG_XIP=n + +CONFIG_RISCV_ALWAYS_SWITCH_THROUGH_ECALL=y From 36a4dfc64c7bb8d2c16d5536660b4ea27396ed85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 13 Jan 2026 10:30:12 +0100 Subject: [PATCH 1835/3334] [nrf fromtree] modules: hal_nordic: add support for nRF54LM20B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added compile definition translation and MDK links for nRF54LM20B. Signed-off-by: Michał Stasiak (cherry picked from commit 0b438c3b4a8dd3e02b82d6b158e245c97179dbd3) --- modules/hal_nordic/nrfx/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 889758af5dbe..ba83619c912e 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -78,6 +78,9 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF7120_ENGA NRF7120_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF7120_ENGA_CPUAPP NRF_APPLICATION) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20B NRF54LM20B_XXAA) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20B_CPUAPP NRF_APPLICATION) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20B_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9120 NRF9120_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160 NRF9160_XXAA) @@ -280,6 +283,8 @@ mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP nrf54lm20a_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR nrf54lm20a_flpr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP nrf7120_enga_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUFLPR nrf7120_enga_flpr.svd) +mdk_svd_ifdef(CONFIG_SOC_NRF54LM20B_CPUAPP nrf54lm20b_application.svd) +mdk_svd_ifdef(CONFIG_SOC_NRF54LM20B_CPUFLPR nrf54lm20b_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) From c29282ef1a0b1881cc97eaf4d060cbfb45f7e031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 13 Jan 2026 11:39:10 +0100 Subject: [PATCH 1836/3334] [nrf fromtree] modules: trusted-firmware-m: add nRF54LM20B support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added TFM board reference to nRF54LM20B. Signed-off-by: Michał Stasiak (cherry picked from commit 290dcea170cb1508452d247c828cf6719318eba4) --- modules/trusted-firmware-m/Kconfig.tfm | 1 + .../nordic/nrf54lm20b_cpuapp/CMakeLists.txt | 23 +++++++++++++++++++ .../nordic/nrf54lm20b_cpuapp/config.cmake | 9 ++++++++ .../nordic/nrf54lm20b_cpuapp/cpuarch.cmake | 9 ++++++++ .../nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake | 10 ++++++++ 5 files changed, 52 insertions(+) create mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/CMakeLists.txt create mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/config.cmake create mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/cpuarch.cmake create mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 8440c823092f..f8acc307c12e 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -36,6 +36,7 @@ config TFM_BOARD default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp" if SOC_NRF54LM20A_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf7120_cpuapp" if SOC_NRF7120_ENGA_CPUAPP + default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp" if SOC_NRF54LM20B_CPUAPP help The board name used for building TFM. Building with TFM requires that TFM has been ported to the given board/SoC. diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/CMakeLists.txt b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/CMakeLists.txt new file mode 100644 index 000000000000..f15374c99bed --- /dev/null +++ b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright (c) 2026, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set(NRF_BOARD_SELECTED True) + +add_subdirectory(${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/common/nrf54lm20b nrf54lm20b) + +add_subdirectory(.. common) + +install(FILES ${CMAKE_CURRENT_LIST_DIR}/ns/cpuarch_ns.cmake + DESTINATION ${INSTALL_PLATFORM_NS_DIR} + RENAME cpuarch.cmake) + +install(FILES config.cmake + DESTINATION ${INSTALL_PLATFORM_NS_DIR}) + +install(DIRECTORY ${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/nrf54lm20dk_nrf54lm20b_cpuapp/tests + + DESTINATION ${INSTALL_PLATFORM_NS_DIR} +) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/config.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/config.cmake new file mode 100644 index 000000000000..100e01421fda --- /dev/null +++ b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/config.cmake @@ -0,0 +1,9 @@ +# +# Copyright (c) 2026, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set(NRF_SOC_VARIANT nrf54lm20b CACHE STRING "nRF SoC Variant") + +include(${PLATFORM_PATH}/common/nrf54lm20b/config.cmake) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/cpuarch.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/cpuarch.cmake new file mode 100644 index 000000000000..319f5939f204 --- /dev/null +++ b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/cpuarch.cmake @@ -0,0 +1,9 @@ +# +# Copyright (c) 2026, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set(PLATFORM_PATH platform/ext/target/nordic_nrf) + +include(${PLATFORM_PATH}/common/nrf54lm20b/cpuarch.cmake) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake new file mode 100644 index 000000000000..d1eee37de899 --- /dev/null +++ b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake @@ -0,0 +1,10 @@ +# +# Copyright (c) 2026, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set(PLATFORM_DIR ${CMAKE_CURRENT_LIST_DIR}) +set(PLATFORM_PATH ${CMAKE_CURRENT_LIST_DIR}) + +include(${CMAKE_CURRENT_LIST_DIR}/common/nrf54lm20b/cpuarch.cmake) From 7e9e2d185be45d3e3587c15b500ef1ea63580f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 26 Jan 2026 14:53:04 +0100 Subject: [PATCH 1837/3334] [nrf fromtree] tests: drivers: watchdog: add nRF54LM20B support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added overlays for nRF54LM20B SoC. Signed-off-by: Michał Stasiak (cherry picked from commit 96cfd30e0a4a832ab863e47a66b6a71eec0b59e3) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 8 ++++++++ samples/drivers/watchdog/sample.yaml | 1 + .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 +++++++++ tests/drivers/watchdog/wdt_basic_api/testcase.yaml | 1 + 4 files changed, 19 insertions(+) create mode 100644 samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..20011e23efd8 --- /dev/null +++ b/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,8 @@ +/* + * Copyright 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/samples/drivers/watchdog/sample.yaml b/samples/drivers/watchdog/sample.yaml index 7fd53d18762c..24b9bcba4628 100644 --- a/samples/drivers/watchdog/sample.yaml +++ b/samples/drivers/watchdog/sample.yaml @@ -27,6 +27,7 @@ tests: - panb611evb/nrf54l15/cpuflpr - panb611evb/nrf54l15/cpuflpr/xip - nrf54lm20dk/nrf54lm20a/cpuapp/ns + - nrf54lm20dk/nrf54lm20b/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54l15tag/nrf54l15/cpuapp diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..dcac0662ba24 --- /dev/null +++ b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml index 9551d3b8503f..97169e222e94 100644 --- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml +++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml @@ -33,6 +33,7 @@ tests: - nrf54l15tag/nrf54l15/cpuflpr - nrf54l15tag/nrf54l15/cpuflpr/xip - nrf54lm20dk/nrf54lm20a/cpuapp/ns + - nrf54lm20dk/nrf54lm20b/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns - bl54l15u_dvk/nrf54l15/cpuapp/ns From 0a50e1d440baf97f14b5c212617451110828b04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Fri, 30 Jan 2026 15:31:53 +0100 Subject: [PATCH 1838/3334] [nrf fromtree] dts: add Axon node to nRF54LM20B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added binding and node describing Axon. Signed-off-by: Michał Stasiak (cherry picked from commit 7ca2793ebfa896b8804b44b0daa36dd82bccb6f1) --- dts/bindings/misc/nordic,axon.yaml | 16 ++++++++++++++++ dts/vendor/nordic/nrf54lm20b.dtsi | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 dts/bindings/misc/nordic,axon.yaml diff --git a/dts/bindings/misc/nordic,axon.yaml b/dts/bindings/misc/nordic,axon.yaml new file mode 100644 index 000000000000..e6d4145de9d4 --- /dev/null +++ b/dts/bindings/misc/nordic,axon.yaml @@ -0,0 +1,16 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic Axon + +compatible: "nordic,axon" + +include: + - "base.yaml" + +properties: + reg: + required: true + + interrupts: + required: true diff --git a/dts/vendor/nordic/nrf54lm20b.dtsi b/dts/vendor/nordic/nrf54lm20b.dtsi index 7734f295c2f9..75c766c747bb 100644 --- a/dts/vendor/nordic/nrf54lm20b.dtsi +++ b/dts/vendor/nordic/nrf54lm20b.dtsi @@ -5,3 +5,12 @@ */ #include "nrf54lm20_a_b.dtsi" + +&global_peripherals { + axon: axon@56000 { + compatible = "nordic,axon"; + reg = <0x56000 0x1000>; + interrupts = <86 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; +}; From d6528a7d08a0acb830f9a467b6b835073ffbca08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 26 Jan 2026 14:53:45 +0100 Subject: [PATCH 1839/3334] [nrf fromtree] tests: arch: arm: remove increase kobject text area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increased kobject text area no longer needed, fix provided in nrfx 4.1. Signed-off-by: Michał Stasiak (cherry picked from commit 05a762a5b8ece0dd3696fc74cd36101eabc413aa) --- tests/arch/arm/arm_interrupt/testcase.yaml | 1 - tests/arch/arm/arm_thread_swap/testcase.yaml | 2 -- 2 files changed, 3 deletions(-) diff --git a/tests/arch/arm/arm_interrupt/testcase.yaml b/tests/arch/arm/arm_interrupt/testcase.yaml index 5836a20b9565..df47b02fccd9 100644 --- a/tests/arch/arm/arm_interrupt/testcase.yaml +++ b/tests/arch/arm/arm_interrupt/testcase.yaml @@ -17,7 +17,6 @@ tests: - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_ZTEST_STACK_SIZE=1280 - - CONFIG_KOBJECT_TEXT_AREA=32768 arch.arm.interrupt.extra_exception_info: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: diff --git a/tests/arch/arm/arm_thread_swap/testcase.yaml b/tests/arch/arm/arm_thread_swap/testcase.yaml index b60ad6f705d8..e26d88429050 100644 --- a/tests/arch/arm/arm_thread_swap/testcase.yaml +++ b/tests/arch/arm/arm_thread_swap/testcase.yaml @@ -14,7 +14,6 @@ tests: - CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - - CONFIG_KOBJECT_TEXT_AREA=32768 min_flash: 192 arch.arm.swap.common.fpu_sharing: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_ARMV7_M_ARMV8_M_FP @@ -30,5 +29,4 @@ tests: - CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - - CONFIG_KOBJECT_TEXT_AREA=32768 min_flash: 192 From abfbf0735712167313d49f8c80be0a9cfac1fbc5 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Mon, 26 Jan 2026 17:28:50 +0100 Subject: [PATCH 1840/3334] [nrf fromtree] drivers: gppi: cleanup some resources before conn alloc Some of the peripherals might be used in the bootloader and not cleaned up properly for the next image in the boot chain. Ensure that affected registers are always cleaned up before use. Signed-off-by: Nikodem Kastelik (cherry picked from commit 3171e650455e183d1cacbbdb01ffc44a109e176a) --- drivers/serial/uart_nrfx_uarte.c | 5 +++++ soc/nordic/nrf53/soc.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index a0ea6fe31818..91dff7cecb93 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2894,6 +2894,11 @@ static int endtx_stoptx_ppi_init(NRF_UARTE_Type *uarte, { int ret; +#ifdef DPPIC_PRESENT + nrf_uarte_publish_clear(uarte, NRF_UARTE_EVENT_ENDTX); + nrf_uarte_subscribe_clear(uarte, NRF_UARTE_TASK_STOPTX); +#endif + ret = nrfx_gppi_conn_alloc( nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_ENDTX), nrf_uarte_task_address_get(uarte, NRF_UARTE_TASK_STOPTX), &data->ppi_h_endtx); diff --git a/soc/nordic/nrf53/soc.c b/soc/nordic/nrf53/soc.c index 58730f86d8c4..5887399c6ace 100644 --- a/soc/nordic/nrf53/soc.c +++ b/soc/nordic/nrf53/soc.c @@ -399,10 +399,14 @@ static int rtc_pretick_cpuapp_init(void) uint32_t task_ipc = nrf_ipc_task_address_get(NRF_IPC, ipc_task); uint32_t evt_ipc = nrf_ipc_event_address_get(NRF_IPC, ipc_event); + nrf_ipc_publish_clear(NRF_IPC, ipc_event); + nrf_ipc_subscribe_clear(NRF_IPC, ipc_task); + nrf_ipc_receive_config_set(NRF_IPC, CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET, BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET)); nrf_ipc_send_config_set(NRF_IPC, CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET, BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET)); + err = nrfx_gppi_conn_alloc(evt_ipc, task_ipc, &handle); if (err < 0) { return err; From 90b0dcb43385cc43668097a3579a267f80d73653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 29 Jan 2026 11:53:18 +0100 Subject: [PATCH 1841/3334] [nrf fromtree] drivers: hwinfo_nrf: align to missing DOG1 reset reason MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Its missing on some targets. Signed-off-by: Michał Stasiak (cherry picked from commit 05e7090ad73877d6bc0e1fc50a08b2b37f0abccb) --- drivers/hwinfo/hwinfo_nrf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index 143a7bd200b0..d7b7b077546b 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -87,7 +87,8 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length) #if NRF_POWER_HAS_RESETREAS #define REASON_WATCHDOG NRFX_RESET_REASON_DOG_MASK #else -#define REASON_WATCHDOG (NRFX_RESET_REASON_DOG0_MASK | NRFX_RESET_REASON_DOG1_MASK) +#define REASON_WATCHDOG (NRFX_RESET_REASON_DOG0_MASK | \ + COND_CODE_1(NRFX_RESET_REASON_HAS_DOG1, (NRFX_RESET_REASON_DOG1_MASK), (0))) #endif /* NRF_POWER_HAS_RESETREAS */ #endif /* NRF_RESETINFO */ From e5c923ae0e0487609d22a2644542a674b625a356 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 12:17:00 +0200 Subject: [PATCH 1842/3334] [nrf noup] dts: choose a psa-rng for entropy for 54lm20a Set PSA as the entropy source for nRF54lm20a target. PSA is the only NCS-supported interface to CRACEN. There is no other entropy source in 54lm20a than CRACEN. The commit also disables `rng` compatible with `nrf-cracen-ctrdrbg`, the nrfx based interface to CRACEN that is used in upstream Zephyr. Only one CRACEN interface may be enabled. Signed-off-by: Piotr Pryga (cherry picked from commit ae18200a608e1cfc048e58bde0e5e1da859cf63c) --- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index d4dcee6850d6..6e0b57f0f0d4 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -31,7 +31,7 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; diff --git a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi index 484ff2afcfd5..3484a4d6fab8 100644 --- a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi @@ -23,7 +23,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -34,11 +34,11 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; }; From 3c80c155dc70f1a3874f365c570c6fd2adce7e2e Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 07:48:52 +0200 Subject: [PATCH 1843/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding as default The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. The SoftDevice Controller is a default BT controller in nRF Connect SDK context, therefore it should be enabled by default instead of open source link layer. The commit changes the default BT controller for nRF54lm20a SoC. Signed-off-by: Piotr Pryga (cherry picked from commit 39166353a40830e5d1bf02cfa4d4c99040adbfc8) --- dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi | 4 ++-- dts/vendor/nordic/nrf54lm20_a_b.dtsi | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi index 3484a4d6fab8..8080d21d8f94 100644 --- a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi @@ -22,7 +22,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -43,7 +43,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54lm20_a_b.dtsi b/dts/vendor/nordic/nrf54lm20_a_b.dtsi index 454bc446de0a..0eb0e33b7158 100644 --- a/dts/vendor/nordic/nrf54lm20_a_b.dtsi +++ b/dts/vendor/nordic/nrf54lm20_a_b.dtsi @@ -303,6 +303,11 @@ /* Note: In the nRF Connect SDK the SoftDevice Controller * is added and set as the default Bluetooth Controller. */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From 8989f27f3f7c42f5bdb86019d599002003b95eaf Mon Sep 17 00:00:00 2001 From: Sergei Ovchinnikov Date: Tue, 6 Jan 2026 11:58:48 +0100 Subject: [PATCH 1844/3334] [nrf fromtree] drivers: regulator: npm13xx: add LDO soft start support Starting from revision 1.1 nPM1304 has support for soft start on the LDSW regulators configured in the LDO mode. This requires special handling and is done automatically for applicable device versions. Signed-off-by: Sergei Ovchinnikov (cherry picked from commit cb5a44458ae8fa65c74d4903c1b0d8c46d8d87e6) --- drivers/regulator/regulator_npm13xx.c | 88 ++++++++++++++++++++++++--- 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/regulator_npm13xx.c b/drivers/regulator/regulator_npm13xx.c index c07970bb5c64..2047bdd40f14 100644 --- a/drivers/regulator/regulator_npm13xx.c +++ b/drivers/regulator/regulator_npm13xx.c @@ -28,10 +28,18 @@ enum npm13xx_gpio_type { NPM13XX_GPIO_TYPE_PWM }; -/* nPM13xx regulator base addresses */ -#define BUCK_BASE 0x04U -#define LDSW_BASE 0x08U -#define SHIP_BASE 0x0BU +/* nPM13xx base addresses */ +#define MAIN_BASE 0x00U +#define LDSW_EXTRA_BASE 0x02U +#define BUCK_BASE 0x04U +#define LDSW_BASE 0x08U +#define SHIP_BASE 0x0BU + +/* nPM13xx main register offsets */ +#define MAIN_OFFSET_VERSION 0x26U + +/* nPM13xx ldsw extra register offsets */ +#define LDSW_OFFSET_LDO_SOFT 0x08U /* nPM13xx regulator register offsets */ #define BUCK_OFFSET_EN_SET 0x00U @@ -60,6 +68,9 @@ enum npm13xx_gpio_type { /* nPM13xx ship register offsets */ #define SHIP_OFFSET_SHIP 0x02U +/* relevant masks and shifts */ +#define MAIN_VERSION_MINOR_MASK 0x0FU + #define BUCK1_ON_MASK 0x04U #define BUCK2_ON_MASK 0x40U #define BUCK1_EN_PULLDOWN_MASK BIT(2) @@ -77,6 +88,15 @@ enum npm13xx_gpio_type { #define NPM13XX_GPIO_UNUSED UINT8_MAX +#define NPM1304_REV_HAS_LDO_SOFTSTART(major, minor) ((major) > 1 || ((major == 1) && (minor >= 1))) +#define DEVICE_HAS_LDO_SOFTSTART(device, major, minor) \ + ((device) == NPM1304_DEVICE && NPM1304_REV_HAS_LDO_SOFTSTART(major, minor)) + +enum npm13xx_device_variant { + NPM1300_DEVICE, + NPM1304_DEVICE, +}; + struct npm13xx_gpio_info { uint8_t pin; bool invert; @@ -90,6 +110,7 @@ struct regulator_npm13xx_pconfig { struct regulator_npm13xx_config { struct regulator_common_config common; const struct device *mfd; + enum npm13xx_device_variant device_variant; uint8_t source; int32_t retention_uv; struct npm13xx_gpio_info enable_gpios; @@ -333,14 +354,61 @@ static int set_buck_mode(const struct device *dev, uint8_t chan, regulator_mode_ return mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, pwm_reg + (chan * 2U), 1U); } +static int get_pmic_revision(const struct device *dev, uint8_t *major, uint8_t *minor) +{ + const struct regulator_npm13xx_config *config = dev->config; + static uint8_t version_regs[2]; + int ret; + + if (!(version_regs[0] || version_regs[1])) { + /* avoid re-reading the registers content */ + ret = mfd_npm13xx_reg_read_burst(config->mfd, MAIN_BASE, MAIN_OFFSET_VERSION, + version_regs, 2U); + if (ret < 0) { + return ret; + } + } + + *major = version_regs[0]; + *minor = version_regs[1] & MAIN_VERSION_MINOR_MASK; + return 0; +} + static int set_ldsw_mode(const struct device *dev, uint8_t chan, regulator_mode_t mode) { const struct regulator_npm13xx_config *config = dev->config; + uint8_t major, minor; + int ret; + + ret = get_pmic_revision(dev, &major, &minor); + if (ret < 0) { + return ret; + } switch (mode) { case NPM13XX_LDSW_MODE_LDO: + if (DEVICE_HAS_LDO_SOFTSTART(config->device_variant, major, minor)) { + ret = mfd_npm13xx_reg_update(config->mfd, LDSW_EXTRA_BASE, + LDSW_OFFSET_LDO_SOFT, 1U << chan, 1U << chan); + if (ret < 0) { + return ret; + } + + return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, + LDSW_OFFSET_LDOSEL + chan, 0U); + } + return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_LDOSEL + chan, 1U); case NPM13XX_LDSW_MODE_LDSW: + if (DEVICE_HAS_LDO_SOFTSTART(config->device_variant, major, minor)) { + /* clear the "LDO with soft start" bit, so that LS mode can take effect */ + ret = mfd_npm13xx_reg_update(config->mfd, LDSW_EXTRA_BASE, + LDSW_OFFSET_LDO_SOFT, 0U, 1U << chan); + if (ret < 0) { + return ret; + } + } + return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_LDOSEL + chan, 0U); default: return -ENOTSUP; @@ -716,6 +784,7 @@ static DEVICE_API(regulator, api) = { static const struct regulator_npm13xx_config regulator_##partno##_config_##id = { \ .common = REGULATOR_DT_COMMON_CONFIG_INIT(node_id), \ .mfd = DEVICE_DT_GET(DT_GPARENT(node_id)), \ + .device_variant = partno##_DEVICE, \ .source = _source, \ .retention_uv = DT_PROP_OR(node_id, retention_microvolt, 0), \ .soft_start = DT_ENUM_IDX_OR(node_id, soft_start_microamp, UINT8_MAX), \ @@ -745,19 +814,18 @@ static DEVICE_API(regulator, api) = { \ DEVICE_DT_INST_DEFINE(n, regulator_npm13xx_common_init, NULL, NULL, \ ®ulator_##partno##_config##n, POST_KERNEL, \ - CONFIG_REGULATOR_NPM13XX_COMMON_INIT_PRIORITY, \ - &parent_api); \ + CONFIG_REGULATOR_NPM13XX_COMMON_INIT_PRIORITY, &parent_api); \ \ REGULATOR_NPM13XX_DEFINE_COND(partno, n, buck1, NPM13XX_SOURCE_BUCK1) \ REGULATOR_NPM13XX_DEFINE_COND(partno, n, buck2, NPM13XX_SOURCE_BUCK2) \ REGULATOR_NPM13XX_DEFINE_COND(partno, n, ldo1, NPM13XX_SOURCE_LDO1) \ REGULATOR_NPM13XX_DEFINE_COND(partno, n, ldo2, NPM13XX_SOURCE_LDO2) -#define DT_DRV_COMPAT nordic_npm1300_regulator -#define REGULATOR_NPM1300_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(npm1300, n) +#define DT_DRV_COMPAT nordic_npm1300_regulator +#define REGULATOR_NPM1300_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(NPM1300, n) DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM1300_DEFINE_ALL) #undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1304_regulator -#define REGULATOR_NPM1304_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(npm1304, n) +#define DT_DRV_COMPAT nordic_npm1304_regulator +#define REGULATOR_NPM1304_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(NPM1304, n) DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM1304_DEFINE_ALL) From 0c696d07b19bf9567dd8e77e45670f048f16f793 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 28 Jan 2026 12:02:44 +0530 Subject: [PATCH 1845/3334] [nrf fromtree] drivers: wifi: nrf_wifi: configure GPIO pins early during driver init Configure all nRF70 GPIO pins (BUCKEN, VDDIO_CTRL, SR RF switch) to OUTPUT_INACTIVE state during driver initialization to prevent floating pins from accidentally powering the module or affecting RF switch before the interface is brought up. This addresses an issue where GPIO configuration was delayed until the interface was brought up for the first time, leaving voltage control pins floating which could result in unintended power supply. Fixes #100993. Signed-off-by: Chaitanya Tata (cherry picked from commit 7c1cd4c569aaea9e25c2b4cb1b1630619b6d3be1) --- drivers/wifi/nrf_wifi/src/coex.c | 31 ++++++- drivers/wifi/nrf_wifi/src/fmac_main.c | 22 ++++- .../drivers/wifi/nrf_wifi/bus/rpu_hw_if.h | 4 +- modules/nrf_wifi/bus/rpu_hw_if.c | 92 ++++++++++++++++++- 4 files changed, 145 insertions(+), 4 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/coex.c b/drivers/wifi/nrf_wifi/src/coex.c index a9147aad5dc9..a5abf1807217 100644 --- a/drivers/wifi/nrf_wifi/src/coex.c +++ b/drivers/wifi/nrf_wifi/src/coex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2026 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -289,6 +289,35 @@ int nrf_wifi_coex_hw_reset(void) } #ifdef CONFIG_NRF70_SR_COEX_RF_SWITCH +/** + * @brief Configure SR RF switch GPIO to OUTPUT_INACTIVE state during + * driver initialization. + * + * This function configures the SR RF switch GPIO pin to OUTPUT_INACTIVE + * state to prevent it from floating. This should be called early during + * driver initialization, before the interface is brought up. + * + * @return 0 on success, negative error code on failure + */ +int sr_gpio_config_early(void) +{ + int ret; + + if (!device_is_ready(sr_rf_switch_spec.port)) { + return -ENODEV; + } + + /* Configure SR RF switch as output in inactive (low) state to + * prevent floating pin from accidentally switching the antenna. + */ + ret = gpio_pin_configure_dt(&sr_rf_switch_spec, GPIO_OUTPUT_INACTIVE); + if (ret) { + LOG_ERR("SR GPIO early configuration failed %d", ret); + } + + return ret; +} + int sr_gpio_config(void) { int ret; diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 5ddf11a14254..d7fcc00fb63c 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2026 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -25,6 +25,9 @@ #include #include "common/fmac_util.h" #include +#ifndef CONFIG_NRF71_ON_IPC +#include +#endif /* !CONFIG_NRF71_ON_IPC */ #ifndef CONFIG_NRF70_RADIO_TEST #ifdef CONFIG_NRF70_STA_MODE @@ -795,6 +798,23 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) return 0; } +#ifndef CONFIG_NRF71_ON_IPC + int ret; + + /* Configure all nRF70 GPIO pins to OUTPUT_INACTIVE state early + * during driver initialization to prevent floating pins from + * accidentally powering the module or affecting RF switch. This is + * done before any other RPU initialization to ensure pins are in a + * known state. + */ + ret = nrf_wifi_gpio_config_early(); + if (ret) { + LOG_ERR("%s: nrf_wifi_gpio_config_early failed with error %d", + __func__, ret); + return ret; + } +#endif /* !CONFIG_NRF71_ON_IPC */ + #ifdef CONFIG_NRF70_DATA_TX data_config.aggregation = aggregation; data_config.wmm = IS_ENABLED(CONFIG_NRF_WIFI_FEAT_WMM); diff --git a/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h b/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h index c691743fd77f..fe5a096d5f43 100644 --- a/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h +++ b/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2026 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -72,11 +72,13 @@ int rpu_read_reg(uint8_t reg_addr, uint8_t *reg_value); */ int rpu_write_reg(uint8_t reg_addr, uint8_t reg_value); +int nrf_wifi_gpio_config_early(void); int rpu_init(void); int rpu_enable(void); int rpu_disable(void); #ifdef CONFIG_NRF70_SR_COEX_RF_SWITCH +int sr_gpio_config_early(void); int sr_ant_switch(unsigned int ant_switch); int sr_gpio_remove(void); int sr_gpio_config(void); diff --git a/modules/nrf_wifi/bus/rpu_hw_if.c b/modules/nrf_wifi/bus/rpu_hw_if.c index d3ac867f0711..004c820c6322 100644 --- a/modules/nrf_wifi/bus/rpu_hw_if.c +++ b/modules/nrf_wifi/bus/rpu_hw_if.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2026 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -183,6 +183,96 @@ int rpu_irq_remove(struct gpio_callback *irq_callback_data) return ret; } +/** + * @brief Configure RPU GPIO pins to OUTPUT_INACTIVE state during driver + * initialization. + * + * This function configures the voltage control pins (BUCKEN, VDDIO_CTRL) + * to OUTPUT_INACTIVE state to prevent them from floating. This should be + * called early during driver initialization, before the interface is + * brought up. + * + * @return 0 on success, negative error code on failure + */ +static int rpu_gpio_config_early(void) +{ + int ret; + +#ifdef NRF70_IOVDD_GPIO + if (!device_is_ready(iovdd_ctrl_spec.port)) { + LOG_ERR("IOVDD GPIO %s is not ready", iovdd_ctrl_spec.port->name); + return -ENODEV; + } +#endif + + if (!device_is_ready(bucken_spec.port)) { + LOG_ERR("BUCKEN GPIO %s is not ready", bucken_spec.port->name); + return -ENODEV; + } + + /* Configure BUCKEN as output in inactive (low) state to prevent + * floating pin from accidentally powering the module. + */ + ret = gpio_pin_configure_dt(&bucken_spec, + (GPIO_OUTPUT_INACTIVE | NRF_GPIO_DRIVE_H0H1)); + if (ret) { + LOG_ERR("BUCKEN GPIO configuration failed..."); + return ret; + } + +#ifdef NRF70_IOVDD_GPIO + /* Configure IOVDD_CTRL as output in inactive (low) state to prevent + * floating pin from accidentally enabling IOVDD. + */ + ret = gpio_pin_configure_dt(&iovdd_ctrl_spec, GPIO_OUTPUT_INACTIVE); + if (ret) { + LOG_ERR("IOVDD GPIO configuration failed..."); + gpio_pin_configure_dt(&bucken_spec, GPIO_DISCONNECTED); + return ret; + } +#endif + + return 0; +} + +/** + * @brief Configure all nRF70 GPIO pins to OUTPUT_INACTIVE state during + * driver initialization. + * + * This function configures all output GPIO pins controlled by the nRF70 + * driver (BUCKEN, VDDIO_CTRL, SR RF switch) to OUTPUT_INACTIVE state to + * prevent them from floating. This should be called early during driver + * initialization, before the interface is brought up. + * + * @return 0 on success, negative error code on failure + */ +int nrf_wifi_gpio_config_early(void) +{ + int ret; + + ret = rpu_gpio_config_early(); + if (ret) { + return ret; + } + +#ifdef CONFIG_NRF70_SR_COEX_RF_SWITCH + /* Configure SR RF switch GPIO to OUTPUT_INACTIVE state to prevent + * floating pin from accidentally switching the antenna. + */ + ret = sr_gpio_config_early(); + if (ret) { + LOG_ERR("SR GPIO early configuration failed..."); + /* Clean up RPU GPIOs on failure */ + rpu_gpio_remove(); + return ret; + } +#endif + + LOG_DBG("Early GPIO configuration done (pins set to inactive)...\n"); + + return 0; +} + static int rpu_gpio_config(void) { int ret; From aede5bdf8744e8d6a3679e439af29c579422840f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 2 Feb 2026 20:35:55 +0530 Subject: [PATCH 1846/3334] [nrf fromtree] nrf_wifi: Remove nRF71 support The driver and module now supports nRF70 only, nRF71 support will be added in the future using a new driver. Signed-off-by: Chaitanya Tata (cherry picked from commit 7f6d36147397ff5265c942b9e1adcabb6d559e3b) --- drivers/wifi/nrf_wifi/CMakeLists.txt | 8 +- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 14 +- drivers/wifi/nrf_wifi/inc/fmac_main.h | 4 - .../nrf_wifi/off_raw_tx/src/off_raw_tx_api.c | 11 - drivers/wifi/nrf_wifi/src/debug_shell.c | 4 - drivers/wifi/nrf_wifi/src/fmac_main.c | 27 -- drivers/wifi/nrf_wifi/src/fw_load.c | 6 - drivers/wifi/nrf_wifi/src/net_if.c | 10 - drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 2 - drivers/wifi/nrf_wifi/src/wifi_util.c | 10 - drivers/wifi/nrf_wifi/src/wifi_util.h | 4 - drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 141 ---------- modules/nrf_wifi/bus/CMakeLists.txt | 15 - modules/nrf_wifi/bus/Kconfig | 9 - modules/nrf_wifi/bus/device.c | 23 +- modules/nrf_wifi/bus/ipc_if.c | 135 --------- modules/nrf_wifi/bus/ipc_if.h | 48 ---- modules/nrf_wifi/bus/ipc_service.c | 206 -------------- modules/nrf_wifi/bus/ipc_service.h | 260 ------------------ modules/nrf_wifi/bus/spsc_qm.c | 84 ------ modules/nrf_wifi/bus/spsc_qm.h | 79 ------ modules/nrf_wifi/os/CMakeLists.txt | 8 - modules/nrf_wifi/os/shim.c | 75 ----- subsys/ipc/ipc_service/lib/Kconfig.icmsg | 1 - 24 files changed, 6 insertions(+), 1178 deletions(-) delete mode 100644 modules/nrf_wifi/bus/ipc_if.c delete mode 100644 modules/nrf_wifi/bus/ipc_if.h delete mode 100644 modules/nrf_wifi/bus/ipc_service.c delete mode 100644 modules/nrf_wifi/bus/ipc_service.h delete mode 100644 modules/nrf_wifi/bus/spsc_qm.c delete mode 100644 modules/nrf_wifi/bus/spsc_qm.h diff --git a/drivers/wifi/nrf_wifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt index c6a76bad086a..b3aa412183e1 100644 --- a/drivers/wifi/nrf_wifi/CMakeLists.txt +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -27,11 +27,9 @@ zephyr_library_sources_ifndef(CONFIG_NRF70_OFFLOADED_RAW_TX src/fmac_main.c ) -if(NOT CONFIG_NRF71_ON_IPC) - zephyr_library_sources_ifdef(CONFIG_NRF_WIFI_PATCHES_BUILTIN - src/fw_load.c - ) -endif() +zephyr_library_sources_ifdef(CONFIG_NRF_WIFI_PATCHES_BUILTIN + src/fw_load.c +) if(NOT CONFIG_NRF70_RADIO_TEST AND NOT CONFIG_NRF70_OFFLOADED_RAW_TX) zephyr_library_sources( diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 3a276a8ff707..7a926fbd6d4f 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -16,8 +16,7 @@ menuconfig WIFI_NRF70 depends on \ DT_HAS_NORDIC_NRF7002_SPI_ENABLED || DT_HAS_NORDIC_NRF7002_QSPI_ENABLED || \ DT_HAS_NORDIC_NRF7001_SPI_ENABLED || DT_HAS_NORDIC_NRF7001_QSPI_ENABLED || \ - DT_HAS_NORDIC_NRF7000_SPI_ENABLED || DT_HAS_NORDIC_NRF7000_QSPI_ENABLED || \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF71_WIFI)) + DT_HAS_NORDIC_NRF7000_SPI_ENABLED || DT_HAS_NORDIC_NRF7000_QSPI_ENABLED help Nordic Wi-Fi Driver @@ -25,7 +24,7 @@ if WIFI_NRF70 # Hidden symbols for internal use config WIFI_NRF7002 bool - default y if DT_HAS_NORDIC_NRF7002_SPI_ENABLED || DT_HAS_NORDIC_NRF7002_QSPI_ENABLED || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF71_WIFI)) + default y if DT_HAS_NORDIC_NRF7002_SPI_ENABLED || DT_HAS_NORDIC_NRF7002_QSPI_ENABLED config WIFI_NRF7001 bool @@ -167,12 +166,10 @@ endchoice config NRF_WIFI_LOW_POWER bool "Low power mode in nRF Wi-Fi chipsets" depends on !NRF70_RADIO_TEST && !NRF70_AP_MODE - depends on !NRF71_ON_IPC default y config NRF70_TCP_IP_CHECKSUM_OFFLOAD bool "TCP/IP checksum offload" - depends on !NRF71_ON_IPC default y config NRF70_REG_DOMAIN @@ -220,7 +217,6 @@ config NRF70_SR_COEX_RF_SWITCH config NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL bool "Configuration of GPIO control for coexistence" - depends on !NRF71_ON_IPC default y config NRF70_SR_COEX_SWCTRL1_OUTPUT @@ -680,13 +676,7 @@ config NRF_WIFI_2G_BAND config NRF_WIFI_5G_BAND bool "Set operation band to 5GHz" -if NRF71_ON_IPC -config NRF_WIFI_6G_BAND - bool "Set operation band to 6GHz" -config NRF_WIFI_DUAL_BAND - bool "Set operation band to 2.4GHz and 5GHz" -endif # NRF71_ON_IPC endchoice config NRF_WIFI_IFACE_MTU diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 857205eeebbc..ca539bd546b7 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -31,11 +31,7 @@ #else #include #endif /* !CONFIG_NRF70_RADIO_TEST */ -#ifdef CONFIG_NRF71_ON_IPC -#include -#else #include -#endif /* CONFIG_NRF71_ON_IPC */ #define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING diff --git a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c index 1e53f70c111f..baa960faee52 100644 --- a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c +++ b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c @@ -133,17 +133,6 @@ static enum op_band get_nrf_wifi_op_band(void) if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { return BAND_24G; } -#ifdef CONFIG_NRF71_ON_IPC - if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { - return BAND_5G; - } - if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { - return BAND_6G; - } - if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { - return BAND_DUAL; - } -#endif /* CONFIG_NRF71_ON_IPC */ return BAND_ALL; } diff --git a/drivers/wifi/nrf_wifi/src/debug_shell.c b/drivers/wifi/nrf_wifi/src/debug_shell.c index b6ac79bf7724..70fb77d6ed0d 100644 --- a/drivers/wifi/nrf_wifi/src/debug_shell.c +++ b/drivers/wifi/nrf_wifi/src/debug_shell.c @@ -9,11 +9,7 @@ */ #include #include -#ifdef NRF71_ON_IPC -#include -#else #include "host_rpu_umac_if.h" -#endif #include "fmac_main.h" extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index d7fcc00fb63c..45739091b0bf 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -25,9 +25,7 @@ #include #include "common/fmac_util.h" #include -#ifndef CONFIG_NRF71_ON_IPC #include -#endif /* !CONFIG_NRF71_ON_IPC */ #ifndef CONFIG_NRF70_RADIO_TEST #ifdef CONFIG_NRF70_STA_MODE @@ -68,10 +66,8 @@ BUILD_ASSERT(CONFIG_NRF70_MAX_TX_TOKENS >= 1, "At least one TX token is required"); BUILD_ASSERT(CONFIG_NRF70_MAX_TX_AGGREGATION <= 15, "Max TX aggregation is 15"); -#ifndef CONFIG_NRF71_ON_IPC BUILD_ASSERT(RPU_PKTRAM_SIZE - TOTAL_RX_SIZE >= TOTAL_TX_SIZE, "Packet RAM overflow: not enough memory for TX"); -#endif /* CONFIG_NRF71_ON_IPC */ BUILD_ASSERT(CONFIG_NRF70_TX_MAX_DATA_SIZE >= MAX_TX_FRAME_SIZE, "TX buffer size must be at least as big as the MTU and headroom"); @@ -516,7 +512,6 @@ void reg_change_callbk_fn(void *vif_ctx, } #endif /* !CONFIG_NRF70_RADIO_TEST */ -#ifndef CONFIG_NRF71_ON_IPC /* DTS uses 1dBm as the unit for TX power, while the RPU uses 0.25dBm */ #define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(nrf70), label) * 4 @@ -597,25 +592,12 @@ void configure_board_dep_params(struct nrf_wifi_board_params *board_params) board_params->pcb_loss_5g_band3 = CONFIG_NRF70_PCB_LOSS_5G_BAND3; #endif /* CONFIG_NRF70_2_4G_ONLY */ } -#endif /* CONFIG_NRF71_ON_IPC */ static enum op_band get_nrf_wifi_op_band(void) { if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { return BAND_24G; } -#ifdef CONFIG_NRF71_ON_IPC - if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { - return BAND_5G; - } - - if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { - return BAND_6G; - } - if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { - return BAND_DUAL; - } -#endif /* CONFIG_NRF71_ON_IPC */ return BAND_ALL; } @@ -684,12 +666,10 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv NRF_WIFI_UMAC_VER_MIN(fw_ver), NRF_WIFI_UMAC_VER_EXTRA(fw_ver)); -#ifndef CONFIG_NRF71_ON_IPC configure_tx_pwr_settings(&tx_pwr_ctrl_params, &tx_pwr_ceil_params); configure_board_dep_params(&board_params); -#endif /* CONFIG_NRF71_ON_IPC */ #if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \ defined(CONFIG_NRF70_SYSTEM_MODE) @@ -798,7 +778,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) return 0; } -#ifndef CONFIG_NRF71_ON_IPC int ret; /* Configure all nRF70 GPIO pins to OUTPUT_INACTIVE state early @@ -813,7 +792,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) __func__, ret); return ret; } -#endif /* !CONFIG_NRF71_ON_IPC */ #ifdef CONFIG_NRF70_DATA_TX data_config.aggregation = aggregation; @@ -904,14 +882,9 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) struct nrf_wifi_sys_fmac_priv *sys_fpriv = NULL; sys_fpriv = wifi_fmac_priv(rpu_drv_priv_zep.fmac_priv); -#ifdef CONFIG_NRF71_ON_IPC - /* TODO: Revisit this */ - sys_fpriv->max_ampdu_len_per_token = 8192; -#else sys_fpriv->max_ampdu_len_per_token = (RPU_PKTRAM_SIZE - (CONFIG_NRF70_RX_NUM_BUFS * CONFIG_NRF70_RX_MAX_DATA_SIZE)) / CONFIG_NRF70_MAX_TX_TOKENS; -#endif /* CONFIG_NRF71_ON_IPC */ /* Align to 4-byte */ sys_fpriv->max_ampdu_len_per_token &= ~0x3; diff --git a/drivers/wifi/nrf_wifi/src/fw_load.c b/drivers/wifi/nrf_wifi/src/fw_load.c index cce5a98372fc..64b8608cba95 100644 --- a/drivers/wifi/nrf_wifi/src/fw_load.c +++ b/drivers/wifi/nrf_wifi/src/fw_load.c @@ -17,17 +17,14 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include -#ifndef CONFIG_NRF71_ON_IPC static const char fw_patch[] = { #include }; -#endif /* CONFIG_NRF71_ON_IPC */ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; -#ifndef CONFIG_NRF71_ON_IPC struct nrf_wifi_fmac_fw_info fw_info = { 0 }; status = nrf_wifi_fmac_fw_parse(rpu_ctx, fw_patch, sizeof(fw_patch), &fw_info); @@ -42,8 +39,5 @@ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_fmac_fw_load failed", __func__); } -#else - status = NRF_WIFI_STATUS_SUCCESS; -#endif /* !CONFIG_NRF71_ON_IPC */ return status; } diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index c93313e5a071..c120fba1b8da 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -650,7 +650,6 @@ enum nrf_wifi_status nrf_wifi_get_mac_addr(struct nrf_wifi_vif_ctx_zep *vif_ctx_ random_mac_addr, WIFI_MAC_ADDR_LEN); #elif CONFIG_WIFI_OTP_MAC_ADDRESS -#ifndef CONFIG_NRF71_ON_IPC status = nrf_wifi_fmac_otp_mac_addr_get(fmac_dev_ctx, vif_ctx_zep->vif_idx, vif_ctx_zep->mac_addr.addr); @@ -659,15 +658,6 @@ enum nrf_wifi_status nrf_wifi_get_mac_addr(struct nrf_wifi_vif_ctx_zep *vif_ctx_ __func__); goto unlock; } -#else - /* Set dummy MAC address */ - vif_ctx_zep->mac_addr.addr[0] = 0x00; - vif_ctx_zep->mac_addr.addr[1] = 0x00; - vif_ctx_zep->mac_addr.addr[2] = 0x5E; - vif_ctx_zep->mac_addr.addr[3] = 0x00; - vif_ctx_zep->mac_addr.addr[4] = 0x10; - vif_ctx_zep->mac_addr.addr[5] = 0x00; -#endif /* !CONFIG_NRF71_ON_IPC */ #endif if (!nrf_wifi_utils_is_mac_addr_valid(vif_ctx_zep->mac_addr.addr)) { diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 1fae3d2cf2a4..8e2100e3d625 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -565,9 +565,7 @@ int nrf_wifi_set_twt(const struct device *dev, twt_info.dialog_token = twt_params->dialog_token; twt_info.twt_wake_ahead_duration = twt_params->setup.twt_wake_ahead_duration; -#ifndef CONFIG_NRF71_ON_IPC twt_info.twt_req_timeout = CONFIG_NRF_WIFI_TWT_SETUP_TIMEOUT_MS; -#endif /* CONFIG_NRF71_ON_IPC */ status = nrf_wifi_sys_fmac_twt_setup(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &twt_info); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index c923d79eccf9..99ab4a2d6f41 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -8,20 +8,14 @@ * @brief NRF Wi-Fi util shell module */ #include -#ifdef NRF71_ON_IPC -#include -#else #include "host_rpu_umac_if.h" -#endif #include "common/fmac_util.h" #include "system/fmac_api.h" #include "fmac_main.h" #include "wifi_util.h" -#ifndef CONFIG_NRF71_ON_IPC #include "rpu_lmac_phy_stats.h" #include "rpu_umac_stats.h" -#endif extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; struct nrf_wifi_ctx_zep *ctx = &rpu_drv_priv_zep.rpu_ctx_zep; @@ -979,7 +973,6 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, } #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ -#ifndef CONFIG_NRF71_ON_IPC static int nrf_wifi_dump_stats(const struct shell *sh, struct nrf_wifi_hal_dev_ctx *hal_dev_ctx, const char *name, @@ -1103,7 +1096,6 @@ static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh, k_mutex_unlock(&ctx->rpu_lock); return ret; } -#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_STATIC_SUBCMD_SET_CREATE( nrf70_util, @@ -1208,7 +1200,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 1, 0), #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ -#ifndef CONFIG_NRF71_ON_IPC SHELL_CMD_ARG(rpu_stats_mem, NULL, "Display RPU stats by reading from memory " @@ -1216,7 +1207,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_util_dump_rpu_stats_mem, 1, 1), -#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_SUBCMD_SET_END); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.h b/drivers/wifi/nrf_wifi/src/wifi_util.h index a2490a1df24c..303d5feac99f 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.h +++ b/drivers/wifi/nrf_wifi/src/wifi_util.h @@ -14,11 +14,7 @@ #include #include #include -#ifdef CONFIG_NRF71_ON_IPC -#include -#else #include -#endif #include #include diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 25b69b94801c..5d24fb811f15 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -19,10 +19,6 @@ #include "wpa_supp_if.h" #include -#ifdef CONFIG_NRF71_ON_IPC -#include -#include "wifi_keys.h" -#endif LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); @@ -979,112 +975,6 @@ int nrf_wifi_wpa_supp_associate(void *if_priv, struct wpa_driver_associate_param return ret; } -#ifdef CONFIG_NRF71_ON_IPC -static bool is_mic_cipher_suite(unsigned int suite) -{ - return (suite == RSN_CIPHER_SUITE_AES_128_CMAC || - suite == RSN_CIPHER_SUITE_BIP_GMAC_128 || - suite == RSN_CIPHER_SUITE_BIP_GMAC_256 || - suite == RSN_CIPHER_SUITE_BIP_CMAC_256); -} - -/* Maximum number of keys we can track (unicast + group keys) */ -#define WIFI_CRYPTO_MAX_KEYS 8 - -/* Track installed keys: key_idx -> key_type mapping */ -static struct { - bool valid; - wifi_keys_key_type_t type; - uint32_t db_id; -} installed_keys[WIFI_CRYPTO_MAX_KEYS]; - -static int wifi_import_key_to_crypto(unsigned int suite, const unsigned char *key, size_t key_len, - const unsigned char *addr, int key_idx, uint32_t db_id) -{ - wifi_keys_key_type_t type; - psa_key_attributes_t attr; - psa_key_id_t key_id; - psa_status_t status; - uint32_t key_index; - bool is_broadcast = false; - - /* Determine if this is a broadcast/group key or unicast/pairwise key */ - if (addr && is_broadcast_ether_addr(addr)) { - is_broadcast = true; - } - - /* Determine key type based on cipher suite and address */ - if (is_mic_cipher_suite(suite)) { - type = is_broadcast ? PEER_BCST_MIC : PEER_UCST_MIC; - } else { - type = is_broadcast ? PEER_BCST_ENC : PEER_UCST_ENC; - } - - /* Convert key_idx to uint32_t, ensure it's within valid range */ - key_index = (key_idx < 0) ? 0 : (uint32_t)key_idx; - - /* Initialize PSA key attributes */ - attr = wifi_keys_key_attributes_init(type, db_id, key_index); - - LOG_DBG("%s: Importing key to PSA (suite: 0x%08x, type: %d, idx: %u, len: %zu)", - __func__, suite, type, key_index, key_len); - - /* Import key to PSA */ - status = psa_import_key(&attr, key, key_len, &key_id); - if (status != PSA_SUCCESS) { - LOG_ERR("%s: Failed to import key to PSA: %d", __func__, status); - return -EIO; - } - - /* Track installed key for later destruction */ - if (key_index < WIFI_CRYPTO_MAX_KEYS) { - installed_keys[key_index].valid = true; - installed_keys[key_index].type = type; - installed_keys[key_index].db_id = db_id; - } - - LOG_DBG("%s: Key imported successfully (type: %d, idx: %u)", __func__, type, key_index); - - return 0; -} - -static int wifi_destroy_key_from_crypto(int key_idx, uint32_t db_id) -{ - psa_key_attributes_t attr; - psa_key_id_t key_id; - psa_status_t status; - uint32_t key_index; - - /* Convert key_idx to uint32_t */ - key_index = (key_idx < 0) ? 0 : (uint32_t)key_idx; - - if (key_index >= WIFI_CRYPTO_MAX_KEYS || !installed_keys[key_index].valid) { - LOG_WRN("%s: No tracked key at index %u", __func__, key_index); - /* During init supplicant deletes all keys, so, suppress error */ - return 0; - } - - /* Get the key type that was used during import */ - attr = wifi_keys_key_attributes_init(installed_keys[key_index].type, - installed_keys[key_index].db_id, key_index); - key_id = psa_get_key_id(&attr); - - LOG_DBG("%s: Destroying key (type: %d, idx: %u, key_id: 0x%08x)", - __func__, installed_keys[key_index].type, key_index, key_id); - - status = psa_destroy_key(key_id); - if (status != PSA_SUCCESS) { - LOG_ERR("%s: Failed to destroy key: %d", __func__, status); - return -EIO; - } - - /* Clear tracking entry */ - installed_keys[key_index].valid = false; - - LOG_DBG("%s: Key destroyed successfully", __func__); - return 0; -} -#endif int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum wpa_alg alg, const unsigned char *addr, int key_idx, int set_tx, @@ -1134,15 +1024,7 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w goto out; } -#ifdef CONFIG_NRF71_ON_IPC - ret = wifi_import_key_to_crypto(suite, key, key_len, addr, key_idx, 0); - if (ret) { - LOG_ERR("%s: Failed to import key to crypto: %d", __func__, ret); - goto out; - } -#else memcpy(key_info.key.nrf_wifi_key, key, key_len); -#endif key_info.key.nrf_wifi_key_len = key_len; key_info.cipher_suite = suite; @@ -1180,16 +1062,7 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_sys_fmac_del_key failed", __func__); } else { -#ifdef CONFIG_NRF71_ON_IPC - /* Destroy PSA key after successful del_key */ - ret = wifi_destroy_key_from_crypto(key_idx, 0); - if (ret) { - LOG_ERR("%s: Failed to destroy key from crypto: %d", - __func__, ret); - } -#else ret = 0; -#endif } } else { status = nrf_wifi_sys_fmac_add_key(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, @@ -3054,19 +2927,6 @@ int nrf_wifi_wpa_supp_sta_add(void *if_priv, struct hostapd_sta_add_params *para sta_info.sta_flags2.nrf_wifi_set = nrf_wifi_sta_flags_to_nrf(params->flags); sta_info.sta_flags2.nrf_wifi_mask = sta_info.sta_flags2.nrf_wifi_set | nrf_wifi_sta_flags_to_nrf(params->flags_mask); -#ifdef CONFIG_NRF71_ON_IPC - if (params->ht_capabilities) { - memcpy(&sta_info.ht_capability, - params->ht_capabilities, - sizeof(sta_info.ht_capability)); - } - - if (params->vht_capabilities) { - memcpy(&sta_info.vht_capability, - params->vht_capabilities, - sizeof(sta_info.vht_capability)); - } -#else if (params->ht_capabilities) { memcpy(sta_info.ht_capability, params->ht_capabilities, @@ -3078,7 +2938,6 @@ int nrf_wifi_wpa_supp_sta_add(void *if_priv, struct hostapd_sta_add_params *para params->vht_capabilities, sizeof(sta_info.vht_capability)); } -#endif memcpy(sta_info.mac_addr, params->addr, sizeof(sta_info.mac_addr)); diff --git a/modules/nrf_wifi/bus/CMakeLists.txt b/modules/nrf_wifi/bus/CMakeLists.txt index 479b118be7a1..63c1d2693aa5 100644 --- a/modules/nrf_wifi/bus/CMakeLists.txt +++ b/modules/nrf_wifi/bus/CMakeLists.txt @@ -26,17 +26,7 @@ if(CONFIG_NRF70_BUSLIB) inc ${NRF_WIFI_DIR}/os_if/inc ) - zephyr_library_include_directories_ifdef(CONFIG_NRF71_ON_IPC - ${NRF_WIFI_DIR}/bus_if/bal/inc - # QSPI is common to (Q)SPI and IPC - ${NRF_WIFI_DIR}/bus_if/bus/qspi/inc - ${NRF_WIFI_DIR}/fw_if/umac_if/inc/fw - ${NRF_WIFI_DIR}/hw_if/hal/inc - ) - zephyr_library_compile_definitions_ifdef(CONFIG_NRF71_ON_IPC - NRF71_ON_IPC - ) zephyr_library_sources( device.c ) @@ -53,9 +43,4 @@ if(CONFIG_NRF70_BUSLIB) rpu_hw_if.c spi_if.c ) - zephyr_library_sources_ifdef(CONFIG_NRF71_ON_IPC - ipc_if.c - ipc_service.c - spsc_qm.c - ) endif() diff --git a/modules/nrf_wifi/bus/Kconfig b/modules/nrf_wifi/bus/Kconfig index 1fab99da46ff..da3644673b2d 100644 --- a/modules/nrf_wifi/bus/Kconfig +++ b/modules/nrf_wifi/bus/Kconfig @@ -23,15 +23,6 @@ config NRF70_ON_SPI $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF7000_SPI)) select SPI -config NRF71_ON_IPC - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF71_WIFI)) - select MBOX - select IPC_SERVICE - select SPSC_PBUF - help - nRF71 is a Wi-Fi and BLE combo SoC and uses IPC as a communication - between APP and Wi-Fi cores. - module = WIFI_NRF70_BUSLIB module-dep = LOG module-str = Log level for Wi-Fi nRF70 bus library diff --git a/modules/nrf_wifi/bus/device.c b/modules/nrf_wifi/bus/device.c index 611af2489c87..cd35e56618c2 100644 --- a/modules/nrf_wifi/bus/device.c +++ b/modules/nrf_wifi/bus/device.c @@ -15,23 +15,11 @@ #include #include -#if defined(CONFIG_NRF71_ON_IPC) -#include "ipc_if.h" -#else #include #include "spi_if.h" static struct qspi_config config; -#endif -#if defined(CONFIG_NRF71_ON_IPC) -static struct rpu_dev ipc = { - .init = ipc_init, - .deinit = ipc_deinit, - .send = ipc_send, - .recv = ipc_recv, - .register_rx_cb = ipc_register_rx_cb, -}; -#elif defined(CONFIG_NRF70_ON_QSPI) +#if defined(CONFIG_NRF70_ON_QSPI) static struct qspi_dev qspi = {.init = qspi_init, .deinit = qspi_deinit, .read = qspi_read, @@ -45,7 +33,6 @@ static struct qspi_dev spim = {.init = spim_init, .hl_read = spim_hl_read}; #endif -#ifndef CONFIG_NRF71_ON_IPC struct qspi_config *qspi_defconfig(void) { memset(&config, 0, sizeof(struct qspi_config)); @@ -83,9 +70,7 @@ struct qspi_config *qspi_get_config(void) { return &config; } -#endif -#ifndef CONFIG_NRF71_ON_IPC struct qspi_dev *qspi_dev(void) { #if defined(CONFIG_NRF70_ON_QSPI) @@ -94,9 +79,3 @@ struct qspi_dev *qspi_dev(void) return &spim; #endif } -#else -struct rpu_dev *rpu_dev(void) -{ - return &ipc; -} -#endif /*! CONFIG_NRF71_ON_IPC */ diff --git a/modules/nrf_wifi/bus/ipc_if.c b/modules/nrf_wifi/bus/ipc_if.c deleted file mode 100644 index cd2365a9af06..000000000000 --- a/modules/nrf_wifi/bus/ipc_if.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @brief File containing API definitions for the - * IPC bus layer of the nRF71 Wi-Fi driver. - */ -#include -#include - -LOG_MODULE_DECLARE(wifi_nrf_bus, CONFIG_WIFI_NRF70_BUSLIB_LOG_LEVEL); - -#include "ipc_if.h" -#include "bal_structs.h" -#include "qspi.h" -#include "common/hal_structs_common.h" - -/* Define addresses to use for the free queues */ -#define EVENT_FREEQ_ADDR 0x200C2000 -#define CMD_FREEQ_ADDR 0x200C3000 - -#define NUM_INSTANCES 3 -#define NUM_ENDPOINTS 1 - -struct device *ipc_instances[NUM_INSTANCES]; -struct ipc_ept ept[NUM_ENDPOINTS]; -struct ipc_ept_cfg ept_cfg[NUM_ENDPOINTS]; - -static wifi_ipc_t wifi_event; -static wifi_ipc_t wifi_cmd; -static wifi_ipc_t wifi_tx; - -static int (*callback_func)(void *data); - -static void event_recv(void *data, void *priv) -{ - struct nrf_wifi_bus_qspi_dev_ctx *dev_ctx = NULL; - struct nrf_wifi_bal_dev_ctx *bal_dev_ctx = NULL; - struct nrf_wifi_hal_dev_ctx *hal_dev_ctx = NULL; - - dev_ctx = (struct nrf_wifi_bus_qspi_dev_ctx *)priv; - bal_dev_ctx = (struct nrf_wifi_bal_dev_ctx *)dev_ctx->bal_dev_ctx; - hal_dev_ctx = (struct nrf_wifi_hal_dev_ctx *)bal_dev_ctx->hal_dev_ctx; - LOG_DBG("Event IPC received"); - - hal_dev_ctx->ipc_msg = data; - callback_func(priv); - LOG_DBG("Event IPC callback completed"); -} - -int ipc_init(void) -{ - wifi_ipc_host_event_init(&wifi_event, EVENT_FREEQ_ADDR); - LOG_DBG("Event IPC initialized"); - wifi_ipc_host_cmd_init(&wifi_cmd, CMD_FREEQ_ADDR); - LOG_DBG("Command IPC initialized"); - return 0; -} - -int ipc_deinit(void) -{ - return 0; -} - -int ipc_recv(ipc_ctx_t ctx, void *data, int len) -{ - return 0; -} - -int ipc_send(ipc_ctx_t ctx, const void *data, int len) -{ - - int ret = 0; - - switch (ctx.inst) { - case IPC_INSTANCE_CMD_CTRL: - /* IPC service on RPU may not have been established. Keep trying. */ - do { - ret = wifi_ipc_host_cmd_send_memcpy(&wifi_cmd, data, len); - } while (ret == WIFI_IPC_STATUS_BUSYQ_NOTREADY); - - /* Critical error during IPC service transfer. Should never happen. */ - if (ret == WIFI_IPC_STATUS_BUSYQ_CRITICAL_ERR) { - LOG_ERR("Critical error during IPC CMD busyq transfer"); - return -1; - } - break; - case IPC_INSTANCE_CMD_TX: - /* IPC service on RPU may not have been established. Keep trying. */ - do { - ret = wifi_ipc_host_tx_send(&wifi_tx, data); - } while (ret == WIFI_IPC_STATUS_BUSYQ_NOTREADY); - - /* Critical error during IPC service transfer. Should never happen. */ - if (ret == WIFI_IPC_STATUS_BUSYQ_CRITICAL_ERR) { - LOG_ERR("Critical error during IPC TX busyq transfer"); - return -1; - } - break; - case IPC_INSTANCE_RX: - break; - default: - break; - } - - LOG_DBG("IPC send completed: %d", ret); - - return ret; -} - -int ipc_register_rx_cb(int (*rx_handler)(void *priv), void *data) -{ - int ret; - - callback_func = rx_handler; - - ret = wifi_ipc_bind_ipc_service_tx_rx(&wifi_cmd, &wifi_event, - DEVICE_DT_GET(DT_NODELABEL(ipc0)), event_recv, data); - if (ret != WIFI_IPC_STATUS_OK) { - LOG_ERR("Failed to bind IPC service: %d", ret); - return -1; - } - - ret = wifi_ipc_bind_ipc_service(&wifi_tx, DEVICE_DT_GET(DT_NODELABEL(ipc1)), event_recv, - data); - if (ret != WIFI_IPC_STATUS_OK) { - LOG_ERR("Failed to bind IPC service: %d", ret); - return -1; - } - - return 0; -} diff --git a/modules/nrf_wifi/bus/ipc_if.h b/modules/nrf_wifi/bus/ipc_if.h deleted file mode 100644 index 5dbc2edf4f4d..000000000000 --- a/modules/nrf_wifi/bus/ipc_if.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef __IPC_IF_H__ -#define __IPC_IF_H__ - -#include -#include "ipc_service.h" - -typedef enum { - IPC_INSTANCE_CMD_CTRL = 0, - IPC_INSTANCE_CMD_TX, - IPC_INSTANCE_EVT, - IPC_INSTANCE_RX -} ipc_instances_nrf71_t; - -typedef enum { - IPC_EPT_UMAC = 0, - IPC_EPT_LMAC -} ipc_epts_nrf71_t; - -typedef struct ipc_ctx { - ipc_instances_nrf71_t inst; - ipc_epts_nrf71_t ept; -} ipc_ctx_t; - -struct rpu_dev { - int (*init)(); - int (*deinit)(void); - int (*send)(ipc_ctx_t ctx, const void *data, int len); - int (*recv)(ipc_ctx_t ctx, void *data, int len); - int (*register_rx_cb)(int (*rx_handler)(void *priv), void *data); -}; - -struct rpu_dev *rpu_dev(void); - -int ipc_init(void); -int ipc_deinit(void); -int ipc_send(ipc_ctx_t ctx, const void *data, int len); -/* Blocking Receive */ -int ipc_recv(ipc_ctx_t ctx, void *data, int len); -/* Non-blocking Receive (global, not per instance) */ -int ipc_register_rx_cb(int (*rx_handler)(void *priv), void *data); - -#endif /* __IPC_IF_H__ */ diff --git a/modules/nrf_wifi/bus/ipc_service.c b/modules/nrf_wifi/bus/ipc_service.c deleted file mode 100644 index e1e6b3cf4fb8..000000000000 --- a/modules/nrf_wifi/bus/ipc_service.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @brief File containing API definitions for the - * IPC service layer of the nrf71 Wi-Fi driver. - */ -#include -#include - -LOG_MODULE_REGISTER(wifi_nrf_bus, CONFIG_WIFI_NRF70_BUSLIB_LOG_LEVEL); - -#include "ipc_service.h" - -static void wifi_ipc_ep_bound(void *priv) -{ - wifi_ipc_t *context = (wifi_ipc_t *)priv; - - context->busy_q.ipc_ready = true; -} - -static void wifi_ipc_recv_callback(const void *data, size_t len, void *priv) -{ - (void)len; - uint32_t global_addr = *((uint32_t *)data); - - wifi_ipc_t *context = (wifi_ipc_t *)priv; - - context->busy_q.recv_cb((void *)global_addr, context->busy_q.priv); - - if (context->free_q != NULL) { - while (!spsc32_push(context->free_q, global_addr)) { - }; - } -} - -static void wifi_ipc_busyq_init(wifi_ipc_busyq_t *busyq, const ipc_device_wrapper_t *ipc_inst, - void *rx_cb, void *priv) -{ - busyq->ipc_inst = ipc_inst; - busyq->ipc_ep_cfg.cb.bound = wifi_ipc_ep_bound; - busyq->ipc_ep_cfg.cb.received = wifi_ipc_recv_callback; - busyq->recv_cb = rx_cb; - busyq->ipc_ready = false; - busyq->priv = priv; -} - -/** - * Register the IPC service on the busy_queue - */ -static wifi_ipc_status_t wifi_ipc_busyq_register(wifi_ipc_t *context) -{ - int ret; - const struct device *ipc_instance = GET_IPC_INSTANCE(context->busy_q.ipc_inst); - - ret = ipc_service_open_instance(ipc_instance); - if (ret < 0) { - return WIFI_IPC_STATUS_INIT_ERR; - } - - context->busy_q.ipc_ep_cfg.name = "ep"; - context->busy_q.ipc_ep_cfg.priv = context; - - ret = ipc_service_register_endpoint(ipc_instance, &context->busy_q.ipc_ep, - &context->busy_q.ipc_ep_cfg); - if (ret < 0 && ret != -EALREADY) { - return WIFI_IPC_STATUS_INIT_ERR; - } - - LOG_INF("IPC busy queue registered"); - - return WIFI_IPC_STATUS_OK; -} - -wifi_ipc_status_t wifi_ipc_bind_ipc_service(wifi_ipc_t *context, - const ipc_device_wrapper_t *ipc_inst, - void (*rx_cb)(void *data, void *priv), void *priv) -{ - wifi_ipc_busyq_init(&context->busy_q, ipc_inst, rx_cb, priv); - return wifi_ipc_busyq_register(context); -} - -wifi_ipc_status_t wifi_ipc_bind_ipc_service_tx_rx(wifi_ipc_t *tx, wifi_ipc_t *rx, - const ipc_device_wrapper_t *ipc_inst, - void (*rx_cb)(void *data, void *priv), void *priv) -{ - wifi_ipc_busyq_init(&rx->busy_q, ipc_inst, rx_cb, priv); - - /** - * When initialising an IPC service, both TX and RX mailboxes need to be - * registered at the same time using a single function call. Both tx and - * rx need to refer to the same IPC instance. - */ - tx->linked_ipc = &rx->busy_q; - - return wifi_ipc_busyq_register(rx); -} - -wifi_ipc_status_t wifi_ipc_freeq_get(wifi_ipc_t *context, uint32_t *data) -{ - if (context->free_q == NULL) { - LOG_ERR("Free queue is not initialised"); - return WIFI_IPC_STATUS_FREEQ_UNINIT_ERR; - } - - if (spsc32_is_empty(context->free_q)) { - LOG_DBG("Free queue is empty"); - return WIFI_IPC_STATUS_FREEQ_EMPTY; - } - - if (!spsc32_read_head(context->free_q, data)) { - LOG_DBG("Free queue is empty"); - return WIFI_IPC_STATUS_FREEQ_EMPTY; - } - - return WIFI_IPC_STATUS_OK; -} - -wifi_ipc_status_t wifi_ipc_freeq_send(wifi_ipc_t *context, uint32_t data) -{ - return (spsc32_push(context->free_q, data) == true ? WIFI_IPC_STATUS_OK - : WIFI_IPC_STATUS_FREEQ_FULL); -} - -wifi_ipc_status_t wifi_ipc_busyq_send(wifi_ipc_t *context, uint32_t *data) -{ - /* Get correct linked endpoint */ - wifi_ipc_busyq_t *busyq = - context->linked_ipc ? context->linked_ipc : &context->busy_q; - - if (!busyq->ipc_ready) { - LOG_ERR("IPC service is not ready"); - return WIFI_IPC_STATUS_BUSYQ_NOTREADY; - } - - int ret = ipc_service_send(&busyq->ipc_ep, data, sizeof(*data)); - - if (ret == -ENOMEM) { - LOG_ERR("No space in the buffer"); - /* No space in the buffer */ - return WIFI_IPC_STATUS_BUSYQ_FULL; - } else if (ret < 0) { - LOG_ERR("Critical IPC failure: %d", ret); - /* Critical IPC failure */ - return WIFI_IPC_STATUS_BUSYQ_CRITICAL_ERR; - } - - if (context->free_q != NULL) { - /* Free up global address pointer from the free queue */ - uint32_t data_out; - - return (spsc32_pop(context->free_q, &data_out) == true - ? (*data == data_out ? WIFI_IPC_STATUS_OK - : WIFI_IPC_STATUS_FREEQ_INVALID) - : WIFI_IPC_STATUS_FREEQ_EMPTY); - } - - return WIFI_IPC_STATUS_OK; -} - -wifi_ipc_status_t wifi_ipc_host_cmd_init(wifi_ipc_t *context, uint32_t addr_freeq) -{ - context->free_q = (void *)addr_freeq; - return WIFI_IPC_STATUS_OK; -} - -wifi_ipc_status_t wifi_ipc_host_event_init(wifi_ipc_t *context, uint32_t addr_freeq) -{ - context->free_q = (void *)addr_freeq; - return WIFI_IPC_STATUS_OK; -} - -wifi_ipc_status_t wifi_ipc_host_cmd_get(wifi_ipc_t *context, uint32_t *data) -{ - return wifi_ipc_freeq_get(context, data); -} - -wifi_ipc_status_t wifi_ipc_host_cmd_send(wifi_ipc_t *context, uint32_t *data) -{ - return wifi_ipc_busyq_send(context, data); -} - -wifi_ipc_status_t wifi_ipc_host_cmd_send_memcpy(wifi_ipc_t *context, const void *msg, - size_t len) -{ - int ret; - uint32_t gdram_addr; - - ret = wifi_ipc_host_cmd_get(context, &gdram_addr); - if (ret != WIFI_IPC_STATUS_OK) { - LOG_ERR("Failed to get command location from free queue: %d", ret); - return ret; - } - - memcpy((void *)gdram_addr, msg, len); - - return wifi_ipc_host_cmd_send(context, &gdram_addr); -} - -wifi_ipc_status_t wifi_ipc_host_tx_send(wifi_ipc_t *context, const void *msg) -{ - return wifi_ipc_host_cmd_send(context, (uint32_t *)&msg); -} diff --git a/modules/nrf_wifi/bus/ipc_service.h b/modules/nrf_wifi/bus/ipc_service.h deleted file mode 100644 index 3d355e0c23a9..000000000000 --- a/modules/nrf_wifi/bus/ipc_service.h +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef IPC_SERVICE_H -#define IPC_SERVICE_H - -#include -#include -#include "spsc_qm.h" - -#define GET_IPC_INSTANCE(dev) (dev) -typedef struct device ipc_device_wrapper_t; - -#include -#include - -/* - * Must be large enough to contain the internal struct (spsc_pbuf struct) and - * at least two bytes of data (one is reserved for written message length) - */ -#define _MIN_SPSC_SIZE (sizeof(spsc_queue_t) + sizeof(uint32_t)) -/* - * TODO: Unsure why some additional bytes are needed for overhead. - */ -#define WIFI_IPC_GET_SPSC_SIZE(x) (_MIN_SPSC_SIZE + 12 + (x)) - -/* 4 x cmd location 32-bit pointers of 400 bytes each */ -#define WIFI_IPC_CMD_SIZE 400 -#define WIFI_IPC_CMD_NUM 4 -#define WIFI_IPC_CMD_SPSC_SIZE WIFI_IPC_GET_SPSC_SIZE(WIFI_IPC_CMD_NUM * sizeof(uint32_t)) - -/* 7 x event location 32-bit pointers of 1000 bytes each */ -#define WIFI_IPC_EVENT_SIZE 1000 -#define WIFI_IPC_EVENT_NUM 7 -#define WIFI_IPC_EVENT_SPSC_SIZE WIFI_IPC_GET_SPSC_SIZE(WIFI_IPC_EVENT_NUM * sizeof(uint32_t)) - -/** - * @enum wifi_ipc_status_t - * @brief Status codes for the Wi-Fi IPC service. - * - * This enumeration defines various status codes that represent - * the state or result of operations in the Wi-Fi IPC service. - */ -typedef enum { - /** Status indicating the operation completed successfully. */ - WIFI_IPC_STATUS_OK = 0, - - /** Error indicating failure to register IPC service for the Busy queue. */ - WIFI_IPC_STATUS_INIT_ERR, - - /** Error indicating that the Free queue has not been initialized. */ - WIFI_IPC_STATUS_FREEQ_UNINIT_ERR, - - /** Status indicating that the Free queue is empty. */ - WIFI_IPC_STATUS_FREEQ_EMPTY, - - /** Error indicating that the value passed to wifi_ipc_busyq_send() - * does not match the value from the Free queue. - */ - WIFI_IPC_STATUS_FREEQ_INVALID, - - /** Status indicating that the Free queue is full. */ - WIFI_IPC_STATUS_FREEQ_FULL, - - /** Error indicating that the IPC service for the Busy queue connection - * has not been established. - */ - WIFI_IPC_STATUS_BUSYQ_NOTREADY, - - /** Status indicating that the Busy queue is full. */ - WIFI_IPC_STATUS_BUSYQ_FULL, - - /** Critical error indicating an IPC transfer failure. This should never happen. */ - WIFI_IPC_STATUS_BUSYQ_CRITICAL_ERR, -} wifi_ipc_status_t; - -/** - * Structure to hold context information for busy queue. - */ -typedef struct { - const ipc_device_wrapper_t *ipc_inst; - struct ipc_ept ipc_ep; - struct ipc_ept_cfg ipc_ep_cfg; - void (*recv_cb)(const void *data, const void *priv); - const void *priv; - volatile bool ipc_ready; -} wifi_ipc_busyq_t; - -/** - * Top-level structure to hold context information for sending data between RPU - * and the Host. - */ -typedef struct { - spsc_queue_t *free_q; - - wifi_ipc_busyq_t busy_q; - wifi_ipc_busyq_t *linked_ipc; -} wifi_ipc_t; - -/** - * Performs memory-to-memory copy via MVDMA. - * - * Enters low power state by issuing wait-for-interrupt (WFI) while waiting for - * MVDMA event to complete. - * - * @param[in] p_dest : Pointer to destination memory to be copied to. - * @param[in] p_src : Pointer to source memory to be copied from. - * @param[in] len : Number of bytes to be copied. - */ -void wifi_ipc_mvdma_copy(void *p_dest, const void *p_src, size_t len); - -/** - * Bind either TX or RX context to one IPC service. This utilises the half-duplex - * capability of the IPC service. - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[in] ipc_inst : Pointer to the IPC instance. - * @param[in] rx_cb : If binding RX context, this is the callback function. - * Leave NULL if binding to a TX. - * @param[in] priv : If binding RX context, this is the private data to be passed - * along with the callback function. - * Leave NULL if binding to a TX. - * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_init_err. - */ -wifi_ipc_status_t wifi_ipc_bind_ipc_service(wifi_ipc_t *p_context, - const ipc_device_wrapper_t *ipc_inst, - void (*rx_cb)(void *data, void *priv), void *priv); - -/** - * Bind both TX and RX contexts to a single IPC service. This utilises the - * full-duplex capability of the IPC service. - * - * @param[in] p_tx : Pointer to wifi_ipc_t struct to bind IPC TX mailbox to. - * @param[in] p_rx : Pointer to wifi_ipc_t struct to bind IPC RX mailbox to. - * @param[in] ipc_inst : Pointer to the IPC instance. - * @param[in] rx_cb : Callback function to bind to data in received from RX mailbox. - * @param[in] priv : Private data to the callback function. - * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_init_err. - */ -wifi_ipc_status_t wifi_ipc_bind_ipc_service_tx_rx(wifi_ipc_t *p_tx, wifi_ipc_t *p_rx, - const ipc_device_wrapper_t *ipc_inst, - void (*rx_cb)(void *data, void *priv), - void *priv); - -/** - * Get data from the free queue. - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[out] data : Pointer to the data to read to. - * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_freeq_empty. - */ -wifi_ipc_status_t wifi_ipc_freeq_get(wifi_ipc_t *p_context, uint32_t *data); - -/** - * Send data to the free queue. - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[in] data : 32-bit data to send. - * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_freeq_full. - */ -wifi_ipc_status_t wifi_ipc_freeq_send(wifi_ipc_t *p_context, uint32_t data); - -/** - * Send data to the busy queue over IPC service, and pop the same data from the - * free queue. - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[in] data : Pointer to the data to send to. - * @return : wifi_ipc_status_ok if successful, otherwise one of the following: - * - wifi_ipc_status_busyq_notready - * - wifi_ipc_status_busyq_full - * - wifi_ipc_status_busyq_critical_err - * - wifi_ipc_status_freeq_invalid - * - wifi_ipc_status_freeq_empty - */ -wifi_ipc_status_t wifi_ipc_busyq_send(wifi_ipc_t *p_context, uint32_t *data); - -/** - * Prepares and initialises the Host for sending a command to RPU. - * - * The free queue points to the already allocated free queue from the RPU. - * - * The busy queue using IPC service must be initialised using @see wifi_ipc_bind_ipc_service() - * or @see wifi_ipc_bind_ipc_service_tx_rx(). - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[in] addr_freeq : Address of the allocated free queue. - * @return : wifi_ipc_status_ok if successful. - */ -wifi_ipc_status_t wifi_ipc_host_cmd_init(wifi_ipc_t *p_context, uint32_t addr_freeq); - -/** - * Prepares and initialises the Host for receiving an event from RPU. - * - * The free queue points to the already allocated free queue from the RPU. - * - * The busy queue using IPC service must be initialised using @see wifi_ipc_bind_ipc_service() - * or @see wifi_ipc_bind_ipc_service_tx_rx(). - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[in] addr_freeq : Address of the allocated SPSC free queue. - * @return : wifi_ipc_status_ok if successful. - */ -wifi_ipc_status_t wifi_ipc_host_event_init(wifi_ipc_t *p_context, uint32_t addr_freeq); - -/** - * Get a command location from the free queue. - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[out] p_data : Pointer to data to write event location to. - * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_freeq_empty. - */ -wifi_ipc_status_t wifi_ipc_host_cmd_get(wifi_ipc_t *p_context, uint32_t *p_data); - -/** - * Send an event location pointer to the Host and frees up the event location - * pointer from the free queue. - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[in] p_data : Pointer to command location to be sent. - * @return : wifi_ipc_status_ok if successful, otherwise one of the following - * - wifi_ipc_status_busyq_notready - * - wifi_ipc_status_busyq_full - * - wifi_ipc_status_busyq_critical_err - * - wifi_ipc_status_freeq_invalid - * - wifi_ipc_status_freeq_empty - */ -wifi_ipc_status_t wifi_ipc_host_cmd_send(wifi_ipc_t *p_context, uint32_t *p_data); - -/** - * Send a command from the Host to RPU using standard memcpy. - * - * 1. Retrieves an address pointer of Packet RAM from the free queue. - * 2. Copies local message to the retrieved address pointer via memcpy. - * 3. Sends the address pointer to the busy queue via IPC service. - * 4. Upon successful transmission, removes the address pointer the free queue. - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[in] p_msg : Pointer the local message to be copied to Packet RAM via memcpy. - * @param[in] len : Length of the local message in bytes. - * @return : wifi_ipc_status_ok if send is successful, otherwise one of - * status code from wifi_ipc_status_t will be returned. - */ -wifi_ipc_status_t wifi_ipc_host_cmd_send_memcpy(wifi_ipc_t *p_context, const void *p_msg, - size_t len); - -/** - * Send a tx data pointer from the Host to RPU and raises RPU interrupt. - * - * @param[in] p_context : Pointer to wifi_ipc_t struct. - * @param[in] p_msg : Pointer to message. - * @return : wifi_ipc_status_ok if send is successful, otherwise one of - * status code from wifi_ipc_status_t will be returned. - */ -wifi_ipc_status_t wifi_ipc_host_tx_send(wifi_ipc_t *p_context, const void *p_msg); - -#endif /* IPC_SERVICE_H */ diff --git a/modules/nrf_wifi/bus/spsc_qm.c b/modules/nrf_wifi/bus/spsc_qm.c deleted file mode 100644 index 01da1b5e8973..000000000000 --- a/modules/nrf_wifi/bus/spsc_qm.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @brief File containing API definitions for the - * SPSC queue management layer of the nRF71 Wi-Fi driver. - */ -#include -#include - -LOG_MODULE_DECLARE(wifi_nrf_bus, CONFIG_WIFI_NRF70_BUSLIB_LOG_LEVEL); - -#include "spsc_qm.h" - -spsc_queue_t *spsc32_init(uint32_t address, size_t size) -{ - return spsc_pbuf_init((void *)address, size, 0); -} - -bool spsc32_push(spsc_queue_t *queue, uint32_t value) -{ - char *pbuf; - uint8_t len = sizeof(uint32_t); - - if (spsc_pbuf_alloc(queue, len, &pbuf) != len) { - LOG_ERR("%s: Failed to allocate buffer", __func__); - return false; - } - - memcpy(pbuf, &value, len); - spsc_pbuf_commit(queue, len); - - return true; -} - -bool spsc32_pop(spsc_queue_t *queue, uint32_t *out_value) -{ - char *buf; - uint16_t plen = spsc_pbuf_claim(queue, &buf); - - if (plen == 0) { - LOG_ERR("%s: Failed to claim buffer", __func__); - return false; - } - - spsc_pbuf_free(queue, plen); - - *out_value = *((uint32_t *)buf); - - return true; -} - -bool spsc32_read_head(spsc_queue_t *queue, uint32_t *out_value) -{ - char *buf; - uint16_t plen = spsc_pbuf_claim(queue, &buf); - - if (plen == 0) { - LOG_ERR("%s: Failed to claim buffer", __func__); - return false; - } - - *out_value = *((uint32_t *)buf); - - return true; -} - -bool spsc32_is_empty(spsc_queue_t *queue) -{ - char *buf; - - return spsc_pbuf_claim(queue, &buf) == 0; -} - -bool spsc32_is_full(spsc_queue_t *queue) -{ - char *pbuf; - uint8_t len = sizeof(uint32_t); - - return spsc_pbuf_alloc(queue, len, &pbuf) != len; -} diff --git a/modules/nrf_wifi/bus/spsc_qm.h b/modules/nrf_wifi/bus/spsc_qm.h deleted file mode 100644 index 063cb470b525..000000000000 --- a/modules/nrf_wifi/bus/spsc_qm.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @brief File containing API definitions for the - * SPSC queue management layer of the nRF71 Wi-Fi driver. - - * SPSC Queue Manager API for handling 32-bit values. - * - * The Queue Manager API for Single-Producer, Single-Consumer (SPSC) queue. This - * API allows queues to be allocated, pushed and popped. - */ - -#ifndef SPSC_QM_H -#define SPSC_QM_H - -#include - -#include -#include - -typedef struct spsc_pbuf spsc_queue_t; - -/** - * Initialise and allocate SPSC queue. - * - * @param[in] address : Address to allocate. - * @param[in] size : Size in bytes to allocate. - * @return : SPSC packet queue. - */ -spsc_queue_t *spsc32_init(uint32_t address, size_t size); - -/** - * Push a value onto the tail of a queue. - * - * @param[in] pb : Pointer to SPSC packet queue. - * @param[in] value : The value to push to the queue. - * @return : true if push is successful, false otherwise. - */ -bool spsc32_push(spsc_queue_t *pb, uint32_t value); - -/** - * Pop a value from the head of a queue and return it. - * - * @param[in] pb : Pointer to SPSC packet queue. - * @param[out] out_value : Pointer to the value to pop to. - * @return : true if pop is successful, false otherwise. - */ -bool spsc32_pop(spsc_queue_t *pb, uint32_t *out_value); - -/** - * Return a value at the head of a queue without popping it. - * - * @param[in] pb : Pointer to SPSC packet queue. - * @param[out] out_value : Pointer to value to read from the head of the queue. - * @return : true if read is successful, false otherwise. - */ -bool spsc32_read_head(spsc_queue_t *pb, uint32_t *out_value); - -/** - * Test whether a queue is empty. - * - * @param[in] pb : Pointer to SPSC packet queue. - * @return : true if the queue is empty, false otherwise. - */ -bool spsc32_is_empty(spsc_queue_t *pb); - -/** - * Test whether a queue is full. - * - * @param[in] pb : Pointer to SPSC packet queue. - * @return : true if the queue is full, false otherwise. - */ -bool spsc32_is_full(spsc_queue_t *pb); - -#endif /* SPSC_QM_H */ diff --git a/modules/nrf_wifi/os/CMakeLists.txt b/modules/nrf_wifi/os/CMakeLists.txt index ce1c9a850c88..e4f9cf2a0b6d 100644 --- a/modules/nrf_wifi/os/CMakeLists.txt +++ b/modules/nrf_wifi/os/CMakeLists.txt @@ -15,13 +15,5 @@ zephyr_library_sources( timer.c work.c ) -zephyr_include_directories_ifdef(CONFIG_NRF71_ON_IPC - ${CMAKE_CURRENT_LIST_DIR}/../bus/ - ${CMAKE_CURRENT_LIST_DIR}/../hw_if/hal/inc -) - -zephyr_library_compile_definitions_ifdef(CONFIG_NRF71_ON_IPC - NRF71_ON_IPC -) zephyr_library_link_libraries(nrf-wifi-osal) diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index 99224b665338..61f1baf500ab 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -18,12 +18,8 @@ #include #include #include -#ifdef CONFIG_NRF71_ON_IPC -#include "ipc_if.h" -#else #include #include -#endif /* CONFIG_NRF71_ON_IPC */ #include #include "shim.h" @@ -140,7 +136,6 @@ static int zep_shim_mem_cmp(const void *addr1, return memcmp(addr1, addr2, size); } -#ifndef CONFIG_NRF71_ON_IPC static unsigned int zep_shim_qspi_read_reg32(void *priv, unsigned long addr) { unsigned int val; @@ -193,7 +188,6 @@ static void zep_shim_qspi_cpy_to(void *priv, unsigned long addr, const void *src dev->write(addr, src, count_aligned); } -#endif /* !CONFIG_NRF71_ON_IPC */ static void *zep_shim_spinlock_alloc(void) { @@ -882,56 +876,14 @@ static enum nrf_wifi_status zep_shim_bus_qspi_dev_init(void *os_qspi_dev_ctx) static void zep_shim_bus_qspi_dev_deinit(void *priv) { struct zep_shim_bus_qspi_priv *qspi_priv = priv; -#ifndef CONFIG_NRF71_ON_IPC volatile struct qspi_dev *dev = qspi_priv->qspi_dev; -#else - volatile struct rpu_dev *dev = qspi_priv->qspi_dev; -#endif /* !CONFIG_NRF71_ON_IPC */ dev->deinit(); } -#ifdef CONFIG_NRF71_ON_IPC -static int ipc_send_msg(unsigned int msg_type, void *msg, unsigned int len) -{ - enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; - struct rpu_dev *dev = rpu_dev(); - int ret; - ipc_ctx_t ctx; - - switch (msg_type) { - case NRF_WIFI_HAL_MSG_TYPE_CMD_CTRL: - ctx.inst = IPC_INSTANCE_CMD_CTRL; - ctx.ept = IPC_EPT_UMAC; - break; - case NRF_WIFI_HAL_MSG_TYPE_CMD_DATA_TX: - ctx.inst = IPC_INSTANCE_CMD_TX; - ctx.ept = IPC_EPT_UMAC; - break; - case NRF_WIFI_HAL_MSG_TYPE_CMD_DATA_RX: - ctx.inst = IPC_INSTANCE_RX; - ctx.ept = IPC_EPT_LMAC; - break; - default: - nrf_wifi_osal_log_err("%s: Invalid msg_type (%d)", __func__, msg_type); - goto out; - }; - - ret = dev->send(ctx, msg, len); - if (ret < 0) { - nrf_wifi_osal_log_err("%s: Sending message to RPU failed\n", __func__); - goto out; - } - - status = NRF_WIFI_STATUS_SUCCESS; -out: - return status; -} -#endif /* CONFIG_NRF71_ON_IPC */ static void *zep_shim_bus_qspi_dev_add(void *os_qspi_priv, void *osal_qspi_dev_ctx) { struct zep_shim_bus_qspi_priv *zep_qspi_priv = os_qspi_priv; -#ifndef CONFIG_NRF71_ON_IPC struct qspi_dev *dev = qspi_dev(); int ret; enum nrf_wifi_status status; @@ -953,11 +905,6 @@ static void *zep_shim_bus_qspi_dev_add(void *os_qspi_priv, void *osal_qspi_dev_c LOG_ERR("%s: RPU enable failed with error %d", __func__, ret); return NULL; } -#else - struct rpu_dev *dev = rpu_dev(); - - dev->init(); -#endif /* !CONFIG_NRF71_ON_IPC */ zep_qspi_priv->qspi_dev = dev; zep_qspi_priv->dev_added = true; @@ -971,10 +918,8 @@ static void zep_shim_bus_qspi_dev_rem(void *priv) ARG_UNUSED(dev); -#ifndef CONFIG_NRF71_ON_IPC /* TODO: Make qspi_dev a dynamic instance and remove it here */ rpu_disable(); -#endif /* !CONFIG_NRF71_ON_IPC */ } static void *zep_shim_bus_qspi_init(void) @@ -1032,7 +977,6 @@ static void zep_shim_bus_qspi_dev_host_map_get(void *os_qspi_dev_ctx, host_map->addr = 0; } -#ifndef CONFIG_NRF71_ON_IPC static void irq_work_handler(struct k_work *work) { int ret = 0; @@ -1065,7 +1009,6 @@ static void zep_shim_irq_handler(const struct device *dev, struct gpio_callback k_work_schedule_for_queue(&zep_wifi_intr_q, &intr_priv->work, K_NO_WAIT); } -#endif /* !CONFIG_NRF71_ON_IPC */ static enum nrf_wifi_status zep_shim_bus_qspi_intr_reg(void *os_dev_ctx, void *callbk_data, int (*callbk_fn)(void *callbk_data)) @@ -1075,14 +1018,6 @@ static enum nrf_wifi_status zep_shim_bus_qspi_intr_reg(void *os_dev_ctx, void *c ARG_UNUSED(os_dev_ctx); -#ifdef CONFIG_NRF71_ON_IPC - ret = ipc_register_rx_cb(callbk_fn, callbk_data); - if (ret) { - LOG_ERR("%s: ipc_register_rx_cb failed\n", __func__); - goto out; - } - status = NRF_WIFI_STATUS_SUCCESS; -#else intr_priv = zep_shim_mem_zalloc(sizeof(*intr_priv)); if (!intr_priv) { @@ -1105,20 +1040,16 @@ static enum nrf_wifi_status zep_shim_bus_qspi_intr_reg(void *os_dev_ctx, void *c } status = NRF_WIFI_STATUS_SUCCESS; -#endif /* CONFIG_NRF71_ON_IPC */ out: return status; } static void zep_shim_bus_qspi_intr_unreg(void *os_qspi_dev_ctx) { -#ifndef CONFIG_NRF71_ON_IPC struct k_work_sync sync; int ret; -#endif /* !CONFIG_NRF71_ON_IPC */ ARG_UNUSED(os_qspi_dev_ctx); -#ifndef CONFIG_NRF71_ON_IPC ret = rpu_irq_remove(&intr_priv->gpio_cb_data); if (ret) { LOG_ERR("%s: rpu_irq_remove failed", __func__); @@ -1129,7 +1060,6 @@ static void zep_shim_bus_qspi_intr_unreg(void *os_qspi_dev_ctx) zep_shim_mem_free(intr_priv); intr_priv = NULL; -#endif /*! CONFIG_NRF71_ON_IPC */ } #ifdef CONFIG_NRF_WIFI_LOW_POWER @@ -1210,12 +1140,10 @@ const struct nrf_wifi_osal_ops nrf_wifi_os_zep_ops = { .mem_cpy = zep_shim_mem_cpy, .mem_set = zep_shim_mem_set, .mem_cmp = zep_shim_mem_cmp, -#ifndef CONFIG_NRF71_ON_IPC .qspi_read_reg32 = zep_shim_qspi_read_reg32, .qspi_write_reg32 = zep_shim_qspi_write_reg32, .qspi_cpy_from = zep_shim_qspi_cpy_from, .qspi_cpy_to = zep_shim_qspi_cpy_to, -#endif /* CONFIG_NRF71_ON_IPC */ .spinlock_alloc = zep_shim_spinlock_alloc, .spinlock_free = zep_shim_spinlock_free, .spinlock_init = zep_shim_spinlock_init, @@ -1302,7 +1230,4 @@ const struct nrf_wifi_osal_ops nrf_wifi_os_zep_ops = { #endif /* CONFIG_NRF_WIFI_LOW_POWER */ .assert = zep_shim_assert, .strlen = zep_shim_strlen, -#ifdef CONFIG_NRF71_ON_IPC - .ipc_send_msg = ipc_send_msg, -#endif /* CONFIG_NRF71_ON_IPC */ }; diff --git a/subsys/ipc/ipc_service/lib/Kconfig.icmsg b/subsys/ipc/ipc_service/lib/Kconfig.icmsg index fa84c399ffb5..6bbc79d4fa2a 100644 --- a/subsys/ipc/ipc_service/lib/Kconfig.icmsg +++ b/subsys/ipc/ipc_service/lib/Kconfig.icmsg @@ -43,7 +43,6 @@ if IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE config IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE int "Size of RX work queue stack" - default 5400 if NRF71_ON_IPC default 1280 help Size of stack used by work queue RX thread. This work queue is From 03f5365ee9bc2663454ef9ffd9b0f0613ed7e41e Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Thu, 5 Feb 2026 00:56:46 +0530 Subject: [PATCH 1847/3334] [nrf fromtree] manifest: nrf_wifi: Pull nRF71 removal Pull nRF71 removal. Signed-off-by: Chaitanya Tata (cherry picked from commit 82c4af69ff20a89d2528e9469ffe3994ac0e29d2) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 55772b9fc8a0..f1ca6eb10401 100644 --- a/west.yml +++ b/west.yml @@ -347,7 +347,7 @@ manifest: revision: 4d11a73d62bf999205f16de21a0ef675501f5b21 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 29afb11a512787bc68e2afd58c9dfde4bb4d5dc4 + revision: 1e37ff7a739173cfe7adb248f9637d385a36c96b path: modules/lib/nrf_wifi - name: open-amp revision: 5efe7974f9546582e99f5a842a816ea4b65f5227 From 85eb0216f06c95701dceeee4dcd73d6086c94138 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 10 Feb 2026 13:24:04 +0530 Subject: [PATCH 1848/3334] [nrf fromtree] modules: nrf_wifi: Fix missing prototype Fix the build error. Signed-off-by: Chaitanya Tata (cherry picked from commit c945ea2f51dcecd4e01a5adad83b023924632617) --- modules/nrf_wifi/bus/rpu_hw_if.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/nrf_wifi/bus/rpu_hw_if.c b/modules/nrf_wifi/bus/rpu_hw_if.c index 004c820c6322..385157d3aa69 100644 --- a/modules/nrf_wifi/bus/rpu_hw_if.c +++ b/modules/nrf_wifi/bus/rpu_hw_if.c @@ -70,6 +70,8 @@ uint32_t rpu_7002_memmap[][3] = { static const struct qspi_dev *qdev; static struct qspi_config *cfg; +static int rpu_gpio_remove(void); + static int validate_addr_blk(uint32_t start_addr, uint32_t end_addr, uint32_t block_no, From 920d7d68c9aec870e079f7c3aa9172f9a3c6b148 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 10 Feb 2026 13:38:23 +0530 Subject: [PATCH 1849/3334] [nrf fromtree] tests: drivers: nrf_wifi: Add a combo for coex This tests the SR coex parts, we found a build error recently. Signed-off-by: Chaitanya Tata (cherry picked from commit 1edcc91f273af91f088826eede53640d6b38945c) --- tests/drivers/wifi/nrf_wifi/testcase.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/drivers/wifi/nrf_wifi/testcase.yaml b/tests/drivers/wifi/nrf_wifi/testcase.yaml index 6dc68db29a97..52928ac6386a 100644 --- a/tests/drivers/wifi/nrf_wifi/testcase.yaml +++ b/tests/drivers/wifi/nrf_wifi/testcase.yaml @@ -48,3 +48,11 @@ tests: extra_configs: - CONFIG_NET_STATISTICS_ETHERNET=y - CONFIG_NET_STATISTICS_ETHERNET_VENDOR=y + drivers.wifi.build.sr_coex: + extra_configs: + - CONFIG_NRF70_SR_COEX=y + extra_args: SHIELD=nrf7002ek + platform_allow: + - nrf5340dk/nrf5340/cpuapp + platform_exclude: + - nrf7002dk/nrf5340/cpuapp From 211ea93cee38eb34486cb6083777bfd6d2db00ab Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 13 Feb 2026 17:28:12 +0530 Subject: [PATCH 1850/3334] [nrf fromlist] dts: Fix nRF71 Wi-Fi bindings Match to the DTS entry and use the specific chip instead of the series. Upstream PR #: 104055 Signed-off-by: Chaitanya Tata --- MAINTAINERS.yml | 2 +- .../{nordic,nrf71-wifi.yaml => nordic,nrf7120-wifi.yaml} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename dts/bindings/wifi/{nordic,nrf71-wifi.yaml => nordic,nrf7120-wifi.yaml} (56%) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index dc801509a465..efdd9e61ecd9 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -2638,7 +2638,7 @@ Documentation Infrastructure: - dts/bindings/wifi/nordic,nrf7000-spi.yaml - dts/bindings/wifi/nordic,nrf7001-qspi.yaml - dts/bindings/wifi/nordic,nrf7001-spi.yaml - - dts/bindings/wifi/nordic,nrf71-wifi.yaml + - dts/bindings/wifi/nordic,nrf7120-wifi.yaml - boards/shields/nrf7002ek/ labels: - "area: Wi-Fi" diff --git a/dts/bindings/wifi/nordic,nrf71-wifi.yaml b/dts/bindings/wifi/nordic,nrf7120-wifi.yaml similarity index 56% rename from dts/bindings/wifi/nordic,nrf71-wifi.yaml rename to dts/bindings/wifi/nordic,nrf7120-wifi.yaml index 41f5acd86d08..6c0ba480dcc7 100644 --- a/dts/bindings/wifi/nordic,nrf71-wifi.yaml +++ b/dts/bindings/wifi/nordic,nrf7120-wifi.yaml @@ -2,10 +2,10 @@ # SPDX-License-Identifier: Apache-2.0 description: > - This is a representation of the Wi-Fi parts of the nRF71 Series Wi-Fi and - Bluetooth chip SoC. + Wi-Fi domain of nRF7120 Wi-Fi and + Bluetooth combo SoC. -compatible: "nordic,nrf71-wifi" +compatible: "nordic,nrf7120-wifi" include: - "wifi-tx-power-2g.yaml" From 75a8753c2fc4f603ecacf1b70a04374d18b5a6bc Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 16 Feb 2026 11:36:21 +0200 Subject: [PATCH 1851/3334] [nrf noup] boards: nordic: thingy53: ns: default to minimal TF-M profile The default TF-M profile in NCS was changed from MINIMAL (an NCS construct) to NOT_SET. The Thingy:53 has static PM files which give little space for TF-M so it needs to continue defaulting to the minimal TF-M profile. Signed-off-by: Tomi Fontanilles --- boards/nordic/thingy53/Kconfig.defconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 2809fd1eafc9..c75f7bfee6d5 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -21,6 +21,14 @@ config BOOTLOADER_MCUBOOT config BOARD_ENABLE_CPUNET default y if !MCUBOOT +if BUILD_WITH_TFM + +choice TFM_PROFILE_TYPE + default TFM_PROFILE_TYPE_MINIMAL +endchoice + +endif # BUILD_WITH_TFM + # Code Partition: # # For the secure version of the board the firmware is linked at the beginning From 570faba6cf5cfcc9ab9e8fd048336ffdf80e0cdc Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Mon, 9 Feb 2026 12:41:22 +0100 Subject: [PATCH 1852/3334] [nrf fromtree] Bluetooth: Host: Use HCI VS command to set public addr on bt_enable The current way of setting the public address using `bt_hci_driver_api::setup` does not work well in split builds where host and controller runs on different cores/socs/boards. This approach requires each HCI driver and each `hci_` application to implement the setup and pass the information on to the next layer. Zephyr already defines a vendor-specific command that can be used to set the public address (`bt_hci_cp_vs_write_bd_addr`). Use this in `bt_enable` after opening the HCI transport and before initializing the id module. This makes the setup independent of hci transport and only depends on a controller that implements the Zephyr HCI VS commands. Signed-off-by: Herman Berget (cherry picked from commit 62e12edb19fbdbfd11da9725216ed3705fe83c03) Signed-off-by: Herman Berget --- include/zephyr/bluetooth/hci_vs.h | 3 +++ subsys/bluetooth/host/hci_core.c | 27 +++++++++++++++++++ subsys/bluetooth/host/id.c | 3 ++- .../src/test_suite_invalid_inputs.c | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/include/zephyr/bluetooth/hci_vs.h b/include/zephyr/bluetooth/hci_vs.h index 51e7b19cdddb..3e79d5ad1dde 100644 --- a/include/zephyr/bluetooth/hci_vs.h +++ b/include/zephyr/bluetooth/hci_vs.h @@ -38,6 +38,9 @@ extern "C" { #define BT_VS_CMD_SUP_FEAT(cmd) BT_LE_FEAT_TEST(cmd, \ BT_VS_CMD_BIT_SUP_FEAT) +/** Check if HCI VS command BT_VS_CMD_BIT_WRITE_BDADDR is supported */ +#define BT_VS_CMD_WRITE_BD_ADDR(cmd) BT_LE_FEAT_TEST(cmd, \ + BT_VS_CMD_BIT_WRITE_BDADDR) #define BT_VS_CMD_READ_STATIC_ADDRS(cmd) BT_LE_FEAT_TEST(cmd, \ BT_VS_CMD_BIT_READ_STATIC_ADDRS) #define BT_VS_CMD_READ_KEY_ROOTS(cmd) BT_LE_FEAT_TEST(cmd, \ diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 82c429aef9d6..9573f714fa1f 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4262,6 +4262,22 @@ static void hci_vs_init(void) net_buf_unref(rsp); } } + +static int hci_vs_write_bd_addr(bt_addr_t *bdaddr) +{ + struct bt_hci_cp_vs_write_bd_addr *cp; + struct net_buf *buf; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (buf == NULL) { + return -ENOBUFS; + } + + cp = net_buf_add(buf, sizeof(*cp)); + bt_addr_copy(&cp->bdaddr, bdaddr); + + return bt_hci_cmd_send_sync(BT_HCI_OP_VS_WRITE_BD_ADDR, buf, NULL); +} #endif /* CONFIG_BT_HCI_VS */ static int hci_init(void) @@ -4317,6 +4333,17 @@ static int hci_init(void) #if defined(CONFIG_BT_HCI_VS) hci_vs_init(); + + if (bt_dev.id_count > 0U && bt_dev.id_addr[BT_ID_DEFAULT].type == BT_ADDR_LE_PUBLIC) { + if (BT_VS_CMD_WRITE_BD_ADDR(bt_dev.vs_commands)) { + err = hci_vs_write_bd_addr(&bt_dev.id_addr[BT_ID_DEFAULT].a); + if (err != 0) { + return err; + } + } else if (!IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR)) { + return -ENOTSUP; + } + } #endif err = bt_id_init(); if (err) { diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 4c54460ab4df..7ff4c0de3d11 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -1550,7 +1550,8 @@ int bt_id_create(bt_addr_le_t *addr, uint8_t *irk) return -EALREADY; } - if (addr->type == BT_ADDR_LE_PUBLIC && IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR)) { + if (addr->type == BT_ADDR_LE_PUBLIC && + (IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR) || IS_ENABLED(CONFIG_BT_HCI_VS))) { /* set the single public address */ if (bt_dev.id_count != 0) { return -EALREADY; diff --git a/tests/bluetooth/host/id/bt_id_create/src/test_suite_invalid_inputs.c b/tests/bluetooth/host/id/bt_id_create/src/test_suite_invalid_inputs.c index e803694326ac..9f832568bd6b 100644 --- a/tests/bluetooth/host/id/bt_id_create/src/test_suite_invalid_inputs.c +++ b/tests/bluetooth/host/id/bt_id_create/src/test_suite_invalid_inputs.c @@ -93,7 +93,7 @@ ZTEST(bt_id_create_invalid_inputs, test_public_address) { int err; - if (IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR)) { + if (IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR) || IS_ENABLED(CONFIG_BT_HCI_VS)) { ztest_test_skip(); } From 570d01f236b732601091182221744dfb4537faa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Sk=C3=B8ien?= Date: Mon, 9 Feb 2026 16:01:43 +0100 Subject: [PATCH 1853/3334] [nrf fromtree] Bluetooth: BAP: Direction fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugfix, changed from source to sink in bt_bap_unicast_group_reconfig Signed-off-by: Kristoffer Skøien (cherry picked from commit c966a54549dcac3eafe53467cb6c207f78d7593f) Signed-off-by: Alexander Svensen --- subsys/bluetooth/audio/bap_unicast_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index 8114e93036b9..b163d9c2aa93 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -3080,7 +3080,7 @@ int bt_bap_unicast_group_reconfig(struct bt_bap_unicast_group *unicast_group, CONTAINER_OF(tx_param->stream->iso, struct bt_bap_iso, chan); unicast_group_set_iso_stream_param(unicast_group, bap_iso, tx_param->qos, - BT_AUDIO_DIR_SOURCE); + BT_AUDIO_DIR_SINK); } } From f16807cfef63175ee1daeaa374a26bda53628859 Mon Sep 17 00:00:00 2001 From: Grzegorz Chwierut Date: Fri, 9 Jan 2026 17:51:58 +0100 Subject: [PATCH 1854/3334] [nrf fromtree] twister: refactor DUT class to dataclass for serialization support Convert the DUT class from a traditional class to a dataclass to enable proper serialization and support for future multi-device testing with pytest-harness. Key changes: - Migrated DUT class to use `dataclass` decorator with proper type hints - Renamed `baud` property to `serial_baud` for consistency - Updated hardware map schema to support both `baud` (legacy) and `serial_baud` fields for backward compatibility - Updated tests Signed-off-by: Grzegorz Chwierut (cherry picked from commit efc36d96d34acc283674ac576ba564f9be163c57) --- scripts/pylib/twister/twisterlib/handlers.py | 6 +- .../pylib/twister/twisterlib/hardwaremap.py | 91 ++++++++----------- scripts/pylib/twister/twisterlib/harness.py | 2 +- scripts/schemas/twister/hwmap-schema.yaml | 3 + scripts/tests/twister/test_hardwaremap.py | 38 +++----- scripts/tests/twister/test_harness.py | 2 +- .../twister_blackbox/test_hardwaremap.py | 6 +- 7 files changed, 65 insertions(+), 83 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index 6e321cfec2c0..0b893e8569ed 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -765,7 +765,7 @@ def handle(self, harness): ser_pty_master, slave = pty.openpty() serial_device = os.ttyname(slave) - logger.debug(f"Using serial device {serial_device} @ {hardware.baud} baud") + logger.debug(f"Using serial device {serial_device} @ {hardware.serial_baud} baud") command = self._create_command(runner, hardware) @@ -787,7 +787,7 @@ def handle(self, harness): ser = self._create_serial_connection( hardware, serial_port, - hardware.baud, + hardware.serial_baud, flash_timeout, serial_pty, ser_pty_process @@ -848,7 +848,7 @@ def handle(self, harness): try: if serial_pty: ser_pty_process = self._start_serial_pty(serial_pty, ser_pty_master) - logger.debug(f"Attach serial device {serial_device} @ {hardware.baud} baud") + logger.debug(f"Attach serial device {serial_device} @ {hardware.serial_baud} baud") ser.port = serial_device # Apply ESP32-specific RTS/DTR reset logic diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 6bbf22099c32..6f32849f27a4 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -3,13 +3,16 @@ # # Copyright (c) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +from __future__ import annotations import logging import os import platform import re +from dataclasses import asdict, dataclass, field from multiprocessing import Lock, Value from pathlib import Path +from typing import Any import scl import yaml @@ -32,50 +35,39 @@ logger = logging.getLogger('twister') +@dataclass class DUT: - def __init__(self, - id=None, - serial=None, - serial_baud=None, - platform=None, - product=None, - serial_pty=None, - connected=False, - runner_params=None, - pre_script=None, - post_script=None, - post_flash_script=None, - script_param=None, - runner=None, - flash_timeout=60, - flash_with_test=False, - flash_before=False): - - self.serial = serial - self.baud = serial_baud or 115200 - self.platform = platform - self.serial_pty = serial_pty + """Device Under Test configuration.""" + id: str | None = None + serial: str | None = None + serial_baud: int = 115200 + platform: str | None = None + product: str | None = None + serial_pty: str | None = None + connected: bool = False + runner_params: str | None = None + pre_script: str | None = None + post_script: str | None = None + post_flash_script: str | None = None + script_param: str | None = None + runner: str | None = None + flash_timeout: int = 60 + flash_with_test: bool = False + flash_before: bool = False + fixtures: list[str] = field(default_factory=list) + probe_id: str | None = None + notes: str | None = None + match: bool = False + + def __post_init__(self): + """Initialize non-serializable objects after dataclass initialization.""" + # These are not dataclass fields, so they won't be serialized by asdict() self._counter = Value("i", 0) self._available = Value("i", 1) self._failures = Value("i", 0) - self.connected = connected - self.pre_script = pre_script - self.id = id - self.product = product - self.runner = runner - self.runner_params = runner_params - self.flash_before = flash_before - self.fixtures = [] - self.post_flash_script = post_flash_script - self.post_script = post_script - self.pre_script = pre_script - self.script_param = script_param - self.probe_id = None - self.notes = None self.lock = Lock() - self.match = False - self.flash_timeout = flash_timeout - self.flash_with_test = flash_with_test + # Ensure serial_baud has a default value + self.serial_baud = self.serial_baud or 115200 @property def available(self): @@ -115,19 +107,16 @@ def failures_increment(self, value=1): with self._failures.get_lock(): self._failures.value += value - def to_dict(self): - d = {} - exclude = ['_available', '_counter', '_failures', 'match'] - v = vars(self) - for k in v: - if k not in exclude and v[k]: - d[k] = v[k] - return d - + def to_dict(self) -> dict[str, Any]: + """Convert DUT dataclass to dictionary for YAML serialization.""" + result = asdict(self) + # Remove None and False values and empty lists to keep YAML clean + return {k: v for k, v in result.items() if v} def __repr__(self): return f"<{self.platform} ({self.product}) on {self.serial}>" + class HardwareMap: schema_path = os.path.join(ZEPHYR_BASE, "scripts", "schemas", "twister", "hwmap-schema.yaml") @@ -170,7 +159,7 @@ class HardwareMap: } def __init__(self, env=None): - self.detected = [] + self.detected: list[DUT] = [] self.duts: list[DUT] = [] self.options = env.options @@ -295,7 +284,7 @@ def load(self, map_file): runner = dut.get('runner') runner_params = dut.get('runner_params') serial = dut.get('serial') - baud = dut.get('baud', None) + serial_baud = dut.get('serial_baud', None) or dut.get('baud', None) product = dut.get('product') fixtures = dut.get('fixtures', []) connected = dut.get('connected') and ((serial or serial_pty) is not None) @@ -309,7 +298,7 @@ def load(self, map_file): id=id, serial_pty=serial_pty, serial=serial, - serial_baud=baud, + serial_baud=serial_baud, connected=connected, pre_script=pre_script, flash_before=flash_before, diff --git a/scripts/pylib/twister/twisterlib/harness.py b/scripts/pylib/twister/twisterlib/harness.py index d00d308c5542..957ebba1b874 100644 --- a/scripts/pylib/twister/twisterlib/harness.py +++ b/scripts/pylib/twister/twisterlib/harness.py @@ -463,7 +463,7 @@ def _generate_parameters_for_hardware(self, handler: Handler): else: command.extend([ f'--device-serial={hardware.serial}', - f'--device-serial-baud={hardware.baud}' + f'--device-serial-baud={hardware.serial_baud}' ]) for extra_serial in handler.get_more_serials_from_device(hardware): command.append(f'--device-serial={extra_serial}') diff --git a/scripts/schemas/twister/hwmap-schema.yaml b/scripts/schemas/twister/hwmap-schema.yaml index 142d4a1969bf..caa58088fd6d 100644 --- a/scripts/schemas/twister/hwmap-schema.yaml +++ b/scripts/schemas/twister/hwmap-schema.yaml @@ -41,6 +41,9 @@ sequence: "baud": type: int required: false + "serial_baud": + type: int + required: false "post_script": type: str required: false diff --git a/scripts/tests/twister/test_hardwaremap.py b/scripts/tests/twister/test_hardwaremap.py index 5d0ea798ed64..f7ed424f996b 100644 --- a/scripts/tests/twister/test_hardwaremap.py +++ b/scripts/tests/twister/test_hardwaremap.py @@ -37,7 +37,7 @@ def mocked_hm(): TESTDATA_1 = [ ( {}, - {'baud': 115200, 'lock': mock.ANY, 'flash_timeout': 60}, + {'serial_baud': 115200, 'flash_timeout': 60}, '' ), ( @@ -63,10 +63,9 @@ def mocked_hm(): } }, { - 'lock': mock.ANY, 'id': 'dummy id', 'serial': 'dummy serial', - 'baud': 4400, + 'serial_baud': 4400, 'platform': 'dummy platform', 'product': 'dummy product', 'serial_pty': 'dummy serial pty', @@ -269,7 +268,7 @@ def test_hardwaremap_load(): runner: r0 flash_with_test: True flash_timeout: 15 - baud: 14400 + serial_baud: 14400 fixtures: - dummy fixture 1 - dummy fixture 2 @@ -310,7 +309,7 @@ def mock_open(*args, **kwargs): 'runner': 'r0', 'flash_timeout': 15, 'flash_with_test': True, - 'baud': 14400, + 'serial_baud': 14400, 'fixtures': ['dummy fixture 1', 'dummy fixture 2'], 'connected': True, 'serial': 'dummy', @@ -322,7 +321,7 @@ def mock_open(*args, **kwargs): 'runner': 'r1', 'flash_timeout': 30, 'flash_with_test': False, - 'baud': 115200, + 'serial_baud': 115200, 'fixtures': [], 'connected': True, 'serial': None, @@ -503,50 +502,45 @@ def mock_exists(path): '', [{ 'serial': 's1', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p1', 'connected': True, 'id': 1, 'product': 'pr1', - 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's2', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p2', 'id': 2, 'product': 'pr2', - 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's3', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p3', 'connected': True, 'id': 3, 'product': 'pr3', - 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's4', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p4', 'id': 4, 'product': 'pr4', - 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's5', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p5', 'connected': True, 'id': 5, 'product': 'pr5', - 'lock': mock.ANY, 'flash_timeout': 60 }] ), @@ -603,41 +597,37 @@ def mock_exists(path): }, { 'serial': 's1', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p1', 'connected': True, 'id': 1, 'product': 'pr1', - 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's2', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p2', 'id': 2, 'product': 'pr2', - 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's3', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p3', 'connected': True, 'id': 3, 'product': 'pr3', - 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's5', - 'baud': 115200, + 'serial_baud': 115200, 'platform': 'p5', 'connected': True, 'id': 5, 'product': 'pr5', - 'lock': mock.ANY, 'flash_timeout': 60 }] ), diff --git a/scripts/tests/twister/test_harness.py b/scripts/tests/twister/test_harness.py index fc90205f32e2..62fc6460e788 100644 --- a/scripts/tests/twister/test_harness.py +++ b/scripts/tests/twister/test_harness.py @@ -552,7 +552,7 @@ def test_pytest__generate_parameters_for_hardware(tmp_path, pty_value, hardware_ hardware = mock.Mock() hardware.serial_pty = pty_value hardware.serial = "serial" - hardware.baud = 115200 + hardware.serial_baud = 115200 hardware.runner = "runner" hardware.runner_params = ["--runner-param1", "runner-param2"] hardware.fixtures = ["fixture1:option1", "fixture2"] diff --git a/scripts/tests/twister_blackbox/test_hardwaremap.py b/scripts/tests/twister_blackbox/test_hardwaremap.py index 01bab62313e0..e39ab75c2638 100644 --- a/scripts/tests/twister_blackbox/test_hardwaremap.py +++ b/scripts/tests/twister_blackbox/test_hardwaremap.py @@ -112,7 +112,7 @@ def teardown_class(cls): def test_generate(self, capfd, out_path, manufacturer, product, serial, runner): file_name = "test-map.yaml" path = os.path.join(ZEPHYR_BASE, file_name) - args = ['--outdir', out_path, '--generate-hardware-map', file_name] + args = ['--outdir', out_path, '--generate-hardware-map', path] if os.path.exists(path): os.remove(path) @@ -164,7 +164,7 @@ def mocked_comports(): def test_few_generate(self, capfd, out_path, manufacturer, product, serial, runner): file_name = "test-map.yaml" path = os.path.join(ZEPHYR_BASE, file_name) - args = ['--outdir', out_path, '--generate-hardware-map', file_name] + args = ['--outdir', out_path, '--generate-hardware-map', path] if os.path.exists(path): os.remove(path) @@ -245,7 +245,7 @@ def mocked_comports(): def test_texas_exeption(self, capfd, out_path, manufacturer, product, serial, location): file_name = "test-map.yaml" path = os.path.join(ZEPHYR_BASE, file_name) - args = ['--outdir', out_path, '--generate-hardware-map', file_name] + args = ['--outdir', out_path, '--generate-hardware-map', path] if os.path.exists(path): os.remove(path) From 455ff2349ce38660e7c8c2051e7eb81de72f0edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 4 Jan 2026 00:51:36 +0000 Subject: [PATCH 1855/3334] [nrf fromtree] twister: replace pykwalify with jsonschema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usage of pykwalify is deprecated. Signed-off-by: Guðni Már Gilbert (cherry picked from commit e9f106dd7a1c5bcd5021a6285930e8499c00ffff) --- scripts/pylib/twister/scl.py | 49 +- scripts/schemas/twister/hwmap-schema.yaml | 147 +++-- scripts/schemas/twister/platform-schema.yaml | 241 ++++---- .../schemas/twister/quarantine-schema.yaml | 67 +-- .../schemas/twister/test-config-schema.yaml | 94 ++-- scripts/schemas/twister/testsuite-schema.yaml | 519 ++++++++---------- scripts/tests/twister/test_platform.py | 23 +- scripts/tests/twister/test_scl.py | 179 ++---- 8 files changed, 549 insertions(+), 770 deletions(-) diff --git a/scripts/pylib/twister/scl.py b/scripts/pylib/twister/scl.py index 25a3210b141f..ef8c381adfe3 100644 --- a/scripts/pylib/twister/scl.py +++ b/scripts/pylib/twister/scl.py @@ -1,23 +1,20 @@ -#! /usr/bin/python +#!/usr/bin/env python3 # # SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors # Zephyr's Twister library # -# pylint: disable=unused-import -# # Set of code that other projects can also import to do things on # Zephyr's sanity check testcases. import logging import yaml try: - # Use the C LibYAML parser if available, rather than the Python parser. - # It's much faster. - from yaml import CLoader as Loader from yaml import CSafeLoader as SafeLoader - from yaml import CDumper as Dumper except ImportError: - from yaml import Loader, SafeLoader, Dumper + from yaml import SafeLoader + +from jsonschema import Draft202012Validator log = logging.getLogger("scl") @@ -26,8 +23,6 @@ class EmptyYamlFileException(Exception): pass -# -# def yaml_load(filename): """ Safely load a YAML document @@ -51,23 +46,23 @@ def yaml_load(filename): e.note, cmark.name, cmark.line, cmark.column, e.context) raise -# If pykwalify is installed, then the validate function will work -- -# otherwise, it is a stub and we'd warn about it. -try: - import pykwalify.core - # Don't print error messages yourself, let us do it - logging.getLogger("pykwalify.core").setLevel(50) +def _yaml_validate(data, schema): + """ + Validate loaded YAML data against a JSON Schema. + + :param dict data: YAML document data + :param dict schema: JSON Schema (already loaded) + :raises jsonschema.exceptions.ValidationError: on schema violation + :raises jsonschema.exceptions.SchemaError: on invalid schema + """ + if not schema: + return - def _yaml_validate(data, schema): - if not schema: - return - c = pykwalify.core.Core(source_data=data, schema_data=schema) - c.validate(raise_exception=True) + validator = Draft202012Validator(schema) -except ImportError as e: - log.warning("can't import pykwalify; won't validate YAML (%s)", e) - def _yaml_validate(data, schema): - pass + # Fail fast on first error + for error in validator.iter_errors(data): + raise error def yaml_load_verify(filename, schema): """ @@ -77,9 +72,9 @@ def yaml_load_verify(filename, schema): :param str filename: name of the file to load and process :param dict schema: loaded YAML schema (can load with :func:`yaml_load`) - # 'document.yaml' contains a single YAML document. :raises yaml.scanner.ScannerError: on YAML parsing error - :raises pykwalify.errors.SchemaError: on Schema violation error + :raises jsonschema.exceptions.ValidationError: on schema violation + :raises jsonschema.exceptions.SchemaError: on Schema violation error """ # 'document.yaml' contains a single YAML document. y = yaml_load(filename) diff --git a/scripts/schemas/twister/hwmap-schema.yaml b/scripts/schemas/twister/hwmap-schema.yaml index caa58088fd6d..77b6998fced0 100644 --- a/scripts/schemas/twister/hwmap-schema.yaml +++ b/scripts/schemas/twister/hwmap-schema.yaml @@ -1,82 +1,65 @@ -type: seq -sequence: - - type: map - required: false - mapping: - "available": - type: bool - required: false - "connected": - type: bool - required: true - "id": - type: str - required: true - "notes": - type: str - required: false - "platform": - type: any - required: true - "probe_id": - type: str - required: false - "product": - type: str - required: true - "runner": - type: str - required: true - "runner_params": - type: seq - required: false - sequence: - - type: str - "serial_pty": - type: str - required: false - "serial": - type: str - required: false - "baud": - type: int - required: false - "serial_baud": - type: int - required: false - "post_script": - type: str - required: false - "post_flash_script": - type: str - required: false - "pre_script": - type: str - required: false - "fixtures": - type: seq - required: false - sequence: - - type: str - "flash_timeout": - type: int - required: false - "flash_with_test": - type: bool - required: false - "flash_before": - type: bool - required: false - "script_param": - type: map - required: false - mapping: - "pre_script_timeout": - type: int - required: false - "post_script_timeout": - type: int - required: false - "post_flash_timeout": - type: int - required: false +$schema: "https://json-schema.org/draft/2020-12/schema" +type: array +items: + type: object + properties: + available: + type: boolean + connected: + type: boolean + id: + type: string + notes: + type: string + platform: {} + probe_id: + type: string + product: + type: string + runner: + type: string + runner_params: + type: array + items: + type: string + serial_pty: + type: string + serial: + type: string + baud: + type: integer + serial_baud: + type: integer + post_script: + type: string + post_flash_script: + type: string + pre_script: + type: string + fixtures: + type: array + items: + type: string + flash_timeout: + type: integer + flash_with_test: + type: boolean + flash_before: + type: boolean + script_param: + type: object + properties: + pre_script_timeout: + type: integer + post_script_timeout: + type: integer + post_flash_timeout: + type: integer + additionalProperties: false + required: + - connected + - id + - platform + - product + - runner + additionalProperties: false diff --git a/scripts/schemas/twister/platform-schema.yaml b/scripts/schemas/twister/platform-schema.yaml index 7ceebfe491c4..272ae8b10c2b 100644 --- a/scripts/schemas/twister/platform-schema.yaml +++ b/scripts/schemas/twister/platform-schema.yaml @@ -1,130 +1,119 @@ # # Schema to validate a YAML file describing a Zephyr test platform # -# We load this with pykwalify -# (http://pykwalify.readthedocs.io/en/unstable/validation-rules.html), -# a YAML structure validator, to validate the YAML files that describe -# Zephyr test platforms -# -# The original spec comes from Zephyr's twister script -# - -schema;platform-schema: - type: map - mapping: - "variants": - type: map - matching-rule: "any" - mapping: - regex;(([a-zA-Z0-9_]+)): - include: platform-schema - "identifier": - type: str - "maintainers": - type: seq - seq: - - type: str - "name": - type: str - "type": - type: str - enum: ["mcu", "qemu", "sim", "unit", "native"] - "simulation": - type: seq - seq: - - type: map - mapping: - "name": - type: str - required: true +$schema: "https://json-schema.org/draft/2020-12/schema" +$defs: + platform: + type: object + properties: + variants: + type: object + patternProperties: + "[a-zA-Z0-9_]+": + $ref: "#/$defs/platform" + additionalProperties: false + identifier: + type: string + maintainers: + type: array + items: + type: string + name: + type: string + type: + type: string + enum: ["mcu", "qemu", "sim", "unit", "native"] + simulation: + type: array + items: + type: object + properties: + name: + type: string enum: - [ - "qemu", - "simics", - "xt-sim", - "renode", - "nsim", - "mdb-nsim", - "tsim", - "armfvp", - "native", - "custom", - ] - "exec": - type: str - "arch": - type: str - enum: - [ - # architectures - "arc", - "arm", - "arm64", - "mips", - "nios2", - "posix", - "riscv", - "rx", - "sparc", - "x86", - "xtensa", - - # unit testing - "unit", - ] - "vendor": - type: str - "tier": - type: int - "toolchain": - type: seq - seq: - - type: str - "sysbuild": - type: bool - "env": - type: seq - seq: - - type: str - "ram": - type: int - "flash": - type: int - "twister": - type: bool - "supported": - type: seq - seq: - - type: str - "testing": - type: map - mapping: - "timeout_multiplier": - type: number - required: false - "default": - type: bool - "flash_before": - type: bool - required: false - "binaries": - type: seq - seq: - - type: str - "only_tags": - type: seq - seq: - - type: str - "ignore_tags": - type: seq - seq: - - type: str - "renode": - type: map - mapping: - "uart": - type: str - "resc": - type: str - -include: platform-schema + - qemu + - simics + - xt-sim + - renode + - nsim + - mdb-nsim + - tsim + - armfvp + - native + - custom + exec: + type: string + required: + - name + additionalProperties: false + arch: + type: string + enum: + - arc + - arm + - arm64 + - mips + - nios2 + - posix + - riscv + - rx + - sparc + - x86 + - xtensa + - unit + vendor: + type: string + tier: + type: integer + toolchain: + type: array + items: + type: string + sysbuild: + type: boolean + env: + type: array + items: + type: string + ram: + type: integer + flash: + type: integer + twister: + type: boolean + supported: + type: array + items: + type: string + testing: + type: object + properties: + timeout_multiplier: + type: number + default: + type: boolean + flash_before: + type: boolean + binaries: + type: array + items: + type: string + only_tags: + type: array + items: + type: string + ignore_tags: + type: array + items: + type: string + renode: + type: object + properties: + uart: + type: string + resc: + type: string + additionalProperties: false + additionalProperties: false + additionalProperties: false +$ref: "#/$defs/platform" diff --git a/scripts/schemas/twister/quarantine-schema.yaml b/scripts/schemas/twister/quarantine-schema.yaml index f7a145a3f0f4..a8ba7230ad4d 100644 --- a/scripts/schemas/twister/quarantine-schema.yaml +++ b/scripts/schemas/twister/quarantine-schema.yaml @@ -2,42 +2,31 @@ # Schema to validate a YAML file providing the list of configurations # under quarantine # -# We load this with pykwalify -# (http://pykwalify.readthedocs.io/en/unstable/validation-rules.html), -# a YAML structure validator, to validate the YAML files that provide -# a list of configurations (scenarios + platforms) under quarantine -# -type: seq -matching: all -sequence: - - type: map - required: true - matching: all - mapping: - "scenarios": - type: seq - required: false - sequence: - - type: str - - unique: true - "platforms": - required: false - type: seq - sequence: - - type: str - - unique: true - "architectures": - required: false - type: seq - sequence: - - type: str - - unique: true - "simulations": - required: false - type: seq - sequence: - - type: str - - unique: true - "comment": - type: str - required: false +$schema: "https://json-schema.org/draft/2020-12/schema" +type: array +items: + type: object + properties: + scenarios: + type: array + items: + type: string + uniqueItems: true + platforms: + type: array + items: + type: string + uniqueItems: true + architectures: + type: array + items: + type: string + uniqueItems: true + simulations: + type: array + items: + type: string + uniqueItems: true + comment: + type: string + additionalProperties: false diff --git a/scripts/schemas/twister/test-config-schema.yaml b/scripts/schemas/twister/test-config-schema.yaml index 24a92c34361f..338814dfdb45 100644 --- a/scripts/schemas/twister/test-config-schema.yaml +++ b/scripts/schemas/twister/test-config-schema.yaml @@ -1,53 +1,47 @@ # # Schema to validate a YAML file describing a Zephyr test configuration. # - -type: map -mapping: - "options": - type: map - required: false - mapping: - "integration_mode": - type: seq - required: false - sequence: - - type: str - "platforms": - type: map - required: false - mapping: - "override_default_platforms": - type: bool - required: false - "increased_platform_scope": - type: bool - required: false - "default_platforms": - type: seq - required: false - sequence: - - type: str - "levels": - type: seq - required: false - sequence: - - type: map - required: false - mapping: - "name": - type: str - required: true - "description": - type: str - required: false - "adds": - type: seq - required: false - sequence: - - type: str - "inherits": - type: seq - required: false - sequence: - - type: str +$schema: "https://json-schema.org/draft/2020-12/schema" +type: object +properties: + options: + type: object + properties: + integration_mode: + type: array + items: + type: string + additionalProperties: false + platforms: + type: object + properties: + override_default_platforms: + type: boolean + increased_platform_scope: + type: boolean + default_platforms: + type: array + items: + type: string + additionalProperties: false + levels: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + adds: + type: array + items: + type: string + inherits: + type: array + items: + type: string + required: + - name + additionalProperties: false +additionalProperties: false diff --git a/scripts/schemas/twister/testsuite-schema.yaml b/scripts/schemas/twister/testsuite-schema.yaml index 1d00098e318c..3fa4e33d4c13 100644 --- a/scripts/schemas/twister/testsuite-schema.yaml +++ b/scripts/schemas/twister/testsuite-schema.yaml @@ -1,311 +1,230 @@ # # Schema to validate a YAML file describing a Zephyr test platform # -# We load this with pykwalify -# (http://pykwalify.readthedocs.io/en/unstable/validation-rules.html), -# a YAML structure validator, to validate the YAML files that describe -# Zephyr test platforms -# -# The original spec comes from Zephyr's twister script -# -schema;scenario-schema: - type: map - # has to be not-required, otherwise the parser gets - # confused and things it never found it - required: false - mapping: - "arch_exclude": - type: any - required: false - "arch_allow": - type: any - required: false - "vendor_exclude": - type: seq - required: false - sequence: - - type: str - "vendor_allow": - type: seq - required: false - sequence: - - type: str - "testcases": - type: seq - required: false - sequence: - - type: str - "build_only": - type: bool - required: false - "build_on_all": - type: bool - required: false - "depends_on": - type: any - required: false - "extra_args": - type: any - required: false - "extra_configs": - type: seq - required: false - sequence: - - type: str - "extra_conf_files": - type: seq - required: false - sequence: - - type: str - "extra_overlay_confs": - type: seq - required: false - sequence: - - type: str - "extra_dtc_overlay_files": - type: seq - required: false - sequence: - - type: str - "extra_sections": - type: any - required: false - "expect_reboot": - type: bool - required: false - "required_applications": - type: seq - required: false - sequence: - - type: map - mapping: - "name": - type: str - required: true - "platform": - type: str - "required_snippets": - type: seq - required: false - sequence: - - type: str - "filter": - type: str - required: false - "levels": - type: seq - required: false - sequence: - - type: str +$schema: "https://json-schema.org/draft/2020-12/schema" +$defs: + scenario: + type: object + properties: + arch_exclude: {} + arch_allow: {} + vendor_exclude: + type: array + items: + type: string + vendor_allow: + type: array + items: + type: string + testcases: + type: array + items: + type: string + build_only: + type: boolean + build_on_all: + type: boolean + depends_on: {} + extra_args: {} + extra_configs: + type: array + items: + type: string + extra_conf_files: + type: array + items: + type: string + extra_overlay_confs: + type: array + items: + type: string + extra_dtc_overlay_files: + type: array + items: + type: string + extra_sections: {} + expect_reboot: + type: boolean + required_applications: + type: array + items: + type: object + properties: + name: + type: string + platform: + type: string + required: [name] + additionalProperties: false + required_snippets: + type: array + items: + type: string + filter: + type: string + levels: + type: array + items: + type: string enum: ["smoke", "unit", "integration", "acceptance", "system", "regression"] - "integration_platforms": - type: seq - required: false - sequence: - - type: str - "integration_toolchains": - type: seq - required: false - sequence: - - type: str - "ignore_faults": - type: bool - required: false - "ignore_qemu_crash": - type: bool - required: false - "harness": - type: str - required: false - "harness_config": - type: map - required: false - mapping: - "power_measurements": - type: any - required: false - "shell_commands_file": - type: str - required: false - "shell_commands": - type: seq - required: false - sequence: - - type: map - mapping: - "command": - type: str - required: true - "expected": - type: str - "display_capture_config": - type: str - required: false - "type": - type: str - required: false - "fixture": - type: str - required: false - "ordered": - type: bool - required: false - "pytest_root": - type: seq - required: false - sequence: - - type: str - "pytest_args": - type: seq - required: false - sequence: - - type: str - "pytest_dut_scope": - type: str - enum: ["function", "class", "module", "package", "session"] - required: false - "ctest_args": - type: seq - required: false - sequence: - - type: str - "regex": - type: seq - required: false - sequence: - - type: str - "robot_testsuite": - type: any - required: false - "robot_option": - type: any - required: false - "record": - type: map - required: false - mapping: - "regex": - type: seq - required: true - sequence: - - type: str - "merge": - type: bool - required: false - "as_json": - type: seq - required: false - sequence: - - type: str - "bsim_exe_name": - type: str - required: false - "ztest_suite_repeat": - type: int - required: false - "ztest_test_repeat": - type: int - required: false - "ztest_test_shuffle": - type: bool - required: false - "min_ram": - type: int - required: false - "min_flash": - type: int - required: false - "modules": - type: seq - required: false - sequence: - - type: str - "platform_exclude": - type: any - required: false - "platform_allow": - type: any - required: false - "platform_type": - type: seq - required: false - sequence: - - type: str + integration_platforms: + type: array + items: + type: string + integration_toolchains: + type: array + items: + type: string + ignore_faults: + type: boolean + ignore_qemu_crash: + type: boolean + harness: + type: string + harness_config: + type: object + properties: + power_measurements: {} + shell_commands_file: + type: string + shell_commands: + type: array + items: + type: object + properties: + command: + type: string + expected: + type: string + required: [command] + additionalProperties: false + display_capture_config: + type: string + type: + type: string + fixture: + type: string + ordered: + type: boolean + pytest_root: + type: array + items: + type: string + pytest_args: + type: array + items: + type: string + pytest_dut_scope: + type: string + enum: ["function", "class", "module", "package", "session"] + ctest_args: + type: array + items: + type: string + regex: + type: array + items: + type: string + robot_testsuite: {} + robot_option: {} + record: + type: object + properties: + regex: + type: array + items: + type: string + merge: + type: boolean + as_json: + type: array + items: + type: string + required: [regex] + additionalProperties: false + bsim_exe_name: + type: string + ztest_suite_repeat: + type: integer + ztest_test_repeat: + type: integer + ztest_test_shuffle: + type: boolean + additionalProperties: false + min_ram: + type: integer + min_flash: + type: integer + modules: + type: array + items: + type: string + platform_exclude: {} + platform_allow: {} + platform_type: + type: array + items: + type: string enum: ["mcu", "qemu", "sim", "unit", "native"] - "platform_key": - required: false - type: seq - matching: "all" - sequence: - - type: str - "simulation_exclude": - type: seq - required: false - sequence: - - type: str + platform_key: + type: array + items: + type: string + simulation_exclude: + type: array + items: + type: string enum: - [ - "qemu", - "simics", - "xt-sim", - "renode", - "nsim", - "mdb-nsim", - "tsim", - "armfvp", - "native", - "custom", - ] - "tags": - type: any - required: false - "timeout": - type: int - required: false - "toolchain_exclude": - type: any - required: false - "toolchain_allow": - type: any - required: false - "type": - type: str - enum: ["unit"] - "skip": - type: bool - required: false - "slow": - type: bool - required: false - "sysbuild": - type: bool - required: false + - qemu + - simics + - xt-sim + - renode + - nsim + - mdb-nsim + - tsim + - armfvp + - native + - custom + tags: {} + timeout: + type: integer + toolchain_exclude: {} + toolchain_allow: {} + type: + type: string + enum: ["unit"] + skip: + type: boolean + slow: + type: boolean + sysbuild: + type: boolean + additionalProperties: false -type: map -mapping: - "common": - include: scenario-schema +type: object +properties: + common: + $ref: "#/$defs/scenario" # The sample descriptor, if present - "sample": - type: map - required: false - mapping: - "name": - type: str - required: true - "description": - type: str - required: false + sample: + type: object + properties: + name: + type: string + description: + type: string + required: [name] + additionalProperties: false # The list of testcases -- IDK why this is a sequence of # maps maps, shall just be a sequence of maps # maybe it is just an artifact? - "tests": - type: map - required: true - matching-rule: "any" - mapping: - # The key for the testname is any, so - # regex;(([a-zA-Z0-9_]+)) for this to work, note below we - # make it required: false - regex;(([a-zA-Z0-9_]+)): - include: scenario-schema + tests: + type: object + patternProperties: + # The key for the testname is any + "[a-zA-Z0-9_]+": + $ref: "#/$defs/scenario" + additionalProperties: false +required: + - tests +additionalProperties: false diff --git a/scripts/tests/twister/test_platform.py b/scripts/tests/twister/test_platform.py index bef49ca861f4..f499e8a754de 100644 --- a/scripts/tests/twister/test_platform.py +++ b/scripts/tests/twister/test_platform.py @@ -10,7 +10,7 @@ from unittest import mock import pytest -from pykwalify.errors import SchemaError +from jsonschema.exceptions import ValidationError from twisterlib.platform import Platform, Simulator, generate_platforms TESTDATA_1 = [ @@ -131,6 +131,7 @@ def xtest_platform_load(platform_text, expected_data, expected_repr): ( ['m0'], None, + None, { 'p1e1/s1', 'p1e2/s1', 'p2/s1', 'p3@A/s2/c1', 'p3@B/s2/c1', }, @@ -138,6 +139,7 @@ def xtest_platform_load(platform_text, expected_data, expected_repr): ( ['m0', 'm1'], None, + None, { 'p1e1/s1', 'p1e2/s1', 'p2/s1', 'p3@A/s2/c1', 'p3@B/s2/c1', 'p1e1/s1/v1', 'p1e1/s1/v2', 'p1e2/s1/v1', 'p2/s1/v1', @@ -146,6 +148,7 @@ def xtest_platform_load(platform_text, expected_data, expected_repr): ( ['m0', 'm1', 'm2'], None, + None, { 'p1e1/s1', 'p1e2/s1', 'p2/s1', 'p3@A/s2/c1', 'p3@B/s2/c1', 'p1e1/s1/v1', 'p1e1/s1/v2', 'p1e2/s1/v1', 'p2/s1/v1', @@ -154,23 +157,26 @@ def xtest_platform_load(platform_text, expected_data, expected_repr): ), ( ['m0', 'm3'], - Exception("Duplicate platform identifier p1e1/s1 found"), + Exception, + "Duplicate platform identifier p1e1/s1 found", None, ), ( ['m0', 'm1', 'm4'], - Exception("Duplicate platform identifier p1e2/s1/v1 found"), + Exception, + "Duplicate platform identifier p1e2/s1/v1 found", None, ), ( ['m0', 'm5'], - SchemaError(), # Unknown message as this is raised externally + ValidationError, # Unknown message as this is raised externally + None, None, ), ] @pytest.mark.parametrize( - 'roots, expected_exception, expected_platform_names', + 'roots, expected_exception, expected_exception_msg, expected_platform_names', TESTDATA_2, ids=[ 'default board root', @@ -185,6 +191,7 @@ def test_generate_platforms( tmp_path, roots, expected_exception, + expected_exception_msg, expected_platform_names, ): tmp_files = { @@ -356,13 +363,13 @@ def test_generate_platforms( (tmp_path / filename).write_text(content) roots = list(map(tmp_path.joinpath, roots)) - with pytest.raises(type(expected_exception)) if \ + with pytest.raises(expected_exception) if \ expected_exception else nullcontext() as exception: platforms = list(generate_platforms(board_roots=roots, soc_roots=roots, arch_roots=roots)) if expected_exception: - if expected_exception.args: - assert str(expected_exception) == str(exception.value) + if expected_exception_msg: + assert expected_exception_msg == str(exception.value) return platform_names = {platform.name for platform in platforms} diff --git a/scripts/tests/twister/test_scl.py b/scripts/tests/twister/test_scl.py index f08ed30ee992..199f58576faf 100644 --- a/scripts/tests/twister/test_scl.py +++ b/scripts/tests/twister/test_scl.py @@ -6,116 +6,38 @@ Tests for scl.py functions """ -import logging import sys +import types from contextlib import nullcontext from importlib import reload from unittest import mock import pytest import scl -from pykwalify.errors import SchemaError +from jsonschema.exceptions import ValidationError from yaml.scanner import ScannerError -TESTDATA_1 = [ - (False,), - (True,), -] -@pytest.mark.parametrize( - 'fail_c', - TESTDATA_1, - ids=['C YAML', 'non-C YAML'] -) -def test_yaml_imports(fail_c): - class ImportRaiser: - def find_spec(self, fullname, path, target=None): - if fullname == 'yaml.CLoader' and fail_c: - raise ImportError() - if fullname == 'yaml.CSafeLoader' and fail_c: - raise ImportError() - if fullname == 'yaml.CDumper' and fail_c: - raise ImportError() - - modules_mock = sys.modules.copy() - - if hasattr(modules_mock['yaml'], 'CLoader'): - del modules_mock['yaml'].CLoader - del modules_mock['yaml'].CSafeLoader - del modules_mock['yaml'].CDumper - - cloader_mock = mock.Mock() - loader_mock = mock.Mock() - csafeloader_mock = mock.Mock() - safeloader_mock = mock.Mock() - cdumper_mock = mock.Mock() - dumper_mock = mock.Mock() - - if not fail_c: - modules_mock['yaml'].CLoader = cloader_mock - modules_mock['yaml'].CSafeLoader = csafeloader_mock - modules_mock['yaml'].CDumper = cdumper_mock - - modules_mock['yaml'].Loader = loader_mock - modules_mock['yaml'].SafeLoader = safeloader_mock - modules_mock['yaml'].Dumper = dumper_mock - - meta_path_mock = sys.meta_path[:] - meta_path_mock.insert(0, ImportRaiser()) - - with mock.patch.dict('sys.modules', modules_mock, clear=True), \ - mock.patch('sys.meta_path', meta_path_mock): +@pytest.mark.parametrize("has_cyaml", [True, False], ids=["C YAML", "non-C YAML"]) +def test_yaml_imports(has_cyaml): + """ + scl.py does: + from yaml import CSafeLoader as SafeLoader + falling back to: + from yaml import SafeLoader + So we simulate a yaml module with/without CSafeLoader. + """ + fake_yaml = types.ModuleType("yaml") + fake_yaml.load = mock.Mock() + fake_yaml.SafeLoader = object() + if has_cyaml: + fake_yaml.CSafeLoader = object() + + with mock.patch.dict(sys.modules, {"yaml": fake_yaml}): reload(scl) + assert scl.SafeLoader is (fake_yaml.CSafeLoader if has_cyaml else fake_yaml.SafeLoader) - assert sys.modules['scl'].Loader == loader_mock if fail_c else \ - cloader_mock - - assert sys.modules['scl'].SafeLoader == safeloader_mock if fail_c else \ - csafeloader_mock - - assert sys.modules['scl'].Dumper == dumper_mock if fail_c else \ - cdumper_mock - - import yaml - reload(yaml) - - -TESTDATA_2 = [ - (False, logging.CRITICAL, []), - (True, None, ['can\'t import pykwalify; won\'t validate YAML']), -] - -@pytest.mark.parametrize( - 'fail_pykwalify, log_level, expected_logs', - TESTDATA_2, - ids=['pykwalify OK', 'no pykwalify'] -) -def test_pykwalify_import(caplog, fail_pykwalify, log_level, expected_logs): - class ImportRaiser: - def find_spec(self, fullname, path, target=None): - if fullname == 'pykwalify.core' and fail_pykwalify: - raise ImportError() - - modules_mock = sys.modules.copy() - modules_mock['pykwalify'] = None if fail_pykwalify else \ - modules_mock['pykwalify'] - - meta_path_mock = sys.meta_path[:] - meta_path_mock.insert(0, ImportRaiser()) - - with mock.patch.dict('sys.modules', modules_mock, clear=True), \ - mock.patch('sys.meta_path', meta_path_mock): - reload(scl) - - if log_level: - assert logging.getLogger('pykwalify.core').level == log_level - - assert all([log in caplog.text for log in expected_logs]) - - if fail_pykwalify: - assert scl._yaml_validate(None, None) is None - assert scl._yaml_validate(mock.Mock(), mock.Mock()) is None - + # cleanup reload(scl) @@ -169,7 +91,7 @@ def mock_load(*args, **kwargs): TESTDATA_4 = [ (True, False, None), - (False, False, SchemaError), + (False, False, ValidationError), (False, True, ScannerError), ] @@ -183,18 +105,18 @@ def test_yaml_load_verify(validate, fail_load, expected_error): schema_mock = mock.Mock() data_mock = mock.Mock() - def mock_load(file_name, *args, **kwargs): + def mock_load(file_name): assert file_name == filename if fail_load: raise ScannerError return data_mock - def mock_validate(data, schema, *args, **kwargs): + def mock_validate(data, schema): assert data == data_mock assert schema == schema_mock if validate: - return True - raise SchemaError(u'Schema validation failed.') + return None + raise ValidationError("Schema validation failed") with mock.patch('scl.yaml_load', side_effect=mock_load), \ mock.patch('scl._yaml_validate', side_effect=mock_validate), \ @@ -204,47 +126,28 @@ def mock_validate(data, schema, *args, **kwargs): if validate: assert res == data_mock +def test_yaml_validate(): + data = {"a": 1} + schema = { + "type": "object", + "properties": { + "a": {"type": "string"} + }, + "required": ["a"], + "additionalProperties": False, + } -TESTDATA_5 = [ - (True, True, None), - (True, False, SchemaError), - (False, None, None), -] + with pytest.raises(ValidationError): + scl._yaml_validate(data, schema) -@pytest.mark.parametrize( - 'schema_exists, validate, expected_error', - TESTDATA_5, - ids=['successful validation', 'failed validation', 'no schema'] -) -def test_yaml_validate(schema_exists, validate, expected_error): - data_mock = mock.Mock() - schema_mock = mock.Mock() if schema_exists else None - def mock_validate(raise_exception, *args, **kwargs): - assert raise_exception - if validate: - return True - raise SchemaError(u'Schema validation failed.') - - def mock_core(source_data, schema_data, *args, **kwargs): - assert source_data == data_mock - assert schema_data == schema_mock - return mock.Mock(validate=mock_validate) - - core_mock = mock.Mock(side_effect=mock_core) - - with mock.patch('pykwalify.core.Core', core_mock), \ - pytest.raises(expected_error) if expected_error else nullcontext(): - scl._yaml_validate(data_mock, schema_mock) - - if schema_exists: - core_mock.assert_called_once() - else: - core_mock.assert_not_called() +def test_yaml_validate_no_schema(): + data = {"a": 1} + assert scl._yaml_validate(data, None) is None def test_yaml_load_empty_file(tmp_path): quarantine_file = tmp_path / 'empty_quarantine.yml' - quarantine_file.write_text("# yaml file without data") + quarantine_file.write_text("# yaml file without data", encoding="utf-8") with pytest.raises(scl.EmptyYamlFileException): scl.yaml_load_verify(quarantine_file, None) From 447ee68dc690d81acbc392ebccd11d4d14167b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 24 Jan 2026 16:16:16 +0000 Subject: [PATCH 1856/3334] [nrf fromtree] scripts: twister: fix issue with empty serial in hwmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jsonschema is more strict when it comes to typing and only allows strings for 'serial' in hwmap-schema.yaml. Since 'serial' is not a required key in the schema, this commit removes the 'serial' key from generated hardware maps when the 'serial' value is empty /unknown. Signed-off-by: Guðni Már Gilbert (cherry picked from commit e3575fc84845dfdbc9ce8ec8b3e78f54d1d4a9b1) --- .../pylib/twister/twisterlib/hardwaremap.py | 9 +- scripts/tests/twister/test_hardwaremap.py | 84 ++++++++++++++++++- 2 files changed, 85 insertions(+), 8 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 6f32849f27a4..59c2ec5a0bb1 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -399,7 +399,7 @@ def save(self, hwm_file): for h in hwm: if h['product'] != 'BOOT-SERIAL' : h['connected'] = False - h['serial'] = None + h.pop('serial', None) else : boot_ids.append(h['id']) @@ -412,7 +412,8 @@ def save(self, hwm_file): h['connected'] is False ]): h['connected'] = True - h['serial'] = _detected.serial + if _detected.serial: + h['serial'] = _detected.serial _detected.match = True break @@ -445,16 +446,16 @@ def save(self, hwm_file): platform = _connected.platform id = _connected.id runner = _connected.runner - serial = _connected.serial product = _connected.product d = { 'platform': platform, 'id': id, 'runner': runner, - 'serial': serial, 'product': product, 'connected': _connected.connected } + if _connected.serial: + d['serial'] = _connected.serial dl.append(d) with open(hwm_file, 'w') as yaml_file: yaml.dump(dl, yaml_file, Dumper=Dumper, default_flow_style=False) diff --git a/scripts/tests/twister/test_hardwaremap.py b/scripts/tests/twister/test_hardwaremap.py index f7ed424f996b..6fd68d71ba95 100644 --- a/scripts/tests/twister/test_hardwaremap.py +++ b/scripts/tests/twister/test_hardwaremap.py @@ -324,7 +324,6 @@ def mock_open(*args, **kwargs): 'serial_baud': 115200, 'fixtures': [], 'connected': True, - 'serial': None, 'serial_pty': 'dummy', }, } @@ -572,7 +571,6 @@ def mock_exists(path): 'platform': 'p0', 'product': 'pr0', 'connected': False, - 'serial': None }, { 'id': 4, @@ -586,14 +584,12 @@ def mock_exists(path): 'platform': 'p5-5', 'product': 'pr5-5', 'connected': False, - 'serial': None }, { 'id': 10, 'platform': 'p10', 'product': 'pr10', 'connected': False, - 'serial': None }, { 'serial': 's1', @@ -721,3 +717,83 @@ def test_hardwaremap_dump( sys.stderr.write(err) assert out.strip() == expected_out.strip() + +def _run_save_and_get_dump(mocked_hm, *, exists, filename='hwm.yaml', read_data=None): + """ + Run HardwareMap.save() with mocked file I/O and return the object passed to yaml.dump() + """ + dump_mock = mock.Mock() + + if read_data is None: + write_mock = mock.mock_open() + open_mock = mock.Mock(return_value=write_mock()) + else: + read_mock = mock.mock_open(read_data=read_data) + write_mock = mock.mock_open() + + def mock_open(filename, mode='r'): + if mode == 'r': + return read_mock() + if mode == 'w': + return write_mock() + raise AssertionError(f"unexpected mode {mode}") + + open_mock = mock.Mock(side_effect=mock_open) + + mocked_hm.load = mock.Mock() + mocked_hm.dump = mock.Mock() + + with mock.patch('os.path.exists', return_value=exists), \ + mock.patch('builtins.open', open_mock), \ + mock.patch('twisterlib.hardwaremap.yaml.dump', dump_mock): + mocked_hm.save(filename) + + return dump_mock.call_args.args[0] + +def test_hardwaremap_save_omits_serial_when_none(mocked_hm): + """ + Verify 'serial' key is omitted when from the generated hardware map + when it is unknown. 'serial' is not required. + """ + # Force one detected device to have no serial + mocked_hm.detected = list(mocked_hm.detected) + mocked_hm.detected[1].serial = None # id=2 in mocked_hm fixture + + dumped = _run_save_and_get_dump(mocked_hm, exists=False, filename='hwm.yaml') + + entry = next(d for d in dumped if d['id'] == 2) + assert 'serial' not in entry + + # And ensure nobody writes serial=None + assert all(d.get('serial') is not None for d in dumped if 'serial' in d) + +def test_hardwaremap_save_existing_map_disconnect_omits_serial(mocked_hm): + """ + If the hardware map contained a 'serial' value, then the next time a + hardmap is generated and the device is disconnected, and the serial value + is unknown, then the new file should not contain the 'serial'. + """ + mocked_hm.detected = [] # simulate unplugged + + hwm = """ +- id: 4 + platform: p4 + product: pr4 + runner: r4 + connected: True + serial: s4 +""" + + dumped = _run_save_and_get_dump( + mocked_hm, + exists=True, + filename='hwmap1.yaml', + read_data=hwm, + ) + + entry = next(d for d in dumped if d['id'] == 4) + assert entry['connected'] is False + assert 'serial' not in entry + + # And ensure nobody writes serial=None + assert all(d.get('serial') is not None for d in dumped if 'serial' in d) From 7b76f0caf4c2c7d08eac5a0555dc6c59084d724f Mon Sep 17 00:00:00 2001 From: Sharon Lin Date: Tue, 25 Nov 2025 08:37:55 +0800 Subject: [PATCH 1857/3334] [nrf fromtree] scripts: twister: fix codec cp950 error when running on Windows When running twister on Windows host, the build will fail from cmakecache.py with error as: UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 3444: illegal multibyte sequence Signed-off-by: Sharon Lin (cherry picked from commit 5d56e00bfbb91bbd8786b3c49392d77eea410b6f) --- scripts/pylib/twister/twisterlib/cmakecache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/cmakecache.py b/scripts/pylib/twister/twisterlib/cmakecache.py index 16e18669675c..177fc59d4bcf 100644 --- a/scripts/pylib/twister/twisterlib/cmakecache.py +++ b/scripts/pylib/twister/twisterlib/cmakecache.py @@ -115,7 +115,7 @@ def __init__(self, cache_file): def load(self, cache_file): entries = [] - with open(cache_file) as cache: + with open(cache_file, encoding='utf-8') as cache: for line_no, line in enumerate(cache): entry = CMakeCacheEntry.from_line(line, line_no) if entry: From d3fef392bc085dfaf54539de1332db676ee5be88 Mon Sep 17 00:00:00 2001 From: Grzegorz Chwierut Date: Wed, 28 Jan 2026 23:07:56 +0100 Subject: [PATCH 1858/3334] [nrf fromtree] Revert "twister: pytest: fix duplicate log lines from pytest" This reverts commit 96985a32e862c94ec292b98366e27da9e7feb7c6. Signed-off-by: Grzegorz Chwierut (cherry picked from commit 1b1e902540c2573a8bf67e5425df350417561190) --- scripts/pylib/twister/twisterlib/harness.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/harness.py b/scripts/pylib/twister/twisterlib/harness.py index 957ebba1b874..99c113fb4344 100644 --- a/scripts/pylib/twister/twisterlib/harness.py +++ b/scripts/pylib/twister/twisterlib/harness.py @@ -403,7 +403,6 @@ def generate_command(self): 'pytest', '--twister-harness', '-s', '-v', - '--log-level=DEBUG', f'--build-dir={self.running_dir}', f'--junit-xml={self.report_file}', f'--platform={self.instance.platform.name}' @@ -415,6 +414,12 @@ def generate_command(self): if pytest_dut_scope: command.append(f'--dut-scope={pytest_dut_scope}') + # Always pass output from the pytest test and the test image up to Twister log. + command.extend([ + '--log-cli-level=DEBUG', + '--log-cli-format=%(levelname)s: %(message)s' + ]) + # Use the test timeout as the base timeout for pytest base_timeout = handler.get_test_timeout() command.append(f'--base-timeout={base_timeout}') From e932c7cc28b5f4c4ef7abdad80dc98783bf46fb6 Mon Sep 17 00:00:00 2001 From: Lukasz Fundakowski Date: Fri, 28 Nov 2025 13:20:34 +0100 Subject: [PATCH 1859/3334] [nrf fromtree] twister: Improve error handling for user's errors Exit from twister in case of user's error e.g. empty list of tests provided by user instead of throwing unhandled exception. Signed-off-by: Lukasz Fundakowski (cherry picked from commit 2ad2ce9fe1bb287a2a0fe8f3e74bb39f6df890af) --- scripts/pylib/twister/twisterlib/testplan.py | 8 +-- scripts/tests/twister/test_testplan.py | 12 ++--- scripts/tests/twister_blackbox/test_error.py | 51 ++++++++------------ 3 files changed, 30 insertions(+), 41 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index 6213bc5d7d9b..89ec4b76cea0 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -216,9 +216,11 @@ def discover(self): testsuite_pattern=self.options.test_pattern) if num == 0: - raise TwisterRuntimeError("No testsuites found at the specified location...") + logger.error("No testsuites found at the specified location...") + raise SystemExit("No testsuites found at the specified location...") if self.load_errors: - raise TwisterRuntimeError( + logger.error(f"Found {self.load_errors} errors loading {num} test configurations.") + raise SystemExit( f"Found {self.load_errors} errors loading {num} test configurations." ) @@ -235,7 +237,7 @@ def discover(self): qv = self.options.quarantine_verify if qv and not ql: logger.error("No quarantine list given to be verified") - raise TwisterRuntimeError("No quarantine list given to be verified") + raise SystemExit("No quarantine list given to be verified") if ql: for quarantine_file in ql: try: diff --git a/scripts/tests/twister/test_testplan.py b/scripts/tests/twister/test_testplan.py index 85bd2fd14428..b10c50c2281c 100644 --- a/scripts/tests/twister/test_testplan.py +++ b/scripts/tests/twister/test_testplan.py @@ -641,9 +641,9 @@ def test_testplan_find_subtests( TESTDATA_3 = [ - (0, 0, [], False, [], TwisterRuntimeError, []), - (1, 1, [], False, [], TwisterRuntimeError, []), - (1, 0, [], True, [], TwisterRuntimeError, ['No quarantine list given to be verified']), + (0, 0, [], False, [], SystemExit, []), + (1, 1, [], False, [], SystemExit, []), + (1, 0, [], True, [], SystemExit, ['No quarantine list given to be verified']), (1, 0, ['qfile.yaml'], False, ['- platforms:\n - demo_board_3\n comment: "board_3"'], None, []), ] @@ -714,10 +714,10 @@ def test_testplan_discover( ] @pytest.mark.parametrize( - 'report_suffix, only_failed, load_tests, test_only, subset,' \ - ' exception, expected_selected_platforms, expected_generate_subset_args', + 'report_suffix, only_failed, load_tests, test_only, subset, ' \ + 'exception, expected_selected_platforms, expected_generate_subset_args', TESTDATA_4, - ids=['apply_filters only', 'only failed', 'load tests', 'test only'] + ids=['apply-filters-only', 'only-failed', 'load-tests', 'test-only'] ) def test_testplan_load( tmp_path, diff --git a/scripts/tests/twister_blackbox/test_error.py b/scripts/tests/twister_blackbox/test_error.py index a15b3b5129cf..cbd6b5e80044 100644 --- a/scripts/tests/twister_blackbox/test_error.py +++ b/scripts/tests/twister_blackbox/test_error.py @@ -6,17 +6,16 @@ Blackbox tests for twister's command line functions - simple does-error-out or not tests """ -import importlib -from unittest import mock import os import pytest -import sys import re +import sys +from unittest import mock # pylint: disable=no-name-in-module -from conftest import ZEPHYR_BASE, TEST_DATA, suite_filename_mock +from conftest import TEST_DATA, suite_filename_mock from twisterlib.testplan import TestPlan -from twisterlib.error import TwisterRuntimeError +from twisterlib.twister_main import main as twister_main class TestError: @@ -26,17 +25,17 @@ class TestError: os.path.join('scripts', 'tests', 'twister_blackbox', 'test_data', 'tests', 'dummy', 'agnostic', 'group1', 'subgroup1', 'dummy.agnostic.group1.subgroup1'), - SystemExit + (0, '') ), ( None, 'dummy.agnostic.group1.subgroup1', - TwisterRuntimeError + (1, 'No testsuites found at the specified location...') ), ( os.path.join(TEST_DATA, 'tests', 'dummy'), 'dummy.agnostic.group1.subgroup1', - SystemExit + (0, '') ) ] TESTDATA_2 = [ @@ -50,24 +49,13 @@ class TestError: ) ] - @classmethod - def setup_class(cls): - apath = os.path.join(ZEPHYR_BASE, 'scripts', 'twister') - cls.loader = importlib.machinery.SourceFileLoader('__main__', apath) - cls.spec = importlib.util.spec_from_loader(cls.loader.name, cls.loader) - cls.twister_module = importlib.util.module_from_spec(cls.spec) - - @classmethod - def teardown_class(cls): - pass - @pytest.mark.parametrize( - 'testroot, test, expected_exception', + 'testroot, test, expected_return', TESTDATA_1, ids=['valid', 'invalid', 'valid'] ) @mock.patch.object(TestPlan, 'TESTSUITE_FILENAME', suite_filename_mock) - def test_test(self, out_path, testroot, test, expected_exception): + def test_test(self, out_path, testroot, test, expected_return, capsys): test_platforms = ['qemu_x86', 'intel_adl_crb'] args = [] if testroot: @@ -77,13 +65,14 @@ def test_test(self, out_path, testroot, test, expected_exception): ['-p'] * len(test_platforms), test_platforms ) for val in pair] - with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \ - pytest.raises(expected_exception) as exc: - self.loader.exec_module(self.twister_module) + expected_return_code, expected_message = expected_return + + return_code = twister_main(args) + captured = capsys.readouterr() - if expected_exception == SystemExit: - assert str(exc.value) == '0' - assert True + assert return_code == expected_return_code + if expected_message: + assert expected_message in captured.err @pytest.mark.parametrize( 'switch, expected', @@ -106,9 +95,7 @@ def test_overflow_as_errors(self, capfd, out_path, switch, expected): if switch: args += [switch] - with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \ - pytest.raises(SystemExit) as sys_exit: - self.loader.exec_module(self.twister_module) + return_code = twister_main(args) out, err = capfd.readouterr() sys.stdout.write(out) @@ -116,8 +103,8 @@ def test_overflow_as_errors(self, capfd, out_path, switch, expected): print(args) if switch: - assert str(sys_exit.value) == '1' + assert return_code == 1 else: - assert str(sys_exit.value) == '0' + assert return_code == 0 assert re.search(expected, err) From f59609861868ac4fe54ce0abebc728c78631554d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 23 Jan 2026 10:44:20 +0000 Subject: [PATCH 1860/3334] [nrf fromtree] scripts: twister: don't parse snippets multiple times MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently apply_filters is parsing & validating a snippet YAML file multiple times, duplicating expensive work. Do the work once per testsuite instead of for each testsuite multiplied by number of toolchains. Signed-off-by: Guðni Már Gilbert (cherry picked from commit bcb00aaa9a713bd1d75beb25653fff6533900b32) --- scripts/pylib/twister/twisterlib/testplan.py | 43 +++++++++++--------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index 89ec4b76cea0..d294e8375a50 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -867,6 +867,23 @@ def apply_filters(self, **kwargs): platform_scope = list( filter(lambda item: item.name in ts.platform_allow, self.platforms) ) + + # Discover required snippet YAML files and load them once per testsuite + found_snippets = None + snippet_args = None + missing_required_snippet = None + + if ts.required_snippets: + snippet_args = {"snippets": ts.required_snippets} + found_snippets = snippets.find_snippets_in_roots( + snippet_args, + [*self.env.snippet_roots, Path(ts.source_dir)] + ) + for this_snippet in snippet_args["snippets"]: + if this_snippet not in found_snippets: + missing_required_snippet = this_snippet + break + # list of instances per testsuite, aka configurations. instance_list = [] for itoolchain, plat in itertools.product( @@ -1031,25 +1048,13 @@ def apply_filters(self, **kwargs): instance.add_filter("Excluded tags per platform (only_tags)", Filters.PLATFORM) if ts.required_snippets: - missing_snippet = False - snippet_args = {"snippets": ts.required_snippets} - found_snippets = snippets.find_snippets_in_roots( - snippet_args, - [*self.env.snippet_roots, Path(ts.source_dir)] - ) - - # Search and check that all required snippet files are found - for this_snippet in snippet_args['snippets']: - if this_snippet not in found_snippets: - logger.error( - f"Can't find snippet '{this_snippet}' for test '{ts.name}'" - ) - instance.status = TwisterStatus.ERROR - instance.reason = f"Snippet {this_snippet} not found" - missing_snippet = True - break - - if not missing_snippet: + if missing_required_snippet: + logger.error( + f"Can't find snippet '{missing_required_snippet}' for test '{ts.name}'" + ) + instance.status = TwisterStatus.ERROR + instance.reason = f"Snippet {missing_required_snippet} not found" + else: # Look for required snippets and check that they are applicable for these # platforms/boards for this_snippet in snippet_args['snippets']: From 94e928bd992eb36a4686ade945b41f017999529a Mon Sep 17 00:00:00 2001 From: Hake Huang Date: Fri, 30 Jan 2026 14:54:08 +0800 Subject: [PATCH 1861/3334] [nrf fromtree] twister: handler: add spsdk support with dev_id spsdk now support dev_id as parameter Signed-off-by: Hake Huang (cherry picked from commit cdd9d63a465612a993aa038ed08ae641c742f35c) --- 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 0b893e8569ed..d8ebe4a0ae86 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -609,7 +609,7 @@ def _create_command(self, runner, hardware): board_id = hardware.probe_id or hardware.id product = hardware.product if board_id is not None: - if runner in ("pyocd", "nrfjprog", "nrfutil", "nrfutil_next"): + if runner in ("pyocd", "nrfjprog", "nrfutil", "nrfutil_next", "spsdk"): command_extra_args.append("--dev-id") command_extra_args.append(board_id) elif runner == "esp32": From cb07e5f16688a57704eba394c97bdf643903e931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 31 Jan 2026 13:45:27 +0000 Subject: [PATCH 1862/3334] [nrf fromtree] scripts: twister: minor speedup in apply_filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move a check to run earlier in a for-loop to minimize doing unnecessary work like creating TestInstance class instances. This is a very minor optimization when the number of testsuites are low. But starts to count when there are a lot of testsuites. Signed-off-by: Guðni Már Gilbert (cherry picked from commit fc8e096ee18f3c46eb81166907670227f1a46918) --- scripts/pylib/twister/twisterlib/testplan.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index d294e8375a50..866763009681 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -889,6 +889,10 @@ def apply_filters(self, **kwargs): for itoolchain, plat in itertools.product( ts.integration_toolchains or [None], platform_scope ): + if (plat.arch == "unit") != (ts.type == "unit"): + # Discard silently + continue + if itoolchain: toolchain = itoolchain elif plat.arch in ['posix', 'unit']: @@ -909,10 +913,6 @@ def apply_filters(self, **kwargs): if not force_platform and self.check_platform(plat,exclude_platform): instance.add_filter("Platform is excluded on command line.", Filters.CMD_LINE) - if (plat.arch == "unit") != (ts.type == "unit"): - # Discard silently - continue - if ts.modules and self.modules and not set(ts.modules).issubset(set(self.modules)): instance.add_filter( f"one or more required modules not available: {','.join(ts.modules)}", From b723f8901b3873766198de2923a7ea26b44bfc51 Mon Sep 17 00:00:00 2001 From: Lukasz Fundakowski Date: Wed, 28 Jan 2026 11:29:24 +0100 Subject: [PATCH 1863/3334] [nrf fromtree] twister: Refactor twister_main.py Refactored main function for Twister execution. - Rewrote the main function as a class and divided it into smaller, more maintainable methods. - Improved code structure, making it easier to test with unit and module tests. - Reduced the amount of code in a single function, enhancing readability and understanding Signed-off-by: Lukasz Fundakowski (cherry picked from commit 98c6fbfc9ba61f6520fb34615d7d9209c32486f3) --- .../pylib/twister/twisterlib/twister_main.py | 440 +++++++++++------- scripts/west_commands/twister_cmd.py | 4 +- 2 files changed, 266 insertions(+), 178 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/twister_main.py b/scripts/pylib/twister/twisterlib/twister_main.py index e851cda31aad..410d9c0f2476 100644 --- a/scripts/pylib/twister/twisterlib/twister_main.py +++ b/scripts/pylib/twister/twisterlib/twister_main.py @@ -3,12 +3,15 @@ # Copyright (c) 2022 Google # SPDX-License-Identifier: Apache-2.0 +from __future__ import annotations + import argparse import logging import os import shutil import sys import time +import warnings from collections.abc import Sequence import colorama @@ -50,219 +53,304 @@ def _inner(*args, **kwargs): return _inner -@catch_system_exit_exception -def twister(options: argparse.Namespace, default_options: argparse.Namespace) -> int: - start_time = time.time() - - # Configure color output - color_strip = False if options.force_color else None - - colorama.init(strip=color_strip) - init_color(colorama_strip=color_strip) - - previous_results = None - # Cleanup - if ( - options.no_clean - or options.only_failed - or options.test_only - or options.report_summary is not None - ): - if os.path.exists(options.outdir): - print("Keeping artifacts untouched") - elif options.last_metrics: - ls = os.path.join(options.outdir, "twister.json") - if os.path.exists(ls): - with open(ls) as fp: - previous_results = fp.read() - else: - sys.exit(f"Can't compare metrics with non existing file {ls}") - elif os.path.exists(options.outdir): - if options.clobber_output: - print(f"Deleting output directory {options.outdir}") - shutil.rmtree(options.outdir) - else: - for i in range(1, 100): - new_out = options.outdir + f".{i}" - if not os.path.exists(new_out): - print(f"Renaming previous output directory to {new_out}") - shutil.move(options.outdir, new_out) - break - else: - sys.exit(f"Too many '{options.outdir}.*' directories. Run either with --no-clean, " - "or --clobber-output, or delete these directories manually.") - - previous_results_file = None - os.makedirs(options.outdir, exist_ok=True) - if options.last_metrics and previous_results: - previous_results_file = os.path.join(options.outdir, "baseline.json") - with open(previous_results_file, "w") as fp: - fp.write(previous_results) - - setup_logging(options.outdir, options.log_file, options.log_level, options.timestamps) - logger = logging.getLogger("twister") +class Twister: + """Main class for Twister.""" - env = TwisterEnv(options, default_options) - env.discover() + def __init__(self, options: argparse.Namespace, default_options: argparse.Namespace) -> None: + """Initialize Twister.""" + self.options: argparse.Namespace = options + self.default_options: argparse.Namespace = default_options + self.logger: logging.Logger = logging.getLogger("twister") + self.start_time: float = 0.0 + self.tplan: TestPlan | None = None + self.runner: TwisterRunner | None = None + self.hwm: HardwareMap | None = None + self.env: TwisterEnv | None = None + self.report: Reporting | None = None - hwm = HardwareMap(env) - ret = hwm.discover() - if ret == 0: - return 0 + def __repr__(self) -> str: + return f'{self.__class__.__name__}()' - env.hwm = hwm - - tplan = TestPlan(env) - try: - tplan.discover() - except RuntimeError as e: - logger.error(f"{e}") - return 1 - - if tplan.report() == 0: - return 0 + @classmethod + def create_instance(cls, argv: Sequence[str] | None = None) -> Twister: + """Create a new instance of Twister from CLI arguments.""" + parser = add_parse_arguments() + options = parse_arguments(parser, argv) + default_options = parse_arguments(parser, [], on_init=False) + return cls(options, default_options) + + def clean_previous_results(self) -> str | None: + """Run cleanup and return a results from previous session.""" + previous_results = None + if ( + self.options.no_clean + or self.options.only_failed + or self.options.test_only + or self.options.report_summary is not None + ): + if os.path.exists(self.options.outdir): + print("Keeping artifacts untouched") + elif self.options.last_metrics: + ls = os.path.join(self.options.outdir, "twister.json") + if os.path.exists(ls): + with open(ls) as fp: + previous_results = fp.read() + else: + sys.exit(f"Can't compare metrics with non existing file {ls}") + elif os.path.exists(self.options.outdir): + if self.options.clobber_output: + print(f"Deleting output directory {self.options.outdir}") + shutil.rmtree(self.options.outdir) + else: + for i in range(1, 100): + new_out = self.options.outdir + f".{i}" + if not os.path.exists(new_out): + print(f"Renaming previous output directory to {new_out}") + shutil.move(self.options.outdir, new_out) + break + else: + sys.exit( + f"Too many '{self.options.outdir}.*' directories. " + "Run either with --no-clean, " + "or --clobber-output, or delete these directories manually." + ) - try: - tplan.load() - except RuntimeError as e: - logger.error(f"{e}") - return 1 + return previous_results + + def configure_color_output(self) -> None: + """Configure color output.""" + color_strip = False if self.options.force_color else None + init_color(colorama_strip=color_strip) + + def export_previous_results(self, previous_results: str | None) -> str | None: + """Export previous results to a file and return path to that file.""" + previous_results_file = None + os.makedirs(self.options.outdir, exist_ok=True) + if self.options.last_metrics and previous_results: + previous_results_file = os.path.join(self.options.outdir, "baseline.json") + with open(previous_results_file, "w") as fp: + fp.write(previous_results) + return previous_results_file + + def create_test_plan(self, env: TwisterEnv) -> TestPlan: + """Create a test plan.""" + tplan = TestPlan(env) + try: + tplan.discover() + except RuntimeError as e: + self.logger.error(f"{e}") + raise SystemExit(1) from e - # if we are using command line platform filter, no need to list every - # other platform as excluded, we know that already. - # Show only the discards that apply to the selected platforms on the - # command line + if tplan.report() == 0: + raise SystemExit(0) - if options.verbose > 0: + try: + tplan.load() + except RuntimeError as e: + self.logger.error(f"{e}") + raise SystemExit(1) from e + + return tplan + + def discover_hardware_map(self, env: TwisterEnv) -> HardwareMap: + """Discover hardware map and return it.""" + hwm = HardwareMap(env) + ret = hwm.discover() + if ret == 0: + raise SystemExit(0) + return hwm + + def verbose(self, tplan: TestPlan) -> None: + """Print additional info for verbose.""" for i in tplan.instances.values(): - if i.status in [TwisterStatus.SKIP,TwisterStatus.FILTER]: - if options.platform and not tplan.check_platform(i.platform, options.platform): + if i.status in [TwisterStatus.SKIP, TwisterStatus.FILTER]: + if ( + self.options.platform + and not tplan.check_platform(i.platform, self.options.platform) + ): continue # Filtered tests should be visible only when verbosity > 1 - if options.verbose < 2 and i.status == TwisterStatus.FILTER: + if self.options.verbose < 2 and i.status == TwisterStatus.FILTER: continue res = i.reason if "Quarantine" in i.reason: res = "Quarantined" - logger.info( + self.logger.info( f"{i.platform.name:<25} {i.testsuite.name:<50}" f" {Fore.YELLOW}{i.status.upper()}{Fore.RESET}: {res}" - ) + ) + + def create_report(self, tplan: TestPlan, env: TwisterEnv) -> Reporting: + """Create a report.""" + report = Reporting(tplan, env) + plan_file = os.path.join(self.options.outdir, "testplan.json") + if not os.path.exists(plan_file): + report.json_report(plan_file, env.version) + + if self.options.save_tests: + report.json_report(self.options.save_tests, env.version) + raise SystemExit(0) + + if self.options.report_summary is not None: + if self.options.report_summary < 0: + self.logger.error("The report summary value cannot be less than 0") + raise SystemExit(1) + report.synopsis() + raise SystemExit(0) + return report + + def execute(self, tplan: TestPlan, env: TwisterEnv, hwm: HardwareMap) -> TwisterRunner: + """Run twister runner.""" + runner = TwisterRunner(tplan.instances, tplan.testsuites, env) + runner.duts = hwm.duts + runner.run() + return runner + + def match_platforms_names(self, hwm: HardwareMap, tplan: TestPlan) -> None: + # FIXME: This is a workaround for the fact that the hardware map can be usng + # the short name of the platform, while the testplan is using the full name. + # + # convert platform names coming from the hardware map to the full target + # name. + # this is needed to match the platform names in the testplan. + for d in hwm.duts: + if d.platform in tplan.platform_names: + d.platform = tplan.get_platform(d.platform).name + + def prepare_reports(self, report: Reporting, previous_results_file: str | None) -> None: + """Prepare reports.""" + # figure out which report to use for size comparison + report_to_use = None + if self.options.compare_report: + report_to_use = self.options.compare_report + elif self.options.last_metrics: + report_to_use = previous_results_file + + report.footprint_reports( + report_to_use, + self.options.show_footprint, + self.options.all_deltas, + self.options.footprint_threshold, + self.options.last_metrics, + ) + + duration = time.time() - self.start_time + + if self.options.verbose > 1: + self.runner.results.summary() + + report.summary(self.runner.results, duration) + + report.coverage_status = True + if self.options.coverage and not self.options.disable_coverage_aggregation: + if not self.options.build_only: + report.coverage_status, report.coverage = run_coverage(self.options, self.tplan) + else: + self.logger.info("Skipping coverage report generation due to --build-only.") - report = Reporting(tplan, env) - plan_file = os.path.join(options.outdir, "testplan.json") - if not os.path.exists(plan_file): - report.json_report(plan_file, env.version) + if self.options.device_testing and not self.options.build_only: + self.hwm.summary(self.tplan.selected_platforms) - if options.save_tests: - report.json_report(options.save_tests, env.version) - return 0 + report.save_reports( + self.options.report_name, + self.options.report_suffix, + self.options.report_dir, + self.options.no_update, + self.options.platform_reports, + ) - if options.report_summary is not None: - if options.report_summary < 0: - logger.error("The report summary value cannot be less than 0") - return 1 report.synopsis() - return 0 - # FIXME: This is a workaround for the fact that the hardware map can be usng - # the short name of the platform, while the testplan is using the full name. - # - # convert platform names coming from the hardware map to the full target - # name. - # this is needed to match the platform names in the testplan. - for d in hwm.duts: - if d.platform in tplan.platform_names: - d.platform = tplan.get_platform(d.platform).name - - if options.device_testing and not options.build_only: - print("\nDevice testing on:") - hwm.dump(filtered=tplan.selected_platforms) - print("") - - if options.dry_run: - duration = time.time() - start_time - logger.info(f"Completed in {duration:.2f} seconds") - return 0 + if self.options.package_artifacts: + artifacts = Artifacts(self.env) + artifacts.package() + + if ( + self.runner.results.failed + or self.runner.results.error + or (self.tplan.warnings and self.options.warnings_as_errors) + or (self.options.coverage and not report.coverage_status) + ): + if self.env.options.quit_on_failure: + self.logger.info("twister aborted because of a failure/error") + else: + self.logger.info("Run completed") + raise SystemExit(1) - if options.short_build_path: - tplan.create_build_dir_links() - - runner = TwisterRunner(tplan.instances, tplan.testsuites, env) - runner.duts = hwm.duts - runner.run() - - # figure out which report to use for size comparison - report_to_use = None - if options.compare_report: - report_to_use = options.compare_report - elif options.last_metrics: - report_to_use = previous_results_file - - report.footprint_reports( - report_to_use, - options.show_footprint, - options.all_deltas, - options.footprint_threshold, - options.last_metrics, - ) + @catch_system_exit_exception + def run(self) -> int: + """Run twister.""" + self.start_time = time.time() - duration = time.time() - start_time + self.configure_color_output() - if options.verbose > 1: - runner.results.summary() + previous_results = self.clean_previous_results() + previous_results_file = self.export_previous_results(previous_results) - report.summary(runner.results, duration) + setup_logging( + self.options.outdir, + self.options.log_file, + self.options.log_level, + self.options.timestamps, + ) - report.coverage_status = True - if options.coverage and not options.disable_coverage_aggregation: - if not options.build_only: - report.coverage_status, report.coverage = run_coverage(options, tplan) - else: - logger.info("Skipping coverage report generation due to --build-only.") + self.env = TwisterEnv(self.options, self.default_options) + self.env.discover() - if options.device_testing and not options.build_only: - hwm.summary(tplan.selected_platforms) + self.hwm = self.env.hwm = self.discover_hardware_map(self.env) - report.save_reports( - options.report_name, - options.report_suffix, - options.report_dir, - options.no_update, - options.platform_reports, - ) + self.tplan = self.create_test_plan(self.env) - report.synopsis() + # if we are using command line platform filter, no need to list every + # other platform as excluded, we know that already. + # Show only the discards that apply to the selected platforms on the + # command line - if options.package_artifacts: - artifacts = Artifacts(env) - artifacts.package() + if self.options.verbose > 0: + self.verbose(self.tplan) - if ( - runner.results.failed - or runner.results.error - or (tplan.warnings and options.warnings_as_errors) - or (options.coverage and not report.coverage_status) - ): - if env.options.quit_on_failure: - logger.info("twister aborted because of a failure/error") - else: - logger.info("Run completed") - return 1 + self.report = self.create_report(self.tplan, self.env) - logger.info("Run completed") - return 0 + self.match_platforms_names(self.hwm, self.tplan) + + if self.options.device_testing and not self.options.build_only: + print("\nDevice testing on:") + self.hwm.dump(filtered=self.tplan.selected_platforms) + print("") + + if self.options.dry_run: + duration = time.time() - self.start_time + self.logger.info(f"Completed in {duration:.2f} seconds") + return 0 + + if self.options.short_build_path: + self.tplan.create_build_dir_links() + + self.runner = self.execute(self.tplan, self.env, self.hwm) + + self.prepare_reports(self.report, previous_results_file) + + self.logger.info("Run completed") + return 0 + + +def twister(options: argparse.Namespace, default_options: argparse.Namespace) -> int: + """Run twister.""" + # function for backward compatibility + warnings.warn( + "Function `twister` is deprecated, use `Twister` class instead", + DeprecationWarning, + stacklevel=2 + ) + return Twister(options, default_options).run() def main(argv: Sequence[str] | None = None) -> int: """Main function to run twister.""" try: python_version_guard() - - parser = add_parse_arguments() - options = parse_arguments(parser, argv) - default_options = parse_arguments(parser, [], on_init=False) - return twister(options, default_options) + twister_instance = Twister.create_instance(argv) + return twister_instance.run() finally: close_logging() if (os.name != "nt") and os.isatty(1): diff --git a/scripts/west_commands/twister_cmd.py b/scripts/west_commands/twister_cmd.py index b96ab1b37175..93b39017e399 100644 --- a/scripts/west_commands/twister_cmd.py +++ b/scripts/west_commands/twister_cmd.py @@ -18,7 +18,7 @@ sys.path.insert(0, str(twister_path / "pylib" / "twister")) from twisterlib.environment import add_parse_arguments, parse_arguments, python_version_guard -from twisterlib.twister_main import twister +from twisterlib.twister_main import Twister as TwisterMain TWISTER_DESCRIPTION = """\ Convenience wrapper for twister. The below options are shared with the twister @@ -58,7 +58,7 @@ def do_run(self, args, remainder): options = parse_arguments(self.parser, args=remainder, options=args) default_options = parse_arguments(self.parser, args=[], on_init=False) - ret = twister(options, default_options) + ret = TwisterMain(options, default_options).run() sys.exit(ret) def _parse_arguments(self, args, options): From 6cd491a81123732833c03634fdee97ac40add34b Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 4 Feb 2026 15:22:11 +0100 Subject: [PATCH 1864/3334] [nrf fromtree] manifest: update hal_nordic revision and IronSide SE support code Pull in updated IronSide SE supporting code and adapt the Zephyr integration layers: * Implement the glue function interfaces for doing data cache operations, which are needed for some of the IronSide SE APIs. * Add an option to the PERIPHCONF entry generator for not locking SPU registers. This will be used to enable reconfiguration of the SPU registers using an IPC call after their initial configuration at boot. Signed-off-by: Jonathan Nilsen (cherry picked from commit 50f5dfc7f314e27f8dce23f1c0f9dcfdc51f93a5) --- modules/hal_nordic/ironside/se/CMakeLists.txt | 8 +++++++ modules/hal_nordic/ironside/se/Kconfig | 13 ++++++++++- modules/hal_nordic/ironside/se/glue.c | 22 +++++++++++++++++++ .../se/scripts/gen_periphconf_entries.py | 8 ++++++- .../ironside/se/scripts/periphconf/builder.py | 14 +++++++++++- west.yml | 2 +- 6 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 modules/hal_nordic/ironside/se/glue.c diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index 50379a084cb9..8532072b0b0a 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -18,6 +18,7 @@ zephyr_library_property(ALLOW_EMPTY TRUE) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL ${IRONSIDE_SUPPORT_DIR}/se/src/ironside_se_api.c call.c + glue.c ) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c) @@ -26,6 +27,12 @@ if(CONFIG_NRF_PERIPHCONF_SECTION) endif() if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) + set(optional_args) + if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES_LOCK) + list(APPEND optional_args --lock) + else() + list(APPEND optional_args --no-lock) + endif() set(periphconf_entries_c_file ${PROJECT_BINARY_DIR}/periphconf_entries_generated.c) execute_process( COMMAND @@ -34,6 +41,7 @@ if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) --soc ${CONFIG_SOC} --in-edt-pickle ${EDT_PICKLE} --out-periphconf-source ${periphconf_entries_c_file} + ${optional_args} WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMAND_ERROR_IS_FATAL ANY ) diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index eae311bef6d0..99692fb228e0 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -55,12 +55,23 @@ menuconfig NRF_PERIPHCONF_SECTION Include static global domain peripheral initialization values from the build in a dedicated section in the devnull region. +if NRF_PERIPHCONF_SECTION + config NRF_PERIPHCONF_GENERATE_ENTRIES bool "Generate PERIPHCONF entries source file" default y - depends on NRF_PERIPHCONF_SECTION help Generate a C file containing PERIPHCONF entries based on the device configuration in the devicetree. +config NRF_PERIPHCONF_GENERATE_ENTRIES_LOCK + bool "Lock registers in PERIPHCONF" + default y + depends on NRF_PERIPHCONF_GENERATE_ENTRIES + help + Set the lock bit in registers that support it. + Disable this to allow the registers to be reconfigured after boot. + +endif # NRF_PERIPHCONF_SECTION + endmenu # IronSide SE diff --git a/modules/hal_nordic/ironside/se/glue.c b/modules/hal_nordic/ironside/se/glue.c new file mode 100644 index 000000000000..130ed4eae002 --- /dev/null +++ b/modules/hal_nordic/ironside/se/glue.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +void ironside_se_data_cache_writeback(void *addr, size_t size) +{ + sys_cache_data_flush_range(addr, size); +} + +void ironside_se_data_cache_invalidate(void *addr, size_t size) +{ + sys_cache_data_invd_range(addr, size); +} + +void ironside_se_data_cache_writeback_invalidate(void *addr, size_t size) +{ + sys_cache_data_flush_and_invd_range(addr, size); +} diff --git a/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py b/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py index b30d36f4c7f6..f7b1537a7afc 100644 --- a/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py +++ b/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py @@ -126,6 +126,12 @@ def parse_args() -> argparse.Namespace: "Used to look up soc specific hardware information" ), ) + parser.add_argument( + "--lock", + action=argparse.BooleanOptionalAction, + default=True, + help="Value to set for the lock bit in registers that support it.", + ) parser.add_argument( "--in-edt-pickle", type=argparse.FileType("rb"), @@ -146,7 +152,7 @@ def main() -> None: dt = pickle.load(args.in_edt_pickle) processor = dt_processor_id(dt) lookup_tables = lookup_tables_get(Soc.soc(args.soc), Family.family(args.soc)) - builder = PeriphconfBuilder(dt, lookup_tables) + builder = PeriphconfBuilder(dt, lookup_tables, lock_value=args.lock) # Application local peripherals if processor == ProcessorId.APPLICATION: diff --git a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py index 7c214b46ff09..461b0de4f3c3 100644 --- a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py +++ b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py @@ -98,17 +98,20 @@ def __init__( self, dt: EDT, lookup_tables: SocLookupTables, + lock_value: bool = True, ) -> None: """Builder class used to generate a PERIPHCONF C source file based on the devicetree. :param dt: Devicetree object. :param lookup_tables: Lookup table object containing soc-specific information. + :param lock_value: Lock bit value to set in the registers that support it. """ self._dt = dt self._hw_tables = lookup_tables self._processor_id = dt_processor_id(dt) self._owner_id = self._processor_id.default_owner_id + self._lock_value = lock_value self._macros = [] self._ipcmap_idx = 0 @@ -277,6 +280,7 @@ def _add_global_peripheral_spu_permissions( secure, dma_secure, self._owner_id.c_enum, + self._lock_value, ], comment=f"{spu_name}: {periph_label} permissions", ) @@ -346,6 +350,7 @@ def _add_nrf_gpiote_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, + self._lock_value, ], comment=f"{spu_name}: {instance_name} ch. {num} permissions", ) @@ -376,6 +381,7 @@ def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, + self._lock_value, ], comment=f"{spu_name}: {instance_name} ch. {num} permissions", ) @@ -390,6 +396,7 @@ def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, + self._lock_value, ], comment=f"{spu_name}: {instance_name} ch. group {num} permissions", ) @@ -439,6 +446,7 @@ def _link_dppi_channels( [ Address(sub_ppib_addr), sub_ppib_ch, + True, ], comment=( f"SUB: {sub_ppib_name} ch. {sub_ppib_ch} => {pub_ppib_name} ch. {pub_ppib_ch}" @@ -451,6 +459,7 @@ def _link_dppi_channels( [ Address(pub_ppib_addr), pub_ppib_ch, + True, ], comment=( f"PUB: {sub_ppib_name} ch. {sub_ppib_ch} => {pub_ppib_name} ch. {pub_ppib_ch}" @@ -476,6 +485,7 @@ def _add_nrf_ipct_global_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, + self._lock_value, ], comment=f"{spu_name}: {instance_name} ch. {num} permissions", ) @@ -537,7 +547,7 @@ def _link_ipct_channel( self._macros.append( MacroCall( "PERIPHCONF_IPCMAP_CHANNEL_SOURCE", - [self._ipcmap_idx, source_domain.c_enum, source_ch], + [self._ipcmap_idx, source_domain.c_enum, source_ch, True], comment=( f"{source_domain.name} IPCT ch. {source_ch} => " f"{sink_domain.name} IPCT ch. {sink_ch}" @@ -573,6 +583,7 @@ def _add_nrf_grtc_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, + self._lock_value, ], comment=f"{spu_name}: GRTC CC{num} permissions", ) @@ -696,6 +707,7 @@ def _configure_gpio_pin( num, secure, self._owner_id.c_enum, + self._lock_value, ], comment=f"{spu_name}: P{gpio_port}.{num} permissions", ) diff --git a/west.yml b/west.yml index f1ca6eb10401..033982273c98 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 63f2083ff9bc9c39b39f0a874becc7cf8e011a2a + revision: 5c1df3fe9bc144e558b3506cef6cf33652bb2539 path: modules/hal/nordic groups: - hal From 4712a645d8625a5c28520c89f440e1f463be3960 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 11 Feb 2026 10:19:46 +0100 Subject: [PATCH 1865/3334] [nrf fromtree] soc: nordic: uicr: use IRONSIDE_SUPPORT_DIR for the script location Use the IRONSIDE_SUPPORT_DIR cmake variable to determine the location of the UICR generator script location, to allow overriding the location if needed. Since the CMake that would normally set this variable in modules/hal_nordic/ironside/se/CMakeLists.txt is not actually run in the gen_uicr image, refactor the logic for setting the variable so that it can be included in the gen_uicr image directly. Signed-off-by: Jonathan Nilsen (cherry picked from commit 352c4ae52a9ccc676b8c8e37d4af577f4a2e32e3) --- modules/hal_nordic/ironside/se/CMakeLists.txt | 9 +-------- .../hal_nordic/ironside/se/ironside_support_dir.cmake | 8 ++++++++ soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 5 ++++- 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 modules/hal_nordic/ironside/se/ironside_support_dir.cmake diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index 8532072b0b0a..87dbeb333038 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -1,14 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -# The IronSide source directory can be overridden by setting -# IRONSIDE_SUPPORT_DIR before invoking the build system. -zephyr_get(IRONSIDE_SUPPORT_DIR SYSBUILD GLOBAL) -if(NOT DEFINED IRONSIDE_SUPPORT_DIR) - set(IRONSIDE_SUPPORT_DIR - ${ZEPHYR_CURRENT_MODULE_DIR}/ironside CACHE PATH "IronSide Support Directory" - ) -endif() +include(./ironside_support_dir.cmake) zephyr_include_directories(include) zephyr_include_directories(${IRONSIDE_SUPPORT_DIR}/se/include) diff --git a/modules/hal_nordic/ironside/se/ironside_support_dir.cmake b/modules/hal_nordic/ironside/se/ironside_support_dir.cmake new file mode 100644 index 000000000000..cb1d16ee3ac1 --- /dev/null +++ b/modules/hal_nordic/ironside/se/ironside_support_dir.cmake @@ -0,0 +1,8 @@ +# The IronSide source directory can be overridden by setting +# IRONSIDE_SUPPORT_DIR before invoking the build system. +zephyr_get(IRONSIDE_SUPPORT_DIR SYSBUILD GLOBAL) +if(NOT DEFINED IRONSIDE_SUPPORT_DIR) + set(IRONSIDE_SUPPORT_DIR + ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/ironside CACHE PATH "IronSide Support Directory" + ) +endif() diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index d6af0c6cbb33..6f7f69649fd3 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -17,6 +17,9 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE} ) +# Needed since the CMakeLists.txt that would normally set this is not run in this image. +include(${ZEPHYR_BASE}/modules/hal_nordic/ironside/se/ironside_support_dir.cmake) + project(uicr) # Function to parse a Kconfig value from a .config file @@ -261,7 +264,7 @@ endif() # Generate hex files (merged, uicr-only, periphconf-only, and secondary-periphconf-only) add_custom_command( OUTPUT ${merged_hex_file} ${uicr_hex_file} ${periphconf_hex_file} ${secondary_periphconf_hex_file} - COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/ironside/se/tool/ironside/__main__.py + COMMAND ${PYTHON_EXECUTABLE} ${IRONSIDE_SUPPORT_DIR}/se/tool/ironside/__main__.py gen-uicr --uicr-address ${UICR_ADDRESS} --out-merged-hex ${merged_hex_file} From 3b739f795fe013e49b2c35646956df21d24f88ff Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Mon, 2 Feb 2026 16:54:25 +0100 Subject: [PATCH 1866/3334] [nrf fromtree] soc: nordic: uicr: make it possible to keep the PERIPHCONF section Add a config that can be disabled to keep the PERIPHCONF data in the firmware binary rather than stripping it. When the option is disabled for a given image, the UICR generator does not include that image's PERIPHCONF data in the UICR PERIPHCONF blob, instead it is expected that it is loaded separately via an IronSide API call. Signed-off-by: Jonathan Nilsen (cherry picked from commit ceb55f56cc78076b70731f3dbdb9909154c0bb6c) --- modules/hal_nordic/ironside/se/Kconfig | 25 +++++++++++++++++-- modules/hal_nordic/ironside/se/uicr.ld | 8 ++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 6 +++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index 99692fb228e0..04e271c0b78b 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -50,13 +50,27 @@ endif # IRONSIDE_SE_DVFS menuconfig NRF_PERIPHCONF_SECTION bool "Global peripheral initialization section" depends on LINKER_DEVNULL_SUPPORT - imply LINKER_DEVNULL_MEMORY help Include static global domain peripheral initialization values from the - build in a dedicated section in the devnull region. + build in a dedicated section. The section is either stripped from the + firmware binary or kept as constant data, depending on how it will be + loaded at runtime. if NRF_PERIPHCONF_SECTION +config NRF_PERIPHCONF_SECTION_STRIP + bool "Strip the section from the binary" + default y if !NRF_PERIPHCONF_SECTION_KEEP_BY_DEFAULT + imply LINKER_DEVNULL_MEMORY + help + Strip the PERIPHCONF section from the firmware binary. + If the UICR generator image is enabled, it will include the stripped section + in the generated UICR PERIPHCONF blob. + + When this is disabled, the PERIPHCONF section will remain as data in the binary, + and will not included in the UICR PERIPHCONF blob. Instead, it is expected that + it will be loaded via the ironside_se_periphconf_write() API. + config NRF_PERIPHCONF_GENERATE_ENTRIES bool "Generate PERIPHCONF entries source file" default y @@ -74,4 +88,11 @@ config NRF_PERIPHCONF_GENERATE_ENTRIES_LOCK endif # NRF_PERIPHCONF_SECTION +config NRF_PERIPHCONF_SECTION_KEEP_BY_DEFAULT + bool "Keep the PERIPHCONF section by default (set by build system)" + help + This is set from Sysbuild to change the default behavior for the image so that + CONFIG_NRF_PERIPHCONF_SECTION_STRIP=n unless explicitly configured otherwise. + To override this behavior, set CONFIG_NRF_PERIPHCONF_SECTION_STRIP=y directly. + endmenu # IronSide SE diff --git a/modules/hal_nordic/ironside/se/uicr.ld b/modules/hal_nordic/ironside/se/uicr.ld index adc2e2cc3f64..acfc52242893 100644 --- a/modules/hal_nordic/ironside/se/uicr.ld +++ b/modules/hal_nordic/ironside/se/uicr.ld @@ -5,7 +5,15 @@ #include +#if defined(CONFIG_NRF_PERIPHCONF_SECTION_STRIP) + SECTION_PROLOGUE(periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) { Z_LINK_ITERABLE(periphconf_entry); } GROUP_ROM_LINK_IN(DEVNULL_REGION, DEVNULL_REGION) + +#else + +ITERABLE_SECTION_ROM(periphconf_entry, Z_LINK_ITERABLE_SUBALIGN) + +#endif diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 6f7f69649fd3..fe30c1c1e150 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -169,6 +169,12 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) endif() if(EXISTS ${_dir}/zephyr/zephyr.dts) + # If the PERIPHCONF is configured to remain in the firmware, do not include it here. + parse_kconfig_value(${_dir}/zephyr/.config CONFIG_NRF_PERIPHCONF_SECTION_STRIP strip_periphconf) + if(NOT (strip_periphconf STREQUAL "y")) + continue() + endif() + # Read CONFIG_KERNEL_BIN_NAME from the sibling's .config file parse_kconfig_value(${_dir}/zephyr/.config CONFIG_KERNEL_BIN_NAME kernel_bin_name) set(kernel_elf_path ${_dir}/zephyr/${kernel_bin_name}.elf) From e1bbf3144cb8af4ae01c2f42a048e8254eb87cdc Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Mon, 2 Feb 2026 16:58:08 +0100 Subject: [PATCH 1867/3334] [nrf fromtree] soc: nordic: uicr: add support for UICR.POLICY_PERIPHCONFSTAGE Add support for configuring the "PERIPHCONF stage" that is set when the application core is started by IronSide SE. This configures which permissions the application has when calling the IronSide PERIPHCONF write API at boot time. The new option is part of the new version 2.1 of the UICR format. IronSide SE versions that do not support the 2.1 format version will fail the boot if given a UICR with that version number. To avoid forcing users to upgrade IronSide, the UICR generator only sets the UICR format version to 2.1 if a PERIPHCONF stage policy is explicitly set, otherwise it will default to the 2.0 version. Signed-off-by: Jonathan Nilsen (cherry picked from commit 04bebca0f41c3d87b0aff4856f7b8fa286febbe1) --- soc/nordic/common/uicr/Kconfig.gen_uicr | 31 +++++++++++++++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 6 ++++ 2 files changed, 37 insertions(+) diff --git a/soc/nordic/common/uicr/Kconfig.gen_uicr b/soc/nordic/common/uicr/Kconfig.gen_uicr index 4ee6af87eaef..0e726e6712bb 100644 --- a/soc/nordic/common/uicr/Kconfig.gen_uicr +++ b/soc/nordic/common/uicr/Kconfig.gen_uicr @@ -274,4 +274,35 @@ config GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES endif # GEN_UICR_SECONDARY +choice GEN_UICR_POLICY_PERIPHCONF_STAGE + bool "UICR.POLICY_PERIPHCONFSTAGE" + default GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL + help + Sets the behavior of the IronSide SE PERIPHCONF service APIs at boot. + +config GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL + bool "Normal operation stage" + help + The API starts in the normal operation stage, meaning that no explicit + API call is needed to finish initialization. + +config GEN_UICR_POLICY_PERIPHCONF_STAGE_INIT + bool "Initialization stage" + help + The API starts in the initialization stage, which gives permission + to write any register supported by the UICR PERIPHCONF blob without CPU based + restrictions. To finish initialization, the application must notify IronSide SE + via the ironside_se_periphconf_finish_init() API. + + Enabling this policy option causes the generated UICR format version to be set + to >= 2.1, which requires IronSide SE v23.3.0+26 or higher to be installed. + +endchoice + +config GEN_UICR_POLICY_PERIPHCONF_STAGE_VALUE + hex + default 0xBD2328A8 if GEN_UICR_POLICY_PERIPHCONF_STAGE_INIT + default 0x1730C77F if GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL + default 0 + endmenu diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index fe30c1c1e150..81b5c59c63bd 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -82,6 +82,7 @@ set(protectedmem_args) set(periphconf_args) set(wdtstart_args) set(periphconf_elfs) +set(policy_args) set(merged_hex_file ${APPLICATION_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.hex) set(secondary_periphconf_elfs) set(uicr_hex_file ${APPLICATION_BINARY_DIR}/zephyr/uicr.hex) @@ -267,6 +268,10 @@ if(CONFIG_GEN_UICR_SECONDARY) endif() endif() +if(CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL) + list(APPEND policy_args --policy-periphconf-stage ${CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_VALUE}) +endif() + # Generate hex files (merged, uicr-only, periphconf-only, and secondary-periphconf-only) add_custom_command( OUTPUT ${merged_hex_file} ${uicr_hex_file} ${periphconf_hex_file} ${secondary_periphconf_hex_file} @@ -285,6 +290,7 @@ add_custom_command( ${securestorage_args} ${protectedmem_args} ${secondary_args} + ${policy_args} DEPENDS ${periphconf_elfs} ${secondary_periphconf_elfs} WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} COMMENT "Using gen_uicr.py to generate ${merged_hex_file}, ${uicr_hex_file}, ${periphconf_hex_file}, and ${secondary_periphconf_hex_file} from ${periphconf_elfs} ${secondary_periphconf_elfs}" From b839e83e85f04fb7e06a001fd5c7c88c26125675 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 12 Feb 2026 12:51:16 +0000 Subject: [PATCH 1868/3334] [nrf noup] dts: nrf54h20: fix formatting error nrf-squash! [nrf noup] dts: Add Bluetooth Controller to nRF54H20 Formatting problem from upmerge causing error during any PR to nrf54h20 file. Signed-off-by: David Jewsbury --- dts/vendor/nordic/nrf54h20.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index ca2d475ec00b..7c520011a208 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -507,6 +507,7 @@ compatible = "nordic,bt-hci-sdc"; status = "disabled"; }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From df8d673f1873b85e17210830db89bf5f7443fd57 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Fri, 30 Jan 2026 14:56:51 +0000 Subject: [PATCH 1869/3334] [nrf fromtree] drivers: nrf_auxpll: Fix frequency calculation The out_div dts setting differs to the register setting causing the frequency calcuation to be incorrect. This was originally intended to be fixed in NRFX but this requires further investigation on how to approach translation of literal values to enums in NRFX. This PR adds a helper function for the conversion for now and changes the devicetree bindings to align with the literal value. Signed-off-by: David Jewsbury (cherry picked from commit 0f90354a27ef17a4540f3bd03a9d8701a3f0655e) --- .../clock_control/clock_control_nrf_auxpll.c | 41 ++++++++++++++----- dts/bindings/clock/nordic,nrf-auxpll.yaml | 16 ++++---- include/zephyr/dt-bindings/clock/nrf-auxpll.h | 10 ----- 3 files changed, 38 insertions(+), 29 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf_auxpll.c b/drivers/clock_control/clock_control_nrf_auxpll.c index 0aa4c059d964..3fc747b96df5 100644 --- a/drivers/clock_control/clock_control_nrf_auxpll.c +++ b/drivers/clock_control/clock_control_nrf_auxpll.c @@ -30,15 +30,6 @@ CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_USB24M, NRF_AUXPLL_FREQUENCY_USB_2 CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_AUDIO_48K, NRF_AUXPLL_FREQUENCY_AUDIO_48K); CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_MAX, NRF_AUXPLL_FREQUENCY_DIV_MAX); -CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_1, NRF_AUXPLL_CTRL_OUTSEL_DIV_1); -CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_2, NRF_AUXPLL_CTRL_OUTSEL_DIV_2); -CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_3, NRF_AUXPLL_CTRL_OUTSEL_DIV_3); -CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_4, NRF_AUXPLL_CTRL_OUTSEL_DIV_4); -CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_6, NRF_AUXPLL_CTRL_OUTSEL_DIV_6); -CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_8, NRF_AUXPLL_CTRL_OUTSEL_DIV_8); -CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_12, NRF_AUXPLL_CTRL_OUTSEL_DIV_12); -CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_16, NRF_AUXPLL_CTRL_OUTSEL_DIV_16); - /* maximum lock time in us, >10x time observed experimentally */ #define AUXPLL_LOCK_TIME_MAX_US 20000 /* lock wait step in us*/ @@ -56,9 +47,37 @@ struct clock_control_nrf_auxpll_config { uint32_t ficr_ctune; nrf_auxpll_config_t cfg; nrf_auxpll_freq_div_ratio_t frequency; - nrf_auxpll_ctrl_outsel_t out_div; + uint8_t out_div; }; +/* Helper function to convert out_div to register AUXPLLCTRL.OUTSEL value */ +static inline void set_out_div(const struct clock_control_nrf_auxpll_config *config) +{ + nrf_auxpll_ctrl_outsel_t out_div_nrfx; + uint8_t out_div_dts = config->out_div; + + switch (out_div_dts) { + case NRF_AUXPLL_CTRL_OUTSEL_DIV_6: + out_div_nrfx = (nrf_auxpll_ctrl_outsel_t)AUXPLL_AUXPLLCTRL_OUTSEL_OUTSEL_Div6; + break; + case NRF_AUXPLL_CTRL_OUTSEL_DIV_8: + out_div_nrfx = (nrf_auxpll_ctrl_outsel_t)AUXPLL_AUXPLLCTRL_OUTSEL_OUTSEL_Div8; + break; + case NRF_AUXPLL_CTRL_OUTSEL_DIV_12: + out_div_nrfx = (nrf_auxpll_ctrl_outsel_t)AUXPLL_AUXPLLCTRL_OUTSEL_OUTSEL_Div12; + break; + case NRF_AUXPLL_CTRL_OUTSEL_DIV_16: + out_div_nrfx = (nrf_auxpll_ctrl_outsel_t)AUXPLL_AUXPLLCTRL_OUTSEL_OUTSEL_Div16; + break; + default: + /* Values less than 5 align with the OUTSEL register value */ + out_div_nrfx = out_div_dts; + break; + } + + nrf_auxpll_ctrl_outsel_set(config->auxpll, out_div_nrfx); +} + static int clock_control_nrf_auxpll_on(struct dev_data_auxpll *dev_data) { const struct clock_control_nrf_auxpll_config *config = dev_data->dev->config; @@ -190,7 +209,7 @@ static int clock_control_nrf_auxpll_init(const struct device *dev) nrf_auxpll_lock(config->auxpll); nrf_auxpll_trim_ctune_set(config->auxpll, sys_read8(config->ficr_ctune)); nrf_auxpll_config_set(config->auxpll, &config->cfg); - nrf_auxpll_ctrl_outsel_set(config->auxpll, config->out_div); + set_out_div(config); nrf_auxpll_unlock(config->auxpll); nrf_auxpll_ctrl_mode_set(config->auxpll, NRF_AUXPLL_CTRL_MODE_LOCKED); diff --git a/dts/bindings/clock/nordic,nrf-auxpll.yaml b/dts/bindings/clock/nordic,nrf-auxpll.yaml index c9e4bf1c2379..e14dd7699480 100644 --- a/dts/bindings/clock/nordic,nrf-auxpll.yaml +++ b/dts/bindings/clock/nordic,nrf-auxpll.yaml @@ -48,14 +48,14 @@ properties: nordic,out-div: type: int enum: - - 1 # Division of 1 - - 2 # Division of 2 - - 3 # Division of 3 - - 4 # Division of 4 - - 5 # Division of 6 - - 6 # Division of 8 - - 7 # Division of 12 - - 8 # Division of 16 + - 1 + - 2 + - 3 + - 4 + - 6 + - 8 + - 12 + - 16 description: PLL output divider. Valid values shown in dt-bindings/clock/nrf-auxpll.h. nordic,out-drive: diff --git a/include/zephyr/dt-bindings/clock/nrf-auxpll.h b/include/zephyr/dt-bindings/clock/nrf-auxpll.h index d40940b6a62f..a07c96997597 100644 --- a/include/zephyr/dt-bindings/clock/nrf-auxpll.h +++ b/include/zephyr/dt-bindings/clock/nrf-auxpll.h @@ -13,14 +13,4 @@ #define NRF_AUXPLL_FREQ_DIV_AUDIO_48K 39845 #define NRF_AUXPLL_FREQ_DIV_MAX 65535 -#define NRF_AUXPLL_OUT_DIV_DISABLED 0 -#define NRF_AUXPLL_OUT_DIV_1 1 -#define NRF_AUXPLL_OUT_DIV_2 2 -#define NRF_AUXPLL_OUT_DIV_3 3 -#define NRF_AUXPLL_OUT_DIV_4 4 -#define NRF_AUXPLL_OUT_DIV_6 5 -#define NRF_AUXPLL_OUT_DIV_8 6 -#define NRF_AUXPLL_OUT_DIV_12 7 -#define NRF_AUXPLL_OUT_DIV_16 8 - #endif /* #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_ */ From fcd99e9b5d45d7609125b3c0b2a8b2c75b31ef01 Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Fri, 30 Jan 2026 14:58:33 +0000 Subject: [PATCH 1870/3334] [nrf fromtree] dts: nordic: edit auxpll nodes to remove out-div macros The out-div binding was removed as dts setting now aligns literal value, not register value. This commit updates the out-div node entry to be the literal values as the translation is now handled in the driver. Signed-off-by: David Jewsbury (cherry picked from commit 346abf8a37f51688b012df902c638623e9860b78) --- dts/vendor/nordic/nrf54h20.dtsi | 2 +- dts/vendor/nordic/nrf7120_enga.dtsi | 2 +- dts/vendor/nordic/nrf9280.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 7c520011a208..b73f519b56ad 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -694,7 +694,7 @@ #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; nordic,frequency = ; - nordic,out-div = ; + nordic,out-div = <2>; nordic,out-drive = <0>; nordic,current-tune = <6>; nordic,sdm-disable; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index d5ba811d2d3e..105743cec16a 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -885,7 +885,7 @@ * not defined yet */ nordic,ficrs = <&ficr 0>; - nordic,out-div = ; + nordic,out-div = <12>; nordic,out-drive = <0>; nordic,current-tune = <9>; nordic,sdm-disable; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 97a1bf7495b0..6ab6f6e439da 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -450,7 +450,7 @@ #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; nordic,frequency = ; - nordic,out-div = ; + nordic,out-div = <2>; nordic,out-drive = <0>; nordic,current-tune = <6>; nordic,sdm-disable; From 6726cf87c22cca5ceafbad51876d730351e32807 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Tue, 17 Feb 2026 13:01:51 +0000 Subject: [PATCH 1871/3334] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding for nRF7120" This reverts commit ba1fe7dc8aef8a8165fe2a0dd3b8de4ceedabedb. Signed-off-by: Robert Robinson --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 256f2d8f43b8..39e815afc199 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,7 +17,6 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -38,10 +37,6 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { - status = "okay"; -}; - &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; From 4622dbf1ec9b4b700f64d037056083465fb525b4 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Tue, 17 Feb 2026 13:01:58 +0000 Subject: [PATCH 1872/3334] Revert "[nrf noup] dts: choose a psa-rng for entropy for nRF7120" This reverts commit a16a0de16b8e5bee2895c44892a7945d292daa48. Signed-off-by: Robert Robinson --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 39e815afc199..829836660cad 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -27,13 +27,13 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "disabled"; + status = "okay"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "okay"; + status = "disabled"; }; }; From b37bb7abf11581e0e9c38888acc3e2d303d6276d Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Wed, 4 Feb 2026 12:06:18 +0000 Subject: [PATCH 1873/3334] [nrf fromtree] dts: nordic: nRF7120: Add missing power register in dtsi Power register was missing from nrf7120_enga.dtsi, this commit includes it. Signed-off-by: Robert Robinson (cherry picked from commit 1c4c1444fe2f375e6458db7b025deef234efb78c) --- dts/vendor/nordic/nrf7120_enga.dtsi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index 105743cec16a..6179e1703d35 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -874,6 +874,32 @@ status = "disabled"; }; + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <261 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@500 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x500 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@504 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x504 0x1>; + status = "disabled"; + }; + }; + audio_auxpll: auxpll@130000 { compatible = "nordic,nrf-auxpll"; reg = <0x130000 0x1000>; From febf3bb2b20c4278e8ab59e898c54addf1dc8c94 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Thu, 5 Feb 2026 13:08:25 +0000 Subject: [PATCH 1874/3334] [nrf fromtree] dts: nordic: nrf7120: Update MRAM partitions MRAM sizes were wrongly defined in .dtsi files and so required updating. Signed-off-by: Robert Robinson (cherry picked from commit ec3b856c2f41f063c8e88bb40351e56ab2588b57) --- dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi | 4 ++-- dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi | 8 ++++---- dts/vendor/nordic/nrf7120_enga.dtsi | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi b/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi index 7995093515f5..e33596587028 100644 --- a/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi +++ b/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi @@ -16,9 +16,9 @@ clic: &cpuflpr_clic {}; /delete-node/ &cpuapp_mram; &mram_controller { - cpuflpr_mram: mram@3e0000 { + cpuflpr_mram: mram@3de000 { compatible = "soc-nv-flash"; - reg = <0x3e0000 DT_SIZE_K(116)>; + reg = <0x3de000 DT_SIZE_K(116)>; erase-block-size = <4096>; write-block-size = <4>; }; diff --git a/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi index 4783e495b3ea..64d5e69e2068 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi @@ -7,7 +7,7 @@ */ &cpuapp_mram { - reg = <0x0 DT_SIZE_K(4084)>; + reg = <0x0 DT_SIZE_K(4076)>; }; /* These partition sizes assume no FLPR area in MRAM */ @@ -25,17 +25,17 @@ slot0_partition: partition@10000 { label = "image-0"; - reg = <0x00010000 DT_SIZE_K(1992)>; + reg = <0x00010000 DT_SIZE_K(1988)>; }; slot1_partition: partition@202000 { label = "image-1"; - reg = <0x00202000 DT_SIZE_K(1992)>; + reg = <0x00201000 DT_SIZE_K(1988)>; }; storage_partition: partition@3f4000 { label = "storage"; - reg = <0x003f4000 DT_SIZE_K(36)>; + reg = <0x003f2000 DT_SIZE_K(36)>; }; }; }; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index 6179e1703d35..e8b65d516d49 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -961,8 +961,8 @@ cpuapp_mram: mram@0 { compatible = "soc-nv-flash"; - reg = <0 DT_SIZE_K(4084)>; - ranges = <0x0 0 DT_SIZE_K(4084)>; + reg = <0 DT_SIZE_K(4076)>; + ranges = <0x0 0 DT_SIZE_K(4076)>; erase-block-size = <4096>; write-block-size = <4>; #address-cells = <1>; From a166a8e44c3652445d366b4198a05180cbc37a26 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Fri, 6 Feb 2026 11:21:29 +0000 Subject: [PATCH 1875/3334] [nrf fromtree] soc/Kconfig: Create a config for nRF71 series soc compatible SOC_COMPATIBLE_NRF7120_ENGA was erroneously being used in KConfig filter and therefore not being applied, since soc configs are generated at compile time. Created SOC_COMPATIBLE_NRF71 to be used at KConfig build stage. Signed-off-by: Robert Robinson (cherry picked from commit 54d9069522ab264b2af1d5e1d8e55af07bc015f2) --- drivers/entropy/Kconfig.nrf_cracen | 2 +- modules/hal_nordic/nrfx/Kconfig | 2 +- soc/nordic/Kconfig | 3 +++ soc/nordic/nrf71/Kconfig | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/entropy/Kconfig.nrf_cracen b/drivers/entropy/Kconfig.nrf_cracen index 903a304c6808..37753b44fc5b 100644 --- a/drivers/entropy/Kconfig.nrf_cracen +++ b/drivers/entropy/Kconfig.nrf_cracen @@ -5,7 +5,7 @@ config ENTROPY_NRF_CRACEN_CTR_DRBG bool "nRF entropy driver based on the CRACEN CTR_DRBG driver" default y depends on DT_HAS_NORDIC_NRF_CRACEN_CTRDRBG_ENABLED - depends on SOC_COMPATIBLE_NRF54LX || SOC_COMPATIBLE_NRF7120_ENGA + depends on SOC_COMPATIBLE_NRF54LX || SOC_COMPATIBLE_NRF71 select ENTROPY_HAS_DRIVER select NRFX_CRACEN help diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 06bce944b449..99855ed401cc 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -54,7 +54,7 @@ config NRFX_COMP config NRFX_CRACEN bool "CRACEN drivers" - depends on SOC_COMPATIBLE_NRF54LX + depends on SOC_COMPATIBLE_NRF54LX || SOC_COMPATIBLE_NRF71 select NRFX_CRACEN_BSIM_SUPPORT if SOC_SERIES_BSIM_NRFXX config NRFX_CRACEN_BSIM_SUPPORT diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 22ae416bfbfa..6a8b8a0810e4 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -43,6 +43,9 @@ config SOC_COMPATIBLE_NRF54LM20A config SOC_COMPATIBLE_NRF54LM20A_CPUAPP bool +config SOC_COMPATIBLE_NRF71 + bool + config SOC_COMPATIBLE_NRF7120_ENGA bool diff --git a/soc/nordic/nrf71/Kconfig b/soc/nordic/nrf71/Kconfig index 12f8fe77a695..5c5d6056aff1 100644 --- a/soc/nordic/nrf71/Kconfig +++ b/soc/nordic/nrf71/Kconfig @@ -4,6 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF71 + select SOC_COMPATIBLE_NRF71 select HAS_NRFX select HAS_NORDIC_DRIVERS select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE From 5669dbda0fb38d9e6d1b9a4448aff6b1e6299326 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Fri, 6 Feb 2026 11:29:40 +0000 Subject: [PATCH 1876/3334] [nrf fromtree] dts: arm: nordic: Disable psa_rng since not default entropy for nRF7120 rng node is the default entropy source for nRF7120, so psa_rng should be disabled by default. Signed-off-by: Robert Robinson (cherry picked from commit 7eded43c3d6727ea5a6dceddf52bf94641257285) --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 829836660cad..37425bc9a430 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &psa_rng; + zephyr,entropy = &rng; }; soc { From 325e35c14e899a1a32d843bb0a9a0072de707241 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Fri, 6 Feb 2026 15:14:06 +0000 Subject: [PATCH 1877/3334] [nrf fromtree] boards: nordic: nrf7120dk: Set entropy to PSA RNG as default for ns builds Non secure applictions can not access cracen directly and must use PSA API calls instead, therefore default entropy source for non secure builds must be PSA. Signed-off-by: Robert Robinson (cherry picked from commit 83466b2378e9f3e1e7e7d15488437050a9b58d85) --- boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts index 56f2104393d4..66baaac5b7d6 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts @@ -17,6 +17,13 @@ chosen { zephyr,code-partition = &slot0_ns_partition; zephyr,sram = &cpuapp_sram; + zephyr,entropy = &psa_rng; + }; + + /delete-node/ rng; + + psa_rng: psa-rng { + status = "okay"; }; }; From 754b3cf91618ecd9300bf16dfe37b86ecfac6e88 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Fri, 6 Feb 2026 15:23:40 +0000 Subject: [PATCH 1878/3334] [nrf fromtree] boards: nordic: nrf7120dk: Align button and led GPIOs with DK led and button values for nRF7120 had previously been defined arbitrarily, this commit updates the values to match expected values. Signed-off-by: Robert Robinson (cherry picked from commit 914c96c6630d586b8ad3b7cc83c7054eb40b5073) --- .../nrf7120dk/nrf7120dk_nrf7120-common.dtsi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-common.dtsi b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-common.dtsi index 50a219c56a0d..a48e0202c131 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-common.dtsi +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-common.dtsi @@ -11,22 +11,22 @@ compatible = "gpio-leds"; led0: led_0 { - gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>; label = "Green LED 0"; }; led1: led_1 { - gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>; label = "Green LED 1"; }; led2: led_2 { - gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; + gpios = <&gpio4 10 GPIO_ACTIVE_HIGH>; label = "Green LED 2"; }; led3: led_3 { - gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio4 11 GPIO_ACTIVE_HIGH>; label = "Green LED 3"; }; }; @@ -49,25 +49,25 @@ compatible = "gpio-keys"; button0: button_0 { - gpios = <&gpio1 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio1 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 0"; zephyr,code = ; }; button1: button_1 { - gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio1 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 1"; zephyr,code = ; }; button2: button_2 { - gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio1 14 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 2"; zephyr,code = ; }; button3: button_3 { - gpios = <&gpio0 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio1 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 3"; zephyr,code = ; }; From daa5c8e7571ef38fa5ca34d692ca94734629bf9c Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Fri, 6 Feb 2026 15:25:43 +0000 Subject: [PATCH 1879/3334] [nrf fromtree] snippets: nordic: flpr: Define flpr snippet for nRF7120 This commit adds a snippet for the nRF7120 FLPR, to define memory allocations for flpr core. Signed-off-by: Robert Robinson (cherry picked from commit ab374580f2c463a7472647b99bdcef895e44019e) --- snippets/nordic/nordic-flpr/snippet.yml | 3 ++ .../nordic-flpr/soc/nrf7120_cpuapp.overlay | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 snippets/nordic/nordic-flpr/soc/nrf7120_cpuapp.overlay diff --git a/snippets/nordic/nordic-flpr/snippet.yml b/snippets/nordic/nordic-flpr/snippet.yml index 1ad4ec54e666..4fbb7c14c056 100644 --- a/snippets/nordic/nordic-flpr/snippet.yml +++ b/snippets/nordic/nordic-flpr/snippet.yml @@ -12,3 +12,6 @@ boards: /.*/nrf54lm20a/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: soc/nrf54lm20a_cpuapp.overlay + /.*/nrf7120/cpuapp/: + append: + EXTRA_DTC_OVERLAY_FILE: soc/nrf7120_cpuapp.overlay diff --git a/snippets/nordic/nordic-flpr/soc/nrf7120_cpuapp.overlay b/snippets/nordic/nordic-flpr/soc/nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..2bc48ae60b9a --- /dev/null +++ b/snippets/nordic/nordic-flpr/soc/nrf7120_cpuapp.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +&ram03_sram { + cpuflpr_sram_code_data: sram@0 { + compatible = "mmio-sram"; + reg = <0x0 DT_SIZE_K(116)>; + status = "reserved"; + }; +}; + +&mram_controller { + cpuflpr_mram: mram@3de000 { + compatible = "soc-nv-flash"; + reg = <0x3de000 DT_SIZE_K(116)>; + ranges = <0x0 0x3de000 DT_SIZE_K(116)>; + erase-block-size = <4096>; + write-block-size = <4>; + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +&uart00 { + status = "reserved"; +}; + +&cpuflpr_vpr { + execution-memory = <&cpuflpr_sram_code_data>; + source-memory = <&cpuflpr_mram>; +}; + +&cpuapp_vevif_tx { + status = "okay"; +}; From 8334d4c11931685c35c0d25ef338bb9f7b40dfa0 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 2 Feb 2026 12:29:47 +0000 Subject: [PATCH 1880/3334] [nrf noup] dts: choose a psa-rng for entropy for nRF7120 Set PSA as the entropy source for nRF7120 target. PSA is the only NCS-supported interface to CRACEN. Disables `rng` compatible with `nrf-cracen-ctrdrbg`, the nrfx based interface to CRACEN that is used in upstream Zephyr. Only one CRACEN interface may be enabled. Signed-off-by: Robert Robinson --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 37425bc9a430..39e815afc199 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -27,13 +27,13 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; }; From 42cd30f6f202fa63f4cc70a90d7da3820edc1308 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 2 Feb 2026 12:48:15 +0000 Subject: [PATCH 1881/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding for nRF7120 nrf-squash! [nrf noup] dts: Select SoftDevice Controller DTS binding as default Sets bt_hci_sdc as default for nRF7120. Signed-off-by: Robert Robinson --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 39e815afc199..256f2d8f43b8 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,6 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -37,6 +38,10 @@ nvic: &cpuapp_nvic {}; }; }; +&bt_hci_sdc { + status = "okay"; +}; + &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; From 69143f1367a788a4abc68c1f8e9a105a3eed7744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Fri, 13 Feb 2026 07:43:07 +0100 Subject: [PATCH 1882/3334] [nrf fromtree] modules: hal_nordic: nrfx: bump API to version 4.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated nrfx API version to 4.1.0. Signed-off-by: Michał Stasiak (cherry picked from commit 39d64f17ca0567849484f6b72de171758252c3ec) --- modules/hal_nordic/nrfx/nrfx_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index f006240844e5..9e909dcfe837 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -9,7 +9,7 @@ /* Define nrfx API version used in Zephyr. */ #define NRFX_CONFIG_API_VER_MAJOR 4 -#define NRFX_CONFIG_API_VER_MINOR 0 +#define NRFX_CONFIG_API_VER_MINOR 1 #define NRFX_CONFIG_API_VER_MICRO 0 /* Macros used in zephyr-specific config files. */ From 7ec091469ebd415dc19a24433eeafda5cb953da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 16 Jan 2026 11:06:12 +0100 Subject: [PATCH 1883/3334] [nrf fromtree] drivers: timer: nrf_rtc: Align to nrfx 4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align to change in nrf_rtc HAL. Signed-off-by: Krzysztof Chruściński (cherry picked from commit f3cbc13912d6f9d1057fdda26d3f42b543e9e03a) --- drivers/timer/nrf_rtc_timer.c | 8 ++++---- modules/hal_nordic/nrfx/Kconfig | 27 +------------------------- modules/hal_nordic/nrfx/nrfx_kconfig.h | 15 -------------- 3 files changed, 5 insertions(+), 45 deletions(-) diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index 2abc183ad0b9..db49e1ed8b51 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -736,10 +736,10 @@ static void int_event_disable_rtc(void) #if !CUSTOM_COUNTER_BIT_WIDTH NRF_RTC_INT_OVERFLOW_MASK | #endif - NRF_RTC_INT_COMPARE0_MASK | - NRF_RTC_INT_COMPARE1_MASK | - NRF_RTC_INT_COMPARE2_MASK | - NRF_RTC_INT_COMPARE3_MASK; + NRF_RTC_INT_COMPARE_0_MASK | + NRF_RTC_INT_COMPARE_1_MASK | + NRF_RTC_INT_COMPARE_2_MASK | + NRF_RTC_INT_COMPARE_3_MASK; /* Reset interrupt enabling to expected reset values */ nrfy_rtc_int_disable(RTC, mask); diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 99855ed401cc..62fd8f0b0463 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -228,32 +228,7 @@ config NRFX_RRAMC depends on $(dt_nodelabel_exists,rram_controller) config NRFX_RTC - bool - -config NRFX_RTC0 - bool "RTC0 driver instance" - depends on $(dt_nodelabel_exists,rtc0) - select NRFX_RTC - -config NRFX_RTC1 - bool "RTC1 driver instance" - depends on $(dt_nodelabel_exists,rtc1) - select NRFX_RTC - -config NRFX_RTC2 - bool "RTC2 driver instance" - depends on $(dt_nodelabel_exists,rtc2) - select NRFX_RTC - -config NRFX_RTC130 - bool "RTC130 driver instance" - depends on $(dt_nodelabel_exists,rtc130) - select NRFX_RTC - -config NRFX_RTC131 - bool "RTC131 driver instance" - depends on $(dt_nodelabel_exists,rtc131) - select NRFX_RTC + bool "RTC driver" config NRFX_SAADC bool "SAADC driver" diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index d98d9c03d04a..7f40716bffec 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -298,21 +298,6 @@ #ifdef CONFIG_NRFX_RTC_LOG #define NRFX_RTC_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_RTC0 -#define NRFX_RTC0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_RTC1 -#define NRFX_RTC1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_RTC2 -#define NRFX_RTC2_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_RTC130 -#define NRFX_RTC130_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_RTC131 -#define NRFX_RTC131_ENABLED 1 -#endif #ifdef CONFIG_NRFX_SAADC #define NRFX_SAADC_ENABLED 1 From f26e275e4caa859d4c5b32fa57ce636c890988e5 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Mon, 17 Nov 2025 17:04:10 +0100 Subject: [PATCH 1884/3334] [nrf fromtree] drivers: i2c: i2c_nrfx_twi: use standard instantiation Switched nrfx_twi API to standard instantiation. Signed-off-by: Adam Kondraciuk (cherry picked from commit 6d14ea188cf0984da2b1543135d88679f55b6127) --- drivers/i2c/Kconfig.nrfx | 3 +- drivers/i2c/i2c_nrfx_twi.c | 93 ++++++++++---------- drivers/i2c/i2c_nrfx_twi_common.c | 22 ++--- drivers/i2c/i2c_nrfx_twi_common.h | 13 ++- drivers/i2c/i2c_nrfx_twi_rtio.c | 114 ++++++++++++------------- modules/hal_nordic/nrfx/Kconfig | 12 +-- modules/hal_nordic/nrfx/nrfx_kconfig.h | 6 -- soc/nordic/common/Kconfig.peripherals | 6 -- 8 files changed, 119 insertions(+), 150 deletions(-) diff --git a/drivers/i2c/Kconfig.nrfx b/drivers/i2c/Kconfig.nrfx index c6a7dbeadcf7..c967cc239cf5 100644 --- a/drivers/i2c/Kconfig.nrfx +++ b/drivers/i2c/Kconfig.nrfx @@ -17,8 +17,7 @@ if I2C_NRFX config I2C_NRFX_TWI def_bool y depends on DT_HAS_NORDIC_NRF_TWI_ENABLED - select NRFX_TWI0 if HAS_HW_NRF_TWI0 - select NRFX_TWI1 if HAS_HW_NRF_TWI1 + select NRFX_TWI config I2C_NRFX_TWIM def_bool y diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c index 12d40ee7323e..cde02ef7a217 100644 --- a/drivers/i2c/i2c_nrfx_twi.c +++ b/drivers/i2c/i2c_nrfx_twi.c @@ -17,6 +17,8 @@ #include LOG_MODULE_REGISTER(i2c_nrfx_twi, CONFIG_I2C_LOG_LEVEL); +#define DT_DRV_COMPAT nordic_nrf_twi + #if CONFIG_I2C_NRFX_TRANSFER_TIMEOUT #define I2C_TRANSFER_TIMEOUT_MSEC K_MSEC(CONFIG_I2C_NRFX_TRANSFER_TIMEOUT) #else @@ -24,6 +26,7 @@ LOG_MODULE_REGISTER(i2c_nrfx_twi, CONFIG_I2C_LOG_LEVEL); #endif struct i2c_nrfx_twi_data { + nrfx_twi_t twi; uint32_t dev_config; struct k_sem transfer_sync; struct k_sem completion_sync; @@ -42,7 +45,6 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs, uint16_t addr) { - const struct i2c_nrfx_twi_config *config = dev->config; struct i2c_nrfx_twi_data *data = dev->data; int ret = 0; @@ -51,11 +53,11 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, /* Dummy take on completion_sync sem to be sure that it is empty */ k_sem_take(&data->completion_sync, K_NO_WAIT); - nrfx_twi_enable(&config->twi); + nrfx_twi_enable(&data->twi); for (size_t i = 0; i < num_msgs; i++) { bool more_msgs = ((i < (num_msgs - 1)) && - !(msgs[i + 1].flags & I2C_MSG_RESTART)); + !(msgs[i + 1].flags & I2C_MSG_RESTART)); ret = i2c_nrfx_twi_msg_transfer(dev, msgs[i].flags, msgs[i].buf, @@ -84,7 +86,7 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, * to make sure everything has been done to restore the * bus from this error. */ - nrfx_twi_disable(&config->twi); + nrfx_twi_disable(&data->twi); (void)i2c_nrfx_twi_recover_bus(dev); ret = -EIO; break; @@ -96,13 +98,13 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, } } - nrfx_twi_disable(&config->twi); + nrfx_twi_disable(&data->twi); k_sem_give(&data->transfer_sync); return ret; } -static void event_handler(nrfx_twi_evt_t const *p_event, void *p_context) +static void event_handler(nrfx_twi_event_t const *p_event, void *p_context) { const struct device *dev = p_context; struct i2c_nrfx_twi_data *dev_data = (struct i2c_nrfx_twi_data *)dev->data; @@ -131,45 +133,40 @@ static DEVICE_API(i2c, i2c_nrfx_twi_driver_api) = { .recover_bus = i2c_nrfx_twi_recover_bus, }; -#define I2C_NRFX_TWI_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(I2C(idx)) != I2C_NRFX_TWI_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static int twi_##idx##_init(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ - nrfx_twi_##idx##_irq_handler, 0); \ - const struct i2c_nrfx_twi_config *config = dev->config; \ - int err = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - return i2c_nrfx_twi_init(dev); \ - } \ - static struct i2c_nrfx_twi_data twi_##idx##_data = { \ - .transfer_sync = Z_SEM_INITIALIZER(twi_##idx##_data.transfer_sync, 1, 1), \ - .completion_sync = Z_SEM_INITIALIZER(twi_##idx##_data.completion_sync, 0, 1)}; \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ - .twi = NRFX_TWI_INSTANCE(idx), \ - .config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(I2C(idx)), \ - }, \ - .event_handler = event_handler, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ - }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \ - I2C_DEVICE_DT_DEFINE(I2C(idx), twi_##idx##_init, PM_DEVICE_DT_GET(I2C(idx)), \ - &twi_##idx##_data, &twi_##idx##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twi_driver_api) - -#ifdef CONFIG_HAS_HW_NRF_TWI0 -I2C_NRFX_TWI_DEVICE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWI1 -I2C_NRFX_TWI_DEVICE(1); -#endif +#define I2C_NRFX_TWI_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWI_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static struct i2c_nrfx_twi_data twi_##idx##_data = { \ + .twi = NRFX_TWI_INSTANCE(DT_INST_REG_ADDR(idx)), \ + .transfer_sync = Z_SEM_INITIALIZER(twi_##idx##_data.transfer_sync, 1, 1), \ + .completion_sync = Z_SEM_INITIALIZER(twi_##idx##_data.completion_sync, 0, 1) \ + }; \ + static int twi_##idx##_init(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twi_irq_handler, \ + &twi_##idx##_data.twi, 0); \ + const struct i2c_nrfx_twi_config *config = dev->config; \ + int err = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + return i2c_nrfx_twi_init(dev); \ + } \ + PINCTRL_DT_INST_DEFINE(idx); \ + static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ + .config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ + }, \ + .event_handler = event_handler, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ + }; \ + PM_DEVICE_DT_INST_DEFINE(idx, twi_nrfx_pm_action); \ + I2C_DEVICE_DT_INST_DEFINE(idx, twi_##idx##_init, PM_DEVICE_DT_INST_GET(idx), \ + &twi_##idx##_data, &twi_##idx##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twi_driver_api) + +DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWI_DEVICE) diff --git a/drivers/i2c/i2c_nrfx_twi_common.c b/drivers/i2c/i2c_nrfx_twi_common.c index 2d07863e3d73..b35ee8f3054b 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.c +++ b/drivers/i2c/i2c_nrfx_twi_common.c @@ -16,7 +16,8 @@ LOG_MODULE_DECLARE(i2c_nrfx_twi); int i2c_nrfx_twi_init(const struct device *dev) { const struct i2c_nrfx_twi_config *config = dev->config; - int result = nrfx_twi_init(&config->twi, &config->config, + struct i2c_nrfx_twi_common_data *data = dev->data; + int result = nrfx_twi_init(&data->twi, &config->config, config->event_handler, (void *)dev); if (result != 0) { LOG_ERR("Failed to initialize device: %s", @@ -29,9 +30,8 @@ int i2c_nrfx_twi_init(const struct device *dev) int i2c_nrfx_twi_configure(const struct device *dev, uint32_t dev_config) { - const struct i2c_nrfx_twi_config *config = dev->config; struct i2c_nrfx_twi_common_data *data = dev->data; - nrfx_twi_t const *inst = &config->twi; + nrfx_twi_t const *inst = &data->twi; if (I2C_ADDR_10_BITS & dev_config) { return -EINVAL; @@ -39,10 +39,10 @@ int i2c_nrfx_twi_configure(const struct device *dev, uint32_t dev_config) switch (I2C_SPEED_GET(dev_config)) { case I2C_SPEED_STANDARD: - nrf_twi_frequency_set(inst->p_twi, NRF_TWI_FREQ_100K); + nrf_twi_frequency_set(inst->p_reg, NRF_TWI_FREQ_100K); break; case I2C_SPEED_FAST: - nrf_twi_frequency_set(inst->p_twi, NRF_TWI_FREQ_400K); + nrf_twi_frequency_set(inst->p_reg, NRF_TWI_FREQ_400K); break; default: LOG_ERR("unsupported speed"); @@ -55,12 +55,12 @@ int i2c_nrfx_twi_configure(const struct device *dev, uint32_t dev_config) int i2c_nrfx_twi_recover_bus(const struct device *dev) { - const struct i2c_nrfx_twi_config *config = dev->config; + struct i2c_nrfx_twi_common_data *data = dev->data; uint32_t scl_pin; uint32_t sda_pin; - scl_pin = nrf_twi_scl_pin_get(config->twi.p_twi); - sda_pin = nrf_twi_sda_pin_get(config->twi.p_twi); + scl_pin = nrf_twi_scl_pin_get(data->twi.p_reg); + sda_pin = nrf_twi_sda_pin_get(data->twi.p_reg); return nrfx_twi_bus_recover(scl_pin, sda_pin); } @@ -69,7 +69,7 @@ int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, uint8_t *buf, size_t buf_len, uint16_t i2c_addr, bool more_msgs) { - const struct i2c_nrfx_twi_config *config = dev->config; + struct i2c_nrfx_twi_common_data *data = dev->data; int ret = 0; uint32_t xfer_flags = 0; nrfx_twi_xfer_desc_t cur_xfer = { @@ -107,7 +107,7 @@ int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, } if (!ret) { - ret = nrfx_twi_xfer(&config->twi, &cur_xfer, xfer_flags); + ret = nrfx_twi_xfer(&data->twi, &cur_xfer, xfer_flags); } return ret; @@ -133,7 +133,7 @@ int twi_nrfx_pm_action(const struct device *dev, enum pm_device_action action) break; case PM_DEVICE_ACTION_SUSPEND: - nrfx_twi_uninit(&config->twi); + nrfx_twi_uninit(&data->twi); ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); if (ret < 0) { diff --git a/drivers/i2c/i2c_nrfx_twi_common.h b/drivers/i2c/i2c_nrfx_twi_common.h index 3f81b5cc94e0..0a3fb081e8ce 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.h +++ b/drivers/i2c/i2c_nrfx_twi_common.h @@ -20,23 +20,22 @@ extern "C" { : bitrate == 250000 ? NRF_TWI_FREQ_250K \ : bitrate == I2C_BITRATE_FAST ? NRF_TWI_FREQ_400K \ : I2C_NRFX_TWI_INVALID_FREQUENCY) -#define I2C(idx) DT_NODELABEL(i2c##idx) -#define I2C_FREQUENCY(idx) \ - I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ - I2C_BITRATE_STANDARD)) + +#define I2C_FREQUENCY(node) \ + I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(node, clock_frequency, I2C_BITRATE_STANDARD)) struct i2c_nrfx_twi_common_data { + nrfx_twi_t twi; uint32_t dev_config; }; struct i2c_nrfx_twi_config { - nrfx_twi_t twi; nrfx_twi_config_t config; - nrfx_twi_evt_handler_t event_handler; + nrfx_twi_event_handler_t event_handler; const struct pinctrl_dev_config *pcfg; }; -static inline int i2c_nrfx_twi_get_evt_result(nrfx_twi_evt_t const *p_event) +static inline int i2c_nrfx_twi_get_evt_result(nrfx_twi_event_t const *p_event) { switch (p_event->type) { case NRFX_TWI_EVT_DONE: diff --git a/drivers/i2c/i2c_nrfx_twi_rtio.c b/drivers/i2c/i2c_nrfx_twi_rtio.c index 531b9eaac261..a4151b08fc06 100644 --- a/drivers/i2c/i2c_nrfx_twi_rtio.c +++ b/drivers/i2c/i2c_nrfx_twi_rtio.c @@ -18,7 +18,10 @@ #include LOG_MODULE_REGISTER(i2c_nrfx_twi, CONFIG_I2C_LOG_LEVEL); +#define DT_DRV_COMPAT nordic_nrf_twi + struct i2c_nrfx_twi_rtio_data { + nrfx_twi_t twi; uint32_t dev_config; bool twi_enabled; struct i2c_rtio *ctx; @@ -37,7 +40,7 @@ static void i2c_nrfx_twi_rtio_complete(const struct device *dev, int status); static bool i2c_nrfx_twi_rtio_msg_start(const struct device *dev, uint8_t flags, uint8_t *buf, size_t buf_len, uint16_t i2c_addr) { - const struct i2c_nrfx_twi_config *config = dev->config; + struct i2c_nrfx_twi_common_data *data = dev->data; struct i2c_nrfx_twi_rtio_data *const dev_data = dev->data; struct i2c_rtio *ctx = dev_data->ctx; int ret = 0; @@ -46,13 +49,13 @@ static bool i2c_nrfx_twi_rtio_msg_start(const struct device *dev, uint8_t flags, /** Enabling while already enabled ends up in a failed assertion: skip it. */ if (!dev_data->twi_enabled) { - nrfx_twi_enable(&config->twi); + nrfx_twi_enable(&data->twi); dev_data->twi_enabled = true; } ret = i2c_nrfx_twi_msg_transfer(dev, flags, buf, buf_len, i2c_addr, more_msgs); if (ret != 0) { - nrfx_twi_disable(&config->twi); + nrfx_twi_disable(&data->twi); dev_data->twi_enabled = false; return i2c_rtio_complete(ctx, ret); @@ -112,14 +115,13 @@ static bool i2c_nrfx_twi_rtio_start(const struct device *dev) static void i2c_nrfx_twi_rtio_complete(const struct device *dev, int status) { /** Finalize if there are no more pending xfers */ - const struct i2c_nrfx_twi_config *config = dev->config; struct i2c_nrfx_twi_rtio_data *data = dev->data; struct i2c_rtio *const ctx = data->ctx; if (i2c_rtio_complete(ctx, status)) { (void)i2c_nrfx_twi_rtio_start(dev); } else { - nrfx_twi_disable(&config->twi); + nrfx_twi_disable(&data->twi); data->twi_enabled = false; } } @@ -149,7 +151,7 @@ static int i2c_nrfx_twi_rtio_recover_bus(const struct device *dev) return i2c_rtio_recover(ctx); } -static void event_handler(nrfx_twi_evt_t const *p_event, void *p_context) +static void event_handler(nrfx_twi_event_t const *p_event, void *p_context) { const struct device *dev = p_context; int status = 0; @@ -178,56 +180,50 @@ static DEVICE_API(i2c, i2c_nrfx_twi_rtio_driver_api) = { .iodev_submit = i2c_nrfx_twi_rtio_submit, }; -#define I2C_NRFX_TWI_RTIO_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(idx) != \ - I2C_NRFX_TWI_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static int twi_##idx##_init(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ - nrfx_isr, nrfx_twi_##idx##_irq_handler, 0); \ - const struct i2c_nrfx_twi_config *config = dev->config; \ - const struct i2c_nrfx_twi_rtio_data *dev_data = dev->data; \ - int err = pinctrl_apply_state(config->pcfg, \ - PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - i2c_rtio_init(dev_data->ctx, dev); \ - return i2c_nrfx_twi_init(dev); \ - } \ - I2C_RTIO_DEFINE(_i2c##idx##_twi_rtio, \ - DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ - DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ - static struct i2c_nrfx_twi_rtio_data twi_##idx##_data = { \ - .ctx = &_i2c##idx##_twi_rtio, \ - }; \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ - .twi = NRFX_TWI_INSTANCE(idx), \ - .config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ - }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \ - I2C_DEVICE_DT_DEFINE(I2C(idx), \ - twi_##idx##_init, \ - PM_DEVICE_DT_GET(I2C(idx)), \ - &twi_##idx##_data, \ - &twi_##idx##z_config, \ - POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twi_rtio_driver_api) - -#ifdef CONFIG_HAS_HW_NRF_TWI0 -I2C_NRFX_TWI_RTIO_DEVICE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_TWI1 -I2C_NRFX_TWI_RTIO_DEVICE(1); -#endif +#define I2C_NRFX_TWI_RTIO_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != \ + I2C_NRFX_TWI_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static struct i2c_nrfx_twi_rtio_data twi_##idx##_data = { \ + .twi = NRFX_TWI_INSTANCE(DT_INST_REG_ADDR(idx)), \ + .ctx = &_i2c##idx##_twi_rtio, \ + }; \ + static int twi_##idx##_init(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), \ + nrfx_twi_irq_handler, &twi_##idx##_data.twi, 0); \ + const struct i2c_nrfx_twi_config *config = dev->config; \ + const struct i2c_nrfx_twi_rtio_data *dev_data = dev->data; \ + int err = pinctrl_apply_state(config->pcfg, \ + PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + i2c_rtio_init(dev_data->ctx, dev); \ + return i2c_nrfx_twi_init(dev); \ + } \ + I2C_RTIO_DEFINE(_i2c##idx##_twi_rtio, \ + DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ + DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ + PINCTRL_DT_INST_DEFINE(idx); \ + static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ + .config = { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ + }, \ + .event_handler = event_handler, \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ + }; \ + PM_DEVICE_DT_INST_DEFINE(idx, twi_nrfx_pm_action); \ + I2C_DEVICE_DT_INST_DEFINE(idx, \ + twi_##idx##_init, \ + PM_DEVICE_DT_INST_GET(idx), \ + &twi_##idx##_data, \ + &twi_##idx##z_config, \ + POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, \ + &i2c_nrfx_twi_rtio_driver_api) + +DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWI_RTIO_DEVICE) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 62fd8f0b0463..898051f0ef17 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -276,17 +276,7 @@ config NRFX_TIMER bool "TIMER driver" config NRFX_TWI - bool - -config NRFX_TWI0 - bool "TWI0 driver instance" - depends on $(dt_nodelabel_exists,i2c0) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) - select NRFX_TWI - -config NRFX_TWI1 - bool "TWI1 driver instance" - depends on $(dt_nodelabel_exists,i2c1) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) - select NRFX_TWI + bool "NRFX driver for TWI peripheral" config NRFX_TWIM bool "NRFX driver for TWIM peripheral" diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 7f40716bffec..d52a67c3343e 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -378,12 +378,6 @@ #ifdef CONFIG_NRFX_TWI_LOG #define NRFX_TWI_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_TWI0 -#define NRFX_TWI0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_TWI1 -#define NRFX_TWI1_ENABLED 1 -#endif #ifdef CONFIG_NRFX_TWIM #define NRFX_TWIM_ENABLED 1 diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 77c4f3b98399..0ae024e00bef 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -298,12 +298,6 @@ config HAS_HW_NRF_TIMER136 config HAS_HW_NRF_TIMER137 def_bool $(dt_nodelabel_enabled_with_compat,timer137,$(DT_COMPAT_NORDIC_NRF_TIMER)) -config HAS_HW_NRF_TWI0 - def_bool $(dt_nodelabel_enabled_with_compat,i2c0,$(DT_COMPAT_NORDIC_NRF_TWI)) - -config HAS_HW_NRF_TWI1 - def_bool $(dt_nodelabel_enabled_with_compat,i2c1,$(DT_COMPAT_NORDIC_NRF_TWI)) - config HAS_HW_NRF_UART0 def_bool $(dt_nodelabel_enabled_with_compat,uart0,$(DT_COMPAT_NORDIC_NRF_UART)) From c6e975fd59ddfe0f70dc3a915e87102d4c94705c Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Fri, 21 Nov 2025 17:01:36 +0100 Subject: [PATCH 1885/3334] [nrf fromtree] drivers: spi: spi_nrfx_spi: use standard instantiation Switched nrfx_spi API to standard instantiation. Signed-off-by: Adam Kondraciuk (cherry picked from commit 38c736295a61d1594bb269066f3b80bbd46c3c1e) --- drivers/spi/Kconfig.nrfx | 4 +- drivers/spi/spi_nrfx_spi.c | 77 +++++++++++--------------- modules/hal_nordic/nrfx/Kconfig | 17 +----- modules/hal_nordic/nrfx/nrfx_kconfig.h | 9 --- 4 files changed, 34 insertions(+), 73 deletions(-) diff --git a/drivers/spi/Kconfig.nrfx b/drivers/spi/Kconfig.nrfx index 990f044574ba..b391b919beff 100644 --- a/drivers/spi/Kconfig.nrfx +++ b/drivers/spi/Kconfig.nrfx @@ -15,9 +15,7 @@ if SPI_NRFX config SPI_NRFX_SPI def_bool y depends on DT_HAS_NORDIC_NRF_SPI_ENABLED - select NRFX_SPI0 if HAS_HW_NRF_SPI0 - select NRFX_SPI1 if HAS_HW_NRF_SPI1 - select NRFX_SPI2 if HAS_HW_NRF_SPI2 + select NRFX_SPI config SPI_NRFX_SPIM def_bool y diff --git a/drivers/spi/spi_nrfx_spi.c b/drivers/spi/spi_nrfx_spi.c index 10badb033d97..3b27a05c85f3 100644 --- a/drivers/spi/spi_nrfx_spi.c +++ b/drivers/spi/spi_nrfx_spi.c @@ -15,10 +15,13 @@ #include LOG_MODULE_REGISTER(spi_nrfx_spi, CONFIG_SPI_LOG_LEVEL); +#define DT_DRV_COMPAT nordic_nrf_spi + #include "spi_context.h" #include "spi_nrfx_common.h" struct spi_nrfx_data { + nrfx_spi_t spi; struct spi_context ctx; const struct device *dev; size_t chunk_len; @@ -27,7 +30,6 @@ struct spi_nrfx_data { }; struct spi_nrfx_config { - nrfx_spi_t spi; nrfx_spi_config_t def_config; void (*irq_connect)(void); const struct pinctrl_dev_config *pcfg; @@ -35,7 +37,7 @@ struct spi_nrfx_config { uint32_t wake_pin; }; -static void event_handler(const nrfx_spi_evt_t *p_event, void *p_context); +static void event_handler(const nrfx_spi_event_t *p_event, void *p_context); static inline nrf_spi_frequency_t get_nrf_spi_frequency(uint32_t frequency) { @@ -136,18 +138,18 @@ static int configure(const struct device *dev, config.mode = get_nrf_spi_mode(spi_cfg->operation); config.bit_order = get_nrf_spi_bit_order(spi_cfg->operation); - sck_pin = nrf_spi_sck_pin_get(dev_config->spi.p_reg); + sck_pin = nrf_spi_sck_pin_get(dev_data->spi.p_reg); if (sck_pin != NRF_SPI_PIN_NOT_CONNECTED) { nrf_gpio_pin_write(sck_pin, spi_cfg->operation & SPI_MODE_CPOL ? 1 : 0); } if (dev_data->initialized) { - nrfx_spi_uninit(&dev_config->spi); + nrfx_spi_uninit(&dev_data->spi); dev_data->initialized = false; } - result = nrfx_spi_init(&dev_config->spi, &config, + result = nrfx_spi_init(&dev_data->spi, &config, event_handler, dev_data); if (result != 0) { LOG_ERR("Failed to initialize nrfx driver: %d", result); @@ -174,7 +176,6 @@ static void finish_transaction(const struct device *dev, int error) static void transfer_next_chunk(const struct device *dev) { - const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; struct spi_context *ctx = &dev_data->ctx; int error = 0; @@ -190,7 +191,7 @@ static void transfer_next_chunk(const struct device *dev) xfer.tx_length = spi_context_tx_buf_on(ctx) ? chunk_len : 0; xfer.p_rx_buffer = ctx->rx_buf; xfer.rx_length = spi_context_rx_buf_on(ctx) ? chunk_len : 0; - error = nrfx_spi_xfer(&dev_config->spi, &xfer, 0); + error = nrfx_spi_xfer(&dev_data->spi, &xfer, 0); if (error == 0) { return; } @@ -201,7 +202,7 @@ static void transfer_next_chunk(const struct device *dev) finish_transaction(dev, error); } -static void event_handler(const nrfx_spi_evt_t *p_event, void *p_context) +static void event_handler(const nrfx_spi_event_t *p_event, void *p_context) { struct spi_nrfx_data *dev_data = p_context; @@ -267,7 +268,7 @@ static int transceive(const struct device *dev, /* Abort the current transfer by deinitializing * the nrfx driver. */ - nrfx_spi_uninit(&dev_config->spi); + nrfx_spi_uninit(&dev_data->spi); dev_data->initialized = false; /* Make sure the transaction is finished (it may be @@ -363,7 +364,7 @@ static int spi_nrfx_pm_action(const struct device *dev, case PM_DEVICE_ACTION_SUSPEND: if (dev_data->initialized) { - nrfx_spi_uninit(&dev_config->spi); + nrfx_spi_uninit(&dev_data->spi); dev_data->initialized = false; } @@ -424,31 +425,27 @@ static int spi_nrfx_init(const struct device *dev) * - Name-based HAL IRQ handlers, e.g. nrfx_spi_0_irq_handler */ -#define SPI(idx) DT_NODELABEL(spi##idx) -#define SPI_PROP(idx, prop) DT_PROP(SPI(idx), prop) +#define SPI_PROP(idx, prop) DT_INST_PROP(idx, prop) #define SPI_NRFX_SPI_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPI(idx)); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(SPI(idx)), DT_IRQ(SPI(idx), priority), \ - nrfx_isr, nrfx_spi_##idx##_irq_handler, 0); \ - } \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ static struct spi_nrfx_data spi_##idx##_data = { \ IF_ENABLED(CONFIG_MULTITHREADING, \ (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ IF_ENABLED(CONFIG_MULTITHREADING, \ (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - SPI_CONTEXT_CS_GPIOS_INITIALIZE(SPI(idx), ctx) \ - .dev = DEVICE_DT_GET(SPI(idx)), \ + SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(idx), ctx) \ + .spi = NRFX_SPI_INSTANCE(DT_INST_REG_ADDR(idx)), \ + .dev = DEVICE_DT_INST_GET(idx), \ .busy = false, \ }; \ - PINCTRL_DT_DEFINE(SPI(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), \ + nrfx_spi_irq_handler, &spi_##idx##_data.spi, 0); \ + } \ + PINCTRL_DT_INST_DEFINE(idx); \ static const struct spi_nrfx_config spi_##idx##z_config = { \ - .spi = { \ - .p_reg = (NRF_SPI_Type *)DT_REG_ADDR(SPI(idx)), \ - .drv_inst_idx = NRFX_SPI##idx##_INST_IDX, \ - }, \ .def_config = { \ .skip_gpio_cfg = true, \ .skip_psel_cfg = true, \ @@ -456,31 +453,21 @@ static int spi_nrfx_init(const struct device *dev) .orc = SPI_PROP(idx, overrun_character), \ }, \ .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPI(idx)), \ - .wake_gpiote = WAKE_GPIOTE_NODE(SPI(idx)), \ - .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPI(idx), wake_gpios, \ - WAKE_PIN_NOT_USED), \ + .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ + .wake_gpiote = WAKE_GPIOTE_NODE(DT_DRV_INST(idx)), \ + .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(DT_DRV_INST(idx), \ + wake_gpios, WAKE_PIN_NOT_USED),\ }; \ - BUILD_ASSERT(!DT_NODE_HAS_PROP(SPI(idx), wake_gpios) || \ - !(DT_GPIO_FLAGS(SPI(idx), wake_gpios) & GPIO_ACTIVE_LOW), \ + BUILD_ASSERT(!DT_NODE_HAS_PROP(DT_DRV_INST(idx), wake_gpios) || \ + !(DT_INST_GPIO_FLAGS(idx, wake_gpios) & GPIO_ACTIVE_LOW), \ "WAKE line must be configured as active high"); \ - PM_DEVICE_DT_DEFINE(SPI(idx), spi_nrfx_pm_action); \ - SPI_DEVICE_DT_DEFINE(SPI(idx), \ + PM_DEVICE_DT_INST_DEFINE(idx, spi_nrfx_pm_action); \ + SPI_DEVICE_DT_INST_DEFINE(idx, \ spi_nrfx_init, \ - PM_DEVICE_DT_GET(SPI(idx)), \ + PM_DEVICE_DT_INST_GET(idx), \ &spi_##idx##_data, \ &spi_##idx##z_config, \ POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \ &spi_nrfx_driver_api) -#ifdef CONFIG_HAS_HW_NRF_SPI0 -SPI_NRFX_SPI_DEFINE(0); -#endif - -#ifdef CONFIG_HAS_HW_NRF_SPI1 -SPI_NRFX_SPI_DEFINE(1); -#endif - -#ifdef CONFIG_HAS_HW_NRF_SPI2 -SPI_NRFX_SPI_DEFINE(2); -#endif +DT_INST_FOREACH_STATUS_OKAY(SPI_NRFX_SPI_DEFINE) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 898051f0ef17..030a07e4cf85 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -235,22 +235,7 @@ config NRFX_SAADC depends on $(dt_nodelabel_exists,adc) && !SOC_SERIES_NRF51 config NRFX_SPI - bool - -config NRFX_SPI0 - bool "SPI0 driver instance" - depends on $(dt_nodelabel_exists,spi0) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) - select NRFX_SPI - -config NRFX_SPI1 - bool "SPI1 driver instance" - depends on $(dt_nodelabel_exists,spi1) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) - select NRFX_SPI - -config NRFX_SPI2 - bool "SPI2 driver instance" - depends on $(dt_nodelabel_exists,spi2) && SOC_SERIES_NRF52 - select NRFX_SPI + bool "SPI driver" config NRFX_SPIM bool "SPIM driver" diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index d52a67c3343e..d5ec4d7e53a5 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -312,15 +312,6 @@ #ifdef CONFIG_NRFX_SPI_LOG #define NRFX_SPI_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_SPI0 -#define NRFX_SPI0_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPI1 -#define NRFX_SPI1_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_SPI2 -#define NRFX_SPI2_ENABLED 1 -#endif #ifdef CONFIG_NRFX_SPIM #define NRFX_SPIM_ENABLED 1 From c07e2aa624703617f9fbb3329f6551c4debbe9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Fri, 13 Feb 2026 07:54:23 +0100 Subject: [PATCH 1886/3334] [nrf fromtree] modules: hal_nordic: nrfx: remove UART instance specific symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer needed after switching to nrfx 4.1 API. Signed-off-by: Michał Stasiak (cherry picked from commit 5f8d1eb80d70e07f17998a3c78469380845699bf) --- modules/hal_nordic/nrfx/Kconfig | 7 +------ modules/hal_nordic/nrfx/nrfx_kconfig.h | 3 --- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 030a07e4cf85..59f3d9fe2fde 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -270,12 +270,7 @@ config NRFX_TWIS bool "NRFX driver for TWIS peripheral" config NRFX_UART - bool - -config NRFX_UART0 - bool "UART0 driver instance" - depends on $(dt_nodelabel_exists,uart0) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) - select NRFX_UART + bool "UART driver" config NRFX_UARTE bool "UARTE driver" diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index d5ec4d7e53a5..d75ed21aac55 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -396,9 +396,6 @@ #ifdef CONFIG_NRFX_UART_LOG #define NRFX_UART_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_UART0 -#define NRFX_UART0_ENABLED 1 -#endif #ifdef CONFIG_NRFX_UARTE #define NRFX_UARTE_ENABLED 1 From 86a89bb89c2be193f58b6dfc6b21f52413b22d9a Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 30 Jan 2026 12:42:31 +0530 Subject: [PATCH 1887/3334] [nrf fromtree] soc: nordic: nrf71: Add support to enable Wi-Fi debug To debug Wi-Fi cores, we need to enable access to Wi-Fi debug registers. Signed-off-by: Chaitanya Tata (cherry picked from commit 863fe89ea14b74490f97be95cd81b2ba3024154b) --- soc/nordic/nrf71/Kconfig | 9 +++++++++ soc/nordic/nrf71/soc.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/soc/nordic/nrf71/Kconfig b/soc/nordic/nrf71/Kconfig index 5c5d6056aff1..59b973d1c66f 100644 --- a/soc/nordic/nrf71/Kconfig +++ b/soc/nordic/nrf71/Kconfig @@ -26,3 +26,12 @@ config SOC_NRF7120_ENGA_CPUAPP config SOC_NRF7120_ENGA_CPUFLPR select RISCV_CORE_NORDIC_VPR + +if SOC_SERIES_NRF71 + +config SOC_NRF71_WIFI_DAP + bool "nRF71 Wi-Fi Debug access port for debugging" + help + This controls the Wi-Fi AHB Debug AP (DAP) for debugging nRF71 Wi-Fi cores. + +endif # SOC_SERIES_NRF71 diff --git a/soc/nordic/nrf71/soc.c b/soc/nordic/nrf71/soc.c index 9018bc99e482..bb241ba060b6 100644 --- a/soc/nordic/nrf71/soc.c +++ b/soc/nordic/nrf71/soc.c @@ -138,6 +138,15 @@ static void wifi_mpc_configuration(void) override.endaddr = 0x200E0000; override.index = 0; mpc_configure_override(NRF_MPC03, &override); + + if (IS_ENABLED(CONFIG_SOC_NRF71_WIFI_DAP)) { + /* Allow access to Wi-Fi debug interface registers */ + init_mpc_region_override(&override); + override.start_address = 0x48000000; + override.endaddr = 0x48100000; + override.index = index++; + mpc_configure_override(NRF_MPC00, &override); + } } static void grtc_configuration(void) From a66cfaac8511351e47542c180418de92fc53c16e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 11 Feb 2026 11:05:14 +0000 Subject: [PATCH 1888/3334] Revert "[nrf noup] ble: Adding missing AES config for BT_CRYPTO" nrf-squash! [nrf noup] ble: Adding missing AES config for BT_CRYPTO This reverts commit e7b3779b58584ab4c9badbafda32b2c21d6fc50a. Signed-off-by: Jamie McCrae --- subsys/bluetooth/crypto/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/crypto/Kconfig b/subsys/bluetooth/crypto/Kconfig index 0e382060278a..e9234e4157b3 100644 --- a/subsys/bluetooth/crypto/Kconfig +++ b/subsys/bluetooth/crypto/Kconfig @@ -7,7 +7,6 @@ config BT_CRYPTO select PSA_WANT_KEY_TYPE_AES select PSA_WANT_ALG_CMAC select PSA_WANT_ALG_ECB_NO_PADDING - imply MBEDTLS_CIPHER_AES_ENABLED if !BUILD_WITH_TFM imply MBEDTLS_AES_ROM_TABLES if MBEDTLS_PSA_CRYPTO_C help This option enables the Bluetooth Cryptographic Toolbox. From 308954d183679575b30efd175d0071b541cef0b8 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 11 Feb 2026 13:00:36 +0000 Subject: [PATCH 1889/3334] [nrf noup] modules: mbedtls: kconfig: Partial revert of a noup nrf-squash! [nrf noup] mbedtls: Add dependency logic for PSA crypto configurations Partially reverts some Kconfig changes which can be applied in sdk-nrf instead Signed-off-by: Jamie McCrae --- modules/mbedtls/Kconfig.psa.auto | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index b235c30380fb..057d0a710eb0 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -160,7 +160,6 @@ 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 @@ -265,37 +264,30 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE From c63d889a0bd09b9b8f82d714fa3f2350dd1748d8 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 11 Feb 2026 11:24:42 +0000 Subject: [PATCH 1890/3334] Revert "[nrf noup] mbedtls: Enable PSA_WANT_GENERATE_RANDOM for PSA RNG" nrf-squash! [nrf noup] mbedtls: Enable PSA_WANT_GENERATE_RANDOM for PSA RNG This reverts commit b3f3a15be778db47df9ff62c91e2c2511be24345. Signed-off-by: Jamie McCrae --- drivers/entropy/Kconfig.psa_crypto | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/entropy/Kconfig.psa_crypto b/drivers/entropy/Kconfig.psa_crypto index 18514a071d1c..d06001225b05 100644 --- a/drivers/entropy/Kconfig.psa_crypto +++ b/drivers/entropy/Kconfig.psa_crypto @@ -7,7 +7,6 @@ config ENTROPY_PSA_CRYPTO_RNG bool "PSA Crypto Random source Entropy driver" depends on DT_HAS_ZEPHYR_PSA_CRYPTO_RNG_ENABLED select ENTROPY_HAS_DRIVER - select PSA_WANT_GENERATE_RANDOM default y help Enable the PSA Crypto source Entropy driver. From 802a7d44bc205b4d5bcac11e7a04f724ba645649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pelikan?= Date: Mon, 16 Feb 2026 14:17:39 +0100 Subject: [PATCH 1891/3334] [nrf fromtree] tests: kernel: sleep: Adjustments for NRF54H20 PPR xip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adjusting the max shortest ticks value for slow PPR core with XIP variant. Signed-off-by: Paweł Pelikan (cherry picked from commit 125afecddd055341bb064102bfae795fc7aadfcd) --- tests/kernel/sleep/src/usleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/sleep/src/usleep.c b/tests/kernel/sleep/src/usleep.c index 9f3fd4dbe94b..f74c089d3b91 100644 --- a/tests/kernel/sleep/src/usleep.c +++ b/tests/kernel/sleep/src/usleep.c @@ -46,7 +46,7 @@ /* Similar for nRF54H20 cpuppr (RISC-V core), it has a slow CPU clock * compared to other cores, causing the increased overhead. */ -#define MAXIMUM_SHORTEST_TICKS 4 +#define MAXIMUM_SHORTEST_TICKS (IS_ENABLED(CONFIG_XIP) ? 8 : 4) #else #define MAXIMUM_SHORTEST_TICKS 1 #endif From f4dcc7b28defe44a15554decd80323cd1da21596 Mon Sep 17 00:00:00 2001 From: Maochen Wang Date: Wed, 14 Jan 2026 19:14:06 +0800 Subject: [PATCH 1892/3334] [nrf fromtree] manifest: fix DPP remain_on_channel wait timeout The remain_on_channel callback triggers cookie_event, which checks pending_remain_on_channel before giving drv_resp_sem. Previously, pending_remain_on_channel was set after calling dev_ops->remain_on_channel, causing drv_resp_sem to timeout. Move the pending_remain_on_channel assignment before invoking dev_ops->remain_on_channel to ensure proper synchronization. Signed-off-by: Maochen Wang (cherry picked from commit 6ebf1963e8d1608133305faa030cd1a0895fff3f) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 033982273c98..76d54ed18072 100644 --- a/west.yml +++ b/west.yml @@ -291,7 +291,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 1a2fbb7910f23822a785294eab9f4922c6119711 + revision: 7c5d886f4b1afd6d00192e346268f03f5f44354c - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 9ceeda206b0c6ab7043d23aff8202987bfde9d60 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 2 Feb 2026 21:15:51 +0530 Subject: [PATCH 1893/3334] [nrf fromtree] modules: hostap: p2p: Configurable retry limit for PD For P2P provisional discovery make the retries configurable, in case the peer doesn't respond we can reduce to avoid airtime. Signed-off-by: Chaitanya Tata (cherry picked from commit e1f857749c07bbacc779202742cc83185c7f47ed) --- modules/hostap/CMakeLists.txt | 4 ++++ modules/hostap/Kconfig | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 52ede512bdd2..43fe0d120203 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -394,6 +394,10 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P CONFIG_OFFCHANNEL ) +zephyr_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P + MAX_PROV_DISC_REQ_RETRIES=${CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P_PROV_DISC_REQ_RETRIES} +) + zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS CONFIG_WPS EAP_WSC diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 101c344804f3..82005b7bad7d 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -344,6 +344,17 @@ config WIFI_NM_WPA_SUPPLICANT_P2P select WIFI_NM_WPA_SUPPLICANT_WPS select WIFI_NM_WPA_SUPPLICANT_EAPOL +if WIFI_NM_WPA_SUPPLICANT_P2P + +config WIFI_NM_WPA_SUPPLICANT_P2P_PROV_DISC_REQ_RETRIES + int "P2P provision discovery request retries" + default 120 + help + Maximum number of retries for P2P provision discovery requests + when the peer is not listening. + +endif # WIFI_NM_WPA_SUPPLICANT_P2P + config WIFI_NM_WPA_SUPPLICANT_EAPOL bool "EAPoL supplicant" default y if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE From 0147a39a2af8de490f35b71f071a44a4d5d83bfd Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 2 Feb 2026 21:16:44 +0530 Subject: [PATCH 1894/3334] [nrf fromtree] manifest: hostap: Pull change for PD retry config Pull the change to use Zephyr Kconfig instead of C macro. Signed-off-by: Chaitanya Tata (cherry picked from commit 7f9dd0d996a751222b9df2c516271868037bd85f) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 76d54ed18072..e6976ce4472f 100644 --- a/west.yml +++ b/west.yml @@ -291,7 +291,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 7c5d886f4b1afd6d00192e346268f03f5f44354c + revision: f5708c522793b0de59f467080a33caac769cd525 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From 29bbe2f2b560ed837c3bcd62f3fe86e2ed41fd44 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Tue, 20 Jan 2026 11:40:54 +0100 Subject: [PATCH 1895/3334] [nrf fromtree] samples: ipc: icmsg: Extend support for nRF54LM20A Extends support and adds new overlays. Signed-off-by: Jakub Zymelka (cherry picked from commit 7431163b522439108300d6746a852c683bdb65fc) --- .../ipc/ipc_service/icmsg/CMakeLists.txt | 1 + .../ipc/ipc_service/icmsg/Kconfig.sysbuild | 1 + .../icmsg/boards/nrf54l_cpuapp_icbmsg.overlay | 11 +++++++ ... => nrf54lm20dk_nrf54lm20a_cpuapp.overlay} | 14 ++++---- .../boards/nrf54l_cpuflpr_icbmsg.overlay | 11 +++++++ ...=> nrf54lm20dk_nrf54lm20a_cpuflpr.overlay} | 14 ++++---- .../subsys/ipc/ipc_service/icmsg/sample.yaml | 33 +++++++++++-------- 7 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l_cpuapp_icbmsg.overlay rename samples/subsys/ipc/ipc_service/icmsg/boards/{nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay => nrf54lm20dk_nrf54lm20a_cpuapp.overlay} (64%) create mode 100644 samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l_cpuflpr_icbmsg.overlay rename samples/subsys/ipc/ipc_service/icmsg/remote/boards/{nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay => nrf54lm20dk_nrf54lm20a_cpuflpr.overlay} (67%) diff --git a/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt b/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt index fd88e8465fe1..b414551dd294 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt +++ b/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt @@ -10,6 +10,7 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) if(NOT CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP AND NOT CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUAPP AND + NOT CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP AND NOT CONFIG_BOARD_STM32H747I_DISCO AND NOT CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUAPP AND NOT CONFIG_BOARD_EK_RA8P1_R7KA8P1KFLCAC_CM85) diff --git a/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild b/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild index 58a434e2b6e9..11edd21c7540 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild +++ b/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild @@ -9,5 +9,6 @@ string default "nrf5340dk/nrf5340/cpunet" if $(BOARD) = "nrf5340dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD) = "nrf5340bsim" default "nrf54l15dk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15dk" + default "nrf54lm20dk/nrf54lm20a/cpuflpr" if $(BOARD) = "nrf54lm20dk" default "stm32h747i_disco/stm32h747xx/m4" if $(BOARD) = "stm32h747i_disco" default "ek_ra8p1/r7ka8p1kflcac/cm33" if $(BOARD) = "ek_ra8p1" diff --git a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l_cpuapp_icbmsg.overlay b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l_cpuapp_icbmsg.overlay new file mode 100644 index 000000000000..68a36325c53d --- /dev/null +++ b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l_cpuapp_icbmsg.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&ipc0 { + compatible = "zephyr,ipc-icbmsg"; + tx-blocks = <16>; + rx-blocks = <18>; +}; diff --git a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay similarity index 64% rename from samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay rename to samples/subsys/ipc/ipc_service/icmsg/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 639ad5e844b4..33afb300d789 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay +++ b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,24 +10,22 @@ #address-cells = <1>; #size-cells = <1>; - sram_rx: memory@20018000 { - reg = <0x20018000 0x0800>; + sram_rx: memory@20057c00 { + reg = <0x20057c00 0x8000>; }; - sram_tx: memory@20020000 { - reg = <0x20020000 0x0800>; + sram_tx: memory@2005fc00 { + reg = <0x2005fc00 0x8000>; }; }; }; ipc { ipc0: ipc0 { - compatible = "zephyr,ipc-icbmsg"; + compatible = "zephyr,ipc-icmsg"; dcache-alignment = <32>; tx-region = <&sram_tx>; rx-region = <&sram_rx>; - tx-blocks = <16>; - rx-blocks = <18>; mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>; mbox-names = "rx", "tx"; status = "okay"; diff --git a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l_cpuflpr_icbmsg.overlay b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l_cpuflpr_icbmsg.overlay new file mode 100644 index 000000000000..e93358b71f22 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l_cpuflpr_icbmsg.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&ipc0 { + compatible = "zephyr,ipc-icbmsg"; + tx-blocks = <18>; + rx-blocks = <16>; +}; diff --git a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay similarity index 67% rename from samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay rename to samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay index 7fe78a716539..7aa2e5fa557b 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay +++ b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,24 +10,22 @@ #address-cells = <1>; #size-cells = <1>; - sram_tx: memory@20018000 { - reg = <0x20018000 0x0800>; + sram_tx: memory@20057c00 { + reg = <0x20057c00 0x8000>; }; - sram_rx: memory@20020000 { - reg = <0x20020000 0x0800>; + sram_rx: memory@2005fc00 { + reg = <0x2005fc00 0x8000>; }; }; }; ipc { ipc0: ipc0 { - compatible = "zephyr,ipc-icbmsg"; + compatible = "zephyr,ipc-icmsg"; dcache-alignment = <32>; tx-region = <&sram_tx>; rx-region = <&sram_rx>; - tx-blocks = <18>; - rx-blocks = <16>; mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>; mbox-names = "rx", "tx"; status = "okay"; diff --git a/samples/subsys/ipc/ipc_service/icmsg/sample.yaml b/samples/subsys/ipc/ipc_service/icmsg/sample.yaml index d084434f7952..27ee7b5ad3bd 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/sample.yaml +++ b/samples/subsys/ipc/ipc_service/icmsg/sample.yaml @@ -14,16 +14,18 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340bsim/nrf5340/cpuapp - sample.ipc.icmsg.nrf54l15: + sample.ipc.icmsg.nrf54l: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: icmsg_SNIPPET=nordic-flpr - sample.ipc.icmsg.nrf54l15_no_multithreading: + sample.ipc.icmsg.nrf54l_no_multithreading: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: @@ -33,9 +35,10 @@ tests: - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y - sample.ipc.icmsg.nrf54l15_remote_no_multithreading: + sample.ipc.icmsg.nrf54l_remote_no_multithreading: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: @@ -43,43 +46,47 @@ tests: - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y - sample.ipc.icbmsg.nrf54l15: - platform_allow: nrf54l15dk/nrf54l15/cpuapp + sample.ipc.icbmsg.nrf54l: + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: - icmsg_SNIPPET=nordic-flpr - icmsg_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - icmsg_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay" + - icmsg_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuapp_icbmsg.overlay" - remote_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - remote_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay" + - remote_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuflpr_icbmsg.overlay" - sample.ipc.icbmsg.nrf54l15_no_multithreading: + sample.ipc.icbmsg.nrf54l_no_multithreading: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: - icmsg_SNIPPET=nordic-flpr - icmsg_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - icmsg_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay" + - icmsg_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuapp_icbmsg.overlay" - icmsg_CONFIG_MULTITHREADING=n - icmsg_CONFIG_LOG_MODE_MINIMAL=y - remote_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - remote_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay" + - remote_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuflpr_icbmsg.overlay" - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y - sample.ipc.icbmsg.nrf54l15_remote_no_multithreading: + sample.ipc.icbmsg.nrf54l_remote_no_multithreading: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: - icmsg_SNIPPET=nordic-flpr - icmsg_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - icmsg_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay" + - icmsg_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuapp_icbmsg.overlay" - remote_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - remote_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay" + - remote_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuflpr_icbmsg.overlay" - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y From 587050447ec81f187dbe268afa21b2b595901d6f Mon Sep 17 00:00:00 2001 From: Leif Harald Urlaub Date: Fri, 20 Feb 2026 14:59:42 +0100 Subject: [PATCH 1896/3334] [nrf noup] ci: workflow: modification of the stale_issue.yml stale_issue.yml: repo changed Signed-off-by: Leif Harald Urlaub --- .github/workflows/stale_issue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale_issue.yml b/.github/workflows/stale_issue.yml index 96d38de631f0..0abab94dfbe5 100644 --- a/.github/workflows/stale_issue.yml +++ b/.github/workflows/stale_issue.yml @@ -10,7 +10,7 @@ jobs: stale: name: Find Stale issues and PRs runs-on: ubuntu-24.04 - if: github.repository == 'zephyrproject-rtos/zephyr' + if: github.repository == 'nrfconnect/sdk-zephyr' permissions: pull-requests: write # to comment on stale pull requests issues: write # to comment on stale issues From f74bfc800155f9a0a88d963461693895900dd3a1 Mon Sep 17 00:00:00 2001 From: Kyle Bonnici Date: Tue, 16 Dec 2025 13:22:26 +0100 Subject: [PATCH 1897/3334] [nrf fromtree] CI: Update dts-linter to dts-linter 0.4.0 Expressions will now indent to align with the group they are in example: Was ```devicetree dmas = <&dma2 1 0 (STM32_DMA_MODE_NORMAL | STM32_DMA_PRIORITY_HIGH | STM32_DMA_16BITS) 0>; ``` Now ```devicetree dmas = <&dma2 1 0 (STM32_DMA_MODE_NORMAL | STM32_DMA_PRIORITY_HIGH | STM32_DMA_16BITS) 0>; ``` Signed-off-by: Kyle Bonnici (cherry picked from commit e0ca21ab5c6410f52a181ab21b7a42d387097c7b) --- scripts/ci/package-lock.json | 16 ++++++++-------- scripts/ci/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/ci/package-lock.json b/scripts/ci/package-lock.json index 50efc7dcaaa1..c8a74316d276 100644 --- a/scripts/ci/package-lock.json +++ b/scripts/ci/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "dts-linter": "^0.3.9" + "dts-linter": "^0.4.0" } }, "node_modules/devicetree-language-server": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/devicetree-language-server/-/devicetree-language-server-0.7.3.tgz", - "integrity": "sha512-Gzv6hp4Kq7t+tujIq5hqjJW+yrd+1KMCJuNNP5SnKub4HaJZKnbALFhSI/wVbOaOYTAhDJLKyiKPC2M5YE+egQ==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/devicetree-language-server/-/devicetree-language-server-0.8.0.tgz", + "integrity": "sha512-Zxfb1qOS9nSaPVJYRaSxCznaltte3O95RCy+89fJxiHYPODaix9vttIOhkhIQ4UdUe44SkqnovvA9z/QM5VuVA==", "license": "Apache-2.0", "bin": { "devicetree-language-server": "dist/server.js" @@ -21,12 +21,12 @@ } }, "node_modules/dts-linter": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/dts-linter/-/dts-linter-0.3.9.tgz", - "integrity": "sha512-J+JWuFmr1YUTqWxUjWtMHr7sGHX6Q9jDtFAE4a1ACvtlMP6CRA24F7WCSuUrQnP6hl3BAxJLmdoYIzT6UN9bxw==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/dts-linter/-/dts-linter-0.4.0.tgz", + "integrity": "sha512-bUuU4pLVagOPuMgzGgfW2ZXih7fHIsY6wqtrBxEsbEUKPCi27mpSYoCiLDjF6lCyAJuJyLeA/iDDYxJjSW5xbA==", "license": "Apache-2.0", "dependencies": { - "devicetree-language-server": "^0.7.3" + "devicetree-language-server": "^0.8.0" }, "bin": { "dts-linter": "dist/dts-linter.js" diff --git a/scripts/ci/package.json b/scripts/ci/package.json index 98b621977c7b..5f1bd4e2b87e 100644 --- a/scripts/ci/package.json +++ b/scripts/ci/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "dts-linter": "^0.3.9" + "dts-linter": "^0.4.0" } } From 06bc388b78938ef1ef30bd1f4b854b18fdf34460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 24 Feb 2026 15:03:14 +0100 Subject: [PATCH 1898/3334] [nrf fromlist] snippets: nordic-flpr: add nRF54LM20B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Required for running apps on cpuflpr core. Upstream PR #: 104470 Signed-off-by: Michał Stasiak --- snippets/nordic/nordic-flpr/snippet.yml | 3 ++ .../nordic-flpr/soc/nrf54lm20b_cpuapp.overlay | 47 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 snippets/nordic/nordic-flpr/soc/nrf54lm20b_cpuapp.overlay diff --git a/snippets/nordic/nordic-flpr/snippet.yml b/snippets/nordic/nordic-flpr/snippet.yml index 4fbb7c14c056..510478861535 100644 --- a/snippets/nordic/nordic-flpr/snippet.yml +++ b/snippets/nordic/nordic-flpr/snippet.yml @@ -12,6 +12,9 @@ boards: /.*/nrf54lm20a/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: soc/nrf54lm20a_cpuapp.overlay + /.*/nrf54lm20b/cpuapp/: + append: + EXTRA_DTC_OVERLAY_FILE: soc/nrf54lm20b_cpuapp.overlay /.*/nrf7120/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: soc/nrf7120_cpuapp.overlay diff --git a/snippets/nordic/nordic-flpr/soc/nrf54lm20b_cpuapp.overlay b/snippets/nordic/nordic-flpr/soc/nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..b950c9c60b43 --- /dev/null +++ b/snippets/nordic/nordic-flpr/soc/nrf54lm20b_cpuapp.overlay @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + soc { + cpuflpr_sram_code_data: memory@20067c00 { + compatible = "mmio-sram"; + reg = <0x20067c00 DT_SIZE_K(96)>; + ranges = <0x0 0x20067c00 0x18000>; + status = "reserved"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(415)>; + ranges = <0x0 0x20000000 DT_SIZE_K(415)>; +}; + +&rram_controller { + cpuflpr_rram: rram@1e5000 { + compatible = "soc-nv-flash"; + reg = <0x1e5000 DT_SIZE_K(96)>; + ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; + erase-block-size = <0x1000>; + write-block-size = <0x10>; + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +&uart30 { + status = "reserved"; +}; + +&cpuflpr_vpr { + execution-memory = <&cpuflpr_sram_code_data>; + source-memory = <&cpuflpr_rram>; +}; + +&cpuapp_vevif_tx { + status = "okay"; +}; From baf177647fc40c5b87d35b24f13b5e4174bd7de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 25 Feb 2026 08:30:05 +0100 Subject: [PATCH 1899/3334] [nrf fromlist] boards: nrf54lm20dk: fix board variants and runners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nRF54LM20 FLPR does not have XIP variant. Added nRF54LM20B SoC to runners. Upstream PR #: 104470 Signed-off-by: Michał Stasiak --- boards/nordic/nrf54lm20dk/board.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/board.yml b/boards/nordic/nrf54lm20dk/board.yml index 73bcd82ecc28..0de3f7c5ffd4 100644 --- a/boards/nordic/nrf54lm20dk/board.yml +++ b/boards/nordic/nrf54lm20dk/board.yml @@ -7,14 +7,10 @@ board: variants: - name: ns cpucluster: cpuapp - - name: xip - cpucluster: cpuflpr - name: nrf54lm20b variants: - name: ns cpucluster: cpuapp - - name: xip - cpucluster: cpuflpr runners: run_once: '--recover': @@ -27,7 +23,9 @@ runners: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr/xip + - nrf54lm20dk/nrf54lm20b/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp/ns + - nrf54lm20dk/nrf54lm20b/cpuflpr '--erase': - runners: - nrfjprog @@ -39,7 +37,9 @@ runners: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr/xip + - nrf54lm20dk/nrf54lm20b/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp/ns + - nrf54lm20dk/nrf54lm20b/cpuflpr '--reset': - runners: - nrfjprog @@ -51,4 +51,6 @@ runners: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20a/cpuflpr/xip + - nrf54lm20dk/nrf54lm20b/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp/ns + - nrf54lm20dk/nrf54lm20b/cpuflpr From 089cd1a3f8fa3c9ca72e78963b67303ceadd4cbf Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:01:05 +0000 Subject: [PATCH 1900/3334] [nrf fromtree] samples: basic: minimal: Add support for nRF7120 After porting nRF7120 to Zephyr, all samples that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 8a7282182bacd7fd36cd3df8e209396abbeb99cf) --- samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf | 1 + samples/basic/minimal/sample.yaml | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf diff --git a/samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf b/samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..c21cb5cfe71a --- /dev/null +++ b/samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_CLOCK_CONTROL=n diff --git a/samples/basic/minimal/sample.yaml b/samples/basic/minimal/sample.yaml index 3330ea4af2a3..dcb6d989f85b 100644 --- a/samples/basic/minimal/sample.yaml +++ b/samples/basic/minimal/sample.yaml @@ -111,9 +111,11 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp sample.minimal.no-mt-no-sw-isr-table.riscv: extra_args: CONF_FILE='common.conf;no-mt.conf;no-sw-isr-table.conf;riscv.conf' build_only: true platform_allow: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr + - nrf7120dk/nrf7120/cpuflpr From fb92e543e74d3a14d4d6f5f54810fa580e34bd2c Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:04:12 +0000 Subject: [PATCH 1901/3334] [nrf fromtree] samples: boards: nordic: nrf_sys_event: Add support for nRF7120 After porting nRF7120 to Zephyr, all samples that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 5101fe2832d94b7b5e0d3a08483dced80aa7f5fd) --- .../nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay | 8 ++++++++ samples/boards/nordic/nrf_sys_event/sample.yaml | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..246efa029ede --- /dev/null +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +sample_counter: &timer20 { + status = "okay"; +}; diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index 5b36f2517b31..6ac248d7fc3c 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -20,6 +20,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -28,6 +29,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp sample.boards.nordic.nrf_sys_event.force_constlat: platform_allow: @@ -42,6 +44,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -50,6 +53,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SOC_NRF_FORCE_CONSTLAT=y From 95c5e78f015f8831b0172ef6528905bd9a49cc22 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:12:28 +0000 Subject: [PATCH 1902/3334] [nrf fromtree] samples: boards: nordic: system_off: add support for nRF7120 After porting nRF7120 to Zephyr, all samples that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 6d543bede7b1dc61b1a774cd02dc73af54c62840) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 29 +++++++++++++++++++ samples/boards/nordic/system_off/sample.yaml | 6 ++++ 2 files changed, 35 insertions(+) create mode 100644 samples/boards/nordic/system_off/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/boards/nordic/system_off/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/boards/nordic/system_off/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..31e33449bd94 --- /dev/null +++ b/samples/boards/nordic/system_off/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + cpuapp_sram@2002e000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2002e000 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + /* Shrink SRAM size to avoid overlap with retained memory region */ + reg = <0x20000000 DT_SIZE_K(184)>; + ranges = <0x0 0x20000000 0x2e000>; +}; diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index ce9321a845b3..0672c22e4c63 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -15,6 +15,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp harness: console harness_config: type: multi_line @@ -34,6 +35,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y harness: console @@ -53,6 +55,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_SYS_CLOCK_DISABLE=y harness: console @@ -70,6 +73,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y - CONFIG_SYS_CLOCK_DISABLE=y @@ -91,6 +95,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_GRTC_WAKEUP_ENABLE=y - CONFIG_GPIO_WAKEUP_ENABLE=n @@ -115,6 +120,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y - CONFIG_GRTC_WAKEUP_ENABLE=y From 7fbf239bdc17c3b3c6a4ba4a49113d40a8485d91 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:15:06 +0000 Subject: [PATCH 1903/3334] [nrf fromtree] samples: drivers: i2c: rtio_loopback: Add support for nRF7120 After porting nRF7120 to Zephyr, all samples that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 3902ab8632eb8545515c787cc597eb3e301ceeaf) --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 7 ++ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 67 +++++++++++++++++++ samples/drivers/i2c/rtio_loopback/sample.yaml | 1 + 3 files changed, 75 insertions(+) create mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf create mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf b/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..9b1d098346ed --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2026 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..61911f3acefa --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P1.8 and P1.9 + * SCL = P1.2 and P1.3 + */ + +/ { + aliases { + i2c-controller = &i2c21; + i2c-controller-target = &i2c22; + }; +}; + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default: i2c22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep: i2c22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c22_default>; + pinctrl-1 = <&i2c22_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; +}; diff --git a/samples/drivers/i2c/rtio_loopback/sample.yaml b/samples/drivers/i2c/rtio_loopback/sample.yaml index dadfe1fff98e..de3c2cb237ce 100644 --- a/samples/drivers/i2c/rtio_loopback/sample.yaml +++ b/samples/drivers/i2c/rtio_loopback/sample.yaml @@ -18,6 +18,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - nucleo_f401re - nucleo_h503rb - ophelia4ev/nrf54l15/cpuapp From 94112b4a7012ce6a9b3f9af249382de5c6aaaf98 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:16:17 +0000 Subject: [PATCH 1904/3334] [nrf fromtree] samples: sensor: qdec: Add support for nRF7120 After porting nRF7120 to Zephyr, all samples that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 66aa83a8d3318d1fe7a4bc4019d12bb7afbc878f) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 46 +++++++++++++++++++ samples/sensor/qdec/sample.yaml | 2 + 2 files changed, 48 insertions(+) create mode 100644 samples/sensor/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/sensor/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/sensor/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..f3c0ea4556b3 --- /dev/null +++ b/samples/sensor/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + qdec0 = &qdec20; + qenca = &phase_a; + qencb = &phase_b; + }; + + encoder-emulate { + compatible = "gpio-leds"; + + phase_a: phase_a { + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + }; + + phase_b: phase_b { + gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pinctrl { + qdec_pinctrl: qdec_pinctrl { + group1 { + psels = , + ; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&qdec20 { + status = "okay"; + pinctrl-0 = <&qdec_pinctrl>; + pinctrl-names = "default"; + steps = <120>; + led-pre = <500>; +}; diff --git a/samples/sensor/qdec/sample.yaml b/samples/sensor/qdec/sample.yaml index fbff236caf1d..78809a7dcba1 100644 --- a/samples/sensor/qdec/sample.yaml +++ b/samples/sensor/qdec/sample.yaml @@ -34,6 +34,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -41,6 +42,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp harness_config: fixture: gpio_loopback From a149e439ef5d38c316aa3aff210a8acf68116a53 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:16:41 +0000 Subject: [PATCH 1905/3334] [nrf fromtree] samples: sysbuild: hello_world: Add support for nRF7120 After porting nRF7120 to Zephyr, all samples that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 1c33298b40be17905cbee92a205ce090ed0a8916) --- samples/sysbuild/hello_world/Kconfig.sysbuild | 1 + samples/sysbuild/hello_world/sample.yaml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/samples/sysbuild/hello_world/Kconfig.sysbuild b/samples/sysbuild/hello_world/Kconfig.sysbuild index 5204e7d6f645..22b942e0510d 100644 --- a/samples/sysbuild/hello_world/Kconfig.sysbuild +++ b/samples/sysbuild/hello_world/Kconfig.sysbuild @@ -34,3 +34,4 @@ config REMOTE_BOARD default "$(BOARD)/nrf54h20/cpuppr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUPPR_XIP_CORE default "$(BOARD)/nrf54h20/cpuflpr" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUFLPR_CORE default "$(BOARD)/nrf54h20/cpuflpr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUFLPR_XIP_CORE + default "$(BOARD)/nrf7120/cpuflpr" if SOC_NRF7120_CPUAPP diff --git a/samples/sysbuild/hello_world/sample.yaml b/samples/sysbuild/hello_world/sample.yaml index 47a95b35bb05..7e1d00b34a8c 100644 --- a/samples/sysbuild/hello_world/sample.yaml +++ b/samples/sysbuild/hello_world/sample.yaml @@ -73,3 +73,10 @@ tests: extra_args: - SB_CONFIG_REMOTE_NRF54H20_CPUFLPR_XIP_CORE=y - hello_world_SNIPPET=nordic-flpr-xip + sample.sysbuild.hello_world.nrf7120_cpuflpr: + platform_allow: + - nrf7120dk/nrf7120/cpuapp + integration_platforms: + - nrf7120dk/nrf7120/cpuapp + extra_args: + - hello_world_SNIPPET=nordic-flpr From 8fadbe6322a0c35b6721438814570b90e17b2235 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:18:20 +0000 Subject: [PATCH 1906/3334] [nrf fromtree] samples drivers: counter: alarm: Add support for nRF7120 After porting nRF7120 to Zephyr, all samples that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 320f3b4893bf23f72032ec52ef730acafcf730e9) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 16 ++++++++++++++++ samples/drivers/counter/alarm/sample.yaml | 1 + 2 files changed, 17 insertions(+) create mode 100644 samples/drivers/counter/alarm/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/drivers/counter/alarm/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/drivers/counter/alarm/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..37001d785480 --- /dev/null +++ b/samples/drivers/counter/alarm/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,16 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2026 Nordic Semiconductor ASA + */ + +/ { + chosen { + counter = &timer10; + }; +}; + +&timer10 { + prescaler = <4>; + status = "okay"; +}; diff --git a/samples/drivers/counter/alarm/sample.yaml b/samples/drivers/counter/alarm/sample.yaml index 266c11240f51..f1e21dea1108 100644 --- a/samples/drivers/counter/alarm/sample.yaml +++ b/samples/drivers/counter/alarm/sample.yaml @@ -28,6 +28,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - nrf9160dk/nrf9160 - sama7g54_ek - samd20_xpro From 7810bbb02599e20b411e4ab5445406b6c9c7070b Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:19:38 +0000 Subject: [PATCH 1907/3334] [nrf fromtree] tests: boards: nrf: hwinfo: reset_cause: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit e789595d0586347346f405f21851e47c9083432e) --- .../reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay | 9 +++++++++ tests/boards/nrf/hwinfo/reset_cause/testcase.yaml | 1 + 2 files changed, 10 insertions(+) create mode 100644 tests/boards/nrf/hwinfo/reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..dcac0662ba24 --- /dev/null +++ b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml index da37f9ef614d..6541d41c7406 100644 --- a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml +++ b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml @@ -39,5 +39,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp From f8f073faa1de6d430a9399b88c01d5f6410926dd Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:20:36 +0000 Subject: [PATCH 1908/3334] [nrf fromtree] tests: boards: nrf: qdec: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit c27bf83db3d42d4238170a15674910675cf606d7) --- .../qdec/boards/nrf7120dk_nrf7120_common.dtsi | 108 ++++++++++++++++++ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 7 ++ tests/boards/nrf/qdec/testcase.yaml | 2 + 3 files changed, 117 insertions(+) create mode 100644 tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_common.dtsi create mode 100644 tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_common.dtsi b/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_common.dtsi new file mode 100644 index 000000000000..db2df77f5ca5 --- /dev/null +++ b/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_common.dtsi @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Required loopbacks + * P1.11 <-> P1.12 + * P1.13 <-> P1.15 + * P1.02 <-> P1.3 + * P1.00 <-> P1.14 + */ + +/ { + encoder-emulate { + compatible = "gpio-leds"; + + phase_a0: phase_a0 { + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + }; + + phase_b0: phase_b0 { + gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + }; + + phase_a1: phase_a1 { + gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + }; + + phase_b1: phase_b1 { + gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; + }; + }; + + qdec_loopbacks: loopbacks { + compatible = "test-qdec-loopbacks"; + + loopback0 { + qdec = <&qdec20>; + qenc-emul-gpios = <&phase_a0 &phase_b0>; + }; + + loopback1 { + qdec = <&qdec21>; + qenc-emul-gpios = <&phase_a1 &phase_b1>; + }; + }; +}; + +&pinctrl { + qdec_20_pinctrl: qdec_20_pinctrl { + group1 { + psels = , + ; + }; + }; + + qdec_20_sleep_pinctrl: qdec_20_sleep_pinctrl { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + qdec_21_pinctrl: qdec_21_pinctrl { + group1 { + psels = , + ; + }; + }; + + qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&qdec20 { + status = "okay"; + pinctrl-0 = <&qdec_20_pinctrl>; + pinctrl-1 = <&qdec_20_sleep_pinctrl>; + pinctrl-names = "default", "sleep"; + steps = <127>; + led-pre = <500>; + zephyr,pm-device-runtime-auto; +}; + +&qdec21 { + status = "okay"; + pinctrl-0 = <&qdec_21_pinctrl>; + pinctrl-1 = <&qdec_21_sleep_pinctrl>; + pinctrl-names = "default", "sleep"; + steps = <127>; + led-pre = <500>; + zephyr,pm-device-runtime-auto; +}; diff --git a/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..b6b6349bb656 --- /dev/null +++ b/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_common.dtsi" diff --git a/tests/boards/nrf/qdec/testcase.yaml b/tests/boards/nrf/qdec/testcase.yaml index e3eb262685ad..232780d7abb9 100644 --- a/tests/boards/nrf/qdec/testcase.yaml +++ b/tests/boards/nrf/qdec/testcase.yaml @@ -8,6 +8,7 @@ common: - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr + - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp @@ -16,6 +17,7 @@ common: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr + - nrf7120dk/nrf7120/cpuapp harness: ztest harness_config: fixture: gpio_loopback From 3b443d37e567e753583412576c29ac9c08248145 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Tue, 10 Feb 2026 17:41:11 +0000 Subject: [PATCH 1909/3334] [nrf fromtree] tests: drivers: audio: dmic_api: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 61f1ede5ec429e53340ab5a662e73f5f2e29b427) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/drivers/audio/dmic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/audio/dmic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/audio/dmic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..3debd272dc09 --- /dev/null +++ b/tests/drivers/audio/dmic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires loopbacks: + * - between P1.14 and P1.0, + * For best performance, PDM_CLK shall be on 'Clock pin'. + */ + +/ { + aliases { + dmic-dev = &pdm20; + }; +}; + +&pinctrl { + pdm20_default_test: pdm20_default_test { + group1 { + psels = , + ; + }; + }; +}; + +&pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_test>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; From 7a6bc3fea52f259fbfdbfc8d19b0eb2d19aa82fa Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:21:25 +0000 Subject: [PATCH 1910/3334] [nrf fromtree] tests: drivers: build_all: comparator: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 7382c4da6123c6a779176af0c6c06f613709266d) --- tests/drivers/build_all/comparator/testcase.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/drivers/build_all/comparator/testcase.yaml b/tests/drivers/build_all/comparator/testcase.yaml index 7c9755ed858b..0d509b68988e 100644 --- a/tests/drivers/build_all/comparator/testcase.yaml +++ b/tests/drivers/build_all/comparator/testcase.yaml @@ -45,6 +45,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - nrf9280pdk/nrf9280/cpuapp integration_platforms: @@ -63,6 +64,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - nrf9280pdk/nrf9280/cpuapp integration_platforms: @@ -77,11 +79,13 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - nrf9280pdk/nrf9280/cpuapp integration_platforms: - nrf51dk/nrf51822 - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.build_all.comparator.nrf_lpcomp.int_ref: extra_args: @@ -92,6 +96,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - nrf9280pdk/nrf9280/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 20bfade2bee8502626283705006894089042b9d6 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:26:14 +0000 Subject: [PATCH 1911/3334] [nrf fromtree] tests: drivers: flash: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 5344e191fc52256ed3962def3997e82fc067274d) --- tests/drivers/flash/common/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 6a3250727d9c..489d2bf0bd57 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -92,6 +92,7 @@ tests: drivers.flash.common.no_explicit_erase.nrf54h: platform_allow: - nrf54h20dk/nrf54h20/cpuapp + - nrf7120dk/nrf7120/cpuapp harness_config: fixture: gpio_loopback drivers.flash.common.nrf54lm20a: From ade9efb2aa1b81875956e57e3383c5f2ae73e19f Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:34:27 +0000 Subject: [PATCH 1912/3334] [nrf fromtree] tests: drivers: timer: nrf_grtc_timer: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 65b98bd44741a726660ef79a79bee83a66d58fe8) --- tests/drivers/timer/nrf_grtc_timer/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index 549234220ceb..f4c6439972ab 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -11,6 +11,7 @@ common: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr integration_platforms: From 86004d54f70bcf5bdb678999cf39fafdb719445d Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:35:08 +0000 Subject: [PATCH 1913/3334] [nrf fromtree] tests: drivers: uart: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 46e9aac3cab6311edecf4bc67c8bc4313b9aeb48) --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 1 + .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 30 ++++++++++ .../boards/nrf7120dk_nrf7120_cpuflpr.overlay | 7 +++ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 35 +++++++++++ ...7120dk_nrf7120_cpuapp_cross_domain.overlay | 35 +++++++++++ .../boards/nrf7120dk_nrf7120_cpuflpr.overlay | 35 +++++++++++ ...rf7120dk_nrf7120_cpuflpr_dual_uart.overlay | 55 +++++++++++++++++ .../nrf7120dk_nrf7120_dual_uart.overlay | 55 +++++++++++++++++ .../uart/uart_elementary/testcase.yaml | 11 ++++ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 59 +++++++++++++++++++ tests/drivers/uart/uart_errors/testcase.yaml | 2 + .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 43 ++++++++++++++ .../uart/uart_mix_fifo_poll/testcase.yaml | 1 + .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 30 ++++++++++ tests/drivers/uart/uart_pm/testcase.yaml | 4 ++ 15 files changed, 403 insertions(+) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuflpr.overlay create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp_cross_domain.overlay create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr.overlay create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr_dual_uart.overlay create mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_dual_uart.overlay create mode 100644 tests/drivers/uart/uart_errors/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/uart/uart_mix_fifo_poll/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/uart/uart_pm/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..8eb6607b6f70 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default_alt: uart21_default_alt { + group1 { + psels = , + ; + }; + }; + + uart21_sleep_alt: uart21_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + pinctrl-0 = <&uart21_default_alt>; + pinctrl-1 = <&uart21_sleep_alt>; + pinctrl-names = "default", "sleep"; + current-speed = <115200>; +}; diff --git a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuflpr.overlay b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuflpr.overlay new file mode 100644 index 000000000000..e2649a103542 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuflpr.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..1d6c9d8a0d99 --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp_cross_domain.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp_cross_domain.overlay new file mode 100644 index 000000000000..831d82c075ec --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp_cross_domain.overlay @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr.overlay new file mode 100644 index 000000000000..661195cb7fa3 --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr.overlay @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr_dual_uart.overlay new file mode 100644 index 000000000000..38494bc31bee --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr_dual_uart.overlay @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + uart22_default: uart22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + uart22_sleep: uart22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; +}; + +dut_aux: &uart22 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart22_default>; + pinctrl-1 = <&uart22_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_dual_uart.overlay new file mode 100644 index 000000000000..5e0813748317 --- /dev/null +++ b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_dual_uart.overlay @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + uart22_default: uart22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + uart22_sleep: uart22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; +}; + +dut_aux: &uart22 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart22_default>; + pinctrl-1 = <&uart22_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index 7de614defbaf..a7ebe182a311 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -16,6 +16,8 @@ tests: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr + - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuflpr - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr @@ -74,6 +76,8 @@ tests: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr + - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuflpr - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr extra_args: @@ -81,6 +85,8 @@ tests: - platform:nrf54l15dk/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - platform:nrf54lm20dk/nrf54lm20a/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - platform:nrf54lm20dk/nrf54lm20a/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" + - platform:nrf7120dk/nrf7120/cpuapp:"DTC_OVERLAY_FILE=boards/nrf7120dk_nrf7120_dual_uart.overlay" + - platform:nrf7120dk/nrf7120/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf7120dk_nrf7120_dual_uart.overlay" - platform:ophelia4ev/nrf54l15/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - platform:ophelia4ev/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" extra_configs: @@ -92,6 +98,8 @@ tests: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr + - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuflpr - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr extra_args: @@ -99,6 +107,8 @@ tests: - platform:nrf54l15dk/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - platform:nrf54lm20dk/nrf54lm20a/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - platform:nrf54lm20dk/nrf54lm20a/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" + - platform:nrf7120dk/nrf7120/cpuapp:"DTC_OVERLAY_FILE=boards/nrf7120dk_nrf7120_dual_uart.overlay" + - platform:nrf7120dk/nrf7120/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf7120dk_nrf7120_dual_uart.overlay" - platform:ophelia4ev/nrf54l15/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - platform:ophelia4ev/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" extra_configs: @@ -110,6 +120,7 @@ tests: fixture: uart_p1_p2_loopback platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay" extra_configs: - CONFIG_NRF_SYS_EVENT=y diff --git a/tests/drivers/uart/uart_errors/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_errors/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..059d55aa1386 --- /dev/null +++ b/tests/drivers/uart/uart_errors/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + uart22_default: uart22_default { + group1 { + psels = ; + bias-pull-up; + }; + + group2 { + psels = ; + }; + }; + + uart22_sleep: uart22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; +}; + +dut_aux: &uart22 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart22_default>; + pinctrl-1 = <&uart22_sleep>; + pinctrl-names = "default", "sleep"; + disable-rx; +}; diff --git a/tests/drivers/uart/uart_errors/testcase.yaml b/tests/drivers/uart/uart_errors/testcase.yaml index 79860fc5b2f6..cdd90f7378b6 100644 --- a/tests/drivers/uart/uart_errors/testcase.yaml +++ b/tests/drivers/uart/uart_errors/testcase.yaml @@ -15,6 +15,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf5340dk/nrf5340/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - sam_e54_xpro drivers.uart.uart_errors.async: @@ -24,6 +25,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf5340dk/nrf5340/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - sam_e54_xpro extra_args: EXTRA_CONF_FILE="boards/sam_e54_xpro_async.conf" diff --git a/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..4884beb93ced --- /dev/null +++ b/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + , + , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; + hw-flow-control; +}; + +counter_dev: &timer00 { + status = "okay"; +}; + +&grtc { + interrupts = <228 2>; +}; diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index 3769ea9f1de9..e98e85aa735c 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -16,6 +16,7 @@ common: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 diff --git a/tests/drivers/uart/uart_pm/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_pm/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..ddcbb362dc05 --- /dev/null +++ b/tests/drivers/uart/uart_pm/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart21_default: uart21_default { + group1 { + psels = , + ; + }; + }; + + uart21_sleep: uart21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart21 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart21_default>; + pinctrl-1 = <&uart21_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 4dec1c51ea01..bd82f4193981 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -12,6 +12,7 @@ common: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp harness_config: fixture: gpio_loopback @@ -39,6 +40,7 @@ tests: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.uart.pm.enhanced_poll: @@ -50,6 +52,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.uart.pm.int_driven: @@ -88,4 +91,5 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp From e489a82503373fcf8d3b128fe8b870654a8985e3 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:31:07 +0000 Subject: [PATCH 1914/3334] [nrf fromtree] tests: drivers: mbox: mbox_error_cases: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 846963f5053a36948107431b0843102bf1faaed4) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 22 +++++++++++++++++++ .../drivers/mbox/mbox_error_cases/sample.yaml | 2 ++ .../drivers/mbox/mbox_error_cases/src/main.c | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/mbox/mbox_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/mbox/mbox_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/mbox/mbox_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..6d1f935b2ce0 --- /dev/null +++ b/tests/drivers/mbox/mbox_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,22 @@ +/* + * Copyright 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + mbox-consumer { + compatible = "vnd,mbox-consumer"; + mboxes = <&cpuapp_vevif_tx 21>, <&cpuapp_vevif_tx 32>, + <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_rx 32>; + mbox-names = "remote_valid", "remote_incorrect", + "local_valid", "local_incorrect"; + }; +}; + +&cpuapp_vevif_rx { + status = "okay"; +}; + +&cpuapp_vevif_tx { + status = "okay"; +}; diff --git a/tests/drivers/mbox/mbox_error_cases/sample.yaml b/tests/drivers/mbox/mbox_error_cases/sample.yaml index a285478b4235..06255734ea5c 100644 --- a/tests/drivers/mbox/mbox_error_cases/sample.yaml +++ b/tests/drivers/mbox/mbox_error_cases/sample.yaml @@ -18,9 +18,11 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_args: SNIPPET=nordic-flpr diff --git a/tests/drivers/mbox/mbox_error_cases/src/main.c b/tests/drivers/mbox/mbox_error_cases/src/main.c index 377ab6b8be43..53e7196dccd9 100644 --- a/tests/drivers/mbox/mbox_error_cases/src/main.c +++ b/tests/drivers/mbox/mbox_error_cases/src/main.c @@ -12,7 +12,7 @@ int dummy_value; #if defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || \ defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) || \ - defined(CONFIG_SOC_NRF54LM20A) + defined(CONFIG_SOC_NRF54LM20A) || defined(CONFIG_SOC_NRF7120) #define EXPECTED_MTU_VALUE (0) #define DATA_TRANSFER_MODE_SUPPORTED (0) #define REMOTE_BUSY_SUPPORTED (0) From e6a1b0c384fcdb5d9eb6c6cb195850b17e85ea22 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:32:30 +0000 Subject: [PATCH 1915/3334] [nrf fromtree] tests: drivers: retained_mem: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit ac24354b469e45eb3aa1ffd6d4752a9683084c53) --- .../api/boards/nrf7120dk_nrf7120_cpuapp.conf | 1 + .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 28 +++++++++++++++++++ tests/drivers/retained_mem/api/testcase.yaml | 1 + 3 files changed, 30 insertions(+) create mode 100644 tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.conf create mode 100644 tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..c15ba3ed96da --- /dev/null +++ b/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_POWEROFF=y diff --git a/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..bce909500d5a --- /dev/null +++ b/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + cpuapp_sram@2002e000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2002e000 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemtestdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(184)>; + ranges = <0x0 0x20000000 0x2e000>; +}; diff --git a/tests/drivers/retained_mem/api/testcase.yaml b/tests/drivers/retained_mem/api/testcase.yaml index a07d56443e39..1a9180d7185e 100644 --- a/tests/drivers/retained_mem/api/testcase.yaml +++ b/tests/drivers/retained_mem/api/testcase.yaml @@ -20,6 +20,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - nucleo_h723zg/stm32h723xx - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 81ca00215cb89c85973722efed9b29e96a26f958 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:35:26 +0000 Subject: [PATCH 1916/3334] [nrf fromtree] tests: drivers: watchdog: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit ac7b7e84351dd8e6216be36d71a2a66db1d85a6f) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 9 +++++++++ tests/drivers/watchdog/wdt_variables/testcase.yaml | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 tests/drivers/watchdog/wdt_variables/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/watchdog/wdt_variables/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/watchdog/wdt_variables/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..dcac0662ba24 --- /dev/null +++ b/tests/drivers/watchdog/wdt_variables/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/tests/drivers/watchdog/wdt_variables/testcase.yaml b/tests/drivers/watchdog/wdt_variables/testcase.yaml index 07f6a8945dc4..f7d3bbbcb850 100644 --- a/tests/drivers/watchdog/wdt_variables/testcase.yaml +++ b/tests/drivers/watchdog/wdt_variables/testcase.yaml @@ -16,9 +16,11 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.watchdog.wdt_variables.54h_flpr: From 5160d5a442c4b6391908f13c2253e9eed6220afa Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:32:54 +0000 Subject: [PATCH 1917/3334] [nrf fromtree] tests: drivers: sensor: temp_sensor: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit c601161938cb905609ace1b3a57676e62499a43d) --- .../temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/drivers/sensor/temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/sensor/temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/sensor/temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..b0d340854352 --- /dev/null +++ b/tests/drivers/sensor/temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +temp_sensor: &temp { + status = "okay"; +}; From d10223872031e5b38abb93b3f86ba9fd8e451b36 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:36:01 +0000 Subject: [PATCH 1918/3334] [nrf fromtree] tests: subsys: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit fd3bcd3ac94f7f5cd96e66ae3d65fbd1b10e089a) --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 + tests/subsys/settings/performance/testcase.yaml | 2 ++ tests/subsys/settings/tfm_psa/testcase.yaml | 1 + 3 files changed, 4 insertions(+) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index c794ea1797e5..5a524f2c5ec6 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -21,6 +21,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf5340dk/nrf5340/cpuapp - nrf52840dk/nrf52840 + - nrf7120dk/nrf7120/cpuapp - nrf9151dk/nrf9151 - nrf9160dk/nrf9160 - nrf9161dk/nrf9161 diff --git a/tests/subsys/settings/performance/testcase.yaml b/tests/subsys/settings/performance/testcase.yaml index efbd2115234c..8ffe1f8112d5 100644 --- a/tests/subsys/settings/performance/testcase.yaml +++ b/tests/subsys/settings/performance/testcase.yaml @@ -7,6 +7,7 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - mps2/an385 integration_platforms: @@ -27,6 +28,7 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - mps2/an385 integration_platforms: diff --git a/tests/subsys/settings/tfm_psa/testcase.yaml b/tests/subsys/settings/tfm_psa/testcase.yaml index 4c036ca752b4..0b7a4b4124ca 100644 --- a/tests/subsys/settings/tfm_psa/testcase.yaml +++ b/tests/subsys/settings/tfm_psa/testcase.yaml @@ -8,6 +8,7 @@ common: - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns + - nrf7120dk/nrf7120/cpuapp/ns - mps2/an521/cpu0/ns - lpcxpresso55s69/lpc55s69/cpu0/ns tags: From d278f23780d56cc101ed52aff665270b800ebdbf Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:18:48 +0000 Subject: [PATCH 1919/3334] [nrf fromtree] tests boards: nrf_comp: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 807bd74b66a5ce90b3f0b604c088f862791b4c1d) --- .../comp/boards/nrf7120dk_nrf7120_cpuapp.conf | 4 ++ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 41 +++++++++++++++++++ tests/boards/nrf/comp/testcase.yaml | 1 + 3 files changed, 46 insertions(+) create mode 100644 tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.conf create mode 100644 tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..369d6daa6d93 --- /dev/null +++ b/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1,4 @@ +CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX=0 +CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX=5 +CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX=1 +CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX=0 diff --git a/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..846417be281a --- /dev/null +++ b/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Two loopbacks are used + * Each loopback is between analog input and GPIO. + * first-gpios (P0.02) -> AIN1 (P0.01) + * second-gpios (P0.03, AIN3) -> (P0.00, AIN0) + * AIN5 (P0.05) -> VDD + */ + +#include + +/ { + aliases { + test-comp = ∁ + }; + + zephyr,user { + first-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + second-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&comp { + status = "okay"; + psel = ; + refsel = "AREF"; + extrefsel = ; + sp-mode = "LOW"; + th-up = <36>; + th-down = <30>; + isource = "DISABLED"; + enable-hyst; +}; diff --git a/tests/boards/nrf/comp/testcase.yaml b/tests/boards/nrf/comp/testcase.yaml index 6d158d284eea..f4a88db57df3 100644 --- a/tests/boards/nrf/comp/testcase.yaml +++ b/tests/boards/nrf/comp/testcase.yaml @@ -13,3 +13,4 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp From b6bd31719f95481386056447890abb44e730ce6d Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:20:06 +0000 Subject: [PATCH 1920/3334] [nrf fromtree] tests: boards: nrf: i2c: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 4511e75716ae36515ddb259787e8f07c011fc9f7) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 67 +++++++++++++++++++ tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 4 ++ 2 files changed, 71 insertions(+) create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..48f3d7b0b53d --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + i2c-slave = &i2c22; + }; +}; + +&pinctrl { + i2c21_default_alt: i2c21_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c21_sleep_alt: i2c21_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default_alt: i2c22_default_alt { + group1 { + /* Temporary workaround as it is currently not possible + * to configure pins for TWIS with pinctrl. + */ + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep_alt: i2c22_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c21 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c21_default_alt>; + pinctrl-1 = <&i2c21_sleep_alt>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c22_default_alt>; + pinctrl-1 = <&i2c22_sleep_alt>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index b50aade0191e..c2e885ec6a00 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -17,6 +17,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp @@ -24,6 +25,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp boards.nrf.i2c.i2c_slave.twi: platform_allow: - nrf52840dk/nrf52840 @@ -39,6 +41,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp @@ -46,6 +49,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE="i2c_speed_fast.overlay" boards.nrf.i2c.i2c_slave.fast_plus: From e4f2c497c526eabc8f6a140be7270691c46cda9c Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:22:20 +0000 Subject: [PATCH 1921/3334] [nrf fromtree] tests: drivers: clock_control: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 68b53e8eb5fa389c8c2ac64e2532ea9c959ade52) --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 1 + .../clock_control/clock_control_api/testcase.yaml | 2 ++ .../clock_control/nrf_clock_calibration/testcase.yaml | 1 + .../clock_control/nrf_clock_control/testcase.yaml | 1 + .../clock_control/nrf_lf_clock_start/testcase.yaml | 9 +++++++++ tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c | 2 +- .../drivers/clock_control/nrf_onoff_and_bt/testcase.yaml | 2 ++ tests/drivers/clock_control/onoff/testcase.yaml | 1 + 8 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/clock_control/clock_control_api/boards/nrf7120dk_nrf7120_cpuapp.conf diff --git a/tests/drivers/clock_control/clock_control_api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/clock_control/clock_control_api/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..377287fb194c --- /dev/null +++ b/tests/drivers/clock_control/clock_control_api/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_TEST_NRF_HF_STARTUP_TIME_US=2000 diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index 9f98524dbb95..d91ea13821ed 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -26,6 +26,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -37,6 +38,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index 39fec028a40b..f7c3dd46a048 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -11,6 +11,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_clock_control/testcase.yaml b/tests/drivers/clock_control/nrf_clock_control/testcase.yaml index 856cc9cb6476..70d0942ebedf 100644 --- a/tests/drivers/clock_control/nrf_clock_control/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_control/testcase.yaml @@ -5,3 +5,4 @@ tests: - clock_control platform_allow: - nrf54h20dk/nrf54h20/cpuapp + - nrf7120dk/nrf7120/cpuapp diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index d789b0e52882..e61cf2deffbf 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -17,6 +17,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SYSTEM_CLOCK_WAIT_FOR_STABILITY=y @@ -35,6 +36,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SYSTEM_CLOCK_WAIT_FOR_AVAILABILITY=y @@ -53,6 +55,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -70,6 +73,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -87,6 +91,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -104,6 +109,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -121,6 +127,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -138,6 +145,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -155,6 +163,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c b/tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c index 377cbc0c6d6a..18e7ade22d80 100644 --- a/tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c +++ b/tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c @@ -14,7 +14,7 @@ LOG_MODULE_REGISTER(test); #define TEST_TIME_MS 10000 -#ifdef CONFIG_SOC_SERIES_NRF54L +#if defined(CONFIG_SOC_SERIES_NRF54L) || defined(CONFIG_SOC_SERIES_NRF71) #define HF_STARTUP_TIME_US 600 #else #define HF_STARTUP_TIME_US 400 diff --git a/tests/drivers/clock_control/nrf_onoff_and_bt/testcase.yaml b/tests/drivers/clock_control/nrf_onoff_and_bt/testcase.yaml index b489bd4c8b6b..d4ece55e8da2 100644 --- a/tests/drivers/clock_control/nrf_onoff_and_bt/testcase.yaml +++ b/tests/drivers/clock_control/nrf_onoff_and_bt/testcase.yaml @@ -8,5 +8,7 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index 4c50ba3c3ade..84bb601a8d13 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -10,6 +10,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp integration_platforms: From ed0b2df1d0cac475884b44761b9584f5576692eb Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:23:23 +0000 Subject: [PATCH 1922/3334] [nrf fromtree] tests: drivers: comparator: gpio_loopback: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 382dce3f12ac900043490247e1ea95624162b499) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 25 +++++++++++++++++++ .../socs/nrf7120_cpuapp_nrf_comp.overlay | 18 +++++++++++++ .../socs/nrf7120_cpuapp_nrf_lpcomp.overlay | 14 +++++++++++ .../comparator/gpio_loopback/testcase.yaml | 2 ++ 4 files changed, 59 insertions(+) create mode 100644 tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_comp.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..4ef6daeced9b --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/* + * P0.03 looped back to P0.00 + */ + +/ { + aliases { + test-comp = ∁ + }; + + zephyr,user { + test-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio0 { + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_comp.overlay new file mode 100644 index 000000000000..c7e7c3c9baa7 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_comp.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&comp { + main-mode = "SE"; + psel = ; /* P0.00 */ + refsel = "INT_1V2"; + sp-mode = "HIGH"; + th-up = <63>; + th-down = <59>; + isource = "DISABLED"; + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_lpcomp.overlay new file mode 100644 index 000000000000..0e1021666d96 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_lpcomp.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&comp { + compatible = "nordic,nrf-lpcomp"; + psel = ; /* P0.00 */ + refsel = "VDD_4_8"; + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index a628911ec904..156c446cf3e6 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -30,6 +30,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: extra_args: @@ -40,6 +41,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.stm32_comp: platform_allow: From 77155b3791099728e391afb898081564d01f5c1d Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:24:52 +0000 Subject: [PATCH 1923/3334] [nrf fromtree] tests: drivers: counter: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 1da6c4443c6cd29bdcdb49d5f6a13a2249fac96d) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..0b454e822e3c --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&timer00 { + prescaler = <6>; + status = "okay"; +}; + +&timer10 { + prescaler = <4>; + status = "okay"; +}; + +&timer20 { + prescaler = <4>; + status = "okay"; +}; + +&timer21 { + prescaler = <4>; + status = "okay"; +}; + +&timer22 { + prescaler = <4>; + status = "okay"; +}; + +&timer23 { + prescaler = <4>; + status = "okay"; +}; + +&timer24 { + prescaler = <4>; + status = "okay"; +}; From a6f3339a2a1316674e19acc6418f358c5c8435d7 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:26:50 +0000 Subject: [PATCH 1924/3334] [nrf fromtree] tests: drivers: gpio: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit f3d2b079473ee06be56190094bb7d775fe42c186) --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 1 + .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 21 +++++++++++++++++++ .../boards/nrf7120dk_nrf7120_cpuflpr .overlay | 7 +++++++ .../nrf7120dk_nrf7120_cpuflpr_xip.overlay | 7 +++++++ tests/drivers/gpio/gpio_hogs/testcase.yaml | 1 + 5 files changed, 37 insertions(+) create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.conf create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr .overlay create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr_xip.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..b9d02cf11d5d --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_SKIP_PULL_TEST=y diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..048a7039fecd --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + resources { + compatible = "test-gpio-basic-api"; + out-gpios = <&gpio1 12 0>; + in-gpios = <&gpio1 11 0>; + }; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr .overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr .overlay new file mode 100644 index 000000000000..e2649a103542 --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr .overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr_xip.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr_xip.overlay new file mode 100644 index 000000000000..e2649a103542 --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr_xip.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/gpio/gpio_hogs/testcase.yaml b/tests/drivers/gpio/gpio_hogs/testcase.yaml index 43b01894f5fb..07a4f13d9a37 100644 --- a/tests/drivers/gpio/gpio_hogs/testcase.yaml +++ b/tests/drivers/gpio/gpio_hogs/testcase.yaml @@ -12,6 +12,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr + - nrf7120dk/nrf7120/cpuapp - nucleo_g474re - nrf52_bsim - nrf5340bsim/nrf5340/cpuapp From d329dd94c98ef74f92cd8893da6851642521f1be Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:27:19 +0000 Subject: [PATCH 1925/3334] [nrf fromtree] tests: drivers: i2c: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 21355893c83fa67ece60891b6e9b75d35e99e345) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 68 +++++++++++++++++ tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml | 2 + .../boards/nrf7120dk_nrf7120_cpuapp.conf | 4 + .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 74 +++++++++++++++++++ .../drivers/i2c/i2c_target_api/testcase.yaml | 1 + 5 files changed, 149 insertions(+) create mode 100644 tests/drivers/i2c/i2c_nrfx_twim/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.conf create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..6008121850db --- /dev/null +++ b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P1.8 and P1.9 + * SCL = P1.2 and P1.3 + */ + +/ { + aliases { + i2c-controller = &i2c21; + i2c-controller-target = &i2c22; + }; +}; + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default: i2c22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep: i2c22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c22_default>; + pinctrl-1 = <&i2c22_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; +}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml index 42d1d98f3af8..21cc44aa5369 100644 --- a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml +++ b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml @@ -15,6 +15,8 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..c0b19426141a --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..e1d445b11f4e --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P1.8 and P1.9 + * SCL = P1.2 and P1.3 + */ + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default: i2c22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep: i2c22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; + + eeprom1: eeprom@56 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x56>; + address-width = <8>; + size = <256>; + }; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c22_default>; + pinctrl-1 = <&i2c22_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; + + eeprom0: eeprom@54 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x54>; + address-width = <8>; + size = <256>; + }; +}; diff --git a/tests/drivers/i2c/i2c_target_api/testcase.yaml b/tests/drivers/i2c/i2c_target_api/testcase.yaml index 0ac4cc223cd9..c8c34853d842 100644 --- a/tests/drivers/i2c/i2c_target_api/testcase.yaml +++ b/tests/drivers/i2c/i2c_target_api/testcase.yaml @@ -73,6 +73,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - s32k5xxcvb/s32k566/m7 - s32k5xxcvb/s32k566/r52 From 9f303f78f909db8c96d63855a0423e06f5e6420f Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:27:41 +0000 Subject: [PATCH 1926/3334] [nrf fromtree] tests: drivers: i2s: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 7fb2733cd0b7467dc7bc07830fa418640e3e5ce9) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 31 +++++++++++++++++++ .../drivers/i2s/i2s_additional/testcase.yaml | 2 ++ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 31 +++++++++++++++++++ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 31 +++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..e0cd7f9e4337 --- /dev/null +++ b/tests/drivers/i2s/i2s_additional/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , /* TDM_SDOUT shorted to TDM_SDIN */ + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; + sck-clock-source = "ACLK"; +}; diff --git a/tests/drivers/i2s/i2s_additional/testcase.yaml b/tests/drivers/i2s/i2s_additional/testcase.yaml index 77a18c3ab9d3..9b521728ccc6 100644 --- a/tests/drivers/i2s/i2s_additional/testcase.yaml +++ b/tests/drivers/i2s/i2s_additional/testcase.yaml @@ -17,11 +17,13 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp drivers.i2s.additional.gpio_loopback.54h: harness_config: diff --git a/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..8cee43a64b57 --- /dev/null +++ b/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , /* TDM_SDOUT shorted to TDM_SDIN */ + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; + sck-clock-source = "ACLK"; +}; diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..e0cd7f9e4337 --- /dev/null +++ b/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , /* TDM_SDOUT shorted to TDM_SDIN */ + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; + sck-clock-source = "ACLK"; +}; From 7b8c092c1bf3cbfceea550aae83d525d1314b0c0 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:29:06 +0000 Subject: [PATCH 1927/3334] [nrf fromtree] tests: drivers: pwm: pwm_gpio_lookback Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 5ff66dcf25c01fb49da84bcec9c3a7f5c856e11a) --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 1 + .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 44 +++++++++++++++++++ .../pwm/pwm_gpio_loopback/testcase.yaml | 1 + 3 files changed, 46 insertions(+) create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..795414a504ab --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_SKIP_EDGE_NUM=4 diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..03f9b1eb18e0 --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires wire connection between: + * - PWM22 OUT[0] at P1.14 <-> GPIO input at P1.00 + * - PWM22 OUT[1] at P1.02 <-> GPIO input at P1.03 + */ + +/ { + zephyr,user { + pwms = <&pwm22 0 160000 PWM_POLARITY_NORMAL>, + <&pwm22 1 160000 PWM_POLARITY_NORMAL>; + + gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>, + <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; +}; + +&pinctrl { + pwm22_alt: pwm22_alt { + group1 { + psels = , + ; + }; + }; + + pwm22_alt_sleep: pwm22_alt_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&pwm22 { + pinctrl-0 = <&pwm22_alt>; + pinctrl-1 = <&pwm22_alt_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; +}; diff --git a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml index ce1ebe94d562..347e0e9f9772 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml @@ -22,6 +22,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.pwm.gpio_loopback.silabs: From 139d55ce34c6d9a2939d09cd6ce3a43dff50e12b Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 9 Feb 2026 17:33:30 +0000 Subject: [PATCH 1928/3334] [nrf fromtree] tests: drivers: spi: Add support for nRF7120 After porting nRF7120 to Zephyr, all tests that were supported in sdk-nrf must now be supported in Zephyr instead. Signed-off-by: Robert Robinson (cherry picked from commit 06df0e6a0b3c9f25badba01f1057b1bec1ad04e5) --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 74 +++++++++++++++++++ .../spi_controller_peripheral/testcase.yaml | 6 ++ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 73 ++++++++++++++++++ .../drivers/spi/spi_error_cases/testcase.yaml | 1 + .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 55 ++++++++++++++ tests/drivers/spi/spi_loopback/testcase.yaml | 4 + 6 files changed, 213 insertions(+) create mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/spi/spi_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay create mode 100644 tests/drivers/spi/spi_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..8e9d6ce4c265 --- /dev/null +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + spi22_default_alt: spi22_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi22_sleep_alt: spi22_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + spi21_default_alt: spi21_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spi21_sleep_alt: spi21_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&spi22 { + status = "okay"; + pinctrl-0 = <&spi22_default_alt>; + pinctrl-1 = <&spi22_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + zephyr,pm-device-runtime-auto; + + dut_spi_dt: test-spi-dev@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +dut_spis: &spi21 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spi21_default_alt>; + pinctrl-1 = <&spi21_sleep_alt>; + pinctrl-names = "default", "sleep"; + /delete-property/ rx-delay-supported; + /delete-property/ rx-delay; +}; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 3fa4cb16db6b..69d62b09042a 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -14,6 +14,7 @@ common: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp tests: @@ -52,6 +53,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf7120dk/nrf7120/cpuapp drivers.spi.spi_2M666666Hz: extra_configs: @@ -60,6 +62,7 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp + - nrf7120dk/nrf7120/cpuapp drivers.spi.spi_4MHz: extra_configs: @@ -84,6 +87,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.spis_fast: @@ -98,6 +102,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.pm_runtime: @@ -121,6 +126,7 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - ophelia4ev/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp drivers.spi.direct_xfer: extra_configs: diff --git a/tests/drivers/spi/spi_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/spi/spi_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..83ef5cc609d2 --- /dev/null +++ b/tests/drivers/spi/spi_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + spi22_default_alt: spi22_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi22_sleep_alt: spi22_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + spi21_default_alt: spi21_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spi21_sleep_alt: spi21_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&spi22 { + status = "okay"; + pinctrl-0 = <&spi22_default_alt>; + pinctrl-1 = <&spi22_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; + + dut_spi_dt: test-spi-dev@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = <4000000>; + }; +}; + +dut_spis: &spi21 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spi21_default_alt>; + pinctrl-1 = <&spi21_sleep_alt>; + pinctrl-names = "default", "sleep"; + /delete-property/ rx-delay-supported; + /delete-property/ rx-delay; +}; diff --git a/tests/drivers/spi/spi_error_cases/testcase.yaml b/tests/drivers/spi/spi_error_cases/testcase.yaml index eb3f4c78c580..6e4aa26a79f7 100644 --- a/tests/drivers/spi/spi_error_cases/testcase.yaml +++ b/tests/drivers/spi/spi_error_cases/testcase.yaml @@ -16,6 +16,7 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/spi/spi_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay new file mode 100644 index 000000000000..a614330abcf8 --- /dev/null +++ b/tests/drivers/spi/spi_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Test requires following loopback: + * P1.11 - P1.12 + */ + +&pinctrl { + spi21_default: spi21_default { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + spi21_sleep: spi21_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +&spi21 { + status = "okay"; + pinctrl-0 = <&spi21_default>; + pinctrl-1 = <&spi21_sleep>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + zephyr,pm-device-runtime-auto; + + slow@0 { + compatible = "test-spi-loopback-slow"; + reg = <0>; + spi-max-frequency = ; + }; + + dut_fast: fast@0 { + compatible = "test-spi-loopback-fast"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +&gpio2 { + status = "okay"; +}; diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index 55e47bbc7340..cf589c48fcab 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -284,6 +284,7 @@ tests: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_1mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp harness: console harness_config: fixture: spi_loopback @@ -295,16 +296,19 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_16mhz: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_16mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_32mhz: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_32mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54lm20_16mhz_32mhz: harness: ztest From 5d1aff98716147f02e0e28c5bc541ba321f71310 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Fri, 20 Feb 2026 14:58:36 +0100 Subject: [PATCH 1929/3334] [nrf fromtree] net: lib: ftp_client: Add FTP client library Add FTP client library, based on the FTP client library from nRF Connect SDK. Signed-off-by: Robert Lubos (cherry picked from commit 991ea36f70edcb7127755024c68ca922e9c22105) --- .../networking/api/ftp_client.rst | 39 + doc/connectivity/networking/api/protocols.rst | 1 + include/zephyr/net/ftp_client.h | 486 +++++++ subsys/net/lib/CMakeLists.txt | 1 + subsys/net/lib/Kconfig | 2 + subsys/net/lib/ftp/CMakeLists.txt | 7 + subsys/net/lib/ftp/Kconfig | 44 + subsys/net/lib/ftp/ftp_client.c | 1294 +++++++++++++++++ subsys/net/lib/ftp/ftp_commands.h | 105 ++ 9 files changed, 1979 insertions(+) create mode 100644 doc/connectivity/networking/api/ftp_client.rst create mode 100644 include/zephyr/net/ftp_client.h create mode 100644 subsys/net/lib/ftp/CMakeLists.txt create mode 100644 subsys/net/lib/ftp/Kconfig create mode 100644 subsys/net/lib/ftp/ftp_client.c create mode 100644 subsys/net/lib/ftp/ftp_commands.h diff --git a/doc/connectivity/networking/api/ftp_client.rst b/doc/connectivity/networking/api/ftp_client.rst new file mode 100644 index 000000000000..a56d065b385c --- /dev/null +++ b/doc/connectivity/networking/api/ftp_client.rst @@ -0,0 +1,39 @@ +.. _ftp_client_interface: + +FTP client +########## + +.. contents:: + :local: + :depth: 2 + +Overview +******** + +The FTP client library can be used to download or upload files to FTP server. + +The FTP client library reports FTP control message and download data with two separate callback +functions :c:member:`ftp_client.ctrl_callback` and :c:member:`ftp_client.data_callback`. +The library can be configured to automatically send KEEPALIVE message to the server through a timer +if :kconfig:option:`CONFIG_FTP_CLIENT_KEEPALIVE_TIME` is not zero. +The KEEPALIVE message is sent periodically at the completion of the time interval indicated by the +value of :kconfig:option:`CONFIG_FTP_CLIENT_KEEPALIVE_TIME`. + +Protocols +********* + +The library is implemented in accordance with the :rfc:`959` specification. + +Limitations +*********** + +The library implements only a minimal set of commands as of now. +However, new command support can be easily added. + +Due to the differences in the implementation of FTP servers, the library might need customization +to work with a specific server. + +API Reference +************* + +.. doxygengroup:: ftp_client diff --git a/doc/connectivity/networking/api/protocols.rst b/doc/connectivity/networking/api/protocols.rst index 2714ba881268..9080e83bab5b 100644 --- a/doc/connectivity/networking/api/protocols.rst +++ b/doc/connectivity/networking/api/protocols.rst @@ -10,6 +10,7 @@ Protocols coap coap_client coap_server + ftp_client http_client http_server lwm2m diff --git a/include/zephyr/net/ftp_client.h b/include/zephyr/net/ftp_client.h new file mode 100644 index 000000000000..c614761c310e --- /dev/null +++ b/include/zephyr/net/ftp_client.h @@ -0,0 +1,486 @@ +/* + * Copyright (c) 2020-2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** @file + * @brief FTP client library + */ + +#ifndef ZEPHYR_INCLUDE_NET_FTP_CLIENT_H_ +#define ZEPHYR_INCLUDE_NET_FTP_CLIENT_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** @file + * @brief FTP client library + * @details Provide selected FTP client functionality + * @defgroup ftp_client FTP client library API + * @since 4.4 + * @version 0.1.0 + * @ingroup networking + * @{ + */ + +/** @cond INTERNAL_HIDDEN */ +#if defined(CONFIG_FTP_CLIENT) +#define FTP_BUFFER_SIZE CONFIG_FTP_CLIENT_BUF_SIZE +#else +#define FTP_BUFFER_SIZE 1 +#endif +/** @endcond */ + +/** + * @brief List of FTP server reply codes + * Reference RFC959 FTP Transfer Protocol + */ +enum ftp_reply_code { + /* 100 Series The requested action is being initiated, expect another + * reply before proceeding with a new command + */ + + /** Restart marker replay. In this case, the text is exact and not left + * to the particular implementation; it must read: MARK yyyy = mmmm + * where yyyy is User-process data stream marker, and mmmm server's + * equivalent marker (note the spaces between markers and "=") + */ + FTP_CODE_110_RESTART_MARKER_REPLAY = 110, + /** Service ready in nnn minutes */ + FTP_CODE_120_SERVICE_READY_IN_NNN_MINUTES = 120, + /** Data connection already open; transfer starting */ + FTP_CODE_125_DATA_CONN_ALREADY_OPEN = 125, + /** File status okay; about to open data connection */ + FTP_CODE_150_FILE_STATUS_OK = 150, + + /* 200 Series The requested action has been successfully completed */ + + /** Command OK*/ + FTP_CODE_200_OK = 200, + /** Command not implemented, superfluous at this site */ + FTP_CODE_202_NOT_IMPLEMENTED = 202, + /** System status, or system help reply */ + FTP_CODE_211_SYSTEM_STATUS = 211, + /** Directory status */ + FTP_CODE_212_DIR_STATUS = 212, + /** File status*/ + FTP_CODE_213_FILE_STATUS = 213, + /** Help message. Explains how to use the server or the meaning of a + * particular non-standard command. This reply is useful only to the + * human user + */ + FTP_CODE_214_HELP_MSG = 214, + /** NAME system type. Where NAME is an official system name from the + * registry kept by IANA. + */ + FTP_CODE_215_NAME_SYSTEM_TYPE = 215, + /** Service ready for new user */ + FTP_CODE_220_SERVICE_READY = 220, + /** Service closing control connection */ + FTP_CODE_221_SERVICE_CLOSING_CONN = 221, + /** Data connection open; no transfer in progress */ + FTP_CODE_225_DATA_CONN_OPEN = 225, + /** Closing data connection. Requested file action successful (for + * example, file transfer or file abort) + */ + FTP_CODE_226_CLOSING_DATA_CONN_SUCCESS = 226, + /** Entering Passive Mode (h1,h2,h3,h4,p1,p2) */ + FTP_CODE_227_ENTERING_PASSIVE_MODE = 227, + /** Entering Long Passive Mode (long address, port) */ + FTP_CODE_228_ENTERING_LONG_PASSIVE_MODE = 228, + /** Entering Extended Passive Mode (|||port|) */ + FTP_CODE_229_ENTERING_EXT_PASSIVE_MODE = 229, + /** User logged in, proceed. Logged out if appropriate */ + FTP_CODE_230_USER_LOGGED_IN = 230, + /** User logged out; service terminated */ + FTP_CODE_231_USER_LOGGED_OUT = 231, + /** Logout command noted, will complete when transfer done */ + FTP_CODE_233_LOGOUT_COMMAND_NOTED = 233, + /** Specifies that the server accepts the authentication mechanism + * specified by the client, and the exchange of security data is + * complete. A higher level nonstandard code created by Microsoft + */ + FTP_CODE_234_SECURITY_ACCEPTED = 234, + /** Requested file action okay, completed */ + FTP_CODE_250_FILE_ACTION_COMPLETED = 250, + /** "PATHNAME" created */ + FTP_CODE_257_PATHNAME_CREATED = 257, + + /* 300 Series The command has been accepted, but the requested action + *is on hold, pending receipt of further information + */ + + /** User name okay, need password */ + FTP_CODE_331_USERNAME_OK_NEED_PASSWORD = 331, + /** Need account for login */ + FTP_CODE_332_NEED_ACCOUNT = 332, + /** Requested file action pending further information */ + FTP_CODE_350_FILE_ACTION_PENDING = 350, + + /* 400 Series The command was not accepted and the requested action + * did not take place, but the error condition is temporary and the + * action may be requested again + */ + + /** Service not available, closing control connection. This may be a + * reply to any command if the service knows it must shut down + */ + FTP_CODE_421_SERVICE_UNAVAILABLE = 421, + /** Cannot open data connection */ + FTP_CODE_425_CANNOT_OPEN_DATA_CONN = 425, + /** Connection closed; transfer aborted */ + FTP_CODE_426_CONN_CLOSED = 426, + /** Invalid username or password */ + FTP_CODE_430_INVALID_USERNAME_OR_PASSWORD = 430, + /** Requested host unavailable */ + FTP_CODE_434_HOST_UNAVAILABLE = 434, + /** Requested file action not taken */ + FTP_CODE_450_FILE_ACTION_NOT_TAKEN = 450, + /** Requested action aborted. Local error in processing */ + FTP_CODE_451_ACTION_ABORTED = 451, + /** Requested action not taken. Insufficient storage space in system. + * File unavailable (for example, file busy) + */ + FTP_CODE_452_ACTION_NOT_TAKEN = 452, + + /* 500 Series Syntax error, command unrecognized and the requested + * action did not take place. This may include errors such as command + * line too long + */ + + /** General error */ + FTP_CODE_500_GENERAL_ERROR = 500, + /** Syntax error in parameters or arguments */ + FTP_CODE_501_SYNTAX_ERROR = 501, + /** Command not implemented */ + FTP_CODE_502_COMMAND_NOT_COMPLETED = 502, + /** Bad sequence of commands */ + FTP_CODE_503_BAD_SEQUENCE_OF_COMMANDS = 503, + /** Command not implemented for that parameter */ + FTP_CODE_504_COMMAND_NOT_IMPLEMENTED = 504, + /** Not logged in */ + FTP_CODE_530_NOT_LOGGED_IN = 530, + /** Need account for storing files */ + FTP_CODE_532_NEED_ACCOUNT = 532, + /** Could Not Connect to Server - Policy Requires SSL */ + FTP_CODE_534_CANNOT_CONNECT_SSL_REQUIRED = 534, + /** Requested action not taken. File unavailable (for example, file not + * found, no access) + */ + FTP_CODE_550_FILE_UNAVAILABLE = 550, + /** Requested action aborted. Page type unknown */ + FTP_CODE_551_PAGE_TYPE_UNKNOWN = 551, + /** Requested file action aborted. Exceeded storage allocation (for + * current directory or dataset) + */ + FTP_CODE_552_FILE_EXCEEDED_STORAGE_LOCATION = 552, + /** Requested action not taken. File name not allowed */ + FTP_CODE_553_FILE_NAME_NOT_ALLOWED = 553, + + /* Replies regarding confidentiality and integrity */ + + /** Integrity protected reply */ + FTP_CODE_631_INTEGRITY_PROTECTED_REPLY = 631, + /** Confidentiality and integrity protected reply */ + FTP_CODE_632_INT_AND_CONF_PROTECTED_REPLY = 632, + /** Confidentiality protected reply */ + FTP_CODE_633_CONFIDENTIALITY_PROTECTED_REPLY = 633, + + /* Proprietary reply codes */ + + /** DUMMY */ + FTP_CODE_900_UNKNOWN_ERROR = 900, + + /** Fatal errors */ + /** Disconnected by remote server */ + FTP_CODE_901_DISCONNECTED_BY_REMOTE = 901, + /** Connection aborted */ + FTP_CODE_902_CONNECTION_ABORTED = 902, + /** Socket poll error */ + FTP_CODE_903_SOCKET_POLL_ERROR = 903, + /** Unexpected poll event */ + FTP_CODE_904_UNEXPECTED_POLL_EVENT = 904, + /** Network down */ + FTP_CODE_905_NETWORK_DOWN = 905, + /** Unexpected error */ + FTP_CODE_909_UNEXPECTED_ERROR = 909, + + /* Non-fatal errors */ + /** Data transfer timeout */ + FTP_CODE_910_DATA_TRANSFER_TIMEOUT = 910, + + /* 10000 Series Common Winsock Error Codes[2] (These are not FTP + * return codes) + */ + + /** Connection reset by peer. The connection was forcibly closed by the + * remote host + */ + FTP_CODE_10054_CONNECTION_RESET_BY_PEER = 10054, + /** Cannot connect to remote server */ + FTP_CODE_10060_CANNOT_CONNECT = 10060, + /** Cannot connect to remote server. The connection is actively refused + * by the server + */ + FTP_CODE_10061_CONNECTION_REFUSED = 10061, + /** Directory not empty */ + FTP_CODE_10066_DIRECTORY_NOT_EMPTY = 10066, + /** Too many users, server is full */ + FTP_CODE_10068_TOO_MANY_USERS = 10068 +}; + +/** @cond INTERNAL_HIDDEN */ +#define FTP_PRELIMINARY_POS(code) ((code) >= 100 && (code) < 200) +#define FTP_COMPLETION_POS(code) ((code) >= 200 && (code) < 300) +#define FTP_INTERMEDIATE_POS(code) ((code) >= 300 && (code) < 400) +#define FTP_TRANSIENT_NEG(code) ((code) >= 400 && (code) < 500) +#define FTP_COMPLETION_NEG(code) ((code) >= 500 && (code) < 600) +#define FTP_PROTECTED(code) ((code) >= 600 && (code) < 700) +#define FTP_PROPRIETARY(code) ((code) >= 900 && (code) < 1000) +#define FTP_WINSOCK_ERR(code) ((code) >= 10000) +/** @endcond */ + +/** FTP transfer mode. */ +enum ftp_transfer_type { + FTP_TYPE_ASCII, /**< ASCII transfer */ + FTP_TYPE_BINARY, /**< Binary transfer */ +}; + +/** FTP file write mode. */ +enum ftp_put_type { + FTP_PUT_NORMAL, /**< Overwrite a file */ + FTP_PUT_UNIQUE, /**< Write to a file with a unique file name */ + FTP_PUT_APPEND, /**< Append a file */ +}; + +/** + * @brief FTP asynchronous callback function. + * + * @param msg FTP client data received, or local message + * @param len length of message + */ +typedef void (*ftp_client_callback_t)(const uint8_t *msg, uint16_t len); + +/** FTP client context. */ +struct ftp_client { + struct net_sockaddr remote; /**< Server address */ + bool connected; /**< Server connected flag */ + int ctrl_sock; /**< Control socket */ + int data_sock; /**< Data socket */ + int sec_tag; /**< Secure tag */ + uint8_t ctrl_buf[FTP_BUFFER_SIZE]; /**< Control buffer */ + size_t ctrl_len; /**< Length of data in the control buffer */ + uint8_t data_buf[FTP_BUFFER_SIZE]; /**< Data buffer */ + ftp_client_callback_t ctrl_callback; /**< Control callback */ + ftp_client_callback_t data_callback; /**< Data callback */ + /** @cond INTERNAL_HIDDEN */ + struct k_mutex lock; + struct k_work_delayable keepalive_work; + /** @endcond */ +}; + +/**@brief Initialize the FTP client context. + * + * @param client FTP client context + * @param ctrl_callback Callback for FTP command result. + * @param data_callback Callback for FTP received data. + * + * @return 0 on success. A negative errno code in case of a failure. + */ +int ftp_init(struct ftp_client *client, ftp_client_callback_t ctrl_callback, + ftp_client_callback_t data_callback); + +/**@brief Uninitialize the FTP client context. + * + * @param client FTP client context + * + * @return 0 on success. A negative errno code in case of a failure. + */ +int ftp_uninit(struct ftp_client *client); + +/**@brief Open FTP connection. + * + * @param client FTP client context + * @param hostname FTP server name or IP address + * @param port FTP service port on server + * @param sec_tag If FTP over TLS is required (-1 means no TLS) + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_open(struct ftp_client *client, const char *hostname, uint16_t port, + int sec_tag); + +/**@brief FTP server login. + * + * @param client FTP client context + * @param username user name + * @param password The password + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_login(struct ftp_client *client, const char *username, + const char *password); + +/**@brief Close FTP connection. + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_close(struct ftp_client *client); + +/**@brief Get FTP server and connection status + * Also returns server system type + * + * @param client FTP client context + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_status(struct ftp_client *client); + +/**@brief Set FTP transfer type + * + * @param client FTP client context + * @param type transfer type + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_type(struct ftp_client *client, enum ftp_transfer_type type); + +/**@brief Print working directory + * + * @param client FTP client context + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_pwd(struct ftp_client *client); + +/**@brief List information of folder or file + * + * @param client FTP client context + * @param options List options, refer to Linux "man ls" + * @param target file or directory to list. If not specified, list current folder + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_list(struct ftp_client *client, const char *options, const char *target); + +/**@brief Change working directory + * + * @param client FTP client context + * @param folder Target folder + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_cwd(struct ftp_client *client, const char *folder); + +/**@brief Make directory + * + * @param client FTP client context + * @param folder New folder name + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_mkd(struct ftp_client *client, const char *folder); + +/**@brief Remove directory + * + * @param client FTP client context + * @param folder Target folder name + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_rmd(struct ftp_client *client, const char *folder); + +/**@brief Rename a file + * + * @param client FTP client context + * @param old_name Old file name + * @param new_name New file name + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_rename(struct ftp_client *client, const char *old_name, + const char *new_name); + +/**@brief Delete a file + * + * @param client FTP client context + * @param file Target file name + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_delete(struct ftp_client *client, const char *file); + +/**@brief Get a file + * + * @param client FTP client context + * @param file Target file name + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_get(struct ftp_client *client, const char *file); + +/**@brief Put data to a file + * If file does not exist, create the file + * + * @param client FTP client context + * @param file Target file name + * @param data Data to be stored + * @param length Length of data to be stored + * @param type specify FTP put types, see enum ftp_reply_code + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_put(struct ftp_client *client, const char *file, const uint8_t *data, + uint16_t length, int type); + +/**@brief Exchange keep-alive commands with the server. + * + * @param client FTP client context + * + * @return 0 on success. + * A negative errno code in case of a failure. + * A positive FTP status code in case of an unexpected server response. + */ +int ftp_keepalive(struct ftp_client *client); + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_NET_FTP_CLIENT_H_ */ + +/**@} */ diff --git a/subsys/net/lib/CMakeLists.txt b/subsys/net/lib/CMakeLists.txt index 60a448147eb9..1832a21ce314 100644 --- a/subsys/net/lib/CMakeLists.txt +++ b/subsys/net/lib/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory(utils) add_subdirectory_ifdef(CONFIG_COAP coap) +add_subdirectory_ifdef(CONFIG_FTP_CLIENT ftp) add_subdirectory_ifdef(CONFIG_LWM2M lwm2m) add_subdirectory_ifdef(CONFIG_SOCKS socks) add_subdirectory_ifdef(CONFIG_SNTP sntp) diff --git a/subsys/net/lib/Kconfig b/subsys/net/lib/Kconfig index 4249ca650f75..9134b140f87f 100644 --- a/subsys/net/lib/Kconfig +++ b/subsys/net/lib/Kconfig @@ -7,6 +7,8 @@ source "subsys/net/lib/coap/Kconfig" source "subsys/net/lib/dns/Kconfig" +source "subsys/net/lib/ftp/Kconfig" + source "subsys/net/lib/latmon/Kconfig" source "subsys/net/lib/midi2/Kconfig" diff --git a/subsys/net/lib/ftp/CMakeLists.txt b/subsys/net/lib/ftp/CMakeLists.txt new file mode 100644 index 000000000000..b8212357f804 --- /dev/null +++ b/subsys/net/lib/ftp/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (c) 2020-2026 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# +zephyr_library() +zephyr_library_sources(ftp_client.c) diff --git a/subsys/net/lib/ftp/Kconfig b/subsys/net/lib/ftp/Kconfig new file mode 100644 index 000000000000..2294318dca2c --- /dev/null +++ b/subsys/net/lib/ftp/Kconfig @@ -0,0 +1,44 @@ +# +# Copyright (c) 2020-2026 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +menuconfig FTP_CLIENT + bool "FTP client [EXPERIMENTAL]" + depends on NET_TCP + depends on NET_SOCKETS + select EXPERIMENTAL + help + Enable FTP client library compliant with RFC959 File Transfer Protocol. + +if FTP_CLIENT + +config FTP_CLIENT_KEEPALIVE_TIME + int "Keep-alive time in seconds after connection" + range 0 $(UINT32_MAX) + default 60 + help + Define the automatic keep-alive time (in seconds) for the FTP client. + Set to 0 to disable automatic keep-alive (which allows to save + resources needed for the dedicated work queue). If disabled, it's + still possible to perform keep-alive exchanges from the application + level with ftp_keepalive() function. + +config FTP_CLIENT_LISTEN_TIME + int "Poll time in seconds in receiving FTP message" + default 10 + help + Define the wait time for receiving. + +config FTP_CLIENT_BUF_SIZE + int "Buffer size used by FTP client" + range 128 $(UINT16_MAX) + default 1024 + +module=FTP_CLIENT +module-dep=LOG +module-str=FTP client +source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" + +endif # FTP_CLIENT diff --git a/subsys/net/lib/ftp/ftp_client.c b/subsys/net/lib/ftp/ftp_client.c new file mode 100644 index 000000000000..ec4044341ffd --- /dev/null +++ b/subsys/net/lib/ftp/ftp_client.c @@ -0,0 +1,1294 @@ +/* + * Copyright (c) 2020-2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ftp_commands.h" + +LOG_MODULE_REGISTER(ftp_client, CONFIG_FTP_CLIENT_LOG_LEVEL); + +#define INVALID_SOCKET -1 +#define FTP_CLIENT_POLL_TIMEOUT_MSEC (MSEC_PER_SEC * CONFIG_FTP_CLIENT_LISTEN_TIME) +#define FTP_CODE_ANY 0 + +/* FTP parameter length limits */ +#define FTP_MAX_USERNAME 64 /* Unix/Linux username typical limit */ +#define FTP_MAX_PASSWORD 255 /* Allow longer passwords */ +#define FTP_MAX_FILENAME 255 /* Filename length limit */ +#define FTP_MAX_PATHNAME 255 /* Standard NAME_MAX */ +#define FTP_MAX_OPTIONS 32 /* FTP LIST options are typically short */ + +#if CONFIG_FTP_CLIENT_KEEPALIVE_TIME > 0 +#define FTP_STACK_SIZE KB(2) +#define FTP_PRIORITY K_LOWEST_APPLICATION_THREAD_PRIO +static K_THREAD_STACK_DEFINE(ftp_stack_area, FTP_STACK_SIZE); + +static struct k_work_q ftp_work_q; +#endif + +enum ftp_channel_type { + FTP_CHANNEL_CTRL, + FTP_CHANNEL_DATA, +}; + +#if CONFIG_FTP_CLIENT_KEEPALIVE_TIME > 0 +static void keepalive_timer_reset(struct ftp_client *client) +{ + k_work_reschedule_for_queue(&ftp_work_q, &client->keepalive_work, + K_SECONDS(CONFIG_FTP_CLIENT_KEEPALIVE_TIME)); +} + +static void keepalive_timer_cancel(struct ftp_client *client) +{ + struct k_work_sync sync; + + k_work_cancel_delayable_sync(&client->keepalive_work, &sync); +} + +static void keepalive_handler(struct k_work *work) +{ + struct k_work_delayable *delayable = k_work_delayable_from_work(work); + struct ftp_client *client = CONTAINER_OF(delayable, struct ftp_client, keepalive_work); + + if (client->ctrl_sock == INVALID_SOCKET) { + return; + } + + (void)ftp_keepalive(client); + + keepalive_timer_reset(client); +} +#else +static void keepalive_timer_reset(struct ftp_client *client) { } +static void keepalive_timer_cancel(struct ftp_client *client) { } +#endif + +static int new_ftp_connection(struct ftp_client *client, enum ftp_channel_type channel, + uint16_t port) +{ + int proto = client->sec_tag <= 0 ? NET_IPPROTO_TCP : NET_IPPROTO_TLS_1_2; + socklen_t addrlen; + int *sock; + int ret; + + if (channel == FTP_CHANNEL_CTRL) { + sock = &client->ctrl_sock; + } else if (channel == FTP_CHANNEL_DATA) { + sock = &client->data_sock; + } else { + return -EINVAL; + } + + *sock = zsock_socket(client->remote.sa_family, NET_SOCK_STREAM, proto); + if (*sock < 0) { + ret = -errno; + LOG_ERR("socket(data) failed: %d", ret); + return ret; + } + if (client->sec_tag != SEC_TAG_TLS_INVALID) { + sec_tag_t sec_tag_list[] = { client->sec_tag }; + + ret = zsock_setsockopt(*sock, ZSOCK_SOL_TLS, ZSOCK_TLS_SEC_TAG_LIST, + sec_tag_list, sizeof(sec_tag_t)); + if (ret < 0) { + ret = -errno; + LOG_ERR("set tag list failed: %d", ret); + zsock_close(*sock); + *sock = INVALID_SOCKET; + return ret; + } + } + + /* Connect to remote host */ + if (client->remote.sa_family == NET_AF_INET) { + net_sin(&client->remote)->sin_port = net_htons(port); + addrlen = sizeof(struct net_sockaddr_in); + } else { + net_sin6(&client->remote)->sin6_port = net_htons(port); + addrlen = sizeof(struct net_sockaddr_in6); + } + + ret = zsock_connect(*sock, &client->remote, addrlen); + if (ret < 0) { + ret = -errno; + LOG_ERR("connect(data) failed: %d", ret); + zsock_close(*sock); + *sock = INVALID_SOCKET; + return ret; + } + + return ret; +} + +static int validate_ftp_param(const char *param, size_t max_len) +{ + if (param == NULL) { + return -EINVAL; + } + + if (strlen(param) > max_len) { + return -EINVAL; + } + + /* Check for FTP command injection - CR/LF can inject additional commands */ + if (strchr(param, '\r') || strchr(param, '\n')) { + return -EINVAL; + } + + return 0; +} + +static int parse_pasv_msg(const char *pasv_msg, uint16_t *data_port) +{ + char *endptr; + long port_byte; + char *tmp1, *tmp2; + + /* Parse Server port from passive message + * e.g. "227 Entering Passive Mode (90,130,70,73,86,111)" in case of IPv4 + * e.g. "227 Entering Passive Mode (0,0,0,0,97,78)" in case of IPv6 + * NOTE assume no IP address change from the Control channel + */ + tmp1 = strrchr(pasv_msg, ')'); + if (tmp1 == NULL) { + return -EINVAL; + } + tmp2 = strrchr(pasv_msg, ','); + if (tmp2 == NULL) { + return -EINVAL; + } + /* Validate that ')' appears after the last ',' */ + if (tmp1 <= tmp2) { + return -EINVAL; + } + + /* Extract low byte of port (p2) */ + port_byte = strtol(tmp2 + 1, &endptr, 10); + if (endptr != tmp1 || port_byte < 0 || port_byte > 255) { + return -EINVAL; + } + *data_port = (uint16_t)port_byte; + + /* Find previous comma for high byte */ + tmp1 = tmp2 - 1; + while (tmp1 > pasv_msg && isdigit((int)(*tmp1))) { + tmp1--; + } + if (tmp1 <= pasv_msg || *tmp1 != ',') { + return -EINVAL; + } + + /* Extract high byte of port (p1) */ + port_byte = strtol(tmp1 + 1, &endptr, 10); + if (endptr != tmp2 || port_byte < 0 || port_byte > 255) { + return -EINVAL; + } + *data_port += (uint16_t)(port_byte << 8); + LOG_DBG("data port: %d", *data_port); + + return 0; +} + +static void close_connection(struct ftp_client *client, int code, int error) +{ + keepalive_timer_cancel(client); + + if (FTP_PROPRIETARY(code) != 0) { + switch (code) { + case FTP_CODE_901_DISCONNECTED_BY_REMOTE: + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + "901 Disconnected(%d).\r\n", error); + break; + case FTP_CODE_902_CONNECTION_ABORTED: + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + "902 Connection aborted(%d).\r\n", error); + break; + case FTP_CODE_903_SOCKET_POLL_ERROR: + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + "903 Poll error(%d).\r\n", error); + break; + case FTP_CODE_904_UNEXPECTED_POLL_EVENT: + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + "904 Unexpected poll event(%d).\r\n", error); + break; + case FTP_CODE_905_NETWORK_DOWN: + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + "905 Network down (%d).\r\n", error); + break; + default: + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + "900 Unknown error(%d).\r\n", -ENOEXEC); + break; + } + client->ctrl_callback(client->ctrl_buf, strlen(client->ctrl_buf)); + } + /* Should be impossible, just in case */ + if (client->data_sock != INVALID_SOCKET) { + zsock_close(client->data_sock); + client->data_sock = INVALID_SOCKET; + } + + if (client->ctrl_sock != INVALID_SOCKET) { + zsock_close(client->ctrl_sock); + client->ctrl_sock = INVALID_SOCKET; + client->connected = false; + client->sec_tag = SEC_TAG_TLS_INVALID; + } +} + +static int do_ftp_send_ctrl(struct ftp_client *client, const uint8_t *message, int length) +{ + int ret = 0; + uint32_t offset = 0; + + LOG_DBG("%s", (char *)message); + while (offset < length) { + ret = zsock_send(client->ctrl_sock, message + offset, length - offset, 0); + if (ret < 0) { + ret = -errno; + LOG_ERR("send cmd failed: %d", ret); + break; + } + offset += ret; + ret = 0; + } + /* Close connection on errors */ + if (ret < 0) { + close_connection(client, ret == -ENETDOWN ? FTP_CODE_905_NETWORK_DOWN : + FTP_CODE_909_UNEXPECTED_ERROR, ret); + } else { + LOG_DBG("CMD sent"); + } + + keepalive_timer_reset(client); + + return ret; +} + +static int handle_ctrl_response(struct ftp_client *client, bool post_result, int success_code) +{ + bool done = false; + int reply_code = 0; + + if (client->ctrl_len > sizeof(client->ctrl_buf) - 1) { + /* Shouldn't happen, but make sure we don't operate out of buffer. */ + return -EINVAL; + } + + while (client->ctrl_len > 0 && !done) { + size_t line_len; + uint8_t backup; + uint8_t *eol; + + /* Make sure buffer is NULL terminated so we can operate as with string. */ + client->ctrl_buf[client->ctrl_len] = 0x00; + + eol = strstr(client->ctrl_buf, "\r\n"); + if (eol == NULL) { + /* No end line detected, need to read more data from the socket. */ + return -EAGAIN; + } + eol += 2; + + line_len = eol - client->ctrl_buf; + + /* Status line starts with a status code followed by space */ + if (line_len >= 4 && isdigit(client->ctrl_buf[0])) { + char *endptr = NULL; + + reply_code = strtol(client->ctrl_buf, &endptr, 10); + /* Strict parsing of "%d ". */ + if (reply_code > 0 && endptr != NULL && *endptr == ' ' && + (reply_code == success_code || reply_code >= 400 || + success_code == FTP_CODE_ANY)) { + /* Stop if got expected code, no specific code was + * expected or received an error response (400+) + */ + done = true; + } + } + + /* Report NULL terminated line. */ + backup = *eol; + *eol = 0x00; + + if (post_result) { + client->ctrl_callback(client->ctrl_buf, line_len); + } + + LOG_DBG("%s", client->ctrl_buf); + + *eol = backup; + + client->ctrl_len -= line_len; + if (client->ctrl_len > 0) { + memmove(client->ctrl_buf, client->ctrl_buf + line_len, client->ctrl_len); + } + } + + return reply_code; +} + +static int recv_ctrl_response(struct ftp_client *client, enum ftp_reply_code *err_code) +{ + struct zsock_pollfd fds[1]; + int ret; + + fds[0].fd = client->ctrl_sock; + fds[0].events = ZSOCK_POLLIN; + + ret = zsock_poll(fds, 1, FTP_CLIENT_POLL_TIMEOUT_MSEC); + if (ret < 0) { + ret = -errno; + *err_code = FTP_CODE_903_SOCKET_POLL_ERROR; + LOG_ERR("poll(ctrl) failed: (%d)", ret); + goto out; + } + + if (ret == 0) { + ret = -ETIMEDOUT; + *err_code = FTP_CODE_903_SOCKET_POLL_ERROR; + LOG_DBG("poll(ctrl) timeout"); + goto out; + } + + if ((fds[0].revents & ZSOCK_POLLHUP) == ZSOCK_POLLHUP) { + ret = -ECONNRESET; + *err_code = FTP_CODE_901_DISCONNECTED_BY_REMOTE; + LOG_ERR("POLLHUP"); + goto out; + } + + if ((fds[0].revents & ZSOCK_POLLIN) != ZSOCK_POLLIN) { + ret = -EIO; + *err_code = FTP_CODE_904_UNEXPECTED_POLL_EVENT; + LOG_ERR("POLL 0x%08x", fds[0].revents); + goto out; + } + + ret = zsock_recv(client->ctrl_sock, client->ctrl_buf + client->ctrl_len, + sizeof(client->ctrl_buf) - client->ctrl_len - 1, 0); + if (ret < 0) { + ret = -errno; + *err_code = ret == -ENETDOWN ? FTP_CODE_905_NETWORK_DOWN : + FTP_CODE_909_UNEXPECTED_ERROR; + LOG_ERR("recv(ctrl) failed: (%d)", ret); + goto out; + } + + if (ret == 0) { + ret = -ECONNRESET; + *err_code = FTP_CODE_901_DISCONNECTED_BY_REMOTE; + LOG_ERR("recv(ctrl) peer closed connection"); + } + +out: + return ret; +} + +static int do_ftp_recv_ctrl(struct ftp_client *client, bool post_result, int success_code) +{ + enum ftp_reply_code err_code = FTP_CODE_500_GENERAL_ERROR; + int ret; + + while (true) { + /* Receive FTP control message */ + ret = recv_ctrl_response(client, &err_code); + if (ret <= 0) { + goto error; + } + + keepalive_timer_reset(client); + + client->ctrl_len += ret; + + ret = handle_ctrl_response(client, post_result, success_code); + if (ret != -EAGAIN) { + break; + } + + if (client->ctrl_len >= sizeof(client->ctrl_buf) - 1) { + ret = -ENOMEM; + err_code = FTP_CODE_909_UNEXPECTED_ERROR; + LOG_ERR("recv(ctrl) buffer full"); + goto error; + } + } + + return ret; + +error: + close_connection(client, err_code, ret); + + return ret; +} + +static int set_passive_mode(struct ftp_client *client, uint16_t *data_port) +{ + int ret; + + ret = do_ftp_send_ctrl(client, CMD_PASV, sizeof(CMD_PASV) - 1); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_227_ENTERING_PASSIVE_MODE); + if (ret != FTP_CODE_227_ENTERING_PASSIVE_MODE) { + goto out; + } + + ret = parse_pasv_msg(client->ctrl_buf, data_port); + if (ret != 0) { + goto out; + } + +out: + return ret; +} + +static int wait_transfer_complete(struct ftp_client *client) +{ + int ret; + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_226_CLOSING_DATA_CONN_SUCCESS); + if (ret == FTP_CODE_226_CLOSING_DATA_CONN_SUCCESS) { + ret = 0; + } + + return ret; +} + +static int do_ftp_send_data(struct ftp_client *client, uint16_t data_port, + const uint8_t *message, uint16_t length) +{ + int ret; + uint32_t offset = 0; + + /* Establish data channel */ + ret = new_ftp_connection(client, FTP_CHANNEL_DATA, data_port); + if (ret < 0) { + return ret; + } + + if (message == NULL || length == 0) { + goto out; + } + + while (offset < length) { + ret = zsock_send(client->data_sock, message + offset, length - offset, 0); + if (ret < 0) { + ret = -errno; + LOG_ERR("send data failed: %d", ret); + break; + } + LOG_DBG("DATA sent %d", ret); + offset += ret; + ret = 0; + } + +out: + zsock_close(client->data_sock); + client->data_sock = INVALID_SOCKET; + + if (ret == 0) { + ret = wait_transfer_complete(client); + } + + keepalive_timer_reset(client); + + return ret; +} + +static int do_ftp_recv_data(struct ftp_client *client, uint16_t data_port) +{ + int ret; + struct zsock_pollfd fds[1]; + + /* Establish data channel */ + ret = new_ftp_connection(client, FTP_CHANNEL_DATA, data_port); + if (ret < 0) { + return ret; + } + + /* Receive FTP data message */ + fds[0].fd = client->data_sock; + fds[0].events = ZSOCK_POLLIN; + do { + ret = zsock_poll(fds, 1, FTP_CLIENT_POLL_TIMEOUT_MSEC); + if (ret < 0) { + ret = -errno; + LOG_ERR("poll(data) failed: (%d)", ret); + break; + } + + if (ret == 0) { + ret = -ETIMEDOUT; + LOG_DBG("poll(data) timeout"); + break; + } + + if ((fds[0].revents & ZSOCK_POLLIN) != ZSOCK_POLLIN) { + LOG_DBG("No more data"); + ret = 0; + break; + } + + ret = zsock_recv(client->data_sock, client->data_buf, + sizeof(client->data_buf), 0); + if (ret < 0) { + ret = -errno; + LOG_ERR("recv(data) failed: (%d)", ret); + break; + } + + if (ret == 0) { + /* Server close connection */ + break; + } + + client->data_callback(client->data_buf, ret); + LOG_DBG("DATA received %d", ret); + } while (true); + + zsock_close(client->data_sock); + client->data_sock = INVALID_SOCKET; + + if (ret == 0) { + ret = wait_transfer_complete(client); + } + + keepalive_timer_reset(client); + + return ret; +} + +int ftp_open(struct ftp_client *client, const char *hostname, uint16_t port, int sec_tag) +{ + int ret; + struct zsock_addrinfo *ai; + + if (client == NULL) { + return -EINVAL; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + if (client->connected) { + LOG_ERR("FTP already connected"); + ret = -EINVAL; + goto out; + } + + /* Resolve the hostname in the preferred IP version .*/ + ret = zsock_getaddrinfo(hostname, NULL, NULL, &ai); + if (ret != 0) { + LOG_ERR("Failed to resolve hostname (\"%s\"): %s", + hostname, zsock_gai_strerror(ret)); + ret = -EHOSTUNREACH; + goto out; + } + + memcpy(&client->remote, ai->ai_addr, ai->ai_addrlen); + zsock_freeaddrinfo(ai); + + client->sec_tag = sec_tag; + + /* open control socket */ + ret = new_ftp_connection(client, FTP_CHANNEL_CTRL, port); + if (ret != 0) { + goto out; + } + + /* Receive server greeting */ + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_220_SERVICE_READY); + if (ret != FTP_CODE_220_SERVICE_READY) { + zsock_close(client->ctrl_sock); + client->ctrl_sock = INVALID_SOCKET; + goto out; + } + + /* Send UTF8 option */ + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_OPTS, "UTF8 ON"); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + zsock_close(client->ctrl_sock); + client->ctrl_sock = INVALID_SOCKET; + goto out; + } + + (void)do_ftp_recv_ctrl(client, true, FTP_CODE_ANY); + + LOG_DBG("FTP opened"); + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_login(struct ftp_client *client, const char *username, const char *password) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + /* Validate inputs */ + ret = validate_ftp_param(username, FTP_MAX_USERNAME); + if (ret != 0) { + return ret; + } + + ret = validate_ftp_param(password, FTP_MAX_PASSWORD); + if (ret != 0) { + return ret; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + /* send username */ + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_USER, username); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_331_USERNAME_OK_NEED_PASSWORD); + if (ret == FTP_CODE_331_USERNAME_OK_NEED_PASSWORD) { + /* send password if requested */ + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_PASS, password); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_230_USER_LOGGED_IN); + } + + if (ret != FTP_CODE_230_USER_LOGGED_IN) { + goto out; + } + + client->connected = true; + ret = 0; + + /* Start keep alive timer */ + keepalive_timer_reset(client); + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_close(struct ftp_client *client) +{ + int ret = 0; + + if (client == NULL) { + return -EINVAL; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + if (client->connected) { + ret = do_ftp_send_ctrl(client, CMD_QUIT, sizeof(CMD_QUIT) - 1); + if (ret != 0) { + goto out; + } + + /* Some FTP servers do not reply QUIT */ + (void)do_ftp_recv_ctrl(client, true, FTP_CODE_221_SERVICE_CLOSING_CONN); + } + + close_connection(client, FTP_CODE_200_OK, 0); + + client->connected = false; + ret = 0; + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_status(struct ftp_client *client) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + /* get server system type */ + ret = do_ftp_send_ctrl(client, CMD_SYST, sizeof(CMD_SYST) - 1); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_215_NAME_SYSTEM_TYPE); + if (ret != FTP_CODE_215_NAME_SYSTEM_TYPE) { + goto out; + } + + /* get server and connection status */ + ret = do_ftp_send_ctrl(client, CMD_STAT, sizeof(CMD_STAT) - 1); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_211_SYSTEM_STATUS); + if (ret != FTP_CODE_211_SYSTEM_STATUS) { + goto out; + } + + ret = 0; + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_type(struct ftp_client *client, enum ftp_transfer_type type) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + if (type == FTP_TYPE_ASCII) { + ret = do_ftp_send_ctrl(client, CMD_TYPE_A, sizeof(CMD_TYPE_A) - 1); + } else if (type == FTP_TYPE_BINARY) { + ret = do_ftp_send_ctrl(client, CMD_TYPE_I, sizeof(CMD_TYPE_I) - 1); + } else { + ret = -EINVAL; + } + + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_200_OK); + if (ret != FTP_CODE_200_OK) { + goto out; + } + + ret = 0; + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_pwd(struct ftp_client *client) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + ret = do_ftp_send_ctrl(client, CMD_PWD, sizeof(CMD_PWD) - 1); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_257_PATHNAME_CREATED); + if (ret != FTP_CODE_257_PATHNAME_CREATED) { + goto out; + } + + ret = 0; + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_list(struct ftp_client *client, const char *options, const char *target) +{ + int ret; + uint16_t data_port; + + if (client == NULL) { + return -EINVAL; + } + + /* Validate inputs */ + ret = validate_ftp_param(options, FTP_MAX_OPTIONS); + if (ret != 0) { + return ret; + } + + ret = validate_ftp_param(target, FTP_MAX_PATHNAME); + if (ret != 0) { + return ret; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + /* Always set Passive mode to act as TCP client */ + ret = set_passive_mode(client, &data_port); + if (ret != 0) { + goto out; + } + + /* Send LIST/NLST command in control channel */ + if (strlen(options) != 0) { + if (strlen(target) != 0) { + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + CMD_LIST_OPT_FILE, options, target); + } else { + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + CMD_LIST_OPT, options); + } + } else { + if (strlen(target) != 0) { + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), + CMD_LIST_FILE, target); + } else { + strcpy(client->ctrl_buf, CMD_NLST); + } + } + + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + /* Wait for file status ok reply from the server. */ + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_150_FILE_STATUS_OK); + if (ret != FTP_CODE_150_FILE_STATUS_OK) { + goto out; + } + + ret = do_ftp_recv_data(client, data_port); + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_cwd(struct ftp_client *client, const char *folder) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + /* Validate input */ + ret = validate_ftp_param(folder, FTP_MAX_PATHNAME); + if (ret != 0) { + return ret; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + if (strcmp(folder, "..") == 0) { + ret = do_ftp_send_ctrl(client, CMD_CDUP, sizeof(CMD_CDUP) - 1); + } else { + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_CWD, folder); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + } + + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_250_FILE_ACTION_COMPLETED); + if (ret != FTP_CODE_250_FILE_ACTION_COMPLETED) { + goto out; + } + + ret = 0; + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_mkd(struct ftp_client *client, const char *folder) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + /* Validate input */ + ret = validate_ftp_param(folder, FTP_MAX_PATHNAME); + if (ret != 0) { + return ret; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_MKD, folder); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_257_PATHNAME_CREATED); + if (ret != FTP_CODE_257_PATHNAME_CREATED) { + goto out; + } + + ret = 0; +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_rmd(struct ftp_client *client, const char *folder) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + /* Validate input */ + ret = validate_ftp_param(folder, FTP_MAX_PATHNAME); + if (ret != 0) { + return ret; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_RMD, folder); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_250_FILE_ACTION_COMPLETED); + if (ret != FTP_CODE_250_FILE_ACTION_COMPLETED) { + goto out; + } + + ret = 0; +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_rename(struct ftp_client *client, const char *old_name, const char *new_name) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + ret = validate_ftp_param(old_name, FTP_MAX_PATHNAME); + if (ret != 0) { + return ret; + } + + + ret = validate_ftp_param(new_name, FTP_MAX_PATHNAME); + if (ret != 0) { + return ret; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_RNFR, old_name); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_350_FILE_ACTION_PENDING); + if (ret != FTP_CODE_350_FILE_ACTION_PENDING) { + goto out; + } + + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_RNTO, new_name); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_250_FILE_ACTION_COMPLETED); + if (ret != FTP_CODE_250_FILE_ACTION_COMPLETED) { + goto out; + } + + ret = 0; + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_delete(struct ftp_client *client, const char *file) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + /* Validate input */ + ret = validate_ftp_param(file, FTP_MAX_PATHNAME); + if (ret != 0) { + return ret; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_DELE, file); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_250_FILE_ACTION_COMPLETED); + if (ret != FTP_CODE_250_FILE_ACTION_COMPLETED) { + goto out; + } + + ret = 0; + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_get(struct ftp_client *client, const char *file) +{ + int ret; + uint16_t data_port; + + if (client == NULL) { + return -EINVAL; + } + + /* Validate input */ + ret = validate_ftp_param(file, FTP_MAX_PATHNAME); + if (ret != 0) { + return ret; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + /* Always set Passive mode to act as TCP client */ + ret = set_passive_mode(client, &data_port); + if (ret != 0) { + goto out; + } + + /* Send RETR command in control channel */ + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_RETR, file); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + if (ret != 0) { + goto out; + } + + /* Wait for file status ok reply from the server. */ + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_150_FILE_STATUS_OK); + if (ret != FTP_CODE_150_FILE_STATUS_OK) { + goto out; + } + + ret = do_ftp_recv_data(client, data_port); + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_put(struct ftp_client *client, const char *file, const uint8_t *data, + uint16_t length, int type) +{ + int ret; + uint16_t data_port = 0; + + if (client == NULL) { + return -EINVAL; + } + + if (type != FTP_PUT_NORMAL && type != FTP_PUT_UNIQUE && type != FTP_PUT_APPEND) { + return -EINVAL; + + } + if ((type == FTP_PUT_NORMAL || type == FTP_PUT_APPEND) && file == NULL) { + return -EINVAL; + } + + if (type == FTP_PUT_APPEND && data == NULL) { + return -EINVAL; + } + + /* Validate file parameter if provided */ + if (file != NULL) { + ret = validate_ftp_param(file, FTP_MAX_FILENAME); + if (ret != 0) { + return ret; + } + } + + k_mutex_lock(&client->lock, K_FOREVER); + + /** Typical sequence: + * FTP 51 Request: PASV + * FTP 96 Response: 227 Entering Passive Mode (90,130,70,73,105,177). + * FTP 63 Request: STOR upload2.txt + * FTP-DATA 53 FTP Data: 8 bytes (PASV) (STOR upload2.txt) + * FTP 67 Response: 150 Ok to send data. + * FTP 69 Response: 226 Transfer complete. + */ + + /* Always set Passive mode to act as TCP client */ + ret = set_passive_mode(client, &data_port); + if (ret != 0) { + goto out; + } + + if (type == FTP_PUT_NORMAL) { + /* Send STOR command in control channel */ + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_STOR, file); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + } else if (type == FTP_PUT_UNIQUE) { + /* Send STOU command in control channel */ + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_STOU); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + } else { + /* Send APPE command in control channel */ + snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_APPE, file); + ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); + } + + if (ret != 0) { + goto out; + } + + /* Wait for file status ok reply from the server. */ + ret = do_ftp_recv_ctrl(client, true, FTP_CODE_150_FILE_STATUS_OK); + if (ret != FTP_CODE_150_FILE_STATUS_OK) { + goto out; + } + + /* Now send data if any */ + ret = do_ftp_send_data(client, data_port, data, length); + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_keepalive(struct ftp_client *client) +{ + int ret; + + if (client == NULL) { + return -EINVAL; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + ret = do_ftp_send_ctrl(client, CMD_NOOP, sizeof(CMD_NOOP) - 1); + if (ret != 0) { + goto out; + } + + ret = do_ftp_recv_ctrl(client, false, FTP_CODE_200_OK); + if (ret != FTP_CODE_200_OK) { + goto out; + } + + ret = 0; + +out: + k_mutex_unlock(&client->lock); + + return ret; +} + +int ftp_init(struct ftp_client *client, ftp_client_callback_t ctrl_callback, + ftp_client_callback_t data_callback) +{ + if (client == NULL || ctrl_callback == NULL || data_callback == NULL) { + return -EINVAL; + } + + client->ctrl_sock = INVALID_SOCKET; + client->data_sock = INVALID_SOCKET; + client->ctrl_len = 0; + client->connected = false; + client->sec_tag = SEC_TAG_TLS_INVALID; + client->ctrl_callback = ctrl_callback; + client->data_callback = data_callback; + + memset(&client->remote, 0, sizeof(client->remote)); + + k_mutex_init(&client->lock); +#if CONFIG_FTP_CLIENT_KEEPALIVE_TIME > 0 + k_work_init_delayable(&client->keepalive_work, keepalive_handler); +#endif + + return 0; +} + +int ftp_uninit(struct ftp_client *client) +{ + int ret = 0; + + if (client == NULL) { + return -EINVAL; + } + + k_mutex_lock(&client->lock, K_FOREVER); + + if (client->ctrl_sock != INVALID_SOCKET) { + ret = ftp_close(client); + } + + k_mutex_unlock(&client->lock); + + return ret; +} + +#if CONFIG_FTP_CLIENT_KEEPALIVE_TIME > 0 +static int ftp_sys_init(void) +{ + k_work_queue_start(&ftp_work_q, ftp_stack_area, + K_THREAD_STACK_SIZEOF(ftp_stack_area), + FTP_PRIORITY, NULL); + + return 0; +} + +SYS_INIT(ftp_sys_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +#endif diff --git a/subsys/net/lib/ftp/ftp_commands.h b/subsys/net/lib/ftp/ftp_commands.h new file mode 100644 index 000000000000..c3148d5e05dc --- /dev/null +++ b/subsys/net/lib/ftp/ftp_commands.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2020-2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef FTP_COMMANDS_H_ +#define FTP_COMMANDS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Reference RFC959 File Transfer Protocol + */ +/* Abort an active file transfer */ +#define CMD_ABOR "ABOR\r\n" +/* Account information */ +#define CMD_ACCT "ACCT %s\r\n" +/* Allocate sufficient disk space to receive a file */ +#define CMD_ALLO "ALLO\r\n" +/* Append (with create) */ +#define CMD_APPE "APPE %s\r\n" +/* Change to Parent Directory */ +#define CMD_CDUP "CDUP\r\n" +/* Change working directory */ +#define CMD_CWD "CWD %s\r\n" +/* Delete file */ +#define CMD_DELE "DELE %s\r\n" +/* Returns usage documentation on a command if specified, else a general help + * document is returned + */ +#define CMD_HELP "HELP\r\n" +/* Returns information of a file or directory if specified, else in formation of + * the current working directory is returned + */ +#define CMD_LIST "LIST\r\n" +#define CMD_LIST_OPT "LIST %s\r\n" +#define CMD_LIST_FILE "LIST %s\r\n" +#define CMD_LIST_OPT_FILE "LIST %s %s\r\n" +/* Make directory */ +#define CMD_MKD "MKD %s\r\n" +/* Sets the transfer mode (Stream, Block, or Compressed) */ +#define CMD_MODE "MODE\r\n" +/* Returns a list of file names in a specified directory */ +#define CMD_NLST "NLST\r\n" +/* No operation (dummy packet; used mostly on keepalives) */ +#define CMD_NOOP "NOOP\r\n" +/* Select options for a feature (for example OPTS UTF8 ON) */ +#define CMD_OPTS "OPTS %s\r\n" +/* Authentication password */ +#define CMD_PASS "PASS %s\r\n" +/* Enter passive mode */ +#define CMD_PASV "PASV\r\n" +/* Specifies an address and port to which the server should connect */ +#define CMD_PORT "PORT\r\n" +/* Print working directory. Returns the current directory of the host */ +#define CMD_PWD "PWD\r\n" +/* Disconnect */ +#define CMD_QUIT "QUIT\r\n" +/* Re-initializes the connection*/ +#define CMD_REIN "REIN\r\n" +/* Restart transfer from the specified point */ +#define CMD_REST "REST\r\n" +/* Retrieve a copy of the file */ +#define CMD_RETR "RETR %s\r\n" +/* Remove a directory */ +#define CMD_RMD "RMD %s\r\n" +/* Rename from */ +#define CMD_RNFR "RNFR %s\r\n" +/* Rename to */ +#define CMD_RNTO "RNTO %s\r\n" +/* Sends site specific commands to remote server (like SITE IDLE 60 or + * SITE UMASK 002). Inspect SITE HELP output for complete list of + * supported commands + */ +#define CMD_SITE "SITE %s\r\n" +/* Return the size of a file */ +#define CMD_SIZE "SIZE %s\r\n" +/* Mount file structure */ +#define CMD_SMNT "SMNT\r\n" +/* Returns information on the server status, including the status of the + * current connection + */ +#define CMD_STAT "STAT\r\n" +/* Accept the data and to store the data as a file at the server site */ +#define CMD_STOR "STOR %s\r\n" +/* Store file uniquely */ +#define CMD_STOU "STOU\r\n" +/* Set file transfer structure */ +#define CMD_STRU "STRU\r\n" +/* Return system type */ +#define CMD_SYST "SYST\r\n" +/* Sets the transfer mode (ASCII/Binary) */ +#define CMD_TYPE_A "TYPE A\r\n" +#define CMD_TYPE_I "TYPE I\r\n" +/* Authentication username */ +#define CMD_USER "USER %s\r\n" + +#ifdef __cplusplus +} +#endif + +#endif /* FTP_COMMANDS_H_ */ From 86f0d04d109eb8bf35d82ab6409f7cfce626c89a Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 26 Feb 2026 13:47:10 +0100 Subject: [PATCH 1930/3334] [nrf fromlist] boards: nordic: Add nRF54LM20A as DEVELOP_IN target Add nRF54LM20A as DEVELOP_IN target on official LM20B DK. Upstream PR #: 104306 Signed-off-by: Jakub Zymelka --- boards/nordic/nrf54lm20dk/Kconfig | 5 ++++ boards/nordic/nrf54lm20dk/doc/index.rst | 38 +++++++++++++++++++++---- modules/hal_nordic/nrfx/CMakeLists.txt | 5 ++-- soc/nordic/nrf54l/Kconfig | 7 +++++ 4 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 boards/nordic/nrf54lm20dk/Kconfig diff --git a/boards/nordic/nrf54lm20dk/Kconfig b/boards/nordic/nrf54lm20dk/Kconfig new file mode 100644 index 000000000000..de688c459fc9 --- /dev/null +++ b/boards/nordic/nrf54lm20dk/Kconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_NRF54LM20DK + select SOC_NRF54LM20A_DEVELOP_IN_NRF54LM20B if SOC_NRF54LM20A_CPUAPP || SOC_NRF54LM20A_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/doc/index.rst b/boards/nordic/nrf54lm20dk/doc/index.rst index 007074c5cc53..119f0dc89e5a 100644 --- a/boards/nordic/nrf54lm20dk/doc/index.rst +++ b/boards/nordic/nrf54lm20dk/doc/index.rst @@ -3,8 +3,13 @@ Overview ******** +.. note:: + You can find more information about the nRF54LM20B SoC on the `nRF54LM20B website`_. + For the nRF54LM20B technical documentation and other resources (such as + SoC Datasheet), see the `nRF54L documentation`_ page. + The nRF54LM20 Development Kit hardware provides support for the Nordic Semiconductor -nRF54LM20A Arm Cortex-M33 CPU and the following devices: +nRF54LM20B Arm Cortex-M33 CPU and the following devices: * :abbr:`SAADC (Successive Approximation Analog to Digital Converter)` * CLOCK @@ -42,19 +47,19 @@ Programming and Debugging .. zephyr:board-supported-runners:: -Applications for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target can be +Applications for the ``nrf54lm20dk/nrf54lm20b/cpuapp`` board target can be built, flashed, and debugged in the usual way. See :ref:`build_an_application` and :ref:`application_run` for more details on building and running. -Applications for the ``nrf54lm20dk/nrf54lm20a/cpuflpr`` board target need +Applications for the ``nrf54lm20dk/nrf54lm20b/cpuflpr`` board target need to be built using sysbuild to include the ``vpr_launcher`` image for the application core. Enter the following command to compile ``hello_world`` for the FLPR core: .. code-block:: console - west build -p -b nrf54lm20dk/nrf54lm20a/cpuflpr --sysbuild + west build -p -b nrf54lm20dk/nrf54lm20b/cpuflpr --sysbuild Flashing @@ -93,10 +98,33 @@ Next, build the sample by running the following command: .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: nrf54lm20dk/nrf54lm20a/cpuapp + :board: nrf54lm20dk/nrf54lm20b/cpuapp :goals: build flash Testing the LEDs and buttons in the nRF54LM20 DK ************************************************ Test the nRF54LM20 DK with a :zephyr:code-sample:`blinky` sample. + + +.. _nrf54lm20dk_nrf54lm20a: + +nRF54LM20A emulation on nRF54LM20 DK +************************************ + +The ``nrf54lm20dk/nrf54lm20a`` board is a modified version of the :zephyr:board:`nrf54lm20dk` +that enforces the limitations imposed by the nRF54LM20A IC, which is the NPU-less variant +of the original nRF54LM20B IC. Since Nordic does not offer a development kit for the nRF54LM20A, +you can use this board to develop for this IC while using the nRF54LM20 Development Kit (PCA10184). + +See `nRF54LM20A website`_ for the official reference on the IC itself. + + +References +********** + +.. target-notes:: + +.. _nRF54LM20B website: https://www.nordicsemi.com/Products/nRF54LM20B +.. _nRF54L documentation: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/index.html +.. _nRF54LM20A website: https://www.nordicsemi.com/Products/nRF54LM20A diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index ba83619c912e..218812d7a654 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -69,8 +69,9 @@ 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_NRF54L15_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A NRF54LM20A_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR NRF_FLPR) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP NRF_APPLICATION) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR NRF_FLPR) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_DEVELOP_IN_NRF54LM20B DEVELOP_IN_NRF54LM20B) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A NRF54LM20A_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA NRF7120_ENGA_XXAA) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 7c98bf3affd3..6e75c6b4df80 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -107,4 +107,11 @@ config SOC_NRF54L_ANOMALY_56_WORKAROUND help This option enables configuration workaround 56 for nRF54L Series SoCs. +config SOC_NRF54LM20A_DEVELOP_IN_NRF54LM20B + bool + help + The nrf54lm20dk board can be used to develop the nRF54LM20A or nRF54LM20B SoCs + onto the nRF54LM20B DK. This symbol needs to be considered by certain system + initialization functionality residing in SoC erratas. + endif # SOC_SERIES_NRF54L From 838caff2374d8187faf3cf95ea829cb2c7ef1cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 26 Feb 2026 15:19:59 +0100 Subject: [PATCH 1931/3334] [nrf fromlist] drivers: audio: nrfx_pdm: allow requesting ACLK clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that requesting ACLK made it into PDM driver, allow it on target with CLKSELECT as long as clock control is enabled. Upstream PR #: 104605 Signed-off-by: Michał Stasiak --- drivers/audio/dmic_nrfx_pdm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index dabb273a0d74..16d4b6eb9765 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -321,10 +321,9 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, * (which is always available without any additional actions), * it is required to request the proper clock to be running * before starting the transfer itself. - * Targets using CLKSELECT register to select clock source - * do not need to request audio clock. */ - drv_data->request_clock = (drv_cfg->clk_src != PCLK32M && !NRF_PDM_HAS_CLKSELECT); + drv_data->request_clock = (drv_cfg->clk_src != PCLK32M && + IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF)); drv_data->configured = true; return 0; } From 4b6df5ff11b1a10a2ffa89dab7450c0af98c9e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 24 Feb 2026 11:08:37 +0100 Subject: [PATCH 1932/3334] [nrf fromtree] tests: drivers: comparator: Enable gpio_loopback test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlays required to run gpio_loopback test on nrf54lm20dk/nrf54lm20b/cpuapp. Signed-off-by: Sebastian Głąb (cherry picked from commit 3db6bfff891f37113527955afa450467fb74bc69) --- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 25 +++++++++++++++++++ .../socs/nrf54lm20b_cpuapp_nrf_comp.overlay | 18 +++++++++++++ .../socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay | 14 +++++++++++ .../comparator/gpio_loopback/testcase.yaml | 2 ++ 4 files changed, 59 insertions(+) create mode 100644 tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_comp.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..94ab328d5887 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/* + * P1.30 looped back to P1.31 (AIN1) + */ + +/ { + aliases { + test-comp = ∁ + }; + + zephyr,user { + test-gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_comp.overlay new file mode 100644 index 000000000000..31b867fd4390 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_comp.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&comp { + main-mode = "SE"; + psel = ; /* P1.31 */ + refsel = "INT_1V2"; + sp-mode = "HIGH"; + th-up = <63>; + th-down = <59>; + isource = "DISABLED"; + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay new file mode 100644 index 000000000000..9e38014b573d --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&comp { + compatible = "nordic,nrf-lpcomp"; + psel = ; /* P1.31 */ + refsel = "VDD_4_8"; + status = "okay"; +}; diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index 156c446cf3e6..abda3de2cb0c 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -30,6 +30,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: @@ -41,6 +42,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.stm32_comp: From 56a4c56085fe86a0e752cf777ec705f3b786a309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 10 Feb 2026 09:31:51 +0100 Subject: [PATCH 1933/3334] [nrf fromtree] tests: drivers: uart: async_api: Clean up nrf54lm20 configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove uart00 specific test configuration and use a single configuration approach with test running on two instances. Signed-off-by: Krzysztof Chruściński (cherry picked from commit b6f9edfba61c2bc47c367604e90c26f96496c5d2) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 28 +++++++++++++ ...f54lm20dk_nrf54lm20a_cpuapp_uart00.overlay | 42 ------------------- .../drivers/uart/uart_async_api/testcase.yaml | 8 ---- 3 files changed, 28 insertions(+), 50 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi index 8a8a0363b652..873c14563478 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -6,6 +6,7 @@ /* Test requires following loopback: * P1.13 - P1.14 + * P2.07 - P2.08 */ &pinctrl { @@ -23,6 +24,25 @@ low-power-enable; }; }; + + uart00_default_alt: uart00_default_alt { + group1 { + psels = ; + }; + + group2 { + psels = ; + bias-pull-up; + }; + }; + + uart00_sleep_alt: uart00_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; }; dut: &uart21 { @@ -32,3 +52,11 @@ dut: &uart21 { pinctrl-names = "default", "sleep"; current-speed = <115200>; }; + +dut2: &uart00 { + status = "okay"; + pinctrl-0 = <&uart00_default_alt>; + pinctrl-1 = <&uart00_sleep_alt>; + pinctrl-names = "default", "sleep"; + current-speed = <4000000>; +}; diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay deleted file mode 100644 index 5f129663e55e..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopback: - * P2.02 - P2.00 - */ - -&pinctrl { - uart00_default_alt: uart00_default_alt { - group1 { - psels = ; - }; - - group2 { - psels = ; - bias-pull-up; - }; - }; - - uart00_sleep_alt: uart00_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart00 { - status = "okay"; - pinctrl-0 = <&uart00_default_alt>; - pinctrl-1 = <&uart00_sleep_alt>; - pinctrl-names = "default", "sleep"; - current-speed = <4000000>; -}; - -&gpio2 { - status = "okay"; -}; diff --git a/tests/drivers/uart/uart_async_api/testcase.yaml b/tests/drivers/uart/uart_async_api/testcase.yaml index cf29a6618aba..2b6bc6681b8f 100644 --- a/tests/drivers/uart/uart_async_api/testcase.yaml +++ b/tests/drivers/uart/uart_async_api/testcase.yaml @@ -18,14 +18,6 @@ tests: - platform:mimxrt685_evk/mimxrt685s/cm33:"DTC_OVERLAY_FILE=nxp/dut_flexcomm4.overlay" - platform:mimxrt595_evk/mimxrt595s/cm33:"DTC_OVERLAY_FILE=nxp/dut_flexcomm12.overlay" - platform:frdm_rw612/rw612:"DTC_OVERLAY_FILE=nxp/dut_lpc_flexcomm0.overlay" - drivers.uart.async_api.fast: - harness: ztest - harness_config: - fixture: uart_fast_loopback - platform_allow: - - nrf54lm20dk/nrf54lm20a/cpuapp - extra_args: - - DTC_OVERLAY_FILE="boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay" drivers.uart.wide: filter: CONFIG_SERIAL_SUPPORT_ASYNC and not CONFIG_UART_MCUX_LPUART harness: ztest From 504e8d48e897d3a26917676c990ca277c631157f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 10:05:03 +0100 Subject: [PATCH 1934/3334] [nrf fromtree] tests: drivers: counter: counter_basic_api: Fix testing on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlays that define DTS nodes required by the test. Signed-off-by: Sebastian Głąb (cherry picked from commit 398934be81b68095ce29b1835dc9e8559fe916cd) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 +++++++ .../boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 7 +++++++ .../boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay create mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" From da8d5e3e8bca79bc5dc18978cad43a7bcd926d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 10:25:16 +0100 Subject: [PATCH 1935/3334] [nrf fromtree] tests: drivers: i2s: Enable testing on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay files that define all DTS nodes required by the I2S tests. Signed-off-by: Sebastian Głąb (cherry picked from commit 41aa8b24055a955c4fbe485bff3aca775f231b10) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 30 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 +--------------- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay | 8 ++++- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 +++++ .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 7 +++++ .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 30 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 +--------------- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay | 8 ++++- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 +++++ .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 7 +++++ 10 files changed, 104 insertions(+), 50 deletions(-) create mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay create mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..b702f98fcc42 --- /dev/null +++ b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , /* TDM_SDOUT shorted to TDM_SDIN */ + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index ef680d4b4105..1e6f31ac52d0 100644 --- a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,27 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay index a2b49797f82f..1e6f31ac52d0 100644 --- a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay +++ b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay @@ -1 +1,7 @@ -#include "nrf54lm20dk_nrf54lm20a_cpuapp.overlay" +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..b702f98fcc42 --- /dev/null +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , /* TDM_SDOUT shorted to TDM_SDIN */ + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index ef680d4b4105..1e6f31ac52d0 100644 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,27 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay index a2b49797f82f..1e6f31ac52d0 100644 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay @@ -1 +1,7 @@ -#include "nrf54lm20dk_nrf54lm20a_cpuapp.overlay" +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" From a2078e2447dbb6cc51b991ef8812b8e1fb38294a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 10:28:56 +0100 Subject: [PATCH 1936/3334] [nrf fromtree] tests: drivers: uart: uart_async_api: Enable test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay files that define DTS nodes required by the test. Signed-off-by: Sebastian Głąb (cherry picked from commit 13224777ea5e231968f573b5323e3f921ae8882b) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 +++++++ .../boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 7 +++++++ .../boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 491d47733054714bd4b83ce5975a33cbad106500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 11:13:45 +0100 Subject: [PATCH 1937/3334] [nrf fromtree] tests: drivers: spi: Run spi_controller_peripheral on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable SPI tests on nrf54lm20b target. Signed-off-by: Sebastian Głąb (cherry picked from commit 3910a684a0487408f1e53ea5aa3c63f640c7af3b) --- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 81 +++++++++++++++++++ .../spi_controller_peripheral/testcase.yaml | 3 + 2 files changed, 84 insertions(+) create mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..56d1cf573d00 --- /dev/null +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires following loopbacks: + * SCK: P1.23 - P1.24 + * MISO: P1.30 - P1.31 + * MOSI: P1.13 - P1.14 + * CS: P1.03 - P1.04 + */ + +&pinctrl { + spi22_default_alt: spi22_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi22_sleep_alt: spi22_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + spi21_default_alt: spi21_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spi21_sleep_alt: spi21_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&spi22 { + status = "okay"; + pinctrl-0 = <&spi22_default_alt>; + pinctrl-1 = <&spi22_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; + zephyr,pm-device-runtime-auto; + + dut_spi_dt: test-spi-dev@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +dut_spis: &spi21 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spi21_default_alt>; + pinctrl-1 = <&spi21_sleep_alt>; + pinctrl-names = "default", "sleep"; + /delete-property/ rx-delay-supported; + /delete-property/ rx-delay; +}; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 69d62b09042a..83602ed1229d 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -14,6 +14,7 @@ common: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -87,6 +88,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -102,6 +104,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp From 1f7894512f05c57b19ba3221ded5068437d3be32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 11:16:07 +0100 Subject: [PATCH 1938/3334] [nrf fromtree] tests: drivers: spi: Run spi_error_cases on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable SPI tests on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 65899aa42c8a21e42f47343df3517ab229af95fd) --- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 81 +++++++++++++++++++ .../drivers/spi/spi_error_cases/testcase.yaml | 1 + 2 files changed, 82 insertions(+) create mode 100644 tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..56d1cf573d00 --- /dev/null +++ b/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires following loopbacks: + * SCK: P1.23 - P1.24 + * MISO: P1.30 - P1.31 + * MOSI: P1.13 - P1.14 + * CS: P1.03 - P1.04 + */ + +&pinctrl { + spi22_default_alt: spi22_default_alt { + group1 { + psels = , + , + ; + }; + }; + + spi22_sleep_alt: spi22_sleep_alt { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + spi21_default_alt: spi21_default_alt { + group1 { + psels = , + , + , + ; + }; + }; + + spi21_sleep_alt: spi21_sleep_alt { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&spi22 { + status = "okay"; + pinctrl-0 = <&spi22_default_alt>; + pinctrl-1 = <&spi22_sleep_alt>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; + zephyr,pm-device-runtime-auto; + + dut_spi_dt: test-spi-dev@0 { + compatible = "vnd,spi-device"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +dut_spis: &spi21 { + compatible = "nordic,nrf-spis"; + status = "okay"; + def-char = <0x00>; + pinctrl-0 = <&spi21_default_alt>; + pinctrl-1 = <&spi21_sleep_alt>; + pinctrl-names = "default", "sleep"; + /delete-property/ rx-delay-supported; + /delete-property/ rx-delay; +}; diff --git a/tests/drivers/spi/spi_error_cases/testcase.yaml b/tests/drivers/spi/spi_error_cases/testcase.yaml index 6e4aa26a79f7..a847742bc0cd 100644 --- a/tests/drivers/spi/spi_error_cases/testcase.yaml +++ b/tests/drivers/spi/spi_error_cases/testcase.yaml @@ -16,6 +16,7 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 9ceb51304330596060e87e9d5df1db8692ec1ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 11:20:50 +0100 Subject: [PATCH 1939/3334] [nrf fromtree] tests: drivers: spi: Run spi_loopback on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable SPI tests on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 5c92576591d5a693118c0beb6585663858e534fd) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 1 + .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 53 +++++++++++++++++ ...rf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay | 57 +++++++++++++++++++ tests/drivers/spi/spi_loopback/testcase.yaml | 4 +- 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf create mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..ad922ab8d26f --- /dev/null +++ b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..35da44246394 --- /dev/null +++ b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires following loopback: + * P1.13 - P1.14 + */ + +&pinctrl { + spi21_default: spi21_default { + group1 { + psels = , + , + ; + }; + }; + + spi21_sleep: spi21_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +&spi21 { + status = "okay"; + pinctrl-0 = <&spi21_default>; + pinctrl-1 = <&spi21_sleep>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + zephyr,pm-device-runtime-auto; + + slow@0 { + compatible = "test-spi-loopback-slow"; + reg = <0>; + spi-max-frequency = ; + }; + + dut_fast: fast@0 { + compatible = "test-spi-loopback-fast"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay new file mode 100644 index 000000000000..27fe2005e480 --- /dev/null +++ b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires following loopback: + * P2.02 - P2.04 + */ + +&pinctrl { + spi00_default: spi00_default { + group1 { + psels = ; + }; + + group2 { + psels = , + ; + nordic,drive-mode = ; + }; + }; + + spi00_sleep: spi00_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +&spi00 { + status = "okay"; + pinctrl-0 = <&spi00_default>; + pinctrl-1 = <&spi00_sleep>; + pinctrl-names = "default", "sleep"; + overrun-character = <0x00>; + zephyr,pm-device-runtime-auto; + + slow@0 { + compatible = "test-spi-loopback-slow"; + reg = <0>; + spi-max-frequency = ; + }; + + dut_fast: fast@0 { + compatible = "test-spi-loopback-fast"; + reg = <0>; + spi-max-frequency = ; + }; +}; + +&gpio2 { + status = "okay"; +}; diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index cf589c48fcab..14d396de53a8 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -296,6 +296,7 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_16mhz: @@ -315,9 +316,10 @@ tests: harness_config: fixture: spi_fast_loopback extra_args: - - DTC_OVERLAY_FILE="boards/nrf54lm20dk_nrf54lm20a_cpuapp_spi00.overlay" + - FILE_SUFFIX=spi00 platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp drivers.spi.ke1xz_flexio_spi.loopback: extra_args: DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_spi.overlay" filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and From f80011480a2208ddbfb2decad3e3d9dab078c548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 13:25:30 +0100 Subject: [PATCH 1940/3334] [nrf fromtree] samples: drivers: jesd216: Run sample on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay that defines DTS nodes required to run the jesd216 sample on nrf54lm20b target. Signed-off-by: Sebastian Głąb (cherry picked from commit 8b5b7e6bc8472818498e1aa8439d1c8a8116ba4c) --- .../jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 +++++++++ samples/drivers/jesd216/sample.yaml | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..3ab838329612 --- /dev/null +++ b/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&mx25r64 { + status = "okay"; +}; diff --git a/samples/drivers/jesd216/sample.yaml b/samples/drivers/jesd216/sample.yaml index 4fd0af6c9ca2..7080dda2abb8 100644 --- a/samples/drivers/jesd216/sample.yaml +++ b/samples/drivers/jesd216/sample.yaml @@ -22,6 +22,7 @@ tests: - mimxrt1170_evk/mimxrt1176/cm7 - mimxrt1170_evk/mimxrt1176/cm4 - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("jedec,mspi-nor") depends_on: spi sample.drivers.jesd216.nrf52840dk_spi: @@ -36,6 +37,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l05/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp harness_config: From 9ba9c8d1934ae15c7a5cb007c1da9a073dc8feb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 19 Feb 2026 07:04:15 +0100 Subject: [PATCH 1941/3334] [nrf fromlist] modules: hal_nordic: nrfx: Use new gppi by default on nrf54h cpurad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrf54h20 cpurad supports new gppi API (only within radio domain). Use new API by default on cpurad. Upstream PR #: 100437 Signed-off-by: Krzysztof Chruściński --- modules/hal_nordic/nrfx/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 59f3d9fe2fde..39d13e2e6fda 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -167,7 +167,7 @@ config NRFX_GPPI config NRFX_GPPI_V1 bool "GPPI layer legacy" depends on NRFX_GPPI - default y if SOC_SERIES_NRF54H + default y if SOC_SERIES_NRF54H && !SOC_NRF54H20_CPURAD help When enabled then legacy version of Generic PPI layer is used. From 2ee09ed913091764595c348f2d9e892eae3c36c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 26 Feb 2026 11:46:53 +0100 Subject: [PATCH 1942/3334] [nrf fromlist] modules: hal_nordic: add support for more PRS boxes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added Kconfig options to select more PRS boxes. Upstream PR #: 104584 Signed-off-by: Michał Stasiak --- modules/hal_nordic/nrfx/Kconfig | 20 ++++++++++++++++++++ modules/hal_nordic/nrfx/nrfx_kconfig.h | 15 +++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 39d13e2e6fda..eab743e7e678 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -327,6 +327,26 @@ config NRFX_PRS_BOX_4 bool "PRS box 4" select NRFX_PRS +config NRFX_PRS_BOX_5 + bool "PRS box 5" + select NRFX_PRS + +config NRFX_PRS_BOX_6 + bool "PRS box 6" + select NRFX_PRS + +config NRFX_PRS_BOX_7 + bool "PRS box 7" + select NRFX_PRS + +config NRFX_PRS_BOX_8 + bool "PRS box 8" + select NRFX_PRS + +config NRFX_PRS_BOX_9 + bool "PRS box 9" + select NRFX_PRS + endmenu config NRFX_RESERVED_RESOURCES_HEADER diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index d75ed21aac55..32fcc824495c 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -259,6 +259,21 @@ #ifdef CONFIG_NRFX_PRS_BOX_4 #define NRFX_PRS_BOX_4_ENABLED 1 #endif +#ifdef CONFIG_NRFX_PRS_BOX_5 +#define NRFX_PRS_BOX_5_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PRS_BOX_6 +#define NRFX_PRS_BOX_6_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PRS_BOX_7 +#define NRFX_PRS_BOX_7_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PRS_BOX_8 +#define NRFX_PRS_BOX_8_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PRS_BOX_9 +#define NRFX_PRS_BOX_9_ENABLED 1 +#endif #ifdef CONFIG_NRFX_PWM #define NRFX_PWM_ENABLED 1 From f9f92c19d07c9a7f1848a3e22c22f3cd56f2a4cc Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Fri, 27 Feb 2026 09:34:20 +0100 Subject: [PATCH 1943/3334] Revert "[nrf noup] modules: tfm: Add Kconfig for CRYPTO_PAKE_MODULE_ENABLED" This reverts commit ce55bc3c10a65a47b26697d9d59bb12e244603cc. Signed-off-by: Torsten Rasmussen --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 9604319ca012..02d3580c22f3 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -88,17 +88,6 @@ config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED is not used. Note that key agreement is under key derivation in the current implementation. -config TFM_CRYPTO_PAKE_MODULE_ENABLED - bool "PAKE crypto module" - default y - depends on PSA_HAS_PAKE_SUPPORT - depends on NRF_SECURITY - depends on PSA_CRYPTO_DRIVER_OBERON || PSA_CRYPTO_DRIVER_CRACEN - help - Enables the PAKE crypto module within the crypto partition. - Unset this option if the functionality provided by 'crypto_pake.c' - is not used. - endif # TFM_PARTITION_CRYPTO endif # BUILD_WITH_TFM From 098b02839c00dd78f2bd87f4dc00a63f6242f853 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 13 Feb 2026 09:53:37 +0100 Subject: [PATCH 1944/3334] [nrf fromtree] include/zephyr/settings: remove API functions #if-defry Remove #if-defry for inclusion of functions definitions. This change follows practices recommended in the zephyr-rtos API Design Guide. Signed-off-by: Andrzej Puzdrowski (cherry picked from commit 26ea9fef16932285ddb1ca4260f081ed2463cf60) --- include/zephyr/settings/settings.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/zephyr/settings/settings.h b/include/zephyr/settings/settings.h index cd45597b8903..77030c0f9611 100644 --- a/include/zephyr/settings/settings.h +++ b/include/zephyr/settings/settings.h @@ -410,12 +410,13 @@ int settings_commit(void); */ int settings_commit_subtree(const char *subtree); -#if defined(CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION) || defined(__DOXYGEN__) /** * Save a single currently running serialized value to persisted storage (if it has changed * value) by reading the value using the get function, or save a whole subtree's currently * running serialized items out. * + * @kconfig_dep{CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION} + * * @param name Name/key of the settings item or subtree. * @param save_if_subtree Set to true if the item should be save and it is a subtree. * @param save_if_single_setting Set to true if the item should be save and it is a single @@ -426,7 +427,6 @@ int settings_commit_subtree(const char *subtree); int settings_save_subtree_or_single_without_modification(const char *name, bool save_if_subtree, bool save_if_single_setting); -#endif /** * @} settings @@ -649,8 +649,6 @@ int settings_name_next(const char *name, const char **next); * @} */ -#ifdef CONFIG_SETTINGS_RUNTIME - /** * @defgroup settings_rt Settings subsystem runtime * @brief API for runtime settings @@ -661,6 +659,8 @@ int settings_name_next(const char *name, const char **next); /** * Set a value with a specific key to a module handler. * + * @kconfig_dep{CONFIG_SETTINGS_RUNTIME} + * * @param name Key in string format. * @param data Binary value. * @param len Value length in bytes. @@ -672,6 +672,8 @@ int settings_runtime_set(const char *name, const void *data, size_t len); /** * Get a value corresponding to a key from a module handler. * + * @kconfig_dep{CONFIG_SETTINGS_RUNTIME} + * * @param name Key in string format. * @param data Returned binary value. * @param len requested value length in bytes. @@ -683,6 +685,8 @@ int settings_runtime_get(const char *name, void *data, size_t len); /** * Apply settings in a module handler. * + * @kconfig_dep{CONFIG_SETTINGS_RUNTIME} + * * @param name Key in string format. * * @return 0 on success, non-zero on failure. @@ -692,8 +696,6 @@ int settings_runtime_commit(const char *name); * @} */ -#endif /* CONFIG_SETTINGS_RUNTIME */ - /** * Get the storage instance used by zephyr. * From c6a579cdf2343bea2932c7d0bf2565b12be1a096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 15:20:01 +0100 Subject: [PATCH 1945/3334] [nrf fromtree] tests: drivers: Enable GPIO tests on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlays that define DTS nodes required to run GPIO tests on nrf54lm20b targets. Signed-off-by: Sebastian Głąb (cherry picked from commit 69e4eec9c3f7a087064df18a59d753e7a109d94d) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 +++++++ .../boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..e32a2d372055 --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.overlay" diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay new file mode 100644 index 000000000000..e32a2d372055 --- /dev/null +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.overlay" From 9e480206c81c39af12a4e2ba73daecb659566646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 25 Feb 2026 15:12:16 +0100 Subject: [PATCH 1946/3334] [nrf fromtree] tests: drivers: Enable clock_control tests on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add nrf54lm20b to platform_allow list in clock control tests. Signed-off-by: Sebastian Głąb (cherry picked from commit 4190b11bd5c10c3a318dceb9e492e47b1cebd452) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 1 + .../clock_control/clock_control_api/testcase.yaml | 2 ++ .../clock_control/nrf_clock_calibration/testcase.yaml | 1 + .../clock_control/nrf_lf_clock_start/testcase.yaml | 9 +++++++++ tests/drivers/clock_control/onoff/testcase.yaml | 1 + 5 files changed, 14 insertions(+) create mode 100644 tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf diff --git a/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..11d42321cbc3 --- /dev/null +++ b/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_TEST_NRF_HF_STARTUP_TIME_US=1000 diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index d91ea13821ed..e6f85d8deae4 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -26,6 +26,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -38,6 +39,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index f7c3dd46a048..2fc0d85f0f4a 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -11,6 +11,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index e61cf2deffbf..995d7825ccd8 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -17,6 +17,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -36,6 +37,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -55,6 +57,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -73,6 +76,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -91,6 +95,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -109,6 +114,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -127,6 +133,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -145,6 +152,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -163,6 +171,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index 84bb601a8d13..aedd89340535 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -10,6 +10,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp From ad6a55f880e6c88e51afb2ab7ebe3b0b6978b3f8 Mon Sep 17 00:00:00 2001 From: Bartlomiej Buczek Date: Thu, 26 Feb 2026 13:46:12 +0100 Subject: [PATCH 1947/3334] [nrf fromlist] samples: boards: nordic: system_off: Enable nrf54lm20b. Enable sample for nrf54lm20dk/nrf54lm20b/cpuapp target. Signed-off-by: Bartlomiej Buczek Upstream PR #: 104594 --- .../nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi | 25 ++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 26 +------------------ .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 1 + samples/boards/nordic/system_off/sample.yaml | 6 +++++ 4 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi create mode 100644 samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi new file mode 100644 index 000000000000..3a79636a4833 --- /dev/null +++ b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi @@ -0,0 +1,25 @@ +/ { + cpuapp_sram@2007ec00 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2007ec00 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + /* Shrink SRAM size to avoid overlap with retained memory region: + * 511 - 4 = 507KB = 0x7ec00 + */ + reg = <0x20000000 DT_SIZE_K(507)>; + ranges = <0x0 0x20000000 0x7ec00>; +}; diff --git a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 3a79636a4833..ab8529994033 100644 --- a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,25 +1 @@ -/ { - cpuapp_sram@2007ec00 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2007ec00 DT_SIZE_K(4)>; - zephyr,memory-region = "RetainedMem"; - status = "okay"; - - retainedmem0: retainedmem { - compatible = "zephyr,retained-ram"; - status = "okay"; - }; - }; - - aliases { - retainedmemdevice = &retainedmem0; - }; -}; - -&cpuapp_sram { - /* Shrink SRAM size to avoid overlap with retained memory region: - * 511 - 4 = 507KB = 0x7ec00 - */ - reg = <0x20000000 DT_SIZE_K(507)>; - ranges = <0x0 0x20000000 0x7ec00>; -}; +#include "nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi" diff --git a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..ab8529994033 --- /dev/null +++ b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1 @@ +#include "nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi" diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index 0672c22e4c63..debdcf8ecd05 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -15,6 +15,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp harness: console harness_config: @@ -35,6 +36,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y @@ -55,6 +57,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_SYS_CLOCK_DISABLE=y @@ -73,6 +76,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y @@ -95,6 +99,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_GRTC_WAKEUP_ENABLE=y @@ -120,6 +125,7 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y From 9387f4825164523a0e10a517149b40f36b7f5dad Mon Sep 17 00:00:00 2001 From: Tommi Kangas Date: Thu, 26 Feb 2026 12:34:07 +0200 Subject: [PATCH 1948/3334] [nrf fromtree] boards: nordic: nrf9280pdk: Add workaround for SoC1.1 GRTC issue Added a workaround for nRF9280 SoC1.1 GRTC related issue. Signed-off-by: Tommi Kangas (cherry picked from commit f7f983063817accabc0ef06a807e3f4c648016a6) --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 7ae6e8ca81a2..dc8bee73f011 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -233,7 +233,8 @@ slot1_partition: &cpuapp_slot1_partition { &grtc { status = "okay"; child-owned-channels = <5 6>; - nonsecure-channels = <5 6>; + /* Workaround for a GRTC related issue with SoC1.1, set channel 4 to nonsecure. */ + nonsecure-channels = <4 5 6>; owned-channels = <4 5 6>; }; From 6d937d80f879591f18d34465aa99bc78544d120c Mon Sep 17 00:00:00 2001 From: Aleksandr Mirlenko Date: Thu, 19 Feb 2026 10:59:55 +0100 Subject: [PATCH 1949/3334] [nrf fromtree] bluetooth: host: add support for CS IPT procedures Add support for CS IPT (Channel Sounding Inline PCT Transfer) in the Bluetooth host stack. Changes include: * definition of new CS IPT HCI opcodes; * handling of CS IPT control procedures; * integration with existing CS infrastructure; * necessary updates to public headers. Signed-off-by: Aleksandr Mirlenko (cherry picked from commit c26eda3b7130d4d4002662d4b81923696fb3c0f5) --- include/zephyr/bluetooth/conn.h | 23 ++ include/zephyr/bluetooth/cs.h | 45 +++- include/zephyr/bluetooth/hci_types.h | 178 +++++++++++++- subsys/bluetooth/host/cs.c | 350 ++++++++++++++++++++++++++- subsys/bluetooth/host/hci_core.c | 19 +- subsys/bluetooth/host/hci_core.h | 1 + 6 files changed, 596 insertions(+), 20 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 50d68d58ef23..9bef1df7dc0c 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -675,6 +675,24 @@ struct bt_conn_le_cs_capabilities { * - Bit 4: 30dB */ uint8_t tx_snr_capability; + /** Supported T_IP2_IPT time durations during CS steps. + * + * - Bit 0: 10 us + * - Bit 1: 20 us + * - Bit 2: 30 us + * - Bit 3: 40 us + * - Bit 4: 50 us + * - Bit 5: 60 us + * - Bit 6: 80 us + */ + uint16_t t_ip2_ipt_times_supported; + /** Supported time in microseconds for the antenna switch period of the + * CS tones during IPT. + * + * 0x00, 0x01, 0x02, 0x04, or 0x0A - Time in microseconds for the + * antenna switch period of the CS tones + */ + uint8_t t_sw_ipt_time_supported; }; /** Remote FAE Table for LE connections supporting CS */ @@ -825,6 +843,11 @@ struct bt_conn_le_cs_config { enum bt_conn_le_cs_ch3c_shape ch3c_shape; /** Number of channels skipped in each rising and falling sequence */ uint8_t ch3c_jump; + /** CS enhancements 1 + * Bit 0 - IPT is enabled in the CS reflector. + * All other bits are reserved and shall be set to 0. + */ + uint8_t cs_enhancements_1; /** Interlude time in microseconds between the RTT packets */ uint8_t t_ip1_time_us; /** Interlude time in microseconds between the CS tones */ diff --git a/include/zephyr/bluetooth/cs.h b/include/zephyr/bluetooth/cs.h index 06450c96201d..601d51e10023 100644 --- a/include/zephyr/bluetooth/cs.h +++ b/include/zephyr/bluetooth/cs.h @@ -498,6 +498,12 @@ struct bt_le_cs_create_config_params { enum bt_conn_le_cs_rtt_type rtt_type; /** CS Sync PHY */ enum bt_conn_le_cs_sync_phy cs_sync_phy; + /** Channel map used for CS procedure + * Channels n = 0, 1, 23, 24, 25, 77, and 78 are not allowed and shall be set to zero. + * Channel 79 is reserved for future use and shall be set to zero. + * At least 15 channels shall be enabled. + */ + uint8_t channel_map[10]; /** The number of times the Channel_Map field will be cycled through for non-mode-0 steps * within a CS procedure */ @@ -508,12 +514,8 @@ struct bt_le_cs_create_config_params { enum bt_conn_le_cs_ch3c_shape ch3c_shape; /** Number of channels skipped in each rising and falling sequence */ uint8_t ch3c_jump; - /** Channel map used for CS procedure - * Channels n = 0, 1, 23, 24, 25, 77, and 78 are not allowed and shall be set to zero. - * Channel 79 is reserved for future use and shall be set to zero. - * At least 15 channels shall be enabled. - */ - uint8_t channel_map[10]; + /** CS enhancements 1 */ + uint8_t cs_enhancements_1; }; /** Callbacks for CS Test */ @@ -665,7 +667,7 @@ int bt_le_cs_start_test(const struct bt_le_cs_test_param *params); int bt_le_cs_create_config(struct bt_conn *conn, struct bt_le_cs_create_config_params *params, enum bt_le_cs_create_config_context context); -/** @brief Create CS configuration +/** @brief Remove CS configuration * * This command is used to remove a CS configuration from the local controller * identified by the config_id @@ -852,6 +854,19 @@ int bt_le_cs_set_channel_classification(uint8_t channel_classification[10]); */ int bt_le_cs_read_local_supported_capabilities(struct bt_conn_le_cs_capabilities *ret); +/** @brief CS Read Local Supported Capabilities V2 + * + * This command is used to read the CS capabilities that are supported + * by the local Controller. + * + * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set. + * + * @param ret Return values for the CS Procedure Enable command. + * + * @return Zero on success or (negative) error code on failure. + */ +int bt_le_cs_read_local_supported_capabilities_v2(struct bt_conn_le_cs_capabilities *ret); + /** @brief CS Write Cached Remote Supported Capabilities * * This command is used to write the cached copy of the CS capabilities @@ -868,6 +883,22 @@ int bt_le_cs_read_local_supported_capabilities(struct bt_conn_le_cs_capabilities int bt_le_cs_write_cached_remote_supported_capabilities( struct bt_conn *conn, const struct bt_conn_le_cs_capabilities *params); +/** @brief CS Write Cached Remote Supported Capabilities V2 + * + * This command is used to write the cached copy of the CS capabilities + * that are supported by the remote Controller for the connection + * identified. + * + * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set. + * + * @param conn Connection Object. + * @param params Parameters for the CS Write Cached Remote Supported Capabilities command. + * + * @return Zero on success or (negative) error code on failure. + */ +int bt_le_cs_write_cached_remote_supported_capabilities_v2( + struct bt_conn *conn, const struct bt_conn_le_cs_capabilities *params); + /** @brief CS Write Cached Remote FAE Table * * This command is used to write a cached copy of the per-channel mode-0 diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index ce2aa428fa5a..4ebd0ad59ad1 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -2626,6 +2626,62 @@ struct bt_hci_rp_le_read_local_supported_capabilities { uint8_t tx_snr_capability; } __packed; +/** HCI opcode for LE Read Local Supported Capabilities (v2). */ +#define BT_HCI_OP_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_V2 BT_OP(BT_OGF_LE, 0x00A5) /* 0x20A5 */ +/** Test if LE Read Local Supported Capabilities v2 command is supported (octet 49, bit 2). */ +#define BT_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_V2_SUPPORTED(cmd) \ + BT_CMD_TEST(cmd, 49, 2) + +/** HCI response parameters for LE Read Local Supported Capabilities command (v2). */ +struct bt_hci_rp_le_read_local_supported_capabilities_v2 { + /** Status. */ + uint8_t status; + /** Number of CS configurations supported. */ + uint8_t num_config_supported; + /** Maximum consecutive procedures supported. */ + uint16_t max_consecutive_procedures_supported; + /** Number of antennas supported. */ + uint8_t num_antennas_supported; + /** Maximum antenna paths supported. */ + uint8_t max_antenna_paths_supported; + /** Roles supported. */ + uint8_t roles_supported; + /** Modes supported. */ + uint8_t modes_supported; + /** RTT capability. */ + uint8_t rtt_capability; + /** RTT AA-only N. */ + uint8_t rtt_aa_only_n; + /** RTT sounding N. */ + uint8_t rtt_sounding_n; + /** RTT random payload N. */ + uint8_t rtt_random_payload_n; + /** NADM sounding capability. */ + uint16_t nadm_sounding_capability; + /** NADM random capability. */ + uint16_t nadm_random_capability; + /** CS sync PHYs supported. */ + uint8_t cs_sync_phys_supported; + /** Subfeatures supported. */ + uint16_t subfeatures_supported; + /** T_IP1 times supported. */ + uint16_t t_ip1_times_supported; + /** T_IP2 times supported. */ + uint16_t t_ip2_times_supported; + /** T_FCS times supported. */ + uint16_t t_fcs_times_supported; + /** T_PM times supported. */ + uint16_t t_pm_times_supported; + /** T_SW time supported. */ + uint8_t t_sw_time_supported; + /** TX SNR capability. */ + uint8_t tx_snr_capability; + /** T_IP2 IPT times supported. */ + uint16_t t_ip2_ipt_times_supported; + /** T_SW IPT time supported. */ + uint8_t t_sw_ipt_time_supported; +} __packed; + #define BT_HCI_OP_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES BT_OP(BT_OGF_LE, 0x008A) /* 0x208A */ struct bt_hci_cp_le_read_remote_supported_capabilities { @@ -2659,6 +2715,60 @@ struct bt_hci_cp_le_write_cached_remote_supported_capabilities { uint8_t tx_snr_capability; } __packed; +/** HCI opcode for LE CS Write Cached Remote Supported Capabilities (v2). */ +#define BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_V2 \ + BT_OP(BT_OGF_LE, 0x00A6) /* 0x20A6 */ + +/** HCI command parameters for LE CS Write Cached Remote Supported Capabilities (v2). */ +struct bt_hci_cp_le_write_cached_remote_supported_capabilities_v2 { + /** Connection handle. */ + uint16_t handle; + /** Number of CS configurations supported. */ + uint8_t num_config_supported; + /** Maximum consecutive procedures supported. */ + uint16_t max_consecutive_procedures_supported; + /** Number of antennas supported. */ + uint8_t num_antennas_supported; + /** Maximum antenna paths supported. */ + uint8_t max_antenna_paths_supported; + /** Roles supported. */ + uint8_t roles_supported; + /** Modes supported. */ + uint8_t modes_supported; + /** RTT capability. */ + uint8_t rtt_capability; + /** RTT AA-only N. */ + uint8_t rtt_aa_only_n; + /** RTT sounding N. */ + uint8_t rtt_sounding_n; + /** RTT random payload N. */ + uint8_t rtt_random_payload_n; + /** NADM sounding capability. */ + uint16_t nadm_sounding_capability; + /** NADM random capability. */ + uint16_t nadm_random_capability; + /** CS sync PHYs supported. */ + uint8_t cs_sync_phys_supported; + /** Subfeatures supported. */ + uint16_t subfeatures_supported; + /** T_IP1 times supported. */ + uint16_t t_ip1_times_supported; + /** T_IP2 times supported. */ + uint16_t t_ip2_times_supported; + /** T_FCS times supported. */ + uint16_t t_fcs_times_supported; + /** T_PM times supported. */ + uint16_t t_pm_times_supported; + /** T_SW time supported. */ + uint8_t t_sw_time_supported; + /** TX SNR capability. */ + uint8_t tx_snr_capability; + /** T_IP2 IPT times supported. */ + uint16_t t_ip2_ipt_times_supported; + /** T_SW IPT time supported. */ + uint8_t t_sw_ipt_time_supported; +} __packed; + #define BT_HCI_OP_LE_CS_SECURITY_ENABLE BT_OP(BT_OGF_LE, 0x008C) /* 0x208C */ struct bt_hci_cp_le_security_enable { @@ -2865,7 +2975,8 @@ struct bt_hci_op_le_cs_test { uint8_t t_pm_time; uint8_t t_sw_time; uint8_t tone_antenna_config_selection; - uint8_t reserved; + /** CS enhancements 1. */ + uint8_t cs_enhancements_1; uint8_t snr_control_initiator; uint8_t snr_control_reflector; uint16_t drbg_nonce; @@ -2895,7 +3006,8 @@ struct bt_hci_cp_le_cs_create_config { uint8_t channel_selection_type; uint8_t ch3c_shape; uint8_t ch3c_jump; - uint8_t reserved; + /** CS enhancements 1. */ + uint8_t cs_enhancements_1; } __packed; #define BT_HCI_OP_LE_CS_REMOVE_CONFIG BT_OP(BT_OGF_LE, 0x0091) /* 0x2091 */ @@ -3871,6 +3983,7 @@ struct bt_hci_evt_le_read_all_remote_feat_complete { #define BT_HCI_LE_CS_TX_SNR_CAPABILITY_30DB_MASK BIT(4) #define BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE 0x2C + struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete { uint8_t status; uint16_t conn_handle; @@ -3896,6 +4009,61 @@ struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete { uint8_t tx_snr_capability; } __packed; +/** HCI LE CS Read Remote Supported Capabilities Complete event (v2). */ +#define BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_V2 0x38 + +/** HCI event parameters for LE CS Read Remote Supported Capabilities Complete (v2). */ +struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete_v2 { + /** Status. */ + uint8_t status; + /** Connection handle. */ + uint16_t conn_handle; + /** Number of CS configurations supported. */ + uint8_t num_config_supported; + /** Maximum consecutive procedures supported. */ + uint16_t max_consecutive_procedures_supported; + /** Number of antennas supported. */ + uint8_t num_antennas_supported; + /** Maximum antenna paths supported. */ + uint8_t max_antenna_paths_supported; + /** Roles supported. */ + uint8_t roles_supported; + /** Modes supported. */ + uint8_t modes_supported; + /** RTT capability. */ + uint8_t rtt_capability; + /** RTT AA-only N. */ + uint8_t rtt_aa_only_n; + /** RTT sounding N. */ + uint8_t rtt_sounding_n; + /** RTT random payload N. */ + uint8_t rtt_random_payload_n; + /** NADM sounding capability. */ + uint16_t nadm_sounding_capability; + /** NADM random capability. */ + uint16_t nadm_random_capability; + /** CS sync PHYs supported. */ + uint8_t cs_sync_phys_supported; + /** Subfeatures supported. */ + uint16_t subfeatures_supported; + /** T_IP1 times supported. */ + uint16_t t_ip1_times_supported; + /** T_IP2 times supported. */ + uint16_t t_ip2_times_supported; + /** T_FCS times supported. */ + uint16_t t_fcs_times_supported; + /** T_PM times supported. */ + uint16_t t_pm_times_supported; + /** T_SW time supported. */ + uint8_t t_sw_time_supported; + /** TX SNR capability. */ + uint8_t tx_snr_capability; + /** T_IP2 IPT times supported. */ + uint16_t t_ip2_ipt_times_supported; + /** T_SW IPT time supported. */ + uint8_t t_sw_ipt_time_supported; +} __packed; + #define BT_HCI_EVT_LE_CS_READ_REMOTE_FAE_TABLE_COMPLETE 0x2D struct bt_hci_evt_le_cs_read_remote_fae_table_complete { uint8_t status; @@ -3932,7 +4100,8 @@ struct bt_hci_evt_le_cs_config_complete { uint8_t channel_selection_type; uint8_t ch3c_shape; uint8_t ch3c_jump; - uint8_t reserved; + /** CS enhancements 1. */ + uint8_t cs_enhancements_1; uint8_t t_ip1_time; uint8_t t_ip2_time; uint8_t t_fcs_time; @@ -4323,6 +4492,9 @@ struct bt_hci_evt_le_conn_rate_change { #define BT_EVT_MASK_LE_FRAME_SPACE_UPDATE_COMPLETE BT_EVT_BIT(52) #define BT_EVT_MASK_LE_CONN_RATE_CHANGE BT_EVT_BIT(54) +/** Event mask for LE CS Read Remote Supported Capabilities Complete (v2). */ +#define BT_EVT_MASK_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_V2 BT_EVT_BIT(55) + /** HCI Error Codes, BT Core Spec v5.4 [Vol 1, Part F]. */ #define BT_HCI_ERR_SUCCESS 0x00 #define BT_HCI_ERR_UNKNOWN_CMD 0x01 diff --git a/subsys/bluetooth/host/cs.c b/subsys/bluetooth/host/cs.c index 1098aba9e8d2..c676a9a477f4 100644 --- a/subsys/bluetooth/host/cs.c +++ b/subsys/bluetooth/host/cs.c @@ -425,6 +425,9 @@ void bt_hci_le_cs_read_remote_supported_capabilities_complete(struct net_buf *bu remote_cs_capabilities.t_sw_time = evt->t_sw_time_supported; remote_cs_capabilities.tx_snr_capability = evt->tx_snr_capability; + remote_cs_capabilities.t_ip2_ipt_times_supported = 0; + remote_cs_capabilities.t_sw_ipt_time_supported = 0; + bt_conn_notify_remote_cs_capabilities(conn, BT_HCI_ERR_SUCCESS, &remote_cs_capabilities); } else { @@ -434,6 +437,139 @@ void bt_hci_le_cs_read_remote_supported_capabilities_complete(struct net_buf *bu bt_conn_unref(conn); } +void bt_hci_le_cs_read_remote_supported_capabilities_complete_v2(struct net_buf *buf) +{ + struct bt_conn *conn; + struct bt_conn_le_cs_capabilities remote_cs_capabilities; + struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete_v2 *evt; + + if (buf->len < sizeof(*evt)) { + LOG_ERR("Unexpected end of buffer"); + return; + } + + evt = net_buf_pull_mem(buf, sizeof(*evt)); + if (evt->status) { + LOG_WRN("Read Remote Supported Capabilities failed (status 0x%02X)", evt->status); + } + + conn = bt_conn_lookup_handle(sys_le16_to_cpu(evt->conn_handle), BT_CONN_TYPE_LE); + if (!conn) { + LOG_ERR("Could not lookup connection handle when reading remote CS capabilities"); + return; + } + + if (evt->status != BT_HCI_ERR_SUCCESS) { + bt_conn_notify_remote_cs_capabilities(conn, evt->status, NULL); + goto out; + } + + remote_cs_capabilities.num_config_supported = evt->num_config_supported; + remote_cs_capabilities.max_consecutive_procedures_supported = + sys_le16_to_cpu(evt->max_consecutive_procedures_supported); + remote_cs_capabilities.num_antennas_supported = evt->num_antennas_supported; + remote_cs_capabilities.max_antenna_paths_supported = + evt->max_antenna_paths_supported; + + remote_cs_capabilities.initiator_supported = + evt->roles_supported & BT_HCI_LE_CS_INITIATOR_ROLE_MASK; + remote_cs_capabilities.reflector_supported = + evt->roles_supported & BT_HCI_LE_CS_REFLECTOR_ROLE_MASK; + remote_cs_capabilities.mode_3_supported = + evt->modes_supported & BT_HCI_LE_CS_MODES_SUPPORTED_MODE_3_MASK; + + remote_cs_capabilities.rtt_aa_only_n = evt->rtt_aa_only_n; + remote_cs_capabilities.rtt_sounding_n = evt->rtt_sounding_n; + remote_cs_capabilities.rtt_random_payload_n = evt->rtt_random_payload_n; + + if (evt->rtt_aa_only_n) { + if (evt->rtt_capability & BT_HCI_LE_CS_RTT_AA_ONLY_N_10NS_MASK) { + remote_cs_capabilities.rtt_aa_only_precision = + BT_CONN_LE_CS_RTT_AA_ONLY_10NS; + } else { + remote_cs_capabilities.rtt_aa_only_precision = + BT_CONN_LE_CS_RTT_AA_ONLY_150NS; + } + } else { + remote_cs_capabilities.rtt_aa_only_precision = + BT_CONN_LE_CS_RTT_AA_ONLY_NOT_SUPP; + } + + if (evt->rtt_sounding_n) { + if (evt->rtt_capability & BT_HCI_LE_CS_RTT_SOUNDING_N_10NS_MASK) { + remote_cs_capabilities.rtt_sounding_precision = + BT_CONN_LE_CS_RTT_SOUNDING_10NS; + } else { + remote_cs_capabilities.rtt_sounding_precision = + BT_CONN_LE_CS_RTT_SOUNDING_150NS; + } + } else { + remote_cs_capabilities.rtt_sounding_precision = + BT_CONN_LE_CS_RTT_SOUNDING_NOT_SUPP; + } + + if (evt->rtt_random_payload_n) { + if (evt->rtt_capability & BT_HCI_LE_CS_RTT_RANDOM_PAYLOAD_N_10NS_MASK) { + remote_cs_capabilities.rtt_random_payload_precision = + BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS; + } else { + remote_cs_capabilities.rtt_random_payload_precision = + BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_150NS; + } + } else { + remote_cs_capabilities.rtt_random_payload_precision = + BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_NOT_SUPP; + } + + remote_cs_capabilities.phase_based_nadm_sounding_supported = + sys_le16_to_cpu(evt->nadm_sounding_capability) & + BT_HCI_LE_CS_NADM_SOUNDING_CAPABILITY_PHASE_BASED_MASK; + + remote_cs_capabilities.phase_based_nadm_random_supported = + sys_le16_to_cpu(evt->nadm_random_capability) & + BT_HCI_LE_CS_NADM_RANDOM_CAPABILITY_PHASE_BASED_MASK; + + remote_cs_capabilities.cs_sync_2m_phy_supported = + evt->cs_sync_phys_supported & BT_HCI_LE_CS_SYNC_PHYS_2M_MASK; + + remote_cs_capabilities.cs_sync_2m_2bt_phy_supported = + evt->cs_sync_phys_supported & BT_HCI_LE_CS_SYNC_PHYS_2M_2BT_MASK; + + remote_cs_capabilities.cs_without_fae_supported = + sys_le16_to_cpu(evt->subfeatures_supported) & + BT_HCI_LE_CS_SUBFEATURE_NO_TX_FAE_MASK; + + remote_cs_capabilities.chsel_alg_3c_supported = + sys_le16_to_cpu(evt->subfeatures_supported) & + BT_HCI_LE_CS_SUBFEATURE_CHSEL_ALG_3C_MASK; + + remote_cs_capabilities.pbr_from_rtt_sounding_seq_supported = + sys_le16_to_cpu(evt->subfeatures_supported) & + BT_HCI_LE_CS_SUBFEATURE_PBR_FROM_RTT_SOUNDING_SEQ_MASK; + + remote_cs_capabilities.t_ip1_times_supported = + sys_le16_to_cpu(evt->t_ip1_times_supported); + remote_cs_capabilities.t_ip2_times_supported = + sys_le16_to_cpu(evt->t_ip2_times_supported); + remote_cs_capabilities.t_fcs_times_supported = + sys_le16_to_cpu(evt->t_fcs_times_supported); + remote_cs_capabilities.t_pm_times_supported = + sys_le16_to_cpu(evt->t_pm_times_supported); + + remote_cs_capabilities.t_sw_time = evt->t_sw_time_supported; + remote_cs_capabilities.tx_snr_capability = evt->tx_snr_capability; + + remote_cs_capabilities.t_ip2_ipt_times_supported = + sys_le16_to_cpu(evt->t_ip2_ipt_times_supported); + remote_cs_capabilities.t_sw_ipt_time_supported = evt->t_sw_ipt_time_supported; + + bt_conn_notify_remote_cs_capabilities(conn, BT_HCI_ERR_SUCCESS, + &remote_cs_capabilities); + +out: + bt_conn_unref(conn); +} + int bt_le_cs_set_default_settings(struct bt_conn *conn, const struct bt_le_cs_set_default_settings_param *params) { @@ -556,9 +692,7 @@ int bt_le_cs_start_test(const struct bt_le_cs_test_param *params) cp->t_pm_time = params->t_pm_time; cp->t_sw_time = params->t_sw_time; cp->tone_antenna_config_selection = params->tone_antenna_config_selection; - - cp->reserved = 0; - + cp->cs_enhancements_1 = 0; cp->snr_control_initiator = params->initiator_snr_control; cp->snr_control_reflector = params->reflector_snr_control; cp->drbg_nonce = sys_cpu_to_le16(params->drbg_nonce); @@ -877,6 +1011,7 @@ void bt_hci_le_cs_config_complete_event(struct net_buf *buf) config.channel_selection_type = evt->channel_selection_type; config.ch3c_shape = evt->ch3c_shape; config.ch3c_jump = evt->ch3c_jump; + config.cs_enhancements_1 = evt->cs_enhancements_1; config.t_ip1_time_us = evt->t_ip1_time; config.t_ip2_time_us = evt->t_ip2_time; config.t_fcs_time_us = evt->t_fcs_time; @@ -927,7 +1062,7 @@ int bt_le_cs_create_config(struct bt_conn *conn, struct bt_le_cs_create_config_p cp->channel_selection_type = params->channel_selection_type; cp->ch3c_shape = params->ch3c_shape; cp->ch3c_jump = params->ch3c_jump; - cp->reserved = 0; + cp->cs_enhancements_1 = params->cs_enhancements_1; memcpy(cp->channel_map, params->channel_map, ARRAY_SIZE(cp->channel_map)); return bt_hci_cmd_send_sync(BT_HCI_OP_LE_CS_CREATE_CONFIG, buf, NULL); @@ -1122,12 +1257,113 @@ int bt_le_cs_read_local_supported_capabilities(struct bt_conn_le_cs_capabilities ret->t_sw_time = rp->t_sw_time_supported; ret->tx_snr_capability = rp->tx_snr_capability; + ret->t_ip2_ipt_times_supported = 0; + ret->t_sw_ipt_time_supported = 0; + + net_buf_unref(rsp); + return status; +} + +int bt_le_cs_read_local_supported_capabilities_v2(struct bt_conn_le_cs_capabilities *ret) +{ + struct bt_hci_rp_le_read_local_supported_capabilities_v2 *rp; + struct net_buf *rsp; + + int err = bt_hci_cmd_send_sync( + BT_HCI_OP_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_V2, NULL, &rsp); + + if (err) { + return err; + } + + rp = (void *)rsp->data; + + uint8_t status = rp->status; + + ret->num_config_supported = rp->num_config_supported; + ret->max_consecutive_procedures_supported = + sys_le16_to_cpu(rp->max_consecutive_procedures_supported); + ret->num_antennas_supported = rp->num_antennas_supported; + ret->max_antenna_paths_supported = rp->max_antenna_paths_supported; + + ret->initiator_supported = rp->roles_supported & BT_HCI_LE_CS_INITIATOR_ROLE_MASK; + ret->reflector_supported = rp->roles_supported & BT_HCI_LE_CS_REFLECTOR_ROLE_MASK; + ret->mode_3_supported = rp->modes_supported & BT_HCI_LE_CS_MODES_SUPPORTED_MODE_3_MASK; + + ret->rtt_aa_only_n = rp->rtt_aa_only_n; + ret->rtt_sounding_n = rp->rtt_sounding_n; + ret->rtt_random_payload_n = rp->rtt_random_payload_n; + + if (rp->rtt_aa_only_n) { + if (rp->rtt_capability & BT_HCI_LE_CS_RTT_AA_ONLY_N_10NS_MASK) { + ret->rtt_aa_only_precision = BT_CONN_LE_CS_RTT_AA_ONLY_10NS; + } else { + ret->rtt_aa_only_precision = BT_CONN_LE_CS_RTT_AA_ONLY_150NS; + } + } else { + ret->rtt_aa_only_precision = BT_CONN_LE_CS_RTT_AA_ONLY_NOT_SUPP; + } + + if (rp->rtt_sounding_n) { + if (rp->rtt_capability & BT_HCI_LE_CS_RTT_SOUNDING_N_10NS_MASK) { + ret->rtt_sounding_precision = BT_CONN_LE_CS_RTT_SOUNDING_10NS; + } else { + ret->rtt_sounding_precision = BT_CONN_LE_CS_RTT_SOUNDING_150NS; + } + } else { + ret->rtt_sounding_precision = BT_CONN_LE_CS_RTT_SOUNDING_NOT_SUPP; + } + + if (rp->rtt_random_payload_n) { + if (rp->rtt_capability & BT_HCI_LE_CS_RTT_RANDOM_PAYLOAD_N_10NS_MASK) { + ret->rtt_random_payload_precision = BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS; + } else { + ret->rtt_random_payload_precision = BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_150NS; + } + } else { + ret->rtt_random_payload_precision = BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_NOT_SUPP; + } + + ret->phase_based_nadm_sounding_supported = + sys_le16_to_cpu(rp->nadm_sounding_capability) & + BT_HCI_LE_CS_NADM_SOUNDING_CAPABILITY_PHASE_BASED_MASK; + + ret->phase_based_nadm_random_supported = + sys_le16_to_cpu(rp->nadm_random_capability) & + BT_HCI_LE_CS_NADM_RANDOM_CAPABILITY_PHASE_BASED_MASK; + + ret->cs_sync_2m_phy_supported = rp->cs_sync_phys_supported & BT_HCI_LE_CS_SYNC_PHYS_2M_MASK; + + ret->cs_sync_2m_2bt_phy_supported = + rp->cs_sync_phys_supported & BT_HCI_LE_CS_SYNC_PHYS_2M_2BT_MASK; + + ret->cs_without_fae_supported = + sys_le16_to_cpu(rp->subfeatures_supported) & BT_HCI_LE_CS_SUBFEATURE_NO_TX_FAE_MASK; + + ret->chsel_alg_3c_supported = sys_le16_to_cpu(rp->subfeatures_supported) & + BT_HCI_LE_CS_SUBFEATURE_CHSEL_ALG_3C_MASK; + + ret->pbr_from_rtt_sounding_seq_supported = + sys_le16_to_cpu(rp->subfeatures_supported) & + BT_HCI_LE_CS_SUBFEATURE_PBR_FROM_RTT_SOUNDING_SEQ_MASK; + + ret->t_ip1_times_supported = sys_le16_to_cpu(rp->t_ip1_times_supported); + ret->t_ip2_times_supported = sys_le16_to_cpu(rp->t_ip2_times_supported); + ret->t_fcs_times_supported = sys_le16_to_cpu(rp->t_fcs_times_supported); + ret->t_pm_times_supported = sys_le16_to_cpu(rp->t_pm_times_supported); + + ret->t_sw_time = rp->t_sw_time_supported; + ret->tx_snr_capability = rp->tx_snr_capability; + + ret->t_ip2_ipt_times_supported = sys_le16_to_cpu(rp->t_ip2_ipt_times_supported); + ret->t_sw_ipt_time_supported = rp->t_sw_ipt_time_supported; + net_buf_unref(rsp); return status; } -int bt_le_cs_write_cached_remote_supported_capabilities( - struct bt_conn *conn, const struct bt_conn_le_cs_capabilities *params) +int bt_le_cs_write_cached_remote_supported_capabilities(struct bt_conn *conn, + const struct bt_conn_le_cs_capabilities *params) { struct bt_hci_cp_le_write_cached_remote_supported_capabilities *cp; struct net_buf *buf; @@ -1224,6 +1460,108 @@ int bt_le_cs_write_cached_remote_supported_capabilities( NULL); } +int bt_le_cs_write_cached_remote_supported_capabilities_v2(struct bt_conn *conn, + const struct bt_conn_le_cs_capabilities *params) +{ + struct bt_hci_cp_le_write_cached_remote_supported_capabilities_v2 *cp; + struct net_buf *buf; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (!buf) { + return -ENOBUFS; + } + + cp = net_buf_add(buf, sizeof(*cp)); + + cp->handle = sys_cpu_to_le16(conn->handle); + + cp->num_config_supported = params->num_config_supported; + + cp->max_consecutive_procedures_supported = + sys_cpu_to_le16(params->max_consecutive_procedures_supported); + + cp->num_antennas_supported = params->num_antennas_supported; + cp->max_antenna_paths_supported = params->max_antenna_paths_supported; + + cp->roles_supported = 0; + if (params->initiator_supported) { + cp->roles_supported |= BT_HCI_LE_CS_INITIATOR_ROLE_MASK; + } + if (params->reflector_supported) { + cp->roles_supported |= BT_HCI_LE_CS_REFLECTOR_ROLE_MASK; + } + + cp->modes_supported = 0; + if (params->mode_3_supported) { + cp->modes_supported |= BT_HCI_LE_CS_MODES_SUPPORTED_MODE_3_MASK; + } + + cp->rtt_aa_only_n = params->rtt_aa_only_n; + cp->rtt_sounding_n = params->rtt_sounding_n; + cp->rtt_random_payload_n = params->rtt_random_payload_n; + + cp->rtt_capability = 0; + if (params->rtt_aa_only_precision == BT_CONN_LE_CS_RTT_AA_ONLY_10NS) { + cp->rtt_capability |= BT_HCI_LE_CS_RTT_AA_ONLY_N_10NS_MASK; + } + + if (params->rtt_sounding_precision == BT_CONN_LE_CS_RTT_SOUNDING_10NS) { + cp->rtt_capability |= BT_HCI_LE_CS_RTT_SOUNDING_N_10NS_MASK; + } + + if (params->rtt_random_payload_precision == BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS) { + cp->rtt_capability |= BT_HCI_LE_CS_RTT_RANDOM_PAYLOAD_N_10NS_MASK; + } + + cp->nadm_sounding_capability = 0; + if (params->phase_based_nadm_sounding_supported) { + cp->nadm_sounding_capability |= + sys_cpu_to_le16(BT_HCI_LE_CS_NADM_SOUNDING_CAPABILITY_PHASE_BASED_MASK); + } + + cp->nadm_random_capability = 0; + if (params->phase_based_nadm_random_supported) { + cp->nadm_random_capability |= + sys_cpu_to_le16(BT_HCI_LE_CS_NADM_RANDOM_CAPABILITY_PHASE_BASED_MASK); + } + + cp->cs_sync_phys_supported = 0; + if (params->cs_sync_2m_phy_supported) { + cp->cs_sync_phys_supported |= BT_HCI_LE_CS_SYNC_PHYS_2M_MASK; + } + if (params->cs_sync_2m_2bt_phy_supported) { + cp->cs_sync_phys_supported |= BT_HCI_LE_CS_SYNC_PHYS_2M_2BT_MASK; + } + + cp->subfeatures_supported = 0; + if (params->cs_without_fae_supported) { + cp->subfeatures_supported |= + sys_cpu_to_le16(BT_HCI_LE_CS_SUBFEATURE_NO_TX_FAE_MASK); + } + if (params->chsel_alg_3c_supported) { + cp->subfeatures_supported |= + sys_cpu_to_le16(BT_HCI_LE_CS_SUBFEATURE_CHSEL_ALG_3C_MASK); + } + if (params->pbr_from_rtt_sounding_seq_supported) { + cp->subfeatures_supported |= + sys_cpu_to_le16(BT_HCI_LE_CS_SUBFEATURE_PBR_FROM_RTT_SOUNDING_SEQ_MASK); + } + + cp->t_ip1_times_supported = sys_cpu_to_le16(params->t_ip1_times_supported); + cp->t_ip2_times_supported = sys_cpu_to_le16(params->t_ip2_times_supported); + cp->t_fcs_times_supported = sys_cpu_to_le16(params->t_fcs_times_supported); + cp->t_pm_times_supported = sys_cpu_to_le16(params->t_pm_times_supported); + cp->t_sw_time_supported = params->t_sw_time; + cp->tx_snr_capability = params->tx_snr_capability; + + cp->t_ip2_ipt_times_supported = sys_cpu_to_le16(params->t_ip2_ipt_times_supported); + cp->t_sw_ipt_time_supported = params->t_sw_ipt_time_supported; + + return bt_hci_cmd_send_sync( + BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_V2, + buf, NULL); +} + int bt_le_cs_write_cached_remote_fae_table(struct bt_conn *conn, int8_t remote_fae_table[72]) { struct bt_hci_cp_le_write_cached_remote_fae_table *cp; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 9573f714fa1f..454929eecfda 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3071,17 +3071,21 @@ static const struct event_handler meta_events[] = { EVENT_HANDLER(BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE, bt_hci_le_cs_read_remote_supported_capabilities_complete, sizeof(struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete)), + EVENT_HANDLER(BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_V2, + bt_hci_le_cs_read_remote_supported_capabilities_complete_v2, + sizeof( + struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete_v2)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_READ_REMOTE_FAE_TABLE_COMPLETE, bt_hci_le_cs_read_remote_fae_table_complete, sizeof(struct bt_hci_evt_le_cs_read_remote_fae_table_complete)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_CONFIG_COMPLETE, bt_hci_le_cs_config_complete_event, sizeof(struct bt_hci_evt_le_cs_config_complete)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_SECURITY_ENABLE_COMPLETE, - bt_hci_le_cs_security_enable_complete, - sizeof(struct bt_hci_evt_le_cs_security_enable_complete)), + bt_hci_le_cs_security_enable_complete, + sizeof(struct bt_hci_evt_le_cs_security_enable_complete)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_PROCEDURE_ENABLE_COMPLETE, - bt_hci_le_cs_procedure_enable_complete, - sizeof(struct bt_hci_evt_le_cs_procedure_enable_complete)), + bt_hci_le_cs_procedure_enable_complete, + sizeof(struct bt_hci_evt_le_cs_procedure_enable_complete)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_SUBEVENT_RESULT, bt_hci_le_cs_subevent_result, sizeof(struct bt_hci_evt_le_cs_subevent_result)), @@ -3724,6 +3728,13 @@ static int le_set_event_mask(void) if (IS_ENABLED(CONFIG_BT_CHANNEL_SOUNDING) && BT_FEAT_LE_CHANNEL_SOUNDING(bt_dev.le.features)) { mask |= BT_EVT_MASK_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE; + /* Only set v2 event mask if controller supports it; v1-only CS controllers + * may reject the Set Event Mask command if an unknown bit is set. + */ + if (BT_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_V2_SUPPORTED( + bt_dev.supported_commands)) { + mask |= BT_EVT_MASK_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_V2; + } mask |= BT_EVT_MASK_LE_CS_READ_REMOTE_FAE_TABLE_COMPLETE; mask |= BT_EVT_MASK_LE_CS_CONFIG_COMPLETE; mask |= BT_EVT_MASK_LE_CS_SECURITY_ENABLE_COMPLETE; diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index dacc51d20fa2..1cc40349cfba 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -559,6 +559,7 @@ void bt_hci_le_past_received_v2(struct net_buf *buf); /* CS HCI event handlers */ void bt_hci_le_cs_read_remote_supported_capabilities_complete(struct net_buf *buf); +void bt_hci_le_cs_read_remote_supported_capabilities_complete_v2(struct net_buf *buf); void bt_hci_le_cs_read_remote_fae_table_complete(struct net_buf *buf); void bt_hci_le_cs_config_complete_event(struct net_buf *buf); void bt_hci_le_cs_security_enable_complete(struct net_buf *buf); From 45ad4db14902a82a6e105ed91cb54601d2bdcac8 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Wed, 4 Mar 2026 13:50:13 +0100 Subject: [PATCH 1950/3334] [nrf fromlist] nrf54h20: Add MCUboot to supported configurations The MCUboot is supported on nRF54H20 platform. Upstream PR #: 104890 Signed-off-by: Tomasz Chyrowicz --- soc/nordic/nrf54h/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 1c5f703ae713..a3f6d83e6e28 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -10,7 +10,6 @@ config SOC_SERIES_NRF54H select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM select NRF_PLATFORM_HALTIUM - select EXPERIMENTAL if MCUBOOT config SOC_SERIES_NRF54HX select DEPRECATED From 8ddd16a64fea379ddf80eecc214ea974c512dd96 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Sun, 1 Mar 2026 12:57:51 +0100 Subject: [PATCH 1951/3334] [nrf fromlist] manifest: update hal_nordic revision with IronSide SE support package Upstream PR #: 104759 Update hal_nordic revision to pull in updated IronSide SE supporting code. Signed-off-by: Grzegorz Swiderski Signed-off-by: Jonathan Nilsen (cherry picked from commit f9b941b6adec2ec6ea99b36c6c3b3e46c8c64767) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e6976ce4472f..e30fc158b29e 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 5c1df3fe9bc144e558b3506cef6cf33652bb2539 + revision: 4dea410729da817a464f778533eb721473262e5b path: modules/hal/nordic groups: - hal From 60aa88bc152dfb7b7b27e138f245cb641df684a3 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Sun, 1 Mar 2026 12:57:51 +0100 Subject: [PATCH 1952/3334] [nrf fromlist] boards: nrf54h20dk: Add partitions for UICR MPCCONF Upstream PR #: 104759 Add `mpcconf_partition` and `secondary_mpcconf_partition` to the board's default memory map. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 564685f48b73f5fe45a59800da3939515f610e57) --- .../nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index 675e4555ac26..91ee56a6ecc8 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -176,6 +176,14 @@ reg = <0x1c0000 DT_SIZE_K(8)>; }; + mpcconf_partition: partition@1c2000 { + reg = <0x1c2000 512>; + }; + + secondary_mpcconf_partition: partition@1c2200 { + reg = <0x1c2200 512>; + }; + /* NB: A gap has been left here for future partitions */ /* 0x1fd000 was chosen for secure_storage_partition such that From b5f993e46f1c5eb8243d891fabbcb447fd958905 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Wed, 4 Mar 2026 19:09:48 +0100 Subject: [PATCH 1953/3334] [nrf fromlist] soc: nordic: uicr: add support for new UICR features Upstream PR #: 104759 Add support to the UICR generator image for the new features in the IronSide support package: Split blob generation options like GEN_UICR_PERIPHCONF into GEN_UICR_PERIPHCONF and GEN_UICR_GENERATE_PERIPHCONF to allow configuring the blob address independently from generating the blob itself. Add support for generating a UICR MPCCONF blob by extracting a table of entries from an image ELF file. The mechanism works mostly the same as the UICR PERIPHCONF blob generation. When the UICR generator image finds another image that has CONFIG_NRF_MPCCONF_SECTION=y, it will extract the data from the section named 'mpcconf_entry' and include it in build/uicr/zephyr.hex and either build/uicr/mpcconf.hex or build/uicr/secondary_mpcconf.hex. Add support to the UICR generator image for setting the POLICY_MPCCONFSTAGE field via Kconfig. Setting this to INIT is required to make use of the new ironside_se_mpcconf_write() API added with IronSide SE v23.4.0+27, which is used to configure global domain MPCs. Signed-off-by: Jonathan Nilsen (cherry picked from commit a0e04827b12f546fd23ee795ae8fe31f6aa59f33) --- modules/hal_nordic/ironside/se/CMakeLists.txt | 10 +- modules/hal_nordic/ironside/se/Kconfig | 11 ++ modules/hal_nordic/ironside/se/uicr.ld | 12 +++ soc/nordic/common/uicr/Kconfig.gen_uicr | 88 +++++++++++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 102 +++++++++++++++--- 5 files changed, 208 insertions(+), 15 deletions(-) diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index 87dbeb333038..a4c3c66aa8fe 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -15,7 +15,7 @@ zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL ) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c) -if(CONFIG_NRF_PERIPHCONF_SECTION) +if(CONFIG_NRF_PERIPHCONF_SECTION OR CONFIG_NRF_MPCCONF_SECTION) zephyr_linker_sources(SECTIONS uicr.ld) endif() @@ -49,3 +49,11 @@ if(CONFIG_NRF_PERIPHCONF_SECTION AND NOT SYSBUILD) "Sysbuild and ensure that SB_CONFIG_NRF_HALTIUM_GENERATE_UICR=y." ) endif() + +if(CONFIG_NRF_MPCCONF_SECTION AND NOT SYSBUILD) + message(WARNING "CONFIG_NRF_MPCCONF_SECTION is enabled, but Sysbuild is not being used. " + "The MPC configuration will not be applied unless artifacts " + "are generated manually/externally. To enable automatic generation, build with " + "Sysbuild and ensure that SB_CONFIG_NRF_HALTIUM_GENERATE_UICR=y." + ) +endif() diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index 04e271c0b78b..80598be0b89a 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -47,6 +47,17 @@ config IRONSIDE_SE_DVFS_ABB_STATUSANA_CHECK_MAX_ATTEMPTS endif # IRONSIDE_SE_DVFS +config NRF_MPCCONF_SECTION + bool "Global Memory Privilege Controller (MPC) initialization section" + depends on LINKER_DEVNULL_SUPPORT + imply LINKER_DEVNULL_MEMORY + help + Include static global Memory Privilege Controller (MPC) peripheral + initialization values from the build in a dedicated section. The section is + stripped from the firmware binary. If the UICR generator image is enabled, + it will include the stripped section in the generated UICR MPCCONF blob. + Currently the UICR generator supports at most one image setting this. + menuconfig NRF_PERIPHCONF_SECTION bool "Global peripheral initialization section" depends on LINKER_DEVNULL_SUPPORT diff --git a/modules/hal_nordic/ironside/se/uicr.ld b/modules/hal_nordic/ironside/se/uicr.ld index acfc52242893..a134fe380242 100644 --- a/modules/hal_nordic/ironside/se/uicr.ld +++ b/modules/hal_nordic/ironside/se/uicr.ld @@ -4,7 +4,18 @@ */ #include +#include +#if defined(CONFIG_NRF_MPCCONF_SECTION) + +SECTION_PROLOGUE(mpcconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) +{ + KEEP(*(.mpcconf_entry)); +} GROUP_ROM_LINK_IN(DEVNULL_REGION, DEVNULL_REGION) + +#endif + +#if defined(CONFIG_NRF_PERIPHCONF_SECTION) #if defined(CONFIG_NRF_PERIPHCONF_SECTION_STRIP) SECTION_PROLOGUE(periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) @@ -17,3 +28,4 @@ SECTION_PROLOGUE(periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) ITERABLE_SECTION_ROM(periphconf_entry, Z_LINK_ITERABLE_SUBALIGN) #endif +#endif diff --git a/soc/nordic/common/uicr/Kconfig.gen_uicr b/soc/nordic/common/uicr/Kconfig.gen_uicr index 0e726e6712bb..65d98e3a0b66 100644 --- a/soc/nordic/common/uicr/Kconfig.gen_uicr +++ b/soc/nordic/common/uicr/Kconfig.gen_uicr @@ -4,9 +4,19 @@ menu "UICR generator options" depends on IS_GEN_UICR_IMAGE +config GEN_UICR_PERIPHCONF + bool "UICR.PERIPHCONF" + default y + depends on $(dt_nodelabel_enabled,periphconf_partition) + help + When enabled, the UICR generator will configure the location + of the peripheral configuration data, based on the + periphconf_partition in device tree. + config GEN_UICR_GENERATE_PERIPHCONF bool "Generate PERIPHCONF hex alongside UICR" default y + depends on GEN_UICR_PERIPHCONF help When enabled, the UICR generator will populate the periphconf_partition partition. @@ -94,6 +104,25 @@ config GEN_UICR_PROTECTEDMEM_SIZE_BYTES Size of the protected memory region in bytes. This value must be divisible by 4096 (4 kiB). +config GEN_UICR_MPCCONF + bool "UICR.MPCCONF" + depends on $(dt_nodelabel_enabled,mpcconf_partition) + help + When enabled, the UICR generator will configure the location + of the MPC configuration data, based on the + mpcconf_partition in device tree. + + Enabling this option causes the generated UICR format version to be set + to >= 2.2, which requires IronSide SE v23.4.0+27 or higher to be installed. + +config GEN_UICR_GENERATE_MPCCONF + bool "Generate MPCCONF hex alongside UICR" + default y + depends on GEN_UICR_MPCCONF + help + When enabled, the UICR generator will populate the + mpcconf_partition partition. + config GEN_UICR_WDTSTART bool "UICR.WDTSTART" help @@ -186,9 +215,19 @@ config GEN_UICR_SECONDARY if GEN_UICR_SECONDARY +config GEN_UICR_SECONDARY_PERIPHCONF + bool "UICR.SECONDARY.PERIPHCONF" + default y + depends on $(dt_nodelabel_enabled,secondary_periphconf_partition) + help + When enabled, the UICR generator will configure the location + of the peripheral configuration data for the secondary firmware, + based on the secondary_periphconf_partition in device tree. + config GEN_UICR_SECONDARY_GENERATE_PERIPHCONF bool "Generate SECONDARY.PERIPHCONF hex alongside UICR" default y + depends on GEN_UICR_SECONDARY_PERIPHCONF help When enabled, the UICR generator will populate the secondary_periphconf_partition partition. @@ -272,6 +311,25 @@ config GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES Size of the secondary protected memory region in bytes. This value must be divisible by 4096 (4 kiB). +config GEN_UICR_SECONDARY_MPCCONF + bool "UICR.SECONDARY.MPCCONF" + depends on $(dt_nodelabel_enabled,secondary_mpcconf_partition) + help + When enabled, the UICR generator will configure the location + of the MPC configuration data for the secondary firmware, + based on the secondary_mpcconf_partition in device tree. + + Enabling this option causes the generated UICR format version to be set + to >= 2.2, which requires IronSide SE v23.4.0+27 or higher to be installed. + +config GEN_UICR_SECONDARY_GENERATE_MPCCONF + bool "Generate SECONDARY.MPCCONF hex alongside UICR" + default y + depends on GEN_UICR_SECONDARY_MPCCONF + help + When enabled, the UICR generator will populate the + secondary_mpcconf_partition partition. + endif # GEN_UICR_SECONDARY choice GEN_UICR_POLICY_PERIPHCONF_STAGE @@ -305,4 +363,34 @@ config GEN_UICR_POLICY_PERIPHCONF_STAGE_VALUE default 0x1730C77F if GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL default 0 +choice GEN_UICR_POLICY_MPCCONF_STAGE + bool "UICR.POLICY_MPCCONFSTAGE" + default GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL + help + Sets the behavior of the IronSide SE MPCCONF service APIs at boot. + +config GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL + bool "Normal operation stage" + help + The API starts in the normal operation stage, meaning that no explicit + API call is needed to finish initialization. + +config GEN_UICR_POLICY_MPCCONF_STAGE_INIT + bool "Initialization stage" + help + The API starts in the initialization stage, which gives permission + to update the global domain MPC configuration. To finish initialization, + the application must notify IronSide SE via the ironside_se_mpcconf_finish_init() API. + + Enabling this policy option causes the generated UICR format version to be set + to >= 2.2, which requires IronSide SE v23.4.0+27 or higher to be installed. + +endchoice + +config GEN_UICR_POLICY_MPCCONF_STAGE_VALUE + hex + default 0xBD2328A8 if GEN_UICR_POLICY_MPCCONF_STAGE_INIT + default 0x1730C77F if GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL + default 0 + endmenu diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 81b5c59c63bd..5f65b9012efe 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -80,14 +80,19 @@ set(eraseprotect_args) set(approtect_args) set(protectedmem_args) set(periphconf_args) +set(mpcconf_args) set(wdtstart_args) set(periphconf_elfs) +set(mpcconf_elfs) set(policy_args) set(merged_hex_file ${APPLICATION_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.hex) set(secondary_periphconf_elfs) +set(secondary_mpcconf_elfs) set(uicr_hex_file ${APPLICATION_BINARY_DIR}/zephyr/uicr.hex) set(periphconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/periphconf.hex) set(secondary_periphconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/secondary_periphconf.hex) +set(mpcconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/mpcconf.hex) +set(secondary_mpcconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/secondary_mpcconf.hex) # Get UICR absolute address from this image's devicetree dt_nodelabel(uicr_path NODELABEL "uicr" REQUIRED) @@ -155,7 +160,28 @@ if(CONFIG_GEN_UICR_WDTSTART) list(APPEND wdtstart_args --wdtstart-crv ${CONFIG_GEN_UICR_WDTSTART_CRV}) endif() -if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) +if(CONFIG_GEN_UICR_MPCCONF) + list(APPEND mpcconf_args --mpcconf) + + # Compute MPCCONF absolute address and size from this image's devicetree + compute_partition_address_and_size("mpcconf_partition" MPCCONF_ADDRESS MPCCONF_SIZE) + + list(APPEND mpcconf_args --mpcconf-address ${MPCCONF_ADDRESS}) + list(APPEND mpcconf_args --mpcconf-size ${MPCCONF_SIZE}) +endif() + +if(CONFIG_GEN_UICR_PERIPHCONF) + list(APPEND periphconf_args --periphconf) + + # Compute PERIPHCONF absolute address and size from this image's devicetree + compute_partition_address_and_size("periphconf_partition" PERIPHCONF_ADDRESS PERIPHCONF_SIZE) + + list(APPEND periphconf_args --periphconf-address ${PERIPHCONF_ADDRESS}) + list(APPEND periphconf_args --periphconf-size ${PERIPHCONF_SIZE}) +endif() + +if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF OR CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF OR + CONFIG_GEN_UICR_GENERATE_MPCCONF OR CONFIG_GEN_UICR_SECONDARY_GENERATE_MPCCONF) # gen_uicr.py parses all zephyr.elf files. To find these files (which # have not been built yet) we scan sibling build directories for # zephyr.dts @@ -176,6 +202,9 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) continue() endif() + parse_kconfig_value(${_dir}/zephyr/.config CONFIG_NRF_PERIPHCONF_SECTION has_periphconf) + parse_kconfig_value(${_dir}/zephyr/.config CONFIG_NRF_MPCCONF_SECTION has_mpcconf) + # Read CONFIG_KERNEL_BIN_NAME from the sibling's .config file parse_kconfig_value(${_dir}/zephyr/.config CONFIG_KERNEL_BIN_NAME kernel_bin_name) set(kernel_elf_path ${_dir}/zephyr/${kernel_bin_name}.elf) @@ -183,25 +212,40 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) # Check if this is secondary firmware by reading the Kconfig from .config parse_kconfig_value(${_dir}/zephyr/.config CONFIG_IS_IRONSIDE_SE_SECONDARY_IMAGE is_secondary) if(is_secondary STREQUAL "y") - list(APPEND secondary_periphconf_elfs ${kernel_elf_path}) + if(has_periphconf) + list(APPEND secondary_periphconf_elfs ${kernel_elf_path}) + endif() + if(has_mpcconf) + list(APPEND secondary_mpcconf_elfs ${kernel_elf_path}) + endif() else() - list(APPEND periphconf_elfs ${kernel_elf_path}) + if(has_periphconf) + list(APPEND periphconf_elfs ${kernel_elf_path}) + endif() + if(has_mpcconf) + list(APPEND mpcconf_elfs ${kernel_elf_path}) + endif() endif() endif() endforeach() - # Compute PERIPHCONF absolute address and size from this image's devicetree - compute_partition_address_and_size("periphconf_partition" PERIPHCONF_ADDRESS PERIPHCONF_SIZE) + if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) + # Set up periphconf arguments for gen_uicr.py + list(APPEND periphconf_args --out-periphconf-hex ${periphconf_hex_file}) - # Set up periphconf arguments for gen_uicr.py - list(APPEND periphconf_args --periphconf-address ${PERIPHCONF_ADDRESS}) - list(APPEND periphconf_args --periphconf-size ${PERIPHCONF_SIZE}) - list(APPEND periphconf_args --out-periphconf-hex ${periphconf_hex_file}) + foreach(elf ${periphconf_elfs}) + list(APPEND periphconf_args --in-periphconf-elf ${elf}) + endforeach() + endif() + if(CONFIG_GEN_UICR_GENERATE_MPCCONF) + # Set up mpcconf arguments for gen_uicr.py + list(APPEND mpcconf_args --out-mpcconf-hex ${mpcconf_hex_file}) - foreach(elf ${periphconf_elfs}) - list(APPEND periphconf_args --in-periphconf-elf ${elf}) - endforeach() -endif(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) + foreach(elf ${mpcconf_elfs}) + list(APPEND mpcconf_args --in-mpcconf-elf ${elf}) + endforeach() + endif() +endif() if(CONFIG_GEN_UICR_SECONDARY) set(secondary_args --secondary) @@ -254,24 +298,52 @@ if(CONFIG_GEN_UICR_SECONDARY) list(APPEND secondary_args --secondary-protectedmem-size ${CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES}) endif() - if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) + # Handle secondary MPCCONF configuration + if(CONFIG_GEN_UICR_SECONDARY_MPCCONF) + list(APPEND secondary_args --secondary-mpcconf) + + # Compute SECONDARY_MPCCONF absolute address and size from this image's devicetree + compute_partition_address_and_size("secondary_mpcconf_partition" SECONDARY_MPCCONF_ADDRESS SECONDARY_MPCCONF_SIZE) + + list(APPEND secondary_args --secondary-mpcconf-address ${SECONDARY_MPCCONF_ADDRESS}) + list(APPEND secondary_args --secondary-mpcconf-size ${SECONDARY_MPCCONF_SIZE}) + endif() + + # Handle secondary PERIPHCONF configuration + if(CONFIG_GEN_UICR_SECONDARY_PERIPHCONF) + list(APPEND secondary_args --secondary-periphconf) + # Compute SECONDARY_PERIPHCONF absolute address and size from this image's devicetree compute_partition_address_and_size("secondary_periphconf_partition" SECONDARY_PERIPHCONF_ADDRESS SECONDARY_PERIPHCONF_SIZE) list(APPEND secondary_args --secondary-periphconf-address ${SECONDARY_PERIPHCONF_ADDRESS}) list(APPEND secondary_args --secondary-periphconf-size ${SECONDARY_PERIPHCONF_SIZE}) + endif() + + if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) list(APPEND secondary_args --out-secondary-periphconf-hex ${secondary_periphconf_hex_file}) foreach(elf ${secondary_periphconf_elfs}) list(APPEND secondary_args --in-secondary-periphconf-elf ${elf}) endforeach() endif() + if(CONFIG_GEN_UICR_SECONDARY_GENERATE_MPCCONF) + list(APPEND secondary_args --out-secondary-mpcconf-hex ${secondary_mpcconf_hex_file}) + + foreach(elf ${secondary_mpcconf_elfs}) + list(APPEND secondary_args --in-secondary-mpcconf-elf ${elf}) + endforeach() + endif() endif() if(CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL) list(APPEND policy_args --policy-periphconf-stage ${CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_VALUE}) endif() +if(CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL) + list(APPEND policy_args --policy-mpcconf-stage ${CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_VALUE}) +endif() + # Generate hex files (merged, uicr-only, periphconf-only, and secondary-periphconf-only) add_custom_command( OUTPUT ${merged_hex_file} ${uicr_hex_file} ${periphconf_hex_file} ${secondary_periphconf_hex_file} @@ -281,11 +353,13 @@ add_custom_command( --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} --periphconf-section-name "periphconf_entry" + --mpcconf-section-name "mpcconf_entry" --periphconf-ipcmap-reallocate ${lock_args} ${eraseprotect_args} ${approtect_args} ${wdtstart_args} + ${mpcconf_args} ${periphconf_args} ${securestorage_args} ${protectedmem_args} From a7eaad25194b933ea9a393a24fb21058dc279b06 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Thu, 19 Feb 2026 20:39:09 +0100 Subject: [PATCH 1954/3334] [nrf fromlist] modules: hal_nordic: ironside: integrate minimal IronSide call driver Upstream PR #: 104759 Integrate support for a minimal driver for IronSide SE IPC which is thread-unsafe, uses busy waiting, and assumes that the IPC region is uncached. The driver is included in the IronSide interface code itself, and is enabled by defining IRONSIDE_SE_CALL_MINIMAL. This is primarily intended to be used by MCUboot but can be used by e.g. resource constrained single-threaded firmware. Signed-off-by: Jonathan Nilsen (cherry picked from commit b529e3e1ec4bdbe8c060e0899beaf18e11e1466b) --- modules/hal_nordic/ironside/se/CMakeLists.txt | 4 ++- modules/hal_nordic/ironside/se/Kconfig | 36 +++++++++++++++++-- .../se/include/ironside_zephyr/se/glue_impl.h | 15 ++++++++ .../common/nrf54hx_nrf92x_mpu_regions.c | 5 +++ soc/nordic/nrf54h/Kconfig | 2 ++ soc/nordic/nrf92/Kconfig | 2 ++ 6 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index a4c3c66aa8fe..ee5b2be8e2fa 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -10,9 +10,11 @@ zephyr_library() zephyr_library_property(ALLOW_EMPTY TRUE) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL ${IRONSIDE_SUPPORT_DIR}/se/src/ironside_se_api.c - call.c glue.c ) +zephyr_library_compile_definitions(IRONSIDE_SE_GLUE_EXT_FILE_PATH="ironside_zephyr/se/glue_impl.h") +zephyr_library_compile_definitions_ifdef(CONFIG_IRONSIDE_SE_CALL_MINIMAL IRONSIDE_SE_CALL_MINIMAL=1) +zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL_ZEPHYR call.c) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c) if(CONFIG_NRF_PERIPHCONF_SECTION OR CONFIG_NRF_MPCCONF_SECTION) diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index 80598be0b89a..a387e4312aba 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -4,24 +4,56 @@ config HAS_IRONSIDE_SE bool +config HAS_IRONSIDE_SE_CALL + bool + menu "IronSide SE" depends on HAS_IRONSIDE_SE config IRONSIDE_SE_CALL bool "IronSide calls" default y + depends on HAS_IRONSIDE_SE_CALL + help + Support for IronSide call APIs. + +if IRONSIDE_SE_CALL + +choice IRONSIDE_SE_CALL_DRIVER + prompt "IronSide calls driver implementation" + default IRONSIDE_SE_CALL_ZEPHYR if DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED + default IRONSIDE_SE_CALL_MINIMAL + help + Driver implementation used for IronSide calls. + +config IRONSIDE_SE_CALL_ZEPHYR + bool "Zephyr driver" depends on DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED depends on MULTITHREADING select EVENTS select MBOX help - Support for IronSide call APIs. + Use the default driver for IronSide calls which supports concurrent + calls being made from different threads. This is the recommended implementation + and should be used in most applications. -if IRONSIDE_SE_CALL +config IRONSIDE_SE_CALL_MINIMAL + bool "Minimal driver" + help + Use the minimal driver for IronSide calls, which is included with the + IronSide APIs. This driver does not support concurrent calls from different + threads, and uses busy waiting instead of interrupts when waiting for a + reply from IronSide SE. It also does not perform data cache handling for the IPC + buffer, and instead assumes that the IPC buffer area is not cached. + This option is primarily intended for constrained applications such as bootloaders + and is not recommended for general use. + +endchoice config IRONSIDE_SE_CALL_INIT_PRIORITY int "IronSide calls' driver initialization priority" default 41 + depends on IRONSIDE_SE_CALL_ZEPHYR help Initialization priority of the IronSide call protocol driver. It must be below MBOX_INIT_PRIORITY, but higher than the priority of any feature diff --git a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h new file mode 100644 index 000000000000..f5fad7cbd2d0 --- /dev/null +++ b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ +#define ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ + +#include + +#ifndef IRONSIDE_SE_ALWAYS_INLINE +#define IRONSIDE_SE_ALWAYS_INLINE ALWAYS_INLINE +#endif + +#endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ */ diff --git a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c index 83c778928e3f..303fdf8ac8ae 100644 --- a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c +++ b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c @@ -53,6 +53,11 @@ static struct arm_mpu_region mpu_regions[] = { MPU_REGION_ENTRY("EVENT_REPORT", IRONSIDE_SE_EVENT_REPORT_ADDRESS, REGION_RAM_NOCACHE_ATTR(IRONSIDE_SE_EVENT_REPORT_ADDRESS, IRONSIDE_SE_EVENT_REPORT_SIZE)), +#if defined(CONFIG_IRONSIDE_SE_CALL_MINIMAL) + MPU_REGION_ENTRY("IRONSIDE_IPC", IRONSIDE_SE_IPC_BUFFER_ADDRESS, + REGION_RAM_NOCACHE_ATTR(IRONSIDE_SE_IPC_BUFFER_ADDRESS, + IRONSIDE_SE_IPC_BUFFER_SIZE)), +#endif }; const struct arm_mpu_config mpu_config = { diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index a3f6d83e6e28..d486d13935ec 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -40,6 +40,7 @@ config SOC_NRF54H20_CPUAPP_COMMON select HAS_PM select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF + select HAS_IRONSIDE_SE_CALL config SOC_NRF54H20_CPUAPP select SOC_NRF54H20_CPUAPP_COMMON @@ -69,6 +70,7 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_NORDIC_RAM_CTRL select HAS_PM select HAS_POWEROFF + select HAS_IRONSIDE_SE_CALL config SOC_NRF54H20_CPURAD_ENABLE bool "Boot the nRF54H20 Radio core" diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index 86978d745665..dd16a354ea1a 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -34,6 +34,7 @@ config SOC_NRF9230_ENGB_CPUAPP select NRFS_HAS_TEMP_SERVICE select NRFS_HAS_VBUS_DETECTOR_SERVICE select NRFS_TEMP_SERVICE_HAS_SUBSCRIPTION_SERVICE + select HAS_IRONSIDE_SE_CALL config SOC_NRF9230_ENGB_CPURAD select ARM @@ -53,6 +54,7 @@ config SOC_NRF9230_ENGB_CPURAD select NRFS_HAS_PMIC_SERVICE select NRFS_HAS_TEMP_SERVICE select NRFS_TEMP_SERVICE_HAS_SUBSCRIPTION_SERVICE + select HAS_IRONSIDE_SE_CALL config SOC_NRF9230_ENGB_CPUPPR select RISCV_CORE_NORDIC_VPR From 942239a1d9430e719ae74bbe5673050c64b3475c Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Sun, 1 Mar 2026 12:57:51 +0100 Subject: [PATCH 1955/3334] [nrf fromlist] modules: hal_nordic: ironside: Add NRF_MPCCONF_API_IN_RAM Upstream PR #: 104759 Add an option for calling the MPCCONF service from RAM, by plugging in the `__ramfunc` attribute via IronSide SE support package's glue layer. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 7e7e37c5b2f9044cf4a8845df06ca86f4c09b471) --- modules/hal_nordic/ironside/se/Kconfig | 12 ++++++++++++ .../se/include/ironside_zephyr/se/glue_impl.h | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index a387e4312aba..92b639667a9d 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -138,4 +138,16 @@ config NRF_PERIPHCONF_SECTION_KEEP_BY_DEFAULT CONFIG_NRF_PERIPHCONF_SECTION_STRIP=n unless explicitly configured otherwise. To override this behavior, set CONFIG_NRF_PERIPHCONF_SECTION_STRIP=y directly. +config NRF_MPCCONF_API_IN_RAM + bool "MPCCONF API in RAM" + depends on IRONSIDE_SE_CALL + depends on !IRONSIDE_SE_CALL_ZEPHYR || !XIP + help + Ensure that the functions used to modify and lock the MPC configuration + - namely, ironside_se_mpcconf_write() and ironside_se_mpcconf_finish_init() - + are placed in RAM. This may be needed to reconfigure permissions for XIP memory. + + This is not supported with the default IronSide call driver in Zephyr, + unless it and all of its dependencies are also relocated to be executed from RAM. + endmenu # IronSide SE diff --git a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h index f5fad7cbd2d0..2bade715cf42 100644 --- a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h +++ b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h @@ -12,4 +12,10 @@ #define IRONSIDE_SE_ALWAYS_INLINE ALWAYS_INLINE #endif +#if defined(CONFIG_NRF_MPCCONF_API_IN_RAM) +/* Place MPCCONF APIs in RAM by plugging in function attributes. */ +#define IRONSIDE_SE_MPCCONF_WRITE_FUNC_ATTR __ramfunc +#define IRONSIDE_SE_MPCCONF_FINISH_INIT_FUNC_ATTR __ramfunc +#endif + #endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ */ From 2d01f414568b9f04a54b25d1a9eae736fa2fd340 Mon Sep 17 00:00:00 2001 From: Aleksandr Mirlenko Date: Fri, 6 Mar 2026 11:59:04 +0100 Subject: [PATCH 1956/3334] Revert "[nrf fromtree] bluetooth: host: add support for CS IPT procedures" The commit to be reverted has broken downstream CI jobs. This reverts commit 6d937d80f879591f18d34465aa99bc78544d120c. Signed-off-by: Aleksandr Mirlenko --- include/zephyr/bluetooth/conn.h | 23 -- include/zephyr/bluetooth/cs.h | 45 +--- include/zephyr/bluetooth/hci_types.h | 178 +------------- subsys/bluetooth/host/cs.c | 350 +-------------------------- subsys/bluetooth/host/hci_core.c | 19 +- subsys/bluetooth/host/hci_core.h | 1 - 6 files changed, 20 insertions(+), 596 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 9bef1df7dc0c..50d68d58ef23 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -675,24 +675,6 @@ struct bt_conn_le_cs_capabilities { * - Bit 4: 30dB */ uint8_t tx_snr_capability; - /** Supported T_IP2_IPT time durations during CS steps. - * - * - Bit 0: 10 us - * - Bit 1: 20 us - * - Bit 2: 30 us - * - Bit 3: 40 us - * - Bit 4: 50 us - * - Bit 5: 60 us - * - Bit 6: 80 us - */ - uint16_t t_ip2_ipt_times_supported; - /** Supported time in microseconds for the antenna switch period of the - * CS tones during IPT. - * - * 0x00, 0x01, 0x02, 0x04, or 0x0A - Time in microseconds for the - * antenna switch period of the CS tones - */ - uint8_t t_sw_ipt_time_supported; }; /** Remote FAE Table for LE connections supporting CS */ @@ -843,11 +825,6 @@ struct bt_conn_le_cs_config { enum bt_conn_le_cs_ch3c_shape ch3c_shape; /** Number of channels skipped in each rising and falling sequence */ uint8_t ch3c_jump; - /** CS enhancements 1 - * Bit 0 - IPT is enabled in the CS reflector. - * All other bits are reserved and shall be set to 0. - */ - uint8_t cs_enhancements_1; /** Interlude time in microseconds between the RTT packets */ uint8_t t_ip1_time_us; /** Interlude time in microseconds between the CS tones */ diff --git a/include/zephyr/bluetooth/cs.h b/include/zephyr/bluetooth/cs.h index 601d51e10023..06450c96201d 100644 --- a/include/zephyr/bluetooth/cs.h +++ b/include/zephyr/bluetooth/cs.h @@ -498,12 +498,6 @@ struct bt_le_cs_create_config_params { enum bt_conn_le_cs_rtt_type rtt_type; /** CS Sync PHY */ enum bt_conn_le_cs_sync_phy cs_sync_phy; - /** Channel map used for CS procedure - * Channels n = 0, 1, 23, 24, 25, 77, and 78 are not allowed and shall be set to zero. - * Channel 79 is reserved for future use and shall be set to zero. - * At least 15 channels shall be enabled. - */ - uint8_t channel_map[10]; /** The number of times the Channel_Map field will be cycled through for non-mode-0 steps * within a CS procedure */ @@ -514,8 +508,12 @@ struct bt_le_cs_create_config_params { enum bt_conn_le_cs_ch3c_shape ch3c_shape; /** Number of channels skipped in each rising and falling sequence */ uint8_t ch3c_jump; - /** CS enhancements 1 */ - uint8_t cs_enhancements_1; + /** Channel map used for CS procedure + * Channels n = 0, 1, 23, 24, 25, 77, and 78 are not allowed and shall be set to zero. + * Channel 79 is reserved for future use and shall be set to zero. + * At least 15 channels shall be enabled. + */ + uint8_t channel_map[10]; }; /** Callbacks for CS Test */ @@ -667,7 +665,7 @@ int bt_le_cs_start_test(const struct bt_le_cs_test_param *params); int bt_le_cs_create_config(struct bt_conn *conn, struct bt_le_cs_create_config_params *params, enum bt_le_cs_create_config_context context); -/** @brief Remove CS configuration +/** @brief Create CS configuration * * This command is used to remove a CS configuration from the local controller * identified by the config_id @@ -854,19 +852,6 @@ int bt_le_cs_set_channel_classification(uint8_t channel_classification[10]); */ int bt_le_cs_read_local_supported_capabilities(struct bt_conn_le_cs_capabilities *ret); -/** @brief CS Read Local Supported Capabilities V2 - * - * This command is used to read the CS capabilities that are supported - * by the local Controller. - * - * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set. - * - * @param ret Return values for the CS Procedure Enable command. - * - * @return Zero on success or (negative) error code on failure. - */ -int bt_le_cs_read_local_supported_capabilities_v2(struct bt_conn_le_cs_capabilities *ret); - /** @brief CS Write Cached Remote Supported Capabilities * * This command is used to write the cached copy of the CS capabilities @@ -883,22 +868,6 @@ int bt_le_cs_read_local_supported_capabilities_v2(struct bt_conn_le_cs_capabilit int bt_le_cs_write_cached_remote_supported_capabilities( struct bt_conn *conn, const struct bt_conn_le_cs_capabilities *params); -/** @brief CS Write Cached Remote Supported Capabilities V2 - * - * This command is used to write the cached copy of the CS capabilities - * that are supported by the remote Controller for the connection - * identified. - * - * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set. - * - * @param conn Connection Object. - * @param params Parameters for the CS Write Cached Remote Supported Capabilities command. - * - * @return Zero on success or (negative) error code on failure. - */ -int bt_le_cs_write_cached_remote_supported_capabilities_v2( - struct bt_conn *conn, const struct bt_conn_le_cs_capabilities *params); - /** @brief CS Write Cached Remote FAE Table * * This command is used to write a cached copy of the per-channel mode-0 diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index 4ebd0ad59ad1..ce2aa428fa5a 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -2626,62 +2626,6 @@ struct bt_hci_rp_le_read_local_supported_capabilities { uint8_t tx_snr_capability; } __packed; -/** HCI opcode for LE Read Local Supported Capabilities (v2). */ -#define BT_HCI_OP_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_V2 BT_OP(BT_OGF_LE, 0x00A5) /* 0x20A5 */ -/** Test if LE Read Local Supported Capabilities v2 command is supported (octet 49, bit 2). */ -#define BT_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_V2_SUPPORTED(cmd) \ - BT_CMD_TEST(cmd, 49, 2) - -/** HCI response parameters for LE Read Local Supported Capabilities command (v2). */ -struct bt_hci_rp_le_read_local_supported_capabilities_v2 { - /** Status. */ - uint8_t status; - /** Number of CS configurations supported. */ - uint8_t num_config_supported; - /** Maximum consecutive procedures supported. */ - uint16_t max_consecutive_procedures_supported; - /** Number of antennas supported. */ - uint8_t num_antennas_supported; - /** Maximum antenna paths supported. */ - uint8_t max_antenna_paths_supported; - /** Roles supported. */ - uint8_t roles_supported; - /** Modes supported. */ - uint8_t modes_supported; - /** RTT capability. */ - uint8_t rtt_capability; - /** RTT AA-only N. */ - uint8_t rtt_aa_only_n; - /** RTT sounding N. */ - uint8_t rtt_sounding_n; - /** RTT random payload N. */ - uint8_t rtt_random_payload_n; - /** NADM sounding capability. */ - uint16_t nadm_sounding_capability; - /** NADM random capability. */ - uint16_t nadm_random_capability; - /** CS sync PHYs supported. */ - uint8_t cs_sync_phys_supported; - /** Subfeatures supported. */ - uint16_t subfeatures_supported; - /** T_IP1 times supported. */ - uint16_t t_ip1_times_supported; - /** T_IP2 times supported. */ - uint16_t t_ip2_times_supported; - /** T_FCS times supported. */ - uint16_t t_fcs_times_supported; - /** T_PM times supported. */ - uint16_t t_pm_times_supported; - /** T_SW time supported. */ - uint8_t t_sw_time_supported; - /** TX SNR capability. */ - uint8_t tx_snr_capability; - /** T_IP2 IPT times supported. */ - uint16_t t_ip2_ipt_times_supported; - /** T_SW IPT time supported. */ - uint8_t t_sw_ipt_time_supported; -} __packed; - #define BT_HCI_OP_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES BT_OP(BT_OGF_LE, 0x008A) /* 0x208A */ struct bt_hci_cp_le_read_remote_supported_capabilities { @@ -2715,60 +2659,6 @@ struct bt_hci_cp_le_write_cached_remote_supported_capabilities { uint8_t tx_snr_capability; } __packed; -/** HCI opcode for LE CS Write Cached Remote Supported Capabilities (v2). */ -#define BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_V2 \ - BT_OP(BT_OGF_LE, 0x00A6) /* 0x20A6 */ - -/** HCI command parameters for LE CS Write Cached Remote Supported Capabilities (v2). */ -struct bt_hci_cp_le_write_cached_remote_supported_capabilities_v2 { - /** Connection handle. */ - uint16_t handle; - /** Number of CS configurations supported. */ - uint8_t num_config_supported; - /** Maximum consecutive procedures supported. */ - uint16_t max_consecutive_procedures_supported; - /** Number of antennas supported. */ - uint8_t num_antennas_supported; - /** Maximum antenna paths supported. */ - uint8_t max_antenna_paths_supported; - /** Roles supported. */ - uint8_t roles_supported; - /** Modes supported. */ - uint8_t modes_supported; - /** RTT capability. */ - uint8_t rtt_capability; - /** RTT AA-only N. */ - uint8_t rtt_aa_only_n; - /** RTT sounding N. */ - uint8_t rtt_sounding_n; - /** RTT random payload N. */ - uint8_t rtt_random_payload_n; - /** NADM sounding capability. */ - uint16_t nadm_sounding_capability; - /** NADM random capability. */ - uint16_t nadm_random_capability; - /** CS sync PHYs supported. */ - uint8_t cs_sync_phys_supported; - /** Subfeatures supported. */ - uint16_t subfeatures_supported; - /** T_IP1 times supported. */ - uint16_t t_ip1_times_supported; - /** T_IP2 times supported. */ - uint16_t t_ip2_times_supported; - /** T_FCS times supported. */ - uint16_t t_fcs_times_supported; - /** T_PM times supported. */ - uint16_t t_pm_times_supported; - /** T_SW time supported. */ - uint8_t t_sw_time_supported; - /** TX SNR capability. */ - uint8_t tx_snr_capability; - /** T_IP2 IPT times supported. */ - uint16_t t_ip2_ipt_times_supported; - /** T_SW IPT time supported. */ - uint8_t t_sw_ipt_time_supported; -} __packed; - #define BT_HCI_OP_LE_CS_SECURITY_ENABLE BT_OP(BT_OGF_LE, 0x008C) /* 0x208C */ struct bt_hci_cp_le_security_enable { @@ -2975,8 +2865,7 @@ struct bt_hci_op_le_cs_test { uint8_t t_pm_time; uint8_t t_sw_time; uint8_t tone_antenna_config_selection; - /** CS enhancements 1. */ - uint8_t cs_enhancements_1; + uint8_t reserved; uint8_t snr_control_initiator; uint8_t snr_control_reflector; uint16_t drbg_nonce; @@ -3006,8 +2895,7 @@ struct bt_hci_cp_le_cs_create_config { uint8_t channel_selection_type; uint8_t ch3c_shape; uint8_t ch3c_jump; - /** CS enhancements 1. */ - uint8_t cs_enhancements_1; + uint8_t reserved; } __packed; #define BT_HCI_OP_LE_CS_REMOVE_CONFIG BT_OP(BT_OGF_LE, 0x0091) /* 0x2091 */ @@ -3983,7 +3871,6 @@ struct bt_hci_evt_le_read_all_remote_feat_complete { #define BT_HCI_LE_CS_TX_SNR_CAPABILITY_30DB_MASK BIT(4) #define BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE 0x2C - struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete { uint8_t status; uint16_t conn_handle; @@ -4009,61 +3896,6 @@ struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete { uint8_t tx_snr_capability; } __packed; -/** HCI LE CS Read Remote Supported Capabilities Complete event (v2). */ -#define BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_V2 0x38 - -/** HCI event parameters for LE CS Read Remote Supported Capabilities Complete (v2). */ -struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete_v2 { - /** Status. */ - uint8_t status; - /** Connection handle. */ - uint16_t conn_handle; - /** Number of CS configurations supported. */ - uint8_t num_config_supported; - /** Maximum consecutive procedures supported. */ - uint16_t max_consecutive_procedures_supported; - /** Number of antennas supported. */ - uint8_t num_antennas_supported; - /** Maximum antenna paths supported. */ - uint8_t max_antenna_paths_supported; - /** Roles supported. */ - uint8_t roles_supported; - /** Modes supported. */ - uint8_t modes_supported; - /** RTT capability. */ - uint8_t rtt_capability; - /** RTT AA-only N. */ - uint8_t rtt_aa_only_n; - /** RTT sounding N. */ - uint8_t rtt_sounding_n; - /** RTT random payload N. */ - uint8_t rtt_random_payload_n; - /** NADM sounding capability. */ - uint16_t nadm_sounding_capability; - /** NADM random capability. */ - uint16_t nadm_random_capability; - /** CS sync PHYs supported. */ - uint8_t cs_sync_phys_supported; - /** Subfeatures supported. */ - uint16_t subfeatures_supported; - /** T_IP1 times supported. */ - uint16_t t_ip1_times_supported; - /** T_IP2 times supported. */ - uint16_t t_ip2_times_supported; - /** T_FCS times supported. */ - uint16_t t_fcs_times_supported; - /** T_PM times supported. */ - uint16_t t_pm_times_supported; - /** T_SW time supported. */ - uint8_t t_sw_time_supported; - /** TX SNR capability. */ - uint8_t tx_snr_capability; - /** T_IP2 IPT times supported. */ - uint16_t t_ip2_ipt_times_supported; - /** T_SW IPT time supported. */ - uint8_t t_sw_ipt_time_supported; -} __packed; - #define BT_HCI_EVT_LE_CS_READ_REMOTE_FAE_TABLE_COMPLETE 0x2D struct bt_hci_evt_le_cs_read_remote_fae_table_complete { uint8_t status; @@ -4100,8 +3932,7 @@ struct bt_hci_evt_le_cs_config_complete { uint8_t channel_selection_type; uint8_t ch3c_shape; uint8_t ch3c_jump; - /** CS enhancements 1. */ - uint8_t cs_enhancements_1; + uint8_t reserved; uint8_t t_ip1_time; uint8_t t_ip2_time; uint8_t t_fcs_time; @@ -4492,9 +4323,6 @@ struct bt_hci_evt_le_conn_rate_change { #define BT_EVT_MASK_LE_FRAME_SPACE_UPDATE_COMPLETE BT_EVT_BIT(52) #define BT_EVT_MASK_LE_CONN_RATE_CHANGE BT_EVT_BIT(54) -/** Event mask for LE CS Read Remote Supported Capabilities Complete (v2). */ -#define BT_EVT_MASK_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_V2 BT_EVT_BIT(55) - /** HCI Error Codes, BT Core Spec v5.4 [Vol 1, Part F]. */ #define BT_HCI_ERR_SUCCESS 0x00 #define BT_HCI_ERR_UNKNOWN_CMD 0x01 diff --git a/subsys/bluetooth/host/cs.c b/subsys/bluetooth/host/cs.c index c676a9a477f4..1098aba9e8d2 100644 --- a/subsys/bluetooth/host/cs.c +++ b/subsys/bluetooth/host/cs.c @@ -425,9 +425,6 @@ void bt_hci_le_cs_read_remote_supported_capabilities_complete(struct net_buf *bu remote_cs_capabilities.t_sw_time = evt->t_sw_time_supported; remote_cs_capabilities.tx_snr_capability = evt->tx_snr_capability; - remote_cs_capabilities.t_ip2_ipt_times_supported = 0; - remote_cs_capabilities.t_sw_ipt_time_supported = 0; - bt_conn_notify_remote_cs_capabilities(conn, BT_HCI_ERR_SUCCESS, &remote_cs_capabilities); } else { @@ -437,139 +434,6 @@ void bt_hci_le_cs_read_remote_supported_capabilities_complete(struct net_buf *bu bt_conn_unref(conn); } -void bt_hci_le_cs_read_remote_supported_capabilities_complete_v2(struct net_buf *buf) -{ - struct bt_conn *conn; - struct bt_conn_le_cs_capabilities remote_cs_capabilities; - struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete_v2 *evt; - - if (buf->len < sizeof(*evt)) { - LOG_ERR("Unexpected end of buffer"); - return; - } - - evt = net_buf_pull_mem(buf, sizeof(*evt)); - if (evt->status) { - LOG_WRN("Read Remote Supported Capabilities failed (status 0x%02X)", evt->status); - } - - conn = bt_conn_lookup_handle(sys_le16_to_cpu(evt->conn_handle), BT_CONN_TYPE_LE); - if (!conn) { - LOG_ERR("Could not lookup connection handle when reading remote CS capabilities"); - return; - } - - if (evt->status != BT_HCI_ERR_SUCCESS) { - bt_conn_notify_remote_cs_capabilities(conn, evt->status, NULL); - goto out; - } - - remote_cs_capabilities.num_config_supported = evt->num_config_supported; - remote_cs_capabilities.max_consecutive_procedures_supported = - sys_le16_to_cpu(evt->max_consecutive_procedures_supported); - remote_cs_capabilities.num_antennas_supported = evt->num_antennas_supported; - remote_cs_capabilities.max_antenna_paths_supported = - evt->max_antenna_paths_supported; - - remote_cs_capabilities.initiator_supported = - evt->roles_supported & BT_HCI_LE_CS_INITIATOR_ROLE_MASK; - remote_cs_capabilities.reflector_supported = - evt->roles_supported & BT_HCI_LE_CS_REFLECTOR_ROLE_MASK; - remote_cs_capabilities.mode_3_supported = - evt->modes_supported & BT_HCI_LE_CS_MODES_SUPPORTED_MODE_3_MASK; - - remote_cs_capabilities.rtt_aa_only_n = evt->rtt_aa_only_n; - remote_cs_capabilities.rtt_sounding_n = evt->rtt_sounding_n; - remote_cs_capabilities.rtt_random_payload_n = evt->rtt_random_payload_n; - - if (evt->rtt_aa_only_n) { - if (evt->rtt_capability & BT_HCI_LE_CS_RTT_AA_ONLY_N_10NS_MASK) { - remote_cs_capabilities.rtt_aa_only_precision = - BT_CONN_LE_CS_RTT_AA_ONLY_10NS; - } else { - remote_cs_capabilities.rtt_aa_only_precision = - BT_CONN_LE_CS_RTT_AA_ONLY_150NS; - } - } else { - remote_cs_capabilities.rtt_aa_only_precision = - BT_CONN_LE_CS_RTT_AA_ONLY_NOT_SUPP; - } - - if (evt->rtt_sounding_n) { - if (evt->rtt_capability & BT_HCI_LE_CS_RTT_SOUNDING_N_10NS_MASK) { - remote_cs_capabilities.rtt_sounding_precision = - BT_CONN_LE_CS_RTT_SOUNDING_10NS; - } else { - remote_cs_capabilities.rtt_sounding_precision = - BT_CONN_LE_CS_RTT_SOUNDING_150NS; - } - } else { - remote_cs_capabilities.rtt_sounding_precision = - BT_CONN_LE_CS_RTT_SOUNDING_NOT_SUPP; - } - - if (evt->rtt_random_payload_n) { - if (evt->rtt_capability & BT_HCI_LE_CS_RTT_RANDOM_PAYLOAD_N_10NS_MASK) { - remote_cs_capabilities.rtt_random_payload_precision = - BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS; - } else { - remote_cs_capabilities.rtt_random_payload_precision = - BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_150NS; - } - } else { - remote_cs_capabilities.rtt_random_payload_precision = - BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_NOT_SUPP; - } - - remote_cs_capabilities.phase_based_nadm_sounding_supported = - sys_le16_to_cpu(evt->nadm_sounding_capability) & - BT_HCI_LE_CS_NADM_SOUNDING_CAPABILITY_PHASE_BASED_MASK; - - remote_cs_capabilities.phase_based_nadm_random_supported = - sys_le16_to_cpu(evt->nadm_random_capability) & - BT_HCI_LE_CS_NADM_RANDOM_CAPABILITY_PHASE_BASED_MASK; - - remote_cs_capabilities.cs_sync_2m_phy_supported = - evt->cs_sync_phys_supported & BT_HCI_LE_CS_SYNC_PHYS_2M_MASK; - - remote_cs_capabilities.cs_sync_2m_2bt_phy_supported = - evt->cs_sync_phys_supported & BT_HCI_LE_CS_SYNC_PHYS_2M_2BT_MASK; - - remote_cs_capabilities.cs_without_fae_supported = - sys_le16_to_cpu(evt->subfeatures_supported) & - BT_HCI_LE_CS_SUBFEATURE_NO_TX_FAE_MASK; - - remote_cs_capabilities.chsel_alg_3c_supported = - sys_le16_to_cpu(evt->subfeatures_supported) & - BT_HCI_LE_CS_SUBFEATURE_CHSEL_ALG_3C_MASK; - - remote_cs_capabilities.pbr_from_rtt_sounding_seq_supported = - sys_le16_to_cpu(evt->subfeatures_supported) & - BT_HCI_LE_CS_SUBFEATURE_PBR_FROM_RTT_SOUNDING_SEQ_MASK; - - remote_cs_capabilities.t_ip1_times_supported = - sys_le16_to_cpu(evt->t_ip1_times_supported); - remote_cs_capabilities.t_ip2_times_supported = - sys_le16_to_cpu(evt->t_ip2_times_supported); - remote_cs_capabilities.t_fcs_times_supported = - sys_le16_to_cpu(evt->t_fcs_times_supported); - remote_cs_capabilities.t_pm_times_supported = - sys_le16_to_cpu(evt->t_pm_times_supported); - - remote_cs_capabilities.t_sw_time = evt->t_sw_time_supported; - remote_cs_capabilities.tx_snr_capability = evt->tx_snr_capability; - - remote_cs_capabilities.t_ip2_ipt_times_supported = - sys_le16_to_cpu(evt->t_ip2_ipt_times_supported); - remote_cs_capabilities.t_sw_ipt_time_supported = evt->t_sw_ipt_time_supported; - - bt_conn_notify_remote_cs_capabilities(conn, BT_HCI_ERR_SUCCESS, - &remote_cs_capabilities); - -out: - bt_conn_unref(conn); -} - int bt_le_cs_set_default_settings(struct bt_conn *conn, const struct bt_le_cs_set_default_settings_param *params) { @@ -692,7 +556,9 @@ int bt_le_cs_start_test(const struct bt_le_cs_test_param *params) cp->t_pm_time = params->t_pm_time; cp->t_sw_time = params->t_sw_time; cp->tone_antenna_config_selection = params->tone_antenna_config_selection; - cp->cs_enhancements_1 = 0; + + cp->reserved = 0; + cp->snr_control_initiator = params->initiator_snr_control; cp->snr_control_reflector = params->reflector_snr_control; cp->drbg_nonce = sys_cpu_to_le16(params->drbg_nonce); @@ -1011,7 +877,6 @@ void bt_hci_le_cs_config_complete_event(struct net_buf *buf) config.channel_selection_type = evt->channel_selection_type; config.ch3c_shape = evt->ch3c_shape; config.ch3c_jump = evt->ch3c_jump; - config.cs_enhancements_1 = evt->cs_enhancements_1; config.t_ip1_time_us = evt->t_ip1_time; config.t_ip2_time_us = evt->t_ip2_time; config.t_fcs_time_us = evt->t_fcs_time; @@ -1062,7 +927,7 @@ int bt_le_cs_create_config(struct bt_conn *conn, struct bt_le_cs_create_config_p cp->channel_selection_type = params->channel_selection_type; cp->ch3c_shape = params->ch3c_shape; cp->ch3c_jump = params->ch3c_jump; - cp->cs_enhancements_1 = params->cs_enhancements_1; + cp->reserved = 0; memcpy(cp->channel_map, params->channel_map, ARRAY_SIZE(cp->channel_map)); return bt_hci_cmd_send_sync(BT_HCI_OP_LE_CS_CREATE_CONFIG, buf, NULL); @@ -1257,113 +1122,12 @@ int bt_le_cs_read_local_supported_capabilities(struct bt_conn_le_cs_capabilities ret->t_sw_time = rp->t_sw_time_supported; ret->tx_snr_capability = rp->tx_snr_capability; - ret->t_ip2_ipt_times_supported = 0; - ret->t_sw_ipt_time_supported = 0; - - net_buf_unref(rsp); - return status; -} - -int bt_le_cs_read_local_supported_capabilities_v2(struct bt_conn_le_cs_capabilities *ret) -{ - struct bt_hci_rp_le_read_local_supported_capabilities_v2 *rp; - struct net_buf *rsp; - - int err = bt_hci_cmd_send_sync( - BT_HCI_OP_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_V2, NULL, &rsp); - - if (err) { - return err; - } - - rp = (void *)rsp->data; - - uint8_t status = rp->status; - - ret->num_config_supported = rp->num_config_supported; - ret->max_consecutive_procedures_supported = - sys_le16_to_cpu(rp->max_consecutive_procedures_supported); - ret->num_antennas_supported = rp->num_antennas_supported; - ret->max_antenna_paths_supported = rp->max_antenna_paths_supported; - - ret->initiator_supported = rp->roles_supported & BT_HCI_LE_CS_INITIATOR_ROLE_MASK; - ret->reflector_supported = rp->roles_supported & BT_HCI_LE_CS_REFLECTOR_ROLE_MASK; - ret->mode_3_supported = rp->modes_supported & BT_HCI_LE_CS_MODES_SUPPORTED_MODE_3_MASK; - - ret->rtt_aa_only_n = rp->rtt_aa_only_n; - ret->rtt_sounding_n = rp->rtt_sounding_n; - ret->rtt_random_payload_n = rp->rtt_random_payload_n; - - if (rp->rtt_aa_only_n) { - if (rp->rtt_capability & BT_HCI_LE_CS_RTT_AA_ONLY_N_10NS_MASK) { - ret->rtt_aa_only_precision = BT_CONN_LE_CS_RTT_AA_ONLY_10NS; - } else { - ret->rtt_aa_only_precision = BT_CONN_LE_CS_RTT_AA_ONLY_150NS; - } - } else { - ret->rtt_aa_only_precision = BT_CONN_LE_CS_RTT_AA_ONLY_NOT_SUPP; - } - - if (rp->rtt_sounding_n) { - if (rp->rtt_capability & BT_HCI_LE_CS_RTT_SOUNDING_N_10NS_MASK) { - ret->rtt_sounding_precision = BT_CONN_LE_CS_RTT_SOUNDING_10NS; - } else { - ret->rtt_sounding_precision = BT_CONN_LE_CS_RTT_SOUNDING_150NS; - } - } else { - ret->rtt_sounding_precision = BT_CONN_LE_CS_RTT_SOUNDING_NOT_SUPP; - } - - if (rp->rtt_random_payload_n) { - if (rp->rtt_capability & BT_HCI_LE_CS_RTT_RANDOM_PAYLOAD_N_10NS_MASK) { - ret->rtt_random_payload_precision = BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS; - } else { - ret->rtt_random_payload_precision = BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_150NS; - } - } else { - ret->rtt_random_payload_precision = BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_NOT_SUPP; - } - - ret->phase_based_nadm_sounding_supported = - sys_le16_to_cpu(rp->nadm_sounding_capability) & - BT_HCI_LE_CS_NADM_SOUNDING_CAPABILITY_PHASE_BASED_MASK; - - ret->phase_based_nadm_random_supported = - sys_le16_to_cpu(rp->nadm_random_capability) & - BT_HCI_LE_CS_NADM_RANDOM_CAPABILITY_PHASE_BASED_MASK; - - ret->cs_sync_2m_phy_supported = rp->cs_sync_phys_supported & BT_HCI_LE_CS_SYNC_PHYS_2M_MASK; - - ret->cs_sync_2m_2bt_phy_supported = - rp->cs_sync_phys_supported & BT_HCI_LE_CS_SYNC_PHYS_2M_2BT_MASK; - - ret->cs_without_fae_supported = - sys_le16_to_cpu(rp->subfeatures_supported) & BT_HCI_LE_CS_SUBFEATURE_NO_TX_FAE_MASK; - - ret->chsel_alg_3c_supported = sys_le16_to_cpu(rp->subfeatures_supported) & - BT_HCI_LE_CS_SUBFEATURE_CHSEL_ALG_3C_MASK; - - ret->pbr_from_rtt_sounding_seq_supported = - sys_le16_to_cpu(rp->subfeatures_supported) & - BT_HCI_LE_CS_SUBFEATURE_PBR_FROM_RTT_SOUNDING_SEQ_MASK; - - ret->t_ip1_times_supported = sys_le16_to_cpu(rp->t_ip1_times_supported); - ret->t_ip2_times_supported = sys_le16_to_cpu(rp->t_ip2_times_supported); - ret->t_fcs_times_supported = sys_le16_to_cpu(rp->t_fcs_times_supported); - ret->t_pm_times_supported = sys_le16_to_cpu(rp->t_pm_times_supported); - - ret->t_sw_time = rp->t_sw_time_supported; - ret->tx_snr_capability = rp->tx_snr_capability; - - ret->t_ip2_ipt_times_supported = sys_le16_to_cpu(rp->t_ip2_ipt_times_supported); - ret->t_sw_ipt_time_supported = rp->t_sw_ipt_time_supported; - net_buf_unref(rsp); return status; } -int bt_le_cs_write_cached_remote_supported_capabilities(struct bt_conn *conn, - const struct bt_conn_le_cs_capabilities *params) +int bt_le_cs_write_cached_remote_supported_capabilities( + struct bt_conn *conn, const struct bt_conn_le_cs_capabilities *params) { struct bt_hci_cp_le_write_cached_remote_supported_capabilities *cp; struct net_buf *buf; @@ -1460,108 +1224,6 @@ int bt_le_cs_write_cached_remote_supported_capabilities(struct bt_conn *conn, NULL); } -int bt_le_cs_write_cached_remote_supported_capabilities_v2(struct bt_conn *conn, - const struct bt_conn_le_cs_capabilities *params) -{ - struct bt_hci_cp_le_write_cached_remote_supported_capabilities_v2 *cp; - struct net_buf *buf; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - - cp->handle = sys_cpu_to_le16(conn->handle); - - cp->num_config_supported = params->num_config_supported; - - cp->max_consecutive_procedures_supported = - sys_cpu_to_le16(params->max_consecutive_procedures_supported); - - cp->num_antennas_supported = params->num_antennas_supported; - cp->max_antenna_paths_supported = params->max_antenna_paths_supported; - - cp->roles_supported = 0; - if (params->initiator_supported) { - cp->roles_supported |= BT_HCI_LE_CS_INITIATOR_ROLE_MASK; - } - if (params->reflector_supported) { - cp->roles_supported |= BT_HCI_LE_CS_REFLECTOR_ROLE_MASK; - } - - cp->modes_supported = 0; - if (params->mode_3_supported) { - cp->modes_supported |= BT_HCI_LE_CS_MODES_SUPPORTED_MODE_3_MASK; - } - - cp->rtt_aa_only_n = params->rtt_aa_only_n; - cp->rtt_sounding_n = params->rtt_sounding_n; - cp->rtt_random_payload_n = params->rtt_random_payload_n; - - cp->rtt_capability = 0; - if (params->rtt_aa_only_precision == BT_CONN_LE_CS_RTT_AA_ONLY_10NS) { - cp->rtt_capability |= BT_HCI_LE_CS_RTT_AA_ONLY_N_10NS_MASK; - } - - if (params->rtt_sounding_precision == BT_CONN_LE_CS_RTT_SOUNDING_10NS) { - cp->rtt_capability |= BT_HCI_LE_CS_RTT_SOUNDING_N_10NS_MASK; - } - - if (params->rtt_random_payload_precision == BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS) { - cp->rtt_capability |= BT_HCI_LE_CS_RTT_RANDOM_PAYLOAD_N_10NS_MASK; - } - - cp->nadm_sounding_capability = 0; - if (params->phase_based_nadm_sounding_supported) { - cp->nadm_sounding_capability |= - sys_cpu_to_le16(BT_HCI_LE_CS_NADM_SOUNDING_CAPABILITY_PHASE_BASED_MASK); - } - - cp->nadm_random_capability = 0; - if (params->phase_based_nadm_random_supported) { - cp->nadm_random_capability |= - sys_cpu_to_le16(BT_HCI_LE_CS_NADM_RANDOM_CAPABILITY_PHASE_BASED_MASK); - } - - cp->cs_sync_phys_supported = 0; - if (params->cs_sync_2m_phy_supported) { - cp->cs_sync_phys_supported |= BT_HCI_LE_CS_SYNC_PHYS_2M_MASK; - } - if (params->cs_sync_2m_2bt_phy_supported) { - cp->cs_sync_phys_supported |= BT_HCI_LE_CS_SYNC_PHYS_2M_2BT_MASK; - } - - cp->subfeatures_supported = 0; - if (params->cs_without_fae_supported) { - cp->subfeatures_supported |= - sys_cpu_to_le16(BT_HCI_LE_CS_SUBFEATURE_NO_TX_FAE_MASK); - } - if (params->chsel_alg_3c_supported) { - cp->subfeatures_supported |= - sys_cpu_to_le16(BT_HCI_LE_CS_SUBFEATURE_CHSEL_ALG_3C_MASK); - } - if (params->pbr_from_rtt_sounding_seq_supported) { - cp->subfeatures_supported |= - sys_cpu_to_le16(BT_HCI_LE_CS_SUBFEATURE_PBR_FROM_RTT_SOUNDING_SEQ_MASK); - } - - cp->t_ip1_times_supported = sys_cpu_to_le16(params->t_ip1_times_supported); - cp->t_ip2_times_supported = sys_cpu_to_le16(params->t_ip2_times_supported); - cp->t_fcs_times_supported = sys_cpu_to_le16(params->t_fcs_times_supported); - cp->t_pm_times_supported = sys_cpu_to_le16(params->t_pm_times_supported); - cp->t_sw_time_supported = params->t_sw_time; - cp->tx_snr_capability = params->tx_snr_capability; - - cp->t_ip2_ipt_times_supported = sys_cpu_to_le16(params->t_ip2_ipt_times_supported); - cp->t_sw_ipt_time_supported = params->t_sw_ipt_time_supported; - - return bt_hci_cmd_send_sync( - BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_V2, - buf, NULL); -} - int bt_le_cs_write_cached_remote_fae_table(struct bt_conn *conn, int8_t remote_fae_table[72]) { struct bt_hci_cp_le_write_cached_remote_fae_table *cp; diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 454929eecfda..9573f714fa1f 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3071,21 +3071,17 @@ static const struct event_handler meta_events[] = { EVENT_HANDLER(BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE, bt_hci_le_cs_read_remote_supported_capabilities_complete, sizeof(struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete)), - EVENT_HANDLER(BT_HCI_EVT_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_V2, - bt_hci_le_cs_read_remote_supported_capabilities_complete_v2, - sizeof( - struct bt_hci_evt_le_cs_read_remote_supported_capabilities_complete_v2)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_READ_REMOTE_FAE_TABLE_COMPLETE, bt_hci_le_cs_read_remote_fae_table_complete, sizeof(struct bt_hci_evt_le_cs_read_remote_fae_table_complete)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_CONFIG_COMPLETE, bt_hci_le_cs_config_complete_event, sizeof(struct bt_hci_evt_le_cs_config_complete)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_SECURITY_ENABLE_COMPLETE, - bt_hci_le_cs_security_enable_complete, - sizeof(struct bt_hci_evt_le_cs_security_enable_complete)), + bt_hci_le_cs_security_enable_complete, + sizeof(struct bt_hci_evt_le_cs_security_enable_complete)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_PROCEDURE_ENABLE_COMPLETE, - bt_hci_le_cs_procedure_enable_complete, - sizeof(struct bt_hci_evt_le_cs_procedure_enable_complete)), + bt_hci_le_cs_procedure_enable_complete, + sizeof(struct bt_hci_evt_le_cs_procedure_enable_complete)), EVENT_HANDLER(BT_HCI_EVT_LE_CS_SUBEVENT_RESULT, bt_hci_le_cs_subevent_result, sizeof(struct bt_hci_evt_le_cs_subevent_result)), @@ -3728,13 +3724,6 @@ static int le_set_event_mask(void) if (IS_ENABLED(CONFIG_BT_CHANNEL_SOUNDING) && BT_FEAT_LE_CHANNEL_SOUNDING(bt_dev.le.features)) { mask |= BT_EVT_MASK_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE; - /* Only set v2 event mask if controller supports it; v1-only CS controllers - * may reject the Set Event Mask command if an unknown bit is set. - */ - if (BT_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_V2_SUPPORTED( - bt_dev.supported_commands)) { - mask |= BT_EVT_MASK_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_COMPLETE_V2; - } mask |= BT_EVT_MASK_LE_CS_READ_REMOTE_FAE_TABLE_COMPLETE; mask |= BT_EVT_MASK_LE_CS_CONFIG_COMPLETE; mask |= BT_EVT_MASK_LE_CS_SECURITY_ENABLE_COMPLETE; diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 1cc40349cfba..dacc51d20fa2 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -559,7 +559,6 @@ void bt_hci_le_past_received_v2(struct net_buf *buf); /* CS HCI event handlers */ void bt_hci_le_cs_read_remote_supported_capabilities_complete(struct net_buf *buf); -void bt_hci_le_cs_read_remote_supported_capabilities_complete_v2(struct net_buf *buf); void bt_hci_le_cs_read_remote_fae_table_complete(struct net_buf *buf); void bt_hci_le_cs_config_complete_event(struct net_buf *buf); void bt_hci_le_cs_security_enable_complete(struct net_buf *buf); From f885f48d11bf4b2e5b9e9e51c37157b3343c211f Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Fri, 20 Feb 2026 11:33:11 +0100 Subject: [PATCH 1957/3334] [nrf fromtree] Bluetooth: BAP: Unicast Client: Handle unexpected ASE IDs If we receive a control point notification with an ASE ID that does not match any existing streams, i.e. audio_stream_by_ep_id returns NULL, we should not continue by calling the subsequent functions like unicast_client_notify_ep_config with a NULL stream. A single notification may contain multiple ASE IDs; if any of them are unknown, we can either reject the entire notification, or we can ignore the specific ASE ID. For now, ignore the specific ASE ID to do a best effort to continue with any other changes. Signed-off-by: Emil Gydesen (cherry picked from commit f04042714da95707ca13eb9f04017b4a1fe4c87d) Signed-off-by: Alexander Svensen --- subsys/bluetooth/audio/bap_unicast_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index b163d9c2aa93..838294937ae4 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -1659,6 +1659,8 @@ static uint8_t unicast_client_cp_notify(struct bt_conn *conn, stream = audio_stream_by_ep_id(conn, ase_rsp->id); if (stream == NULL) { LOG_DBG("Could not find stream by id %u", ase_rsp->id); + + continue; } else { client_ep = CONTAINER_OF(stream->ep, struct bt_bap_unicast_client_ep, ep); client_ep->cp_ntf_pending = false; From 4268e2a112115386f688258ee9688436388e6377 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Mon, 2 Mar 2026 12:53:45 +0100 Subject: [PATCH 1958/3334] [nrf fromtree] doc: releases: Add entry for BT CIS disconnect changes Add entry for change in behavior when disconnecting ACLs with accompanying CIS. Signed-off-by: Emil Gydesen (cherry picked from commit 1e18bce758cbd53ea818a5a2c832f3e806594de4) --- doc/releases/release-notes-4.4.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 28e31ee4f11c..14b0dd27acab 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -138,6 +138,12 @@ New APIs and options * :c:func:`bt_gatt_cb_unregister` Added an API to unregister GATT callback handlers. * :c:func:`bt_le_per_adv_sync_cb_unregister` + * ISO + + * :c:member:`bt_iso_chan_ops.disconnected` will now always be called before + :c:member:`bt_conn_cb.disconnected` for unicast (CIS) channels, + to provide a more deterministic order of callback events. (:github:`104695`). + * Mesh * :c:func:`bt_mesh_input_numeric` to provide provisioning numeric input OOB value. From 4d5eb755deeda4569df4bae7e7e71e3feb4b8769 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Fri, 27 Feb 2026 22:16:11 +0100 Subject: [PATCH 1959/3334] [nrf fromtree] Bluetooth: Host: Make ACL/CIS disconnect order deterministic Currently the other of the ACL and CIS disconnect callbacks depend on the order of the HCI events received. Since this order is not specified by the core spec, it means that any users/applications of ISO will need to wait for all CIS disconnects callbacks and the ACL disconnect callback before attempting to reuse any of them. From an API perspective this is not ideal, and the API will be much simpler if the order of ACL and ISO disconnect callbacks were deterministic, regardless of the controller. This change postpones the finalization of the ACL disconnect until all the CIS associated with it has been disconnected. This will also make the API more similar to e.g. the L2CAP disconnect order. Signed-off-by: Emil Gydesen (cherry picked from commit d0dae06458bbbbd5e33963fa04d114f5c622d12e) --- include/zephyr/bluetooth/iso.h | 3 ++ subsys/bluetooth/host/conn.c | 60 ++++++++++++++-------------------- subsys/bluetooth/host/iso.c | 39 ++++++++++++++++++++-- 3 files changed, 65 insertions(+), 37 deletions(-) diff --git a/include/zephyr/bluetooth/iso.h b/include/zephyr/bluetooth/iso.h index f5e0182f2d66..371843ff4302 100644 --- a/include/zephyr/bluetooth/iso.h +++ b/include/zephyr/bluetooth/iso.h @@ -729,6 +729,9 @@ struct bt_iso_chan_ops { * * For the above reason it is still possible to use bt_iso_chan_get_info() on the @p chan. * + * If the @p chan is a unicast (CIS) channel, then this callback will always be called + * before @ref bt_conn_cb.disconnected when the associated ACL connection also disconnects. + * * @param chan The channel that has been Disconnected * @param reason BT_HCI_ERR_* reason for the disconnection. */ diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index ff4dba086e1c..57b5b7dc098b 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2165,29 +2165,6 @@ static int send_conn_le_param_update(struct bt_conn *conn, return bt_l2cap_update_conn_param(conn, param); } -#if defined(CONFIG_BT_ISO_UNICAST) -static struct bt_conn *conn_lookup_iso(struct bt_conn *conn) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(iso_conns); i++) { - struct bt_conn *iso = bt_conn_ref(&iso_conns[i]); - - if (iso == NULL) { - continue; - } - - if (iso->iso.acl == conn) { - return iso; - } - - bt_conn_unref(iso); - } - - return NULL; -} -#endif /* CONFIG_BT_ISO */ - #if defined(CONFIG_BT_CLASSIC) static struct bt_conn *conn_lookup_sco(struct bt_conn *conn) { @@ -2221,7 +2198,7 @@ static void deferred_work(struct k_work *work) if (conn->state == BT_CONN_DISCONNECTED) { #if defined(CONFIG_BT_ISO_UNICAST) - struct bt_conn *iso; + bool acl_coupled_with_cis; if (bt_conn_is_iso(conn)) { /* bt_iso_disconnected is responsible for unref'ing the @@ -2232,23 +2209,36 @@ static void deferred_work(struct k_work *work) return; } - /* Mark all ISO channels associated - * with ACL conn as not connected, and - * remove ACL reference + /* Mark all CIS still associated with the ACL conn as disconnecting. + * If any CIS are associated with the ACL, we postpone the disconnect work until + * after the CIS has been disconnected from a HCI Disconnect event. */ - iso = conn_lookup_iso(conn); - while (iso != NULL) { - struct bt_iso_chan *chan = iso->iso.chan; + acl_coupled_with_cis = false; + ARRAY_FOR_EACH_PTR(iso_conns, iso_conn) { + struct bt_conn *iso = bt_conn_ref(iso_conn); - if (chan != NULL) { - bt_iso_chan_set_state(chan, - BT_ISO_STATE_DISCONNECTING); + if (iso == NULL) { + continue; } - bt_iso_cleanup_acl(iso); + if (iso->iso.acl == conn) { + struct bt_iso_chan *chan = iso->iso.chan; + + if (chan != NULL) { + bt_iso_chan_set_state(chan, BT_ISO_STATE_DISCONNECTING); + } + + acl_coupled_with_cis = true; + } bt_conn_unref(iso); - iso = conn_lookup_iso(conn); + } + + if (acl_coupled_with_cis) { + LOG_DBG("acl %p is pending on CIS disconnects, wait for CIS disconnects", + conn); + + return; } #endif #if defined(CONFIG_BT_CLASSIC) diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index 53dc729db56c..96499e0c8ac0 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -1156,13 +1156,48 @@ int bt_iso_chan_disconnect(struct bt_iso_chan *chan) return err; } +static bool bt_iso_acl_has_cis(const struct bt_conn *acl) +{ + ARRAY_FOR_EACH_PTR(iso_conns, iso_conn) { + struct bt_conn *iso = bt_conn_ref(iso_conn); + + if (iso == NULL) { + continue; + } + + if (iso->iso.acl == acl) { + bt_conn_unref(iso); + + return true; + } + + bt_conn_unref(iso); + } + + return false; +} + void bt_iso_cleanup_acl(struct bt_conn *iso) { + struct bt_conn *acl = iso->iso.acl; LOG_DBG("%p", iso); - if (iso->iso.acl) { - bt_conn_unref(iso->iso.acl); + if (acl != NULL) { iso->iso.acl = NULL; + + /* If we have removed the last ACL reference, trigger the deferred work to finalize + * the ACL disconnection + */ + if (acl->state == BT_CONN_DISCONNECTED && !bt_iso_acl_has_cis(acl)) { + LOG_DBG("Trigger disconnect work for ACL %p", acl); + + __maybe_unused const int err = + k_work_schedule(&acl->deferred_work, K_NO_WAIT); + + __ASSERT(err >= 0, "Failed to retrigger conn->deferred_work for %p", acl); + } + + bt_conn_unref(acl); } } From 61dfdd79086afbae0a9692e7626e9a17319a5693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 2 Mar 2026 13:22:14 +0100 Subject: [PATCH 1960/3334] [nrf fromtree] tests: drivers: mbox_error_cases: Move test parametrization to Kconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve mbox_error_cases test. Move test parametrization from source code to Kconfigs. Signed-off-by: Sebastian Głąb (cherry picked from commit ce8f159f92a5e67858fdbcece9cef977b8457697) --- tests/drivers/mbox/mbox_error_cases/Kconfig | 23 ++++++++++++++ .../drivers/mbox/mbox_error_cases/src/main.c | 30 +++++-------------- 2 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 tests/drivers/mbox/mbox_error_cases/Kconfig diff --git a/tests/drivers/mbox/mbox_error_cases/Kconfig b/tests/drivers/mbox/mbox_error_cases/Kconfig new file mode 100644 index 000000000000..8969bfb6fc10 --- /dev/null +++ b/tests/drivers/mbox/mbox_error_cases/Kconfig @@ -0,0 +1,23 @@ +# +# Copyright (c) 2026 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +mainmenu "MBOX Negative Test" + +config TEST_EXPECTED_MTU_VALUE + int "Maximum data field size" + default 0 + help + Expected value that mbox_mtu_get_dt() shall return. + Maximum number of bytes possible in an outbound message. + +config TEST_REMOTE_BUSY_NOT_SUPPORTED + bool "Remote busy is NOT supported" + default y + help + Value of 'y' means that transmitter is NOT able to detect + if the remote hasn't yet read the last data sent. + +source "Kconfig.zephyr" diff --git a/tests/drivers/mbox/mbox_error_cases/src/main.c b/tests/drivers/mbox/mbox_error_cases/src/main.c index 53e7196dccd9..9636d139865c 100644 --- a/tests/drivers/mbox/mbox_error_cases/src/main.c +++ b/tests/drivers/mbox/mbox_error_cases/src/main.c @@ -10,18 +10,6 @@ int dummy_value; -#if defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || \ - defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) || \ - defined(CONFIG_SOC_NRF54LM20A) || defined(CONFIG_SOC_NRF7120) -#define EXPECTED_MTU_VALUE (0) -#define DATA_TRANSFER_MODE_SUPPORTED (0) -#define REMOTE_BUSY_SUPPORTED (0) -#else -#define EXPECTED_MTU_VALUE (4) -#define DATA_TRANSFER_MODE_SUPPORTED (1) -#define REMOTE_BUSY_SUPPORTED (1) -#endif - static void dummy_callback(const struct device *dev, mbox_channel_id_t channel_id, void *user_data, struct mbox_msg *data) { @@ -165,7 +153,7 @@ ZTEST(mbox_error_cases, test_02c_mbox_send_message_with_data) struct mbox_msg data_msg = {0}; int ret; - if (DATA_TRANSFER_MODE_SUPPORTED) { + if (CONFIG_TEST_EXPECTED_MTU_VALUE > 0) { /* Skip this test because data transfer is supported. */ ztest_test_skip(); } @@ -195,12 +183,8 @@ ZTEST(mbox_error_cases, test_02d_mbox_send_message_remote_busy) MBOX_DT_SPEC_GET(DT_PATH(mbox_consumer), remote_valid); int ret; - if (!REMOTE_BUSY_SUPPORTED) { - /* Skip this test because driver is not - * capable of detecting that remote is busy. - */ - ztest_test_skip(); - } + /* Skip this test when driver can't detect that remote is busy. */ + Z_TEST_SKIP_IFDEF(CONFIG_TEST_REMOTE_BUSY_NOT_SUPPORTED); ret = mbox_send_dt(&tx_channel, NULL); zassert_true( @@ -334,19 +318,19 @@ ZTEST(mbox_error_cases, test_04b_mbox_mtu_get_on_tx_channel) ret = mbox_mtu_get_dt(&tx_channel); zassert_true( - (ret == EXPECTED_MTU_VALUE), + (ret == CONFIG_TEST_EXPECTED_MTU_VALUE), "mbox_mtu_get_dt(tx_channel) shall return %d" " got unexpected %d", - EXPECTED_MTU_VALUE, + CONFIG_TEST_EXPECTED_MTU_VALUE, ret ); ret = mbox_mtu_get_dt(&tx_channel_incorrect); zassert_true( - (ret == EXPECTED_MTU_VALUE), + (ret == CONFIG_TEST_EXPECTED_MTU_VALUE), "mbox_mtu_get_dt(tx_channel_incorrect) shall return %d" " got unexpected %d", - EXPECTED_MTU_VALUE, + CONFIG_TEST_EXPECTED_MTU_VALUE, ret ); } From 1b6e9b47a99da0fb63c893e41dbc87936c8e951d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 2 Mar 2026 13:20:07 +0100 Subject: [PATCH 1961/3334] [nrf fromtree] tests: drivers: mbox: Enable mbox_error_cases on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the mbox_error_cases test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 0c9f5c4b48d3aa7308c6e6b48d0cf4405b3c589d) --- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 22 +++++++++++++++++++ .../drivers/mbox/mbox_error_cases/sample.yaml | 1 + 2 files changed, 23 insertions(+) create mode 100644 tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..462f213aa66d --- /dev/null +++ b/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,22 @@ +/* + * Copyright 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + mbox-consumer { + compatible = "vnd,mbox-consumer"; + mboxes = <&cpuapp_vevif_tx 21>, <&cpuapp_vevif_tx 32>, + <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_rx 32>; + mbox-names = "remote_valid", "remote_incorrect", + "local_valid", "local_incorrect"; + }; +}; + +&cpuapp_vevif_rx { + status = "okay"; +}; + +&cpuapp_vevif_tx { + status = "okay"; +}; diff --git a/tests/drivers/mbox/mbox_error_cases/sample.yaml b/tests/drivers/mbox/mbox_error_cases/sample.yaml index 06255734ea5c..565d0350b241 100644 --- a/tests/drivers/mbox/mbox_error_cases/sample.yaml +++ b/tests/drivers/mbox/mbox_error_cases/sample.yaml @@ -18,6 +18,7 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 91a1d37120c4e6a3080653074db0036d1449fd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 2 Mar 2026 13:31:35 +0100 Subject: [PATCH 1962/3334] [nrf fromtree] tests: boards: nrf: Enable comp test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the comp test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 75678e5f4712c01b559f56bee263013a4f59ec59) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 4 ++ .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 41 +++++++++++++++++++ tests/boards/nrf/comp/testcase.yaml | 1 + 3 files changed, 46 insertions(+) create mode 100644 tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf create mode 100644 tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..3a7f6a038761 --- /dev/null +++ b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf @@ -0,0 +1,4 @@ +CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX=1 +CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX=4 +CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX=6 +CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX=5 diff --git a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..31d239bf1869 --- /dev/null +++ b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Two loopbacks are used + * Each loopback is between analog input and GPIO. + * first-gpios (P1.03) -> AIN6 (P1.04) + * second-gpios (P1.30, AIN2) -> AIN1 (P1.31) + * AIN4 (P1.06) tied to VDD + */ + +#include + +/ { + aliases { + test-comp = ∁ + }; + + zephyr,user { + first-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + second-gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&comp { + status = "okay"; + psel = ; + refsel = "AREF"; + extrefsel = ; + sp-mode = "NORMAL"; + th-up = <36>; + th-down = <30>; + isource = "DISABLED"; + enable-hyst; +}; diff --git a/tests/boards/nrf/comp/testcase.yaml b/tests/boards/nrf/comp/testcase.yaml index f4a88db57df3..406fa4641385 100644 --- a/tests/boards/nrf/comp/testcase.yaml +++ b/tests/boards/nrf/comp/testcase.yaml @@ -13,4 +13,5 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp From 7ab19c54cc8bc398f11d68330035cf7f339bd167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 2 Mar 2026 13:45:40 +0100 Subject: [PATCH 1963/3334] [nrf fromtree] tests: drivers: flash: Enable flash common test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the flash common test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 2062409a27e4340e2ccfd9b50099e9eabd05e484) --- .../common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 4 ++++ .../common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 +++++++++ tests/drivers/flash/common/testcase.yaml | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf create mode 100644 tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..821a5e77e5b5 --- /dev/null +++ b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf @@ -0,0 +1,4 @@ +CONFIG_FCB=y +CONFIG_FLASH_MAP=y +CONFIG_SETTINGS=y +CONFIG_SETTINGS_FCB=y diff --git a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..3ab838329612 --- /dev/null +++ b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&mx25r64 { + status = "okay"; +}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 489d2bf0bd57..f5f75451a4cb 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -67,6 +67,7 @@ tests: or dt_label_with_parent_compat_enabled("storage_partition", "nordic,owned-partitions"))) platform_exclude: - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - qemu_x86 @@ -98,6 +99,7 @@ tests: drivers.flash.common.nrf54lm20a: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp harness_config: fixture: external_flash drivers.flash.common.tfm_ns: From f718399ee070dce75bf1eca5ed1a92e7e67e508f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 2 Mar 2026 14:04:21 +0100 Subject: [PATCH 1964/3334] [nrf fromtree] tests: drivers: flash: Enable flash negative_test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add nrf54lm20b to the platform allow list. Signed-off-by: Sebastian Głąb (cherry picked from commit e937492426c0227771468fe24307de3985b098a3) --- tests/drivers/flash/negative_tests/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/flash/negative_tests/testcase.yaml b/tests/drivers/flash/negative_tests/testcase.yaml index 304637cac40f..b6b4137c31a4 100644 --- a/tests/drivers/flash/negative_tests/testcase.yaml +++ b/tests/drivers/flash/negative_tests/testcase.yaml @@ -8,5 +8,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - ophelia4ev/nrf54l15/cpuapp - sam_e54_xpro From fbfb85a7e16f26a03a09d4e322c3c0a5cef4148a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Mon, 2 Mar 2026 14:49:32 +0100 Subject: [PATCH 1965/3334] [nrf fromtree] samples: drivers: Enable soc_flash_nrf on nrf54lm20dk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable soc_flash_nrf test on nrf54lm20a and nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 789aa1e030e1a2e7f805f836dc5999eea7e00f81) --- samples/drivers/soc_flash_nrf/sample.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/drivers/soc_flash_nrf/sample.yaml b/samples/drivers/soc_flash_nrf/sample.yaml index b36ac7921abe..02d90fb2e337 100644 --- a/samples/drivers/soc_flash_nrf/sample.yaml +++ b/samples/drivers/soc_flash_nrf/sample.yaml @@ -10,6 +10,8 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp + - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp integration_platforms: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 From b0d8b6041a03248588296c7fb278f243870e178e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 3 Mar 2026 10:23:41 +0100 Subject: [PATCH 1966/3334] [nrf fromtree] samples: drivers: Enable spi_flash sample on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the spi_flash sample on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 2d8fae2af6474cc98e6cc9919c8767475d484c89) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 +++++++++ samples/drivers/spi_flash/sample.yaml | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..3ab838329612 --- /dev/null +++ b/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&mx25r64 { + status = "okay"; +}; diff --git a/samples/drivers/spi_flash/sample.yaml b/samples/drivers/spi_flash/sample.yaml index 36a799fda6d2..83e1c9168e4d 100644 --- a/samples/drivers/spi_flash/sample.yaml +++ b/samples/drivers/spi_flash/sample.yaml @@ -15,6 +15,7 @@ tests: - hifive_unmatched/fu740/s7 - hifive_unmatched/fu740/u74 - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - stm32n6570_dk/stm32n657xx/sb harness: console harness_config: @@ -47,6 +48,7 @@ tests: sample.drivers.spi.flash.nrf54lm20: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp harness: console From 244dbba19cfe8769213c0f64a71e4a7a48ece830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 3 Mar 2026 10:41:19 +0100 Subject: [PATCH 1967/3334] [nrf fromtree] tests: boards: nrf: hwinfo: Enable reset_cause test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the reset_cause test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 1f40ebe2a2091f52ad3dedc5dd1568a7aba5b9f5) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 +++++++++ tests/boards/nrf/hwinfo/reset_cause/testcase.yaml | 1 + 2 files changed, 10 insertions(+) create mode 100644 tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..dcac0662ba24 --- /dev/null +++ b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wdt31 { + status = "okay"; +}; diff --git a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml index 6541d41c7406..0c21eac9d5d2 100644 --- a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml +++ b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml @@ -39,6 +39,7 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp From df120f8ec8b67163ad67a3c7f2be25130d8cd046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 3 Mar 2026 11:25:09 +0100 Subject: [PATCH 1968/3334] [nrf fromtree] tests: drivers: timer: Enable nrf_grtc_timer test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add nrf54lm20b to the platform allow list. Signed-off-by: Sebastian Głąb (cherry picked from commit 610d62d70a77731d399dc7a90b9171141b73db4e) --- tests/drivers/timer/nrf_grtc_timer/testcase.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index f4c6439972ab..ae6cee3a4563 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -11,6 +11,8 @@ common: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr + - nrf54lm20dk/nrf54lm20b/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuflpr - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr From 377bebec10f6c8a5a386a9ec4eab23648be0204f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 3 Mar 2026 12:30:02 +0100 Subject: [PATCH 1969/3334] [nrf fromtree] tests: drivers: i2s: Enable i2s_additional test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the i2s_additional test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit e8eb98280a09da90a047346276e78e8969c6499a) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 30 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 +--------------- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 +++++ .../drivers/i2s/i2s_additional/testcase.yaml | 1 + 4 files changed, 39 insertions(+), 24 deletions(-) create mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..022a6a60f058 --- /dev/null +++ b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index e93f6df8fd8c..1e6f31ac52d0 100644 --- a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,27 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_additional/testcase.yaml b/tests/drivers/i2s/i2s_additional/testcase.yaml index 9b521728ccc6..a37571680ac3 100644 --- a/tests/drivers/i2s/i2s_additional/testcase.yaml +++ b/tests/drivers/i2s/i2s_additional/testcase.yaml @@ -17,6 +17,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 From c6ea8ec24b69ae9319a63c71db9dd5e85c635365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 3 Mar 2026 12:35:29 +0100 Subject: [PATCH 1970/3334] [nrf fromtree] tests: drivers: audio: Enable dmic_api test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the dmic_api test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 0fba7a62f6de7f8abc68316130392c050c8d567e) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 31 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 26 +--------------- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 +++++ 3 files changed, 39 insertions(+), 25 deletions(-) create mode 100644 tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..ea5828159ef7 --- /dev/null +++ b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires loopback between P1.23 and P1.24. + * For best performance, PDM_CLK shall be on 'Clock pin'. + */ + +/ { + aliases { + dmic-dev = &pdm20; + }; +}; + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +dmic_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; diff --git a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index ebe43a7c825e..1e6f31ac52d0 100644 --- a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,28 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* Test requires loopback between P1.23 and P1.24. - * For best performance, PDM_CLK shall be on 'Clock pin'. - */ - -/ { - aliases { - dmic-dev = &pdm20; - }; -}; - -&pinctrl { - pdm20_default_alt: pdm20_default_alt { - group1 { - psels = , - ; - }; - }; -}; - -dmic_dev: &pdm20 { - status = "okay"; - pinctrl-0 = <&pdm20_default_alt>; - pinctrl-names = "default"; - clock-source = "PCLK32M"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 1071abf4d03be15761503e9285752e89a59bee41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 3 Mar 2026 12:47:42 +0100 Subject: [PATCH 1971/3334] [nrf fromtree] samples: drivers: audio: Enable dmic sample on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the dmic sample on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 8876363d3ff12ad4c03c41c92bec2709cf432e0d) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 25 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 20 +-------------- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ++++++ 3 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..75a8bfdcd913 --- /dev/null +++ b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires loopback between P1.23 and P1.24. + * For best performance, PDM_CLK shall be on 'Clock pin'. + */ + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +dmic_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; diff --git a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index b3e08098722d..1e6f31ac52d0 100644 --- a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,22 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* Test requires loopback between P1.23 and P1.24. - * For best performance, PDM_CLK shall be on 'Clock pin'. - */ - -&pinctrl { - pdm20_default_alt: pdm20_default_alt { - group1 { - psels = , - ; - }; - }; -}; - -dmic_dev: &pdm20 { - status = "okay"; - pinctrl-0 = <&pdm20_default_alt>; - pinctrl-names = "default"; - clock-source = "PCLK32M"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 27f87ec5cb01b6597a040848e4a94c4ff1abbb93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 3 Mar 2026 14:35:20 +0100 Subject: [PATCH 1972/3334] [nrf fromtree] tests: drivers: pwm: Enable pwm_api test on nrf54lm20dk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlays required to run the pwm_api test on nrf54lm20a and nrf54lm20b targets. Signed-off-by: Sebastian Głąb (cherry picked from commit d1e1b2d5f3ab173f06a13c0d5f1018dfb2b0b8fc) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 32 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 6 ++++ .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 6 ++++ 3 files changed, 44 insertions(+) create mode 100644 tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay create mode 100644 tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..2d0e1b07fd2a --- /dev/null +++ b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + pwm-test = &pwm20; + }; +}; + +&pinctrl { + pwm20_alt: pwm20_alt { + group1 { + psels = ; + }; + }; + + pwm20_alt_sleep: pwm20_alt_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm20_alt>; + pinctrl-1 = <&pwm20_alt_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..a669ed1275a8 --- /dev/null +++ b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..a669ed1275a8 --- /dev/null +++ b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" From a5db3bb6b47aaa4c5d2b6a7215d804abe52920f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Tue, 3 Mar 2026 14:44:08 +0100 Subject: [PATCH 1973/3334] [nrf fromtree] tests: drivers: pwm: Enable pwm_gpio_loopback test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the pwm_gpio_loopback test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 3eeea53b61756bb7332c42a0da2af14a0069127b) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 36 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 32 +---------------- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 1 + .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 6 ++++ .../pwm/pwm_gpio_loopback/testcase.yaml | 1 + 5 files changed, 45 insertions(+), 31 deletions(-) create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..326707c43d9c --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + * + * Test requires jumper between: + * - PWM20 OUT[0] at P1.29 <-> GPIO input at P1.00 + */ + +/ { + zephyr,user { + pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>; + gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; + }; +}; + +&pinctrl { + pwm20_alt: pwm20_alt { + group1 { + psels = ; + }; + }; + + pwm20_alt_sleep: pwm20_alt_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm20_alt>; + pinctrl-1 = <&pwm20_alt_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 89ff80dcb677..2309f6a758f6 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,36 +1,6 @@ /* * Copyright (c) 2025 Nordic Semiconductor ASA * SPDX-License-Identifier: Apache-2.0 - * - * Test requires jumper between: - * - PWM20 OUT[0] at P1.29 <-> GPIO input at P1.00 */ -/ { - zephyr,user { - pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>; - gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; - }; -}; - -&pinctrl { - pwm20_alt: pwm20_alt { - group1 { - psels = ; - }; - }; - - pwm20_alt_sleep: pwm20_alt_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; -}; - -&pwm20 { - status = "okay"; - pinctrl-0 = <&pwm20_alt>; - pinctrl-1 = <&pwm20_alt_sleep>; - pinctrl-names = "default", "sleep"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..795414a504ab --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_SKIP_EDGE_NUM=4 diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..a669ed1275a8 --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml index 347e0e9f9772..b7994e228135 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml @@ -22,6 +22,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp From 6cd89a33bad80df137bcebd30e482d043d9292de Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 16 Feb 2026 16:58:24 +0100 Subject: [PATCH 1974/3334] [nrf fromtree] boards: nordic: nrf54lm20dk: add nordic expansion board connector Add nordic,expansion-board-header to the nrf54lm20dk, assigning default SPI and PWM instances. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit e1886c8ce63942c4da74ddb91bdbd62882a91015) --- .../nrf54lm20_a_b_cpuapp_common.dtsi | 18 +++++++++-- .../nrf54lm20_a_b_cpuflpr_common.dtsi | 17 ++++++++++ .../nrf54lm20dk/nrf54lm20dk_common.dtsi | 29 +++++++++++++++++ .../nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi | 32 +++++++++++++++++++ 4 files changed, 94 insertions(+), 2 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi index b097848fe3ee..1b9f488d7407 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi @@ -130,5 +130,19 @@ zephyr_udc0: &usbhs { }; }; -/* Get a node label for wi-fi spi to use in shield files */ -wifi_spi: &spi22 {}; +/* + * Note this SPI instance conflicts with UART30. Disable or reconfigure pinctrl for UART30 + * to use this SPI instance. + */ +nordic_expansion_spi: &spi22 { + cs-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; +}; + +nordic_expansion_pwm: &pwm21 { + pinctrl-0 = <&pwm21_default>; + pinctrl-1 = <&pwm21_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi index 11068b98446c..27e4a3557cb5 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi @@ -53,3 +53,20 @@ &gpiote30 { status = "okay"; }; + +/* + * Note this SPI instance conflicts with UART30. Disable or reconfigure pinctrl for UART30 + * to use this SPI instance. + */ +nordic_expansion_spi: &spi22 { + cs-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; +}; + +nordic_expansion_pwm: &pwm21 { + pinctrl-0 = <&pwm21_default>; + pinctrl-1 = <&pwm21_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi index 335e04deeebf..47e5ace3d389 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi @@ -85,6 +85,35 @@ sw3 = &button3; watchdog0 = &wdt31; }; + + nordic_expansion_header: nordic_expansion_header { + compatible = "nordic,expansion-board-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio3 5 0>, + <1 0 &gpio3 4 0>, + <2 0 &gpio1 2 0>, + <3 0 &gpio1 3 0>, + <4 0 &gpio1 4 0>, + <5 0 &gpio1 13 0>, + <6 0 &gpio3 0 0>, + <7 0 &gpio3 1 0>, + <8 0 &gpio0 3 0>, + <9 0 &gpio0 4 0>, + <10 0 &gpio3 2 0>, + <11 0 &gpio3 3 0>, + <12 0 &gpio1 7 0>, + <13 0 &gpio1 6 0>, + <14 0 &gpio1 5 0>, + <15 0 &gpio3 6 0>, + <16 0 &gpio2 0 0>, + <17 0 &gpio2 1 0>, + <18 0 &gpio2 2 0>, + <19 0 &gpio2 3 0>, + <20 0 &gpio2 4 0>, + <21 0 &gpio2 5 0>; + }; }; &uart20 { diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi index d6a6dbadd146..f338bb3adaa6 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi @@ -99,4 +99,36 @@ low-power-enable; }; }; + + spi22_default: spi22_default { + group1 { + psels = , + , + ; + bias-pull-down; + }; + }; + + spi22_sleep: spi22_sleep { + group1 { + psels = , + , + ; + bias-pull-down; + low-power-enable; + }; + }; + + pwm21_default: pwm21_default { + group1 { + psels = ; + }; + }; + + pwm21_sleep: pwm21_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; }; From 922580a2ef0b06f8a487308533d022054a4602b6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 16 Feb 2026 17:55:37 +0100 Subject: [PATCH 1975/3334] [nrf fromtree] boards: nordic: nrf54lm20dk: enable gpio3 by default gpio3 was not enabled by default. Enable it. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 239bc4618faeb40c60c2d618e93ba5192b8c20ba) --- boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi | 4 ++++ boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi index 1b9f488d7407..7e79fc89935a 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi @@ -77,6 +77,10 @@ status = "okay"; }; +&gpio3 { + status = "okay"; +}; + &gpiote20 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi index 27e4a3557cb5..f7969b3de49c 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi @@ -46,6 +46,10 @@ status = "okay"; }; +&gpio3 { + status = "okay"; +}; + &gpiote20 { status = "okay"; }; From bb4bd0ea64db3ad9fdfc38fd0b102ecfc0170a2b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Tue, 17 Feb 2026 15:35:35 +0100 Subject: [PATCH 1976/3334] [nrf fromtree] boards: nordic: nrf54l15dk: add nordic expansion board connector Add nordic,expansion-board-header to the nrf54l15dk, assigning default SPI and PWM instances. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 0c57145c9c3377ff19f273b6fb6bd7c8f93e97cd) --- .../nordic/nrf54l15dk/nrf54l15dk_common.dtsi | 25 ++++++++++++++++--- .../nrf54l15dk_nrf54l15_cpuflpr.dts | 11 ++++++++ .../nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi | 19 ++++++++++++++ .../nrf54l_05_10_15_cpuapp_common.dtsi | 11 ++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi index c030c2c55189..ad1a1b253ec9 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi @@ -85,6 +85,28 @@ sw3 = &button3; watchdog0 = &wdt31; }; + + /* + * Note the header is marked "PORT P1" on the DK and only + * a subset of the pins are available. + */ + nordic_expansion_header: nordic_expansion_header { + compatible = "nordic,expansion-board-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <4 0 &gpio1 4 0>, + <5 0 &gpio1 5 0>, + <6 0 &gpio1 6 0>, + <7 0 &gpio1 7 0>, + <8 0 &gpio1 8 0>, + <9 0 &gpio1 9 0>, + <10 0 &gpio1 10 0>, + <11 0 &gpio1 11 0>, + <12 0 &gpio1 12 0>, + <13 0 &gpio1 13 0>, + <14 0 &gpio1 14 0>; + }; }; &uart20 { @@ -107,6 +129,3 @@ pinctrl-1 = <&pwm20_sleep>; pinctrl-names = "default", "sleep"; }; - -/* Get a node label for wi-fi spi to use in shield files */ -wifi_spi: &spi22 {}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts index 58bdd2bf59bf..edaad821d37b 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts @@ -75,3 +75,14 @@ &gpiote30 { status = "okay"; }; + +/* + * Note this SPI instance conflicts with UART30. Disable or reconfigure pinctrl for UART30 + * to use this SPI instance. + */ +nordic_expansion_spi: &spi22 { + cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi index 54c2f0241ad0..4b055c2d3e67 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi @@ -99,4 +99,23 @@ low-power-enable; }; }; + + spi22_default: spi22_default { + group1 { + psels = , + , + ; + bias-pull-down; + }; + }; + + spi22_sleep: spi22_sleep { + group1 { + psels = , + , + ; + bias-pull-down; + low-power-enable; + }; + }; }; diff --git a/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi index 37e6a910bdbd..727f9c314ce2 100644 --- a/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi @@ -139,3 +139,14 @@ &adc { status = "okay"; }; + +/* + * Note this SPI instance conflicts with UART30. Disable or reconfigure pinctrl for UART30 + * to use this SPI instance. + */ +nordic_expansion_spi: &spi22 { + cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; +}; From 790448870360bbb2a8d88f87e91d53cbe84a2593 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 6 Mar 2026 19:53:38 +0530 Subject: [PATCH 1977/3334] Revert "[nrf fromlist] boards: shields: Add nRF7002 EB-II shield" This reverts commit 71e8ec66300fe58fc5212f5708f5a32b3e151325. Signed-off-by: Chaitanya Tata --- boards/shields/nrf7002eb2/Kconfig.shield | 14 --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 54 ----------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 89 ------------------ boards/shields/nrf7002eb2/doc/index.rst | 72 -------------- boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg | Bin 49527 -> 0 bytes boards/shields/nrf7002eb2/nrf7002eb2.overlay | 24 ----- .../nrf7002eb2/nrf7002eb2_coex.overlay | 15 --- .../shields/nrf7002eb2/nrf7002eb2_common.dtsi | 20 ---- .../nrf7002eb2/nrf7002eb2_common_5g.dtsi | 12 --- .../nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi | 25 ----- .../nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi | 15 --- .../nrf7002eb2/nrf7002eb2_nrf7000.overlay | 24 ----- .../nrf7002eb2/nrf7002eb2_nrf7001.overlay | 23 ----- boards/shields/nrf7002eb2/shield.yml | 26 ----- 14 files changed, 413 deletions(-) delete mode 100644 boards/shields/nrf7002eb2/Kconfig.shield delete mode 100644 boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 boards/shields/nrf7002eb2/doc/index.rst delete mode 100644 boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2.overlay delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay delete mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay delete mode 100644 boards/shields/nrf7002eb2/shield.yml diff --git a/boards/shields/nrf7002eb2/Kconfig.shield b/boards/shields/nrf7002eb2/Kconfig.shield deleted file mode 100644 index 3a6309b39148..000000000000 --- a/boards/shields/nrf7002eb2/Kconfig.shield +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config SHIELD_NRF7002EB2 - def_bool $(shields_list_contains,nrf7002eb2) - -config SHIELD_NRF7002EB2_NRF7001 - def_bool $(shields_list_contains,nrf7002eb2_nrf7001) - -config SHIELD_NRF7002EB2_NRF7000 - def_bool $(shields_list_contains,nrf7002eb2_nrf7000) - -config SHIELD_NRF7002EB2_COEX - def_bool $(shields_list_contains,nrf7002eb2_coex) diff --git a/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 912d806b5f47..000000000000 --- a/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "../nrf7002eb2_gpio_pins_1.dtsi" - -/ { - chosen { - zephyr,wifi = &wlan0; - zephyr,console = &uart30; - zephyr,shell-uart = &uart30; - zephyr,uart-mcumgr = &uart30; - zephyr,bt-mon-uart = &uart30; - zephyr,bt-c2h-uart = &uart30; - }; -}; - -&pinctrl { - spi22_default: spi22_default { - group1 { - psels = , - , - ; - bias-pull-down; - }; - }; - - spi22_sleep: spi22_sleep { - group1 { - psels = , - , - ; - bias-pull-down; - low-power-enable; - }; - }; -}; - -&spi22 { - cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&uart20 { - status = "disabled"; -}; - -&uart30 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index dcc759345bad..000000000000 --- a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "../nrf7002eb2_gpio_pins_2.dtsi" - -/ { - chosen { - zephyr,wifi = &wlan0; - zephyr,console = &uart30; - zephyr,shell-uart = &uart30; - zephyr,uart-mcumgr = &uart30; - zephyr,bt-mon-uart = &uart30; - zephyr,bt-c2h-uart = &uart30; - }; - - buttons { - /delete-node/ button_3; - }; - - aliases { - /delete-property/ sw3; - }; -}; - -&gpio3 { - status = "okay"; -}; - -&pinctrl { - spi22_default: spi22_default { - group1 { - psels = , - , - ; - bias-pull-down; - }; - }; - - spi22_sleep: spi22_sleep { - group1 { - psels = , - , - ; - bias-pull-down; - low-power-enable; - }; - }; - - uart30_default: uart30_default { - group1 { - psels = ; - }; - - group2 { - psels = ; - bias-pull-up; - }; - }; - - uart30_sleep: uart30_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&spi22 { - status = "okay"; - cs-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; -}; - -/* uart20 has pin conflicts with EB-II shield hence disabling that - * and enabling uart30 as console port. - */ -&uart20 { - status = "disabled"; -}; - -&uart30 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/doc/index.rst b/boards/shields/nrf7002eb2/doc/index.rst deleted file mode 100644 index 6fe033c21221..000000000000 --- a/boards/shields/nrf7002eb2/doc/index.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. _nrf7002eb2: - -nRF7002 EB II -############# - -Overview -******** - -The nRF7002 EB II is a versatile evaluation kit in the form of a thumbstick shield which connects to -compatible Nordic host boards using the Nordic edge-connector. - -The nRF7002 EB II unlocks low-power Wi-Fi 6 capabilities for your host device. It supports dual-band Wi-Fi -2.4GHz and 5GHz, and is based on the nRF7002 SoC. The shield also supports nRF7001 and nRF7000 SoCs -through variant overlays. -Seamlessly connect to Wi-Fi networks and leverage Wi-Fi-based locationing, enabling advanced -features such as SSID sniffing of local Wi-Fi hubs. - -.. figure:: nrf7002eb2.jpg - :alt: nRF7002 EB II - :align: center - - nRF7002 EB II - -Requirements -************ - -The nRF7002 EB II board is designed to fit straight into a Nordic edge-connector and uses SPI as the -communication interface. Any host board that supports the Nordic edge-connector can be used with -the nRF7002 EB II. - -Prerequisites -------------- - -The nRF70 driver requires firmware binary blobs for Wi-Fi operation. Run the command -below to retrieve those files. - -.. code-block:: console - - west update - west blobs fetch nrf_wifi - -Usage -***** - -The shield can be used in any application by setting ``--shield nrf7002eb2`` when invoking ``west build``. - -Shield Variants -*************** - -The nRF7002 EB II has several variants to support different nRF70 SoCs and features: - -- ``nrf7002eb2``: The default variant using the nRF7002 SoC. -- ``nrf7002eb2_nrf7001``: Variant using the nRF7001 SoC. -- ``nrf7002eb2_nrf7000``: Variant using the nRF7000 SoC. -- ``nrf7002eb2_coex``: Variant which includes the COEX pins. These pins are not routed to the - edge-connector on some boards, like earlier revisions of the Thingy53 than v1.0.0. - -SR Co-existence -*************** - -The nRF7002 EB II supports SR co-existence provided the host board supports it. The SR co-existence -pins are connected to the host board's GPIO pins. - -Two Kconfig options are available to enable SR co-existence: - -- :kconfig:option:`CONFIG_NRF70_SR_COEX`: Enables SR co-existence. -- :kconfig:option:`CONFIG_NRF70_SR_COEX_RF_SWITCH`: Control SR side RF switch. - -References -********** - -- `Developing with nRF7002 EB II `_ diff --git a/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg b/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg deleted file mode 100644 index 458093f1662041123b3afae0d83a1aa9e8564ec3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49527 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 z 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 bi4kLg0)r;$UqfF0JMo17SNgvAYwCXh^nayi diff --git a/boards/shields/nrf7002eb2/nrf7002eb2.overlay b/boards/shields/nrf7002eb2/nrf7002eb2.overlay deleted file mode 100644 index 304814fa3040..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2.overlay +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&wifi_spi { - status = "okay"; - - nrf70: nrf7002-spi@0 { - compatible = "nordic,nrf7002-spi"; - status = "okay"; - - /* Include common nRF70 overlays */ - #include "nrf7002eb2_common.dtsi" - #include "nrf7002eb2_common_5g.dtsi" - }; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay deleted file mode 100644 index 36f352bc6a5e..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - nrf_radio_coex: coex { - compatible = "nordic,nrf7002-coex"; - status = "okay"; - status0-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; - req-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; - grant-gpios = <&gpio1 7 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; - }; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi deleted file mode 100644 index efe0703ac9dd..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_common.dtsi +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include - -/* Common assignments for nRF70 EB-II shield */ -reg = <0>; -spi-max-frequency = ; - -/* Maximum TX power limits for 2.4 GHz */ -wifi-max-tx-pwr-2g-dsss = <21>; -wifi-max-tx-pwr-2g-mcs0 = <16>; -wifi-max-tx-pwr-2g-mcs7 = <16>; - -/* List of interfaces */ -wlan0: wlan0 { - compatible = "nordic,wlan"; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi deleted file mode 100644 index 05a472a32bd5..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.dtsi +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -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/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi deleted file mode 100644 index 95ad1ed44221..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_1.dtsi +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - nrf_radio_coex: coex { - compatible = "nordic,nrf7002-coex"; - status = "disabled"; - status0-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; - req-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; - grant-gpios = <&gpio1 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; - }; -}; - -&nrf70 { - iovdd-ctrl-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; - bucken-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; - host-irq-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi b/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi deleted file mode 100644 index dc59273a0314..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_gpio_pins_2.dtsi +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&nrf70 { - iovdd-ctrl-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - bucken-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; - host-irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay deleted file mode 100644 index 22b36e7b27fc..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&wifi_spi { - status = "okay"; - - nrf70: nrf7000-spi@0 { - compatible = "nordic,nrf7000-spi"; - status = "okay"; - - /* Include common nRF70 overlays */ - #include "nrf7002eb2_common.dtsi" - #include "nrf7002eb2_common_5g.dtsi" - }; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay deleted file mode 100644 index 9a9243063a98..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&wifi_spi { - status = "okay"; - - nrf70: nrf7001-spi@0 { - compatible = "nordic,nrf7001-spi"; - status = "okay"; - - /* Include common nRF70 overlays */ - #include "nrf7002eb2_common.dtsi" - }; -}; diff --git a/boards/shields/nrf7002eb2/shield.yml b/boards/shields/nrf7002eb2/shield.yml deleted file mode 100644 index 60349b0a3cb7..000000000000 --- a/boards/shields/nrf7002eb2/shield.yml +++ /dev/null @@ -1,26 +0,0 @@ -# @Kconfig.shield - -shields: - - name: nrf7002eb2 - full_name: nRF7002 EB-II Shield - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_nrf7001 - full_name: nRF7002 EB-II Shield (nRF7001) - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_nrf7000 - full_name: nRF7002 EB-II Shield (nRF7000) - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_coex - full_name: nRF7002 EB-II Shield (SR Co-Existence) - vendor: nordic - supported_features: - - wifi From 3745ff32028ed876833ad9320264db75e69dca40 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 19 Nov 2025 11:36:53 +0530 Subject: [PATCH 1978/3334] [nrf fromtree] boards: shields: Add nRF7002 EB-II shield This is primarily intended for providing Wi-Fi capabilities for the nRF54L Series hosts using SPI. Signed-off-by: Chaitanya Tata Signed-off-by: Bansidhar Mangalwedhekar (cherry picked from commit 02b90eee89046e64ded83def84f7e50847265222) --- MAINTAINERS.yml | 2 +- boards/shields/nrf7002eb2/Kconfig.shield | 14 ++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 9 ++ .../nrf54l15dk_nrf54l15_cpuapp_ns.overlay | 9 ++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 9 ++ .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay | 9 ++ .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 ++ .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 9 ++ boards/shields/nrf7002eb2/doc/index.rst | 135 ++++++++++++++++++ boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg | Bin 0 -> 49527 bytes boards/shields/nrf7002eb2/nrf54l15.overlay | 35 +++++ boards/shields/nrf7002eb2/nrf54lm20.overlay | 57 ++++++++ boards/shields/nrf7002eb2/nrf7002eb2.overlay | 32 +++++ .../nrf7002eb2/nrf7002eb2_coex.overlay | 18 +++ .../nrf7002eb2/nrf7002eb2_common.overlay | 22 +++ .../nrf7002eb2/nrf7002eb2_common_5g.overlay | 14 ++ .../nrf7002eb2/nrf7002eb2_nrf7000.overlay | 32 +++++ .../nrf7002eb2/nrf7002eb2_nrf7001.overlay | 31 ++++ boards/shields/nrf7002eb2/shield.yml | 26 ++++ doc/releases/release-notes-4.4.rst | 5 + 20 files changed, 476 insertions(+), 1 deletion(-) create mode 100644 boards/shields/nrf7002eb2/Kconfig.shield create mode 100644 boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay create mode 100644 boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay create mode 100644 boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay create mode 100644 boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay create mode 100644 boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay create mode 100644 boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay create mode 100644 boards/shields/nrf7002eb2/doc/index.rst create mode 100644 boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg create mode 100644 boards/shields/nrf7002eb2/nrf54l15.overlay create mode 100644 boards/shields/nrf7002eb2/nrf54lm20.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_common_5g.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay create mode 100644 boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay create mode 100644 boards/shields/nrf7002eb2/shield.yml diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index efdd9e61ecd9..48e29dd29e7d 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -2639,7 +2639,7 @@ Documentation Infrastructure: - dts/bindings/wifi/nordic,nrf7001-qspi.yaml - dts/bindings/wifi/nordic,nrf7001-spi.yaml - dts/bindings/wifi/nordic,nrf7120-wifi.yaml - - boards/shields/nrf7002ek/ + - boards/shields/nrf7002e*/ labels: - "area: Wi-Fi" diff --git a/boards/shields/nrf7002eb2/Kconfig.shield b/boards/shields/nrf7002eb2/Kconfig.shield new file mode 100644 index 000000000000..9dec8cbaf3cf --- /dev/null +++ b/boards/shields/nrf7002eb2/Kconfig.shield @@ -0,0 +1,14 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_NRF7002EB2 + def_bool $(shields_list_contains,nrf7002eb2) + +config SHIELD_NRF7002EB2_NRF7001 + def_bool $(shields_list_contains,nrf7002eb2_nrf7001) + +config SHIELD_NRF7002EB2_NRF7000 + def_bool $(shields_list_contains,nrf7002eb2_nrf7000) + +config SHIELD_NRF7002EB2_COEX + def_bool $(shields_list_contains,nrf7002eb2_coex) diff --git a/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..dd4eef5aa4d7 --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * nRF7002 EB-II board overlay for nrf54l15dk/nrf54l15/cpuapp. + * Includes common SoC overlay snippet. + */ +#include "../nrf54l15.overlay" diff --git a/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay new file mode 100644 index 000000000000..60d402e78de1 --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * nRF7002 EB-II board overlay for nrf54l15dk/nrf54l15/cpuapp/ns. + * Includes common SoC overlay snippet. + */ +#include "../nrf54l15.overlay" diff --git a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay new file mode 100644 index 000000000000..2704eb235dc7 --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * nRF7002 EB-II board overlay for nrf54lm20dk/nrf54lm20a/cpuapp. + * Includes common SoC overlay snippet. + */ +#include "../nrf54lm20.overlay" diff --git a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay new file mode 100644 index 000000000000..e5974c907074 --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * nRF7002 EB-II board overlay for nrf54lm20dk/nrf54lm20a/cpuapp/ns. + * Includes common SoC overlay snippet. + */ +#include "../nrf54lm20.overlay" diff --git a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..d0f861e3455d --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * nRF7002 EB-II board overlay for nrf54lm20dk/nrf54lm20b/cpuapp. + * Includes common SoC overlay snippet. + */ +#include "../nrf54lm20.overlay" diff --git a/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay new file mode 100644 index 000000000000..33c00feca151 --- /dev/null +++ b/boards/shields/nrf7002eb2/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * nRF7002 EB-II board overlay for nrf54lm20dk/nrf54lm20b/cpuapp/ns. + * Includes common SoC overlay snippet. + */ +#include "../nrf54lm20.overlay" diff --git a/boards/shields/nrf7002eb2/doc/index.rst b/boards/shields/nrf7002eb2/doc/index.rst new file mode 100644 index 000000000000..a5deb054bbcf --- /dev/null +++ b/boards/shields/nrf7002eb2/doc/index.rst @@ -0,0 +1,135 @@ +.. _nrf7002eb2: + +nRF7002 EB II +############# + +Overview +******** + +The nRF7002 EB II is a versatile evaluation kit in the form of a thumbstick shield which connects to +compatible Nordic host boards using the Nordic expansion header. + +The nRF7002 EB II unlocks low-power Wi-Fi 6 capabilities for your host device. It supports dual-band Wi-Fi +2.4GHz and 5GHz, and is based on the nRF7002 SoC. The shield also supports nRF7001 and nRF7000 SoCs +through variant overlays. +Seamlessly connect to Wi-Fi networks and leverage Wi-Fi-based locationing, enabling advanced +features such as SSID sniffing of local Wi-Fi hubs. + +.. figure:: nrf7002eb2.jpg + :alt: nRF7002 EB II + :align: center + + nRF7002 EB II + +Requirements +************ + +The nRF7002 EB II board is designed to fit straight into a Nordic expansion header and uses SPI as the +communication interface. Any host board that supports the Nordic expansion header can be used with +the nRF7002 EB II. + +Prerequisites +------------- + +The nRF70 driver requires firmware binary blobs for Wi-Fi operation. Run the command +below to retrieve those files. + +.. code-block:: console + + west update + west blobs fetch nrf_wifi + +Usage +***** + +The shield can be used in any application by setting ``--shield nrf7002eb2`` when invoking +``west build``. + +Console and UART impact +*********************** + +On nRF54L15 DK and nRF54LM20 DK, the expansion header pins conflict with the pins used by +Virtual Serial Port 1 (VCOM1). + +Because the application core (CPUAPP) is essential, the shield overlay disables the conflicting +UART20 and reroutes the application console (including shell, mcumgr, and Bluetooth monitor) to +UART30, which maps to VCOM0. + +Key changes and requirements +============================ + +- **Virtual Serial Port Swap**: The application console moves from the secondary port to the + primary port (the first enumerated VCOM port on your OS). You must use this primary port (e.g. + the lower-numbered ttyACM on Linux or COM port on Windows) for all shell, flashing, and mcumgr + tasks. +- **Mandatory Step**: VCOM1 (the secondary port) must be disabled in the + `nRF Connect Board Configurator + `_ for the + shield to function. +- **Physical Limitation**: Since VCOM1 is electrically blocked by the shield, only one virtual + serial port (VCOM0) remains functional. +- **FLPR Core**: Because the application core claims the only functional port (VCOM0), the FLPR + core has no UART output by default. Even if FLPR is remapped to a different UART instance via + an overlay, it cannot be routed to the PC via USB unless the application core's console is + disabled to free up the VCOM0 gateway. As a fallback for FLPR console output when using the + shield, use the ``rtt-console`` snippet. + +UART and port mapping +===================== + +.. list-table:: UART and port mapping with shield + :header-rows: 1 + :widths: auto + + * - Feature + - Standard (no shield) + - With shield attached + * - App core UART instance + - UART20 + - UART30 + * - App core virtual serial port + - Serial port 1 + - Serial port 0 + * - FLPR core UART instance + - UART30 + - None + * - FLPR core virtual serial port + - Serial port 0 + - None + * - Board configurator + - All ports enabled + - Disable VCOM1 + +.. caution:: + If you have multiple devices connected, identify the primary port for this specific board. + Using the secondary port (VCOM1) while the shield is attached will cause pin conflicts and + hardware instability. + +Shield Variants +*************** + +The nRF7002 EB II has several variants to support different nRF70 SoCs and features: + +- ``nrf7002eb2``: The default variant using the nRF7002 SoC. +- ``nrf7002eb2_nrf7001``: Variant using the nRF7001 SoC. +- ``nrf7002eb2_nrf7000``: Variant using the nRF7000 SoC. +- ``nrf7002eb2_coex``: Adds SR co-existence pins only. It cannot be used standalone; it extends + one of the main shields (e.g. ``nrf7002eb2`` or ``nrf7002eb2_nrf7000``) by passing both in a + single ``--shield`` argument, for example: ``--shield "nrf7002eb2;nrf7002eb2_coex"``. + +SR Co-existence +*************** + +The nRF7002 EB II supports SR co-existence provided the host board supports it. The SR co-existence +pins are connected to the host board's GPIO pins. Enable it by using the ``nrf7002eb2_coex`` shield +together with one of the main shields (see Shield Variants above). + +Two Kconfig options are available to enable SR co-existence: + +- :kconfig:option:`CONFIG_NRF70_SR_COEX`: Enables SR co-existence. +- :kconfig:option:`CONFIG_NRF70_SR_COEX_RF_SWITCH`: Control SR side RF switch. + +References +********** + +- `Developing with nRF7002 EB II `_ diff --git a/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg b/boards/shields/nrf7002eb2/doc/nrf7002eb2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..458093f1662041123b3afae0d83a1aa9e8564ec3 GIT binary patch literal 49527 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 z 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 bi4kLg0)r;$UqfF0JMo17SNgvAYwCXh^nayi literal 0 HcmV?d00001 diff --git a/boards/shields/nrf7002eb2/nrf54l15.overlay b/boards/shields/nrf7002eb2/nrf54l15.overlay new file mode 100644 index 000000000000..785c55e78c09 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf54l15.overlay @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * nRF7002 EB-II SoC overlay for nRF54L15 (cpuapp and cpuapp_ns). + * SPI and GPIOs come from root overlay via nordic_expansion_spi and + * nordic_expansion_header. + */ + +/* Conflicts with nRF7002 EB-II SPI-CS pin */ +/delete-node/ &led1; + +/* UART20 conflicts with EB-II shield; use UART30 */ +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,uart-mcumgr = &uart30; + zephyr,bt-mon-uart = &uart30; + zephyr,bt-c2h-uart = &uart30; + }; + + aliases { + /delete-property/ led1; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/nrf54lm20.overlay b/boards/shields/nrf7002eb2/nrf54lm20.overlay new file mode 100644 index 000000000000..d644ddd2a942 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf54lm20.overlay @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * nRF7002 EB-II SoC overlay for nRF54L(m)20 (all variants). + * SPI and GPIOs come from root overlay via nordic_expansion_spi and + * nordic_expansion_header. + */ + +/* UART20 conflicts with EB-II shield; use UART30 */ +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,uart-mcumgr = &uart30; + zephyr,bt-mon-uart = &uart30; + zephyr,bt-c2h-uart = &uart30; + }; + + buttons { + /delete-node/ button_3; + }; + + aliases { + /delete-property/ sw3; + }; +}; + +&pinctrl { + uart30_default: uart30_default { + group1 { + psels = ; + }; + + group2 { + psels = ; + bias-pull-up; + }; + }; + + uart30_sleep: uart30_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&uart20 { + status = "disabled"; +}; + +&uart30 { + status = "okay"; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2.overlay b/boards/shields/nrf7002eb2/nrf7002eb2.overlay new file mode 100644 index 000000000000..03facb4632c8 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * Uses nordic_expansion_spi and nordic_expansion_header nexus nodes. + * Supported on nRF54L15 DK and nRF54L(m)20 DK which both define these nodes. + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&nordic_expansion_spi { + status = "okay"; + + nrf70: nrf7002-spi@0 { + compatible = "nordic,nrf7002-spi"; + status = "okay"; + + #include "nrf7002eb2_common.overlay" + #include "nrf7002eb2_common_5g.overlay" + }; +}; + +&nrf70 { + iovdd-ctrl-gpios = <&nordic_expansion_header 5 GPIO_ACTIVE_HIGH>; + bucken-gpios = <&nordic_expansion_header 4 GPIO_ACTIVE_HIGH>; + host-irq-gpios = <&nordic_expansion_header 14 GPIO_ACTIVE_HIGH>; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay new file mode 100644 index 000000000000..e60662b8a848 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * SR co-existence via nordic_expansion_header (same nexus as main shield; + * nRF54L15 DK and nRF54L(m)20 DK). + */ + +/ { + nrf_radio_coex: coex { + compatible = "nordic,nrf7002-coex"; + status = "okay"; + status0-gpios = <&nordic_expansion_header 8 GPIO_ACTIVE_HIGH>; + req-gpios = <&nordic_expansion_header 9 GPIO_ACTIVE_HIGH>; + grant-gpios = <&nordic_expansion_header 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; + }; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_common.overlay new file mode 100644 index 000000000000..237a3494c552 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_common.overlay @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * Common overlay snippet for nRF70 EB-II shield (included by shield overlays). + */ +#include + +/* Common assignments for nRF70 EB-II shield */ +reg = <0>; +spi-max-frequency = ; + +/* Maximum TX power limits for 2.4 GHz */ +wifi-max-tx-pwr-2g-dsss = <21>; +wifi-max-tx-pwr-2g-mcs0 = <16>; +wifi-max-tx-pwr-2g-mcs7 = <16>; + +/* List of interfaces */ +wlan0: wlan0 { + compatible = "nordic,wlan"; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.overlay new file mode 100644 index 000000000000..16fbd991ae14 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * Common 5 GHz TX power overlay snippet for nRF70 EB-II shield. + */ + +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/nrf7002eb2/nrf7002eb2_nrf7000.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay new file mode 100644 index 000000000000..236981ec0745 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * Uses nordic_expansion_spi and nordic_expansion_header nexus nodes. + * Supported on nRF54L15 DK and nRF54L(m)20 DK which both define these nodes. + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&nordic_expansion_spi { + status = "okay"; + + nrf70: nrf7000-spi@0 { + compatible = "nordic,nrf7000-spi"; + status = "okay"; + + #include "nrf7002eb2_common.overlay" + #include "nrf7002eb2_common_5g.overlay" + }; +}; + +&nrf70 { + iovdd-ctrl-gpios = <&nordic_expansion_header 5 GPIO_ACTIVE_HIGH>; + bucken-gpios = <&nordic_expansion_header 4 GPIO_ACTIVE_HIGH>; + host-irq-gpios = <&nordic_expansion_header 14 GPIO_ACTIVE_HIGH>; +}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay new file mode 100644 index 000000000000..ab95a2b74c67 --- /dev/null +++ b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + * + * Uses nordic_expansion_spi and nordic_expansion_header nexus nodes. + * Supported on nRF54L15 DK and nRF54L(m)20 DK which both define these nodes. + */ + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&nordic_expansion_spi { + status = "okay"; + + nrf70: nrf7001-spi@0 { + compatible = "nordic,nrf7001-spi"; + status = "okay"; + + #include "nrf7002eb2_common.overlay" + }; +}; + +&nrf70 { + iovdd-ctrl-gpios = <&nordic_expansion_header 5 GPIO_ACTIVE_HIGH>; + bucken-gpios = <&nordic_expansion_header 4 GPIO_ACTIVE_HIGH>; + host-irq-gpios = <&nordic_expansion_header 14 GPIO_ACTIVE_HIGH>; +}; diff --git a/boards/shields/nrf7002eb2/shield.yml b/boards/shields/nrf7002eb2/shield.yml new file mode 100644 index 000000000000..60349b0a3cb7 --- /dev/null +++ b/boards/shields/nrf7002eb2/shield.yml @@ -0,0 +1,26 @@ +# @Kconfig.shield + +shields: + - name: nrf7002eb2 + full_name: nRF7002 EB-II Shield + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_nrf7001 + full_name: nRF7002 EB-II Shield (nRF7001) + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_nrf7000 + full_name: nRF7002 EB-II Shield (nRF7000) + vendor: nordic + supported_features: + - wifi + + - name: nrf7002eb2_coex + full_name: nRF7002 EB-II Shield (SR Co-Existence) + vendor: nordic + supported_features: + - wifi diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 14b0dd27acab..3ab677b34094 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -277,6 +277,11 @@ New Shields .. Same as above, this will also be recomputed at the time of the release. + +* Nordic Semiconductor ASA + + * :ref:`nrf7002eb2 ` (nRF7002 EB II) + New Drivers *********** From 5e6207de283c234b1f55579aa1125f4d28811363 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Thu, 5 Mar 2026 23:43:49 +0530 Subject: [PATCH 1979/3334] [nrf fromtree] samples: net: wifi: shell: Add nRF7002Eb2 combos to twister Add nRF7002EB2 with 54LM20 Series platforms to twister, 54L15 is not added due to its low RAM. Signed-off-by: Chaitanya Tata (cherry picked from commit 3bb97ca73aae7c1ee34889b1ded7d13457242095) --- boards/shields/nrf7002eb2/doc/index.rst | 4 ++-- samples/net/wifi/shell/sample.yaml | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/boards/shields/nrf7002eb2/doc/index.rst b/boards/shields/nrf7002eb2/doc/index.rst index a5deb054bbcf..02737c192297 100644 --- a/boards/shields/nrf7002eb2/doc/index.rst +++ b/boards/shields/nrf7002eb2/doc/index.rst @@ -56,7 +56,7 @@ UART20 and reroutes the application console (including shell, mcumgr, and Blueto UART30, which maps to VCOM0. Key changes and requirements -============================ +---------------------------- - **Virtual Serial Port Swap**: The application console moves from the secondary port to the primary port (the first enumerated VCOM port on your OS). You must use this primary port (e.g. @@ -75,7 +75,7 @@ Key changes and requirements shield, use the ``rtt-console`` snippet. UART and port mapping -===================== +--------------------- .. list-table:: UART and port mapping with shield :header-rows: 1 diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index ce8ec12b1441..fbbc199b2d22 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -77,6 +77,15 @@ tests: - thingy53/nrf5340/cpuapp integration_platforms: - thingy53/nrf5340/cpuapp + sample.net.wifi.nrf7002eb2: + extra_args: + - CONFIG_BUILD_ONLY_NO_BLOBS=y + - SHIELD=nrf7002eb2 + platform_allow: + - nrf54lm20dk/nrf54lm20b/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp/ns + integration_platforms: + - nrf54lm20dk/nrf54lm20b/cpuapp sample.net.wifi.nxp_wifi: extra_args: - CONFIG_BUILD_ONLY_NO_BLOBS=y From d939d911ee5f34fb9a0fdb3ff80de01337801448 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Tue, 24 Feb 2026 15:36:25 +0100 Subject: [PATCH 1980/3334] Revert "[nrf noup] bluetooth: Temporary Kconfig fix for BT RPC configuration" nrf-squash! [nrf noup] bluetooth: Temporary Kconfig fix for BT RPC configuration This reverts commit a87ca4c92469a6ef8118c29785e8f5ac36111b75. Signed-off-by: Damian Krolik --- drivers/bluetooth/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index e64a33f663ce..a1680af6583d 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -12,7 +12,7 @@ menuconfig BT_DRIVERS bool "Bluetooth drivers" default y - depends on BT && BT_HCI + depends on BT if BT_DRIVERS From 670284f8e429dd2eb8dcac8ba0cba3244aef7e78 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Wed, 25 Feb 2026 14:54:43 +0100 Subject: [PATCH 1981/3334] [nrf fromtree] boards: enable BT_HCI_IPC by default only if BT_HCI Boards based on Nordic Semiconductor's nRF53 and nRF54H series enable the Bluetooth HCI IPC driver whenever BT is set, even though the original BT_HCI_IPC symbol depends also on BT_HCI. Signed-off-by: Damian Krolik (cherry picked from commit 02191db6fe3aaa809a75743b4eb9561a08d32fc2) --- boards/ezurio/bl5340_dvk/Kconfig.defconfig | 2 +- boards/native/nrf_bsim/Kconfig.defconfig | 2 +- boards/nordic/nrf5340_audio_dk/Kconfig.defconfig | 2 +- boards/nordic/nrf5340dk/Kconfig.defconfig | 2 +- boards/nordic/nrf54h20dk/Kconfig.defconfig | 2 +- boards/nordic/nrf7002dk/Kconfig | 2 +- boards/nordic/thingy53/Kconfig.defconfig | 2 +- boards/panasonic/pan1783/Kconfig.defconfig | 2 +- boards/raytac/an7002q_db/Kconfig | 2 +- boards/raytac/mdbt53_db_40/Kconfig.defconfig | 2 +- boards/raytac/mdbt53v_db_40/Kconfig.defconfig | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/boards/ezurio/bl5340_dvk/Kconfig.defconfig b/boards/ezurio/bl5340_dvk/Kconfig.defconfig index 2f93c265e0a2..1c6bfdc79489 100644 --- a/boards/ezurio/bl5340_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl5340_dvk/Kconfig.defconfig @@ -58,7 +58,7 @@ config FLASH_LOAD_SIZE endif # BOARD_BL5340_DVK_NRF5340_CPUAPP_NS config BT_HCI_IPC - default y if BT + default y if BT_HCI config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/native/nrf_bsim/Kconfig.defconfig b/boards/native/nrf_bsim/Kconfig.defconfig index 393db8060ded..356650438d00 100644 --- a/boards/native/nrf_bsim/Kconfig.defconfig +++ b/boards/native/nrf_bsim/Kconfig.defconfig @@ -50,7 +50,7 @@ config IPC_SERVICE_BACKEND_RPMSG_SHMEM_RESET default y if IPC_SERVICE_BACKEND_RPMSG config BT_HCI_IPC - default y if BT + default y if BT_HCI endif # BOARD_NRF5340BSIM_NRF5340_CPUAPP diff --git a/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig b/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig index 0ba5af149073..de77a9846f82 100644 --- a/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig @@ -57,7 +57,7 @@ config FLASH_LOAD_SIZE endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS config BT_HCI_IPC - default y if BT + default y if BT_HCI config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/nordic/nrf5340dk/Kconfig.defconfig b/boards/nordic/nrf5340dk/Kconfig.defconfig index 7cfbc6731930..c0ac00bcfe54 100644 --- a/boards/nordic/nrf5340dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340dk/Kconfig.defconfig @@ -54,7 +54,7 @@ config BOARD_NRF5340DK select USE_DT_CODE_PARTITION if BOARD_NRF5340DK_NRF5340_CPUAPP_NS config BT_HCI_IPC - default y if BT + default y if BT_HCI config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 8c532b093c97..3aaca9795ffa 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -7,7 +7,7 @@ config HW_STACK_PROTECTION if BOARD_NRF54H20DK_NRF54H20_CPUAPP config BT_HCI_IPC - default y if BT + default y if BT_HCI config MAX_THREAD_BYTES default 3 if USERSPACE diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index d4b7030a65ab..c56650c74c68 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -15,7 +15,7 @@ if BOARD_NRF7002DK_NRF5340_CPUAPP || \ BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS config BT_HCI_IPC - default y if BT + default y if BT_HCI config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index c75f7bfee6d5..4a478c8db254 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -80,7 +80,7 @@ endif # BOARD_THINGY53_NRF5340_CPUAPP_NS if !TRUSTED_EXECUTION_SECURE config BT_HCI_IPC - default y if BT + default y if BT_HCI config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/panasonic/pan1783/Kconfig.defconfig b/boards/panasonic/pan1783/Kconfig.defconfig index f240f37ef85d..454cc43b6687 100644 --- a/boards/panasonic/pan1783/Kconfig.defconfig +++ b/boards/panasonic/pan1783/Kconfig.defconfig @@ -6,7 +6,7 @@ if SOC_NRF5340_CPUAPP_QKAA config BT_HCI_IPC - default y if BT + default y if BT_HCI config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/raytac/an7002q_db/Kconfig b/boards/raytac/an7002q_db/Kconfig index f5493e172d71..c59b71853ebb 100644 --- a/boards/raytac/an7002q_db/Kconfig +++ b/boards/raytac/an7002q_db/Kconfig @@ -13,7 +13,7 @@ config MBOX_NRFX_IPC if BOARD_RAYTAC_AN7002Q_DB_NRF5340_CPUAPP config BT_HCI_IPC - default y if BT + default y if BT_HCI 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 40ae18ba31b9..128e5fc62dbc 100644 --- a/boards/raytac/mdbt53_db_40/Kconfig.defconfig +++ b/boards/raytac/mdbt53_db_40/Kconfig.defconfig @@ -54,7 +54,7 @@ config FLASH_LOAD_SIZE endif # BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS config BT_HCI_IPC - default y if BT + default y if BT_HCI 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 61e7592cc66f..c30d57c073d0 100644 --- a/boards/raytac/mdbt53v_db_40/Kconfig.defconfig +++ b/boards/raytac/mdbt53v_db_40/Kconfig.defconfig @@ -54,7 +54,7 @@ config FLASH_LOAD_SIZE endif # BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS config BT_HCI_IPC - default y if BT + default y if BT_HCI config HEAP_MEM_POOL_ADD_SIZE_BOARD int From 78880bfbf8beb2b31ee3e2dac9946893a157f74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 4 Mar 2026 13:34:34 +0100 Subject: [PATCH 1982/3334] [nrf fromtree] tests: drivers: i2c: Enable i2c_nrfx_twim test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the i2c_nrfx_twim test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit c1cb5d97d7e60bed5f97cc2758862afffca5a14c) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 67 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 62 +---------------- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ++ tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml | 1 + 4 files changed, 76 insertions(+), 61 deletions(-) create mode 100644 tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..179db1de6040 --- /dev/null +++ b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P1.13 and P1.14 + * SCL = P1.23 and P1.24 + */ + +/ { + aliases { + i2c-controller = &i2c21; + i2c-controller-target = &i2c22; + }; +}; + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default: i2c22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep: i2c22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c22_default>; + pinctrl-1 = <&i2c22_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; +}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 1fc56cc63298..1e6f31ac52d0 100644 --- a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,64 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * SDA = P1.13 and P1.14 - * SCL = P1.23 and P1.24 - */ - -/ { - aliases { - i2c-controller = &i2c21; - i2c-controller-target = &i2c22; - }; -}; - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml index 21cc44aa5369..c50ec53893bb 100644 --- a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml +++ b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml @@ -15,6 +15,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf5340dk/nrf5340/cpuapp From 21a018dd3ed626f30b04a770120bd349d7a54c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 4 Mar 2026 13:18:00 +0100 Subject: [PATCH 1983/3334] [nrf fromtree] samples: drivers: i2c: Enable rtio_loopback sample on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the rtio_loopback sample on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit c84e4e388847296f7e7a6aa71a2f79d90ea74eaf) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 67 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 62 +---------------- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 4 ++ .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ++ samples/drivers/i2c/rtio_loopback/sample.yaml | 1 + 5 files changed, 80 insertions(+), 61 deletions(-) create mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf create mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..179db1de6040 --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P1.13 and P1.14 + * SCL = P1.23 and P1.24 + */ + +/ { + aliases { + i2c-controller = &i2c21; + i2c-controller-target = &i2c22; + }; +}; + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default: i2c22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep: i2c22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c22_default>; + pinctrl-1 = <&i2c22_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; +}; diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 1fc56cc63298..1e6f31ac52d0 100644 --- a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,64 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * SDA = P1.13 and P1.14 - * SCL = P1.23 and P1.24 - */ - -/ { - aliases { - i2c-controller = &i2c21; - i2c-controller-target = &i2c22; - }; -}; - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..7dfef7da2839 --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/samples/drivers/i2c/rtio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/drivers/i2c/rtio_loopback/sample.yaml b/samples/drivers/i2c/rtio_loopback/sample.yaml index de3c2cb237ce..5c0c91cb9507 100644 --- a/samples/drivers/i2c/rtio_loopback/sample.yaml +++ b/samples/drivers/i2c/rtio_loopback/sample.yaml @@ -18,6 +18,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - nucleo_f401re - nucleo_h503rb From 39f4c35e44516b7e79dc247096448a9e9344077d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 4 Mar 2026 13:10:55 +0100 Subject: [PATCH 1984/3334] [nrf fromtree] tests: drivers: i2c: Enable i2c_target_api test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the i2c_target_api test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit d788ad5d3bda34c3d1e942ebf66bcac2e842495d) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 74 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 69 +---------------- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 1 + .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ++ .../drivers/i2c/i2c_target_api/testcase.yaml | 1 + 5 files changed, 84 insertions(+), 68 deletions(-) create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..3b9ac5275a17 --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDA = P1.13 and P1.14 + * SCL = P1.23 and P1.24 + */ + +&pinctrl { + i2c21_default: i2c21_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c21_sleep: i2c21_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default: i2c22_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep: i2c22_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c21 { + pinctrl-0 = <&i2c21_default>; + pinctrl-1 = <&i2c21_sleep>; + pinctrl-names = "default", "sleep"; + zephyr,concat-buf-size = <256>; + status = "okay"; + + eeprom1: eeprom@56 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x56>; + address-width = <8>; + size = <256>; + }; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c22_default>; + pinctrl-1 = <&i2c22_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; + + eeprom0: eeprom@54 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x54>; + address-width = <8>; + size = <256>; + }; +}; diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index f6d76c7253c2..1e6f31ac52d0 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,71 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * SDA = P1.13 and P1.14 - * SCL = P1.23 and P1.24 - */ - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; - - eeprom1: eeprom@56 { - compatible = "zephyr,i2c-target-eeprom"; - reg = <0x56>; - address-width = <8>; - size = <256>; - }; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; - - eeprom0: eeprom@54 { - compatible = "zephyr,i2c-target-eeprom"; - reg = <0x54>; - address-width = <8>; - size = <256>; - }; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..2510d6673c1b --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2c/i2c_target_api/testcase.yaml b/tests/drivers/i2c/i2c_target_api/testcase.yaml index c8c34853d842..c64b4333acc0 100644 --- a/tests/drivers/i2c/i2c_target_api/testcase.yaml +++ b/tests/drivers/i2c/i2c_target_api/testcase.yaml @@ -73,6 +73,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - s32k5xxcvb/s32k566/m7 From 9bdcc1c711c18d828bc5e694a1e3039b7f061f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 4 Mar 2026 13:05:00 +0100 Subject: [PATCH 1985/3334] [nrf fromtree] tests: boards: nrf: i2c: Enable i2c_slave test on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the i2c_slave test on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit f1d1d59c4c560efac9d7c9f43a36ac3e879a9d43) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 73 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 69 +----------------- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ++ tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 2 + 4 files changed, 84 insertions(+), 67 deletions(-) create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..a84e0b6ccfa2 --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,73 @@ +/* + * Copyright 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Two loopbacks are required: + * P1.13 - P1.14 + * P1.23 - P1.24 + */ + +/ { + aliases { + i2c-slave = &i2c22; + }; +}; + +&pinctrl { + i2c21_default_alt: i2c21_default_alt { + group1 { + psels = , + ; + }; + }; + + i2c21_sleep_alt: i2c21_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c22_default_alt: i2c22_default_alt { + group1 { + /* Temporary workaround as it is currently not possible + * to configure pins for TWIS with pinctrl. + */ + psels = , + ; + bias-pull-up; + }; + }; + + i2c22_sleep_alt: i2c22_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut_twim: &i2c21 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c21_default_alt>; + pinctrl-1 = <&i2c21_sleep_alt>; + pinctrl-names = "default", "sleep"; + + sensor: sensor@54 { + reg = <0x54>; + }; +}; + +&i2c22 { + compatible = "nordic,nrf-twis"; + status = "okay"; + pinctrl-0 = <&i2c22_default_alt>; + pinctrl-1 = <&i2c22_sleep_alt>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index e1655d2cf649..c42c42bef059 100644 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,72 +1,7 @@ /* * Copyright 2025 Nordic Semiconductor ASA + * * SPDX-License-Identifier: Apache-2.0 */ -/* - * Two loopbacks are required: - * P1.13 - P1.14 - * P1.23 - P1.24 - */ - -/ { - aliases { - i2c-slave = &i2c22; - }; -}; - -&pinctrl { - i2c21_default_alt: i2c21_default_alt { - group1 { - psels = , - ; - }; - }; - - i2c21_sleep_alt: i2c21_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default_alt: i2c22_default_alt { - group1 { - /* Temporary workaround as it is currently not possible - * to configure pins for TWIS with pinctrl. - */ - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep_alt: i2c22_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut_twim: &i2c21 { - compatible = "nordic,nrf-twim"; - status = "okay"; - pinctrl-0 = <&i2c21_default_alt>; - pinctrl-1 = <&i2c21_sleep_alt>; - pinctrl-names = "default", "sleep"; - - sensor: sensor@54 { - reg = <0x54>; - }; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - status = "okay"; - pinctrl-0 = <&i2c22_default_alt>; - pinctrl-1 = <&i2c22_sleep_alt>; - pinctrl-names = "default", "sleep"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..b02ef78c94dd --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index c2e885ec6a00..2e0191e4af2d 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -17,6 +17,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -41,6 +42,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 From bb64af1f03d2a623cbbd3920c5ebd07d40491004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 4 Mar 2026 12:56:07 +0100 Subject: [PATCH 1986/3334] [nrf fromtree] samples: drivers: counter: Enable alarm sample on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the alarm sample on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 3ce67933a834908dd36dbcfb917c59ab0fc8d2be) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 15 +++++++++++++++ .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 14 ++++++-------- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 +++++++ samples/drivers/counter/alarm/sample.yaml | 1 + 4 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..58bd61b77da9 --- /dev/null +++ b/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + counter = &timer24; + }; +}; + +&timer24 { + status = "okay"; +}; diff --git a/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 0847233437ba..1e6f31ac52d0 100644 --- a/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,9 +1,7 @@ -/ { - chosen { - counter = &timer24; - }; -}; +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ -&timer24 { - status = "okay"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/samples/drivers/counter/alarm/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/drivers/counter/alarm/sample.yaml b/samples/drivers/counter/alarm/sample.yaml index f1e21dea1108..8f375b30a56c 100644 --- a/samples/drivers/counter/alarm/sample.yaml +++ b/samples/drivers/counter/alarm/sample.yaml @@ -28,6 +28,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - nrf9160dk/nrf9160 - sama7g54_ek From 7333892035bf31d25093a496a8d0c869b3fd24da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 4 Mar 2026 12:34:58 +0100 Subject: [PATCH 1987/3334] [nrf fromtree] samples: drivers: Enable spi_bitbang on nrf54lm20b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the spi_bitbang sample on nrf54lm20b. Signed-off-by: Sebastian Głąb (cherry picked from commit 6666899d73ab762dc1492b37fd583fcf3bd615cc) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 23 +++++++++++++++++++ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 18 +-------------- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ++++++ samples/drivers/spi_bitbang/sample.yaml | 1 + 4 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..2fc32372e357 --- /dev/null +++ b/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Test requires loopback between P1.13 and P1.14 + * No other driver on SPI_CLK and SPI_CS. + */ + +/ { + spibb0: spibb0 { + compatible = "zephyr,spi-bitbang"; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + clk-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio1 30 GPIO_ACTIVE_LOW>; + }; +}; diff --git a/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 6afc29a382ab..1e6f31ac52d0 100644 --- a/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,20 +4,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * Test requires loopback between P1.13 and P1.14 - * No other driver on SPI_CLK and SPI_CS. - */ - -/ { - spibb0: spibb0 { - compatible = "zephyr,spi-bitbang"; - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - clk-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; - mosi-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - miso-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; - cs-gpios = <&gpio1 30 GPIO_ACTIVE_LOW>; - }; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..f42b85509760 --- /dev/null +++ b/samples/drivers/spi_bitbang/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/drivers/spi_bitbang/sample.yaml b/samples/drivers/spi_bitbang/sample.yaml index e3265ce2fdb6..5023318d658d 100644 --- a/samples/drivers/spi_bitbang/sample.yaml +++ b/samples/drivers/spi_bitbang/sample.yaml @@ -12,6 +12,7 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp From af4c6081fd77bc462b5027f47cc53c8775b772c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 4 Mar 2026 12:18:47 +0100 Subject: [PATCH 1988/3334] [nrf fromtree] tests: drivers: spi: Add harness to dt_spec test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Define harness for SPI dt_spec test that will allow Twister to determine test result. Signed-off-by: Sebastian Głąb (cherry picked from commit 6a27c34c6b0613b8f400ae1e069084cc79cde092) --- tests/drivers/spi/dt_spec/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/spi/dt_spec/testcase.yaml b/tests/drivers/spi/dt_spec/testcase.yaml index f605180fcb0f..70cac22ac955 100644 --- a/tests/drivers/spi/dt_spec/testcase.yaml +++ b/tests/drivers/spi/dt_spec/testcase.yaml @@ -7,3 +7,4 @@ tests: depends_on: - spi - gpio + harness: ztest From 5f6f4d370d26c81e751c3741cb79e16bbec261d7 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 7 Mar 2026 00:55:38 +0530 Subject: [PATCH 1989/3334] [nrf fromlist] boards: nordic: nrf7120dk: Use a single IPC channel The new IPC design between APP and Wi-Fi doesn't use ACKs, so, we only need a single IPC channel for (cmd, event) pairs, the ACKs are replaced with a direct-memory write based rings. Upstream PR #: 105067 Signed-off-by: Chaitanya Tata --- .../nrf7120dk/nrf7120_cpuapp_common.dtsi | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi b/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi index 71e1ed593ec0..a814fd2464a0 100644 --- a/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi +++ b/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi @@ -21,7 +21,7 @@ zephyr,wifi = &wlan0; }; - /* TODO: Fine tune the sizes */ + /* Single IPC channel: 4KB shared memory for TX+RX */ reserved-memory { #address-cells = <1>; #size-cells = <1>; @@ -29,26 +29,18 @@ ipc_shm_area_cpuapp_cpuuma: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 0x2000>; - ranges = <0x0 0x200c0000 0x2000>; + reg = <0x200c0000 0x1000>; + ranges = <0x0 0x200c0000 0x1000>; #address-cells = <1>; #size-cells = <1>; status = "okay"; ipc_shm_cpuapp_cpuuma_0: memory@0 { - reg = <0x0 DT_SIZE_K(2)>; + reg = <0x0 0x800>; }; ipc_shm_cpuuma_cpuapp_0: memory@800 { - reg = <0x800 DT_SIZE_K(2)>; - }; - - ipc_shm_cpuapp_cpuuma_1: memory@1000 { - reg = <0x1000 DT_SIZE_K(2)>; - }; - - ipc_shm_cpuuma_cpuapp_1: memory@1800 { - reg = <0x1800 DT_SIZE_K(2)>; + reg = <0x800 0x800>; }; }; }; @@ -63,16 +55,6 @@ mbox-names = "tx", "rx"; status = "okay"; }; - - ipc1: ipc1 { - compatible = "zephyr,ipc-icmsg"; - tx-region = <&ipc_shm_cpuapp_cpuuma_1>; - rx-region = <&ipc_shm_cpuuma_cpuapp_1>; - mboxes = <&wifi_bellboard 3>, - <&cpuapp_bellboard 1>; - mbox-names = "tx", "rx"; - status = "okay"; - }; }; }; From 9848c70bc2c0c78cd3434a60fdb5a550202680f8 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 6 Mar 2026 00:19:08 +0530 Subject: [PATCH 1990/3334] [nrf fromlist] boards: nordic: nrf7120: Fix Wi-Fi GRTC channel allocation Wi-Fi users (14, 15) channels of GRTC, exclude them from the common allocation. Upstream PR #: 104991 Signed-off-by: Chaitanya Tata --- boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi b/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi index a814fd2464a0..012562d25f18 100644 --- a/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi +++ b/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi @@ -63,7 +63,8 @@ }; &grtc { - owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>; + /* Channels 14-15 are reserved for Wi-Fi domain */ + owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11 12 13>; /* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */ child-owned-channels = <3 4 7 8 9 10 11>; status = "okay"; From d4ac922b0f0d492bace58975916456d1e701c5e4 Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Fri, 27 Feb 2026 18:05:34 +0100 Subject: [PATCH 1991/3334] [nrf fromtree] dts: nordic: nrf7120: fix nrf7120 ns partitioning Fix dts zephyr,sram to use sram0_ns and its reg offset so that it does not overlap the secure ram in nrf7120dk/nrf7120/cpuapp/ns sample. Signed-off-by: Travis Lam (cherry picked from commit 92bdaca1a16097deaedd0cc6b99b530cb0bdcce4) --- boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts | 2 +- dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts index 66baaac5b7d6..10e149cc678b 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts @@ -16,7 +16,7 @@ chosen { zephyr,code-partition = &slot0_ns_partition; - zephyr,sram = &cpuapp_sram; + zephyr,sram = &sram0_ns; zephyr,entropy = &psa_rng; }; diff --git a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi index d8744c85db24..538091d11d4e 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi @@ -25,12 +25,12 @@ ranges = <0x0 0x0 DT_SIZE_K(256)>; }; - sram0_ns: image_ns@20000 { + sram0_ns: image_ns@40000 { #address-cells = <1>; #size-cells = <1>; /* Non-Secure image memory */ - reg = <0x20000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000 DT_SIZE_K(256)>; + reg = <0x40000 DT_SIZE_K(256)>; + ranges = <0x0 0x40000 DT_SIZE_K(256)>; }; }; From b676f47a406f4713feb75c513c6e1b7834c5c168 Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Fri, 27 Feb 2026 18:12:34 +0100 Subject: [PATCH 1992/3334] [nrf fromtree] soc: nordic: nrf71: Fix ANTSWC to run in ns Enable ANTSWC register in spe for ns sample, so that it is not running twice in spe and nspe. Signed-off-by: Travis Lam (cherry picked from commit 78111396049f40e24ede0f147c893851a7282b8a) --- soc/nordic/nrf71/soc.c | 7 ++++--- soc/nordic/nrf71/soc.h | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/soc/nordic/nrf71/soc.c b/soc/nordic/nrf71/soc.c index bb241ba060b6..77848170359b 100644 --- a/soc/nordic/nrf71/soc.c +++ b/soc/nordic/nrf71/soc.c @@ -181,9 +181,6 @@ static void wifi_setup(void) void soc_early_init_hook(void) { -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc) - *(volatile uint32_t *)PWR_ANTSWC_REG |= PWR_ANTSWC_ENABLE; -#endif /* Update the SystemCoreClock global variable with current core clock * retrieved from hardware state. */ @@ -192,6 +189,10 @@ void soc_early_init_hook(void) SystemCoreClockUpdate(); wifi_setup(); +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc) + *(volatile uint32_t *)PWR_ANTSWC_REG |= PWR_ANTSWC_ENABLE; +#endif + /* Configure LFXO capacitive load if internal load capacitors are used */ #if DT_ENUM_HAS_VALUE(LFXO_NODE, load_capacitors, internal) nrf_lfxo_cload_set(NRF_LFXO, diff --git a/soc/nordic/nrf71/soc.h b/soc/nordic/nrf71/soc.h index 91456f4ac94d..cd7eb97ea170 100644 --- a/soc/nordic/nrf71/soc.h +++ b/soc/nordic/nrf71/soc.h @@ -18,10 +18,10 @@ #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc) -#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && !defined(__NRF_TFM__) -#define PWR_ANTSWC_REG (0x4010F780UL) -#else /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ +#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(__NRF_TFM__) #define PWR_ANTSWC_REG (0x5010F780UL) +#else +#define PWR_ANTSWC_REG (0x4010F780UL) #endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ #define PWR_ANTSWC_ENABLE (0x3UL) From 7b59e92b43f0d6c50eb4140edd601c92b6a64623 Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Fri, 27 Feb 2026 18:19:27 +0100 Subject: [PATCH 1993/3334] [nrf fromtree] soc: nordic: nrf71: Add WiFi Boot Kconfig in soc.c Add CONFIG_SOC_NRF71_WIFI_BOOT, so that ns sample does not start Wi-Fi, this is because wicr and lmac is initialised to some gibberish value when it is not loaded this breaks the CI. Signed-off-by: Travis Lam (cherry picked from commit 3eaf85bd22a41a9d91257397e491c8d0f31105d3) --- soc/nordic/nrf71/Kconfig | 8 ++++++++ soc/nordic/nrf71/soc.c | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/soc/nordic/nrf71/Kconfig b/soc/nordic/nrf71/Kconfig index 59b973d1c66f..e58604ab3102 100644 --- a/soc/nordic/nrf71/Kconfig +++ b/soc/nordic/nrf71/Kconfig @@ -34,4 +34,12 @@ config SOC_NRF71_WIFI_DAP help This controls the Wi-Fi AHB Debug AP (DAP) for debugging nRF71 Wi-Fi cores. +config SOC_NRF71_WIFI_BOOT + bool "nRF71 start Wi-Fi on system initialization" + default y if !BUILD_WITH_TFM + help + This controls whether the Wi-Fi core is started on system initialization. If + disabled, the Wi-Fi core must be started by the application before it can be + used. + endif # SOC_SERIES_NRF71 diff --git a/soc/nordic/nrf71/soc.c b/soc/nordic/nrf71/soc.c index 77848170359b..951859181344 100644 --- a/soc/nordic/nrf71/soc.c +++ b/soc/nordic/nrf71/soc.c @@ -171,11 +171,13 @@ static void wifi_setup(void) #endif +#if defined(CONFIG_SOC_NRF71_WIFI_BOOT) /* Kickstart the LMAC processor */ NRF_WIFICORE_LRCCONF_LRC0->POWERON = (LRCCONF_POWERON_MAIN_AlwaysOn << LRCCONF_POWERON_MAIN_Pos); NRF_WIFICORE_LMAC_VPR->INITPC = NRF_WICR->RESERVED[0]; NRF_WIFICORE_LMAC_VPR->CPURUN = (VPR_CPURUN_EN_Running << VPR_CPURUN_EN_Pos); +#endif } #endif @@ -198,7 +200,7 @@ void soc_early_init_hook(void) nrf_lfxo_cload_set(NRF_LFXO, (uint8_t)(DT_PROP(LFXO_NODE, load_capacitance_femtofarad) / 1000)); #endif -#endif +#endif /* !CONFIG_TRUSTED_EXECUTION_NONSECURE || __NRF_TFM__ */ #ifdef __NRF_TFM__ /* TF-M enables the instruction cache from target_cfg_71.c, so we From 9e206120802bbd0cb5c2096820cc7b03194eaa8f Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 26 Feb 2026 14:06:38 +0100 Subject: [PATCH 1994/3334] [nrf fromtree] boards: nordic: Fix nRF54L05/L10 DEVELOP_IN targets Fix nRF54L05/L10 DEVELOP_IN targets on nRF54L15 DK. Signed-off-by: Jakub Zymelka (cherry picked from commit 1378615ede5dee809cf1a607994c24133f07cf85) --- boards/nordic/nrf54l15dk/Kconfig | 6 ++++++ modules/hal_nordic/nrfx/CMakeLists.txt | 8 ++++---- soc/nordic/nrf54l/Kconfig | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 boards/nordic/nrf54l15dk/Kconfig diff --git a/boards/nordic/nrf54l15dk/Kconfig b/boards/nordic/nrf54l15dk/Kconfig new file mode 100644 index 000000000000..a72d067ac689 --- /dev/null +++ b/boards/nordic/nrf54l15dk/Kconfig @@ -0,0 +1,6 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_NRF54L15DK + select SOC_NRF54L10_DEVELOP_IN_NRF54L15 if SOC_NRF54L10 + select SOC_NRF54L05_DEVELOP_IN_NRF54L15 if SOC_NRF54L05 diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 218812d7a654..ee58544e1d24 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -57,14 +57,14 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54H20_CPUPPR NRF54H20_XXAA NRF_PPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54H20_CPUFLPR NRF54H20_XXAA NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L05 NRF54L05_XXAA - DEVELOP_IN_NRF54L15) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L05 NRF54L05_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L05_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L05_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L10 NRF54L10_XXAA - DEVELOP_IN_NRF54L15) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L05_DEVELOP_IN_NRF54L15 DEVELOP_IN_NRF54L15) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L10 NRF54L10_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L10_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L10_CPUFLPR NRF_FLPR) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L10_DEVELOP_IN_NRF54L15 DEVELOP_IN_NRF54L15) 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_NRF54L15_CPUFLPR NRF_FLPR) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 6e75c6b4df80..06955bb550f0 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -114,4 +114,18 @@ config SOC_NRF54LM20A_DEVELOP_IN_NRF54LM20B onto the nRF54LM20B DK. This symbol needs to be considered by certain system initialization functionality residing in SoC erratas. +config SOC_NRF54L10_DEVELOP_IN_NRF54L15 + bool + help + The nrf54l15dk board can be used to develop the nRF54L10 SoC onto the nRF54L15 DK. + This symbol needs to be considered by certain system initialization functionality + residing in system_nrf54l.c and SoC erratas. + +config SOC_NRF54L05_DEVELOP_IN_NRF54L15 + bool + help + The nrf54l15dk board can be used to develop the nRF54L05 SoC onto the nRF54L15 DK. + This symbol needs to be considered by certain system initialization functionality + residing in system_nrf54l.c and SoC erratas. + endif # SOC_SERIES_NRF54L From b4811bc167b2678b64d2d1e573609655b737344c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Sun, 15 Feb 2026 12:41:56 +0200 Subject: [PATCH 1995/3334] [nrf fromtree] net: wifi: shell: Convert the code to use SHELL_HELP macro This will save flash memory by 1489 bytes and make usage help look uniform in different commands. Re-order the shell commands to alphabetical order. This has been done before but has bitrotted over time. Signed-off-by: Jukka Rissanen (cherry picked from commit d060673658d76ef7a600ead555d7c802f77e497b) --- subsys/net/l2/wifi/wifi_shell.c | 953 +++++++++++++++++--------------- 1 file changed, 498 insertions(+), 455 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index ff14bdccfd07..e734bae24f08 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -921,6 +921,7 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv strlen(params->server_cert_domain_suffix); break; case 'h': + shell_help(sh); return -ENOEXEC; default: PR_ERROR("Invalid option %c\n", state->optopt); @@ -4320,87 +4321,115 @@ static int cmd_wifi_config_params(const struct shell *sh, size_t argc, char *arg return 0; } +SHELL_SUBCMD_ADD((wifi), 11k, NULL, + SHELL_HELP("Configure 11k or get 11k status", + "[-i, --iface=]\n" + "[enable/disable]"), + cmd_wifi_11k, + 1, 3); + +SHELL_SUBCMD_ADD((wifi), 11k_neighbor_request, NULL, + SHELL_HELP("Send Neighbor Report Request frame", + "[-i, --iface=]\n" + "[ssid ]"), + cmd_wifi_11k_neighbor_request, + 1, 4); + +SHELL_SUBCMD_ADD((wifi), 11v_btm_query, NULL, + SHELL_HELP("Setting BTM query reason", + "[-i, --iface=]\n" + ""), + cmd_wifi_btm_query, + 2, 2); + SHELL_STATIC_SUBCMD_SET_CREATE( wifi_cmd_ap, - SHELL_CMD_ARG(disable, NULL, "Disable Access Point mode.\n" - "[-i, --iface=] : Interface index.\n", + SHELL_CMD_ARG(disable, NULL, + SHELL_HELP("Disable Access Point mode", + "[-i, --iface=]"), cmd_wifi_ap_disable, 1, 2), SHELL_CMD_ARG(enable, NULL, - "-s --ssid=\n" - "-c --channel=\n" - "-p --passphrase= (valid only for secure SSIDs)\n" - "-k --key-mgmt= (valid only for secure SSIDs)\n" - "0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE-HNP, 4:SAE-H2E, 5:SAE-AUTO, 6:WAPI," - "7:EAP-TLS, 8:WEP, 9: WPA-PSK, 10: WPA-Auto-Personal, 11: DPP\n" - "12: EAP-PEAP-MSCHAPv2, 13: EAP-PEAP-GTC, 14: EAP-TTLS-MSCHAPv2,\n" - "15: EAP-PEAP-TLS, 20: SAE-EXT-KEY\n" - "-w --ieee-80211w= (optional: needs security type to be specified)\n" - "0:Disable, 1:Optional, 2:Required\n" - "-b --band= (2 -2.6GHz, 5 - 5Ghz, 6 - 6GHz)\n" - "-m --bssid=\n" - "-g --ignore-broadcast-ssid=. Hide SSID in AP mode.\n" - "0: disabled (default)\n" - "1: send empty (length=0) SSID in beacon and ignore probe request for " - "broadcast SSID.\n" - "2: clear SSID (ASCII 0), but keep the original length and ignore " - "probe requests for broadcast SSID.\n" - "[-B, --bandwidth=]: 1:20MHz, 2:40MHz, 3:80MHz\n" - "[-K, --key1-pwd for eap phase1 or --key2-pwd for eap phase2]:\n" - "Private key passwd for enterprise mode. Default no password for private key.\n" - "[-S, --wpa3-enterprise]: WPA3 enterprise mode:\n" - "Default 0: Not WPA3 enterprise mode.\n" - "1:Suite-b mode, 2:Suite-b-192-bit mode, 3:WPA3-enterprise-only mode.\n" - "[-V, --eap-version]: 0 or 1. Default 1: eap version 1.\n" - "[-I, --eap-id1...--eap-id8]: Client Identity. Default no eap identity.\n" - "[-P, --eap-pwd1...--eap-pwd8]: Client Password.\n" - "Default no password for eap user.\n" - "[-i, --iface=] : Interface index.\n" - "-h --help (prints help)", + SHELL_HELP("Enable Access Point mode", + "[-i, --iface=]\n" + "-s --ssid=\n" + "-c --channel=\n" + "-p --passphrase= (valid only for secure SSIDs)\n" + "-k --key-mgmt= (valid only for secure SSIDs)\n" + "0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE-HNP, 4:SAE-H2E, " + "5:SAE-AUTO, 6:WAPI, 7:EAP-TLS, 8:WEP, 9: WPA-PSK, " + "10:WPA-Auto-Personal, 11:DPP 12:EAP-PEAP-MSCHAPv2, " + "13:EAP-PEAP-GTC, 14:EAP-TTLS-MSCHAPv2, 15:EAP-PEAP-TLS, " + "20:SAE-EXT-KEY\n" + "-w --ieee-80211w= (optional: needs security type to " + "be specified)\n" + "0:Disable, 1:Optional, 2:Required\n" + "-b --band= (2 -2.6GHz, 5 - 5Ghz, 6 - 6GHz)\n" + "-m --bssid=\n" + "-g --ignore-broadcast-ssid=. Hide SSID in AP mode.\n" + "0: disabled (default)\n" + "1: send empty (length=0) SSID in beacon and ignore probe " + "request for broadcast SSID\n" + "2: clear SSID (ASCII 0), but keep the original length " + "and ignore probe requests for broadcast SSID\n" + "[-B, --bandwidth=]: 1:20MHz, 2:40MHz, 3:80MHz\n" + "[-K, --key1-pwd for eap phase1 or --key2-pwd for eap phase2]:\n" + "Private key passwd for enterprise mode. Default is no password " + "for private key\n" + "[-S, --wpa3-enterprise]: WPA3 enterprise mode:\n" + "Default is 0: Not WPA3 enterprise mode\n" + "1:Suite-b mode, 2:Suite-b-192-bit mode, 3:WPA3-enterprise-only mode\n" + "[-V, --eap-version]: 0 or 1. Default 1: eap version 1\n" + "[-I, --eap-id1...--eap-id8]: Client Identity. Default no eap identity\n" + "[-P, --eap-pwd1...--eap-pwd8]: Client Password\n" + "Default no password for eap user"), cmd_wifi_ap_enable, 2, 47), - SHELL_CMD_ARG(stations, NULL, "List stations connected to the AP\n" - "[-i, --iface=] : Interface index.\n", + SHELL_CMD_ARG(stations, NULL, + SHELL_HELP("List stations connected to the AP", + "[-i, --iface=]"), cmd_wifi_ap_stations, 1, 2), SHELL_CMD_ARG(disconnect, NULL, - "Disconnect a station from the AP\n" - "[-i, --iface=] : Interface index.\n" - "\n", + SHELL_HELP("Disconnect a station from the AP", + "[-i, --iface=]\n" + ""), cmd_wifi_ap_sta_disconnect, 2, 3), SHELL_CMD_ARG(config, NULL, - "Configure AP parameters.\n" - "[-i, --iface=] : Interface index.\n" - "-t --max_inactivity=~l&H-kwc|!9JUih>$ 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 bi4kLg0)r;$UqfF0JMo17SNgvAYwCXh^nayi diff --git a/boards/shields/nrf7002eb2/nrf54l15.overlay b/boards/shields/nrf7002eb2/nrf54l15.overlay deleted file mode 100644 index 785c55e78c09..000000000000 --- a/boards/shields/nrf7002eb2/nrf54l15.overlay +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - * - * nRF7002 EB-II SoC overlay for nRF54L15 (cpuapp and cpuapp_ns). - * SPI and GPIOs come from root overlay via nordic_expansion_spi and - * nordic_expansion_header. - */ - -/* Conflicts with nRF7002 EB-II SPI-CS pin */ -/delete-node/ &led1; - -/* UART20 conflicts with EB-II shield; use UART30 */ -/ { - chosen { - zephyr,console = &uart30; - zephyr,shell-uart = &uart30; - zephyr,uart-mcumgr = &uart30; - zephyr,bt-mon-uart = &uart30; - zephyr,bt-c2h-uart = &uart30; - }; - - aliases { - /delete-property/ led1; - }; -}; - -&uart20 { - status = "disabled"; -}; - -&uart30 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/nrf54lm20.overlay b/boards/shields/nrf7002eb2/nrf54lm20.overlay deleted file mode 100644 index d644ddd2a942..000000000000 --- a/boards/shields/nrf7002eb2/nrf54lm20.overlay +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - * - * nRF7002 EB-II SoC overlay for nRF54L(m)20 (all variants). - * SPI and GPIOs come from root overlay via nordic_expansion_spi and - * nordic_expansion_header. - */ - -/* UART20 conflicts with EB-II shield; use UART30 */ -/ { - chosen { - zephyr,console = &uart30; - zephyr,shell-uart = &uart30; - zephyr,uart-mcumgr = &uart30; - zephyr,bt-mon-uart = &uart30; - zephyr,bt-c2h-uart = &uart30; - }; - - buttons { - /delete-node/ button_3; - }; - - aliases { - /delete-property/ sw3; - }; -}; - -&pinctrl { - uart30_default: uart30_default { - group1 { - psels = ; - }; - - group2 { - psels = ; - bias-pull-up; - }; - }; - - uart30_sleep: uart30_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&uart20 { - status = "disabled"; -}; - -&uart30 { - status = "okay"; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2.overlay b/boards/shields/nrf7002eb2/nrf7002eb2.overlay deleted file mode 100644 index 03facb4632c8..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - * - * Uses nordic_expansion_spi and nordic_expansion_header nexus nodes. - * Supported on nRF54L15 DK and nRF54L(m)20 DK which both define these nodes. - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&nordic_expansion_spi { - status = "okay"; - - nrf70: nrf7002-spi@0 { - compatible = "nordic,nrf7002-spi"; - status = "okay"; - - #include "nrf7002eb2_common.overlay" - #include "nrf7002eb2_common_5g.overlay" - }; -}; - -&nrf70 { - iovdd-ctrl-gpios = <&nordic_expansion_header 5 GPIO_ACTIVE_HIGH>; - bucken-gpios = <&nordic_expansion_header 4 GPIO_ACTIVE_HIGH>; - host-irq-gpios = <&nordic_expansion_header 14 GPIO_ACTIVE_HIGH>; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay deleted file mode 100644 index e60662b8a848..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_coex.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - * - * SR co-existence via nordic_expansion_header (same nexus as main shield; - * nRF54L15 DK and nRF54L(m)20 DK). - */ - -/ { - nrf_radio_coex: coex { - compatible = "nordic,nrf7002-coex"; - status = "okay"; - status0-gpios = <&nordic_expansion_header 8 GPIO_ACTIVE_HIGH>; - req-gpios = <&nordic_expansion_header 9 GPIO_ACTIVE_HIGH>; - grant-gpios = <&nordic_expansion_header 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; - }; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_common.overlay deleted file mode 100644 index 237a3494c552..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_common.overlay +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - * - * Common overlay snippet for nRF70 EB-II shield (included by shield overlays). - */ -#include - -/* Common assignments for nRF70 EB-II shield */ -reg = <0>; -spi-max-frequency = ; - -/* Maximum TX power limits for 2.4 GHz */ -wifi-max-tx-pwr-2g-dsss = <21>; -wifi-max-tx-pwr-2g-mcs0 = <16>; -wifi-max-tx-pwr-2g-mcs7 = <16>; - -/* List of interfaces */ -wlan0: wlan0 { - compatible = "nordic,wlan"; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.overlay deleted file mode 100644 index 16fbd991ae14..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_common_5g.overlay +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - * - * Common 5 GHz TX power overlay snippet for nRF70 EB-II shield. - */ - -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/nrf7002eb2/nrf7002eb2_nrf7000.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay deleted file mode 100644 index 236981ec0745..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7000.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - * - * Uses nordic_expansion_spi and nordic_expansion_header nexus nodes. - * Supported on nRF54L15 DK and nRF54L(m)20 DK which both define these nodes. - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&nordic_expansion_spi { - status = "okay"; - - nrf70: nrf7000-spi@0 { - compatible = "nordic,nrf7000-spi"; - status = "okay"; - - #include "nrf7002eb2_common.overlay" - #include "nrf7002eb2_common_5g.overlay" - }; -}; - -&nrf70 { - iovdd-ctrl-gpios = <&nordic_expansion_header 5 GPIO_ACTIVE_HIGH>; - bucken-gpios = <&nordic_expansion_header 4 GPIO_ACTIVE_HIGH>; - host-irq-gpios = <&nordic_expansion_header 14 GPIO_ACTIVE_HIGH>; -}; diff --git a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay b/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay deleted file mode 100644 index ab95a2b74c67..000000000000 --- a/boards/shields/nrf7002eb2/nrf7002eb2_nrf7001.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - * - * Uses nordic_expansion_spi and nordic_expansion_header nexus nodes. - * Supported on nRF54L15 DK and nRF54L(m)20 DK which both define these nodes. - */ - -/ { - chosen { - zephyr,wifi = &wlan0; - }; -}; - -&nordic_expansion_spi { - status = "okay"; - - nrf70: nrf7001-spi@0 { - compatible = "nordic,nrf7001-spi"; - status = "okay"; - - #include "nrf7002eb2_common.overlay" - }; -}; - -&nrf70 { - iovdd-ctrl-gpios = <&nordic_expansion_header 5 GPIO_ACTIVE_HIGH>; - bucken-gpios = <&nordic_expansion_header 4 GPIO_ACTIVE_HIGH>; - host-irq-gpios = <&nordic_expansion_header 14 GPIO_ACTIVE_HIGH>; -}; diff --git a/boards/shields/nrf7002eb2/shield.yml b/boards/shields/nrf7002eb2/shield.yml deleted file mode 100644 index 60349b0a3cb7..000000000000 --- a/boards/shields/nrf7002eb2/shield.yml +++ /dev/null @@ -1,26 +0,0 @@ -# @Kconfig.shield - -shields: - - name: nrf7002eb2 - full_name: nRF7002 EB-II Shield - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_nrf7001 - full_name: nRF7002 EB-II Shield (nRF7001) - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_nrf7000 - full_name: nRF7002 EB-II Shield (nRF7000) - vendor: nordic - supported_features: - - wifi - - - name: nrf7002eb2_coex - full_name: nRF7002 EB-II Shield (SR Co-Existence) - vendor: nordic - supported_features: - - wifi diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 3ab677b34094..14b0dd27acab 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -277,11 +277,6 @@ New Shields .. Same as above, this will also be recomputed at the time of the release. - -* Nordic Semiconductor ASA - - * :ref:`nrf7002eb2 ` (nRF7002 EB II) - New Drivers *********** From 240abc2a229f47b4f9ab6f909c0f122c8c5ad4f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:27 +0200 Subject: [PATCH 2639/3334] Revert "[nrf fromtree] boards: nordic: nrf54l15dk: add nordic expansion board connector" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb4bd0ea64db3ad9fdfc38fd0b102ecfc0170a2b. Signed-off-by: Andrzej Głąbek --- .../nordic/nrf54l15dk/nrf54l15dk_common.dtsi | 25 +++---------------- .../nrf54l15dk_nrf54l15_cpuflpr.dts | 11 -------- .../nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi | 19 -------------- .../nrf54l_05_10_15_cpuapp_common.dtsi | 11 -------- 4 files changed, 3 insertions(+), 63 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi index ad1a1b253ec9..c030c2c55189 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi @@ -85,28 +85,6 @@ sw3 = &button3; watchdog0 = &wdt31; }; - - /* - * Note the header is marked "PORT P1" on the DK and only - * a subset of the pins are available. - */ - nordic_expansion_header: nordic_expansion_header { - compatible = "nordic,expansion-board-header"; - #gpio-cells = <2>; - gpio-map-mask = <0xffffffff 0xffffffc0>; - gpio-map-pass-thru = <0 0x3f>; - gpio-map = <4 0 &gpio1 4 0>, - <5 0 &gpio1 5 0>, - <6 0 &gpio1 6 0>, - <7 0 &gpio1 7 0>, - <8 0 &gpio1 8 0>, - <9 0 &gpio1 9 0>, - <10 0 &gpio1 10 0>, - <11 0 &gpio1 11 0>, - <12 0 &gpio1 12 0>, - <13 0 &gpio1 13 0>, - <14 0 &gpio1 14 0>; - }; }; &uart20 { @@ -129,3 +107,6 @@ pinctrl-1 = <&pwm20_sleep>; pinctrl-names = "default", "sleep"; }; + +/* Get a node label for wi-fi spi to use in shield files */ +wifi_spi: &spi22 {}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts index edaad821d37b..58bdd2bf59bf 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts @@ -75,14 +75,3 @@ &gpiote30 { status = "okay"; }; - -/* - * Note this SPI instance conflicts with UART30. Disable or reconfigure pinctrl for UART30 - * to use this SPI instance. - */ -nordic_expansion_spi: &spi22 { - cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi index 4b055c2d3e67..54c2f0241ad0 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi @@ -99,23 +99,4 @@ low-power-enable; }; }; - - spi22_default: spi22_default { - group1 { - psels = , - , - ; - bias-pull-down; - }; - }; - - spi22_sleep: spi22_sleep { - group1 { - psels = , - , - ; - bias-pull-down; - low-power-enable; - }; - }; }; diff --git a/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi index 727f9c314ce2..37e6a910bdbd 100644 --- a/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi @@ -139,14 +139,3 @@ &adc { status = "okay"; }; - -/* - * Note this SPI instance conflicts with UART30. Disable or reconfigure pinctrl for UART30 - * to use this SPI instance. - */ -nordic_expansion_spi: &spi22 { - cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; -}; From bff125c573a186945b10c23f2cf668e8b179d451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:27 +0200 Subject: [PATCH 2640/3334] Revert "[nrf fromtree] boards: nordic: nrf54lm20dk: enable gpio3 by default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 922580a2ef0b06f8a487308533d022054a4602b6. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi | 4 ---- boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi | 4 ---- 2 files changed, 8 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi index 7e79fc89935a..1b9f488d7407 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi @@ -77,10 +77,6 @@ status = "okay"; }; -&gpio3 { - status = "okay"; -}; - &gpiote20 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi index f7969b3de49c..27e4a3557cb5 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi @@ -46,10 +46,6 @@ status = "okay"; }; -&gpio3 { - status = "okay"; -}; - &gpiote20 { status = "okay"; }; From edbebf218b76d559b0a48c16bb09ad5e204e2521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:28 +0200 Subject: [PATCH 2641/3334] Revert "[nrf fromtree] boards: nordic: nrf54lm20dk: add nordic expansion board connector" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6cd89a33bad80df137bcebd30e482d043d9292de. Signed-off-by: Andrzej Głąbek --- .../nrf54lm20_a_b_cpuapp_common.dtsi | 18 ++--------- .../nrf54lm20_a_b_cpuflpr_common.dtsi | 17 ---------- .../nrf54lm20dk/nrf54lm20dk_common.dtsi | 29 ----------------- .../nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi | 32 ------------------- 4 files changed, 2 insertions(+), 94 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi index 1b9f488d7407..b097848fe3ee 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi @@ -130,19 +130,5 @@ zephyr_udc0: &usbhs { }; }; -/* - * Note this SPI instance conflicts with UART30. Disable or reconfigure pinctrl for UART30 - * to use this SPI instance. - */ -nordic_expansion_spi: &spi22 { - cs-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; -}; - -nordic_expansion_pwm: &pwm21 { - pinctrl-0 = <&pwm21_default>; - pinctrl-1 = <&pwm21_sleep>; - pinctrl-names = "default", "sleep"; -}; +/* Get a node label for wi-fi spi to use in shield files */ +wifi_spi: &spi22 {}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi index 27e4a3557cb5..11068b98446c 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi @@ -53,20 +53,3 @@ &gpiote30 { status = "okay"; }; - -/* - * Note this SPI instance conflicts with UART30. Disable or reconfigure pinctrl for UART30 - * to use this SPI instance. - */ -nordic_expansion_spi: &spi22 { - cs-gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; -}; - -nordic_expansion_pwm: &pwm21 { - pinctrl-0 = <&pwm21_default>; - pinctrl-1 = <&pwm21_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi index 47e5ace3d389..335e04deeebf 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi @@ -85,35 +85,6 @@ sw3 = &button3; watchdog0 = &wdt31; }; - - nordic_expansion_header: nordic_expansion_header { - compatible = "nordic,expansion-board-header"; - #gpio-cells = <2>; - gpio-map-mask = <0xffffffff 0xffffffc0>; - gpio-map-pass-thru = <0 0x3f>; - gpio-map = <0 0 &gpio3 5 0>, - <1 0 &gpio3 4 0>, - <2 0 &gpio1 2 0>, - <3 0 &gpio1 3 0>, - <4 0 &gpio1 4 0>, - <5 0 &gpio1 13 0>, - <6 0 &gpio3 0 0>, - <7 0 &gpio3 1 0>, - <8 0 &gpio0 3 0>, - <9 0 &gpio0 4 0>, - <10 0 &gpio3 2 0>, - <11 0 &gpio3 3 0>, - <12 0 &gpio1 7 0>, - <13 0 &gpio1 6 0>, - <14 0 &gpio1 5 0>, - <15 0 &gpio3 6 0>, - <16 0 &gpio2 0 0>, - <17 0 &gpio2 1 0>, - <18 0 &gpio2 2 0>, - <19 0 &gpio2 3 0>, - <20 0 &gpio2 4 0>, - <21 0 &gpio2 5 0>; - }; }; &uart20 { diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi index f338bb3adaa6..d6a6dbadd146 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi @@ -99,36 +99,4 @@ low-power-enable; }; }; - - spi22_default: spi22_default { - group1 { - psels = , - , - ; - bias-pull-down; - }; - }; - - spi22_sleep: spi22_sleep { - group1 { - psels = , - , - ; - bias-pull-down; - low-power-enable; - }; - }; - - pwm21_default: pwm21_default { - group1 { - psels = ; - }; - }; - - pwm21_sleep: pwm21_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; }; From 3dfb023b89e7310032a4bd20e3cf156b99a57efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:28 +0200 Subject: [PATCH 2642/3334] Revert "[nrf fromtree] tests: drivers: pwm: Enable pwm_gpio_loopback test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a5db3bb6b47aaa4c5d2b6a7215d804abe52920f7. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 36 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 32 ++++++++++++++++- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 1 - .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 6 ---- .../pwm/pwm_gpio_loopback/testcase.yaml | 1 - 5 files changed, 31 insertions(+), 45 deletions(-) delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index 326707c43d9c..000000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - * - * Test requires jumper between: - * - PWM20 OUT[0] at P1.29 <-> GPIO input at P1.00 - */ - -/ { - zephyr,user { - pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>; - gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; - }; -}; - -&pinctrl { - pwm20_alt: pwm20_alt { - group1 { - psels = ; - }; - }; - - pwm20_alt_sleep: pwm20_alt_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; -}; - -&pwm20 { - status = "okay"; - pinctrl-0 = <&pwm20_alt>; - pinctrl-1 = <&pwm20_alt_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 2309f6a758f6..89ff80dcb677 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,6 +1,36 @@ /* * Copyright (c) 2025 Nordic Semiconductor ASA * SPDX-License-Identifier: Apache-2.0 + * + * Test requires jumper between: + * - PWM20 OUT[0] at P1.29 <-> GPIO input at P1.00 */ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" +/ { + zephyr,user { + pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>; + gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; + }; +}; + +&pinctrl { + pwm20_alt: pwm20_alt { + group1 { + psels = ; + }; + }; + + pwm20_alt_sleep: pwm20_alt_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm20_alt>; + pinctrl-1 = <&pwm20_alt_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf deleted file mode 100644 index 795414a504ab..000000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SKIP_EDGE_NUM=4 diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index a669ed1275a8..000000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml index b7994e228135..347e0e9f9772 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml @@ -22,7 +22,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp From 9b9253de197def6fc124cbacf4402b2841b62b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:28 +0200 Subject: [PATCH 2643/3334] Revert "[nrf fromtree] tests: drivers: pwm: Enable pwm_api test on nrf54lm20dk" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 27f87ec5cb01b6597a040848e4a94c4ff1abbb93. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 32 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 6 ---- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 6 ---- 3 files changed, 44 deletions(-) delete mode 100644 tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay delete mode 100644 tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index 2d0e1b07fd2a..000000000000 --- a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - pwm-test = &pwm20; - }; -}; - -&pinctrl { - pwm20_alt: pwm20_alt { - group1 { - psels = ; - }; - }; - - pwm20_alt_sleep: pwm20_alt_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; -}; - -&pwm20 { - status = "okay"; - pinctrl-0 = <&pwm20_alt>; - pinctrl-1 = <&pwm20_alt_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index a669ed1275a8..000000000000 --- a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index a669ed1275a8..000000000000 --- a/tests/drivers/pwm/pwm_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" From f6a6e41033dc0e19589b4f25eec91e9e11c5a42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:29 +0200 Subject: [PATCH 2644/3334] Revert "[nrf fromtree] samples: drivers: audio: Enable dmic sample on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1071abf4d03be15761503e9285752e89a59bee41. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 25 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 20 ++++++++++++++- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ------ 3 files changed, 19 insertions(+), 33 deletions(-) delete mode 100644 samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index 75a8bfdcd913..000000000000 --- a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires loopback between P1.23 and P1.24. - * For best performance, PDM_CLK shall be on 'Clock pin'. - */ - -&pinctrl { - pdm20_default_alt: pdm20_default_alt { - group1 { - psels = , - ; - }; - }; -}; - -dmic_dev: &pdm20 { - status = "okay"; - pinctrl-0 = <&pdm20_default_alt>; - pinctrl-names = "default"; - clock-source = "PCLK32M"; -}; diff --git a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 1e6f31ac52d0..b3e08098722d 100644 --- a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,4 +4,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" +/* Test requires loopback between P1.23 and P1.24. + * For best performance, PDM_CLK shall be on 'Clock pin'. + */ + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +dmic_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; diff --git a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/samples/drivers/audio/dmic/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 07859d9f00e354b07ed24e2056bffc818aa05bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:29 +0200 Subject: [PATCH 2645/3334] Revert "[nrf fromtree] tests: drivers: audio: Enable dmic_api test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c6ea8ec24b69ae9319a63c71db9dd5e85c635365. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 31 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 26 +++++++++++++++- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ----- 3 files changed, 25 insertions(+), 39 deletions(-) delete mode 100644 tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index ea5828159ef7..000000000000 --- a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires loopback between P1.23 and P1.24. - * For best performance, PDM_CLK shall be on 'Clock pin'. - */ - -/ { - aliases { - dmic-dev = &pdm20; - }; -}; - -&pinctrl { - pdm20_default_alt: pdm20_default_alt { - group1 { - psels = , - ; - }; - }; -}; - -dmic_dev: &pdm20 { - status = "okay"; - pinctrl-0 = <&pdm20_default_alt>; - pinctrl-names = "default"; - clock-source = "PCLK32M"; -}; diff --git a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 1e6f31ac52d0..ebe43a7c825e 100644 --- a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,4 +4,28 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" +/* Test requires loopback between P1.23 and P1.24. + * For best performance, PDM_CLK shall be on 'Clock pin'. + */ + +/ { + aliases { + dmic-dev = &pdm20; + }; +}; + +&pinctrl { + pdm20_default_alt: pdm20_default_alt { + group1 { + psels = , + ; + }; + }; +}; + +dmic_dev: &pdm20 { + status = "okay"; + pinctrl-0 = <&pdm20_default_alt>; + pinctrl-names = "default"; + clock-source = "PCLK32M"; +}; diff --git a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/audio/dmic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 640f38964163f783925467717419b183d2cfc240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:29 +0200 Subject: [PATCH 2646/3334] Revert "[nrf fromtree] tests: drivers: i2s: Enable i2s_additional test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 377bebec10f6c8a5a386a9ec4eab23648be0204f. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 30 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 +++++++++++++++- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ----- .../drivers/i2s/i2s_additional/testcase.yaml | 1 - 4 files changed, 24 insertions(+), 39 deletions(-) delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index 022a6a60f058..000000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 1e6f31ac52d0..e93f6df8fd8c 100644 --- a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,4 +4,27 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_additional/testcase.yaml b/tests/drivers/i2s/i2s_additional/testcase.yaml index a37571680ac3..9b521728ccc6 100644 --- a/tests/drivers/i2s/i2s_additional/testcase.yaml +++ b/tests/drivers/i2s/i2s_additional/testcase.yaml @@ -17,7 +17,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 From 446ed9b7b2ed82e552612757a4b400e0496fc256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:30 +0200 Subject: [PATCH 2647/3334] Revert "[nrf fromtree] tests: drivers: timer: Enable nrf_grtc_timer test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit df120f8ec8b67163ad67a3c7f2be25130d8cd046. Signed-off-by: Andrzej Głąbek --- tests/drivers/timer/nrf_grtc_timer/testcase.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index ae6cee3a4563..f4c6439972ab 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -11,8 +11,6 @@ common: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20b/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuflpr - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr From 2a3886e4fc25e0e7e34875d2c73417fe112824cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:30 +0200 Subject: [PATCH 2648/3334] Revert "[nrf fromtree] tests: boards: nrf: hwinfo: Enable reset_cause test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 244dbba19cfe8769213c0f64a71e4a7a48ece830. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 --------- tests/boards/nrf/hwinfo/reset_cause/testcase.yaml | 1 - 2 files changed, 10 deletions(-) delete mode 100644 tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index dcac0662ba24..000000000000 --- a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml index 0c21eac9d5d2..6541d41c7406 100644 --- a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml +++ b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml @@ -39,7 +39,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp From 76170400cd132027dd8645ebfefa761e8ea22464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:30 +0200 Subject: [PATCH 2649/3334] Revert "[nrf fromtree] samples: drivers: Enable spi_flash sample on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b0d8b6041a03248588296c7fb278f243870e178e. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 --------- samples/drivers/spi_flash/sample.yaml | 2 -- 2 files changed, 11 deletions(-) delete mode 100644 samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 3ab838329612..000000000000 --- a/samples/drivers/spi_flash/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/drivers/spi_flash/sample.yaml b/samples/drivers/spi_flash/sample.yaml index 83e1c9168e4d..36a799fda6d2 100644 --- a/samples/drivers/spi_flash/sample.yaml +++ b/samples/drivers/spi_flash/sample.yaml @@ -15,7 +15,6 @@ tests: - hifive_unmatched/fu740/s7 - hifive_unmatched/fu740/u74 - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - stm32n6570_dk/stm32n657xx/sb harness: console harness_config: @@ -48,7 +47,6 @@ tests: sample.drivers.spi.flash.nrf54lm20: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp harness: console From b5947b6f10e5cd2b1f2532763d8eb8059d558b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:31 +0200 Subject: [PATCH 2650/3334] Revert "[nrf fromtree] samples: drivers: Enable soc_flash_nrf on nrf54lm20dk" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fbfb85a7e16f26a03a09d4e322c3c0a5cef4148a. Signed-off-by: Andrzej Głąbek --- samples/drivers/soc_flash_nrf/sample.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/drivers/soc_flash_nrf/sample.yaml b/samples/drivers/soc_flash_nrf/sample.yaml index 02d90fb2e337..b36ac7921abe 100644 --- a/samples/drivers/soc_flash_nrf/sample.yaml +++ b/samples/drivers/soc_flash_nrf/sample.yaml @@ -10,8 +10,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp integration_platforms: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 From 5bbe0c8a128579275c95f7aed40bd6cdcd0e2a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:31 +0200 Subject: [PATCH 2651/3334] Revert "[nrf fromtree] tests: drivers: flash: Enable flash negative_test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f718399ee070dce75bf1eca5ed1a92e7e67e508f. Signed-off-by: Andrzej Głąbek --- tests/drivers/flash/negative_tests/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/flash/negative_tests/testcase.yaml b/tests/drivers/flash/negative_tests/testcase.yaml index b6b4137c31a4..304637cac40f 100644 --- a/tests/drivers/flash/negative_tests/testcase.yaml +++ b/tests/drivers/flash/negative_tests/testcase.yaml @@ -8,6 +8,5 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - ophelia4ev/nrf54l15/cpuapp - sam_e54_xpro From bc1cbe2e8d50c28780328c457f6e3aa5a370fbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:31 +0200 Subject: [PATCH 2652/3334] Revert "[nrf fromtree] tests: drivers: flash: Enable flash common test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7ab19c54cc8bc398f11d68330035cf7f339bd167. Signed-off-by: Andrzej Głąbek --- .../common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 4 ---- .../common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 --------- tests/drivers/flash/common/testcase.yaml | 2 -- 3 files changed, 15 deletions(-) delete mode 100644 tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf delete mode 100644 tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf deleted file mode 100644 index 821a5e77e5b5..000000000000 --- a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_FCB=y -CONFIG_FLASH_MAP=y -CONFIG_SETTINGS=y -CONFIG_SETTINGS_FCB=y diff --git a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 3ab838329612..000000000000 --- a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - status = "okay"; -}; diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index f5f75451a4cb..489d2bf0bd57 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -67,7 +67,6 @@ tests: or dt_label_with_parent_compat_enabled("storage_partition", "nordic,owned-partitions"))) platform_exclude: - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - qemu_x86 @@ -99,7 +98,6 @@ tests: drivers.flash.common.nrf54lm20a: platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp harness_config: fixture: external_flash drivers.flash.common.tfm_ns: From 7e54a3b93045934da7b6f9cd122a78ec1e57de91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:32 +0200 Subject: [PATCH 2653/3334] Revert "[nrf fromtree] tests: boards: nrf: Enable comp test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 91a1d37120c4e6a3080653074db0036d1449fd48. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 4 -- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 41 ------------------- tests/boards/nrf/comp/testcase.yaml | 1 - 3 files changed, 46 deletions(-) delete mode 100644 tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf delete mode 100644 tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf deleted file mode 100644 index 3a7f6a038761..000000000000 --- a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX=1 -CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX=4 -CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX=6 -CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX=5 diff --git a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 31d239bf1869..000000000000 --- a/tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Two loopbacks are used - * Each loopback is between analog input and GPIO. - * first-gpios (P1.03) -> AIN6 (P1.04) - * second-gpios (P1.30, AIN2) -> AIN1 (P1.31) - * AIN4 (P1.06) tied to VDD - */ - -#include - -/ { - aliases { - test-comp = ∁ - }; - - zephyr,user { - first-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; - second-gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&comp { - status = "okay"; - psel = ; - refsel = "AREF"; - extrefsel = ; - sp-mode = "NORMAL"; - th-up = <36>; - th-down = <30>; - isource = "DISABLED"; - enable-hyst; -}; diff --git a/tests/boards/nrf/comp/testcase.yaml b/tests/boards/nrf/comp/testcase.yaml index 406fa4641385..f4a88db57df3 100644 --- a/tests/boards/nrf/comp/testcase.yaml +++ b/tests/boards/nrf/comp/testcase.yaml @@ -13,5 +13,4 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp From 47c624779d4e88d6444817e7723277e4d326f5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:32 +0200 Subject: [PATCH 2654/3334] Revert "[nrf fromtree] tests: drivers: mbox: Enable mbox_error_cases on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1b6e9b47a99da0fb63c893e41dbc87936c8e951d. Signed-off-by: Andrzej Głąbek --- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 22 ------------------- .../drivers/mbox/mbox_error_cases/sample.yaml | 1 - 2 files changed, 23 deletions(-) delete mode 100644 tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 462f213aa66d..000000000000 --- a/tests/drivers/mbox/mbox_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&cpuapp_vevif_tx 21>, <&cpuapp_vevif_tx 32>, - <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_rx 32>; - mbox-names = "remote_valid", "remote_incorrect", - "local_valid", "local_incorrect"; - }; -}; - -&cpuapp_vevif_rx { - status = "okay"; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; diff --git a/tests/drivers/mbox/mbox_error_cases/sample.yaml b/tests/drivers/mbox/mbox_error_cases/sample.yaml index 565d0350b241..06255734ea5c 100644 --- a/tests/drivers/mbox/mbox_error_cases/sample.yaml +++ b/tests/drivers/mbox/mbox_error_cases/sample.yaml @@ -18,7 +18,6 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From a1357a49e38df20c30d7864297cd2c8a7ab9fbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:33 +0200 Subject: [PATCH 2655/3334] Revert "[nrf fromtree] tests: drivers: mbox_error_cases: Move test parametrization to Kconfig" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 61dfdd79086afbae0a9692e7626e9a17319a5693. Signed-off-by: Andrzej Głąbek --- tests/drivers/mbox/mbox_error_cases/Kconfig | 23 -------------- .../drivers/mbox/mbox_error_cases/src/main.c | 30 ++++++++++++++----- 2 files changed, 23 insertions(+), 30 deletions(-) delete mode 100644 tests/drivers/mbox/mbox_error_cases/Kconfig diff --git a/tests/drivers/mbox/mbox_error_cases/Kconfig b/tests/drivers/mbox/mbox_error_cases/Kconfig deleted file mode 100644 index 8969bfb6fc10..000000000000 --- a/tests/drivers/mbox/mbox_error_cases/Kconfig +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (c) 2026 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -mainmenu "MBOX Negative Test" - -config TEST_EXPECTED_MTU_VALUE - int "Maximum data field size" - default 0 - help - Expected value that mbox_mtu_get_dt() shall return. - Maximum number of bytes possible in an outbound message. - -config TEST_REMOTE_BUSY_NOT_SUPPORTED - bool "Remote busy is NOT supported" - default y - help - Value of 'y' means that transmitter is NOT able to detect - if the remote hasn't yet read the last data sent. - -source "Kconfig.zephyr" diff --git a/tests/drivers/mbox/mbox_error_cases/src/main.c b/tests/drivers/mbox/mbox_error_cases/src/main.c index 9636d139865c..53e7196dccd9 100644 --- a/tests/drivers/mbox/mbox_error_cases/src/main.c +++ b/tests/drivers/mbox/mbox_error_cases/src/main.c @@ -10,6 +10,18 @@ int dummy_value; +#if defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || \ + defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) || \ + defined(CONFIG_SOC_NRF54LM20A) || defined(CONFIG_SOC_NRF7120) +#define EXPECTED_MTU_VALUE (0) +#define DATA_TRANSFER_MODE_SUPPORTED (0) +#define REMOTE_BUSY_SUPPORTED (0) +#else +#define EXPECTED_MTU_VALUE (4) +#define DATA_TRANSFER_MODE_SUPPORTED (1) +#define REMOTE_BUSY_SUPPORTED (1) +#endif + static void dummy_callback(const struct device *dev, mbox_channel_id_t channel_id, void *user_data, struct mbox_msg *data) { @@ -153,7 +165,7 @@ ZTEST(mbox_error_cases, test_02c_mbox_send_message_with_data) struct mbox_msg data_msg = {0}; int ret; - if (CONFIG_TEST_EXPECTED_MTU_VALUE > 0) { + if (DATA_TRANSFER_MODE_SUPPORTED) { /* Skip this test because data transfer is supported. */ ztest_test_skip(); } @@ -183,8 +195,12 @@ ZTEST(mbox_error_cases, test_02d_mbox_send_message_remote_busy) MBOX_DT_SPEC_GET(DT_PATH(mbox_consumer), remote_valid); int ret; - /* Skip this test when driver can't detect that remote is busy. */ - Z_TEST_SKIP_IFDEF(CONFIG_TEST_REMOTE_BUSY_NOT_SUPPORTED); + if (!REMOTE_BUSY_SUPPORTED) { + /* Skip this test because driver is not + * capable of detecting that remote is busy. + */ + ztest_test_skip(); + } ret = mbox_send_dt(&tx_channel, NULL); zassert_true( @@ -318,19 +334,19 @@ ZTEST(mbox_error_cases, test_04b_mbox_mtu_get_on_tx_channel) ret = mbox_mtu_get_dt(&tx_channel); zassert_true( - (ret == CONFIG_TEST_EXPECTED_MTU_VALUE), + (ret == EXPECTED_MTU_VALUE), "mbox_mtu_get_dt(tx_channel) shall return %d" " got unexpected %d", - CONFIG_TEST_EXPECTED_MTU_VALUE, + EXPECTED_MTU_VALUE, ret ); ret = mbox_mtu_get_dt(&tx_channel_incorrect); zassert_true( - (ret == CONFIG_TEST_EXPECTED_MTU_VALUE), + (ret == EXPECTED_MTU_VALUE), "mbox_mtu_get_dt(tx_channel_incorrect) shall return %d" " got unexpected %d", - CONFIG_TEST_EXPECTED_MTU_VALUE, + EXPECTED_MTU_VALUE, ret ); } From 5e6d1cd91e4dafba0fa64d71dec797abeb40c628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:33 +0200 Subject: [PATCH 2656/3334] Revert "[nrf fromtree] Bluetooth: Host: Make ACL/CIS disconnect order deterministic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4d5eb755deeda4569df4bae7e7e71e3feb4b8769. Signed-off-by: Andrzej Głąbek --- include/zephyr/bluetooth/iso.h | 3 -- subsys/bluetooth/host/conn.c | 60 ++++++++++++++++++++-------------- subsys/bluetooth/host/iso.c | 39 ++-------------------- 3 files changed, 37 insertions(+), 65 deletions(-) diff --git a/include/zephyr/bluetooth/iso.h b/include/zephyr/bluetooth/iso.h index 371843ff4302..f5e0182f2d66 100644 --- a/include/zephyr/bluetooth/iso.h +++ b/include/zephyr/bluetooth/iso.h @@ -729,9 +729,6 @@ struct bt_iso_chan_ops { * * For the above reason it is still possible to use bt_iso_chan_get_info() on the @p chan. * - * If the @p chan is a unicast (CIS) channel, then this callback will always be called - * before @ref bt_conn_cb.disconnected when the associated ACL connection also disconnects. - * * @param chan The channel that has been Disconnected * @param reason BT_HCI_ERR_* reason for the disconnection. */ diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 57b5b7dc098b..ff4dba086e1c 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2165,6 +2165,29 @@ static int send_conn_le_param_update(struct bt_conn *conn, return bt_l2cap_update_conn_param(conn, param); } +#if defined(CONFIG_BT_ISO_UNICAST) +static struct bt_conn *conn_lookup_iso(struct bt_conn *conn) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(iso_conns); i++) { + struct bt_conn *iso = bt_conn_ref(&iso_conns[i]); + + if (iso == NULL) { + continue; + } + + if (iso->iso.acl == conn) { + return iso; + } + + bt_conn_unref(iso); + } + + return NULL; +} +#endif /* CONFIG_BT_ISO */ + #if defined(CONFIG_BT_CLASSIC) static struct bt_conn *conn_lookup_sco(struct bt_conn *conn) { @@ -2198,7 +2221,7 @@ static void deferred_work(struct k_work *work) if (conn->state == BT_CONN_DISCONNECTED) { #if defined(CONFIG_BT_ISO_UNICAST) - bool acl_coupled_with_cis; + struct bt_conn *iso; if (bt_conn_is_iso(conn)) { /* bt_iso_disconnected is responsible for unref'ing the @@ -2209,36 +2232,23 @@ static void deferred_work(struct k_work *work) return; } - /* Mark all CIS still associated with the ACL conn as disconnecting. - * If any CIS are associated with the ACL, we postpone the disconnect work until - * after the CIS has been disconnected from a HCI Disconnect event. + /* Mark all ISO channels associated + * with ACL conn as not connected, and + * remove ACL reference */ - acl_coupled_with_cis = false; - ARRAY_FOR_EACH_PTR(iso_conns, iso_conn) { - struct bt_conn *iso = bt_conn_ref(iso_conn); + iso = conn_lookup_iso(conn); + while (iso != NULL) { + struct bt_iso_chan *chan = iso->iso.chan; - if (iso == NULL) { - continue; + if (chan != NULL) { + bt_iso_chan_set_state(chan, + BT_ISO_STATE_DISCONNECTING); } - if (iso->iso.acl == conn) { - struct bt_iso_chan *chan = iso->iso.chan; - - if (chan != NULL) { - bt_iso_chan_set_state(chan, BT_ISO_STATE_DISCONNECTING); - } - - acl_coupled_with_cis = true; - } + bt_iso_cleanup_acl(iso); bt_conn_unref(iso); - } - - if (acl_coupled_with_cis) { - LOG_DBG("acl %p is pending on CIS disconnects, wait for CIS disconnects", - conn); - - return; + iso = conn_lookup_iso(conn); } #endif #if defined(CONFIG_BT_CLASSIC) diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index 96499e0c8ac0..53dc729db56c 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -1156,48 +1156,13 @@ int bt_iso_chan_disconnect(struct bt_iso_chan *chan) return err; } -static bool bt_iso_acl_has_cis(const struct bt_conn *acl) -{ - ARRAY_FOR_EACH_PTR(iso_conns, iso_conn) { - struct bt_conn *iso = bt_conn_ref(iso_conn); - - if (iso == NULL) { - continue; - } - - if (iso->iso.acl == acl) { - bt_conn_unref(iso); - - return true; - } - - bt_conn_unref(iso); - } - - return false; -} - void bt_iso_cleanup_acl(struct bt_conn *iso) { - struct bt_conn *acl = iso->iso.acl; LOG_DBG("%p", iso); - if (acl != NULL) { + if (iso->iso.acl) { + bt_conn_unref(iso->iso.acl); iso->iso.acl = NULL; - - /* If we have removed the last ACL reference, trigger the deferred work to finalize - * the ACL disconnection - */ - if (acl->state == BT_CONN_DISCONNECTED && !bt_iso_acl_has_cis(acl)) { - LOG_DBG("Trigger disconnect work for ACL %p", acl); - - __maybe_unused const int err = - k_work_schedule(&acl->deferred_work, K_NO_WAIT); - - __ASSERT(err >= 0, "Failed to retrigger conn->deferred_work for %p", acl); - } - - bt_conn_unref(acl); } } From d4e9ae55c9b972da1d5377d6090c5a70a8edbff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:33 +0200 Subject: [PATCH 2657/3334] Revert "[nrf fromtree] doc: releases: Add entry for BT CIS disconnect changes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4268e2a112115386f688258ee9688436388e6377. Signed-off-by: Andrzej Głąbek --- doc/releases/release-notes-4.4.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/releases/release-notes-4.4.rst b/doc/releases/release-notes-4.4.rst index 14b0dd27acab..28e31ee4f11c 100644 --- a/doc/releases/release-notes-4.4.rst +++ b/doc/releases/release-notes-4.4.rst @@ -138,12 +138,6 @@ New APIs and options * :c:func:`bt_gatt_cb_unregister` Added an API to unregister GATT callback handlers. * :c:func:`bt_le_per_adv_sync_cb_unregister` - * ISO - - * :c:member:`bt_iso_chan_ops.disconnected` will now always be called before - :c:member:`bt_conn_cb.disconnected` for unicast (CIS) channels, - to provide a more deterministic order of callback events. (:github:`104695`). - * Mesh * :c:func:`bt_mesh_input_numeric` to provide provisioning numeric input OOB value. From 99a9f5485b2a7c684560c6b3d288100ea4fd4c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:33 +0200 Subject: [PATCH 2658/3334] Revert "[nrf fromtree] Bluetooth: BAP: Unicast Client: Handle unexpected ASE IDs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f885f48d11bf4b2e5b9e9e51c37157b3343c211f. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/audio/bap_unicast_client.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index 838294937ae4..b163d9c2aa93 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -1659,8 +1659,6 @@ static uint8_t unicast_client_cp_notify(struct bt_conn *conn, stream = audio_stream_by_ep_id(conn, ase_rsp->id); if (stream == NULL) { LOG_DBG("Could not find stream by id %u", ase_rsp->id); - - continue; } else { client_ep = CONTAINER_OF(stream->ep, struct bt_bap_unicast_client_ep, ep); client_ep->cp_ntf_pending = false; From 2efe74954bf13a666a0ae7bc97e56d4ce677e4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:33 +0200 Subject: [PATCH 2659/3334] Revert "[nrf fromlist] modules: hal_nordic: ironside: Add NRF_MPCCONF_API_IN_RAM" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 942239a1d9430e719ae74bbe5673050c64b3475c. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/ironside/se/Kconfig | 12 ------------ .../se/include/ironside_zephyr/se/glue_impl.h | 6 ------ 2 files changed, 18 deletions(-) diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index 92b639667a9d..a387e4312aba 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -138,16 +138,4 @@ config NRF_PERIPHCONF_SECTION_KEEP_BY_DEFAULT CONFIG_NRF_PERIPHCONF_SECTION_STRIP=n unless explicitly configured otherwise. To override this behavior, set CONFIG_NRF_PERIPHCONF_SECTION_STRIP=y directly. -config NRF_MPCCONF_API_IN_RAM - bool "MPCCONF API in RAM" - depends on IRONSIDE_SE_CALL - depends on !IRONSIDE_SE_CALL_ZEPHYR || !XIP - help - Ensure that the functions used to modify and lock the MPC configuration - - namely, ironside_se_mpcconf_write() and ironside_se_mpcconf_finish_init() - - are placed in RAM. This may be needed to reconfigure permissions for XIP memory. - - This is not supported with the default IronSide call driver in Zephyr, - unless it and all of its dependencies are also relocated to be executed from RAM. - endmenu # IronSide SE diff --git a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h index 2bade715cf42..f5fad7cbd2d0 100644 --- a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h +++ b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h @@ -12,10 +12,4 @@ #define IRONSIDE_SE_ALWAYS_INLINE ALWAYS_INLINE #endif -#if defined(CONFIG_NRF_MPCCONF_API_IN_RAM) -/* Place MPCCONF APIs in RAM by plugging in function attributes. */ -#define IRONSIDE_SE_MPCCONF_WRITE_FUNC_ATTR __ramfunc -#define IRONSIDE_SE_MPCCONF_FINISH_INIT_FUNC_ATTR __ramfunc -#endif - #endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ */ From 5c86ab672475d9c4a89ffd74743f859c15fd3d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:34 +0200 Subject: [PATCH 2660/3334] Revert "[nrf fromlist] modules: hal_nordic: ironside: integrate minimal IronSide call driver" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a7eaad25194b933ea9a393a24fb21058dc279b06. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/ironside/se/CMakeLists.txt | 4 +-- modules/hal_nordic/ironside/se/Kconfig | 36 ++----------------- .../se/include/ironside_zephyr/se/glue_impl.h | 15 -------- .../common/nrf54hx_nrf92x_mpu_regions.c | 5 --- soc/nordic/nrf54h/Kconfig | 2 -- soc/nordic/nrf92/Kconfig | 2 -- 6 files changed, 3 insertions(+), 61 deletions(-) delete mode 100644 modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index ee5b2be8e2fa..a4c3c66aa8fe 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -10,11 +10,9 @@ zephyr_library() zephyr_library_property(ALLOW_EMPTY TRUE) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL ${IRONSIDE_SUPPORT_DIR}/se/src/ironside_se_api.c + call.c glue.c ) -zephyr_library_compile_definitions(IRONSIDE_SE_GLUE_EXT_FILE_PATH="ironside_zephyr/se/glue_impl.h") -zephyr_library_compile_definitions_ifdef(CONFIG_IRONSIDE_SE_CALL_MINIMAL IRONSIDE_SE_CALL_MINIMAL=1) -zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL_ZEPHYR call.c) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c) if(CONFIG_NRF_PERIPHCONF_SECTION OR CONFIG_NRF_MPCCONF_SECTION) diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index a387e4312aba..80598be0b89a 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -4,56 +4,24 @@ config HAS_IRONSIDE_SE bool -config HAS_IRONSIDE_SE_CALL - bool - menu "IronSide SE" depends on HAS_IRONSIDE_SE config IRONSIDE_SE_CALL bool "IronSide calls" default y - depends on HAS_IRONSIDE_SE_CALL - help - Support for IronSide call APIs. - -if IRONSIDE_SE_CALL - -choice IRONSIDE_SE_CALL_DRIVER - prompt "IronSide calls driver implementation" - default IRONSIDE_SE_CALL_ZEPHYR if DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED - default IRONSIDE_SE_CALL_MINIMAL - help - Driver implementation used for IronSide calls. - -config IRONSIDE_SE_CALL_ZEPHYR - bool "Zephyr driver" depends on DT_HAS_NORDIC_IRONSIDE_CALL_ENABLED depends on MULTITHREADING select EVENTS select MBOX help - Use the default driver for IronSide calls which supports concurrent - calls being made from different threads. This is the recommended implementation - and should be used in most applications. - -config IRONSIDE_SE_CALL_MINIMAL - bool "Minimal driver" - help - Use the minimal driver for IronSide calls, which is included with the - IronSide APIs. This driver does not support concurrent calls from different - threads, and uses busy waiting instead of interrupts when waiting for a - reply from IronSide SE. It also does not perform data cache handling for the IPC - buffer, and instead assumes that the IPC buffer area is not cached. - This option is primarily intended for constrained applications such as bootloaders - and is not recommended for general use. + Support for IronSide call APIs. -endchoice +if IRONSIDE_SE_CALL config IRONSIDE_SE_CALL_INIT_PRIORITY int "IronSide calls' driver initialization priority" default 41 - depends on IRONSIDE_SE_CALL_ZEPHYR help Initialization priority of the IronSide call protocol driver. It must be below MBOX_INIT_PRIORITY, but higher than the priority of any feature diff --git a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h b/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h deleted file mode 100644 index f5fad7cbd2d0..000000000000 --- a/modules/hal_nordic/ironside/se/include/ironside_zephyr/se/glue_impl.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ -#define ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ - -#include - -#ifndef IRONSIDE_SE_ALWAYS_INLINE -#define IRONSIDE_SE_ALWAYS_INLINE ALWAYS_INLINE -#endif - -#endif /* ZEPHYR_MODULES_HAL_NORDIC_IRONSIDE_SE_INCLUDE_IRONSIDE_ZEPHYR_SE_GLUE_IMPL_H_ */ diff --git a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c index 303fdf8ac8ae..83c778928e3f 100644 --- a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c +++ b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c @@ -53,11 +53,6 @@ static struct arm_mpu_region mpu_regions[] = { MPU_REGION_ENTRY("EVENT_REPORT", IRONSIDE_SE_EVENT_REPORT_ADDRESS, REGION_RAM_NOCACHE_ATTR(IRONSIDE_SE_EVENT_REPORT_ADDRESS, IRONSIDE_SE_EVENT_REPORT_SIZE)), -#if defined(CONFIG_IRONSIDE_SE_CALL_MINIMAL) - MPU_REGION_ENTRY("IRONSIDE_IPC", IRONSIDE_SE_IPC_BUFFER_ADDRESS, - REGION_RAM_NOCACHE_ATTR(IRONSIDE_SE_IPC_BUFFER_ADDRESS, - IRONSIDE_SE_IPC_BUFFER_SIZE)), -#endif }; const struct arm_mpu_config mpu_config = { diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 44f18efe8105..cf33c96309fe 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -40,7 +40,6 @@ config SOC_NRF54H20_CPUAPP_COMMON select HAS_PM select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF - select HAS_IRONSIDE_SE_CALL config SOC_NRF54H20_CPUAPP select SOC_NRF54H20_CPUAPP_COMMON @@ -70,7 +69,6 @@ config SOC_NRF54H20_CPURAD_COMMON select HAS_NORDIC_RAM_CTRL select HAS_PM select HAS_POWEROFF - select HAS_IRONSIDE_SE_CALL config SOC_NRF54H20_CPURAD_ENABLE bool "Boot the nRF54H20 Radio core" diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index dd16a354ea1a..86978d745665 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -34,7 +34,6 @@ config SOC_NRF9230_ENGB_CPUAPP select NRFS_HAS_TEMP_SERVICE select NRFS_HAS_VBUS_DETECTOR_SERVICE select NRFS_TEMP_SERVICE_HAS_SUBSCRIPTION_SERVICE - select HAS_IRONSIDE_SE_CALL config SOC_NRF9230_ENGB_CPURAD select ARM @@ -54,7 +53,6 @@ config SOC_NRF9230_ENGB_CPURAD select NRFS_HAS_PMIC_SERVICE select NRFS_HAS_TEMP_SERVICE select NRFS_TEMP_SERVICE_HAS_SUBSCRIPTION_SERVICE - select HAS_IRONSIDE_SE_CALL config SOC_NRF9230_ENGB_CPUPPR select RISCV_CORE_NORDIC_VPR From b00b3ace18741729e5d215b506afa9ff70063d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:34 +0200 Subject: [PATCH 2661/3334] Revert "[nrf fromlist] soc: nordic: uicr: add support for new UICR features" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b5f993e46f1c5eb8243d891fabbcb447fd958905. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/ironside/se/CMakeLists.txt | 10 +- modules/hal_nordic/ironside/se/Kconfig | 11 -- modules/hal_nordic/ironside/se/uicr.ld | 12 --- soc/nordic/common/uicr/Kconfig.gen_uicr | 88 --------------- .../common/uicr/gen_uicr/CMakeLists.txt | 102 +++--------------- 5 files changed, 15 insertions(+), 208 deletions(-) diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index a4c3c66aa8fe..87dbeb333038 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -15,7 +15,7 @@ zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL ) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c) -if(CONFIG_NRF_PERIPHCONF_SECTION OR CONFIG_NRF_MPCCONF_SECTION) +if(CONFIG_NRF_PERIPHCONF_SECTION) zephyr_linker_sources(SECTIONS uicr.ld) endif() @@ -49,11 +49,3 @@ if(CONFIG_NRF_PERIPHCONF_SECTION AND NOT SYSBUILD) "Sysbuild and ensure that SB_CONFIG_NRF_HALTIUM_GENERATE_UICR=y." ) endif() - -if(CONFIG_NRF_MPCCONF_SECTION AND NOT SYSBUILD) - message(WARNING "CONFIG_NRF_MPCCONF_SECTION is enabled, but Sysbuild is not being used. " - "The MPC configuration will not be applied unless artifacts " - "are generated manually/externally. To enable automatic generation, build with " - "Sysbuild and ensure that SB_CONFIG_NRF_HALTIUM_GENERATE_UICR=y." - ) -endif() diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index 80598be0b89a..04e271c0b78b 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -47,17 +47,6 @@ config IRONSIDE_SE_DVFS_ABB_STATUSANA_CHECK_MAX_ATTEMPTS endif # IRONSIDE_SE_DVFS -config NRF_MPCCONF_SECTION - bool "Global Memory Privilege Controller (MPC) initialization section" - depends on LINKER_DEVNULL_SUPPORT - imply LINKER_DEVNULL_MEMORY - help - Include static global Memory Privilege Controller (MPC) peripheral - initialization values from the build in a dedicated section. The section is - stripped from the firmware binary. If the UICR generator image is enabled, - it will include the stripped section in the generated UICR MPCCONF blob. - Currently the UICR generator supports at most one image setting this. - menuconfig NRF_PERIPHCONF_SECTION bool "Global peripheral initialization section" depends on LINKER_DEVNULL_SUPPORT diff --git a/modules/hal_nordic/ironside/se/uicr.ld b/modules/hal_nordic/ironside/se/uicr.ld index a134fe380242..acfc52242893 100644 --- a/modules/hal_nordic/ironside/se/uicr.ld +++ b/modules/hal_nordic/ironside/se/uicr.ld @@ -4,18 +4,7 @@ */ #include -#include -#if defined(CONFIG_NRF_MPCCONF_SECTION) - -SECTION_PROLOGUE(mpcconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) -{ - KEEP(*(.mpcconf_entry)); -} GROUP_ROM_LINK_IN(DEVNULL_REGION, DEVNULL_REGION) - -#endif - -#if defined(CONFIG_NRF_PERIPHCONF_SECTION) #if defined(CONFIG_NRF_PERIPHCONF_SECTION_STRIP) SECTION_PROLOGUE(periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) @@ -28,4 +17,3 @@ SECTION_PROLOGUE(periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) ITERABLE_SECTION_ROM(periphconf_entry, Z_LINK_ITERABLE_SUBALIGN) #endif -#endif diff --git a/soc/nordic/common/uicr/Kconfig.gen_uicr b/soc/nordic/common/uicr/Kconfig.gen_uicr index 65d98e3a0b66..0e726e6712bb 100644 --- a/soc/nordic/common/uicr/Kconfig.gen_uicr +++ b/soc/nordic/common/uicr/Kconfig.gen_uicr @@ -4,19 +4,9 @@ menu "UICR generator options" depends on IS_GEN_UICR_IMAGE -config GEN_UICR_PERIPHCONF - bool "UICR.PERIPHCONF" - default y - depends on $(dt_nodelabel_enabled,periphconf_partition) - help - When enabled, the UICR generator will configure the location - of the peripheral configuration data, based on the - periphconf_partition in device tree. - config GEN_UICR_GENERATE_PERIPHCONF bool "Generate PERIPHCONF hex alongside UICR" default y - depends on GEN_UICR_PERIPHCONF help When enabled, the UICR generator will populate the periphconf_partition partition. @@ -104,25 +94,6 @@ config GEN_UICR_PROTECTEDMEM_SIZE_BYTES Size of the protected memory region in bytes. This value must be divisible by 4096 (4 kiB). -config GEN_UICR_MPCCONF - bool "UICR.MPCCONF" - depends on $(dt_nodelabel_enabled,mpcconf_partition) - help - When enabled, the UICR generator will configure the location - of the MPC configuration data, based on the - mpcconf_partition in device tree. - - Enabling this option causes the generated UICR format version to be set - to >= 2.2, which requires IronSide SE v23.4.0+27 or higher to be installed. - -config GEN_UICR_GENERATE_MPCCONF - bool "Generate MPCCONF hex alongside UICR" - default y - depends on GEN_UICR_MPCCONF - help - When enabled, the UICR generator will populate the - mpcconf_partition partition. - config GEN_UICR_WDTSTART bool "UICR.WDTSTART" help @@ -215,19 +186,9 @@ config GEN_UICR_SECONDARY if GEN_UICR_SECONDARY -config GEN_UICR_SECONDARY_PERIPHCONF - bool "UICR.SECONDARY.PERIPHCONF" - default y - depends on $(dt_nodelabel_enabled,secondary_periphconf_partition) - help - When enabled, the UICR generator will configure the location - of the peripheral configuration data for the secondary firmware, - based on the secondary_periphconf_partition in device tree. - config GEN_UICR_SECONDARY_GENERATE_PERIPHCONF bool "Generate SECONDARY.PERIPHCONF hex alongside UICR" default y - depends on GEN_UICR_SECONDARY_PERIPHCONF help When enabled, the UICR generator will populate the secondary_periphconf_partition partition. @@ -311,25 +272,6 @@ config GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES Size of the secondary protected memory region in bytes. This value must be divisible by 4096 (4 kiB). -config GEN_UICR_SECONDARY_MPCCONF - bool "UICR.SECONDARY.MPCCONF" - depends on $(dt_nodelabel_enabled,secondary_mpcconf_partition) - help - When enabled, the UICR generator will configure the location - of the MPC configuration data for the secondary firmware, - based on the secondary_mpcconf_partition in device tree. - - Enabling this option causes the generated UICR format version to be set - to >= 2.2, which requires IronSide SE v23.4.0+27 or higher to be installed. - -config GEN_UICR_SECONDARY_GENERATE_MPCCONF - bool "Generate SECONDARY.MPCCONF hex alongside UICR" - default y - depends on GEN_UICR_SECONDARY_MPCCONF - help - When enabled, the UICR generator will populate the - secondary_mpcconf_partition partition. - endif # GEN_UICR_SECONDARY choice GEN_UICR_POLICY_PERIPHCONF_STAGE @@ -363,34 +305,4 @@ config GEN_UICR_POLICY_PERIPHCONF_STAGE_VALUE default 0x1730C77F if GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL default 0 -choice GEN_UICR_POLICY_MPCCONF_STAGE - bool "UICR.POLICY_MPCCONFSTAGE" - default GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL - help - Sets the behavior of the IronSide SE MPCCONF service APIs at boot. - -config GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL - bool "Normal operation stage" - help - The API starts in the normal operation stage, meaning that no explicit - API call is needed to finish initialization. - -config GEN_UICR_POLICY_MPCCONF_STAGE_INIT - bool "Initialization stage" - help - The API starts in the initialization stage, which gives permission - to update the global domain MPC configuration. To finish initialization, - the application must notify IronSide SE via the ironside_se_mpcconf_finish_init() API. - - Enabling this policy option causes the generated UICR format version to be set - to >= 2.2, which requires IronSide SE v23.4.0+27 or higher to be installed. - -endchoice - -config GEN_UICR_POLICY_MPCCONF_STAGE_VALUE - hex - default 0xBD2328A8 if GEN_UICR_POLICY_MPCCONF_STAGE_INIT - default 0x1730C77F if GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL - default 0 - endmenu diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 5f65b9012efe..81b5c59c63bd 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -80,19 +80,14 @@ set(eraseprotect_args) set(approtect_args) set(protectedmem_args) set(periphconf_args) -set(mpcconf_args) set(wdtstart_args) set(periphconf_elfs) -set(mpcconf_elfs) set(policy_args) set(merged_hex_file ${APPLICATION_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.hex) set(secondary_periphconf_elfs) -set(secondary_mpcconf_elfs) set(uicr_hex_file ${APPLICATION_BINARY_DIR}/zephyr/uicr.hex) set(periphconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/periphconf.hex) set(secondary_periphconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/secondary_periphconf.hex) -set(mpcconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/mpcconf.hex) -set(secondary_mpcconf_hex_file ${APPLICATION_BINARY_DIR}/zephyr/secondary_mpcconf.hex) # Get UICR absolute address from this image's devicetree dt_nodelabel(uicr_path NODELABEL "uicr" REQUIRED) @@ -160,28 +155,7 @@ if(CONFIG_GEN_UICR_WDTSTART) list(APPEND wdtstart_args --wdtstart-crv ${CONFIG_GEN_UICR_WDTSTART_CRV}) endif() -if(CONFIG_GEN_UICR_MPCCONF) - list(APPEND mpcconf_args --mpcconf) - - # Compute MPCCONF absolute address and size from this image's devicetree - compute_partition_address_and_size("mpcconf_partition" MPCCONF_ADDRESS MPCCONF_SIZE) - - list(APPEND mpcconf_args --mpcconf-address ${MPCCONF_ADDRESS}) - list(APPEND mpcconf_args --mpcconf-size ${MPCCONF_SIZE}) -endif() - -if(CONFIG_GEN_UICR_PERIPHCONF) - list(APPEND periphconf_args --periphconf) - - # Compute PERIPHCONF absolute address and size from this image's devicetree - compute_partition_address_and_size("periphconf_partition" PERIPHCONF_ADDRESS PERIPHCONF_SIZE) - - list(APPEND periphconf_args --periphconf-address ${PERIPHCONF_ADDRESS}) - list(APPEND periphconf_args --periphconf-size ${PERIPHCONF_SIZE}) -endif() - -if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF OR CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF OR - CONFIG_GEN_UICR_GENERATE_MPCCONF OR CONFIG_GEN_UICR_SECONDARY_GENERATE_MPCCONF) +if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) # gen_uicr.py parses all zephyr.elf files. To find these files (which # have not been built yet) we scan sibling build directories for # zephyr.dts @@ -202,9 +176,6 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF OR CONFIG_GEN_UICR_SECONDARY_GENERATE_PER continue() endif() - parse_kconfig_value(${_dir}/zephyr/.config CONFIG_NRF_PERIPHCONF_SECTION has_periphconf) - parse_kconfig_value(${_dir}/zephyr/.config CONFIG_NRF_MPCCONF_SECTION has_mpcconf) - # Read CONFIG_KERNEL_BIN_NAME from the sibling's .config file parse_kconfig_value(${_dir}/zephyr/.config CONFIG_KERNEL_BIN_NAME kernel_bin_name) set(kernel_elf_path ${_dir}/zephyr/${kernel_bin_name}.elf) @@ -212,40 +183,25 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF OR CONFIG_GEN_UICR_SECONDARY_GENERATE_PER # Check if this is secondary firmware by reading the Kconfig from .config parse_kconfig_value(${_dir}/zephyr/.config CONFIG_IS_IRONSIDE_SE_SECONDARY_IMAGE is_secondary) if(is_secondary STREQUAL "y") - if(has_periphconf) - list(APPEND secondary_periphconf_elfs ${kernel_elf_path}) - endif() - if(has_mpcconf) - list(APPEND secondary_mpcconf_elfs ${kernel_elf_path}) - endif() + list(APPEND secondary_periphconf_elfs ${kernel_elf_path}) else() - if(has_periphconf) - list(APPEND periphconf_elfs ${kernel_elf_path}) - endif() - if(has_mpcconf) - list(APPEND mpcconf_elfs ${kernel_elf_path}) - endif() + list(APPEND periphconf_elfs ${kernel_elf_path}) endif() endif() endforeach() - if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) - # Set up periphconf arguments for gen_uicr.py - list(APPEND periphconf_args --out-periphconf-hex ${periphconf_hex_file}) + # Compute PERIPHCONF absolute address and size from this image's devicetree + compute_partition_address_and_size("periphconf_partition" PERIPHCONF_ADDRESS PERIPHCONF_SIZE) - foreach(elf ${periphconf_elfs}) - list(APPEND periphconf_args --in-periphconf-elf ${elf}) - endforeach() - endif() - if(CONFIG_GEN_UICR_GENERATE_MPCCONF) - # Set up mpcconf arguments for gen_uicr.py - list(APPEND mpcconf_args --out-mpcconf-hex ${mpcconf_hex_file}) + # Set up periphconf arguments for gen_uicr.py + list(APPEND periphconf_args --periphconf-address ${PERIPHCONF_ADDRESS}) + list(APPEND periphconf_args --periphconf-size ${PERIPHCONF_SIZE}) + list(APPEND periphconf_args --out-periphconf-hex ${periphconf_hex_file}) - foreach(elf ${mpcconf_elfs}) - list(APPEND mpcconf_args --in-mpcconf-elf ${elf}) - endforeach() - endif() -endif() + foreach(elf ${periphconf_elfs}) + list(APPEND periphconf_args --in-periphconf-elf ${elf}) + endforeach() +endif(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) if(CONFIG_GEN_UICR_SECONDARY) set(secondary_args --secondary) @@ -298,52 +254,24 @@ if(CONFIG_GEN_UICR_SECONDARY) list(APPEND secondary_args --secondary-protectedmem-size ${CONFIG_GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES}) endif() - # Handle secondary MPCCONF configuration - if(CONFIG_GEN_UICR_SECONDARY_MPCCONF) - list(APPEND secondary_args --secondary-mpcconf) - - # Compute SECONDARY_MPCCONF absolute address and size from this image's devicetree - compute_partition_address_and_size("secondary_mpcconf_partition" SECONDARY_MPCCONF_ADDRESS SECONDARY_MPCCONF_SIZE) - - list(APPEND secondary_args --secondary-mpcconf-address ${SECONDARY_MPCCONF_ADDRESS}) - list(APPEND secondary_args --secondary-mpcconf-size ${SECONDARY_MPCCONF_SIZE}) - endif() - - # Handle secondary PERIPHCONF configuration - if(CONFIG_GEN_UICR_SECONDARY_PERIPHCONF) - list(APPEND secondary_args --secondary-periphconf) - + if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) # Compute SECONDARY_PERIPHCONF absolute address and size from this image's devicetree compute_partition_address_and_size("secondary_periphconf_partition" SECONDARY_PERIPHCONF_ADDRESS SECONDARY_PERIPHCONF_SIZE) list(APPEND secondary_args --secondary-periphconf-address ${SECONDARY_PERIPHCONF_ADDRESS}) list(APPEND secondary_args --secondary-periphconf-size ${SECONDARY_PERIPHCONF_SIZE}) - endif() - - if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF) list(APPEND secondary_args --out-secondary-periphconf-hex ${secondary_periphconf_hex_file}) foreach(elf ${secondary_periphconf_elfs}) list(APPEND secondary_args --in-secondary-periphconf-elf ${elf}) endforeach() endif() - if(CONFIG_GEN_UICR_SECONDARY_GENERATE_MPCCONF) - list(APPEND secondary_args --out-secondary-mpcconf-hex ${secondary_mpcconf_hex_file}) - - foreach(elf ${secondary_mpcconf_elfs}) - list(APPEND secondary_args --in-secondary-mpcconf-elf ${elf}) - endforeach() - endif() endif() if(CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL) list(APPEND policy_args --policy-periphconf-stage ${CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_VALUE}) endif() -if(CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL) - list(APPEND policy_args --policy-mpcconf-stage ${CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_VALUE}) -endif() - # Generate hex files (merged, uicr-only, periphconf-only, and secondary-periphconf-only) add_custom_command( OUTPUT ${merged_hex_file} ${uicr_hex_file} ${periphconf_hex_file} ${secondary_periphconf_hex_file} @@ -353,13 +281,11 @@ add_custom_command( --out-merged-hex ${merged_hex_file} --out-uicr-hex ${uicr_hex_file} --periphconf-section-name "periphconf_entry" - --mpcconf-section-name "mpcconf_entry" --periphconf-ipcmap-reallocate ${lock_args} ${eraseprotect_args} ${approtect_args} ${wdtstart_args} - ${mpcconf_args} ${periphconf_args} ${securestorage_args} ${protectedmem_args} From 9d216414eca18fd0f5e084190cf6f3b94033e895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:34 +0200 Subject: [PATCH 2662/3334] Revert "[nrf fromlist] boards: nrf54h20dk: Add partitions for UICR MPCCONF" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 60aa88bc152dfb7b7b27e138f245cb641df684a3. Signed-off-by: Andrzej Głąbek --- .../nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi | 8 -------- 1 file changed, 8 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index 91ee56a6ecc8..675e4555ac26 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -176,14 +176,6 @@ reg = <0x1c0000 DT_SIZE_K(8)>; }; - mpcconf_partition: partition@1c2000 { - reg = <0x1c2000 512>; - }; - - secondary_mpcconf_partition: partition@1c2200 { - reg = <0x1c2200 512>; - }; - /* NB: A gap has been left here for future partitions */ /* 0x1fd000 was chosen for secure_storage_partition such that From 8ed0432d3be729a7139e0bba557bb430c950ef8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:35 +0200 Subject: [PATCH 2663/3334] Revert "[nrf fromlist] manifest: update hal_nordic revision with IronSide SE support package" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8ddd16a64fea379ddf80eecc214ea974c512dd96. Signed-off-by: Andrzej Głąbek --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e30fc158b29e..e6976ce4472f 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 4dea410729da817a464f778533eb721473262e5b + revision: 5c1df3fe9bc144e558b3506cef6cf33652bb2539 path: modules/hal/nordic groups: - hal From de4cb7e03c3336e61879e63a7e80e2d1bf0d234a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:35 +0200 Subject: [PATCH 2664/3334] Revert "[nrf fromlist] nrf54h20: Add MCUboot to supported configurations" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 45ad4db14902a82a6e105ed91cb54601d2bdcac8. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54h/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index cf33c96309fe..189bb117ebf5 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -10,6 +10,7 @@ config SOC_SERIES_NRF54H select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM select NRF_PLATFORM_HALTIUM + select EXPERIMENTAL if MCUBOOT config SOC_SERIES_NRF54HX select DEPRECATED From ea2eb2d4c4ef1081c94fa95709c3ec170a9fdd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:35 +0200 Subject: [PATCH 2665/3334] Revert "[nrf fromtree] boards: nordic: nrf9280pdk: Add workaround for SoC1.1 GRTC issue" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9387f4825164523a0e10a517149b40f36b7f5dad. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index dc8bee73f011..7ae6e8ca81a2 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -233,8 +233,7 @@ slot1_partition: &cpuapp_slot1_partition { &grtc { status = "okay"; child-owned-channels = <5 6>; - /* Workaround for a GRTC related issue with SoC1.1, set channel 4 to nonsecure. */ - nonsecure-channels = <4 5 6>; + nonsecure-channels = <5 6>; owned-channels = <4 5 6>; }; From f1d90ca4ae3b87cecfe8b048b147493568240f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:35 +0200 Subject: [PATCH 2666/3334] Revert "[nrf fromlist] samples: boards: nordic: system_off: Enable nrf54lm20b." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ad6a55f880e6c88e51afb2ab7ebe3b0b6978b3f8. Signed-off-by: Andrzej Głąbek --- .../nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi | 25 ------------------ .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 26 ++++++++++++++++++- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 1 - samples/boards/nordic/system_off/sample.yaml | 6 ----- 4 files changed, 25 insertions(+), 33 deletions(-) delete mode 100644 samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi delete mode 100644 samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi deleted file mode 100644 index 3a79636a4833..000000000000 --- a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi +++ /dev/null @@ -1,25 +0,0 @@ -/ { - cpuapp_sram@2007ec00 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2007ec00 DT_SIZE_K(4)>; - zephyr,memory-region = "RetainedMem"; - status = "okay"; - - retainedmem0: retainedmem { - compatible = "zephyr,retained-ram"; - status = "okay"; - }; - }; - - aliases { - retainedmemdevice = &retainedmem0; - }; -}; - -&cpuapp_sram { - /* Shrink SRAM size to avoid overlap with retained memory region: - * 511 - 4 = 507KB = 0x7ec00 - */ - reg = <0x20000000 DT_SIZE_K(507)>; - ranges = <0x0 0x20000000 0x7ec00>; -}; diff --git a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index ab8529994033..3a79636a4833 100644 --- a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1 +1,25 @@ -#include "nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi" +/ { + cpuapp_sram@2007ec00 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2007ec00 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + /* Shrink SRAM size to avoid overlap with retained memory region: + * 511 - 4 = 507KB = 0x7ec00 + */ + reg = <0x20000000 DT_SIZE_K(507)>; + ranges = <0x0 0x20000000 0x7ec00>; +}; diff --git a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index ab8529994033..000000000000 --- a/samples/boards/nordic/system_off/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1 +0,0 @@ -#include "nrf54lm20dk_nrf54lm20_a_b_cpuapp.dtsi" diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index debdcf8ecd05..0672c22e4c63 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -15,7 +15,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp harness: console harness_config: @@ -36,7 +35,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y @@ -57,7 +55,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_SYS_CLOCK_DISABLE=y @@ -76,7 +73,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y @@ -99,7 +95,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_GRTC_WAKEUP_ENABLE=y @@ -125,7 +120,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y From 630dee2dfbc5284f906379f97a9f118df8438350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:36 +0200 Subject: [PATCH 2667/3334] Revert "[nrf fromtree] tests: drivers: Enable clock_control tests on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9e480206c81c39af12a4e2ba73daecb659566646. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 1 - .../clock_control/clock_control_api/testcase.yaml | 2 -- .../clock_control/nrf_clock_calibration/testcase.yaml | 1 - .../clock_control/nrf_lf_clock_start/testcase.yaml | 9 --------- tests/drivers/clock_control/onoff/testcase.yaml | 1 - 5 files changed, 14 deletions(-) delete mode 100644 tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf diff --git a/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf deleted file mode 100644 index 11d42321cbc3..000000000000 --- a/tests/drivers/clock_control/clock_control_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_TEST_NRF_HF_STARTUP_TIME_US=1000 diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index e6f85d8deae4..d91ea13821ed 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -26,7 +26,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -39,7 +38,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index 2fc0d85f0f4a..f7c3dd46a048 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -11,7 +11,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index 995d7825ccd8..e61cf2deffbf 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -17,7 +17,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -37,7 +36,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: @@ -57,7 +55,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -76,7 +73,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -95,7 +91,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -114,7 +109,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -133,7 +127,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -152,7 +145,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: @@ -171,7 +163,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index aedd89340535..84bb601a8d13 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -10,7 +10,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp From 597f8f24d0f6418a17ab4abaaff14423556b359b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:36 +0200 Subject: [PATCH 2668/3334] Revert "[nrf fromtree] tests: drivers: Enable GPIO tests on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c6a579cdf2343bea2932c7d0bf2565b12be1a096. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ------- .../boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay | 7 ------- 2 files changed, 14 deletions(-) delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index e32a2d372055..000000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.overlay" diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay deleted file mode 100644 index e32a2d372055..000000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.overlay" From ded2b0dbc51cbe77335bd54f104b278020550050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:36 +0200 Subject: [PATCH 2669/3334] Revert "[nrf fromtree] include/zephyr/settings: remove API functions #if-defry" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 098b02839c00dd78f2bd87f4dc00a63f6242f853. Signed-off-by: Andrzej Głąbek --- include/zephyr/settings/settings.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/zephyr/settings/settings.h b/include/zephyr/settings/settings.h index 77030c0f9611..cd45597b8903 100644 --- a/include/zephyr/settings/settings.h +++ b/include/zephyr/settings/settings.h @@ -410,13 +410,12 @@ int settings_commit(void); */ int settings_commit_subtree(const char *subtree); +#if defined(CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION) || defined(__DOXYGEN__) /** * Save a single currently running serialized value to persisted storage (if it has changed * value) by reading the value using the get function, or save a whole subtree's currently * running serialized items out. * - * @kconfig_dep{CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_MODIFICATION} - * * @param name Name/key of the settings item or subtree. * @param save_if_subtree Set to true if the item should be save and it is a subtree. * @param save_if_single_setting Set to true if the item should be save and it is a single @@ -427,6 +426,7 @@ int settings_commit_subtree(const char *subtree); int settings_save_subtree_or_single_without_modification(const char *name, bool save_if_subtree, bool save_if_single_setting); +#endif /** * @} settings @@ -649,6 +649,8 @@ int settings_name_next(const char *name, const char **next); * @} */ +#ifdef CONFIG_SETTINGS_RUNTIME + /** * @defgroup settings_rt Settings subsystem runtime * @brief API for runtime settings @@ -659,8 +661,6 @@ int settings_name_next(const char *name, const char **next); /** * Set a value with a specific key to a module handler. * - * @kconfig_dep{CONFIG_SETTINGS_RUNTIME} - * * @param name Key in string format. * @param data Binary value. * @param len Value length in bytes. @@ -672,8 +672,6 @@ int settings_runtime_set(const char *name, const void *data, size_t len); /** * Get a value corresponding to a key from a module handler. * - * @kconfig_dep{CONFIG_SETTINGS_RUNTIME} - * * @param name Key in string format. * @param data Returned binary value. * @param len requested value length in bytes. @@ -685,8 +683,6 @@ int settings_runtime_get(const char *name, void *data, size_t len); /** * Apply settings in a module handler. * - * @kconfig_dep{CONFIG_SETTINGS_RUNTIME} - * * @param name Key in string format. * * @return 0 on success, non-zero on failure. @@ -696,6 +692,8 @@ int settings_runtime_commit(const char *name); * @} */ +#endif /* CONFIG_SETTINGS_RUNTIME */ + /** * Get the storage instance used by zephyr. * From 72bc6209ca2215dd6570e5a88d3ee80ae05d7153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:37 +0200 Subject: [PATCH 2670/3334] Revert "[nrf fromlist] modules: hal_nordic: add support for more PRS boxes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2ee09ed913091764595c348f2d9e892eae3c36c6. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/nrfx/Kconfig | 20 -------------------- modules/hal_nordic/nrfx/nrfx_kconfig.h | 15 --------------- 2 files changed, 35 deletions(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index beefa0f5352c..59f3d9fe2fde 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -327,26 +327,6 @@ config NRFX_PRS_BOX_4 bool "PRS box 4" select NRFX_PRS -config NRFX_PRS_BOX_5 - bool "PRS box 5" - select NRFX_PRS - -config NRFX_PRS_BOX_6 - bool "PRS box 6" - select NRFX_PRS - -config NRFX_PRS_BOX_7 - bool "PRS box 7" - select NRFX_PRS - -config NRFX_PRS_BOX_8 - bool "PRS box 8" - select NRFX_PRS - -config NRFX_PRS_BOX_9 - bool "PRS box 9" - select NRFX_PRS - endmenu config NRFX_RESERVED_RESOURCES_HEADER diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 32fcc824495c..d75ed21aac55 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -259,21 +259,6 @@ #ifdef CONFIG_NRFX_PRS_BOX_4 #define NRFX_PRS_BOX_4_ENABLED 1 #endif -#ifdef CONFIG_NRFX_PRS_BOX_5 -#define NRFX_PRS_BOX_5_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PRS_BOX_6 -#define NRFX_PRS_BOX_6_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PRS_BOX_7 -#define NRFX_PRS_BOX_7_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PRS_BOX_8 -#define NRFX_PRS_BOX_8_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_PRS_BOX_9 -#define NRFX_PRS_BOX_9_ENABLED 1 -#endif #ifdef CONFIG_NRFX_PWM #define NRFX_PWM_ENABLED 1 From e4cac2489c82532e2bf68eba6718823c3a98967b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:37 +0200 Subject: [PATCH 2671/3334] Revert "[nrf fromtree] samples: drivers: jesd216: Run sample on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f80011480a2208ddbfb2decad3e3d9dab078c548. Signed-off-by: Andrzej Głąbek --- .../jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 --------- samples/drivers/jesd216/sample.yaml | 2 -- 2 files changed, 11 deletions(-) delete mode 100644 samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 3ab838329612..000000000000 --- a/samples/drivers/jesd216/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/drivers/jesd216/sample.yaml b/samples/drivers/jesd216/sample.yaml index 7080dda2abb8..4fd0af6c9ca2 100644 --- a/samples/drivers/jesd216/sample.yaml +++ b/samples/drivers/jesd216/sample.yaml @@ -22,7 +22,6 @@ tests: - mimxrt1170_evk/mimxrt1176/cm7 - mimxrt1170_evk/mimxrt1176/cm4 - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("jedec,mspi-nor") depends_on: spi sample.drivers.jesd216.nrf52840dk_spi: @@ -37,7 +36,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l05/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp integration_platforms: - nrf54lm20dk/nrf54lm20a/cpuapp harness_config: From 567a9c183bf5cbd40de3ddb53c6d27e07ea50653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:37 +0200 Subject: [PATCH 2672/3334] Revert "[nrf fromtree] tests: drivers: spi: Run spi_loopback on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9ceb51304330596060e87e9d5df1db8692ec1ec7. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 1 - .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 53 ----------------- ...rf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay | 57 ------------------- tests/drivers/spi/spi_loopback/testcase.yaml | 4 +- 4 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf deleted file mode 100644 index ad922ab8d26f..000000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=12 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 35da44246394..000000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopback: - * P1.13 - P1.14 - */ - -&pinctrl { - spi21_default: spi21_default { - group1 { - psels = , - , - ; - }; - }; - - spi21_sleep: spi21_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - -&spi21 { - status = "okay"; - pinctrl-0 = <&spi21_default>; - pinctrl-1 = <&spi21_sleep>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - zephyr,pm-device-runtime-auto; - - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = ; - }; - - dut_fast: fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay b/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay deleted file mode 100644 index 27fe2005e480..000000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp_spi00.overlay +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopback: - * P2.02 - P2.04 - */ - -&pinctrl { - spi00_default: spi00_default { - group1 { - psels = ; - }; - - group2 { - psels = , - ; - nordic,drive-mode = ; - }; - }; - - spi00_sleep: spi00_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - -&spi00 { - status = "okay"; - pinctrl-0 = <&spi00_default>; - pinctrl-1 = <&spi00_sleep>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - zephyr,pm-device-runtime-auto; - - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = ; - }; - - dut_fast: fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -&gpio2 { - status = "okay"; -}; diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index 14d396de53a8..cf589c48fcab 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -296,7 +296,6 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_16mhz: @@ -316,10 +315,9 @@ tests: harness_config: fixture: spi_fast_loopback extra_args: - - FILE_SUFFIX=spi00 + - DTC_OVERLAY_FILE="boards/nrf54lm20dk_nrf54lm20a_cpuapp_spi00.overlay" platform_allow: - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp drivers.spi.ke1xz_flexio_spi.loopback: extra_args: DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_spi.overlay" filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and From 891c86742de9d1d103429b62b82ca47a8bc9295f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:37 +0200 Subject: [PATCH 2673/3334] Revert "[nrf fromtree] tests: drivers: spi: Run spi_error_cases on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1f7894512f05c57b19ba3221ded5068437d3be32. Signed-off-by: Andrzej Głąbek --- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 81 ------------------- .../drivers/spi/spi_error_cases/testcase.yaml | 1 - 2 files changed, 82 deletions(-) delete mode 100644 tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 56d1cf573d00..000000000000 --- a/tests/drivers/spi/spi_error_cases/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopbacks: - * SCK: P1.23 - P1.24 - * MISO: P1.30 - P1.31 - * MOSI: P1.13 - P1.14 - * CS: P1.03 - P1.04 - */ - -&pinctrl { - spi22_default_alt: spi22_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi22_sleep_alt: spi22_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi21_default_alt: spi21_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi21_sleep_alt: spi21_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&spi22 { - status = "okay"; - pinctrl-0 = <&spi22_default_alt>; - pinctrl-1 = <&spi22_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - zephyr,pm-device-runtime-auto; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -dut_spis: &spi21 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi21_default_alt>; - pinctrl-1 = <&spi21_sleep_alt>; - pinctrl-names = "default", "sleep"; - /delete-property/ rx-delay-supported; - /delete-property/ rx-delay; -}; diff --git a/tests/drivers/spi/spi_error_cases/testcase.yaml b/tests/drivers/spi/spi_error_cases/testcase.yaml index a847742bc0cd..6e4aa26a79f7 100644 --- a/tests/drivers/spi/spi_error_cases/testcase.yaml +++ b/tests/drivers/spi/spi_error_cases/testcase.yaml @@ -16,7 +16,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 937e3c7acbd9ad7fb677e7b7d0fbdc3d3e80d222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:38 +0200 Subject: [PATCH 2674/3334] Revert "[nrf fromtree] tests: drivers: spi: Run spi_controller_peripheral on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 491d47733054714bd4b83ce5975a33cbad106500. Signed-off-by: Andrzej Głąbek --- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 81 ------------------- .../spi_controller_peripheral/testcase.yaml | 3 - 2 files changed, 84 deletions(-) delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 56d1cf573d00..000000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires following loopbacks: - * SCK: P1.23 - P1.24 - * MISO: P1.30 - P1.31 - * MOSI: P1.13 - P1.14 - * CS: P1.03 - P1.04 - */ - -&pinctrl { - spi22_default_alt: spi22_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi22_sleep_alt: spi22_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi21_default_alt: spi21_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi21_sleep_alt: spi21_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&spi22 { - status = "okay"; - pinctrl-0 = <&spi22_default_alt>; - pinctrl-1 = <&spi22_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - zephyr,pm-device-runtime-auto; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -dut_spis: &spi21 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi21_default_alt>; - pinctrl-1 = <&spi21_sleep_alt>; - pinctrl-names = "default", "sleep"; - /delete-property/ rx-delay-supported; - /delete-property/ rx-delay; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 83602ed1229d..69d62b09042a 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -14,7 +14,6 @@ common: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -88,7 +87,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp @@ -104,7 +102,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp From 05716cce37b5ce1cc4f383fdd44e2d133b796e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:38 +0200 Subject: [PATCH 2675/3334] Revert "[nrf fromtree] tests: drivers: uart: uart_async_api: Enable test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a2078e2447dbb6cc51b991ef8812b8e1fb38294a. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ------- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 7 ------- .../boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay | 7 ------- 3 files changed, 21 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 181d830c5816dc1e584ff4f99608d56ec18be1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:38 +0200 Subject: [PATCH 2676/3334] Revert "[nrf fromtree] tests: drivers: i2s: Enable testing on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit da8d5e3e8bca79bc5dc18978cad43a7bcd926d47. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 30 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 +++++++++++++++- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay | 8 +---- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ----- .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 7 ----- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 30 ------------------- .../nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 25 +++++++++++++++- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay | 8 +---- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ----- .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 7 ----- 10 files changed, 50 insertions(+), 104 deletions(-) delete mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay delete mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20_common.dtsi delete mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index b702f98fcc42..000000000000 --- a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 1e6f31ac52d0..ef680d4b4105 100644 --- a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,4 +4,27 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , /* TDM_SDOUT shorted to TDM_SDIN */ + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay index 1e6f31ac52d0..a2b49797f82f 100644 --- a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay +++ b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay @@ -1,7 +1 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" +#include "nrf54lm20dk_nrf54lm20a_cpuapp.overlay" diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/i2s/i2s_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20_common.dtsi deleted file mode 100644 index b702f98fcc42..000000000000 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; -}; diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 1e6f31ac52d0..ef680d4b4105 100644 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,4 +4,27 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20dk_nrf54lm20_common.dtsi" +/* i2s-node0 is the transmitter/receiver */ + +/ { + aliases { + i2s-node0 = &tdm; + }; +}; + +&pinctrl { + tdm_default_alt: tdm_default_alt { + group1 { + psels = , + , + , /* TDM_SDOUT shorted to TDM_SDIN */ + ; + }; + }; +}; + +&tdm { + status = "okay"; + pinctrl-0 = <&tdm_default_alt>; + pinctrl-names = "default"; +}; diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay index 1e6f31ac52d0..a2b49797f82f 100644 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay +++ b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.overlay @@ -1,7 +1 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" +#include "nrf54lm20dk_nrf54lm20a_cpuapp.overlay" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/i2s/i2s_speed/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" From e9876c9746c630ed49c4df0e770a1ac4316d4354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:39 +0200 Subject: [PATCH 2677/3334] Revert "[nrf fromtree] tests: drivers: counter: counter_basic_api: Fix testing on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 504e8d48e897d3a26917676c990ca277c631157f. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 7 ------- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay | 7 ------- .../boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay | 7 ------- 3 files changed, 21 deletions(-) delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp_ns.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay deleted file mode 100644 index f42b85509760..000000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuflpr.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20dk_nrf54lm20_common.dtsi" From 9c43a3d44d38d1b3f237ac4120cdd5babd0a3696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:39 +0200 Subject: [PATCH 2678/3334] Revert "[nrf fromtree] tests: drivers: uart: async_api: Clean up nrf54lm20 configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 56a4c56085fe86a0e752cf777ec705f3b786a309. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 28 ------------- ...f54lm20dk_nrf54lm20a_cpuapp_uart00.overlay | 42 +++++++++++++++++++ .../drivers/uart/uart_async_api/testcase.yaml | 8 ++++ 3 files changed, 50 insertions(+), 28 deletions(-) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi index 873c14563478..8a8a0363b652 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -6,7 +6,6 @@ /* Test requires following loopback: * P1.13 - P1.14 - * P2.07 - P2.08 */ &pinctrl { @@ -24,25 +23,6 @@ low-power-enable; }; }; - - uart00_default_alt: uart00_default_alt { - group1 { - psels = ; - }; - - group2 { - psels = ; - bias-pull-up; - }; - }; - - uart00_sleep_alt: uart00_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; }; dut: &uart21 { @@ -52,11 +32,3 @@ dut: &uart21 { pinctrl-names = "default", "sleep"; current-speed = <115200>; }; - -dut2: &uart00 { - status = "okay"; - pinctrl-0 = <&uart00_default_alt>; - pinctrl-1 = <&uart00_sleep_alt>; - pinctrl-names = "default", "sleep"; - current-speed = <4000000>; -}; diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay new file mode 100644 index 000000000000..5f129663e55e --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Test requires following loopback: + * P2.02 - P2.00 + */ + +&pinctrl { + uart00_default_alt: uart00_default_alt { + group1 { + psels = ; + }; + + group2 { + psels = ; + bias-pull-up; + }; + }; + + uart00_sleep_alt: uart00_sleep_alt { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +dut: &uart00 { + status = "okay"; + pinctrl-0 = <&uart00_default_alt>; + pinctrl-1 = <&uart00_sleep_alt>; + pinctrl-names = "default", "sleep"; + current-speed = <4000000>; +}; + +&gpio2 { + status = "okay"; +}; diff --git a/tests/drivers/uart/uart_async_api/testcase.yaml b/tests/drivers/uart/uart_async_api/testcase.yaml index 2b6bc6681b8f..cf29a6618aba 100644 --- a/tests/drivers/uart/uart_async_api/testcase.yaml +++ b/tests/drivers/uart/uart_async_api/testcase.yaml @@ -18,6 +18,14 @@ tests: - platform:mimxrt685_evk/mimxrt685s/cm33:"DTC_OVERLAY_FILE=nxp/dut_flexcomm4.overlay" - platform:mimxrt595_evk/mimxrt595s/cm33:"DTC_OVERLAY_FILE=nxp/dut_flexcomm12.overlay" - platform:frdm_rw612/rw612:"DTC_OVERLAY_FILE=nxp/dut_lpc_flexcomm0.overlay" + drivers.uart.async_api.fast: + harness: ztest + harness_config: + fixture: uart_fast_loopback + platform_allow: + - nrf54lm20dk/nrf54lm20a/cpuapp + extra_args: + - DTC_OVERLAY_FILE="boards/nrf54lm20dk_nrf54lm20a_cpuapp_uart00.overlay" drivers.uart.wide: filter: CONFIG_SERIAL_SUPPORT_ASYNC and not CONFIG_UART_MCUX_LPUART harness: ztest From 3a46347cbe756b56d6359f5e680e635a59743847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:39 +0200 Subject: [PATCH 2679/3334] Revert "[nrf fromtree] tests: drivers: comparator: Enable gpio_loopback test on nrf54lm20b" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4b6df5ff11b1a10a2ffa89dab7450c0af98c9e3a. Signed-off-by: Andrzej Głąbek --- .../nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 25 ------------------- .../socs/nrf54lm20b_cpuapp_nrf_comp.overlay | 18 ------------- .../socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay | 14 ----------- .../comparator/gpio_loopback/testcase.yaml | 2 -- 4 files changed, 59 deletions(-) delete mode 100644 tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_comp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 94ab328d5887..000000000000 --- a/tests/drivers/comparator/gpio_loopback/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/* - * P1.30 looped back to P1.31 (AIN1) - */ - -/ { - aliases { - test-comp = ∁ - }; - - zephyr,user { - test-gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_comp.overlay deleted file mode 100644 index 31b867fd4390..000000000000 --- a/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_comp.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&comp { - main-mode = "SE"; - psel = ; /* P1.31 */ - refsel = "INT_1V2"; - sp-mode = "HIGH"; - th-up = <63>; - th-down = <59>; - isource = "DISABLED"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay deleted file mode 100644 index 9e38014b573d..000000000000 --- a/tests/drivers/comparator/gpio_loopback/socs/nrf54lm20b_cpuapp_nrf_lpcomp.overlay +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&comp { - compatible = "nordic,nrf-lpcomp"; - psel = ; /* P1.31 */ - refsel = "VDD_4_8"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index abda3de2cb0c..156c446cf3e6 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -30,7 +30,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: @@ -42,7 +41,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.stm32_comp: From b8a496dda23e96f2611c697ee009d646926c9dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:40 +0200 Subject: [PATCH 2680/3334] Revert "[nrf fromlist] drivers: audio: nrfx_pdm: allow requesting ACLK clock" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 838caff2374d8187faf3cf95ea829cb2c7ef1cb3. Signed-off-by: Andrzej Głąbek --- drivers/audio/dmic_nrfx_pdm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index 16d4b6eb9765..dabb273a0d74 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -321,9 +321,10 @@ static int dmic_nrfx_pdm_configure(const struct device *dev, * (which is always available without any additional actions), * it is required to request the proper clock to be running * before starting the transfer itself. + * Targets using CLKSELECT register to select clock source + * do not need to request audio clock. */ - drv_data->request_clock = (drv_cfg->clk_src != PCLK32M && - IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF)); + drv_data->request_clock = (drv_cfg->clk_src != PCLK32M && !NRF_PDM_HAS_CLKSELECT); drv_data->configured = true; return 0; } From ab94aaa8453fb3f503090ad016c1c881ffcb9590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:40 +0200 Subject: [PATCH 2681/3334] Revert "[nrf fromlist] boards: nordic: Add nRF54LM20A as DEVELOP_IN target" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 86f0d04d109eb8bf35d82ab6409f7cfce626c89a. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54lm20dk/Kconfig | 5 ---- boards/nordic/nrf54lm20dk/doc/index.rst | 38 ++++--------------------- modules/hal_nordic/nrfx/CMakeLists.txt | 5 ++-- soc/nordic/nrf54l/Kconfig | 7 ----- 4 files changed, 7 insertions(+), 48 deletions(-) delete mode 100644 boards/nordic/nrf54lm20dk/Kconfig diff --git a/boards/nordic/nrf54lm20dk/Kconfig b/boards/nordic/nrf54lm20dk/Kconfig deleted file mode 100644 index de688c459fc9..000000000000 --- a/boards/nordic/nrf54lm20dk/Kconfig +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NRF54LM20DK - select SOC_NRF54LM20A_DEVELOP_IN_NRF54LM20B if SOC_NRF54LM20A_CPUAPP || SOC_NRF54LM20A_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/doc/index.rst b/boards/nordic/nrf54lm20dk/doc/index.rst index 119f0dc89e5a..007074c5cc53 100644 --- a/boards/nordic/nrf54lm20dk/doc/index.rst +++ b/boards/nordic/nrf54lm20dk/doc/index.rst @@ -3,13 +3,8 @@ Overview ******** -.. note:: - You can find more information about the nRF54LM20B SoC on the `nRF54LM20B website`_. - For the nRF54LM20B technical documentation and other resources (such as - SoC Datasheet), see the `nRF54L documentation`_ page. - The nRF54LM20 Development Kit hardware provides support for the Nordic Semiconductor -nRF54LM20B Arm Cortex-M33 CPU and the following devices: +nRF54LM20A Arm Cortex-M33 CPU and the following devices: * :abbr:`SAADC (Successive Approximation Analog to Digital Converter)` * CLOCK @@ -47,19 +42,19 @@ Programming and Debugging .. zephyr:board-supported-runners:: -Applications for the ``nrf54lm20dk/nrf54lm20b/cpuapp`` board target can be +Applications for the ``nrf54lm20dk/nrf54lm20a/cpuapp`` board target can be built, flashed, and debugged in the usual way. See :ref:`build_an_application` and :ref:`application_run` for more details on building and running. -Applications for the ``nrf54lm20dk/nrf54lm20b/cpuflpr`` board target need +Applications for the ``nrf54lm20dk/nrf54lm20a/cpuflpr`` board target need to be built using sysbuild to include the ``vpr_launcher`` image for the application core. Enter the following command to compile ``hello_world`` for the FLPR core: .. code-block:: console - west build -p -b nrf54lm20dk/nrf54lm20b/cpuflpr --sysbuild + west build -p -b nrf54lm20dk/nrf54lm20a/cpuflpr --sysbuild Flashing @@ -98,33 +93,10 @@ Next, build the sample by running the following command: .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: nrf54lm20dk/nrf54lm20b/cpuapp + :board: nrf54lm20dk/nrf54lm20a/cpuapp :goals: build flash Testing the LEDs and buttons in the nRF54LM20 DK ************************************************ Test the nRF54LM20 DK with a :zephyr:code-sample:`blinky` sample. - - -.. _nrf54lm20dk_nrf54lm20a: - -nRF54LM20A emulation on nRF54LM20 DK -************************************ - -The ``nrf54lm20dk/nrf54lm20a`` board is a modified version of the :zephyr:board:`nrf54lm20dk` -that enforces the limitations imposed by the nRF54LM20A IC, which is the NPU-less variant -of the original nRF54LM20B IC. Since Nordic does not offer a development kit for the nRF54LM20A, -you can use this board to develop for this IC while using the nRF54LM20 Development Kit (PCA10184). - -See `nRF54LM20A website`_ for the official reference on the IC itself. - - -References -********** - -.. target-notes:: - -.. _nRF54LM20B website: https://www.nordicsemi.com/Products/nRF54LM20B -.. _nRF54L documentation: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/index.html -.. _nRF54LM20A website: https://www.nordicsemi.com/Products/nRF54LM20A diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 218812d7a654..ba83619c912e 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -69,9 +69,8 @@ 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_NRF54L15_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A NRF54LM20A_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_DEVELOP_IN_NRF54LM20B DEVELOP_IN_NRF54LM20B) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP NRF_APPLICATION) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A NRF54LM20A_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA NRF7120_ENGA_XXAA) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 6e75c6b4df80..7c98bf3affd3 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -107,11 +107,4 @@ config SOC_NRF54L_ANOMALY_56_WORKAROUND help This option enables configuration workaround 56 for nRF54L Series SoCs. -config SOC_NRF54LM20A_DEVELOP_IN_NRF54LM20B - bool - help - The nrf54lm20dk board can be used to develop the nRF54LM20A or nRF54LM20B SoCs - onto the nRF54LM20B DK. This symbol needs to be considered by certain system - initialization functionality residing in SoC erratas. - endif # SOC_SERIES_NRF54L From 4a63214d5f514d1489957c12da3aeeae89d37373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:41 +0200 Subject: [PATCH 2682/3334] Revert "[nrf fromtree] net: lib: ftp_client: Add FTP client library" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5d1aff98716147f02e0e28c5bc541ba321f71310. Signed-off-by: Andrzej Głąbek --- .../networking/api/ftp_client.rst | 39 - doc/connectivity/networking/api/protocols.rst | 1 - include/zephyr/net/ftp_client.h | 486 ------- subsys/net/lib/CMakeLists.txt | 1 - subsys/net/lib/Kconfig | 2 - subsys/net/lib/ftp/CMakeLists.txt | 7 - subsys/net/lib/ftp/Kconfig | 44 - subsys/net/lib/ftp/ftp_client.c | 1294 ----------------- subsys/net/lib/ftp/ftp_commands.h | 105 -- 9 files changed, 1979 deletions(-) delete mode 100644 doc/connectivity/networking/api/ftp_client.rst delete mode 100644 include/zephyr/net/ftp_client.h delete mode 100644 subsys/net/lib/ftp/CMakeLists.txt delete mode 100644 subsys/net/lib/ftp/Kconfig delete mode 100644 subsys/net/lib/ftp/ftp_client.c delete mode 100644 subsys/net/lib/ftp/ftp_commands.h diff --git a/doc/connectivity/networking/api/ftp_client.rst b/doc/connectivity/networking/api/ftp_client.rst deleted file mode 100644 index a56d065b385c..000000000000 --- a/doc/connectivity/networking/api/ftp_client.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. _ftp_client_interface: - -FTP client -########## - -.. contents:: - :local: - :depth: 2 - -Overview -******** - -The FTP client library can be used to download or upload files to FTP server. - -The FTP client library reports FTP control message and download data with two separate callback -functions :c:member:`ftp_client.ctrl_callback` and :c:member:`ftp_client.data_callback`. -The library can be configured to automatically send KEEPALIVE message to the server through a timer -if :kconfig:option:`CONFIG_FTP_CLIENT_KEEPALIVE_TIME` is not zero. -The KEEPALIVE message is sent periodically at the completion of the time interval indicated by the -value of :kconfig:option:`CONFIG_FTP_CLIENT_KEEPALIVE_TIME`. - -Protocols -********* - -The library is implemented in accordance with the :rfc:`959` specification. - -Limitations -*********** - -The library implements only a minimal set of commands as of now. -However, new command support can be easily added. - -Due to the differences in the implementation of FTP servers, the library might need customization -to work with a specific server. - -API Reference -************* - -.. doxygengroup:: ftp_client diff --git a/doc/connectivity/networking/api/protocols.rst b/doc/connectivity/networking/api/protocols.rst index 9080e83bab5b..2714ba881268 100644 --- a/doc/connectivity/networking/api/protocols.rst +++ b/doc/connectivity/networking/api/protocols.rst @@ -10,7 +10,6 @@ Protocols coap coap_client coap_server - ftp_client http_client http_server lwm2m diff --git a/include/zephyr/net/ftp_client.h b/include/zephyr/net/ftp_client.h deleted file mode 100644 index c614761c310e..000000000000 --- a/include/zephyr/net/ftp_client.h +++ /dev/null @@ -1,486 +0,0 @@ -/* - * Copyright (c) 2020-2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** @file - * @brief FTP client library - */ - -#ifndef ZEPHYR_INCLUDE_NET_FTP_CLIENT_H_ -#define ZEPHYR_INCLUDE_NET_FTP_CLIENT_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @file - * @brief FTP client library - * @details Provide selected FTP client functionality - * @defgroup ftp_client FTP client library API - * @since 4.4 - * @version 0.1.0 - * @ingroup networking - * @{ - */ - -/** @cond INTERNAL_HIDDEN */ -#if defined(CONFIG_FTP_CLIENT) -#define FTP_BUFFER_SIZE CONFIG_FTP_CLIENT_BUF_SIZE -#else -#define FTP_BUFFER_SIZE 1 -#endif -/** @endcond */ - -/** - * @brief List of FTP server reply codes - * Reference RFC959 FTP Transfer Protocol - */ -enum ftp_reply_code { - /* 100 Series The requested action is being initiated, expect another - * reply before proceeding with a new command - */ - - /** Restart marker replay. In this case, the text is exact and not left - * to the particular implementation; it must read: MARK yyyy = mmmm - * where yyyy is User-process data stream marker, and mmmm server's - * equivalent marker (note the spaces between markers and "=") - */ - FTP_CODE_110_RESTART_MARKER_REPLAY = 110, - /** Service ready in nnn minutes */ - FTP_CODE_120_SERVICE_READY_IN_NNN_MINUTES = 120, - /** Data connection already open; transfer starting */ - FTP_CODE_125_DATA_CONN_ALREADY_OPEN = 125, - /** File status okay; about to open data connection */ - FTP_CODE_150_FILE_STATUS_OK = 150, - - /* 200 Series The requested action has been successfully completed */ - - /** Command OK*/ - FTP_CODE_200_OK = 200, - /** Command not implemented, superfluous at this site */ - FTP_CODE_202_NOT_IMPLEMENTED = 202, - /** System status, or system help reply */ - FTP_CODE_211_SYSTEM_STATUS = 211, - /** Directory status */ - FTP_CODE_212_DIR_STATUS = 212, - /** File status*/ - FTP_CODE_213_FILE_STATUS = 213, - /** Help message. Explains how to use the server or the meaning of a - * particular non-standard command. This reply is useful only to the - * human user - */ - FTP_CODE_214_HELP_MSG = 214, - /** NAME system type. Where NAME is an official system name from the - * registry kept by IANA. - */ - FTP_CODE_215_NAME_SYSTEM_TYPE = 215, - /** Service ready for new user */ - FTP_CODE_220_SERVICE_READY = 220, - /** Service closing control connection */ - FTP_CODE_221_SERVICE_CLOSING_CONN = 221, - /** Data connection open; no transfer in progress */ - FTP_CODE_225_DATA_CONN_OPEN = 225, - /** Closing data connection. Requested file action successful (for - * example, file transfer or file abort) - */ - FTP_CODE_226_CLOSING_DATA_CONN_SUCCESS = 226, - /** Entering Passive Mode (h1,h2,h3,h4,p1,p2) */ - FTP_CODE_227_ENTERING_PASSIVE_MODE = 227, - /** Entering Long Passive Mode (long address, port) */ - FTP_CODE_228_ENTERING_LONG_PASSIVE_MODE = 228, - /** Entering Extended Passive Mode (|||port|) */ - FTP_CODE_229_ENTERING_EXT_PASSIVE_MODE = 229, - /** User logged in, proceed. Logged out if appropriate */ - FTP_CODE_230_USER_LOGGED_IN = 230, - /** User logged out; service terminated */ - FTP_CODE_231_USER_LOGGED_OUT = 231, - /** Logout command noted, will complete when transfer done */ - FTP_CODE_233_LOGOUT_COMMAND_NOTED = 233, - /** Specifies that the server accepts the authentication mechanism - * specified by the client, and the exchange of security data is - * complete. A higher level nonstandard code created by Microsoft - */ - FTP_CODE_234_SECURITY_ACCEPTED = 234, - /** Requested file action okay, completed */ - FTP_CODE_250_FILE_ACTION_COMPLETED = 250, - /** "PATHNAME" created */ - FTP_CODE_257_PATHNAME_CREATED = 257, - - /* 300 Series The command has been accepted, but the requested action - *is on hold, pending receipt of further information - */ - - /** User name okay, need password */ - FTP_CODE_331_USERNAME_OK_NEED_PASSWORD = 331, - /** Need account for login */ - FTP_CODE_332_NEED_ACCOUNT = 332, - /** Requested file action pending further information */ - FTP_CODE_350_FILE_ACTION_PENDING = 350, - - /* 400 Series The command was not accepted and the requested action - * did not take place, but the error condition is temporary and the - * action may be requested again - */ - - /** Service not available, closing control connection. This may be a - * reply to any command if the service knows it must shut down - */ - FTP_CODE_421_SERVICE_UNAVAILABLE = 421, - /** Cannot open data connection */ - FTP_CODE_425_CANNOT_OPEN_DATA_CONN = 425, - /** Connection closed; transfer aborted */ - FTP_CODE_426_CONN_CLOSED = 426, - /** Invalid username or password */ - FTP_CODE_430_INVALID_USERNAME_OR_PASSWORD = 430, - /** Requested host unavailable */ - FTP_CODE_434_HOST_UNAVAILABLE = 434, - /** Requested file action not taken */ - FTP_CODE_450_FILE_ACTION_NOT_TAKEN = 450, - /** Requested action aborted. Local error in processing */ - FTP_CODE_451_ACTION_ABORTED = 451, - /** Requested action not taken. Insufficient storage space in system. - * File unavailable (for example, file busy) - */ - FTP_CODE_452_ACTION_NOT_TAKEN = 452, - - /* 500 Series Syntax error, command unrecognized and the requested - * action did not take place. This may include errors such as command - * line too long - */ - - /** General error */ - FTP_CODE_500_GENERAL_ERROR = 500, - /** Syntax error in parameters or arguments */ - FTP_CODE_501_SYNTAX_ERROR = 501, - /** Command not implemented */ - FTP_CODE_502_COMMAND_NOT_COMPLETED = 502, - /** Bad sequence of commands */ - FTP_CODE_503_BAD_SEQUENCE_OF_COMMANDS = 503, - /** Command not implemented for that parameter */ - FTP_CODE_504_COMMAND_NOT_IMPLEMENTED = 504, - /** Not logged in */ - FTP_CODE_530_NOT_LOGGED_IN = 530, - /** Need account for storing files */ - FTP_CODE_532_NEED_ACCOUNT = 532, - /** Could Not Connect to Server - Policy Requires SSL */ - FTP_CODE_534_CANNOT_CONNECT_SSL_REQUIRED = 534, - /** Requested action not taken. File unavailable (for example, file not - * found, no access) - */ - FTP_CODE_550_FILE_UNAVAILABLE = 550, - /** Requested action aborted. Page type unknown */ - FTP_CODE_551_PAGE_TYPE_UNKNOWN = 551, - /** Requested file action aborted. Exceeded storage allocation (for - * current directory or dataset) - */ - FTP_CODE_552_FILE_EXCEEDED_STORAGE_LOCATION = 552, - /** Requested action not taken. File name not allowed */ - FTP_CODE_553_FILE_NAME_NOT_ALLOWED = 553, - - /* Replies regarding confidentiality and integrity */ - - /** Integrity protected reply */ - FTP_CODE_631_INTEGRITY_PROTECTED_REPLY = 631, - /** Confidentiality and integrity protected reply */ - FTP_CODE_632_INT_AND_CONF_PROTECTED_REPLY = 632, - /** Confidentiality protected reply */ - FTP_CODE_633_CONFIDENTIALITY_PROTECTED_REPLY = 633, - - /* Proprietary reply codes */ - - /** DUMMY */ - FTP_CODE_900_UNKNOWN_ERROR = 900, - - /** Fatal errors */ - /** Disconnected by remote server */ - FTP_CODE_901_DISCONNECTED_BY_REMOTE = 901, - /** Connection aborted */ - FTP_CODE_902_CONNECTION_ABORTED = 902, - /** Socket poll error */ - FTP_CODE_903_SOCKET_POLL_ERROR = 903, - /** Unexpected poll event */ - FTP_CODE_904_UNEXPECTED_POLL_EVENT = 904, - /** Network down */ - FTP_CODE_905_NETWORK_DOWN = 905, - /** Unexpected error */ - FTP_CODE_909_UNEXPECTED_ERROR = 909, - - /* Non-fatal errors */ - /** Data transfer timeout */ - FTP_CODE_910_DATA_TRANSFER_TIMEOUT = 910, - - /* 10000 Series Common Winsock Error Codes[2] (These are not FTP - * return codes) - */ - - /** Connection reset by peer. The connection was forcibly closed by the - * remote host - */ - FTP_CODE_10054_CONNECTION_RESET_BY_PEER = 10054, - /** Cannot connect to remote server */ - FTP_CODE_10060_CANNOT_CONNECT = 10060, - /** Cannot connect to remote server. The connection is actively refused - * by the server - */ - FTP_CODE_10061_CONNECTION_REFUSED = 10061, - /** Directory not empty */ - FTP_CODE_10066_DIRECTORY_NOT_EMPTY = 10066, - /** Too many users, server is full */ - FTP_CODE_10068_TOO_MANY_USERS = 10068 -}; - -/** @cond INTERNAL_HIDDEN */ -#define FTP_PRELIMINARY_POS(code) ((code) >= 100 && (code) < 200) -#define FTP_COMPLETION_POS(code) ((code) >= 200 && (code) < 300) -#define FTP_INTERMEDIATE_POS(code) ((code) >= 300 && (code) < 400) -#define FTP_TRANSIENT_NEG(code) ((code) >= 400 && (code) < 500) -#define FTP_COMPLETION_NEG(code) ((code) >= 500 && (code) < 600) -#define FTP_PROTECTED(code) ((code) >= 600 && (code) < 700) -#define FTP_PROPRIETARY(code) ((code) >= 900 && (code) < 1000) -#define FTP_WINSOCK_ERR(code) ((code) >= 10000) -/** @endcond */ - -/** FTP transfer mode. */ -enum ftp_transfer_type { - FTP_TYPE_ASCII, /**< ASCII transfer */ - FTP_TYPE_BINARY, /**< Binary transfer */ -}; - -/** FTP file write mode. */ -enum ftp_put_type { - FTP_PUT_NORMAL, /**< Overwrite a file */ - FTP_PUT_UNIQUE, /**< Write to a file with a unique file name */ - FTP_PUT_APPEND, /**< Append a file */ -}; - -/** - * @brief FTP asynchronous callback function. - * - * @param msg FTP client data received, or local message - * @param len length of message - */ -typedef void (*ftp_client_callback_t)(const uint8_t *msg, uint16_t len); - -/** FTP client context. */ -struct ftp_client { - struct net_sockaddr remote; /**< Server address */ - bool connected; /**< Server connected flag */ - int ctrl_sock; /**< Control socket */ - int data_sock; /**< Data socket */ - int sec_tag; /**< Secure tag */ - uint8_t ctrl_buf[FTP_BUFFER_SIZE]; /**< Control buffer */ - size_t ctrl_len; /**< Length of data in the control buffer */ - uint8_t data_buf[FTP_BUFFER_SIZE]; /**< Data buffer */ - ftp_client_callback_t ctrl_callback; /**< Control callback */ - ftp_client_callback_t data_callback; /**< Data callback */ - /** @cond INTERNAL_HIDDEN */ - struct k_mutex lock; - struct k_work_delayable keepalive_work; - /** @endcond */ -}; - -/**@brief Initialize the FTP client context. - * - * @param client FTP client context - * @param ctrl_callback Callback for FTP command result. - * @param data_callback Callback for FTP received data. - * - * @return 0 on success. A negative errno code in case of a failure. - */ -int ftp_init(struct ftp_client *client, ftp_client_callback_t ctrl_callback, - ftp_client_callback_t data_callback); - -/**@brief Uninitialize the FTP client context. - * - * @param client FTP client context - * - * @return 0 on success. A negative errno code in case of a failure. - */ -int ftp_uninit(struct ftp_client *client); - -/**@brief Open FTP connection. - * - * @param client FTP client context - * @param hostname FTP server name or IP address - * @param port FTP service port on server - * @param sec_tag If FTP over TLS is required (-1 means no TLS) - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_open(struct ftp_client *client, const char *hostname, uint16_t port, - int sec_tag); - -/**@brief FTP server login. - * - * @param client FTP client context - * @param username user name - * @param password The password - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_login(struct ftp_client *client, const char *username, - const char *password); - -/**@brief Close FTP connection. - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_close(struct ftp_client *client); - -/**@brief Get FTP server and connection status - * Also returns server system type - * - * @param client FTP client context - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_status(struct ftp_client *client); - -/**@brief Set FTP transfer type - * - * @param client FTP client context - * @param type transfer type - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_type(struct ftp_client *client, enum ftp_transfer_type type); - -/**@brief Print working directory - * - * @param client FTP client context - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_pwd(struct ftp_client *client); - -/**@brief List information of folder or file - * - * @param client FTP client context - * @param options List options, refer to Linux "man ls" - * @param target file or directory to list. If not specified, list current folder - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_list(struct ftp_client *client, const char *options, const char *target); - -/**@brief Change working directory - * - * @param client FTP client context - * @param folder Target folder - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_cwd(struct ftp_client *client, const char *folder); - -/**@brief Make directory - * - * @param client FTP client context - * @param folder New folder name - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_mkd(struct ftp_client *client, const char *folder); - -/**@brief Remove directory - * - * @param client FTP client context - * @param folder Target folder name - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_rmd(struct ftp_client *client, const char *folder); - -/**@brief Rename a file - * - * @param client FTP client context - * @param old_name Old file name - * @param new_name New file name - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_rename(struct ftp_client *client, const char *old_name, - const char *new_name); - -/**@brief Delete a file - * - * @param client FTP client context - * @param file Target file name - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_delete(struct ftp_client *client, const char *file); - -/**@brief Get a file - * - * @param client FTP client context - * @param file Target file name - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_get(struct ftp_client *client, const char *file); - -/**@brief Put data to a file - * If file does not exist, create the file - * - * @param client FTP client context - * @param file Target file name - * @param data Data to be stored - * @param length Length of data to be stored - * @param type specify FTP put types, see enum ftp_reply_code - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_put(struct ftp_client *client, const char *file, const uint8_t *data, - uint16_t length, int type); - -/**@brief Exchange keep-alive commands with the server. - * - * @param client FTP client context - * - * @return 0 on success. - * A negative errno code in case of a failure. - * A positive FTP status code in case of an unexpected server response. - */ -int ftp_keepalive(struct ftp_client *client); - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_NET_FTP_CLIENT_H_ */ - -/**@} */ diff --git a/subsys/net/lib/CMakeLists.txt b/subsys/net/lib/CMakeLists.txt index 1832a21ce314..60a448147eb9 100644 --- a/subsys/net/lib/CMakeLists.txt +++ b/subsys/net/lib/CMakeLists.txt @@ -2,7 +2,6 @@ add_subdirectory(utils) add_subdirectory_ifdef(CONFIG_COAP coap) -add_subdirectory_ifdef(CONFIG_FTP_CLIENT ftp) add_subdirectory_ifdef(CONFIG_LWM2M lwm2m) add_subdirectory_ifdef(CONFIG_SOCKS socks) add_subdirectory_ifdef(CONFIG_SNTP sntp) diff --git a/subsys/net/lib/Kconfig b/subsys/net/lib/Kconfig index 9134b140f87f..4249ca650f75 100644 --- a/subsys/net/lib/Kconfig +++ b/subsys/net/lib/Kconfig @@ -7,8 +7,6 @@ source "subsys/net/lib/coap/Kconfig" source "subsys/net/lib/dns/Kconfig" -source "subsys/net/lib/ftp/Kconfig" - source "subsys/net/lib/latmon/Kconfig" source "subsys/net/lib/midi2/Kconfig" diff --git a/subsys/net/lib/ftp/CMakeLists.txt b/subsys/net/lib/ftp/CMakeLists.txt deleted file mode 100644 index b8212357f804..000000000000 --- a/subsys/net/lib/ftp/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright (c) 2020-2026 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# -zephyr_library() -zephyr_library_sources(ftp_client.c) diff --git a/subsys/net/lib/ftp/Kconfig b/subsys/net/lib/ftp/Kconfig deleted file mode 100644 index 2294318dca2c..000000000000 --- a/subsys/net/lib/ftp/Kconfig +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright (c) 2020-2026 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -menuconfig FTP_CLIENT - bool "FTP client [EXPERIMENTAL]" - depends on NET_TCP - depends on NET_SOCKETS - select EXPERIMENTAL - help - Enable FTP client library compliant with RFC959 File Transfer Protocol. - -if FTP_CLIENT - -config FTP_CLIENT_KEEPALIVE_TIME - int "Keep-alive time in seconds after connection" - range 0 $(UINT32_MAX) - default 60 - help - Define the automatic keep-alive time (in seconds) for the FTP client. - Set to 0 to disable automatic keep-alive (which allows to save - resources needed for the dedicated work queue). If disabled, it's - still possible to perform keep-alive exchanges from the application - level with ftp_keepalive() function. - -config FTP_CLIENT_LISTEN_TIME - int "Poll time in seconds in receiving FTP message" - default 10 - help - Define the wait time for receiving. - -config FTP_CLIENT_BUF_SIZE - int "Buffer size used by FTP client" - range 128 $(UINT16_MAX) - default 1024 - -module=FTP_CLIENT -module-dep=LOG -module-str=FTP client -source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" - -endif # FTP_CLIENT diff --git a/subsys/net/lib/ftp/ftp_client.c b/subsys/net/lib/ftp/ftp_client.c deleted file mode 100644 index ec4044341ffd..000000000000 --- a/subsys/net/lib/ftp/ftp_client.c +++ /dev/null @@ -1,1294 +0,0 @@ -/* - * Copyright (c) 2020-2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ftp_commands.h" - -LOG_MODULE_REGISTER(ftp_client, CONFIG_FTP_CLIENT_LOG_LEVEL); - -#define INVALID_SOCKET -1 -#define FTP_CLIENT_POLL_TIMEOUT_MSEC (MSEC_PER_SEC * CONFIG_FTP_CLIENT_LISTEN_TIME) -#define FTP_CODE_ANY 0 - -/* FTP parameter length limits */ -#define FTP_MAX_USERNAME 64 /* Unix/Linux username typical limit */ -#define FTP_MAX_PASSWORD 255 /* Allow longer passwords */ -#define FTP_MAX_FILENAME 255 /* Filename length limit */ -#define FTP_MAX_PATHNAME 255 /* Standard NAME_MAX */ -#define FTP_MAX_OPTIONS 32 /* FTP LIST options are typically short */ - -#if CONFIG_FTP_CLIENT_KEEPALIVE_TIME > 0 -#define FTP_STACK_SIZE KB(2) -#define FTP_PRIORITY K_LOWEST_APPLICATION_THREAD_PRIO -static K_THREAD_STACK_DEFINE(ftp_stack_area, FTP_STACK_SIZE); - -static struct k_work_q ftp_work_q; -#endif - -enum ftp_channel_type { - FTP_CHANNEL_CTRL, - FTP_CHANNEL_DATA, -}; - -#if CONFIG_FTP_CLIENT_KEEPALIVE_TIME > 0 -static void keepalive_timer_reset(struct ftp_client *client) -{ - k_work_reschedule_for_queue(&ftp_work_q, &client->keepalive_work, - K_SECONDS(CONFIG_FTP_CLIENT_KEEPALIVE_TIME)); -} - -static void keepalive_timer_cancel(struct ftp_client *client) -{ - struct k_work_sync sync; - - k_work_cancel_delayable_sync(&client->keepalive_work, &sync); -} - -static void keepalive_handler(struct k_work *work) -{ - struct k_work_delayable *delayable = k_work_delayable_from_work(work); - struct ftp_client *client = CONTAINER_OF(delayable, struct ftp_client, keepalive_work); - - if (client->ctrl_sock == INVALID_SOCKET) { - return; - } - - (void)ftp_keepalive(client); - - keepalive_timer_reset(client); -} -#else -static void keepalive_timer_reset(struct ftp_client *client) { } -static void keepalive_timer_cancel(struct ftp_client *client) { } -#endif - -static int new_ftp_connection(struct ftp_client *client, enum ftp_channel_type channel, - uint16_t port) -{ - int proto = client->sec_tag <= 0 ? NET_IPPROTO_TCP : NET_IPPROTO_TLS_1_2; - socklen_t addrlen; - int *sock; - int ret; - - if (channel == FTP_CHANNEL_CTRL) { - sock = &client->ctrl_sock; - } else if (channel == FTP_CHANNEL_DATA) { - sock = &client->data_sock; - } else { - return -EINVAL; - } - - *sock = zsock_socket(client->remote.sa_family, NET_SOCK_STREAM, proto); - if (*sock < 0) { - ret = -errno; - LOG_ERR("socket(data) failed: %d", ret); - return ret; - } - if (client->sec_tag != SEC_TAG_TLS_INVALID) { - sec_tag_t sec_tag_list[] = { client->sec_tag }; - - ret = zsock_setsockopt(*sock, ZSOCK_SOL_TLS, ZSOCK_TLS_SEC_TAG_LIST, - sec_tag_list, sizeof(sec_tag_t)); - if (ret < 0) { - ret = -errno; - LOG_ERR("set tag list failed: %d", ret); - zsock_close(*sock); - *sock = INVALID_SOCKET; - return ret; - } - } - - /* Connect to remote host */ - if (client->remote.sa_family == NET_AF_INET) { - net_sin(&client->remote)->sin_port = net_htons(port); - addrlen = sizeof(struct net_sockaddr_in); - } else { - net_sin6(&client->remote)->sin6_port = net_htons(port); - addrlen = sizeof(struct net_sockaddr_in6); - } - - ret = zsock_connect(*sock, &client->remote, addrlen); - if (ret < 0) { - ret = -errno; - LOG_ERR("connect(data) failed: %d", ret); - zsock_close(*sock); - *sock = INVALID_SOCKET; - return ret; - } - - return ret; -} - -static int validate_ftp_param(const char *param, size_t max_len) -{ - if (param == NULL) { - return -EINVAL; - } - - if (strlen(param) > max_len) { - return -EINVAL; - } - - /* Check for FTP command injection - CR/LF can inject additional commands */ - if (strchr(param, '\r') || strchr(param, '\n')) { - return -EINVAL; - } - - return 0; -} - -static int parse_pasv_msg(const char *pasv_msg, uint16_t *data_port) -{ - char *endptr; - long port_byte; - char *tmp1, *tmp2; - - /* Parse Server port from passive message - * e.g. "227 Entering Passive Mode (90,130,70,73,86,111)" in case of IPv4 - * e.g. "227 Entering Passive Mode (0,0,0,0,97,78)" in case of IPv6 - * NOTE assume no IP address change from the Control channel - */ - tmp1 = strrchr(pasv_msg, ')'); - if (tmp1 == NULL) { - return -EINVAL; - } - tmp2 = strrchr(pasv_msg, ','); - if (tmp2 == NULL) { - return -EINVAL; - } - /* Validate that ')' appears after the last ',' */ - if (tmp1 <= tmp2) { - return -EINVAL; - } - - /* Extract low byte of port (p2) */ - port_byte = strtol(tmp2 + 1, &endptr, 10); - if (endptr != tmp1 || port_byte < 0 || port_byte > 255) { - return -EINVAL; - } - *data_port = (uint16_t)port_byte; - - /* Find previous comma for high byte */ - tmp1 = tmp2 - 1; - while (tmp1 > pasv_msg && isdigit((int)(*tmp1))) { - tmp1--; - } - if (tmp1 <= pasv_msg || *tmp1 != ',') { - return -EINVAL; - } - - /* Extract high byte of port (p1) */ - port_byte = strtol(tmp1 + 1, &endptr, 10); - if (endptr != tmp2 || port_byte < 0 || port_byte > 255) { - return -EINVAL; - } - *data_port += (uint16_t)(port_byte << 8); - LOG_DBG("data port: %d", *data_port); - - return 0; -} - -static void close_connection(struct ftp_client *client, int code, int error) -{ - keepalive_timer_cancel(client); - - if (FTP_PROPRIETARY(code) != 0) { - switch (code) { - case FTP_CODE_901_DISCONNECTED_BY_REMOTE: - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - "901 Disconnected(%d).\r\n", error); - break; - case FTP_CODE_902_CONNECTION_ABORTED: - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - "902 Connection aborted(%d).\r\n", error); - break; - case FTP_CODE_903_SOCKET_POLL_ERROR: - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - "903 Poll error(%d).\r\n", error); - break; - case FTP_CODE_904_UNEXPECTED_POLL_EVENT: - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - "904 Unexpected poll event(%d).\r\n", error); - break; - case FTP_CODE_905_NETWORK_DOWN: - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - "905 Network down (%d).\r\n", error); - break; - default: - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - "900 Unknown error(%d).\r\n", -ENOEXEC); - break; - } - client->ctrl_callback(client->ctrl_buf, strlen(client->ctrl_buf)); - } - /* Should be impossible, just in case */ - if (client->data_sock != INVALID_SOCKET) { - zsock_close(client->data_sock); - client->data_sock = INVALID_SOCKET; - } - - if (client->ctrl_sock != INVALID_SOCKET) { - zsock_close(client->ctrl_sock); - client->ctrl_sock = INVALID_SOCKET; - client->connected = false; - client->sec_tag = SEC_TAG_TLS_INVALID; - } -} - -static int do_ftp_send_ctrl(struct ftp_client *client, const uint8_t *message, int length) -{ - int ret = 0; - uint32_t offset = 0; - - LOG_DBG("%s", (char *)message); - while (offset < length) { - ret = zsock_send(client->ctrl_sock, message + offset, length - offset, 0); - if (ret < 0) { - ret = -errno; - LOG_ERR("send cmd failed: %d", ret); - break; - } - offset += ret; - ret = 0; - } - /* Close connection on errors */ - if (ret < 0) { - close_connection(client, ret == -ENETDOWN ? FTP_CODE_905_NETWORK_DOWN : - FTP_CODE_909_UNEXPECTED_ERROR, ret); - } else { - LOG_DBG("CMD sent"); - } - - keepalive_timer_reset(client); - - return ret; -} - -static int handle_ctrl_response(struct ftp_client *client, bool post_result, int success_code) -{ - bool done = false; - int reply_code = 0; - - if (client->ctrl_len > sizeof(client->ctrl_buf) - 1) { - /* Shouldn't happen, but make sure we don't operate out of buffer. */ - return -EINVAL; - } - - while (client->ctrl_len > 0 && !done) { - size_t line_len; - uint8_t backup; - uint8_t *eol; - - /* Make sure buffer is NULL terminated so we can operate as with string. */ - client->ctrl_buf[client->ctrl_len] = 0x00; - - eol = strstr(client->ctrl_buf, "\r\n"); - if (eol == NULL) { - /* No end line detected, need to read more data from the socket. */ - return -EAGAIN; - } - eol += 2; - - line_len = eol - client->ctrl_buf; - - /* Status line starts with a status code followed by space */ - if (line_len >= 4 && isdigit(client->ctrl_buf[0])) { - char *endptr = NULL; - - reply_code = strtol(client->ctrl_buf, &endptr, 10); - /* Strict parsing of "%d ". */ - if (reply_code > 0 && endptr != NULL && *endptr == ' ' && - (reply_code == success_code || reply_code >= 400 || - success_code == FTP_CODE_ANY)) { - /* Stop if got expected code, no specific code was - * expected or received an error response (400+) - */ - done = true; - } - } - - /* Report NULL terminated line. */ - backup = *eol; - *eol = 0x00; - - if (post_result) { - client->ctrl_callback(client->ctrl_buf, line_len); - } - - LOG_DBG("%s", client->ctrl_buf); - - *eol = backup; - - client->ctrl_len -= line_len; - if (client->ctrl_len > 0) { - memmove(client->ctrl_buf, client->ctrl_buf + line_len, client->ctrl_len); - } - } - - return reply_code; -} - -static int recv_ctrl_response(struct ftp_client *client, enum ftp_reply_code *err_code) -{ - struct zsock_pollfd fds[1]; - int ret; - - fds[0].fd = client->ctrl_sock; - fds[0].events = ZSOCK_POLLIN; - - ret = zsock_poll(fds, 1, FTP_CLIENT_POLL_TIMEOUT_MSEC); - if (ret < 0) { - ret = -errno; - *err_code = FTP_CODE_903_SOCKET_POLL_ERROR; - LOG_ERR("poll(ctrl) failed: (%d)", ret); - goto out; - } - - if (ret == 0) { - ret = -ETIMEDOUT; - *err_code = FTP_CODE_903_SOCKET_POLL_ERROR; - LOG_DBG("poll(ctrl) timeout"); - goto out; - } - - if ((fds[0].revents & ZSOCK_POLLHUP) == ZSOCK_POLLHUP) { - ret = -ECONNRESET; - *err_code = FTP_CODE_901_DISCONNECTED_BY_REMOTE; - LOG_ERR("POLLHUP"); - goto out; - } - - if ((fds[0].revents & ZSOCK_POLLIN) != ZSOCK_POLLIN) { - ret = -EIO; - *err_code = FTP_CODE_904_UNEXPECTED_POLL_EVENT; - LOG_ERR("POLL 0x%08x", fds[0].revents); - goto out; - } - - ret = zsock_recv(client->ctrl_sock, client->ctrl_buf + client->ctrl_len, - sizeof(client->ctrl_buf) - client->ctrl_len - 1, 0); - if (ret < 0) { - ret = -errno; - *err_code = ret == -ENETDOWN ? FTP_CODE_905_NETWORK_DOWN : - FTP_CODE_909_UNEXPECTED_ERROR; - LOG_ERR("recv(ctrl) failed: (%d)", ret); - goto out; - } - - if (ret == 0) { - ret = -ECONNRESET; - *err_code = FTP_CODE_901_DISCONNECTED_BY_REMOTE; - LOG_ERR("recv(ctrl) peer closed connection"); - } - -out: - return ret; -} - -static int do_ftp_recv_ctrl(struct ftp_client *client, bool post_result, int success_code) -{ - enum ftp_reply_code err_code = FTP_CODE_500_GENERAL_ERROR; - int ret; - - while (true) { - /* Receive FTP control message */ - ret = recv_ctrl_response(client, &err_code); - if (ret <= 0) { - goto error; - } - - keepalive_timer_reset(client); - - client->ctrl_len += ret; - - ret = handle_ctrl_response(client, post_result, success_code); - if (ret != -EAGAIN) { - break; - } - - if (client->ctrl_len >= sizeof(client->ctrl_buf) - 1) { - ret = -ENOMEM; - err_code = FTP_CODE_909_UNEXPECTED_ERROR; - LOG_ERR("recv(ctrl) buffer full"); - goto error; - } - } - - return ret; - -error: - close_connection(client, err_code, ret); - - return ret; -} - -static int set_passive_mode(struct ftp_client *client, uint16_t *data_port) -{ - int ret; - - ret = do_ftp_send_ctrl(client, CMD_PASV, sizeof(CMD_PASV) - 1); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_227_ENTERING_PASSIVE_MODE); - if (ret != FTP_CODE_227_ENTERING_PASSIVE_MODE) { - goto out; - } - - ret = parse_pasv_msg(client->ctrl_buf, data_port); - if (ret != 0) { - goto out; - } - -out: - return ret; -} - -static int wait_transfer_complete(struct ftp_client *client) -{ - int ret; - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_226_CLOSING_DATA_CONN_SUCCESS); - if (ret == FTP_CODE_226_CLOSING_DATA_CONN_SUCCESS) { - ret = 0; - } - - return ret; -} - -static int do_ftp_send_data(struct ftp_client *client, uint16_t data_port, - const uint8_t *message, uint16_t length) -{ - int ret; - uint32_t offset = 0; - - /* Establish data channel */ - ret = new_ftp_connection(client, FTP_CHANNEL_DATA, data_port); - if (ret < 0) { - return ret; - } - - if (message == NULL || length == 0) { - goto out; - } - - while (offset < length) { - ret = zsock_send(client->data_sock, message + offset, length - offset, 0); - if (ret < 0) { - ret = -errno; - LOG_ERR("send data failed: %d", ret); - break; - } - LOG_DBG("DATA sent %d", ret); - offset += ret; - ret = 0; - } - -out: - zsock_close(client->data_sock); - client->data_sock = INVALID_SOCKET; - - if (ret == 0) { - ret = wait_transfer_complete(client); - } - - keepalive_timer_reset(client); - - return ret; -} - -static int do_ftp_recv_data(struct ftp_client *client, uint16_t data_port) -{ - int ret; - struct zsock_pollfd fds[1]; - - /* Establish data channel */ - ret = new_ftp_connection(client, FTP_CHANNEL_DATA, data_port); - if (ret < 0) { - return ret; - } - - /* Receive FTP data message */ - fds[0].fd = client->data_sock; - fds[0].events = ZSOCK_POLLIN; - do { - ret = zsock_poll(fds, 1, FTP_CLIENT_POLL_TIMEOUT_MSEC); - if (ret < 0) { - ret = -errno; - LOG_ERR("poll(data) failed: (%d)", ret); - break; - } - - if (ret == 0) { - ret = -ETIMEDOUT; - LOG_DBG("poll(data) timeout"); - break; - } - - if ((fds[0].revents & ZSOCK_POLLIN) != ZSOCK_POLLIN) { - LOG_DBG("No more data"); - ret = 0; - break; - } - - ret = zsock_recv(client->data_sock, client->data_buf, - sizeof(client->data_buf), 0); - if (ret < 0) { - ret = -errno; - LOG_ERR("recv(data) failed: (%d)", ret); - break; - } - - if (ret == 0) { - /* Server close connection */ - break; - } - - client->data_callback(client->data_buf, ret); - LOG_DBG("DATA received %d", ret); - } while (true); - - zsock_close(client->data_sock); - client->data_sock = INVALID_SOCKET; - - if (ret == 0) { - ret = wait_transfer_complete(client); - } - - keepalive_timer_reset(client); - - return ret; -} - -int ftp_open(struct ftp_client *client, const char *hostname, uint16_t port, int sec_tag) -{ - int ret; - struct zsock_addrinfo *ai; - - if (client == NULL) { - return -EINVAL; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - if (client->connected) { - LOG_ERR("FTP already connected"); - ret = -EINVAL; - goto out; - } - - /* Resolve the hostname in the preferred IP version .*/ - ret = zsock_getaddrinfo(hostname, NULL, NULL, &ai); - if (ret != 0) { - LOG_ERR("Failed to resolve hostname (\"%s\"): %s", - hostname, zsock_gai_strerror(ret)); - ret = -EHOSTUNREACH; - goto out; - } - - memcpy(&client->remote, ai->ai_addr, ai->ai_addrlen); - zsock_freeaddrinfo(ai); - - client->sec_tag = sec_tag; - - /* open control socket */ - ret = new_ftp_connection(client, FTP_CHANNEL_CTRL, port); - if (ret != 0) { - goto out; - } - - /* Receive server greeting */ - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_220_SERVICE_READY); - if (ret != FTP_CODE_220_SERVICE_READY) { - zsock_close(client->ctrl_sock); - client->ctrl_sock = INVALID_SOCKET; - goto out; - } - - /* Send UTF8 option */ - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_OPTS, "UTF8 ON"); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - zsock_close(client->ctrl_sock); - client->ctrl_sock = INVALID_SOCKET; - goto out; - } - - (void)do_ftp_recv_ctrl(client, true, FTP_CODE_ANY); - - LOG_DBG("FTP opened"); - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_login(struct ftp_client *client, const char *username, const char *password) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - /* Validate inputs */ - ret = validate_ftp_param(username, FTP_MAX_USERNAME); - if (ret != 0) { - return ret; - } - - ret = validate_ftp_param(password, FTP_MAX_PASSWORD); - if (ret != 0) { - return ret; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - /* send username */ - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_USER, username); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_331_USERNAME_OK_NEED_PASSWORD); - if (ret == FTP_CODE_331_USERNAME_OK_NEED_PASSWORD) { - /* send password if requested */ - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_PASS, password); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_230_USER_LOGGED_IN); - } - - if (ret != FTP_CODE_230_USER_LOGGED_IN) { - goto out; - } - - client->connected = true; - ret = 0; - - /* Start keep alive timer */ - keepalive_timer_reset(client); - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_close(struct ftp_client *client) -{ - int ret = 0; - - if (client == NULL) { - return -EINVAL; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - if (client->connected) { - ret = do_ftp_send_ctrl(client, CMD_QUIT, sizeof(CMD_QUIT) - 1); - if (ret != 0) { - goto out; - } - - /* Some FTP servers do not reply QUIT */ - (void)do_ftp_recv_ctrl(client, true, FTP_CODE_221_SERVICE_CLOSING_CONN); - } - - close_connection(client, FTP_CODE_200_OK, 0); - - client->connected = false; - ret = 0; - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_status(struct ftp_client *client) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - /* get server system type */ - ret = do_ftp_send_ctrl(client, CMD_SYST, sizeof(CMD_SYST) - 1); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_215_NAME_SYSTEM_TYPE); - if (ret != FTP_CODE_215_NAME_SYSTEM_TYPE) { - goto out; - } - - /* get server and connection status */ - ret = do_ftp_send_ctrl(client, CMD_STAT, sizeof(CMD_STAT) - 1); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_211_SYSTEM_STATUS); - if (ret != FTP_CODE_211_SYSTEM_STATUS) { - goto out; - } - - ret = 0; - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_type(struct ftp_client *client, enum ftp_transfer_type type) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - if (type == FTP_TYPE_ASCII) { - ret = do_ftp_send_ctrl(client, CMD_TYPE_A, sizeof(CMD_TYPE_A) - 1); - } else if (type == FTP_TYPE_BINARY) { - ret = do_ftp_send_ctrl(client, CMD_TYPE_I, sizeof(CMD_TYPE_I) - 1); - } else { - ret = -EINVAL; - } - - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_200_OK); - if (ret != FTP_CODE_200_OK) { - goto out; - } - - ret = 0; - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_pwd(struct ftp_client *client) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - ret = do_ftp_send_ctrl(client, CMD_PWD, sizeof(CMD_PWD) - 1); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_257_PATHNAME_CREATED); - if (ret != FTP_CODE_257_PATHNAME_CREATED) { - goto out; - } - - ret = 0; - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_list(struct ftp_client *client, const char *options, const char *target) -{ - int ret; - uint16_t data_port; - - if (client == NULL) { - return -EINVAL; - } - - /* Validate inputs */ - ret = validate_ftp_param(options, FTP_MAX_OPTIONS); - if (ret != 0) { - return ret; - } - - ret = validate_ftp_param(target, FTP_MAX_PATHNAME); - if (ret != 0) { - return ret; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - /* Always set Passive mode to act as TCP client */ - ret = set_passive_mode(client, &data_port); - if (ret != 0) { - goto out; - } - - /* Send LIST/NLST command in control channel */ - if (strlen(options) != 0) { - if (strlen(target) != 0) { - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - CMD_LIST_OPT_FILE, options, target); - } else { - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - CMD_LIST_OPT, options); - } - } else { - if (strlen(target) != 0) { - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), - CMD_LIST_FILE, target); - } else { - strcpy(client->ctrl_buf, CMD_NLST); - } - } - - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - /* Wait for file status ok reply from the server. */ - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_150_FILE_STATUS_OK); - if (ret != FTP_CODE_150_FILE_STATUS_OK) { - goto out; - } - - ret = do_ftp_recv_data(client, data_port); - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_cwd(struct ftp_client *client, const char *folder) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - /* Validate input */ - ret = validate_ftp_param(folder, FTP_MAX_PATHNAME); - if (ret != 0) { - return ret; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - if (strcmp(folder, "..") == 0) { - ret = do_ftp_send_ctrl(client, CMD_CDUP, sizeof(CMD_CDUP) - 1); - } else { - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_CWD, folder); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - } - - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_250_FILE_ACTION_COMPLETED); - if (ret != FTP_CODE_250_FILE_ACTION_COMPLETED) { - goto out; - } - - ret = 0; - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_mkd(struct ftp_client *client, const char *folder) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - /* Validate input */ - ret = validate_ftp_param(folder, FTP_MAX_PATHNAME); - if (ret != 0) { - return ret; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_MKD, folder); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_257_PATHNAME_CREATED); - if (ret != FTP_CODE_257_PATHNAME_CREATED) { - goto out; - } - - ret = 0; -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_rmd(struct ftp_client *client, const char *folder) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - /* Validate input */ - ret = validate_ftp_param(folder, FTP_MAX_PATHNAME); - if (ret != 0) { - return ret; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_RMD, folder); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_250_FILE_ACTION_COMPLETED); - if (ret != FTP_CODE_250_FILE_ACTION_COMPLETED) { - goto out; - } - - ret = 0; -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_rename(struct ftp_client *client, const char *old_name, const char *new_name) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - ret = validate_ftp_param(old_name, FTP_MAX_PATHNAME); - if (ret != 0) { - return ret; - } - - - ret = validate_ftp_param(new_name, FTP_MAX_PATHNAME); - if (ret != 0) { - return ret; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_RNFR, old_name); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_350_FILE_ACTION_PENDING); - if (ret != FTP_CODE_350_FILE_ACTION_PENDING) { - goto out; - } - - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_RNTO, new_name); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_250_FILE_ACTION_COMPLETED); - if (ret != FTP_CODE_250_FILE_ACTION_COMPLETED) { - goto out; - } - - ret = 0; - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_delete(struct ftp_client *client, const char *file) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - /* Validate input */ - ret = validate_ftp_param(file, FTP_MAX_PATHNAME); - if (ret != 0) { - return ret; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_DELE, file); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_250_FILE_ACTION_COMPLETED); - if (ret != FTP_CODE_250_FILE_ACTION_COMPLETED) { - goto out; - } - - ret = 0; - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_get(struct ftp_client *client, const char *file) -{ - int ret; - uint16_t data_port; - - if (client == NULL) { - return -EINVAL; - } - - /* Validate input */ - ret = validate_ftp_param(file, FTP_MAX_PATHNAME); - if (ret != 0) { - return ret; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - /* Always set Passive mode to act as TCP client */ - ret = set_passive_mode(client, &data_port); - if (ret != 0) { - goto out; - } - - /* Send RETR command in control channel */ - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_RETR, file); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - if (ret != 0) { - goto out; - } - - /* Wait for file status ok reply from the server. */ - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_150_FILE_STATUS_OK); - if (ret != FTP_CODE_150_FILE_STATUS_OK) { - goto out; - } - - ret = do_ftp_recv_data(client, data_port); - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_put(struct ftp_client *client, const char *file, const uint8_t *data, - uint16_t length, int type) -{ - int ret; - uint16_t data_port = 0; - - if (client == NULL) { - return -EINVAL; - } - - if (type != FTP_PUT_NORMAL && type != FTP_PUT_UNIQUE && type != FTP_PUT_APPEND) { - return -EINVAL; - - } - if ((type == FTP_PUT_NORMAL || type == FTP_PUT_APPEND) && file == NULL) { - return -EINVAL; - } - - if (type == FTP_PUT_APPEND && data == NULL) { - return -EINVAL; - } - - /* Validate file parameter if provided */ - if (file != NULL) { - ret = validate_ftp_param(file, FTP_MAX_FILENAME); - if (ret != 0) { - return ret; - } - } - - k_mutex_lock(&client->lock, K_FOREVER); - - /** Typical sequence: - * FTP 51 Request: PASV - * FTP 96 Response: 227 Entering Passive Mode (90,130,70,73,105,177). - * FTP 63 Request: STOR upload2.txt - * FTP-DATA 53 FTP Data: 8 bytes (PASV) (STOR upload2.txt) - * FTP 67 Response: 150 Ok to send data. - * FTP 69 Response: 226 Transfer complete. - */ - - /* Always set Passive mode to act as TCP client */ - ret = set_passive_mode(client, &data_port); - if (ret != 0) { - goto out; - } - - if (type == FTP_PUT_NORMAL) { - /* Send STOR command in control channel */ - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_STOR, file); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - } else if (type == FTP_PUT_UNIQUE) { - /* Send STOU command in control channel */ - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_STOU); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - } else { - /* Send APPE command in control channel */ - snprintf(client->ctrl_buf, sizeof(client->ctrl_buf), CMD_APPE, file); - ret = do_ftp_send_ctrl(client, client->ctrl_buf, strlen(client->ctrl_buf)); - } - - if (ret != 0) { - goto out; - } - - /* Wait for file status ok reply from the server. */ - ret = do_ftp_recv_ctrl(client, true, FTP_CODE_150_FILE_STATUS_OK); - if (ret != FTP_CODE_150_FILE_STATUS_OK) { - goto out; - } - - /* Now send data if any */ - ret = do_ftp_send_data(client, data_port, data, length); - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_keepalive(struct ftp_client *client) -{ - int ret; - - if (client == NULL) { - return -EINVAL; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - ret = do_ftp_send_ctrl(client, CMD_NOOP, sizeof(CMD_NOOP) - 1); - if (ret != 0) { - goto out; - } - - ret = do_ftp_recv_ctrl(client, false, FTP_CODE_200_OK); - if (ret != FTP_CODE_200_OK) { - goto out; - } - - ret = 0; - -out: - k_mutex_unlock(&client->lock); - - return ret; -} - -int ftp_init(struct ftp_client *client, ftp_client_callback_t ctrl_callback, - ftp_client_callback_t data_callback) -{ - if (client == NULL || ctrl_callback == NULL || data_callback == NULL) { - return -EINVAL; - } - - client->ctrl_sock = INVALID_SOCKET; - client->data_sock = INVALID_SOCKET; - client->ctrl_len = 0; - client->connected = false; - client->sec_tag = SEC_TAG_TLS_INVALID; - client->ctrl_callback = ctrl_callback; - client->data_callback = data_callback; - - memset(&client->remote, 0, sizeof(client->remote)); - - k_mutex_init(&client->lock); -#if CONFIG_FTP_CLIENT_KEEPALIVE_TIME > 0 - k_work_init_delayable(&client->keepalive_work, keepalive_handler); -#endif - - return 0; -} - -int ftp_uninit(struct ftp_client *client) -{ - int ret = 0; - - if (client == NULL) { - return -EINVAL; - } - - k_mutex_lock(&client->lock, K_FOREVER); - - if (client->ctrl_sock != INVALID_SOCKET) { - ret = ftp_close(client); - } - - k_mutex_unlock(&client->lock); - - return ret; -} - -#if CONFIG_FTP_CLIENT_KEEPALIVE_TIME > 0 -static int ftp_sys_init(void) -{ - k_work_queue_start(&ftp_work_q, ftp_stack_area, - K_THREAD_STACK_SIZEOF(ftp_stack_area), - FTP_PRIORITY, NULL); - - return 0; -} - -SYS_INIT(ftp_sys_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); -#endif diff --git a/subsys/net/lib/ftp/ftp_commands.h b/subsys/net/lib/ftp/ftp_commands.h deleted file mode 100644 index c3148d5e05dc..000000000000 --- a/subsys/net/lib/ftp/ftp_commands.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2020-2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef FTP_COMMANDS_H_ -#define FTP_COMMANDS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Reference RFC959 File Transfer Protocol - */ -/* Abort an active file transfer */ -#define CMD_ABOR "ABOR\r\n" -/* Account information */ -#define CMD_ACCT "ACCT %s\r\n" -/* Allocate sufficient disk space to receive a file */ -#define CMD_ALLO "ALLO\r\n" -/* Append (with create) */ -#define CMD_APPE "APPE %s\r\n" -/* Change to Parent Directory */ -#define CMD_CDUP "CDUP\r\n" -/* Change working directory */ -#define CMD_CWD "CWD %s\r\n" -/* Delete file */ -#define CMD_DELE "DELE %s\r\n" -/* Returns usage documentation on a command if specified, else a general help - * document is returned - */ -#define CMD_HELP "HELP\r\n" -/* Returns information of a file or directory if specified, else in formation of - * the current working directory is returned - */ -#define CMD_LIST "LIST\r\n" -#define CMD_LIST_OPT "LIST %s\r\n" -#define CMD_LIST_FILE "LIST %s\r\n" -#define CMD_LIST_OPT_FILE "LIST %s %s\r\n" -/* Make directory */ -#define CMD_MKD "MKD %s\r\n" -/* Sets the transfer mode (Stream, Block, or Compressed) */ -#define CMD_MODE "MODE\r\n" -/* Returns a list of file names in a specified directory */ -#define CMD_NLST "NLST\r\n" -/* No operation (dummy packet; used mostly on keepalives) */ -#define CMD_NOOP "NOOP\r\n" -/* Select options for a feature (for example OPTS UTF8 ON) */ -#define CMD_OPTS "OPTS %s\r\n" -/* Authentication password */ -#define CMD_PASS "PASS %s\r\n" -/* Enter passive mode */ -#define CMD_PASV "PASV\r\n" -/* Specifies an address and port to which the server should connect */ -#define CMD_PORT "PORT\r\n" -/* Print working directory. Returns the current directory of the host */ -#define CMD_PWD "PWD\r\n" -/* Disconnect */ -#define CMD_QUIT "QUIT\r\n" -/* Re-initializes the connection*/ -#define CMD_REIN "REIN\r\n" -/* Restart transfer from the specified point */ -#define CMD_REST "REST\r\n" -/* Retrieve a copy of the file */ -#define CMD_RETR "RETR %s\r\n" -/* Remove a directory */ -#define CMD_RMD "RMD %s\r\n" -/* Rename from */ -#define CMD_RNFR "RNFR %s\r\n" -/* Rename to */ -#define CMD_RNTO "RNTO %s\r\n" -/* Sends site specific commands to remote server (like SITE IDLE 60 or - * SITE UMASK 002). Inspect SITE HELP output for complete list of - * supported commands - */ -#define CMD_SITE "SITE %s\r\n" -/* Return the size of a file */ -#define CMD_SIZE "SIZE %s\r\n" -/* Mount file structure */ -#define CMD_SMNT "SMNT\r\n" -/* Returns information on the server status, including the status of the - * current connection - */ -#define CMD_STAT "STAT\r\n" -/* Accept the data and to store the data as a file at the server site */ -#define CMD_STOR "STOR %s\r\n" -/* Store file uniquely */ -#define CMD_STOU "STOU\r\n" -/* Set file transfer structure */ -#define CMD_STRU "STRU\r\n" -/* Return system type */ -#define CMD_SYST "SYST\r\n" -/* Sets the transfer mode (ASCII/Binary) */ -#define CMD_TYPE_A "TYPE A\r\n" -#define CMD_TYPE_I "TYPE I\r\n" -/* Authentication username */ -#define CMD_USER "USER %s\r\n" - -#ifdef __cplusplus -} -#endif - -#endif /* FTP_COMMANDS_H_ */ From 708a3d6105c42eb02d71c4b4c7bfec9e4313c5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:41 +0200 Subject: [PATCH 2683/3334] Revert "[nrf fromtree] tests: drivers: spi: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 139d55ce34c6d9a2939d09cd6ce3a43dff50e12b. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 74 ------------------- .../spi_controller_peripheral/testcase.yaml | 6 -- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 73 ------------------ .../drivers/spi/spi_error_cases/testcase.yaml | 1 - .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 55 -------------- tests/drivers/spi/spi_loopback/testcase.yaml | 4 - 6 files changed, 213 deletions(-) delete mode 100644 tests/drivers/spi/spi_controller_peripheral/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/spi/spi_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/spi/spi_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 8e9d6ce4c265..000000000000 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi22_default_alt: spi22_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi22_sleep_alt: spi22_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi21_default_alt: spi21_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi21_sleep_alt: spi21_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&spi22 { - status = "okay"; - pinctrl-0 = <&spi22_default_alt>; - pinctrl-1 = <&spi22_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; - zephyr,pm-device-runtime-auto; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -dut_spis: &spi21 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi21_default_alt>; - pinctrl-1 = <&spi21_sleep_alt>; - pinctrl-names = "default", "sleep"; - /delete-property/ rx-delay-supported; - /delete-property/ rx-delay; -}; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index 69d62b09042a..3fa4cb16db6b 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -14,7 +14,6 @@ common: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp tests: @@ -53,7 +52,6 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf7120dk/nrf7120/cpuapp drivers.spi.spi_2M666666Hz: extra_configs: @@ -62,7 +60,6 @@ tests: integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - - nrf7120dk/nrf7120/cpuapp drivers.spi.spi_4MHz: extra_configs: @@ -87,7 +84,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.spis_fast: @@ -102,7 +98,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.pm_runtime: @@ -126,7 +121,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54h20dk/nrf54h20/cpuppr - ophelia4ev/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp drivers.spi.direct_xfer: extra_configs: diff --git a/tests/drivers/spi/spi_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/spi/spi_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 83ef5cc609d2..000000000000 --- a/tests/drivers/spi/spi_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - spi22_default_alt: spi22_default_alt { - group1 { - psels = , - , - ; - }; - }; - - spi22_sleep_alt: spi22_sleep_alt { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi21_default_alt: spi21_default_alt { - group1 { - psels = , - , - , - ; - }; - }; - - spi21_sleep_alt: spi21_sleep_alt { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -&gpio2 { - status = "okay"; -}; - -&spi22 { - status = "okay"; - pinctrl-0 = <&spi22_default_alt>; - pinctrl-1 = <&spi22_sleep_alt>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; - - dut_spi_dt: test-spi-dev@0 { - compatible = "vnd,spi-device"; - reg = <0>; - spi-max-frequency = <4000000>; - }; -}; - -dut_spis: &spi21 { - compatible = "nordic,nrf-spis"; - status = "okay"; - def-char = <0x00>; - pinctrl-0 = <&spi21_default_alt>; - pinctrl-1 = <&spi21_sleep_alt>; - pinctrl-names = "default", "sleep"; - /delete-property/ rx-delay-supported; - /delete-property/ rx-delay; -}; diff --git a/tests/drivers/spi/spi_error_cases/testcase.yaml b/tests/drivers/spi/spi_error_cases/testcase.yaml index 6e4aa26a79f7..eb3f4c78c580 100644 --- a/tests/drivers/spi/spi_error_cases/testcase.yaml +++ b/tests/drivers/spi/spi_error_cases/testcase.yaml @@ -16,7 +16,6 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 diff --git a/tests/drivers/spi/spi_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/spi/spi_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index a614330abcf8..000000000000 --- a/tests/drivers/spi/spi_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Test requires following loopback: - * P1.11 - P1.12 - */ - -&pinctrl { - spi21_default: spi21_default { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi21_sleep: spi21_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - -&spi21 { - status = "okay"; - pinctrl-0 = <&spi21_default>; - pinctrl-1 = <&spi21_sleep>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - zephyr,pm-device-runtime-auto; - - slow@0 { - compatible = "test-spi-loopback-slow"; - reg = <0>; - spi-max-frequency = ; - }; - - dut_fast: fast@0 { - compatible = "test-spi-loopback-fast"; - reg = <0>; - spi-max-frequency = ; - }; -}; - -&gpio2 { - status = "okay"; -}; diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index cf589c48fcab..55e47bbc7340 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -284,7 +284,6 @@ tests: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_1mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp harness: console harness_config: fixture: spi_loopback @@ -296,19 +295,16 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_16mhz: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_16mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54l_32mhz: extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_32mhz.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.spi.nrf54lm20_16mhz_32mhz: harness: ztest From aa20f4d4bcd993dfe52f70cf88ee3159bcf0d961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:41 +0200 Subject: [PATCH 2684/3334] Revert "[nrf fromtree] tests: drivers: pwm: pwm_gpio_lookback Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7b8c092c1bf3cbfceea550aae83d525d1314b0c0. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 1 - .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 44 ------------------- .../pwm/pwm_gpio_loopback/testcase.yaml | 1 - 3 files changed, 46 deletions(-) delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf delete mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index 795414a504ab..000000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SKIP_EDGE_NUM=4 diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 03f9b1eb18e0..000000000000 --- a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires wire connection between: - * - PWM22 OUT[0] at P1.14 <-> GPIO input at P1.00 - * - PWM22 OUT[1] at P1.02 <-> GPIO input at P1.03 - */ - -/ { - zephyr,user { - pwms = <&pwm22 0 160000 PWM_POLARITY_NORMAL>, - <&pwm22 1 160000 PWM_POLARITY_NORMAL>; - - gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>, - <&gpio1 3 GPIO_ACTIVE_HIGH>; - }; -}; - -&pinctrl { - pwm22_alt: pwm22_alt { - group1 { - psels = , - ; - }; - }; - - pwm22_alt_sleep: pwm22_alt_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&pwm22 { - pinctrl-0 = <&pwm22_alt>; - pinctrl-1 = <&pwm22_alt_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; diff --git a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml index 347e0e9f9772..ce1ebe94d562 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml @@ -22,7 +22,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.pwm.gpio_loopback.silabs: From 69b801b162bdb756f1ff76a568ffe459c41a107c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:42 +0200 Subject: [PATCH 2685/3334] Revert "[nrf fromtree] tests: drivers: i2s: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9f303f78f909db8c96d63855a0423e06f5e6420f. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 31 ------------------- .../drivers/i2s/i2s_additional/testcase.yaml | 2 -- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 31 ------------------- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 31 ------------------- 4 files changed, 95 deletions(-) delete mode 100644 tests/drivers/i2s/i2s_additional/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/i2s/i2s_additional/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_additional/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index e0cd7f9e4337..000000000000 --- a/tests/drivers/i2s/i2s_additional/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; - sck-clock-source = "ACLK"; -}; diff --git a/tests/drivers/i2s/i2s_additional/testcase.yaml b/tests/drivers/i2s/i2s_additional/testcase.yaml index 9b521728ccc6..77a18c3ab9d3 100644 --- a/tests/drivers/i2s/i2s_additional/testcase.yaml +++ b/tests/drivers/i2s/i2s_additional/testcase.yaml @@ -17,13 +17,11 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp drivers.i2s.additional.gpio_loopback.54h: harness_config: diff --git a/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 8cee43a64b57..000000000000 --- a/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; - sck-clock-source = "ACLK"; -}; diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index e0cd7f9e4337..000000000000 --- a/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* i2s-node0 is the transmitter/receiver */ - -/ { - aliases { - i2s-node0 = &tdm; - }; -}; - -&pinctrl { - tdm_default_alt: tdm_default_alt { - group1 { - psels = , - , - , /* TDM_SDOUT shorted to TDM_SDIN */ - ; - }; - }; -}; - -&tdm { - status = "okay"; - pinctrl-0 = <&tdm_default_alt>; - pinctrl-names = "default"; - sck-clock-source = "ACLK"; -}; From 4eecbe2edd81026404e7e8c6aa0127fb2ad667d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:42 +0200 Subject: [PATCH 2686/3334] Revert "[nrf fromtree] tests: drivers: i2c: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d329dd94c98ef74f92cd8893da6851642521f1be. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 68 ----------------- tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml | 2 - .../boards/nrf7120dk_nrf7120_cpuapp.conf | 4 - .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 74 ------------------- .../drivers/i2c/i2c_target_api/testcase.yaml | 1 - 5 files changed, 149 deletions(-) delete mode 100644 tests/drivers/i2c/i2c_nrfx_twim/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.conf delete mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 6008121850db..000000000000 --- a/tests/drivers/i2c/i2c_nrfx_twim/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SDA = P1.8 and P1.9 - * SCL = P1.2 and P1.3 - */ - -/ { - aliases { - i2c-controller = &i2c21; - i2c-controller-target = &i2c22; - }; -}; - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - compatible = "nordic,nrf-twim"; - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; diff --git a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml index 21cc44aa5369..42d1d98f3af8 100644 --- a/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml +++ b/tests/drivers/i2c/i2c_nrfx_twim/testcase.yaml @@ -15,8 +15,6 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf5340dk/nrf5340/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index c0b19426141a..000000000000 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index e1d445b11f4e..000000000000 --- a/tests/drivers/i2c/i2c_target_api/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SDA = P1.8 and P1.9 - * SCL = P1.2 and P1.3 - */ - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; - - eeprom1: eeprom@56 { - compatible = "zephyr,i2c-target-eeprom"; - reg = <0x56>; - address-width = <8>; - size = <256>; - }; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; - - eeprom0: eeprom@54 { - compatible = "zephyr,i2c-target-eeprom"; - reg = <0x54>; - address-width = <8>; - size = <256>; - }; -}; diff --git a/tests/drivers/i2c/i2c_target_api/testcase.yaml b/tests/drivers/i2c/i2c_target_api/testcase.yaml index c8c34853d842..0ac4cc223cd9 100644 --- a/tests/drivers/i2c/i2c_target_api/testcase.yaml +++ b/tests/drivers/i2c/i2c_target_api/testcase.yaml @@ -73,7 +73,6 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - s32k5xxcvb/s32k566/m7 - s32k5xxcvb/s32k566/r52 From 1d3b9f08da179202cf9514018674c33309c60086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:42 +0200 Subject: [PATCH 2687/3334] Revert "[nrf fromtree] tests: drivers: gpio: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a6f3339a2a1316674e19acc6418f358c5c8435d7. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 1 - .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 21 ------------------- .../boards/nrf7120dk_nrf7120_cpuflpr .overlay | 7 ------- .../nrf7120dk_nrf7120_cpuflpr_xip.overlay | 7 ------- tests/drivers/gpio/gpio_hogs/testcase.yaml | 1 - 5 files changed, 37 deletions(-) delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.conf delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr .overlay delete mode 100644 tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr_xip.overlay diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index b9d02cf11d5d..000000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SKIP_PULL_TEST=y diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 048a7039fecd..000000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - resources { - compatible = "test-gpio-basic-api"; - out-gpios = <&gpio1 12 0>; - in-gpios = <&gpio1 11 0>; - }; -}; - -&gpiote20 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr .overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr .overlay deleted file mode 100644 index e2649a103542..000000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr .overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr_xip.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr_xip.overlay deleted file mode 100644 index e2649a103542..000000000000 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf7120dk_nrf7120_cpuflpr_xip.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/gpio/gpio_hogs/testcase.yaml b/tests/drivers/gpio/gpio_hogs/testcase.yaml index 07a4f13d9a37..43b01894f5fb 100644 --- a/tests/drivers/gpio/gpio_hogs/testcase.yaml +++ b/tests/drivers/gpio/gpio_hogs/testcase.yaml @@ -12,7 +12,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - - nrf7120dk/nrf7120/cpuapp - nucleo_g474re - nrf52_bsim - nrf5340bsim/nrf5340/cpuapp From 7a0b44799d24b17408913a4cb6a483120b90c220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:43 +0200 Subject: [PATCH 2688/3334] Revert "[nrf fromtree] tests: drivers: counter: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 77155b3791099728e391afb898081564d01f5c1d. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 40 ------------------- 1 file changed, 40 deletions(-) delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 0b454e822e3c..000000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&timer00 { - prescaler = <6>; - status = "okay"; -}; - -&timer10 { - prescaler = <4>; - status = "okay"; -}; - -&timer20 { - prescaler = <4>; - status = "okay"; -}; - -&timer21 { - prescaler = <4>; - status = "okay"; -}; - -&timer22 { - prescaler = <4>; - status = "okay"; -}; - -&timer23 { - prescaler = <4>; - status = "okay"; -}; - -&timer24 { - prescaler = <4>; - status = "okay"; -}; From 354022b23f16b453c904a153e1b977b15212140e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:43 +0200 Subject: [PATCH 2689/3334] Revert "[nrf fromtree] tests: drivers: comparator: gpio_loopback: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ed0b2df1d0cac475884b44761b9584f5576692eb. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 25 ------------------- .../socs/nrf7120_cpuapp_nrf_comp.overlay | 18 ------------- .../socs/nrf7120_cpuapp_nrf_lpcomp.overlay | 14 ----------- .../comparator/gpio_loopback/testcase.yaml | 2 -- 4 files changed, 59 deletions(-) delete mode 100644 tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_comp.overlay delete mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_lpcomp.overlay diff --git a/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 4ef6daeced9b..000000000000 --- a/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/* - * P0.03 looped back to P0.00 - */ - -/ { - aliases { - test-comp = ∁ - }; - - zephyr,user { - test-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio0 { - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_comp.overlay deleted file mode 100644 index c7e7c3c9baa7..000000000000 --- a/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_comp.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&comp { - main-mode = "SE"; - psel = ; /* P0.00 */ - refsel = "INT_1V2"; - sp-mode = "HIGH"; - th-up = <63>; - th-down = <59>; - isource = "DISABLED"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_lpcomp.overlay deleted file mode 100644 index 0e1021666d96..000000000000 --- a/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_nrf_lpcomp.overlay +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -&comp { - compatible = "nordic,nrf-lpcomp"; - psel = ; /* P0.00 */ - refsel = "VDD_4_8"; - status = "okay"; -}; diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index 156c446cf3e6..a628911ec904 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -30,7 +30,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: extra_args: @@ -41,7 +40,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.stm32_comp: platform_allow: From 51c070250a8727300e52855a2a44c2c638d595a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:44 +0200 Subject: [PATCH 2690/3334] Revert "[nrf fromtree] tests: drivers: clock_control: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e4f2c497c526eabc8f6a140be7270691c46cda9c. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 1 - .../clock_control/clock_control_api/testcase.yaml | 2 -- .../clock_control/nrf_clock_calibration/testcase.yaml | 1 - .../clock_control/nrf_clock_control/testcase.yaml | 1 - .../clock_control/nrf_lf_clock_start/testcase.yaml | 9 --------- tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c | 2 +- .../drivers/clock_control/nrf_onoff_and_bt/testcase.yaml | 2 -- tests/drivers/clock_control/onoff/testcase.yaml | 1 - 8 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 tests/drivers/clock_control/clock_control_api/boards/nrf7120dk_nrf7120_cpuapp.conf diff --git a/tests/drivers/clock_control/clock_control_api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/clock_control/clock_control_api/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index 377287fb194c..000000000000 --- a/tests/drivers/clock_control/clock_control_api/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_TEST_NRF_HF_STARTUP_TIME_US=2000 diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index d91ea13821ed..9f98524dbb95 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -26,7 +26,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -38,7 +37,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index f7c3dd46a048..39fec028a40b 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -11,7 +11,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_clock_control/testcase.yaml b/tests/drivers/clock_control/nrf_clock_control/testcase.yaml index 70d0942ebedf..856cc9cb6476 100644 --- a/tests/drivers/clock_control/nrf_clock_control/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_control/testcase.yaml @@ -5,4 +5,3 @@ tests: - clock_control platform_allow: - nrf54h20dk/nrf54h20/cpuapp - - nrf7120dk/nrf7120/cpuapp diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index e61cf2deffbf..d789b0e52882 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -17,7 +17,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SYSTEM_CLOCK_WAIT_FOR_STABILITY=y @@ -36,7 +35,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SYSTEM_CLOCK_WAIT_FOR_AVAILABILITY=y @@ -55,7 +53,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -73,7 +70,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -91,7 +87,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -109,7 +104,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -127,7 +121,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -145,7 +138,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -163,7 +155,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c b/tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c index 18e7ade22d80..377cbc0c6d6a 100644 --- a/tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c +++ b/tests/drivers/clock_control/nrf_onoff_and_bt/src/main.c @@ -14,7 +14,7 @@ LOG_MODULE_REGISTER(test); #define TEST_TIME_MS 10000 -#if defined(CONFIG_SOC_SERIES_NRF54L) || defined(CONFIG_SOC_SERIES_NRF71) +#ifdef CONFIG_SOC_SERIES_NRF54L #define HF_STARTUP_TIME_US 600 #else #define HF_STARTUP_TIME_US 400 diff --git a/tests/drivers/clock_control/nrf_onoff_and_bt/testcase.yaml b/tests/drivers/clock_control/nrf_onoff_and_bt/testcase.yaml index d4ece55e8da2..b489bd4c8b6b 100644 --- a/tests/drivers/clock_control/nrf_onoff_and_bt/testcase.yaml +++ b/tests/drivers/clock_control/nrf_onoff_and_bt/testcase.yaml @@ -8,7 +8,5 @@ tests: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index 84bb601a8d13..4c50ba3c3ade 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -10,7 +10,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 4194044ab2f95c9b314a924c507dc7f028446e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:44 +0200 Subject: [PATCH 2691/3334] Revert "[nrf fromtree] tests: boards: nrf: i2c: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b6bd31719f95481386056447890abb44e730ce6d. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 67 ------------------- tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 4 -- 2 files changed, 71 deletions(-) delete mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 48f3d7b0b53d..000000000000 --- a/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - i2c-slave = &i2c22; - }; -}; - -&pinctrl { - i2c21_default_alt: i2c21_default_alt { - group1 { - psels = , - ; - }; - }; - - i2c21_sleep_alt: i2c21_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default_alt: i2c22_default_alt { - group1 { - /* Temporary workaround as it is currently not possible - * to configure pins for TWIS with pinctrl. - */ - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep_alt: i2c22_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut_twim: &i2c21 { - compatible = "nordic,nrf-twim"; - status = "okay"; - pinctrl-0 = <&i2c21_default_alt>; - pinctrl-1 = <&i2c21_sleep_alt>; - pinctrl-names = "default", "sleep"; - clock-frequency = ; - - sensor: sensor@54 { - reg = <0x54>; - }; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - status = "okay"; - pinctrl-0 = <&i2c22_default_alt>; - pinctrl-1 = <&i2c22_sleep_alt>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index c2e885ec6a00..b50aade0191e 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -17,7 +17,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp @@ -25,7 +24,6 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp boards.nrf.i2c.i2c_slave.twi: platform_allow: - nrf52840dk/nrf52840 @@ -41,7 +39,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp @@ -49,7 +46,6 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp extra_args: - EXTRA_DTC_OVERLAY_FILE="i2c_speed_fast.overlay" boards.nrf.i2c.i2c_slave.fast_plus: From 61ee5512047d8a22c114b99f42f71a0a986fbf26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:44 +0200 Subject: [PATCH 2692/3334] Revert "[nrf fromtree] tests boards: nrf_comp: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d278f23780d56cc101ed52aff665270b800ebdbf. Signed-off-by: Andrzej Głąbek --- .../comp/boards/nrf7120dk_nrf7120_cpuapp.conf | 4 -- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 41 ------------------- tests/boards/nrf/comp/testcase.yaml | 1 - 3 files changed, 46 deletions(-) delete mode 100644 tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.conf delete mode 100644 tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index 369d6daa6d93..000000000000 --- a/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX=0 -CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX=5 -CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX=1 -CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX=0 diff --git a/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 846417be281a..000000000000 --- a/tests/boards/nrf/comp/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Two loopbacks are used - * Each loopback is between analog input and GPIO. - * first-gpios (P0.02) -> AIN1 (P0.01) - * second-gpios (P0.03, AIN3) -> (P0.00, AIN0) - * AIN5 (P0.05) -> VDD - */ - -#include - -/ { - aliases { - test-comp = ∁ - }; - - zephyr,user { - first-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; - second-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio0 { - status = "okay"; -}; - -&comp { - status = "okay"; - psel = ; - refsel = "AREF"; - extrefsel = ; - sp-mode = "LOW"; - th-up = <36>; - th-down = <30>; - isource = "DISABLED"; - enable-hyst; -}; diff --git a/tests/boards/nrf/comp/testcase.yaml b/tests/boards/nrf/comp/testcase.yaml index f4a88db57df3..6d158d284eea 100644 --- a/tests/boards/nrf/comp/testcase.yaml +++ b/tests/boards/nrf/comp/testcase.yaml @@ -13,4 +13,3 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp From f673ea900939a903694b0f55dcb027af92a65a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:45 +0200 Subject: [PATCH 2693/3334] Revert "[nrf fromtree] tests: subsys: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d10223872031e5b38abb93b3f86ba9fd8e451b36. Signed-off-by: Andrzej Głąbek --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 - tests/subsys/settings/performance/testcase.yaml | 2 -- tests/subsys/settings/tfm_psa/testcase.yaml | 1 - 3 files changed, 4 deletions(-) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index 5a524f2c5ec6..c794ea1797e5 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -21,7 +21,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf5340dk/nrf5340/cpuapp - nrf52840dk/nrf52840 - - nrf7120dk/nrf7120/cpuapp - nrf9151dk/nrf9151 - nrf9160dk/nrf9160 - nrf9161dk/nrf9161 diff --git a/tests/subsys/settings/performance/testcase.yaml b/tests/subsys/settings/performance/testcase.yaml index 8ffe1f8112d5..efbd2115234c 100644 --- a/tests/subsys/settings/performance/testcase.yaml +++ b/tests/subsys/settings/performance/testcase.yaml @@ -7,7 +7,6 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - mps2/an385 integration_platforms: @@ -28,7 +27,6 @@ tests: platform_allow: - nrf52840dk/nrf52840 - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - mps2/an385 integration_platforms: diff --git a/tests/subsys/settings/tfm_psa/testcase.yaml b/tests/subsys/settings/tfm_psa/testcase.yaml index 0b7a4b4124ca..4c036ca752b4 100644 --- a/tests/subsys/settings/tfm_psa/testcase.yaml +++ b/tests/subsys/settings/tfm_psa/testcase.yaml @@ -8,7 +8,6 @@ common: - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns - - nrf7120dk/nrf7120/cpuapp/ns - mps2/an521/cpu0/ns - lpcxpresso55s69/lpc55s69/cpu0/ns tags: From 73fb50aaf0c0599033bceed91356d4a70a3717a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:45 +0200 Subject: [PATCH 2694/3334] Revert "[nrf fromtree] tests: drivers: sensor: temp_sensor: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5160d5a442c4b6391908f13c2253e9eed6220afa. Signed-off-by: Andrzej Głąbek --- .../temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 tests/drivers/sensor/temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/sensor/temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/sensor/temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index b0d340854352..000000000000 --- a/tests/drivers/sensor/temp_sensor/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -temp_sensor: &temp { - status = "okay"; -}; From 6bc604c96ca91e04c0e1501deac43c24e28ade24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:45 +0200 Subject: [PATCH 2695/3334] Revert "[nrf fromtree] tests: drivers: watchdog: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 81ca00215cb89c85973722efed9b29e96a26f958. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 9 --------- tests/drivers/watchdog/wdt_variables/testcase.yaml | 2 -- 2 files changed, 11 deletions(-) delete mode 100644 tests/drivers/watchdog/wdt_variables/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/watchdog/wdt_variables/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/watchdog/wdt_variables/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index dcac0662ba24..000000000000 --- a/tests/drivers/watchdog/wdt_variables/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_variables/testcase.yaml b/tests/drivers/watchdog/wdt_variables/testcase.yaml index f7d3bbbcb850..07f6a8945dc4 100644 --- a/tests/drivers/watchdog/wdt_variables/testcase.yaml +++ b/tests/drivers/watchdog/wdt_variables/testcase.yaml @@ -16,11 +16,9 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.watchdog.wdt_variables.54h_flpr: From fb96f25df5c0b50bb577291bbe3b4a0c73f6832b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:46 +0200 Subject: [PATCH 2696/3334] Revert "[nrf fromtree] tests: drivers: retained_mem: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e6a1b0c384fcdb5d9eb6c6cb195850b17e85ea22. Signed-off-by: Andrzej Głąbek --- .../api/boards/nrf7120dk_nrf7120_cpuapp.conf | 1 - .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 28 ------------------- tests/drivers/retained_mem/api/testcase.yaml | 1 - 3 files changed, 30 deletions(-) delete mode 100644 tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.conf delete mode 100644 tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index c15ba3ed96da..000000000000 --- a/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_POWEROFF=y diff --git a/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index bce909500d5a..000000000000 --- a/tests/drivers/retained_mem/api/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - cpuapp_sram@2002e000 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2002e000 DT_SIZE_K(4)>; - zephyr,memory-region = "RetainedMem"; - status = "okay"; - - retainedmem0: retainedmem { - compatible = "zephyr,retained-ram"; - status = "okay"; - }; - }; - - aliases { - retainedmemtestdevice = &retainedmem0; - }; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(184)>; - ranges = <0x0 0x20000000 0x2e000>; -}; diff --git a/tests/drivers/retained_mem/api/testcase.yaml b/tests/drivers/retained_mem/api/testcase.yaml index 1a9180d7185e..a07d56443e39 100644 --- a/tests/drivers/retained_mem/api/testcase.yaml +++ b/tests/drivers/retained_mem/api/testcase.yaml @@ -20,7 +20,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - nucleo_h723zg/stm32h723xx - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 22b63d28fae89d27dd4e8650d5693c3bca798b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:46 +0200 Subject: [PATCH 2697/3334] Revert "[nrf fromtree] tests: drivers: mbox: mbox_error_cases: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e489a82503373fcf8d3b128fe8b870654a8985e3. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 22 ------------------- .../drivers/mbox/mbox_error_cases/sample.yaml | 2 -- .../drivers/mbox/mbox_error_cases/src/main.c | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 tests/drivers/mbox/mbox_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/mbox/mbox_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/mbox/mbox_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 6d1f935b2ce0..000000000000 --- a/tests/drivers/mbox/mbox_error_cases/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&cpuapp_vevif_tx 21>, <&cpuapp_vevif_tx 32>, - <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_rx 32>; - mbox-names = "remote_valid", "remote_incorrect", - "local_valid", "local_incorrect"; - }; -}; - -&cpuapp_vevif_rx { - status = "okay"; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; diff --git a/tests/drivers/mbox/mbox_error_cases/sample.yaml b/tests/drivers/mbox/mbox_error_cases/sample.yaml index 06255734ea5c..a285478b4235 100644 --- a/tests/drivers/mbox/mbox_error_cases/sample.yaml +++ b/tests/drivers/mbox/mbox_error_cases/sample.yaml @@ -18,11 +18,9 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_args: SNIPPET=nordic-flpr diff --git a/tests/drivers/mbox/mbox_error_cases/src/main.c b/tests/drivers/mbox/mbox_error_cases/src/main.c index 53e7196dccd9..377ab6b8be43 100644 --- a/tests/drivers/mbox/mbox_error_cases/src/main.c +++ b/tests/drivers/mbox/mbox_error_cases/src/main.c @@ -12,7 +12,7 @@ int dummy_value; #if defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || \ defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) || \ - defined(CONFIG_SOC_NRF54LM20A) || defined(CONFIG_SOC_NRF7120) + defined(CONFIG_SOC_NRF54LM20A) #define EXPECTED_MTU_VALUE (0) #define DATA_TRANSFER_MODE_SUPPORTED (0) #define REMOTE_BUSY_SUPPORTED (0) From bd483c6be1e6484e50e1dd792679684037d4819e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:47 +0200 Subject: [PATCH 2698/3334] Revert "[nrf fromtree] tests: drivers: uart: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 86004d54f70bcf5bdb678999cf39fafdb719445d. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 1 - .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 30 ---------- .../boards/nrf7120dk_nrf7120_cpuflpr.overlay | 7 --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 35 ----------- ...7120dk_nrf7120_cpuapp_cross_domain.overlay | 35 ----------- .../boards/nrf7120dk_nrf7120_cpuflpr.overlay | 35 ----------- ...rf7120dk_nrf7120_cpuflpr_dual_uart.overlay | 55 ----------------- .../nrf7120dk_nrf7120_dual_uart.overlay | 55 ----------------- .../uart/uart_elementary/testcase.yaml | 11 ---- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 59 ------------------- tests/drivers/uart/uart_errors/testcase.yaml | 2 - .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 43 -------------- .../uart/uart_mix_fifo_poll/testcase.yaml | 1 - .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 30 ---------- tests/drivers/uart/uart_pm/testcase.yaml | 4 -- 15 files changed, 403 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.conf delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuflpr.overlay delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp_cross_domain.overlay delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr.overlay delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr_dual_uart.overlay delete mode 100644 tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_dual_uart.overlay delete mode 100644 tests/drivers/uart/uart_errors/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_mix_fifo_poll/boards/nrf7120dk_nrf7120_cpuapp.overlay delete mode 100644 tests/drivers/uart/uart_pm/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index d70069646c93..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 8eb6607b6f70..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default_alt: uart21_default_alt { - group1 { - psels = , - ; - }; - }; - - uart21_sleep_alt: uart21_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - pinctrl-0 = <&uart21_default_alt>; - pinctrl-1 = <&uart21_sleep_alt>; - pinctrl-names = "default", "sleep"; - current-speed = <115200>; -}; diff --git a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuflpr.overlay b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuflpr.overlay deleted file mode 100644 index e2649a103542..000000000000 --- a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuflpr.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 1d6c9d8a0d99..000000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp_cross_domain.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp_cross_domain.overlay deleted file mode 100644 index 831d82c075ec..000000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuapp_cross_domain.overlay +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr.overlay deleted file mode 100644 index 661195cb7fa3..000000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr.overlay +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr_dual_uart.overlay deleted file mode 100644 index 38494bc31bee..000000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_cpuflpr_dual_uart.overlay +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - uart22_default: uart22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - uart22_sleep: uart22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; -}; - -dut_aux: &uart22 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart22_default>; - pinctrl-1 = <&uart22_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_dual_uart.overlay deleted file mode 100644 index 5e0813748317..000000000000 --- a/tests/drivers/uart/uart_elementary/boards/nrf7120dk_nrf7120_dual_uart.overlay +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - uart22_default: uart22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - uart22_sleep: uart22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; -}; - -dut_aux: &uart22 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart22_default>; - pinctrl-1 = <&uart22_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/drivers/uart/uart_elementary/testcase.yaml b/tests/drivers/uart/uart_elementary/testcase.yaml index a7ebe182a311..7de614defbaf 100644 --- a/tests/drivers/uart/uart_elementary/testcase.yaml +++ b/tests/drivers/uart/uart_elementary/testcase.yaml @@ -16,8 +16,6 @@ tests: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf7120dk/nrf7120/cpuapp - - nrf7120dk/nrf7120/cpuflpr - nrf5340dk/nrf5340/cpuapp - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr @@ -76,8 +74,6 @@ tests: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf7120dk/nrf7120/cpuapp - - nrf7120dk/nrf7120/cpuflpr - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr extra_args: @@ -85,8 +81,6 @@ tests: - platform:nrf54l15dk/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - platform:nrf54lm20dk/nrf54lm20a/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - platform:nrf54lm20dk/nrf54lm20a/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - - platform:nrf7120dk/nrf7120/cpuapp:"DTC_OVERLAY_FILE=boards/nrf7120dk_nrf7120_dual_uart.overlay" - - platform:nrf7120dk/nrf7120/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf7120dk_nrf7120_dual_uart.overlay" - platform:ophelia4ev/nrf54l15/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - platform:ophelia4ev/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" extra_configs: @@ -98,8 +92,6 @@ tests: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf7120dk/nrf7120/cpuapp - - nrf7120dk/nrf7120/cpuflpr - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr extra_args: @@ -107,8 +99,6 @@ tests: - platform:nrf54l15dk/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - platform:nrf54lm20dk/nrf54lm20a/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - platform:nrf54lm20dk/nrf54lm20a/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54lm20dk_nrf54lm20a_dual_uart.overlay" - - platform:nrf7120dk/nrf7120/cpuapp:"DTC_OVERLAY_FILE=boards/nrf7120dk_nrf7120_dual_uart.overlay" - - platform:nrf7120dk/nrf7120/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf7120dk_nrf7120_dual_uart.overlay" - platform:ophelia4ev/nrf54l15/cpuapp:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" - platform:ophelia4ev/nrf54l15/cpuflpr:"DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_dual_uart.overlay" extra_configs: @@ -120,7 +110,6 @@ tests: fixture: uart_p1_p2_loopback platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_cross_domain.overlay" extra_configs: - CONFIG_NRF_SYS_EVENT=y diff --git a/tests/drivers/uart/uart_errors/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_errors/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 059d55aa1386..000000000000 --- a/tests/drivers/uart/uart_errors/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - uart22_default: uart22_default { - group1 { - psels = ; - bias-pull-up; - }; - - group2 { - psels = ; - }; - }; - - uart22_sleep: uart22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; -}; - -dut_aux: &uart22 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart22_default>; - pinctrl-1 = <&uart22_sleep>; - pinctrl-names = "default", "sleep"; - disable-rx; -}; diff --git a/tests/drivers/uart/uart_errors/testcase.yaml b/tests/drivers/uart/uart_errors/testcase.yaml index cdd90f7378b6..79860fc5b2f6 100644 --- a/tests/drivers/uart/uart_errors/testcase.yaml +++ b/tests/drivers/uart/uart_errors/testcase.yaml @@ -15,7 +15,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf5340dk/nrf5340/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - sam_e54_xpro drivers.uart.uart_errors.async: @@ -25,7 +24,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf5340dk/nrf5340/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - sam_e54_xpro extra_args: EXTRA_CONF_FILE="boards/sam_e54_xpro_async.conf" diff --git a/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 4884beb93ced..000000000000 --- a/tests/drivers/uart/uart_mix_fifo_poll/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - , - , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; - -counter_dev: &timer00 { - status = "okay"; -}; - -&grtc { - interrupts = <228 2>; -}; diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index e98e85aa735c..3769ea9f1de9 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -16,7 +16,6 @@ common: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 diff --git a/tests/drivers/uart/uart_pm/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/uart/uart_pm/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index ddcbb362dc05..000000000000 --- a/tests/drivers/uart/uart_pm/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&pinctrl { - uart21_default: uart21_default { - group1 { - psels = , - ; - }; - }; - - uart21_sleep: uart21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -dut: &uart21 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart21_default>; - pinctrl-1 = <&uart21_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index bd82f4193981..4dec1c51ea01 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -12,7 +12,6 @@ common: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp harness_config: fixture: gpio_loopback @@ -40,7 +39,6 @@ tests: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20bsim/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.uart.pm.enhanced_poll: @@ -52,7 +50,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.uart.pm.int_driven: @@ -91,5 +88,4 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp From 4eae6646939ee0da35e4e053c6dc44bf460eb443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:47 +0200 Subject: [PATCH 2699/3334] Revert "[nrf fromtree] tests: drivers: timer: nrf_grtc_timer: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ade9efb2aa1b81875956e57e3383c5f2ae73e19f. Signed-off-by: Andrzej Głąbek --- 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 f4c6439972ab..549234220ceb 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -11,7 +11,6 @@ common: - nrf54l15bsim/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr integration_platforms: From d420c31e09a962a4b32e01a9adcbb5e1a778152a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:47 +0200 Subject: [PATCH 2700/3334] Revert "[nrf fromtree] tests: drivers: flash: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 20bfade2bee8502626283705006894089042b9d6. Signed-off-by: Andrzej Głąbek --- tests/drivers/flash/common/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/flash/common/testcase.yaml b/tests/drivers/flash/common/testcase.yaml index 489d2bf0bd57..6a3250727d9c 100644 --- a/tests/drivers/flash/common/testcase.yaml +++ b/tests/drivers/flash/common/testcase.yaml @@ -92,7 +92,6 @@ tests: drivers.flash.common.no_explicit_erase.nrf54h: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - - nrf7120dk/nrf7120/cpuapp harness_config: fixture: gpio_loopback drivers.flash.common.nrf54lm20a: From 624732e1cb562ba4a7e227460527732e0b0d2e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:48 +0200 Subject: [PATCH 2701/3334] Revert "[nrf fromtree] tests: drivers: build_all: comparator: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7a6bc3fea52f259fbfdbfc8d19b0eb2d19aa82fa. Signed-off-by: Andrzej Głąbek --- tests/drivers/build_all/comparator/testcase.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/drivers/build_all/comparator/testcase.yaml b/tests/drivers/build_all/comparator/testcase.yaml index 0d509b68988e..7c9755ed858b 100644 --- a/tests/drivers/build_all/comparator/testcase.yaml +++ b/tests/drivers/build_all/comparator/testcase.yaml @@ -45,7 +45,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - nrf9280pdk/nrf9280/cpuapp integration_platforms: @@ -64,7 +63,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - nrf9280pdk/nrf9280/cpuapp integration_platforms: @@ -79,13 +77,11 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp - nrf9280pdk/nrf9280/cpuapp integration_platforms: - nrf51dk/nrf51822 - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp drivers.build_all.comparator.nrf_lpcomp.int_ref: extra_args: @@ -96,7 +92,6 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - nrf9280pdk/nrf9280/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: From 2914f808ea93a3a2466a7d87986ddced54aeb369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:48 +0200 Subject: [PATCH 2702/3334] Revert "[nrf fromtree] tests: drivers: audio: dmic_api: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3b443d37e567e753583412576c29ac9c08248145. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 tests/drivers/audio/dmic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/drivers/audio/dmic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/drivers/audio/dmic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 3debd272dc09..000000000000 --- a/tests/drivers/audio/dmic_api/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Test requires loopbacks: - * - between P1.14 and P1.0, - * For best performance, PDM_CLK shall be on 'Clock pin'. - */ - -/ { - aliases { - dmic-dev = &pdm20; - }; -}; - -&pinctrl { - pdm20_default_test: pdm20_default_test { - group1 { - psels = , - ; - }; - }; -}; - -&pdm20 { - status = "okay"; - pinctrl-0 = <&pdm20_default_test>; - pinctrl-names = "default"; - clock-source = "PCLK32M"; -}; From ca37e1e80a1584f517ff20d728d36fa6d9042304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:48 +0200 Subject: [PATCH 2703/3334] Revert "[nrf fromtree] tests: boards: nrf: qdec: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f8f073faa1de6d430a9399b88c01d5f6410926dd. Signed-off-by: Andrzej Głąbek --- .../qdec/boards/nrf7120dk_nrf7120_common.dtsi | 108 ------------------ .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 7 -- tests/boards/nrf/qdec/testcase.yaml | 2 - 3 files changed, 117 deletions(-) delete mode 100644 tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_common.dtsi delete mode 100644 tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_common.dtsi b/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_common.dtsi deleted file mode 100644 index db2df77f5ca5..000000000000 --- a/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_common.dtsi +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* Required loopbacks - * P1.11 <-> P1.12 - * P1.13 <-> P1.15 - * P1.02 <-> P1.3 - * P1.00 <-> P1.14 - */ - -/ { - encoder-emulate { - compatible = "gpio-leds"; - - phase_a0: phase_a0 { - gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; - }; - - phase_b0: phase_b0 { - gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - }; - - phase_a1: phase_a1 { - gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; - }; - - phase_b1: phase_b1 { - gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; - }; - }; - - qdec_loopbacks: loopbacks { - compatible = "test-qdec-loopbacks"; - - loopback0 { - qdec = <&qdec20>; - qenc-emul-gpios = <&phase_a0 &phase_b0>; - }; - - loopback1 { - qdec = <&qdec21>; - qenc-emul-gpios = <&phase_a1 &phase_b1>; - }; - }; -}; - -&pinctrl { - qdec_20_pinctrl: qdec_20_pinctrl { - group1 { - psels = , - ; - }; - }; - - qdec_20_sleep_pinctrl: qdec_20_sleep_pinctrl { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - qdec_21_pinctrl: qdec_21_pinctrl { - group1 { - psels = , - ; - }; - }; - - qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&qdec20 { - status = "okay"; - pinctrl-0 = <&qdec_20_pinctrl>; - pinctrl-1 = <&qdec_20_sleep_pinctrl>; - pinctrl-names = "default", "sleep"; - steps = <127>; - led-pre = <500>; - zephyr,pm-device-runtime-auto; -}; - -&qdec21 { - status = "okay"; - pinctrl-0 = <&qdec_21_pinctrl>; - pinctrl-1 = <&qdec_21_sleep_pinctrl>; - pinctrl-names = "default", "sleep"; - steps = <127>; - led-pre = <500>; - zephyr,pm-device-runtime-auto; -}; diff --git a/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index b6b6349bb656..000000000000 --- a/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf7120dk_nrf7120_common.dtsi" diff --git a/tests/boards/nrf/qdec/testcase.yaml b/tests/boards/nrf/qdec/testcase.yaml index 232780d7abb9..e3eb262685ad 100644 --- a/tests/boards/nrf/qdec/testcase.yaml +++ b/tests/boards/nrf/qdec/testcase.yaml @@ -8,7 +8,6 @@ common: - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp @@ -17,7 +16,6 @@ common: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf7120dk/nrf7120/cpuapp harness: ztest harness_config: fixture: gpio_loopback From 960f3aa49145db87ab3b0bca5d83ab414ea13438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:49 +0200 Subject: [PATCH 2704/3334] Revert "[nrf fromtree] tests: boards: nrf: hwinfo: reset_cause: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7810bbb02599e20b411e4ab5445406b6c9c7070b. Signed-off-by: Andrzej Głąbek --- .../reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay | 9 --------- tests/boards/nrf/hwinfo/reset_cause/testcase.yaml | 1 - 2 files changed, 10 deletions(-) delete mode 100644 tests/boards/nrf/hwinfo/reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay b/tests/boards/nrf/hwinfo/reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index dcac0662ba24..000000000000 --- a/tests/boards/nrf/hwinfo/reset_cause/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml index 6541d41c7406..da37f9ef614d 100644 --- a/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml +++ b/tests/boards/nrf/hwinfo/reset_cause/testcase.yaml @@ -39,6 +39,5 @@ tests: - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp From 5fd3faff85e5bc5658201070142535446fdc6cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:49 +0200 Subject: [PATCH 2705/3334] Revert "[nrf fromtree] samples drivers: counter: alarm: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8fadbe6322a0c35b6721438814570b90e17b2235. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 16 ---------------- samples/drivers/counter/alarm/sample.yaml | 1 - 2 files changed, 17 deletions(-) delete mode 100644 samples/drivers/counter/alarm/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/drivers/counter/alarm/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/drivers/counter/alarm/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 37001d785480..000000000000 --- a/samples/drivers/counter/alarm/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2026 Nordic Semiconductor ASA - */ - -/ { - chosen { - counter = &timer10; - }; -}; - -&timer10 { - prescaler = <4>; - status = "okay"; -}; diff --git a/samples/drivers/counter/alarm/sample.yaml b/samples/drivers/counter/alarm/sample.yaml index f1e21dea1108..266c11240f51 100644 --- a/samples/drivers/counter/alarm/sample.yaml +++ b/samples/drivers/counter/alarm/sample.yaml @@ -28,7 +28,6 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - nrf9160dk/nrf9160 - sama7g54_ek - samd20_xpro From 56efa1ef78f8d528377cfe1a1d878a97e5a8fba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:49 +0200 Subject: [PATCH 2706/3334] Revert "[nrf fromtree] samples: sysbuild: hello_world: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a149e439ef5d38c316aa3aff210a8acf68116a53. Signed-off-by: Andrzej Głąbek --- samples/sysbuild/hello_world/Kconfig.sysbuild | 1 - samples/sysbuild/hello_world/sample.yaml | 7 ------- 2 files changed, 8 deletions(-) diff --git a/samples/sysbuild/hello_world/Kconfig.sysbuild b/samples/sysbuild/hello_world/Kconfig.sysbuild index 22b942e0510d..5204e7d6f645 100644 --- a/samples/sysbuild/hello_world/Kconfig.sysbuild +++ b/samples/sysbuild/hello_world/Kconfig.sysbuild @@ -34,4 +34,3 @@ config REMOTE_BOARD default "$(BOARD)/nrf54h20/cpuppr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUPPR_XIP_CORE default "$(BOARD)/nrf54h20/cpuflpr" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUFLPR_CORE default "$(BOARD)/nrf54h20/cpuflpr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUFLPR_XIP_CORE - default "$(BOARD)/nrf7120/cpuflpr" if SOC_NRF7120_CPUAPP diff --git a/samples/sysbuild/hello_world/sample.yaml b/samples/sysbuild/hello_world/sample.yaml index 7e1d00b34a8c..47a95b35bb05 100644 --- a/samples/sysbuild/hello_world/sample.yaml +++ b/samples/sysbuild/hello_world/sample.yaml @@ -73,10 +73,3 @@ tests: extra_args: - SB_CONFIG_REMOTE_NRF54H20_CPUFLPR_XIP_CORE=y - hello_world_SNIPPET=nordic-flpr-xip - sample.sysbuild.hello_world.nrf7120_cpuflpr: - platform_allow: - - nrf7120dk/nrf7120/cpuapp - integration_platforms: - - nrf7120dk/nrf7120/cpuapp - extra_args: - - hello_world_SNIPPET=nordic-flpr From 3ec9fe232e2a757c714e6b56aaa0e9b802fdcea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:49 +0200 Subject: [PATCH 2707/3334] Revert "[nrf fromtree] samples: sensor: qdec: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 94112b4a7012ce6a9b3f9af249382de5c6aaaf98. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 46 ------------------- samples/sensor/qdec/sample.yaml | 2 - 2 files changed, 48 deletions(-) delete mode 100644 samples/sensor/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/sensor/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/sensor/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index f3c0ea4556b3..000000000000 --- a/samples/sensor/qdec/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - aliases { - qdec0 = &qdec20; - qenca = &phase_a; - qencb = &phase_b; - }; - - encoder-emulate { - compatible = "gpio-leds"; - - phase_a: phase_a { - gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; - }; - - phase_b: phase_b { - gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&pinctrl { - qdec_pinctrl: qdec_pinctrl { - group1 { - psels = , - ; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&qdec20 { - status = "okay"; - pinctrl-0 = <&qdec_pinctrl>; - pinctrl-names = "default"; - steps = <120>; - led-pre = <500>; -}; diff --git a/samples/sensor/qdec/sample.yaml b/samples/sensor/qdec/sample.yaml index 78809a7dcba1..fbff236caf1d 100644 --- a/samples/sensor/qdec/sample.yaml +++ b/samples/sensor/qdec/sample.yaml @@ -34,7 +34,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -42,7 +41,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp harness_config: fixture: gpio_loopback From e2227faaa88d154d388bd1ee679034720007be27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:50 +0200 Subject: [PATCH 2708/3334] Revert "[nrf fromtree] samples: drivers: i2c: rtio_loopback: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7fbf239bdc17c3b3c6a4ba4a49113d40a8485d91. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.conf | 7 -- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 67 ------------------- samples/drivers/i2c/rtio_loopback/sample.yaml | 1 - 3 files changed, 75 deletions(-) delete mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf delete mode 100644 samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf b/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index 9b1d098346ed..000000000000 --- a/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright (c) 2026 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 diff --git a/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 61911f3acefa..000000000000 --- a/samples/drivers/i2c/rtio_loopback/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SDA = P1.8 and P1.9 - * SCL = P1.2 and P1.3 - */ - -/ { - aliases { - i2c-controller = &i2c21; - i2c-controller-target = &i2c22; - }; -}; - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - i2c22_default: i2c22_default { - group1 { - psels = , - ; - bias-pull-up; - }; - }; - - i2c22_sleep: i2c22_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - status = "okay"; -}; - -&i2c22 { - compatible = "nordic,nrf-twis"; - pinctrl-0 = <&i2c22_default>; - pinctrl-1 = <&i2c22_sleep>; - pinctrl-names = "default", "sleep"; - status = "okay"; -}; diff --git a/samples/drivers/i2c/rtio_loopback/sample.yaml b/samples/drivers/i2c/rtio_loopback/sample.yaml index de3c2cb237ce..dadfe1fff98e 100644 --- a/samples/drivers/i2c/rtio_loopback/sample.yaml +++ b/samples/drivers/i2c/rtio_loopback/sample.yaml @@ -18,7 +18,6 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp - nucleo_f401re - nucleo_h503rb - ophelia4ev/nrf54l15/cpuapp From 2f161971bce76290aaed4721e3ccbd3e9fe5cb06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:50 +0200 Subject: [PATCH 2709/3334] Revert "[nrf fromtree] samples: boards: nordic: system_off: add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 95c5e78f015f8831b0172ef6528905bd9a49cc22. Signed-off-by: Andrzej Głąbek --- .../boards/nrf7120dk_nrf7120_cpuapp.overlay | 29 ------------------- samples/boards/nordic/system_off/sample.yaml | 6 ---- 2 files changed, 35 deletions(-) delete mode 100644 samples/boards/nordic/system_off/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/boards/nordic/system_off/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/boards/nordic/system_off/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 31e33449bd94..000000000000 --- a/samples/boards/nordic/system_off/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - cpuapp_sram@2002e000 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2002e000 DT_SIZE_K(4)>; - zephyr,memory-region = "RetainedMem"; - status = "okay"; - - retainedmem0: retainedmem { - compatible = "zephyr,retained-ram"; - status = "okay"; - }; - }; - - aliases { - retainedmemdevice = &retainedmem0; - }; -}; - -&cpuapp_sram { - /* Shrink SRAM size to avoid overlap with retained memory region */ - reg = <0x20000000 DT_SIZE_K(184)>; - ranges = <0x0 0x20000000 0x2e000>; -}; diff --git a/samples/boards/nordic/system_off/sample.yaml b/samples/boards/nordic/system_off/sample.yaml index 0672c22e4c63..ce9321a845b3 100644 --- a/samples/boards/nordic/system_off/sample.yaml +++ b/samples/boards/nordic/system_off/sample.yaml @@ -15,7 +15,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp harness: console harness_config: type: multi_line @@ -35,7 +34,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y harness: console @@ -55,7 +53,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_SYS_CLOCK_DISABLE=y harness: console @@ -73,7 +70,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y - CONFIG_SYS_CLOCK_DISABLE=y @@ -95,7 +91,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_GRTC_WAKEUP_ENABLE=y - CONFIG_GPIO_WAKEUP_ENABLE=n @@ -120,7 +115,6 @@ tests: - nrf54l15dk/nrf54l10/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y - CONFIG_GRTC_WAKEUP_ENABLE=y From 4ca7b885e2b797efa7e1a7c9d88bc259e1d2c59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:50 +0200 Subject: [PATCH 2710/3334] Revert "[nrf fromtree] samples: boards: nordic: nrf_sys_event: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fb92e543e74d3a14d4d6f5f54810fa580e34bd2c. Signed-off-by: Andrzej Głąbek --- .../nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay | 8 -------- samples/boards/nordic/nrf_sys_event/sample.yaml | 4 ---- 2 files changed, 12 deletions(-) delete mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay deleted file mode 100644 index 246efa029ede..000000000000 --- a/samples/boards/nordic/nrf_sys_event/boards/nrf7120dk_nrf7120_cpuapp.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -sample_counter: &timer20 { - status = "okay"; -}; diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index 6ac248d7fc3c..5b36f2517b31 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -20,7 +20,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -29,7 +28,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp sample.boards.nordic.nrf_sys_event.force_constlat: platform_allow: @@ -44,7 +42,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 @@ -53,7 +50,6 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - nrf54l15dk/nrf54l15/cpuapp - - nrf7120dk/nrf7120/cpuapp - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SOC_NRF_FORCE_CONSTLAT=y From bcda7fc254932a151d8e438dd432736abfa75faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:50 +0200 Subject: [PATCH 2711/3334] Revert "[nrf fromtree] samples: basic: minimal: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 089cd1a3f8fa3c9ca72e78963b67303ceadd4cbf. Signed-off-by: Andrzej Głąbek --- samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf | 1 - samples/basic/minimal/sample.yaml | 2 -- 2 files changed, 3 deletions(-) delete mode 100644 samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf diff --git a/samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf b/samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf deleted file mode 100644 index c21cb5cfe71a..000000000000 --- a/samples/basic/minimal/boards/nrf7120dk_nrf7120_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CLOCK_CONTROL=n diff --git a/samples/basic/minimal/sample.yaml b/samples/basic/minimal/sample.yaml index dcb6d989f85b..3330ea4af2a3 100644 --- a/samples/basic/minimal/sample.yaml +++ b/samples/basic/minimal/sample.yaml @@ -111,11 +111,9 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - - nrf7120dk/nrf7120/cpuapp sample.minimal.no-mt-no-sw-isr-table.riscv: extra_args: CONF_FILE='common.conf;no-mt.conf;no-sw-isr-table.conf;riscv.conf' build_only: true platform_allow: - nrf54l15dk/nrf54l15/cpuflpr - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf7120dk/nrf7120/cpuflpr From 113b279c32fd02f89dbb188ced47dca8d30698a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:51 +0200 Subject: [PATCH 2712/3334] Revert "[nrf fromlist] boards: nrf54lm20dk: fix board variants and runners" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit baf177647fc40c5b87d35b24f13b5e4174bd7de3. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54lm20dk/board.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/board.yml b/boards/nordic/nrf54lm20dk/board.yml index 0de3f7c5ffd4..73bcd82ecc28 100644 --- a/boards/nordic/nrf54lm20dk/board.yml +++ b/boards/nordic/nrf54lm20dk/board.yml @@ -7,10 +7,14 @@ board: variants: - name: ns cpucluster: cpuapp + - name: xip + cpucluster: cpuflpr - name: nrf54lm20b variants: - name: ns cpucluster: cpuapp + - name: xip + cpucluster: cpuflpr runners: run_once: '--recover': @@ -23,9 +27,7 @@ runners: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20b/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp/ns - - nrf54lm20dk/nrf54lm20b/cpuflpr + - nrf54lm20dk/nrf54lm20a/cpuflpr/xip '--erase': - runners: - nrfjprog @@ -37,9 +39,7 @@ runners: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20b/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp/ns - - nrf54lm20dk/nrf54lm20b/cpuflpr + - nrf54lm20dk/nrf54lm20a/cpuflpr/xip '--reset': - runners: - nrfjprog @@ -51,6 +51,4 @@ runners: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuflpr - - nrf54lm20dk/nrf54lm20b/cpuapp - - nrf54lm20dk/nrf54lm20b/cpuapp/ns - - nrf54lm20dk/nrf54lm20b/cpuflpr + - nrf54lm20dk/nrf54lm20a/cpuflpr/xip From 9c72bb82cfb0c51653c90f3defa88dad1af0f01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:51 +0200 Subject: [PATCH 2713/3334] Revert "[nrf fromlist] snippets: nordic-flpr: add nRF54LM20B" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 06bc388b78938ef1ef30bd1f4b854b18fdf34460. Signed-off-by: Andrzej Głąbek --- snippets/nordic/nordic-flpr/snippet.yml | 3 -- .../nordic-flpr/soc/nrf54lm20b_cpuapp.overlay | 47 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 snippets/nordic/nordic-flpr/soc/nrf54lm20b_cpuapp.overlay diff --git a/snippets/nordic/nordic-flpr/snippet.yml b/snippets/nordic/nordic-flpr/snippet.yml index 510478861535..4fbb7c14c056 100644 --- a/snippets/nordic/nordic-flpr/snippet.yml +++ b/snippets/nordic/nordic-flpr/snippet.yml @@ -12,9 +12,6 @@ boards: /.*/nrf54lm20a/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: soc/nrf54lm20a_cpuapp.overlay - /.*/nrf54lm20b/cpuapp/: - append: - EXTRA_DTC_OVERLAY_FILE: soc/nrf54lm20b_cpuapp.overlay /.*/nrf7120/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: soc/nrf7120_cpuapp.overlay diff --git a/snippets/nordic/nordic-flpr/soc/nrf54lm20b_cpuapp.overlay b/snippets/nordic/nordic-flpr/soc/nrf54lm20b_cpuapp.overlay deleted file mode 100644 index b950c9c60b43..000000000000 --- a/snippets/nordic/nordic-flpr/soc/nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - soc { - cpuflpr_sram_code_data: memory@20067c00 { - compatible = "mmio-sram"; - reg = <0x20067c00 DT_SIZE_K(96)>; - ranges = <0x0 0x20067c00 0x18000>; - status = "reserved"; - #address-cells = <1>; - #size-cells = <1>; - }; - }; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(415)>; - ranges = <0x0 0x20000000 DT_SIZE_K(415)>; -}; - -&rram_controller { - cpuflpr_rram: rram@1e5000 { - compatible = "soc-nv-flash"; - reg = <0x1e5000 DT_SIZE_K(96)>; - ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; - erase-block-size = <0x1000>; - write-block-size = <0x10>; - #address-cells = <1>; - #size-cells = <1>; - }; -}; - -&uart30 { - status = "reserved"; -}; - -&cpuflpr_vpr { - execution-memory = <&cpuflpr_sram_code_data>; - source-memory = <&cpuflpr_rram>; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; From 419f7a76f35433c80086d9103f9257d7ea787a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:51 +0200 Subject: [PATCH 2714/3334] Revert "[nrf fromtree] CI: Update dts-linter to dts-linter 0.4.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f74bfc800155f9a0a88d963461693895900dd3a1. Signed-off-by: Andrzej Głąbek --- scripts/ci/package-lock.json | 16 ++++++++-------- scripts/ci/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/ci/package-lock.json b/scripts/ci/package-lock.json index c8a74316d276..50efc7dcaaa1 100644 --- a/scripts/ci/package-lock.json +++ b/scripts/ci/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "dts-linter": "^0.4.0" + "dts-linter": "^0.3.9" } }, "node_modules/devicetree-language-server": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/devicetree-language-server/-/devicetree-language-server-0.8.0.tgz", - "integrity": "sha512-Zxfb1qOS9nSaPVJYRaSxCznaltte3O95RCy+89fJxiHYPODaix9vttIOhkhIQ4UdUe44SkqnovvA9z/QM5VuVA==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/devicetree-language-server/-/devicetree-language-server-0.7.3.tgz", + "integrity": "sha512-Gzv6hp4Kq7t+tujIq5hqjJW+yrd+1KMCJuNNP5SnKub4HaJZKnbALFhSI/wVbOaOYTAhDJLKyiKPC2M5YE+egQ==", "license": "Apache-2.0", "bin": { "devicetree-language-server": "dist/server.js" @@ -21,12 +21,12 @@ } }, "node_modules/dts-linter": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/dts-linter/-/dts-linter-0.4.0.tgz", - "integrity": "sha512-bUuU4pLVagOPuMgzGgfW2ZXih7fHIsY6wqtrBxEsbEUKPCi27mpSYoCiLDjF6lCyAJuJyLeA/iDDYxJjSW5xbA==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/dts-linter/-/dts-linter-0.3.9.tgz", + "integrity": "sha512-J+JWuFmr1YUTqWxUjWtMHr7sGHX6Q9jDtFAE4a1ACvtlMP6CRA24F7WCSuUrQnP6hl3BAxJLmdoYIzT6UN9bxw==", "license": "Apache-2.0", "dependencies": { - "devicetree-language-server": "^0.8.0" + "devicetree-language-server": "^0.7.3" }, "bin": { "dts-linter": "dist/dts-linter.js" diff --git a/scripts/ci/package.json b/scripts/ci/package.json index 5f1bd4e2b87e..98b621977c7b 100644 --- a/scripts/ci/package.json +++ b/scripts/ci/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "dts-linter": "^0.4.0" + "dts-linter": "^0.3.9" } } From 3bb810283786f4c06f795ace173b4bada3a6272f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:52 +0200 Subject: [PATCH 2715/3334] Revert "[nrf noup] ci: workflow: modification of the stale_issue.yml" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 587050447ec81f187dbe268afa21b2b595901d6f. Signed-off-by: Andrzej Głąbek --- .github/workflows/stale_issue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale_issue.yml b/.github/workflows/stale_issue.yml index 0abab94dfbe5..96d38de631f0 100644 --- a/.github/workflows/stale_issue.yml +++ b/.github/workflows/stale_issue.yml @@ -10,7 +10,7 @@ jobs: stale: name: Find Stale issues and PRs runs-on: ubuntu-24.04 - if: github.repository == 'nrfconnect/sdk-zephyr' + if: github.repository == 'zephyrproject-rtos/zephyr' permissions: pull-requests: write # to comment on stale pull requests issues: write # to comment on stale issues From f7824de96e93ea6575507b3b4461508d45232e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:52 +0200 Subject: [PATCH 2716/3334] Revert "[nrf fromtree] samples: ipc: icmsg: Extend support for nRF54LM20A" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 29bbe2f2b560ed837c3bcd62f3fe86e2ed41fd44. Signed-off-by: Andrzej Głąbek --- .../ipc/ipc_service/icmsg/CMakeLists.txt | 1 - .../ipc/ipc_service/icmsg/Kconfig.sysbuild | 1 - ...nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay} | 14 ++++---- .../icmsg/boards/nrf54l_cpuapp_icbmsg.overlay | 11 ------- ...rf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay} | 14 ++++---- .../boards/nrf54l_cpuflpr_icbmsg.overlay | 11 ------- .../subsys/ipc/ipc_service/icmsg/sample.yaml | 33 ++++++++----------- 7 files changed, 29 insertions(+), 56 deletions(-) rename samples/subsys/ipc/ipc_service/icmsg/boards/{nrf54lm20dk_nrf54lm20a_cpuapp.overlay => nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay} (64%) delete mode 100644 samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l_cpuapp_icbmsg.overlay rename samples/subsys/ipc/ipc_service/icmsg/remote/boards/{nrf54lm20dk_nrf54lm20a_cpuflpr.overlay => nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay} (67%) delete mode 100644 samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l_cpuflpr_icbmsg.overlay diff --git a/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt b/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt index b414551dd294..fd88e8465fe1 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt +++ b/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt @@ -10,7 +10,6 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) if(NOT CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP AND NOT CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUAPP AND - NOT CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP AND NOT CONFIG_BOARD_STM32H747I_DISCO AND NOT CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUAPP AND NOT CONFIG_BOARD_EK_RA8P1_R7KA8P1KFLCAC_CM85) diff --git a/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild b/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild index 11edd21c7540..58a434e2b6e9 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild +++ b/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild @@ -9,6 +9,5 @@ string default "nrf5340dk/nrf5340/cpunet" if $(BOARD) = "nrf5340dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD) = "nrf5340bsim" default "nrf54l15dk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15dk" - default "nrf54lm20dk/nrf54lm20a/cpuflpr" if $(BOARD) = "nrf54lm20dk" default "stm32h747i_disco/stm32h747xx/m4" if $(BOARD) = "stm32h747i_disco" default "ek_ra8p1/r7ka8p1kflcac/cm33" if $(BOARD) = "ek_ra8p1" diff --git a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay similarity index 64% rename from samples/subsys/ipc/ipc_service/icmsg/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay rename to samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay index 33afb300d789..639ad5e844b4 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,22 +10,24 @@ #address-cells = <1>; #size-cells = <1>; - sram_rx: memory@20057c00 { - reg = <0x20057c00 0x8000>; + sram_rx: memory@20018000 { + reg = <0x20018000 0x0800>; }; - sram_tx: memory@2005fc00 { - reg = <0x2005fc00 0x8000>; + sram_tx: memory@20020000 { + reg = <0x20020000 0x0800>; }; }; }; ipc { ipc0: ipc0 { - compatible = "zephyr,ipc-icmsg"; + compatible = "zephyr,ipc-icbmsg"; dcache-alignment = <32>; tx-region = <&sram_tx>; rx-region = <&sram_rx>; + tx-blocks = <16>; + rx-blocks = <18>; mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>; mbox-names = "rx", "tx"; status = "okay"; diff --git a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l_cpuapp_icbmsg.overlay b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l_cpuapp_icbmsg.overlay deleted file mode 100644 index 68a36325c53d..000000000000 --- a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l_cpuapp_icbmsg.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&ipc0 { - compatible = "zephyr,ipc-icbmsg"; - tx-blocks = <16>; - rx-blocks = <18>; -}; diff --git a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay similarity index 67% rename from samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay rename to samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay index 7aa2e5fa557b..7fe78a716539 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54lm20dk_nrf54lm20a_cpuflpr.overlay +++ b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,22 +10,24 @@ #address-cells = <1>; #size-cells = <1>; - sram_tx: memory@20057c00 { - reg = <0x20057c00 0x8000>; + sram_tx: memory@20018000 { + reg = <0x20018000 0x0800>; }; - sram_rx: memory@2005fc00 { - reg = <0x2005fc00 0x8000>; + sram_rx: memory@20020000 { + reg = <0x20020000 0x0800>; }; }; }; ipc { ipc0: ipc0 { - compatible = "zephyr,ipc-icmsg"; + compatible = "zephyr,ipc-icbmsg"; dcache-alignment = <32>; tx-region = <&sram_tx>; rx-region = <&sram_rx>; + tx-blocks = <18>; + rx-blocks = <16>; mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>; mbox-names = "rx", "tx"; status = "okay"; diff --git a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l_cpuflpr_icbmsg.overlay b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l_cpuflpr_icbmsg.overlay deleted file mode 100644 index e93358b71f22..000000000000 --- a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l_cpuflpr_icbmsg.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&ipc0 { - compatible = "zephyr,ipc-icbmsg"; - tx-blocks = <18>; - rx-blocks = <16>; -}; diff --git a/samples/subsys/ipc/ipc_service/icmsg/sample.yaml b/samples/subsys/ipc/ipc_service/icmsg/sample.yaml index 27ee7b5ad3bd..d084434f7952 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/sample.yaml +++ b/samples/subsys/ipc/ipc_service/icmsg/sample.yaml @@ -14,18 +14,16 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340bsim/nrf5340/cpuapp - sample.ipc.icmsg.nrf54l: + sample.ipc.icmsg.nrf54l15: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: icmsg_SNIPPET=nordic-flpr - sample.ipc.icmsg.nrf54l_no_multithreading: + sample.ipc.icmsg.nrf54l15_no_multithreading: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: @@ -35,10 +33,9 @@ tests: - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y - sample.ipc.icmsg.nrf54l_remote_no_multithreading: + sample.ipc.icmsg.nrf54l15_remote_no_multithreading: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: @@ -46,47 +43,43 @@ tests: - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y - sample.ipc.icbmsg.nrf54l: - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp + sample.ipc.icbmsg.nrf54l15: + platform_allow: nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: - icmsg_SNIPPET=nordic-flpr - icmsg_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - icmsg_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuapp_icbmsg.overlay" + - icmsg_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay" - remote_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - remote_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuflpr_icbmsg.overlay" + - remote_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay" - sample.ipc.icbmsg.nrf54l_no_multithreading: + sample.ipc.icbmsg.nrf54l15_no_multithreading: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: - icmsg_SNIPPET=nordic-flpr - icmsg_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - icmsg_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuapp_icbmsg.overlay" + - icmsg_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay" - icmsg_CONFIG_MULTITHREADING=n - icmsg_CONFIG_LOG_MODE_MINIMAL=y - remote_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - remote_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuflpr_icbmsg.overlay" + - remote_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay" - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y - sample.ipc.icbmsg.nrf54l_remote_no_multithreading: + sample.ipc.icbmsg.nrf54l15_remote_no_multithreading: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: - icmsg_SNIPPET=nordic-flpr - icmsg_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - icmsg_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuapp_icbmsg.overlay" + - icmsg_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_icbmsg.overlay" - remote_CONFIG_IPC_SERVICE_BACKEND_ICBMSG_NUM_EP=1 - - remote_EXTRA_DTC_OVERLAY_FILE="boards/nrf54l_cpuflpr_icbmsg.overlay" + - remote_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuflpr_icbmsg.overlay" - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y From 950b2b93ee9bab5841dea1e68083319ecfe30d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:52 +0200 Subject: [PATCH 2717/3334] Revert "[nrf fromtree] manifest: hostap: Pull change for PD retry config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0147a39a2af8de490f35b71f071a44a4d5d83bfd. Signed-off-by: Andrzej Głąbek --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e6976ce4472f..76d54ed18072 100644 --- a/west.yml +++ b/west.yml @@ -291,7 +291,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: f5708c522793b0de59f467080a33caac769cd525 + revision: 7c5d886f4b1afd6d00192e346268f03f5f44354c - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From ac1f7320af0b04fdb265cde1e32683c292ae1a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:53 +0200 Subject: [PATCH 2718/3334] Revert "[nrf fromtree] modules: hostap: p2p: Configurable retry limit for PD" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9ceeda206b0c6ab7043d23aff8202987bfde9d60. Signed-off-by: Andrzej Głąbek --- modules/hostap/CMakeLists.txt | 4 ---- modules/hostap/Kconfig | 11 ----------- 2 files changed, 15 deletions(-) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 43fe0d120203..52ede512bdd2 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -394,10 +394,6 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P CONFIG_OFFCHANNEL ) -zephyr_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P - MAX_PROV_DISC_REQ_RETRIES=${CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P_PROV_DISC_REQ_RETRIES} -) - zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS CONFIG_WPS EAP_WSC diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 82005b7bad7d..101c344804f3 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -344,17 +344,6 @@ config WIFI_NM_WPA_SUPPLICANT_P2P select WIFI_NM_WPA_SUPPLICANT_WPS select WIFI_NM_WPA_SUPPLICANT_EAPOL -if WIFI_NM_WPA_SUPPLICANT_P2P - -config WIFI_NM_WPA_SUPPLICANT_P2P_PROV_DISC_REQ_RETRIES - int "P2P provision discovery request retries" - default 120 - help - Maximum number of retries for P2P provision discovery requests - when the peer is not listening. - -endif # WIFI_NM_WPA_SUPPLICANT_P2P - config WIFI_NM_WPA_SUPPLICANT_EAPOL bool "EAPoL supplicant" default y if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE From c39ae52d9ff6aa2034fe66c2b16d8adc8ad160bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:53 +0200 Subject: [PATCH 2719/3334] Revert "[nrf fromtree] manifest: fix DPP remain_on_channel wait timeout" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f4dcc7b28defe44a15554decd80323cd1da21596. Signed-off-by: Andrzej Głąbek --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 76d54ed18072..033982273c98 100644 --- a/west.yml +++ b/west.yml @@ -291,7 +291,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 7c5d886f4b1afd6d00192e346268f03f5f44354c + revision: 1a2fbb7910f23822a785294eab9f4922c6119711 - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3 From cafc10cb3a523a56bb49f2cb3904f67d45c47910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:53 +0200 Subject: [PATCH 2720/3334] Revert "[nrf fromtree] tests: kernel: sleep: Adjustments for NRF54H20 PPR xip" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 802a7d44bc205b4d5bcac11e7a04f724ba645649. Signed-off-by: Andrzej Głąbek --- tests/kernel/sleep/src/usleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/sleep/src/usleep.c b/tests/kernel/sleep/src/usleep.c index f74c089d3b91..9f3fd4dbe94b 100644 --- a/tests/kernel/sleep/src/usleep.c +++ b/tests/kernel/sleep/src/usleep.c @@ -46,7 +46,7 @@ /* Similar for nRF54H20 cpuppr (RISC-V core), it has a slow CPU clock * compared to other cores, causing the increased overhead. */ -#define MAXIMUM_SHORTEST_TICKS (IS_ENABLED(CONFIG_XIP) ? 8 : 4) +#define MAXIMUM_SHORTEST_TICKS 4 #else #define MAXIMUM_SHORTEST_TICKS 1 #endif From abb58667c44dbfd5c77b11fffffac9943d04ddcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:54 +0200 Subject: [PATCH 2721/3334] Revert "[nrf noup] modules: mbedtls: kconfig: Partial revert of a noup" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 308954d183679575b30efd175d0071b541cef0b8. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/Kconfig.psa.auto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 057d0a710eb0..b235c30380fb 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -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 @@ -264,30 +265,37 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE From 6173df89b298933486eda30a4602c35f2ec63552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:54 +0200 Subject: [PATCH 2722/3334] Revert "[nrf fromtree] soc: nordic: nrf71: Add support to enable Wi-Fi debug" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 86a89bb89c2be193f58b6dfc6b21f52413b22d9a. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf71/Kconfig | 9 --------- soc/nordic/nrf71/soc.c | 9 --------- 2 files changed, 18 deletions(-) diff --git a/soc/nordic/nrf71/Kconfig b/soc/nordic/nrf71/Kconfig index 59b973d1c66f..5c5d6056aff1 100644 --- a/soc/nordic/nrf71/Kconfig +++ b/soc/nordic/nrf71/Kconfig @@ -26,12 +26,3 @@ config SOC_NRF7120_ENGA_CPUAPP config SOC_NRF7120_ENGA_CPUFLPR select RISCV_CORE_NORDIC_VPR - -if SOC_SERIES_NRF71 - -config SOC_NRF71_WIFI_DAP - bool "nRF71 Wi-Fi Debug access port for debugging" - help - This controls the Wi-Fi AHB Debug AP (DAP) for debugging nRF71 Wi-Fi cores. - -endif # SOC_SERIES_NRF71 diff --git a/soc/nordic/nrf71/soc.c b/soc/nordic/nrf71/soc.c index bb241ba060b6..9018bc99e482 100644 --- a/soc/nordic/nrf71/soc.c +++ b/soc/nordic/nrf71/soc.c @@ -138,15 +138,6 @@ static void wifi_mpc_configuration(void) override.endaddr = 0x200E0000; override.index = 0; mpc_configure_override(NRF_MPC03, &override); - - if (IS_ENABLED(CONFIG_SOC_NRF71_WIFI_DAP)) { - /* Allow access to Wi-Fi debug interface registers */ - init_mpc_region_override(&override); - override.start_address = 0x48000000; - override.endaddr = 0x48100000; - override.index = index++; - mpc_configure_override(NRF_MPC00, &override); - } } static void grtc_configuration(void) From 465afac37b3f6f1a9578485347e849db1894e15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:54 +0200 Subject: [PATCH 2723/3334] Revert "[nrf fromtree] modules: hal_nordic: nrfx: remove UART instance specific symbols" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c07e2aa624703617f9fbb3329f6551c4debbe9a9. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/nrfx/Kconfig | 7 ++++++- modules/hal_nordic/nrfx/nrfx_kconfig.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 59f3d9fe2fde..030a07e4cf85 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -270,7 +270,12 @@ config NRFX_TWIS bool "NRFX driver for TWIS peripheral" config NRFX_UART - bool "UART driver" + bool + +config NRFX_UART0 + bool "UART0 driver instance" + depends on $(dt_nodelabel_exists,uart0) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) + select NRFX_UART config NRFX_UARTE bool "UARTE driver" diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index d75ed21aac55..d5ec4d7e53a5 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -396,6 +396,9 @@ #ifdef CONFIG_NRFX_UART_LOG #define NRFX_UART_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_UART0 +#define NRFX_UART0_ENABLED 1 +#endif #ifdef CONFIG_NRFX_UARTE #define NRFX_UARTE_ENABLED 1 From d0987732877e288c619899d7fc0ee0d4a7632da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:55 +0200 Subject: [PATCH 2724/3334] Revert "[nrf fromtree] drivers: spi: spi_nrfx_spi: use standard instantiation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c6e975fd59ddfe0f70dc3a915e87102d4c94705c. Signed-off-by: Andrzej Głąbek --- drivers/spi/Kconfig.nrfx | 4 +- drivers/spi/spi_nrfx_spi.c | 77 +++++++++++++++----------- modules/hal_nordic/nrfx/Kconfig | 17 +++++- modules/hal_nordic/nrfx/nrfx_kconfig.h | 9 +++ 4 files changed, 73 insertions(+), 34 deletions(-) diff --git a/drivers/spi/Kconfig.nrfx b/drivers/spi/Kconfig.nrfx index b391b919beff..990f044574ba 100644 --- a/drivers/spi/Kconfig.nrfx +++ b/drivers/spi/Kconfig.nrfx @@ -15,7 +15,9 @@ if SPI_NRFX config SPI_NRFX_SPI def_bool y depends on DT_HAS_NORDIC_NRF_SPI_ENABLED - select NRFX_SPI + select NRFX_SPI0 if HAS_HW_NRF_SPI0 + select NRFX_SPI1 if HAS_HW_NRF_SPI1 + select NRFX_SPI2 if HAS_HW_NRF_SPI2 config SPI_NRFX_SPIM def_bool y diff --git a/drivers/spi/spi_nrfx_spi.c b/drivers/spi/spi_nrfx_spi.c index 3b27a05c85f3..10badb033d97 100644 --- a/drivers/spi/spi_nrfx_spi.c +++ b/drivers/spi/spi_nrfx_spi.c @@ -15,13 +15,10 @@ #include LOG_MODULE_REGISTER(spi_nrfx_spi, CONFIG_SPI_LOG_LEVEL); -#define DT_DRV_COMPAT nordic_nrf_spi - #include "spi_context.h" #include "spi_nrfx_common.h" struct spi_nrfx_data { - nrfx_spi_t spi; struct spi_context ctx; const struct device *dev; size_t chunk_len; @@ -30,6 +27,7 @@ struct spi_nrfx_data { }; struct spi_nrfx_config { + nrfx_spi_t spi; nrfx_spi_config_t def_config; void (*irq_connect)(void); const struct pinctrl_dev_config *pcfg; @@ -37,7 +35,7 @@ struct spi_nrfx_config { uint32_t wake_pin; }; -static void event_handler(const nrfx_spi_event_t *p_event, void *p_context); +static void event_handler(const nrfx_spi_evt_t *p_event, void *p_context); static inline nrf_spi_frequency_t get_nrf_spi_frequency(uint32_t frequency) { @@ -138,18 +136,18 @@ static int configure(const struct device *dev, config.mode = get_nrf_spi_mode(spi_cfg->operation); config.bit_order = get_nrf_spi_bit_order(spi_cfg->operation); - sck_pin = nrf_spi_sck_pin_get(dev_data->spi.p_reg); + sck_pin = nrf_spi_sck_pin_get(dev_config->spi.p_reg); if (sck_pin != NRF_SPI_PIN_NOT_CONNECTED) { nrf_gpio_pin_write(sck_pin, spi_cfg->operation & SPI_MODE_CPOL ? 1 : 0); } if (dev_data->initialized) { - nrfx_spi_uninit(&dev_data->spi); + nrfx_spi_uninit(&dev_config->spi); dev_data->initialized = false; } - result = nrfx_spi_init(&dev_data->spi, &config, + result = nrfx_spi_init(&dev_config->spi, &config, event_handler, dev_data); if (result != 0) { LOG_ERR("Failed to initialize nrfx driver: %d", result); @@ -176,6 +174,7 @@ static void finish_transaction(const struct device *dev, int error) static void transfer_next_chunk(const struct device *dev) { + const struct spi_nrfx_config *dev_config = dev->config; struct spi_nrfx_data *dev_data = dev->data; struct spi_context *ctx = &dev_data->ctx; int error = 0; @@ -191,7 +190,7 @@ static void transfer_next_chunk(const struct device *dev) xfer.tx_length = spi_context_tx_buf_on(ctx) ? chunk_len : 0; xfer.p_rx_buffer = ctx->rx_buf; xfer.rx_length = spi_context_rx_buf_on(ctx) ? chunk_len : 0; - error = nrfx_spi_xfer(&dev_data->spi, &xfer, 0); + error = nrfx_spi_xfer(&dev_config->spi, &xfer, 0); if (error == 0) { return; } @@ -202,7 +201,7 @@ static void transfer_next_chunk(const struct device *dev) finish_transaction(dev, error); } -static void event_handler(const nrfx_spi_event_t *p_event, void *p_context) +static void event_handler(const nrfx_spi_evt_t *p_event, void *p_context) { struct spi_nrfx_data *dev_data = p_context; @@ -268,7 +267,7 @@ static int transceive(const struct device *dev, /* Abort the current transfer by deinitializing * the nrfx driver. */ - nrfx_spi_uninit(&dev_data->spi); + nrfx_spi_uninit(&dev_config->spi); dev_data->initialized = false; /* Make sure the transaction is finished (it may be @@ -364,7 +363,7 @@ static int spi_nrfx_pm_action(const struct device *dev, case PM_DEVICE_ACTION_SUSPEND: if (dev_data->initialized) { - nrfx_spi_uninit(&dev_data->spi); + nrfx_spi_uninit(&dev_config->spi); dev_data->initialized = false; } @@ -425,27 +424,31 @@ static int spi_nrfx_init(const struct device *dev) * - Name-based HAL IRQ handlers, e.g. nrfx_spi_0_irq_handler */ -#define SPI_PROP(idx, prop) DT_INST_PROP(idx, prop) +#define SPI(idx) DT_NODELABEL(spi##idx) +#define SPI_PROP(idx, prop) DT_PROP(SPI(idx), prop) #define SPI_NRFX_SPI_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(SPI(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(SPI(idx)), DT_IRQ(SPI(idx), priority), \ + nrfx_isr, nrfx_spi_##idx##_irq_handler, 0); \ + } \ static struct spi_nrfx_data spi_##idx##_data = { \ IF_ENABLED(CONFIG_MULTITHREADING, \ (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ IF_ENABLED(CONFIG_MULTITHREADING, \ (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(idx), ctx) \ - .spi = NRFX_SPI_INSTANCE(DT_INST_REG_ADDR(idx)), \ - .dev = DEVICE_DT_INST_GET(idx), \ + SPI_CONTEXT_CS_GPIOS_INITIALIZE(SPI(idx), ctx) \ + .dev = DEVICE_DT_GET(SPI(idx)), \ .busy = false, \ }; \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), \ - nrfx_spi_irq_handler, &spi_##idx##_data.spi, 0); \ - } \ - PINCTRL_DT_INST_DEFINE(idx); \ + PINCTRL_DT_DEFINE(SPI(idx)); \ static const struct spi_nrfx_config spi_##idx##z_config = { \ + .spi = { \ + .p_reg = (NRF_SPI_Type *)DT_REG_ADDR(SPI(idx)), \ + .drv_inst_idx = NRFX_SPI##idx##_INST_IDX, \ + }, \ .def_config = { \ .skip_gpio_cfg = true, \ .skip_psel_cfg = true, \ @@ -453,21 +456,31 @@ static int spi_nrfx_init(const struct device *dev) .orc = SPI_PROP(idx, overrun_character), \ }, \ .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ - .wake_gpiote = WAKE_GPIOTE_NODE(DT_DRV_INST(idx)), \ - .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(DT_DRV_INST(idx), \ - wake_gpios, WAKE_PIN_NOT_USED),\ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPI(idx)), \ + .wake_gpiote = WAKE_GPIOTE_NODE(SPI(idx)), \ + .wake_pin = NRF_DT_GPIOS_TO_PSEL_OR(SPI(idx), wake_gpios, \ + WAKE_PIN_NOT_USED), \ }; \ - BUILD_ASSERT(!DT_NODE_HAS_PROP(DT_DRV_INST(idx), wake_gpios) || \ - !(DT_INST_GPIO_FLAGS(idx, wake_gpios) & GPIO_ACTIVE_LOW), \ + BUILD_ASSERT(!DT_NODE_HAS_PROP(SPI(idx), wake_gpios) || \ + !(DT_GPIO_FLAGS(SPI(idx), wake_gpios) & GPIO_ACTIVE_LOW), \ "WAKE line must be configured as active high"); \ - PM_DEVICE_DT_INST_DEFINE(idx, spi_nrfx_pm_action); \ - SPI_DEVICE_DT_INST_DEFINE(idx, \ + PM_DEVICE_DT_DEFINE(SPI(idx), spi_nrfx_pm_action); \ + SPI_DEVICE_DT_DEFINE(SPI(idx), \ spi_nrfx_init, \ - PM_DEVICE_DT_INST_GET(idx), \ + PM_DEVICE_DT_GET(SPI(idx)), \ &spi_##idx##_data, \ &spi_##idx##z_config, \ POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \ &spi_nrfx_driver_api) -DT_INST_FOREACH_STATUS_OKAY(SPI_NRFX_SPI_DEFINE) +#ifdef CONFIG_HAS_HW_NRF_SPI0 +SPI_NRFX_SPI_DEFINE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_SPI1 +SPI_NRFX_SPI_DEFINE(1); +#endif + +#ifdef CONFIG_HAS_HW_NRF_SPI2 +SPI_NRFX_SPI_DEFINE(2); +#endif diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 030a07e4cf85..898051f0ef17 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -235,7 +235,22 @@ config NRFX_SAADC depends on $(dt_nodelabel_exists,adc) && !SOC_SERIES_NRF51 config NRFX_SPI - bool "SPI driver" + bool + +config NRFX_SPI0 + bool "SPI0 driver instance" + depends on $(dt_nodelabel_exists,spi0) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) + select NRFX_SPI + +config NRFX_SPI1 + bool "SPI1 driver instance" + depends on $(dt_nodelabel_exists,spi1) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) + select NRFX_SPI + +config NRFX_SPI2 + bool "SPI2 driver instance" + depends on $(dt_nodelabel_exists,spi2) && SOC_SERIES_NRF52 + select NRFX_SPI config NRFX_SPIM bool "SPIM driver" diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index d5ec4d7e53a5..d52a67c3343e 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -312,6 +312,15 @@ #ifdef CONFIG_NRFX_SPI_LOG #define NRFX_SPI_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_SPI0 +#define NRFX_SPI0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPI1 +#define NRFX_SPI1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_SPI2 +#define NRFX_SPI2_ENABLED 1 +#endif #ifdef CONFIG_NRFX_SPIM #define NRFX_SPIM_ENABLED 1 From 3fb8751537786bd0a5cbef057c318c59a417e569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:55 +0200 Subject: [PATCH 2725/3334] Revert "[nrf fromtree] drivers: i2c: i2c_nrfx_twi: use standard instantiation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f26e275e4caa859d4c5b32fa57ce636c890988e5. Signed-off-by: Andrzej Głąbek --- drivers/i2c/Kconfig.nrfx | 3 +- drivers/i2c/i2c_nrfx_twi.c | 93 ++++++++++---------- drivers/i2c/i2c_nrfx_twi_common.c | 22 ++--- drivers/i2c/i2c_nrfx_twi_common.h | 13 +-- drivers/i2c/i2c_nrfx_twi_rtio.c | 114 +++++++++++++------------ modules/hal_nordic/nrfx/Kconfig | 12 ++- modules/hal_nordic/nrfx/nrfx_kconfig.h | 6 ++ soc/nordic/common/Kconfig.peripherals | 6 ++ 8 files changed, 150 insertions(+), 119 deletions(-) diff --git a/drivers/i2c/Kconfig.nrfx b/drivers/i2c/Kconfig.nrfx index c967cc239cf5..c6a7dbeadcf7 100644 --- a/drivers/i2c/Kconfig.nrfx +++ b/drivers/i2c/Kconfig.nrfx @@ -17,7 +17,8 @@ if I2C_NRFX config I2C_NRFX_TWI def_bool y depends on DT_HAS_NORDIC_NRF_TWI_ENABLED - select NRFX_TWI + select NRFX_TWI0 if HAS_HW_NRF_TWI0 + select NRFX_TWI1 if HAS_HW_NRF_TWI1 config I2C_NRFX_TWIM def_bool y diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c index cde02ef7a217..12d40ee7323e 100644 --- a/drivers/i2c/i2c_nrfx_twi.c +++ b/drivers/i2c/i2c_nrfx_twi.c @@ -17,8 +17,6 @@ #include LOG_MODULE_REGISTER(i2c_nrfx_twi, CONFIG_I2C_LOG_LEVEL); -#define DT_DRV_COMPAT nordic_nrf_twi - #if CONFIG_I2C_NRFX_TRANSFER_TIMEOUT #define I2C_TRANSFER_TIMEOUT_MSEC K_MSEC(CONFIG_I2C_NRFX_TRANSFER_TIMEOUT) #else @@ -26,7 +24,6 @@ LOG_MODULE_REGISTER(i2c_nrfx_twi, CONFIG_I2C_LOG_LEVEL); #endif struct i2c_nrfx_twi_data { - nrfx_twi_t twi; uint32_t dev_config; struct k_sem transfer_sync; struct k_sem completion_sync; @@ -45,6 +42,7 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs, uint16_t addr) { + const struct i2c_nrfx_twi_config *config = dev->config; struct i2c_nrfx_twi_data *data = dev->data; int ret = 0; @@ -53,11 +51,11 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, /* Dummy take on completion_sync sem to be sure that it is empty */ k_sem_take(&data->completion_sync, K_NO_WAIT); - nrfx_twi_enable(&data->twi); + nrfx_twi_enable(&config->twi); for (size_t i = 0; i < num_msgs; i++) { bool more_msgs = ((i < (num_msgs - 1)) && - !(msgs[i + 1].flags & I2C_MSG_RESTART)); + !(msgs[i + 1].flags & I2C_MSG_RESTART)); ret = i2c_nrfx_twi_msg_transfer(dev, msgs[i].flags, msgs[i].buf, @@ -86,7 +84,7 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, * to make sure everything has been done to restore the * bus from this error. */ - nrfx_twi_disable(&data->twi); + nrfx_twi_disable(&config->twi); (void)i2c_nrfx_twi_recover_bus(dev); ret = -EIO; break; @@ -98,13 +96,13 @@ static int i2c_nrfx_twi_transfer(const struct device *dev, } } - nrfx_twi_disable(&data->twi); + nrfx_twi_disable(&config->twi); k_sem_give(&data->transfer_sync); return ret; } -static void event_handler(nrfx_twi_event_t const *p_event, void *p_context) +static void event_handler(nrfx_twi_evt_t const *p_event, void *p_context) { const struct device *dev = p_context; struct i2c_nrfx_twi_data *dev_data = (struct i2c_nrfx_twi_data *)dev->data; @@ -133,40 +131,45 @@ static DEVICE_API(i2c, i2c_nrfx_twi_driver_api) = { .recover_bus = i2c_nrfx_twi_recover_bus, }; -#define I2C_NRFX_TWI_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != I2C_NRFX_TWI_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static struct i2c_nrfx_twi_data twi_##idx##_data = { \ - .twi = NRFX_TWI_INSTANCE(DT_INST_REG_ADDR(idx)), \ - .transfer_sync = Z_SEM_INITIALIZER(twi_##idx##_data.transfer_sync, 1, 1), \ - .completion_sync = Z_SEM_INITIALIZER(twi_##idx##_data.completion_sync, 0, 1) \ - }; \ - static int twi_##idx##_init(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), nrfx_twi_irq_handler, \ - &twi_##idx##_data.twi, 0); \ - const struct i2c_nrfx_twi_config *config = dev->config; \ - int err = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - return i2c_nrfx_twi_init(dev); \ - } \ - PINCTRL_DT_INST_DEFINE(idx); \ - static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ - .config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ - }, \ - .event_handler = event_handler, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ - }; \ - PM_DEVICE_DT_INST_DEFINE(idx, twi_nrfx_pm_action); \ - I2C_DEVICE_DT_INST_DEFINE(idx, twi_##idx##_init, PM_DEVICE_DT_INST_GET(idx), \ - &twi_##idx##_data, &twi_##idx##z_config, POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twi_driver_api) - -DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWI_DEVICE) +#define I2C_NRFX_TWI_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(I2C(idx)) != I2C_NRFX_TWI_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static int twi_##idx##_init(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ + nrfx_twi_##idx##_irq_handler, 0); \ + const struct i2c_nrfx_twi_config *config = dev->config; \ + int err = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + return i2c_nrfx_twi_init(dev); \ + } \ + static struct i2c_nrfx_twi_data twi_##idx##_data = { \ + .transfer_sync = Z_SEM_INITIALIZER(twi_##idx##_data.transfer_sync, 1, 1), \ + .completion_sync = Z_SEM_INITIALIZER(twi_##idx##_data.completion_sync, 0, 1)}; \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ + .twi = NRFX_TWI_INSTANCE(idx), \ + .config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(I2C(idx)), \ + }, \ + .event_handler = event_handler, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + }; \ + PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \ + I2C_DEVICE_DT_DEFINE(I2C(idx), twi_##idx##_init, PM_DEVICE_DT_GET(I2C(idx)), \ + &twi_##idx##_data, &twi_##idx##z_config, POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, &i2c_nrfx_twi_driver_api) + +#ifdef CONFIG_HAS_HW_NRF_TWI0 +I2C_NRFX_TWI_DEVICE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWI1 +I2C_NRFX_TWI_DEVICE(1); +#endif diff --git a/drivers/i2c/i2c_nrfx_twi_common.c b/drivers/i2c/i2c_nrfx_twi_common.c index b35ee8f3054b..2d07863e3d73 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.c +++ b/drivers/i2c/i2c_nrfx_twi_common.c @@ -16,8 +16,7 @@ LOG_MODULE_DECLARE(i2c_nrfx_twi); int i2c_nrfx_twi_init(const struct device *dev) { const struct i2c_nrfx_twi_config *config = dev->config; - struct i2c_nrfx_twi_common_data *data = dev->data; - int result = nrfx_twi_init(&data->twi, &config->config, + int result = nrfx_twi_init(&config->twi, &config->config, config->event_handler, (void *)dev); if (result != 0) { LOG_ERR("Failed to initialize device: %s", @@ -30,8 +29,9 @@ int i2c_nrfx_twi_init(const struct device *dev) int i2c_nrfx_twi_configure(const struct device *dev, uint32_t dev_config) { + const struct i2c_nrfx_twi_config *config = dev->config; struct i2c_nrfx_twi_common_data *data = dev->data; - nrfx_twi_t const *inst = &data->twi; + nrfx_twi_t const *inst = &config->twi; if (I2C_ADDR_10_BITS & dev_config) { return -EINVAL; @@ -39,10 +39,10 @@ int i2c_nrfx_twi_configure(const struct device *dev, uint32_t dev_config) switch (I2C_SPEED_GET(dev_config)) { case I2C_SPEED_STANDARD: - nrf_twi_frequency_set(inst->p_reg, NRF_TWI_FREQ_100K); + nrf_twi_frequency_set(inst->p_twi, NRF_TWI_FREQ_100K); break; case I2C_SPEED_FAST: - nrf_twi_frequency_set(inst->p_reg, NRF_TWI_FREQ_400K); + nrf_twi_frequency_set(inst->p_twi, NRF_TWI_FREQ_400K); break; default: LOG_ERR("unsupported speed"); @@ -55,12 +55,12 @@ int i2c_nrfx_twi_configure(const struct device *dev, uint32_t dev_config) int i2c_nrfx_twi_recover_bus(const struct device *dev) { - struct i2c_nrfx_twi_common_data *data = dev->data; + const struct i2c_nrfx_twi_config *config = dev->config; uint32_t scl_pin; uint32_t sda_pin; - scl_pin = nrf_twi_scl_pin_get(data->twi.p_reg); - sda_pin = nrf_twi_sda_pin_get(data->twi.p_reg); + scl_pin = nrf_twi_scl_pin_get(config->twi.p_twi); + sda_pin = nrf_twi_sda_pin_get(config->twi.p_twi); return nrfx_twi_bus_recover(scl_pin, sda_pin); } @@ -69,7 +69,7 @@ int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, uint8_t *buf, size_t buf_len, uint16_t i2c_addr, bool more_msgs) { - struct i2c_nrfx_twi_common_data *data = dev->data; + const struct i2c_nrfx_twi_config *config = dev->config; int ret = 0; uint32_t xfer_flags = 0; nrfx_twi_xfer_desc_t cur_xfer = { @@ -107,7 +107,7 @@ int i2c_nrfx_twi_msg_transfer(const struct device *dev, uint8_t flags, } if (!ret) { - ret = nrfx_twi_xfer(&data->twi, &cur_xfer, xfer_flags); + ret = nrfx_twi_xfer(&config->twi, &cur_xfer, xfer_flags); } return ret; @@ -133,7 +133,7 @@ int twi_nrfx_pm_action(const struct device *dev, enum pm_device_action action) break; case PM_DEVICE_ACTION_SUSPEND: - nrfx_twi_uninit(&data->twi); + nrfx_twi_uninit(&config->twi); ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); if (ret < 0) { diff --git a/drivers/i2c/i2c_nrfx_twi_common.h b/drivers/i2c/i2c_nrfx_twi_common.h index 0a3fb081e8ce..3f81b5cc94e0 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.h +++ b/drivers/i2c/i2c_nrfx_twi_common.h @@ -20,22 +20,23 @@ extern "C" { : bitrate == 250000 ? NRF_TWI_FREQ_250K \ : bitrate == I2C_BITRATE_FAST ? NRF_TWI_FREQ_400K \ : I2C_NRFX_TWI_INVALID_FREQUENCY) - -#define I2C_FREQUENCY(node) \ - I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(node, clock_frequency, I2C_BITRATE_STANDARD)) +#define I2C(idx) DT_NODELABEL(i2c##idx) +#define I2C_FREQUENCY(idx) \ + I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ + I2C_BITRATE_STANDARD)) struct i2c_nrfx_twi_common_data { - nrfx_twi_t twi; uint32_t dev_config; }; struct i2c_nrfx_twi_config { + nrfx_twi_t twi; nrfx_twi_config_t config; - nrfx_twi_event_handler_t event_handler; + nrfx_twi_evt_handler_t event_handler; const struct pinctrl_dev_config *pcfg; }; -static inline int i2c_nrfx_twi_get_evt_result(nrfx_twi_event_t const *p_event) +static inline int i2c_nrfx_twi_get_evt_result(nrfx_twi_evt_t const *p_event) { switch (p_event->type) { case NRFX_TWI_EVT_DONE: diff --git a/drivers/i2c/i2c_nrfx_twi_rtio.c b/drivers/i2c/i2c_nrfx_twi_rtio.c index a4151b08fc06..531b9eaac261 100644 --- a/drivers/i2c/i2c_nrfx_twi_rtio.c +++ b/drivers/i2c/i2c_nrfx_twi_rtio.c @@ -18,10 +18,7 @@ #include LOG_MODULE_REGISTER(i2c_nrfx_twi, CONFIG_I2C_LOG_LEVEL); -#define DT_DRV_COMPAT nordic_nrf_twi - struct i2c_nrfx_twi_rtio_data { - nrfx_twi_t twi; uint32_t dev_config; bool twi_enabled; struct i2c_rtio *ctx; @@ -40,7 +37,7 @@ static void i2c_nrfx_twi_rtio_complete(const struct device *dev, int status); static bool i2c_nrfx_twi_rtio_msg_start(const struct device *dev, uint8_t flags, uint8_t *buf, size_t buf_len, uint16_t i2c_addr) { - struct i2c_nrfx_twi_common_data *data = dev->data; + const struct i2c_nrfx_twi_config *config = dev->config; struct i2c_nrfx_twi_rtio_data *const dev_data = dev->data; struct i2c_rtio *ctx = dev_data->ctx; int ret = 0; @@ -49,13 +46,13 @@ static bool i2c_nrfx_twi_rtio_msg_start(const struct device *dev, uint8_t flags, /** Enabling while already enabled ends up in a failed assertion: skip it. */ if (!dev_data->twi_enabled) { - nrfx_twi_enable(&data->twi); + nrfx_twi_enable(&config->twi); dev_data->twi_enabled = true; } ret = i2c_nrfx_twi_msg_transfer(dev, flags, buf, buf_len, i2c_addr, more_msgs); if (ret != 0) { - nrfx_twi_disable(&data->twi); + nrfx_twi_disable(&config->twi); dev_data->twi_enabled = false; return i2c_rtio_complete(ctx, ret); @@ -115,13 +112,14 @@ static bool i2c_nrfx_twi_rtio_start(const struct device *dev) static void i2c_nrfx_twi_rtio_complete(const struct device *dev, int status) { /** Finalize if there are no more pending xfers */ + const struct i2c_nrfx_twi_config *config = dev->config; struct i2c_nrfx_twi_rtio_data *data = dev->data; struct i2c_rtio *const ctx = data->ctx; if (i2c_rtio_complete(ctx, status)) { (void)i2c_nrfx_twi_rtio_start(dev); } else { - nrfx_twi_disable(&data->twi); + nrfx_twi_disable(&config->twi); data->twi_enabled = false; } } @@ -151,7 +149,7 @@ static int i2c_nrfx_twi_rtio_recover_bus(const struct device *dev) return i2c_rtio_recover(ctx); } -static void event_handler(nrfx_twi_event_t const *p_event, void *p_context) +static void event_handler(nrfx_twi_evt_t const *p_event, void *p_context) { const struct device *dev = p_context; int status = 0; @@ -180,50 +178,56 @@ static DEVICE_API(i2c, i2c_nrfx_twi_rtio_driver_api) = { .iodev_submit = i2c_nrfx_twi_rtio_submit, }; -#define I2C_NRFX_TWI_RTIO_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(DT_DRV_INST(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(DT_DRV_INST(idx)) != \ - I2C_NRFX_TWI_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static struct i2c_nrfx_twi_rtio_data twi_##idx##_data = { \ - .twi = NRFX_TWI_INSTANCE(DT_INST_REG_ADDR(idx)), \ - .ctx = &_i2c##idx##_twi_rtio, \ - }; \ - static int twi_##idx##_init(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(idx), DT_INST_IRQ(idx, priority), \ - nrfx_twi_irq_handler, &twi_##idx##_data.twi, 0); \ - const struct i2c_nrfx_twi_config *config = dev->config; \ - const struct i2c_nrfx_twi_rtio_data *dev_data = dev->data; \ - int err = pinctrl_apply_state(config->pcfg, \ - PINCTRL_STATE_DEFAULT); \ - if (err < 0) { \ - return err; \ - } \ - i2c_rtio_init(dev_data->ctx, dev); \ - return i2c_nrfx_twi_init(dev); \ - } \ - I2C_RTIO_DEFINE(_i2c##idx##_twi_rtio, \ - DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ - DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ - PINCTRL_DT_INST_DEFINE(idx); \ - static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ - .config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(DT_DRV_INST(idx)), \ - }, \ - .event_handler = event_handler, \ - .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \ - }; \ - PM_DEVICE_DT_INST_DEFINE(idx, twi_nrfx_pm_action); \ - I2C_DEVICE_DT_INST_DEFINE(idx, \ - twi_##idx##_init, \ - PM_DEVICE_DT_INST_GET(idx), \ - &twi_##idx##_data, \ - &twi_##idx##z_config, \ - POST_KERNEL, \ - CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twi_rtio_driver_api) - -DT_INST_FOREACH_STATUS_OKAY(I2C_NRFX_TWI_RTIO_DEVICE) +#define I2C_NRFX_TWI_RTIO_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(idx) != \ + I2C_NRFX_TWI_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static int twi_##idx##_init(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ + nrfx_isr, nrfx_twi_##idx##_irq_handler, 0); \ + const struct i2c_nrfx_twi_config *config = dev->config; \ + const struct i2c_nrfx_twi_rtio_data *dev_data = dev->data; \ + int err = pinctrl_apply_state(config->pcfg, \ + PINCTRL_STATE_DEFAULT); \ + if (err < 0) { \ + return err; \ + } \ + i2c_rtio_init(dev_data->ctx, dev); \ + return i2c_nrfx_twi_init(dev); \ + } \ + I2C_RTIO_DEFINE(_i2c##idx##_twi_rtio, \ + DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ + DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ + static struct i2c_nrfx_twi_rtio_data twi_##idx##_data = { \ + .ctx = &_i2c##idx##_twi_rtio, \ + }; \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static const struct i2c_nrfx_twi_config twi_##idx##z_config = { \ + .twi = NRFX_TWI_INSTANCE(idx), \ + .config = { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + }; \ + PM_DEVICE_DT_DEFINE(I2C(idx), twi_nrfx_pm_action); \ + I2C_DEVICE_DT_DEFINE(I2C(idx), \ + twi_##idx##_init, \ + PM_DEVICE_DT_GET(I2C(idx)), \ + &twi_##idx##_data, \ + &twi_##idx##z_config, \ + POST_KERNEL, \ + CONFIG_I2C_INIT_PRIORITY, \ + &i2c_nrfx_twi_rtio_driver_api) + +#ifdef CONFIG_HAS_HW_NRF_TWI0 +I2C_NRFX_TWI_RTIO_DEVICE(0); +#endif + +#ifdef CONFIG_HAS_HW_NRF_TWI1 +I2C_NRFX_TWI_RTIO_DEVICE(1); +#endif diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 898051f0ef17..62fd8f0b0463 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -276,7 +276,17 @@ config NRFX_TIMER bool "TIMER driver" config NRFX_TWI - bool "NRFX driver for TWI peripheral" + bool + +config NRFX_TWI0 + bool "TWI0 driver instance" + depends on $(dt_nodelabel_exists,i2c0) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) + select NRFX_TWI + +config NRFX_TWI1 + bool "TWI1 driver instance" + depends on $(dt_nodelabel_exists,i2c1) && (SOC_SERIES_NRF51 || SOC_SERIES_NRF52) + select NRFX_TWI config NRFX_TWIM bool "NRFX driver for TWIM peripheral" diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index d52a67c3343e..7f40716bffec 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -378,6 +378,12 @@ #ifdef CONFIG_NRFX_TWI_LOG #define NRFX_TWI_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_TWI0 +#define NRFX_TWI0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_TWI1 +#define NRFX_TWI1_ENABLED 1 +#endif #ifdef CONFIG_NRFX_TWIM #define NRFX_TWIM_ENABLED 1 diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 1e3c19850835..a19634b16864 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -297,6 +297,12 @@ config HAS_HW_NRF_TIMER136 config HAS_HW_NRF_TIMER137 def_bool $(dt_nodelabel_enabled_with_compat,timer137,$(DT_COMPAT_NORDIC_NRF_TIMER)) +config HAS_HW_NRF_TWI0 + def_bool $(dt_nodelabel_enabled_with_compat,i2c0,$(DT_COMPAT_NORDIC_NRF_TWI)) + +config HAS_HW_NRF_TWI1 + def_bool $(dt_nodelabel_enabled_with_compat,i2c1,$(DT_COMPAT_NORDIC_NRF_TWI)) + config HAS_HW_NRF_UART0 def_bool $(dt_nodelabel_enabled_with_compat,uart0,$(DT_COMPAT_NORDIC_NRF_UART)) From ed2131a34bf920542683a173884954d385313ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:55 +0200 Subject: [PATCH 2726/3334] Revert "[nrf fromtree] drivers: timer: nrf_rtc: Align to nrfx 4.1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7ec091469ebd415dc19a24433eeafda5cb953da2. Signed-off-by: Andrzej Głąbek --- drivers/timer/nrf_rtc_timer.c | 8 ++++---- modules/hal_nordic/nrfx/Kconfig | 27 +++++++++++++++++++++++++- modules/hal_nordic/nrfx/nrfx_kconfig.h | 15 ++++++++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index db49e1ed8b51..2abc183ad0b9 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -736,10 +736,10 @@ static void int_event_disable_rtc(void) #if !CUSTOM_COUNTER_BIT_WIDTH NRF_RTC_INT_OVERFLOW_MASK | #endif - NRF_RTC_INT_COMPARE_0_MASK | - NRF_RTC_INT_COMPARE_1_MASK | - NRF_RTC_INT_COMPARE_2_MASK | - NRF_RTC_INT_COMPARE_3_MASK; + NRF_RTC_INT_COMPARE0_MASK | + NRF_RTC_INT_COMPARE1_MASK | + NRF_RTC_INT_COMPARE2_MASK | + NRF_RTC_INT_COMPARE3_MASK; /* Reset interrupt enabling to expected reset values */ nrfy_rtc_int_disable(RTC, mask); diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 62fd8f0b0463..99855ed401cc 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -228,7 +228,32 @@ config NRFX_RRAMC depends on $(dt_nodelabel_exists,rram_controller) config NRFX_RTC - bool "RTC driver" + bool + +config NRFX_RTC0 + bool "RTC0 driver instance" + depends on $(dt_nodelabel_exists,rtc0) + select NRFX_RTC + +config NRFX_RTC1 + bool "RTC1 driver instance" + depends on $(dt_nodelabel_exists,rtc1) + select NRFX_RTC + +config NRFX_RTC2 + bool "RTC2 driver instance" + depends on $(dt_nodelabel_exists,rtc2) + select NRFX_RTC + +config NRFX_RTC130 + bool "RTC130 driver instance" + depends on $(dt_nodelabel_exists,rtc130) + select NRFX_RTC + +config NRFX_RTC131 + bool "RTC131 driver instance" + depends on $(dt_nodelabel_exists,rtc131) + select NRFX_RTC config NRFX_SAADC bool "SAADC driver" diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index 7f40716bffec..d98d9c03d04a 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -298,6 +298,21 @@ #ifdef CONFIG_NRFX_RTC_LOG #define NRFX_RTC_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_RTC0 +#define NRFX_RTC0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_RTC1 +#define NRFX_RTC1_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_RTC2 +#define NRFX_RTC2_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_RTC130 +#define NRFX_RTC130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_RTC131 +#define NRFX_RTC131_ENABLED 1 +#endif #ifdef CONFIG_NRFX_SAADC #define NRFX_SAADC_ENABLED 1 From cccbd5152acf8ff9074ecac4c6ddf052c0225c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:55 +0200 Subject: [PATCH 2727/3334] Revert "[nrf fromtree] modules: hal_nordic: nrfx: bump API to version 4.1.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 69143f1367a788a4abc68c1f8e9a105a3eed7744. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/nrfx/nrfx_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index 9e909dcfe837..f006240844e5 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -9,7 +9,7 @@ /* Define nrfx API version used in Zephyr. */ #define NRFX_CONFIG_API_VER_MAJOR 4 -#define NRFX_CONFIG_API_VER_MINOR 1 +#define NRFX_CONFIG_API_VER_MINOR 0 #define NRFX_CONFIG_API_VER_MICRO 0 /* Macros used in zephyr-specific config files. */ From b8dcf0b1063a0966182ff92e1a7fd7531514738c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:56 +0200 Subject: [PATCH 2728/3334] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 42cd30f6f202fa63f4cc70a90d7da3820edc1308. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 256f2d8f43b8..39e815afc199 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,7 +17,6 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -38,10 +37,6 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { - status = "okay"; -}; - &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; From a8cf65bbe52c150c05a15a31cc4514e5b0f6b68f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:56 +0200 Subject: [PATCH 2729/3334] Revert "[nrf noup] dts: choose a psa-rng for entropy for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8334d4c11931685c35c0d25ef338bb9f7b40dfa0. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 39e815afc199..37425bc9a430 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &psa_rng; + zephyr,entropy = &rng; }; soc { @@ -27,13 +27,13 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "disabled"; + status = "okay"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "okay"; + status = "disabled"; }; }; From 6e6e5099d0b44f8832615cfbe20f39f30b9469c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:56 +0200 Subject: [PATCH 2730/3334] Revert "[nrf fromtree] snippets: nordic: flpr: Define flpr snippet for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit daa5c8e7571ef38fa5ca34d692ca94734629bf9c. Signed-off-by: Andrzej Głąbek --- snippets/nordic/nordic-flpr/snippet.yml | 3 -- .../nordic-flpr/soc/nrf7120_cpuapp.overlay | 37 ------------------- 2 files changed, 40 deletions(-) delete mode 100644 snippets/nordic/nordic-flpr/soc/nrf7120_cpuapp.overlay diff --git a/snippets/nordic/nordic-flpr/snippet.yml b/snippets/nordic/nordic-flpr/snippet.yml index 4fbb7c14c056..1ad4ec54e666 100644 --- a/snippets/nordic/nordic-flpr/snippet.yml +++ b/snippets/nordic/nordic-flpr/snippet.yml @@ -12,6 +12,3 @@ boards: /.*/nrf54lm20a/cpuapp/: append: EXTRA_DTC_OVERLAY_FILE: soc/nrf54lm20a_cpuapp.overlay - /.*/nrf7120/cpuapp/: - append: - EXTRA_DTC_OVERLAY_FILE: soc/nrf7120_cpuapp.overlay diff --git a/snippets/nordic/nordic-flpr/soc/nrf7120_cpuapp.overlay b/snippets/nordic/nordic-flpr/soc/nrf7120_cpuapp.overlay deleted file mode 100644 index 2bc48ae60b9a..000000000000 --- a/snippets/nordic/nordic-flpr/soc/nrf7120_cpuapp.overlay +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&ram03_sram { - cpuflpr_sram_code_data: sram@0 { - compatible = "mmio-sram"; - reg = <0x0 DT_SIZE_K(116)>; - status = "reserved"; - }; -}; - -&mram_controller { - cpuflpr_mram: mram@3de000 { - compatible = "soc-nv-flash"; - reg = <0x3de000 DT_SIZE_K(116)>; - ranges = <0x0 0x3de000 DT_SIZE_K(116)>; - erase-block-size = <4096>; - write-block-size = <4>; - #address-cells = <1>; - #size-cells = <1>; - }; -}; - -&uart00 { - status = "reserved"; -}; - -&cpuflpr_vpr { - execution-memory = <&cpuflpr_sram_code_data>; - source-memory = <&cpuflpr_mram>; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; From f0c7dd6fc34c32623aa690b2ee82dc1617aaaf0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:57 +0200 Subject: [PATCH 2731/3334] Revert "[nrf fromtree] boards: nordic: nrf7120dk: Align button and led GPIOs with DK" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 754b3cf91618ecd9300bf16dfe37b86ecfac6e88. Signed-off-by: Andrzej Głąbek --- .../nrf7120dk/nrf7120dk_nrf7120-common.dtsi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-common.dtsi b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-common.dtsi index a48e0202c131..50a219c56a0d 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-common.dtsi +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-common.dtsi @@ -11,22 +11,22 @@ compatible = "gpio-leds"; led0: led_0 { - gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; label = "Green LED 0"; }; led1: led_1 { - gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; label = "Green LED 1"; }; led2: led_2 { - gpios = <&gpio4 10 GPIO_ACTIVE_HIGH>; + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; label = "Green LED 2"; }; led3: led_3 { - gpios = <&gpio4 11 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; label = "Green LED 3"; }; }; @@ -49,25 +49,25 @@ compatible = "gpio-keys"; button0: button_0 { - gpios = <&gpio1 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio1 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 0"; zephyr,code = ; }; button1: button_1 { - gpios = <&gpio1 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 1"; zephyr,code = ; }; button2: button_2 { - gpios = <&gpio1 14 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 2"; zephyr,code = ; }; button3: button_3 { - gpios = <&gpio1 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + gpios = <&gpio0 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; label = "Push button 3"; zephyr,code = ; }; From 146d8bdb1415433acc938124315c7402c7e390ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:57 +0200 Subject: [PATCH 2732/3334] Revert "[nrf fromtree] boards: nordic: nrf7120dk: Set entropy to PSA RNG as default for ns builds" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 325e35c14e899a1a32d843bb0a9a0072de707241. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts index 66baaac5b7d6..56f2104393d4 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.dts @@ -17,13 +17,6 @@ chosen { zephyr,code-partition = &slot0_ns_partition; zephyr,sram = &cpuapp_sram; - zephyr,entropy = &psa_rng; - }; - - /delete-node/ rng; - - psa_rng: psa-rng { - status = "okay"; }; }; From 07092c923a3bb59cac2c13697241c14c5cceb686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:57 +0200 Subject: [PATCH 2733/3334] Revert "[nrf fromtree] dts: arm: nordic: Disable psa_rng since not default entropy for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5669dbda0fb38d9e6d1b9a4448aff6b1e6299326. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 37425bc9a430..829836660cad 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { From b2332f6a767a3e9d534d072efe810f231bac0776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:58 +0200 Subject: [PATCH 2734/3334] Revert "[nrf fromtree] soc/Kconfig: Create a config for nRF71 series soc compatible" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a166a8e44c3652445d366b4198a05180cbc37a26. Signed-off-by: Andrzej Głąbek --- drivers/entropy/Kconfig.nrf_cracen | 2 +- modules/hal_nordic/nrfx/Kconfig | 2 +- soc/nordic/Kconfig | 3 --- soc/nordic/nrf71/Kconfig | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/entropy/Kconfig.nrf_cracen b/drivers/entropy/Kconfig.nrf_cracen index 37753b44fc5b..903a304c6808 100644 --- a/drivers/entropy/Kconfig.nrf_cracen +++ b/drivers/entropy/Kconfig.nrf_cracen @@ -5,7 +5,7 @@ config ENTROPY_NRF_CRACEN_CTR_DRBG bool "nRF entropy driver based on the CRACEN CTR_DRBG driver" default y depends on DT_HAS_NORDIC_NRF_CRACEN_CTRDRBG_ENABLED - depends on SOC_COMPATIBLE_NRF54LX || SOC_COMPATIBLE_NRF71 + depends on SOC_COMPATIBLE_NRF54LX || SOC_COMPATIBLE_NRF7120_ENGA select ENTROPY_HAS_DRIVER select NRFX_CRACEN help diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 99855ed401cc..06bce944b449 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -54,7 +54,7 @@ config NRFX_COMP config NRFX_CRACEN bool "CRACEN drivers" - depends on SOC_COMPATIBLE_NRF54LX || SOC_COMPATIBLE_NRF71 + depends on SOC_COMPATIBLE_NRF54LX select NRFX_CRACEN_BSIM_SUPPORT if SOC_SERIES_BSIM_NRFXX config NRFX_CRACEN_BSIM_SUPPORT diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 6a8b8a0810e4..22ae416bfbfa 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -43,9 +43,6 @@ config SOC_COMPATIBLE_NRF54LM20A config SOC_COMPATIBLE_NRF54LM20A_CPUAPP bool -config SOC_COMPATIBLE_NRF71 - bool - config SOC_COMPATIBLE_NRF7120_ENGA bool diff --git a/soc/nordic/nrf71/Kconfig b/soc/nordic/nrf71/Kconfig index 5c5d6056aff1..12f8fe77a695 100644 --- a/soc/nordic/nrf71/Kconfig +++ b/soc/nordic/nrf71/Kconfig @@ -4,7 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF71 - select SOC_COMPATIBLE_NRF71 select HAS_NRFX select HAS_NORDIC_DRIVERS select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE From ad32318e5f0478a723d029edaf8cf7a83fd6830d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:59 +0200 Subject: [PATCH 2735/3334] Revert "[nrf fromtree] dts: nordic: nrf7120: Update MRAM partitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit febf3bb2b20c4278e8ab59e898c54addf1dc8c94. Signed-off-by: Andrzej Głąbek --- dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi | 4 ++-- dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi | 8 ++++---- dts/vendor/nordic/nrf7120_enga.dtsi | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi b/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi index e33596587028..7995093515f5 100644 --- a/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi +++ b/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi @@ -16,9 +16,9 @@ clic: &cpuflpr_clic {}; /delete-node/ &cpuapp_mram; &mram_controller { - cpuflpr_mram: mram@3de000 { + cpuflpr_mram: mram@3e0000 { compatible = "soc-nv-flash"; - reg = <0x3de000 DT_SIZE_K(116)>; + reg = <0x3e0000 DT_SIZE_K(116)>; erase-block-size = <4096>; write-block-size = <4>; }; diff --git a/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi index 64d5e69e2068..4783e495b3ea 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi @@ -7,7 +7,7 @@ */ &cpuapp_mram { - reg = <0x0 DT_SIZE_K(4076)>; + reg = <0x0 DT_SIZE_K(4084)>; }; /* These partition sizes assume no FLPR area in MRAM */ @@ -25,17 +25,17 @@ slot0_partition: partition@10000 { label = "image-0"; - reg = <0x00010000 DT_SIZE_K(1988)>; + reg = <0x00010000 DT_SIZE_K(1992)>; }; slot1_partition: partition@202000 { label = "image-1"; - reg = <0x00201000 DT_SIZE_K(1988)>; + reg = <0x00202000 DT_SIZE_K(1992)>; }; storage_partition: partition@3f4000 { label = "storage"; - reg = <0x003f2000 DT_SIZE_K(36)>; + reg = <0x003f4000 DT_SIZE_K(36)>; }; }; }; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index e8b65d516d49..6179e1703d35 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -961,8 +961,8 @@ cpuapp_mram: mram@0 { compatible = "soc-nv-flash"; - reg = <0 DT_SIZE_K(4076)>; - ranges = <0x0 0 DT_SIZE_K(4076)>; + reg = <0 DT_SIZE_K(4084)>; + ranges = <0x0 0 DT_SIZE_K(4084)>; erase-block-size = <4096>; write-block-size = <4>; #address-cells = <1>; From 28fa062f95c40c4fcff291a8dd2eddd221881d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:59 +0200 Subject: [PATCH 2736/3334] Revert "[nrf fromtree] dts: nordic: nRF7120: Add missing power register in dtsi" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b37bb7abf11581e0e9c38888acc3e2d303d6276d. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf7120_enga.dtsi | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index 6179e1703d35..105743cec16a 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -874,32 +874,6 @@ status = "disabled"; }; - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <261 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@500 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x500 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@504 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x504 0x1>; - status = "disabled"; - }; - }; - audio_auxpll: auxpll@130000 { compatible = "nordic,nrf-auxpll"; reg = <0x130000 0x1000>; From 178fbaec2de57ada6a1f43ba8b987c8b53ea050f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:58:59 +0200 Subject: [PATCH 2737/3334] Revert "[nrf fromtree] dts: nordic: edit auxpll nodes to remove out-div macros" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fcd99e9b5d45d7609125b3c0b2a8b2c75b31ef01. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf54h20.dtsi | 2 +- dts/vendor/nordic/nrf7120_enga.dtsi | 2 +- dts/vendor/nordic/nrf9280.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index b73f519b56ad..7c520011a208 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -694,7 +694,7 @@ #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; nordic,frequency = ; - nordic,out-div = <2>; + nordic,out-div = ; nordic,out-drive = <0>; nordic,current-tune = <6>; nordic,sdm-disable; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index 105743cec16a..d5ba811d2d3e 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -885,7 +885,7 @@ * not defined yet */ nordic,ficrs = <&ficr 0>; - nordic,out-div = <12>; + nordic,out-div = ; nordic,out-drive = <0>; nordic,current-tune = <9>; nordic,sdm-disable; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 6ab6f6e439da..97a1bf7495b0 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -450,7 +450,7 @@ #clock-cells = <0>; nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; nordic,frequency = ; - nordic,out-div = <2>; + nordic,out-div = ; nordic,out-drive = <0>; nordic,current-tune = <6>; nordic,sdm-disable; From 8e26f76f3b71a4d21a5f2697927a6fc65dc308de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:00 +0200 Subject: [PATCH 2738/3334] Revert "[nrf fromtree] drivers: nrf_auxpll: Fix frequency calculation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit df8d673f1873b85e17210830db89bf5f7443fd57. Signed-off-by: Andrzej Głąbek --- .../clock_control/clock_control_nrf_auxpll.c | 41 +++++-------------- dts/bindings/clock/nordic,nrf-auxpll.yaml | 16 ++++---- include/zephyr/dt-bindings/clock/nrf-auxpll.h | 10 +++++ 3 files changed, 29 insertions(+), 38 deletions(-) diff --git a/drivers/clock_control/clock_control_nrf_auxpll.c b/drivers/clock_control/clock_control_nrf_auxpll.c index 3fc747b96df5..0aa4c059d964 100644 --- a/drivers/clock_control/clock_control_nrf_auxpll.c +++ b/drivers/clock_control/clock_control_nrf_auxpll.c @@ -30,6 +30,15 @@ CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_USB24M, NRF_AUXPLL_FREQUENCY_USB_2 CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_AUDIO_48K, NRF_AUXPLL_FREQUENCY_AUDIO_48K); CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_FREQ_DIV_MAX, NRF_AUXPLL_FREQUENCY_DIV_MAX); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_1, NRF_AUXPLL_CTRL_OUTSEL_DIV_1); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_2, NRF_AUXPLL_CTRL_OUTSEL_DIV_2); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_3, NRF_AUXPLL_CTRL_OUTSEL_DIV_3); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_4, NRF_AUXPLL_CTRL_OUTSEL_DIV_4); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_6, NRF_AUXPLL_CTRL_OUTSEL_DIV_6); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_8, NRF_AUXPLL_CTRL_OUTSEL_DIV_8); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_12, NRF_AUXPLL_CTRL_OUTSEL_DIV_12); +CHECK_DTS_BINDING_VS_MDK(NRF_AUXPLL_OUT_DIV_16, NRF_AUXPLL_CTRL_OUTSEL_DIV_16); + /* maximum lock time in us, >10x time observed experimentally */ #define AUXPLL_LOCK_TIME_MAX_US 20000 /* lock wait step in us*/ @@ -47,37 +56,9 @@ struct clock_control_nrf_auxpll_config { uint32_t ficr_ctune; nrf_auxpll_config_t cfg; nrf_auxpll_freq_div_ratio_t frequency; - uint8_t out_div; + nrf_auxpll_ctrl_outsel_t out_div; }; -/* Helper function to convert out_div to register AUXPLLCTRL.OUTSEL value */ -static inline void set_out_div(const struct clock_control_nrf_auxpll_config *config) -{ - nrf_auxpll_ctrl_outsel_t out_div_nrfx; - uint8_t out_div_dts = config->out_div; - - switch (out_div_dts) { - case NRF_AUXPLL_CTRL_OUTSEL_DIV_6: - out_div_nrfx = (nrf_auxpll_ctrl_outsel_t)AUXPLL_AUXPLLCTRL_OUTSEL_OUTSEL_Div6; - break; - case NRF_AUXPLL_CTRL_OUTSEL_DIV_8: - out_div_nrfx = (nrf_auxpll_ctrl_outsel_t)AUXPLL_AUXPLLCTRL_OUTSEL_OUTSEL_Div8; - break; - case NRF_AUXPLL_CTRL_OUTSEL_DIV_12: - out_div_nrfx = (nrf_auxpll_ctrl_outsel_t)AUXPLL_AUXPLLCTRL_OUTSEL_OUTSEL_Div12; - break; - case NRF_AUXPLL_CTRL_OUTSEL_DIV_16: - out_div_nrfx = (nrf_auxpll_ctrl_outsel_t)AUXPLL_AUXPLLCTRL_OUTSEL_OUTSEL_Div16; - break; - default: - /* Values less than 5 align with the OUTSEL register value */ - out_div_nrfx = out_div_dts; - break; - } - - nrf_auxpll_ctrl_outsel_set(config->auxpll, out_div_nrfx); -} - static int clock_control_nrf_auxpll_on(struct dev_data_auxpll *dev_data) { const struct clock_control_nrf_auxpll_config *config = dev_data->dev->config; @@ -209,7 +190,7 @@ static int clock_control_nrf_auxpll_init(const struct device *dev) nrf_auxpll_lock(config->auxpll); nrf_auxpll_trim_ctune_set(config->auxpll, sys_read8(config->ficr_ctune)); nrf_auxpll_config_set(config->auxpll, &config->cfg); - set_out_div(config); + nrf_auxpll_ctrl_outsel_set(config->auxpll, config->out_div); nrf_auxpll_unlock(config->auxpll); nrf_auxpll_ctrl_mode_set(config->auxpll, NRF_AUXPLL_CTRL_MODE_LOCKED); diff --git a/dts/bindings/clock/nordic,nrf-auxpll.yaml b/dts/bindings/clock/nordic,nrf-auxpll.yaml index e14dd7699480..c9e4bf1c2379 100644 --- a/dts/bindings/clock/nordic,nrf-auxpll.yaml +++ b/dts/bindings/clock/nordic,nrf-auxpll.yaml @@ -48,14 +48,14 @@ properties: nordic,out-div: type: int enum: - - 1 - - 2 - - 3 - - 4 - - 6 - - 8 - - 12 - - 16 + - 1 # Division of 1 + - 2 # Division of 2 + - 3 # Division of 3 + - 4 # Division of 4 + - 5 # Division of 6 + - 6 # Division of 8 + - 7 # Division of 12 + - 8 # Division of 16 description: PLL output divider. Valid values shown in dt-bindings/clock/nrf-auxpll.h. nordic,out-drive: diff --git a/include/zephyr/dt-bindings/clock/nrf-auxpll.h b/include/zephyr/dt-bindings/clock/nrf-auxpll.h index a07c96997597..d40940b6a62f 100644 --- a/include/zephyr/dt-bindings/clock/nrf-auxpll.h +++ b/include/zephyr/dt-bindings/clock/nrf-auxpll.h @@ -13,4 +13,14 @@ #define NRF_AUXPLL_FREQ_DIV_AUDIO_48K 39845 #define NRF_AUXPLL_FREQ_DIV_MAX 65535 +#define NRF_AUXPLL_OUT_DIV_DISABLED 0 +#define NRF_AUXPLL_OUT_DIV_1 1 +#define NRF_AUXPLL_OUT_DIV_2 2 +#define NRF_AUXPLL_OUT_DIV_3 3 +#define NRF_AUXPLL_OUT_DIV_4 4 +#define NRF_AUXPLL_OUT_DIV_6 5 +#define NRF_AUXPLL_OUT_DIV_8 6 +#define NRF_AUXPLL_OUT_DIV_12 7 +#define NRF_AUXPLL_OUT_DIV_16 8 + #endif /* #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRF_AUXPLL_H_ */ From 91bb344d05f3212e73a8c42774bbe4c0740ba4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:00 +0200 Subject: [PATCH 2739/3334] Revert "[nrf noup] dts: nrf54h20: fix formatting error" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b839e83e85f04fb7e06a001fd5c7c88c26125675. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf54h20.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 7c520011a208..ca2d475ec00b 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -507,7 +507,6 @@ compatible = "nordic,bt-hci-sdc"; status = "disabled"; }; - bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From f98793489b16f9a30f8156d5a3391ee96d213d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:00 +0200 Subject: [PATCH 2740/3334] Revert "[nrf fromtree] soc: nordic: uicr: add support for UICR.POLICY_PERIPHCONFSTAGE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e1bbf3144cb8af4ae01c2f42a048e8254eb87cdc. Signed-off-by: Andrzej Głąbek --- soc/nordic/common/uicr/Kconfig.gen_uicr | 31 ------------------- .../common/uicr/gen_uicr/CMakeLists.txt | 6 ---- 2 files changed, 37 deletions(-) diff --git a/soc/nordic/common/uicr/Kconfig.gen_uicr b/soc/nordic/common/uicr/Kconfig.gen_uicr index 0e726e6712bb..4ee6af87eaef 100644 --- a/soc/nordic/common/uicr/Kconfig.gen_uicr +++ b/soc/nordic/common/uicr/Kconfig.gen_uicr @@ -274,35 +274,4 @@ config GEN_UICR_SECONDARY_PROTECTEDMEM_SIZE_BYTES endif # GEN_UICR_SECONDARY -choice GEN_UICR_POLICY_PERIPHCONF_STAGE - bool "UICR.POLICY_PERIPHCONFSTAGE" - default GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL - help - Sets the behavior of the IronSide SE PERIPHCONF service APIs at boot. - -config GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL - bool "Normal operation stage" - help - The API starts in the normal operation stage, meaning that no explicit - API call is needed to finish initialization. - -config GEN_UICR_POLICY_PERIPHCONF_STAGE_INIT - bool "Initialization stage" - help - The API starts in the initialization stage, which gives permission - to write any register supported by the UICR PERIPHCONF blob without CPU based - restrictions. To finish initialization, the application must notify IronSide SE - via the ironside_se_periphconf_finish_init() API. - - Enabling this policy option causes the generated UICR format version to be set - to >= 2.1, which requires IronSide SE v23.3.0+26 or higher to be installed. - -endchoice - -config GEN_UICR_POLICY_PERIPHCONF_STAGE_VALUE - hex - default 0xBD2328A8 if GEN_UICR_POLICY_PERIPHCONF_STAGE_INIT - default 0x1730C77F if GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL - default 0 - endmenu diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 81b5c59c63bd..fe30c1c1e150 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -82,7 +82,6 @@ set(protectedmem_args) set(periphconf_args) set(wdtstart_args) set(periphconf_elfs) -set(policy_args) set(merged_hex_file ${APPLICATION_BINARY_DIR}/zephyr/${CONFIG_KERNEL_BIN_NAME}.hex) set(secondary_periphconf_elfs) set(uicr_hex_file ${APPLICATION_BINARY_DIR}/zephyr/uicr.hex) @@ -268,10 +267,6 @@ if(CONFIG_GEN_UICR_SECONDARY) endif() endif() -if(CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_NORMAL) - list(APPEND policy_args --policy-periphconf-stage ${CONFIG_GEN_UICR_POLICY_PERIPHCONF_STAGE_VALUE}) -endif() - # Generate hex files (merged, uicr-only, periphconf-only, and secondary-periphconf-only) add_custom_command( OUTPUT ${merged_hex_file} ${uicr_hex_file} ${periphconf_hex_file} ${secondary_periphconf_hex_file} @@ -290,7 +285,6 @@ add_custom_command( ${securestorage_args} ${protectedmem_args} ${secondary_args} - ${policy_args} DEPENDS ${periphconf_elfs} ${secondary_periphconf_elfs} WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} COMMENT "Using gen_uicr.py to generate ${merged_hex_file}, ${uicr_hex_file}, ${periphconf_hex_file}, and ${secondary_periphconf_hex_file} from ${periphconf_elfs} ${secondary_periphconf_elfs}" From 6181f5908a69cf9791dd2176bdd6819116c03779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:01 +0200 Subject: [PATCH 2741/3334] Revert "[nrf fromtree] soc: nordic: uicr: make it possible to keep the PERIPHCONF section" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3b739f795fe013e49b2c35646956df21d24f88ff. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/ironside/se/Kconfig | 25 ++----------------- modules/hal_nordic/ironside/se/uicr.ld | 8 ------ .../common/uicr/gen_uicr/CMakeLists.txt | 6 ----- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index 04e271c0b78b..99692fb228e0 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -50,27 +50,13 @@ endif # IRONSIDE_SE_DVFS menuconfig NRF_PERIPHCONF_SECTION bool "Global peripheral initialization section" depends on LINKER_DEVNULL_SUPPORT + imply LINKER_DEVNULL_MEMORY help Include static global domain peripheral initialization values from the - build in a dedicated section. The section is either stripped from the - firmware binary or kept as constant data, depending on how it will be - loaded at runtime. + build in a dedicated section in the devnull region. if NRF_PERIPHCONF_SECTION -config NRF_PERIPHCONF_SECTION_STRIP - bool "Strip the section from the binary" - default y if !NRF_PERIPHCONF_SECTION_KEEP_BY_DEFAULT - imply LINKER_DEVNULL_MEMORY - help - Strip the PERIPHCONF section from the firmware binary. - If the UICR generator image is enabled, it will include the stripped section - in the generated UICR PERIPHCONF blob. - - When this is disabled, the PERIPHCONF section will remain as data in the binary, - and will not included in the UICR PERIPHCONF blob. Instead, it is expected that - it will be loaded via the ironside_se_periphconf_write() API. - config NRF_PERIPHCONF_GENERATE_ENTRIES bool "Generate PERIPHCONF entries source file" default y @@ -88,11 +74,4 @@ config NRF_PERIPHCONF_GENERATE_ENTRIES_LOCK endif # NRF_PERIPHCONF_SECTION -config NRF_PERIPHCONF_SECTION_KEEP_BY_DEFAULT - bool "Keep the PERIPHCONF section by default (set by build system)" - help - This is set from Sysbuild to change the default behavior for the image so that - CONFIG_NRF_PERIPHCONF_SECTION_STRIP=n unless explicitly configured otherwise. - To override this behavior, set CONFIG_NRF_PERIPHCONF_SECTION_STRIP=y directly. - endmenu # IronSide SE diff --git a/modules/hal_nordic/ironside/se/uicr.ld b/modules/hal_nordic/ironside/se/uicr.ld index acfc52242893..adc2e2cc3f64 100644 --- a/modules/hal_nordic/ironside/se/uicr.ld +++ b/modules/hal_nordic/ironside/se/uicr.ld @@ -5,15 +5,7 @@ #include -#if defined(CONFIG_NRF_PERIPHCONF_SECTION_STRIP) - SECTION_PROLOGUE(periphconf_entry,(COPY),SUBALIGN(Z_LINK_ITERABLE_SUBALIGN)) { Z_LINK_ITERABLE(periphconf_entry); } GROUP_ROM_LINK_IN(DEVNULL_REGION, DEVNULL_REGION) - -#else - -ITERABLE_SECTION_ROM(periphconf_entry, Z_LINK_ITERABLE_SUBALIGN) - -#endif diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index fe30c1c1e150..6f7f69649fd3 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -169,12 +169,6 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF) endif() if(EXISTS ${_dir}/zephyr/zephyr.dts) - # If the PERIPHCONF is configured to remain in the firmware, do not include it here. - parse_kconfig_value(${_dir}/zephyr/.config CONFIG_NRF_PERIPHCONF_SECTION_STRIP strip_periphconf) - if(NOT (strip_periphconf STREQUAL "y")) - continue() - endif() - # Read CONFIG_KERNEL_BIN_NAME from the sibling's .config file parse_kconfig_value(${_dir}/zephyr/.config CONFIG_KERNEL_BIN_NAME kernel_bin_name) set(kernel_elf_path ${_dir}/zephyr/${kernel_bin_name}.elf) From 2b142c9d088afa9f78f659dc78fc12cc0fba796a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:01 +0200 Subject: [PATCH 2742/3334] Revert "[nrf fromtree] soc: nordic: uicr: use IRONSIDE_SUPPORT_DIR for the script location" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4712a645d8625a5c28520c89f440e1f463be3960. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/ironside/se/CMakeLists.txt | 9 ++++++++- .../hal_nordic/ironside/se/ironside_support_dir.cmake | 8 -------- soc/nordic/common/uicr/gen_uicr/CMakeLists.txt | 5 +---- 3 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 modules/hal_nordic/ironside/se/ironside_support_dir.cmake diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index 87dbeb333038..8532072b0b0a 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -1,7 +1,14 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -include(./ironside_support_dir.cmake) +# The IronSide source directory can be overridden by setting +# IRONSIDE_SUPPORT_DIR before invoking the build system. +zephyr_get(IRONSIDE_SUPPORT_DIR SYSBUILD GLOBAL) +if(NOT DEFINED IRONSIDE_SUPPORT_DIR) + set(IRONSIDE_SUPPORT_DIR + ${ZEPHYR_CURRENT_MODULE_DIR}/ironside CACHE PATH "IronSide Support Directory" + ) +endif() zephyr_include_directories(include) zephyr_include_directories(${IRONSIDE_SUPPORT_DIR}/se/include) diff --git a/modules/hal_nordic/ironside/se/ironside_support_dir.cmake b/modules/hal_nordic/ironside/se/ironside_support_dir.cmake deleted file mode 100644 index cb1d16ee3ac1..000000000000 --- a/modules/hal_nordic/ironside/se/ironside_support_dir.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# The IronSide source directory can be overridden by setting -# IRONSIDE_SUPPORT_DIR before invoking the build system. -zephyr_get(IRONSIDE_SUPPORT_DIR SYSBUILD GLOBAL) -if(NOT DEFINED IRONSIDE_SUPPORT_DIR) - set(IRONSIDE_SUPPORT_DIR - ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/ironside CACHE PATH "IronSide Support Directory" - ) -endif() diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index 6f7f69649fd3..d6af0c6cbb33 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -17,9 +17,6 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE} ) -# Needed since the CMakeLists.txt that would normally set this is not run in this image. -include(${ZEPHYR_BASE}/modules/hal_nordic/ironside/se/ironside_support_dir.cmake) - project(uicr) # Function to parse a Kconfig value from a .config file @@ -264,7 +261,7 @@ endif() # Generate hex files (merged, uicr-only, periphconf-only, and secondary-periphconf-only) add_custom_command( OUTPUT ${merged_hex_file} ${uicr_hex_file} ${periphconf_hex_file} ${secondary_periphconf_hex_file} - COMMAND ${PYTHON_EXECUTABLE} ${IRONSIDE_SUPPORT_DIR}/se/tool/ironside/__main__.py + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/ironside/se/tool/ironside/__main__.py gen-uicr --uicr-address ${UICR_ADDRESS} --out-merged-hex ${merged_hex_file} From af601078f56b00e227edf8841ba5573bb4018da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:02 +0200 Subject: [PATCH 2743/3334] Revert "[nrf fromtree] manifest: update hal_nordic revision and IronSide SE support code" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6cd491a81123732833c03634fdee97ac40add34b. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/ironside/se/CMakeLists.txt | 8 ------- modules/hal_nordic/ironside/se/Kconfig | 13 +---------- modules/hal_nordic/ironside/se/glue.c | 22 ------------------- .../se/scripts/gen_periphconf_entries.py | 8 +------ .../ironside/se/scripts/periphconf/builder.py | 14 +----------- west.yml | 2 +- 6 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 modules/hal_nordic/ironside/se/glue.c diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index 8532072b0b0a..50379a084cb9 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -18,7 +18,6 @@ zephyr_library_property(ALLOW_EMPTY TRUE) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_CALL ${IRONSIDE_SUPPORT_DIR}/se/src/ironside_se_api.c call.c - glue.c ) zephyr_library_sources_ifdef(CONFIG_IRONSIDE_SE_DVFS dvfs.c) @@ -27,12 +26,6 @@ if(CONFIG_NRF_PERIPHCONF_SECTION) endif() if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) - set(optional_args) - if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES_LOCK) - list(APPEND optional_args --lock) - else() - list(APPEND optional_args --no-lock) - endif() set(periphconf_entries_c_file ${PROJECT_BINARY_DIR}/periphconf_entries_generated.c) execute_process( COMMAND @@ -41,7 +34,6 @@ if(CONFIG_NRF_PERIPHCONF_GENERATE_ENTRIES) --soc ${CONFIG_SOC} --in-edt-pickle ${EDT_PICKLE} --out-periphconf-source ${periphconf_entries_c_file} - ${optional_args} WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMAND_ERROR_IS_FATAL ANY ) diff --git a/modules/hal_nordic/ironside/se/Kconfig b/modules/hal_nordic/ironside/se/Kconfig index 99692fb228e0..eae311bef6d0 100644 --- a/modules/hal_nordic/ironside/se/Kconfig +++ b/modules/hal_nordic/ironside/se/Kconfig @@ -55,23 +55,12 @@ menuconfig NRF_PERIPHCONF_SECTION Include static global domain peripheral initialization values from the build in a dedicated section in the devnull region. -if NRF_PERIPHCONF_SECTION - config NRF_PERIPHCONF_GENERATE_ENTRIES bool "Generate PERIPHCONF entries source file" default y + depends on NRF_PERIPHCONF_SECTION help Generate a C file containing PERIPHCONF entries based on the device configuration in the devicetree. -config NRF_PERIPHCONF_GENERATE_ENTRIES_LOCK - bool "Lock registers in PERIPHCONF" - default y - depends on NRF_PERIPHCONF_GENERATE_ENTRIES - help - Set the lock bit in registers that support it. - Disable this to allow the registers to be reconfigured after boot. - -endif # NRF_PERIPHCONF_SECTION - endmenu # IronSide SE diff --git a/modules/hal_nordic/ironside/se/glue.c b/modules/hal_nordic/ironside/se/glue.c deleted file mode 100644 index 130ed4eae002..000000000000 --- a/modules/hal_nordic/ironside/se/glue.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -void ironside_se_data_cache_writeback(void *addr, size_t size) -{ - sys_cache_data_flush_range(addr, size); -} - -void ironside_se_data_cache_invalidate(void *addr, size_t size) -{ - sys_cache_data_invd_range(addr, size); -} - -void ironside_se_data_cache_writeback_invalidate(void *addr, size_t size) -{ - sys_cache_data_flush_and_invd_range(addr, size); -} diff --git a/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py b/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py index f7b1537a7afc..b30d36f4c7f6 100644 --- a/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py +++ b/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py @@ -126,12 +126,6 @@ def parse_args() -> argparse.Namespace: "Used to look up soc specific hardware information" ), ) - parser.add_argument( - "--lock", - action=argparse.BooleanOptionalAction, - default=True, - help="Value to set for the lock bit in registers that support it.", - ) parser.add_argument( "--in-edt-pickle", type=argparse.FileType("rb"), @@ -152,7 +146,7 @@ def main() -> None: dt = pickle.load(args.in_edt_pickle) processor = dt_processor_id(dt) lookup_tables = lookup_tables_get(Soc.soc(args.soc), Family.family(args.soc)) - builder = PeriphconfBuilder(dt, lookup_tables, lock_value=args.lock) + builder = PeriphconfBuilder(dt, lookup_tables) # Application local peripherals if processor == ProcessorId.APPLICATION: diff --git a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py index 461b0de4f3c3..7c214b46ff09 100644 --- a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py +++ b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py @@ -98,20 +98,17 @@ def __init__( self, dt: EDT, lookup_tables: SocLookupTables, - lock_value: bool = True, ) -> None: """Builder class used to generate a PERIPHCONF C source file based on the devicetree. :param dt: Devicetree object. :param lookup_tables: Lookup table object containing soc-specific information. - :param lock_value: Lock bit value to set in the registers that support it. """ self._dt = dt self._hw_tables = lookup_tables self._processor_id = dt_processor_id(dt) self._owner_id = self._processor_id.default_owner_id - self._lock_value = lock_value self._macros = [] self._ipcmap_idx = 0 @@ -280,7 +277,6 @@ def _add_global_peripheral_spu_permissions( secure, dma_secure, self._owner_id.c_enum, - self._lock_value, ], comment=f"{spu_name}: {periph_label} permissions", ) @@ -350,7 +346,6 @@ def _add_nrf_gpiote_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, - self._lock_value, ], comment=f"{spu_name}: {instance_name} ch. {num} permissions", ) @@ -381,7 +376,6 @@ def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, - self._lock_value, ], comment=f"{spu_name}: {instance_name} ch. {num} permissions", ) @@ -396,7 +390,6 @@ def _add_nrf_dppic_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, - self._lock_value, ], comment=f"{spu_name}: {instance_name} ch. group {num} permissions", ) @@ -446,7 +439,6 @@ def _link_dppi_channels( [ Address(sub_ppib_addr), sub_ppib_ch, - True, ], comment=( f"SUB: {sub_ppib_name} ch. {sub_ppib_ch} => {pub_ppib_name} ch. {pub_ppib_ch}" @@ -459,7 +451,6 @@ def _link_dppi_channels( [ Address(pub_ppib_addr), pub_ppib_ch, - True, ], comment=( f"PUB: {sub_ppib_name} ch. {sub_ppib_ch} => {pub_ppib_name} ch. {pub_ppib_ch}" @@ -485,7 +476,6 @@ def _add_nrf_ipct_global_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, - self._lock_value, ], comment=f"{spu_name}: {instance_name} ch. {num} permissions", ) @@ -547,7 +537,7 @@ def _link_ipct_channel( self._macros.append( MacroCall( "PERIPHCONF_IPCMAP_CHANNEL_SOURCE", - [self._ipcmap_idx, source_domain.c_enum, source_ch, True], + [self._ipcmap_idx, source_domain.c_enum, source_ch], comment=( f"{source_domain.name} IPCT ch. {source_ch} => " f"{sink_domain.name} IPCT ch. {sink_ch}" @@ -583,7 +573,6 @@ def _add_nrf_grtc_spu_permissions(self, node: Node) -> None: num, secure, self._owner_id.c_enum, - self._lock_value, ], comment=f"{spu_name}: GRTC CC{num} permissions", ) @@ -707,7 +696,6 @@ def _configure_gpio_pin( num, secure, self._owner_id.c_enum, - self._lock_value, ], comment=f"{spu_name}: P{gpio_port}.{num} permissions", ) diff --git a/west.yml b/west.yml index 033982273c98..f1ca6eb10401 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 5c1df3fe9bc144e558b3506cef6cf33652bb2539 + revision: 63f2083ff9bc9c39b39f0a874becc7cf8e011a2a path: modules/hal/nordic groups: - hal From 56943598228a5fa30eb51fd937aef3187f753265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:02 +0200 Subject: [PATCH 2744/3334] Revert "[nrf fromtree] twister: Refactor twister_main.py" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b723f8901b3873766198de2923a7ea26b44bfc51. Signed-off-by: Andrzej Głąbek --- .../pylib/twister/twisterlib/twister_main.py | 440 +++++++----------- scripts/west_commands/twister_cmd.py | 4 +- 2 files changed, 178 insertions(+), 266 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/twister_main.py b/scripts/pylib/twister/twisterlib/twister_main.py index 410d9c0f2476..e851cda31aad 100644 --- a/scripts/pylib/twister/twisterlib/twister_main.py +++ b/scripts/pylib/twister/twisterlib/twister_main.py @@ -3,15 +3,12 @@ # Copyright (c) 2022 Google # SPDX-License-Identifier: Apache-2.0 -from __future__ import annotations - import argparse import logging import os import shutil import sys import time -import warnings from collections.abc import Sequence import colorama @@ -53,304 +50,219 @@ def _inner(*args, **kwargs): return _inner -class Twister: - """Main class for Twister.""" +@catch_system_exit_exception +def twister(options: argparse.Namespace, default_options: argparse.Namespace) -> int: + start_time = time.time() + + # Configure color output + color_strip = False if options.force_color else None + + colorama.init(strip=color_strip) + init_color(colorama_strip=color_strip) + + previous_results = None + # Cleanup + if ( + options.no_clean + or options.only_failed + or options.test_only + or options.report_summary is not None + ): + if os.path.exists(options.outdir): + print("Keeping artifacts untouched") + elif options.last_metrics: + ls = os.path.join(options.outdir, "twister.json") + if os.path.exists(ls): + with open(ls) as fp: + previous_results = fp.read() + else: + sys.exit(f"Can't compare metrics with non existing file {ls}") + elif os.path.exists(options.outdir): + if options.clobber_output: + print(f"Deleting output directory {options.outdir}") + shutil.rmtree(options.outdir) + else: + for i in range(1, 100): + new_out = options.outdir + f".{i}" + if not os.path.exists(new_out): + print(f"Renaming previous output directory to {new_out}") + shutil.move(options.outdir, new_out) + break + else: + sys.exit(f"Too many '{options.outdir}.*' directories. Run either with --no-clean, " + "or --clobber-output, or delete these directories manually.") - def __init__(self, options: argparse.Namespace, default_options: argparse.Namespace) -> None: - """Initialize Twister.""" - self.options: argparse.Namespace = options - self.default_options: argparse.Namespace = default_options - self.logger: logging.Logger = logging.getLogger("twister") - self.start_time: float = 0.0 - self.tplan: TestPlan | None = None - self.runner: TwisterRunner | None = None - self.hwm: HardwareMap | None = None - self.env: TwisterEnv | None = None - self.report: Reporting | None = None + previous_results_file = None + os.makedirs(options.outdir, exist_ok=True) + if options.last_metrics and previous_results: + previous_results_file = os.path.join(options.outdir, "baseline.json") + with open(previous_results_file, "w") as fp: + fp.write(previous_results) - def __repr__(self) -> str: - return f'{self.__class__.__name__}()' + setup_logging(options.outdir, options.log_file, options.log_level, options.timestamps) + logger = logging.getLogger("twister") - @classmethod - def create_instance(cls, argv: Sequence[str] | None = None) -> Twister: - """Create a new instance of Twister from CLI arguments.""" - parser = add_parse_arguments() - options = parse_arguments(parser, argv) - default_options = parse_arguments(parser, [], on_init=False) - return cls(options, default_options) - - def clean_previous_results(self) -> str | None: - """Run cleanup and return a results from previous session.""" - previous_results = None - if ( - self.options.no_clean - or self.options.only_failed - or self.options.test_only - or self.options.report_summary is not None - ): - if os.path.exists(self.options.outdir): - print("Keeping artifacts untouched") - elif self.options.last_metrics: - ls = os.path.join(self.options.outdir, "twister.json") - if os.path.exists(ls): - with open(ls) as fp: - previous_results = fp.read() - else: - sys.exit(f"Can't compare metrics with non existing file {ls}") - elif os.path.exists(self.options.outdir): - if self.options.clobber_output: - print(f"Deleting output directory {self.options.outdir}") - shutil.rmtree(self.options.outdir) - else: - for i in range(1, 100): - new_out = self.options.outdir + f".{i}" - if not os.path.exists(new_out): - print(f"Renaming previous output directory to {new_out}") - shutil.move(self.options.outdir, new_out) - break - else: - sys.exit( - f"Too many '{self.options.outdir}.*' directories. " - "Run either with --no-clean, " - "or --clobber-output, or delete these directories manually." - ) + env = TwisterEnv(options, default_options) + env.discover() - return previous_results - - def configure_color_output(self) -> None: - """Configure color output.""" - color_strip = False if self.options.force_color else None - init_color(colorama_strip=color_strip) - - def export_previous_results(self, previous_results: str | None) -> str | None: - """Export previous results to a file and return path to that file.""" - previous_results_file = None - os.makedirs(self.options.outdir, exist_ok=True) - if self.options.last_metrics and previous_results: - previous_results_file = os.path.join(self.options.outdir, "baseline.json") - with open(previous_results_file, "w") as fp: - fp.write(previous_results) - return previous_results_file - - def create_test_plan(self, env: TwisterEnv) -> TestPlan: - """Create a test plan.""" - tplan = TestPlan(env) - try: - tplan.discover() - except RuntimeError as e: - self.logger.error(f"{e}") - raise SystemExit(1) from e + hwm = HardwareMap(env) + ret = hwm.discover() + if ret == 0: + return 0 - if tplan.report() == 0: - raise SystemExit(0) + env.hwm = hwm - try: - tplan.load() - except RuntimeError as e: - self.logger.error(f"{e}") - raise SystemExit(1) from e - - return tplan - - def discover_hardware_map(self, env: TwisterEnv) -> HardwareMap: - """Discover hardware map and return it.""" - hwm = HardwareMap(env) - ret = hwm.discover() - if ret == 0: - raise SystemExit(0) - return hwm - - def verbose(self, tplan: TestPlan) -> None: - """Print additional info for verbose.""" + tplan = TestPlan(env) + try: + tplan.discover() + except RuntimeError as e: + logger.error(f"{e}") + return 1 + + if tplan.report() == 0: + return 0 + + try: + tplan.load() + except RuntimeError as e: + logger.error(f"{e}") + return 1 + + # if we are using command line platform filter, no need to list every + # other platform as excluded, we know that already. + # Show only the discards that apply to the selected platforms on the + # command line + + if options.verbose > 0: for i in tplan.instances.values(): - if i.status in [TwisterStatus.SKIP, TwisterStatus.FILTER]: - if ( - self.options.platform - and not tplan.check_platform(i.platform, self.options.platform) - ): + if i.status in [TwisterStatus.SKIP,TwisterStatus.FILTER]: + if options.platform and not tplan.check_platform(i.platform, options.platform): continue # Filtered tests should be visible only when verbosity > 1 - if self.options.verbose < 2 and i.status == TwisterStatus.FILTER: + if options.verbose < 2 and i.status == TwisterStatus.FILTER: continue res = i.reason if "Quarantine" in i.reason: res = "Quarantined" - self.logger.info( + logger.info( f"{i.platform.name:<25} {i.testsuite.name:<50}" f" {Fore.YELLOW}{i.status.upper()}{Fore.RESET}: {res}" - ) - - def create_report(self, tplan: TestPlan, env: TwisterEnv) -> Reporting: - """Create a report.""" - report = Reporting(tplan, env) - plan_file = os.path.join(self.options.outdir, "testplan.json") - if not os.path.exists(plan_file): - report.json_report(plan_file, env.version) - - if self.options.save_tests: - report.json_report(self.options.save_tests, env.version) - raise SystemExit(0) - - if self.options.report_summary is not None: - if self.options.report_summary < 0: - self.logger.error("The report summary value cannot be less than 0") - raise SystemExit(1) - report.synopsis() - raise SystemExit(0) - return report - - def execute(self, tplan: TestPlan, env: TwisterEnv, hwm: HardwareMap) -> TwisterRunner: - """Run twister runner.""" - runner = TwisterRunner(tplan.instances, tplan.testsuites, env) - runner.duts = hwm.duts - runner.run() - return runner - - def match_platforms_names(self, hwm: HardwareMap, tplan: TestPlan) -> None: - # FIXME: This is a workaround for the fact that the hardware map can be usng - # the short name of the platform, while the testplan is using the full name. - # - # convert platform names coming from the hardware map to the full target - # name. - # this is needed to match the platform names in the testplan. - for d in hwm.duts: - if d.platform in tplan.platform_names: - d.platform = tplan.get_platform(d.platform).name - - def prepare_reports(self, report: Reporting, previous_results_file: str | None) -> None: - """Prepare reports.""" - # figure out which report to use for size comparison - report_to_use = None - if self.options.compare_report: - report_to_use = self.options.compare_report - elif self.options.last_metrics: - report_to_use = previous_results_file - - report.footprint_reports( - report_to_use, - self.options.show_footprint, - self.options.all_deltas, - self.options.footprint_threshold, - self.options.last_metrics, - ) - - duration = time.time() - self.start_time - - if self.options.verbose > 1: - self.runner.results.summary() - - report.summary(self.runner.results, duration) - - report.coverage_status = True - if self.options.coverage and not self.options.disable_coverage_aggregation: - if not self.options.build_only: - report.coverage_status, report.coverage = run_coverage(self.options, self.tplan) - else: - self.logger.info("Skipping coverage report generation due to --build-only.") + ) - if self.options.device_testing and not self.options.build_only: - self.hwm.summary(self.tplan.selected_platforms) + report = Reporting(tplan, env) + plan_file = os.path.join(options.outdir, "testplan.json") + if not os.path.exists(plan_file): + report.json_report(plan_file, env.version) - report.save_reports( - self.options.report_name, - self.options.report_suffix, - self.options.report_dir, - self.options.no_update, - self.options.platform_reports, - ) + if options.save_tests: + report.json_report(options.save_tests, env.version) + return 0 + if options.report_summary is not None: + if options.report_summary < 0: + logger.error("The report summary value cannot be less than 0") + return 1 report.synopsis() + return 0 - if self.options.package_artifacts: - artifacts = Artifacts(self.env) - artifacts.package() - - if ( - self.runner.results.failed - or self.runner.results.error - or (self.tplan.warnings and self.options.warnings_as_errors) - or (self.options.coverage and not report.coverage_status) - ): - if self.env.options.quit_on_failure: - self.logger.info("twister aborted because of a failure/error") - else: - self.logger.info("Run completed") - raise SystemExit(1) - - @catch_system_exit_exception - def run(self) -> int: - """Run twister.""" - self.start_time = time.time() - - self.configure_color_output() - - previous_results = self.clean_previous_results() - previous_results_file = self.export_previous_results(previous_results) - - setup_logging( - self.options.outdir, - self.options.log_file, - self.options.log_level, - self.options.timestamps, - ) - - self.env = TwisterEnv(self.options, self.default_options) - self.env.discover() - - self.hwm = self.env.hwm = self.discover_hardware_map(self.env) - - self.tplan = self.create_test_plan(self.env) - - # if we are using command line platform filter, no need to list every - # other platform as excluded, we know that already. - # Show only the discards that apply to the selected platforms on the - # command line + # FIXME: This is a workaround for the fact that the hardware map can be usng + # the short name of the platform, while the testplan is using the full name. + # + # convert platform names coming from the hardware map to the full target + # name. + # this is needed to match the platform names in the testplan. + for d in hwm.duts: + if d.platform in tplan.platform_names: + d.platform = tplan.get_platform(d.platform).name + + if options.device_testing and not options.build_only: + print("\nDevice testing on:") + hwm.dump(filtered=tplan.selected_platforms) + print("") + + if options.dry_run: + duration = time.time() - start_time + logger.info(f"Completed in {duration:.2f} seconds") + return 0 - if self.options.verbose > 0: - self.verbose(self.tplan) + if options.short_build_path: + tplan.create_build_dir_links() + + runner = TwisterRunner(tplan.instances, tplan.testsuites, env) + runner.duts = hwm.duts + runner.run() + + # figure out which report to use for size comparison + report_to_use = None + if options.compare_report: + report_to_use = options.compare_report + elif options.last_metrics: + report_to_use = previous_results_file + + report.footprint_reports( + report_to_use, + options.show_footprint, + options.all_deltas, + options.footprint_threshold, + options.last_metrics, + ) - self.report = self.create_report(self.tplan, self.env) + duration = time.time() - start_time - self.match_platforms_names(self.hwm, self.tplan) + if options.verbose > 1: + runner.results.summary() - if self.options.device_testing and not self.options.build_only: - print("\nDevice testing on:") - self.hwm.dump(filtered=self.tplan.selected_platforms) - print("") + report.summary(runner.results, duration) - if self.options.dry_run: - duration = time.time() - self.start_time - self.logger.info(f"Completed in {duration:.2f} seconds") - return 0 + report.coverage_status = True + if options.coverage and not options.disable_coverage_aggregation: + if not options.build_only: + report.coverage_status, report.coverage = run_coverage(options, tplan) + else: + logger.info("Skipping coverage report generation due to --build-only.") - if self.options.short_build_path: - self.tplan.create_build_dir_links() + if options.device_testing and not options.build_only: + hwm.summary(tplan.selected_platforms) - self.runner = self.execute(self.tplan, self.env, self.hwm) + report.save_reports( + options.report_name, + options.report_suffix, + options.report_dir, + options.no_update, + options.platform_reports, + ) - self.prepare_reports(self.report, previous_results_file) + report.synopsis() - self.logger.info("Run completed") - return 0 + if options.package_artifacts: + artifacts = Artifacts(env) + artifacts.package() + if ( + runner.results.failed + or runner.results.error + or (tplan.warnings and options.warnings_as_errors) + or (options.coverage and not report.coverage_status) + ): + if env.options.quit_on_failure: + logger.info("twister aborted because of a failure/error") + else: + logger.info("Run completed") + return 1 -def twister(options: argparse.Namespace, default_options: argparse.Namespace) -> int: - """Run twister.""" - # function for backward compatibility - warnings.warn( - "Function `twister` is deprecated, use `Twister` class instead", - DeprecationWarning, - stacklevel=2 - ) - return Twister(options, default_options).run() + logger.info("Run completed") + return 0 def main(argv: Sequence[str] | None = None) -> int: """Main function to run twister.""" try: python_version_guard() - twister_instance = Twister.create_instance(argv) - return twister_instance.run() + + parser = add_parse_arguments() + options = parse_arguments(parser, argv) + default_options = parse_arguments(parser, [], on_init=False) + return twister(options, default_options) finally: close_logging() if (os.name != "nt") and os.isatty(1): diff --git a/scripts/west_commands/twister_cmd.py b/scripts/west_commands/twister_cmd.py index 93b39017e399..b96ab1b37175 100644 --- a/scripts/west_commands/twister_cmd.py +++ b/scripts/west_commands/twister_cmd.py @@ -18,7 +18,7 @@ sys.path.insert(0, str(twister_path / "pylib" / "twister")) from twisterlib.environment import add_parse_arguments, parse_arguments, python_version_guard -from twisterlib.twister_main import Twister as TwisterMain +from twisterlib.twister_main import twister TWISTER_DESCRIPTION = """\ Convenience wrapper for twister. The below options are shared with the twister @@ -58,7 +58,7 @@ def do_run(self, args, remainder): options = parse_arguments(self.parser, args=remainder, options=args) default_options = parse_arguments(self.parser, args=[], on_init=False) - ret = TwisterMain(options, default_options).run() + ret = twister(options, default_options) sys.exit(ret) def _parse_arguments(self, args, options): From 295b9e7c82fe46b8f7bab2c36612b1b8cff5c4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:02 +0200 Subject: [PATCH 2745/3334] Revert "[nrf fromtree] scripts: twister: minor speedup in apply_filters" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cb07e5f16688a57704eba394c97bdf643903e931. Signed-off-by: Andrzej Głąbek --- scripts/pylib/twister/twisterlib/testplan.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index 866763009681..d294e8375a50 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -889,10 +889,6 @@ def apply_filters(self, **kwargs): for itoolchain, plat in itertools.product( ts.integration_toolchains or [None], platform_scope ): - if (plat.arch == "unit") != (ts.type == "unit"): - # Discard silently - continue - if itoolchain: toolchain = itoolchain elif plat.arch in ['posix', 'unit']: @@ -913,6 +909,10 @@ def apply_filters(self, **kwargs): if not force_platform and self.check_platform(plat,exclude_platform): instance.add_filter("Platform is excluded on command line.", Filters.CMD_LINE) + if (plat.arch == "unit") != (ts.type == "unit"): + # Discard silently + continue + if ts.modules and self.modules and not set(ts.modules).issubset(set(self.modules)): instance.add_filter( f"one or more required modules not available: {','.join(ts.modules)}", From e603ba818d0e9e0b35e64a23a7c72b594d9814e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:02 +0200 Subject: [PATCH 2746/3334] Revert "[nrf fromtree] twister: handler: add spsdk support with dev_id" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 94e928bd992eb36a4686ade945b41f017999529a. Signed-off-by: Andrzej Głąbek --- 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 d8ebe4a0ae86..0b893e8569ed 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -609,7 +609,7 @@ def _create_command(self, runner, hardware): board_id = hardware.probe_id or hardware.id product = hardware.product if board_id is not None: - if runner in ("pyocd", "nrfjprog", "nrfutil", "nrfutil_next", "spsdk"): + if runner in ("pyocd", "nrfjprog", "nrfutil", "nrfutil_next"): command_extra_args.append("--dev-id") command_extra_args.append(board_id) elif runner == "esp32": From 2eb540830f12f5d8792c6ace0b489d2f54ce39c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:03 +0200 Subject: [PATCH 2747/3334] Revert "[nrf fromtree] scripts: twister: don't parse snippets multiple times" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f59609861868ac4fe54ce0abebc728c78631554d. Signed-off-by: Andrzej Głąbek --- scripts/pylib/twister/twisterlib/testplan.py | 43 +++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index d294e8375a50..89ec4b76cea0 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -867,23 +867,6 @@ def apply_filters(self, **kwargs): platform_scope = list( filter(lambda item: item.name in ts.platform_allow, self.platforms) ) - - # Discover required snippet YAML files and load them once per testsuite - found_snippets = None - snippet_args = None - missing_required_snippet = None - - if ts.required_snippets: - snippet_args = {"snippets": ts.required_snippets} - found_snippets = snippets.find_snippets_in_roots( - snippet_args, - [*self.env.snippet_roots, Path(ts.source_dir)] - ) - for this_snippet in snippet_args["snippets"]: - if this_snippet not in found_snippets: - missing_required_snippet = this_snippet - break - # list of instances per testsuite, aka configurations. instance_list = [] for itoolchain, plat in itertools.product( @@ -1048,13 +1031,25 @@ def apply_filters(self, **kwargs): instance.add_filter("Excluded tags per platform (only_tags)", Filters.PLATFORM) if ts.required_snippets: - if missing_required_snippet: - logger.error( - f"Can't find snippet '{missing_required_snippet}' for test '{ts.name}'" - ) - instance.status = TwisterStatus.ERROR - instance.reason = f"Snippet {missing_required_snippet} not found" - else: + missing_snippet = False + snippet_args = {"snippets": ts.required_snippets} + found_snippets = snippets.find_snippets_in_roots( + snippet_args, + [*self.env.snippet_roots, Path(ts.source_dir)] + ) + + # Search and check that all required snippet files are found + for this_snippet in snippet_args['snippets']: + if this_snippet not in found_snippets: + logger.error( + f"Can't find snippet '{this_snippet}' for test '{ts.name}'" + ) + instance.status = TwisterStatus.ERROR + instance.reason = f"Snippet {this_snippet} not found" + missing_snippet = True + break + + if not missing_snippet: # Look for required snippets and check that they are applicable for these # platforms/boards for this_snippet in snippet_args['snippets']: From 3a089c1e19bf5ec8d3c94d9cdfc44468077bbc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:04 +0200 Subject: [PATCH 2748/3334] Revert "[nrf fromtree] twister: Improve error handling for user's errors" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e932c7cc28b5f4c4ef7abdad80dc98783bf46fb6. Signed-off-by: Andrzej Głąbek --- scripts/pylib/twister/twisterlib/testplan.py | 8 ++- scripts/tests/twister/test_testplan.py | 12 ++--- scripts/tests/twister_blackbox/test_error.py | 51 ++++++++++++-------- 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index 89ec4b76cea0..6213bc5d7d9b 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -216,11 +216,9 @@ def discover(self): testsuite_pattern=self.options.test_pattern) if num == 0: - logger.error("No testsuites found at the specified location...") - raise SystemExit("No testsuites found at the specified location...") + raise TwisterRuntimeError("No testsuites found at the specified location...") if self.load_errors: - logger.error(f"Found {self.load_errors} errors loading {num} test configurations.") - raise SystemExit( + raise TwisterRuntimeError( f"Found {self.load_errors} errors loading {num} test configurations." ) @@ -237,7 +235,7 @@ def discover(self): qv = self.options.quarantine_verify if qv and not ql: logger.error("No quarantine list given to be verified") - raise SystemExit("No quarantine list given to be verified") + raise TwisterRuntimeError("No quarantine list given to be verified") if ql: for quarantine_file in ql: try: diff --git a/scripts/tests/twister/test_testplan.py b/scripts/tests/twister/test_testplan.py index b10c50c2281c..85bd2fd14428 100644 --- a/scripts/tests/twister/test_testplan.py +++ b/scripts/tests/twister/test_testplan.py @@ -641,9 +641,9 @@ def test_testplan_find_subtests( TESTDATA_3 = [ - (0, 0, [], False, [], SystemExit, []), - (1, 1, [], False, [], SystemExit, []), - (1, 0, [], True, [], SystemExit, ['No quarantine list given to be verified']), + (0, 0, [], False, [], TwisterRuntimeError, []), + (1, 1, [], False, [], TwisterRuntimeError, []), + (1, 0, [], True, [], TwisterRuntimeError, ['No quarantine list given to be verified']), (1, 0, ['qfile.yaml'], False, ['- platforms:\n - demo_board_3\n comment: "board_3"'], None, []), ] @@ -714,10 +714,10 @@ def test_testplan_discover( ] @pytest.mark.parametrize( - 'report_suffix, only_failed, load_tests, test_only, subset, ' \ - 'exception, expected_selected_platforms, expected_generate_subset_args', + 'report_suffix, only_failed, load_tests, test_only, subset,' \ + ' exception, expected_selected_platforms, expected_generate_subset_args', TESTDATA_4, - ids=['apply-filters-only', 'only-failed', 'load-tests', 'test-only'] + ids=['apply_filters only', 'only failed', 'load tests', 'test only'] ) def test_testplan_load( tmp_path, diff --git a/scripts/tests/twister_blackbox/test_error.py b/scripts/tests/twister_blackbox/test_error.py index cbd6b5e80044..a15b3b5129cf 100644 --- a/scripts/tests/twister_blackbox/test_error.py +++ b/scripts/tests/twister_blackbox/test_error.py @@ -6,16 +6,17 @@ Blackbox tests for twister's command line functions - simple does-error-out or not tests """ +import importlib +from unittest import mock import os import pytest -import re import sys -from unittest import mock +import re # pylint: disable=no-name-in-module -from conftest import TEST_DATA, suite_filename_mock +from conftest import ZEPHYR_BASE, TEST_DATA, suite_filename_mock from twisterlib.testplan import TestPlan -from twisterlib.twister_main import main as twister_main +from twisterlib.error import TwisterRuntimeError class TestError: @@ -25,17 +26,17 @@ class TestError: os.path.join('scripts', 'tests', 'twister_blackbox', 'test_data', 'tests', 'dummy', 'agnostic', 'group1', 'subgroup1', 'dummy.agnostic.group1.subgroup1'), - (0, '') + SystemExit ), ( None, 'dummy.agnostic.group1.subgroup1', - (1, 'No testsuites found at the specified location...') + TwisterRuntimeError ), ( os.path.join(TEST_DATA, 'tests', 'dummy'), 'dummy.agnostic.group1.subgroup1', - (0, '') + SystemExit ) ] TESTDATA_2 = [ @@ -49,13 +50,24 @@ class TestError: ) ] + @classmethod + def setup_class(cls): + apath = os.path.join(ZEPHYR_BASE, 'scripts', 'twister') + cls.loader = importlib.machinery.SourceFileLoader('__main__', apath) + cls.spec = importlib.util.spec_from_loader(cls.loader.name, cls.loader) + cls.twister_module = importlib.util.module_from_spec(cls.spec) + + @classmethod + def teardown_class(cls): + pass + @pytest.mark.parametrize( - 'testroot, test, expected_return', + 'testroot, test, expected_exception', TESTDATA_1, ids=['valid', 'invalid', 'valid'] ) @mock.patch.object(TestPlan, 'TESTSUITE_FILENAME', suite_filename_mock) - def test_test(self, out_path, testroot, test, expected_return, capsys): + def test_test(self, out_path, testroot, test, expected_exception): test_platforms = ['qemu_x86', 'intel_adl_crb'] args = [] if testroot: @@ -65,14 +77,13 @@ def test_test(self, out_path, testroot, test, expected_return, capsys): ['-p'] * len(test_platforms), test_platforms ) for val in pair] - expected_return_code, expected_message = expected_return - - return_code = twister_main(args) - captured = capsys.readouterr() + with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \ + pytest.raises(expected_exception) as exc: + self.loader.exec_module(self.twister_module) - assert return_code == expected_return_code - if expected_message: - assert expected_message in captured.err + if expected_exception == SystemExit: + assert str(exc.value) == '0' + assert True @pytest.mark.parametrize( 'switch, expected', @@ -95,7 +106,9 @@ def test_overflow_as_errors(self, capfd, out_path, switch, expected): if switch: args += [switch] - return_code = twister_main(args) + with mock.patch.object(sys, 'argv', [sys.argv[0]] + args), \ + pytest.raises(SystemExit) as sys_exit: + self.loader.exec_module(self.twister_module) out, err = capfd.readouterr() sys.stdout.write(out) @@ -103,8 +116,8 @@ def test_overflow_as_errors(self, capfd, out_path, switch, expected): print(args) if switch: - assert return_code == 1 + assert str(sys_exit.value) == '1' else: - assert return_code == 0 + assert str(sys_exit.value) == '0' assert re.search(expected, err) From ede25bef164742caccb9670687845a6bfe592e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:04 +0200 Subject: [PATCH 2749/3334] Revert "[nrf fromtree] Revert "twister: pytest: fix duplicate log lines from pytest"" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d3fef392bc085dfaf54539de1332db676ee5be88. Signed-off-by: Andrzej Głąbek --- scripts/pylib/twister/twisterlib/harness.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/harness.py b/scripts/pylib/twister/twisterlib/harness.py index 99c113fb4344..957ebba1b874 100644 --- a/scripts/pylib/twister/twisterlib/harness.py +++ b/scripts/pylib/twister/twisterlib/harness.py @@ -403,6 +403,7 @@ def generate_command(self): 'pytest', '--twister-harness', '-s', '-v', + '--log-level=DEBUG', f'--build-dir={self.running_dir}', f'--junit-xml={self.report_file}', f'--platform={self.instance.platform.name}' @@ -414,12 +415,6 @@ def generate_command(self): if pytest_dut_scope: command.append(f'--dut-scope={pytest_dut_scope}') - # Always pass output from the pytest test and the test image up to Twister log. - command.extend([ - '--log-cli-level=DEBUG', - '--log-cli-format=%(levelname)s: %(message)s' - ]) - # Use the test timeout as the base timeout for pytest base_timeout = handler.get_test_timeout() command.append(f'--base-timeout={base_timeout}') From e5bf08d38202439313fef1863b8ef118350802b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:04 +0200 Subject: [PATCH 2750/3334] Revert "[nrf fromtree] scripts: twister: fix codec cp950 error when running on Windows" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7b76f0caf4c2c7d08eac5a0555dc6c59084d724f. Signed-off-by: Andrzej Głąbek --- scripts/pylib/twister/twisterlib/cmakecache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/cmakecache.py b/scripts/pylib/twister/twisterlib/cmakecache.py index 177fc59d4bcf..16e18669675c 100644 --- a/scripts/pylib/twister/twisterlib/cmakecache.py +++ b/scripts/pylib/twister/twisterlib/cmakecache.py @@ -115,7 +115,7 @@ def __init__(self, cache_file): def load(self, cache_file): entries = [] - with open(cache_file, encoding='utf-8') as cache: + with open(cache_file) as cache: for line_no, line in enumerate(cache): entry = CMakeCacheEntry.from_line(line, line_no) if entry: From 6938b00306d28c5fdb5584d4d569c722f538c5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:04 +0200 Subject: [PATCH 2751/3334] Revert "[nrf fromtree] scripts: twister: fix issue with empty serial in hwmap" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 447ee68dc690d81acbc392ebccd11d4d14167b98. Signed-off-by: Andrzej Głąbek --- .../pylib/twister/twisterlib/hardwaremap.py | 9 +- scripts/tests/twister/test_hardwaremap.py | 84 +------------------ 2 files changed, 8 insertions(+), 85 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 59c2ec5a0bb1..6f32849f27a4 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -399,7 +399,7 @@ def save(self, hwm_file): for h in hwm: if h['product'] != 'BOOT-SERIAL' : h['connected'] = False - h.pop('serial', None) + h['serial'] = None else : boot_ids.append(h['id']) @@ -412,8 +412,7 @@ def save(self, hwm_file): h['connected'] is False ]): h['connected'] = True - if _detected.serial: - h['serial'] = _detected.serial + h['serial'] = _detected.serial _detected.match = True break @@ -446,16 +445,16 @@ def save(self, hwm_file): platform = _connected.platform id = _connected.id runner = _connected.runner + serial = _connected.serial product = _connected.product d = { 'platform': platform, 'id': id, 'runner': runner, + 'serial': serial, 'product': product, 'connected': _connected.connected } - if _connected.serial: - d['serial'] = _connected.serial dl.append(d) with open(hwm_file, 'w') as yaml_file: yaml.dump(dl, yaml_file, Dumper=Dumper, default_flow_style=False) diff --git a/scripts/tests/twister/test_hardwaremap.py b/scripts/tests/twister/test_hardwaremap.py index 6fd68d71ba95..f7ed424f996b 100644 --- a/scripts/tests/twister/test_hardwaremap.py +++ b/scripts/tests/twister/test_hardwaremap.py @@ -324,6 +324,7 @@ def mock_open(*args, **kwargs): 'serial_baud': 115200, 'fixtures': [], 'connected': True, + 'serial': None, 'serial_pty': 'dummy', }, } @@ -571,6 +572,7 @@ def mock_exists(path): 'platform': 'p0', 'product': 'pr0', 'connected': False, + 'serial': None }, { 'id': 4, @@ -584,12 +586,14 @@ def mock_exists(path): 'platform': 'p5-5', 'product': 'pr5-5', 'connected': False, + 'serial': None }, { 'id': 10, 'platform': 'p10', 'product': 'pr10', 'connected': False, + 'serial': None }, { 'serial': 's1', @@ -717,83 +721,3 @@ def test_hardwaremap_dump( sys.stderr.write(err) assert out.strip() == expected_out.strip() - -def _run_save_and_get_dump(mocked_hm, *, exists, filename='hwm.yaml', read_data=None): - """ - Run HardwareMap.save() with mocked file I/O and return the object passed to yaml.dump() - """ - dump_mock = mock.Mock() - - if read_data is None: - write_mock = mock.mock_open() - open_mock = mock.Mock(return_value=write_mock()) - else: - read_mock = mock.mock_open(read_data=read_data) - write_mock = mock.mock_open() - - def mock_open(filename, mode='r'): - if mode == 'r': - return read_mock() - if mode == 'w': - return write_mock() - raise AssertionError(f"unexpected mode {mode}") - - open_mock = mock.Mock(side_effect=mock_open) - - mocked_hm.load = mock.Mock() - mocked_hm.dump = mock.Mock() - - with mock.patch('os.path.exists', return_value=exists), \ - mock.patch('builtins.open', open_mock), \ - mock.patch('twisterlib.hardwaremap.yaml.dump', dump_mock): - mocked_hm.save(filename) - - return dump_mock.call_args.args[0] - -def test_hardwaremap_save_omits_serial_when_none(mocked_hm): - """ - Verify 'serial' key is omitted when from the generated hardware map - when it is unknown. 'serial' is not required. - """ - # Force one detected device to have no serial - mocked_hm.detected = list(mocked_hm.detected) - mocked_hm.detected[1].serial = None # id=2 in mocked_hm fixture - - dumped = _run_save_and_get_dump(mocked_hm, exists=False, filename='hwm.yaml') - - entry = next(d for d in dumped if d['id'] == 2) - assert 'serial' not in entry - - # And ensure nobody writes serial=None - assert all(d.get('serial') is not None for d in dumped if 'serial' in d) - -def test_hardwaremap_save_existing_map_disconnect_omits_serial(mocked_hm): - """ - If the hardware map contained a 'serial' value, then the next time a - hardmap is generated and the device is disconnected, and the serial value - is unknown, then the new file should not contain the 'serial'. - """ - mocked_hm.detected = [] # simulate unplugged - - hwm = """ -- id: 4 - platform: p4 - product: pr4 - runner: r4 - connected: True - serial: s4 -""" - - dumped = _run_save_and_get_dump( - mocked_hm, - exists=True, - filename='hwmap1.yaml', - read_data=hwm, - ) - - entry = next(d for d in dumped if d['id'] == 4) - assert entry['connected'] is False - assert 'serial' not in entry - - # And ensure nobody writes serial=None - assert all(d.get('serial') is not None for d in dumped if 'serial' in d) From 04906f6da3b43adad92897abf39fb21823be7336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:05 +0200 Subject: [PATCH 2752/3334] Revert "[nrf fromtree] twister: replace pykwalify with jsonschema" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 455ff2349ce38660e7c8c2051e7eb81de72f0edf. Signed-off-by: Andrzej Głąbek --- scripts/pylib/twister/scl.py | 49 +- scripts/schemas/twister/hwmap-schema.yaml | 147 ++--- scripts/schemas/twister/platform-schema.yaml | 241 ++++---- .../schemas/twister/quarantine-schema.yaml | 67 ++- .../schemas/twister/test-config-schema.yaml | 94 ++-- scripts/schemas/twister/testsuite-schema.yaml | 519 ++++++++++-------- scripts/tests/twister/test_platform.py | 23 +- scripts/tests/twister/test_scl.py | 179 ++++-- 8 files changed, 770 insertions(+), 549 deletions(-) diff --git a/scripts/pylib/twister/scl.py b/scripts/pylib/twister/scl.py index ef8c381adfe3..25a3210b141f 100644 --- a/scripts/pylib/twister/scl.py +++ b/scripts/pylib/twister/scl.py @@ -1,20 +1,23 @@ -#!/usr/bin/env python3 +#! /usr/bin/python # # SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors # Zephyr's Twister library # +# pylint: disable=unused-import +# # Set of code that other projects can also import to do things on # Zephyr's sanity check testcases. import logging import yaml try: + # Use the C LibYAML parser if available, rather than the Python parser. + # It's much faster. + from yaml import CLoader as Loader from yaml import CSafeLoader as SafeLoader + from yaml import CDumper as Dumper except ImportError: - from yaml import SafeLoader - -from jsonschema import Draft202012Validator + from yaml import Loader, SafeLoader, Dumper log = logging.getLogger("scl") @@ -23,6 +26,8 @@ class EmptyYamlFileException(Exception): pass +# +# def yaml_load(filename): """ Safely load a YAML document @@ -46,23 +51,23 @@ def yaml_load(filename): e.note, cmark.name, cmark.line, cmark.column, e.context) raise -def _yaml_validate(data, schema): - """ - Validate loaded YAML data against a JSON Schema. - - :param dict data: YAML document data - :param dict schema: JSON Schema (already loaded) - :raises jsonschema.exceptions.ValidationError: on schema violation - :raises jsonschema.exceptions.SchemaError: on invalid schema - """ - if not schema: - return +# If pykwalify is installed, then the validate function will work -- +# otherwise, it is a stub and we'd warn about it. +try: + import pykwalify.core + # Don't print error messages yourself, let us do it + logging.getLogger("pykwalify.core").setLevel(50) - validator = Draft202012Validator(schema) + def _yaml_validate(data, schema): + if not schema: + return + c = pykwalify.core.Core(source_data=data, schema_data=schema) + c.validate(raise_exception=True) - # Fail fast on first error - for error in validator.iter_errors(data): - raise error +except ImportError as e: + log.warning("can't import pykwalify; won't validate YAML (%s)", e) + def _yaml_validate(data, schema): + pass def yaml_load_verify(filename, schema): """ @@ -72,9 +77,9 @@ def yaml_load_verify(filename, schema): :param str filename: name of the file to load and process :param dict schema: loaded YAML schema (can load with :func:`yaml_load`) + # 'document.yaml' contains a single YAML document. :raises yaml.scanner.ScannerError: on YAML parsing error - :raises jsonschema.exceptions.ValidationError: on schema violation - :raises jsonschema.exceptions.SchemaError: on Schema violation error + :raises pykwalify.errors.SchemaError: on Schema violation error """ # 'document.yaml' contains a single YAML document. y = yaml_load(filename) diff --git a/scripts/schemas/twister/hwmap-schema.yaml b/scripts/schemas/twister/hwmap-schema.yaml index 77b6998fced0..caa58088fd6d 100644 --- a/scripts/schemas/twister/hwmap-schema.yaml +++ b/scripts/schemas/twister/hwmap-schema.yaml @@ -1,65 +1,82 @@ -$schema: "https://json-schema.org/draft/2020-12/schema" -type: array -items: - type: object - properties: - available: - type: boolean - connected: - type: boolean - id: - type: string - notes: - type: string - platform: {} - probe_id: - type: string - product: - type: string - runner: - type: string - runner_params: - type: array - items: - type: string - serial_pty: - type: string - serial: - type: string - baud: - type: integer - serial_baud: - type: integer - post_script: - type: string - post_flash_script: - type: string - pre_script: - type: string - fixtures: - type: array - items: - type: string - flash_timeout: - type: integer - flash_with_test: - type: boolean - flash_before: - type: boolean - script_param: - type: object - properties: - pre_script_timeout: - type: integer - post_script_timeout: - type: integer - post_flash_timeout: - type: integer - additionalProperties: false - required: - - connected - - id - - platform - - product - - runner - additionalProperties: false +type: seq +sequence: + - type: map + required: false + mapping: + "available": + type: bool + required: false + "connected": + type: bool + required: true + "id": + type: str + required: true + "notes": + type: str + required: false + "platform": + type: any + required: true + "probe_id": + type: str + required: false + "product": + type: str + required: true + "runner": + type: str + required: true + "runner_params": + type: seq + required: false + sequence: + - type: str + "serial_pty": + type: str + required: false + "serial": + type: str + required: false + "baud": + type: int + required: false + "serial_baud": + type: int + required: false + "post_script": + type: str + required: false + "post_flash_script": + type: str + required: false + "pre_script": + type: str + required: false + "fixtures": + type: seq + required: false + sequence: + - type: str + "flash_timeout": + type: int + required: false + "flash_with_test": + type: bool + required: false + "flash_before": + type: bool + required: false + "script_param": + type: map + required: false + mapping: + "pre_script_timeout": + type: int + required: false + "post_script_timeout": + type: int + required: false + "post_flash_timeout": + type: int + required: false diff --git a/scripts/schemas/twister/platform-schema.yaml b/scripts/schemas/twister/platform-schema.yaml index 272ae8b10c2b..7ceebfe491c4 100644 --- a/scripts/schemas/twister/platform-schema.yaml +++ b/scripts/schemas/twister/platform-schema.yaml @@ -1,119 +1,130 @@ # # Schema to validate a YAML file describing a Zephyr test platform # -$schema: "https://json-schema.org/draft/2020-12/schema" -$defs: - platform: - type: object - properties: - variants: - type: object - patternProperties: - "[a-zA-Z0-9_]+": - $ref: "#/$defs/platform" - additionalProperties: false - identifier: - type: string - maintainers: - type: array - items: - type: string - name: - type: string - type: - type: string - enum: ["mcu", "qemu", "sim", "unit", "native"] - simulation: - type: array - items: - type: object - properties: - name: - type: string +# We load this with pykwalify +# (http://pykwalify.readthedocs.io/en/unstable/validation-rules.html), +# a YAML structure validator, to validate the YAML files that describe +# Zephyr test platforms +# +# The original spec comes from Zephyr's twister script +# + +schema;platform-schema: + type: map + mapping: + "variants": + type: map + matching-rule: "any" + mapping: + regex;(([a-zA-Z0-9_]+)): + include: platform-schema + "identifier": + type: str + "maintainers": + type: seq + seq: + - type: str + "name": + type: str + "type": + type: str + enum: ["mcu", "qemu", "sim", "unit", "native"] + "simulation": + type: seq + seq: + - type: map + mapping: + "name": + type: str + required: true enum: - - qemu - - simics - - xt-sim - - renode - - nsim - - mdb-nsim - - tsim - - armfvp - - native - - custom - exec: - type: string - required: - - name - additionalProperties: false - arch: - type: string - enum: - - arc - - arm - - arm64 - - mips - - nios2 - - posix - - riscv - - rx - - sparc - - x86 - - xtensa - - unit - vendor: - type: string - tier: - type: integer - toolchain: - type: array - items: - type: string - sysbuild: - type: boolean - env: - type: array - items: - type: string - ram: - type: integer - flash: - type: integer - twister: - type: boolean - supported: - type: array - items: - type: string - testing: - type: object - properties: - timeout_multiplier: - type: number - default: - type: boolean - flash_before: - type: boolean - binaries: - type: array - items: - type: string - only_tags: - type: array - items: - type: string - ignore_tags: - type: array - items: - type: string - renode: - type: object - properties: - uart: - type: string - resc: - type: string - additionalProperties: false - additionalProperties: false - additionalProperties: false -$ref: "#/$defs/platform" + [ + "qemu", + "simics", + "xt-sim", + "renode", + "nsim", + "mdb-nsim", + "tsim", + "armfvp", + "native", + "custom", + ] + "exec": + type: str + "arch": + type: str + enum: + [ + # architectures + "arc", + "arm", + "arm64", + "mips", + "nios2", + "posix", + "riscv", + "rx", + "sparc", + "x86", + "xtensa", + + # unit testing + "unit", + ] + "vendor": + type: str + "tier": + type: int + "toolchain": + type: seq + seq: + - type: str + "sysbuild": + type: bool + "env": + type: seq + seq: + - type: str + "ram": + type: int + "flash": + type: int + "twister": + type: bool + "supported": + type: seq + seq: + - type: str + "testing": + type: map + mapping: + "timeout_multiplier": + type: number + required: false + "default": + type: bool + "flash_before": + type: bool + required: false + "binaries": + type: seq + seq: + - type: str + "only_tags": + type: seq + seq: + - type: str + "ignore_tags": + type: seq + seq: + - type: str + "renode": + type: map + mapping: + "uart": + type: str + "resc": + type: str + +include: platform-schema diff --git a/scripts/schemas/twister/quarantine-schema.yaml b/scripts/schemas/twister/quarantine-schema.yaml index a8ba7230ad4d..f7a145a3f0f4 100644 --- a/scripts/schemas/twister/quarantine-schema.yaml +++ b/scripts/schemas/twister/quarantine-schema.yaml @@ -2,31 +2,42 @@ # Schema to validate a YAML file providing the list of configurations # under quarantine # -$schema: "https://json-schema.org/draft/2020-12/schema" -type: array -items: - type: object - properties: - scenarios: - type: array - items: - type: string - uniqueItems: true - platforms: - type: array - items: - type: string - uniqueItems: true - architectures: - type: array - items: - type: string - uniqueItems: true - simulations: - type: array - items: - type: string - uniqueItems: true - comment: - type: string - additionalProperties: false +# We load this with pykwalify +# (http://pykwalify.readthedocs.io/en/unstable/validation-rules.html), +# a YAML structure validator, to validate the YAML files that provide +# a list of configurations (scenarios + platforms) under quarantine +# +type: seq +matching: all +sequence: + - type: map + required: true + matching: all + mapping: + "scenarios": + type: seq + required: false + sequence: + - type: str + - unique: true + "platforms": + required: false + type: seq + sequence: + - type: str + - unique: true + "architectures": + required: false + type: seq + sequence: + - type: str + - unique: true + "simulations": + required: false + type: seq + sequence: + - type: str + - unique: true + "comment": + type: str + required: false diff --git a/scripts/schemas/twister/test-config-schema.yaml b/scripts/schemas/twister/test-config-schema.yaml index 338814dfdb45..24a92c34361f 100644 --- a/scripts/schemas/twister/test-config-schema.yaml +++ b/scripts/schemas/twister/test-config-schema.yaml @@ -1,47 +1,53 @@ # # Schema to validate a YAML file describing a Zephyr test configuration. # -$schema: "https://json-schema.org/draft/2020-12/schema" -type: object -properties: - options: - type: object - properties: - integration_mode: - type: array - items: - type: string - additionalProperties: false - platforms: - type: object - properties: - override_default_platforms: - type: boolean - increased_platform_scope: - type: boolean - default_platforms: - type: array - items: - type: string - additionalProperties: false - levels: - type: array - items: - type: object - properties: - name: - type: string - description: - type: string - adds: - type: array - items: - type: string - inherits: - type: array - items: - type: string - required: - - name - additionalProperties: false -additionalProperties: false + +type: map +mapping: + "options": + type: map + required: false + mapping: + "integration_mode": + type: seq + required: false + sequence: + - type: str + "platforms": + type: map + required: false + mapping: + "override_default_platforms": + type: bool + required: false + "increased_platform_scope": + type: bool + required: false + "default_platforms": + type: seq + required: false + sequence: + - type: str + "levels": + type: seq + required: false + sequence: + - type: map + required: false + mapping: + "name": + type: str + required: true + "description": + type: str + required: false + "adds": + type: seq + required: false + sequence: + - type: str + "inherits": + type: seq + required: false + sequence: + - type: str diff --git a/scripts/schemas/twister/testsuite-schema.yaml b/scripts/schemas/twister/testsuite-schema.yaml index 3fa4e33d4c13..1d00098e318c 100644 --- a/scripts/schemas/twister/testsuite-schema.yaml +++ b/scripts/schemas/twister/testsuite-schema.yaml @@ -1,230 +1,311 @@ # # Schema to validate a YAML file describing a Zephyr test platform # -$schema: "https://json-schema.org/draft/2020-12/schema" -$defs: - scenario: - type: object - properties: - arch_exclude: {} - arch_allow: {} - vendor_exclude: - type: array - items: - type: string - vendor_allow: - type: array - items: - type: string - testcases: - type: array - items: - type: string - build_only: - type: boolean - build_on_all: - type: boolean - depends_on: {} - extra_args: {} - extra_configs: - type: array - items: - type: string - extra_conf_files: - type: array - items: - type: string - extra_overlay_confs: - type: array - items: - type: string - extra_dtc_overlay_files: - type: array - items: - type: string - extra_sections: {} - expect_reboot: - type: boolean - required_applications: - type: array - items: - type: object - properties: - name: - type: string - platform: - type: string - required: [name] - additionalProperties: false - required_snippets: - type: array - items: - type: string - filter: - type: string - levels: - type: array - items: - type: string +# We load this with pykwalify +# (http://pykwalify.readthedocs.io/en/unstable/validation-rules.html), +# a YAML structure validator, to validate the YAML files that describe +# Zephyr test platforms +# +# The original spec comes from Zephyr's twister script +# +schema;scenario-schema: + type: map + # has to be not-required, otherwise the parser gets + # confused and things it never found it + required: false + mapping: + "arch_exclude": + type: any + required: false + "arch_allow": + type: any + required: false + "vendor_exclude": + type: seq + required: false + sequence: + - type: str + "vendor_allow": + type: seq + required: false + sequence: + - type: str + "testcases": + type: seq + required: false + sequence: + - type: str + "build_only": + type: bool + required: false + "build_on_all": + type: bool + required: false + "depends_on": + type: any + required: false + "extra_args": + type: any + required: false + "extra_configs": + type: seq + required: false + sequence: + - type: str + "extra_conf_files": + type: seq + required: false + sequence: + - type: str + "extra_overlay_confs": + type: seq + required: false + sequence: + - type: str + "extra_dtc_overlay_files": + type: seq + required: false + sequence: + - type: str + "extra_sections": + type: any + required: false + "expect_reboot": + type: bool + required: false + "required_applications": + type: seq + required: false + sequence: + - type: map + mapping: + "name": + type: str + required: true + "platform": + type: str + "required_snippets": + type: seq + required: false + sequence: + - type: str + "filter": + type: str + required: false + "levels": + type: seq + required: false + sequence: + - type: str enum: ["smoke", "unit", "integration", "acceptance", "system", "regression"] - integration_platforms: - type: array - items: - type: string - integration_toolchains: - type: array - items: - type: string - ignore_faults: - type: boolean - ignore_qemu_crash: - type: boolean - harness: - type: string - harness_config: - type: object - properties: - power_measurements: {} - shell_commands_file: - type: string - shell_commands: - type: array - items: - type: object - properties: - command: - type: string - expected: - type: string - required: [command] - additionalProperties: false - display_capture_config: - type: string - type: - type: string - fixture: - type: string - ordered: - type: boolean - pytest_root: - type: array - items: - type: string - pytest_args: - type: array - items: - type: string - pytest_dut_scope: - type: string - enum: ["function", "class", "module", "package", "session"] - ctest_args: - type: array - items: - type: string - regex: - type: array - items: - type: string - robot_testsuite: {} - robot_option: {} - record: - type: object - properties: - regex: - type: array - items: - type: string - merge: - type: boolean - as_json: - type: array - items: - type: string - required: [regex] - additionalProperties: false - bsim_exe_name: - type: string - ztest_suite_repeat: - type: integer - ztest_test_repeat: - type: integer - ztest_test_shuffle: - type: boolean - additionalProperties: false - min_ram: - type: integer - min_flash: - type: integer - modules: - type: array - items: - type: string - platform_exclude: {} - platform_allow: {} - platform_type: - type: array - items: - type: string + "integration_platforms": + type: seq + required: false + sequence: + - type: str + "integration_toolchains": + type: seq + required: false + sequence: + - type: str + "ignore_faults": + type: bool + required: false + "ignore_qemu_crash": + type: bool + required: false + "harness": + type: str + required: false + "harness_config": + type: map + required: false + mapping: + "power_measurements": + type: any + required: false + "shell_commands_file": + type: str + required: false + "shell_commands": + type: seq + required: false + sequence: + - type: map + mapping: + "command": + type: str + required: true + "expected": + type: str + "display_capture_config": + type: str + required: false + "type": + type: str + required: false + "fixture": + type: str + required: false + "ordered": + type: bool + required: false + "pytest_root": + type: seq + required: false + sequence: + - type: str + "pytest_args": + type: seq + required: false + sequence: + - type: str + "pytest_dut_scope": + type: str + enum: ["function", "class", "module", "package", "session"] + required: false + "ctest_args": + type: seq + required: false + sequence: + - type: str + "regex": + type: seq + required: false + sequence: + - type: str + "robot_testsuite": + type: any + required: false + "robot_option": + type: any + required: false + "record": + type: map + required: false + mapping: + "regex": + type: seq + required: true + sequence: + - type: str + "merge": + type: bool + required: false + "as_json": + type: seq + required: false + sequence: + - type: str + "bsim_exe_name": + type: str + required: false + "ztest_suite_repeat": + type: int + required: false + "ztest_test_repeat": + type: int + required: false + "ztest_test_shuffle": + type: bool + required: false + "min_ram": + type: int + required: false + "min_flash": + type: int + required: false + "modules": + type: seq + required: false + sequence: + - type: str + "platform_exclude": + type: any + required: false + "platform_allow": + type: any + required: false + "platform_type": + type: seq + required: false + sequence: + - type: str enum: ["mcu", "qemu", "sim", "unit", "native"] - platform_key: - type: array - items: - type: string - simulation_exclude: - type: array - items: - type: string + "platform_key": + required: false + type: seq + matching: "all" + sequence: + - type: str + "simulation_exclude": + type: seq + required: false + sequence: + - type: str enum: - - qemu - - simics - - xt-sim - - renode - - nsim - - mdb-nsim - - tsim - - armfvp - - native - - custom - tags: {} - timeout: - type: integer - toolchain_exclude: {} - toolchain_allow: {} - type: - type: string - enum: ["unit"] - skip: - type: boolean - slow: - type: boolean - sysbuild: - type: boolean - additionalProperties: false + [ + "qemu", + "simics", + "xt-sim", + "renode", + "nsim", + "mdb-nsim", + "tsim", + "armfvp", + "native", + "custom", + ] + "tags": + type: any + required: false + "timeout": + type: int + required: false + "toolchain_exclude": + type: any + required: false + "toolchain_allow": + type: any + required: false + "type": + type: str + enum: ["unit"] + "skip": + type: bool + required: false + "slow": + type: bool + required: false + "sysbuild": + type: bool + required: false -type: object -properties: - common: - $ref: "#/$defs/scenario" +type: map +mapping: + "common": + include: scenario-schema # The sample descriptor, if present - sample: - type: object - properties: - name: - type: string - description: - type: string - required: [name] - additionalProperties: false + "sample": + type: map + required: false + mapping: + "name": + type: str + required: true + "description": + type: str + required: false # The list of testcases -- IDK why this is a sequence of # maps maps, shall just be a sequence of maps # maybe it is just an artifact? - tests: - type: object - patternProperties: - # The key for the testname is any - "[a-zA-Z0-9_]+": - $ref: "#/$defs/scenario" - additionalProperties: false -required: - - tests -additionalProperties: false + "tests": + type: map + required: true + matching-rule: "any" + mapping: + # The key for the testname is any, so + # regex;(([a-zA-Z0-9_]+)) for this to work, note below we + # make it required: false + regex;(([a-zA-Z0-9_]+)): + include: scenario-schema diff --git a/scripts/tests/twister/test_platform.py b/scripts/tests/twister/test_platform.py index f499e8a754de..bef49ca861f4 100644 --- a/scripts/tests/twister/test_platform.py +++ b/scripts/tests/twister/test_platform.py @@ -10,7 +10,7 @@ from unittest import mock import pytest -from jsonschema.exceptions import ValidationError +from pykwalify.errors import SchemaError from twisterlib.platform import Platform, Simulator, generate_platforms TESTDATA_1 = [ @@ -131,7 +131,6 @@ def xtest_platform_load(platform_text, expected_data, expected_repr): ( ['m0'], None, - None, { 'p1e1/s1', 'p1e2/s1', 'p2/s1', 'p3@A/s2/c1', 'p3@B/s2/c1', }, @@ -139,7 +138,6 @@ def xtest_platform_load(platform_text, expected_data, expected_repr): ( ['m0', 'm1'], None, - None, { 'p1e1/s1', 'p1e2/s1', 'p2/s1', 'p3@A/s2/c1', 'p3@B/s2/c1', 'p1e1/s1/v1', 'p1e1/s1/v2', 'p1e2/s1/v1', 'p2/s1/v1', @@ -148,7 +146,6 @@ def xtest_platform_load(platform_text, expected_data, expected_repr): ( ['m0', 'm1', 'm2'], None, - None, { 'p1e1/s1', 'p1e2/s1', 'p2/s1', 'p3@A/s2/c1', 'p3@B/s2/c1', 'p1e1/s1/v1', 'p1e1/s1/v2', 'p1e2/s1/v1', 'p2/s1/v1', @@ -157,26 +154,23 @@ def xtest_platform_load(platform_text, expected_data, expected_repr): ), ( ['m0', 'm3'], - Exception, - "Duplicate platform identifier p1e1/s1 found", + Exception("Duplicate platform identifier p1e1/s1 found"), None, ), ( ['m0', 'm1', 'm4'], - Exception, - "Duplicate platform identifier p1e2/s1/v1 found", + Exception("Duplicate platform identifier p1e2/s1/v1 found"), None, ), ( ['m0', 'm5'], - ValidationError, # Unknown message as this is raised externally - None, + SchemaError(), # Unknown message as this is raised externally None, ), ] @pytest.mark.parametrize( - 'roots, expected_exception, expected_exception_msg, expected_platform_names', + 'roots, expected_exception, expected_platform_names', TESTDATA_2, ids=[ 'default board root', @@ -191,7 +185,6 @@ def test_generate_platforms( tmp_path, roots, expected_exception, - expected_exception_msg, expected_platform_names, ): tmp_files = { @@ -363,13 +356,13 @@ def test_generate_platforms( (tmp_path / filename).write_text(content) roots = list(map(tmp_path.joinpath, roots)) - with pytest.raises(expected_exception) if \ + with pytest.raises(type(expected_exception)) if \ expected_exception else nullcontext() as exception: platforms = list(generate_platforms(board_roots=roots, soc_roots=roots, arch_roots=roots)) if expected_exception: - if expected_exception_msg: - assert expected_exception_msg == str(exception.value) + if expected_exception.args: + assert str(expected_exception) == str(exception.value) return platform_names = {platform.name for platform in platforms} diff --git a/scripts/tests/twister/test_scl.py b/scripts/tests/twister/test_scl.py index 199f58576faf..f08ed30ee992 100644 --- a/scripts/tests/twister/test_scl.py +++ b/scripts/tests/twister/test_scl.py @@ -6,38 +6,116 @@ Tests for scl.py functions """ +import logging import sys -import types from contextlib import nullcontext from importlib import reload from unittest import mock import pytest import scl -from jsonschema.exceptions import ValidationError +from pykwalify.errors import SchemaError from yaml.scanner import ScannerError +TESTDATA_1 = [ + (False,), + (True,), +] -@pytest.mark.parametrize("has_cyaml", [True, False], ids=["C YAML", "non-C YAML"]) -def test_yaml_imports(has_cyaml): - """ - scl.py does: - from yaml import CSafeLoader as SafeLoader - falling back to: - from yaml import SafeLoader - So we simulate a yaml module with/without CSafeLoader. - """ - fake_yaml = types.ModuleType("yaml") - fake_yaml.load = mock.Mock() - fake_yaml.SafeLoader = object() - if has_cyaml: - fake_yaml.CSafeLoader = object() - - with mock.patch.dict(sys.modules, {"yaml": fake_yaml}): +@pytest.mark.parametrize( + 'fail_c', + TESTDATA_1, + ids=['C YAML', 'non-C YAML'] +) +def test_yaml_imports(fail_c): + class ImportRaiser: + def find_spec(self, fullname, path, target=None): + if fullname == 'yaml.CLoader' and fail_c: + raise ImportError() + if fullname == 'yaml.CSafeLoader' and fail_c: + raise ImportError() + if fullname == 'yaml.CDumper' and fail_c: + raise ImportError() + + modules_mock = sys.modules.copy() + + if hasattr(modules_mock['yaml'], 'CLoader'): + del modules_mock['yaml'].CLoader + del modules_mock['yaml'].CSafeLoader + del modules_mock['yaml'].CDumper + + cloader_mock = mock.Mock() + loader_mock = mock.Mock() + csafeloader_mock = mock.Mock() + safeloader_mock = mock.Mock() + cdumper_mock = mock.Mock() + dumper_mock = mock.Mock() + + if not fail_c: + modules_mock['yaml'].CLoader = cloader_mock + modules_mock['yaml'].CSafeLoader = csafeloader_mock + modules_mock['yaml'].CDumper = cdumper_mock + + modules_mock['yaml'].Loader = loader_mock + modules_mock['yaml'].SafeLoader = safeloader_mock + modules_mock['yaml'].Dumper = dumper_mock + + meta_path_mock = sys.meta_path[:] + meta_path_mock.insert(0, ImportRaiser()) + + with mock.patch.dict('sys.modules', modules_mock, clear=True), \ + mock.patch('sys.meta_path', meta_path_mock): reload(scl) - assert scl.SafeLoader is (fake_yaml.CSafeLoader if has_cyaml else fake_yaml.SafeLoader) - # cleanup + assert sys.modules['scl'].Loader == loader_mock if fail_c else \ + cloader_mock + + assert sys.modules['scl'].SafeLoader == safeloader_mock if fail_c else \ + csafeloader_mock + + assert sys.modules['scl'].Dumper == dumper_mock if fail_c else \ + cdumper_mock + + import yaml + reload(yaml) + + +TESTDATA_2 = [ + (False, logging.CRITICAL, []), + (True, None, ['can\'t import pykwalify; won\'t validate YAML']), +] + +@pytest.mark.parametrize( + 'fail_pykwalify, log_level, expected_logs', + TESTDATA_2, + ids=['pykwalify OK', 'no pykwalify'] +) +def test_pykwalify_import(caplog, fail_pykwalify, log_level, expected_logs): + class ImportRaiser: + def find_spec(self, fullname, path, target=None): + if fullname == 'pykwalify.core' and fail_pykwalify: + raise ImportError() + + modules_mock = sys.modules.copy() + modules_mock['pykwalify'] = None if fail_pykwalify else \ + modules_mock['pykwalify'] + + meta_path_mock = sys.meta_path[:] + meta_path_mock.insert(0, ImportRaiser()) + + with mock.patch.dict('sys.modules', modules_mock, clear=True), \ + mock.patch('sys.meta_path', meta_path_mock): + reload(scl) + + if log_level: + assert logging.getLogger('pykwalify.core').level == log_level + + assert all([log in caplog.text for log in expected_logs]) + + if fail_pykwalify: + assert scl._yaml_validate(None, None) is None + assert scl._yaml_validate(mock.Mock(), mock.Mock()) is None + reload(scl) @@ -91,7 +169,7 @@ def mock_load(*args, **kwargs): TESTDATA_4 = [ (True, False, None), - (False, False, ValidationError), + (False, False, SchemaError), (False, True, ScannerError), ] @@ -105,18 +183,18 @@ def test_yaml_load_verify(validate, fail_load, expected_error): schema_mock = mock.Mock() data_mock = mock.Mock() - def mock_load(file_name): + def mock_load(file_name, *args, **kwargs): assert file_name == filename if fail_load: raise ScannerError return data_mock - def mock_validate(data, schema): + def mock_validate(data, schema, *args, **kwargs): assert data == data_mock assert schema == schema_mock if validate: - return None - raise ValidationError("Schema validation failed") + return True + raise SchemaError(u'Schema validation failed.') with mock.patch('scl.yaml_load', side_effect=mock_load), \ mock.patch('scl._yaml_validate', side_effect=mock_validate), \ @@ -126,28 +204,47 @@ def mock_validate(data, schema): if validate: assert res == data_mock -def test_yaml_validate(): - data = {"a": 1} - schema = { - "type": "object", - "properties": { - "a": {"type": "string"} - }, - "required": ["a"], - "additionalProperties": False, - } - with pytest.raises(ValidationError): - scl._yaml_validate(data, schema) +TESTDATA_5 = [ + (True, True, None), + (True, False, SchemaError), + (False, None, None), +] +@pytest.mark.parametrize( + 'schema_exists, validate, expected_error', + TESTDATA_5, + ids=['successful validation', 'failed validation', 'no schema'] +) +def test_yaml_validate(schema_exists, validate, expected_error): + data_mock = mock.Mock() + schema_mock = mock.Mock() if schema_exists else None -def test_yaml_validate_no_schema(): - data = {"a": 1} - assert scl._yaml_validate(data, None) is None + def mock_validate(raise_exception, *args, **kwargs): + assert raise_exception + if validate: + return True + raise SchemaError(u'Schema validation failed.') + + def mock_core(source_data, schema_data, *args, **kwargs): + assert source_data == data_mock + assert schema_data == schema_mock + return mock.Mock(validate=mock_validate) + + core_mock = mock.Mock(side_effect=mock_core) + + with mock.patch('pykwalify.core.Core', core_mock), \ + pytest.raises(expected_error) if expected_error else nullcontext(): + scl._yaml_validate(data_mock, schema_mock) + + if schema_exists: + core_mock.assert_called_once() + else: + core_mock.assert_not_called() def test_yaml_load_empty_file(tmp_path): quarantine_file = tmp_path / 'empty_quarantine.yml' - quarantine_file.write_text("# yaml file without data", encoding="utf-8") + quarantine_file.write_text("# yaml file without data") with pytest.raises(scl.EmptyYamlFileException): scl.yaml_load_verify(quarantine_file, None) From 7643b8bca7338561b8e81ac433c3edeea0ccd8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:05 +0200 Subject: [PATCH 2753/3334] Revert "[nrf fromtree] twister: refactor DUT class to dataclass for serialization support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f16807cfef63175ee1daeaa374a26bda53628859. Signed-off-by: Andrzej Głąbek --- scripts/pylib/twister/twisterlib/handlers.py | 6 +- .../pylib/twister/twisterlib/hardwaremap.py | 91 +++++++++++-------- scripts/pylib/twister/twisterlib/harness.py | 2 +- scripts/schemas/twister/hwmap-schema.yaml | 3 - scripts/tests/twister/test_hardwaremap.py | 38 +++++--- scripts/tests/twister/test_harness.py | 2 +- .../twister_blackbox/test_hardwaremap.py | 6 +- 7 files changed, 83 insertions(+), 65 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index 0b893e8569ed..6e321cfec2c0 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -765,7 +765,7 @@ def handle(self, harness): ser_pty_master, slave = pty.openpty() serial_device = os.ttyname(slave) - logger.debug(f"Using serial device {serial_device} @ {hardware.serial_baud} baud") + logger.debug(f"Using serial device {serial_device} @ {hardware.baud} baud") command = self._create_command(runner, hardware) @@ -787,7 +787,7 @@ def handle(self, harness): ser = self._create_serial_connection( hardware, serial_port, - hardware.serial_baud, + hardware.baud, flash_timeout, serial_pty, ser_pty_process @@ -848,7 +848,7 @@ def handle(self, harness): try: if serial_pty: ser_pty_process = self._start_serial_pty(serial_pty, ser_pty_master) - logger.debug(f"Attach serial device {serial_device} @ {hardware.serial_baud} baud") + logger.debug(f"Attach serial device {serial_device} @ {hardware.baud} baud") ser.port = serial_device # Apply ESP32-specific RTS/DTR reset logic diff --git a/scripts/pylib/twister/twisterlib/hardwaremap.py b/scripts/pylib/twister/twisterlib/hardwaremap.py index 6f32849f27a4..6bbf22099c32 100644 --- a/scripts/pylib/twister/twisterlib/hardwaremap.py +++ b/scripts/pylib/twister/twisterlib/hardwaremap.py @@ -3,16 +3,13 @@ # # Copyright (c) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -from __future__ import annotations import logging import os import platform import re -from dataclasses import asdict, dataclass, field from multiprocessing import Lock, Value from pathlib import Path -from typing import Any import scl import yaml @@ -35,39 +32,50 @@ logger = logging.getLogger('twister') -@dataclass class DUT: - """Device Under Test configuration.""" - id: str | None = None - serial: str | None = None - serial_baud: int = 115200 - platform: str | None = None - product: str | None = None - serial_pty: str | None = None - connected: bool = False - runner_params: str | None = None - pre_script: str | None = None - post_script: str | None = None - post_flash_script: str | None = None - script_param: str | None = None - runner: str | None = None - flash_timeout: int = 60 - flash_with_test: bool = False - flash_before: bool = False - fixtures: list[str] = field(default_factory=list) - probe_id: str | None = None - notes: str | None = None - match: bool = False - - def __post_init__(self): - """Initialize non-serializable objects after dataclass initialization.""" - # These are not dataclass fields, so they won't be serialized by asdict() + def __init__(self, + id=None, + serial=None, + serial_baud=None, + platform=None, + product=None, + serial_pty=None, + connected=False, + runner_params=None, + pre_script=None, + post_script=None, + post_flash_script=None, + script_param=None, + runner=None, + flash_timeout=60, + flash_with_test=False, + flash_before=False): + + self.serial = serial + self.baud = serial_baud or 115200 + self.platform = platform + self.serial_pty = serial_pty self._counter = Value("i", 0) self._available = Value("i", 1) self._failures = Value("i", 0) + self.connected = connected + self.pre_script = pre_script + self.id = id + self.product = product + self.runner = runner + self.runner_params = runner_params + self.flash_before = flash_before + self.fixtures = [] + self.post_flash_script = post_flash_script + self.post_script = post_script + self.pre_script = pre_script + self.script_param = script_param + self.probe_id = None + self.notes = None self.lock = Lock() - # Ensure serial_baud has a default value - self.serial_baud = self.serial_baud or 115200 + self.match = False + self.flash_timeout = flash_timeout + self.flash_with_test = flash_with_test @property def available(self): @@ -107,16 +115,19 @@ def failures_increment(self, value=1): with self._failures.get_lock(): self._failures.value += value - def to_dict(self) -> dict[str, Any]: - """Convert DUT dataclass to dictionary for YAML serialization.""" - result = asdict(self) - # Remove None and False values and empty lists to keep YAML clean - return {k: v for k, v in result.items() if v} + def to_dict(self): + d = {} + exclude = ['_available', '_counter', '_failures', 'match'] + v = vars(self) + for k in v: + if k not in exclude and v[k]: + d[k] = v[k] + return d + def __repr__(self): return f"<{self.platform} ({self.product}) on {self.serial}>" - class HardwareMap: schema_path = os.path.join(ZEPHYR_BASE, "scripts", "schemas", "twister", "hwmap-schema.yaml") @@ -159,7 +170,7 @@ class HardwareMap: } def __init__(self, env=None): - self.detected: list[DUT] = [] + self.detected = [] self.duts: list[DUT] = [] self.options = env.options @@ -284,7 +295,7 @@ def load(self, map_file): runner = dut.get('runner') runner_params = dut.get('runner_params') serial = dut.get('serial') - serial_baud = dut.get('serial_baud', None) or dut.get('baud', None) + baud = dut.get('baud', None) product = dut.get('product') fixtures = dut.get('fixtures', []) connected = dut.get('connected') and ((serial or serial_pty) is not None) @@ -298,7 +309,7 @@ def load(self, map_file): id=id, serial_pty=serial_pty, serial=serial, - serial_baud=serial_baud, + serial_baud=baud, connected=connected, pre_script=pre_script, flash_before=flash_before, diff --git a/scripts/pylib/twister/twisterlib/harness.py b/scripts/pylib/twister/twisterlib/harness.py index 957ebba1b874..d00d308c5542 100644 --- a/scripts/pylib/twister/twisterlib/harness.py +++ b/scripts/pylib/twister/twisterlib/harness.py @@ -463,7 +463,7 @@ def _generate_parameters_for_hardware(self, handler: Handler): else: command.extend([ f'--device-serial={hardware.serial}', - f'--device-serial-baud={hardware.serial_baud}' + f'--device-serial-baud={hardware.baud}' ]) for extra_serial in handler.get_more_serials_from_device(hardware): command.append(f'--device-serial={extra_serial}') diff --git a/scripts/schemas/twister/hwmap-schema.yaml b/scripts/schemas/twister/hwmap-schema.yaml index caa58088fd6d..142d4a1969bf 100644 --- a/scripts/schemas/twister/hwmap-schema.yaml +++ b/scripts/schemas/twister/hwmap-schema.yaml @@ -41,9 +41,6 @@ sequence: "baud": type: int required: false - "serial_baud": - type: int - required: false "post_script": type: str required: false diff --git a/scripts/tests/twister/test_hardwaremap.py b/scripts/tests/twister/test_hardwaremap.py index f7ed424f996b..5d0ea798ed64 100644 --- a/scripts/tests/twister/test_hardwaremap.py +++ b/scripts/tests/twister/test_hardwaremap.py @@ -37,7 +37,7 @@ def mocked_hm(): TESTDATA_1 = [ ( {}, - {'serial_baud': 115200, 'flash_timeout': 60}, + {'baud': 115200, 'lock': mock.ANY, 'flash_timeout': 60}, '' ), ( @@ -63,9 +63,10 @@ def mocked_hm(): } }, { + 'lock': mock.ANY, 'id': 'dummy id', 'serial': 'dummy serial', - 'serial_baud': 4400, + 'baud': 4400, 'platform': 'dummy platform', 'product': 'dummy product', 'serial_pty': 'dummy serial pty', @@ -268,7 +269,7 @@ def test_hardwaremap_load(): runner: r0 flash_with_test: True flash_timeout: 15 - serial_baud: 14400 + baud: 14400 fixtures: - dummy fixture 1 - dummy fixture 2 @@ -309,7 +310,7 @@ def mock_open(*args, **kwargs): 'runner': 'r0', 'flash_timeout': 15, 'flash_with_test': True, - 'serial_baud': 14400, + 'baud': 14400, 'fixtures': ['dummy fixture 1', 'dummy fixture 2'], 'connected': True, 'serial': 'dummy', @@ -321,7 +322,7 @@ def mock_open(*args, **kwargs): 'runner': 'r1', 'flash_timeout': 30, 'flash_with_test': False, - 'serial_baud': 115200, + 'baud': 115200, 'fixtures': [], 'connected': True, 'serial': None, @@ -502,45 +503,50 @@ def mock_exists(path): '', [{ 'serial': 's1', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p1', 'connected': True, 'id': 1, 'product': 'pr1', + 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's2', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p2', 'id': 2, 'product': 'pr2', + 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's3', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p3', 'connected': True, 'id': 3, 'product': 'pr3', + 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's4', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p4', 'id': 4, 'product': 'pr4', + 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's5', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p5', 'connected': True, 'id': 5, 'product': 'pr5', + 'lock': mock.ANY, 'flash_timeout': 60 }] ), @@ -597,37 +603,41 @@ def mock_exists(path): }, { 'serial': 's1', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p1', 'connected': True, 'id': 1, 'product': 'pr1', + 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's2', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p2', 'id': 2, 'product': 'pr2', + 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's3', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p3', 'connected': True, 'id': 3, 'product': 'pr3', + 'lock': mock.ANY, 'flash_timeout': 60 }, { 'serial': 's5', - 'serial_baud': 115200, + 'baud': 115200, 'platform': 'p5', 'connected': True, 'id': 5, 'product': 'pr5', + 'lock': mock.ANY, 'flash_timeout': 60 }] ), diff --git a/scripts/tests/twister/test_harness.py b/scripts/tests/twister/test_harness.py index 62fc6460e788..fc90205f32e2 100644 --- a/scripts/tests/twister/test_harness.py +++ b/scripts/tests/twister/test_harness.py @@ -552,7 +552,7 @@ def test_pytest__generate_parameters_for_hardware(tmp_path, pty_value, hardware_ hardware = mock.Mock() hardware.serial_pty = pty_value hardware.serial = "serial" - hardware.serial_baud = 115200 + hardware.baud = 115200 hardware.runner = "runner" hardware.runner_params = ["--runner-param1", "runner-param2"] hardware.fixtures = ["fixture1:option1", "fixture2"] diff --git a/scripts/tests/twister_blackbox/test_hardwaremap.py b/scripts/tests/twister_blackbox/test_hardwaremap.py index e39ab75c2638..01bab62313e0 100644 --- a/scripts/tests/twister_blackbox/test_hardwaremap.py +++ b/scripts/tests/twister_blackbox/test_hardwaremap.py @@ -112,7 +112,7 @@ def teardown_class(cls): def test_generate(self, capfd, out_path, manufacturer, product, serial, runner): file_name = "test-map.yaml" path = os.path.join(ZEPHYR_BASE, file_name) - args = ['--outdir', out_path, '--generate-hardware-map', path] + args = ['--outdir', out_path, '--generate-hardware-map', file_name] if os.path.exists(path): os.remove(path) @@ -164,7 +164,7 @@ def mocked_comports(): def test_few_generate(self, capfd, out_path, manufacturer, product, serial, runner): file_name = "test-map.yaml" path = os.path.join(ZEPHYR_BASE, file_name) - args = ['--outdir', out_path, '--generate-hardware-map', path] + args = ['--outdir', out_path, '--generate-hardware-map', file_name] if os.path.exists(path): os.remove(path) @@ -245,7 +245,7 @@ def mocked_comports(): def test_texas_exeption(self, capfd, out_path, manufacturer, product, serial, location): file_name = "test-map.yaml" path = os.path.join(ZEPHYR_BASE, file_name) - args = ['--outdir', out_path, '--generate-hardware-map', path] + args = ['--outdir', out_path, '--generate-hardware-map', file_name] if os.path.exists(path): os.remove(path) From d77a4be44211bba152a43a70e62aad8336643924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:05 +0200 Subject: [PATCH 2754/3334] Revert "[nrf fromtree] Bluetooth: BAP: Direction fix" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 570d01f236b732601091182221744dfb4537faa5. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/audio/bap_unicast_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index b163d9c2aa93..8114e93036b9 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -3080,7 +3080,7 @@ int bt_bap_unicast_group_reconfig(struct bt_bap_unicast_group *unicast_group, CONTAINER_OF(tx_param->stream->iso, struct bt_bap_iso, chan); unicast_group_set_iso_stream_param(unicast_group, bap_iso, tx_param->qos, - BT_AUDIO_DIR_SINK); + BT_AUDIO_DIR_SOURCE); } } From 2ef26cf5250131968fb9b394fcf171905906c4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:05 +0200 Subject: [PATCH 2755/3334] Revert "[nrf fromtree] Bluetooth: Host: Use HCI VS command to set public addr on bt_enable" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 570faba6cf5cfcc9ab9e8fd048336ffdf80e0cdc. Signed-off-by: Andrzej Głąbek --- include/zephyr/bluetooth/hci_vs.h | 3 --- subsys/bluetooth/host/hci_core.c | 27 ------------------- subsys/bluetooth/host/id.c | 3 +-- .../src/test_suite_invalid_inputs.c | 2 +- 4 files changed, 2 insertions(+), 33 deletions(-) diff --git a/include/zephyr/bluetooth/hci_vs.h b/include/zephyr/bluetooth/hci_vs.h index 3e79d5ad1dde..51e7b19cdddb 100644 --- a/include/zephyr/bluetooth/hci_vs.h +++ b/include/zephyr/bluetooth/hci_vs.h @@ -38,9 +38,6 @@ extern "C" { #define BT_VS_CMD_SUP_FEAT(cmd) BT_LE_FEAT_TEST(cmd, \ BT_VS_CMD_BIT_SUP_FEAT) -/** Check if HCI VS command BT_VS_CMD_BIT_WRITE_BDADDR is supported */ -#define BT_VS_CMD_WRITE_BD_ADDR(cmd) BT_LE_FEAT_TEST(cmd, \ - BT_VS_CMD_BIT_WRITE_BDADDR) #define BT_VS_CMD_READ_STATIC_ADDRS(cmd) BT_LE_FEAT_TEST(cmd, \ BT_VS_CMD_BIT_READ_STATIC_ADDRS) #define BT_VS_CMD_READ_KEY_ROOTS(cmd) BT_LE_FEAT_TEST(cmd, \ diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 9573f714fa1f..82c429aef9d6 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4262,22 +4262,6 @@ static void hci_vs_init(void) net_buf_unref(rsp); } } - -static int hci_vs_write_bd_addr(bt_addr_t *bdaddr) -{ - struct bt_hci_cp_vs_write_bd_addr *cp; - struct net_buf *buf; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (buf == NULL) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - bt_addr_copy(&cp->bdaddr, bdaddr); - - return bt_hci_cmd_send_sync(BT_HCI_OP_VS_WRITE_BD_ADDR, buf, NULL); -} #endif /* CONFIG_BT_HCI_VS */ static int hci_init(void) @@ -4333,17 +4317,6 @@ static int hci_init(void) #if defined(CONFIG_BT_HCI_VS) hci_vs_init(); - - if (bt_dev.id_count > 0U && bt_dev.id_addr[BT_ID_DEFAULT].type == BT_ADDR_LE_PUBLIC) { - if (BT_VS_CMD_WRITE_BD_ADDR(bt_dev.vs_commands)) { - err = hci_vs_write_bd_addr(&bt_dev.id_addr[BT_ID_DEFAULT].a); - if (err != 0) { - return err; - } - } else if (!IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR)) { - return -ENOTSUP; - } - } #endif err = bt_id_init(); if (err) { diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index 602fea7cb5e9..0ed84dff7331 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -1365,8 +1365,7 @@ int bt_id_create(bt_addr_le_t *addr, uint8_t *irk) return -EALREADY; } - if (addr->type == BT_ADDR_LE_PUBLIC && - (IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR) || IS_ENABLED(CONFIG_BT_HCI_VS))) { + if (addr->type == BT_ADDR_LE_PUBLIC && IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR)) { /* set the single public address */ if (bt_dev.id_count != 0) { return -EALREADY; diff --git a/tests/bluetooth/host/id/bt_id_create/src/test_suite_invalid_inputs.c b/tests/bluetooth/host/id/bt_id_create/src/test_suite_invalid_inputs.c index 9f832568bd6b..e803694326ac 100644 --- a/tests/bluetooth/host/id/bt_id_create/src/test_suite_invalid_inputs.c +++ b/tests/bluetooth/host/id/bt_id_create/src/test_suite_invalid_inputs.c @@ -93,7 +93,7 @@ ZTEST(bt_id_create_invalid_inputs, test_public_address) { int err; - if (IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR) || IS_ENABLED(CONFIG_BT_HCI_VS)) { + if (IS_ENABLED(CONFIG_BT_HCI_SET_PUBLIC_ADDR)) { ztest_test_skip(); } From 82031981555a2594ec8b0e045574cddaac3d5097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:06 +0200 Subject: [PATCH 2756/3334] Revert "[nrf noup] boards: nordic: thingy53: ns: default to minimal TF-M profile" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 75a8753c2fc4f603ecacf1b70a04374d18b5a6bc. Signed-off-by: Andrzej Głąbek --- boards/nordic/thingy53/Kconfig.defconfig | 8 -------- 1 file changed, 8 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index c75f7bfee6d5..2809fd1eafc9 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -21,14 +21,6 @@ config BOOTLOADER_MCUBOOT config BOARD_ENABLE_CPUNET default y if !MCUBOOT -if BUILD_WITH_TFM - -choice TFM_PROFILE_TYPE - default TFM_PROFILE_TYPE_MINIMAL -endchoice - -endif # BUILD_WITH_TFM - # Code Partition: # # For the secure version of the board the firmware is linked at the beginning From 003e80244bc60df3ffdfeb1c3376ff7d05d8808f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:06 +0200 Subject: [PATCH 2757/3334] Revert "[nrf fromlist] dts: Fix nRF71 Wi-Fi bindings" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 211ea93cee38eb34486cb6083777bfd6d2db00ab. Signed-off-by: Andrzej Głąbek --- MAINTAINERS.yml | 2 +- .../{nordic,nrf7120-wifi.yaml => nordic,nrf71-wifi.yaml} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename dts/bindings/wifi/{nordic,nrf7120-wifi.yaml => nordic,nrf71-wifi.yaml} (56%) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index efdd9e61ecd9..dc801509a465 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -2638,7 +2638,7 @@ Documentation Infrastructure: - dts/bindings/wifi/nordic,nrf7000-spi.yaml - dts/bindings/wifi/nordic,nrf7001-qspi.yaml - dts/bindings/wifi/nordic,nrf7001-spi.yaml - - dts/bindings/wifi/nordic,nrf7120-wifi.yaml + - dts/bindings/wifi/nordic,nrf71-wifi.yaml - boards/shields/nrf7002ek/ labels: - "area: Wi-Fi" diff --git a/dts/bindings/wifi/nordic,nrf7120-wifi.yaml b/dts/bindings/wifi/nordic,nrf71-wifi.yaml similarity index 56% rename from dts/bindings/wifi/nordic,nrf7120-wifi.yaml rename to dts/bindings/wifi/nordic,nrf71-wifi.yaml index 6c0ba480dcc7..41f5acd86d08 100644 --- a/dts/bindings/wifi/nordic,nrf7120-wifi.yaml +++ b/dts/bindings/wifi/nordic,nrf71-wifi.yaml @@ -2,10 +2,10 @@ # SPDX-License-Identifier: Apache-2.0 description: > - Wi-Fi domain of nRF7120 Wi-Fi and - Bluetooth combo SoC. + This is a representation of the Wi-Fi parts of the nRF71 Series Wi-Fi and + Bluetooth chip SoC. -compatible: "nordic,nrf7120-wifi" +compatible: "nordic,nrf71-wifi" include: - "wifi-tx-power-2g.yaml" From 10bf7192321668b5afcb889dca931669da032e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:06 +0200 Subject: [PATCH 2758/3334] Revert "[nrf fromtree] tests: drivers: nrf_wifi: Add a combo for coex" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 920d7d68c9aec870e079f7c3aa9172f9a3c6b148. Signed-off-by: Andrzej Głąbek --- tests/drivers/wifi/nrf_wifi/testcase.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/drivers/wifi/nrf_wifi/testcase.yaml b/tests/drivers/wifi/nrf_wifi/testcase.yaml index 52928ac6386a..6dc68db29a97 100644 --- a/tests/drivers/wifi/nrf_wifi/testcase.yaml +++ b/tests/drivers/wifi/nrf_wifi/testcase.yaml @@ -48,11 +48,3 @@ tests: extra_configs: - CONFIG_NET_STATISTICS_ETHERNET=y - CONFIG_NET_STATISTICS_ETHERNET_VENDOR=y - drivers.wifi.build.sr_coex: - extra_configs: - - CONFIG_NRF70_SR_COEX=y - extra_args: SHIELD=nrf7002ek - platform_allow: - - nrf5340dk/nrf5340/cpuapp - platform_exclude: - - nrf7002dk/nrf5340/cpuapp From e59fa5b4cda40d835aecad4a76f5b3d29a9e5107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:07 +0200 Subject: [PATCH 2759/3334] Revert "[nrf fromtree] modules: nrf_wifi: Fix missing prototype" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 85eb0216f06c95701dceeee4dcd73d6086c94138. Signed-off-by: Andrzej Głąbek --- modules/nrf_wifi/bus/rpu_hw_if.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/nrf_wifi/bus/rpu_hw_if.c b/modules/nrf_wifi/bus/rpu_hw_if.c index 385157d3aa69..004c820c6322 100644 --- a/modules/nrf_wifi/bus/rpu_hw_if.c +++ b/modules/nrf_wifi/bus/rpu_hw_if.c @@ -70,8 +70,6 @@ uint32_t rpu_7002_memmap[][3] = { static const struct qspi_dev *qdev; static struct qspi_config *cfg; -static int rpu_gpio_remove(void); - static int validate_addr_blk(uint32_t start_addr, uint32_t end_addr, uint32_t block_no, From e39965e9304c9cddcc367d2e8de393a3d11f4922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:07 +0200 Subject: [PATCH 2760/3334] Revert "[nrf fromtree] manifest: nrf_wifi: Pull nRF71 removal" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 03f5365ee9bc2663454ef9ffd9b0f0613ed7e41e. Signed-off-by: Andrzej Głąbek --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f1ca6eb10401..55772b9fc8a0 100644 --- a/west.yml +++ b/west.yml @@ -347,7 +347,7 @@ manifest: revision: 4d11a73d62bf999205f16de21a0ef675501f5b21 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 1e37ff7a739173cfe7adb248f9637d385a36c96b + revision: 29afb11a512787bc68e2afd58c9dfde4bb4d5dc4 path: modules/lib/nrf_wifi - name: open-amp revision: 5efe7974f9546582e99f5a842a816ea4b65f5227 From 378dcd751bf8c7330628771ac2bd13499dfdec7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:07 +0200 Subject: [PATCH 2761/3334] Revert "[nrf fromtree] nrf_wifi: Remove nRF71 support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aede5bdf8744e8d6a3679e439af29c579422840f. Signed-off-by: Andrzej Głąbek --- drivers/wifi/nrf_wifi/CMakeLists.txt | 8 +- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 14 +- drivers/wifi/nrf_wifi/inc/fmac_main.h | 4 + .../nrf_wifi/off_raw_tx/src/off_raw_tx_api.c | 11 + drivers/wifi/nrf_wifi/src/debug_shell.c | 4 + drivers/wifi/nrf_wifi/src/fmac_main.c | 27 ++ drivers/wifi/nrf_wifi/src/fw_load.c | 6 + drivers/wifi/nrf_wifi/src/net_if.c | 10 + drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 2 + drivers/wifi/nrf_wifi/src/wifi_util.c | 10 + drivers/wifi/nrf_wifi/src/wifi_util.h | 4 + drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 141 ++++++++++ modules/nrf_wifi/bus/CMakeLists.txt | 15 + modules/nrf_wifi/bus/Kconfig | 9 + modules/nrf_wifi/bus/device.c | 23 +- modules/nrf_wifi/bus/ipc_if.c | 135 +++++++++ modules/nrf_wifi/bus/ipc_if.h | 48 ++++ modules/nrf_wifi/bus/ipc_service.c | 206 ++++++++++++++ modules/nrf_wifi/bus/ipc_service.h | 260 ++++++++++++++++++ modules/nrf_wifi/bus/spsc_qm.c | 84 ++++++ modules/nrf_wifi/bus/spsc_qm.h | 79 ++++++ modules/nrf_wifi/os/CMakeLists.txt | 8 + modules/nrf_wifi/os/shim.c | 75 +++++ subsys/ipc/ipc_service/lib/Kconfig.icmsg | 1 + 24 files changed, 1178 insertions(+), 6 deletions(-) create mode 100644 modules/nrf_wifi/bus/ipc_if.c create mode 100644 modules/nrf_wifi/bus/ipc_if.h create mode 100644 modules/nrf_wifi/bus/ipc_service.c create mode 100644 modules/nrf_wifi/bus/ipc_service.h create mode 100644 modules/nrf_wifi/bus/spsc_qm.c create mode 100644 modules/nrf_wifi/bus/spsc_qm.h diff --git a/drivers/wifi/nrf_wifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt index b3aa412183e1..c6a76bad086a 100644 --- a/drivers/wifi/nrf_wifi/CMakeLists.txt +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -27,9 +27,11 @@ zephyr_library_sources_ifndef(CONFIG_NRF70_OFFLOADED_RAW_TX src/fmac_main.c ) -zephyr_library_sources_ifdef(CONFIG_NRF_WIFI_PATCHES_BUILTIN - src/fw_load.c -) +if(NOT CONFIG_NRF71_ON_IPC) + zephyr_library_sources_ifdef(CONFIG_NRF_WIFI_PATCHES_BUILTIN + src/fw_load.c + ) +endif() if(NOT CONFIG_NRF70_RADIO_TEST AND NOT CONFIG_NRF70_OFFLOADED_RAW_TX) zephyr_library_sources( diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 7a926fbd6d4f..3a276a8ff707 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -16,7 +16,8 @@ menuconfig WIFI_NRF70 depends on \ DT_HAS_NORDIC_NRF7002_SPI_ENABLED || DT_HAS_NORDIC_NRF7002_QSPI_ENABLED || \ DT_HAS_NORDIC_NRF7001_SPI_ENABLED || DT_HAS_NORDIC_NRF7001_QSPI_ENABLED || \ - DT_HAS_NORDIC_NRF7000_SPI_ENABLED || DT_HAS_NORDIC_NRF7000_QSPI_ENABLED + DT_HAS_NORDIC_NRF7000_SPI_ENABLED || DT_HAS_NORDIC_NRF7000_QSPI_ENABLED || \ + $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF71_WIFI)) help Nordic Wi-Fi Driver @@ -24,7 +25,7 @@ if WIFI_NRF70 # Hidden symbols for internal use config WIFI_NRF7002 bool - default y if DT_HAS_NORDIC_NRF7002_SPI_ENABLED || DT_HAS_NORDIC_NRF7002_QSPI_ENABLED + default y if DT_HAS_NORDIC_NRF7002_SPI_ENABLED || DT_HAS_NORDIC_NRF7002_QSPI_ENABLED || $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF71_WIFI)) config WIFI_NRF7001 bool @@ -166,10 +167,12 @@ endchoice config NRF_WIFI_LOW_POWER bool "Low power mode in nRF Wi-Fi chipsets" depends on !NRF70_RADIO_TEST && !NRF70_AP_MODE + depends on !NRF71_ON_IPC default y config NRF70_TCP_IP_CHECKSUM_OFFLOAD bool "TCP/IP checksum offload" + depends on !NRF71_ON_IPC default y config NRF70_REG_DOMAIN @@ -217,6 +220,7 @@ config NRF70_SR_COEX_RF_SWITCH config NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL bool "Configuration of GPIO control for coexistence" + depends on !NRF71_ON_IPC default y config NRF70_SR_COEX_SWCTRL1_OUTPUT @@ -676,7 +680,13 @@ config NRF_WIFI_2G_BAND config NRF_WIFI_5G_BAND bool "Set operation band to 5GHz" +if NRF71_ON_IPC +config NRF_WIFI_6G_BAND + bool "Set operation band to 6GHz" +config NRF_WIFI_DUAL_BAND + bool "Set operation band to 2.4GHz and 5GHz" +endif # NRF71_ON_IPC endchoice config NRF_WIFI_IFACE_MTU diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index ca539bd546b7..857205eeebbc 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -31,7 +31,11 @@ #else #include #endif /* !CONFIG_NRF70_RADIO_TEST */ +#ifdef CONFIG_NRF71_ON_IPC +#include +#else #include +#endif /* CONFIG_NRF71_ON_IPC */ #define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING diff --git a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c index baa960faee52..1e53f70c111f 100644 --- a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c +++ b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c @@ -133,6 +133,17 @@ static enum op_band get_nrf_wifi_op_band(void) if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { return BAND_24G; } +#ifdef CONFIG_NRF71_ON_IPC + if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { + return BAND_5G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { + return BAND_6G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { + return BAND_DUAL; + } +#endif /* CONFIG_NRF71_ON_IPC */ return BAND_ALL; } diff --git a/drivers/wifi/nrf_wifi/src/debug_shell.c b/drivers/wifi/nrf_wifi/src/debug_shell.c index 70fb77d6ed0d..b6ac79bf7724 100644 --- a/drivers/wifi/nrf_wifi/src/debug_shell.c +++ b/drivers/wifi/nrf_wifi/src/debug_shell.c @@ -9,7 +9,11 @@ */ #include #include +#ifdef NRF71_ON_IPC +#include +#else #include "host_rpu_umac_if.h" +#endif #include "fmac_main.h" extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 45739091b0bf..d7fcc00fb63c 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -25,7 +25,9 @@ #include #include "common/fmac_util.h" #include +#ifndef CONFIG_NRF71_ON_IPC #include +#endif /* !CONFIG_NRF71_ON_IPC */ #ifndef CONFIG_NRF70_RADIO_TEST #ifdef CONFIG_NRF70_STA_MODE @@ -66,8 +68,10 @@ BUILD_ASSERT(CONFIG_NRF70_MAX_TX_TOKENS >= 1, "At least one TX token is required"); BUILD_ASSERT(CONFIG_NRF70_MAX_TX_AGGREGATION <= 15, "Max TX aggregation is 15"); +#ifndef CONFIG_NRF71_ON_IPC BUILD_ASSERT(RPU_PKTRAM_SIZE - TOTAL_RX_SIZE >= TOTAL_TX_SIZE, "Packet RAM overflow: not enough memory for TX"); +#endif /* CONFIG_NRF71_ON_IPC */ BUILD_ASSERT(CONFIG_NRF70_TX_MAX_DATA_SIZE >= MAX_TX_FRAME_SIZE, "TX buffer size must be at least as big as the MTU and headroom"); @@ -512,6 +516,7 @@ void reg_change_callbk_fn(void *vif_ctx, } #endif /* !CONFIG_NRF70_RADIO_TEST */ +#ifndef CONFIG_NRF71_ON_IPC /* DTS uses 1dBm as the unit for TX power, while the RPU uses 0.25dBm */ #define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(nrf70), label) * 4 @@ -592,12 +597,25 @@ void configure_board_dep_params(struct nrf_wifi_board_params *board_params) board_params->pcb_loss_5g_band3 = CONFIG_NRF70_PCB_LOSS_5G_BAND3; #endif /* CONFIG_NRF70_2_4G_ONLY */ } +#endif /* CONFIG_NRF71_ON_IPC */ static enum op_band get_nrf_wifi_op_band(void) { if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { return BAND_24G; } +#ifdef CONFIG_NRF71_ON_IPC + if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { + return BAND_5G; + } + + if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { + return BAND_6G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { + return BAND_DUAL; + } +#endif /* CONFIG_NRF71_ON_IPC */ return BAND_ALL; } @@ -666,10 +684,12 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv NRF_WIFI_UMAC_VER_MIN(fw_ver), NRF_WIFI_UMAC_VER_EXTRA(fw_ver)); +#ifndef CONFIG_NRF71_ON_IPC configure_tx_pwr_settings(&tx_pwr_ctrl_params, &tx_pwr_ceil_params); configure_board_dep_params(&board_params); +#endif /* CONFIG_NRF71_ON_IPC */ #if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \ defined(CONFIG_NRF70_SYSTEM_MODE) @@ -778,6 +798,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) return 0; } +#ifndef CONFIG_NRF71_ON_IPC int ret; /* Configure all nRF70 GPIO pins to OUTPUT_INACTIVE state early @@ -792,6 +813,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) __func__, ret); return ret; } +#endif /* !CONFIG_NRF71_ON_IPC */ #ifdef CONFIG_NRF70_DATA_TX data_config.aggregation = aggregation; @@ -882,9 +904,14 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) struct nrf_wifi_sys_fmac_priv *sys_fpriv = NULL; sys_fpriv = wifi_fmac_priv(rpu_drv_priv_zep.fmac_priv); +#ifdef CONFIG_NRF71_ON_IPC + /* TODO: Revisit this */ + sys_fpriv->max_ampdu_len_per_token = 8192; +#else sys_fpriv->max_ampdu_len_per_token = (RPU_PKTRAM_SIZE - (CONFIG_NRF70_RX_NUM_BUFS * CONFIG_NRF70_RX_MAX_DATA_SIZE)) / CONFIG_NRF70_MAX_TX_TOKENS; +#endif /* CONFIG_NRF71_ON_IPC */ /* Align to 4-byte */ sys_fpriv->max_ampdu_len_per_token &= ~0x3; diff --git a/drivers/wifi/nrf_wifi/src/fw_load.c b/drivers/wifi/nrf_wifi/src/fw_load.c index 64b8608cba95..cce5a98372fc 100644 --- a/drivers/wifi/nrf_wifi/src/fw_load.c +++ b/drivers/wifi/nrf_wifi/src/fw_load.c @@ -17,14 +17,17 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include +#ifndef CONFIG_NRF71_ON_IPC static const char fw_patch[] = { #include }; +#endif /* CONFIG_NRF71_ON_IPC */ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; +#ifndef CONFIG_NRF71_ON_IPC struct nrf_wifi_fmac_fw_info fw_info = { 0 }; status = nrf_wifi_fmac_fw_parse(rpu_ctx, fw_patch, sizeof(fw_patch), &fw_info); @@ -39,5 +42,8 @@ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_fmac_fw_load failed", __func__); } +#else + status = NRF_WIFI_STATUS_SUCCESS; +#endif /* !CONFIG_NRF71_ON_IPC */ return status; } diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index c120fba1b8da..c93313e5a071 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -650,6 +650,7 @@ enum nrf_wifi_status nrf_wifi_get_mac_addr(struct nrf_wifi_vif_ctx_zep *vif_ctx_ random_mac_addr, WIFI_MAC_ADDR_LEN); #elif CONFIG_WIFI_OTP_MAC_ADDRESS +#ifndef CONFIG_NRF71_ON_IPC status = nrf_wifi_fmac_otp_mac_addr_get(fmac_dev_ctx, vif_ctx_zep->vif_idx, vif_ctx_zep->mac_addr.addr); @@ -658,6 +659,15 @@ enum nrf_wifi_status nrf_wifi_get_mac_addr(struct nrf_wifi_vif_ctx_zep *vif_ctx_ __func__); goto unlock; } +#else + /* Set dummy MAC address */ + vif_ctx_zep->mac_addr.addr[0] = 0x00; + vif_ctx_zep->mac_addr.addr[1] = 0x00; + vif_ctx_zep->mac_addr.addr[2] = 0x5E; + vif_ctx_zep->mac_addr.addr[3] = 0x00; + vif_ctx_zep->mac_addr.addr[4] = 0x10; + vif_ctx_zep->mac_addr.addr[5] = 0x00; +#endif /* !CONFIG_NRF71_ON_IPC */ #endif if (!nrf_wifi_utils_is_mac_addr_valid(vif_ctx_zep->mac_addr.addr)) { diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 8e2100e3d625..1fae3d2cf2a4 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -565,7 +565,9 @@ int nrf_wifi_set_twt(const struct device *dev, twt_info.dialog_token = twt_params->dialog_token; twt_info.twt_wake_ahead_duration = twt_params->setup.twt_wake_ahead_duration; +#ifndef CONFIG_NRF71_ON_IPC twt_info.twt_req_timeout = CONFIG_NRF_WIFI_TWT_SETUP_TIMEOUT_MS; +#endif /* CONFIG_NRF71_ON_IPC */ status = nrf_wifi_sys_fmac_twt_setup(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &twt_info); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index 99ab4a2d6f41..c923d79eccf9 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -8,14 +8,20 @@ * @brief NRF Wi-Fi util shell module */ #include +#ifdef NRF71_ON_IPC +#include +#else #include "host_rpu_umac_if.h" +#endif #include "common/fmac_util.h" #include "system/fmac_api.h" #include "fmac_main.h" #include "wifi_util.h" +#ifndef CONFIG_NRF71_ON_IPC #include "rpu_lmac_phy_stats.h" #include "rpu_umac_stats.h" +#endif extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; struct nrf_wifi_ctx_zep *ctx = &rpu_drv_priv_zep.rpu_ctx_zep; @@ -973,6 +979,7 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, } #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ +#ifndef CONFIG_NRF71_ON_IPC static int nrf_wifi_dump_stats(const struct shell *sh, struct nrf_wifi_hal_dev_ctx *hal_dev_ctx, const char *name, @@ -1096,6 +1103,7 @@ static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh, k_mutex_unlock(&ctx->rpu_lock); return ret; } +#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_STATIC_SUBCMD_SET_CREATE( nrf70_util, @@ -1200,6 +1208,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 1, 0), #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ +#ifndef CONFIG_NRF71_ON_IPC SHELL_CMD_ARG(rpu_stats_mem, NULL, "Display RPU stats by reading from memory " @@ -1207,6 +1216,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_util_dump_rpu_stats_mem, 1, 1), +#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_SUBCMD_SET_END); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.h b/drivers/wifi/nrf_wifi/src/wifi_util.h index 303d5feac99f..a2490a1df24c 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.h +++ b/drivers/wifi/nrf_wifi/src/wifi_util.h @@ -14,7 +14,11 @@ #include #include #include +#ifdef CONFIG_NRF71_ON_IPC +#include +#else #include +#endif #include #include diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 5d24fb811f15..25b69b94801c 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -19,6 +19,10 @@ #include "wpa_supp_if.h" #include +#ifdef CONFIG_NRF71_ON_IPC +#include +#include "wifi_keys.h" +#endif LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); @@ -975,6 +979,112 @@ int nrf_wifi_wpa_supp_associate(void *if_priv, struct wpa_driver_associate_param return ret; } +#ifdef CONFIG_NRF71_ON_IPC +static bool is_mic_cipher_suite(unsigned int suite) +{ + return (suite == RSN_CIPHER_SUITE_AES_128_CMAC || + suite == RSN_CIPHER_SUITE_BIP_GMAC_128 || + suite == RSN_CIPHER_SUITE_BIP_GMAC_256 || + suite == RSN_CIPHER_SUITE_BIP_CMAC_256); +} + +/* Maximum number of keys we can track (unicast + group keys) */ +#define WIFI_CRYPTO_MAX_KEYS 8 + +/* Track installed keys: key_idx -> key_type mapping */ +static struct { + bool valid; + wifi_keys_key_type_t type; + uint32_t db_id; +} installed_keys[WIFI_CRYPTO_MAX_KEYS]; + +static int wifi_import_key_to_crypto(unsigned int suite, const unsigned char *key, size_t key_len, + const unsigned char *addr, int key_idx, uint32_t db_id) +{ + wifi_keys_key_type_t type; + psa_key_attributes_t attr; + psa_key_id_t key_id; + psa_status_t status; + uint32_t key_index; + bool is_broadcast = false; + + /* Determine if this is a broadcast/group key or unicast/pairwise key */ + if (addr && is_broadcast_ether_addr(addr)) { + is_broadcast = true; + } + + /* Determine key type based on cipher suite and address */ + if (is_mic_cipher_suite(suite)) { + type = is_broadcast ? PEER_BCST_MIC : PEER_UCST_MIC; + } else { + type = is_broadcast ? PEER_BCST_ENC : PEER_UCST_ENC; + } + + /* Convert key_idx to uint32_t, ensure it's within valid range */ + key_index = (key_idx < 0) ? 0 : (uint32_t)key_idx; + + /* Initialize PSA key attributes */ + attr = wifi_keys_key_attributes_init(type, db_id, key_index); + + LOG_DBG("%s: Importing key to PSA (suite: 0x%08x, type: %d, idx: %u, len: %zu)", + __func__, suite, type, key_index, key_len); + + /* Import key to PSA */ + status = psa_import_key(&attr, key, key_len, &key_id); + if (status != PSA_SUCCESS) { + LOG_ERR("%s: Failed to import key to PSA: %d", __func__, status); + return -EIO; + } + + /* Track installed key for later destruction */ + if (key_index < WIFI_CRYPTO_MAX_KEYS) { + installed_keys[key_index].valid = true; + installed_keys[key_index].type = type; + installed_keys[key_index].db_id = db_id; + } + + LOG_DBG("%s: Key imported successfully (type: %d, idx: %u)", __func__, type, key_index); + + return 0; +} + +static int wifi_destroy_key_from_crypto(int key_idx, uint32_t db_id) +{ + psa_key_attributes_t attr; + psa_key_id_t key_id; + psa_status_t status; + uint32_t key_index; + + /* Convert key_idx to uint32_t */ + key_index = (key_idx < 0) ? 0 : (uint32_t)key_idx; + + if (key_index >= WIFI_CRYPTO_MAX_KEYS || !installed_keys[key_index].valid) { + LOG_WRN("%s: No tracked key at index %u", __func__, key_index); + /* During init supplicant deletes all keys, so, suppress error */ + return 0; + } + + /* Get the key type that was used during import */ + attr = wifi_keys_key_attributes_init(installed_keys[key_index].type, + installed_keys[key_index].db_id, key_index); + key_id = psa_get_key_id(&attr); + + LOG_DBG("%s: Destroying key (type: %d, idx: %u, key_id: 0x%08x)", + __func__, installed_keys[key_index].type, key_index, key_id); + + status = psa_destroy_key(key_id); + if (status != PSA_SUCCESS) { + LOG_ERR("%s: Failed to destroy key: %d", __func__, status); + return -EIO; + } + + /* Clear tracking entry */ + installed_keys[key_index].valid = false; + + LOG_DBG("%s: Key destroyed successfully", __func__); + return 0; +} +#endif int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum wpa_alg alg, const unsigned char *addr, int key_idx, int set_tx, @@ -1024,7 +1134,15 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w goto out; } +#ifdef CONFIG_NRF71_ON_IPC + ret = wifi_import_key_to_crypto(suite, key, key_len, addr, key_idx, 0); + if (ret) { + LOG_ERR("%s: Failed to import key to crypto: %d", __func__, ret); + goto out; + } +#else memcpy(key_info.key.nrf_wifi_key, key, key_len); +#endif key_info.key.nrf_wifi_key_len = key_len; key_info.cipher_suite = suite; @@ -1062,7 +1180,16 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_sys_fmac_del_key failed", __func__); } else { +#ifdef CONFIG_NRF71_ON_IPC + /* Destroy PSA key after successful del_key */ + ret = wifi_destroy_key_from_crypto(key_idx, 0); + if (ret) { + LOG_ERR("%s: Failed to destroy key from crypto: %d", + __func__, ret); + } +#else ret = 0; +#endif } } else { status = nrf_wifi_sys_fmac_add_key(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, @@ -2927,6 +3054,19 @@ int nrf_wifi_wpa_supp_sta_add(void *if_priv, struct hostapd_sta_add_params *para sta_info.sta_flags2.nrf_wifi_set = nrf_wifi_sta_flags_to_nrf(params->flags); sta_info.sta_flags2.nrf_wifi_mask = sta_info.sta_flags2.nrf_wifi_set | nrf_wifi_sta_flags_to_nrf(params->flags_mask); +#ifdef CONFIG_NRF71_ON_IPC + if (params->ht_capabilities) { + memcpy(&sta_info.ht_capability, + params->ht_capabilities, + sizeof(sta_info.ht_capability)); + } + + if (params->vht_capabilities) { + memcpy(&sta_info.vht_capability, + params->vht_capabilities, + sizeof(sta_info.vht_capability)); + } +#else if (params->ht_capabilities) { memcpy(sta_info.ht_capability, params->ht_capabilities, @@ -2938,6 +3078,7 @@ int nrf_wifi_wpa_supp_sta_add(void *if_priv, struct hostapd_sta_add_params *para params->vht_capabilities, sizeof(sta_info.vht_capability)); } +#endif memcpy(sta_info.mac_addr, params->addr, sizeof(sta_info.mac_addr)); diff --git a/modules/nrf_wifi/bus/CMakeLists.txt b/modules/nrf_wifi/bus/CMakeLists.txt index 63c1d2693aa5..479b118be7a1 100644 --- a/modules/nrf_wifi/bus/CMakeLists.txt +++ b/modules/nrf_wifi/bus/CMakeLists.txt @@ -26,7 +26,17 @@ if(CONFIG_NRF70_BUSLIB) inc ${NRF_WIFI_DIR}/os_if/inc ) + zephyr_library_include_directories_ifdef(CONFIG_NRF71_ON_IPC + ${NRF_WIFI_DIR}/bus_if/bal/inc + # QSPI is common to (Q)SPI and IPC + ${NRF_WIFI_DIR}/bus_if/bus/qspi/inc + ${NRF_WIFI_DIR}/fw_if/umac_if/inc/fw + ${NRF_WIFI_DIR}/hw_if/hal/inc + ) + zephyr_library_compile_definitions_ifdef(CONFIG_NRF71_ON_IPC + NRF71_ON_IPC + ) zephyr_library_sources( device.c ) @@ -43,4 +53,9 @@ if(CONFIG_NRF70_BUSLIB) rpu_hw_if.c spi_if.c ) + zephyr_library_sources_ifdef(CONFIG_NRF71_ON_IPC + ipc_if.c + ipc_service.c + spsc_qm.c + ) endif() diff --git a/modules/nrf_wifi/bus/Kconfig b/modules/nrf_wifi/bus/Kconfig index da3644673b2d..1fab99da46ff 100644 --- a/modules/nrf_wifi/bus/Kconfig +++ b/modules/nrf_wifi/bus/Kconfig @@ -23,6 +23,15 @@ config NRF70_ON_SPI $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF7000_SPI)) select SPI +config NRF71_ON_IPC + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF71_WIFI)) + select MBOX + select IPC_SERVICE + select SPSC_PBUF + help + nRF71 is a Wi-Fi and BLE combo SoC and uses IPC as a communication + between APP and Wi-Fi cores. + module = WIFI_NRF70_BUSLIB module-dep = LOG module-str = Log level for Wi-Fi nRF70 bus library diff --git a/modules/nrf_wifi/bus/device.c b/modules/nrf_wifi/bus/device.c index cd35e56618c2..611af2489c87 100644 --- a/modules/nrf_wifi/bus/device.c +++ b/modules/nrf_wifi/bus/device.c @@ -15,11 +15,23 @@ #include #include +#if defined(CONFIG_NRF71_ON_IPC) +#include "ipc_if.h" +#else #include #include "spi_if.h" static struct qspi_config config; +#endif -#if defined(CONFIG_NRF70_ON_QSPI) +#if defined(CONFIG_NRF71_ON_IPC) +static struct rpu_dev ipc = { + .init = ipc_init, + .deinit = ipc_deinit, + .send = ipc_send, + .recv = ipc_recv, + .register_rx_cb = ipc_register_rx_cb, +}; +#elif defined(CONFIG_NRF70_ON_QSPI) static struct qspi_dev qspi = {.init = qspi_init, .deinit = qspi_deinit, .read = qspi_read, @@ -33,6 +45,7 @@ static struct qspi_dev spim = {.init = spim_init, .hl_read = spim_hl_read}; #endif +#ifndef CONFIG_NRF71_ON_IPC struct qspi_config *qspi_defconfig(void) { memset(&config, 0, sizeof(struct qspi_config)); @@ -70,7 +83,9 @@ struct qspi_config *qspi_get_config(void) { return &config; } +#endif +#ifndef CONFIG_NRF71_ON_IPC struct qspi_dev *qspi_dev(void) { #if defined(CONFIG_NRF70_ON_QSPI) @@ -79,3 +94,9 @@ struct qspi_dev *qspi_dev(void) return &spim; #endif } +#else +struct rpu_dev *rpu_dev(void) +{ + return &ipc; +} +#endif /*! CONFIG_NRF71_ON_IPC */ diff --git a/modules/nrf_wifi/bus/ipc_if.c b/modules/nrf_wifi/bus/ipc_if.c new file mode 100644 index 000000000000..cd2365a9af06 --- /dev/null +++ b/modules/nrf_wifi/bus/ipc_if.c @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @brief File containing API definitions for the + * IPC bus layer of the nRF71 Wi-Fi driver. + */ +#include +#include + +LOG_MODULE_DECLARE(wifi_nrf_bus, CONFIG_WIFI_NRF70_BUSLIB_LOG_LEVEL); + +#include "ipc_if.h" +#include "bal_structs.h" +#include "qspi.h" +#include "common/hal_structs_common.h" + +/* Define addresses to use for the free queues */ +#define EVENT_FREEQ_ADDR 0x200C2000 +#define CMD_FREEQ_ADDR 0x200C3000 + +#define NUM_INSTANCES 3 +#define NUM_ENDPOINTS 1 + +struct device *ipc_instances[NUM_INSTANCES]; +struct ipc_ept ept[NUM_ENDPOINTS]; +struct ipc_ept_cfg ept_cfg[NUM_ENDPOINTS]; + +static wifi_ipc_t wifi_event; +static wifi_ipc_t wifi_cmd; +static wifi_ipc_t wifi_tx; + +static int (*callback_func)(void *data); + +static void event_recv(void *data, void *priv) +{ + struct nrf_wifi_bus_qspi_dev_ctx *dev_ctx = NULL; + struct nrf_wifi_bal_dev_ctx *bal_dev_ctx = NULL; + struct nrf_wifi_hal_dev_ctx *hal_dev_ctx = NULL; + + dev_ctx = (struct nrf_wifi_bus_qspi_dev_ctx *)priv; + bal_dev_ctx = (struct nrf_wifi_bal_dev_ctx *)dev_ctx->bal_dev_ctx; + hal_dev_ctx = (struct nrf_wifi_hal_dev_ctx *)bal_dev_ctx->hal_dev_ctx; + LOG_DBG("Event IPC received"); + + hal_dev_ctx->ipc_msg = data; + callback_func(priv); + LOG_DBG("Event IPC callback completed"); +} + +int ipc_init(void) +{ + wifi_ipc_host_event_init(&wifi_event, EVENT_FREEQ_ADDR); + LOG_DBG("Event IPC initialized"); + wifi_ipc_host_cmd_init(&wifi_cmd, CMD_FREEQ_ADDR); + LOG_DBG("Command IPC initialized"); + return 0; +} + +int ipc_deinit(void) +{ + return 0; +} + +int ipc_recv(ipc_ctx_t ctx, void *data, int len) +{ + return 0; +} + +int ipc_send(ipc_ctx_t ctx, const void *data, int len) +{ + + int ret = 0; + + switch (ctx.inst) { + case IPC_INSTANCE_CMD_CTRL: + /* IPC service on RPU may not have been established. Keep trying. */ + do { + ret = wifi_ipc_host_cmd_send_memcpy(&wifi_cmd, data, len); + } while (ret == WIFI_IPC_STATUS_BUSYQ_NOTREADY); + + /* Critical error during IPC service transfer. Should never happen. */ + if (ret == WIFI_IPC_STATUS_BUSYQ_CRITICAL_ERR) { + LOG_ERR("Critical error during IPC CMD busyq transfer"); + return -1; + } + break; + case IPC_INSTANCE_CMD_TX: + /* IPC service on RPU may not have been established. Keep trying. */ + do { + ret = wifi_ipc_host_tx_send(&wifi_tx, data); + } while (ret == WIFI_IPC_STATUS_BUSYQ_NOTREADY); + + /* Critical error during IPC service transfer. Should never happen. */ + if (ret == WIFI_IPC_STATUS_BUSYQ_CRITICAL_ERR) { + LOG_ERR("Critical error during IPC TX busyq transfer"); + return -1; + } + break; + case IPC_INSTANCE_RX: + break; + default: + break; + } + + LOG_DBG("IPC send completed: %d", ret); + + return ret; +} + +int ipc_register_rx_cb(int (*rx_handler)(void *priv), void *data) +{ + int ret; + + callback_func = rx_handler; + + ret = wifi_ipc_bind_ipc_service_tx_rx(&wifi_cmd, &wifi_event, + DEVICE_DT_GET(DT_NODELABEL(ipc0)), event_recv, data); + if (ret != WIFI_IPC_STATUS_OK) { + LOG_ERR("Failed to bind IPC service: %d", ret); + return -1; + } + + ret = wifi_ipc_bind_ipc_service(&wifi_tx, DEVICE_DT_GET(DT_NODELABEL(ipc1)), event_recv, + data); + if (ret != WIFI_IPC_STATUS_OK) { + LOG_ERR("Failed to bind IPC service: %d", ret); + return -1; + } + + return 0; +} diff --git a/modules/nrf_wifi/bus/ipc_if.h b/modules/nrf_wifi/bus/ipc_if.h new file mode 100644 index 000000000000..5dbc2edf4f4d --- /dev/null +++ b/modules/nrf_wifi/bus/ipc_if.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __IPC_IF_H__ +#define __IPC_IF_H__ + +#include +#include "ipc_service.h" + +typedef enum { + IPC_INSTANCE_CMD_CTRL = 0, + IPC_INSTANCE_CMD_TX, + IPC_INSTANCE_EVT, + IPC_INSTANCE_RX +} ipc_instances_nrf71_t; + +typedef enum { + IPC_EPT_UMAC = 0, + IPC_EPT_LMAC +} ipc_epts_nrf71_t; + +typedef struct ipc_ctx { + ipc_instances_nrf71_t inst; + ipc_epts_nrf71_t ept; +} ipc_ctx_t; + +struct rpu_dev { + int (*init)(); + int (*deinit)(void); + int (*send)(ipc_ctx_t ctx, const void *data, int len); + int (*recv)(ipc_ctx_t ctx, void *data, int len); + int (*register_rx_cb)(int (*rx_handler)(void *priv), void *data); +}; + +struct rpu_dev *rpu_dev(void); + +int ipc_init(void); +int ipc_deinit(void); +int ipc_send(ipc_ctx_t ctx, const void *data, int len); +/* Blocking Receive */ +int ipc_recv(ipc_ctx_t ctx, void *data, int len); +/* Non-blocking Receive (global, not per instance) */ +int ipc_register_rx_cb(int (*rx_handler)(void *priv), void *data); + +#endif /* __IPC_IF_H__ */ diff --git a/modules/nrf_wifi/bus/ipc_service.c b/modules/nrf_wifi/bus/ipc_service.c new file mode 100644 index 000000000000..e1e6b3cf4fb8 --- /dev/null +++ b/modules/nrf_wifi/bus/ipc_service.c @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @brief File containing API definitions for the + * IPC service layer of the nrf71 Wi-Fi driver. + */ +#include +#include + +LOG_MODULE_REGISTER(wifi_nrf_bus, CONFIG_WIFI_NRF70_BUSLIB_LOG_LEVEL); + +#include "ipc_service.h" + +static void wifi_ipc_ep_bound(void *priv) +{ + wifi_ipc_t *context = (wifi_ipc_t *)priv; + + context->busy_q.ipc_ready = true; +} + +static void wifi_ipc_recv_callback(const void *data, size_t len, void *priv) +{ + (void)len; + uint32_t global_addr = *((uint32_t *)data); + + wifi_ipc_t *context = (wifi_ipc_t *)priv; + + context->busy_q.recv_cb((void *)global_addr, context->busy_q.priv); + + if (context->free_q != NULL) { + while (!spsc32_push(context->free_q, global_addr)) { + }; + } +} + +static void wifi_ipc_busyq_init(wifi_ipc_busyq_t *busyq, const ipc_device_wrapper_t *ipc_inst, + void *rx_cb, void *priv) +{ + busyq->ipc_inst = ipc_inst; + busyq->ipc_ep_cfg.cb.bound = wifi_ipc_ep_bound; + busyq->ipc_ep_cfg.cb.received = wifi_ipc_recv_callback; + busyq->recv_cb = rx_cb; + busyq->ipc_ready = false; + busyq->priv = priv; +} + +/** + * Register the IPC service on the busy_queue + */ +static wifi_ipc_status_t wifi_ipc_busyq_register(wifi_ipc_t *context) +{ + int ret; + const struct device *ipc_instance = GET_IPC_INSTANCE(context->busy_q.ipc_inst); + + ret = ipc_service_open_instance(ipc_instance); + if (ret < 0) { + return WIFI_IPC_STATUS_INIT_ERR; + } + + context->busy_q.ipc_ep_cfg.name = "ep"; + context->busy_q.ipc_ep_cfg.priv = context; + + ret = ipc_service_register_endpoint(ipc_instance, &context->busy_q.ipc_ep, + &context->busy_q.ipc_ep_cfg); + if (ret < 0 && ret != -EALREADY) { + return WIFI_IPC_STATUS_INIT_ERR; + } + + LOG_INF("IPC busy queue registered"); + + return WIFI_IPC_STATUS_OK; +} + +wifi_ipc_status_t wifi_ipc_bind_ipc_service(wifi_ipc_t *context, + const ipc_device_wrapper_t *ipc_inst, + void (*rx_cb)(void *data, void *priv), void *priv) +{ + wifi_ipc_busyq_init(&context->busy_q, ipc_inst, rx_cb, priv); + return wifi_ipc_busyq_register(context); +} + +wifi_ipc_status_t wifi_ipc_bind_ipc_service_tx_rx(wifi_ipc_t *tx, wifi_ipc_t *rx, + const ipc_device_wrapper_t *ipc_inst, + void (*rx_cb)(void *data, void *priv), void *priv) +{ + wifi_ipc_busyq_init(&rx->busy_q, ipc_inst, rx_cb, priv); + + /** + * When initialising an IPC service, both TX and RX mailboxes need to be + * registered at the same time using a single function call. Both tx and + * rx need to refer to the same IPC instance. + */ + tx->linked_ipc = &rx->busy_q; + + return wifi_ipc_busyq_register(rx); +} + +wifi_ipc_status_t wifi_ipc_freeq_get(wifi_ipc_t *context, uint32_t *data) +{ + if (context->free_q == NULL) { + LOG_ERR("Free queue is not initialised"); + return WIFI_IPC_STATUS_FREEQ_UNINIT_ERR; + } + + if (spsc32_is_empty(context->free_q)) { + LOG_DBG("Free queue is empty"); + return WIFI_IPC_STATUS_FREEQ_EMPTY; + } + + if (!spsc32_read_head(context->free_q, data)) { + LOG_DBG("Free queue is empty"); + return WIFI_IPC_STATUS_FREEQ_EMPTY; + } + + return WIFI_IPC_STATUS_OK; +} + +wifi_ipc_status_t wifi_ipc_freeq_send(wifi_ipc_t *context, uint32_t data) +{ + return (spsc32_push(context->free_q, data) == true ? WIFI_IPC_STATUS_OK + : WIFI_IPC_STATUS_FREEQ_FULL); +} + +wifi_ipc_status_t wifi_ipc_busyq_send(wifi_ipc_t *context, uint32_t *data) +{ + /* Get correct linked endpoint */ + wifi_ipc_busyq_t *busyq = + context->linked_ipc ? context->linked_ipc : &context->busy_q; + + if (!busyq->ipc_ready) { + LOG_ERR("IPC service is not ready"); + return WIFI_IPC_STATUS_BUSYQ_NOTREADY; + } + + int ret = ipc_service_send(&busyq->ipc_ep, data, sizeof(*data)); + + if (ret == -ENOMEM) { + LOG_ERR("No space in the buffer"); + /* No space in the buffer */ + return WIFI_IPC_STATUS_BUSYQ_FULL; + } else if (ret < 0) { + LOG_ERR("Critical IPC failure: %d", ret); + /* Critical IPC failure */ + return WIFI_IPC_STATUS_BUSYQ_CRITICAL_ERR; + } + + if (context->free_q != NULL) { + /* Free up global address pointer from the free queue */ + uint32_t data_out; + + return (spsc32_pop(context->free_q, &data_out) == true + ? (*data == data_out ? WIFI_IPC_STATUS_OK + : WIFI_IPC_STATUS_FREEQ_INVALID) + : WIFI_IPC_STATUS_FREEQ_EMPTY); + } + + return WIFI_IPC_STATUS_OK; +} + +wifi_ipc_status_t wifi_ipc_host_cmd_init(wifi_ipc_t *context, uint32_t addr_freeq) +{ + context->free_q = (void *)addr_freeq; + return WIFI_IPC_STATUS_OK; +} + +wifi_ipc_status_t wifi_ipc_host_event_init(wifi_ipc_t *context, uint32_t addr_freeq) +{ + context->free_q = (void *)addr_freeq; + return WIFI_IPC_STATUS_OK; +} + +wifi_ipc_status_t wifi_ipc_host_cmd_get(wifi_ipc_t *context, uint32_t *data) +{ + return wifi_ipc_freeq_get(context, data); +} + +wifi_ipc_status_t wifi_ipc_host_cmd_send(wifi_ipc_t *context, uint32_t *data) +{ + return wifi_ipc_busyq_send(context, data); +} + +wifi_ipc_status_t wifi_ipc_host_cmd_send_memcpy(wifi_ipc_t *context, const void *msg, + size_t len) +{ + int ret; + uint32_t gdram_addr; + + ret = wifi_ipc_host_cmd_get(context, &gdram_addr); + if (ret != WIFI_IPC_STATUS_OK) { + LOG_ERR("Failed to get command location from free queue: %d", ret); + return ret; + } + + memcpy((void *)gdram_addr, msg, len); + + return wifi_ipc_host_cmd_send(context, &gdram_addr); +} + +wifi_ipc_status_t wifi_ipc_host_tx_send(wifi_ipc_t *context, const void *msg) +{ + return wifi_ipc_host_cmd_send(context, (uint32_t *)&msg); +} diff --git a/modules/nrf_wifi/bus/ipc_service.h b/modules/nrf_wifi/bus/ipc_service.h new file mode 100644 index 000000000000..3d355e0c23a9 --- /dev/null +++ b/modules/nrf_wifi/bus/ipc_service.h @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef IPC_SERVICE_H +#define IPC_SERVICE_H + +#include +#include +#include "spsc_qm.h" + +#define GET_IPC_INSTANCE(dev) (dev) +typedef struct device ipc_device_wrapper_t; + +#include +#include + +/* + * Must be large enough to contain the internal struct (spsc_pbuf struct) and + * at least two bytes of data (one is reserved for written message length) + */ +#define _MIN_SPSC_SIZE (sizeof(spsc_queue_t) + sizeof(uint32_t)) +/* + * TODO: Unsure why some additional bytes are needed for overhead. + */ +#define WIFI_IPC_GET_SPSC_SIZE(x) (_MIN_SPSC_SIZE + 12 + (x)) + +/* 4 x cmd location 32-bit pointers of 400 bytes each */ +#define WIFI_IPC_CMD_SIZE 400 +#define WIFI_IPC_CMD_NUM 4 +#define WIFI_IPC_CMD_SPSC_SIZE WIFI_IPC_GET_SPSC_SIZE(WIFI_IPC_CMD_NUM * sizeof(uint32_t)) + +/* 7 x event location 32-bit pointers of 1000 bytes each */ +#define WIFI_IPC_EVENT_SIZE 1000 +#define WIFI_IPC_EVENT_NUM 7 +#define WIFI_IPC_EVENT_SPSC_SIZE WIFI_IPC_GET_SPSC_SIZE(WIFI_IPC_EVENT_NUM * sizeof(uint32_t)) + +/** + * @enum wifi_ipc_status_t + * @brief Status codes for the Wi-Fi IPC service. + * + * This enumeration defines various status codes that represent + * the state or result of operations in the Wi-Fi IPC service. + */ +typedef enum { + /** Status indicating the operation completed successfully. */ + WIFI_IPC_STATUS_OK = 0, + + /** Error indicating failure to register IPC service for the Busy queue. */ + WIFI_IPC_STATUS_INIT_ERR, + + /** Error indicating that the Free queue has not been initialized. */ + WIFI_IPC_STATUS_FREEQ_UNINIT_ERR, + + /** Status indicating that the Free queue is empty. */ + WIFI_IPC_STATUS_FREEQ_EMPTY, + + /** Error indicating that the value passed to wifi_ipc_busyq_send() + * does not match the value from the Free queue. + */ + WIFI_IPC_STATUS_FREEQ_INVALID, + + /** Status indicating that the Free queue is full. */ + WIFI_IPC_STATUS_FREEQ_FULL, + + /** Error indicating that the IPC service for the Busy queue connection + * has not been established. + */ + WIFI_IPC_STATUS_BUSYQ_NOTREADY, + + /** Status indicating that the Busy queue is full. */ + WIFI_IPC_STATUS_BUSYQ_FULL, + + /** Critical error indicating an IPC transfer failure. This should never happen. */ + WIFI_IPC_STATUS_BUSYQ_CRITICAL_ERR, +} wifi_ipc_status_t; + +/** + * Structure to hold context information for busy queue. + */ +typedef struct { + const ipc_device_wrapper_t *ipc_inst; + struct ipc_ept ipc_ep; + struct ipc_ept_cfg ipc_ep_cfg; + void (*recv_cb)(const void *data, const void *priv); + const void *priv; + volatile bool ipc_ready; +} wifi_ipc_busyq_t; + +/** + * Top-level structure to hold context information for sending data between RPU + * and the Host. + */ +typedef struct { + spsc_queue_t *free_q; + + wifi_ipc_busyq_t busy_q; + wifi_ipc_busyq_t *linked_ipc; +} wifi_ipc_t; + +/** + * Performs memory-to-memory copy via MVDMA. + * + * Enters low power state by issuing wait-for-interrupt (WFI) while waiting for + * MVDMA event to complete. + * + * @param[in] p_dest : Pointer to destination memory to be copied to. + * @param[in] p_src : Pointer to source memory to be copied from. + * @param[in] len : Number of bytes to be copied. + */ +void wifi_ipc_mvdma_copy(void *p_dest, const void *p_src, size_t len); + +/** + * Bind either TX or RX context to one IPC service. This utilises the half-duplex + * capability of the IPC service. + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[in] ipc_inst : Pointer to the IPC instance. + * @param[in] rx_cb : If binding RX context, this is the callback function. + * Leave NULL if binding to a TX. + * @param[in] priv : If binding RX context, this is the private data to be passed + * along with the callback function. + * Leave NULL if binding to a TX. + * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_init_err. + */ +wifi_ipc_status_t wifi_ipc_bind_ipc_service(wifi_ipc_t *p_context, + const ipc_device_wrapper_t *ipc_inst, + void (*rx_cb)(void *data, void *priv), void *priv); + +/** + * Bind both TX and RX contexts to a single IPC service. This utilises the + * full-duplex capability of the IPC service. + * + * @param[in] p_tx : Pointer to wifi_ipc_t struct to bind IPC TX mailbox to. + * @param[in] p_rx : Pointer to wifi_ipc_t struct to bind IPC RX mailbox to. + * @param[in] ipc_inst : Pointer to the IPC instance. + * @param[in] rx_cb : Callback function to bind to data in received from RX mailbox. + * @param[in] priv : Private data to the callback function. + * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_init_err. + */ +wifi_ipc_status_t wifi_ipc_bind_ipc_service_tx_rx(wifi_ipc_t *p_tx, wifi_ipc_t *p_rx, + const ipc_device_wrapper_t *ipc_inst, + void (*rx_cb)(void *data, void *priv), + void *priv); + +/** + * Get data from the free queue. + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[out] data : Pointer to the data to read to. + * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_freeq_empty. + */ +wifi_ipc_status_t wifi_ipc_freeq_get(wifi_ipc_t *p_context, uint32_t *data); + +/** + * Send data to the free queue. + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[in] data : 32-bit data to send. + * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_freeq_full. + */ +wifi_ipc_status_t wifi_ipc_freeq_send(wifi_ipc_t *p_context, uint32_t data); + +/** + * Send data to the busy queue over IPC service, and pop the same data from the + * free queue. + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[in] data : Pointer to the data to send to. + * @return : wifi_ipc_status_ok if successful, otherwise one of the following: + * - wifi_ipc_status_busyq_notready + * - wifi_ipc_status_busyq_full + * - wifi_ipc_status_busyq_critical_err + * - wifi_ipc_status_freeq_invalid + * - wifi_ipc_status_freeq_empty + */ +wifi_ipc_status_t wifi_ipc_busyq_send(wifi_ipc_t *p_context, uint32_t *data); + +/** + * Prepares and initialises the Host for sending a command to RPU. + * + * The free queue points to the already allocated free queue from the RPU. + * + * The busy queue using IPC service must be initialised using @see wifi_ipc_bind_ipc_service() + * or @see wifi_ipc_bind_ipc_service_tx_rx(). + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[in] addr_freeq : Address of the allocated free queue. + * @return : wifi_ipc_status_ok if successful. + */ +wifi_ipc_status_t wifi_ipc_host_cmd_init(wifi_ipc_t *p_context, uint32_t addr_freeq); + +/** + * Prepares and initialises the Host for receiving an event from RPU. + * + * The free queue points to the already allocated free queue from the RPU. + * + * The busy queue using IPC service must be initialised using @see wifi_ipc_bind_ipc_service() + * or @see wifi_ipc_bind_ipc_service_tx_rx(). + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[in] addr_freeq : Address of the allocated SPSC free queue. + * @return : wifi_ipc_status_ok if successful. + */ +wifi_ipc_status_t wifi_ipc_host_event_init(wifi_ipc_t *p_context, uint32_t addr_freeq); + +/** + * Get a command location from the free queue. + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[out] p_data : Pointer to data to write event location to. + * @return : wifi_ipc_status_ok if successful, otherwise wifi_ipc_status_freeq_empty. + */ +wifi_ipc_status_t wifi_ipc_host_cmd_get(wifi_ipc_t *p_context, uint32_t *p_data); + +/** + * Send an event location pointer to the Host and frees up the event location + * pointer from the free queue. + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[in] p_data : Pointer to command location to be sent. + * @return : wifi_ipc_status_ok if successful, otherwise one of the following + * - wifi_ipc_status_busyq_notready + * - wifi_ipc_status_busyq_full + * - wifi_ipc_status_busyq_critical_err + * - wifi_ipc_status_freeq_invalid + * - wifi_ipc_status_freeq_empty + */ +wifi_ipc_status_t wifi_ipc_host_cmd_send(wifi_ipc_t *p_context, uint32_t *p_data); + +/** + * Send a command from the Host to RPU using standard memcpy. + * + * 1. Retrieves an address pointer of Packet RAM from the free queue. + * 2. Copies local message to the retrieved address pointer via memcpy. + * 3. Sends the address pointer to the busy queue via IPC service. + * 4. Upon successful transmission, removes the address pointer the free queue. + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[in] p_msg : Pointer the local message to be copied to Packet RAM via memcpy. + * @param[in] len : Length of the local message in bytes. + * @return : wifi_ipc_status_ok if send is successful, otherwise one of + * status code from wifi_ipc_status_t will be returned. + */ +wifi_ipc_status_t wifi_ipc_host_cmd_send_memcpy(wifi_ipc_t *p_context, const void *p_msg, + size_t len); + +/** + * Send a tx data pointer from the Host to RPU and raises RPU interrupt. + * + * @param[in] p_context : Pointer to wifi_ipc_t struct. + * @param[in] p_msg : Pointer to message. + * @return : wifi_ipc_status_ok if send is successful, otherwise one of + * status code from wifi_ipc_status_t will be returned. + */ +wifi_ipc_status_t wifi_ipc_host_tx_send(wifi_ipc_t *p_context, const void *p_msg); + +#endif /* IPC_SERVICE_H */ diff --git a/modules/nrf_wifi/bus/spsc_qm.c b/modules/nrf_wifi/bus/spsc_qm.c new file mode 100644 index 000000000000..01da1b5e8973 --- /dev/null +++ b/modules/nrf_wifi/bus/spsc_qm.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @brief File containing API definitions for the + * SPSC queue management layer of the nRF71 Wi-Fi driver. + */ +#include +#include + +LOG_MODULE_DECLARE(wifi_nrf_bus, CONFIG_WIFI_NRF70_BUSLIB_LOG_LEVEL); + +#include "spsc_qm.h" + +spsc_queue_t *spsc32_init(uint32_t address, size_t size) +{ + return spsc_pbuf_init((void *)address, size, 0); +} + +bool spsc32_push(spsc_queue_t *queue, uint32_t value) +{ + char *pbuf; + uint8_t len = sizeof(uint32_t); + + if (spsc_pbuf_alloc(queue, len, &pbuf) != len) { + LOG_ERR("%s: Failed to allocate buffer", __func__); + return false; + } + + memcpy(pbuf, &value, len); + spsc_pbuf_commit(queue, len); + + return true; +} + +bool spsc32_pop(spsc_queue_t *queue, uint32_t *out_value) +{ + char *buf; + uint16_t plen = spsc_pbuf_claim(queue, &buf); + + if (plen == 0) { + LOG_ERR("%s: Failed to claim buffer", __func__); + return false; + } + + spsc_pbuf_free(queue, plen); + + *out_value = *((uint32_t *)buf); + + return true; +} + +bool spsc32_read_head(spsc_queue_t *queue, uint32_t *out_value) +{ + char *buf; + uint16_t plen = spsc_pbuf_claim(queue, &buf); + + if (plen == 0) { + LOG_ERR("%s: Failed to claim buffer", __func__); + return false; + } + + *out_value = *((uint32_t *)buf); + + return true; +} + +bool spsc32_is_empty(spsc_queue_t *queue) +{ + char *buf; + + return spsc_pbuf_claim(queue, &buf) == 0; +} + +bool spsc32_is_full(spsc_queue_t *queue) +{ + char *pbuf; + uint8_t len = sizeof(uint32_t); + + return spsc_pbuf_alloc(queue, len, &pbuf) != len; +} diff --git a/modules/nrf_wifi/bus/spsc_qm.h b/modules/nrf_wifi/bus/spsc_qm.h new file mode 100644 index 000000000000..063cb470b525 --- /dev/null +++ b/modules/nrf_wifi/bus/spsc_qm.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @brief File containing API definitions for the + * SPSC queue management layer of the nRF71 Wi-Fi driver. + + * SPSC Queue Manager API for handling 32-bit values. + * + * The Queue Manager API for Single-Producer, Single-Consumer (SPSC) queue. This + * API allows queues to be allocated, pushed and popped. + */ + +#ifndef SPSC_QM_H +#define SPSC_QM_H + +#include + +#include +#include + +typedef struct spsc_pbuf spsc_queue_t; + +/** + * Initialise and allocate SPSC queue. + * + * @param[in] address : Address to allocate. + * @param[in] size : Size in bytes to allocate. + * @return : SPSC packet queue. + */ +spsc_queue_t *spsc32_init(uint32_t address, size_t size); + +/** + * Push a value onto the tail of a queue. + * + * @param[in] pb : Pointer to SPSC packet queue. + * @param[in] value : The value to push to the queue. + * @return : true if push is successful, false otherwise. + */ +bool spsc32_push(spsc_queue_t *pb, uint32_t value); + +/** + * Pop a value from the head of a queue and return it. + * + * @param[in] pb : Pointer to SPSC packet queue. + * @param[out] out_value : Pointer to the value to pop to. + * @return : true if pop is successful, false otherwise. + */ +bool spsc32_pop(spsc_queue_t *pb, uint32_t *out_value); + +/** + * Return a value at the head of a queue without popping it. + * + * @param[in] pb : Pointer to SPSC packet queue. + * @param[out] out_value : Pointer to value to read from the head of the queue. + * @return : true if read is successful, false otherwise. + */ +bool spsc32_read_head(spsc_queue_t *pb, uint32_t *out_value); + +/** + * Test whether a queue is empty. + * + * @param[in] pb : Pointer to SPSC packet queue. + * @return : true if the queue is empty, false otherwise. + */ +bool spsc32_is_empty(spsc_queue_t *pb); + +/** + * Test whether a queue is full. + * + * @param[in] pb : Pointer to SPSC packet queue. + * @return : true if the queue is full, false otherwise. + */ +bool spsc32_is_full(spsc_queue_t *pb); + +#endif /* SPSC_QM_H */ diff --git a/modules/nrf_wifi/os/CMakeLists.txt b/modules/nrf_wifi/os/CMakeLists.txt index e4f9cf2a0b6d..ce1c9a850c88 100644 --- a/modules/nrf_wifi/os/CMakeLists.txt +++ b/modules/nrf_wifi/os/CMakeLists.txt @@ -15,5 +15,13 @@ zephyr_library_sources( timer.c work.c ) +zephyr_include_directories_ifdef(CONFIG_NRF71_ON_IPC + ${CMAKE_CURRENT_LIST_DIR}/../bus/ + ${CMAKE_CURRENT_LIST_DIR}/../hw_if/hal/inc +) + +zephyr_library_compile_definitions_ifdef(CONFIG_NRF71_ON_IPC + NRF71_ON_IPC +) zephyr_library_link_libraries(nrf-wifi-osal) diff --git a/modules/nrf_wifi/os/shim.c b/modules/nrf_wifi/os/shim.c index 61f1baf500ab..99224b665338 100644 --- a/modules/nrf_wifi/os/shim.c +++ b/modules/nrf_wifi/os/shim.c @@ -18,8 +18,12 @@ #include #include #include +#ifdef CONFIG_NRF71_ON_IPC +#include "ipc_if.h" +#else #include #include +#endif /* CONFIG_NRF71_ON_IPC */ #include #include "shim.h" @@ -136,6 +140,7 @@ static int zep_shim_mem_cmp(const void *addr1, return memcmp(addr1, addr2, size); } +#ifndef CONFIG_NRF71_ON_IPC static unsigned int zep_shim_qspi_read_reg32(void *priv, unsigned long addr) { unsigned int val; @@ -188,6 +193,7 @@ static void zep_shim_qspi_cpy_to(void *priv, unsigned long addr, const void *src dev->write(addr, src, count_aligned); } +#endif /* !CONFIG_NRF71_ON_IPC */ static void *zep_shim_spinlock_alloc(void) { @@ -876,14 +882,56 @@ static enum nrf_wifi_status zep_shim_bus_qspi_dev_init(void *os_qspi_dev_ctx) static void zep_shim_bus_qspi_dev_deinit(void *priv) { struct zep_shim_bus_qspi_priv *qspi_priv = priv; +#ifndef CONFIG_NRF71_ON_IPC volatile struct qspi_dev *dev = qspi_priv->qspi_dev; +#else + volatile struct rpu_dev *dev = qspi_priv->qspi_dev; +#endif /* !CONFIG_NRF71_ON_IPC */ dev->deinit(); } +#ifdef CONFIG_NRF71_ON_IPC +static int ipc_send_msg(unsigned int msg_type, void *msg, unsigned int len) +{ + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + struct rpu_dev *dev = rpu_dev(); + int ret; + ipc_ctx_t ctx; + + switch (msg_type) { + case NRF_WIFI_HAL_MSG_TYPE_CMD_CTRL: + ctx.inst = IPC_INSTANCE_CMD_CTRL; + ctx.ept = IPC_EPT_UMAC; + break; + case NRF_WIFI_HAL_MSG_TYPE_CMD_DATA_TX: + ctx.inst = IPC_INSTANCE_CMD_TX; + ctx.ept = IPC_EPT_UMAC; + break; + case NRF_WIFI_HAL_MSG_TYPE_CMD_DATA_RX: + ctx.inst = IPC_INSTANCE_RX; + ctx.ept = IPC_EPT_LMAC; + break; + default: + nrf_wifi_osal_log_err("%s: Invalid msg_type (%d)", __func__, msg_type); + goto out; + }; + + ret = dev->send(ctx, msg, len); + if (ret < 0) { + nrf_wifi_osal_log_err("%s: Sending message to RPU failed\n", __func__); + goto out; + } + + status = NRF_WIFI_STATUS_SUCCESS; +out: + return status; +} +#endif /* CONFIG_NRF71_ON_IPC */ static void *zep_shim_bus_qspi_dev_add(void *os_qspi_priv, void *osal_qspi_dev_ctx) { struct zep_shim_bus_qspi_priv *zep_qspi_priv = os_qspi_priv; +#ifndef CONFIG_NRF71_ON_IPC struct qspi_dev *dev = qspi_dev(); int ret; enum nrf_wifi_status status; @@ -905,6 +953,11 @@ static void *zep_shim_bus_qspi_dev_add(void *os_qspi_priv, void *osal_qspi_dev_c LOG_ERR("%s: RPU enable failed with error %d", __func__, ret); return NULL; } +#else + struct rpu_dev *dev = rpu_dev(); + + dev->init(); +#endif /* !CONFIG_NRF71_ON_IPC */ zep_qspi_priv->qspi_dev = dev; zep_qspi_priv->dev_added = true; @@ -918,8 +971,10 @@ static void zep_shim_bus_qspi_dev_rem(void *priv) ARG_UNUSED(dev); +#ifndef CONFIG_NRF71_ON_IPC /* TODO: Make qspi_dev a dynamic instance and remove it here */ rpu_disable(); +#endif /* !CONFIG_NRF71_ON_IPC */ } static void *zep_shim_bus_qspi_init(void) @@ -977,6 +1032,7 @@ static void zep_shim_bus_qspi_dev_host_map_get(void *os_qspi_dev_ctx, host_map->addr = 0; } +#ifndef CONFIG_NRF71_ON_IPC static void irq_work_handler(struct k_work *work) { int ret = 0; @@ -1009,6 +1065,7 @@ static void zep_shim_irq_handler(const struct device *dev, struct gpio_callback k_work_schedule_for_queue(&zep_wifi_intr_q, &intr_priv->work, K_NO_WAIT); } +#endif /* !CONFIG_NRF71_ON_IPC */ static enum nrf_wifi_status zep_shim_bus_qspi_intr_reg(void *os_dev_ctx, void *callbk_data, int (*callbk_fn)(void *callbk_data)) @@ -1018,6 +1075,14 @@ static enum nrf_wifi_status zep_shim_bus_qspi_intr_reg(void *os_dev_ctx, void *c ARG_UNUSED(os_dev_ctx); +#ifdef CONFIG_NRF71_ON_IPC + ret = ipc_register_rx_cb(callbk_fn, callbk_data); + if (ret) { + LOG_ERR("%s: ipc_register_rx_cb failed\n", __func__); + goto out; + } + status = NRF_WIFI_STATUS_SUCCESS; +#else intr_priv = zep_shim_mem_zalloc(sizeof(*intr_priv)); if (!intr_priv) { @@ -1040,16 +1105,20 @@ static enum nrf_wifi_status zep_shim_bus_qspi_intr_reg(void *os_dev_ctx, void *c } status = NRF_WIFI_STATUS_SUCCESS; +#endif /* CONFIG_NRF71_ON_IPC */ out: return status; } static void zep_shim_bus_qspi_intr_unreg(void *os_qspi_dev_ctx) { +#ifndef CONFIG_NRF71_ON_IPC struct k_work_sync sync; int ret; +#endif /* !CONFIG_NRF71_ON_IPC */ ARG_UNUSED(os_qspi_dev_ctx); +#ifndef CONFIG_NRF71_ON_IPC ret = rpu_irq_remove(&intr_priv->gpio_cb_data); if (ret) { LOG_ERR("%s: rpu_irq_remove failed", __func__); @@ -1060,6 +1129,7 @@ static void zep_shim_bus_qspi_intr_unreg(void *os_qspi_dev_ctx) zep_shim_mem_free(intr_priv); intr_priv = NULL; +#endif /*! CONFIG_NRF71_ON_IPC */ } #ifdef CONFIG_NRF_WIFI_LOW_POWER @@ -1140,10 +1210,12 @@ const struct nrf_wifi_osal_ops nrf_wifi_os_zep_ops = { .mem_cpy = zep_shim_mem_cpy, .mem_set = zep_shim_mem_set, .mem_cmp = zep_shim_mem_cmp, +#ifndef CONFIG_NRF71_ON_IPC .qspi_read_reg32 = zep_shim_qspi_read_reg32, .qspi_write_reg32 = zep_shim_qspi_write_reg32, .qspi_cpy_from = zep_shim_qspi_cpy_from, .qspi_cpy_to = zep_shim_qspi_cpy_to, +#endif /* CONFIG_NRF71_ON_IPC */ .spinlock_alloc = zep_shim_spinlock_alloc, .spinlock_free = zep_shim_spinlock_free, .spinlock_init = zep_shim_spinlock_init, @@ -1230,4 +1302,7 @@ const struct nrf_wifi_osal_ops nrf_wifi_os_zep_ops = { #endif /* CONFIG_NRF_WIFI_LOW_POWER */ .assert = zep_shim_assert, .strlen = zep_shim_strlen, +#ifdef CONFIG_NRF71_ON_IPC + .ipc_send_msg = ipc_send_msg, +#endif /* CONFIG_NRF71_ON_IPC */ }; diff --git a/subsys/ipc/ipc_service/lib/Kconfig.icmsg b/subsys/ipc/ipc_service/lib/Kconfig.icmsg index 6bbc79d4fa2a..fa84c399ffb5 100644 --- a/subsys/ipc/ipc_service/lib/Kconfig.icmsg +++ b/subsys/ipc/ipc_service/lib/Kconfig.icmsg @@ -43,6 +43,7 @@ if IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE config IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE int "Size of RX work queue stack" + default 5400 if NRF71_ON_IPC default 1280 help Size of stack used by work queue RX thread. This work queue is From 57b4312bd4003863f8decd259641552edaf9fa75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:08 +0200 Subject: [PATCH 2762/3334] Revert "[nrf fromtree] drivers: wifi: nrf_wifi: configure GPIO pins early during driver init" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0c696d07b19bf9567dd8e77e45670f048f16f793. Signed-off-by: Andrzej Głąbek --- drivers/wifi/nrf_wifi/src/coex.c | 31 +------ drivers/wifi/nrf_wifi/src/fmac_main.c | 22 +---- .../drivers/wifi/nrf_wifi/bus/rpu_hw_if.h | 4 +- modules/nrf_wifi/bus/rpu_hw_if.c | 92 +------------------ 4 files changed, 4 insertions(+), 145 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/coex.c b/drivers/wifi/nrf_wifi/src/coex.c index a5abf1807217..a9147aad5dc9 100644 --- a/drivers/wifi/nrf_wifi/src/coex.c +++ b/drivers/wifi/nrf_wifi/src/coex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2026 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -289,35 +289,6 @@ int nrf_wifi_coex_hw_reset(void) } #ifdef CONFIG_NRF70_SR_COEX_RF_SWITCH -/** - * @brief Configure SR RF switch GPIO to OUTPUT_INACTIVE state during - * driver initialization. - * - * This function configures the SR RF switch GPIO pin to OUTPUT_INACTIVE - * state to prevent it from floating. This should be called early during - * driver initialization, before the interface is brought up. - * - * @return 0 on success, negative error code on failure - */ -int sr_gpio_config_early(void) -{ - int ret; - - if (!device_is_ready(sr_rf_switch_spec.port)) { - return -ENODEV; - } - - /* Configure SR RF switch as output in inactive (low) state to - * prevent floating pin from accidentally switching the antenna. - */ - ret = gpio_pin_configure_dt(&sr_rf_switch_spec, GPIO_OUTPUT_INACTIVE); - if (ret) { - LOG_ERR("SR GPIO early configuration failed %d", ret); - } - - return ret; -} - int sr_gpio_config(void) { int ret; diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index d7fcc00fb63c..5ddf11a14254 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2026 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -25,9 +25,6 @@ #include #include "common/fmac_util.h" #include -#ifndef CONFIG_NRF71_ON_IPC -#include -#endif /* !CONFIG_NRF71_ON_IPC */ #ifndef CONFIG_NRF70_RADIO_TEST #ifdef CONFIG_NRF70_STA_MODE @@ -798,23 +795,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) return 0; } -#ifndef CONFIG_NRF71_ON_IPC - int ret; - - /* Configure all nRF70 GPIO pins to OUTPUT_INACTIVE state early - * during driver initialization to prevent floating pins from - * accidentally powering the module or affecting RF switch. This is - * done before any other RPU initialization to ensure pins are in a - * known state. - */ - ret = nrf_wifi_gpio_config_early(); - if (ret) { - LOG_ERR("%s: nrf_wifi_gpio_config_early failed with error %d", - __func__, ret); - return ret; - } -#endif /* !CONFIG_NRF71_ON_IPC */ - #ifdef CONFIG_NRF70_DATA_TX data_config.aggregation = aggregation; data_config.wmm = IS_ENABLED(CONFIG_NRF_WIFI_FEAT_WMM); diff --git a/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h b/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h index fe5a096d5f43..c691743fd77f 100644 --- a/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h +++ b/include/zephyr/drivers/wifi/nrf_wifi/bus/rpu_hw_if.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2026 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -72,13 +72,11 @@ int rpu_read_reg(uint8_t reg_addr, uint8_t *reg_value); */ int rpu_write_reg(uint8_t reg_addr, uint8_t reg_value); -int nrf_wifi_gpio_config_early(void); int rpu_init(void); int rpu_enable(void); int rpu_disable(void); #ifdef CONFIG_NRF70_SR_COEX_RF_SWITCH -int sr_gpio_config_early(void); int sr_ant_switch(unsigned int ant_switch); int sr_gpio_remove(void); int sr_gpio_config(void); diff --git a/modules/nrf_wifi/bus/rpu_hw_if.c b/modules/nrf_wifi/bus/rpu_hw_if.c index 004c820c6322..d3ac867f0711 100644 --- a/modules/nrf_wifi/bus/rpu_hw_if.c +++ b/modules/nrf_wifi/bus/rpu_hw_if.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2026 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -183,96 +183,6 @@ int rpu_irq_remove(struct gpio_callback *irq_callback_data) return ret; } -/** - * @brief Configure RPU GPIO pins to OUTPUT_INACTIVE state during driver - * initialization. - * - * This function configures the voltage control pins (BUCKEN, VDDIO_CTRL) - * to OUTPUT_INACTIVE state to prevent them from floating. This should be - * called early during driver initialization, before the interface is - * brought up. - * - * @return 0 on success, negative error code on failure - */ -static int rpu_gpio_config_early(void) -{ - int ret; - -#ifdef NRF70_IOVDD_GPIO - if (!device_is_ready(iovdd_ctrl_spec.port)) { - LOG_ERR("IOVDD GPIO %s is not ready", iovdd_ctrl_spec.port->name); - return -ENODEV; - } -#endif - - if (!device_is_ready(bucken_spec.port)) { - LOG_ERR("BUCKEN GPIO %s is not ready", bucken_spec.port->name); - return -ENODEV; - } - - /* Configure BUCKEN as output in inactive (low) state to prevent - * floating pin from accidentally powering the module. - */ - ret = gpio_pin_configure_dt(&bucken_spec, - (GPIO_OUTPUT_INACTIVE | NRF_GPIO_DRIVE_H0H1)); - if (ret) { - LOG_ERR("BUCKEN GPIO configuration failed..."); - return ret; - } - -#ifdef NRF70_IOVDD_GPIO - /* Configure IOVDD_CTRL as output in inactive (low) state to prevent - * floating pin from accidentally enabling IOVDD. - */ - ret = gpio_pin_configure_dt(&iovdd_ctrl_spec, GPIO_OUTPUT_INACTIVE); - if (ret) { - LOG_ERR("IOVDD GPIO configuration failed..."); - gpio_pin_configure_dt(&bucken_spec, GPIO_DISCONNECTED); - return ret; - } -#endif - - return 0; -} - -/** - * @brief Configure all nRF70 GPIO pins to OUTPUT_INACTIVE state during - * driver initialization. - * - * This function configures all output GPIO pins controlled by the nRF70 - * driver (BUCKEN, VDDIO_CTRL, SR RF switch) to OUTPUT_INACTIVE state to - * prevent them from floating. This should be called early during driver - * initialization, before the interface is brought up. - * - * @return 0 on success, negative error code on failure - */ -int nrf_wifi_gpio_config_early(void) -{ - int ret; - - ret = rpu_gpio_config_early(); - if (ret) { - return ret; - } - -#ifdef CONFIG_NRF70_SR_COEX_RF_SWITCH - /* Configure SR RF switch GPIO to OUTPUT_INACTIVE state to prevent - * floating pin from accidentally switching the antenna. - */ - ret = sr_gpio_config_early(); - if (ret) { - LOG_ERR("SR GPIO early configuration failed..."); - /* Clean up RPU GPIOs on failure */ - rpu_gpio_remove(); - return ret; - } -#endif - - LOG_DBG("Early GPIO configuration done (pins set to inactive)...\n"); - - return 0; -} - static int rpu_gpio_config(void) { int ret; From 2b67a67f50e33516f64bf3e22341e16425baa8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:08 +0200 Subject: [PATCH 2763/3334] Revert "[nrf fromtree] drivers: regulator: npm13xx: add LDO soft start support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8989f27f3f7c42f5bdb86019d599002003b95eaf. Signed-off-by: Andrzej Głąbek --- drivers/regulator/regulator_npm13xx.c | 88 +++------------------------ 1 file changed, 10 insertions(+), 78 deletions(-) diff --git a/drivers/regulator/regulator_npm13xx.c b/drivers/regulator/regulator_npm13xx.c index 2047bdd40f14..c07970bb5c64 100644 --- a/drivers/regulator/regulator_npm13xx.c +++ b/drivers/regulator/regulator_npm13xx.c @@ -28,18 +28,10 @@ enum npm13xx_gpio_type { NPM13XX_GPIO_TYPE_PWM }; -/* nPM13xx base addresses */ -#define MAIN_BASE 0x00U -#define LDSW_EXTRA_BASE 0x02U -#define BUCK_BASE 0x04U -#define LDSW_BASE 0x08U -#define SHIP_BASE 0x0BU - -/* nPM13xx main register offsets */ -#define MAIN_OFFSET_VERSION 0x26U - -/* nPM13xx ldsw extra register offsets */ -#define LDSW_OFFSET_LDO_SOFT 0x08U +/* nPM13xx regulator base addresses */ +#define BUCK_BASE 0x04U +#define LDSW_BASE 0x08U +#define SHIP_BASE 0x0BU /* nPM13xx regulator register offsets */ #define BUCK_OFFSET_EN_SET 0x00U @@ -68,9 +60,6 @@ enum npm13xx_gpio_type { /* nPM13xx ship register offsets */ #define SHIP_OFFSET_SHIP 0x02U -/* relevant masks and shifts */ -#define MAIN_VERSION_MINOR_MASK 0x0FU - #define BUCK1_ON_MASK 0x04U #define BUCK2_ON_MASK 0x40U #define BUCK1_EN_PULLDOWN_MASK BIT(2) @@ -88,15 +77,6 @@ enum npm13xx_gpio_type { #define NPM13XX_GPIO_UNUSED UINT8_MAX -#define NPM1304_REV_HAS_LDO_SOFTSTART(major, minor) ((major) > 1 || ((major == 1) && (minor >= 1))) -#define DEVICE_HAS_LDO_SOFTSTART(device, major, minor) \ - ((device) == NPM1304_DEVICE && NPM1304_REV_HAS_LDO_SOFTSTART(major, minor)) - -enum npm13xx_device_variant { - NPM1300_DEVICE, - NPM1304_DEVICE, -}; - struct npm13xx_gpio_info { uint8_t pin; bool invert; @@ -110,7 +90,6 @@ struct regulator_npm13xx_pconfig { struct regulator_npm13xx_config { struct regulator_common_config common; const struct device *mfd; - enum npm13xx_device_variant device_variant; uint8_t source; int32_t retention_uv; struct npm13xx_gpio_info enable_gpios; @@ -354,61 +333,14 @@ static int set_buck_mode(const struct device *dev, uint8_t chan, regulator_mode_ return mfd_npm13xx_reg_write(config->mfd, BUCK_BASE, pwm_reg + (chan * 2U), 1U); } -static int get_pmic_revision(const struct device *dev, uint8_t *major, uint8_t *minor) -{ - const struct regulator_npm13xx_config *config = dev->config; - static uint8_t version_regs[2]; - int ret; - - if (!(version_regs[0] || version_regs[1])) { - /* avoid re-reading the registers content */ - ret = mfd_npm13xx_reg_read_burst(config->mfd, MAIN_BASE, MAIN_OFFSET_VERSION, - version_regs, 2U); - if (ret < 0) { - return ret; - } - } - - *major = version_regs[0]; - *minor = version_regs[1] & MAIN_VERSION_MINOR_MASK; - return 0; -} - static int set_ldsw_mode(const struct device *dev, uint8_t chan, regulator_mode_t mode) { const struct regulator_npm13xx_config *config = dev->config; - uint8_t major, minor; - int ret; - - ret = get_pmic_revision(dev, &major, &minor); - if (ret < 0) { - return ret; - } switch (mode) { case NPM13XX_LDSW_MODE_LDO: - if (DEVICE_HAS_LDO_SOFTSTART(config->device_variant, major, minor)) { - ret = mfd_npm13xx_reg_update(config->mfd, LDSW_EXTRA_BASE, - LDSW_OFFSET_LDO_SOFT, 1U << chan, 1U << chan); - if (ret < 0) { - return ret; - } - - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, - LDSW_OFFSET_LDOSEL + chan, 0U); - } - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_LDOSEL + chan, 1U); case NPM13XX_LDSW_MODE_LDSW: - if (DEVICE_HAS_LDO_SOFTSTART(config->device_variant, major, minor)) { - /* clear the "LDO with soft start" bit, so that LS mode can take effect */ - ret = mfd_npm13xx_reg_update(config->mfd, LDSW_EXTRA_BASE, - LDSW_OFFSET_LDO_SOFT, 0U, 1U << chan); - if (ret < 0) { - return ret; - } - } - return mfd_npm13xx_reg_write(config->mfd, LDSW_BASE, LDSW_OFFSET_LDOSEL + chan, 0U); default: return -ENOTSUP; @@ -784,7 +716,6 @@ static DEVICE_API(regulator, api) = { static const struct regulator_npm13xx_config regulator_##partno##_config_##id = { \ .common = REGULATOR_DT_COMMON_CONFIG_INIT(node_id), \ .mfd = DEVICE_DT_GET(DT_GPARENT(node_id)), \ - .device_variant = partno##_DEVICE, \ .source = _source, \ .retention_uv = DT_PROP_OR(node_id, retention_microvolt, 0), \ .soft_start = DT_ENUM_IDX_OR(node_id, soft_start_microamp, UINT8_MAX), \ @@ -814,18 +745,19 @@ static DEVICE_API(regulator, api) = { \ DEVICE_DT_INST_DEFINE(n, regulator_npm13xx_common_init, NULL, NULL, \ ®ulator_##partno##_config##n, POST_KERNEL, \ - CONFIG_REGULATOR_NPM13XX_COMMON_INIT_PRIORITY, &parent_api); \ + CONFIG_REGULATOR_NPM13XX_COMMON_INIT_PRIORITY, \ + &parent_api); \ \ REGULATOR_NPM13XX_DEFINE_COND(partno, n, buck1, NPM13XX_SOURCE_BUCK1) \ REGULATOR_NPM13XX_DEFINE_COND(partno, n, buck2, NPM13XX_SOURCE_BUCK2) \ REGULATOR_NPM13XX_DEFINE_COND(partno, n, ldo1, NPM13XX_SOURCE_LDO1) \ REGULATOR_NPM13XX_DEFINE_COND(partno, n, ldo2, NPM13XX_SOURCE_LDO2) -#define DT_DRV_COMPAT nordic_npm1300_regulator -#define REGULATOR_NPM1300_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(NPM1300, n) +#define DT_DRV_COMPAT nordic_npm1300_regulator +#define REGULATOR_NPM1300_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(npm1300, n) DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM1300_DEFINE_ALL) #undef DT_DRV_COMPAT -#define DT_DRV_COMPAT nordic_npm1304_regulator -#define REGULATOR_NPM1304_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(NPM1304, n) +#define DT_DRV_COMPAT nordic_npm1304_regulator +#define REGULATOR_NPM1304_DEFINE_ALL(n) REGULATOR_NPM13XX_DEFINE_ALL(npm1304, n) DT_INST_FOREACH_STATUS_OKAY(REGULATOR_NPM1304_DEFINE_ALL) From ccb0eae7b54c498d2d98662f33c555f27548a4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:09 +0200 Subject: [PATCH 2764/3334] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding as default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3c80c155dc70f1a3874f365c570c6fd2adce7e2e. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi | 4 ++-- dts/vendor/nordic/nrf54lm20_a_b.dtsi | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi index 8080d21d8f94..3484a4d6fab8 100644 --- a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi @@ -22,7 +22,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &psa_rng; }; @@ -43,7 +43,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54lm20_a_b.dtsi b/dts/vendor/nordic/nrf54lm20_a_b.dtsi index 0eb0e33b7158..454bc446de0a 100644 --- a/dts/vendor/nordic/nrf54lm20_a_b.dtsi +++ b/dts/vendor/nordic/nrf54lm20_a_b.dtsi @@ -303,11 +303,6 @@ /* Note: In the nRF Connect SDK the SoftDevice Controller * is added and set as the default Bluetooth Controller. */ - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From a49ca184176835e98402b1fdc67618650905e1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:09 +0200 Subject: [PATCH 2765/3334] Revert "[nrf noup] dts: choose a psa-rng for entropy for 54lm20a" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e5c923ae0e0487609d22a2644542a674b625a356. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 6e0b57f0f0d4..d4dcee6850d6 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -31,7 +31,7 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "disabled"; + status = "okay"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; diff --git a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi index 3484a4d6fab8..484ff2afcfd5 100644 --- a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi @@ -23,7 +23,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &psa_rng; + zephyr,entropy = &rng; }; soc { @@ -34,11 +34,11 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "okay"; + status = "disabled"; }; rng: rng { - status = "disabled"; + status = "okay"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; }; From 976feedc563a010479d825e2554703b5859f6bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:09 +0200 Subject: [PATCH 2766/3334] Revert "[nrf fromtree] drivers: hwinfo_nrf: align to missing DOG1 reset reason" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 90b0dcb43385cc43668097a3579a267f80d73653. Signed-off-by: Andrzej Głąbek --- drivers/hwinfo/hwinfo_nrf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index d7b7b077546b..143a7bd200b0 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -87,8 +87,7 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length) #if NRF_POWER_HAS_RESETREAS #define REASON_WATCHDOG NRFX_RESET_REASON_DOG_MASK #else -#define REASON_WATCHDOG (NRFX_RESET_REASON_DOG0_MASK | \ - COND_CODE_1(NRFX_RESET_REASON_HAS_DOG1, (NRFX_RESET_REASON_DOG1_MASK), (0))) +#define REASON_WATCHDOG (NRFX_RESET_REASON_DOG0_MASK | NRFX_RESET_REASON_DOG1_MASK) #endif /* NRF_POWER_HAS_RESETREAS */ #endif /* NRF_RESETINFO */ From c799a1cd3ffabb808deddf53959bd38c382f2042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:10 +0200 Subject: [PATCH 2767/3334] Revert "[nrf fromtree] drivers: gppi: cleanup some resources before conn alloc" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit abfbf0735712167313d49f8c80be0a9cfac1fbc5. Signed-off-by: Andrzej Głąbek --- drivers/serial/uart_nrfx_uarte.c | 5 ----- soc/nordic/nrf53/soc.c | 4 ---- 2 files changed, 9 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 91dff7cecb93..a0ea6fe31818 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2894,11 +2894,6 @@ static int endtx_stoptx_ppi_init(NRF_UARTE_Type *uarte, { int ret; -#ifdef DPPIC_PRESENT - nrf_uarte_publish_clear(uarte, NRF_UARTE_EVENT_ENDTX); - nrf_uarte_subscribe_clear(uarte, NRF_UARTE_TASK_STOPTX); -#endif - ret = nrfx_gppi_conn_alloc( nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_ENDTX), nrf_uarte_task_address_get(uarte, NRF_UARTE_TASK_STOPTX), &data->ppi_h_endtx); diff --git a/soc/nordic/nrf53/soc.c b/soc/nordic/nrf53/soc.c index 5887399c6ace..58730f86d8c4 100644 --- a/soc/nordic/nrf53/soc.c +++ b/soc/nordic/nrf53/soc.c @@ -399,14 +399,10 @@ static int rtc_pretick_cpuapp_init(void) uint32_t task_ipc = nrf_ipc_task_address_get(NRF_IPC, ipc_task); uint32_t evt_ipc = nrf_ipc_event_address_get(NRF_IPC, ipc_event); - nrf_ipc_publish_clear(NRF_IPC, ipc_event); - nrf_ipc_subscribe_clear(NRF_IPC, ipc_task); - nrf_ipc_receive_config_set(NRF_IPC, CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET, BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_FROM_NET)); nrf_ipc_send_config_set(NRF_IPC, CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET, BIT(CONFIG_SOC_NRF53_RTC_PRETICK_IPC_CH_TO_NET)); - err = nrfx_gppi_conn_alloc(evt_ipc, task_ipc, &handle); if (err < 0) { return err; From 8e30667f87bf947ea49740c2086ee15517758542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:10 +0200 Subject: [PATCH 2768/3334] Revert "[nrf fromtree] tests: arch: arm: remove increase kobject text area" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d6528a7d08a0acb830f9a467b6b835073ffbca08. Signed-off-by: Andrzej Głąbek --- tests/arch/arm/arm_interrupt/testcase.yaml | 1 + tests/arch/arm/arm_thread_swap/testcase.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/arch/arm/arm_interrupt/testcase.yaml b/tests/arch/arm/arm_interrupt/testcase.yaml index df47b02fccd9..5836a20b9565 100644 --- a/tests/arch/arm/arm_interrupt/testcase.yaml +++ b/tests/arch/arm/arm_interrupt/testcase.yaml @@ -17,6 +17,7 @@ tests: - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_ZTEST_STACK_SIZE=1280 + - CONFIG_KOBJECT_TEXT_AREA=32768 arch.arm.interrupt.extra_exception_info: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: diff --git a/tests/arch/arm/arm_thread_swap/testcase.yaml b/tests/arch/arm/arm_thread_swap/testcase.yaml index e26d88429050..b60ad6f705d8 100644 --- a/tests/arch/arm/arm_thread_swap/testcase.yaml +++ b/tests/arch/arm/arm_thread_swap/testcase.yaml @@ -14,6 +14,7 @@ tests: - CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 + - CONFIG_KOBJECT_TEXT_AREA=32768 min_flash: 192 arch.arm.swap.common.fpu_sharing: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_ARMV7_M_ARMV8_M_FP @@ -29,4 +30,5 @@ tests: - CONFIG_ZTEST_WARN_NO_OPTIMIZATIONS=n - CONFIG_IDLE_STACK_SIZE=512 - CONFIG_MAIN_STACK_SIZE=2048 + - CONFIG_KOBJECT_TEXT_AREA=32768 min_flash: 192 From fd1b25e5076fa7f5ae883b9eb374bf856e5a2639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:10 +0200 Subject: [PATCH 2769/3334] Revert "[nrf fromtree] dts: add Axon node to nRF54LM20B" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0a50e1d440baf97f14b5c212617451110828b04e. Signed-off-by: Andrzej Głąbek --- dts/bindings/misc/nordic,axon.yaml | 16 ---------------- dts/vendor/nordic/nrf54lm20b.dtsi | 9 --------- 2 files changed, 25 deletions(-) delete mode 100644 dts/bindings/misc/nordic,axon.yaml diff --git a/dts/bindings/misc/nordic,axon.yaml b/dts/bindings/misc/nordic,axon.yaml deleted file mode 100644 index e6d4145de9d4..000000000000 --- a/dts/bindings/misc/nordic,axon.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic Axon - -compatible: "nordic,axon" - -include: - - "base.yaml" - -properties: - reg: - required: true - - interrupts: - required: true diff --git a/dts/vendor/nordic/nrf54lm20b.dtsi b/dts/vendor/nordic/nrf54lm20b.dtsi index 75c766c747bb..7734f295c2f9 100644 --- a/dts/vendor/nordic/nrf54lm20b.dtsi +++ b/dts/vendor/nordic/nrf54lm20b.dtsi @@ -5,12 +5,3 @@ */ #include "nrf54lm20_a_b.dtsi" - -&global_peripherals { - axon: axon@56000 { - compatible = "nordic,axon"; - reg = <0x56000 0x1000>; - interrupts = <86 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; -}; From d277025c1b700fe0f5a5681b8bc1d5c04e42059c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:11 +0200 Subject: [PATCH 2770/3334] Revert "[nrf fromtree] tests: drivers: watchdog: add nRF54LM20B support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e9e2d185be45d3e3587c15b500ef1ea63580f74. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 8 -------- samples/drivers/watchdog/sample.yaml | 1 - .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 9 --------- tests/drivers/watchdog/wdt_basic_api/testcase.yaml | 1 - 4 files changed, 19 deletions(-) delete mode 100644 samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index 20011e23efd8..000000000000 --- a/samples/drivers/watchdog/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/samples/drivers/watchdog/sample.yaml b/samples/drivers/watchdog/sample.yaml index 24b9bcba4628..7fd53d18762c 100644 --- a/samples/drivers/watchdog/sample.yaml +++ b/samples/drivers/watchdog/sample.yaml @@ -27,7 +27,6 @@ tests: - panb611evb/nrf54l15/cpuflpr - panb611evb/nrf54l15/cpuflpr/xip - nrf54lm20dk/nrf54lm20a/cpuapp/ns - - nrf54lm20dk/nrf54lm20b/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54l15tag/nrf54l15/cpuapp diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay deleted file mode 100644 index dcac0662ba24..000000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml index 97169e222e94..9551d3b8503f 100644 --- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml +++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml @@ -33,7 +33,6 @@ tests: - nrf54l15tag/nrf54l15/cpuflpr - nrf54l15tag/nrf54l15/cpuflpr/xip - nrf54lm20dk/nrf54lm20a/cpuapp/ns - - nrf54lm20dk/nrf54lm20b/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns - bl54l15u_dvk/nrf54l15/cpuapp/ns From 1902b747edd480d49a07802a331ead76eea74078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:11 +0200 Subject: [PATCH 2771/3334] Revert "[nrf fromtree] modules: trusted-firmware-m: add nRF54LM20B support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c29282ef1a0b1881cc97eaf4d060cbfb45f7e031. Signed-off-by: Andrzej Głąbek --- modules/trusted-firmware-m/Kconfig.tfm | 1 - .../nordic/nrf54lm20b_cpuapp/CMakeLists.txt | 23 ------------------- .../nordic/nrf54lm20b_cpuapp/config.cmake | 9 -------- .../nordic/nrf54lm20b_cpuapp/cpuarch.cmake | 9 -------- .../nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake | 10 -------- 5 files changed, 52 deletions(-) delete mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/CMakeLists.txt delete mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/config.cmake delete mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/cpuarch.cmake delete mode 100644 modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index f8acc307c12e..8440c823092f 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -36,7 +36,6 @@ config TFM_BOARD default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp" if SOC_NRF54LM20A_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf7120_cpuapp" if SOC_NRF7120_ENGA_CPUAPP - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp" if SOC_NRF54LM20B_CPUAPP help The board name used for building TFM. Building with TFM requires that TFM has been ported to the given board/SoC. diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/CMakeLists.txt b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/CMakeLists.txt deleted file mode 100644 index f15374c99bed..000000000000 --- a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (c) 2026, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(NRF_BOARD_SELECTED True) - -add_subdirectory(${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/common/nrf54lm20b nrf54lm20b) - -add_subdirectory(.. common) - -install(FILES ${CMAKE_CURRENT_LIST_DIR}/ns/cpuarch_ns.cmake - DESTINATION ${INSTALL_PLATFORM_NS_DIR} - RENAME cpuarch.cmake) - -install(FILES config.cmake - DESTINATION ${INSTALL_PLATFORM_NS_DIR}) - -install(DIRECTORY ${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/nrf54lm20dk_nrf54lm20b_cpuapp/tests - - DESTINATION ${INSTALL_PLATFORM_NS_DIR} -) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/config.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/config.cmake deleted file mode 100644 index 100e01421fda..000000000000 --- a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/config.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2026, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(NRF_SOC_VARIANT nrf54lm20b CACHE STRING "nRF SoC Variant") - -include(${PLATFORM_PATH}/common/nrf54lm20b/config.cmake) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/cpuarch.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/cpuarch.cmake deleted file mode 100644 index 319f5939f204..000000000000 --- a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/cpuarch.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2026, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(PLATFORM_PATH platform/ext/target/nordic_nrf) - -include(${PLATFORM_PATH}/common/nrf54lm20b/cpuarch.cmake) diff --git a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake b/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake deleted file mode 100644 index d1eee37de899..000000000000 --- a/modules/trusted-firmware-m/nordic/nrf54lm20b_cpuapp/ns/cpuarch_ns.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) 2026, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(PLATFORM_DIR ${CMAKE_CURRENT_LIST_DIR}) -set(PLATFORM_PATH ${CMAKE_CURRENT_LIST_DIR}) - -include(${CMAKE_CURRENT_LIST_DIR}/common/nrf54lm20b/cpuarch.cmake) From 295cb4cb0fde4aa1b4aed1f3df2f49dfba5a0d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:11 +0200 Subject: [PATCH 2772/3334] Revert "[nrf fromtree] modules: hal_nordic: add support for nRF54LM20B" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 36a4dfc64c7bb8d2c16d5536660b4ea27396ed85. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/nrfx/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index ba83619c912e..889758af5dbe 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -78,9 +78,6 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF7120_ENGA NRF7120_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF7120_ENGA_CPUAPP NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20B NRF54LM20B_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20B_CPUAPP NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20B_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9120 NRF9120_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160 NRF9160_XXAA) @@ -283,8 +280,6 @@ mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP nrf54lm20a_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR nrf54lm20a_flpr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP nrf7120_enga_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUFLPR nrf7120_enga_flpr.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF54LM20B_CPUAPP nrf54lm20b_application.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF54LM20B_CPUFLPR nrf54lm20b_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) From 5f0b17fcfff30f85c1cf710ea9c1385db14e88e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:12 +0200 Subject: [PATCH 2773/3334] Revert "[nrf fromtree] boards: nordic: nrf54lm20dk: add nRF54LM20B SoC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 949cfd47680e7803d8bbd689e02a070bb344fcb6. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54lm20dk/Kconfig.defconfig | 8 ++-- boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk | 2 - boards/nordic/nrf54lm20dk/board.cmake | 6 +-- boards/nordic/nrf54lm20dk/board.yml | 6 --- .../nrf54lm20dk_nrf54lm20b_cpuapp.dts | 21 --------- .../nrf54lm20dk_nrf54lm20b_cpuapp.yaml | 24 ---------- .../nrf54lm20dk_nrf54lm20b_cpuapp_defconfig | 26 ----------- .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts | 41 ----------------- .../nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml | 22 --------- ...nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig | 45 ------------------- .../nrf54lm20dk_nrf54lm20b_cpuflpr.dts | 23 ---------- .../nrf54lm20dk_nrf54lm20b_cpuflpr.yaml | 15 ------- .../nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig | 19 -------- 13 files changed, 7 insertions(+), 251 deletions(-) delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.yaml delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.dts delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.yaml delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig diff --git a/boards/nordic/nrf54lm20dk/Kconfig.defconfig b/boards/nordic/nrf54lm20dk/Kconfig.defconfig index d7f9c4ead8ea..c77e844b822c 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54lm20dk/Kconfig.defconfig @@ -1,18 +1,18 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP +if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP config HW_STACK_PROTECTION default ARCH_HAS_STACK_PROTECTION -endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP +endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP -if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP_NS +if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS # By default, if we build for a Non-Secure version of the board, # enable building with TF-M as the Secure Execution Environment. config BUILD_WITH_TFM default y -endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP_NS +endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS diff --git a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk index adb6b8167929..8b704357e66a 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk +++ b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk @@ -4,5 +4,3 @@ config BOARD_NRF54LM20DK select SOC_NRF54LM20A_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS select SOC_NRF54LM20A_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR - select SOC_NRF54LM20B_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20B_CPUAPP_NS - select SOC_NRF54LM20B_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20B_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake index 2f8ad51b8417..8e84753dc143 100644 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ b/boards/nordic/nrf54lm20dk/board.cmake @@ -1,13 +1,13 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_SOC_NRF54LM20A_CPUAPP OR CONFIG_SOC_NRF54LM20B_CPUAPP) +if(CONFIG_SOC_NRF54LM20A_CPUAPP) board_runner_args(jlink "--device=nRF54LM20A_M33" "--speed=4000") -elseif(CONFIG_SOC_NRF54LM20A_CPUFLPR OR CONFIG_SOC_NRF54LM20B_CPUFLPR) +elseif(CONFIG_SOC_NRF54LM20A_CPUFLPR) board_runner_args(jlink "--device=nRF54LM20A_RV32" "--speed=4000") endif() -if(CONFIG_TRUSTED_EXECUTION_NONSECURE) +if(CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS) set(TFM_PUBLIC_KEY_FORMAT "full") endif() diff --git a/boards/nordic/nrf54lm20dk/board.yml b/boards/nordic/nrf54lm20dk/board.yml index 73bcd82ecc28..86decbf7c7cd 100644 --- a/boards/nordic/nrf54lm20dk/board.yml +++ b/boards/nordic/nrf54lm20dk/board.yml @@ -9,12 +9,6 @@ board: cpucluster: cpuapp - name: xip cpucluster: cpuflpr - - name: nrf54lm20b - variants: - - name: ns - cpucluster: cpuapp - - name: xip - cpucluster: cpuflpr runners: run_once: '--recover': diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts deleted file mode 100644 index f8f9fb7a9361..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.dts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "nrf54lm20_a_b_cpuapp_common.dtsi" -#include - -/ { - compatible = "nordic,nrf54lm20dk_nrf54lm20b-cpuapp"; - model = "Nordic nRF54LM20 DK nRF54LM20B Application MCU"; - - chosen { - zephyr,code-partition = &slot0_partition; - zephyr,sram = &cpuapp_sram; - }; -}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.yaml deleted file mode 100644 index 6b1a8ed806ae..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54lm20dk/nrf54lm20b/cpuapp -name: nRF54LM20-DK-nRF54LM20B-Application -type: mcu -arch: arm -toolchain: - - gnuarmemb - - zephyr -sysbuild: true -ram: 511 -flash: 920 -supported: - - adc - - counter - - dmic - - gpio - - i2c - - i2s - - pwm - - spi - - usbd - - watchdog diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig deleted file mode 100644 index f9a1fdba322a..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_defconfig +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2026 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 - -# MPU-based null-pointer dereferencing detection cannot -# be applied as the (0x0 - 0x400) is unmapped for this target. -CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y - -# Enable Cache -CONFIG_CACHE_MANAGEMENT=y -CONFIG_EXTERNAL_CACHE=y - -# Start SYSCOUNTER on driver init -CONFIG_NRF_GRTC_START_SYSCOUNTER=y diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts deleted file mode 100644 index 7a6d3179f551..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.dts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#define USE_NON_SECURE_ADDRESS_MAP 1 - -#include -#include "nrf54lm20_a_b_cpuapp_common.dtsi" - -/ { - compatible = "nordic,nrf54lm20dk_nrf54lm20b-cpuapp-ns"; - model = "Nordic nRF54LM20 DK nRF54LM20B Application MCU Non-Secure"; - - chosen { - zephyr,code-partition = &slot0_ns_partition; - zephyr,sram = &sram0_ns; - zephyr,entropy = &psa_rng; - }; - - /delete-node/ rng; - - psa_rng: psa-rng { - status = "okay"; - }; -}; - -&bt_hci_controller { - status = "disabled"; -}; - -&uart30 { - /* Disable so that TF-M can use this UART */ - status = "disabled"; -}; - -/* Include default memory partition configuration file */ -#include diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml deleted file mode 100644 index afd7bcf905c0..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns.yaml +++ /dev/null @@ -1,22 +0,0 @@ -identifier: nrf54lm20dk/nrf54lm20b/cpuapp/ns -name: nRF54lm20-DK-nRF54lm20b-Application-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - zephyr -ram: 252 -flash: 1452 -supported: - - adc - - counter - - dmic - - gpio - - i2c - - i2s - - pwm - - spi - - usbd - - watchdog -vendor: nordic -sysbuild: true diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig deleted file mode 100644 index df94a70e6c6d..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuapp_ns_defconfig +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y -CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# Use devicetree code partition for TF-M -CONFIG_USE_DT_CODE_PARTITION=y - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable GPIO -CONFIG_GPIO=y - -# Don't enable the cache in the non-secure image as it is a -# secure-only peripheral on 54l -CONFIG_CACHE_MANAGEMENT=n -CONFIG_EXTERNAL_CACHE=n - -# Start SYSCOUNTER on driver init -CONFIG_NRF_GRTC_START_SYSCOUNTER=y - -# Disable TFM BL2 since it is not supported -CONFIG_TFM_BL2=n -# Support for silence logging is not supported at the moment -# Tracked by: NCSDK-31930 -CONFIG_TFM_LOG_LEVEL_SILENCE=n - -# The oscillators are configured as secure and cannot be configured -# from the non secure application directly. This needs to be set -# otherwise nrfx will try to configure them, resulting in a bus -# fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.dts deleted file mode 100644 index 3549e6573ca4..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.dts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "nrf54lm20_a_b_cpuflpr_common.dtsi" - -/ { - model = "Nordic nRF54LM20 DK nRF54LM20B FLPR MCU"; - compatible = "nordic,nrf54lm20dk_nrf54lm20b-cpuflpr"; - - chosen { - zephyr,console = &uart30; - zephyr,shell-uart = &uart30; - zephyr,code-partition = &cpuflpr_code_partition; - zephyr,flash = &cpuflpr_rram; - zephyr,sram = &cpuflpr_sram; - }; -}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.yaml deleted file mode 100644 index 1f250499a43e..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54lm20dk/nrf54lm20b/cpuflpr -name: nRF54LM20-DK-nRF54LM20B-Fast-Lightweight-Peripheral-Processor -type: mcu -arch: riscv -toolchain: - - zephyr -sysbuild: true -ram: 96 -flash: 96 -supported: - - counter - - gpio diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig deleted file mode 100644 index 8a0dee97d159..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20b_cpuflpr_defconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable UART driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable GPIO -CONFIG_GPIO=y - -CONFIG_USE_DT_CODE_PARTITION=y - -# Execute from SRAM -CONFIG_XIP=n - -CONFIG_RISCV_ALWAYS_SWITCH_THROUGH_ECALL=y From 1457c0f228ee01adddcd47e092cd3d4c168e537c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:12 +0200 Subject: [PATCH 2774/3334] Revert "[nrf fromtree] soc: nordic: nrf54l: add nRF54LM20B SoC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 180fa28ee0c99184096cce4b32dce3aa4d456d9d. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54l/Kconfig | 13 ------------- .../Kconfig.defconfig.nrf54lm20_a_b_cpuapp | 4 ++-- .../Kconfig.defconfig.nrf54lm20_a_b_cpuflpr | 4 ++-- soc/nordic/nrf54l/Kconfig.soc | 19 ------------------- soc/nordic/nrf54l/Kconfig.sysbuild | 2 +- soc/nordic/soc.yml | 13 ------------- 6 files changed, 5 insertions(+), 50 deletions(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 7c98bf3affd3..36d6c69b4a58 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -58,16 +58,6 @@ config SOC_NRF54LM20A_CPUAPP select CPU_HAS_FPU select HAS_SWO -config SOC_NRF54LM20B_CPUAPP - select SOC_NRF54L_CPUAPP_COMMON - select SOC_COMPATIBLE_NRF54LM20A - select SOC_COMPATIBLE_NRF54LM20A_CPUAPP - select ARMV8_M_DSP - select CPU_HAS_ARM_MPU - select CPU_HAS_ARM_SAU - select CPU_HAS_FPU - select HAS_SWO - config SOC_NRF54L05_CPUFLPR select RISCV_CORE_NORDIC_VPR @@ -81,9 +71,6 @@ config SOC_NRF54L15_CPUFLPR config SOC_NRF54LM20A_CPUFLPR select RISCV_CORE_NORDIC_VPR -config SOC_NRF54LM20B_CPUFLPR - select RISCV_CORE_NORDIC_VPR - if SOC_SERIES_NRF54L config SOC_NRF54LX_DISABLE_FICR_TRIMCNF diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp index c0458ff44258..7e5336e2212a 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp @@ -4,9 +4,9 @@ # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54LM20A_CPUAPP || SOC_NRF54LM20B_CPUAPP +if SOC_NRF54LM20A_CPUAPP config NUM_IRQS default 290 -endif # SOC_NRF54LM20A_CPUAPP || SOC_NRF54LM20B_CPUAPP +endif # SOC_NRF54LM20A_CPUAPP diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr index e6a2f9775f59..4b84d1ed8bb9 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr @@ -3,9 +3,9 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54LM20A_CPUFLPR || SOC_NRF54LM20B_CPUFLPR +if SOC_NRF54LM20A_CPUFLPR config NUM_IRQS default 287 -endif # SOC_NRF54LM20A_CPUFLPR || SOC_NRF54LM20B_CPUFLPR +endif # SOC_NRF54LM20A_CPUFLPR diff --git a/soc/nordic/nrf54l/Kconfig.soc b/soc/nordic/nrf54l/Kconfig.soc index 978345c10cc2..f550cd557a66 100644 --- a/soc/nordic/nrf54l/Kconfig.soc +++ b/soc/nordic/nrf54l/Kconfig.soc @@ -90,27 +90,8 @@ config SOC_NRF54LM20A_CPUFLPR help NRF54LM20A CPUFLPR -config SOC_NRF54LM20B - bool - select SOC_SERIES_NRF54L - help - NRF54LM20B - -config SOC_NRF54LM20B_CPUAPP - bool - select SOC_NRF54LM20B - help - NRF54LM20B CPUAPP - -config SOC_NRF54LM20B_CPUFLPR - bool - select SOC_NRF54LM20B - help - NRF54LM20B CPUFLPR - config SOC default "nrf54l05" if SOC_NRF54L05 default "nrf54l10" if SOC_NRF54L10 default "nrf54l15" if SOC_NRF54L15 default "nrf54lm20a" if SOC_NRF54LM20A - default "nrf54lm20b" if SOC_NRF54LM20B diff --git a/soc/nordic/nrf54l/Kconfig.sysbuild b/soc/nordic/nrf54l/Kconfig.sysbuild index 38828e2329a4..b2034be193dd 100644 --- a/soc/nordic/nrf54l/Kconfig.sysbuild +++ b/soc/nordic/nrf54l/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54L15_CPUFLPR || SOC_NRF54LM20A_CPUFLPR || SOC_NRF54LM20B_CPUFLPR +if SOC_NRF54L15_CPUFLPR || SOC_NRF54LM20A_CPUFLPR config HAS_NORDIC_VPR_LAUNCHER_IMAGE default y diff --git a/soc/nordic/soc.yml b/soc/nordic/soc.yml index 39076d9e4d02..aab70b717b11 100644 --- a/soc/nordic/soc.yml +++ b/soc/nordic/soc.yml @@ -37,10 +37,6 @@ family: cpuclusters: - name: cpuapp - name: cpuflpr - - name: nrf54lm20b - cpuclusters: - - name: cpuapp - - name: cpuflpr - name: nrf54h socs: - name: nrf54h20 @@ -127,9 +123,6 @@ runners: - qualifiers: - nrf54lm20a/cpuapp - nrf54lm20a/cpuflpr - - qualifiers: - - nrf54lm20b/cpuapp - - nrf54lm20b/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad @@ -193,9 +186,6 @@ runners: - qualifiers: - nrf54lm20a/cpuapp - nrf54lm20a/cpuflpr - - qualifiers: - - nrf54lm20b/cpuapp - - nrf54lm20b/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad @@ -259,9 +249,6 @@ runners: - qualifiers: - nrf54lm20a/cpuapp - nrf54lm20a/cpuflpr - - qualifiers: - - nrf54lm20b/cpuapp - - nrf54lm20b/cpuflpr - qualifiers: - nrf54h20/cpuapp - nrf54h20/cpurad From 0c04027e4acb04e18e5b27dba424747a0f0fcaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:12 +0200 Subject: [PATCH 2775/3334] Revert "[nrf fromtree] dts: nordic: add nRF54LM20B" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a035e48141e6b137892bc4813d38afa358969dbb. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf54lm20b_cpuapp.dtsi | 8 -------- dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi | 8 -------- dts/vendor/nordic/nrf54lm20b.dtsi | 7 ------- dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi | 7 ------- dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi | 7 ------- 5 files changed, 37 deletions(-) delete mode 100644 dts/arm/nordic/nrf54lm20b_cpuapp.dtsi delete mode 100644 dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi delete mode 100644 dts/vendor/nordic/nrf54lm20b.dtsi delete mode 100644 dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi delete mode 100644 dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi diff --git a/dts/arm/nordic/nrf54lm20b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20b_cpuapp.dtsi deleted file mode 100644 index 7d66c30a4d35..000000000000 --- a/dts/arm/nordic/nrf54lm20b_cpuapp.dtsi +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "nrf54lm20_a_b_cpuapp.dtsi" diff --git a/dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi b/dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi deleted file mode 100644 index a055194955a1..000000000000 --- a/dts/riscv/nordic/nrf54lm20b_cpuflpr.dtsi +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "nrf54lm20_a_b_cpuflpr.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20b.dtsi b/dts/vendor/nordic/nrf54lm20b.dtsi deleted file mode 100644 index 7734f295c2f9..000000000000 --- a/dts/vendor/nordic/nrf54lm20b.dtsi +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20_a_b.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi deleted file mode 100644 index fe16227f76b2..000000000000 --- a/dts/vendor/nordic/nrf54lm20b_cpuapp_ns_partition.dtsi +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20_a_b_cpuapp_ns_partition.dtsi" diff --git a/dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi deleted file mode 100644 index 6d6cefc88256..000000000000 --- a/dts/vendor/nordic/nrf54lm20b_cpuapp_partition.dtsi +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54lm20_a_b_cpuapp_partition.dtsi" From e6b582ccff02e767f50ca63621c67593a9ea6a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:13 +0200 Subject: [PATCH 2776/3334] Revert "[nrf fromtree] modules: trusted-firmware-m: remove Eng A naming for nRF54LM20A" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 711e2664a74308a732914d3aac13801cd46d5965. Signed-off-by: Andrzej Głąbek --- modules/trusted-firmware-m/Kconfig.tfm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 8440c823092f..a62ef049d2d8 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -34,7 +34,7 @@ config TFM_BOARD default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l15_cpuapp" if SOC_NRF54L15_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP - default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp" if SOC_NRF54LM20A_CPUAPP + default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf54lm20a_cpuapp" if SOC_NRF54LM20A_ENGA_CPUAPP default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf7120_cpuapp" if SOC_NRF7120_ENGA_CPUAPP help The board name used for building TFM. Building with TFM requires that From 656629501e9aa6a85942fc0922600ddd8ea454da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:13 +0200 Subject: [PATCH 2777/3334] Revert "[nrf fromtree] modules: hal_nordic: remove Eng A naming for nRF54LM20A" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 94938e8c3a4b75b2c26728b713c9ef462717fff5. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/nrfx/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 889758af5dbe..f2b5265ed2d0 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -68,10 +68,10 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L10_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_NRF54L15_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A NRF54LM20A_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUAPP NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A NRF54LM20A_XXAA) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA NRF54LM20A_ENGA_XXAA) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP NRF_APPLICATION) +zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR NRF_FLPR) +zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A NRF54LM20A_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54LM20A_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA NRF7120_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP NRF_APPLICATION) @@ -276,8 +276,8 @@ mdk_svd_ifdef(CONFIG_SOC_NRF54L10_CPUAPP nrf54l10_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54L10_CPUFLPR nrf54l10_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_NRF54LM20A_CPUAPP nrf54lm20a_application.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_CPUFLPR nrf54lm20a_flpr.svd) +mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP nrf54lm20a_enga_application.svd) +mdk_svd_ifdef(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR nrf54lm20a_enga_flpr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUAPP nrf7120_enga_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF7120_ENGA_CPUFLPR nrf7120_enga_flpr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF9120 nrf9120.svd) From d715cbabffb65c09fe533208bc183b1dc42d32fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:14 +0200 Subject: [PATCH 2778/3334] Revert "[nrf fromtree] boards: nordic: add common files for nrf54lm20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 95bba3eab8d6b5a32e656e6fa07faa2300872efe. Signed-off-by: Andrzej Głąbek --- .../nrf54lm20bsim_nrf54lm20a_cpuapp.dts | 4 +- boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk | 4 +- boards/nordic/nrf54lm20dk/board.cmake | 4 +- .../nrf54lm20_a_b_cpuflpr_common.dtsi | 55 ------------------- ...mon.dtsi => nrf54lm20a_cpuapp_common.dtsi} | 7 +-- ...tsi => nrf54lm20dk_nrf54lm20a-common.dtsi} | 2 +- ...si => nrf54lm20dk_nrf54lm20a-pinctrl.dtsi} | 0 .../nrf54lm20dk_nrf54lm20a_cpuapp.dts | 6 +- .../nrf54lm20dk_nrf54lm20a_cpuapp.yaml | 4 +- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts | 3 +- .../nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml | 4 +- .../nrf54lm20dk_nrf54lm20a_cpuflpr.dts | 52 +++++++++++++++++- 12 files changed, 67 insertions(+), 78 deletions(-) delete mode 100644 boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi rename boards/nordic/nrf54lm20dk/{nrf54lm20_a_b_cpuapp_common.dtsi => nrf54lm20a_cpuapp_common.dtsi} (92%) rename boards/nordic/nrf54lm20dk/{nrf54lm20dk_common.dtsi => nrf54lm20dk_nrf54lm20a-common.dtsi} (97%) rename boards/nordic/nrf54lm20dk/{nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi => nrf54lm20dk_nrf54lm20a-pinctrl.dtsi} (100%) diff --git a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts b/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts index fcc334014ce9..03482e97e260 100644 --- a/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf54lm20bsim_nrf54lm20a_cpuapp.dts @@ -7,8 +7,8 @@ /dts-v1/; #include -#include -#include <../boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi> +#include +#include <../boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi> / { model = "Nordic NRF54LM20 BSIM NRF54LM20A Application MCU"; diff --git a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk index 8b704357e66a..b311fd9ae87e 100644 --- a/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk +++ b/boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk @@ -2,5 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF54LM20DK - select SOC_NRF54LM20A_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS - select SOC_NRF54LM20A_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR + select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS + select SOC_NRF54LM20A_ENGA_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR diff --git a/boards/nordic/nrf54lm20dk/board.cmake b/boards/nordic/nrf54lm20dk/board.cmake index 8e84753dc143..f805e0d74112 100644 --- a/boards/nordic/nrf54lm20dk/board.cmake +++ b/boards/nordic/nrf54lm20dk/board.cmake @@ -1,9 +1,9 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_SOC_NRF54LM20A_CPUAPP) +if(CONFIG_SOC_NRF54LM20A_ENGA_CPUAPP) board_runner_args(jlink "--device=nRF54LM20A_M33" "--speed=4000") -elseif(CONFIG_SOC_NRF54LM20A_CPUFLPR) +elseif(CONFIG_SOC_NRF54LM20A_ENGA_CPUFLPR) board_runner_args(jlink "--device=nRF54LM20A_RV32" "--speed=4000") endif() diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi deleted file mode 100644 index 11068b98446c..000000000000 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuflpr_common.dtsi +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "nrf54lm20dk_common.dtsi" - -&cpuflpr_sram { - status = "okay"; -}; - -&cpuflpr_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - cpuflpr_code_partition: partition@0 { - label = "image-0"; - reg = <0x0 DT_SIZE_K(96)>; - }; - }; -}; - -&grtc { - owned-channels = <3 4>; - status = "okay"; -}; - -&uart30 { - status = "okay"; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&gpiote20 { - status = "okay"; -}; - -&gpiote30 { - status = "okay"; -}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi similarity index 92% rename from boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi rename to boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index b097848fe3ee..6ab124d0fb84 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20_a_b_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -6,8 +6,8 @@ /* This file is common to the secure and non-secure domain */ -#include -#include "nrf54lm20dk_common.dtsi" +#include +#include "nrf54lm20dk_nrf54lm20a-common.dtsi" / { chosen { @@ -129,6 +129,3 @@ zephyr_udc0: &usbhs { reset-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; }; }; - -/* Get a node label for wi-fi spi to use in shield files */ -wifi_spi: &spi22 {}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi similarity index 97% rename from boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi rename to boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi index 335e04deeebf..525a3a5fdc0e 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi" +#include "nrf54lm20dk_nrf54lm20a-pinctrl.dtsi" / { leds { diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi similarity index 100% rename from boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20_a_b-pinctrl.dtsi rename to boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-pinctrl.dtsi diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index 6c06a16f1576..ef47e866e4c4 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -6,8 +6,7 @@ /dts-v1/; -#include -#include "nrf54lm20_a_b_cpuapp_common.dtsi" +#include "nrf54lm20a_cpuapp_common.dtsi" #include / { @@ -19,3 +18,6 @@ zephyr,sram = &cpuapp_sram; }; }; + +/* Get a node label for wi-fi spi to use in shield files */ +wifi_spi: &spi22 {}; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml index 36c37206b219..e5a2b89087de 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.yaml @@ -9,8 +9,8 @@ toolchain: - gnuarmemb - zephyr sysbuild: true -ram: 511 -flash: 920 +ram: 512 +flash: 449 supported: - adc - counter diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts index 47ef49d2debb..78da8edbccd4 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.dts @@ -8,8 +8,7 @@ #define USE_NON_SECURE_ADDRESS_MAP 1 -#include -#include "nrf54lm20_a_b_cpuapp_common.dtsi" +#include "nrf54lm20a_cpuapp_common.dtsi" / { compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp-ns"; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml index 2bd2c023ca71..3f10201892fb 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp_ns.yaml @@ -5,8 +5,8 @@ arch: arm toolchain: - gnuarmemb - zephyr -ram: 252 -flash: 1452 +ram: 208 +flash: 1356 supported: - adc - counter diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts index 71c0fd0fe72e..11d72c63dfe8 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts @@ -5,9 +5,8 @@ */ /dts-v1/; - -#include -#include "nrf54lm20_a_b_cpuflpr_common.dtsi" +#include +#include "nrf54lm20dk_nrf54lm20a-common.dtsi" / { model = "Nordic nRF54LM20 DK nRF54LM20A FLPR MCU"; @@ -21,3 +20,50 @@ zephyr,sram = &cpuflpr_sram; }; }; + +&cpuflpr_sram { + status = "okay"; +}; + +&cpuflpr_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + 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"; +}; From 75388b424685b9015fd979fc5224b220be27e02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:14 +0200 Subject: [PATCH 2779/3334] Revert "[nrf fromtree] soc: nordic: add common files for nrf54lm20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cc4f79909c69eb8c835a24cea2791390e7e7d791. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54l/Kconfig | 4 ++-- ... => Kconfig.defconfig.nrf54lm20a_enga_cpuapp} | 6 +++--- ...=> Kconfig.defconfig.nrf54lm20a_enga_cpuflpr} | 6 +++--- soc/nordic/nrf54l/Kconfig.soc | 16 +++++++++++----- soc/nordic/nrf54l/Kconfig.sysbuild | 2 +- 5 files changed, 20 insertions(+), 14 deletions(-) rename soc/nordic/nrf54l/{Kconfig.defconfig.nrf54lm20_a_b_cpuapp => Kconfig.defconfig.nrf54lm20a_enga_cpuapp} (51%) rename soc/nordic/nrf54l/{Kconfig.defconfig.nrf54lm20_a_b_cpuflpr => Kconfig.defconfig.nrf54lm20a_enga_cpuflpr} (51%) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 36d6c69b4a58..3d940eaa0540 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -48,7 +48,7 @@ config SOC_NRF54L15_CPUAPP select CPU_HAS_FPU select HAS_SWO -config SOC_NRF54LM20A_CPUAPP +config SOC_NRF54LM20A_ENGA_CPUAPP select SOC_NRF54L_CPUAPP_COMMON select SOC_COMPATIBLE_NRF54LM20A select SOC_COMPATIBLE_NRF54LM20A_CPUAPP @@ -68,7 +68,7 @@ config SOC_NRF54L15_CPUFLPR select RISCV_CORE_NORDIC_VPR select SOC_COMPATIBLE_NRF54L15 -config SOC_NRF54LM20A_CPUFLPR +config SOC_NRF54LM20A_ENGA_CPUFLPR select RISCV_CORE_NORDIC_VPR if SOC_SERIES_NRF54L diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp similarity index 51% rename from soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp rename to soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp index 7e5336e2212a..a32729e5f40d 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuapp +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp @@ -1,12 +1,12 @@ -# Nordic Semiconductor nRF54LM20A and nRF54LM20B MCUs +# Nordic Semiconductor nRF54LM20A MCU # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54LM20A_CPUAPP +if SOC_NRF54LM20A_ENGA_CPUAPP config NUM_IRQS default 290 -endif # SOC_NRF54LM20A_CPUAPP +endif # SOC_NRF54LM20A_ENGA_CPUAPP diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr similarity index 51% rename from soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr rename to soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr index 4b84d1ed8bb9..b8065044a5f5 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20_a_b_cpuflpr +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuflpr @@ -1,11 +1,11 @@ -# Nordic Semiconductor nRF54LM20A and nRF54LM20B MCUs +# Nordic Semiconductor nRF54LM20A MCU # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54LM20A_CPUFLPR +if SOC_NRF54LM20A_ENGA_CPUFLPR config NUM_IRQS default 287 -endif # SOC_NRF54LM20A_CPUFLPR +endif # SOC_NRF54LM20A_ENGA_CPUFLPR diff --git a/soc/nordic/nrf54l/Kconfig.soc b/soc/nordic/nrf54l/Kconfig.soc index f550cd557a66..3363948e6ebb 100644 --- a/soc/nordic/nrf54l/Kconfig.soc +++ b/soc/nordic/nrf54l/Kconfig.soc @@ -78,17 +78,23 @@ config SOC_NRF54LM20A help NRF54LM20A -config SOC_NRF54LM20A_CPUAPP +config SOC_NRF54LM20A_ENGA bool select SOC_NRF54LM20A help - NRF54LM20A CPUAPP + NRF54LM20A ENGA -config SOC_NRF54LM20A_CPUFLPR +config SOC_NRF54LM20A_ENGA_CPUAPP bool - select SOC_NRF54LM20A + select SOC_NRF54LM20A_ENGA + help + NRF54LM20A ENGA CPUAPP + +config SOC_NRF54LM20A_ENGA_CPUFLPR + bool + select SOC_NRF54LM20A_ENGA help - NRF54LM20A CPUFLPR + NRF54LM20A ENGA CPUFLPR config SOC default "nrf54l05" if SOC_NRF54L05 diff --git a/soc/nordic/nrf54l/Kconfig.sysbuild b/soc/nordic/nrf54l/Kconfig.sysbuild index b2034be193dd..57173a8a5492 100644 --- a/soc/nordic/nrf54l/Kconfig.sysbuild +++ b/soc/nordic/nrf54l/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if SOC_NRF54L15_CPUFLPR || SOC_NRF54LM20A_CPUFLPR +if SOC_NRF54L15_CPUFLPR || SOC_NRF54LM20A_ENGA_CPUFLPR config HAS_NORDIC_VPR_LAUNCHER_IMAGE default y From dba1165c906eaa767c44326b00bfe83e9d9f2c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:14 +0200 Subject: [PATCH 2780/3334] Revert "[nrf fromtree] manifest: update hal_nordic revision to integrate nrfx 4.1.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 30eead2435786b44acafbfdef5e8113f2790dc3e. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf54lm20a_cpuapp.dtsi | 8 - ...puapp.dtsi => nrf54lm20a_enga_cpuapp.dtsi} | 4 +- dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi | 8 - ...flpr.dtsi => nrf54lm20a_enga_cpuflpr.dtsi} | 2 +- dts/vendor/nordic/nrf54lm20_a_b.dtsi | 929 ------------------ .../nrf54lm20_a_b_cpuapp_ns_partition.dtsi | 91 -- .../nrf54lm20_a_b_cpuapp_partition.dtsi | 37 - dts/vendor/nordic/nrf54lm20a.dtsi | 924 ++++++++++++++++- .../nrf54lm20a_cpuapp_ns_partition.dtsi | 85 +- .../nordic/nrf54lm20a_cpuapp_partition.dtsi | 32 +- west.yml | 4 +- 11 files changed, 1043 insertions(+), 1081 deletions(-) delete mode 100644 dts/arm/nordic/nrf54lm20a_cpuapp.dtsi rename dts/arm/nordic/{nrf54lm20_a_b_cpuapp.dtsi => nrf54lm20a_enga_cpuapp.dtsi} (96%) delete mode 100644 dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi rename dts/riscv/nordic/{nrf54lm20_a_b_cpuflpr.dtsi => nrf54lm20a_enga_cpuflpr.dtsi} (97%) delete mode 100644 dts/vendor/nordic/nrf54lm20_a_b.dtsi delete mode 100644 dts/vendor/nordic/nrf54lm20_a_b_cpuapp_ns_partition.dtsi delete mode 100644 dts/vendor/nordic/nrf54lm20_a_b_cpuapp_partition.dtsi diff --git a/dts/arm/nordic/nrf54lm20a_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_cpuapp.dtsi deleted file mode 100644 index 27be8f894b03..000000000000 --- a/dts/arm/nordic/nrf54lm20a_cpuapp.dtsi +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "nrf54lm20_a_b_cpuapp.dtsi" diff --git a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi similarity index 96% rename from dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi rename to dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index 484ff2afcfd5..3c97f8ead421 100644 --- a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -1,10 +1,10 @@ /* - * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ -#include +#include cpu: &cpuapp {}; diff --git a/dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi b/dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi deleted file mode 100644 index b51a8e69b7f9..000000000000 --- a/dts/riscv/nordic/nrf54lm20a_cpuflpr.dtsi +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "nrf54lm20_a_b_cpuflpr.dtsi" diff --git a/dts/riscv/nordic/nrf54lm20_a_b_cpuflpr.dtsi b/dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi similarity index 97% rename from dts/riscv/nordic/nrf54lm20_a_b_cpuflpr.dtsi rename to dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi index 06db95384172..83908c4ad242 100644 --- a/dts/riscv/nordic/nrf54lm20_a_b_cpuflpr.dtsi +++ b/dts/riscv/nordic/nrf54lm20a_enga_cpuflpr.dtsi @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include cpu: &cpuflpr {}; diff --git a/dts/vendor/nordic/nrf54lm20_a_b.dtsi b/dts/vendor/nordic/nrf54lm20_a_b.dtsi deleted file mode 100644 index 454bc446de0a..000000000000 --- a/dts/vendor/nordic/nrf54lm20_a_b.dtsi +++ /dev/null @@ -1,929 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -/delete-node/ &sw_pwm; - -/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ -#define NRF_DOMAIN_ID_APPLICATION 0 -#define NRF_DOMAIN_ID_FLPR 1 - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@0 { - compatible = "arm,cortex-m33f"; - reg = <0>; - device_type = "cpu"; - clocks = <&hfpll>; - #address-cells = <1>; - #size-cells = <1>; - - itm: itm@e0000000 { - compatible = "arm,armv8m-itm"; - reg = <0xe0000000 0x1000>; - swo-ref-frequency = ; - }; - }; - - cpuflpr: cpu@1 { - compatible = "nordic,vpr", "riscv"; - reg = <1>; - device_type = "cpu"; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "c", "zicsr"; - nordic,bus-width = <32>; - }; - }; - - clocks { - pclk: pclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - pclk32m: pclk32m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfxo: lfxo { - compatible = "nordic,nrf54l-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf54l-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1650>; - }; - - hfpll: hfpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - aclk: aclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - ficr: ficr@ffc000 { - compatible = "nordic,nrf-ficr"; - reg = <0xffc000 0x1000>; - #nordic,ficr-cells = <1>; - }; - -#ifdef USE_NON_SECURE_ADDRESS_MAP - /* intentionally empty because UICR is hardware fixed to Secure */ -#else - uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; - reg = <0xffd000 0x1000>; - }; -#endif - -#ifdef USE_NON_SECURE_ADDRESS_MAP - /* FLPR/VPR is not used with TF-M so NS can use its memory */ - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 0x7fe40>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 0x7fe40>; - }; -#else - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(511)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 DT_SIZE_K(511)>; - }; - - cpuflpr_sram: memory@20067c00 { - compatible = "mmio-sram"; - reg = <0x20067c00 DT_SIZE_K(96)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; - }; -#endif - -#ifdef USE_NON_SECURE_ADDRESS_MAP - global_peripherals: peripheral@40000000 { - reg = <0x40000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x40000000 0x10000000>; -#else - global_peripherals: peripheral@50000000 { - reg = <0x50000000 0x10000000>; - ranges = <0x0 0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; -#endif - - dppic00: dppic@42000 { - compatible = "nordic,nrf-dppic"; - reg = <0x42000 0x808>; - status = "disabled"; - }; - - ppib00: ppib@44000 { - compatible = "nordic,nrf-ppib"; - reg = <0x44000 0x1000>; - status = "disabled"; - }; - - ppib01: ppib@45000 { - compatible = "nordic,nrf-ppib"; - reg = <0x45000 0x1000>; - status = "disabled"; - }; - - cpuflpr_vpr: vpr@4c000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x4c000 0x1000>; - ranges = <0x0 0x4c000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - status = "disabled"; - enable-secure; - - cpuflpr_clic: interrupt-controller@f0000000 { - compatible = "nordic,nrf-clic"; - reg = <0xf0000000 0x143c>; - interrupt-controller; - #interrupt-cells = <2>; - #address-cells = <1>; - status = "disabled"; - }; - }; - - spi00: spi@4d000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart00: uart@4d000 { - compatible = "nordic,nrf-uarte"; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - gpio2: gpio@50400 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x50400 0x300>; - #gpio-cells = <2>; - ngpios = <11>; - status = "disabled"; - port = <2>; - }; - - timer00: timer@55000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x55000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - prescaler = <0>; - }; - - usbhs: usbhs@5a000 { - compatible = "nordic,nrf-usbhs-nrf54l", "snps,dwc2"; - reg = <0x5a000 0x1000>, <0x20000 0x1a000>; - reg-names = "wrapper", "core"; - interrupts = <90 NRF_DEFAULT_IRQ_PRIORITY>; - num-in-eps = <16>; - num-out-eps = <16>; - ghwcfg1 = <0x0>; - ghwcfg2 = <0x22affc52>; - ghwcfg4 = <0x3e10aa60>; - status = "disabled"; - }; - - dppic10: dppic@82000 { - compatible = "nordic,nrf-dppic"; - reg = <0x82000 0x808>; - status = "disabled"; - }; - - ppib10: ppib@83000 { - compatible = "nordic,nrf-ppib"; - reg = <0x83000 0x1000>; - status = "disabled"; - }; - - ppib11: ppib@84000 { - compatible = "nordic,nrf-ppib"; - reg = <0x84000 0x1000>; - status = "disabled"; - }; - - timer10: timer@85000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x85000 0x1000>; - cc-num = <8>; - max-bit-width = <32>; - interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - prescaler = <0>; - }; - - egu10: egu@87000 { - compatible = "nordic,nrf-egu"; - reg = <0x87000 0x1000>; - interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - radio: radio@8a000 { - compatible = "nordic,nrf-radio"; - reg = <0x8a000 0x1000>; - interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - dfe-supported; - ieee802154-supported; - ble-2mbps-supported; - ble-coded-phy-supported; - ble-cs-supported; - - ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; - }; - - dppic20: dppic@c2000 { - compatible = "nordic,nrf-dppic"; - reg = <0xc2000 0x808>; - status = "disabled"; - }; - - ppib20: ppib@c3000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc3000 0x1000>; - status = "disabled"; - }; - - ppib21: ppib@c4000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc4000 0x1000>; - status = "disabled"; - }; - - ppib22: ppib@c5000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc5000 0x1000>; - status = "disabled"; - }; - - i2c20: i2c@c6000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi20: spi@c6000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart20: uart@c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c21: i2c@c7000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi21: spi@c7000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart21: uart@c7000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c22: i2c@c8000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi22: spi@c8000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart22: uart@c8000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - egu20: egu@c9000 { - compatible = "nordic,nrf-egu"; - reg = <0xc9000 0x1000>; - interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - timer20: timer@ca000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xca000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer21: timer@cb000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcb000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer22: timer@cc000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcc000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer23: timer@cd000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcd000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer24: timer@ce000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xce000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - pdm20: pdm@d0000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd0000 0x1000>; - interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pdm21: pdm@d1000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd1000 0x1000>; - interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pwm20: pwm@d2000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd2000 0x1000>; - interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - pwm21: pwm@d3000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd3000 0x1000>; - interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - pwm22: pwm@d4000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd4000 0x1000>; - interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - adc: adc@d5000 { - compatible = "nordic,nrf-saadc"; - reg = <0xd5000 0x1000>; - interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - zephyr,pm-device-runtime-auto; - }; - - nfct: nfct@d6000 { - compatible = "nordic,nrf-nfct"; - reg = <0xd6000 0x1000>; - interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - temp: temp@d7000 { - compatible = "nordic,nrf-temp"; - reg = <0xd7000 0x1000>; - interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio1: gpio@d8200 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8200 0x300>; - #gpio-cells = <2>; - ngpios = <32>; - status = "disabled"; - port = <1>; - gpiote-instance = <&gpiote20>; - }; - - gpio3: gpio@d8600 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8600 0x300>; - #gpio-cells = <2>; - ngpios = <13>; - status = "disabled"; - port = <3>; - gpiote-instance = <&gpiote20>; - }; - - gpiote20: gpiote@da000 { - compatible = "nordic,nrf-gpiote"; - reg = <0xda000 0x1000>; - status = "disabled"; - instance = <20>; - }; - - qdec20: qdec@e0000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe0000 0x1000>; - interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - qdec21: qdec@e1000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe1000 0x1000>; - interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - grtc: grtc@e2000 { - compatible = "nordic,nrf-grtc"; - reg = <0xe2000 0x1000>; - cc-num = <12>; - clocks = <&lfxo>, <&pclk>; - clock-names = "lfclock", "hfclock"; - status = "disabled"; - }; - - tdm: tdm@e8000 { - compatible = "nordic,nrf-tdm"; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xe8000 0x1000>; - interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - clocks = <&pclk32m>; - }; - - i2c23: i2c@ed000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi23: spi@ed000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart23: uart@ed000 { - compatible = "nordic,nrf-uarte"; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c24: i2c@ee000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi24: spi@ee000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart24: uart@ee000 { - compatible = "nordic,nrf-uarte"; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - dppic30: dppic@102000 { - compatible = "nordic,nrf-dppic"; - reg = <0x102000 0x808>; - status = "disabled"; - }; - - ppib30: ppib@103000 { - compatible = "nordic,nrf-ppib"; - reg = <0x103000 0x1000>; - status = "disabled"; - }; - - i2c30: i2c@104000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi30: spi@104000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart30: uart@104000 { - compatible = "nordic,nrf-uarte"; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - comp: comparator@106000 { - /* - * Use compatible "nordic,nrf-comp" to configure as COMP - * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP - */ - compatible = "nordic,nrf-comp"; - reg = <0x106000 0x1000>; - status = "disabled"; - interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; - }; - -#ifdef USE_NON_SECURE_ADDRESS_MAP - /* intentionally empty because WDT30 is hardware fixed to Secure */ -#else - wdt30: watchdog@108000 { - compatible = "nordic,nrf-wdt"; - reg = <0x108000 0x620>; - interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; -#endif - - wdt31: watchdog@109000 { - compatible = "nordic,nrf-wdt"; - reg = <0x109000 0x620>; - interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio0: gpio@10a000 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x10a000 0x300>; - #gpio-cells = <2>; - ngpios = <10>; - status = "disabled"; - port = <0>; - gpiote-instance = <&gpiote30>; - }; - - gpiote30: gpiote@10c000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x10c000 0x1000>; - status = "disabled"; - instance = <30>; - }; - - clock: clock@10e000 { - compatible = "nordic,nrf-clock"; - reg = <0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@500 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x500 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@504 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x504 0x1>; - status = "disabled"; - }; - }; - - regulators: regulator@120000 { - compatible = "nordic,nrf54l-regulators"; - reg = <0x120000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - vregmain: regulator@120600 { - compatible = "nordic,nrf5x-regulator"; - reg = <0x120600 0x1>; - status = "disabled"; - regulator-name = "VREGMAIN"; - regulator-initial-mode = ; - }; - }; - }; - - rram_controller: rram-controller@5004e000 { - compatible = "nordic,rram-controller"; - reg = <0x5004e000 0x1000>; - interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; - #address-cells = <1>; - #size-cells = <1>; - -#ifdef USE_NON_SECURE_ADDRESS_MAP - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(2036)>; - ranges = <0x0 0x0 DT_SIZE_K(2036)>; - erase-block-size = <4096>; - write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; - }; -#else - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(1940)>; - ranges = <0x0 0x0 DT_SIZE_K(1940)>; - erase-block-size = <4096>; - write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; - }; - - cpuflpr_rram: rram@1e5000 { - compatible = "soc-nv-flash"; - reg = <0x1e5000 DT_SIZE_K(96)>; - ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; - erase-block-size = <4096>; - write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; - }; -#endif - }; - - nrf_mpc: memory@50041000 { - compatible = "nordic,nrf-mpc"; - reg = <0x50041000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - override-num = <5>; - override-granularity = <4096>; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_nvic: interrupt-controller@e000e100 { - #address-cells = <1>; - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - }; - }; -}; diff --git a/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_ns_partition.dtsi deleted file mode 100644 index ea354b033632..000000000000 --- a/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_ns_partition.dtsi +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Default SRAM planning when building for nRF54LM20A and nRF54LM20B with ARM TrustZone-M support - * - Lowest 256 kB SRAM allocated to Secure image (sram0_s). - * - Upper 252 kB SRAM allocated to Non-Secure image (sram0_ns). - * - * nRF54LM20A and nRF54LM20B have 512 kB of volatile memory (SRAM), - * but only 511 kB is available to use. - * Since TF-m requires 4kB page alignment we can only use a total of 508 kB. - * This static layout needs to be the same with the upstream TF-M layout in the - * header flash_layout.h of the relevant platform. Any updates in the layout - * needs to happen both in the flash_layout.h and in this file at the same time. - */ -&cpuapp_sram { - sram0_s: image_s@0 { - #address-cells = <1>; - #size-cells = <1>; - /* Secure image memory */ - reg = <0x0 DT_SIZE_K(256)>; - ranges = <0x0 0x0 DT_SIZE_K(256)>; - }; - - sram0_ns: image_ns@40000 { - #address-cells = <1>; - #size-cells = <1>; - /* Non-Secure image memory */ - reg = <0x40000 DT_SIZE_K(252)>; - ranges = <0x0 0x40000 DT_SIZE_K(252)>; - }; -}; - -&cpuapp_rram { - /* - * Default NVM layout on nRF54LM20A and nRF54LM20B Application MCUs without BL2: - * This layout matches (by necessity) that in the TF-M repository: - * - * 0x0000_0000 Secure image primary (512 KB) - * 0x0008_0000 Protected Storage Area (16 KB) - * 0x0008_4000 Internal Trusted Storage Area (16 KB) - * 0x0008_8000 OTP / NV counters area (8 KB) - * 0x0008_A000 Non-secure image primary (1452 KB) - * 0x001F_5000 Non-secure storage, used when built with NRF_NS_STORAGE=ON, - * otherwise unused (32 KB) - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - /* nRF54LM20A and nRF54LM20B have 2036 kB of non-volatile memory (RRAM) - * - * This static layout needs to be the same with the upstream TF-M layout in the - * header flash_layout.h of the relevant platform. Any updates in the layout - * needs to happen both in the flash_layout.h and in this file at the same time. - */ - slot0_partition: partition@0 { - label = "image-0"; - reg = <0x0000000 DT_SIZE_K(512)>; - }; - - tfm_ps_partition: partition@80000 { - label = "tfm-ps"; - reg = <0x00080000 DT_SIZE_K(16)>; - }; - - tfm_its_partition: partition@84000 { - label = "tfm-its"; - reg = <0x00084000 DT_SIZE_K(16)>; - }; - - tfm_otp_partition: partition@88000 { - label = "tfm-otp"; - reg = <0x00088000 DT_SIZE_K(8)>; - }; - - slot0_ns_partition: partition@8a000 { - label = "image-0-nonsecure"; - reg = <0x0008a000 DT_SIZE_K(1452)>; - }; - - storage_partition: partition@1f5000 { - label = "storage"; - reg = <0x001f5000 DT_SIZE_K(32)>; - }; - }; -}; diff --git a/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_partition.dtsi deleted file mode 100644 index cf1a263f32a5..000000000000 --- a/dts/vendor/nordic/nrf54lm20_a_b_cpuapp_partition.dtsi +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuapp_rram { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - /* nRF54LM20A and nRF54LM20B have 2036 kB of non-volatile memory (RRAM) but the last - * 96 kB are reserved for the FLPR MCU, so we have ~1940 kB available. - */ - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x10000 DT_SIZE_K(920)>; - }; - - slot1_partition: partition@f6000 { - label = "image-1"; - reg = <0xf6000 DT_SIZE_K(920)>; - }; - - storage_partition: partition@1dc000 { - label = "storage"; - reg = <0x1dc000 DT_SIZE_K(36)>; - }; - }; -}; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 3404287f1bb0..454bc446de0a 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -4,4 +4,926 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20_a_b.dtsi" +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr", "riscv"; + reg = <1>; + device_type = "cpu"; + riscv,isa-base = "rv32e"; + riscv,isa-extensions = "e", "m", "c", "zicsr"; + nordic,bus-width = <32>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + pclk32m: pclk32m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + aclk: aclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + +#ifdef USE_NON_SECURE_ADDRESS_MAP + /* intentionally empty because UICR is hardware fixed to Secure */ +#else + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; +#endif + +#ifdef USE_NON_SECURE_ADDRESS_MAP + /* FLPR/VPR is not used with TF-M so NS can use its memory */ + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 0x7fe40>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 0x7fe40>; + }; +#else + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(511)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 DT_SIZE_K(511)>; + }; + + cpuflpr_sram: memory@20067c00 { + compatible = "mmio-sram"; + reg = <0x20067c00 DT_SIZE_K(96)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; + }; +#endif + +#ifdef USE_NON_SECURE_ADDRESS_MAP + global_peripherals: peripheral@40000000 { + reg = <0x40000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x40000000 0x10000000>; +#else + global_peripherals: peripheral@50000000 { + reg = <0x50000000 0x10000000>; + ranges = <0x0 0x50000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; +#endif + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x143c>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + spi00: spi@4d000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart00: uart@4d000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + usbhs: usbhs@5a000 { + compatible = "nordic,nrf-usbhs-nrf54l", "snps,dwc2"; + reg = <0x5a000 0x1000>, <0x20000 0x1a000>; + reg-names = "wrapper", "core"; + interrupts = <90 NRF_DEFAULT_IRQ_PRIORITY>; + num-in-eps = <16>; + num-out-eps = <16>; + ghwcfg1 = <0x0>; + ghwcfg2 = <0x22affc52>; + ghwcfg4 = <0x3e10aa60>; + status = "disabled"; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + ble-cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + pdm20: pdm@d0000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd0000 0x1000>; + interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pdm21: pdm@d1000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd1000 0x1000>; + interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pwm20: pwm@d2000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd2000 0x1000>; + interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + }; + + pwm21: pwm@d3000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd3000 0x1000>; + interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + }; + + pwm22: pwm@d4000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd4000 0x1000>; + interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <32>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpio3: gpio@d8600 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8600 0x300>; + #gpio-cells = <2>; + ngpios = <13>; + status = "disabled"; + port = <3>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + tdm: tdm@e8000 { + compatible = "nordic,nrf-tdm"; + easydma-maxcnt-bits = <15>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xe8000 0x1000>; + interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + clocks = <&pclk32m>; + }; + + i2c23: i2c@ed000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi23: spi@ed000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart23: uart@ed000 { + compatible = "nordic,nrf-uarte"; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c24: i2c@ee000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi24: spi@ee000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart24: uart@ee000 { + compatible = "nordic,nrf-uarte"; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + +#ifdef USE_NON_SECURE_ADDRESS_MAP + /* intentionally empty because WDT30 is hardware fixed to Secure */ +#else + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; +#endif + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <10>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@500 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x500 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@504 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x504 0x1>; + status = "disabled"; + }; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; + #address-cells = <1>; + #size-cells = <1>; + +#ifdef USE_NON_SECURE_ADDRESS_MAP + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(2036)>; + ranges = <0x0 0x0 DT_SIZE_K(2036)>; + erase-block-size = <4096>; + write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; + }; +#else + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1940)>; + ranges = <0x0 0x0 DT_SIZE_K(1940)>; + erase-block-size = <4096>; + write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; + }; + + cpuflpr_rram: rram@1e5000 { + compatible = "soc-nv-flash"; + reg = <0x1e5000 DT_SIZE_K(96)>; + ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; + erase-block-size = <4096>; + write-block-size = <16>; + #address-cells = <1>; + #size-cells = <1>; + }; +#endif + }; + + nrf_mpc: memory@50041000 { + compatible = "nordic,nrf-mpc"; + reg = <0x50041000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + override-num = <5>; + override-granularity = <4096>; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi index 2625fe11e566..5f5f974db565 100644 --- a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi @@ -4,4 +4,87 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20_a_b_cpuapp_ns_partition.dtsi" +/* + * Default SRAM planning when building for nRF54LM20A with ARM TrustZone-M support + * - Lowest 256 kB SRAM allocated to Secure image (sram0_s). + * - Upper 252 kB SRAM allocated to Non-Secure image (sram0_ns). + * + * nRF54LM20A has 512 kB of volatile memory (SRAM), but only 511 kB is available to use. + * Since TF-m requires 4kB page alignment we can only use a total of 508 kB. + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ +&cpuapp_sram { + sram0_s: image_s@0 { + #address-cells = <1>; + #size-cells = <1>; + /* Secure image memory */ + reg = <0x0 DT_SIZE_K(256)>; + ranges = <0x0 0x0 DT_SIZE_K(256)>; + }; + + sram0_ns: image_ns@40000 { + #address-cells = <1>; + #size-cells = <1>; + /* Non-Secure image memory */ + reg = <0x40000 DT_SIZE_K(252)>; + ranges = <0x0 0x40000 DT_SIZE_K(252)>; + }; +}; + +&cpuapp_rram { + /* + * Default NVM layout on NRF54LM20A Application MCU without BL2: + * This layout matches (by necessity) that in the TF-M repository: + * + * 0x0000_0000 Secure image primary (512 KB) + * 0x0008_0000 Protected Storage Area (16 KB) + * 0x0008_4000 Internal Trusted Storage Area (16 KB) + * 0x0008_8000 OTP / NV counters area (8 KB) + * 0x0008_A000 Non-secure image primary (1452 KB) + * 0x001F_5000 Non-secure storage, used when built with NRF_NS_STORAGE=ON, + * otherwise unused (32 KB) + */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54LM20A has 2036 kB of non-volatile memory (RRAM) + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8a000 { + label = "image-0-nonsecure"; + reg = <0x0008a000 DT_SIZE_K(1452)>; + }; + + storage_partition: partition@1f5000 { + label = "storage"; + reg = <0x001f5000 DT_SIZE_K(32)>; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54lm20a_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_cpuapp_partition.dtsi index f25bbe927f0b..1bc6991c434a 100644 --- a/dts/vendor/nordic/nrf54lm20a_cpuapp_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_cpuapp_partition.dtsi @@ -4,4 +4,34 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "nrf54lm20_a_b_cpuapp_partition.dtsi" +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54LM20A has 2036 kB of non-volatile memory (RRAM) but the last + * 96 kB are reserved for the FLPR MCU, so we have ~1940 kB available. + */ + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(920)>; + }; + + slot1_partition: partition@f6000 { + label = "image-1"; + reg = <0xf6000 DT_SIZE_K(920)>; + }; + + storage_partition: partition@1dc000 { + label = "storage"; + reg = <0x1dc000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/west.yml b/west.yml index 55772b9fc8a0..6ed480e2cffb 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 63f2083ff9bc9c39b39f0a874becc7cf8e011a2a + revision: daad38f2e9f6c641849010d74fe02ea736d4d921 path: modules/hal/nordic groups: - hal @@ -386,7 +386,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 3a128df2bdebedf5a01726e86de3880991d6bb63 + revision: 6788687e013733d12f015b5d45b214019dea58f7 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 0c3e753b9822cccea609eb573dc56a1b8edeb150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:15 +0200 Subject: [PATCH 2781/3334] Revert "[nrf fromtree] dts: vendor: nordic: Add missing hfpll clock source to peripherals" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc8e9b2c71f739a17d16794b419f3d4af99589d0. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 1 - dts/vendor/nordic/nrf54lm20a.dtsi | 1 - dts/vendor/nordic/nrf7120_enga.dtsi | 2 -- 3 files changed, 4 deletions(-) diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 4f119f4358ac..0919b1347d77 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -145,7 +145,6 @@ #size-cells = <0>; reg = <0x4a000 0x1000>; interrupts = <74 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; max-frequency = ; easydma-maxcnt-bits = <16>; rx-delay-supported; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 454bc446de0a..9522ed31c364 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -196,7 +196,6 @@ #size-cells = <0>; reg = <0x4d000 0x1000>; interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; max-frequency = ; easydma-maxcnt-bits = <16>; rx-delay-supported; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index d5ba811d2d3e..48a2b268317e 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -240,7 +240,6 @@ compatible = "nordic,nrf-spim"; reg = <0x4d000 0x1000>; interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; #address-cells = <1>; #size-cells = <0>; max-frequency = ; @@ -254,7 +253,6 @@ compatible = "nordic,nrf-uarte"; reg = <0x4d000 0x1000>; interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; status = "disabled"; endtx-stoptx-supported; frame-timeout-supported; From 274bd4c1f9b2716c3e93e1cd89690f34ee9178dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:15 +0200 Subject: [PATCH 2782/3334] Revert "[nrf fromtree] dts: vendor: nordic: fix nrf54lm20a/*[/ns] sram size" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f23d100fc379851ef65ff70a9d109ff1fd604c70. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf54lm20a.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 9522ed31c364..b872dff0f559 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -110,10 +110,10 @@ /* FLPR/VPR is not used with TF-M so NS can use its memory */ cpuapp_sram: memory@20000000 { compatible = "mmio-sram"; - reg = <0x20000000 0x7fe40>; + reg = <0x20000000 0x2007fe40>; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20000000 0x7fe40>; + ranges = <0x0 0x20000000 0x2007fe40>; }; #else cpuapp_sram: memory@20000000 { From 2dd2671ac26e94966308ed2e5c40fdc0d0e1d49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:15 +0200 Subject: [PATCH 2783/3334] Revert "[nrf fromtree] dts: nordic: Move BT controller enable" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 09c3bbd35c15e3eae2c5fc8d53b91649759f7801. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi | 5 +++++ boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts | 4 ++++ dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi | 5 ----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi index 6ab124d0fb84..f0946efb543f 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi +++ b/boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi @@ -18,6 +18,7 @@ zephyr,bt-c2h-uart = &uart20; zephyr,flash-controller = &rram_controller; zephyr,flash = &cpuapp_rram; + zephyr,bt-hci = &bt_hci_controller; zephyr,ieee802154 = &ieee802154; }; @@ -97,6 +98,10 @@ status = "okay"; }; +&bt_hci_controller { + status = "okay"; +}; + &ieee802154 { status = "okay"; }; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts index ef47e866e4c4..a5d1600de247 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts @@ -19,5 +19,9 @@ }; }; +&bt_hci_controller { + status = "okay"; +}; + /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi22 {}; diff --git a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi index 3c97f8ead421..d74a33745c01 100644 --- a/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20a_enga_cpuapp.dtsi @@ -22,7 +22,6 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; }; @@ -43,10 +42,6 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_controller { - status = "okay"; -}; - &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; From b79e6074e05dd353c70436dfba8fa7b0145bd006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:16 +0200 Subject: [PATCH 2784/3334] Revert "[nrf fromtree] riscv: require `riscv,isa-base` and `riscv,isa-extensions`" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c04e0b5db1d8235a0fa317d289242898194c5cae. Signed-off-by: Andrzej Głąbek --- dts/bindings/cpu/riscv,cpus.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index 0e422044ff38..2cf259461cdc 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -25,7 +25,6 @@ properties: riscv,isa-base: description: The base ISA implemented by the hart. type: string - required: true enum: - rv32i - rv32e @@ -40,4 +39,3 @@ properties: for a list of possible extensions. Not all options listed there are necessarily supported by Zephyr. type: string-array - required: true From cd496e43153db1df5da9a4bc11c9d9b6df8651d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:16 +0200 Subject: [PATCH 2785/3334] Revert "[nrf fromtree] docs: migration-guide: mention riscv changes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1703bcbb163aa053b7ef3be5aa49113fdbec19c7. Signed-off-by: Andrzej Głąbek --- doc/releases/migration-guide-4.4.rst | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index d60ed5ae7db4..0bb6fabcd067 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -805,21 +805,3 @@ Architectures * :kconfig:option:`CONFIG_RISCV` now requires, that the :dtcompatible:`riscv` is present in the devicetree. - -* The ``riscv,isa-base`` and ``riscv,isa-extensions`` devicetree properties of - :dtcompatible:`riscv` are now used to set the Base Integer Instruction Set and the RISC-V - extensions. They are no longer set by the SoC. The devicetree property ``riscv,isa`` has been - deprecated in favor of the two new properties. (:github:`97540`) - - * ``CONFIG_SOC_CV64A6_IMAFDC`` and ``CONFIG_SOC_CV64A6_IMAC`` are now combined into - :kconfig:option:`CONFIG_SOC_CV64A6`, as the RISC-V extensions are now set by the devicetree. - - * The following options of :kconfig:option:`CONFIG_SOC_SERIES_AE350` had been removed, as they - now can be set via the devicetree: - - * ``CONFIG_RV32I_CPU`` - * ``CONFIG_RV32E_CPU`` - * ``CONFIG_RV64I_CPU`` - * ``CONFIG_NO_FPU`` - * ``CONFIG_SINGLE_PRECISION_FPU`` - * ``CONFIG_DOUBLE_PRECISION_FPU`` From b033c34d67b8a4305c5fd7975818968a82b88cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:16 +0200 Subject: [PATCH 2786/3334] Revert "[nrf fromtree] riscv: deprecate riscv,isa dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3a5685f65fadd230eb4ac311fdf6f0e2bf42a4c6. Signed-off-by: Andrzej Głąbek --- dts/bindings/cpu/riscv,cpus.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index 2cf259461cdc..0ff385142e1f 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -20,7 +20,6 @@ properties: riscv,isa: description: RISC-V instruction set architecture type: string - deprecated: true riscv,isa-base: description: The base ISA implemented by the hart. From fea0fb3557e996c215c2220304fbc885df5bbc9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:17 +0200 Subject: [PATCH 2787/3334] Revert "[nrf fromtree] thead: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 316e00b77caba181224e66503655276d3c0f1893. Signed-off-by: Andrzej Głąbek --- arch/riscv/custom/thead/Kconfig.core | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/riscv/custom/thead/Kconfig.core b/arch/riscv/custom/thead/Kconfig.core index 453325574767..3550e91957fa 100644 --- a/arch/riscv/custom/thead/Kconfig.core +++ b/arch/riscv/custom/thead/Kconfig.core @@ -8,6 +8,12 @@ config CPU_XUANTIE_E907 select RISCV_HAS_CLIC select RISCV_MACHINE_TIMER select RISCV_PRIVILEGED + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_VECTORED_MODE select CPU_HAS_ICACHE select CPU_HAS_DCACHE From d76f624b0a6490b84266604cd95c1af2f6c68783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:17 +0200 Subject: [PATCH 2788/3334] Revert "[nrf fromtree] aesc: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ec27ec81abe97388ee98e3bc23444be02c35e674. Signed-off-by: Andrzej Głąbek --- dts/riscv/aesc/nitrogen.dtsi | 3 +-- soc/aesc/nitrogen/Kconfig | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dts/riscv/aesc/nitrogen.dtsi b/dts/riscv/aesc/nitrogen.dtsi index bdaed267cefa..b1e3def00bbd 100644 --- a/dts/riscv/aesc/nitrogen.dtsi +++ b/dts/riscv/aesc/nitrogen.dtsi @@ -20,8 +20,7 @@ compatible = "litex,vexriscv-standard", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imc"; status = "okay"; hlic: interrupt-controller { diff --git a/soc/aesc/nitrogen/Kconfig b/soc/aesc/nitrogen/Kconfig index f19a32bbb2c8..050a364a3d2c 100644 --- a/soc/aesc/nitrogen/Kconfig +++ b/soc/aesc/nitrogen/Kconfig @@ -5,6 +5,11 @@ config SOC_SERIES_NITROGEN select RISCV select RISCV_PRIVILEGED select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI config SOC_PART_NUMBER default "elemrv_n" if SOC_ELEMRV_N From 2235747c739aa3af6c1a864f32ebb22f74dcc0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:17 +0200 Subject: [PATCH 2789/3334] Revert "[nrf fromtree] andestech: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 73e9e0706293146c4455edfbfd8a98d1b66eac2f. Signed-off-by: Andrzej Głąbek --- dts/riscv/andes/andes_v5_ae350.dtsi | 32 ++++++---------------- soc/andestech/ae350/Kconfig | 41 +++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/dts/riscv/andes/andes_v5_ae350.dtsi b/dts/riscv/andes/andes_v5_ae350.dtsi index 23dd62c22e6b..6f0ccdb37ae7 100644 --- a/dts/riscv/andes/andes_v5_ae350.dtsi +++ b/dts/riscv/andes/andes_v5_ae350.dtsi @@ -21,9 +21,7 @@ device_type = "cpu"; reg = <0>; status = "okay"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", - "xandes"; + riscv,isa = "rv32gc_xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -42,9 +40,7 @@ device_type = "cpu"; reg = <1>; status = "okay"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", - "xandes"; + riscv,isa = "rv32gc_xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -63,9 +59,7 @@ device_type = "cpu"; reg = <2>; status = "okay"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", - "xandes"; + riscv,isa = "rv32gc_xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -84,9 +78,7 @@ device_type = "cpu"; reg = <3>; status = "okay"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", - "xandes"; + riscv,isa = "rv32gc_xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -105,9 +97,7 @@ device_type = "cpu"; reg = <4>; status = "okay"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", - "xandes"; + riscv,isa = "rv32gc_xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -126,9 +116,7 @@ device_type = "cpu"; reg = <5>; status = "okay"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", - "xandes"; + riscv,isa = "rv32gc_xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -147,9 +135,7 @@ device_type = "cpu"; reg = <6>; status = "okay"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", - "xandes"; + riscv,isa = "rv32gc_xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; @@ -168,9 +154,7 @@ device_type = "cpu"; reg = <7>; status = "okay"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei", - "xandes"; + riscv,isa = "rv32gc_xandes"; mmu-type = "riscv,sv32"; clock-frequency = <60000000>; i-cache-line-size = <32>; diff --git a/soc/andestech/ae350/Kconfig b/soc/andestech/ae350/Kconfig index b29504c79c55..109e6a2f8541 100644 --- a/soc/andestech/ae350/Kconfig +++ b/soc/andestech/ae350/Kconfig @@ -6,6 +6,11 @@ config SOC_SERIES_AE350 select RISCV_PRIVILEGED select RISCV_PMP select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select CPU_HAS_DCACHE select CPU_HAS_ICACHE select CPU_HAS_ANDES_EXECIT @@ -38,6 +43,42 @@ config SOC_AE350_INTERRUPT_TYPE_CLIC endchoice +choice + prompt "Base CPU ISA options" + default RV32I_CPU + +config RV32I_CPU + bool "RISCV32 CPU ISA" + select RISCV_ISA_RV32I + +config RV32E_CPU + bool "RISCV32E CPU ISA" + select RISCV_ISA_RV32E + +config RV64I_CPU + bool "RISCV64 CPU ISA" + select RISCV_ISA_RV64I + +endchoice + +choice + prompt "FPU options" + default NO_FPU + +config NO_FPU + bool "No FPU" + +config SINGLE_PRECISION_FPU + bool "Single precision FPU" + select RISCV_ISA_EXT_F + +config DOUBLE_PRECISION_FPU + bool "Double precision FPU" + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_D + +endchoice + config SOC_ANDES_V5_HWDSP bool select DEPRECATED From 50cbde4bb0f36d59a92af610f294eb17c094d9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:18 +0200 Subject: [PATCH 2790/3334] Revert "[nrf fromtree] egis: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 539920ca8b83e08d9b3942804e1f50eff2c72eda. Signed-off-by: Andrzej Głąbek --- dts/riscv/egis/egis_et171.dtsi | 3 +-- soc/egis/et171/Kconfig | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dts/riscv/egis/egis_et171.dtsi b/dts/riscv/egis/egis_et171.dtsi index 7c0b09f98b7c..d83e3c900cde 100644 --- a/dts/riscv/egis/egis_et171.dtsi +++ b/dts/riscv/egis/egis_et171.dtsi @@ -20,8 +20,7 @@ compatible = "andestech,andescore-v5", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imafc_zicsr_zifencei"; mmu-type = "riscv,sv32"; i-cache-line-size = <32>; d-cache-line-size = <32>; diff --git a/soc/egis/et171/Kconfig b/soc/egis/et171/Kconfig index b51685fa3c78..15b1dbb3498d 100644 --- a/soc/egis/et171/Kconfig +++ b/soc/egis/et171/Kconfig @@ -7,6 +7,13 @@ config SOC_EGIS_ET171 select RISCV_PRIVILEGED select RISCV_HAS_PLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select CPU_HAS_DCACHE select CPU_HAS_ICACHE select CPU_HAS_ANDES_EXECIT From 4a6ac6d559f98f2baf2df458e44f131475843c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:18 +0200 Subject: [PATCH 2791/3334] Revert "[nrf fromtree] gd: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bdf6a35cd15a46ddd656a2fa021e5cf14c88853e. Signed-off-by: Andrzej Głąbek --- dts/riscv/gd/gd32vf103.dtsi | 3 +-- soc/gd/gd32/gd32vf103/Kconfig | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dts/riscv/gd/gd32vf103.dtsi b/dts/riscv/gd/gd32vf103.dtsi index 43e69b60a209..714a2020011d 100644 --- a/dts/riscv/gd/gd32vf103.dtsi +++ b/dts/riscv/gd/gd32vf103.dtsi @@ -24,8 +24,7 @@ cpu: cpu@0 { clock-frequency = ; compatible = "nuclei,bumblebee", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr_zifencei"; reg = <0>; }; }; diff --git a/soc/gd/gd32/gd32vf103/Kconfig b/soc/gd/gd32/gd32vf103/Kconfig index e53353c2df47..b9e0aaa45348 100644 --- a/soc/gd/gd32/gd32vf103/Kconfig +++ b/soc/gd/gd32/gd32vf103/Kconfig @@ -6,6 +6,12 @@ config SOC_SERIES_GD32VF103 select RISCV select RISCV_PRIVILEGED + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_CLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select RISCV_SOC_CONTEXT_SAVE From 2ddbdf47ebf153aaedfcad5f0900c5402920f469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:19 +0200 Subject: [PATCH 2792/3334] Revert "[nrf fromtree] intel: niosv: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7c392b611a93af71f13436adb97748bbc2493732. Signed-off-by: Andrzej Głąbek --- dts/riscv/niosv/niosv-g.dtsi | 3 +-- dts/riscv/niosv/niosv-m.dtsi | 3 +-- soc/intel/intel_niosv/niosv/Kconfig | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dts/riscv/niosv/niosv-g.dtsi b/dts/riscv/niosv/niosv-g.dtsi index 17db4a808ad7..1770fe4e3d12 100644 --- a/dts/riscv/niosv/niosv-g.dtsi +++ b/dts/riscv/niosv/niosv-g.dtsi @@ -19,8 +19,7 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "intel,niosv", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "zicsr", "zifencei"; + riscv,isa = "rv32ima_zicsr_zifencei"; reg = <0>; clock-frequency = <50000000>; diff --git a/dts/riscv/niosv/niosv-m.dtsi b/dts/riscv/niosv/niosv-m.dtsi index dd683ff2370c..eedf425cf0ee 100644 --- a/dts/riscv/niosv/niosv-m.dtsi +++ b/dts/riscv/niosv/niosv-m.dtsi @@ -19,8 +19,7 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "intel,niosv", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "a", "zicsr", "zifencei"; + riscv,isa = "rv32ia_zicsr_zifencei"; reg = <0>; clock-frequency = <50000000>; diff --git a/soc/intel/intel_niosv/niosv/Kconfig b/soc/intel/intel_niosv/niosv/Kconfig index 46f0140ed73b..28e38894a0f6 100644 --- a/soc/intel/intel_niosv/niosv/Kconfig +++ b/soc/intel/intel_niosv/niosv/Kconfig @@ -6,6 +6,10 @@ config SOC_SERIES_NIOSV select RISCV select RISCV_PRIVILEGED select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING imply XIP @@ -14,5 +18,6 @@ config SOC_NIOSV_M Intel FPGA NIOSV Microcontroller Core Processor config SOC_NIOSV_G + select RISCV_ISA_EXT_M help Intel FPGA NIOSV General Purpose Processor From 3bb37139248f93c40e05301a79043b7584d92865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:19 +0200 Subject: [PATCH 2793/3334] Revert "[nrf fromtree] ite: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9d775679389cf97f18d3baea7e851c6865e5eff0. Signed-off-by: Andrzej Głąbek --- dts/riscv/ite/it51526aw.dtsi | 3 +-- dts/riscv/ite/it51xxx.dtsi | 4 +--- dts/riscv/ite/it8xxx2.dtsi | 3 +-- soc/ite/ec/it51xxx/Kconfig | 9 +++++++++ soc/ite/ec/it8xxx2/Kconfig | 5 +++++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/dts/riscv/ite/it51526aw.dtsi b/dts/riscv/ite/it51526aw.dtsi index a8e730c5b554..b03cfc22e1b1 100644 --- a/dts/riscv/ite/it51526aw.dtsi +++ b/dts/riscv/ite/it51526aw.dtsi @@ -8,8 +8,7 @@ cpus { cpu0: cpu@0 { compatible = "ite,riscv-ite", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "zba", "zbb", "zbs", "zicsr", "zifencei"; + riscv,isa = "rv32imb_zifencei"; device_type = "cpu"; reg = <0>; clock-frequency = <32768>; diff --git a/dts/riscv/ite/it51xxx.dtsi b/dts/riscv/ite/it51xxx.dtsi index 267ab05530c9..80045de34acb 100644 --- a/dts/riscv/ite/it51xxx.dtsi +++ b/dts/riscv/ite/it51xxx.dtsi @@ -30,9 +30,7 @@ cpu0: cpu@0 { compatible = "ite,riscv-ite", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "c", "zba", "zbb", "zbs", "zicsr", - "zifencei"; + riscv,isa = "rv32imcb_zifencei"; device_type = "cpu"; reg = <0>; clock-frequency = <32768>; diff --git a/dts/riscv/ite/it8xxx2.dtsi b/dts/riscv/ite/it8xxx2.dtsi index b127530acc50..1ba4acf39a27 100644 --- a/dts/riscv/ite/it8xxx2.dtsi +++ b/dts/riscv/ite/it8xxx2.dtsi @@ -30,8 +30,7 @@ cpu0: cpu@0 { compatible = "ite,riscv-ite", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imafc_zifencei"; device_type = "cpu"; reg = <0>; cpu-power-states = <&standby>; diff --git a/soc/ite/ec/it51xxx/Kconfig b/soc/ite/ec/it51xxx/Kconfig index 7a0a8a58d1be..83096116742a 100644 --- a/soc/ite/ec/it51xxx/Kconfig +++ b/soc/ite/ec/it51xxx/Kconfig @@ -11,6 +11,15 @@ if SOC_SERIES_IT51XXX config SOC_IT51XXX select RISCV + select ATOMIC_OPERATIONS_C + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C if !SOC_IT51526AW + select RISCV_ISA_EXT_ZBA + select RISCV_ISA_EXT_ZBB + select RISCV_ISA_EXT_ZBS select FLASH imply XIP diff --git a/soc/ite/ec/it8xxx2/Kconfig b/soc/ite/ec/it8xxx2/Kconfig index 13a07447d600..12b3aeabd591 100644 --- a/soc/ite/ec/it8xxx2/Kconfig +++ b/soc/ite/ec/it8xxx2/Kconfig @@ -13,9 +13,14 @@ if SOC_SERIES_IT8XXX2 config SOC_IT8XXX2 select RISCV + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI # Workaround mul instruction bug, see: # https://www.ite.com.tw/uploads/product_download/it81202-bx-chip-errata.pdf select RISCV_ISA_EXT_M if !(SOC_IT81302BX || SOC_IT81202BX) + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C imply XIP config SOC_IT8XXX2_REG_SET_V1 From 8e8ba0abf1aefd5a1b3d812564d1e6282132c462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:19 +0200 Subject: [PATCH 2794/3334] Revert "[nrf fromtree] lowriscv: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 77486da49f2ccdcbba25cfc12f8062bea742ef4b. Signed-off-by: Andrzej Głąbek --- dts/riscv/lowrisc/opentitan_earlgrey.dtsi | 4 +--- soc/lowrisc/opentitan/Kconfig | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dts/riscv/lowrisc/opentitan_earlgrey.dtsi b/dts/riscv/lowrisc/opentitan_earlgrey.dtsi index d0bab22a2ade..014101b61264 100644 --- a/dts/riscv/lowrisc/opentitan_earlgrey.dtsi +++ b/dts/riscv/lowrisc/opentitan_earlgrey.dtsi @@ -18,9 +18,7 @@ reg = <0x00>; status = "okay"; compatible = "lowrisc,ibex", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "c", "zicsr", "zifencei", - "zba", "zbb", "zbc", "zbs"; + riscv,isa = "rv32imcb_zicsr_zifencei"; hlic: interrupt-controller { #interrupt-cells = <0x01>; diff --git a/soc/lowrisc/opentitan/Kconfig b/soc/lowrisc/opentitan/Kconfig index 37e498636545..c76751f6e967 100644 --- a/soc/lowrisc/opentitan/Kconfig +++ b/soc/lowrisc/opentitan/Kconfig @@ -4,6 +4,15 @@ config SOC_OPENTITAN select ATOMIC_OPERATIONS_C select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select RISCV_ISA_EXT_ZBA + select RISCV_ISA_EXT_ZBB + select RISCV_ISA_EXT_ZBC + select RISCV_ISA_EXT_ZBS select RISCV select RISCV_PRIVILEGED select RISCV_HAS_PLIC From 6d067c68590ee2259a99fcc913fe62c7c528cae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:19 +0200 Subject: [PATCH 2795/3334] Revert "[nrf fromtree] microchip: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 61cae1b7ac13ab521f4e18b2afc3b3bfb141b72d. Signed-off-by: Andrzej Głąbek --- dts/riscv/microchip/microchip-miv.dtsi | 3 +-- dts/riscv/microchip/mpfs.dtsi | 15 +++++---------- dts/riscv/microchip/pic64gx.dtsi | 15 +++++---------- soc/microchip/miv/miv/Kconfig | 5 +++++ soc/microchip/miv/polarfire/Kconfig | 16 ++++++++++++++++ soc/microchip/pic64/pic64gx/Kconfig | 18 ++++++++++++++++++ 6 files changed, 50 insertions(+), 22 deletions(-) diff --git a/dts/riscv/microchip/microchip-miv.dtsi b/dts/riscv/microchip/microchip-miv.dtsi index 1a5413903b05..0314ec5f95b0 100644 --- a/dts/riscv/microchip/microchip-miv.dtsi +++ b/dts/riscv/microchip/microchip-miv.dtsi @@ -17,8 +17,7 @@ compatible = "microchip,miv", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "zicsr", "zifencei"; + riscv,isa = "rv32ima_zicsr_zifencei"; hlic: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/microchip/mpfs.dtsi b/dts/riscv/microchip/mpfs.dtsi index 98a1f24fbdba..6bdcff412469 100644 --- a/dts/riscv/microchip/mpfs.dtsi +++ b/dts/riscv/microchip/mpfs.dtsi @@ -21,8 +21,7 @@ compatible = "sifive,e51", "riscv"; device_type = "cpu"; reg = <0x0>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imac_zicsr_zifencei"; hlic0: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -37,8 +36,7 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x1>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic1: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -53,8 +51,7 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x2>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic2: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -69,8 +66,7 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x3>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic3: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -85,8 +81,7 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x4>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic4: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/microchip/pic64gx.dtsi b/dts/riscv/microchip/pic64gx.dtsi index 48f46c461da7..7bb3ab39ec80 100644 --- a/dts/riscv/microchip/pic64gx.dtsi +++ b/dts/riscv/microchip/pic64gx.dtsi @@ -20,8 +20,7 @@ compatible = "sifive,e51", "riscv"; device_type = "cpu"; reg = <0x0>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imac_zicsr_zifencei"; hlic0: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -36,8 +35,7 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x1>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic1: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -52,8 +50,7 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x2>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic2: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -68,8 +65,7 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x3>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic3: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -84,8 +80,7 @@ compatible = "sifive,u54", "riscv"; device_type = "cpu"; reg = <0x4>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic4: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/microchip/miv/miv/Kconfig b/soc/microchip/miv/miv/Kconfig index ea0194ed2500..9db954b0de3f 100644 --- a/soc/microchip/miv/miv/Kconfig +++ b/soc/microchip/miv/miv/Kconfig @@ -12,3 +12,8 @@ config SOC_SERIES_MIV config SOC_MIV select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI diff --git a/soc/microchip/miv/polarfire/Kconfig b/soc/microchip/miv/polarfire/Kconfig index 6dc4a878bd3f..3eb8a33499bb 100644 --- a/soc/microchip/miv/polarfire/Kconfig +++ b/soc/microchip/miv/polarfire/Kconfig @@ -11,11 +11,27 @@ config SOC_SERIES_POLARFIRE imply XIP config SOC_POLARFIRE + select 64BIT select SCHED_IPI_SUPPORTED select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select USE_SWITCH_SUPPORTED select USE_SWITCH +config SOC_POLARFIRE_U54 + select CPU_HAS_FPU + select CPU_HAS_FPU_DOUBLE_PRECISION + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_G + select RISCV_ISA_EXT_C + +config SOC_POLARFIRE_E51 + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + config MPFS_HAL depends on SOC_POLARFIRE bool "Microchip Polarfire SOC hardware abstracton layer" diff --git a/soc/microchip/pic64/pic64gx/Kconfig b/soc/microchip/pic64/pic64gx/Kconfig index 9ada84dd06cb..b8cc439b9367 100644 --- a/soc/microchip/pic64/pic64gx/Kconfig +++ b/soc/microchip/pic64/pic64gx/Kconfig @@ -13,9 +13,27 @@ config SOC_SERIES_PIC64GX config SOC_PIC64GX1000 bool + select 64BIT select SCHED_IPI_SUPPORTED select ATOMIC_OPERATIONS_BUILTIN select INCLUDE_RESET_VECTOR select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select USE_SWITCH_SUPPORTED select USE_SWITCH + +config SOC_PIC64GX1000_U54 + bool + select CPU_HAS_FPU + select CPU_HAS_FPU_DOUBLE_PRECISION + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_G + select RISCV_ISA_EXT_C + +config SOC_PIC64GX1000_E51 + bool + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI From 79972f30526ed55a64c4be5a1a39590242413404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:20 +0200 Subject: [PATCH 2796/3334] Revert "[nrf fromtree] neorv32: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0505becd20e3abff51d7504fb03cae0a456e6938. Signed-off-by: Andrzej Głąbek --- boards/others/neorv32/Kconfig | 17 +++++++++++++++++ boards/others/neorv32/doc/index.rst | 4 ++-- .../neorv32/neorv32_neorv32_minimalboot.dts | 3 +-- .../others/neorv32/neorv32_neorv32_up5kdemo.dts | 3 +-- soc/neorv32/Kconfig | 2 ++ 5 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 boards/others/neorv32/Kconfig diff --git a/boards/others/neorv32/Kconfig b/boards/others/neorv32/Kconfig new file mode 100644 index 000000000000..816f2ae1543c --- /dev/null +++ b/boards/others/neorv32/Kconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2021,2025 Henrik Brix Andersen +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_NEORV32_NEORV32_MINIMALBOOT + +config BOARD_NEORV32 + select RISCV_ISA_RV32I + +endif # BOARD_NEORV32_NEORV32_MINIMALBOOT + +if BOARD_NEORV32_NEORV32_UP5KDEMO + +config BOARD_NEORV32 + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + +endif # BOARD_NEORV32_NEORV32_UP5KDEMO diff --git a/boards/others/neorv32/doc/index.rst b/boards/others/neorv32/doc/index.rst index 731fc5521529..62e78d1ef592 100644 --- a/boards/others/neorv32/doc/index.rst +++ b/boards/others/neorv32/doc/index.rst @@ -53,8 +53,8 @@ enabled: - Zicsr (Control and Status Register (CSR) Instructions, always enabled) - Zifencei (Instruction-fetch fence, always enabled) -Other supported RISC-V ISA extensions can be enabled by changing the ``riscv,isa-extensions`` -devicetree property of the ``cpu0`` node accordingly. +Other supported RISC-V ISA extensions must be enabled via Kconfig on the board level, and the +``riscv,isa`` devicetree property of the ``cpu0`` node must be set accordingly. Core Local Interruptor ====================== diff --git a/boards/others/neorv32/neorv32_neorv32_minimalboot.dts b/boards/others/neorv32/neorv32_neorv32_minimalboot.dts index 3f445a12f5bb..690a5b16c465 100644 --- a/boards/others/neorv32/neorv32_neorv32_minimalboot.dts +++ b/boards/others/neorv32/neorv32_neorv32_minimalboot.dts @@ -109,8 +109,7 @@ }; &cpu0 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "zicsr", "zifencei"; + riscv,isa = "rv32i_zicsr_zifencei"; }; &bootrom { diff --git a/boards/others/neorv32/neorv32_neorv32_up5kdemo.dts b/boards/others/neorv32/neorv32_neorv32_up5kdemo.dts index a40a12715b0a..96f0546bcfae 100644 --- a/boards/others/neorv32/neorv32_neorv32_up5kdemo.dts +++ b/boards/others/neorv32/neorv32_neorv32_up5kdemo.dts @@ -109,8 +109,7 @@ }; &cpu0 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "zicsr", "zifencei"; + riscv,isa = "rv32im_zicsr_zifencei"; }; &bootrom { diff --git a/soc/neorv32/Kconfig b/soc/neorv32/Kconfig index d92af16eef64..c643c942f40c 100644 --- a/soc/neorv32/Kconfig +++ b/soc/neorv32/Kconfig @@ -5,6 +5,8 @@ config SOC_NEORV32 select RISCV select RISCV_PRIVILEGED select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI imply XIP if SOC_NEORV32 From 5aaec7c1eaf9b308f9840398d068b2ee3cfae26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:20 +0200 Subject: [PATCH 2797/3334] Revert "[nrf fromtree] openhwgroup: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8ff93f5e40a628f39ec963f713e9e248aa808785. Signed-off-by: Andrzej Głąbek --- .../cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 | 2 +- boards/openhwgroup/cv64a6_genesys_2/board.yml | 2 +- .../cv64a6_genesys_2/doc/index.rst | 2 +- dts/riscv/openhwgroup/cv32a6.dtsi | 3 +-- dts/riscv/openhwgroup/cv64a6.dtsi | 3 +-- soc/openhwgroup/cva6/cv32a6/Kconfig | 5 +++++ soc/openhwgroup/cva6/cv64a6/Kconfig | 20 +++++++++++++++++++ soc/openhwgroup/cva6/cv64a6/Kconfig.soc | 14 ++++++++++--- soc/openhwgroup/cva6/soc.yml | 3 ++- 9 files changed, 43 insertions(+), 11 deletions(-) diff --git a/boards/openhwgroup/cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 b/boards/openhwgroup/cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 index fd698942dcca..1a983093e994 100644 --- a/boards/openhwgroup/cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 +++ b/boards/openhwgroup/cv64a6_genesys_2/Kconfig.cv64a6_genesys_2 @@ -1,4 +1,4 @@ # Copyright 2024 CISPA Helmholtz Center for Information Security gGmbH # SPDX-License-Identifier: Apache-2.0 config BOARD_CV64A6_GENESYS_2 - select SOC_CV64A6 + select SOC_CV64A6_IMAFDC diff --git a/boards/openhwgroup/cv64a6_genesys_2/board.yml b/boards/openhwgroup/cv64a6_genesys_2/board.yml index 70b0a877748f..e08ea7e79280 100644 --- a/boards/openhwgroup/cv64a6_genesys_2/board.yml +++ b/boards/openhwgroup/cv64a6_genesys_2/board.yml @@ -5,4 +5,4 @@ board: full_name: Digilent CV64A6 on Genesys 2 vendor: openhwgroup socs: - - name: cv64a6 + - name: cv64a6_imafdc diff --git a/boards/openhwgroup/cv64a6_genesys_2/doc/index.rst b/boards/openhwgroup/cv64a6_genesys_2/doc/index.rst index 48acc5f18ac2..090332078de7 100644 --- a/boards/openhwgroup/cv64a6_genesys_2/doc/index.rst +++ b/boards/openhwgroup/cv64a6_genesys_2/doc/index.rst @@ -44,7 +44,7 @@ Loading the FPGA configuration You need to build a bitstream with Xilinx Vivado and load it into the FPGA before you can load zephyr onto the board. Please refer to the CVA6 documentation for the required steps. -This configuration is compatible with the following build target: cv64a6_sv39 +This configuration is compatible with the following build target: cv64a6_imafdc_sv39 Flashing ======== diff --git a/dts/riscv/openhwgroup/cv32a6.dtsi b/dts/riscv/openhwgroup/cv32a6.dtsi index 78860733d2a9..e71571bee118 100644 --- a/dts/riscv/openhwgroup/cv32a6.dtsi +++ b/dts/riscv/openhwgroup/cv32a6.dtsi @@ -22,8 +22,7 @@ timebase-frequency = ; device_type = "cpu"; compatible = "openhwgroup,cva6", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "zicsr", "zifencei"; + riscv,isa = "rv32ima"; /* overwrite in board configuration if sv32 MMU is enabled */ mmu-type = "riscv,none"; reg = <0>; diff --git a/dts/riscv/openhwgroup/cv64a6.dtsi b/dts/riscv/openhwgroup/cv64a6.dtsi index bc0e431f1bc8..ca3b47523cec 100644 --- a/dts/riscv/openhwgroup/cv64a6.dtsi +++ b/dts/riscv/openhwgroup/cv64a6.dtsi @@ -22,8 +22,7 @@ timebase-frequency = ; device_type = "cpu"; compatible = "openhwgroup,cva6", "riscv"; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imafdc"; mmu-type = "riscv,sv39"; reg = <0>; diff --git a/soc/openhwgroup/cva6/cv32a6/Kconfig b/soc/openhwgroup/cva6/cv32a6/Kconfig index f4fd6cc0fbcb..b4f184121a56 100644 --- a/soc/openhwgroup/cva6/cv32a6/Kconfig +++ b/soc/openhwgroup/cva6/cv32a6/Kconfig @@ -9,5 +9,10 @@ config SOC_CV32A6 select USE_SWITCH_SUPPORTED select USE_SWITCH select SCHED_IPI_SUPPORTED + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select CPU_HAS_DCACHE select CPU_HAS_ICACHE diff --git a/soc/openhwgroup/cva6/cv64a6/Kconfig b/soc/openhwgroup/cva6/cv64a6/Kconfig index c5e321a3d1e7..94b1ef049a74 100644 --- a/soc/openhwgroup/cva6/cv64a6/Kconfig +++ b/soc/openhwgroup/cva6/cv64a6/Kconfig @@ -4,11 +4,31 @@ # Shared properties config SOC_CV64A6 + bool select RISCV select RISCV_PRIVILEGED select RISCV_HAS_PLIC select USE_SWITCH_SUPPORTED select USE_SWITCH select SCHED_IPI_SUPPORTED + select 64BIT + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select CPU_HAS_DCACHE select CPU_HAS_ICACHE + +# Variant with FPU +config SOC_CV64A6_IMAFDC + select SOC_CV64A6 + select CPU_HAS_FPU + select CPU_HAS_FPU_DOUBLE_PRECISION + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_D + +# Variant without FPU +config SOC_CV64A6_IMAC + select SOC_CV64A6 diff --git a/soc/openhwgroup/cva6/cv64a6/Kconfig.soc b/soc/openhwgroup/cva6/cv64a6/Kconfig.soc index 3719ddf5f149..c3be28de8346 100644 --- a/soc/openhwgroup/cva6/cv64a6/Kconfig.soc +++ b/soc/openhwgroup/cva6/cv64a6/Kconfig.soc @@ -10,15 +10,23 @@ config SOC_SERIES_CV64A6 as well as the forked project with support for the Xilinx AXI Ethernet Subsystem (https://github.com/cispa/CVA6-Vivado-Project-with-Xilinx-AXI-Ethernet). -config SOC_CV64A6 +config SOC_CV64A6_IMAFDC bool select SOC_SERIES_CV64A6 help Standard CVA6 core in 64-bit configuration: SV39 MMU and SoC with CLINT, PLIC, UART, - SPI, and Ethernet (Xilinx or lowRISC). + SPI, and Ethernet (Xilinx or lowRISC). Supports imafdc instruction sets. + +config SOC_CV64A6_IMAC + bool + select SOC_SERIES_CV64A6 + help + Minimal CVA6 core in 64-bit configuration: SV39 MMU and SoC with CLINT, PLIC, UART, + SPI, and Ethernet (Xilinx or lowRISC). Supports imac instruction sets. config SOC_SERIES default "cv64a6" if SOC_SERIES_CV64A6 config SOC - default "cv64a6" if SOC_CV64A6 + default "cv64a6_imac" if SOC_CV64A6_IMAC + default "cv64a6_imafdc" if SOC_CV64A6_IMAFDC diff --git a/soc/openhwgroup/cva6/soc.yml b/soc/openhwgroup/cva6/soc.yml index 3ce510e7b5fc..bd250f81d4b4 100644 --- a/soc/openhwgroup/cva6/soc.yml +++ b/soc/openhwgroup/cva6/soc.yml @@ -5,7 +5,8 @@ family: series: - name: cv64a6 socs: - - name: cv64a6 + - name: cv64a6_imafdc + - name: cv64a6_imac - name: cv32a6 socs: - name: cv32a6 From 971b45ad7b8f3e870f6fed98f493c2fc77c08731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:21 +0200 Subject: [PATCH 2798/3334] Revert "[nrf fromtree] openisa: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fc2a125d5dc154cfad921c5ce9ee88e2270837b2. Signed-off-by: Andrzej Głąbek --- dts/riscv/openisa/rv32m1.dtsi | 6 ++---- soc/openisa/rv32m1/Kconfig | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dts/riscv/openisa/rv32m1.dtsi b/dts/riscv/openisa/rv32m1.dtsi index 14154754dfb5..1b730dafec6d 100644 --- a/dts/riscv/openisa/rv32m1.dtsi +++ b/dts/riscv/openisa/rv32m1.dtsi @@ -24,16 +24,14 @@ cpu@0 { device_type = "cpu"; compatible = "openisa,ri5cy", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imc_zicsr_zifencei"; reg = <0>; }; cpu@1 { device_type = "cpu"; compatible = "openisa,zero-ri5cy", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imc_zicsr_zifencei"; reg = <1>; }; }; diff --git a/soc/openisa/rv32m1/Kconfig b/soc/openisa/rv32m1/Kconfig index 1f4d08083cd3..fcaa650192ed 100644 --- a/soc/openisa/rv32m1/Kconfig +++ b/soc/openisa/rv32m1/Kconfig @@ -14,4 +14,9 @@ config SOC_OPENISA_RV32M1 select HAS_RV32M1_FTFX select HAS_FLASH_LOAD_OFFSET select BUILD_OUTPUT_HEX + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select SOC_EARLY_INIT_HOOK From dd39017f07445319bcc079b1ae37444ee9fc8656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:21 +0200 Subject: [PATCH 2799/3334] Revert "[nrf fromtree] raspberrypi: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2b617a3301bdf4cead5a887b0be4bd074f539087. Signed-off-by: Andrzej Głąbek --- dts/riscv/raspberrypi/hazard3.dtsi | 6 ++---- soc/raspberrypi/rpi_pico/rp2350/Kconfig | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dts/riscv/raspberrypi/hazard3.dtsi b/dts/riscv/raspberrypi/hazard3.dtsi index dcd3bfea2ba0..31f960013454 100644 --- a/dts/riscv/raspberrypi/hazard3.dtsi +++ b/dts/riscv/raspberrypi/hazard3.dtsi @@ -34,12 +34,10 @@ */ &cpu0 { compatible = "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei", "zba", "zbs"; + riscv,isa = "rv32imac_zicsr_zifencei"; }; &cpu1 { compatible = "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei", "zba", "zbs"; + riscv,isa = "rv32imac_zicsr_zifencei"; }; diff --git a/soc/raspberrypi/rpi_pico/rp2350/Kconfig b/soc/raspberrypi/rpi_pico/rp2350/Kconfig index 1f5876fcb563..389f8275e9da 100644 --- a/soc/raspberrypi/rpi_pico/rp2350/Kconfig +++ b/soc/raspberrypi/rpi_pico/rp2350/Kconfig @@ -14,6 +14,14 @@ config SOC_RP2350A_HAZARD3 select HAS_FLASH_LOAD_OFFSET select INCLUDE_RESET_VECTOR select RISCV + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZBA + select RISCV_ISA_EXT_ZBS + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI config SOC_RP2350A_M33 select ARM @@ -31,6 +39,14 @@ config SOC_RP2350B_HAZARD3 select HAS_FLASH_LOAD_OFFSET select INCLUDE_RESET_VECTOR select RISCV + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZBA + select RISCV_ISA_EXT_ZBS + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI config SOC_RP2350B_M33 select ARM From 2fe443885697b3c88fa3521e5034be27842d3809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:21 +0200 Subject: [PATCH 2800/3334] Revert "[nrf fromtree] sensry: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9ec1d620127cd0e17d88aa1ffc63e1a9a308acbb. Signed-off-by: Andrzej Głąbek --- dts/riscv/sensry/ganymed-sy1xx.dtsi | 3 +-- soc/sensry/ganymed/sy1xx/Kconfig | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dts/riscv/sensry/ganymed-sy1xx.dtsi b/dts/riscv/sensry/ganymed-sy1xx.dtsi index d50f6b030ebe..996edd062353 100644 --- a/dts/riscv/sensry/ganymed-sy1xx.dtsi +++ b/dts/riscv/sensry/ganymed-sy1xx.dtsi @@ -20,8 +20,7 @@ cpu0: cpu@0 { compatible = "sensry,sy1xx", "riscv"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "c", "zicsr"; + riscv,isa = "rv32imc_zicsr"; status = "okay"; }; }; diff --git a/soc/sensry/ganymed/sy1xx/Kconfig b/soc/sensry/ganymed/sy1xx/Kconfig index 0eec265e9d2d..548c200ac53d 100644 --- a/soc/sensry/ganymed/sy1xx/Kconfig +++ b/soc/sensry/ganymed/sy1xx/Kconfig @@ -3,4 +3,8 @@ config SOC_SERIES_SY1XX select RISCV + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR select RISCV_PRIVILEGED From 84e5964c8dc3829d6fad88818f849953191aaacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:22 +0200 Subject: [PATCH 2801/3334] Revert "[nrf fromtree] bflb: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 15e4f765b4fcd9908152464b8a1f76972c5584d4. Signed-off-by: Andrzej Głąbek --- dts/riscv/bflb/bl60x.dtsi | 3 +-- dts/riscv/bflb/bl61x.dtsi | 3 +-- dts/riscv/bflb/bl70x.dtsi | 3 +-- soc/bflb/bl60x/Kconfig | 7 +++++++ soc/bflb/bl61x/Kconfig | 1 + soc/bflb/bl70x/Kconfig | 7 +++++++ 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/dts/riscv/bflb/bl60x.dtsi b/dts/riscv/bflb/bl60x.dtsi index 467e8bc450fd..625675bdf029 100644 --- a/dts/riscv/bflb/bl60x.dtsi +++ b/dts/riscv/bflb/bl60x.dtsi @@ -72,8 +72,7 @@ device_type = "cpu"; compatible = "sifive,e24", "riscv"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imafcb"; hardware-exec-breakpoint-count = <4>; status = "okay"; diff --git a/dts/riscv/bflb/bl61x.dtsi b/dts/riscv/bflb/bl61x.dtsi index ccb947ab5ce9..1de40dc2150c 100644 --- a/dts/riscv/bflb/bl61x.dtsi +++ b/dts/riscv/bflb/bl61x.dtsi @@ -86,8 +86,7 @@ device_type = "cpu"; compatible = "xuantie,e907", "riscv"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imafcp"; i-cache-line-size = <32>; d-cache-line-size = <32>; hardware-exec-breakpoint-count = <4>; diff --git a/dts/riscv/bflb/bl70x.dtsi b/dts/riscv/bflb/bl70x.dtsi index df5b250d4efa..92546b02a399 100644 --- a/dts/riscv/bflb/bl70x.dtsi +++ b/dts/riscv/bflb/bl70x.dtsi @@ -71,8 +71,7 @@ device_type = "cpu"; compatible = "sifive,e24", "riscv"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imafcb"; hardware-exec-breakpoint-count = <4>; status = "okay"; diff --git a/soc/bflb/bl60x/Kconfig b/soc/bflb/bl60x/Kconfig index e6c65c4120b4..debeb6cbee0e 100644 --- a/soc/bflb/bl60x/Kconfig +++ b/soc/bflb/bl60x/Kconfig @@ -18,6 +18,13 @@ config SOC_SERIES_BL60X select RISCV_HAS_CLIC select RISCV_MACHINE_TIMER select RISCV_PRIVILEGED + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_VECTORED_MODE select SOC_EARLY_INIT_HOOK select SOC_PREP_HOOK diff --git a/soc/bflb/bl61x/Kconfig b/soc/bflb/bl61x/Kconfig index 7cb76798dab6..4fc4dbd4bdca 100644 --- a/soc/bflb/bl61x/Kconfig +++ b/soc/bflb/bl61x/Kconfig @@ -10,6 +10,7 @@ config SOC_SERIES_BL61X select FPU select ICACHE select RISCV + select RISCV_ISA_EXT_F select SOC_EARLY_INIT_HOOK select SYSCON select XIP diff --git a/soc/bflb/bl70x/Kconfig b/soc/bflb/bl70x/Kconfig index 23e234d99346..c681f08766ef 100644 --- a/soc/bflb/bl70x/Kconfig +++ b/soc/bflb/bl70x/Kconfig @@ -17,6 +17,13 @@ config SOC_SERIES_BL70X select RISCV_HAS_CLIC select RISCV_MACHINE_TIMER select RISCV_PRIVILEGED + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_VECTORED_MODE select SOC_EARLY_INIT_HOOK select SOC_PREP_HOOK From b2a65e6979bf88c71dc3c21b1b304f6887ed973a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:22 +0200 Subject: [PATCH 2802/3334] Revert "[nrf fromtree] sifive: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8a72806b1931c7ab105899984a846a6cb2a76029. Signed-off-by: Andrzej Głąbek --- dts/riscv/sifive/riscv32-fe310.dtsi | 3 +-- dts/riscv/sifive/riscv64-fu540.dtsi | 15 +++++---------- dts/riscv/sifive/riscv64-fu740.dtsi | 15 +++++---------- soc/sifive/sifive_freedom/fe300/Kconfig | 7 +++++++ soc/sifive/sifive_freedom/fu500/Kconfig | 8 ++++++++ soc/sifive/sifive_freedom/fu700/Kconfig | 8 ++++++++ 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/dts/riscv/sifive/riscv32-fe310.dtsi b/dts/riscv/sifive/riscv32-fe310.dtsi index 95f2d286fb13..6ab404f08680 100644 --- a/dts/riscv/sifive/riscv32-fe310.dtsi +++ b/dts/riscv/sifive/riscv32-fe310.dtsi @@ -33,8 +33,7 @@ compatible = "sifive,e31", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr_zifencei"; status = "okay"; hlic: interrupt-controller { diff --git a/dts/riscv/sifive/riscv64-fu540.dtsi b/dts/riscv/sifive/riscv64-fu540.dtsi index c75a3a957189..ab01193344a2 100644 --- a/dts/riscv/sifive/riscv64-fu540.dtsi +++ b/dts/riscv/sifive/riscv64-fu540.dtsi @@ -37,8 +37,7 @@ device_type = "cpu"; i-cache-line-size = <0x4000>; reg = <0x0>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imac_zicsr_zifencei"; hlic0: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -55,8 +54,7 @@ i-cache-line-size = <0x8000>; d-cache-line-size = <0x8000>; reg = <0x1>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic1: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -74,8 +72,7 @@ i-cache-line-size = <0x8000>; d-cache-line-size = <0x8000>; reg = <0x2>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic2: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -93,8 +90,7 @@ i-cache-line-size = <0x8000>; d-cache-line-size = <0x8000>; reg = <0x3>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic3: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -112,8 +108,7 @@ i-cache-line-size = <0x8000>; d-cache-line-size = <0x8000>; reg = <0x4>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic4: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/sifive/riscv64-fu740.dtsi b/dts/riscv/sifive/riscv64-fu740.dtsi index 79d2760bf690..c4691ae79800 100644 --- a/dts/riscv/sifive/riscv64-fu740.dtsi +++ b/dts/riscv/sifive/riscv64-fu740.dtsi @@ -35,8 +35,7 @@ compatible = "sifive,s7", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imac_zicsr_zifencei"; status = "okay"; hlic0: interrupt-controller { @@ -52,8 +51,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x1>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic1: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -68,8 +66,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x2>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic2: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -84,8 +81,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x3>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic3: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -100,8 +96,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x4>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; hlic4: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/sifive/sifive_freedom/fe300/Kconfig b/soc/sifive/sifive_freedom/fe300/Kconfig index bd49ac7524f7..027f96e8c3f7 100644 --- a/soc/sifive/sifive_freedom/fe300/Kconfig +++ b/soc/sifive/sifive_freedom/fe300/Kconfig @@ -11,6 +11,13 @@ config SOC_SERIES_SIFIVE_FREEDOM_FE300 select RISCV_HAS_PLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select INCLUDE_RESET_VECTOR select SOC_EARLY_INIT_HOOK imply XIP diff --git a/soc/sifive/sifive_freedom/fu500/Kconfig b/soc/sifive/sifive_freedom/fu500/Kconfig index ceb034373835..10761abbf813 100644 --- a/soc/sifive/sifive_freedom/fu500/Kconfig +++ b/soc/sifive/sifive_freedom/fu500/Kconfig @@ -12,9 +12,17 @@ config SOC_SERIES_SIFIVE_FREEDOM_FU500 select RISCV_PMP select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select SOC_EARLY_INIT_HOOK select INCLUDE_RESET_VECTOR imply XIP config SOC_SIFIVE_FREEDOM_FU540_U54 bool + select RISCV_ISA_EXT_G diff --git a/soc/sifive/sifive_freedom/fu700/Kconfig b/soc/sifive/sifive_freedom/fu700/Kconfig index 1bab9f933cd0..9f981d2f1796 100644 --- a/soc/sifive/sifive_freedom/fu700/Kconfig +++ b/soc/sifive/sifive_freedom/fu700/Kconfig @@ -11,9 +11,17 @@ config SOC_SERIES_SIFIVE_FREEDOM_FU700 select RISCV_PMP select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select SOC_EARLY_INIT_HOOK select INCLUDE_RESET_VECTOR imply XIP config SOC_SIFIVE_FREEDOM_FU740_U74 bool + select RISCV_ISA_EXT_G From c85190c74ca4301d38afebc3e5635b8d1220907b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:22 +0200 Subject: [PATCH 2803/3334] Revert "[nrf fromtree] snps: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 790e112881b8d30e5d8ee863a7b9f469a2743f65. Signed-off-by: Andrzej Głąbek --- boards/snps/nsim/arc_v/rhx1xx.dtsi | 4 +--- boards/snps/nsim/arc_v/rmx1xx.dtsi | 3 +-- soc/snps/nsim/arc_v/rhx/Kconfig | 10 ++++++++++ soc/snps/nsim/arc_v/rmx/Kconfig | 6 ++++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/boards/snps/nsim/arc_v/rhx1xx.dtsi b/boards/snps/nsim/arc_v/rhx1xx.dtsi index 26318ddb483c..d4889f191933 100644 --- a/boards/snps/nsim/arc_v/rhx1xx.dtsi +++ b/boards/snps/nsim/arc_v/rhx1xx.dtsi @@ -12,9 +12,7 @@ device_type = "cpu"; reg = <0>; clock-frequency = <5000000>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei", - "zba", "zbb", "zbc", "zbs"; + riscv,isa = "rv32imac_zicsr_zifencei_zba_zbb_zbc_zbs"; cpu0_intc: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/boards/snps/nsim/arc_v/rmx1xx.dtsi b/boards/snps/nsim/arc_v/rmx1xx.dtsi index 2b8553143c97..905065870850 100644 --- a/boards/snps/nsim/arc_v/rmx1xx.dtsi +++ b/boards/snps/nsim/arc_v/rmx1xx.dtsi @@ -12,8 +12,7 @@ device_type = "cpu"; reg = <0>; clock-frequency = <5000000>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr_zifencei"; cpu0_intc: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/snps/nsim/arc_v/rhx/Kconfig b/soc/snps/nsim/arc_v/rhx/Kconfig index d6f9301947aa..64e991bf7364 100644 --- a/soc/snps/nsim/arc_v/rhx/Kconfig +++ b/soc/snps/nsim/arc_v/rhx/Kconfig @@ -4,6 +4,16 @@ config SOC_SERIES_RHX select RISCV select RISCV_PRIVILEGED + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select RISCV_ISA_EXT_ZBA + select RISCV_ISA_EXT_ZBB + select RISCV_ISA_EXT_ZBC + select RISCV_ISA_EXT_ZBS select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select INCLUDE_RESET_VECTOR imply XIP diff --git a/soc/snps/nsim/arc_v/rmx/Kconfig b/soc/snps/nsim/arc_v/rmx/Kconfig index 6d3f0c97fbde..e80cfefa471f 100644 --- a/soc/snps/nsim/arc_v/rmx/Kconfig +++ b/soc/snps/nsim/arc_v/rmx/Kconfig @@ -5,6 +5,12 @@ config SOC_SERIES_RMX bool select RISCV select RISCV_PRIVILEGED + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select INCLUDE_RESET_VECTOR imply XIP From a731953e4c1a7a3ec9b75c0bbff4cc2721b034e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:23 +0200 Subject: [PATCH 2804/3334] Revert "[nrf fromtree] starfive: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 36de06a3a252eb3af2e6eebb1a02a1f774797030. Signed-off-by: Andrzej Głąbek --- dts/riscv/starfive/jh7110-visionfive-v2.dtsi | 15 +++++---------- dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi | 6 ++---- soc/starfive/jh71xx/Kconfig | 12 ++++++++++++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/dts/riscv/starfive/jh7110-visionfive-v2.dtsi b/dts/riscv/starfive/jh7110-visionfive-v2.dtsi index 1cd042d6c729..a1b51d8f9ac3 100644 --- a/dts/riscv/starfive/jh7110-visionfive-v2.dtsi +++ b/dts/riscv/starfive/jh7110-visionfive-v2.dtsi @@ -23,8 +23,7 @@ compatible = "sifive,s7", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imac_zicsr_zifencei"; status = "okay"; cpu0_intc: interrupt-controller { @@ -39,8 +38,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x1>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imafdcg"; cpu1_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -54,8 +52,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x2>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imafdcg"; cpu2_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -69,8 +66,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x3>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imafdcg"; cpu3_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -84,8 +80,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0x4>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64imafdcg"; cpu4_intc: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi b/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi index c6e6ac1c00fd..e2568deb7c19 100644 --- a/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi +++ b/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi @@ -24,8 +24,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <0>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; status = "okay"; cpu0intctrl: interrupt-controller { @@ -42,8 +41,7 @@ device_type = "cpu"; mmu-type = "riscv,sv39"; reg = <1>; - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; status = "okay"; cpu1intctrl: interrupt-controller { diff --git a/soc/starfive/jh71xx/Kconfig b/soc/starfive/jh71xx/Kconfig index 74421040ed9d..607e6e94f8c6 100644 --- a/soc/starfive/jh71xx/Kconfig +++ b/soc/starfive/jh71xx/Kconfig @@ -10,6 +10,18 @@ config SOC_SERIES_STARFIVE_JH71XX config SOC_JH7100 select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI config SOC_JH7110 select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI From 969fe99d4fa6348fcf0c0f3db871236af8c75aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:23 +0200 Subject: [PATCH 2805/3334] Revert "[nrf fromtree] telink: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3a1e2e2f494e5b2e2f67086ed6e710ec58ba7e87. Signed-off-by: Andrzej Głąbek --- dts/riscv/telink/telink_b91.dtsi | 3 +-- soc/telink/tlsr/tlsr951x/Kconfig | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dts/riscv/telink/telink_b91.dtsi b/dts/riscv/telink/telink_b91.dtsi index 149f7ec6e97e..c9bd546a2e94 100644 --- a/dts/riscv/telink/telink_b91.dtsi +++ b/dts/riscv/telink/telink_b91.dtsi @@ -24,8 +24,7 @@ reg = <0>; clock-frequency = <24000000>; compatible = "telink,b91", "andestech,andescore-v5", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "f", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr_zifencei"; hlic: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/telink/tlsr/tlsr951x/Kconfig b/soc/telink/tlsr/tlsr951x/Kconfig index 99191575c4f5..a31aec0a5c65 100644 --- a/soc/telink/tlsr/tlsr951x/Kconfig +++ b/soc/telink/tlsr/tlsr951x/Kconfig @@ -4,6 +4,13 @@ config SOC_SERIES_TLSR951X bool select RISCV + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_PRIVILEGED select RISCV_HAS_PLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING From 5e6ae061ae345d1ddc54bb57cd7245f95b1913cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:24 +0200 Subject: [PATCH 2806/3334] Revert "[nrf fromtree] wch: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1794d47c17a4b36a709f47014069f99cc4acd741. Signed-off-by: Andrzej Głąbek --- dts/riscv/wch/qingke-v2a.dtsi | 3 +-- dts/riscv/wch/qingke-v2c.dtsi | 3 +-- dts/riscv/wch/qingke-v4b.dtsi | 3 +-- dts/riscv/wch/qingke-v4c.dtsi | 3 +-- dts/riscv/wch/qingke-v4f.dtsi | 3 +-- soc/wch/ch32v/ch32v00x/Kconfig | 5 +++++ soc/wch/ch32v/qingke_v2a/Kconfig | 4 ++++ soc/wch/ch32v/qingke_v4b/Kconfig | 6 ++++++ soc/wch/ch32v/qingke_v4c/Kconfig | 6 ++++++ soc/wch/ch32v/qingke_v4f/Kconfig | 7 +++++++ 10 files changed, 33 insertions(+), 10 deletions(-) diff --git a/dts/riscv/wch/qingke-v2a.dtsi b/dts/riscv/wch/qingke-v2a.dtsi index f6ad3cbaee38..b7da8aab9f0d 100644 --- a/dts/riscv/wch/qingke-v2a.dtsi +++ b/dts/riscv/wch/qingke-v2a.dtsi @@ -16,8 +16,7 @@ device_type = "cpu"; compatible = "wch,qingke-v2", "riscv"; reg = <0>; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "c", "zicsr", "zifencei"; + riscv,isa = "rv32ec_zicsr_zifencei"; }; }; diff --git a/dts/riscv/wch/qingke-v2c.dtsi b/dts/riscv/wch/qingke-v2c.dtsi index 4e397841c97e..2a005c5766f3 100644 --- a/dts/riscv/wch/qingke-v2c.dtsi +++ b/dts/riscv/wch/qingke-v2c.dtsi @@ -16,8 +16,7 @@ device_type = "cpu"; compatible = "wch,qingke-v2", "riscv"; reg = <0>; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "c", "zicsr", "zifencei", "zmmul"; + riscv,isa = "rv32ec_zicsr_zifencei_zmmul"; }; }; diff --git a/dts/riscv/wch/qingke-v4b.dtsi b/dts/riscv/wch/qingke-v4b.dtsi index 24313efe0fa0..7ff969ba6f1c 100644 --- a/dts/riscv/wch/qingke-v4b.dtsi +++ b/dts/riscv/wch/qingke-v4b.dtsi @@ -16,8 +16,7 @@ device_type = "cpu"; compatible = "wch,qingke-v4b", "riscv"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr_zifencei"; }; }; diff --git a/dts/riscv/wch/qingke-v4c.dtsi b/dts/riscv/wch/qingke-v4c.dtsi index 182dcd1623c5..866fc98ab088 100644 --- a/dts/riscv/wch/qingke-v4c.dtsi +++ b/dts/riscv/wch/qingke-v4c.dtsi @@ -16,8 +16,7 @@ device_type = "cpu"; compatible = "wch,qingke-v4c", "riscv"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr_zifencei"; }; }; diff --git a/dts/riscv/wch/qingke-v4f.dtsi b/dts/riscv/wch/qingke-v4f.dtsi index cedda00e21e0..159c215eb251 100644 --- a/dts/riscv/wch/qingke-v4f.dtsi +++ b/dts/riscv/wch/qingke-v4f.dtsi @@ -16,8 +16,7 @@ device_type = "cpu"; compatible = "wch,qingke-v4f", "riscv"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "f", "zicsr", "zifencei"; + riscv,isa = "rv32imacf_zicsr_zifencei"; }; }; diff --git a/soc/wch/ch32v/ch32v00x/Kconfig b/soc/wch/ch32v/ch32v00x/Kconfig index f32770bbd662..74e07bf1aa70 100644 --- a/soc/wch/ch32v/ch32v00x/Kconfig +++ b/soc/wch/ch32v/ch32v00x/Kconfig @@ -2,3 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_CH32V00X + select RISCV_ISA_RV32E + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZMMUL diff --git a/soc/wch/ch32v/qingke_v2a/Kconfig b/soc/wch/ch32v/qingke_v2a/Kconfig index b3201ea981fe..de004227a473 100644 --- a/soc/wch/ch32v/qingke_v2a/Kconfig +++ b/soc/wch/ch32v/qingke_v2a/Kconfig @@ -2,3 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_QINGKE_V2A + select RISCV_ISA_RV32E + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI + select RISCV_ISA_EXT_C diff --git a/soc/wch/ch32v/qingke_v4b/Kconfig b/soc/wch/ch32v/qingke_v4b/Kconfig index 45619d3c9e73..1706900e7cd9 100644 --- a/soc/wch/ch32v/qingke_v4b/Kconfig +++ b/soc/wch/ch32v/qingke_v4b/Kconfig @@ -2,3 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_QINGKE_V4B + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI diff --git a/soc/wch/ch32v/qingke_v4c/Kconfig b/soc/wch/ch32v/qingke_v4c/Kconfig index 8539c83ef6da..732a7d8a9ec0 100644 --- a/soc/wch/ch32v/qingke_v4c/Kconfig +++ b/soc/wch/ch32v/qingke_v4c/Kconfig @@ -2,3 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_QINGKE_V4C + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI diff --git a/soc/wch/ch32v/qingke_v4f/Kconfig b/soc/wch/ch32v/qingke_v4f/Kconfig index 472fcfa45a15..3f6c61415485 100644 --- a/soc/wch/ch32v/qingke_v4f/Kconfig +++ b/soc/wch/ch32v/qingke_v4f/Kconfig @@ -2,3 +2,10 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_QINGKE_V4F + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI From d0757d6e1d02ae445a49a1f9d9c3429201a9ea55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:24 +0200 Subject: [PATCH 2807/3334] Revert "[nrf fromtree] espressif: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b32c2a1b114df361fbcc639117dc95c7ce53e6a4. Signed-off-by: Andrzej Głąbek --- dts/riscv/espressif/esp32c2/esp32c2_common.dtsi | 3 +-- dts/riscv/espressif/esp32c3/esp32c3_common.dtsi | 3 +-- dts/riscv/espressif/esp32c6/esp32c6_common.dtsi | 3 +-- dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi | 3 +-- dts/riscv/espressif/esp32h2/esp32h2_common.dtsi | 3 +-- soc/espressif/esp32c2/Kconfig | 4 ++++ soc/espressif/esp32c3/Kconfig | 4 ++++ soc/espressif/esp32c6/Kconfig | 6 ++++++ soc/espressif/esp32h2/Kconfig | 6 ++++++ 9 files changed, 25 insertions(+), 10 deletions(-) diff --git a/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi b/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi index 5271e436f55c..af44efa41174 100644 --- a/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi +++ b/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi @@ -33,8 +33,7 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "c", "zicsr"; + riscv,isa = "rv32imc_zicsr"; reg = <0>; clock-source = ; clock-frequency = ; diff --git a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi index 1129596d6cd5..75719bd14917 100644 --- a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi +++ b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi @@ -34,8 +34,7 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "c", "zicsr"; + riscv,isa = "rv32imc_zicsr"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; clock-source = ; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi index 75d7980143f4..c0c53314d5a1 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi @@ -35,8 +35,7 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; clock-source = ; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi index 2daf47299a5b..50d2b6592e04 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi @@ -21,8 +21,7 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr_zifencei"; reg = <0>; clock-source = ; clock-frequency = ; diff --git a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi index 26a5cc0215e3..631dd14969e2 100644 --- a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi +++ b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi @@ -34,8 +34,7 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "espressif,riscv", "riscv"; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; clock-source = ; diff --git a/soc/espressif/esp32c2/Kconfig b/soc/espressif/esp32c2/Kconfig index 34716ff5b72c..cfade8c5b900 100644 --- a/soc/espressif/esp32c2/Kconfig +++ b/soc/espressif/esp32c2/Kconfig @@ -7,6 +7,10 @@ config SOC_SERIES_ESP32C2 select DYNAMIC_INTERRUPTS select CLOCK_CONTROL select PINCTRL + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR select HAS_ESPRESSIF_HAL select HAS_PM select HAS_POWEROFF diff --git a/soc/espressif/esp32c3/Kconfig b/soc/espressif/esp32c3/Kconfig index 605d0a94c1d0..c0dbb8ba8765 100644 --- a/soc/espressif/esp32c3/Kconfig +++ b/soc/espressif/esp32c3/Kconfig @@ -7,6 +7,10 @@ config SOC_SERIES_ESP32C3 select DYNAMIC_INTERRUPTS select CLOCK_CONTROL select PINCTRL + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR select HAS_ESPRESSIF_HAL select HAS_PM select HAS_POWEROFF diff --git a/soc/espressif/esp32c6/Kconfig b/soc/espressif/esp32c6/Kconfig index fe6db5e4ec0b..bb1b4a752392 100644 --- a/soc/espressif/esp32c6/Kconfig +++ b/soc/espressif/esp32c6/Kconfig @@ -8,6 +8,12 @@ config SOC_SERIES_ESP32C6 select DYNAMIC_INTERRUPTS if SOC_ESP32C6_HPCORE select CLOCK_CONTROL if SOC_ESP32C6_HPCORE select PINCTRL if SOC_ESP32C6_HPCORE + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select HAS_ESPRESSIF_HAL select HAS_PM select HAS_POWEROFF diff --git a/soc/espressif/esp32h2/Kconfig b/soc/espressif/esp32h2/Kconfig index 7c795fe3fe9e..40ce94bbd682 100644 --- a/soc/espressif/esp32h2/Kconfig +++ b/soc/espressif/esp32h2/Kconfig @@ -7,6 +7,12 @@ config SOC_SERIES_ESP32H2 select DYNAMIC_INTERRUPTS select CLOCK_CONTROL select PINCTRL + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select HAS_ESPRESSIF_HAL select HAS_PM select HAS_POWEROFF From 2504bc3162c0d87b4aab9e62b84ee40f3c336c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:24 +0200 Subject: [PATCH 2808/3334] Revert "[nrf fromtree] nordic: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1d2553fe764fdb53ca09b13368ca5d98c33c1983. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf54h20.dtsi | 6 ++---- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 3 +-- dts/vendor/nordic/nrf54lm20a.dtsi | 3 +-- dts/vendor/nordic/nrf7120_enga.dtsi | 3 +-- dts/vendor/nordic/nrf9280.dtsi | 3 +-- soc/nordic/common/vpr/Kconfig | 4 ++++ 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index ca2d475ec00b..eb8df4805a84 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -48,8 +48,7 @@ device_type = "cpu"; clocks = <&fll16m>; clock-frequency = ; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "c", "zicsr"; + riscv,isa = "rv32emc"; nordic,bus-width = <32>; cpuppr_vevif_rx: mailbox { @@ -83,8 +82,7 @@ reg = <14>; device_type = "cpu"; clock-frequency = ; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "c", "zicsr"; + riscv,isa = "rv32emc"; nordic,bus-width = <32>; cpuflpr_vevif_rx: mailbox { diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 0919b1347d77..0f609cbd3a80 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -43,8 +43,7 @@ reg = <1>; device_type = "cpu"; clocks = <&hfpll>; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "c", "zicsr"; + riscv,isa = "rv32emc"; nordic,bus-width = <32>; }; }; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index b872dff0f559..1ba0cf6a813f 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -42,8 +42,7 @@ compatible = "nordic,vpr", "riscv"; reg = <1>; device_type = "cpu"; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "c", "zicsr"; + riscv,isa = "rv32emc"; nordic,bus-width = <32>; }; }; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index 48a2b268317e..a709b0109f66 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -38,8 +38,7 @@ reg = <1>; device_type = "cpu"; clock-frequency = ; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "c", "zicsr"; + riscv,isa = "rv32emc"; nordic,bus-width = <32>; }; }; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 97a1bf7495b0..271fcc765f57 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -42,8 +42,7 @@ reg = <13>; device_type = "cpu"; clock-frequency = ; - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "c", "zicsr"; + riscv,isa = "rv32emc"; nordic,bus-width = <32>; cpuppr_vevif_rx: mailbox { diff --git a/soc/nordic/common/vpr/Kconfig b/soc/nordic/common/vpr/Kconfig index 5a2ae8e48bf8..e3f8a717cba3 100644 --- a/soc/nordic/common/vpr/Kconfig +++ b/soc/nordic/common/vpr/Kconfig @@ -6,6 +6,10 @@ config RISCV_CORE_NORDIC_VPR select RISCV select RISCV_PRIVILEGED select RISCV_VECTORED_MODE + select RISCV_ISA_RV32E + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR select RISCV_SOC_HAS_ISR_STACKING select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING select RISCV_HAS_CLIC From ddcbf061611baaf35a29d928b1864ea776647240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:25 +0200 Subject: [PATCH 2809/3334] Revert "[nrf fromtree] renode: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 79012188f4698a397588b70b95e1f975eb853a17. Signed-off-by: Andrzej Głąbek --- dts/riscv/renode_riscv32_virt.dtsi | 3 +-- soc/renode/riscv_virtual/Kconfig | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dts/riscv/renode_riscv32_virt.dtsi b/dts/riscv/renode_riscv32_virt.dtsi index 96c870deba0d..2b8a74ba4198 100644 --- a/dts/riscv/renode_riscv32_virt.dtsi +++ b/dts/riscv/renode_riscv32_virt.dtsi @@ -19,8 +19,7 @@ compatible = "renode,virt", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "c", "zicsr", "zifencei"; + riscv,isa = "rv32imac_zicsr_zifencei"; hlic: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/soc/renode/riscv_virtual/Kconfig b/soc/renode/riscv_virtual/Kconfig index 6f11befe6e86..f4fa61a0b11a 100644 --- a/soc/renode/riscv_virtual/Kconfig +++ b/soc/renode/riscv_virtual/Kconfig @@ -5,6 +5,12 @@ config SOC_RISCV_VIRTUAL_RENODE select RISCV select RISCV_PRIVILEGED select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_PLIC select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING imply XIP From 3d9e520d17d7438ccfd399bf2368eb23ac285cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:25 +0200 Subject: [PATCH 2810/3334] Revert "[nrf fromtree] efinix: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 380fa9cd41fbbfec99fc515ef6fec0d55412ab25. Signed-off-by: Andrzej Głąbek --- dts/riscv/efinix/sapphire_soc.dtsi | 3 +-- soc/efinix/sapphire/Kconfig | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dts/riscv/efinix/sapphire_soc.dtsi b/dts/riscv/efinix/sapphire_soc.dtsi index 5d066c05360a..3e50d8d7a208 100644 --- a/dts/riscv/efinix/sapphire_soc.dtsi +++ b/dts/riscv/efinix/sapphire_soc.dtsi @@ -31,8 +31,7 @@ compatible = "efinix,vexriscv-sapphire", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "zicsr", "zifencei"; + riscv,isa = "rv32ima_zicsr_zifencei"; status = "okay"; hlic: interrupt-controller { diff --git a/soc/efinix/sapphire/Kconfig b/soc/efinix/sapphire/Kconfig index 75a4f4f4c44c..17406bfe7f71 100644 --- a/soc/efinix/sapphire/Kconfig +++ b/soc/efinix/sapphire/Kconfig @@ -3,6 +3,11 @@ config SOC_EFINIX_SAPPHIRE select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV select RISCV_PRIVILEGED select RISCV_HAS_PLIC From 30d7cafa55fac5cb8cd348f6c9dc63f58f8932f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:26 +0200 Subject: [PATCH 2811/3334] Revert "[nrf fromtree] qemu: riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 254ccf3f7be792201bfb86ee84dff524dfbc1545. Signed-off-by: Andrzej Głąbek --- boards/qemu/riscv32e/qemu_riscv32e.dts | 2 +- dts/riscv/qemu/virt-riscv32.dtsi | 24 +++------ dts/riscv/qemu/virt-riscv32e.dtsi | 53 ------------------- dts/riscv/qemu/virt-riscv64.dtsi | 24 +++------ soc/qemu/virt_riscv/Kconfig | 3 ++ soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig | 4 ++ .../virt_riscv/qemu_virt_riscv32e/Kconfig | 3 ++ soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig | 5 ++ 8 files changed, 32 insertions(+), 86 deletions(-) delete mode 100644 dts/riscv/qemu/virt-riscv32e.dtsi diff --git a/boards/qemu/riscv32e/qemu_riscv32e.dts b/boards/qemu/riscv32e/qemu_riscv32e.dts index 0ed55c7a965f..403d75cb7420 100644 --- a/boards/qemu/riscv32e/qemu_riscv32e.dts +++ b/boards/qemu/riscv32e/qemu_riscv32e.dts @@ -7,7 +7,7 @@ /dts-v1/; -#include +#include / { chosen { diff --git a/dts/riscv/qemu/virt-riscv32.dtsi b/dts/riscv/qemu/virt-riscv32.dtsi index 6fa79c639d37..25d769d5183a 100644 --- a/dts/riscv/qemu/virt-riscv32.dtsi +++ b/dts/riscv/qemu/virt-riscv32.dtsi @@ -11,43 +11,35 @@ / { cpus { cpu@0 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv32gc"; }; cpu@1 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv32gc"; }; cpu@2 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv32gc"; }; cpu@3 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv32gc"; }; cpu@4 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv32gc"; }; cpu@5 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv32gc"; }; cpu@6 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv32gc"; }; cpu@7 { - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv32gc"; }; }; }; diff --git a/dts/riscv/qemu/virt-riscv32e.dtsi b/dts/riscv/qemu/virt-riscv32e.dtsi deleted file mode 100644 index e7f79639739e..000000000000 --- a/dts/riscv/qemu/virt-riscv32e.dtsi +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include - -/ { - cpus { - cpu@0 { - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; - }; - - cpu@1 { - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; - }; - - cpu@2 { - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; - }; - - cpu@3 { - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; - }; - - cpu@4 { - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; - }; - - cpu@5 { - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; - }; - - cpu@6 { - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; - }; - - cpu@7 { - riscv,isa-base = "rv32e"; - riscv,isa-extensions = "e", "m", "a", "c", "zicsr", "zifencei"; - }; - }; -}; diff --git a/dts/riscv/qemu/virt-riscv64.dtsi b/dts/riscv/qemu/virt-riscv64.dtsi index 0410ee3ec58e..936f0a188152 100644 --- a/dts/riscv/qemu/virt-riscv64.dtsi +++ b/dts/riscv/qemu/virt-riscv64.dtsi @@ -11,43 +11,35 @@ / { cpus { cpu@0 { - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; }; cpu@1 { - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; }; cpu@2 { - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; }; cpu@3 { - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; }; cpu@4 { - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; }; cpu@5 { - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; }; cpu@6 { - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; }; cpu@7 { - riscv,isa-base = "rv64i"; - riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicsr", "zifencei"; + riscv,isa = "rv64gc"; }; }; }; diff --git a/soc/qemu/virt_riscv/Kconfig b/soc/qemu/virt_riscv/Kconfig index f4f82a7fa07f..d17ac3296a12 100644 --- a/soc/qemu/virt_riscv/Kconfig +++ b/soc/qemu/virt_riscv/Kconfig @@ -3,6 +3,9 @@ config SOC_FAMILY_QEMU_VIRT_RISCV select INCLUDE_RESET_VECTOR + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C select RISCV select RISCV_PRIVILEGED select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING diff --git a/soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig b/soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig index 8405adf66d36..f8f1157f247b 100644 --- a/soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig +++ b/soc/qemu/virt_riscv/qemu_virt_riscv32/Kconfig @@ -2,4 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_QEMU_VIRT_RISCV32 + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_PLIC diff --git a/soc/qemu/virt_riscv/qemu_virt_riscv32e/Kconfig b/soc/qemu/virt_riscv/qemu_virt_riscv32e/Kconfig index 94f13a2a4b56..973992ece9bf 100644 --- a/soc/qemu/virt_riscv/qemu_virt_riscv32e/Kconfig +++ b/soc/qemu/virt_riscv/qemu_virt_riscv32e/Kconfig @@ -3,4 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_QEMU_VIRT_RISCV32E + select RISCV_ISA_RV32E + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_PLIC diff --git a/soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig b/soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig index f130f51207be..b78e2bf5a980 100644 --- a/soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig +++ b/soc/qemu/virt_riscv/qemu_virt_riscv64/Kconfig @@ -2,4 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_QEMU_VIRT_RISCV64 + select RISCV_ISA_RV64I + select RISCV_ISA_EXT_F + select RISCV_ISA_EXT_D + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI select RISCV_HAS_PLIC From 612ec99d8e4a50541077add64076357bbaafe020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:26 +0200 Subject: [PATCH 2812/3334] Revert "[nrf fromtree] litex: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e933df1a3ea4e1a266a826ccc47a33001ff7b573. Signed-off-by: Andrzej Głąbek --- dts/riscv/riscv32-litex-vexriscv.dtsi | 3 +-- soc/litex/litex_vexriscv/Kconfig | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dts/riscv/riscv32-litex-vexriscv.dtsi b/dts/riscv/riscv32-litex-vexriscv.dtsi index 7089bf154521..0439d2ab3a43 100644 --- a/dts/riscv/riscv32-litex-vexriscv.dtsi +++ b/dts/riscv/riscv32-litex-vexriscv.dtsi @@ -19,8 +19,7 @@ compatible = "litex,vexriscv-standard", "spinalhdl,vexriscv", "riscv"; device_type = "cpu"; reg = <0>; - riscv,isa-base = "rv32i"; - riscv,isa-extensions = "i", "m", "zicsr", "zifencei"; + riscv,isa = "rv32im_zicsr_zifencei"; status = "okay"; }; }; diff --git a/soc/litex/litex_vexriscv/Kconfig b/soc/litex/litex_vexriscv/Kconfig index 37463c812bff..00d5c6d05bf4 100644 --- a/soc/litex/litex_vexriscv/Kconfig +++ b/soc/litex/litex_vexriscv/Kconfig @@ -4,6 +4,10 @@ config SOC_LITEX_VEXRISCV select RISCV select INCLUDE_RESET_VECTOR + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_ZICSR + select RISCV_ISA_EXT_ZIFENCEI # There are varriants of the Vexriscv without cache, be able to set it select CPU_HAS_ICACHE if $(dt_node_int_prop_int,/cpus/cpu@0,i-cache-line-size) > 0 select CPU_HAS_DCACHE if $(dt_node_int_prop_int,/cpus/cpu@0,d-cache-line-size) > 0 From a94746fc256729818edde2425a51c1652dbdace6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:26 +0200 Subject: [PATCH 2813/3334] Revert "[nrf fromtree] riscv: make riscv,isa dt prop no longer required" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fcd601a8778b6aaacf409604207aa21e8af7d225. Signed-off-by: Andrzej Głąbek --- dts/bindings/cpu/riscv,cpus.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index 0ff385142e1f..6858a290fc9a 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -19,6 +19,7 @@ properties: riscv,isa: description: RISC-V instruction set architecture + required: true type: string riscv,isa-base: From a702535e870adf9216b7357dbcfa85bd0df06cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:27 +0200 Subject: [PATCH 2814/3334] Revert "[nrf fromtree] riscv: use riscv,isa-extensions dt prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e223c442535b6f65e22c5ec32c56a8692615821c. Signed-off-by: Andrzej Głąbek --- arch/riscv/Kconfig.isa | 31 ------------------------------- dts/bindings/cpu/riscv,cpus.yaml | 18 ------------------ 2 files changed, 49 deletions(-) diff --git a/arch/riscv/Kconfig.isa b/arch/riscv/Kconfig.isa index c3b3c4044ae1..f5df9b85eef1 100644 --- a/arch/riscv/Kconfig.isa +++ b/arch/riscv/Kconfig.isa @@ -1,37 +1,29 @@ # Copyright (c) 2022 Carlo Caione # SPDX-License-Identifier: Apache-2.0 -RISCV_ISA_BASE_PROP := riscv,isa-base -RISCV_ISA_EXT_PROP := riscv,isa-extensions - config RISCV_ISA_RV32I bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_BASE_PROP),rv32i) help RV32I Base Integer Instruction Set - 32bit config RISCV_ISA_RV32E bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_BASE_PROP),rv32e) help RV32E Base Integer Instruction Set (Embedded) - 32bit config RISCV_ISA_RV64I bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_BASE_PROP),rv64i) select 64BIT help RV64I Base Integer Instruction Set - 64bit config RISCV_ISA_RV128I bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_BASE_PROP),rv128i) help RV128I Base Integer Instruction Set - 128bit config RISCV_ISA_EXT_M bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),m) help (M) - Standard Extension for Integer Multiplication and Division @@ -41,7 +33,6 @@ config RISCV_ISA_EXT_M config RISCV_ISA_EXT_A bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),a) imply RISCV_ISA_EXT_ZAAMO imply RISCV_ISA_EXT_ZALRSC help @@ -54,7 +45,6 @@ config RISCV_ISA_EXT_A config RISCV_ISA_EXT_F bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),f) select CPU_HAS_FPU help (F) - Standard Extension for Single-Precision Floating-Point @@ -66,7 +56,6 @@ config RISCV_ISA_EXT_F config RISCV_ISA_EXT_D bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),d) depends on RISCV_ISA_EXT_F select CPU_HAS_FPU_DOUBLE_PRECISION help @@ -90,7 +79,6 @@ config RISCV_ISA_EXT_G config RISCV_ISA_EXT_Q bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),q) depends on RISCV_ISA_RV64I depends on RISCV_ISA_EXT_F depends on RISCV_ISA_EXT_D @@ -103,7 +91,6 @@ config RISCV_ISA_EXT_Q config RISCV_ISA_EXT_C bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),c) select RISCV_ISA_EXT_ZCA select RISCV_ISA_EXT_ZCD if RISCV_ISA_EXT_D select RISCV_ISA_EXT_ZCF if RISCV_ISA_EXT_F && (RISCV_ISA_RV32I || RISCV_ISA_RV32E) @@ -116,7 +103,6 @@ config RISCV_ISA_EXT_C config RISCV_ISA_EXT_ZICNTR bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zicntr) depends on RISCV_ISA_EXT_ZICSR help (Zicntr) - Standard Extension for Base Counters and Timers @@ -127,7 +113,6 @@ config RISCV_ISA_EXT_ZICNTR config RISCV_ISA_EXT_ZICSR bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zicsr) help (Zicsr) - Standard Extension for Control and Status Register (CSR) Instructions @@ -136,7 +121,6 @@ config RISCV_ISA_EXT_ZICSR config RISCV_ISA_EXT_SMCSRIND bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),smcsrind) depends on RISCV_ISA_EXT_ZICSR help (Smcsrind) - Standard Extension for Indirect CSR Access @@ -146,7 +130,6 @@ config RISCV_ISA_EXT_SMCSRIND config RISCV_ISA_EXT_ZIFENCEI bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zifencei) help (Zifencei) - Standard Extension for Instruction-Fetch Fence @@ -156,7 +139,6 @@ config RISCV_ISA_EXT_ZIFENCEI config RISCV_ISA_EXT_ZAAMO bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zaamo) help (Zaamo) - Atomic memory operation subset of the A extension @@ -164,7 +146,6 @@ config RISCV_ISA_EXT_ZAAMO config RISCV_ISA_EXT_ZALRSC bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zalrsc) help (Zalrsc) - Load-Reserved/Store-Conditional subset of the A extension @@ -172,7 +153,6 @@ config RISCV_ISA_EXT_ZALRSC config RISCV_ISA_EXT_ZCA bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zca) help (Zca) - Zba Extension for Compressed Instructions @@ -181,7 +161,6 @@ config RISCV_ISA_EXT_ZCA config RISCV_ISA_EXT_ZCB bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcb) depends on RISCV_ISA_EXT_ZCA help (Zcb) - Zcb Extension for Simple Compressed Instructions @@ -191,7 +170,6 @@ config RISCV_ISA_EXT_ZCB config RISCV_ISA_EXT_ZCD bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcd) depends on RISCV_ISA_EXT_D depends on RISCV_ISA_EXT_ZCA help @@ -202,7 +180,6 @@ config RISCV_ISA_EXT_ZCD config RISCV_ISA_EXT_ZCF bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcf) depends on RISCV_ISA_RV32I || RISCV_ISA_RV32E depends on RISCV_ISA_EXT_F depends on RISCV_ISA_EXT_ZCA @@ -214,7 +191,6 @@ config RISCV_ISA_EXT_ZCF config RISCV_ISA_EXT_ZCMP bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcmp) depends on RISCV_ISA_EXT_ZCA depends on !RISCV_ISA_EXT_ZCD help @@ -225,7 +201,6 @@ config RISCV_ISA_EXT_ZCMP config RISCV_ISA_EXT_ZCMT bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zcmt) depends on RISCV_ISA_EXT_ZICSR depends on RISCV_ISA_EXT_ZCA depends on !RISCV_ISA_EXT_ZCD @@ -237,7 +212,6 @@ config RISCV_ISA_EXT_ZCMT config RISCV_ISA_EXT_ZBA bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zba) help (Zba) - Zba BitManip Extension @@ -248,7 +222,6 @@ config RISCV_ISA_EXT_ZBA config RISCV_ISA_EXT_ZBB bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zbb) help (Zbb) - Zbb BitManip Extension (Basic bit-manipulation) @@ -258,7 +231,6 @@ config RISCV_ISA_EXT_ZBB config RISCV_ISA_EXT_ZBC bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zbc) help (Zbc) - Zbc BitManip Extension (Carry-less multiplication) @@ -267,7 +239,6 @@ config RISCV_ISA_EXT_ZBC config RISCV_ISA_EXT_ZBKB bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zbkb) help (Zbkb) - Zbkb BitManip Extension (Bit-manipulation for Cryptography) @@ -276,7 +247,6 @@ config RISCV_ISA_EXT_ZBKB config RISCV_ISA_EXT_ZBS bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zbs) help (Zbs) - Zbs BitManip Extension (Single-bit instructions) @@ -286,7 +256,6 @@ config RISCV_ISA_EXT_ZBS config RISCV_ISA_EXT_ZMMUL bool - default y if $(dt_compat_all_has_prop,riscv,$(RISCV_ISA_EXT_PROP),zmmul) help (Zmmul) - Zmmul Extension for Integer Multiplication diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index 6858a290fc9a..ed38bfa69a56 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -21,21 +21,3 @@ properties: description: RISC-V instruction set architecture required: true type: string - - riscv,isa-base: - description: The base ISA implemented by the hart. - type: string - enum: - - rv32i - - rv32e - - rv64i - - rv128i - - riscv,isa-extensions: - description: | - Extensions supported by the hart. Take a look at - https://www.kernel.org/doc/Documentation/devicetree/bindings/riscv/extensions.yaml - and https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html - for a list of possible extensions. Not all options listed there are - necessarily supported by Zephyr. - type: string-array From 8b28b677f525ae9148b902ef1666211c0c96aa9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:27 +0200 Subject: [PATCH 2815/3334] Revert "[nrf fromtree] docs: migration-guide: riscv compatible requirement" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 131291bacb2df7d3ab07da7413a3a5b892f549be. Signed-off-by: Andrzej Głąbek --- doc/releases/migration-guide-4.4.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 0bb6fabcd067..21d580984f10 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -802,6 +802,3 @@ Architectures the feature is cache related so move it under cache. * Use :c:func:`sys_cache_is_mem_coherent` instead of :c:func:`arch_mem_coherent`. - -* :kconfig:option:`CONFIG_RISCV` now requires, that the :dtcompatible:`riscv` is present in the - devicetree. From c4c5146ce46a983882bfc7008180ece26bc70e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:27 +0200 Subject: [PATCH 2816/3334] Revert "[nrf fromtree] arch: riscv: require "riscv" compatible" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 33036c88cb9dac794c42ac9a28823d232683af45. Signed-off-by: Andrzej Głąbek --- arch/Kconfig | 1 - dts/bindings/cpu/riscv,cpus.yaml | 4 ---- 2 files changed, 5 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index e14c24119c85..9a08a29cf38e 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -122,7 +122,6 @@ config RISCV select ARCH_HAS_DIRECTED_IPIS select BARRIER_OPERATIONS_BUILTIN select ARCH_HAS_THREAD_PRIV_STACK_SPACE_GET if USERSPACE - depends on DT_HAS_RISCV_ENABLED help RISCV architecture diff --git a/dts/bindings/cpu/riscv,cpus.yaml b/dts/bindings/cpu/riscv,cpus.yaml index ed38bfa69a56..883146d76b2a 100644 --- a/dts/bindings/cpu/riscv,cpus.yaml +++ b/dts/bindings/cpu/riscv,cpus.yaml @@ -1,10 +1,6 @@ # Copyright (c) 2021 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 -description: RISC-V CPU - -compatible: "riscv" - include: cpu.yaml properties: From fb119a17024f025672b64de3297e11978ca66cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:28 +0200 Subject: [PATCH 2817/3334] Revert "[nrf fromtree] starfive: riscv: dts: remove unsupported properties" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 62cb56c299ea268aa4806553d51e4dd3759e61a1. Signed-off-by: Andrzej Głąbek --- dts/riscv/starfive/jh7110-visionfive-v2.dtsi | 48 +++++++++++++++++++ .../starfive/starfive_jh7100_beagle_v.dtsi | 26 ++++++++++ 2 files changed, 74 insertions(+) diff --git a/dts/riscv/starfive/jh7110-visionfive-v2.dtsi b/dts/riscv/starfive/jh7110-visionfive-v2.dtsi index a1b51d8f9ac3..7803ccd9f649 100644 --- a/dts/riscv/starfive/jh7110-visionfive-v2.dtsi +++ b/dts/riscv/starfive/jh7110-visionfive-v2.dtsi @@ -36,9 +36,21 @@ U74_1: cpu@1 { compatible = "sifive,u74", "riscv"; device_type = "cpu"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <40>; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <40>; mmu-type = "riscv,sv39"; + next-level-cache = <&ccache>; reg = <0x1>; riscv,isa = "rv64imafdcg"; + tlb-spilt; cpu1_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -50,9 +62,21 @@ U74_2: cpu@2 { compatible = "sifive,u74", "riscv"; device_type = "cpu"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <40>; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <40>; mmu-type = "riscv,sv39"; + next-level-cache = <&ccache>; reg = <0x2>; riscv,isa = "rv64imafdcg"; + tlb-split; cpu2_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -64,9 +88,21 @@ U74_3: cpu@3 { compatible = "sifive,u74", "riscv"; device_type = "cpu"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <40>; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <40>; mmu-type = "riscv,sv39"; + next-level-cache = <&ccache>; reg = <0x3>; riscv,isa = "rv64imafdcg"; + tlb-split; cpu3_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -78,9 +114,21 @@ U74_4: cpu@4 { compatible = "sifive,u74", "riscv"; device_type = "cpu"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <40>; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <40>; mmu-type = "riscv,sv39"; + next-level-cache = <&ccache>; reg = <0x4>; riscv,isa = "rv64imafdcg"; + tlb-split; cpu4_intc: interrupt-controller { compatible = "riscv,cpu-intc"; diff --git a/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi b/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi index e2568deb7c19..3e7f55cee028 100644 --- a/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi +++ b/dts/riscv/starfive/starfive_jh7100_beagle_v.dtsi @@ -21,11 +21,24 @@ cpu@0 { clock-frequency = <0>; compatible = "starfive,rocket0", "riscv"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <32>; device_type = "cpu"; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <32>; mmu-type = "riscv,sv39"; + next-level-cache = <&cachectrl>; reg = <0>; riscv,isa = "rv64gc"; + starfive,itim = <&itim0>; status = "okay"; + tlb-split; cpu0intctrl: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -38,11 +51,24 @@ cpu@1 { clock-frequency = <0>; compatible = "starfive,rocket0", "riscv"; + d-cache-block-size = <64>; + d-cache-sets = <64>; + d-cache-size = <32768>; + d-tlb-sets = <1>; + d-tlb-size = <32>; device_type = "cpu"; + i-cache-block-size = <64>; + i-cache-sets = <64>; + i-cache-size = <32768>; + i-tlb-sets = <1>; + i-tlb-size = <32>; mmu-type = "riscv,sv39"; + next-level-cache = <&cachectrl>; reg = <1>; riscv,isa = "rv64gc"; + starfive,itim = <&itim1>; status = "okay"; + tlb-split; cpu1intctrl: interrupt-controller { compatible = "riscv,cpu-intc"; From 3a562b32e6be2975aed7c37d315868a311a71633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:28 +0200 Subject: [PATCH 2818/3334] Revert "[nrf fromtree] riscv: dts: add missing "riscv" compatible" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a2685accb2810e9b5867cb8b31026421a951190e. Signed-off-by: Andrzej Głąbek --- dts/riscv/aesc/nitrogen.dtsi | 2 +- dts/riscv/espressif/esp32c6/esp32c6_common.dtsi | 2 +- dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi | 2 +- dts/riscv/espressif/esp32h2/esp32h2_common.dtsi | 2 +- dts/riscv/openhwgroup/cv32a6.dtsi | 2 +- dts/riscv/openhwgroup/cv64a6.dtsi | 2 +- dts/riscv/wch/qingke-v2a.dtsi | 2 +- dts/riscv/wch/qingke-v2c.dtsi | 2 +- dts/riscv/wch/qingke-v4b.dtsi | 2 +- dts/riscv/wch/qingke-v4c.dtsi | 2 +- dts/riscv/wch/qingke-v4f.dtsi | 2 +- dts/vendor/nordic/nrf54h20.dtsi | 4 ++-- dts/vendor/nordic/nrf54l_05_10_15.dtsi | 2 +- dts/vendor/nordic/nrf54lm20a.dtsi | 2 +- dts/vendor/nordic/nrf7120_enga.dtsi | 2 +- dts/vendor/nordic/nrf9280.dtsi | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dts/riscv/aesc/nitrogen.dtsi b/dts/riscv/aesc/nitrogen.dtsi index b1e3def00bbd..0babebf5ce1d 100644 --- a/dts/riscv/aesc/nitrogen.dtsi +++ b/dts/riscv/aesc/nitrogen.dtsi @@ -17,7 +17,7 @@ #size-cells = <0>; cpu0: cpu@0 { - compatible = "litex,vexriscv-standard", "riscv"; + compatible = "litex,vexriscv-standard"; device_type = "cpu"; reg = <0>; riscv,isa = "rv32imc"; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi index c0c53314d5a1..7cfd23bb683c 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi @@ -34,7 +34,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "espressif,riscv", "riscv"; + compatible = "espressif,riscv"; riscv,isa = "rv32imac_zicsr"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi index 50d2b6592e04..d92d8e992b7c 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_lpcore.dtsi @@ -20,7 +20,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "espressif,riscv", "riscv"; + compatible = "espressif,riscv"; riscv,isa = "rv32imac_zicsr_zifencei"; reg = <0>; clock-source = ; diff --git a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi index 631dd14969e2..5353e91bdb38 100644 --- a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi +++ b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi @@ -33,7 +33,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "espressif,riscv", "riscv"; + compatible = "espressif,riscv"; riscv,isa = "rv32imac_zicsr"; reg = <0>; cpu-power-states = <&light_sleep &deep_sleep>; diff --git a/dts/riscv/openhwgroup/cv32a6.dtsi b/dts/riscv/openhwgroup/cv32a6.dtsi index e71571bee118..83ac4bd70fb2 100644 --- a/dts/riscv/openhwgroup/cv32a6.dtsi +++ b/dts/riscv/openhwgroup/cv32a6.dtsi @@ -21,7 +21,7 @@ clock-frequency = ; timebase-frequency = ; device_type = "cpu"; - compatible = "openhwgroup,cva6", "riscv"; + compatible = "openhwgroup,cva6"; riscv,isa = "rv32ima"; /* overwrite in board configuration if sv32 MMU is enabled */ mmu-type = "riscv,none"; diff --git a/dts/riscv/openhwgroup/cv64a6.dtsi b/dts/riscv/openhwgroup/cv64a6.dtsi index ca3b47523cec..13fe21399b69 100644 --- a/dts/riscv/openhwgroup/cv64a6.dtsi +++ b/dts/riscv/openhwgroup/cv64a6.dtsi @@ -21,7 +21,7 @@ clock-frequency = ; timebase-frequency = ; device_type = "cpu"; - compatible = "openhwgroup,cva6", "riscv"; + compatible = "openhwgroup,cva6"; riscv,isa = "rv64imafdc"; mmu-type = "riscv,sv39"; reg = <0>; diff --git a/dts/riscv/wch/qingke-v2a.dtsi b/dts/riscv/wch/qingke-v2a.dtsi index b7da8aab9f0d..a82ce935a53b 100644 --- a/dts/riscv/wch/qingke-v2a.dtsi +++ b/dts/riscv/wch/qingke-v2a.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v2", "riscv"; + compatible = "wch,qingke-v2"; reg = <0>; riscv,isa = "rv32ec_zicsr_zifencei"; }; diff --git a/dts/riscv/wch/qingke-v2c.dtsi b/dts/riscv/wch/qingke-v2c.dtsi index 2a005c5766f3..dc6b57cdae7a 100644 --- a/dts/riscv/wch/qingke-v2c.dtsi +++ b/dts/riscv/wch/qingke-v2c.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v2", "riscv"; + compatible = "wch,qingke-v2"; reg = <0>; riscv,isa = "rv32ec_zicsr_zifencei_zmmul"; }; diff --git a/dts/riscv/wch/qingke-v4b.dtsi b/dts/riscv/wch/qingke-v4b.dtsi index 7ff969ba6f1c..0fb20ef7e25f 100644 --- a/dts/riscv/wch/qingke-v4b.dtsi +++ b/dts/riscv/wch/qingke-v4b.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v4b", "riscv"; + compatible = "wch,qingke-v4b"; reg = <0>; riscv,isa = "rv32imac_zicsr_zifencei"; }; diff --git a/dts/riscv/wch/qingke-v4c.dtsi b/dts/riscv/wch/qingke-v4c.dtsi index 866fc98ab088..c4b00b5fdd7e 100644 --- a/dts/riscv/wch/qingke-v4c.dtsi +++ b/dts/riscv/wch/qingke-v4c.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v4c", "riscv"; + compatible = "wch,qingke-v4c"; reg = <0>; riscv,isa = "rv32imac_zicsr_zifencei"; }; diff --git a/dts/riscv/wch/qingke-v4f.dtsi b/dts/riscv/wch/qingke-v4f.dtsi index 159c215eb251..32d70579ba1b 100644 --- a/dts/riscv/wch/qingke-v4f.dtsi +++ b/dts/riscv/wch/qingke-v4f.dtsi @@ -14,7 +14,7 @@ cpu0: cpu@0 { device_type = "cpu"; - compatible = "wch,qingke-v4f", "riscv"; + compatible = "wch,qingke-v4f"; reg = <0>; riscv,isa = "rv32imacf_zicsr_zifencei"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index eb8df4805a84..f40b202fbba2 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -43,7 +43,7 @@ }; cpuppr: cpu@d { - compatible = "nordic,vpr", "riscv"; + compatible = "nordic,vpr"; reg = <13>; device_type = "cpu"; clocks = <&fll16m>; @@ -78,7 +78,7 @@ }; cpuflpr: cpu@e { - compatible = "nordic,vpr", "riscv"; + compatible = "nordic,vpr"; reg = <14>; device_type = "cpu"; clock-frequency = ; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 0f609cbd3a80..4dea8277169f 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -39,7 +39,7 @@ }; cpuflpr: cpu@1 { - compatible = "nordic,vpr", "riscv"; + compatible = "nordic,vpr"; reg = <1>; device_type = "cpu"; clocks = <&hfpll>; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 1ba0cf6a813f..351b4b959886 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -39,7 +39,7 @@ }; cpuflpr: cpu@1 { - compatible = "nordic,vpr", "riscv"; + compatible = "nordic,vpr"; reg = <1>; device_type = "cpu"; riscv,isa = "rv32emc"; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index a709b0109f66..bcbb99be2feb 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -34,7 +34,7 @@ }; cpuflpr: cpu@1 { - compatible = "nordic,vpr", "riscv"; + compatible = "nordic,vpr"; reg = <1>; device_type = "cpu"; clock-frequency = ; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index 271fcc765f57..a4dd3e2ea2b9 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -38,7 +38,7 @@ }; cpuppr: cpu@d { - compatible = "nordic,vpr", "riscv"; + compatible = "nordic,vpr"; reg = <13>; device_type = "cpu"; clock-frequency = ; From 0cebdd13cddcc884818cc22683bfa3b022c6fd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:28 +0200 Subject: [PATCH 2819/3334] Revert "[nrf fromtree] scripts: Refactor dt_compat_any_has_prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e4d6bcf660d075e5aa836caf4a7700ce95a23ed. Signed-off-by: Andrzej Głąbek --- scripts/kconfig/kconfigfunctions.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 87fcc70d4cf5..5c54d40f760f 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -890,19 +890,16 @@ def dt_compat_any_has_prop(kconf, _, compat, prop, value=None): if doc_mode or edt is None: return "n" - if compat not in edt.compat2okay: - return "n" - - for node in edt.compat2okay[compat]: - if prop not in node.props: - continue - if value is None: - return "y" - if isinstance(node.props[prop].val, list): - if value in map(str, node.props[prop].val): - return "y" - elif str(node.props[prop].val) == value: - return "y" + if compat in edt.compat2okay: + for node in edt.compat2okay[compat]: + if prop in node.props: + if value is None: + return "y" + if isinstance(node.props[prop].val, list): + if value in map(str, node.props[prop].val): + return "y" + elif str(node.props[prop].val) == value: + return "y" return "n" def dt_compat_any_not_has_prop(kconf, _, compat, prop): From 4e26cd72f625c50441095500561359813f46f25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:29 +0200 Subject: [PATCH 2820/3334] Revert "[nrf fromtree] scripts: Add dt_compat_all_has_prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d0e1186ef2dc7bb96736e9bddc4e3279c46d73d5. Signed-off-by: Andrzej Głąbek --- doc/build/kconfig/preprocessor-functions.rst | 1 - scripts/kconfig/kconfigfunctions.py | 28 -------------------- 2 files changed, 29 deletions(-) diff --git a/doc/build/kconfig/preprocessor-functions.rst b/doc/build/kconfig/preprocessor-functions.rst index 92287c87a183..ab7429963409 100644 --- a/doc/build/kconfig/preprocessor-functions.rst +++ b/doc/build/kconfig/preprocessor-functions.rst @@ -39,7 +39,6 @@ while the ``*_hex`` version returns a hexadecimal value starting with ``0x``. $(dt_chosen_reg_addr_int,[,,]) $(dt_chosen_reg_size_hex,[,,]) $(dt_chosen_reg_size_int,[,,]) - $(dt_compat_all_has_prop,,[,]) $(dt_compat_any_has_prop,,[,]) $(dt_compat_any_on_bus,,) $(dt_compat_enabled,) diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 5c54d40f760f..350a278fa46d 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -851,33 +851,6 @@ def dt_compat_on_bus(kconf, _, compat, bus): return "n" -def dt_compat_all_has_prop(kconf, _, compat, prop, value=None): - """ - This function takes a 'compat', a 'prop', and a 'value'. - If value=None, the function returns "y" if all - enabled node with compatible 'compat' also has a valid property 'prop'. - If value is given, the function returns "y" if all enabled node with compatible 'compat' - also has a valid property 'prop' with value 'value'. - It returns "n" otherwise. - """ - if doc_mode or edt is None: - return "n" - - if compat not in edt.compat2okay or len(edt.compat2okay[compat]) == 0: - return "n" - - for node in edt.compat2okay[compat]: - if prop not in node.props: - return "n" - if value is None: - continue - if isinstance(node.props[prop].val, list): - if value not in map(str, node.props[prop].val): - return "n" - elif str(node.props[prop].val) != value: - return "n" - return "y" - def dt_compat_any_has_prop(kconf, _, compat, prop, value=None): """ This function takes a 'compat', a 'prop', and a 'value'. @@ -1171,7 +1144,6 @@ def inc_dec(kconf, name, *args): "dt_compat_enabled": (dt_compat_enabled, 1, 1), "dt_compat_enabled_num": (dt_compat_enabled_num, 1, 1), "dt_compat_on_bus": (dt_compat_on_bus, 2, 2), - "dt_compat_all_has_prop": (dt_compat_all_has_prop, 2, 3), "dt_compat_any_has_prop": (dt_compat_any_has_prop, 2, 3), "dt_compat_any_not_has_prop": (dt_compat_any_not_has_prop, 2, 2), "dt_chosen_label": (dt_chosen_label, 1, 1), From 3e41e11177f5d2b925f44f0c6d5908c5cc490e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:29 +0200 Subject: [PATCH 2821/3334] Revert "[nrf fromtree] scripts: Add list array support for dt_compat_any_has_prop" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6337ad6b0c3823c6bdc934e30bb441ce31268b61. Signed-off-by: Andrzej Głąbek --- scripts/kconfig/kconfigfunctions.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 350a278fa46d..3c66066b4457 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -868,9 +868,6 @@ def dt_compat_any_has_prop(kconf, _, compat, prop, value=None): if prop in node.props: if value is None: return "y" - if isinstance(node.props[prop].val, list): - if value in map(str, node.props[prop].val): - return "y" elif str(node.props[prop].val) == value: return "y" return "n" From 1ff054c8520138879c182000c6e195723fafba9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:29 +0200 Subject: [PATCH 2822/3334] Revert "[nrf fromtree] arch: riscv: Add the support for Zbkb ISA extension" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 48afc0536944715f35ea614f5ae8a3dc453ec3fd. Signed-off-by: Andrzej Głąbek --- arch/riscv/Kconfig.isa | 8 -------- cmake/compiler/gcc/target_riscv.cmake | 4 ---- 2 files changed, 12 deletions(-) diff --git a/arch/riscv/Kconfig.isa b/arch/riscv/Kconfig.isa index f5df9b85eef1..c5ee324464d8 100644 --- a/arch/riscv/Kconfig.isa +++ b/arch/riscv/Kconfig.isa @@ -237,14 +237,6 @@ config RISCV_ISA_EXT_ZBC The Zbc instructions can be used for carry-less multiplication that is the multiplication in the polynomial ring over GF(2). -config RISCV_ISA_EXT_ZBKB - bool - help - (Zbkb) - Zbkb BitManip Extension (Bit-manipulation for Cryptography) - - The Zbkb instructions can be used for accelerating cryptography workloads - and contain rotation, reversion, packing and some advanced bit-manipulation. - config RISCV_ISA_EXT_ZBS bool help diff --git a/cmake/compiler/gcc/target_riscv.cmake b/cmake/compiler/gcc/target_riscv.cmake index 656b597a393e..e440d4e2b158 100644 --- a/cmake/compiler/gcc/target_riscv.cmake +++ b/cmake/compiler/gcc/target_riscv.cmake @@ -118,10 +118,6 @@ if(CONFIG_RISCV_ISA_EXT_ZBC) string(CONCAT riscv_march ${riscv_march} "_zbc") endif() -if(CONFIG_RISCV_ISA_EXT_ZBKB) - string(CONCAT riscv_march ${riscv_march} "_zbkb") -endif() - if(CONFIG_RISCV_ISA_EXT_ZBS) string(CONCAT riscv_march ${riscv_march} "_zbs") endif() From 3b3dc4cff66e00149387058ddce10453c465376c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:30 +0200 Subject: [PATCH 2823/3334] Revert "[nrf fromtree] manifest: tf-m: BL2 support mcxn947" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4776b16d017389d897c62e37b37f0c6b963a5010. Signed-off-by: Andrzej Głąbek --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 6ed480e2cffb..728d9d165845 100644 --- a/west.yml +++ b/west.yml @@ -386,7 +386,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 6788687e013733d12f015b5d45b214019dea58f7 + revision: 677e0565e030cbe4946ac0cbde5603eae7d6392f path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 5c7c377317bb14446f0d12451844f7b0ed0d3376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:30 +0200 Subject: [PATCH 2824/3334] Revert "[nrf fromtree] boards: nrf54h20: Move extemem config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5a84f0363611e5b0f64f557d7ef088571b168025. Signed-off-by: Andrzej Głąbek --- .../nrf54h20dk_nrf54h20-common.dtsi | 37 ------------------- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi index 28dbc5a5e329..72d78b9c739c 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi @@ -14,40 +14,3 @@ /* Get a node label for wi-fi spi to use in shield files */ wifi_spi: &spi130 {}; - -&exmif { - pinctrl-0 = <&exmif_default>; - pinctrl-1 = <&exmif_sleep>; - pinctrl-names = "default", "sleep"; - status = "disabled"; - - mx25uw63: mx25uw6345g@0 { - compatible = "mxicy,mx25u", "jedec,mspi-nor"; - status = "disabled"; - reg = <0>; - 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]; - sfdp-ff05 = [00 ee c0 69 72 72 71 71 00 d8 f7 f6 00 0a 00 00 - 14 45 98 80]; - sfdp-ff84 = [43 06 0f 00 21 dc ff ff]; - size = <67108864>; - has-dpd; - t-enter-dpd = <10000>; - t-exit-dpd = <30000>; - reset-gpios = <&gpio6 12 GPIO_ACTIVE_LOW>; - t-reset-pulse = <10000>; - t-reset-recovery = <35000>; - - mspi-max-frequency = ; - mspi-io-mode = "MSPI_IO_MODE_OCTAL"; - mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; - mspi-hardware-ce-num = <1>; - mspi-cpp-mode = "MSPI_CPP_MODE_0"; - mspi-endian = "MSPI_BIG_ENDIAN"; - mspi-ce-polarity = "MSPI_CE_ACTIVE_LOW"; - }; -}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 3025a413f498..c5dd7a124d1d 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -274,6 +274,43 @@ slot3_partition: &cpurad_slot1_partition { status = "disabled"; }; +&exmif { + pinctrl-0 = <&exmif_default>; + pinctrl-1 = <&exmif_sleep>; + pinctrl-names = "default", "sleep"; + status = "disabled"; + + mx25uw63: mx25uw6345g@0 { + compatible = "mxicy,mx25u", "jedec,mspi-nor"; + status = "disabled"; + reg = <0>; + 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]; + sfdp-ff05 = [00 ee c0 69 72 72 71 71 00 d8 f7 f6 00 0a 00 00 + 14 45 98 80]; + sfdp-ff84 = [43 06 0f 00 21 dc ff ff]; + size = <67108864>; + has-dpd; + t-enter-dpd = <10000>; + t-exit-dpd = <30000>; + reset-gpios = <&gpio6 12 GPIO_ACTIVE_LOW>; + t-reset-pulse = <10000>; + t-reset-recovery = <35000>; + + mspi-max-frequency = ; + mspi-io-mode = "MSPI_IO_MODE_OCTAL"; + mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; + mspi-hardware-ce-num = <1>; + mspi-cpp-mode = "MSPI_CPP_MODE_0"; + mspi-endian = "MSPI_BIG_ENDIAN"; + mspi-ce-polarity = "MSPI_CE_ACTIVE_LOW"; + }; +}; + &cpuapp_ieee802154 { status = "okay"; }; From 41bad88b6916a8692209fe11690b53e91415f374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:31 +0200 Subject: [PATCH 2825/3334] Revert "[nrf fromtree] boards: nordic: fix flash_load_offset calculation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 554b3ebd2f2031c05cf59c71d18b48a8a1ff5008. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf9280pdk/Kconfig.defconfig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/boards/nordic/nrf9280pdk/Kconfig.defconfig b/boards/nordic/nrf9280pdk/Kconfig.defconfig index e9dfea8d31ec..055c6c8be253 100644 --- a/boards/nordic/nrf9280pdk/Kconfig.defconfig +++ b/boards/nordic/nrf9280pdk/Kconfig.defconfig @@ -14,13 +14,10 @@ endif # BOARD_NRF9280PDK_NRF9280_CPUPPR if BOARD_NRF9280PDK_NRF9280_CPUAPP -DT_CHOSEN_Z_FLASH := zephyr,flash - config ROM_START_OFFSET default 0x800 if BOOTLOADER_MCUBOOT config FLASH_LOAD_OFFSET - default $(sub_hex, $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition), \ - $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if !USE_DT_CODE_PARTITION + default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) if !USE_DT_CODE_PARTITION endif # BOARD_NRF9280PDK_NRF9280_CPUAPP From 40337513e170c82c0fc00404ce35fbd7db3665f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:31 +0200 Subject: [PATCH 2826/3334] Revert "[nrf fromlist] dts: vendor: nordic: nrf7120_enga: Rename DTS node" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 136efa18b4843c92066e14f1d89d618ef4ce9c64. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf7120_enga.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index bcbb99be2feb..d2e4b273a2a4 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -96,7 +96,7 @@ zephyr,memory-region = "NRF_KMU_CRACEN_EXCHANGE"; }; - nrf_mpc: memory@50041000 { + nrf_mpc_region: memory@50041000 { #address-cells = <1>; #size-cells = <1>; compatible = "nordic,nrf-mpc"; From ab7280e591897f5ece93ae04ccb8d0486a49cbae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:31 +0200 Subject: [PATCH 2827/3334] Revert "[nrf fromtree] doc: contribute: style: kconfig: Add board naming style" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 65254f2850ba622b59a01ea1f7078190ef7e669a. Signed-off-by: Andrzej Głąbek --- doc/contribute/style/kconfig.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/contribute/style/kconfig.rst b/doc/contribute/style/kconfig.rst index 47f5bfc1d466..97c60c6e9cbe 100644 --- a/doc/contribute/style/kconfig.rst +++ b/doc/contribute/style/kconfig.rst @@ -88,8 +88,6 @@ The specific formats by subtree: * **Tests (/tests)**: Use ``TEST_`` for symbols, this is to prevent conflicts with external modules. -* **Boards (/boards)**: Use ``BOARD_`` for symbols. - Examples ======== From ccfa2ef26b51e8b9f69a1fa653a981595bc54dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:31 +0200 Subject: [PATCH 2828/3334] Revert "[nrf fromtree] doc: contribute: style: kconfig: Add sample/test naming style" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 262d62d746c354ab4b8506025776e5f3d58dd3e9. Signed-off-by: Andrzej Głąbek --- doc/contribute/style/kconfig.rst | 18 ------------------ .../style/kconfig_example_sample.txt | 13 ------------- doc/contribute/style/kconfig_example_test.txt | 11 ----------- 3 files changed, 42 deletions(-) delete mode 100644 doc/contribute/style/kconfig_example_sample.txt delete mode 100644 doc/contribute/style/kconfig_example_test.txt diff --git a/doc/contribute/style/kconfig.rst b/doc/contribute/style/kconfig.rst index 97c60c6e9cbe..5c5cf7f0aaef 100644 --- a/doc/contribute/style/kconfig.rst +++ b/doc/contribute/style/kconfig.rst @@ -82,12 +82,6 @@ The specific formats by subtree: creating new symbols, check if similar ones already exist in other architectures. -* **Samples (/samples)**: Use ``SAMPLE_`` for symbols, this is to prevent conflicts with external - modules. - -* **Tests (/tests)**: Use ``TEST_`` for symbols, this is to prevent conflicts with external - modules. - Examples ======== @@ -107,18 +101,6 @@ Examples :language: kconfig :start-after: start-after-here -**Sample examples:** - -.. literalinclude:: kconfig_example_sample.txt - :language: kconfig - :start-after: start-after-here - -**Test examples:** - -.. literalinclude:: kconfig_example_test.txt - :language: kconfig - :start-after: start-after-here - Configuration Symbol Organization ********************************* diff --git a/doc/contribute/style/kconfig_example_sample.txt b/doc/contribute/style/kconfig_example_sample.txt deleted file mode 100644 index 08fbfb73ecad..000000000000 --- a/doc/contribute/style/kconfig_example_sample.txt +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors -# -# SPDX-License-Identifier: Apache-2.0 -# -# Examples of Kconfig symbols for samples - -# start-after-here - -config SAMPLE_LOCK - bool "Locking feature" - -config SAMPLE_TEMPERATURE_READINGS - bool "Fetch readings from temperature sensor" diff --git a/doc/contribute/style/kconfig_example_test.txt b/doc/contribute/style/kconfig_example_test.txt deleted file mode 100644 index 100aa8beb3ed..000000000000 --- a/doc/contribute/style/kconfig_example_test.txt +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors -# -# SPDX-License-Identifier: Apache-2.0 -# -# Examples of Kconfig symbols for tests - -# start-after-here - -config TEST_ITERATIONS - int "Number of times test should run" - default 3 From 2107fa7b2588f2f35e70da9abc13dd845c5a441a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:32 +0200 Subject: [PATCH 2829/3334] Revert "[nrf fromtree] soc: nordic: Add common TF-M Kconfigs instead of duplicate" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8726caece27f8a4dbcc46cb5a788af4963347344. Signed-off-by: Andrzej Głąbek --- boards/ezurio/bl54l15_dvk/Kconfig | 31 +++++++++++++++++++ boards/ezurio/bl54l15u_dvk/Kconfig | 31 +++++++++++++++++++ boards/nordic/nrf54l15dk/Kconfig | 30 ++++++++++++++++++ boards/nordic/nrf54l15tag/Kconfig | 30 ++++++++++++++++++ .../nordic/nrf54lm20dk/Kconfig | 7 +++-- boards/nordic/nrf7120dk/Kconfig | 30 ++++++++++++++++++ boards/panasonic/panb611evb/Kconfig | 30 ++++++++++++++++++ boards/raytac/an54lq_db_15/Kconfig | 31 +++++++++++++++++++ soc/nordic/common/Kconfig | 1 - 9 files changed, 218 insertions(+), 3 deletions(-) create mode 100644 boards/ezurio/bl54l15_dvk/Kconfig create mode 100644 boards/ezurio/bl54l15u_dvk/Kconfig create mode 100644 boards/nordic/nrf54l15dk/Kconfig create mode 100644 boards/nordic/nrf54l15tag/Kconfig rename soc/nordic/common/Kconfig.tfm => boards/nordic/nrf54lm20dk/Kconfig (82%) create mode 100644 boards/nordic/nrf7120dk/Kconfig create mode 100644 boards/panasonic/panb611evb/Kconfig create mode 100644 boards/raytac/an54lq_db_15/Kconfig diff --git a/boards/ezurio/bl54l15_dvk/Kconfig b/boards/ezurio/bl54l15_dvk/Kconfig new file mode 100644 index 000000000000..412d5c5b3dd6 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/Kconfig @@ -0,0 +1,31 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# BL54L15 DVK board configuration + +if BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS diff --git a/boards/ezurio/bl54l15u_dvk/Kconfig b/boards/ezurio/bl54l15u_dvk/Kconfig new file mode 100644 index 000000000000..b1623fe1b824 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/Kconfig @@ -0,0 +1,31 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# BL54L15U DVK board configuration + +if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS diff --git a/boards/nordic/nrf54l15dk/Kconfig b/boards/nordic/nrf54l15dk/Kconfig new file mode 100644 index 000000000000..bf64dd32293d --- /dev/null +++ b/boards/nordic/nrf54l15dk/Kconfig @@ -0,0 +1,30 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# nRF54L15 DK board configuration + +if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS || BOARD_NRF54L15DK_NRF54L10_CPUAPP_NS diff --git a/boards/nordic/nrf54l15tag/Kconfig b/boards/nordic/nrf54l15tag/Kconfig new file mode 100644 index 000000000000..e2f267bb829e --- /dev/null +++ b/boards/nordic/nrf54l15tag/Kconfig @@ -0,0 +1,30 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# nRF54L15 TAG board configuration + +if BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS diff --git a/soc/nordic/common/Kconfig.tfm b/boards/nordic/nrf54lm20dk/Kconfig similarity index 82% rename from soc/nordic/common/Kconfig.tfm rename to boards/nordic/nrf54lm20dk/Kconfig index 07bdaef7dae7..0b1905a0d8ef 100644 --- a/soc/nordic/common/Kconfig.tfm +++ b/boards/nordic/nrf54lm20dk/Kconfig @@ -1,7 +1,10 @@ -if BUILD_WITH_TFM && (SOC_SERIES_NRF54L || SOC_SERIES_NRF71) +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) +if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS + config NRF_TRUSTZONE_FLASH_REGION_SIZE hex default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) @@ -22,4 +25,4 @@ config NRF_TRUSTZONE_RAM_REGION_SIZE This abstraction allows us to configure TrustZone without depending on peripheral specific symbols. -endif # BUILD_WITH_TFM +endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS diff --git a/boards/nordic/nrf7120dk/Kconfig b/boards/nordic/nrf7120dk/Kconfig new file mode 100644 index 000000000000..7232ebc06d2e --- /dev/null +++ b/boards/nordic/nrf7120dk/Kconfig @@ -0,0 +1,30 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# nRF7120 DK board configuration + +if BOARD_NRF7120DK_NRF7120_CPUAPP_NS + +DT_NRF_MPC_REGION := $(dt_nodelabel_path,nrf_mpc_region) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC_REGION),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC_REGION),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_NRF7120DK_NRF7120_CPUAPP_NS diff --git a/boards/panasonic/panb611evb/Kconfig b/boards/panasonic/panb611evb/Kconfig new file mode 100644 index 000000000000..93fcd9b78f98 --- /dev/null +++ b/boards/panasonic/panb611evb/Kconfig @@ -0,0 +1,30 @@ +# Copyright (c) 2025 Panasonic Industrial Devices Europe GmbH +# SPDX-License-Identifier: Apache-2.0 + +# PANB611EVB configuration + +if BOARD_PANB611EVB_NRF54L15_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_PANB611EVB_NRF54L15_CPUAPP_NS diff --git a/boards/raytac/an54lq_db_15/Kconfig b/boards/raytac/an54lq_db_15/Kconfig new file mode 100644 index 000000000000..091071d266a1 --- /dev/null +++ b/boards/raytac/an54lq_db_15/Kconfig @@ -0,0 +1,31 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Raytac Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# Raytac AN54LQ-DB-15 board configuration + +if BOARD_RAYTAC_AN54LQ_DB_15_NRF54L15_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_RAYTAC_AN54LQ_DB_15_NRF54L15_CPUAPP_NS diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index f1c31e46551b..f69d50635ab8 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -105,4 +105,3 @@ endif # HAS_NORDIC_DMM rsource "vpr/Kconfig" rsource "uicr/Kconfig" -rsource "Kconfig.tfm" From adb82912b4a8dfa1a1a6129116c7a672df16a1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:32 +0200 Subject: [PATCH 2830/3334] Revert "[nrf fromtree] dts: Handle phandles in cmake" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e62d41a5e4f12778971e0122f31c65865711ef95. Signed-off-by: Andrzej Głąbek --- scripts/dts/gen_dts_cmake.py | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/scripts/dts/gen_dts_cmake.py b/scripts/dts/gen_dts_cmake.py index 3c4b14a65047..2886e570335e 100755 --- a/scripts/dts/gen_dts_cmake.py +++ b/scripts/dts/gen_dts_cmake.py @@ -120,25 +120,8 @@ def main(): if node.props: for item in node.props: - # We currently do not support phandle-arrays for edt -> cmake conversion. - # The code below supports the following phandle types: - # - phandle: which specifies a reference to a single node - # - phandles: which specifies a bare list of references to other nodes - if "phandle" in node.props[item].type: - if "array" in node.props[item].type: - continue # phandle-array not supported - # Convert array to CMake list - if isinstance(node.props[item].val, list): - cmake_value = ';'.join(phandle.path for phandle in node.props[item].val) - else: - cmake_value = node.props[item].val.path - - # Encode node's property 'item' as a CMake target property - # with a name like 'DT_PROP||'. - cmake_prop = f'DT_PROP|{node.path}|{item}' - cmake_props.append(f'"{cmake_prop}" "{escape(cmake_value)}"') - - else: + # We currently do not support phandles for edt -> cmake conversion. + if "phandle" not in node.props[item].type: if "array" in node.props[item].type: # Convert array to CMake list cmake_value = ';'.join(str(val) for val in node.props[item].val) From e6bb88d5d7f9d7d92a94fe46a983b0dbba1a9d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:33 +0200 Subject: [PATCH 2831/3334] Revert "[nrf fromtree] scripts: dts: python-devicetree: Fix failing test with uppercase address" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 17a3e8bd3c6ff883e3a833437e6123013cd7d5d9. Signed-off-by: Andrzej Głąbek --- scripts/dts/python-devicetree/tests/test_edtlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dts/python-devicetree/tests/test_edtlib.py b/scripts/dts/python-devicetree/tests/test_edtlib.py index 34e7ac81483a..46c29a597a04 100644 --- a/scripts/dts/python-devicetree/tests/test_edtlib.py +++ b/scripts/dts/python-devicetree/tests/test_edtlib.py @@ -126,7 +126,7 @@ def test_interrupts(): edtlib.ControllerAndData(node=node, controller=controller_2, data={'one': 0, 'two': 0, 'three': 5}, name=None, basename=None) ] - node = edt.get_node("/interrupt-map-bitops-test/node@70000000e") + node = edt.get_node("/interrupt-map-bitops-test/node@70000000E") assert node.interrupts == [ edtlib.ControllerAndData(node=node, controller=edt.get_node('/interrupt-map-bitops-test/controller'), data={'one': 3, 'two': 2}, name=None, basename=None) ] From 8f863ef0d07b178d6d86982400cd44ddf8a15610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:33 +0200 Subject: [PATCH 2832/3334] Revert "[nrf fromtree] scripts: dts: gen_dts_cmake.py: Prevent trailing semicolon for lists" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 79657ce30f6f83df9a823af913bd65ded06a7f88. Signed-off-by: Andrzej Głąbek --- scripts/dts/gen_dts_cmake.py | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/scripts/dts/gen_dts_cmake.py b/scripts/dts/gen_dts_cmake.py index 2886e570335e..ef2c9a7f932f 100755 --- a/scripts/dts/gen_dts_cmake.py +++ b/scripts/dts/gen_dts_cmake.py @@ -124,7 +124,9 @@ def main(): if "phandle" not in node.props[item].type: if "array" in node.props[item].type: # Convert array to CMake list - cmake_value = ';'.join(str(val) for val in node.props[item].val) + cmake_value = '' + for val in node.props[item].val: + cmake_value = f'{cmake_value}{val};' else: cmake_value = node.props[item].val @@ -134,8 +136,9 @@ def main(): cmake_props.append(f'"{cmake_prop}" "{escape(cmake_value)}"') elif node.compats: # Manually output compatibles for nodes that have no properties - cmake_value = ';'.join(node.compats) - + cmake_value = '' + for val in node.compats: + cmake_value = f'{cmake_value}{val};' cmake_prop = f'DT_PROP|{node.path}|compatible' cmake_props.append(f'"{cmake_prop}" "{escape(cmake_value)}"') @@ -144,13 +147,19 @@ def main(): if node.regs is not None: cmake_props.append(f'"DT_REG|{node.path}|NUM" "{len(node.regs)}"') + cmake_addr = '' + cmake_size = '' + + for reg in node.regs: + if reg.addr is None: + cmake_addr = f'{cmake_addr}NONE;' + else: + cmake_addr = f'{cmake_addr}{hex(reg.addr)};' - cmake_addr = ';'.join( - 'NONE' if reg.addr is None else hex(reg.addr) for reg in node.regs - ) - cmake_size = ';'.join( - 'NONE' if reg.size is None else hex(reg.size) for reg in node.regs - ) + if reg.size is None: + cmake_size = f'{cmake_size}NONE;' + else: + cmake_size = f'{cmake_size}{hex(reg.size)};' cmake_props.append(f'"DT_REG|{node.path}|ADDR" "{cmake_addr}"') cmake_props.append(f'"DT_REG|{node.path}|SIZE" "{cmake_size}"') @@ -160,7 +169,12 @@ def main(): cmake_props.append(f'"DT_UNIT_ADDR|{node.path}" "{cmake_unit_addr_int}"') for comp in compatible2paths.keys(): - cmake_path = ';'.join(compatible2paths[comp]) + cmake_path = '' + for path in compatible2paths[comp]: + cmake_path = f'{cmake_path}{path};' + + # Remove the last ';' + cmake_path = cmake_path[:-1] cmake_comp = f'DT_COMP|{comp}' cmake_props.append(f'"{cmake_comp}" "{cmake_path}"') From ee2e36520074bb9baada7dd148275d9488361756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:33 +0200 Subject: [PATCH 2833/3334] Revert "[nrf fromlist] drivers: serial: nrfx_uarte: Fix wrong endif use" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e12eda89530dcefbe4edb57e278437067cfe6e83. Signed-off-by: Andrzej Głąbek --- drivers/serial/uart_nrfx_uarte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index a0ea6fe31818..540c456375ab 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -767,8 +767,8 @@ static void uarte_periph_enable(const struct device *dev) nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_COUNT); } } -#endif return; +#endif } #endif From 0c02a750e3deecde1da0f51dc45d9adf9dd98a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:34 +0200 Subject: [PATCH 2834/3334] Revert "[nrf fromlist] drivers: audio: dmic_nrfx: Add support for HFCLK24M clock" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 221e95232775b6dcca88aaa94c9397ac8d2173c4. Signed-off-by: Andrzej Głąbek --- drivers/audio/dmic_nrfx_pdm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/audio/dmic_nrfx_pdm.c b/drivers/audio/dmic_nrfx_pdm.c index dabb273a0d74..661f96e837bd 100644 --- a/drivers/audio/dmic_nrfx_pdm.c +++ b/drivers/audio/dmic_nrfx_pdm.c @@ -471,12 +471,11 @@ static void init_clock_manager(const struct device *dev) #elif CONFIG_CLOCK_CONTROL_NRF clock_control_subsys_t subsys; struct dmic_nrfx_pdm_drv_data *drv_data = dev->data; -#if NRF_CLOCK_HAS_HFCLKAUDIO || NRF_CLOCK_HAS_HFCLK24M +#if NRF_CLOCK_HAS_HFCLKAUDIO const struct dmic_nrfx_pdm_drv_cfg *drv_cfg = dev->config; if (drv_cfg->clk_src == ACLK) { - IF_ENABLED(NRF_CLOCK_HAS_HFCLKAUDIO, (subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO;)) - IF_ENABLED(NRF_CLOCK_HAS_HFCLK24M, (subsys = CLOCK_CONTROL_NRF_SUBSYS_HF24M;)) + subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO; } else #endif { From bbbd4a371bd62a2653b76d380053af9160e5d284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:34 +0200 Subject: [PATCH 2835/3334] Revert "[nrf fromlist] drivers: i2s: Add support for HFCLK24M clock" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5b3b2186201695219204ba05c621102605d2ea57. Signed-off-by: Andrzej Głąbek --- drivers/i2s/i2s_nrf_tdm.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/i2s/i2s_nrf_tdm.c b/drivers/i2s/i2s_nrf_tdm.c index 200a9c0b47c5..eb855dcc38d7 100644 --- a/drivers/i2s/i2s_nrf_tdm.c +++ b/drivers/i2s/i2s_nrf_tdm.c @@ -1134,7 +1134,14 @@ static void data_handler(const struct device *dev, const tdm_buffers_t *released static void clock_manager_init(const struct device *dev) { -#if DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL +#if CONFIG_CLOCK_CONTROL_NRF && NRF_CLOCK_HAS_HFCLKAUDIO + clock_control_subsys_t subsys; + struct tdm_drv_data *drv_data = dev->data; + + subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO; + drv_data->clk_mgr = z_nrf_clock_control_get_onoff(subsys); + __ASSERT_NO_MSG(drv_data->clk_mgr != NULL); +#elif DT_NODE_HAS_STATUS_OKAY(NODE_ACLK) && CONFIG_CLOCK_CONTROL_NRFS_AUDIOPLL struct tdm_drv_data *drv_data = dev->data; drv_data->audiopll = DEVICE_DT_GET(NODE_ACLK); @@ -1144,17 +1151,9 @@ static void clock_manager_init(const struct device *dev) drv_data->audiopll = DEVICE_DT_GET(NODE_AUDIO_AUXPLL); drv_data->aclk_spec.frequency = ACLK_FREQUENCY; -#elif CONFIG_CLOCK_CONTROL_NRF && (NRF_CLOCK_HAS_HFCLKAUDIO || NRF_CLOCK_HAS_HFCLK24M) - clock_control_subsys_t subsys; - struct tdm_drv_data *drv_data = dev->data; - - IF_ENABLED(NRF_CLOCK_HAS_HFCLKAUDIO, (subsys = CLOCK_CONTROL_NRF_SUBSYS_HFAUDIO;)) - IF_ENABLED(NRF_CLOCK_HAS_HFCLK24M, (subsys = CLOCK_CONTROL_NRF_SUBSYS_HF24M;)) - drv_data->clk_mgr = z_nrf_clock_control_get_onoff(subsys); - __ASSERT_NO_MSG(drv_data->clk_mgr != NULL); #else (void)dev; -#endif /* CONFIG_CLOCK_CONTROL_NRF && (NRF_CLOCK_HAS_HFCLKAUDIO || NRF_CLOCK_HAS_HFCLK24M) */ +#endif } static int data_init(const struct device *dev) From 68385df7a245192be2b98e37540793e46e648b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:34 +0200 Subject: [PATCH 2836/3334] Revert "[nrf fromtree] samples: boards: nordic: nrf_sys_event: Enable Twister on nrf54lm20dk" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 36a7087df6337304aa4f055403588126fd4711e0. Signed-off-by: Andrzej Głąbek --- samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py | 2 +- samples/boards/nordic/nrf_sys_event/sample.yaml | 1 - samples/boards/nordic/nrf_sys_event/src/main.c | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py b/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py index 4c8c760b3c65..01377f916f24 100644 --- a/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py +++ b/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py @@ -16,7 +16,7 @@ def test_rramc_wakeup(dut: DeviceAdapter): - sample.boards.nordic.nrf_sys_event.rramc_wakeup.ppi. Parse logs from serial port. If the Register Event API was used correctly, code execution shall be faster by ~14 us when event was registered. - If the API works correctly, RRAMC is woken up just before event occurs. + If the API works correctly, RRAMC is woken up just before event occures. Thus, there is no delay resulting from RRAMC getting ready. """ diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index 5b36f2517b31..b7025bb4731e 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -62,6 +62,5 @@ tests: - CONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y platform_allow: - nrf54l15dk/nrf54l15/cpuapp - - nrf54lm20dk/nrf54lm20a/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp diff --git a/samples/boards/nordic/nrf_sys_event/src/main.c b/samples/boards/nordic/nrf_sys_event/src/main.c index 8f2f6751806f..feb257f360b2 100644 --- a/samples/boards/nordic/nrf_sys_event/src/main.c +++ b/samples/boards/nordic/nrf_sys_event/src/main.c @@ -97,7 +97,9 @@ static void sys_event_irq_latency_run(enum rramc_mode mode) static void sys_event_irq_latency(void) { sys_event_irq_latency_run(RRAMC_DEFAULT); +#if !defined(CONFIG_SOC_NRF54LM20A) sys_event_irq_latency_run(RRAMC_POWER_MODE); +#endif sys_event_irq_latency_run(RRAMC_PPI_WAKEUP); } #endif /* CONFIG_NRF_SYS_EVENT_IRQ_LATENCY */ From dd92c56f878e6fa03a48ee9ce48fa614886b3bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:34 +0200 Subject: [PATCH 2837/3334] Revert "[nrf fromtree] samples: boards: nordic: nrf_sys_event: Remove unused overlays" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bfbd2e5bd1278bd7aa677d03003032dd0c220138. Signed-off-by: Andrzej Głąbek --- .../nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi | 8 ++++++++ .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 4 +--- .../boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi create mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi new file mode 100644 index 000000000000..d6edc1f6f91c --- /dev/null +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_common.dtsi @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +sample_counter: &timer20 { + status = "okay"; +}; diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index d6edc1f6f91c..6db12fbcb683 100644 --- a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -3,6 +3,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -sample_counter: &timer20 { - status = "okay"; -}; +#include "nrf54l15dk_nrf54l15_common.dtsi" diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay new file mode 100644 index 000000000000..6db12fbcb683 --- /dev/null +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54l15dk_nrf54l15_common.dtsi" From 1d96cc3204062e167cb3b5350c17be16879df119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:35 +0200 Subject: [PATCH 2838/3334] Revert "[nrf fromtree] CI: Update dts-linter dts-linter 0.3.9" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dccfa0547e91b1d8a1a0eeba112c371fd1a3af05. Signed-off-by: Andrzej Głąbek --- scripts/ci/package-lock.json | 16 ++++++++-------- scripts/ci/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/ci/package-lock.json b/scripts/ci/package-lock.json index 50efc7dcaaa1..21fe2fdb4147 100644 --- a/scripts/ci/package-lock.json +++ b/scripts/ci/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "dts-linter": "^0.3.9" + "dts-linter": "^0.3.7-hotfix2" } }, "node_modules/devicetree-language-server": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/devicetree-language-server/-/devicetree-language-server-0.7.3.tgz", - "integrity": "sha512-Gzv6hp4Kq7t+tujIq5hqjJW+yrd+1KMCJuNNP5SnKub4HaJZKnbALFhSI/wVbOaOYTAhDJLKyiKPC2M5YE+egQ==", + "version": "0.7.2-hotfix1", + "resolved": "https://registry.npmjs.org/devicetree-language-server/-/devicetree-language-server-0.7.2-hotfix1.tgz", + "integrity": "sha512-46UFopMrfO5sNEPZSqCmWfkwVRn370roIUt3W99KwLpF/4rEt2FOxFtp/uZ+T+h09HLx013L3h7jTKnMtTLU4g==", "license": "Apache-2.0", "bin": { "devicetree-language-server": "dist/server.js" @@ -21,12 +21,12 @@ } }, "node_modules/dts-linter": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/dts-linter/-/dts-linter-0.3.9.tgz", - "integrity": "sha512-J+JWuFmr1YUTqWxUjWtMHr7sGHX6Q9jDtFAE4a1ACvtlMP6CRA24F7WCSuUrQnP6hl3BAxJLmdoYIzT6UN9bxw==", + "version": "0.3.7-hotfix2", + "resolved": "https://registry.npmjs.org/dts-linter/-/dts-linter-0.3.7-hotfix2.tgz", + "integrity": "sha512-pFR/Zpwsh8djV9Gd9sO8mSvTwOpW3Y4DRKD+Y4Scka+KXVYQQB8Z1uGxNFMjMQVdg9plwYUSLLt9//QkN48ulw==", "license": "Apache-2.0", "dependencies": { - "devicetree-language-server": "^0.7.3" + "devicetree-language-server": "0.7.2-hotfix1" }, "bin": { "dts-linter": "dist/dts-linter.js" diff --git a/scripts/ci/package.json b/scripts/ci/package.json index 98b621977c7b..c3b12dcbd4e0 100644 --- a/scripts/ci/package.json +++ b/scripts/ci/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "dts-linter": "^0.3.9" + "dts-linter": "^0.3.7-hotfix2" } } From 9ccb7a5e8c634eacdb848dad4d89aad924ea9b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:35 +0200 Subject: [PATCH 2839/3334] Revert "[nrf fromtree] snippets: nordic-ppr: nordic-ppi-xip: Forward UART interrupt" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4d0e0ea5a77d1d692361b49c7beb199a84f54978. Signed-off-by: Andrzej Głąbek --- snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay | 1 - snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay | 1 - snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay | 1 - snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay | 1 - 4 files changed, 4 deletions(-) diff --git a/snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay index dabe6693d9fd..2d884a3455a2 100644 --- a/snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay +++ b/snippets/nordic/nordic-ppr-xip/soc/nrf54h20_cpuapp.overlay @@ -10,5 +10,4 @@ &uart135 { status = "reserved"; - interrupt-parent = <&cpuppr_clic>; }; diff --git a/snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay b/snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay index 077c3528b84e..4d02921660b5 100644 --- a/snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay +++ b/snippets/nordic/nordic-ppr-xip/soc/nrf9280_cpuapp.overlay @@ -14,5 +14,4 @@ &uart135 { status = "reserved"; - interrupt-parent = <&cpuppr_clic>; }; diff --git a/snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay b/snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay index f23767e8d1de..ae635c9ca9b6 100644 --- a/snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay +++ b/snippets/nordic/nordic-ppr/soc/nrf54h20_cpuapp.overlay @@ -5,5 +5,4 @@ &uart135 { status = "reserved"; - interrupt-parent = <&cpuppr_clic>; }; diff --git a/snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay b/snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay index 1ef2fb78cc32..75128f42a13f 100644 --- a/snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay +++ b/snippets/nordic/nordic-ppr/soc/nrf9280_cpuapp.overlay @@ -9,5 +9,4 @@ &uart135 { status = "reserved"; - interrupt-parent = <&cpuppr_clic>; }; From 6b0569f52f585c7a6aad3aff8f1cb66e2ae63842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:35 +0200 Subject: [PATCH 2840/3334] Revert "[nrf fromtree] drivers: serial: nrfx_uarte: Handle unexpected RXTO events" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d9ac6052ebb7da967dfdcf4db4fdb18378e87373. Signed-off-by: Andrzej Głąbek --- drivers/serial/uart_nrfx_uarte.c | 52 +++++--------------------------- 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 540c456375ab..7d245f9a5fa2 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -220,8 +220,6 @@ struct uarte_async_rx { #endif uint8_t idle_cnt; uint8_t flush_cnt; - /* Flag indicating that STOPRX is triggered and RXTO is expected. */ - bool stopped; volatile bool enabled; volatile bool discard_fifo; }; @@ -889,26 +887,6 @@ static void rx_disable_finalize(const struct device *dev) } } -/** @brief Trigger RX stop. - * - * Function triggers RX stop and sets the flag if it is expected that RXTO will be generated. - * - * @param dev Device. - * @param force If true then RXTO is expected, if false then it depends on presence of the next - * buffer. - */ -static ALWAYS_INLINE void trigger_stoprx(const struct device *dev, bool force) -{ - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - - /* RXTO is not expected after triggering STOPRX if there is ENDRX_STARTRX short. - * It is enabled if there is a second buffer. - */ - async_rx->stopped = force ? true : (async_rx->next_buf == NULL); - nrf_uarte_task_trigger(get_uarte_instance(dev), NRF_UARTE_TASK_STOPRX); -} - static int rx_disable(const struct device *dev, bool api) { struct uarte_nrfx_data *data = dev->data; @@ -946,7 +924,7 @@ static int rx_disable(const struct device *dev, bool api) async_rx->discard_fifo = true; } - trigger_stoprx(dev, true); + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); irq_unlock(key); return 0; @@ -1998,15 +1976,16 @@ static void tx_timeout(struct k_timer *timer) */ static void rx_idle_line_handle(const struct device *dev) { + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + if (!IS_CBWT_LEGACY(dev)) { - trigger_stoprx(dev, false); + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); return; } #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY const struct uarte_nrfx_config *cfg = dev->config; struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); uint32_t len; if (async_rx->is_in_irq == true) { @@ -2060,7 +2039,7 @@ static void rx_timeout(struct k_timer *timer) } } else { if (!rxdrdy) { - trigger_stoprx(dev, false); + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); k_timer_stop(timer); } } @@ -2210,7 +2189,6 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) if (!rxstarted && !rxto) { nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); - async_rx->stopped = false; if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND)) { data->flags |= UARTE_FLAG_FTIMEOUT_WATCH; start_timeout = true; @@ -2220,7 +2198,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { k_timer_stop(&async_rx->timer); } - trigger_stoprx(dev, true); + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); } irq_unlock(key); @@ -2452,22 +2430,10 @@ static void uarte_nrfx_isr_async(const void *arg) uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); bool rxto, endrx, rxstarted, rxdrdy, error; -#ifdef UARTE_HAS_FRAME_TIMEOUT - /* Frame timeout short may also trigger RX stopping. Detect that case to set - * the flag that RXTO is expected. - */ - if (!IS_CBWT(dev) && - event_check_clear(uarte, NRF_UARTE_EVENT_FRAME_TIMEOUT, - NRF_UARTE_INT_RXTO_MASK, imask) && (async_rx->next_buf == NULL)) { - async_rx->stopped = true; - } -#endif - /* Order of reading those events is important as it must be ensured that processing * order is maintained. */ - rxto = event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask) && - (async_rx->stopped == true); + rxto = event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask); endrx = event_check_clear(uarte, NRF_UARTE_EVENT_ENDRX, NRF_UARTE_INT_ENDRX_MASK, imask); rxdrdy = event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask); rxstarted = event_check_clear(uarte, NRF_UARTE_EVENT_RXSTARTED, @@ -2500,11 +2466,7 @@ static void uarte_nrfx_isr_async(const void *arg) endrx_isr(dev, false, false); } - /* If RXTO is set, check also if STOPRX was triggered as there are cases where RXTO - * is unexpectedly generated with ENDRX and such events shall be discarded. - */ if (rxto) { - async_rx->stopped = false; #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER if (IS_CBWT(dev)) { cbwt_rxto_isr(dev, true); From e2dfb923d651d56596dc4982683210f4929e5b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:36 +0200 Subject: [PATCH 2841/3334] Revert "[nrf fromtree] soc: nordic: nrf54l: Remove UART RXTO workaround Kconfig" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 237c555d919ddb07a81294cd082aba20506fc263. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp index a32729e5f40d..c6c083bd7e63 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp +++ b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54lm20a_enga_cpuapp @@ -9,4 +9,7 @@ if SOC_NRF54LM20A_ENGA_CPUAPP config NUM_IRQS default 290 +config UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND + default y + endif # SOC_NRF54LM20A_ENGA_CPUAPP From adb1485558eba8c9e900a033d4a47360ad2f4a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:36 +0200 Subject: [PATCH 2842/3334] Revert "[nrf fromtree] Revert "drivers: serial: nrfx_uarte: Workaround for spurious RXTO during restart"" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 434bc87bb1dba8d41782b68e3cbf6174d72caa63. Signed-off-by: Andrzej Głąbek --- drivers/serial/Kconfig.nrfx | 5 +++++ drivers/serial/uart_nrfx_uarte.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 9be3851b1f66..04b682c5bbd6 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -93,6 +93,11 @@ config UART_NRFX_UARTE_DIRECT_ISR bool "Use direct ISR" default y if !MULTITHREADING +config UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND + bool + help + Apply workaround for spurious RXTO during restart. + if HAS_HW_NRF_UART0 || HAS_HW_NRF_UARTE0 nrfx_uart_num = 0 rsource "Kconfig.nrfx_uart_instance" diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 7d245f9a5fa2..54db754e7287 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -291,6 +291,9 @@ struct uarte_nrfx_data { /* If enabled then UARTE peripheral is using memory which is cacheable. */ #define UARTE_CFG_FLAG_CACHEABLE BIT(2) +/* Indicates that workaround for spurious RXTO during restart shall be applied. */ +#define UARTE_CFG_FLAG_SPURIOUS_RXTO BIT(3) + /* Indicates that UARTE/TIMER interrupt priority differs from system clock (GRTC/RTC). */ #define UARTE_CFG_FLAG_VAR_IRQ BIT(4) @@ -2180,6 +2183,17 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) unsigned int key = irq_lock(); if (async_rx->buf) { + +#if CONFIG_UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND + /* Check for spurious RXTO event. */ + const struct uarte_nrfx_config *config = dev->config; + + if ((config->flags & UARTE_CFG_FLAG_SPURIOUS_RXTO) && + nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXTO)) { + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); + } +#endif + /* Remove the short until the subsequent next buffer is setup */ nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); @@ -3305,6 +3319,9 @@ static int uarte_instance_deinit(const struct device *dev) (!IS_ENABLED(CONFIG_HAS_NORDIC_DMM) ? 0 : \ (UARTE_IS_CACHEABLE(idx) ? \ UARTE_CFG_FLAG_CACHEABLE : 0)) | \ + (IS_ENABLED(CONFIG_UART_NRFX_UARTE_SPURIOUS_RXTO_WORKAROUND) && \ + INSTANCE_IS_HIGH_SPEED(_, /*empty*/, idx, _) ? \ + UARTE_CFG_FLAG_SPURIOUS_RXTO : 0) | \ ((IS_ENABLED(UARTE_BAUDRATE_RETENTION_WORKAROUND) && \ UARTE_IS_CACHEABLE(idx)) ? \ UARTE_CFG_FLAG_VOLATILE_BAUDRATE : 0) | \ From c32d36d560d7b56ac079a8011af77277eb224ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:36 +0200 Subject: [PATCH 2843/3334] Revert "[nrf fromtree] drivers: serial: nrfx_uarte: Fix compilation with deprecated option" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 34a4121290f1f2ec0e879b6ba46e3a5cfc9ad7dc. Signed-off-by: Andrzej Głąbek --- drivers/serial/uart_nrfx_uarte.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 54db754e7287..f106ec26129a 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -3296,6 +3296,9 @@ static int uarte_instance_deinit(const struct device *dev) (.uart_config = UARTE_CONFIG(idx),)) \ IF_ENABLED(CONFIG_UART_##idx##_ASYNC, \ (.async = &uarte##idx##_async,)) \ + IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ + (.timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET( \ + CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER)),)) \ IF_ENABLED(CONFIG_UART_##idx##_INTERRUPT_DRIVEN, \ (.int_driven = &uarte##idx##_int_driven,)) \ }; \ From 0e1392a3bcba1259b71b82657eb54ef2e3e090ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:37 +0200 Subject: [PATCH 2844/3334] Revert "[nrf fromtree] tests: drivers: uart: async_api: Remove baudrate limit from nRF targets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f229c5ac430a68879851a9491eb41b39c38aed1a. Signed-off-by: Andrzej Głąbek --- .../drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf | 1 + .../uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf | 1 + .../uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf | 1 + .../uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 1 + .../uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 + .../uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf | 1 + .../uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf | 1 + .../uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 + .../uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf | 1 + .../uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 1 + .../uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 1 + .../uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf | 1 + .../uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf | 1 + .../uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 1 + .../uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf | 1 + tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf | 1 + .../drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf | 1 + 17 files changed, 17 insertions(+) create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf diff --git a/tests/drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf b/tests/drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..b83fb4eb08ad --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY=n diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 74cc8d7691e1..47f481017118 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -1,2 +1,3 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf index 74cc8d7691e1..47f481017118 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr.conf @@ -1,2 +1,3 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf index 74cc8d7691e1..47f481017118 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpuppr_xip.conf @@ -1,2 +1,3 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf index 0eebd15e8a92..b80531ff3f2e 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -1 +1,2 @@ CONFIG_TEST_LONG_BUFFER_SIZE=128 +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l05_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54l15dk_nrf54l15_cpuflpr.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf new file mode 100644 index 000000000000..d70069646c93 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf54lm20dk_nrf54lm20a_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf index b695c18ab28d..83e126780f99 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf @@ -1 +1,2 @@ CONFIG_ARM_MPU=n +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf index b695c18ab28d..83e126780f99 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf @@ -1 +1,2 @@ CONFIG_ARM_MPU=n +CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 From e87ac1a9badbf0cd0f10fe37a68b03e60d0288c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:37 +0200 Subject: [PATCH 2845/3334] Revert "[nrf fromtree] tests: drivers: uart: Aligning Nordic configurations" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ca289f7c146c9e72f8be42a77c1026a3aeaea82e. Signed-off-by: Andrzej Głąbek --- .../boards/nrf5340bsim_nrf5340_cpuapp.conf | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 2 ++ .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 10 +--------- .../boards/nrf5340dk_nrf5340_cpuapp_ns.conf | 2 ++ .../uart/uart_async_api/boards/nrf9160dk_nrf9160.conf | 2 ++ .../uart_async_api/boards/nrf9160dk_nrf9160_ns.conf | 2 ++ .../uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf | 2 ++ .../uart_async_dual/boards/nrf9160dk_nrf9160.overlay | 5 ----- tests/drivers/uart/uart_async_dual/testcase.yaml | 1 - .../uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf | 2 ++ tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml | 3 +++ tests/drivers/uart/uart_pm/testcase.yaml | 6 ++++++ 12 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf create mode 100644 tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf index b83fb4eb08ad..3a15540b2dd5 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -1 +1 @@ -CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY=n +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf index d70069646c93..396d23ba5ae3 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1 +1,3 @@ +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.overlay index fd0a98896269..81ae813daf3c 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -1,8 +1,4 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ &pinctrl { uart1_default_alt: uart1_default_alt { @@ -21,10 +17,6 @@ }; }; -&timer1 { - status = "reserved"; -}; - dut: &uart1 { compatible = "nordic,nrf-uarte"; current-speed = <115200>; diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf index d70069646c93..396d23ba5ae3 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -1 +1,3 @@ +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf index 83e126780f99..4f738f955e10 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf @@ -1,2 +1,4 @@ CONFIG_ARM_MPU=n CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf index 83e126780f99..4f738f955e10 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160_ns.conf @@ -1,2 +1,4 @@ CONFIG_ARM_MPU=n CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf new file mode 100644 index 000000000000..025b92361475 --- /dev/null +++ b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf @@ -0,0 +1,2 @@ +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay index d34b8fde6240..2a501b4ee1a1 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay @@ -46,17 +46,12 @@ }; }; -&timer1 { - status = "reserved"; -}; - dut: &uart1 { status = "okay"; current-speed = <115200>; pinctrl-0 = <&uart1_default>; pinctrl-1 = <&uart1_sleep>; pinctrl-names = "default", "sleep"; - timer = <&timer1>; hw-flow-control; }; diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index 34bd20103ef8..3d1c43ed621f 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -89,5 +89,4 @@ tests: extra_configs: - CONFIG_TEST_CHOPPED_TX=n - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER=n - - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY=n - CONFIG_UART_1_NRF_HW_ASYNC=n diff --git a/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..025b92361475 --- /dev/null +++ b/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index 3769ea9f1de9..3fc19af2bd64 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -76,6 +76,9 @@ tests: - CONFIG_UART_0_INTERRUPT_DRIVEN=n - CONFIG_UART_0_ASYNC=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y + - CONFIG_UART_0_NRF_HW_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 + - CONFIG_NRFX_TIMER=y platform_allow: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 4dec1c51ea01..38da5dca4800 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -76,6 +76,9 @@ tests: - CONFIG_UART_INTERRUPT_DRIVEN=n - CONFIG_UART_ASYNC_API=y - CONFIG_UART_0_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 + - CONFIG_NRFX_TIMER=y - CONFIG_UART_0_ENHANCED_POLL_OUT=n drivers.uart.pm.async.enhanced_poll: @@ -83,6 +86,9 @@ tests: - CONFIG_UART_INTERRUPT_DRIVEN=n - CONFIG_UART_ASYNC_API=y - CONFIG_UART_0_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC=y + - CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 + - CONFIG_NRFX_TIMER=y - CONFIG_UART_0_ENHANCED_POLL_OUT=y platform_exclude: - nrf54h20dk/nrf54h20/cpuapp From 58f2e23c4ff47bc165e6800d664c1e6ef938c03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:38 +0200 Subject: [PATCH 2846/3334] Revert "[nrf fromtree] drivers: serial: nrfx_uarte: Refactor byte counting with TIMER" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cb6cf32d75ae2c6a7c5a26bca272df118c3268b9. Signed-off-by: Andrzej Głąbek --- drivers/serial/Kconfig.nrfx | 11 +- drivers/serial/Kconfig.nrfx_uart_instance | 41 +--- drivers/serial/uart_nrfx_uarte.c | 274 +++++++++++----------- 3 files changed, 153 insertions(+), 173 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 04b682c5bbd6..53fa3ab54de6 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -36,6 +36,9 @@ config UART_NRFX_UARTE_NO_IRQ config UART_NRFX_UARTE_ENHANCED_RX bool "Enhanced RX handling" + depends on UART_ASYNC_API + depends on !(UART_0_NRF_HW_ASYNC || UART_1_NRF_HW_ASYNC || UART_2_NRF_HW_ASYNC) + default y select DEPRECATED help Option is deprecated as it is used as default unless TIMER peripheral is used @@ -59,17 +62,9 @@ config UART_ASYNC_TX_CACHE_SIZE config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER bool "Use TIMER to count RX bytes" depends on UART_ASYNC_API - depends on $(dt_compat_any_has_prop,$(DT_COMPAT_NORDIC_NRF_UARTE),frame-timeout-supported) depends on !ARCH_POSIX # Mode not supported on BSIM target select NRFX_GPPI -config UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY - bool "Use TIMER to count RX bytes on legacy platforms" - depends on UART_ASYNC_API - select NRFX_GPPI - help - Method used on nRF52x, nRF53x and nRF91x series. - config UART_NRFX_UARTE_BOUNCE_BUF_LEN int "RX bounce buffer size" depends on UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index 023ba4557e70..bcc60a0e0482 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -17,35 +17,12 @@ config UART_$(nrfx_uart_num)_ASYNC help This option enables UART Asynchronous API support on port $(nrfx_uart_num). -config UART_$(nrfx_uart_num)_NRF_USE_TIMER +config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER bool - depends on UART_ASYNC_API depends on $(dt_nodelabel_has_prop,uart$(nrfx_uart_num),timer) depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) default y - help - Indicates that TIMER peripheral for RX byte counting is assigned to that instance - in the Device Tree. - -config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER - bool - depends on UART_$(nrfx_uart_num)_NRF_USE_TIMER - depends on $(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),frame-timeout-supported) - default y imply UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - help - Indicates that TIMER peripheral for RX byte counting is assigned to that instance - in the Device Tree. UARTE revision used in the newer targets like nRF54x Series. - -config UART_$(nrfx_uart_num)_COUNT_BYTES_WITH_TIMER_LEGACY - bool - depends on UART_$(nrfx_uart_num)_NRF_USE_TIMER || UART_$(nrfx_uart_num)_NRF_HW_ASYNC - depends on !$(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),frame-timeout-supported) - default y - imply UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY - help - Indicates that TIMER peripheral for RX byte counting is assigned to that instance - in the Device Tree. UARTE revision used in the legacy targets (nRF52x, nRF53x and nRF91x). config UART_$(nrfx_uart_num)_ENHANCED_POLL_OUT bool "Efficient poll out on port $(nrfx_uart_num)" @@ -75,13 +52,15 @@ config UART_$(nrfx_uart_num)_NRF_TX_BUFFER_SIZE config UART_$(nrfx_uart_num)_NRF_HW_ASYNC bool "Use hardware RX byte counting" - depends on UART_ASYNC_API depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) - depends on !($(dt_nodelabel_bool_prop,uart$(nrfx_uart_num),frame-timeout-supported)) - select DEPRECATED + depends on UART_ASYNC_API + depends on HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC + select NRFX_GPPI help - Option is deprecated. Use Device Tree "timer" property to assign a TIMER peripheral - for reliable reception without HWFC. + If default driver uses interrupts to count incoming bytes, it is possible + that with higher speeds and/or high cpu load some data can be lost. + It is recommended to use hardware byte counting in such scenarios. + Hardware RX byte counting requires timer instance and one PPI channel. config UART_$(nrfx_uart_num)_NRF_ASYNC_LOW_POWER bool "Low power mode" @@ -98,8 +77,4 @@ config UART_$(nrfx_uart_num)_NRF_ASYNC_LOW_POWER config UART_$(nrfx_uart_num)_NRF_HW_ASYNC_TIMER int "Timer instance" - depends on !UART_$(nrfx_uart_num)_NRF_USE_TIMER depends on UART_$(nrfx_uart_num)_NRF_HW_ASYNC - help - Option is deprecated. Use Device Tree "timer" property to assign a TIMER peripheral - for reliable reception without HWFC. diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index f106ec26129a..38d70b1dd663 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -26,12 +26,6 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); -#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX) -#define MAYBE_CONST -#else -#define MAYBE_CONST const -#endif - #define RX_FLUSH_WORKAROUND 1 #define UARTE(idx) DT_NODELABEL(uart##idx) @@ -71,12 +65,11 @@ LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL); #define UARTE_ANY_ASYNC 1 #endif -/* Set a flag that is used for code that is shared between bytes counting methods - * on legacy and new platforms. - */ -#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) || \ - defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) -#define COUNT_BYTES_WITH_TIMER_COMMON 1 +/* Determine if any instance is using asynchronous API with HW byte counting. */ +#define IS_HW_ASYNC(unused, prefix, i, _) IS_ENABLED(CONFIG_UART_##prefix##i##_NRF_HW_ASYNC) + +#if UARTE_FOR_EACH_INSTANCE(IS_HW_ASYNC, (||), (0)) +#define UARTE_ANY_HW_ASYNC 1 #endif /* Determine if any instance is using enhanced poll_out feature. */ @@ -194,7 +187,9 @@ struct uarte_async_rx_cbwt { uint8_t *anomaly_byte_dst; uint8_t anomaly_byte; #endif + nrfx_gppi_handle_t ppi_h; uint8_t bounce_idx; + bool in_irq; bool discard_fifo; }; @@ -210,14 +205,12 @@ struct uarte_async_rx { uint8_t *next_buf; size_t next_buf_len; k_timeout_t timeout; -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY +#ifdef UARTE_ANY_HW_ASYNC uint32_t total_user_byte_cnt; /* Total number of bytes passed to user */ -#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY */ -#ifdef COUNT_BYTES_WITH_TIMER_COMMON - nrfx_gppi_handle_t ppi_h; + nrfx_gppi_handle_t ppi; /* Flag to ensure that RX timeout won't be executed during ENDRX ISR */ volatile bool is_in_irq; -#endif +#endif /* UARTE_ANY_HW_ASYNC */ uint8_t idle_cnt; uint8_t flush_cnt; volatile bool enabled; @@ -260,6 +253,7 @@ struct uarte_nrfx_data { #endif #ifdef UARTE_ANY_ASYNC struct uarte_async_cb *async; + nrfx_timer_t timer; #endif atomic_val_t poll_out_lock; atomic_t flags; @@ -283,13 +277,16 @@ struct uarte_nrfx_data { /* If enabled then ENDTX is PPI'ed to TXSTOP */ #define UARTE_CFG_FLAG_PPI_ENDTX BIT(0) +/* If enabled then TIMER and PPI is used for byte counting. */ +#define UARTE_CFG_FLAG_HW_BYTE_COUNTING BIT(1) + /* If enabled then UARTE peripheral is disabled when not used. This allows * to achieve lowest power consumption in idle. */ -#define UARTE_CFG_FLAG_LOW_POWER BIT(1) +#define UARTE_CFG_FLAG_LOW_POWER BIT(2) /* If enabled then UARTE peripheral is using memory which is cacheable. */ -#define UARTE_CFG_FLAG_CACHEABLE BIT(2) +#define UARTE_CFG_FLAG_CACHEABLE BIT(3) /* Indicates that workaround for spurious RXTO during restart shall be applied. */ #define UARTE_CFG_FLAG_SPURIOUS_RXTO BIT(3) @@ -372,12 +369,10 @@ struct uarte_nrfx_config { #endif /* CONFIG_UART_USE_RUNTIME_CONFIGURE */ #ifdef UARTE_ANY_ASYNC -#ifdef COUNT_BYTES_WITH_TIMER_COMMON - NRF_TIMER_Type * timer_regs; - IRQn_Type uarte_irqn; -#endif #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + NRF_TIMER_Type * timer_regs; IRQn_Type timer_irqn; + IRQn_Type uarte_irqn; uint8_t *bounce_buf[2]; size_t bounce_buf_len; size_t bounce_buf_swap_len; @@ -385,21 +380,22 @@ struct uarte_nrfx_config { #endif uint8_t *tx_cache; uint8_t *rx_flush_buf; -#endif /* UARTE_ANY_ASYNC */ +#endif uint8_t *poll_out_byte; uint8_t *poll_in_byte; }; -/* Determine if instance is using an approach with counting bytes with TIMER (legacy). */ -#define IS_CBWT_LEGACY(dev) \ - COND_CODE_1(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY, \ - ((((const struct uarte_nrfx_config *)dev->config)->timer_regs != NULL)),\ - (false)) +/* Using Macro instead of static inline function to handle NO_OPTIMIZATIONS case + * where static inline fails on linking. + */ +#define HW_RX_COUNTING_ENABLED(config) \ + (IS_ENABLED(UARTE_ANY_HW_ASYNC) ? \ + (config->flags & UARTE_CFG_FLAG_HW_BYTE_COUNTING) : false) /* Determine if instance is using an approach with counting bytes with TIMER (cbwt). */ #define IS_CBWT(dev) \ COND_CODE_1(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ - ((((const struct uarte_nrfx_config *)dev->config)->timer_regs != NULL)),\ + ((((const struct uarte_nrfx_config *)dev->config)->cbwt_data != NULL)), \ (false)) static inline NRF_UARTE_Type *get_uarte_instance(const struct device *dev) @@ -448,14 +444,9 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) return; } -#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) - if (data->async && IS_CBWT_LEGACY(dev)) { -#if NRF_TIMER_HAS_SHUTDOWN - nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_SHUTDOWN); -#else - nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_STOP); - nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_CLEAR); -#endif +#if defined(UARTE_ANY_HW_ASYNC) + if (data->async && HW_RX_COUNTING_ENABLED(config)) { + nrfx_timer_disable(&data->timer); /* Timer/counter value is reset when disabled. */ data->async->rx.total_user_byte_cnt = 0; } @@ -761,15 +752,16 @@ static void uarte_periph_enable(const struct device *dev) #ifdef UARTE_ANY_ASYNC if (data->async) { -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY - if (IS_CBWT_LEGACY(dev)) { - nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_START); + if (HW_RX_COUNTING_ENABLED(config)) { + nrfx_timer_t *timer = &data->timer; + + nrfx_timer_enable(timer); + for (int i = 0; i < data->async->rx.flush_cnt; i++) { - nrf_timer_task_trigger(config->timer_regs, NRF_TIMER_TASK_COUNT); + nrfx_timer_increment(timer); } } return; -#endif } #endif @@ -945,6 +937,45 @@ static int uarte_nrfx_rx_disable(const struct device *dev) return rx_disable(dev, true); } +#if defined(UARTE_ANY_HW_ASYNC) +static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } + +static int uarte_nrfx_rx_counting_init(const struct device *dev) +{ + struct uarte_nrfx_data *data = dev->data; + const struct uarte_nrfx_config *cfg = dev->config; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + int ret; + nrfx_timer_config_t tmr_config = NRFX_TIMER_DEFAULT_CONFIG( + NRF_TIMER_BASE_FREQUENCY_GET(data->timer.p_reg)); + uint32_t evt_addr = nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_RXDRDY); + uint32_t tsk_addr = nrfx_timer_task_address_get(&data->timer, NRF_TIMER_TASK_COUNT); + + tmr_config.mode = NRF_TIMER_MODE_COUNTER; + tmr_config.bit_width = NRF_TIMER_BIT_WIDTH_32; + ret = nrfx_timer_init(&data->timer, + &tmr_config, + timer_handler); + if (ret != 0) { + LOG_ERR("Timer already initialized"); + return -EINVAL; + } + + nrfx_timer_clear(&cfg->timer); + + ret = nrfx_gppi_conn_alloc(evt_addr, tsk_addr, &data->async->rx.cnt.ppi); + if (ret < 0) { + LOG_ERR("Failed to allocate PPI Channel"); + nrfx_timer_uninit(&data->timer); + return ret; + } + + nrfx_gppi_conn_enable(data->async->rx.cnt.ppi); + + return 0; +} +#endif /* !defined(UARTE_ANY_HW_ASYNC) */ + #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER static uint32_t get_byte_cnt(NRF_TIMER_Type *timer) @@ -1336,6 +1367,7 @@ static void cbwt_rx_timeout(struct k_timer *timer) const struct device *dev = k_timer_user_data_get(timer); const struct uarte_nrfx_config *cfg = dev->config; struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; struct uarte_async_rx *async_rx = &data->async->rx; if (nrf_uarte_event_check(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY)) { @@ -1345,7 +1377,7 @@ static void cbwt_rx_timeout(struct k_timer *timer) async_rx->idle_cnt++; if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { - if (async_rx->is_in_irq) { + if (cbwt_data->in_irq) { /* TIMER or UARTE interrupt preempted. Lets try again * later. */ @@ -1462,13 +1494,13 @@ static void timer_isr(const void *arg) const struct device *dev = arg; const struct uarte_nrfx_config *cfg = dev->config; struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; + struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; static const uint32_t flags_to_check = UARTE_FLAG_RX_BUF_REQ | UARTE_FLAG_TRIG_RXTO | UARTE_FLAG_LATE_CC; uint32_t flags = atomic_and(&data->flags, ~flags_to_check); - async_rx->is_in_irq = true; + cbwt_data->in_irq = true; if (timer_ch_evt_check_clear(cfg->timer_regs, UARTE_TIMER_USR_CNT_CH) || (flags & UARTE_FLAG_LATE_CC)) { @@ -1488,7 +1520,7 @@ static void timer_isr(const void *arg) cbwt_rxto_isr(dev, false); } - async_rx->is_in_irq = false; + cbwt_data->in_irq = false; } static void cbwt_rx_enable(const struct device *dev, bool with_timeout) @@ -1555,29 +1587,13 @@ static void cbwt_rx_enable(const struct device *dev, bool with_timeout) static int cbwt_uarte_async_init(const struct device *dev) { + /* As this approach does not use nrfx_timer driver but only HAL special setup + * function is used. + */ const struct uarte_nrfx_config *cfg = dev->config; struct uarte_async_rx_cbwt *cbwt_data = cfg->cbwt_data; static const uint32_t rx_int_mask = NRF_UARTE_INT_ERROR_MASK | NRF_UARTE_INT_RXTO_MASK; - -#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE - cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; -#endif - - /* Enable EasyDMA LIST feature (it is exposed in SPIM but not in UARTE). */ - *(volatile uint32_t *)((uint32_t)cfg->uarte_regs + 0x714) = 1; - nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); - - return 0; -} -#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER */ - -#ifdef COUNT_BYTES_WITH_TIMER_COMMON -static int count_byte_with_timer_common_init(const struct device *dev) -{ - const struct uarte_nrfx_config *cfg = dev->config; - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; uint32_t evt = nrf_uarte_event_address_get(cfg->uarte_regs, NRF_UARTE_EVENT_RXDRDY); uint32_t tsk = nrf_timer_task_address_get(cfg->timer_regs, NRF_TIMER_TASK_COUNT); int ret; @@ -1585,15 +1601,24 @@ static int count_byte_with_timer_common_init(const struct device *dev) nrf_timer_mode_set(cfg->timer_regs, NRF_TIMER_MODE_COUNTER); nrf_timer_bit_width_set(cfg->timer_regs, NRF_TIMER_BIT_WIDTH_32); - ret = nrfx_gppi_conn_alloc(evt, tsk, &async_rx->ppi_h); + ret = nrfx_gppi_conn_alloc(evt, tsk, &cbwt_data->ppi_h); if (ret < 0) { return ret; } - nrfx_gppi_conn_enable(async_rx->ppi_h); + nrfx_gppi_conn_enable(cbwt_data->ppi_h); + +#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE + cbwt_data->bounce_buf_swap_len = cfg->bounce_buf_swap_len; +#endif + + /* Enable EasyDMA LIST feature (it is exposed in SPIM but not in UARTE). */ + *(volatile uint32_t *)((uint32_t)cfg->uarte_regs + 0x714) = 1; + nrf_uarte_int_enable(cfg->uarte_regs, rx_int_mask); + return 0; } -#endif +#endif /* CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER */ static int uarte_async_init(const struct device *dev) { @@ -1604,21 +1629,24 @@ static int uarte_async_init(const struct device *dev) k_timer_init(&data->async->tx.timer, tx_timeout, NULL); k_timer_user_data_set(&data->async->tx.timer, (void *)dev); -#ifdef COUNT_BYTES_WITH_TIMER_COMMON - if (IS_CBWT(dev) || IS_CBWT_LEGACY(dev)) { - int ret = count_byte_with_timer_common_init(dev); +#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER + if (IS_CBWT(dev)) { + return cbwt_uarte_async_init(dev); + } +#endif - if (ret < 0) { +#if defined(UARTE_ANY_HW_ASYNC) + const struct uarte_nrfx_config *cfg = dev->config; + int ret; + + if (HW_RX_COUNTING_ENABLED(cfg)) { + ret = uarte_nrfx_rx_counting_init(dev); + if (ret != 0) { return ret; } } #endif -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - return cbwt_uarte_async_init(dev); - } -#endif return 0; } @@ -1973,38 +2001,32 @@ static void tx_timeout(struct k_timer *timer) (void) uarte_nrfx_tx_abort(dev); } -#ifndef UARTE_HAS_FRAME_TIMEOUT /** Function is called when idle state is detected on the line. Notify user * all pending data. */ -static void rx_idle_line_handle(const struct device *dev) +#ifndef UARTE_HAS_FRAME_TIMEOUT +static void hw_count_rx_timeout(const struct device *dev) { - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - - if (!IS_CBWT_LEGACY(dev)) { - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - return; - } -#ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY - const struct uarte_nrfx_config *cfg = dev->config; +#ifdef UARTE_ANY_HW_ASYNC struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; + const struct uarte_nrfx_config *cfg = dev->config; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); uint32_t len; if (async_rx->is_in_irq == true) { return; } - irq_disable(cfg->uarte_irqn); + irq_disable(nrfx_get_irq_number(uarte)); - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_CAPTURE0); - len = nrf_timer_cc_get(cfg->timer_regs, 0) - async_rx->total_user_byte_cnt; + len = nrfx_timer_capture(&cfg->timer, 0) - async_rx->total_user_byte_cnt; if ((len > 0) && ((len + async_rx->offset) < async_rx->buf_len)) { notify_uart_rx_rdy(dev, len); async_rx->offset += len; async_rx->total_user_byte_cnt += len; } nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); - irq_enable(cfg->uarte_irqn); + irq_enable(nrfx_get_irq_number(uarte)); #endif } #endif @@ -2051,6 +2073,7 @@ static void rx_timeout(struct k_timer *timer) #else /* UARTE_HAS_FRAME_TIMEOUT */ struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; + const struct uarte_nrfx_config *cfg = dev->config; if (nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY)) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); @@ -2067,7 +2090,11 @@ static void rx_timeout(struct k_timer *timer) */ if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { k_timer_stop(timer); - rx_idle_line_handle(dev); + if (HW_RX_COUNTING_ENABLED(cfg)) { + hw_count_rx_timeout(dev); + } else { + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); + } return; } } @@ -2104,12 +2131,13 @@ static void rxstarted_isr(const struct device *dev) .type = UART_RX_BUF_REQUEST, }; -#if !defined(UARTE_HAS_FRAME_TIMEOUT) +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && !defined(UARTE_HAS_FRAME_TIMEOUT) struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { - nrf_uarte_int_enable(get_uarte_instance(dev), NRF_UARTE_INT_RXDRDY_MASK); + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); } #endif user_callback(dev, &evt); @@ -2121,7 +2149,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); -#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) +#if defined(UARTE_ANY_HW_ASYNC) async_rx->is_in_irq = true; #endif @@ -2154,7 +2182,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) rx_len = 0; } -#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) +#if defined(UARTE_ANY_HW_ASYNC) async_rx->total_user_byte_cnt += rx_len; #endif @@ -2223,7 +2251,7 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) #endif } -#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) +#if defined(UARTE_ANY_HW_ASYNC) async_rx->is_in_irq = false; #endif } @@ -2303,8 +2331,8 @@ static void rxto_isr(const struct device *dev) */ if (async_rx->discard_fifo) { async_rx->discard_fifo = false; -#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) - if (IS_CBWT_LEGACY(dev)) { +#if defined(UARTE_ANY_HW_ASYNC) + if (HW_RX_COUNTING_ENABLED(config)) { /* It need to be included because TIMER+PPI got RXDRDY events * and counted those flushed bytes. */ @@ -2955,14 +2983,9 @@ static void uarte_pm_suspend(const struct device *dev) wait_for_tx_stopped(dev); } -#if defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER_LEGACY) - if (data->async && IS_CBWT_LEGACY(dev)) { -#if NRF_TIMER_HAS_SHUTDOWN - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_SHUTDOWN); -#else - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_STOP); - nrf_timer_task_trigger(cfg->timer_regs, NRF_TIMER_TASK_CLEAR); -#endif +#if defined(UARTE_ANY_HW_ASYNC) + if (data->async && HW_RX_COUNTING_ENABLED(cfg)) { + nrfx_timer_disable(&data->timer); /* Timer/counter value is reset when disabled. */ data->async->rx.total_user_byte_cnt = 0; } @@ -3067,16 +3090,10 @@ static int uarte_instance_init(const struct device *dev, int err; const struct uarte_nrfx_config *cfg = dev->config; -#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX) - /* For simulation the DT provided peripheral address needs to be corrected */ - ((struct pinctrl_dev_config *)cfg->pcfg)->reg = (uintptr_t)cfg->uarte_regs; -#if defined(COUNT_BYTES_WITH_TIMER_COMMON) - if (cfg->timer_regs != NULL) { - ((struct uarte_nrfx_config *)dev->config)->timer_regs = - nhw_convert_periph_base_addr(cfg->timer_regs); + if (IS_ENABLED(CONFIG_ARCH_POSIX)) { + /* For simulation the DT provided peripheral address needs to be corrected */ + ((struct pinctrl_dev_config *)cfg->pcfg)->reg = (uintptr_t)cfg->uarte_regs; } -#endif -#endif /* Apply sleep state by default. * If PM is disabled, the default state will be applied in pm_device_driver_init. @@ -3127,18 +3144,11 @@ static int uarte_instance_deinit(const struct device *dev) #define UARTE_TIMER_IRQ_PRIO(idx) DT_IRQ(DT_PHANDLE(UARTE(idx), timer), priority) -#define UARTE_COUNT_BYTES_WITH_TIMER_COMMON_CONFIG(idx) \ - .timer_regs = COND_CODE_1(UARTE_HAS_PROP(idx, timer), \ - (UARTE_TIMER_REG(idx)), \ - (COND_CODE_1(CONFIG_UART_##idx##_NRF_HW_ASYNC, \ - (NRFX_CONCAT(NRF_TIMER, CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER)), \ - (NULL)))), \ - .uarte_irqn = DT_IRQN(UARTE(idx)), - - #define UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx) \ IF_ENABLED(UARTE_HAS_PROP(idx, timer), \ - (.timer_irqn = UARTE_TIMER_IRQN(idx), \ + (.timer_regs = UARTE_TIMER_REG(idx), \ + .timer_irqn = UARTE_TIMER_IRQN(idx), \ + .uarte_irqn = DT_IRQN(UARTE(idx)), \ .bounce_buf = { \ uart##idx##_bounce_buf, \ &uart##idx##_bounce_buf[sizeof(uart##idx##_bounce_buf) / 2] \ @@ -3305,9 +3315,9 @@ static int uarte_instance_deinit(const struct device *dev) COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, (), \ (BUILD_ASSERT(UARTE_GET_BAUDRATE(idx) > 0, \ "Unsupported baudrate");)) \ - static MAYBE_CONST struct uarte_nrfx_config uarte_##idx##z_config = { \ + static const struct uarte_nrfx_config uarte_##idx##z_config = { \ COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, \ - (.clock_freq = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),), \ + (.clock_freq = NRF_PERIPH_GET_FREQUENCY(UARTE(idx)),), \ (IF_ENABLED(UARTE_HAS_FRAME_TIMEOUT, \ (.baudrate = UARTE_PROP(idx, current_speed),)) \ .nrf_baudrate = UARTE_GET_BAUDRATE(idx), \ @@ -3319,6 +3329,8 @@ static int uarte_instance_deinit(const struct device *dev) .flags = \ (IS_ENABLED(CONFIG_UART_##idx##_ENHANCED_POLL_OUT) ? \ UARTE_CFG_FLAG_PPI_ENDTX : 0) | \ + (IS_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC) ? \ + UARTE_CFG_FLAG_HW_BYTE_COUNTING : 0) | \ (!IS_ENABLED(CONFIG_HAS_NORDIC_DMM) ? 0 : \ (UARTE_IS_CACHEABLE(idx) ? \ UARTE_CFG_FLAG_CACHEABLE : 0)) | \ @@ -3338,8 +3350,6 @@ static int uarte_instance_deinit(const struct device *dev) .rx_flush_buf = uarte##idx##_flush_buf,)) \ IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER, \ (UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx))) \ - IF_ENABLED(COUNT_BYTES_WITH_TIMER_COMMON, \ - (UARTE_COUNT_BYTES_WITH_TIMER_COMMON_CONFIG(idx))) \ }; \ UARTE_DIRECT_ISR_DECLARE(idx) \ static int uarte_##idx##_init(const struct device *dev) \ From a6ade95e40bed0993aae108a720189806ce7bc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:38 +0200 Subject: [PATCH 2847/3334] Revert "[nrf fromtree] samples: modem: Update configuration for nrf9160dk" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 78cb11f218dba86460eeae6936e578e2756eb92f. Signed-off-by: Andrzej Głąbek --- .../modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/drivers/modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf b/samples/drivers/modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf index 65fd5d703342..9e033b1590f9 100644 --- a/samples/drivers/modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/drivers/modem/hello_hl78xx/boards/nrf9160dk_nrf9160_ns.conf @@ -1,6 +1,9 @@ CONFIG_UART_ASYNC_API=y CONFIG_UART_1_ASYNC=y CONFIG_UART_1_INTERRUPT_DRIVEN=n +# Enable HW RX byte counting. This especially matters at higher baud rates. +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y From 737d596ef0e7cba80ee64aed0d4c3df64da040c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:39 +0200 Subject: [PATCH 2848/3334] Revert "[nrf fromtree] tests: drivers: uart: uart_errors: Fix nrf54l overlays" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba4f624bdfacdaa897a55bafd8e3189867fe532f. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 14 +++----------- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 13 +++---------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/tests/drivers/uart/uart_errors/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_errors/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 4e6392f6132c..12276e58abb7 100644 --- a/tests/drivers/uart/uart_errors/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_errors/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -1,18 +1,10 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ &pinctrl { uart21_default: uart21_default { group1 { - psels = ; - bias-pull-up; - }; - - group2 { - psels = ; + psels = , + ; }; }; diff --git a/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 64e7c2257e66..00a35f9aca84 100644 --- a/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/uart/uart_errors/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -1,17 +1,10 @@ -/* * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ &pinctrl { uart21_default: uart21_default { group1 { - psels = ; - bias-pull-up; - }; - - group2 { - psels = ; + psels = , + ; }; }; From e572d28392f21ec995fdb03c5c54f703065ed173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:39 +0200 Subject: [PATCH 2849/3334] Revert "[nrf fromtree] tests: drivers: uart: async_dual: Add pull-up to sleep state" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7ffec3996cdf7629c6c7ba2420cd80ec1bda8b67. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54h20dk_nrf54h20_common.dtsi | 8 +------- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 8 +------- .../uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay | 8 +------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi index 7dbe2caff1ee..c44628969d69 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54h20dk_nrf54h20_common.dtsi @@ -1,8 +1,4 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ &pinctrl { uart134_alt_default: uart134_alt_default { @@ -21,7 +17,6 @@ psels = , ; low-power-enable; - bias-pull-up; }; }; @@ -41,7 +36,6 @@ psels = , ; low-power-enable; - bias-pull-up; }; }; diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay index 555943b3fa69..f0f9fa7667af 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf54l15dk_nrf54l15_cpuapp.overlay @@ -1,8 +1,4 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ &pinctrl { uart21_default: uart21_default { @@ -21,7 +17,6 @@ psels = , ; low-power-enable; - bias-pull-up; }; }; @@ -41,7 +36,6 @@ psels = , ; low-power-enable; - bias-pull-up; }; }; }; diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay index 2a501b4ee1a1..bca1841c6505 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay +++ b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.overlay @@ -1,8 +1,4 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ &pinctrl { uart1_default: uart1_default { @@ -21,7 +17,6 @@ psels = , ; low-power-enable; - bias-pull-up; }; }; @@ -41,7 +36,6 @@ psels = , ; low-power-enable; - bias-pull-up; }; }; }; From 8dbfceab9ed0f247629551f46bd7ead01a1d470f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:39 +0200 Subject: [PATCH 2850/3334] Revert "[nrf fromtree] tests: drivers: uart: async_dual: Extend test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 59ff9bfc731b2f0b3730047966ff312d32a87cc1. Signed-off-by: Andrzej Głąbek --- tests/drivers/uart/uart_async_dual/prj.conf | 1 - tests/drivers/uart/uart_async_dual/src/main.c | 54 ++++--------------- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/prj.conf b/tests/drivers/uart/uart_async_dual/prj.conf index 8c838a67e465..aaf360d69136 100644 --- a/tests/drivers/uart/uart_async_dual/prj.conf +++ b/tests/drivers/uart/uart_async_dual/prj.conf @@ -1,7 +1,6 @@ CONFIG_ZTEST=y CONFIG_RING_BUFFER=y CONFIG_TEST_RANDOM_GENERATOR=y -CONFIG_XOSHIRO_RANDOM_GENERATOR=y CONFIG_SERIAL=y CONFIG_UART_ASYNC_API=y CONFIG_UART_USE_RUNTIME_CONFIGURE=y diff --git a/tests/drivers/uart/uart_async_dual/src/main.c b/tests/drivers/uart/uart_async_dual/src/main.c index d2ef48f83aa4..160d8c761040 100644 --- a/tests/drivers/uart/uart_async_dual/src/main.c +++ b/tests/drivers/uart/uart_async_dual/src/main.c @@ -145,7 +145,6 @@ enum test_rx_mode { RX_CONT, RX_DIS, RX_ALL, - RX_CONT_1BYTE_BUF, }; typedef bool (*test_on_rx_rdy_t)(const struct device *dev, uint8_t *buf, size_t len); @@ -356,12 +355,9 @@ static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) { int err; - if (rx_data.mode != RX_CONT_1BYTE_BUF) { - zassert_equal(buf, rx_data.hdr); - } + zassert_equal(buf, rx_data.hdr); zassert_equal(len, 1); - - if (buf[0] == 1) { + if (rx_data.hdr[0] == 1) { /* single byte packet. */ if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { err = uart_rx_buf_rsp(dev, rx_data.hdr, 1); @@ -372,15 +368,14 @@ static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) zassert_equal(rx_data.payload_idx, 0); rx_data.on_rx_rdy = on_rx_rdy_payload; - rx_data.payload_idx = buf[0] - 1; + rx_data.payload_idx = rx_data.hdr[0] - 1; rx_data.state = RX_PAYLOAD; if ((rx_data.mode == RX_CONT) && rx_data.buf_req) { - size_t l = buf[0] - 1; + size_t l = rx_data.hdr[0] - 1; zassert_true(l > 0); rx_data.buf_req = false; err = uart_rx_buf_rsp(dev, rx_data.buf, buf[0] - 1); - zassert_equal(err, 0); } return true; @@ -388,21 +383,16 @@ static bool on_rx_rdy_hdr(const struct device *dev, uint8_t *buf, size_t len) static void on_rx_buf_req(const struct device *dev) { - uint8_t *buf; - size_t len; - int err; - - if ((rx_data.mode == RX_CONT) || (rx_data.mode == RX_DIS)) { + if (rx_data.mode != RX_ALL) { rx_data.buf_req = true; return; } - len = (rx_data.mode == RX_CONT_1BYTE_BUF) ? 1 : sizeof(rx_data.buf) / 2; - buf = &rx_data.buf[len * rx_data.buf_idx]; - rx_data.buf_idx = (rx_data.buf_idx + 1) & 0x1; + size_t len = sizeof(rx_data.buf) / 2; + uint8_t *buf = &rx_data.buf[len * rx_data.buf_idx]; - err = uart_rx_buf_rsp(dev, buf, len); - zassert_equal(err, 0); + rx_data.buf_idx = (rx_data.buf_idx + 1) & 0x1; + uart_rx_buf_rsp(dev, buf, len); } static void on_rx_dis(const struct device *dev, struct uart_event *evt, void *user_data) @@ -660,25 +650,6 @@ ZTEST(uart_async_dual, test_var_packets_cont_hwfc_1m) var_packet(1000000, TX_PACKETS, RX_CONT, true); } -ZTEST(uart_async_dual, test_var_packets_1byte_rx_hwfc) -{ - /* TX in packet mode, RX in CONT mode, 1M */ - var_packet(115200, TX_PACKETS, RX_CONT_1BYTE_BUF, true); -} - -ZTEST(uart_async_dual, test_var_packets_1byte_rx_hwfc_1m) -{ - if (IS_ENABLED(CONFIG_TEST_BUSY_SIM)) { - /* Providing 1 byte buffers all the time generates too much cpu load - * to handle with additional busy simulator loading the cpu. - */ - ztest_test_skip(); - } - - /* TX in packet mode, RX in CONT mode, 1M */ - var_packet(1000000, TX_PACKETS, RX_CONT_1BYTE_BUF, true); -} - ZTEST(uart_async_dual, test_var_packets_chopped_all) { if (!IS_ENABLED(CONFIG_TEST_CHOPPED_TX)) { @@ -982,7 +953,7 @@ static void hci_like_test(uint32_t baudrate) /* Flush data. */ (void)uart_tx_abort(tx_dev); - k_sleep(K_USEC(TX_TIMEOUT * 12 / 10)); + k_msleep(10); PM_CHECK(tx_dev, rx_dev, false); (void)uart_rx_enable(rx_dev, rx_data.buf, sizeof(rx_data.buf), rx_data.timeout); @@ -1012,11 +983,6 @@ static void *setup(void) { static int idx; - /* First call will initialize the test random generator and it needs to be done - * from a thread context. - */ - (void)sys_rand8_get(); - rx_dev = duts[idx].dev; if (duts[idx].dev_aux == NULL) { TC_PRINT("Single UART test on instance:%s\n", duts[idx].name); From 13b782d02b99283634d1021f191e093112992a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:40 +0200 Subject: [PATCH 2851/3334] Revert "[nrf fromtree] drivers: serial: nrfx_uarte: Fix short RX buffers handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 820d855483faa390a19070f76859782f463c45ea. Signed-off-by: Andrzej Głąbek --- drivers/serial/uart_nrfx_uarte.c | 124 +++++++++++++++---------------- 1 file changed, 61 insertions(+), 63 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 38d70b1dd663..7da1d8097f9a 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -855,15 +855,8 @@ static void rx_disable_finalize(const struct device *dev) struct uart_event evt = { .type = UART_RX_DISABLED, }; - static const uint32_t rx_int_mask = - NRF_UARTE_INT_ENDRX_MASK | - NRF_UARTE_INT_RXSTARTED_MASK | - NRF_UARTE_INT_ERROR_MASK | - NRF_UARTE_INT_RXTO_MASK | - NRF_UARTE_INT_RXDRDY_MASK; async_rx->enabled = false; - nrf_uarte_int_disable(get_uarte_instance(dev), rx_int_mask); if (LOW_POWER_ENABLED(cfg)) { uint32_t key = irq_lock(); @@ -1623,6 +1616,12 @@ static int cbwt_uarte_async_init(const struct device *dev) static int uarte_async_init(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; + NRF_UARTE_Type *uarte = get_uarte_instance(dev); + static const uint32_t rx_int_mask = + NRF_UARTE_INT_ENDRX_MASK | + NRF_UARTE_INT_RXSTARTED_MASK | + NRF_UARTE_INT_ERROR_MASK | + NRF_UARTE_INT_RXTO_MASK; k_timer_init(&data->async->rx.timer, rx_timeout, NULL); k_timer_user_data_set(&data->async->rx.timer, (void *)dev); @@ -1647,6 +1646,8 @@ static int uarte_async_init(const struct device *dev) } #endif + nrf_uarte_int_enable(uarte, rx_int_mask); + return 0; } @@ -1913,16 +1914,14 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, * RXTO interrupt is kept enabled only when RX is active. */ nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXTO_MASK); } - static const uint32_t rx_int_mask = - NRF_UARTE_INT_ENDRX_MASK | - NRF_UARTE_INT_RXSTARTED_MASK | - NRF_UARTE_INT_ERROR_MASK | - NRF_UARTE_INT_RXTO_MASK; + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); - nrf_uarte_int_enable(uarte, rx_int_mask); async_rx->enabled = true; + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); return 0; @@ -2131,7 +2130,7 @@ static void rxstarted_isr(const struct device *dev) .type = UART_RX_BUF_REQUEST, }; -#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && !defined(UARTE_HAS_FRAME_TIMEOUT) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); @@ -2139,11 +2138,11 @@ static void rxstarted_isr(const struct device *dev) if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); } -#endif +#endif /* !UARTE_HAS_FRAME_TIMEOUT */ user_callback(dev, &evt); } -static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) +static void endrx_isr(const struct device *dev) { struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; @@ -2153,6 +2152,11 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) async_rx->is_in_irq = true; #endif + /* ensure rx timer is stopped - it will be restarted in RXSTARTED + * handler if needed + */ + k_timer_stop(&async_rx->timer); + /* this is the amount that the EasyDMA controller has copied into the * buffer */ @@ -2222,13 +2226,11 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) } #endif - /* Remove the short until the subsequent next buffer is setup */ - nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); - - /* If RXSTARTED is not set then it means that second buffer was - * provided not on time. + /* Check is based on assumption that ISR handler handles + * ENDRX before RXSTARTED so if short was set on time, RXSTARTED + * event will be set. */ - if (!rxstarted && !rxto) { + if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED)) { nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STARTRX); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND)) { @@ -2236,10 +2238,9 @@ static void endrx_isr(const struct device *dev, bool rxstarted, bool rxto) start_timeout = true; } } + /* Remove the short until the subsequent next buffer is setup */ + nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_ENDRX_STARTRX); } else { - if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { - k_timer_stop(&async_rx->timer); - } nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); } @@ -2455,7 +2456,7 @@ static void rxdrdy_isr(const struct device *dev) static bool event_check_clear(NRF_UARTE_Type *uarte, nrf_uarte_event_t event, uint32_t int_mask, uint32_t int_en_mask) { - if ((int_mask & int_en_mask) && nrf_uarte_event_check(uarte, event)) { + if (nrf_uarte_event_check(uarte, event) && (int_mask & int_en_mask)) { nrf_uarte_event_clear(uarte, event); return true; } @@ -2470,54 +2471,52 @@ static void uarte_nrfx_isr_async(const void *arg) struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); - bool rxto, endrx, rxstarted, rxdrdy, error; - /* Order of reading those events is important as it must be ensured that processing - * order is maintained. - */ - rxto = event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask); - endrx = event_check_clear(uarte, NRF_UARTE_EVENT_ENDRX, NRF_UARTE_INT_ENDRX_MASK, imask); - rxdrdy = event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask); - rxstarted = event_check_clear(uarte, NRF_UARTE_EVENT_RXSTARTED, - NRF_UARTE_INT_RXSTARTED_MASK, imask); - error = event_check_clear(uarte, NRF_UARTE_EVENT_ERROR, NRF_UARTE_INT_ERROR_MASK, imask); - - if (error) { - error_isr(dev); - } - - if (rxdrdy) { + if ((!IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT) || IS_CBWT(dev)) && + event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { rxdrdy_isr(dev); } - /* If next buffer is already provided then handle ENDRX before RXSTARTED. */ - if ((endrx || rxstarted) && (async_rx->next_buf != NULL)) { - if (!endrx) { - __ASSERT_NO_MSG(nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)); - nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); - } - endrx_isr(dev, rxstarted, rxto); - endrx = false; + if (event_check_clear(uarte, NRF_UARTE_EVENT_ERROR, NRF_UARTE_INT_ERROR_MASK, imask)) { + error_isr(dev); } - if (rxstarted) { - rxstarted_isr(dev); + if (event_check_clear(uarte, NRF_UARTE_EVENT_ENDRX, NRF_UARTE_INT_ENDRX_MASK, imask)) { + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX); + endrx_isr(dev); } - if (endrx) { - endrx_isr(dev, false, false); + /* RXSTARTED must be handled after ENDRX because it starts the RX timeout + * and if order is swapped then ENDRX will stop this timeout. + * Skip if ENDRX is set when RXSTARTED is set. It means that + * ENDRX occurred after check for ENDRX in isr which may happen when + * UARTE interrupt got preempted. Events are not cleared + * and isr will be called again. ENDRX will be handled first. + */ + if ((imask & NRF_UARTE_INT_RXSTARTED_MASK) && + nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXSTARTED) && + !nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) { + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED); + rxstarted_isr(dev); } - if (rxto) { #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER - if (IS_CBWT(dev)) { - cbwt_rxto_isr(dev, true); - } else { - rxto_isr(dev); - } -#else + if (IS_CBWT(dev) && + event_check_clear(uarte, NRF_UARTE_EVENT_RXTO, NRF_UARTE_INT_RXTO_MASK, imask)) { + cbwt_rxto_isr(dev, true); + } else +#endif + /* RXTO must be handled after ENDRX which should notify the buffer. + * Skip if ENDRX is set when RXTO is set. It means that + * ENDRX occurred after check for ENDRX in isr which may happen when + * UARTE interrupt got preempted. Events are not cleared + * and isr will be called again. ENDRX will be handled first. + */ + if ((imask & NRF_UARTE_INT_RXTO_MASK) && + nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXTO) && + !nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) { + nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO); rxto_isr(dev); -#endif } if (!IS_ENABLED(UARTE_HAS_ENDTX_STOPTX_SHORT) && @@ -2534,7 +2533,6 @@ static void uarte_nrfx_isr_async(const void *arg) if (!IS_CBWT(dev) && (atomic_and(&data->flags, ~UARTE_FLAG_TRIG_RXTO) & UARTE_FLAG_TRIG_RXTO)) { #ifdef CONFIG_HAS_NORDIC_DMM - const struct uarte_nrfx_config *config = dev->config; int ret; ret = dmm_buffer_in_release(config->mem_reg, async_rx->usr_buf, async_rx->buf_len, From 0959fe271a188a9a4b532df3e44f18e9a03ada4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:40 +0200 Subject: [PATCH 2852/3334] Revert "[nrf fromtree] drivers: serial: nrfx_uarte: Cleanup" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit adc8e8f57f77496a35bf229bda36cd5815ceeca9. Signed-off-by: Andrzej Głąbek --- drivers/serial/Kconfig.nrfx | 4 - drivers/serial/uart_nrfx_uarte.c | 292 ++++++++++++------ .../boards/nrf5340bsim_nrf5340_cpuapp.conf | 1 + 3 files changed, 200 insertions(+), 97 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index 53fa3ab54de6..f931a30f0f8e 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -39,11 +39,7 @@ config UART_NRFX_UARTE_ENHANCED_RX depends on UART_ASYNC_API depends on !(UART_0_NRF_HW_ASYNC || UART_1_NRF_HW_ASYNC || UART_2_NRF_HW_ASYNC) default y - select DEPRECATED help - Option is deprecated as it is used as default unless TIMER peripheral is used - for RX byte counting. - Enable RX handling mode which is switching buffers on timeout. This is an enhancement compared to other two modes (default and hardware assisted). Default mode could miscount bytes when interrupt was not handled on time diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 7da1d8097f9a..8258aab48255 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -204,14 +204,25 @@ struct uarte_async_rx { size_t offset; uint8_t *next_buf; size_t next_buf_len; +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + uint32_t idle_cnt; +#endif k_timeout_t timeout; -#ifdef UARTE_ANY_HW_ASYNC +#else + uint32_t total_byte_cnt; /* Total number of bytes received */ uint32_t total_user_byte_cnt; /* Total number of bytes passed to user */ - nrfx_gppi_handle_t ppi; + int32_t timeout_us; /* Timeout set by user */ + int32_t timeout_slab; /* rx_timeout divided by RX_TIMEOUT_DIV */ + int32_t timeout_left; /* Current time left until user callback */ + union { + nrfx_gppi_handle_t ppi; + uint32_t cnt; + } cnt; /* Flag to ensure that RX timeout won't be executed during ENDRX ISR */ volatile bool is_in_irq; -#endif /* UARTE_ANY_HW_ASYNC */ - uint8_t idle_cnt; +#endif /* CONFIG_UART_NRFX_UARTE_ENHANCED_RX */ uint8_t flush_cnt; volatile bool enabled; volatile bool discard_fifo; @@ -444,10 +455,11 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask) return; } -#if defined(UARTE_ANY_HW_ASYNC) +#if defined(UARTE_ANY_ASYNC) && !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) if (data->async && HW_RX_COUNTING_ENABLED(config)) { nrfx_timer_disable(&data->timer); /* Timer/counter value is reset when disabled. */ + data->async->rx.total_byte_cnt = 0; data->async->rx.total_user_byte_cnt = 0; } #endif @@ -930,7 +942,7 @@ static int uarte_nrfx_rx_disable(const struct device *dev) return rx_disable(dev, true); } -#if defined(UARTE_ANY_HW_ASYNC) +#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) static void timer_handler(nrf_timer_event_t event_type, void *p_context) { } static int uarte_nrfx_rx_counting_init(const struct device *dev) @@ -939,35 +951,40 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev) const struct uarte_nrfx_config *cfg = dev->config; NRF_UARTE_Type *uarte = get_uarte_instance(dev); int ret; - nrfx_timer_config_t tmr_config = NRFX_TIMER_DEFAULT_CONFIG( - NRF_TIMER_BASE_FREQUENCY_GET(data->timer.p_reg)); - uint32_t evt_addr = nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_RXDRDY); - uint32_t tsk_addr = nrfx_timer_task_address_get(&data->timer, NRF_TIMER_TASK_COUNT); - - tmr_config.mode = NRF_TIMER_MODE_COUNTER; - tmr_config.bit_width = NRF_TIMER_BIT_WIDTH_32; - ret = nrfx_timer_init(&data->timer, - &tmr_config, - timer_handler); - if (ret != 0) { - LOG_ERR("Timer already initialized"); - return -EINVAL; - } - nrfx_timer_clear(&cfg->timer); + if (HW_RX_COUNTING_ENABLED(cfg)) { + nrfx_timer_config_t tmr_config = NRFX_TIMER_DEFAULT_CONFIG( + NRF_TIMER_BASE_FREQUENCY_GET(data->timer.p_reg)); + uint32_t evt_addr = nrf_uarte_event_address_get(uarte, NRF_UARTE_EVENT_RXDRDY); + uint32_t tsk_addr = nrfx_timer_task_address_get(&data->timer, NRF_TIMER_TASK_COUNT); + + tmr_config.mode = NRF_TIMER_MODE_COUNTER; + tmr_config.bit_width = NRF_TIMER_BIT_WIDTH_32; + ret = nrfx_timer_init(&data->timer, + &tmr_config, + timer_handler); + if (ret != 0) { + LOG_ERR("Timer already initialized"); + return -EINVAL; + } + + nrfx_timer_clear(&data->timer); - ret = nrfx_gppi_conn_alloc(evt_addr, tsk_addr, &data->async->rx.cnt.ppi); - if (ret < 0) { - LOG_ERR("Failed to allocate PPI Channel"); - nrfx_timer_uninit(&data->timer); - return ret; - } + ret = nrfx_gppi_conn_alloc(evt_addr, tsk_addr, &data->async->rx.cnt.ppi); + if (ret < 0) { + LOG_ERR("Failed to allocate PPI Channel"); + nrfx_timer_uninit(&data->timer); + return ret; + } - nrfx_gppi_conn_enable(data->async->rx.cnt.ppi); + nrfx_gppi_conn_enable(data->async->rx.cnt.ppi); + } else { + nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); + } return 0; } -#endif /* !defined(UARTE_ANY_HW_ASYNC) */ +#endif /* !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) */ #ifdef CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER @@ -1374,6 +1391,7 @@ static void cbwt_rx_timeout(struct k_timer *timer) /* TIMER or UARTE interrupt preempted. Lets try again * later. */ + k_timer_start(timer, async_rx->timeout, K_NO_WAIT); return; } irq_disable(cfg->uarte_irqn); @@ -1382,7 +1400,6 @@ static void cbwt_rx_timeout(struct k_timer *timer) nrf_uarte_int_enable(cfg->uarte_regs, NRF_UARTE_INT_RXDRDY_MASK); notify_new_data(dev, true); - k_timer_stop(timer); if (cfg->flags & UARTE_CFG_FLAG_VAR_IRQ) { irq_enable(cfg->uarte_irqn); @@ -1391,6 +1408,8 @@ static void cbwt_rx_timeout(struct k_timer *timer) return; } } + + k_timer_start(timer, async_rx->timeout, K_NO_WAIT); } static void cbwt_rx_flush_handle(const struct device *dev) @@ -1621,7 +1640,9 @@ static int uarte_async_init(const struct device *dev) NRF_UARTE_INT_ENDRX_MASK | NRF_UARTE_INT_RXSTARTED_MASK | NRF_UARTE_INT_ERROR_MASK | - NRF_UARTE_INT_RXTO_MASK; + NRF_UARTE_INT_RXTO_MASK | + ((IS_ENABLED(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) && + !IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) ? NRF_UARTE_INT_RXDRDY_MASK : 0); k_timer_init(&data->async->rx.timer, rx_timeout, NULL); k_timer_user_data_set(&data->async->rx.timer, (void *)dev); @@ -1634,15 +1655,11 @@ static int uarte_async_init(const struct device *dev) } #endif -#if defined(UARTE_ANY_HW_ASYNC) - const struct uarte_nrfx_config *cfg = dev->config; - int ret; +#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) + int ret = uarte_nrfx_rx_counting_init(dev); - if (HW_RX_COUNTING_ENABLED(cfg)) { - ret = uarte_nrfx_rx_counting_init(dev); - if (ret != 0) { - return ret; - } + if (ret != 0) { + return ret; } #endif @@ -1657,6 +1674,7 @@ static int uarte_async_init(const struct device *dev) */ static void start_tx_locked(const struct device *dev, struct uarte_nrfx_data *data) { + nrf_uarte_int_enable(get_uarte_instance(dev), NRF_UARTE_INT_TXSTOPPED_MASK); if (!is_tx_ready(dev)) { /* Active poll out, postpone until it is completed. */ data->async->tx.pending = true; @@ -1665,7 +1683,6 @@ static void start_tx_locked(const struct device *dev, struct uarte_nrfx_data *da data->async->tx.amount = -1; tx_start(dev, data->async->tx.xfer_buf, data->async->tx.xfer_len); } - nrf_uarte_int_enable(get_uarte_instance(dev), NRF_UARTE_INT_TXSTOPPED_MASK); } /* Setup cache buffer (used for sending data outside of RAM memory). @@ -1791,7 +1808,11 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, struct uarte_async_rx *async_rx = &data->async->rx; const struct uarte_nrfx_config *cfg = dev->config; NRF_UARTE_Type *uarte = get_uarte_instance(dev); + +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) bool with_timeout = timeout != SYS_FOREVER_US; +#endif if (cfg->disable_rx) { __ASSERT(false, "TX only UARTE instance"); @@ -1821,6 +1842,9 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } #endif +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + #ifdef UARTE_HAS_FRAME_TIMEOUT if (!IS_CBWT(dev) && with_timeout) { uint32_t baudrate = COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE, @@ -1829,6 +1853,9 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, nrf_uarte_shorts_enable(uarte, NRF_UARTE_SHORT_FRAME_TIMEOUT_STOPRX); } #endif +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + async_rx->idle_cnt = 0; +#endif if (with_timeout) { if (!IS_CBWT(dev) && IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) { @@ -1840,6 +1867,10 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, } else { async_rx->timeout = K_NO_WAIT; } +#else + async_rx->timeout_us = timeout; + async_rx->timeout_slab = timeout / RX_TIMEOUT_DIV; +#endif async_rx->buf = buf; async_rx->buf_len = len; @@ -1898,11 +1929,13 @@ static int uarte_nrfx_rx_enable(const struct device *dev, uint8_t *buf, NRFX_IRQ_PENDING_SET(nrfx_get_irq_number(uarte)); return 0; } else { +#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX if (with_timeout) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); k_timer_start(&async_rx->timer, async_rx->timeout, - async_rx->timeout); + K_NO_WAIT); } +#endif } } } @@ -2000,36 +2033,6 @@ static void tx_timeout(struct k_timer *timer) (void) uarte_nrfx_tx_abort(dev); } -/** Function is called when idle state is detected on the line. Notify user - * all pending data. - */ -#ifndef UARTE_HAS_FRAME_TIMEOUT -static void hw_count_rx_timeout(const struct device *dev) -{ -#ifdef UARTE_ANY_HW_ASYNC - struct uarte_nrfx_data *data = dev->data; - struct uarte_async_rx *async_rx = &data->async->rx; - const struct uarte_nrfx_config *cfg = dev->config; - NRF_UARTE_Type *uarte = get_uarte_instance(dev); - uint32_t len; - - if (async_rx->is_in_irq == true) { - return; - } - irq_disable(nrfx_get_irq_number(uarte)); - - len = nrfx_timer_capture(&cfg->timer, 0) - async_rx->total_user_byte_cnt; - if ((len > 0) && ((len + async_rx->offset) < async_rx->buf_len)) { - notify_uart_rx_rdy(dev, len); - async_rx->offset += len; - async_rx->total_user_byte_cnt += len; - } - nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); - irq_enable(nrfx_get_irq_number(uarte)); -#endif -} -#endif - /** * Whole timeout is divided by RX_TIMEOUT_DIV into smaller units, rx_timeout * is executed periodically every rx_timeout_slab us. If between executions @@ -2041,6 +2044,8 @@ static void hw_count_rx_timeout(const struct device *dev) static void rx_timeout(struct k_timer *timer) { const struct device *dev = k_timer_user_data_get(timer); + +#if CONFIG_UART_NRFX_UARTE_ENHANCED_RX NRF_UARTE_Type *uarte = get_uarte_instance(dev); #ifdef UARTE_HAS_FRAME_TIMEOUT @@ -2058,13 +2063,12 @@ static void rx_timeout(struct k_timer *timer) if (IS_ENABLED(RX_FRAMETIMEOUT_WORKAROUND) && (atomic_and(&data->flags, ~UARTE_FLAG_FTIMEOUT_WATCH) & UARTE_FLAG_FTIMEOUT_WATCH)) { if (rxdrdy) { - k_timer_start(timer, async_rx->timeout, K_NO_WAIT); nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); + k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); } } else { if (!rxdrdy) { nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - k_timer_stop(timer); } } @@ -2072,7 +2076,6 @@ static void rx_timeout(struct k_timer *timer) #else /* UARTE_HAS_FRAME_TIMEOUT */ struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; - const struct uarte_nrfx_config *cfg = dev->config; if (nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_RXDRDY)) { nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); @@ -2088,16 +2091,94 @@ static void rx_timeout(struct k_timer *timer) * then RX notification would come after (RX_TIMEOUT_DIV + 1) * timeout. */ if (async_rx->idle_cnt == (RX_TIMEOUT_DIV - 1)) { - k_timer_stop(timer); - if (HW_RX_COUNTING_ENABLED(cfg)) { - hw_count_rx_timeout(dev); - } else { - nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); - } + nrf_uarte_task_trigger(uarte, NRF_UARTE_TASK_STOPRX); return; } } + + k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT); #endif /* UARTE_HAS_FRAME_TIMEOUT */ +#else /* CONFIG_UART_NRFX_UARTE_ENHANCED_RX */ + const struct uarte_nrfx_config *cfg = dev->config; + struct uarte_nrfx_data *data = dev->data; + struct uarte_async_rx *async_rx = &data->async->rx; + uint32_t read; + + if (async_rx->is_in_irq) { + return; + } + + /* Disable ENDRX ISR, in case ENDRX event is generated, it will be + * handled after rx_timeout routine is complete. + */ + nrf_uarte_int_disable(get_uarte_instance(dev), + NRF_UARTE_INT_ENDRX_MASK); + + if (HW_RX_COUNTING_ENABLED(cfg)) { + read = nrfx_timer_capture(&data->timer, 0); + } else { + read = async_rx->cnt.cnt; + } + + /* Check if data was received since last function call */ + if (read != async_rx->total_byte_cnt) { + async_rx->total_byte_cnt = read; + async_rx->timeout_left = async_rx->timeout_us; + } + + /* Check if there is data that was not sent to user yet + * Note though that 'len' is a count of data bytes received, but not + * necessarily the amount available in the current buffer + */ + int32_t len = async_rx->total_byte_cnt - async_rx->total_user_byte_cnt; + + if (!HW_RX_COUNTING_ENABLED(cfg) && + (len < 0)) { + /* Prevent too low value of rx_cnt.cnt which may occur due to + * latencies in handling of the RXRDY interrupt. + * At this point, the number of received bytes is at least + * equal to what was reported to the user. + */ + async_rx->cnt.cnt = async_rx->total_user_byte_cnt; + len = 0; + } + + /* Check for current buffer being full. + * if the UART receives characters before the ENDRX is handled + * and the 'next' buffer is set up, then the SHORT between ENDRX and + * STARTRX will mean that data will be going into to the 'next' buffer + * until the ENDRX event gets a chance to be handled. + */ + bool clipped = false; + + if (len + async_rx->offset > async_rx->buf_len) { + len = async_rx->buf_len - async_rx->offset; + clipped = true; + } + + if (len > 0) { + if (clipped || (async_rx->timeout_left < async_rx->timeout_slab)) { + /* rx_timeout us elapsed since last receiving */ + if (async_rx->buf != NULL) { + notify_uart_rx_rdy(dev, len); + async_rx->offset += len; + async_rx->total_user_byte_cnt += len; + } + } else { + async_rx->timeout_left -= async_rx->timeout_slab; + } + + /* If there's nothing left to report until the buffers are + * switched then the timer can be stopped + */ + if (clipped) { + k_timer_stop(&async_rx->timer); + } + } + + nrf_uarte_int_enable(get_uarte_instance(dev), + NRF_UARTE_INT_ENDRX_MASK); +#endif /* CONFIG_UART_NRFX_UARTE_ENHANCED_RX */ } #define UARTE_ERROR_FROM_MASK(mask) \ @@ -2130,14 +2211,24 @@ static void rxstarted_isr(const struct device *dev) .type = UART_RX_BUF_REQUEST, }; -#if !defined(UARTE_HAS_FRAME_TIMEOUT) +#ifndef UARTE_HAS_FRAME_TIMEOUT struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; + +#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX NRF_UARTE_Type *uarte = get_uarte_instance(dev); if (!K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) { nrf_uarte_int_enable(uarte, NRF_UARTE_INT_RXDRDY_MASK); } +#else + if (async_rx->timeout_us != SYS_FOREVER_US) { + k_timeout_t timeout = K_USEC(async_rx->timeout_slab); + + async_rx->timeout_left = async_rx->timeout_us; + k_timer_start(&async_rx->timer, timeout, timeout); + } +#endif /* CONFIG_UART_NRFX_UARTE_ENHANCED_RX */ #endif /* !UARTE_HAS_FRAME_TIMEOUT */ user_callback(dev, &evt); } @@ -2148,7 +2239,7 @@ static void endrx_isr(const struct device *dev) struct uarte_async_rx *async_rx = &data->async->rx; NRF_UARTE_Type *uarte = get_uarte_instance(dev); -#if defined(UARTE_ANY_HW_ASYNC) +#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) async_rx->is_in_irq = true; #endif @@ -2186,7 +2277,7 @@ static void endrx_isr(const struct device *dev) rx_len = 0; } -#if defined(UARTE_ANY_HW_ASYNC) +#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) async_rx->total_user_byte_cnt += rx_len; #endif @@ -2252,7 +2343,7 @@ static void endrx_isr(const struct device *dev) #endif } -#if defined(UARTE_ANY_HW_ASYNC) +#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) async_rx->is_in_irq = false; #endif } @@ -2332,7 +2423,7 @@ static void rxto_isr(const struct device *dev) */ if (async_rx->discard_fifo) { async_rx->discard_fifo = false; -#if defined(UARTE_ANY_HW_ASYNC) +#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) if (HW_RX_COUNTING_ENABLED(config)) { /* It need to be included because TIMER+PPI got RXDRDY events * and counted those flushed bytes. @@ -2344,6 +2435,7 @@ static void rxto_isr(const struct device *dev) async_rx->flush_cnt = rx_flush(dev); } +#ifdef CONFIG_UART_NRFX_UARTE_ENHANCED_RX NRF_UARTE_Type *uarte = get_uarte_instance(dev); if (IS_ENABLED(CONFIG_HAS_HW_NRF_UARTE120) && (config->flags & UARTE_CFG_FLAG_CACHEABLE)) { /* Spurious RXTO event was seen on fast instance (UARTE120) thus @@ -2355,6 +2447,7 @@ static void rxto_isr(const struct device *dev) nrf_uarte_shorts_disable(uarte, NRF_UARTE_SHORT_FRAME_TIMEOUT_STOPRX); #endif nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXDRDY); +#endif rx_disable_finalize(dev); } @@ -2445,12 +2538,21 @@ static void txstopped_isr(const struct device *dev) static void rxdrdy_isr(const struct device *dev) { +#if !defined(UARTE_HAS_FRAME_TIMEOUT) || defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) struct uarte_nrfx_data *data = dev->data; + +#if defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) || \ + defined(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER) + NRF_UARTE_Type *uarte = get_uarte_instance(dev); data->async->rx.idle_cnt = 0; - k_timer_start(&data->async->rx.timer, data->async->rx.timeout, data->async->rx.timeout); + k_timer_start(&data->async->rx.timer, data->async->rx.timeout, K_NO_WAIT); nrf_uarte_int_disable(uarte, NRF_UARTE_INT_RXDRDY_MASK); +#else + data->async->rx.cnt.cnt++; +#endif +#endif /* !UARTE_HAS_FRAME_TIMEOUT */ } static bool event_check_clear(NRF_UARTE_Type *uarte, nrf_uarte_event_t event, @@ -2468,13 +2570,16 @@ static void uarte_nrfx_isr_async(const void *arg) { const struct device *dev = arg; NRF_UARTE_Type *uarte = get_uarte_instance(dev); + const struct uarte_nrfx_config *config = dev->config; struct uarte_nrfx_data *data = dev->data; struct uarte_async_rx *async_rx = &data->async->rx; uint32_t imask = nrf_uarte_int_enable_check(uarte, UINT32_MAX); - if ((!IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT) || IS_CBWT(dev)) && + if ((IS_CBWT(dev) || + !(HW_RX_COUNTING_ENABLED(config) || IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT))) && event_check_clear(uarte, NRF_UARTE_EVENT_RXDRDY, NRF_UARTE_INT_RXDRDY_MASK, imask)) { rxdrdy_isr(dev); + } if (event_check_clear(uarte, NRF_UARTE_EVENT_ERROR, NRF_UARTE_INT_ERROR_MASK, imask)) { @@ -2631,14 +2736,14 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c) } } - *config->poll_out_byte = c; - tx_start(dev, config->poll_out_byte, 1); - if (!IS_ENABLED(CONFIG_UART_NRFX_UARTE_NO_IRQ) && (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) || LOW_POWER_ENABLED(config))) { nrf_uarte_int_enable(uarte, NRF_UARTE_INT_TXSTOPPED_MASK); } + *config->poll_out_byte = c; + tx_start(dev, config->poll_out_byte, 1); + irq_unlock(key); if (IS_ENABLED(CONFIG_UART_NRFX_UARTE_NO_IRQ)) { @@ -2981,10 +3086,11 @@ static void uarte_pm_suspend(const struct device *dev) wait_for_tx_stopped(dev); } -#if defined(UARTE_ANY_HW_ASYNC) +#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX) if (data->async && HW_RX_COUNTING_ENABLED(cfg)) { nrfx_timer_disable(&data->timer); /* Timer/counter value is reset when disabled. */ + data->async->rx.total_byte_cnt = 0; data->async->rx.total_user_byte_cnt = 0; } #endif @@ -3171,8 +3277,8 @@ static int uarte_instance_deinit(const struct device *dev) #define UARTE_HAS_VAR_PRIO(idx) \ COND_CODE_1(UTIL_AND(IS_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER), \ UARTE_HAS_PROP(idx, timer)), \ - (((DT_IRQ(UARTE(idx), priority) != DT_IRQ(DT_NODELABEL(grtc), priority)) ? \ - UARTE_CFG_FLAG_VAR_IRQ : 0)), (0)) + ((DT_IRQ(UARTE(idx), priority) != DT_IRQ(DT_NODELABEL(grtc), priority)) ? \ + UARTE_CFG_FLAG_VAR_IRQ : 0), (0)) #define UARTE_GET_ISR(idx) \ diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf index 3a15540b2dd5..e7a460fde6bb 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -1 +1,2 @@ CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 +CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y From 4623dc1fc53841861910abf9f39af85f240323ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:40 +0200 Subject: [PATCH 2853/3334] Revert "[nrf fromtree] tests: drivers: uart: async_dual: Fix nrf9160dk configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 96852355e4503e5e65a5f39b0e26b4404299c8e1. Signed-off-by: Andrzej Głąbek --- .../drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf | 3 +-- tests/drivers/uart/uart_async_dual/testcase.yaml | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf index 025b92361475..4da3788618f3 100644 --- a/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf +++ b/tests/drivers/uart/uart_async_dual/boards/nrf9160dk_nrf9160.conf @@ -1,2 +1 @@ -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 +CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index 3d1c43ed621f..c03d6404e178 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -89,4 +89,3 @@ tests: extra_configs: - CONFIG_TEST_CHOPPED_TX=n - CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER=n - - CONFIG_UART_1_NRF_HW_ASYNC=n From ab56342b89ba642a4c2d9b5a58228e0c165286f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:41 +0200 Subject: [PATCH 2854/3334] Revert "[nrf fromtree] tests: drivers: uart: Enable uart_async_dual for xg24_rb4187c" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e59011c9077626153883f7ba53c71b79774b497c. Signed-off-by: Andrzej Głąbek --- .../boards/xg24_rb4187c.overlay | 4 +- .../boards/xg24_rb4187c.overlay | 93 ------------------- .../uart/uart_async_dual/testcase.yaml | 1 - .../boards/xg24_rb4187c.overlay | 4 +- 4 files changed, 4 insertions(+), 98 deletions(-) delete mode 100644 tests/drivers/uart/uart_async_dual/boards/xg24_rb4187c.overlay diff --git a/tests/drivers/uart/uart_async_api/boards/xg24_rb4187c.overlay b/tests/drivers/uart/uart_async_api/boards/xg24_rb4187c.overlay index 1dd14881ae14..79ca9a7e7c22 100644 --- a/tests/drivers/uart/uart_async_api/boards/xg24_rb4187c.overlay +++ b/tests/drivers/uart/uart_async_api/boards/xg24_rb4187c.overlay @@ -5,7 +5,7 @@ */ /* - * Need to connect PC1 and PA5 of the Expension Pin header + * Need to connect PC1 and PC2 of the Expension Pin header */ / { chosen { @@ -24,7 +24,7 @@ }; group1 { - pins = ; + pins = ; input-enable; silabs,input-filter; }; diff --git a/tests/drivers/uart/uart_async_dual/boards/xg24_rb4187c.overlay b/tests/drivers/uart/uart_async_dual/boards/xg24_rb4187c.overlay deleted file mode 100644 index fb3713605ff8..000000000000 --- a/tests/drivers/uart/uart_async_dual/boards/xg24_rb4187c.overlay +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2026, Silicon Laboratories Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * Connect EXP[4,6,8,10] with EXP[7,9,11,13] on the Expension Pin header - */ -/ { - chosen { - zephyr,console = &eusart0; - zephyr,shell-uart = &eusart0; - zephyr,uart-pipe = &eusart0; - }; -}; - -&pinctrl { - usart0_default: usart0_default { - group0 { - pins = , ; - drive-push-pull; - output-high; - }; - - group1 { - pins = , ; - input-enable; - silabs,input-filter; - }; - }; - - eusart1_default: eusart1_default { - group0 { - pins = , ; - drive-push-pull; - output-high; - }; - - group1 { - pins = , ; - input-enable; - silabs,input-filter; - }; - }; - - eusart0_default: eusart0_default { - group0 { - pins = ; - drive-push-pull; - output-high; - }; - - group1 { - pins = ; - input-enable; - silabs,input-filter; - }; - }; -}; - -dut: &usart0 { - dmas = <&dma0 DMA_REQSEL_USART0TXBL>, - <&dma0 DMA_REQSEL_USART0RXDATAV>; - dma-names = "tx", "rx"; - pinctrl-0 = <&usart0_default>; - pinctrl-names = "default"; -}; - -dut_aux: &eusart1 { - compatible = "silabs,eusart-uart"; - current-speed = <115200>; - dmas = <&dma0 DMA_REQSEL_EUSART1TXFL>, - <&dma0 DMA_REQSEL_EUSART1RXFL>; - dma-names = "tx", "rx"; - pinctrl-0 = <&eusart1_default>; - pinctrl-names = "default"; - status = "okay"; - - /delete-property/ cs-gpios; -}; - -&eusart0 { - compatible = "silabs,eusart-uart"; - current-speed = <115200>; - pinctrl-0 = <&eusart0_default>; - pinctrl-names = "default"; - status = "okay"; -}; - -&dma0 { - status = "okay"; -}; diff --git a/tests/drivers/uart/uart_async_dual/testcase.yaml b/tests/drivers/uart/uart_async_dual/testcase.yaml index c03d6404e178..1722d5e5e7d1 100644 --- a/tests/drivers/uart/uart_async_dual/testcase.yaml +++ b/tests/drivers/uart/uart_async_dual/testcase.yaml @@ -15,7 +15,6 @@ tests: - nrf54h20dk/nrf54h20/cpuppr - nrf9160dk/nrf9160 - nrf52_bsim - - xg24_rb4187c drivers.uart.async_dual.busy_sim: harness: ztest harness_config: diff --git a/tests/drivers/uart/uart_elementary/boards/xg24_rb4187c.overlay b/tests/drivers/uart/uart_elementary/boards/xg24_rb4187c.overlay index c166b4ba64a6..0824d7f547d6 100644 --- a/tests/drivers/uart/uart_elementary/boards/xg24_rb4187c.overlay +++ b/tests/drivers/uart/uart_elementary/boards/xg24_rb4187c.overlay @@ -13,7 +13,7 @@ }; /* - * Connect EXP4 (PC1) and EXP7 (PA5) of the Expansion Pin header + * Connect EXP4 (PC1) and EXP6 (PC2) of the Expansion Pin header */ &pinctrl { @@ -39,7 +39,7 @@ }; group1 { - pins = ; /* WPK EXP7 (PA5) */ + pins = ; /* WPK EXP6 (PC2) */ input-enable; silabs,input-filter; }; From b9f941a18808bcaef459f027af844a892238c743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:41 +0200 Subject: [PATCH 2855/3334] Revert "[nrf fromtree] tests: subsys: ipc: ipc_sessions: fix tags" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4a35150931b8639d20701f94d1300dcdaf3010d4. Signed-off-by: Andrzej Głąbek --- tests/subsys/ipc/ipc_sessions/testcase.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/subsys/ipc/ipc_sessions/testcase.yaml b/tests/subsys/ipc/ipc_sessions/testcase.yaml index fd57a5f83bb4..d1dc3e5d5033 100644 --- a/tests/subsys/ipc/ipc_sessions/testcase.yaml +++ b/tests/subsys/ipc/ipc_sessions/testcase.yaml @@ -4,9 +4,7 @@ sample: common: sysbuild: true - tags: - - ipc - - ipc_sessions + tags: ipc ipc_sessions harness: ztest tests: From dd3f2563574bf261ae39b2de70bb247a9e1c47d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:41 +0200 Subject: [PATCH 2856/3334] Revert "[nrf fromtree] tests: arch: common: interrupt: make tags common" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 65008779d0c166710e97f327ce11c69ff2197da1. Signed-off-by: Andrzej Głąbek --- tests/arch/common/interrupt/testcase.yaml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/arch/common/interrupt/testcase.yaml b/tests/arch/common/interrupt/testcase.yaml index ce4e04b9711e..b11a688a1cef 100644 --- a/tests/arch/common/interrupt/testcase.yaml +++ b/tests/arch/common/interrupt/testcase.yaml @@ -1,13 +1,15 @@ -common: - tags: - - kernel - - interrupt tests: arch.interrupt: platform_exclude: qemu_cortex_m0 + tags: + - kernel + - interrupt filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE arch.interrupt.qemu_cortex_m0: platform_allow: qemu_cortex_m0 + tags: + - kernel + - interrupt filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE extra_configs: - CONFIG_QEMU_ICOUNT=y @@ -15,6 +17,8 @@ tests: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_MINIMAL_LIBC_SUPPORTED platform_exclude: qemu_cortex_m0 tags: + - kernel + - interrupt - libc extra_configs: - CONFIG_MINIMAL_LIBC=y @@ -22,6 +26,8 @@ tests: filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE and CONFIG_MINIMAL_LIBC_SUPPORTED platform_allow: qemu_cortex_m0 tags: + - kernel + - interrupt - libc extra_configs: - CONFIG_QEMU_ICOUNT=y @@ -38,6 +44,9 @@ tests: - xtensa # TODO: make test work on this arch - mips + tags: + - kernel + - interrupt extra_configs: - CONFIG_SHARED_INTERRUPTS=y filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE @@ -53,6 +62,8 @@ tests: # TODO: make test work on this arch - mips tags: + - kernel + - interrupt - lto extra_configs: - CONFIG_SHARED_INTERRUPTS=y From 35ed2020715af6657016c88071b21390b45d6b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:42 +0200 Subject: [PATCH 2857/3334] Revert "[nrf fromtree] samples: drivers: uart: async_api: make tags common" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 60370afd41dee0f1becf8b591964ef89bfbb1d3f. Signed-off-by: Andrzej Głąbek --- samples/drivers/uart/async_api/sample.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/samples/drivers/uart/async_api/sample.yaml b/samples/drivers/uart/async_api/sample.yaml index 410b6d050650..74c7c02131a1 100644 --- a/samples/drivers/uart/async_api/sample.yaml +++ b/samples/drivers/uart/async_api/sample.yaml @@ -1,19 +1,21 @@ sample: name: UART ASYNC API driver sample -common: - tags: - - serial - - uart tests: sample.drivers.uart.async_api: integration_platforms: - nrf52840dk/nrf52840 + tags: + - serial + - uart filter: CONFIG_SERIAL and CONFIG_UART_ASYNC_API and dt_chosen_enabled("zephyr,shell-uart") and not CONFIG_UART_MCUX_LPUART harness: keyboard sample.drivers.uart.async_api.lpuart: + tags: + - serial + - uart filter: CONFIG_SERIAL and CONFIG_UART_ASYNC_API and dt_chosen_enabled("zephyr,shell-uart") and From 9bae6ba9a235450363f523051424241ae9d16b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:42 +0200 Subject: [PATCH 2858/3334] Revert "[nrf fromtree] samples: drivers: display: use common tag" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 725d58a5fc479cb98c3b7a33684d758eef648731. Signed-off-by: Andrzej Głąbek --- samples/drivers/display/sample.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/drivers/display/sample.yaml b/samples/drivers/display/sample.yaml index 0ec520831c68..adc5b4b94301 100644 --- a/samples/drivers/display/sample.yaml +++ b/samples/drivers/display/sample.yaml @@ -1,13 +1,12 @@ sample: description: Sample application for displays name: display_sample -common: - tags: display tests: sample.display.sdl: build_only: true platform_allow: - native_sim/native/64 + tags: display sample.display.dummy: platform_allow: - native_sim @@ -15,6 +14,7 @@ tests: extra_configs: - CONFIG_SDL_DISPLAY=n - CONFIG_TEST=y + tags: display harness: console harness_config: fixture: fixture_display @@ -25,6 +25,7 @@ tests: platform_allow: - mimxrt595_evk/mimxrt595s/cm33 - mimxrt700_evk/mimxrt798s/cm33_cpu0 + tags: display harness: console extra_args: SHIELD=g1120b0mipi extra_configs: @@ -46,11 +47,13 @@ tests: harness: console harness_config: fixture: fixture_display + tags: display sample.display.st_b_lcd40_dsi1_mb1166_a09: filter: dt_compat_enabled("frida,nt35510") platform_allow: stm32h747i_disco/stm32h747xx/m7 extra_args: SHIELD=st_b_lcd40_dsi1_mb1166_a09 tags: + - display - shield harness: console harness_config: @@ -65,6 +68,7 @@ tests: - mimxrt1040_evk integration_platforms: - mimxrt1040_evk + tags: display harness: console extra_args: SHIELD=rk043fn02h_ct harness_config: From f7ba022bec1fec51ba0dabf26667170d5cd5800a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:42 +0200 Subject: [PATCH 2859/3334] Revert "[nrf fromtree] samples: subsys: usb: uvc: fix tags" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cdbac3df84ef91dfe0d384b7bf27dc08d8402c28. Signed-off-by: Andrzej Głąbek --- samples/subsys/usb/uvc/sample.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/subsys/usb/uvc/sample.yaml b/samples/subsys/usb/uvc/sample.yaml index ea91e0dae139..558c0c8ee219 100644 --- a/samples/subsys/usb/uvc/sample.yaml +++ b/samples/subsys/usb/uvc/sample.yaml @@ -6,13 +6,11 @@ common: type: one_line regex: - "Waiting the host to select the video format" - tags: - - usb - - video tests: sample.subsys.usb.uvc: depends_on: - usbd + tags: usb video extra_args: SNIPPET=video-sw-generator integration_platforms: - nrf52840dk/nrf52840 @@ -25,12 +23,14 @@ tests: sample.subsys.usb.uvc.camera: depends_on: - usbd + tags: usb video filter: dt_chosen_enabled("zephyr,camera") integration_platforms: - arduino_nicla_vision/stm32h747xx/m7 sample.subsys.usb.uvc.encoder.h264: depends_on: - usbd + tags: usb video extra_configs: - CONFIG_VIDEO_ENCODER_H264=y extra_args: @@ -42,6 +42,7 @@ tests: sample.subsys.usb.uvc.encoder.jpeg: depends_on: - usbd + tags: usb video extra_configs: - CONFIG_VIDEO_ENCODER_JPEG=y extra_args: From c9f6ad399baeb618525d3bce36d07f839f29c3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:43 +0200 Subject: [PATCH 2860/3334] Revert "[nrf fromlist] boards: nordic: nrf54l15dk: Fix missing flash runner groups" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fe2e7d0129fa5d4ab4dbd13e0066e8cf02558ef9. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54l15dk/board.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/boards/nordic/nrf54l15dk/board.yml b/boards/nordic/nrf54l15dk/board.yml index ec33e29bef34..8d97ef356a91 100644 --- a/boards/nordic/nrf54l15dk/board.yml +++ b/boards/nordic/nrf54l15dk/board.yml @@ -23,9 +23,6 @@ runners: run: first groups: - boards: - - nrf54l15dk/nrf54l05/cpuapp - - nrf54l15dk/nrf54l10/cpuapp - - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuflpr @@ -38,9 +35,6 @@ runners: run: first groups: - boards: - - nrf54l15dk/nrf54l05/cpuapp - - nrf54l15dk/nrf54l10/cpuapp - - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuflpr @@ -53,9 +47,6 @@ runners: run: last groups: - boards: - - nrf54l15dk/nrf54l05/cpuapp - - nrf54l15dk/nrf54l10/cpuapp - - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l15/cpuflpr From b1ea2d889fb65fb967e4ccdbb93ae56822486351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:43 +0200 Subject: [PATCH 2861/3334] Revert "[nrf fromlist] kconfig: explicit invalid flash address acts on offset fallback value" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aa0c569a452102011ddc282de9e47f3d4c271419. Signed-off-by: Andrzej Głąbek --- Kconfig.zephyr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 89c45793bdfb..d25bd6ed6ad7 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -119,10 +119,10 @@ config FLASH_CODE_PARTITION_ADDRESS_INVALID config FLASH_LOAD_OFFSET # Only user-configurable when USE_DT_CODE_PARTITION is disabled hex "Kernel load offset" if !USE_DT_CODE_PARTITION - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) \ - if FLASH_CODE_PARTITION_ADDRESS_INVALID default $(sub_hex, $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)), \ - $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if USE_DT_CODE_PARTITION + $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if USE_DT_CODE_PARTITION && \ + !FLASH_CODE_PARTITION_ADDRESS_INVALID + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION default 0 help This option specifies the byte offset from the beginning of flash that From a6a2758e4d63f1d4a9c016bc02eede4d12bc5001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:44 +0200 Subject: [PATCH 2862/3334] Revert "[nrf fromlist] kconfig: fix flash load offset fallback on invalid partition address" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5b80922a4b229a4c0add79d1a2dd239f3070c82b. Signed-off-by: Andrzej Głąbek --- Kconfig.zephyr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index d25bd6ed6ad7..d56bea555aa0 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -122,7 +122,7 @@ config FLASH_LOAD_OFFSET default $(sub_hex, $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)), \ $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if USE_DT_CODE_PARTITION && \ !FLASH_CODE_PARTITION_ADDRESS_INVALID - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) if USE_DT_CODE_PARTITION default 0 help This option specifies the byte offset from the beginning of flash that From e5d96a273021d8817026c4fb042dfaa0d93dffb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:44 +0200 Subject: [PATCH 2863/3334] Revert "[nrf fromlist] kconfig: remove non-applicable build warning on invalid partition address" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 91ed7632190180867ac3b2d7740454dbad883760. Signed-off-by: Andrzej Głąbek --- Kconfig.zephyr | 1 - 1 file changed, 1 deletion(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index d56bea555aa0..2df77507f123 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -103,7 +103,6 @@ DT_CHOSEN_Z_FLASH := zephyr,flash config FLASH_CODE_PARTITION_ADDRESS_INVALID bool default y if XIP && $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) < FLASH_BASE_ADDRESS - depends on USE_DT_CODE_PARTITION select DEPRECATED help If this item is selected, it is likely selected because your board/SoC/base DTS files From 28e61c6be702dbb0a312a4becd013dd2ce227a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:44 +0200 Subject: [PATCH 2864/3334] Revert "[nrf fromlist] tests: storage: flash_map: Fix testing on sub-partitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e12a466761eecb74d3e3f1565cbacaa0324cdbc5. Signed-off-by: Andrzej Głąbek --- tests/subsys/storage/flash_map/src/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tests/subsys/storage/flash_map/src/main.c b/tests/subsys/storage/flash_map/src/main.c index aa47c9e0c70c..7075110bb0a7 100644 --- a/tests/subsys/storage/flash_map/src/main.c +++ b/tests/subsys/storage/flash_map/src/main.c @@ -169,17 +169,8 @@ ZTEST(flash_map, test_fixed_partition_node_macros) */ #if defined(CONFIG_TEST_FLASH_MAP_NODE_MACROS) /* Test against changes in API */ -#if DT_REG_ADDR(DT_PARENT(SLOT1_PARTITION_NODE)) - /* Sub-partition handling */ zassert_equal(FIXED_PARTITION_NODE_OFFSET(SLOT1_PARTITION_NODE), - (DT_REG_ADDR(SLOT1_PARTITION_NODE) - DT_REG_ADDR(DT_PARENT(SLOT1_PARTITION_NODE)))); -#else - /* Partition handling */ - zassert_equal(FIXED_PARTITION_NODE_OFFSET(SLOT1_PARTITION_NODE), - (DT_REG_ADDR(SLOT1_PARTITION_NODE) - DT_REG_ADDR(DT_PARENT( - DT_PARENT(SLOT1_PARTITION_NODE))))); -#endif - + DT_REG_ADDR(SLOT1_PARTITION_NODE)); zassert_equal(FIXED_PARTITION_NODE_SIZE(SLOT1_PARTITION_NODE), DT_REG_SIZE(SLOT1_PARTITION_NODE)); zassert_equal(FIXED_PARTITION_NODE_DEVICE(SLOT1_PARTITION_NODE), From 2e1775eab2007f2fad762913f046d467c8911a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:45 +0200 Subject: [PATCH 2865/3334] Revert "[nrf fromlist] tests: shell: shell_flash: Fix invalid partition handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 84262608b556028e028cde61c0b407070fc3796c. Signed-off-by: Andrzej Głąbek --- tests/subsys/shell/shell_flash/src/shell_flash_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/subsys/shell/shell_flash/src/shell_flash_test.c b/tests/subsys/shell/shell_flash/src/shell_flash_test.c index ff8d1bb0db93..f4c51f595146 100644 --- a/tests/subsys/shell/shell_flash/src/shell_flash_test.c +++ b/tests/subsys/shell/shell_flash/src/shell_flash_test.c @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -24,7 +23,7 @@ #else #define SOC_NV_FLASH_NODE DT_CHILD(DT_INST(0, zephyr_sim_flash), flash_sim_0) #endif /* CONFIG_ARCH_POSIX */ -#define FLASH_SIMULATOR_BASE_OFFSET FIXED_PARTITION_NODE_OFFSET(SOC_NV_FLASH_NODE) +#define FLASH_SIMULATOR_BASE_OFFSET DT_REG_ADDR(SOC_NV_FLASH_NODE) /* Test 'flash read' shell command */ ZTEST(shell_flash, test_flash_read) From 80afabc2ff6a38c522ce25cedf4f68198f616a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:45 +0200 Subject: [PATCH 2866/3334] Revert "[nrf fromlist] drivers: disk: flashdisk: Fix invalid partition handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 276acc01ab32c8e3be33cb2b75388f8a2faf54a4. Signed-off-by: Andrzej Głąbek --- drivers/disk/flashdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index 73832cdba358..bd5dc6a8f76a 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -523,7 +523,7 @@ DT_INST_FOREACH_STATUS_OKAY(DEFINE_FLASHDISKS_CACHE) .name = DT_INST_PROP(n, disk_name), \ }, \ .area_id = DT_FIXED_PARTITION_ID(PARTITION_PHANDLE(n)), \ - .offset = FIXED_PARTITION_NODE_OFFSET(PARTITION_PHANDLE(n)), \ + .offset = DT_REG_ADDR(PARTITION_PHANDLE(n)), \ .cache = flashdisk##n##_cache, \ .cache_size = sizeof(flashdisk##n##_cache), \ .size = DT_REG_SIZE(PARTITION_PHANDLE(n)), \ From a08eb7a5af6625fa34f0ee18f6266b01f32d8732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:46 +0200 Subject: [PATCH 2867/3334] Revert "[nrf fromlist] tests: drivers: flash_simulator: Fix invalid partition handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4cf767dcbd23fbe339914f9ce876e5016eb9762c. Signed-off-by: Andrzej Głąbek --- tests/drivers/flash_simulator/flash_sim_impl/src/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/drivers/flash_simulator/flash_sim_impl/src/main.c b/tests/drivers/flash_simulator/flash_sim_impl/src/main.c index 95dd3d92d92a..8fef1927a49a 100644 --- a/tests/drivers/flash_simulator/flash_sim_impl/src/main.c +++ b/tests/drivers/flash_simulator/flash_sim_impl/src/main.c @@ -7,7 +7,6 @@ #include #include #include -#include /* Warning: The test has been written for testing boards with single * instance of Flash Simulator device only. @@ -19,7 +18,7 @@ #else #define SOC_NV_FLASH_NODE DT_CHILD(DT_INST(0, zephyr_sim_flash), flash_sim_0) #endif /* CONFIG_ARCH_POSIX */ -#define FLASH_SIMULATOR_BASE_OFFSET FIXED_PARTITION_NODE_OFFSET(SOC_NV_FLASH_NODE) +#define FLASH_SIMULATOR_BASE_OFFSET DT_REG_ADDR(SOC_NV_FLASH_NODE) #define FLASH_SIMULATOR_ERASE_UNIT DT_PROP(SOC_NV_FLASH_NODE, erase_block_size) #define FLASH_SIMULATOR_PROG_UNIT DT_PROP(SOC_NV_FLASH_NODE, write_block_size) #define FLASH_SIMULATOR_FLASH_SIZE DT_REG_SIZE(SOC_NV_FLASH_NODE) From 861a2eb58ac875435c96b867b45b1c8f8baaf17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:46 +0200 Subject: [PATCH 2868/3334] Revert "[nrf fromlist] tests: drivers: flash: Fix invalid partition handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a1bf1cd236a74e8398c6fee65be97df41b1102a5. Signed-off-by: Andrzej Głąbek --- tests/drivers/flash/erase_blocks/src/main.c | 3 +-- tests/drivers/flash/interface_test/src/main.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/drivers/flash/erase_blocks/src/main.c b/tests/drivers/flash/erase_blocks/src/main.c index d44eed15e4de..57edfee8fced 100644 --- a/tests/drivers/flash/erase_blocks/src/main.c +++ b/tests/drivers/flash/erase_blocks/src/main.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -27,7 +26,7 @@ LOG_MODULE_REGISTER(test_flash); #endif #define TEST_FLASH_PART_OFFSET \ - FIXED_PARTITION_NODE_OFFSET(TEST_FLASH_PART_NODE) + DT_REG_ADDR(TEST_FLASH_PART_NODE) #define TEST_FLASH_PART_SIZE \ DT_REG_SIZE(TEST_FLASH_PART_NODE) diff --git a/tests/drivers/flash/interface_test/src/main.c b/tests/drivers/flash/interface_test/src/main.c index 8b2627b4f787..461323e8863d 100644 --- a/tests/drivers/flash/interface_test/src/main.c +++ b/tests/drivers/flash/interface_test/src/main.c @@ -7,7 +7,6 @@ #include #include #include -#include #ifdef CONFIG_BOOTLOADER_MCUBOOT #define TEST_FLASH_PART_NODE DT_NODELABEL(boot_partition) @@ -15,7 +14,7 @@ #define TEST_FLASH_PART_NODE DT_NODELABEL(slot1_partition) #endif -#define TEST_FLASH_PART_OFFSET FIXED_PARTITION_NODE_OFFSET(TEST_FLASH_PART_NODE) +#define TEST_FLASH_PART_OFFSET DT_REG_ADDR(TEST_FLASH_PART_NODE) #define TEST_FLASH_PART_SIZE DT_REG_SIZE(TEST_FLASH_PART_NODE) #define TEST_FLASH_CONTROLLER_NODE DT_MTD_FROM_FIXED_PARTITION(TEST_FLASH_PART_NODE) From 9730cc74713b98202595c3b3c8e7edb284cc4bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:46 +0200 Subject: [PATCH 2869/3334] Revert "[nrf fromlist] include: devicetree: fixed-partitions: Fix node handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0bfdaabb1afe0079e68fedb2800c6cb45005842f. Signed-off-by: Andrzej Głąbek --- include/zephyr/devicetree/fixed-partitions.h | 38 +---- tests/lib/devicetree/api/app.overlay | 83 +---------- tests/lib/devicetree/api/src/main.c | 146 ++----------------- 3 files changed, 20 insertions(+), 247 deletions(-) diff --git a/include/zephyr/devicetree/fixed-partitions.h b/include/zephyr/devicetree/fixed-partitions.h index 3a60f960013c..ff44e07ef644 100644 --- a/include/zephyr/devicetree/fixed-partitions.h +++ b/include/zephyr/devicetree/fixed-partitions.h @@ -5,7 +5,6 @@ /* * Copyright (c) 2020, Linaro Ltd. - * Copyright (c) 2026, Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ @@ -106,15 +105,9 @@ extern "C" { * &flash_controller { * flash@1000000 { * compatible = "soc-nv-flash"; - * reg = <0x1000000 0x50000> - * ranges = <0x0 0x1000000 0x50000> - * * partitions { * compatible = "fixed-partitions"; - * ranges; - * * storage_partition: partition@3a000 { - * reg = <0x3a000 0x8000> * label = "storage"; * }; * }; @@ -137,20 +130,8 @@ extern "C" { * @return the partition's offset plus the base address of the flash * node containing it. */ - -/* - * The COND_CODE_0 ranges part handles invalid devices where they wrongly do not inherit the - * parent's address and wrongly start at address 0x0 which was a bug that was fixed post Zephyr - * 4.3, this extra handling can be removed in Zephyr 4.6 or newer - */ -#define DT_FIXED_PARTITION_ADDR(node_id) \ - COND_CODE_0(DT_NODE_HAS_COMPAT(DT_PARENT(node_id), fixed_subpartitions), \ - (COND_CODE_0(DT_NUM_RANGES(DT_GPARENT(node_id)), \ - (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(node_id))), \ - (DT_REG_ADDR(node_id)))), \ - (COND_CODE_0(DT_NUM_RANGES(DT_GPARENT(DT_PARENT(node_id))), \ - (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(node_id))), \ - (DT_REG_ADDR(node_id))))) +#define DT_FIXED_PARTITION_ADDR(node_id) \ + (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(node_id))) /** * @brief Test if fixed-subpartitions compatible node exists @@ -189,12 +170,9 @@ extern "C" { * &flash_controller { * flash@1000000 { * compatible = "soc-nv-flash"; - * reg = <0x1000000 0x50000> - * ranges = <0x0 0x1000000 0x50000> * * partitions { * compatible = "fixed-partitions"; - * ranges; * * slot0_partition: partition@10000 { * compatible = "fixed-subpartitions"; @@ -228,16 +206,8 @@ extern "C" { * @return the subpartition's offset plus the base address of the flash * node containing it. */ - -/* - * The COND_CODE_0 part handles invalid devices where they wrongly do not inherit the parent's - * address and wrongly start at address 0x0 which was a bug that was fixed post Zephyr 4.3, this - * extra handling can be removed in Zephyr 4.6 or newer - */ -#define DT_FIXED_SUBPARTITION_ADDR(node_id) \ - COND_CODE_0(DT_NUM_RANGES(DT_GPARENT(DT_PARENT(node_id))), \ - (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(DT_PARENT(node_id)))), \ - (DT_REG_ADDR(node_id))) +#define DT_FIXED_SUBPARTITION_ADDR(node_id) \ + (DT_REG_ADDR(node_id) + DT_REG_ADDR(DT_GPARENT(DT_PARENT(node_id)))) /** * @} diff --git a/tests/lib/devicetree/api/app.overlay b/tests/lib/devicetree/api/app.overlay index ecbe17df3e78..95a073ec8e63 100644 --- a/tests/lib/devicetree/api/app.overlay +++ b/tests/lib/devicetree/api/app.overlay @@ -886,14 +886,6 @@ #address-cells = <1>; #size-cells = <1>; - /* - * The below specifies an invalid setup whereby partitions wrongly do not - * inherit the parent node's address space and specify that the partitions - * start at absolute address 0x0 onwards, this has been fixed post Zephyr - * 4.3 and is only here to ensure macros do not break for out of tree - * users so that they have time to fix their DTS files, it will be removed - * in Zephyr 4.6 or newer. - */ flash@20000000 { compatible = "soc-nv-flash"; reg = <0x20000000 0x100>; @@ -903,51 +895,6 @@ #address-cells = <1>; #size-cells = <1>; - partition@0 { - reg = <0x0 0xc0>; - label = "test-partition-0-deprecated"; - }; - - partition@c0 { - reg = <0xc0 0x40>; - label = "test-partition-1-deprecated"; - }; - - partition@100 { - compatible = "fixed-subpartitions"; - label = "test-subpartitions-deprecated"; - reg = <0x00000100 0x100>; - ranges = <0x0 0x100 0x100>; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "test-subpartition-0-deprecated"; - reg = <0x00000000 0x40>; - }; - - partition@40 { - label = "test-subpartition-1-deprecated"; - reg = <0x00000040 0xc0>; - }; - }; - }; - }; - - /* The below device correctly inherits the parent's address space */ - flash@20001000 { - compatible = "soc-nv-flash"; - reg = <0x20001000 0x200>; - ranges = <0x0 0x20001000 0x200>; - #address-cells = <1>; - #size-cells = <1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - partition@0 { reg = <0x0 0xc0>; label = "test-partition-0"; @@ -980,42 +927,14 @@ }; }; - /* - * The below specifies an invalid setup whereby partitions wrongly do not - * inherit the parent node's address space and specify that the partitions - * start at absolute address 0x0 onwards, this has been fixed post Zephyr - * 4.3 and is only here to ensure macros do not break for out of tree - * users so that they have time to fix their DTS files, it will be removed - * in Zephyr 4.6 or newer. - */ test-mtd@33221100 { - reg = <0x33221100 0x70000>; + reg = <0x33221100 0x1000>; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - partition@6ff80 { - reg = <0x6ff80 0x80>; - label = "test-partition-2-deprecated"; - }; - }; - }; - - /* The below device correctly inherits the parent's address space */ - test-mtd@33291100 { - reg = <0x33291100 0x70000>; - ranges = <0x0 0x33291100 0x70000>; - #address-cells = <1>; - #size-cells = <1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - partition@6ff80 { reg = <0x6ff80 0x80>; label = "test-partition-2"; diff --git a/tests/lib/devicetree/api/src/main.c b/tests/lib/devicetree/api/src/main.c index eb06c570e116..fd8bd88085ff 100644 --- a/tests/lib/devicetree/api/src/main.c +++ b/tests/lib/devicetree/api/src/main.c @@ -97,37 +97,19 @@ #define TEST_RANGES_EMPTY DT_NODELABEL(test_ranges_empty) #define TEST_MTD_0 DT_PATH(test, test_mtd_ffeeddcc) +#define TEST_MTD_1 DT_PATH(test, test_mtd_33221100) -#define TEST_MTD_1_DEPRECATED DT_PATH(test, test_mtd_33221100) +#define TEST_MEM_0 DT_CHILD(TEST_MTD_0, flash_20000000) -#define TEST_MEM_0_DEPRECATED DT_CHILD(TEST_MTD_0, flash_20000000) +#define TEST_PARTITION_0 DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, partition_0) +#define TEST_PARTITION_1 DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, partition_c0) +#define TEST_PARTITION_2 DT_PATH(test, test_mtd_33221100, partitions, partition_6ff80) -#define TEST_PARTITION_0_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ - partition_0) -#define TEST_PARTITION_1_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ - partition_c0) -#define TEST_PARTITION_2_DEPRECATED DT_PATH(test, test_mtd_33221100, partitions, partition_6ff80) - -#define TEST_SUBPARTITION_COMBINED_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, \ - partitions, partition_100) -#define TEST_SUBPARTITION_0_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, \ - partitions, partition_100, partition_0) -#define TEST_SUBPARTITION_1_DEPRECATED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, \ - partitions, partition_100, partition_40) - -#define TEST_MTD_1 DT_PATH(test, test_mtd_33291100) - -#define TEST_MEM_0 DT_CHILD(TEST_MTD_0, flash_20001000) - -#define TEST_PARTITION_0 DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, partition_0) -#define TEST_PARTITION_1 DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, partition_c0) -#define TEST_PARTITION_2 DT_PATH(test, test_mtd_33291100, partitions, partition_6ff80) - -#define TEST_SUBPARTITION_COMBINED DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, \ +#define TEST_SUBPARTITION_COMBINED DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ partition_100) -#define TEST_SUBPARTITION_0 DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, \ +#define TEST_SUBPARTITION_0 DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ partition_100, partition_0) -#define TEST_SUBPARTITION_1 DT_PATH(test, test_mtd_ffeeddcc, flash_20001000, partitions, \ +#define TEST_SUBPARTITION_1 DT_PATH(test, test_mtd_ffeeddcc, flash_20000000, partitions, \ partition_100, partition_40) #define ZEPHYR_USER DT_PATH(zephyr_user) @@ -3296,107 +3278,13 @@ ZTEST(devicetree_api, test_mbox) DT_NODELABEL(test_mbox_zero_cell)), ""); } -/* - * Tests that invalid but accidentally working behaviour does not break out of tree users, to be - * removed in Zephyr 4.6 or newer - */ -ZTEST(devicetree_api, test_fixed_partitions_deprecated) -{ - /* Test finding fixed partitions by the 'label' property. */ - zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_0_deprecated)); - zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_1_deprecated)); - zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_2_deprecated)); - zassert_true(DT_SAME_NODE(TEST_PARTITION_0_DEPRECATED, - DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_0_deprecated))); - zassert_true(DT_SAME_NODE(TEST_PARTITION_1_DEPRECATED, - DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_1_deprecated))); - zassert_true(DT_SAME_NODE(TEST_PARTITION_2_DEPRECATED, - DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_2_deprecated))); - - zassert_true(DT_FIXED_PARTITION_EXISTS(TEST_PARTITION_0_DEPRECATED)); - zassert_true(DT_FIXED_PARTITION_EXISTS(TEST_PARTITION_1_DEPRECATED)); - zassert_true(DT_FIXED_PARTITION_EXISTS(TEST_PARTITION_2_DEPRECATED)); - - /* There should not be a node with `label = "test_partition_3_deprecated"`. */ - zassert_false(DT_HAS_FIXED_PARTITION_LABEL(test_partition_3_deprecated)); - zassert_false(DT_NODE_EXISTS( - DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_3_deprecated))); - - /* Test DT_MTD_FROM_FIXED_PARTITION. */ - zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION(TEST_PARTITION_0_DEPRECATED))); - zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION(TEST_PARTITION_1_DEPRECATED))); - zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION(TEST_PARTITION_2_DEPRECATED))); - - zassert_true(DT_SAME_NODE(TEST_MTD_0, DT_MTD_FROM_FIXED_PARTITION( - TEST_PARTITION_0_DEPRECATED))); - zassert_true(DT_SAME_NODE(TEST_MTD_0, DT_MTD_FROM_FIXED_PARTITION( - TEST_PARTITION_1_DEPRECATED))); - zassert_true(DT_SAME_NODE(TEST_MTD_1_DEPRECATED, DT_MTD_FROM_FIXED_PARTITION( - TEST_PARTITION_2_DEPRECATED))); - - /* Test DT_MEM_FROM_FIXED_PARTITION. */ - zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_PARTITION(TEST_PARTITION_0_DEPRECATED))); - zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_PARTITION(TEST_PARTITION_1_DEPRECATED))); - zassert_false(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_PARTITION(TEST_PARTITION_2_DEPRECATED))); - - zassert_true(DT_SAME_NODE(TEST_MEM_0_DEPRECATED, DT_MEM_FROM_FIXED_PARTITION( - TEST_PARTITION_0_DEPRECATED))); - zassert_true(DT_SAME_NODE(TEST_MEM_0_DEPRECATED, DT_MEM_FROM_FIXED_PARTITION( - TEST_PARTITION_1_DEPRECATED))); - - /* Test DT_FIXED_PARTITION_ADDR. */ - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_0_DEPRECATED), 0x20000000); - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_1_DEPRECATED), 0x200000c0); - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2_DEPRECATED), 0x33291080); -} - -ZTEST(devicetree_api, test_fixed_subpartitions_deprecated) -{ - zassert_true(DT_FIXED_PARTITION_EXISTS(TEST_SUBPARTITION_COMBINED_DEPRECATED)); - zassert_true(DT_FIXED_SUBPARTITION_EXISTS(TEST_SUBPARTITION_0_DEPRECATED)); - zassert_true(DT_FIXED_SUBPARTITION_EXISTS(TEST_SUBPARTITION_1_DEPRECATED)); - - /* Test DT_MEM_FROM_FIXED_SUBPARTITION. */ - zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_PARTITION( - TEST_SUBPARTITION_COMBINED_DEPRECATED))); - zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_SUBPARTITION( - TEST_SUBPARTITION_0_DEPRECATED))); - zassert_true(DT_NODE_EXISTS(DT_MEM_FROM_FIXED_SUBPARTITION( - TEST_SUBPARTITION_1_DEPRECATED))); - - /* Test DT_MTD_FROM_FIXED_SUBPARTITION. */ - zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_PARTITION( - TEST_SUBPARTITION_COMBINED_DEPRECATED))); - zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_SUBPARTITION( - TEST_SUBPARTITION_0_DEPRECATED))); - zassert_true(DT_NODE_EXISTS(DT_MTD_FROM_FIXED_SUBPARTITION( - TEST_SUBPARTITION_1_DEPRECATED))); - zassert_true(DT_SAME_NODE( - DT_MTD_FROM_FIXED_PARTITION(TEST_SUBPARTITION_COMBINED_DEPRECATED), - DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_1_DEPRECATED))); - - /* Test DT_FIXED_SUBPARTITION_ADDR. */ - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED_DEPRECATED), 0x20000100); - zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0_DEPRECATED), - DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED_DEPRECATED)); - zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0_DEPRECATED), 0x20000100); - zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_1_DEPRECATED), 0x20000140); - - /* Check sizes match */ - zassert_equal(DT_REG_SIZE(TEST_SUBPARTITION_COMBINED_DEPRECATED), - (DT_REG_SIZE(TEST_SUBPARTITION_0_DEPRECATED) + - DT_REG_SIZE(TEST_SUBPARTITION_1_DEPRECATED))); - zassert_equal(DT_REG_SIZE(TEST_SUBPARTITION_COMBINED_DEPRECATED), - (DT_REG_SIZE(TEST_SUBPARTITION_0_DEPRECATED) + - DT_REG_SIZE(TEST_SUBPARTITION_1_DEPRECATED))); -} - ZTEST(devicetree_api, test_fixed_partitions) { /* Test finding fixed partitions by the 'label' property. */ zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_0)); zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_1)); zassert_true(DT_HAS_FIXED_PARTITION_LABEL(test_partition_2)); + zassert_true(DT_SAME_NODE(TEST_PARTITION_0, DT_NODE_BY_FIXED_PARTITION_LABEL(test_partition_0))); zassert_true(DT_SAME_NODE(TEST_PARTITION_1, @@ -3434,9 +3322,9 @@ ZTEST(devicetree_api, test_fixed_partitions) zassert_true(DT_SAME_NODE(TEST_MEM_0, DT_MEM_FROM_FIXED_PARTITION(TEST_PARTITION_1))); /* Test DT_FIXED_PARTITION_ADDR. */ - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_0), 0x20001000); - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_1), 0x200010c0); - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2), 0x33301080); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_0), 0x20000000); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_1), 0x200000c0); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_PARTITION_2), 0x33291080); /* Test that all DT_FIXED_PARTITION_ID are defined and unique. */ #define FIXED_PARTITION_ID_COMMA(node_id) DT_FIXED_PARTITION_ID(node_id), @@ -3444,8 +3332,6 @@ ZTEST(devicetree_api, test_fixed_partitions) static const int ids[] = { DT_FOREACH_STATUS_OKAY_VARGS(fixed_partitions, DT_FOREACH_CHILD, FIXED_PARTITION_ID_COMMA) - DT_FOREACH_STATUS_OKAY_VARGS(fixed_subpartitions, DT_FOREACH_CHILD, - FIXED_PARTITION_ID_COMMA) }; bool found[ARRAY_SIZE(ids)] = { false }; @@ -3478,17 +3364,15 @@ ZTEST(devicetree_api, test_fixed_subpartitions) DT_MTD_FROM_FIXED_SUBPARTITION(TEST_SUBPARTITION_1))); /* Test DT_FIXED_SUBPARTITION_ADDR. */ - zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED), 0x20001100); + zassert_equal(DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED), 0x20000100); zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0), DT_FIXED_PARTITION_ADDR(TEST_SUBPARTITION_COMBINED)); - zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0), 0x20001100); - zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_1), 0x20001140); + zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_0), 0x20000100); + zassert_equal(DT_FIXED_SUBPARTITION_ADDR(TEST_SUBPARTITION_1), 0x20000140); /* Check sizes match */ zassert_equal(DT_REG_SIZE(TEST_SUBPARTITION_COMBINED), (DT_REG_SIZE(TEST_SUBPARTITION_0) + DT_REG_SIZE(TEST_SUBPARTITION_1))); - zassert_equal(DT_REG_SIZE(TEST_SUBPARTITION_COMBINED), - (DT_REG_SIZE(TEST_SUBPARTITION_0) + DT_REG_SIZE(TEST_SUBPARTITION_1))); } ZTEST(devicetree_api, test_string_token) From bd0f0dd0516d692d2f6bd1cbe3b1350f55b20033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:47 +0200 Subject: [PATCH 2870/3334] Revert "[nrf fromtree] drivers: mbox: nrf_vevif_task_rx: Fix indexing in rx_set_enabled" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6e1d8263225047eb1d7fb4cf3444e0a166465b9e. Signed-off-by: Andrzej Głąbek --- drivers/mbox/mbox_nrf_vevif_task_rx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mbox/mbox_nrf_vevif_task_rx.c b/drivers/mbox/mbox_nrf_vevif_task_rx.c index 1ddc023312cd..8afe9eeb50bb 100644 --- a/drivers/mbox/mbox_nrf_vevif_task_rx.c +++ b/drivers/mbox/mbox_nrf_vevif_task_rx.c @@ -39,7 +39,7 @@ static const uint8_t vevif_irqs[VEVIF_TASKS_NUM] = { static void vevif_task_rx_isr(const void *parameter) { - uint8_t channel = *(const uint8_t *)parameter; + uint8_t channel = *(uint8_t *)parameter; uint8_t idx = channel - TASKS_IDX_MIN; nrf_vpr_csr_vevif_tasks_clear(BIT(channel)); @@ -65,13 +65,12 @@ 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; } - uint8_t idx = id - TASKS_IDX_MIN; - cbs.cb[idx] = cb; cbs.user_data[idx] = user_data; @@ -81,13 +80,12 @@ static int vevif_task_rx_register_callback(const struct device *dev, uint32_t id 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; } - uint8_t idx = id - vevif_irqs[0]; - if (enable) { if ((cbs.enabled_mask & BIT(id)) != 0U) { return -EALREADY; From 64a38ad5a6cd9565b53f80a8cc9d1ba2f3d231e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:47 +0200 Subject: [PATCH 2871/3334] Revert "[nrf fromtree] dts: riscv: nordic: add definitions for vevif_rx for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 583736dc88828eb84ba0b97b9e5fede016de6199. Signed-off-by: Andrzej Głąbek --- dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi b/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi index 7995093515f5..2aec31f3a282 100644 --- a/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi +++ b/dts/riscv/nordic/nrf7120_enga_cpuflpr.dtsi @@ -32,24 +32,6 @@ clic: &cpuflpr_clic {}; }; }; -&cpuflpr { - cpuflpr_vevif_rx: mailbox { - compatible = "nordic,nrf-vevif-task-rx"; - status = "disabled"; - interrupt-parent = <&cpuflpr_clic>; - interrupts = <16 NRF_DEFAULT_IRQ_PRIORITY>, - <17 NRF_DEFAULT_IRQ_PRIORITY>, - <18 NRF_DEFAULT_IRQ_PRIORITY>, - <19 NRF_DEFAULT_IRQ_PRIORITY>, - <20 NRF_DEFAULT_IRQ_PRIORITY>, - <21 NRF_DEFAULT_IRQ_PRIORITY>, - <22 NRF_DEFAULT_IRQ_PRIORITY>; - #mbox-cells = <1>; - nordic,tasks = <7>; - nordic,tasks-mask = <0x007f0000>; - }; -}; - &cpuflpr_vpr { cpuflpr_vevif_tx: mailbox { compatible = "nordic,nrf-vevif-event-tx"; From 49f1404ef51aa205dcf3b3bf2fb8a88a5b3570e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:47 +0200 Subject: [PATCH 2872/3334] Revert "[nrf fromtree] dts: use lowercase hex values in DTS files." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a1fc171a6fece30aff57bcbf5b7b784b19993094. Signed-off-by: Andrzej Głąbek --- .../adafruit_feather_esp32s2_tft.dts | 6 +- .../adafruit_feather_esp32s2_tft_reverse.dts | 6 +- .../adafruit_feather_esp32s3_tft_procpu.dts | 6 +- ...uit_feather_esp32s3_tft_reverse_procpu.dts | 6 +- .../adafruit_macropad_rp2040.dts | 2 +- .../nrf52_adafruit_feather.dts | 4 +- .../trinket_m0/adafruit_trinket_m0.dts | 2 +- .../adi/apard32690/apard32690_max32690_m4.dts | 6 +- .../eval_adin1110ebz/adi_eval_adin1110ebz.dts | 6 +- .../eval_adin2111ebz/adi_eval_adin2111ebz.dts | 8 +- .../aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi | 4 +- .../aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi | 4 +- .../alientek/dnesp32s3b/dnesp32s3b_procpu.dts | 2 +- boards/ambiq/apollo510_evb/apollo510_evb.dts | 6 +- boards/amd/versal2_rpu/versal2_rpu-qemu.dts | 42 +-- .../amd/versalnet_apu/versalnet_apu-qemu.dts | 28 +- boards/arduino/mkrzero/arduino_mkrzero.dts | 2 +- .../nano_33_iot/arduino_nano_33_iot.dts | 2 +- .../nano_matter/arduino_nano_matter.dts | 6 +- .../portenta_c33/arduino_portenta_c33.dts | 4 +- .../arduino_portenta_h7_stm32h747xx_m7.dts | 4 +- boards/arduino/uno_r4/arduino_uno_r4.dts | 2 +- boards/arm/mps2/mps2_an521_cpu1.dts | 4 +- boards/bbc/microbit_v2/bbc_microbit_v2.dts | 10 +- .../blueclover_plt_demo_v2_nrf52832.dts | 4 +- .../beagleconnect_freedom.dts | 2 +- boards/blues/swan_r5/swan_r5.dts | 4 +- .../bytesatwork/bytesensi_l/bytesensi_l.dts | 4 +- .../croxel_cx1825/croxel_cx1825_nrf52840.dts | 4 +- .../ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts | 4 +- .../esp32s3_eye/esp32s3_eye_procpu.dts | 8 +- .../bl5340_dvk_nrf5340_cpuapp_common.dtsi | 2 +- .../bl5340_dvk_nrf5340_cpunet_common.dtsi | 2 +- boards/ezurio/bl652_dvk/bl652_dvk.dts | 4 +- boards/ezurio/bl653_dvk/bl653_dvk.dts | 10 +- boards/ezurio/bt610/bt610.dts | 12 +- boards/ezurio/mg100/mg100.dts | 8 +- .../pinnacle_100_dvk/pinnacle_100_dvk.dts | 8 +- boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts | 6 +- boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts | 8 +- .../quill_nrf52840_mesh_common.dtsi | 16 +- boards/focaltech/ft9001_eval/ft9001_eval.dts | 2 +- .../heltec_wireless_tracker_procpu.dts | 28 +- boards/holyiot/yj17095/holyiot_yj17095.dts | 2 +- .../cyw920829m2evk_02-memory_map.dtsi | 4 +- .../kit_pse84_ai/kit_pse84_ai_memory_map.dtsi | 2 +- boards/kws/pico2_spe/pico2_spe.dtsi | 2 +- boards/kws/pico_spe/pico_spe.dts | 2 +- .../lilygo/tdongle_s3/tdongle_s3_procpu.dts | 12 +- .../m5stack_atoms3/m5stack_atoms3_procpu.dts | 2 +- .../m5stickc_plus/m5stickc_plus_procpu.dts | 2 +- .../makerdiary/nrf52832_mdk/nrf52832_mdk.dts | 4 +- boards/native/native_sim/native_sim.dts | 4 +- .../nordic/nrf21540dk/nrf21540dk_nrf52840.dts | 4 +- .../nordic/nrf52833dk/nrf52833dk_nrf52820.dts | 6 +- .../nordic/nrf52833dk/nrf52833dk_nrf52833.dts | 6 +- .../nordic/nrf52840dk/nrf52840dk_nrf52811.dts | 2 +- boards/nordic/nrf52dk/nrf52dk_nrf52805.dts | 2 +- boards/nordic/nrf52dk/nrf52dk_nrf52810.dts | 2 +- boards/nordic/nrf52dk/nrf52dk_nrf52832.dts | 2 +- .../nrf5340_audio_dk_nrf5340_cpunet.dts | 4 +- .../nrf5340dk/nrf5340dk_nrf5340_cpunet.dts | 2 +- .../nrf7002dk/nrf7002dk_nrf5340_cpunet.dts | 2 +- .../nrf7120dk/nrf7120_cpuapp_common.dtsi | 6 +- .../nrf9280pdk_nrf9280-memory_map.dtsi | 8 +- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 2 +- boards/nordic/thingy52/thingy52_nrf52832.dts | 4 +- .../thingy53/thingy53_nrf5340_cpunet.dts | 2 +- boards/nxp/frdm_k22f/frdm_k22f.dts | 8 +- boards/nxp/frdm_mcxa153/frdm_mcxa153.dts | 4 +- boards/nxp/frdm_mcxa344/frdm_mcxa344.dts | 4 +- boards/nxp/frdm_mcxa577/frdm_mcxa577.dts | 4 +- boards/nxp/frdm_mcxc444/frdm_mcxc444.dts | 2 +- boards/nxp/frdm_mcxn236/frdm_mcxn236.dts | 4 +- boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi | 4 +- .../frdm_mcxn947_mcxn947_cpu0_ns.dts | 4 +- .../frdm_mcxw23/dts/bypass_first_32k.overlay | 2 +- boards/nxp/frdm_mcxw71/frdm_mcxw71.dts | 12 +- .../frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts | 8 +- .../nxp/imx95_evk/imx95_evk_mimx9596_m7.dts | 4 +- .../nxp/lpcxpresso55s28/lpcxpresso55s28.dts | 4 +- boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi | 4 +- .../mcxw23_evk/dts/bypass_first_32k.overlay | 2 +- .../mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts | 8 +- boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts | 4 +- boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts | 4 +- boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts | 4 +- .../mimxrt1060_evk_mimxrt1062_qspi_C.overlay | 6 +- boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi | 4 +- boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi | 4 +- .../mimxrt1170_evk_mimxrt1176_cm4_B.overlay | 4 +- .../mimxrt1170_evk_mimxrt1176_cm7_B.overlay | 4 +- boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi | 4 +- .../mimxrt700_evk_mimxrt798s_cm33_cpu0.dts | 4 +- .../dts/goworld_16880_lcm.overlay | 12 +- boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts | 8 +- boards/nxp/twr_kv58f220m/twr_kv58f220m.dts | 8 +- .../rv32m1_vega_openisa_rv32m1_ri5cy.dts | 2 +- boards/panasonic/pan1770_evb/pan1770_evb.dts | 4 +- boards/panasonic/pan1780_evb/pan1780_evb.dts | 4 +- boards/panasonic/pan1782_evb/pan1782_evb.dts | 10 +- .../pan1783_nrf5340_cpunet_common.dtsi | 2 +- boards/phytec/reel_board/reel_board.dts | 6 +- .../reel_board/reel_board_nrf52840_2.overlay | 2 +- .../pinetime_devkit0/pinetime_devkit0.dts | 10 +- .../decawave_dwm1001_dev.dts | 4 +- .../decawave_dwm3001cdk.dts | 6 +- .../raytac_an7002q_db_nrf5340_cpunet.dts | 2 +- ...tac_mdbt53_db_40_nrf5340_cpunet_common.dts | 2 +- ...ac_mdbt53v_db_40_nrf5340_cpunet_common.dts | 2 +- .../renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts | 2 +- .../dts/da14695_dk_usb_psram.overlay | 8 +- .../dts/da1469x_dk_pro_psram.overlay | 8 +- boards/renesas/ek_ra2a1/ek_ra2a1.dts | 2 +- boards/renesas/ek_ra4e2/ek_ra4e2.dts | 2 +- boards/renesas/ek_ra4m2/ek_ra4m2.dts | 2 +- boards/renesas/ek_ra4m3/ek_ra4m3.dts | 2 +- boards/renesas/ek_ra6e2/ek_ra6e2.dts | 2 +- boards/renesas/ek_ra6m1/ek_ra6m1.dts | 2 +- boards/renesas/ek_ra6m2/ek_ra6m2.dts | 2 +- boards/renesas/ek_ra6m3/ek_ra6m3.dts | 2 +- boards/renesas/ek_ra6m4/ek_ra6m4.dts | 4 +- boards/renesas/ek_ra6m5/ek_ra6m5.dts | 4 +- boards/renesas/ek_ra8d1/ek_ra8d1.dts | 4 +- boards/renesas/ek_ra8m1/ek_ra8m1.dts | 4 +- boards/renesas/ek_rx261/ek_rx261.dts | 2 +- boards/renesas/fpb_ra4e1/fpb_ra4e1.dts | 2 +- boards/renesas/fpb_ra6e1/fpb_ra6e1.dts | 2 +- boards/renesas/fpb_ra6e2/fpb_ra6e2.dts | 2 +- boards/renesas/fpb_rx261/fpb_rx261.dts | 2 +- boards/renesas/mck_ra8t1/mck_ra8t1.dts | 4 +- boards/renesas/rsk_rx130/rsk_rx130.dts | 2 +- boards/renesas/rza2m_evk/rza2m_evk.dts | 4 +- boards/renesas/voice_ra4e1/voice_ra4e1.dts | 2 +- boards/ruiside/art_pi/art_pi.dts | 10 +- .../ra8d1_vision_board/ra8d1_vision_board.dts | 2 +- boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts | 4 +- boards/seeed/xiao_mg24/xiao_mg24.dts | 6 +- .../abrobot_sh1106_72x40.overlay | 2 +- .../arduino_giga_display_shield.overlay | 30 +-- .../mimxrt595_evk_mimxrt595s_cm33.overlay | 4 +- .../lcd_par_s035/lcd_par_s035_8080.overlay | 12 +- .../lcd_par_s035/lcd_par_s035_spi.overlay | 12 +- .../m5stack_cardputer.overlay | 2 +- .../boards/rssk_ra2l1.overlay | 10 +- .../rtk0eg0019b01002bj.overlay | 6 +- .../st7789v_tl019fqv01.overlay | 8 +- .../st7789v_waveshare_240x240.overlay | 8 +- .../waveshare_epaper_gdeh0213b1.overlay | 6 +- .../waveshare_epaper_gdeh0213b72.overlay | 2 +- .../waveshare_epaper_gdeh029a1.overlay | 4 +- .../waveshare_epaper_gdew042t2-p.overlay | 10 +- .../waveshare_pico_lcd_1_14_display.overlay | 2 +- .../bg29_rb4420a/bg29_rb4420a.dts | 6 +- .../radio_boards/slwrb4180b/slwrb4180b.dts | 6 +- .../xg29_rb4412a/xg29_rb4412a.dts | 6 +- .../longan_nano/longan_nano-common.dtsi | 18 +- boards/sipeed/maix_m0s_dock/maix_m0s.dtsi | 4 +- .../sparkfun/micromod/micromod_nrf52840.dts | 4 +- .../st/stm32f429i_disc1/stm32f429i_disc1.dts | 2 +- .../stm32h573i_dk/stm32h573i_dk-common.dtsi | 6 +- .../stm32l562e_dk/stm32l562e_dk_common.dtsi | 6 +- boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts | 4 +- .../ubx_bmd300eval_nrf52832.dts | 4 +- .../ubx_bmd330eval_nrf52810.dts | 2 +- .../ubx_bmd360eval_nrf52811.dts | 2 +- .../ubx_evkannab1/ubx_evkannab1_nrf52832.dts | 4 +- .../ubx_evkninab1/ubx_evkninab1_nrf52832.dts | 4 +- .../ubx_evkninab4/ubx_evkninab4_nrf52833.dts | 10 +- .../ubx_evkninab5/ubx_evkninab5_mcxw716c.dts | 8 +- boards/waveshare/rp2040_geek/rp2040_geek.dts | 8 +- .../we/ophelia1ev/we_ophelia1ev_nrf52805.dts | 2 +- .../we/proteus2ev/we_proteus2ev_nrf52832.dts | 4 +- .../weact/mini_stm32h743/mini_stm32h743.dts | 20 +- .../weact/mini_stm32h7b0/mini_stm32h7b0.dts | 20 +- boards/witte/linum/linum.dts | 6 +- doc/contribute/style/style-example.dts | 16 +- dts/arc/synopsys/emsk.dtsi | 4 +- dts/arm/ambiq/ambiq_apollo3_blue.dtsi | 8 +- dts/arm/ambiq/ambiq_apollo3p_blue.dtsi | 10 +- dts/arm/ambiq/ambiq_apollo4p.dtsi | 16 +- dts/arm/ambiq/ambiq_apollo4p_blue.dtsi | 16 +- dts/arm/ambiq/ambiq_apollo510.dtsi | 4 +- dts/arm/atmel/samc2x.dtsi | 10 +- dts/arm/atmel/samd2x.dtsi | 14 +- dts/arm/atmel/samd5x.dtsi | 12 +- dts/arm/atmel/saml21.dtsi | 2 +- dts/arm/atmel/saml2x.dtsi | 10 +- dts/arm/atmel/samx7x.dtsi | 6 +- dts/arm/elan/em32fxxx.dtsi | 4 +- dts/arm/ene/kb106x/kb1064.dtsi | 12 +- dts/arm/ene/kb106x/kb106x.dtsi | 2 +- dts/arm/ene/kb1200.dtsi | 2 +- dts/arm/gd/gd32a50x/gd32a50x.dtsi | 2 +- dts/arm/gd/gd32e10x/gd32e10x.dtsi | 2 +- dts/arm/gd/gd32e50x/gd32e50x.dtsi | 2 +- dts/arm/gd/gd32f3x0/gd32f3x0.dtsi | 2 +- dts/arm/gd/gd32f403/gd32f403.dtsi | 2 +- dts/arm/gd/gd32f4xx/gd32f4xx.dtsi | 2 +- dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi | 4 +- dts/arm/intel_socfpga_std/socfpga.dtsi | 2 +- dts/arm/microchip/mec/mec1501hsz.dtsi | 12 +- dts/arm/microchip/mec/mec1727nsz.dtsi | 2 +- dts/arm/microchip/mec/mec172x_common.dtsi | 14 +- dts/arm/microchip/mec/mec172xnlj.dtsi | 2 +- dts/arm/microchip/mec/mec172xnsz.dtsi | 2 +- dts/arm/microchip/mec/mec5.dtsi | 2 +- .../pic32c/pic32cx_sg/common/pic32cx_sg.dtsi | 2 +- .../sam/sam_d5x_e5x/common/samd5xe5x.dtsi | 2 +- dts/arm/nuvoton/m46x.dtsi | 2 +- dts/arm/nuvoton/npck/npck-alts-map.dtsi | 8 +- dts/arm/nuvoton/npck/npck.dtsi | 12 +- dts/arm/nuvoton/npck/npck3.dtsi | 4 +- dts/arm/nuvoton/npck3m8k.dtsi | 4 +- dts/arm/nuvoton/npcx/npcx-alts-map.dtsi | 66 ++--- dts/arm/nuvoton/npcx/npcx.dtsi | 14 +- dts/arm/nuvoton/npcx/npcx4.dtsi | 14 +- .../nuvoton/npcx/npcx4/npcx4-alts-map.dtsi | 14 +- dts/arm/nuvoton/npcx/npcx7.dtsi | 6 +- .../nuvoton/npcx/npcx7/npcx7-alts-map.dtsi | 12 +- .../npcx/npcx7/npcx7-miwus-int-map.dtsi | 2 +- dts/arm/nuvoton/npcx/npcx9.dtsi | 10 +- .../nuvoton/npcx/npcx9/npcx9-alts-map.dtsi | 8 +- dts/arm/nuvoton/npcx4m3f.dtsi | 2 +- dts/arm/nuvoton/npcx4m8f.dtsi | 2 +- dts/arm/nuvoton/npcx7m6fb.dtsi | 4 +- dts/arm/nuvoton/npcx7m6fc.dtsi | 4 +- dts/arm/nuvoton/npcx7m7fc.dtsi | 4 +- dts/arm/nuvoton/npcx9m3f.dtsi | 2 +- dts/arm/nuvoton/npcx9m6f.dtsi | 2 +- dts/arm/nuvoton/npcx9m7f.dtsi | 2 +- dts/arm/nuvoton/npcx9m7fb.dtsi | 4 +- dts/arm/nuvoton/npcx9mfp.dtsi | 4 +- dts/arm/nxp/nxp_imx95_m7.dtsi | 2 +- dts/arm/nxp/nxp_k2x.dtsi | 16 +- dts/arm/nxp/nxp_k32l2b3.dtsi | 10 +- dts/arm/nxp/nxp_k6x.dtsi | 18 +- dts/arm/nxp/nxp_k8x.dtsi | 8 +- dts/arm/nxp/nxp_ke1xz.dtsi | 2 +- dts/arm/nxp/nxp_kl25z.dtsi | 8 +- dts/arm/nxp/nxp_kv5x.dtsi | 4 +- dts/arm/nxp/nxp_kw2xd.dtsi | 8 +- dts/arm/nxp/nxp_kw40z.dtsi | 12 +- dts/arm/nxp/nxp_kw41z.dtsi | 20 +- dts/arm/nxp/nxp_lpc11u6x.dtsi | 6 +- dts/arm/nxp/nxp_lpc54xxx.dtsi | 2 +- dts/arm/nxp/nxp_lpc55S0x_common.dtsi | 4 +- dts/arm/nxp/nxp_lpc55S1x_common.dtsi | 4 +- dts/arm/nxp/nxp_lpc55S2x_common.dtsi | 4 +- dts/arm/nxp/nxp_lpc55S3x_common.dtsi | 12 +- dts/arm/nxp/nxp_lpc55S6x_common.dtsi | 22 +- dts/arm/nxp/nxp_mcxa153.dtsi | 4 +- dts/arm/nxp/nxp_mcxa156.dtsi | 4 +- dts/arm/nxp/nxp_mcxa344.dtsi | 4 +- dts/arm/nxp/nxp_mcxaxx6_common.dtsi | 4 +- dts/arm/nxp/nxp_mcxc141.dtsi | 2 +- dts/arm/nxp/nxp_mcxc142.dtsi | 2 +- dts/arm/nxp/nxp_mcxc242.dtsi | 2 +- dts/arm/nxp/nxp_mcxc444.dtsi | 2 +- dts/arm/nxp/nxp_mcxc_common.dtsi | 12 +- dts/arm/nxp/nxp_mcxe24x_common.dtsi | 4 +- dts/arm/nxp/nxp_mcxn23x_common.dtsi | 4 +- dts/arm/nxp/nxp_mcxw72.dtsi | 8 +- dts/arm/nxp/nxp_rt1010.dtsi | 22 +- dts/arm/nxp/nxp_rt10xx.dtsi | 66 ++--- dts/arm/nxp/nxp_rt118x.dtsi | 54 ++-- dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi | 4 +- dts/arm/nxp/nxp_rt11xx.dtsi | 6 +- dts/arm/nxp/nxp_rt5xx_common.dtsi | 4 +- dts/arm/nxp/nxp_rt7xx_common.dtsi | 4 +- dts/arm/nxp/nxp_rw6xx_common.dtsi | 4 +- dts/arm/nxp/nxp_s32k344_m7.dtsi | 36 +-- dts/arm/nxp/nxp_s32k566.dtsi | 36 +-- dts/arm/nxp/nxp_s32z27x_r52.dtsi | 26 +- dts/arm/realtek/amebad/amebad.dtsi | 2 +- dts/arm/realtek/ec/rts5912.dtsi | 36 +-- dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi | 4 +- dts/arm/renesas/ra/ra8/ra8x1.dtsi | 4 +- dts/arm/renesas/ra/ra8/ra8x2.dtsi | 6 +- dts/arm/renesas/rz/rza/r7s9210.dtsi | 2 +- dts/arm/renesas/rz/rzg/r9a07g044.dtsi | 2 +- dts/arm/renesas/rz/rzg/r9a08g045.dtsi | 6 +- dts/arm/renesas/rz/rzn/r9a07g084.dtsi | 14 +- dts/arm/renesas/rz/rzt/r9a07g074.dtsi | 14 +- dts/arm/renesas/rz/rzt/r9a07g075.dtsi | 14 +- dts/arm/renesas/rz/rzv/r9a07g054.dtsi | 2 +- dts/arm/renesas/rz/rzv/r9a09g056.dtsi | 6 +- dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi | 2 +- dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi | 4 +- dts/arm/renesas/smartbond/da1469x.dtsi | 10 +- dts/arm/silabs/gg11/efm32gg11.dtsi | 4 +- .../silabs/gg11/efm32gg11b820f2048gl192.dtsi | 2 +- dts/arm/silabs/gg12/efm32gg12.dtsi | 4 +- dts/arm/silabs/siwg917.dtsi | 12 +- dts/arm/silabs/xg12/xg12.dtsi | 4 +- dts/arm/silabs/xg13/efr32xg13.dtsi | 4 +- dts/arm/st/f1/stm32f103Xc.dtsi | 2 +- dts/arm/st/f3/stm32f302.dtsi | 2 +- dts/arm/ti/cc32xx.dtsi | 2 +- dts/arm/ti/mspm0/g/mspm0g1518.dtsi | 2 +- dts/arm/ti/mspm0/g/mspm0g1519.dtsi | 2 +- dts/arm/ti/mspm0/g/mspm0g3518.dtsi | 2 +- dts/arm/ti/mspm0/g/mspm0g3519.dtsi | 2 +- dts/arm/xilinx/zynq7000.dtsi | 4 +- dts/arm64/intel/intel_socfpga_agilex5.dtsi | 30 +-- dts/arm64/nxp/nxp_mimx8mm_a53.dtsi | 2 +- dts/arm64/nxp/nxp_mimx8mn_a53.dtsi | 2 +- dts/arm64/nxp/nxp_mimx8mp_a53.dtsi | 2 +- dts/riscv/andes/andes_v5_ae350.dtsi | 6 +- dts/riscv/bflb/bl60x.dtsi | 2 +- dts/riscv/bflb/bl61x.dtsi | 6 +- dts/riscv/bflb/bl70x.dtsi | 2 +- dts/riscv/efinix/sapphire_soc.dtsi | 4 +- .../espressif/esp32c2/esp32c2_common.dtsi | 6 +- .../espressif/esp32c3/esp32c3_common.dtsi | 6 +- .../espressif/esp32c6/esp32c6_common.dtsi | 16 +- .../espressif/esp32h2/esp32h2_common.dtsi | 18 +- dts/riscv/gd/gd32vf103.dtsi | 2 +- dts/riscv/ite/it81xx2.dtsi | 2 +- dts/riscv/ite/it82xx2.dtsi | 6 +- dts/riscv/microchip/mpfs.dtsi | 2 +- dts/riscv/telink/telink_b91.dtsi | 10 +- dts/riscv/wch/ch32v0/ch32v006.dtsi | 4 +- dts/riscv/wch/ch32v203/ch32v203.dtsi | 4 +- dts/riscv/wch/ch32v203/ch32v203c8t.dtsi | 2 +- dts/riscv/wch/ch32v203/ch32v203rbt.dtsi | 2 +- dts/riscv/wch/ch32v208/ch32v208.dtsi | 6 +- dts/riscv/wch/ch32v303/ch32v303.dtsi | 6 +- dts/riscv/wch/ch32v307/ch32v307.dtsi | 6 +- dts/rx/renesas/r5f51308axfp.dtsi | 2 +- dts/rx/renesas/r5f52618bgfp.dtsi | 2 +- dts/rx/renesas/r5f526tfddfp.dtsi | 2 +- dts/rx/renesas/rx-qemu.dtsi | 6 +- dts/rx/renesas/rx130-common.dtsi | 208 +++++++-------- dts/rx/renesas/rx261-common.dtsi | 182 ++++++------- dts/rx/renesas/rx26t-common.dtsi | 252 +++++++++--------- .../espressif/partitions_0x0_amp_128M.dtsi | 16 +- .../espressif/partitions_0x0_amp_16M.dtsi | 16 +- .../espressif/partitions_0x0_amp_2M.dtsi | 12 +- .../espressif/partitions_0x0_amp_32M.dtsi | 16 +- .../espressif/partitions_0x0_amp_4M.dtsi | 12 +- .../espressif/partitions_0x0_amp_64M.dtsi | 16 +- .../espressif/partitions_0x0_amp_8M.dtsi | 16 +- .../partitions_0x0_default_128M.dtsi | 12 +- .../espressif/partitions_0x0_default_16M.dtsi | 12 +- .../espressif/partitions_0x0_default_2M.dtsi | 12 +- .../espressif/partitions_0x0_default_32M.dtsi | 12 +- .../espressif/partitions_0x0_default_4M.dtsi | 12 +- .../espressif/partitions_0x0_default_64M.dtsi | 12 +- .../espressif/partitions_0x0_default_8M.dtsi | 12 +- .../espressif/partitions_0x1000_amp_128M.dtsi | 16 +- .../espressif/partitions_0x1000_amp_16M.dtsi | 16 +- .../espressif/partitions_0x1000_amp_2M.dtsi | 12 +- .../espressif/partitions_0x1000_amp_32M.dtsi | 16 +- .../espressif/partitions_0x1000_amp_4M.dtsi | 12 +- .../espressif/partitions_0x1000_amp_64M.dtsi | 16 +- .../espressif/partitions_0x1000_amp_8M.dtsi | 16 +- .../partitions_0x1000_default_128M.dtsi | 12 +- .../partitions_0x1000_default_16M.dtsi | 12 +- .../partitions_0x1000_default_2M.dtsi | 12 +- .../partitions_0x1000_default_32M.dtsi | 12 +- .../partitions_0x1000_default_4M.dtsi | 12 +- .../partitions_0x1000_default_64M.dtsi | 12 +- .../partitions_0x1000_default_8M.dtsi | 12 +- dts/vendor/nordic/nrf52840_partition.dtsi | 4 +- .../nordic/nrf52840_partition_uf2_sdv6.dtsi | 2 +- .../nordic/nrf52840_partition_uf2_sdv7.dtsi | 2 +- dts/vendor/nordic/nrf54h20.dtsi | 24 +- .../nordic/nrf54l10_cpuapp_ns_partition.dtsi | 8 +- .../nordic/nrf54l15_cpuapp_ns_partition.dtsi | 4 +- dts/vendor/nordic/nrf54lm20a.dtsi | 4 +- .../nrf54lm20a_cpuapp_ns_partition.dtsi | 8 +- .../nordic/nrf7120_cpuapp_ns_partition.dtsi | 8 +- .../raspberrypi/partitions_2M_sysbuild.dtsi | 4 +- dts/x86/intel/alder_lake.dtsi | 14 +- dts/x86/intel/raptor_lake_p.dtsi | 2 +- dts/xtensa/espressif/esp32/esp32_common.dtsi | 6 +- .../espressif/esp32s2/esp32s2_common.dtsi | 2 +- .../espressif/esp32s3/esp32s3_common.dtsi | 2 +- dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi | 14 +- dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi | 18 +- dts/xtensa/intel/intel_adsp_ace30.dtsi | 18 +- dts/xtensa/intel/intel_adsp_ace40.dtsi | 18 +- dts/xtensa/intel/intel_adsp_cavs.dtsi | 2 +- dts/xtensa/intel/intel_adsp_cavs25.dtsi | 26 +- dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi | 16 +- .../blinky_pwm/boards/frdm_mcxc242.overlay | 4 +- .../rzg3s_smarc_r9a08g045s33gbg_cm33.overlay | 24 +- .../rzv2l_smarc_r9a07g054l23gbg_cm33.overlay | 24 +- .../adc_sequence/boards/stm32f3_disco.overlay | 4 +- .../boards/qemu_cortex_a53.overlay | 6 +- .../led/pwm/boards/frdm_mcxc242.overlay | 4 +- .../lpcxpresso55s69_lpc55s69_cpu0.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu1.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu0.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu1.overlay | 2 +- .../drivers/memc/boards/apollo3p_evb.overlay | 2 +- .../mspi_async/boards/apollo3p_evb.overlay | 2 +- .../mspi_flash/boards/apollo3p_evb.overlay | 4 +- .../mspi_flash/boards/b_u585i_iot02a.overlay | 4 +- .../mspi_flash/boards/stm32h573i_dk.overlay | 4 +- .../boards/stm32h735g_disco.overlay | 4 +- .../boards/stm32l496g_disco.overlay | 2 +- .../pwm/capture/boards/lp_mspm0g3507.overlay | 2 +- .../fdc2x1x/boards/nrf9160dk_nrf9160.overlay | 4 +- .../tmp11x/boards/nucleo_f401re.overlay | 2 +- .../boards/nrf52840dk_nrf52840.overlay | 2 +- .../instrumentation/boards/mps2_an385.overlay | 2 +- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 4 +- .../nrf5340dk_nrf5340_cpuapp_icbmsg.overlay | 4 +- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 +- .../boards/nrf5340dk_nrf5340_cpunet.overlay | 4 +- .../nrf5340dk_nrf5340_cpunet_icbmsg.overlay | 4 +- .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 4 +- .../lpcxpresso55s69_lpc55s69_cpu0.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu1.overlay | 2 +- .../boards/frdm_mcxn947_mcxn947_cpu0.overlay | 2 +- .../boards/mcx_n9xx_evk_mcxn947_cpu0.overlay | 2 +- .../openamp/boards/mps2_an521_cpu0.overlay | 4 +- .../boards/frdm_mcxn947_mcxn947_cpu1.overlay | 2 +- .../boards/mcx_n9xx_evk_mcxn947_cpu1.overlay | 2 +- .../remote/boards/mps2_an521_cpu1.overlay | 4 +- .../boards/mps2_an521_cpu0.overlay | 4 +- .../remote/boards/mps2_an521_cpu1.overlay | 4 +- ...mimxrt1050_evk_hyperflash_ram_load.overlay | 4 +- .../nrf52840dk_nrf52840_ram_load.overlay | 4 +- .../audio_headphones_microphone/app.overlay | 2 +- .../usb/legacy/audio_headset/app.overlay | 2 +- .../nucleo_l552ze_q_stm32l552xx_ns.overlay | 2 +- scripts/dts/python-devicetree/tests/test.dts | 56 ++-- .../ram_context_for_isr/app.overlay | 4 +- .../nucleo_l552ze_q_stm32l552xx_ns.overlay | 4 +- .../boards/nrf52840dk_nrf52840.overlay | 4 +- .../boards/nrf52840dk_nrf52840_mem.overlay | 4 +- .../native_sim_native_one.dts | 4 +- .../comparator/nxp_cmp/frdm_mcxc242.overlay | 2 +- tests/drivers/build_all/dac/app.overlay | 12 +- tests/drivers/build_all/display/app.overlay | 16 +- .../build_all/ethernet/spi_devices.overlay | 6 +- .../gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay | 4 +- .../i2c/boards/qemu_cortex_m3.overlay | 4 +- tests/drivers/build_all/sensor/i2c.dtsi | 2 +- tests/drivers/build_all/sensor/i3c.dtsi | 28 +- tests/drivers/build_all/sensor/spi.dtsi | 2 +- .../sbs_charger/boards/emulated_board.overlay | 2 +- .../boards/qemu_cortex_a53.overlay | 2 +- .../coredump_api/boards/qemu_riscv32.overlay | 2 +- .../boards/intel_btl_s_crb.overlay | 2 +- .../boards/intel_ptl_h_crb.overlay | 2 +- .../disk_access/boards/qemu_x86_64.overlay | 2 +- .../boards/intel_btl_s_crb.overlay | 2 +- .../boards/qemu_x86_64.overlay | 2 +- .../flash/common/boards/ek_ra6m2.overlay | 4 +- .../flash/common/boards/ek_ra6m3.overlay | 4 +- .../flash/common/boards/ek_ra6m4.overlay | 4 +- .../flash/common/boards/ek_ra6m5.overlay | 4 +- .../flash/common/boards/ek_ra8d1.overlay | 4 +- .../flash/common/boards/ek_ra8m1.overlay | 4 +- .../flash/common/boards/fpb_ra6e1.overlay | 4 +- .../flash/common/boards/mck_ra8t1.overlay | 4 +- .../boards/nrf52840dk_mx25l51245g.overlay | 2 +- .../common/boards/nrf52840dk_spi_nor.overlay | 2 +- .../boards/nrf52840dk_spi_nor_wp_hold.overlay | 2 +- .../boards/nucleo_f411re.overlay | 4 +- .../boards/mps2_an385.overlay | 4 +- .../sbs_gauge/boards/emulated_board.overlay | 2 +- .../sbs_gauge/boards/qemu_cortex_a53.overlay | 2 +- .../boards/nrf54l_sense_edge.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu0.overlay | 2 +- .../lpcxpresso55s69_lpc55s69_cpu1.overlay | 2 +- .../rzg3s_smarc_r9a08g045s33gbg_cm33.overlay | 20 +- .../rzv2l_smarc_r9a07g054l23gbg_cm33.overlay | 20 +- .../mspi/flash/boards/apollo3p_evb.overlay | 2 +- .../mspi/flash/boards/native_sim.overlay | 4 +- .../boards/nrf52840dk_nrf52840_ram.overlay | 4 +- .../api/boards/qemu_cortex_m3.overlay | 4 +- .../sbs_gauge/boards/native_sim.overlay | 2 +- .../sbs_gauge/boards/nucleo_f070rb.overlay | 4 +- .../boards/qemu_arc_qemu_arc_hs.overlay | 2 +- .../sbs_gauge/boards/qemu_cortex_a9.overlay | 2 +- .../boards/samc21n_xpro.overlay | 2 +- .../uart_errors/boards/sam_e54_xpro.overlay | 2 +- tests/kernel/device/app.overlay | 38 +-- .../boards/hifive_unmatched_fu740_s7.overlay | 38 +-- .../boards/hifive_unmatched_fu740_u74.overlay | 38 +-- tests/lib/devicetree/api/app.overlay | 4 +- tests/lib/devicetree/devices/app.overlay | 4 +- .../dfu/mcuboot_multi/native_sim.overlay | 8 +- .../mcuboot_multi/nrf52840dk_nrf52840.overlay | 12 +- .../fs/littlefs/boards/frdm_mcxa156.overlay | 4 +- .../fs/littlefs/boards/frdm_mcxn236.overlay | 4 +- .../boards/frdm_mcxn947_mcxn947_cpu0.overlay | 4 +- .../fs/littlefs/boards/frdm_mcxw71.overlay | 4 +- .../fs/littlefs/boards/frdm_rw612.overlay | 12 +- .../littlefs/boards/lpcxpresso55s06.overlay | 4 +- .../littlefs/boards/lpcxpresso55s16.overlay | 4 +- .../littlefs/boards/lpcxpresso55s28.overlay | 4 +- .../littlefs/boards/lpcxpresso55s36.overlay | 4 +- .../fs/littlefs/boards/mimxrt1010_evk.overlay | 12 +- .../fs/littlefs/boards/mimxrt1015_evk.overlay | 12 +- .../fs/littlefs/boards/mimxrt1020_evk.overlay | 4 +- .../fs/littlefs/boards/mimxrt1024_evk.overlay | 4 +- .../fs/littlefs/boards/mimxrt1040_evk.overlay | 4 +- ...mxrt1050_evk_mimxrt1052_hyperflash.overlay | 4 +- .../mimxrt1060_evk_mimxrt1062_qspi_C.overlay | 12 +- .../fs/littlefs/boards/mimxrt1064_evk.overlay | 4 +- .../mimxrt1160_evk_mimxrt1166_cm7.overlay | 12 +- .../mimxrt1170_evk_mimxrt1176_cm7.overlay | 12 +- .../mimxrt1180_evk_mimxrt1189_cm33.overlay | 12 +- .../mimxrt595_evk_mimxrt595s_cm33.overlay | 12 +- .../mimxrt685_evk_mimxrt685s_cm33.overlay | 12 +- .../fs/littlefs/boards/mr_canhubk3.overlay | 2 +- .../fs/littlefs/boards/native_sim.overlay | 2 +- .../boards/nrf52840dk_nrf52840.overlay | 2 +- .../boards/s32z2xxdc2_s32z270_rtu0.overlay | 2 +- .../boards/s32z2xxdc2_s32z270_rtu1.overlay | 2 +- .../boards/qemu_cortex_m3.overlay | 16 +- ...arduino_portenta_h7_stm32h747xx_m7.overlay | 4 +- .../boards/nrf52840dk_nrf52840.overlay | 4 +- .../retention/boards/qemu_cortex_m3.overlay | 4 +- tests/subsys/storage/flash_map/app.overlay | 4 +- 521 files changed, 2116 insertions(+), 2116 deletions(-) diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts index 75e2fc860288..114a2d9cb91d 100644 --- a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts @@ -76,9 +76,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; - nvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; - ram-param = [00 f0]; + pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + ram-param = [00 F0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts index ebf57c840054..fe6a7eba826d 100644 --- a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts @@ -90,9 +90,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; - nvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; - ram-param = [00 f0]; + pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + ram-param = [00 F0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts index 3295356dbf66..3f7971fce669 100644 --- a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts @@ -115,9 +115,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; - nvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; - ram-param = [00 f0]; + pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + ram-param = [00 F0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/adafruit/feather_esp32s3_tft_reverse/adafruit_feather_esp32s3_tft_reverse_procpu.dts b/boards/adafruit/feather_esp32s3_tft_reverse/adafruit_feather_esp32s3_tft_reverse_procpu.dts index 52839c64a7b2..841e85761a15 100644 --- a/boards/adafruit/feather_esp32s3_tft_reverse/adafruit_feather_esp32s3_tft_reverse_procpu.dts +++ b/boards/adafruit/feather_esp32s3_tft_reverse/adafruit_feather_esp32s3_tft_reverse_procpu.dts @@ -133,9 +133,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; - nvgam-param = [70 2c 2e 15 10 09 48 33 53 0b 19 18 20 25]; - ram-param = [00 f0]; + pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + ram-param = [00 F0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts index 59025fb656f5..13e4435f03bd 100644 --- a/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts +++ b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts @@ -187,7 +187,7 @@ page-offset = <0>; display-offset = <0>; multiplex-ratio = <63>; - prechargep = <0x1f>; + prechargep = <0x1F>; segment-remap; com-invdir; inversion-on; diff --git a/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.dts b/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.dts index 05dbca9884db..7c3694986705 100644 --- a/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.dts +++ b/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.dts @@ -120,12 +120,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/adafruit/trinket_m0/adafruit_trinket_m0.dts b/boards/adafruit/trinket_m0/adafruit_trinket_m0.dts index d557aff3a79e..e130368f5d3d 100644 --- a/boards/adafruit/trinket_m0/adafruit_trinket_m0.dts +++ b/boards/adafruit/trinket_m0/adafruit_trinket_m0.dts @@ -121,7 +121,7 @@ code_partition: partition@2000 { label = "code"; - reg = <0x2000 0x3a000>; + reg = <0x2000 0x3A000>; read-only; }; diff --git a/boards/adi/apard32690/apard32690_max32690_m4.dts b/boards/adi/apard32690/apard32690_max32690_m4.dts index beff42273c6d..43575a724ac7 100644 --- a/boards/adi/apard32690/apard32690_max32690_m4.dts +++ b/boards/adi/apard32690/apard32690_max32690_m4.dts @@ -259,7 +259,7 @@ pmod_spi: &spi4 { status = "okay"; port1 { - local-mac-address = [00 e0 22 fe da c9]; + local-mac-address = [00 E0 22 FE DA C9]; }; mdio { @@ -305,7 +305,7 @@ pmod_spi: &spi4 { * HPB doesn't support 7-clock latency which is default */ config-regs = <0x1000>; - config-reg-vals = <0x801f>; + config-reg-vals = <0x801F>; }; mem@1 { @@ -325,7 +325,7 @@ pmod_spi: &spi4 { * HPB doesn't support 7-clock latency which is default */ config-regs = <0x1000>; - config-reg-vals = <0x801f>; + config-reg-vals = <0x801F>; }; }; diff --git a/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.dts b/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.dts index 4358027c8494..b8acb6ad6bf7 100644 --- a/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.dts +++ b/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.dts @@ -130,12 +130,12 @@ slot1_partition: partition@8c000 { label = "image-1"; - reg = <0x0008c000 DT_SIZE_K(432)>; + reg = <0x0008C000 DT_SIZE_K(432)>; }; scratch_partition: partition@f8000 { label = "image-scratch"; - reg = <0x000f8000 DT_SIZE_K(16)>; + reg = <0x000F8000 DT_SIZE_K(16)>; }; storage_partition: partition@fc000 { @@ -221,7 +221,7 @@ spi-oa-protection; port1 { - local-mac-address = [00 e0 22 fe da c8]; + local-mac-address = [00 E0 22 FE DA C8]; }; mdio { diff --git a/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.dts b/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.dts index 245ac4af8f0a..1e64014618af 100644 --- a/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.dts +++ b/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.dts @@ -109,12 +109,12 @@ slot1_partition: partition@8c000 { label = "image-1"; - reg = <0x0008c000 DT_SIZE_K(432)>; + reg = <0x0008C000 DT_SIZE_K(432)>; }; scratch_partition: partition@f8000 { label = "image-scratch"; - reg = <0x000f8000 DT_SIZE_K(16)>; + reg = <0x000F8000 DT_SIZE_K(16)>; }; storage_partition: partition@fc000 { @@ -184,11 +184,11 @@ spi-oa-protection; port1 { - local-mac-address = [00 e0 22 fe da c9]; + local-mac-address = [00 E0 22 FE DA C9]; }; port2 { - local-mac-address = [00 e0 22 fe da d9]; + local-mac-address = [00 E0 22 FE DA D9]; }; mdio { diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi index ff7eee912de1..75c4225ab31c 100644 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi @@ -26,9 +26,9 @@ }; &flashctrl { - flash0: flash@a0000000 { + flash0: flash@A0000000 { compatible = "soc-nv-flash", "gd,gd25q64e"; - reg = <0xa0000000 (0x800000 - 0x2000)>; + reg = <0xA0000000 (0x800000 - 0x2000)>; write-block-size = <256>; erase-block-size = ; diff --git a/boards/aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi b/boards/aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi index 8ac9e3eb7ea8..0c861700cdba 100644 --- a/boards/aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi +++ b/boards/aithinker/ai_m62_12f_kit/ai_m62_12f.dtsi @@ -26,9 +26,9 @@ }; &flashctrl { - flash0: flash@a0000000 { + flash0: flash@A0000000 { compatible = "soc-nv-flash", "gd,gd25lq32d"; - reg = <0xa0000000 (0x400000 - 0x2000)>; + reg = <0xA0000000 (0x400000 - 0x2000)>; write-block-size = <256>; erase-block-size = ; diff --git a/boards/alientek/dnesp32s3b/dnesp32s3b_procpu.dts b/boards/alientek/dnesp32s3b/dnesp32s3b_procpu.dts index 834e7658e68c..cae7f11d2160 100644 --- a/boards/alientek/dnesp32s3b/dnesp32s3b_procpu.dts +++ b/boards/alientek/dnesp32s3b/dnesp32s3b_procpu.dts @@ -163,7 +163,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 f0]; + ram-param = [00 F0]; rgb-param = [40 02 14]; }; }; diff --git a/boards/ambiq/apollo510_evb/apollo510_evb.dts b/boards/ambiq/apollo510_evb/apollo510_evb.dts index 869b1d0463c5..0be49ee6784b 100644 --- a/boards/ambiq/apollo510_evb/apollo510_evb.dts +++ b/boards/ambiq/apollo510_evb/apollo510_evb.dts @@ -175,7 +175,7 @@ mspi-hardware-ce-num = <0>; mspi-dqs-enable; read-command = <0x20>; - write-command = <0xa0>; + write-command = <0xA0>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; rx-dummy = <7>; @@ -213,8 +213,8 @@ mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-dqs-enable; mspi-hardware-ce-num = <0>; - read-command = <0xcc>; - write-command = <0x8e>; + read-command = <0xCC>; + write-command = <0x8E>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; /* Avoid use of 3 byte address if Ambiq MSPI */ rx-dummy = <16>; diff --git a/boards/amd/versal2_rpu/versal2_rpu-qemu.dts b/boards/amd/versal2_rpu/versal2_rpu-qemu.dts index 26d57c783cc8..d2b4dac5de1f 100644 --- a/boards/amd/versal2_rpu/versal2_rpu-qemu.dts +++ b/boards/amd/versal2_rpu/versal2_rpu-qemu.dts @@ -960,7 +960,7 @@ phandle = <0x10f>; }; - loader_write_cpu0_0x1@0xf1110880 { + loader_write_cpu0_0x1@0xF1110880 { compatible = "loader"; addr = <0xf1110880>; data = <0x01>; @@ -972,7 +972,7 @@ phandle = <0x110>; }; - loader_write_cpu0_0x5@0xfd1a0050 { + loader_write_cpu0_0x5@0xFD1A0050 { compatible = "loader"; addr = <0xfd1a0050>; data = <0x05>; @@ -984,7 +984,7 @@ phandle = <0x111>; }; - loader_write_cpu0_0xFF@0xf111010c { + loader_write_cpu0_0xFF@0xF111010C { compatible = "loader"; addr = <0xf111010c>; data = <0xff>; @@ -1031,7 +1031,7 @@ phandle = <0x44>; }; - loader_write_cpu0_0x80C@0xf12b0100 { + loader_write_cpu0_0x80C@0xF12B0100 { compatible = "loader"; addr = <0xf12b0100>; data = <0x80c>; @@ -1043,7 +1043,7 @@ phandle = <0x113>; }; - loader_write_cpu0_0x77@0xf1260320 { + loader_write_cpu0_0x77@0xF1260320 { compatible = "loader"; addr = <0xf1260320>; data = <0x77>; @@ -2488,7 +2488,7 @@ phandle = <0x165>; }; - loader_write_cpu0_0x1@0xedc30440 { + loader_write_cpu0_0x1@0xEDC30440 { compatible = "loader"; addr = <0xedc30440>; data = <0x01>; @@ -2500,7 +2500,7 @@ phandle = <0x166>; }; - loader_write_cpu0_0x7F@0xedc30444 { + loader_write_cpu0_0x7F@0xEDC30444 { compatible = "loader"; addr = <0xedc30444>; data = <0x7f>; @@ -2512,7 +2512,7 @@ phandle = <0x167>; }; - loader_write_cpu0_0x1@0xedc3044c { + loader_write_cpu0_0x1@0xEDC3044c { compatible = "loader"; addr = <0xedc3044c>; data = <0x01>; @@ -2524,7 +2524,7 @@ phandle = <0x168>; }; - loader_write_cpu0_0x1@0xedc30450 { + loader_write_cpu0_0x1@0xEDC30450 { compatible = "loader"; addr = <0xedc30450>; data = <0x01>; @@ -2536,7 +2536,7 @@ phandle = <0x169>; }; - loader_write_cpu0_0x1@0xedc30460 { + loader_write_cpu0_0x1@0xEDC30460 { compatible = "loader"; addr = <0xedc30460>; data = <0x01>; @@ -2548,7 +2548,7 @@ phandle = <0x16a>; }; - loader_write_cpu0_0x7f@0xedc30464 { + loader_write_cpu0_0x7f@0xEDC30464 { compatible = "loader"; addr = <0xedc30464>; data = <0x7f>; @@ -2560,7 +2560,7 @@ phandle = <0x16b>; }; - loader_write_cpu0_0x1@0xedc3046c { + loader_write_cpu0_0x1@0xEDC3046c { compatible = "loader"; addr = <0xedc3046c>; data = <0x01>; @@ -2572,7 +2572,7 @@ phandle = <0x16c>; }; - loader_write_cpu0_0x1@0xedc30470 { + loader_write_cpu0_0x1@0xEDC30470 { compatible = "loader"; addr = <0xedc30470>; data = <0x01>; @@ -2584,7 +2584,7 @@ phandle = <0x16d>; }; - loader_write_cpu0_0x3@0xed0a0098 { + loader_write_cpu0_0x3@0xED0A0098 { compatible = "loader"; addr = <0xed0a0098>; data = <0x03>; @@ -3289,7 +3289,7 @@ Cannot continue.\nTry installing libgcrypt."; phandle = <0x91>; }; - pmc_sha1@0xf1800000 { + pmc_sha1@0xF1800000 { doc-status = "complete"; compatible = "xlnx,asu_sha2"; reg = <0x00 0xf1800000 0x00 0x10000 0x00>; @@ -3941,7 +3941,7 @@ Cannot continue.\nTry installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x1a4>; - asu_io_intc@0c { + asu_io_intc@0C { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -4268,7 +4268,7 @@ Cannot continue.\nTry installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x1b5>; - pmc_ppu0_intc@0c { + pmc_ppu0_intc@0C { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -4484,7 +4484,7 @@ Cannot continue.\nTry installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x1bf>; - pmc_ppu1_intc@0c { + pmc_ppu1_intc@0C { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -4730,7 +4730,7 @@ Cannot continue.\nTry installing libgcrypt."; priority = <0xffffffff>; phandle = <0x1cd>; - ddrmc0_intc@0c { + ddrmc0_intc@0C { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -5062,7 +5062,7 @@ Cannot continue.\nTry installing libgcrypt."; phandle = <0x103>; }; - memory@0x50000000000ull { + memory@0x50000000000ULL { compatible = "qemu:memory-region"; device_type = "memory"; container = <0x0d>; @@ -5797,7 +5797,7 @@ Cannot continue.\nTry installing libgcrypt."; phandle = <0xa2>; }; - ddr_2@0x800000000ull { + ddr_2@0x800000000ULL { compatible = "qemu:memory-region-spec"; container = <0x103>; qemu,ram = <0x01>; diff --git a/boards/amd/versalnet_apu/versalnet_apu-qemu.dts b/boards/amd/versalnet_apu/versalnet_apu-qemu.dts index 881f0d9fe5c1..f011af0cdd63 100644 --- a/boards/amd/versalnet_apu/versalnet_apu-qemu.dts +++ b/boards/amd/versalnet_apu/versalnet_apu-qemu.dts @@ -694,7 +694,7 @@ phandle = <0xc9>; }; - loader_write_cpu0_0x1@0xf1110880 { + loader_write_cpu0_0x1@0xF1110880 { compatible = "loader"; addr = <0xf1110880>; data = <0x01>; @@ -706,7 +706,7 @@ phandle = <0xca>; }; - loader_write_cpu0_0x5@0xfd1a0050 { + loader_write_cpu0_0x5@0xFD1A0050 { compatible = "loader"; addr = <0xfd1a0050>; data = <0x05>; @@ -718,7 +718,7 @@ phandle = <0xcb>; }; - loader_write_cpu0_0xFF@0xf111010c { + loader_write_cpu0_0xFF@0xF111010C { compatible = "loader"; addr = <0xf111010c>; data = <0xff>; @@ -744,7 +744,7 @@ phandle = <0x2c>; }; - loader_write_cpu0_0x80C@0xf12b0100 { + loader_write_cpu0_0x80C@0xF12B0100 { compatible = "loader"; addr = <0xf12b0100>; data = <0x80c>; @@ -1394,7 +1394,7 @@ phandle = <0xb7>; }; - rpu_pcil@0xeb420000 { + rpu_pcil@0xEB420000 { compatible = "xlnx,rpu_pcil"; reg = <0x00 0xeb420000 0x00 0x10000 0x00>; gpio-controller; @@ -1564,7 +1564,7 @@ phandle = <0x4e>; }; - pki_rng@0x20400040000ull { + pki_rng@0x20400040000ULL { compatible = "xlnx,psx-pki-rng"; reg = <0x204 0x40000 0x00 0x20000 0x00>; interrupts = <0x9c>; @@ -2143,7 +2143,7 @@ Cannot continue.Try installing libgcrypt."; phandle = <0x6e>; }; - pmc_sha1@0xf1800000 { + pmc_sha1@0xF1800000 { doc-status = "complete"; compatible = "zynqmp,csu-sha3"; reg = <0x00 0xf1800000 0x00 0x10000 0x00>; @@ -2224,7 +2224,7 @@ Cannot continue.Try installing libgcrypt."; phandle = <0x76>; }; - pmc_err_mng@0xf1130000 { + pmc_err_mng@0xF1130000 { compatible = "xlnx,PmcErrMngmnt"; reg = <0x00 0xf1130000 0x00 0x10000 0x00>; interrupts = <0xbca>; @@ -2975,7 +2975,7 @@ Cannot continue.Try installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x139>; - pmc_ppu0_intc@0c { + pmc_ppu0_intc@0C { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -3191,7 +3191,7 @@ Cannot continue.Try installing libgcrypt."; xlnx,use-io-bus = <0x01>; phandle = <0x143>; - pmc_ppu1_intc@0c { + pmc_ppu1_intc@0C { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -3407,7 +3407,7 @@ Cannot continue.Try installing libgcrypt."; container = <0x92>; phandle = <0x14d>; - psm0_intc@0c { + psm0_intc@0C { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -3554,7 +3554,7 @@ Cannot continue.Try installing libgcrypt."; priority = <0xffffffff>; phandle = <0x153>; - ddrmc0_intc@0c { + ddrmc0_intc@0C { #interrupt-cells = <0x01>; compatible = "xlnx,io-intc-1.02.a\0xlnx,io_intc"; interrupt-controller; @@ -3865,7 +3865,7 @@ Cannot continue.Try installing libgcrypt."; phandle = <0xba>; }; - memory@0x50000000000ull { + memory@0x50000000000ULL { compatible = "qemu:memory-region"; device_type = "memory"; container = <0x0b>; @@ -4668,7 +4668,7 @@ Cannot continue.Try installing libgcrypt."; phandle = <0x7f>; }; - ddr_2@0x800000000ull { + ddr_2@0x800000000ULL { compatible = "qemu:memory-region-spec"; container = <0xba>; qemu,ram = <0x01>; diff --git a/boards/arduino/mkrzero/arduino_mkrzero.dts b/boards/arduino/mkrzero/arduino_mkrzero.dts index aa98de5d00c5..3fbf38268d79 100644 --- a/boards/arduino/mkrzero/arduino_mkrzero.dts +++ b/boards/arduino/mkrzero/arduino_mkrzero.dts @@ -135,7 +135,7 @@ zephyr_i2c: &sercom0 { code_partition: partition@2000 { label = "code"; - reg = <0x2000 0x3a000>; + reg = <0x2000 0x3A000>; read-only; }; diff --git a/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts b/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts index cdd79bddff46..fed0ec2dd2b8 100644 --- a/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts +++ b/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts @@ -163,7 +163,7 @@ code_partition: partition@2000 { label = "code"; - reg = <0x2000 0x3a000>; + reg = <0x2000 0x3A000>; read-only; }; diff --git a/boards/arduino/nano_matter/arduino_nano_matter.dts b/boards/arduino/nano_matter/arduino_nano_matter.dts index dd108d99189a..9e20e508805d 100644 --- a/boards/arduino/nano_matter/arduino_nano_matter.dts +++ b/boards/arduino/nano_matter/arduino_nano_matter.dts @@ -327,13 +327,13 @@ /* Reserve 736 kB for the application in slot 0 */ slot0_partition: partition@c000 { - reg = <0x0000c000 0x000b8000>; + reg = <0x0000c000 0x000B8000>; label = "image-0"; }; /* Reserve 736 kB for the application in slot 1 */ - slot1_partition: partition@c4000 { - reg = <0x000c4000 0x000b8000>; + slot1_partition: partition@C4000 { + reg = <0x000C4000 0x000B8000>; label = "image-1"; }; diff --git a/boards/arduino/portenta_c33/arduino_portenta_c33.dts b/boards/arduino/portenta_c33/arduino_portenta_c33.dts index dbf6e0b53eb1..3dda993399e8 100644 --- a/boards/arduino/portenta_c33/arduino_portenta_c33.dts +++ b/boards/arduino/portenta_c33/arduino_portenta_c33.dts @@ -308,7 +308,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; @@ -318,7 +318,7 @@ }; ð { - local-mac-address = [74 90 50 b0 5d e9]; + local-mac-address = [74 90 50 B0 5D E9]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts index 7a6bd8f91a81..afc4ca90fc9c 100644 --- a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts +++ b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts @@ -203,9 +203,9 @@ zephyr_udc0: &usbotg_hs { reg = <0x00040000 0x00060000>; }; - slot1_partition: partition@a0000 { + slot1_partition: partition@A0000 { label = "image-1"; - reg = <0x000a0000 0x00060000>; + reg = <0x000A0000 0x00060000>; }; }; }; diff --git a/boards/arduino/uno_r4/arduino_uno_r4.dts b/boards/arduino/uno_r4/arduino_uno_r4.dts index e369914bc4da..7119ad6d049c 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4.dts +++ b/boards/arduino/uno_r4/arduino_uno_r4.dts @@ -103,7 +103,7 @@ code_partition: partition@4000 { label = "code"; - reg = <0x4000 0x3c000>; + reg = <0x4000 0x3C000>; read-only; }; }; diff --git a/boards/arm/mps2/mps2_an521_cpu1.dts b/boards/arm/mps2/mps2_an521_cpu1.dts index 72f5d6a8e107..acc956c42a3e 100644 --- a/boards/arm/mps2/mps2_an521_cpu1.dts +++ b/boards/arm/mps2/mps2_an521_cpu1.dts @@ -120,8 +120,8 @@ * https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/master/platform/ext/target/arm/mps2/an521/partition/flash_layout.h */ - code: memory@38b000 { - reg = <0x0038b000 DT_SIZE_K(468)>; + code: memory@38B000 { + reg = <0x0038B000 DT_SIZE_K(468)>; }; /* This ram memory region's base address is chosen to avoid diff --git a/boards/bbc/microbit_v2/bbc_microbit_v2.dts b/boards/bbc/microbit_v2/bbc_microbit_v2.dts index 2ec032af8132..112e857df51a 100644 --- a/boards/bbc/microbit_v2/bbc_microbit_v2.dts +++ b/boards/bbc/microbit_v2/bbc_microbit_v2.dts @@ -165,27 +165,27 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xc000>; + reg = <0x00000000 0xC000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { label = "image-scratch"; - reg = <0x00070000 0xa000>; + reg = <0x00070000 0xA000>; }; storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007a000 0x00006000>; + reg = <0x0007A000 0x00006000>; }; }; }; diff --git a/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.dts b/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.dts index fa889b01c4e2..f712184c3444 100644 --- a/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.dts +++ b/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.dts @@ -136,12 +136,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts b/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts index 5ec74a28f536..3187a51aceeb 100644 --- a/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts +++ b/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts @@ -194,7 +194,7 @@ }; /* Allocate 128 KiB scratch for image swap */ - scratch_partition: partition@a0000 { + scratch_partition: partition@A0000 { label = "image-scratch"; reg = <0x000a0000 DT_SIZE_K(128)>; }; diff --git a/boards/blues/swan_r5/swan_r5.dts b/boards/blues/swan_r5/swan_r5.dts index 95e8c1f6981c..795751591c33 100644 --- a/boards/blues/swan_r5/swan_r5.dts +++ b/boards/blues/swan_r5/swan_r5.dts @@ -188,9 +188,9 @@ zephyr_udc0: &usbotg_fs { #size-cells = <1>; /* Reserve last 16KiB for property storage */ - storage_partition: partition@1fb000 { + storage_partition: partition@1FB000 { label = "storage"; - reg = <0x001fb000 0x00004000>; + reg = <0x001FB000 0x00004000>; }; }; }; diff --git a/boards/bytesatwork/bytesensi_l/bytesensi_l.dts b/boards/bytesatwork/bytesensi_l/bytesensi_l.dts index f68e66c7d5fd..baf7b0209d6c 100644 --- a/boards/bytesatwork/bytesensi_l/bytesensi_l.dts +++ b/boards/bytesatwork/bytesensi_l/bytesensi_l.dts @@ -43,12 +43,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.dts b/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.dts index 709998ba107d..ebcb17d6f61f 100644 --- a/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.dts +++ b/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.dts @@ -142,12 +142,12 @@ zephyr_udc0: &usbd { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000c000>; + reg = <0x00000000 0x0000C000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00076000>; + reg = <0x0000C000 0x00076000>; }; slot1_partition: partition@82000 { diff --git a/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts b/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts index 7ccae16ec375..cb06d4ef06c2 100644 --- a/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts +++ b/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.dts @@ -121,12 +121,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts index 9d9e0f6d3434..257a85373eb6 100644 --- a/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts +++ b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts @@ -109,10 +109,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; - nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; - ram-param = [00 f0]; - rgb-param = [cd 08 14]; + pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; + nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; + ram-param = [00 F0]; + rgb-param = [CD 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi index 3389ad997124..6af62971ef80 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi @@ -375,7 +375,7 @@ }; /* 256K */ - slot1_ns_partition: partition@a0000 { + slot1_ns_partition: partition@A0000 { label = "image-1-nonsecure"; }; diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi index b73f177a8d79..f20e1909f792 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi @@ -50,7 +50,7 @@ /* 88K */ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x16000>; + reg = <0x0000C000 0x16000>; }; /* 88K */ diff --git a/boards/ezurio/bl652_dvk/bl652_dvk.dts b/boards/ezurio/bl652_dvk/bl652_dvk.dts index 2a42758f812e..23f61e4e80a5 100644 --- a/boards/ezurio/bl652_dvk/bl652_dvk.dts +++ b/boards/ezurio/bl652_dvk/bl652_dvk.dts @@ -160,12 +160,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/ezurio/bl653_dvk/bl653_dvk.dts b/boards/ezurio/bl653_dvk/bl653_dvk.dts index bcf0896eb207..5279f263c362 100644 --- a/boards/ezurio/bl653_dvk/bl653_dvk.dts +++ b/boards/ezurio/bl653_dvk/bl653_dvk.dts @@ -176,27 +176,27 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xc000>; + reg = <0x00000000 0xC000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { label = "image-scratch"; - reg = <0x00070000 0xa000>; + reg = <0x00070000 0xA000>; }; storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007a000 0x00006000>; + reg = <0x0007A000 0x00006000>; }; }; }; diff --git a/boards/ezurio/bt610/bt610.dts b/boards/ezurio/bt610/bt610.dts index b7dd129c8be9..791e6c75421a 100644 --- a/boards/ezurio/bt610/bt610.dts +++ b/boards/ezurio/bt610/bt610.dts @@ -254,7 +254,7 @@ /* 896K */ slot0_partition: partition@18000 { label = "image-0"; - reg = <0x00018000 0x000e0000>; + reg = <0x00018000 0x000E0000>; }; /* @@ -282,19 +282,19 @@ /* 896K */ slot1_partition: partition@0 { label = "image-1"; - reg = <0x00000000 0x000e0000>; + reg = <0x00000000 0x000E0000>; }; /* 16K */ - scratch_partition: partition@e0000 { + scratch_partition: partition@E0000 { label = "image-scratch"; - reg = <0x000e0000 0x00004000>; + reg = <0x000E0000 0x00004000>; }; /* 112K */ - customer_partition: partition@e4000 { + customer_partition: partition@E4000 { label = "customer-storage"; - reg = <0x000e4000 0x0001c000>; + reg = <0x000E4000 0x0001C000>; }; /* 7MB */ diff --git a/boards/ezurio/mg100/mg100.dts b/boards/ezurio/mg100/mg100.dts index 3a46456d5425..f7505e18fb79 100644 --- a/boards/ezurio/mg100/mg100.dts +++ b/boards/ezurio/mg100/mg100.dts @@ -207,7 +207,7 @@ /* 896K */ slot0_partition: partition@18000 { label = "image-0"; - reg = <0x00018000 0x000e0000>; + reg = <0x00018000 0x000E0000>; }; /* @@ -235,13 +235,13 @@ /* 896K */ slot1_partition: partition@0 { label = "image-1"; - reg = <0x00000000 0x000e0000>; + reg = <0x00000000 0x000E0000>; }; /* 128K */ - scratch_partition: partition@e0000 { + scratch_partition: partition@E0000 { label = "image-scratch"; - reg = <0x000e0000 0x00020000>; + reg = <0x000E0000 0x00020000>; }; /* 7MB */ diff --git a/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.dts b/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.dts index f5b58ea54a9f..5660a0624d8f 100644 --- a/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.dts +++ b/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.dts @@ -220,7 +220,7 @@ /* 896K */ slot0_partition: partition@18000 { label = "image-0"; - reg = <0x00018000 0x000e0000>; + reg = <0x00018000 0x000E0000>; }; /* @@ -248,13 +248,13 @@ /* 896K */ slot1_partition: partition@0 { label = "image-1"; - reg = <0x00000000 0x000e0000>; + reg = <0x00000000 0x000E0000>; }; /* 128K */ - scratch_partition: partition@e0000 { + scratch_partition: partition@E0000 { label = "image-scratch"; - reg = <0x000e0000 0x00020000>; + reg = <0x000E0000 0x00020000>; }; /* 7MB */ diff --git a/boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts b/boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts index 44a8066baa1c..dddb743cf092 100644 --- a/boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts +++ b/boards/ezurio/rm1xx_dvk/rm1xx_dvk.dts @@ -124,13 +124,13 @@ /* 52K */ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000c000>; + reg = <0x00000000 0x0000C000>; }; /* 188K */ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00030000>; + reg = <0x0000C000 0x00030000>; }; /* @@ -139,7 +139,7 @@ */ storage_partition: partition@3c000 { label = "storage"; - reg = <0x0003c000 0x00004000>; + reg = <0x0003C000 0x00004000>; }; }; }; diff --git a/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts b/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts index 7792ea0dfdd6..10e8798731b9 100644 --- a/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts +++ b/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.dts @@ -62,10 +62,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; - nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; - ram-param = [00 f0]; - rgb-param = [cd 08 14]; + pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; + nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; + ram-param = [00 F0]; + rgb-param = [CD 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/fobe/quill_nrf52840_mesh/quill_nrf52840_mesh_common.dtsi b/boards/fobe/quill_nrf52840_mesh/quill_nrf52840_mesh_common.dtsi index b9470bd9f8c8..aac440914bdf 100644 --- a/boards/fobe/quill_nrf52840_mesh/quill_nrf52840_mesh_common.dtsi +++ b/boards/fobe/quill_nrf52840_mesh/quill_nrf52840_mesh_common.dtsi @@ -75,20 +75,20 @@ height = <240>; x-offset = <52>; y-offset = <40>; - vcom = <0x3f>; + vcom = <0x3F>; gctrl = <0x05>; - vrhs = <0x0f>; + vrhs = <0x0F>; vdvs = <0x20>; mdac = <0x00>; gamma = <0x01>; colmod = <0x05>; - lcm = <0x2c>; + lcm = <0x2C>; porch-param = [05 05 00 33 33]; - cmd2en-param = [5a 69 02 00]; - pwctrl1-param = [a4 a1]; - pvgam-param = [d0 05 09 09 08 14 28 33 3f 07 13 14 28 30]; - nvgam-param = [d0 05 09 09 08 03 24 32 32 3b 14 13 28 2f]; - ram-param = [00 f0]; + cmd2en-param = [5A 69 02 00]; + pwctrl1-param = [A4 A1]; + pvgam-param = [D0 05 09 09 08 14 28 33 3F 07 13 14 28 30]; + nvgam-param = [D0 05 09 09 08 03 24 32 32 3B 14 13 28 2F]; + ram-param = [00 F0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/focaltech/ft9001_eval/ft9001_eval.dts b/boards/focaltech/ft9001_eval/ft9001_eval.dts index bd24ffb00ad7..64fca08709be 100644 --- a/boards/focaltech/ft9001_eval/ft9001_eval.dts +++ b/boards/focaltech/ft9001_eval/ft9001_eval.dts @@ -39,7 +39,7 @@ app_partition: partition@1000 { label = "app"; - reg = <0x00001000 0x001ff000>; + reg = <0x00001000 0x001FF000>; }; }; }; diff --git a/boards/heltec/heltec_wireless_tracker/heltec_wireless_tracker_procpu.dts b/boards/heltec/heltec_wireless_tracker/heltec_wireless_tracker_procpu.dts index b70fcb66b7fb..23c058bce044 100644 --- a/boards/heltec/heltec_wireless_tracker/heltec_wireless_tracker_procpu.dts +++ b/boards/heltec/heltec_wireless_tracker/heltec_wireless_tracker_procpu.dts @@ -81,22 +81,22 @@ inversion-on; x-offset = <1>; y-offset = <26>; - madctl = <0xa8>; + madctl = <0xA8>; colmod = <0x05>; invctr = <7>; - vmctr1 = <0x0e>; - pwctr1 = [a2 02 84]; - pwctr2 = [c1]; - pwctr3 = [0a 00]; - pwctr4 = [8a 2a]; - pwctr5 = [8a ee]; - frmctr1 = [01 26 2e]; - frmctr2 = [01 26 2e]; - frmctr3 = [01 26 2e 01 26 2e]; - gamctrp1 = [0f 1a 0f 18 2f 28 20 22 1f 1b 23 37 00 07 02 10]; - gamctrn1 = [0f 1b 0f 17 33 2c 29 2e 30 2e 30 3b 00 07 03 10]; - caset = [00 01 00 a0]; - raset = [00 1a 00 69]; + vmctr1 = <0x0E>; + pwctr1 = [A2 02 84]; + pwctr2 = [C1]; + pwctr3 = [0A 00]; + pwctr4 = [8A 2A]; + pwctr5 = [8A EE]; + frmctr1 = [01 26 2E]; + frmctr2 = [01 26 2E]; + frmctr3 = [01 26 2E 01 26 2E]; + gamctrp1 = [0F 1A 0F 18 2F 28 20 22 1F 1B 23 37 00 07 02 10]; + gamctrn1 = [0F 1B 0F 17 33 2C 29 2E 30 2E 30 3B 00 07 03 10]; + caset = [00 01 00 A0]; + raset = [00 1A 00 69]; }; }; }; diff --git a/boards/holyiot/yj17095/holyiot_yj17095.dts b/boards/holyiot/yj17095/holyiot_yj17095.dts index 3cb3083c6ac1..c6a396fdc989 100644 --- a/boards/holyiot/yj17095/holyiot_yj17095.dts +++ b/boards/holyiot/yj17095/holyiot_yj17095.dts @@ -56,7 +56,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x37000>; + reg = <0x0000C000 0x37000>; }; slot1_partition: partition@43000 { diff --git a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02-memory_map.dtsi b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02-memory_map.dtsi index bbe94a64160d..7f0454ae4d59 100644 --- a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02-memory_map.dtsi +++ b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02-memory_map.dtsi @@ -88,9 +88,9 @@ reg = <0x80000 0x60000>; }; - storage_partition: storage_partition@e0000 { + storage_partition: storage_partition@E0000 { compatible = "soc-nv-flash"; - reg = <0xe0000 DT_SIZE_K(64)>; + reg = <0xE0000 DT_SIZE_K(64)>; }; }; }; diff --git a/boards/infineon/kit_pse84_ai/kit_pse84_ai_memory_map.dtsi b/boards/infineon/kit_pse84_ai/kit_pse84_ai_memory_map.dtsi index 4e315583bf10..cf0024ff9c2c 100644 --- a/boards/infineon/kit_pse84_ai/kit_pse84_ai_memory_map.dtsi +++ b/boards/infineon/kit_pse84_ai/kit_pse84_ai_memory_map.dtsi @@ -96,7 +96,7 @@ }; m33s_xip: m33s_xip@70100400 { - reg = <0x70100400 0x1ffc00>; + reg = <0x70100400 0x1FFC00>; }; m33_xip: m33_xip@8300000 { diff --git a/boards/kws/pico2_spe/pico2_spe.dtsi b/boards/kws/pico2_spe/pico2_spe.dtsi index b4f3db7021e9..f99ec6f98aa7 100644 --- a/boards/kws/pico2_spe/pico2_spe.dtsi +++ b/boards/kws/pico2_spe/pico2_spe.dtsi @@ -86,7 +86,7 @@ rst-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; status = "okay"; - local-mac-address = [ca 2f b7 10 23 79]; + local-mac-address = [CA 2F B7 10 23 79]; lan865x_mdio: lan865x_mdio { compatible = "microchip,lan865x-mdio"; diff --git a/boards/kws/pico_spe/pico_spe.dts b/boards/kws/pico_spe/pico_spe.dts index 048c18ea6276..1b333f69e9fe 100644 --- a/boards/kws/pico_spe/pico_spe.dts +++ b/boards/kws/pico_spe/pico_spe.dts @@ -150,7 +150,7 @@ int-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; rst-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; status = "okay"; - local-mac-address = [ca 2f b7 10 23 78]; + local-mac-address = [CA 2F B7 10 23 78]; lan865x_mdio: lan865x_mdio { compatible = "microchip,lan865x-mdio"; diff --git a/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts b/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts index f2afc45fef85..542781c515cf 100644 --- a/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts +++ b/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts @@ -70,16 +70,16 @@ height = <80>; inversion-on; rgb-is-inverted; - madctl = <0xbe>; + madctl = <0xBE>; x-offset = <1>; y-offset = <26>; - gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2b 39 00 01 03 10]; - gamctrn1 = [03 1d 07 06 2e 2c 29 2d 2e 2e 37 3f 00 00 02 10]; - te-delay = <0x0a>; - vmctr1 = <0x0e>; + gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2B 39 00 01 03 10]; + gamctrn1 = [03 1d 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10]; + te-delay = <0x0A>; + vmctr1 = <0x0E>; colmod = <0x05>; caset = [00 02 00 81]; - raset = [00 01 00 a0]; + raset = [00 01 00 A0]; status = "okay"; }; }; diff --git a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts index 5d8684322f93..cbc697bcdf34 100644 --- a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts +++ b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts @@ -83,7 +83,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 e0]; + ram-param = [00 E0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts index 426cb6973a3c..e9c090eec51e 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts @@ -95,7 +95,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 f0]; + ram-param = [00 F0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.dts b/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.dts index 6dd7f134a595..9cc34be37cf5 100644 --- a/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.dts +++ b/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.dts @@ -153,12 +153,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/native/native_sim/native_sim.dts b/boards/native/native_sim/native_sim.dts index 128562a7f506..1d2b1bde46ca 100644 --- a/boards/native/native_sim/native_sim.dts +++ b/boards/native/native_sim/native_sim.dts @@ -77,12 +77,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000c000>; + reg = <0x00000000 0x0000C000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00069000>; + reg = <0x0000C000 0x00069000>; }; slot1_partition: partition@75000 { diff --git a/boards/nordic/nrf21540dk/nrf21540dk_nrf52840.dts b/boards/nordic/nrf21540dk/nrf21540dk_nrf52840.dts index 801782c35efe..7368127a72a6 100644 --- a/boards/nordic/nrf21540dk/nrf21540dk_nrf52840.dts +++ b/boards/nordic/nrf21540dk/nrf21540dk_nrf52840.dts @@ -279,12 +279,12 @@ fem_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000c000>; + reg = <0x00000000 0x0000C000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00076000>; + reg = <0x0000C000 0x00076000>; }; slot1_partition: partition@82000 { diff --git a/boards/nordic/nrf52833dk/nrf52833dk_nrf52820.dts b/boards/nordic/nrf52833dk/nrf52833dk_nrf52820.dts index 6516a779928f..04c90fbbb017 100644 --- a/boards/nordic/nrf52833dk/nrf52833dk_nrf52820.dts +++ b/boards/nordic/nrf52833dk/nrf52833dk_nrf52820.dts @@ -167,12 +167,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xc000>; + reg = <0x00000000 0xC000>; }; - slot0_partition: partition@c000 { + slot0_partition: partition@C000 { label = "image-0"; - reg = <0x0000c000 0x17000>; + reg = <0x0000C000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts b/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts index 098632f622b5..d7f5b3ba0b92 100644 --- a/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts +++ b/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts @@ -237,12 +237,12 @@ arduino_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xc000>; + reg = <0x00000000 0xC000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x37000>; + reg = <0x0000C000 0x37000>; }; slot1_partition: partition@43000 { @@ -252,7 +252,7 @@ arduino_spi: &spi3 { storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007a000 0x00006000>; + reg = <0x0007A000 0x00006000>; }; }; }; diff --git a/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts b/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts index 6dc7731389f8..35a9e6403012 100644 --- a/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts +++ b/boards/nordic/nrf52840dk/nrf52840dk_nrf52811.dts @@ -175,7 +175,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0xe000>; + reg = <0x0000C000 0xe000>; }; slot1_partition: partition@1a000 { diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52805.dts b/boards/nordic/nrf52dk/nrf52dk_nrf52805.dts index a27bae1c72cf..8f1ff01454dd 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52805.dts +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52805.dts @@ -150,7 +150,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0xe000>; + reg = <0x0000C000 0xe000>; }; slot1_partition: partition@1a000 { diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts b/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts index 8c72a1b5fa30..e9a50ea9ac50 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52810.dts @@ -152,7 +152,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0xe000>; + reg = <0x0000C000 0xe000>; }; slot1_partition: partition@1a000 { diff --git a/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts b/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts index 9f1b167c2165..2f7a08013580 100644 --- a/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts +++ b/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts @@ -239,7 +239,7 @@ arduino_spi: &spi2 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x37000>; + reg = <0x0000C000 0x37000>; }; slot1_partition: partition@43000 { diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts index 11d75635e32e..8d578efde1b2 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts @@ -70,12 +70,12 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x12000>; + reg = <0x0000C000 0x12000>; }; slot1_partition: partition@1e000 { label = "image-1"; - reg = <0x0001e000 0x12000>; + reg = <0x0001E000 0x12000>; }; storage_partition: partition@3a000 { diff --git a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts index 69c9cd860730..980348a849a3 100644 --- a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts @@ -89,7 +89,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x17000>; + reg = <0x0000C000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts index 044e38e497e8..d15594a7d374 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts @@ -163,7 +163,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x17000>; + reg = <0x0000C000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi b/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi index 71e1ed593ec0..41c76e48433b 100644 --- a/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi +++ b/boards/nordic/nrf7120dk/nrf7120_cpuapp_common.dtsi @@ -27,10 +27,10 @@ #size-cells = <1>; ranges; - ipc_shm_area_cpuapp_cpuuma: memory@200c0000 { + ipc_shm_area_cpuapp_cpuuma: memory@200C0000 { compatible = "mmio-sram"; - reg = <0x200c0000 0x2000>; - ranges = <0x0 0x200c0000 0x2000>; + reg = <0x200C0000 0x2000>; + ranges = <0x0 0x200C0000 0x2000>; #address-cells = <1>; #size-cells = <1>; status = "okay"; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi index 4be968ed3df2..4c082ecb7be3 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi @@ -203,12 +203,12 @@ reg = <0x376000 DT_SIZE_K(440)>; }; - cpuppr_code_partition: partition@3e4000 { - reg = <0x3e4000 DT_SIZE_K(64)>; + cpuppr_code_partition: partition@3E4000 { + reg = <0x3E4000 DT_SIZE_K(64)>; }; - cpuflpr_code_partition: partition@3f4000 { - reg = <0x3f4000 DT_SIZE_K(48)>; + cpuflpr_code_partition: partition@3F4000 { + reg = <0x3F4000 DT_SIZE_K(48)>; }; cpurad_slot0_partition: partition@400000 { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 7ae6e8ca81a2..12ef4b4bb828 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -139,7 +139,7 @@ * - Bell 18: cpurad * - Bells 24, 25, 29, 31: cpucell */ - nordic,interrupt-mapping = <0xa3042041 0>; + nordic,interrupt-mapping = <0xA3042041 0>; }; &cpurad_bellboard { diff --git a/boards/nordic/thingy52/thingy52_nrf52832.dts b/boards/nordic/thingy52/thingy52_nrf52832.dts index a023b06e55b9..e081ae877ce2 100644 --- a/boards/nordic/thingy52/thingy52_nrf52832.dts +++ b/boards/nordic/thingy52/thingy52_nrf52832.dts @@ -206,12 +206,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts index d74952119839..e3b4465b0751 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts +++ b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts @@ -154,7 +154,7 @@ fem_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x17000>; + reg = <0x0000C000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/nxp/frdm_k22f/frdm_k22f.dts b/boards/nxp/frdm_k22f/frdm_k22f.dts index 0a6d810ad8ff..0ca83d4f905c 100644 --- a/boards/nxp/frdm_k22f/frdm_k22f.dts +++ b/boards/nxp/frdm_k22f/frdm_k22f.dts @@ -231,14 +231,14 @@ zephyr_uhc0: &usbh { reg = <0x00010000 DT_SIZE_K(182)>; }; - slot1_partition: partition@3d800 { + slot1_partition: partition@3D800 { label = "image-1"; - reg = <0x0003d800 DT_SIZE_K(182)>; + reg = <0x0003D800 DT_SIZE_K(182)>; }; - storage_partition: partition@6b000 { + storage_partition: partition@6B000 { label = "storage"; - reg = <0x0006b000 DT_SIZE_K(84)>; + reg = <0x0006B000 DT_SIZE_K(84)>; }; }; }; diff --git a/boards/nxp/frdm_mcxa153/frdm_mcxa153.dts b/boards/nxp/frdm_mcxa153/frdm_mcxa153.dts index 4219f02b8447..8f568d40ddbd 100644 --- a/boards/nxp/frdm_mcxa153/frdm_mcxa153.dts +++ b/boards/nxp/frdm_mcxa153/frdm_mcxa153.dts @@ -169,9 +169,9 @@ reg = <0x00012000 DT_SIZE_K(40)>; }; - storage_partition: partition@1c000 { + storage_partition: partition@1C000 { label = "storage"; - reg = <0x0001c000 DT_SIZE_K(16)>; + reg = <0x0001C000 DT_SIZE_K(16)>; }; }; }; diff --git a/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts b/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts index 069c3a06ee21..9e6433e974d7 100644 --- a/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts +++ b/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts @@ -127,9 +127,9 @@ reg = <0x00004000 DT_SIZE_K(100)>; }; - slot1_partition: partition@1d000 { + slot1_partition: partition@1D000 { label = "image-1"; - reg = <0x0001d000 DT_SIZE_K(100)>; + reg = <0x0001D000 DT_SIZE_K(100)>; }; storage_partition: partition@36000 { diff --git a/boards/nxp/frdm_mcxa577/frdm_mcxa577.dts b/boards/nxp/frdm_mcxa577/frdm_mcxa577.dts index e47bb5fe58c9..d395e97c3e2a 100644 --- a/boards/nxp/frdm_mcxa577/frdm_mcxa577.dts +++ b/boards/nxp/frdm_mcxa577/frdm_mcxa577.dts @@ -148,9 +148,9 @@ reg = <0x00100000 DT_SIZE_K(896)>; }; - storage_partition: partition@1e0000 { + storage_partition: partition@1E0000 { label = "storage"; - reg = <0x001e0000 DT_SIZE_K(128)>; + reg = <0x001E0000 DT_SIZE_K(128)>; }; }; }; diff --git a/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts b/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts index fcd50f6e129f..b120147eb273 100644 --- a/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts +++ b/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts @@ -188,7 +188,7 @@ i2c0: &i2c0 { status = "okay"; pinctrl-0 = <&pinmux_tpm0>; pinctrl-names = "default"; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 24>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 24>; }; zephyr_udc0: &usb { diff --git a/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts b/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts index 0f24cc60cf73..b5e83a71fb5a 100644 --- a/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts +++ b/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts @@ -381,9 +381,9 @@ nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 { reg = <0x0084000 DT_SIZE_K(440)>; }; - storage_partition: partition@f0000 { + storage_partition: partition@F0000 { label = "storage"; - reg = <0x000f0000 DT_SIZE_K(64)>; + reg = <0x000F0000 DT_SIZE_K(64)>; }; }; }; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi b/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi index 908f5f209d7f..a02998337b55 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi @@ -278,9 +278,9 @@ arduino_serial: &flexcomm2_lpuart2 {}; reg = <0x00014000 DT_SIZE_K(984)>; }; - slot1_partition: partition@10a000 { + slot1_partition: partition@10A000 { label = "image-1"; - reg = <0x0010a000 DT_SIZE_K(984)>; + reg = <0x0010A000 DT_SIZE_K(984)>; }; /* storage_partition is placed in WINBOND flash memory*/ }; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts index 562c73a76ce0..7e4ac87cb46a 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts @@ -88,9 +88,9 @@ }; /* Non-secure image - secondary */ - slot1_ns_partition: partition@e0000 { + slot1_ns_partition: partition@E0000 { label = "image-1-non-secure"; - reg = <0x000e0000 DT_SIZE_K(256)>; /* 256 KB */ + reg = <0x000E0000 DT_SIZE_K(256)>; /* 256 KB */ }; /* Protected Storage (PS) */ diff --git a/boards/nxp/frdm_mcxw23/dts/bypass_first_32k.overlay b/boards/nxp/frdm_mcxw23/dts/bypass_first_32k.overlay index 51d95fefdacd..7b61d0957bab 100644 --- a/boards/nxp/frdm_mcxw23/dts/bypass_first_32k.overlay +++ b/boards/nxp/frdm_mcxw23/dts/bypass_first_32k.overlay @@ -5,5 +5,5 @@ */ &sram0 { - reg = <0x2000c000 DT_SIZE_K(80)>; + reg = <0x2000C000 DT_SIZE_K(80)>; }; diff --git a/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts b/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts index 7c5301729855..7edb77a0eda9 100644 --- a/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts +++ b/boards/nxp/frdm_mcxw71/frdm_mcxw71.dts @@ -186,17 +186,17 @@ arduino_i2c: &lpi2c1 {}; reg = <0x10000 DT_SIZE_K(424)>; }; - slot1_partition: partition@7a000 { - reg = <0x7a000 DT_SIZE_K(424)>; + slot1_partition: partition@7A000 { + reg = <0x7A000 DT_SIZE_K(424)>; }; - storage_partition: partition@e4000 { - reg = <0xe4000 DT_SIZE_K(104)>; + storage_partition: partition@E4000 { + reg = <0xE4000 DT_SIZE_K(104)>; }; - hw_params_partition: partition@fe000 { + hw_params_partition: partition@FE000 { label = "hw-parameters"; - reg = <0xfe000 DT_SIZE_K(8)>; + reg = <0xFE000 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/nxp/frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts b/boards/nxp/frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts index 29d78a02faa7..cf753867af50 100644 --- a/boards/nxp/frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts +++ b/boards/nxp/frdm_mcxw72/frdm_mcxw72_mcxw727c_cpu0.dts @@ -134,13 +134,13 @@ reg = <0x0 DT_SIZE_K(2024)>; }; - storage_partition: partition@1fa000 { - reg = <0x1fa000 DT_SIZE_K(16)>; + storage_partition: partition@1FA000 { + reg = <0x1FA000 DT_SIZE_K(16)>; }; - hw_params_partition: partition@1fe000 { + hw_params_partition: partition@1FE000 { label = "hw-parameters"; - reg = <0x1fe000 DT_SIZE_K(8)>; + reg = <0x1FE000 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/nxp/imx95_evk/imx95_evk_mimx9596_m7.dts b/boards/nxp/imx95_evk/imx95_evk_mimx9596_m7.dts index ff220f6ad5c5..7e513f583660 100644 --- a/boards/nxp/imx95_evk/imx95_evk_mimx9596_m7.dts +++ b/boards/nxp/imx95_evk/imx95_evk_mimx9596_m7.dts @@ -91,9 +91,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts b/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts index d5b5cb3e7eed..973570648784 100644 --- a/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts +++ b/boards/nxp/lpcxpresso55s28/lpcxpresso55s28.dts @@ -119,9 +119,9 @@ reg = <0x00008000 DT_SIZE_K(208)>; }; - slot1_partition: partition@3c000 { + slot1_partition: partition@3C000 { label = "image-1"; - reg = <0x0003c000 DT_SIZE_K(208)>; + reg = <0x0003C000 DT_SIZE_K(208)>; }; storage_partition: partition@70000 { diff --git a/boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi b/boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi index 3862ffa98e30..8332a3eea471 100644 --- a/boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi +++ b/boards/nxp/mcx_nx4x_evk/mcx_nx4x_evk.dtsi @@ -146,9 +146,9 @@ nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 { reg = <0x00014000 DT_SIZE_K(984)>; }; - slot1_partition: partition@10a000 { + slot1_partition: partition@10A000 { label = "image-1"; - reg = <0x0010a000 DT_SIZE_K(984)>; + reg = <0x0010A000 DT_SIZE_K(984)>; }; /* storage_partition is placed in WINBOND flash memory*/ diff --git a/boards/nxp/mcxw23_evk/dts/bypass_first_32k.overlay b/boards/nxp/mcxw23_evk/dts/bypass_first_32k.overlay index 51d95fefdacd..7b61d0957bab 100644 --- a/boards/nxp/mcxw23_evk/dts/bypass_first_32k.overlay +++ b/boards/nxp/mcxw23_evk/dts/bypass_first_32k.overlay @@ -5,5 +5,5 @@ */ &sram0 { - reg = <0x2000c000 DT_SIZE_K(80)>; + reg = <0x2000C000 DT_SIZE_K(80)>; }; diff --git a/boards/nxp/mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts b/boards/nxp/mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts index 0164309e733f..672f7712c6cf 100644 --- a/boards/nxp/mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts +++ b/boards/nxp/mcxw72_evk/mcxw72_evk_mcxw727c_cpu0.dts @@ -134,13 +134,13 @@ reg = <0x0 DT_SIZE_K(2024)>; }; - storage_partition: partition@1fa000 { - reg = <0x1fa000 DT_SIZE_K(16)>; + storage_partition: partition@1FA000 { + reg = <0x1FA000 DT_SIZE_K(16)>; }; - hw_params_partition: partition@1fe000 { + hw_params_partition: partition@1FE000 { label = "hw-parameters"; - reg = <0x1fe000 DT_SIZE_K(8)>; + reg = <0x1FE000 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts b/boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts index f08a6d2c005b..bf416dae98e7 100644 --- a/boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts +++ b/boards/nxp/mimxrt1010_evk/mimxrt1010_evk.dts @@ -130,9 +130,9 @@ arduino_serial: &lpuart1 {}; reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts b/boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts index ef36e75c99e8..22f2cab4767d 100644 --- a/boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts +++ b/boards/nxp/mimxrt1015_evk/mimxrt1015_evk.dts @@ -127,9 +127,9 @@ arduino_serial: &lpuart4 { reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts b/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts index bca1718913be..07a86e4e8588 100644 --- a/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts +++ b/boards/nxp/mimxrt1024_evk/mimxrt1024_evk.dts @@ -127,9 +127,9 @@ arduino_serial: &lpuart2 { reg = <0x00201000 DT_SIZE_K(1924)>; }; - storage_partition: partition@3e2000 { + storage_partition: partition@3E2000 { label = "storage"; - reg = <0x003e2000 DT_SIZE_K(120)>; + reg = <0x003E2000 DT_SIZE_K(120)>; }; }; }; diff --git a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk_mimxrt1062_qspi_C.overlay b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk_mimxrt1062_qspi_C.overlay index c4d2f4a4ba1f..63862a724c02 100644 --- a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk_mimxrt1062_qspi_C.overlay +++ b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk_mimxrt1062_qspi_C.overlay @@ -40,7 +40,7 @@ audio_codec: wm8962@1a { compatible = "wolfson,wm8962"; reg = <0x1a>; - clocks = <&ccm IMX_CCM_SAI1_CLK 0x7c 18>; + clocks = <&ccm IMX_CCM_SAI1_CLK 0x7C 18>; clock-names = "mclk"; }; }; @@ -86,9 +86,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi b/boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi index 8a1d8af112ed..ac1b5c6af4c6 100644 --- a/boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi +++ b/boards/nxp/mimxrt1160_evk/mimxrt1160_evk.dtsi @@ -128,9 +128,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi index 45541035e5f3..5059c202dd5f 100644 --- a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi +++ b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk.dtsi @@ -298,9 +298,9 @@ arduino_spi: &lpspi1 { reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm4_B.overlay b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm4_B.overlay index 44e4487c78f5..64236b4ce536 100644 --- a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm4_B.overlay +++ b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm4_B.overlay @@ -57,9 +57,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(50) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(50) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay index 27d5325b0f77..a073a86d6a83 100644 --- a/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay +++ b/boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay @@ -60,9 +60,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(50) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(50) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi b/boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi index 220216046328..5b21283a7041 100644 --- a/boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi +++ b/boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi @@ -232,9 +232,9 @@ reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts b/boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts index 694d2fb80c00..2bf7fa89d26a 100644 --- a/boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts +++ b/boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts @@ -395,9 +395,9 @@ zephyr_lcdif: &lcdif {}; reg = <0x00720000 DT_SIZE_M(7)>; }; - storage_partition: partition@e20000 { + storage_partition: partition@E20000 { label = "storage"; - reg = <0x00e20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; + reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>; }; }; }; diff --git a/boards/nxp/rd_rw612_bga/dts/goworld_16880_lcm.overlay b/boards/nxp/rd_rw612_bga/dts/goworld_16880_lcm.overlay index 5085022b4fad..3f338f241a3a 100644 --- a/boards/nxp/rd_rw612_bga/dts/goworld_16880_lcm.overlay +++ b/boards/nxp/rd_rw612_bga/dts/goworld_16880_lcm.overlay @@ -46,15 +46,15 @@ width = <480>; invert-mode = "1-dot"; frmctl1 = [80 10]; - bpc = [1f 50 00 20]; - dfc = [8a 07 3b]; + bpc = [1F 50 00 20]; + dfc = [8A 07 3B]; pwr1 = [80 64]; pwr2 = <0x13>; - pwr3 = <0xa7>; + pwr3 = <0xA7>; vcmpctl = <0x09>; - doca = [40 8a 00 00 29 19 a5 38]; - pgc = [f0 06 0b 07 06 05 2e 33 47 3a 17 16 2e 31]; - ngc = [f0 09 0d 09 08 23 2e 33 46 38 13 13 2c 32]; + doca = [40 8A 00 00 29 19 A5 38]; + pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31]; + ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32]; madctl = <0x28>; }; }; diff --git a/boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts b/boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts index c98192a4cd81..ebd2cd80cee8 100644 --- a/boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts +++ b/boards/nxp/rddrone_fmuk66/rddrone_fmuk66.dts @@ -253,14 +253,14 @@ zephyr_udc0: &usbotg { reg = <0x00010000 DT_SIZE_K(932)>; }; - slot1_partition: partition@f9000 { + slot1_partition: partition@F9000 { label = "image-1"; - reg = <0x000f9000 DT_SIZE_K(932)>; + reg = <0x000F9000 DT_SIZE_K(932)>; }; - storage_partition: partition@1e2000 { + storage_partition: partition@1E2000 { label = "storage"; - reg = <0x001e2000 DT_SIZE_K(120)>; + reg = <0x001E2000 DT_SIZE_K(120)>; }; }; }; diff --git a/boards/nxp/twr_kv58f220m/twr_kv58f220m.dts b/boards/nxp/twr_kv58f220m/twr_kv58f220m.dts index b886da936808..4af2188aef3a 100644 --- a/boards/nxp/twr_kv58f220m/twr_kv58f220m.dts +++ b/boards/nxp/twr_kv58f220m/twr_kv58f220m.dts @@ -137,14 +137,14 @@ reg = <0x00010000 DT_SIZE_K(424)>; }; - slot1_partition: partition@7a000 { + slot1_partition: partition@7A000 { label = "image-1"; - reg = <0x0007a000 DT_SIZE_K(424)>; + reg = <0x0007A000 DT_SIZE_K(424)>; }; - storage_partition: partition@e4000 { + storage_partition: partition@E4000 { label = "storage"; - reg = <0x000e4000 DT_SIZE_K(112)>; + reg = <0x000E4000 DT_SIZE_K(112)>; }; }; }; 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 a2aa5736737d..e3c4f20166f5 100644 --- a/boards/openisa/rv32m1_vega/rv32m1_vega_openisa_rv32m1_ri5cy.dts +++ b/boards/openisa/rv32m1_vega/rv32m1_vega_openisa_rv32m1_ri5cy.dts @@ -59,7 +59,7 @@ boot_partition: partition@f4000 { label = "mcuboot"; - reg = <0x000f4000 0x0000c000>; + reg = <0x000f4000 0x0000C000>; }; }; }; diff --git a/boards/panasonic/pan1770_evb/pan1770_evb.dts b/boards/panasonic/pan1770_evb/pan1770_evb.dts index 9ce07b12ac45..fa2fd75e6cc5 100644 --- a/boards/panasonic/pan1770_evb/pan1770_evb.dts +++ b/boards/panasonic/pan1770_evb/pan1770_evb.dts @@ -265,12 +265,12 @@ arduino_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x000000000 0x0000c000>; + reg = <0x000000000 0x0000C000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00067000>; + reg = <0x0000C000 0x00067000>; }; slot1_partition: partition@73000 { diff --git a/boards/panasonic/pan1780_evb/pan1780_evb.dts b/boards/panasonic/pan1780_evb/pan1780_evb.dts index 72585a723f36..27cfc4208e31 100644 --- a/boards/panasonic/pan1780_evb/pan1780_evb.dts +++ b/boards/panasonic/pan1780_evb/pan1780_evb.dts @@ -265,12 +265,12 @@ arduino_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x000000000 0x0000c000>; + reg = <0x000000000 0x0000C000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00067000>; + reg = <0x0000C000 0x00067000>; }; slot1_partition: partition@73000 { diff --git a/boards/panasonic/pan1782_evb/pan1782_evb.dts b/boards/panasonic/pan1782_evb/pan1782_evb.dts index f9b027606ef5..7186348edd5a 100644 --- a/boards/panasonic/pan1782_evb/pan1782_evb.dts +++ b/boards/panasonic/pan1782_evb/pan1782_evb.dts @@ -191,27 +191,27 @@ arduino_spi: &spi3 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x000000000 0xc000>; + reg = <0x000000000 0xC000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { label = "image-scratch"; - reg = <0x00070000 0xa000>; + reg = <0x00070000 0xA000>; }; storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007a000 0x00006000>; + reg = <0x0007A000 0x00006000>; }; }; }; diff --git a/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi b/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi index f25de361d20c..4fc10e6f8147 100644 --- a/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi +++ b/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi @@ -194,7 +194,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x17000>; + reg = <0x0000C000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/phytec/reel_board/reel_board.dts b/boards/phytec/reel_board/reel_board.dts index b819d372cdc9..4c8997a1c4e4 100644 --- a/boards/phytec/reel_board/reel_board.dts +++ b/boards/phytec/reel_board/reel_board.dts @@ -72,9 +72,9 @@ border-waveform = <0x71>; dummy-line = <0x1a>; gate-line-width = <0x08>; - lut = [22 55 aa 55 aa 55 aa 11 + lut = [22 55 AA 55 AA 55 AA 11 00 00 00 00 00 00 00 00 - 1e 1e 1e 1e 1e 1e 1e 1e + 1E 1E 1E 1E 1E 1E 1E 1E 01 00 00 00 00]; }; @@ -87,7 +87,7 @@ gate-line-width = <0x08>; lut = [18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0f 01 00 00 00 00 00 00 + 0F 01 00 00 00 00 00 00 00 00 00 00 00]; }; }; diff --git a/boards/phytec/reel_board/reel_board_nrf52840_2.overlay b/boards/phytec/reel_board/reel_board_nrf52840_2.overlay index f2749f66f205..d2766240872b 100644 --- a/boards/phytec/reel_board/reel_board_nrf52840_2.overlay +++ b/boards/phytec/reel_board/reel_board_nrf52840_2.overlay @@ -99,7 +99,7 @@ 40 00 00 00 00 00 00 /* LUT2: WB: VS0..6 */ 80 00 00 00 00 00 00 /* LUT3: WW: VS0..6 */ 00 00 00 00 00 00 00 /* LUT4: VCOM: VS0..6 */ - 0a 00 00 00 04 /* TP0A TP0B TP0C TP0D RP0 */ + 0A 00 00 00 04 /* TP0A TP0B TP0C TP0D RP0 */ 00 00 00 00 00 /* TP1A TP1B TP1C TP1D RP1 */ 00 00 00 00 00 /* TP2A TP2B TP2C TP2D RP2 */ 00 00 00 00 00 /* TP3A TP3B TP3C TP3D RP3 */ diff --git a/boards/pine64/pinetime_devkit0/pinetime_devkit0.dts b/boards/pine64/pinetime_devkit0/pinetime_devkit0.dts index b69c5ddfb328..e5a3cd0473f6 100644 --- a/boards/pine64/pinetime_devkit0/pinetime_devkit0.dts +++ b/boards/pine64/pinetime_devkit0/pinetime_devkit0.dts @@ -109,10 +109,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; - nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; - ram-param = [00 f0]; - rgb-param = [cd 08 14]; + pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; + nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; + ram-param = [00 F0]; + rgb-param = [CD 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; @@ -236,7 +236,7 @@ /* main firmware partition */ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x74000>; + reg = <0x0000C000 0x74000>; }; }; }; diff --git a/boards/qorvo/decawave_dwm1001_dev/decawave_dwm1001_dev.dts b/boards/qorvo/decawave_dwm1001_dev/decawave_dwm1001_dev.dts index ea8021b88644..d78f4df1f20f 100644 --- a/boards/qorvo/decawave_dwm1001_dev/decawave_dwm1001_dev.dts +++ b/boards/qorvo/decawave_dwm1001_dev/decawave_dwm1001_dev.dts @@ -178,12 +178,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts index 44481be48bd6..9ce633a01c63 100644 --- a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts +++ b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts @@ -139,12 +139,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xc000>; + reg = <0x00000000 0xC000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x38000>; + reg = <0x0000C000 0x38000>; }; slot1_partition: partition@44000 { @@ -154,7 +154,7 @@ storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007a000 0x00006000>; + reg = <0x0007A000 0x00006000>; }; }; }; diff --git a/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts b/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts index cd362309e198..b6893a916f70 100644 --- a/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts +++ b/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts @@ -134,7 +134,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x17000>; + reg = <0x0000C000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts index 85802f9c8766..6b4aa354bb91 100644 --- a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts +++ b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts @@ -44,7 +44,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x17000>; + reg = <0x0000C000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts index 85802f9c8766..6b4aa354bb91 100644 --- a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts +++ b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts @@ -44,7 +44,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x17000>; + reg = <0x0000C000 0x17000>; }; slot1_partition: partition@23000 { diff --git a/boards/renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts b/boards/renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts index 1ddc19d6b15d..9d1efcd347ea 100644 --- a/boards/renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts +++ b/boards/renesas/cpkcor_ra8d1b/cpkcor_ra8d1b.dts @@ -151,7 +151,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(12)>; + reg = <0X0 DT_SIZE_K(12)>; }; }; }; diff --git a/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_psram.overlay b/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_psram.overlay index f1e0f2ed807f..e44f1484bc5c 100644 --- a/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_psram.overlay +++ b/boards/renesas/da14695_dk_usb/dts/da14695_dk_usb_psram.overlay @@ -19,9 +19,9 @@ status = "okay"; is-ram; dev-size = ; - dev-type = <0x5d>; - dev-id = <0x0d>; - dev-density = <0xe040>; + dev-type = <0x5D>; + dev-id = <0x0D>; + dev-density = <0xE040>; reset-delay-us = <50>; read-cs-idle-min-ns = <18>; tcem-max-us = <2>; @@ -30,7 +30,7 @@ extra-byte-enable; extra-byte = <0x0>; dummy-bytes-count = "dummy-bytes-count2"; - read-cmd = <0xeb>; + read-cmd = <0xEB>; write-cmd = <0x38>; rx-inst-mode = "quad-spi"; rx-addr-mode = "quad-spi"; diff --git a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_psram.overlay b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_psram.overlay index f1e0f2ed807f..e44f1484bc5c 100644 --- a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_psram.overlay +++ b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_psram.overlay @@ -19,9 +19,9 @@ status = "okay"; is-ram; dev-size = ; - dev-type = <0x5d>; - dev-id = <0x0d>; - dev-density = <0xe040>; + dev-type = <0x5D>; + dev-id = <0x0D>; + dev-density = <0xE040>; reset-delay-us = <50>; read-cs-idle-min-ns = <18>; tcem-max-us = <2>; @@ -30,7 +30,7 @@ extra-byte-enable; extra-byte = <0x0>; dummy-bytes-count = "dummy-bytes-count2"; - read-cmd = <0xeb>; + read-cmd = <0xEB>; write-cmd = <0x38>; rx-inst-mode = "quad-spi"; rx-addr-mode = "quad-spi"; diff --git a/boards/renesas/ek_ra2a1/ek_ra2a1.dts b/boards/renesas/ek_ra2a1/ek_ra2a1.dts index 22315fb8e653..48e422257383 100644 --- a/boards/renesas/ek_ra2a1/ek_ra2a1.dts +++ b/boards/renesas/ek_ra2a1/ek_ra2a1.dts @@ -159,7 +159,7 @@ ssdiv = "1.00"; so = <0x108>; snum = <0x01>; - sdpa = <0x0b>; + sdpa = <0x0B>; on-freq = <3>; off-freq = <3>; drift-freq = <255>; diff --git a/boards/renesas/ek_ra4e2/ek_ra4e2.dts b/boards/renesas/ek_ra4e2/ek_ra4e2.dts index 22d3f66185d8..75643d16b91c 100644 --- a/boards/renesas/ek_ra4e2/ek_ra4e2.dts +++ b/boards/renesas/ek_ra4e2/ek_ra4e2.dts @@ -213,7 +213,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(4)>; + reg = <0X0 DT_SIZE_K(4)>; }; }; }; diff --git a/boards/renesas/ek_ra4m2/ek_ra4m2.dts b/boards/renesas/ek_ra4m2/ek_ra4m2.dts index 486d9411116d..04bfe461a2fc 100644 --- a/boards/renesas/ek_ra4m2/ek_ra4m2.dts +++ b/boards/renesas/ek_ra4m2/ek_ra4m2.dts @@ -175,7 +175,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/ek_ra4m3/ek_ra4m3.dts b/boards/renesas/ek_ra4m3/ek_ra4m3.dts index 5b7db6c3becc..0d00778baa37 100644 --- a/boards/renesas/ek_ra4m3/ek_ra4m3.dts +++ b/boards/renesas/ek_ra4m3/ek_ra4m3.dts @@ -173,7 +173,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/ek_ra6e2/ek_ra6e2.dts b/boards/renesas/ek_ra6e2/ek_ra6e2.dts index ac5e1e64e7eb..2b806a5dce7f 100644 --- a/boards/renesas/ek_ra6e2/ek_ra6e2.dts +++ b/boards/renesas/ek_ra6e2/ek_ra6e2.dts @@ -189,7 +189,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(4)>; + reg = <0X0 DT_SIZE_K(4)>; }; }; }; diff --git a/boards/renesas/ek_ra6m1/ek_ra6m1.dts b/boards/renesas/ek_ra6m1/ek_ra6m1.dts index 9b429c7a5308..ce09e71c8afb 100644 --- a/boards/renesas/ek_ra6m1/ek_ra6m1.dts +++ b/boards/renesas/ek_ra6m1/ek_ra6m1.dts @@ -143,7 +143,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/ek_ra6m2/ek_ra6m2.dts b/boards/renesas/ek_ra6m2/ek_ra6m2.dts index 73ea49c3d956..3de37950b8e9 100644 --- a/boards/renesas/ek_ra6m2/ek_ra6m2.dts +++ b/boards/renesas/ek_ra6m2/ek_ra6m2.dts @@ -139,7 +139,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(32)>; + reg = <0X0 DT_SIZE_K(32)>; }; }; }; diff --git a/boards/renesas/ek_ra6m3/ek_ra6m3.dts b/boards/renesas/ek_ra6m3/ek_ra6m3.dts index 44eb89fd38b9..ce22f083a3fe 100644 --- a/boards/renesas/ek_ra6m3/ek_ra6m3.dts +++ b/boards/renesas/ek_ra6m3/ek_ra6m3.dts @@ -190,7 +190,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(64)>; + reg = <0X0 DT_SIZE_K(64)>; }; }; }; diff --git a/boards/renesas/ek_ra6m4/ek_ra6m4.dts b/boards/renesas/ek_ra6m4/ek_ra6m4.dts index 4b4a6db6cb9c..5b664eee0021 100644 --- a/boards/renesas/ek_ra6m4/ek_ra6m4.dts +++ b/boards/renesas/ek_ra6m4/ek_ra6m4.dts @@ -313,7 +313,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; @@ -362,7 +362,7 @@ pmod_header: &pmod2_header {}; }; ð { - local-mac-address = [74 90 50 b0 6d 5d]; + local-mac-address = [74 90 50 B0 6D 5D]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/ek_ra6m5/ek_ra6m5.dts b/boards/renesas/ek_ra6m5/ek_ra6m5.dts index 6f63b055b1f4..28e844b3a1fb 100644 --- a/boards/renesas/ek_ra6m5/ek_ra6m5.dts +++ b/boards/renesas/ek_ra6m5/ek_ra6m5.dts @@ -284,7 +284,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; @@ -316,7 +316,7 @@ arduino_spi: &spi0 {}; }; ð { - local-mac-address = [74 90 50 b0 6d 5c]; + local-mac-address = [74 90 50 B0 6D 5C]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/ek_ra8d1/ek_ra8d1.dts b/boards/renesas/ek_ra8d1/ek_ra8d1.dts index 83be7187b5f2..e941eaa577c9 100644 --- a/boards/renesas/ek_ra8d1/ek_ra8d1.dts +++ b/boards/renesas/ek_ra8d1/ek_ra8d1.dts @@ -319,7 +319,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(12)>; + reg = <0X0 DT_SIZE_K(12)>; }; }; }; @@ -367,7 +367,7 @@ }; ð { - local-mac-address = [74 90 50 b0 5d e9]; + local-mac-address = [74 90 50 B0 5D E9]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/ek_ra8m1/ek_ra8m1.dts b/boards/renesas/ek_ra8m1/ek_ra8m1.dts index de68c6933123..9cec8fe638dc 100644 --- a/boards/renesas/ek_ra8m1/ek_ra8m1.dts +++ b/boards/renesas/ek_ra8m1/ek_ra8m1.dts @@ -371,7 +371,7 @@ mikrobus_spi: &spi1 {}; storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(12)>; + reg = <0X0 DT_SIZE_K(12)>; }; }; }; @@ -397,7 +397,7 @@ pmod_serial: &pmod1_serial {}; pmod_header: &pmod1_header {}; ð { - local-mac-address = [74 90 50 b0 6d 5a]; + local-mac-address = [74 90 50 B0 6D 5A]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/ek_rx261/ek_rx261.dts b/boards/renesas/ek_rx261/ek_rx261.dts index 9ef757f9ed40..e7841dd2dfc3 100644 --- a/boards/renesas/ek_rx261/ek_rx261.dts +++ b/boards/renesas/ek_rx261/ek_rx261.dts @@ -133,7 +133,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/fpb_ra4e1/fpb_ra4e1.dts b/boards/renesas/fpb_ra4e1/fpb_ra4e1.dts index d01787531b91..4f62f92bc014 100644 --- a/boards/renesas/fpb_ra4e1/fpb_ra4e1.dts +++ b/boards/renesas/fpb_ra4e1/fpb_ra4e1.dts @@ -152,7 +152,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/fpb_ra6e1/fpb_ra6e1.dts b/boards/renesas/fpb_ra6e1/fpb_ra6e1.dts index 494bffd04350..61a1bc73235c 100644 --- a/boards/renesas/fpb_ra6e1/fpb_ra6e1.dts +++ b/boards/renesas/fpb_ra6e1/fpb_ra6e1.dts @@ -112,7 +112,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts b/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts index 26dd38f38bb3..e5965dd83c49 100644 --- a/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts +++ b/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts @@ -90,7 +90,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(4)>; + reg = <0X0 DT_SIZE_K(4)>; }; }; }; diff --git a/boards/renesas/fpb_rx261/fpb_rx261.dts b/boards/renesas/fpb_rx261/fpb_rx261.dts index d9877e56c4be..d735a73f4585 100644 --- a/boards/renesas/fpb_rx261/fpb_rx261.dts +++ b/boards/renesas/fpb_rx261/fpb_rx261.dts @@ -115,7 +115,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/mck_ra8t1/mck_ra8t1.dts b/boards/renesas/mck_ra8t1/mck_ra8t1.dts index aeedfd02a436..90528485d355 100644 --- a/boards/renesas/mck_ra8t1/mck_ra8t1.dts +++ b/boards/renesas/mck_ra8t1/mck_ra8t1.dts @@ -171,7 +171,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(12)>; + reg = <0X0 DT_SIZE_K(12)>; }; }; }; @@ -204,7 +204,7 @@ }; ð { - local-mac-address = [74 90 50 6d 81 75]; + local-mac-address = [74 90 50 6D 81 75]; status = "okay"; phy-handle = <&phy>; }; diff --git a/boards/renesas/rsk_rx130/rsk_rx130.dts b/boards/renesas/rsk_rx130/rsk_rx130.dts index 6c15d97e411a..92b04bcf6ec0 100644 --- a/boards/renesas/rsk_rx130/rsk_rx130.dts +++ b/boards/renesas/rsk_rx130/rsk_rx130.dts @@ -196,7 +196,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/renesas/rza2m_evk/rza2m_evk.dts b/boards/renesas/rza2m_evk/rza2m_evk.dts index 8f1673aa1836..3db33997c522 100644 --- a/boards/renesas/rza2m_evk/rza2m_evk.dts +++ b/boards/renesas/rza2m_evk/rza2m_evk.dts @@ -52,9 +52,9 @@ read-only; }; - slot0_partition: partition@e000 { + slot0_partition: partition@E000 { label = "image-0"; - reg = <0x0000e000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; + reg = <0x0000E000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; read-only; }; }; diff --git a/boards/renesas/voice_ra4e1/voice_ra4e1.dts b/boards/renesas/voice_ra4e1/voice_ra4e1.dts index 46a6de50b45a..5e616c0933aa 100644 --- a/boards/renesas/voice_ra4e1/voice_ra4e1.dts +++ b/boards/renesas/voice_ra4e1/voice_ra4e1.dts @@ -121,7 +121,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(8)>; + reg = <0X0 DT_SIZE_K(8)>; }; }; }; diff --git a/boards/ruiside/art_pi/art_pi.dts b/boards/ruiside/art_pi/art_pi.dts index c1ae16b23da4..64d71fb2a341 100644 --- a/boards/ruiside/art_pi/art_pi.dts +++ b/boards/ruiside/art_pi/art_pi.dts @@ -30,7 +30,7 @@ sdram1: memory@c0000000 { compatible = "zephyr,memory-region", "mmio-sram"; device_type = "memory"; - reg = <0xc0000000 0x00600000>; /* Use 6 MB MAX 32MB */ + reg = <0xC0000000 0x00600000>; /* Use 6 MB MAX 32MB */ zephyr,memory-region = "SDRAM1"; zephyr,memory-attr = ; }; @@ -196,9 +196,9 @@ width = <800>; height = <480>; pixel-format = ; - def-back-color-red = <0x00>; - def-back-color-green = <0x00>; - def-back-color-blue = <0x00>; + def-back-color-red = <0X00>; + def-back-color-green = <0X00>; + def-back-color-blue = <0X00>; display-timings { compatible = "zephyr,panel-timing"; @@ -352,7 +352,7 @@ zephyr_udc0: &usbotg_fs { status = "okay"; phy-connection-type = "rmii"; phy-handle = <ð_phy>; - local-mac-address = [00 80 e1 2a 75 01]; + local-mac-address = [00 80 E1 2A 75 01]; pinctrl-0 = <ð_ref_clk_pa1 ð_crs_dv_pa7 ð_rxd0_pc4 diff --git a/boards/ruiside/ra8d1_vision_board/ra8d1_vision_board.dts b/boards/ruiside/ra8d1_vision_board/ra8d1_vision_board.dts index 2c4079c6e9d0..6ee870de5e8c 100644 --- a/boards/ruiside/ra8d1_vision_board/ra8d1_vision_board.dts +++ b/boards/ruiside/ra8d1_vision_board/ra8d1_vision_board.dts @@ -165,7 +165,7 @@ storage_partition: partition@0 { label = "storage"; - reg = <0x0 DT_SIZE_K(12)>; + reg = <0X0 DT_SIZE_K(12)>; }; }; }; diff --git a/boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts b/boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts index c66c02e06ef9..ef8188bc607c 100644 --- a/boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts +++ b/boards/ruuvi/ruuvitag/ruuvi_ruuvitag.dts @@ -119,12 +119,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/seeed/xiao_mg24/xiao_mg24.dts b/boards/seeed/xiao_mg24/xiao_mg24.dts index 233a28e0d3ea..0cf0e6cd0aa6 100644 --- a/boards/seeed/xiao_mg24/xiao_mg24.dts +++ b/boards/seeed/xiao_mg24/xiao_mg24.dts @@ -292,13 +292,13 @@ /* Reserve 736 kB for the application in slot 0 */ slot0_partition: partition@c000 { - reg = <0x0000c000 0x000b8000>; + reg = <0x0000c000 0x000B8000>; label = "image-0"; }; /* Reserve 736 kB for the application in slot 1 */ - slot1_partition: partition@c4000 { - reg = <0x000c4000 0x000b8000>; + slot1_partition: partition@C4000 { + reg = <0x000C4000 0x000B8000>; label = "image-1"; }; diff --git a/boards/shields/abrobot_esp32c3_oled/abrobot_sh1106_72x40.overlay b/boards/shields/abrobot_esp32c3_oled/abrobot_sh1106_72x40.overlay index 109befad278f..7160e706c87f 100644 --- a/boards/shields/abrobot_esp32c3_oled/abrobot_sh1106_72x40.overlay +++ b/boards/shields/abrobot_esp32c3_oled/abrobot_sh1106_72x40.overlay @@ -23,7 +23,7 @@ height = <40>; segment-offset = <30>; page-offset = <0>; - display-offset = <0xc>; + display-offset = <0xC>; multiplex-ratio = <0x27>; prechargep = <0x22>; ready-time-ms = <10>; diff --git a/boards/shields/arduino_giga_display_shield/arduino_giga_display_shield.overlay b/boards/shields/arduino_giga_display_shield/arduino_giga_display_shield.overlay index 0c74cc361b8d..5da125332dbd 100644 --- a/boards/shields/arduino_giga_display_shield/arduino_giga_display_shield.overlay +++ b/boards/shields/arduino_giga_display_shield/arduino_giga_display_shield.overlay @@ -14,21 +14,21 @@ data-lanes = <2>; pixel-format = ; rotation = <0>; - gip-e0 = [e0 00 00 02]; - gip-e1 = [e1 08 00 0a 00 07 00 09 00 00 33 33]; - gip-e2 = [e2 00 00 00 00 00 00 00 00 00 00 00 00 00]; - gip-e3 = [e3 00 00 33 33]; - gip-e4 = [e4 44 44]; - gip-e5 = [e5 0e 60 a0 a0 10 60 a0 a0 0a 60 a0 a0 0c 60 a0 a0]; - gip-e6 = [e6 00 00 33 33]; - gip-e7 = [e7 44 44]; - gip-e8 = [e8 0d 60 a0 a0 0f 60 a0 a0 09 60 a0 a0 0b 60 a0 a0]; - gip-eb = [eb 02 01 e4 e4 44 00 40]; - gip-ec = [ec 02 01]; - gip-ed = [ed ab 89 76 54 01 ff ff ff ff ff ff 10 45 67 98 ba]; - gip-ed = [ed ab 89 76 54 01 ff ff ff ff ff ff 10 45 67 98 ba]; - pvgamctrl = [b0 40 c9 91 0d 12 07 02 09 09 1f 04 50 0f e4 29 df]; - nvgamctrl = [b1 40 cb d0 11 92 07 00 08 07 1c 06 53 12 63 eb df]; + gip-e0 = [E0 00 00 02]; + gip-e1 = [E1 08 00 0A 00 07 00 09 00 00 33 33]; + gip-e2 = [E2 00 00 00 00 00 00 00 00 00 00 00 00 00]; + gip-e3 = [E3 00 00 33 33]; + gip-e4 = [E4 44 44]; + gip-e5 = [E5 0E 60 A0 A0 10 60 A0 A0 0A 60 A0 A0 0C 60 A0 A0]; + gip-e6 = [E6 00 00 33 33]; + gip-e7 = [E7 44 44]; + gip-e8 = [E8 0D 60 A0 A0 0F 60 A0 A0 09 60 A0 A0 0B 60 A0 A0]; + gip-eb = [EB 02 01 E4 E4 44 00 40]; + gip-ec = [EC 02 01]; + gip-ed = [ED AB 89 76 54 01 FF FF FF FF FF FF 10 45 67 98 BA]; + gip-ed = [ED AB 89 76 54 01 FF FF FF FF FF FF 10 45 67 98 BA]; + pvgamctrl = [B0 40 C9 91 0D 12 07 02 09 09 1F 04 50 0F E4 29 DF]; + nvgamctrl = [B1 40 CB D0 11 92 07 00 08 07 1C 06 53 12 63 EB DF]; display-timings { compatible = "zephyr,panel-timing"; diff --git a/boards/shields/g1120b0mipi/boards/mimxrt595_evk_mimxrt595s_cm33.overlay b/boards/shields/g1120b0mipi/boards/mimxrt595_evk_mimxrt595s_cm33.overlay index 94797404c03d..7e9a98e68b96 100644 --- a/boards/shields/g1120b0mipi/boards/mimxrt595_evk_mimxrt595s_cm33.overlay +++ b/boards/shields/g1120b0mipi/boards/mimxrt595_evk_mimxrt595s_cm33.overlay @@ -8,8 +8,8 @@ * so the SMARTDMA will continue functioning after deep sleep */ &suspend { - deep-sleep-config = <0xc800>, + deep-sleep-config = <0xC800>, <0x80030004>, - <0xffffffff>, + <0xFFFFFFFF>, <0>; }; diff --git a/boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay b/boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay index 7d006f661f8a..8aa3ecd780d0 100644 --- a/boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay +++ b/boards/shields/lcd_par_s035/lcd_par_s035_8080.overlay @@ -51,15 +51,15 @@ width = <480>; invert-mode = "1-dot"; frmctl1 = [80 10]; - bpc = [1f 50 00 20]; - dfc = [8a 07 3b]; + bpc = [1F 50 00 20]; + dfc = [8A 07 3B]; pwr1 = [80 64]; pwr2 = <0x13>; - pwr3 = <0xa7>; + pwr3 = <0xA7>; vcmpctl = <0x09>; - doca = [40 8a 00 00 29 19 a5 33]; - pgc = [f0 06 0b 07 06 05 2e 33 47 3a 17 16 2e 31]; - ngc = [f0 09 0d 09 08 23 2e 33 46 38 13 13 2c 32]; + doca = [40 8A 00 00 29 19 A5 33]; + pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31]; + ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32]; madctl = <0x28>; color-invert; zephyr,deferred-init; diff --git a/boards/shields/lcd_par_s035/lcd_par_s035_spi.overlay b/boards/shields/lcd_par_s035/lcd_par_s035_spi.overlay index 7ac70db8252d..902222860c83 100644 --- a/boards/shields/lcd_par_s035/lcd_par_s035_spi.overlay +++ b/boards/shields/lcd_par_s035/lcd_par_s035_spi.overlay @@ -59,15 +59,15 @@ width = <480>; invert-mode = "1-dot"; frmctl1 = [80 10]; - bpc = [1f 50 00 20]; - dfc = [8a 07 3b]; + bpc = [1F 50 00 20]; + dfc = [8A 07 3B]; pwr1 = [80 64]; pwr2 = <0x13>; - pwr3 = <0xa7>; + pwr3 = <0xA7>; vcmpctl = <0x09>; - doca = [40 8a 00 00 29 19 a5 33]; - pgc = [f0 06 0b 07 06 05 2e 33 47 3a 17 16 2e 31]; - ngc = [f0 09 0d 09 08 23 2e 33 46 38 13 13 2c 32]; + doca = [40 8A 00 00 29 19 A5 33]; + pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31]; + ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32]; madctl = <0x28>; color-invert; zephyr,deferred-init; diff --git a/boards/shields/m5stack_cardputer/m5stack_cardputer.overlay b/boards/shields/m5stack_cardputer/m5stack_cardputer.overlay index d546518607be..8befb2a66f29 100644 --- a/boards/shields/m5stack_cardputer/m5stack_cardputer.overlay +++ b/boards/shields/m5stack_cardputer/m5stack_cardputer.overlay @@ -49,7 +49,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 f0]; + ram-param = [00 F0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; diff --git a/boards/shields/rtk0eg0019b01002bj/boards/rssk_ra2l1.overlay b/boards/shields/rtk0eg0019b01002bj/boards/rssk_ra2l1.overlay index 570796e4afb3..f33505d135e1 100644 --- a/boards/shields/rtk0eg0019b01002bj/boards/rssk_ra2l1.overlay +++ b/boards/shields/rtk0eg0019b01002bj/boards/rssk_ra2l1.overlay @@ -16,9 +16,9 @@ group1 { ssdiv = "4.00", "4.00", "4.00"; - so = <0x03b>, <0x059>, <0x049>; + so = <0x03B>, <0x059>, <0x049>; snum = <0x07>, <0x07>, <0x07>; - sdpa = <0x0f>, <0x0f>, <0x0f>; + sdpa = <0x0F>, <0x0F>, <0x0F>; num-moving-avg = <4>; on-freq = <3>; off-freq = <3>; @@ -47,9 +47,9 @@ group2 { ssdiv = "4.00", "4.00", "4.00", "4.00", "4.00"; - so = <0x02b>, <0x03b>, <0x036>, <0x03b>, <0x03a>; + so = <0x02B>, <0x03B>, <0x036>, <0x03B>, <0x03A>; snum = <0x07>, <0x07>, <0x07>, <0x07>, <0x07>; - sdpa = <0x0f>, <0x0f>, <0x0f>, <0x0f>, <0x0f>; + sdpa = <0x0F>, <0x0F>, <0x0F>, <0x0F>, <0x0F>; num-moving-avg = <4>; on-freq = <3>; off-freq = <3>; @@ -67,7 +67,7 @@ ssdiv = "4.00", "4.00", "4.00", "4.00"; so = <0x047>, <0x046>, <0x049>, <0x040>; snum = <0x07>, <0x07>, <0x07>, <0x07>; - sdpa = <0x0f>, <0x0f>, <0x0f>, <0x0f>; + sdpa = <0x0F>, <0x0F>, <0x0F>, <0x0F>; num-moving-avg = <4>; on-freq = <3>; off-freq = <3>; diff --git a/boards/shields/rtk0eg0019b01002bj/rtk0eg0019b01002bj.overlay b/boards/shields/rtk0eg0019b01002bj/rtk0eg0019b01002bj.overlay index 0dd852974020..5685903a6a78 100644 --- a/boards/shields/rtk0eg0019b01002bj/rtk0eg0019b01002bj.overlay +++ b/boards/shields/rtk0eg0019b01002bj/rtk0eg0019b01002bj.overlay @@ -45,7 +45,7 @@ status = "okay"; group1 { - ctsuchac = <0x01 0x0e 0x00 0x00 0x00>; + ctsuchac = <0x01 0x0E 0x00 0x00 0x00>; ctsuchtrc = <0x01 0x00 0x00 0x00 0x00>; rx-count = <3>; tx-count = <0>; @@ -74,7 +74,7 @@ }; group2 { - ctsuchac = <0xf4 0x01 0x00 0x00 0x00>; + ctsuchac = <0xF4 0x01 0x00 0x00 0x00>; ctsuchtrc = <0x00 0x01 0x00 0x00 0x00>; rx-count = <5>; tx-count = <0>; @@ -90,7 +90,7 @@ }; group3 { - ctsuchac = <0x00 0x40 0xa4 0x00 0x01>; + ctsuchac = <0x00 0x40 0xA4 0x00 0x01>; ctsuchtrc = <0x00 0x40 0x00 0x00 0x00>; rx-count = <4>; tx-count = <0>; diff --git a/boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay b/boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay index 64ad7436769a..09f65e682343 100644 --- a/boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay +++ b/boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay @@ -39,10 +39,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [52 a1]; - pvgam-param = [d0 00 02 07 0b 1a 31 54 40 29 12 12 12 17]; - nvgam-param = [d0 00 02 07 05 15 2d 44 44 1c 18 16 1c 1d]; - ram-param = [00 f8]; - rgb-param = [cd 08 14]; + pvgam-param = [D0 00 02 07 0B 1A 31 54 40 29 12 12 12 17]; + nvgam-param = [D0 00 02 07 05 15 2D 44 44 1C 18 16 1C 1D]; + ram-param = [00 F8]; + rgb-param = [CD 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay b/boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay index 93f9e0d76406..bed545e1cc7f 100644 --- a/boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay +++ b/boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay @@ -41,10 +41,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; - nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; - ram-param = [00 f0]; - rgb-param = [cd 08 14]; + pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; + nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; + ram-param = [00 F0]; + rgb-param = [CD 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b1.overlay b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b1.overlay index e0de86115606..0bd9a4a276c5 100644 --- a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b1.overlay +++ b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b1.overlay @@ -35,9 +35,9 @@ border-waveform = <0x71>; dummy-line = <0x1a>; gate-line-width = <0x08>; - lut = [22 55 aa 55 aa 55 aa 11 + lut = [22 55 AA 55 AA 55 AA 11 00 00 00 00 00 00 00 00 - 1e 1e 1e 1e 1e 1e 1e 1e + 1E 1E 1E 1E 1E 1E 1E 1E 01 00 00 00 00]; }; @@ -50,7 +50,7 @@ gate-line-width = <0x08>; lut = [18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0f 01 00 00 00 00 00 00 + 0F 01 00 00 00 00 00 00 00 00 00 00 00]; }; }; diff --git a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b72.overlay b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b72.overlay index 69c1d1941531..247ab55152e3 100644 --- a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b72.overlay +++ b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh0213b72.overlay @@ -61,7 +61,7 @@ 40 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0a 00 00 00 04 + 0A 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh029a1.overlay b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh029a1.overlay index 08a3cf7c96ed..6dcfc0615ada 100644 --- a/boards/shields/waveshare_epaper/waveshare_epaper_gdeh029a1.overlay +++ b/boards/shields/waveshare_epaper/waveshare_epaper_gdeh029a1.overlay @@ -35,9 +35,9 @@ border-waveform = <0x33>; dummy-line = <0x1a>; gate-line-width = <0x08>; - lut = [50 aa 55 aa 11 00 00 00 + lut = [50 AA 55 AA 11 00 00 00 00 00 00 00 00 00 00 00 - 00 00 00 00 ff ff 1f 00 + 00 00 00 00 FF FF 1F 00 00 00 00 00 00 00]; }; diff --git a/boards/shields/waveshare_epaper/waveshare_epaper_gdew042t2-p.overlay b/boards/shields/waveshare_epaper/waveshare_epaper_gdew042t2-p.overlay index 7175bacfb5a4..7cdc0d8611e4 100644 --- a/boards/shields/waveshare_epaper/waveshare_epaper_gdew042t2-p.overlay +++ b/boards/shields/waveshare_epaper/waveshare_epaper_gdew042t2-p.overlay @@ -45,7 +45,7 @@ pll = <0x3c>; vdcs = <0x08>; - lutc = [00 01 0e 00 00 01 + lutc = [00 01 0E 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -54,7 +54,7 @@ 00 00 00 00 00 00 00 00]; - lutww = [00 01 0e 00 00 01 + lutww = [00 01 0E 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -62,7 +62,7 @@ 00 00 00 00 00 00 00 00 00 00 00 00]; - lutkw = [20 01 0e 00 00 01 + lutkw = [20 01 0E 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -70,7 +70,7 @@ 00 00 00 00 00 00 00 00 00 00 00 00]; - lutwk = [10 01 0e 00 00 01 + lutwk = [10 01 0E 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -78,7 +78,7 @@ 00 00 00 00 00 00 00 00 00 00 00 00]; - lutkk = [00 01 0e 00 00 01 + lutkk = [00 01 0E 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/boards/shields/waveshare_pico_lcd_1_14/waveshare_pico_lcd_1_14_display.overlay b/boards/shields/waveshare_pico_lcd_1_14/waveshare_pico_lcd_1_14_display.overlay index 674101776aa7..eb027f772bba 100644 --- a/boards/shields/waveshare_pico_lcd_1_14/waveshare_pico_lcd_1_14_display.overlay +++ b/boards/shields/waveshare_pico_lcd_1_14/waveshare_pico_lcd_1_14_display.overlay @@ -45,7 +45,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; - ram-param = [00 f0]; + ram-param = [00 F0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; status = "okay"; diff --git a/boards/silabs/radio_boards/bg29_rb4420a/bg29_rb4420a.dts b/boards/silabs/radio_boards/bg29_rb4420a/bg29_rb4420a.dts index b02ec2241caa..7b7b11e774de 100644 --- a/boards/silabs/radio_boards/bg29_rb4420a/bg29_rb4420a.dts +++ b/boards/silabs/radio_boards/bg29_rb4420a/bg29_rb4420a.dts @@ -240,7 +240,7 @@ }; slot0_partition: partition@c000 { - reg = <0x0000c000 DT_SIZE_K(472)>; + reg = <0x0000C000 DT_SIZE_K(472)>; label = "image-0"; }; @@ -249,8 +249,8 @@ label = "image-1"; }; - storage_partition: partition@f8000 { - reg = <0x000f8000 DT_SIZE_K(32)>; + storage_partition: partition@F8000 { + reg = <0x000F8000 DT_SIZE_K(32)>; label = "storage"; }; }; diff --git a/boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts b/boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts index 5a9b366ac57a..2e12da2e7209 100644 --- a/boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts +++ b/boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts @@ -247,7 +247,7 @@ }; slot0_partition: partition@c000 { - reg = <0x0000c000 DT_SIZE_K(472)>; + reg = <0x0000C000 DT_SIZE_K(472)>; label = "image-0"; }; @@ -256,8 +256,8 @@ label = "image-1"; }; - storage_partition: partition@f8000 { - reg = <0x000f8000 DT_SIZE_K(32)>; + storage_partition: partition@F8000 { + reg = <0x000F8000 DT_SIZE_K(32)>; label = "storage"; }; }; diff --git a/boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts b/boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts index f5406988423d..84d1aa616066 100644 --- a/boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts +++ b/boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts @@ -329,7 +329,7 @@ }; slot0_partition: partition@c000 { - reg = <0x0000c000 DT_SIZE_K(472)>; + reg = <0x0000C000 DT_SIZE_K(472)>; label = "image-0"; }; @@ -338,8 +338,8 @@ label = "image-1"; }; - storage_partition: partition@f8000 { - reg = <0x000f8000 DT_SIZE_K(32)>; + storage_partition: partition@F8000 { + reg = <0x000F8000 DT_SIZE_K(32)>; label = "storage"; }; }; diff --git a/boards/sipeed/longan_nano/longan_nano-common.dtsi b/boards/sipeed/longan_nano/longan_nano-common.dtsi index 71b184920c98..ddbfb71cfddf 100644 --- a/boards/sipeed/longan_nano/longan_nano-common.dtsi +++ b/boards/sipeed/longan_nano/longan_nano-common.dtsi @@ -95,17 +95,17 @@ x-offset = <1>; y-offset = <26>; pwctr1 = [62 02 04]; - pwctr2 = [c0]; - pwctr3 = [0d 00]; - pwctr4 = [8d 6a]; - pwctr5 = [8d ee]; + pwctr2 = [C0]; + pwctr3 = [0D 00]; + pwctr4 = [8D 6A]; + pwctr5 = [8D EE]; invctr = <3>; - frmctr1 = [05 3a 3a]; - frmctr2 = [05 3a 3a]; - frmctr3 = [05 3a 3a 05 3a 3a]; + frmctr1 = [05 3A 3A]; + frmctr2 = [05 3A 3A]; + frmctr3 = [05 3A 3A 05 3A 3A]; vmctr1 = <14>; - gamctrp1 = [10 0e 02 03 0e 07 02 07 0a 12 27 37 00 0d 0e 10]; - gamctrn1 = [10 0e 03 03 0f 06 02 08 0a 13 26 36 00 0d 0e 10]; + gamctrp1 = [10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10]; + gamctrn1 = [10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10]; colmod = <5>; madctl = <120>; caset = [00 01 00 a0]; diff --git a/boards/sipeed/maix_m0s_dock/maix_m0s.dtsi b/boards/sipeed/maix_m0s_dock/maix_m0s.dtsi index d519e51590d5..c3b693ca02fe 100644 --- a/boards/sipeed/maix_m0s_dock/maix_m0s.dtsi +++ b/boards/sipeed/maix_m0s_dock/maix_m0s.dtsi @@ -28,9 +28,9 @@ }; &flashctrl { - flash0: flash@a0000000 { + flash0: flash@A0000000 { compatible = "soc-nv-flash", "gd,25lq32d"; - reg = <0xa0000000 (0x400000 - 0x2000)>; + reg = <0xA0000000 (0x400000 - 0x2000)>; write-block-size = <256>; erase-block-size = ; diff --git a/boards/sparkfun/micromod/micromod_nrf52840.dts b/boards/sparkfun/micromod/micromod_nrf52840.dts index 12ad64a582ab..a8b680f2b7f8 100644 --- a/boards/sparkfun/micromod/micromod_nrf52840.dts +++ b/boards/sparkfun/micromod/micromod_nrf52840.dts @@ -190,9 +190,9 @@ * if enabled. */ - storage_partition: partition@fa000 { + storage_partition: partition@fA000 { label = "storage"; - reg = <0x000fa000 0x00006000>; + reg = <0x000fA000 0x00006000>; }; }; }; diff --git a/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts b/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts index 417c55339142..b94606c56343 100644 --- a/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts +++ b/boards/st/stm32f429i_disc1/stm32f429i_disc1.dts @@ -93,7 +93,7 @@ frmctr1 = [00 1b]; pwctrl1 = [10]; pwctrl2 = [10]; - pgamctrl = [0f 29 24 0c 0e 09 4e 78 3c 09 13 05 17 11 00]; + pgamctrl = [0F 29 24 0c 0e 09 4e 78 3c 09 13 05 17 11 00]; ngamctrl = [00 16 1b 04 11 07 31 33 42 05 0c 0a 28 2f 0f]; }; }; diff --git a/boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi b/boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi index 270e177bd25d..cc992733ee62 100644 --- a/boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi +++ b/boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi @@ -147,9 +147,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 00]; pwctrl1-param = [a4 a1]; - pvgam-param = [d0 08 11 08 0c 15 39 33 50 36 13 14 29 2d]; - nvgam-param = [d0 08 10 08 06 06 39 44 51 0b 16 14 2f 31]; - ram-param = [00 f0]; + pvgam-param = [D0 08 11 08 0C 15 39 33 50 36 13 14 29 2D]; + nvgam-param = [D0 08 10 08 06 06 39 44 51 0B 16 14 2F 31]; + ram-param = [00 F0]; rgb-param = [40 02 14]; }; }; diff --git a/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi b/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi index 7bc9f456a194..2e1c97da5a20 100644 --- a/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi +++ b/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi @@ -108,9 +108,9 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 00]; pwctrl1-param = [a4 a1]; - pvgam-param = [d0 08 11 08 0c 15 39 33 50 36 13 14 29 2d]; - nvgam-param = [d0 08 10 08 06 06 39 44 51 0b 16 14 2f 31]; - ram-param = [00 f0]; + pvgam-param = [D0 08 11 08 0C 15 39 33 50 36 13 14 29 2D]; + nvgam-param = [D0 08 10 08 06 06 39 44 51 0B 16 14 2F 31]; + ram-param = [00 F0]; rgb-param = [40 02 14]; }; }; diff --git a/boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts b/boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts index 94d0b88b129f..0882a8ed1b82 100644 --- a/boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts +++ b/boards/ti/lp_mspm0g3507/lp_mspm0g3507.dts @@ -77,12 +77,12 @@ slot0_partition: partition@8000 { label = "image-0"; - reg = <0x00008000 0xc000>; + reg = <0x00008000 0xC000>; }; slot1_partition: partition@14000 { label = "image-1"; - reg = <0x00014000 0xc000>; + reg = <0x00014000 0xC000>; }; }; }; diff --git a/boards/u-blox/ubx_bmd300eval/ubx_bmd300eval_nrf52832.dts b/boards/u-blox/ubx_bmd300eval/ubx_bmd300eval_nrf52832.dts index 31e0366c2904..83d789477c52 100644 --- a/boards/u-blox/ubx_bmd300eval/ubx_bmd300eval_nrf52832.dts +++ b/boards/u-blox/ubx_bmd300eval/ubx_bmd300eval_nrf52832.dts @@ -234,12 +234,12 @@ arduino_spi: &spi2 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/u-blox/ubx_bmd330eval/ubx_bmd330eval_nrf52810.dts b/boards/u-blox/ubx_bmd330eval/ubx_bmd330eval_nrf52810.dts index 3c6dc6ae5e0c..bc92435166ab 100644 --- a/boards/u-blox/ubx_bmd330eval/ubx_bmd330eval_nrf52810.dts +++ b/boards/u-blox/ubx_bmd330eval/ubx_bmd330eval_nrf52810.dts @@ -208,7 +208,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0xd000>; + reg = <0x0000C000 0xd000>; }; slot1_partition: partition@19000 { diff --git a/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts b/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts index 5a9367ca2463..1f2e2a1811a8 100644 --- a/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts +++ b/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts @@ -209,7 +209,7 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0xd000>; + reg = <0x0000C000 0xd000>; }; slot1_partition: partition@19000 { diff --git a/boards/u-blox/ubx_evkannab1/ubx_evkannab1_nrf52832.dts b/boards/u-blox/ubx_evkannab1/ubx_evkannab1_nrf52832.dts index f8a100549241..00bf3657e8c9 100644 --- a/boards/u-blox/ubx_evkannab1/ubx_evkannab1_nrf52832.dts +++ b/boards/u-blox/ubx_evkannab1/ubx_evkannab1_nrf52832.dts @@ -222,12 +222,12 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/u-blox/ubx_evkninab1/ubx_evkninab1_nrf52832.dts b/boards/u-blox/ubx_evkninab1/ubx_evkninab1_nrf52832.dts index a4cfec889240..5a9100fd3366 100644 --- a/boards/u-blox/ubx_evkninab1/ubx_evkninab1_nrf52832.dts +++ b/boards/u-blox/ubx_evkninab1/ubx_evkninab1_nrf52832.dts @@ -222,12 +222,12 @@ arduino_spi: &spi0 { slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/u-blox/ubx_evkninab4/ubx_evkninab4_nrf52833.dts b/boards/u-blox/ubx_evkninab4/ubx_evkninab4_nrf52833.dts index 6b286aa67913..e74f3315deb1 100644 --- a/boards/u-blox/ubx_evkninab4/ubx_evkninab4_nrf52833.dts +++ b/boards/u-blox/ubx_evkninab4/ubx_evkninab4_nrf52833.dts @@ -227,27 +227,27 @@ arduino_spi: &spi2 { boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0xc000>; + reg = <0x00000000 0xC000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { label = "image-scratch"; - reg = <0x00070000 0xa000>; + reg = <0x00070000 0xA000>; }; storage_partition: partition@7a000 { label = "storage"; - reg = <0x0007a000 0x00006000>; + reg = <0x0007A000 0x00006000>; }; }; }; diff --git a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts index c29e5c3cdf49..7c3fa4fa51b8 100644 --- a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts +++ b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts @@ -124,12 +124,12 @@ reg = <0x10000 DT_SIZE_K(424)>; }; - slot1_partition: partition@7a000 { - reg = <0x7a000 DT_SIZE_K(424)>; + slot1_partition: partition@7A000 { + reg = <0x7A000 DT_SIZE_K(424)>; }; - storage_partition: partition@e4000 { - reg = <0xe4000 DT_SIZE_K(112)>; + storage_partition: partition@E4000 { + reg = <0xE4000 DT_SIZE_K(112)>; }; }; }; diff --git a/boards/waveshare/rp2040_geek/rp2040_geek.dts b/boards/waveshare/rp2040_geek/rp2040_geek.dts index 89cbed0e5036..488a176a92d6 100644 --- a/boards/waveshare/rp2040_geek/rp2040_geek.dts +++ b/boards/waveshare/rp2040_geek/rp2040_geek.dts @@ -63,10 +63,10 @@ porch-param = [0c 0c 00 33 33]; cmd2en-param = [5a 69 02 01]; pwctrl1-param = [a4 a1]; - pvgam-param = [d0 04 0d 11 13 2b 3f 54 4c 18 0d 0b 1f 23]; - nvgam-param = [d0 04 0c 11 13 2c 3f 44 51 2f 1f 1f 20 23]; - ram-param = [00 f0]; - rgb-param = [cd 08 14]; + pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23]; + nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23]; + ram-param = [00 F0]; + rgb-param = [CD 08 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; }; diff --git a/boards/we/ophelia1ev/we_ophelia1ev_nrf52805.dts b/boards/we/ophelia1ev/we_ophelia1ev_nrf52805.dts index 2d68e7bd67f0..a200f645463c 100644 --- a/boards/we/ophelia1ev/we_ophelia1ev_nrf52805.dts +++ b/boards/we/ophelia1ev/we_ophelia1ev_nrf52805.dts @@ -117,7 +117,7 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0xd000>; + reg = <0x0000C000 0xd000>; }; slot1_partition: partition@19000 { diff --git a/boards/we/proteus2ev/we_proteus2ev_nrf52832.dts b/boards/we/proteus2ev/we_proteus2ev_nrf52832.dts index 1628cfce73cd..b8dd6150ea6e 100644 --- a/boards/we/proteus2ev/we_proteus2ev_nrf52832.dts +++ b/boards/we/proteus2ev/we_proteus2ev_nrf52832.dts @@ -115,12 +115,12 @@ slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x32000>; + reg = <0x0000C000 0x32000>; }; slot1_partition: partition@3e000 { label = "image-1"; - reg = <0x0003e000 0x32000>; + reg = <0x0003E000 0x32000>; }; scratch_partition: partition@70000 { diff --git a/boards/weact/mini_stm32h743/mini_stm32h743.dts b/boards/weact/mini_stm32h743/mini_stm32h743.dts index 7e55c6457ba7..030369008a86 100644 --- a/boards/weact/mini_stm32h743/mini_stm32h743.dts +++ b/boards/weact/mini_stm32h743/mini_stm32h743.dts @@ -57,18 +57,18 @@ rgb-is-inverted; x-offset = <1>; y-offset = <26>; - pwctr1 = [a2 02 84]; - pwctr2 = [c5]; - pwctr3 = [0a 00]; - pwctr4 = [8a 2a]; - pwctr5 = [8a ee]; + pwctr1 = [A2 02 84]; + pwctr2 = [C5]; + pwctr3 = [0A 00]; + pwctr4 = [8A 2A]; + pwctr5 = [8A EE]; invctr = <7>; - frmctr1 = [01 2c 2d]; - frmctr2 = [01 2c 2d]; - frmctr3 = [01 2c 2d 01 2c 2d]; + frmctr1 = [01 2C 2D]; + frmctr2 = [01 2C 2D]; + frmctr3 = [01 2C 2D 01 2C 2D]; vmctr1 = <14>; - gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2b 39 00 01 03 10]; - gamctrn1 = [03 1d 07 06 2e 2c 29 2d 2e 2e 37 3f 00 00 02 10]; + gamctrp1 = [02 1C 07 12 37 32 29 2D 29 25 2B 39 00 01 03 10]; + gamctrn1 = [03 1D 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10]; colmod = <5>; /* Set D3 (RGB) bit to 1. LV_COLOR_16_SWAP is enabled by default */ madctl = <120>; /* Set to <184> to rotate the image 180 degrees. */ diff --git a/boards/weact/mini_stm32h7b0/mini_stm32h7b0.dts b/boards/weact/mini_stm32h7b0/mini_stm32h7b0.dts index b439dc2525e7..a7093d8eadc2 100644 --- a/boards/weact/mini_stm32h7b0/mini_stm32h7b0.dts +++ b/boards/weact/mini_stm32h7b0/mini_stm32h7b0.dts @@ -57,18 +57,18 @@ rgb-is-inverted; x-offset = <1>; y-offset = <26>; - pwctr1 = [a2 02 84]; - pwctr2 = [c5]; - pwctr3 = [0a 00]; - pwctr4 = [8a 2a]; - pwctr5 = [8a ee]; + pwctr1 = [A2 02 84]; + pwctr2 = [C5]; + pwctr3 = [0A 00]; + pwctr4 = [8A 2A]; + pwctr5 = [8A EE]; invctr = <7>; - frmctr1 = [01 2c 2d]; - frmctr2 = [01 2c 2d]; - frmctr3 = [01 2c 2d 01 2c 2d]; + frmctr1 = [01 2C 2D]; + frmctr2 = [01 2C 2D]; + frmctr3 = [01 2C 2D 01 2C 2D]; vmctr1 = <14>; - gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2b 39 00 01 03 10]; - gamctrn1 = [03 1d 07 06 2e 2c 29 2d 2e 2e 37 3f 00 00 02 10]; + gamctrp1 = [02 1C 07 12 37 32 29 2D 29 25 2B 39 00 01 03 10]; + gamctrn1 = [03 1D 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10]; colmod = <5>; /* Set D3 (RGB) bit to 1. LV_COLOR_16_SWAP is enabled by default */ madctl = <120>; /* Set to <184> to rotate the image 180 degrees. */ diff --git a/boards/witte/linum/linum.dts b/boards/witte/linum/linum.dts index f25e336a70aa..3254cdc078cb 100644 --- a/boards/witte/linum/linum.dts +++ b/boards/witte/linum/linum.dts @@ -405,9 +405,9 @@ zephyr_udc0: &usbotg_fs { vfront-porch = <12>; }; - def-back-color-red = <0xff>; - def-back-color-green = <0xff>; - def-back-color-blue = <0xff>; + def-back-color-red = <0xFF>; + def-back-color-green = <0xFF>; + def-back-color-blue = <0xFF>; }; &sdmmc1 { diff --git a/doc/contribute/style/style-example.dts b/doc/contribute/style/style-example.dts index 4875e28b77ca..9648b8e61ee2 100644 --- a/doc/contribute/style/style-example.dts +++ b/doc/contribute/style/style-example.dts @@ -40,14 +40,14 @@ lcd0: lcd@0 { compatible = "sitronix,st7735r"; /* Split array values across multiple lines to help readability. */ - gamctrp1 = [10 0e 02 03 - 0e 07 02 07 - 0a 12 27 37 - 00 0d 0e 10]; - gamctrn1 = [10 0e 03 03 - 0f 06 02 08 - 0a 13 26 36 - 00 0d 0e 10]; + gamctrp1 = [10 0E 02 03 + 0E 07 02 07 + 0A 12 27 37 + 00 0D 0E 10]; + gamctrn1 = [10 0E 03 03 + 0F 06 02 08 + 0A 13 26 36 + 00 0D 0E 10]; }; }; }; diff --git a/dts/arc/synopsys/emsk.dtsi b/dts/arc/synopsys/emsk.dtsi index f426ba311178..212df83b3a36 100644 --- a/dts/arc/synopsys/emsk.dtsi +++ b/dts/arc/synopsys/emsk.dtsi @@ -121,7 +121,7 @@ gpio2: gpio@f0002018 { compatible = "snps,designware-gpio"; - reg = <0xf0002018 0xc>; + reg = <0xF0002018 0xc>; ngpios = <32>; interrupt-parent = <&intc>; @@ -132,7 +132,7 @@ gpio3: gpio@f0002024 { compatible = "snps,designware-gpio"; - reg = <0xf0002024 0xc>; + reg = <0xF0002024 0xc>; ngpios = <12>; interrupt-parent = <&intc>; diff --git a/dts/arm/ambiq/ambiq_apollo3_blue.dtsi b/dts/arm/ambiq/ambiq_apollo3_blue.dtsi index df6a5353ea8b..a8829447951a 100644 --- a/dts/arm/ambiq/ambiq_apollo3_blue.dtsi +++ b/dts/arm/ambiq/ambiq_apollo3_blue.dtsi @@ -195,7 +195,7 @@ timer5: timer@400080a0 { compatible = "ambiq,ctimer"; - reg = <0x400080a0 0x20>; + reg = <0x400080A0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -214,7 +214,7 @@ timer6: timer@400080c0 { compatible = "ambiq,ctimer"; - reg = <0x400080c0 0x20>; + reg = <0x400080C0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -233,7 +233,7 @@ timer7: timer@400080e0 { compatible = "ambiq,ctimer"; - reg = <0x400080e0 0x20>; + reg = <0x400080E0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -434,7 +434,7 @@ rtc0: rtc@40004240 { compatible = "ambiq,rtc"; - reg = <0x40004240 0xd0>; + reg = <0x40004240 0xD0>; interrupts = <2 0>; alarms-count = <1>; status = "disabled"; diff --git a/dts/arm/ambiq/ambiq_apollo3p_blue.dtsi b/dts/arm/ambiq/ambiq_apollo3p_blue.dtsi index 7f87afae83ce..541b306387c7 100644 --- a/dts/arm/ambiq/ambiq_apollo3p_blue.dtsi +++ b/dts/arm/ambiq/ambiq_apollo3p_blue.dtsi @@ -71,7 +71,7 @@ /* SRAM */ sram0: memory@10010000 { compatible = "mmio-sram"; - reg = <0x10010000 0xb0000>; + reg = <0x10010000 0xB0000>; }; xip0: memory@52000000 { @@ -213,7 +213,7 @@ timer5: timer@400080a0 { compatible = "ambiq,ctimer"; - reg = <0x400080a0 0x20>; + reg = <0x400080A0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -232,7 +232,7 @@ timer6: timer@400080c0 { compatible = "ambiq,ctimer"; - reg = <0x400080c0 0x20>; + reg = <0x400080C0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -251,7 +251,7 @@ timer7: timer@400080e0 { compatible = "ambiq,ctimer"; - reg = <0x400080e0 0x20>; + reg = <0x400080E0 0x20>; interrupts = <14 0>; clk-source = "CLK_SELECT_HFRC_3MHZ"; status = "disabled"; @@ -473,7 +473,7 @@ rtc0: rtc@40004240 { compatible = "ambiq,rtc"; - reg = <0x40004240 0xd0>; + reg = <0x40004240 0xD0>; interrupts = <2 0>; alarms-count = <1>; status = "disabled"; diff --git a/dts/arm/ambiq/ambiq_apollo4p.dtsi b/dts/arm/ambiq/ambiq_apollo4p.dtsi index 20192058d072..9b39950a34c7 100644 --- a/dts/arm/ambiq/ambiq_apollo4p.dtsi +++ b/dts/arm/ambiq/ambiq_apollo4p.dtsi @@ -70,7 +70,7 @@ /* SRAM */ sram0: memory@10010000 { compatible = "mmio-sram"; - reg = <0x10010000 0x2b0000>; + reg = <0x10010000 0x2B0000>; }; soc { @@ -189,7 +189,7 @@ timer5: timer@400080a0 { compatible = "ambiq,timer"; - reg = <0x400080a0 0x20>; + reg = <0x400080A0 0x20>; interrupts = <72 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -207,7 +207,7 @@ timer6: timer@400080c0 { compatible = "ambiq,timer"; - reg = <0x400080c0 0x20>; + reg = <0x400080C0 0x20>; interrupts = <73 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -225,7 +225,7 @@ timer7: timer@400080e0 { compatible = "ambiq,timer"; - reg = <0x400080e0 0x20>; + reg = <0x400080E0 0x20>; interrupts = <74 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -333,7 +333,7 @@ timer13: timer@400081a0 { compatible = "ambiq,timer"; - reg = <0x400081a0 0x20>; + reg = <0x400081A0 0x20>; interrupts = <80 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -351,7 +351,7 @@ timer14: timer@400081c0 { compatible = "ambiq,timer"; - reg = <0x400081c0 0x20>; + reg = <0x400081C0 0x20>; interrupts = <81 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -369,7 +369,7 @@ timer15: timer@400081e0 { compatible = "ambiq,timer"; - reg = <0x400081e0 0x20>; + reg = <0x400081E0 0x20>; interrupts = <82 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -652,7 +652,7 @@ usb: usb@400b0000 { compatible = "ambiq,usb"; - reg = <0x400b0000 0x4100>; + reg = <0x400B0000 0x4100>; interrupts = <27 0>; num-bidir-endpoints = <6>; maximum-speed = "full-speed"; diff --git a/dts/arm/ambiq/ambiq_apollo4p_blue.dtsi b/dts/arm/ambiq/ambiq_apollo4p_blue.dtsi index 113d1adf930d..e1f4ba71090e 100644 --- a/dts/arm/ambiq/ambiq_apollo4p_blue.dtsi +++ b/dts/arm/ambiq/ambiq_apollo4p_blue.dtsi @@ -84,7 +84,7 @@ /* SRAM */ sram0: memory@10010000 { compatible = "mmio-sram"; - reg = <0x10010000 0x2b0000>; + reg = <0x10010000 0x2B0000>; }; soc { @@ -203,7 +203,7 @@ timer5: timer@400080a0 { compatible = "ambiq,timer"; - reg = <0x400080a0 0x20>; + reg = <0x400080A0 0x20>; interrupts = <72 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -221,7 +221,7 @@ timer6: timer@400080c0 { compatible = "ambiq,timer"; - reg = <0x400080c0 0x20>; + reg = <0x400080C0 0x20>; interrupts = <73 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -239,7 +239,7 @@ timer7: timer@400080e0 { compatible = "ambiq,timer"; - reg = <0x400080e0 0x20>; + reg = <0x400080E0 0x20>; interrupts = <74 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -347,7 +347,7 @@ timer13: timer@400081a0 { compatible = "ambiq,timer"; - reg = <0x400081a0 0x20>; + reg = <0x400081A0 0x20>; interrupts = <80 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -365,7 +365,7 @@ timer14: timer@400081c0 { compatible = "ambiq,timer"; - reg = <0x400081c0 0x20>; + reg = <0x400081C0 0x20>; interrupts = <81 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -383,7 +383,7 @@ timer15: timer@400081e0 { compatible = "ambiq,timer"; - reg = <0x400081e0 0x20>; + reg = <0x400081E0 0x20>; interrupts = <82 0>; clk-source = "CLK_SELECT_HFRC_DIV64"; @@ -651,7 +651,7 @@ usb: usb@400b0000 { compatible = "ambiq,usb"; - reg = <0x400b0000 0x4100>; + reg = <0x400B0000 0x4100>; interrupts = <27 0>; num-bidir-endpoints = <6>; maximum-speed = "full-speed"; diff --git a/dts/arm/ambiq/ambiq_apollo510.dtsi b/dts/arm/ambiq/ambiq_apollo510.dtsi index d232b92f821a..8d60b8bf9d8a 100644 --- a/dts/arm/ambiq/ambiq_apollo510.dtsi +++ b/dts/arm/ambiq/ambiq_apollo510.dtsi @@ -758,8 +758,8 @@ 0x40 0x0 &gpio64_95 0x0 0x0 0x60 0x0 &gpio96_127 0x0 0x0 0x80 0x0 &gpio128_159 0x0 0x0 - 0xa0 0x0 &gpio160_191 0x0 0x0 - 0xc0 0x0 &gpio192_223 0x0 0x0>; + 0xA0 0x0 &gpio160_191 0x0 0x0 + 0xC0 0x0 &gpio192_223 0x0 0x0>; reg = ; #gpio-cells = <2>; #address-cells = <1>; diff --git a/dts/arm/atmel/samc2x.dtsi b/dts/arm/atmel/samc2x.dtsi index bfc55053bd50..4bdea798c2f0 100644 --- a/dts/arm/atmel/samc2x.dtsi +++ b/dts/arm/atmel/samc2x.dtsi @@ -56,10 +56,10 @@ id: device_id@80a00c { compatible = "atmel,sam0-id"; - reg = <0x0080a00c 0x4>, - <0x0080a040 0x4>, - <0x0080a044 0x4>, - <0x0080a048 0x4>; + reg = <0x0080A00C 0x4>, + <0x0080A040 0x4>, + <0x0080A044 0x4>, + <0x0080A048 0x4>; }; soc { @@ -103,7 +103,7 @@ eic: eic@40002800 { compatible = "atmel,sam0-eic"; - reg = <0x40002800 0x1c>; + reg = <0x40002800 0x1C>; interrupts = <3 0>; }; diff --git a/dts/arm/atmel/samd2x.dtsi b/dts/arm/atmel/samd2x.dtsi index 036d7d832676..437085d93c68 100644 --- a/dts/arm/atmel/samd2x.dtsi +++ b/dts/arm/atmel/samd2x.dtsi @@ -55,10 +55,10 @@ id: device_id@80a00c { compatible = "atmel,sam0-id"; - reg = <0x0080a00c 0x4>, - <0x0080a040 0x4>, - <0x0080a044 0x4>, - <0x0080a048 0x4>; + reg = <0x0080A00C 0x4>, + <0x0080A040 0x4>, + <0x0080A044 0x4>, + <0x0080A048 0x4>; }; soc { @@ -97,7 +97,7 @@ eic: eic@40001800 { compatible = "atmel,sam0-eic"; - reg = <0x40001800 0x1c>; + reg = <0x40001800 0x1C>; interrupts = <4 0>; }; @@ -189,7 +189,7 @@ rtc: rtc@40001400 { compatible = "atmel,sam0-rtc"; - reg = <0x40001400 0x1c>; + reg = <0x40001400 0x1C>; interrupts = <3 0>; clocks = <&gclk 4 4>, <&pm 0x18 5>; clock-names = "GCLK", "PM"; @@ -201,7 +201,7 @@ adc: adc@42004000 { compatible = "atmel,sam0-adc"; - reg = <0x42004000 0x2b>; + reg = <0x42004000 0x2B>; status = "disabled"; #io-channel-cells = <1>; diff --git a/dts/arm/atmel/samd5x.dtsi b/dts/arm/atmel/samd5x.dtsi index 2e8d3f7713ea..48092d2f9981 100644 --- a/dts/arm/atmel/samd5x.dtsi +++ b/dts/arm/atmel/samd5x.dtsi @@ -85,7 +85,7 @@ id: device_id@8061fc { compatible = "atmel,sam0-id"; - reg = <0x008061fc 0x4>, + reg = <0x008061FC 0x4>, <0x00806010 0x4>, <0x00806014 0x4>, <0x00806018 0x4>; @@ -132,7 +132,7 @@ dmac: dmac@4100a000 { compatible = "atmel,sam0-dmac"; - reg = <0x4100a000 0x50>; + reg = <0x4100A000 0x50>; interrupts = <31 0>, <32 0>, <33 0>, <34 0>, <35 0>; status = "disabled"; @@ -253,7 +253,7 @@ sercom7: sercom@43000c00 { compatible = "atmel,sam0-sercom"; - reg = <0x43000c00 0x40>; + reg = <0x43000C00 0x40>; interrupts = <74 0>, <75 0>, <76 0>, <77 0>; clocks = <&gclk 37>, <&mclk 0x20 3>; clock-names = "GCLK", "MCLK"; @@ -341,7 +341,7 @@ adc0: adc@43001c00 { compatible = "atmel,sam0-adc"; - reg = <0x43001c00 0x4a>; + reg = <0x43001C00 0x4A>; interrupts = <118 0>, <119 0>; interrupt-names = "overrun", "resrdy"; clocks = <&gclk 40>, <&mclk 0x20 7>; @@ -366,7 +366,7 @@ adc1: adc@43002000 { compatible = "atmel,sam0-adc"; - reg = <0x43002000 0x4a>; + reg = <0x43002000 0x4A>; interrupts = <120 0>, <121 0>; interrupt-names = "overrun", "resrdy"; clocks = <&gclk 41>, <&mclk 0x20 8>; @@ -414,7 +414,7 @@ tc2: tc@4101a000 { compatible = "atmel,sam0-tc32"; - reg = <0x4101a000 0x34>; + reg = <0x4101A000 0x34>; interrupts = <109 0>; clocks = <&gclk 26>, <&mclk 0x18 13>; clock-names = "GCLK", "MCLK"; diff --git a/dts/arm/atmel/saml21.dtsi b/dts/arm/atmel/saml21.dtsi index da9b47dcb4b8..de2f456e200a 100644 --- a/dts/arm/atmel/saml21.dtsi +++ b/dts/arm/atmel/saml21.dtsi @@ -45,7 +45,7 @@ tcc2: tcc@42001c00 { compatible = "atmel,sam0-tcc"; - reg = <0x42001c00 0x80>; + reg = <0x42001C00 0x80>; interrupts = <16 0>; clocks = <&gclk 26>, <&mclk 0x1c 7>; clock-names = "GCLK", "MCLK"; diff --git a/dts/arm/atmel/saml2x.dtsi b/dts/arm/atmel/saml2x.dtsi index 89149280fa6d..e2cb9bd11552 100644 --- a/dts/arm/atmel/saml2x.dtsi +++ b/dts/arm/atmel/saml2x.dtsi @@ -57,10 +57,10 @@ id: device_id@80a00c { compatible = "atmel,sam0-id"; - reg = <0x0080a00c 0x4>, - <0x0080a040 0x4>, - <0x0080a044 0x4>, - <0x0080a048 0x4>; + reg = <0x0080A00C 0x4>, + <0x0080A040 0x4>, + <0x0080A044 0x4>, + <0x0080A048 0x4>; }; soc { @@ -146,7 +146,7 @@ sercom3: sercom@42000c00 { compatible = "atmel,sam0-sercom"; - reg = <0x42000c00 0x40>; + reg = <0x42000C00 0x40>; status = "disabled"; }; diff --git a/dts/arm/atmel/samx7x.dtsi b/dts/arm/atmel/samx7x.dtsi index 88cdccbc6c6e..129584f0eb98 100644 --- a/dts/arm/atmel/samx7x.dtsi +++ b/dts/arm/atmel/samx7x.dtsi @@ -127,7 +127,7 @@ clock-frequency = ; #address-cells = <1>; #size-cells = <0>; - reg = <0x40018000 0x12b>; + reg = <0x40018000 0x12B>; interrupts = <19 0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 19>; status = "disabled"; @@ -138,7 +138,7 @@ clock-frequency = ; #address-cells = <1>; #size-cells = <0>; - reg = <0x4001c000 0x12b>; + reg = <0x4001c000 0x12B>; interrupts = <20 0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 20>; status = "disabled"; @@ -297,7 +297,7 @@ clock-frequency = ; #address-cells = <1>; #size-cells = <0>; - reg = <0x40060000 0x12b>; + reg = <0x40060000 0x12B>; interrupts = <41 0>; clocks = <&pmc PMC_TYPE_PERIPHERAL 41>; status = "disabled"; diff --git a/dts/arm/elan/em32fxxx.dtsi b/dts/arm/elan/em32fxxx.dtsi index b88abbe182bb..cdc5b0055b81 100644 --- a/dts/arm/elan/em32fxxx.dtsi +++ b/dts/arm/elan/em32fxxx.dtsi @@ -145,8 +145,8 @@ uid: device_uid@40030f00 { compatible = "elan,em32-uid"; reg = <0x40030f00 0x4 /* Chip ID */ - 0x100a6020 0x4 /* Device ID */ - 0x100a6024 0x4 /* IC Version */ >; + 0x100A6020 0x4 /* Device ID */ + 0x100A6024 0x4 /* IC Version */ >; reg-names = "chip_id", "device_id", "ic_version"; status = "disabled"; }; diff --git a/dts/arm/ene/kb106x/kb1064.dtsi b/dts/arm/ene/kb106x/kb1064.dtsi index c8e2a7875c5a..bce2c6160633 100644 --- a/dts/arm/ene/kb106x/kb1064.dtsi +++ b/dts/arm/ene/kb106x/kb1064.dtsi @@ -57,7 +57,7 @@ pwm10: pwm@402100a0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100a0 0x10>; + reg = <0x402100A0 0x10>; pwm-channel = <10>; #pwm-cells = <3>; status = "disabled"; @@ -65,7 +65,7 @@ pwm11: pwm@402100b0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100b0 0x10>; + reg = <0x402100B0 0x10>; pwm-channel = <11>; #pwm-cells = <3>; status = "disabled"; @@ -73,7 +73,7 @@ pwm12: pwm@402100c0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100c0 0x10>; + reg = <0x402100C0 0x10>; pwm-channel = <12>; #pwm-cells = <3>; status = "disabled"; @@ -81,7 +81,7 @@ pwm13: pwm@402100d0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100d0 0x10>; + reg = <0x402100D0 0x10>; pwm-channel = <13>; #pwm-cells = <3>; status = "disabled"; @@ -89,7 +89,7 @@ pwm14: pwm@402100e0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100e0 0x10>; + reg = <0x402100E0 0x10>; pwm-channel = <14>; #pwm-cells = <3>; status = "disabled"; @@ -97,7 +97,7 @@ pwm15: pwm@402100f0 { compatible = "ene,kb106x-pwm"; - reg = <0x402100f0 0x10>; + reg = <0x402100F0 0x10>; pwm-channel = <15>; #pwm-cells = <3>; status = "disabled"; diff --git a/dts/arm/ene/kb106x/kb106x.dtsi b/dts/arm/ene/kb106x/kb106x.dtsi index 39fcdfd58eb0..a95ecc049635 100644 --- a/dts/arm/ene/kb106x/kb106x.dtsi +++ b/dts/arm/ene/kb106x/kb106x.dtsi @@ -93,7 +93,7 @@ gpio6x7x: gpio@5000000c { compatible = "ene,kb106x-gpio"; - reg = <0x5000000c 0x04>, <0x5001000c 0x04>; + reg = <0x5000000C 0x04>, <0x5001000C 0x04>; interrupts = <8 3>, <9 3>; gpio-controller; #gpio-cells = <2>; diff --git a/dts/arm/ene/kb1200.dtsi b/dts/arm/ene/kb1200.dtsi index 576046c612f0..f680de20066e 100644 --- a/dts/arm/ene/kb1200.dtsi +++ b/dts/arm/ene/kb1200.dtsi @@ -92,7 +92,7 @@ gpio6x7x: gpio@5000000c { compatible = "ene,kb1200-gpio"; - reg = <0x5000000c 0x04>, <0x5001000c 0x04>; + reg = <0x5000000C 0x04>, <0x5001000C 0x04>; interrupts = <8 3>, <9 3>; gpio-controller; #gpio-cells = <2>; diff --git a/dts/arm/gd/gd32a50x/gd32a50x.dtsi b/dts/arm/gd/gd32a50x/gd32a50x.dtsi index e9e95a1e2fe0..6fd4e0c5c83d 100644 --- a/dts/arm/gd/gd32a50x/gd32a50x.dtsi +++ b/dts/arm/gd/gd32a50x/gd32a50x.dtsi @@ -205,7 +205,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002c00 0x400>; + reg = <0x40002C00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32e10x/gd32e10x.dtsi b/dts/arm/gd/gd32e10x/gd32e10x.dtsi index e1065e5ea116..4d4adba3e95e 100644 --- a/dts/arm/gd/gd32e10x/gd32e10x.dtsi +++ b/dts/arm/gd/gd32e10x/gd32e10x.dtsi @@ -172,7 +172,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002c00 0x400>; + reg = <0x40002C00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32e50x/gd32e50x.dtsi b/dts/arm/gd/gd32e50x/gd32e50x.dtsi index ac50b013e178..a02dd5df866b 100644 --- a/dts/arm/gd/gd32e50x/gd32e50x.dtsi +++ b/dts/arm/gd/gd32e50x/gd32e50x.dtsi @@ -208,7 +208,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002c00 0x400>; + reg = <0x40002C00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32f3x0/gd32f3x0.dtsi b/dts/arm/gd/gd32f3x0/gd32f3x0.dtsi index daa27e011089..95c56e3de0aa 100644 --- a/dts/arm/gd/gd32f3x0/gd32f3x0.dtsi +++ b/dts/arm/gd/gd32f3x0/gd32f3x0.dtsi @@ -110,7 +110,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002c00 0x400>; + reg = <0x40002C00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32f403/gd32f403.dtsi b/dts/arm/gd/gd32f403/gd32f403.dtsi index 070d0a73f297..0b6ac33245c5 100644 --- a/dts/arm/gd/gd32f403/gd32f403.dtsi +++ b/dts/arm/gd/gd32f403/gd32f403.dtsi @@ -210,7 +210,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002c00 0x400>; + reg = <0x40002C00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/gd/gd32f4xx/gd32f4xx.dtsi b/dts/arm/gd/gd32f4xx/gd32f4xx.dtsi index 830f261d2ddc..f94ddc4e38e7 100644 --- a/dts/arm/gd/gd32f4xx/gd32f4xx.dtsi +++ b/dts/arm/gd/gd32f4xx/gd32f4xx.dtsi @@ -294,7 +294,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002c00 0x400>; + reg = <0x40002C00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi b/dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi index 87c691a7de1a..33f1a0b6a489 100644 --- a/dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi +++ b/dts/arm/infineon/cat3/xmc/xmc4xxx.dtsi @@ -169,7 +169,7 @@ adc2: adc@40004c00 { compatible = "infineon,xmc4xxx-adc"; - reg = <0x40004c00 0x400>; + reg = <0x40004C00 0x400>; interrupts = <26 62>; #io-channel-cells = <1>; status = "disabled"; @@ -247,7 +247,7 @@ }; ethernet@5000c000 { - reg = <0x5000c000 0x3fff>; + reg = <0x5000C000 0x3FFF>; eth: ethernet { compatible = "infineon,xmc4xxx-ethernet"; diff --git a/dts/arm/intel_socfpga_std/socfpga.dtsi b/dts/arm/intel_socfpga_std/socfpga.dtsi index 5575f44c894a..accf63c8acfa 100644 --- a/dts/arm/intel_socfpga_std/socfpga.dtsi +++ b/dts/arm/intel_socfpga_std/socfpga.dtsi @@ -116,7 +116,7 @@ IRQ_DEFAULT_PRIORITY>, ; - reg = <0xfffec200 0x1c>; + reg = <0xfffec200 0x1C>; clocks = <&osc1>; }; diff --git a/dts/arm/microchip/mec/mec1501hsz.dtsi b/dts/arm/microchip/mec/mec1501hsz.dtsi index 460c81c234e0..5815a8859e69 100644 --- a/dts/arm/microchip/mec/mec1501hsz.dtsi +++ b/dts/arm/microchip/mec/mec1501hsz.dtsi @@ -41,7 +41,7 @@ }; flash0: flash@e0000 { - reg = <0x000e0000 0x38000>; + reg = <0x000E0000 0x38000>; }; sram0: memory@118000 { @@ -261,7 +261,7 @@ i2c_smb_3: i2c@40004c00 { compatible = "microchip,xec-i2c"; - reg = <0x40004c00 0x80>; + reg = <0x40004C00 0x80>; clock-frequency = ; interrupts = <23 1>; pcrs = <3 15>; @@ -309,7 +309,7 @@ clock-frequency = <48000000>; reg = <0x40000c00 0x20>; interrupts = <136 0>; - max-value = <0xffff>; + max-value = <0xFFFF>; prescaler = <0>; status = "disabled"; girqs = <23 0>; @@ -321,7 +321,7 @@ clock-frequency = <48000000>; reg = <0x40000c20 0x20>; interrupts = <137 0>; - max-value = <0xffff>; + max-value = <0xFFFF>; prescaler = <0>; status = "disabled"; girqs = <23 1>; @@ -339,7 +339,7 @@ clock-frequency = <48000000>; reg = <0x40000c80 0x20>; interrupts = <140 0>; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; prescaler = <0>; girqs = <23 4>; pcrs = <3 23>; @@ -351,7 +351,7 @@ clock-frequency = <48000000>; reg = <0x40000ca0 0x20>; interrupts = <141 0>; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; prescaler = <0>; girqs = <23 5>; pcrs = <3 24>; diff --git a/dts/arm/microchip/mec/mec1727nsz.dtsi b/dts/arm/microchip/mec/mec1727nsz.dtsi index 32135ed7b412..fd3e7adabdea 100644 --- a/dts/arm/microchip/mec/mec1727nsz.dtsi +++ b/dts/arm/microchip/mec/mec1727nsz.dtsi @@ -44,7 +44,7 @@ }; flash0: flash@c0000 { - reg = <0x000c0000 0x58000>; + reg = <0x000C0000 0x58000>; }; flash1: flash@60000000 { diff --git a/dts/arm/microchip/mec/mec172x_common.dtsi b/dts/arm/microchip/mec/mec172x_common.dtsi index 9e07a70fc9ea..ba87bccd832a 100644 --- a/dts/arm/microchip/mec/mec172x_common.dtsi +++ b/dts/arm/microchip/mec/mec172x_common.dtsi @@ -324,7 +324,7 @@ timer0: timer@40000c00 { interrupts = <136 0>; girqs = <23 0>; pcrs = <1 30>; - max-value = <0xffff>; + max-value = <0xFFFF>; prescaler = <0>; status = "disabled"; }; @@ -336,7 +336,7 @@ timer1: timer@40000c20 { interrupts = <137 0>; girqs = <23 1>; pcrs = <1 31>; - max-value = <0xffff>; + max-value = <0xFFFF>; prescaler = <0>; status = "disabled"; }; @@ -348,7 +348,7 @@ timer2: timer@40000c40 { interrupts = <138 0>; girqs = <23 2>; pcrs = <3 21>; - max-value = <0xffff>; + max-value = <0xFFFF>; prescaler = <0>; status = "disabled"; }; @@ -360,7 +360,7 @@ timer3: timer@40000c60 { interrupts = <139 0>; girqs = <23 3>; pcrs = <3 22>; - max-value = <0xffff>; + max-value = <0xFFFF>; prescaler = <0>; status = "disabled"; }; @@ -377,7 +377,7 @@ timer4: timer@40000c80 { interrupts = <140 0>; girqs = <23 4>; pcrs = <3 23>; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; prescaler = <0>; status = "disabled"; }; @@ -389,7 +389,7 @@ timer5: timer@40000ca0 { interrupts = <141 0>; girqs = <23 5>; pcrs = <3 24>; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; prescaler = <0>; status = "disabled"; }; @@ -539,7 +539,7 @@ i2c_smb_2: i2c@40004800 { i2c_smb_3: i2c@40004c00 { compatible = "microchip,xec-i2c-v2"; - reg = <0x40004c00 0x80>; + reg = <0x40004C00 0x80>; clock-frequency = ; interrupts = <23 1>; girqs = <13 3>; diff --git a/dts/arm/microchip/mec/mec172xnlj.dtsi b/dts/arm/microchip/mec/mec172xnlj.dtsi index ff003ee9645d..95b3b2e47b80 100644 --- a/dts/arm/microchip/mec/mec172xnlj.dtsi +++ b/dts/arm/microchip/mec/mec172xnlj.dtsi @@ -46,7 +46,7 @@ }; flash0: flash@c0000 { - reg = <0x000c0000 0x58000>; + reg = <0x000C0000 0x58000>; }; sram0: memory@118000 { diff --git a/dts/arm/microchip/mec/mec172xnsz.dtsi b/dts/arm/microchip/mec/mec172xnsz.dtsi index dc057238d914..817e22361b8d 100644 --- a/dts/arm/microchip/mec/mec172xnsz.dtsi +++ b/dts/arm/microchip/mec/mec172xnsz.dtsi @@ -46,7 +46,7 @@ }; flash0: flash@c0000 { - reg = <0x000c0000 0x58000>; + reg = <0x000C0000 0x58000>; }; sram0: memory@118000 { diff --git a/dts/arm/microchip/mec/mec5.dtsi b/dts/arm/microchip/mec/mec5.dtsi index 205ade2b642a..60de7b7afa6e 100644 --- a/dts/arm/microchip/mec/mec5.dtsi +++ b/dts/arm/microchip/mec/mec5.dtsi @@ -446,7 +446,7 @@ }; i2c_smb_3: i2c@40004c00 { - reg = <0x40004c00 0x80>; + reg = <0x40004C00 0x80>; clock-frequency = ; interrupts = <23 2>; girqs = <13 3>; diff --git a/dts/arm/microchip/pic32c/pic32cx_sg/common/pic32cx_sg.dtsi b/dts/arm/microchip/pic32c/pic32cx_sg/common/pic32cx_sg.dtsi index a4baa8623b65..8229fc230cf8 100644 --- a/dts/arm/microchip/pic32c/pic32cx_sg/common/pic32cx_sg.dtsi +++ b/dts/arm/microchip/pic32c/pic32cx_sg/common/pic32cx_sg.dtsi @@ -234,7 +234,7 @@ dmac: dmac@4100a000 { compatible = "microchip,dmac-g1-dma"; - reg = <0x4100a000 0x50>; + reg = <0x4100A000 0x50>; interrupts = <31 0>, <32 0>, <33 0>, <34 0>, <35 0>; clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_AHB_DMAC>; clock-names = "mclk"; diff --git a/dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi b/dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi index 8a6a753dbeb5..7edd0b21b5a3 100644 --- a/dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi +++ b/dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi @@ -232,7 +232,7 @@ dmac: dmac@4100a000 { compatible = "microchip,dmac-g1-dma"; - reg = <0x4100a000 0x50>; + reg = <0x4100A000 0x50>; interrupts = <31 0>, <32 0>, <33 0>, <34 0>, <35 0>; clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_AHB_DMAC>; clock-names = "mclk"; diff --git a/dts/arm/nuvoton/m46x.dtsi b/dts/arm/nuvoton/m46x.dtsi index 9c7ef77ce1f5..eef431800874 100644 --- a/dts/arm/nuvoton/m46x.dtsi +++ b/dts/arm/nuvoton/m46x.dtsi @@ -495,7 +495,7 @@ emac: ethernet@40012000 { compatible = "nuvoton,numaker-ethernet"; - reg = <0x40012000 0x105c>; + reg = <0x40012000 0x105C>; interrupts = <66 0>; resets = <&rst NUMAKER_EMAC0_RST>; phy-addr = <1>; diff --git a/dts/arm/nuvoton/npck/npck-alts-map.dtsi b/dts/arm/nuvoton/npck/npck-alts-map.dtsi index 71f00529dd66..e702ef1b5413 100644 --- a/dts/arm/nuvoton/npck/npck-alts-map.dtsi +++ b/dts/arm/nuvoton/npck/npck-alts-map.dtsi @@ -359,19 +359,19 @@ /* SCFG DEVALT C */ altc_smb4b_sl: altc4 { - alts = <&scfg 0x0c 0x4 0>; + alts = <&scfg 0x0C 0x4 0>; }; altc_smb3b_sl: altc5 { - alts = <&scfg 0x0c 0x5 0>; + alts = <&scfg 0x0C 0x5 0>; }; altc_smb2b_sl: altc6 { - alts = <&scfg 0x0c 0x6 0>; + alts = <&scfg 0x0C 0x6 0>; }; altc_smb2a_sl: altc7 { - alts = <&scfg 0x0c 0x7 0>; + alts = <&scfg 0x0C 0x7 0>; }; /* SCFG DEVALT D */ diff --git a/dts/arm/nuvoton/npck/npck.dtsi b/dts/arm/nuvoton/npck/npck.dtsi index a0003fb8fc4d..d64a3af5782b 100644 --- a/dts/arm/nuvoton/npck/npck.dtsi +++ b/dts/arm/nuvoton/npck/npck.dtsi @@ -218,7 +218,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40095000 0x2000>; gpio-controller; - index = <0xa>; + index = <0xA>; #gpio-cells = <2>; }; @@ -226,7 +226,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40097000 0x2000>; gpio-controller; - index = <0xb>; + index = <0xB>; #gpio-cells = <2>; }; @@ -234,7 +234,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40099000 0x2000>; gpio-controller; - index = <0xc>; + index = <0xC>; #gpio-cells = <2>; }; @@ -242,7 +242,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009b000 0x2000>; gpio-controller; - index = <0xd>; + index = <0xD>; #gpio-cells = <2>; }; @@ -250,7 +250,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009d000 0x2000>; gpio-controller; - index = <0xe>; + index = <0xE>; #gpio-cells = <2>; }; @@ -258,7 +258,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009f000 0x2000>; gpio-controller; - index = <0xf>; + index = <0xF>; #gpio-cells = <2>; }; diff --git a/dts/arm/nuvoton/npck/npck3.dtsi b/dts/arm/nuvoton/npck/npck3.dtsi index 8d31caa6babb..6de99add419a 100644 --- a/dts/arm/nuvoton/npck/npck3.dtsi +++ b/dts/arm/nuvoton/npck/npck3.dtsi @@ -55,7 +55,7 @@ uart1: serial@400c4000 { compatible = "nuvoton,npcx-uart", "nuvoton,npcx-uart-npckn"; - reg = <0x400c4000 0x2000>; + reg = <0x400C4000 0x2000>; interrupts = <23 3>; clocks = <&pcc NPCX_CLOCK_BUS_APB2 NPCX_PWDWN_CTL1 4>; uart-rx = <&wui_cr_sin1>; @@ -279,6 +279,6 @@ soc-id { chip-id = <0x09>; - revision-reg = <0x0000fffc 4>; + revision-reg = <0x0000FFFC 4>; }; }; diff --git a/dts/arm/nuvoton/npck3m8k.dtsi b/dts/arm/nuvoton/npck3m8k.dtsi index e07f97d1f0f4..fdd860b9495b 100644 --- a/dts/arm/nuvoton/npck3m8k.dtsi +++ b/dts/arm/nuvoton/npck3m8k.dtsi @@ -18,13 +18,13 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(62)>; + reg = <0x200C0000 DT_SIZE_K(62)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200c7800 { compatible = "mmio-sram"; - reg = <0x200c7800 DT_SIZE_K(2)>; + reg = <0x200C7800 DT_SIZE_K(2)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx/npcx-alts-map.dtsi b/dts/arm/nuvoton/npcx/npcx-alts-map.dtsi index f81686b30bb1..f5f71d6aed0e 100644 --- a/dts/arm/nuvoton/npcx/npcx-alts-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx-alts-map.dtsi @@ -282,141 +282,141 @@ /* SCFG DEVALT A */ alta_no_kso16_sl: alta0-inv { - alts = <&scfg 0x0a 0x0 1>; + alts = <&scfg 0x0A 0x0 1>; }; alta_no_kso17_sl: alta1-inv { - alts = <&scfg 0x0a 0x1 1>; + alts = <&scfg 0x0A 0x1 1>; }; alta_32k_out_sl: alta2 { - alts = <&scfg 0x0a 0x2 0>; + alts = <&scfg 0x0A 0x2 0>; }; alta_no_vcc1_rst: alta4-inv { - alts = <&scfg 0x0a 0x4 1>; + alts = <&scfg 0x0A 0x4 1>; }; alta_no_peci_en: alta6-inv { - alts = <&scfg 0x0a 0x6 1>; + alts = <&scfg 0x0A 0x6 1>; }; /* SCFG DEVALT B */ altb_rxd_sl: altb0 { - alts = <&scfg 0x0b 0x0 0>; + alts = <&scfg 0x0B 0x0 0>; }; altb_txd_sl: altb1 { - alts = <&scfg 0x0b 0x1 0>; + alts = <&scfg 0x0B 0x1 0>; }; altb_rts_sl: altb2 { - alts = <&scfg 0x0b 0x2 0>; + alts = <&scfg 0x0B 0x2 0>; }; altb_cts_sl: altb3 { - alts = <&scfg 0x0b 0x3 0>; + alts = <&scfg 0x0B 0x3 0>; }; altb_ri_sl: altb4 { - alts = <&scfg 0x0b 0x4 0>; + alts = <&scfg 0x0B 0x4 0>; }; altb_dtr_bout_sl: altb5 { - alts = <&scfg 0x0b 0x5 0>; + alts = <&scfg 0x0B 0x5 0>; }; altb_dcd_sl: altb6 { - alts = <&scfg 0x0b 0x6 0>; + alts = <&scfg 0x0B 0x6 0>; }; altb_dsr_sl: altb7 { - alts = <&scfg 0x0b 0x7 0>; + alts = <&scfg 0x0B 0x7 0>; }; /* SCFG DEVALT C */ altc_shi_sl: altc1 { - alts = <&scfg 0x0c 0x1 0>; + alts = <&scfg 0x0C 0x1 0>; }; altc_ps2_3_sl2: altc3 { - alts = <&scfg 0x0c 0x3 0>; + alts = <&scfg 0x0C 0x3 0>; }; altc_ta1_sl2: altc4 { - alts = <&scfg 0x0c 0x4 0>; + alts = <&scfg 0x0C 0x4 0>; }; altc_tb1_sl2: altc5 { - alts = <&scfg 0x0c 0x5 0>; + alts = <&scfg 0x0C 0x5 0>; }; altc_ta2_sl2: altc6 { - alts = <&scfg 0x0c 0x6 0>; + alts = <&scfg 0x0C 0x6 0>; }; altc_tb2_sl2: altc7 { - alts = <&scfg 0x0c 0x7 0>; + alts = <&scfg 0x0C 0x7 0>; }; /* SCFG DEVALT D */ altd_psl_in1_ahi: altd0 { - alts = <&scfg 0x0d 0x0 0>; + alts = <&scfg 0x0D 0x0 0>; }; altd_npsl_in1_sl: altd1-inv { - alts = <&scfg 0x0d 0x1 1>; + alts = <&scfg 0x0D 0x1 1>; }; altd_psl_in2_ahi: altd2 { - alts = <&scfg 0x0d 0x2 0>; + alts = <&scfg 0x0D 0x2 0>; }; altd_npsl_in2_sl: altd3-inv { - alts = <&scfg 0x0d 0x3 1>; + alts = <&scfg 0x0D 0x3 1>; }; altd_psl_in3_ahi: altd4 { - alts = <&scfg 0x0d 0x4 0>; + alts = <&scfg 0x0D 0x4 0>; }; altd_psl_in3_sl: altd5 { - alts = <&scfg 0x0d 0x5 0>; + alts = <&scfg 0x0D 0x5 0>; }; altd_psl_in4_ahi: altd6 { - alts = <&scfg 0x0d 0x6 0>; + alts = <&scfg 0x0D 0x6 0>; }; altd_psl_in4_sl: altd7 { - alts = <&scfg 0x0d 0x7 0>; + alts = <&scfg 0x0D 0x7 0>; }; /* SCFG DEVALT E */ /* SCFG DEVALT F */ altf_adc5_sl: altf0 { - alts = <&scfg 0x0f 0x0 0>; + alts = <&scfg 0x0F 0x0 0>; }; altf_adc6_sl: altf1 { - alts = <&scfg 0x0f 0x1 0>; + alts = <&scfg 0x0F 0x1 0>; }; altf_adc7_sl: altf2 { - alts = <&scfg 0x0f 0x2 0>; + alts = <&scfg 0x0F 0x2 0>; }; altf_adc8_sl: altf3 { - alts = <&scfg 0x0f 0x3 0>; + alts = <&scfg 0x0F 0x3 0>; }; altf_adc9_sl: altf4 { - alts = <&scfg 0x0f 0x4 0>; + alts = <&scfg 0x0F 0x4 0>; }; altf_shi_new: altf7 { - alts = <&scfg 0x0f 0x7 0>; + alts = <&scfg 0x0F 0x7 0>; }; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx.dtsi b/dts/arm/nuvoton/npcx/npcx.dtsi index 27bc21e6909a..4268c7f95ce5 100644 --- a/dts/arm/nuvoton/npcx/npcx.dtsi +++ b/dts/arm/nuvoton/npcx/npcx.dtsi @@ -205,7 +205,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40095000 0x2000>; gpio-controller; - index = <0xa>; + index = <0xA>; #gpio-cells = <2>; }; @@ -213,7 +213,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40097000 0x2000>; gpio-controller; - index = <0xb>; + index = <0xB>; #gpio-cells = <2>; }; @@ -221,7 +221,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x40099000 0x2000>; gpio-controller; - index = <0xc>; + index = <0xC>; #gpio-cells = <2>; }; @@ -229,7 +229,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009b000 0x2000>; gpio-controller; - index = <0xd>; + index = <0xD>; #gpio-cells = <2>; }; @@ -237,7 +237,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009d000 0x2000>; gpio-controller; - index = <0xe>; + index = <0xE>; #gpio-cells = <2>; }; @@ -245,7 +245,7 @@ compatible = "nuvoton,npcx-gpio"; reg = <0x4009f000 0x2000>; gpio-controller; - index = <0xf>; + index = <0xF>; #gpio-cells = <2>; }; @@ -328,7 +328,7 @@ interrupts = <10 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB1 NPCX_PWDWN_CTL4 4>; vref-mv = <2816>; - speed-conf = <0x03 0x8b07 0x0100 0x0001>; + speed-conf = <0x03 0x8B07 0x0100 0x0001>; status = "disabled"; }; diff --git a/dts/arm/nuvoton/npcx/npcx4.dtsi b/dts/arm/nuvoton/npcx/npcx4.dtsi index 674319121973..a23ec0ddd7ff 100644 --- a/dts/arm/nuvoton/npcx/npcx4.dtsi +++ b/dts/arm/nuvoton/npcx/npcx4.dtsi @@ -86,7 +86,7 @@ */ bbram: bb-ram@400af001 { compatible = "nuvoton,npcx-bbram"; - reg = <0x400af001 0x7f + reg = <0x400af001 0x7F 0x400af100 0x1>; reg-names = "memory", "status"; }; @@ -106,7 +106,7 @@ uart1: serial@400e0000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART1 register, Index 1: MDMA1 register */ - reg = <0x400e0000 0x2000 0x40011100 0x100>; + reg = <0x400E0000 0x2000 0x40011100 0x100>; interrupts = <33 4>; /* Index 0: UART1 clock, Index 1: MDMA1 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL1 4 @@ -118,7 +118,7 @@ uart2: serial@400e2000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART2 register, Index 1: MDMA2 register */ - reg = <0x400e2000 0x2000 0x40011200 0x100>; + reg = <0x400E2000 0x2000 0x40011200 0x100>; interrupts = <32 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 6 &pcc NPCX_CLOCK_BUS_CORE NPCX_PWDWN_CTL9 1>; @@ -129,7 +129,7 @@ uart3: serial@400e4000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART3 register, Index 1: MDMA3 register */ - reg = <0x400e4000 0x2000 0x40011300 0x100>; + reg = <0x400E4000 0x2000 0x40011300 0x100>; interrupts = <38 4>; /* Index 0: UART3 clock, Index 1: MDMA3 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 4 @@ -141,7 +141,7 @@ uart4: serial@400e6000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART4 register, Index 1: MDMA4 register */ - reg = <0x400e6000 0x2000 0x40011400 0x100>; + reg = <0x400E6000 0x2000 0x40011400 0x100>; interrupts = <39 4>; /* Index 0: UART4 clock, Index 1: MDMA4 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 3 @@ -386,7 +386,7 @@ interrupts = <22 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB1 NPCX_PWDWN_CTL4 3>; vref-mv = <3300>; - speed-conf = <0x03 0x8b07 0x0100 0x0001>; + speed-conf = <0x03 0x8B07 0x0100 0x0001>; channel-count = <26>; threshold-count = <6>; status = "disabled"; @@ -582,6 +582,6 @@ soc-id { family-id = <0x23>; chip-id = <0x0a>; - revision-reg = <0x0000fffc 4>; + revision-reg = <0x0000FFFC 4>; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx4/npcx4-alts-map.dtsi b/dts/arm/nuvoton/npcx/npcx4/npcx4-alts-map.dtsi index 0256890453b8..731fed2cf1b4 100644 --- a/dts/arm/nuvoton/npcx/npcx4/npcx4-alts-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx4/npcx4-alts-map.dtsi @@ -37,35 +37,35 @@ /* SCFG DEVALT E */ alte_cr_sin4_sl: alte6 { - alts = <&scfg 0x0e 0x6 0>; + alts = <&scfg 0x0E 0x6 0>; }; alte_cr_sout4_sl: alte7 { - alts = <&scfg 0x0e 0x7 0>; + alts = <&scfg 0x0E 0x7 0>; }; /* SCFG DEVALT F */ altf_adc10_sl: altf5 { - alts = <&scfg 0x0f 0x5 0>; + alts = <&scfg 0x0F 0x5 0>; }; altf_adc11_sl: altf6 { - alts = <&scfg 0x0f 0x6 0>; + alts = <&scfg 0x0F 0x6 0>; }; /* SCFG DEVALT A */ alta_32kclkin_sl: alta3 { - alts = <&scfg 0x0a 0x3 0>; + alts = <&scfg 0x0A 0x3 0>; }; /* SCFG DEVALT C */ altc_gpio97_sl_inv: altc2-inv { - alts = <&scfg 0x0c 0x2 1>; + alts = <&scfg 0x0C 0x2 1>; }; /* SCFG DEVALT F */ altf_adc12_sl: altf7 { - alts = <&scfg 0x0f 0x7 0>; + alts = <&scfg 0x0F 0x7 0>; }; /* SCFG DEVALT G */ diff --git a/dts/arm/nuvoton/npcx/npcx7.dtsi b/dts/arm/nuvoton/npcx/npcx7.dtsi index 63947cf0c090..8bd51870398c 100644 --- a/dts/arm/nuvoton/npcx/npcx7.dtsi +++ b/dts/arm/nuvoton/npcx/npcx7.dtsi @@ -102,7 +102,7 @@ uart1: serial@400c4000 { compatible = "nuvoton,npcx-uart"; - reg = <0x400c4000 0x2000>; + reg = <0x400C4000 0x2000>; interrupts = <33 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB2 NPCX_PWDWN_CTL1 4>; uart-rx = <&wui_cr_sin1>; @@ -111,7 +111,7 @@ uart2: serial@400c6000 { compatible = "nuvoton,npcx-uart"; - reg = <0x400c6000 0x2000>; + reg = <0x400C6000 0x2000>; interrupts = <32 4>; clocks = <&pcc NPCX_CLOCK_BUS_APB2 NPCX_PWDWN_CTL7 6>; uart-rx = <&wui_cr_sin2>; @@ -377,7 +377,7 @@ soc-id { chip-id = <0x07>; - revision-reg = <0x00007ffc 1>; + revision-reg = <0x00007FFC 1>; }; booter-variant { diff --git a/dts/arm/nuvoton/npcx/npcx7/npcx7-alts-map.dtsi b/dts/arm/nuvoton/npcx/npcx7/npcx7-alts-map.dtsi index e928abb1af38..173b7fb14424 100644 --- a/dts/arm/nuvoton/npcx/npcx7/npcx7-alts-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx7/npcx7-alts-map.dtsi @@ -28,29 +28,29 @@ /* SCFG DEVALT A */ alta_uart2_sl: alta5 { - alts = <&scfg 0x0a 0x5 0>; + alts = <&scfg 0x0A 0x5 0>; }; alta_uart1_sl1: alta7 { - alts = <&scfg 0x0a 0x7 0>; + alts = <&scfg 0x0A 0x7 0>; }; /* SCFG DEVALT C */ altc_uart1_sl2: altc0 { - alts = <&scfg 0x0c 0x0 0>; + alts = <&scfg 0x0C 0x0 0>; }; /* SCFG DEVALT E */ alte_wov_sl: alte0 { - alts = <&scfg 0x0e 0x0 0>; + alts = <&scfg 0x0E 0x0 0>; }; alte_i2s_sl: alte1 { - alts = <&scfg 0x0e 0x1 0>; + alts = <&scfg 0x0E 0x1 0>; }; alte_dmclk_fast: alte2 { - alts = <&scfg 0x0e 0x2 0>; + alts = <&scfg 0x0E 0x2 0>; }; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx7/npcx7-miwus-int-map.dtsi b/dts/arm/nuvoton/npcx/npcx7/npcx7-miwus-int-map.dtsi index 13ed889e0285..806d6f0a24f7 100644 --- a/dts/arm/nuvoton/npcx/npcx7/npcx7-miwus-int-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx7/npcx7-miwus-int-map.dtsi @@ -24,7 +24,7 @@ group_efgh0: group-efgh0-map { irq = <11>; irq-prio = <3>; - group-mask = <0xf0>; + group-mask = <0xF0>; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx9.dtsi b/dts/arm/nuvoton/npcx/npcx9.dtsi index 2f0845d0c894..b9c0190e0d31 100644 --- a/dts/arm/nuvoton/npcx/npcx9.dtsi +++ b/dts/arm/nuvoton/npcx/npcx9.dtsi @@ -104,7 +104,7 @@ uart1: serial@400e0000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART1 register, Index 1: MDMA1 register */ - reg = <0x400e0000 0x2000 0x40011100 0x100>; + reg = <0x400E0000 0x2000 0x40011100 0x100>; interrupts = <33 4>; /* Index 0: UART1 clock, Index 1: MDMA1 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL1 4 @@ -116,7 +116,7 @@ uart2: serial@400e2000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART2 register, Index 1: MDMA2 register */ - reg = <0x400e2000 0x2000 0x40011200 0x100>; + reg = <0x400E2000 0x2000 0x40011200 0x100>; interrupts = <32 4>; /* Index 0: UART2 clock, Index 1: MDMA2 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 6 @@ -128,7 +128,7 @@ uart3: serial@400e4000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART3 register, Index 1: MDMA3 register */ - reg = <0x400e4000 0x2000 0x40011300 0x100>; + reg = <0x400E4000 0x2000 0x40011300 0x100>; interrupts = <38 4>; /* Index 0: UART3 clock, Index 1: MDMA3 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 4 @@ -140,7 +140,7 @@ uart4: serial@400e6000 { compatible = "nuvoton,npcx-uart"; /* Index 0: UART4 register, Index 1: MDMA4 register */ - reg = <0x400e6000 0x2000 0x40011400 0x100>; + reg = <0x400E6000 0x2000 0x40011400 0x100>; interrupts = <39 4>; /* Index 0: UART4 clock, Index 1: MDMA4 clock */ clocks = <&pcc NPCX_CLOCK_BUS_APB4 NPCX_PWDWN_CTL7 3 @@ -435,6 +435,6 @@ soc-id { chip-id = <0x09>; - revision-reg = <0x0000fffc 4>; + revision-reg = <0x0000FFFC 4>; }; }; diff --git a/dts/arm/nuvoton/npcx/npcx9/npcx9-alts-map.dtsi b/dts/arm/nuvoton/npcx/npcx9/npcx9-alts-map.dtsi index 1438ad12780b..bdfd7c47f93f 100644 --- a/dts/arm/nuvoton/npcx/npcx9/npcx9-alts-map.dtsi +++ b/dts/arm/nuvoton/npcx/npcx9/npcx9-alts-map.dtsi @@ -28,20 +28,20 @@ /* SCFG DEVALT E */ alte_cr_sin4_sl: alte6 { - alts = <&scfg 0x0e 0x6 0>; + alts = <&scfg 0x0E 0x6 0>; }; alte_cr_sout4_sl: alte7 { - alts = <&scfg 0x0e 0x7 0>; + alts = <&scfg 0x0E 0x7 0>; }; /* SCFG DEVALT F */ altf_adc10_sl: altf5 { - alts = <&scfg 0x0f 0x5 0>; + alts = <&scfg 0x0F 0x5 0>; }; altf_adc11_sl: altf6 { - alts = <&scfg 0x0f 0x6 0>; + alts = <&scfg 0x0F 0x6 0>; }; /* SCFG DEVALT G */ diff --git a/dts/arm/nuvoton/npcx4m3f.dtsi b/dts/arm/nuvoton/npcx4m3f.dtsi index e0cb1ad17331..9f1792452b44 100644 --- a/dts/arm/nuvoton/npcx4m3f.dtsi +++ b/dts/arm/nuvoton/npcx4m3f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(96)>; + reg = <0x200C0000 DT_SIZE_K(96)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx4m8f.dtsi b/dts/arm/nuvoton/npcx4m8f.dtsi index fc6789daf9ca..ee427af47058 100644 --- a/dts/arm/nuvoton/npcx4m8f.dtsi +++ b/dts/arm/nuvoton/npcx4m8f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(114)>; + reg = <0x200C0000 DT_SIZE_K(114)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx7m6fb.dtsi b/dts/arm/nuvoton/npcx7m6fb.dtsi index 3a319dcc1beb..9c2b2e757efa 100644 --- a/dts/arm/nuvoton/npcx7m6fb.dtsi +++ b/dts/arm/nuvoton/npcx7m6fb.dtsi @@ -18,13 +18,13 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(62)>; + reg = <0x200C0000 DT_SIZE_K(62)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200cf800 { compatible = "mmio-sram"; - reg = <0x200cf800 DT_SIZE_K(2)>; + reg = <0x200CF800 DT_SIZE_K(2)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx7m6fc.dtsi b/dts/arm/nuvoton/npcx7m6fc.dtsi index 7e31b5a3e62f..15d1b3c6b1df 100644 --- a/dts/arm/nuvoton/npcx7m6fc.dtsi +++ b/dts/arm/nuvoton/npcx7m6fc.dtsi @@ -18,13 +18,13 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(62)>; + reg = <0x200C0000 DT_SIZE_K(62)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200cf800 { compatible = "mmio-sram"; - reg = <0x200cf800 DT_SIZE_K(2)>; + reg = <0x200CF800 DT_SIZE_K(2)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx7m7fc.dtsi b/dts/arm/nuvoton/npcx7m7fc.dtsi index d89a8cb6eb9c..72aa5d17cea9 100644 --- a/dts/arm/nuvoton/npcx7m7fc.dtsi +++ b/dts/arm/nuvoton/npcx7m7fc.dtsi @@ -22,13 +22,13 @@ sram0: memory@200b0000 { compatible = "mmio-sram"; - reg = <0x200b0000 DT_SIZE_K(126)>; + reg = <0x200B0000 DT_SIZE_K(126)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200cf800 { compatible = "mmio-sram"; - reg = <0x200cf800 DT_SIZE_K(2)>; + reg = <0x200CF800 DT_SIZE_K(2)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx9m3f.dtsi b/dts/arm/nuvoton/npcx9m3f.dtsi index d11039eeede6..a82c33589ea0 100644 --- a/dts/arm/nuvoton/npcx9m3f.dtsi +++ b/dts/arm/nuvoton/npcx9m3f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(64)>; + reg = <0x200C0000 DT_SIZE_K(64)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx9m6f.dtsi b/dts/arm/nuvoton/npcx9m6f.dtsi index 15bb9c63332e..e0adaf8b0a56 100644 --- a/dts/arm/nuvoton/npcx9m6f.dtsi +++ b/dts/arm/nuvoton/npcx9m6f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(64)>; + reg = <0x200C0000 DT_SIZE_K(64)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx9m7f.dtsi b/dts/arm/nuvoton/npcx9m7f.dtsi index f73ab976826b..3d8f8d33330c 100644 --- a/dts/arm/nuvoton/npcx9m7f.dtsi +++ b/dts/arm/nuvoton/npcx9m7f.dtsi @@ -18,7 +18,7 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(64)>; + reg = <0x200C0000 DT_SIZE_K(64)>; }; soc-id { diff --git a/dts/arm/nuvoton/npcx9m7fb.dtsi b/dts/arm/nuvoton/npcx9m7fb.dtsi index 0b331db2bb69..c025c646d480 100644 --- a/dts/arm/nuvoton/npcx9m7fb.dtsi +++ b/dts/arm/nuvoton/npcx9m7fb.dtsi @@ -18,12 +18,12 @@ sram0: memory@200b0000 { compatible = "mmio-sram"; - reg = <0x200b0000 DT_SIZE_K(128)>; + reg = <0x200B0000 DT_SIZE_K(128)>; }; soc-id { device-id = <0x62>; - revision-reg = <0x00017ffc 4>; + revision-reg = <0x00017FFC 4>; }; }; diff --git a/dts/arm/nuvoton/npcx9mfp.dtsi b/dts/arm/nuvoton/npcx9mfp.dtsi index 26e126904793..a4b1fef4b414 100644 --- a/dts/arm/nuvoton/npcx9mfp.dtsi +++ b/dts/arm/nuvoton/npcx9mfp.dtsi @@ -22,13 +22,13 @@ sram0: memory@200c0000 { compatible = "mmio-sram"; - reg = <0x200c0000 DT_SIZE_K(92)>; + reg = <0x200C0000 DT_SIZE_K(92)>; }; /* RAM space used by Booter */ bootloader_ram: memory@200d7000 { compatible = "mmio-sram"; - reg = <0x200d7000 DT_SIZE_K(4)>; + reg = <0x200D7000 DT_SIZE_K(4)>; }; soc { diff --git a/dts/arm/nxp/nxp_imx95_m7.dtsi b/dts/arm/nxp/nxp_imx95_m7.dtsi index 6b1eeb3ac815..7937ab7ab01d 100644 --- a/dts/arm/nxp/nxp_imx95_m7.dtsi +++ b/dts/arm/nxp/nxp_imx95_m7.dtsi @@ -216,7 +216,7 @@ dma-requests = <92>; no-error-irq; interrupts = <128 0>, <129 0>, <143 0>; - channels-shared-irq-mask = <0x00000003 0x00000000 0x0000000c 0x00000000 + channels-shared-irq-mask = <0x00000003 0x00000000 0x0000000C 0x00000000 0x00000030 0x00000000>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_k2x.dtsi b/dts/arm/nxp/nxp_k2x.dtsi index ba4eb0422aec..9b6850a5003f 100644 --- a/dts/arm/nxp/nxp_k2x.dtsi +++ b/dts/arm/nxp/nxp_k2x.dtsi @@ -81,9 +81,9 @@ clock-frequency = <32768>; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { @@ -284,7 +284,7 @@ compatible = "nxp,dspi"; reg = <0x4002c000 0x88>; interrupts = <26 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -294,7 +294,7 @@ compatible = "nxp,dspi"; reg = <0x4002d000 0x88>; interrupts = <27 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -312,7 +312,7 @@ reg = <0x40038000 0x98>; interrupts = <42 0>; clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>, - <&sim KINETIS_SIM_BUS_CLK 0x103c 24>; + <&sim KINETIS_SIM_BUS_CLK 0x103C 24>; prescaler = <16>; status = "disabled"; }; @@ -322,7 +322,7 @@ reg = <0x40039000 0x98>; interrupts = <43 0>; clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>, - <&sim KINETIS_SIM_BUS_CLK 0x103c 25>; + <&sim KINETIS_SIM_BUS_CLK 0x103C 25>; prescaler = <16>; status = "disabled"; }; @@ -332,7 +332,7 @@ reg = <0x4003a000 0x98>; interrupts = <44 0>; clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>, - <&sim KINETIS_SIM_BUS_CLK 0x103c 26>; + <&sim KINETIS_SIM_BUS_CLK 0x103C 26>; prescaler = <16>; status = "disabled"; }; @@ -342,7 +342,7 @@ reg = <0x400b9000 0x98>; interrupts = <71 0>; clocks = <&mcg KINETIS_MCG_FIXED_FREQ_CLK>, - <&sim KINETIS_SIM_BUS_CLK 0x103c 6>; + <&sim KINETIS_SIM_BUS_CLK 0x103C 6>; prescaler = <16>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_k32l2b3.dtsi b/dts/arm/nxp/nxp_k32l2b3.dtsi index 2d8627e80d85..0c2ced6dc83f 100644 --- a/dts/arm/nxp/nxp_k32l2b3.dtsi +++ b/dts/arm/nxp/nxp_k32l2b3.dtsi @@ -87,9 +87,9 @@ #clock-cells = <1>; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { @@ -257,7 +257,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x40038000 0x88>; interrupts = <17 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 24>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 24>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -267,7 +267,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x40039000 0x88>; interrupts = <18 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 25>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 25>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -277,7 +277,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x4003a000 0x88>; interrupts = <19 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 26>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 26>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; diff --git a/dts/arm/nxp/nxp_k6x.dtsi b/dts/arm/nxp/nxp_k6x.dtsi index 340fa3554a2a..0f186f705399 100644 --- a/dts/arm/nxp/nxp_k6x.dtsi +++ b/dts/arm/nxp/nxp_k6x.dtsi @@ -112,9 +112,9 @@ prescaler = <32768>; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { @@ -350,7 +350,7 @@ dma-names = "rx", "tx"; rx-fifo-size = <4>; tx-fifo-size = <4>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -365,7 +365,7 @@ rx-fifo-size = <1>; tx-fifo-size = <1>; nxp,rx-tx-chn-share; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -432,7 +432,7 @@ adc0: adc@4003b000 { compatible = "nxp,kinetis-adc16"; reg = <0x4003b000 0x70>; - clocks = <&sim KINETIS_SIM_SIM_SOPT7 0 0xf>, + clocks = <&sim KINETIS_SIM_SIM_SOPT7 0 0xF>, <&sim KINETIS_SIM_SIM_SOPT7 7 0x80>; dmas = <&edma0 0 40>; dma-names = "adc0"; @@ -445,7 +445,7 @@ adc1: adc@400bb000 { compatible = "nxp,kinetis-adc16"; reg = <0x400bb000 0x70>; - clocks = <&sim KINETIS_SIM_SIM_SOPT7 8 0xf00>, + clocks = <&sim KINETIS_SIM_SIM_SOPT7 8 0xF00>, <&sim KINETIS_SIM_SIM_SOPT7 15 0x8000>; dmas = <&edma0 0 41>; dma-names = "adc1"; @@ -526,8 +526,8 @@ interrupts = <75 0>, <76 0>, <77 0>, <78 0>, <79 0>, <80 0>; interrupt-names = "mb-0-15", "bus-off", "error", "tx-warning", "rx-warning", "wake-up"; - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 4>, - <&sim KINETIS_SIM_BUS_CLK 0x103c 4>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 4>, + <&sim KINETIS_SIM_BUS_CLK 0x103C 4>; clock-names = "clksrc0", "clksrc1"; clk-source = <1>; number-of-mb = <16>; @@ -549,7 +549,7 @@ <12 0>, <13 0>, <14 0>, <15 0>, <16 0>; clocks = <&sim KINETIS_SIM_DMA_CLK 0x1040 0x00000002>, - <&sim KINETIS_SIM_DMAMUX_CLK 0x103c 0x00000002>; + <&sim KINETIS_SIM_DMAMUX_CLK 0x103C 0x00000002>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_k8x.dtsi b/dts/arm/nxp/nxp_k8x.dtsi index e9afbb63bf50..38ae65795291 100644 --- a/dts/arm/nxp/nxp_k8x.dtsi +++ b/dts/arm/nxp/nxp_k8x.dtsi @@ -45,9 +45,9 @@ status = "disabled"; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { @@ -110,7 +110,7 @@ adc0: adc@4003b000 { compatible = "nxp,kinetis-adc16"; reg = <0x4003b000 0x1000>; - clocks = <&sim KINETIS_SIM_SIM_SOPT7 0 0xf>, + clocks = <&sim KINETIS_SIM_SIM_SOPT7 0 0xF>, <&sim KINETIS_SIM_SIM_SOPT7 7 0x80>; interrupts = <39 0>; dmas = <&edma0 0 40>; @@ -444,7 +444,7 @@ <12 0>, <13 0>, <14 0>, <15 0>, <16 0>; clocks = <&sim KINETIS_SIM_DMA_CLK 0x1040 0x00000002>, - <&sim KINETIS_SIM_DMAMUX_CLK 0x103c 0x00000002>; + <&sim KINETIS_SIM_DMAMUX_CLK 0x103C 0x00000002>; status = "disabled"; }; }; diff --git a/dts/arm/nxp/nxp_ke1xz.dtsi b/dts/arm/nxp/nxp_ke1xz.dtsi index e70be4c5f74a..fcc65090a08b 100644 --- a/dts/arm/nxp/nxp_ke1xz.dtsi +++ b/dts/arm/nxp/nxp_ke1xz.dtsi @@ -66,7 +66,7 @@ sram_l: memory@1fffe000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x1fffe000 DT_SIZE_K(8)>; + reg = <0x1FFFE000 DT_SIZE_K(8)>; zephyr,memory-region = "SRAML"; }; diff --git a/dts/arm/nxp/nxp_kl25z.dtsi b/dts/arm/nxp/nxp_kl25z.dtsi index 5198c339cb8b..af4091f9b28e 100644 --- a/dts/arm/nxp/nxp_kl25z.dtsi +++ b/dts/arm/nxp/nxp_kl25z.dtsi @@ -25,9 +25,9 @@ }; }; - sram0: memory@1ffff000 { + sram0: memory@1FFFF000 { compatible = "mmio-sram"; - reg = <0x1ffff000 DT_SIZE_K(16)>; + reg = <0x1FFFF000 DT_SIZE_K(16)>; }; /* Dummy pinctrl node, filled with pin mux options at board level */ @@ -82,9 +82,9 @@ status = "disabled"; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { diff --git a/dts/arm/nxp/nxp_kv5x.dtsi b/dts/arm/nxp/nxp_kv5x.dtsi index 956081b6c86b..82d8c9d16f35 100644 --- a/dts/arm/nxp/nxp_kv5x.dtsi +++ b/dts/arm/nxp/nxp_kv5x.dtsi @@ -40,9 +40,9 @@ status = "disabled"; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { diff --git a/dts/arm/nxp/nxp_kw2xd.dtsi b/dts/arm/nxp/nxp_kw2xd.dtsi index 2b2a7fe00342..bf0ce0335adf 100644 --- a/dts/arm/nxp/nxp_kw2xd.dtsi +++ b/dts/arm/nxp/nxp_kw2xd.dtsi @@ -83,9 +83,9 @@ clock-frequency = <32768>; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { @@ -269,7 +269,7 @@ compatible = "nxp,dspi"; reg = <0x4002c000 0x88>; interrupts = <26 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; status = "disabled"; #address-cells = <1>; #size-cells = <0>; @@ -279,7 +279,7 @@ compatible = "nxp,dspi"; reg = <0x4002d000 0x88>; interrupts = <27 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/arm/nxp/nxp_kw40z.dtsi b/dts/arm/nxp/nxp_kw40z.dtsi index 1e8c98ad8b65..88feb64b3dbb 100644 --- a/dts/arm/nxp/nxp_kw40z.dtsi +++ b/dts/arm/nxp/nxp_kw40z.dtsi @@ -60,9 +60,9 @@ clock-frequency = <32768>; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { @@ -182,9 +182,9 @@ spi0: spi@4002c000 { compatible = "nxp,dspi"; - reg = <0x4002c000 0x9c>; + reg = <0x4002c000 0x9C>; interrupts = <10 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; status = "disabled"; #address-cells = <1>; @@ -193,9 +193,9 @@ spi1: spi@4002d000 { compatible = "nxp,dspi"; - reg = <0x4002d000 0x9c>; + reg = <0x4002d000 0x9C>; interrupts = <29 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; status = "disabled"; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/arm/nxp/nxp_kw41z.dtsi b/dts/arm/nxp/nxp_kw41z.dtsi index 63b7ad8e911f..19680e26d6b8 100644 --- a/dts/arm/nxp/nxp_kw41z.dtsi +++ b/dts/arm/nxp/nxp_kw41z.dtsi @@ -63,9 +63,9 @@ prescaler = <32768>; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { @@ -185,9 +185,9 @@ spi0: spi@4002c000 { compatible = "nxp,dspi"; - reg = <0x4002c000 0x9c>; + reg = <0x4002c000 0x9C>; interrupts = <10 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 12>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 12>; status = "disabled"; #address-cells = <1>; @@ -196,9 +196,9 @@ spi1: spi@4002d000 { compatible = "nxp,dspi"; - reg = <0x4002d000 0x9c>; + reg = <0x4002d000 0x9C>; interrupts = <29 3>; - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 13>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 13>; status = "disabled"; #address-cells = <1>; #size-cells = <0>; @@ -209,7 +209,7 @@ reg = <0x40038000 0x88>; interrupts = <0x84 0>; /* channel information needed - fixme */ - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 24>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 24>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -220,7 +220,7 @@ reg = <0x40039000 0x88>; interrupts = <0x88 0>; /* channel information needed - fixme */ - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 25>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 25>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -229,9 +229,9 @@ tpm2: pwm@4003a000 { compatible = "nxp,kinetis-tpm"; reg = <0x4003a000 0x88>; - interrupts = <0x8c 0>; + interrupts = <0x8C 0>; /* channel information needed - fixme */ - clocks = <&sim KINETIS_SIM_BUS_CLK 0x103c 26>; + clocks = <&sim KINETIS_SIM_BUS_CLK 0x103C 26>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; diff --git a/dts/arm/nxp/nxp_lpc11u6x.dtsi b/dts/arm/nxp/nxp_lpc11u6x.dtsi index 9ca4778519d9..cbc834eb1311 100644 --- a/dts/arm/nxp/nxp_lpc11u6x.dtsi +++ b/dts/arm/nxp/nxp_lpc11u6x.dtsi @@ -72,7 +72,7 @@ /* PIO1_0 to PIO1_31. */ pio1: pio1@60 { compatible = "nxp,lpc-iocon-pio"; - reg = <0x60 0x7c>; + reg = <0x60 0x7C>; }; /* PIO2_0 to PIO2_23. */ @@ -151,7 +151,7 @@ compatible = "nxp,lpc11u6x-uart"; clocks = <&syscon LPC11U6X_CLOCK_USART1>; interrupts = <11 0>; - reg = <0x4006c000 0x30>; + reg = <0x4006C000 0x30>; status = "disabled"; }; @@ -175,7 +175,7 @@ compatible = "nxp,lpc11u6x-uart"; clocks = <&syscon LPC11U6X_CLOCK_USART4>; interrupts = <11 0>; - reg = <0x4004c000 0x30>; + reg = <0x4004C000 0x30>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_lpc54xxx.dtsi b/dts/arm/nxp/nxp_lpc54xxx.dtsi index 597eefdc264b..439e837bed03 100644 --- a/dts/arm/nxp/nxp_lpc54xxx.dtsi +++ b/dts/arm/nxp/nxp_lpc54xxx.dtsi @@ -154,7 +154,7 @@ mailbox0: mailbox@4008b000 { compatible = "nxp,lpc-mailbox"; - reg = <0x4008b000 0xec>; + reg = <0x4008b000 0xEC>; interrupts = <31 0>; status = "disabled"; }; diff --git a/dts/arm/nxp/nxp_lpc55S0x_common.dtsi b/dts/arm/nxp/nxp_lpc55S0x_common.dtsi index 79c9129a0b12..97356ebe561d 100644 --- a/dts/arm/nxp/nxp_lpc55S0x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S0x_common.dtsi @@ -55,9 +55,9 @@ reg = <0x20008000 DT_SIZE_K(16)>; }; - sram2: memory@2000c000 { + sram2: memory@2000C000 { compatible = "mmio-sram"; - reg = <0x2000c000 DT_SIZE_K(16)>; + reg = <0x2000C000 DT_SIZE_K(16)>; }; sram3: memory@20010000 { diff --git a/dts/arm/nxp/nxp_lpc55S1x_common.dtsi b/dts/arm/nxp/nxp_lpc55S1x_common.dtsi index 15cdd1cd8c28..61c368f172c3 100644 --- a/dts/arm/nxp/nxp_lpc55S1x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S1x_common.dtsi @@ -210,9 +210,9 @@ prescale = <0>; }; - ctimer4: ctimer@2a000 { + ctimer4: ctimer@2A000 { compatible = "nxp,lpc-ctimer"; - reg = <0x2a000 0x1000>; + reg = <0x2A000 0x1000>; interrupts = <37 0>; status = "disabled"; clk-source = <3>; diff --git a/dts/arm/nxp/nxp_lpc55S2x_common.dtsi b/dts/arm/nxp/nxp_lpc55S2x_common.dtsi index 6c4d9184e98a..2774016e90ae 100644 --- a/dts/arm/nxp/nxp_lpc55S2x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S2x_common.dtsi @@ -339,7 +339,7 @@ status = "disabled"; }; - usbhfs: usbhfs@a2000 { + usbhfs: usbhfs@A2000 { compatible = "nxp,uhc-ohci"; reg = <0xa2000 0x1000>; interrupts = <28 1>; @@ -347,7 +347,7 @@ status = "disabled"; }; - usbhhs: usbhhs@a3000 { + usbhhs: usbhhs@A3000 { compatible = "nxp,uhc-ip3516hs"; reg = <0xa3000 0x1000>; interrupts = <47 1>; diff --git a/dts/arm/nxp/nxp_lpc55S3x_common.dtsi b/dts/arm/nxp/nxp_lpc55S3x_common.dtsi index 0208c6969d17..8c70c28551d9 100644 --- a/dts/arm/nxp/nxp_lpc55S3x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S3x_common.dtsi @@ -293,9 +293,9 @@ #size-cells = <0>; }; - adc0: adc@a0000 { + adc0: adc@A0000 { compatible = "nxp,lpc-lpadc"; - reg = <0xa0000 0x1000>; + reg = <0xA0000 0x1000>; interrupts = <22 0>; status = "disabled"; clk-divider = <8>; @@ -410,9 +410,9 @@ status = "disabled"; }; - flexpwm0: flexpwm@400c3000 { + flexpwm0: flexpwm@400C3000 { compatible = "nxp,flexpwm"; - reg = <0x400c3000 0x1000>; + reg = <0x400C3000 0x1000>; interrupt-names = "INPUT-CAPTURE", "FAULT", "RELOAD-ERROR"; interrupts = <80 0>, <81 0>, <82 0>; @@ -465,9 +465,9 @@ }; }; - flexpwm1: flexpwm@400c5000 { + flexpwm1: flexpwm@400C5000 { compatible = "nxp,flexpwm"; - reg = <0x400c5000 0x1000>; + reg = <0x400C5000 0x1000>; interrupt-names = "INPUT-CAPTURE", "FAULT", "RELOAD-ERROR"; interrupts = <91 0>, <92 0>, <93 0>; diff --git a/dts/arm/nxp/nxp_lpc55S6x_common.dtsi b/dts/arm/nxp/nxp_lpc55S6x_common.dtsi index e5965bd1e0bd..59ee736098c5 100644 --- a/dts/arm/nxp/nxp_lpc55S6x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S6x_common.dtsi @@ -137,9 +137,9 @@ write-block-size = <512>; }; - flash_reserved: flash@9d800 { + flash_reserved: flash@9D800 { compatible = "soc-nv-flash"; - reg = <0x9d800 DT_SIZE_K(9)>; + reg = <0x9D800 DT_SIZE_K(9)>; status = "disabled"; }; @@ -227,7 +227,7 @@ mailbox0: mailbox@8b000 { compatible = "nxp,lpc-mailbox"; - reg = <0x8b000 0xec>; + reg = <0x8b000 0xEC>; interrupts = <31 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "disabled"; @@ -364,9 +364,9 @@ clk-divider = <1>; }; - adc0: adc@a0000 { + adc0: adc@A0000 { compatible = "nxp,lpc-lpadc"; - reg = <0xa0000 0x1000>; + reg = <0xA0000 0x1000>; interrupts = <22 0>; status = "disabled"; clk-divider = <8>; @@ -397,7 +397,7 @@ status = "disabled"; }; - usbhfs: usbhfs@a2000 { + usbhfs: usbhfs@A2000 { compatible = "nxp,uhc-ohci"; reg = <0xa2000 0x1000>; interrupts = <28 1>; @@ -405,7 +405,7 @@ status = "disabled"; }; - usbhhs: usbhhs@a3000 { + usbhhs: usbhhs@A3000 { compatible = "nxp,uhc-ip3516hs"; reg = <0xa3000 0x1000>; interrupts = <47 1>; @@ -466,9 +466,9 @@ prescale = <0>; }; - ctimer4: ctimer@2a000 { + ctimer4: ctimer@2A000 { compatible = "nxp,lpc-ctimer"; - reg = <0x2a000 0x1000>; + reg = <0x2A000 0x1000>; interrupts = <37 0>; status = "disabled"; clk-source = <3>; @@ -488,9 +488,9 @@ #pwm-cells = <3>; }; - rtc: rtc@2c000 { + rtc: rtc@2C000 { compatible = "nxp,lpc-rtc"; - reg = <0x2c000 0x1000>; + reg = <0x2C000 0x1000>; interrupts = <29 0>; status = "disabled"; diff --git a/dts/arm/nxp/nxp_mcxa153.dtsi b/dts/arm/nxp/nxp_mcxa153.dtsi index bec39ff7e4fd..1138680ccd95 100644 --- a/dts/arm/nxp/nxp_mcxa153.dtsi +++ b/dts/arm/nxp/nxp_mcxa153.dtsi @@ -451,9 +451,9 @@ interrupts = <18 0>; }; - cmc: system-modules@4008b000 { + cmc: system-modules@4008B000 { compatible = "nxp,cmc", "nxp,cmc-reset-cause"; - reg = <0x4008b000 0x1000>; + reg = <0x4008B000 0x1000>; interrupts = <1 0>; }; diff --git a/dts/arm/nxp/nxp_mcxa156.dtsi b/dts/arm/nxp/nxp_mcxa156.dtsi index ded2feb9885c..4b4bf059c01b 100644 --- a/dts/arm/nxp/nxp_mcxa156.dtsi +++ b/dts/arm/nxp/nxp_mcxa156.dtsi @@ -587,9 +587,9 @@ interrupts = <18 0>; }; - cmc: system-modules@4008b000 { + cmc: system-modules@4008B000 { compatible = "nxp,cmc", "nxp,cmc-reset-cause"; - reg = <0x4008b000 0x1000>; + reg = <0x4008B000 0x1000>; interrupts = <1 0>; }; diff --git a/dts/arm/nxp/nxp_mcxa344.dtsi b/dts/arm/nxp/nxp_mcxa344.dtsi index b435a3ceab85..36a845afcfd6 100644 --- a/dts/arm/nxp/nxp_mcxa344.dtsi +++ b/dts/arm/nxp/nxp_mcxa344.dtsi @@ -519,9 +519,9 @@ interrupts = <18 0>; }; - cmc: system-modules@4008b000 { + cmc: system-modules@4008B000 { compatible = "nxp,cmc"; - reg = <0x4008b000 0x1000>; + reg = <0x4008B000 0x1000>; interrupts = <1 0>; }; diff --git a/dts/arm/nxp/nxp_mcxaxx6_common.dtsi b/dts/arm/nxp/nxp_mcxaxx6_common.dtsi index bfa79d47afe6..fd03815c9c4e 100644 --- a/dts/arm/nxp/nxp_mcxaxx6_common.dtsi +++ b/dts/arm/nxp/nxp_mcxaxx6_common.dtsi @@ -544,9 +544,9 @@ interrupts = <18 0>; }; - cmc: system-modules@4008b000 { + cmc: system-modules@4008B000 { compatible = "nxp,cmc", "nxp,cmc-reset-cause"; - reg = <0x4008b000 0x1000>; + reg = <0x4008B000 0x1000>; interrupts = <1 0>; }; diff --git a/dts/arm/nxp/nxp_mcxc141.dtsi b/dts/arm/nxp/nxp_mcxc141.dtsi index 2fcaad459b94..7518beaa4713 100644 --- a/dts/arm/nxp/nxp_mcxc141.dtsi +++ b/dts/arm/nxp/nxp_mcxc141.dtsi @@ -7,7 +7,7 @@ #include &sram0 { - reg = <0x1ffff800 DT_SIZE_K(8)>; + reg = <0x1FFFF800 DT_SIZE_K(8)>; }; &flash0 { diff --git a/dts/arm/nxp/nxp_mcxc142.dtsi b/dts/arm/nxp/nxp_mcxc142.dtsi index 41c6815de66b..ae7f90eb066c 100644 --- a/dts/arm/nxp/nxp_mcxc142.dtsi +++ b/dts/arm/nxp/nxp_mcxc142.dtsi @@ -7,7 +7,7 @@ #include &sram0 { - reg = <0x1ffff000 DT_SIZE_K(16)>; + reg = <0x1FFFF000 DT_SIZE_K(16)>; }; &flash0 { diff --git a/dts/arm/nxp/nxp_mcxc242.dtsi b/dts/arm/nxp/nxp_mcxc242.dtsi index af8075e38243..1e493364e734 100644 --- a/dts/arm/nxp/nxp_mcxc242.dtsi +++ b/dts/arm/nxp/nxp_mcxc242.dtsi @@ -7,7 +7,7 @@ #include &sram0 { - reg = <0x1ffff000 DT_SIZE_K(16)>; + reg = <0x1FFFF000 DT_SIZE_K(16)>; }; &flash0 { diff --git a/dts/arm/nxp/nxp_mcxc444.dtsi b/dts/arm/nxp/nxp_mcxc444.dtsi index 3e2aa2ab4654..bdbe4e6cf24c 100644 --- a/dts/arm/nxp/nxp_mcxc444.dtsi +++ b/dts/arm/nxp/nxp_mcxc444.dtsi @@ -7,7 +7,7 @@ #include &sram0 { - reg = <0x1fffe000 DT_SIZE_K(32)>; + reg = <0x1FFFE000 DT_SIZE_K(32)>; }; &flash0 { diff --git a/dts/arm/nxp/nxp_mcxc_common.dtsi b/dts/arm/nxp/nxp_mcxc_common.dtsi index 12413709ed33..90a68cd8e058 100644 --- a/dts/arm/nxp/nxp_mcxc_common.dtsi +++ b/dts/arm/nxp/nxp_mcxc_common.dtsi @@ -35,7 +35,7 @@ }; }; - sram0: memory@1ffff000 { + sram0: memory@1FFFF000 { compatible = "mmio-sram"; }; @@ -92,9 +92,9 @@ #clock-cells = <1>; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; sim: sim@40047000 { @@ -271,7 +271,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x40038000 0x88>; interrupts = <17 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 24>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 24>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -281,7 +281,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x40039000 0x88>; interrupts = <18 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 25>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 25>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; @@ -291,7 +291,7 @@ compatible = "nxp,kinetis-tpm"; reg = <0x4003a000 0x88>; interrupts = <19 0>; - clocks = <&sim KINETIS_SIM_MCGPCLK 0x103c 26>; + clocks = <&sim KINETIS_SIM_MCGPCLK 0x103C 26>; prescaler = <16>; status = "disabled"; #pwm-cells = <3>; diff --git a/dts/arm/nxp/nxp_mcxe24x_common.dtsi b/dts/arm/nxp/nxp_mcxe24x_common.dtsi index 21c71aa1c2ec..36ab6c38185a 100644 --- a/dts/arm/nxp/nxp_mcxe24x_common.dtsi +++ b/dts/arm/nxp/nxp_mcxe24x_common.dtsi @@ -643,9 +643,9 @@ clocks = <&pcc 0x134 KINETIS_PCC_SRC_NONE_OR_EXT>; }; - rcm: rcm@4007f000 { + rcm: rcm@4007F000 { compatible = "nxp,rcm-hwinfo"; - reg = <0x4007f000 0x1000>; + reg = <0x4007F000 0x1000>; }; rtc: rtc@4003d000 { diff --git a/dts/arm/nxp/nxp_mcxn23x_common.dtsi b/dts/arm/nxp/nxp_mcxn23x_common.dtsi index 8970667e9cdd..8179afe26253 100644 --- a/dts/arm/nxp/nxp_mcxn23x_common.dtsi +++ b/dts/arm/nxp/nxp_mcxn23x_common.dtsi @@ -1054,9 +1054,9 @@ #dma-cells = <0>; }; - ewm0: ewm@c0000 { + ewm0: ewm@C0000 { compatible = "nxp,ewm"; - reg = <0xc0000 0x6>; + reg = <0xC0000 0x6>; status = "disabled"; interrupts = <100 0>; clk-divider = <0x0>; diff --git a/dts/arm/nxp/nxp_mcxw72.dtsi b/dts/arm/nxp/nxp_mcxw72.dtsi index 5fb13854b1f7..e99f032655f7 100644 --- a/dts/arm/nxp/nxp_mcxw72.dtsi +++ b/dts/arm/nxp/nxp_mcxw72.dtsi @@ -49,19 +49,19 @@ }; &porta { - reg = <0x42000 0xf0>; + reg = <0x42000 0xF0>; }; &portb { - reg = <0x43000 0xf0>; + reg = <0x43000 0xF0>; }; &portc { - reg = <0x44000 0xf0>; + reg = <0x44000 0xF0>; }; &portd { - reg = <0x45000 0xf0>; + reg = <0x45000 0xF0>; }; &smu2 { diff --git a/dts/arm/nxp/nxp_rt1010.dtsi b/dts/arm/nxp/nxp_rt1010.dtsi index 76eebe6d75c2..b49d8212fb40 100644 --- a/dts/arm/nxp/nxp_rt1010.dtsi +++ b/dts/arm/nxp/nxp_rt1010.dtsi @@ -286,18 +286,18 @@ #size-cells = <0>; #pinmux-cells = <2>; reg = <0x401e0000 0x4000>; - clocks = <&ccm IMX_CCM_SAI1_CLK 0x7c 18>; + clocks = <&ccm IMX_CCM_SAI1_CLK 0x7C 18>; /* Source clock from Audio PLL */ clock-mux = <2>; /* Audio PLL Output Frequency is determined by: * (Fref * (DIV_SELECT + NUM/DENOM)) / POST_DIV * = (24MHz * (32 + 77 / 100)) / 1 = 786.48 MHz */ - pll-clocks = <&anatop 0x70 0xc000 0>, - <&anatop 0x70 0x7f 32>, + pll-clocks = <&anatop 0x70 0xC000 0>, + <&anatop 0x70 0x7F 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3fffffff 77>, - <&anatop 0x90 0x3fffffff 100>; + <&anatop 0x80 0x3FFFFFFF 77>, + <&anatop 0x90 0x3FFFFFFF 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; /* The maximum input frequency into the SAI mclk input is 300MHz * Based on this requirement, pre-div must be at least 3 @@ -306,7 +306,7 @@ * (1+1) = 2 */ pre-div = <0x3>; - podf = <0x0f>; + podf = <0x0F>; pinmuxes = <&iomuxcgpr 0x4 0x80000>; interrupts = <56 0>; dmas = <&edma0 0 19>, <&edma0 0 20>; @@ -326,16 +326,16 @@ #size-cells = <0>; #pinmux-cells = <2>; reg = <0x401e8000 0x4000>; - clocks = <&ccm IMX_CCM_SAI3_CLK 0x7c 22>; + clocks = <&ccm IMX_CCM_SAI3_CLK 0x7C 22>; /* Source clock from Audio PLL */ clock-mux = <2>; pre-div = <0>; podf = <63>; - pll-clocks = <&anatop 0x70 0xc000 0>, - <&anatop 0x70 0x7f 32>, + pll-clocks = <&anatop 0x70 0xC000 0>, + <&anatop 0x70 0x7F 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3fffffff 77>, - <&anatop 0x90 0x3fffffff 100>; + <&anatop 0x80 0x3FFFFFFF 77>, + <&anatop 0x90 0x3FFFFFFF 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; pinmuxes = <&iomuxcgpr 0x4 0x200000>; interrupts = <58 0>, <59 0>; diff --git a/dts/arm/nxp/nxp_rt10xx.dtsi b/dts/arm/nxp/nxp_rt10xx.dtsi index 95f64e872836..5a14b50017a2 100644 --- a/dts/arm/nxp/nxp_rt10xx.dtsi +++ b/dts/arm/nxp/nxp_rt10xx.dtsi @@ -619,7 +619,7 @@ adc1: adc@400c4000 { compatible = "nxp,mcux-12b1msps-sar"; - reg = <0x400c4000 0x1000>; + reg = <0x400C4000 0x1000>; interrupts = <67 0>; clk-divider = <1>; sample-period-mode = <0>; @@ -629,7 +629,7 @@ adc2: adc@400c8000 { compatible = "nxp,mcux-12b1msps-sar"; - reg = <0x400c8000 0x1000>; + reg = <0x400C8000 0x1000>; interrupts = <68 0>; clk-divider = <1>; sample-period-mode = <0>; @@ -823,7 +823,7 @@ enet: enet@402d8000 { compatible = "nxp,enet"; - reg = <0x402d8000 0x628>; + reg = <0x402D8000 0x628>; clocks = <&ccm IMX_CCM_ENET_CLK 0 0>; enet_mac: ethernet { @@ -865,7 +865,7 @@ usb1: usbd@402e0000 { compatible = "nxp,ehci"; - reg = <0x402e0000 0x200>; + reg = <0x402E0000 0x200>; interrupts = <113 1>; interrupt-names = "usb_otg"; clocks = <&usbclk>; @@ -875,7 +875,7 @@ usb2: usbd@402e0200 { compatible = "nxp,ehci"; - reg = <0x402e0200 0x200>; + reg = <0x402E0200 0x200>; interrupts = <112 1>; interrupt-names = "usb_otg"; clocks = <&usbclk>; @@ -885,7 +885,7 @@ usbh1: usbh@402e0000 { compatible = "nxp,uhc-ehci"; - reg = <0x402e0000 0x200>; + reg = <0x402E0000 0x200>; interrupts = <113 1>; interrupt-names = "usb_otg"; clocks = <&usbclk>; @@ -894,7 +894,7 @@ usbh2: usbh@402e0200 { compatible = "nxp,uhc-ehci"; - reg = <0x402e0200 0x200>; + reg = <0x402E0200 0x200>; interrupts = <112 1>; interrupt-names = "usb_otg"; clocks = <&usbclk>; @@ -903,13 +903,13 @@ usbphy1: usbphy@400d9000 { compatible = "nxp,usbphy"; - reg = <0x400d9000 0x1000>; + reg = <0x400D9000 0x1000>; status = "disabled"; }; usbphy2: usbphy@400da000 { compatible = "nxp,usbphy"; - reg = <0x400da000 0x1000>; + reg = <0x400DA000 0x1000>; status = "disabled"; }; @@ -939,7 +939,7 @@ csi: csi@402bc000 { compatible = "nxp,imx-csi"; - reg = <0x402bc000 0x4000>; + reg = <0x402BC000 0x4000>; interrupts = <43 1>; status = "disabled"; }; @@ -952,14 +952,14 @@ dma-requests = <128>; nxp,mem2mem; nxp,a-on; - reg = <0x400e8000 0x4000>, - <0x400ec000 0x4000>; + reg = <0x400E8000 0x4000>, + <0x400EC000 0x4000>; interrupts = <0 0>, <1 0>, <2 0>, <3 0>, <4 0>, <5 0>, <6 0>, <7 0>, <8 0>, <9 0>, <10 0>, <11 0>, <12 0>, <13 0>, <14 0>, <15 0>; irq-shared-offset = <16>; - clocks = <&ccm IMX_CCM_EDMA_CLK 0x7c 0x000000c0>; + clocks = <&ccm IMX_CCM_EDMA_CLK 0x7C 0x000000C0>; status = "disabled"; }; @@ -996,14 +996,14 @@ wdog0: wdog@400b8000 { compatible = "nxp,imx-wdog"; - reg = <0x400b8000 0xa>; + reg = <0x400b8000 0xA>; status = "disabled"; interrupts = <92 0>; }; wdog1: wdog@400d0000 { compatible = "nxp,imx-wdog"; - reg = <0x400d0000 0xa>; + reg = <0x400d0000 0xA>; status = "disabled"; interrupts = <45 0>; }; @@ -1017,7 +1017,7 @@ iomuxcgpr: iomuxcgpr@400ac000 { compatible = "nxp,imx-gpr"; - reg = <0x400ac000 0x4000>; + reg = <0x400AC000 0x4000>; #pinmux-cells = <2>; }; @@ -1035,18 +1035,18 @@ #size-cells = <0>; #pinmux-cells = <2>; reg = <0x40384000 0x4000>; - clocks = <&ccm IMX_CCM_SAI1_CLK 0x7c 18>; + clocks = <&ccm IMX_CCM_SAI1_CLK 0x7C 18>; /* Source clock from Audio PLL */ clock-mux = <2>; /* Audio PLL Output Frequency is determined by: * (Fref * (DIV_SELECT + NUM/DENOM)) / POST_DIV * = (24MHz * (32 + 77 / 100)) / 1 = 786.48 MHz */ - pll-clocks = <&anatop 0x70 0xc000 0>, - <&anatop 0x70 0x7f 32>, + pll-clocks = <&anatop 0x70 0xC000 0>, + <&anatop 0x70 0x7F 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3fffffff 77>, - <&anatop 0x90 0x3fffffff 100>; + <&anatop 0x80 0x3FFFFFFF 77>, + <&anatop 0x90 0x3FFFFFFF 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; /* The maximum input frequency into the SAI mclk input is 300MHz * Based on this requirement, pre-div must be at least 3 @@ -1055,7 +1055,7 @@ * (1+1) = 2 */ pre-div = <0x3>; - podf = <0x0f>; + podf = <0x0F>; pinmuxes = <&iomuxcgpr 0x4 0x80000>; interrupts = <56 0>; dmas = <&edma0 0 19>, <&edma0 0 20>; @@ -1075,16 +1075,16 @@ #size-cells = <0>; #pinmux-cells = <2>; reg = <0x40388000 0x4000>; - clocks = <&ccm IMX_CCM_SAI2_CLK 0x7c 20>; + clocks = <&ccm IMX_CCM_SAI2_CLK 0x7C 20>; /* Source clock from Audio PLL */ clock-mux = <2>; pre-div = <0>; podf = <63>; - pll-clocks = <&anatop 0x70 0xc000 0x0>, - <&anatop 0x70 0x7f 32>, + pll-clocks = <&anatop 0x70 0xC000 0x0>, + <&anatop 0x70 0x7F 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3fffffff 77>, - <&anatop 0x90 0x3fffffff 100>; + <&anatop 0x80 0x3FFFFFFF 77>, + <&anatop 0x90 0x3FFFFFFF 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; pinmuxes = <&iomuxcgpr 0x4 0x100000>; interrupts = <57 0>; @@ -1101,17 +1101,17 @@ #address-cells = <1>; #size-cells = <0>; #pinmux-cells = <2>; - reg = <0x4038c000 0x4000>; - clocks = <&ccm IMX_CCM_SAI3_CLK 0x7c 22>; + reg = <0x4038C000 0x4000>; + clocks = <&ccm IMX_CCM_SAI3_CLK 0x7C 22>; /* Source clock from Audio PLL */ clock-mux = <2>; pre-div = <0>; podf = <63>; - pll-clocks = <&anatop 0x70 0xc000 0>, - <&anatop 0x70 0x7f 32>, + pll-clocks = <&anatop 0x70 0xC000 0>, + <&anatop 0x70 0x7F 32>, <&anatop 0x70 0x180000 1>, - <&anatop 0x80 0x3fffffff 77>, - <&anatop 0x90 0x3fffffff 100>; + <&anatop 0x80 0x3FFFFFFF 77>, + <&anatop 0x90 0x3FFFFFFF 100>; pll-clock-names = "src", "lp", "pd", "num", "den"; pinmuxes = <&iomuxcgpr 0x4 0x200000>; interrupts = <58 0>, <59 0>; diff --git a/dts/arm/nxp/nxp_rt118x.dtsi b/dts/arm/nxp/nxp_rt118x.dtsi index 1aae388dcff8..6abc73028713 100644 --- a/dts/arm/nxp/nxp_rt118x.dtsi +++ b/dts/arm/nxp/nxp_rt118x.dtsi @@ -76,9 +76,9 @@ * or nxp_rt118x_cm7.dtsi. The base addresses on cm33 core differ * between non-secure (0x40000000) and secure modes (0x50000000). */ - iomuxc: pinctrl@2a10000 { + iomuxc: pinctrl@2A10000 { compatible = "nxp,imx-iomuxc"; - reg = <0x2a10000 0x4000>; + reg = <0x2A10000 0x4000>; pinctrl: pinctrl { status = "okay"; @@ -86,9 +86,9 @@ }; }; - iomuxc_aon: pinctrl@43c0000 { + iomuxc_aon: pinctrl@43C0000 { compatible = "nxp,mcux-rt-pinctrl"; - reg = <0x43c0000 0x4000>; + reg = <0x43C0000 0x4000>; status = "okay"; }; @@ -168,9 +168,9 @@ status = "disabled"; }; - lpuart6: serial@25a0000 { + lpuart6: serial@25A0000 { compatible = "nxp,lpuart"; - reg = <0x25a0000 0x4000>; + reg = <0x25A0000 0x4000>; interrupts = <71 0>; clocks = <&ccm IMX_CCM_LPUART0506_CLK 0x74 6>; dmas = <&edma4 6 23>, <&edma4 7 24>; @@ -188,9 +188,9 @@ status = "disabled"; }; - lpuart8: serial@2da0000 { + lpuart8: serial@2DA0000 { compatible = "nxp,lpuart"; - reg = <0x2da0000 0x4000>; + reg = <0x2DA0000 0x4000>; interrupts = <197 0>; clocks = <&ccm IMX_CCM_LPUART0708_CLK 0x80 14>; dmas = <&edma4 8 178>, <&edma4 9 179>; @@ -198,9 +198,9 @@ status = "disabled"; }; - lpuart9: serial@2d70000 { + lpuart9: serial@2D70000 { compatible = "nxp,lpuart"; - reg = <0x2d70000 0x4000>; + reg = <0x2D70000 0x4000>; interrupts = <156 0>; clocks = <&ccm IMX_CCM_LPUART0910_CLK 0x80 14>; dmas = <&edma4 10 172>, <&edma4 11 173>; @@ -208,9 +208,9 @@ status = "disabled"; }; - lpuart10: serial@2d80000 { + lpuart10: serial@2D80000 { compatible = "nxp,lpuart"; - reg = <0x2d80000 0x4000>; + reg = <0x2D80000 0x4000>; interrupts = <157 0>; clocks = <&ccm IMX_CCM_LPUART0910_CLK 0x80 14>; dmas = <&edma4 12 174>, <&edma4 13 175>; @@ -218,9 +218,9 @@ status = "disabled"; }; - lpuart11: serial@2d90000 { + lpuart11: serial@2D90000 { compatible = "nxp,lpuart"; - reg = <0x2d90000 0x4000>; + reg = <0x2D90000 0x4000>; interrupts = <158 0>; clocks = <&ccm IMX_CCM_LPUART1112_CLK 0x80 14>; dmas = <&edma4 14 176>, <&edma4 15 177>; @@ -1182,9 +1182,9 @@ #pwm-cells = <3>; }; - tpm3: pwm@24e0000 { + tpm3: pwm@24E0000 { compatible = "nxp,kinetis-tpm"; - reg = <0x24e0000 0x88>; + reg = <0x24E0000 0x88>; interrupts = <75 0>; clocks = <&ccm IMX_CCM_TPM3_CLK 0x3d 0>; prescaler = <16>; @@ -1192,9 +1192,9 @@ #pwm-cells = <3>; }; - tpm4: pwm@24f0000 { + tpm4: pwm@24F0000 { compatible = "nxp,kinetis-tpm"; - reg = <0x24f0000 0x88>; + reg = <0x24F0000 0x88>; interrupts = <76 0>; clocks = <&ccm IMX_CCM_TPM4_CLK 0x3e 0>; prescaler = <16>; @@ -1306,14 +1306,14 @@ <139 0>, <140 0>, <141 0>, <142 0>, <143 0>, <127 0>; channels-shared-irq-mask = <0x00000003 0x00000003 - 0x0000000c 0x0000000c 0x00000030 0x00000030 - 0x000000c0 0x000000c0 0x00000300 0x00000300 - 0x00000c00 0x00000c00 0x00003000 0x00003000 - 0x0000c000 0x0000c000 0x00030000 0x00030000 - 0x000c0000 0x000c0000 0x00300000 0x00300000 - 0x00c00000 0x00c00000 0x03000000 0x03000000 - 0x0c000000 0x0c000000 0x30000000 0x30000000 - 0xc0000000 0xc0000000>; + 0x0000000C 0x0000000C 0x00000030 0x00000030 + 0x000000C0 0x000000C0 0x00000300 0x00000300 + 0x00000C00 0x00000C00 0x00003000 0x00003000 + 0x0000C000 0x0000C000 0x00030000 0x00030000 + 0x000C0000 0x000C0000 0x00300000 0x00300000 + 0x00C00000 0x00C00000 0x03000000 0x03000000 + 0x0C000000 0x0C000000 0x30000000 0x30000000 + 0xC0000000 0xC0000000>; status = "disabled"; }; @@ -1340,7 +1340,7 @@ kpp: kpp@2a00000 { compatible = "nxp,mcux-kpp"; - reg = <0x2a00000 0x1000>; + reg = <0x2A00000 0x1000>; interrupts = <211 0>; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi b/dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi index b2d7a7b6a8a2..35df8b101e80 100644 --- a/dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi +++ b/dts/arm/nxp/nxp_rt118x_cm33_ns.dtsi @@ -11,9 +11,9 @@ / { soc { - itcm: itcm@ffe0000 { + itcm: itcm@FFE0000 { compatible = "zephyr,memory-region", "nxp,imx-itcm"; - reg = <0xffe0000 DT_SIZE_K(128)>; + reg = <0xFFE0000 DT_SIZE_K(128)>; zephyr,memory-region = "ITCM"; }; diff --git a/dts/arm/nxp/nxp_rt11xx.dtsi b/dts/arm/nxp/nxp_rt11xx.dtsi index d794f5d4039a..c962666e6c97 100644 --- a/dts/arm/nxp/nxp_rt11xx.dtsi +++ b/dts/arm/nxp/nxp_rt11xx.dtsi @@ -960,7 +960,7 @@ wdog1: wdog@40030000 { compatible = "nxp,imx-wdog"; - reg = <0x40030000 0xa>; + reg = <0x40030000 0xA>; status = "disabled"; interrupts = <112 0>; }; @@ -1062,7 +1062,7 @@ nxp,a-on; reg = <0x40070000 0x4000>, <0x40074000 0x4000>; - clocks = <&ccm IMX_CCM_EDMA_CLK 0x7c 0x000000c0>; + clocks = <&ccm IMX_CCM_EDMA_CLK 0x7C 0x000000C0>; status = "disabled"; interrupts = <0 0>, <1 0>, <2 0>, <3 0>, <4 0>, <5 0>, <6 0>, <7 0>, @@ -1081,7 +1081,7 @@ nxp,a-on; reg = <0x40c14000 0x4000>, <0x40c18000 0x4000>; - clocks = <&ccm IMX_CCM_EDMA_LPSR_CLK 0x7c 0x000000c0>; + clocks = <&ccm IMX_CCM_EDMA_LPSR_CLK 0x7C 0x000000C0>; status = "disabled"; interrupts = <0 0>, <1 0>, <2 0>, <3 0>, <4 0>, <5 0>, <6 0>, <7 0>, diff --git a/dts/arm/nxp/nxp_rt5xx_common.dtsi b/dts/arm/nxp/nxp_rt5xx_common.dtsi index 661056af7915..f9f88c52814c 100644 --- a/dts/arm/nxp/nxp_rt5xx_common.dtsi +++ b/dts/arm/nxp/nxp_rt5xx_common.dtsi @@ -59,9 +59,9 @@ * LPOSC, SRAM's, FlexSPI0 SRAM powered on * during deep sleep mode. */ - deep-sleep-config = <0xc800>, + deep-sleep-config = <0xC800>, <0x80000004>, - <0xffffffff>, + <0xFFFFFFFF>, <0>; }; }; diff --git a/dts/arm/nxp/nxp_rt7xx_common.dtsi b/dts/arm/nxp/nxp_rt7xx_common.dtsi index 3072fa27ebcc..70642103d368 100644 --- a/dts/arm/nxp/nxp_rt7xx_common.dtsi +++ b/dts/arm/nxp/nxp_rt7xx_common.dtsi @@ -88,10 +88,10 @@ zephyr,memory-region = "SRAM1"; }; - sram3: memory@205c0000 { + sram3: memory@205C0000 { compatible = "mmio-sram"; /* Only use 256K, align with SDK */ - reg = <0x205c0000 DT_SIZE_K(256)>; + reg = <0x205C0000 DT_SIZE_K(256)>; }; sram4: memory@20600000 { diff --git a/dts/arm/nxp/nxp_rw6xx_common.dtsi b/dts/arm/nxp/nxp_rw6xx_common.dtsi index 017eb93daf96..6015ac85275b 100644 --- a/dts/arm/nxp/nxp_rw6xx_common.dtsi +++ b/dts/arm/nxp/nxp_rw6xx_common.dtsi @@ -80,8 +80,8 @@ ranges = <0x0 0x41380000 DT_SIZE_K(510)>; }; - smu2: sram@443c0000 { - ranges = <0x0 0x443c0000 DT_SIZE_K(140)>; + smu2: sram@443C0000 { + ranges = <0x0 0x443C0000 DT_SIZE_K(140)>; }; peripheral_domain: peripheral-domain { diff --git a/dts/arm/nxp/nxp_s32k344_m7.dtsi b/dts/arm/nxp/nxp_s32k344_m7.dtsi index 467cee0233ef..1f7e6cdd6664 100644 --- a/dts/arm/nxp/nxp_s32k344_m7.dtsi +++ b/dts/arm/nxp/nxp_s32k344_m7.dtsi @@ -701,42 +701,42 @@ <64 0>, <65 0>, <66 0>; interrupt-names = "0_0", "0_1", "0_2", "0_3", "0_4", "0_5"; - internal-cnt = <0xc101ff>; + internal-cnt = <0xC101FF>; status = "disabled"; master_bus { emios0_bus_a: emios0_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07fffff>; + channel-mask = <0x07FFFFF>; status = "disabled"; }; emios0_bus_b: emios0_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000fe>; + channel-mask = <0x00000FE>; status = "disabled"; }; emios0_bus_c: emios0_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000fe00>; + channel-mask = <0x0000FE00>; status = "disabled"; }; emios0_bus_d: emios0_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00fe0000>; + channel-mask = <0x00FE0000>; status = "disabled"; }; emios0_bus_f: emios0_bus_f { channel = <22>; bus-type = "BUS_F"; - channel-mask = <0x0bfffff>; + channel-mask = <0x0BFFFFF>; status = "disabled"; }; }; @@ -756,41 +756,41 @@ <72 0>, <73 0>, <74 0>; interrupt-names = "1_0", "1_1", "1_2", "1_3", "1_4", "1_5"; - internal-cnt = <0xc10101>; + internal-cnt = <0xC10101>; status = "disabled"; master_bus { emios1_bus_a: emios1_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07fffff>; + channel-mask = <0x07FFFFF>; status = "disabled"; }; emios1_bus_b: emios1_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000fe>; + channel-mask = <0x00000FE>; status = "disabled"; }; emios1_bus_c: emios1_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000fe00>; + channel-mask = <0x0000FE00>; status = "disabled"; }; emios1_bus_d: emios1_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00fe0000>; + channel-mask = <0x00FE0000>; status = "disabled"; }; emios1_bus_f: emios1_bus_f { channel = <22>; - channel-mask = <0x0bfffff>; + channel-mask = <0x0BFFFFF>; bus-type = "BUS_F"; status = "disabled"; }; @@ -811,42 +811,42 @@ <80 0>, <81 0>, <82 0>; interrupt-names = "2_0", "2_1", "2_2", "2_3", "2_4", "2_5"; - internal-cnt = <0xc10101>; + internal-cnt = <0xC10101>; status = "disabled"; master_bus { emios2_bus_a: emios2_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07fffff>; + channel-mask = <0x07FFFFF>; status = "disabled"; }; emios2_bus_b: emios2_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000fe>; + channel-mask = <0x00000FE>; status = "disabled"; }; emios2_bus_c: emios2_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000fe00>; + channel-mask = <0x0000FE00>; status = "disabled"; }; emios2_bus_d: emios2_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00fe0000>; + channel-mask = <0x00FE0000>; status = "disabled"; }; emios2_bus_f: emios2_bus_f { channel = <22>; bus-type = "BUS_F"; - channel-mask = <0x0bfffff>; + channel-mask = <0x0BFFFFF>; status = "disabled"; }; }; diff --git a/dts/arm/nxp/nxp_s32k566.dtsi b/dts/arm/nxp/nxp_s32k566.dtsi index 23f990784006..201148656739 100644 --- a/dts/arm/nxp/nxp_s32k566.dtsi +++ b/dts/arm/nxp/nxp_s32k566.dtsi @@ -807,7 +807,7 @@ clocks = <&clock NXP_S32_EMIOS0_IPG_CLK>; interrupt-names = "0_5", "0_4", "0_3", "0_2", "0_1", "0_0"; - internal-cnt = <0xffffff>; + internal-cnt = <0xFFFFFF>; global-timebase-provider = <&emios0>; status = "disabled"; @@ -815,35 +815,35 @@ emios0_bus_a: emios0_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07fffff>; + channel-mask = <0x07FFFFF>; status = "disabled"; }; emios0_bus_b: emios0_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000fe>; + channel-mask = <0x00000FE>; status = "disabled"; }; emios0_bus_c: emios0_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000fe00>; + channel-mask = <0x0000FE00>; status = "disabled"; }; emios0_bus_d: emios0_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00fe0000>; + channel-mask = <0x00FE0000>; status = "disabled"; }; emios0_bus_f: emios0_bus_f { channel = <22>; bus-type = "BUS_F"; - channel-mask = <0x0bfffff>; + channel-mask = <0x0BFFFFF>; status = "disabled"; }; }; @@ -861,7 +861,7 @@ clocks = <&clock NXP_S32_EMIOS1_IPG_CLK>; interrupt-names = "0_5", "0_4", "0_3", "0_2", "0_1", "0_0"; - internal-cnt = <0xffffff>; + internal-cnt = <0xFFFFFF>; global-timebase-provider = <&emios1>; status = "disabled"; @@ -869,34 +869,34 @@ emios1_bus_a: emios1_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07fffff>; + channel-mask = <0x07FFFFF>; status = "disabled"; }; emios1_bus_b: emios1_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000fe>; + channel-mask = <0x00000FE>; status = "disabled"; }; emios1_bus_c: emios1_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000fe00>; + channel-mask = <0x0000FE00>; status = "disabled"; }; emios1_bus_d: emios1_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00fe0000>; + channel-mask = <0x00FE0000>; status = "disabled"; }; emios1_bus_f: emios1_bus_f { channel = <22>; - channel-mask = <0x0bfffff>; + channel-mask = <0x0BFFFFF>; bus-type = "BUS_F"; status = "disabled"; }; @@ -915,7 +915,7 @@ clocks = <&clock NXP_S32_EMIOS2_IPG_CLK>; interrupt-names = "0_5", "0_4", "0_3", "0_2", "0_1", "0_0"; - internal-cnt = <0xffffff>; + internal-cnt = <0xFFFFFF>; global-timebase-provider = <&emios2>; status = "disabled"; @@ -923,35 +923,35 @@ emios2_bus_a: emios2_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0x07fffff>; + channel-mask = <0x07FFFFF>; status = "disabled"; }; emios2_bus_b: emios2_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x00000fe>; + channel-mask = <0x00000FE>; status = "disabled"; }; emios2_bus_c: emios2_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000fe00>; + channel-mask = <0x0000FE00>; status = "disabled"; }; emios2_bus_d: emios2_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00fe0000>; + channel-mask = <0x00FE0000>; status = "disabled"; }; emios2_bus_f: emios2_bus_f { channel = <22>; bus-type = "BUS_F"; - channel-mask = <0x0bfffff>; + channel-mask = <0x0BFFFFF>; status = "disabled"; }; }; diff --git a/dts/arm/nxp/nxp_s32z27x_r52.dtsi b/dts/arm/nxp/nxp_s32z27x_r52.dtsi index 1956dcc3cd76..8a4634610418 100644 --- a/dts/arm/nxp/nxp_s32z27x_r52.dtsi +++ b/dts/arm/nxp/nxp_s32z27x_r52.dtsi @@ -1130,7 +1130,7 @@ sar_adc0: adc@402c0000 { compatible = "nxp,s32-adc-sar"; - reg = <0x402c0000 0x1000>; + reg = <0x402C0000 0x1000>; interrupts = , , ; @@ -1306,7 +1306,7 @@ compatible = "nxp,s32-emios"; reg = <0x420b0000 0x4000>; clocks = <&clock NXP_S32_P4_REG_INTF_CLK>; - internal-cnt = <0xffffffff>; + internal-cnt = <0xFFFFFFFF>; interrupts = , , , @@ -1349,35 +1349,35 @@ emios0_bus_a: emios0_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0xff7fffff>; + channel-mask = <0xFF7FFFFF>; status = "disabled"; }; emios0_bus_b: emios0_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x000000fe>; + channel-mask = <0x000000FE>; status = "disabled"; }; emios0_bus_c: emios0_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000fe00>; + channel-mask = <0x0000FE00>; status = "disabled"; }; emios0_bus_d: emios0_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00fe0000>; + channel-mask = <0x00FE0000>; status = "disabled"; }; emios0_bus_e: emios0_bus_e { channel = <24>; bus-type = "BUS_E"; - channel-mask = <0xfe000000>; + channel-mask = <0xFE000000>; status = "disabled"; }; }; @@ -1393,7 +1393,7 @@ compatible = "nxp,s32-emios"; reg = <0x400b0000 0x4000>; clocks = <&clock NXP_S32_P0_REG_INTF_CLK>; - internal-cnt = <0xffffffff>; + internal-cnt = <0xFFFFFFFF>; interrupts = , , , @@ -1435,34 +1435,34 @@ emios1_bus_a: emios1_bus_a { channel = <23>; bus-type = "BUS_A"; - channel-mask = <0xff7fffff>; + channel-mask = <0xFF7FFFFF>; status = "disabled"; }; emios1_bus_b: emios1_bus_b { channel = <0>; bus-type = "BUS_B"; - channel-mask = <0x000000fe>; + channel-mask = <0x000000FE>; status = "disabled"; }; emios1_bus_c: emios1_bus_c { channel = <8>; bus-type = "BUS_C"; - channel-mask = <0x0000fe00>; + channel-mask = <0x0000FE00>; status = "disabled"; }; emios1_bus_d: emios1_bus_d { channel = <16>; bus-type = "BUS_D"; - channel-mask = <0x00fe0000>; + channel-mask = <0x00FE0000>; status = "disabled"; }; emios1_bus_e: emios1_bus_e { channel = <24>; - channel-mask = <0xfe000000>; + channel-mask = <0xFE000000>; bus-type = "BUS_E"; status = "disabled"; }; diff --git a/dts/arm/realtek/amebad/amebad.dtsi b/dts/arm/realtek/amebad/amebad.dtsi index 45b6b010562d..0ec2d9324c03 100644 --- a/dts/arm/realtek/amebad/amebad.dtsi +++ b/dts/arm/realtek/amebad/amebad.dtsi @@ -64,7 +64,7 @@ #size-cells = <1>; status = "disabled"; - flash0: flash@e000020 { + flash0: flash@E000020 { compatible = "soc-nv-flash"; erase-block-size = ; write-block-size = <4>; diff --git a/dts/arm/realtek/ec/rts5912.dtsi b/dts/arm/realtek/ec/rts5912.dtsi index cabf52168165..bd1c32bf75e2 100644 --- a/dts/arm/realtek/ec/rts5912.dtsi +++ b/dts/arm/realtek/ec/rts5912.dtsi @@ -35,8 +35,8 @@ }; }; - flash0: flash@2000b400 { - reg = <0x2000b400 0x40000>; + flash0: flash@2000B400 { + reg = <0x2000B400 0x40000>; }; sram0: memory@20050000 { @@ -94,7 +94,7 @@ interrupts = <196 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR0_CLKPWR>; clock-names = "tmr32"; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -107,7 +107,7 @@ interrupts = <197 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR1_CLKPWR>; clock-names = "tmr32"; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -120,7 +120,7 @@ interrupts = <198 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR2_CLKPWR>; clock-names = "tmr32"; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -133,7 +133,7 @@ interrupts = <199 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR3_CLKPWR>; clock-names = "tmr32"; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -146,7 +146,7 @@ interrupts = <200 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR4_CLKPWR>; clock-names = "tmr32"; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -159,7 +159,7 @@ interrupts = <201 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_TMR5_CLKPWR>; clock-names = "tmr32"; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; clock-frequency = <25000000>; prescaler = <0>; status = "disabled"; @@ -173,20 +173,20 @@ reg = <0x400b1000 0x200 /* espi target */ 0x400a0400 0x01c /* port80 */ 0x400a0200 0x1c /* ACPI */ - 0x400a021c 0x1c /* PROMT0 */ - 0x400a0238 0x1c /* PROMT1 */ - 0x400a0254 0x1c /* PROMT2 */ - 0x400a0270 0x1c /* PROMT3 */ + 0x400A021C 0x1C /* PROMT0 */ + 0x400A0238 0x1C /* PROMT1 */ + 0x400A0254 0x1C /* PROMT2 */ + 0x400A0270 0x1C /* PROMT3 */ 0x40082000 0x14 /* EMI0 */ 0x40082020 0x14 /* EMI1 */ 0x40082040 0x14 /* EMI2 */ 0x40082060 0x14 /* EMI3 */ 0x40082080 0x14 /* EMI4 */ - 0x400820a0 0x14 /* EMI5 */ - 0x400820c0 0x14 /* EMI6 */ - 0x400820e0 0x14 /* EMI7 */ + 0x400820A0 0x14 /* EMI5 */ + 0x400820C0 0x14 /* EMI6 */ + 0x400820E0 0x14 /* EMI7 */ 0x400a0100 0x1c /* KBC */ - 0x400b1600 0xd0>; /* MBX */ + 0x400B1600 0xd0>; /* MBX */ reg-names = "espi_target", "port80", "acpi", "promt0", "promt1", "promt2", "promt3", "emi0", "emi1", "emi2", "emi3", "emi4", "emi5", @@ -250,7 +250,7 @@ interrupts = <202 0>; clocks = <&sccon RTS5912_SCCON_PERIPH_GRP1 PERIPH_GRP1_SLWTMR0_CLKPWR>; clock-names = "slwtmr"; - max-value = <0xffffffff>; + max-value = <0xFFFFFFFF>; clock-frequency = <1000000>; prescaler = <0>; status = "disabled"; @@ -277,7 +277,7 @@ #size-cells = <0>; compatible = "realtek,rts5912-spi"; clocks = <&sccon RTS5912_SCCON_SYS 0>; - reg = <0x40010400 0x3c>; + reg = <0x40010400 0x3C>; status = "disabled"; }; diff --git a/dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi b/dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi index e9ee71eac017..a22606f22921 100644 --- a/dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi +++ b/dts/arm/renesas/ra/ra4/r7fa4l1bx.dtsi @@ -153,9 +153,9 @@ status = "disabled"; }; - pinctrl: pin-controller@4001f800 { + pinctrl: pin-controller@4001F800 { compatible = "renesas,ra-pinctrl-pfs"; - reg = <0x4001f800 0x3c0>; + reg = <0x4001F800 0x3c0>; status = "okay"; }; diff --git a/dts/arm/renesas/ra/ra8/ra8x1.dtsi b/dts/arm/renesas/ra/ra8/ra8x1.dtsi index 5a2c0b006268..9774b1c95852 100644 --- a/dts/arm/renesas/ra/ra8/ra8x1.dtsi +++ b/dts/arm/renesas/ra/ra8/ra8x1.dtsi @@ -230,7 +230,7 @@ iic0: iic0@4025e000 { compatible = "renesas,ra-iic"; channel = <0>; - reg = <0x4025e000 0x100>; + reg = <0x4025E000 0x100>; status = "disabled"; }; @@ -239,7 +239,7 @@ channel = <1>; interrupts = <91 1>, <92 1>, <93 1>, <94 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x4025e100 0x100>; + reg = <0x4025E100 0x100>; status = "disabled"; }; diff --git a/dts/arm/renesas/ra/ra8/ra8x2.dtsi b/dts/arm/renesas/ra/ra8/ra8x2.dtsi index afc8c09da1ab..936bf4d669b1 100644 --- a/dts/arm/renesas/ra/ra8/ra8x2.dtsi +++ b/dts/arm/renesas/ra/ra8/ra8x2.dtsi @@ -247,21 +247,21 @@ iic0: iic0@4025e000 { compatible = "renesas,ra-iic"; channel = <0>; - reg = <0x4025e000 0x100>; + reg = <0x4025E000 0x100>; status = "disabled"; }; iic1: iic1@4025e100 { compatible = "renesas,ra-iic"; channel = <1>; - reg = <0x4025e100 0x100>; + reg = <0x4025E100 0x100>; status = "disabled"; }; iic2: iic2@4025e200 { compatible = "renesas,ra-iic"; channel = <2>; - reg = <0x4025e200 0x100>; + reg = <0x4025E200 0x100>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rza/r7s9210.dtsi b/dts/arm/renesas/rz/rza/r7s9210.dtsi index 0eb81524057c..5e6f1bc9b6ae 100644 --- a/dts/arm/renesas/rz/rza/r7s9210.dtsi +++ b/dts/arm/renesas/rz/rza/r7s9210.dtsi @@ -327,7 +327,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <3300>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; clocks = <&cpg RZA2M_CLOCK(RZA2M_MODULE_ADC, RZA2M_CLK_P1C)>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzg/r9a07g044.dtsi b/dts/arm/renesas/rz/rzg/r9a07g044.dtsi index df98751af445..e1567177e7c4 100644 --- a/dts/arm/renesas/rz/rzg/r9a07g044.dtsi +++ b/dts/arm/renesas/rz/rzg/r9a07g044.dtsi @@ -498,7 +498,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzg/r9a08g045.dtsi b/dts/arm/renesas/rz/rzg/r9a08g045.dtsi index 051120ea0d91..050644aaa40a 100644 --- a/dts/arm/renesas/rz/rzg/r9a08g045.dtsi +++ b/dts/arm/renesas/rz/rzg/r9a08g045.dtsi @@ -215,7 +215,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0x01ff>; + channel-available-mask = <0x01FF>; status = "disabled"; }; @@ -391,12 +391,12 @@ status = "disabled"; }; - gpio18: gpio@a00 { + gpio18: gpio@A00 { compatible = "renesas,rz-gpio"; gpio-controller; #gpio-cells = <2>; ngpios = <6>; - reg = <0xa00>; + reg = <0xA00>; status = "disabled"; }; }; diff --git a/dts/arm/renesas/rz/rzn/r9a07g084.dtsi b/dts/arm/renesas/rz/rzn/r9a07g084.dtsi index f019c614ccaf..e7a48f2e9743 100644 --- a/dts/arm/renesas/rz/rzn/r9a07g084.dtsi +++ b/dts/arm/renesas/rz/rzn/r9a07g084.dtsi @@ -87,19 +87,19 @@ loader_param: partition@0 { label = "loader-param"; - reg = <0x00000000 0x4c>; + reg = <0x00000000 0x4C>; read-only; }; - loader_program: partition@4c { + loader_program: partition@4C { label = "loader-program"; - reg = <0x0000004c (DT_SIZE_K(56) - 0x4C)>; + reg = <0x0000004C (DT_SIZE_K(56) - 0x4C)>; read-only; }; - slot0_partition: partition@e000 { + slot0_partition: partition@E000 { label = "image-0"; - reg = <0x0000e000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; + reg = <0x0000E000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; read-only; }; }; @@ -218,7 +218,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xf>; + channel-available-mask = <0xF>; status = "disabled"; }; @@ -230,7 +230,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzt/r9a07g074.dtsi b/dts/arm/renesas/rz/rzt/r9a07g074.dtsi index 48b8f93c056e..518da4dd89ba 100644 --- a/dts/arm/renesas/rz/rzt/r9a07g074.dtsi +++ b/dts/arm/renesas/rz/rzt/r9a07g074.dtsi @@ -78,19 +78,19 @@ loader_param: partition@0 { label = "loader-param"; - reg = <0x00000000 0x4c>; + reg = <0x00000000 0x4C>; read-only; }; - loader_program: partition@4c { + loader_program: partition@4C { label = "loader-program"; - reg = <0x0000004c (DT_SIZE_K(56) - 0x4C)>; + reg = <0x0000004C (DT_SIZE_K(56) - 0x4C)>; read-only; }; - slot0_partition: partition@e000 { + slot0_partition: partition@E000 { label = "image-0"; - reg = <0x0000e000 (DT_SIZE_M(16) - DT_SIZE_K(56))>; + reg = <0x0000E000 (DT_SIZE_M(16) - DT_SIZE_K(56))>; read-only; }; }; @@ -487,7 +487,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xf>; + channel-available-mask = <0xF>; status = "disabled"; }; @@ -499,7 +499,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xf>; + channel-available-mask = <0xF>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzt/r9a07g075.dtsi b/dts/arm/renesas/rz/rzt/r9a07g075.dtsi index 247b36996ca8..c9962c5a51eb 100644 --- a/dts/arm/renesas/rz/rzt/r9a07g075.dtsi +++ b/dts/arm/renesas/rz/rzt/r9a07g075.dtsi @@ -95,19 +95,19 @@ loader_param: partition@0 { label = "loader-param"; - reg = <0x00000000 0x4c>; + reg = <0x00000000 0x4C>; read-only; }; - loader_program: partition@4c { + loader_program: partition@4C { label = "loader-program"; - reg = <0x0000004c (DT_SIZE_K(56) - 0x4C)>; + reg = <0x0000004C (DT_SIZE_K(56) - 0x4C)>; read-only; }; - slot0_partition: partition@e000 { + slot0_partition: partition@E000 { label = "image-0"; - reg = <0x0000e000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; + reg = <0x0000E000 (DT_SIZE_M(64) - DT_SIZE_K(56))>; read-only; }; }; @@ -231,7 +231,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; @@ -243,7 +243,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xffff>; + channel-available-mask = <0xFFFF>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzv/r9a07g054.dtsi b/dts/arm/renesas/rz/rzv/r9a07g054.dtsi index 83c03134ff67..b0a357baca56 100644 --- a/dts/arm/renesas/rz/rzv/r9a07g054.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a07g054.dtsi @@ -55,7 +55,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzv/r9a09g056.dtsi b/dts/arm/renesas/rz/rzv/r9a09g056.dtsi index a9fce7823bd1..8af64a2690b3 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g056.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g056.dtsi @@ -166,7 +166,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; @@ -178,7 +178,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; @@ -190,7 +190,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi b/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi index 4ff49a0ba424..5dad51d7aff4 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi @@ -725,7 +725,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; diff --git a/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi b/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi index be77fa1187ed..5e61653c3d59 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi @@ -48,7 +48,7 @@ , , ; - reg = <0x12c10200 0x1c>; + reg = <0x12c10200 0x1C>; label = "arch_timer"; }; @@ -205,7 +205,7 @@ interrupt-names = "scanend"; #io-channel-cells = <1>; vref-mv = <1800>; - channel-available-mask = <0xff>; + channel-available-mask = <0xFF>; status = "disabled"; }; diff --git a/dts/arm/renesas/smartbond/da1469x.dtsi b/dts/arm/renesas/smartbond/da1469x.dtsi index fd27e839b58d..df52ffab55ed 100644 --- a/dts/arm/renesas/smartbond/da1469x.dtsi +++ b/dts/arm/renesas/smartbond/da1469x.dtsi @@ -321,7 +321,7 @@ adc: adc@50030900 { compatible = "renesas,smartbond-adc"; - reg = <0x50030900 0x1c>; + reg = <0x50030900 0x1C>; interrupts = <27 0>; status = "disabled"; #io-channel-cells = <1>; @@ -329,7 +329,7 @@ sdadc: sdadc@50020800 { compatible = "renesas,smartbond-sdadc"; - reg = <0x50020800 0x1c>; + reg = <0x50020800 0x1C>; interrupts = <28 0>; clock-freq = <2>; status = "disabled"; @@ -345,7 +345,7 @@ trng: trng@50040c00 { compatible = "renesas,smartbond-trng"; - reg = <0x50040c00 0x0c>; + reg = <0x50040c00 0x0C>; interrupts = <24 0>; status = "okay"; }; @@ -372,7 +372,7 @@ lcdc: lcdc@30030000 { compatible = "renesas,smartbond-display"; - reg = <0x30030000 0x18c>; + reg = <0x30030000 0x18C>; interrupts = <32 0>; status = "disabled"; }; @@ -399,7 +399,7 @@ usbd: usb@50040000 { compatible = "renesas,smartbond-usbd"; - reg = <0x50040000 0x1b0>; + reg = <0x50040000 0x1B0>; dmas = <&dma 0 DMA_SMARTBOND_TRIG_MUX_USB>, <&dma 1 DMA_SMARTBOND_TRIG_MUX_USB>; dma-names = "rx", "tx"; diff --git a/dts/arm/silabs/gg11/efm32gg11.dtsi b/dts/arm/silabs/gg11/efm32gg11.dtsi index f88d98a0c1f4..529b3e90587d 100644 --- a/dts/arm/silabs/gg11/efm32gg11.dtsi +++ b/dts/arm/silabs/gg11/efm32gg11.dtsi @@ -273,7 +273,7 @@ wdog0: wdog@40052000 { compatible = "silabs,gecko-wdog"; - reg = <0x40052000 0x2c>; + reg = <0x40052000 0x2C>; peripheral-id = <0>; interrupts = <1 0>; status = "disabled"; @@ -281,7 +281,7 @@ wdog1: wdog@40052400 { compatible = "silabs,gecko-wdog"; - reg = <0x40052400 0x2c>; + reg = <0x40052400 0x2C>; peripheral-id = <1>; interrupts = <64 0>; status = "disabled"; diff --git a/dts/arm/silabs/gg11/efm32gg11b820f2048gl192.dtsi b/dts/arm/silabs/gg11/efm32gg11b820f2048gl192.dtsi index b682d2f5b383..4f17b7fbb21d 100644 --- a/dts/arm/silabs/gg11/efm32gg11b820f2048gl192.dtsi +++ b/dts/arm/silabs/gg11/efm32gg11b820f2048gl192.dtsi @@ -15,7 +15,7 @@ eth0: eth@40024000 { /* ETH0 */ compatible = "silabs,gecko-ethernet"; - reg = <0x40024000 0xc14>; + reg = <0x40024000 0xC14>; interrupts = <59 0>; status = "disabled"; }; diff --git a/dts/arm/silabs/gg12/efm32gg12.dtsi b/dts/arm/silabs/gg12/efm32gg12.dtsi index 5ba11750cf86..5938baab5c24 100644 --- a/dts/arm/silabs/gg12/efm32gg12.dtsi +++ b/dts/arm/silabs/gg12/efm32gg12.dtsi @@ -226,7 +226,7 @@ wdog0: wdog@40052000 { compatible = "silabs,gecko-wdog"; - reg = <0x40052000 0x2c>; + reg = <0x40052000 0x2C>; peripheral-id = <0>; interrupts = <1 0>; status = "disabled"; @@ -234,7 +234,7 @@ wdog1: wdog@40052400 { compatible = "silabs,gecko-wdog"; - reg = <0x40052400 0x2c>; + reg = <0x40052400 0x2C>; peripheral-id = <1>; interrupts = <55 0>; status = "disabled"; diff --git a/dts/arm/silabs/siwg917.dtsi b/dts/arm/silabs/siwg917.dtsi index 4c5f0bfaca68..b8c365cb5db2 100644 --- a/dts/arm/silabs/siwg917.dtsi +++ b/dts/arm/silabs/siwg917.dtsi @@ -245,7 +245,7 @@ egpio1: egpio@2404c000 { compatible = "silabs,siwx91x-gpio"; - reg = <0x2404c000 0x1260>; + reg = <0x2404C000 0x1260>; interrupts = <18 0>; interrupt-names = "ULP"; silabs,ulp; @@ -318,7 +318,7 @@ compatible = "silabs,siwx91x-dma"; #address-cells = <1>; #size-cells = <0>; - reg = <0x24078000 0x82c>; + reg = <0x24078000 0x82C>; interrupts = <10 0>; interrupt-names = "ulpdma"; clocks = <&clock0 SIWX91X_CLK_ULP_DMA>; @@ -334,7 +334,7 @@ compatible = "silabs,siwx91x-dma"; #address-cells = <1>; #size-cells = <0>; - reg = <0x44030000 0x82c>; + reg = <0x44030000 0x82C>; interrupts = <33 0>; interrupt-names = "dma0"; clocks = <&clock0 SIWX91X_CLK_DMA0>; @@ -365,7 +365,7 @@ compatible = "silabs,siwx91x-pwm"; #address-cells = <1>; #size-cells = <0>; - reg = <0x47070000 0x14c>; + reg = <0x47070000 0x14C>; interrupts = <48 0>; interrupt-names = "pwm"; clocks = <&clock0 SIWX91X_CLK_PWM>; @@ -389,7 +389,7 @@ compatible = "silabs,siwx91x-wdt"; #address-cells = <1>; #size-cells = <0>; - reg = <0x24048300 0x1c>; + reg = <0x24048300 0x1C>; interrupts = <20 0>; interrupt-names = "watchdog"; clocks = <&clock0 SIWX91X_CLK_WATCHDOG>; @@ -410,7 +410,7 @@ compatible = "silabs,gspi"; #address-cells = <1>; #size-cells = <0>; - reg = <0x45030000 0xbc>; + reg = <0x45030000 0xBC>; interrupts = <46 0>; interrupt-names = "gspi"; clocks = <&clock0 SIWX91X_CLK_GSPI>; diff --git a/dts/arm/silabs/xg12/xg12.dtsi b/dts/arm/silabs/xg12/xg12.dtsi index 7a0ded78a2dc..f0f6b2401353 100644 --- a/dts/arm/silabs/xg12/xg12.dtsi +++ b/dts/arm/silabs/xg12/xg12.dtsi @@ -213,7 +213,7 @@ wdog0: wdog@40052000 { compatible = "silabs,gecko-wdog"; - reg = <0x40052000 0x2c>; + reg = <0x40052000 0x2C>; peripheral-id = <0>; interrupts = <2 0>; status = "disabled"; @@ -221,7 +221,7 @@ wdog1: wdog@40052400 { compatible = "silabs,gecko-wdog"; - reg = <0x40052400 0x2c>; + reg = <0x40052400 0x2C>; peripheral-id = <1>; interrupts = <3 0>; status = "disabled"; diff --git a/dts/arm/silabs/xg13/efr32xg13.dtsi b/dts/arm/silabs/xg13/efr32xg13.dtsi index 5ea50101d1b5..e3dd0e6fd1ac 100644 --- a/dts/arm/silabs/xg13/efr32xg13.dtsi +++ b/dts/arm/silabs/xg13/efr32xg13.dtsi @@ -165,7 +165,7 @@ wdog0: wdog@40052000 { compatible = "silabs,gecko-wdog"; - reg = <0x40052000 0x2c>; + reg = <0x40052000 0x2C>; peripheral-id = <0>; interrupts = <2 0>; status = "disabled"; @@ -173,7 +173,7 @@ wdog1: wdog@40052400 { compatible = "silabs,gecko-wdog"; - reg = <0x40052400 0x2c>; + reg = <0x40052400 0x2C>; peripheral-id = <1>; interrupts = <3 0>; status = "disabled"; diff --git a/dts/arm/st/f1/stm32f103Xc.dtsi b/dts/arm/st/f1/stm32f103Xc.dtsi index 63cecfafef17..cec1209fc6c7 100644 --- a/dts/arm/st/f1/stm32f103Xc.dtsi +++ b/dts/arm/st/f1/stm32f103Xc.dtsi @@ -108,7 +108,7 @@ compatible = "st,stm32-spi"; #address-cells = <1>; #size-cells = <0>; - reg = <0x40003c00 0x400>; + reg = <0X40003c00 0x400>; clocks = <&rcc STM32_CLOCK(APB1, 15)>; interrupts = <51 5>; st,spi-data-width = "limited-8-16-bit"; diff --git a/dts/arm/st/f3/stm32f302.dtsi b/dts/arm/st/f3/stm32f302.dtsi index e8adf9bf2f89..2fa6ee84d76d 100644 --- a/dts/arm/st/f3/stm32f302.dtsi +++ b/dts/arm/st/f3/stm32f302.dtsi @@ -62,7 +62,7 @@ compatible = "st,stm32-spi-fifo", "st,stm32-spi"; #address-cells = <1>; #size-cells = <0>; - reg = <0x40003c00 0x400>; + reg = <0X40003c00 0x400>; clocks = <&rcc STM32_CLOCK(APB1, 15)>; interrupts = <51 5>; st,spi-data-width = "full-4-to-16-bit"; diff --git a/dts/arm/ti/cc32xx.dtsi b/dts/arm/ti/cc32xx.dtsi index bc7c3c460ccb..c2e7cfc598e4 100644 --- a/dts/arm/ti/cc32xx.dtsi +++ b/dts/arm/ti/cc32xx.dtsi @@ -118,7 +118,7 @@ adc0: adc@4402e800 { compatible = "ti,cc32xx-adc"; - reg = <0x4402e800 0x100>; + reg = <0x4402E800 0x100>; interrupts = , , , ; status = "disabled"; #io-channel-cells = <1>; diff --git a/dts/arm/ti/mspm0/g/mspm0g1518.dtsi b/dts/arm/ti/mspm0/g/mspm0g1518.dtsi index 47dbd32a339e..19512820ab28 100644 --- a/dts/arm/ti/mspm0/g/mspm0g1518.dtsi +++ b/dts/arm/ti/mspm0/g/mspm0g1518.dtsi @@ -26,7 +26,7 @@ }; flash2: serial-flash@41e00000 { - reg = <0x41e00000 DT_SIZE_K(16)>; + reg = <0x41E00000 DT_SIZE_K(16)>; }; }; }; diff --git a/dts/arm/ti/mspm0/g/mspm0g1519.dtsi b/dts/arm/ti/mspm0/g/mspm0g1519.dtsi index 7da6a6f4b3dd..2d85d1c24b58 100644 --- a/dts/arm/ti/mspm0/g/mspm0g1519.dtsi +++ b/dts/arm/ti/mspm0/g/mspm0g1519.dtsi @@ -26,7 +26,7 @@ }; flash2: serial-flash@41e00000 { - reg = <0x41e00000 DT_SIZE_K(16)>; + reg = <0x41E00000 DT_SIZE_K(16)>; }; }; }; diff --git a/dts/arm/ti/mspm0/g/mspm0g3518.dtsi b/dts/arm/ti/mspm0/g/mspm0g3518.dtsi index 47dbd32a339e..19512820ab28 100644 --- a/dts/arm/ti/mspm0/g/mspm0g3518.dtsi +++ b/dts/arm/ti/mspm0/g/mspm0g3518.dtsi @@ -26,7 +26,7 @@ }; flash2: serial-flash@41e00000 { - reg = <0x41e00000 DT_SIZE_K(16)>; + reg = <0x41E00000 DT_SIZE_K(16)>; }; }; }; diff --git a/dts/arm/ti/mspm0/g/mspm0g3519.dtsi b/dts/arm/ti/mspm0/g/mspm0g3519.dtsi index 7da6a6f4b3dd..2d85d1c24b58 100644 --- a/dts/arm/ti/mspm0/g/mspm0g3519.dtsi +++ b/dts/arm/ti/mspm0/g/mspm0g3519.dtsi @@ -26,7 +26,7 @@ }; flash2: serial-flash@41e00000 { - reg = <0x41e00000 DT_SIZE_K(16)>; + reg = <0x41E00000 DT_SIZE_K(16)>; }; }; }; diff --git a/dts/arm/xilinx/zynq7000.dtsi b/dts/arm/xilinx/zynq7000.dtsi index 40ddf50f50dd..1e62ac2e1660 100644 --- a/dts/arm/xilinx/zynq7000.dtsi +++ b/dts/arm/xilinx/zynq7000.dtsi @@ -20,7 +20,7 @@ ocm_high: memory@fffc0000 { compatible = "zephyr,memory-region", "xlnx,zynq-ocm"; - reg = <0xfffc0000 DT_SIZE_K(256)>; + reg = <0xFFFC0000 DT_SIZE_K(256)>; zephyr,memory-region = "OCM_HIGH"; }; @@ -36,7 +36,7 @@ IRQ_DEFAULT_PRIORITY>, ; - reg = <0xf8f00200 0x1c>; + reg = <0xf8f00200 0x1C>; }; gic: interrupt-controller@f8f01000 { diff --git a/dts/arm64/intel/intel_socfpga_agilex5.dtsi b/dts/arm64/intel/intel_socfpga_agilex5.dtsi index 4df5faf2aa35..ade3e5caba59 100644 --- a/dts/arm64/intel/intel_socfpga_agilex5.dtsi +++ b/dts/arm64/intel/intel_socfpga_agilex5.dtsi @@ -114,9 +114,9 @@ status = "disabled"; }; - reset: reset-controller@10d11000 { + reset: reset-controller@10D11000 { compatible = "intel,socfpga-reset"; - reg = <0x10d11000 0x100>; + reg = <0x10D11000 0x100>; active-low; #reset-cells = <1>; status = "okay"; @@ -125,7 +125,7 @@ sdmmc: sdmmc@10808000 { compatible = "cdns,sdhc"; reg = <0x10808000 0x1000>, - <0x10b92000 0x1000>; + <0x10B92000 0x1000>; reg-names = "reg_base", "combo_phy"; clock-frequency = <200000000>; power-delay-ms = <1000>; @@ -135,7 +135,7 @@ status = "disabled"; }; - timer0: timer@10c03000 { + timer0: timer@10C03000 { compatible = "snps,dw-timers"; interrupt-parent = <&gic>; interrupts = ; interrupts = ; interrupts = ; - reg = <0x10d00000 0x100>; + reg = <0x10D00000 0x100>; clocks = <&clock INTEL_SOCFPGA_CLOCK_TIMER>; resets = <&reset RSTMGR_L4SYSTIMER0_RSTLINE>; status = "disabled"; }; - timer3: timer@10d00100 { + timer3: timer@10D00100 { compatible = "snps,dw-timers"; interrupt-parent = <&gic>; interrupts = ; - reg = <0x10d00100 0x100>; + reg = <0x10D00100 0x100>; clocks = <&clock INTEL_SOCFPGA_CLOCK_TIMER>; resets = <&reset RSTMGR_L4SYSTIMER1_RSTLINE>; }; @@ -226,9 +226,9 @@ }; /* cadence Nand Flash controller*/ - nand: nand@10b80000 { + nand: nand@10B80000 { compatible = "cdns,nand"; - reg = <0x10b80000 0x10000>, + reg = <0x10B80000 0X10000>, <0x10840000 0x10000>; reg-names = "nand_reg", "sdma"; interrupt-parent = <&gic>; @@ -240,10 +240,10 @@ status = "disabled"; }; - dma0: dma@10db0000 { + dma0: dma@10DB0000 { compatible = "snps,designware-dma-axi"; #dma-cells = <1>; - reg = <0x10db0000 0x1000>; + reg = <0x10DB0000 0x1000>; interrupt-parent = <&gic>; interrupts = , @@ -258,10 +258,10 @@ status = "disabled"; }; - dma1: dma@10dc0000 { + dma1: dma@10DC0000 { compatible = "snps,designware-dma-axi"; #dma-cells = <1>; - reg = <0x10dc0000 0x1000>; + reg = <0x10DC0000 0x1000>; interrupt-parent = <&gic>; interrupts = , diff --git a/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi b/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi index 4061d64ad322..d2043a2acf98 100644 --- a/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi +++ b/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi @@ -148,7 +148,7 @@ interrupts = ; gptfreq = <24000000>; - clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6c 20>; + clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6C 20>; status = "disabled"; }; diff --git a/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi b/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi index 3b4eba5ea151..9bed8892a4d7 100644 --- a/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi +++ b/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi @@ -149,7 +149,7 @@ interrupts = ; gptfreq = <24000000>; - clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6c 20>; + clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6C 20>; status = "disabled"; }; diff --git a/dts/arm64/nxp/nxp_mimx8mp_a53.dtsi b/dts/arm64/nxp/nxp_mimx8mp_a53.dtsi index 0092d9fb72ec..f16388707582 100644 --- a/dts/arm64/nxp/nxp_mimx8mp_a53.dtsi +++ b/dts/arm64/nxp/nxp_mimx8mp_a53.dtsi @@ -150,7 +150,7 @@ interrupts = ; gptfreq = <24000000>; - clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6c 20>; + clocks = <&ccm IMX_CCM_GPT_IPG_CLK 0x6C 20>; status = "disabled"; }; diff --git a/dts/riscv/andes/andes_v5_ae350.dtsi b/dts/riscv/andes/andes_v5_ae350.dtsi index 6f0ccdb37ae7..5ba45d146522 100644 --- a/dts/riscv/andes/andes_v5_ae350.dtsi +++ b/dts/riscv/andes/andes_v5_ae350.dtsi @@ -319,7 +319,7 @@ interrupts = <4 1>; interrupt-parent = <&plic0>; dmas = <&dma0 0 0 0x009>, - <&dma0 1 1 0x00a>; + <&dma0 1 1 0x00A>; dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; @@ -334,7 +334,7 @@ interrupts = <5 1>; interrupt-parent = <&plic0>; dmas = <&dma0 2 2 0x009>, - <&dma0 3 3 0x00a>; + <&dma0 3 3 0x00A>; dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; @@ -360,7 +360,7 @@ reg = <0xe0100000 0x1000>; interrupts = <19 2>; interrupt-parent = <&plic0>; - local-mac-address = [fc 8c eb 9b a6 51]; + local-mac-address = [FC 8C EB 9B A6 51]; status = "disabled"; }; diff --git a/dts/riscv/bflb/bl60x.dtsi b/dts/riscv/bflb/bl60x.dtsi index 625675bdf029..4ab191e8d149 100644 --- a/dts/riscv/bflb/bl60x.dtsi +++ b/dts/riscv/bflb/bl60x.dtsi @@ -148,7 +148,7 @@ adc0: adc@40002000 { compatible = "bflb,adc"; - reg = <0x40002000 0x1000 0x4000f000 0x1000>; + reg = <0x40002000 0x1000 0x4000F000 0x1000>; #io-channel-cells = <1>; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/riscv/bflb/bl61x.dtsi b/dts/riscv/bflb/bl61x.dtsi index 1de40dc2150c..f63d472ec28a 100644 --- a/dts/riscv/bflb/bl61x.dtsi +++ b/dts/riscv/bflb/bl61x.dtsi @@ -113,7 +113,7 @@ mtimer: timer@e000bff8 { compatible = "riscv,machine-timer"; - reg = <0xe000bff8 0x8 0xe0004000 0x8>; + reg = <0xE000BFF8 0x8 0xE0004000 0x8>; reg-names = "mtime", "mtimecmp"; interrupts-extended = <&clic 7 1>; @@ -163,7 +163,7 @@ adc0: adc@20002000 { compatible = "bflb,adc"; - reg = <0x20002000 0x400 0x2000f000 0x1000>; + reg = <0x20002000 0x400 0x2000F000 0x1000>; #io-channel-cells = <1>; #address-cells = <1>; #size-cells = <0>; @@ -296,7 +296,7 @@ sram0: memory@62fc0000 { compatible = "mmio-sram"; - reg = <0x62fc0000 DT_SIZE_K(320)>; + reg = <0x62FC0000 DT_SIZE_K(320)>; }; sram1: memory@63010000 { diff --git a/dts/riscv/bflb/bl70x.dtsi b/dts/riscv/bflb/bl70x.dtsi index 92546b02a399..1e6aadac74cf 100644 --- a/dts/riscv/bflb/bl70x.dtsi +++ b/dts/riscv/bflb/bl70x.dtsi @@ -153,7 +153,7 @@ adc0: adc@40002000 { compatible = "bflb,adc"; - reg = <0x40002000 0x1000 0x4000f000 0x1000>; + reg = <0x40002000 0x1000 0x4000F000 0x1000>; #io-channel-cells = <1>; #address-cells = <1>; #size-cells = <0>; diff --git a/dts/riscv/efinix/sapphire_soc.dtsi b/dts/riscv/efinix/sapphire_soc.dtsi index 3e50d8d7a208..289fd4f83a16 100644 --- a/dts/riscv/efinix/sapphire_soc.dtsi +++ b/dts/riscv/efinix/sapphire_soc.dtsi @@ -17,9 +17,9 @@ zephyr,sram = &ram0; }; - ram0: memory@f9000000 { + ram0: memory@F9000000 { device_type = "memory"; - reg = <0xf9000000 DT_SIZE_K(192)>; + reg = <0xF9000000 DT_SIZE_K(192)>; }; cpus { diff --git a/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi b/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi index af44efa41174..b85de18fa025 100644 --- a/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi +++ b/dts/riscv/espressif/esp32c2/esp32c2_common.dtsi @@ -101,7 +101,7 @@ }; rtc_timer: rtc_timer@60008004 { - reg = <0x60008004 0xc>; + reg = <0x60008004 0xC>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; @@ -180,7 +180,7 @@ timer0: counter@6001f000 { compatible = "espressif,esp32-timer"; - reg = <0x6001f000 DT_SIZE_K(4)>; + reg = <0x6001F000 DT_SIZE_K(4)>; clocks = <&clock ESP32_TIMG0_MODULE>; group = <0>; index = <0>; @@ -196,7 +196,7 @@ trng0: trng@3ff700b0 { compatible = "espressif,esp32-trng"; - reg = <0x3ff700b0 0x4>; + reg = <0x3FF700B0 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; diff --git a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi index 75719bd14917..d60b3837c74c 100644 --- a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi +++ b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi @@ -134,7 +134,7 @@ }; rtc_timer: rtc_timer@60008004 { - reg = <0x60008004 0xc>; + reg = <0x60008004 0xC>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; @@ -236,7 +236,7 @@ timer0: counter@6001f000 { compatible = "espressif,esp32-timer"; - reg = <0x6001f000 DT_SIZE_K(4)>; + reg = <0x6001F000 DT_SIZE_K(4)>; clocks = <&clock ESP32_TIMG0_MODULE>; group = <0>; index = <0>; @@ -268,7 +268,7 @@ trng0: trng@3ff700b0 { compatible = "espressif,esp32-trng"; - reg = <0x3ff700b0 0x4>; + reg = <0x3FF700B0 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; diff --git a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi index 7cfd23bb683c..727f712820c5 100644 --- a/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi +++ b/dts/riscv/espressif/esp32c6/esp32c6_common.dtsi @@ -147,7 +147,7 @@ systimer0: systimer@6000a000 { compatible = "espressif,esp32-systimer"; - reg = <0x6000a000 DT_SIZE_K(4)>; + reg = <0x6000A000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; status = "okay"; @@ -187,7 +187,7 @@ rtc_timer: rtc_timer@600b0c00 { compatible = "espressif,esp32-rtc-timer"; - reg = <0x600b0c00 DT_SIZE_K(1)>; + reg = <0x600B0C00 DT_SIZE_K(1)>; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; interrupt-parent = <&intc>; @@ -196,14 +196,14 @@ trng0: trng@600b2808 { compatible = "espressif,esp32-trng"; - reg = <0x600b2808 0x4>; + reg = <0x600B2808 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; twai0: can@6000b000 { compatible = "espressif,esp32-twai"; - reg = <0x6000b000 DT_SIZE_K(4)>; + reg = <0x6000B000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_TWAI0_MODULE>; @@ -212,7 +212,7 @@ twai1: can@6000d000 { compatible = "espressif,esp32-twai"; - reg = <0x6000d000 DT_SIZE_K(4)>; + reg = <0x6000D000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_TWAI1_MODULE>; @@ -265,13 +265,13 @@ coretemp: coretemp@6000e058 { compatible = "espressif,esp32-temp"; friendly-name = "coretemp"; - reg = <0x6000e058 0x4>; + reg = <0x6000E058 0x4>; status = "disabled"; }; adc0: adc@6000e000 { compatible = "espressif,esp32-adc"; - reg = <0x6000e000 4>; + reg = <0x6000E000 4>; clocks = <&clock ESP32_SARADC_MODULE>; unit = <1>; channel-count = <7>; @@ -359,7 +359,7 @@ usb_serial: uart@6000f000 { compatible = "espressif,esp32-usb-serial"; - reg = <0x6000f000 0x1000>; + reg = <0x6000F000 0x1000>; status = "disabled"; interrupts = ; interrupt-parent = <&intc>; diff --git a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi index 5353e91bdb38..5c88040baecf 100644 --- a/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi +++ b/dts/riscv/espressif/esp32h2/esp32h2_common.dtsi @@ -114,7 +114,7 @@ systimer0: systimer@6000b000 { compatible = "espressif,esp32-systimer"; - reg = <0x6000b000 DT_SIZE_K(4)>; + reg = <0x6000B000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; status = "okay"; @@ -138,7 +138,7 @@ timer1: counter@6000a000 { compatible = "espressif,esp32-timer"; - reg = <0x6000a000 DT_SIZE_K(4)>; + reg = <0x6000A000 DT_SIZE_K(4)>; clocks = <&clock ESP32_TIMG1_MODULE>; group = <1>; index = <0>; @@ -154,7 +154,7 @@ rtc_timer: rtc_timer@600b0c00 { compatible = "espressif,esp32-rtc-timer"; - reg = <0x600b0c00 DT_SIZE_K(1)>; + reg = <0x600B0C00 DT_SIZE_K(1)>; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; interrupt-parent = <&intc>; @@ -163,7 +163,7 @@ trng0: trng@600b2808 { compatible = "espressif,esp32-trng"; - reg = <0x600b2808 0x4>; + reg = <0x600B2808 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; @@ -179,7 +179,7 @@ wdt1: watchdog@6000a048 { compatible = "espressif,esp32-watchdog"; - reg = <0x6000a048 0x20>; + reg = <0x6000A048 0x20>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_TIMG1_MODULE>; @@ -204,7 +204,7 @@ coretemp: coretemp@6000e058 { compatible = "espressif,esp32-temp"; friendly-name = "coretemp"; - reg = <0x6000e058 0x4>; + reg = <0x6000E058 0x4>; status = "disabled"; }; @@ -241,7 +241,7 @@ usb_serial: uart@6000f000 { compatible = "espressif,esp32-usb-serial"; - reg = <0x6000f000 DT_SIZE_K(4)>; + reg = <0x6000F000 DT_SIZE_K(4)>; status = "disabled"; interrupts = ; interrupt-parent = <&intc>; @@ -301,7 +301,7 @@ compatible = "espressif,esp32-i2s"; #address-cells = <1>; #size-cells = <0>; - reg = <0x6000d000 DT_SIZE_K(4)>; + reg = <0x6000D000 DT_SIZE_K(4)>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_I2S1_MODULE>; @@ -313,7 +313,7 @@ adc0: adc@6000e000 { compatible = "espressif,esp32-adc"; - reg = <0x6000e000 0x4>; + reg = <0x6000E000 0x4>; clocks = <&clock ESP32_SARADC_MODULE>; unit = <1>; channel-count = <5>; diff --git a/dts/riscv/gd/gd32vf103.dtsi b/dts/riscv/gd/gd32vf103.dtsi index 714a2020011d..871531267d42 100644 --- a/dts/riscv/gd/gd32vf103.dtsi +++ b/dts/riscv/gd/gd32vf103.dtsi @@ -229,7 +229,7 @@ wwdgt: watchdog@40002c00 { compatible = "gd,gd32-wwdgt"; - reg = <0x40002c00 0x400>; + reg = <0x40002C00 0x400>; clocks = <&cctl GD32_CLOCK_WWDGT>; resets = <&rctl GD32_RESET_WWDGT>; interrupts = <0 0>; diff --git a/dts/riscv/ite/it81xx2.dtsi b/dts/riscv/ite/it81xx2.dtsi index 11ebc0219ee6..770e986e477e 100644 --- a/dts/riscv/ite/it81xx2.dtsi +++ b/dts/riscv/ite/it81xx2.dtsi @@ -66,7 +66,7 @@ func3-gcr = ; func3-en-mask = <0 0 0 0 - 0x02 0x02 0x10 0x0c>; + 0x02 0x02 0x10 0x0C>; func4-gcr = ; func4-en-mask = <0 0 0 0 diff --git a/dts/riscv/ite/it82xx2.dtsi b/dts/riscv/ite/it82xx2.dtsi index 7f057bfbc020..c9dcb5e97252 100644 --- a/dts/riscv/ite/it82xx2.dtsi +++ b/dts/riscv/ite/it82xx2.dtsi @@ -452,7 +452,7 @@ func3-gcr = ; func3-en-mask = <0 0 0 0 - 0x02 0x02 0x10 0x0c>; + 0x02 0x02 0x10 0x0C>; func4-gcr = ; func4-en-mask = <0 0 0 0 @@ -656,7 +656,7 @@ pinctrlk: pinctrl@f016b0 { compatible = "ite,it8xxx2-pinctrl-func"; reg = <0x00f016b0 8 /* GPCR */ - 0x00f03e3a 1>; /* PDSCK */ + 0x00f03e3A 1>; /* PDSCK */ func3-gcr = ; func3-en-mask = <0 0 0 0 @@ -676,7 +676,7 @@ pinctrll: pinctrl@f016b8 { compatible = "ite,it8xxx2-pinctrl-func"; reg = <0x00f016b8 8 /* GPCR */ - 0x00f03e3b 1>; /* PDSCL */ + 0x00f03e3B 1>; /* PDSCL */ func3-gcr = ; func3-en-mask = <0 0 0 0 diff --git a/dts/riscv/microchip/mpfs.dtsi b/dts/riscv/microchip/mpfs.dtsi index 6bdcff412469..78c421168a0f 100644 --- a/dts/riscv/microchip/mpfs.dtsi +++ b/dts/riscv/microchip/mpfs.dtsi @@ -149,7 +149,7 @@ mbox: mailbox@37020000 { compatible = "microchip,mpfs-mailbox"; - reg = <0x37020000 0x58>, <0x2000318c 0x40>, + reg = <0x37020000 0x58>, <0x2000318C 0x40>, <0x37020800 0x100>; interrupt-parent = <&plic>; interrupts = <96 1>; diff --git a/dts/riscv/telink/telink_b91.dtsi b/dts/riscv/telink/telink_b91.dtsi index c9bd546a2e94..d572eace65b1 100644 --- a/dts/riscv/telink/telink_b91.dtsi +++ b/dts/riscv/telink/telink_b91.dtsi @@ -147,9 +147,9 @@ status = "disabled"; }; - uart1: serial@801400c0 { + uart1: serial@801400C0 { compatible = "telink,b91-uart"; - reg = <0x801400c0 0x40>; + reg = <0x801400C0 0x40>; interrupts = <18 1>; interrupt-parent = <&plic0>; status = "disabled"; @@ -177,9 +177,9 @@ #pwm-cells = <3>; }; - hspi: spi@81ffffc0 { + hspi: spi@81FFFFC0 { compatible = "telink,b91-spi"; - reg = <0x81ffffc0 0x40>; + reg = <0x81FFFFC0 0x40>; peripheral-id = "HSPI_MODULE"; cs0-pin = "0"; cs1-pin = "0"; @@ -221,7 +221,7 @@ compatible = "telink,b91-pinctrl"; reg = <0x80140330 0x28 0x80140306 0x28 - 0x0000000e 0x0c>; + 0x0000000e 0x0C>; reg-names = "pin_mux", "gpio_en", "pull_up_en"; diff --git a/dts/riscv/wch/ch32v0/ch32v006.dtsi b/dts/riscv/wch/ch32v0/ch32v006.dtsi index c6edacdb5b2b..7aa311886536 100644 --- a/dts/riscv/wch/ch32v0/ch32v006.dtsi +++ b/dts/riscv/wch/ch32v0/ch32v006.dtsi @@ -102,9 +102,9 @@ clocks = <&rcc CH32V00X_CLOCK_IOPA>; }; - gpiob: gpio@40010c00 { + gpiob: gpio@40010C00 { compatible = "wch,gpio"; - reg = <0x40010c00 0x20>; + reg = <0x40010C00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <7>; diff --git a/dts/riscv/wch/ch32v203/ch32v203.dtsi b/dts/riscv/wch/ch32v203/ch32v203.dtsi index 32d334f0f3d5..d8994503586c 100644 --- a/dts/riscv/wch/ch32v203/ch32v203.dtsi +++ b/dts/riscv/wch/ch32v203/ch32v203.dtsi @@ -80,9 +80,9 @@ clocks = <&rcc CH32V20X_V30X_CLOCK_IOPA>; }; - gpiob: gpio@40010c00 { + gpiob: gpio@40010C00 { compatible = "wch,gpio"; - reg = <0x40010c00 0x20>; + reg = <0x40010C00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <16>; diff --git a/dts/riscv/wch/ch32v203/ch32v203c8t.dtsi b/dts/riscv/wch/ch32v203/ch32v203c8t.dtsi index 664273e81b0a..b0e3e57c5723 100644 --- a/dts/riscv/wch/ch32v203/ch32v203c8t.dtsi +++ b/dts/riscv/wch/ch32v203/ch32v203c8t.dtsi @@ -31,7 +31,7 @@ usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004c00 0x20>; + reg = <0x40004C00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/riscv/wch/ch32v203/ch32v203rbt.dtsi b/dts/riscv/wch/ch32v203/ch32v203rbt.dtsi index 232545e15827..465c5b1b88af 100644 --- a/dts/riscv/wch/ch32v203/ch32v203rbt.dtsi +++ b/dts/riscv/wch/ch32v203/ch32v203rbt.dtsi @@ -26,7 +26,7 @@ soc { usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004c00 0x20>; + reg = <0x40004C00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/riscv/wch/ch32v208/ch32v208.dtsi b/dts/riscv/wch/ch32v208/ch32v208.dtsi index 5e499a951518..1595d6114d98 100644 --- a/dts/riscv/wch/ch32v208/ch32v208.dtsi +++ b/dts/riscv/wch/ch32v208/ch32v208.dtsi @@ -102,9 +102,9 @@ clocks = <&rcc CH32V20X_V30X_CLOCK_IOPA>; }; - gpiob: gpio@40010c00 { + gpiob: gpio@40010C00 { compatible = "wch,gpio"; - reg = <0x40010c00 0x20>; + reg = <0x40010C00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <16>; @@ -159,7 +159,7 @@ usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004c00 0x20>; + reg = <0x40004C00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/riscv/wch/ch32v303/ch32v303.dtsi b/dts/riscv/wch/ch32v303/ch32v303.dtsi index fec38a4eece1..57542d433b11 100644 --- a/dts/riscv/wch/ch32v303/ch32v303.dtsi +++ b/dts/riscv/wch/ch32v303/ch32v303.dtsi @@ -82,9 +82,9 @@ clocks = <&rcc CH32V20X_V30X_CLOCK_IOPA>; }; - gpiob: gpio@40010c00 { + gpiob: gpio@40010C00 { compatible = "wch,gpio"; - reg = <0x40010c00 0x20>; + reg = <0x40010C00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <16>; @@ -148,7 +148,7 @@ usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004c00 0x20>; + reg = <0x40004C00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/riscv/wch/ch32v307/ch32v307.dtsi b/dts/riscv/wch/ch32v307/ch32v307.dtsi index c816231dc2f9..31e8c8014179 100644 --- a/dts/riscv/wch/ch32v307/ch32v307.dtsi +++ b/dts/riscv/wch/ch32v307/ch32v307.dtsi @@ -82,9 +82,9 @@ clocks = <&rcc CH32V20X_V30X_CLOCK_IOPA>; }; - gpiob: gpio@40010c00 { + gpiob: gpio@40010C00 { compatible = "wch,gpio"; - reg = <0x40010c00 0x20>; + reg = <0x40010C00 0x20>; gpio-controller; #gpio-cells = <2>; ngpios = <8>; @@ -148,7 +148,7 @@ usart4: uart@40004c00 { compatible = "wch,usart"; - reg = <0x40004c00 0x20>; + reg = <0x40004C00 0x20>; clocks = <&rcc CH32V20X_V30X_CLOCK_USART4>; interrupt-parent = <&pfic>; interrupts = <68>; diff --git a/dts/rx/renesas/r5f51308axfp.dtsi b/dts/rx/renesas/r5f51308axfp.dtsi index 15054c7e3438..12376d2391ce 100644 --- a/dts/rx/renesas/r5f51308axfp.dtsi +++ b/dts/rx/renesas/r5f51308axfp.dtsi @@ -62,7 +62,7 @@ pclkblock: pclkblock@80010 { compatible = "renesas,rx-cgc-pclk-block"; reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, - <0x0008001c 4>; + <0x0008001C 4>; reg-names = "MSTPA", "MSTPB", "MSTPC", "MSTPD"; #clock-cells = <0>; clocks = <&pll>; diff --git a/dts/rx/renesas/r5f52618bgfp.dtsi b/dts/rx/renesas/r5f52618bgfp.dtsi index 4ee783bd7cff..c36fc4dce31c 100644 --- a/dts/rx/renesas/r5f52618bgfp.dtsi +++ b/dts/rx/renesas/r5f52618bgfp.dtsi @@ -75,7 +75,7 @@ reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, - <0x0008001c 4>; + <0x0008001C 4>; reg-names = "MSTPA", "MSTPB", "MSTPC", "MSTPD"; #clock-cells = <0>; clocks = <&pll>; diff --git a/dts/rx/renesas/r5f526tfddfp.dtsi b/dts/rx/renesas/r5f526tfddfp.dtsi index 077ce0a3d7ef..b07576b690b4 100644 --- a/dts/rx/renesas/r5f526tfddfp.dtsi +++ b/dts/rx/renesas/r5f526tfddfp.dtsi @@ -61,7 +61,7 @@ pclkblock: pclkblock@80010 { compatible = "renesas,rx-cgc-pclk-block"; - reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, <0x0008001c 4>; + reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, <0x0008001C 4>; reg-names = "MSTPA", "MSTPB", "MSTPC", "MSTPD"; #clock-cells = <0>; clocks = <&pll>; diff --git a/dts/rx/renesas/rx-qemu.dtsi b/dts/rx/renesas/rx-qemu.dtsi index da5af2cc96a5..27ef92faf950 100644 --- a/dts/rx/renesas/rx-qemu.dtsi +++ b/dts/rx/renesas/rx-qemu.dtsi @@ -111,7 +111,7 @@ pclkblock: pclkblock@80010 { compatible = "renesas,rx-cgc-pclk-block"; reg = <0x00080010 4>, <0x00080014 4>, <0x00080018 4>, - <0x0008001c 4>; + <0x0008001C 4>; reg-names = "MSTPA", "MSTPB", "MSTPC", "MSTPD"; #clock-cells = <0>; clocks = <&pll>; @@ -209,8 +209,8 @@ cmt1: timer@88008 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088008 0x02>, - <0x0008800a 0x02>, - <0x0008800c 0x02>; + <0x0008800A 0x02>, + <0x0008800C 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <29 1>; interrupt-names = "cmi"; diff --git a/dts/rx/renesas/rx130-common.dtsi b/dts/rx/renesas/rx130-common.dtsi index 92e0f45e2643..ddb5f68e9ad7 100644 --- a/dts/rx/renesas/rx130-common.dtsi +++ b/dts/rx/renesas/rx130-common.dtsi @@ -89,7 +89,7 @@ pinctrl: pin-controller@8c11f { compatible = "renesas,rx-pinctrl"; - reg = <0x0008c11f 0x3c0>; + reg = <0x0008C11F 0x3c0>; status = "okay"; }; @@ -270,11 +270,11 @@ #gpio-cells = <0x02>; ngpios = <8>; port = <0>; - reg = <0x0008c000 0x01>, - <0x0008c020 0x01>, - <0x0008c040 0x01>, - <0x0008c060 0x01>, - <0x0008c0c0 0x01>; + reg = <0x0008C000 0x01>, + <0x0008C020 0x01>, + <0x0008C040 0x01>, + <0x0008C060 0x01>, + <0x0008C0C0 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmux0>; status = "disabled"; @@ -286,14 +286,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <1>; - reg = <0x0008c001 0x01>, - <0x0008c021 0x01>, - <0x0008c041 0x01>, - <0x0008c061 0x01>, - <0x0008c082 0x01>, - <0x0008c083 0x01>, - <0x0008c0c1 0x01>, - <0x0008c0e1 0x01>; + reg = <0x0008C001 0x01>, + <0x0008C021 0x01>, + <0x0008C041 0x01>, + <0x0008C061 0x01>, + <0x0008C082 0x01>, + <0x0008C083 0x01>, + <0x0008C0C1 0x01>, + <0x0008C0E1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux1>; port-irqs = <&port_irq2 &port_irq3 &port_irq4 @@ -319,14 +319,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <2>; - reg = <0x0008c002 0x01>, - <0x0008c022 0x01>, - <0x0008c042 0x01>, - <0x0008c062 0x01>, - <0x0008c084 0x01>, - <0x0008c085 0x01>, - <0x0008c0c2 0x01>, - <0x0008c0e2 0x01>; + reg = <0x0008C002 0x01>, + <0x0008C022 0x01>, + <0x0008C042 0x01>, + <0x0008C062 0x01>, + <0x0008C084 0x01>, + <0x0008C085 0x01>, + <0x0008C0C2 0x01>, + <0x0008C0E2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux2>; status = "disabled"; @@ -338,14 +338,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <3>; - reg = <0x0008c003 0x01>, - <0x0008c023 0x01>, - <0x0008c043 0x01>, - <0x0008c063 0x01>, - <0x0008c086 0x01>, - <0x0008c087 0x01>, - <0x0008c0c3 0x01>, - <0x0008c0e3 0x01>; + reg = <0x0008C003 0x01>, + <0x0008C023 0x01>, + <0x0008C043 0x01>, + <0x0008C063 0x01>, + <0x0008C086 0x01>, + <0x0008C087 0x01>, + <0x0008C0C3 0x01>, + <0x0008C0E3 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux3>; port-irqs = <&port_irq0 &port_irq1 &port_irq2 &port_irq3 &port_irq4>; @@ -368,11 +368,11 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <4>; - reg = <0x0008c004 0x01>, - <0x0008c024 0x01>, - <0x0008c044 0x01>, - <0x0008c064 0x01>, - <0x0008c0c4 0x01>; + reg = <0x0008C004 0x01>, + <0x0008C024 0x01>, + <0x0008C044 0x01>, + <0x0008C064 0x01>, + <0x0008C0C4 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmux4>; status = "disabled"; @@ -384,12 +384,12 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <5>; - reg = <0x0008c005 0x01>, - <0x0008c025 0x01>, - <0x0008c045 0x01>, - <0x0008c065 0x01>, - <0x0008c0c5 0x01>, - <0x0008c0e5 0x01>; + reg = <0x0008C005 0x01>, + <0x0008C025 0x01>, + <0x0008C045 0x01>, + <0x0008C065 0x01>, + <0x0008C0C5 0x01>, + <0x0008C0E5 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR", "DSCR"; pinmux = <&pinmux5>; status = "disabled"; @@ -401,14 +401,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <10>; - reg = <0x0008c00a 0x01>, - <0x0008c02a 0x01>, - <0x0008c04a 0x01>, - <0x0008c06a 0x01>, - <0x0008c094 0x01>, - <0x0008c095 0x01>, - <0x0008c0ca 0x01>, - <0x0008c0ea 0x01>; + reg = <0x0008C00A 0x01>, + <0x0008C02A 0x01>, + <0x0008C04A 0x01>, + <0x0008C06A 0x01>, + <0x0008C094 0x01>, + <0x0008C095 0x01>, + <0x0008C0CA 0x01>, + <0x0008C0EA 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxa>; port-irqs = <&port_irq5 &port_irq6>; @@ -425,14 +425,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <11>; - reg = <0x0008c00b 0x01>, - <0x0008c02b 0x01>, - <0x0008c04b 0x01>, - <0x0008c06b 0x01>, - <0x0008c096 0x01>, - <0x0008c097 0x01>, - <0x0008c0cb 0x01>, - <0x0008c0eb 0x01>; + reg = <0x0008C00B 0x01>, + <0x0008C02B 0x01>, + <0x0008C04B 0x01>, + <0x0008C06B 0x01>, + <0x0008C096 0x01>, + <0x0008C097 0x01>, + <0x0008C0CB 0x01>, + <0x0008C0EB 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxb>; port-irqs = <&port_irq4>; @@ -447,14 +447,14 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <12>; - reg = <0x0008c00c 0x01>, - <0x0008c02c 0x01>, - <0x0008c04c 0x01>, - <0x0008c06c 0x01>, - <0x0008c098 0x01>, - <0x0008c099 0x01>, - <0x0008c0cc 0x01>, - <0x0008c0ec 0x01>; + reg = <0x0008C00C 0x01>, + <0x0008C02C 0x01>, + <0x0008C04C 0x01>, + <0x0008C06C 0x01>, + <0x0008C098 0x01>, + <0x0008C099 0x01>, + <0x0008C0CC 0x01>, + <0x0008C0EC 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxc>; status = "disabled"; @@ -466,13 +466,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <13>; - reg = <0x0008c00d 0x01>, - <0x0008c02d 0x01>, - <0x0008c04d 0x01>, - <0x0008c06d 0x01>, - <0x0008c09a 0x01>, - <0x0008c0cd 0x01>, - <0x0008c0ed 0x01>; + reg = <0x0008C00D 0x01>, + <0x0008C02D 0x01>, + <0x0008C04D 0x01>, + <0x0008C06D 0x01>, + <0x0008C09A 0x01>, + <0x0008C0CD 0x01>, + <0x0008C0ED 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmuxd>; port-irqs = <&port_irq0 &port_irq1 &port_irq2 @@ -503,13 +503,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <14>; - reg = <0x0008c00e 0x01>, - <0x0008c02e 0x01>, - <0x0008c04e 0x01>, - <0x0008c06e 0x01>, - <0x0008c09c 0x01>, - <0x0008c0ce 0x01>, - <0x0008c0ee 0x01>; + reg = <0x0008C00E 0x01>, + <0x0008C02E 0x01>, + <0x0008C04E 0x01>, + <0x0008C06E 0x01>, + <0x0008C09C 0x01>, + <0x0008C0CE 0x01>, + <0x0008C0EE 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmuxe>; port-irqs = <&port_irq5 &port_irq6 &port_irq7>; @@ -528,12 +528,12 @@ #gpio-cells = <2>; ngpios = <8>; port = <17>; - reg = <0x0008c011 0x01>, - <0x0008c031 0x01>, - <0x0008c051 0x01>, - <0x0008c071 0x01>, - <0x0008c0d1 0x01>, - <0x0008c0f1 0x01>; + reg = <0x0008C011 0x01>, + <0x0008C031 0x01>, + <0x0008C051 0x01>, + <0x0008C071 0x01>, + <0x0008C0D1 0x01>, + <0x0008C0F1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR", "DSCR"; pinmux = <&pinmuxh>; port-irqs = <&port_irq0 &port_irq1>; @@ -550,13 +550,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <18>; - reg = <0x0008c012 0x01>, - <0x0008c032 0x01>, - <0x0008c052 0x01>, - <0x0008c072 0x01>, - <0x0008c0a4 0x01>, - <0x0008c0d2 0x01>, - <0x0008c0f2 0x01>; + reg = <0x0008C012 0x01>, + <0x0008C032 0x01>, + <0x0008C052 0x01>, + <0x0008C072 0x01>, + <0x0008C0A4 0x01>, + <0x0008C0D2 0x01>, + <0x0008C0F2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmuxj>; status = "disabled"; @@ -566,7 +566,7 @@ compatible = "renesas,rx-sci"; interrupts = <215 1>, <216 1>, <217 1>, <214 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a000 0x20>; + reg = <0x8A000 0x20>; clocks = <&pclkb MSTPB 31>; channel = <0>; dtc = <&dtc>; @@ -582,7 +582,7 @@ compatible = "renesas,rx-sci"; interrupts = <219 1>, <220 1>, <221 1>, <218 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a020 0x20>; + reg = <0x8A020 0x20>; clocks = <&pclkb MSTPB 30>; channel = <1>; dtc = <&dtc>; @@ -598,7 +598,7 @@ compatible = "renesas,rx-sci"; interrupts = <223 1>, <224 1>, <225 1>, <222 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a0a0 0x20>; + reg = <0x8A0A0 0x20>; clocks = <&pclkb MSTPB 26>; channel = <5>; dtc = <&dtc>; @@ -614,7 +614,7 @@ compatible = "renesas,rx-sci"; interrupts = <227 1>, <228 1>, <229 1>, <226 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a0c0 0x20>; + reg = <0x8A0C0 0x20>; clocks = <&pclkb MSTPB 25>; channel = <6>; dtc = <&dtc>; @@ -630,7 +630,7 @@ compatible = "renesas,rx-sci"; interrupts = <231 1>, <232 1>, <233 1>, <230 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a100 0x20>; + reg = <0x8A100 0x20>; clocks = <&pclkb MSTPC 27>; channel = <8>; dtc = <&dtc>; @@ -785,7 +785,7 @@ compatible = "renesas,rx-sci"; interrupts = <235 1>, <236 1>, <237 1>, <234 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a120 0x20>; + reg = <0x8A120 0x20>; clocks = <&pclkb MSTPC 26>; status = "disabled"; channel = <9>; @@ -832,8 +832,8 @@ cmt1: timer@88008 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088008 0x02>, - <0x0008800a 0x02>, - <0x0008800c 0x02>; + <0x0008800A 0x02>, + <0x0008800C 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <29 1>; interrupt-names = "cmi"; @@ -867,7 +867,7 @@ ctsu: ctsu@a0900 { compatible = "renesas,rx-ctsu"; - reg = <0x000a0900 0x100>; + reg = <0x000A0900 0x100>; clocks = <&pclkb MSTPD 10>; interrupts = <60 1>, <61 1>, <62 1>; interrupt-names = "ctsuwr", "ctsurd", "ctsufn"; @@ -876,7 +876,7 @@ lvd0: lvd@800e0 { compatible = "renesas,rx-lvd"; - reg = <0x000800e0 0x02>; + reg = <0x000800E0 0x02>; channel = <0>; interrupts = <88 1>; interrupt-names = "lvd"; @@ -885,7 +885,7 @@ lvd1: lvd@800e2 { compatible = "renesas,rx-lvd"; - reg = <0x000800e2 0x02>; + reg = <0x000800E2 0x02>; channel = <1>; interrupts = <89 1>; interrupt-names = "lvd"; @@ -895,7 +895,7 @@ ofsm: ofsm@ffffff80 { compatible = "zephyr,memory-region"; - reg = <0xffffff80 0x0f>; + reg = <0xFFFFFF80 0x0F>; zephyr,memory-region = "OFSM"; status = "okay"; }; diff --git a/dts/rx/renesas/rx261-common.dtsi b/dts/rx/renesas/rx261-common.dtsi index edfd3e3e1122..e7e95e019d46 100644 --- a/dts/rx/renesas/rx261-common.dtsi +++ b/dts/rx/renesas/rx261-common.dtsi @@ -72,7 +72,7 @@ pinctrl: pin-controller@8c11f { compatible = "renesas,rx-pinctrl"; - reg = <0x0008c11f 0xb8>; + reg = <0x0008C11F 0xb8>; status = "okay"; }; @@ -253,11 +253,11 @@ #gpio-cells = <2>; ngpios = <5>; port = <0>; - reg = <0x0008c000 0x01>, - <0x0008c020 0x01>, - <0x0008c040 0x01>, - <0x0008c060 0x01>, - <0x0008c0c0 0x01>; + reg = <0x0008C000 0x01>, + <0x0008C020 0x01>, + <0x0008C040 0x01>, + <0x0008C060 0x01>, + <0x0008C0C0 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmux0>; status = "disabled"; @@ -269,13 +269,13 @@ #gpio-cells = <2>; ngpios = <8>; port = <1>; - reg = <0x0008c001 0x01>, - <0x0008c021 0x01>, - <0x0008c041 0x01>, - <0x0008c061 0x01>, - <0x0008c082 0x01>, - <0x0008c083 0x01>, - <0x0008c0c1 0x01>; + reg = <0x0008C001 0x01>, + <0x0008C021 0x01>, + <0x0008C041 0x01>, + <0x0008C061 0x01>, + <0x0008C082 0x01>, + <0x0008C083 0x01>, + <0x0008C0C1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux1>; port-irqs = <&port_irq2 &port_irq3 &port_irq4 @@ -301,13 +301,13 @@ #gpio-cells = <2>; ngpios = <8>; port = <2>; - reg = <0x0008c002 0x01>, - <0x0008c022 0x01>, - <0x0008c042 0x01>, - <0x0008c062 0x01>, - <0x0008c084 0x01>, - <0x0008c085 0x01>, - <0x0008c0c2 0x01>; + reg = <0x0008C002 0x01>, + <0x0008C022 0x01>, + <0x0008C042 0x01>, + <0x0008C062 0x01>, + <0x0008C084 0x01>, + <0x0008C085 0x01>, + <0x0008C0C2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux2>; status = "disabled"; @@ -319,13 +319,13 @@ #gpio-cells = <2>; ngpios = <8>; port = <3>; - reg = <0x0008c003 0x01>, - <0x0008c023 0x01>, - <0x0008c043 0x01>, - <0x0008c063 0x01>, - <0x0008c086 0x01>, - <0x0008c087 0x01>, - <0x0008c0c3 0x01>; + reg = <0x0008C003 0x01>, + <0x0008C023 0x01>, + <0x0008C043 0x01>, + <0x0008C063 0x01>, + <0x0008C086 0x01>, + <0x0008C087 0x01>, + <0x0008C0C3 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux3>; port-irqs = <&port_irq0 &port_irq1 &port_irq2 &port_irq3 &port_irq4>; @@ -348,11 +348,11 @@ #gpio-cells = <2>; ngpios = <8>; port = <4>; - reg = <0x0008c004 0x01>, - <0x0008c024 0x01>, - <0x0008c044 0x01>, - <0x0008c064 0x01>, - <0x0008c0c4 0x01>; + reg = <0x0008C004 0x01>, + <0x0008C024 0x01>, + <0x0008C044 0x01>, + <0x0008C064 0x01>, + <0x0008C0C4 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmux4>; status = "disabled"; @@ -364,13 +364,13 @@ #gpio-cells = <2>; ngpios = <8>; port = <5>; - reg = <0x0008c005 0x01>, - <0x0008c025 0x01>, - <0x0008c045 0x01>, - <0x0008c065 0x01>, - <0x0008c08a 0x01>, - <0x0008c08b 0x01>, - <0x0008c0c5 0x01>; + reg = <0x0008C005 0x01>, + <0x0008C025 0x01>, + <0x0008C045 0x01>, + <0x0008C065 0x01>, + <0x0008C08A 0x01>, + <0x0008C08B 0x01>, + <0x0008C0C5 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux5>; status = "disabled"; @@ -382,13 +382,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <10>; - reg = <0x0008c00a 0x01>, - <0x0008c02a 0x01>, - <0x0008c04a 0x01>, - <0x0008c06a 0x01>, - <0x0008c094 0x01>, - <0x0008c095 0x01>, - <0x0008c0ca 0x01>; + reg = <0x0008C00A 0x01>, + <0x0008C02A 0x01>, + <0x0008C04A 0x01>, + <0x0008C06A 0x01>, + <0x0008C094 0x01>, + <0x0008C095 0x01>, + <0x0008C0CA 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmuxa>; port-irqs = <&port_irq5 &port_irq6>; @@ -405,13 +405,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <11>; - reg = <0x0008c00b 0x01>, - <0x0008c02b 0x01>, - <0x0008c04b 0x01>, - <0x0008c06b 0x01>, - <0x0008c096 0x01>, - <0x0008c097 0x01>, - <0x0008c0cb 0x01>; + reg = <0x0008C00B 0x01>, + <0x0008C02B 0x01>, + <0x0008C04B 0x01>, + <0x0008C06B 0x01>, + <0x0008C096 0x01>, + <0x0008C097 0x01>, + <0x0008C0CB 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmuxb>; port-irqs = <&port_irq4>; @@ -426,13 +426,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <12>; - reg = <0x0008c00c 0x01>, - <0x0008c02c 0x01>, - <0x0008c04c 0x01>, - <0x0008c06c 0x01>, - <0x0008c098 0x01>, - <0x0008c099 0x01>, - <0x0008c0cc 0x01>; + reg = <0x0008C00C 0x01>, + <0x0008C02C 0x01>, + <0x0008C04C 0x01>, + <0x0008C06C 0x01>, + <0x0008C098 0x01>, + <0x0008C099 0x01>, + <0x0008C0CC 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmuxc>; status = "disabled"; @@ -444,12 +444,12 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <13>; - reg = <0x0008c00d 0x01>, - <0x0008c02d 0x01>, - <0x0008c04d 0x01>, - <0x0008c06d 0x01>, - <0x0008c09a 0x01>, - <0x0008c0cd 0x01>; + reg = <0x0008C00D 0x01>, + <0x0008C02D 0x01>, + <0x0008C04D 0x01>, + <0x0008C06D 0x01>, + <0x0008C09A 0x01>, + <0x0008C0CD 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR"; pinmux = <&pinmuxd>; port-irqs = <&port_irq0 &port_irq1 &port_irq2 @@ -480,12 +480,12 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <14>; - reg = <0x0008c00e 0x01>, - <0x0008c02e 0x01>, - <0x0008c04e 0x01>, - <0x0008c06e 0x01>, - <0x0008c09c 0x01>, - <0x0008c0ce 0x01>; + reg = <0x0008C00E 0x01>, + <0x0008C02E 0x01>, + <0x0008C04E 0x01>, + <0x0008C06E 0x01>, + <0x0008C09C 0x01>, + <0x0008C0CE 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR"; pinmux = <&pinmuxe>; port-irqs = <&port_irq5 &port_irq6 &port_irq7>; @@ -504,11 +504,11 @@ #gpio-cells = <2>; ngpios = <8>; port = <17>; - reg = <0x0008c011 0x01>, - <0x0008c031 0x01>, - <0x0008c051 0x01>, - <0x0008c071 0x01>, - <0x0008c0d1 0x01>; + reg = <0x0008C011 0x01>, + <0x0008C031 0x01>, + <0x0008C051 0x01>, + <0x0008C071 0x01>, + <0x0008C0D1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmuxh>; port-irqs = <&port_irq0 &port_irq1>; @@ -525,11 +525,11 @@ #gpio-cells = <2>; ngpios = <8>; port = <18>; - reg = <0x0008c012 0x01>, - <0x0008c032 0x01>, - <0x0008c052 0x01>, - <0x0008c072 0x01>, - <0x0008c0d2 0x01>; + reg = <0x0008C012 0x01>, + <0x0008C032 0x01>, + <0x0008C052 0x01>, + <0x0008C072 0x01>, + <0x0008C0D2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR"; pinmux = <&pinmuxj>; status = "disabled"; @@ -539,7 +539,7 @@ compatible = "renesas,rx-sci"; interrupts = <219 1>, <220 1>, <221 1>, <218 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a020 0x20>; + reg = <0x8A020 0x20>; clocks = <&pclkb MSTPB 30>; dtc = <&dtc>; channel = <1>; @@ -555,7 +555,7 @@ compatible = "renesas,rx-sci"; interrupts = <223 1>, <224 1>, <225 1>, <222 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a0a0 0x20>; + reg = <0x8A0A0 0x20>; clocks = <&pclkb MSTPB 26>; dtc = <&dtc>; channel = <5>; @@ -571,7 +571,7 @@ compatible = "renesas,rx-sci"; interrupts = <227 1>, <228 1>, <229 1>, <226 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8a0c0 0x20>; + reg = <0x8A0C0 0x20>; clocks = <&pclkb MSTPB 25>; dtc = <&dtc>; channel = <6>; @@ -587,7 +587,7 @@ compatible = "renesas,rx-sci"; interrupts = <239 1>, <240 1>, <241 1>, <238 1>; interrupt-names = "rxi", "txi", "tei", "eri"; - reg = <0x8b300 0x20>; + reg = <0x8B300 0x20>; clocks = <&pclkb MSTPB 4>; dtc = <&dtc>; channel = <12>; @@ -636,8 +636,8 @@ cmt1: timer@88008 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088008 0x02>, - <0x0008800a 0x02>, - <0x0008800c 0x02>; + <0x0008800A 0x02>, + <0x0008800C 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <29 1>; interrupt-names = "cmi"; @@ -658,8 +658,8 @@ cmt3: timer@88018 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088018 0x02>, - <0x0008801a 0x02>, - <0x0008801c 0x02>; + <0x0008801A 0x02>, + <0x0008801C 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <31 1>; interrupt-names = "cmi"; @@ -693,7 +693,7 @@ ofsm: ofsm@ffffff80 { compatible = "zephyr,memory-region"; - reg = <0xffffff80 0x0f>; + reg = <0xFFFFFF80 0x0F>; zephyr,memory-region = "OFSM"; status = "okay"; }; diff --git a/dts/rx/renesas/rx26t-common.dtsi b/dts/rx/renesas/rx26t-common.dtsi index 459e93001dda..3bd3118a7ccc 100644 --- a/dts/rx/renesas/rx26t-common.dtsi +++ b/dts/rx/renesas/rx26t-common.dtsi @@ -65,7 +65,7 @@ pinctrl: pin-controller@8c11f { compatible = "renesas,rx-pinctrl"; - reg = <0x0008c11f 0x3c0>; + reg = <0x0008C11F 0x3c0>; status = "okay"; }; @@ -180,13 +180,13 @@ #gpio-cells = <0x02>; ngpios = <2>; port = <0>; - reg = <0x0008c000 0x01>, - <0x0008c020 0x01>, - <0x0008c040 0x01>, - <0x0008c060 0x01>, - <0x0008c080 0x01>, - <0x0008c0c0 0x01>, - <0x0008c0e0 0x01>; + reg = <0x0008C000 0x01>, + <0x0008C020 0x01>, + <0x0008C040 0x01>, + <0x0008C060 0x01>, + <0x0008C080 0x01>, + <0x0008C0C0 0x01>, + <0x0008C0E0 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmux0>; status = "disabled"; @@ -198,13 +198,13 @@ #gpio-cells = <0x2>; ngpios = <2>; port = <1>; - reg = <0x0008c001 0x01>, - <0x0008c021 0x01>, - <0x0008c041 0x01>, - <0x0008c061 0x01>, - <0x0008c082 0x01>, - <0x0008c0c1 0x01>, - <0x0008c0e1 0x01>; + reg = <0x0008C001 0x01>, + <0x0008C021 0x01>, + <0x0008C041 0x01>, + <0x0008C061 0x01>, + <0x0008C082 0x01>, + <0x0008C0C1 0x01>, + <0x0008C0E1 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR"; pinmux = <&pinmux1>; status = "disabled"; @@ -216,14 +216,14 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <2>; - reg = <0x0008c002 0x01>, - <0x0008c022 0x01>, - <0x0008c042 0x01>, - <0x0008c062 0x01>, - <0x0008c084 0x01>, - <0x0008c085 0x01>, - <0x0008c0c2 0x01>, - <0x0008c0e2 0x01>; + reg = <0x0008C002 0x01>, + <0x0008C022 0x01>, + <0x0008C042 0x01>, + <0x0008C062 0x01>, + <0x0008C084 0x01>, + <0x0008C085 0x01>, + <0x0008C0C2 0x01>, + <0x0008C0E2 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux2>; status = "disabled"; @@ -235,14 +235,14 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <3>; - reg = <0x0008c003 0x01>, - <0x0008c023 0x01>, - <0x0008c043 0x01>, - <0x0008c063 0x01>, - <0x0008c086 0x01>, - <0x0008c087 0x01>, - <0x0008c0c3 0x01>, - <0x0008c0e3 0x01>; + reg = <0x0008C003 0x01>, + <0x0008C023 0x01>, + <0x0008C043 0x01>, + <0x0008C063 0x01>, + <0x0008C086 0x01>, + <0x0008C087 0x01>, + <0x0008C0C3 0x01>, + <0x0008C0E3 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmux3>; status = "disabled"; @@ -254,13 +254,13 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <4>; - reg = <0x0008c004 0x01>, - <0x0008c024 0x01>, - <0x0008c044 0x01>, - <0x0008c064 0x01>, - <0x0008c088 0x01>, - <0x0008c089 0x01>, - <0x0008c0c4 0x01>; + reg = <0x0008C004 0x01>, + <0x0008C024 0x01>, + <0x0008C044 0x01>, + <0x0008C064 0x01>, + <0x0008C088 0x01>, + <0x0008C089 0x01>, + <0x0008C0C4 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux4>; status = "disabled"; @@ -272,13 +272,13 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <5>; - reg = <0x0008c005 0x01>, - <0x0008c025 0x01>, - <0x0008c045 0x01>, - <0x0008c065 0x01>, - <0x0008c08a 0x01>, - <0x0008c08b 0x01>, - <0x0008c0c5 0x01>; + reg = <0x0008C005 0x01>, + <0x0008C025 0x01>, + <0x0008C045 0x01>, + <0x0008C065 0x01>, + <0x0008C08A 0x01>, + <0x0008C08B 0x01>, + <0x0008C0C5 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux5>; status = "disabled"; @@ -290,13 +290,13 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <6>; - reg = <0x0008c006 0x01>, - <0x0008c026 0x01>, - <0x0008c046 0x01>, - <0x0008c066 0x01>, - <0x0008c08c 0x01>, - <0x0008c08d 0x01>, - <0x0008c0c6 0x01>; + reg = <0x0008C006 0x01>, + <0x0008C026 0x01>, + <0x0008C046 0x01>, + <0x0008C066 0x01>, + <0x0008C08C 0x01>, + <0x0008C08D 0x01>, + <0x0008C0C6 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR"; pinmux = <&pinmux5>; status = "disabled"; @@ -308,15 +308,15 @@ #gpio-cells = <0x2>; ngpios = <7>; port = <7>; - reg = <0x0008c007 0x01>, - <0x0008c027 0x01>, - <0x0008c047 0x01>, - <0x0008c067 0x01>, - <0x0008c08e 0x01>, - <0x0008c08f 0x01>, - <0x0008c0c7 0x01>, - <0x0008c0e7 0x01>, - <0x0008c12f 0x01>; + reg = <0x0008C007 0x01>, + <0x0008C027 0x01>, + <0x0008C047 0x01>, + <0x0008C067 0x01>, + <0x0008C08E 0x01>, + <0x0008C08F 0x01>, + <0x0008C0C7 0x01>, + <0x0008C0E7 0x01>, + <0x0008C12F 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmux7>; @@ -329,14 +329,14 @@ #gpio-cells = <0x2>; ngpios = <3>; port = <8>; - reg = <0x0008c008 0x01>, - <0x0008c028 0x01>, - <0x0008c048 0x01>, - <0x0008c068 0x01>, - <0x0008c090 0x01>, - <0x0008c0c8 0x01>, - <0x0008c0e8 0x01>, - <0x0008c130 0x01>; + reg = <0x0008C008 0x01>, + <0x0008C028 0x01>, + <0x0008C048 0x01>, + <0x0008C068 0x01>, + <0x0008C090 0x01>, + <0x0008C0C8 0x01>, + <0x0008C0E8 0x01>, + <0x0008C130 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmux8>; @@ -349,15 +349,15 @@ #gpio-cells = <0x2>; ngpios = <7>; port = <9>; - reg = <0x0008c009 0x01>, - <0x0008c029 0x01>, - <0x0008c049 0x01>, - <0x0008c069 0x01>, - <0x0008c092 0x01>, - <0x0008c093 0x01>, - <0x0008c0c9 0x01>, - <0x0008c0e9 0x01>, - <0x0008c131 0x01>; + reg = <0x0008C009 0x01>, + <0x0008C029 0x01>, + <0x0008C049 0x01>, + <0x0008C069 0x01>, + <0x0008C092 0x01>, + <0x0008C093 0x01>, + <0x0008C0C9 0x01>, + <0x0008C0E9 0x01>, + <0x0008C131 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmux9>; @@ -370,14 +370,14 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <10>; - reg = <0x0008c00a 0x01>, - <0x0008c02a 0x01>, - <0x0008c04a 0x01>, - <0x0008c06a 0x01>, - <0x0008c094 0x01>, - <0x0008c095 0x01>, - <0x0008c0ca 0x01>, - <0x0008c0ea 0x01>; + reg = <0x0008C00A 0x01>, + <0x0008C02A 0x01>, + <0x0008C04A 0x01>, + <0x0008C06A 0x01>, + <0x0008C094 0x01>, + <0x0008C095 0x01>, + <0x0008C0CA 0x01>, + <0x0008C0EA 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxa>; @@ -390,15 +390,15 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <11>; - reg = <0x0008c00b 0x01>, - <0x0008c02b 0x01>, - <0x0008c04b 0x01>, - <0x0008c06b 0x01>, - <0x0008c096 0x01>, - <0x0008c097 0x01>, - <0x0008c0cb 0x01>, - <0x0008c0eb 0x01>, - <0x0008c133 0x01>; + reg = <0x0008C00B 0x01>, + <0x0008C02B 0x01>, + <0x0008C04B 0x01>, + <0x0008C06B 0x01>, + <0x0008C096 0x01>, + <0x0008C097 0x01>, + <0x0008C0CB 0x01>, + <0x0008C0EB 0x01>, + <0x0008C133 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmuxb>; @@ -411,15 +411,15 @@ #gpio-cells = <0x2>; ngpios = <8>; port = <13>; - reg = <0x0008c00d 0x01>, - <0x0008c02d 0x01>, - <0x0008c04d 0x01>, - <0x0008c06d 0x01>, - <0x0008c09a 0x01>, - <0x0008c09b 0x01>, - <0x0008c0cd 0x01>, - <0x0008c0ed 0x01>, - <0x0008c135 0x01>; + reg = <0x0008C00D 0x01>, + <0x0008C02D 0x01>, + <0x0008C04D 0x01>, + <0x0008C06D 0x01>, + <0x0008C09A 0x01>, + <0x0008C09B 0x01>, + <0x0008C0CD 0x01>, + <0x0008C0ED 0x01>, + <0x0008C135 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR", "DSCR2"; pinmux = <&pinmuxd>; @@ -432,14 +432,14 @@ #gpio-cells = <0x2>; ngpios = <6>; port = <14>; - reg = <0x0008c00e 0x01>, - <0x0008c02e 0x01>, - <0x0008c04e 0x01>, - <0x0008c06e 0x01>, - <0x0008c09c 0x01>, - <0x0008c09d 0x01>, - <0x0008c0ce 0x01>, - <0x0008c0ee 0x01>; + reg = <0x0008C00E 0x01>, + <0x0008C02E 0x01>, + <0x0008C04E 0x01>, + <0x0008C06E 0x01>, + <0x0008C09C 0x01>, + <0x0008C09D 0x01>, + <0x0008C0CE 0x01>, + <0x0008C0EE 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "ODR0", "ODR1", "PCR", "DSCR"; pinmux = <&pinmuxe>; status = "disabled"; @@ -451,13 +451,13 @@ #gpio-cells = <0x2>; ngpios = <2>; port = <23>; - reg = <0x0008c016 0x01>, - <0x0008c036 0x01>, - <0x0008c056 0x01>, - <0x0008c076 0x01>, - <0x0008c0d6 0x01>, - <0x0008c0f6 0x01>, - <0x0008c0ad 0x01>; + reg = <0x0008C016 0x01>, + <0x0008C036 0x01>, + <0x0008C056 0x01>, + <0x0008C076 0x01>, + <0x0008C0D6 0x01>, + <0x0008C0F6 0x01>, + <0x0008C0AD 0x01>; reg-names = "PDR", "PODR", "PIDR", "PMR", "PCR", "DSCR", "ODR1"; pinmux = <&pinmuxn>; status = "disabled"; @@ -467,7 +467,7 @@ compatible = "renesas,rx-sci"; interrupts = <60 1>, <61 1>; interrupt-names = "rxi", "txi"; - reg = <0x8a020 0x20>; + reg = <0x8A020 0x20>; clocks = <&pclkb MSTPB 30>; status = "disabled"; channel = <1>; @@ -482,7 +482,7 @@ compatible = "renesas,rx-sci"; interrupts = <84 1>, <85 1>; interrupt-names = "rxi", "txi"; - reg = <0x8a0a0 0x20>; + reg = <0x8A0A0 0x20>; clocks = <&pclkb MSTPB 26>; status = "disabled"; channel = <5>; @@ -497,7 +497,7 @@ compatible = "renesas,rx-sci"; interrupts = <86 1>, <87 1>; interrupt-names = "rxi", "txi"; - reg = <0x8a0c0 0x20>; + reg = <0x8A0C0 0x20>; clocks = <&pclkb MSTPB 25>; status = "disabled"; channel = <6>; @@ -512,7 +512,7 @@ compatible = "renesas,rx-sci"; interrupts = <116 1>, <117 1>; interrupt-names = "rxi", "txi"; - reg = <0x8b300 0x20>; + reg = <0x8B300 0x20>; clocks = <&pclkb MSTPB 4>; status = "disabled"; channel = <12>; @@ -548,8 +548,8 @@ cmt1: timer@88008 { compatible = "renesas,rx-timer-cmt"; reg = <0x00088008 0x02>, - <0x0008800a 0x02>, - <0x0008800c 0x02>; + <0x0008800A 0x02>, + <0x0008800C 0x02>; reg-names = "CMCR", "CMCNT", "CMCOR"; interrupts = <29 1>; interrupt-names = "cmi"; @@ -559,7 +559,7 @@ ofsm: ofsm@120040 { compatible = "zephyr,memory-region"; - reg = <0x00120040 0xbf>; + reg = <0x00120040 0xBF>; zephyr,memory-region = "OFSM"; status = "okay"; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_128M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_128M.dtsi index e536f10d5967..2e90bd55286c 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_128M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_128M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@2ff0000 { label = "image-1"; - reg = <0x2ff0000 DT_SIZE_K(48960)>; + reg = <0x2FF0000 DT_SIZE_K(48960)>; }; slot0_appcpu_partition: partition@5fc0000 { label = "image-0-appcpu"; - reg = <0x5fc0000 DT_SIZE_K(16320)>; + reg = <0x5FC0000 DT_SIZE_K(16320)>; }; slot1_appcpu_partition: partition@6fb0000 { label = "image-1-appcpu"; - reg = <0x6fb0000 DT_SIZE_K(16320)>; + reg = <0x6FB0000 DT_SIZE_K(16320)>; }; slot0_lpcore_partition: partition@7fa0000 { label = "image-0-lpcore"; - reg = <0x7fa0000 DT_SIZE_K(32)>; + reg = <0x7FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7fa8000 { label = "image-1-lpcore"; - reg = <0x7fa8000 DT_SIZE_K(32)>; + reg = <0x7FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@7fb0000 { label = "storage"; - reg = <0x7fb0000 DT_SIZE_K(192)>; + reg = <0x7FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7fe0000 { label = "image-scratch"; - reg = <0x7fe0000 DT_SIZE_K(124)>; + reg = <0x7FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7fff000 { label = "coredump"; - reg = <0x7fff000 DT_SIZE_K(4)>; + reg = <0x7FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_16M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_16M.dtsi index 5fbec8596ffb..e47801b34151 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_16M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_16M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@5f0000 { label = "image-1"; - reg = <0x5f0000 DT_SIZE_K(5952)>; + reg = <0x5F0000 DT_SIZE_K(5952)>; }; slot0_appcpu_partition: partition@bc0000 { label = "image-0-appcpu"; - reg = <0xbc0000 DT_SIZE_K(1984)>; + reg = <0xBC0000 DT_SIZE_K(1984)>; }; slot1_appcpu_partition: partition@db0000 { label = "image-1-appcpu"; - reg = <0xdb0000 DT_SIZE_K(1984)>; + reg = <0xDB0000 DT_SIZE_K(1984)>; }; slot0_lpcore_partition: partition@fa0000 { label = "image-0-lpcore"; - reg = <0xfa0000 DT_SIZE_K(32)>; + reg = <0xFA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@fa8000 { label = "image-1-lpcore"; - reg = <0xfa8000 DT_SIZE_K(32)>; + reg = <0xFA8000 DT_SIZE_K(32)>; }; storage_partition: partition@fb0000 { label = "storage"; - reg = <0xfb0000 DT_SIZE_K(192)>; + reg = <0xFB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@fe0000 { label = "image-scratch"; - reg = <0xfe0000 DT_SIZE_K(124)>; + reg = <0xFE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@fff000 { label = "coredump"; - reg = <0xfff000 DT_SIZE_K(4)>; + reg = <0xFFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_2M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_2M.dtsi index 91cadab3b802..4a956952e0a9 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_2M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_2M.dtsi @@ -27,7 +27,7 @@ slot1_partition: partition@b0000 { label = "image-1"; - reg = <0xb0000 DT_SIZE_K(576)>; + reg = <0xB0000 DT_SIZE_K(576)>; }; slot0_appcpu_partition: partition@140000 { @@ -42,27 +42,27 @@ slot0_lpcore_partition: partition@1a0000 { label = "image-0-lpcore"; - reg = <0x1a0000 DT_SIZE_K(32)>; + reg = <0x1A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1a8000 { label = "image-1-lpcore"; - reg = <0x1a8000 DT_SIZE_K(32)>; + reg = <0x1A8000 DT_SIZE_K(32)>; }; storage_partition: partition@1b0000 { label = "storage"; - reg = <0x1b0000 DT_SIZE_K(192)>; + reg = <0x1B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1e0000 { label = "image-scratch"; - reg = <0x1e0000 DT_SIZE_K(124)>; + reg = <0x1E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1ff000 { label = "coredump"; - reg = <0x1ff000 DT_SIZE_K(4)>; + reg = <0x1FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_32M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_32M.dtsi index ad488fe45f30..81e7fdc5800b 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_32M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_32M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@bf0000 { label = "image-1"; - reg = <0xbf0000 DT_SIZE_K(12096)>; + reg = <0xBF0000 DT_SIZE_K(12096)>; }; slot0_appcpu_partition: partition@17c0000 { label = "image-0-appcpu"; - reg = <0x17c0000 DT_SIZE_K(4032)>; + reg = <0x17C0000 DT_SIZE_K(4032)>; }; slot1_appcpu_partition: partition@1bb0000 { label = "image-1-appcpu"; - reg = <0x1bb0000 DT_SIZE_K(4032)>; + reg = <0x1BB0000 DT_SIZE_K(4032)>; }; slot0_lpcore_partition: partition@1fa0000 { label = "image-0-lpcore"; - reg = <0x1fa0000 DT_SIZE_K(32)>; + reg = <0x1FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1fa8000 { label = "image-1-lpcore"; - reg = <0x1fa8000 DT_SIZE_K(32)>; + reg = <0x1FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@1fb0000 { label = "storage"; - reg = <0x1fb0000 DT_SIZE_K(192)>; + reg = <0x1FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1fe0000 { label = "image-scratch"; - reg = <0x1fe0000 DT_SIZE_K(124)>; + reg = <0x1FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1fff000 { label = "coredump"; - reg = <0x1fff000 DT_SIZE_K(4)>; + reg = <0x1FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_4M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_4M.dtsi index 0b77ccf9ee45..0d7b86bac8bd 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_4M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_4M.dtsi @@ -32,7 +32,7 @@ slot0_appcpu_partition: partition@2c0000 { label = "image-0-appcpu"; - reg = <0x2c0000 DT_SIZE_K(448)>; + reg = <0x2C0000 DT_SIZE_K(448)>; }; slot1_appcpu_partition: partition@330000 { @@ -42,27 +42,27 @@ slot0_lpcore_partition: partition@3a0000 { label = "image-0-lpcore"; - reg = <0x3a0000 DT_SIZE_K(32)>; + reg = <0x3A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3a8000 { label = "image-1-lpcore"; - reg = <0x3a8000 DT_SIZE_K(32)>; + reg = <0x3A8000 DT_SIZE_K(32)>; }; storage_partition: partition@3b0000 { label = "storage"; - reg = <0x3b0000 DT_SIZE_K(192)>; + reg = <0x3B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3e0000 { label = "image-scratch"; - reg = <0x3e0000 DT_SIZE_K(124)>; + reg = <0x3E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3ff000 { label = "coredump"; - reg = <0x3ff000 DT_SIZE_K(4)>; + reg = <0x3FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_64M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_64M.dtsi index 882ceead6ed7..0538f0f90653 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_64M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_64M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@17f0000 { label = "image-1"; - reg = <0x17f0000 DT_SIZE_K(24384)>; + reg = <0x17F0000 DT_SIZE_K(24384)>; }; slot0_appcpu_partition: partition@2fc0000 { label = "image-0-appcpu"; - reg = <0x2fc0000 DT_SIZE_K(8128)>; + reg = <0x2FC0000 DT_SIZE_K(8128)>; }; slot1_appcpu_partition: partition@37b0000 { label = "image-1-appcpu"; - reg = <0x37b0000 DT_SIZE_K(8128)>; + reg = <0x37B0000 DT_SIZE_K(8128)>; }; slot0_lpcore_partition: partition@3fa0000 { label = "image-0-lpcore"; - reg = <0x3fa0000 DT_SIZE_K(32)>; + reg = <0x3FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3fa8000 { label = "image-1-lpcore"; - reg = <0x3fa8000 DT_SIZE_K(32)>; + reg = <0x3FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@3fb0000 { label = "storage"; - reg = <0x3fb0000 DT_SIZE_K(192)>; + reg = <0x3FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3fe0000 { label = "image-scratch"; - reg = <0x3fe0000 DT_SIZE_K(124)>; + reg = <0x3FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3fff000 { label = "coredump"; - reg = <0x3fff000 DT_SIZE_K(4)>; + reg = <0x3FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_amp_8M.dtsi b/dts/vendor/espressif/partitions_0x0_amp_8M.dtsi index e84cf2d8df57..ef8289c49ab8 100644 --- a/dts/vendor/espressif/partitions_0x0_amp_8M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_amp_8M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@2f0000 { label = "image-1"; - reg = <0x2f0000 DT_SIZE_K(2880)>; + reg = <0x2F0000 DT_SIZE_K(2880)>; }; slot0_appcpu_partition: partition@5c0000 { label = "image-0-appcpu"; - reg = <0x5c0000 DT_SIZE_K(960)>; + reg = <0x5C0000 DT_SIZE_K(960)>; }; slot1_appcpu_partition: partition@6b0000 { label = "image-1-appcpu"; - reg = <0x6b0000 DT_SIZE_K(960)>; + reg = <0x6B0000 DT_SIZE_K(960)>; }; slot0_lpcore_partition: partition@7a0000 { label = "image-0-lpcore"; - reg = <0x7a0000 DT_SIZE_K(32)>; + reg = <0x7A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7a8000 { label = "image-1-lpcore"; - reg = <0x7a8000 DT_SIZE_K(32)>; + reg = <0x7A8000 DT_SIZE_K(32)>; }; storage_partition: partition@7b0000 { label = "storage"; - reg = <0x7b0000 DT_SIZE_K(192)>; + reg = <0x7B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7e0000 { label = "image-scratch"; - reg = <0x7e0000 DT_SIZE_K(124)>; + reg = <0x7E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7ff000 { label = "coredump"; - reg = <0x7ff000 DT_SIZE_K(4)>; + reg = <0x7FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_128M.dtsi b/dts/vendor/espressif/partitions_0x0_default_128M.dtsi index 25da18a0fef9..df41ed75d9cb 100644 --- a/dts/vendor/espressif/partitions_0x0_default_128M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_128M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@3fe0000 { label = "image-1"; - reg = <0x3fe0000 DT_SIZE_K(65280)>; + reg = <0x3FE0000 DT_SIZE_K(65280)>; }; slot0_lpcore_partition: partition@7fa0000 { label = "image-0-lpcore"; - reg = <0x7fa0000 DT_SIZE_K(32)>; + reg = <0x7FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7fa8000 { label = "image-1-lpcore"; - reg = <0x7fa8000 DT_SIZE_K(32)>; + reg = <0x7FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@7fb0000 { label = "storage"; - reg = <0x7fb0000 DT_SIZE_K(192)>; + reg = <0x7FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7fe0000 { label = "image-scratch"; - reg = <0x7fe0000 DT_SIZE_K(124)>; + reg = <0x7FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7fff000 { label = "coredump"; - reg = <0x7fff000 DT_SIZE_K(4)>; + reg = <0x7FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_16M.dtsi b/dts/vendor/espressif/partitions_0x0_default_16M.dtsi index ccc1e4cbbd13..fd333e90165d 100644 --- a/dts/vendor/espressif/partitions_0x0_default_16M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_16M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@7e0000 { label = "image-1"; - reg = <0x7e0000 DT_SIZE_K(7936)>; + reg = <0x7E0000 DT_SIZE_K(7936)>; }; slot0_lpcore_partition: partition@fa0000 { label = "image-0-lpcore"; - reg = <0xfa0000 DT_SIZE_K(32)>; + reg = <0xFA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@fa8000 { label = "image-1-lpcore"; - reg = <0xfa8000 DT_SIZE_K(32)>; + reg = <0xFA8000 DT_SIZE_K(32)>; }; storage_partition: partition@fb0000 { label = "storage"; - reg = <0xfb0000 DT_SIZE_K(192)>; + reg = <0xFB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@fe0000 { label = "image-scratch"; - reg = <0xfe0000 DT_SIZE_K(124)>; + reg = <0xFE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@fff000 { label = "coredump"; - reg = <0xfff000 DT_SIZE_K(4)>; + reg = <0xFFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_2M.dtsi b/dts/vendor/espressif/partitions_0x0_default_2M.dtsi index 5923faef4e47..974e180df092 100644 --- a/dts/vendor/espressif/partitions_0x0_default_2M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_2M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@e0000 { label = "image-1"; - reg = <0xe0000 DT_SIZE_K(768)>; + reg = <0xE0000 DT_SIZE_K(768)>; }; slot0_lpcore_partition: partition@1a0000 { label = "image-0-lpcore"; - reg = <0x1a0000 DT_SIZE_K(32)>; + reg = <0x1A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1a8000 { label = "image-1-lpcore"; - reg = <0x1a8000 DT_SIZE_K(32)>; + reg = <0x1A8000 DT_SIZE_K(32)>; }; storage_partition: partition@1b0000 { label = "storage"; - reg = <0x1b0000 DT_SIZE_K(192)>; + reg = <0x1B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1e0000 { label = "image-scratch"; - reg = <0x1e0000 DT_SIZE_K(124)>; + reg = <0x1E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1ff000 { label = "coredump"; - reg = <0x1ff000 DT_SIZE_K(4)>; + reg = <0x1FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_32M.dtsi b/dts/vendor/espressif/partitions_0x0_default_32M.dtsi index 6953e8cd91d8..5cb8a5ebec76 100644 --- a/dts/vendor/espressif/partitions_0x0_default_32M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_32M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@fe0000 { label = "image-1"; - reg = <0xfe0000 DT_SIZE_K(16128)>; + reg = <0xFE0000 DT_SIZE_K(16128)>; }; slot0_lpcore_partition: partition@1fa0000 { label = "image-0-lpcore"; - reg = <0x1fa0000 DT_SIZE_K(32)>; + reg = <0x1FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1fa8000 { label = "image-1-lpcore"; - reg = <0x1fa8000 DT_SIZE_K(32)>; + reg = <0x1FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@1fb0000 { label = "storage"; - reg = <0x1fb0000 DT_SIZE_K(192)>; + reg = <0x1FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1fe0000 { label = "image-scratch"; - reg = <0x1fe0000 DT_SIZE_K(124)>; + reg = <0x1FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1fff000 { label = "coredump"; - reg = <0x1fff000 DT_SIZE_K(4)>; + reg = <0x1FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_4M.dtsi b/dts/vendor/espressif/partitions_0x0_default_4M.dtsi index c8e9fc9797b2..c4e1d5c52b70 100644 --- a/dts/vendor/espressif/partitions_0x0_default_4M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_4M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@1e0000 { label = "image-1"; - reg = <0x1e0000 DT_SIZE_K(1792)>; + reg = <0x1E0000 DT_SIZE_K(1792)>; }; slot0_lpcore_partition: partition@3a0000 { label = "image-0-lpcore"; - reg = <0x3a0000 DT_SIZE_K(32)>; + reg = <0x3A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3a8000 { label = "image-1-lpcore"; - reg = <0x3a8000 DT_SIZE_K(32)>; + reg = <0x3A8000 DT_SIZE_K(32)>; }; storage_partition: partition@3b0000 { label = "storage"; - reg = <0x3b0000 DT_SIZE_K(192)>; + reg = <0x3B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3e0000 { label = "image-scratch"; - reg = <0x3e0000 DT_SIZE_K(124)>; + reg = <0x3E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3ff000 { label = "coredump"; - reg = <0x3ff000 DT_SIZE_K(4)>; + reg = <0x3FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_64M.dtsi b/dts/vendor/espressif/partitions_0x0_default_64M.dtsi index 69cbe315c050..d5f26660431d 100644 --- a/dts/vendor/espressif/partitions_0x0_default_64M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_64M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@1fe0000 { label = "image-1"; - reg = <0x1fe0000 DT_SIZE_K(32512)>; + reg = <0x1FE0000 DT_SIZE_K(32512)>; }; slot0_lpcore_partition: partition@3fa0000 { label = "image-0-lpcore"; - reg = <0x3fa0000 DT_SIZE_K(32)>; + reg = <0x3FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3fa8000 { label = "image-1-lpcore"; - reg = <0x3fa8000 DT_SIZE_K(32)>; + reg = <0x3FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@3fb0000 { label = "storage"; - reg = <0x3fb0000 DT_SIZE_K(192)>; + reg = <0x3FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3fe0000 { label = "image-scratch"; - reg = <0x3fe0000 DT_SIZE_K(124)>; + reg = <0x3FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3fff000 { label = "coredump"; - reg = <0x3fff000 DT_SIZE_K(4)>; + reg = <0x3FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x0_default_8M.dtsi b/dts/vendor/espressif/partitions_0x0_default_8M.dtsi index e38bec829edb..c316321ed392 100644 --- a/dts/vendor/espressif/partitions_0x0_default_8M.dtsi +++ b/dts/vendor/espressif/partitions_0x0_default_8M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@3e0000 { label = "image-1"; - reg = <0x3e0000 DT_SIZE_K(3840)>; + reg = <0x3E0000 DT_SIZE_K(3840)>; }; slot0_lpcore_partition: partition@7a0000 { label = "image-0-lpcore"; - reg = <0x7a0000 DT_SIZE_K(32)>; + reg = <0x7A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7a8000 { label = "image-1-lpcore"; - reg = <0x7a8000 DT_SIZE_K(32)>; + reg = <0x7A8000 DT_SIZE_K(32)>; }; storage_partition: partition@7b0000 { label = "storage"; - reg = <0x7b0000 DT_SIZE_K(192)>; + reg = <0x7B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7e0000 { label = "image-scratch"; - reg = <0x7e0000 DT_SIZE_K(124)>; + reg = <0x7E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7ff000 { label = "coredump"; - reg = <0x7ff000 DT_SIZE_K(4)>; + reg = <0x7FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_128M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_128M.dtsi index 3607a7f06ba6..aec4d88840f5 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_128M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_128M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@2ff0000 { label = "image-1"; - reg = <0x2ff0000 DT_SIZE_K(48960)>; + reg = <0x2FF0000 DT_SIZE_K(48960)>; }; slot0_appcpu_partition: partition@5fc0000 { label = "image-0-appcpu"; - reg = <0x5fc0000 DT_SIZE_K(16320)>; + reg = <0x5FC0000 DT_SIZE_K(16320)>; }; slot1_appcpu_partition: partition@6fb0000 { label = "image-1-appcpu"; - reg = <0x6fb0000 DT_SIZE_K(16320)>; + reg = <0x6FB0000 DT_SIZE_K(16320)>; }; slot0_lpcore_partition: partition@7fa0000 { label = "image-0-lpcore"; - reg = <0x7fa0000 DT_SIZE_K(32)>; + reg = <0x7FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7fa8000 { label = "image-1-lpcore"; - reg = <0x7fa8000 DT_SIZE_K(32)>; + reg = <0x7FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@7fb0000 { label = "storage"; - reg = <0x7fb0000 DT_SIZE_K(192)>; + reg = <0x7FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7fe0000 { label = "image-scratch"; - reg = <0x7fe0000 DT_SIZE_K(124)>; + reg = <0x7FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7fff000 { label = "coredump"; - reg = <0x7fff000 DT_SIZE_K(4)>; + reg = <0x7FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_16M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_16M.dtsi index 19b1b0ee9027..0fcbf5abd3cd 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_16M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_16M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@5f0000 { label = "image-1"; - reg = <0x5f0000 DT_SIZE_K(5952)>; + reg = <0x5F0000 DT_SIZE_K(5952)>; }; slot0_appcpu_partition: partition@bc0000 { label = "image-0-appcpu"; - reg = <0xbc0000 DT_SIZE_K(1984)>; + reg = <0xBC0000 DT_SIZE_K(1984)>; }; slot1_appcpu_partition: partition@db0000 { label = "image-1-appcpu"; - reg = <0xdb0000 DT_SIZE_K(1984)>; + reg = <0xDB0000 DT_SIZE_K(1984)>; }; slot0_lpcore_partition: partition@fa0000 { label = "image-0-lpcore"; - reg = <0xfa0000 DT_SIZE_K(32)>; + reg = <0xFA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@fa8000 { label = "image-1-lpcore"; - reg = <0xfa8000 DT_SIZE_K(32)>; + reg = <0xFA8000 DT_SIZE_K(32)>; }; storage_partition: partition@fb0000 { label = "storage"; - reg = <0xfb0000 DT_SIZE_K(192)>; + reg = <0xFB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@fe0000 { label = "image-scratch"; - reg = <0xfe0000 DT_SIZE_K(124)>; + reg = <0xFE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@fff000 { label = "coredump"; - reg = <0xfff000 DT_SIZE_K(4)>; + reg = <0xFFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_2M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_2M.dtsi index 522ca070f168..54e8fdaf46c6 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_2M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_2M.dtsi @@ -27,7 +27,7 @@ slot1_partition: partition@b0000 { label = "image-1"; - reg = <0xb0000 DT_SIZE_K(576)>; + reg = <0xB0000 DT_SIZE_K(576)>; }; slot0_appcpu_partition: partition@140000 { @@ -42,27 +42,27 @@ slot0_lpcore_partition: partition@1a0000 { label = "image-0-lpcore"; - reg = <0x1a0000 DT_SIZE_K(32)>; + reg = <0x1A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1a8000 { label = "image-1-lpcore"; - reg = <0x1a8000 DT_SIZE_K(32)>; + reg = <0x1A8000 DT_SIZE_K(32)>; }; storage_partition: partition@1b0000 { label = "storage"; - reg = <0x1b0000 DT_SIZE_K(192)>; + reg = <0x1B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1e0000 { label = "image-scratch"; - reg = <0x1e0000 DT_SIZE_K(124)>; + reg = <0x1E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1ff000 { label = "coredump"; - reg = <0x1ff000 DT_SIZE_K(4)>; + reg = <0x1FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_32M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_32M.dtsi index 96704fba5fee..4c36ae7f954c 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_32M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_32M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@bf0000 { label = "image-1"; - reg = <0xbf0000 DT_SIZE_K(12096)>; + reg = <0xBF0000 DT_SIZE_K(12096)>; }; slot0_appcpu_partition: partition@17c0000 { label = "image-0-appcpu"; - reg = <0x17c0000 DT_SIZE_K(4032)>; + reg = <0x17C0000 DT_SIZE_K(4032)>; }; slot1_appcpu_partition: partition@1bb0000 { label = "image-1-appcpu"; - reg = <0x1bb0000 DT_SIZE_K(4032)>; + reg = <0x1BB0000 DT_SIZE_K(4032)>; }; slot0_lpcore_partition: partition@1fa0000 { label = "image-0-lpcore"; - reg = <0x1fa0000 DT_SIZE_K(32)>; + reg = <0x1FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1fa8000 { label = "image-1-lpcore"; - reg = <0x1fa8000 DT_SIZE_K(32)>; + reg = <0x1FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@1fb0000 { label = "storage"; - reg = <0x1fb0000 DT_SIZE_K(192)>; + reg = <0x1FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1fe0000 { label = "image-scratch"; - reg = <0x1fe0000 DT_SIZE_K(124)>; + reg = <0x1FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1fff000 { label = "coredump"; - reg = <0x1fff000 DT_SIZE_K(4)>; + reg = <0x1FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_4M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_4M.dtsi index f6f7ff2ac0c0..c3d3d28546f9 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_4M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_4M.dtsi @@ -32,7 +32,7 @@ slot0_appcpu_partition: partition@2c0000 { label = "image-0-appcpu"; - reg = <0x2c0000 DT_SIZE_K(448)>; + reg = <0x2C0000 DT_SIZE_K(448)>; }; slot1_appcpu_partition: partition@330000 { @@ -42,27 +42,27 @@ slot0_lpcore_partition: partition@3a0000 { label = "image-0-lpcore"; - reg = <0x3a0000 DT_SIZE_K(32)>; + reg = <0x3A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3a8000 { label = "image-1-lpcore"; - reg = <0x3a8000 DT_SIZE_K(32)>; + reg = <0x3A8000 DT_SIZE_K(32)>; }; storage_partition: partition@3b0000 { label = "storage"; - reg = <0x3b0000 DT_SIZE_K(192)>; + reg = <0x3B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3e0000 { label = "image-scratch"; - reg = <0x3e0000 DT_SIZE_K(124)>; + reg = <0x3E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3ff000 { label = "coredump"; - reg = <0x3ff000 DT_SIZE_K(4)>; + reg = <0x3FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_64M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_64M.dtsi index a580f63762c3..d40da4e014c7 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_64M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_64M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@17f0000 { label = "image-1"; - reg = <0x17f0000 DT_SIZE_K(24384)>; + reg = <0x17F0000 DT_SIZE_K(24384)>; }; slot0_appcpu_partition: partition@2fc0000 { label = "image-0-appcpu"; - reg = <0x2fc0000 DT_SIZE_K(8128)>; + reg = <0x2FC0000 DT_SIZE_K(8128)>; }; slot1_appcpu_partition: partition@37b0000 { label = "image-1-appcpu"; - reg = <0x37b0000 DT_SIZE_K(8128)>; + reg = <0x37B0000 DT_SIZE_K(8128)>; }; slot0_lpcore_partition: partition@3fa0000 { label = "image-0-lpcore"; - reg = <0x3fa0000 DT_SIZE_K(32)>; + reg = <0x3FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3fa8000 { label = "image-1-lpcore"; - reg = <0x3fa8000 DT_SIZE_K(32)>; + reg = <0x3FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@3fb0000 { label = "storage"; - reg = <0x3fb0000 DT_SIZE_K(192)>; + reg = <0x3FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3fe0000 { label = "image-scratch"; - reg = <0x3fe0000 DT_SIZE_K(124)>; + reg = <0x3FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3fff000 { label = "coredump"; - reg = <0x3fff000 DT_SIZE_K(4)>; + reg = <0x3FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_amp_8M.dtsi b/dts/vendor/espressif/partitions_0x1000_amp_8M.dtsi index 53410e708f9d..77526fe6068d 100644 --- a/dts/vendor/espressif/partitions_0x1000_amp_8M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_amp_8M.dtsi @@ -27,42 +27,42 @@ slot1_partition: partition@2f0000 { label = "image-1"; - reg = <0x2f0000 DT_SIZE_K(2880)>; + reg = <0x2F0000 DT_SIZE_K(2880)>; }; slot0_appcpu_partition: partition@5c0000 { label = "image-0-appcpu"; - reg = <0x5c0000 DT_SIZE_K(960)>; + reg = <0x5C0000 DT_SIZE_K(960)>; }; slot1_appcpu_partition: partition@6b0000 { label = "image-1-appcpu"; - reg = <0x6b0000 DT_SIZE_K(960)>; + reg = <0x6B0000 DT_SIZE_K(960)>; }; slot0_lpcore_partition: partition@7a0000 { label = "image-0-lpcore"; - reg = <0x7a0000 DT_SIZE_K(32)>; + reg = <0x7A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7a8000 { label = "image-1-lpcore"; - reg = <0x7a8000 DT_SIZE_K(32)>; + reg = <0x7A8000 DT_SIZE_K(32)>; }; storage_partition: partition@7b0000 { label = "storage"; - reg = <0x7b0000 DT_SIZE_K(192)>; + reg = <0x7B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7e0000 { label = "image-scratch"; - reg = <0x7e0000 DT_SIZE_K(124)>; + reg = <0x7E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7ff000 { label = "coredump"; - reg = <0x7ff000 DT_SIZE_K(4)>; + reg = <0x7FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_128M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_128M.dtsi index 2aad8ffd2064..4836b5a6397a 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_128M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_128M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@3fe0000 { label = "image-1"; - reg = <0x3fe0000 DT_SIZE_K(65280)>; + reg = <0x3FE0000 DT_SIZE_K(65280)>; }; slot0_lpcore_partition: partition@7fa0000 { label = "image-0-lpcore"; - reg = <0x7fa0000 DT_SIZE_K(32)>; + reg = <0x7FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7fa8000 { label = "image-1-lpcore"; - reg = <0x7fa8000 DT_SIZE_K(32)>; + reg = <0x7FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@7fb0000 { label = "storage"; - reg = <0x7fb0000 DT_SIZE_K(192)>; + reg = <0x7FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7fe0000 { label = "image-scratch"; - reg = <0x7fe0000 DT_SIZE_K(124)>; + reg = <0x7FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7fff000 { label = "coredump"; - reg = <0x7fff000 DT_SIZE_K(4)>; + reg = <0x7FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_16M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_16M.dtsi index dc36e726b673..e29c1f83e413 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_16M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_16M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@7e0000 { label = "image-1"; - reg = <0x7e0000 DT_SIZE_K(7936)>; + reg = <0x7E0000 DT_SIZE_K(7936)>; }; slot0_lpcore_partition: partition@fa0000 { label = "image-0-lpcore"; - reg = <0xfa0000 DT_SIZE_K(32)>; + reg = <0xFA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@fa8000 { label = "image-1-lpcore"; - reg = <0xfa8000 DT_SIZE_K(32)>; + reg = <0xFA8000 DT_SIZE_K(32)>; }; storage_partition: partition@fb0000 { label = "storage"; - reg = <0xfb0000 DT_SIZE_K(192)>; + reg = <0xFB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@fe0000 { label = "image-scratch"; - reg = <0xfe0000 DT_SIZE_K(124)>; + reg = <0xFE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@fff000 { label = "coredump"; - reg = <0xfff000 DT_SIZE_K(4)>; + reg = <0xFFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_2M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_2M.dtsi index fd1c018f94f1..c290dbd18f55 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_2M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_2M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@e0000 { label = "image-1"; - reg = <0xe0000 DT_SIZE_K(768)>; + reg = <0xE0000 DT_SIZE_K(768)>; }; slot0_lpcore_partition: partition@1a0000 { label = "image-0-lpcore"; - reg = <0x1a0000 DT_SIZE_K(32)>; + reg = <0x1A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1a8000 { label = "image-1-lpcore"; - reg = <0x1a8000 DT_SIZE_K(32)>; + reg = <0x1A8000 DT_SIZE_K(32)>; }; storage_partition: partition@1b0000 { label = "storage"; - reg = <0x1b0000 DT_SIZE_K(192)>; + reg = <0x1B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1e0000 { label = "image-scratch"; - reg = <0x1e0000 DT_SIZE_K(124)>; + reg = <0x1E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1ff000 { label = "coredump"; - reg = <0x1ff000 DT_SIZE_K(4)>; + reg = <0x1FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_32M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_32M.dtsi index eec77c2d0f13..a6ecdffb8d9c 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_32M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_32M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@fe0000 { label = "image-1"; - reg = <0xfe0000 DT_SIZE_K(16128)>; + reg = <0xFE0000 DT_SIZE_K(16128)>; }; slot0_lpcore_partition: partition@1fa0000 { label = "image-0-lpcore"; - reg = <0x1fa0000 DT_SIZE_K(32)>; + reg = <0x1FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@1fa8000 { label = "image-1-lpcore"; - reg = <0x1fa8000 DT_SIZE_K(32)>; + reg = <0x1FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@1fb0000 { label = "storage"; - reg = <0x1fb0000 DT_SIZE_K(192)>; + reg = <0x1FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@1fe0000 { label = "image-scratch"; - reg = <0x1fe0000 DT_SIZE_K(124)>; + reg = <0x1FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@1fff000 { label = "coredump"; - reg = <0x1fff000 DT_SIZE_K(4)>; + reg = <0x1FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_4M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_4M.dtsi index 21f17985a83e..7011c48f7b81 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_4M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_4M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@1e0000 { label = "image-1"; - reg = <0x1e0000 DT_SIZE_K(1792)>; + reg = <0x1E0000 DT_SIZE_K(1792)>; }; slot0_lpcore_partition: partition@3a0000 { label = "image-0-lpcore"; - reg = <0x3a0000 DT_SIZE_K(32)>; + reg = <0x3A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3a8000 { label = "image-1-lpcore"; - reg = <0x3a8000 DT_SIZE_K(32)>; + reg = <0x3A8000 DT_SIZE_K(32)>; }; storage_partition: partition@3b0000 { label = "storage"; - reg = <0x3b0000 DT_SIZE_K(192)>; + reg = <0x3B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3e0000 { label = "image-scratch"; - reg = <0x3e0000 DT_SIZE_K(124)>; + reg = <0x3E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3ff000 { label = "coredump"; - reg = <0x3ff000 DT_SIZE_K(4)>; + reg = <0x3FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_64M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_64M.dtsi index 618f93653407..9e6a24e3a107 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_64M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_64M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@1fe0000 { label = "image-1"; - reg = <0x1fe0000 DT_SIZE_K(32512)>; + reg = <0x1FE0000 DT_SIZE_K(32512)>; }; slot0_lpcore_partition: partition@3fa0000 { label = "image-0-lpcore"; - reg = <0x3fa0000 DT_SIZE_K(32)>; + reg = <0x3FA0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@3fa8000 { label = "image-1-lpcore"; - reg = <0x3fa8000 DT_SIZE_K(32)>; + reg = <0x3FA8000 DT_SIZE_K(32)>; }; storage_partition: partition@3fb0000 { label = "storage"; - reg = <0x3fb0000 DT_SIZE_K(192)>; + reg = <0x3FB0000 DT_SIZE_K(192)>; }; scratch_partition: partition@3fe0000 { label = "image-scratch"; - reg = <0x3fe0000 DT_SIZE_K(124)>; + reg = <0x3FE0000 DT_SIZE_K(124)>; }; coredump_partition: partition@3fff000 { label = "coredump"; - reg = <0x3fff000 DT_SIZE_K(4)>; + reg = <0x3FFF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/espressif/partitions_0x1000_default_8M.dtsi b/dts/vendor/espressif/partitions_0x1000_default_8M.dtsi index 29f6b3e4a87e..9b8810573edb 100644 --- a/dts/vendor/espressif/partitions_0x1000_default_8M.dtsi +++ b/dts/vendor/espressif/partitions_0x1000_default_8M.dtsi @@ -27,32 +27,32 @@ slot1_partition: partition@3e0000 { label = "image-1"; - reg = <0x3e0000 DT_SIZE_K(3840)>; + reg = <0x3E0000 DT_SIZE_K(3840)>; }; slot0_lpcore_partition: partition@7a0000 { label = "image-0-lpcore"; - reg = <0x7a0000 DT_SIZE_K(32)>; + reg = <0x7A0000 DT_SIZE_K(32)>; }; slot1_lpcore_partition: partition@7a8000 { label = "image-1-lpcore"; - reg = <0x7a8000 DT_SIZE_K(32)>; + reg = <0x7A8000 DT_SIZE_K(32)>; }; storage_partition: partition@7b0000 { label = "storage"; - reg = <0x7b0000 DT_SIZE_K(192)>; + reg = <0x7B0000 DT_SIZE_K(192)>; }; scratch_partition: partition@7e0000 { label = "image-scratch"; - reg = <0x7e0000 DT_SIZE_K(124)>; + reg = <0x7E0000 DT_SIZE_K(124)>; }; coredump_partition: partition@7ff000 { label = "coredump"; - reg = <0x7ff000 DT_SIZE_K(4)>; + reg = <0x7FF000 DT_SIZE_K(4)>; }; }; }; diff --git a/dts/vendor/nordic/nrf52840_partition.dtsi b/dts/vendor/nordic/nrf52840_partition.dtsi index 8b5df504d422..1fa90a3ed714 100644 --- a/dts/vendor/nordic/nrf52840_partition.dtsi +++ b/dts/vendor/nordic/nrf52840_partition.dtsi @@ -20,12 +20,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000c000>; + reg = <0x00000000 0x0000C000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00076000>; + reg = <0x0000C000 0x00076000>; }; slot1_partition: partition@82000 { diff --git a/dts/vendor/nordic/nrf52840_partition_uf2_sdv6.dtsi b/dts/vendor/nordic/nrf52840_partition_uf2_sdv6.dtsi index 6acdb0e690ab..9c12d7f82f59 100644 --- a/dts/vendor/nordic/nrf52840_partition_uf2_sdv6.dtsi +++ b/dts/vendor/nordic/nrf52840_partition_uf2_sdv6.dtsi @@ -38,7 +38,7 @@ code_partition: partition@26000 { label = "Application"; - reg = <0x00026000 0x000c6000>; + reg = <0x00026000 0x000C6000>; }; storage_partition: partition@ec000 { diff --git a/dts/vendor/nordic/nrf52840_partition_uf2_sdv7.dtsi b/dts/vendor/nordic/nrf52840_partition_uf2_sdv7.dtsi index 72530f7f4be4..c7f5e0d5e20e 100644 --- a/dts/vendor/nordic/nrf52840_partition_uf2_sdv7.dtsi +++ b/dts/vendor/nordic/nrf52840_partition_uf2_sdv7.dtsi @@ -36,7 +36,7 @@ code_partition: partition@27000 { label = "Application"; - reg = <0x00027000 0x000c5000>; + reg = <0x00027000 0x000C5000>; }; storage_partition: partition@ec000 { diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index f40b202fbba2..84fced0f1bcf 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -606,28 +606,28 @@ reg = <0x9000 0x1000>; }; - atbreplicator212: atbreplicator@a000 { - reg = <0xa000 0x1000>; + atbreplicator212: atbreplicator@A000 { + reg = <0xA000 0x1000>; }; - atbreplicator213: atbreplicator@b000 { - reg = <0xb000 0x1000>; + atbreplicator213: atbreplicator@B000 { + reg = <0xB000 0x1000>; }; - atbfunnel210: atbfunnel@c000 { - reg = <0xc000 0x1000>; + atbfunnel210: atbfunnel@C000 { + reg = <0xC000 0x1000>; }; - atbfunnel211: atbfunnel@d000 { - reg = <0xd000 0x1000>; + atbfunnel211: atbfunnel@D000 { + reg = <0xD000 0x1000>; }; - atbfunnel212: atbfunnel@e000 { - reg = <0xe000 0x1000>; + atbfunnel212: atbfunnel@E000 { + reg = <0xE000 0x1000>; }; - atbfunnel213: atbfunnel@f000 { - reg = <0xf000 0x1000>; + atbfunnel213: atbfunnel@F000 { + reg = <0xF000 0x1000>; }; }; }; diff --git a/dts/vendor/nordic/nrf54l10_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54l10_cpuapp_ns_partition.dtsi index 92bcd8bb8a30..b7b976463de0 100644 --- a/dts/vendor/nordic/nrf54l10_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54l10_cpuapp_ns_partition.dtsi @@ -65,14 +65,14 @@ reg = <0x00068000 DT_SIZE_K(8)>; }; - slot0_ns_partition: partition@6a000 { + slot0_ns_partition: partition@6A000 { label = "image-0-nonsecure"; - reg = <0x0006a000 DT_SIZE_K(556)>; + reg = <0x0006A000 DT_SIZE_K(556)>; }; - storage_partition: partition@f5000 { + storage_partition: partition@F5000 { label = "storage"; - reg = <0x000f5000 DT_SIZE_K(32)>; + reg = <0x000F5000 DT_SIZE_K(32)>; }; }; }; diff --git a/dts/vendor/nordic/nrf54l15_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54l15_cpuapp_ns_partition.dtsi index ab1f686caa24..2586516cfefb 100644 --- a/dts/vendor/nordic/nrf54l15_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54l15_cpuapp_ns_partition.dtsi @@ -76,9 +76,9 @@ reg = <0x00088000 DT_SIZE_K(8)>; }; - slot0_ns_partition: partition@8a000 { + slot0_ns_partition: partition@8A000 { label = "image-0-nonsecure"; - reg = <0x0008a000 DT_SIZE_K(940)>; + reg = <0x0008A000 DT_SIZE_K(940)>; }; storage_partition: partition@175000 { diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 351b4b959886..689d329eec96 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -109,10 +109,10 @@ /* FLPR/VPR is not used with TF-M so NS can use its memory */ cpuapp_sram: memory@20000000 { compatible = "mmio-sram"; - reg = <0x20000000 0x2007fe40>; + reg = <0x20000000 0x2007FE40>; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x20000000 0x2007fe40>; + ranges = <0x0 0x20000000 0x2007FE40>; }; #else cpuapp_sram: memory@20000000 { diff --git a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi index 5f5f974db565..38f4addb5184 100644 --- a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi @@ -77,14 +77,14 @@ reg = <0x00088000 DT_SIZE_K(8)>; }; - slot0_ns_partition: partition@8a000 { + slot0_ns_partition: partition@8A000 { label = "image-0-nonsecure"; - reg = <0x0008a000 DT_SIZE_K(1452)>; + reg = <0x0008A000 DT_SIZE_K(1452)>; }; - storage_partition: partition@1f5000 { + storage_partition: partition@1F5000 { label = "storage"; - reg = <0x001f5000 DT_SIZE_K(32)>; + reg = <0x001F5000 DT_SIZE_K(32)>; }; }; }; diff --git a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi index d8744c85db24..5e93a13c0c5e 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi @@ -78,14 +78,14 @@ reg = <0x00088000 DT_SIZE_K(8)>; }; - slot0_ns_partition: partition@8a000 { + slot0_ns_partition: partition@8A000 { label = "image-0-nonsecure"; - reg = <0x0008a000 DT_SIZE_K(844)>; + reg = <0x0008A000 DT_SIZE_K(844)>; }; - storage_partition: partition@15d000 { + storage_partition: partition@15D000 { label = "storage"; - reg = <0x00015d000 DT_SIZE_K(32)>; + reg = <0x00015D000 DT_SIZE_K(32)>; }; }; }; diff --git a/dts/vendor/raspberrypi/partitions_2M_sysbuild.dtsi b/dts/vendor/raspberrypi/partitions_2M_sysbuild.dtsi index 105bef5d5ce9..5172fb980a73 100644 --- a/dts/vendor/raspberrypi/partitions_2M_sysbuild.dtsi +++ b/dts/vendor/raspberrypi/partitions_2M_sysbuild.dtsi @@ -28,12 +28,12 @@ reg = <0x10000 0xd0000>; }; - slot1_partition: partition@e0000 { + slot1_partition: partition@E0000 { label = "image-1"; reg = <0xe0000 0xd0000>; }; - storage_partition: partition@1b0000 { + storage_partition: partition@1B0000 { label = "storage"; reg = <0x1b0000 0x50000>; }; diff --git a/dts/x86/intel/alder_lake.dtsi b/dts/x86/intel/alder_lake.dtsi index 825026523aad..f3455e7b8b22 100644 --- a/dts/x86/intel/alder_lake.dtsi +++ b/dts/x86/intel/alder_lake.dtsi @@ -74,7 +74,7 @@ gpio_c: gpio_c { acpi-hid = "INTC1057"; acpi-uid = "0"; - group-index = <0x0b>; + group-index = <0x0B>; int-stat-offset = <0x40>; int-en-offset = <0x20>; status = "okay"; @@ -92,7 +92,7 @@ gpio_e: gpio_e { acpi-hid = "INTC1057"; acpi-uid = "0"; - group-index = <0xe>; + group-index = <0xE>; int-stat-offset = <0x40>; int-en-offset = <0x20>; status = "okay"; @@ -101,7 +101,7 @@ gpio_f: gpio_f { acpi-hid = "INTC1057"; acpi-uid = "0"; - group-index = <0xc>; + group-index = <0xC>; int-stat-offset = <0x40>; int-en-offset = <0x20>; status = "okay"; @@ -155,7 +155,7 @@ gpio_v: gpio_v { acpi-hid = "INTC1057"; acpi-uid = "0"; - group-index = <0xa>; + group-index = <0xA>; int-stat-offset = <0x40>; int-en-offset = <0x20>; status = "okay"; @@ -205,7 +205,7 @@ uart1: uart1 { compatible = "ns16550"; vendor-id = <0x8086>; - device-id = <0x54a9>; + device-id = <0x54A9>; clock-frequency = <1843200>; current-speed = <115200>; reg-shift = <2>; @@ -225,7 +225,7 @@ uart2: uart2 { compatible = "ns16550"; vendor-id = <0x8086>; - device-id = <0x54c7>; + device-id = <0x54C7>; clock-frequency = <1843200>; current-speed = <115200>; reg-shift = <2>; @@ -366,7 +366,7 @@ emmc: emmc0 { compatible = "intel,emmc-host"; vendor-id = <0x8086>; - device-id = <0x54c4>; + device-id = <0x54C4>; interrupts = ; interrupt-parent = <&intc>; diff --git a/dts/x86/intel/raptor_lake_p.dtsi b/dts/x86/intel/raptor_lake_p.dtsi index bcd780cd9361..38b400baccd6 100644 --- a/dts/x86/intel/raptor_lake_p.dtsi +++ b/dts/x86/intel/raptor_lake_p.dtsi @@ -77,7 +77,7 @@ uart1: uart1 { compatible = "ns16550"; vendor-id = <0x8086>; - device-id = <0x51a9>; + device-id = <0x51A9>; reg-shift = <2>; clock-frequency = <1843200>; interrupts = ; diff --git a/dts/xtensa/espressif/esp32/esp32_common.dtsi b/dts/xtensa/espressif/esp32/esp32_common.dtsi index b3dc237ae0ea..0d44c6aa396d 100644 --- a/dts/xtensa/espressif/esp32/esp32_common.dtsi +++ b/dts/xtensa/espressif/esp32/esp32_common.dtsi @@ -200,7 +200,7 @@ }; rtc_timer: rtc_timer@3ff48004 { - reg = <0x3ff48004 0xc>; + reg = <0x3ff48004 0xC>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; @@ -256,7 +256,7 @@ uart2: uart@3ff6e000 { compatible = "espressif,esp32-uart"; - reg = <0x3ff6e000 0x400>; + reg = <0x3ff6E000 0x400>; interrupts = ; interrupt-parent = <&intc>; clocks = <&clock ESP32_UART2_MODULE>; @@ -397,7 +397,7 @@ trng0: trng@3ff75144 { compatible = "espressif,esp32-trng"; - reg = <0x3ff75144 0x4>; + reg = <0x3FF75144 0x4>; clocks = <&clock ESP32_RNG_MODULE>; status = "disabled"; }; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi index 8e91cc3a02ee..3b337d9089e5 100644 --- a/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi +++ b/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi @@ -153,7 +153,7 @@ }; rtc_timer: rtc_timer@3f408004 { - reg = <0x3f408004 0xc>; + reg = <0x3f408004 0xC>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi index 528c212c4065..2b9f09fb5885 100644 --- a/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi +++ b/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi @@ -194,7 +194,7 @@ }; rtc_timer: rtc_timer@60008004 { - reg = <0x60008004 0xc>; + reg = <0x60008004 0xC>; compatible = "espressif,esp32-rtc-timer"; clocks = <&clock ESP32_MODULE_MAX>; interrupts = ; diff --git a/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi b/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi index e70edd5b04b5..3c7b58089ec3 100644 --- a/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi @@ -103,9 +103,9 @@ #clock-cells = <0>; }; - IMR1: memory@a1000000 { + IMR1: memory@A1000000 { compatible = "intel,adsp-imr"; - reg = <0xa1000000 DT_SIZE_M(16)>; + reg = <0xA1000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -156,7 +156,7 @@ dmic0: dmic0@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0xc000>; + shim = <0xC000>; fifo = <0x0008>; interrupts = <0x08 0 0>; interrupt-parent = <&ace_intc>; @@ -167,7 +167,7 @@ dmic1: dmic1@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0xc000>; + shim = <0xC000>; fifo = <0x0108>; interrupts = <0x09 0 0>; interrupt-parent = <&ace_intc>; @@ -291,7 +291,7 @@ #size-cells = <0>; compatible = "intel,ssp"; reg = <0x00028000 0x1000 - 0x00079c00 0x200>; + 0x00079C00 0x200>; interrupts = <0x00 0 0>; interrupt-parent = <&ace_intc>; dmas = <&lpgpdma0 2 @@ -314,7 +314,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00029000 0x1000 - 0x00079c00 0x200>; + 0x00079C00 0x200>; interrupts = <0x01 0 0>; interrupt-parent = <&ace_intc>; dmas = <&lpgpdma0 4 @@ -337,7 +337,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x0002a000 0x1000 - 0x00079c00 0x200>; + 0x00079C00 0x200>; interrupts = <0x02 0 0>; interrupt-parent = <&ace_intc>; dmas = <&lpgpdma0 6 diff --git a/dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi b/dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi index a59247f55355..8a0c593a5646 100644 --- a/dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi @@ -117,9 +117,9 @@ #clock-cells = <0>; }; - IMR1: memory@a1000000 { + IMR1: memory@A1000000 { compatible = "intel,adsp-imr"; - reg = <0xa1000000 DT_SIZE_M(16)>; + reg = <0xA1000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -211,7 +211,7 @@ hdamlssp: hdamlssp@d00 { compatible = "intel,adsp-hda-ssp-cap"; - reg = <0xd00 0x40>; + reg = <0xD00 0x40>; status = "okay"; }; @@ -220,8 +220,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00028100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x00028c00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x00028C00 0x1000>; interrupts = <0x00 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 1 @@ -244,8 +244,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00029100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x00029c00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x00029C00 0x1000>; interrupts = <0x01 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 2 @@ -268,8 +268,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x0002a100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x0002ac00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x0002AC00 0x1000>; interrupts = <0x02 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 3 diff --git a/dts/xtensa/intel/intel_adsp_ace30.dtsi b/dts/xtensa/intel/intel_adsp_ace30.dtsi index 38470e583a4f..16f38b8b81be 100644 --- a/dts/xtensa/intel/intel_adsp_ace30.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace30.dtsi @@ -97,9 +97,9 @@ #clock-cells = <0>; }; - IMR1: memory@a1000000 { + IMR1: memory@A1000000 { compatible = "intel,adsp-imr"; - reg = <0xa1000000 DT_SIZE_M(16)>; + reg = <0xA1000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -188,7 +188,7 @@ hdamlssp: hdamlssp@d00 { compatible = "intel,adsp-hda-ssp-cap"; - reg = <0xd00 0x40>; + reg = <0xD00 0x40>; status = "okay"; }; @@ -197,8 +197,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00028100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x00028c00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x00028C00 0x1000>; interrupts = <0x00 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 1 @@ -277,8 +277,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00029100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x00029c00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x00029C00 0x1000>; interrupts = <0x01 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 2 @@ -357,8 +357,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x0002a100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x0002ac00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x0002AC00 0x1000>; interrupts = <0x02 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 3 diff --git a/dts/xtensa/intel/intel_adsp_ace40.dtsi b/dts/xtensa/intel/intel_adsp_ace40.dtsi index 81726d5d2307..4d16803d6b90 100644 --- a/dts/xtensa/intel/intel_adsp_ace40.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace40.dtsi @@ -90,9 +90,9 @@ #clock-cells = <0>; }; - IMR1: memory@a1000000 { + IMR1: memory@A1000000 { compatible = "intel,adsp-imr"; - reg = <0xa1000000 DT_SIZE_M(16)>; + reg = <0xA1000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -181,7 +181,7 @@ hdamlssp: hdamlssp@d00 { compatible = "intel,adsp-hda-ssp-cap"; - reg = <0xd00 0x40>; + reg = <0xD00 0x40>; status = "okay"; }; @@ -190,8 +190,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00028100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x00028c00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x00028C00 0x1000>; interrupts = <0x00 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 1 @@ -270,8 +270,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00029100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x00029c00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x00029C00 0x1000>; interrupts = <0x01 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 2 @@ -350,8 +350,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x0002a100 0x1000 - 0x00079c00 0x200>; - i2svss = <0x0002ac00 0x1000>; + 0x00079C00 0x200>; + i2svss = <0x0002AC00 0x1000>; interrupts = <0x02 0 0>; interrupt-parent = <&ace_intc>; dmas = <&hda_link_out 3 diff --git a/dts/xtensa/intel/intel_adsp_cavs.dtsi b/dts/xtensa/intel/intel_adsp_cavs.dtsi index 1188ef891427..b7b3e145961e 100644 --- a/dts/xtensa/intel/intel_adsp_cavs.dtsi +++ b/dts/xtensa/intel/intel_adsp_cavs.dtsi @@ -26,7 +26,7 @@ #dma-cells = <1>; reg = <0x0007d000 0x1000>; shim = <0x00078500 0x100>; - interrupts = <0x0f 0 0>; + interrupts = <0x0F 0 0>; interrupt-parent = <&cavs_intc3>; dma-buf-size-alignment = <4>; dma-copy-alignment = <4>; diff --git a/dts/xtensa/intel/intel_adsp_cavs25.dtsi b/dts/xtensa/intel/intel_adsp_cavs25.dtsi index fe95613e9fca..55be6d267bdf 100644 --- a/dts/xtensa/intel/intel_adsp_cavs25.dtsi +++ b/dts/xtensa/intel/intel_adsp_cavs25.dtsi @@ -101,7 +101,7 @@ IMR1: memory@b0000000 { compatible = "intel,adsp-imr"; - reg = <0xb0000000 DT_SIZE_M(16)>; + reg = <0xB0000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -157,7 +157,7 @@ sspbase: ssp_base@71c00 { compatible = "intel,cavs-sspbase"; - reg = <0x71c00 0x100>; + reg = <0x71C00 0x100>; }; l2lm: l2lm@71d00 { @@ -193,7 +193,7 @@ reg = <0x78810 0x10>; interrupt-controller; #interrupt-cells = <3>; - interrupts = <0xa 0 0>; + interrupts = <0xA 0 0>; interrupt-parent = <&core_intc>; }; @@ -202,7 +202,7 @@ reg = <0x78820 0x10>; interrupt-controller; #interrupt-cells = <3>; - interrupts = <0xd 0 0>; + interrupts = <0XD 0 0>; interrupt-parent = <&core_intc>; }; @@ -233,7 +233,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077000 0x200 - 0x00078c00 0x008>; + 0x00078C00 0x008>; interrupts = <0x01 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 2 @@ -254,7 +254,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077200 0x200 - 0x00078c00 0x008>; + 0x00078C00 0x008>; interrupts = <0x01 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 4 @@ -275,7 +275,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077400 0x200 - 0x00078c00 0x008>; + 0x00078C00 0x008>; interrupts = <0x02 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 6 @@ -296,7 +296,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077600 0x200 - 0x00078c00 0x008>; + 0x00078C00 0x008>; interrupts = <0x03 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 8 @@ -317,7 +317,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077800 0x200 - 0x00078c00 0x008>; + 0x00078C00 0x008>; interrupts = <0x03 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 10 @@ -337,8 +337,8 @@ compatible = "intel,ssp"; #address-cells = <1>; #size-cells = <0>; - reg = <0x00077a00 0x200 - 0x00078c00 0x008>; + reg = <0x00077A00 0x200 + 0x00078C00 0x008>; interrupts = <0x03 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 12 @@ -460,7 +460,7 @@ dmic0: dmic0@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0x71e80>; + shim = <0x71E80>; fifo = <0x0008>; interrupts = <0x08 0 0>; interrupt-parent = <&cavs_intc3>; @@ -469,7 +469,7 @@ dmic1: dmic1@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0x71e80>; + shim = <0x71E80>; fifo = <0x0108>; interrupts = <0x09 0 0>; interrupt-parent = <&cavs_intc3>; diff --git a/dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi b/dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi index 4a50211f11d1..d1dfd067f44d 100644 --- a/dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi +++ b/dts/xtensa/intel/intel_adsp_cavs25_tgph.dtsi @@ -86,7 +86,7 @@ IMR1: memory@b0000000 { compatible = "intel,adsp-imr"; - reg = <0xb0000000 DT_SIZE_M(16)>; + reg = <0xB0000000 DT_SIZE_M(16)>; block-size = <0x1000>; zephyr,memory-region = "IMR1"; }; @@ -178,7 +178,7 @@ reg = <0x78810 0x10>; interrupt-controller; #interrupt-cells = <3>; - interrupts = <0xa 0 0>; + interrupts = <0xA 0 0>; interrupt-parent = <&core_intc>; }; @@ -187,7 +187,7 @@ reg = <0x78820 0x10>; interrupt-controller; #interrupt-cells = <3>; - interrupts = <0xd 0 0>; + interrupts = <0XD 0 0>; interrupt-parent = <&core_intc>; }; @@ -216,7 +216,7 @@ dmic0: dmic0@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0x71e80>; + shim = <0x71E80>; fifo = <0x0008>; interrupts = <0x08 0 0>; interrupt-parent = <&cavs_intc3>; @@ -225,7 +225,7 @@ dmic1: dmic1@10000 { compatible = "intel,dai-dmic"; reg = <0x10000 0x8000>; - shim = <0x71e80>; + shim = <0x71E80>; fifo = <0x0108>; interrupts = <0x09 0 0>; interrupt-parent = <&cavs_intc3>; @@ -257,7 +257,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077000 0x200 - 0x00078c00 0x008>; + 0x00078C00 0x008>; interrupts = <0x01 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 2 @@ -278,7 +278,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077200 0x200 - 0x00078c00 0x008>; + 0x00078C00 0x008>; interrupts = <0x01 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 4 @@ -299,7 +299,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x00077400 0x200 - 0x00078c00 0x008>; + 0x00078C00 0x008>; interrupts = <0x02 0 0>; interrupt-parent = <&cavs_intc3>; dmas = <&lpgpdma0 6 diff --git a/samples/basic/blinky_pwm/boards/frdm_mcxc242.overlay b/samples/basic/blinky_pwm/boards/frdm_mcxc242.overlay index 57dad865deff..09c1ccb22ad9 100644 --- a/samples/basic/blinky_pwm/boards/frdm_mcxc242.overlay +++ b/samples/basic/blinky_pwm/boards/frdm_mcxc242.overlay @@ -5,9 +5,9 @@ */ &tpm1 { - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 25>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 25>; }; &tpm2 { - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 26>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 26>; }; diff --git a/samples/boards/renesas/openamp_linux_zephyr/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay b/samples/boards/renesas/openamp_linux_zephyr/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay index a38830ce789a..cc545f79b7e5 100644 --- a/samples/boards/renesas/openamp_linux_zephyr/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay +++ b/samples/boards/renesas/openamp_linux_zephyr/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay @@ -14,9 +14,9 @@ #size-cells = <1>; ranges; - openamp_shm: memory-region@62f00000 { + openamp_shm: memory-region@62F00000 { compatible = "zephyr,memory-region"; - reg = <0x62f00000 0x600000>; + reg = <0x62F00000 0x600000>; zephyr,memory-region = "openamp_memory"; zephyr,memory-attr = ; }; @@ -42,29 +42,29 @@ reg = <0x63200000 0x300000>; }; - rsctbl: memory@62f00000 { + rsctbl: memory@62F00000 { compatible = "mmio-sram"; - reg = <0x62f00000 0x1000>; + reg = <0x62F00000 0x1000>; }; - mhu1_shm: memory@62f01008 { + mhu1_shm: memory@62F01008 { compatible = "mmio-sram"; - reg = <0x62f01008 0x8>; + reg = <0x62F01008 0x8>; }; - mhu3_shm: memory@62f01018 { + mhu3_shm: memory@62F01018 { compatible = "mmio-sram"; - reg = <0x62f01018 0x8>; + reg = <0x62F01018 0x8>; }; - mhu4_shm: memory@62f01020 { + mhu4_shm: memory@62F01020 { compatible = "mmio-sram"; - reg = <0x62f01020 0x8>; + reg = <0x62F01020 0x8>; }; - mhu5_shm: memory@62f01028 { + mhu5_shm: memory@62F01028 { compatible = "mmio-sram"; - reg = <0x62f01028 0x8>; + reg = <0x62F01028 0x8>; }; mbox_consumer: mbox-consumer { diff --git a/samples/boards/renesas/openamp_linux_zephyr/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay b/samples/boards/renesas/openamp_linux_zephyr/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay index fb7908b31685..e4176fc9f3a7 100644 --- a/samples/boards/renesas/openamp_linux_zephyr/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay +++ b/samples/boards/renesas/openamp_linux_zephyr/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay @@ -13,9 +13,9 @@ #size-cells = <1>; ranges; - openamp_shm: memory-region@62f00000 { + openamp_shm: memory-region@62F00000 { compatible = "zephyr,memory-region"; - reg = <0x62f00000 0x900000>; + reg = <0x62F00000 0x900000>; zephyr,memory-region = "openamp_memory"; zephyr,memory-attr = ; }; @@ -41,29 +41,29 @@ reg = <0x63200000 0x300000>; }; - rsctbl: memory@62f00000 { + rsctbl: memory@62F00000 { compatible = "mmio-sram"; - reg = <0x62f00000 0x1000>; + reg = <0x62F00000 0x1000>; }; - mhu1_shm: memory@62f01008 { + mhu1_shm: memory@62F01008 { compatible = "mmio-sram"; - reg = <0x62f01008 0x8>; + reg = <0x62F01008 0x8>; }; - mhu3_shm: memory@62f01018 { + mhu3_shm: memory@62F01018 { compatible = "mmio-sram"; - reg = <0x62f01018 0x8>; + reg = <0x62F01018 0x8>; }; - mhu4_shm: memory@62f01020 { + mhu4_shm: memory@62F01020 { compatible = "mmio-sram"; - reg = <0x62f01020 0x8>; + reg = <0x62F01020 0x8>; }; - mhu5_shm: memory@62f01028 { + mhu5_shm: memory@62F01028 { compatible = "mmio-sram"; - reg = <0x62f01028 0x8>; + reg = <0x62F01028 0x8>; }; mbox_consumer: mbox-consumer { diff --git a/samples/drivers/adc/adc_sequence/boards/stm32f3_disco.overlay b/samples/drivers/adc/adc_sequence/boards/stm32f3_disco.overlay index 89a595aefc88..84a8957c6500 100644 --- a/samples/drivers/adc/adc_sequence/boards/stm32f3_disco.overlay +++ b/samples/drivers/adc/adc_sequence/boards/stm32f3_disco.overlay @@ -26,8 +26,8 @@ #size-cells = <0>; /* INPUTx mapping bits [9:0] for CH0 to CH15 */ - map-inputs = <0x10 0x30 0x50 0x70 0x90 0xb0 0xd0 0xf0 0x110 - 0x130 0x150 0x170 0x190 0x1b0 0x1d0 0x1f0>; + map-inputs = <0x10 0x30 0x50 0x70 0x90 0xB0 0xD0 0xF0 0x110 + 0x130 0x150 0x170 0x190 0x1B0 0x1D0 0x1F0>; channel@0 { reg = <0x0>; diff --git a/samples/drivers/ethernet/eth_ivshmem/boards/qemu_cortex_a53.overlay b/samples/drivers/ethernet/eth_ivshmem/boards/qemu_cortex_a53.overlay index 17aaa71db3d2..775ffa3b48f1 100644 --- a/samples/drivers/ethernet/eth_ivshmem/boards/qemu_cortex_a53.overlay +++ b/samples/drivers/ethernet/eth_ivshmem/boards/qemu_cortex_a53.overlay @@ -48,10 +48,10 @@ ivshmem0: ivshmem@0 { compatible = "qemu,ivshmem"; ivshmem-v2; - vendor-id = <0x110a>; /* Siemens */ + vendor-id = <0x110A>; /* Siemens */ device-id = <0x4106>; /* IVSHMEM */ - class-rev = <0xff000100>; /* PCI_CLASS_OTHERS | IVSHMEM_PROTO_NET */ - class-rev-mask = <0xffffff00>; /* PCI_CLASS_MASK | IVSHMEM_PROTO_MASK */ + class-rev = <0xFF000100>; /* PCI_CLASS_OTHERS | IVSHMEM_PROTO_NET */ + class-rev-mask = <0xFFFFFF00>; /* PCI_CLASS_MASK | IVSHMEM_PROTO_MASK */ interrupt-parent = <&pcie>; interrupts = <1 2 3 4>; reg = <0x00 0x00 0x00 0x00 0x01>; diff --git a/samples/drivers/led/pwm/boards/frdm_mcxc242.overlay b/samples/drivers/led/pwm/boards/frdm_mcxc242.overlay index 8ad1757a6bee..eaee9d6959b0 100644 --- a/samples/drivers/led/pwm/boards/frdm_mcxc242.overlay +++ b/samples/drivers/led/pwm/boards/frdm_mcxc242.overlay @@ -15,9 +15,9 @@ }; &tpm1 { - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 25>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 25>; }; &tpm2 { - clocks = <&sim KINETIS_SIM_OSCERCLK 0x103c 26>; + clocks = <&sim KINETIS_SIM_OSCERCLK 0x103C 26>; }; diff --git a/samples/drivers/mbox/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay b/samples/drivers/mbox/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay index 233dcff5e042..e02fb726cb9a 100644 --- a/samples/drivers/mbox/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay +++ b/samples/drivers/mbox/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xec>; + reg = <0x5008b000 0xEC>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/drivers/mbox/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay b/samples/drivers/mbox/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay index a0474c44c6ef..6c40b6b4e286 100644 --- a/samples/drivers/mbox/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay +++ b/samples/drivers/mbox/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay @@ -21,7 +21,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mbox@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xec>; + reg = <0x5008b000 0xEC>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/drivers/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay b/samples/drivers/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay index 9e5b871b78e4..df5656467da2 100644 --- a/samples/drivers/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay +++ b/samples/drivers/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xec>; + reg = <0x5008b000 0xEC>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/drivers/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay b/samples/drivers/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay index d3667fefd307..2b183cbb148a 100644 --- a/samples/drivers/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay +++ b/samples/drivers/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mbox@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xec>; + reg = <0x5008b000 0xEC>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/drivers/memc/boards/apollo3p_evb.overlay b/samples/drivers/memc/boards/apollo3p_evb.overlay index 10e6a757d5d5..8694986e7a7b 100644 --- a/samples/drivers/memc/boards/apollo3p_evb.overlay +++ b/samples/drivers/memc/boards/apollo3p_evb.overlay @@ -40,7 +40,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xeb>; + read-command = <0xEB>; write-command = <0x38>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_3_BYTE"; diff --git a/samples/drivers/mspi/mspi_async/boards/apollo3p_evb.overlay b/samples/drivers/mspi/mspi_async/boards/apollo3p_evb.overlay index a3e7177799c5..5f1213f38e83 100644 --- a/samples/drivers/mspi/mspi_async/boards/apollo3p_evb.overlay +++ b/samples/drivers/mspi/mspi_async/boards/apollo3p_evb.overlay @@ -40,7 +40,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xeb>; + read-command = <0xEB>; write-command = <0x38>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_3_BYTE"; diff --git a/samples/drivers/mspi/mspi_flash/boards/apollo3p_evb.overlay b/samples/drivers/mspi/mspi_flash/boards/apollo3p_evb.overlay index 190f63e2e159..b1314b49e65b 100644 --- a/samples/drivers/mspi/mspi_flash/boards/apollo3p_evb.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/apollo3p_evb.overlay @@ -41,7 +41,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xeb>; + read-command = <0xEB>; write-command = <0x38>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_3_BYTE"; @@ -62,7 +62,7 @@ mspi-io-mode = "MSPI_IO_MODE_OCTAL"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0x0b>; + read-command = <0x0B>; write-command = <0x02>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; diff --git a/samples/drivers/mspi/mspi_flash/boards/b_u585i_iot02a.overlay b/samples/drivers/mspi/mspi_flash/boards/b_u585i_iot02a.overlay index e84050df2281..eeb536a00f37 100644 --- a/samples/drivers/mspi/mspi_flash/boards/b_u585i_iot02a.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/b_u585i_iot02a.overlay @@ -45,9 +45,9 @@ mspi-io-mode = "MSPI_IO_MODE_OCTAL"; mspi-data-rate = "MSPI_DATA_RATE_DUAL"; /* as first step */ mspi-hardware-ce-num = <0>; - read-command = <0xee11>; /* ReaD 4Bytes */ + read-command = <0xEE11>; /* ReaD 4Bytes */ command-length = "INSTR_2_BYTE"; - write-command = <0x12ed>; /* WRite 4Bytes */ + write-command = <0x12ED>; /* WRite 4Bytes */ rx-dummy = <20>; jedec-id = [c2 85 3a]; status = "okay"; diff --git a/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay b/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay index 3ac04886111a..cd37ec69d24c 100644 --- a/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay @@ -42,8 +42,8 @@ reg = <0>; size = ; /* 512 Mbits */ status = "okay"; - read-command = <0xee11>; - write-command = <0x12ed>; + read-command = <0xEE11>; + write-command = <0x12ED>; rx-dummy = <20>; mspi-max-frequency = ; mspi-io-mode = "MSPI_IO_MODE_OCTAL"; diff --git a/samples/drivers/mspi/mspi_flash/boards/stm32h735g_disco.overlay b/samples/drivers/mspi/mspi_flash/boards/stm32h735g_disco.overlay index 21435902a9e2..5f4ad6c0d6ce 100644 --- a/samples/drivers/mspi/mspi_flash/boards/stm32h735g_disco.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/stm32h735g_disco.overlay @@ -42,8 +42,8 @@ mspi-io-mode = "MSPI_IO_MODE_OCTAL"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xec13>; - write-command = <0x12ed>; + read-command = <0xEC13>; + write-command = <0x12ED>; command-length = "INSTR_2_BYTE"; rx-dummy = <20>; jedec-id = [c2 85 3a]; diff --git a/samples/drivers/mspi/mspi_flash/boards/stm32l496g_disco.overlay b/samples/drivers/mspi/mspi_flash/boards/stm32l496g_disco.overlay index 4fbe529b72d1..8a711b4109b8 100644 --- a/samples/drivers/mspi/mspi_flash/boards/stm32l496g_disco.overlay +++ b/samples/drivers/mspi/mspi_flash/boards/stm32l496g_disco.overlay @@ -44,7 +44,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD_1_4_4"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0xeb>; + read-command = <0xEB>; write-command = <0x38>; /* PP_1_4_4 */ mspi-hardware-ce-num = <0>; command-length = "INSTR_1_BYTE"; diff --git a/samples/drivers/pwm/capture/boards/lp_mspm0g3507.overlay b/samples/drivers/pwm/capture/boards/lp_mspm0g3507.overlay index 05b944c33c59..0e1422ab2d62 100644 --- a/samples/drivers/pwm/capture/boards/lp_mspm0g3507.overlay +++ b/samples/drivers/pwm/capture/boards/lp_mspm0g3507.overlay @@ -25,7 +25,7 @@ pinctrl-names = "default"; ti,cc-index = <0>; ti,cc-mode = "PULSE_WIDTH"; - ti,period = <0xffff>; + ti,period = <0xFFFF>; status = "okay"; }; }; diff --git a/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay b/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay index bbdf36d6eeca..2ecd7e172c64 100644 --- a/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay +++ b/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay @@ -7,9 +7,9 @@ &i2c2 { clock-frequency = ; - fdc2x1x@2a { + fdc2x1x@2A { compatible = "ti,fdc2x1x"; - reg = <0x2a>; + reg = <0x2A>; sd-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; intb-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; diff --git a/samples/sensor/tmp11x/boards/nucleo_f401re.overlay b/samples/sensor/tmp11x/boards/nucleo_f401re.overlay index 85840214f403..3a7b18daeed7 100644 --- a/samples/sensor/tmp11x/boards/nucleo_f401re.overlay +++ b/samples/sensor/tmp11x/boards/nucleo_f401re.overlay @@ -7,7 +7,7 @@ &i2c1 { ti_tmp11x: ti_tmp11x@4b { compatible = "ti,tmp11x"; - reg = <0x4b>; + reg = <0x4B>; #address-cells = <1>; #size-cells = <0>; diff --git a/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay b/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay index fe4e532b471c..28d54e79132d 100644 --- a/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay +++ b/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay @@ -22,7 +22,7 @@ #size-cells = <1>; slot0_partition: partition@c000 { - reg = <0x0000c000 0x00066000>; + reg = <0x0000C000 0x00066000>; }; slot1_partition: partition@72000 { diff --git a/samples/subsys/instrumentation/boards/mps2_an385.overlay b/samples/subsys/instrumentation/boards/mps2_an385.overlay index 8fa07f12b577..adccb6d44909 100644 --- a/samples/subsys/instrumentation/boards/mps2_an385.overlay +++ b/samples/subsys/instrumentation/boards/mps2_an385.overlay @@ -30,5 +30,5 @@ }; &sram0 { - reg = <0x20000000 0x3fffe0>; + reg = <0x20000000 0x3FFFE0>; }; 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 d43b27afd242..c0381229f999 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 @@ -27,8 +27,8 @@ reg = <0x20078000 0x4000>; }; - sram_ipc1_rx: memory@2007c000 { - reg = <0x2007c000 0x4000>; + sram_ipc1_rx: memory@2007C000 { + reg = <0x2007C000 0x4000>; }; }; 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 9cc591856ebd..bf5df3e3881d 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 @@ -27,8 +27,8 @@ reg = <0x20078000 0x4000>; }; - sram_ipc1_rx: memory@2007c000 { - reg = <0x2007c000 0x4000>; + sram_ipc1_rx: memory@2007C000 { + reg = <0x2007C000 0x4000>; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index acb7ec4356c0..812f3bdb1e12 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -15,8 +15,8 @@ reg = <0x2f0bf800 DT_SIZE_K(1)>; }; - cpurad_cpuapp_ipc_shm_b: memory@2f0bfc00 { - reg = <0x2f0bfc00 DT_SIZE_K(1)>; + cpurad_cpuapp_ipc_shm_b: memory@2f0bfC00 { + reg = <0x2f0bfC00 DT_SIZE_K(1)>; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay index b5efc051c0ba..63e1d6a03a08 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -27,8 +27,8 @@ reg = <0x20078000 0x4000>; }; - sram_ipc1_tx: memory@2007c000 { - reg = <0x2007c000 0x4000>; + sram_ipc1_tx: memory@2007C000 { + reg = <0x2007C000 0x4000>; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay index 97b89152ffdf..39f513954ffb 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay @@ -27,8 +27,8 @@ reg = <0x20078000 0x4000>; }; - sram_ipc1_tx: memory@2007c000 { - reg = <0x2007c000 0x4000>; + sram_ipc1_tx: memory@2007C000 { + reg = <0x2007C000 0x4000>; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay index 11fbaa605fee..74ffd9ab56e1 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -15,8 +15,8 @@ reg = <0x2f0bf800 DT_SIZE_K(1)>; }; - cpurad_cpuapp_ipc_shm_b: memory@2f0bfc00 { - reg = <0x2f0bfc00 DT_SIZE_K(1)>; + cpurad_cpuapp_ipc_shm_b: memory@2f0bfC00 { + reg = <0x2f0bfC00 DT_SIZE_K(1)>; }; }; diff --git a/samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay b/samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay index 4806a4123046..45f164e26df1 100644 --- a/samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay +++ b/samples/subsys/ipc/ipc_service/static_vrings/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay @@ -40,7 +40,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xec>; + reg = <0x5008b000 0xEC>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay b/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay index 9df3b6bf78e1..513a78be7711 100644 --- a/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay +++ b/samples/subsys/ipc/ipc_service/static_vrings/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay @@ -40,7 +40,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xec>; + reg = <0x5008b000 0xEC>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/samples/subsys/ipc/openamp/boards/frdm_mcxn947_mcxn947_cpu0.overlay b/samples/subsys/ipc/openamp/boards/frdm_mcxn947_mcxn947_cpu0.overlay index e2acdcdacf8f..ec9bbbc46525 100644 --- a/samples/subsys/ipc/openamp/boards/frdm_mcxn947_mcxn947_cpu0.overlay +++ b/samples/subsys/ipc/openamp/boards/frdm_mcxn947_mcxn947_cpu0.overlay @@ -20,7 +20,7 @@ soc { mailbox0: mailbox@400b2000 { compatible = "nxp,lpc-mailbox"; - reg = <0x400b2000 0xec>; + reg = <0x400b2000 0xEC>; interrupts = <54 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "okay"; diff --git a/samples/subsys/ipc/openamp/boards/mcx_n9xx_evk_mcxn947_cpu0.overlay b/samples/subsys/ipc/openamp/boards/mcx_n9xx_evk_mcxn947_cpu0.overlay index e2acdcdacf8f..ec9bbbc46525 100644 --- a/samples/subsys/ipc/openamp/boards/mcx_n9xx_evk_mcxn947_cpu0.overlay +++ b/samples/subsys/ipc/openamp/boards/mcx_n9xx_evk_mcxn947_cpu0.overlay @@ -20,7 +20,7 @@ soc { mailbox0: mailbox@400b2000 { compatible = "nxp,lpc-mailbox"; - reg = <0x400b2000 0xec>; + reg = <0x400b2000 0xEC>; interrupts = <54 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "okay"; diff --git a/samples/subsys/ipc/openamp/boards/mps2_an521_cpu0.overlay b/samples/subsys/ipc/openamp/boards/mps2_an521_cpu0.overlay index 3e50ce23c8b1..ea8b8d6a0c71 100644 --- a/samples/subsys/ipc/openamp/boards/mps2_an521_cpu0.overlay +++ b/samples/subsys/ipc/openamp/boards/mps2_an521_cpu0.overlay @@ -13,8 +13,8 @@ zephyr,ipc = &mhu0; }; - sramx: memory@281f8000 { + sramx: memory@281F8000 { compatible = "mmio-sram"; - reg = <0x281f8000 0x8000>; + reg = <0x281F8000 0x8000>; }; }; diff --git a/samples/subsys/ipc/openamp/remote/boards/frdm_mcxn947_mcxn947_cpu1.overlay b/samples/subsys/ipc/openamp/remote/boards/frdm_mcxn947_mcxn947_cpu1.overlay index e2acdcdacf8f..ec9bbbc46525 100644 --- a/samples/subsys/ipc/openamp/remote/boards/frdm_mcxn947_mcxn947_cpu1.overlay +++ b/samples/subsys/ipc/openamp/remote/boards/frdm_mcxn947_mcxn947_cpu1.overlay @@ -20,7 +20,7 @@ soc { mailbox0: mailbox@400b2000 { compatible = "nxp,lpc-mailbox"; - reg = <0x400b2000 0xec>; + reg = <0x400b2000 0xEC>; interrupts = <54 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "okay"; diff --git a/samples/subsys/ipc/openamp/remote/boards/mcx_n9xx_evk_mcxn947_cpu1.overlay b/samples/subsys/ipc/openamp/remote/boards/mcx_n9xx_evk_mcxn947_cpu1.overlay index e2acdcdacf8f..ec9bbbc46525 100644 --- a/samples/subsys/ipc/openamp/remote/boards/mcx_n9xx_evk_mcxn947_cpu1.overlay +++ b/samples/subsys/ipc/openamp/remote/boards/mcx_n9xx_evk_mcxn947_cpu1.overlay @@ -20,7 +20,7 @@ soc { mailbox0: mailbox@400b2000 { compatible = "nxp,lpc-mailbox"; - reg = <0x400b2000 0xec>; + reg = <0x400b2000 0xEC>; interrupts = <54 0>; resets = <&reset NXP_SYSCON_RESET(0, 26)>; status = "okay"; diff --git a/samples/subsys/ipc/openamp/remote/boards/mps2_an521_cpu1.overlay b/samples/subsys/ipc/openamp/remote/boards/mps2_an521_cpu1.overlay index 3e50ce23c8b1..ea8b8d6a0c71 100644 --- a/samples/subsys/ipc/openamp/remote/boards/mps2_an521_cpu1.overlay +++ b/samples/subsys/ipc/openamp/remote/boards/mps2_an521_cpu1.overlay @@ -13,8 +13,8 @@ zephyr,ipc = &mhu0; }; - sramx: memory@281f8000 { + sramx: memory@281F8000 { compatible = "mmio-sram"; - reg = <0x281f8000 0x8000>; + reg = <0x281F8000 0x8000>; }; }; diff --git a/samples/subsys/ipc/rpmsg_service/boards/mps2_an521_cpu0.overlay b/samples/subsys/ipc/rpmsg_service/boards/mps2_an521_cpu0.overlay index 3e50ce23c8b1..ea8b8d6a0c71 100644 --- a/samples/subsys/ipc/rpmsg_service/boards/mps2_an521_cpu0.overlay +++ b/samples/subsys/ipc/rpmsg_service/boards/mps2_an521_cpu0.overlay @@ -13,8 +13,8 @@ zephyr,ipc = &mhu0; }; - sramx: memory@281f8000 { + sramx: memory@281F8000 { compatible = "mmio-sram"; - reg = <0x281f8000 0x8000>; + reg = <0x281F8000 0x8000>; }; }; diff --git a/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_cpu1.overlay b/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_cpu1.overlay index 0b332033d2e6..64ee92afb990 100644 --- a/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_cpu1.overlay +++ b/samples/subsys/ipc/rpmsg_service/remote/boards/mps2_an521_cpu1.overlay @@ -13,8 +13,8 @@ zephyr,ipc = &mhu0; }; - sramx: memory@281f8000 { + sramx: memory@281F8000 { compatible = "mmio-sram"; - reg = <0x281f8000 0x8000>; + reg = <0x281F8000 0x8000>; }; }; diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/boards/mimxrt1050_evk_hyperflash_ram_load.overlay b/samples/subsys/mgmt/mcumgr/smp_svr/boards/mimxrt1050_evk_hyperflash_ram_load.overlay index 81d3a3e23ebc..7e78f22e078c 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/boards/mimxrt1050_evk_hyperflash_ram_load.overlay +++ b/samples/subsys/mgmt/mcumgr/smp_svr/boards/mimxrt1050_evk_hyperflash_ram_load.overlay @@ -12,9 +12,9 @@ /delete-node/ &sdram0; / { - sram@80007f00 { + sram@80007F00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x80007f00 0x100>; + reg = <0x80007F00 0x100>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/boards/nrf52840dk_nrf52840_ram_load.overlay b/samples/subsys/mgmt/mcumgr/smp_svr/boards/nrf52840dk_nrf52840_ram_load.overlay index 8607c157de60..aefc7bf148f6 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/boards/nrf52840dk_nrf52840_ram_load.overlay +++ b/samples/subsys/mgmt/mcumgr/smp_svr/boards/nrf52840dk_nrf52840_ram_load.overlay @@ -10,9 +10,9 @@ }; / { - sram@2003fc00 { + sram@2003FC00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003fc00 DT_SIZE_K(1)>; + reg = <0x2003FC00 DT_SIZE_K(1)>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/samples/subsys/usb/legacy/audio_headphones_microphone/app.overlay b/samples/subsys/usb/legacy/audio_headphones_microphone/app.overlay index 2f743ffd6851..f8c62efb775d 100644 --- a/samples/subsys/usb/legacy/audio_headphones_microphone/app.overlay +++ b/samples/subsys/usb/legacy/audio_headphones_microphone/app.overlay @@ -13,7 +13,7 @@ feature-volume; volume-max = <0x0500>; - volume-min = <0xba00>; + volume-min = <0xBA00>; volume-res = <0x100>; }; diff --git a/samples/subsys/usb/legacy/audio_headset/app.overlay b/samples/subsys/usb/legacy/audio_headset/app.overlay index a411f1cf7d16..91c153cd13ba 100644 --- a/samples/subsys/usb/legacy/audio_headset/app.overlay +++ b/samples/subsys/usb/legacy/audio_headset/app.overlay @@ -17,7 +17,7 @@ hp-feature-volume; volume-max = <0x0500>; - volume-min = <0xba00>; + volume-min = <0xBA00>; volume-res = <0x100>; }; }; diff --git a/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay b/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay index 2760c3f22ca8..1e481042ddf8 100644 --- a/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay +++ b/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay @@ -49,7 +49,7 @@ */ storage_partition: partition@77000 { label = "storage"; - reg = <0x0007f000 DT_SIZE_K(40)>; + reg = <0x0007F000 DT_SIZE_K(40)>; }; }; }; diff --git a/scripts/dts/python-devicetree/tests/test.dts b/scripts/dts/python-devicetree/tests/test.dts index 0a6b5ecfbc13..7a3ab8eb631e 100644 --- a/scripts/dts/python-devicetree/tests/test.dts +++ b/scripts/dts/python-devicetree/tests/test.dts @@ -159,7 +159,7 @@ nexus { #interrupt-cells = <2>; interrupt-map = <6 6 6 6 &{/interrupt-map-bitops-test/controller} 2 1>; - interrupt-map-mask = <0xe 0x7 0xe 0x7>; + interrupt-map-mask = <0xE 0x7 0xE 0x7>; // Not specified in the DT spec., but shows up due to // common code with GPIO. Might as well test it here. interrupt-map-pass-thru = <1 2 3 3>; @@ -168,10 +168,10 @@ // Child unit specifier: 00000007 0000000E 00000007 0000000E // Mask: 0000000E 00000007 0000000E 00000007 // Pass-thru: 00000001 00000002 00000003 00000003 - node@70000000e { - reg = <0x7 0xe>; + node@70000000E { + reg = <0x7 0xE>; interrupt-parent = <&{/interrupt-map-bitops-test/nexus}>; - interrupts = <0x7 0xe>; + interrupts = <0x7 0xE>; }; }; @@ -197,9 +197,9 @@ #address-cells = <1>; #size-cells = <0>; - ranges = <0xa>, - <0x1a>, - <0x2a>; + ranges = <0xA>, + <0x1A>, + <0x2A>; }; }; @@ -210,9 +210,9 @@ reg = <1>; #address-cells = <1>; - ranges = <0xa 0xb>, - <0x1a 0x1b>, - <0x2a 0x2b>; + ranges = <0xA 0xB>, + <0x1A 0x1B>, + <0x2A 0x2B>; }; }; @@ -224,9 +224,9 @@ #address-cells = <1>; #size-cells = <2>; - ranges = <0xa 0xb 0xc>, - <0x1a 0x1b 0x1c>, - <0x2a 0x2b 0x2c>; + ranges = <0xA 0xB 0xC>, + <0x1A 0x1B 0x1C>, + <0x2A 0x2B 0x2C>; }; }; @@ -236,9 +236,9 @@ node@1 { reg = <1 2>; - ranges = <0xa 0xb 0xc 0xd>, - <0x1a 0x1b 0x1c 0x1d>, - <0x2a 0x2b 0x2c 0x2d>; + ranges = <0xA 0xB 0xC 0xD>, + <0x1A 0x1B 0x1C 0x1D>, + <0x2A 0x2B 0x2C 0x2D>; }; }; @@ -249,9 +249,9 @@ reg = <1 2>; #size-cells = <2>; - ranges = <0xa 0xb 0xc 0xd 0xe>, - <0x1a 0x1b 0x1c 0x1d 0x1e>, - <0x2a 0x2b 0x2c 0x2d 0x1d>; + ranges = <0xA 0xB 0xC 0xD 0xE>, + <0x1A 0x1B 0x1C 0x1D 0x1E>, + <0x2A 0x2B 0x2C 0x2D 0x1D>; }; }; @@ -260,9 +260,9 @@ reg = <0 1 2>; #address-cells = <3>; - ranges = <0xa 0xb 0xc 0xd 0xe 0xf>, - <0x1a 0x1b 0x1c 0x1d 0x1e 0x1f>, - <0x2a 0x2b 0x2c 0x2d 0x2e 0x2f>; + ranges = <0xA 0xB 0xC 0xD 0xE 0xF>, + <0x1A 0x1B 0x1C 0x1D 0x1E 0x1F>, + <0x2A 0x2B 0x2C 0x2D 0x2E 0x2F>; }; }; @@ -272,9 +272,9 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0xa 0xb 0xc 0xd 0xe 0xf 0x10>, - <0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x110>, - <0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x210>; + ranges = <0xA 0xB 0xC 0xD 0xE 0xF 0x10>, + <0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x110>, + <0x2A 0x2B 0x2C 0x2D 0x2E 0x2F 0x210>; }; }; @@ -307,9 +307,9 @@ parent { #address-cells = <1>; - ranges = <1 0xa 0xb 1 /* 1 -> 0xA 0xB */ - 2 0xc 0xd 2 /* 2..3 -> 0xC 0xD */ - 4 0xe 0xf 1 /* 4 -> 0xE 0xF */ >; + ranges = <1 0xA 0xB 1 /* 1 -> 0xA 0xB */ + 2 0xC 0xD 2 /* 2..3 -> 0xC 0xD */ + 4 0xE 0xF 1 /* 4 -> 0xE 0xF */ >; node { reg = <5 1 /* Matches no range */ diff --git a/tests/application_development/ram_context_for_isr/app.overlay b/tests/application_development/ram_context_for_isr/app.overlay index 8d4a9e8af331..15899c033044 100644 --- a/tests/application_development/ram_context_for_isr/app.overlay +++ b/tests/application_development/ram_context_for_isr/app.overlay @@ -8,9 +8,9 @@ #address-cells = <1>; #size-cells = <1>; - fakedriver: fakedriver@e0000000 { + fakedriver: fakedriver@E0000000 { compatible = "fakedriver"; - reg = <0xe0000000 0x2000>; + reg = <0xE0000000 0x2000>; zephyr,mutable; status = "okay"; }; diff --git a/tests/arch/arm/arm_thread_swap_tz/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay b/tests/arch/arm/arm_thread_swap_tz/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay index 35b2bd51887f..6bab3bd65501 100644 --- a/tests/arch/arm/arm_thread_swap_tz/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay +++ b/tests/arch/arm/arm_thread_swap_tz/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay @@ -45,9 +45,9 @@ * The flash starting at 0x7F000 and ending at * 0x80000 is reserved for the application. */ - storage_partition: partition@7f000 { + storage_partition: partition@7F000 { label = "storage"; - reg = <0x0007f000 DT_SIZE_K(4)>; + reg = <0x0007F000 DT_SIZE_K(4)>; }; }; }; diff --git a/tests/boot/mcuboot_data_sharing/boards/nrf52840dk_nrf52840.overlay b/tests/boot/mcuboot_data_sharing/boards/nrf52840dk_nrf52840.overlay index 307d2b890fb0..a78f393b9ff3 100644 --- a/tests/boot/mcuboot_data_sharing/boards/nrf52840dk_nrf52840.overlay +++ b/tests/boot/mcuboot_data_sharing/boards/nrf52840dk_nrf52840.overlay @@ -5,9 +5,9 @@ /delete-property/ zephyr,boot-mode; }; - sram@2003fc00 { + sram@2003FC00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003fc00 DT_SIZE_K(1)>; + reg = <0x2003FC00 DT_SIZE_K(1)>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/boot/mcuboot_recovery_retention/boards/nrf52840dk_nrf52840_mem.overlay b/tests/boot/mcuboot_recovery_retention/boards/nrf52840dk_nrf52840_mem.overlay index a61ee5db8746..c7bd352f67f0 100644 --- a/tests/boot/mcuboot_recovery_retention/boards/nrf52840dk_nrf52840_mem.overlay +++ b/tests/boot/mcuboot_recovery_retention/boards/nrf52840dk_nrf52840_mem.overlay @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ / { - sram@2003fc00 { + sram@2003FC00 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003fc00 DT_SIZE_K(1)>; + reg = <0x2003FC00 DT_SIZE_K(1)>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts index 4df61070c6c9..8ae80025ee18 100644 --- a/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts +++ b/tests/cmake/hwm/board_extend/oot_root/boards/native/native_sim_extend/native_sim_native_one.dts @@ -75,12 +75,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000c000>; + reg = <0x00000000 0x0000C000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00069000>; + reg = <0x0000C000 0x00069000>; }; slot1_partition: partition@75000 { diff --git a/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.overlay b/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.overlay index a8f628978210..93dc828c7a03 100644 --- a/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.overlay +++ b/tests/drivers/build_all/comparator/nxp_cmp/frdm_mcxc242.overlay @@ -10,7 +10,7 @@ dac-vref-source = "VIN2"; dac-value = <31>; filter-count = <0x3>; - filter-period = <0xf>; + filter-period = <0xF>; hysteresis-mode = "LEVEL2"; enable-high-speed-mode; invert-output; diff --git a/tests/drivers/build_all/dac/app.overlay b/tests/drivers/build_all/dac/app.overlay index 7f3ab6fb9c8f..03fc52b3e4ec 100644 --- a/tests/drivers/build_all/dac/app.overlay +++ b/tests/drivers/build_all/dac/app.overlay @@ -231,7 +231,7 @@ test_spi_ad5676: ad5676@a { compatible = "adi,ad5676"; - reg = <0xa>; + reg = <0xA>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -239,7 +239,7 @@ test_spi_ad5679: ad5679@b { compatible = "adi,ad5679"; - reg = <0xb>; + reg = <0xB>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -247,7 +247,7 @@ test_spi_ad5684: ad5684@c { compatible = "adi,ad5684"; - reg = <0xc>; + reg = <0xC>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -255,7 +255,7 @@ test_spi_ad5686: ad5686@d { compatible = "adi,ad5686"; - reg = <0xd>; + reg = <0xD>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -263,7 +263,7 @@ test_spi_ad5687: ad5687@e { compatible = "adi,ad5687"; - reg = <0xe>; + reg = <0xE>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; @@ -271,7 +271,7 @@ test_spi_ad5689: ad5689@f { compatible = "adi,ad5689"; - reg = <0xf>; + reg = <0xF>; spi-max-frequency = <0>; #io-channel-cells = <1>; reset-gpios = <&test_gpio 0 0>; diff --git a/tests/drivers/build_all/display/app.overlay b/tests/drivers/build_all/display/app.overlay index 60e11d085049..f87b736713d4 100644 --- a/tests/drivers/build_all/display/app.overlay +++ b/tests/drivers/build_all/display/app.overlay @@ -53,8 +53,8 @@ /* Use dummy values for PCG and NGC, * As this won't drive a real panel */ - pgc = [f0 06 0b 07 06 05 2e 33 47 3a 17 16 2e 31]; - ngc = [f0 09 0d 09 08 23 2e 33 46 38 13 13 2c 32]; + pgc = [F0 06 0B 07 06 05 2E 33 47 3A 17 16 2E 31]; + ngc = [F0 09 0D 09 08 23 2E 33 46 38 13 13 2C 32]; }; test_mipi_dbi_st7735r: st7735t@2 { @@ -65,8 +65,8 @@ /* Arbitrary values */ x-offset = <0>; y-offset = <0>; - gamctrp1 = [10 0e 02 03 0e 07 02 07 0a 12 27 37 00 0d 0e 10]; - gamctrn1 = [10 0e 03 03 0f 06 02 08 0a 13 26 36 00 0d 0e 10]; + gamctrp1 = [10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10]; + gamctrn1 = [10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10]; width = <160>; height = <128>; }; @@ -94,7 +94,7 @@ pwctrl1-param = [a4 a1]; pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; - ram-param = [00 e0]; + ram-param = [00 E0]; rgb-param = [40 02 14]; mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; }; @@ -328,7 +328,7 @@ vsl = [19 19 19 19]; vshn = [41 41 41 41]; vsln = [19 19 19 19]; - osc-settings = <0xa6>; + osc-settings = <0xA6>; framerate = <0x5>; multiplex-ratio = <0x64>; source-voltage = <0x0>; @@ -470,8 +470,8 @@ data-lanes = <2>; pixel-format = <0>; rotation = <0>; - pvgamctrl = [00 10 0e 02 03 0e 07 02 07 0a 12 27 37 00 0d 0e 10]; - nvgamctrl = [00 10 0e 03 03 0f 06 02 08 0a 13 26 36 00 0d 0e 10]; + pvgamctrl = [00 10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10]; + nvgamctrl = [00 10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10]; display-timings { compatible = "zephyr,panel-timing"; diff --git a/tests/drivers/build_all/ethernet/spi_devices.overlay b/tests/drivers/build_all/ethernet/spi_devices.overlay index 1d0f6944b790..4305dbb8a809 100644 --- a/tests/drivers/build_all/ethernet/spi_devices.overlay +++ b/tests/drivers/build_all/ethernet/spi_devices.overlay @@ -73,7 +73,7 @@ reset-gpios = <&test_gpio 0 0>; port1 { - local-mac-address = [ca 2f b7 10 23 63]; + local-mac-address = [CA 2F B7 10 23 63]; }; mdio { @@ -98,11 +98,11 @@ reset-gpios = <&test_gpio 0 0>; port1 { - local-mac-address = [ca 2f b7 10 23 63]; + local-mac-address = [CA 2F B7 10 23 63]; }; port2 { - local-mac-address = [3c 82 d4 a2 29 8e]; + local-mac-address = [3C 82 D4 A2 29 8E]; }; mdio { diff --git a/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay index 63903dbc6017..4e1ee5de62cb 100644 --- a/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ b/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -5,8 +5,8 @@ */ &cpuflpr_rram { - reg = <0x15d000 DT_SIZE_K(128)>; - ranges = <0x0 0x15d000 DT_SIZE_K(128)>; + reg = <0x15D000 DT_SIZE_K(128)>; + ranges = <0x0 0x15D000 DT_SIZE_K(128)>; }; &cpuflpr_code_partition { diff --git a/tests/drivers/build_all/i2c/boards/qemu_cortex_m3.overlay b/tests/drivers/build_all/i2c/boards/qemu_cortex_m3.overlay index 72a6f8354252..6060194486ce 100644 --- a/tests/drivers/build_all/i2c/boards/qemu_cortex_m3.overlay +++ b/tests/drivers/build_all/i2c/boards/qemu_cortex_m3.overlay @@ -25,12 +25,12 @@ interrupts = <5 1>; }; - i2c2: i2c@888a8888 { + i2c2: i2c@888A8888 { compatible = "brcm,iproc-i2c"; clock-frequency = ; #address-cells = <1>; #size-cells = <0>; - reg = <0x888a8888 0x100>; + reg = <0x888A8888 0x100>; interrupt-parent = <&nvic>; interrupts = <6 1>; }; diff --git a/tests/drivers/build_all/sensor/i2c.dtsi b/tests/drivers/build_all/sensor/i2c.dtsi index 28af7470cf43..5c47fbf01d01 100644 --- a/tests/drivers/build_all/sensor/i2c.dtsi +++ b/tests/drivers/build_all/sensor/i2c.dtsi @@ -788,7 +788,7 @@ test_i2c_bmi08x_accel: bmi08x@6d { int-gpios = <&test_gpio 0 0>; int1-map-io = <0x01>; int2-map-io = <0x00>; - int1-conf-io = <0x0a>; + int1-conf-io = <0x0A>; int2-conf-io = <0x17>; accel-hz = "800"; accel-fs = <4>; diff --git a/tests/drivers/build_all/sensor/i3c.dtsi b/tests/drivers/build_all/sensor/i3c.dtsi index cfd41e820d32..7118f1d4b717 100644 --- a/tests/drivers/build_all/sensor/i3c.dtsi +++ b/tests/drivers/build_all/sensor/i3c.dtsi @@ -11,36 +11,36 @@ ************************************** */ -test_i3c_lps22hh: lps22hh@100000803e0000001 { +test_i3c_lps22hh: lps22hh@100000803E0000001 { compatible = "st,lps22hh"; - reg = <0x1 0x00000803 0xe0000001>; + reg = <0x1 0x00000803 0xE0000001>; assigned-address = <0x1>; drdy-gpios = <&test_gpio 0 0>; }; -test_i3c_lps22df: lps22df@200000803e0000002 { +test_i3c_lps22df: lps22df@200000803E0000002 { compatible = "st,lps22df"; - reg = <0x2 0x00000803 0xe0000002>; + reg = <0x2 0x00000803 0xE0000002>; assigned-address = <0x2>; drdy-gpios = <&test_gpio 0 0>; }; -test_i3c_lps28dfw: lps28dfw@300000803e0000003 { +test_i3c_lps28dfw: lps28dfw@300000803E0000003 { compatible = "st,lps28dfw"; - reg = <0x3 0x00000803 0xe0000003>; + reg = <0x3 0x00000803 0xE0000003>; assigned-address = <0x3>; drdy-gpios = <&test_gpio 0 0>; }; -test_i3c_ilps22qs: ilps22qs@400000803e0000004 { +test_i3c_ilps22qs: ilps22qs@400000803E0000004 { compatible = "st,ilps22qs"; - reg = <0x3 0x00000803 0xe0000004>; + reg = <0x3 0x00000803 0xE0000004>; assigned-address = <0x4>; }; -test_i3c_lsm6dsv16x: lsm6dsv16x@500000803e0000004 { +test_i3c_lsm6dsv16x: lsm6dsv16x@500000803E0000004 { compatible = "st,lsm6dsv16x"; - reg = <0x5 0x00000803 0xe0000004>; + reg = <0x5 0x00000803 0xE0000004>; assigned-address = <0x5>; int1-gpios = <&test_gpio 0 0>; int2-gpios = <&test_gpio 0 0>; @@ -50,9 +50,9 @@ test_i3c_lsm6dsv16x: lsm6dsv16x@500000803e0000004 { gyro-odr = ; }; -test_i3c_lsm6dsv32x: lsm6dsv32x@600000803e0000004 { +test_i3c_lsm6dsv32x: lsm6dsv32x@600000803E0000004 { compatible = "st,lsm6dsv32x"; - reg = <0x6 0x00000803 0xe0000004>; + reg = <0x6 0x00000803 0xE0000004>; assigned-address = <0x6>; int1-gpios = <&test_gpio 0 0>; int2-gpios = <&test_gpio 0 0>; @@ -62,9 +62,9 @@ test_i3c_lsm6dsv32x: lsm6dsv32x@600000803e0000004 { gyro-odr = ; }; -test_i3c_icm45686: icm45686@700000803e0000004 { +test_i3c_icm45686: icm45686@700000803E0000004 { compatible = "invensense,icm45686"; - reg = <0x7 0x00000803 0xe0000004>; + reg = <0x7 0x00000803 0xE0000004>; assigned-address = <0x7>; int-gpios = <&test_gpio 0 0>; }; diff --git a/tests/drivers/build_all/sensor/spi.dtsi b/tests/drivers/build_all/sensor/spi.dtsi index 6dc2b6f0c91e..2f22e7a09f17 100644 --- a/tests/drivers/build_all/sensor/spi.dtsi +++ b/tests/drivers/build_all/sensor/spi.dtsi @@ -273,7 +273,7 @@ test_spi_bmi08x_accel: bmi08x@23 { int-gpios = <&test_gpio 0 0>; int1-map-io = <0x01>; int2-map-io = <0x00>; - int1-conf-io = <0x0a>; + int1-conf-io = <0x0A>; int2-conf-io = <0x17>; accel-hz = "800"; accel-fs = <4>; diff --git a/tests/drivers/charger/sbs_charger/boards/emulated_board.overlay b/tests/drivers/charger/sbs_charger/boards/emulated_board.overlay index becd3eceb54e..6d3279753673 100644 --- a/tests/drivers/charger/sbs_charger/boards/emulated_board.overlay +++ b/tests/drivers/charger/sbs_charger/boards/emulated_board.overlay @@ -23,7 +23,7 @@ smartcharger0: smartcharger@b { compatible = "sbs,sbs-charger"; - reg = <0x0b>; + reg = <0x0B>; status = "okay"; }; }; diff --git a/tests/drivers/charger/sbs_charger/boards/qemu_cortex_a53.overlay b/tests/drivers/charger/sbs_charger/boards/qemu_cortex_a53.overlay index fe22ab8793b0..05bec8d88b58 100644 --- a/tests/drivers/charger/sbs_charger/boards/qemu_cortex_a53.overlay +++ b/tests/drivers/charger/sbs_charger/boards/qemu_cortex_a53.overlay @@ -27,7 +27,7 @@ smartcharger0: smartcharger@b { compatible = "sbs,sbs-charger"; - reg = <0x0b>; + reg = <0x0B>; status = "okay"; }; }; diff --git a/tests/drivers/coredump/coredump_api/boards/qemu_riscv32.overlay b/tests/drivers/coredump/coredump_api/boards/qemu_riscv32.overlay index c410cc992e5e..696e941f55e7 100644 --- a/tests/drivers/coredump/coredump_api/boards/qemu_riscv32.overlay +++ b/tests/drivers/coredump/coredump_api/boards/qemu_riscv32.overlay @@ -19,7 +19,7 @@ coredump-type = "COREDUMP_TYPE_MEMCPY"; status = "okay"; - memory-regions = <0x86000000 0xc>; + memory-regions = <0x86000000 0xC>; }; coredump_devicecb: coredump-device-cb { diff --git a/tests/drivers/disk/disk_access/boards/intel_btl_s_crb.overlay b/tests/drivers/disk/disk_access/boards/intel_btl_s_crb.overlay index cc2daa2cdb08..f6e8f28f0856 100644 --- a/tests/drivers/disk/disk_access/boards/intel_btl_s_crb.overlay +++ b/tests/drivers/disk/disk_access/boards/intel_btl_s_crb.overlay @@ -9,7 +9,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1b36>; /* Subjected to change base on Hardware used */ + vendor-id = <0x1B36>; /* Subjected to change base on Hardware used */ device-id = <0x0010>; /* Subjected to change base on Hardware used */ status = "okay"; diff --git a/tests/drivers/disk/disk_access/boards/intel_ptl_h_crb.overlay b/tests/drivers/disk/disk_access/boards/intel_ptl_h_crb.overlay index ff3415c7b16d..ae455bdffbb3 100644 --- a/tests/drivers/disk/disk_access/boards/intel_ptl_h_crb.overlay +++ b/tests/drivers/disk/disk_access/boards/intel_ptl_h_crb.overlay @@ -9,7 +9,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1b36>; /* Subject to change based on hardware used */ + vendor-id = <0x1B36>; /* Subject to change based on hardware used */ device-id = <0x0010>; /* Subject to change based on hardware used */ status = "okay"; diff --git a/tests/drivers/disk/disk_access/boards/qemu_x86_64.overlay b/tests/drivers/disk/disk_access/boards/qemu_x86_64.overlay index e5aecf7458ea..85b9b28246fe 100644 --- a/tests/drivers/disk/disk_access/boards/qemu_x86_64.overlay +++ b/tests/drivers/disk/disk_access/boards/qemu_x86_64.overlay @@ -7,7 +7,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1b36>; + vendor-id = <0x1B36>; device-id = <0x0010>; status = "okay"; diff --git a/tests/drivers/disk/disk_performance/boards/intel_btl_s_crb.overlay b/tests/drivers/disk/disk_performance/boards/intel_btl_s_crb.overlay index cc2daa2cdb08..f6e8f28f0856 100644 --- a/tests/drivers/disk/disk_performance/boards/intel_btl_s_crb.overlay +++ b/tests/drivers/disk/disk_performance/boards/intel_btl_s_crb.overlay @@ -9,7 +9,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1b36>; /* Subjected to change base on Hardware used */ + vendor-id = <0x1B36>; /* Subjected to change base on Hardware used */ device-id = <0x0010>; /* Subjected to change base on Hardware used */ status = "okay"; diff --git a/tests/drivers/disk/disk_performance/boards/qemu_x86_64.overlay b/tests/drivers/disk/disk_performance/boards/qemu_x86_64.overlay index e2826b326b40..037b2528d8ce 100644 --- a/tests/drivers/disk/disk_performance/boards/qemu_x86_64.overlay +++ b/tests/drivers/disk/disk_performance/boards/qemu_x86_64.overlay @@ -7,7 +7,7 @@ nvme0: nvme0 { compatible = "nvme-controller"; - vendor-id = <0x1b36>; + vendor-id = <0x1B36>; device-id = <0x0010>; status = "okay"; diff --git a/tests/drivers/flash/common/boards/ek_ra6m2.overlay b/tests/drivers/flash/common/boards/ek_ra6m2.overlay index 6d224ad7c879..a910732a53a2 100644 --- a/tests/drivers/flash/common/boards/ek_ra6m2.overlay +++ b/tests/drivers/flash/common/boards/ek_ra6m2.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@f0000 { + storage_partition: partition@F0000 { label = "storage"; - reg = <0xf0000 DT_SIZE_K(64)>; + reg = <0xF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra6m3.overlay b/tests/drivers/flash/common/boards/ek_ra6m3.overlay index 8d2004a383b9..5692054a716b 100644 --- a/tests/drivers/flash/common/boards/ek_ra6m3.overlay +++ b/tests/drivers/flash/common/boards/ek_ra6m3.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@1f0000 { + storage_partition: partition@1F0000 { label = "storage"; - reg = <0x1f0000 DT_SIZE_K(64)>; + reg = <0x1F0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra6m4.overlay b/tests/drivers/flash/common/boards/ek_ra6m4.overlay index 749b350261c6..cc09229e41e2 100644 --- a/tests/drivers/flash/common/boards/ek_ra6m4.overlay +++ b/tests/drivers/flash/common/boards/ek_ra6m4.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@f0000 { + storage_partition: partition@F0000 { label = "storage"; - reg = <0xf0000 DT_SIZE_K(64)>; + reg = <0xF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra6m5.overlay b/tests/drivers/flash/common/boards/ek_ra6m5.overlay index f168086c7aec..8d36cc7d2caa 100644 --- a/tests/drivers/flash/common/boards/ek_ra6m5.overlay +++ b/tests/drivers/flash/common/boards/ek_ra6m5.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@1f0000 { + storage_partition: partition@1F0000 { label = "storage"; - reg = <0x1f0000 DT_SIZE_K(64)>; + reg = <0x1F0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra8d1.overlay b/tests/drivers/flash/common/boards/ek_ra8d1.overlay index 460286808cb4..ee45617b0097 100644 --- a/tests/drivers/flash/common/boards/ek_ra8d1.overlay +++ b/tests/drivers/flash/common/boards/ek_ra8d1.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set the 2 last block of storage. */ - storage_partition: partition@1e8000 { + storage_partition: partition@1E8000 { label = "storage"; - reg = <0x1e8000 DT_SIZE_K(64)>; + reg = <0x1E8000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/ek_ra8m1.overlay b/tests/drivers/flash/common/boards/ek_ra8m1.overlay index 460286808cb4..ee45617b0097 100644 --- a/tests/drivers/flash/common/boards/ek_ra8m1.overlay +++ b/tests/drivers/flash/common/boards/ek_ra8m1.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set the 2 last block of storage. */ - storage_partition: partition@1e8000 { + storage_partition: partition@1E8000 { label = "storage"; - reg = <0x1e8000 DT_SIZE_K(64)>; + reg = <0x1E8000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/fpb_ra6e1.overlay b/tests/drivers/flash/common/boards/fpb_ra6e1.overlay index 6d224ad7c879..a910732a53a2 100644 --- a/tests/drivers/flash/common/boards/fpb_ra6e1.overlay +++ b/tests/drivers/flash/common/boards/fpb_ra6e1.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set 2 last blocks of the code flash as storage partition */ - storage_partition: partition@f0000 { + storage_partition: partition@F0000 { label = "storage"; - reg = <0xf0000 DT_SIZE_K(64)>; + reg = <0xF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/mck_ra8t1.overlay b/tests/drivers/flash/common/boards/mck_ra8t1.overlay index b56f8c5af307..8e42c66387c7 100644 --- a/tests/drivers/flash/common/boards/mck_ra8t1.overlay +++ b/tests/drivers/flash/common/boards/mck_ra8t1.overlay @@ -12,9 +12,9 @@ #size-cells = <1>; /* Set the 2 last block of storage. */ - storage_partition: partition@1e8000 { + storage_partition: partition@1E8000 { label = "storage"; - reg = <0x1e8000 DT_SIZE_K(64)>; + reg = <0x1E8000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/drivers/flash/common/boards/nrf52840dk_mx25l51245g.overlay b/tests/drivers/flash/common/boards/nrf52840dk_mx25l51245g.overlay index 47f2cbe5130b..4b38cce55071 100644 --- a/tests/drivers/flash/common/boards/nrf52840dk_mx25l51245g.overlay +++ b/tests/drivers/flash/common/boards/nrf52840dk_mx25l51245g.overlay @@ -49,7 +49,7 @@ /* MX25L5145G supports all readoc options */ readoc = "read4io"; sck-frequency = <2000000>; - jedec-id = [c2 20 1a]; + jedec-id = [c2 20 1A]; sfdp-bfp = [e5 20 fb ff 1f ff ff ff 44 eb 08 6b 08 3b 04 bb fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 10 d8 00 ff d6 49 c5 00 81 df 04 e3 44 03 67 38 diff --git a/tests/drivers/flash/common/boards/nrf52840dk_spi_nor.overlay b/tests/drivers/flash/common/boards/nrf52840dk_spi_nor.overlay index 87e571300114..1658c1dab59c 100644 --- a/tests/drivers/flash/common/boards/nrf52840dk_spi_nor.overlay +++ b/tests/drivers/flash/common/boards/nrf52840dk_spi_nor.overlay @@ -44,7 +44,7 @@ has-dpd; t-enter-dpd = <10000>; t-exit-dpd = <45000>; - jedec-id = [c2 23 15]; + jedec-id = [C2 23 15]; sfdp-bfp = [e5 20 f1 ff ff ff ff 00 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 f1 00 82 ec 04 c2 44 83 48 44 diff --git a/tests/drivers/flash/common/boards/nrf52840dk_spi_nor_wp_hold.overlay b/tests/drivers/flash/common/boards/nrf52840dk_spi_nor_wp_hold.overlay index c5bc85174e97..bb876888320f 100644 --- a/tests/drivers/flash/common/boards/nrf52840dk_spi_nor_wp_hold.overlay +++ b/tests/drivers/flash/common/boards/nrf52840dk_spi_nor_wp_hold.overlay @@ -46,7 +46,7 @@ has-dpd; t-enter-dpd = <10000>; t-exit-dpd = <45000>; - jedec-id = [c2 23 15]; + jedec-id = [C2 23 15]; sfdp-bfp = [e5 20 f1 ff ff ff ff 00 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 f1 00 82 ec 04 c2 44 83 48 44 diff --git a/tests/drivers/flash_simulator/flash_sim_impl/boards/nucleo_f411re.overlay b/tests/drivers/flash_simulator/flash_sim_impl/boards/nucleo_f411re.overlay index 6c3b163298a2..d8b0071c94c0 100644 --- a/tests/drivers/flash_simulator/flash_sim_impl/boards/nucleo_f411re.overlay +++ b/tests/drivers/flash_simulator/flash_sim_impl/boards/nucleo_f411re.overlay @@ -5,9 +5,9 @@ */ / { - sram_2001C000: sram@2001c000 { + sram_2001C000: sram@2001C000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2001c000 0x4000>; + reg = <0x2001C000 0x4000>; zephyr,memory-region = "FlashSim"; status = "okay"; }; diff --git a/tests/drivers/flash_simulator/flash_sim_reboot/boards/mps2_an385.overlay b/tests/drivers/flash_simulator/flash_sim_reboot/boards/mps2_an385.overlay index 59fc8c37271a..77623e89347f 100644 --- a/tests/drivers/flash_simulator/flash_sim_reboot/boards/mps2_an385.overlay +++ b/tests/drivers/flash_simulator/flash_sim_reboot/boards/mps2_an385.overlay @@ -1,9 +1,9 @@ #include / { - sram_203F0000: sram@203f0000 { + sram_203F0000: sram@203F0000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x203f0000 0x10000>; + reg = <0x203F0000 0x10000>; zephyr,memory-region = "FlashSim"; status = "okay"; }; diff --git a/tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.overlay b/tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.overlay index 27e58000b19b..14334b8c3780 100644 --- a/tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.overlay +++ b/tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.overlay @@ -23,7 +23,7 @@ smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge-new-api"; - reg = <0x0b>; + reg = <0x0B>; status = "okay"; }; }; diff --git a/tests/drivers/fuel_gauge/sbs_gauge/boards/qemu_cortex_a53.overlay b/tests/drivers/fuel_gauge/sbs_gauge/boards/qemu_cortex_a53.overlay index f975f6d3af9e..8c216c01cd25 100644 --- a/tests/drivers/fuel_gauge/sbs_gauge/boards/qemu_cortex_a53.overlay +++ b/tests/drivers/fuel_gauge/sbs_gauge/boards/qemu_cortex_a53.overlay @@ -27,7 +27,7 @@ smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge-new-api"; - reg = <0x0b>; + reg = <0x0B>; status = "okay"; }; }; diff --git a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay index 9845244852c0..59839fa9265b 100644 --- a/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay +++ b/tests/drivers/gpio/gpio_basic_api/boards/nrf54l_sense_edge.overlay @@ -5,5 +5,5 @@ */ &gpio1 { - sense-edge-mask = <0xc00>; + sense-edge-mask = <0xC00>; }; diff --git a/tests/drivers/mbox/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay b/tests/drivers/mbox/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay index 2da7632140c0..56452fc4936b 100644 --- a/tests/drivers/mbox/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay +++ b/tests/drivers/mbox/mbox_data/boards/lpcxpresso55s69_lpc55s69_cpu0.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mailbox0@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xec>; + reg = <0x5008b000 0xEC>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/tests/drivers/mbox/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay b/tests/drivers/mbox/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay index 4146d6b34a90..eb20ff9a1dd6 100644 --- a/tests/drivers/mbox/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay +++ b/tests/drivers/mbox/mbox_data/remote/boards/lpcxpresso55s69_lpc55s69_cpu1.overlay @@ -19,7 +19,7 @@ /* Attach MBOX driver to Mailbox Unit */ mbox: mbox@5008b000 { compatible = "nxp,mbox-mailbox"; - reg = <0x5008b000 0xec>; + reg = <0x5008b000 0xEC>; interrupts = <31 0>; rx-channels = <4>; #mbox-cells = <1>; diff --git a/tests/drivers/mbox/mbox_error_cases/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay b/tests/drivers/mbox/mbox_error_cases/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay index 16dab060c56b..f1e60dfaa6a6 100644 --- a/tests/drivers/mbox/mbox_error_cases/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay +++ b/tests/drivers/mbox/mbox_error_cases/boards/rzg3s_smarc_r9a08g045s33gbg_cm33.overlay @@ -14,32 +14,32 @@ #size-cells = <1>; ranges; - openamp_shm: memory-region@62f00000 { + openamp_shm: memory-region@62F00000 { compatible = "zephyr,memory-region"; - reg = <0x62f00000 0x600000>; + reg = <0x62F00000 0x600000>; zephyr,memory-region = "openamp_memory"; zephyr,memory-attr = ; }; }; - mhu1_shm: memory@62f01008 { + mhu1_shm: memory@62F01008 { compatible = "mmio-sram"; - reg = <0x62f01008 0x8>; + reg = <0x62F01008 0x8>; }; - mhu3_shm: memory@62f01018 { + mhu3_shm: memory@62F01018 { compatible = "mmio-sram"; - reg = <0x62f01018 0x8>; + reg = <0x62F01018 0x8>; }; - mhu4_shm: memory@62f01020 { + mhu4_shm: memory@62F01020 { compatible = "mmio-sram"; - reg = <0x62f01020 0x8>; + reg = <0x62F01020 0x8>; }; - mhu5_shm: memory@62f01028 { + mhu5_shm: memory@62F01028 { compatible = "mmio-sram"; - reg = <0x62f01028 0x8>; + reg = <0x62F01028 0x8>; }; mbox-consumer { diff --git a/tests/drivers/mbox/mbox_error_cases/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay b/tests/drivers/mbox/mbox_error_cases/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay index 7f64051d3fc1..1f65f3cafc56 100644 --- a/tests/drivers/mbox/mbox_error_cases/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay +++ b/tests/drivers/mbox/mbox_error_cases/boards/rzv2l_smarc_r9a07g054l23gbg_cm33.overlay @@ -13,32 +13,32 @@ #size-cells = <1>; ranges; - openamp_shm: memory-region@62f00000 { + openamp_shm: memory-region@62F00000 { compatible = "zephyr,memory-region"; - reg = <0x62f00000 0x900000>; + reg = <0x62F00000 0x900000>; zephyr,memory-region = "openamp_memory"; zephyr,memory-attr = ; }; }; - mhu1_shm: memory@62f01008 { + mhu1_shm: memory@62F01008 { compatible = "mmio-sram"; - reg = <0x62f01008 0x8>; + reg = <0x62F01008 0x8>; }; - mhu3_shm: memory@62f01018 { + mhu3_shm: memory@62F01018 { compatible = "mmio-sram"; - reg = <0x62f01018 0x8>; + reg = <0x62F01018 0x8>; }; - mhu4_shm: memory@62f01020 { + mhu4_shm: memory@62F01020 { compatible = "mmio-sram"; - reg = <0x62f01020 0x8>; + reg = <0x62F01020 0x8>; }; - mhu5_shm: memory@62f01028 { + mhu5_shm: memory@62F01028 { compatible = "mmio-sram"; - reg = <0x62f01028 0x8>; + reg = <0x62F01028 0x8>; }; mbox-consumer { diff --git a/tests/drivers/mspi/flash/boards/apollo3p_evb.overlay b/tests/drivers/mspi/flash/boards/apollo3p_evb.overlay index eede73ada1df..c625137f79e2 100644 --- a/tests/drivers/mspi/flash/boards/apollo3p_evb.overlay +++ b/tests/drivers/mspi/flash/boards/apollo3p_evb.overlay @@ -35,7 +35,7 @@ mspi-io-mode = "MSPI_IO_MODE_OCTAL"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0x0b>; + read-command = <0x0B>; write-command = <0x02>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; diff --git a/tests/drivers/mspi/flash/boards/native_sim.overlay b/tests/drivers/mspi/flash/boards/native_sim.overlay index 9ee245966604..41544316bc84 100644 --- a/tests/drivers/mspi/flash/boards/native_sim.overlay +++ b/tests/drivers/mspi/flash/boards/native_sim.overlay @@ -25,7 +25,7 @@ mspi-io-mode = "MSPI_IO_MODE_QUAD"; mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; mspi-hardware-ce-num = <0>; - read-command = <0x0b>; + read-command = <0x0B>; write-command = <0x02>; command-length = "INSTR_1_BYTE"; address-length = "ADDR_4_BYTE"; @@ -44,7 +44,7 @@ mspi-hardware-ce-num = <1>; mspi-dqs-enable; read-command = <0x20>; - write-command = <0xaa>; + write-command = <0xAA>; command-length = "INSTR_2_BYTE"; address-length = "ADDR_3_BYTE"; rx-dummy = <6>; diff --git a/tests/drivers/retained_mem/api/boards/nrf52840dk_nrf52840_ram.overlay b/tests/drivers/retained_mem/api/boards/nrf52840dk_nrf52840_ram.overlay index 061e57b5dd52..0e69d3424568 100644 --- a/tests/drivers/retained_mem/api/boards/nrf52840dk_nrf52840_ram.overlay +++ b/tests/drivers/retained_mem/api/boards/nrf52840dk_nrf52840_ram.overlay @@ -1,7 +1,7 @@ / { - sram@2003ffe0 { + sram@2003FFE0 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003ffe0 0x20>; + reg = <0x2003FFE0 0x20>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/drivers/retained_mem/api/boards/qemu_cortex_m3.overlay b/tests/drivers/retained_mem/api/boards/qemu_cortex_m3.overlay index 27e7d4a0e7ad..32cab58a74f4 100644 --- a/tests/drivers/retained_mem/api/boards/qemu_cortex_m3.overlay +++ b/tests/drivers/retained_mem/api/boards/qemu_cortex_m3.overlay @@ -1,9 +1,9 @@ #include / { - sram@2000ffe0 { + sram@2000FFE0 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000ffe0 0x20>; + reg = <0x2000FFE0 0x20>; zephyr,memory-region = "Retention"; status = "okay"; diff --git a/tests/drivers/sensor/sbs_gauge/boards/native_sim.overlay b/tests/drivers/sensor/sbs_gauge/boards/native_sim.overlay index 70953bb26be5..b28d8b8b3d69 100644 --- a/tests/drivers/sensor/sbs_gauge/boards/native_sim.overlay +++ b/tests/drivers/sensor/sbs_gauge/boards/native_sim.overlay @@ -9,7 +9,7 @@ smartbattery: sbs_gauge@b { compatible = "sbs,sbs-gauge"; - reg = <0x0b>; + reg = <0x0B>; status = "okay"; }; }; diff --git a/tests/drivers/sensor/sbs_gauge/boards/nucleo_f070rb.overlay b/tests/drivers/sensor/sbs_gauge/boards/nucleo_f070rb.overlay index 40cfe82e93f8..c63a3c43cd84 100644 --- a/tests/drivers/sensor/sbs_gauge/boards/nucleo_f070rb.overlay +++ b/tests/drivers/sensor/sbs_gauge/boards/nucleo_f070rb.overlay @@ -6,11 +6,11 @@ &i2c1 { clock-frequency = ; - timings = <32000000 I2C_BITRATE_STANDARD 0x10e03e52>; + timings = <32000000 I2C_BITRATE_STANDARD 0x10E03E52>; smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge"; - reg = <0x0b>; + reg = <0x0B>; status = "okay"; }; }; diff --git a/tests/drivers/sensor/sbs_gauge/boards/qemu_arc_qemu_arc_hs.overlay b/tests/drivers/sensor/sbs_gauge/boards/qemu_arc_qemu_arc_hs.overlay index a0233727329a..973d682645d0 100644 --- a/tests/drivers/sensor/sbs_gauge/boards/qemu_arc_qemu_arc_hs.overlay +++ b/tests/drivers/sensor/sbs_gauge/boards/qemu_arc_qemu_arc_hs.overlay @@ -24,7 +24,7 @@ smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge"; - reg = <0x0b>; + reg = <0x0B>; status = "okay"; }; }; diff --git a/tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.overlay b/tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.overlay index 79474c867f02..5ccce21056c9 100644 --- a/tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.overlay +++ b/tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.overlay @@ -24,7 +24,7 @@ smartbattery0: smartbattery@b { compatible = "sbs,sbs-gauge"; - reg = <0x0b>; + reg = <0x0B>; status = "okay"; }; }; diff --git a/tests/drivers/uart/uart_async_api/boards/samc21n_xpro.overlay b/tests/drivers/uart/uart_async_api/boards/samc21n_xpro.overlay index c238f4cd43a5..9333f88db6fd 100644 --- a/tests/drivers/uart/uart_async_api/boards/samc21n_xpro.overlay +++ b/tests/drivers/uart/uart_async_api/boards/samc21n_xpro.overlay @@ -20,6 +20,6 @@ dut: &sercom0 { &sercom4 { /* configure DMA channels for async operation */ - dmas = <&dmac 10 0x0a>, <&dmac 11 0x0b>; + dmas = <&dmac 10 0x0A>, <&dmac 11 0x0B>; dma-names = "rx", "tx"; }; diff --git a/tests/drivers/uart/uart_errors/boards/sam_e54_xpro.overlay b/tests/drivers/uart/uart_errors/boards/sam_e54_xpro.overlay index 2cad973a16eb..75ec055162d9 100644 --- a/tests/drivers/uart/uart_errors/boards/sam_e54_xpro.overlay +++ b/tests/drivers/uart/uart_errors/boards/sam_e54_xpro.overlay @@ -34,7 +34,7 @@ dut_aux: &sercom5 { pinctrl-0 = <&sercom5_uart_default>; pinctrl-names = "default"; - dmas = <&dmac 0x5 0xe>, <&dmac 0x6 0xf>; + dmas = <&dmac 0x5 0xE>, <&dmac 0x6 0xF>; dma-names = "rx", "tx"; }; diff --git a/tests/kernel/device/app.overlay b/tests/kernel/device/app.overlay index 0773813a0137..82e59159fd9f 100644 --- a/tests/kernel/device/app.overlay +++ b/tests/kernel/device/app.overlay @@ -17,62 +17,62 @@ #address-cells = <1>; #size-cells = <1>; - fake_driver_label: fakedriver@e0000000 { + fake_driver_label: fakedriver@E0000000 { compatible = "fakedriver"; - reg = <0xe0000000 0x2000>; + reg = <0xE0000000 0x2000>; status = "okay"; }; - fakedriver@e1000000 { + fakedriver@E1000000 { compatible = "fakedriver"; - reg = <0xe1000000 0x2000>; + reg = <0xE1000000 0x2000>; status = "okay"; }; - fakedriver@e2000000 { + fakedriver@E2000000 { compatible = "fakedriver"; - reg = <0xe2000000 0x2000>; + reg = <0xE2000000 0x2000>; status = "okay"; }; - fakedriver@e3000000 { + fakedriver@E3000000 { compatible = "fakedriver"; - reg = <0xe3000000 0x2000>; + reg = <0xE3000000 0x2000>; status = "okay"; }; - fakedriver@e4000000 { + fakedriver@E4000000 { compatible = "fakedriver"; - reg = <0xe4000000 0x2000>; + reg = <0xE4000000 0x2000>; status = "okay"; }; - fakedriver_multireg@e5000000 { + fakedriver_multireg@E5000000 { compatible = "fakedriver_multireg"; - reg = <0xe5000000 0x1000>, - <0xe6000000 0x1000>; + reg = <0xE5000000 0x1000>, + <0xE6000000 0x1000>; reg-names = "chip", "dale"; status = "okay"; }; - fakedeferdriver@e7000000 { + fakedeferdriver@E7000000 { compatible = "fakedeferdriver"; - reg = <0xe7000000 0x2000>; + reg = <0xE7000000 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@e8000000 { + fakedeferdriver@E8000000 { compatible = "fakedeferdriver"; - reg = <0xe8000000 0x2000>; + reg = <0xE8000000 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@f9000000 { + fakedeferdriver@F9000000 { compatible = "fakedeferdriver"; - reg = <0xf9000000 0x2000>; + reg = <0xF9000000 0x2000>; status = "okay"; zephyr,deferred-init; }; diff --git a/tests/kernel/device/boards/hifive_unmatched_fu740_s7.overlay b/tests/kernel/device/boards/hifive_unmatched_fu740_s7.overlay index ac1655c3b75f..d30a5b9af349 100644 --- a/tests/kernel/device/boards/hifive_unmatched_fu740_s7.overlay +++ b/tests/kernel/device/boards/hifive_unmatched_fu740_s7.overlay @@ -14,62 +14,62 @@ */ / { - fakedriver@e0000000 { + fakedriver@E0000000 { compatible = "fakedriver"; - reg = <0x0 0xe0000000 0x0 0x2000>; + reg = <0x0 0xE0000000 0x0 0x2000>; status = "okay"; }; - fakedriver@e1000000 { + fakedriver@E1000000 { compatible = "fakedriver"; - reg = <0x0 0xe1000000 0x0 0x2000>; + reg = <0x0 0xE1000000 0x0 0x2000>; status = "okay"; }; - fakedriver@e2000000 { + fakedriver@E2000000 { compatible = "fakedriver"; - reg = <0x0 0xe2000000 0x0 0x2000>; + reg = <0x0 0xE2000000 0x0 0x2000>; status = "okay"; }; - fakedriver@e3000000 { + fakedriver@E3000000 { compatible = "fakedriver"; - reg = <0x0 0xe3000000 0x0 0x2000>; + reg = <0x0 0xE3000000 0x0 0x2000>; status = "okay"; }; - fakedriver@e4000000 { + fakedriver@E4000000 { compatible = "fakedriver"; - reg = <0x0 0xe4000000 0x0 0x2000>; + reg = <0x0 0xE4000000 0x0 0x2000>; status = "okay"; }; - fakedriver_multireg@e5000000 { + fakedriver_multireg@E5000000 { compatible = "fakedriver_multireg"; - reg = <0x0 0xe5000000 0x0 0x1000>, - <0x0 0xe6000000 0x0 0x1000>; + reg = <0x0 0xE5000000 0x0 0x1000>, + <0x0 0xE6000000 0x0 0x1000>; reg-names = "chip", "dale"; status = "okay"; }; - fakedeferdriver@e7000000 { + fakedeferdriver@E7000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xe7000000 0x0 0x2000>; + reg = <0x0 0xE7000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@e8000000 { + fakedeferdriver@E8000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xe8000000 0x0 0x2000>; + reg = <0x0 0xE8000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@f9000000 { + fakedeferdriver@F9000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xf9000000 0x0 0x2000>; + reg = <0x0 0xF9000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; diff --git a/tests/kernel/device/boards/hifive_unmatched_fu740_u74.overlay b/tests/kernel/device/boards/hifive_unmatched_fu740_u74.overlay index ac1655c3b75f..d30a5b9af349 100644 --- a/tests/kernel/device/boards/hifive_unmatched_fu740_u74.overlay +++ b/tests/kernel/device/boards/hifive_unmatched_fu740_u74.overlay @@ -14,62 +14,62 @@ */ / { - fakedriver@e0000000 { + fakedriver@E0000000 { compatible = "fakedriver"; - reg = <0x0 0xe0000000 0x0 0x2000>; + reg = <0x0 0xE0000000 0x0 0x2000>; status = "okay"; }; - fakedriver@e1000000 { + fakedriver@E1000000 { compatible = "fakedriver"; - reg = <0x0 0xe1000000 0x0 0x2000>; + reg = <0x0 0xE1000000 0x0 0x2000>; status = "okay"; }; - fakedriver@e2000000 { + fakedriver@E2000000 { compatible = "fakedriver"; - reg = <0x0 0xe2000000 0x0 0x2000>; + reg = <0x0 0xE2000000 0x0 0x2000>; status = "okay"; }; - fakedriver@e3000000 { + fakedriver@E3000000 { compatible = "fakedriver"; - reg = <0x0 0xe3000000 0x0 0x2000>; + reg = <0x0 0xE3000000 0x0 0x2000>; status = "okay"; }; - fakedriver@e4000000 { + fakedriver@E4000000 { compatible = "fakedriver"; - reg = <0x0 0xe4000000 0x0 0x2000>; + reg = <0x0 0xE4000000 0x0 0x2000>; status = "okay"; }; - fakedriver_multireg@e5000000 { + fakedriver_multireg@E5000000 { compatible = "fakedriver_multireg"; - reg = <0x0 0xe5000000 0x0 0x1000>, - <0x0 0xe6000000 0x0 0x1000>; + reg = <0x0 0xE5000000 0x0 0x1000>, + <0x0 0xE6000000 0x0 0x1000>; reg-names = "chip", "dale"; status = "okay"; }; - fakedeferdriver@e7000000 { + fakedeferdriver@E7000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xe7000000 0x0 0x2000>; + reg = <0x0 0xE7000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@e8000000 { + fakedeferdriver@E8000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xe8000000 0x0 0x2000>; + reg = <0x0 0xE8000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; - fakedeferdriver@f9000000 { + fakedeferdriver@F9000000 { compatible = "fakedeferdriver"; - reg = <0x0 0xf9000000 0x0 0x2000>; + reg = <0x0 0xF9000000 0x0 0x2000>; status = "okay"; zephyr,deferred-init; }; diff --git a/tests/lib/devicetree/api/app.overlay b/tests/lib/devicetree/api/app.overlay index 95a073ec8e63..ae6e4e316a1c 100644 --- a/tests/lib/devicetree/api/app.overlay +++ b/tests/lib/devicetree/api/app.overlay @@ -304,9 +304,9 @@ reg = <0x88889999 0x1000>; status = "okay"; - test-i3c-dev@420000abcd12345678 { + test-i3c-dev@420000ABCD12345678 { compatible = "vnd,i3c-device"; - reg = <0x42 0xabcd 0x12345678>; + reg = <0x42 0xABCD 0x12345678>; }; test-i3c-i2c-dev@380000000000000050 { diff --git a/tests/lib/devicetree/devices/app.overlay b/tests/lib/devicetree/devices/app.overlay index 7e6b2ec651fd..e195256d48c1 100644 --- a/tests/lib/devicetree/devices/app.overlay +++ b/tests/lib/devicetree/devices/app.overlay @@ -73,12 +73,12 @@ test_p0: partition@0 { label = "partition-0"; - reg = <0x00000000 0x0000c000>; + reg = <0x00000000 0x0000C000>; }; test_p1: partition@c000 { label = "partition-1"; - reg = <0x0000c000 0x00067000>; + reg = <0x0000C000 0x00067000>; }; }; }; diff --git a/tests/subsys/dfu/mcuboot_multi/native_sim.overlay b/tests/subsys/dfu/mcuboot_multi/native_sim.overlay index 791ea9e7354f..0a6335fea04f 100644 --- a/tests/subsys/dfu/mcuboot_multi/native_sim.overlay +++ b/tests/subsys/dfu/mcuboot_multi/native_sim.overlay @@ -15,12 +15,12 @@ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x0000c000>; + reg = <0x00000000 0x0000C000>; }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000c000 0x00069000>; + reg = <0x0000C000 0x00069000>; }; slot1_partition: partition@75000 { @@ -28,9 +28,9 @@ reg = <0x00075000 0x00069000>; }; - slot2_partition: partition@de000 { + slot2_partition: partition@DE000 { label = "image-2"; - reg = <0x000de000 0x00069000>; + reg = <0x000DE000 0x00069000>; }; slot3_partition: partition@146000 { diff --git a/tests/subsys/dfu/mcuboot_multi/nrf52840dk_nrf52840.overlay b/tests/subsys/dfu/mcuboot_multi/nrf52840dk_nrf52840.overlay index e46c6318792c..51010ad0af73 100644 --- a/tests/subsys/dfu/mcuboot_multi/nrf52840dk_nrf52840.overlay +++ b/tests/subsys/dfu/mcuboot_multi/nrf52840dk_nrf52840.overlay @@ -21,22 +21,22 @@ slot0_partition: partition@10000 { label = "image-0"; - reg = <0x00010000 0x0000a000>; + reg = <0x00010000 0x0000A000>; }; - slot1_partition: partition@1a000 { + slot1_partition: partition@1A000 { label = "image-1"; - reg = <0x0001a000 0x0000a000>; + reg = <0x0001A000 0x0000A000>; }; slot2_partition: partition@24000 { label = "image-2"; - reg = <0x00024000 0x0000a000>; + reg = <0x00024000 0x0000A000>; }; - slot3_partition: partition@2e000 { + slot3_partition: partition@2E000 { label = "image-3"; - reg = <0x0002e000 0x0000a000>; + reg = <0x0002E000 0x0000A000>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_mcxa156.overlay b/tests/subsys/fs/littlefs/boards/frdm_mcxa156.overlay index 9d5efbe24e8c..c5d1289e8058 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_mcxa156.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_mcxa156.overlay @@ -8,9 +8,9 @@ &flash { partitions { - small_partition: partition@e0000 { + small_partition: partition@E0000 { label = "small"; - reg = <0x000e0000 DT_SIZE_K(128)>; + reg = <0x000E0000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_mcxn236.overlay b/tests/subsys/fs/littlefs/boards/frdm_mcxn236.overlay index 9d5efbe24e8c..c5d1289e8058 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_mcxn236.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_mcxn236.overlay @@ -8,9 +8,9 @@ &flash { partitions { - small_partition: partition@e0000 { + small_partition: partition@E0000 { label = "small"; - reg = <0x000e0000 DT_SIZE_K(128)>; + reg = <0x000E0000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_mcxn947_mcxn947_cpu0.overlay b/tests/subsys/fs/littlefs/boards/frdm_mcxn947_mcxn947_cpu0.overlay index 703d7ce0e699..d6cb83685aaa 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_mcxn947_mcxn947_cpu0.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_mcxn947_mcxn947_cpu0.overlay @@ -18,9 +18,9 @@ reg = <0x00700000 DT_SIZE_K(960)>; }; - small_partition: partition@7f0000 { + small_partition: partition@7F0000 { label = "small"; - reg = <0x007f0000 DT_SIZE_K(64)>; + reg = <0x007F0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_mcxw71.overlay b/tests/subsys/fs/littlefs/boards/frdm_mcxw71.overlay index 9d5efbe24e8c..c5d1289e8058 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_mcxw71.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_mcxw71.overlay @@ -8,9 +8,9 @@ &flash { partitions { - small_partition: partition@e0000 { + small_partition: partition@E0000 { label = "small"; - reg = <0x000e0000 DT_SIZE_K(128)>; + reg = <0x000E0000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/frdm_rw612.overlay b/tests/subsys/fs/littlefs/boards/frdm_rw612.overlay index 6911f59c2f2a..95e334d6fb70 100644 --- a/tests/subsys/fs/littlefs/boards/frdm_rw612.overlay +++ b/tests/subsys/fs/littlefs/boards/frdm_rw612.overlay @@ -8,19 +8,19 @@ &w25q512jvfiq { partitions { - large_partition: partition@3c00000 { + large_partition: partition@3C00000 { label = "large"; - reg = <0x03c00000 DT_SIZE_M(3)>; + reg = <0x03C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@3f00000 { + medium_partition: partition@3F00000 { label = "medium"; - reg = <0x03f00000 DT_SIZE_K(960)>; + reg = <0x03F00000 DT_SIZE_K(960)>; }; - small_partition: partition@3ff0000 { + small_partition: partition@3FF0000 { label = "small"; - reg = <0x03ff0000 DT_SIZE_K(64)>; + reg = <0x03FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/lpcxpresso55s06.overlay b/tests/subsys/fs/littlefs/boards/lpcxpresso55s06.overlay index 8df2ec08b737..7c7b3ca21f8a 100644 --- a/tests/subsys/fs/littlefs/boards/lpcxpresso55s06.overlay +++ b/tests/subsys/fs/littlefs/boards/lpcxpresso55s06.overlay @@ -8,9 +8,9 @@ &flash0 { partitions { - small_partition: partition@1d000 { + small_partition: partition@1D000 { label = "small"; - reg = <0x0001d000 DT_SIZE_K(128)>; + reg = <0x0001D000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/lpcxpresso55s16.overlay b/tests/subsys/fs/littlefs/boards/lpcxpresso55s16.overlay index 8df2ec08b737..7c7b3ca21f8a 100644 --- a/tests/subsys/fs/littlefs/boards/lpcxpresso55s16.overlay +++ b/tests/subsys/fs/littlefs/boards/lpcxpresso55s16.overlay @@ -8,9 +8,9 @@ &flash0 { partitions { - small_partition: partition@1d000 { + small_partition: partition@1D000 { label = "small"; - reg = <0x0001d000 DT_SIZE_K(128)>; + reg = <0x0001D000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/lpcxpresso55s28.overlay b/tests/subsys/fs/littlefs/boards/lpcxpresso55s28.overlay index b54b50c8d263..56e240a5f429 100644 --- a/tests/subsys/fs/littlefs/boards/lpcxpresso55s28.overlay +++ b/tests/subsys/fs/littlefs/boards/lpcxpresso55s28.overlay @@ -8,9 +8,9 @@ &flash0 { partitions { - small_partition: partition@5d000 { + small_partition: partition@5D000 { label = "small"; - reg = <0x0005d000 DT_SIZE_K(128)>; + reg = <0x0005D000 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/lpcxpresso55s36.overlay b/tests/subsys/fs/littlefs/boards/lpcxpresso55s36.overlay index 0292d31ca6e6..e67dc535faf4 100644 --- a/tests/subsys/fs/littlefs/boards/lpcxpresso55s36.overlay +++ b/tests/subsys/fs/littlefs/boards/lpcxpresso55s36.overlay @@ -8,9 +8,9 @@ &flash0 { partitions { - small_partition: partition@1d800 { + small_partition: partition@1D800 { label = "small"; - reg = <0x0001d800 DT_SIZE_K(128)>; + reg = <0x0001D800 DT_SIZE_K(128)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1010_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1010_evk.overlay index 8be5adc873cd..ab4ee994818e 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1010_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1010_evk.overlay @@ -8,19 +8,19 @@ &at25sf128a { partitions { - large_partition: partition@c00000 { + large_partition: partition@C00000 { label = "large"; - reg = <0x00c00000 DT_SIZE_M(3)>; + reg = <0x00C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@f00000 { + medium_partition: partition@F00000 { label = "medium"; - reg = <0x00f00000 DT_SIZE_K(960)>; + reg = <0x00F00000 DT_SIZE_K(960)>; }; - small_partition: partition@ff0000 { + small_partition: partition@FF0000 { label = "small"; - reg = <0x00ff0000 DT_SIZE_K(64)>; + reg = <0x00FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1015_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1015_evk.overlay index 8be5adc873cd..ab4ee994818e 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1015_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1015_evk.overlay @@ -8,19 +8,19 @@ &at25sf128a { partitions { - large_partition: partition@c00000 { + large_partition: partition@C00000 { label = "large"; - reg = <0x00c00000 DT_SIZE_M(3)>; + reg = <0x00C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@f00000 { + medium_partition: partition@F00000 { label = "medium"; - reg = <0x00f00000 DT_SIZE_K(960)>; + reg = <0x00F00000 DT_SIZE_K(960)>; }; - small_partition: partition@ff0000 { + small_partition: partition@FF0000 { label = "small"; - reg = <0x00ff0000 DT_SIZE_K(64)>; + reg = <0x00FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1020_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1020_evk.overlay index 5362cdb5bff6..ce8f017116e9 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1020_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1020_evk.overlay @@ -18,9 +18,9 @@ reg = <0x00700000 DT_SIZE_K(960)>; }; - small_partition: partition@7f0000 { + small_partition: partition@7F0000 { label = "small"; - reg = <0x007f0000 DT_SIZE_K(64)>; + reg = <0x007F0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1024_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1024_evk.overlay index 1a607ef2af32..f3c2eb901a04 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1024_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1024_evk.overlay @@ -8,9 +8,9 @@ &w25q32jvwj0 { partitions { - small_partition: partition@3f0000 { + small_partition: partition@3F0000 { label = "small"; - reg = <0x003f0000 DT_SIZE_K(64)>; + reg = <0x003F0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1040_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1040_evk.overlay index 703d7ce0e699..d6cb83685aaa 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1040_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1040_evk.overlay @@ -18,9 +18,9 @@ reg = <0x00700000 DT_SIZE_K(960)>; }; - small_partition: partition@7f0000 { + small_partition: partition@7F0000 { label = "small"; - reg = <0x007f0000 DT_SIZE_K(64)>; + reg = <0x007F0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1050_evk_mimxrt1052_hyperflash.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1050_evk_mimxrt1052_hyperflash.overlay index d2f050371265..525f805af8df 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1050_evk_mimxrt1052_hyperflash.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1050_evk_mimxrt1052_hyperflash.overlay @@ -18,9 +18,9 @@ reg = <0x03800000 DT_SIZE_M(4)>; }; - small_partition: partition@3c00000 { + small_partition: partition@3C00000 { label = "small"; - reg = <0x03c00000 DT_SIZE_M(4)>; + reg = <0x03C00000 DT_SIZE_M(4)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay index b9cdfec161a4..1e9297aaf8a5 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay @@ -8,19 +8,19 @@ &w25q128jw { partitions { - large_partition: partition@c00000 { + large_partition: partition@C00000 { label = "large"; - reg = <0x00c00000 DT_SIZE_M(3)>; + reg = <0x00C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@f00000 { + medium_partition: partition@F00000 { label = "medium"; - reg = <0x00f00000 DT_SIZE_K(960)>; + reg = <0x00F00000 DT_SIZE_K(960)>; }; - small_partition: partition@ff0000 { + small_partition: partition@FF0000 { label = "small"; - reg = <0x00ff0000 DT_SIZE_K(64)>; + reg = <0x00FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1064_evk.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1064_evk.overlay index ad7041227faa..a96d11885868 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1064_evk.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1064_evk.overlay @@ -18,9 +18,9 @@ reg = <0x00700000 DT_SIZE_K(960)>; }; - small_partition: partition@7f0000 { + small_partition: partition@7F0000 { label = "small"; - reg = <0x007f0000 DT_SIZE_K(64)>; + reg = <0x007F0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay index daa41b2c5c20..0853b0c6afc8 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1160_evk_mimxrt1166_cm7.overlay @@ -8,19 +8,19 @@ &is25wp128 { partitions { - large_partition: partition@c00000 { + large_partition: partition@C00000 { label = "large"; - reg = <0x00c00000 DT_SIZE_M(3)>; + reg = <0x00C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@f00000 { + medium_partition: partition@F00000 { label = "medium"; - reg = <0x00f00000 DT_SIZE_K(960)>; + reg = <0x00F00000 DT_SIZE_K(960)>; }; - small_partition: partition@ff0000 { + small_partition: partition@FF0000 { label = "small"; - reg = <0x00ff0000 DT_SIZE_K(64)>; + reg = <0x00FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay index 03253f21593e..8f4bc077c247 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1170_evk_mimxrt1176_cm7.overlay @@ -8,19 +8,19 @@ &w25q512nw { partitions { - large_partition: partition@3c00000 { + large_partition: partition@3C00000 { label = "large"; - reg = <0x03c00000 DT_SIZE_M(3)>; + reg = <0x03C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@3f00000 { + medium_partition: partition@3F00000 { label = "medium"; - reg = <0x03f00000 DT_SIZE_K(960)>; + reg = <0x03F00000 DT_SIZE_K(960)>; }; - small_partition: partition@3ff0000 { + small_partition: partition@3FF0000 { label = "small"; - reg = <0x03ff0000 DT_SIZE_K(64)>; + reg = <0x03FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt1180_evk_mimxrt1189_cm33.overlay b/tests/subsys/fs/littlefs/boards/mimxrt1180_evk_mimxrt1189_cm33.overlay index abd821377986..0712305b3c8e 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt1180_evk_mimxrt1189_cm33.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt1180_evk_mimxrt1189_cm33.overlay @@ -8,19 +8,19 @@ &w25q128jw { partitions { - large_partition: partition@c00000 { + large_partition: partition@C00000 { label = "large"; - reg = <0x00c00000 DT_SIZE_M(3)>; + reg = <0x00C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@f00000 { + medium_partition: partition@F00000 { label = "medium"; - reg = <0x00f00000 DT_SIZE_K(960)>; + reg = <0x00F00000 DT_SIZE_K(960)>; }; - small_partition: partition@ff0000 { + small_partition: partition@FF0000 { label = "small"; - reg = <0x00ff0000 DT_SIZE_K(64)>; + reg = <0x00FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt595_evk_mimxrt595s_cm33.overlay b/tests/subsys/fs/littlefs/boards/mimxrt595_evk_mimxrt595s_cm33.overlay index 410320a5ebbe..5b02741d577a 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt595_evk_mimxrt595s_cm33.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt595_evk_mimxrt595s_cm33.overlay @@ -8,19 +8,19 @@ &mx25um51345g { partitions { - large_partition: partition@3c00000 { + large_partition: partition@3C00000 { label = "large"; - reg = <0x03c00000 DT_SIZE_M(3)>; + reg = <0x03C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@3f00000 { + medium_partition: partition@3F00000 { label = "medium"; - reg = <0x03f00000 DT_SIZE_K(960)>; + reg = <0x03F00000 DT_SIZE_K(960)>; }; - small_partition: partition@3ff0000 { + small_partition: partition@3FF0000 { label = "small"; - reg = <0x03ff0000 DT_SIZE_K(64)>; + reg = <0x03FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mimxrt685_evk_mimxrt685s_cm33.overlay b/tests/subsys/fs/littlefs/boards/mimxrt685_evk_mimxrt685s_cm33.overlay index 410320a5ebbe..5b02741d577a 100644 --- a/tests/subsys/fs/littlefs/boards/mimxrt685_evk_mimxrt685s_cm33.overlay +++ b/tests/subsys/fs/littlefs/boards/mimxrt685_evk_mimxrt685s_cm33.overlay @@ -8,19 +8,19 @@ &mx25um51345g { partitions { - large_partition: partition@3c00000 { + large_partition: partition@3C00000 { label = "large"; - reg = <0x03c00000 DT_SIZE_M(3)>; + reg = <0x03C00000 DT_SIZE_M(3)>; }; - medium_partition: partition@3f00000 { + medium_partition: partition@3F00000 { label = "medium"; - reg = <0x03f00000 DT_SIZE_K(960)>; + reg = <0x03F00000 DT_SIZE_K(960)>; }; - small_partition: partition@3ff0000 { + small_partition: partition@3FF0000 { label = "small"; - reg = <0x03ff0000 DT_SIZE_K(64)>; + reg = <0x03FF0000 DT_SIZE_K(64)>; }; }; }; diff --git a/tests/subsys/fs/littlefs/boards/mr_canhubk3.overlay b/tests/subsys/fs/littlefs/boards/mr_canhubk3.overlay index d494402a5fa0..d1e267e5e7dd 100644 --- a/tests/subsys/fs/littlefs/boards/mr_canhubk3.overlay +++ b/tests/subsys/fs/littlefs/boards/mr_canhubk3.overlay @@ -15,7 +15,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000f0000>; + reg = <0x00010000 0x000F0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/fs/littlefs/boards/native_sim.overlay b/tests/subsys/fs/littlefs/boards/native_sim.overlay index e1ee0717aafd..d7789f51e52c 100644 --- a/tests/subsys/fs/littlefs/boards/native_sim.overlay +++ b/tests/subsys/fs/littlefs/boards/native_sim.overlay @@ -23,7 +23,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000f0000>; + reg = <0x00010000 0x000F0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.overlay index c2ceb26ac379..766906bc2aab 100644 --- a/tests/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.overlay +++ b/tests/subsys/fs/littlefs/boards/nrf52840dk_nrf52840.overlay @@ -17,7 +17,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000f0000>; + reg = <0x00010000 0x000F0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu0.overlay b/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu0.overlay index bf936b16046d..1a81fb2b6ba9 100644 --- a/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu0.overlay +++ b/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu0.overlay @@ -15,7 +15,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000f0000>; + reg = <0x00010000 0x000F0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu1.overlay b/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu1.overlay index bf936b16046d..1a81fb2b6ba9 100644 --- a/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu1.overlay +++ b/tests/subsys/fs/littlefs/boards/s32z2xxdc2_s32z270_rtu1.overlay @@ -15,7 +15,7 @@ medium_partition: partition@10000 { label = "medium"; - reg = <0x00010000 0x000f0000>; + reg = <0x00010000 0x000F0000>; }; large_partition: partition@100000 { diff --git a/tests/subsys/mem_mgmt/mem_attr_heap/boards/qemu_cortex_m3.overlay b/tests/subsys/mem_mgmt/mem_attr_heap/boards/qemu_cortex_m3.overlay index 1d22fb42a6f4..d75f0423a4ea 100644 --- a/tests/subsys/mem_mgmt/mem_attr_heap/boards/qemu_cortex_m3.overlay +++ b/tests/subsys/mem_mgmt/mem_attr_heap/boards/qemu_cortex_m3.overlay @@ -17,30 +17,30 @@ zephyr,memory-attr = <(DT_MEM_CACHEABLE | DT_MEM_SW_ALLOC_CACHE)>; }; - mem_noncache_sw: memory@2000a000 { + mem_noncache_sw: memory@2000A000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000a000 0x1000>; + reg = <0x2000A000 0x1000>; zephyr,memory-region = "MEM_NON_CACHEABLE_SW"; zephyr,memory-attr = ; }; - mem_dma_sw: memory@2000b000 { + mem_dma_sw: memory@2000B000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000b000 0x1000>; + reg = <0x2000B000 0x1000>; zephyr,memory-region = "MEM_DMA_SW"; zephyr,memory-attr = <(DT_MEM_DMA | DT_MEM_SW_ALLOC_DMA)>; }; - mem_cache_sw_big: memory@2000c000 { + mem_cache_sw_big: memory@2000C000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000c000 0x2000>; + reg = <0x2000C000 0x2000>; zephyr,memory-region = "MEM_CACHEABLE_SW_BIG"; zephyr,memory-attr = <(DT_MEM_CACHEABLE | DT_MEM_SW_ALLOC_CACHE)>; }; - mem_cache_cache_dma_multi: memory@2000e000 { + mem_cache_cache_dma_multi: memory@2000E000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000e000 0x1000>; + reg = <0x2000E000 0x1000>; zephyr,memory-region = "MEM_CACHEABLE_SW_MULTI_ATTR"; zephyr,memory-attr = <(DT_MEM_CACHEABLE | DT_MEM_DMA | DT_MEM_SW_ALLOC_CACHE | DT_MEM_SW_ALLOC_DMA)>; diff --git a/tests/subsys/sd/sdio/boards/arduino_portenta_h7_stm32h747xx_m7.overlay b/tests/subsys/sd/sdio/boards/arduino_portenta_h7_stm32h747xx_m7.overlay index d2ee3d9bf794..2f231124a68c 100644 --- a/tests/subsys/sd/sdio/boards/arduino_portenta_h7_stm32h747xx_m7.overlay +++ b/tests/subsys/sd/sdio/boards/arduino_portenta_h7_stm32h747xx_m7.overlay @@ -13,11 +13,11 @@ }; &slot0_partition { - reg = <0x00040000 0x001c0000>; + reg = <0x00040000 0x001C0000>; }; &slot1_partition { - reg = <0x00200000 0x001c0000>; + reg = <0x00200000 0x001C0000>; }; &wifi { diff --git a/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay index 37bae45ab120..e7806a54b853 100644 --- a/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay +++ b/tests/subsys/settings/retention/boards/nrf52840dk_nrf52840.overlay @@ -9,9 +9,9 @@ /delete-property/ zephyr,boot-mode; }; - sram@2003f000 { + sram@2003F000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2003f000 DT_SIZE_K(4)>; + reg = <0x2003F000 DT_SIZE_K(4)>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay b/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay index 348b780c492f..fe9bab6b727c 100644 --- a/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay +++ b/tests/subsys/settings/retention/boards/qemu_cortex_m3.overlay @@ -5,9 +5,9 @@ */ / { - sram@2000f000 { + sram@2000F000 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x2000f000 0x1000>; + reg = <0x2000F000 0x1000>; zephyr,memory-region = "RetainedMem"; status = "okay"; diff --git a/tests/subsys/storage/flash_map/app.overlay b/tests/subsys/storage/flash_map/app.overlay index eed55beedcef..72875fff32b8 100644 --- a/tests/subsys/storage/flash_map/app.overlay +++ b/tests/subsys/storage/flash_map/app.overlay @@ -37,7 +37,7 @@ disabled_a_b: partition@100 { label = "disabled_a_b"; - reg = <0x00000100 0xf00>; + reg = <0x00000100 0xF00>; }; }; @@ -56,7 +56,7 @@ disabled_b_b: partition@100 { label = "disabled_b_b"; - reg = <0x00000100 0xf00>; + reg = <0x00000100 0xF00>; }; }; }; From abd4b535579301d8e9975a92be8e94f648d76b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:48 +0200 Subject: [PATCH 2873/3334] Revert "[nrf fromtree] dts: adc: add bindings for bflb adc" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d45a420465699d1896d92a58e73f0ff74e0fc37e. Signed-off-by: Andrzej Głąbek --- dts/bindings/adc/bflb,adc.yaml | 23 ----------------------- dts/riscv/bflb/bl60x.dtsi | 15 +-------------- dts/riscv/bflb/bl61x.dtsi | 15 +-------------- dts/riscv/bflb/bl70x.dtsi | 15 +-------------- 4 files changed, 3 insertions(+), 65 deletions(-) delete mode 100644 dts/bindings/adc/bflb,adc.yaml diff --git a/dts/bindings/adc/bflb,adc.yaml b/dts/bindings/adc/bflb,adc.yaml deleted file mode 100644 index b4a8388ece72..000000000000 --- a/dts/bindings/adc/bflb,adc.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) -# -# SPDX-License-Identifier: Apache-2.0 - -description: | - Bouffalolab ADC - -compatible: "bflb,adc" - -include: [adc-controller.yaml, pinctrl-device.yaml] - -properties: - reg: - required: true - - interrupts: - required: true - - "#io-channel-cells": - const: 1 - -io-channel-cells: - - input diff --git a/dts/riscv/bflb/bl60x.dtsi b/dts/riscv/bflb/bl60x.dtsi index 4ab191e8d149..d6f8429c7987 100644 --- a/dts/riscv/bflb/bl60x.dtsi +++ b/dts/riscv/bflb/bl60x.dtsi @@ -1,6 +1,6 @@ /* * Copyright (c) 2021-2025 ATL Electronics - * Copyright (c) 2024-2026 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -15,7 +15,6 @@ #include #include #include -#include / { #address-cells = <1>; @@ -146,18 +145,6 @@ "pll_120", "pll_48"; }; - adc0: adc@40002000 { - compatible = "bflb,adc"; - reg = <0x40002000 0x1000 0x4000F000 0x1000>; - #io-channel-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - - interrupts = <41 0>; - interrupt-parent = <&clic>; - }; - efuse: efuse@40007000 { compatible = "bflb,efuse"; reg = <0x40007000 0x1000>; diff --git a/dts/riscv/bflb/bl61x.dtsi b/dts/riscv/bflb/bl61x.dtsi index f63d472ec28a..be944d11a907 100644 --- a/dts/riscv/bflb/bl61x.dtsi +++ b/dts/riscv/bflb/bl61x.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024-2026 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -14,7 +14,6 @@ #include #include #include -#include / { #address-cells = <1>; @@ -161,18 +160,6 @@ "root", "bclk", "flash"; }; - adc0: adc@20002000 { - compatible = "bflb,adc"; - reg = <0x20002000 0x400 0x2000F000 0x1000>; - #io-channel-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - - interrupts = <41 1>; - interrupt-parent = <&clic>; - }; - uart0: uart@2000a000 { compatible = "bflb,uart"; reg = <0x2000a000 0x100>; diff --git a/dts/riscv/bflb/bl70x.dtsi b/dts/riscv/bflb/bl70x.dtsi index 1e6aadac74cf..4956750ea14a 100644 --- a/dts/riscv/bflb/bl70x.dtsi +++ b/dts/riscv/bflb/bl70x.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024-2026 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -14,7 +14,6 @@ #include #include #include -#include / { #address-cells = <1>; @@ -151,18 +150,6 @@ "dll_120", "dll_57"; }; - adc0: adc@40002000 { - compatible = "bflb,adc"; - reg = <0x40002000 0x1000 0x4000F000 0x1000>; - #io-channel-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - - interrupts = <41 0>; - interrupt-parent = <&clic>; - }; - efuse: efuse@40007000 { compatible = "bflb,efuse"; reg = <0x40007000 0x1000>; From 4c597c61622fb41cc4b67680d3ba7d839e19a45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:49 +0200 Subject: [PATCH 2874/3334] Revert "[nrf fromtree] dts: nxp: nxp_mcxe24x_common.dtsi: add uuid/hwinfo feature" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 65548dfb38d52547d170b0badd08d8e32476c8e9. Signed-off-by: Andrzej Głąbek --- dts/arm/nxp/nxp_mcxe24x_common.dtsi | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dts/arm/nxp/nxp_mcxe24x_common.dtsi b/dts/arm/nxp/nxp_mcxe24x_common.dtsi index 36ab6c38185a..feff15d88f65 100644 --- a/dts/arm/nxp/nxp_mcxe24x_common.dtsi +++ b/dts/arm/nxp/nxp_mcxe24x_common.dtsi @@ -643,11 +643,6 @@ clocks = <&pcc 0x134 KINETIS_PCC_SRC_NONE_OR_EXT>; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - rtc: rtc@4003d000 { compatible = "nxp,rtc"; reg = <0x4003d000 0x1000>; @@ -710,11 +705,6 @@ reg = <0x40032000 0x1000>; status = "disabled"; }; - - uuid: uuid@40048000 { - compatible = "nxp,sim-uuid"; - reg = <0x40048000 0x1000>; - }; }; }; From a160fcf170b60629b12a07ce9d1399fce5c011e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:49 +0200 Subject: [PATCH 2875/3334] Revert "[nrf fromtree] boards: u-blox: ubx_evkninab5: add new board" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7a276854dc77d01e2eeae438d6c9e0bc9b542833. Signed-off-by: Andrzej Głąbek --- .../ubx_evkninab5/Kconfig.ubx_evkninab5 | 7 - boards/u-blox/ubx_evkninab5/board.cmake | 8 - boards/u-blox/ubx_evkninab5/board.yml | 6 - boards/u-blox/ubx_evkninab5/doc/index.rst | 162 ------------------ .../ubx_evkninab5/doc/ubx_evkninab5.webp | Bin 70150 -> 0 bytes .../ubx_evkninab5_mcxw716c-pinctrl.dtsi | 35 ---- .../ubx_evkninab5/ubx_evkninab5_mcxw716c.dts | 158 ----------------- .../ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml | 22 --- .../ubx_evkninab5_mcxw716c_defconfig | 11 -- 9 files changed, 409 deletions(-) delete mode 100644 boards/u-blox/ubx_evkninab5/Kconfig.ubx_evkninab5 delete mode 100644 boards/u-blox/ubx_evkninab5/board.cmake delete mode 100644 boards/u-blox/ubx_evkninab5/board.yml delete mode 100644 boards/u-blox/ubx_evkninab5/doc/index.rst delete mode 100644 boards/u-blox/ubx_evkninab5/doc/ubx_evkninab5.webp delete mode 100644 boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c-pinctrl.dtsi delete mode 100644 boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts delete mode 100644 boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml delete mode 100644 boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c_defconfig diff --git a/boards/u-blox/ubx_evkninab5/Kconfig.ubx_evkninab5 b/boards/u-blox/ubx_evkninab5/Kconfig.ubx_evkninab5 deleted file mode 100644 index f55fee1c1cf1..000000000000 --- a/boards/u-blox/ubx_evkninab5/Kconfig.ubx_evkninab5 +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2026 NXP -# Copyright 2026 u-blox -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_UBX_EVKNINAB5 - select SOC_MCXW716C - select SOC_PART_NUMBER_MCXW716CMFTA diff --git a/boards/u-blox/ubx_evkninab5/board.cmake b/boards/u-blox/ubx_evkninab5/board.cmake deleted file mode 100644 index a815f9608c33..000000000000 --- a/boards/u-blox/ubx_evkninab5/board.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2026 u-blox -# SPDX-License-Identifier: Apache-2.0 - -board_runner_args(linkserver "--device=MCXW716CxxxA:UBX_EVKNINAB5") -board_runner_args(jlink "--device=mcxw716" "--reset-after-load") - -include(${ZEPHYR_BASE}/boards/common/linkserver.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/u-blox/ubx_evkninab5/board.yml b/boards/u-blox/ubx_evkninab5/board.yml deleted file mode 100644 index 99aa257ea084..000000000000 --- a/boards/u-blox/ubx_evkninab5/board.yml +++ /dev/null @@ -1,6 +0,0 @@ -board: - name: ubx_evkninab5 - full_name: EVK-NINA-B5-MCXW716C - vendor: u-blox - socs: - - name: mcxw716c diff --git a/boards/u-blox/ubx_evkninab5/doc/index.rst b/boards/u-blox/ubx_evkninab5/doc/index.rst deleted file mode 100644 index b38241b96d51..000000000000 --- a/boards/u-blox/ubx_evkninab5/doc/index.rst +++ /dev/null @@ -1,162 +0,0 @@ -.. zephyr:board:: ubx_evkninab5 - -Overview -******** - -The EVK-NINA-B5 is a compact and scalable development board for rapid -prototyping of the NINA-B5 wireless module. It offers easy evaluation of the -NINA-B5's multiprotocol wireless support for Bluetooth LE, Zigbee, Thread and -Matter. The board includes an on-board J-link-Link debugger and industry -standard headers for easy access to the MCU’s I/Os. - -The NINA-B5 module is built on the MCX W71x 96 MHz Arm® Cortex®-M33 from NXP. - -Hardware -******** - -- MCXW71 Arm Cortex-M33 microcontroller running up to 96 MHz -- 1MB on-chip Flash memory unit -- 128 KB TCM RAM -- On-board MCU-Link debugger with CMSIS-DAP - -For more information about the NINA-B5 module and EVK-NINA-B5 board, see: - -- `NINA-B5 product page`_ -- `EVK-NINA-B5 product page`_ - -Supported Features -================== - -.. zephyr:board-supported-hw:: - -Fetch Binary Blobs -****************** - -To support Bluetooth, ubx_evkninab5 requires fetching binary blobs, which can be -achieved by running the following command: - -.. code-block:: console - - west blobs fetch hal_nxp - -Note: The EVK-NINA-B5 is preflashed with NBU files. - -Programming and Debugging -************************* - -.. zephyr:board-supported-runners:: - -Build and flash applications as usual (see :ref:`build_an_application` and -:ref:`application_run` for more details). - -Configuring a Debug Probe -========================= - -A debug probe is used for both flashing and debugging the board. This board is -configured by default to use the MCU-Link CMSIS-DAP Onboard Debug Probe. - - -Using J-Link ------------- - -The onboard debug circuit is a Segger J-Link debugger - -The second option is to attach a :ref:`jlink-external-debug-probe` to the -10-pin SWD connector (J12) of the board. - -For both options use the ``-r jlink`` option with west to use the jlink runner. - -.. code-block:: console - - west flash -r jlink - -Configuring a Console -===================== - -Connect a USB cable from your PC to the USB port, and use the serial terminal -of your choice (minicom, putty, etc.) with the following settings: - -- Speed: 115200 -- Data: 8 bits -- Parity: None -- Stop bits: 1 - -Application Building -==================== - -.. zephyr-app-commands:: - :zephyr-app: samples/basic/button - :board: ubx_evkninab5 - :goals: build - :gen-args: - - -Application Flashing -==================== - -Here is an example for the :zephyr:code-sample:`hello_world` application. - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: ubx_evkninab5 - :goals: flash - -Open a serial terminal, reset the board (press the RESET button), and you should -see the following message in the terminal: - -.. code-block:: console - - *** Booting Zephyr OS build v3.7.0-xxx-xxxx *** - Hello World! ubx_evkninab5 - -Debugging -========= - -Here is an example for the :zephyr:code-sample:`hello_world` application. - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: ubx_evkninab5 - :goals: debug - -Open a serial terminal, step through the application in your debugger, and you -should see the following message in the terminal: - -.. code-block:: console - - *** Booting Zephyr OS build v3.7.0-xxx-xxxx *** - Hello World! ubx_evkninab5 - -NBU Flashing -============ - -BLE functionality requires to fetch binary blobs, so make sure to follow -the ``Fetch Binary Blobs`` section first. - -Two images must be written to the board: one for the host (CM33) and one for the NBU (CM3). - -- To flash the application (CM33) refer to the ``Application Flashing`` section above. - -- To flash the ``NBU Flashing``, follow the instructions below in the NINA-B5 system - integration manual available on the `NINA-B5 product page`_. - -The NBU files can be found in : ``/modules/hal/nxp/zephyr/blobs/mcxw71/`` folder. - -For more details: - -.. _MCXW71 In-System Programming Utility: - https://docs.nxp.com/bundle/AN14427/page/topics/introduction.html - -.. _blhost Website: - https://www.nxp.com/search?keyword=blhost&start=0 - -References -********** - -.. target-notes:: - -.. _NINA-B5 product page: - https://www.u-blox.com/en/product/nina-b50-series-open-cpu - -.. _EVK-NINA-B5 product page: - https://www.u-blox.com/en/product/evk-nina-b5?legacy=Current#Documentation-&-resources diff --git a/boards/u-blox/ubx_evkninab5/doc/ubx_evkninab5.webp b/boards/u-blox/ubx_evkninab5/doc/ubx_evkninab5.webp deleted file mode 100644 index b870bdd4f2a9f62aa33507ef55e85ffe97fa12d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 70150 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 - -&pinctrl { - pinmux_lpuart0: pinmux_lpuart0 { - group0 { - pinmux = , ; - drive-strength = "low"; - slew-rate = "fast"; - }; - }; - - pinmux_lpuart1: pinmux_lpuart1 { - group0 { - pinmux = , ; - drive-strength = "low"; - slew-rate = "fast"; - }; - }; - - pinmux_lpadc0: pinmux_lpadc0 { - group0 { - pinmux = , - , - ; - drive-strength = "low"; - slew-rate = "fast"; - }; - }; -}; diff --git a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts deleted file mode 100644 index 7c3fa4fa51b8..000000000000 --- a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.dts +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2026 u-blox - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "ubx_evkninab5_mcxw716c-pinctrl.dtsi" -#include -#include - -/ { - model = "u-blox EVK-NINA-B5 mcxw71"; - compatible = "u-blox,ubx_evkninab5_mcxw716c"; - - aliases { - led0 = &blue_led; - sw0 = &user_button_0; - }; - - chosen { - zephyr,flash = &flash; - zephyr,flash-controller = &fmu; - zephyr,code-partition = &slot0_partition; - zephyr,sram = &stcm0; - zephyr,console = &lpuart1; - zephyr,shell-uart = &lpuart1; - zephyr,uart-pipe = &lpuart0; - zephyr,uart-mcumgr = &lpuart0; - zephyr,bt-c2h-uart = &lpuart0; - }; - - user_led { - compatible = "gpio-leds"; - - blue_led: led { - gpios = <&gpioc 5 GPIO_ACTIVE_LOW>; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - - user_button_0: button_0 { - label = "User SW2"; - gpios = <&gpiod 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - zephyr,code = ; - status = "okay"; - }; - }; - - arduino_header: arduino-connector { - compatible = "arduino-header-r3"; - #gpio-cells = <2>; - gpio-map-mask = <0xffffffff 0xffffffc0>; - gpio-map-pass-thru = <0 0x3f>; - gpio-map = , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - ; - }; -}; - -&vref { - status = "okay"; -}; - -&gpiob { - status = "okay"; -}; - -&gpioc { - status = "okay"; -}; - -&gpiod { - status = "okay"; -}; - -&lpuart0 { - current-speed = <115200>; - status = "okay"; - pinctrl-0 = <&pinmux_lpuart0>; - pinctrl-names = "default"; -}; - -&lpuart1 { - current-speed = <115200>; - status = "okay"; - pinctrl-0 = <&pinmux_lpuart1>; - pinctrl-names = "default"; -}; - -&flash { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - /* - * Partition sizes must be aligned - * to the flash memory sector size of 8KB. - */ - boot_partition: partition@0 { - reg = <0x0 DT_SIZE_K(64)>; - }; - - slot0_partition: partition@10000 { - reg = <0x10000 DT_SIZE_K(424)>; - }; - - slot1_partition: partition@7A000 { - reg = <0x7A000 DT_SIZE_K(424)>; - }; - - storage_partition: partition@E4000 { - reg = <0xE4000 DT_SIZE_K(112)>; - }; - }; -}; - -&fmu { - status = "okay"; -}; - -&lptmr0 { - status = "okay"; -}; - -&adc0 { - pinctrl-0 = <&pinmux_lpadc0>; - pinctrl-names = "default"; - status = "okay"; -}; - -&nbu { - status = "okay"; - wakeup-source; -}; - -&rtc { - status = "okay"; -}; diff --git a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml deleted file mode 100644 index b09c63aea81c..000000000000 --- a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c.yaml +++ /dev/null @@ -1,22 +0,0 @@ -identifier: ubx_evkninab5 -name: u-blox EVK-NINA-B5 -type: mcu -arch: arm -ram: 64 -flash: 1024 -toolchain: - - zephyr - - gnuarmemb -supported: - - adc - - can - - counter - - flash - - flexio - - gpio - - pinctrl - - pwm - - regulator - - uart - - watchdog -vendor: u-blox diff --git a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c_defconfig b/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c_defconfig deleted file mode 100644 index 73fbe1834b5b..000000000000 --- a/boards/u-blox/ubx_evkninab5/ubx_evkninab5_mcxw716c_defconfig +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright 2026 u-blox -# SPDX-License-Identifier: Apache-2.0 -# - -CONFIG_ARM_MPU=y -CONFIG_TRUSTED_EXECUTION_SECURE=y -CONFIG_SERIAL=y -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y -CONFIG_GPIO=y From 92aa4d4b04f331f685be5eff93df21461ec0fd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:49 +0200 Subject: [PATCH 2876/3334] Revert "[nrf fromtree] dts: renesas: Add ADC support for Renesas RZ SoCs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 44bfa10b3fd6efd1726f492e5c0e728c2f210f1e. Signed-off-by: Andrzej Głąbek --- dts/arm/renesas/rz/rzg/r9a07g043.dtsi | 12 ------- dts/arm/renesas/rz/rzg/r9a07g044.dtsi | 12 ------- dts/arm/renesas/rz/rzt/r9a07g074.dtsi | 25 --------------- dts/arm/renesas/rz/rzv/r9a09g056.dtsi | 37 ---------------------- dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi | 13 -------- dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi | 13 -------- 6 files changed, 112 deletions(-) diff --git a/dts/arm/renesas/rz/rzg/r9a07g043.dtsi b/dts/arm/renesas/rz/rzg/r9a07g043.dtsi index de045977f24d..f40b425f9338 100644 --- a/dts/arm/renesas/rz/rzg/r9a07g043.dtsi +++ b/dts/arm/renesas/rz/rzg/r9a07g043.dtsi @@ -6,7 +6,6 @@ #include #include #include -#include #include / { @@ -221,17 +220,6 @@ }; }; - adc: adc@40059000 { - compatible = "renesas,rz-adc-c"; - reg = <0x40059000 DT_SIZE_K(1)>; - interrupts = <347 3>; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0x3>; - status = "disabled"; - }; - scif0: serial@4004b800 { compatible = "renesas,rz-scif-uart"; channel = <0>; diff --git a/dts/arm/renesas/rz/rzg/r9a07g044.dtsi b/dts/arm/renesas/rz/rzg/r9a07g044.dtsi index e1567177e7c4..f4c0d9e1cee7 100644 --- a/dts/arm/renesas/rz/rzg/r9a07g044.dtsi +++ b/dts/arm/renesas/rz/rzg/r9a07g044.dtsi @@ -6,7 +6,6 @@ #include #include #include -#include #include / { @@ -491,17 +490,6 @@ }; }; - adc: adc@40059000 { - compatible = "renesas,rz-adc-c"; - reg = <0x40059000 DT_SIZE_K(1)>; - interrupts = <347 3>; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0xFF>; - status = "disabled"; - }; - scif0: serial@4004b800 { compatible = "renesas,rz-scif-uart"; channel = <0>; diff --git a/dts/arm/renesas/rz/rzt/r9a07g074.dtsi b/dts/arm/renesas/rz/rzt/r9a07g074.dtsi index 518da4dd89ba..abe232f261a8 100644 --- a/dts/arm/renesas/rz/rzt/r9a07g074.dtsi +++ b/dts/arm/renesas/rz/rzt/r9a07g074.dtsi @@ -7,7 +7,6 @@ #include #include #include -#include #include / { @@ -479,30 +478,6 @@ }; }; - adc0: adc0@90004000 { - compatible = "renesas,rz-adc"; - reg = <0x90004000 0x800>; - unit = <0>; - interrupts = ; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0xF>; - status = "disabled"; - }; - - adc1: adc1@90004800 { - compatible = "renesas,rz-adc"; - reg = <0x90004800 0x800>; - unit = <1>; - interrupts = ; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0xF>; - status = "disabled"; - }; - sci0: sci0@80001000 { compatible = "renesas,rz-sci"; reg = <0x80001000 0x400>; diff --git a/dts/arm/renesas/rz/rzv/r9a09g056.dtsi b/dts/arm/renesas/rz/rzv/r9a09g056.dtsi index 8af64a2690b3..4dbe6691befc 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g056.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g056.dtsi @@ -6,7 +6,6 @@ #include #include #include -#include #include / { @@ -158,42 +157,6 @@ }; }; - adc0: adc0@41c00000 { - compatible = "renesas,rz-adc-e"; - reg = <0x41c00000 0x400>; - unit = <0>; - interrupts = <403 3>; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0xFF>; - status = "disabled"; - }; - - adc1: adc1@41c02800 { - compatible = "renesas,rz-adc-e"; - reg = <0x41c02800 0x400>; - unit = <1>; - interrupts = <404 3>; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0xFF>; - status = "disabled"; - }; - - adc2: adc2@41c02c00 { - compatible = "renesas,rz-adc-e"; - reg = <0x41c02c00 0x400>; - unit = <2>; - interrupts = <405 3>; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0xFF>; - status = "disabled"; - }; - gpt0: gpt@43010000 { compatible = "renesas,rz-gpt"; reg = <0x43010000 0x100>; diff --git a/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi b/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi index 5dad51d7aff4..5b919bb56634 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g057_cm33.dtsi @@ -6,7 +6,6 @@ #include #include #include -#include #include / { @@ -717,18 +716,6 @@ }; }; - adc0: adc0@41c00000 { - compatible = "renesas,rz-adc-e"; - reg = <0x41c00000 0x400>; - unit = <0>; - interrupts = <403 3>; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0xFF>; - status = "disabled"; - }; - sci0: sci0@42800c00 { compatible = "renesas,rz-sci-b"; reg = <0x42800c00 0x400>; diff --git a/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi b/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi index 5e61653c3d59..9127fd27de52 100644 --- a/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi +++ b/dts/arm/renesas/rz/rzv/r9a09g057_cr8.dtsi @@ -6,7 +6,6 @@ #include #include #include -#include #include #include @@ -197,18 +196,6 @@ }; }; - adc0: adc0@11c00000 { - compatible = "renesas,rz-adc-e"; - reg = <0x11c00000 0x400>; - unit = <0>; - interrupts = ; - interrupt-names = "scanend"; - #io-channel-cells = <1>; - vref-mv = <1800>; - channel-available-mask = <0xFF>; - status = "disabled"; - }; - gpt0: gpt@13010000 { compatible = "renesas,rz-gpt"; reg = <0x13010000 0x100>; From 9e0a846fba06112ad06e0258a489edc026daa94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:50 +0200 Subject: [PATCH 2877/3334] Revert "[nrf fromtree] dts: arm: nxp: Add specific compatible strings for RCM and SIM" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 68f4031b4f177540ef01c190a357a2793fd07970. Signed-off-by: Andrzej Głąbek --- dts/arm/nxp/nxp_k2x.dtsi | 7 +------ dts/arm/nxp/nxp_k32l2b3.dtsi | 7 +------ dts/arm/nxp/nxp_k6x.dtsi | 7 +------ dts/arm/nxp/nxp_k8x.dtsi | 7 +------ dts/arm/nxp/nxp_kl25z.dtsi | 7 +------ dts/arm/nxp/nxp_kv5x.dtsi | 7 +------ dts/arm/nxp/nxp_kw2xd.dtsi | 13 ++----------- dts/arm/nxp/nxp_kw40z.dtsi | 13 ++----------- dts/arm/nxp/nxp_kw41z.dtsi | 7 +------ dts/arm/nxp/nxp_mcxc_common.dtsi | 7 +------ 10 files changed, 12 insertions(+), 70 deletions(-) diff --git a/dts/arm/nxp/nxp_k2x.dtsi b/dts/arm/nxp/nxp_k2x.dtsi index 9b6850a5003f..c56eec74a558 100644 --- a/dts/arm/nxp/nxp_k2x.dtsi +++ b/dts/arm/nxp/nxp_k2x.dtsi @@ -81,13 +81,8 @@ clock-frequency = <32768>; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_k32l2b3.dtsi b/dts/arm/nxp/nxp_k32l2b3.dtsi index 0c2ced6dc83f..223c419dce4b 100644 --- a/dts/arm/nxp/nxp_k32l2b3.dtsi +++ b/dts/arm/nxp/nxp_k32l2b3.dtsi @@ -87,13 +87,8 @@ #clock-cells = <1>; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_k6x.dtsi b/dts/arm/nxp/nxp_k6x.dtsi index 0f186f705399..bd8a859aebb1 100644 --- a/dts/arm/nxp/nxp_k6x.dtsi +++ b/dts/arm/nxp/nxp_k6x.dtsi @@ -112,13 +112,8 @@ prescaler = <32768>; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_k8x.dtsi b/dts/arm/nxp/nxp_k8x.dtsi index 38ae65795291..351a6f750efc 100644 --- a/dts/arm/nxp/nxp_k8x.dtsi +++ b/dts/arm/nxp/nxp_k8x.dtsi @@ -45,13 +45,8 @@ status = "disabled"; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x2000>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kl25z.dtsi b/dts/arm/nxp/nxp_kl25z.dtsi index af4091f9b28e..068071fbf514 100644 --- a/dts/arm/nxp/nxp_kl25z.dtsi +++ b/dts/arm/nxp/nxp_kl25z.dtsi @@ -82,13 +82,8 @@ status = "disabled"; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kv5x.dtsi b/dts/arm/nxp/nxp_kv5x.dtsi index 82d8c9d16f35..ae2107303435 100644 --- a/dts/arm/nxp/nxp_kv5x.dtsi +++ b/dts/arm/nxp/nxp_kv5x.dtsi @@ -40,13 +40,8 @@ status = "disabled"; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x2000>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kw2xd.dtsi b/dts/arm/nxp/nxp_kw2xd.dtsi index bf0ce0335adf..f1fedeb61269 100644 --- a/dts/arm/nxp/nxp_kw2xd.dtsi +++ b/dts/arm/nxp/nxp_kw2xd.dtsi @@ -1,8 +1,4 @@ -/* - * Copyright 2026 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ #include #include @@ -83,13 +79,8 @@ clock-frequency = <32768>; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kw40z.dtsi b/dts/arm/nxp/nxp_kw40z.dtsi index 88feb64b3dbb..cd89adf080ce 100644 --- a/dts/arm/nxp/nxp_kw40z.dtsi +++ b/dts/arm/nxp/nxp_kw40z.dtsi @@ -1,8 +1,4 @@ -/* - * Copyright 2026 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ +/* SPDX-License-Identifier: Apache-2.0 */ #include #include @@ -60,13 +56,8 @@ clock-frequency = <32768>; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_kw41z.dtsi b/dts/arm/nxp/nxp_kw41z.dtsi index 19680e26d6b8..3896629aa55e 100644 --- a/dts/arm/nxp/nxp_kw41z.dtsi +++ b/dts/arm/nxp/nxp_kw41z.dtsi @@ -63,13 +63,8 @@ prescaler = <32768>; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x1060>; #clock-cells = <3>; diff --git a/dts/arm/nxp/nxp_mcxc_common.dtsi b/dts/arm/nxp/nxp_mcxc_common.dtsi index 90a68cd8e058..2756aa6b7721 100644 --- a/dts/arm/nxp/nxp_mcxc_common.dtsi +++ b/dts/arm/nxp/nxp_mcxc_common.dtsi @@ -92,13 +92,8 @@ #clock-cells = <1>; }; - rcm: rcm@4007F000 { - compatible = "nxp,rcm-hwinfo"; - reg = <0x4007F000 0x1000>; - }; - sim: sim@40047000 { - compatible = "nxp,kinetis-sim", "nxp,sim-uuid"; + compatible = "nxp,kinetis-sim"; reg = <0x40047000 0x1060>; #clock-cells = <3>; From 225f80cb89da66c74aa1a620be8a2027e81bb98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:50 +0200 Subject: [PATCH 2878/3334] Revert "[nrf fromtree] boards: nxp: mcxn947: updated partitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1514a19721ba9c1461ab39deb37bf9adafb478c0. Signed-off-by: Andrzej Głąbek --- .../frdm_mcxn947_mcxn947_cpu0_ns.dts | 55 ++----------------- .../frdm_mcxn947_mcxn947_cpu0_ns_defconfig | 6 +- 2 files changed, 7 insertions(+), 54 deletions(-) diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts index 7e4ac87cb46a..71cb3a93dc9c 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns.dts @@ -56,59 +56,12 @@ #size-cells = <1>; /* - * All partition sizes must be aligned to the flash memory sector size (8 KB). - * - * This flash layout must exactly match the upstream TF-M layout defined in - * the platform-specific `flash_layout.h`. Any modification to the layout - * must be applied consistently in both `flash_layout.h` and this file. - * - * BL2 / MCUBoot + * Partition sizes must be aligned + * to the flash memory sector size of 8KB. */ - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 DT_SIZE_K(64)>; /* 64 KB */ - }; - - /* Secure image - primary */ - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x00010000 DT_SIZE_K(288)>; /* 288 KB */ - }; - - /* Non-secure image - primary */ - slot0_ns_partition: partition@58000 { + slot0_ns_partition: partition@80000 { label = "image-0-nonsecure"; - reg = <0x00058000 DT_SIZE_K(256)>; /* 256 KB */ - }; - - /* Secure image - secondary */ - slot1_partition: partition@98000 { - label = "image-1-secondary"; - reg = <0x00098000 DT_SIZE_K(288)>; /* 288 KB */ - }; - - /* Non-secure image - secondary */ - slot1_ns_partition: partition@E0000 { - label = "image-1-non-secure"; - reg = <0x000E0000 DT_SIZE_K(256)>; /* 256 KB */ - }; - - /* Protected Storage (PS) */ - tfm_ps_partition: partition@120000 { - label = "tfm-ps"; - reg = <0x00120000 DT_SIZE_K(16)>; /* 16 KB */ - }; - - /* Internal Trusted Storage (ITS) */ - tfm_its_partition: partition@124000 { - label = "tfm-its"; - reg = <0x00124000 DT_SIZE_K(16)>; /* 16 KB */ - }; - - /* OTP / NV counters */ - tfm_otp_partition: partition@128000 { - label = "tfm-otp"; - reg = <0x00128000 DT_SIZE_K(8)>; /* 8 KB */ + reg = <0x00080000 DT_SIZE_K(512)>; }; }; }; diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns_defconfig b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns_defconfig index 66adee8f206b..9f421c6b50bb 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns_defconfig +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_ns_defconfig @@ -1,5 +1,5 @@ # -# Copyright 2025-2026 NXP +# Copyright 2025 NXP # # SPDX-License-Identifier: Apache-2.0 # @@ -14,6 +14,6 @@ CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y CONFIG_TRUSTED_EXECUTION_NONSECURE=y -CONFIG_TFM_BL2=y +CONFIG_TFM_BL2=n CONFIG_BUILD_WITH_TFM=y -CONFIG_FLASH_BASE_ADDRESS=0x58000 +CONFIG_FLASH_BASE_ADDRESS=0x80000 From cb7213919d90163ccdd3cc2b193a084d097bb01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:50 +0200 Subject: [PATCH 2879/3334] Revert "[nrf fromtree] boards: aithinker: bflb: ai_m61_32s demonstrates overclocking" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8cc212e3cde152bc4d23bbcc8e92f34a0d00aff5. Signed-off-by: Andrzej Głąbek --- .../ai_m61_32s_kit/Kconfig.ai_m61_32s_kit | 32 +----- .../aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi | 7 +- .../ai_m61_32s_kit/ai_m61_32s_kit.dts | 97 ++++++++++++++++- .../ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay | 12 --- ...m61_32s_kit_bl618m05q2i_safe_overclock.dts | 27 ----- ...kit_bl618m05q2i_safe_overclock_ALL.overlay | 18 ---- ...1_32s_kit_bl618m05q2i_unsafe_overclock.dts | 35 ------ ...t_bl618m05q2i_unsafe_overclock_ALL.overlay | 27 ----- .../ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi | 100 ------------------ .../ai_m61_32s_kit/ai_m61_32s_kit_defconfig | 10 ++ boards/aithinker/ai_m61_32s_kit/board.yml | 12 +-- boards/aithinker/ai_m61_32s_kit/doc/index.rst | 11 +- .../aithinker/ai_m61_32s_kit/revision.cmake | 8 -- 13 files changed, 114 insertions(+), 282 deletions(-) delete mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay delete mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock.dts delete mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock_ALL.overlay delete mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock.dts delete mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock_ALL.overlay delete mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi create mode 100644 boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_defconfig delete mode 100644 boards/aithinker/ai_m61_32s_kit/revision.cmake diff --git a/boards/aithinker/ai_m61_32s_kit/Kconfig.ai_m61_32s_kit b/boards/aithinker/ai_m61_32s_kit/Kconfig.ai_m61_32s_kit index 2cc4ccde0155..318e560e4e8e 100644 --- a/boards/aithinker/ai_m61_32s_kit/Kconfig.ai_m61_32s_kit +++ b/boards/aithinker/ai_m61_32s_kit/Kconfig.ai_m61_32s_kit @@ -1,34 +1,6 @@ -# Copyright (c) 2024-2026 MASSDRIVER EI (massdriver.space) +# Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space) # # SPDX-License-Identifier: Apache-2.0 config BOARD_AI_M61_32S_KIT - select SOC_BL618M05Q2I if BOARD_REVISION_DEFAULT - select SOC_BL618M65Q2I if BOARD_REVISION_ALL - -if BOARD_AI_M61_32S_KIT - -config BOARD_REVISION_DEFAULT - bool - -config BOARD_REVISION_ALL - bool - -# Avoid adding 8 identical files -config CONSOLE - bool - default y - -config SERIAL - bool - default y - -config UART_CONSOLE - bool - default y - -config MEMC - bool - default y - -endif + select SOC_BL618M65Q2I diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi index 75c4225ab31c..d9f20cbd6867 100644 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025-2026 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2025 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -27,7 +27,10 @@ &flashctrl { flash0: flash@A0000000 { - compatible = "soc-nv-flash", "gd,gd25q64e"; + /* in-chip xmc flash die on ALL variant, NC pins noneffective + * in-module SOIC-8 gigadevice flash on non-ALL variant, NC pins effective + */ + compatible = "soc-nv-flash", "xmc,xm25qw64", "gd,gd25q64e"; reg = <0xA0000000 (0x800000 - 0x2000)>; write-block-size = <256>; erase-block-size = ; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit.dts b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit.dts index b7f8551f6720..080f7ec40f88 100644 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit.dts +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025-2026 MASSDRIVER EI (massdriver.space) + * Copyright (c) 2025 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ @@ -7,4 +7,97 @@ /dts-v1/; #include "ai_m61_32s.dtsi" -#include "ai_m61_32s_kit_common.dtsi" +#include "ai_m61_32s_kit-pinctrl.dtsi" + +/ { + model = "Ai-Thinker M61-32S development board"; + + aliases { + led0 = &blue_led; + sw0 = &button_0; + pwm-led0 = &blue_pwm_led; + }; + + leds { + compatible = "gpio-leds"; + + blue_led: led_0 { + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + label = "Blue - LED0"; + }; + + green_led: led_1 { + gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; + label = "Green - LED1"; + }; + + red_led: led_2 { + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + label = "Red - LED2"; + }; + + white_led: led_3 { + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + label = "White - LED3"; + }; + + warmwhite_led: led_4 { + gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; + label = "Warm White - LED4"; + }; + }; + + pwmleds: pwmleds { + compatible = "pwm-leds"; + status = "disabled"; + + blue_pwm_led: led_pwm_0 { + pwms = <&pwm0 3 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "Blue - LED0 PWM"; + }; + + green_pwm_led: led_pwm_1 { + pwms = <&pwm0 2 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "Green - LED1 PWM"; + }; + + red_pwm_led: led_pwm_2 { + pwms = <&pwm0 0 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "Red - LED2 PWM"; + }; + + white_pwm_led: led_pwm_3 { + pwms = <&pwm0 1 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "White - LED3 PWM"; + }; + + warmwhite_pwm_led: led_pwm_4 { + pwms = <&pwm0 3 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "Warm White - LED4 PWM"; + }; + }; + + buttons { + compatible = "gpio-keys"; + + button_0: sw0 { + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + zephyr,code = ; + }; + }; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&spi0 { + status = "okay"; + + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; +}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay deleted file mode 100644 index 78ca5ad05c18..000000000000 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_ALL.overlay +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&flash0 { - /* ALL revision is BL618M65, which has an internal XMC Flash die - * instead of an external SOIC Flash. - */ - compatible = "soc-nv-flash", "xmc,xm25qw64"; -}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock.dts b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock.dts deleted file mode 100644 index 31c58b656440..000000000000 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock.dts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include "ai_m61_32s.dtsi" -#include "ai_m61_32s_kit_common.dtsi" - -&clk_root { - /* Increased PLL speed used as FCLK */ - clocks = <&clk_wifipll BL61X_WIFIPLL_OC_480MHz>; -}; - -&clk_bclk { - /* 120 MHz BCLK and so Flash clock at this FCLK works for both revisions */ - divider = <4>; -}; - -&clk_flash { - /* 0 Units of delay for GD Flash but inverted RX */ - read-delay = <0>; - rx-clock-invert; - divider = <1>; -}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock_ALL.overlay b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock_ALL.overlay deleted file mode 100644 index 34665912841b..000000000000 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_safe_overclock_ALL.overlay +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&flash0 { - /* ALL revision is BL618M65, which has an internal XMC Flash die - * instead of an external SOIC Flash. - */ - compatible = "soc-nv-flash", "xmc,xm25qw64"; -}; - -&clk_flash { - /* 1 Unit of delay (4 Cycles) for XMC Flash at 120 MHz Flash clock */ - read-delay = <1>; - /delete-property/ rx-clock-invert; -}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock.dts b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock.dts deleted file mode 100644 index 32973b217c07..000000000000 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock.dts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include "ai_m61_32s.dtsi" -#include "ai_m61_32s_kit_common.dtsi" - -&clk_root { - /* Increased PLL speed used as FCLK */ - clocks = <&clk_wifipll BL61X_WIFIPLL_OCMAX_640MHz>; -}; - -®_soc { - /* SoC LDO at 1.25v to handle 640MHz FCLK*/ - regulator-init-microvolt = <1250000>; -}; - -/* With the settings used for their flash (Dual Out mode), the ALL and non-ALL revisions - * need different flash clock settings to work properly at 640MHz FCLK. - */ -&clk_bclk { - /* 120MHz BCLK */ - divider = <5>; -}; - -&clk_flash { - /* 0 Units of delay for GD Flash but inverted RX */ - read-delay = <0>; - rx-clock-invert; - divider = <1>; -}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock_ALL.overlay b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock_ALL.overlay deleted file mode 100644 index ce7067e85702..000000000000 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_bl618m05q2i_unsafe_overclock_ALL.overlay +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2026 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&flash0 { - /* ALL revision is BL618M65, which has an internal XMC Flash die - * instead of an external SOIC Flash. - */ - compatible = "soc-nv-flash", "xmc,xm25qw64"; -}; - -/* With the settings used for their flash (Dual Out mode), the ALL and non-ALL revisions - * need different flash clock settings to work properly at 640MHz FCLK. - */ - -&clk_bclk { - /* 100 + 20/3 (106.66...) MHz BCLK */ - divider = <6>; -}; - -&clk_flash { - /* 1 Unit of delay (4 Cycles) for XMC Flash at 100 + 20/3 (106.66...) MHz Flash clock */ - read-delay = <1>; - /delete-property/ rx-clock-invert; -}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi deleted file mode 100644 index b16900e47073..000000000000 --- a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_common.dtsi +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2025-2026 MASSDRIVER EI (massdriver.space) - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "ai_m61_32s_kit-pinctrl.dtsi" - -/ { - model = "Ai-Thinker M61-32S development board"; - - aliases { - led0 = &blue_led; - sw0 = &button_0; - pwm-led0 = &blue_pwm_led; - }; - - leds { - compatible = "gpio-leds"; - - blue_led: led_0 { - gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; - label = "Blue - LED0"; - }; - - green_led: led_1 { - gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; - label = "Green - LED1"; - }; - - red_led: led_2 { - gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; - label = "Red - LED2"; - }; - - white_led: led_3 { - gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; - label = "White - LED3"; - }; - - warmwhite_led: led_4 { - gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; - label = "Warm White - LED4"; - }; - }; - - pwmleds: pwmleds { - compatible = "pwm-leds"; - status = "disabled"; - - blue_pwm_led: led_pwm_0 { - pwms = <&pwm0 3 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "Blue - LED0 PWM"; - }; - - green_pwm_led: led_pwm_1 { - pwms = <&pwm0 2 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "Green - LED1 PWM"; - }; - - red_pwm_led: led_pwm_2 { - pwms = <&pwm0 0 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "Red - LED2 PWM"; - }; - - white_pwm_led: led_pwm_3 { - pwms = <&pwm0 1 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "White - LED3 PWM"; - }; - - warmwhite_pwm_led: led_pwm_4 { - pwms = <&pwm0 3 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - label = "Warm White - LED4 PWM"; - }; - }; - - buttons { - compatible = "gpio-keys"; - - button_0: sw0 { - gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; - zephyr,code = ; - }; - }; -}; - -&i2c0 { - status = "okay"; - clock-frequency = ; - - pinctrl-0 = <&i2c0_default>; - pinctrl-names = "default"; -}; - -&spi0 { - status = "okay"; - - pinctrl-0 = <&spi0_default>; - pinctrl-names = "default"; -}; diff --git a/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_defconfig b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_defconfig new file mode 100644 index 000000000000..f55755ffde6f --- /dev/null +++ b/boards/aithinker/ai_m61_32s_kit/ai_m61_32s_kit_defconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2025 MASSDRIVER EI (massdriver.space) +# +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y + +CONFIG_UART_CONSOLE=y + +CONFIG_MEMC=y diff --git a/boards/aithinker/ai_m61_32s_kit/board.yml b/boards/aithinker/ai_m61_32s_kit/board.yml index 40d0cd2f6d85..911910b4e4f9 100644 --- a/boards/aithinker/ai_m61_32s_kit/board.yml +++ b/boards/aithinker/ai_m61_32s_kit/board.yml @@ -2,15 +2,5 @@ board: name: ai_m61_32s_kit full_name: Ai-Thinker M61-32S development board vendor: aithinker - revision: - format: custom - default: "DEFAULT" - exact: true - revisions: - - name: "ALL" - - name: "DEFAULT" socs: - - name: bl618m05q2i # ALL revision is bl618m65q2i, Kconfig repairs this 'error' - variants: - - name: "safe_overclock" - - name: "unsafe_overclock" + - name: bl618m65q2i diff --git a/boards/aithinker/ai_m61_32s_kit/doc/index.rst b/boards/aithinker/ai_m61_32s_kit/doc/index.rst index 678bc0363ab7..cd67db06aca5 100644 --- a/boards/aithinker/ai_m61_32s_kit/doc/index.rst +++ b/boards/aithinker/ai_m61_32s_kit/doc/index.rst @@ -29,15 +29,6 @@ System Clock The M61 (BL618) Development Board is configured to run at maximum speed (320MHz) and can be overclocked to 480 MHz. -This board provides demonstration configurations for the overclocking of the BL618 SoC clocks: - -- ``ai_m61_32s_kit/bl618m05q2i/safe_overclock`` demonstrates 120MHz BCLK and 480MHz core clock on both variants. This nets a Coremark score up to 1600. -- ``ai_m61_32s_kit/bl618m05q2i/unsafe_overclock`` demonstrates 120MHz or 106MHz BCLK and 640MHz core clock with higher core voltages. This nets a Coremark score up to 2100. - -If you are using the ALL variant, please use :``ai_m61_32s_kit@ALL``. - -When overclocking, DMA and DMA-using drivers will not work properly. - Serial Port =========== @@ -78,7 +69,7 @@ Samples .. code-block:: console *** Booting Zephyr OS build v4.3.0 *** - Hello World! ai_m61_32s_kit/bl618m05q2i + Hello World! ai_m61_32s_kit/bl618m65q2i Congratulations, you have ``ai_m61_32s_kit`` configured and running Zephyr. diff --git a/boards/aithinker/ai_m61_32s_kit/revision.cmake b/boards/aithinker/ai_m61_32s_kit/revision.cmake deleted file mode 100644 index f6d6fc64e4df..000000000000 --- a/boards/aithinker/ai_m61_32s_kit/revision.cmake +++ /dev/null @@ -1,8 +0,0 @@ -set(BOARD_REVISIONS "ALL" "DEFAULT") -if(NOT DEFINED BOARD_REVISION) - set(BOARD_REVISION "DEFAULT") -else() - if(NOT BOARD_REVISION IN_LIST BOARD_REVISIONS) - message(FATAL_ERROR "${BOARD_REVISION} is not a valid revision for ai_m61_32s_kit Accepted revisions: ${BOARD_REVISIONS}") - endif() -endif() From 9c9aebcbf78ab24461be60a6ff0e6b8fa4500dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:51 +0200 Subject: [PATCH 2880/3334] Revert "[nrf noup] boards: nordic: nrf54h20: Fix addresses in cpuapp_ram0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d9e419d8c7382e596229078ea905e4f1cf726b32. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index c5dd7a124d1d..42ab67eda189 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -365,16 +365,16 @@ zephyr_udc0: &usbhs { }; /* temporary stack for S2RAM resume logic */ - pm_s2ram_stack: cpuapp_s2ram_stack@7fc8 { + pm_s2ram_stack: cpuapp_s2ram_stack@22007fc8 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x00007fc8 16>; + reg = <0x22007fc8 16>; zephyr,memory-region = "pm_s2ram_stack"; }; /* run-time common mcuboot S2RAM support section */ - mcuboot_s2ram: cpuapp_s2ram@7fd8 { + mcuboot_s2ram: cpuapp_s2ram@22007fd8 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x00007fd8 8>; + reg = <0x22007fd8 8>; zephyr,memory-region = "mcuboot_s2ram_context"; }; From 71e8cc8921018cba26b468dddf712f38585b104b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:51 +0200 Subject: [PATCH 2881/3334] Revert "[nrf fromtree] boards: nrf7120dk: Update UART00 and SPI00 pin mappings" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8faa9cbdfc9eb4c355f1bbda75440da34d8df2ee. Signed-off-by: Andrzej Głąbek --- .../nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi index 4e307df24894..6538af10f840 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120-pinctrl.dtsi @@ -53,16 +53,16 @@ /omit-if-no-ref/ spi00_default: spi00_default { group1 { psels = , - , - ; + , + ; }; }; /omit-if-no-ref/ spi00_sleep: spi00_sleep { group1 { psels = , - , - ; + , + ; low-power-enable; }; }; @@ -82,23 +82,23 @@ /omit-if-no-ref/ uart00_default: uart00_default { group1 { - psels = , + psels = , ; }; group2 { - psels = , - ; + psels = , + ; bias-pull-up; }; }; /omit-if-no-ref/ uart00_sleep: uart00_sleep { group1 { - psels = , - , + psels = , + , , - ; + ; low-power-enable; }; }; From 92f0ac32ecafb3eac13009d2748196a18c733734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:51 +0200 Subject: [PATCH 2882/3334] Revert "[nrf fromtree] samples: boards: nordic: Check if register event sample works" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 304c7db23b2baee83d626f49fdf068af5621a3d9. Signed-off-by: Andrzej Głąbek --- .../nrf_sys_event/pytest/test_reg_event.py | 59 ------------------- .../boards/nordic/nrf_sys_event/sample.yaml | 4 -- .../boards/nordic/nrf_sys_event/src/main.c | 2 - 3 files changed, 65 deletions(-) delete mode 100644 samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py diff --git a/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py b/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py deleted file mode 100644 index 01377f916f24..000000000000 --- a/samples/boards/nordic/nrf_sys_event/pytest/test_reg_event.py +++ /dev/null @@ -1,59 +0,0 @@ -# -# Copyright (c) 2026 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -import re - -from twister_harness import DeviceAdapter - - -def test_rramc_wakeup(dut: DeviceAdapter): - """ - PyTest code for samples/boards/nordic/nrf_sys_event, sample configurations: - - sample.boards.nordic.nrf_sys_event.rramc_wakeup, - - sample.boards.nordic.nrf_sys_event.rramc_wakeup.ppi. - Parse logs from serial port. If the Register Event API was used correctly, - code execution shall be faster by ~14 us when event was registered. - If the API works correctly, RRAMC is woken up just before event occures. - Thus, there is no delay resulting from RRAMC getting ready. - """ - - TIMEOUT = 5 - MIN_DIFF = 10 # Minimal difference to pass the check - - # Get output from serial port - output = "\n".join( - dut.readlines_until( - regex="All done", - print_output=True, - timeout=TIMEOUT, - ) - ) - - # Get execution times - t_default_str = re.search( - r"Alarm set for 100 us, execution took:(.+) \(default RRAMC mode\)", output - ).group(1) - assert t_default_str is not None, "Timing for the default RRAMC mode was NOT found" - t_default = int(t_default_str) - - t_standby_str = re.search( - r"Alarm set for 100 us, execution took:(.+) \(RRAMC Standby mode\)", output - ).group(1) - assert t_standby_str is not None, "Timing for RRAMC Standby mode was NOT found" - t_standby = int(t_standby_str) - - t_ppi_str = re.search( - r"Alarm set for 100 us, execution took:(.+) \(RRAMC waken by PPI\)", output - ).group(1) - assert t_ppi_str is not None, "Timing for RRAMC Standby mode was NOT found" - t_ppi = int(t_ppi_str) - - # Check if RRAMC standby mode results in faster code execution - assert t_default > t_standby + MIN_DIFF, ( - f"{t_default} is NOT larger than {t_standby} + {MIN_DIFF}" - ) - # Check if RRAMC waken by PPI results in faster code execution - assert t_default > t_ppi + MIN_DIFF, f"{t_default} is NOT larger than {t_ppi} + {MIN_DIFF}" diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index b7025bb4731e..1e34b4233fc2 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -54,10 +54,6 @@ tests: extra_configs: - CONFIG_SOC_NRF_FORCE_CONSTLAT=y sample.boards.nordic.nrf_sys_event.rramc_wakeup: - harness: pytest - harness_config: - pytest_root: - - "pytest/test_reg_event.py::test_rramc_wakeup" extra_configs: - CONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y platform_allow: diff --git a/samples/boards/nordic/nrf_sys_event/src/main.c b/samples/boards/nordic/nrf_sys_event/src/main.c index feb257f360b2..57be33a9ad2c 100644 --- a/samples/boards/nordic/nrf_sys_event/src/main.c +++ b/samples/boards/nordic/nrf_sys_event/src/main.c @@ -137,8 +137,6 @@ int main(void) #ifdef CONFIG_NRF_SYS_EVENT_IRQ_LATENCY sys_event_irq_latency(); - - printf("All done\n"); #endif return 0; } From 65b231fc75b676ff52a2437e0665ba270087d585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:52 +0200 Subject: [PATCH 2883/3334] Revert "[nrf fromtree] soc: nordic: common: nrf_sys_event: Fix absolute event register" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bcf21d48850c2632dd09e6e799580d12378ef4e3. Signed-off-by: Andrzej Głąbek --- soc/nordic/common/nrf_sys_event.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index d455e99da6e0..0eff17f3d69a 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -166,12 +166,13 @@ static int event_register(union nrf_sys_evt_us us, bool force, bool abs) LOCKED() { if ((CONFIG_NRF_SYS_EVENT_GRTC_CHAN_CNT > 0) && - ((abs == true) || ((us.rel >= NVM_WAKEUP_US) || !NVM_MANUAL_SUPPORT)) && + ((abs == false) && ((us.rel >= NVM_WAKEUP_US) || !NVM_MANUAL_SUPPORT)) && (chan_mask != 0)) { rv = __builtin_ctz(chan_mask); chan_mask &= ~BIT(rv); if (abs) { - nrfy_grtc_sys_counter_cc_set(NRF_GRTC, rv, us.abs - NVM_WAKEUP_US); + nrfy_grtc_sys_counter_cc_set(NRF_GRTC, rv, + us.abs - NVM_WAKEUP_US); } else { uint32_t val = (NVM_MANUAL_SUPPORT || (us.rel >= NVM_WAKEUP_US)) ? (us.rel - NVM_WAKEUP_US) : 1; From bca7a57c4c4ddcea5a5b638acdb22692b8a05d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:52 +0200 Subject: [PATCH 2884/3334] Revert "[nrf fromtree] samples: boards: nordic: nrf_sys_event: Add nrf54lm20dk" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ef14bbf6705ebe25f21204e7af1877de402b614b. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 8 -------- samples/boards/nordic/nrf_sys_event/src/main.c | 2 -- 2 files changed, 10 deletions(-) delete mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay deleted file mode 100644 index 246efa029ede..000000000000 --- a/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2026 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -sample_counter: &timer20 { - status = "okay"; -}; diff --git a/samples/boards/nordic/nrf_sys_event/src/main.c b/samples/boards/nordic/nrf_sys_event/src/main.c index 57be33a9ad2c..b69dd0b7db23 100644 --- a/samples/boards/nordic/nrf_sys_event/src/main.c +++ b/samples/boards/nordic/nrf_sys_event/src/main.c @@ -97,9 +97,7 @@ static void sys_event_irq_latency_run(enum rramc_mode mode) static void sys_event_irq_latency(void) { sys_event_irq_latency_run(RRAMC_DEFAULT); -#if !defined(CONFIG_SOC_NRF54LM20A) sys_event_irq_latency_run(RRAMC_POWER_MODE); -#endif sys_event_irq_latency_run(RRAMC_PPI_WAKEUP); } #endif /* CONFIG_NRF_SYS_EVENT_IRQ_LATENCY */ From 7ebfbfc343006bbecf60ce9b182f95df920b9a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:53 +0200 Subject: [PATCH 2885/3334] Revert "[nrf fromtree] samples: boards: nordic: nrf_sys_event: Rework RRAMC latency part" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f645af0f8e84ec5d5821b722a9739f550e769856. Signed-off-by: Andrzej Głąbek --- .../boards/nordic/nrf_sys_event/sample.yaml | 9 +++ .../boards/nordic/nrf_sys_event/src/main.c | 62 +++++++------------ 2 files changed, 32 insertions(+), 39 deletions(-) diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index 1e34b4233fc2..4651f21542aa 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -56,7 +56,16 @@ tests: sample.boards.nordic.nrf_sys_event.rramc_wakeup: extra_configs: - CONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y + - CONFIG_NRF_SYS_EVENT_GRTC_CHAN_CNT=0 platform_allow: - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp + sample.boards.nordic.nrf_sys_event.rramc_wakeup.ppi: + extra_configs: + - CONFIG_NRF_SYS_EVENT_IRQ_LATENCY=y + platform_allow: + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l15/cpuflpr/xip + integration_platforms: + - nrf54l15dk/nrf54l15/cpuapp diff --git a/samples/boards/nordic/nrf_sys_event/src/main.c b/samples/boards/nordic/nrf_sys_event/src/main.c index b69dd0b7db23..74d78bd2f2fd 100644 --- a/samples/boards/nordic/nrf_sys_event/src/main.c +++ b/samples/boards/nordic/nrf_sys_event/src/main.c @@ -10,18 +10,6 @@ #include #ifdef CONFIG_NRF_SYS_EVENT_IRQ_LATENCY -#define ALARM_CH 0 -#define TIMEOUT_US 100 - -enum rramc_mode { - /* Default mode where RRAMC goes to low power state and had approx.15 us wake up time. */ - RRAMC_DEFAULT, - /* Using nrf_sys_event API to schedule a PPI wake up before expected interrupt. */ - RRAMC_PPI_WAKEUP, - /* Using nrf_sys_event API to change the power mode of RRAMC to 0 us wake up time. */ - RRAMC_POWER_MODE, -}; - static void counter_handler(const struct device *counter_dev, uint8_t ch_id, uint32_t ticks, void *user_data) { @@ -39,7 +27,7 @@ static uint32_t counter_alarm_execute(const struct device *counter_dev, alarm_cfg->user_data = &sem; now = k_cycle_get_32(); - err = counter_set_channel_alarm(counter_dev, ALARM_CH, alarm_cfg); + err = counter_set_channel_alarm(counter_dev, 0, alarm_cfg); if (err < 0) { printf("Failed to set the counter alarm.\n"); return 0; @@ -53,17 +41,15 @@ static uint32_t counter_alarm_execute(const struct device *counter_dev, return k_cycle_get_32() - now; } -static void sys_event_irq_latency_run(enum rramc_mode mode) +static void sys_event_irq_latency(void) { const struct device *counter = DEVICE_DT_GET(DT_NODELABEL(sample_counter)); struct counter_alarm_cfg alarm_cfg; - uint32_t delay = TIMEOUT_US; - uint32_t delay_adj = 4; - uint32_t rpt = 10; + uint32_t delay = 1000; + uint32_t delay_adj = 8; + uint32_t rpt = 100; uint32_t cyc; int event_handle; - const char *mode_str = (mode == RRAMC_DEFAULT) ? "default RRAMC mode" : - (mode == RRAMC_PPI_WAKEUP) ? "RRAMC waken by PPI" : "RRAMC Standby mode"; counter_start(counter); alarm_cfg.flags = 0; @@ -73,32 +59,30 @@ static void sys_event_irq_latency_run(enum rramc_mode mode) cyc = 0; for (int i = 0; i < rpt; i++) { sys_cache_instr_invd_all(); - if (mode != RRAMC_DEFAULT) { - uint32_t t = (mode == RRAMC_PPI_WAKEUP) ? (delay + delay_adj) : 0; - - event_handle = nrf_sys_event_register(t, true); - if (mode == RRAMC_PPI_WAKEUP && event_handle == 32) { - printk("err\n"); - } - } - cyc += counter_alarm_execute(counter, &alarm_cfg, K_USEC(delay + 100)); - if (mode != RRAMC_DEFAULT) { - (void)nrf_sys_event_unregister(event_handle, false); - } } cyc /= rpt; - printf("Alarm set for %d us, execution took:%d (%s)\n", delay, cyc, mode_str); + printf("Alarm set for %d us, execution took:%d (no event registered)\n", delay, cyc); - counter_stop(counter); -} + cyc = 0; + for (int i = 0; i < rpt; i++) { + sys_cache_instr_invd_all(); + /* Event is delayed because it is registered early and not as it should just + * before starting. Triggering event too early may result in RRAMC going back + * to sleep before actual event wakes up the CPU. + */ + event_handle = nrf_sys_event_register(delay + delay_adj, true); + if (event_handle < 0) { + printf("Failed to register an event:%d\n", event_handle); + return; + } + cyc += counter_alarm_execute(counter, &alarm_cfg, K_USEC(delay + 100)); + (void)nrf_sys_event_unregister(event_handle, false); + } -static void sys_event_irq_latency(void) -{ - sys_event_irq_latency_run(RRAMC_DEFAULT); - sys_event_irq_latency_run(RRAMC_POWER_MODE); - sys_event_irq_latency_run(RRAMC_PPI_WAKEUP); + cyc /= rpt; + printf("Alarm set for %d us, execution took:%d\n", delay, cyc); } #endif /* CONFIG_NRF_SYS_EVENT_IRQ_LATENCY */ From 9b94fe2bb7fdaf5e63823f40d20fafb7c341e9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:53 +0200 Subject: [PATCH 2886/3334] Revert "[nrf fromtree] soc: nordic: common: nrf_sys_event: Fix missing return" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9c76806de718b3bc3d1e84eec59f20371876d66c. Signed-off-by: Andrzej Głąbek --- soc/nordic/common/nrf_sys_event.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/soc/nordic/common/nrf_sys_event.c b/soc/nordic/common/nrf_sys_event.c index 0eff17f3d69a..809ad2e71005 100644 --- a/soc/nordic/common/nrf_sys_event.c +++ b/soc/nordic/common/nrf_sys_event.c @@ -112,12 +112,6 @@ BUILD_ASSERT(IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY_MANUAL) || static uint32_t event_ref_cnt; static uint32_t chan_mask; -/* Handle returned by the registering function can be a GRTC channel that was used which indicates - * that PPI RRAMC wake up is used. If manual mode is used (changing RRAMC power mode) than that - * handle value is used which exceeds any potential GRTC channel number. - */ -#define NRF_SYS_EVENT_MANUAL_HANDLE 32 - #define NVM_HW_WAKEUP_US 16 #define NVM_MANUAL_SUPPORT IS_ENABLED(CONFIG_NRF_SYS_EVENT_IRQ_LATENCY_MANUAL) /* Due to software performance and risk of waking up too early (then RRAMC may go @@ -160,7 +154,7 @@ union nrf_sys_evt_us { uint64_t abs; }; -static int event_register(union nrf_sys_evt_us us, bool force, bool abs) +int event_register(union nrf_sys_evt_us us, bool force, bool abs) { int rv; @@ -187,7 +181,7 @@ static int event_register(union nrf_sys_evt_us us, bool force, bool abs) irq_low_latency_on(true); } event_ref_cnt++; - rv = NRF_SYS_EVENT_MANUAL_HANDLE; + rv = 32; } } @@ -209,12 +203,11 @@ int nrf_sys_event_unregister(int handle, bool cancel) __ASSERT_NO_MSG(handle >= 0); int rv = 0; - if (handle != NRF_SYS_EVENT_MANUAL_HANDLE) { + if (handle < 32) { if (cancel) { nrf_grtc_sys_counter_compare_event_disable(NRF_GRTC, handle); } atomic_or((atomic_t *)&chan_mask, BIT(handle)); - return rv; } LOCKED() { From 198e78c1589398812d4efa1c52076c4476402c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:54 +0200 Subject: [PATCH 2887/3334] Revert "[nrf fromlist] soc: nrf54h: Fix active partition detection" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 24347c1e9b3a1c2fbffb49709301ed6b7b50bc28. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54h/soc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 0d3c7c4a959e..5e35cbcdbae0 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -38,17 +38,17 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #endif #ifdef CONFIG_USE_DT_CODE_PARTITION -#define FLASH_LOAD_ADDRESS DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) +#define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) #elif defined(CONFIG_FLASH_LOAD_OFFSET) -#define FLASH_LOAD_ADDRESS (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET) +#define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET #endif #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && \ - (FIXED_PARTITION_ADDRESS(label) <= FLASH_LOAD_ADDRESS && \ - FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ - FLASH_LOAD_ADDRESS) + FIXED_PARTITION_MTD(label)) && (FIXED_PARTITION_ADDRESS(label) <= \ + (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET) && \ + FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ + (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET)) sys_snode_t soc_node; From c2a903471c2ede3877c3b18bece4420968822547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:54 +0200 Subject: [PATCH 2888/3334] Revert "[nrf fromlist] soc: nrf54h: Fix mcuboot-enabled booting" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit df173561e15bd20b2ee6c39c36d0d38a6ef9bdee. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54h/soc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 5e35cbcdbae0..8262877b537e 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -209,15 +209,12 @@ void soc_late_init_hook(void) #if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition) + - CONFIG_ROM_START_OFFSET); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition)); } else { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + - CONFIG_ROM_START_OFFSET); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition)); } #else - radiocore_address = - (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + CONFIG_ROM_START_OFFSET); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition)); #endif if (IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR) && From 631b175f38687ed8aae1a6d17c820386456af846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:54 +0200 Subject: [PATCH 2889/3334] Revert "[nrf fromtree] doc: release: migration_guide: 4.4: Add note on NVM change" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ec3d56c866555e8842ecb29b784fbc4c3101102. Signed-off-by: Andrzej Głąbek --- doc/releases/migration-guide-4.4.rst | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 21d580984f10..11498e15a83c 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -96,17 +96,6 @@ Boards * ITE ``it515xx_evb`` is renamed to ``it51xxx_evb``. -* Boards that have NVM devices must now correctly have their addresses set or inheritied when they - do not start at address 0x0. In previous zephyr releases, a ``partitions`` entry in DTS was - wrongly interpreted as starting in the flash device's address range even though the DTS file - does not describe this and instead describes flash partitions starting at absolute addresses - e.g. 0x0. If you build and get the deprecated Kconfig - :kconfig:option:`CONFIG_FLASH_CODE_PARTITION_ADDRESS_INVALID` being set then this means your - board, SoC or DTS files are wrong and need updating, a ``ranges <>;`` property should be used - by the flash nodes to specify the base address and size for child nodes, and - ``fixed-partitions``/``fixed-subpartitions`` nodes must have a ``ranges;`` property to pass the - parent's ranges on to child nodes. - Device Drivers and Devicetree ***************************** From 29da3d25a2a526405756b6aecd964a26f97bc4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:55 +0200 Subject: [PATCH 2890/3334] Revert "[nrf fromtree] dts: nordic: Fix missing ranges properties and relative addresses" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f85c79a52e8ac1b97259fd08e6ab4f7423b348dd. Signed-off-by: Andrzej Głąbek --- .../bl5340_dvk_nrf5340_cpunet_common.dtsi | 1 - .../nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts | 2 -- .../nrf5340_audio_dk_nrf5340_cpunet.dts | 1 - .../nrf5340dk/nrf5340dk_nrf5340_cpunet.dts | 1 - boards/nordic/nrf54h20dk/Kconfig.defconfig | 5 +--- .../nrf54h20dk_nrf54h20-memory_map.dtsi | 1 - .../nrf7002dk/nrf7002dk_nrf5340_cpunet.dts | 1 - .../nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts | 1 - .../nrf9280pdk_nrf9280-memory_map.dtsi | 1 - .../thingy53/thingy53_nrf5340_cpunet.dts | 1 - .../pan1783_nrf5340_cpunet_common.dtsi | 1 - .../raytac_an7002q_db_nrf5340_cpunet.dts | 1 - ...tac_mdbt53_db_40_nrf5340_cpunet_common.dts | 1 - ...ac_mdbt53v_db_40_nrf5340_cpunet_common.dts | 1 - .../nordic_vpr_launcher/nordic_vpr_launcher.c | 9 ++++-- dts/arm/nordic/nrf5340_cpunet.dtsi | 2 -- dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi | 1 - dts/vendor/nordic/nrf54h20.dtsi | 3 -- .../nordic/nrf7120_cpuapp_ns_partition.dtsi | 1 - .../nordic/nrf7120_cpuapp_partition.dtsi | 1 - dts/vendor/nordic/nrf7120_enga.dtsi | 3 -- dts/vendor/nordic/nrf9280.dtsi | 3 -- .../common/uicr/gen_uicr/CMakeLists.txt | 5 +++- soc/nordic/nrf54h/soc.c | 29 +++++++++++++------ 24 files changed, 32 insertions(+), 44 deletions(-) diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi index f20e1909f792..8f6785d97733 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi @@ -39,7 +39,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; /* 48K */ boot_partition: partition@0 { diff --git a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts index 94f1ee0ccbbd..567e87869d39 100644 --- a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts +++ b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts @@ -55,13 +55,11 @@ &flash1 { reg = <0x01000000 DT_SIZE_K(256)>; - ranges = <0x0 0x01000000 DT_SIZE_K(256)>; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; storage_partition: partition@0 { label = "storage"; diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts index 8d578efde1b2..71c19f48e09a 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts @@ -61,7 +61,6 @@ arduino_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts index 980348a849a3..e3899d435d7f 100644 --- a/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet.dts @@ -80,7 +80,6 @@ arduino_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 8c532b093c97..c11d3ef63e1f 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -18,13 +18,10 @@ config ROM_START_OFFSET if !USE_DT_CODE_PARTITION -DT_CHOSEN_Z_FLASH := zephyr,flash - # Application core firmware must start at this offset when not using MCUboot. # However, the default 'zephyr,code-partition' in DT is set for MCUboot. config FLASH_LOAD_OFFSET - default $(sub_hex, $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition), \ - $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) + default $(dt_nodelabel_reg_addr_hex,cpuapp_boot_partition) # This is meant to span 'cpuapp_boot_partition' and 'cpuapp_slot0_partition' # in the default memory map. diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index 675e4555ac26..fa1b601974b0 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -130,7 +130,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuapp_boot_partition: partition@30000 { reg = <0x30000 DT_SIZE_K(64)>; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts index d15594a7d374..5e4fd288089b 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts @@ -154,7 +154,6 @@ arduino_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts index 0497918a3195..87e7f03dc79e 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuflpr.dts @@ -34,7 +34,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi index 4c082ecb7be3..75ef062c1024 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi @@ -189,7 +189,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuapp_boot_partition: partition@312000 { reg = <0x312000 DT_SIZE_K(64)>; diff --git a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts index e3b4465b0751..6da36791d5ec 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts +++ b/boards/nordic/thingy53/thingy53_nrf5340_cpunet.dts @@ -145,7 +145,6 @@ fem_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi b/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi index 4fc10e6f8147..f75e5aa0ea7c 100644 --- a/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi +++ b/boards/panasonic/pan1783/pan1783_nrf5340_cpunet_common.dtsi @@ -185,7 +185,6 @@ arduino_spi: &spi0 { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts b/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts index b6893a916f70..8a4a4f65ab62 100644 --- a/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts +++ b/boards/raytac/an7002q_db/raytac_an7002q_db_nrf5340_cpunet.dts @@ -125,7 +125,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts index 6b4aa354bb91..6e8e5183d8aa 100644 --- a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts +++ b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpunet_common.dts @@ -35,7 +35,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts index 6b4aa354bb91..6e8e5183d8aa 100644 --- a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts +++ b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpunet_common.dts @@ -35,7 +35,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c index 4e2abc52427a..bf7462c5e05c 100644 --- a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c +++ b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c @@ -79,6 +79,11 @@ static int nordic_vpr_launcher_init(const struct device *dev) return 0; } +/* obtain VPR address either from memory or partition */ +#define VPR_ADDR(node_id) \ + (DT_REG_ADDR(node_id) + \ + COND_CODE_0(DT_FIXED_PARTITION_EXISTS(node_id), (0), (DT_REG_ADDR(DT_GPARENT(node_id))))) + #define NEEDS_COPYING(inst) UTIL_AND(DT_INST_NODE_HAS_PROP(inst, execution_memory), \ DT_INST_NODE_HAS_PROP(inst, source_memory)) @@ -91,11 +96,11 @@ static int nordic_vpr_launcher_init(const struct device *dev) static const struct nordic_vpr_launcher_config config##inst = { \ .vpr = (NRF_VPR_Type *)DT_INST_REG_ADDR(inst), \ IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, execution_memory), \ - (.exec_addr = DT_REG_ADDR(DT_INST_PHANDLE(inst, execution_memory)),)) \ + (.exec_addr = VPR_ADDR(DT_INST_PHANDLE(inst, execution_memory)),)) \ .enable_secure = DT_INST_PROP(inst, enable_secure), \ .enable_dma_secure = DT_INST_PROP(inst, enable_dma_secure), \ IF_ENABLED(NEEDS_COPYING(inst), \ - (.src_addr = DT_REG_ADDR(DT_INST_PHANDLE(inst, source_memory)), \ + (.src_addr = VPR_ADDR(DT_INST_PHANDLE(inst, source_memory)), \ .size = DT_REG_SIZE(DT_INST_PHANDLE(inst, execution_memory)),))}; \ \ DEVICE_DT_INST_DEFINE(inst, nordic_vpr_launcher_init, NULL, NULL, &config##inst, \ diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 7ad64233bc77..b7b00c4feeda 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -318,8 +318,6 @@ compatible = "soc-nv-flash"; erase-block-size = <2048>; write-block-size = <4>; - #address-cells = <1>; - #size-cells = <1>; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi index 6c06e3479927..be16eedfc529 100644 --- a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi @@ -9,7 +9,6 @@ &flash1 { reg = <0x01000000 DT_SIZE_K(256)>; - ranges = <0x0 0x01000000 DT_SIZE_K(256)>; }; &sram0 { diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 84fced0f1bcf..7c569e2bf104 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -269,11 +269,8 @@ mram1x: mram@e000000 { compatible = "nordic,mram"; reg = <0xe000000 DT_SIZE_K(2048)>; - ranges = <0x0 0xe000000 DT_SIZE_K(2048)>; erase-block-size = <4096>; write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; }; uicr: uicr@fff8000 { diff --git a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi index 5e93a13c0c5e..dcb5f7563140 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi @@ -51,7 +51,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; /* This static layout needs to be the same with the upstream TF-M layout in the * header flash_layout.h of the relevant platform. Any updates in the layout diff --git a/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi index 4783e495b3ea..a508d3760381 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_partition.dtsi @@ -16,7 +16,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; boot_partition: partition@0 { label = "mcuboot"; diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index d2e4b273a2a4..9f310aa00619 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -933,11 +933,8 @@ cpuapp_mram: mram@0 { compatible = "soc-nv-flash"; reg = <0 DT_SIZE_K(4084)>; - ranges = <0x0 0 DT_SIZE_K(4084)>; erase-block-size = <4096>; write-block-size = <4>; - #address-cells = <1>; - #size-cells = <1>; }; }; }; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index a4dd3e2ea2b9..df0a57d99a9b 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -113,11 +113,8 @@ mram1x: mram@e000000 { compatible = "nordic,mram"; reg = <0xe000000 DT_SIZE_K(8192)>; - ranges = <0x0 0xe000000 DT_SIZE_K(8192)>; erase-block-size = <4096>; write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; }; uicr: uicr@fff8000 { diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index d6af0c6cbb33..9c5111717c6c 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -41,9 +41,12 @@ endfunction() # Function to compute partition absolute address and size from devicetree function(compute_partition_address_and_size partition_nodelabel output_address_var output_size_var) dt_nodelabel(partition_path NODELABEL ${partition_nodelabel} REQUIRED) - dt_reg_addr(partition_address PATH ${partition_path} REQUIRED) + dt_reg_addr(partition_offset PATH ${partition_path} REQUIRED) dt_reg_size(partition_size PATH ${partition_path} REQUIRED) + # Calculate absolute partition address + math(EXPR partition_address "${CONFIG_FLASH_BASE_ADDRESS} + ${partition_offset}" OUTPUT_FORMAT HEXADECIMAL) + # Set output variables in parent scope set(${output_address_var} ${partition_address} PARENT_SCOPE) set(${output_size_var} ${partition_size} PARENT_SCOPE) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 8262877b537e..fe664dce6c0d 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -37,18 +36,27 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #define HSFLL_NODE DT_NODELABEL(cpurad_hsfll) #endif +#define FIXED_PARTITION_ADDRESS(label) \ + (DT_REG_ADDR(DT_NODELABEL(label)) + \ + DT_REG_ADDR(COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ + (DT_GPARENT(DT_PARENT(DT_NODELABEL(label)))), \ + (DT_GPARENT(DT_NODELABEL(label)))))) +#define FIXED_PARTITION_NODE_MTD(node) \ + COND_CODE_1( \ + DT_FIXED_SUBPARTITION_EXISTS(node), \ + (DT_MTD_FROM_FIXED_SUBPARTITION(node)), \ + (DT_MTD_FROM_FIXED_PARTITION(node))) + #ifdef CONFIG_USE_DT_CODE_PARTITION #define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition)) #elif defined(CONFIG_FLASH_LOAD_OFFSET) #define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET #endif - #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && (FIXED_PARTITION_ADDRESS(label) <= \ - (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET) && \ - FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ - (CONFIG_FLASH_BASE_ADDRESS + FLASH_LOAD_OFFSET)) + FIXED_PARTITION_NODE_MTD(DT_NODELABEL(label))) && \ + (DT_REG_ADDR(DT_NODELABEL(label)) <= FLASH_LOAD_OFFSET && \ + DT_REG_ADDR(DT_NODELABEL(label)) + DT_REG_SIZE(DT_NODELABEL(label)) > FLASH_LOAD_OFFSET) sys_snode_t soc_node; @@ -209,12 +217,15 @@ void soc_late_init_hook(void) #if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition)) if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(cpuapp_slot1_partition)) { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition)); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot1_partition) + + CONFIG_ROM_START_OFFSET); } else { - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition)); + radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + + CONFIG_ROM_START_OFFSET); } #else - radiocore_address = (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition)); + radiocore_address = + (void *)(FIXED_PARTITION_ADDRESS(cpurad_slot0_partition) + CONFIG_ROM_START_OFFSET); #endif if (IS_ENABLED(CONFIG_SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR) && From 6dbfbc805ca485de7265968205df57e59c839b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:55 +0200 Subject: [PATCH 2891/3334] Revert "[nrf fromtree] dts: arm: nordic: nrf91: Fix missing reg property" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2238c33132cb0f0fb20858bec438a2b93228b3ba. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf91.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 74afa25f76a7..6baf06e3d4e4 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -42,7 +42,6 @@ peripheral@50000000 { #address-cells = <1>; #size-cells = <1>; - reg = <0x50000000 0x10000000>; ranges = <0x0 0x50000000 0x10000000>; /* Common nRF91 peripherals description. */ From 8d1b9b847c305d90028470406375a6382dc91098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:55 +0200 Subject: [PATCH 2892/3334] Revert "[nrf fromtree] storage: flash_map: Fix macros for offset/address" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 779ca3ab1785a632bd4c76c86220b98600f0fcbf. Signed-off-by: Andrzej Głąbek --- include/zephyr/storage/flash_map.h | 31 ++++++------------- subsys/dfu/img_util/flash_img.c | 7 ++--- .../mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 7 ++--- subsys/storage/flash_map/flash_map_default.c | 8 ++--- tests/subsys/storage/flash_map/app.overlay | 8 ++--- 5 files changed, 22 insertions(+), 39 deletions(-) diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index bfd86e7771f2..558a0a0b7e72 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -377,20 +377,11 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); /** * Get fixed-partition or fixed-subpartition offset from DTS node label * - * Note: This only works from a top level ``fixed-partitions`` node, top level - * ``fixed-subpartitions`` node or ``fixed-partitions`` node inside of 1 layer of a - * ``fixed-subpartitions`` node, it will not work for multiple layers of ``fixed-subpartitions`` - * nodes. - * * @param label DTS node label of a partition * * @return fixed-partition offset, as defined for the partition in DTS. */ -#define FIXED_PARTITION_OFFSET(label) \ - COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ - (DT_PROP_BY_IDX(DT_PARENT(DT_NODELABEL(label)), reg, 0) + \ - DT_PROP_BY_IDX(DT_NODELABEL(label), reg, 0)), \ - (DT_PROP_BY_IDX(DT_NODELABEL(label), reg, 0))) +#define FIXED_PARTITION_OFFSET(label) DT_REG_ADDR(DT_NODELABEL(label)) /** * Get fixed-partition or fixed-subpartition address from DTS node label @@ -399,7 +390,10 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); * * @return fixed-partition address, as defined for the partition in DTS. */ -#define FIXED_PARTITION_ADDRESS(label) DT_REG_ADDR(DT_NODELABEL(label)) +#define FIXED_PARTITION_ADDRESS(label) \ + (COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(DT_NODELABEL(label)), \ + (DT_FIXED_SUBPARTITION_ADDR(DT_NODELABEL(label))), \ + (DT_FIXED_PARTITION_ADDR(DT_NODELABEL(label))))) /** * Get fixed-partition or fixed-subpartition address from DTS node @@ -408,24 +402,19 @@ uint8_t flash_area_erased_val(const struct flash_area *fa); * * @return fixed-partition address, as defined for the partition in DTS. */ -#define FIXED_PARTITION_NODE_ADDRESS(node) DT_REG_ADDR(node) +#define FIXED_PARTITION_NODE_ADDRESS(node) \ + (COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(node), \ + (DT_FIXED_SUBPARTITION_ADDR(node)), \ + (DT_FIXED_PARTITION_ADDR(node)))) /** * Get fixed-partition offset from DTS node * - * Note: This only works from a top level ``fixed-partitions`` node, top level - * ``fixed-subpartitions`` node or ``fixed-partitions`` node inside of 1 layer of a - * ``fixed-subpartitions`` node, it will not work for multiple layers of ``fixed-subpartitions`` - * nodes. - * * @param node DTS node of a partition * * @return fixed-partition offset, as defined for the partition in DTS. */ -#define FIXED_PARTITION_NODE_OFFSET(node) \ - COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(node), \ - (DT_PROP_BY_IDX(DT_PARENT(node), reg, 0) + DT_PROP_BY_IDX(node, reg, 0)), \ - (DT_PROP_BY_IDX(node, reg, 0))) +#define FIXED_PARTITION_NODE_OFFSET(node) DT_REG_ADDR(node) /** * Get fixed-partition size for DTS node label diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index 2e6a5e7485fb..8c597b77129a 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -25,10 +25,9 @@ LOG_MODULE_REGISTER(flash_img, CONFIG_IMG_MANAGER_LOG_LEVEL); #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && (FIXED_PARTITION_ADDRESS(label) <= \ - (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET) && \ - FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ - (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET)) + FIXED_PARTITION_MTD(label)) && \ + (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ + FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && (CONFIG_TFM_MCUBOOT_IMAGE_NUMBER == 2) #define UPLOAD_FLASH_AREA_LABEL slot1_ns_partition 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 edcacd4cfd8c..7947b89bcdaf 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -50,10 +50,9 @@ #define FIXED_PARTITION_IS_RUNNING_APP_PARTITION(label) \ DT_SAME_NODE(FIXED_PARTITION_NODE_MTD(DT_CHOSEN(zephyr_code_partition)), \ - FIXED_PARTITION_MTD(label)) && (FIXED_PARTITION_ADDRESS(label) <= \ - (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET) && \ - FIXED_PARTITION_ADDRESS(label) + FIXED_PARTITION_SIZE(label) > \ - (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET)) + FIXED_PARTITION_MTD(label)) && \ + (FIXED_PARTITION_OFFSET(label) <= CONFIG_FLASH_LOAD_OFFSET && \ + FIXED_PARTITION_OFFSET(label) + FIXED_PARTITION_SIZE(label) > CONFIG_FLASH_LOAD_OFFSET) BUILD_ASSERT(sizeof(struct image_header) == IMAGE_HEADER_SIZE, "struct image_header not required size"); diff --git a/subsys/storage/flash_map/flash_map_default.c b/subsys/storage/flash_map/flash_map_default.c index c5ba79af2340..6b1edfbbaef5 100644 --- a/subsys/storage/flash_map/flash_map_default.c +++ b/subsys/storage/flash_map/flash_map_default.c @@ -13,14 +13,14 @@ #if CONFIG_FLASH_MAP_LABELS #define FLASH_AREA_FOO(part, mtd_from_partition) \ {.fa_id = DT_FIXED_PARTITION_ID(part), \ - .fa_off = FIXED_PARTITION_NODE_OFFSET(part), \ + .fa_off = DT_REG_ADDR(part), \ .fa_dev = DEVICE_DT_GET(mtd_from_partition(part)), \ .fa_size = DT_REG_SIZE(part), \ .fa_label = DT_PROP_OR(part, label, NULL), }, #else #define FLASH_AREA_FOO(part, mtd_from_partition) \ {.fa_id = DT_FIXED_PARTITION_ID(part), \ - .fa_off = FIXED_PARTITION_NODE_OFFSET(part), \ + .fa_off = DT_REG_ADDR(part), \ .fa_dev = DEVICE_DT_GET(mtd_from_partition(part)), \ .fa_size = DT_REG_SIZE(part), }, #endif @@ -56,7 +56,7 @@ const struct flash_area *flash_map = default_flash_map; #define DEFINE_PARTITION_0(part, ord) \ const struct flash_area DT_CAT(global_fixed_partition_ORD_, ord) = { \ .fa_id = DT_FIXED_PARTITION_ID(part), \ - .fa_off = FIXED_PARTITION_NODE_OFFSET(part), \ + .fa_off = DT_REG_ADDR(part), \ .fa_dev = DEVICE_DT_GET(DT_MTD_FROM_FIXED_PARTITION(part)), \ .fa_size = DT_REG_SIZE(part), \ }; @@ -71,7 +71,7 @@ DT_FOREACH_STATUS_OKAY(fixed_partitions, FOR_EACH_PARTITION_TABLE) #define DEFINE_SUBPARTITION_0(part, ord) \ const struct flash_area DT_CAT(global_fixed_subpartition_ORD_, ord) = { \ .fa_id = DT_FIXED_PARTITION_ID(part), \ - .fa_off = FIXED_PARTITION_NODE_OFFSET(part), \ + .fa_off = DT_REG_ADDR(part), \ .fa_dev = DEVICE_DT_GET(DT_MTD_FROM_FIXED_SUBPARTITION(part)), \ .fa_size = DT_REG_SIZE(part), \ }; diff --git a/tests/subsys/storage/flash_map/app.overlay b/tests/subsys/storage/flash_map/app.overlay index 72875fff32b8..c03a9c54ff0c 100644 --- a/tests/subsys/storage/flash_map/app.overlay +++ b/tests/subsys/storage/flash_map/app.overlay @@ -8,17 +8,13 @@ */ / { - disabled_flash@4000 { + disabled_flash@0 { compatible = "vnd,flash"; - reg = <0x4000 0x1000>; - ranges = <0x0 0x4000 0x1000>; + reg = <0x00 0x1000>; status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; - ranges; #address-cells = <1>; #size-cells = <1>; From ab94ca0c57be52e48fd0e1f17688b2cd1234a573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:56 +0200 Subject: [PATCH 2893/3334] Revert "[nrf fromtree] kconfig: Fix CONFIG_FLASH_LOAD_OFFSET for non-0 starting addresses" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 582294fee02c5a7ffa72295d914445c28699a9c8. Signed-off-by: Andrzej Głąbek --- Kconfig.zephyr | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 2df77507f123..8e3934ac7461 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -98,30 +98,11 @@ config USE_DT_CODE_PARTITION # Workaround for not being able to have commas in macro arguments DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_FLASH := zephyr,flash - -config FLASH_CODE_PARTITION_ADDRESS_INVALID - bool - default y if XIP && $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) < FLASH_BASE_ADDRESS - select DEPRECATED - help - If this item is selected, it is likely selected because your board/SoC/base DTS files - are wrong and have a flash memory that does not start at absolute address 0x0 and: - * Do not have a ``ranges <>;`` property in the flash node passing down the address - and size to child nodes - * Do not have a ``ranges;`` property in the partitions node passing down the previous - ranges to child nodes - - Support for this will be removed and required that your files be updated correctly for - a future release, check the Zephyr 4.4 migration notes. config FLASH_LOAD_OFFSET # Only user-configurable when USE_DT_CODE_PARTITION is disabled hex "Kernel load offset" if !USE_DT_CODE_PARTITION - default $(sub_hex, $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)), \ - $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))) if USE_DT_CODE_PARTITION && \ - !FLASH_CODE_PARTITION_ADDRESS_INVALID - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) if USE_DT_CODE_PARTITION + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION default 0 help This option specifies the byte offset from the beginning of flash that From 91231a4978a394a6d822f1f58f832f8fbd331262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:56 +0200 Subject: [PATCH 2894/3334] Revert "[nrf fromtree] scripts: kconfig: Fix dt_chosen_partition_addr function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cf62d2ac3ead0d0e16f0ce839c00cb0a8769deb8. Signed-off-by: Andrzej Głąbek --- scripts/kconfig/kconfigfunctions.py | 33 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py index 3c66066b4457..d92017853a67 100644 --- a/scripts/kconfig/kconfigfunctions.py +++ b/scripts/kconfig/kconfigfunctions.py @@ -192,16 +192,6 @@ def _node_reg_addr(node, index, unit): return node.regs[int(index)].addr >> _dt_units_to_scale(unit) -def _node_unit_addr(node, unit): - if not node: - return 0 - - if not node.unit_addr: - return 0 - - return node.unit_addr >> _dt_units_to_scale(unit) - - def _node_reg_addr_by_name(node, name, unit): if not node: return 0 @@ -384,10 +374,13 @@ def dt_chosen_reg(kconf, name, chosen, index=0, unit=None): return hex(_dt_chosen_reg_addr(kconf, chosen, index, unit)) -def _dt_chosen_partition_addr(kconf, chosen, unit=None): +def _dt_chosen_partition_addr(kconf, chosen, index=0, unit=None): """ - This function takes a 'chosen' property and treats that property as a path to an EDT node. - If it finds an EDT node, it will return the unit address of that node, and if not, we return 0. + This function takes a 'chosen' property and treats that property as a path + to an EDT node. If it finds an EDT node, it will look to see if that + node has a register, and if that node has a grandparent that has a register + at the given 'index'. The addition of both addresses will be returned, if + not, we return 0. The function will divide the value based on 'unit': None No division @@ -402,19 +395,25 @@ def _dt_chosen_partition_addr(kconf, chosen, unit=None): return 0 node = edt.chosen_node(chosen) + if not node: + return 0 - return _node_unit_addr(node, unit) + p_node = node.parent + if not p_node: + return 0 + + return _node_reg_addr(p_node.parent, index, unit) + _node_reg_addr(node, 0, unit) def dt_chosen_partition_addr(kconf, name, chosen, index=0, unit=None): """ This function just routes to the proper function and converts - the result to either a string int or string hex value. The index value is not used. + the result to either a string int or string hex value. """ if name == "dt_chosen_partition_addr_int": - return str(_dt_chosen_partition_addr(kconf, chosen, unit)) + return str(_dt_chosen_partition_addr(kconf, chosen, index, unit)) if name == "dt_chosen_partition_addr_hex": - return hex(_dt_chosen_partition_addr(kconf, chosen, unit)) + return hex(_dt_chosen_partition_addr(kconf, chosen, index, unit)) def _dt_node_reg_addr(kconf, path, index=0, unit=None): From 809c9f6465dabcd8e4cc12ca3563d4dd6b8a25f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:56 +0200 Subject: [PATCH 2895/3334] Revert "[nrf fromtree] dts: Fix incorrect/invalid usage of RAM/NVM nodes for nRF54L*" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d4bad14527d318c035063f3780d66df7817a6d15. Signed-off-by: Andrzej Głąbek --- .../bl54l15_dvk_nrf54l15_cpuflpr.dts | 1 - .../bl54l15u_dvk_nrf54l15_cpuflpr.dts | 1 - .../nrf54l15dk_nrf54l15_cpuflpr.dts | 1 - .../nrf54lm20dk_nrf54lm20a_cpuflpr.dts | 1 - .../panb611evb_nrf54l15_cpuflpr.dts | 1 - .../raytac_an54lq_db_15_nrf54l15_cpuflpr.dts | 1 - .../xiao_nrf54l15_nrf54l15_cpuflpr.dts | 1 - .../ophelia4ev_nrf54l15_cpuflpr.dts | 2 +- dts/vendor/nordic/nrf54l05.dtsi | 3 --- dts/vendor/nordic/nrf54l10.dtsi | 3 --- dts/vendor/nordic/nrf54l15.dtsi | 3 --- dts/vendor/nordic/nrf54lm20a.dtsi | 18 +------------ .../soc/nrf54l15_cpuapp.overlay | 22 ++++++++------- .../nordic-flpr/soc/nrf54l15_cpuapp.overlay | 27 +++++++++---------- .../nordic-flpr/soc/nrf54lm20a_cpuapp.overlay | 27 +++++++++---------- soc/nordic/validate_rram_partitions.c | 7 ++--- .../gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay | 1 - 17 files changed, 42 insertions(+), 78 deletions(-) diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts index c0584b08c98c..0e00b2d1e5e4 100644 --- a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts @@ -34,7 +34,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts index 2211743673c0..12e280a9a90e 100644 --- a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts @@ -34,7 +34,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts index 58bdd2bf59bf..eae0b605eb4b 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts @@ -38,7 +38,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts index 11d72c63dfe8..3097d3f2775e 100644 --- a/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts +++ b/boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuflpr.dts @@ -30,7 +30,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuflpr.dts b/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuflpr.dts index 3dc55b73513d..bd40a2f837be 100644 --- a/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuflpr.dts +++ b/boards/panasonic/panb611evb/panb611evb_nrf54l15_cpuflpr.dts @@ -33,7 +33,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/raytac/an54lq_db_15/raytac_an54lq_db_15_nrf54l15_cpuflpr.dts b/boards/raytac/an54lq_db_15/raytac_an54lq_db_15_nrf54l15_cpuflpr.dts index 76a52b128622..582bbf6d7c3a 100644 --- a/boards/raytac/an54lq_db_15/raytac_an54lq_db_15_nrf54l15_cpuflpr.dts +++ b/boards/raytac/an54lq_db_15/raytac_an54lq_db_15_nrf54l15_cpuflpr.dts @@ -34,7 +34,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/seeed/xiao_nrf54l15/xiao_nrf54l15_nrf54l15_cpuflpr.dts b/boards/seeed/xiao_nrf54l15/xiao_nrf54l15_nrf54l15_cpuflpr.dts index 20a7b22e46c0..42d316aaa485 100644 --- a/boards/seeed/xiao_nrf54l15/xiao_nrf54l15_nrf54l15_cpuflpr.dts +++ b/boards/seeed/xiao_nrf54l15/xiao_nrf54l15_nrf54l15_cpuflpr.dts @@ -31,7 +31,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.dts b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.dts index a22b84bc102c..b47b81affc44 100644 --- a/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.dts +++ b/boards/we/ophelia4ev/ophelia4ev_nrf54l15_cpuflpr.dts @@ -33,9 +33,9 @@ &cpuflpr_rram { partitions { compatible = "fixed-partitions"; + #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/dts/vendor/nordic/nrf54l05.dtsi b/dts/vendor/nordic/nrf54l05.dtsi index 8213db7612db..747fea0c5498 100644 --- a/dts/vendor/nordic/nrf54l05.dtsi +++ b/dts/vendor/nordic/nrf54l05.dtsi @@ -33,9 +33,6 @@ cpuflpr_rram: rram@75800 { compatible = "soc-nv-flash"; reg = <0x75800 DT_SIZE_K(30)>; - ranges = <0x0 0x75800 DT_SIZE_K(30)>; - #address-cells = <1>; - #size-cells = <1>; erase-block-size = <4096>; write-block-size = <16>; }; diff --git a/dts/vendor/nordic/nrf54l10.dtsi b/dts/vendor/nordic/nrf54l10.dtsi index 1ef1e5fbba0c..800c4081f283 100644 --- a/dts/vendor/nordic/nrf54l10.dtsi +++ b/dts/vendor/nordic/nrf54l10.dtsi @@ -33,9 +33,6 @@ cpuflpr_rram: rram@ed800 { compatible = "soc-nv-flash"; reg = <0xed800 DT_SIZE_K(62)>; - ranges = <0x0 0xed800 DT_SIZE_K(62)>; - #address-cells = <1>; - #size-cells = <1>; erase-block-size = <4096>; write-block-size = <16>; }; diff --git a/dts/vendor/nordic/nrf54l15.dtsi b/dts/vendor/nordic/nrf54l15.dtsi index d6af3f385f60..56c97ae87acf 100644 --- a/dts/vendor/nordic/nrf54l15.dtsi +++ b/dts/vendor/nordic/nrf54l15.dtsi @@ -33,9 +33,6 @@ cpuflpr_rram: rram@165000 { compatible = "soc-nv-flash"; reg = <0x165000 DT_SIZE_K(96)>; - ranges = <0x0 0x165000 DT_SIZE_K(96)>; - #address-cells = <1>; - #size-cells = <1>; erase-block-size = <4096>; write-block-size = <16>; }; diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index 689d329eec96..f09ca573f56f 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -862,35 +862,19 @@ #address-cells = <1>; #size-cells = <1>; -#ifdef USE_NON_SECURE_ADDRESS_MAP cpuapp_rram: rram@0 { compatible = "soc-nv-flash"; reg = <0x0 DT_SIZE_K(2036)>; - ranges = <0x0 0x0 DT_SIZE_K(2036)>; erase-block-size = <4096>; write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; - }; -#else - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(1940)>; - ranges = <0x0 0x0 DT_SIZE_K(1940)>; - erase-block-size = <4096>; - write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; }; +#ifndef USE_NON_SECURE_ADDRESS_MAP cpuflpr_rram: rram@1e5000 { compatible = "soc-nv-flash"; reg = <0x1e5000 DT_SIZE_K(96)>; - ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; erase-block-size = <4096>; write-block-size = <16>; - #address-cells = <1>; - #size-cells = <1>; }; #endif }; diff --git a/snippets/nordic/nordic-flpr-xip/soc/nrf54l15_cpuapp.overlay b/snippets/nordic/nordic-flpr-xip/soc/nrf54l15_cpuapp.overlay index 74d9d477b19d..031f9ac86cf5 100644 --- a/snippets/nordic/nordic-flpr-xip/soc/nrf54l15_cpuapp.overlay +++ b/snippets/nordic/nordic-flpr-xip/soc/nrf54l15_cpuapp.overlay @@ -3,15 +3,17 @@ * SPDX-License-Identifier: Apache-2.0 */ -&rram_controller { - cpuflpr_rram: rram@165000 { - compatible = "soc-nv-flash"; - reg = <0x165000 DT_SIZE_K(96)>; - ranges = <0x0 0x165000 DT_SIZE_K(96)>; - erase-block-size = <0x1000>; - write-block-size = <0x10>; - #address-cells = <1>; - #size-cells = <1>; +/ { + soc { + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + + cpuflpr_code_partition: image@165000 { + /* FLPR core code partition */ + reg = <0x165000 DT_SIZE_K(96)>; + }; + }; }; }; @@ -20,7 +22,7 @@ }; &cpuflpr_vpr { - execution-memory = <&cpuflpr_rram>; + execution-memory = <&cpuflpr_code_partition>; }; &cpuapp_vevif_tx { diff --git a/snippets/nordic/nordic-flpr/soc/nrf54l15_cpuapp.overlay b/snippets/nordic/nordic-flpr/soc/nrf54l15_cpuapp.overlay index f429def60040..2d608fc8a6b7 100644 --- a/snippets/nordic/nordic-flpr/soc/nrf54l15_cpuapp.overlay +++ b/snippets/nordic/nordic-flpr/soc/nrf54l15_cpuapp.overlay @@ -5,13 +5,22 @@ / { 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)>; - ranges = <0x0 0x20028000 0x18000>; - status = "reserved"; #address-cells = <1>; #size-cells = <1>; + ranges = <0x0 0x20028000 0x18000>; }; }; }; @@ -25,21 +34,9 @@ ranges = <0x0 0x20000000 0x28000>; }; -&rram_controller { - cpuflpr_rram: rram@165000 { - compatible = "soc-nv-flash"; - reg = <0x165000 DT_SIZE_K(96)>; - ranges = <0x0 0x165000 DT_SIZE_K(96)>; - erase-block-size = <0x1000>; - write-block-size = <0x10>; - #address-cells = <1>; - #size-cells = <1>; - }; -}; - &cpuflpr_vpr { execution-memory = <&cpuflpr_sram_code_data>; - source-memory = <&cpuflpr_rram>; + source-memory = <&cpuflpr_code_partition>; }; &cpuapp_vevif_tx { diff --git a/snippets/nordic/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay b/snippets/nordic/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay index 4f00889891d1..071241cf03d7 100644 --- a/snippets/nordic/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay +++ b/snippets/nordic/nordic-flpr/soc/nrf54lm20a_cpuapp.overlay @@ -5,13 +5,22 @@ / { soc { + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + + cpuflpr_code_partition: image@1e5000 { + /* FLPR core code partition */ + reg = <0x1e5000 DT_SIZE_K(96)>; + }; + }; + cpuflpr_sram_code_data: memory@20067c00 { compatible = "mmio-sram"; reg = <0x20067c00 DT_SIZE_K(96)>; - ranges = <0x0 0x20067c00 0x18000>; - status = "reserved"; #address-cells = <1>; #size-cells = <1>; + ranges = <0x0 0x20067c00 DT_SIZE_K(96)>; }; }; }; @@ -21,25 +30,13 @@ ranges = <0x0 0x20000000 DT_SIZE_K(415)>; }; -&rram_controller { - cpuflpr_rram: rram@1e5000 { - compatible = "soc-nv-flash"; - reg = <0x1e5000 DT_SIZE_K(96)>; - ranges = <0x0 0x1e5000 DT_SIZE_K(96)>; - erase-block-size = <0x1000>; - write-block-size = <0x10>; - #address-cells = <1>; - #size-cells = <1>; - }; -}; - &uart30 { status = "reserved"; }; &cpuflpr_vpr { execution-memory = <&cpuflpr_sram_code_data>; - source-memory = <&cpuflpr_rram>; + source-memory = <&cpuflpr_code_partition>; }; &cpuapp_vevif_tx { diff --git a/soc/nordic/validate_rram_partitions.c b/soc/nordic/validate_rram_partitions.c index fe555b4249fc..99f75f291af9 100644 --- a/soc/nordic/validate_rram_partitions.c +++ b/soc/nordic/validate_rram_partitions.c @@ -43,6 +43,7 @@ /* clang-format off */ +#define RRAM_BASE REG_ADDR_NS(DT_CHOSEN(zephyr_flash)) #define RRAM_CONTROLLER DT_NODELABEL(rram_controller) #if !DT_NODE_EXISTS(RRAM_CONTROLLER) @@ -55,9 +56,9 @@ " (required for all children of " DT_NODE_PATH(RRAM_CONTROLLER) ")") #define CHECK_RRAM_PARTITION_WITHIN_PARENT(node_id) \ - BUILD_ASSERT(REG_ADDR_NS(node_id) >= REG_ADDR_NS(DT_GPARENT(node_id)) && \ - REG_END_NS(node_id) <= REG_END_NS(DT_GPARENT(node_id)), \ - DT_NODE_FULL_NAME(node_id) " is not fully contained within its parent " \ + BUILD_ASSERT(RRAM_BASE + REG_ADDR_NS(node_id) >= REG_ADDR_NS(DT_GPARENT(node_id)) && \ + RRAM_BASE + REG_END_NS(node_id) <= REG_END_NS(DT_GPARENT(node_id)), \ + DT_NODE_FULL_NAME(node_id) " is not fully contained within its parent " \ DT_NODE_PATH(DT_GPARENT(node_id))) #define CHECK_NODES_NON_OVERLAPPING(node_id_1, node_id_2) \ diff --git a/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay index 4e1ee5de62cb..621ec9da86b4 100644 --- a/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ b/tests/drivers/build_all/gpio/nrf54l15dk_nrf54l15_cpuflpr.overlay @@ -6,7 +6,6 @@ &cpuflpr_rram { reg = <0x15D000 DT_SIZE_K(128)>; - ranges = <0x0 0x15D000 DT_SIZE_K(128)>; }; &cpuflpr_code_partition { From b231347941b0b0c5fcc7f0f5943d07f79bec2def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:56 +0200 Subject: [PATCH 2896/3334] Revert "[nrf fromtree] soc: nordic: nrf7120 fix missing tfm support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 26dcedd1a938d00825c08046d9ccca62336e6ad1. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf7120dk/Kconfig | 30 ------------------- .../nordic/nrf7120_cpuapp_ns_partition.dtsi | 28 ----------------- soc/nordic/nrf71/soc.c | 1 - soc/nordic/nrf71/soc.h | 2 +- 4 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 boards/nordic/nrf7120dk/Kconfig diff --git a/boards/nordic/nrf7120dk/Kconfig b/boards/nordic/nrf7120dk/Kconfig deleted file mode 100644 index 7232ebc06d2e..000000000000 --- a/boards/nordic/nrf7120dk/Kconfig +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# nRF7120 DK board configuration - -if BOARD_NRF7120DK_NRF7120_CPUAPP_NS - -DT_NRF_MPC_REGION := $(dt_nodelabel_path,nrf_mpc_region) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC_REGION),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC_REGION),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_NRF7120DK_NRF7120_CPUAPP_NS diff --git a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi index dcb5f7563140..f2bf6feec045 100644 --- a/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf7120_cpuapp_ns_partition.dtsi @@ -6,34 +6,6 @@ * Default memory partitioning for nRF7120 application CPU. */ -/* - * Default SRAM planning when building for nRF7120 with ARM TrustZone-M support - * - Lowest 256 kB SRAM allocated to Secure image (sram0_s). - * - Upper 256 kB SRAM allocated to Non-Secure image (sram0_ns). - * - * cpuapp_sram has 512 kB of volatile memory (SRAM). - * This static layout needs to be the same with the upstream TF-M layout in the - * header flash_layout.h of the relevant platform. Any updates in the layout - * needs to happen both in the flash_layout.h and in this file at the same time. - */ -&cpuapp_sram { - sram0_s: image_s@0 { - #address-cells = <1>; - #size-cells = <1>; - /* Secure image memory */ - reg = <0x0 DT_SIZE_K(256)>; - ranges = <0x0 0x0 DT_SIZE_K(256)>; - }; - - sram0_ns: image_ns@20000 { - #address-cells = <1>; - #size-cells = <1>; - /* Non-Secure image memory */ - reg = <0x20000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000 DT_SIZE_K(256)>; - }; -}; - &cpuapp_mram { /* * Default NVM layout on NRF7120 Application MCU without BL2: diff --git a/soc/nordic/nrf71/soc.c b/soc/nordic/nrf71/soc.c index 9018bc99e482..a71cd26367e1 100644 --- a/soc/nordic/nrf71/soc.c +++ b/soc/nordic/nrf71/soc.c @@ -30,7 +30,6 @@ #include #endif -#include #include #include diff --git a/soc/nordic/nrf71/soc.h b/soc/nordic/nrf71/soc.h index 91456f4ac94d..28ff81c8265e 100644 --- a/soc/nordic/nrf71/soc.h +++ b/soc/nordic/nrf71/soc.h @@ -18,7 +18,7 @@ #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc) -#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && !defined(__NRF_TFM__) +#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) #define PWR_ANTSWC_REG (0x4010F780UL) #else /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ #define PWR_ANTSWC_REG (0x5010F780UL) From 96de759d6608bbb02dd0fc61941fb25edfd0544a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:57 +0200 Subject: [PATCH 2897/3334] Revert "[nrf noup] zephyr: doc: Update OTA documentation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5a157b38198d0c7e2d1f8e6a754c3832770ccde2. Signed-off-by: Andrzej Głąbek --- doc/services/device_mgmt/ota.rst | 119 ++++++++++++++++++++++--------- 1 file changed, 84 insertions(+), 35 deletions(-) diff --git a/doc/services/device_mgmt/ota.rst b/doc/services/device_mgmt/ota.rst index 6cf6e67a26e4..73df5554c675 100644 --- a/doc/services/device_mgmt/ota.rst +++ b/doc/services/device_mgmt/ota.rst @@ -19,41 +19,90 @@ same method can be used as part of OTA. The binary is first downloaded into an unoccupied code partition, usually named ``slot1_partition``, then upgraded using the :ref:`mcuboot` process. +Examples of OTA +*************** + +Golioth +======= + +`Golioth`_ is an IoT management platform that includes OTA updates. Devices are +configured to observe your available firmware revisions on the Golioth Cloud. +When a new version is available, the device downloads and flashes the binary. In +this implementation, the connection between cloud and device is secured using +TLS/DTLS, and the signed firmware binary is confirmed by MCUboot before the +upgrade occurs. + +1. A working sample can be found on the `Golioth Firmware SDK repository`_ +2. The `Golioth OTA documentation`_ includes complete information about the + versioning process + +Eclipse hawkBit |trade| +======================= + +`Eclipse hawkBit`_ |trade| is an update server framework that uses polling on a +REST api to detect firmware updates. When a new update is detected, the binary +is downloaded and installed. MCUboot can be used to verify the signature before +upgrading the firmware. + +There is a :zephyr:code-sample:`hawkbit-api` sample included in the +Zephyr :zephyr:code-sample-category:`mgmt` section. + +UpdateHub +========= + +`UpdateHub`_ is a platform for remotely updating embedded devices. Updates can +be manually triggered or monitored via polling. When a new update is detected, +the binary is downloaded and installed. MCUboot can be used to verify the +signature before upgrading the firmware. + +There is an :zephyr:code-sample:`updatehub-fota` sample included in the Zephyr +:zephyr:code-sample-category:`mgmt` section. + +SMP Server +========== + +A Simple Management Protocol (SMP) server can be used to update firmware via +Bluetooth Low Energy (LE) or UDP. :ref:`mcu_mgr` is used to send a signed +firmware binary to the remote device where it is verified by MCUboot before the +upgrade occurs. + +There is an :zephyr:code-sample:`smp-svr` sample included in the Zephyr +:zephyr:code-sample-category:`mgmt` section. + +Lightweight M2M (LWM2M) +======================= + +The :ref:`lwm2m_interface` protocol includes support for firmware update via +:kconfig:option:`CONFIG_LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT`. Devices securely +connect to an LwM2M server using DTLS. A :zephyr:code-sample:`lwm2m-client` sample is +available but it does not demonstrate the firmware update feature. + +mender-mcu +========== + +`mender-mcu`_ enables robust firmware updates on resource-constrained devices by +integrating with Zephyr. It implements an Update Module interface and provides +a default Update Module that integrates with MCUboot to provide A/B updates. +This allows microcontroller units (MCUs) to perform atomic, fail-safe OTA +updates with automatic rollback on failure. + +See :ref:`external_module_mender_mcu` for integration details and examples. + Memfault and nRF Cloud powered by Memfault -****************************************** - -`Memfault`_ is an IoT observability platform that includes OTA management. -Devices check in with Memfault's service periodically for an OTA update, and -when an update is available, download and install the binary. - -Zephyr projects that use MCUboot and have a direct Internet connection can -leverage the `Memfault Firmware SDK's `_ OTA client to -download a payload from Memfault's OTA service, load it into the secondary -partition, and then reboot into the new image. -See `Memfault OTA for Zephyr documentation`_ for more details on this support -for Zephyr projects. - -For Nordic Semiconductor cellular chip users, the Memfault -Firmware SDK includes support for downloading the payload over a cellular -connection using nRF Connect SDK's FOTA and downloader libraries. -See the `Memfault Quickstart for the nRF91 Series`_ for more -information. Zephyr projects with a Bluetooth Low Energy connection can -leverage the `Memfault Diagnostic Service`_ (MDS) with the `Memfault iOS SDK`_ -and `Memfault Android SDK`_ to deliver the update payload to the device. For -Nordic Semiconductor's Bluetooth Low Energy chip users, the Zephyr-based -nRF Connect SDK provides an implementation of MDS. See the -`nRF Connect SDK documentation on MDS`_ for more information as well as -`nRF Cloud powered by Memfault`_ for detail on using the Memfault platform with -Nordic Semiconductor Bluetooth Low Energy chips. -See :ref:`external_module_memfault_firmware_sdk` for overall integration -details and examples. +========================================== + +`Memfault`_ is a IoT observability platform that includes OTA management. Devices check-in with +Memfault's service periodically for an OTA update, and when an update is available, download and +install the binary. + +See :ref:`external_module_memfault_firmware_sdk` for overall integration details and +examples. +.. _MCUboot bootloader: https://mcuboot.com/ +.. _Golioth: https://golioth.io/ +.. _Golioth Firmware SDK repository: https://github.com/golioth/golioth-firmware-sdk/tree/main/examples/zephyr/fw_update +.. _Golioth OTA documentation: https://docs.golioth.io/device-management/ota +.. _Eclipse hawkBit: https://www.eclipse.org/hawkbit/ +.. _UpdateHub: https://updatehub.io/ +.. _mender-mcu: https://github.com/mendersoftware/mender-mcu .. _Memfault: https://memfault.com/ -.. _Memfault Firmware SDK: https://github.com/memfault/memfault-firmware-sdk -.. _Memfault OTA for Zephyr documentation: https://docs.memfault.com/docs/mcu/zephyr-guide#ota -.. _Memfault Quickstart for the nRF91 Series: https://docs.memfault.com/docs/mcu/quickstart-nrf9160 -.. _Memfault Diagnostic Service: https://docs.memfault.com/docs/mcu/mds -.. _Memfault iOS SDK: https://github.com/memfault/memfault-cloud-ios -.. _Memfault Android SDK: https://github.com/memfault/memfault-cloud-android -.. _nRF Connect SDK documentation on MDS: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/bluetooth/services/mds.html -.. _nRF Cloud powered by Memfault: https://nrfcloud.com/#/ From 39ef4381d0f7e986356cc9b28c65cafe0fced2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:57 +0200 Subject: [PATCH 2898/3334] Revert "[nrf fromtree] doc: develop: manifests: external: add memfault" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a7c2a12b91342b106c6a0697cf11337105c81b13. Signed-off-by: Andrzej Głąbek --- .../external/memfault-firmware-sdk.rst | 70 ------------------- doc/services/device_mgmt/ota.rst | 11 --- 2 files changed, 81 deletions(-) delete mode 100644 doc/develop/manifest/external/memfault-firmware-sdk.rst diff --git a/doc/develop/manifest/external/memfault-firmware-sdk.rst b/doc/develop/manifest/external/memfault-firmware-sdk.rst deleted file mode 100644 index d872f3a16d3a..000000000000 --- a/doc/develop/manifest/external/memfault-firmware-sdk.rst +++ /dev/null @@ -1,70 +0,0 @@ -.. _external_module_memfault_firmware_sdk: - -memfault-firmware-sdk -##################### - -Introduction -************ - -`memfault-firmware-sdk`_ provides embedded developers with built-in remote debugging, performance -monitoring, and OTA update capabilities for MCU-based devices. It automatically captures crash -reports, logs, and stack traces from devices in the field, making it easier to diagnose issues -without physical access. The SDK also collects lightweight performance metrics such as memory usage, -battery life, connectivity, and firmware stability to track fleet reliability over time. - -The SDK communicates with the `Memfault`_ platform, which aggregates this data so teams can -prioritize and resolve issues faster. In addition, the SDK supports over-the-air firmware updates, -enabling controlled rollouts and remote deployment of new releases. - -The SDK is protected under a custom BSD-style license with service-specific use restrictions. See -the `Memfault Firmware SDK License`_ for more details. - -Usage with Zephyr -***************** - -To pull in ``memfault-firmware-sdk`` as a Zephyr :ref:`module `, add it as a West project -in the :file:`west.yaml` file with the following content and run :command:`west update`: - -.. code-block:: yaml - - manifest: - remotes: - # Add the Memfault GitHub repo - - name: memfault - url-base: https://github.com/memfault - projects: - # Add the Memfault SDK - - name: memfault-firmware-sdk - path: modules/lib/memfault-firmware-sdk - revision: 1.33.0 - remote: memfault - -.. note:: - - The revision shown above is an example. Check the `memfault-firmware-sdk`_ - releases page for the latest release tag to ensure you are using the desired - version. - -For more detailed instructions and API documentation, refer to the -`memfault-firmware-sdk documentation`_ as well as the provided `memfault-firmware-sdk examples`_. - -Reference -********* - -.. _memfault-firmware-sdk: - https://github.com/memfault/memfault-firmware-sdk - -.. _Memfault Firmware SDK License: - https://github.com/memfault/memfault-firmware-sdk/blob/master/LICENSE - -.. _memfault-firmware-sdk documentation: - https://docs.memfault.com/docs/mcu/introduction - -.. _memfault-firmware-sdk Zephyr guide: - https://docs.memfault.com/docs/mcu/zephyr-guide - -.. _memfault-firmware-sdk examples: - https://github.com/memfault/memfault-firmware-sdk/tree/master/examples - -.. _Memfault: - https://memfault.com/ diff --git a/doc/services/device_mgmt/ota.rst b/doc/services/device_mgmt/ota.rst index 73df5554c675..aebe3d36d82d 100644 --- a/doc/services/device_mgmt/ota.rst +++ b/doc/services/device_mgmt/ota.rst @@ -88,16 +88,6 @@ updates with automatic rollback on failure. See :ref:`external_module_mender_mcu` for integration details and examples. -Memfault and nRF Cloud powered by Memfault -========================================== - -`Memfault`_ is a IoT observability platform that includes OTA management. Devices check-in with -Memfault's service periodically for an OTA update, and when an update is available, download and -install the binary. - -See :ref:`external_module_memfault_firmware_sdk` for overall integration details and -examples. - .. _MCUboot bootloader: https://mcuboot.com/ .. _Golioth: https://golioth.io/ .. _Golioth Firmware SDK repository: https://github.com/golioth/golioth-firmware-sdk/tree/main/examples/zephyr/fw_update @@ -105,4 +95,3 @@ examples. .. _Eclipse hawkBit: https://www.eclipse.org/hawkbit/ .. _UpdateHub: https://updatehub.io/ .. _mender-mcu: https://github.com/mendersoftware/mender-mcu -.. _Memfault: https://memfault.com/ From 3f4aeeef8d728a09ca83ba8f9edc8963829ee3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:58 +0200 Subject: [PATCH 2899/3334] Revert "[nrf fromtree] modules: hal_nordic: fix enumeration of SAADC channels" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bbc95b524e6deb64f4df6185f2b2bd1499218343. Signed-off-by: Andrzej Głąbek --- .../ironside/se/scripts/periphconf/builder.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py index 7c214b46ff09..f749a8ea277d 100644 --- a/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py +++ b/modules/hal_nordic/ironside/se/scripts/periphconf/builder.py @@ -1049,23 +1049,23 @@ def _missing_(cls, value: Any) -> NrfFun: class NrfSaadcChannel(int, enum.Enum): """Identifiers representing SAADC channels. - See include/zephyr/dt-bindings/adc/nrf-saadc.h. + See include/zephyr/dt-bindings/adc/nrf-saadc-haltium.h. """ - AIN0 = 0 - AIN1 = 1 - AIN2 = 2 - AIN3 = 3 - AIN4 = 4 - AIN5 = 5 - AIN6 = 6 - AIN7 = 7 - AIN8 = 8 - AIN9 = 9 - AIN10 = 10 - AIN11 = 11 - AIN12 = 12 - AIN13 = 13 + AIN0 = 1 + AIN1 = 2 + AIN2 = 3 + AIN3 = 4 + AIN4 = 5 + AIN5 = 6 + AIN6 = 7 + AIN7 = 8 + AIN8 = 9 + AIN9 = 10 + AIN10 = 11 + AIN11 = 12 + AIN12 = 13 + AIN13 = 14 class NrfCompChannel(str, enum.Enum): From 1bd5fcd968254f867f41b0acc60213839f0b01c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:58 +0200 Subject: [PATCH 2900/3334] Revert "[nrf fromtree] net: dns: Implement CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b5b3cbcab0e060bace38deb27b27337db6071c8c. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/dns_resolve.h | 5 ----- subsys/net/lib/dns/resolve.c | 8 -------- 2 files changed, 13 deletions(-) diff --git a/include/zephyr/net/dns_resolve.h b/include/zephyr/net/dns_resolve.h index 9af09951dfbf..eeaa1adf2db8 100644 --- a/include/zephyr/net/dns_resolve.h +++ b/include/zephyr/net/dns_resolve.h @@ -530,11 +530,6 @@ struct dns_resolve_context { */ uint16_t query_hash; - /* Number of additional queries sent to resolve CNAME record - * name aliases. - */ - uint8_t additional_queries; - /** Flag to indicate that the callback has been called at least once. */ bool cb_called; } queries[DNS_NUM_CONCUR_QUERIES]; diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index a8a853b78213..0e1d04dd5733 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -318,11 +318,6 @@ static int dispatcher_cb(struct dns_socket_dispatcher *my_ctx, int sock, goto free_buf; } - if (ctx->queries[i].additional_queries >= CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES) { - ret = DNS_EAI_FAIL; - goto quit; - } - for (j = 0; j < SERVER_COUNT; j++) { if (ctx->servers[j].sock < 0) { continue; @@ -337,8 +332,6 @@ static int dispatcher_cb(struct dns_socket_dispatcher *my_ctx, int sock, } } - ctx->queries[i].additional_queries++; - if (nfail > 0) { NET_DBG("DNS cname query %d fails on %d attempts", nfail, ntry); @@ -2048,7 +2041,6 @@ int dns_resolve_name_internal(struct dns_resolve_context *ctx, ctx->queries[i].user_data = user_data; ctx->queries[i].ctx = ctx; ctx->queries[i].query_hash = 0; - ctx->queries[i].additional_queries = 0; ctx->queries[i].cb_called = false; k_work_init_delayable(&ctx->queries[i].timer, query_timeout); From 42a7af11f92076edc821d70ae53594b0def88116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:59 +0200 Subject: [PATCH 2901/3334] Revert "[nrf fromtree] net: dns: Fix query redirection in case of CNAME result" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1bace8b099c73ff77bcfca9cf53356c6da9e0ef4. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/dns/resolve.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index 0e1d04dd5733..f5c469d883bd 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -1490,12 +1490,12 @@ static int dns_read(struct dns_resolve_context *ctx, ret = dns_validate_msg(ctx, &dns_msg, dns_id, &query_idx, dns_cname, query_hash); if (ret == DNS_EAI_AGAIN) { - return ret; + goto finished; } if ((ret < 0 && ret != DNS_EAI_ALLDONE) || query_idx < 0 || query_idx > CONFIG_DNS_NUM_CONCUR_QUERIES) { - return ret; + goto quit; } #if defined(CONFIG_DNS_RESOLVER_PACKET_FORWARDING) @@ -1518,6 +1518,13 @@ static int dns_read(struct dns_resolve_context *ctx, } return 0; + +finished: + dns_resolve_cancel_with_name(ctx, *dns_id, + ctx->queries[query_idx].query, + ctx->queries[query_idx].query_type); +quit: + return ret; } static int set_ttl_hop_limit(int sock, int level, int option, int new_limit) From 9b23128bfb43998fd23fbea789d649376171b3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:59 +0200 Subject: [PATCH 2902/3334] Revert "[nrf fromtree] net: dns: Don't report CNAME records via callback" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c683bd97f95cb609be5818ba34bccbd616f11f2f. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/dns/resolve.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/subsys/net/lib/dns/resolve.c b/subsys/net/lib/dns/resolve.c index f5c469d883bd..408a694a5ef8 100644 --- a/subsys/net/lib/dns/resolve.c +++ b/subsys/net/lib/dns/resolve.c @@ -1395,14 +1395,6 @@ int dns_validate_msg(struct dns_resolve_context *ctx, goto quit; } - - if (answer_type == DNS_RR_TYPE_CNAME) { - /* Don't report CNAME records to the application, they're used internally - * for query redirection. - */ - continue; - } - invoke_query_callback(DNS_EAI_INPROGRESS, &info, &ctx->queries[*query_idx]); if (dns_msg->response_type == DNS_RESPONSE_IP || From 2544ba2f5aee6f3da9a87f3ea8f0f0fc5db7fc43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 13:59:59 +0200 Subject: [PATCH 2903/3334] Revert "[nrf fromtree] doc: bluetooth: mesh: add cdb documentation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8896326defedb02d445d39ee554ea71c5249395b. Signed-off-by: Andrzej Głąbek --- doc/connectivity/bluetooth/api/mesh.rst | 1 - .../bluetooth/api/mesh/cdb_usage.rst | 899 ------------------ include/zephyr/bluetooth/mesh/cdb.h | 33 +- 3 files changed, 6 insertions(+), 927 deletions(-) delete mode 100644 doc/connectivity/bluetooth/api/mesh/cdb_usage.rst diff --git a/doc/connectivity/bluetooth/api/mesh.rst b/doc/connectivity/bluetooth/api/mesh.rst index 0fd11c335dc9..45b3563fc758 100644 --- a/doc/connectivity/bluetooth/api/mesh.rst +++ b/doc/connectivity/bluetooth/api/mesh.rst @@ -25,4 +25,3 @@ Read more about Bluetooth Mesh on the mesh/statistic.rst mesh/shell.rst mesh/brg_cfg.rst - mesh/cdb_usage.rst diff --git a/doc/connectivity/bluetooth/api/mesh/cdb_usage.rst b/doc/connectivity/bluetooth/api/mesh/cdb_usage.rst deleted file mode 100644 index ad19674e1fb2..000000000000 --- a/doc/connectivity/bluetooth/api/mesh/cdb_usage.rst +++ /dev/null @@ -1,899 +0,0 @@ -.. _bluetooth_mesh_cdb_usage: - -Configuration Database (CDB) -############################ - -.. contents:: - :local: - :depth: 2 - -Overview -******** - -The Configuration Database (CDB) is the subsystem for Bluetooth® Mesh provisioner devices. -It stores and manages information about the mesh network, including provisioned nodes, network keys, and application keys. -The CDB enables a provisioner to track the network topology, assign addresses, and configure nodes systematically. - -.. note:: - - The CDB implementation has proprietary design and does not follow the Bluetooth SIG specification. - -The CDB is enabled with the :kconfig:option:`CONFIG_BT_MESH_CDB` configuration option and is typically used only on the provisioner device in the network. -There should be only one device in the mesh network with CDB enabled to avoid conflicts. - -Key features -============ - -* **Persistent Storage**: All CDB data is stored persistently when :kconfig:option:`CONFIG_BT_SETTINGS` is enabled, allowing the provisioner to recover network state across reboots. -* **Address Management**: Automatic allocation and tracking of unicast addresses for provisioned nodes. -* **Key Management**: Storage and synchronization of network keys and application keys. -* **Node Tracking**: Maintains information about each provisioned node including UUID, address, element count, device key, and configuration status. -* **IV Index Management**: Tracks the network's IV Index and IV Update state. - -Configuration options -********************* - -The following Kconfig options control the CDB capacity: - -* :kconfig:option:`CONFIG_BT_MESH_CDB_NODE_COUNT` - Maximum number of nodes the CDB can handle. -* :kconfig:option:`CONFIG_BT_MESH_CDB_SUBNET_COUNT` - Maximum number of subnets the CDB can handle. -* :kconfig:option:`CONFIG_BT_MESH_CDB_APP_KEY_COUNT` - Maximum number of application keys the CDB can handle. - -Additional options: - -* :kconfig:option:`CONFIG_BT_MESH_CDB_KEY_SYNC` - Enables automatic synchronization between mesh keys on the provisioner node and the CDB keys. - If option is enabled then operations with keys performed through the :ref:`bluetooth_mesh_models_cfg_srv` are automatically mirrored to the CDB. - -Data Structures -*************** - -The CDB was designed to handle data collected in several data structures. -The structures represent nodes, subnets, application keys, and the overall database state. - -Node structure -============== - -.. literalinclude:: ../../../../../include/zephyr/bluetooth/mesh/cdb.h - :language: c - :dedent: - :start-after: doc string cdb node start - :end-before: doc string cdb node end - -Node flags: - -* ``BT_MESH_CDB_NODE_CONFIGURED`` - Set when the node has been configured with keys and bindings. - -Subnet structure -================ - -.. literalinclude:: ../../../../../include/zephyr/bluetooth/mesh/cdb.h - :language: c - :dedent: - :start-after: doc string cdb subnet start - :end-before: doc string cdb subnet end - -Application Key structure -========================== - -.. literalinclude:: ../../../../../include/zephyr/bluetooth/mesh/cdb.h - :language: c - :dedent: - :start-after: doc string cdb app key start - :end-before: doc string cdb app key end - -Main CDB structure -================== - -.. literalinclude:: ../../../../../include/zephyr/bluetooth/mesh/cdb.h - :language: c - :dedent: - :start-after: doc string cdb start - :end-before: doc string cdb end - -Usage scenarios -*************** - -The following patterns demonstrate common CDB usage scenarios: - -* :ref:`cdb_pattern_1` - Creating and initializing the CDB -* :ref:`cdb_pattern_2` - Managing node provisioning and addresses -* :ref:`cdb_pattern_3` - Managing network keys and subnets -* :ref:`cdb_pattern_4` - Finding and removing subnets -* :ref:`cdb_pattern_5` - Adding application keys to the CDB -* :ref:`cdb_pattern_6` - Finding and removing application keys -* :ref:`cdb_pattern_7` - Configuring provisioned nodes -* :ref:`cdb_pattern_8` - Processing nodes with callbacks -* :ref:`cdb_pattern_9` - Finding and removing nodes -* :ref:`cdb_pattern_10` - Managing IV Index updates -* :ref:`cdb_pattern_11` - Importing/exporting device keys -* :ref:`cdb_pattern_12` - Resetting the database - -.. note:: - - The provided below source code of scenarios should be treated as conceptual patterns rather than exact implementations. - They require adaptation to fit into an application context and testing. - Please read the CDB API description for correct usage. - -.. _cdb_pattern_1: - -Provisioner initialization -========================== - -On the embedded provisioner node, the CDB must be initialized before the mesh stack is provisioned and the application can use it for key storage, node tracking, and configuration. -This step establishes the primary network key, the initial subnet, and the starting IV Index and address space, so that all later CDB operations work on a well‑defined network context and can be persisted across reboots. - -A typical provisioner initializes the CDB during startup: - -.. code-block:: c - - #include - - static int provisioner_init(void) - { - uint8_t net_key[16]; - int err; - - /* Initialize Bluetooth Mesh */ - err = bt_mesh_init(&prov, &comp); - if (err) { - return err; - } - - /* Load settings if persistent storage is enabled */ - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { - settings_load(); - } - - /* Generate or use predefined network key */ - bt_rand(net_key, 16); - - /* Create CDB with primary network key */ - err = bt_mesh_cdb_create(net_key); - if (err == -EALREADY) { - printk("Using stored CDB\n"); - } else if (err) { - printk("Failed to create CDB (err %d)\n", err); - return err; - } else { - printk("Created new CDB\n"); - } - - return 0; - } - -Key points: - -* Call the :c:func:`bt_mesh_cdb_create` function with the primary network key. -* Returns error code if CDB already exists (loaded from persistent storage). -* The function automatically creates a subnet with ``NetIdx = 0``. -* Sets the IV Index to ``0`` and lowest available address to ``1``. - -.. _cdb_pattern_2: - -Provisioning and node allocation -================================ - -When you add new devices to the mesh, their addresses, device keys, and basic metadata must be recorded consistently in the provisioner’s database. -Automatic node allocation during PB‑ADV/PB‑GATT provisioning keeps CDB and the actual network in sync. -When provisioning a new device, the CDB automatically allocates the node during the provisioning process. - -However, you can also manually allocate nodes or check allocation. -Manual node allocation is useful for advanced scenarios such as importing nodes from an external source, pre‑allocating address ranges, or recovering a network from known information. - -.. code-block:: c - - /* Provisioning callback - node is automatically added to CDB */ - static void node_added(uint16_t idx, uint8_t uuid[16], uint16_t addr, - uint8_t num_elem) - { - printk("Node added: addr=0x%04x, elements=%d\n", addr, num_elem); - /* The CDB node is created automatically by the provisioning subsystem */ - } - - static const struct bt_mesh_prov prov = { - .uuid = dev_uuid, - .node_added = node_added, - /* ... other callbacks ... */ - }; - - /* Manual node allocation (if needed) */ - static struct bt_mesh_cdb_node *allocate_node(const uint8_t uuid[16], - uint8_t num_elem) - { - struct bt_mesh_cdb_node *node; - uint16_t addr; - - /* Get free address or specify one (0 = auto-allocate) */ - addr = bt_mesh_cdb_free_addr_get(num_elem); - if (addr == BT_MESH_ADDR_UNASSIGNED) { - printk("No free addresses available\n"); - return NULL; - } - - /* Allocate node in CDB */ - node = bt_mesh_cdb_node_alloc(uuid, addr, num_elem, net_idx); - if (node == NULL) { - printk("Failed to allocate node\n"); - return NULL; - } - - return node; - } - -Key points: - -* During normal PB-ADV/PB-GATT provisioning, nodes are automatically added to the CDB. -* The :c:func:`bt_mesh_cdb_node_alloc` function creates a CDB entry with the specified parameters. -* Pass :c:macro:`BT_MESH_ADDR_UNASSIGNED` as the address to let the CDB auto-assign the lowest available address. -* The :c:func:`bt_mesh_cdb_free_addr_get` function finds a free address range for a given element count. -* Address allocation checks for conflicts and ensures the unicast address validity. - -.. _cdb_pattern_3: - -Subnet and key management -========================= - -Large or segmented mesh networks often use multiple subnets to separate traffic domains, enable secure migration, or support the Key Refresh procedure. -Managing subnets and their network keys in the CDB allows the provisioner to create new subnets, rotate keys, and derive the correct flags and IV Index when provisioning and configuring nodes. - -Manage network keys and subnets in the CDB: - -.. code-block:: c - - /* Add a new subnet */ - static int add_subnet(uint16_t net_idx) - { - struct bt_mesh_cdb_subnet *sub; - uint8_t net_key[16]; - int err; - - /* Allocate subnet in CDB */ - sub = bt_mesh_cdb_subnet_alloc(net_idx); - if (sub == NULL) { - printk("Failed to allocate subnet\n"); - return -ENOMEM; - } - - /* Generate network key */ - bt_rand(net_key, 16); - - /* Import key value */ - err = bt_mesh_cdb_subnet_key_import(sub, 0, net_key); - if (err) { - bt_mesh_cdb_subnet_del(sub, false); - return err; - } - - /* Store subnet */ - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { - bt_mesh_cdb_subnet_store(sub); - } - - return 0; - } - - /* Get subnet for provisioning */ - static int get_subnet_flags(uint16_t net_idx) - { - struct bt_mesh_cdb_subnet *sub; - uint8_t flags; - - sub = bt_mesh_cdb_subnet_get(net_idx); - if (sub == NULL) { - return -ENOENT; - } - - flags = bt_mesh_cdb_subnet_flags(sub); - printk("Subnet flags: KR=%d IVU=%d\n", - !!(flags & BT_MESH_NET_FLAG_KR), - !!(flags & BT_MESH_NET_FLAG_IVU)); - - return 0; - } - -Key points: - -* The :c:func:`bt_mesh_cdb_subnet_alloc` function allocates a subnet by NetIdx. -* The :c:func:`bt_mesh_cdb_subnet_key_import` function sets the actual key value. -* The :c:func:`bt_mesh_cdb_subnet_flags` function returns flags needed for provisioning data. -* The flags include Key Refresh and IV Update state from the CDB. - -.. _cdb_pattern_4: - -Subnet lookup and removal -========================= - -At some point you may need to inspect an existing subnet (for diagnostics or tooling) or remove it entirely (for example when decommissioning a segment, rotating to a new subnet, or cleaning up after experimentation). -The CDB provides lookup and deletion helpers so that the provisioner can keep its view of active subnets consistent with what nodes actually use. - -Find and manage subnets in the CDB: - -.. code-block:: c - - /* Get subnet by NetIdx */ - static void lookup_subnet(uint16_t net_idx) - { - struct bt_mesh_cdb_subnet *sub; - - sub = bt_mesh_cdb_subnet_get(net_idx); - if (sub == NULL) { - printk("Subnet 0x%03x not found\n", net_idx); - return; - } - - printk("Subnet 0x%03x: kr_phase=%d\n", net_idx, sub->kr_phase); - } - - /* Remove a subnet from the CDB */ - static void remove_subnet(uint16_t net_idx) - { - struct bt_mesh_cdb_subnet *sub; - - sub = bt_mesh_cdb_subnet_get(net_idx); - if (sub == NULL) { - printk("Subnet not found\n"); - return; - } - - /* First, remove the subnet from all nodes in the network */ - /* ... send NetKey Delete to all nodes using Config Client ... */ - - /* Delete subnet from CDB */ - bt_mesh_cdb_subnet_del(sub, true); - - printk("Subnet 0x%03x removed\n", net_idx); - } - - /* Export subnet key for external use */ - static int export_subnet_key(uint16_t net_idx, int key_idx) - { - struct bt_mesh_cdb_subnet *sub; - uint8_t net_key[16]; - int err; - - sub = bt_mesh_cdb_subnet_get(net_idx); - if (sub == NULL) { - return -ENOENT; - } - - err = bt_mesh_cdb_subnet_key_export(sub, key_idx, net_key); - if (err) { - printk("Failed to export subnet key (err %d)\n", err); - return err; - } - - printk("NetKey[%d] for subnet 0x%03x: ", key_idx, net_idx); - for (int i = 0; i < 16; i++) { - printk("%02x", net_key[i]); - } - printk("\n"); - - return 0; - } - -Key points: - -* The :c:func:`bt_mesh_cdb_subnet_get` function retrieves a subnet by its NetKeyIndex. -* Pass ``true`` to the :c:func:`bt_mesh_cdb_subnet_del` function to clear persistent storage. -* Always remove the subnet from all nodes before deleting it from the CDB. -* Use the :c:func:`bt_mesh_cdb_subnet_key_export` function to retrieve key material securely. -* The ``key_idx`` parameter (``0`` or ``1``) selects between old and new keys during the Key Refresh procedure. - -.. _cdb_pattern_5: - -Setting up application keys -=========================== - -Application keys define which application traffic can be encrypted and where it can be bound. -After the CDB is initialized, the provisioner must create one or more application keys so that it can bind models on nodes and enable real application‑level communication (for example, lighting or sensor data). - -After creating the CDB, add application keys for node configuration: - -.. code-block:: c - - static void setup_cdb_keys(void) - { - struct bt_mesh_cdb_app_key *key; - uint8_t app_key[16]; - int err; - - /* Allocate application key in CDB */ - key = bt_mesh_cdb_app_key_alloc(net_idx, app_idx); - if (key == NULL) { - printk("Failed to allocate app-key\n"); - return; - } - - /* Generate random key value */ - bt_rand(app_key, 16); - - /* Import the key into CDB */ - err = bt_mesh_cdb_app_key_import(key, 0, app_key); - if (err) { - printk("Failed to import appkey (err %d)\n", err); - return; - } - - /* Store to persistent storage */ - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { - bt_mesh_cdb_app_key_store(key); - } - } - -Key points: - -* The :c:func:`bt_mesh_cdb_app_key_alloc` function allocates a slot in the CDB. -* The :c:func:`bt_mesh_cdb_app_key_import` function sets the actual key value. -* The second parameter to import (``0``) is the key index for the Key Refresh procedure (``0`` = current key). -* Always store keys after creation when using persistent storage. - -.. _cdb_pattern_6: - -Application keys lookup and removal -=================================== - -Over time, you may need to inspect which network key an application key is bound to, rotate or revoke application keys, or clean up keys that are no longer used. -Proper lookup and removal through the CDB helps avoid dangling bindings and ensures that nodes and the provisioner share the same view of usable application keys. - -Find and manage application keys in the CDB: - -.. code-block:: c - - /* Get application key by AppIdx */ - static void lookup_app_key(uint16_t app_idx) - { - struct bt_mesh_cdb_app_key *key; - - key = bt_mesh_cdb_app_key_get(app_idx); - if (key == NULL) { - printk("AppKey 0x%03x not found\n", app_idx); - return; - } - - printk("AppKey 0x%03x: bound to NetIdx 0x%03x\n", - app_idx, key->net_idx); - } - - /* Remove an application key from the CDB */ - static void remove_app_key(uint16_t app_idx) - { - struct bt_mesh_cdb_app_key *key; - - key = bt_mesh_cdb_app_key_get(app_idx); - if (key == NULL) { - printk("AppKey not found\n"); - return; - } - - /* First, remove the app key from all nodes in the network */ - /* ... send AppKey Delete to all nodes using Config Client ... */ - - /* Delete app key from CDB */ - bt_mesh_cdb_app_key_del(key, true); - - printk("AppKey 0x%03x removed\n", app_idx); - } - - /* Export application key for external use */ - static int export_app_key(uint16_t app_idx, int key_idx) - { - struct bt_mesh_cdb_app_key *key; - uint8_t app_key[16]; - int err; - - key = bt_mesh_cdb_app_key_get(app_idx); - if (key == NULL) { - return -ENOENT; - } - - err = bt_mesh_cdb_app_key_export(key, key_idx, app_key); - if (err) { - printk("Failed to export app key (err %d)\n", err); - return err; - } - - printk("AppKey[%d] 0x%03x: ", key_idx, app_idx); - for (int i = 0; i < 16; i++) { - printk("%02x", app_key[i]); - } - printk("\n"); - - return 0; - } - - /* Update application key binding */ - static int update_app_key_binding(uint16_t app_idx, uint16_t new_net_idx) - { - struct bt_mesh_cdb_app_key *key; - - key = bt_mesh_cdb_app_key_get(app_idx); - if (key == NULL) { - return -ENOENT; - } - - /* Verify the new subnet exists */ - if (bt_mesh_cdb_subnet_get(new_net_idx) == NULL) { - printk("Target subnet 0x%03x not found\n", new_net_idx); - return -ENOENT; - } - - key->net_idx = new_net_idx; - - /* Store updated binding */ - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { - bt_mesh_cdb_app_key_store(key); - } - - printk("AppKey 0x%03x rebound to NetIdx 0x%03x\n", - app_idx, new_net_idx); - - return 0; - } - -Key points: - -* The :c:func:`bt_mesh_cdb_app_key_get` function retrieves an application key by its AppKeyIndex. -* Pass ``true`` to the :c:func:`bt_mesh_cdb_app_key_del` function to clear persistent storage. -* Always remove the app key from all nodes before deleting it from the CDB. -* Use the :c:func:`bt_mesh_cdb_app_key_export` function to retrieve key material securely. -* The ``key_idx`` parameter (``0`` or ``1``) selects between old and new keys during the Key Refresh procedure. -* Application keys are bound to a network key through the ``net_idx`` field. - -.. _cdb_pattern_7: - -Node configuration -================== - -Provisioning only adds a node to the network; it does not make it participate in your application. -After provisioning, you must configure nodes—add network/app keys, bind models, and set subscriptions/publications. -The CDB stores the keys and configuration status so the provisioner can resume configuration after a reboot and avoid re‑configuring already finished nodes. - -After provisioning, configure the node by adding keys and binding models: - -.. code-block:: c - - static void configure_node(struct bt_mesh_cdb_node *node) - { - NET_BUF_SIMPLE_DEFINE(buf, BT_MESH_RX_SDU_MAX); - struct bt_mesh_cdb_app_key *key; - uint8_t app_key[16]; - uint8_t status; - int err; - - printk("Configuring node 0x%04x\n", node->addr); - - /* Get application key from CDB */ - key = bt_mesh_cdb_app_key_get(app_idx); - if (key == NULL) { - printk("App-key not found\n"); - return; - } - - /* Export key value from CDB */ - err = bt_mesh_cdb_app_key_export(key, 0, app_key); - if (err) { - printk("Failed to export key (err %d)\n", err); - return; - } - - /* Add application key to the node */ - err = bt_mesh_cfg_cli_app_key_add(net_idx, node->addr, - net_idx, app_idx, - app_key, &status); - if (err || status) { - printk("Failed to add app-key (err %d, status %d)\n", - err, status); - return; - } - - /* Get composition data and bind models */ - err = bt_mesh_cfg_cli_comp_data_get(net_idx, node->addr, 0, - &status, &buf); - if (err || status) { - printk("Failed to get composition data\n"); - return; - } - - /* Parse composition and bind models to app key */ - /* ... model binding code ... */ - - /* Mark node as configured */ - atomic_set_bit(node->flags, BT_MESH_CDB_NODE_CONFIGURED); - - /* Persist configuration status */ - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { - bt_mesh_cdb_node_store(node); - } - } - -Key points: - -* Use the :c:func:`bt_mesh_cdb_app_key_get` and the :c:func:`bt_mesh_cdb_app_key_export` functions to retrieve keys. -* The Configuration Client model is used to configure remote nodes. -* Set the ``BT_MESH_CDB_NODE_CONFIGURED`` flag after successful configuration. -* Always call the :c:func:`bt_mesh_cdb_node_store` function to persist the configured state. - -.. _cdb_pattern_8: - -Iterating over nodes -==================== - -Many management tasks involve acting on all (or a filtered subset of) nodes: checking which ones still need configuration, generating statistics, or performing bulk operations. -The CDB iterator lets the provisioner traverse all known nodes in a safe, abstract way without relying on internal storage details. - -The CDB provides an iterator to process all allocated nodes: - -.. code-block:: c - - /* Check for unconfigured nodes */ - static uint8_t check_unconfigured(struct bt_mesh_cdb_node *node, - void *user_data) - { - if (!atomic_test_bit(node->flags, BT_MESH_CDB_NODE_CONFIGURED)) { - printk("Node 0x%04x needs configuration\n", node->addr); - configure_node(node); - } - - return BT_MESH_CDB_ITER_CONTINUE; - } - - static void process_nodes(void) - { - bt_mesh_cdb_node_foreach(check_unconfigured, NULL); - } - - /* Example: Count nodes on a specific subnet */ - static uint8_t count_subnet_nodes(struct bt_mesh_cdb_node *node, - void *user_data) - { - uint16_t *net_idx = user_data; - static int count = 0; - - if (node->net_idx == *net_idx) { - count++; - } - - return BT_MESH_CDB_ITER_CONTINUE; - } - -Key points: - -* The :c:func:`bt_mesh_cdb_node_foreach` function calls the callback for each allocated node. -* Return ``BT_MESH_CDB_ITER_CONTINUE`` to continue iteration. -* Return ``BT_MESH_CDB_ITER_STOP`` to stop iteration early. -* The callback is only called for nodes with ``addr != BT_MESH_ADDR_UNASSIGNED``. - -.. _cdb_pattern_9: - -Node lookup and removal -======================= - -Sometimes a single node must be inspected (for example, when debugging) or removed from the network (for example, when it is physically decommissioned or replaced). -Using CDB node lookup and deletion keeps the logical view of the mesh consistent with the actual devices and prevents address reuse conflicts. - -Find and manage nodes in the CDB: - -.. code-block:: c - - /* Get node by address */ - static void lookup_node(uint16_t addr) - { - struct bt_mesh_cdb_node *node; - - node = bt_mesh_cdb_node_get(addr); - if (node == NULL) { - printk("Node 0x%04x not found\n", addr); - return; - } - - printk("Node 0x%04x: %d elements, net_idx=0x%03x\n", - node->addr, node->num_elem, node->net_idx); - } - - /* Remove a node from the network */ - static void remove_node(uint16_t addr) - { - struct bt_mesh_cdb_node *node; - - node = bt_mesh_cdb_node_get(addr); - if (node == NULL) { - printk("Node not found\n"); - return; - } - - /* First, send Node Reset to the device (recommended) */ - /* ... send reset command using Config Client ... */ - - /* Delete node from CDB */ - bt_mesh_cdb_node_del(node, true); - - printk("Node 0x%04x removed\n", addr); - } - -Key points: - -* The :c:func:`bt_mesh_cdb_node_get` function searches by element address (works for any element address). -* Always send a ``Node Reset`` command before removing a node to avoid orphaned devices. -* Pass ``true`` to the :c:func:`bt_mesh_cdb_node_del` function to clear persistent storage. -* Deleting a node might update the ``lowest_avail_addr`` if appropriate (please read CDB API for details). - -.. _cdb_pattern_10: - -IV Index management -=================== - -The IV Index is a core part of Bluetooth Mesh security and replay protection. -When IV Update procedures occur, the provisioner must update its stored IV Index so that future provisioning and configuration use the correct value and address space. -Storing this in the CDB keeps the network state coherent across reboots and between provisioning actions. - -Update the network's IV Index: - -.. code-block:: c - - /* Update IV Index when IV Update procedure occurs */ - static void handle_iv_update(uint32_t iv_index, bool iv_update) - { - bt_mesh_cdb_iv_update(iv_index, iv_update); - - printk("IV Index updated: %u (IV Update: %s)\n", - iv_index, iv_update ? "in progress" : "normal"); - } - - /* The IV Index is automatically used during provisioning */ - static void provision_with_current_iv(void) - { - /* The provisioner automatically uses bt_mesh_cdb.iv_index - * and bt_mesh_cdb_subnet_flags() when sending provisioning data - */ - } - -Key points: - -* The :c:func:`bt_mesh_cdb_iv_update` function updates both the IV Index and IV Update flag. -* The CDB automatically resets ``lowest_avail_addr`` during IV Index updates. -* The provisioner subsystem automatically uses CDB's IV Index for new nodes. - -.. _cdb_pattern_11: - -Working with device keys -======================== - -Device keys are sensitive information and often handled through secure key storage (for example, PSA crypto). -The CDB’s key import/export APIs abstract how keys are stored, allowing the application to use device keys when needed (for configuration or external tooling) without breaking the security model or relying on direct pointers into key storage. - -Import and export device keys using the key management API: - -.. code-block:: c - - /* Import a known device key */ - static int import_dev_key(struct bt_mesh_cdb_node *node, - const uint8_t dev_key[16]) - { - int err; - - err = bt_mesh_cdb_node_key_import(node, dev_key); - if (err) { - printk("Failed to import device key (err %d)\n", err); - return err; - } - - /* Store updated node */ - if (IS_ENABLED(CONFIG_BT_SETTINGS)) { - bt_mesh_cdb_node_store(node); - } - - return 0; - } - - /* Export device key for external use */ - static int export_dev_key(struct bt_mesh_cdb_node *node) - { - uint8_t dev_key[16]; - int err; - - err = bt_mesh_cdb_node_key_export(node, dev_key); - if (err) { - printk("Failed to export device key (err %d)\n", err); - return err; - } - - /* Use the exported key */ - printk("Device key: "); - for (int i = 0; i < 16; i++) { - printk("%02x", dev_key[i]); - } - printk("\n"); - - return 0; - } - -Key points: - -* Always use import/export functions when working with keys (required for PSA crypto). -* Keys are stored securely and are not be directly accessible through pointers. -* The provisioner automatically generates and imports device keys during provisioning. - -.. _cdb_pattern_12: - -Clearing the CDB -================ - -For factory reset, testing, or starting a completely new network, you may need to wipe all provisioning and configuration data. -Clearing the CDB resets the logical network state so you can safely recreate it from scratch, while avoiding inconsistencies with stale keys or node entries. - -Reset the entire configuration database: - -.. code-block:: c - - static void reset_network(void) - { - printk("Clearing CDB...\n"); - - /* Clear all CDB data */ - bt_mesh_cdb_clear(); - - printk("CDB cleared\n"); - } - -Key points: - -* The :c:func:`bt_mesh_cdb_clear` function removes all nodes, subnets, and app keys. -* Clears persistent storage if the :kconfig:option:`CONFIG_BT_SETTINGS` Kconfig option is enabled. -* Marks the CDB as invalid (must call the :c:func:`bt_mesh_cdb_create` function to use again). - -Best practices -************** - -* **Error handling** - Check return values from all CDB functions, especially allocation functions which can fail when capacity is reached. - -* **Address management** - Let the CDB manage address allocation by passing ``0`` to the :c:func:`bt_mesh_cdb_node_alloc` function unless you have specific addressing requirements. - -* **Configuration tracking** - Always set the ``BT_MESH_CDB_NODE_CONFIGURED`` flag and store the node after successful configuration to avoid reconfiguring nodes unnecessarily. - -* **Key security** - Never log or expose keys in production code. - Use import/export functions to handle key material securely. - -* **Iteration safety** - Do not modify the CDB (add/remove nodes) during :c:func:`bt_mesh_cdb_node_foreach` iteration. - Collect addresses first, then modify. - -Common pitfalls -*************** - -CDB synchronization among multiple provisioners - If there are multiple provisioners in the network, ensure they synchronize their CDBs to avoid conflicts. - Use application-level mechanisms to share CDB among multiple provisioners. - There is no built-in mechanism for CDB synchronization. - -Forgetting to store - CDB modifications are not automatically persisted. - Always call the appropriate ``_store()`` function after making changes when using persistent storage. - -Incorrect key index - When importing/exporting keys, the key index parameter (``0`` or ``1``) refers to the position in the Key Refresh key array, not the NetIdx or AppIdx. - -Address conflicts - If manually specifying addresses, ensure they do not conflict with existing nodes. - Use the :c:func:`bt_mesh_cdb_free_addr_get` function to find available addresses. - -Over-capacity - CDB has fixed capacity defined by Kconfig. - Exceeding capacity causes allocation failures. - Monitor CDB usage and increase capacity if needed. - -Accessing invalid nodes - Always check if returned pointers from ``_get()`` or ``_alloc()`` functions are ``NULL`` before dereferencing. - -API reference -************* - -For complete API documentation, refer to: - -* Header file: :file:`include/zephyr/bluetooth/mesh/cdb.h` -* Implementation: :file:`subsys/bluetooth/mesh/cdb.c` - -Related documentation -********************* - -* :ref:`bluetooth_mesh` -* :ref:`bluetooth_mesh_provisioning` -* Mesh Shell commands: :ref:`bluetooth_mesh_shell` diff --git a/include/zephyr/bluetooth/mesh/cdb.h b/include/zephyr/bluetooth/mesh/cdb.h index 887fe8a54393..9b7fbf4af796 100644 --- a/include/zephyr/bluetooth/mesh/cdb.h +++ b/include/zephyr/bluetooth/mesh/cdb.h @@ -32,48 +32,34 @@ enum { BT_MESH_CDB_NODE_FLAG_COUNT }; -/* doc string cdb node start */ struct bt_mesh_cdb_node { - /** Node UUID */ uint8_t uuid[16]; - /** Primary element address */ uint16_t addr; - /** Network key index used during provisioning */ uint16_t net_idx; - /** Number of elements */ uint8_t num_elem; - /** Device key */ struct bt_mesh_key dev_key; - /** Node flags */ + ATOMIC_DEFINE(flags, BT_MESH_CDB_NODE_FLAG_COUNT); }; -/* doc string cdb node end */ -/* doc string cdb subnet start */ struct bt_mesh_cdb_subnet { - /** Network key index */ uint16_t net_idx; - /** Key Refresh phase */ + uint8_t kr_phase; - /** Old and new keys for Key Refresh */ + struct { struct bt_mesh_key net_key; } keys[2]; }; -/* doc string cdb subnet end */ -/* doc string cdb app key start */ struct bt_mesh_cdb_app_key { - /** Bound network key index */ uint16_t net_idx; - /** Application key index */ uint16_t app_idx; - /** Old and new keys for Key Refresh */ + struct { struct bt_mesh_key app_key; } keys[2]; }; -/* doc string cdb app key end */ enum { BT_MESH_CDB_VALID, @@ -85,25 +71,18 @@ enum { BT_MESH_CDB_FLAG_COUNT, }; -/* doc string cdb start */ struct bt_mesh_cdb { - /** Network IV Index */ uint32_t iv_index; - /** Lowest available unicast address for provisioning */ uint16_t lowest_avail_addr; - /** Flags for CDB state (private) */ + ATOMIC_DEFINE(flags, BT_MESH_CDB_FLAG_COUNT); - /** Nodes in the mesh network */ + struct bt_mesh_cdb_node nodes[NODE_COUNT]; - /** Subnets in the mesh network */ struct bt_mesh_cdb_subnet subnets[SUBNET_COUNT]; - /** Application keys in the mesh network */ struct bt_mesh_cdb_app_key app_keys[APP_KEY_COUNT]; }; -/** The global CDB instance is accessible through this variable. */ extern struct bt_mesh_cdb bt_mesh_cdb; -/* doc string cdb end */ /** @brief Create the Mesh Configuration Database. * From cbe53c513d485598a5bba8bbdb2c2d33013be0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:00 +0200 Subject: [PATCH 2904/3334] Revert "[nrf fromtree] scripts: runners: nrf: Add support for nRF7120" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 74780c2e6fdf55cfaa9f640b0e7dcd34691f72c8. Signed-off-by: Andrzej Głąbek --- scripts/west_commands/runners/nrf_common.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index c236eff5ad15..212b22e83bf7 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -39,9 +39,6 @@ 'nrf54l': { 'Application': (0x00FFD000, 0x00FFDA00), }, - 'nrf71': { - 'Application': (0x00FFD000, 0x00FFDA00) - }, 'nrf91': { 'Application': (0x00FF8000, 0x00FF8800), }, @@ -93,7 +90,7 @@ def _dev_id_help(cls) -> str: def do_add_parser(cls, parser): parser.add_argument('--nrf-family', choices=['NRF51', 'NRF52', 'NRF53', 'NRF54L', - 'NRF54H', 'NRF71', 'NRF91', 'NRF92'], + 'NRF54H', 'NRF91', 'NRF92'], help='''MCU family; still accepted for compatibility only''') # Not using a mutual exclusive group for softreset and pinreset due to @@ -229,8 +226,6 @@ def ensure_family(self): self.family = 'nrf54l' elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF54H'): self.family = 'nrf54h' - elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF71'): - self.family = 'nrf71' elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF91'): self.family = 'nrf91' elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF92'): From fce274a6f98e4d0b8d8f82f005f4f9bf7ed4253a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:00 +0200 Subject: [PATCH 2905/3334] Revert "[nrf noup] scripts: west: Resolve cmake-opt conflict from upmerge" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba740b914e7f6ded691a5d73a14ae37e6abcfc8e. Signed-off-by: Andrzej Głąbek --- scripts/west_commands/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index 4426580c4f3d..819805aa49e7 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -664,9 +664,9 @@ def _run_cmake(self, board, origin): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', []) + config_sysbuild = config_getboolean('sysbuild', None) - if config_sysbuild == []: + if config_sysbuild is None: # If no option is set, then enable sysbuild globally config_sysbuild = True From 55c57a8f5650a96d2bb3c1c3c2ca9f9bf3f6fb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:00 +0200 Subject: [PATCH 2906/3334] Revert "[nrf fromtree] scripts: pylib: twister: twisterlib: coverage: catch hex parsing" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 32c5ef783101805970fa2dd8157a01081cbfc5e1. Signed-off-by: Andrzej Głąbek --- scripts/pylib/twister/twisterlib/coverage.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/coverage.py b/scripts/pylib/twister/twisterlib/coverage.py index 4529f0cf0166..ed3413fa9b82 100644 --- a/scripts/pylib/twister/twisterlib/coverage.py +++ b/scripts/pylib/twister/twisterlib/coverage.py @@ -79,11 +79,8 @@ def retrieve_gcov_data(input_file): continue else: continue - try: - hex_bytes = bytes.fromhex(hex_dump) - extracted_coverage_info[file_name].append(hex_bytes) - except ValueError: - logger.exception(f"Unable to convert hex data for file: {file_name}") + hex_bytes = bytes.fromhex(hex_dump) + extracted_coverage_info[file_name].append(hex_bytes) if not capture_data: capture_complete = True return {'complete': capture_complete, 'data': extracted_coverage_info} @@ -129,6 +126,9 @@ def create_gcda_files(self, extracted_coverage_info): hexdump_val = self.merge_hexdumps(hexdumps) with open(filename, 'wb') as fp: fp.write(hexdump_val) + except ValueError: + logger.exception(f"Unable to convert hex data for file: {filename}") + gcda_created = False except FileNotFoundError: logger.exception(f"Unable to create gcda file: {filename}") gcda_created = False From 4b828567c505bdfbb2dd488264c7e5fd62a96ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:01 +0200 Subject: [PATCH 2907/3334] Revert "[nrf fromtree] dts: vendor: nordic: Update nRF54LM20A SRAM layout" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 42dc8df2ee97ae2696c74a5c01de440589646ef2. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi index 38f4addb5184..6fb92c1bbaed 100644 --- a/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi +++ b/dts/vendor/nordic/nrf54lm20a_cpuapp_ns_partition.dtsi @@ -7,10 +7,9 @@ /* * Default SRAM planning when building for nRF54LM20A with ARM TrustZone-M support * - Lowest 256 kB SRAM allocated to Secure image (sram0_s). - * - Upper 252 kB SRAM allocated to Non-Secure image (sram0_ns). + * - Upper 256 kB SRAM allocated to Non-Secure image (sram0_ns). * - * nRF54LM20A has 512 kB of volatile memory (SRAM), but only 511 kB is available to use. - * Since TF-m requires 4kB page alignment we can only use a total of 508 kB. + * nRF54LM20A has 512 kB of volatile memory (SRAM). * This static layout needs to be the same with the upstream TF-M layout in the * header flash_layout.h of the relevant platform. Any updates in the layout * needs to happen both in the flash_layout.h and in this file at the same time. @@ -28,8 +27,8 @@ #address-cells = <1>; #size-cells = <1>; /* Non-Secure image memory */ - reg = <0x40000 DT_SIZE_K(252)>; - ranges = <0x0 0x40000 DT_SIZE_K(252)>; + reg = <0x40000 0x7FE40>; + ranges = <0x0 0x40000 0x7FE40>; }; }; From dd289cdbb2e7ff95a12c865c7fa7f54ab96b7a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:01 +0200 Subject: [PATCH 2908/3334] Revert "[nrf fromtree] net: ppp: Fixes to peer LCP_OPTION_MRU handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d95178d351f256373ff560e54afe1dca7e343c62. Signed-off-by: Andrzej Głąbek --- subsys/net/l2/ppp/Kconfig | 7 +++++++ subsys/net/l2/ppp/lcp.c | 44 ++++++++++++++------------------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/subsys/net/l2/ppp/Kconfig b/subsys/net/l2/ppp/Kconfig index 1dc6baf601aa..d5dae67f99c8 100644 --- a/subsys/net/l2/ppp/Kconfig +++ b/subsys/net/l2/ppp/Kconfig @@ -60,6 +60,13 @@ config NET_L2_PPP_OPTION_MRU help Enable support for LCP MRU option. +config NET_L2_PPP_OPTION_MAX_MRU + int "LCP MRU maximum size" + default 1500 + help + Set the maximal MRU size which is allowed while negotiation with peer over LCP. + The default value is defined by RFC 1661. + config NET_L2_PPP_OPTION_SERVE_IP bool "Serve IP address to peer" help diff --git a/subsys/net/l2/ppp/lcp.c b/subsys/net/l2/ppp/lcp.c index 7a25e47b923b..9c664d006021 100644 --- a/subsys/net/l2/ppp/lcp.c +++ b/subsys/net/l2/ppp/lcp.c @@ -122,9 +122,8 @@ static int lcp_async_ctrl_char_map_parse(struct ppp_fsm *fsm, struct net_pkt *pk return 0; } -#if defined(CONFIG_NET_L2_PPP_OPTION_MRU) static int lcp_peer_mru_parse(struct ppp_fsm *fsm, struct net_pkt *pkt, - void *user_data) + void *user_data) { struct lcp_option_data *data = user_data; uint16_t peer_mru; @@ -138,13 +137,19 @@ static int lcp_peer_mru_parse(struct ppp_fsm *fsm, struct net_pkt *pkt, NET_DBG("[LCP] Received peer MRU %u", peer_mru); + if (peer_mru > CONFIG_NET_L2_PPP_OPTION_MAX_MRU) { + LOG_WRN("[LCP] Received peer MRU is too big. %u > %u.", + peer_mru, CONFIG_NET_L2_PPP_OPTION_MAX_MRU); + return -EINVAL; + } + data->mru = peer_mru; return 0; } static int lcp_peer_mru_nack(struct ppp_fsm *fsm, struct net_pkt *ret_pkt, - void *user_data) + void *user_data) { struct ppp_context *ctx = ppp_fsm_ctx(fsm); @@ -152,16 +157,14 @@ static int lcp_peer_mru_nack(struct ppp_fsm *fsm, struct net_pkt *ret_pkt, (void)net_pkt_write_u8(ret_pkt, 4); return net_pkt_write_be16(ret_pkt, ctx->lcp.my_options.mru); } -#endif static const struct ppp_peer_option_info lcp_peer_options[] = { PPP_PEER_OPTION(LCP_OPTION_AUTH_PROTO, lcp_auth_proto_parse, lcp_auth_proto_nack), PPP_PEER_OPTION(LCP_OPTION_ASYNC_CTRL_CHAR_MAP, lcp_async_ctrl_char_map_parse, NULL), -#if defined(CONFIG_NET_L2_PPP_OPTION_MRU) - PPP_PEER_OPTION(LCP_OPTION_MRU, lcp_peer_mru_parse, lcp_peer_mru_nack), -#endif + PPP_PEER_OPTION(LCP_OPTION_MRU, lcp_peer_mru_parse, + lcp_peer_mru_nack), }; static int lcp_config_info_req(struct ppp_fsm *fsm, @@ -188,9 +191,6 @@ static int lcp_config_info_req(struct ppp_fsm *fsm, ctx->lcp.peer_options.auth_proto = data.auth_proto; ctx->lcp.peer_options.async_map = data.async_ctrl_char_map; -#if defined(CONFIG_NET_L2_PPP_OPTION_MRU) - ctx->lcp.peer_options.mru = data.mru; -#endif NET_DBG("Asynchronous Control Character Map: %08X", data.async_ctrl_char_map); if (data.auth_proto_present) { @@ -259,23 +259,12 @@ static void lcp_up(struct ppp_fsm *fsm) struct ppp_context *ctx = CONTAINER_OF(fsm, struct ppp_context, lcp.fsm); -#if defined(CONFIG_NET_L2_PPP_OPTION_MRU) - /* Set MTU based on negotiated MRU values. - * Use the minimum of our MRU and peer's MRU to ensure both sides - * can handle the packet size. - */ - uint16_t mtu = ctx->lcp.my_options.mru; - - if (ctx->lcp.peer_options.mru > 0 && - ctx->lcp.peer_options.mru < mtu) { - mtu = ctx->lcp.peer_options.mru; + if (ctx->lcp.peer_options.mru > 0) { + NET_DBG("Set MTU size from peer options: %u -> %u", + net_if_get_mtu(ctx->iface), ctx->lcp.peer_options.mru); + net_if_set_mtu(ctx->iface, ctx->lcp.peer_options.mru); } - NET_DBG("PPP MTU set to %d (mru=%d, peer_mru=%d)", - mtu, ctx->lcp.my_options.mru, ctx->lcp.peer_options.mru); - net_if_set_mtu(ctx->iface, mtu); -#endif - ppp_link_established(ctx, fsm); } @@ -316,7 +305,7 @@ static int lcp_ack_mru(struct ppp_context *ctx, struct net_pkt *pkt, return -EINVAL; } - ret = net_pkt_read_be16(pkt, &mru); + ret = net_pkt_read(pkt, &mru, sizeof(mru)); if (ret) { return ret; } @@ -339,7 +328,7 @@ static int lcp_nak_mru(struct ppp_context *ctx, struct net_pkt *pkt, return -EINVAL; } - ret = net_pkt_read_be16(pkt, &mru); + ret = net_pkt_read(pkt, &mru, sizeof(mru)); if (ret) { return ret; } @@ -467,7 +456,6 @@ static void lcp_init(struct ppp_context *ctx) ctx->lcp.fsm.cb.config_info_add = lcp_config_info_add; ctx->lcp.fsm.cb.config_info_req = lcp_config_info_req; - ctx->lcp.fsm.cb.config_info_ack = ppp_my_options_parse_conf_ack; ctx->lcp.fsm.cb.config_info_nack = lcp_config_info_nack; ctx->lcp.fsm.cb.config_info_rej = ppp_my_options_parse_conf_rej; From a5f8ad9a7c91b7b517e61936eb664bc14750d0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:01 +0200 Subject: [PATCH 2909/3334] Revert "[nrf fromtree] manifest: update hal_nordic to fix TWIM instance in samples" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 60f66447ed847208e80dc5a53618e4d2d050b8e0. Signed-off-by: Andrzej Głąbek --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 728d9d165845..6cc9d5a80089 100644 --- a/west.yml +++ b/west.yml @@ -200,7 +200,7 @@ manifest: groups: - hal - name: hal_nordic - revision: daad38f2e9f6c641849010d74fe02ea736d4d921 + revision: a83db66acbeca0bfef157a0c3482c07ddbb82555 path: modules/hal/nordic groups: - hal From 5a16126ab81e47260be5f01c86c0385d8b3d2074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:02 +0200 Subject: [PATCH 2910/3334] Revert "[nrf fromtree] manifest: Update Segger debug monitor files." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bdaa2b9522fb225cd5575144316be5cb5ccd26eb. Signed-off-by: Andrzej Głąbek --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 6cc9d5a80089..f3a744910910 100644 --- a/west.yml +++ b/west.yml @@ -370,7 +370,7 @@ manifest: - testing - tee - name: segger - revision: 50892fdbcf2f570e67baa72b8894a66b16946f72 + revision: 7c843ea24b9b4f100c226bce0b4eb807e50a42ac path: modules/debug/segger groups: - debug From f5eacfba8d366f270f0c8b056d3aebab49fc667b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:02 +0200 Subject: [PATCH 2911/3334] Revert "[nrf fromlist] tests: retained_mem: Fix overlay for nRF54H20dk" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 97bcab454d515df15f6e9e4c1650ad5f3b96f474. Signed-off-by: Andrzej Głąbek --- .../api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 5 +++++ .../api/boards/nrf54h20dk_nrf54h20_cpurad.overlay | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 5e13cc069c53..672a49379e76 100644 --- a/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -15,3 +15,8 @@ retainedmemtestdevice = &retainedmem0; }; }; + +&cpuapp_ram0 { + reg = <0x22000000 DT_SIZE_K(16)>; + ranges = <0x0 0x22000000 0x4000>; +}; diff --git a/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpurad.overlay index ee3754076532..c824df8b74e4 100644 --- a/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ b/tests/drivers/retained_mem/api/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -15,3 +15,8 @@ retainedmemtestdevice = &retainedmem0; }; }; + +&cpurad_ram0 { + reg = <0x23000000 DT_SIZE_K(176)>; + ranges = <0x0 0x23000000 0x2c000>; +}; From 955a83f8f84825fe2666cd3b39ca096500b3dc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:03 +0200 Subject: [PATCH 2912/3334] Revert "[nrf fromlist] tests: clock_control: onoff: Fix test when RC is used" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f366739563d124466d2e91386941d4be7e267379. Signed-off-by: Andrzej Głąbek --- .../clock_control/onoff/src/test_clock_control_onoff.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/drivers/clock_control/onoff/src/test_clock_control_onoff.c b/tests/drivers/clock_control/onoff/src/test_clock_control_onoff.c index 2ce5585c38e1..29b235d2b5ec 100644 --- a/tests/drivers/clock_control/onoff/src/test_clock_control_onoff.c +++ b/tests/drivers/clock_control/onoff/src/test_clock_control_onoff.c @@ -29,11 +29,6 @@ static void clock_off(void) { struct onoff_manager *mgr = get_mgr(); -#if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC) - while (z_nrf_clock_calibration_is_in_progress()) { - /* empty */ - } -#endif do { (void)onoff_release(mgr); From b601d872efef2ccaa1ea1d8ecad60c0951da1553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:03 +0200 Subject: [PATCH 2913/3334] Revert "[nrf noup] scripts: ci: check_compliance: Fix ruff issues part 4" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9749b5cfd4a61b2c7bfc666fbbc69110eb0b2f0b. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 45 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index f0fa9747d364..0962de488739 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1897,30 +1897,31 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop + # NCS-specific allowlist # zephyr-keep-sorted-start re(^\s+") - "APP_CPUNET_RUN", # Used by sample - "APP_DFU", # Used by sample - "BT_FAST_PAIR", # Legacy/removed, used in migration documentation - "COMP_DATA_LAYOUT_ARRAY", # Used by test - "COMP_DATA_LAYOUT_MULTIPLE", # Used by test - "COMP_DATA_LAYOUT_SINGLE", # Used by test - "DTM_NO_DFE", # Used by DTM application - "DTM_TRANSPORT_HCI", # Used by DTM application - "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation - "INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation - "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "ML_APP_REMOTE_BOARD", # Used by machine learning application - "MY_APP_IMAGE_ABC", # Used in documentation - "NETCORE_ABC", # Used in documentation - "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests - "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation - "SUIT_ENVELOPE_", # Used by jinja - "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation - "SUIT_MPI_", # Used by jinja - "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation - "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample + "APP_CPUNET_RUN", # Used by sample + "APP_DFU", # Used by sample + "BT_FAST_PAIR", # Legacy/removed, used in migration documentation + "COMP_DATA_LAYOUT_ARRAY", # Used by test + "COMP_DATA_LAYOUT_MULTIPLE", # Used by test + "COMP_DATA_LAYOUT_SINGLE", # Used by test + "DTM_NO_DFE", # Used by DTM application + "DTM_TRANSPORT_HCI", # Used by DTM application + "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation + "INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation + "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "ML_APP_REMOTE_BOARD", # Used by machine learning application + "MY_APP_IMAGE_ABC", # Used in documentation + "NETCORE_ABC", # Used in documentation + "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests + "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation + "SUIT_ENVELOPE_", # Used by jinja + "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation + "SUIT_MPI_", # Used by jinja + "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation + "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample # zephyr-keep-sorted-stop } From 5e480c22d30a0a07e616361ea2df5789ea75d90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:04 +0200 Subject: [PATCH 2914/3334] Revert "[nrf noup] scripts: ci: check_compliance: Fix ruff issues part 3" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 78357fa2d1320ac843dfbfa60e1a830ddd8128bf. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 143 +++++++++++++++++---------------- 1 file changed, 72 insertions(+), 71 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 0962de488739..3ad714667158 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1748,79 +1748,80 @@ def check_no_undef_outside_kconfig(self, kconf): "ZTEST_FAIL_TEST_", # regex in tests/ztest/fail/CMakeLists.txt "ZVFS_OPEN_ADD_SIZE_", # Used as an option matching prefix # zephyr-keep-sorted-stop + # NCS-specific allow list # zephyr-keep-sorted-start re(^\s+") - "APPLICATION", # Example documentation - "BAR", # Example documentation - "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation - "BT_ADV_PROV_", # Documentation - "BT_CTLR_TX_PWR_MINUS", # CHIP documentation - "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation - "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo - "CHANNEL", # NRF desktop - "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop - "CHANNEL_TRANSPORT_DISABLED", # NRF desktop - "CHANNEL_TRANSPORT_IDLE", # NRF desktop - "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop - "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop - "CHIP_DFU_OVER_BT_SMP", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module - "CHIP_MEMORY_PROFILING", # CHIP module - "CHIP_NUS", # CHIP module - "CHIP_NUS_FIXED_PASSKEY", # CHIP module - "CHIP_NUS_MAX_COMMANDS", # CHIP module - "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module - "CHIP_QSPI_NOR", # CHIP module - "CHIP_SPI_NOR", # CHIP module - "CHIP_WIFI", # CHIP module - "DESKTOP_DVFS_STATE_", # NRF desktop - "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop - "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module - "MEMFAULT_", # Documentation - "MEMFAULT_NCS", # Documentation - "MEMFAULT_NCS_", # Documentation - "MY_CUSTOM_CONFIG", # Example documentation - "MY_EXT_API_ENABLED", # Example documentation - "MY_EXT_API_REQUIRED", # Example documentation - "NCS_IS_VARIANT_IMAGE", # Build system defined symbol - "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot - "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot - "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol - "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation - "PM_PARTITION_SIZE", # Used in search link - "PM_PARTITION_SIZE_", # Used in documentation - "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template - "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template - "SOC_NRF54H20_CPUSEC", # Internal - "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal - "STATUS_", # NRF desktop - "STATUS_COUNT", # NRF desktop - "STATUS_DISCONNECTED", # NRF desktop - "STATUS_FETCH", # NRF desktop - "STATUS_GET_BOARD_NAME", # NRF desktop - "STATUS_GET_HWID", # NRF desktop - "STATUS_GET_MAX_MOD_ID", # NRF desktop - "STATUS_GET_PEER", # NRF desktop - "STATUS_GET_PEERS_CACHE", # NRF desktop - "STATUS_INDEX_PEERS", # NRF desktop - "STATUS_LIST", # NRF desktop - "STATUS_PENDING", # NRF desktop - "STATUS_POS", # NRF desktop - "STATUS_REJECT", # NRF desktop - "STATUS_SET", # NRF desktop - "STATUS_SUCCESS", # NRF desktop - "STATUS_TIMEOUT", # NRF desktop - "STATUS_WRITE_FAIL", # NRF desktop + "APPLICATION", # Example documentation + "BAR", # Example documentation + "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation + "BT_ADV_PROV_", # Documentation + "BT_CTLR_TX_PWR_MINUS", # CHIP documentation + "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation + "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo + "CHANNEL", # NRF desktop + "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop + "CHANNEL_TRANSPORT_DISABLED", # NRF desktop + "CHANNEL_TRANSPORT_IDLE", # NRF desktop + "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop + "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop + "CHIP_DFU_OVER_BT_SMP", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module + "CHIP_MEMORY_PROFILING", # CHIP module + "CHIP_NUS", # CHIP module + "CHIP_NUS_FIXED_PASSKEY", # CHIP module + "CHIP_NUS_MAX_COMMANDS", # CHIP module + "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module + "CHIP_QSPI_NOR", # CHIP module + "CHIP_SPI_NOR", # CHIP module + "CHIP_WIFI", # CHIP module + "DESKTOP_DVFS_STATE_", # NRF desktop + "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop + "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module + "MEMFAULT_", # Documentation + "MEMFAULT_NCS", # Documentation + "MEMFAULT_NCS_", # Documentation + "MY_CUSTOM_CONFIG", # Example documentation + "MY_EXT_API_ENABLED", # Example documentation + "MY_EXT_API_REQUIRED", # Example documentation + "NCS_IS_VARIANT_IMAGE", # Build system defined symbol + "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot + "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot + "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol + "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation + "PM_PARTITION_SIZE", # Used in search link + "PM_PARTITION_SIZE_", # Used in documentation + "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template + "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template + "SOC_NRF54H20_CPUSEC", # Internal + "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal + "STATUS_", # NRF desktop + "STATUS_COUNT", # NRF desktop + "STATUS_DISCONNECTED", # NRF desktop + "STATUS_FETCH", # NRF desktop + "STATUS_GET_BOARD_NAME", # NRF desktop + "STATUS_GET_HWID", # NRF desktop + "STATUS_GET_MAX_MOD_ID", # NRF desktop + "STATUS_GET_PEER", # NRF desktop + "STATUS_GET_PEERS_CACHE", # NRF desktop + "STATUS_INDEX_PEERS", # NRF desktop + "STATUS_LIST", # NRF desktop + "STATUS_PENDING", # NRF desktop + "STATUS_POS", # NRF desktop + "STATUS_REJECT", # NRF desktop + "STATUS_SET", # NRF desktop + "STATUS_SUCCESS", # NRF desktop + "STATUS_TIMEOUT", # NRF desktop + "STATUS_WRITE_FAIL", # NRF desktop # zephyr-keep-sorted-stop } From c1e0e72c3b0a059ae106386d568beb52ef22965c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:04 +0200 Subject: [PATCH 2915/3334] Revert "[nrf noup] scripts: ci: check_compliance: Fix ruff issues part 2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 62c751a8046b47bbad0e816bd82c753c4293c662. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 3ad714667158..e7ae38f28e0f 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -771,11 +771,9 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se self.blocked_module_dirs.append(modules_dir / module / 'Kconfig') if os.path.exists(nrf_modules_dir): - nrf_modules = [ - name - for name in os.listdir(nrf_modules_dir) - if os.path.exists(os.path.join(nrf_modules_dir, name, 'Kconfig')) - ] + nrf_modules = [name for name in os.listdir(nrf_modules_dir) if + os.path.exists(os.path.join(nrf_modules_dir, name, + 'Kconfig'))] for module in nrf_modules: if module in self.external_module_name_block_list: From 0f34505468c34dbeab86258b7a1608a6da56d95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:04 +0200 Subject: [PATCH 2916/3334] Revert "[nrf noup] scripts: ci: check_compliance: Fix ruff issues part 1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6e235065f405d60ab6ce3bf258280f57e2ec31b1. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 43 +++++++--------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index e7ae38f28e0f..a4f134944840 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -687,37 +687,13 @@ class KconfigCheck(ComplianceTest): # This block list contains a list of upstream Zephyr modules that should not be checked # DO NOT MERGE CHANGES TO THIS WITHOUT BUILD SYSTEM AND CODE OWNER APPROVAL! - external_module_name_block_list = [ - 'canopennode', - 'chre', - 'cmsis', - 'cmsis-dsp', - 'cmsis-nn', - 'cmsis_6', - 'edtt', - 'fatfs', - 'hal_st', - 'hal_tdk', - 'hal_wurthelektronik', - 'liblc3', - 'libmetal', - 'littlefs', - 'loramac-node', - 'lvgl', - 'lz4', - 'mipi-sys-t', - 'nanopb', - 'net-tools', - 'nrf_hw_models', - 'open-amp', - 'percepio', - 'picolibc', - 'segger', - 'tf-m-tests', - 'tinycrypt', - 'uoscore-uedhoc', - 'zscilib', - ] + external_module_name_block_list = ['canopennode', 'chre', 'cmsis', 'cmsis-dsp', 'cmsis-nn', + 'cmsis_6', 'edtt', 'fatfs', 'hal_st', 'hal_tdk', + 'hal_wurthelektronik', 'liblc3', 'libmetal', 'littlefs', + 'loramac-node', 'lvgl', 'lz4', 'mipi-sys-t', 'nanopb', + 'net-tools', 'nrf_hw_models', 'open-amp', 'percepio', + 'picolibc', 'segger', 'tf-m-tests', 'tinycrypt', + 'uoscore-uedhoc', 'zscilib'] # Holds a list or directories/files which should not be checked blocked_module_dirs = [] @@ -1379,9 +1355,8 @@ def check_no_enable_in_boolean_prompt(self, kconf): for module_name in self.external_module_name_block_list: # Workaround for being unable to use full_match() due to python version - if '/modules/' in str(normalised_file_name) and ( - '/' + module_name + '/' - ) in str(normalised_file_name): + if '/modules/' in str(normalised_file_name) and \ + ('/' + module_name + '/') in str(normalised_file_name): skip_node = True break From 27f935c0816d29ce20b3da899f36a911af92ebc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:05 +0200 Subject: [PATCH 2917/3334] Revert "[nrf fromlist] CI: Add prefix to dts-linter npx commands" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 802d91c869325a28f3f5be564ec4c8eefb6a0c8b. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index a4f134944840..439c82508c20 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -536,7 +536,6 @@ class DevicetreeLintingCheck(ComplianceTest): name = "DevicetreeLinting" doc = zephyr_doc_detail_builder("/contribute/style/devicetree.html") NPX_EXECUTABLE = "npx" - prefix = ZEPHYR_BASE / "scripts" / "ci" def ensure_npx(self) -> bool: if not (npx_executable := shutil.which(self.NPX_EXECUTABLE)): @@ -545,7 +544,7 @@ def ensure_npx(self) -> bool: self.npx_exe = npx_executable # --no prevents npx from fetching from registry subprocess.run( - [self.npx_exe, "--prefix", self.prefix, "--no", 'dts-linter', "--", "--version"], + [self.npx_exe, "--prefix", "./scripts/ci", "--no", 'dts-linter', "--", "--version"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True, @@ -626,7 +625,7 @@ def run(self): cmd = [ self.npx_exe, "--prefix", - self.prefix, + "./scripts/ci", "--no", "dts-linter", "--", From a9ed97ff106203a9ecf16827420135ac5f8147ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:05 +0200 Subject: [PATCH 2918/3334] Revert "[nrf fromtree] tests: nrf: add integration platform for rram_throttling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 74b7483eb21c705df9f2c607a9085d9f440b9528. Signed-off-by: Andrzej Głąbek --- tests/boards/nrf/rram_throttling/testcase.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/boards/nrf/rram_throttling/testcase.yaml b/tests/boards/nrf/rram_throttling/testcase.yaml index 4aee70d034b4..4ed53aac8c7b 100644 --- a/tests/boards/nrf/rram_throttling/testcase.yaml +++ b/tests/boards/nrf/rram_throttling/testcase.yaml @@ -13,5 +13,3 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l10/cpuapp - integration_platforms: - - nrf54l15dk/nrf54l15/cpuapp From 70ea58f0dc68e2248e8c99b429c45f731e56e0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:05 +0200 Subject: [PATCH 2919/3334] Revert "[nrf fromtree] boards: nordic: nrf54l15tag: Fix missing ranges" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4b9ff7f299d33df38dd0bf33d3e6da01e67e9691. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts | 1 - boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts | 1 - 2 files changed, 2 deletions(-) diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts index d1e39d3e5d96..6cdf34ddc663 100644 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts @@ -31,7 +31,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts index 26bdbe51a22d..2f98d5ffc28f 100644 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts +++ b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts @@ -18,7 +18,6 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ranges; cpuflpr_code_partition: partition@0 { label = "image-0"; From e8ebc43bb546a3ceee4f2b63fc1779b806bce326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:06 +0200 Subject: [PATCH 2920/3334] Revert "[nrf fromtree] samples: tests: drivers: watchdog: exclude nrf54l15tag" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 47417afd7141e6fb445e745b54d932a1303a2e55. Signed-off-by: Andrzej Głąbek --- samples/drivers/watchdog/sample.yaml | 4 ---- tests/drivers/watchdog/wdt_basic_api/testcase.yaml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/samples/drivers/watchdog/sample.yaml b/samples/drivers/watchdog/sample.yaml index 7fd53d18762c..c7fffc99001a 100644 --- a/samples/drivers/watchdog/sample.yaml +++ b/samples/drivers/watchdog/sample.yaml @@ -29,10 +29,6 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - - nrf54l15tag/nrf54l15/cpuapp - - nrf54l15tag/nrf54l15/cpuapp/ns - - nrf54l15tag/nrf54l15/cpuflpr - - nrf54l15tag/nrf54l15/cpuflpr/xip - nrf7120dk/nrf7120/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns diff --git a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml index 9551d3b8503f..75cdc5da40e3 100644 --- a/tests/drivers/watchdog/wdt_basic_api/testcase.yaml +++ b/tests/drivers/watchdog/wdt_basic_api/testcase.yaml @@ -28,10 +28,6 @@ tests: - panb611evb/nrf54l15/cpuflpr/xip - mimxrt700_evk/mimxrt798s/cm33_cpu1 - nrf54l15dk/nrf54l10/cpuapp/ns - - nrf54l15tag/nrf54l15/cpuapp - - nrf54l15tag/nrf54l15/cpuapp/ns - - nrf54l15tag/nrf54l15/cpuflpr - - nrf54l15tag/nrf54l15/cpuflpr/xip - nrf54lm20dk/nrf54lm20a/cpuapp/ns - bl54l15_dvk/nrf54l10/cpuapp/ns - bl54l15_dvk/nrf54l15/cpuapp/ns From adada855976849c932e02576078d16b06b621a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:06 +0200 Subject: [PATCH 2921/3334] Revert "[nrf fromtree] tests: drivers: pinctrl: nrf: enable PINCTRL" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2cef306d846b166ed05ed862eb839ea820a58770. Signed-off-by: Andrzej Głąbek --- tests/drivers/pinctrl/nrf/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/pinctrl/nrf/prj.conf b/tests/drivers/pinctrl/nrf/prj.conf index 311b1dbbc841..5e341d7d3873 100644 --- a/tests/drivers/pinctrl/nrf/prj.conf +++ b/tests/drivers/pinctrl/nrf/prj.conf @@ -1,3 +1,2 @@ CONFIG_ZTEST=y -CONFIG_PINCTRL=y CONFIG_PINCTRL_TEST_NON_STATIC=y From 92c3f4df15b5f062ca0fc9596e0d10e7bd76fa83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:06 +0200 Subject: [PATCH 2922/3334] Revert "[nrf fromtree] boards: nordic: introduce nrf54l15tag" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a7f9ca07bafd12d13f5610d801c104244cc88834. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54l15tag/Kconfig | 30 --- boards/nordic/nrf54l15tag/Kconfig.defconfig | 27 --- boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag | 8 - boards/nordic/nrf54l15tag/board.cmake | 19 -- boards/nordic/nrf54l15tag/board.yml | 48 ----- .../nrf54l15tag/doc/img/nrf54l15tag.webp | Bin 31422 -> 0 bytes .../doc/img/nrf54l15tag_debug.webp | Bin 28458 -> 0 bytes boards/nordic/nrf54l15tag/doc/index.rst | 85 -------- .../nrf54l15tag/nrf54l15tag_common.dtsi | 190 ------------------ .../nrf54l15tag_cpuapp_common.dtsi | 114 ----------- .../nrf54l15tag_cpuflpr_common.dtsi | 22 -- .../nrf54l15tag_nrf54l15_cpuapp.dts | 27 --- .../nrf54l15tag_nrf54l15_cpuapp.yaml | 24 --- .../nrf54l15tag_nrf54l15_cpuapp_defconfig | 5 - .../nrf54l15tag_nrf54l15_cpuapp_ns.dts | 31 --- .../nrf54l15tag_nrf54l15_cpuapp_ns.yaml | 23 --- .../nrf54l15tag_nrf54l15_cpuapp_ns_defconfig | 31 --- .../nrf54l15tag_nrf54l15_cpuflpr.dts | 40 ---- .../nrf54l15tag_nrf54l15_cpuflpr.yaml | 17 -- .../nrf54l15tag_nrf54l15_cpuflpr_defconfig | 8 - .../nrf54l15tag_nrf54l15_cpuflpr_xip.dts | 27 --- .../nrf54l15tag_nrf54l15_cpuflpr_xip.yaml | 17 -- ...nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig | 7 - 23 files changed, 800 deletions(-) delete mode 100644 boards/nordic/nrf54l15tag/Kconfig delete mode 100644 boards/nordic/nrf54l15tag/Kconfig.defconfig delete mode 100644 boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag delete mode 100644 boards/nordic/nrf54l15tag/board.cmake delete mode 100644 boards/nordic/nrf54l15tag/board.yml delete mode 100644 boards/nordic/nrf54l15tag/doc/img/nrf54l15tag.webp delete mode 100644 boards/nordic/nrf54l15tag/doc/img/nrf54l15tag_debug.webp delete mode 100644 boards/nordic/nrf54l15tag/doc/index.rst delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_common.dtsi delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_cpuapp_common.dtsi delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_cpuflpr_common.dtsi delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.dts delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.yaml delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_defconfig delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.dts delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.yaml delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns_defconfig delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.yaml delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_defconfig delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.yaml delete mode 100644 boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig diff --git a/boards/nordic/nrf54l15tag/Kconfig b/boards/nordic/nrf54l15tag/Kconfig deleted file mode 100644 index e2f267bb829e..000000000000 --- a/boards/nordic/nrf54l15tag/Kconfig +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# nRF54L15 TAG board configuration - -if BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS - -DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) - -config NRF_TRUSTZONE_FLASH_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the flash region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral-specific symbols. - -config NRF_TRUSTZONE_RAM_REGION_SIZE - hex - default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) - help - This defines the RAM region size from the TrustZone perspective. - It is used when configuring the TrustZone and when setting alignments - requirements for the partitions. - This abstraction allows us to configure TrustZone without depending - on peripheral specific symbols. - -endif # BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS diff --git a/boards/nordic/nrf54l15tag/Kconfig.defconfig b/boards/nordic/nrf54l15tag/Kconfig.defconfig deleted file mode 100644 index 20fad4b04be6..000000000000 --- a/boards/nordic/nrf54l15tag/Kconfig.defconfig +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -if SPI_NOR - -config SPI_NOR_FLASH_LAYOUT_PAGE_SIZE - default 4096 if MCUBOOT || BOOTLOADER_MCUBOOT - -endif # SPI_NOR - -if BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS - -config BOARD_NRF54L15TAG - select USE_DT_CODE_PARTITION - -config HAS_BT_CTLR - default BT - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y - -endif # BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS diff --git a/boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag b/boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag deleted file mode 100644 index 48a6fb2c79f0..000000000000 --- a/boards/nordic/nrf54l15tag/Kconfig.nrf54l15tag +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NRF54L15TAG - select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15TAG_NRF54L15_CPUAPP || \ - BOARD_NRF54L15TAG_NRF54L15_CPUAPP_NS - select SOC_NRF54L15_CPUFLPR if BOARD_NRF54L15TAG_NRF54L15_CPUFLPR || \ - BOARD_NRF54L15TAG_NRF54L15_CPUFLPR_XIP diff --git a/boards/nordic/nrf54l15tag/board.cmake b/boards/nordic/nrf54l15tag/board.cmake deleted file mode 100644 index 8750e32d0bb4..000000000000 --- a/boards/nordic/nrf54l15tag/board.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if(CONFIG_SOC_NRF54L15_CPUAPP) - board_runner_args(jlink "--device=nRF54L15_M33" "--speed=4000") -elseif(CONFIG_SOC_NRF54L15_CPUFLPR) - board_runner_args(jlink "--device=nRF54L15_RV32") -endif() - -if(CONFIG_TRUSTED_EXECUTION_NONSECURE) - set(TFM_PUBLIC_KEY_FORMAT "full") -endif() - -if(CONFIG_TFM_FLASH_MERGED_BINARY) - set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) -endif() - -include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nordic/nrf54l15tag/board.yml b/boards/nordic/nrf54l15tag/board.yml deleted file mode 100644 index c482665487be..000000000000 --- a/boards/nordic/nrf54l15tag/board.yml +++ /dev/null @@ -1,48 +0,0 @@ -board: - name: nrf54l15tag - full_name: nRF54L15 TAG - vendor: nordic - socs: - - name: nrf54l15 - variants: - - name: xip - cpucluster: cpuflpr - - name: ns - cpucluster: cpuapp -runners: - run_once: - '--recover': - - runners: - - nrfjprog - - nrfutil - run: first - groups: - - boards: - - nrf54l15tag/nrf54l15/cpuapp - - nrf54l15tag/nrf54l15/cpuapp/ns - - nrf54l15tag/nrf54l15/cpuflpr - - nrf54l15tag/nrf54l15/cpuflpr/xip - '--erase': - - runners: - - nrfjprog - - jlink - - nrfutil - run: first - groups: - - boards: - - nrf54l15tag/nrf54l15/cpuapp - - nrf54l15tag/nrf54l15/cpuapp/ns - - nrf54l15tag/nrf54l15/cpuflpr - - nrf54l15tag/nrf54l15/cpuflpr/xip - '--reset': - - runners: - - nrfjprog - - jlink - - nrfutil - run: last - groups: - - boards: - - nrf54l15tag/nrf54l15/cpuapp - - nrf54l15tag/nrf54l15/cpuapp/ns - - nrf54l15tag/nrf54l15/cpuflpr - - nrf54l15tag/nrf54l15/cpuflpr/xip diff --git a/boards/nordic/nrf54l15tag/doc/img/nrf54l15tag.webp b/boards/nordic/nrf54l15tag/doc/img/nrf54l15tag.webp deleted file mode 100644 index 49e4ab27d06e2659d1d6b1a2ba154512d1a533ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31422 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 diff --git a/boards/nordic/nrf54l15tag/doc/img/nrf54l15tag_debug.webp b/boards/nordic/nrf54l15tag/doc/img/nrf54l15tag_debug.webp deleted file mode 100644 index a3a0ce478f494e001ba5fca67ebbc42ae0760146..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28458 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 diff --git a/boards/nordic/nrf54l15tag/doc/index.rst b/boards/nordic/nrf54l15tag/doc/index.rst deleted file mode 100644 index 7fa73f5346a8..000000000000 --- a/boards/nordic/nrf54l15tag/doc/index.rst +++ /dev/null @@ -1,85 +0,0 @@ -.. zephyr:board:: nrf54l15tag - -Overview -******** - -The nRF54L15 TAG is a hardware development platform used to design and develop applications for the -nrf54L15 SoC. - -Hardware -******** - -The nRF54L15 TAG has a number of exposed pins which can be used for application specific purposes. -The following is the default availability (no optional components mounted by user). - -* P0.01 Available -* P0.02 Available -* P0.04 Available -* P1.02 Available -* P1.03 Available -* P1.11 SCL (i2c21) -* P1.12 SDA (i2c21) -* P1.13 Available -* P1.14 Available -* P2.05 Reserved -* P2.06 Available -* P2.07 Available - -.. note:: By default the ANT1 antenna is connected to the SoC using GPIO Hogs. - -Supported Features -****************** - -.. zephyr:board-supported-hw:: - -Programming and Debugging -************************* - -.. zephyr:board-supported-runners:: - -The nRF54L15 TAG is programmed and debugged using the onboard debugger of an nRF54L DK as -depicted below: - -.. figure:: img/nrf54l15tag_debug.webp - :align: center - :alt: nRF54L15 TAG debugging - - nRF54L15 TAG debugging (Credit: Nordic Semiconductor) - -Once the nRF54L15 TAG is inserted into the DK's ``DEBUG OUT`` header, the nRF54L DK's onboard -debugger is rerouted from the DK's nRF54L15 SoC to the TAG's nRF54L15 SoC. Once powered, the TAG's -nRF54L15 SoC is then programmed and debugged just like the nRF54L15 SoC of an nRF54L DK, see -:zephyr:board:`nrf54l15dk`. - -.. warning:: - - Do not apply 3.3V to ``VDD SWD0`` or the ``VDD`` on the TAG in general if a coin cell battery - is inserted. - -The nRF54L15 TAG is not powered from the ``DEBUG OUT`` header by default. To power the nRF54L15 -TAG, either insert a CR2032 coin cell battery into its battery holder, **OR** apply 3.3V to the -``VDD SWD0`` pin on the nRF54L DK to power the TAG externally. - -Using an nRF54L15 DK, the DK can be configured to set VDD to 3.3V, and a jumper between any -of the DK's ``VDDIO`` pins and the ``VDD SWD0`` pin can be connected. - -Console and logging -******************* - -To get console and logging output, enable Segger RTT using the :ref:`snippet-rtt-console` snippet: - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: nrf54l15tag/nrf54l15/cpuapp - :goals: build flash - :west-args: --snippet rtt-console - :compact: - -or enable the NUS service using the :ref:`snippet-nus-console` snippet: - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: nrf54l15tag/nrf54l15/cpuapp - :goals: build flash - :west-args: --snippet nus-console - :compact: diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_common.dtsi b/boards/nordic/nrf54l15tag/nrf54l15tag_common.dtsi deleted file mode 100644 index f197704373cb..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_common.dtsi +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -/ { - aliases { - led0 = &led1_blue; - sw0 = &button0; - }; - - leds { - compatible = "gpio-leds"; - - led1_red: led1_red { - gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; - label = "LED 1 red"; - }; - - led1_green: led1_green { - gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; - label = "LED 1 green"; - }; - - led1_blue: led1_blue { - gpios = <&gpio2 9 GPIO_ACTIVE_LOW>; - label = "LED 1 blue"; - }; - - led2_red: led2_red { - status = "disabled"; - gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; - label = "LED 2 red"; - }; - - led2_green: led2_green { - status = "disabled"; - gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; - label = "LED 2 green"; - }; - - led2_blue: led2_blue { - status = "disabled"; - gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; - label = "LED 2 blue"; - }; - }; - - rgb_led_1: rgb_led_1 { - compatible = "leds-group-multicolor"; - - leds = <&led1_red>, - <&led1_green>, - <&led1_blue>; - - color-mapping = , - , - ; - }; - - rgb_led_2: rgb_led_2 { - status = "disabled"; - compatible = "leds-group-multicolor"; - - leds = <&led2_red>, - <&led2_green>, - <&led2_blue>; - - color-mapping = , - , - ; - }; - - buttons { - compatible = "gpio-keys"; - - button0: button0 { - gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 0"; - zephyr,code = ; - }; - - button1: button1 { - status = "disabled"; - gpios = <&gpio0 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 1"; - zephyr,code = ; - }; - }; - - sky13348: sky13348 { - compatible = "skyworks,sky13348"; - v1-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; - v2-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; - }; -}; - -&pinctrl { - i2c21_default: i2c21_default { - group1 { - psels = , - ; - }; - }; - - i2c21_sleep: i2c21_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - spi22_default: spi22_default { - group1 { - psels = , - , - ; - }; - }; - - spi22_sleep: spi22_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; -}; - -&i2c21 { - pinctrl-0 = <&i2c21_default>; - pinctrl-1 = <&i2c21_sleep>; - pinctrl-names = "default", "sleep"; - zephyr,concat-buf-size = <256>; - clock-frequency = ; - - bme688: bme688@76 { - status = "disabled"; - compatible = "bosch,bme680"; - reg = <0x76>; - }; - - adxl367: adxl367@1d { - status = "disabled"; - compatible = "adi,adxl367"; - reg = <0x1d>; - }; -}; - -&spi22 { - pinctrl-0 = <&spi22_default>; - pinctrl-1 = <&spi22_sleep>; - pinctrl-names = "default", "sleep"; - overrun-character = <0x00>; - cs-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; - - bmi270: bmi270@0 { - status = "disabled"; - compatible = "bosch,bmi270"; - reg = <0>; - spi-max-frequency = ; - irq-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; - }; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&gpiote20 { - status = "okay"; -}; - -&gpiote30 { - status = "okay"; -}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_cpuapp_common.dtsi b/boards/nordic/nrf54l15tag/nrf54l15tag_cpuapp_common.dtsi deleted file mode 100644 index 592a84ee751c..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_cpuapp_common.dtsi +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15tag_common.dtsi" - -/ { - chosen { - zephyr,flash-controller = &rram_controller; - zephyr,flash = &cpuapp_rram; - zephyr,ieee802154 = &ieee802154; - zephyr,boot-mode = &boot_mode0; - }; - - aliases { - mcuboot-led0 = &led1_blue; - mcuboot-button0 = &button0; - }; -}; - -&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"; -}; - -&lfxo { - status = "okay"; - load-capacitors = "internal"; - load-capacitance-femtofarad = <9000>; -}; - -&hfxo { - status = "okay"; - load-capacitors = "internal"; - load-capacitance-femtofarad = <8000>; -}; - -&radio { - status = "okay"; -}; - -&ieee802154 { - status = "okay"; -}; - -&temp { - status = "okay"; -}; - -&clock { - status = "okay"; -}; - -®ulators { - status = "okay"; -}; - -&vregmain { - status = "okay"; - regulator-initial-mode = ; -}; - -&gpregret1 { - status = "okay"; - - boot_mode0: boot_mode@0 { - compatible = "zephyr,retention"; - status = "okay"; - reg = <0x0 0x1>; - }; -}; - -&adc { - status = "okay"; -}; - -&i2c21 { - status = "okay"; -}; - -&bme688 { - status = "okay"; -}; - -&adxl367 { - status = "okay"; -}; - -&spi22 { - status = "okay"; -}; - -&bmi270 { - status = "okay"; -}; - -/* Initially connect ANT1 to SoC */ -&gpio1 { - antenna_switch_v1 { - gpio-hog; - gpios = <9 GPIO_ACTIVE_HIGH>; - output-high; - }; - - antenna_switch_v2 { - gpio-hog; - gpios = <10 GPIO_ACTIVE_HIGH>; - output-low; - }; -}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_cpuflpr_common.dtsi b/boards/nordic/nrf54l15tag/nrf54l15tag_cpuflpr_common.dtsi deleted file mode 100644 index 96c440092450..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_cpuflpr_common.dtsi +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -#include "nrf54l15tag_common.dtsi" - -/ { - chosen { - zephyr,code-partition = &cpuflpr_code_partition; - zephyr,flash = &cpuflpr_rram; - zephyr,sram = &cpuflpr_sram; - }; -}; - -&grtc { - owned-channels = <3 4>; - status = "okay"; -}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.dts deleted file mode 100644 index e1ef8ccb4069..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.dts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include - -#include "nrf54l15tag_cpuapp_common.dtsi" - -/ { - compatible = "nordic,nrf54l15tag_nrf54l15_cpuapp"; - model = "Nordic nRF54L15 TAG nRF54L15 Application MCU"; - - chosen { - zephyr,flash = &cpuapp_rram; - zephyr,sram = &cpuapp_sram; - zephyr,code-partition = &slot0_partition; - }; -}; - -&uicr { - nfct-pins-as-gpios; -}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.yaml b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.yaml deleted file mode 100644 index 7e6152eb79f1..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54l15tag/nrf54l15/cpuapp -name: nRF54l15-TAG-nRF54l15-Application -type: mcu -arch: arm -toolchain: - - gnuarmemb - - zephyr -sysbuild: true -ram: 188 -flash: 664 -supported: - - adc - - counter - - dmic - - gpio - - i2c - - i2s - - pwm - - retained_mem - - spi - - watchdog diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_defconfig b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_defconfig deleted file mode 100644 index 5d5bca8f9693..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_defconfig +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_GPIO=y -CONFIG_ARM_MPU=y diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.dts deleted file mode 100644 index 9d17ea870c5c..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.dts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#define USE_NON_SECURE_ADDRESS_MAP 1 - -#include -#include - -#include "nrf54l15tag_cpuapp_common.dtsi" - -/ { - compatible = "nordic,nrf54l15tag_nrf54l15-cpuapp"; - model = "Nordic nRF54L15 TAG nRF54L15 Application MCU"; - - /delete-node/ rng; - - psa_rng: psa-rng { - status = "okay"; - }; - - chosen { - zephyr,sram = &sram0_ns; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - }; -}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.yaml b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.yaml deleted file mode 100644 index dd1315aaeac2..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54l15tag/nrf54l15/cpuapp/ns -name: nRF54l15-TAG-nRF54l15-Application-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - zephyr -ram: 128 -flash: 512 -supported: - - adc - - counter - - gpio - - i2c - - i2s - - pwm - - spi - - watchdog -vendor: nordic -sysbuild: true diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns_defconfig b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns_defconfig deleted file mode 100644 index b1d9e1219343..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuapp_ns_defconfig +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_ARM_MPU=y -CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# Don't enable the cache in the non-secure image as it is a -# secure-only peripheral on 54l -CONFIG_CACHE_MANAGEMENT=n -CONFIG_EXTERNAL_CACHE=n - -CONFIG_GPIO=y - -# Start SYSCOUNTER on driver init -CONFIG_NRF_GRTC_START_SYSCOUNTER=y - -# Disable TFM BL2 since it is not supported -CONFIG_TFM_BL2=n - -# No UART available for TF-M log output -CONFIG_TFM_LOG_LEVEL_SILENCE=y - -# The oscillators are configured as secure and cannot be configured -# from the non secure application directly. This needs to be set -# otherwise nrfx will try to configure them, resulting in a bus -# fault. -CONFIG_NRF_SKIP_CLOCK_CONFIG=y diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts deleted file mode 100644 index 6cdf34ddc663..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.dts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include "nrf54l15tag_cpuflpr_common.dtsi" - -/ { - model = "Nordic nRF54L15 TAG nRF54L15 FLPR MCU"; - compatible = "nordic,nrf54l15tag_nrf54l15-cpuflpr"; - - soc { - /* Resize SRAM partition */ - /delete-node/ memory@2002f000; - - cpuflpr_sram: memory@20028000 { - compatible = "mmio-sram"; - reg = <0x20028000 DT_SIZE_K(96)>; - #address-cells = <1>; - #size-cells = <1>; - 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)>; - }; - }; -}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.yaml b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.yaml deleted file mode 100644 index 02dffd2f5162..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54l15tag/nrf54l15/cpuflpr -name: nRF54L15-TAG-nRF54L15-Fast-Lightweight-Peripheral-Processor -type: mcu -arch: riscv -toolchain: - - zephyr -sysbuild: true -ram: 96 -flash: 96 -supported: - - counter - - gpio - - i2c - - spi diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_defconfig b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_defconfig deleted file mode 100644 index 706e58db3f28..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_defconfig +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_GPIO=y -CONFIG_USE_DT_CODE_PARTITION=y - -# Execute from SRAM -CONFIG_XIP=n diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts deleted file mode 100644 index 2f98d5ffc28f..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.dts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include "nrf54l15tag_cpuflpr_common.dtsi" - -/ { - model = "Nordic nRF54L15 TAG nRF54L15 FLPR MCU"; - compatible = "nordic,nrf54l15tag_nrf54l15-cpuflpr"; -}; - -&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)>; - }; - }; -}; diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.yaml b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.yaml deleted file mode 100644 index ccf6a310a637..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54l15tag/nrf54l15/cpuflpr/xip -name: nRF54L15-TAG-nRF54L15-Fast-Lightweight-Peripheral-Processor (RRAM XIP) -type: mcu -arch: riscv -toolchain: - - zephyr -sysbuild: true -ram: 68 -flash: 96 -supported: - - counter - - gpio - - i2c - - spi diff --git a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig b/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig deleted file mode 100644 index 36b6c6c6fc1d..000000000000 --- a/boards/nordic/nrf54l15tag/nrf54l15tag_nrf54l15_cpuflpr_xip_defconfig +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_GPIO=y - -# Execute from RRAM -CONFIG_XIP=y From 8d18c3a9879c0b20b529881ff86e740c10c78a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:07 +0200 Subject: [PATCH 2923/3334] Revert "[nrf fromtree] dts: bindings: misc: add model for skyworks sky13348 antenna switch" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d1d515d38b1981dfc0e6fad1d4f7d5a53d8ae743. Signed-off-by: Andrzej Głąbek --- dts/bindings/misc/skyworks,sky13348.yaml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 dts/bindings/misc/skyworks,sky13348.yaml diff --git a/dts/bindings/misc/skyworks,sky13348.yaml b/dts/bindings/misc/skyworks,sky13348.yaml deleted file mode 100644 index 000e50a3ae63..000000000000 --- a/dts/bindings/misc/skyworks,sky13348.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Output selectors on the SKY13348 GaAs SPDT FET I/C switch - -compatible: "skyworks,sky13348" - -include: base.yaml - -properties: - v1-gpios: - type: phandle-array - required: true - description: V1 pin - v2-gpios: - type: phandle-array - required: true - description: V2 pin From 1cc2c1cb1920d264ca3941d3505cf6083dfecd31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:07 +0200 Subject: [PATCH 2924/3334] Revert "[nrf fromlist] tests: arch: arm_irq_advanced_features: allow overriding IRQ offset" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 86faecec4d17a7b2a61f77ba0e47aef13a6ed63a. Signed-off-by: Andrzej Głąbek --- tests/arch/arm/arm_irq_advanced_features/Kconfig | 8 -------- .../src/arm_dynamic_direct_interrupts.c | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 tests/arch/arm/arm_irq_advanced_features/Kconfig diff --git a/tests/arch/arm/arm_irq_advanced_features/Kconfig b/tests/arch/arm/arm_irq_advanced_features/Kconfig deleted file mode 100644 index 8efcea753559..000000000000 --- a/tests/arch/arm/arm_irq_advanced_features/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2026 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config TEST_DIRECT_IRQ_MAX - int "Max offset of direct IRQ used for the test" - default NUM_IRQS - -source "Kconfig.zephyr" diff --git a/tests/arch/arm/arm_irq_advanced_features/src/arm_dynamic_direct_interrupts.c b/tests/arch/arm/arm_irq_advanced_features/src/arm_dynamic_direct_interrupts.c index 9bbc618f26f8..fc64cb3fb3fb 100644 --- a/tests/arch/arm/arm_irq_advanced_features/src/arm_dynamic_direct_interrupts.c +++ b/tests/arch/arm/arm_irq_advanced_features/src/arm_dynamic_direct_interrupts.c @@ -13,7 +13,7 @@ #ifdef CONFIG_2ND_LVL_ISR_TBL_OFFSET #define DIRECT_ISR_OFFSET (CONFIG_2ND_LVL_ISR_TBL_OFFSET - 1) #else -#define DIRECT_ISR_OFFSET (CONFIG_TEST_DIRECT_IRQ_MAX - 1) +#define DIRECT_ISR_OFFSET (CONFIG_NUM_IRQS - 1) #endif static volatile int test_flag; From 164a35c254c9a2e0bc94aebc311e60711fd69aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:07 +0200 Subject: [PATCH 2925/3334] Revert "[nrf fromtree] drivers: mspi_dw: nrf_qspi_v2: Remove redundant EVDMA definitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 02597955642fc2f435ec99485163f831af545e55. Signed-off-by: Andrzej Głąbek --- drivers/mspi/mspi_dw_vendor_specific.h | 29 +++++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index f3627132f669..fbdd0119d383 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -140,9 +140,19 @@ static inline void vendor_specific_irq_clear(const struct device *dev) #if defined(CONFIG_MSPI_DMA) /* DMA support */ + +#define EVDMA_ATTR_LEN_Pos (0UL) +#define EVDMA_ATTR_LEN_Msk (0x00FFFFFFUL) + #define EVDMA_ATTR_ATTR_Pos (24UL) #define EVDMA_ATTR_ATTR_Msk (0x3FUL << EVDMA_ATTR_ATTR_Pos) +#define EVDMA_ATTR_32AXI_Pos (30UL) +#define EVDMA_ATTR_32AXI_Msk (0x1UL << EVDMA_ATTR_32AXI_Pos) + +#define EVDMA_ATTR_EVENTS_Pos (31UL) +#define EVDMA_ATTR_EVENTS_Msk (0x1UL << EVDMA_ATTR_EVENTS_Pos) + typedef enum { EVDMA_BYTE_SWAP = 0, EVDMA_JOBLIST = 1, @@ -150,9 +160,13 @@ typedef enum { EVDMA_FIXED_ATTR = 3, EVDMA_STATIC_ADDR = 4, EVDMA_PLAIN_DATA_BUF_WR = 5, - EVDMA_PLAIN_DATA = 0x3f, } EVDMA_ATTR_Type; +/* Setup EVDMA attribute with the following configuratrion */ +#define EVDMA_ATTRIBUTE (BIT(EVDMA_BYTE_SWAP) | BIT(EVDMA_JOBLIST) | \ + BIT(EVDMA_BUFFER_FILL) | BIT(EVDMA_FIXED_ATTR) | \ + BIT(EVDMA_STATIC_ADDR) | BIT(EVDMA_PLAIN_DATA_BUF_WR)) + typedef struct { uint8_t *addr; uint32_t attr; @@ -215,14 +229,13 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) /* * The Command and Address will always have a length of 4 from the DMA's - * perspective. QSPI peripheral will use length of data specified in core registers. - * Since the cmd and address are stored as uint32_t, byte swap is never needed. + * perspective. QSPI peripheral will use length of data specified in core registers */ if (dev_data->xfer.cmd_length > 0) { - joblist[job_idx++] = EVDMA_JOB(&packet->cmd, 4, EVDMA_PLAIN_DATA); + joblist[job_idx++] = EVDMA_JOB(&packet->cmd, 4, EVDMA_ATTRIBUTE); } if (dev_data->xfer.addr_length > 0) { - joblist[job_idx++] = EVDMA_JOB(&packet->address, 4, EVDMA_PLAIN_DATA); + joblist[job_idx++] = EVDMA_JOB(&packet->address, 4, EVDMA_ATTRIBUTE); } if (packet->dir == MSPI_TX) { @@ -230,7 +243,7 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) if (packet->num_bytes > 0) { joblist[job_idx++] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_PLAIN_DATA); + EVDMA_ATTRIBUTE); } /* Always terminate with null job */ @@ -250,7 +263,7 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) joblist[job_idx++] = EVDMA_NULL_JOB(); transfer_list->rx_job = &joblist[job_idx]; joblist[job_idx++] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_PLAIN_DATA); + EVDMA_ATTRIBUTE); joblist[job_idx] = EVDMA_NULL_JOB(); } else { /* Sending command or address while configured as target isn't supported */ @@ -258,7 +271,7 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) transfer_list->rx_job = &joblist[0]; joblist[0] = EVDMA_JOB(packet->data_buf, packet->num_bytes, - EVDMA_PLAIN_DATA); + EVDMA_ATTRIBUTE); joblist[1] = EVDMA_NULL_JOB(); transfer_list->tx_job = &joblist[1]; } From e52d1847be8770010fdd309a8d49147f201c41a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:08 +0200 Subject: [PATCH 2926/3334] Revert "[nrf fromtree] drivers: mspi_dw: nrf_qspi_v2: Add ifdef to include DMA code if enabled" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3a1ec57a78889643bbde01b31c4ced3be369e467. Signed-off-by: Andrzej Głąbek --- drivers/mspi/mspi_dw_vendor_specific.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index fbdd0119d383..2c26cfa1b1ee 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -138,7 +138,6 @@ static inline void vendor_specific_irq_clear(const struct device *dev) preg->EVENTS_DMA.DONE = 0; } -#if defined(CONFIG_MSPI_DMA) /* DMA support */ #define EVDMA_ATTR_LEN_Pos (0UL) @@ -309,7 +308,6 @@ static inline bool vendor_specific_read_dma_irq(const struct device *dev) return (bool) preg->EVENTS_DMA.DONE; } -#endif /*defined(CONFIG_MSPI_DMA)*/ #else /* Supply empty vendor specific macros for generic case */ From 8896023d43a1658c676a339338c02e3e8c7a1303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:08 +0200 Subject: [PATCH 2927/3334] Revert "[nrf fromtree] drivers: mspi_dw: fix DMA transfer size logic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3c36fcd3cdccb4d417e86452ffc686e84e6d03f7. Signed-off-by: Andrzej Głąbek --- drivers/mspi/mspi_dw.c | 15 ++++++--------- drivers/mspi/mspi_dw_vendor_specific.h | 5 +++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/mspi/mspi_dw.c b/drivers/mspi/mspi_dw.c index bb91ec984d35..d26a537e8af9 100644 --- a/drivers/mspi/mspi_dw.c +++ b/drivers/mspi/mspi_dw.c @@ -160,9 +160,6 @@ DEFINE_MM_REG_WR(xip_write_wrap_inst, 0x144) DEFINE_MM_REG_WR(xip_write_ctrl, 0x148) #endif -/* Ceiling division by 32 */ -#define CEIL_DIV_32(x) (((x) + 31U) >> 5) - #include "mspi_dw_vendor_specific.h" static int start_next_packet(const struct device *dev); @@ -1277,16 +1274,16 @@ static int start_next_packet(const struct device *dev) #if defined(CONFIG_MSPI_DMA) if (dev_data->xfer.xfer_mode == MSPI_DMA) { /* For DMA mode, set start level based on transfer length to prevent underflow */ - uint32_t transfer_frames = (packet->num_bytes >> dev_data->bytes_per_frame_exp) + - CEIL_DIV_32(dev_data->xfer.addr_length) - + CEIL_DIV_32(dev_data->xfer.cmd_length); + uint32_t total_transfer_bytes = packet->num_bytes + dev_data->xfer.addr_length + + dev_data->xfer.cmd_length; + uint32_t transfer_frames = total_transfer_bytes >> dev_data->bytes_per_frame_exp; - /* Above dma_start_level, the transfer will start. - * Use minimum of transfer length and FIFO depth. - */ + /* Use minimum of transfer length or FIFO depth, but at least 1 */ uint8_t dma_start_level = MIN(transfer_frames - 1, dev_config->tx_fifo_depth_minus_1); + dma_start_level = (dma_start_level > 0 ? dma_start_level : 1); + /* Only TXFTHR needs to be set to the minimum number of frames */ write_txftlr(dev, FIELD_PREP(TXFTLR_TXFTHR_MASK, dma_start_level)); write_dmatdlr(dev, FIELD_PREP(DMATDLR_DMATDL_MASK, dev_config->dma_tx_data_level)); diff --git a/drivers/mspi/mspi_dw_vendor_specific.h b/drivers/mspi/mspi_dw_vendor_specific.h index 2c26cfa1b1ee..d994f579ad8e 100644 --- a/drivers/mspi/mspi_dw_vendor_specific.h +++ b/drivers/mspi/mspi_dw_vendor_specific.h @@ -251,8 +251,9 @@ static inline void vendor_specific_start_dma_xfer(const struct device *dev) transfer_list->rx_job = &joblist[job_idx]; tmod = QSPI_TMOD_TX_ONLY; } else { - preg->CONFIG.RXTRANSFERLENGTH = ((packet->num_bytes) >> - dev_data->bytes_per_frame_exp); + preg->CONFIG.RXTRANSFERLENGTH = ((packet->num_bytes + dev_data->xfer.addr_length + + dev_data->xfer.cmd_length) >> + dev_data->bytes_per_frame_exp) - 1; /* If sending address or command while being configured as controller */ if (job_idx > 0 && config->op_mode == MSPI_OP_MODE_CONTROLLER) { From 7f9ac0e636478503d1f6f161cba1c2d0d5476c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:08 +0200 Subject: [PATCH 2928/3334] Revert "[nrf fromlist] doc: domain: Disable warnings when board catalog not present" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aa7b0fab11bc88edf7ab7c93cf024419a73a52d2. Signed-off-by: Andrzej Głąbek --- doc/_extensions/zephyr/domain/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_extensions/zephyr/domain/__init__.py b/doc/_extensions/zephyr/domain/__init__.py index ce745a75683d..ece106a0c430 100644 --- a/doc/_extensions/zephyr/domain/__init__.py +++ b/doc/_extensions/zephyr/domain/__init__.py @@ -1155,7 +1155,7 @@ class ZephyrDomain(Domain): "code-sample": XRefRole(innernodeclass=nodes.inline, warn_dangling=True), "code-sample-category": XRefRole(innernodeclass=nodes.inline, warn_dangling=True), "board": XRefRole(innernodeclass=nodes.inline, warn_dangling=True), - "board-catalog": XRefRole(innernodeclass=nodes.inline, warn_dangling=False), + "board-catalog": XRefRole(innernodeclass=nodes.inline, warn_dangling=True), } directives = { From 5ef5c54cb1f2fea552e79acba3f3bdee6261ff60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:09 +0200 Subject: [PATCH 2929/3334] Revert "[nrf noup] net: mqtt: add native TLS support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8025e2ec04a513acfae96d0561486b0d278ec53b. Signed-off-by: Andrzej Głąbek --- subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 6a08497ee7ba..fa854c5505f9 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -22,15 +22,10 @@ int mqtt_client_tls_connect(struct mqtt_client *client) { const struct net_sockaddr *broker = client->broker; struct mqtt_sec_config *tls_config = &client->transport.tls.config; - int type = NET_SOCK_STREAM; int ret; - if (!IS_ENABLED(CONFIG_NET_SOCKETS_OFFLOAD_DISPATCHER) && tls_config->set_native_tls) { - type |= SOCK_NATIVE_TLS; - } - client->transport.tls.sock = zsock_socket(broker->sa_family, - type, NET_IPPROTO_TLS_1_2); + NET_SOCK_STREAM, NET_IPPROTO_TLS_1_2); if (client->transport.tls.sock < 0) { return -errno; } From 163b51ff60f1db6fd06c43b43a1f88b90e0d9123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:09 +0200 Subject: [PATCH 2930/3334] Revert "[nrf noup] boards: nordic: nrf7002dk: Fix include files" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 529a26dc1884a96a687035f781007b0fab333af2. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 2 +- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts index ac863872d55d..5ff28accf3fc 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "nrf5340_cpuapp_common.dtsi" / { diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 8225e992bb82..9c06a17ad7bf 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "nrf5340_cpuapp_common.dtsi" #include "nordic/nrf5340_sram_partition.dtsi" #include "nordic/nrf5340_cpuapp_ns_partition.dtsi" From 390f3ccbfb207187b1c13a28eb2915276c88465a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:09 +0200 Subject: [PATCH 2931/3334] Revert "[nrf fromlist] samples: drivers: crypto: fix failing test on qemu_cortex_m3/ti_lm3s6965" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bdb7f070b09962ededeb0377aa95b6cdc19e3be7. Signed-off-by: Andrzej Głąbek --- samples/drivers/crypto/prj_mtls_shim.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/drivers/crypto/prj_mtls_shim.conf b/samples/drivers/crypto/prj_mtls_shim.conf index a8a088c88be9..5954fe5f9f3c 100644 --- a/samples/drivers/crypto/prj_mtls_shim.conf +++ b/samples/drivers/crypto/prj_mtls_shim.conf @@ -1,5 +1,5 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_BUILTIN=y -CONFIG_MBEDTLS_HEAP_SIZE=2048 +CONFIG_MBEDTLS_HEAP_SIZE=1024 CONFIG_CRYPTO_MBEDTLS_SHIM=y From cd91db18dc85b6fe7217315b35e51aa656128911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:10 +0200 Subject: [PATCH 2932/3334] Revert "[nrf noup] soc: nordic: common: Fix updated SoC series Kconfig" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aeccbe456ff7cd83e54841681a3a31d6c2b1feb9. Signed-off-by: Andrzej Głąbek --- soc/nordic/common/Kconfig.peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index a19634b16864..8706c650e0d1 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -14,7 +14,7 @@ config HAS_HW_NRF_BPROT config HAS_HW_NRF_CC310 def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) || \ - ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91) + ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91X) config HAS_HW_NRF_CC312 def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \ From d710396fb92b65f213fa018936eb03b060e6de06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:10 +0200 Subject: [PATCH 2933/3334] Revert "[nrf noup] sysbuild: Disable slot1 variant when PM is used" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9a111ef8fb1a615996e69833bbd9468a150bd28a. Signed-off-by: Andrzej Głąbek --- share/sysbuild/images/bootloader/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/share/sysbuild/images/bootloader/Kconfig b/share/sysbuild/images/bootloader/Kconfig index 01849e54210e..40790490cda6 100644 --- a/share/sysbuild/images/bootloader/Kconfig +++ b/share/sysbuild/images/bootloader/Kconfig @@ -153,7 +153,6 @@ endchoice config MCUBOOT_DIRECT_XIP_GENERATE_VARIANT bool "Generate slot 1 variant image [EXPERIMENTAL]" depends on MCUBOOT_MODE_DIRECT_XIP || MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT - depends on !PARTITION_MANAGER select EXPERIMENTAL default y help From df3f7047fd2d85a8eaa902b8e0f99f0269681b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:10 +0200 Subject: [PATCH 2934/3334] Revert "[nrf noup] samples: sysbuild: Update SOC_SERIES_NRF*X Kconfig to remove X" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4d28ae74aaada42e84c63fa53e4ab12094a007cb. Signed-off-by: Andrzej Głąbek --- samples/sysbuild/hello_world/sysbuild.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index b86a7659fdd6..654c4175faac 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -9,12 +9,12 @@ if(DEFINED SB_CONFIG_REMOTE_BOARD) BOARD_REVISION ${BOARD_REVISION} ) - if(SB_CONFIG_SOC_SERIES_NRF53) + if(SB_CONFIG_SOC_SERIES_NRF53X) set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") - else(SB_CONFIG_SOC_SERIES_NRF54L) + else(SB_CONFIG_SOC_SERIES_NRF54LX) set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) From e6727d914cef287330015eb4e4aa2cd44b460af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:11 +0200 Subject: [PATCH 2935/3334] Revert "[nrf noup] modules: hal_nordic: Update SOC_SERIES_NRF*X Kconfig to remove X" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8f08a9a21c56b8ff3e7b6c1bfdbabb370c90392d. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h index 26e8ea67cbea..2c1fe3640493 100644 --- a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h +++ b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h @@ -13,12 +13,12 @@ #define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK #elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) #define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) #define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK #define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK #define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54H) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) #define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK #define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK #define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ @@ -34,12 +34,12 @@ #define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK #elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) #define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) #define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK #define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK #define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54H) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) #define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK #else #error Unsupported chip family From df609e4224e9b3366ccfa7b416cbaa662ba22731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:11 +0200 Subject: [PATCH 2936/3334] Revert "[nrf fromlist] tests: crypto: mbedtls_psa: remove MD5 test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2eb8603cc6f617f3b49407be935470138f6f3d4e. Signed-off-by: Andrzej Głąbek --- tests/crypto/mbedtls_psa/prj.conf | 1 + tests/crypto/mbedtls_psa/src/main.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/tests/crypto/mbedtls_psa/prj.conf b/tests/crypto/mbedtls_psa/prj.conf index fcc619fbcf74..9b66a86493f6 100644 --- a/tests/crypto/mbedtls_psa/prj.conf +++ b/tests/crypto/mbedtls_psa/prj.conf @@ -5,6 +5,7 @@ CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y +CONFIG_PSA_WANT_ALG_MD5=y CONFIG_PSA_WANT_ALG_SHA_1=y CONFIG_PSA_WANT_ALG_SHA_224=y CONFIG_PSA_WANT_ALG_SHA_256=y diff --git a/tests/crypto/mbedtls_psa/src/main.c b/tests/crypto/mbedtls_psa/src/main.c index 74da439b0a5d..449db10e17d0 100644 --- a/tests/crypto/mbedtls_psa/src/main.c +++ b/tests/crypto/mbedtls_psa/src/main.c @@ -22,6 +22,23 @@ ZTEST_USER(test_mbedtls_psa, test_generate_random) zassert_equal(status, PSA_SUCCESS); } +ZTEST_USER(test_mbedtls_psa, test_md5) +{ + uint8_t in_buf[] = { 'a' }; + uint8_t out_buf[PSA_HASH_LENGTH(PSA_ALG_MD5)] = { 0 }; + uint8_t out_buf_ref[PSA_HASH_LENGTH(PSA_ALG_MD5)] = { + 0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8, + 0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 + }; + size_t out_len; + psa_status_t status; + + status = psa_hash_compute(PSA_ALG_MD5, in_buf, sizeof(in_buf), + out_buf, sizeof(out_buf), &out_len); + zassert_equal(status, PSA_SUCCESS); + zassert_mem_equal(out_buf, out_buf_ref, sizeof(out_buf_ref)); +} + ZTEST_USER(test_mbedtls_psa, test_sha1) { uint8_t in_buf[] = { 'a' }; From f299e9fb08fd2f2a38b9cefa77c7c1488c214f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:12 +0200 Subject: [PATCH 2937/3334] Revert "[nrf fromlist] tests: crypto: mbedtls_psa: use static key slots" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e03f98f4a28abe14377f729a40b1c1350d162f24. Signed-off-by: Andrzej Głąbek --- tests/crypto/mbedtls_psa/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/crypto/mbedtls_psa/prj.conf b/tests/crypto/mbedtls_psa/prj.conf index 9b66a86493f6..233742c1d30f 100644 --- a/tests/crypto/mbedtls_psa/prj.conf +++ b/tests/crypto/mbedtls_psa/prj.conf @@ -3,7 +3,6 @@ CONFIG_ZTEST=y CONFIG_MBEDTLS=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y CONFIG_PSA_WANT_ALG_MD5=y CONFIG_PSA_WANT_ALG_SHA_1=y From 0f9efc58bed1099ee6404b9372434175d8df282e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:12 +0200 Subject: [PATCH 2938/3334] Revert "[nrf fromlist] modules: mbedtls: remove extra spaces in config-mbedtls.h" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc70fe434fd4e2ee9ad0cdb0b990f97651856ec8. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/configs/config-mbedtls.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mbedtls/configs/config-mbedtls.h b/modules/mbedtls/configs/config-mbedtls.h index d241031ddfb7..d574071885fe 100644 --- a/modules/mbedtls/configs/config-mbedtls.h +++ b/modules/mbedtls/configs/config-mbedtls.h @@ -462,8 +462,8 @@ #define MBEDTLS_PKCS5_C #endif -#define MBEDTLS_SSL_IN_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN -#define MBEDTLS_SSL_OUT_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN +#define MBEDTLS_SSL_IN_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN +#define MBEDTLS_SSL_OUT_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN /* Enable OpenThread optimizations. */ #if defined(CONFIG_MBEDTLS_OPENTHREAD_OPTIMIZATIONS_ENABLED) @@ -525,7 +525,7 @@ #if defined(CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT) #define MBEDTLS_PSA_CRYPTO_CLIENT #define MBEDTLS_PSA_CRYPTO_CONFIG -#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "config-psa.h" +#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "config-psa.h" #endif #if defined(CONFIG_MBEDTLS_SSL_PROTO_TLS1_2) && defined(CONFIG_MBEDTLS_PSA_CRYPTO_C) From 35dec10c01fb9fe1253b30c8860f82cdc43c10aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:12 +0200 Subject: [PATCH 2939/3334] Revert "[nrf fromlist] dts: bindings: clock: fix reference audio frequencies" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 98fa3d82d5f21b5d4e4f179e85ed7ef8687d7513. Signed-off-by: Andrzej Głąbek --- include/zephyr/dt-bindings/clock/nrfs-audiopll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/dt-bindings/clock/nrfs-audiopll.h b/include/zephyr/dt-bindings/clock/nrfs-audiopll.h index a79a4061f266..b4c3975b5e15 100644 --- a/include/zephyr/dt-bindings/clock/nrfs-audiopll.h +++ b/include/zephyr/dt-bindings/clock/nrfs-audiopll.h @@ -8,8 +8,8 @@ #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRFS_AUDIOPLL_H_ #define NRFS_AUDIOPLL_FREQ_MIN 10666707 -#define NRFS_AUDIOPLL_FREQ_AUDIO_44K1 11289600 -#define NRFS_AUDIOPLL_FREQ_AUDIO_48K 12288000 +#define NRFS_AUDIOPLL_FREQ_AUDIO_44K1 11289591 +#define NRFS_AUDIOPLL_FREQ_AUDIO_48K 12287963 #define NRFS_AUDIOPLL_FREQ_MAX 13333292 #endif /* #define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_NRFS_AUDIOPLL_H_ */ From 4569ba134eb8c80839d4c0faaef96fcd5cdd3409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:13 +0200 Subject: [PATCH 2940/3334] Revert "[nrf fromlist] net: posix: Avoid multiple definitions of IFNAMSIZ symbol" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d373b7dfa2ff013793bd37837616108a29c40250. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/net_compat.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/zephyr/net/net_compat.h b/include/zephyr/net/net_compat.h index 927c8d5087e9..c044d86cfa87 100644 --- a/include/zephyr/net/net_compat.h +++ b/include/zephyr/net/net_compat.h @@ -140,9 +140,7 @@ extern "C" { #define IN6ADDR_ANY_INIT NET_IN6ADDR_ANY_INIT #define IN6ADDR_LOOPBACK_INIT NET_IN6ADDR_LOOPBACK_INIT -#if !defined(IFNAMSIZ) #define IFNAMSIZ NET_IFNAMSIZ -#endif /* IFNAMSIZ */ #define in_pktinfo net_in_pktinfo #define ip_mreqn net_ip_mreqn From c49b86843d96b65d18bdea0d141a5dc4a2913493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:13 +0200 Subject: [PATCH 2941/3334] Revert "[nrf fromlist] tests/subsys/dfu/img_util: DTS overlay for nRF52840dk" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d340a91cc52ec4e74b2384bfcf6e25d3b3104863. Signed-off-by: Andrzej Głąbek --- .../boards/nrf52840dk_nrf52840.overlay | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 tests/subsys/dfu/img_util/boards/nrf52840dk_nrf52840.overlay diff --git a/tests/subsys/dfu/img_util/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/dfu/img_util/boards/nrf52840dk_nrf52840.overlay deleted file mode 100644 index d3fca8743776..000000000000 --- a/tests/subsys/dfu/img_util/boards/nrf52840dk_nrf52840.overlay +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2026 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/delete-node/ &boot_partition; -/delete-node/ &slot0_partition; -/delete-node/ &slot1_partition; - -&flash0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 0x10000>; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x00010000 0x74000>; - }; - - slot1_partition: partition@84000 { - label = "image-1"; - reg = <0x00084000 0x74000>; - }; - }; -}; From 17586f5e378b8d00155040784cb4db75191e2548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:14 +0200 Subject: [PATCH 2942/3334] Revert "[nrf noup] tests: benchmark: mbedtls: remove ARIA/Camellia ciphers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7695db46f30eb72c64feb7fd21a5a7565538b301. Signed-off-by: Andrzej Głąbek --- tests/benchmarks/mbedtls/prj.conf | 2 ++ tests/benchmarks/mbedtls/src/benchmark.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tests/benchmarks/mbedtls/prj.conf b/tests/benchmarks/mbedtls/prj.conf index 944544eed5a3..ba24d6663924 100644 --- a/tests/benchmarks/mbedtls/prj.conf +++ b/tests/benchmarks/mbedtls/prj.conf @@ -11,6 +11,8 @@ CONFIG_PSA_WANT_ALG_SHA_384=y CONFIG_PSA_WANT_ALG_SHA_512=y CONFIG_PSA_WANT_KEY_TYPE_AES=y +CONFIG_PSA_WANT_KEY_TYPE_ARIA=y +CONFIG_PSA_WANT_KEY_TYPE_CAMELLIA=y CONFIG_PSA_WANT_ALG_ECB_NO_PADDING=y CONFIG_MAIN_STACK_SIZE=4096 diff --git a/tests/benchmarks/mbedtls/src/benchmark.c b/tests/benchmarks/mbedtls/src/benchmark.c index 02e9ec2171c2..890652d14a4e 100644 --- a/tests/benchmarks/mbedtls/src/benchmark.c +++ b/tests/benchmarks/mbedtls/src/benchmark.c @@ -112,6 +112,30 @@ int main(void) printk("Failed to import AES key (%d)", status); } + status = make_cipher_key(PSA_KEY_TYPE_ARIA, PSA_ALG_ECB_NO_PADDING, &key_id); + if (status == PSA_SUCCESS) { + COMPUTE_THROUGHPUT("ARIA-256-ECB", + psa_cipher_encrypt(key_id, PSA_ALG_ECB_NO_PADDING, + in_buf, sizeof(in_buf), + out_buf, sizeof(out_buf), &out_len) + ); + psa_destroy_key(key_id); + } else { + printk("Failed to import ARIA key (%d)", status); + } + + status = make_cipher_key(PSA_KEY_TYPE_CAMELLIA, PSA_ALG_ECB_NO_PADDING, &key_id); + if (status == PSA_SUCCESS) { + COMPUTE_THROUGHPUT("CAMELLIA-256-ECB", + psa_cipher_encrypt(key_id, PSA_ALG_ECB_NO_PADDING, + in_buf, sizeof(in_buf), + out_buf, sizeof(out_buf), &out_len) + ); + psa_destroy_key(key_id); + } else { + printk("Failed to import Camellia key (%d)", status); + } + printk("Benchmark completed\n"); return 0; } From 9bf767d72e0f0d80489c7b00ea8a4ea4fcc90003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:14 +0200 Subject: [PATCH 2943/3334] Revert "[nrf fromlist] lib: posix: add missing getopt_long guard" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6dc1641e50fd4109ca79877baadf0de3e89d17e5. Signed-off-by: Andrzej Głąbek --- lib/posix/c_lib_ext/getopt_shim.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/posix/c_lib_ext/getopt_shim.c b/lib/posix/c_lib_ext/getopt_shim.c index 251029b51cf2..1187c53440ab 100644 --- a/lib/posix/c_lib_ext/getopt_shim.c +++ b/lib/posix/c_lib_ext/getopt_shim.c @@ -34,7 +34,6 @@ void z_getopt_global_state_update_shim(struct sys_getopt_state *state) optarg = state->optarg; } -#if CONFIG_GETOPT_LONG int getopt_long(int argc, char *const argv[], const char *shortopts, const struct option *longopts, int *longind) { @@ -46,4 +45,3 @@ int getopt_long_only(int argc, char *const argv[], const char *shortopts, { return sys_getopt_long_only(argc, argv, shortopts, longopts, longind); } -#endif From 34004a0641bd4ec4004dc3fcc848703acedf7835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:15 +0200 Subject: [PATCH 2944/3334] Revert "[nrf noup] test-spec: Reduce thingy91 scope" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 625f5ace806127b0c0674174b6dc945064ef17d5. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index fc74207ebd5f..ecf8102649dc 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -149,9 +149,14 @@ - "drivers/net/**/*" - "drivers/serial/**/*" - "drivers/timer/**/*" + - "include/**/*" + - "kernel/**/*" - "lib/libc/common/source/stdlib/**/*" - "lib/libc/newlib/**/*" - "lib/libc/picolibc/**/*" + - "lib/os/**/*" + - "lib/posix/**/*" + - "misc/**/*" - "modules/mbedtls/**/*" - "soc/x86/ia32/**/*" - "subsys/fs/fcb/**/*" From 99b4ec0a2e99c4d8c2f043e911a6f0d749c3a429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:15 +0200 Subject: [PATCH 2945/3334] Revert "[nrf noup] test-spec: update CI-ble-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1ec4eaf22f2c3b21a9dc21f066d8e12ac5bfe0af. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index ecf8102649dc..d91e0f0bd3a2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -108,8 +108,6 @@ - "boards/nordic/nrf5*" - any: - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf9*" - any: - "subsys/pm/**/*" From 45d4196f2f41b04e32937cdcea6e07000aeb8e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:15 +0200 Subject: [PATCH 2946/3334] Revert "[nrf noup] test-spec: update CI-fem-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7ed22d94fee4cd8c02c9a80697488c4bc0548130. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index d91e0f0bd3a2..aac297f11412 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -204,11 +204,7 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 9af1e123941c1d4d31439aa09fd388f5f32a076c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:15 +0200 Subject: [PATCH 2947/3334] Revert "[nrf noup] test-spec: update CI-matter-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit de24a82dab8f31b68d1405a9524d8f1325a61ca0. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index aac297f11412..df4166d8e6b0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -283,12 +283,7 @@ "CI-matter-test": - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf52*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/dfu/**/*" - "subsys/settings/**/*" - "subsys/net/**/*" From edd182e8cf85b9575612a1e8f2ffa82df8c513c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:16 +0200 Subject: [PATCH 2948/3334] Revert "[nrf noup] test-spec: update CI-thread-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 28c3c0e4507b7cd7f9f38ad7e69eb8f182d6c1e2. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index df4166d8e6b0..79064e3febd0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -248,11 +248,7 @@ - "modules/mbedtls/**/*" - "modules/openthread/**/*" - "samples/net/openthread/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" From 2363cae983bc624615c23a0e5bc1f79398ac8866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:16 +0200 Subject: [PATCH 2949/3334] Revert "[nrf noup] test-spec: update CI-rs-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f3f1f1664f30a33bf176e35bba0f91f5d5f5d5ce. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 79064e3febd0..7588b157337a 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -231,11 +231,7 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 86652097144c3deb8d6f370d17125f5684a86e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:16 +0200 Subject: [PATCH 2950/3334] Revert "[nrf noup] test-spec: update CI-ble-samples-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 001f6d37d5cb33fa9cd29b0c0da521ec36e954f1. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 7588b157337a..af7db8adce71 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -115,9 +115,7 @@ - any: - "drivers/bluetooth/**/*" - any: - - "dts/arm/nordic/nrf52*" - - "dts/arm/nordic/nrf53*" - - "dts/arm/nordic/nrf54*" + - "dts/arm/nordic/nrf5*" - any: - "subsys/bluetooth/**/*" - "!subsys/bluetooth/mesh/**/*" @@ -125,6 +123,7 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/**/*" "CI-mesh-test": - "subsys/bluetooth/mesh/**/*" From fec77120f5511fc3d30c9feccfb60cf9a79a0fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:17 +0200 Subject: [PATCH 2951/3334] Revert "[nrf noup] test-spec: update CI-dfu-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ddf21391242f21c6faeabd00ed9e2b10cfc35301. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index af7db8adce71..1c45698e423d 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -54,8 +54,7 @@ - "tests/subsys/mgmt/mcumgr/**/*" "CI-dfu-test": - - "boards/nordic/nrf54h20dk*" - - "boards/nordic/nrf54l*" + - "boards/nordic/**/*" - "drivers/bluetooth/**/*" - "drivers/console/**/*" - "drivers/flash/**/*" From 0099e7dd78d8ecf3d137c23df4a313e8325c5052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:17 +0200 Subject: [PATCH 2952/3334] Revert "[nrf noup] test-spec: update CI-boot-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 01db4e609927e92b4a77c2396d286a41cfbd9838. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 1c45698e423d..27e81cd357e7 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,11 +39,7 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": - - "boards/nordic/nrf52840dk*" - - "boards/nordic/nrf5340dk*" - - "boards/nordic/nrf54h20dk*" - - "boards/nordic/nrf54l*" - - "boards/nordic/nrf9160dk*" + - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" From c00afdbd4483aad8c733ea4287315f8e9eb4df59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:17 +0200 Subject: [PATCH 2953/3334] Revert "[nrf noup] test-spec: update CI-fem-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 16b0fe1edb2fb7f05bd7c881a3945edc575c2e9c. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 27e81cd357e7..554b15bc2476 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -180,11 +180,7 @@ - "modules/mbedtls/**/*" "CI-fem-test": - - "boards/nordic/nrf21540dk*" - - "boards/nordic/nrf52833dk*" - - "boards/nordic/nrf52840dk*" - - "boards/nordic/nrf5340dk*" - - "boards/nordic/nrf54l*" + - "boards/nordic/**/*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From 57219811565dc1d622770d3a835c9aef5ab07437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:18 +0200 Subject: [PATCH 2954/3334] Revert "[nrf noup] test-spec: update CI-rs-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3eb6d829f7c066b7f5a2a1b0a2e4d07b1d7014e5. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 554b15bc2476..09d7b372bfca 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -203,11 +203,7 @@ - "CMakeLists.txt" "CI-rs-test": - - "boards/nordic/nrf21540dk*" - - "boards/nordic/nrf52833dk*" - - "boards/nordic/nrf52840dk*" - - "boards/nordic/nrf5340dk*" - - "boards/nordic/nrf54l*" + - "boards/nordic/**/*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From 60739e9dc842e593649603801c096b029196854d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:18 +0200 Subject: [PATCH 2955/3334] Revert "[nrf noup] test-spec: update CI-nfc-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f590e77e111b0e4e01decb33527e1a226a890501. Signed-off-by: Andrzej Głąbek --- .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 09d7b372bfca..00a75b24d829 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -242,10 +242,7 @@ - "drivers/spi/**/*" - "lib/crc/**/*" - "modules/hal_nordic/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/ipc/ipc_service/**/*" - "subsys/fs/**/*" - "subsys/mem_mgmt/**/*" From ec426293b4ea7414c8f2cc7527c755fedd438818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:19 +0200 Subject: [PATCH 2956/3334] Revert "[nrf noup] test-spec: update CI-cloud-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0b57fe968cecd3a1f66f1fa01d0bf534e6d15755. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 00a75b24d829..db9cac90e17f 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -332,7 +332,7 @@ - "drivers/serial/**/*" - "drivers/wifi/**/*" - "lib/posix/**/*" - - "soc/nordic/nrf9*/*" + - "soc/nordic/**/*" - "subsys/dfu/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" From 719cf05bab68c1d4d74bd060bf4efe1796a9e30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:19 +0200 Subject: [PATCH 2957/3334] Revert "[nrf noup] ci: Use NordicBuilder to open backport PRs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1075a7ab701cf1dff1fbfe4307e8e289277cd3d5. Signed-off-by: Andrzej Głąbek --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 402341a9c389..3ecf66b17da9 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -33,6 +33,6 @@ jobs: - name: Backport uses: zephyrproject-rtos/action-backport@7e74f601d11eaca577742445e87775b5651a965f # v2.0.3-3 with: - github_token: ${{ secrets.NCS_GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} issue_labels: Backport labels_template: '["Backport"]' From 429a8367a87a64a3e3f3ec1c79d1438d7f4cb801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:19 +0200 Subject: [PATCH 2958/3334] Revert "[nrf noup] ci: Dynamically set target branch for manifest PRs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f481af0553fcd55e0e7b129e7ec4ed96f6959a17. Signed-off-by: Andrzej Głąbek --- .github/workflows/manifest-PR.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 6e2430ec901e..0f3bd738a36c 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -4,7 +4,6 @@ on: types: [opened, synchronize, closed, reopened] branches: - main - - ncs-v*-branch permissions: contents: read @@ -12,28 +11,9 @@ permissions: jobs: call-manifest-pr-action: runs-on: ubuntu-latest - outputs: - base-branch: ${{ steps.set-base-branch.outputs.base_branch }} steps: - # Determine the base branch: - # * sdk-zephyr/main -> sdk-nrf/main - # * sdk-zephyr/ncs-vX.Y-branch -> sdk-nrf/vX.Y-branch - - name: Set base branch - id: set-base-branch - run: | - if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then - echo "base_branch=main" >> "$GITHUB_OUTPUT" - elif [[ "${{ github.event.pull_request.base.ref }}" =~ ^ncs-(v[0-9]+\.[0-9]+-branch)$ ]]; then - branch_name="${{ github.event.pull_request.base.ref }}" - branch_name="${branch_name#ncs-}" - echo "base_branch=${branch_name}" >> "$GITHUB_OUTPUT" - else - echo "Error: Unsupported base branch: ${{ github.event.pull_request.base.ref }}" >&2 - exit 1 - fi - name: handle manifest PR uses: nrfconnect/action-manifest-pr@main with: token: ${{ secrets.NCS_GITHUB_TOKEN }} manifest-pr-title-details: ${{ github.event.pull_request.title }} - base-branch: ${{ steps.set-base-branch.outputs.base_branch }} From 18727113d89223282b366833c6e885ff7346e635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:19 +0200 Subject: [PATCH 2959/3334] Revert "[nrf noup] test-spec: update CI-find-my-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 01485da73ae12e94edd4f472cac3798dc832a4db. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index db9cac90e17f..483f135b03e2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -271,19 +271,13 @@ - "!subsys/bluetooth/audio/**/*" "CI-find-my-test": - - "boards/nordic/nrf52840dk/**/*" - - "boards/nordic/nrf5340dk/**/*" - - "boards/nordic/nrf54l15dk/**/*" + - "boards/nordic/**/*" - "drivers/bluetooth/**/*" - "drivers/entropy/**/*" - "drivers/flash/**/*" - "drivers/usb/**/*" - "drivers/regulator/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf54h*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/dfu/**/*" - "subsys/fs/**/*" - "subsys/ipc/**/*" From 69dd0ec9e68788d53ff6fe5e5f92c1c3ab442f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:20 +0200 Subject: [PATCH 2960/3334] Revert "[nrf noup] test-spec: update CI-audio-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 652f1554c75ac14de8a81092b6e5b118fd04a41e. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 483f135b03e2..14519ac3a149 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -345,12 +345,7 @@ - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - "samples/bluetooth/hci_ipc/**/*" - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf52*" - - "!soc/nordic/nrf54*" - - "!soc/nordic/nrf9*" + - "soc/nordic/**/*" - "subsys/bluetooth/audio/**/*" - "subsys/bluetooth/host/**/*" - "subsys/dfu/**/*" From 98dc2cd2fc29be19aba5607ebd1c5265af07aa77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:20 +0200 Subject: [PATCH 2961/3334] Revert "[nrf noup] test-spec: update CI-test-low-level" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e3a52be45cf5b225379e26bc30ac24ae449e8edb. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 92 +++++++++++++------------------------------ 1 file changed, 28 insertions(+), 64 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 14519ac3a149..5fdf9c0ca782 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -367,71 +367,35 @@ - "drivers/sensor/sensor_shell.c" "CI-test-low-level": - - any: - - "soc/nordic/**/*" - - "!soc/nordic/nrf51*" - - "!soc/nordic/nrf52*" - - "!soc/nordic/nrf53*" - - "!soc/nordic/nrf9*" - - "arch/arm/**/*" - - "arch/riscv/**/*" + - "arch/**/*" - "boards/nordic/nrf54*/**/*" - - "drivers/adc/**/*" - - "drivers/cache/**/*" - - "drivers/clock_control/**/*" - - "drivers/comparator/**/*" - - "drivers/counter/**/*" - - "drivers/flash/**/*" - - "drivers/gpio/**/*" - - "drivers/hwinfo/**/*" - - "drivers/i2c/**/*" - - "drivers/i2s/**/*" - - "drivers/interrupt_controller/**/*" - - "drivers/mbox/**/*" - - "drivers/mspi/**/*" - - "drivers/pinctrl/**/*" - - "drivers/power_domain/**/*" - - "drivers/pwm/**/*" - - "drivers/retained_mem/**/*" - - "drivers/rtc/**/*" - - "drivers/serial/**/*" - - "drivers/spi/**/*" - - "drivers/timer/**/*" - - "drivers/usb/**/*" - - "drivers/watchdog/**/*" - - any: - - "dts/vendor/nordic/**/*" - - "!dts/vendor/nordic/nrf52*" - - "!dts/vendor/nordic/nrf53*" - - "!dts/vendor/nordic/nrf9*" + - "drivers/**/*" + - "dts/**/*" + - "include/zephyr/**/*" + - "kernel/**/*" - "modules/hal_nordic/**/*" + - "samples/basic/blinky_pwm/**/*" + - "samples/basic/fade_led/**/*" + - "samples/boards/nrf/**/*" - "samples/boards/nordic/**/*" - - "tests/arch/arm/**/*" + - "samples/drivers/adc/**/*" + - "samples/drivers/jesd216/**/*" + - "samples/drivers/mbox/**/*" + - "samples/drivers/soc_flash_nrf/**/*" + - "samples/drivers/spi_flash/**/*" + - "samples/drivers/watchdog/**/*" + - "samples/hello_world/**/*" + - "samples/sensor/**/*" + - "samples/subsys/ipc/**/*" + - "samples/subsys/logging/**/*" + - "samples/subsys/settings/**/*" + - "samples/subsys/usb/cdc_acm/**/*" + - "samples/subsys/usb/mass/**/*" + - "samples/synchronization/**/*" + - "subsys/logging/**/*" + - "subsys/settings/**/*" + - "tests/arch/**/*" - "tests/boards/nrf/**/*" - - "tests/drivers/adc/**/*" - - "tests/drivers/clock_control/**/*" - - "tests/drivers/comparator/**/*" - - "tests/drivers/counter/**/*" - - "tests/drivers/flash/**/*" - - "tests/drivers/gpio/**/*" - - "tests/drivers/hwinfo/**/*" - - "tests/drivers/i2c/**/*" - - "tests/drivers/i2s/**/*" - - "tests/drivers/interrupt_controller/**/*" - - "tests/drivers/mbox/**/*" - - "tests/drivers/mspi/**/*" - - "tests/drivers/pinctrl/**/*" - - "tests/drivers/pwm/**/*" - - "tests/drivers/retained_mem/**/*" - - "tests/drivers/rtc/**/*" - - "tests/drivers/spi/**/*" - - "tests/drivers/timer/**/*" - - "tests/drivers/uart/**/*" - - "tests/drivers/watchdog/**/*" - - "tests/kernel/common/**/*" - - "tests/kernel/context/**/*" - - "tests/kernel/fatal/**/*" - - "tests/kernel/fpu_sharing/**/*" - - "tests/kernel/gen_isr_table/**/*" - - "tests/kernel/interrupt/**/*" - - "tests/kernel/sched/preempt/**/*" + - "tests/boards/nordic/**/*" + - "tests/drivers/**/*" + - "tests/kernel/**/*" From 71a7268a449428bc7ad432426a0c04a667677a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:20 +0200 Subject: [PATCH 2962/3334] Revert "[nrf noup] soc: nordic: Support TF-M for poweroff" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1ccd687ded0cc174e6329fbaf5dda7af5f489a2c. Signed-off-by: Andrzej Głąbek --- soc/nordic/common/poweroff.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/soc/nordic/common/poweroff.c b/soc/nordic/common/poweroff.c index e75636b737bb..eae8341c3e69 100644 --- a/soc/nordic/common/poweroff.c +++ b/soc/nordic/common/poweroff.c @@ -7,9 +7,7 @@ #include #include -#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) -#include "tfm_platform_api.h" -#elif defined(CONFIG_SOC_SERIES_NRF51) || defined(CONFIG_SOC_SERIES_NRF52) +#if defined(CONFIG_SOC_SERIES_NRF51) || defined(CONFIG_SOC_SERIES_NRF52) #include #elif defined(CONFIG_SOC_SERIES_NRF54H) #include @@ -32,10 +30,6 @@ void z_sys_poweroff(void) { -#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) - tfm_platform_system_off(); -#else - #if defined(CONFIG_HAS_NORDIC_RAM_CTRL) uint8_t *ram_start; size_t ram_size; @@ -84,7 +78,5 @@ void z_sys_poweroff(void) nrf_regulators_system_off(NRF_REGULATORS); #endif -#endif /* CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE */ - CODE_UNREACHABLE; } From 04bb466c1000994ff7cd0a60bfc08550b1af0344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:21 +0200 Subject: [PATCH 2963/3334] Revert "[nrf noup] include: net: add TLS_DTLS_FRAG_EXT to NCS extensions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b3e6816fa807b57dca1ffa0c95bd9076c5ffb37a. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/socket_ncs.h | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h index 7c8bae645f6c..6a77d6c41f13 100644 --- a/include/zephyr/net/socket_ncs.h +++ b/include/zephyr/net/socket_ncs.h @@ -69,27 +69,6 @@ extern "C" { #define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 #define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 -/** Socket option to enable the DTLS fragmentation extension. - * Accepted values for the option are: @ref DTLS_FRAG_EXT_DISABLED, - * @ref DTLS_FRAG_EXT_512_ENABLED, @ref DTLS_FRAG_EXT_1024_ENABLED. - */ -#define TLS_DTLS_FRAG_EXT (NET_SOCKET_NCS_BASE + 22) - -/** Disabled - The DTLS fragmentation extension is not included in the Client Hello. */ -#define DTLS_FRAG_EXT_DISABLED 0 -/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment - * size of 512 bytes. - * - * @note The user data size in send requests also becomes limited to a maximum of 512 bytes. - */ -#define DTLS_FRAG_EXT_512_ENABLED 1 -/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment - * size of 1024 bytes. - * - * @note The user data size in send requests also becomes limited to a maximum of 1024 bytes. - */ -#define DTLS_FRAG_EXT_1024_ENABLED 2 - /* NCS specific socket options */ /** sockopt: enable sending data as part of exceptional events */ From 3eb47b20defc1192d5da3f577b058e02d39b85e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:21 +0200 Subject: [PATCH 2964/3334] Revert "[nrf noup] dts: nordic: remove leftover file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit db78578bfdd2da618d9de8ca82a56c775725adf9. Signed-off-by: Andrzej Głąbek --- dts/vendor/nordic/nrf54l20.dtsi | 852 ++++++++++++++++++++++++++++++++ 1 file changed, 852 insertions(+) create mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi new file mode 100644 index 000000000000..bee70effa0e8 --- /dev/null +++ b/dts/vendor/nordic/nrf54l20.dtsi @@ -0,0 +1,852 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr"; + reg = <1>; + device_type = "cpu"; + riscv,isa = "rv32emc"; + nordic,bus-width = <64>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + pclk32m: pclk32m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + aclk: aclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; + + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(447)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 0x6fc00>; + }; + + cpuflpr_sram: memory@2006fc00 { + compatible = "mmio-sram"; + reg = <0x2006fc00 DT_SIZE_K(64)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2006fc00 0x10000>; + }; + + global_peripherals: peripheral@50000000 { + ranges = <0x0 0x50000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x143c>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + spi00: spi@4d000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart00: uart@4d000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + pdm20: pdm@d0000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd0000 0x1000>; + interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pdm21: pdm@d1000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd1000 0x1000>; + interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pwm20: pwm@d2000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd2000 0x1000>; + interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm21: pwm@d3000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd3000 0x1000>; + interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm22: pwm@d4000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd4000 0x1000>; + interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <16>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + tdm: tdm@e8000 { + compatible = "nordic,nrf-tdm"; + easydma-maxcnt-bits = <15>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xe8000 0x1000>; + interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + clocks = <&pclk32m>; + }; + + i2c23: i2c@ed000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi23: spi@ed000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart23: uart@ed000 { + compatible = "nordic,nrf-uarte"; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c24: i2c@ee000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi24: spi@ee000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart24: uart@ee000 { + compatible = "nordic,nrf-uarte"; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <5>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@51c { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x51c 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@520 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x520 0x1>; + status = "disabled"; + }; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1972)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + + cpuflpr_rram: rram@1ed000 { + compatible = "soc-nv-flash"; + reg = <0x1ed000 DT_SIZE_K(64)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; From cf38a75cd15917575770070eb55499646392cad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:21 +0200 Subject: [PATCH 2965/3334] Revert "[nrf noup] modules: hal_nordic: cleanup nrfx_config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 81578337195c95dad6eccc88599f07e2e8bcc2bd. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ++++++++++++++++++ .../nrfx/nrfx_reserved_resources_ncs.h | 217 ---- 3 files changed, 949 insertions(+), 218 deletions(-) create mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h delete mode 100644 modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 06bce944b449..98dacdcfede4 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -386,6 +386,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_reserved_resources_ncs.h" + default "nrfx_config_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h new file mode 100644 index 000000000000..ec8a9acaf7b5 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h @@ -0,0 +1,948 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ +#define NRFX_CONFIG_RESERVED_RESOURCES_H__ + +/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE130_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) + +/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE131_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) + +/** @brief Bitmask that defines EGU instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_EGUS_USED 0 + +/** @brief Bitmask that defines TIMER instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_TIMERS_USED 0 + +/* If the GRTC system timer driver is to be used, prepare definitions required + * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and + * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. + */ +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) +#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ + (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ + ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) +#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ + (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ + DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ + +/* + * The enabled Bluetooth controller subsystem is responsible for providing + * definitions of the BT_CTLR_USED_* symbols used below in a file named + * bt_ctlr_used_resources.h and for adding its location to global include + * paths so that the file can be included here for all Zephyr libraries that + * are to be built. + */ +#if defined(CONFIG_BT_LL_SW_SPLIT) +#include +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#endif +#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +/* Define auxiliary symbols needed for SDC device dispatch. */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRF52_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRF53_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRF54L_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF71X) +#define NRF71_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRF54H_SERIES +#endif +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_NRF_802154_RADIO_DRIVER) +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#include <../src/nrf_802154_peripherals_nrf52.h> +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#include <../src/nrf_802154_peripherals_nrf53.h> +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#include <../src/nrf_802154_peripherals_nrf54l.h> +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#include <../src/nrf_802154_peripherals_nrf54h.h> +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL +#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL +#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL +#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL +#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL +#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL +#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL +#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL +#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL +#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL +#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL +#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL +#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL +#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL +#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL +#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL +#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL +#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 +#endif + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_CHANNELS_USED \ + (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI0_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_GROUPS_USED \ + (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI0_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_CHANNELS_USED \ + (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI00_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_GROUPS_USED \ + (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI00_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_CHANNELS_USED \ + (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI10_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_GROUPS_USED \ + (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI10_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_CHANNELS_USED \ + (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI20_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_GROUPS_USED \ + (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI20_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_CHANNELS_USED \ + (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI30_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_GROUPS_USED \ + (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI30_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_CHANNELS_USED \ + (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI020_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_GROUPS_USED \ + (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI020_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_CHANNELS_USED \ + (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI030_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_GROUPS_USED \ + (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI030_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_CHANNELS_USED \ + (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI120_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_GROUPS_USED \ + (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI120_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_CHANNELS_USED \ + (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI130_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_GROUPS_USED \ + (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI130_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_CHANNELS_USED \ + (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI131_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_GROUPS_USED \ + (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI131_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_CHANNELS_USED \ + (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI132_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_GROUPS_USED \ + (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI132_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_CHANNELS_USED \ + (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI133_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_GROUPS_USED \ + (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI133_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_CHANNELS_USED \ + (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI134_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_GROUPS_USED \ + (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI134_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_CHANNELS_USED \ + (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI135_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_GROUPS_USED \ + (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI135_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_CHANNELS_USED \ + (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI136_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_GROUPS_USED \ + (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI136_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines PPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_CHANNELS_USED \ + (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) + +#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED +#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED + +/** @brief Bitmask that defines PPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_GROUPS_USED \ + (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ + NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) + +#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ + (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ + (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ + (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ + (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ + (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ + (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ + (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ + NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) + +#if defined(CONFIG_SOFTDEVICE) +#include +#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED +#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED +#else +#define NRFX_PPI_CHANNELS_USED_BY_SD 0 +#define NRFX_PPI_GROUPS_USED_BY_SD 0 +#endif + +#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h deleted file mode 100644 index 2c1fe3640493..000000000000 --- a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_RESERVED_RESOURCES_NCS_H__ -#define NRFX_RESERVED_RESOURCES_NCS_H__ - -#if defined(CONFIG_BT_LL_SOFTDEVICE) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) -#else -#error Unsupported chip family -#endif -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ - -#if defined(CONFIG_MPSL) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ - (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif - -#include "nrfx_reserved_resources.h" - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) - -BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ -#endif /* NRFX_RESERVED_RESOURCES_NCS_H__ */ From c6d643a01a517dcd9d17881a1fedd05fa0734817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:22 +0200 Subject: [PATCH 2966/3334] Revert "[nrf noup] tests: ram_context_for_isr: Disable KMU by default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 206c0efa9be0b49e1ab7bffb09978da18368ba40. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ------ .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ------ .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ------ .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ------ .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ------ .../boards/nrf7120pdk_nrf7120_cpuapp.conf | 6 ------ 6 files changed, 36 deletions(-) delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n From 7f95f10705f70b82f3b4093d18115c3d60affd2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:22 +0200 Subject: [PATCH 2967/3334] Revert "[nrf noup] drivers: can: mcan: implement CAN_MODE_ONE_SHOT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 93d8bf56fc746116ad6075e6ce2df76cb91b70d6. Signed-off-by: Andrzej Głąbek --- drivers/can/Kconfig.mcan | 15 ---- drivers/can/can_mcan.c | 114 +------------------------- include/zephyr/drivers/can/can_mcan.h | 1 - 3 files changed, 2 insertions(+), 128 deletions(-) diff --git a/drivers/can/Kconfig.mcan b/drivers/can/Kconfig.mcan index 96c5f22446f6..db09fc800c11 100644 --- a/drivers/can/Kconfig.mcan +++ b/drivers/can/Kconfig.mcan @@ -7,18 +7,3 @@ config CAN_MCAN bool help Enable the Bosch M_CAN CAN IP module driver backend. - -if CAN_MCAN - -config CAN_MCAN_TXBCF_POLL_INTERVAL_MS - int "Polling interval in milliseconds of TXBCF register if DAR is enabled" - default 75 - help - When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, - is enabled, and a transmission fails, a bug in the MCAN IP prevents the - TCF (Transmission Cancellation Finalized) interrupt from triggering, - despite the correct bit being set in the TXBCF register. It is thus - necessary to poll TXBCF register to detect when a transmission failed if - DAR is enabled. - -endif # CAN_MCAN diff --git a/drivers/can/can_mcan.c b/drivers/can/can_mcan.c index 351423d16ac5..513daad82199 100644 --- a/drivers/can/can_mcan.c +++ b/drivers/can/can_mcan.c @@ -17,7 +17,6 @@ LOG_MODULE_REGISTER(can_mcan, CONFIG_CAN_LOG_LEVEL); #define CAN_INIT_TIMEOUT_MS 100 -#define TXBCF_TIMER_TIMEOUT K_MSEC(CONFIG_CAN_MCAN_TXBCF_POLL_INTERVAL_MS) int can_mcan_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) { @@ -277,7 +276,7 @@ int can_mcan_get_capabilities(const struct device *dev, can_mode_t *cap) { ARG_UNUSED(dev); - *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; + *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; if (IS_ENABLED(CONFIG_CAN_MANUAL_RECOVERY_MODE)) { *cap |= CAN_MODE_MANUAL_RECOVERY; @@ -323,78 +322,12 @@ int can_mcan_start(const struct device *dev) return err; } - uint32_t cccr; - - err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); - if (err != 0) { - return err; - } - - if (cccr & CAN_MCAN_CCCR_DAR) { - /* - * When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, - * is enabled, and a transmission fails, a bug in the MCAN IP prevents the - * TCF (Transmission Cancellation Finalized) interrupt from triggering, - * despite the correct bit being set in the TXBCF register. It is thus - * necessary to poll TXBCF register to detect when a transmission failed if - * DAR is enabled. - */ - k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); - } - data->common.started = true; pm_device_busy_set(dev); return err; } -static int can_mcan_read_txbcf(const struct device *dev) -{ - const struct can_mcan_config *config = dev->config; - const struct can_mcan_callbacks *cbs = config->callbacks; - struct can_mcan_data *data = dev->data; - uint32_t txbcfs; - int err; - can_tx_callback_t tx_cb; - void *user_data; - - err = can_mcan_read_reg(dev, CAN_MCAN_TXBCF, &txbcfs); - if (err != 0) { - LOG_ERR("failed to read tx cancellation finished (err %d)", err); - return err; - } - - if (txbcfs == 0) { - return 0; - } - - for (size_t tx_idx = 0; tx_idx < cbs->num_tx; tx_idx++) { - if ((txbcfs & BIT(tx_idx)) == 0) { - continue; - } - - if (cbs->tx[tx_idx].function == NULL) { - continue; - } - - tx_cb = cbs->tx[tx_idx].function; - user_data = cbs->tx[tx_idx].user_data; - cbs->tx[tx_idx].function = NULL; - LOG_DBG("tx buffer cancellation finished (idx %u)", tx_idx); - k_sem_give(&data->tx_sem); - tx_cb(dev, -EIO, user_data); - } - - return 0; -} - -static void can_mcan_txbcf_timer_handler(struct k_timer *timer_id) -{ - const struct device *dev = k_timer_user_data_get(timer_id); - - can_mcan_read_txbcf(dev); -} - static bool can_mcan_rx_filters_exist(const struct device *dev) { const struct can_mcan_config *config = dev->config; @@ -429,8 +362,6 @@ int can_mcan_stop(const struct device *dev) return -EALREADY; } - k_timer_stop(&data->txbcf_timer); - /* CAN transmissions are automatically stopped when entering init mode */ err = can_mcan_enter_init_mode(dev, K_MSEC(CAN_INIT_TIMEOUT_MS)); if (err != 0) { @@ -471,7 +402,7 @@ int can_mcan_stop(const struct device *dev) int can_mcan_set_mode(const struct device *dev, can_mode_t mode) { - can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; + can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; struct can_mcan_data *data = dev->data; uint32_t cccr; uint32_t test; @@ -529,13 +460,6 @@ int can_mcan_set_mode(const struct device *dev, can_mode_t mode) } #endif /* CONFIG_CAN_FD_MODE */ - if ((mode & CAN_MODE_ONE_SHOT) != 0) { - /* Disable Automatic Retransmission */ - cccr |= CAN_MCAN_CCCR_DAR; - } else { - cccr &= ~CAN_MCAN_CCCR_DAR; - } - err = can_mcan_write_reg(dev, CAN_MCAN_CCCR, cccr); if (err != 0) { goto unlock; @@ -1131,21 +1055,6 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim } } - uint32_t cccr; - - err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); - if (err != 0) { - return err; - } - - if (cccr & CAN_MCAN_CCCR_DAR) { - /* - * TXBCR is cleared after TXBAR is set. Stop timer to ensure - * TXBCR is not read before TXBAR has been set. - */ - k_timer_stop(&data->txbcf_timer); - } - cbs->tx[put_idx].function = callback; cbs->tx[put_idx].user_data = user_data; @@ -1155,18 +1064,10 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim goto err_unlock; } - if (cccr & CAN_MCAN_CCCR_DAR) { - k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); - } - k_mutex_unlock(&data->tx_mtx); return 0; err_unlock: - if (cccr & CAN_MCAN_CCCR_DAR) { - k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); - } - k_mutex_unlock(&data->tx_mtx); k_sem_give(&data->tx_sem); @@ -1519,8 +1420,6 @@ int can_mcan_init(const struct device *dev) k_mutex_init(&data->lock); k_mutex_init(&data->tx_mtx); k_sem_init(&data->tx_sem, cbs->num_tx, cbs->num_tx); - k_timer_init(&data->txbcf_timer, can_mcan_txbcf_timer_handler, NULL); - k_timer_user_data_set(&data->txbcf_timer, (void *)dev); if (config->common.phy != NULL && !device_is_ready(config->common.phy)) { LOG_ERR("CAN transceiver not ready"); @@ -1679,14 +1578,5 @@ int can_mcan_init(const struct device *dev) return err; } - /* - * Interrupt on every TX buffer cancellation finished event. - */ - reg = CAN_MCAN_TXBCIE_CFIE; - err = can_mcan_write_reg(dev, CAN_MCAN_TXBCIE, reg); - if (err != 0) { - return err; - } - return can_mcan_clear_mram(dev, 0, config->mram_size); } diff --git a/include/zephyr/drivers/can/can_mcan.h b/include/zephyr/drivers/can/can_mcan.h index c62b4009526c..c064cc87d0c1 100644 --- a/include/zephyr/drivers/can/can_mcan.h +++ b/include/zephyr/drivers/can/can_mcan.h @@ -1065,7 +1065,6 @@ struct can_mcan_data { struct k_mutex lock; struct k_sem tx_sem; struct k_mutex tx_mtx; - struct k_timer txbcf_timer; void *custom; } __aligned(4); From 13c3c77b583fef1d5db090f6d7cdd9ded0dbfb1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:22 +0200 Subject: [PATCH 2968/3334] Revert "[nrf noup] mgmt: mcumgr: Fix nRF5340 network core hook" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 258c7573e918d2602ab20ee78fb64d4f04240a8d. Signed-off-by: Andrzej Głąbek --- subsys/mgmt/mcumgr/CMakeLists.txt | 13 ++++++------- subsys/mgmt/mcumgr/Kconfig | 2 +- subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 15 ++++++++++++--- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 -------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 3bb21e16f798..ad088eca0677 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -17,11 +17,10 @@ add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) -if(CONFIG_MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index be48e2f4fb7e..5a7314ad57ed 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,7 @@ menuconfig MCUMGR bool "MCUmgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP && MCUMGR_GRP_IMG && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 + imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the MCUmgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c index b372ce4e4945..f1ac8a168e65 100644 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -8,10 +8,19 @@ #include #include "bootutil/bootutil_public.h" -int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state) +#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 +/* Sysbuild */ +#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER +#else +/* Legacy child/parent */ +#define NET_CORE_IMAGE 1 +#endif + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) { - if (image_index == CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER) { - /* Pretend that primary slot of the network core update image is unpopulated */ + if (image_index == NET_CORE_IMAGE) { + /* Pretend that primary slot of image 1 unpopulated */ state->magic = BOOT_MAGIC_UNSET; state->swap_type = BOOT_SWAP_TYPE_NONE; state->image_num = image_index; diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index b3a7410d6408..ca5362f1fd68 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -231,14 +231,6 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS This will enable the slot info function hooks which can be used to add additional information to responses. -config MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK - bool "nRF5340 network core bootutil hook" - depends on SOC_NRF5340_CPUAPP && BOOT_IMAGE_ACCESS_HOOKS && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 - default y - help - This option will enable a bootutil hook that populates the network core update image - slot with dummy data to allow for uploading a firmware update to the network core. - module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" From 7be25b292501dbc302d20926ff4dd31fb3039145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:23 +0200 Subject: [PATCH 2969/3334] Revert "[nrf noup] tests: drivers: mspi: flash: disable psa_rng" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4c7aba3df46ce8b5755d56643e2fe59373542c26. Signed-off-by: Andrzej Głąbek --- .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 ---- .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 - .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay | 5 ----- 3 files changed, 10 deletions(-) delete mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf delete mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 2e6b6cf5eacc..6e0d84e07cdb 100644 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -8,10 +8,6 @@ aliases { mspi0 = &exmif; }; - - psa_rng: psa-rng { - status = "disabled"; - }; }; &gpio6 { diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index a026df97a458..000000000000 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_PM=n diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay deleted file mode 100644 index 09b4edc100a4..000000000000 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - psa_rng: psa-rng { - status = "disabled"; - }; -}; From 54c1f09e981e462e1292187d731e560a05d7c1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:24 +0200 Subject: [PATCH 2970/3334] Revert "[nrf noup] ci: Extend test spec for CI-ble-test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f1d901d629baa1d1bb58d8772425f59e9a403fc7. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5fdf9c0ca782..76def875e0be 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -86,8 +86,6 @@ - "samples/tfm_integration/**/*" "CI-ble-test": - - any: - - "arch/arm/**/*" - any: - "drivers/bluetooth/**/*" - any: @@ -99,12 +97,7 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" - - any: - - "boards/nordic/nrf5*" - - any: - - "soc/nordic/**/*" - - any: - - "subsys/pm/**/*" + - "samples/bluetooth/hci_ipc/**/*" "CI-ble-samples-test": - any: From 718279c21759a0342d60b9385e046f8f1c824e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:24 +0200 Subject: [PATCH 2971/3334] Revert "[nrf noup] boards: nordic: Enable PSA RNG for nrf9280" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8e1b36318165056872f2e7719ef29bc9fa45e5aa. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 6 ------ boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 6 ------ 2 files changed, 12 deletions(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index 12ef4b4bb828..ee8588622a52 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -27,7 +27,6 @@ zephyr,uart-mcumgr = &uart136; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &psa_rng; }; aliases { @@ -109,11 +108,6 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; }; &cpuapp_ram0x_region { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index 17c482e7865c..45fd620c37a1 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -29,18 +29,12 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; }; &cpuapp_cpurad_ram0x_region { From 448b74c8f003a4a5f5246d75bc21694e06de0e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:24 +0200 Subject: [PATCH 2972/3334] Revert "[nrf noup] boards: nordic: Enable PSA RNG for nrf54h20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b9d5d9f655bfb8ca7438af16d0e9111043639222. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 6 ------ boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 6 ------ 2 files changed, 12 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 42ab67eda189..da4dbf236406 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -27,7 +27,6 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; - zephyr,entropy = &psa_rng; }; aliases { @@ -112,11 +111,6 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; }; &cpuapp_bellboard { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index 0c46f46b7249..cf88e536d43c 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -28,18 +28,12 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; - zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; }; &cpurad_bellboard { From 0ef386d1d8e9f037fa7a1ea642d163ebfa4877da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:25 +0200 Subject: [PATCH 2973/3334] Revert "[nrf noup] tests: bluetooth: tester: Remove deprecated configs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 30cd6282e2016ce77738427809249fe963d76273. Signed-off-by: Andrzej Głąbek --- tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 + .../sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 0f16f6ea7b4c..51b0ef5fa8d4 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -26,5 +26,6 @@ CONFIG_UART_INTERRUPT_DRIVEN=y # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf index 24e3d84ecf96..b7d64a9e6a08 100644 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -35,5 +35,6 @@ CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y From c9898dd68250f30e20525a697b3fe9579414377a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:25 +0200 Subject: [PATCH 2974/3334] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding as default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e89fd5f868c584dbda3d140ca7ff062c8a942968. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf52805.dtsi | 11 +- dts/arm/nordic/nrf52810.dtsi | 11 +- dts/arm/nordic/nrf52811.dtsi | 11 +- dts/arm/nordic/nrf52820.dtsi | 11 +- dts/arm/nordic/nrf52832.dtsi | 11 +- dts/arm/nordic/nrf52833.dtsi | 11 +- dts/arm/nordic/nrf52840.dtsi | 11 +- dts/arm/nordic/nrf5340_cpunet.dtsi | 11 +- dts/arm/nordic/nrf54h20_cpurad.dtsi | 4 +- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +- dts/vendor/nordic/nrf54h20.dtsi | 7 +- dts/vendor/nordic/nrf54l20.dtsi | 852 ------------------ dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 +- .../bluetooth/bap_broadcast_sink/sample.yaml | 4 +- .../bap_broadcast_sink/sysbuild.cmake | 4 - .../bap_broadcast_source/sample.yaml | 4 +- .../bap_broadcast_source/sysbuild.cmake | 4 - .../bluetooth/bap_unicast_client/sample.yaml | 4 +- .../bap_unicast_client/sysbuild.cmake | 4 - .../bluetooth/bap_unicast_server/sample.yaml | 4 +- .../bap_unicast_server/sysbuild.cmake | 4 - samples/bluetooth/beacon/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sysbuild.cmake | 4 - samples/bluetooth/cap_initiator/sample.yaml | 4 +- .../bluetooth/cap_initiator/sysbuild.cmake | 4 - .../direction_finding_central/sample.yaml | 15 +- .../sample.yaml | 14 +- .../sample.yaml | 14 +- .../direction_finding_peripheral/sample.yaml | 15 +- samples/bluetooth/hci_ipc/sample.yaml | 34 +- samples/bluetooth/hci_uart/sample.yaml | 18 +- samples/bluetooth/hci_vs_scan_req/sample.yaml | 2 - samples/bluetooth/iso_central/sample.yaml | 6 +- .../pbp_public_broadcast_sink/sample.yaml | 4 +- .../pbp_public_broadcast_sink/sysbuild.cmake | 4 - .../pbp_public_broadcast_source/sample.yaml | 4 +- .../sysbuild.cmake | 4 - .../bt-ll-sw-split/bt-ll-sw-split.overlay | 4 - .../controller/ll_sw/nordic/lll/lll.c | 2 +- .../controller/ctrl_api/testcase.yaml | 2 - .../controller/ctrl_chmu/testcase.yaml | 2 - .../controller/ctrl_cis_create/testcase.yaml | 2 - .../ctrl_cis_terminate/testcase.yaml | 2 - .../controller/ctrl_collision/testcase.yaml | 2 - .../controller/ctrl_conn_update/testcase.yaml | 11 +- .../controller/ctrl_cte_req/testcase.yaml | 2 - .../ctrl_data_length_update/testcase.yaml | 10 +- .../controller/ctrl_encrypt/testcase.yaml | 2 - .../ctrl_feature_exchange/testcase.yaml | 2 - .../controller/ctrl_hci/testcase.yaml | 2 - .../controller/ctrl_invalid/testcase.yaml | 2 - .../controller/ctrl_le_ping/testcase.yaml | 2 - .../ctrl_min_used_chans/testcase.yaml | 2 - .../controller/ctrl_phy_update/testcase.yaml | 6 +- .../controller/ctrl_sca_update/testcase.yaml | 2 - .../controller/ctrl_sw_privacy/testcase.yaml | 2 - .../controller/ctrl_terminate/testcase.yaml | 2 - .../ctrl_tx_buffer_alloc/testcase.yaml | 22 +- .../controller/ctrl_tx_queue/testcase.yaml | 2 - .../controller/ctrl_unsupported/testcase.yaml | 6 +- .../controller/ctrl_user_ext/testcase.yaml | 2 - .../controller/ctrl_version/testcase.yaml | 2 - .../df/connection_cte_req/testcase.yaml | 2 - .../df/connection_cte_tx_params/testcase.yaml | 2 - .../connectionless_cte_chains/testcase.yaml | 2 - .../df/connectionless_cte_rx/testcase.yaml | 2 - .../df/connectionless_cte_tx/testcase.yaml | 2 - tests/bluetooth/init/testcase.yaml | 101 +-- 69 files changed, 122 insertions(+), 1235 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 0d564955f8c1..3355f3918c87 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -108,13 +108,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 d95751752109..0c61d6700c71 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -116,13 +116,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 5c55cf44edcf..2e785877ca97 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -124,13 +124,12 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "okay"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index d67d81686a4a..d95a47943acb 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; }; @@ -125,13 +125,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 a127ffb194d9..1be9885a756b 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -116,13 +116,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 33df68336231..daee86d5c244 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -126,13 +126,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 15052e2e82a4..324f06d0fba9 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -118,13 +118,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 b7b00c4feeda..94e93782fe31 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; }; @@ -106,13 +106,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 2cde225beb01..eac16a3c14f3 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -32,7 +32,7 @@ wdt011: &cpurad_wdt011 {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; }; soc { @@ -136,6 +136,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index d4dcee6850d6..b29562185846 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -20,7 +20,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &psa_rng; }; @@ -41,7 +41,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 7c569e2bf104..94b45b297cc3 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -498,10 +498,9 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi deleted file mode 100644 index bee70effa0e8..000000000000 --- a/dts/vendor/nordic/nrf54l20.dtsi +++ /dev/null @@ -1,852 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -/delete-node/ &sw_pwm; - -/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ -#define NRF_DOMAIN_ID_APPLICATION 0 -#define NRF_DOMAIN_ID_FLPR 1 - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@0 { - compatible = "arm,cortex-m33f"; - reg = <0>; - device_type = "cpu"; - clocks = <&hfpll>; - #address-cells = <1>; - #size-cells = <1>; - - itm: itm@e0000000 { - compatible = "arm,armv8m-itm"; - reg = <0xe0000000 0x1000>; - swo-ref-frequency = ; - }; - }; - - cpuflpr: cpu@1 { - compatible = "nordic,vpr"; - reg = <1>; - device_type = "cpu"; - riscv,isa = "rv32emc"; - nordic,bus-width = <64>; - }; - }; - - clocks { - pclk: pclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - pclk32m: pclk32m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfxo: lfxo { - compatible = "nordic,nrf54l-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf54l-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1650>; - }; - - hfpll: hfpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - aclk: aclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - ficr: ficr@ffc000 { - compatible = "nordic,nrf-ficr"; - reg = <0xffc000 0x1000>; - #nordic,ficr-cells = <1>; - }; - - uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; - reg = <0xffd000 0x1000>; - }; - - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(447)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 0x6fc00>; - }; - - cpuflpr_sram: memory@2006fc00 { - compatible = "mmio-sram"; - reg = <0x2006fc00 DT_SIZE_K(64)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2006fc00 0x10000>; - }; - - global_peripherals: peripheral@50000000 { - ranges = <0x0 0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - - dppic00: dppic@42000 { - compatible = "nordic,nrf-dppic"; - reg = <0x42000 0x808>; - status = "disabled"; - }; - - ppib00: ppib@44000 { - compatible = "nordic,nrf-ppib"; - reg = <0x44000 0x1000>; - status = "disabled"; - }; - - ppib01: ppib@45000 { - compatible = "nordic,nrf-ppib"; - reg = <0x45000 0x1000>; - status = "disabled"; - }; - - cpuflpr_vpr: vpr@4c000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x4c000 0x1000>; - ranges = <0x0 0x4c000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - status = "disabled"; - enable-secure; - - cpuflpr_clic: interrupt-controller@f0000000 { - compatible = "nordic,nrf-clic"; - reg = <0xf0000000 0x143c>; - interrupt-controller; - #interrupt-cells = <2>; - #address-cells = <1>; - status = "disabled"; - }; - }; - - spi00: spi@4d000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart00: uart@4d000 { - compatible = "nordic,nrf-uarte"; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - gpio2: gpio@50400 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x50400 0x300>; - #gpio-cells = <2>; - ngpios = <11>; - status = "disabled"; - port = <2>; - }; - - timer00: timer@55000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x55000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - prescaler = <0>; - }; - - dppic10: dppic@82000 { - compatible = "nordic,nrf-dppic"; - reg = <0x82000 0x808>; - status = "disabled"; - }; - - ppib10: ppib@83000 { - compatible = "nordic,nrf-ppib"; - reg = <0x83000 0x1000>; - status = "disabled"; - }; - - ppib11: ppib@84000 { - compatible = "nordic,nrf-ppib"; - reg = <0x84000 0x1000>; - status = "disabled"; - }; - - timer10: timer@85000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x85000 0x1000>; - cc-num = <8>; - max-bit-width = <32>; - interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - prescaler = <0>; - }; - - egu10: egu@87000 { - compatible = "nordic,nrf-egu"; - reg = <0x87000 0x1000>; - interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - radio: radio@8a000 { - compatible = "nordic,nrf-radio"; - reg = <0x8a000 0x1000>; - interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - dfe-supported; - ieee802154-supported; - ble-2mbps-supported; - ble-coded-phy-supported; - cs-supported; - - ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; - }; - - dppic20: dppic@c2000 { - compatible = "nordic,nrf-dppic"; - reg = <0xc2000 0x808>; - status = "disabled"; - }; - - ppib20: ppib@c3000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc3000 0x1000>; - status = "disabled"; - }; - - ppib21: ppib@c4000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc4000 0x1000>; - status = "disabled"; - }; - - ppib22: ppib@c5000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc5000 0x1000>; - status = "disabled"; - }; - - i2c20: i2c@c6000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi20: spi@c6000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart20: uart@c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c21: i2c@c7000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi21: spi@c7000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart21: uart@c7000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c22: i2c@c8000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi22: spi@c8000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart22: uart@c8000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - egu20: egu@c9000 { - compatible = "nordic,nrf-egu"; - reg = <0xc9000 0x1000>; - interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - timer20: timer@ca000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xca000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer21: timer@cb000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcb000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer22: timer@cc000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcc000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer23: timer@cd000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcd000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer24: timer@ce000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xce000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - pdm20: pdm@d0000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd0000 0x1000>; - interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pdm21: pdm@d1000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd1000 0x1000>; - interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pwm20: pwm@d2000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd2000 0x1000>; - interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm21: pwm@d3000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd3000 0x1000>; - interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm22: pwm@d4000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd4000 0x1000>; - interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - adc: adc@d5000 { - compatible = "nordic,nrf-saadc"; - reg = <0xd5000 0x1000>; - interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - zephyr,pm-device-runtime-auto; - }; - - nfct: nfct@d6000 { - compatible = "nordic,nrf-nfct"; - reg = <0xd6000 0x1000>; - interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - temp: temp@d7000 { - compatible = "nordic,nrf-temp"; - reg = <0xd7000 0x1000>; - interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio1: gpio@d8200 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8200 0x300>; - #gpio-cells = <2>; - ngpios = <16>; - status = "disabled"; - port = <1>; - gpiote-instance = <&gpiote20>; - }; - - gpiote20: gpiote@da000 { - compatible = "nordic,nrf-gpiote"; - reg = <0xda000 0x1000>; - status = "disabled"; - instance = <20>; - }; - - qdec20: qdec@e0000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe0000 0x1000>; - interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - qdec21: qdec@e1000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe1000 0x1000>; - interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - grtc: grtc@e2000 { - compatible = "nordic,nrf-grtc"; - reg = <0xe2000 0x1000>; - cc-num = <12>; - clocks = <&lfxo>, <&pclk>; - clock-names = "lfclock", "hfclock"; - status = "disabled"; - }; - - tdm: tdm@e8000 { - compatible = "nordic,nrf-tdm"; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xe8000 0x1000>; - interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - clocks = <&pclk32m>; - }; - - i2c23: i2c@ed000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi23: spi@ed000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart23: uart@ed000 { - compatible = "nordic,nrf-uarte"; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c24: i2c@ee000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi24: spi@ee000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart24: uart@ee000 { - compatible = "nordic,nrf-uarte"; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - dppic30: dppic@102000 { - compatible = "nordic,nrf-dppic"; - reg = <0x102000 0x808>; - status = "disabled"; - }; - - ppib30: ppib@103000 { - compatible = "nordic,nrf-ppib"; - reg = <0x103000 0x1000>; - status = "disabled"; - }; - - i2c30: i2c@104000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi30: spi@104000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart30: uart@104000 { - compatible = "nordic,nrf-uarte"; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - comp: comparator@106000 { - /* - * Use compatible "nordic,nrf-comp" to configure as COMP - * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP - */ - compatible = "nordic,nrf-comp"; - reg = <0x106000 0x1000>; - status = "disabled"; - interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - wdt30: watchdog@108000 { - compatible = "nordic,nrf-wdt"; - reg = <0x108000 0x620>; - interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - wdt31: watchdog@109000 { - compatible = "nordic,nrf-wdt"; - reg = <0x109000 0x620>; - interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio0: gpio@10a000 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x10a000 0x300>; - #gpio-cells = <2>; - ngpios = <5>; - status = "disabled"; - port = <0>; - gpiote-instance = <&gpiote30>; - }; - - gpiote30: gpiote@10c000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x10c000 0x1000>; - status = "disabled"; - instance = <30>; - }; - - clock: clock@10e000 { - compatible = "nordic,nrf-clock"; - reg = <0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@51c { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x51c 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@520 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x520 0x1>; - status = "disabled"; - }; - }; - - regulators: regulator@120000 { - compatible = "nordic,nrf54l-regulators"; - reg = <0x120000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - vregmain: regulator@120600 { - compatible = "nordic,nrf5x-regulator"; - reg = <0x120600 0x1>; - status = "disabled"; - regulator-name = "VREGMAIN"; - regulator-initial-mode = ; - }; - }; - }; - - rram_controller: rram-controller@5004e000 { - compatible = "nordic,rram-controller"; - reg = <0x5004e000 0x1000>; - interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(1972)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - - cpuflpr_rram: rram@1ed000 { - compatible = "soc-nv-flash"; - reg = <0x1ed000 DT_SIZE_K(64)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_nvic: interrupt-controller@e000e100 { - #address-cells = <1>; - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - }; - }; -}; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 4dea8277169f..bbd9e135e3d7 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -253,11 +253,9 @@ status = "disabled"; }; - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/samples/bluetooth/bap_broadcast_sink/sample.yaml b/samples/bluetooth/bap_broadcast_sink/sample.yaml index 3eb1acd40762..e6739dc10242 100644 --- a/samples/bluetooth/bap_broadcast_sink/sample.yaml +++ b/samples/bluetooth/bap_broadcast_sink/sample.yaml @@ -25,7 +25,5 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake index f969f05ecffd..f030ce94ef20 100644 --- a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_broadcast_source/sample.yaml b/samples/bluetooth/bap_broadcast_source/sample.yaml index 5f745cd08950..5e5b01d942d0 100644 --- a/samples/bluetooth/bap_broadcast_source/sample.yaml +++ b/samples/bluetooth/bap_broadcast_source/sample.yaml @@ -36,7 +36,5 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake index 8ff4c02acf5a..5aa4c28ce922 100644 --- a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_client/sample.yaml b/samples/bluetooth/bap_unicast_client/sample.yaml index 44f32934ce99..7283090b8781 100644 --- a/samples/bluetooth/bap_unicast_client/sample.yaml +++ b/samples/bluetooth/bap_unicast_client/sample.yaml @@ -22,7 +22,5 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_client/sysbuild.cmake b/samples/bluetooth/bap_unicast_client/sysbuild.cmake index 8ff4c02acf5a..5aa4c28ce922 100644 --- a/samples/bluetooth/bap_unicast_client/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_client/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_server/sample.yaml b/samples/bluetooth/bap_unicast_server/sample.yaml index 266ced73f66d..068f752b626b 100644 --- a/samples/bluetooth/bap_unicast_server/sample.yaml +++ b/samples/bluetooth/bap_unicast_server/sample.yaml @@ -22,7 +22,5 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_server/sysbuild.cmake b/samples/bluetooth/bap_unicast_server/sysbuild.cmake index 8ff4c02acf5a..5aa4c28ce922 100644 --- a/samples/bluetooth/bap_unicast_server/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_server/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index fe90b5952f92..1cbfc7da36f7 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -21,9 +21,7 @@ tests: - ophelia4ev/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp sample.bluetooth.beacon-coex: - extra_args: - - CONF_FILE="prj-coex.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="prj-coex.conf" harness: bluetooth platform_allow: - nrf52840dk/nrf52840 diff --git a/samples/bluetooth/cap_acceptor/sample.yaml b/samples/bluetooth/cap_acceptor/sample.yaml index 9061f44679fb..824e744eecaf 100644 --- a/samples/bluetooth/cap_acceptor/sample.yaml +++ b/samples/bluetooth/cap_acceptor/sample.yaml @@ -26,7 +26,5 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/cap_acceptor/sysbuild.cmake b/samples/bluetooth/cap_acceptor/sysbuild.cmake index 8ff4c02acf5a..5aa4c28ce922 100644 --- a/samples/bluetooth/cap_acceptor/sysbuild.cmake +++ b/samples/bluetooth/cap_acceptor/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/cap_initiator/sample.yaml b/samples/bluetooth/cap_initiator/sample.yaml index e3e557f48301..b4f593c99129 100644 --- a/samples/bluetooth/cap_initiator/sample.yaml +++ b/samples/bluetooth/cap_initiator/sample.yaml @@ -26,7 +26,5 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/cap_initiator/sysbuild.cmake b/samples/bluetooth/cap_initiator/sysbuild.cmake index 8ff4c02acf5a..5aa4c28ce922 100644 --- a/samples/bluetooth/cap_initiator/sysbuild.cmake +++ b/samples/bluetooth/cap_initiator/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index ffdf634c6e3e..b7a118e6cdc8 100644 --- a/samples/bluetooth/direction_finding_central/sample.yaml +++ b/samples/bluetooth/direction_finding_central/sample.yaml @@ -14,24 +14,15 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.central.aod_with_controller: + sample.bluetooth.direction_finding.central.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aod.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aod.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding.central.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aod.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - tags: bluetooth - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml index c500cc80dcec..8e6097de58ae 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml @@ -12,22 +12,14 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless_rx.aod_with_controller: + sample.bluetooth.direction_finding_connectionless_rx.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aod.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aod.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding_connectionless_rx.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aod.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 2a4fa93d19d5..78d21b2c95f5 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -12,22 +12,14 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless.aoa_with_controller: + sample.bluetooth.direction_finding_connectionless.aoa: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aoa.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding_connectionless.aoa_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aoa.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_peripheral/sample.yaml b/samples/bluetooth/direction_finding_peripheral/sample.yaml index 01f612ad08a0..f300cb415cc5 100644 --- a/samples/bluetooth/direction_finding_peripheral/sample.yaml +++ b/samples/bluetooth/direction_finding_peripheral/sample.yaml @@ -14,24 +14,15 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.peripheral.aod_with_controller: + sample.bluetooth.direction_finding.peripheral.aod: harness: bluetooth - extra_args: - - EXTRA_CONF_FILE="overlay-aoa.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - sample.bluetooth.direction_finding.peripheral.aod_host_only: - harness: bluetooth - extra_args: - - OVERLAY_CONFIG="overlay-aoa.conf" - platform_allow: - - nrf5340dk/nrf5340/cpuapp - tags: bluetooth - integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/hci_ipc/sample.yaml b/samples/bluetooth/hci_ipc/sample.yaml index 3763478b6b33..b758b2547688 100644 --- a/samples/bluetooth/hci_ipc/sample.yaml +++ b/samples/bluetooth/hci_ipc/sample.yaml @@ -15,9 +15,7 @@ tests: sample.bluetooth.hci_ipc.iso_broadcast.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -27,9 +25,7 @@ tests: sample.bluetooth.hci_ipc.iso_receive.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -39,9 +35,7 @@ tests: sample.bluetooth.hci_ipc.bis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -51,9 +45,7 @@ tests: sample.bluetooth.hci_ipc.iso_central.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -63,9 +55,7 @@ tests: sample.bluetooth.hci_ipc.iso_peripheral.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -75,9 +65,7 @@ tests: sample.bluetooth.hci_ipc.cis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -87,9 +75,7 @@ tests: sample.bluetooth.hci_ipc.iso.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -113,7 +99,6 @@ tests: extra_args: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet @@ -124,16 +109,13 @@ tests: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - CONFIG_BT_CTLR_PHY_CODED=n - - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet sample.bluetooth.hci_ipc.mesh.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: - - CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet diff --git a/samples/bluetooth/hci_uart/sample.yaml b/samples/bluetooth/hci_uart/sample.yaml index 8555c65cf0df..df2b40135c67 100644 --- a/samples/bluetooth/hci_uart/sample.yaml +++ b/samples/bluetooth/hci_uart/sample.yaml @@ -24,9 +24,7 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -35,9 +33,7 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -48,9 +44,7 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -60,9 +54,7 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df.iq_report: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: - - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay - - SNIPPET="bt-ll-sw-split" + extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -96,7 +88,6 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay - - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth @@ -108,7 +99,6 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf54l15dk_nrf54l15_cpuapp_df.overlay - - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth diff --git a/samples/bluetooth/hci_vs_scan_req/sample.yaml b/samples/bluetooth/hci_vs_scan_req/sample.yaml index 49526522d16e..245a83aa0d96 100644 --- a/samples/bluetooth/hci_vs_scan_req/sample.yaml +++ b/samples/bluetooth/hci_vs_scan_req/sample.yaml @@ -9,6 +9,4 @@ tests: - nrf52dk/nrf52832 extra_configs: - CONFIG_BT_LL_SW_SPLIT=y - extra_args: - - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/iso_central/sample.yaml b/samples/bluetooth/iso_central/sample.yaml index 57254ee809ab..3a7dedd404ae 100644 --- a/samples/bluetooth/iso_central/sample.yaml +++ b/samples/bluetooth/iso_central/sample.yaml @@ -11,11 +11,11 @@ tests: sample.bluetooth.iso_central.bt_ll_sw_split: harness: bluetooth platform_allow: + - qemu_cortex_m3 + - qemu_x86 - nrf52_bsim - nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml index 901d40b00d4f..d7c816ee5b76 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml @@ -23,7 +23,5 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake index 8ff4c02acf5a..5aa4c28ce922 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake @@ -18,10 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml index 1d2e31306e29..80c907042119 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml @@ -23,7 +23,5 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: - - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake index fa62c31f7b3b..f0aa34b7ad4a 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake @@ -18,10 +18,6 @@ if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")) CACHE INTERNAL "" ) - list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) - list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) - set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) - native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay index a57a0e82ba6e..04bf83ef44d4 100644 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay +++ b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay @@ -2,10 +2,6 @@ status = "okay"; }; -&bt_hci_sdc { - status = "disabled"; -}; - / { chosen { zephyr,bt-hci = &bt_hci_controller; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 37c6b29a0582..9ff7e9007285 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -62,7 +62,7 @@ static struct { /* FIXME: This could probably use a chosen entropy device instead on relying on * the nodelabel being the same as for the old nrf rng. */ -static const struct device *const dev_entropy = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy)); +static const struct device *const dev_entropy = DEVICE_DT_GET(DT_NODELABEL(rng)); #endif /* CONFIG_ENTROPY_HAS_DRIVER */ static int init_reset(void); diff --git a/tests/bluetooth/controller/ctrl_api/testcase.yaml b/tests/bluetooth/controller/ctrl_api/testcase.yaml index 21f178bf9b2b..19bf6c9ab490 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 9c3ee6264335..f7e8068d60ec 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 2371d7063eb7..99612a89bc31 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 a98229ba45f3..956172a89b20 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 daa8f3bc6c3d..6086a9a4ebc8 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 fc4ecb0b647d..5b0bda4b9088 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 c6288aecc433..fd6ff51118d9 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 c7d1174e12bf..9778af435b4a 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 86dd5bfe4d30..d5bb2cb8b110 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 087e49575ff7..257542f36120 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 e0735bae6962..d7f7ce7168d1 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 cee54e6b09ed..2d1741931e37 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 54178905da17..b6a77528f32d 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 a9445cbf8c4d..0991b0cdd43c 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 d5c49d587a8f..1d7da169f1d8 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 cbc3c3faf720..cbf63aa1b575 100644 --- a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_sca_update.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml index ac5dd6e957eb..778606d69549 100644 --- a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml @@ -4,5 +4,3 @@ common: tests: bluetooth.ctrl_sw_privacy.test: platform_allow: nrf52_bsim - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml index 6b1409e9653e..cbe639401ea3 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 363986bd3d35..614eb7fe94c0 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 282b620b317a..295ad891a630 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 48b18af93536..28aba1a752a8 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml @@ -6,11 +6,7 @@ common: tests: bluetooth.controller.ctrl_unsupported.default.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_unsupported.test: type: unit - extra_args: - - CONF_FILE=prj_unsupported.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_unsupported.conf diff --git a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml index be963df24a8a..af319a7a7191 100644 --- a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml @@ -4,5 +4,3 @@ common: tests: bluetooth.ctrl_user_ext.test: platform_allow: nrf52_bsim - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_version/testcase.yaml b/tests/bluetooth/controller/ctrl_version/testcase.yaml index 5df86b9bca9f..6badcbc72547 100644 --- a/tests/bluetooth/controller/ctrl_version/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_version/testcase.yaml @@ -6,5 +6,3 @@ common: tests: bluetooth.controller.ctrl_version.test: type: unit - extra_args: - - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_req/testcase.yaml b/tests/bluetooth/df/connection_cte_req/testcase.yaml index fbfe4b0d9a1a..768aba4a51f5 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 a9986c5b0e53..38a23b0950e3 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 844a7bbb524e..6aa5bb0f0c1c 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 c8f08a908436..f839b1910eb2 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 491cc0e7e599..77d651d0cbc2 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 bbefd93265c1..120b6a3d81bd 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -62,9 +62,7 @@ tests: extra_args: CONF_FILE=prj_6.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 @@ -76,9 +74,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 @@ -87,9 +83,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 @@ -98,9 +92,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 @@ -112,7 +104,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 @@ -123,7 +114,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 @@ -135,7 +125,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 @@ -145,16 +134,13 @@ tests: bluetooth.init.test_ctlr_ticker: extra_args: - CONF_FILE=prj_ctlr_ticker.conf - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_broadcaster: - extra_args: - - CONF_FILE=prj_ctlr_broadcaster.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_broadcaster.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -163,9 +149,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral: - extra_args: - - CONF_FILE=prj_ctlr_peripheral.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -174,9 +158,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral_priv: - extra_args: - - CONF_FILE=prj_ctlr_peripheral_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_peripheral_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -185,9 +167,7 @@ tests: integration_platforms: - nrf52840dk/nrf52840 bluetooth.init.test_ctlr_observer: - extra_args: - - CONF_FILE=prj_ctlr_observer.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_observer.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -196,9 +176,7 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_central: - extra_args: - - CONF_FILE=prj_ctlr_central.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -208,9 +186,7 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_central_priv: - extra_args: - - CONF_FILE=prj_ctlr_central_priv.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_central_priv.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -220,9 +196,7 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_broadcaster_ext: - extra_args: - - CONF_FILE=prj_ctlr_broadcaster_ext.conf - - SNIPPET="bt-ll-sw-split" + extra_args: CONF_FILE=prj_ctlr_broadcaster_ext.conf platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -231,9 +205,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 @@ -242,9 +214,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 @@ -253,9 +223,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 @@ -264,9 +232,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 @@ -275,9 +241,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 @@ -286,9 +250,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 @@ -297,9 +259,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 @@ -308,9 +268,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 @@ -319,9 +277,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 @@ -330,9 +286,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 @@ -341,9 +295,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 @@ -352,9 +304,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 @@ -373,9 +323,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 @@ -387,7 +335,6 @@ tests: extra_args: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_RECV_WORKQ_BT=y - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 bluetooth.init.test_host_6_x: From b92995aa51de8aa7902cc18896c03a2e6f4091cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:25 +0200 Subject: [PATCH 2975/3334] Revert "[nrf noup] dts: Add Bluetooth Controller to nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9a1090dbe899a8ca3e7e64f9044a00ac9414aac5. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 8 -------- dts/vendor/nordic/nrf54h20.dtsi | 8 -------- 2 files changed, 16 deletions(-) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index eac16a3c14f3..b910e42789b0 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -31,10 +31,6 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &s2ram; / { - chosen { - zephyr,bt-hci = &bt_hci_controller; - }; - soc { compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; @@ -135,7 +131,3 @@ wdt011: &cpurad_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; - -&bt_hci_controller { - status = "okay"; -}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 94b45b297cc3..c53ba69a9edf 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -497,14 +497,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 c98c87e5e2a751b22ca39cad83d2e024963bae56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:26 +0200 Subject: [PATCH 2976/3334] Revert "[nrf noup] scripts: ci: check_compliance: Check Kconfigs for enable" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit df055b3eb59af0bf18b7ceb4427ddceb60648421. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 57 ++-------------------------------- 1 file changed, 3 insertions(+), 54 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 439c82508c20..fc4c73e7285b 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -681,22 +681,6 @@ class KconfigCheck(ComplianceTest): # Kconfig symbol prefix/namespace. CONFIG_ = "CONFIG_" - # If modules should be excluded from checks. - EXCLUDE_MODULES = False - - # This block list contains a list of upstream Zephyr modules that should not be checked - # DO NOT MERGE CHANGES TO THIS WITHOUT BUILD SYSTEM AND CODE OWNER APPROVAL! - external_module_name_block_list = ['canopennode', 'chre', 'cmsis', 'cmsis-dsp', 'cmsis-nn', - 'cmsis_6', 'edtt', 'fatfs', 'hal_st', 'hal_tdk', - 'hal_wurthelektronik', 'liblc3', 'libmetal', 'littlefs', - 'loramac-node', 'lvgl', 'lz4', 'mipi-sys-t', 'nanopb', - 'net-tools', 'nrf_hw_models', 'open-amp', 'percepio', - 'picolibc', 'segger', 'tf-m-tests', 'tinycrypt', - 'uoscore-uedhoc', 'zscilib'] - - # Holds a list or directories/files which should not be checked - blocked_module_dirs = [] - def run(self): kconf = self.parse_kconfig() @@ -738,22 +722,13 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir = ZEPHYR_BASE / 'modules' modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] - nrf_modules_dir = (Path(ZEPHYR_BASE) / '..' / 'nrf' / 'modules').resolve() + nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') nrf_modules = [] - - for module in modules: - if module in self.external_module_name_block_list: - self.blocked_module_dirs.append(modules_dir / module / 'Kconfig') - if os.path.exists(nrf_modules_dir): nrf_modules = [name for name in os.listdir(nrf_modules_dir) if os.path.exists(os.path.join(nrf_modules_dir, name, 'Kconfig'))] - for module in nrf_modules: - if module in self.external_module_name_block_list: - self.blocked_module_dirs.append(nrf_modules_dir / module / 'Kconfig') - with open(modules_file) as fp_module_file: content = fp_module_file.read() @@ -778,7 +753,6 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir / module / 'Kconfig', ) ) - # Add NRF as static entry as workaround for ext Kconfig root support fp_module_file.write( "ZEPHYR_NRF_KCONFIG = {}\n".format( @@ -1343,32 +1317,9 @@ def check_no_enable_in_boolean_prompt(self, kconf): # Checks that boolean's prompt does not start with "Enable...". for node in kconf.node_iter(): - skip_node = False - - # skip Kconfig nodes not in-tree when set to (will present an absolute path) + # skip Kconfig nodes not in-tree (will present an absolute path) if os.path.isabs(node.filename): - if self.EXCLUDE_MODULES is True: - continue - - normalised_file_name = Path(node.filename).resolve() - - for module_name in self.external_module_name_block_list: - # Workaround for being unable to use full_match() due to python version - if '/modules/' in str(normalised_file_name) and \ - ('/' + module_name + '/') in str(normalised_file_name): - skip_node = True - break - - if skip_node: - continue - - for blocked_dir in self.blocked_module_dirs: - if normalised_file_name.match(blocked_dir, case_sensitive=True): - skip_node = True - break - - if skip_node: - continue + continue # 'kconfiglib' is global # pylint: disable=undefined-variable @@ -1822,7 +1773,6 @@ class KconfigBasicNoModulesCheck(KconfigBasicCheck): name = "KconfigBasicNoModules" path_hint = "" EMPTY_FILE_CONTENTS = "# Empty\n" - EXCLUDE_MODULES = True def get_modules(self, module_dirs_file, modules_file, sysbuild_modules_file, settings_file): with open(module_dirs_file, 'w') as fp_module_file: @@ -1919,7 +1869,6 @@ class SysbuildKconfigBasicNoModulesCheck(SysbuildKconfigCheck, KconfigBasicNoMod name = "SysbuildKconfigBasicNoModules" path_hint = "" - EXCLUDE_MODULES = True class Nits(ComplianceTest): From a5dc35aad1c9fbf8f8a35889e15ab9ea799bfece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:26 +0200 Subject: [PATCH 2977/3334] Revert "[nrf noup] boards: nordic: Skip offsets in merged slot" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9f8e4ede3aaa409b959148d05e8c7fe6c139dc24. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54h20dk/Kconfig.defconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index c11d3ef63e1f..069ed7b6eba6 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -13,7 +13,6 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET - default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT if !USE_DT_CODE_PARTITION @@ -40,7 +39,6 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET - default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From 7680cd059063cf203533f55c49e8442dc695a236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:27 +0200 Subject: [PATCH 2978/3334] Revert "[nrf noup] ci: add default permissions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 38f7a5f684e8fb0bf7aca909939483ca1339149e. Signed-off-by: Andrzej Głąbek --- .github/workflows/commit-tags.yml | 5 +---- .github/workflows/manifest-PR.yml | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml index 61fc3a6c5bd3..828f02971678 100644 --- a/.github/workflows/commit-tags.yml +++ b/.github/workflows/commit-tags.yml @@ -6,9 +6,6 @@ on: milestoned, demilestoned, assigned, unassigned, ready_for_review, review_requested] -permissions: - contents: read - jobs: commit_tags: runs-on: ubuntu-22.04 @@ -19,7 +16,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Checkout the code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 0f3bd738a36c..473301146527 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -5,8 +5,6 @@ on: branches: - main -permissions: - contents: read jobs: call-manifest-pr-action: From 79c543b067832ecbd5774b43887ff236e9027967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:27 +0200 Subject: [PATCH 2979/3334] Revert "[nrf noup] bluetooth: att: Allow ATT sent callback after data TX is done" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 44a465970de240fae2260ea11dec67456ab6de16. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/host/Kconfig.gatt | 14 -------------- subsys/bluetooth/host/att.c | 17 +---------------- subsys/bluetooth/host/conn.c | 27 +++++---------------------- subsys/bluetooth/host/l2cap.c | 10 ++-------- 4 files changed, 8 insertions(+), 60 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index 3403e8d308b8..a04241a3e94f 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -38,20 +38,6 @@ config BT_ATT_RETRY_ON_SEC_ERR If an ATT request fails due to insufficient security, the host will try to elevate the security level and retry the ATT request. -config BT_ATT_SENT_CB_AFTER_TX - bool "Delay ATT sent callback until data transmission is done by controller [EXPERIMENTAL]" - select EXPERIMENTAL - help - By default, the BLE stack calls sent callback for ATT data when the - data is passed to BLE controller for transmission. Enabling this - Kconfig option delays calling the sent callback until data - transmission is finished by BLE controller (the callback is called - upon receiving the Number of Completed Packets HCI Event). - - The feature is not available in Zephyr RTOS (it's specific to NCS - Zephyr fork). It is a temporary solution allowing to control flow of - GATT notifications with HID reports for HID use-case. - 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 ad1d407b71b8..eed079b08fc7 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -396,13 +396,6 @@ static void att_disconnect(struct bt_att_chan *chan) } } -static void chan_sent_cb(struct bt_conn *conn, void *user_data, int err) -{ - struct net_buf *nb = user_data; - - net_buf_unref(nb); -} - /* In case of success the ownership of the buffer is transferred to the stack * which takes care of releasing it when it completes transmitting to the * controller. @@ -496,15 +489,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."); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index ff4dba086e1c..3bb442e3f185 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -699,29 +699,12 @@ 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 (CONFIG_BT_ATT_SENT_CB_AFTER_TX), - * the `chan_send` function from `att.c` introduces 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 (the reference is removed when the TX callback passed - * to `bt_l2cap_send_pdu` is called). - * - * send_buf function can be called multiple times, if buffer - * has to be fragmented over HCI. In that case, the callback - * is provided as an argument only for the last transmitted - * fragment. The `buf->ref == 1` (or 2) check is skipped - * because it's impossible to properly validate number of - * references for the sent fragments if buffers may have the - * additional reference. - * - * Otherwise, check that buf->ref is 1 or 2. It would be 1 - * if this was the only reference (e.g. buf was removed from - * the conn tx_queue). It would be 2 if the tx_data_pull - * kept it on the tx_queue for segmentation. + /* Check that buf->ref is 1 or 2. It would be 1 if this + * was the only reference (e.g. buf was removed + * from the conn tx_queue). It would be 2 if the + * tx_data_pull kept it on the tx_queue for segmentation. */ - __ASSERT_NO_MSG(IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX) || (buf->ref == 1) || - (buf->ref == 2)); + __ASSERT_NO_MSG((buf->ref == 1) || (buf->ref == 2)); /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 3e8e0da251c4..3727345e4ee6 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -778,19 +778,13 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, return -ENOTCONN; } - /* If ATT sent callback is delayed until data transmission is done by BLE controller - * (CONFIG_BT_ATT_SENT_CB_AFTER_TX), the `chan_send` function from `att.c` introduces 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 (the reference is removed when - * the TX callback passed to `bt_l2cap_send_pdu` is called). - */ - 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 f4c47f1231f6e1128f2aff74aeb8738002c7a274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:27 +0200 Subject: [PATCH 2980/3334] Revert "[nrf noup] soc/nordic/nrf54h/pm_s2ram: S2RAM resume hardening" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8b6ec77050bf145329f52f51417fe53940dbcf95. Signed-off-by: Andrzej Głąbek --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 14 -------------- soc/nordic/nrf54h/pm_s2ram.c | 14 -------------- soc/nordic/nrf54h/pm_s2ram.h | 7 ------- 3 files changed, 35 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index da4dbf236406..c534e1bd91c8 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -358,20 +358,6 @@ zephyr_udc0: &usbhs { zephyr,memory-region = "PMLocalRamfunc"; }; - /* temporary stack for S2RAM resume logic */ - pm_s2ram_stack: cpuapp_s2ram_stack@22007fc8 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fc8 16>; - zephyr,memory-region = "pm_s2ram_stack"; - }; - - /* run-time common mcuboot S2RAM support section */ - mcuboot_s2ram: cpuapp_s2ram@22007fd8 { - compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fd8 8>; - zephyr,memory-region = "mcuboot_s2ram_context"; - }; - /* run-time common S2RAM cpu context RAM */ pm_s2ram: cpuapp_s2ram@7fe0 { compatible = "zephyr,memory-region", "mmio-sram"; diff --git a/soc/nordic/nrf54h/pm_s2ram.c b/soc/nordic/nrf54h/pm_s2ram.c index 08be128ac432..d8bb0fc4cd54 100644 --- a/soc/nordic/nrf54h/pm_s2ram.c +++ b/soc/nordic/nrf54h/pm_s2ram.c @@ -77,24 +77,10 @@ static void fpu_power_up(void) } #endif /* defined(CONFIG_FPU) */ -#if DT_NODE_EXISTS(DT_NODELABEL(mcuboot_s2ram)) &&\ - DT_NODE_HAS_COMPAT(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region) -/* Linker section name is given by `zephyr,memory-region` property of - * `zephyr,memory-region` compatible DT node with nodelabel `mcuboot_s2ram`. - */ -__attribute__((section(DT_PROP(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region)))) -volatile struct mcuboot_resume_s _mcuboot_resume; - -#define SET_MCUBOOT_RESUME_MAGIC() _mcuboot_resume.magic = MCUBOOT_S2RAM_RESUME_MAGIC -#else -#define SET_MCUBOOT_RESUME_MAGIC() -#endif - int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) { int ret; - SET_MCUBOOT_RESUME_MAGIC(); z_arm_save_scb_context(&backup_data.scb_context); #if defined(CONFIG_FPU) #if !defined(CONFIG_FPU_SHARING) diff --git a/soc/nordic/nrf54h/pm_s2ram.h b/soc/nordic/nrf54h/pm_s2ram.h index 01c098ea4310..565afad6ca10 100644 --- a/soc/nordic/nrf54h/pm_s2ram.h +++ b/soc/nordic/nrf54h/pm_s2ram.h @@ -10,13 +10,6 @@ #ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ #define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ -#define MCUBOOT_S2RAM_RESUME_MAGIC 0x75832419 - -struct mcuboot_resume_s { - uint32_t magic; /* magic value to identify valid structure */ - uint32_t slot_info; -}; - /** * @brief Save CPU state on suspend * From 5901f5d4d82d87916df61721eb10a08a800aa589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:28 +0200 Subject: [PATCH 2981/3334] Revert "[nrf noup] scripts: ci: check_compliance: Exclude some docs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 74ca5f8e85863415b4a3f8c1cbf8c62e6e2e3ae1. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index fc4c73e7285b..16abcab9c6fc 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1457,10 +1457,6 @@ def check_no_undef_outside_kconfig(self, kconf): "--", ":!/doc/releases", ":!/doc/security/vulnerabilities.rst", - ":!/doc/nrf/releases_and_maturity", - ":!/doc/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.rst", - ":!/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst", - ":!/doc/nrf-bm/release_notes", cwd=GIT_TOP, ) From 9d04800c5e1d4b1b3edbb92ea68369b5517fdff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:28 +0200 Subject: [PATCH 2982/3334] Revert "[nrf noup] scripts: ci: check_compliance: Add undefined Kconfigs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fe5d6adc277a9078d56591128898a1c16eb2f751. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 75 ---------------------------------- 1 file changed, 75 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 16abcab9c6fc..508915ce0ede 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1667,81 +1667,6 @@ def check_no_undef_outside_kconfig(self, kconf): "ZTEST_FAIL_TEST_", # regex in tests/ztest/fail/CMakeLists.txt "ZVFS_OPEN_ADD_SIZE_", # Used as an option matching prefix # zephyr-keep-sorted-stop - - # NCS-specific allow list - # zephyr-keep-sorted-start re(^\s+") - "APPLICATION", # Example documentation - "BAR", # Example documentation - "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation - "BT_ADV_PROV_", # Documentation - "BT_CTLR_TX_PWR_MINUS", # CHIP documentation - "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation - "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo - "CHANNEL", # NRF desktop - "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop - "CHANNEL_TRANSPORT_DISABLED", # NRF desktop - "CHANNEL_TRANSPORT_IDLE", # NRF desktop - "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop - "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop - "CHIP_DFU_OVER_BT_SMP", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module - "CHIP_MEMORY_PROFILING", # CHIP module - "CHIP_NUS", # CHIP module - "CHIP_NUS_FIXED_PASSKEY", # CHIP module - "CHIP_NUS_MAX_COMMANDS", # CHIP module - "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module - "CHIP_QSPI_NOR", # CHIP module - "CHIP_SPI_NOR", # CHIP module - "CHIP_WIFI", # CHIP module - "DESKTOP_DVFS_STATE_", # NRF desktop - "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop - "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module - "MEMFAULT_", # Documentation - "MEMFAULT_NCS", # Documentation - "MEMFAULT_NCS_", # Documentation - "MY_CUSTOM_CONFIG", # Example documentation - "MY_EXT_API_ENABLED", # Example documentation - "MY_EXT_API_REQUIRED", # Example documentation - "NCS_IS_VARIANT_IMAGE", # Build system defined symbol - "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot - "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot - "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol - "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation - "PM_PARTITION_SIZE", # Used in search link - "PM_PARTITION_SIZE_", # Used in documentation - "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template - "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template - "SOC_NRF54H20_CPUSEC", # Internal - "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal - "STATUS_", # NRF desktop - "STATUS_COUNT", # NRF desktop - "STATUS_DISCONNECTED", # NRF desktop - "STATUS_FETCH", # NRF desktop - "STATUS_GET_BOARD_NAME", # NRF desktop - "STATUS_GET_HWID", # NRF desktop - "STATUS_GET_MAX_MOD_ID", # NRF desktop - "STATUS_GET_PEER", # NRF desktop - "STATUS_GET_PEERS_CACHE", # NRF desktop - "STATUS_INDEX_PEERS", # NRF desktop - "STATUS_LIST", # NRF desktop - "STATUS_PENDING", # NRF desktop - "STATUS_POS", # NRF desktop - "STATUS_REJECT", # NRF desktop - "STATUS_SET", # NRF desktop - "STATUS_SUCCESS", # NRF desktop - "STATUS_TIMEOUT", # NRF desktop - "STATUS_WRITE_FAIL", # NRF desktop - # zephyr-keep-sorted-stop } From 53cb034dbb4fe1f7b4f38dd40f248c022abcafae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:29 +0200 Subject: [PATCH 2983/3334] Revert "[nrf noup] soc: nordic: nrf54l: Add ROM start offset PM override" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cf7c4d33918ef1a43ba573ba6ba5bbc20c8c2a51. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54l/Kconfig.defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index bc7577b7c55e..2cd38dca0e95 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -33,7 +33,6 @@ choice NULL_POINTER_EXCEPTION_DETECTION endchoice config ROM_START_OFFSET - default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # ARM From 2e6a3e67ecfb1987cf6edaf6690b9cb482ff7e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:29 +0200 Subject: [PATCH 2984/3334] Revert "[nrf noup] boards: nordic: nrf7002: Include required headers" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c82c4284bab25b8948ace32edb92e54d04575cd6. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 9c06a17ad7bf..0deb8ccc1bf5 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -7,8 +7,6 @@ /dts-v1/; #include #include "nrf5340_cpuapp_common.dtsi" -#include "nordic/nrf5340_sram_partition.dtsi" -#include "nordic/nrf5340_cpuapp_ns_partition.dtsi" / { model = "Nordic NRF5340 DK NRF5340 Application"; From f3af2c0d65969516fcb8fd503dce4a8485ebd2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:30 +0200 Subject: [PATCH 2985/3334] Revert "[nrf noup] ci: add reopen for manifest-pr action" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 473385a2525eded8462da11820386c6411936c13. Signed-off-by: Andrzej Głąbek --- .github/workflows/manifest-PR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 473301146527..a871aa381ded 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -1,7 +1,7 @@ name: handle manifest PR on: pull_request_target: - types: [opened, synchronize, closed, reopened] + types: [opened, synchronize, closed] branches: - main From 1a854708ddcc1656980a1936526e65c7f040d039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:30 +0200 Subject: [PATCH 2986/3334] Revert "[nrf noup] doc: extensions: kconfig: Add SoC sysbuild Kconfigs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 488c9ff3113181f7ba1826859244f18aae016241. Signed-off-by: Andrzej Głąbek --- doc/_extensions/zephyr/kconfig/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index 98422c8ba2fc..e977a3b734a8 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -114,9 +114,6 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d for folder in soc_folders: f.write('source "' + (Path(folder) / 'Kconfig.soc').as_posix() + '"\n') - if "nordic" in folder: - f.write('osource "' + (Path(folder) / 'Kconfig.sysbuild').as_posix() + '"\n') - with open(Path(td) / "soc" / "Kconfig", "w") as f: for folder in soc_folders: f.write('osource "' + (Path(folder) / 'Kconfig').as_posix() + '"\n') From 7b82e018e65a490f9616181f9c33acb99815b8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:30 +0200 Subject: [PATCH 2987/3334] Revert "[nrf noup] soc: nrf54h: work around missing power domain handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fa2b950dcb37884bf5109f15ebf9e4839895d771. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54h/Kconfig | 5 ----- soc/nordic/nrf54h/soc.c | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 189bb117ebf5..b23ee3f22a0a 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -99,11 +99,6 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT endif # SOC_NRF54H20_CPURAD_ENABLE -config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND - bool "Disable all GPIO pin retention on boot" - default y - depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD - config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index fe664dce6c0d..42a99ab6b246 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -14,7 +14,6 @@ #include #endif -#include #include #include #include @@ -187,17 +186,6 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } - - /* This is a workaround for not yet having upstream patches for properly handling - * pin retention. It should be removed as part of the next upmerge. - */ - if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) { - NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST; - - for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) { - nrf_gpio_port_retain_set(gpio_regs[i], 0); - } - } } #if defined(CONFIG_SOC_LATE_INIT_HOOK) From c623889d1981063047fadbec8fd9453a7228f8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:30 +0200 Subject: [PATCH 2988/3334] Revert "[nrf noup] zms: add lookup cache hash function for legacy ZMS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 56d74c7289c6ac082d95739096a87f7b8f0dbc3c. Signed-off-by: Andrzej Głąbek --- subsys/fs/zms/zms.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/subsys/fs/zms/zms.c b/subsys/fs/zms/zms.c index 80caedca387e..693a7c165e5d 100644 --- a/subsys/fs/zms/zms.c +++ b/subsys/fs/zms/zms.c @@ -13,12 +13,8 @@ #include #include "zms_priv.h" #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS -#ifdef CONFIG_SETTINGS_ZMS_LEGACY -#include -#else #include #endif -#endif #include LOG_MODULE_REGISTER(fs_zms, CONFIG_ZMS_LOG_LEVEL); @@ -36,40 +32,6 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at static inline size_t zms_lookup_cache_pos(zms_id_t id) { #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS -#ifdef CONFIG_SETTINGS_ZMS_LEGACY - /* - * 1. The ZMS settings backend uses up to (ZMS_NAME_ID_OFFSET - 1) ZMS IDs to - store keys and equal number of ZMS IDs to store values. - * 2. For each key-value pair, the value is stored at ZMS ID greater by exactly - * ZMS_NAME_ID_OFFSET than ZMS ID that holds the key. - * 3. The backend tries to minimize the range of ZMS IDs used to store keys. - * That is, ZMS IDs are allocated sequentially, and freed ZMS IDs are reused - * before allocating new ones. - * - * Therefore, to assure the least number of collisions in the lookup cache, - * the least significant bit of the hash indicates whether the given ZMS ID - * represents a key or a value, and remaining bits of the hash are set to - * the ordinal number of the key-value pair. Consequently, the hash function - * provides the following mapping: - * - * 1st settings key => hash 0 - * 1st settings value => hash 1 - * 2nd settings key => hash 2 - * 2nd settings value => hash 3 - * ... - */ - BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAMECNT_ID), "ZMS_NAMECNT_ID is not power of 2"); - BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAME_ID_OFFSET), "ZMS_NAME_ID_OFFSET is not power of 2"); - - uint32_t key_value_bit; - uint32_t key_value_ord; - uint32_t hash; - - key_value_bit = (id >> LOG2(ZMS_NAME_ID_OFFSET)) & 1; - key_value_ord = id & (ZMS_NAME_ID_OFFSET - 1); - - hash = ((key_value_ord << 1) | key_value_bit); -#else /* * 1. Settings subsystem is storing the name ID and the linked list node ID * with only one bit difference at BIT(0). @@ -95,7 +57,6 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; -#endif /* CONFIG_SETTINGS_ZMS_LEGACY */ #elif defined(CONFIG_ZMS_ID_64BIT) /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ From 080060b689b5e3938ebebde07f9fb0bed9f565bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:31 +0200 Subject: [PATCH 2989/3334] Revert "[nrf noup] tests: crypto: Add ENTROPY_GENERATOR in overlays" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a3ea67716178769c447c026b8032fdb65d01029a. Signed-off-by: Andrzej Głąbek --- .../mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ------ .../mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ------ 5 files changed, 30 deletions(-) delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l05dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index 70c601183ddf..000000000000 --- a/tests/crypto/mbedtls_psa/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_ENTROPY_GENERATOR=y From 176eb45e95ebbb0257bf69d622c21a1840e4845d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:31 +0200 Subject: [PATCH 2990/3334] Revert "[nrf noup] tests: secure_storage: fix test w/ ZMS backend on 54L15" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5fe83a2e79854570859ffaa2cbe343a285c22859. Signed-off-by: Andrzej Głąbek --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index c794ea1797e5..6b244a065b65 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -29,7 +29,6 @@ tests: - EXTRA_DTC_OVERLAY_FILE=zms.overlay - EXTRA_CONF_FILE=\ overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf - - SB_CONFIG_PARTITION_MANAGER=n secure_storage.psa.its.secure_storage.store.zms.64-bit_uids: platform_allow: *zms_platform_allow From 80a2a1b35c39795ae02fdf9adc8f5958fd5095f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:31 +0200 Subject: [PATCH 2991/3334] Revert "[nrf noup] samples: bluetooth: mesh: update stack sizes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit abe30cf858dbc18e3fc91951efe7465757dadab7. Signed-off-by: Andrzej Głąbek --- samples/bluetooth/mesh_provisioner/prj.conf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index ba3520610f60..3eb40c7112ce 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -1,10 +1,6 @@ #CONFIG_INIT_STACKS=y -# Stack sizes from thread analysis + 50% margin, rounded to nearest 100 -CONFIG_MAIN_STACK_SIZE=4400 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4800 -CONFIG_BT_MESH_SETTINGS_WORKQ_STACK_SIZE=1700 -CONFIG_BT_MESH_ADV_STACK_SIZE=4000 -CONFIG_BT_RX_STACK_SIZE=3300 +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 # The Bluetooth API should not be used from a preemptive thread: CONFIG_MAIN_THREAD_PRIORITY=-2 From c5737097403f80ac2bd9f2455e1960d50e14565e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:32 +0200 Subject: [PATCH 2992/3334] Revert "[nrf noup] boards: arm: nrf9131ek: enable tfm" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 91df299acf7cce694bd396ae6cf028879c139e27. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf9131ek/Kconfig.defconfig | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index 1a30d006b4c6..e1d8de241c0a 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -8,22 +8,3 @@ config HW_STACK_PROTECTION config BOARD_NRF9131EK select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS - -if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_NRF9131EK_NRF9131_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS From 04d4c7ae9bfa9eeecff76ce456faf0519300241e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:32 +0200 Subject: [PATCH 2993/3334] Revert "[nrf noup] boards: nordic: nrf7002dk: Bring back NS variants" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3f9d391279f88fdbd61da6b63e83c1d9d9259479. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 --- boards/nordic/nrf7002dk/Kconfig | 4 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 72 ------------------- boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 18 +---- boards/nordic/nrf7002dk/board.yml | 4 -- .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ---------- .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 ----- ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 24 ------- .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 ----------- .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 ----- .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 23 ------ 12 files changed, 4 insertions(+), 273 deletions(-) delete mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt deleted file mode 100644 index db20255712bc..000000000000 --- a/boards/nordic/nrf7002dk/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND - CONFIG_BOARD_ENABLE_CPUNET) - zephyr_library() - zephyr_library_sources(nrf5340_cpunet_reset.c) -endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index d4b7030a65ab..fa6c8097ae32 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,9 +10,7 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 config BT_HCI_IPC default y if BT diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig index 8eee0dcdf3da..a6cf1d7fbca1 100644 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -16,75 +16,3 @@ config SPI_NOR_FLASH_LAYOUT_PAGE_SIZE endif # SPI_NOR endif # BOARD_NRF7002DK - -if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -# By default, if we build for a Non-Secure version of the board, -# force building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -# Code Partition: -# -# For the secure version of the board the firmware is linked at the beginning -# of the flash, or into the code-partition defined in DT if it is intended to -# be loaded by MCUboot. If the secure firmware is to be combined with a non- -# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always -# be restricted to the size of its code partition. -# -# For the non-secure version of the board, the firmware -# must be linked into the code-partition (non-secure) defined in DT, regardless. -# Apply this configuration below by setting the Kconfig symbols used by -# the linker according to the information extracted from DT partitions. - -# SRAM Partition: -# -# If the secure firmware is to be combined with a non-secure image -# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always -# be restricted to the secure image SRAM partition (sram-secure-partition). -# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram -# may be used by the image. -# -# For the non-secure version of the board, the firmware image SRAM is -# always restricted to the allocated non-secure SRAM partition. -# -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - -if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ - TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif - -if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif - -endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 91f52ee6f08c..61b9e818f367 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,6 +4,4 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index 11a27910eebc..f85bbc86f485 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,24 +1,10 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) - set(TFM_PUBLIC_KEY_FORMAT "full") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -endif() - -if(CONFIG_TFM_FLASH_MERGED_BINARY) - set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 39db5dcfa3a7..4f41341e4423 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,9 +5,5 @@ board: socs: - name: nrf5340 variants: - - name: ns - cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp - variants: - - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts deleted file mode 100644 index 5ff28accf3fc..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dtsi" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - zephyr,wifi = &wlan0; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; -}; - -&qspi { - nrf70: nrf7001@1 { - compatible = "nordic,nrf7001-qspi"; - status = "okay"; - reg = <1>; - qspi-frequency = <24000000>; - qspi-quad-mode; - - #include "nrf70_common.dtsi" - }; -}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml deleted file mode 100644 index 165759691260..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns -name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usbd - - usb_device - - netif:openthread -vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig deleted file mode 100644 index 2c435653140a..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts deleted file mode 100644 index 0deb8ccc1bf5..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dtsi" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns_app; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - zephyr,wifi = &wlan0; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; -}; - -&qspi { - nrf70: nrf7002@1 { - compatible = "nordic,nrf7002-qspi"; - status = "okay"; - reg = <1>; - qspi-frequency = <24000000>; - qspi-quad-mode; - - #include "nrf70_common.dtsi" - #include "nrf70_common_5g.dtsi" - }; -}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml deleted file mode 100644 index ea43785b4559..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk/nrf5340/cpuapp/ns -name: NRF7002-DK-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usbd - - usb_device - - netif:openthread -vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig deleted file mode 100644 index 1886b926bfd5..000000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig +++ /dev/null @@ -1,23 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y From 001f3e75f3fe70565d54551b753b4d613483b5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:33 +0200 Subject: [PATCH 2994/3334] Revert "[nrf noup] modules: hal_nordic: require nrf-regtool" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c4820ccff3ca439ed5b3ead210f9f08d476372cd. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index 83354b9d2f64..a49aec6406fa 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -14,7 +14,6 @@ if(CONFIG_NRF_REGTOOL_GENERATE_UICR) endif() if(DEFINED nrf_regtool_components) find_package(nrf-regtool 9.2.0 - REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From 312375a8ce419d8ddda1e51e2060c7eb364d0e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:33 +0200 Subject: [PATCH 2995/3334] Revert "[nrf noup] samples: lwm2m_client: Add support for nRF91x" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3f93b67ecb00dc744fa3cc7fe048640ad0470f05. Signed-off-by: Andrzej Głąbek --- samples/net/lwm2m_client/overlay-nrf91x.conf | 53 -------------------- 1 file changed, 53 deletions(-) delete mode 100644 samples/net/lwm2m_client/overlay-nrf91x.conf diff --git a/samples/net/lwm2m_client/overlay-nrf91x.conf b/samples/net/lwm2m_client/overlay-nrf91x.conf deleted file mode 100644 index 7b902178e078..000000000000 --- a/samples/net/lwm2m_client/overlay-nrf91x.conf +++ /dev/null @@ -1,53 +0,0 @@ -# Configuration file for nRF91x -# This file is merged with prj.conf in the application folder, and options -# set here will take precedence if they are present in both files. - -# General -CONFIG_MAIN_STACK_SIZE=4096 - -CONFIG_NET_SOCKETS=y -CONFIG_NET_NATIVE=y -CONFIG_NET_SOCKETS_OFFLOAD=y - -CONFIG_NET_CONFIG_MY_IPV6_ADDR="" -CONFIG_NET_CONFIG_PEER_IPV6_ADDR="" -CONFIG_NET_CONFIG_MY_IPV4_ADDR="" -CONFIG_NET_CONFIG_MY_IPV4_GW="" - -CONFIG_NET_CONFIG_NEED_IPV6=n -CONFIG_NET_CONFIG_NEED_IPV4=n -CONFIG_NET_CONFIG_AUTO_INIT=n - -# Modem related configurations -CONFIG_NRF_MODEM_LIB_NET_IF=y -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_DOWN=n -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n -CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=n -CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y - -CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=n -CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=n - -# Disable Duplicate Address Detection (DAD) -# due to not being properly implemented for offloaded interfaces. -CONFIG_NET_IPV6_NBR_CACHE=n -CONFIG_NET_IPV6_MLD=n - -# Zephyr NET Connection Manager and Connectivity layer. -CONFIG_NET_CONNECTION_MANAGER=y -CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024 - -CONFIG_NET_SAMPLE_LWM2M_ID="nrf91x" -CONFIG_NET_SAMPLE_LWM2M_SERVER="coaps://leshan.eclipseprojects.io:5684" -CONFIG_LWM2M_DNS_SUPPORT=y - -## Enable DTLS support -CONFIG_LWM2M_DTLS_SUPPORT=y -CONFIG_LWM2M_TLS_SESSION_CACHING=y -CONFIG_LWM2M_DTLS_CID=y -CONFIG_TLS_CREDENTIALS=y - -## Crypto -CONFIG_OBERON_BACKEND=y -CONFIG_NORDIC_SECURITY_BACKEND=y -CONFIG_MBEDTLS_SHA256_C=y From 8d73f265db4a1cd1d1f64dea4a6b827f2c216704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:34 +0200 Subject: [PATCH 2996/3334] Revert "[nrf noup] ci: update test_spec label for E2E DFU tests" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 23af03a7bc8c90df329a7aa907c7f4c96311a3ab. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 76def875e0be..5337249f7dab 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -49,33 +49,6 @@ - "tests/subsys/dfu/**/*" - "tests/subsys/mgmt/mcumgr/**/*" -"CI-dfu-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/**/*" - - "drivers/console/**/*" - - "drivers/flash/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/spi/**/*" - - "dts/arm/nordic/nrf54h*" - - "dts/common/nordic/*" - - "dts/riscv/nordic/nrf54h*" - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "include/zephyr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" - - "scripts/west_commands/runners/nrfutil.py" - - "soc/nordic/nrf54h/**/*" - - "subsys/bluetooth/**/*" - - "subsys/dfu/**/*" - - "subsys/logging/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "subsys/tracing/**/*" - "CI-tfm-test": - "boards/nordic/nrf5340dk/**/*" - "boards/nordic/nrf9160dk/**/*" From 65c89aedcc7eecefa7102da9d06236b59bacbc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:34 +0200 Subject: [PATCH 2997/3334] Revert "[nrf noup] boards: xiao_ble: Add static partition manager configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0128a91146232d6337b6c9cbe16b3039dc629139. Signed-off-by: Andrzej Głąbek --- boards/seeed/xiao_ble/pm_static.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 boards/seeed/xiao_ble/pm_static.yml diff --git a/boards/seeed/xiao_ble/pm_static.yml b/boards/seeed/xiao_ble/pm_static.yml deleted file mode 100644 index 02915293177c..000000000000 --- a/boards/seeed/xiao_ble/pm_static.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Mirror of partitions defined in nrf52840_partition_uf2_sdv7.dtsi -# Default flash layout for nrf52840 using UF2 and SoftDevice s140 v7 - -softdevice_reserved: - address: 0x00 - size: 0x27000 - -app: - address: 0x27000 - size: 0xC5000 - -settings_storage: - address: 0xEC000 - size: 0x8000 - -uf2_partition: - address: 0xF4000 - size: 0xC000 From 6fde3d4d47e7ed93060740e871db603b9815e9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:35 +0200 Subject: [PATCH 2998/3334] Revert "[nrf noup] boards: nrf54h20dk: Enable default images for sysbuild" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bc0141cf74fe34a34dc5bde3e533bb3b4131669b. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf54h20dk/Kconfig.sysbuild | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 boards/nordic/nrf54h20dk/Kconfig.sysbuild diff --git a/boards/nordic/nrf54h20dk/Kconfig.sysbuild b/boards/nordic/nrf54h20dk/Kconfig.sysbuild deleted file mode 100644 index 29bd62b49927..000000000000 --- a/boards/nordic/nrf54h20dk/Kconfig.sysbuild +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2025 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF54H20DK_NRF54H20_CPURAD - -config NRF_DEFAULT_EMPTY - default y - -endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From ac99d110580ee957142fa4c3ffa4bb12747cb03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:35 +0200 Subject: [PATCH 2999/3334] Revert "[nrf noup] zephyr: doc: fix board page" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3b01d333a7e135b5dfda4f8c48a050e68543d627. Signed-off-by: Andrzej Głąbek --- boards/index.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/boards/index.rst b/boards/index.rst index 2ffe426fc24b..3cc92770cfeb 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -12,8 +12,33 @@ template available under :zephyr_file:`doc/templates/board.tmpl`. Shields are hardware add-ons that can be stacked on top of a board to add extra functionality. Refer to the :ref:`shield_porting_guide` for more information on how to port a shield. +.. admonition:: Search Tips + :class: dropdown + + * Use the form below to filter the list of supported boards and shields. If a field is left + empty, it will not be used in the filtering process. + + * Filtering by name and vendor is available for both boards and shields. The rest of the fields + apply only to boards. + + * A board/shield must meet **all** criteria selected across different fields. For example, if you + select both a vendor and an architecture, only boards that match both will be displayed. Within + a single field, selecting multiple options (such as two architectures) will show boards + matching **either** option. + + * The list of supported hardware features for each board is automatically generated using + information from the Devicetree. It may not be reflecting the full list of supported features + since some of them may not be enabled by default. + + * Can't find your exact board? Don't worry! If a similar board with the same or a closely related + MCU exists, you can use it as a :ref:`starting point ` for adding + support for your own board. + .. toctree:: :maxdepth: 2 :glob: + :hidden: */index + +.. zephyr:board-catalog:: From 0659f3f02ff01571fec0632b7cd1de601b1719ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:35 +0200 Subject: [PATCH 3000/3334] Revert "[nrf noup] ci: Update CI-boot-test patterns and remove SUIT labels" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f2b86e03f7a4c9d7d2a0d066f2fa719300e70dcf. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5337249f7dab..6da6bdbaa87d 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,7 +39,6 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": - - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" @@ -365,3 +364,29 @@ - "tests/boards/nordic/**/*" - "tests/drivers/**/*" - "tests/kernel/**/*" + +"CI-suit-dfu-test": + - "subsys/mgmt/mcumgr/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "subsys/bluetooth/**/*" + - "drivers/bluetooth/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/console/**/*" + - "drivers/gpio/**/*" + - "dts/common/nordic/*" + - "dts/arm/nordic/nrf54h*/**/*" + - "dts/riscv/nordic/nrf54h*/**/*" + - "boards/nordic/nrf54h*/**/*" + - "soc/nordic/nrf54h/**/*" + - "include/zephyr/**/*" + - "subsys/logging/**/*" + - "subsys/tracing/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/nrfutil.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" From 5633f9cddc9601198ed027665d74764224acd31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:36 +0200 Subject: [PATCH 3001/3334] Revert "[nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 666ffc1eb2120511c224e3cbceb349572d74adb1. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 508915ce0ede..1db5b2e9cfc8 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1741,32 +1741,6 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop - - # NCS-specific allowlist - # zephyr-keep-sorted-start re(^\s+") - "APP_CPUNET_RUN", # Used by sample - "APP_DFU", # Used by sample - "BT_FAST_PAIR", # Legacy/removed, used in migration documentation - "COMP_DATA_LAYOUT_ARRAY", # Used by test - "COMP_DATA_LAYOUT_MULTIPLE", # Used by test - "COMP_DATA_LAYOUT_SINGLE", # Used by test - "DTM_NO_DFE", # Used by DTM application - "DTM_TRANSPORT_HCI", # Used by DTM application - "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation - "INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation - "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "ML_APP_REMOTE_BOARD", # Used by machine learning application - "MY_APP_IMAGE_ABC", # Used in documentation - "NETCORE_ABC", # Used in documentation - "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests - "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation - "SUIT_ENVELOPE_", # Used by jinja - "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation - "SUIT_MPI_", # Used by jinja - "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation - "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample - # zephyr-keep-sorted-stop } From 5f96692f091830ac41e10be8865c242b61c58739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:36 +0200 Subject: [PATCH 3002/3334] Revert "[nrf noup] ci: NCS-specific CI tweaks" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7de0c8423dee010ff70a411f5788bd9a9149b4d7. Signed-off-by: Andrzej Głąbek --- .github/workflows/commit-tags.yml | 28 -------------------------- .github/workflows/compliance.yml | 13 +++++++----- Jenkinsfile | 5 ----- scripts/gitlint/zephyr_commit_rules.py | 4 ++-- 4 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/commit-tags.yml delete mode 100644 Jenkinsfile diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml deleted file mode 100644 index 828f02971678..000000000000 --- a/.github/workflows/commit-tags.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Commit tags - -on: - pull_request: - types: [synchronize, opened, reopened, edited, labeled, unlabeled, - milestoned, demilestoned, assigned, unassigned, ready_for_review, - review_requested] - -jobs: - commit_tags: - runs-on: ubuntu-22.04 - name: Run commit tags checks on patch series (PR) - steps: - - name: Update PATH for west - run: | - echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Checkout the code - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - - name: Run the commit tags - uses: nrfconnect/action-commit-tags@main - with: - target: . - upstream: zephyrproject-rtos/zephyr/main diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 31b87304960f..26e41485ef67 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -34,8 +34,8 @@ jobs: git config --global user.name "Your Name" git remote -v # Ensure there's no merge commits in the PR - #[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ - #(echo "::error ::Merge commits not allowed, rebase instead";false) + [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ + (echo "::error ::Merge commits not allowed, rebase instead";false) rm -fr ".git/rebase-apply" rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} @@ -83,9 +83,12 @@ jobs: git log --pretty=oneline | head -n 10 # Increase rename limit to allow for large PRs git config diff.renameLimit 10000 - ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic \ - -e Kconfig -e SysbuildKconfig -e KconfigBasicNoModules -e SysbuildKconfigBasicNoModules \ - -e ModulesMaintainers -c origin/${BASE_REF}.. + excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat" + # The signed-off-by check for dependabot should be skipped + if [ "${{ github.actor }}" == "dependabot[bot]" ]; then + excludes="$excludes -e Identity" + fi + ./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3b9cf0022399..000000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,5 +0,0 @@ -@Library("CI_LIB") _ - -def pipeline = new ncs.sdk_zephyr.Main() - -pipeline.run(JOB_NAME) diff --git a/scripts/gitlint/zephyr_commit_rules.py b/scripts/gitlint/zephyr_commit_rules.py index ef317e22684c..a2c9cd3cb7fe 100644 --- a/scripts/gitlint/zephyr_commit_rules.py +++ b/scripts/gitlint/zephyr_commit_rules.py @@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule): name = "title-max-length-no-revert" id = "UC5" target = CommitMessageTitle - options_spec = [IntOption('line-length', 120, "Max line length")] + options_spec = [IntOption('line-length', 75, "Max line length")] violation_message = "Commit title exceeds max length ({0}>{1})" def validate(self, line, _commit): @@ -103,7 +103,7 @@ class MaxLineLengthExceptions(LineRule): name = "max-line-length-with-exceptions" id = "UC4" target = CommitMessageBody - options_spec = [IntOption('line-length', 120, "Max line length")] + options_spec = [IntOption('line-length', 75, "Max line length")] violation_message = "Commit message body line exceeds max length ({0}>{1})" def validate(self, line, _commit): From a31cf2b3592720a73620f8e02b1b1da25c95a0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:36 +0200 Subject: [PATCH 3003/3334] Revert "[nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 60e3e915b4e664e0724ae4a83f10f8c73de0d268. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 ---- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 ------- tests/bluetooth/tester/sysbuild.cmake | 7 ++++ .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 40 ------------------- .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 13 ------ .../tester/sysbuild/hci_ipc/prj.conf | 23 ----------- 6 files changed, 7 insertions(+), 97 deletions(-) delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay delete mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 51b0ef5fa8d4..5bb1c4d82846 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -22,10 +22,3 @@ CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_BTTESTER_LOG_LEVEL_DBG=y CONFIG_UART_INTERRUPT_DRIVEN=y - -# Enable PSA RNG -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n -CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 4f9de686b7e5..e6d4f675f57a 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,17 +12,3 @@ status = "okay"; hw-flow-control; }; - -// Enable PSA RNG -/ { - chosen { - zephyr,entropy = &psa_rng; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; - - /delete-node/ prng; -}; diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index b4c05e1ee4aa..b480fa4ee449 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -18,6 +18,13 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) ) endif() + if(SB_CONFIG_SOC_NRF54H20_CPUAPP) + set(${NET_APP}_CONF_FILE + ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf + CACHE INTERNAL "" + ) + endif() + set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index b7d64a9e6a08..000000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,40 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_ISR_STACK_SIZE=1024 -CONFIG_IDLE_STACK_SIZE=256 -CONFIG_MAIN_STACK_SIZE=1024 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=8192 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y - -CONFIG_BT_BUF_EVT_RX_COUNT=16 -CONFIG_BT_BUF_EVT_RX_SIZE=255 -CONFIG_BT_BUF_ACL_RX_SIZE=255 -CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_BUF_CMD_TX_SIZE=255 - -# Host -CONFIG_BT_BROADCASTER=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_OBSERVER=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_EXT_ADV=y -CONFIG_BT_PER_ADV=y -CONFIG_BT_PER_ADV_SYNC=y - -# Controller -CONFIG_BT_LL_SW_SPLIT=n -CONFIG_BT_LL_SOFTDEVICE=y -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 -CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 - -# Enable PSA RNG -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n -CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay deleted file mode 100644 index e34567fe834a..000000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ /dev/null @@ -1,13 +0,0 @@ -// Enable PSA RNG -/ { - chosen { - zephyr,entropy = &psa_rng; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; - - /delete-node/ prng; -}; diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf deleted file mode 100644 index 08b1aed9e7f6..000000000000 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf +++ /dev/null @@ -1,23 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_HEAP_MEM_POOL_SIZE=4096 - -CONFIG_MAIN_STACK_SIZE=512 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y -CONFIG_BT_MAX_CONN=16 - - -# Workaround: Unable to allocate command buffer when using K_NO_WAIT since -# Host number of completed commands does not follow normal flow control. -CONFIG_BT_BUF_CMD_TX_COUNT=10 - -# Enable and adjust the below value as necessary -# CONFIG_BT_BUF_EVT_RX_COUNT=16 -# CONFIG_BT_BUF_EVT_RX_SIZE=255 -# CONFIG_BT_BUF_ACL_RX_SIZE=255 -# CONFIG_BT_BUF_ACL_TX_SIZE=251 -# CONFIG_BT_BUF_CMD_TX_SIZE=255 From 1fdf8149f2f75cad90d24649d14a66600963bd5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:37 +0200 Subject: [PATCH 3004/3334] Revert "[nrf noup] Bluetooth: update experimental for qualification" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f23942a502af928620fe745e9d0ae23b68e1e9c8. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/controller/Kconfig | 4 +--- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index abffc5faa164..0d5cba824162 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -141,12 +141,10 @@ config HAS_BT_CTLR bool config BT_LL_SW_SPLIT - bool "Software-based Bluetooth LE Link Layer [EXPERIMENTAL]" + bool "Software-based Bluetooth LE Link Layer" default y depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED select HAS_BT_CTLR - select EXPERIMENTAL - select ENTROPY_GENERATOR help Use Zephyr software Bluetooth LE Link Layer ULL LLL split implementation. diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index 34e862378c5e..2841e7d8a129 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -52,7 +52,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" + bool "L2CAP Enhanced Credit Based Flow Control support" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From 5d447f42083db614c5a20f3826c96a455e723da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:37 +0200 Subject: [PATCH 3005/3334] Revert "[nrf noup] drivers: spi_dw: Bring back custom EXMIF peripheral handling" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5878b1b0004b5b86e4b3c54bef9b0071cdca4554. Signed-off-by: Andrzej Głąbek --- drivers/pinctrl/pinctrl_nrf.c | 3 +- drivers/spi/spi_dw.c | 32 +--------------------- dts/bindings/spi/nordic,nrf-exmif-spi.yaml | 8 ------ 3 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 dts/bindings/spi/nordic,nrf-exmif-spi.yaml diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index b052e61eb803..a9902d33f801 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -468,8 +468,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) || \ - DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif_spi) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) /* Pin routing is controlled by secure domain, via UICR */ case NRF_FUN_EXMIF_CK: case NRF_FUN_EXMIF_DQ0: diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index ac703af10f91..9f00905a3f02 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -41,14 +41,6 @@ LOG_MODULE_REGISTER(spi_dw); #include #endif -#ifdef CONFIG_HAS_NRFX -#include -#endif - -#ifdef CONFIG_SOC_NRF54H20_GPD -#include -#endif - static inline bool spi_dw_is_slave(struct spi_dw_data *spi) { return (IS_ENABLED(CONFIG_SPI_SLAVE) && @@ -266,7 +258,6 @@ static int spi_dw_configure(const struct device *dev, /* Baud rate and Slave select, for master only */ write_baudr(dev, SPI_DW_CLK_DIVIDER(info->clock_frequency, config->frequency)); - write_ser(dev, BIT(config->slave)); } if (spi_dw_is_slave(spi)) { @@ -521,10 +512,6 @@ void spi_dw_isr(const struct device *dev) uint32_t int_status; int error; -#ifdef CONFIG_HAS_NRFX - NRF_EXMIF->EVENTS_CORE = 0; -#endif - int_status = read_isr(dev); LOG_DBG("SPI %p int_status 0x%x - (tx: %d, rx: %d)", dev, int_status, @@ -573,18 +560,6 @@ int spi_dw_init(const struct device *dev) DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); -#ifdef CONFIG_HAS_NRFX - NRF_EXMIF->INTENSET = BIT(0); - NRF_EXMIF->TASKS_START = 1; - -#ifdef CONFIG_SOC_NRF54H20_GPD - err = nrf_gpd_request(NRF_GPD_FAST_ACTIVE1); - if (err < 0) { - return err; - } -#endif -#endif - info->config_func(); /* Masking interrupt and making sure controller is disabled */ @@ -611,11 +586,6 @@ int spi_dw_init(const struct device *dev) return 0; } -#define REG_ADDR(inst) \ - COND_CODE_1(DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), nordic_nrf_exmif_spi), \ - (Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(core, DT_DRV_INST(inst))), \ - (DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)))) - #define SPI_CFG_IRQS_SINGLE_ERR_LINE(inst) \ IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, rx_avail, irq), \ DT_INST_IRQ_BY_NAME(inst, rx_avail, priority), \ @@ -688,7 +658,7 @@ COND_CODE_1(IS_EQ(DT_NUM_IRQS(DT_DRV_INST(inst)), 1), \ SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ }; \ static const struct spi_dw_config spi_dw_config_##inst = { \ - REG_ADDR(inst), \ + DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ .clock_frequency = COND_CODE_1( \ DT_NODE_HAS_PROP(DT_INST_PHANDLE(inst, clocks), clock_frequency), \ (DT_INST_PROP_BY_PHANDLE(inst, clocks, clock_frequency)), \ diff --git a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml deleted file mode 100644 index d988b4146878..000000000000 --- a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic External Memory Interface (EXMIF) used in SPI mode only - -compatible: "nordic,nrf-exmif-spi" - -include: snps,designware-spi.yaml From 19cb8fee4c48158f1d56192608b2d1ff39be5e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:37 +0200 Subject: [PATCH 3006/3334] Revert "[nrf noup] samples: bluetooth: hci_ipc: increase main stack size for Cracen driver on nRF54H20" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4797b5f214fcd753d3f955c6df083dd67ceb4ec7. Signed-off-by: Andrzej Głąbek --- .../bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index 296e68366389..000000000000 --- a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Increase stack size for Cracen driver. -CONFIG_MAIN_STACK_SIZE=1024 From 3af43abdcf971d6e7737afd09865306feba8470b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:38 +0200 Subject: [PATCH 3007/3334] Revert "[nrf noup] samples: bluetooth: mesh: Disable secure storage for real targets." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 35fcd6ef1e872b5b5549049e9a702904abcd9377. Signed-off-by: Andrzej Głąbek --- samples/bluetooth/mesh/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh/prj.conf | 2 +- samples/bluetooth/mesh_demo/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh_demo/prj.conf | 2 +- samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh_provisioner/prj.conf | 2 +- samples/boards/nordic/mesh/onoff-app/prj.conf | 2 +- .../nordic/mesh/onoff_level_lighting_vnd_app/prj.conf | 2 +- tests/bluetooth/mesh_shell/boards/qemu_x86.conf | 6 ------ tests/bluetooth/mesh_shell/prj.conf | 2 +- 10 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 samples/bluetooth/mesh/boards/qemu_x86.conf delete mode 100644 samples/bluetooth/mesh_demo/boards/qemu_x86.conf delete mode 100644 samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf delete mode 100644 tests/bluetooth/mesh_shell/boards/qemu_x86.conf diff --git a/samples/bluetooth/mesh/boards/qemu_x86.conf b/samples/bluetooth/mesh/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh/prj.conf b/samples/bluetooth/mesh/prj.conf index cd7d6532b614..14b19316a866 100644 --- a/samples/bluetooth/mesh/prj.conf +++ b/samples/bluetooth/mesh/prj.conf @@ -5,7 +5,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_HWINFO=y CONFIG_BT=y diff --git a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_demo/prj.conf b/samples/bluetooth/mesh_demo/prj.conf index b7016b02c65b..bcb738ae5bd1 100644 --- a/samples/bluetooth/mesh_demo/prj.conf +++ b/samples/bluetooth/mesh_demo/prj.conf @@ -31,7 +31,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y # Limit the number of key slots in PSA Crypto core to reduce # RAM footprint diff --git a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 3eb40c7112ce..0fb814adcd4c 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -46,7 +46,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y #CONFIG_BT_MESH_LOG_LEVEL_DBG=y #CONFIG_BT_MESH_SETTINGS_LOG_LEVEL_DBG=y diff --git a/samples/boards/nordic/mesh/onoff-app/prj.conf b/samples/boards/nordic/mesh/onoff-app/prj.conf index 0783579e795e..0e67042b2653 100644 --- a/samples/boards/nordic/mesh/onoff-app/prj.conf +++ b/samples/boards/nordic/mesh/onoff-app/prj.conf @@ -9,7 +9,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf index 96b5466b4a16..3bb984208c70 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf @@ -7,7 +7,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT_OBSERVER=y CONFIG_BT_BROADCASTER=y diff --git a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index aab2745d359f..2af600295680 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -# CONFIG_SECURE_STORAGE=y +CONFIG_SECURE_STORAGE=y CONFIG_BT=y CONFIG_BT_OBSERVER=y From 3390f05108e870d7907b876e0b3720ee014a0574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:38 +0200 Subject: [PATCH 3008/3334] Revert "[nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5566637e963e25bdba81508558f780d4f9e1470d. Signed-off-by: Andrzej Głąbek --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ------------------ 2 files changed, 1 insertion(+), 949 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 98dacdcfede4..3c410d8af208 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -386,6 +386,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_config_reserved_resources_ncs.h" + default "nrfx_reserved_resources.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h deleted file mode 100644 index ec8a9acaf7b5..000000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h +++ /dev/null @@ -1,948 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ -#define NRFX_CONFIG_RESERVED_RESOURCES_H__ - -/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE130_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) - -/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE131_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) - -/** @brief Bitmask that defines EGU instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_EGUS_USED 0 - -/** @brief Bitmask that defines TIMER instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_TIMERS_USED 0 - -/* If the GRTC system timer driver is to be used, prepare definitions required - * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and - * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. - */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ - (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ - ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ - (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ - DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ - -/* - * The enabled Bluetooth controller subsystem is responsible for providing - * definitions of the BT_CTLR_USED_* symbols used below in a file named - * bt_ctlr_used_resources.h and for adding its location to global include - * paths so that the file can be included here for all Zephyr libraries that - * are to be built. - */ -#if defined(CONFIG_BT_LL_SW_SPLIT) -#include -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#endif -#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ - -#if defined(CONFIG_BT_LL_SOFTDEVICE) -/* Define auxiliary symbols needed for SDC device dispatch. */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRF52_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRF53_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRF54L_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF71X) -#define NRF71_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRF54H_SERIES -#endif -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) -#else -#error Unsupported chip family -#endif -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ - -#if defined(CONFIG_NRF_802154_RADIO_DRIVER) -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#include <../src/nrf_802154_peripherals_nrf52.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#include <../src/nrf_802154_peripherals_nrf53.h> -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#include <../src/nrf_802154_peripherals_nrf54l.h> -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#include <../src/nrf_802154_peripherals_nrf54h.h> -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ - -#if defined(CONFIG_MPSL) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ - (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif - -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL -#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL -#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL -#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL -#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL -#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL -#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL -#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL -#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL -#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL -#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL -#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL -#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL -#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL -#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL -#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL -#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL -#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 -#endif - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) - -BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_CHANNELS_USED \ - (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI0_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_GROUPS_USED \ - (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI0_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_CHANNELS_USED \ - (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI00_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_GROUPS_USED \ - (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI00_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_CHANNELS_USED \ - (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI10_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_GROUPS_USED \ - (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI10_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_CHANNELS_USED \ - (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI20_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_GROUPS_USED \ - (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI20_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_CHANNELS_USED \ - (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI30_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_GROUPS_USED \ - (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI30_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_CHANNELS_USED \ - (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI020_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_GROUPS_USED \ - (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI020_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_CHANNELS_USED \ - (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI030_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_GROUPS_USED \ - (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI030_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_CHANNELS_USED \ - (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI120_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_GROUPS_USED \ - (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI120_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_CHANNELS_USED \ - (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI130_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_GROUPS_USED \ - (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI130_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_CHANNELS_USED \ - (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI131_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_GROUPS_USED \ - (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI131_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_CHANNELS_USED \ - (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI132_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_GROUPS_USED \ - (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI132_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_CHANNELS_USED \ - (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI133_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_GROUPS_USED \ - (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI133_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_CHANNELS_USED \ - (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI134_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_GROUPS_USED \ - (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI134_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_CHANNELS_USED \ - (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI135_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_GROUPS_USED \ - (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI135_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_CHANNELS_USED \ - (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI136_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_GROUPS_USED \ - (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI136_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines PPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_CHANNELS_USED \ - (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) - -#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED -#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED - -/** @brief Bitmask that defines PPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_GROUPS_USED \ - (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) - -#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ - (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ - (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ - (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ - (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ - (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ - (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ - (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ - NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) - -#if defined(CONFIG_SOFTDEVICE) -#include -#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED -#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED -#else -#define NRFX_PPI_CHANNELS_USED_BY_SD 0 -#define NRFX_PPI_GROUPS_USED_BY_SD 0 -#endif - -#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ From 34997bc9ff840e1250d377d9447bb2c2aad6b3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:38 +0200 Subject: [PATCH 3009/3334] Revert "[nrf noup] Revert "mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA"" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1e5e0e36555f53543a7136e7a441e9697592d49. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/Kconfig.mbedtls | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 28b4ffa2ff75..7c66b58f768f 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -271,6 +271,7 @@ config MBEDTLS_SOME_CIPHER_ENABLED config MBEDTLS_CIPHER_AES_ENABLED bool "AES block cipher" + default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C if MBEDTLS_CIPHER_AES_ENABLED From 0a39cc552308598bfdb6c0a727c2eefab081de64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:39 +0200 Subject: [PATCH 3010/3334] Revert "[nrf noup] samples/tests: Add TF-M sysbuild config files" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 20d3749d7abf116dbe240f28a310971f37b30f23. Signed-off-by: Andrzej Głąbek --- samples/subsys/usb/dfu/sysbuild.conf | 1 - tests/drivers/flash/common/sysbuild.conf | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 samples/subsys/usb/dfu/sysbuild.conf create mode 100644 tests/drivers/flash/common/sysbuild.conf diff --git a/samples/subsys/usb/dfu/sysbuild.conf b/samples/subsys/usb/dfu/sysbuild.conf deleted file mode 100644 index 47f00ff3cff8..000000000000 --- a/samples/subsys/usb/dfu/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/drivers/flash/common/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n From db32a734c3b0d09c34434998fb26d8a2429c94fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:39 +0200 Subject: [PATCH 3011/3334] Revert "[nrf noup] soc: nrf54l: Add custom section for KMU" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fbc20243ec195fce829e1355c3bbd9eb1da192d8. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf54l/CMakeLists.txt | 13 ------------- soc/nordic/nrf54l/kmu_push_area_section.ld | 19 ------------------- 2 files changed, 32 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 b220b9d2a7a2..cebbda571b68 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -6,16 +6,3 @@ zephyr_library_sources( ../validate_rram_partitions.c ) zephyr_include_directories(.) - -dt_nodelabel(kmu_push_area_node NODELABEL nrf_kmu_reserved_push_area) - -# We need a buffer in memory in a static location which can be used by -# the KMU peripheral. The KMU has a static destination address, we chose -# this address to be 0x20000000, which is the first address in the SRAM. -if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND NOT kmu_push_area_node) -# 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) - -zephyr_linker_section(NAME ".nrf_kmu_reserved_push_area" ADDRESS "${RAM_ADDR}" GROUP RAM_REGION NOINIT) -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 e8c8cd9f09ad..000000000000 --- 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 dbbfe152ee45388b7eb806247aba5625d768c138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:39 +0200 Subject: [PATCH 3012/3334] Revert "[nrf noup] dts: choose a crypto accelerator for entropy" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2cd9fbbf078302bc397552fa8891570611f4c04a. Signed-off-by: Andrzej Głąbek --- dts/arm/nordic/nrf52840.dtsi | 4 ++-- dts/arm/nordic/nrf5340_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf91.dtsi | 3 +-- soc/nordic/common/Kconfig.peripherals | 6 ++---- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 324f06d0fba9..78fa17809ec6 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -12,7 +12,7 @@ / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -577,7 +577,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 cca54846a8a7..36a44029cfbd 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -34,7 +34,7 @@ }; chosen { - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng_hci; zephyr,flash-controller = &flash_controller; }; @@ -107,7 +107,7 @@ reg = <0x50844000 0x1000>, <0x50845000 0x1000>; reg-names = "wrapper", "core"; interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index b29562185846..8bbd9bcc892d 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -21,7 +21,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &psa_rng; + zephyr,entropy = &rng; }; soc { @@ -37,7 +37,7 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 6baf06e3d4e4..3813c49f38ec 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -28,7 +28,6 @@ }; chosen { - zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -54,7 +53,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 8706c650e0d1..049c3b18afa8 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 82d1cbc4476e08d7ff0e072fb925c5b82d94cb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:40 +0200 Subject: [PATCH 3013/3334] Revert "[nrf noup] Bluetooth: Mesh: Disable processing of ext ADV packets" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6a6f1e49672e1d80594843386f8052e95304ccc3. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/mesh/Kconfig | 11 ----------- subsys/bluetooth/mesh/adv_ext.c | 12 ------------ 2 files changed, 23 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 903bd485b8a5..722bf0bedafb 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -215,17 +215,6 @@ config BT_MESH_ADV_EXT_FRIEND_SEPARATE messages as close to the start of the ReceiveWindow as possible, thus reducing the scanning time on the Low Power node. -config BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS - bool "Reject or accept extended advertising packets" - depends on BT_LL_SOFTDEVICE - help - Configure the scanner and initiator to either reject or accept extended - advertising packets by the SoftDevice Controller. This is set to false - by default, to prevent loss of scan time when receiving a pointer packet - while scanning for Bluetooth Mesh packets. Set to true if extended - advertising packets are to be received by the SoftDevice Controller for - purposes other than Bluetooth Mesh. - endif # BT_MESH_ADV_EXT endchoice diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 0cfaec39fdb7..68a6c27beebf 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -529,18 +529,6 @@ void bt_mesh_adv_init(void) K_PRIO_COOP(MESH_WORKQ_PRIORITY), NULL); k_thread_name_set(&bt_mesh_workq.thread, "BT MESH WQ"); } - -#if defined(CONFIG_BT_LL_SOFTDEVICE) - const sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t cmd_params = { - .accept_ext_adv_packets = IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS), - }; - - int err = sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set(&cmd_params); - - if (err) { - LOG_ERR("Failed to set accept_ext_adv_packets: %d", err); - } -#endif } static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance) From edb35a9a66c4518ef9c50f5b3c66e1aa868c65bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:40 +0200 Subject: [PATCH 3014/3334] Revert "[nrf noup] tests: bluetooth: tester: sysbuild configurable 53/54H" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3765002bf40d5499b4491d69f060457bddece076. Signed-off-by: Andrzej Głąbek --- .../nrf54h20_cpurad-bt_ll_softdevice.conf | 33 ------------------- tests/bluetooth/tester/Kconfig.sysbuild | 1 - tests/bluetooth/tester/sysbuild.cmake | 16 ++------- 3 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf diff --git a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf deleted file mode 100644 index 1f7748e5cd7d..000000000000 --- a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf +++ /dev/null @@ -1,33 +0,0 @@ -CONFIG_IPC_SERVICE=y -CONFIG_MBOX=y - -CONFIG_ISR_STACK_SIZE=1024 -CONFIG_IDLE_STACK_SIZE=256 -CONFIG_MAIN_STACK_SIZE=512 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=8192 - -CONFIG_BT=y -CONFIG_BT_HCI_RAW=y - -CONFIG_BT_BUF_EVT_RX_COUNT=16 -CONFIG_BT_BUF_EVT_RX_SIZE=255 -CONFIG_BT_BUF_ACL_RX_SIZE=255 -CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_BUF_CMD_TX_SIZE=255 - -# Host -CONFIG_BT_BROADCASTER=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_OBSERVER=y -CONFIG_BT_CENTRAL=y -CONFIG_BT_EXT_ADV=y -CONFIG_BT_PER_ADV=y -CONFIG_BT_PER_ADV_SYNC=y - -# Controller -CONFIG_BT_LL_SW_SPLIT=n -CONFIG_BT_LL_SOFTDEVICE=y -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 -CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/tests/bluetooth/tester/Kconfig.sysbuild b/tests/bluetooth/tester/Kconfig.sysbuild index e14a6e1aa8e0..69e4d5a97fbe 100644 --- a/tests/bluetooth/tester/Kconfig.sysbuild +++ b/tests/bluetooth/tester/Kconfig.sysbuild @@ -5,7 +5,6 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string - default "nrf54h20dk/nrf54h20/cpurad" if "$(BOARD)" = "nrf54h20dk" default "nrf5340dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340dk" default "nrf5340_audio_dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340_audio_dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP" diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index b480fa4ee449..b0bb228ab997 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -2,6 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) + # For builds in the nrf5340, we build the netcore image with the controller + set(NET_APP hci_ipc) set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP}) @@ -11,20 +13,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) BOARD ${SB_CONFIG_NET_CORE_BOARD} ) - if(SB_CONFIG_SOC_NRF5340_CPUAPP) - set(${NET_APP}_SNIPPET - "bt-ll-sw-split" - CACHE INTERNAL "" - ) - endif() - - if(SB_CONFIG_SOC_NRF54H20_CPUAPP) - set(${NET_APP}_CONF_FILE - ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf - CACHE INTERNAL "" - ) - endif() - set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" From 804bd4d3d933cc9414a23181dcd0f8abeef822a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:41 +0200 Subject: [PATCH 3015/3334] Revert "[nrf noup] net: tests: crypto: Adding legacy Crypto support ipv6 tests" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d04c0070d2afe69dc8b69d2f1ea1b3cce07a8eb9. Signed-off-by: Andrzej Głąbek --- tests/net/ipv6/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index 6a6be5dba36a..9f9f21d59050 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -33,7 +33,6 @@ CONFIG_NET_IF_MAX_IPV6_COUNT=2 CONFIG_NET_IPV6_PE=y CONFIG_NET_IPV6_PE_FILTER_PREFIX_COUNT=2 CONFIG_NET_IPV6_PE_PREFER_PUBLIC_ADDRESSES=n -CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y # Increase the stack a bit for mps2/an385 CONFIG_NET_RX_STACK_SIZE=1700 From 4c9fc34943e9a9716adb8aff2172f84fda392319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:41 +0200 Subject: [PATCH 3016/3334] Revert "[nrf noup] net: tests: Add legacy crypto API support for big_http_download" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dc583bac9e76382f5171a3db86e856aa6fe72c0e. Signed-off-by: Andrzej Głąbek --- samples/net/sockets/big_http_download/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/net/sockets/big_http_download/prj.conf b/samples/net/sockets/big_http_download/prj.conf index 661ff62e9d92..c623d3b763bf 100644 --- a/samples/net/sockets/big_http_download/prj.conf +++ b/samples/net/sockets/big_http_download/prj.conf @@ -3,7 +3,6 @@ CONFIG_REQUIRES_FULL_LIBC=y CONFIG_PSA_CRYPTO=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_PSA_WANT_ALG_SHA_256=y -CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y CONFIG_MAIN_STACK_SIZE=2536 # Networking config From 08b76ecb8890b1ae707d33d662f00c3994bc4267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:42 +0200 Subject: [PATCH 3017/3334] Revert "[nrf noup] samples: net: Enable Wi-Fi driver in sysbuild builds" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 13946e4ba178943b25d748338156ade2f2ef0a17. Signed-off-by: Andrzej Głąbek --- samples/net/dns_resolve/Kconfig.sysbuild | 13 ------------- samples/net/ipv4_autoconf/Kconfig.sysbuild | 13 ------------- samples/net/lwm2m_client/Kconfig.sysbuild | 13 ------------- samples/net/mdns_responder/Kconfig.sysbuild | 13 ------------- samples/net/mqtt_publisher/Kconfig.sysbuild | 13 ------------- samples/net/mqtt_sn_publisher/Kconfig.sysbuild | 13 ------------- samples/net/sockets/coap_server/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_async/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_client/Kconfig.sysbuild | 13 ------------- samples/net/sockets/echo_server/Kconfig.sysbuild | 13 ------------- samples/net/sockets/http_get/Kconfig.sysbuild | 13 ------------- samples/net/sockets/sntp_client/Kconfig.sysbuild | 13 ------------- samples/net/syslog_net/Kconfig.sysbuild | 13 ------------- samples/net/telnet/Kconfig.sysbuild | 13 ------------- samples/net/wifi/Kconfig.sysbuild | 13 ------------- samples/net/wifi/shell/sample.yaml | 2 -- 16 files changed, 197 deletions(-) delete mode 100644 samples/net/dns_resolve/Kconfig.sysbuild delete mode 100644 samples/net/ipv4_autoconf/Kconfig.sysbuild delete mode 100644 samples/net/lwm2m_client/Kconfig.sysbuild delete mode 100644 samples/net/mdns_responder/Kconfig.sysbuild delete mode 100644 samples/net/mqtt_publisher/Kconfig.sysbuild delete mode 100644 samples/net/mqtt_sn_publisher/Kconfig.sysbuild delete mode 100644 samples/net/sockets/coap_server/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_async/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_client/Kconfig.sysbuild delete mode 100644 samples/net/sockets/echo_server/Kconfig.sysbuild delete mode 100644 samples/net/sockets/http_get/Kconfig.sysbuild delete mode 100644 samples/net/sockets/sntp_client/Kconfig.sysbuild delete mode 100644 samples/net/syslog_net/Kconfig.sysbuild delete mode 100644 samples/net/telnet/Kconfig.sysbuild delete mode 100644 samples/net/wifi/Kconfig.sysbuild diff --git a/samples/net/dns_resolve/Kconfig.sysbuild b/samples/net/dns_resolve/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/dns_resolve/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/ipv4_autoconf/Kconfig.sysbuild b/samples/net/ipv4_autoconf/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/ipv4_autoconf/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/lwm2m_client/Kconfig.sysbuild b/samples/net/lwm2m_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/lwm2m_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mdns_responder/Kconfig.sysbuild b/samples/net/mdns_responder/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/mdns_responder/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_publisher/Kconfig.sysbuild b/samples/net/mqtt_publisher/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/mqtt_publisher/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/coap_server/Kconfig.sysbuild b/samples/net/sockets/coap_server/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/coap_server/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_async/Kconfig.sysbuild b/samples/net/sockets/echo_async/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/echo_async/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_client/Kconfig.sysbuild b/samples/net/sockets/echo_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/echo_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_server/Kconfig.sysbuild b/samples/net/sockets/echo_server/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/echo_server/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/http_get/Kconfig.sysbuild b/samples/net/sockets/http_get/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/http_get/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/sntp_client/Kconfig.sysbuild b/samples/net/sockets/sntp_client/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/sockets/sntp_client/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/syslog_net/Kconfig.sysbuild b/samples/net/syslog_net/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/syslog_net/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/telnet/Kconfig.sysbuild b/samples/net/telnet/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/telnet/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/Kconfig.sysbuild b/samples/net/wifi/Kconfig.sysbuild deleted file mode 100644 index 158551060c56..000000000000 --- a/samples/net/wifi/Kconfig.sysbuild +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -config WIFI_NRF70 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index ce8ec12b1441..1121b4fa6cef 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -58,7 +58,6 @@ tests: - nrf7002dk/nrf5340/cpuapp/nrf7001 sample.net.wifi.nrf7002ek: extra_args: - - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002ek platform_allow: @@ -70,7 +69,6 @@ tests: sample.net.wifi.nrf7002eb: extra_args: - CONFIG_NRF70_UTIL=y - - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002eb platform_allow: From fa9d9a182e904ebc8dd15910e79cbb9152b47732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:42 +0200 Subject: [PATCH 3018/3334] Revert "[nrf noup] lib: os: zvfs: Remove EXPERIMENTAL from ZVFS" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8cb052488688da59da7d4fab4f75cd193697338c. Signed-off-by: Andrzej Głąbek --- lib/os/zvfs/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index 420d6bc41333..d7b6914cb5d8 100644 --- a/lib/os/zvfs/Kconfig +++ b/lib/os/zvfs/Kconfig @@ -5,6 +5,7 @@ menuconfig ZVFS bool "Zephyr virtual filesystem (ZVFS) support [EXPERIMENTAL]" + 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 9a887b042f14ea83483ca41a0f929d6ffcb60d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:42 +0200 Subject: [PATCH 3019/3334] Revert "[nrf noup] mbedtls: Adding missing configuration for RSA key type derive" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2d6042685472d1c8e211333a35a8679b04ea46c6. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/Kconfig.psa.auto | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index b235c30380fb..834252432b52 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -298,9 +298,4 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE - bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY - default y if PSA_CRYPTO_ENABLE_ALL - endif # PSA_CRYPTO_CLIENT From f7fc6adc1d511c5eb0d21e65636df689be65099a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:43 +0200 Subject: [PATCH 3020/3334] Revert "[nrf noup] mbedtls: Adding helptext warnings for weak crypto" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6acd8bf86f07042e355511939cc8594d65be561c. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/Kconfig.psa.auto | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 834252432b52..fa8cdbc7b536 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -88,9 +88,7 @@ config PSA_WANT_ALG_HMAC config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - help - Warning: The MD5 hash is weak and deprecated and is only recommended - for use in legacy protocols. + config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -121,9 +119,6 @@ config PSA_WANT_ALG_RSA_PSS config PSA_WANT_ALG_SHA_1 bool "PSA_WANT_ALG_SHA_1" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - help - Warning: The SHA-1 hash is weak and deprecated and is only recommended - for use in legacy protocols. config PSA_WANT_ALG_SHA_224 bool "PSA_WANT_ALG_SHA_224" if !MBEDTLS_PROMPTLESS From a7bd31dad42120021b0ff34da687031bc587b343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:44 +0200 Subject: [PATCH 3021/3334] Revert "[nrf noup] mbedtls: Add dependency logic for PSA crypto configurations" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e9b99eb333d00f006550bcca1e336c774839d218. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/Kconfig.psa.auto | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index fa8cdbc7b536..56a81dd6efda 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -71,7 +71,6 @@ config PSA_WANT_ALG_GCM config PSA_WANT_ALG_HKDF bool "PSA_WANT_ALG_HKDF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_HKDF_EXTRACT bool "PSA_WANT_ALG_HKDF_EXTRACT" if !MBEDTLS_PROMPTLESS @@ -93,12 +92,11 @@ config PSA_WANT_ALG_MD5 config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_CMAC + config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -155,22 +153,18 @@ config PSA_WANT_ALG_SHA3_512 config PSA_WANT_ALG_STREAM_CIPHER bool "PSA_WANT_ALG_STREAM_CIPHER" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - select PSA_WANT_KEY_TYPE_CHACHA20 config PSA_WANT_ALG_TLS12_PRF bool "PSA_WANT_ALG_TLS12_PRF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_PSK_TO_MS bool "PSA_WANT_ALG_TLS12_PSK_TO_MS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS bool "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_SHA_256 config PSA_WANT_ECC_BRAINPOOL_P_R1_256 bool "PSA_WANT_ECC_BRAINPOOL_P_R1_256" if !MBEDTLS_PROMPTLESS @@ -243,8 +237,7 @@ config PSA_WANT_KEY_TYPE_AES config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - depends on PSA_WANT_ALG_CHACHA20_POLY1305 || \ - PSA_WANT_ALG_STREAM_CIPHER + config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS @@ -260,37 +253,30 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY default y if PSA_CRYPTO_ENABLE_ALL endif # PSA_CRYPTO_CLIENT From 1aa5d3a87a8d5aa792c0d0674b6ecde1fb506be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:44 +0200 Subject: [PATCH 3022/3334] Revert "[nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aa49bd203c70254b6e55ba917b1b04f9e4140fde. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/Kconfig.psa.auto | 61 +++++++++++++++++++++++++++++++ modules/mbedtls/Kconfig.psa.logic | 7 ++++ 2 files changed, 68 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 56a81dd6efda..08b1bbc02410 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -36,6 +36,10 @@ config PSA_WANT_ALG_CMAC bool "PSA_WANT_ALG_CMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_CFB + bool "PSA_WANT_ALG_CFB" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_ALG_CHACHA20_POLY1305 bool "PSA_WANT_ALG_CHACHA20_POLY1305" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -56,6 +60,10 @@ config PSA_WANT_ALG_ECDH bool "PSA_WANT_ALG_ECDH" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_FFDH + bool "PSA_WANT_ALG_FFDH" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_ALG_ECDSA bool "PSA_WANT_ALG_ECDSA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -88,6 +96,9 @@ config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_OFB + bool "PSA_WANT_ALG_OFB" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -97,6 +108,9 @@ config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_ALG_RIPEMD160 + bool "PSA_WANT_ALG_RIPEMD160" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -214,6 +228,26 @@ config PSA_WANT_ECC_SECP_R1_521 bool "PSA_WANT_ECC_SECP_R1_521" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_DH_RFC7919_2048 + bool "PSA_WANT_DH_RFC7919_2048" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_3072 + bool "PSA_WANT_DH_RFC7919_3072" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_4096 + bool "PSA_WANT_DH_RFC7919_4096" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_6144 + bool "PSA_WANT_DH_RFC7919_6144" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_DH_RFC7919_8192 + bool "PSA_WANT_DH_RFC7919_8192" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_DERIVE bool "PSA_WANT_KEY_TYPE_DERIVE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -234,15 +268,30 @@ config PSA_WANT_KEY_TYPE_AES bool "PSA_WANT_KEY_TYPE_AES" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_ARIA + bool "PSA_WANT_KEY_TYPE_ARIA" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_CAMELLIA + bool "PSA_WANT_KEY_TYPE_CAMELLIA" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DES + bool "PSA_WANT_KEY_TYPE_DES" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY + bool "PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + config PSA_WANT_KEY_TYPE_RAW_DATA bool "PSA_WANT_KEY_TYPE_RAW_DATA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -279,4 +328,16 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE + bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS + default y if PSA_CRYPTO_ENABLE_ALL + endif # PSA_CRYPTO_CLIENT diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index 9c3a55ea3191..972054e105b0 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -47,3 +47,10 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE + +config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC + bool + default y + depends on PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT || \ + PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT || \ + PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE From f859c86695eb09444e129b0d41ecddb1df8df2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:45 +0200 Subject: [PATCH 3023/3334] Revert "[nrf noup] samples: basic: blinky: add eGPIO tests configuration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8b6614f59e6d9b8ad1e6f6861738716af3c27f6b. Signed-off-by: Andrzej Głąbek --- .../boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay diff --git a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay deleted file mode 100644 index bd1ceb2f8945..000000000000 --- a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -&led0 { - gpios = <&hpf_gpio 9 GPIO_ACTIVE_HIGH>; -}; From 50fa46faabc62898e67ae518556ab4d756688bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:45 +0200 Subject: [PATCH 3024/3334] Revert "[nrf noup] board: nordic_ thingy53: Enable QSPI by default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 08d091ea39b2bfbe279860edacacd12a1107f163. Signed-off-by: Andrzej Głąbek --- 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 2809fd1eafc9..65d6f3dad1aa 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -104,9 +104,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 4bd0386f5b81c97a8c8f98081cf103d0db4c8bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:46 +0200 Subject: [PATCH 3025/3334] Revert "[nrf noup] ci: Enable action-manifest-pr" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a0d974eaacd3fc8042cba8ef5044be2dd5d50d6e. Signed-off-by: Andrzej Głąbek --- .github/workflows/manifest-PR.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/manifest-PR.yml diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml deleted file mode 100644 index a871aa381ded..000000000000 --- a/.github/workflows/manifest-PR.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: handle manifest PR -on: - pull_request_target: - types: [opened, synchronize, closed] - branches: - - main - - -jobs: - call-manifest-pr-action: - runs-on: ubuntu-latest - steps: - - name: handle manifest PR - uses: nrfconnect/action-manifest-pr@main - with: - token: ${{ secrets.NCS_GITHUB_TOKEN }} - manifest-pr-title-details: ${{ github.event.pull_request.title }} From 85a4140176dd80c691e4c6d8242030b3c59fae65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:46 +0200 Subject: [PATCH 3026/3334] Revert "[nrf noup] settings: nvs: use dedicated lookup cache hash function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c7c73c12195d5f108e985022feaf5b857e6bfad1. Signed-off-by: Andrzej Głąbek --- subsys/fs/nvs/Kconfig | 9 --------- subsys/fs/nvs/nvs.c | 46 ------------------------------------------- 2 files changed, 55 deletions(-) diff --git a/subsys/fs/nvs/Kconfig b/subsys/fs/nvs/Kconfig index 21798932f521..48915c2f048e 100644 --- a/subsys/fs/nvs/Kconfig +++ b/subsys/fs/nvs/Kconfig @@ -29,15 +29,6 @@ config NVS_LOOKUP_CACHE_SIZE Number of entries in Non-volatile Storage lookup cache. It is recommended that it be a power of 2. -config NVS_LOOKUP_CACHE_FOR_SETTINGS - bool "Non-volatile Storage lookup cache optimized for settings" - depends on NVS_LOOKUP_CACHE - help - Use the lookup cache hash function that results in the least number of - collissions and, in turn, the best NVS performance provided that the NVS - is used as the settings backend only. This option should NOT be enabled - if the NVS is also written to directly, outside the settings layer. - config NVS_DATA_CRC bool "Non-volatile Storage CRC protection on the data" help diff --git a/subsys/fs/nvs/nvs.c b/subsys/fs/nvs/nvs.c index f36d5b76dd56..8a710d570fb1 100644 --- a/subsys/fs/nvs/nvs.c +++ b/subsys/fs/nvs/nvs.c @@ -13,11 +13,6 @@ #include #include "nvs_priv.h" -#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS -#include -#include -#endif - #include LOG_MODULE_REGISTER(fs_nvs, CONFIG_NVS_LOG_LEVEL); @@ -26,45 +21,6 @@ static int nvs_ate_valid(struct nvs_fs *fs, const struct nvs_ate *entry); #ifdef CONFIG_NVS_LOOKUP_CACHE -#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS - -static inline size_t nvs_lookup_cache_pos(uint16_t id) -{ - /* - * 1. The NVS settings backend uses up to (NVS_NAME_ID_OFFSET - 1) NVS IDs to - store keys and equal number of NVS IDs to store values. - * 2. For each key-value pair, the value is stored at NVS ID greater by exactly - * NVS_NAME_ID_OFFSET than NVS ID that holds the key. - * 3. The backend tries to minimize the range of NVS IDs used to store keys. - * That is, NVS IDs are allocated sequentially, and freed NVS IDs are reused - * before allocating new ones. - * - * Therefore, to assure the least number of collisions in the lookup cache, - * the least significant bit of the hash indicates whether the given NVS ID - * represents a key or a value, and remaining bits of the hash are set to - * the ordinal number of the key-value pair. Consequently, the hash function - * provides the following mapping: - * - * 1st settings key => hash 0 - * 1st settings value => hash 1 - * 2nd settings key => hash 2 - * 2nd settings value => hash 3 - * ... - */ - BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAMECNT_ID), "NVS_NAMECNT_ID is not power of 2"); - BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAME_ID_OFFSET), "NVS_NAME_ID_OFFSET is not power of 2"); - - uint16_t key_value_bit; - uint16_t key_value_ord; - - key_value_bit = (id >> LOG2(NVS_NAME_ID_OFFSET)) & 1; - key_value_ord = id & (NVS_NAME_ID_OFFSET - 1); - - return ((key_value_ord << 1) | key_value_bit) % CONFIG_NVS_LOOKUP_CACHE_SIZE; -} - -#else /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ - static inline size_t nvs_lookup_cache_pos(uint16_t id) { uint16_t hash; @@ -80,8 +36,6 @@ static inline size_t nvs_lookup_cache_pos(uint16_t id) return hash % CONFIG_NVS_LOOKUP_CACHE_SIZE; } -#endif /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ - static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) { int rc; From 3a8b4a2c5066a80412dd1fa32bdcdf1014bbb88b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:47 +0200 Subject: [PATCH 3027/3334] Revert "[nrf noup] samples: sysbuild: hello_world: support PM on nRF53" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7784106ebe3c7bf12b36008bd0be209cb6f2e6ac. Signed-off-by: Andrzej Głąbek --- samples/sysbuild/hello_world/sysbuild.cmake | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index 654c4175faac..fa0599c6a621 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -9,18 +9,6 @@ if(DEFINED SB_CONFIG_REMOTE_BOARD) BOARD_REVISION ${BOARD_REVISION} ) - if(SB_CONFIG_SOC_SERIES_NRF53X) - set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) - set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) - set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) - set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") - else(SB_CONFIG_SOC_SERIES_NRF54LX) - set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) - set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) - set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) - set(CPUFLPR_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") - endif() - add_dependencies(${DEFAULT_IMAGE} remote) sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote) endif() From e2b54ac8bfb74c2b2f8f2937b81b8d27c77316c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:47 +0200 Subject: [PATCH 3028/3334] Revert "[nrf noup] board: nordic: thingy53: Default to update only MCUboot type" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fb75570475499ef69fdc3f463808f337b6d2d14d. Signed-off-by: Andrzej Głąbek --- boards/nordic/thingy53/Kconfig.sysbuild | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index df489c1dd546..c03d191b3708 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -7,10 +7,6 @@ choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -choice MCUBOOT_MODE - default MCUBOOT_MODE_OVERWRITE_ONLY -endchoice - config SECURE_BOOT_NETCORE default y @@ -20,9 +16,6 @@ config NETCORE_APP_UPDATE config NRF_DEFAULT_EMPTY default y if SECURE_BOOT_NETCORE -config MCUBOOT_USE_ALL_AVAILABLE_RAM - default y if BOARD_THINGY53_NRF5340_CPUAPP_NS && BOOTLOADER_MCUBOOT - endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY From 3a434009c73a38fdbb4d93273e659ca8c3a9b8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:48 +0200 Subject: [PATCH 3029/3334] =?UTF-8?q?Revert=20"[nrf=20noup]=C2=A0Bluetooth?= =?UTF-8?q?:=20Mesh:=20remove=20legacy=20adv=20support"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c6241a49d34b61fdd0fde58612aaec1fb6cefc27. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/mesh/Kconfig | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 722bf0bedafb..cd9844eeef6a 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -59,16 +59,12 @@ choice BT_MESH_ADV menuconfig BT_MESH_ADV_LEGACY bool "Legacy advertising" - depends on BT_LL_SW_SPLIT help Use legacy advertising commands for mesh sending. Legacy - advertising is significantly slower than the extended advertising. + advertising is significantly slower than the extended advertising, but + is supported by all controllers. - WARNING: This feature is not supported in NCS. The legacy advertiser will not work - with SDC, as attempting to start an advertisement during the scanner duty cycle - will result in an error. The Zephyr Link Layer can be used experimentally as an - alternative. - The legacy advertiser can occasionally do more message + WARNING: The legacy advertiser can occasionally do more message retransmissions than requested because of limitations of HCI interface API. From b5525a19d0baf8259969ac522163ab927207be7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:48 +0200 Subject: [PATCH 3030/3334] Revert "[nrf noup] tree-wide: support NCS Partition Manager (PM) definitions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a8cb6e26828c238cb4f46f81c1f45215f6a83deb. Signed-off-by: Andrzej Głąbek --- arch/arm/core/mpu/arm_mpu_regions.c | 13 ----- cmake/linker/ld/target.cmake | 1 - cmake/linker/lld/target.cmake | 1 - cmake/modules/kernel.cmake | 4 -- drivers/flash/soc_flash_nrf.c | 11 ---- drivers/flash/soc_flash_nrf_rram.c | 11 ---- .../arch/arm/cortex_m/scripts/linker.ld | 50 ------------------- include/zephyr/storage/flash_map.h | 6 --- lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 18 +------ subsys/dfu/boot/mcuboot_shell.c | 40 --------------- subsys/fs/littlefs_fs.c | 7 +-- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ---------- 13 files changed, 4 insertions(+), 187 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 71c0a9a2b739..4771c5914ce6 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,9 +8,6 @@ #include #include -#if USE_PARTITION_MANAGER -#include -#endif #ifdef CONFIG_ARM_MPU_SRAM_WRITE_THROUGH #define ARM_MPU_SRAM_REGION_ATTR REGION_RAM_WT_ATTR @@ -33,14 +30,6 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", -#if USE_PARTITION_MANAGER - PM_SRAM_ADDRESS, -#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) - REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), -#else - REGION_RAM_ATTR(REGION_SRAM_SIZE)), -#endif -#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) ARM_MPU_SRAM_REGION_ATTR(CONFIG_SRAM_BASE_ADDRESS, @@ -48,8 +37,6 @@ static const struct arm_mpu_region mpu_regions[] = { #else ARM_MPU_SRAM_REGION_ATTR(REGION_SRAM_SIZE)), #endif - -#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index ccf6a1903162..592596576d11 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,7 +80,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} - -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index fe8aad62c73d..96df1c123796 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,7 +52,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} - -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 83c3e4bcb846..af9c85d80e35 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -256,7 +256,3 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() - -if(ZEPHYR_NRF_MODULE_DIR) - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) -endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 27fda598be20..f6b8a6f5eef3 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -36,11 +36,6 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -170,12 +165,6 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index 84c7e958f3cd..9f0e24dc33d5 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,11 +54,6 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -297,12 +292,6 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index 82e417900ff0..288e0d0dc647 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,39 +34,6 @@ #define ROMSTART_REGION ROMABLE_REGION #endif -#if USE_PARTITION_MANAGER - -#include - -#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) -/* We are linking against S1, create symbol containing the flash ID of S0. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S0_ID; - -#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ - -#ifdef PM_S1_ID -/* We are linking against S0, create symbol containing the flash ID of S1. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S1_ID; -#endif /* PM_S1_ID */ - -#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ - -#define ROM_ADDR PM_ADDRESS -#define ROM_SIZE PM_SIZE - -#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) -#define RAM_SIZE CONFIG_PM_SRAM_SIZE -#else -#define RAM_SIZE PM_SRAM_SIZE -#endif -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) #define ROM_ADDR RAM_ADDR #else @@ -88,23 +55,6 @@ _image_1_primary_slot_id = PM_S1_ID; #define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS -#endif /* USE_PARTITION_MANAGER */ - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) -#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) -#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) -#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) -#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) -#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) -#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) -#endif - #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 558a0a0b7e72..7771e14a0e7b 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -348,10 +348,6 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); -#if USE_PARTITION_MANAGER -#include -#else - /** * Returns non-0 value if fixed-partition or fixed-subpartition of given * DTS node label exists. @@ -547,8 +543,6 @@ DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) #undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ -#endif /* USE_PARTITION_MANAGER */ - #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index 9a39ab8ad73b..0d97da3e340b 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -81,7 +81,7 @@ config HEAP_LISTENER choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) && !PARTITION_MANAGER_ENABLED + default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 2821ae8173ac..2b01e152f009 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,20 +25,6 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); -#if USE_PARTITION_MANAGER - -#include - -#define RAM_SIZE PM_SRAM_SIZE -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - -#define RAM_SIZE (KB((size_t) CONFIG_SRAM_SIZE)) -#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS - -#endif /* USE_PARTITION_MANAGER */ - #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -120,8 +106,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((RAM_SIZE - \ - ((size_t) HEAP_BASE - (size_t) RAM_ADDR)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ + ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index e167bc1e39b8..be4e558713f1 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,16 +20,6 @@ #endif #endif -#if USE_PARTITION_MANAGER -#include - -#ifdef CONFIG_NCS_IS_VARIANT_IMAGE -#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID -#else -#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID -#endif -#endif - struct area_desc { const char *name; unsigned int id; @@ -103,35 +93,6 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ -#if USE_PARTITION_MANAGER -#ifdef PM_MCUBOOT_ID - if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { - shell_error(sh, "Cannot erase boot partition"); - return -EACCES; - } -#endif - -#ifdef PM_APP_ID - if (id == PM_APP_ID) { - shell_error(sh, "Cannot erase this area"); - return -EACCES; - } -#endif - -#ifdef PM_MCUBOOT_PRIMARY_APP_ID - if (id == PM_MCUBOOT_PRIMARY_APP_ID) { - shell_error(sh, "Cannot erase this area"); - return -EACCES; - } -#endif - -#ifdef ACTIVE_IMAGE_ID - if (id == ACTIVE_IMAGE_ID) { - shell_error(sh, "Cannot erase active partitions"); - return -EACCES; - } -#endif -#else #if FIXED_PARTITION_EXISTS(boot_partition) if (id == FIXED_PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -144,7 +105,6 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } -#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index a31e01836a9c..bf60649e9b95 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1133,12 +1133,7 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = FSTAB_ENTRY_DT_INST_MOUNT_POINT(inst), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *) \ - COND_CODE_1(USE_PARTITION_MANAGER, \ - (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ - (FIXED_PARTITION_ID(littlefs_storage)), \ - (FIXED_PARTITION_ID(storage)))), \ - (DT_FIXED_PARTITION_ID(FS_PARTITION(inst)))), \ + .storage_dev = (void *)DT_FIXED_PARTITION_ID(FS_PARTITION(inst)), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index 9996e1d74d9b..a74e46b85207 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,35 +13,8 @@ extern "C" { #endif -#if CONFIG_PARTITION_MANAGER_ENABLED - -#include "pm_config.h" - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) -#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE -#else -/* The current image is a child image in a different domain than the image - * which defined the required values. To reach the values of the parent domain - * we use the 'PM__' variant of the define. - */ -#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ - -#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ - -#else - -#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) -#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) - -#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #define VDEV_STATUS_ADDR VDEV_START_ADDR #define VDEV_STATUS_SIZE 0x400 From 705de2d40819d7d83b6a71fc5deeb740531078e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:49 +0200 Subject: [PATCH 3031/3334] Revert "[nrf noup] include: net: add NCS extensions" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b82e432c73348b2cdf3a9862d65d89a917e2060c. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/socket.h | 1 - include/zephyr/net/socket_ncs.h | 207 -------------------------------- 2 files changed, 208 deletions(-) delete mode 100644 include/zephyr/net/socket_ncs.h diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index b460fc910ac5..f21a7fd764cc 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -36,7 +36,6 @@ #include #include #include -#include #include #ifdef __cplusplus diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h deleted file mode 100644 index 6a77d6c41f13..000000000000 --- a/include/zephyr/net/socket_ncs.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ -#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ - -/** - * @file - * @brief NCS specific additions to the BSD sockets API definitions - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence - * when creating a new socket. Combine this flag with a socket type when - * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). - * If it's desired to create a native TLS socket, but still offload the - * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. - */ -#define SOCK_NATIVE 0x80000000 -#define SOCK_NATIVE_TLS 0x40000000 - -/** Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options. - */ -#define NET_SOCKET_NCS_BASE 1000 - -/* NCS specific TLS level socket options */ - -/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. - * The option accepts an integer, indicating the total handshake timeout, - * including retransmissions, in seconds. - * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. - */ -#define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) - -/** Socket option to save DTLS connection, specifically for nRF sockets. - */ -#define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) - -/** Socket option to load DTLS connection, specifically for nRF sockets. - */ -#define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) - -/** Socket option to get result of latest TLS/DTLS completed handshakes end status, - * specifically for nRF sockets. - * The option accepts an integer, indicating the setting. - * Accepted vaules for the option are: 0 and 1. - */ -#define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) - -/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ -#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */ -#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ -#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ -#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ - -/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */ -#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 -#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 - -/* NCS specific socket options */ - -/** sockopt: enable sending data as part of exceptional events */ -#define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) -/** sockopt: Keep socket open when its PDN connection is lost - * or the device is put into flight mode. - */ -#define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) -/** sockopt: bind to PDN */ -#define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) - -/** sockopt: Release assistance indication (RAI). - * The option accepts an integer, indicating the type of RAI. - * Accepted values for the option are: @ref RAI_NO_DATA, @ref RAI_LAST, @ref RAI_ONE_RESP, - * @ref RAI_ONGOING, @ref RAI_WAIT_MORE. - */ -#define SO_RAI (NET_SOCKET_NCS_BASE + 61) - -/** Release assistance indication (RAI). - * Indicate that the application does not intend to send more data. - * This applies immediately and lets the modem exit connected mode more - * quickly. - * - * @note This requires the socket to be connected. - */ -#define RAI_NO_DATA 1 -/** Release assistance indication (RAI). - * Indicate that the application does not intend to send more data - * after the next call to send() or sendto(). - * This lets the modem exit connected mode more quickly after sending the data. - */ -#define RAI_LAST 2 -/** Release assistance indication (RAI). - * Indicate that the application is expecting to receive just one data packet - * after the next call to send() or sendto(). - * This lets the modem exit connected mode more quickly after having received the data. - */ -#define RAI_ONE_RESP 3 -/** Release assistance indication (RAI). - * Indicate that the socket is in active use by a client application. - * This lets the modem stay in connected mode longer. - */ -#define RAI_ONGOING 4 -/** Release assistance indication (RAI). - * Indicate that the socket is in active use by a server application. - * This lets the modem stay in connected mode longer. - */ -#define RAI_WAIT_MORE 5 - -/** sockopt: set a callback to be called when a send request is acknowledged by the network and - * the data has been acknowledged by the peer, if required by the network protocol, or until the - * timeout, given by the SO_SNDTIMEO socket option, is reached. Valid timeout values are - * 1 to 600 seconds. - * This option takes a @ref socket_ncs_sendcb structure. - * - * @note The callback is executed in an interrupt context. - * Take care to offload any processing as appropriate. - * - * @note This is only supported by the following modem firmware: - * - mfw_nrf9151-ntn - * - * This socket option cannot be used along with the @ref MSG_WAITACK send flag. - */ -#define SO_SENDCB (NET_SOCKET_NCS_BASE + 63) - -/** Parameters returned in the @ref socket_ncs_sendcb_t callback. */ -struct socket_ncs_sendcb_params { - /** Socket handle. */ - int fd; - /** Status. Can be 0 on successful send or EAGAIN on timeout. */ - int status; - /** Number of bytes that was sent. */ - size_t bytes_sent; -}; - -/** Callback type in the @ref socket_ncs_sendcb structure. */ -typedef void (*socket_ncs_sendcb_t)(const struct socket_ncs_sendcb_params *params); - -/** Option value for the @ref SO_SENDCB socket option. */ -struct socket_ncs_sendcb { - /** Callback function. */ - socket_ncs_sendcb_t callback; -}; - -/* NCS specific IPPROTO_ALL level socket options */ - -/** IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. */ -#define IPPROTO_ALL 512 -/** sockopt: disable all replies to unexpected traffics */ -#define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) - -/* NCS specific IPPROTO_IP level socket options */ - -/** sockopt: enable IPv4 ICMP replies */ -#define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) - -/* NCS specific IPPROTO_IPV6 level socket options */ - -/** sockopt: enable IPv6 ICMP replies */ -#define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) - -/** sockopt: Delay IPv6 address refresh during power saving mode */ -#define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) - -/* NCS specific TCP level socket options */ - -/** sockopt: Configurable TCP server session timeout in minutes. - * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). - */ -#define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) - -/* NCS specific gettaddrinfo() flags */ - -/** Assume `service` contains a Packet Data Network (PDN) ID. - * When specified together with the AI_NUMERICSERV flag, - * `service` shall be formatted as follows: "port:pdn_id" - * where "port" is the port number and "pdn_id" is the PDN ID. - * Example: "8080:1", port 8080 PDN ID 1. - * Example: "42:0", port 42 PDN ID 0. - */ -#define AI_PDNSERV 0x1000 - -/* NCS specific send() and sendto() flags */ - -/** Request a blocking send operation until the request is acknowledged. - * When used in send() or sendto(), the request will not return until the - * send operation is completed by lower layers, or until the timeout, given by the SO_SNDTIMEO - * socket option, is reached. Valid timeout values are 1 to 600 seconds. - */ -#define MSG_WAITACK 0x200 - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ From 99829123fe9ec581115546fc7725dbcce31638cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:49 +0200 Subject: [PATCH 3032/3334] Revert "[nrf noup] board: nordic: thingy53: Enable default images for sysbuild" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a05d733d37bd95a1d12c33142a523913bf0d3e12. Signed-off-by: Andrzej Głąbek --- boards/nordic/thingy53/Kconfig.sysbuild | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index c03d191b3708..2110f226e6b1 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -1,22 +1,5 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS - -choice BOOTLOADER - default BOOTLOADER_MCUBOOT -endchoice - -config SECURE_BOOT_NETCORE - default y - -config NETCORE_APP_UPDATE - default y if SECURE_BOOT_NETCORE - -config NRF_DEFAULT_EMPTY - default y if SECURE_BOOT_NETCORE - -endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS - config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY default y if BOOTLOADER_MCUBOOT From e5278d819d5168115d29d73dcb7c2592bc645175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:50 +0200 Subject: [PATCH 3033/3334] Revert "[nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6914e76bc3ce34570f0fdccc64aa31c40ab35230. Signed-off-by: Andrzej Głąbek --- scripts/west_commands/build.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index 819805aa49e7..f7aab1adb147 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -664,12 +664,7 @@ def _run_cmake(self, board, origin): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', None) - - if config_sysbuild is None: - # If no option is set, then enable sysbuild globally - config_sysbuild = True - + config_sysbuild = config_getboolean('sysbuild', False) if self.args.sysbuild is True or (config_sysbuild and self.args.sysbuild is not False): cmake_opts.extend([f'-S{SYSBUILD_PROJ_DIR}']) cmake_env = os.environ.copy() From 05134777dc3279ba53fd995b2b3d49e9fc9db000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:50 +0200 Subject: [PATCH 3034/3334] Revert "[nrf noup] boards: nordic: thingy53: Add sysbuild Kconfig file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4eeba095b882fd5b0c556d03420787252530e3e8. Signed-off-by: Andrzej Głąbek --- boards/nordic/thingy53/Kconfig.sysbuild | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 boards/nordic/thingy53/Kconfig.sysbuild diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild deleted file mode 100644 index 2110f226e6b1..000000000000 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY - default y if BOOTLOADER_MCUBOOT From 284724fef13923171fbcc989b141a2678de0809c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:51 +0200 Subject: [PATCH 3035/3334] Revert "[nrf noup] samples: psa_crypto: Remove support for Nordic boards" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5ce34aae05be9c66e45ca4ac3d160c21f1f5bcb8. Signed-off-by: Andrzej Głąbek --- samples/tfm_integration/psa_crypto/sample.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/tfm_integration/psa_crypto/sample.yaml b/samples/tfm_integration/psa_crypto/sample.yaml index 442f20163940..545b2337e578 100644 --- a/samples/tfm_integration/psa_crypto/sample.yaml +++ b/samples/tfm_integration/psa_crypto/sample.yaml @@ -16,6 +16,8 @@ tests: platform_allow: - mps2/an521/cpu0/ns - v2m_musca_s1/musca_s1/ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns - stm32l562e_dk/stm32l562xx/ns - bl5340_dvk/nrf5340/cpuapp/ns - max32657evkit/max32657/ns From 8dc02d2aa49c8617f0d63b55365eaa3e162cd27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:51 +0200 Subject: [PATCH 3036/3334] Revert "[nrf noup] boards: thingy53_nrf5340: Enable MCUboot by default" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 832056890e822a62eaaa29a93c416fb7c29eae84. Signed-off-by: Andrzej Głąbek --- boards/nordic/thingy53/Kconfig.defconfig | 6 ------ boards/nordic/thingy53/thingy53_nrf5340_common.dtsi | 1 - 2 files changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 65d6f3dad1aa..f90f267ba2e0 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -15,12 +15,6 @@ endif # NORDIC_QSPI_NOR if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS -config BOOTLOADER_MCUBOOT - default y if !MCUBOOT - -config BOARD_ENABLE_CPUNET - default y if !MCUBOOT - # Code Partition: # # For the secure version of the board the firmware is linked at the beginning diff --git a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi index fef36ec84f57..828b710c1ad4 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi +++ b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi @@ -13,7 +13,6 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; - nordic,pm-ext-flash = &mx25r64; }; buttons { From d60e82d6e1c578e9035f5d46e551f8adae2b1a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:52 +0200 Subject: [PATCH 3037/3334] Revert "[nrf noup] boards: arm: thingy53: Disable USB CDC added by MCUBoot" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 683b8fe80e94f8601003db5dd2f744b566ba649d. Signed-off-by: Andrzej Głąbek --- boards/nordic/thingy53/Kconfig.defconfig | 7 ------- 1 file changed, 7 deletions(-) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index f90f267ba2e0..c5b54f30cb79 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -91,13 +91,6 @@ endif # !TRUSTED_EXECUTION_SECURE source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" -# By default, a USB CDC ACM instance is already enabled in the board's DTS. -# It is not necessary for nRF Connect SDK to add another instance if MCUBoot -# bootloader is built as a child image. -config MCUBOOT_USB_SUPPORT - bool - default n - endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From 596cbde13b74b5851459974ed4232f615dbcdabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:52 +0200 Subject: [PATCH 3038/3334] Revert "[nrf noup] boards: thingy53_nrf5340: Add common partition map" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6b3aadd69c890713c027373cf10c0da0732ca196. Signed-off-by: Andrzej Głąbek --- .../pm_static_thingy53_nrf5340_cpuapp.yml | 55 -------------- .../pm_static_thingy53_nrf5340_cpuapp_ns.yml | 73 ------------------- 2 files changed, 128 deletions(-) delete mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml delete mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml deleted file mode 100644 index 7a48d51ec334..000000000000 --- a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml +++ /dev/null @@ -1,55 +0,0 @@ -app: - address: 0x10200 - region: flash_primary - size: 0xdfe00 -mcuboot: - address: 0x0 - region: flash_primary - size: 0x10000 -mcuboot_pad: - address: 0x10000 - region: flash_primary - size: 0x200 -mcuboot_primary: - address: 0x10000 - orig_span: &id001 - - mcuboot_pad - - app - region: flash_primary - size: 0xe0000 - span: *id001 -mcuboot_primary_app: - address: 0x10200 - orig_span: &id002 - - app - region: flash_primary - size: 0xdfe00 - span: *id002 -settings_storage: - address: 0xf0000 - region: flash_primary - size: 0x10000 -mcuboot_primary_1: - address: 0x0 - size: 0x40000 - device: flash_ctrl - region: ram_flash -mcuboot_secondary: - address: 0x00000 - size: 0xe0000 - device: MX25R64 - region: external_flash -mcuboot_secondary_1: - address: 0xe0000 - size: 0x40000 - device: MX25R64 - region: external_flash -external_flash: - address: 0x120000 - size: 0x6e0000 - device: MX25R64 - region: external_flash -pcd_sram: - address: 0x20000000 - size: 0x2000 - region: sram_primary diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml deleted file mode 100644 index 70ffe6d9c124..000000000000 --- a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml +++ /dev/null @@ -1,73 +0,0 @@ -mcuboot: - address: 0x0 - region: flash_primary - size: 0x10000 -mcuboot_pad: - address: 0x10000 - region: flash_primary - size: 0x200 -tfm_secure: - address: 0x10000 - size: 0xc000 - span: [mcuboot_pad, tfm] -tfm_nonsecure: - address: 0x1c000 - size: 0xd4000 - span: [app] -tfm: - address: 0x10200 - region: flash_primary - size: 0xbe00 -app: - address: 0x1c000 - region: flash_primary - size: 0xd4000 -mcuboot_primary: - address: 0x10000 - orig_span: &id001 - - mcuboot_pad - - tfm - - app - region: flash_primary - size: 0xe0000 - span: *id001 -mcuboot_primary_app: - address: 0x10200 - orig_span: &id002 - - tfm - - app - region: flash_primary - size: 0xdfe00 - span: *id002 -nonsecure_storage: - address: 0xf0000 - size: 0x10000 - span: [settings_storage] -settings_storage: - address: 0xf0000 - region: flash_primary - size: 0x10000 -mcuboot_primary_1: - address: 0x0 - size: 0x40000 - device: flash_ctrl - region: ram_flash -mcuboot_secondary: - address: 0x00000 - size: 0xe0000 - device: MX25R64 - region: external_flash -mcuboot_secondary_1: - address: 0xe0000 - size: 0x40000 - device: MX25R64 - region: external_flash -external_flash: - address: 0x120000 - size: 0x6e0000 - device: MX25R64 - region: external_flash -pcd_sram: - address: 0x20000000 - size: 0x2000 - region: sram_primary From 76b745f9ef919c02b09e554f1d3c46a8178b9f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:52 +0200 Subject: [PATCH 3039/3334] Revert "[nrf noup] soc: arm: nRF53: Add SPU Flash/RAM alignment" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4cd49f9fcd036df82a4346f5b572e6e7c5e4de33. Signed-off-by: Andrzej Głąbek --- soc/nordic/nrf53/Kconfig | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 186fb547a7b3..7794fba63ba1 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -170,26 +170,12 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_SPU_FLASH_REGION_ALIGNMENT - hex - default 0x4000 - help - FLASH regions must be aligned to this value due to SPU HW - limitations. - config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 help RAM region size for the NRF_SPU peripheral -config NRF_SPU_RAM_REGION_ALIGNMENT - hex - default 0x2000 - help - RAM regions must be aligned to this value due to SPU HW - limitations. - config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" depends on NRF_SOC_SECURE_SUPPORTED From a34d3bb447dbcc4c1d44960b4879937017c0dbe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:53 +0200 Subject: [PATCH 3040/3334] Revert "[nrf noup] net: mqtt: Provide option to enable TLS session caching" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 270cc3fbdaf5af33b2e012bad4c22275fe56960c. Signed-off-by: Andrzej Głąbek --- include/zephyr/net/mqtt.h | 3 --- subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index c1f3b9924133..a4d961a502ef 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -763,9 +763,6 @@ struct mqtt_sec_config { uint32_t alpn_protocol_name_count; #endif - /** Indicates the preference for enabling TLS session caching. */ - int session_cache; - /** Peer hostname for certificate verification. */ const char *hostname; diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index fa854c5505f9..8565d227f858 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -121,16 +121,6 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } - if (tls_config->session_cache == ZSOCK_TLS_SESSION_CACHE_ENABLED) { - ret = zsock_setsockopt(client->transport.tls.sock, ZSOCK_SOL_TLS, - ZSOCK_TLS_SESSION_CACHE, - &tls_config->session_cache, - sizeof(tls_config->session_cache)); - if (ret < 0) { - goto error; - } - } - if (tls_config->cert_nocopy != ZSOCK_TLS_CERT_NOCOPY_NONE) { ret = zsock_setsockopt(client->transport.tls.sock, ZSOCK_SOL_TLS, ZSOCK_TLS_CERT_NOCOPY, &tls_config->cert_nocopy, From ea4a4f3734c1691a2f0c740a0dbd6a02e10d8894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:53 +0200 Subject: [PATCH 3041/3334] Revert "[nrf noup] test: schedule_api: Use Minimal C library" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 17a2a8c3f7279bae5d9025c83c0eaf118afda8cb. Signed-off-by: Andrzej Głąbek --- tests/kernel/pipe/deprecated/pipe_api/prj.conf | 9 --------- tests/kernel/sched/schedule_api/prj.conf | 1 - tests/kernel/sched/schedule_api/prj_multiq.conf | 1 - 3 files changed, 11 deletions(-) delete mode 100644 tests/kernel/pipe/deprecated/pipe_api/prj.conf diff --git a/tests/kernel/pipe/deprecated/pipe_api/prj.conf b/tests/kernel/pipe/deprecated/pipe_api/prj.conf deleted file mode 100644 index df3270adfdf8..000000000000 --- a/tests/kernel/pipe/deprecated/pipe_api/prj.conf +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG_ZTEST=y -CONFIG_IRQ_OFFLOAD=y -CONFIG_TEST_USERSPACE=y -CONFIG_DYNAMIC_OBJECTS=y -CONFIG_MP_MAX_NUM_CPUS=1 -CONFIG_ZTEST_FATAL_HOOK=y -CONFIG_PIPES=y -CONFIG_DEPRECATION_TEST=y -CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj.conf b/tests/kernel/sched/schedule_api/prj.conf index 8b649a3b7fca..a5ceef694331 100644 --- a/tests/kernel/sched/schedule_api/prj.conf +++ b/tests/kernel/sched/schedule_api/prj.conf @@ -7,4 +7,3 @@ CONFIG_MAX_THREAD_BYTES=6 CONFIG_TEST_USERSPACE=y CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y -CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index 84c9d80ac619..c8dd4bf786bc 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -7,4 +7,3 @@ CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y CONFIG_NUM_COOP_PRIORITIES=30 CONFIG_NUM_PREEMPT_PRIORITIES=40 -CONFIG_MINIMAL_LIBC=y From 31c508022fb7afe43864bc68d030acb7f7035388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:54 +0200 Subject: [PATCH 3042/3334] Revert "[nrf noup] dfu/boot/mcuboot: fix confirmation in case of USE_PARTITION_MANAGER" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e48546d45e19b993b8f83c36accea60d6a9291e1. Signed-off-by: Andrzej Głąbek --- subsys/dfu/boot/mcuboot.c | 47 ++------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/subsys/dfu/boot/mcuboot.c b/subsys/dfu/boot/mcuboot.c index 3750e44ac6b0..f6122e3c04d9 100644 --- a/subsys/dfu/boot/mcuboot.c +++ b/subsys/dfu/boot/mcuboot.c @@ -73,49 +73,8 @@ enum IMAGE_INDEXES { IMAGE_INDEX_7, }; -#if USE_PARTITION_MANAGER -#include - -#if CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 -/* Sysbuild */ -#ifdef CONFIG_MCUBOOT -/* lib is part of MCUboot -> operate on the primary application slot */ -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#else -/* TODO: Add firmware loader support */ -/* lib is part of the app -> operate on active slot */ -#if defined(CONFIG_NCS_IS_VARIANT_IMAGE) -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID -#else -#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#endif -#endif /* CONFIG_MCUBOOT */ -#else -/* Legacy child/parent */ -#if CONFIG_BUILD_WITH_TFM - #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) -#else - #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) -#endif - -#ifdef CONFIG_MCUBOOT - /* lib is part of MCUboot -> operate on the primary application slot */ - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#else - /* lib is part of the App -> operate on active slot */ -#if (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_PRIMARY_ADDRESS - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID -#elif (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_SECONDARY_ADDRESS - #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID -#else - #error Missing partition definitions. -#endif -#endif /* CONFIG_MCUBOOT */ -#endif /* CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 */ - -#else - -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) +#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \ + defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) /* For RAM LOAD mode, the active image must be fetched from the bootloader */ #define ACTIVE_SLOT_FLASH_AREA_ID boot_fetch_active_slot() #define INVALID_SLOT_ID 255 @@ -124,8 +83,6 @@ enum IMAGE_INDEXES { #define ACTIVE_SLOT_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_code_partition)) #endif -#endif /* USE_PARTITION_MANAGER */ - /* * Raw (on-flash) representation of the v1 image header. */ From 6e9d64103ea8bd90634521d926c4ba253ac98612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:54 +0200 Subject: [PATCH 3043/3334] Revert "[nrf noup] Bluetooth: Mesh: Fix adv randomness bug" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit daf9a6a61e2bb4300e2374f0befd0e0b81c1f2df. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/mesh/adv_ext.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 68a6c27beebf..2382b01bd182 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -578,10 +578,8 @@ int bt_mesh_adv_enable(void) return err; } - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && - IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_FRIEND_SEPARATE) && - advs[i].tags == BT_MESH_ADV_TAG_BIT_FRIEND) { - err = set_adv_randomness(advs[i].instance->handle, 0); + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { + err = set_adv_randomness(adv->instance->handle, 0); if (err) { LOG_ERR("Failed to set zero randomness: %d", err); } From 9e15ce223a4e0848507827f8f0af098dbc72c7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:55 +0200 Subject: [PATCH 3044/3334] Revert "[nrf noup] Bluetooth: Mesh: zero randomization for friend's adv" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c14cef2282f624d031910b7affa6417a2327f7de. Signed-off-by: Andrzej Głąbek --- subsys/bluetooth/mesh/Kconfig | 2 +- subsys/bluetooth/mesh/adv_ext.c | 32 -------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index cd9844eeef6a..c37c3e03129a 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1705,7 +1705,7 @@ config BT_MESH_LPN_INIT_POLL_TIMEOUT config BT_MESH_LPN_SCAN_LATENCY int "Latency for enabling scanning" range 0 50 - default 2 + default 15 help Latency in milliseconds that it takes to enable scanning. This is in practice how much time in advance before the Receive Window diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 2382b01bd182..0ff0bc5e9fe7 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -13,9 +13,6 @@ #include #include #include -#if defined(CONFIG_BT_LL_SOFTDEVICE) -#include -#endif #include "common/bt_str.h" @@ -152,28 +149,6 @@ static inline struct bt_mesh_ext_adv *gatt_adv_get(void) } } -static int set_adv_randomness(uint8_t handle, int rand_us) -{ -#if defined(CONFIG_BT_LL_SOFTDEVICE) - struct net_buf *buf; - sdc_hci_cmd_vs_set_adv_randomness_t *cmd_params; - - buf = bt_hci_cmd_alloc(K_FOREVER); - if (!buf) { - LOG_ERR("Could not allocate command buffer"); - return -ENOMEM; - } - - cmd_params = net_buf_add(buf, sizeof(*cmd_params)); - cmd_params->adv_handle = handle; - cmd_params->rand_us = rand_us; - - return bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_SET_ADV_RANDOMNESS, buf, NULL); -#else - return 0; -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ -} - static int adv_start(struct bt_mesh_ext_adv *ext_adv, const struct bt_le_adv_param *param, struct bt_le_ext_adv_start_param *start, @@ -577,13 +552,6 @@ int bt_mesh_adv_enable(void) if (err) { return err; } - - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { - err = set_adv_randomness(adv->instance->handle, 0); - if (err) { - LOG_ERR("Failed to set zero randomness: %d", err); - } - } } return 0; From 88933fd7010d7d1eeab970d5e3f00092e78602a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:55 +0200 Subject: [PATCH 3045/3334] Revert "[nrf noup] samples/tests: Disable PM for some sysbuild builds" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 413fef8340aee7a882dd0fe82a5c76d72da54fa8. Signed-off-by: Andrzej Głąbek --- samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf | 1 - samples/drivers/mbox/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf | 1 - samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf | 1 - samples/subsys/logging/multidomain/sysbuild.conf | 1 - tests/boot/mcuboot_recovery_retention/sysbuild.conf | 1 - tests/boot/test_mcuboot/sysbuild.conf | 1 - tests/drivers/flash/common/sysbuild.conf | 1 - tests/drivers/flash/negative_tests/sysbuild.conf | 1 - tests/subsys/fs/fcb/sysbuild.conf | 1 - tests/subsys/fs/littlefs/sysbuild.conf | 1 - 12 files changed, 12 deletions(-) delete mode 100644 samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf delete mode 100644 samples/drivers/mbox/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf delete mode 100644 samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf delete mode 100644 samples/subsys/logging/multidomain/sysbuild.conf delete mode 100644 tests/drivers/flash/common/sysbuild.conf delete mode 100644 tests/drivers/flash/negative_tests/sysbuild.conf delete mode 100644 tests/subsys/fs/fcb/sysbuild.conf delete mode 100644 tests/subsys/fs/littlefs/sysbuild.conf diff --git a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/drivers/mbox/sysbuild.conf b/samples/drivers/mbox/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/drivers/mbox/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/logging/multidomain/sysbuild.conf b/samples/subsys/logging/multidomain/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/samples/subsys/logging/multidomain/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/mcuboot_recovery_retention/sysbuild.conf b/tests/boot/mcuboot_recovery_retention/sysbuild.conf index 3b5b3c963800..47f00ff3cff8 100644 --- a/tests/boot/mcuboot_recovery_retention/sysbuild.conf +++ b/tests/boot/mcuboot_recovery_retention/sysbuild.conf @@ -1,2 +1 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/test_mcuboot/sysbuild.conf b/tests/boot/test_mcuboot/sysbuild.conf index 3b5b3c963800..47f00ff3cff8 100644 --- a/tests/boot/test_mcuboot/sysbuild.conf +++ b/tests/boot/test_mcuboot/sysbuild.conf @@ -1,2 +1 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/drivers/flash/common/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/negative_tests/sysbuild.conf b/tests/drivers/flash/negative_tests/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/drivers/flash/negative_tests/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/fcb/sysbuild.conf b/tests/subsys/fs/fcb/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/subsys/fs/fcb/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/littlefs/sysbuild.conf b/tests/subsys/fs/littlefs/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/subsys/fs/littlefs/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n From 64a3e2ce604388ccecaaab3315df9f794b571b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:55 +0200 Subject: [PATCH 3046/3334] Revert "[nrf noup] samples&tests: Restore a few CONFIG_NEWLIB_LIBC_NANO=n" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 56c7896a6e65c8d8ae8e2a44b8afd10faa239770. Signed-off-by: Andrzej Głąbek --- tests/lib/newlib/heap_listener/prj.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/lib/newlib/heap_listener/prj.conf b/tests/lib/newlib/heap_listener/prj.conf index 7282777ff1ca..e5a5dc6df4c1 100644 --- a/tests/lib/newlib/heap_listener/prj.conf +++ b/tests/lib/newlib/heap_listener/prj.conf @@ -1,4 +1,3 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y From 463ef6d963e1029b3e16e50c8c5d3c4fe25e1395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:56 +0200 Subject: [PATCH 3047/3334] Revert "[nrf noup] samples: mgmt: mcumgr smp_svr: Migrate child image config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8c39a5f75aa0ae22e66b20b1027d6636dac9dd16. Signed-off-by: Andrzej Głąbek --- .../subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf deleted file mode 100644 index 98260877332f..000000000000 --- a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor -# -# SPDX-License-Identifier: Apache-2.0 -# - -CONFIG_BT_MAX_CONN=2 -CONFIG_BT_BUF_ACL_RX_SIZE=502 -CONFIG_BT_BUF_ACL_TX_SIZE=502 -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 From 1d71f59b62882e6cd9cf4aefc1e6997058404d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:56 +0200 Subject: [PATCH 3048/3334] Revert "[nrf noup] samples: bluetooth: hci_pow_ctrl: Migrate child image config" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ffc0901fd6d92dff0cb889ada2b5d740b37eb35d. Signed-off-by: Andrzej Głąbek --- samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf | 1 - 1 file changed, 1 deletion(-) delete mode 100644 samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf deleted file mode 100644 index e6749ae63990..000000000000 --- a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From e2266d46fcd8113c3eeab6c46dfc7bd419a133cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:57 +0200 Subject: [PATCH 3049/3334] Revert "[nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4d3a054bee760c70509d61775d2f51eac73ce605. Signed-off-by: Andrzej Głąbek --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 ----- subsys/mgmt/mcumgr/Kconfig | 1 - .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 35 ------------------- 3 files changed, 44 deletions(-) delete mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index ad088eca0677..39d4a4ca8ce0 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -16,11 +16,3 @@ add_subdirectory(transport) add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) - -if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) -endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 5a7314ad57ed..c917b1e55e0a 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,6 @@ menuconfig MCUMGR bool "MCUmgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the MCUmgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c deleted file mode 100644 index f1ac8a168e65..000000000000 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include "bootutil/bootutil_public.h" - -#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 -/* Sysbuild */ -#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER -#else -/* Legacy child/parent */ -#define NET_CORE_IMAGE 1 -#endif - -int boot_read_swap_state_primary_slot_hook(int image_index, - struct boot_swap_state *state) -{ - if (image_index == NET_CORE_IMAGE) { - /* Pretend that primary slot of image 1 unpopulated */ - state->magic = BOOT_MAGIC_UNSET; - state->swap_type = BOOT_SWAP_TYPE_NONE; - state->image_num = image_index; - state->copy_done = BOOT_FLAG_UNSET; - state->image_ok = BOOT_FLAG_UNSET; - - /* Prevent bootutil from trying to obtain true info */ - return 0; - } - - return BOOT_HOOK_REGULAR; -} From 59882ea78d37ff497da71ff708f0d248638a5ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:57 +0200 Subject: [PATCH 3050/3334] Revert "[nrf noup] drivers/flashdisk: Add support for Partition Manager" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 97649f1cba744554f06675f4fa1aeabd2665852a. Signed-off-by: Andrzej Głąbek --- drivers/disk/flashdisk.c | 78 ---------------------------------------- 1 file changed, 78 deletions(-) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index bd5dc6a8f76a..1959f94b0ed3 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -504,8 +504,6 @@ static const struct disk_operations flash_disk_ops = { .ioctl = disk_flash_access_ioctl, }; -#ifndef USE_PARTITION_MANAGER -/* The non-Partition manager, DTS based generators below */ #define DT_DRV_COMPAT zephyr_flash_disk #define PARTITION_PHANDLE(n) DT_PHANDLE_BY_IDX(DT_DRV_INST(n), partition, 0) @@ -547,82 +545,6 @@ DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) "Devicetree node " DT_NODE_PATH(DT_DRV_INST(n)) \ " has cache size which is not a multiple of its sector size"); DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) -#else /* ifndef USE_PARTITION_MANAGER */ -/* Partition Manager based generators below */ - -/* Gets the PM_..._EXTRA_PARAM_##param value */ -#define PM_FLASH_DISK_ENTRY_EXTRA_PARAM(name, param) PM_##name##_EXTRA_PARAM_disk_##param - -/* Gets the PM_..._NAME value which is originally cased, as in yaml, partition name */ -#define PM_FLASH_DISK_ENTRY_PARTITION_NAME(name) PM_##name##_NAME - -/* Generates flashdiskN_cache variable name, where N is partition ID */ -#define PM_FLASH_DISK_CACHE_VARIABLE(n) UTIL_CAT(flashdisk, UTIL_CAT(FIXED_PARTITION_ID(n), _cache)) - -/* Generate cache buffers */ -#define CACHE_SIZE(n) (COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), (0), (1)) * \ - PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size)) -#define DEFINE_FLASHDISKS_CACHE(n) \ - static uint8_t __aligned(4) PM_FLASH_DISK_CACHE_VARIABLE(n)[CACHE_SIZE(n)]; - -PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) - -/* Generated single Flash Disk device data from Partition Manager partition. - * Partition is required to have type set to disk in partition definitions: - * type: disk - * and following extra params can be provided: - * extra_params: { - * name = "", - * cache_size = , - * sector_size = , - * read_only = - * } - * where: - * is mandatory device name that will be used by Disk Access and FAT FS to mount device; - * is cache r/w cache size, which is mandatory if read_only = 0 or not present, - * and should be multiple of ; - * is mandatory device sector size information, usually should be erase page size, - * for flash devices, for example 4096 bytes; - * read_only is optional, if not present then assumed false; can be 0(false) or 1(true). - */ -#define DEFINE_FLASHDISKS_DEVICE(n) \ -{ \ - .info = { \ - .ops = &flash_disk_ops, \ - .name = STRINGIFY(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, name)), \ - }, \ - .area_id = FIXED_PARTITION_ID(n), \ - .offset = FIXED_PARTITION_OFFSET(n), \ - .cache = PM_FLASH_DISK_CACHE_VARIABLE(n), \ - .cache_size = sizeof(PM_FLASH_DISK_CACHE_VARIABLE(n)), \ - .size = FIXED_PARTITION_SIZE(n), \ - .sector_size = PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size), \ -}, - -/* The bellow used PM_FOREACH_TYPE_disk is generated by Partition Manager foreach - * loop macro. The lower case _disk is type name for which the macro has been generated; - * partition entry can have multiple types set and foreach macro will be generated - * for every type found across partition definitions. - */ -static struct flashdisk_data flash_disks[] = { - PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE) -}; - -#define VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY(n) \ - COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), \ - (/* cache-size is not used for read-only disks */), \ - (BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) != 0, \ - "Flash disk partition " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n))\ - " must have non-zero cache-size");)) -PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) - -#define VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE(n) \ - BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) % \ - PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size) == 0, \ - "Devicetree node " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n)) \ - " has cache size which is not a multiple of its sector size"); -PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) -#endif /* USE_PARTITION_MANAGER */ static int disk_flash_init(void) { From 0f05b94c5c302d1ffefad208dbab0d58e4bca513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:57 +0200 Subject: [PATCH 3051/3334] Revert "[nrf noup] modules: mbedtls: Add include folders" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 82142dbc3767a4b05b1877f8a35dcc2606063ccb. Signed-off-by: Andrzej Głąbek --- modules/mbedtls/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index ddeb62a65182..b75822441968 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -40,8 +40,6 @@ zephyr_interface_library_named(mbedTLS) # Add regular includes target_include_directories(mbedTLS INTERFACE ${ZEPHYR_CURRENT_MODULE_DIR}/include - ${ZEPHYR_CURRENT_MODULE_DIR}/include/library - ${ZEPHYR_CURRENT_MODULE_DIR}/library configs include ) From f80d1f1302cf77d57e80f1918b46851434634524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:57 +0200 Subject: [PATCH 3052/3334] Revert "[nrf noup] modules: tf-m: use of PSA_HAS_XXXX_SUPPORT" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bac94d557eb647a0a8ba6b21e81bc31dbd724eff. Signed-off-by: Andrzej Głąbek --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 02d3580c22f3..1d70a2c44d29 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -10,7 +10,6 @@ if TFM_PARTITION_CRYPTO config TFM_CRYPTO_RNG_MODULE_ENABLED bool "Random number generator crypto module" default y - depends on PSA_WANT_GENERATE_RANDOM && NRF_SECURITY help Enables the random number generator module within the crypto partition. Unset this option if 'psa_generate_random' is not used. @@ -18,7 +17,6 @@ config TFM_CRYPTO_RNG_MODULE_ENABLED config TFM_CRYPTO_KEY_MODULE_ENABLED bool "KEY crypto module" default y - depends on PSA_HAS_KEY_SUPPORT && NRF_SECURITY help Enables the KEY crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_management.c' @@ -27,7 +25,6 @@ config TFM_CRYPTO_KEY_MODULE_ENABLED config TFM_CRYPTO_AEAD_MODULE_ENABLED bool "AEAD crypto module" default y - depends on PSA_HAS_AEAD_SUPPORT && NRF_SECURITY help Enables the AEAD crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_aead.c' @@ -36,7 +33,6 @@ config TFM_CRYPTO_AEAD_MODULE_ENABLED config TFM_CRYPTO_MAC_MODULE_ENABLED bool "MAC crypto module" default y - depends on PSA_HAS_MAC_SUPPORT && NRF_SECURITY help Enables the MAC crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_mac.c' @@ -45,7 +41,6 @@ config TFM_CRYPTO_MAC_MODULE_ENABLED config TFM_CRYPTO_HASH_MODULE_ENABLED bool "HASH crypto module" default y - depends on PSA_HAS_HASH_SUPPORT && NRF_SECURITY help Enables the HASH crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_hash.c' @@ -54,7 +49,6 @@ config TFM_CRYPTO_HASH_MODULE_ENABLED config TFM_CRYPTO_CIPHER_MODULE_ENABLED bool "CIPHER crypto module" default y - depends on PSA_HAS_CIPHER_SUPPORT && NRF_SECURITY help Enables the CIPHER crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_cipher.c' @@ -63,7 +57,6 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED bool "ASYM ENCRYPT crypto module" default y - depends on PSA_HAS_ASYM_ENCRYPT_SUPPORT && NRF_SECURITY help Enables the ASYM ENCRYPT crypto module within the crypto partition. Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' @@ -72,7 +65,6 @@ config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED bool "ASYM SIGN crypto module" default y - depends on PSA_HAS_ASYM_SIGN_SUPPORT && NRF_SECURITY help Enables the ASYM SIGN crypto module within the crypto partition. Unset this option if the sign functionality provided by 'crypto_asymmetric.c' @@ -81,12 +73,10 @@ config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED bool "KEY DERIVATION crypto module" default y - depends on (PSA_HAS_KEY_DERIVATION || PSA_HAS_KEY_AGREEMENT) && NRF_SECURITY help Enables the KEY_DERIVATION crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_derivation.c' is not used. - Note that key agreement is under key derivation in the current implementation. endif # TFM_PARTITION_CRYPTO From fda0632f902a710299b44c02c2cdc09dd355aa95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:58 +0200 Subject: [PATCH 3053/3334] Revert "[nrf noup] doc: remove Kconfig search" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 433fa6a009070e37c42804a85789fa966214dec1. Signed-off-by: Andrzej Głąbek --- MAINTAINERS.yml | 1 + doc/build/kconfig/setting.rst | 6 ++++-- doc/develop/application/index.rst | 5 +++-- doc/kconfig.rst | 8 ++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 doc/kconfig.rst diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index dc801509a465..0aff172eb1e8 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1227,6 +1227,7 @@ Documentation: - doc/index-tex.rst - doc/index.html - doc/index.rst + - doc/kconfig.rst - doc/templates/sample.tmpl - doc/templates/board.tmpl - boards/index.rst diff --git a/doc/build/kconfig/setting.rst b/doc/build/kconfig/setting.rst index cbaf9c5b3897..17eafc95a3be 100644 --- a/doc/build/kconfig/setting.rst +++ b/doc/build/kconfig/setting.rst @@ -7,7 +7,8 @@ The :ref:`menuconfig and guiconfig interfaces ` can be used to test out configurations during application development. This page explains how to make settings permanent. -All Kconfig options can be searched in the Kconfig search page. +All Kconfig options can be searched in the :ref:`Kconfig search page +`. .. note:: @@ -114,7 +115,8 @@ Assignments in configuration files are only respected if the dependencies for the symbol are satisfied. A warning is printed otherwise. To figure out what the dependencies of a symbol are, use one of the :ref:`interactive configuration interfaces ` (you can jump directly to a symbol with -:kbd:`/`), or look up the symbol in the Kconfig search page. +:kbd:`/`), or look up the symbol in the :ref:`Kconfig search page +`. .. _initial-conf: diff --git a/doc/develop/application/index.rst b/doc/develop/application/index.rst index 2f1fae6ebcbb..cc1b49fa3812 100644 --- a/doc/develop/application/index.rst +++ b/doc/develop/application/index.rst @@ -649,8 +649,9 @@ started. See :ref:`setting_configuration_values` for detailed documentation on setting Kconfig configuration values. The :ref:`initial-conf` section on the same page -explains how the initial configuration is derived. See :ref:`hardening` for -security information related with Kconfig options. +explains how the initial configuration is derived. See :ref:`kconfig-search` +for a complete list of configuration options. +See :ref:`hardening` for security information related with Kconfig options. The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration diff --git a/doc/kconfig.rst b/doc/kconfig.rst new file mode 100644 index 000000000000..1123de2adbd9 --- /dev/null +++ b/doc/kconfig.rst @@ -0,0 +1,8 @@ +:orphan: + +.. _kconfig-search: + +Kconfig Search +============== + +.. kconfig:search:: From 23dd73782bc43faa8039243c8441371012e16006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:58 +0200 Subject: [PATCH 3054/3334] Revert "[nrf noup] ci: add .github/test-spec.yml" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c660bc0206a2bd155c6de832ff32a5df72ebbc7a. Signed-off-by: Andrzej Głąbek --- .github/test-spec.yml | 392 ------------------------------------------ 1 file changed, 392 deletions(-) delete mode 100644 .github/test-spec.yml diff --git a/.github/test-spec.yml b/.github/test-spec.yml deleted file mode 100644 index 6da6bdbaa87d..000000000000 --- a/.github/test-spec.yml +++ /dev/null @@ -1,392 +0,0 @@ -# This is the Jenkins ci variant of the .github/labler.yaml - -"CI-run-zephyr-twister": - - any: - - "!.github/**/*" - - "!doc/**/*" - - "!CODEOWNERS" - - "!LICENSE" - - "!**/*.rst" - - "!VERSION" - - "!submanifests/**/*" - - "!MAINTAINERS.yml" - - "!version.h.in" - - "!Jenkinsfile" - - "!**/*.md" - -"CI-iot-zephyr-lwm2m-test": - - "drivers/console/**/*" - - "drivers/flash/**/*" - - "subsys/dfu/boot/**/*" - - "subsys/net/ip/**/*" - - "subsys/net/lib/http/**/*" - - "subsys/net/lib/lwm2m//**/*" - - "subsys/net/**/*" - -"CI-iot-samples-test": - - "boards/nordic/nrf9160dk/**/*" - - "dts/arm/nordic/nrf9160*" - - "include/net/**/*" - - "subsys/net/lib/**/*" - -"CI-iot-libraries-test": - - "boards/nordic/nrf9160dk/**/*" - - "dts/arm/nordic/nrf9160*" - - "include/net/socket_ncs.h" - - "subsys/testsuite/ztest/**/*" - -"CI-lwm2m-test": null -# Not necessary to run tests on changes to this repo. - -"CI-boot-test": - - "subsys/mgmt/mcumgr/**/*" - - "subsys/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "include/dfu/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "tests/boot/**/*" - - "tests/subsys/dfu/**/*" - - "tests/subsys/mgmt/mcumgr/**/*" - -"CI-tfm-test": - - "boards/nordic/nrf5340dk/**/*" - - "boards/nordic/nrf9160dk/**/*" - - "drivers/entropy/*" - - "dts/arm/nordic/nrf5340*" - - "dts/arm/nordic/nrf9160*" - - "modules/trusted-firmware-m/**/*" - - "samples/tfm_integration/**/*" - -"CI-ble-test": - - any: - - "drivers/bluetooth/**/*" - - any: - - "dts/arm/nordic/nrf5*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - - any: - - "include/zephyr/bluetooth/**/*" - - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/hci_ipc/**/*" - -"CI-ble-samples-test": - - any: - - "drivers/bluetooth/**/*" - - any: - - "dts/arm/nordic/nrf5*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - - any: - - "include/zephyr/bluetooth/**/*" - - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/**/*" - -"CI-mesh-test": - - "subsys/bluetooth/mesh/**/*" - - "include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/mesh/**/*" - - "samples/bluetooth/mesh_demo/**/*" - - "samples/bluetooth/mesh_provisioner/**/*" - - "tests/bluetooth/mesh/**/*" - - "tests/bluetooth/mesh_shell/**/*" - -"CI-thingy91-test": - - "boards/nordic/nrf9160dk/**/*" - - "arch/x86/core/**/*" - - "arch/x86/include/**/*" - - "drivers/console/**/*" - - "drivers/ethernet/**/*" - - "drivers/flash/**/*" - - "drivers/hwinfo/**/*" - - "drivers/interrupt_controller/**/*" - - "drivers/net/**/*" - - "drivers/serial/**/*" - - "drivers/timer/**/*" - - "include/**/*" - - "kernel/**/*" - - "lib/libc/common/source/stdlib/**/*" - - "lib/libc/newlib/**/*" - - "lib/libc/picolibc/**/*" - - "lib/os/**/*" - - "lib/posix/**/*" - - "misc/**/*" - - "modules/mbedtls/**/*" - - "soc/x86/ia32/**/*" - - "subsys/fs/fcb/**/*" - - "subsys/logging/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/include/**/*" - - "subsys/settings/src/**/*" - - "subsys/stats/**/*" - - "subsys/storage/flash_map/**/*" - - "subsys/storage/stream/**/*" - - "subsys/tracing/**/*" - -"CI-desktop-test": - - "drivers/bluetooth/*" - - "subsys/bluetooth/*" - - "include/zephyr/bluetooth/*" - -"CI-crypto-test": - - "boards/nordic/nrf52840dk/**/*" - - "boards/nordic/nrf5340dk/**/*" - - "boards/nordic/nrf9160dk/**/*" - - "drivers/entropy/*" - - "drivers/serial/**/*" - - "dts/arm/nordic/nrf52840*" - - "dts/arm/nordic/nrf5340*" - - "dts/arm/nordic/nrf9160*" - - "include/drivers/serial/**/*" - - "modules/mbedtls/**/*" - -"CI-fem-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "dts/bindings/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/arch/**/*" - - "lib/libc/**/*" - - "lib/open-amp/**/*" - - "modules/hal_nordic/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "modules/trusted-firmware-m/**/*" - - "samples/net/sockets/echo_*/**/*" - - "share/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - - "subsys/bluetooth/shell/**/*" - - "subsys/ipc/**/*" - - "Kconfig" - - "CMakeLists.txt" - -"CI-rs-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "dts/bindings/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/arch/**/*" - - "lib/libc/**/*" - - "lib/open-amp/**/*" - - "modules/hal_nordic/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "modules/trusted-firmware-m/**/*" - - "samples/net/sockets/echo_*/**/*" - - "share/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - - "subsys/bluetooth/shell/**/*" - - "subsys/ipc/**/*" - - "Kconfig" - - "CMakeLists.txt" - -"CI-thread-test": - - "include/zephyr/net/**/*" - - "modules/mbedtls/**/*" - - "modules/openthread/**/*" - - "samples/net/openthread/**/*" - - "soc/nordic/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-nfc-test": - - "drivers/bluetooth/hci/**/*" - - "drivers/entropy/**/*" - - "drivers/flash/**/*" - - "drivers/mbox/**/*" - - "drivers/spi/**/*" - - "lib/crc/**/*" - - "modules/hal_nordic/**/*" - - "soc/nordic/**/*" - - "subsys/ipc/ipc_service/**/*" - - "subsys/fs/**/*" - - "subsys/mem_mgmt/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/**/*" - - "subsys/shell/**/*" - - "subsys/storage/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - -"CI-matter-test": - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/settings/**/*" - - "subsys/net/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "drivers/net/**/*" - - "samples/bluetooth/hci_ipc/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - - "!subsys/bluetooth/audio/**/*" - -"CI-find-my-test": - - "boards/nordic/**/*" - - "drivers/bluetooth/**/*" - - "drivers/entropy/**/*" - - "drivers/flash/**/*" - - "drivers/usb/**/*" - - "drivers/regulator/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/fs/**/*" - - "subsys/ipc/**/*" - - "subsys/net/**/*" - - "subsys/random/**/*" - - "subsys/settings/**/*" - - "subsys/storage/**/*" - - "subsys/tracing/**/*" - - "subsys/usb/device/**/*" - - any: - - "subsys/bluetooth/**/*" - - "!subsys/bluetooth/mesh/**/*" - -"CI-rpc-test": - - "subsys/ipc/ipc_service/**/*" - - "subsys/random/**/*" - - "soc/nordic/nrf53/**/*" - -"CI-modemshell-test": - - "include/net/**/*" - - "include/posix/**/*" - - "include/shell/**/*" - - "drivers/net/**/*" - - "drivers/serial/**/*" - - "drivers/wifi/**/*" - - "subsys/shell/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-positioning-test": - - "include/net/**/*" - - "include/posix/**/*" - - "drivers/net/**/*" - - "drivers/wifi/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-cloud-test": - - "include/zephyr/dfu/**/*" - - "include/zephyr/net/**/*" - - "include/zephyr/posix/**/*" - - "include/zephyr/settings/**/*" - - "drivers/led/**/*" - - "drivers/net/**/*" - - "drivers/sensor/**/*" - - "drivers/serial/**/*" - - "drivers/wifi/**/*" - - "lib/posix/**/*" - - "soc/nordic/**/*" - - "subsys/dfu/**/*" - - "subsys/net/**/*" - - "subsys/settings/**/*" - -"CI-wifi": - - "subsys/net/l2/wifi/**/*" - - "subsys/net/l2/ethernet/**/*" - -"CI-audio-test": - - "boards/nordic/nrf5340_audio_dk/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/gpio/**/*" - - "drivers/i2c/**/*" - - "drivers/watchdog/**/*" - - "include/dfu/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/bluetooth/hci_ipc/**/*" - - "soc/nordic/**/*" - - "subsys/bluetooth/audio/**/*" - - "subsys/bluetooth/host/**/*" - - "subsys/dfu/**/*" - - "subsys/fs/**/*" - - "subsys/mgmt/mcumgr/**/*" - - "subsys/sd/**/*" - - "subsys/storage/**/*" - - "subsys/task_wdt/**/*" - - "subsys/usb/**/*" - - "subsys/zbus/**/*" - -"CI-pmic-samples-test": - - "samples/shields/npm1300_ek/**/*" - - "boards/shields/npm1300_ek/**/*" - - "**/**npm1300**/**" - - "drivers/regulator/regulator_common.c" - - "drivers/regulator/regulator_shell.c" - - "drivers/gpio/gpio_shell.c" - - "drivers/sensor/sensor_shell.c" - -"CI-test-low-level": - - "arch/**/*" - - "boards/nordic/nrf54*/**/*" - - "drivers/**/*" - - "dts/**/*" - - "include/zephyr/**/*" - - "kernel/**/*" - - "modules/hal_nordic/**/*" - - "samples/basic/blinky_pwm/**/*" - - "samples/basic/fade_led/**/*" - - "samples/boards/nrf/**/*" - - "samples/boards/nordic/**/*" - - "samples/drivers/adc/**/*" - - "samples/drivers/jesd216/**/*" - - "samples/drivers/mbox/**/*" - - "samples/drivers/soc_flash_nrf/**/*" - - "samples/drivers/spi_flash/**/*" - - "samples/drivers/watchdog/**/*" - - "samples/hello_world/**/*" - - "samples/sensor/**/*" - - "samples/subsys/ipc/**/*" - - "samples/subsys/logging/**/*" - - "samples/subsys/settings/**/*" - - "samples/subsys/usb/cdc_acm/**/*" - - "samples/subsys/usb/mass/**/*" - - "samples/synchronization/**/*" - - "subsys/logging/**/*" - - "subsys/settings/**/*" - - "tests/arch/**/*" - - "tests/boards/nrf/**/*" - - "tests/boards/nordic/**/*" - - "tests/drivers/**/*" - - "tests/kernel/**/*" - -"CI-suit-dfu-test": - - "subsys/mgmt/mcumgr/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "subsys/bluetooth/**/*" - - "drivers/bluetooth/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/console/**/*" - - "drivers/gpio/**/*" - - "dts/common/nordic/*" - - "dts/arm/nordic/nrf54h*/**/*" - - "dts/riscv/nordic/nrf54h*/**/*" - - "boards/nordic/nrf54h*/**/*" - - "soc/nordic/nrf54h/**/*" - - "include/zephyr/**/*" - - "subsys/logging/**/*" - - "subsys/tracing/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/nrfutil.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" From 64e28c1926f680ab1604d2728ef8c1bd4c55ad72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:59 +0200 Subject: [PATCH 3055/3334] Revert "[nrf noup] ci: scripts: add quarantine file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 960f89b397ee92b5b36ca044b8a2b78193e1ac88. Signed-off-by: Andrzej Głąbek --- scripts/quarantine.yaml | 88 ----------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 scripts/quarantine.yaml diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml deleted file mode 100644 index 20c4f9248ea9..000000000000 --- a/scripts/quarantine.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# The configurations resulting as a product of scenarios and platforms -# will be skipped if quarantine is used. More details here: -# https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine - -- scenarios: - - testing.ztest.busy_sim - - testing.ztest.busy_sim_nrf52840dk_pin - platforms: - - nrf52840dk_nrf52840 - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.unary_f64 - platforms: - - nrf5340dk_nrf5340_cpunet - - qemu_cortex_m3 - comment: "Flash overflows" - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.binary_f16 - - libraries.cmsis_dsp.matrix.binary_f16.fpu - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Flash overflows" - -# Already reported, but will not be fixed (look at the discussion): -# https://github.com/zephyrproject-rtos/zephyr/issues/44947 -- scenarios: - - libraries.cmsis_dsp.matrix.binary_q15 - - libraries.cmsis_dsp.matrix.binary_q15.fpu - - libraries.cmsis_dsp.matrix.unary_f32 - - libraries.cmsis_dsp.matrix.unary_f32.fpu - - libraries.cmsis_dsp.matrix.unary_f64 - - libraries.cmsis_dsp.matrix.unary_f64.fpu - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Flash overflows" - -# libsdl2-dev package should be added into docker image -- scenarios: - - sample.boards.nrf.nrf_led_matrix - - sample.display.lvgl.gui - platforms: - - native_posix - comment: "libsdl2-dev package not available" - -- scenarios: - - sample.net.sockets.echo_server.usbnet - - sample.net.sockets.echo_server.usbnet_composite - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - sample.net.zperf.netusb_ecm - - sample.net.zperf.netusb_eem - - sample.net.zperf.netusb_rndis - platforms: - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - net.mqtt.tls - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Ram/flash overflows, also in the upstream" - -- scenarios: - - kernel.common.picolibc - - libraries.picolibc - - libraries.libc.picolibc.mem_alloc - - libraries.picolibc.sprintf_new - platforms: - - nrf52dk_nrf52832 - comment: "Ram overflows, also in the upstream" - -- scenarios: - - sample.psa_crypto - platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - comment: "Due to using sdk-zephyr manifest instead of nrf. Should be fixed after the change" From a852f1854ea48c69412b993a5cb8b12c3ae25358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 29 Apr 2026 14:00:59 +0200 Subject: [PATCH 3056/3334] Revert "[nrf noup] ci: set `ZEPHYR__KCONFIG` for NCS modules" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 30e423a7b8352037c0ea7e0cb211aa8a2317f952. Signed-off-by: Andrzej Głąbek --- scripts/ci/check_compliance.py | 38 ---------------------------------- 1 file changed, 38 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 1db5b2e9cfc8..701fc1fce02a 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -722,13 +722,6 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir = ZEPHYR_BASE / 'modules' modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] - nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') - nrf_modules = [] - if os.path.exists(nrf_modules_dir): - nrf_modules = [name for name in os.listdir(nrf_modules_dir) if - os.path.exists(os.path.join(nrf_modules_dir, name, - 'Kconfig'))] - with open(modules_file) as fp_module_file: content = fp_module_file.read() @@ -740,39 +733,8 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir / module / 'Kconfig', ) ) - for module in nrf_modules: - fp_module_file.write( - "ZEPHYR_{}_KCONFIG = {}\n".format( - re.sub('[^a-zA-Z0-9]', '_', module).upper(), - nrf_modules_dir / module / 'Kconfig', - ) - ) - fp_module_file.write( - "NCS_{}_KCONFIG = {}\n".format( - re.sub('[^a-zA-Z0-9]', '_', module).upper(), - modules_dir / module / 'Kconfig', - ) - ) - # Add NRF as static entry as workaround for ext Kconfig root support - fp_module_file.write( - "ZEPHYR_NRF_KCONFIG = {}\n".format( - nrf_modules_dir / '..' / 'Kconfig.nrf', - ) - ) fp_module_file.write(content) - with open(sysbuild_modules_file) as fp_sysbuild_module_file: - content = fp_sysbuild_module_file.read() - - with open(sysbuild_modules_file, 'w') as fp_sysbuild_module_file: - # Add NRF as static entry as workaround for ext Kconfig root support - fp_sysbuild_module_file.write( - "SYSBUILD_NRF_KCONFIG = {}\n".format( - nrf_modules_dir / '..' / 'sysbuild' / 'Kconfig.sysbuild', - ) - ) - fp_sysbuild_module_file.write(content) - def get_kconfig_dts(self, kconfig_dts_file, settings_file): """ Generate the Kconfig.dts using dts/bindings as the source. From fabb24b23454940cec5dcc7f1551226ed02e36a6 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 26 Jan 2021 15:43:08 +0100 Subject: [PATCH 3057/3334] [nrf noup] ci: set `ZEPHYR__KCONFIG` for NCS modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit sets `ZEPHYR__KCONFIG` variable for each Kconfig file discovered in `nrf/modules//Kconfig`. This is not meant as a permanent solution; we should do more careful consideration on the optimal approach forward that will allow compliance_check.py to be used downstream with custom module_ext_roots, and at the same time keep current flexibility for module glue code handling intact. Adds a static path for the NRF Kconfig variable in the check compliance script, this is a temporary workaround due to supporting an external root for NCS that should be reworked to use package helper in future Signed-off-by: Torsten Rasmussen Signed-off-by: Martí Bolívar Signed-off-by: Carles Cufi Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Moń (cherry picked from commit 30e423a7b8352037c0ea7e0cb211aa8a2317f952) --- scripts/ci/check_compliance.py | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 9c3aa721b830..19616c5e4fde 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -746,6 +746,13 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir = ZEPHYR_BASE / 'modules' modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] + nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') + nrf_modules = [] + if os.path.exists(nrf_modules_dir): + nrf_modules = [name for name in os.listdir(nrf_modules_dir) if + os.path.exists(os.path.join(nrf_modules_dir, name, + 'Kconfig'))] + with open(modules_file) as fp_module_file: content = fp_module_file.read() @@ -757,8 +764,39 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir / module / 'Kconfig', ) ) + for module in nrf_modules: + fp_module_file.write( + "ZEPHYR_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + nrf_modules_dir / module / 'Kconfig', + ) + ) + fp_module_file.write( + "NCS_{}_KCONFIG = {}\n".format( + re.sub('[^a-zA-Z0-9]', '_', module).upper(), + modules_dir / module / 'Kconfig', + ) + ) + # Add NRF as static entry as workaround for ext Kconfig root support + fp_module_file.write( + "ZEPHYR_NRF_KCONFIG = {}\n".format( + nrf_modules_dir / '..' / 'Kconfig.nrf', + ) + ) fp_module_file.write(content) + with open(sysbuild_modules_file) as fp_sysbuild_module_file: + content = fp_sysbuild_module_file.read() + + with open(sysbuild_modules_file, 'w') as fp_sysbuild_module_file: + # Add NRF as static entry as workaround for ext Kconfig root support + fp_sysbuild_module_file.write( + "SYSBUILD_NRF_KCONFIG = {}\n".format( + nrf_modules_dir / '..' / 'sysbuild' / 'Kconfig.sysbuild', + ) + ) + fp_sysbuild_module_file.write(content) + def get_kconfig_dts(self, kconfig_dts_file, settings_file): """ Generate the Kconfig.dts using dts/bindings as the source. From d0b8e0a8e37885df9dcc046305e4755ffcdf8882 Mon Sep 17 00:00:00 2001 From: Piotr Golyzniak Date: Mon, 1 Aug 2022 13:06:01 +0200 Subject: [PATCH 3058/3334] [nrf noup] ci: scripts: add quarantine file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add scripts/quarantine.yaml file, which will be used in CI. Signed-off-by: Piotr Golyzniak Signed-off-by: Andrzej Głąbek Signed-off-by: Maciej Perkowski Signed-off-by: Robert Lubos (cherry picked from commit 960f89b397ee92b5b36ca044b8a2b78193e1ac88) --- scripts/quarantine.yaml | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 scripts/quarantine.yaml diff --git a/scripts/quarantine.yaml b/scripts/quarantine.yaml new file mode 100644 index 000000000000..20c4f9248ea9 --- /dev/null +++ b/scripts/quarantine.yaml @@ -0,0 +1,88 @@ +# The configurations resulting as a product of scenarios and platforms +# will be skipped if quarantine is used. More details here: +# https://docs.zephyrproject.org/latest/guides/test/twister.html#quarantine + +- scenarios: + - testing.ztest.busy_sim + - testing.ztest.busy_sim_nrf52840dk_pin + platforms: + - nrf52840dk_nrf52840 + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.unary_f64 + platforms: + - nrf5340dk_nrf5340_cpunet + - qemu_cortex_m3 + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_f16 + - libraries.cmsis_dsp.matrix.binary_f16.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Flash overflows" + +# Already reported, but will not be fixed (look at the discussion): +# https://github.com/zephyrproject-rtos/zephyr/issues/44947 +- scenarios: + - libraries.cmsis_dsp.matrix.binary_q15 + - libraries.cmsis_dsp.matrix.binary_q15.fpu + - libraries.cmsis_dsp.matrix.unary_f32 + - libraries.cmsis_dsp.matrix.unary_f32.fpu + - libraries.cmsis_dsp.matrix.unary_f64 + - libraries.cmsis_dsp.matrix.unary_f64.fpu + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Flash overflows" + +# libsdl2-dev package should be added into docker image +- scenarios: + - sample.boards.nrf.nrf_led_matrix + - sample.display.lvgl.gui + platforms: + - native_posix + comment: "libsdl2-dev package not available" + +- scenarios: + - sample.net.sockets.echo_server.usbnet + - sample.net.sockets.echo_server.usbnet_composite + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - sample.net.zperf.netusb_ecm + - sample.net.zperf.netusb_eem + - sample.net.zperf.netusb_rndis + platforms: + - nrf52833dk_nrf52833 + - nrf5340dk_nrf5340_cpuapp_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - net.mqtt.tls + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Ram/flash overflows, also in the upstream" + +- scenarios: + - kernel.common.picolibc + - libraries.picolibc + - libraries.libc.picolibc.mem_alloc + - libraries.picolibc.sprintf_new + platforms: + - nrf52dk_nrf52832 + comment: "Ram overflows, also in the upstream" + +- scenarios: + - sample.psa_crypto + platforms: + - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk_nrf9160_ns + comment: "Due to using sdk-zephyr manifest instead of nrf. Should be fixed after the change" From 3f77045995d7cf3296e09e25183fe12662d617f5 Mon Sep 17 00:00:00 2001 From: Sebastian Wezel Date: Tue, 15 Mar 2022 13:12:25 +0100 Subject: [PATCH 3059/3334] [nrf noup] ci: add .github/test-spec.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file is used for NCS-specific testing configuration based on modifications to files in this repository. Signed-off-by: Alperen Sener Signed-off-by: Elisabeth Solheim Klakken Signed-off-by: Mariusz Poslinski Signed-off-by: Markus Swarowsky Signed-off-by: Robert Lubos Signed-off-by: Sebastian Wezel Signed-off-by: Tomasz Tyzenhauz Signed-off-by: Fredrik Ås Signed-off-by: Michał Szablowski Signed-off-by: Tony Le Signed-off-by: Krishna T Signed-off-by: Dawid Przybylo Signed-off-by: Rubin Gerritsen Signed-off-by: Jørgen Kvalvaag Signed-off-by: Magne Værnes Signed-off-by: Lang Xie Signed-off-by: Alexander Svensen Signed-off-by: Jan Gałda Signed-off-by: Vladislav Litvinov Signed-off-by: Guojun Wang Signed-off-by: Piotr Kosycarz Signed-off-by: Thomas Stilwell Signed-off-by: Krzysztof Szromek Signed-off-by: Grzegorz Chwierut Signed-off-by: Eduardo Montoya Signed-off-by: Pavel Vasilyev (cherry picked from commit c660bc0206a2bd155c6de832ff32a5df72ebbc7a) --- .github/test-spec.yml | 392 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 .github/test-spec.yml diff --git a/.github/test-spec.yml b/.github/test-spec.yml new file mode 100644 index 000000000000..6da6bdbaa87d --- /dev/null +++ b/.github/test-spec.yml @@ -0,0 +1,392 @@ +# This is the Jenkins ci variant of the .github/labler.yaml + +"CI-run-zephyr-twister": + - any: + - "!.github/**/*" + - "!doc/**/*" + - "!CODEOWNERS" + - "!LICENSE" + - "!**/*.rst" + - "!VERSION" + - "!submanifests/**/*" + - "!MAINTAINERS.yml" + - "!version.h.in" + - "!Jenkinsfile" + - "!**/*.md" + +"CI-iot-zephyr-lwm2m-test": + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "subsys/dfu/boot/**/*" + - "subsys/net/ip/**/*" + - "subsys/net/lib/http/**/*" + - "subsys/net/lib/lwm2m//**/*" + - "subsys/net/**/*" + +"CI-iot-samples-test": + - "boards/nordic/nrf9160dk/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/**/*" + - "subsys/net/lib/**/*" + +"CI-iot-libraries-test": + - "boards/nordic/nrf9160dk/**/*" + - "dts/arm/nordic/nrf9160*" + - "include/net/socket_ncs.h" + - "subsys/testsuite/ztest/**/*" + +"CI-lwm2m-test": null +# Not necessary to run tests on changes to this repo. + +"CI-boot-test": + - "subsys/mgmt/mcumgr/**/*" + - "subsys/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/dfu/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "tests/boot/**/*" + - "tests/subsys/dfu/**/*" + - "tests/subsys/mgmt/mcumgr/**/*" + +"CI-tfm-test": + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf9160dk/**/*" + - "drivers/entropy/*" + - "dts/arm/nordic/nrf5340*" + - "dts/arm/nordic/nrf9160*" + - "modules/trusted-firmware-m/**/*" + - "samples/tfm_integration/**/*" + +"CI-ble-test": + - any: + - "drivers/bluetooth/**/*" + - any: + - "dts/arm/nordic/nrf5*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + - any: + - "include/zephyr/bluetooth/**/*" + - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/hci_ipc/**/*" + +"CI-ble-samples-test": + - any: + - "drivers/bluetooth/**/*" + - any: + - "dts/arm/nordic/nrf5*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + - any: + - "include/zephyr/bluetooth/**/*" + - "!include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/**/*" + +"CI-mesh-test": + - "subsys/bluetooth/mesh/**/*" + - "include/zephyr/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh/**/*" + - "samples/bluetooth/mesh_demo/**/*" + - "samples/bluetooth/mesh_provisioner/**/*" + - "tests/bluetooth/mesh/**/*" + - "tests/bluetooth/mesh_shell/**/*" + +"CI-thingy91-test": + - "boards/nordic/nrf9160dk/**/*" + - "arch/x86/core/**/*" + - "arch/x86/include/**/*" + - "drivers/console/**/*" + - "drivers/ethernet/**/*" + - "drivers/flash/**/*" + - "drivers/hwinfo/**/*" + - "drivers/interrupt_controller/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/timer/**/*" + - "include/**/*" + - "kernel/**/*" + - "lib/libc/common/source/stdlib/**/*" + - "lib/libc/newlib/**/*" + - "lib/libc/picolibc/**/*" + - "lib/os/**/*" + - "lib/posix/**/*" + - "misc/**/*" + - "modules/mbedtls/**/*" + - "soc/x86/ia32/**/*" + - "subsys/fs/fcb/**/*" + - "subsys/logging/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/include/**/*" + - "subsys/settings/src/**/*" + - "subsys/stats/**/*" + - "subsys/storage/flash_map/**/*" + - "subsys/storage/stream/**/*" + - "subsys/tracing/**/*" + +"CI-desktop-test": + - "drivers/bluetooth/*" + - "subsys/bluetooth/*" + - "include/zephyr/bluetooth/*" + +"CI-crypto-test": + - "boards/nordic/nrf52840dk/**/*" + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf9160dk/**/*" + - "drivers/entropy/*" + - "drivers/serial/**/*" + - "dts/arm/nordic/nrf52840*" + - "dts/arm/nordic/nrf5340*" + - "dts/arm/nordic/nrf9160*" + - "include/drivers/serial/**/*" + - "modules/mbedtls/**/*" + +"CI-fem-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "dts/bindings/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/arch/**/*" + - "lib/libc/**/*" + - "lib/open-amp/**/*" + - "modules/hal_nordic/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "modules/trusted-firmware-m/**/*" + - "samples/net/sockets/echo_*/**/*" + - "share/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + - "subsys/bluetooth/shell/**/*" + - "subsys/ipc/**/*" + - "Kconfig" + - "CMakeLists.txt" + +"CI-rs-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "dts/bindings/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/arch/**/*" + - "lib/libc/**/*" + - "lib/open-amp/**/*" + - "modules/hal_nordic/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "modules/trusted-firmware-m/**/*" + - "samples/net/sockets/echo_*/**/*" + - "share/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + - "subsys/bluetooth/shell/**/*" + - "subsys/ipc/**/*" + - "Kconfig" + - "CMakeLists.txt" + +"CI-thread-test": + - "include/zephyr/net/**/*" + - "modules/mbedtls/**/*" + - "modules/openthread/**/*" + - "samples/net/openthread/**/*" + - "soc/nordic/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-nfc-test": + - "drivers/bluetooth/hci/**/*" + - "drivers/entropy/**/*" + - "drivers/flash/**/*" + - "drivers/mbox/**/*" + - "drivers/spi/**/*" + - "lib/crc/**/*" + - "modules/hal_nordic/**/*" + - "soc/nordic/**/*" + - "subsys/ipc/ipc_service/**/*" + - "subsys/fs/**/*" + - "subsys/mem_mgmt/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/**/*" + - "subsys/shell/**/*" + - "subsys/storage/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-matter-test": + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/settings/**/*" + - "subsys/net/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "drivers/net/**/*" + - "samples/bluetooth/hci_ipc/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - "!subsys/bluetooth/audio/**/*" + +"CI-find-my-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/**/*" + - "drivers/entropy/**/*" + - "drivers/flash/**/*" + - "drivers/usb/**/*" + - "drivers/regulator/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/fs/**/*" + - "subsys/ipc/**/*" + - "subsys/net/**/*" + - "subsys/random/**/*" + - "subsys/settings/**/*" + - "subsys/storage/**/*" + - "subsys/tracing/**/*" + - "subsys/usb/device/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + +"CI-rpc-test": + - "subsys/ipc/ipc_service/**/*" + - "subsys/random/**/*" + - "soc/nordic/nrf53/**/*" + +"CI-modemshell-test": + - "include/net/**/*" + - "include/posix/**/*" + - "include/shell/**/*" + - "drivers/net/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "subsys/shell/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-positioning-test": + - "include/net/**/*" + - "include/posix/**/*" + - "drivers/net/**/*" + - "drivers/wifi/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-cloud-test": + - "include/zephyr/dfu/**/*" + - "include/zephyr/net/**/*" + - "include/zephyr/posix/**/*" + - "include/zephyr/settings/**/*" + - "drivers/led/**/*" + - "drivers/net/**/*" + - "drivers/sensor/**/*" + - "drivers/serial/**/*" + - "drivers/wifi/**/*" + - "lib/posix/**/*" + - "soc/nordic/**/*" + - "subsys/dfu/**/*" + - "subsys/net/**/*" + - "subsys/settings/**/*" + +"CI-wifi": + - "subsys/net/l2/wifi/**/*" + - "subsys/net/l2/ethernet/**/*" + +"CI-audio-test": + - "boards/nordic/nrf5340_audio_dk/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/gpio/**/*" + - "drivers/i2c/**/*" + - "drivers/watchdog/**/*" + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/bluetooth/hci_ipc/**/*" + - "soc/nordic/**/*" + - "subsys/bluetooth/audio/**/*" + - "subsys/bluetooth/host/**/*" + - "subsys/dfu/**/*" + - "subsys/fs/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "subsys/sd/**/*" + - "subsys/storage/**/*" + - "subsys/task_wdt/**/*" + - "subsys/usb/**/*" + - "subsys/zbus/**/*" + +"CI-pmic-samples-test": + - "samples/shields/npm1300_ek/**/*" + - "boards/shields/npm1300_ek/**/*" + - "**/**npm1300**/**" + - "drivers/regulator/regulator_common.c" + - "drivers/regulator/regulator_shell.c" + - "drivers/gpio/gpio_shell.c" + - "drivers/sensor/sensor_shell.c" + +"CI-test-low-level": + - "arch/**/*" + - "boards/nordic/nrf54*/**/*" + - "drivers/**/*" + - "dts/**/*" + - "include/zephyr/**/*" + - "kernel/**/*" + - "modules/hal_nordic/**/*" + - "samples/basic/blinky_pwm/**/*" + - "samples/basic/fade_led/**/*" + - "samples/boards/nrf/**/*" + - "samples/boards/nordic/**/*" + - "samples/drivers/adc/**/*" + - "samples/drivers/jesd216/**/*" + - "samples/drivers/mbox/**/*" + - "samples/drivers/soc_flash_nrf/**/*" + - "samples/drivers/spi_flash/**/*" + - "samples/drivers/watchdog/**/*" + - "samples/hello_world/**/*" + - "samples/sensor/**/*" + - "samples/subsys/ipc/**/*" + - "samples/subsys/logging/**/*" + - "samples/subsys/settings/**/*" + - "samples/subsys/usb/cdc_acm/**/*" + - "samples/subsys/usb/mass/**/*" + - "samples/synchronization/**/*" + - "subsys/logging/**/*" + - "subsys/settings/**/*" + - "tests/arch/**/*" + - "tests/boards/nrf/**/*" + - "tests/boards/nordic/**/*" + - "tests/drivers/**/*" + - "tests/kernel/**/*" + +"CI-suit-dfu-test": + - "subsys/mgmt/mcumgr/**/*" + - "include/mgmt/mcumgr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "subsys/bluetooth/**/*" + - "drivers/bluetooth/**/*" + - "drivers/flash/**/*" + - "drivers/spi/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/console/**/*" + - "drivers/gpio/**/*" + - "dts/common/nordic/*" + - "dts/arm/nordic/nrf54h*/**/*" + - "dts/riscv/nordic/nrf54h*/**/*" + - "boards/nordic/nrf54h*/**/*" + - "soc/nordic/nrf54h/**/*" + - "include/zephyr/**/*" + - "subsys/logging/**/*" + - "subsys/tracing/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/nrfutil.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" From 25b586cc74d737bad8eb710807c750e253718162 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 3 Mar 2022 15:28:16 +0100 Subject: [PATCH 3060/3334] [nrf noup] doc: remove Kconfig search Kconfig search is handled in a separate docset in NCS, so remove the page. This is a long-term noup patch. Signed-off-by: Gerard Marull-Paretas Signed-off-by: Krishna T (cherry picked from commit 433fa6a009070e37c42804a85789fa966214dec1) --- MAINTAINERS.yml | 1 - doc/build/kconfig/setting.rst | 6 ++---- doc/develop/application/index.rst | 5 ++--- doc/kconfig.rst | 8 -------- 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 doc/kconfig.rst diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index c45bd07c555c..065806f804d0 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1286,7 +1286,6 @@ Documentation: - doc/index-tex.rst - doc/index.html - doc/index.rst - - doc/kconfig.rst - doc/templates/sample.tmpl - doc/templates/board.tmpl - boards/index.rst diff --git a/doc/build/kconfig/setting.rst b/doc/build/kconfig/setting.rst index 17eafc95a3be..cbaf9c5b3897 100644 --- a/doc/build/kconfig/setting.rst +++ b/doc/build/kconfig/setting.rst @@ -7,8 +7,7 @@ The :ref:`menuconfig and guiconfig interfaces ` can be used to test out configurations during application development. This page explains how to make settings permanent. -All Kconfig options can be searched in the :ref:`Kconfig search page -`. +All Kconfig options can be searched in the Kconfig search page. .. note:: @@ -115,8 +114,7 @@ Assignments in configuration files are only respected if the dependencies for the symbol are satisfied. A warning is printed otherwise. To figure out what the dependencies of a symbol are, use one of the :ref:`interactive configuration interfaces ` (you can jump directly to a symbol with -:kbd:`/`), or look up the symbol in the :ref:`Kconfig search page -`. +:kbd:`/`), or look up the symbol in the Kconfig search page. .. _initial-conf: diff --git a/doc/develop/application/index.rst b/doc/develop/application/index.rst index 3e6cceb55342..4346d10f6592 100644 --- a/doc/develop/application/index.rst +++ b/doc/develop/application/index.rst @@ -649,9 +649,8 @@ started. See :ref:`setting_configuration_values` for detailed documentation on setting Kconfig configuration values. The :ref:`initial-conf` section on the same page -explains how the initial configuration is derived. See :ref:`kconfig-search` -for a complete list of configuration options. -See :ref:`hardening` for security information related with Kconfig options. +explains how the initial configuration is derived. See :ref:`hardening` for +security information related with Kconfig options. The other pages in the :ref:`Kconfig section of the manual ` are also worth going through, especially if you planning to add new configuration diff --git a/doc/kconfig.rst b/doc/kconfig.rst deleted file mode 100644 index 1123de2adbd9..000000000000 --- a/doc/kconfig.rst +++ /dev/null @@ -1,8 +0,0 @@ -:orphan: - -.. _kconfig-search: - -Kconfig Search -============== - -.. kconfig:search:: From 2218d07991738365b3a019690c9fdb58329c28e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 13 Jan 2022 11:37:18 +0100 Subject: [PATCH 3061/3334] [nrf noup] modules: tf-m: use of PSA_HAS_XXXX_SUPPORT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This allows configurations enabled by PSA_WANTS_ALG_XXXX to be used to control which TF-M module is enabled -If the TF-M image doesn't support e.g. the MAC APIs, then the MAC interface is not enabled Note: This functionality requires that nrf_security is enabled ref: NCSDK-11689 Make TF-M crypto module depend on PSA_WANT_GENERATE_RANDOM, same as all other crypto modules, which have PSA_HAS to group all PSA features that require the module. This makes TF-M by default exclude the RNG module when not needed. Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Joakim Andersson (cherry picked from commit bac94d557eb647a0a8ba6b21e81bc31dbd724eff) --- modules/trusted-firmware-m/Kconfig.tfm.crypto_modules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules index 1d70a2c44d29..02d3580c22f3 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules @@ -10,6 +10,7 @@ if TFM_PARTITION_CRYPTO config TFM_CRYPTO_RNG_MODULE_ENABLED bool "Random number generator crypto module" default y + depends on PSA_WANT_GENERATE_RANDOM && NRF_SECURITY help Enables the random number generator module within the crypto partition. Unset this option if 'psa_generate_random' is not used. @@ -17,6 +18,7 @@ config TFM_CRYPTO_RNG_MODULE_ENABLED config TFM_CRYPTO_KEY_MODULE_ENABLED bool "KEY crypto module" default y + depends on PSA_HAS_KEY_SUPPORT && NRF_SECURITY help Enables the KEY crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_management.c' @@ -25,6 +27,7 @@ config TFM_CRYPTO_KEY_MODULE_ENABLED config TFM_CRYPTO_AEAD_MODULE_ENABLED bool "AEAD crypto module" default y + depends on PSA_HAS_AEAD_SUPPORT && NRF_SECURITY help Enables the AEAD crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_aead.c' @@ -33,6 +36,7 @@ config TFM_CRYPTO_AEAD_MODULE_ENABLED config TFM_CRYPTO_MAC_MODULE_ENABLED bool "MAC crypto module" default y + depends on PSA_HAS_MAC_SUPPORT && NRF_SECURITY help Enables the MAC crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_mac.c' @@ -41,6 +45,7 @@ config TFM_CRYPTO_MAC_MODULE_ENABLED config TFM_CRYPTO_HASH_MODULE_ENABLED bool "HASH crypto module" default y + depends on PSA_HAS_HASH_SUPPORT && NRF_SECURITY help Enables the HASH crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_hash.c' @@ -49,6 +54,7 @@ config TFM_CRYPTO_HASH_MODULE_ENABLED config TFM_CRYPTO_CIPHER_MODULE_ENABLED bool "CIPHER crypto module" default y + depends on PSA_HAS_CIPHER_SUPPORT && NRF_SECURITY help Enables the CIPHER crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_cipher.c' @@ -57,6 +63,7 @@ config TFM_CRYPTO_CIPHER_MODULE_ENABLED config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED bool "ASYM ENCRYPT crypto module" default y + depends on PSA_HAS_ASYM_ENCRYPT_SUPPORT && NRF_SECURITY help Enables the ASYM ENCRYPT crypto module within the crypto partition. Unset this option if the encrypt functionality provided by 'crypto_asymmetric.c' @@ -65,6 +72,7 @@ config TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED bool "ASYM SIGN crypto module" default y + depends on PSA_HAS_ASYM_SIGN_SUPPORT && NRF_SECURITY help Enables the ASYM SIGN crypto module within the crypto partition. Unset this option if the sign functionality provided by 'crypto_asymmetric.c' @@ -73,10 +81,12 @@ config TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED bool "KEY DERIVATION crypto module" default y + depends on (PSA_HAS_KEY_DERIVATION || PSA_HAS_KEY_AGREEMENT) && NRF_SECURITY help Enables the KEY_DERIVATION crypto module within the crypto partition. Unset this option if the functionality provided by 'crypto_key_derivation.c' is not used. + Note that key agreement is under key derivation in the current implementation. endif # TFM_PARTITION_CRYPTO From 7f89bbe161fcbecca1a36f476a214f5afaf6c72e Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Mon, 12 Feb 2024 14:30:23 +0100 Subject: [PATCH 3062/3334] [nrf noup] modules: mbedtls: Add include folders We moved the header files in sdk-mbedtls from the library folder to the include/library folder. This was done to avoid issues when building MbedTLS with the nrf_security module and the Oberon PSA core. The Oberon PSA core provides a subset of these header files and since they are included with quotes we cannot have them in the same directory. This change make the needed adaptions in CMake for the applications that don't use nrf_security. Signed-off-by: Georgios Vasilakis Signed-off-by: Markus Swarowsky (cherry picked from commit 82142dbc3767a4b05b1877f8a35dcc2606063ccb) --- modules/mbedtls/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index e75bfae7feb9..2c6cf0073325 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -62,6 +62,8 @@ if(CONFIG_MBEDTLS) # Add Mbed TLS public include directories to the "mbedTLS" interface library. target_include_directories(mbedTLS INTERFACE $ + ${ZEPHYR_CURRENT_MODULE_DIR}/include/library + ${ZEPHYR_CURRENT_MODULE_DIR}/library ) # Add local include directories to the "mbedTLS" interface library. From 0ca30a0caadffe19987e496307d6291ed56264c0 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 13 Jul 2023 13:42:10 +0000 Subject: [PATCH 3063/3334] [nrf noup] drivers/flashdisk: Add support for Partition Manager The commits adds support for generating flash disks from Partition Manager defined partitions. Signed-off-by: Dominik Ermel (cherry picked from commit 97649f1cba744554f06675f4fa1aeabd2665852a) --- drivers/disk/flashdisk.c | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index bdb19fae1663..a23b719d4291 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -504,6 +504,8 @@ static const struct disk_operations flash_disk_ops = { .ioctl = disk_flash_access_ioctl, }; +#ifndef USE_PARTITION_MANAGER +/* The non-Partition manager, DTS based generators below */ #define DT_DRV_COMPAT zephyr_flash_disk #define PARTITION_PHANDLE(n) DT_PHANDLE_BY_IDX(DT_DRV_INST(n), partition, 0) @@ -545,6 +547,82 @@ DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) "Devicetree node " DT_NODE_PATH(DT_DRV_INST(n)) \ " has cache size which is not a multiple of its sector size"); DT_INST_FOREACH_STATUS_OKAY(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) +#else /* ifndef USE_PARTITION_MANAGER */ +/* Partition Manager based generators below */ + +/* Gets the PM_..._EXTRA_PARAM_##param value */ +#define PM_FLASH_DISK_ENTRY_EXTRA_PARAM(name, param) PM_##name##_EXTRA_PARAM_disk_##param + +/* Gets the PM_..._NAME value which is originally cased, as in yaml, partition name */ +#define PM_FLASH_DISK_ENTRY_PARTITION_NAME(name) PM_##name##_NAME + +/* Generates flashdiskN_cache variable name, where N is partition ID */ +#define PM_FLASH_DISK_CACHE_VARIABLE(n) UTIL_CAT(flashdisk, UTIL_CAT(FIXED_PARTITION_ID(n), _cache)) + +/* Generate cache buffers */ +#define CACHE_SIZE(n) (COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), (0), (1)) * \ + PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size)) +#define DEFINE_FLASHDISKS_CACHE(n) \ + static uint8_t __aligned(4) PM_FLASH_DISK_CACHE_VARIABLE(n)[CACHE_SIZE(n)]; + +PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) + +/* Generated single Flash Disk device data from Partition Manager partition. + * Partition is required to have type set to disk in partition definitions: + * type: disk + * and following extra params can be provided: + * extra_params: { + * name = "", + * cache_size = , + * sector_size = , + * read_only = + * } + * where: + * is mandatory device name that will be used by Disk Access and FAT FS to mount device; + * is cache r/w cache size, which is mandatory if read_only = 0 or not present, + * and should be multiple of ; + * is mandatory device sector size information, usually should be erase page size, + * for flash devices, for example 4096 bytes; + * read_only is optional, if not present then assumed false; can be 0(false) or 1(true). + */ +#define DEFINE_FLASHDISKS_DEVICE(n) \ +{ \ + .info = { \ + .ops = &flash_disk_ops, \ + .name = STRINGIFY(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, name)), \ + }, \ + .area_id = FIXED_PARTITION_ID(n), \ + .offset = FIXED_PARTITION_OFFSET(n), \ + .cache = PM_FLASH_DISK_CACHE_VARIABLE(n), \ + .cache_size = sizeof(PM_FLASH_DISK_CACHE_VARIABLE(n)), \ + .size = FIXED_PARTITION_SIZE(n), \ + .sector_size = PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size), \ +}, + +/* The bellow used PM_FOREACH_TYPE_disk is generated by Partition Manager foreach + * loop macro. The lower case _disk is type name for which the macro has been generated; + * partition entry can have multiple types set and foreach macro will be generated + * for every type found across partition definitions. + */ +static struct flashdisk_data flash_disks[] = { + PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE) +}; + +#define VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY(n) \ + COND_CODE_1(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, read_only), \ + (/* cache-size is not used for read-only disks */), \ + (BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) != 0, \ + "Flash disk partition " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n))\ + " must have non-zero cache-size");)) +PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) + +#define VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE(n) \ + BUILD_ASSERT(PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, cache_size) % \ + PM_FLASH_DISK_ENTRY_EXTRA_PARAM(n, sector_size) == 0, \ + "Devicetree node " STRINGIFY(PM_FLASH_DISK_ENTRY_PARTITION_NAME(n)) \ + " has cache size which is not a multiple of its sector size"); +PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_MULTIPLY_OF_SECTOR_SIZE) +#endif /* USE_PARTITION_MANAGER */ static int disk_flash_init(void) { From 972389ec4cc3ee9f3e44a5fb54e78f6f1654f7e6 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 23 Jun 2022 14:10:01 +0000 Subject: [PATCH 3064/3334] [nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit adds bootutil hook, for nrf5340, to allow it handling the non-accessible image-1/primary slot. Signed-off-by: Andrzej Głąbek Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Johann Fischer Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit 4d3a054bee760c70509d61775d2f51eac73ce605) --- subsys/mgmt/mcumgr/CMakeLists.txt | 8 +++++ subsys/mgmt/mcumgr/Kconfig | 1 + .../mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 35 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index 39d4a4ca8ce0..ad088eca0677 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -16,3 +16,11 @@ add_subdirectory(transport) add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) + +if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index c917b1e55e0a..5a7314ad57ed 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,6 +6,7 @@ menuconfig MCUMGR bool "MCUmgr Support" depends on NET_BUF depends on ZCBOR + imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) help This option enables the MCUmgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c new file mode 100644 index 000000000000..f1ac8a168e65 --- /dev/null +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "bootutil/bootutil_public.h" + +#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 +/* Sysbuild */ +#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER +#else +/* Legacy child/parent */ +#define NET_CORE_IMAGE 1 +#endif + +int boot_read_swap_state_primary_slot_hook(int image_index, + struct boot_swap_state *state) +{ + if (image_index == NET_CORE_IMAGE) { + /* Pretend that primary slot of image 1 unpopulated */ + state->magic = BOOT_MAGIC_UNSET; + state->swap_type = BOOT_SWAP_TYPE_NONE; + state->image_num = image_index; + state->copy_done = BOOT_FLAG_UNSET; + state->image_ok = BOOT_FLAG_UNSET; + + /* Prevent bootutil from trying to obtain true info */ + return 0; + } + + return BOOT_HOOK_REGULAR; +} From db67a211f47003dc11ff9068e7e645b548841437 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 16 Oct 2023 08:40:38 +0100 Subject: [PATCH 3065/3334] [nrf noup] samples: bluetooth: hci_pow_ctrl: Migrate child image config Migrates child image configuration for this sample over to sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit ffc0901fd6d92dff0cb889ada2b5d740b37eb35d) --- samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf new file mode 100644 index 000000000000..e6749ae63990 --- /dev/null +++ b/samples/bluetooth/hci_pwr_ctrl/sysbuild/hci_rpmsg.conf @@ -0,0 +1 @@ +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From 4bbb16c1d9e514a734eb55c1081272e5e429bcd9 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 16 Oct 2023 08:41:27 +0100 Subject: [PATCH 3066/3334] [nrf noup] samples: mgmt: mcumgr smp_svr: Migrate child image config Migrates child image configuration for this sample over to sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit 8c39a5f75aa0ae22e66b20b1027d6636dac9dd16) --- .../subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf new file mode 100644 index 000000000000..98260877332f --- /dev/null +++ b/samples/subsys/mgmt/mcumgr/smp_svr/sysbuild/hci_rpmsg.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2022 Nordic Semiconductor +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_BT_MAX_CONN=2 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=502 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 From 5c5e62634809b201c14f9ceb8f9adfa7692947b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 1 Dec 2022 14:41:13 +0100 Subject: [PATCH 3067/3334] [nrf noup] samples&tests: Restore a few CONFIG_NEWLIB_LIBC_NANO=n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit 9dd570f8a2207a02c886480b0065cd5a0e3a2e94. Since in NCS, unlike in vanilla Zephyr, the nano variant of newlib is the default one, restore entries that disable the nano variant in one sample and one test that require the full newlib variant. This patch is supposed to be removed when picolibc becomes the default. Signed-off-by: Andrzej Głąbek Signed-off-by: Dominik Ermel (cherry picked from commit 56c7896a6e65c8d8ae8e2a44b8afd10faa239770) --- tests/lib/newlib/heap_listener/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib/newlib/heap_listener/prj.conf b/tests/lib/newlib/heap_listener/prj.conf index e5a5dc6df4c1..7282777ff1ca 100644 --- a/tests/lib/newlib/heap_listener/prj.conf +++ b/tests/lib/newlib/heap_listener/prj.conf @@ -1,3 +1,4 @@ CONFIG_ZTEST=y CONFIG_NEWLIB_LIBC=y +CONFIG_NEWLIB_LIBC_NANO=n CONFIG_NEWLIB_LIBC_HEAP_LISTENER=y From 767d56be5b49fc361ed3b3f750544eaf9ae00482 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 15 Dec 2023 07:57:14 +0000 Subject: [PATCH 3068/3334] [nrf noup] samples/tests: Disable PM for some sysbuild builds Disables partition manager when building some samples and tests which use sysbuild to prevent build issues Signed-off-by: Jamie McCrae (cherry picked from commit e99379d6a289797fe4361658f4a04e44b651d705) --- samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf | 1 + samples/drivers/mbox/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf | 1 + samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf | 1 + samples/subsys/logging/multidomain/sysbuild.conf | 1 + samples/subsys/zbus/proxy_agent_ipc/sysbuild.conf | 1 + tests/boot/mcuboot_recovery_retention/sysbuild.conf | 1 + tests/boot/test_mcuboot/sysbuild.conf | 1 + tests/drivers/flash/common/sysbuild.conf | 1 + tests/drivers/flash/negative_tests/sysbuild.conf | 1 + tests/subsys/fs/fcb/sysbuild.conf | 1 + tests/subsys/fs/littlefs/sysbuild.conf | 1 + 13 files changed, 13 insertions(+) create mode 100644 samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf create mode 100644 samples/drivers/mbox/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf create mode 100644 samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf create mode 100644 samples/subsys/logging/multidomain/sysbuild.conf create mode 100644 samples/subsys/zbus/proxy_agent_ipc/sysbuild.conf create mode 100644 tests/drivers/flash/common/sysbuild.conf create mode 100644 tests/drivers/flash/negative_tests/sysbuild.conf create mode 100644 tests/subsys/fs/fcb/sysbuild.conf create mode 100644 tests/subsys/fs/littlefs/sysbuild.conf diff --git a/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/boards/nordic/nrf53_sync_rtc/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/drivers/mbox/sysbuild.conf b/samples/drivers/mbox/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/drivers/mbox/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/icmsg/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/ipc/ipc_service/static_vrings/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/logging/multidomain/sysbuild.conf b/samples/subsys/logging/multidomain/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/logging/multidomain/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/subsys/zbus/proxy_agent_ipc/sysbuild.conf b/samples/subsys/zbus/proxy_agent_ipc/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/samples/subsys/zbus/proxy_agent_ipc/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/mcuboot_recovery_retention/sysbuild.conf b/tests/boot/mcuboot_recovery_retention/sysbuild.conf index 47f00ff3cff8..3b5b3c963800 100644 --- a/tests/boot/mcuboot_recovery_retention/sysbuild.conf +++ b/tests/boot/mcuboot_recovery_retention/sysbuild.conf @@ -1 +1,2 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/boot/test_mcuboot/sysbuild.conf b/tests/boot/test_mcuboot/sysbuild.conf index 47f00ff3cff8..3b5b3c963800 100644 --- a/tests/boot/test_mcuboot/sysbuild.conf +++ b/tests/boot/test_mcuboot/sysbuild.conf @@ -1 +1,2 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/drivers/flash/common/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/drivers/flash/negative_tests/sysbuild.conf b/tests/drivers/flash/negative_tests/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/drivers/flash/negative_tests/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/fcb/sysbuild.conf b/tests/subsys/fs/fcb/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/subsys/fs/fcb/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n diff --git a/tests/subsys/fs/littlefs/sysbuild.conf b/tests/subsys/fs/littlefs/sysbuild.conf new file mode 100644 index 000000000000..6408669a8474 --- /dev/null +++ b/tests/subsys/fs/littlefs/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_PARTITION_MANAGER=n From f5a191c86dda1e910ac0d8786e5ff9ca057fa8c6 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 7 Feb 2023 12:39:12 +0100 Subject: [PATCH 3069/3334] [nrf noup] Bluetooth: Mesh: zero randomization for friend's adv Friend's replies on LPN's polls do not assume randomization in advertiser. Zero randomization will help to optimize time when LPN keeps receiving window open and save power. Signed-off-by: Aleksandr Khromykh Signed-off-by: Olivier Lesage (cherry picked from commit c14cef2282f624d031910b7affa6417a2327f7de) --- subsys/bluetooth/mesh/Kconfig | 2 +- subsys/bluetooth/mesh/adv_ext.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index 423f120c681f..ce6c75f2f6d3 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1706,7 +1706,7 @@ config BT_MESH_LPN_INIT_POLL_TIMEOUT config BT_MESH_LPN_SCAN_LATENCY int "Latency for enabling scanning" range 0 50 - default 15 + default 2 help Latency in milliseconds that it takes to enable scanning. This is in practice how much time in advance before the Receive Window diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index a73bf86ad15f..983f0fe54392 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -13,6 +13,9 @@ #include #include #include +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#endif #include "common/bt_str.h" @@ -149,6 +152,28 @@ static inline struct bt_mesh_ext_adv *gatt_adv_get(void) } } +static int set_adv_randomness(uint8_t handle, int rand_us) +{ +#if defined(CONFIG_BT_LL_SOFTDEVICE) + struct net_buf *buf; + sdc_hci_cmd_vs_set_adv_randomness_t *cmd_params; + + buf = bt_hci_cmd_alloc(K_FOREVER); + if (!buf) { + LOG_ERR("Could not allocate command buffer"); + return -ENOMEM; + } + + cmd_params = net_buf_add(buf, sizeof(*cmd_params)); + cmd_params->adv_handle = handle; + cmd_params->rand_us = rand_us; + + return bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_SET_ADV_RANDOMNESS, buf, NULL); +#else + return 0; +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ +} + static int adv_start(struct bt_mesh_ext_adv *ext_adv, const struct bt_le_adv_param *param, struct bt_le_ext_adv_start_param *start, @@ -552,6 +577,13 @@ int bt_mesh_adv_enable(void) if (err) { return err; } + + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { + err = set_adv_randomness(adv->instance->handle, 0); + if (err) { + LOG_ERR("Failed to set zero randomness: %d", err); + } + } } return 0; From b8b613fb2ae23229dcbb0cfceddea458e89ebdb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Storr=C3=B8?= Date: Wed, 8 Mar 2023 12:17:09 +0100 Subject: [PATCH 3070/3334] [nrf noup] Bluetooth: Mesh: Fix adv randomness bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue where randomness can be removed for advertising sets that have to handle other adv types than the BT_MESH_FRIEND_ADV tag type. Signed-off-by: Anders Storrø Signed-off-by: Aleksandr Khromykh Signed-off-by: Dominik Ermel (cherry picked from commit daf9a6a61e2bb4300e2374f0befd0e0b81c1f2df) --- subsys/bluetooth/mesh/adv_ext.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index 983f0fe54392..f41d2dd0f422 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -578,8 +578,10 @@ int bt_mesh_adv_enable(void) return err; } - if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && adv->tag & BT_MESH_FRIEND_ADV) { - err = set_adv_randomness(adv->instance->handle, 0); + if (IS_ENABLED(CONFIG_BT_LL_SOFTDEVICE) && + IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_FRIEND_SEPARATE) && + advs[i].tags == BT_MESH_ADV_TAG_BIT_FRIEND) { + err = set_adv_randomness(advs[i].instance->handle, 0); if (err) { LOG_ERR("Failed to set zero randomness: %d", err); } From be6ef55e466ba594b326316416091dc5eac6bddf Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Thu, 28 Mar 2024 15:04:41 +0100 Subject: [PATCH 3071/3334] [nrf noup] dfu/boot/mcuboot: fix confirmation in case of USE_PARTITION_MANAGER Active partition ID need to be extracted basing on PARTITION_MANAGER products. ref.:NCSDK-26693 Signed-off-by: Andrzej Puzdrowski Signed-off-by: Jamie McCrae (cherry picked from commit e48546d45e19b993b8f83c36accea60d6a9291e1) --- subsys/dfu/boot/mcuboot.c | 47 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/subsys/dfu/boot/mcuboot.c b/subsys/dfu/boot/mcuboot.c index a776a24a3c15..d754acc8d939 100644 --- a/subsys/dfu/boot/mcuboot.c +++ b/subsys/dfu/boot/mcuboot.c @@ -73,8 +73,49 @@ enum IMAGE_INDEXES { IMAGE_INDEX_7, }; -#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \ - defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT) +#if USE_PARTITION_MANAGER +#include + +#if CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 +/* Sysbuild */ +#ifdef CONFIG_MCUBOOT +/* lib is part of MCUboot -> operate on the primary application slot */ +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#else +/* TODO: Add firmware loader support */ +/* lib is part of the app -> operate on active slot */ +#if defined(CONFIG_NCS_IS_VARIANT_IMAGE) +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif /* CONFIG_MCUBOOT */ +#else +/* Legacy child/parent */ +#if CONFIG_BUILD_WITH_TFM + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE) +#else + #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE) +#endif + +#ifdef CONFIG_MCUBOOT + /* lib is part of MCUboot -> operate on the primary application slot */ + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#else + /* lib is part of the App -> operate on active slot */ +#if (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_PRIMARY_ADDRESS + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID +#elif (PM_ADDRESS - PM_ADDRESS_OFFSET) == PM_MCUBOOT_SECONDARY_ADDRESS + #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_SECONDARY_ID +#else + #error Missing partition definitions. +#endif +#endif /* CONFIG_MCUBOOT */ +#endif /* CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 */ + +#else + +#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) /* For RAM LOAD mode, the active image must be fetched from the bootloader */ #define ACTIVE_SLOT_FLASH_AREA_ID boot_fetch_active_slot() #define INVALID_SLOT_ID 255 @@ -83,6 +124,8 @@ enum IMAGE_INDEXES { #define ACTIVE_SLOT_FLASH_AREA_ID DT_PARTITION_ID(DT_CHOSEN(zephyr_code_partition)) #endif +#endif /* USE_PARTITION_MANAGER */ + /* * Raw (on-flash) representation of the v1 image header. */ From 93b9723ad9cc66000499996b3544a97f0aa05741 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Wed, 27 Sep 2023 09:41:10 +0000 Subject: [PATCH 3072/3334] [nrf noup] test: schedule_api: Use Minimal C library There is no point to use PICOLIB here as it bloats the tests. Signed-off-by: Dominik Ermel (cherry picked from commit 17a2a8c3f7279bae5d9025c83c0eaf118afda8cb) --- tests/kernel/pipe/deprecated/pipe_api/prj.conf | 9 +++++++++ tests/kernel/sched/schedule_api/prj.conf | 1 + tests/kernel/sched/schedule_api/prj_multiq.conf | 1 + 3 files changed, 11 insertions(+) create mode 100644 tests/kernel/pipe/deprecated/pipe_api/prj.conf diff --git a/tests/kernel/pipe/deprecated/pipe_api/prj.conf b/tests/kernel/pipe/deprecated/pipe_api/prj.conf new file mode 100644 index 000000000000..df3270adfdf8 --- /dev/null +++ b/tests/kernel/pipe/deprecated/pipe_api/prj.conf @@ -0,0 +1,9 @@ +CONFIG_ZTEST=y +CONFIG_IRQ_OFFLOAD=y +CONFIG_TEST_USERSPACE=y +CONFIG_DYNAMIC_OBJECTS=y +CONFIG_MP_MAX_NUM_CPUS=1 +CONFIG_ZTEST_FATAL_HOOK=y +CONFIG_PIPES=y +CONFIG_DEPRECATION_TEST=y +CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj.conf b/tests/kernel/sched/schedule_api/prj.conf index a5ceef694331..8b649a3b7fca 100644 --- a/tests/kernel/sched/schedule_api/prj.conf +++ b/tests/kernel/sched/schedule_api/prj.conf @@ -7,3 +7,4 @@ CONFIG_MAX_THREAD_BYTES=6 CONFIG_TEST_USERSPACE=y CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y +CONFIG_MINIMAL_LIBC=y diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index c8dd4bf786bc..84c9d80ac619 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -7,3 +7,4 @@ CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y CONFIG_NUM_COOP_PRIORITIES=30 CONFIG_NUM_PREEMPT_PRIORITIES=40 +CONFIG_MINIMAL_LIBC=y From f9044d9c3a38a9231a510ec813a74985160d7194 Mon Sep 17 00:00:00 2001 From: Jan Tore Guggedal Date: Mon, 18 May 2020 20:50:13 +0200 Subject: [PATCH 3073/3334] [nrf noup] net: mqtt: Provide option to enable TLS session caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provides an option to enable TLS session caching for an MQTT client's secure socket. Signed-off-by: Jan Tore Guggedal Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Johann Fischer Signed-off-by: Tomasz Moń (cherry picked from commit 270cc3fbdaf5af33b2e012bad4c22275fe56960c) --- include/zephyr/net/mqtt.h | 3 +++ subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/zephyr/net/mqtt.h b/include/zephyr/net/mqtt.h index a4d961a502ef..c1f3b9924133 100644 --- a/include/zephyr/net/mqtt.h +++ b/include/zephyr/net/mqtt.h @@ -763,6 +763,9 @@ struct mqtt_sec_config { uint32_t alpn_protocol_name_count; #endif + /** Indicates the preference for enabling TLS session caching. */ + int session_cache; + /** Peer hostname for certificate verification. */ const char *hostname; diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 1164424ebbdb..7151c6b14f60 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -122,6 +122,16 @@ int mqtt_client_tls_connect(struct mqtt_client *client) } } + if (tls_config->session_cache == ZSOCK_TLS_SESSION_CACHE_ENABLED) { + ret = zsock_setsockopt(client->transport.tls.sock, ZSOCK_SOL_TLS, + ZSOCK_TLS_SESSION_CACHE, + &tls_config->session_cache, + sizeof(tls_config->session_cache)); + if (ret < 0) { + goto error; + } + } + if (tls_config->cert_nocopy != ZSOCK_TLS_CERT_NOCOPY_NONE) { ret = zsock_setsockopt(client->transport.tls.sock, ZSOCK_SOL_TLS, ZSOCK_TLS_CERT_NOCOPY, &tls_config->cert_nocopy, From 9cecb6cb6ef0f70fd39a820b3655b59c436f724c Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Mon, 4 Dec 2023 15:27:08 +0100 Subject: [PATCH 3074/3334] [nrf noup] soc: arm: nRF53: Add SPU Flash/RAM alignment TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF53 Signed-off-by: Markus Swarowsky (cherry picked from commit 4cd49f9fcd036df82a4346f5b572e6e7c5e4de33) --- soc/nordic/nrf53/Kconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 7794fba63ba1..186fb547a7b3 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -170,12 +170,26 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral +config NRF_SPU_FLASH_REGION_ALIGNMENT + hex + default 0x4000 + help + FLASH regions must be aligned to this value due to SPU HW + limitations. + config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 help RAM region size for the NRF_SPU peripheral +config NRF_SPU_RAM_REGION_ALIGNMENT + hex + default 0x2000 + help + RAM regions must be aligned to this value due to SPU HW + limitations. + config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" depends on NRF_SOC_SECURE_SUPPORTED From e69ecc3d26b064d011d3875d8e192e8f8d5d6c01 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 14 Nov 2022 11:22:06 +0100 Subject: [PATCH 3075/3334] [nrf noup] boards: thingy53_nrf5340: Add common partition map Change introduces common static Partition Manager configuration. The tfm_nonsecure partition must be SPU region aligned. Ref: NCSDK-18033 Ref: NCSDK-19515 Signed-off-by: Marek Pieta Signed-off-by: Markus Swarowsky (cherry picked from commit 6b3aadd69c890713c027373cf10c0da0732ca196) --- .../pm_static_thingy53_nrf5340_cpuapp.yml | 55 ++++++++++++++ .../pm_static_thingy53_nrf5340_cpuapp_ns.yml | 73 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml create mode 100644 boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..7a48d51ec334 --- /dev/null +++ b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp.yml @@ -0,0 +1,55 @@ +app: + address: 0x10200 + region: flash_primary + size: 0xdfe00 +mcuboot: + address: 0x0 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + region: flash_primary + size: 0x200 +mcuboot_primary: + address: 0x10000 + orig_span: &id001 + - mcuboot_pad + - app + region: flash_primary + size: 0xe0000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + orig_span: &id002 + - app + region: flash_primary + size: 0xdfe00 + span: *id002 +settings_storage: + address: 0xf0000 + region: flash_primary + size: 0x10000 +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x00000 + size: 0xe0000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xe0000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x120000 + size: 0x6e0000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml new file mode 100644 index 000000000000..70ffe6d9c124 --- /dev/null +++ b/boards/nordic/thingy53/pm_static_thingy53_nrf5340_cpuapp_ns.yml @@ -0,0 +1,73 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x10000 +mcuboot_pad: + address: 0x10000 + region: flash_primary + size: 0x200 +tfm_secure: + address: 0x10000 + size: 0xc000 + span: [mcuboot_pad, tfm] +tfm_nonsecure: + address: 0x1c000 + size: 0xd4000 + span: [app] +tfm: + address: 0x10200 + region: flash_primary + size: 0xbe00 +app: + address: 0x1c000 + region: flash_primary + size: 0xd4000 +mcuboot_primary: + address: 0x10000 + orig_span: &id001 + - mcuboot_pad + - tfm + - app + region: flash_primary + size: 0xe0000 + span: *id001 +mcuboot_primary_app: + address: 0x10200 + orig_span: &id002 + - tfm + - app + region: flash_primary + size: 0xdfe00 + span: *id002 +nonsecure_storage: + address: 0xf0000 + size: 0x10000 + span: [settings_storage] +settings_storage: + address: 0xf0000 + region: flash_primary + size: 0x10000 +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x00000 + size: 0xe0000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xe0000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x120000 + size: 0x6e0000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary From 834ee909ed52ff9f71abd392471c864518dd0267 Mon Sep 17 00:00:00 2001 From: Mateusz Kapala Date: Thu, 2 Feb 2023 11:04:23 +0100 Subject: [PATCH 3076/3334] [nrf noup] boards: arm: thingy53: Disable USB CDC added by MCUBoot Enabling USB CDC by default in Thingy:53 board configuration caused that there were two instances of USB CDC in MCUBoot. Change disables one instance which was added automatically by NCS if MCUBoot bootloader was built as a child image. Jira: NCSDK-18596 Signed-off-by: Mateusz Kapala Signed-off-by: Johann Fischer (cherry picked from commit 683b8fe80e94f8601003db5dd2f744b566ba649d) --- boards/nordic/thingy53/Kconfig.defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 218dbedfb128..3e4ba6b10724 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -91,6 +91,13 @@ endif # !TRUSTED_EXECUTION_SECURE source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" +# By default, a USB CDC ACM instance is already enabled in the board's DTS. +# It is not necessary for nRF Connect SDK to add another instance if MCUBoot +# bootloader is built as a child image. +config MCUBOOT_USB_SUPPORT + bool + default n + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From b3efce8b27865687b24c893ed44a4e5c64b83c77 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 28 Nov 2022 15:31:33 +0100 Subject: [PATCH 3077/3334] [nrf noup] boards: thingy53_nrf5340: Enable MCUboot by default Change enables MCUboot bootloader by default to allow programming samples and applications without external programmer (using MCUboot serial recovery). Change also enables network core to prevent build failures when building MCUboot with nRF53 multi image DFU. Jira: NCSDK-18263 Signed-off-by: Marek Pieta Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Johann Fischer Signed-off-by: Joakim Andersson (cherry picked from commit 832056890e822a62eaaa29a93c416fb7c29eae84) --- boards/nordic/thingy53/Kconfig.defconfig | 6 ++++++ boards/nordic/thingy53/thingy53_nrf5340_common.dtsi | 1 + 2 files changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 3e4ba6b10724..062f7424aa31 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -15,6 +15,12 @@ endif # NORDIC_QSPI_NOR if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS +config BOOTLOADER_MCUBOOT + default y if !MCUBOOT + +config BOARD_ENABLE_CPUNET + default y if !MCUBOOT + # Code Partition: # # For the secure version of the board the firmware is linked at the beginning diff --git a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi index 828b710c1ad4..fef36ec84f57 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi +++ b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi @@ -13,6 +13,7 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; + nordic,pm-ext-flash = &mx25r64; }; buttons { From 4b318c90cad4170acffb1ecba0f76979b72a7e79 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 9 May 2024 09:34:06 +0100 Subject: [PATCH 3078/3334] [nrf noup] boards: nordic: thingy53: Add sysbuild Kconfig file Adds a sysbuild Kconfig file which enables external flash when partition manager is enabled Signed-off-by: Jamie McCrae (cherry picked from commit 4eeba095b882fd5b0c556d03420787252530e3e8) --- boards/nordic/thingy53/Kconfig.sysbuild | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 boards/nordic/thingy53/Kconfig.sysbuild diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild new file mode 100644 index 000000000000..2110f226e6b1 --- /dev/null +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY + default y if BOOTLOADER_MCUBOOT From 714455e80539345e224c9737b55a30b9a0bda290 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 14 May 2024 12:22:51 +0100 Subject: [PATCH 3079/3334] [nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses sysbuild by default when building an application which resides in an allowed NCS-based directory when the sysbuild config key is not set. Do not use sysbuild if the mps2 board is being used to avoid problems with CI testing. Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Moń (cherry picked from commit 6914e76bc3ce34570f0fdccc64aa31c40ab35230) --- scripts/west_commands/build.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index 10ea4644e687..ad6965a04271 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -663,7 +663,12 @@ def _run_cmake(self, board, origin): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', False) + config_sysbuild = config_getboolean('sysbuild', None) + + if config_sysbuild is None: + # If no option is set, then enable sysbuild globally + config_sysbuild = True + if self.args.sysbuild is True or (config_sysbuild and self.args.sysbuild is not False): cmake_opts.extend([f'-S{SYSBUILD_PROJ_DIR}']) cmake_env = os.environ.copy() From e58496d927a35d95b37c147ee42e3685590e7fda Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 17 May 2024 10:15:33 +0100 Subject: [PATCH 3080/3334] [nrf noup] board: nordic: thingy53: Enable default images for sysbuild Enables MCUboot, empty network core and network core updates by default when building for the thingy53 Signed-off-by: Jamie McCrae (cherry picked from commit a05d733d37bd95a1d12c33142a523913bf0d3e12) --- boards/nordic/thingy53/Kconfig.sysbuild | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index 2110f226e6b1..c03d191b3708 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -1,5 +1,22 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +if BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +config SECURE_BOOT_NETCORE + default y + +config NETCORE_APP_UPDATE + default y if SECURE_BOOT_NETCORE + +config NRF_DEFAULT_EMPTY + default y if SECURE_BOOT_NETCORE + +endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS + config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY default y if BOOTLOADER_MCUBOOT From 9bfee801bffbdbf4eb7c23125bb8a0dc4867c259 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 1 Oct 2018 10:27:32 +0200 Subject: [PATCH 3081/3334] [nrf noup] include: net: add NCS extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add some socket options and address family extensions to Zephyr headers, which will be useful for nRF Connect SDK. Add secure socket options: * Add CID socket options to NCS specific options. * Add TLS/DTLS tls ciphersuite chosen socket option to NCS specific options. * Add TLS/DTLS connection save/load socket options to NCS specific options. * Add TLS/DTLS handshake status socket option to NCS specific options. * Add SO_KEEPOPEN socket option. * Add SO_RAI socket options. * Add SO_IPV6_DELAYED_ADDR_REFRESH socket option. * Add SO_SENDCB socket option. The "author" of this commit is a contact person; various people with s-o-b lines following here have contributed to the maintenance of this patch. Signed-off-by: Andreas Moltumyr Signed-off-by: Andrzej Głąbek Signed-off-by: Christopher Métrailler Signed-off-by: Emanuele Di Santo Signed-off-by: Glenn Ruben Bakke Signed-off-by: Håkon Alseth Signed-off-by: Ioannis Glaropoulos Signed-off-by: Jan Tore Guggedal Signed-off-by: Joakim Andersson Signed-off-by: Martí Bolívar Signed-off-by: Mirko Covizzi Signed-off-by: Petri Honkala Signed-off-by: Robert Lubos Signed-off-by: Tommi Mammela Signed-off-by: Trond Einar Snekvik Signed-off-by: Torsten Rasmussen Signed-off-by: Eivind Jølsgard Signed-off-by: Dominik Ermel Signed-off-by: Kacper Radoszewski (cherry picked from commit b82e432c73348b2cdf3a9862d65d89a917e2060c) --- include/zephyr/net/socket.h | 1 + include/zephyr/net/socket_ncs.h | 207 ++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+) create mode 100644 include/zephyr/net/socket_ncs.h diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index 322309c26f02..3dd8874fbc60 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #ifdef __cplusplus diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h new file mode 100644 index 000000000000..6a77d6c41f13 --- /dev/null +++ b/include/zephyr/net/socket_ncs.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ +#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ + +/** + * @file + * @brief NCS specific additions to the BSD sockets API definitions + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence + * when creating a new socket. Combine this flag with a socket type when + * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE). + * If it's desired to create a native TLS socket, but still offload the + * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS. + */ +#define SOCK_NATIVE 0x80000000 +#define SOCK_NATIVE_TLS 0x40000000 + +/** Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options. + */ +#define NET_SOCKET_NCS_BASE 1000 + +/* NCS specific TLS level socket options */ + +/** Socket option to set DTLS handshake timeout, specifically for nRF sockets. + * The option accepts an integer, indicating the total handshake timeout, + * including retransmissions, in seconds. + * Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123. + */ +#define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) + +/** Socket option to save DTLS connection, specifically for nRF sockets. + */ +#define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) + +/** Socket option to load DTLS connection, specifically for nRF sockets. + */ +#define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) + +/** Socket option to get result of latest TLS/DTLS completed handshakes end status, + * specifically for nRF sockets. + * The option accepts an integer, indicating the setting. + * Accepted vaules for the option are: 0 and 1. + */ +#define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) + +/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */ +#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */ +#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */ +#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 /**< 1s + 2s + 4s + 8s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 /**< 1s + 2s + 4s + 8s + 16s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */ +#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */ + +/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */ +#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 +#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 + +/* NCS specific socket options */ + +/** sockopt: enable sending data as part of exceptional events */ +#define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) +/** sockopt: Keep socket open when its PDN connection is lost + * or the device is put into flight mode. + */ +#define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) +/** sockopt: bind to PDN */ +#define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) + +/** sockopt: Release assistance indication (RAI). + * The option accepts an integer, indicating the type of RAI. + * Accepted values for the option are: @ref RAI_NO_DATA, @ref RAI_LAST, @ref RAI_ONE_RESP, + * @ref RAI_ONGOING, @ref RAI_WAIT_MORE. + */ +#define SO_RAI (NET_SOCKET_NCS_BASE + 61) + +/** Release assistance indication (RAI). + * Indicate that the application does not intend to send more data. + * This applies immediately and lets the modem exit connected mode more + * quickly. + * + * @note This requires the socket to be connected. + */ +#define RAI_NO_DATA 1 +/** Release assistance indication (RAI). + * Indicate that the application does not intend to send more data + * after the next call to send() or sendto(). + * This lets the modem exit connected mode more quickly after sending the data. + */ +#define RAI_LAST 2 +/** Release assistance indication (RAI). + * Indicate that the application is expecting to receive just one data packet + * after the next call to send() or sendto(). + * This lets the modem exit connected mode more quickly after having received the data. + */ +#define RAI_ONE_RESP 3 +/** Release assistance indication (RAI). + * Indicate that the socket is in active use by a client application. + * This lets the modem stay in connected mode longer. + */ +#define RAI_ONGOING 4 +/** Release assistance indication (RAI). + * Indicate that the socket is in active use by a server application. + * This lets the modem stay in connected mode longer. + */ +#define RAI_WAIT_MORE 5 + +/** sockopt: set a callback to be called when a send request is acknowledged by the network and + * the data has been acknowledged by the peer, if required by the network protocol, or until the + * timeout, given by the SO_SNDTIMEO socket option, is reached. Valid timeout values are + * 1 to 600 seconds. + * This option takes a @ref socket_ncs_sendcb structure. + * + * @note The callback is executed in an interrupt context. + * Take care to offload any processing as appropriate. + * + * @note This is only supported by the following modem firmware: + * - mfw_nrf9151-ntn + * + * This socket option cannot be used along with the @ref MSG_WAITACK send flag. + */ +#define SO_SENDCB (NET_SOCKET_NCS_BASE + 63) + +/** Parameters returned in the @ref socket_ncs_sendcb_t callback. */ +struct socket_ncs_sendcb_params { + /** Socket handle. */ + int fd; + /** Status. Can be 0 on successful send or EAGAIN on timeout. */ + int status; + /** Number of bytes that was sent. */ + size_t bytes_sent; +}; + +/** Callback type in the @ref socket_ncs_sendcb structure. */ +typedef void (*socket_ncs_sendcb_t)(const struct socket_ncs_sendcb_params *params); + +/** Option value for the @ref SO_SENDCB socket option. */ +struct socket_ncs_sendcb { + /** Callback function. */ + socket_ncs_sendcb_t callback; +}; + +/* NCS specific IPPROTO_ALL level socket options */ + +/** IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. */ +#define IPPROTO_ALL 512 +/** sockopt: disable all replies to unexpected traffics */ +#define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) + +/* NCS specific IPPROTO_IP level socket options */ + +/** sockopt: enable IPv4 ICMP replies */ +#define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) + +/* NCS specific IPPROTO_IPV6 level socket options */ + +/** sockopt: enable IPv6 ICMP replies */ +#define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) + +/** sockopt: Delay IPv6 address refresh during power saving mode */ +#define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) + +/* NCS specific TCP level socket options */ + +/** sockopt: Configurable TCP server session timeout in minutes. + * Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout). + */ +#define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) + +/* NCS specific gettaddrinfo() flags */ + +/** Assume `service` contains a Packet Data Network (PDN) ID. + * When specified together with the AI_NUMERICSERV flag, + * `service` shall be formatted as follows: "port:pdn_id" + * where "port" is the port number and "pdn_id" is the PDN ID. + * Example: "8080:1", port 8080 PDN ID 1. + * Example: "42:0", port 42 PDN ID 0. + */ +#define AI_PDNSERV 0x1000 + +/* NCS specific send() and sendto() flags */ + +/** Request a blocking send operation until the request is acknowledged. + * When used in send() or sendto(), the request will not return until the + * send operation is completed by lower layers, or until the timeout, given by the SO_SNDTIMEO + * socket option, is reached. Valid timeout values are 1 to 600 seconds. + */ +#define MSG_WAITACK 0x200 + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */ From 9991882440b7100fbcbe81bec51c6ce73c2f7aeb Mon Sep 17 00:00:00 2001 From: Sigvart Hovland Date: Fri, 3 May 2019 14:21:52 +0200 Subject: [PATCH 3082/3334] [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition Manager (PM) is a component of the nRF Connect SDK (NCS) which uses yaml files to resolve flash partition placement with a holistic view of the entire device, including each firmware image present on the flash device, and various subsystems, such as settings and NFFS. When this NCS extension is used, various source files which would use partition information from devicetree in "vanilla" zephyr instead use defines generated by PM instead. This commit removes support for HEX_FILES_TO_MERGE, as it conflicts with PM. The settings subsystem pm.yml defines a partition 'settings_storage'. The nffs subsystem pm.yml defines 'nffs_storage'. Leverage label translation to avoid patching partition names. Refer to the NCS documentation page for this feature for more details. This is a long-running out of tree patch which has been worked on by several people. The following sign-offs are in alphabetical order by first name. Signed-off-by: Andrzej Głąbek Signed-off-by: Andrzej Puzdrowski Signed-off-by: Håkon Øye Amundsen Signed-off-by: Ioannis Glaropoulos Signed-off-by: Joakim Andersson Signed-off-by: Johann Fischer Signed-off-by: Martí Bolívar Signed-off-by: Ole Sæther Signed-off-by: Robert Lubos Signed-off-by: Sebastian Bøe Signed-off-by: Sigvart Hovland Signed-off-by: Thomas Stenersen Signed-off-by: Torsten Rasmussen Signed-off-by: Øyvind Rønningstad Signed-off-by: Trond Einar Snekvik Signed-off-by: Gerard Marull-Paretas Signed-off-by: Tomasz Moń Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit a8cb6e26828c238cb4f46f81c1f45215f6a83deb) --- arch/arm/core/mpu/arm_mpu_regions.c | 13 +++++ cmake/linker/ld/target.cmake | 1 + cmake/linker/lld/target.cmake | 1 + cmake/modules/kernel.cmake | 4 ++ drivers/flash/soc_flash_nrf.c | 11 ++++ drivers/flash/soc_flash_nrf_rram.c | 11 ++++ .../arch/arm/cortex_m/scripts/linker.ld | 50 +++++++++++++++++++ include/zephyr/storage/flash_map.h | 6 +++ lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 18 ++++++- subsys/dfu/boot/mcuboot_shell.c | 40 +++++++++++++++ subsys/fs/littlefs_fs.c | 7 ++- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ++++++++++ 13 files changed, 187 insertions(+), 4 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 4771c5914ce6..71c0a9a2b739 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,6 +8,9 @@ #include #include +#if USE_PARTITION_MANAGER +#include +#endif #ifdef CONFIG_ARM_MPU_SRAM_WRITE_THROUGH #define ARM_MPU_SRAM_REGION_ATTR REGION_RAM_WT_ATTR @@ -30,6 +33,14 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) ARM_MPU_SRAM_REGION_ATTR(CONFIG_SRAM_BASE_ADDRESS, @@ -37,6 +48,8 @@ static const struct arm_mpu_region mpu_regions[] = { #else ARM_MPU_SRAM_REGION_ATTR(REGION_SRAM_SIZE)), #endif + +#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index 592596576d11..ccf6a1903162 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,6 +80,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index 96df1c123796..fe8aad62c73d 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,6 +52,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 310a836eebcf..53aa705fdc9b 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -257,3 +257,7 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() + +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index f6b8a6f5eef3..27fda598be20 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -36,6 +36,11 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -165,6 +170,12 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index 1f7f89b5509f..cd217a5f2c2d 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,6 +54,11 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -292,6 +297,12 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index 2f3d55412f06..7b5e9358af02 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,6 +34,39 @@ #define ROMSTART_REGION ROMABLE_REGION #endif +#if USE_PARTITION_MANAGER + +#include + +#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ + +#define ROM_ADDR PM_ADDRESS +#define ROM_SIZE PM_SIZE + +#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) +#define RAM_SIZE CONFIG_PM_SRAM_SIZE +#else +#define RAM_SIZE PM_SRAM_SIZE +#endif +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if defined(CONFIG_ROM_END_OFFSET) #define ROM_END_OFFSET CONFIG_ROM_END_OFFSET #else @@ -60,6 +93,23 @@ #define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 13f381e135fd..819f94182474 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -351,6 +351,10 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + /** * Returns non-0 value if partition of given DTS node label exists. * @@ -620,6 +624,8 @@ DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) #undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index b9e6371fabff..f9f98db27c52 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -160,7 +160,7 @@ source "subsys/logging/Kconfig.template.log_config" choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) + default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) && !PARTITION_MANAGER_ENABLED default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 74193fbdce48..368342cc86de 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,6 +25,20 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); +#if USE_PARTITION_MANAGER + +#include + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + +#define RAM_SIZE (KB((size_t) CONFIG_SRAM_SIZE)) +#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS + +#endif /* USE_PARTITION_MANAGER */ + #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -106,8 +120,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ - ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((RAM_SIZE - \ + ((size_t) HEAP_BASE - (size_t) RAM_ADDR)), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index 583bc4778362..06eb79baa92b 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,6 +20,16 @@ #endif #endif +#if USE_PARTITION_MANAGER +#include + +#ifdef CONFIG_NCS_IS_VARIANT_IMAGE +#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif + struct area_desc { const char *name; unsigned int id; @@ -93,6 +103,35 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ +#if USE_PARTITION_MANAGER +#ifdef PM_MCUBOOT_ID + if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { + shell_error(sh, "Cannot erase boot partition"); + return -EACCES; + } +#endif + +#ifdef PM_APP_ID + if (id == PM_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef PM_MCUBOOT_PRIMARY_APP_ID + if (id == PM_MCUBOOT_PRIMARY_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef ACTIVE_IMAGE_ID + if (id == ACTIVE_IMAGE_ID) { + shell_error(sh, "Cannot erase active partitions"); + return -EACCES; + } +#endif +#else #if PARTITION_EXISTS(boot_partition) if (id == PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -105,6 +144,7 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } +#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index e41287edf2f6..094cb761756b 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1133,7 +1133,12 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = FSTAB_ENTRY_DT_INST_MOUNT_POINT(inst), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *)DT_PARTITION_ID(FS_PARTITION(inst)), \ + .storage_dev = (void *) \ + COND_CODE_1(USE_PARTITION_MANAGER, \ + (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ + (FIXED_PARTITION_ID(littlefs_storage)), \ + (FIXED_PARTITION_ID(storage)))), \ + (DT_PARTITION_ID(FS_PARTITION(inst)))), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index 349eee664810..e7015d512d36 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,8 +13,35 @@ extern "C" { #endif +#if CONFIG_PARTITION_MANAGER_ENABLED + +#include "pm_config.h" + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) +#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE +#else +/* The current image is a child image in a different domain than the image + * which defined the required values. To reach the values of the parent domain + * we use the 'PM__' variant of the define. + */ +#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ + +#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ + +#else + +#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) +#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) + +#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #ifdef CONFIG_OPENAMP_RSC_TABLE #define SHM_START_ADDR (VDEV_START_ADDR) From 1d32c68e9e5154a554817d59d083bcdd469014dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Reierstad?= Date: Fri, 31 May 2024 08:21:51 +0200 Subject: [PATCH 3083/3334] =?UTF-8?q?[nrf=20noup]=C2=A0Bluetooth:=20Mesh:?= =?UTF-8?q?=20remove=20legacy=20adv=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes explicit support for the legacy advertiser due to incompatibility with SDC. The legacy advertiser can be used (experimentally) with the Zephyr Link Layer enabled, but is not recommended. Signed-off-by: Håvard Reierstad (cherry picked from commit c6241a49d34b61fdd0fde58612aaec1fb6cefc27) --- subsys/bluetooth/mesh/Kconfig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index ce6c75f2f6d3..a311032d46e7 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -60,12 +60,16 @@ choice BT_MESH_ADV menuconfig BT_MESH_ADV_LEGACY bool "Legacy advertising" + depends on BT_LL_SW_SPLIT help Use legacy advertising commands for mesh sending. Legacy - advertising is significantly slower than the extended advertising, but - is supported by all controllers. + advertising is significantly slower than the extended advertising. - WARNING: The legacy advertiser can occasionally do more message + WARNING: This feature is not supported in NCS. The legacy advertiser will not work + with SDC, as attempting to start an advertisement during the scanner duty cycle + will result in an error. The Zephyr Link Layer can be used experimentally as an + alternative. + The legacy advertiser can occasionally do more message retransmissions than requested because of limitations of HCI interface API. From acc2d18e65b61994ff9a3d04a0802477b01e7198 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 5 Jun 2024 13:37:34 +0100 Subject: [PATCH 3084/3334] [nrf noup] board: nordic: thingy53: Default to update only MCUboot type Changes the default MCUboot mode to update only for the thingy53, to align with previous bootloader builds Changes the thingy53 default configuration for sysbuild to enable using all RAM in the MCUboot image Signed-off-by: Jamie McCrae (cherry picked from commit fb75570475499ef69fdc3f463808f337b6d2d14d) --- boards/nordic/thingy53/Kconfig.sysbuild | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.sysbuild b/boards/nordic/thingy53/Kconfig.sysbuild index c03d191b3708..df489c1dd546 100644 --- a/boards/nordic/thingy53/Kconfig.sysbuild +++ b/boards/nordic/thingy53/Kconfig.sysbuild @@ -7,6 +7,10 @@ choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice +choice MCUBOOT_MODE + default MCUBOOT_MODE_OVERWRITE_ONLY +endchoice + config SECURE_BOOT_NETCORE default y @@ -16,6 +20,9 @@ config NETCORE_APP_UPDATE config NRF_DEFAULT_EMPTY default y if SECURE_BOOT_NETCORE +config MCUBOOT_USE_ALL_AVAILABLE_RAM + default y if BOARD_THINGY53_NRF5340_CPUAPP_NS && BOOTLOADER_MCUBOOT + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY From 8c4925a5d383135c5d76d08b05e04dac1880305a Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 12 Jun 2024 16:15:29 +0200 Subject: [PATCH 3085/3334] [nrf noup] samples: sysbuild: hello_world: support PM on nRF53 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PM support is still required for nRF53/nRF54l15 in the context of NCS. Signed-off-by: Gerard Marull-Paretas Signed-off-by: Tomasz Moń (cherry picked from commit 7784106ebe3c7bf12b36008bd0be209cb6f2e6ac) --- samples/sysbuild/hello_world/sysbuild.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index fa0599c6a621..654c4175faac 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -9,6 +9,18 @@ if(DEFINED SB_CONFIG_REMOTE_BOARD) BOARD_REVISION ${BOARD_REVISION} ) + if(SB_CONFIG_SOC_SERIES_NRF53X) + set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) + set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) + set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) + set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") + else(SB_CONFIG_SOC_SERIES_NRF54LX) + set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) + set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) + set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) + set(CPUFLPR_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") + endif() + add_dependencies(${DEFAULT_IMAGE} remote) sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote) endif() From 96356474dc6741a8f6d0db5f6de3e9bd0ff61ac1 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Mon, 25 Sep 2023 16:41:15 +0200 Subject: [PATCH 3086/3334] [nrf noup] settings: nvs: use dedicated lookup cache hash function Introduce NVS_LOOKUP_CACHE_FOR_SETTINGS Kconfig option that enables a dedicated hash function for the NVS lookup cache that takes advantage of the NVS ID allocation scheme used by the NVS settings backend. As such, this option should only be used if an application uses NVS via the settings layer. Signed-off-by: Damian Krolik (cherry picked from commit c7c73c12195d5f108e985022feaf5b857e6bfad1) --- subsys/kvss/nvs/Kconfig | 9 ++++++++ subsys/kvss/nvs/nvs.c | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/subsys/kvss/nvs/Kconfig b/subsys/kvss/nvs/Kconfig index 48915c2f048e..21798932f521 100644 --- a/subsys/kvss/nvs/Kconfig +++ b/subsys/kvss/nvs/Kconfig @@ -29,6 +29,15 @@ config NVS_LOOKUP_CACHE_SIZE Number of entries in Non-volatile Storage lookup cache. It is recommended that it be a power of 2. +config NVS_LOOKUP_CACHE_FOR_SETTINGS + bool "Non-volatile Storage lookup cache optimized for settings" + depends on NVS_LOOKUP_CACHE + help + Use the lookup cache hash function that results in the least number of + collissions and, in turn, the best NVS performance provided that the NVS + is used as the settings backend only. This option should NOT be enabled + if the NVS is also written to directly, outside the settings layer. + config NVS_DATA_CRC bool "Non-volatile Storage CRC protection on the data" help diff --git a/subsys/kvss/nvs/nvs.c b/subsys/kvss/nvs/nvs.c index fd6dd480d571..720ba43eb329 100644 --- a/subsys/kvss/nvs/nvs.c +++ b/subsys/kvss/nvs/nvs.c @@ -14,6 +14,11 @@ #include #include "nvs_priv.h" +#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS +#include +#include +#endif + #include LOG_MODULE_REGISTER(fs_nvs, CONFIG_NVS_LOG_LEVEL); @@ -23,6 +28,45 @@ static int nvs_ate_valid(struct nvs_fs *fs, uint16_t entry_addr, #ifdef CONFIG_NVS_LOOKUP_CACHE +#ifdef CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS + +static inline size_t nvs_lookup_cache_pos(uint16_t id) +{ + /* + * 1. The NVS settings backend uses up to (NVS_NAME_ID_OFFSET - 1) NVS IDs to + store keys and equal number of NVS IDs to store values. + * 2. For each key-value pair, the value is stored at NVS ID greater by exactly + * NVS_NAME_ID_OFFSET than NVS ID that holds the key. + * 3. The backend tries to minimize the range of NVS IDs used to store keys. + * That is, NVS IDs are allocated sequentially, and freed NVS IDs are reused + * before allocating new ones. + * + * Therefore, to assure the least number of collisions in the lookup cache, + * the least significant bit of the hash indicates whether the given NVS ID + * represents a key or a value, and remaining bits of the hash are set to + * the ordinal number of the key-value pair. Consequently, the hash function + * provides the following mapping: + * + * 1st settings key => hash 0 + * 1st settings value => hash 1 + * 2nd settings key => hash 2 + * 2nd settings value => hash 3 + * ... + */ + BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAMECNT_ID), "NVS_NAMECNT_ID is not power of 2"); + BUILD_ASSERT(IS_POWER_OF_TWO(NVS_NAME_ID_OFFSET), "NVS_NAME_ID_OFFSET is not power of 2"); + + uint16_t key_value_bit; + uint16_t key_value_ord; + + key_value_bit = (id >> LOG2(NVS_NAME_ID_OFFSET)) & 1; + key_value_ord = id & (NVS_NAME_ID_OFFSET - 1); + + return ((key_value_ord << 1) | key_value_bit) % CONFIG_NVS_LOOKUP_CACHE_SIZE; +} + +#else /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ + static inline size_t nvs_lookup_cache_pos(uint16_t id) { uint16_t hash; @@ -38,6 +82,8 @@ static inline size_t nvs_lookup_cache_pos(uint16_t id) return hash % CONFIG_NVS_LOOKUP_CACHE_SIZE; } +#endif /* CONFIG_NVS_LOOKUP_CACHE_FOR_SETTINGS */ + static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) { int rc; From 1c5fcd678e6f573fbb6cfe0bcbeefbd5a474ffd3 Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Mon, 8 Jul 2024 10:08:10 +0200 Subject: [PATCH 3087/3334] [nrf noup] ci: Enable action-manifest-pr This action will automatically manage a PR to sdk-nrf once a PR to sdk-zephyr is created. This includes: - Creating an initial PR - Updating and (optionally) rebase it once the PR to sdk-nrf is merged. The action can be disabled by adding the string "manifest-pr-skip" to the title or body of the PR. This will simplify cherry-picking changes from upstream zephyr. Signed-off-by: Rubin Gerritsen (cherry picked from commit a0d974eaacd3fc8042cba8ef5044be2dd5d50d6e) --- .github/workflows/manifest-PR.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/manifest-PR.yml diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml new file mode 100644 index 000000000000..a871aa381ded --- /dev/null +++ b/.github/workflows/manifest-PR.yml @@ -0,0 +1,17 @@ +name: handle manifest PR +on: + pull_request_target: + types: [opened, synchronize, closed] + branches: + - main + + +jobs: + call-manifest-pr-action: + runs-on: ubuntu-latest + steps: + - name: handle manifest PR + uses: nrfconnect/action-manifest-pr@main + with: + token: ${{ secrets.NCS_GITHUB_TOKEN }} + manifest-pr-title-details: ${{ github.event.pull_request.title }} From 7439e0a153ce41a1a267831e2ae257b94e89c663 Mon Sep 17 00:00:00 2001 From: Sigurd Hellesvik Date: Fri, 23 Aug 2024 11:24:06 +0200 Subject: [PATCH 3088/3334] [nrf noup] board: nordic_ thingy53: Enable QSPI by default The Thingy:53 enabled MCUboot and external flash by default. Therefore, it should also enable drivers for its external flash by default. Signed-off-by: Sigurd Hellesvik (cherry picked from commit 08d091ea39b2bfbe279860edacacd12a1107f163) --- boards/nordic/thingy53/Kconfig.defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 062f7424aa31..d7132b6649e4 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -104,6 +104,9 @@ config MCUBOOT_USB_SUPPORT bool default n +config NORDIC_QSPI_NOR + default y + endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS if BOARD_THINGY53_NRF5340_CPUNET From c6e94ca856e151fab1ff42e9acbeca5202049a45 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 26 Sep 2024 12:40:33 +0200 Subject: [PATCH 3089/3334] [nrf noup] samples: basic: blinky: add eGPIO tests configuration Add overlay for nrf54l15dk to enable eGPIO tests. Signed-off-by: Jakub Zymelka Signed-off-by: Marcin Szymczyk (cherry picked from commit 8b6614f59e6d9b8ad1e6f6861738716af3c27f6b) --- .../boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay diff --git a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay new file mode 100644 index 000000000000..bd1ceb2f8945 --- /dev/null +++ b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_hpf_gpio.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&led0 { + gpios = <&hpf_gpio 9 GPIO_ACTIVE_HIGH>; +}; From 116a8240295a4f17b7ae523be1f6e33ecf4caa17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:35:25 +0200 Subject: [PATCH 3090/3334] [nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This commit is a [nrf noup] because it removes configuration options for cryptographic algortihms available in Mbed TLS but which is not actively supported in nRF Connect SDK. The list of algorithms removed: - AES CFB - Cipher Feedback block cipher - AES OFB - Output Feedback block cipher - FFDH - RIPEMD160 - Aria - Camellia - DES The removal of these algorithms is based both on a wish to remove weaker cryptography and unsupported features in the products we have today. Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit aa49bd203c70254b6e55ba917b1b04f9e4140fde) --- modules/mbedtls/Kconfig.psa.auto | 58 ------------------------------- modules/mbedtls/Kconfig.psa.logic | 7 ---- 2 files changed, 65 deletions(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index ef6b7d363db9..3bbc05bcbc25 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -36,10 +36,6 @@ config PSA_WANT_ALG_CMAC bool "PSA_WANT_ALG_CMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_CFB - bool "PSA_WANT_ALG_CFB" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_ALG_CHACHA20_POLY1305 bool "PSA_WANT_ALG_CHACHA20_POLY1305" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -60,10 +56,6 @@ config PSA_WANT_ALG_ECDH bool "PSA_WANT_ALG_ECDH" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_FFDH - bool "PSA_WANT_ALG_FFDH" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_ALG_ECDSA bool "PSA_WANT_ALG_ECDSA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -96,9 +88,6 @@ config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_OFB - bool "PSA_WANT_ALG_OFB" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS @@ -108,9 +97,6 @@ config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_ALG_RIPEMD160 - bool "PSA_WANT_ALG_RIPEMD160" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -224,26 +210,6 @@ config PSA_WANT_ECC_SECP_R1_521 bool "PSA_WANT_ECC_SECP_R1_521" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_DH_RFC7919_2048 - bool "PSA_WANT_DH_RFC7919_2048" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_3072 - bool "PSA_WANT_DH_RFC7919_3072" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_4096 - bool "PSA_WANT_DH_RFC7919_4096" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_6144 - bool "PSA_WANT_DH_RFC7919_6144" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_DH_RFC7919_8192 - bool "PSA_WANT_DH_RFC7919_8192" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_DERIVE bool "PSA_WANT_KEY_TYPE_DERIVE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -264,14 +230,6 @@ config PSA_WANT_KEY_TYPE_AES bool "PSA_WANT_KEY_TYPE_AES" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_ARIA - bool "PSA_WANT_KEY_TYPE_ARIA" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_CAMELLIA - bool "PSA_WANT_KEY_TYPE_CAMELLIA" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -280,10 +238,6 @@ config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY - bool "PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - config PSA_WANT_KEY_TYPE_RAW_DATA bool "PSA_WANT_KEY_TYPE_RAW_DATA" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL @@ -320,16 +274,4 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE - bool "PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS - default y if PSA_CRYPTO_ENABLE_ALL - endif # PSA_CRYPTO_CLIENT diff --git a/modules/mbedtls/Kconfig.psa.logic b/modules/mbedtls/Kconfig.psa.logic index 972054e105b0..9c3a55ea3191 100644 --- a/modules/mbedtls/Kconfig.psa.logic +++ b/modules/mbedtls/Kconfig.psa.logic @@ -47,10 +47,3 @@ config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE - -config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC - bool - default y - depends on PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT || \ - PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT || \ - PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE From 14ebee8263cccdb80522a2a1202ec5717015c354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 21 Aug 2024 12:49:58 +0200 Subject: [PATCH 3091/3334] [nrf noup] mbedtls: Add dependency logic for PSA crypto configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This is a [nrf noup] as this the upstream version of PSA crypto configs is generated by tooling, and there is no mechanisms to qualify that dependent configurations are enabled (by depends or select). -This adds dependency-mapping between configurations in the Kconfigs added for PSA crypto in upstream. -Selecting CHACHA20 key type if PSA_WANT_ALG_STREAM_CIPHER is enabled Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit e9b99eb333d00f006550bcca1e336c774839d218) --- modules/mbedtls/Kconfig.psa.auto | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 3bbc05bcbc25..5528572497c7 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -71,6 +71,7 @@ config PSA_WANT_ALG_GCM config PSA_WANT_ALG_HKDF bool "PSA_WANT_ALG_HKDF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_HKDF_EXTRACT bool "PSA_WANT_ALG_HKDF_EXTRACT" if !MBEDTLS_PROMPTLESS @@ -92,11 +93,12 @@ config PSA_WANT_ALG_MD5 config PSA_WANT_ALG_PBKDF2_HMAC bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL - + depends on PSA_WANT_ALG_CMAC config PSA_WANT_ALG_RSA_OAEP bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS @@ -157,14 +159,17 @@ config PSA_WANT_ALG_STREAM_CIPHER config PSA_WANT_ALG_TLS12_PRF bool "PSA_WANT_ALG_TLS12_PRF" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_PSK_TO_MS bool "PSA_WANT_ALG_TLS12_PSK_TO_MS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_HMAC config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS bool "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_SHA_256 config PSA_WANT_ALG_SHAKE128 bool "PSA_WANT_ALG_SHAKE128" if !MBEDTLS_PROMPTLESS @@ -233,6 +238,8 @@ config PSA_WANT_KEY_TYPE_AES config PSA_WANT_KEY_TYPE_CHACHA20 bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + depends on PSA_WANT_ALG_CHACHA20_POLY1305 || \ + PSA_WANT_ALG_STREAM_CIPHER config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS From 6bb9554be73a9002aeba35e93ae52944bcb5f4f6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 20 Sep 2024 14:48:37 +0200 Subject: [PATCH 3092/3334] [nrf noup] lib: os: zvfs: Remove EXPERIMENTAL from ZVFS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Tomasz Moń (cherry picked from commit 8cb052488688da59da7d4fab4f75cd193697338c) --- lib/os/zvfs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index d7b6914cb5d8..420d6bc41333 100644 --- a/lib/os/zvfs/Kconfig +++ b/lib/os/zvfs/Kconfig @@ -5,7 +5,6 @@ menuconfig ZVFS bool "Zephyr virtual filesystem (ZVFS) support [EXPERIMENTAL]" - 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 a2f44d734422640ccfa4b52b6b4c3209be54da95 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 7 Oct 2024 15:36:43 +0200 Subject: [PATCH 3093/3334] [nrf noup] samples: net: Enable Wi-Fi driver in sysbuild builds Make sure Wi-Fi driver is enabled in networking samples supporting Wi-Fi when sysbuild is used. For shields we cannot automate this, as sysbuild doesn't recognize shields, so, Wi-Fi has to be explicitly enabled, this is done for twister in Wi-Fi sample. Signed-off-by: Robert Lubos Signed-off-by: Chaitanya Tata (cherry picked from commit 13946e4ba178943b25d748338156ade2f2ef0a17) --- samples/net/dns_resolve/Kconfig.sysbuild | 13 +++++++++++++ samples/net/ipv4_autoconf/Kconfig.sysbuild | 13 +++++++++++++ samples/net/lwm2m_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mdns_responder/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mqtt_publisher/Kconfig.sysbuild | 13 +++++++++++++ samples/net/mqtt_sn_publisher/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/coap_server/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_async/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/echo_server/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/http_get/Kconfig.sysbuild | 13 +++++++++++++ samples/net/sockets/sntp_client/Kconfig.sysbuild | 13 +++++++++++++ samples/net/syslog_net/Kconfig.sysbuild | 13 +++++++++++++ samples/net/telnet/Kconfig.sysbuild | 13 +++++++++++++ samples/net/wifi/Kconfig.sysbuild | 13 +++++++++++++ samples/net/wifi/shell/sample.yaml | 2 ++ 16 files changed, 197 insertions(+) create mode 100644 samples/net/dns_resolve/Kconfig.sysbuild create mode 100644 samples/net/ipv4_autoconf/Kconfig.sysbuild create mode 100644 samples/net/lwm2m_client/Kconfig.sysbuild create mode 100644 samples/net/mdns_responder/Kconfig.sysbuild create mode 100644 samples/net/mqtt_publisher/Kconfig.sysbuild create mode 100644 samples/net/mqtt_sn_publisher/Kconfig.sysbuild create mode 100644 samples/net/sockets/coap_server/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_async/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_client/Kconfig.sysbuild create mode 100644 samples/net/sockets/echo_server/Kconfig.sysbuild create mode 100644 samples/net/sockets/http_get/Kconfig.sysbuild create mode 100644 samples/net/sockets/sntp_client/Kconfig.sysbuild create mode 100644 samples/net/syslog_net/Kconfig.sysbuild create mode 100644 samples/net/telnet/Kconfig.sysbuild create mode 100644 samples/net/wifi/Kconfig.sysbuild diff --git a/samples/net/dns_resolve/Kconfig.sysbuild b/samples/net/dns_resolve/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/dns_resolve/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/ipv4_autoconf/Kconfig.sysbuild b/samples/net/ipv4_autoconf/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/ipv4_autoconf/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/lwm2m_client/Kconfig.sysbuild b/samples/net/lwm2m_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/lwm2m_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mdns_responder/Kconfig.sysbuild b/samples/net/mdns_responder/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mdns_responder/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_publisher/Kconfig.sysbuild b/samples/net/mqtt_publisher/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mqtt_publisher/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/mqtt_sn_publisher/Kconfig.sysbuild b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/mqtt_sn_publisher/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/coap_server/Kconfig.sysbuild b/samples/net/sockets/coap_server/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/coap_server/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_async/Kconfig.sysbuild b/samples/net/sockets/echo_async/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_async/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_client/Kconfig.sysbuild b/samples/net/sockets/echo_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/echo_server/Kconfig.sysbuild b/samples/net/sockets/echo_server/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/echo_server/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/http_get/Kconfig.sysbuild b/samples/net/sockets/http_get/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/http_get/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/sockets/sntp_client/Kconfig.sysbuild b/samples/net/sockets/sntp_client/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/sockets/sntp_client/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/syslog_net/Kconfig.sysbuild b/samples/net/syslog_net/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/syslog_net/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/telnet/Kconfig.sysbuild b/samples/net/telnet/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/telnet/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/Kconfig.sysbuild b/samples/net/wifi/Kconfig.sysbuild new file mode 100644 index 000000000000..158551060c56 --- /dev/null +++ b/samples/net/wifi/Kconfig.sysbuild @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config WIFI_NRF70 + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index d799c1b9beec..52edf0c6267f 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -58,6 +58,7 @@ tests: - nrf7002dk/nrf5340/cpuapp/nrf7001 sample.net.wifi.nrf7002ek: extra_args: + - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002ek platform_allow: @@ -69,6 +70,7 @@ tests: sample.net.wifi.nrf7002eb: extra_args: - CONFIG_NRF70_UTIL=y + - SB_CONFIG_WIFI_NRF70=y - CONFIG_BUILD_ONLY_NO_BLOBS=y - SHIELD=nrf7002eb platform_allow: From a23d458e03abf532b89c3eb7048f288adc51a783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 14:05:41 +0200 Subject: [PATCH 3094/3334] [nrf noup] net: tests: Add legacy crypto API support for big_http_download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -We handle legacy Crypto API support specially (favoring PSA crypto) the tests here require MD interface to build, which needs the config MBEDTLS_LEGACY_CRYPTO_C to be enable to get access to Signed-off-by: Frank Audun Kvamtrø Signed-off-by: Tomasz Moń (cherry picked from commit dc583bac9e76382f5171a3db86e856aa6fe72c0e) --- samples/net/sockets/big_http_download/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/net/sockets/big_http_download/prj.conf b/samples/net/sockets/big_http_download/prj.conf index c623d3b763bf..661ff62e9d92 100644 --- a/samples/net/sockets/big_http_download/prj.conf +++ b/samples/net/sockets/big_http_download/prj.conf @@ -3,6 +3,7 @@ CONFIG_REQUIRES_FULL_LIBC=y CONFIG_PSA_CRYPTO=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_PSA_WANT_ALG_SHA_256=y +CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y CONFIG_MAIN_STACK_SIZE=2536 # Networking config From 562e256b4bedfa5a06b4831f5c9fdc2140715a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 14:31:02 +0200 Subject: [PATCH 3095/3334] [nrf noup] net: tests: crypto: Adding legacy Crypto support ipv6 tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -This adds crypto support for ipv6 tests by enabling CONFIG_MBEDTLS_LEGACY_CRYPTO_C Signed-off-by: Frank Audun Kvamtrø (cherry picked from commit d04c0070d2afe69dc8b69d2f1ea1b3cce07a8eb9) --- tests/net/ipv6/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index 9f9f21d59050..6a6be5dba36a 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -33,6 +33,7 @@ CONFIG_NET_IF_MAX_IPV6_COUNT=2 CONFIG_NET_IPV6_PE=y CONFIG_NET_IPV6_PE_FILTER_PREFIX_COUNT=2 CONFIG_NET_IPV6_PE_PREFER_PUBLIC_ADDRESSES=n +CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y # Increase the stack a bit for mps2/an385 CONFIG_NET_RX_STACK_SIZE=1700 From f03014ffc99d77be0becd82d1d280142bf567900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayt=C3=BCrk=20D=C3=BCzen?= Date: Wed, 20 Nov 2024 13:06:23 +0100 Subject: [PATCH 3096/3334] [nrf noup] tests: bluetooth: tester: sysbuild configurable 53/54H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for sysbuild 54h20 building added nrf54h20 cpurad configuration to hci_ipc sample. Signed-off-by: Aytürk Düzen Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Tomasz Moń (cherry picked from commit 3765002bf40d5499b4491d69f060457bddece076) --- .../nrf54h20_cpurad-bt_ll_softdevice.conf | 33 +++++++++++++++++++ tests/bluetooth/tester/Kconfig.sysbuild | 1 + tests/bluetooth/tester/sysbuild.cmake | 16 +++++++-- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf diff --git a/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf new file mode 100644 index 000000000000..1f7748e5cd7d --- /dev/null +++ b/samples/bluetooth/hci_ipc/nrf54h20_cpurad-bt_ll_softdevice.conf @@ -0,0 +1,33 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_ISR_STACK_SIZE=1024 +CONFIG_IDLE_STACK_SIZE=256 +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 +CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y + +CONFIG_BT_BUF_EVT_RX_COUNT=16 +CONFIG_BT_BUF_EVT_RX_SIZE=255 +CONFIG_BT_BUF_ACL_RX_SIZE=255 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_BUF_CMD_TX_SIZE=255 + +# Host +CONFIG_BT_BROADCASTER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_PER_ADV=y +CONFIG_BT_PER_ADV_SYNC=y + +# Controller +CONFIG_BT_LL_SW_SPLIT=n +CONFIG_BT_LL_SOFTDEVICE=y +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 diff --git a/tests/bluetooth/tester/Kconfig.sysbuild b/tests/bluetooth/tester/Kconfig.sysbuild index 69e4d5a97fbe..e14a6e1aa8e0 100644 --- a/tests/bluetooth/tester/Kconfig.sysbuild +++ b/tests/bluetooth/tester/Kconfig.sysbuild @@ -5,6 +5,7 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string + default "nrf54h20dk/nrf54h20/cpurad" if "$(BOARD)" = "nrf54h20dk" default "nrf5340dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340dk" default "nrf5340_audio_dk/nrf5340/cpunet" if "$(BOARD)" = "nrf5340_audio_dk" default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP" diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index b0bb228ab997..b480fa4ee449 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) - # For builds in the nrf5340, we build the netcore image with the controller - set(NET_APP hci_ipc) set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP}) @@ -13,6 +11,20 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) BOARD ${SB_CONFIG_NET_CORE_BOARD} ) + if(SB_CONFIG_SOC_NRF5340_CPUAPP) + set(${NET_APP}_SNIPPET + "bt-ll-sw-split" + CACHE INTERNAL "" + ) + endif() + + if(SB_CONFIG_SOC_NRF54H20_CPUAPP) + set(${NET_APP}_CONF_FILE + ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf + CACHE INTERNAL "" + ) + endif() + set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" From 2b7cf1efe34ebf61e3f113efd9d62e5e014d8a72 Mon Sep 17 00:00:00 2001 From: Ingar Kulbrandstad Date: Tue, 21 May 2024 13:59:58 +0200 Subject: [PATCH 3097/3334] [nrf noup] Bluetooth: Mesh: Disable processing of ext ADV packets Disable processing of extended ADV packets by mesh scanner. This is done to prevent loss of scan time due to reception of pointer packets while scanning for mesh packets. Signed-off-by: Ingar Kulbrandstad (cherry picked from commit 6a6f1e49672e1d80594843386f8052e95304ccc3) --- subsys/bluetooth/mesh/Kconfig | 11 +++++++++++ subsys/bluetooth/mesh/adv_ext.c | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index a311032d46e7..91a0e8fc7360 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -216,6 +216,17 @@ config BT_MESH_ADV_EXT_FRIEND_SEPARATE messages as close to the start of the ReceiveWindow as possible, thus reducing the scanning time on the Low Power node. +config BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS + bool "Reject or accept extended advertising packets" + depends on BT_LL_SOFTDEVICE + help + Configure the scanner and initiator to either reject or accept extended + advertising packets by the SoftDevice Controller. This is set to false + by default, to prevent loss of scan time when receiving a pointer packet + while scanning for Bluetooth Mesh packets. Set to true if extended + advertising packets are to be received by the SoftDevice Controller for + purposes other than Bluetooth Mesh. + endif # BT_MESH_ADV_EXT endchoice diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index f41d2dd0f422..abcccd27a1ac 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -529,6 +529,18 @@ void bt_mesh_adv_init(void) K_PRIO_COOP(MESH_WORKQ_PRIORITY), NULL); k_thread_name_set(&bt_mesh_workq.thread, "BT MESH WQ"); } + +#if defined(CONFIG_BT_LL_SOFTDEVICE) + const sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t cmd_params = { + .accept_ext_adv_packets = IS_ENABLED(CONFIG_BT_MESH_ADV_EXT_ACCEPT_EXT_ADV_PACKETS), + }; + + int err = sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set(&cmd_params); + + if (err) { + LOG_ERR("Failed to set accept_ext_adv_packets: %d", err); + } +#endif } static struct bt_mesh_ext_adv *adv_instance_find(struct bt_le_ext_adv *instance) From 993c9e536d9fa196c7dbeed8bdc643876e5902ce Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Mon, 16 Jan 2023 14:15:22 +0100 Subject: [PATCH 3098/3334] [nrf noup] dts: choose a crypto accelerator for entropy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a long-term noup patch because crypto driver support is NCS-only for both cryptocell and CRACEN. Set HAS_HW_NRF_CC3XX to be defined in NS build when cryptocell is accessed through the PSA API. We need to know which CC3XX features are available. Set PSA as the entropy source for 54L. PSA is the only NCS-supported interface to CRACEN. Signed-off-by: Georgios Vasilakis Signed-off-by: Joakim Andersson Signed-off-by: Dominik Ermel Signed-off-by: Sebastian Bøe Signed-off-by: Robert Lubos Signed-off-by: Rubin Gerritsen (cherry picked from commit 2cd9fbbf078302bc397552fa8891570611f4c04a) --- dts/arm/nordic/nrf52840.dtsi | 4 ++-- dts/arm/nordic/nrf5340_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf91.dtsi | 3 ++- soc/nordic/common/Kconfig.peripherals | 6 ++++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 14b3d14adc18..a9c32ace6111 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -12,7 +12,7 @@ / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -589,7 +589,7 @@ reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>; reg-names = "wrapper", "core"; interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; }; }; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index 517bbb4c6e99..f0a7a6eeb301 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -34,7 +34,7 @@ }; chosen { - zephyr,entropy = &rng_hci; + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -132,7 +132,7 @@ reg = <0x50844000 0x1000>, <0x50845000 0x1000>; reg-names = "wrapper", "core"; interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 10739683e0c9..5715ebfd2a05 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -16,7 +16,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -32,7 +32,7 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; }; diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 5d625ed2cb8f..b840bdaa5fc7 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -28,6 +28,7 @@ }; chosen { + zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -76,7 +77,7 @@ reg = <0x50840000 0x1000>, <0x50841000 0x1000>; reg-names = "wrapper", "core"; interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; + status = "okay"; }; ctrlap: ctrlap@50006000 { diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index e54ba6f21f92..dd1da546ab8b 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -13,10 +13,12 @@ config HAS_HW_NRF_BPROT def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT)) config HAS_HW_NRF_CC310 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) || \ + ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91X) config HAS_HW_NRF_CC312 - def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) + def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \ + ($(dt_nodelabel_enabled,psa_rng) && SOC_NRF5340_CPUAPP) config HAS_HW_NRF_CCM def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM)) From ba305ea2549cebaa5d68bd5f9c99e671369d7baa Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 21 Jun 2024 13:25:22 +0200 Subject: [PATCH 3099/3334] [nrf noup] soc: nrf54l: Add custom section for KMU Add a custom section in the linker which should always be placed in the top of RAM. This will be used by the KMU to push keys into it. Since when you provision a key into the KMU you need to set specific a memory location for the PUSH operation we need to keep this memory location static across images/dfus. The linker script inclusion which places the KMU reserved buffer on the top of RAM doesn't work for non-XIP builds. The Zephyr linker script will firstly load the code for an non-XIP build in RAM and then include this KMU related linker script which results in an unpredictable placement of the KMU reserved area and a failed build. In order to support non-XIP builds the linker file is not included and the a DTS reserved-memory entry should be used. To limit the scope, the DTS reserved memory region is currently only supported for non-XIP builds. This is a noup since the KMU is not supported upstream. Ref: NCSDK-25121 Signed-off-by: Georgios Vasilakis Signed-off-by: Robin Kastberg (cherry picked from commit fbc20243ec195fce829e1355c3bbd9eb1da192d8) --- soc/nordic/nrf54l/CMakeLists.txt | 13 +++++++++++++ soc/nordic/nrf54l/kmu_push_area_section.ld | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 soc/nordic/nrf54l/kmu_push_area_section.ld diff --git a/soc/nordic/nrf54l/CMakeLists.txt b/soc/nordic/nrf54l/CMakeLists.txt index cebbda571b68..b220b9d2a7a2 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -6,3 +6,16 @@ zephyr_library_sources( ../validate_rram_partitions.c ) zephyr_include_directories(.) + +dt_nodelabel(kmu_push_area_node NODELABEL nrf_kmu_reserved_push_area) + +# We need a buffer in memory in a static location which can be used by +# the KMU peripheral. The KMU has a static destination address, we chose +# this address to be 0x20000000, which is the first address in the SRAM. +if(NOT CONFIG_BUILD_WITH_TFM AND CONFIG_PSA_NEED_CRACEN_KMU_DRIVER AND NOT kmu_push_area_node) +# 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) + +zephyr_linker_section(NAME ".nrf_kmu_reserved_push_area" ADDRESS "${RAM_ADDR}" GROUP RAM_REGION NOINIT) +endif() diff --git a/soc/nordic/nrf54l/kmu_push_area_section.ld b/soc/nordic/nrf54l/kmu_push_area_section.ld new file mode 100644 index 000000000000..e8c8cd9f09ad --- /dev/null +++ b/soc/nordic/nrf54l/kmu_push_area_section.ld @@ -0,0 +1,19 @@ +# This section must be loaded first of all the +# custom sections because we want it to be placed +# at the top address of RAM. +SECTION_PROLOGUE(NRF_KMU_RESERVED_PUSH_SECTION,(NOLOAD) ,) +{ + __nrf_kmu_reserved_push_area = .; + *(.nrf_kmu_reserved_push_area) + __nrf_kmu_reserved_push_area_end = .; +} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) + +# It doesn't seem to be possible to enforce placing a section +# at a specific address in memory using the Zephyr SECTION macros. +# So this assert is necessary to avoid accidentatly moving this +# section to a different address. +ASSERT(__nrf_kmu_reserved_push_area == RAM_ADDR, "Error: \ + The section NRF_KMU_RESERVED_PUSH_SECTION needs to be \ + placed on the top RAM address but it is not, please edit \ + your linker scripts to make sure that it is placed on \ + the to RAM address.") From 03b994684a8804ba55e1b2d0fbc42b6a32780ddf Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 12 Dec 2024 07:58:06 +0000 Subject: [PATCH 3100/3334] [nrf noup] samples/tests: Add TF-M sysbuild config files Fixes some issues with samples/tests by adding configuration files to satisfy TF-M requirements Signed-off-by: Jamie McCrae (cherry picked from commit 20d3749d7abf116dbe240f28a310971f37b30f23) --- samples/subsys/usb/dfu/sysbuild.conf | 1 + tests/drivers/flash/common/sysbuild.conf | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 samples/subsys/usb/dfu/sysbuild.conf delete mode 100644 tests/drivers/flash/common/sysbuild.conf diff --git a/samples/subsys/usb/dfu/sysbuild.conf b/samples/subsys/usb/dfu/sysbuild.conf new file mode 100644 index 000000000000..47f00ff3cff8 --- /dev/null +++ b/samples/subsys/usb/dfu/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/drivers/flash/common/sysbuild.conf b/tests/drivers/flash/common/sysbuild.conf deleted file mode 100644 index 6408669a8474..000000000000 --- a/tests/drivers/flash/common/sysbuild.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_PARTITION_MANAGER=n From df426b6b1fd182276a261b411c539efd2d39a1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 22 Oct 2024 08:55:47 +0200 Subject: [PATCH 3101/3334] [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added ncs-specific modules to nrfx_config_reserved_resources. The modules are: - mpsl - nrfe Signed-off-by: Rafał Kuźnia Signed-off-by: Nikodem Kastelik Co-authored-by: Krzysztof Chruściński Signed-off-by: Eivind Jølsgard Signed-off-by: Aleksandar Stanoev Signed-off-by: Piotr Pryga (cherry picked from commit 5566637e963e25bdba81508558f780d4f9e1470d) --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ++++++++++++++++++ 2 files changed, 949 insertions(+), 1 deletion(-) create mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index e45a405b2482..bc1d447c82f5 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -328,6 +328,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_reserved_resources.h" + default "nrfx_config_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h new file mode 100644 index 000000000000..ec8a9acaf7b5 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h @@ -0,0 +1,948 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ +#define NRFX_CONFIG_RESERVED_RESOURCES_H__ + +/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE130_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) + +/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE131_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) + +/** @brief Bitmask that defines EGU instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_EGUS_USED 0 + +/** @brief Bitmask that defines TIMER instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_TIMERS_USED 0 + +/* If the GRTC system timer driver is to be used, prepare definitions required + * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and + * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. + */ +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) +#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ + (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ + ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) +#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ + (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ + DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ + +/* + * The enabled Bluetooth controller subsystem is responsible for providing + * definitions of the BT_CTLR_USED_* symbols used below in a file named + * bt_ctlr_used_resources.h and for adding its location to global include + * paths so that the file can be included here for all Zephyr libraries that + * are to be built. + */ +#if defined(CONFIG_BT_LL_SW_SPLIT) +#include +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#endif +#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +/* Define auxiliary symbols needed for SDC device dispatch. */ +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRF52_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRF53_SERIES +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#define NRF54L_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF71X) +#define NRF71_SERIES +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRF54H_SERIES +#endif +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_NRF_802154_RADIO_DRIVER) +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#include <../src/nrf_802154_peripherals_nrf52.h> +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#include <../src/nrf_802154_peripherals_nrf53.h> +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#include <../src/nrf_802154_peripherals_nrf54l.h> +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#include <../src/nrf_802154_peripherals_nrf54h.h> +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL +#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL +#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL +#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL +#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL +#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL +#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL +#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL +#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL +#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL +#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL +#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL +#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL +#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL +#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL +#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL +#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL +#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 +#endif + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_CHANNELS_USED \ + (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI0_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_GROUPS_USED \ + (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI0_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_CHANNELS_USED \ + (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI00_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_GROUPS_USED \ + (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI00_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_CHANNELS_USED \ + (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI10_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_GROUPS_USED \ + (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI10_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_CHANNELS_USED \ + (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI20_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_GROUPS_USED \ + (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI20_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_CHANNELS_USED \ + (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI30_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_GROUPS_USED \ + (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI30_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_CHANNELS_USED \ + (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI020_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_GROUPS_USED \ + (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI020_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_CHANNELS_USED \ + (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI030_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_GROUPS_USED \ + (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI030_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_CHANNELS_USED \ + (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI120_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_GROUPS_USED \ + (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI120_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_CHANNELS_USED \ + (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI130_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_GROUPS_USED \ + (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI130_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_CHANNELS_USED \ + (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI131_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_GROUPS_USED \ + (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI131_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_CHANNELS_USED \ + (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI132_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_GROUPS_USED \ + (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI132_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_CHANNELS_USED \ + (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI133_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_GROUPS_USED \ + (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI133_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_CHANNELS_USED \ + (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI134_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_GROUPS_USED \ + (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI134_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_CHANNELS_USED \ + (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI135_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_GROUPS_USED \ + (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI135_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_CHANNELS_USED \ + (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI136_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_GROUPS_USED \ + (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI136_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines PPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_CHANNELS_USED \ + (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) + +#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED +#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED + +/** @brief Bitmask that defines PPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_GROUPS_USED \ + (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ + NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) + +#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ + (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ + (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ + (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ + (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ + (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ + (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ + (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ + NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) + +#if defined(CONFIG_SOFTDEVICE) +#include +#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED +#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED +#else +#define NRFX_PPI_CHANNELS_USED_BY_SD 0 +#define NRFX_PPI_GROUPS_USED_BY_SD 0 +#endif + +#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ From 7fb40c559b47114cc1914cb136e12736554312a3 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Tue, 25 Feb 2025 10:35:24 +0100 Subject: [PATCH 3102/3334] [nrf noup] samples: bluetooth: mesh: Disable secure storage for real targets. Mesh currently works with trusted storage on real targets. Until secure storage is supported by default disable it. Signed-off-by: Aleksandr Khromykh (cherry picked from commit 35fcd6ef1e872b5b5549049e9a702904abcd9377) --- samples/bluetooth/mesh/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh/prj.conf | 2 +- samples/bluetooth/mesh_demo/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh_demo/prj.conf | 2 +- samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf | 6 ++++++ samples/bluetooth/mesh_provisioner/prj.conf | 2 +- samples/boards/nordic/mesh/onoff-app/prj.conf | 2 +- .../nordic/mesh/onoff_level_lighting_vnd_app/prj.conf | 2 +- tests/bluetooth/mesh_shell/boards/qemu_x86.conf | 6 ++++++ tests/bluetooth/mesh_shell/prj.conf | 2 +- 10 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 samples/bluetooth/mesh/boards/qemu_x86.conf create mode 100644 samples/bluetooth/mesh_demo/boards/qemu_x86.conf create mode 100644 samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf create mode 100644 tests/bluetooth/mesh_shell/boards/qemu_x86.conf diff --git a/samples/bluetooth/mesh/boards/qemu_x86.conf b/samples/bluetooth/mesh/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh/prj.conf b/samples/bluetooth/mesh/prj.conf index 05db4813e912..c98fddec6f9a 100644 --- a/samples/bluetooth/mesh/prj.conf +++ b/samples/bluetooth/mesh/prj.conf @@ -5,7 +5,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_HWINFO=y CONFIG_BT=y diff --git a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_demo/prj.conf b/samples/bluetooth/mesh_demo/prj.conf index bcb738ae5bd1..b7016b02c65b 100644 --- a/samples/bluetooth/mesh_demo/prj.conf +++ b/samples/bluetooth/mesh_demo/prj.conf @@ -31,7 +31,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y # Limit the number of key slots in PSA Crypto core to reduce # RAM footprint diff --git a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 5660adcd48c3..4a2606efcb36 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -46,7 +46,7 @@ CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y #CONFIG_BT_MESH_LOG_LEVEL_DBG=y #CONFIG_BT_MESH_SETTINGS_LOG_LEVEL_DBG=y diff --git a/samples/boards/nordic/mesh/onoff-app/prj.conf b/samples/boards/nordic/mesh/onoff-app/prj.conf index 0e67042b2653..0783579e795e 100644 --- a/samples/boards/nordic/mesh/onoff-app/prj.conf +++ b/samples/boards/nordic/mesh/onoff-app/prj.conf @@ -9,7 +9,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600 diff --git a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf index 3bb984208c70..96b5466b4a16 100644 --- a/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf +++ b/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/prj.conf @@ -7,7 +7,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT_OBSERVER=y CONFIG_BT_BROADCASTER=y diff --git a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf new file mode 100644 index 000000000000..bfb57193b782 --- /dev/null +++ b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf @@ -0,0 +1,6 @@ +# nrf_security only supports Cortex-M via PSA crypto libraries. +# Enforcing usage of built-in Mbed TLS for native simulator. +CONFIG_NRF_SECURITY=n +CONFIG_MBEDTLS_ENABLE_HEAP=n +CONFIG_TRUSTED_STORAGE=n +CONFIG_SECURE_STORAGE=y diff --git a/tests/bluetooth/mesh_shell/prj.conf b/tests/bluetooth/mesh_shell/prj.conf index 2af600295680..aab2745d359f 100644 --- a/tests/bluetooth/mesh_shell/prj.conf +++ b/tests/bluetooth/mesh_shell/prj.conf @@ -14,7 +14,7 @@ CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y -CONFIG_SECURE_STORAGE=y +# CONFIG_SECURE_STORAGE=y CONFIG_BT=y CONFIG_BT_OBSERVER=y From e2e5283edf502971d13dc2d947db8844c07d5b87 Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Fri, 28 Feb 2025 12:27:22 +0100 Subject: [PATCH 3103/3334] [nrf noup] samples: bluetooth: hci_ipc: increase main stack size for Cracen driver on nRF54H20 A larger stack is needed to accomodate the Cracen driver. Signed-off-by: Gordon Klaus (cherry picked from commit 4797b5f214fcd753d3f955c6df083dd67ceb4ec7) --- .../bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..296e68366389 --- /dev/null +++ b/samples/bluetooth/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,2 @@ +# Increase stack size for Cracen driver. +CONFIG_MAIN_STACK_SIZE=1024 From 0581249d1c5383a93d9b59b6a0b73fcdb1e6c095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Tue, 17 Dec 2024 21:45:47 +0100 Subject: [PATCH 3104/3334] [nrf noup] drivers: spi_dw: Bring back custom EXMIF peripheral handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit brings back modifications from these reverted commits: - f68b2edaa2233cde29d955bc3d3b3dd75ff50334 - e606246f0fc3e9299cb5bdd3c1e34a091e5d85a1 slightly adjusted so that the EXMIF peripheral is still by default handled by the mspi_dw driver, and in cases where this driver cannot be used because something still does not work correctly, one can switch to the old solution based on the tweaked spi_dw driver. Signed-off-by: Andrzej Głąbek (cherry picked from commit 5878b1b0004b5b86e4b3c54bef9b0071cdca4554) --- drivers/pinctrl/pinctrl_nrf.c | 3 +- drivers/spi/spi_dw.c | 32 +++++++++++++++++++++- dts/bindings/spi/nordic,nrf-exmif-spi.yaml | 8 ++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 dts/bindings/spi/nordic,nrf-exmif-spi.yaml diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index a9902d33f801..b052e61eb803 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -468,7 +468,8 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif) || \ + DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_exmif_spi) /* Pin routing is controlled by secure domain, via UICR */ case NRF_FUN_EXMIF_CK: case NRF_FUN_EXMIF_DQ0: diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index 587342931aea..8025d8d28d7c 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -41,6 +41,14 @@ LOG_MODULE_REGISTER(spi_dw); #include #endif +#ifdef CONFIG_HAS_NRFX +#include +#endif + +#ifdef CONFIG_SOC_NRF54H20_GPD +#include +#endif + static inline bool spi_dw_is_slave(struct spi_dw_data *spi) { return (IS_ENABLED(CONFIG_SPI_SLAVE) && @@ -258,6 +266,7 @@ static int spi_dw_configure(const struct device *dev, /* Baud rate and Slave select, for master only */ write_baudr(dev, SPI_DW_CLK_DIVIDER(info->clock_frequency, config->frequency)); + write_ser(dev, BIT(config->slave)); } if (spi_dw_is_slave(spi)) { @@ -512,6 +521,10 @@ void spi_dw_isr(const struct device *dev) uint32_t int_status; int error; +#ifdef CONFIG_HAS_NRFX + NRF_EXMIF->EVENTS_CORE = 0; +#endif + int_status = read_isr(dev); LOG_DBG("SPI %p int_status 0x%x - (tx: %d, rx: %d)", dev, int_status, @@ -570,6 +583,18 @@ int spi_dw_init(const struct device *dev) DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); +#ifdef CONFIG_HAS_NRFX + NRF_EXMIF->INTENSET = BIT(0); + NRF_EXMIF->TASKS_START = 1; + +#ifdef CONFIG_SOC_NRF54H20_GPD + err = nrf_gpd_request(NRF_GPD_FAST_ACTIVE1); + if (err < 0) { + return err; + } +#endif +#endif + info->config_func(); /* Masking interrupt and making sure controller is disabled */ @@ -596,6 +621,11 @@ int spi_dw_init(const struct device *dev) return 0; } +#define REG_ADDR(inst) \ + COND_CODE_1(DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), nordic_nrf_exmif_spi), \ + (Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(core, DT_DRV_INST(inst))), \ + (DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)))) + #define SPI_CFG_IRQS_SINGLE_ERR_LINE(inst) \ IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, rx_avail, irq), \ DT_INST_IRQ_BY_NAME(inst, rx_avail, priority), \ @@ -677,7 +707,7 @@ COND_CODE_1(IS_EQ(DT_NUM_IRQS(DT_DRV_INST(inst)), 1), \ SPI_CONTEXT_CS_GPIOS_INITIALIZE(DT_DRV_INST(inst), ctx) \ }; \ static const struct spi_dw_config spi_dw_config_##inst = { \ - DEVICE_MMIO_ROM_INIT(DT_DRV_INST(inst)), \ + REG_ADDR(inst), \ .clock_frequency = COND_CODE_1( \ DT_NODE_HAS_PROP(DT_INST_PHANDLE(inst, clocks), clock_frequency), \ (DT_INST_PROP_BY_PHANDLE(inst, clocks, clock_frequency)), \ diff --git a/dts/bindings/spi/nordic,nrf-exmif-spi.yaml b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml new file mode 100644 index 000000000000..d988b4146878 --- /dev/null +++ b/dts/bindings/spi/nordic,nrf-exmif-spi.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic External Memory Interface (EXMIF) used in SPI mode only + +compatible: "nordic,nrf-exmif-spi" + +include: snps,designware-spi.yaml From d2939cbeb921c2263bc26b594db514a7d0d050fc Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 20 Nov 2020 14:44:03 +0100 Subject: [PATCH 3105/3334] [nrf noup] Bluetooth: update experimental for qualification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Kconfig options for qualification: - Remove experimental on qualified feature. - Add experimental on unqualified feature. - BT_L2CAP_ECRED is not marked as experimental upstream and we qualify it downstream. Signed-off-by: Joakim Andersson Signed-off-by: Trond Einar Snekvik Signed-off-by: Martí Bolívar Signed-off-by: Robert Lubos Signed-off-by: Dominik Ermel Signed-off-by: Ingar Kulbrandstad Signed-off-by: Torsten Rasmussen Signed-off-by: Herman Berget Signed-off-by: Tomasz Moń Signed-off-by: Théo Battrel (cherry picked from commit f23942a502af928620fe745e9d0ae23b68e1e9c8) --- subsys/bluetooth/controller/Kconfig | 4 +++- subsys/bluetooth/host/Kconfig.l2cap | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 0d5cba824162..abffc5faa164 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -141,10 +141,12 @@ config HAS_BT_CTLR bool config BT_LL_SW_SPLIT - bool "Software-based Bluetooth LE Link Layer" + bool "Software-based Bluetooth LE Link Layer [EXPERIMENTAL]" default y depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED select HAS_BT_CTLR + select EXPERIMENTAL + select ENTROPY_GENERATOR help Use Zephyr software Bluetooth LE Link Layer ULL LLL split implementation. diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index dc98241a6730..64f9420fbbff 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -52,7 +52,7 @@ config BT_L2CAP_DYNAMIC_CHANNEL allowing the creation of dynamic L2CAP Channels. config BT_L2CAP_ECRED - bool "L2CAP Enhanced Credit Based Flow Control support" + bool "L2CAP Enhanced Credit Based Flow Control support [EXPERIMENTAL]" depends on BT_L2CAP_DYNAMIC_CHANNEL help This option enables support for LE Connection oriented Channels with From 2c0d4267cfa54e1fa68287791059c02feb51c43c Mon Sep 17 00:00:00 2001 From: Gordon Klaus Date: Tue, 8 Apr 2025 17:56:00 +0200 Subject: [PATCH 3106/3334] [nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PSA is a cryptographically secure random number generator. It will be enabled by default, eventually, For now, enable it manually. Signed-off-by: Gordon Klaus Signed-off-by: Tomasz Moń (cherry picked from commit 60e3e915b4e664e0724ae4a83f10f8c73de0d268) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 ++++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 +++++++ tests/bluetooth/tester/sysbuild.cmake | 7 ---- .../boards/nrf54h20dk_nrf54h20_cpurad.conf | 40 +++++++++++++++++++ .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 13 ++++++ .../tester/sysbuild/hci_ipc/prj.conf | 23 +++++++++++ 6 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay create mode 100644 tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 5bb1c4d82846..51b0ef5fa8d4 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -22,3 +22,10 @@ CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_BTTESTER_LOG_LEVEL_DBG=y CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable PSA RNG +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index e6d4f675f57a..4f9de686b7e5 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -12,3 +12,17 @@ status = "okay"; hw-flow-control; }; + +// Enable PSA RNG +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; + + /delete-node/ prng; +}; diff --git a/tests/bluetooth/tester/sysbuild.cmake b/tests/bluetooth/tester/sysbuild.cmake index b480fa4ee449..b4c05e1ee4aa 100644 --- a/tests/bluetooth/tester/sysbuild.cmake +++ b/tests/bluetooth/tester/sysbuild.cmake @@ -18,13 +18,6 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) ) endif() - if(SB_CONFIG_SOC_NRF54H20_CPUAPP) - set(${NET_APP}_CONF_FILE - ${NET_APP_SRC_DIR}/nrf54h20_cpurad-bt_ll_softdevice.conf - CACHE INTERNAL "" - ) - endif() - set(${NET_APP}_EXTRA_CONF_FILE ${APP_DIR}/overlay-bt_ll_sw_split.conf CACHE INTERNAL "" diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..b7d64a9e6a08 --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,40 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_ISR_STACK_SIZE=1024 +CONFIG_IDLE_STACK_SIZE=256 +CONFIG_MAIN_STACK_SIZE=1024 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 +CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y + +CONFIG_BT_BUF_EVT_RX_COUNT=16 +CONFIG_BT_BUF_EVT_RX_SIZE=255 +CONFIG_BT_BUF_ACL_RX_SIZE=255 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_BUF_CMD_TX_SIZE=255 + +# Host +CONFIG_BT_BROADCASTER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_CENTRAL=y +CONFIG_BT_EXT_ADV=y +CONFIG_BT_PER_ADV=y +CONFIG_BT_PER_ADV_SYNC=y + +# Controller +CONFIG_BT_LL_SW_SPLIT=n +CONFIG_BT_LL_SOFTDEVICE=y +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 + +# Enable PSA RNG +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n +CONFIG_PSA_SSF_CRYPTO_CLIENT=y +CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..e34567fe834a --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,13 @@ +// Enable PSA RNG +/ { + chosen { + zephyr,entropy = &psa_rng; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; + + /delete-node/ prng; +}; diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf new file mode 100644 index 000000000000..08b1aed9e7f6 --- /dev/null +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/prj.conf @@ -0,0 +1,23 @@ +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_HEAP_MEM_POOL_SIZE=4096 + +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y +CONFIG_BT_MAX_CONN=16 + + +# Workaround: Unable to allocate command buffer when using K_NO_WAIT since +# Host number of completed commands does not follow normal flow control. +CONFIG_BT_BUF_CMD_TX_COUNT=10 + +# Enable and adjust the below value as necessary +# CONFIG_BT_BUF_EVT_RX_COUNT=16 +# CONFIG_BT_BUF_EVT_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_TX_SIZE=251 +# CONFIG_BT_BUF_CMD_TX_SIZE=255 From 9bd16fb835d944838dabef0432a4fad05edd73a1 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 30 Nov 2018 14:07:56 +0100 Subject: [PATCH 3107/3334] [nrf noup] ci: NCS-specific CI tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Necessary changes for NCS CI. - Add a Jenkinsfile - Add a commit-tags workflow: This enables sauce tag checking in sdk-zephyr - compliance.yml: Disable check for merge commits, since we have upmerges downstream. Also, since in the code we refer to Kconfig symbols that are defined in the sdk-nrf repository, the Kconfig checks ((SysBuild)Kconfig, (SysBuild)KconfigBasic and (SysBuild)KconfigBasicNoModules) will not pass so exclude them. Also, disable any maintainers-related checks - scripts/gitlint: Extend the max commit line lengths for Gitlint to account for sauce tags - Adapt to the changes in: https://github.com/nrfconnect/action-commit-tags/pull/4 Signed-off-by: Carles Cufi Signed-off-by: Dominik Ermel Signed-off-by: Martí Bolívar Signed-off-by: Vinayak Kariappa Chettimada Signed-off-by: Krishna T Signed-off-by: Dominik Ermel (cherry picked from commit 7de0c8423dee010ff70a411f5788bd9a9149b4d7) --- .github/workflows/commit-tags.yml | 28 ++++++++++++++++++++++++++ .github/workflows/compliance.yml | 13 +++++------- Jenkinsfile | 5 +++++ scripts/gitlint/zephyr_commit_rules.py | 4 ++-- 4 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/commit-tags.yml create mode 100644 Jenkinsfile diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml new file mode 100644 index 000000000000..828f02971678 --- /dev/null +++ b/.github/workflows/commit-tags.yml @@ -0,0 +1,28 @@ +name: Commit tags + +on: + pull_request: + types: [synchronize, opened, reopened, edited, labeled, unlabeled, + milestoned, demilestoned, assigned, unassigned, ready_for_review, + review_requested] + +jobs: + commit_tags: + runs-on: ubuntu-22.04 + name: Run commit tags checks on patch series (PR) + steps: + - name: Update PATH for west + run: | + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Checkout the code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Run the commit tags + uses: nrfconnect/action-commit-tags@main + with: + target: . + upstream: zephyrproject-rtos/zephyr/main diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 8b7a8a2fb5fe..b25f65ac76b0 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -34,8 +34,8 @@ jobs: git config --global user.name "Your Name" git remote -v # Ensure there's no merge commits in the PR - [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ - (echo "::error ::Merge commits not allowed, rebase instead";false) + #[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ + #(echo "::error ::Merge commits not allowed, rebase instead";false) rm -fr ".git/rebase-apply" rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} @@ -83,12 +83,9 @@ jobs: git log --pretty=oneline | head -n 10 # Increase rename limit to allow for large PRs git config diff.renameLimit 10000 - excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat" - # The signed-off-by check for dependabot should be skipped - if [ "${{ github.actor }}" == "dependabot[bot]" ]; then - excludes="$excludes -e Identity" - fi - ./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}.. + ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic \ + -e Kconfig -e SysbuildKconfig -e KconfigBasicNoModules -e SysbuildKconfigBasicNoModules \ + -e ModulesMaintainers -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000000..3b9cf0022399 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,5 @@ +@Library("CI_LIB") _ + +def pipeline = new ncs.sdk_zephyr.Main() + +pipeline.run(JOB_NAME) diff --git a/scripts/gitlint/zephyr_commit_rules.py b/scripts/gitlint/zephyr_commit_rules.py index a2c9cd3cb7fe..ef317e22684c 100644 --- a/scripts/gitlint/zephyr_commit_rules.py +++ b/scripts/gitlint/zephyr_commit_rules.py @@ -78,7 +78,7 @@ class TitleMaxLengthRevert(LineRule): name = "title-max-length-no-revert" id = "UC5" target = CommitMessageTitle - options_spec = [IntOption('line-length', 75, "Max line length")] + options_spec = [IntOption('line-length', 120, "Max line length")] violation_message = "Commit title exceeds max length ({0}>{1})" def validate(self, line, _commit): @@ -103,7 +103,7 @@ class MaxLineLengthExceptions(LineRule): name = "max-line-length-with-exceptions" id = "UC4" target = CommitMessageBody - options_spec = [IntOption('line-length', 75, "Max line length")] + options_spec = [IntOption('line-length', 120, "Max line length")] violation_message = "Commit message body line exceeds max length ({0}>{1})" def validate(self, line, _commit): From 097e89d310ff7a9823c15346f0cd89d82b4b7f8f Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 12 May 2025 08:47:55 +0100 Subject: [PATCH 3108/3334] [nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs Adds symbols used in NCS to the sysbuild Kconfig allow list Signed-off-by: Jamie McCrae (cherry picked from commit 666ffc1eb2120511c224e3cbceb349572d74adb1) --- scripts/ci/check_compliance.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 19616c5e4fde..d3dba54e0c0e 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1769,6 +1769,32 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop + + # NCS-specific allowlist + # zephyr-keep-sorted-start re(^\s+") + "APP_CPUNET_RUN", # Used by sample + "APP_DFU", # Used by sample + "BT_FAST_PAIR", # Legacy/removed, used in migration documentation + "COMP_DATA_LAYOUT_ARRAY", # Used by test + "COMP_DATA_LAYOUT_MULTIPLE", # Used by test + "COMP_DATA_LAYOUT_SINGLE", # Used by test + "DTM_NO_DFE", # Used by DTM application + "DTM_TRANSPORT_HCI", # Used by DTM application + "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation + "INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation + "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "ML_APP_REMOTE_BOARD", # Used by machine learning application + "MY_APP_IMAGE_ABC", # Used in documentation + "NETCORE_ABC", # Used in documentation + "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests + "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation + "SUIT_ENVELOPE_", # Used by jinja + "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation + "SUIT_MPI_", # Used by jinja + "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation + "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample + # zephyr-keep-sorted-stop } From 767eb35f8d5274737124700bc07a4e5367529e69 Mon Sep 17 00:00:00 2001 From: Robert Stypa Date: Wed, 18 Jun 2025 07:45:47 +0200 Subject: [PATCH 3109/3334] [nrf noup] ci: Update CI-boot-test patterns and remove SUIT labels Add boards/nordic/**/* to the CI-boot-test scope and remove SUIT labels. Signed-off-by: Robert Stypa (cherry picked from commit f2b86e03f7a4c9d7d2a0d066f2fa719300e70dcf) --- .github/test-spec.yml | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 6da6bdbaa87d..5337249f7dab 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,6 +39,7 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": + - "boards/nordic/**/*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" @@ -364,29 +365,3 @@ - "tests/boards/nordic/**/*" - "tests/drivers/**/*" - "tests/kernel/**/*" - -"CI-suit-dfu-test": - - "subsys/mgmt/mcumgr/**/*" - - "include/mgmt/mcumgr/**/*" - - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" - - "subsys/bluetooth/**/*" - - "drivers/bluetooth/**/*" - - "drivers/flash/**/*" - - "drivers/spi/**/*" - - "drivers/mbox/**/*" - - "drivers/serial/**/*" - - "drivers/console/**/*" - - "drivers/gpio/**/*" - - "dts/common/nordic/*" - - "dts/arm/nordic/nrf54h*/**/*" - - "dts/riscv/nordic/nrf54h*/**/*" - - "boards/nordic/nrf54h*/**/*" - - "soc/nordic/nrf54h/**/*" - - "include/zephyr/**/*" - - "subsys/logging/**/*" - - "subsys/tracing/**/*" - - "scripts/west_commands/build.py" - - "scripts/west_commands/flash.py" - - "scripts/west_commands/runners/nrfutil.py" - - "scripts/west_commands/runners/core.py" - - "scripts/west_commands/runners/nrf_common.py" From ed18f11046de7c974512948bd4ef26b427007db6 Mon Sep 17 00:00:00 2001 From: Richa Pandey Date: Thu, 19 Jun 2025 11:07:37 +0200 Subject: [PATCH 3110/3334] [nrf noup] zephyr: doc: fix board page Fixed board page in zephyr. Signed-off-by: Richa Pandey (cherry picked from commit 3b01d333a7e135b5dfda4f8c48a050e68543d627) --- boards/index.rst | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/boards/index.rst b/boards/index.rst index 3cc92770cfeb..2ffe426fc24b 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -12,33 +12,8 @@ template available under :zephyr_file:`doc/templates/board.tmpl`. Shields are hardware add-ons that can be stacked on top of a board to add extra functionality. Refer to the :ref:`shield_porting_guide` for more information on how to port a shield. -.. admonition:: Search Tips - :class: dropdown - - * Use the form below to filter the list of supported boards and shields. If a field is left - empty, it will not be used in the filtering process. - - * Filtering by name and vendor is available for both boards and shields. The rest of the fields - apply only to boards. - - * A board/shield must meet **all** criteria selected across different fields. For example, if you - select both a vendor and an architecture, only boards that match both will be displayed. Within - a single field, selecting multiple options (such as two architectures) will show boards - matching **either** option. - - * The list of supported hardware features for each board is automatically generated using - information from the Devicetree. It may not be reflecting the full list of supported features - since some of them may not be enabled by default. - - * Can't find your exact board? Don't worry! If a similar board with the same or a closely related - MCU exists, you can use it as a :ref:`starting point ` for adding - support for your own board. - .. toctree:: :maxdepth: 2 :glob: - :hidden: */index - -.. zephyr:board-catalog:: From 6c07908836947ed16f090a3c85910f038e368342 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 12 Jun 2025 13:09:23 +0200 Subject: [PATCH 3111/3334] [nrf noup] boards: nrf54h20dk: Enable default images for sysbuild Enable the `empty_app_core` image when building for `cpurad`. Signed-off-by: Grzegorz Swiderski (cherry picked from commit bc0141cf74fe34a34dc5bde3e533bb3b4131669b) --- boards/nordic/nrf54h20dk/Kconfig.sysbuild | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 boards/nordic/nrf54h20dk/Kconfig.sysbuild diff --git a/boards/nordic/nrf54h20dk/Kconfig.sysbuild b/boards/nordic/nrf54h20dk/Kconfig.sysbuild new file mode 100644 index 000000000000..29bd62b49927 --- /dev/null +++ b/boards/nordic/nrf54h20dk/Kconfig.sysbuild @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_NRF54H20DK_NRF54H20_CPURAD + +config NRF_DEFAULT_EMPTY + default y + +endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From d1b096649ac20231a3a539f02ebbfc11cc3819c9 Mon Sep 17 00:00:00 2001 From: Aleksandar Stanoev Date: Thu, 3 Jul 2025 15:37:01 +0100 Subject: [PATCH 3112/3334] [nrf noup] boards: xiao_ble: Add static partition manager configuration The xiao_ble boards ship with a bootloader requiring an app offset of 0x27000. The upstream board defines this via DT partitions, which will not be used if partition manager is enabled. Add a static partition configuration to allow binaries built for this board to work out-of-the-box in NCS, and match the behavior with sysbuild disabled. Signed-off-by: Aleksandar Stanoev (cherry picked from commit 0128a91146232d6337b6c9cbe16b3039dc629139) --- boards/seeed/xiao_ble/pm_static.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 boards/seeed/xiao_ble/pm_static.yml diff --git a/boards/seeed/xiao_ble/pm_static.yml b/boards/seeed/xiao_ble/pm_static.yml new file mode 100644 index 000000000000..02915293177c --- /dev/null +++ b/boards/seeed/xiao_ble/pm_static.yml @@ -0,0 +1,18 @@ +# Mirror of partitions defined in nrf52840_partition_uf2_sdv7.dtsi +# Default flash layout for nrf52840 using UF2 and SoftDevice s140 v7 + +softdevice_reserved: + address: 0x00 + size: 0x27000 + +app: + address: 0x27000 + size: 0xC5000 + +settings_storage: + address: 0xEC000 + size: 0x8000 + +uf2_partition: + address: 0xF4000 + size: 0xC000 From 0a228feaef0ca61ec4103ead4a79cb68de72200f Mon Sep 17 00:00:00 2001 From: Krzysztof Szromek Date: Fri, 18 Jul 2025 08:05:27 +0200 Subject: [PATCH 3113/3334] [nrf noup] ci: update test_spec label for E2E DFU tests Ref: NCSDK-34052 Signed-off-by: Krzysztof Szromek (cherry picked from commit 23af03a7bc8c90df329a7aa907c7f4c96311a3ab) --- .github/test-spec.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5337249f7dab..76def875e0be 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -49,6 +49,33 @@ - "tests/subsys/dfu/**/*" - "tests/subsys/mgmt/mcumgr/**/*" +"CI-dfu-test": + - "boards/nordic/**/*" + - "drivers/bluetooth/**/*" + - "drivers/console/**/*" + - "drivers/flash/**/*" + - "drivers/mbox/**/*" + - "drivers/serial/**/*" + - "drivers/spi/**/*" + - "dts/arm/nordic/nrf54h*" + - "dts/common/nordic/*" + - "dts/riscv/nordic/nrf54h*" + - "include/dfu/**/*" + - "include/mgmt/mcumgr/**/*" + - "include/zephyr/**/*" + - "samples/subsys/mgmt/mcumgr/smp_svr/**/*" + - "scripts/west_commands/build.py" + - "scripts/west_commands/flash.py" + - "scripts/west_commands/runners/core.py" + - "scripts/west_commands/runners/nrf_common.py" + - "scripts/west_commands/runners/nrfutil.py" + - "soc/nordic/nrf54h/**/*" + - "subsys/bluetooth/**/*" + - "subsys/dfu/**/*" + - "subsys/logging/**/*" + - "subsys/mgmt/mcumgr/**/*" + - "subsys/tracing/**/*" + "CI-tfm-test": - "boards/nordic/nrf5340dk/**/*" - "boards/nordic/nrf9160dk/**/*" From be792c618e752fdc11c74557d0ca310372e90611 Mon Sep 17 00:00:00 2001 From: Juha Ylinen Date: Fri, 19 Jan 2024 15:26:33 +0200 Subject: [PATCH 3114/3334] [nrf noup] samples: lwm2m_client: Add support for nRF91x Add support for nRF91x by providing overlay configuration file. Signed-off-by: Juha Ylinen Signed-off-by: Robert Lubos (cherry picked from commit 3f93b67ecb00dc744fa3cc7fe048640ad0470f05) --- samples/net/lwm2m_client/overlay-nrf91x.conf | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 samples/net/lwm2m_client/overlay-nrf91x.conf diff --git a/samples/net/lwm2m_client/overlay-nrf91x.conf b/samples/net/lwm2m_client/overlay-nrf91x.conf new file mode 100644 index 000000000000..7b902178e078 --- /dev/null +++ b/samples/net/lwm2m_client/overlay-nrf91x.conf @@ -0,0 +1,53 @@ +# Configuration file for nRF91x +# This file is merged with prj.conf in the application folder, and options +# set here will take precedence if they are present in both files. + +# General +CONFIG_MAIN_STACK_SIZE=4096 + +CONFIG_NET_SOCKETS=y +CONFIG_NET_NATIVE=y +CONFIG_NET_SOCKETS_OFFLOAD=y + +CONFIG_NET_CONFIG_MY_IPV6_ADDR="" +CONFIG_NET_CONFIG_PEER_IPV6_ADDR="" +CONFIG_NET_CONFIG_MY_IPV4_ADDR="" +CONFIG_NET_CONFIG_MY_IPV4_GW="" + +CONFIG_NET_CONFIG_NEED_IPV6=n +CONFIG_NET_CONFIG_NEED_IPV4=n +CONFIG_NET_CONFIG_AUTO_INIT=n + +# Modem related configurations +CONFIG_NRF_MODEM_LIB_NET_IF=y +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_DOWN=n +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n +CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_START=n +CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y + +CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=n +CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=n + +# Disable Duplicate Address Detection (DAD) +# due to not being properly implemented for offloaded interfaces. +CONFIG_NET_IPV6_NBR_CACHE=n +CONFIG_NET_IPV6_MLD=n + +# Zephyr NET Connection Manager and Connectivity layer. +CONFIG_NET_CONNECTION_MANAGER=y +CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024 + +CONFIG_NET_SAMPLE_LWM2M_ID="nrf91x" +CONFIG_NET_SAMPLE_LWM2M_SERVER="coaps://leshan.eclipseprojects.io:5684" +CONFIG_LWM2M_DNS_SUPPORT=y + +## Enable DTLS support +CONFIG_LWM2M_DTLS_SUPPORT=y +CONFIG_LWM2M_TLS_SESSION_CACHING=y +CONFIG_LWM2M_DTLS_CID=y +CONFIG_TLS_CREDENTIALS=y + +## Crypto +CONFIG_OBERON_BACKEND=y +CONFIG_NORDIC_SECURITY_BACKEND=y +CONFIG_MBEDTLS_SHA256_C=y From 5b5eff6d1daa4a1f21d2c722235989acf071a2e5 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Tue, 22 Apr 2025 14:34:11 +0200 Subject: [PATCH 3115/3334] [nrf noup] modules: hal_nordic: require nrf-regtool Same as commit 6ec9d10 but with the REQUIRED keyword on its own line to attempt to avoid a merge conflict when reverting/reapplying this patch. Signed-off-by: Jonathan Nilsen (cherry picked from commit c4820ccff3ca439ed5b3ead210f9f08d476372cd) --- modules/hal_nordic/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index a49aec6406fa..83354b9d2f64 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -14,6 +14,7 @@ if(CONFIG_NRF_REGTOOL_GENERATE_UICR) endif() if(DEFINED nrf_regtool_components) find_package(nrf-regtool 9.2.0 + REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From 51a1ec3468d4759774fc35e77dfa0ea5ef293cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 11:15:56 +0100 Subject: [PATCH 3116/3334] [nrf noup] boards: nordic: nrf7002dk: Bring back NS variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Non-secure variants for nRF7002 DK were removed from upstream in commit 10d49736cffa14d3798e615e70d58b3be8ee2cfc. Revert these changes downstream, so that the NS variants are still available. Signed-off-by: Andrzej Głąbek Signed-off-by: Johann Fischer (cherry picked from commit 3f9d391279f88fdbd61da6b63e83c1d9d9259479) --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 +++ boards/nordic/nrf7002dk/Kconfig | 4 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 72 +++++++++++++++++++ boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 18 ++++- boards/nordic/nrf7002dk/board.yml | 4 ++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ++++++++++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 +++++ ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 24 +++++++ .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 +++++++++++ .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 +++++ .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 23 ++++++ 12 files changed, 273 insertions(+), 4 deletions(-) create mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt new file mode 100644 index 000000000000..db20255712bc --- /dev/null +++ b/boards/nordic/nrf7002dk/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND + CONFIG_BOARD_ENABLE_CPUNET) + zephyr_library() + zephyr_library_sources(nrf5340_cpunet_reset.c) +endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index ca0328bd530b..c56650c74c68 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,7 +10,9 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS config BT_HCI_IPC default y if BT_HCI diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig index a6cf1d7fbca1..8eee0dcdf3da 100644 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -16,3 +16,75 @@ config SPI_NOR_FLASH_LAYOUT_PAGE_SIZE endif # SPI_NOR endif # BOARD_NRF7002DK + +if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +# By default, if we build for a Non-Secure version of the board, +# force building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +# Code Partition: +# +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# SRAM Partition: +# +# If the secure firmware is to be combined with a non-secure image +# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always +# be restricted to the secure image SRAM partition (sram-secure-partition). +# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram +# may be used by the image. +# +# For the non-secure version of the board, the firmware image SRAM is +# always restricted to the allocated non-secure SRAM partition. +# +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ + TRUSTED_EXECUTION_SECURE + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config SRAM_SIZE + default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) + +endif + +if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif + +endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 61b9e818f367..91f52ee6f08c 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,4 +4,6 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index f85bbc86f485..11a27910eebc 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,10 +1,24 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 4f41341e4423..39db5dcfa3a7 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,5 +5,9 @@ board: socs: - name: nrf5340 variants: + - name: ns + cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp + variants: + - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts new file mode 100644 index 000000000000..5ff28accf3fc --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7001@1 { + compatible = "nordic,nrf7001-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml new file mode 100644 index 000000000000..165759691260 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns +name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig new file mode 100644 index 000000000000..2c435653140a --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig @@ -0,0 +1,24 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts new file mode 100644 index 000000000000..0deb8ccc1bf5 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns_app; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7002@1 { + compatible = "nordic,nrf7002-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + #include "nrf70_common_5g.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml new file mode 100644 index 000000000000..ea43785b4559 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/ns +name: NRF7002-DK-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig new file mode 100644 index 000000000000..1886b926bfd5 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y From ffd1befb7c8aea9df0d46821b722fdc2b8e3568f Mon Sep 17 00:00:00 2001 From: Maximilian Deubel Date: Wed, 15 Nov 2023 12:55:40 +0100 Subject: [PATCH 3117/3334] [nrf noup] boards: arm: nrf9131ek: enable tfm This patch backports the nrf9131ek to a time before tfm was refactored. To be reverted when TF-M is updated. Signed-off-by: Maximilian Deubel (cherry picked from commit 91df299acf7cce694bd396ae6cf028879c139e27) --- boards/nordic/nrf9131ek/Kconfig.defconfig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/boards/nordic/nrf9131ek/Kconfig.defconfig b/boards/nordic/nrf9131ek/Kconfig.defconfig index e1d8de241c0a..1a30d006b4c6 100644 --- a/boards/nordic/nrf9131ek/Kconfig.defconfig +++ b/boards/nordic/nrf9131ek/Kconfig.defconfig @@ -8,3 +8,22 @@ config HW_STACK_PROTECTION config BOARD_NRF9131EK select USE_DT_CODE_PARTITION if BOARD_NRF9131EK_NRF9131_NS + +if BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF9131EK_NRF9131_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +endif # BOARD_NRF9131EK_NRF9131 || BOARD_NRF9131EK_NRF9131_NS From 638f0ba0e5bb5149532dd784b9f94b889c7e18bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stine=20=C3=85kredalen?= Date: Mon, 4 Aug 2025 01:26:12 +0200 Subject: [PATCH 3118/3334] [nrf noup] samples: bluetooth: mesh: update stack sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increased stack sizes for mesh provisoner sample. Values are based of thread analysis, plus added margin. Signed-off-by: Stine Åkredalen (cherry picked from commit abe30cf858dbc18e3fc91951efe7465757dadab7) --- samples/bluetooth/mesh_provisioner/prj.conf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/bluetooth/mesh_provisioner/prj.conf b/samples/bluetooth/mesh_provisioner/prj.conf index 4a2606efcb36..ba3520610f60 100644 --- a/samples/bluetooth/mesh_provisioner/prj.conf +++ b/samples/bluetooth/mesh_provisioner/prj.conf @@ -1,6 +1,10 @@ #CONFIG_INIT_STACKS=y -CONFIG_MAIN_STACK_SIZE=2500 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2500 +# Stack sizes from thread analysis + 50% margin, rounded to nearest 100 +CONFIG_MAIN_STACK_SIZE=4400 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4800 +CONFIG_BT_MESH_SETTINGS_WORKQ_STACK_SIZE=1700 +CONFIG_BT_MESH_ADV_STACK_SIZE=4000 +CONFIG_BT_RX_STACK_SIZE=3300 # The Bluetooth API should not be used from a preemptive thread: CONFIG_MAIN_THREAD_PRIORITY=-2 From 20236eeb7fe46f8e014f0b4b9aa12f86ec30da4b Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Fri, 31 Jan 2025 14:47:05 +0200 Subject: [PATCH 3119/3334] [nrf noup] tests: secure_storage: fix test w/ ZMS backend on 54L15 noup because it's about partition manager. Fix the build of secure_storage.psa.its.secure_storage.store.zms on nrf54l15dk/nrf54l15/cpuapp by disabling partition manager, which is incompatible with the ZMS implementation of the ITS store module. Disabling it only for that test as it's not needed for the others and even makes the NS board targets fail if disabling PM. Signed-off-by: Tomi Fontanilles (cherry picked from commit 5fe83a2e79854570859ffaa2cbe343a285c22859) --- tests/subsys/secure_storage/psa/its/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/subsys/secure_storage/psa/its/testcase.yaml b/tests/subsys/secure_storage/psa/its/testcase.yaml index 217f113b31b5..ee7cafed08eb 100644 --- a/tests/subsys/secure_storage/psa/its/testcase.yaml +++ b/tests/subsys/secure_storage/psa/its/testcase.yaml @@ -33,6 +33,7 @@ tests: - EXTRA_DTC_OVERLAY_FILE=zms.overlay - EXTRA_CONF_FILE=\ overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf + - SB_CONFIG_PARTITION_MANAGER=n secure_storage.psa.its.secure_storage.store.zms.64-bit_uids: platform_allow: *zms_platform_allow From 9003f4f2f4325b8ecf664b134e01c584302d8989 Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Tue, 3 Jun 2025 16:07:48 +0200 Subject: [PATCH 3120/3334] [nrf noup] zms: add lookup cache hash function for legacy ZMS ZMS legacy enabled by CONFIG_SETTINGS_ZMS_LEGACY uses a different lookup cache function that is optimized for Settings subsystem. Signed-off-by: Riadh Ghaddab (cherry picked from commit 56d74c7289c6ac082d95739096a87f7b8f0dbc3c) --- subsys/kvss/zms/zms.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/subsys/kvss/zms/zms.c b/subsys/kvss/zms/zms.c index 13f87289665e..04dd014777cb 100644 --- a/subsys/kvss/zms/zms.c +++ b/subsys/kvss/zms/zms.c @@ -13,8 +13,12 @@ #include #include "zms_priv.h" #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS +#ifdef CONFIG_SETTINGS_ZMS_LEGACY +#include +#else #include #endif +#endif #include LOG_MODULE_REGISTER(fs_zms, CONFIG_ZMS_LOG_LEVEL); @@ -33,6 +37,40 @@ static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_at static inline size_t zms_lookup_cache_pos(zms_id_t id) { #ifdef CONFIG_ZMS_LOOKUP_CACHE_FOR_SETTINGS +#ifdef CONFIG_SETTINGS_ZMS_LEGACY + /* + * 1. The ZMS settings backend uses up to (ZMS_NAME_ID_OFFSET - 1) ZMS IDs to + store keys and equal number of ZMS IDs to store values. + * 2. For each key-value pair, the value is stored at ZMS ID greater by exactly + * ZMS_NAME_ID_OFFSET than ZMS ID that holds the key. + * 3. The backend tries to minimize the range of ZMS IDs used to store keys. + * That is, ZMS IDs are allocated sequentially, and freed ZMS IDs are reused + * before allocating new ones. + * + * Therefore, to assure the least number of collisions in the lookup cache, + * the least significant bit of the hash indicates whether the given ZMS ID + * represents a key or a value, and remaining bits of the hash are set to + * the ordinal number of the key-value pair. Consequently, the hash function + * provides the following mapping: + * + * 1st settings key => hash 0 + * 1st settings value => hash 1 + * 2nd settings key => hash 2 + * 2nd settings value => hash 3 + * ... + */ + BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAMECNT_ID), "ZMS_NAMECNT_ID is not power of 2"); + BUILD_ASSERT(IS_POWER_OF_TWO(ZMS_NAME_ID_OFFSET), "ZMS_NAME_ID_OFFSET is not power of 2"); + + uint32_t key_value_bit; + uint32_t key_value_ord; + uint32_t hash; + + key_value_bit = (id >> LOG2(ZMS_NAME_ID_OFFSET)) & 1; + key_value_ord = id & (ZMS_NAME_ID_OFFSET - 1); + + hash = ((key_value_ord << 1) | key_value_bit); +#else /* * 1. Settings subsystem is storing the name ID and the linked list node ID * with only one bit difference at BIT(0). @@ -58,6 +96,7 @@ static inline size_t zms_lookup_cache_pos(zms_id_t id) key_value_ll = id & BIT(0); hash = (key_value_hash << 2) | (key_value_bit << 1) | key_value_ll; +#endif /* CONFIG_SETTINGS_ZMS_LEGACY */ #elif defined(CONFIG_ZMS_ID_64BIT) /* 64-bit integer hash function found by https://github.com/skeeto/hash-prospector. */ From 71d16fb8c1181b8e17ecddbd6f7cd07733cba34a Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Thu, 28 Aug 2025 08:26:23 +0200 Subject: [PATCH 3121/3334] [nrf noup] soc: nrf54h: work around missing power domain handling This patch should be dropped as part of the next upmerge. The upcoming release of IronSide SE no longer disables RETAIN in all GPIO instances on boot, so the application must be able to handle the hardware default state of RETAIN being enabled. The GPIO retention is properly handled by changes that are currently only upstream and will be pulled in by the next upmerge. This patch exists a workaround to be able to integrate IronSide SE before the proper solution is pulled in. Signed-off-by: Jonathan Nilsen (cherry picked from commit fa2b950dcb37884bf5109f15ebf9e4839895d771) --- soc/nordic/nrf54h/Kconfig | 5 +++++ soc/nordic/nrf54h/soc.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 500183877938..44f18efe8105 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -100,6 +100,11 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT endif # SOC_NRF54H20_CPURAD_ENABLE +config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND + bool "Disable all GPIO pin retention on boot" + default y + depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index e5cf9c34fc69..740d58d5a339 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -15,6 +15,7 @@ #include #endif +#include #include #include #include @@ -134,6 +135,17 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } + + /* This is a workaround for not yet having upstream patches for properly handling + * pin retention. It should be removed as part of the next upmerge. + */ + if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) { + NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST; + + for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) { + nrf_gpio_port_retain_set(gpio_regs[i], 0); + } + } } #if defined(CONFIG_SOC_LATE_INIT_HOOK) From a26530f9586c790a90e21f58cde05b9b4ebaa681 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 2 Sep 2025 10:48:14 +0100 Subject: [PATCH 3122/3334] [nrf noup] doc: extensions: kconfig: Add SoC sysbuild Kconfigs Allows listing sysbuild Kconfigs for SoCs Signed-off-by: Jamie McCrae (cherry picked from commit 488c9ff3113181f7ba1826859244f18aae016241) --- doc/_extensions/zephyr/kconfig/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index e977a3b734a8..98422c8ba2fc 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -114,6 +114,9 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d for folder in soc_folders: f.write('source "' + (Path(folder) / 'Kconfig.soc').as_posix() + '"\n') + if "nordic" in folder: + f.write('osource "' + (Path(folder) / 'Kconfig.sysbuild').as_posix() + '"\n') + with open(Path(td) / "soc" / "Kconfig", "w") as f: for folder in soc_folders: f.write('osource "' + (Path(folder) / 'Kconfig').as_posix() + '"\n') From f6dca8eb8f7f8273f2a2bf4f28cc3fc07f56f6f2 Mon Sep 17 00:00:00 2001 From: Kari Hamalainen Date: Fri, 12 Sep 2025 10:46:10 +0300 Subject: [PATCH 3123/3334] [nrf noup] ci: add reopen for manifest-pr action Previously reopening of PR did not reopen manifest PR. This commit will enable reopening of manifest PR in such case. Signed-off-by: Kari Hamalainen (cherry picked from commit 473385a2525eded8462da11820386c6411936c13) --- .github/workflows/manifest-PR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index a871aa381ded..473301146527 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -1,7 +1,7 @@ name: handle manifest PR on: pull_request_target: - types: [opened, synchronize, closed] + types: [opened, synchronize, closed, reopened] branches: - main From 57f1d455e62b85bd297e9d43be7e9e648cbb4980 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 11 Sep 2025 16:07:03 +0530 Subject: [PATCH 3124/3334] [nrf noup] boards: nordic: nrf7002: Include required headers The definitions of slot partitions and sram partition has been moved. Include corresponding headers. Signed-off-by: Ravi Dondaputi (cherry picked from commit c82c4284bab25b8948ace32edb92e54d04575cd6) --- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 0deb8ccc1bf5..9c06a17ad7bf 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -7,6 +7,8 @@ /dts-v1/; #include #include "nrf5340_cpuapp_common.dtsi" +#include "nordic/nrf5340_sram_partition.dtsi" +#include "nordic/nrf5340_cpuapp_ns_partition.dtsi" / { model = "Nordic NRF5340 DK NRF5340 Application"; From bc38fb0fbf634e139a6e3a58584b21a3a8be3bcd Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 25 Sep 2025 09:44:35 +0100 Subject: [PATCH 3125/3334] [nrf noup] soc: nordic: nrf54l: Add ROM start offset PM override Adds an override to force this Kconfig to 0 when partition manager is enabled Signed-off-by: Jamie McCrae (cherry picked from commit cf7c4d33918ef1a43ba573ba6ba5bbc20c8c2a51) --- soc/nordic/nrf54l/Kconfig.defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index 2cd38dca0e95..bc7577b7c55e 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -33,6 +33,7 @@ choice NULL_POINTER_EXCEPTION_DETECTION endchoice config ROM_START_OFFSET + default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # ARM From b9dc37a7556d842b0d7f37178835ce09c1b44d37 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 8 Jul 2025 13:59:15 +0100 Subject: [PATCH 3126/3334] [nrf noup] scripts: ci: check_compliance: Add undefined Kconfigs Adds undefined Kconfigs used in NCS to the allow list for Kconfig compliance checks Signed-off-by: Jamie McCrae (cherry picked from commit fe5d6adc277a9078d56591128898a1c16eb2f751) --- scripts/ci/check_compliance.py | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index d3dba54e0c0e..dc7a25f38482 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1695,6 +1695,81 @@ def check_no_undef_outside_kconfig(self, kconf): "ZTEST_FAIL_TEST_", # regex in tests/ztest/fail/CMakeLists.txt "ZVFS_OPEN_ADD_SIZE_", # Used as an option matching prefix # zephyr-keep-sorted-stop + + # NCS-specific allow list + # zephyr-keep-sorted-start re(^\s+") + "APPLICATION", # Example documentation + "BAR", # Example documentation + "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation + "BT_ADV_PROV_", # Documentation + "BT_CTLR_TX_PWR_MINUS", # CHIP documentation + "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation + "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo + "CHANNEL", # NRF desktop + "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop + "CHANNEL_TRANSPORT_DISABLED", # NRF desktop + "CHANNEL_TRANSPORT_IDLE", # NRF desktop + "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop + "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop + "CHIP_DFU_OVER_BT_SMP", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module + "CHIP_MEMORY_PROFILING", # CHIP module + "CHIP_NUS", # CHIP module + "CHIP_NUS_FIXED_PASSKEY", # CHIP module + "CHIP_NUS_MAX_COMMANDS", # CHIP module + "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module + "CHIP_QSPI_NOR", # CHIP module + "CHIP_SPI_NOR", # CHIP module + "CHIP_WIFI", # CHIP module + "DESKTOP_DVFS_STATE_", # NRF desktop + "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop + "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module + "MEMFAULT_", # Documentation + "MEMFAULT_NCS", # Documentation + "MEMFAULT_NCS_", # Documentation + "MY_CUSTOM_CONFIG", # Example documentation + "MY_EXT_API_ENABLED", # Example documentation + "MY_EXT_API_REQUIRED", # Example documentation + "NCS_IS_VARIANT_IMAGE", # Build system defined symbol + "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot + "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot + "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol + "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation + "PM_PARTITION_SIZE", # Used in search link + "PM_PARTITION_SIZE_", # Used in documentation + "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template + "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template + "SOC_NRF54H20_CPUSEC", # Internal + "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal + "STATUS_", # NRF desktop + "STATUS_COUNT", # NRF desktop + "STATUS_DISCONNECTED", # NRF desktop + "STATUS_FETCH", # NRF desktop + "STATUS_GET_BOARD_NAME", # NRF desktop + "STATUS_GET_HWID", # NRF desktop + "STATUS_GET_MAX_MOD_ID", # NRF desktop + "STATUS_GET_PEER", # NRF desktop + "STATUS_GET_PEERS_CACHE", # NRF desktop + "STATUS_INDEX_PEERS", # NRF desktop + "STATUS_LIST", # NRF desktop + "STATUS_PENDING", # NRF desktop + "STATUS_POS", # NRF desktop + "STATUS_REJECT", # NRF desktop + "STATUS_SET", # NRF desktop + "STATUS_SUCCESS", # NRF desktop + "STATUS_TIMEOUT", # NRF desktop + "STATUS_WRITE_FAIL", # NRF desktop + # zephyr-keep-sorted-stop } From 5eb67b1057dfcc5870b8764109c802971f743beb Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 7 Jul 2025 09:02:08 +0100 Subject: [PATCH 3127/3334] [nrf noup] scripts: ci: check_compliance: Exclude some docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the NCS release notes folder to the exclusion list for undefined Kconfigs so that old Kconfigs can be used e.g. for old release notes, and lwm2m carrier library changelog. Also adds a nrf7x page which details setup instructions for software on Linux Excludes bare metal release docs from the invalid Kconfig check as these will have old Kconfigs that have been removed Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Moń (cherry picked from commit 74ca5f8e85863415b4a3f8c1cbf8c62e6e2e3ae1) --- scripts/ci/check_compliance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index dc7a25f38482..237d217f60fa 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1482,6 +1482,10 @@ def check_no_undef_outside_kconfig(self, kconf): ":!/doc/releases", ":!/doc/develop/manifest/external", ":!/doc/security/vulnerabilities.rst", + ":!/doc/nrf/releases_and_maturity", + ":!/doc/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.rst", + ":!/doc/nrf/app_dev/device_guides/nrf70/wifi_advanced_security_modes.rst", + ":!/doc/nrf-bm/release_notes", cwd=GIT_TOP, ) From c558dfa32b40c2cbffe70512fb00b35a18f6ecb2 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 5 Sep 2025 18:11:52 +0200 Subject: [PATCH 3128/3334] [nrf noup] soc/nordic/nrf54h/pm_s2ram: S2RAM resume hardening MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for hardening decision on resume from S2RAM by MCUboot bootloader. Application sets additional variable to MCUBOOT_S2RAM_RESUME_MAGIC which allows the bootloader to doublecheck. Extended mcuboot_resume_s suture by slot_info field intended to be used by MCUboot for recognize proper boot slot in direct-xp mode. Signed-off-by: Andrzej Puzdrowski Signed-off-by: Tomasz Moń (cherry picked from commit 8b6ec77050bf145329f52f51417fe53940dbcf95) --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 14 ++++++++++++++ soc/nordic/common/haltium_pm_s2ram.c | 14 ++++++++++++++ soc/nordic/common/haltium_pm_s2ram.h | 7 +++++++ 3 files changed, 35 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 567e84336546..18dad5cbade6 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -321,6 +321,20 @@ zephyr_udc0: &usbhs { zephyr,memory-region = "PMLocalRamfunc"; }; + /* temporary stack for S2RAM resume logic */ + pm_s2ram_stack: cpuapp_s2ram_stack@22007fc8 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x22007fc8 16>; + zephyr,memory-region = "pm_s2ram_stack"; + }; + + /* run-time common mcuboot S2RAM support section */ + mcuboot_s2ram: cpuapp_s2ram@22007fd8 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x22007fd8 8>; + zephyr,memory-region = "mcuboot_s2ram_context"; + }; + /* run-time common S2RAM cpu context RAM */ pm_s2ram: cpuapp_s2ram@7fe0 { compatible = "zephyr,memory-region", "mmio-sram"; diff --git a/soc/nordic/common/haltium_pm_s2ram.c b/soc/nordic/common/haltium_pm_s2ram.c index 976a4677cead..1910e0f8fe6d 100644 --- a/soc/nordic/common/haltium_pm_s2ram.c +++ b/soc/nordic/common/haltium_pm_s2ram.c @@ -77,10 +77,24 @@ static void fpu_power_up(void) } #endif /* defined(CONFIG_FPU) */ +#if DT_NODE_EXISTS(DT_NODELABEL(mcuboot_s2ram)) &&\ + DT_NODE_HAS_COMPAT(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region) +/* Linker section name is given by `zephyr,memory-region` property of + * `zephyr,memory-region` compatible DT node with nodelabel `mcuboot_s2ram`. + */ +__attribute__((section(DT_PROP(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region)))) +volatile struct mcuboot_resume_s _mcuboot_resume; + +#define SET_MCUBOOT_RESUME_MAGIC() _mcuboot_resume.magic = MCUBOOT_S2RAM_RESUME_MAGIC +#else +#define SET_MCUBOOT_RESUME_MAGIC() +#endif + int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) { int ret; + SET_MCUBOOT_RESUME_MAGIC(); z_arm_save_scb_context(&backup_data.scb_context); #if defined(CONFIG_FPU) #if !defined(CONFIG_FPU_SHARING) diff --git a/soc/nordic/common/haltium_pm_s2ram.h b/soc/nordic/common/haltium_pm_s2ram.h index 565afad6ca10..01c098ea4310 100644 --- a/soc/nordic/common/haltium_pm_s2ram.h +++ b/soc/nordic/common/haltium_pm_s2ram.h @@ -10,6 +10,13 @@ #ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ #define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ +#define MCUBOOT_S2RAM_RESUME_MAGIC 0x75832419 + +struct mcuboot_resume_s { + uint32_t magic; /* magic value to identify valid structure */ + uint32_t slot_info; +}; + /** * @brief Save CPU state on suspend * From 7b5bfa906a4d34cd53e50841fad0eec6ab01d682 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Fri, 14 Jun 2024 09:13:48 +0200 Subject: [PATCH 3129/3334] [nrf noup] bluetooth: att: Allow ATT sent callback after data TX is done By default, the BLE stack calls sent callback for ATT data when the data is passed to BLE controller for transmission. Enabling this Kconfig option delays calling the sent callback until data transmission is finished by BLE controller (the callback is delayed until receiving the Number of Completed Packets HCI Event). If the 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. Jira: NCSDK-27422 Jira: NCSDK-28624 Jira: NCSDK-35650 Signed-off-by: Marek Pieta (cherry picked from commit 44a465970de240fae2260ea11dec67456ab6de16) --- subsys/bluetooth/host/Kconfig.gatt | 14 ++++++++++++++ subsys/bluetooth/host/att.c | 17 ++++++++++++++++- subsys/bluetooth/host/conn.c | 27 ++++++++++++++++++++++----- subsys/bluetooth/host/l2cap.c | 10 ++++++++-- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index 38bbeaa989a3..dc1ad4ad0376 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -38,6 +38,20 @@ 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. + 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 58ec4472e7f3..797bb5096a34 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -394,6 +394,13 @@ static void att_disconnect(struct bt_att_chan *chan) } } +static void chan_sent_cb(struct bt_conn *conn, void *user_data, int err) +{ + struct net_buf *nb = user_data; + + net_buf_unref(nb); +} + /* In case of success the ownership of the buffer is transferred to the stack * which takes care of releasing it when it completes transmitting to the * controller. @@ -487,7 +494,15 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf) data->att_chan = chan; - err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); + if (IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX)) { + err = bt_l2cap_send_pdu(&chan->chan, buf, chan_sent_cb, net_buf_ref(buf)); + if (err) { + net_buf_unref(buf); + } + } else { + err = bt_l2cap_send_pdu(&chan->chan, buf, NULL, NULL); + } + if (err) { if (err == -ENOBUFS) { LOG_ERR("Ran out of TX buffers or contexts."); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 569467915c4d..ea70207e2b86 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -698,12 +698,29 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - /* Check that buf->ref is 1 or 2. It would be 1 if this - * was the only reference (e.g. buf was removed - * from the conn tx_queue). It would be 2 if the - * tx_data_pull kept it on the tx_queue for segmentation. + /* If ATT sent callback is delayed until data transmission + * is done by BLE controller (CONFIG_BT_ATT_SENT_CB_AFTER_TX), + * the `chan_send` function from `att.c` introduces 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 (the reference is removed when the TX callback passed + * to `bt_l2cap_send_pdu` is called). + * + * send_buf function can be called multiple times, if buffer + * has to be fragmented over HCI. In that case, the callback + * is provided as an argument only for the last transmitted + * fragment. The `buf->ref == 1` (or 2) check is skipped + * because it's impossible to properly validate number of + * references for the sent fragments if buffers may have the + * additional reference. + * + * Otherwise, check that buf->ref is 1 or 2. It would be 1 + * if this was the only reference (e.g. buf was removed from + * the conn tx_queue). It would be 2 if the tx_data_pull + * kept it on the tx_queue for segmentation. */ - __ASSERT_NO_MSG((buf->ref == 1) || (buf->ref == 2)); + __ASSERT_NO_MSG(IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX) || (buf->ref == 1) || + (buf->ref == 2)); /* The reference is always transferred to the frag, so when * the frag is destroyed, the parent reference is decremented. diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 148a1b9a9b9f..2b6a201d1ad4 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -777,13 +777,19 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, return -ENOTCONN; } - if (pdu->ref != 1) { + /* If ATT sent callback is delayed until data transmission is done by BLE controller + * (CONFIG_BT_ATT_SENT_CB_AFTER_TX), the `chan_send` function from `att.c` introduces 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 (the reference is removed when + * the TX callback passed to `bt_l2cap_send_pdu` is called). + */ + if (pdu->ref > 1 + (cb ? 1 : 0)) { /* The host may alter the buf contents when fragmenting. Higher * layers cannot expect the buf contents to stay intact. Extra * refs suggests a silent data corruption would occur if not for * this error. */ - LOG_ERR("Expecting 1 ref, got %d", pdu->ref); + LOG_ERR("Expecting up to %d refs, got %d", cb ? 2 : 1, pdu->ref); return -EINVAL; } From da03676854ee243719f34dec869d1bef46cc899f Mon Sep 17 00:00:00 2001 From: Kari Hamalainen Date: Mon, 13 Oct 2025 14:30:13 +0300 Subject: [PATCH 3130/3334] [nrf noup] ci: add default permissions Scanners report these as missing so lets add them. Signed-off-by: Kari Hamalainen (cherry picked from commit 38f7a5f684e8fb0bf7aca909939483ca1339149e) --- .github/workflows/commit-tags.yml | 5 ++++- .github/workflows/manifest-PR.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit-tags.yml b/.github/workflows/commit-tags.yml index 828f02971678..61fc3a6c5bd3 100644 --- a/.github/workflows/commit-tags.yml +++ b/.github/workflows/commit-tags.yml @@ -6,6 +6,9 @@ on: milestoned, demilestoned, assigned, unassigned, ready_for_review, review_requested] +permissions: + contents: read + jobs: commit_tags: runs-on: ubuntu-22.04 @@ -16,7 +19,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 473301146527..0f3bd738a36c 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -5,6 +5,8 @@ on: branches: - main +permissions: + contents: read jobs: call-manifest-pr-action: From e56e5d86a0e382f46e509440c2a7d33f404e9c2e Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Thu, 25 Sep 2025 16:15:45 +0200 Subject: [PATCH 3131/3334] [nrf noup] boards: nordic: Skip offsets in merged slot In the merged slot approach, the memory reservation for the MCUboot header is done in CMake, as it is not obvious, which image includes the (merged) MCUboot header. This change will remove the unnecessary gap between images. Ref: NCSDK-35612 Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 9f8e4ede3aaa409b959148d05e8c7fe6c139dc24) --- boards/nordic/nrf54h20dk/Kconfig.defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index 5c39b68e4929..3aaca9795ffa 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -13,6 +13,7 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET + default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT if !USE_DT_CODE_PARTITION @@ -42,6 +43,7 @@ config MAX_THREAD_BYTES default 3 if USERSPACE config ROM_START_OFFSET + default 0 if NCS_MCUBOOT_BOOTLOADER_SIGN_MERGED_BINARY default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54H20DK_NRF54H20_CPURAD From 7086c0ca10dabd9cd818ff188233d443972a06e5 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 6 Oct 2025 08:43:55 +0100 Subject: [PATCH 3132/3334] [nrf noup] scripts: ci: check_compliance: Check Kconfigs for enable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows checking sdk-nrf for Kconfig prompts that start with "Enable" as these should not be allowed Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Moń (cherry picked from commit df055b3eb59af0bf18b7ceb4427ddceb60648421) --- scripts/ci/check_compliance.py | 57 ++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 237d217f60fa..439eebe6dd5d 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -705,6 +705,22 @@ class KconfigCheck(ComplianceTest): # Kconfig symbol prefix/namespace. CONFIG_ = "CONFIG_" + # If modules should be excluded from checks. + EXCLUDE_MODULES = False + + # This block list contains a list of upstream Zephyr modules that should not be checked + # DO NOT MERGE CHANGES TO THIS WITHOUT BUILD SYSTEM AND CODE OWNER APPROVAL! + external_module_name_block_list = ['canopennode', 'chre', 'cmsis', 'cmsis-dsp', 'cmsis-nn', + 'cmsis_6', 'edtt', 'fatfs', 'hal_st', 'hal_tdk', + 'hal_wurthelektronik', 'liblc3', 'libmetal', 'littlefs', + 'loramac-node', 'lvgl', 'lz4', 'mipi-sys-t', 'nanopb', + 'net-tools', 'nrf_hw_models', 'open-amp', 'percepio', + 'picolibc', 'segger', 'tf-m-tests', 'tinycrypt', + 'uoscore-uedhoc', 'zscilib'] + + # Holds a list or directories/files which should not be checked + blocked_module_dirs = [] + def run(self): kconf = self.parse_kconfig() @@ -746,13 +762,22 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir = ZEPHYR_BASE / 'modules' modules = [name for name in os.listdir(modules_dir) if modules_dir / name / 'Kconfig'] - nrf_modules_dir = ZEPHYR_BASE / Path('../nrf/modules') + nrf_modules_dir = (Path(ZEPHYR_BASE) / '..' / 'nrf' / 'modules').resolve() nrf_modules = [] + + for module in modules: + if module in self.external_module_name_block_list: + self.blocked_module_dirs.append(modules_dir / module / 'Kconfig') + if os.path.exists(nrf_modules_dir): nrf_modules = [name for name in os.listdir(nrf_modules_dir) if os.path.exists(os.path.join(nrf_modules_dir, name, 'Kconfig'))] + for module in nrf_modules: + if module in self.external_module_name_block_list: + self.blocked_module_dirs.append(nrf_modules_dir / module / 'Kconfig') + with open(modules_file) as fp_module_file: content = fp_module_file.read() @@ -777,6 +802,7 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se modules_dir / module / 'Kconfig', ) ) + # Add NRF as static entry as workaround for ext Kconfig root support fp_module_file.write( "ZEPHYR_NRF_KCONFIG = {}\n".format( @@ -1341,9 +1367,32 @@ def check_no_enable_in_boolean_prompt(self, kconf): # Checks that boolean's prompt does not start with "Enable...". for node in kconf.node_iter(): - # skip Kconfig nodes not in-tree (will present an absolute path) + skip_node = False + + # skip Kconfig nodes not in-tree when set to (will present an absolute path) if os.path.isabs(node.filename): - continue + if self.EXCLUDE_MODULES is True: + continue + + normalised_file_name = Path(node.filename).resolve() + + for module_name in self.external_module_name_block_list: + # Workaround for being unable to use full_match() due to python version + if '/modules/' in str(normalised_file_name) and \ + ('/' + module_name + '/') in str(normalised_file_name): + skip_node = True + break + + if skip_node: + continue + + for blocked_dir in self.blocked_module_dirs: + if normalised_file_name.match(blocked_dir, case_sensitive=True): + skip_node = True + break + + if skip_node: + continue # 'kconfiglib' is global # pylint: disable=undefined-variable @@ -1801,6 +1850,7 @@ class KconfigBasicNoModulesCheck(KconfigBasicCheck): name = "KconfigBasicNoModules" path_hint = "" EMPTY_FILE_CONTENTS = "# Empty\n" + EXCLUDE_MODULES = True def get_modules(self, module_dirs_file, modules_file, sysbuild_modules_file, settings_file): with open(module_dirs_file, 'w') as fp_module_file: @@ -1897,6 +1947,7 @@ class SysbuildKconfigBasicNoModulesCheck(SysbuildKconfigCheck, KconfigBasicNoMod name = "SysbuildKconfigBasicNoModules" path_hint = "" + EXCLUDE_MODULES = True class Nits(ComplianceTest): From 24b0291eb215e42dafbf1538fa78900becc47f3e Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Tue, 16 Jul 2024 14:43:30 +0200 Subject: [PATCH 3133/3334] [nrf noup] dts: Add Bluetooth Controller to nRF54H20 The nRF54H20 supports a Bluetooth controller. The HCI driver interface has changed upstream in https://github.com/zephyrproject-rtos/zephyr/pull/72323 so now we need to add it to device tree. Signed-off-by: Rubin Gerritsen (cherry picked from commit 9a1090dbe899a8ca3e7e64f9044a00ac9414aac5) --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 8 ++++++++ dts/vendor/nordic/nrf54h20.dtsi | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index b910e42789b0..eac16a3c14f3 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -31,6 +31,10 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &s2ram; / { + chosen { + zephyr,bt-hci = &bt_hci_controller; + }; + soc { compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; @@ -131,3 +135,7 @@ wdt011: &cpurad_wdt011 {}; &gdpwr_slow_main { status = "okay"; }; + +&bt_hci_controller { + status = "okay"; +}; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index aecd7d896678..8a59b519cb68 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -518,6 +518,14 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; + + /* Note: In the nRF Connect SDK the SoftDevice Controller + * is added and set as the default Bluetooth Controller. + */ + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; }; ppib030: ppib@31000 { From 0db092d6aa64f933e8659003e82d53a6ac60effb Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Thu, 5 Sep 2024 08:04:15 +0200 Subject: [PATCH 3134/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding as default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. It should therefore have its own device tree binding. This commit converts the SoftDevice Controller driver to use this new DTS binding instead of reusing the existing one. This commit updates or adds additional overlays for existing samples, applications and tests that were using the open source link layer. Signed-off-by: Rubin Gerritsen Signed-off-by: Kristoffer Rist Skøien Signed-off-by: Rafał Kuźnia Signed-off-by: Tomasz Moń (cherry picked from commit e89fd5f868c584dbda3d140ca7ff062c8a942968) --- dts/arm/nordic/nrf52805.dtsi | 11 +- dts/arm/nordic/nrf52810.dtsi | 11 +- dts/arm/nordic/nrf52811.dtsi | 11 +- dts/arm/nordic/nrf52820.dtsi | 11 +- dts/arm/nordic/nrf52832.dtsi | 11 +- dts/arm/nordic/nrf52833.dtsi | 11 +- dts/arm/nordic/nrf52840.dtsi | 11 +- dts/arm/nordic/nrf5340_cpunet.dtsi | 11 +- dts/arm/nordic/nrf54h20_cpurad.dtsi | 4 +- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 4 +- dts/vendor/nordic/nrf54h20.dtsi | 7 +- dts/vendor/nordic/nrf54l20.dtsi | 852 ++++++++++++++++++ dts/vendor/nordic/nrf54l_05_10_15.dtsi | 8 +- .../bluetooth/bap_broadcast_sink/sample.yaml | 4 +- .../bap_broadcast_sink/sysbuild.cmake | 4 + .../bap_broadcast_source/sample.yaml | 4 +- .../bap_broadcast_source/sysbuild.cmake | 4 + .../bluetooth/bap_unicast_client/sample.yaml | 4 +- .../bap_unicast_client/sysbuild.cmake | 4 + .../bluetooth/bap_unicast_server/sample.yaml | 4 +- .../bap_unicast_server/sysbuild.cmake | 4 + samples/bluetooth/beacon/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sample.yaml | 4 +- samples/bluetooth/cap_acceptor/sysbuild.cmake | 4 + samples/bluetooth/cap_initiator/sample.yaml | 4 +- .../bluetooth/cap_initiator/sysbuild.cmake | 4 + .../direction_finding_central/sample.yaml | 15 +- .../sample.yaml | 14 +- .../sample.yaml | 14 +- .../direction_finding_peripheral/sample.yaml | 15 +- samples/bluetooth/hci_ipc/sample.yaml | 34 +- samples/bluetooth/hci_uart/sample.yaml | 18 +- samples/bluetooth/hci_vs_scan_req/sample.yaml | 2 + samples/bluetooth/iso_central/sample.yaml | 6 +- .../pbp_public_broadcast_sink/sample.yaml | 4 +- .../pbp_public_broadcast_sink/sysbuild.cmake | 4 + .../pbp_public_broadcast_source/sample.yaml | 4 +- .../sysbuild.cmake | 4 + .../bt-ll-sw-split/bt-ll-sw-split.overlay | 4 + .../controller/ll_sw/nordic/lll/lll.c | 2 +- .../controller/ctrl_api/testcase.yaml | 2 + .../controller/ctrl_chmu/testcase.yaml | 2 + .../controller/ctrl_cis_create/testcase.yaml | 2 + .../ctrl_cis_terminate/testcase.yaml | 2 + .../controller/ctrl_collision/testcase.yaml | 2 + .../controller/ctrl_conn_update/testcase.yaml | 11 +- .../controller/ctrl_cte_req/testcase.yaml | 2 + .../ctrl_data_length_update/testcase.yaml | 10 +- .../controller/ctrl_encrypt/testcase.yaml | 2 + .../ctrl_feature_exchange/testcase.yaml | 2 + .../controller/ctrl_hci/testcase.yaml | 2 + .../controller/ctrl_invalid/testcase.yaml | 2 + .../controller/ctrl_le_ping/testcase.yaml | 2 + .../ctrl_min_used_chans/testcase.yaml | 2 + .../controller/ctrl_phy_update/testcase.yaml | 6 +- .../controller/ctrl_sca_update/testcase.yaml | 2 + .../controller/ctrl_sw_privacy/testcase.yaml | 2 + .../controller/ctrl_terminate/testcase.yaml | 2 + .../ctrl_tx_buffer_alloc/testcase.yaml | 22 +- .../controller/ctrl_tx_queue/testcase.yaml | 2 + .../controller/ctrl_unsupported/testcase.yaml | 6 +- .../controller/ctrl_user_ext/testcase.yaml | 2 + .../controller/ctrl_version/testcase.yaml | 2 + .../df/connection_cte_req/testcase.yaml | 2 + .../df/connection_cte_tx_params/testcase.yaml | 2 + .../connectionless_cte_chains/testcase.yaml | 2 + .../df/connectionless_cte_rx/testcase.yaml | 2 + .../df/connectionless_cte_tx/testcase.yaml | 2 + tests/bluetooth/init/testcase.yaml | 101 ++- 69 files changed, 1235 insertions(+), 122 deletions(-) create mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 59f64d021368..ac703e2254b4 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -113,12 +113,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index fa786fc88d0a..6a40594215b5 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -121,12 +121,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index e8823af4afbf..e7658980dd7f 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -129,12 +129,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index 67b4b6fa6200..a111c0ba1bf7 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -10,7 +10,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -130,12 +130,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK another Bluetooth controller - * is added and set as the default. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index fe60970230f8..6cf8aff68bb8 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -121,12 +121,13 @@ status = "okay"; ble-2mbps-supported; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 14d23323c4e5..0cad8d33f67e 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -131,12 +131,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index a9c32ace6111..82cb57082943 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -11,7 +11,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -125,12 +125,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 20c161945bfb..68c257a4b37a 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -9,7 +9,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -111,12 +111,13 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "okay"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; + status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index eac16a3c14f3..2cde225beb01 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -32,7 +32,7 @@ wdt011: &cpurad_wdt011 {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; }; soc { @@ -136,6 +136,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index 5715ebfd2a05..db6b101df93d 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -15,7 +15,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -36,7 +36,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 8a59b519cb68..87c5abe300df 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -519,9 +519,10 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi new file mode 100644 index 000000000000..bee70effa0e8 --- /dev/null +++ b/dts/vendor/nordic/nrf54l20.dtsi @@ -0,0 +1,852 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/delete-node/ &sw_pwm; + +/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ +#define NRF_DOMAIN_ID_APPLICATION 0 +#define NRF_DOMAIN_ID_FLPR 1 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpuapp: cpu@0 { + compatible = "arm,cortex-m33f"; + reg = <0>; + device_type = "cpu"; + clocks = <&hfpll>; + #address-cells = <1>; + #size-cells = <1>; + + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + + cpuflpr: cpu@1 { + compatible = "nordic,vpr"; + reg = <1>; + device_type = "cpu"; + riscv,isa = "rv32emc"; + nordic,bus-width = <64>; + }; + }; + + clocks { + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + pclk32m: pclk32m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + lfxo: lfxo { + compatible = "nordic,nrf54l-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf54l-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1650>; + }; + + hfpll: hfpll { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + + aclk: aclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + + uicr: uicr@ffd000 { + compatible = "nordic,nrf-uicr"; + reg = <0xffd000 0x1000>; + }; + + cpuapp_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(447)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20000000 0x6fc00>; + }; + + cpuflpr_sram: memory@2006fc00 { + compatible = "mmio-sram"; + reg = <0x2006fc00 DT_SIZE_K(64)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2006fc00 0x10000>; + }; + + global_peripherals: peripheral@50000000 { + ranges = <0x0 0x50000000 0x10000000>; + #address-cells = <1>; + #size-cells = <1>; + + dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; + }; + + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + + cpuflpr_vpr: vpr@4c000 { + compatible = "nordic,nrf-vpr-coprocessor"; + reg = <0x4c000 0x1000>; + ranges = <0x0 0x4c000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + status = "disabled"; + enable-secure; + + cpuflpr_clic: interrupt-controller@f0000000 { + compatible = "nordic,nrf-clic"; + reg = <0xf0000000 0x143c>; + interrupt-controller; + #interrupt-cells = <2>; + #address-cells = <1>; + status = "disabled"; + }; + }; + + spi00: spi@4d000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart00: uart@4d000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4d000 0x1000>; + interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; + }; + + timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfpll>; + prescaler = <0>; + }; + + dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; + }; + + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + + timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + clocks = <&hfxo>; + prescaler = <0>; + }; + + egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + cs-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; + + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { + compatible = "zephyr,bt-hci-ll-sw-split"; + status = "disabled"; + }; + }; + + dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; + }; + + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + + i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; + }; + + pdm20: pdm@d0000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd0000 0x1000>; + interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pdm21: pdm@d1000 { + compatible = "nordic,nrf-pdm"; + status = "disabled"; + reg = <0xd1000 0x1000>; + interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + pwm20: pwm@d2000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd2000 0x1000>; + interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm21: pwm@d3000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd3000 0x1000>; + interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + pwm22: pwm@d4000 { + compatible = "nordic,nrf-pwm"; + status = "disabled"; + reg = <0xd4000 0x1000>; + interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; + #pwm-cells = <3>; + idleout-supported; + }; + + adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; + zephyr,pm-device-runtime-auto; + }; + + nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <16>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; + }; + + gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + status = "disabled"; + instance = <20>; + }; + + qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + clocks = <&lfxo>, <&pclk>; + clock-names = "lfclock", "hfclock"; + status = "disabled"; + }; + + tdm: tdm@e8000 { + compatible = "nordic,nrf-tdm"; + easydma-maxcnt-bits = <15>; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xe8000 0x1000>; + interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + clocks = <&pclk32m>; + }; + + i2c23: i2c@ed000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi23: spi@ed000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart23: uart@ed000 { + compatible = "nordic,nrf-uarte"; + reg = <0xed000 0x1000>; + interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + i2c24: i2c@ee000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi24: spi@ee000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart24: uart@ee000 { + compatible = "nordic,nrf-uarte"; + reg = <0xee000 0x1000>; + interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; + }; + + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + + i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; + zephyr,pm-device-runtime-auto; + }; + + spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + rx-delay-supported; + rx-delay = <1>; + status = "disabled"; + }; + + uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + endtx-stoptx-supported; + frame-timeout-supported; + }; + + comp: comparator@106000 { + /* + * Use compatible "nordic,nrf-comp" to configure as COMP + * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP + */ + compatible = "nordic,nrf-comp"; + reg = <0x106000 0x1000>; + status = "disabled"; + interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; + }; + + wdt30: watchdog@108000 { + compatible = "nordic,nrf-wdt"; + reg = <0x108000 0x620>; + interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <5>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; + }; + + gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + status = "disabled"; + instance = <30>; + }; + + clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + }; + + power: power@10e000 { + compatible = "nordic,nrf-power"; + reg = <0x10e000 0x1000>; + ranges = <0x0 0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + gpregret1: gpregret1@51c { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x51c 0x1>; + status = "disabled"; + }; + + gpregret2: gpregret2@520 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "nordic,nrf-gpregret"; + reg = <0x520 0x1>; + status = "disabled"; + }; + }; + + regulators: regulator@120000 { + compatible = "nordic,nrf54l-regulators"; + reg = <0x120000 0x1000>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + + vregmain: regulator@120600 { + compatible = "nordic,nrf5x-regulator"; + reg = <0x120600 0x1>; + status = "disabled"; + regulator-name = "VREGMAIN"; + regulator-initial-mode = ; + }; + }; + }; + + rram_controller: rram-controller@5004e000 { + compatible = "nordic,rram-controller"; + reg = <0x5004e000 0x1000>; + interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_rram: rram@0 { + compatible = "soc-nv-flash"; + reg = <0x0 DT_SIZE_K(1972)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + + cpuflpr_rram: rram@1ed000 { + compatible = "soc-nv-flash"; + reg = <0x1ed000 DT_SIZE_K(64)>; + erase-block-size = <4096>; + write-block-size = <16>; + }; + }; + + cpuapp_ppb: cpuapp-ppb-bus { + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_nvic: interrupt-controller@e000e100 { + #address-cells = <1>; + compatible = "arm,v8m-nvic"; + reg = <0xe000e100 0xc00>; + arm,num-irq-priority-bits = <3>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + cpuapp_systick: timer@e000e010 { + compatible = "arm,armv8m-systick"; + reg = <0xe000e010 0x10>; + status = "disabled"; + }; + }; + }; +}; diff --git a/dts/vendor/nordic/nrf54l_05_10_15.dtsi b/dts/vendor/nordic/nrf54l_05_10_15.dtsi index 50396ff0042c..02897232a6c7 100644 --- a/dts/vendor/nordic/nrf54l_05_10_15.dtsi +++ b/dts/vendor/nordic/nrf54l_05_10_15.dtsi @@ -267,9 +267,11 @@ status = "disabled"; }; - /* Note: In the nRF Connect SDK the SoftDevice Controller - * is added and set as the default Bluetooth Controller. - */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; diff --git a/samples/bluetooth/bap_broadcast_sink/sample.yaml b/samples/bluetooth/bap_broadcast_sink/sample.yaml index e6739dc10242..3eb1acd40762 100644 --- a/samples/bluetooth/bap_broadcast_sink/sample.yaml +++ b/samples/bluetooth/bap_broadcast_sink/sample.yaml @@ -25,5 +25,7 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake index f030ce94ef20..f969f05ecffd 100644 --- a/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_sink/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_broadcast_source/sample.yaml b/samples/bluetooth/bap_broadcast_source/sample.yaml index 5e5b01d942d0..5f745cd08950 100644 --- a/samples/bluetooth/bap_broadcast_source/sample.yaml +++ b/samples/bluetooth/bap_broadcast_source/sample.yaml @@ -36,5 +36,7 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/bap_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/bap_broadcast_source/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_client/sample.yaml b/samples/bluetooth/bap_unicast_client/sample.yaml index 7283090b8781..44f32934ce99 100644 --- a/samples/bluetooth/bap_unicast_client/sample.yaml +++ b/samples/bluetooth/bap_unicast_client/sample.yaml @@ -22,5 +22,7 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_client/sysbuild.cmake b/samples/bluetooth/bap_unicast_client/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/bap_unicast_client/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_client/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/bap_unicast_server/sample.yaml b/samples/bluetooth/bap_unicast_server/sample.yaml index 068f752b626b..266ced73f66d 100644 --- a/samples/bluetooth/bap_unicast_server/sample.yaml +++ b/samples/bluetooth/bap_unicast_server/sample.yaml @@ -22,5 +22,7 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/bap_unicast_server/sysbuild.cmake b/samples/bluetooth/bap_unicast_server/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/bap_unicast_server/sysbuild.cmake +++ b/samples/bluetooth/bap_unicast_server/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index 1cbfc7da36f7..fe90b5952f92 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -21,7 +21,9 @@ tests: - ophelia4ev/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp sample.bluetooth.beacon-coex: - extra_args: CONF_FILE="prj-coex.conf" + extra_args: + - CONF_FILE="prj-coex.conf" + - SNIPPET="bt-ll-sw-split" harness: bluetooth platform_allow: - nrf52840dk/nrf52840 diff --git a/samples/bluetooth/cap_acceptor/sample.yaml b/samples/bluetooth/cap_acceptor/sample.yaml index 824e744eecaf..9061f44679fb 100644 --- a/samples/bluetooth/cap_acceptor/sample.yaml +++ b/samples/bluetooth/cap_acceptor/sample.yaml @@ -26,5 +26,7 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/cap_acceptor/sysbuild.cmake b/samples/bluetooth/cap_acceptor/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/cap_acceptor/sysbuild.cmake +++ b/samples/bluetooth/cap_acceptor/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/cap_initiator/sample.yaml b/samples/bluetooth/cap_initiator/sample.yaml index b4f593c99129..e3e557f48301 100644 --- a/samples/bluetooth/cap_initiator/sample.yaml +++ b/samples/bluetooth/cap_initiator/sample.yaml @@ -26,5 +26,7 @@ tests: - nrf52833dk/nrf52833 - nrf52840dk/nrf52840 - nrf52840dongle/nrf52840 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/cap_initiator/sysbuild.cmake b/samples/bluetooth/cap_initiator/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/cap_initiator/sysbuild.cmake +++ b/samples/bluetooth/cap_initiator/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index b7a118e6cdc8..ffdf634c6e3e 100644 --- a/samples/bluetooth/direction_finding_central/sample.yaml +++ b/samples/bluetooth/direction_finding_central/sample.yaml @@ -14,15 +14,24 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.central.aod: + sample.bluetooth.direction_finding.central.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aod.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aod.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding.central.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aod.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml index 8e6097de58ae..c500cc80dcec 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml @@ -12,14 +12,22 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless_rx.aod: + sample.bluetooth.direction_finding_connectionless_rx.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aod.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aod.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless_rx.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aod.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 78d21b2c95f5..2a4fa93d19d5 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -12,14 +12,22 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding_connectionless.aoa: + sample.bluetooth.direction_finding_connectionless.aoa_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aoa.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding_connectionless.aoa_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_peripheral/sample.yaml b/samples/bluetooth/direction_finding_peripheral/sample.yaml index f300cb415cc5..01f612ad08a0 100644 --- a/samples/bluetooth/direction_finding_peripheral/sample.yaml +++ b/samples/bluetooth/direction_finding_peripheral/sample.yaml @@ -14,15 +14,24 @@ tests: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - nrf5340dk/nrf5340/cpuapp - sample.bluetooth.direction_finding.peripheral.aod: + sample.bluetooth.direction_finding.peripheral.aod_with_controller: harness: bluetooth - extra_args: EXTRA_CONF_FILE="overlay-aoa.conf" + extra_args: + - EXTRA_CONF_FILE="overlay-aoa.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 - - nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - nrf52833dk/nrf52833 - nrf52833dk/nrf52820 + sample.bluetooth.direction_finding.peripheral.aod_host_only: + harness: bluetooth + extra_args: + - OVERLAY_CONFIG="overlay-aoa.conf" + platform_allow: + - nrf5340dk/nrf5340/cpuapp + tags: bluetooth + integration_platforms: - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/hci_ipc/sample.yaml b/samples/bluetooth/hci_ipc/sample.yaml index b758b2547688..3763478b6b33 100644 --- a/samples/bluetooth/hci_ipc/sample.yaml +++ b/samples/bluetooth/hci_ipc/sample.yaml @@ -15,7 +15,9 @@ tests: sample.bluetooth.hci_ipc.iso_broadcast.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -25,7 +27,9 @@ tests: sample.bluetooth.hci_ipc.iso_receive.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -35,7 +39,9 @@ tests: sample.bluetooth.hci_ipc.bis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -45,7 +51,9 @@ tests: sample.bluetooth.hci_ipc.iso_central.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -55,7 +63,9 @@ tests: sample.bluetooth.hci_ipc.iso_peripheral.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -65,7 +75,9 @@ tests: sample.bluetooth.hci_ipc.cis.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -75,7 +87,9 @@ tests: sample.bluetooth.hci_ipc.iso.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf5340_audio_dk/nrf5340/cpunet @@ -99,6 +113,7 @@ tests: extra_args: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet @@ -109,13 +124,16 @@ tests: - CONF_FILE="nrf5340_cpunet_df-bt_ll_sw_split.conf" - DTC_OVERLAY_FILE="nrf5340_cpunet_df-bt_ll_sw_split.overlay" - CONFIG_BT_CTLR_PHY_CODED=n + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet sample.bluetooth.hci_ipc.mesh.bt_ll_sw_split: harness: bluetooth tags: bluetooth - extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" + extra_args: + - CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf" + - SNIPPET="bt-ll-sw-split" platform_allow: nrf5340dk/nrf5340/cpunet integration_platforms: - nrf5340dk/nrf5340/cpunet diff --git a/samples/bluetooth/hci_uart/sample.yaml b/samples/bluetooth/hci_uart/sample.yaml index df2b40135c67..8555c65cf0df 100644 --- a/samples/bluetooth/hci_uart/sample.yaml +++ b/samples/bluetooth/hci_uart/sample.yaml @@ -24,7 +24,9 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -33,7 +35,9 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y tags: @@ -44,7 +48,9 @@ tests: platform_allow: nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -54,7 +60,9 @@ tests: sample.bluetooth.hci_uart.nrf5340_netcore.df.iq_report: harness: bluetooth platform_allow: nrf5340dk/nrf5340/cpunet - extra_args: DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + extra_args: + - DTC_OVERLAY_FILE=./boards/nrf5340dk_nrf5340_cpunet_df.overlay + - SNIPPET="bt-ll-sw-split" extra_configs: - CONFIG_BT_CTLR_DF=y - CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y @@ -88,6 +96,7 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf52833dk_nrf52833_df.overlay + - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth @@ -99,6 +108,7 @@ tests: extra_args: - EXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf - DTC_OVERLAY_FILE=./boards/nrf54l15dk_nrf54l15_cpuapp_df.overlay + - SNIPPET="bt-ll-sw-split" tags: - uart - bluetooth diff --git a/samples/bluetooth/hci_vs_scan_req/sample.yaml b/samples/bluetooth/hci_vs_scan_req/sample.yaml index 245a83aa0d96..49526522d16e 100644 --- a/samples/bluetooth/hci_vs_scan_req/sample.yaml +++ b/samples/bluetooth/hci_vs_scan_req/sample.yaml @@ -9,4 +9,6 @@ tests: - nrf52dk/nrf52832 extra_configs: - CONFIG_BT_LL_SW_SPLIT=y + extra_args: + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/iso_central/sample.yaml b/samples/bluetooth/iso_central/sample.yaml index 3a7dedd404ae..57254ee809ab 100644 --- a/samples/bluetooth/iso_central/sample.yaml +++ b/samples/bluetooth/iso_central/sample.yaml @@ -11,11 +11,11 @@ tests: sample.bluetooth.iso_central.bt_ll_sw_split: harness: bluetooth platform_allow: - - qemu_cortex_m3 - - qemu_x86 - nrf52_bsim - nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml index d7c816ee5b76..901d40b00d4f 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_sink/sample.yaml @@ -23,5 +23,7 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake index 5aa4c28ce922..8ff4c02acf5a 100644 --- a/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_sink/sysbuild.cmake @@ -18,6 +18,10 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml index 80c907042119..1d2e31306e29 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sample.yaml +++ b/samples/bluetooth/pbp_public_broadcast_source/sample.yaml @@ -23,5 +23,7 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + extra_args: + - EXTRA_CONF_FILE=overlay-bt_ll_sw_split.conf + - SNIPPET="bt-ll-sw-split" tags: bluetooth diff --git a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake index f0aa34b7ad4a..fa62c31f7b3b 100644 --- a/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/pbp_public_broadcast_source/sysbuild.cmake @@ -18,6 +18,10 @@ if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")) CACHE INTERNAL "" ) + list(APPEND ${NET_APP}_SNIPPET ${SNIPPET}) + list(APPEND ${NET_APP}_SNIPPET bt-ll-sw-split) + set(${NET_APP}_SNIPPET ${${NET_APP}_SNIPPET} CACHE STRING "" FORCE) + native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP}) endif() diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay index 04bf83ef44d4..a57a0e82ba6e 100644 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay +++ b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay @@ -2,6 +2,10 @@ status = "okay"; }; +&bt_hci_sdc { + status = "disabled"; +}; + / { chosen { zephyr,bt-hci = &bt_hci_controller; diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 9a39b1fe3829..0ae21070aa6d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -63,7 +63,7 @@ static struct { /* FIXME: This could probably use a chosen entropy device instead on relying on * the nodelabel being the same as for the old nrf rng. */ -static const struct device *const dev_entropy = DEVICE_DT_GET(DT_NODELABEL(rng)); +static const struct device *const dev_entropy = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy)); #endif /* CONFIG_ENTROPY_HAS_DRIVER */ static int init_reset(void); diff --git a/tests/bluetooth/controller/ctrl_api/testcase.yaml b/tests/bluetooth/controller/ctrl_api/testcase.yaml index 19bf6c9ab490..21f178bf9b2b 100644 --- a/tests/bluetooth/controller/ctrl_api/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_api/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_api.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml index f7e8068d60ec..9c3ee6264335 100644 --- a/tests/bluetooth/controller/ctrl_chmu/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_chmu/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_chmu.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml index 99612a89bc31..2371d7063eb7 100644 --- a/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_create/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cis_create.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml index 956172a89b20..a98229ba45f3 100644 --- a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cis_terminate.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_collision/testcase.yaml b/tests/bluetooth/controller/ctrl_collision/testcase.yaml index 6086a9a4ebc8..daa8f3bc6c3d 100644 --- a/tests/bluetooth/controller/ctrl_collision/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_collision/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_collision.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml index 5b0bda4b9088..fc4ecb0b647d 100644 --- a/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_conn_update/testcase.yaml @@ -7,11 +7,18 @@ common: tests: bluetooth.controller.ctrl_conn_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_conn_update.apm_test: type: unit - extra_args: CONF_FILE=prj_apm.conf + extra_args: + - CONF_FILE=prj_apm.conf + - SNIPPET="bt-ll-sw-split" + bluetooth.controller.ctrl_conn_update.no_param_req_test: type: unit - extra_args: CONF_FILE=prj_no_param_req.conf + extra_args: + - CONF_FILE=prj_no_param_req.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml index fd6ff51118d9..c6288aecc433 100644 --- a/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_cte_req/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_cte_req.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml index 9778af435b4a..c7d1174e12bf 100644 --- a/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_data_length_update/testcase.yaml @@ -6,11 +6,17 @@ common: tests: bluetooth.controller.ctrl_data_length_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nocodedphy: type: unit - extra_args: CONF_FILE=prj_nocoded.conf + extra_args: + - CONF_FILE=prj_nocoded.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_data_length_update.test_nophy: type: unit - extra_args: CONF_FILE=prj_nophy.conf + extra_args: + - CONF_FILE=prj_nophy.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml index d5bb2cb8b110..86dd5bfe4d30 100644 --- a/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_encrypt/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_encrypt.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml index 257542f36120..087e49575ff7 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_feature_exchange/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_feature_exchange.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_hci/testcase.yaml b/tests/bluetooth/controller/ctrl_hci/testcase.yaml index d7f7ce7168d1..e0735bae6962 100644 --- a/tests/bluetooth/controller/ctrl_hci/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_hci/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_hci.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml index 2d1741931e37..cee54e6b09ed 100644 --- a/tests/bluetooth/controller/ctrl_invalid/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_invalid/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_invalid.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml index b6a77528f32d..54178905da17 100644 --- a/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_le_ping/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_le_ping.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml index 0991b0cdd43c..a9445cbf8c4d 100644 --- a/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_min_used_chans/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_min_used_chans.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml index 1d7da169f1d8..d5c49d587a8f 100644 --- a/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_phy_update/testcase.yaml @@ -6,6 +6,10 @@ common: tests: bluetooth.controller.ctrl_phy_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_phy_update.test_reduced_buf: type: unit - extra_args: CONF_FILE=prj_rx_cnt.conf + extra_args: + - CONF_FILE=prj_rx_cnt.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml index cbf63aa1b575..cbc3c3faf720 100644 --- a/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sca_update/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_sca_update.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml index 778606d69549..ac5dd6e957eb 100644 --- a/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_sw_privacy/testcase.yaml @@ -4,3 +4,5 @@ common: tests: bluetooth.ctrl_sw_privacy.test: platform_allow: nrf52_bsim + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml index cbe639401ea3..6b1409e9653e 100644 --- a/tests/bluetooth/controller/ctrl_terminate/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_terminate/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_terminate.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml index 614eb7fe94c0..363986bd3d35 100644 --- a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/testcase.yaml @@ -6,23 +6,35 @@ common: tests: bluetooth.controller.ctrl_tx_buffer_alloc.test_0_per_conn: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_1_per_conn: type: unit - extra_args: CONF_FILE=prj_1.conf + extra_args: + - CONF_FILE=prj_1.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_2_per_conn: type: unit - extra_args: CONF_FILE=prj_2.conf + extra_args: + - CONF_FILE=prj_2.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_3_per_conn: type: unit - extra_args: CONF_FILE=prj_3.conf + extra_args: + - CONF_FILE=prj_3.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_max_per_conn_alloc: type: unit - extra_args: CONF_FILE=prj_max.conf + extra_args: + - CONF_FILE=prj_max.conf + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_tx_buffer_alloc.test_max_common_alloc: type: unit - extra_args: CONF_FILE=prj_max_common.conf + extra_args: + - CONF_FILE=prj_max_common.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml index 295ad891a630..282b620b317a 100644 --- a/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_tx_queue/testcase.yaml @@ -5,3 +5,5 @@ common: tests: bluetooth.ctrl_tx_queue.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml index 28aba1a752a8..48b18af93536 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_unsupported/testcase.yaml @@ -6,7 +6,11 @@ common: tests: bluetooth.controller.ctrl_unsupported.default.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" bluetooth.controller.ctrl_unsupported.test: type: unit - extra_args: CONF_FILE=prj_unsupported.conf + extra_args: + - CONF_FILE=prj_unsupported.conf + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml index af319a7a7191..be963df24a8a 100644 --- a/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_user_ext/testcase.yaml @@ -4,3 +4,5 @@ common: tests: bluetooth.ctrl_user_ext.test: platform_allow: nrf52_bsim + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/controller/ctrl_version/testcase.yaml b/tests/bluetooth/controller/ctrl_version/testcase.yaml index 6badcbc72547..5df86b9bca9f 100644 --- a/tests/bluetooth/controller/ctrl_version/testcase.yaml +++ b/tests/bluetooth/controller/ctrl_version/testcase.yaml @@ -6,3 +6,5 @@ common: tests: bluetooth.controller.ctrl_version.test: type: unit + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_req/testcase.yaml b/tests/bluetooth/df/connection_cte_req/testcase.yaml index 768aba4a51f5..fbfe4b0d9a1a 100644 --- a/tests/bluetooth/df/connection_cte_req/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_req/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.conection_cte_req: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml index 38a23b0950e3..a9986c5b0e53 100644 --- a/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml +++ b/tests/bluetooth/df/connection_cte_tx_params/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.conection_cte_tx_params: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml index 6aa5bb0f0c1c..844a7bbb524e 100644 --- a/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_chains/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_chains: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml index f839b1910eb2..c8f08a908436 100644 --- a/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_rx/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_rx: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml index 77d651d0cbc2..491cc0e7e599 100644 --- a/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml +++ b/tests/bluetooth/df/connectionless_cte_tx/testcase.yaml @@ -2,3 +2,5 @@ tests: bluetooth.df.connectionless_cte_tx: platform_allow: nrf52_bsim tags: bluetooth + extra_args: + - SNIPPET="bt-ll-sw-split" diff --git a/tests/bluetooth/init/testcase.yaml b/tests/bluetooth/init/testcase.yaml index 120b6a3d81bd..bbefd93265c1 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -62,7 +62,9 @@ tests: extra_args: CONF_FILE=prj_6.conf platform_allow: qemu_cortex_m3 bluetooth.init.test_ctlr: - extra_args: CONF_FILE=prj_ctlr.conf + extra_args: + - CONF_FILE=prj_ctlr.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -74,7 +76,9 @@ tests: - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_4_0: - extra_args: CONF_FILE=prj_ctlr_4_0.conf + extra_args: + - CONF_FILE=prj_ctlr_4_0.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -83,7 +87,9 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_4_0_dbg: - extra_args: CONF_FILE=prj_ctlr_4_0_dbg.conf + extra_args: + - CONF_FILE=prj_ctlr_4_0_dbg.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -92,7 +98,9 @@ tests: - nrf52dk/nrf52832 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_tiny: - extra_args: CONF_FILE=prj_ctlr_tiny.conf + extra_args: + - CONF_FILE=prj_ctlr_tiny.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -104,6 +112,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -114,6 +123,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr_5_x_dbg.conf - DTC_OVERLAY_FILE=pa_lna.overlay + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -125,6 +135,7 @@ tests: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_CTLR_ADVANCED_FEATURES=y - CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf5340dk/nrf5340/cpunet - nrf52840dk/nrf52840 @@ -134,13 +145,16 @@ tests: bluetooth.init.test_ctlr_ticker: extra_args: - CONF_FILE=prj_ctlr_ticker.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_broadcaster: - extra_args: CONF_FILE=prj_ctlr_broadcaster.conf + extra_args: + - CONF_FILE=prj_ctlr_broadcaster.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -149,7 +163,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral: - extra_args: CONF_FILE=prj_ctlr_peripheral.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -158,7 +174,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_peripheral_priv: - extra_args: CONF_FILE=prj_ctlr_peripheral_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -167,7 +185,9 @@ tests: integration_platforms: - nrf52840dk/nrf52840 bluetooth.init.test_ctlr_observer: - extra_args: CONF_FILE=prj_ctlr_observer.conf + extra_args: + - CONF_FILE=prj_ctlr_observer.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -176,7 +196,9 @@ tests: integration_platforms: - nrf52dk/nrf52832 bluetooth.init.test_ctlr_central: - extra_args: CONF_FILE=prj_ctlr_central.conf + extra_args: + - CONF_FILE=prj_ctlr_central.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -186,7 +208,9 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_central_priv: - extra_args: CONF_FILE=prj_ctlr_central_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_central_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -196,7 +220,9 @@ tests: - nrf52dk/nrf52832 - rv32m1_vega/openisa_rv32m1/ri5cy bluetooth.init.test_ctlr_broadcaster_ext: - extra_args: CONF_FILE=prj_ctlr_broadcaster_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_broadcaster_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -205,7 +231,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext: - extra_args: CONF_FILE=prj_ctlr_peripheral_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -214,7 +242,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_ext_priv: - extra_args: CONF_FILE=prj_ctlr_peripheral_ext_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_ext_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -223,7 +253,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_oberver_ext: - extra_args: CONF_FILE=prj_ctlr_observer_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_observer_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -232,7 +264,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext: - extra_args: CONF_FILE=prj_ctlr_central_ext.conf + extra_args: + - CONF_FILE=prj_ctlr_central_ext.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -241,7 +275,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_ext_priv: - extra_args: CONF_FILE=prj_ctlr_central_ext_priv.conf + extra_args: + - CONF_FILE=prj_ctlr_central_ext_priv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -250,7 +286,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv: - extra_args: CONF_FILE=prj_ctlr_per_adv.conf + extra_args: + - CONF_FILE=prj_ctlr_per_adv.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -259,7 +297,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_adv_no_adi: - extra_args: CONF_FILE=prj_ctlr_per_adv_no_adi.conf + extra_args: + - CONF_FILE=prj_ctlr_per_adv_no_adi.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -268,7 +308,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync: - extra_args: CONF_FILE=prj_ctlr_per_sync.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -277,7 +319,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_adi: - extra_args: CONF_FILE=prj_ctlr_per_sync_no_adi.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync_no_adi.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -286,7 +330,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_per_sync_no_filter: - extra_args: CONF_FILE=prj_ctlr_per_sync_no_filter.conf + extra_args: + - CONF_FILE=prj_ctlr_per_sync_no_filter.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -295,7 +341,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_peripheral_iso: - extra_args: CONF_FILE=prj_ctlr_peripheral_iso.conf + extra_args: + - CONF_FILE=prj_ctlr_peripheral_iso.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -304,7 +352,9 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_ctlr_central_iso: - extra_args: CONF_FILE=prj_ctlr_central_iso.conf + extra_args: + - CONF_FILE=prj_ctlr_central_iso.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -323,7 +373,9 @@ tests: - DTC_OVERLAY_FILE=h5.overlay platform_allow: qemu_cortex_m3 bluetooth.init.test_llcp: - extra_args: CONF_FILE=prj_llcp.conf + extra_args: + - CONF_FILE=prj_llcp.conf + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 @@ -335,6 +387,7 @@ tests: extra_args: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_RECV_WORKQ_BT=y + - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 bluetooth.init.test_host_6_x: From 80fb41bd5e2364bb4412ce9db59825d752fd73ec Mon Sep 17 00:00:00 2001 From: alperen sener Date: Fri, 24 Oct 2025 15:25:55 +0200 Subject: [PATCH 3135/3334] [nrf noup] tests: bluetooth: tester: Remove deprecated configs Removing the deprecated kconfigs for nrf54h20 target. Signed-off-by: alperen sener (cherry picked from commit 30cd6282e2016ce77738427809249fe963d76273) --- tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 1 - .../sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 51b0ef5fa8d4..0f16f6ea7b4c 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -26,6 +26,5 @@ CONFIG_UART_INTERRUPT_DRIVEN=y # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf index b7d64a9e6a08..24e3d84ecf96 100644 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -35,6 +35,5 @@ CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_NRF_SECURITY=y From f98fdf543b7218895774b1a04af0307f5cc2db10 Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Thu, 5 Sep 2024 10:41:36 +0200 Subject: [PATCH 3136/3334] [nrf noup] boards: nordic: Enable PSA RNG for nrf54h20 Noup since Ironside not available upstream and it is required for PSA RNG. This enables the PSA RNG as the default Zephyr entropy provider for the nrf54h20dk cpuapp and cpurad targets. Signed-off-by: Georgios Vasilakis Signed-off-by: Sergey Korotkov (cherry picked from commit b9d5d9f655bfb8ca7438af16d0e9111043639222) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 6 ++++++ boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 18dad5cbade6..a8525de37816 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -27,6 +27,7 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; + zephyr,entropy = &psa_rng; }; aliases { @@ -111,6 +112,11 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_bellboard { diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index cf88e536d43c..0c46f46b7249 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -28,12 +28,18 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpurad_bellboard { From 5cbd1da70f4d7a38f206a533b7dbb8d8ac93fce1 Mon Sep 17 00:00:00 2001 From: Sergey Korotkov Date: Fri, 31 Oct 2025 13:02:15 +0100 Subject: [PATCH 3137/3334] [nrf noup] boards: nordic: Enable PSA RNG for nrf9280 Noup since Ironside not available upstream and it is required for PSA RNG. This enables the PSA RNG as the default Zephyr entropy provider for the nrf9280pdk cpuapp and cpurad targets. Signed-off-by: Sergey Korotkov (cherry picked from commit 8e1b36318165056872f2e7719ef29bc9fa45e5aa) --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 6 ++++++ boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index f1bc01a8f742..dc8bee73f011 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -27,6 +27,7 @@ zephyr,uart-mcumgr = &uart136; zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { @@ -108,6 +109,11 @@ pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; }; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_ram0x_region { diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts index 45fd620c37a1..17c482e7865c 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts @@ -29,12 +29,18 @@ zephyr,ieee802154 = &cpurad_ieee802154; zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; + zephyr,entropy = &psa_rng; }; aliases { ipc-to-cpusys = &cpurad_cpusys_ipc; resetinfo = &cpurad_resetinfo; }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; }; &cpuapp_cpurad_ram0x_region { From 623bdffd2625148e7c681d32d5becc132f7cf67a Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Wed, 5 Nov 2025 14:16:33 +0100 Subject: [PATCH 3138/3334] [nrf noup] ci: Extend test spec for CI-ble-test We want to run CI when Nordic specific arch, soc, or board changes are done. Running CI on such changes would have prevented that https://github.com/nrfconnect/sdk-nrf/pull/25230 broke this CI plan. Signed-off-by: Rubin Gerritsen (cherry picked from commit f1d901d629baa1d1bb58d8772425f59e9a403fc7) --- .github/test-spec.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 76def875e0be..5fdf9c0ca782 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -86,6 +86,8 @@ - "samples/tfm_integration/**/*" "CI-ble-test": + - any: + - "arch/arm/**/*" - any: - "drivers/bluetooth/**/*" - any: @@ -97,7 +99,12 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/hci_ipc/**/*" + - any: + - "boards/nordic/nrf5*" + - any: + - "soc/nordic/**/*" + - any: + - "subsys/pm/**/*" "CI-ble-samples-test": - any: From 0459117a8080d32138f3ebc1103c5d930a91c744 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 6 Nov 2025 12:51:08 +0100 Subject: [PATCH 3139/3334] [nrf noup] tests: drivers: mspi: flash: disable psa_rng Not needed for this test and prevents from building with CONFIG_MULTITHREADING=n. Changes for h20 rad are similar, but needed to test cases filtering working only. Signed-off-by: Piotr Kosycarz (cherry picked from commit 4c7aba3df46ce8b5755d56643e2fe59373542c26) --- .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 4 ++++ .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf | 1 + .../mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf create mode 100644 tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 6e0d84e07cdb..2e6b6cf5eacc 100644 --- a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -8,6 +8,10 @@ aliases { mspi0 = &exmif; }; + + psa_rng: psa-rng { + status = "disabled"; + }; }; &gpio6 { diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..a026df97a458 --- /dev/null +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +CONFIG_PM=n diff --git a/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..09b4edc100a4 --- /dev/null +++ b/tests/drivers/mspi/flash/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,5 @@ +/ { + psa_rng: psa-rng { + status = "disabled"; + }; +}; From 6ba3265b9e122e3e520a258575d5b7bbdee83ec7 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 8 Apr 2025 10:16:33 +0100 Subject: [PATCH 3140/3334] [nrf noup] mgmt: mcumgr: Fix nRF5340 network core hook Fixes an issue whereby just enabling hooks would enable the nrf5340 network core hook despite lacking other requirements Signed-off-by: Jamie McCrae Signed-off-by: Tomasz Chyrowicz (cherry picked from commit 258c7573e918d2602ab20ee78fb64d4f04240a8d) --- subsys/mgmt/mcumgr/CMakeLists.txt | 13 +++++++------ subsys/mgmt/mcumgr/Kconfig | 2 +- subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c | 15 +++------------ subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 ++++++++ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subsys/mgmt/mcumgr/CMakeLists.txt b/subsys/mgmt/mcumgr/CMakeLists.txt index ad088eca0677..3bb21e16f798 100644 --- a/subsys/mgmt/mcumgr/CMakeLists.txt +++ b/subsys/mgmt/mcumgr/CMakeLists.txt @@ -17,10 +17,11 @@ add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client) zephyr_library_link_libraries(mgmt_mcumgr) -if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS) - zephyr_include_directories( - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include - ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include - ) - zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) +if(CONFIG_MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK) + zephyr_include_directories( + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include + ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include + ) + + zephyr_library_sources(bootutil_hooks/nrf53_hooks.c) endif() diff --git a/subsys/mgmt/mcumgr/Kconfig b/subsys/mgmt/mcumgr/Kconfig index 5a7314ad57ed..be48e2f4fb7e 100644 --- a/subsys/mgmt/mcumgr/Kconfig +++ b/subsys/mgmt/mcumgr/Kconfig @@ -6,7 +6,7 @@ menuconfig MCUMGR bool "MCUmgr Support" depends on NET_BUF depends on ZCBOR - imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG) + imply BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP && MCUMGR_GRP_IMG && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 help This option enables the MCUmgr management library. diff --git a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c index f1ac8a168e65..b372ce4e4945 100644 --- a/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c +++ b/subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c @@ -8,19 +8,10 @@ #include #include "bootutil/bootutil_public.h" -#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1 -/* Sysbuild */ -#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER -#else -/* Legacy child/parent */ -#define NET_CORE_IMAGE 1 -#endif - -int boot_read_swap_state_primary_slot_hook(int image_index, - struct boot_swap_state *state) +int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state) { - if (image_index == NET_CORE_IMAGE) { - /* Pretend that primary slot of image 1 unpopulated */ + if (image_index == CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER) { + /* Pretend that primary slot of the network core update image is unpopulated */ state->magic = BOOT_MAGIC_UNSET; state->swap_type = BOOT_SWAP_TYPE_NONE; state->image_num = image_index; diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index ca5362f1fd68..b3a7410d6408 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -231,6 +231,14 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS This will enable the slot info function hooks which can be used to add additional information to responses. +config MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK + bool "nRF5340 network core bootutil hook" + depends on SOC_NRF5340_CPUAPP && BOOT_IMAGE_ACCESS_HOOKS && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1 + default y + help + This option will enable a bootutil hook that populates the network core update image + slot with dummy data to allow for uploading a firmware update to the network core. + module = MCUMGR_GRP_IMG module-str = mcumgr_grp_img source "subsys/logging/Kconfig.template.log_config" From ac26720ec10c4b9c2d0f4884e8707b9d4fdc2f46 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Thu, 6 Nov 2025 20:37:33 +0100 Subject: [PATCH 3141/3334] [nrf noup] drivers: can: mcan: implement CAN_MODE_ONE_SHOT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement CAN_MODE_ONE_SHOT in MCAN impementation. The implementation contains a workaround for a bug in the MCAN IP which prevents an IRQ from triggering. This is a noup as the workaround is too complicated and the feature is too niche to be accepted it upstream. Signed-off-by: Bjarki Arge Andreasen Signed-off-by: Tomasz Moń (cherry picked from commit 93d8bf56fc746116ad6075e6ce2df76cb91b70d6) --- drivers/can/Kconfig.mcan | 15 ++++ drivers/can/can_mcan.c | 114 +++++++++++++++++++++++++- include/zephyr/drivers/can/can_mcan.h | 1 + 3 files changed, 128 insertions(+), 2 deletions(-) diff --git a/drivers/can/Kconfig.mcan b/drivers/can/Kconfig.mcan index db09fc800c11..96c5f22446f6 100644 --- a/drivers/can/Kconfig.mcan +++ b/drivers/can/Kconfig.mcan @@ -7,3 +7,18 @@ config CAN_MCAN bool help Enable the Bosch M_CAN CAN IP module driver backend. + +if CAN_MCAN + +config CAN_MCAN_TXBCF_POLL_INTERVAL_MS + int "Polling interval in milliseconds of TXBCF register if DAR is enabled" + default 75 + help + When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, + is enabled, and a transmission fails, a bug in the MCAN IP prevents the + TCF (Transmission Cancellation Finalized) interrupt from triggering, + despite the correct bit being set in the TXBCF register. It is thus + necessary to poll TXBCF register to detect when a transmission failed if + DAR is enabled. + +endif # CAN_MCAN diff --git a/drivers/can/can_mcan.c b/drivers/can/can_mcan.c index 513daad82199..351423d16ac5 100644 --- a/drivers/can/can_mcan.c +++ b/drivers/can/can_mcan.c @@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(can_mcan, CONFIG_CAN_LOG_LEVEL); #define CAN_INIT_TIMEOUT_MS 100 +#define TXBCF_TIMER_TIMEOUT K_MSEC(CONFIG_CAN_MCAN_TXBCF_POLL_INTERVAL_MS) int can_mcan_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) { @@ -276,7 +277,7 @@ int can_mcan_get_capabilities(const struct device *dev, can_mode_t *cap) { ARG_UNUSED(dev); - *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; + *cap = CAN_MODE_NORMAL | CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; if (IS_ENABLED(CONFIG_CAN_MANUAL_RECOVERY_MODE)) { *cap |= CAN_MODE_MANUAL_RECOVERY; @@ -322,12 +323,78 @@ int can_mcan_start(const struct device *dev) return err; } + uint32_t cccr; + + err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); + if (err != 0) { + return err; + } + + if (cccr & CAN_MCAN_CCCR_DAR) { + /* + * When DAR (Disable Automatic Retransmission), used for CAN_MODE_ONE_SHOT, + * is enabled, and a transmission fails, a bug in the MCAN IP prevents the + * TCF (Transmission Cancellation Finalized) interrupt from triggering, + * despite the correct bit being set in the TXBCF register. It is thus + * necessary to poll TXBCF register to detect when a transmission failed if + * DAR is enabled. + */ + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + data->common.started = true; pm_device_busy_set(dev); return err; } +static int can_mcan_read_txbcf(const struct device *dev) +{ + const struct can_mcan_config *config = dev->config; + const struct can_mcan_callbacks *cbs = config->callbacks; + struct can_mcan_data *data = dev->data; + uint32_t txbcfs; + int err; + can_tx_callback_t tx_cb; + void *user_data; + + err = can_mcan_read_reg(dev, CAN_MCAN_TXBCF, &txbcfs); + if (err != 0) { + LOG_ERR("failed to read tx cancellation finished (err %d)", err); + return err; + } + + if (txbcfs == 0) { + return 0; + } + + for (size_t tx_idx = 0; tx_idx < cbs->num_tx; tx_idx++) { + if ((txbcfs & BIT(tx_idx)) == 0) { + continue; + } + + if (cbs->tx[tx_idx].function == NULL) { + continue; + } + + tx_cb = cbs->tx[tx_idx].function; + user_data = cbs->tx[tx_idx].user_data; + cbs->tx[tx_idx].function = NULL; + LOG_DBG("tx buffer cancellation finished (idx %u)", tx_idx); + k_sem_give(&data->tx_sem); + tx_cb(dev, -EIO, user_data); + } + + return 0; +} + +static void can_mcan_txbcf_timer_handler(struct k_timer *timer_id) +{ + const struct device *dev = k_timer_user_data_get(timer_id); + + can_mcan_read_txbcf(dev); +} + static bool can_mcan_rx_filters_exist(const struct device *dev) { const struct can_mcan_config *config = dev->config; @@ -362,6 +429,8 @@ int can_mcan_stop(const struct device *dev) return -EALREADY; } + k_timer_stop(&data->txbcf_timer); + /* CAN transmissions are automatically stopped when entering init mode */ err = can_mcan_enter_init_mode(dev, K_MSEC(CAN_INIT_TIMEOUT_MS)); if (err != 0) { @@ -402,7 +471,7 @@ int can_mcan_stop(const struct device *dev) int can_mcan_set_mode(const struct device *dev, can_mode_t mode) { - can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY; + can_mode_t supported = CAN_MODE_LOOPBACK | CAN_MODE_LISTENONLY | CAN_MODE_ONE_SHOT; struct can_mcan_data *data = dev->data; uint32_t cccr; uint32_t test; @@ -460,6 +529,13 @@ int can_mcan_set_mode(const struct device *dev, can_mode_t mode) } #endif /* CONFIG_CAN_FD_MODE */ + if ((mode & CAN_MODE_ONE_SHOT) != 0) { + /* Disable Automatic Retransmission */ + cccr |= CAN_MCAN_CCCR_DAR; + } else { + cccr &= ~CAN_MCAN_CCCR_DAR; + } + err = can_mcan_write_reg(dev, CAN_MCAN_CCCR, cccr); if (err != 0) { goto unlock; @@ -1055,6 +1131,21 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim } } + uint32_t cccr; + + err = can_mcan_read_reg(dev, CAN_MCAN_CCCR, &cccr); + if (err != 0) { + return err; + } + + if (cccr & CAN_MCAN_CCCR_DAR) { + /* + * TXBCR is cleared after TXBAR is set. Stop timer to ensure + * TXBCR is not read before TXBAR has been set. + */ + k_timer_stop(&data->txbcf_timer); + } + cbs->tx[put_idx].function = callback; cbs->tx[put_idx].user_data = user_data; @@ -1064,10 +1155,18 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim goto err_unlock; } + if (cccr & CAN_MCAN_CCCR_DAR) { + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + k_mutex_unlock(&data->tx_mtx); return 0; err_unlock: + if (cccr & CAN_MCAN_CCCR_DAR) { + k_timer_start(&data->txbcf_timer, TXBCF_TIMER_TIMEOUT, TXBCF_TIMER_TIMEOUT); + } + k_mutex_unlock(&data->tx_mtx); k_sem_give(&data->tx_sem); @@ -1420,6 +1519,8 @@ int can_mcan_init(const struct device *dev) k_mutex_init(&data->lock); k_mutex_init(&data->tx_mtx); k_sem_init(&data->tx_sem, cbs->num_tx, cbs->num_tx); + k_timer_init(&data->txbcf_timer, can_mcan_txbcf_timer_handler, NULL); + k_timer_user_data_set(&data->txbcf_timer, (void *)dev); if (config->common.phy != NULL && !device_is_ready(config->common.phy)) { LOG_ERR("CAN transceiver not ready"); @@ -1578,5 +1679,14 @@ int can_mcan_init(const struct device *dev) return err; } + /* + * Interrupt on every TX buffer cancellation finished event. + */ + reg = CAN_MCAN_TXBCIE_CFIE; + err = can_mcan_write_reg(dev, CAN_MCAN_TXBCIE, reg); + if (err != 0) { + return err; + } + return can_mcan_clear_mram(dev, 0, config->mram_size); } diff --git a/include/zephyr/drivers/can/can_mcan.h b/include/zephyr/drivers/can/can_mcan.h index c064cc87d0c1..c62b4009526c 100644 --- a/include/zephyr/drivers/can/can_mcan.h +++ b/include/zephyr/drivers/can/can_mcan.h @@ -1065,6 +1065,7 @@ struct can_mcan_data { struct k_mutex lock; struct k_sem tx_sem; struct k_mutex tx_mtx; + struct k_timer txbcf_timer; void *custom; } __aligned(4); From 0c7c6d4a12c515d1ff61458d49597563e415c9ed Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Fri, 12 Sep 2025 12:38:25 +0200 Subject: [PATCH 3142/3334] [nrf noup] tests: ram_context_for_isr: Disable KMU by default Disable the KMU by default for all the NRF54L and NRF71 devices for this test. With the current configuration this test is incompatible with the KMU because it changes the placement of the RAM in the linker files and this collides with the KMU logic. But it also does not need the KMU so there is no need to be there. This is a noup because the configuration (and KMU support) is only placed in ncs. Reverted and reapplied noup to maintain all changes in a single commit. The KMU dependency to reserve the top RAM address is planned to be done in dts (NCSDK-31980). Hopefully when this is done this noup can be removed. Signed-off-by: Georgios Vasilakis Signed-off-by: Robert Robinson (cherry picked from commit 206c0efa9be0b49e1ab7bffb09978da18368ba40) --- .../boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ++++++ .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ++++++ .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ++++++ .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ++++++ .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ++++++ .../boards/nrf7120pdk_nrf7120_cpuapp.conf | 6 ++++++ 6 files changed, 36 insertions(+) create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n From 8ada1e924b35a31afcaeeb6fa2c29843f7278a2a Mon Sep 17 00:00:00 2001 From: Marcin Szymczyk Date: Fri, 21 Feb 2025 16:59:33 +0100 Subject: [PATCH 3143/3334] [nrf noup] modules: hal_nordic: cleanup nrfx_config nrf-squash! [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS - Remove temporary workaround for SDC in nrfx's reserved resources. - Modify NCS reserved resources to use upstream version with additions instead of creating new file - Align filename Signed-off-by: Marcin Szymczyk (cherry picked from commit 81578337195c95dad6eccc88599f07e2e8bcc2bd) --- modules/hal_nordic/nrfx/Kconfig | 2 +- .../nrfx/nrfx_config_reserved_resources_ncs.h | 948 ------------------ .../nrfx/nrfx_reserved_resources_ncs.h | 217 ++++ 3 files changed, 218 insertions(+), 949 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h create mode 100644 modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index bc1d447c82f5..a908834b50e2 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -328,6 +328,6 @@ endmenu config NRFX_RESERVED_RESOURCES_HEADER string - default "nrfx_config_reserved_resources_ncs.h" + default "nrfx_reserved_resources_ncs.h" endmenu # "nrfx drivers" diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h deleted file mode 100644 index ec8a9acaf7b5..000000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources_ncs.h +++ /dev/null @@ -1,948 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ -#define NRFX_CONFIG_RESERVED_RESOURCES_H__ - -/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE130_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) - -/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside - * of the nrfx library. - */ -#define NRFX_GPIOTE131_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) - -/** @brief Bitmask that defines EGU instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_EGUS_USED 0 - -/** @brief Bitmask that defines TIMER instances that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_TIMERS_USED 0 - -/* If the GRTC system timer driver is to be used, prepare definitions required - * by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and - * NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree. - */ -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \ - (NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \ - ~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels)) -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \ - (DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \ - DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0)) -#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */ - -/* - * The enabled Bluetooth controller subsystem is responsible for providing - * definitions of the BT_CTLR_USED_* symbols used below in a file named - * bt_ctlr_used_resources.h and for adding its location to global include - * paths so that the file can be included here for all Zephyr libraries that - * are to be built. - */ -#if defined(CONFIG_BT_LL_SW_SPLIT) -#include -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#endif -#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ - -#if defined(CONFIG_BT_LL_SOFTDEVICE) -/* Define auxiliary symbols needed for SDC device dispatch. */ -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRF52_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRF53_SERIES -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#define NRF54L_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF71X) -#define NRF71_SERIES -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRF54H_SERIES -#endif -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ - (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) -#else -#error Unsupported chip family -#endif -#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ - -#if defined(CONFIG_NRF_802154_RADIO_DRIVER) -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#include <../src/nrf_802154_peripherals_nrf52.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#include <../src/nrf_802154_peripherals_nrf53.h> -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) -#include <../src/nrf_802154_peripherals_nrf54l.h> -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#include <../src/nrf_802154_peripherals_nrf54h.h> -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ - -#if defined(CONFIG_MPSL) -#include -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ - (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK -#else -#error Unsupported chip family -#endif -#endif - -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL -#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL -#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL -#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL -#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL -#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL -#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL -#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL -#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL -#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL -#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL -#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL -#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL -#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL -#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR -#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR -#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV -#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV -#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL -#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL -#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 -#endif - -#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL -#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 -#endif -#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL -#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 -#endif - -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 -#endif -#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL -#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 -#endif - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) - -BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & - NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_CHANNELS_USED \ - (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI0_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI0_GROUPS_USED \ - (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI0_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_CHANNELS_USED \ - (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI00_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI00_GROUPS_USED \ - (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI00_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_CHANNELS_USED \ - (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI10_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI10_GROUPS_USED \ - (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI10_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_CHANNELS_USED \ - (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI20_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI20_GROUPS_USED \ - (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI20_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_CHANNELS_USED \ - (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI30_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI30_GROUPS_USED \ - (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI30_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_CHANNELS_USED \ - (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI020_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI020_GROUPS_USED \ - (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI020_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_CHANNELS_USED \ - (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI030_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI030_GROUPS_USED \ - (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI030_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_CHANNELS_USED \ - (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI120_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI120_GROUPS_USED \ - (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI120_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_CHANNELS_USED \ - (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI130_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI130_GROUPS_USED \ - (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI130_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_CHANNELS_USED \ - (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI131_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI131_GROUPS_USED \ - (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI131_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_CHANNELS_USED \ - (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI132_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI132_GROUPS_USED \ - (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI132_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_CHANNELS_USED \ - (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI133_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI133_GROUPS_USED \ - (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI133_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_CHANNELS_USED \ - (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI134_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI134_GROUPS_USED \ - (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI134_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_CHANNELS_USED \ - (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI135_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI135_GROUPS_USED \ - (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI135_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_CHANNELS_USED \ - (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ - NRFX_DPPI136_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_DPPI136_GROUPS_USED \ - (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ - NRFX_DPPI136_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines PPI channels that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_CHANNELS_USED \ - (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL | NRFX_PPI_CHANNELS_USED_BY_SD) - -#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED -#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED - -/** @brief Bitmask that defines PPI groups that are reserved for use outside - * of the nrfx library. - */ -#define NRFX_PPI_GROUPS_USED \ - (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL | NRFX_PPI_GROUPS_USED_BY_SD) - -#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ - (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ - (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ - (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ - (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ - (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ - (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) - -#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ - (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ - NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) - -#if defined(CONFIG_SOFTDEVICE) -#include -#define NRFX_PPI_CHANNELS_USED_BY_SD SD_PPI_CHANNELS_USED -#define NRFX_PPI_GROUPS_USED_BY_SD SD_PPI_GROUPS_USED -#else -#define NRFX_PPI_CHANNELS_USED_BY_SD 0 -#define NRFX_PPI_GROUPS_USED_BY_SD 0 -#endif - -#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h new file mode 100644 index 000000000000..2c1fe3640493 --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_RESERVED_RESOURCES_NCS_H__ +#define NRFX_RESERVED_RESOURCES_NCS_H__ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + +#if defined(CONFIG_MPSL) +#include +#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + +#include "nrfx_reserved_resources.h" + +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ +#endif /* NRFX_RESERVED_RESOURCES_NCS_H__ */ From 270fa278d7fe87290bb85ad4c68ec6933992e8a4 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Wed, 19 Nov 2025 11:37:26 +0100 Subject: [PATCH 3144/3334] [nrf noup] dts: nordic: remove leftover file File no longer needed, can be removed. Signed-off-by: Jakub Zymelka (cherry picked from commit db78578bfdd2da618d9de8ca82a56c775725adf9) --- dts/vendor/nordic/nrf54l20.dtsi | 852 -------------------------------- 1 file changed, 852 deletions(-) delete mode 100644 dts/vendor/nordic/nrf54l20.dtsi diff --git a/dts/vendor/nordic/nrf54l20.dtsi b/dts/vendor/nordic/nrf54l20.dtsi deleted file mode 100644 index bee70effa0e8..000000000000 --- a/dts/vendor/nordic/nrf54l20.dtsi +++ /dev/null @@ -1,852 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -/delete-node/ &sw_pwm; - -/* Domain IDs. Can be used to specify channel links in IPCT nodes. */ -#define NRF_DOMAIN_ID_APPLICATION 0 -#define NRF_DOMAIN_ID_FLPR 1 - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@0 { - compatible = "arm,cortex-m33f"; - reg = <0>; - device_type = "cpu"; - clocks = <&hfpll>; - #address-cells = <1>; - #size-cells = <1>; - - itm: itm@e0000000 { - compatible = "arm,armv8m-itm"; - reg = <0xe0000000 0x1000>; - swo-ref-frequency = ; - }; - }; - - cpuflpr: cpu@1 { - compatible = "nordic,vpr"; - reg = <1>; - device_type = "cpu"; - riscv,isa = "rv32emc"; - nordic,bus-width = <64>; - }; - }; - - clocks { - pclk: pclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - pclk32m: pclk32m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfxo: lfxo { - compatible = "nordic,nrf54l-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf54l-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1650>; - }; - - hfpll: hfpll { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - aclk: aclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - ficr: ficr@ffc000 { - compatible = "nordic,nrf-ficr"; - reg = <0xffc000 0x1000>; - #nordic,ficr-cells = <1>; - }; - - uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; - reg = <0xffd000 0x1000>; - }; - - cpuapp_sram: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(447)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20000000 0x6fc00>; - }; - - cpuflpr_sram: memory@2006fc00 { - compatible = "mmio-sram"; - reg = <0x2006fc00 DT_SIZE_K(64)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2006fc00 0x10000>; - }; - - global_peripherals: peripheral@50000000 { - ranges = <0x0 0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - - dppic00: dppic@42000 { - compatible = "nordic,nrf-dppic"; - reg = <0x42000 0x808>; - status = "disabled"; - }; - - ppib00: ppib@44000 { - compatible = "nordic,nrf-ppib"; - reg = <0x44000 0x1000>; - status = "disabled"; - }; - - ppib01: ppib@45000 { - compatible = "nordic,nrf-ppib"; - reg = <0x45000 0x1000>; - status = "disabled"; - }; - - cpuflpr_vpr: vpr@4c000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x4c000 0x1000>; - ranges = <0x0 0x4c000 0x1000>; - #address-cells = <1>; - #size-cells = <1>; - status = "disabled"; - enable-secure; - - cpuflpr_clic: interrupt-controller@f0000000 { - compatible = "nordic,nrf-clic"; - reg = <0xf0000000 0x143c>; - interrupt-controller; - #interrupt-cells = <2>; - #address-cells = <1>; - status = "disabled"; - }; - }; - - spi00: spi@4d000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart00: uart@4d000 { - compatible = "nordic,nrf-uarte"; - reg = <0x4d000 0x1000>; - interrupts = <77 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - gpio2: gpio@50400 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x50400 0x300>; - #gpio-cells = <2>; - ngpios = <11>; - status = "disabled"; - port = <2>; - }; - - timer00: timer@55000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x55000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfpll>; - prescaler = <0>; - }; - - dppic10: dppic@82000 { - compatible = "nordic,nrf-dppic"; - reg = <0x82000 0x808>; - status = "disabled"; - }; - - ppib10: ppib@83000 { - compatible = "nordic,nrf-ppib"; - reg = <0x83000 0x1000>; - status = "disabled"; - }; - - ppib11: ppib@84000 { - compatible = "nordic,nrf-ppib"; - reg = <0x84000 0x1000>; - status = "disabled"; - }; - - timer10: timer@85000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0x85000 0x1000>; - cc-num = <8>; - max-bit-width = <32>; - interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - prescaler = <0>; - }; - - egu10: egu@87000 { - compatible = "nordic,nrf-egu"; - reg = <0x87000 0x1000>; - interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - radio: radio@8a000 { - compatible = "nordic,nrf-radio"; - reg = <0x8a000 0x1000>; - interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - dfe-supported; - ieee802154-supported; - ble-2mbps-supported; - ble-coded-phy-supported; - cs-supported; - - ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - bt_hci_sdc: bt_hci_sdc { - compatible = "nordic,bt-hci-sdc"; - status = "disabled"; - }; - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; - }; - - dppic20: dppic@c2000 { - compatible = "nordic,nrf-dppic"; - reg = <0xc2000 0x808>; - status = "disabled"; - }; - - ppib20: ppib@c3000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc3000 0x1000>; - status = "disabled"; - }; - - ppib21: ppib@c4000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc4000 0x1000>; - status = "disabled"; - }; - - ppib22: ppib@c5000 { - compatible = "nordic,nrf-ppib"; - reg = <0xc5000 0x1000>; - status = "disabled"; - }; - - i2c20: i2c@c6000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi20: spi@c6000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart20: uart@c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc6000 0x1000>; - interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c21: i2c@c7000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi21: spi@c7000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart21: uart@c7000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc7000 0x1000>; - interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c22: i2c@c8000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi22: spi@c8000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart22: uart@c8000 { - compatible = "nordic,nrf-uarte"; - reg = <0xc8000 0x1000>; - interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - egu20: egu@c9000 { - compatible = "nordic,nrf-egu"; - reg = <0xc9000 0x1000>; - interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - timer20: timer@ca000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xca000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer21: timer@cb000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcb000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer22: timer@cc000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcc000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer23: timer@cd000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xcd000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - timer24: timer@ce000 { - compatible = "nordic,nrf-timer"; - status = "disabled"; - reg = <0xce000 0x1000>; - cc-num = <6>; - max-bit-width = <32>; - interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <0>; - }; - - pdm20: pdm@d0000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd0000 0x1000>; - interrupts = <208 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pdm21: pdm@d1000 { - compatible = "nordic,nrf-pdm"; - status = "disabled"; - reg = <0xd1000 0x1000>; - interrupts = <209 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - pwm20: pwm@d2000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd2000 0x1000>; - interrupts = <210 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm21: pwm@d3000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd3000 0x1000>; - interrupts = <211 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - pwm22: pwm@d4000 { - compatible = "nordic,nrf-pwm"; - status = "disabled"; - reg = <0xd4000 0x1000>; - interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - idleout-supported; - }; - - adc: adc@d5000 { - compatible = "nordic,nrf-saadc"; - reg = <0xd5000 0x1000>; - interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - zephyr,pm-device-runtime-auto; - }; - - nfct: nfct@d6000 { - compatible = "nordic,nrf-nfct"; - reg = <0xd6000 0x1000>; - interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - temp: temp@d7000 { - compatible = "nordic,nrf-temp"; - reg = <0xd7000 0x1000>; - interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio1: gpio@d8200 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0xd8200 0x300>; - #gpio-cells = <2>; - ngpios = <16>; - status = "disabled"; - port = <1>; - gpiote-instance = <&gpiote20>; - }; - - gpiote20: gpiote@da000 { - compatible = "nordic,nrf-gpiote"; - reg = <0xda000 0x1000>; - status = "disabled"; - instance = <20>; - }; - - qdec20: qdec@e0000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe0000 0x1000>; - interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - qdec21: qdec@e1000 { - compatible = "nordic,nrf-qdec"; - reg = <0xe1000 0x1000>; - interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - grtc: grtc@e2000 { - compatible = "nordic,nrf-grtc"; - reg = <0xe2000 0x1000>; - cc-num = <12>; - clocks = <&lfxo>, <&pclk>; - clock-names = "lfclock", "hfclock"; - status = "disabled"; - }; - - tdm: tdm@e8000 { - compatible = "nordic,nrf-tdm"; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xe8000 0x1000>; - interrupts = <232 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - clocks = <&pclk32m>; - }; - - i2c23: i2c@ed000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi23: spi@ed000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart23: uart@ed000 { - compatible = "nordic,nrf-uarte"; - reg = <0xed000 0x1000>; - interrupts = <237 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - i2c24: i2c@ee000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi24: spi@ee000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart24: uart@ee000 { - compatible = "nordic,nrf-uarte"; - reg = <0xee000 0x1000>; - interrupts = <238 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - dppic30: dppic@102000 { - compatible = "nordic,nrf-dppic"; - reg = <0x102000 0x808>; - status = "disabled"; - }; - - ppib30: ppib@103000 { - compatible = "nordic,nrf-ppib"; - reg = <0x103000 0x1000>; - status = "disabled"; - }; - - i2c30: i2c@104000 { - compatible = "nordic,nrf-twim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <16>; - status = "disabled"; - zephyr,pm-device-runtime-auto; - }; - - spi30: spi@104000 { - /* - * This spi node can be either SPIM or SPIS, - * for the user to pick: - * compatible = "nordic,nrf-spim" or - * "nordic,nrf-spis". - */ - compatible = "nordic,nrf-spim"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - easydma-maxcnt-bits = <16>; - rx-delay-supported; - rx-delay = <1>; - status = "disabled"; - }; - - uart30: uart@104000 { - compatible = "nordic,nrf-uarte"; - reg = <0x104000 0x1000>; - interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - endtx-stoptx-supported; - frame-timeout-supported; - }; - - comp: comparator@106000 { - /* - * Use compatible "nordic,nrf-comp" to configure as COMP - * Use compatible "nordic,nrf-lpcomp" to configure as LPCOMP - */ - compatible = "nordic,nrf-comp"; - reg = <0x106000 0x1000>; - status = "disabled"; - interrupts = <262 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - wdt30: watchdog@108000 { - compatible = "nordic,nrf-wdt"; - reg = <0x108000 0x620>; - interrupts = <264 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - wdt31: watchdog@109000 { - compatible = "nordic,nrf-wdt"; - reg = <0x109000 0x620>; - interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - gpio0: gpio@10a000 { - compatible = "nordic,nrf-gpio"; - gpio-controller; - reg = <0x10a000 0x300>; - #gpio-cells = <2>; - ngpios = <5>; - status = "disabled"; - port = <0>; - gpiote-instance = <&gpiote30>; - }; - - gpiote30: gpiote@10c000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x10c000 0x1000>; - status = "disabled"; - instance = <30>; - }; - - clock: clock@10e000 { - compatible = "nordic,nrf-clock"; - reg = <0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - power: power@10e000 { - compatible = "nordic,nrf-power"; - reg = <0x10e000 0x1000>; - ranges = <0x0 0x10e000 0x1000>; - interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - gpregret1: gpregret1@51c { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x51c 0x1>; - status = "disabled"; - }; - - gpregret2: gpregret2@520 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "nordic,nrf-gpregret"; - reg = <0x520 0x1>; - status = "disabled"; - }; - }; - - regulators: regulator@120000 { - compatible = "nordic,nrf54l-regulators"; - reg = <0x120000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - - vregmain: regulator@120600 { - compatible = "nordic,nrf5x-regulator"; - reg = <0x120600 0x1>; - status = "disabled"; - regulator-name = "VREGMAIN"; - regulator-initial-mode = ; - }; - }; - }; - - rram_controller: rram-controller@5004e000 { - compatible = "nordic,rram-controller"; - reg = <0x5004e000 0x1000>; - interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_rram: rram@0 { - compatible = "soc-nv-flash"; - reg = <0x0 DT_SIZE_K(1972)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - - cpuflpr_rram: rram@1ed000 { - compatible = "soc-nv-flash"; - reg = <0x1ed000 DT_SIZE_K(64)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_nvic: interrupt-controller@e000e100 { - #address-cells = <1>; - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - }; - }; -}; From 1f8a7e29f3d588486ce06e66c804f5516b4d3db8 Mon Sep 17 00:00:00 2001 From: Kacper Radoszewski Date: Thu, 27 Nov 2025 08:57:56 +0100 Subject: [PATCH 3145/3334] [nrf noup] include: net: add TLS_DTLS_FRAG_EXT to NCS extensions nrf-squash! [nrf noup] include: net: add NCS extensions The TLS_DTLS_FRAG_EXT socket option is used to enable and disable the DTLS fragmentation extension. Signed-off-by: Kacper Radoszewski (cherry picked from commit b3e6816fa807b57dca1ffa0c95bd9076c5ffb37a) --- include/zephyr/net/socket_ncs.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h index 6a77d6c41f13..7c8bae645f6c 100644 --- a/include/zephyr/net/socket_ncs.h +++ b/include/zephyr/net/socket_ncs.h @@ -69,6 +69,27 @@ extern "C" { #define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 #define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 +/** Socket option to enable the DTLS fragmentation extension. + * Accepted values for the option are: @ref DTLS_FRAG_EXT_DISABLED, + * @ref DTLS_FRAG_EXT_512_ENABLED, @ref DTLS_FRAG_EXT_1024_ENABLED. + */ +#define TLS_DTLS_FRAG_EXT (NET_SOCKET_NCS_BASE + 22) + +/** Disabled - The DTLS fragmentation extension is not included in the Client Hello. */ +#define DTLS_FRAG_EXT_DISABLED 0 +/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment + * size of 512 bytes. + * + * @note The user data size in send requests also becomes limited to a maximum of 512 bytes. + */ +#define DTLS_FRAG_EXT_512_ENABLED 1 +/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment + * size of 1024 bytes. + * + * @note The user data size in send requests also becomes limited to a maximum of 1024 bytes. + */ +#define DTLS_FRAG_EXT_1024_ENABLED 2 + /* NCS specific socket options */ /** sockopt: enable sending data as part of exceptional events */ From 3b58489d936842a670474a11d2a2d0d38231ed3b Mon Sep 17 00:00:00 2001 From: Georgios Vasilakis Date: Tue, 30 Sep 2025 10:48:18 +0200 Subject: [PATCH 3146/3334] [nrf noup] soc: nordic: Support TF-M for poweroff Enable going to system off when the TF-M API is available. This calls the relevant TF-M platform API to enter system off mode using TF-M. This is a noup because the TF-M service for system off is currently located in sdk-nrf only. This is meant to be a short lived commit, work is already ongoing to upstream an official TF-M system off solution that can be be added to upstream Zephyr. Signed-off-by: Georgios Vasilakis (cherry picked from commit 1ccd687ded0cc174e6329fbaf5dda7af5f489a2c) --- soc/nordic/common/poweroff.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/soc/nordic/common/poweroff.c b/soc/nordic/common/poweroff.c index ecdde3aa2adf..bb64459bf82b 100644 --- a/soc/nordic/common/poweroff.c +++ b/soc/nordic/common/poweroff.c @@ -7,7 +7,9 @@ #include #include -#if defined(CONFIG_SOC_SERIES_NRF51) || defined(CONFIG_SOC_SERIES_NRF52) +#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) +#include "tfm_platform_api.h" +#elif defined(CONFIG_SOC_SERIES_NRF51) || defined(CONFIG_SOC_SERIES_NRF52) #include #elif defined(CONFIG_NRF_PLATFORM_HALTIUM) #include @@ -30,6 +32,10 @@ void z_sys_poweroff(void) { +#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE) + tfm_platform_system_off(); +#else + #if defined(CONFIG_HAS_NORDIC_RAM_CTRL) uint8_t *ram_start; size_t ram_size; @@ -78,5 +84,7 @@ void z_sys_poweroff(void) nrf_regulators_system_off(NRF_REGULATORS); #endif +#endif /* CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE */ + CODE_UNREACHABLE; } From 4609b8f2bee1b1a763f5b2a57f8329f43d8c3506 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 14:30:18 +0100 Subject: [PATCH 3147/3334] [nrf noup] test-spec: update CI-test-low-level nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular folder selection. Signed-off-by: Piotr Kosycarz (cherry picked from commit e3a52be45cf5b225379e26bc30ac24ae449e8edb) --- .github/test-spec.yml | 92 ++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 28 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 5fdf9c0ca782..14519ac3a149 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -367,35 +367,71 @@ - "drivers/sensor/sensor_shell.c" "CI-test-low-level": - - "arch/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf53*" + - "!soc/nordic/nrf9*" + - "arch/arm/**/*" + - "arch/riscv/**/*" - "boards/nordic/nrf54*/**/*" - - "drivers/**/*" - - "dts/**/*" - - "include/zephyr/**/*" - - "kernel/**/*" + - "drivers/adc/**/*" + - "drivers/cache/**/*" + - "drivers/clock_control/**/*" + - "drivers/comparator/**/*" + - "drivers/counter/**/*" + - "drivers/flash/**/*" + - "drivers/gpio/**/*" + - "drivers/hwinfo/**/*" + - "drivers/i2c/**/*" + - "drivers/i2s/**/*" + - "drivers/interrupt_controller/**/*" + - "drivers/mbox/**/*" + - "drivers/mspi/**/*" + - "drivers/pinctrl/**/*" + - "drivers/power_domain/**/*" + - "drivers/pwm/**/*" + - "drivers/retained_mem/**/*" + - "drivers/rtc/**/*" + - "drivers/serial/**/*" + - "drivers/spi/**/*" + - "drivers/timer/**/*" + - "drivers/usb/**/*" + - "drivers/watchdog/**/*" + - any: + - "dts/vendor/nordic/**/*" + - "!dts/vendor/nordic/nrf52*" + - "!dts/vendor/nordic/nrf53*" + - "!dts/vendor/nordic/nrf9*" - "modules/hal_nordic/**/*" - - "samples/basic/blinky_pwm/**/*" - - "samples/basic/fade_led/**/*" - - "samples/boards/nrf/**/*" - "samples/boards/nordic/**/*" - - "samples/drivers/adc/**/*" - - "samples/drivers/jesd216/**/*" - - "samples/drivers/mbox/**/*" - - "samples/drivers/soc_flash_nrf/**/*" - - "samples/drivers/spi_flash/**/*" - - "samples/drivers/watchdog/**/*" - - "samples/hello_world/**/*" - - "samples/sensor/**/*" - - "samples/subsys/ipc/**/*" - - "samples/subsys/logging/**/*" - - "samples/subsys/settings/**/*" - - "samples/subsys/usb/cdc_acm/**/*" - - "samples/subsys/usb/mass/**/*" - - "samples/synchronization/**/*" - - "subsys/logging/**/*" - - "subsys/settings/**/*" - - "tests/arch/**/*" + - "tests/arch/arm/**/*" - "tests/boards/nrf/**/*" - - "tests/boards/nordic/**/*" - - "tests/drivers/**/*" - - "tests/kernel/**/*" + - "tests/drivers/adc/**/*" + - "tests/drivers/clock_control/**/*" + - "tests/drivers/comparator/**/*" + - "tests/drivers/counter/**/*" + - "tests/drivers/flash/**/*" + - "tests/drivers/gpio/**/*" + - "tests/drivers/hwinfo/**/*" + - "tests/drivers/i2c/**/*" + - "tests/drivers/i2s/**/*" + - "tests/drivers/interrupt_controller/**/*" + - "tests/drivers/mbox/**/*" + - "tests/drivers/mspi/**/*" + - "tests/drivers/pinctrl/**/*" + - "tests/drivers/pwm/**/*" + - "tests/drivers/retained_mem/**/*" + - "tests/drivers/rtc/**/*" + - "tests/drivers/spi/**/*" + - "tests/drivers/timer/**/*" + - "tests/drivers/uart/**/*" + - "tests/drivers/watchdog/**/*" + - "tests/kernel/common/**/*" + - "tests/kernel/context/**/*" + - "tests/kernel/fatal/**/*" + - "tests/kernel/fpu_sharing/**/*" + - "tests/kernel/gen_isr_table/**/*" + - "tests/kernel/interrupt/**/*" + - "tests/kernel/sched/preempt/**/*" From 9b9560e40825529fd8795ec564ccca0835d4b091 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 14:38:41 +0100 Subject: [PATCH 3148/3334] [nrf noup] test-spec: update CI-audio-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml CI-audio-test more specific at soc/nordic. Signed-off-by: Piotr Kosycarz (cherry picked from commit 652f1554c75ac14de8a81092b6e5b118fd04a41e) --- .github/test-spec.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 14519ac3a149..483f135b03e2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -345,7 +345,12 @@ - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - "samples/bluetooth/hci_ipc/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf54*" + - "!soc/nordic/nrf9*" - "subsys/bluetooth/audio/**/*" - "subsys/bluetooth/host/**/*" - "subsys/dfu/**/*" From 1a436ab5b085ced8576be77223c6a408e4a7b656 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:12:06 +0100 Subject: [PATCH 3149/3334] [nrf noup] test-spec: update CI-find-my-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular for soc and boards. Signed-off-by: Piotr Kosycarz (cherry picked from commit 01485da73ae12e94edd4f472cac3798dc832a4db) --- .github/test-spec.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 483f135b03e2..db9cac90e17f 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -271,13 +271,19 @@ - "!subsys/bluetooth/audio/**/*" "CI-find-my-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf52840dk/**/*" + - "boards/nordic/nrf5340dk/**/*" + - "boards/nordic/nrf54l15dk/**/*" - "drivers/bluetooth/**/*" - "drivers/entropy/**/*" - "drivers/flash/**/*" - "drivers/usb/**/*" - "drivers/regulator/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/dfu/**/*" - "subsys/fs/**/*" - "subsys/ipc/**/*" From b5dcce667c797c9d2a9be4ca413dda27fbdbbdcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ga=C5=82da?= Date: Wed, 3 Dec 2025 12:57:48 +0100 Subject: [PATCH 3150/3334] [nrf noup] ci: Dynamically set target branch for manifest PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrf-squash! [nrf noup] ci: add default permissions nrf-squash! [nrf noup] ci: add reopen for manifest-pr action nrf-squash! [nrf noup] ci: Enable action-manifest-pr Dynamically set target branch for manifest PRs Signed-off-by: Jan Gałda (cherry picked from commit f481af0553fcd55e0e7b129e7ec4ed96f6959a17) --- .github/workflows/manifest-PR.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/manifest-PR.yml b/.github/workflows/manifest-PR.yml index 0f3bd738a36c..6e2430ec901e 100644 --- a/.github/workflows/manifest-PR.yml +++ b/.github/workflows/manifest-PR.yml @@ -4,6 +4,7 @@ on: types: [opened, synchronize, closed, reopened] branches: - main + - ncs-v*-branch permissions: contents: read @@ -11,9 +12,28 @@ permissions: jobs: call-manifest-pr-action: runs-on: ubuntu-latest + outputs: + base-branch: ${{ steps.set-base-branch.outputs.base_branch }} steps: + # Determine the base branch: + # * sdk-zephyr/main -> sdk-nrf/main + # * sdk-zephyr/ncs-vX.Y-branch -> sdk-nrf/vX.Y-branch + - name: Set base branch + id: set-base-branch + run: | + if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then + echo "base_branch=main" >> "$GITHUB_OUTPUT" + elif [[ "${{ github.event.pull_request.base.ref }}" =~ ^ncs-(v[0-9]+\.[0-9]+-branch)$ ]]; then + branch_name="${{ github.event.pull_request.base.ref }}" + branch_name="${branch_name#ncs-}" + echo "base_branch=${branch_name}" >> "$GITHUB_OUTPUT" + else + echo "Error: Unsupported base branch: ${{ github.event.pull_request.base.ref }}" >&2 + exit 1 + fi - name: handle manifest PR uses: nrfconnect/action-manifest-pr@main with: token: ${{ secrets.NCS_GITHUB_TOKEN }} manifest-pr-title-details: ${{ github.event.pull_request.title }} + base-branch: ${{ steps.set-base-branch.outputs.base_branch }} From 85497c4a4f14a33859dd29ae42a76241e8b02869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ga=C5=82da?= Date: Fri, 5 Dec 2025 16:04:23 +0100 Subject: [PATCH 3151/3334] [nrf noup] ci: Use NordicBuilder to open backport PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport PRs opened by github-actions[bot] do not trigger action which opens sdk-nrf PR with manifest update Signed-off-by: Jan Gałda (cherry picked from commit 1075a7ab701cf1dff1fbfe4307e8e289277cd3d5) --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 3ecf66b17da9..402341a9c389 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -33,6 +33,6 @@ jobs: - name: Backport uses: zephyrproject-rtos/action-backport@7e74f601d11eaca577742445e87775b5651a965f # v2.0.3-3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.NCS_GITHUB_TOKEN }} issue_labels: Backport labels_template: '["Backport"]' From 9ddca712b592e09ded7036658849c0fc27c35a45 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:16:14 +0100 Subject: [PATCH 3152/3334] [nrf noup] test-spec: update CI-cloud-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit 0b57fe968cecd3a1f66f1fa01d0bf534e6d15755) --- .github/test-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index db9cac90e17f..00a75b24d829 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -332,7 +332,7 @@ - "drivers/serial/**/*" - "drivers/wifi/**/*" - "lib/posix/**/*" - - "soc/nordic/**/*" + - "soc/nordic/nrf9*/*" - "subsys/dfu/**/*" - "subsys/net/**/*" - "subsys/settings/**/*" From 0c675ce5734546c1bc4ff6cc7babceffaa73f57e Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 18 Dec 2025 15:20:23 +0100 Subject: [PATCH 3153/3334] [nrf noup] test-spec: update CI-nfc-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit f590e77e111b0e4e01decb33527e1a226a890501) --- .github/test-spec.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 00a75b24d829..09d7b372bfca 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -242,7 +242,10 @@ - "drivers/spi/**/*" - "lib/crc/**/*" - "modules/hal_nordic/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf9*" - "subsys/ipc/ipc_service/**/*" - "subsys/fs/**/*" - "subsys/mem_mgmt/**/*" From 41d0a7387bb4e9e6370c6623ff1b9affcb117531 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:49:13 +0100 Subject: [PATCH 3154/3334] [nrf noup] test-spec: update CI-rs-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at board. Signed-off-by: Piotr Kosycarz (cherry picked from commit 3eb6d829f7c066b7f5a2a1b0a2e4d07b1d7014e5) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 09d7b372bfca..554b15bc2476 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -203,7 +203,11 @@ - "CMakeLists.txt" "CI-rs-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf21540dk*" + - "boards/nordic/nrf52833dk*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From 575524b23de614edc31057f68e8a5f6a1a24a5e6 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:51:19 +0100 Subject: [PATCH 3155/3334] [nrf noup] test-spec: update CI-fem-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz (cherry picked from commit 16b0fe1edb2fb7f05bd7c881a3945edc575c2e9c) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 554b15bc2476..27e81cd357e7 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -180,7 +180,11 @@ - "modules/mbedtls/**/*" "CI-fem-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf21540dk*" + - "boards/nordic/nrf52833dk*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/hci/**/*" - "drivers/entropy/**/*" - "dts/bindings/**/*" From 5c0899ad7000e24d05d571cb57fa64455c85bfe5 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:58:09 +0100 Subject: [PATCH 3156/3334] [nrf noup] test-spec: update CI-boot-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz (cherry picked from commit 01db4e609927e92b4a77c2396d286a41cfbd9838) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 27e81cd357e7..1c45698e423d 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -39,7 +39,11 @@ # Not necessary to run tests on changes to this repo. "CI-boot-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf52840dk*" + - "boards/nordic/nrf5340dk*" + - "boards/nordic/nrf54h20dk*" + - "boards/nordic/nrf54l*" + - "boards/nordic/nrf9160dk*" - "subsys/mgmt/mcumgr/**/*" - "subsys/dfu/**/*" - "include/mgmt/mcumgr/**/*" From d97fa62f753cd2ef991fb206a27bbe5dd2544239 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:58:38 +0100 Subject: [PATCH 3157/3334] [nrf noup] test-spec: update CI-dfu-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at boards. Signed-off-by: Piotr Kosycarz (cherry picked from commit ddf21391242f21c6faeabd00ed9e2b10cfc35301) --- .github/test-spec.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 1c45698e423d..af7db8adce71 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -54,7 +54,8 @@ - "tests/subsys/mgmt/mcumgr/**/*" "CI-dfu-test": - - "boards/nordic/**/*" + - "boards/nordic/nrf54h20dk*" + - "boards/nordic/nrf54l*" - "drivers/bluetooth/**/*" - "drivers/console/**/*" - "drivers/flash/**/*" From ab1c8e79e55903b5ff57c75dfd605dc679a4eca8 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Fri, 9 Jan 2026 11:35:33 +0100 Subject: [PATCH 3158/3334] [nrf noup] test-spec: update CI-ble-samples-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml Depend on actual used socs. Zephyr ble samples are not executed at all. Signed-off-by: Piotr Kosycarz (cherry picked from commit 001f6d37d5cb33fa9cd29b0c0da521ec36e954f1) --- .github/test-spec.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index af7db8adce71..7588b157337a 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -115,7 +115,9 @@ - any: - "drivers/bluetooth/**/*" - any: - - "dts/arm/nordic/nrf5*" + - "dts/arm/nordic/nrf52*" + - "dts/arm/nordic/nrf53*" + - "dts/arm/nordic/nrf54*" - any: - "subsys/bluetooth/**/*" - "!subsys/bluetooth/mesh/**/*" @@ -123,7 +125,6 @@ - any: - "include/zephyr/bluetooth/**/*" - "!include/zephyr/bluetooth/mesh/**/*" - - "samples/bluetooth/**/*" "CI-mesh-test": - "subsys/bluetooth/mesh/**/*" From d50de6368cfe92858be634fb75977df77325e578 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:29:12 +0100 Subject: [PATCH 3159/3334] [nrf noup] test-spec: update CI-rs-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit f3f1f1664f30a33bf176e35bba0f91f5d5f5d5ce) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 7588b157337a..79064e3febd0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -231,7 +231,11 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 33670413ea041dea521beb8586cae59fc8a01021 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:30:48 +0100 Subject: [PATCH 3160/3334] [nrf noup] test-spec: update CI-thread-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit 28c3c0e4507b7cd7f9f38ad7e69eb8f182d6c1e2) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 79064e3febd0..df4166d8e6b0 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -248,7 +248,11 @@ - "modules/mbedtls/**/*" - "modules/openthread/**/*" - "samples/net/openthread/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" From 2f897601b1e7d539859fe7e0d06677f67c963da2 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:32:37 +0100 Subject: [PATCH 3161/3334] [nrf noup] test-spec: update CI-matter-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit de24a82dab8f31b68d1405a9524d8f1325a61ca0) --- .github/test-spec.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index df4166d8e6b0..aac297f11412 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -283,7 +283,12 @@ "CI-matter-test": - "include/dfu/**/*" - "include/mgmt/mcumgr/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf52*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/dfu/**/*" - "subsys/settings/**/*" - "subsys/net/**/*" From 57971d547d10d382407b77cedb17734f314fafbf Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:34:16 +0100 Subject: [PATCH 3162/3334] [nrf noup] test-spec: update CI-fem-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. Signed-off-by: Piotr Kosycarz (cherry picked from commit 7ed22d94fee4cd8c02c9a80697488c4bc0548130) --- .github/test-spec.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index aac297f11412..d91e0f0bd3a2 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -204,7 +204,11 @@ - "modules/trusted-firmware-m/**/*" - "samples/net/sockets/echo_*/**/*" - "share/**/*" - - "soc/nordic/**/*" + - any: + - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf54h*" + - "!soc/nordic/nrf9*" - "subsys/net/**/*" - "subsys/settings/**/*" - "subsys/bluetooth/shell/**/*" From 2aa889f210b1c969ebbf97cf4b98b9d24e344917 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 8 Jan 2026 14:37:20 +0100 Subject: [PATCH 3163/3334] [nrf noup] test-spec: update CI-ble-test nrf-squash! [nrf noup] ci: add .github/test-spec.yml More granular at soc. test-ble is not validating nrf51 and nrf91, so it does not make sense to trigger ci on these changes. Signed-off-by: Piotr Kosycarz (cherry picked from commit 1ec4eaf22f2c3b21a9dc21f066d8e12ac5bfe0af) --- .github/test-spec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index d91e0f0bd3a2..ecf8102649dc 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -108,6 +108,8 @@ - "boards/nordic/nrf5*" - any: - "soc/nordic/**/*" + - "!soc/nordic/nrf51*" + - "!soc/nordic/nrf9*" - any: - "subsys/pm/**/*" From 4e5124a1f3e8791f6da6758de3964f0019814629 Mon Sep 17 00:00:00 2001 From: Jorgen Kvalvaag Date: Fri, 9 Jan 2026 12:13:21 +0100 Subject: [PATCH 3164/3334] [nrf noup] test-spec: Reduce thingy91 scope Reduce thingy91 test scope. Signed-off-by: Jorgen Kvalvaag (cherry picked from commit 625f5ace806127b0c0674174b6dc945064ef17d5) --- .github/test-spec.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index ecf8102649dc..fc74207ebd5f 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -149,14 +149,9 @@ - "drivers/net/**/*" - "drivers/serial/**/*" - "drivers/timer/**/*" - - "include/**/*" - - "kernel/**/*" - "lib/libc/common/source/stdlib/**/*" - "lib/libc/newlib/**/*" - "lib/libc/picolibc/**/*" - - "lib/os/**/*" - - "lib/posix/**/*" - - "misc/**/*" - "modules/mbedtls/**/*" - "soc/x86/ia32/**/*" - "subsys/fs/fcb/**/*" From 0042225b5aa60fc6d0fd220f0b21769cdec2dd48 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 20 Jan 2026 11:39:47 +0200 Subject: [PATCH 3165/3334] [nrf noup] tests: benchmark: mbedtls: remove ARIA/Camellia ciphers nrf-squash! [nrf noup] mbedtls: Remove unsupported algorithms in PSA crypto They are not supported in NCS. Remove their use from the test. Signed-off-by: Tomi Fontanilles (cherry picked from commit 7695db46f30eb72c64feb7fd21a5a7565538b301) --- tests/benchmarks/mbedtls/prj.conf | 2 -- tests/benchmarks/mbedtls/src/benchmark.c | 24 ------------------------ 2 files changed, 26 deletions(-) diff --git a/tests/benchmarks/mbedtls/prj.conf b/tests/benchmarks/mbedtls/prj.conf index ba24d6663924..944544eed5a3 100644 --- a/tests/benchmarks/mbedtls/prj.conf +++ b/tests/benchmarks/mbedtls/prj.conf @@ -11,8 +11,6 @@ CONFIG_PSA_WANT_ALG_SHA_384=y CONFIG_PSA_WANT_ALG_SHA_512=y CONFIG_PSA_WANT_KEY_TYPE_AES=y -CONFIG_PSA_WANT_KEY_TYPE_ARIA=y -CONFIG_PSA_WANT_KEY_TYPE_CAMELLIA=y CONFIG_PSA_WANT_ALG_ECB_NO_PADDING=y CONFIG_MAIN_STACK_SIZE=4096 diff --git a/tests/benchmarks/mbedtls/src/benchmark.c b/tests/benchmarks/mbedtls/src/benchmark.c index 890652d14a4e..02e9ec2171c2 100644 --- a/tests/benchmarks/mbedtls/src/benchmark.c +++ b/tests/benchmarks/mbedtls/src/benchmark.c @@ -112,30 +112,6 @@ int main(void) printk("Failed to import AES key (%d)", status); } - status = make_cipher_key(PSA_KEY_TYPE_ARIA, PSA_ALG_ECB_NO_PADDING, &key_id); - if (status == PSA_SUCCESS) { - COMPUTE_THROUGHPUT("ARIA-256-ECB", - psa_cipher_encrypt(key_id, PSA_ALG_ECB_NO_PADDING, - in_buf, sizeof(in_buf), - out_buf, sizeof(out_buf), &out_len) - ); - psa_destroy_key(key_id); - } else { - printk("Failed to import ARIA key (%d)", status); - } - - status = make_cipher_key(PSA_KEY_TYPE_CAMELLIA, PSA_ALG_ECB_NO_PADDING, &key_id); - if (status == PSA_SUCCESS) { - COMPUTE_THROUGHPUT("CAMELLIA-256-ECB", - psa_cipher_encrypt(key_id, PSA_ALG_ECB_NO_PADDING, - in_buf, sizeof(in_buf), - out_buf, sizeof(out_buf), &out_len) - ); - psa_destroy_key(key_id); - } else { - printk("Failed to import Camellia key (%d)", status); - } - printk("Benchmark completed\n"); return 0; } From 82e04d9dcdf9e61b1f228e49e17da4a029739047 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 22 Jan 2026 07:31:24 +0100 Subject: [PATCH 3166/3334] [nrf noup] modules: hal_nordic: Update SOC_SERIES_NRF*X Kconfig to remove X nrf-squash! [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS The Kconfig was changed upstream. Align usage in our noups. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 8f08a9a21c56b8ff3e7b6c1bfdbabb370c90392d) --- modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h index 2c1fe3640493..26e8ea67cbea 100644 --- a/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h +++ b/modules/hal_nordic/nrfx/nrfx_reserved_resources_ncs.h @@ -13,12 +13,12 @@ #define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK #elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) #define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71) #define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK #define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK #define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#elif defined(CONFIG_SOC_SERIES_NRF54H) #define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK #define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK #define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ @@ -34,12 +34,12 @@ #define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK #elif defined(CONFIG_SOC_COMPATIBLE_NRF53X) #define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK -#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71X) +#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF71) #define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK #define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK #define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) -#elif defined(CONFIG_SOC_SERIES_NRF54HX) +#elif defined(CONFIG_SOC_SERIES_NRF54H) #define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK #else #error Unsupported chip family From 036f8419b04aefe6a161961034a09817f70ae839 Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 22 Jan 2026 07:31:24 +0100 Subject: [PATCH 3167/3334] [nrf noup] samples: sysbuild: Update SOC_SERIES_NRF*X Kconfig to remove X nrf-squash! [nrf noup] samples: sysbuild: hello_world: support PM on nRF53 The Kconfig was changed upstream. Align usage in our noups. Signed-off-by: Grzegorz Swiderski (cherry picked from commit 4d28ae74aaada42e84c63fa53e4ab12094a007cb) --- samples/sysbuild/hello_world/sysbuild.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index 654c4175faac..b86a7659fdd6 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -9,12 +9,12 @@ if(DEFINED SB_CONFIG_REMOTE_BOARD) BOARD_REVISION ${BOARD_REVISION} ) - if(SB_CONFIG_SOC_SERIES_NRF53X) + if(SB_CONFIG_SOC_SERIES_NRF53) set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUNET) set_property(GLOBAL APPEND PROPERTY PM_CPUNET_IMAGES remote) set_property(GLOBAL PROPERTY DOMAIN_APP_CPUNET remote) set(CPUNET_PM_DOMAIN_DYNAMIC_PARTITION remote CACHE INTERNAL "") - else(SB_CONFIG_SOC_SERIES_NRF54LX) + else(SB_CONFIG_SOC_SERIES_NRF54L) set_property(GLOBAL APPEND PROPERTY PM_DOMAINS CPUFLPR) set_property(GLOBAL APPEND PROPERTY PM_CPUFLPR_IMAGES remote) set_property(GLOBAL PROPERTY DOMAIN_APP_CPUFLPR remote) From b4a13fd8887e2817391115c3c2fa681c2284f1f2 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 22 Jan 2026 07:31:16 +0000 Subject: [PATCH 3168/3334] [nrf noup] sysbuild: Disable slot1 variant when PM is used nrf-squash! [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions This feature conflicts with PM, prevent it being used when PM is enabled Signed-off-by: Jamie McCrae (cherry picked from commit 9a111ef8fb1a615996e69833bbd9468a150bd28a) --- share/sysbuild/images/bootloader/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/share/sysbuild/images/bootloader/Kconfig b/share/sysbuild/images/bootloader/Kconfig index 40790490cda6..01849e54210e 100644 --- a/share/sysbuild/images/bootloader/Kconfig +++ b/share/sysbuild/images/bootloader/Kconfig @@ -153,6 +153,7 @@ endchoice config MCUBOOT_DIRECT_XIP_GENERATE_VARIANT bool "Generate slot 1 variant image [EXPERIMENTAL]" depends on MCUBOOT_MODE_DIRECT_XIP || MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT + depends on !PARTITION_MANAGER select EXPERIMENTAL default y help From fc63eb48d5effa4f721aa6813a4da58f126ff9dc Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 22 Jan 2026 07:59:43 +0000 Subject: [PATCH 3169/3334] [nrf noup] soc: nordic: common: Fix updated SoC series Kconfig nrf-squash! [nrf noup] dts: choose a crypto accelerator for entropy Also the underlying patch should never have been added to sdk-zephyr Signed-off-by: Jamie McCrae (cherry picked from commit aeccbe456ff7cd83e54841681a3a31d6c2b1feb9) --- soc/nordic/common/Kconfig.peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index dd1da546ab8b..0ae024e00bef 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -14,7 +14,7 @@ config HAS_HW_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) + ($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91) config HAS_HW_NRF_CC312 def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \ From 0b678644a998244e3c6279158b9450fc973936d0 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 22 Jan 2026 14:48:31 +0000 Subject: [PATCH 3170/3334] [nrf noup] boards: nordic: nrf7002dk: Fix include files nrf-squash! [nrf noup] boards: nordic: nrf7002dk: Bring back NS variants Fixes include files so that they use the new updated paths Signed-off-by: Jamie McCrae (cherry picked from commit 529a26dc1884a96a687035f781007b0fab333af2) --- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 2 +- boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts index 5ff28accf3fc..ac863872d55d 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "nrf5340_cpuapp_common.dtsi" / { diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 9c06a17ad7bf..8225e992bb82 100644 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "nrf5340_cpuapp_common.dtsi" #include "nordic/nrf5340_sram_partition.dtsi" #include "nordic/nrf5340_cpuapp_ns_partition.dtsi" From 099c0580a93154a49be772141f7724c46fc00ba4 Mon Sep 17 00:00:00 2001 From: Mirko Covizzi Date: Thu, 10 Mar 2022 00:25:50 -0800 Subject: [PATCH 3171/3334] [nrf noup] net: mqtt: add native TLS support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make MQTT `set_native_tls` option work w/o socket dispatcher enabled. Signed-off-by: Mirko Covizzi Signed-off-by: Robert Lubos Signed-off-by: Tomasz Moń (cherry picked from commit 8025e2ec04a513acfae96d0561486b0d278ec53b) --- subsys/net/lib/mqtt/mqtt_transport_socket_tls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c index 7151c6b14f60..57a3138a949a 100644 --- a/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c +++ b/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c @@ -23,10 +23,15 @@ int mqtt_client_tls_connect(struct mqtt_client *client) { const struct net_sockaddr *broker = client->broker; struct mqtt_sec_config *tls_config = &client->transport.tls.config; + int type = NET_SOCK_STREAM; int ret; + if (!IS_ENABLED(CONFIG_NET_SOCKETS_OFFLOAD_DISPATCHER) && tls_config->set_native_tls) { + type |= SOCK_NATIVE_TLS; + } + client->transport.tls.sock = zsock_socket(broker->sa_family, - NET_SOCK_STREAM, NET_IPPROTO_TLS_1_2); + type, NET_IPPROTO_TLS_1_2); if (client->transport.tls.sock < 0) { return -errno; } From baafe81840cb81b2eca04fe6bc57391d0a7dae3a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 14:14:39 +0000 Subject: [PATCH 3172/3334] [nrf noup] scripts: ci: check_compliance: Fix ruff issues part 1 nrf-squash! [nrf noup] scripts: ci: check_compliance: Check Kconfigs for enable Fixes some issues that ruff is now showing Signed-off-by: Jamie McCrae (cherry picked from commit 6e235065f405d60ab6ce3bf258280f57e2ec31b1) --- scripts/ci/check_compliance.py | 43 +++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 439eebe6dd5d..1796e3f73b9c 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -710,13 +710,37 @@ class KconfigCheck(ComplianceTest): # This block list contains a list of upstream Zephyr modules that should not be checked # DO NOT MERGE CHANGES TO THIS WITHOUT BUILD SYSTEM AND CODE OWNER APPROVAL! - external_module_name_block_list = ['canopennode', 'chre', 'cmsis', 'cmsis-dsp', 'cmsis-nn', - 'cmsis_6', 'edtt', 'fatfs', 'hal_st', 'hal_tdk', - 'hal_wurthelektronik', 'liblc3', 'libmetal', 'littlefs', - 'loramac-node', 'lvgl', 'lz4', 'mipi-sys-t', 'nanopb', - 'net-tools', 'nrf_hw_models', 'open-amp', 'percepio', - 'picolibc', 'segger', 'tf-m-tests', 'tinycrypt', - 'uoscore-uedhoc', 'zscilib'] + external_module_name_block_list = [ + 'canopennode', + 'chre', + 'cmsis', + 'cmsis-dsp', + 'cmsis-nn', + 'cmsis_6', + 'edtt', + 'fatfs', + 'hal_st', + 'hal_tdk', + 'hal_wurthelektronik', + 'liblc3', + 'libmetal', + 'littlefs', + 'loramac-node', + 'lvgl', + 'lz4', + 'mipi-sys-t', + 'nanopb', + 'net-tools', + 'nrf_hw_models', + 'open-amp', + 'percepio', + 'picolibc', + 'segger', + 'tf-m-tests', + 'tinycrypt', + 'uoscore-uedhoc', + 'zscilib', + ] # Holds a list or directories/files which should not be checked blocked_module_dirs = [] @@ -1378,8 +1402,9 @@ def check_no_enable_in_boolean_prompt(self, kconf): for module_name in self.external_module_name_block_list: # Workaround for being unable to use full_match() due to python version - if '/modules/' in str(normalised_file_name) and \ - ('/' + module_name + '/') in str(normalised_file_name): + if '/modules/' in str(normalised_file_name) and ( + '/' + module_name + '/' + ) in str(normalised_file_name): skip_node = True break From 7794cc5f87c683c2c210c9ccbeebea651212e509 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 14:16:08 +0000 Subject: [PATCH 3173/3334] [nrf noup] scripts: ci: check_compliance: Fix ruff issues part 2 nrf-squash! [nrf noup] ci: set ZEPHYR__KCONFIG for NCS modules Fixes some issues that ruff is now showing Signed-off-by: Jamie McCrae (cherry picked from commit 62c751a8046b47bbad0e816bd82c753c4293c662) --- scripts/ci/check_compliance.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 1796e3f73b9c..570979fa7a0d 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -794,9 +794,11 @@ def get_modules(self, _module_dirs_file, modules_file, sysbuild_modules_file, se self.blocked_module_dirs.append(modules_dir / module / 'Kconfig') if os.path.exists(nrf_modules_dir): - nrf_modules = [name for name in os.listdir(nrf_modules_dir) if - os.path.exists(os.path.join(nrf_modules_dir, name, - 'Kconfig'))] + nrf_modules = [ + name + for name in os.listdir(nrf_modules_dir) + if os.path.exists(os.path.join(nrf_modules_dir, name, 'Kconfig')) + ] for module in nrf_modules: if module in self.external_module_name_block_list: From 77398167e00a7e811f650263eede6db61b7c2069 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 14:19:52 +0000 Subject: [PATCH 3174/3334] [nrf noup] scripts: ci: check_compliance: Fix ruff issues part 3 nrf-squash! [nrf noup] scripts: ci: check_compliance: Add undefined Kconfigs Fixes some issues that ruff is now showing Signed-off-by: Jamie McCrae (cherry picked from commit 78357fa2d1320ac843dfbfa60e1a830ddd8128bf) --- scripts/ci/check_compliance.py | 143 ++++++++++++++++----------------- 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 570979fa7a0d..a2316bcc3aa5 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1775,80 +1775,79 @@ def check_no_undef_outside_kconfig(self, kconf): "ZTEST_FAIL_TEST_", # regex in tests/ztest/fail/CMakeLists.txt "ZVFS_OPEN_ADD_SIZE_", # Used as an option matching prefix # zephyr-keep-sorted-stop - # NCS-specific allow list # zephyr-keep-sorted-start re(^\s+") - "APPLICATION", # Example documentation - "BAR", # Example documentation - "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation - "BT_ADV_PROV_", # Documentation - "BT_CTLR_TX_PWR_MINUS", # CHIP documentation - "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS", # CHIP documentation - "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation - "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo - "CHANNEL", # NRF desktop - "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop - "CHANNEL_TRANSPORT_DISABLED", # NRF desktop - "CHANNEL_TRANSPORT_IDLE", # NRF desktop - "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop - "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop - "CHIP_DFU_OVER_BT_SMP", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module - "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module - "CHIP_MEMORY_PROFILING", # CHIP module - "CHIP_NUS", # CHIP module - "CHIP_NUS_FIXED_PASSKEY", # CHIP module - "CHIP_NUS_MAX_COMMANDS", # CHIP module - "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module - "CHIP_QSPI_NOR", # CHIP module - "CHIP_SPI_NOR", # CHIP module - "CHIP_WIFI", # CHIP module - "DESKTOP_DVFS_STATE_", # NRF desktop - "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop - "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop - "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module - "MEMFAULT_", # Documentation - "MEMFAULT_NCS", # Documentation - "MEMFAULT_NCS_", # Documentation - "MY_CUSTOM_CONFIG", # Example documentation - "MY_EXT_API_ENABLED", # Example documentation - "MY_EXT_API_REQUIRED", # Example documentation - "NCS_IS_VARIANT_IMAGE", # Build system defined symbol - "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot - "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot - "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol - "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation - "PM_PARTITION_SIZE", # Used in search link - "PM_PARTITION_SIZE_", # Used in documentation - "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template - "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template - "SOC_NRF54H20_CPUSEC", # Internal - "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal - "STATUS_", # NRF desktop - "STATUS_COUNT", # NRF desktop - "STATUS_DISCONNECTED", # NRF desktop - "STATUS_FETCH", # NRF desktop - "STATUS_GET_BOARD_NAME", # NRF desktop - "STATUS_GET_HWID", # NRF desktop - "STATUS_GET_MAX_MOD_ID", # NRF desktop - "STATUS_GET_PEER", # NRF desktop - "STATUS_GET_PEERS_CACHE", # NRF desktop - "STATUS_INDEX_PEERS", # NRF desktop - "STATUS_LIST", # NRF desktop - "STATUS_PENDING", # NRF desktop - "STATUS_POS", # NRF desktop - "STATUS_REJECT", # NRF desktop - "STATUS_SET", # NRF desktop - "STATUS_SUCCESS", # NRF desktop - "STATUS_TIMEOUT", # NRF desktop - "STATUS_WRITE_FAIL", # NRF desktop + "APPLICATION", # Example documentation + "BAR", # Example documentation + "BOOT_IMAGE_ACCESS_HOOK", # MCUboot setting used in documentation + "BT_ADV_PROV_", # Documentation + "BT_CTLR_TX_PWR_MINUS", # CHIP documentation + "BT_CTLR_TX_PWR_MINUS_", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS", # CHIP documentation + "BT_CTLR_TX_PWR_PLUS_", # CHIP documentation + "BT_SDC_ADDITIONAL_MEMORY", # From dragoon repo + "CHANNEL", # NRF desktop + "CHANNEL_FETCHED_DATA_MAX_SIZE", # NRF desktop + "CHANNEL_TRANSPORT_DISABLED", # NRF desktop + "CHANNEL_TRANSPORT_IDLE", # NRF desktop + "CHANNEL_TRANSPORT_RSP_READY", # NRF desktop + "CHANNEL_TRANSPORT_WAIT_RSP", # NRF desktop + "CHIP_DFU_OVER_BT_SMP", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY", # CHIP module + "CHIP_LAST_FABRIC_REMOVED_NONE", # CHIP module + "CHIP_MEMORY_PROFILING", # CHIP module + "CHIP_NUS", # CHIP module + "CHIP_NUS_FIXED_PASSKEY", # CHIP module + "CHIP_NUS_MAX_COMMANDS", # CHIP module + "CHIP_NUS_MAX_COMMAND_LEN", # CHIP module + "CHIP_QSPI_NOR", # CHIP module + "CHIP_SPI_NOR", # CHIP module + "CHIP_WIFI", # CHIP module + "DESKTOP_DVFS_STATE_", # NRF desktop + "DESKTOP_DVFS_STATE_CONFIG_CHANNEL_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_INITIALIZING_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_LLPM_CONNECTED_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_SMP_TRANSFER_ENABLE", # NRF desktop + "DESKTOP_DVFS_STATE_USB_CONNECTED_ENABLE", # NRF desktop + "FACTORY_DATA_CUSTOM_BACKEND", # CHIP module + "MEMFAULT_", # Documentation + "MEMFAULT_NCS", # Documentation + "MEMFAULT_NCS_", # Documentation + "MY_CUSTOM_CONFIG", # Example documentation + "MY_EXT_API_ENABLED", # Example documentation + "MY_EXT_API_REQUIRED", # Example documentation + "NCS_IS_VARIANT_IMAGE", # Build system defined symbol + "NCS_MCUBOOT_UUID_CID_IMAGE_0_VALUE", # MCUboot + "NCS_MCUBOOT_UUID_CID_IMAGE_1_VALUE", # MCUboot + "NCS_VARIANT_MERGE_KCONFIG", # Build system defined symbol + "NRF_MODEM_LIB_TRACE_BACKEND_MY_TRACE_BACKEND", # Documentation + "PM_PARTITION_SIZE", # Used in search link + "PM_PARTITION_SIZE_", # Used in documentation + "PM_PARTITION_SIZE_MEMFAULT_STORAGE", # Created by Kconfig template + "PM_PARTITION_SIZE_SETTINGS", # Created by Kconfig template + "SOC_NRF54H20_CPUSEC", # Internal + "SSF_SERVER_PSA_CRYPTO_SERVICE_ENABLED", # Internal + "STATUS_", # NRF desktop + "STATUS_COUNT", # NRF desktop + "STATUS_DISCONNECTED", # NRF desktop + "STATUS_FETCH", # NRF desktop + "STATUS_GET_BOARD_NAME", # NRF desktop + "STATUS_GET_HWID", # NRF desktop + "STATUS_GET_MAX_MOD_ID", # NRF desktop + "STATUS_GET_PEER", # NRF desktop + "STATUS_GET_PEERS_CACHE", # NRF desktop + "STATUS_INDEX_PEERS", # NRF desktop + "STATUS_LIST", # NRF desktop + "STATUS_PENDING", # NRF desktop + "STATUS_POS", # NRF desktop + "STATUS_REJECT", # NRF desktop + "STATUS_SET", # NRF desktop + "STATUS_SUCCESS", # NRF desktop + "STATUS_TIMEOUT", # NRF desktop + "STATUS_WRITE_FAIL", # NRF desktop # zephyr-keep-sorted-stop } From 5d84cbd7c6569abacfec7378cc3b54ad81f7cd7e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 29 Jan 2026 14:21:28 +0000 Subject: [PATCH 3175/3334] [nrf noup] scripts: ci: check_compliance: Fix ruff issues part 4 nrf-squash! [nrf noup] scripts: ci: check_compliance: Add NCS sysbuild Kconfigs Fixes some issues that ruff is now showing Signed-off-by: Jamie McCrae (cherry picked from commit 9749b5cfd4a61b2c7bfc666fbbc69110eb0b2f0b) --- scripts/ci/check_compliance.py | 45 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index a2316bcc3aa5..dfec13c96f7f 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -1924,31 +1924,30 @@ class SysbuildKconfigCheck(KconfigCheck): "OTHER_APP_IMAGE_PATH", # Used in sysbuild documentation as example "SECOND_SAMPLE", # Used in sysbuild documentation # zephyr-keep-sorted-stop - # NCS-specific allowlist # zephyr-keep-sorted-start re(^\s+") - "APP_CPUNET_RUN", # Used by sample - "APP_DFU", # Used by sample - "BT_FAST_PAIR", # Legacy/removed, used in migration documentation - "COMP_DATA_LAYOUT_ARRAY", # Used by test - "COMP_DATA_LAYOUT_MULTIPLE", # Used by test - "COMP_DATA_LAYOUT_SINGLE", # Used by test - "DTM_NO_DFE", # Used by DTM application - "DTM_TRANSPORT_HCI", # Used by DTM application - "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation - "INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation - "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application - "ML_APP_REMOTE_BOARD", # Used by machine learning application - "MY_APP_IMAGE_ABC", # Used in documentation - "NETCORE_ABC", # Used in documentation - "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests - "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation - "SUIT_ENVELOPE_", # Used by jinja - "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation - "SUIT_MPI_", # Used by jinja - "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation - "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample + "APP_CPUNET_RUN", # Used by sample + "APP_DFU", # Used by sample + "BT_FAST_PAIR", # Legacy/removed, used in migration documentation + "COMP_DATA_LAYOUT_ARRAY", # Used by test + "COMP_DATA_LAYOUT_MULTIPLE", # Used by test + "COMP_DATA_LAYOUT_SINGLE", # Used by test + "DTM_NO_DFE", # Used by DTM application + "DTM_TRANSPORT_HCI", # Used by DTM application + "FIRMWARE_LOADER_IMAGE_ABC", # Used in documentation + "INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS", # Used in migration documentation + "ML_APP_INCLUDE_REMOTE_IMAGE", # Used by machine learning application + "ML_APP_REMOTE_BOARD", # Used by machine learning application + "MY_APP_IMAGE_ABC", # Used in documentation + "NETCORE_ABC", # Used in documentation + "REMOTE_GLOBAL_DOMAIN_CLOCK_FREQUENCY_SWITCHING", # Used in tests + "SOC_FLASH_NRF_RADIO_SYNC_RPC", # Used in documentation + "SUIT_ENVELOPE_", # Used by jinja + "SUIT_ENVELOPE_SEQUENCE_NUM", # Legacy/removed, used in migration documentation + "SUIT_MPI_", # Used by jinja + "SUIT_RECOVERY_APPLICATION_CUSTOM", # Used in documentation + "SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST", # Used by wifi radio test sample # zephyr-keep-sorted-stop } From 0779c84e969d3d4bbee9d43ec4bdd01c6c23bb9b Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Fri, 30 Jan 2026 14:49:50 +0000 Subject: [PATCH 3176/3334] [nrf noup] scripts: west: Resolve cmake-opt conflict from upmerge nrf-squash! [nrf noup] scripts: west: build: Use sysbuild by default if in NCS dir New feature Supports cmake options specified via arguments changed default sysbuiild from None to []. Noup commit to use sysbuild by default if in NCS dir requires changes to accommodate this. Signed-off-by: Robert Robinson (cherry picked from commit ba740b914e7f6ded691a5d73a14ae37e6abcfc8e) --- scripts/west_commands/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index ad6965a04271..7d99fbd5c2f9 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -663,9 +663,9 @@ def _run_cmake(self, board, origin): if user_args: cmake_opts.extend(shlex.split(user_args)) - config_sysbuild = config_getboolean('sysbuild', None) + config_sysbuild = config_getboolean('sysbuild', []) - if config_sysbuild is None: + if config_sysbuild == []: # If no option is set, then enable sysbuild globally config_sysbuild = True From abe70a7325702d8be1172d998ee3fdf08df3f571 Mon Sep 17 00:00:00 2001 From: Uma Praseeda Date: Tue, 27 Jan 2026 16:00:00 +0100 Subject: [PATCH 3177/3334] [nrf noup] zephyr: doc: Update OTA documentation update OTA documentation Signed-off-by: Uma Praseeda (cherry picked from commit 5a157b38198d0c7e2d1f8e6a754c3832770ccde2) --- doc/services/device_mgmt/ota.rst | 119 +++++++++---------------------- 1 file changed, 35 insertions(+), 84 deletions(-) diff --git a/doc/services/device_mgmt/ota.rst b/doc/services/device_mgmt/ota.rst index c4e9bb3a737b..6cf6e67a26e4 100644 --- a/doc/services/device_mgmt/ota.rst +++ b/doc/services/device_mgmt/ota.rst @@ -19,90 +19,41 @@ same method can be used as part of OTA. The binary is first downloaded into an unoccupied code partition, usually named ``slot1_partition``, then upgraded using the :ref:`mcuboot` process. -Examples of OTA -*************** - -Golioth -======= - -`Golioth`_ is an IoT management platform that includes OTA updates. Devices are -configured to observe your available firmware revisions on the Golioth Cloud. -When a new version is available, the device downloads and flashes the binary. In -this implementation, the connection between cloud and device is secured using -TLS/DTLS, and the signed firmware binary is confirmed by MCUboot before the -upgrade occurs. - -1. A working sample can be found on the `Golioth Firmware SDK repository`_ -2. The `Golioth OTA documentation`_ includes complete information about the - versioning process - -Eclipse hawkBit™ -================ - -`Eclipse hawkBit™`_ is an update server framework that uses polling on a -REST api to detect firmware updates. When a new update is detected, the binary -is downloaded and installed. MCUboot can be used to verify the signature before -upgrading the firmware. - -There is a :zephyr:code-sample:`hawkbit-api` sample included in the -Zephyr :zephyr:code-sample-category:`mgmt` section. - -UpdateHub -========= - -`UpdateHub`_ is a platform for remotely updating embedded devices. Updates can -be manually triggered or monitored via polling. When a new update is detected, -the binary is downloaded and installed. MCUboot can be used to verify the -signature before upgrading the firmware. - -There is an :zephyr:code-sample:`updatehub-fota` sample included in the Zephyr -:zephyr:code-sample-category:`mgmt` section. - -SMP Server -========== - -A Simple Management Protocol (SMP) server can be used to update firmware via -Bluetooth Low Energy (LE) or UDP. :ref:`mcu_mgr` is used to send a signed -firmware binary to the remote device where it is verified by MCUboot before the -upgrade occurs. - -There is an :zephyr:code-sample:`smp-svr` sample included in the Zephyr -:zephyr:code-sample-category:`mgmt` section. - -Lightweight M2M (LWM2M) -======================= - -The :ref:`lwm2m_interface` protocol includes support for firmware update via -:kconfig:option:`CONFIG_LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT`. Devices securely -connect to an LwM2M server using DTLS. A :zephyr:code-sample:`lwm2m-client` sample is -available but it does not demonstrate the firmware update feature. - -mender-mcu -========== - -`mender-mcu`_ enables robust firmware updates on resource-constrained devices by -integrating with Zephyr. It implements an Update Module interface and provides -a default Update Module that integrates with MCUboot to provide A/B updates. -This allows microcontroller units (MCUs) to perform atomic, fail-safe OTA -updates with automatic rollback on failure. - -See :ref:`external_module_mender_mcu` for integration details and examples. - Memfault and nRF Cloud powered by Memfault -========================================== - -`Memfault`_ is a IoT observability platform that includes OTA management. Devices check-in with -Memfault's service periodically for an OTA update, and when an update is available, download and -install the binary. - -See :ref:`external_module_memfault_firmware_sdk` for overall integration details and -examples. +****************************************** + +`Memfault`_ is an IoT observability platform that includes OTA management. +Devices check in with Memfault's service periodically for an OTA update, and +when an update is available, download and install the binary. + +Zephyr projects that use MCUboot and have a direct Internet connection can +leverage the `Memfault Firmware SDK's `_ OTA client to +download a payload from Memfault's OTA service, load it into the secondary +partition, and then reboot into the new image. +See `Memfault OTA for Zephyr documentation`_ for more details on this support +for Zephyr projects. + +For Nordic Semiconductor cellular chip users, the Memfault +Firmware SDK includes support for downloading the payload over a cellular +connection using nRF Connect SDK's FOTA and downloader libraries. +See the `Memfault Quickstart for the nRF91 Series`_ for more +information. Zephyr projects with a Bluetooth Low Energy connection can +leverage the `Memfault Diagnostic Service`_ (MDS) with the `Memfault iOS SDK`_ +and `Memfault Android SDK`_ to deliver the update payload to the device. For +Nordic Semiconductor's Bluetooth Low Energy chip users, the Zephyr-based +nRF Connect SDK provides an implementation of MDS. See the +`nRF Connect SDK documentation on MDS`_ for more information as well as +`nRF Cloud powered by Memfault`_ for detail on using the Memfault platform with +Nordic Semiconductor Bluetooth Low Energy chips. +See :ref:`external_module_memfault_firmware_sdk` for overall integration +details and examples. -.. _MCUboot bootloader: https://mcuboot.com/ -.. _Golioth: https://golioth.io/ -.. _Golioth Firmware SDK repository: https://github.com/golioth/golioth-firmware-sdk/tree/main/examples/zephyr/fw_update -.. _Golioth OTA documentation: https://docs.golioth.io/device-management/ota -.. _Eclipse hawkBit™: https://www.eclipse.org/hawkbit/ -.. _UpdateHub: https://updatehub.io/ -.. _mender-mcu: https://github.com/mendersoftware/mender-mcu .. _Memfault: https://memfault.com/ +.. _Memfault Firmware SDK: https://github.com/memfault/memfault-firmware-sdk +.. _Memfault OTA for Zephyr documentation: https://docs.memfault.com/docs/mcu/zephyr-guide#ota +.. _Memfault Quickstart for the nRF91 Series: https://docs.memfault.com/docs/mcu/quickstart-nrf9160 +.. _Memfault Diagnostic Service: https://docs.memfault.com/docs/mcu/mds +.. _Memfault iOS SDK: https://github.com/memfault/memfault-cloud-ios +.. _Memfault Android SDK: https://github.com/memfault/memfault-cloud-android +.. _nRF Connect SDK documentation on MDS: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/bluetooth/services/mds.html +.. _nRF Cloud powered by Memfault: https://nrfcloud.com/#/ From ea0e651e8ecb5842a2e51f68e0b8087639ce0ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 30 Jan 2026 10:47:18 +0100 Subject: [PATCH 3178/3334] [nrf noup] boards: nordic: nrf54h20: Fix addresses in cpuapp_ram0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nrf-squash! [nrf noup] soc/nordic/nrf54h/pm_s2ram: S2RAM resume hardening Use only offsets to the base and not the full address. Signed-off-by: Krzysztof Chruściński (cherry picked from commit d9e419d8c7382e596229078ea905e4f1cf726b32) --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index a8525de37816..3025a413f498 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -328,16 +328,16 @@ zephyr_udc0: &usbhs { }; /* temporary stack for S2RAM resume logic */ - pm_s2ram_stack: cpuapp_s2ram_stack@22007fc8 { + pm_s2ram_stack: cpuapp_s2ram_stack@7fc8 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fc8 16>; + reg = <0x00007fc8 16>; zephyr,memory-region = "pm_s2ram_stack"; }; /* run-time common mcuboot S2RAM support section */ - mcuboot_s2ram: cpuapp_s2ram@22007fd8 { + mcuboot_s2ram: cpuapp_s2ram@7fd8 { compatible = "zephyr,memory-region", "mmio-sram"; - reg = <0x22007fd8 8>; + reg = <0x00007fd8 8>; zephyr,memory-region = "mcuboot_s2ram_context"; }; From fb9999cd9b9bc942901b6d35b93d827021bd52d6 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 12:17:00 +0200 Subject: [PATCH 3179/3334] [nrf noup] dts: choose a psa-rng for entropy for 54lm20a Set PSA as the entropy source for nRF54lm20a target. PSA is the only NCS-supported interface to CRACEN. There is no other entropy source in 54lm20a than CRACEN. The commit also disables `rng` compatible with `nrf-cracen-ctrdrbg`, the nrfx based interface to CRACEN that is used in upstream Zephyr. Only one CRACEN interface may be enabled. Signed-off-by: Piotr Pryga (cherry picked from commit e5c923ae0e0487609d22a2644542a674b625a356) --- dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi index db6b101df93d..a94b246e0fd1 100644 --- a/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi @@ -26,7 +26,7 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; diff --git a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi index 52c3450b6780..6a9c1383dc23 100644 --- a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi @@ -18,7 +18,7 @@ nvic: &cpuapp_nvic {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -29,11 +29,11 @@ nvic: &cpuapp_nvic {}; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; }; From 635f7bef351934217e28674f2f812bd2ee279568 Mon Sep 17 00:00:00 2001 From: Piotr Pryga Date: Fri, 12 Sep 2025 07:48:52 +0200 Subject: [PATCH 3180/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding as default The SoftDevice Controller is a different controller than the open source link layer with a different set of quirks. The SoftDevice Controller is a default BT controller in nRF Connect SDK context, therefore it should be enabled by default instead of open source link layer. The commit changes the default BT controller for nRF54lm20a SoC. Signed-off-by: Piotr Pryga (cherry picked from commit 3c80c155dc70f1a3874f365c570c6fd2adce7e2e) --- dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi | 4 ++-- dts/vendor/nordic/nrf54lm20_a_b.dtsi | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi index 6a9c1383dc23..b0fb95f76047 100644 --- a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_controller; + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -38,7 +38,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_controller { +&bt_hci_sdc { status = "okay"; }; diff --git a/dts/vendor/nordic/nrf54lm20_a_b.dtsi b/dts/vendor/nordic/nrf54lm20_a_b.dtsi index 39c94ffdea06..26a62a9226be 100644 --- a/dts/vendor/nordic/nrf54lm20_a_b.dtsi +++ b/dts/vendor/nordic/nrf54lm20_a_b.dtsi @@ -315,6 +315,11 @@ /* Note: In the nRF Connect SDK the SoftDevice Controller * is added and set as the default Bluetooth Controller. */ + bt_hci_sdc: bt_hci_sdc { + compatible = "nordic,bt-hci-sdc"; + status = "disabled"; + }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From b0e00bc18553fce6a6018748969d0c015f30981d Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 16 Feb 2026 11:36:21 +0200 Subject: [PATCH 3181/3334] [nrf noup] boards: nordic: thingy53: ns: default to minimal TF-M profile The default TF-M profile in NCS was changed from MINIMAL (an NCS construct) to NOT_SET. The Thingy:53 has static PM files which give little space for TF-M so it needs to continue defaulting to the minimal TF-M profile. Signed-off-by: Tomi Fontanilles (cherry picked from commit 75a8753c2fc4f603ecacf1b70a04374d18b5a6bc) --- boards/nordic/thingy53/Kconfig.defconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index d7132b6649e4..4a478c8db254 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -21,6 +21,14 @@ config BOOTLOADER_MCUBOOT config BOARD_ENABLE_CPUNET default y if !MCUBOOT +if BUILD_WITH_TFM + +choice TFM_PROFILE_TYPE + default TFM_PROFILE_TYPE_MINIMAL +endchoice + +endif # BUILD_WITH_TFM + # Code Partition: # # For the secure version of the board the firmware is linked at the beginning From cf25f3b31f9fb456a8049c3cd076dbdfd9ddc07e Mon Sep 17 00:00:00 2001 From: David Jewsbury Date: Thu, 12 Feb 2026 12:51:16 +0000 Subject: [PATCH 3182/3334] [nrf noup] dts: nrf54h20: fix formatting error nrf-squash! [nrf noup] dts: Add Bluetooth Controller to nRF54H20 Formatting problem from upmerge causing error during any PR to nrf54h20 file. Signed-off-by: David Jewsbury (cherry picked from commit b839e83e85f04fb7e06a001fd5c7c88c26125675) --- dts/vendor/nordic/nrf54h20.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/dts/vendor/nordic/nrf54h20.dtsi b/dts/vendor/nordic/nrf54h20.dtsi index 87c5abe300df..cf0821d36e7d 100644 --- a/dts/vendor/nordic/nrf54h20.dtsi +++ b/dts/vendor/nordic/nrf54h20.dtsi @@ -523,6 +523,7 @@ compatible = "nordic,bt-hci-sdc"; status = "disabled"; }; + bt_hci_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "disabled"; From 586b2d8d6541eaa4950b62d30b03547cdfcfe507 Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 2 Feb 2026 12:29:47 +0000 Subject: [PATCH 3183/3334] [nrf noup] dts: choose a psa-rng for entropy for nRF7120 Set PSA as the entropy source for nRF7120 target. PSA is the only NCS-supported interface to CRACEN. Disables `rng` compatible with `nrf-cracen-ctrdrbg`, the nrfx based interface to CRACEN that is used in upstream Zephyr. Only one CRACEN interface may be enabled. Signed-off-by: Robert Robinson (cherry picked from commit 8334d4c11931685c35c0d25ef338bb9f7b40dfa0) --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 37425bc9a430..39e815afc199 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,entropy = &rng; + zephyr,entropy = &psa_rng; }; soc { @@ -27,13 +27,13 @@ nvic: &cpuapp_nvic {}; }; rng: rng { - status = "okay"; + status = "disabled"; compatible = "nordic,nrf-cracen-ctrdrbg"; }; psa_rng: psa-rng { compatible = "zephyr,psa-crypto-rng"; - status = "disabled"; + status = "okay"; }; }; From 71418a6a91e103b5ead505f1f54fd0998ea9323a Mon Sep 17 00:00:00 2001 From: Robert Robinson Date: Mon, 2 Feb 2026 12:48:15 +0000 Subject: [PATCH 3184/3334] [nrf noup] dts: Select SoftDevice Controller DTS binding for nRF7120 nrf-squash! [nrf noup] dts: Select SoftDevice Controller DTS binding as default Sets bt_hci_sdc as default for nRF7120. Signed-off-by: Robert Robinson (cherry picked from commit 42cd30f6f202fa63f4cc70a90d7da3820edc1308) --- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 39e815afc199..256f2d8f43b8 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -17,6 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { + zephyr,bt-hci = &bt_hci_sdc; zephyr,entropy = &psa_rng; }; @@ -37,6 +38,10 @@ nvic: &cpuapp_nvic {}; }; }; +&bt_hci_sdc { + status = "okay"; +}; + &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; From d6172fd34d0362c8303f0a537469c9353d65b6d4 Mon Sep 17 00:00:00 2001 From: Leif Harald Urlaub Date: Fri, 20 Feb 2026 14:59:42 +0100 Subject: [PATCH 3185/3334] [nrf noup] ci: workflow: modification of the stale_issue.yml stale_issue.yml: repo changed Signed-off-by: Leif Harald Urlaub (cherry picked from commit 587050447ec81f187dbe268afa21b2b595901d6f) --- .github/workflows/stale_issue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale_issue.yml b/.github/workflows/stale_issue.yml index 23e10d494f5e..efa4d0992b7c 100644 --- a/.github/workflows/stale_issue.yml +++ b/.github/workflows/stale_issue.yml @@ -10,7 +10,7 @@ jobs: stale: name: Find Stale issues and PRs runs-on: ubuntu-24.04 - if: github.repository == 'zephyrproject-rtos/zephyr' + if: github.repository == 'nrfconnect/sdk-zephyr' permissions: pull-requests: write # to comment on stale pull requests issues: write # to comment on stale issues From 81facb6a8ebf7677801600019fc3342e0502dafb Mon Sep 17 00:00:00 2001 From: Rubin Gerritsen Date: Mon, 16 Mar 2026 09:26:50 +0100 Subject: [PATCH 3186/3334] [nrf noup] ci: Extend test spec for Bluetooth to cover clock control The commit 8befca7844b1ac3e7d76f908 broke Bluetooth and it was not caught by CI. We should ensure this doesn't happen again. See also NCSDK-38164. Signed-off-by: Rubin Gerritsen (cherry picked from commit fa14cfca0ae7a73ecc7dd298bc78c7393154ba28) --- .github/test-spec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index fc74207ebd5f..4934d8f243ff 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -95,6 +95,7 @@ - "arch/arm/**/*" - any: - "drivers/bluetooth/**/*" + - "drivers/clock_control/**/*" - any: - "dts/arm/nordic/nrf5*" - any: From 3397db3094781753a75f166c32cab272a05ecc2a Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 5 Sep 2025 18:09:52 +0200 Subject: [PATCH 3187/3334] [nrf noup] soc/nordic/nrf54h: Add extension to define custom s2ram implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Kconfig entries to allow compile own s2ram implementation. Signed-off-by: Karol Lasończyk Signed-off-by: Andrzej Puzdrowski Signed-off-by: Pasi Liimatainen (cherry picked from commit 8820ca6981ae75f6756dfe1d1c3543d64c9fbae0) --- soc/nordic/common/CMakeLists.txt | 4 +++- soc/nordic/nrf54h/Kconfig | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index 163184c1ad25..fbd7fbe0541f 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -23,7 +23,9 @@ if(CONFIG_NRF_PLATFORM_HALTIUM AND CONFIG_ARM) FILTER ".*\\.cache_retain_and_sleep" LOCATION PMLocalRamfunc_TEXT ) - zephyr_library_sources_ifdef(CONFIG_PM_S2RAM haltium_pm_s2ram.c) + if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) + zephyr_library_sources_ifdef(CONFIG_PM_S2RAM haltium_pm_s2ram.c) + endif() zephyr_library_sources_ifdef(CONFIG_CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS nrf54hx_nrf92x_mpu_regions.c) zephyr_library_sources(soc_lrcconf.c) endif() diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 44f18efe8105..d486d13935ec 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -105,6 +105,11 @@ config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND default y depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD +config SOC_NRF54H20_PM_S2RAM_OVERRIDE + bool "Override `pm_s2ram` implementation" + help + Override Nordic s2ram implementation. + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON From f9d1714151e7bd2a2b95d462a05bb87150bc0be9 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Mon, 9 Mar 2026 16:04:08 +0100 Subject: [PATCH 3188/3334] [nrf fromlist] samples: usb: console: add common mapping to sample.yaml Add common mapping to sample.yaml. Upstream PR #: 105141 Signed-off-by: Johann Fischer (cherry picked from commit 90bb5684b70c03f15b4cbdec6393fe1b793cf392) --- samples/subsys/usb/console/sample.yaml | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/samples/subsys/usb/console/sample.yaml b/samples/subsys/usb/console/sample.yaml index d009dbdb3d0a..bfafd84e80c8 100644 --- a/samples/subsys/usb/console/sample.yaml +++ b/samples/subsys/usb/console/sample.yaml @@ -1,17 +1,18 @@ sample: name: Console over CDC ACM serial +common: + depends_on: + - usbd + tags: usb + harness: console + harness_config: + fixture: fixture_usb_cdc + integration_platforms: + - nrf52840dk/nrf52840 + - frdm_k64f + - stm32f723e_disco + - nucleo_f413zh + - mimxrt685_evk/mimxrt685s/cm33 + - mimxrt1060_evk/mimxrt1062/qspi tests: - sample.usbd.console: - depends_on: - - usbd - tags: usb - integration_platforms: - - nrf52840dk/nrf52840 - - frdm_k64f - - stm32f723e_disco - - nucleo_f413zh - - mimxrt685_evk/mimxrt685s/cm33 - - mimxrt1060_evk/mimxrt1062/qspi - harness: console - harness_config: - fixture: fixture_usb_cdc + sample.usbd.console: {} From e461b39b0a3348517f9ee8415cfcd106bb0a4df9 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Mon, 16 Mar 2026 16:25:37 +0100 Subject: [PATCH 3189/3334] [nrf fromlist] usb: device_next: return -EALREADY if class instance is already registered Return -EALREADY if the class instance already registered, which, in some circumstances, may be considered a non-critical error. Upstream PR #: 105141 Signed-off-by: Johann Fischer (cherry picked from commit 220b6b8abcb3afbe7c7c8e8ab383d1fc68c3885f) --- include/zephyr/usb/usbd.h | 2 ++ subsys/usb/device_next/usbd_class.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/zephyr/usb/usbd.h b/include/zephyr/usb/usbd.h index 4527f417483e..1af162325332 100644 --- a/include/zephyr/usb/usbd.h +++ b/include/zephyr/usb/usbd.h @@ -853,6 +853,8 @@ int usbd_add_configuration(struct usbd_context *uds_ctx, * @param[in] cfg Configuration value (bConfigurationValue) * * @return 0 on success, other values on fail. + * @retval -EALREADY If class instance is already registered. + * @retval -EBUSY If USB device support is already initialized. */ int usbd_register_class(struct usbd_context *uds_ctx, const char *name, diff --git a/subsys/usb/device_next/usbd_class.c b/subsys/usb/device_next/usbd_class.c index ae5f74b5c5d9..17571bda2cbb 100644 --- a/subsys/usb/device_next/usbd_class.c +++ b/subsys/usb/device_next/usbd_class.c @@ -319,13 +319,13 @@ int usbd_register_class(struct usbd_context *const uds_ctx, /* TODO: does it still need to be atomic ? */ if (atomic_test_bit(&c_nd->state, USBD_CCTX_REGISTERED)) { LOG_WRN("Class instance already registered"); - ret = -EBUSY; + ret = -EALREADY; goto register_class_error; } if ((c_data->uds_ctx != NULL) && (c_data->uds_ctx != uds_ctx)) { LOG_ERR("Class registered to other context at different speed"); - ret = -EBUSY; + ret = -EALREADY; goto register_class_error; } From 1832d33dfed7787d964472e2ec11c32efce6101e Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Fri, 27 Feb 2026 21:28:16 +0100 Subject: [PATCH 3190/3334] [nrf fromlist] usb: device_next: allow to initialize multiple CDC ACM instances Application can use new option CDC_ACM_SERIAL_MULTIPLE_INSTANCES if different CDC ACM serial backends are required for common use cases such as logging, the shell, and specific protocols. This option also guarantees the order in which the instances will be registered and appear in the configuration descriptor. The option uses the chosen node properties to identify UART devices. The following are currently supported, in this order: "zephyr,console", "zephyr,shell-uart", "zephyr,uart-mcumgr". A supported property may be missing, and properties may reference the same device. Upstream PR #: 105141 Signed-off-by: Johann Fischer (cherry picked from commit d088ff9107d68dc49e21a402b708ab50aca1e847) --- doc/connectivity/usb/device_next/cdc_acm.rst | 9 ++ samples/subsys/usb/console/sample.yaml | 3 + .../device_next/app/Kconfig.cdc_acm_serial | 13 +++ subsys/usb/device_next/app/cdc_acm_serial.c | 94 +++++++++++++++++-- 4 files changed, 111 insertions(+), 8 deletions(-) diff --git a/doc/connectivity/usb/device_next/cdc_acm.rst b/doc/connectivity/usb/device_next/cdc_acm.rst index 1fa7559b191a..eaf56483e680 100644 --- a/doc/connectivity/usb/device_next/cdc_acm.rst +++ b/doc/connectivity/usb/device_next/cdc_acm.rst @@ -97,6 +97,15 @@ As the configuration would be identical for any board, there are common :zephyr_file:`Kconfig file ` that must be included in the board's devicetree and Kconfig.defconfig files. +Application can use :kconfig:option:`CONFIG_CDC_ACM_SERIAL_MULTIPLE_INSTANCES` +if different CDC ACM serial backends are required for common use cases such as +logging, the shell, and specific protocols. This option also guarantees the +order in which the instances will be registered and appear in the configuration +descriptor. The option uses the chosen node properties to identify UART devices. +The following are currently supported, in this order: +"zephyr,console", "zephyr,shell-uart", "zephyr,uart-mcumgr". +A supported property may be missing, and properties may reference the same device. + Using CDC ACM UART in the application ===================================== diff --git a/samples/subsys/usb/console/sample.yaml b/samples/subsys/usb/console/sample.yaml index bfafd84e80c8..50fc98003c21 100644 --- a/samples/subsys/usb/console/sample.yaml +++ b/samples/subsys/usb/console/sample.yaml @@ -16,3 +16,6 @@ common: - mimxrt1060_evk/mimxrt1062/qspi tests: sample.usbd.console: {} + sample.usbd.console.multiple-instances: + extra_configs: + - CONFIG_CDC_ACM_SERIAL_MULTIPLE_INSTANCES=y diff --git a/subsys/usb/device_next/app/Kconfig.cdc_acm_serial b/subsys/usb/device_next/app/Kconfig.cdc_acm_serial index 5192d5636d9e..c170ed9be0e4 100644 --- a/subsys/usb/device_next/app/Kconfig.cdc_acm_serial +++ b/subsys/usb/device_next/app/Kconfig.cdc_acm_serial @@ -23,6 +23,19 @@ config CDC_ACM_SERIAL_ENABLE_AT_BOOT When disabled, the application is responsible for enabling/disabling the USB device. +config CDC_ACM_SERIAL_MULTIPLE_INSTANCES + bool "Register and initialize multiple CDC ACM instances" + help + Register multiple CDC ACM instances whose UARTs are referenced by + appropriate Zephyr-specific chosen node properties. The order in which + the instances will be registered and appear in the configuration + descriptor is guaranteed. The following are currently supported, in + this order: "zephyr,console", "zephyr,shell-uart", "zephyr,uart-mcumgr". + A supported property may be missing, and properties may reference the + same device. + Each instance occupies two IN endpoints and one OUT endpoint. USB device + controller must have enough resources to support multiple instances. + config CDC_ACM_SERIAL_MANUFACTURER_STRING string "USB device manufacturer string descriptor" default "Zephyr Project" diff --git a/subsys/usb/device_next/app/cdc_acm_serial.c b/subsys/usb/device_next/app/cdc_acm_serial.c index af0814693030..845a9f0cf300 100644 --- a/subsys/usb/device_next/app/cdc_acm_serial.c +++ b/subsys/usb/device_next/app/cdc_acm_serial.c @@ -43,9 +43,69 @@ USBD_CONFIGURATION_DEFINE(cdc_acm_serial_hs_config, attributes, CONFIG_CDC_ACM_SERIAL_MAX_POWER, &hs_cfg_desc); +/* + * The CDC ACM instances are registered in the same order that they appear in + * this array. Therefore, they are always presented in the same order on the + * host side. Add new entries at the end. + */ +const static struct device *uart_devs[] = { + DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_console)), + DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_shell_uart)), + DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_uart_mcumgr)), +}; -static int register_cdc_acm_0(struct usbd_context *const uds_ctx, - const enum usbd_speed speed) +/* + * The class data stores a reference to the implemented UART device for + * internal purposes. Iterate over all class instances and compare the dev + * parameter with the referenced UART device. Then, try to register the + * instance. If multiple chosen node properties reference the same device, + * usbd_register_class() will fail with -EALREADY. + */ +static int register_chosen(struct usbd_context *const uds_ctx, + const enum usbd_speed speed, + const struct device *const dev) +{ + int err; + + if (speed == USBD_SPEED_HS) { + STRUCT_SECTION_FOREACH_ALTERNATE(usbd_class_hs, usbd_class_node, c_nd) { + struct usbd_class_data *c_data = c_nd->c_data; + + if (usbd_class_get_private(c_data) == dev) { + err = usbd_register_class(&cdc_acm_serial, + c_data->name, speed, 1); + if (err != 0 && err != -EALREADY) { + LOG_ERR("Failed to register %s", c_data->name); + return err; + } + + break; + } + } + } + + if (speed == USBD_SPEED_FS) { + STRUCT_SECTION_FOREACH_ALTERNATE(usbd_class_fs, usbd_class_node, c_nd) { + struct usbd_class_data *c_data = c_nd->c_data; + + if (usbd_class_get_private(c_data) == dev) { + err = usbd_register_class(&cdc_acm_serial, + c_data->name, speed, 1); + if (err != 0 && err != -EALREADY) { + LOG_ERR("Failed to register %s", c_data->name); + return err; + } + + break; + } + } + } + + return 0; +} + +static int register_cdc_acm(struct usbd_context *const uds_ctx, + const enum usbd_speed speed) { struct usbd_config_node *cfg_nd; int err; @@ -62,10 +122,28 @@ static int register_cdc_acm_0(struct usbd_context *const uds_ctx, return err; } - err = usbd_register_class(&cdc_acm_serial, "cdc_acm_0", speed, 1); - if (err) { - LOG_ERR("Failed to register classes"); - return err; + if (IS_ENABLED(CONFIG_CDC_ACM_SERIAL_MULTIPLE_INSTANCES)) { + for (int n = 0; n < ARRAY_SIZE(uart_devs); n++) { + if (uart_devs[n] == NULL) { + continue; + } + + err = register_chosen(uds_ctx, speed, uart_devs[n]); + if (err) { + return err; + } + } + } else { + /* + * Only register the first instance to maintain the legacy + * stack behavior when using CDC ACM as a serial backend for + * different applications. + */ + err = usbd_register_class(&cdc_acm_serial, "cdc_acm_0", speed, 1); + if (err) { + LOG_ERR("Failed to register %s", "cdc_acm_0"); + return err; + } } return usbd_device_set_code_triple(uds_ctx, speed, @@ -105,13 +183,13 @@ static int cdc_acm_serial_init_device(void) if (USBD_SUPPORTS_HIGH_SPEED && usbd_caps_speed(&cdc_acm_serial) == USBD_SPEED_HS) { - err = register_cdc_acm_0(&cdc_acm_serial, USBD_SPEED_HS); + err = register_cdc_acm(&cdc_acm_serial, USBD_SPEED_HS); if (err) { return err; } } - err = register_cdc_acm_0(&cdc_acm_serial, USBD_SPEED_FS); + err = register_cdc_acm(&cdc_acm_serial, USBD_SPEED_FS); if (err) { return err; } From 2f9a98c410b6897bf08aa9d4fe4cbc338dcddee0 Mon Sep 17 00:00:00 2001 From: Markus Swarowsky Date: Mon, 4 Dec 2023 15:27:14 +0100 Subject: [PATCH 3191/3334] [nrf noup] soc: arm: nRF91: Add SPU Flash/RAM alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TF-M will uses SPU alignment during build time to make sure all partitions can be locked down with the SPU. So adding them for nRF91 The nRF54L15 doesn't use the SPU for setting the security attributes for flash/RAM regions. In order to avoid having multiple Kconfigs with similar meaning renamed the alignment Kconfig option to something more generic in order to use the same symbol for all the TrustZone enabled devices. Ref: NCSDK-25023 Signed-off-by: Markus Swarowsky Signed-off-by: Georgios Vasilakis Signed-off-by: Michał Stasiak (cherry picked from commit 10314a5b86b430505e2327400190c29be8f3a63b) --- soc/nordic/nrf53/Kconfig | 22 ++++++++++++++-------- soc/nordic/nrf91/Kconfig | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 186fb547a7b3..3b82cb23b4a6 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -170,12 +170,15 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral -config NRF_SPU_FLASH_REGION_ALIGNMENT +config NRF_TRUSTZONE_FLASH_REGION_SIZE hex - default 0x4000 + default NRF_SPU_FLASH_REGION_SIZE help - FLASH regions must be aligned to this value due to SPU HW - limitations. + Define the flash region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. config NRF_SPU_RAM_REGION_SIZE hex @@ -183,12 +186,15 @@ config NRF_SPU_RAM_REGION_SIZE help RAM region size for the NRF_SPU peripheral -config NRF_SPU_RAM_REGION_ALIGNMENT +config NRF_TRUSTZONE_RAM_REGION_SIZE hex - default 0x2000 + default NRF_SPU_RAM_REGION_SIZE help - RAM regions must be aligned to this value due to SPU HW - limitations. + Define the RAM region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 bool "Forward GPIO pins to network core" diff --git a/soc/nordic/nrf91/Kconfig b/soc/nordic/nrf91/Kconfig index 122768a05e97..35d772821d83 100644 --- a/soc/nordic/nrf91/Kconfig +++ b/soc/nordic/nrf91/Kconfig @@ -27,6 +27,16 @@ config NRF_SPU_FLASH_REGION_SIZE help FLASH region size for the NRF_SPU peripheral +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default NRF_SPU_FLASH_REGION_SIZE + help + Define the flash region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. + config NRF_SPU_RAM_REGION_SIZE hex default 0x2000 @@ -40,4 +50,14 @@ config NRF_ENABLE_ICACHE config NRF91_ANOMALY_36_WORKAROUND bool "Anomaly 36 workaround" +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default NRF_SPU_RAM_REGION_SIZE + help + Define the RAM region size from a TrustZone perspective. + This is used when we set the security attributes(S/NSC/NS) of a region + in TrustZone enabled devices. + In practice this option defines the granularity of the security attributes, + i.e. the smallest region that can be set to secure or non-secure. + endif # SOC_SERIES_NRF91 From 2d4eb2f1d7e02d28f0b73e4aba7288654bd012b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 24 Mar 2026 11:11:28 +0100 Subject: [PATCH 3192/3334] [nrf fromlist] dts: bindings: nrf-gpio: Add latch detect property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added property to enable latch detect mode. Upstream PR #: 106173 Signed-off-by: Michał Stasiak (cherry picked from commit ce830299ff02a51697bdb207c0c8fa22a81e988a) --- dts/bindings/gpio/nordic,nrf-gpio.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dts/bindings/gpio/nordic,nrf-gpio.yaml b/dts/bindings/gpio/nordic,nrf-gpio.yaml index 6bde10bad07d..238274533aca 100644 --- a/dts/bindings/gpio/nordic,nrf-gpio.yaml +++ b/dts/bindings/gpio/nordic,nrf-gpio.yaml @@ -37,6 +37,11 @@ properties: port = <1>; + latch-detect: + type: boolean + description: | + Enable latch detect mode for this GPIO port. + gpio-cells: - pin - flags From cea5e0b01568b5ac8951503476cdecc98073acd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Tue, 24 Mar 2026 11:12:08 +0100 Subject: [PATCH 3193/3334] [nrf fromlist] drivers: gpio: gpio_nrfx: Add support for latch detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added latch detection mode based on DTS property. Required register is inaccessible in non-secure builds and on nRF54H20 SoC. Added hidden Kconfig to guard it. Upstream PR #: 106173 Signed-off-by: Michał Stasiak (cherry picked from commit ca421b88606afeca40bac9531a39372a26737e6b) --- drivers/gpio/Kconfig.nrfx | 4 ++++ drivers/gpio/gpio_nrfx.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/drivers/gpio/Kconfig.nrfx b/drivers/gpio/Kconfig.nrfx index bd77dbd35bd3..576242f43d3c 100644 --- a/drivers/gpio/Kconfig.nrfx +++ b/drivers/gpio/Kconfig.nrfx @@ -17,3 +17,7 @@ config GPIO_NRFX_INTERRUPT The option can be used to disable the GPIO interrupt support to significantly reduce memory footprint in case of application that does not need GPIO interrupts. + +config GPIO_NRFX_HAS_LATCH_DETECT + bool + default y if !(SOC_NRF54H20 || TRUSTED_EXECUTION_NONSECURE) diff --git a/drivers/gpio/gpio_nrfx.c b/drivers/gpio/gpio_nrfx.c index f5e23f01659c..67aa1392fdf3 100644 --- a/drivers/gpio/gpio_nrfx.c +++ b/drivers/gpio/gpio_nrfx.c @@ -38,6 +38,10 @@ #define GPIOTE_FLAG_FIXED_CHAN BIT(1) #endif +#if NRF_GPIO_HAS_DETECT_MODE && defined(CONFIG_GPIO_NRFX_HAS_LATCH_DETECT) +#define GPIO_LATCH_DETECT_SUPPORT 1 +#endif + struct gpio_nrfx_data { /* gpio_driver_data needs to be first */ struct gpio_driver_data common; @@ -51,6 +55,9 @@ struct gpio_nrfx_cfg { nrfx_gpiote_t *gpiote; uint32_t edge_sense; uint8_t port_num; +#if defined(GPIO_LATCH_DETECT_SUPPORT) + bool latch_detect; +#endif #if defined(GPIOTE_FEATURE_FLAG) uint32_t flags; #endif @@ -449,6 +456,10 @@ static int gpio_nrfx_pin_interrupt_configure(const struct device *port, return 0; } +#if defined(GPIO_LATCH_DETECT_SUPPORT) + nrf_gpio_port_detect_latch_set(cfg->port, cfg->latch_detect); +#endif + nrfx_gpiote_trigger_config_t trigger_config = { .trigger = get_trigger(mode, trig), }; @@ -696,6 +707,8 @@ static DEVICE_API(gpio, gpio_nrfx_drv_api_funcs) = { .gpiote = GPIOTE_REF(id), \ .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ .port_num = DT_INST_PROP(id, port), \ + IF_ENABLED(GPIO_LATCH_DETECT_SUPPORT, \ + (.latch_detect = DT_INST_PROP(id, latch_detect),)) \ IF_ENABLED(GPIOTE_FEATURE_FLAG, \ (.flags = \ (DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) ? \ From 566e95b79e70908ccd20124ca09886c37f8af1b9 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 18 Jul 2025 12:48:25 +0200 Subject: [PATCH 3194/3334] [nrf noup] shell: fix shell: fix threadless option The shell at some point supported CONFIG_MULTITHREADING=n but this has not been maintained. Adjust the shell to support threadless operation similar to how logging works with no logging thread. With these adjustments, building with CONFIG_SHELL_MINIMAL and CONFIG_MULTITHREADING=n, shells can now be used like logging by calling shell_process() with non-polling backends, like async or irq driven UART based backends. Signed-off-by: Bjarki Arge Andreasen (cherry picked from commit 31b404a720a95363a475b90cdabbd74197311914) --- include/zephyr/shell/shell.h | 27 ++++++++++++++++++++++----- subsys/shell/Kconfig | 2 +- subsys/shell/shell.c | 28 ++++++++++++++++++++++------ subsys/shell/shell_ops.c | 7 +++++-- subsys/shell/shell_ops.h | 19 +++++++++++++++++++ 5 files changed, 69 insertions(+), 14 deletions(-) diff --git a/include/zephyr/shell/shell.h b/include/zephyr/shell/shell.h index 7348fb157cfc..41ace41f5d5d 100644 --- a/include/zephyr/shell/shell.h +++ b/include/zephyr/shell/shell.h @@ -1040,10 +1040,11 @@ struct shell_ctx { volatile union shell_backend_cfg cfg; volatile union shell_backend_ctx ctx; +#if CONFIG_MULTITHREADING struct k_event signal_event; - struct k_sem lock_sem; k_tid_t tid; +#endif int ret_val; }; @@ -1079,13 +1080,29 @@ struct shell { LOG_INSTANCE_PTR_DECLARE(log); const char *name; + +#if CONFIG_MULTITHREADING struct k_thread *thread; k_thread_stack_t *stack; +#endif }; extern void z_shell_print_stream(const void *user_ctx, const char *data, size_t data_len); +#if CONFIG_MULTITHREADING +#define Z_SHELL_THREAD_DEFINE(_name) \ + static K_KERNEL_STACK_DEFINE(_name##_stack, CONFIG_SHELL_STACK_SIZE); \ + static struct k_thread _name##_thread + +#define Z_SHELL_THREAD_INIT(_name) \ + .thread = &_name##_thread, \ + .stack = _name##_stack, +#else +#define Z_SHELL_THREAD_DEFINE(_name) +#define Z_SHELL_THREAD_INIT(_name) +#endif + /** @brief Internal macro for defining a shell instance. * * As it does not create the default shell logging backend it allows to use @@ -1106,8 +1123,7 @@ extern void z_shell_print_stream(const void *user_ctx, const char *data, IS_ENABLED(CONFIG_SHELL_PRINTF_AUTOFLUSH), z_shell_print_stream); \ LOG_INSTANCE_REGISTER(shell, _name, CONFIG_SHELL_LOG_LEVEL); \ Z_SHELL_STATS_DEFINE(_name); \ - static K_KERNEL_STACK_DEFINE(_name##_stack, CONFIG_SHELL_STACK_SIZE); \ - static struct k_thread _name##_thread; \ + Z_SHELL_THREAD_DEFINE(_name); \ static const STRUCT_SECTION_ITERABLE(shell, _name) = { \ .default_prompt = _prompt, \ .iface = _transport_iface, \ @@ -1117,8 +1133,9 @@ extern void z_shell_print_stream(const void *user_ctx, const char *data, .fprintf_ctx = &_name##_fprintf, \ .stats = Z_SHELL_STATS_PTR(_name), \ .log_backend = _log_backend, \ - LOG_INSTANCE_PTR_INIT(log, shell, _name).name = \ - STRINGIFY(_name), .thread = &_name##_thread, .stack = _name##_stack} + LOG_INSTANCE_PTR_INIT(log, shell, _name).name = STRINGIFY(_name), \ + Z_SHELL_THREAD_INIT(_name) \ + } /** * @brief Macro for defining a shell instance. diff --git a/subsys/shell/Kconfig b/subsys/shell/Kconfig index 4bbc1aef709d..3565b2556c1a 100644 --- a/subsys/shell/Kconfig +++ b/subsys/shell/Kconfig @@ -8,7 +8,7 @@ menuconfig SHELL bool "Shell" imply LOG_RUNTIME_FILTERING - select EVENTS + select EVENTS if MULTITHREADING if SHELL diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index b86806a18c11..1ea4503616f9 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -1213,13 +1213,21 @@ static void state_collect(const struct shell *sh) static void transport_evt_handler(enum shell_transport_evt evt_type, void *ctx) { struct shell *sh = (struct shell *)ctx; + +#if CONFIG_MULTITHREADING enum shell_signal sig = evt_type == SHELL_TRANSPORT_EVT_RX_RDY ? SHELL_SIGNAL_RXRDY : SHELL_SIGNAL_TXDONE; k_event_post(&sh->ctx->signal_event, sig); +#endif + + if (evt_type == SHELL_TRANSPORT_EVT_TX_RDY) { + z_flag_tx_rdy_set(sh, true); + } } +#if CONFIG_MULTITHREADING static void shell_log_process(const struct shell *sh) { bool processed = false; @@ -1243,6 +1251,7 @@ static void shell_log_process(const struct shell *sh) } while (processed && !k_event_test(&sh->ctx->signal_event, SHELL_SIGNAL_RXRDY)); } +#endif static int instance_init(const struct shell *sh, const void *transport_config, @@ -1256,8 +1265,10 @@ static int instance_init(const struct shell *sh, sh->ctx->selected_cmd = root_cmd_find(CONFIG_SHELL_CMD_ROOT); } +#if CONFIG_MULTITHREADING k_event_init(&sh->ctx->signal_event); k_sem_init(&sh->ctx->lock_sem, 1, 1); +#endif if (IS_ENABLED(CONFIG_SHELL_STATS)) { sh->stats->log_lost_cnt = 0; @@ -1324,6 +1335,7 @@ static int instance_uninit(const struct shell *sh) return 0; } +#if CONFIG_MULTITHREADING typedef void (*shell_signal_handler_t)(const struct shell *sh); static void shell_signal_handle(const struct shell *sh, @@ -1398,6 +1410,7 @@ void shell_thread(void *shell_handle, void *arg_log_backend, z_shell_unlock(sh); } } +#endif int shell_init(const struct shell *sh, const void *transport_config, struct shell_backend_config_flags cfg_flags, @@ -1406,9 +1419,11 @@ int shell_init(const struct shell *sh, const void *transport_config, __ASSERT_NO_MSG(sh); __ASSERT_NO_MSG(sh->ctx && sh->iface && sh->default_prompt); +#if CONFIG_MULTITHREADING if (sh->ctx->tid) { return -EALREADY; } +#endif int err = instance_init(sh, transport_config, cfg_flags); @@ -1416,6 +1431,7 @@ int shell_init(const struct shell *sh, const void *transport_config, return err; } +#if CONFIG_MULTITHREADING k_tid_t tid = k_thread_create(sh->thread, sh->stack, CONFIG_SHELL_STACK_SIZE, shell_thread, (void *)sh, (void *)log_backend, @@ -1424,6 +1440,7 @@ int shell_init(const struct shell *sh, const void *transport_config, sh->ctx->tid = tid; k_thread_name_set(tid, sh->name); +#endif return 0; } @@ -1432,12 +1449,10 @@ void shell_uninit(const struct shell *sh, shell_uninit_cb_t cb) { __ASSERT_NO_MSG(sh); - if (IS_ENABLED(CONFIG_MULTITHREADING)) { - sh->ctx->uninit_cb = cb; - k_event_post(&sh->ctx->signal_event, SHELL_SIGNAL_KILL); - return; - } - +#if CONFIG_MULTITHREADING + sh->ctx->uninit_cb = cb; + k_event_post(&sh->ctx->signal_event, SHELL_SIGNAL_KILL); +#else int err = instance_uninit(sh); if (cb) { @@ -1445,6 +1460,7 @@ void shell_uninit(const struct shell *sh, shell_uninit_cb_t cb) } else { __ASSERT_NO_MSG(0); } +#endif } int shell_start(const struct shell *sh) diff --git a/subsys/shell/shell_ops.c b/subsys/shell/shell_ops.c index fa904cfc6c6f..6a61cfff2c7b 100644 --- a/subsys/shell/shell_ops.c +++ b/subsys/shell/shell_ops.c @@ -434,11 +434,14 @@ void z_shell_print_prompt_and_cmd(const struct shell *sh) static void shell_pend_on_txdone(const struct shell *sh) { - if (IS_ENABLED(CONFIG_MULTITHREADING) && - (sh->ctx->state < SHELL_STATE_PANIC_MODE_ACTIVE)) { +#if CONFIG_MULTITHREADING + if (sh->ctx->state < SHELL_STATE_PANIC_MODE_ACTIVE) { k_event_wait(&sh->ctx->signal_event, SHELL_SIGNAL_TXDONE, false, K_FOREVER); k_event_clear(&sh->ctx->signal_event, SHELL_SIGNAL_TXDONE); } else { +#else + { +#endif /* Blocking wait in case of bare metal. */ while (!z_flag_tx_rdy_get(sh)) { } diff --git a/subsys/shell/shell_ops.h b/subsys/shell/shell_ops.h index a608c17daaea..feec96172ead 100644 --- a/subsys/shell/shell_ops.h +++ b/subsys/shell/shell_ops.h @@ -381,6 +381,7 @@ void z_shell_vfprintf(const struct shell *sh, enum shell_vt100_color color, */ void z_shell_backend_rx_buffer_flush(const struct shell *sh); +#if CONFIG_MULTITHREADING static inline bool z_shell_trylock(const struct shell *sh, k_timeout_t timeout) { return k_sem_take(&sh->ctx->lock_sem, timeout) == 0; @@ -395,6 +396,24 @@ static inline void z_shell_unlock(const struct shell *sh) { k_sem_give(&sh->ctx->lock_sem); } +#else +static inline bool z_shell_trylock(const struct shell *sh, k_timeout_t timeout) +{ + ARG_UNUSED(sh); + ARG_UNUSED(timeout); + return true; +} + +static inline void z_shell_lock(const struct shell *sh) +{ + ARG_UNUSED(sh); +} + +static inline void z_shell_unlock(const struct shell *sh) +{ + ARG_UNUSED(sh); +} +#endif #ifdef __cplusplus } From 81a1306bc1cf71428a12aa595f33922b1c17a111 Mon Sep 17 00:00:00 2001 From: Jonathan Nilsen Date: Sat, 21 Mar 2026 09:59:12 +0100 Subject: [PATCH 3195/3334] [nrf fromtree] soc: nordic: uicr: add PERIPHCONF validation Add targets to the UICR generator image that validates and/or prints the register configurations in the generated PERIPHCONF blob: * periphconf_validate (only check for errors) * periphconf_dump (print entire blob, also prints errors) * periphconf_dump_raw (same as periphconf_dump but with hex values) Equivalent targets exist for SECONDARY PERIPHCONF: * secondary_periphconf_validate * secondary_periphconf_dump * secondary_periphconf_dump_raw The new validation replaces the old conflict detection ("PERIPHCONF has conflicting registers") and adds more checks. PERIPHCONF registers are now also by default printed out in a human readable format instead of by raw hex address and value. Signed-off-by: Jonathan Nilsen (cherry picked from commit cea520433d39f45b6d90f3fdd8c4e7be854d17b1) --- .../common/uicr/gen_uicr/CMakeLists.txt | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index e877e67c504f..c216a5d5e8c5 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -71,6 +71,14 @@ function(compute_optional_partition_address_and_size partition_nodelabel output_ endif() endfunction() +set(IRONSIDE_SE_PERIPHCONF_REGISTERS_FILE "") + +if(CONFIG_SOC_NRF54H20) + set(IRONSIDE_SE_PERIPHCONF_REGISTERS_FILE + "${IRONSIDE_SUPPORT_DIR}/se/resources/periphconf_registers-nrf54h20_xxaa-v23.4.0+27.json" + ) +endif() + # Use CMAKE_VERBOSE_MAKEFILE to silence an unused-variable warning. if(CMAKE_VERBOSE_MAKEFILE) endif() @@ -356,6 +364,70 @@ if(CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_MPCCONF_S list(APPEND policy_args --policy-mpcconf-stage ${CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_VALUE}) endif() +set(periphconf_check_base_cmd + ${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE} + ${PYTHON_EXECUTABLE} ${IRONSIDE_SUPPORT_DIR}/se/tool/ironside/__main__.py + periphconf-check + --in-periphconf-registers-json ${IRONSIDE_SE_PERIPHCONF_REGISTERS_FILE} +) + +set(periphconf_validate_command) +set(secondary_periphconf_validate_command) + +if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF AND IRONSIDE_SE_PERIPHCONF_REGISTERS_FILE) + set(check_cmd ${periphconf_check_base_cmd} --in-periphconf-hex ${periphconf_hex_file}) + + set(periphconf_validate_build_command + COMMAND ${check_cmd} --mode errors + ) + + add_custom_target( + periphconf_validate + COMMAND ${check_cmd} --mode errors + DEPENDS ${periphconf_hex_file} + COMMENT "Validating ${periphconf_hex_file}" + ) + add_custom_target( + periphconf_dump + COMMAND ${check_cmd} --mode full + DEPENDS ${periphconf_hex_file} + COMMENT "Printing ${periphconf_hex_file}" + ) + add_custom_target( + periphconf_dump_raw + COMMAND ${check_cmd} --mode full --style raw + DEPENDS ${periphconf_hex_file} + COMMENT "Printing ${periphconf_hex_file}" + ) +endif() + +if(CONFIG_GEN_UICR_SECONDARY_GENERATE_PERIPHCONF AND IRONSIDE_SE_PERIPHCONF_REGISTERS_FILE) + set(check_cmd ${periphconf_check_base_cmd} --in-periphconf-hex ${secondary_periphconf_hex_file}) + + set(secondary_periphconf_validate_build_command + COMMAND ${check_cmd} --mode errors + ) + + add_custom_target( + secondary_periphconf_validate + COMMAND ${check_cmd} --mode errors + DEPENDS ${secondary_periphconf_hex_file} + COMMENT "Validating ${secondary_periphconf_hex_file}" + ) + add_custom_target( + secondary_periphconf_dump + COMMAND ${check_cmd} --mode full + DEPENDS ${secondary_periphconf_hex_file} + COMMENT "Printing ${secondary_periphconf_hex_file}" + ) + add_custom_target( + secondary_periphconf_dump_raw + COMMAND ${check_cmd} --mode full --style raw + DEPENDS ${secondary_periphconf_hex_file} + COMMENT "Printing ${secondary_periphconf_hex_file}" + ) +endif() + add_custom_command( OUTPUT ${gen_uicr_outputs} COMMAND ${PYTHON_EXECUTABLE} ${IRONSIDE_SUPPORT_DIR}/se/tool/ironside/__main__.py @@ -376,6 +448,8 @@ add_custom_command( ${protectedmem_args} ${secondary_args} ${policy_args} + ${periphconf_validate_build_command} + ${secondary_periphconf_validate_build_command} DEPENDS ${gen_uicr_depends} WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} COMMENT "Generating UICR artifacts" From b86a16658e8195b26c68aa040fd4b91cbdb0852e Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 16 Mar 2026 20:08:46 +0530 Subject: [PATCH 3196/3334] [nrf fromtree] modules: hostap: Add support for external WPA3-SAE implementation This is needed for any downstream vendors to replace wpa_supplicant internal implementation with their own module (e.g., WPA3-PSA for Nordic). And the common symbol helps us maitain any implementations easily. Signed-off-by: Chaitanya Tata (cherry picked from commit e7bd45b1e33ee7ef8129035a472f05bca71fb71e) --- .../networking/api/wifi_crypto.rst | 6 ++- doc/releases/migration-guide-4.4.rst | 12 ++++++ modules/hostap/Kconfig | 38 +++++++++++++++++-- modules/hostap/src/supp_api.c | 10 ++--- tests/net/wifi/configs/testcase.yaml | 2 +- 5 files changed, 58 insertions(+), 10 deletions(-) diff --git a/doc/connectivity/networking/api/wifi_crypto.rst b/doc/connectivity/networking/api/wifi_crypto.rst index e7011680f49a..ba418e7fb9cc 100644 --- a/doc/connectivity/networking/api/wifi_crypto.rst +++ b/doc/connectivity/networking/api/wifi_crypto.rst @@ -18,7 +18,11 @@ Feature set (from hostap Kconfig) Features are gated by Kconfig. Relevant options include: * :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_WEP` — WEP (legacy) -* :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3` — WPA3-SAE (default on) +* :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_COMMON` — WPA3-SAE when Internal or + External is selected (``WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION``; default Internal). + :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3` is promptless and turns on the internal + bignum SAE path when Internal is chosen (set the implementation choice in ``prj.conf``, not + this symbol). * :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP` — Wi-Fi Easy Connect (DPP) * :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS` — Wi-Fi Protected Setup * :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P` — P2P / Wi-Fi Direct (implies WPS) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 5829b067c99c..f6e2f4434bb9 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -1210,6 +1210,9 @@ Bluetooth HCI Networking ********** +Wi-Fi +===== + * :c:struct:`wifi_channel_info` gained a ``band`` field for set-channel. Behaviour is backwards compatible for 2.4 GHz (channels 1–14) and 5 GHz (36–165): omit or leave ``band`` as :c:macro:`WIFI_FREQ_BAND_UNKNOWN` and the driver infers the @@ -1217,6 +1220,15 @@ Networking numbers overlap 1–14 with 2.4 GHz). Recompile so ``sizeof(struct wifi_channel_info)`` is correct when calling net_mgmt. +* WPA3 is configured with the choice + ``WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION`` (Internal, External, or None). + Replace any ``CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3=y`` line in ``prj.conf`` with + ``CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_INT=y`` (or ``_EXT`` / + ``_NONE`` as needed). :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3` is + now promptless and is selected only when Internal is chosen; do not assign it + directly. In C code, prefer :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_COMMON` + to detect either internal or external WPA3. + * Networking APIs found in * :zephyr_file:`include/zephyr/net/net_ip.h` diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 354eacaef98c..cbf64d1ece22 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -318,10 +318,42 @@ config EAP_TLSV1_3 endif # WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE -config WIFI_NM_WPA_SUPPLICANT_WPA3 - bool "WPA3 support" +choice WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION + prompt "WPA3 implementation" + default WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_INT depends on !WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE - default y + help + Select how WPA3/SAE is provided. Internal uses the supplicant + bignum-based implementation. External uses an out-of-tree + implementation (e.g. PSA crypto). None disables WPA3. + +config WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_NONE + bool "None" + help + WPA3 is disabled. Only WPA2 and earlier are available. + +config WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_INT + bool "Internal" + select WIFI_NM_WPA_SUPPLICANT_WPA3 + +config WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_EXT + bool "External" + +endchoice + +config WIFI_NM_WPA_SUPPLICANT_WPA3 + bool + help + Internal WPA3/SAE implementation (bignum-based). Selected by + WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_INT. + +config WIFI_NM_WPA_SUPPLICANT_WPA3_COMMON + bool + default y if WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_INT || \ + WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_EXT + help + WPA3/SAE is available (either internal or external implementation). + Use this in code to gate WPA3 functionality regardless of backend. config WIFI_NM_WPA_SUPPLICANT_AP bool "SoftAP mode support based on WPA supplicant" diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 756ac507b680..4c377d80b771 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -419,7 +419,7 @@ enum wifi_security_type wpas_key_mgmt_to_zephyr(bool is_hapd, void *config, int case WPA_KEY_MGMT_PSK_SHA256: return WIFI_SECURITY_TYPE_PSK_SHA256; case WPA_KEY_MGMT_SAE: - if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3)) { + if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_COMMON)) { if (pwe == 1) { return WIFI_SECURITY_TYPE_SAE_H2E; } else if (pwe == 2) { @@ -438,7 +438,7 @@ enum wifi_security_type wpas_key_mgmt_to_zephyr(bool is_hapd, void *config, int case WPA_KEY_MGMT_FT_PSK: return WIFI_SECURITY_TYPE_FT_PSK; case WPA_KEY_MGMT_FT_SAE: - if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3)) { + if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_COMMON)) { return WIFI_SECURITY_TYPE_FT_SAE; } return WIFI_SECURITY_TYPE_UNKNOWN; @@ -449,7 +449,7 @@ enum wifi_security_type wpas_key_mgmt_to_zephyr(bool is_hapd, void *config, int case WPA_KEY_MGMT_FT_IEEE8021X_SHA384: return WIFI_SECURITY_TYPE_FT_EAP_SHA384; case WPA_KEY_MGMT_SAE_EXT_KEY: - if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3)) { + if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_COMMON)) { return WIFI_SECURITY_TYPE_SAE_EXT_KEY; } return WIFI_SECURITY_TYPE_UNKNOWN; @@ -747,7 +747,7 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, } } - if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3) && + if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_COMMON) && (params->security == WIFI_SECURITY_TYPE_SAE_HNP || params->security == WIFI_SECURITY_TYPE_SAE_H2E || params->security == WIFI_SECURITY_TYPE_SAE_AUTO || @@ -853,7 +853,7 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, goto out; } - if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3)) { + if (IS_ENABLED(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_COMMON)) { if (params->sae_password) { if ((params->sae_password_length < WIFI_PSK_MIN_LEN) || (params->sae_password_length > WIFI_SAE_PSWD_MAX_LEN)) { diff --git a/tests/net/wifi/configs/testcase.yaml b/tests/net/wifi/configs/testcase.yaml index 271bcd41fdfa..5af448a39e12 100644 --- a/tests/net/wifi/configs/testcase.yaml +++ b/tests/net/wifi/configs/testcase.yaml @@ -37,7 +37,7 @@ tests: - CONFIG_EAP_AKA=y wifi.build.wpa3: extra_configs: - - CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3=y + - CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3_IMPLEMENTATION_INT=y - CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y wifi.build.ap: extra_configs: From d524053a9745c3749a151cbe7d57d8c25cd1cf08 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Wed, 25 Mar 2026 12:42:33 +0000 Subject: [PATCH 3197/3334] [nrf fromtree] modules: hostap: Display WEP Open/Shared in status Instead of WEP show WEP-OPEN and WEP-SHARED in status. Signed-off-by: Kapil Bhatt (cherry picked from commit df9a974782f3a4d12afb141d6aadd0521d78775f) --- include/zephyr/net/wifi.h | 13 +++++++++++++ include/zephyr/net/wifi_mgmt.h | 2 ++ modules/hostap/src/supp_api.c | 18 ++++++++++++++++++ subsys/net/l2/wifi/wifi_mgmt.c | 13 +++++++++++++ subsys/net/l2/wifi/wifi_shell.c | 6 ++++-- 5 files changed, 50 insertions(+), 2 deletions(-) diff --git a/include/zephyr/net/wifi.h b/include/zephyr/net/wifi.h index ace82cd4d1bc..0929cc844154 100644 --- a/include/zephyr/net/wifi.h +++ b/include/zephyr/net/wifi.h @@ -125,6 +125,16 @@ enum wifi_security_type { /** @endcond */ }; +/** @brief WEP key type (based on key length). */ +enum wifi_wep_key_type { + /** WEP key type unknown or not applicable. */ + WIFI_WEP_KEY_TYPE_UNKNOWN = 0, + /** WEP-64 (40-bit key: 5 ASCII or 10 hex chars). */ + WIFI_WEP_KEY_TYPE_64, + /** WEP-128 (104-bit key: 13 ASCII or 26 hex chars). */ + WIFI_WEP_KEY_TYPE_128, +}; + /** @brief EPA method Types. */ enum wifi_eap_type { /** No EPA security. */ @@ -239,6 +249,9 @@ const char *wifi_security_txt(enum wifi_security_type security); /** Helper function to get user-friendly wpa3 enterprise security type name. */ const char *wifi_wpa3_enterprise_txt(enum wifi_wpa3_enterprise_type wpa3_ent); +/** Helper function to get user-friendly WEP key type name. */ +const char *wifi_wep_key_type_txt(enum wifi_wep_key_type wep_key_type); + /** @brief IEEE 802.11w - Management frame protection. */ enum wifi_mfp_options { /** MFP disabled. */ diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 24f3ec36aac6..3fd632ddea0f 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -863,6 +863,8 @@ struct wifi_iface_status { enum wifi_wpa3_enterprise_type wpa3_ent_type; /** Security type, see enum wifi_security_type */ enum wifi_security_type security; + /** WEP key type (64-bit or 128-bit), see enum wifi_wep_key_type */ + enum wifi_wep_key_type wep_key_type; /** MFP options, see enum wifi_mfp_options */ enum wifi_mfp_options mfp; /** RSSI */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 4c377d80b771..2490cf1e9c0d 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -404,6 +404,11 @@ enum wifi_security_type wpas_key_mgmt_to_zephyr(bool is_hapd, void *config, int for (int i = 0; i < NUM_WEP_KEYS; i++) { if (ssid->wep_key_len[i] > 0) { + if (ssid->auth_alg == WPA_AUTH_ALG_OPEN) { + return WIFI_SECURITY_TYPE_WEP_OPEN; + } else if (ssid->auth_alg == WPA_AUTH_ALG_SHARED) { + return WIFI_SECURITY_TYPE_WEP_SHARED; + } return WIFI_SECURITY_TYPE_WEP; } } @@ -1489,6 +1494,19 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status status->band = wpas_band_to_zephyr(wpas_freq_to_band(wpa_s->assoc_freq)); status->wpa3_ent_type = wpas_key_mgmt_to_zephyr_wpa3_ent(key_mgmt); status->security = wpas_key_mgmt_to_zephyr(0, ssid, key_mgmt, proto, sae_pwe); +#ifdef CONFIG_WEP + if (status->security == WIFI_SECURITY_TYPE_WEP || + status->security == WIFI_SECURITY_TYPE_WEP_OPEN || + status->security == WIFI_SECURITY_TYPE_WEP_SHARED) { + size_t klen = ssid->wep_key_len[ssid->wep_tx_keyidx]; + + if (klen == 5 || klen == 10) { + status->wep_key_type = WIFI_WEP_KEY_TYPE_64; + } else if (klen == 13 || klen == 26) { + status->wep_key_type = WIFI_WEP_KEY_TYPE_128; + } + } +#endif status->mfp = get_mfp(ssid->ieee80211w); ieee80211_freq_to_chan(wpa_s->assoc_freq, &channel); status->channel = channel; diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index aa7891ab91de..db5156fb60e9 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -104,6 +104,19 @@ const char *wifi_security_txt(enum wifi_security_type security) } } +const char *wifi_wep_key_type_txt(enum wifi_wep_key_type wep_key_type) +{ + switch (wep_key_type) { + case WIFI_WEP_KEY_TYPE_64: + return " (64-bit key)"; + case WIFI_WEP_KEY_TYPE_128: + return " (128-bit key)"; + case WIFI_WEP_KEY_TYPE_UNKNOWN: + default: + return ""; + } +} + const char *wifi_wpa3_enterprise_txt(enum wifi_wpa3_enterprise_type wpa3_ent) { switch (wpa3_ent) { diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index a194979cb6ad..1f383050ee3c 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -1266,8 +1266,10 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) sizeof(mac_string_buf))); PR("Band: %s\n", wifi_band_txt(status.band)); PR("Channel: %d\n", status.channel); - PR("Security: %s %s\n", wifi_wpa3_enterprise_txt(status.wpa3_ent_type), - wifi_security_txt(status.security)); + PR("Security: %s %s%s\n", + wifi_wpa3_enterprise_txt(status.wpa3_ent_type), + wifi_security_txt(status.security), + wifi_wep_key_type_txt(status.wep_key_type)); PR("MFP: %s\n", wifi_mfp_txt(status.mfp)); if (status.iface_mode == WIFI_MODE_INFRA) { PR("RSSI: %d\n", status.rssi); From 60f50d3192fbe0cb81d6db47eb6d1f578f801f2c Mon Sep 17 00:00:00 2001 From: Karun Kumar Eagalapati Date: Mon, 23 Mar 2026 17:27:48 +0530 Subject: [PATCH 3198/3334] [nrf fromtree] manifest: update nrf_wifi to RPU 1.2.14.8 1. Update firmware binaries and patches using the new UCC toolkit. 2. Add WPA3-HNP/H2E display support and enforce max BSS limit. 3. Add support for IPv4 UDP packets with optional checksums. 4. Add build-time options for BT disabling and slot allocation. 5. Bump RPU version from 1.2.14.7 to 1.2.14.8. Signed-off-by: Karun Kumar Eagalapati (cherry picked from commit 6b124d5784f8d13aff8171aea3e6ecc63d5c79c1) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4f5640818960..069c00081d94 100644 --- a/west.yml +++ b/west.yml @@ -361,7 +361,7 @@ manifest: revision: 158b9710d6e10c57b2c623f8f4178f0bbc85c23f path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: cebea8e27ceb91a7d4580d17db65f93669befe72 + revision: 1a4e59f4c6685877f6bff08bb1812bf9318da6d2 path: modules/lib/nrf_wifi - name: open-amp revision: 5efe7974f9546582e99f5a842a816ea4b65f5227 From aec4eb492088d2d552a909f5ad0c8e1d0d79c54c Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Thu, 26 Mar 2026 10:01:46 +0000 Subject: [PATCH 3199/3334] [nrf fromtree] drivers: nrf_wifi: Add kconfig for BT coex and BT slot allocation time Add Kconfig for BT coex and slot allocation time. Signed-off-by: Kapil Bhatt (cherry picked from commit cd0953e3562bf74557d747af687b1b9ccd3a0d74) --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 2530fd3cf8f2..19c98045e44b 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -228,6 +228,13 @@ config NRF70_SR_COEX_SWCTRL1_OUTPUT config NRF70_SR_COEX_BT_GRANT_ACTIVE_LOW int "Configure BT grant active low" default 1 + +config NRF70_BT_SLOT_TIME + int "BT slot allocation time in Wi-Fi scan (ms)" + range 0 255 + default 0 + help + Time allocated in milliseconds for SR between successive Wi-Fi channel scan. endif # NRF70_SR_COEX config NRF70_WORKQ_STACK_SIZE From c3d6227078f5aefeaef86ad90049bdbfcbd40818 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Thu, 26 Mar 2026 11:42:27 +0000 Subject: [PATCH 3200/3334] [nrf fromtree] drivers: nrf_wifi: Add NRF_WIFI_WPA3 AUTO and FT_SAE security type Add NRF_WIFI_WPA3_AUTO and NRF_WIFI_WPA3_FT_SAE security type in nrf_wifi driver. Signed-off-by: Kapil Bhatt (cherry picked from commit 226ce64e9b6e50123b400f1e4e9076c52cc4e684) --- drivers/wifi/nrf_wifi/src/wifi_mgmt_scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt_scan.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt_scan.c index 1a8e1e0d9004..f2024ea44249 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt_scan.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt_scan.c @@ -298,6 +298,10 @@ static inline enum wifi_security_type drv_to_wifi_mgmt(int drv_security_type) return WIFI_SECURITY_TYPE_WAPI; case NRF_WIFI_EAP: return WIFI_SECURITY_TYPE_EAP; + case NRF_WIFI_WPA3_AUTO: + return WIFI_SECURITY_TYPE_SAE_AUTO; + case NRF_WIFI_WPA3_FT_SAE: + return WIFI_SECURITY_TYPE_FT_SAE; default: return WIFI_SECURITY_TYPE_UNKNOWN; } From df61a4966c09f083d6cf68ced7d082647ea9ed54 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Mon, 23 Mar 2026 16:42:14 +0100 Subject: [PATCH 3201/3334] [nrf fromlist] drivers: timer: nrf_grtc_timer: Add Kconfig options for uninit behavior Add Kconfig options to control whether the GRTC timer is stopped and/or cleared when the driver is uninitialized (e.g. when sys_clock_disable() is called). Upstream PR #: 106118 Signed-off-by: Adam Kondraciuk (cherry picked from commit f07637a0577efa64915a83a3d3cdc44761f9d07e) --- drivers/timer/Kconfig.nrf_grtc | 14 ++++++++++++++ modules/hal_nordic/nrfx/nrfx_kconfig.h | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/timer/Kconfig.nrf_grtc b/drivers/timer/Kconfig.nrf_grtc index ab230245ebfd..499b65b7e38e 100644 --- a/drivers/timer/Kconfig.nrf_grtc +++ b/drivers/timer/Kconfig.nrf_grtc @@ -59,6 +59,20 @@ config NRF_GRTC_TIMER_AUTO_KEEP_ALIVE if NRF_GRTC_START_SYSCOUNTER +config NRF_GRTC_TIMER_STOP_AT_UNINIT + bool "Automatically stop the GRTC when uninitialized" + default y if !MCUBOOT + help + If enabled, the GRTC timer will be stopped automatically + when the driver is uninitialized (e.g. when sys_clock_disable() is called). + +config NRF_GRTC_TIMER_CLEAR_AT_UNINIT + bool "Automatically clear the GRTC when uninitialized" + default y if !MCUBOOT + help + If enabled, the GRTC timer will be cleared automatically + when the driver is uninitialized (e.g. when sys_clock_disable() is called). + choice NRF_GRTC_TIMER_SOURCE prompt "nRF GRTC clock source" # Default to LFLPRC if CLOCK_CONTROL_NRF_K32SRC_RC for backwards compatibility diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index b63b2ed4e308..8d4113215354 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -150,6 +150,14 @@ #define NRFX_GRTC_CONFIG_AUTOSTART 1 #endif +#ifdef CONFIG_NRF_GRTC_TIMER_STOP_AT_UNINIT +#define NRFX_GRTC_CONFIG_STOP_AT_UNINIT 1 +#endif + +#ifdef CONFIG_NRF_GRTC_TIMER_CLEAR_AT_UNINIT +#define NRFX_GRTC_CONFIG_CLEAR_AT_UNINIT 1 +#endif + #ifdef CONFIG_NRFX_GPIOTE #define NRFX_GPIOTE_ENABLED 1 #endif From 2ef5518aae69b068a91a465753105a15c8470ace Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Fri, 27 Mar 2026 16:36:38 +0100 Subject: [PATCH 3202/3334] [nrf fromtree] bluetooth: host: Improve `bt_keys` loading from settings Before config flags were introduced to `bt_keys`, the `keys_set` allowed loading previously stored keys after disabling support for Bluetooth LE legacy pairing or signing during DFU (only beginning of the settings record was used after the DFU). Introducing version field prevents from loading keys in this scenario. Settings records that contain extra data are not migrated to the new format during the settings load operation and eventually are cleared. Change allows to automatically migrate `bt_keys` stored with extra data to the new format in the most common scenario where both legacy pairing and signing support are disabled. This allows to still properly load and use the keys. Signed-off-by: Marek Pieta (cherry picked from commit e8e596dcf17348bc7f488b4dfe06fe0dd736a295) --- subsys/bluetooth/host/keys.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 6d58f8ed0baf..7b92e8498e1b 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -46,7 +46,9 @@ static struct bt_keys key_pool[CONFIG_BT_MAX_PAIRED]; /* Configuration version used to detect if the device has configuration flags present in the stored * keys. Shall be higher than the maximum value of the `enc_size` field (16). */ -#define STORAGE_CFG_VERSION 17U +#define STORAGE_CFG_VERSION_MIN 17U +#define STORAGE_CFG_VERSION 17U +BUILD_ASSERT(STORAGE_CFG_VERSION >= STORAGE_CFG_VERSION_MIN, "STORAGE_CFG_VERSION is too small"); BUILD_ASSERT(STORAGE_CFG_VERSION <= UINT8_MAX, "STORAGE_CFG_VERSION is too large"); /* Configuration flags for storage. Based on the bt_keys_cfg_flags enum. */ #define STORAGE_CFG_FLAGS \ @@ -424,7 +426,7 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return -ENOMEM; } if (len != BT_KEYS_STORAGE_LEN) { - if ((uint8_t)val[0] != (uint8_t)STORAGE_CFG_VERSION && + if ((uint8_t)val[0] < (uint8_t)STORAGE_CFG_VERSION_MIN && len == BT_KEYS_STORAGE_LEN_COMPAT) { /* This check migrates keys without configuration flags to the new format * granted only the configuration version and flags are missing. Older keys @@ -448,6 +450,35 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, return -EINVAL; } + } else if (!IS_ENABLED(CONFIG_BT_SIGNING) && IS_ENABLED(CONFIG_BT_SMP_SC_PAIR_ONLY) && + (uint8_t)val[0] < (uint8_t)STORAGE_CFG_VERSION_MIN) { + /* Migrate `bt_keys` stored with extra data to the new format in the most common + * scenario where both legacy pairing and signing support are disabled. This allows + * to still properly load and use the keys after firmware upgrade. + */ + size_t load_size = BT_KEYS_STORAGE_LEN_COMPAT; + + if (IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)) { + /* Restoring aging counter is not implemented for this use-case. */ + LOG_WRN("Skip aging counter - keys for %s", bt_addr_le_str(&addr)); + /* `aging_counter` is an `uint32_t` */ + load_size -= sizeof(uint32_t); + } + + if (len >= load_size) { + LOG_DBG("Adding configuration flags to keys for %s", bt_addr_le_str(&addr)); + keys->cfg_version = STORAGE_CFG_VERSION; + sys_put_le24(STORAGE_CFG_FLAGS, keys->cfg_flags); + (void)memcpy((char *)keys + offsetof(struct bt_keys, enc_size), + val, load_size); + /* Ensure no unsupported key types are set. */ + keys->keys &= (BT_KEYS_IRK | BT_KEYS_LTK_P256); + if ((keys->keys & BT_KEYS_LTK_P256) == 0U) { + LOG_WRN("Dropping keys for %s, no SC LTK", bt_addr_le_str(&addr)); + bt_keys_clear(keys); + return -EINVAL; + } + } } else { memcpy(keys->storage_start, val, len); } From f123222929f9e7719b881d162140fc0af6496a11 Mon Sep 17 00:00:00 2001 From: Tomasz Chyrowicz Date: Wed, 1 Apr 2026 09:35:53 +0200 Subject: [PATCH 3203/3334] [nrf noup] tests: ram_context_for_isr: Disable KMU by default nrf-squash! [nrf noup] tests: ram_context_for_isr: Disable KMU by default Add missing overlay file for the nrf54lm20b board Ref: NCSDK-38489 Signed-off-by: Tomasz Chyrowicz (cherry picked from commit e5618fec38e228854881ecc4ff9c993894a705d1) --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..963ba83325a4 --- /dev/null +++ b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_CRACEN_LIB_KMU=n From 8a83eefdda731eb691e3bf210f91ad8309bb2acb Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Tue, 14 Apr 2026 06:18:05 +0000 Subject: [PATCH 3204/3334] [nrf fromtree] net: wifi: Fix P2P connect command from shell The P2P connect command was failing because keypad method does not require method string. The PIN is directly provided as argument. Signed-off-by: Kapil Bhatt (cherry picked from commit 525c9a8eeb8c42a3d23470ddec9a4a04f135ef37) --- modules/hostap/src/supp_api.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 2490cf1e9c0d..05ded6f84618 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -2994,13 +2994,12 @@ int supplicant_p2p_oper(const struct device *dev, struct wifi_p2p_params *params join_str); break; case WIFI_P2P_METHOD_KEYPAD: - method_str = "keypad"; if (params->connect.pin[0] == '\0') { wpa_printf(MSG_ERROR, "PIN required for keypad method"); return -EINVAL; } - snprintk(cmd_buf, sizeof(cmd_buf), "P2P_CONNECT %s %s %s go_intent=%d%s%s", - addr_str, method_str, params->connect.pin, + snprintk(cmd_buf, sizeof(cmd_buf), "P2P_CONNECT %s %s go_intent=%d%s%s", + addr_str, params->connect.pin, params->connect.go_intent, freq_str, join_str); break; default: From 2277baa5e4dd7a3b72234baa28a8a6f40579e451 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Wed, 1 Apr 2026 07:34:26 +0000 Subject: [PATCH 3205/3334] [nrf fromtree] net: wifi: Fix wps pin support In wps pin support, WIFI_WPS_PIN_GET case only retrieves the PIN but never starts WPS negotiation. Signed-off-by: Kapil Bhatt (cherry picked from commit 258acd69ef9cb6fd66f9b15844eeb7418dd7a6c6) --- modules/hostap/src/supp_api.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 05ded6f84618..9e4614dc9ba8 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -2232,6 +2232,13 @@ static int supplicant_wps_pin(const struct device *dev, struct wifi_wps_config_p if (zephyr_wpa_cli_cmd_resp(wpa_s->ctrl_conn, get_pin_cmd, params->pin)) { goto out; } + + if (!wpa_cli_cmd_v("wps_pin any %s", params->pin)) { + goto out; + } + + wpas_api_ctrl.dev = dev; + wpas_api_ctrl.requested_op = WPS_PIN; } else if (params->oper == WIFI_WPS_PIN_SET) { if (!wpa_cli_cmd_v("wps_check_pin %s", params->pin)) { goto out; From cc3bce4d1c1663cd36941478209f0f112be4ffaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 30 Mar 2026 17:41:21 +0200 Subject: [PATCH 3206/3334] [nrf fromtree] dts: bindings: jedec,mspi-nor: Move t-reset-recovery to spi-nor-common MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so that it can also be used in "jedec,spi-nor" nodes. Signed-off-by: Andrzej Głąbek (cherry picked from commit e5e444e33dc9d8ddc9eaec47391c4151df7cd297) --- dts/bindings/mtd/jedec,mspi-nor.yaml | 8 +------- dts/bindings/mtd/jedec,spi-nor-common.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dts/bindings/mtd/jedec,mspi-nor.yaml b/dts/bindings/mtd/jedec,mspi-nor.yaml index e59fe117557e..ce8077aed35e 100644 --- a/dts/bindings/mtd/jedec,mspi-nor.yaml +++ b/dts/bindings/mtd/jedec,mspi-nor.yaml @@ -19,6 +19,7 @@ include: - dpd-wakeup-sequence - t-enter-dpd - t-exit-dpd + - t-reset-recovery properties: read-frequency: @@ -87,13 +88,6 @@ properties: description: | Minimum duration, in nanoseconds, of an active pulse on the RESET line. - t-reset-recovery: - type: int - description: | - Minimum time, in nanoseconds, the flash chip needs to recover after reset. - Such delay is performed when a GPIO or software reset is done, or after - power is supplied to the chip if the "supply-gpios" property is specified. - transfer-timeout: type: int default: 10 diff --git a/dts/bindings/mtd/jedec,spi-nor-common.yaml b/dts/bindings/mtd/jedec,spi-nor-common.yaml index fba319da31ec..b4f65196230d 100644 --- a/dts/bindings/mtd/jedec,spi-nor-common.yaml +++ b/dts/bindings/mtd/jedec,spi-nor-common.yaml @@ -74,6 +74,13 @@ properties: If not provided the driver does not enforce a delay. + t-reset-recovery: + type: int + description: | + Minimum time, in nanoseconds, the flash chip needs to recover after reset. + Such delay is performed when a GPIO or software reset is done, or after + power is supplied to the chip if the "supply-gpios" property is specified. + has-lock: type: int description: | From f0577225f9dec0bafe97b3daae6b5e93c6ab0f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Mon, 30 Mar 2026 17:44:38 +0200 Subject: [PATCH 3207/3334] [nrf fromtree] drivers: spi_nor: Add support for supply-gpios and t-reset-recovery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for the base DT property "supply-gpios" and related "t-reset-recovery", as in the flash_mspi_nor driver. Signed-off-by: Andrzej Głąbek (cherry picked from commit 4777244fbbf7bffcc6c3f9194ad59930bc018a52) --- drivers/flash/spi_nor.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/flash/spi_nor.c b/drivers/flash/spi_nor.c index e030a1d052d5..9bffb93dcdd6 100644 --- a/drivers/flash/spi_nor.c +++ b/drivers/flash/spi_nor.c @@ -50,6 +50,8 @@ LOG_MODULE_REGISTER(spi_nor, CONFIG_FLASH_LOG_LEVEL); #define ANY_INST_HAS_T_EXIT_DPD DT_ANY_INST_HAS_PROP_STATUS_OKAY(t_exit_dpd) #define ANY_INST_HAS_DPD_WAKEUP_SEQUENCE DT_ANY_INST_HAS_PROP_STATUS_OKAY(dpd_wakeup_sequence) #define ANY_INST_HAS_RESET_GPIOS DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios) +#define ANY_INST_HAS_SUPPLY_GPIOS DT_ANY_INST_HAS_PROP_STATUS_OKAY(supply_gpios) +#define ANY_INST_HAS_T_RESET_RECOVERY DT_ANY_INST_HAS_PROP_STATUS_OKAY(t_reset_recovery) #define ANY_INST_HAS_WP_GPIOS DT_ANY_INST_HAS_PROP_STATUS_OKAY(wp_gpios) #define ANY_INST_HAS_HOLD_GPIOS DT_ANY_INST_HAS_PROP_STATUS_OKAY(hold_gpios) #define ANY_INST_USE_4B_ADDR_OPCODES DT_ANY_INST_HAS_BOOL_STATUS_OKAY(use_4b_addr_opcodes) @@ -81,6 +83,12 @@ struct spi_nor_config { #if ANY_INST_HAS_RESET_GPIOS const struct gpio_dt_spec reset; #endif +#if ANY_INST_HAS_SUPPLY_GPIOS + struct gpio_dt_spec supply; +#endif +#if ANY_INST_HAS_T_RESET_RECOVERY + uint32_t reset_recovery_us; +#endif /* Runtime SFDP stores no static configuration. */ @@ -1517,8 +1525,20 @@ static int spi_nor_configure(const struct device *dev) return -ENODEV; } -#if ANY_INST_HAS_RESET_GPIOS +#if ANY_INST_HAS_SUPPLY_GPIOS + if (cfg->supply.port != NULL) { + if (!gpio_is_ready_dt(&cfg->supply)) { + LOG_ERR("Supply GPIO port is not ready"); + return -ENODEV; + } + if (gpio_pin_configure_dt(&cfg->supply, GPIO_OUTPUT_ACTIVE)) { + LOG_ERR("Failed to activate power supply GPIO"); + return -EIO; + } + } +#endif +#if ANY_INST_HAS_RESET_GPIOS if (cfg->reset_gpios_exist) { if (!gpio_is_ready_dt(&cfg->reset)) { LOG_ERR("Reset pin not ready"); @@ -1535,6 +1555,12 @@ static int spi_nor_configure(const struct device *dev) } #endif +#if ANY_INST_HAS_T_RESET_RECOVERY + if (cfg->reset_recovery_us != 0) { + k_busy_wait(cfg->reset_recovery_us); + } +#endif + /* After a soft-reset the flash might be in DPD or busy writing/erasing. * Exit DPD and wait until flash is ready. */ @@ -1853,6 +1879,11 @@ static DEVICE_API(flash, spi_nor_api) = { #define INIT_RESET_GPIOS(idx) .reset = GPIO_DT_SPEC_INST_GET_OR(idx, reset_gpios, {0}) +#define INIT_SUPPLY_GPIOS(idx) .supply = GPIO_DT_SPEC_INST_GET_OR(idx, supply_gpios, {0}) + +#define INIT_T_RESET_RECOVERY(idx) \ + .reset_recovery_us = DT_INST_PROP_OR(idx, t_reset_recovery, 0) / NSEC_PER_USEC + #define INST_CONFIG_STRUCT_GEN(idx) \ DEFINE_PAGE_LAYOUT(idx) \ .flash_size = DT_INST_PROP(idx, size) / 8, \ @@ -1884,6 +1915,8 @@ static DEVICE_API(flash, spi_nor_api) = { IF_ENABLED(ANY_INST_HAS_MXICY_MX25R_POWER_MODE, \ (INIT_MXICY_MX25R_POWER_MODE(idx),)) \ IF_ENABLED(ANY_INST_HAS_RESET_GPIOS, (INIT_RESET_GPIOS(idx),)) \ + IF_ENABLED(ANY_INST_HAS_SUPPLY_GPIOS, (INIT_SUPPLY_GPIOS(idx),)) \ + IF_ENABLED(ANY_INST_HAS_T_RESET_RECOVERY, (INIT_T_RESET_RECOVERY(idx),)) \ IF_ENABLED(ANY_INST_HAS_WP_GPIOS, (INIT_WP_GPIOS(idx),)) \ IF_ENABLED(ANY_INST_HAS_HOLD_GPIOS, (INIT_HOLD_GPIOS(idx),)) \ IF_DISABLED(CONFIG_SPI_NOR_SFDP_RUNTIME, (INST_CONFIG_STRUCT_GEN(idx)))}; From 613a16c6f93a0877e8e9d80a6592908eb176c64d Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 24 Mar 2026 13:44:21 +0200 Subject: [PATCH 3208/3334] [nrf noup] samples/tests: bluetooth: remove qemu_x86.conf nrf-squash! [nrf noup] samples: bluetooth: mesh: Disable secure storage for real targets. Explicitly disabling/enabling those Kconfig options should not be needed. Signed-off-by: Tomi Fontanilles (cherry picked from commit eb4405177bf539a9c123a5717bf8aef324117152) --- samples/bluetooth/mesh/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh_demo/boards/qemu_x86.conf | 6 ------ samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf | 6 ------ tests/bluetooth/mesh_shell/boards/qemu_x86.conf | 6 ------ 4 files changed, 24 deletions(-) delete mode 100644 samples/bluetooth/mesh/boards/qemu_x86.conf delete mode 100644 samples/bluetooth/mesh_demo/boards/qemu_x86.conf delete mode 100644 samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf delete mode 100644 tests/bluetooth/mesh_shell/boards/qemu_x86.conf diff --git a/samples/bluetooth/mesh/boards/qemu_x86.conf b/samples/bluetooth/mesh/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf b/samples/bluetooth/mesh_demo/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh_demo/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf b/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/samples/bluetooth/mesh_provisioner/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y diff --git a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf b/tests/bluetooth/mesh_shell/boards/qemu_x86.conf deleted file mode 100644 index bfb57193b782..000000000000 --- a/tests/bluetooth/mesh_shell/boards/qemu_x86.conf +++ /dev/null @@ -1,6 +0,0 @@ -# nrf_security only supports Cortex-M via PSA crypto libraries. -# Enforcing usage of built-in Mbed TLS for native simulator. -CONFIG_NRF_SECURITY=n -CONFIG_MBEDTLS_ENABLE_HEAP=n -CONFIG_TRUSTED_STORAGE=n -CONFIG_SECURE_STORAGE=y From f5a861e7e205ef713abc4a46ec4709aa3ff31177 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 24 Mar 2026 13:46:00 +0200 Subject: [PATCH 3209/3334] [nrf noup] tests: bluetooth: tester: do not enable CONFIG_NRF_SECURITY manually nrf-squash! [nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20 Just enable CONFIG_PSA_CRYPTO. It will indirectly result in CONFIG_NRF_SECURITY being enabled. Signed-off-by: Tomi Fontanilles (cherry picked from commit 7f83947c5f824e74c96390fc7afe60f944b89a4d) --- tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf index 0f16f6ea7b4c..80cd932a3976 100644 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -26,5 +26,4 @@ CONFIG_UART_INTERRUPT_DRIVEN=y # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_NRF_SECURITY=y +CONFIG_PSA_CRYPTO=y From 426e3ea3087a7a9380d759974fbececb2d1fd483 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 31 Mar 2026 10:19:46 +0300 Subject: [PATCH 3210/3334] [nrf noup] tests: bluetooth: tester: replace CONFIG_NRF_SECURITY nrf-squash! [nrf noup] tests: bluetooth: tester: Enable PSA RNG on nRF54H20 Signed-off-by: Tomi Fontanilles (cherry picked from commit 8eef1a4a6cb080aadf51bc677e6957d1fc047efc) --- .../sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf index 24e3d84ecf96..081c04a7bc5f 100644 --- a/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf +++ b/tests/bluetooth/tester/sysbuild/hci_ipc/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -35,5 +35,4 @@ CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191 # Enable PSA RNG CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_PSA_SSF_CRYPTO_CLIENT=y -CONFIG_MBEDTLS_PSA_CRYPTO_C=y -CONFIG_NRF_SECURITY=y +CONFIG_PSA_CRYPTO=y From 86ea150535b01518ca2bf430706208307e322872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Thu, 2 Apr 2026 12:23:35 +0200 Subject: [PATCH 3211/3334] [nrf fromtree] arch: ISR table size optimization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow to use a switch-case instead of an array holding ISR entries. When most of IRQs are not used, they share the same, default entry. It results in most of the ISR array entries being identical duplicates. This change allows to use dynamically generated function (after first linker pass) that uses switch-case instead of a full array. Default entries are handled only once, in a default section. Used IRQs have their own case sections. This can help reduce binary size. Signed-off-by: Adam Szczygieł (cherry picked from commit f4747547d95107037daebae32e2f48568b8e53fd) --- arch/Kconfig | 33 ++++++- arch/arm/core/cortex_m/isr_wrapper.c | 7 ++ arch/common/isr_tables.c | 17 ++-- include/zephyr/sw_isr_table.h | 10 ++- .../build/gen_isr_tables_parser_carrays.py | 85 ++++++++++++++++--- 5 files changed, 128 insertions(+), 24 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 7f99dd01fbc7..051d953f87cf 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -599,9 +599,36 @@ config GEN_SW_ISR_TABLE depends on GEN_ISR_TABLES help This option controls whether a platform using gen_isr_tables - needs a software ISR table table created. This is an array of struct - _isr_table_entry containing the interrupt service routine and supplied - parameter. + needs a software ISR table created. + It can be generated as either an array or a switch-case. + See CONFIG_GEN_SW_ISR_TABLE_TYPE. + +choice GEN_SW_ISR_TABLE_TYPE + prompt "Allows to chose how ISR table is implemented" + depends on GEN_SW_ISR_TABLE + default GEN_SW_ISR_TABLE_ARRAY + help + CONFIG_GEN_SW_ISR_TABLE_ARRAY is a default option. + It should be used when in doubt. + GEN_SW_ISR_TABLE_SWITCH allows for binary size optimization + in certain scenarios, but may also increase latency, to execution of ISR with higher number, if there is significant number of ISR assigned in your system. + +config GEN_SW_ISR_TABLE_ARRAY + bool "Generate an array of ISR entries" + help + This is an array of struct _isr_table_entry containing + the interrupt service routine and supplied parameter. + All interrupts have their own entry. + +config GEN_SW_ISR_TABLE_SWITCH + bool "Generate a function with a switch-case" + help + Use a switch-case instead of an array. + This helps to limit binary size when most of the IRQs are not used. + In such case common, duplicated entries are grouped in a single default block + while few used interrupts have their own case blocks. + +endchoice config ARCH_SW_ISR_TABLE_ALIGN int "Alignment size of a software ISR table" diff --git a/arch/arm/core/cortex_m/isr_wrapper.c b/arch/arm/core/cortex_m/isr_wrapper.c index c9f6b1db21cb..2cd691c1f1a7 100644 --- a/arch/arm/core/cortex_m/isr_wrapper.c +++ b/arch/arm/core/cortex_m/isr_wrapper.c @@ -76,8 +76,15 @@ void _isr_wrapper(void) */ irq_number -= 16; +#if defined(CONFIG_GEN_SW_ISR_TABLE_ARRAY) const struct _isr_table_entry *entry = &_sw_isr_table[irq_number]; (entry->isr)(entry->arg); +#elif defined(CONFIG_GEN_SW_ISR_TABLE_SWITCH) + struct _isr_table_entry entry; + + get_isr_entry(irq_number, &entry); + (entry.isr)(entry.arg); +#endif /* CONFIG_GEN_SW_ISR_TABLE_ARRAY */ #if defined(CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER) z_soc_irq_eoi(irq_number); diff --git a/arch/common/isr_tables.c b/arch/common/isr_tables.c index ea9ac3331a86..8e5c093e6aff 100644 --- a/arch/common/isr_tables.c +++ b/arch/common/isr_tables.c @@ -87,15 +87,20 @@ const uintptr_t __irq_vector_table _irq_vector_table[IRQ_TABLE_SIZE] = { /* If there are no interrupts at all, or all interrupts are of the 'direct' * type and bypass the _sw_isr_table, then do not generate one. */ -#ifdef CONFIG_GEN_SW_ISR_TABLE +#if defined(CONFIG_GEN_SW_ISR_TABLE_ARRAY) #ifndef CONFIG_DYNAMIC_INTERRUPTS const -#endif -struct _isr_table_entry __sw_isr_table _sw_isr_table[IRQ_TABLE_SIZE] = { - [0 ...(IRQ_TABLE_SIZE - 1)] = {(const void *)0x42, - &z_irq_spurious}, +#endif /* CONFIG_DYNAMIC_INTERRUPTS */ + struct _isr_table_entry __sw_isr_table _sw_isr_table[IRQ_TABLE_SIZE] = { + [0 ...(IRQ_TABLE_SIZE - 1)] = {(const void *)0x42, &z_irq_spurious}, }; -#endif +#elif defined(CONFIG_GEN_SW_ISR_TABLE_SWITCH) +void __sw_isr_table get_isr_entry(int irq_number, struct _isr_table_entry *entry) +{ + entry->arg = (const void *)0x0; + entry->isr = z_irq_spurious; +} +#endif /* CONFIG_GEN_SW_ISR_TABLE_ARRAY */ #ifdef CONFIG_SHARED_INTERRUPTS #ifndef CONFIG_DYNAMIC_INTERRUPTS diff --git a/include/zephyr/sw_isr_table.h b/include/zephyr/sw_isr_table.h index 0520b72525df..3264b9a51dd6 100644 --- a/include/zephyr/sw_isr_table.h +++ b/include/zephyr/sw_isr_table.h @@ -41,14 +41,18 @@ struct _isr_table_entry { void (*isr)(const void *); }; +#if defined(CONFIG_GEN_SW_ISR_TABLE_ARRAY) /* The software ISR table itself, an array of these structures indexed by the * irq line */ extern #ifndef CONFIG_DYNAMIC_INTERRUPTS -const -#endif -struct _isr_table_entry _sw_isr_table[]; + const +#endif /* CONFIG_DYNAMIC_INTERRUPTS */ + struct _isr_table_entry _sw_isr_table[]; +#elif defined(CONFIG_GEN_SW_ISR_TABLE_SWITCH) +extern void __sw_isr_table get_isr_entry(int irq_number, struct _isr_table_entry *entry); +#endif /* CONFIG_GEN_SW_ISR_TABLE_ARRAY */ struct _irq_parent_entry { const struct device *dev; diff --git a/scripts/build/gen_isr_tables_parser_carrays.py b/scripts/build/gen_isr_tables_parser_carrays.py index f85536da6112..55a220649c42 100755 --- a/scripts/build/gen_isr_tables_parser_carrays.py +++ b/scripts/build/gen_isr_tables_parser_carrays.py @@ -253,23 +253,58 @@ def __write_shared_table(self, fp): fp.write("};\n") - def write_source(self, fp): - fp.write(self.source_header) + def write_isr_switch_start(self, fp): + fp.write("void __sw_isr_table ") + fp.write("get_isr_entry(int irq_index, struct _isr_table_entry *entry)\n") + fp.write("{\n") + fp.write("\tswitch (irq_index)\n") + fp.write("\t{\n") + + def write_isr_case_block(self, fp, i, isr, arg): + fp.write(f"\t\tcase {i}:\n") + fp.write("\t\t{\n") + fp.write(f"\t\t\tentry->isr = (ISR){isr:#x};\n") + fp.write(f"\t\t\tentry->arg = (const void *){arg};\n") + fp.write("\t\t\tbreak;\n") + fp.write("\t\t}\n") + + def write_isr_case_single_irq(self, fp, i): + arg = f"{self.__swt[i][0][0]:#x}" + isr = self.__swt[i][0][1] + self.write_isr_case_block(fp, i, isr, arg) + + def write_isr_case_shared_irq(self, fp, i): + arg = f"&z_shared_sw_isr_table[{i}]" + isr = self.__config.swt_shared_handler + self.write_isr_case_block(fp, i, isr, arg) + + def write_isr_case_default_block(self, fp): + fp.write("\t\tdefault:\n") + fp.write("\t\t{\n") + fp.write(f"\t\t\tentry->isr = (ISR){self.__config.swt_spurious_handler};\n") + fp.write("\t\t\tentry->arg = (const void *)0x0;\n") + fp.write("\t\t\tbreak;\n") + fp.write("\t\t}\n") + fp.write("\t}\n") + fp.write("}\n") - if self.__config.check_shared_interrupts(): - self.__write_shared_table(fp) + def write_isr_table_switch(self, fp): + self.write_isr_switch_start(fp) - if self.__vt: - if self.__config.check_sym("CONFIG_IRQ_VECTOR_TABLE_JUMP_BY_ADDRESS"): - self.__write_address_irq_vector_table(fp) - elif self.__config.check_sym("CONFIG_IRQ_VECTOR_TABLE_JUMP_BY_CODE"): - self.__write_code_irq_vector_table(fp) + for i in range(self.__nv): + if len(self.__swt[i]) == 0: + # Unused interrupt - default will be used + continue + elif len(self.__swt[i]) == 1: + # Single interrupt + self.write_isr_case_single_irq(fp, i) else: - self.__log.error("CONFIG_IRQ_VECTOR_TABLE_JUMP_BY_{ADDRESS,CODE} not set") + # Shared interrupt + self.write_isr_case_shared_irq(fp, i) - if not self.__swt: - return + self.write_isr_case_default_block(fp) + def write_isr_table_array(self, fp): if not self.__config.check_sym("CONFIG_DYNAMIC_INTERRUPTS"): fp.write("const ") fp.write(f"struct _isr_table_entry __sw_isr_table _sw_isr_table[{self.__nv}] = {{\n") @@ -303,3 +338,29 @@ def write_source(self, fp): fp.write(f"\t{{(const void *){param}, (ISR){func_as_string}}}, /* {i} */\n") fp.write("};\n") + + def write_source(self, fp): + fp.write(self.source_header) + + if self.__config.check_shared_interrupts(): + self.__write_shared_table(fp) + + if self.__vt: + if self.__config.check_sym("CONFIG_IRQ_VECTOR_TABLE_JUMP_BY_ADDRESS"): + self.__write_address_irq_vector_table(fp) + elif self.__config.check_sym("CONFIG_IRQ_VECTOR_TABLE_JUMP_BY_CODE"): + self.__write_code_irq_vector_table(fp) + else: + self.__log.error("CONFIG_IRQ_VECTOR_TABLE_JUMP_BY_{ADDRESS,CODE} not set") + + if not self.__swt: + return + + fp.write("\n") + + if self.__config.get_sym("CONFIG_GEN_SW_ISR_TABLE_ARRAY"): + self.write_isr_table_array(fp) + elif self.__config.get_sym("CONFIG_GEN_SW_ISR_TABLE_SWITCH"): + self.write_isr_table_switch(fp) + else: + raise ValueError("Unsupported CONFIG_GEN_SW_ISR_TABLE_TYPE") From c407240e72ea216c1be1e6edd58a494c5bade17a Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 9 Apr 2026 16:14:27 +0530 Subject: [PATCH 3212/3334] [nrf fromtree] modules: hostap: Increase stack size for hostap Due to recent changes, the stack usage is increased, fix the stack overflow. Signed-off-by: Ravi Dondaputi (cherry picked from commit 22c04ed0f95f6dce587e949de9c3fb9792b78078) --- modules/hostap/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index cbf64d1ece22..e64b8376fd6c 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -64,7 +64,7 @@ config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE int "Stack size for wpa_supplicant thread" # TODO: Providing higher stack size for Enterprise mode to fix stack # overflow issues. Need to identify the cause for higher stack usage. - default 8192 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE || WIFI_USAGE_MODE_STA_AP + default 8600 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE || WIFI_USAGE_MODE_STA_AP default 7900 if WIFI_NM_WPA_SUPPLICANT_P2P # This is needed to handle stack overflow issues on nRF Wi-Fi drivers. default 6300 if WIFI_NM_WPA_SUPPLICANT_AP From 553c822839ed08355498d791273b699849445996 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Thu, 9 Apr 2026 16:04:05 +0530 Subject: [PATCH 3213/3334] [nrf fromtree] modules: hostap: Increase Hostap heap requirement Increase heap requirement of hostap. This fixes memory allocation errors seen with certificates' processing. Signed-off-by: Ravi Dondaputi (cherry picked from commit 23e9455e371e9dbb512c92d833efede5431d9d1c) --- modules/hostap/Kconfig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index e64b8376fd6c..219f56e6ded8 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -39,8 +39,7 @@ config WIFI_NM_WPA_SUPPLICANT_HEAP int "Dedicated memory pool for wpa_supplicant" def_int 66560 if WIFI_NM_HOSTAPD_AP def_int 60000 if WIFI_USAGE_MODE_STA_AP - def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS - def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE + def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP def_int 40000 if WIFI_NM_MAX_MANAGED_INTERFACES=2 # 30K is mandatory, but might need more for long duration use cases @@ -51,8 +50,7 @@ if WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP config HEAP_MEM_POOL_ADD_SIZE_HOSTAP def_int 66560 if WIFI_NM_HOSTAPD_AP def_int 60000 if WIFI_USAGE_MODE_STA_AP - def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS - def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE + def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE def_int 80000 if WIFI_NM_WPA_SUPPLICANT_P2P def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP # 30K is mandatory, but might need more for long duration use cases From 08ead05b25c99414d908c8ff566cf01307da9853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 9 Apr 2026 15:16:27 +0200 Subject: [PATCH 3214/3334] [nrf fromlist] drivers: gpio: disable latch detection for nRF92 series MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Latch detection is not supported on nRF92 GPIO driver. Upstream PR #: 106173 Signed-off-by: Michał Stasiak (cherry picked from commit 1a5c2b29b02fea8713792179c4dbfdcaf331eb3a) --- drivers/gpio/Kconfig.nrfx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/Kconfig.nrfx b/drivers/gpio/Kconfig.nrfx index 576242f43d3c..99340331f454 100644 --- a/drivers/gpio/Kconfig.nrfx +++ b/drivers/gpio/Kconfig.nrfx @@ -20,4 +20,4 @@ config GPIO_NRFX_INTERRUPT config GPIO_NRFX_HAS_LATCH_DETECT bool - default y if !(SOC_NRF54H20 || TRUSTED_EXECUTION_NONSECURE) + default y if !(SOC_NRF54H20 || SOC_SERIES_NRF92 || TRUSTED_EXECUTION_NONSECURE) From 6f9265121fd2c390bb19396d2840a966d920edd9 Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Tue, 10 Jun 2025 23:20:32 +0200 Subject: [PATCH 3215/3334] [nrf noup] bluetooth: host: Add support for bonding with same peer This commit adds a new Kconfig option by enabling which Host will keep bonding with the same Central instead of rejecting pairing. Brief implementation details: This implementation adds a new flag to bt_keys struct: BT_KEYS_ID_CONFLICT. The flag is set, when: - bonding with the same peer and conflict identified - when loading conflicting keys from persistent storage. When bonding and conflict is identified, the new keys aren't added to the Resolving List immediately. Instead, the old keys stay in the Resolving List. When start advertising, Host finds conflicting keys that are already added to the Resolving List and substitues them. If, however, there is another advertiser already started for the added keys, the new request is reject and advertising start function returns -EPERM. This is supported by Peripheral role only for now. Allow to use CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS Kconfig option even if CONFIG_BT_PRIVACY is disabled. This is because CONFIG_BT_PRIVACY configures privacy of local device will still allows to resolve peer address. During pairing, peer device may send its Identity Address and IRK which then can be used for address resolution. This doesn't require CONFIG_BT_PRIVACY be enabled. Signed-off-by: Pavel Vasilyev (cherry picked from commit 4d81fdf0d9f2c0a2692b0d34764769adb394f2f4) --- include/zephyr/bluetooth/bluetooth.h | 10 ++ subsys/bluetooth/host/Kconfig | 18 +++ subsys/bluetooth/host/adv.c | 52 +++++++ subsys/bluetooth/host/adv.h | 1 + subsys/bluetooth/host/hci_core.h | 23 ++- subsys/bluetooth/host/id.c | 219 ++++++++++++++++++++++++--- subsys/bluetooth/host/id.h | 23 +++ subsys/bluetooth/host/keys.c | 73 +++++++++ subsys/bluetooth/host/keys.h | 6 + subsys/bluetooth/host/smp.c | 18 ++- tests/bluetooth/host/id/mocks/adv.c | 1 + tests/bluetooth/host/id/mocks/adv.h | 4 +- tests/bluetooth/host/id/mocks/keys.c | 1 + tests/bluetooth/host/id/mocks/keys.h | 4 +- 14 files changed, 428 insertions(+), 25 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 8d6ce5835d80..31a5e7140766 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1312,6 +1312,10 @@ struct bt_le_per_adv_param { * This error code is only guaranteed when using Zephyr * controller, for other controllers code returned in * this case may be -EIO. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_adv_start(const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, @@ -1439,6 +1443,12 @@ struct bt_le_ext_adv_start_param { * * @param adv Advertising set object. * @param param Advertise start parameters. + * + * @return Zero on success or (negative) error code otherwise. + * @return -EPERM When @kconfig{CONFIG_BT_PRIVACY} and + * @kconfig{CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS} are enabled and connectable + * advertising is requested, and the given local identity has a conflicting + * key with another local identity for which advertising is already started. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, const struct bt_le_ext_adv_start_param *param); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 47191fa407ce..7115003bb13b 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -726,6 +726,24 @@ config BT_ID_UNPAIR_MATCHING_BONDS link-layer. The Host does not have control over this acknowledgment, and the order of distribution is fixed by the specification. +config BT_ID_AUTO_SWAP_MATCHING_BONDS + bool "Automatically swap conflicting entries in the Resolving List" + depends on !BT_ID_UNPAIR_MATCHING_BONDS + depends on BT_SMP && BT_PERIPHERAL && !BT_CENTRAL + help + If this option is enabled, the Host will not add a new bond with + the same peer address (or IRK) to the Resolving List if there is + already a bond with the same peer address (or IRK) on another local + identity. + + In case of Peripheral, the Host will swap the existing entry in the + Resolving List with the new one, so that the new bond will be used for + address resolution for the new local identity if the device starts + advertising with the new local identity. + + Important: this option is supported exclusively in the Peripheral + role. Excluding the Central role. + config BT_ID_ALLOW_UNAUTH_OVERWRITE bool "Allow unauthenticated pairing with same peer with other local identity" depends on !BT_SMP_ALLOW_UNAUTH_OVERWRITE diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 8e1cc7e5da5c..283c2521dca4 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -233,6 +233,25 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) #endif /* CONFIG_BT_BROADCASTER */ #endif /* defined(CONFIG_BT_EXT_ADV) */ +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id) +{ +#if defined(CONFIG_BT_EXT_ADV) + for (size_t i = 0; i < ARRAY_SIZE(adv_pool); i++) { + if (atomic_test_bit(adv_pool[i].flags, BT_ADV_CREATED) && + adv_pool[i].id == id) { + return &adv_pool[i]; + } + } +#else + if (atomic_test_bit(bt_dev.adv.flags, BT_ADV_CREATED) && bt_dev.adv.id == id) { + return &bt_dev.adv; + } +#endif + + return NULL; +} + + void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data), void *data) { @@ -935,6 +954,14 @@ static int adv_start_legacy(struct bt_le_ext_adv *adv, adv->id = param->id; bt_dev.adv_conn_id = adv->id; + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = bt_id_set_adv_own_addr(adv, param->options, dir_adv, &set_param.own_addr_type); if (err) { @@ -1218,6 +1245,15 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, } adv->id = param->id; + + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + err = bt_id_resolving_list_check_and_update(adv->id, param->peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + err = le_ext_adv_param_set(adv, param, sd != NULL); if (err) { return err; @@ -1509,6 +1545,22 @@ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, bt_id_pending_keys_update(); } + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + const bt_addr_le_t *peer; + + if (bt_addr_le_eq(&adv->target_addr, BT_ADDR_LE_ANY)) { + peer = NULL; + } else { + peer = &adv->target_addr; + } + + err = bt_id_resolving_list_check_and_update(adv->id, peer); + if (err) { + LOG_ERR("Failed to check and update resolving list: %d", err); + return err; + } + } + if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && atomic_test_bit(adv->flags, BT_ADV_CONNECTABLE)) { err = le_adv_start_add_conn(adv, &conn); diff --git a/subsys/bluetooth/host/adv.h b/subsys/bluetooth/host/adv.h index 6cc950fe8e7f..a6f7007f64b4 100644 --- a/subsys/bluetooth/host/adv.h +++ b/subsys/bluetooth/host/adv.h @@ -23,3 +23,4 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv, int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable); int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv); void bt_adv_reset_adv_pool(void); +struct bt_le_ext_adv *bt_adv_lookup_by_id(uint8_t id); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 132f94a50cd7..de6b7571e9b7 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -490,7 +490,28 @@ struct bt_keys; void bt_id_add(struct bt_keys *keys); void bt_id_del(struct bt_keys *keys); -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate); +/** @brief Find a conflict in the resolving list for a candidate IRK. + * + * @param candidate The candidate keys to check for conflicts. + * @param all If true, check all IRKs, otherwise check only added keys. + * + * @return The conflicting key if there is one, or NULL if no conflict was found. + */ +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool all); + +/** * @brief Find multiple conflicts in the resolving list for a candidate IRK. + * + * This function iterates over all keys (added and not added to the Resolving List). If there are + * multiple conflicts, this function will return true. Otherwise, it will return false. + * + * If @c firt_conflict is not NULL, it will be set to the first found conflict. + * + * @param candidate The candidate key to check for conflicts. + * @param first_conflict Pointer to store the first found conflict, if any. Can be NULL. + * + * @return True if there are multiple conflicts, otherwise it returns false. + */ +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict); int bt_setup_random_id_addr(void); int bt_setup_public_id_addr(void); diff --git a/subsys/bluetooth/host/id.c b/subsys/bluetooth/host/id.c index bdcb21e80780..7ff52e18fe3f 100644 --- a/subsys/bluetooth/host/id.c +++ b/subsys/bluetooth/host/id.c @@ -947,9 +947,33 @@ void bt_id_pending_keys_update(void) } } +static bool keys_conflict_check(const struct bt_keys *candidate, const struct bt_keys *resident) +{ + bool addr_conflict; + bool irk_conflict; + + addr_conflict = bt_addr_le_eq(&candidate->addr, &resident->addr); + + /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ + irk_conflict = (!bt_irk_eq(&candidate->irk, &(struct bt_irk){}) && + bt_irk_eq(&candidate->irk, &resident->irk)); + + if (addr_conflict || irk_conflict) { + LOG_DBG("Resident : addr %s and IRK %s", bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + LOG_DBG("Candidate: addr %s and IRK %s", bt_addr_le_str(&candidate->addr), + bt_hex(candidate->irk.val, sizeof(candidate->irk.val))); + + return true; + } + + return false; +} + struct bt_id_conflict { struct bt_keys *candidate; struct bt_keys *found; + bool check_all_irk; }; /* The Controller Resolve List is constrained by 7.8.38 "LE Add Device To @@ -961,8 +985,6 @@ struct bt_id_conflict { static void find_rl_conflict(struct bt_keys *resident, void *user_data) { struct bt_id_conflict *conflict = user_data; - bool addr_conflict; - bool irk_conflict; __ASSERT_NO_MSG(conflict != NULL); __ASSERT_NO_MSG(conflict->candidate != NULL); @@ -975,32 +997,26 @@ static void find_rl_conflict(struct bt_keys *resident, void *user_data) } /* Test against committed bonds only. */ - if ((resident->state & BT_KEYS_ID_ADDED) == 0) { + if (!conflict->check_all_irk && (resident->state & BT_KEYS_ID_ADDED) == 0) { + /* If the resident bond is not committed, we cannot have a conflict. */ return; } - addr_conflict = bt_addr_le_eq(&conflict->candidate->addr, &resident->addr); - - /* All-zero IRK is "no IRK", and does not conflict with other Zero-IRKs. */ - irk_conflict = (!bt_irk_eq(&conflict->candidate->irk, &(struct bt_irk){}) && - bt_irk_eq(&conflict->candidate->irk, &resident->irk)); - - if (addr_conflict || irk_conflict) { - LOG_DBG("Resident : addr %s and IRK %s, id: %d", bt_addr_le_str(&resident->addr), - bt_hex(resident->irk.val, sizeof(resident->irk.val)), resident->id); - LOG_DBG("Candidate: addr %s and IRK %s, id: %d", - bt_addr_le_str(&conflict->candidate->addr), - bt_hex(conflict->candidate->irk.val, sizeof(conflict->candidate->irk.val)), - conflict->candidate->id); + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + if (keys_conflict_check(conflict->candidate, resident)) { conflict->found = resident; } } -struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) +struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate, bool check_all_irk) { struct bt_id_conflict conflict = { .candidate = candidate, + .check_all_irk = check_all_irk, }; bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict, &conflict); @@ -1008,6 +1024,59 @@ struct bt_keys *bt_id_find_conflict(struct bt_keys *candidate) return conflict.found; } +struct bt_id_conflict_multiple { + struct bt_keys *candidate; + struct bt_keys *found; + bool found_multiple; +}; + +void find_rl_conflict_multiple(struct bt_keys *resident, void *user_data) +{ + struct bt_id_conflict_multiple *conflict = user_data; + + __ASSERT_NO_MSG(conflict != NULL); + __ASSERT_NO_MSG(conflict->candidate != NULL); + __ASSERT_NO_MSG(resident != NULL); + + if (conflict->found_multiple) { + /* If we already found enough conflicts, we can stop searching. */ + return; + } + + if (resident->id == conflict->candidate->id) { + /* If the IDs are the same, we cannot have a conflict. */ + return; + } + + if (keys_conflict_check(conflict->candidate, resident)) { + if (conflict->found) { + conflict->found_multiple = true; + + LOG_WRN("Found multiple conflicts for %s: addr %s and IRK %s", + bt_addr_le_str(&conflict->candidate->addr), + bt_addr_le_str(&resident->addr), + bt_hex(resident->irk.val, sizeof(resident->irk.val))); + } else { + conflict->found = resident; + } + } +} + +bool bt_id_find_conflict_multiple(struct bt_keys *candidate, struct bt_keys **first_conflict) +{ + struct bt_id_conflict_multiple conflict = { + .candidate = candidate, + }; + + bt_keys_foreach_type(BT_KEYS_IRK, find_rl_conflict_multiple, &conflict); + + if (first_conflict != NULL) { + *first_conflict = conflict.found; + } + + return conflict.found_multiple; +} + void bt_id_add(struct bt_keys *keys) { if (keys == NULL) { @@ -1270,6 +1339,122 @@ void bt_id_del(struct bt_keys *keys) bt_le_ext_adv_foreach(adv_unpause_enabled, NULL); } } + +static int conflict_check_and_replace(uint8_t id, struct bt_keys *keys) +{ + /* For the given key check if it has conflicts with other keys in the Resolving List + * (such keys have BT_KEYS_ID_ADDED state and BT_KEYS_ID_CONFLICT flag set). If it does, we + * need to remove the conflicting key from the Resolving List and add the new key. + * + * If the key is not in the Resolving List, we can add the new key right away. + * + * If advertiser for the conflicting key is enabled, we cannot remove the key from the + * Resolving List, so we return an error. + */ + + struct bt_keys *conflict; + const struct bt_le_ext_adv *adv; + + if (!(keys->flags & BT_KEYS_ID_CONFLICT)) { + LOG_DBG("Key has no conflicts for id %u addr %s", id, bt_addr_le_str(&keys->addr)); + return 0; + } + + if (keys->state & BT_KEYS_ID_ADDED) { + LOG_DBG("Key is already added to resolving list for id %u addr %s", id, + bt_addr_le_str(&keys->addr)); + return 0; + } + + /* bt_id_find_conflict returns only keys added to the Resolving List (state is + * BT_KEYS_ID_ADDED). If the key has conflict, but no keys were added (for example, if the + * last added key was removed after bt_unpair()), then this function will return NULL. Then, + * we don't need to remove a conflicting key from the Resolving List. Otherwise, we need to + * remove the conflicting key from the Resolving List before adding the new key. + */ + conflict = bt_id_find_conflict(keys, false); + if (conflict != NULL) { + __ASSERT_NO_MSG((conflict->flags & BT_KEYS_ID_CONFLICT) != 0); + + LOG_DBG("Found conflicting key with id %u addr %s", conflict->id, + bt_addr_le_str(&conflict->addr)); + + adv = bt_adv_lookup_by_id(conflict->id); + if (adv && atomic_test_bit(adv->flags, BT_ADV_ENABLED)) { + LOG_WRN("Cannot remove the conflicting key from the Resolving List while" + " advertising"); + return -EPERM; + } + + /* Drop BT_KEYS_ID_PENDING_DEL flag if we were about to delete the keys since we + * delete it here. + */ + conflict->state &= ~BT_KEYS_ID_PENDING_DEL; + bt_id_del(conflict); + } + + bt_id_add(keys); + + return 0; +} + +struct bt_id_resolve { + uint8_t id; + int err; +}; + +static void check_and_add_keys_for_id(struct bt_keys *keys, void *data) +{ + struct bt_id_resolve *resolve = data; + + if (resolve->err) { + /* Skipping other keys because we got error. */ + return; + } + + if (resolve->id != keys->id) { + /* We are only interested in keys for the given id */ + return; + } + + resolve->err = conflict_check_and_replace(resolve->id, keys); +} + +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer) +{ + int err; + + if (peer == NULL) { + struct bt_id_resolve resolve = { + .id = id, + }; + + LOG_DBG("Updating resolving list for id %u without peer address", id); + + bt_keys_foreach_type(BT_KEYS_IRK, check_and_add_keys_for_id, &resolve); + err = resolve.err; + } else { + struct bt_keys *keys; + + LOG_DBG("Updating resolving list for id %u addr %s", id, bt_addr_le_str(peer)); + + keys = bt_keys_get_addr(id, peer); + if (!keys) { + LOG_DBG("No keys found for id %u addr %s", id, bt_addr_le_str(peer)); + return -ENOENT; + } + + err = conflict_check_and_replace(id, keys); + } + + if (err) { + LOG_ERR("Failed to update resolving list for id %u addr %s (err %d)", id, + peer ? bt_addr_le_str(peer) : "NULL", err); + return err; + } + + return err; +} #endif /* defined(CONFIG_BT_SMP) */ void bt_id_get(bt_addr_le_t *addrs, size_t *count) diff --git a/subsys/bluetooth/host/id.h b/subsys/bluetooth/host/id.h index 8824d3bb496b..cd66784a5037 100644 --- a/subsys/bluetooth/host/id.h +++ b/subsys/bluetooth/host/id.h @@ -60,3 +60,26 @@ void bt_id_pending_keys_update(void); void bt_id_pending_keys_update_set(struct bt_keys *keys, uint8_t flag); void bt_id_adv_limited_stopped(struct bt_le_ext_adv *adv); + +/** + * @brief Check and update the resolving list for a given identity. + * + * This function checks if the resolving list contains the keys for the given + * identity and peer address. If the keys are not present, it adds them to the + * resolving list. If the keys are present, it checks for conflicts with + * existing keys in the resolving list. If a conflict is found, it replaces + * the conflicting key with the new key. + * + * If the peer address is NULL, it updates the resolving list for all keys that belong to the given + * identity. + * + * If for any of the keys belonging to the given identity a conflict is found and the advertiser for + * that key is enabled, the function returns an error. + * + * @param id The identity ID to check and update. + * @param peer The peer address to check against the resolving list. + * + * @return 0 on success, or a negative error code on failure. + * @return -EPERM if a conflict is found and the advertiser for the conflicting key is enabled. + */ +int bt_id_resolving_list_check_and_update(uint8_t id, const bt_addr_le_t *peer); diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 7b92e8498e1b..d999330ad451 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -326,16 +326,57 @@ void bt_keys_add_type(struct bt_keys *keys, enum bt_keys_type type) keys->keys |= type; } +static void add_id_cb(struct k_work *work) +{ + bt_id_pending_keys_update(); +} + +static K_WORK_DEFINE(add_id_work, add_id_cb); + void bt_keys_clear(struct bt_keys *keys) { + struct bt_keys *conflict = NULL; + __ASSERT_NO_MSG(keys != NULL); LOG_DBG("%s (keys 0x%04x)", bt_addr_le_str(&keys->addr), keys->keys); + if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + (keys->flags & BT_KEYS_ID_CONFLICT) != 0) { + /* We need to check how many conflicting keys left. If there is only one conflicting + * key left, we can remove the BT_KEYS_ID_CONFLICT flag from it so that Host don't + * need to check and update the Resolving List whenever this is needed. The key + * should be re-added to the Resolving List. + */ + bool found_multiple; + + found_multiple = bt_id_find_conflict_multiple(keys, &conflict); + if (conflict) { + if (found_multiple || (conflict->state & BT_KEYS_ID_ADDED) != 0) { + /* If we found multiple conflicting keys or the conflicting key + * is already added to the ID list, we don't need to clear the + * conflict flag for it and re-add it to the Resolving List. + */ + conflict = NULL; + } else { + /* Clear the conflict flag for the conflicting key */ + conflict->flags &= ~BT_KEYS_ID_CONFLICT; + } + } + } + if (keys->state & BT_KEYS_ID_ADDED) { bt_id_del(keys); } + if (conflict) { + /* Re-add the conflicting key to the Resolving List if it was the last conflicting + * key. + */ + bt_id_pending_keys_update_set(conflict, BT_KEYS_ID_PENDING_ADD); + k_work_submit(&add_id_work); + } + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { /* Delete stored keys from flash */ bt_settings_delete_keys(keys->id, &keys->addr); @@ -363,6 +404,28 @@ int bt_keys_store(struct bt_keys *keys) return 0; } +static void check_and_set_id_conflict_flag(struct bt_keys *keys) +{ + struct bt_keys *conflict; + + if (!IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + /* If auto-swap is not enabled, we don't need to check for conflicts */ + return; + } + + /* Use bt_id_find_conflict() to check if there are any conflicting keys for the given keys. + * If there is at least one, set the BT_KEYS_ID_CONFLICT flag for both the keys and the + * conflicting key. + */ + conflict = bt_id_find_conflict(keys, true); + if (conflict != NULL) { + LOG_DBG("Found conflicting key %p.", conflict); + + keys->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + } +} + static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { @@ -506,6 +569,8 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb, keys->flags &= ~BT_KEYS_AUTHENTICATED; } + check_and_set_id_conflict_flag(keys); + LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr)); #if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST) if (aging_counter_val < keys->aging_counter) { @@ -523,6 +588,14 @@ static void id_add(struct bt_keys *keys, void *user_data) * demand when advertising or scanning starts, avoiding bt_id_add() * blocking settings_load() on HCI. */ + + if (keys->flags & BT_KEYS_ID_CONFLICT) { + /* If the keys have the conflict flag set, we don't want to add them to the ID list, + * as this will cause issues with resolving list. + */ + return; + } + bt_id_pending_keys_update_set(keys, BT_KEYS_ID_PENDING_ADD); } diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index 4fd0f38cb5d3..84f0c8e6c7ff 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -45,6 +45,12 @@ enum { /* Bit 2 and 3 might accidentally exist in old stored keys */ BT_KEYS_SC = BIT(4), BT_KEYS_OOB = BIT(5), + /** Indicates that the keys are in conflict with existing keys. + * + * This is used to indicate that the keys being added conflict with + * existing keys from different identity. + */ + BT_KEYS_ID_CONFLICT = BIT(6), }; enum bt_keys_cfg_flags { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 5c62124022db..6f92302e6961 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -924,7 +924,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) bt_id_del(keys); } - conflict = bt_id_find_conflict(keys); + conflict = bt_id_find_conflict(keys, false); if (conflict != NULL) { int err; @@ -934,7 +934,7 @@ static void smp_br_id_add_replace(struct bt_keys *keys) __ASSERT_NO_MSG(!err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(keys)); + __ASSERT_NO_MSG(!bt_id_find_conflict(keys, false)); bt_id_add(keys); } @@ -4135,16 +4135,24 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) */ __ASSERT_NO_MSG(!(smp->remote_dist & BT_SMP_DIST_ID_KEY)); - conflict = bt_id_find_conflict(new_bond); + conflict = bt_id_find_conflict(new_bond, IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)); if (conflict) { LOG_DBG("New bond conflicts with a bond on id %d.", conflict->id); } - if (conflict && !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { + if (conflict && !IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS) && + !IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { LOG_WRN("Refusing new pairing. The old bond must be unpaired first."); return BT_SMP_ERR_AUTH_REQUIREMENTS; } + if (conflict && IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { + LOG_WRN("Conflict detected with %p. Don't add key to Resolve List.", conflict); + new_bond->flags |= BT_KEYS_ID_CONFLICT; + conflict->flags |= BT_KEYS_ID_CONFLICT; + return 0; + } + if (conflict && IS_ENABLED(CONFIG_BT_ID_UNPAIR_MATCHING_BONDS)) { bool trust_ok; int unpair_err; @@ -4161,7 +4169,7 @@ static uint8_t smp_id_add_replace(struct bt_smp *smp, struct bt_keys *new_bond) __ASSERT_NO_MSG(!unpair_err); } - __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond)); + __ASSERT_NO_MSG(!bt_id_find_conflict(new_bond, false)); bt_id_add(new_bond); return 0; } diff --git a/tests/bluetooth/host/id/mocks/adv.c b/tests/bluetooth/host/id/mocks/adv.c index 2c2d4f3f3c7a..a22123dea3da 100644 --- a/tests/bluetooth/host/id/mocks/adv.c +++ b/tests/bluetooth/host/id/mocks/adv.c @@ -15,3 +15,4 @@ DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv *, DEFINE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DEFINE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/adv.h b/tests/bluetooth/host/id/mocks/adv.h index bfb744001596..1602ddf47185 100644 --- a/tests/bluetooth/host/id/mocks/adv.h +++ b/tests/bluetooth/host/id/mocks/adv.h @@ -18,7 +18,8 @@ typedef void (*bt_le_ext_adv_foreach_cb)(struct bt_le_ext_adv *adv, void *data); FAKE(bt_le_adv_lookup_legacy) \ FAKE(bt_le_ext_adv_get_index) \ FAKE(bt_le_adv_set_enable_ext) \ - FAKE(bt_le_ext_adv_foreach) + FAKE(bt_le_ext_adv_foreach) \ + FAKE(bt_adv_lookup_by_id) DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable, struct bt_le_ext_adv *, bool); DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_le_adv_lookup_legacy); @@ -27,3 +28,4 @@ DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_legacy, struct bt_le_ext_adv * DECLARE_FAKE_VALUE_FUNC(int, bt_le_adv_set_enable_ext, struct bt_le_ext_adv *, bool, const struct bt_le_ext_adv_start_param *); DECLARE_FAKE_VOID_FUNC(bt_le_ext_adv_foreach, bt_le_ext_adv_foreach_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_le_ext_adv *, bt_adv_lookup_by_id, uint8_t); diff --git a/tests/bluetooth/host/id/mocks/keys.c b/tests/bluetooth/host/id/mocks/keys.c index f885ab875c0f..61f73569c469 100644 --- a/tests/bluetooth/host/id/mocks/keys.c +++ b/tests/bluetooth/host/id/mocks/keys.c @@ -10,3 +10,4 @@ DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DEFINE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DEFINE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); diff --git a/tests/bluetooth/host/id/mocks/keys.h b/tests/bluetooth/host/id/mocks/keys.h index b6901e315ab9..1912472b78de 100644 --- a/tests/bluetooth/host/id/mocks/keys.h +++ b/tests/bluetooth/host/id/mocks/keys.h @@ -15,7 +15,9 @@ typedef void (*bt_keys_foreach_type_cb)(struct bt_keys *keys, void *data); /* List of fakes used by this unit tester */ #define KEYS_FFF_FAKES_LIST(FAKE) \ FAKE(bt_keys_find_irk) \ - FAKE(bt_keys_foreach_type) + FAKE(bt_keys_foreach_type) \ + FAKE(bt_keys_get_addr) DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_find_irk, uint8_t, const bt_addr_le_t *); DECLARE_FAKE_VOID_FUNC(bt_keys_foreach_type, enum bt_keys_type, bt_keys_foreach_type_cb, void *); +DECLARE_FAKE_VALUE_FUNC(struct bt_keys *, bt_keys_get_addr, uint8_t, const bt_addr_le_t *); From 6995eb05922ddf6cf2bd1842748de220dfd26cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Wed, 8 Apr 2026 10:01:31 +0200 Subject: [PATCH 3216/3334] [nrf noup] drivers: flash: Update to support PM removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update conditions for soc_secure_mem_read to support Non-Secure builds without Partition Manager. noup as Partition Manager is a NCS construct. Signed-off-by: Dag Erik Gjørvad (cherry picked from commit b71134cf5d2186b50b78dcded1059f399591536c) --- drivers/flash/soc_flash_nrf.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 27fda598be20..3e735a7edf78 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -36,10 +36,12 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#if CONFIG_TRUSTED_EXECUTION_NONSECURE #include +#if USE_PARTITION_MANAGER #include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ +#endif /* USE_PARTITION_MANAGER */ +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 @@ -170,11 +172,17 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS +#if CONFIG_TRUSTED_EXECUTION_NONSECURE +#if USE_PARTITION_MANAGER && PM_APP_ADDRESS if (addr < PM_APP_ADDRESS) { return soc_secure_mem_read(data, (void *)addr, len); } +#elif !USE_PARTITION_MANAGER && DT_NODE_EXISTS(DT_NODELABEL(slot0_ns_partition)) + if ((uintptr_t)addr < DT_REG_ADDR(DT_NODELABEL(slot0_ns_partition))) { + return soc_secure_mem_read(data, (void *)addr, len); + } #endif +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ nrf_nvmc_buffer_read(data, (uint32_t)addr, len); From 60b37846e857cc47f95d723b11c278c4bd6aded1 Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Mon, 30 Mar 2026 16:30:01 +0200 Subject: [PATCH 3217/3334] [nrf fromtree] tests: Enable tests on nrf7120 NS Enable tests for nrf7120dk/nrf7120/cpuapp/ns platform. Signed-off-by: Travis Lam (cherry picked from commit 19886ffd0fae39bf80a509ad430c82f7c2d7b8d0) --- .../i2c_slave/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay | 7 +++++++ tests/boards/nrf/i2c/i2c_slave/testcase.yaml | 2 ++ .../nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay | 6 ++++++ tests/boards/nrf/qdec/testcase.yaml | 2 ++ .../clock_control/clock_control_api/testcase.yaml | 2 ++ .../clock_control/nrf_clock_calibration/testcase.yaml | 1 + .../clock_control/nrf_lf_clock_start/testcase.yaml | 9 +++++++++ tests/drivers/clock_control/onoff/testcase.yaml | 1 + .../boards/nrf7120dk_nrf7120_cpuapp_ns.overlay | 7 +++++++ .../socs/nrf7120_cpuapp_ns_nrf_comp.overlay | 7 +++++++ .../socs/nrf7120_cpuapp_ns_nrf_lpcomp.overlay | 7 +++++++ tests/drivers/comparator/gpio_loopback/testcase.yaml | 2 ++ .../i2s_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay | 7 +++++++ .../i2s_speed/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay | 7 +++++++ .../boards/nrf7120dk_nrf7120_cpuapp_ns.conf | 1 + .../boards/nrf7120dk_nrf7120_cpuapp_ns.overlay | 7 +++++++ tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml | 1 + tests/drivers/timer/nrf_grtc_timer/testcase.yaml | 1 + .../boards/nrf7120dk_nrf7120_cpuapp_ns.overlay | 7 +++++++ tests/subsys/settings/functional/tfm_psa/testcase.yaml | 1 + 20 files changed, 85 insertions(+) create mode 100644 tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay create mode 100644 tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_ns_nrf_comp.overlay create mode 100644 tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_ns_nrf_lpcomp.overlay create mode 100644 tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay create mode 100644 tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.conf create mode 100644 tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay create mode 100644 tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay diff --git a/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay b/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay new file mode 100644 index 000000000000..a9bb00b00e2d --- /dev/null +++ b/tests/boards/nrf/i2c/i2c_slave/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml index 2e0191e4af2d..5830946f731a 100644 --- a/tests/boards/nrf/i2c/i2c_slave/testcase.yaml +++ b/tests/boards/nrf/i2c/i2c_slave/testcase.yaml @@ -19,6 +19,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp @@ -44,6 +45,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp diff --git a/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay b/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay new file mode 100644 index 000000000000..d806d1dae7c5 --- /dev/null +++ b/tests/boards/nrf/qdec/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay @@ -0,0 +1,6 @@ +/* + * Copyright 2025 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_common.dtsi" diff --git a/tests/boards/nrf/qdec/testcase.yaml b/tests/boards/nrf/qdec/testcase.yaml index 3142d11cb725..cc2a4a0c7782 100644 --- a/tests/boards/nrf/qdec/testcase.yaml +++ b/tests/boards/nrf/qdec/testcase.yaml @@ -11,6 +11,7 @@ common: - nrf54lm20dk/nrf54lm20b/cpuapp - nrf54lm20dk/nrf54lm20b/cpuflpr - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns integration_platforms: - nrf52840dk/nrf52840 - nrf5340dk/nrf5340/cpuapp @@ -20,6 +21,7 @@ common: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20a/cpuflpr - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns harness: ztest harness_config: fixture: gpio_loopback diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index a21d217f2c0c..0e1a75bd690b 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -30,6 +30,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -44,6 +45,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml index 2fc0d85f0f4a..6515882b6e1b 100644 --- a/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml +++ b/tests/drivers/clock_control/nrf_clock_calibration/testcase.yaml @@ -13,6 +13,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml index 995d7825ccd8..a03ce7660cfd 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml +++ b/tests/drivers/clock_control/nrf_lf_clock_start/testcase.yaml @@ -19,6 +19,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SYSTEM_CLOCK_WAIT_FOR_STABILITY=y @@ -39,6 +40,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp extra_configs: - CONFIG_SYSTEM_CLOCK_WAIT_FOR_AVAILABILITY=y @@ -59,6 +61,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -78,6 +81,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -97,6 +101,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -116,6 +121,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -135,6 +141,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -154,6 +161,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 @@ -173,6 +181,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp integration_platforms: - nrf51dk/nrf51822 diff --git a/tests/drivers/clock_control/onoff/testcase.yaml b/tests/drivers/clock_control/onoff/testcase.yaml index 7497615623d3..e24fefe70cd9 100644 --- a/tests/drivers/clock_control/onoff/testcase.yaml +++ b/tests/drivers/clock_control/onoff/testcase.yaml @@ -14,6 +14,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - nrf9160dk/nrf9160 - ophelia4ev/nrf54l15/cpuapp integration_platforms: diff --git a/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay b/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay new file mode 100644 index 000000000000..e2649a103542 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_ns_nrf_comp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_ns_nrf_comp.overlay new file mode 100644 index 000000000000..1b329bcdc6e4 --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_ns_nrf_comp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120_cpuapp_nrf_comp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_ns_nrf_lpcomp.overlay b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_ns_nrf_lpcomp.overlay new file mode 100644 index 000000000000..0c0be798eb1b --- /dev/null +++ b/tests/drivers/comparator/gpio_loopback/socs/nrf7120_cpuapp_ns_nrf_lpcomp.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120_cpuapp_nrf_lpcomp.overlay" diff --git a/tests/drivers/comparator/gpio_loopback/testcase.yaml b/tests/drivers/comparator/gpio_loopback/testcase.yaml index 5c3acb060075..a250523d0460 100644 --- a/tests/drivers/comparator/gpio_loopback/testcase.yaml +++ b/tests/drivers/comparator/gpio_loopback/testcase.yaml @@ -32,6 +32,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.nrf_lpcomp: extra_args: @@ -44,6 +45,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp drivers.comparator.gpio_loopback.stm32_comp: platform_allow: diff --git a/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay new file mode 100644 index 000000000000..e2649a103542 --- /dev/null +++ b/tests/drivers/i2s/i2s_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay b/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay new file mode 100644 index 000000000000..e2649a103542 --- /dev/null +++ b/tests/drivers/i2s/i2s_speed/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.conf b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.conf new file mode 100644 index 000000000000..795414a504ab --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_SKIP_EDGE_NUM=4 diff --git a/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay new file mode 100644 index 000000000000..e2649a103542 --- /dev/null +++ b/tests/drivers/pwm/pwm_gpio_loopback/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml index bf1b0533e5be..0c41f36ee1cc 100644 --- a/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_gpio_loopback/testcase.yaml @@ -41,6 +41,7 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp drivers.pwm.gpio_loopback.silabs: diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index ae6cee3a4563..178d30296ae5 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -14,6 +14,7 @@ common: - nrf54lm20dk/nrf54lm20b/cpuapp - nrf54lm20dk/nrf54lm20b/cpuflpr - nrf7120dk/nrf7120/cpuapp + - nrf7120dk/nrf7120/cpuapp/ns - ophelia4ev/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuflpr integration_platforms: diff --git a/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay new file mode 100644 index 000000000000..e2649a103542 --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf7120dk_nrf7120_cpuapp_ns.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7120dk_nrf7120_cpuapp.overlay" diff --git a/tests/subsys/settings/functional/tfm_psa/testcase.yaml b/tests/subsys/settings/functional/tfm_psa/testcase.yaml index eaed7cc4b8e5..9ff419860fad 100644 --- a/tests/subsys/settings/functional/tfm_psa/testcase.yaml +++ b/tests/subsys/settings/functional/tfm_psa/testcase.yaml @@ -4,6 +4,7 @@ common: - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns + - nrf7120dk/nrf7120/cpuapp/ns - mps2/an521/cpu0/ns platform_exclude: - lpcxpresso55s69/lpc55s69/cpu0/ns From 602013ac3bf9d20375023765abfd05f9cc4a17f1 Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Tue, 7 Apr 2026 12:56:40 +0200 Subject: [PATCH 3218/3334] [nrf fromtree] boards: nordic: nrf7120: Update NS yaml Update nrf7120 ns yaml file with missing pwm support and align ram and flash size to use slot0_ns partition. Signed-off-by: Travis Lam (cherry picked from commit e56287bed13deebe74584e04c83cebda9aa31005) --- boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.yaml b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.yaml index 3891b38e52a0..5d91c5978f3b 100644 --- a/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.yaml +++ b/boards/nordic/nrf7120dk/nrf7120dk_nrf7120_cpuapp_ns.yaml @@ -7,10 +7,9 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr -ram: 896 -flash: 512 +ram: 256 +flash: 844 supported: - adc - gpio @@ -18,5 +17,7 @@ supported: - spi - counter - watchdog - - adc - i2s + - pwm +vendor: nordic +sysbuild: true From 61cfe75744ea06b614e062e52f83c72bfa5ac018 Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Mon, 30 Mar 2026 16:36:36 +0200 Subject: [PATCH 3219/3334] [nrf fromtree] samples: tfm: Add nrf7120 in TF-M samples yaml Add nRF7120 non secure target for the config_build and the tfm_ipc samples. Signed-off-by: Travis Lam (cherry picked from commit e5302dc7cea95aaee933171e4206a5e1e3587cd7) --- samples/tfm_integration/config_build/sample.yaml | 1 + samples/tfm_integration/tfm_ipc/sample.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/samples/tfm_integration/config_build/sample.yaml b/samples/tfm_integration/config_build/sample.yaml index b8d0a6876238..928ed2478db7 100644 --- a/samples/tfm_integration/config_build/sample.yaml +++ b/samples/tfm_integration/config_build/sample.yaml @@ -11,6 +11,7 @@ common: - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns + - nrf7120dk/nrf7120/cpuapp/ns - bl5340_dvk/nrf5340/cpuapp/ns integration_platforms: - nrf5340dk/nrf5340/cpuapp/ns diff --git a/samples/tfm_integration/tfm_ipc/sample.yaml b/samples/tfm_integration/tfm_ipc/sample.yaml index 0ec789de7526..78242176e202 100644 --- a/samples/tfm_integration/tfm_ipc/sample.yaml +++ b/samples/tfm_integration/tfm_ipc/sample.yaml @@ -39,6 +39,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp/ns - nrf54lm20dk/nrf54lm20a/cpuapp/ns + - nrf7120dk/nrf7120/cpuapp/ns extra_configs: - CONFIG_TFM_BL2=n harness: console From 1abbc7cc1c58f55d58cad326eae51be1f8a0b76c Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Fri, 10 Apr 2026 14:13:18 +0200 Subject: [PATCH 3220/3334] [nrf fromtree] scripts: west_commands: runners: nrf_common: use app core at default Use Application core as default unless specified differently. This will make adding new product easier. Signed-off-by: Piotr Kosycarz (cherry picked from commit db145a5af7b840ebf199d9e6c3f4925f17b4c0a3) --- scripts/west_commands/runners/nrf_common.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index e47dd73f4a38..f1fe179474b4 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -305,22 +305,15 @@ def recover_target(self): def _get_core(self): if self.family in ('nrf54h', 'nrf92'): - if (self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP') or - self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUFLPR') or - self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUPPR') or - self.build_conf.getboolean('CONFIG_SOC_NRF9280_CPUAPP')): - return 'Application' if (self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPURAD') or self.build_conf.getboolean('CONFIG_SOC_NRF9280_CPURAD')): return 'Network' - raise RuntimeError(f'Core not found for family: {self.family}') + return 'Application' if self.family in ('nrf53'): - if self.build_conf.getboolean('CONFIG_SOC_NRF5340_CPUAPP'): - return 'Application' if self.build_conf.getboolean('CONFIG_SOC_NRF5340_CPUNET'): return 'Network' - raise RuntimeError(f'Core not found for family: {self.family}') + return 'Application' return None From cbfc83a156cd8e937d60e6decd4ea771591d0963 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Fri, 10 Apr 2026 11:49:30 +0300 Subject: [PATCH 3221/3334] [nrf fromtree] secure_storage: its_transform: aead: enable PSA_CRYPTO This implementation relies on PSA Crypto. Make sure it's enabled. Signed-off-by: Tomi Fontanilles (cherry picked from commit 6b1d0f010bb7efea8deb0b46b397d3172d4cc964) --- subsys/secure_storage/Kconfig.its_transform | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/secure_storage/Kconfig.its_transform b/subsys/secure_storage/Kconfig.its_transform index 1b073a08aab5..f8008353616b 100644 --- a/subsys/secure_storage/Kconfig.its_transform +++ b/subsys/secure_storage/Kconfig.its_transform @@ -6,6 +6,7 @@ choice SECURE_STORAGE_ITS_TRANSFORM_IMPLEMENTATION config SECURE_STORAGE_ITS_TRANSFORM_IMPLEMENTATION_AEAD bool "ITS transform module implementation using AEAD to protect the data" + select PSA_CRYPTO imply HWINFO # for HWINFO_HAS_DRIVER config SECURE_STORAGE_ITS_TRANSFORM_IMPLEMENTATION_CUSTOM From d643753a8c3cce232a64ff00d8542a367ae8eca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 20 Apr 2026 13:28:46 +0200 Subject: [PATCH 3222/3334] [nrf fromtree] drivers: debug: coresight_nrf: Fix setting Trace ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mask STM_STMTCSR_TRACEID_Msk is already bit shifted so Kconfig value should first be shifted and then masked. The way it was done previously resulted in TraceID being cleared. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 3f76f6059d3010c4cdd4207eaee5803148af3f2b) --- drivers/debug/debug_coresight_nrf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/debug/debug_coresight_nrf.c b/drivers/debug/debug_coresight_nrf.c index f0762a871dc0..5bc4d094bc8f 100644 --- a/drivers/debug/debug_coresight_nrf.c +++ b/drivers/debug/debug_coresight_nrf.c @@ -134,8 +134,8 @@ static void nrf_stm_init(void) sys_write32((1 << STM_STMHEMCR_EN_Pos), stm + STM_STMHEMCR_OFFSET); } - sys_write32(((CONFIG_DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL & STM_STMTCSR_TRACEID_Msk) - << STM_STMTCSR_TRACEID_Pos) | + sys_write32(((CONFIG_DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL << STM_STMTCSR_TRACEID_Pos) + & STM_STMTCSR_TRACEID_Msk) | (1 << STM_STMTCSR_EN_Pos) | (1 << STM_STMTCSR_TSEN_Pos), stm + STM_STMTCSR_OFFSET); From eabab17f24a9d1c2f6212adcca8616ef2650fc02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Fri, 10 Apr 2026 13:17:02 +0200 Subject: [PATCH 3223/3334] [nrf fromtree] soc: nordic: Add snapshot region support in UICR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add snapshot region support in UICR. Signed-off-by: Sebastian Bøe (cherry picked from commit 28dfa4343c5d27b8e3676f05c08b9561d6277705) --- soc/nordic/common/uicr/Kconfig.gen_uicr | 32 +++++++++++++++++++ .../Kconfig.template.gen_uicr_snapshot_region | 22 +++++++++++++ .../common/uicr/gen_uicr/CMakeLists.txt | 15 +++++++++ 3 files changed, 69 insertions(+) create mode 100644 soc/nordic/common/uicr/Kconfig.template.gen_uicr_snapshot_region diff --git a/soc/nordic/common/uicr/Kconfig.gen_uicr b/soc/nordic/common/uicr/Kconfig.gen_uicr index c07ba3e051f1..47c7c097991c 100644 --- a/soc/nordic/common/uicr/Kconfig.gen_uicr +++ b/soc/nordic/common/uicr/Kconfig.gen_uicr @@ -404,4 +404,36 @@ config GEN_UICR_POLICY_MPCCONF_STAGE_VALUE default 0x1730C77F if GEN_UICR_POLICY_MPCCONF_STAGE_NORMAL default 0 +config GEN_UICR_SNAPSHOT_REGIONS + bool "UICR.SNAPSHOT.REGIONS" + depends on SOC_SERIES_NRF54H + help + When enabled, the UICR generator will configure the snapshot regions + specified in Kconfig. + +if GEN_UICR_SNAPSHOT_REGIONS + +index = 0 +rsource "Kconfig.template.gen_uicr_snapshot_region" + +index = 1 +rsource "Kconfig.template.gen_uicr_snapshot_region" + +index = 2 +rsource "Kconfig.template.gen_uicr_snapshot_region" + +index = 3 +rsource "Kconfig.template.gen_uicr_snapshot_region" + +index = 4 +rsource "Kconfig.template.gen_uicr_snapshot_region" + +index = 5 +rsource "Kconfig.template.gen_uicr_snapshot_region" + +index = 6 +rsource "Kconfig.template.gen_uicr_snapshot_region" + +endif # GEN_UICR_SNAPSHOT_REGIONS + endmenu diff --git a/soc/nordic/common/uicr/Kconfig.template.gen_uicr_snapshot_region b/soc/nordic/common/uicr/Kconfig.template.gen_uicr_snapshot_region new file mode 100644 index 000000000000..5eed27ac39eb --- /dev/null +++ b/soc/nordic/common/uicr/Kconfig.template.gen_uicr_snapshot_region @@ -0,0 +1,22 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config GEN_UICR_SNAPSHOT_REGION_$(index) + bool "UICR.SNAPSHOT region" + depends on GEN_UICR_SNAPSHOT_REGIONS + help + When enabled, configures a UICR.SNAPSHOT region. + +config GEN_UICR_SNAPSHOT_REGION_$(index)_ADDRESS + hex "UICR.SNAPSHOT region start address" + range 0x0e030000 0x0e1ff000 + depends on GEN_UICR_SNAPSHOT_REGION_$(index) + help + UICR.SNAPSHOT region start address. Must be aligned to a 1 KB boundary. + +config GEN_UICR_SNAPSHOT_REGION_$(index)_SIZE_BYTES + int "UICR.SNAPSHOT region size in bytes" + range 1024 1048576 + depends on GEN_UICR_SNAPSHOT_REGION_$(index) + help + Size of the snapshot region in bytes. Must be a multiple of 1024. diff --git a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt index c216a5d5e8c5..a5cedb4b7a71 100644 --- a/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt @@ -88,6 +88,7 @@ set(eraseprotect_args) set(approtect_args) set(protectedmem_args) set(periphconf_args) +set(snapshot_args) set(mpcconf_args) set(wdtstart_args) set(periphconf_elfs) @@ -364,6 +365,19 @@ if(CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_INIT OR CONFIG_GEN_UICR_POLICY_MPCCONF_S list(APPEND policy_args --policy-mpcconf-stage ${CONFIG_GEN_UICR_POLICY_MPCCONF_STAGE_VALUE}) endif() +# Handle SNAPSHOT configuration (indices 0..6 match Kconfig.template.gen_uicr_snapshot_region) +if(CONFIG_GEN_UICR_SNAPSHOT_REGIONS) + foreach(snapshot_region_idx RANGE 0 6) + if(CONFIG_GEN_UICR_SNAPSHOT_REGION_${snapshot_region_idx}) + list(APPEND snapshot_args + --snapshot-region + ${CONFIG_GEN_UICR_SNAPSHOT_REGION_${snapshot_region_idx}_ADDRESS} + ${CONFIG_GEN_UICR_SNAPSHOT_REGION_${snapshot_region_idx}_SIZE_BYTES} + ) + endif() + endforeach() +endif() + set(periphconf_check_base_cmd ${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE} ${PYTHON_EXECUTABLE} ${IRONSIDE_SUPPORT_DIR}/se/tool/ironside/__main__.py @@ -448,6 +462,7 @@ add_custom_command( ${protectedmem_args} ${secondary_args} ${policy_args} + ${snapshot_args} ${periphconf_validate_build_command} ${secondary_periphconf_validate_build_command} DEPENDS ${gen_uicr_depends} From c6c186b3a19a65cfe988c942e703dee84338c23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Tue, 10 Mar 2026 19:08:55 +0100 Subject: [PATCH 3224/3334] [nrf noup] drivers: pinctrl_nrf: Add support for SDP/HPF pins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add possibility to configure pins to be used by soft peripherals and the High-Performance Framework, i.e. to assign them to the FLPR core. Signed-off-by: Andrzej Głąbek (cherry picked from commit 11cfd5fd7a9ec050e961af26a2b381dad44e5198) --- drivers/pinctrl/pinctrl_nrf.c | 32 ++++++++++ .../zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 58 +++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index b052e61eb803..750f38a83123 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -110,6 +110,18 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = { #define NRF_PSEL_TDM(reg, line) ((NRF_TDM_Type *)reg)->PSEL.line #endif +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || \ + defined(CONFIG_MSPI_HPF) || \ + DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(nordic_nrf_vpr_coprocessor, pinctrl_0) +#if defined(CONFIG_SOC_SERIES_NRF54L) +#define NRF_PSEL_SDP_MSPI(psel) \ + nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_VPR); +#elif defined(CONFIG_SOC_SERIES_NRF54H) +/* On nRF54H, pin routing is controlled by secure domain, via UICR. */ +#define NRF_PSEL_SDP_MSPI(psel) +#endif +#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_hpf_mspi_controller) || ... */ + #if NRF_GPIO_HAS_RETENTION_SETCLEAR static void port_pin_retain_set(uint16_t pin_number, bool enable) @@ -500,6 +512,26 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, input = NRF_GPIO_PIN_INPUT_CONNECT; break; #endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_qspi_v2) */ +#if defined(NRF_PSEL_SDP_MSPI) + case NRF_FUN_SDP_MSPI_CS0: + case NRF_FUN_SDP_MSPI_CS1: + case NRF_FUN_SDP_MSPI_CS2: + case NRF_FUN_SDP_MSPI_CS3: + case NRF_FUN_SDP_MSPI_CS4: + case NRF_FUN_SDP_MSPI_SCK: + case NRF_FUN_SDP_MSPI_DQ0: + case NRF_FUN_SDP_MSPI_DQ1: + case NRF_FUN_SDP_MSPI_DQ2: + case NRF_FUN_SDP_MSPI_DQ3: + case NRF_FUN_SDP_MSPI_DQ4: + case NRF_FUN_SDP_MSPI_DQ5: + case NRF_FUN_SDP_MSPI_DQ6: + case NRF_FUN_SDP_MSPI_DQ7: + NRF_PSEL_SDP_MSPI(psel); + dir = NRF_GPIO_PIN_DIR_OUTPUT; + input = NRF_GPIO_PIN_INPUT_CONNECT; + break; +#endif /* defined(NRF_PSEL_SDP_MSPI) */ #if defined(NRF_PSEL_TWIS) case NRF_FUN_TWIS_SCL: NRF_PSEL_TWIS(reg, SCL) = psel; diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 92e62a9a6bed..480e3f13797c 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -172,6 +172,64 @@ #define NRF_FUN_GRTC_CLKOUT_FAST 55U /** GRTC slow clock output */ #define NRF_FUN_GRTC_CLKOUT_32K 56U +/** SDP_MSPI clock pin */ +#define NRF_FUN_SDP_MSPI_SCK 57U +/** SDP_MSPI data pin 0 */ +#define NRF_FUN_SDP_MSPI_DQ0 58U +/** SDP_MSPI data pin 1 */ +#define NRF_FUN_SDP_MSPI_DQ1 59U +/** SDP_MSPI data pin 2 */ +#define NRF_FUN_SDP_MSPI_DQ2 60U +/** SDP_MSPI data pin 3 */ +#define NRF_FUN_SDP_MSPI_DQ3 61U +/** SDP_MSPI data pin 4 */ +#define NRF_FUN_SDP_MSPI_DQ4 62U +/** SDP_MSPI data pin 5 */ +#define NRF_FUN_SDP_MSPI_DQ5 63U +/** SDP_MSPI data pin 6 */ +#define NRF_FUN_SDP_MSPI_DQ6 64U +/** SDP_MSPI data pin 7 */ +#define NRF_FUN_SDP_MSPI_DQ7 65U +/** SDP_MSPI chip select 0 */ +#define NRF_FUN_SDP_MSPI_CS0 66U +/** SDP_MSPI chip select 1 */ +#define NRF_FUN_SDP_MSPI_CS1 67U +/** SDP_MSPI chip select 2 */ +#define NRF_FUN_SDP_MSPI_CS2 68U +/** SDP_MSPI chip select 3 */ +#define NRF_FUN_SDP_MSPI_CS3 69U +/** SDP_MSPI chip select 4 */ +#define NRF_FUN_SDP_MSPI_CS4 70U +/** Generic soft peripheral pin */ +#define NRF_FUN_SP_PIN NRF_FUN_SDP_MSPI_SCK +/** High-Performance Framework MSPI clock pin */ +#define NRF_FUN_HPF_MSPI_SCK NRF_FUN_SDP_MSPI_SCK +/** High-Performance Framework MSPI data pin 0 */ +#define NRF_FUN_HPF_MSPI_DQ0 NRF_FUN_SDP_MSPI_DQ0 +/** High-Performance Framework MSPI data pin 1 */ +#define NRF_FUN_HPF_MSPI_DQ1 NRF_FUN_SDP_MSPI_DQ1 +/** High-Performance Framework MSPI data pin 2 */ +#define NRF_FUN_HPF_MSPI_DQ2 NRF_FUN_SDP_MSPI_DQ2 +/** High-Performance Framework MSPI data pin 3 */ +#define NRF_FUN_HPF_MSPI_DQ3 NRF_FUN_SDP_MSPI_DQ3 +/** High-Performance Framework MSPI data pin 4 */ +#define NRF_FUN_HPF_MSPI_DQ4 NRF_FUN_SDP_MSPI_DQ4 +/** High-Performance Framework MSPI data pin 5 */ +#define NRF_FUN_HPF_MSPI_DQ5 NRF_FUN_SDP_MSPI_DQ5 +/** High-Performance Framework MSPI data pin 6 */ +#define NRF_FUN_HPF_MSPI_DQ6 NRF_FUN_SDP_MSPI_DQ6 +/** High-Performance Framework MSPI data pin 7 */ +#define NRF_FUN_HPF_MSPI_DQ7 NRF_FUN_SDP_MSPI_DQ7 +/** High-Performance Framework MSPI chip select pin 0 */ +#define NRF_FUN_HPF_MSPI_CS0 NRF_FUN_SDP_MSPI_CS0 +/** High-Performance Framework MSPI chip select pin 1 */ +#define NRF_FUN_HPF_MSPI_CS1 NRF_FUN_SDP_MSPI_CS1 +/** High-Performance Framework MSPI chip select pin 2 */ +#define NRF_FUN_HPF_MSPI_CS2 NRF_FUN_SDP_MSPI_CS2 +/** High-Performance Framework MSPI chip select pin 3 */ +#define NRF_FUN_HPF_MSPI_CS3 NRF_FUN_SDP_MSPI_CS3 +/** High-Performance Framework MSPI chip select pin 4 */ +#define NRF_FUN_HPF_MSPI_CS4 NRF_FUN_SDP_MSPI_CS4 /** TDM SCK in master mode */ #define NRF_FUN_TDM_SCK_M 71U /** TDM SCK in slave mode */ From eee80d58d993521a5ecae8b71ed3b40588fcc1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Thu, 9 Apr 2026 15:35:30 +0200 Subject: [PATCH 3225/3334] [nrf fromtree] drivers: hwinfo: nrf: Enable driver for nRF92 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for hwinfo_nrf driver for nRF92 series. Signed-off-by: Michał Stasiak (cherry picked from commit 82b50ccafd27052e7b4dbf226a8a486317c914ea) --- drivers/hwinfo/Kconfig.nrf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwinfo/Kconfig.nrf b/drivers/hwinfo/Kconfig.nrf index bae67e0a81d3..10ccb0f45747 100644 --- a/drivers/hwinfo/Kconfig.nrf +++ b/drivers/hwinfo/Kconfig.nrf @@ -5,7 +5,7 @@ config HWINFO_NRF bool "NRF device ID" default y depends on SOC_FAMILY_NORDIC_NRF - depends on SOC_SERIES_NRF54H || NRF_SOC_SECURE_SUPPORTED + depends on SOC_SERIES_NRF54H || SOC_SERIES_NRF92 || NRF_SOC_SECURE_SUPPORTED select HWINFO_HAS_DRIVER help Enable Nordic NRF hwinfo driver. From 7e0d2055c0a010f564d64cda71bda4a206033fcc Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Tue, 21 Apr 2026 16:21:53 +0200 Subject: [PATCH 3226/3334] [nrf fromtree] drivers: hwinfo: nrf: align to NFC-only FICR registers Some devices do not have DEVICEID or BLE-related registers in FICR. Use NFCID instead in such cases, if available. Signed-off-by: Nikodem Kastelik (cherry picked from commit 3002ec553068c7c0ca641db3e83e08c9a25847f1) --- drivers/hwinfo/hwinfo_nrf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index d7b7b077546b..df4b8e34bffa 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -52,6 +52,13 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length) */ buf[1] |= (nrf_ficr_er_get(NRF_FICR, 0) & 0xFF) << 16; buf[1] |= (nrf_ficr_ir_get(NRF_FICR, 0) & 0xFF) << 24; +#elif NRF_FICR_HAS_NFC_TAGHEADER_ARRAY + /* DEVICEID is not accessible, use NFCID instead. + * Assume that it is always accessible from the non-secure image. + * Skip TAGHEADER[0] as it always contain Manufacturer ID. + */ + buf[0] = nrf_ficr_nfc_tagheader_get(NRF_FICR, 1); + buf[1] = nrf_ficr_nfc_tagheader_get(NRF_FICR, 2); #else #error "No suitable source for hwinfo device_id generation" #endif From 48158e653ea4bbdd04c9d914ef00cef4e36b681f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 4 Feb 2026 12:59:03 +0100 Subject: [PATCH 3227/3334] [nrf fromtree] samples: boards: nordic: coresight_stm: Minor fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Limit execution of sample.boards.nrf.coresight_stm.tpiu.dict to test setups with jlink_trace_pro fixture as JLink Pro is required to use TPIU. Define harness for sample.boards.nrf.coresight_stm.rtt. Otherwise, Twister is unable to derive test result. Aling serial port use to the lates changes in the DeviceAdapter. Signed-off-by: Sebastian Głąb (cherry picked from commit fd434e2cb5e49a17b94e1c13e890c7d2b21d21ac) --- samples/boards/nordic/coresight_stm/pytest/test_stm.py | 2 +- samples/boards/nordic/coresight_stm/sample.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/samples/boards/nordic/coresight_stm/pytest/test_stm.py b/samples/boards/nordic/coresight_stm/pytest/test_stm.py index 993df0b55fb8..b40cee4ad6e2 100644 --- a/samples/boards/nordic/coresight_stm/pytest/test_stm.py +++ b/samples/boards/nordic/coresight_stm/pytest/test_stm.py @@ -172,7 +172,7 @@ def nrfutil_dictionary_from_serial( decoded_file_name: str = "output.txt", collect_time: float = 60.0, ) -> None: - UART_PATH = dut.device_config.serial + UART_PATH = dut.device_config.serial_configs[0].port dut.close() logger.debug(f"Using serial: {UART_PATH}") diff --git a/samples/boards/nordic/coresight_stm/sample.yaml b/samples/boards/nordic/coresight_stm/sample.yaml index 4dde7feb0219..4a15ce2afb96 100644 --- a/samples/boards/nordic/coresight_stm/sample.yaml +++ b/samples/boards/nordic/coresight_stm/sample.yaml @@ -23,6 +23,9 @@ tests: - SB_CONFIG_APP_CPUFLPR_RUN=y sample.boards.nrf.coresight_stm.tpiu.dict: + harness: console + harness_config: + fixture: jlink_trace_pro required_snippets: - nordic-log-stm-tpiu-dict extra_args: @@ -42,6 +45,11 @@ tests: - SB_CONFIG_APP_CPUFLPR_RUN=y sample.boards.nrf.coresight_stm.rtt: + harness: pytest + harness_config: + pytest_dut_scope: session + pytest_root: + - "pytest/test_stm.py::test_sample_STM_decoded" required_snippets: - nordic-log-stm extra_configs: From e3766f015f5834c601f22a5b005160fc0ee8ddc5 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 16 Apr 2026 13:50:52 +0200 Subject: [PATCH 3228/3334] [nrf fromtree] samples: boards: nordic: coresight_stm: align timming for ppr and flpr Update required timming. Signed-off-by: Piotr Kosycarz (cherry picked from commit 2d628a8e07dbc9424a506c38a88e8311a96543a7) --- samples/boards/nordic/coresight_stm/pytest/test_stm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/boards/nordic/coresight_stm/pytest/test_stm.py b/samples/boards/nordic/coresight_stm/pytest/test_stm.py index b40cee4ad6e2..3578f3e5b078 100644 --- a/samples/boards/nordic/coresight_stm/pytest/test_stm.py +++ b/samples/boards/nordic/coresight_stm/pytest/test_stm.py @@ -302,7 +302,7 @@ def test_STM_decoded(dut: DeviceAdapter): log_2_arg=26.9, log_3_arg=27.5, log_str=68.3, - tracepoint=0.55, + tracepoint=0.9, tracepoint_d32=0.25, tolerance=0.5, ) @@ -313,8 +313,8 @@ def test_STM_decoded(dut: DeviceAdapter): log_2_arg=1.2, log_3_arg=1.2, log_str=3.0, - tracepoint=0.25, - tracepoint_d32=0.25, + tracepoint=0.5, + tracepoint_d32=0.5, tolerance=0.5, ) From 3888bdd3a5b23efdd7e9237cdd53947802c9fa7a Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 16 Apr 2026 14:31:41 +0200 Subject: [PATCH 3229/3334] [nrf fromtree] samples: boards: nordic: coresight_stm: more logs from nrfutil Make easier debugging nrfutil call. Signed-off-by: Piotr Kosycarz (cherry picked from commit de1d79b920e185d5969d8737a1afe2e5c45e29e5) --- samples/boards/nordic/coresight_stm/pytest/test_stm.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/samples/boards/nordic/coresight_stm/pytest/test_stm.py b/samples/boards/nordic/coresight_stm/pytest/test_stm.py index 3578f3e5b078..dd6008c65b26 100644 --- a/samples/boards/nordic/coresight_stm/pytest/test_stm.py +++ b/samples/boards/nordic/coresight_stm/pytest/test_stm.py @@ -203,7 +203,12 @@ def nrfutil_dictionary_from_serial( try: # run nrfutil trace in background non-blocking logger.info(f"Executing:\n{cmd}") - proc = subprocess.Popen(cmd.split(), stdout=subprocess.DEVNULL) + proc = subprocess.Popen(cmd.split(), + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + encoding='UTF-8', + errors='replace') except OSError as exc: logger.error(f"Unable to start nrfutil trace:\n{cmd}\n{exc}") try: @@ -212,6 +217,8 @@ def nrfutil_dictionary_from_serial( pass finally: _kill(proc) + outs, errs = proc.communicate() + logger.info(f"{outs=}\n{errs=}") def test_sample_STM_decoded(dut: DeviceAdapter): From a50c92864a9ecf6da67395d9628f6c9f600fabbe Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Thu, 23 Apr 2026 12:18:14 +0200 Subject: [PATCH 3230/3334] [nrf fromtree] samples: boards: nordic: coresight_stm: align timing Align timing. Signed-off-by: Piotr Kosycarz (cherry picked from commit 4841d6e6fcc5418063b1d11715ed0455668ef46f) --- samples/boards/nordic/coresight_stm/pytest/test_stm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/boards/nordic/coresight_stm/pytest/test_stm.py b/samples/boards/nordic/coresight_stm/pytest/test_stm.py index dd6008c65b26..feb9a7cf37a5 100644 --- a/samples/boards/nordic/coresight_stm/pytest/test_stm.py +++ b/samples/boards/nordic/coresight_stm/pytest/test_stm.py @@ -454,8 +454,8 @@ def test_STM_dictionary_mode(dut: DeviceAdapter): log_2_arg=8.6, log_3_arg=17.4, log_str=45.2, - tracepoint=0.5, - tracepoint_d32=0.5, + tracepoint=1.5, + tracepoint_d32=1.5, tolerance=0.5, ) flpr_constraints = STMLimits( From 4ca40c22d3c57943f79a0d2c129fb594d6e0b0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Mon, 13 Apr 2026 13:41:27 +0200 Subject: [PATCH 3231/3334] [nrf fromtree] manifest: update hal_nordic revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update hal_nordic revision. Signed-off-by: Sebastian Bøe (cherry picked from commit f63ae9547f433333bc00c2e801691c84e51538bc) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 069c00081d94..f0312604b2f7 100644 --- a/west.yml +++ b/west.yml @@ -203,7 +203,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 44fd3d44b15cb75f80a25b4679f91d2787e28664 + revision: af3848538da37360913bc68eeef40f32430b7c52 path: modules/hal/nordic groups: - hal From aa2a6afceafd1b5f5c2dabdbffe01f35bbceaa1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 16 Apr 2026 10:31:24 +0200 Subject: [PATCH 3232/3334] [nrf fromtree] manifest: Update hal_nordic with fix in GPPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update hal_nordic with fix in nrfx_gppi helper module. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 191f5726cf0d48af6422c79474d04ef3b785d2c4) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f0312604b2f7..5801aeded36c 100644 --- a/west.yml +++ b/west.yml @@ -203,7 +203,7 @@ manifest: groups: - hal - name: hal_nordic - revision: af3848538da37360913bc68eeef40f32430b7c52 + revision: 0424db2d8320cfe417af5675b5bfd2b9a8b43d23 path: modules/hal/nordic groups: - hal From 5706ffc1e50eeee56271b2828cebbf292623fc54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Tue, 21 Apr 2026 15:44:51 +0200 Subject: [PATCH 3233/3334] [nrf fromtree] manifest: update hal_nordic revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update hal_nordic revision. Requires https://github.com/zephyrproject-rtos/hal_nordic/pull/357 Signed-off-by: Sebastian Bøe (cherry picked from commit f9799c59e6eea7c1d8845d8a85eade1daf2bb0bf) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 5801aeded36c..cadc129db3e8 100644 --- a/west.yml +++ b/west.yml @@ -203,7 +203,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 0424db2d8320cfe417af5675b5bfd2b9a8b43d23 + revision: c8f0c2b6ecf66b0a4af24b5272d879c305868feb path: modules/hal/nordic groups: - hal From 9e1dd135b62c9f70e90b4bbc3a263bdd83143e17 Mon Sep 17 00:00:00 2001 From: Szymon Antkowiak Date: Mon, 20 Apr 2026 09:46:47 +0200 Subject: [PATCH 3234/3334] [nrf fromtree] drivers: sensor: bmi270: align initialization with spec Soft reset is largely equivalent to power cycle. Add dummy read of chip ID after soft reset in BMI270 initialization function. Dummy read is performed via bus initialization. Jira: NCSDK-38333 Signed-off-by: Szymon Antkowiak (cherry picked from commit 7b54696ef85421d33bd8c208ab342c695704f3b2) --- drivers/sensor/bosch/bmi270/bmi270.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/sensor/bosch/bmi270/bmi270.c b/drivers/sensor/bosch/bmi270/bmi270.c index febcfeb2d032..9d965e6754b7 100644 --- a/drivers/sensor/bosch/bmi270/bmi270.c +++ b/drivers/sensor/bosch/bmi270/bmi270.c @@ -690,6 +690,13 @@ static int bmi270_init(const struct device *dev) k_usleep(BMI270_SOFT_RESET_TIME); + /* Initialize bus after soft reset according to BMI270 spec */ + ret = bmi270_bus_init(dev); + if (ret != 0) { + LOG_ERR("Could not initiate bus communication"); + return ret; + } + ret = bmi270_reg_read(dev, BMI270_REG_PWR_CONF, &adv_pwr_save, 1); if (ret != 0) { return ret; From 6a562e8782b96e234e9caee9b6e1de67218cef5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 16 Apr 2026 10:22:39 +0200 Subject: [PATCH 3235/3334] [nrf fromtree] soc: nordic: gppi: Move to feature specific structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move files which are specific to nrf54h20 global domain from nrf54h folder to common. Rename those files to use sd2ppi name instead of nrf54h. SD2PPI (or SD^2PPI) is an abbrevation for Secure Distributed (multi-Domain) DPPI - PPI system where DPPI resources requires Ironside service. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 2c4b1d1f61ebbe1f45e85aec00036ba0a2c9b03e) --- modules/hal_nordic/nrfx/CMakeLists.txt | 4 +--- modules/hal_nordic/nrfx/Kconfig | 8 ++++++++ soc/nordic/common/CMakeLists.txt | 1 + soc/nordic/common/gppi_init.c | 6 +++--- .../nrfx_gppi_sd2ppi_global.c} | 2 +- .../nrfx_gppi_sd2ppi_global.h} | 6 +++--- soc/nordic/nrf54h/CMakeLists.txt | 1 - soc/nordic/nrf54h/Kconfig | 1 + 8 files changed, 18 insertions(+), 11 deletions(-) rename soc/nordic/{nrf54h/nrfx_gppi_nrf54h_global.c => common/nrfx_gppi_sd2ppi_global.c} (99%) rename soc/nordic/{nrf54h/nrfx_gppi_nrf54h_global.h => common/nrfx_gppi_sd2ppi_global.h} (85%) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index ea7b59902454..dffdaa361b2b 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -139,9 +139,7 @@ zephyr_library_sources_ifdef(CONFIG_HAS_NORDIC_RAM_CTRL ${HELPERS_DIR}/nrf if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) zephyr_library_sources_ifdef(CONFIG_HAS_HW_NRF_PPI ${HELPERS_DIR}/nrfx_gppi_ppi.c) - if(CONFIG_SOC_SERIES_NRF54H OR CONFIG_SOC_SERIES_NRF54L OR CONFIG_SOC_SERIES_NRF71 OR CONFIG_HAS_HW_NRF_DPPIC) - zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi.c) - endif() + zephyr_library_sources_ifndef(CONFIG_HAS_HW_NRF_PPI ${HELPERS_DIR}/nrfx_gppi_dppi.c) if(CONFIG_SOC_COMPATIBLE_NRF54LX OR CONFIG_SOC_SERIES_NRF71) zephyr_library_sources(${BSP_DIR}/soc/interconnect/nrfx_gppi_d2ppi.c) endif() diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index a908834b50e2..f196ef2129e8 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -140,6 +140,14 @@ config NRFX_GPPI_V1 help When enabled then legacy version of Generic PPI layer is used. +config NRFX_GPPI_SD2PPI_GLOBAL + bool + depends on NRFX_GPPI && !NRFX_GPPI_V1 + help + Indicates GPPI implementation for SD^2PPI (Secure multi-Domain DPPI) architecture. + SD^2PPI architecture is using multiple instances of DPPI controllers and Ironside service + to configure the security and ownership of the PPI resources. + config NRFX_GRTC bool "GRTC driver" depends on $(dt_nodelabel_exists,grtc) diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index fbd7fbe0541f..c4042a73ffde 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -38,6 +38,7 @@ endif() if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) zephyr_library_sources(gppi_init.c) + zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI_SD2PPI_GLOBAL nrfx_gppi_sd2ppi_global.c) endif() if(CONFIG_TFM_PARTITION_PLATFORM) diff --git a/soc/nordic/common/gppi_init.c b/soc/nordic/common/gppi_init.c index afa5c9fb2583..e38934b83e5d 100644 --- a/soc/nordic/common/gppi_init.c +++ b/soc/nordic/common/gppi_init.c @@ -7,8 +7,8 @@ #include #if defined(NRFX_GPPI_MULTI_DOMAIN) && !defined(NRFX_GPPI_FIXED_CONNECTIONS) #include -#elif defined(CONFIG_SOC_NRF54H20_CPUAPP) -#include +#elif defined(CONFIG_NRFX_GPPI_SD2PPI_GLOBAL) +#include #elif defined(CONFIG_SOC_NRF54H20_CPURAD) #include #endif @@ -51,7 +51,7 @@ static int gppi_init(void) NRFX_BIT_MASK(DPPIC20_GROUP_NUM_SIZE) & ~NRFX_DPPI20_GROUPS_USED); nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC30, NRFX_BIT_MASK(DPPIC30_GROUP_NUM_SIZE) & ~NRFX_DPPI30_GROUPS_USED); -#elif defined(CONFIG_SOC_NRF54H20_CPUAPP) +#elif defined(CONFIG_NRFX_GPPI_SD2PPI_GLOBAL) gppi_instance.routes = nrfx_gppi_routes_get(); gppi_instance.route_map = nrfx_gppi_route_map_get(); gppi_instance.nodes = nrfx_gppi_nodes_get(); diff --git a/soc/nordic/nrf54h/nrfx_gppi_nrf54h_global.c b/soc/nordic/common/nrfx_gppi_sd2ppi_global.c similarity index 99% rename from soc/nordic/nrf54h/nrfx_gppi_nrf54h_global.c rename to soc/nordic/common/nrfx_gppi_sd2ppi_global.c index ebb5f4662ca4..e1e37eac5b04 100644 --- a/soc/nordic/nrf54h/nrfx_gppi_nrf54h_global.c +++ b/soc/nordic/common/nrfx_gppi_sd2ppi_global.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#include "nrfx_gppi_nrf54h_global.h" +#include "nrfx_gppi_sd2ppi_global.h" #include static nrfx_atomic_t channels[NRFX_GPPI_NODE_COUNT]; diff --git a/soc/nordic/nrf54h/nrfx_gppi_nrf54h_global.h b/soc/nordic/common/nrfx_gppi_sd2ppi_global.h similarity index 85% rename from soc/nordic/nrf54h/nrfx_gppi_nrf54h_global.h rename to soc/nordic/common/nrfx_gppi_sd2ppi_global.h index 391d2a817c6f..375209ccbe1a 100644 --- a/soc/nordic/nrf54h/nrfx_gppi_nrf54h_global.h +++ b/soc/nordic/common/nrfx_gppi_sd2ppi_global.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef SOC_NORDIC_NRF54H_NRFX_GPPI_NRF54H_GLOBAL_H_ -#define SOC_NORDIC_NRF54H_NRFX_GPPI_NRF54H_GLOBAL_H_ +#ifndef SOC_NORDIC_COMMON_NRFX_GPPI_SD2PPI_GLOBAL_H_ +#define SOC_NORDIC_COMMON_NRFX_GPPI_SD2PPI_GLOBAL_H_ #include #include @@ -37,4 +37,4 @@ const nrfx_gppi_node_t *nrfx_gppi_nodes_get(void); void nrfx_gppi_channel_init(nrfx_gppi_node_id_t node_id, uint32_t ch_mask); void nrfx_gppi_groups_init(nrfx_gppi_node_id_t node_id, uint32_t group_mask); -#endif /* SOC_NORDIC_NRF54H_NRFX_GPPI_NRF54H_GLOBAL_H_ */ +#endif /* SOC_NORDIC_COMMON_NRFX_GPPI_SD2PPI_GLOBAL_H_ */ diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 567bc423c9db..7099e79d2a41 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -7,7 +7,6 @@ endif() if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_CPURAD nrfx_gppi_cpurad.c) - zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_CPUAPP nrfx_gppi_nrf54h_global.c) endif() zephyr_include_directories(.) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index d486d13935ec..95ef4d89b4a5 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -41,6 +41,7 @@ config SOC_NRF54H20_CPUAPP_COMMON select HAS_PM_S2RAM_CUSTOM_MARKING select HAS_POWEROFF select HAS_IRONSIDE_SE_CALL + imply NRFX_GPPI_SD2PPI_GLOBAL config SOC_NRF54H20_CPUAPP select SOC_NRF54H20_CPUAPP_COMMON From 55fcc1bebd2fd55cb9eb8ae9f8b1b6fceb94e9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Thu, 16 Apr 2026 10:29:23 +0200 Subject: [PATCH 3236/3334] [nrf fromtree] soc: nordic: common: gppi: Rework sd2ppi_global setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rework GPPI configuration for SD^2PPI global domain. There can be an SoC which does not have dppic135, dppic136, ppib136 and ppib137 nodes. Add build time conditions to configuration files. Additionally, remove references to APBxx (bus) names which could be confusing as they are not references anywhere else. Use DPPIxxx identification instead. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 3145230f108bef933e6e210ff2fcc1fd0ddf6d64) --- soc/nordic/common/gppi_init.c | 12 + soc/nordic/common/nrfx_gppi_sd2ppi_global.c | 554 ++++++++++++-------- soc/nordic/common/nrfx_gppi_sd2ppi_global.h | 8 +- 3 files changed, 348 insertions(+), 226 deletions(-) diff --git a/soc/nordic/common/gppi_init.c b/soc/nordic/common/gppi_init.c index e38934b83e5d..7abfdf06c9e6 100644 --- a/soc/nordic/common/gppi_init.c +++ b/soc/nordic/common/gppi_init.c @@ -67,10 +67,14 @@ static int gppi_init(void) BIT_MASK(DT_PROP(DT_NODELABEL(dppic133), channels))); nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC134, BIT_MASK(DT_PROP(DT_NODELABEL(dppic134), channels))); +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC135, BIT_MASK(DT_PROP(DT_NODELABEL(dppic135), channels))); +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC136, BIT_MASK(DT_PROP(DT_NODELABEL(dppic136), channels))); +#endif nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC120, BIT_MASK(DT_PROP(DT_NODELABEL(dppic120), channels))); @@ -85,10 +89,14 @@ static int gppi_init(void) BIT_MASK(DT_PROP(DT_NODELABEL(dppic133), groups))); nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC134, BIT_MASK(DT_PROP(DT_NODELABEL(dppic134), groups))); +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC135, BIT_MASK(DT_PROP(DT_NODELABEL(dppic135), groups))); +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC136, BIT_MASK(DT_PROP(DT_NODELABEL(dppic136), groups))); +#endif nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC120, BIT_MASK(DT_PROP(DT_NODELABEL(dppic120), groups))); @@ -101,10 +109,14 @@ static int gppi_init(void) BIT_MASK(DT_PROP(DT_NODELABEL(ppib134), channels))); nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB130_135, BIT_MASK(DT_PROP(DT_NODELABEL(ppib135), channels))); +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB131_136, BIT_MASK(DT_PROP(DT_NODELABEL(ppib136), channels))); +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB131_137, BIT_MASK(DT_PROP(DT_NODELABEL(ppib137), channels))); +#endif nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB131_121, BIT_MASK(DT_PROP(DT_NODELABEL(ppib121), channels))); #elif defined(CONFIG_SOC_NRF54H20_CPURAD) diff --git a/soc/nordic/common/nrfx_gppi_sd2ppi_global.c b/soc/nordic/common/nrfx_gppi_sd2ppi_global.c index e1e37eac5b04..501651f5a831 100644 --- a/soc/nordic/common/nrfx_gppi_sd2ppi_global.c +++ b/soc/nordic/common/nrfx_gppi_sd2ppi_global.c @@ -14,249 +14,359 @@ static size_t write_entries_count; #define PPIB_REG(id) (NRF_PPIB_Type *)DT_REG_ADDR(DT_NODELABEL(ppib##id)) #define PPIB_OFF(id) DT_PROP_OR(DT_NODELABEL(ppib##id), offset, 0) -#define NRFX_GPPI_PPIB_EXT_NODE_DEFINE(_id1, _id2) \ -[NRFX_GPPI_NODE_PPIB##_id1##_##_id2] = { \ - .type = NRFX_GPPI_NODE_PPIB, \ - .domain_id = NRFX_GPPI_NODE_PPIB##_id1##_##_id2, \ - .ch_off = {PPIB_OFF(_id2), 0}, \ - .ppib = { \ - .p_channels = &channels[NRFX_GPPI_NODE_PPIB##_id1##_##_id2],\ - .p_reg = {PPIB_REG(_id1), PPIB_REG(_id2)} \ - } \ +#define _NRFX_GPPI_PPIB_EXT_NODE_DEFINE(_id1, _id2) \ + [NRFX_GPPI_NODE_PPIB##_id1##_##_id2] = { \ + .type = NRFX_GPPI_NODE_PPIB, \ + .domain_id = NRFX_GPPI_NODE_PPIB##_id1##_##_id2, \ + .ch_off = { PPIB_OFF(_id2), 0 }, \ + .ppib = { \ + .p_channels = &channels[NRFX_GPPI_NODE_PPIB##_id1##_##_id2], \ + .p_reg = { PPIB_REG(_id1), PPIB_REG(_id2) } \ + } \ } +/** @brief Conditionally create PPIB node. + * + * Node is created if both ppib nodes exist. If node exists then comma is added so macro should not + * be followed by the comma. + * + * @param _id1 PPIB node ID. + * @param _id2 PPIB node ID. + */ +#define NRFX_GPPI_PPIB_EXT_NODE_DEFINE(_id1, _id2) \ + IF_ENABLED(UTIL_AND(DT_NODE_EXISTS(DT_NODELABEL(ppib##_id1)), \ + DT_NODE_EXISTS(DT_NODELABEL(ppib##_id2))), \ + (_NRFX_GPPI_PPIB_EXT_NODE_DEFINE(_id1, _id2),)) + +/** @brief Conditionally create DPPI node. + * + * Node is created if dppic node exists. If node exists then comma is added so macro should not be + * followed by the comma. + */ +#define DPPI_NODE_DEFINE(_node_id) \ + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic##_node_id)), \ + (NRFX_GPPI_DPPI_NODE_DEFINE(_node_id, NRFX_GPPI_NODE_DPPIC##_node_id),)) + static const nrfx_gppi_node_t nodes[] = { - NRFX_GPPI_DPPI_NODE_DEFINE(130, NRFX_GPPI_NODE_DPPIC130), - NRFX_GPPI_DPPI_NODE_DEFINE(131, NRFX_GPPI_NODE_DPPIC131), - NRFX_GPPI_DPPI_NODE_DEFINE(132, NRFX_GPPI_NODE_DPPIC132), - NRFX_GPPI_DPPI_NODE_DEFINE(133, NRFX_GPPI_NODE_DPPIC133), - NRFX_GPPI_DPPI_NODE_DEFINE(134, NRFX_GPPI_NODE_DPPIC134), - NRFX_GPPI_DPPI_NODE_DEFINE(135, NRFX_GPPI_NODE_DPPIC135), - NRFX_GPPI_DPPI_NODE_DEFINE(136, NRFX_GPPI_NODE_DPPIC136), - NRFX_GPPI_DPPI_NODE_DEFINE(120, NRFX_GPPI_NODE_DPPIC120), - NRFX_GPPI_PPIB_EXT_NODE_DEFINE(130, 132), - NRFX_GPPI_PPIB_EXT_NODE_DEFINE(130, 133), - NRFX_GPPI_PPIB_EXT_NODE_DEFINE(130, 134), - NRFX_GPPI_PPIB_EXT_NODE_DEFINE(130, 135), - NRFX_GPPI_PPIB_EXT_NODE_DEFINE(131, 136), - NRFX_GPPI_PPIB_EXT_NODE_DEFINE(131, 137), - NRFX_GPPI_PPIB_EXT_NODE_DEFINE(131, 121), + /* DPPI nodes */ + DPPI_NODE_DEFINE(130) + DPPI_NODE_DEFINE(131) + DPPI_NODE_DEFINE(132) + DPPI_NODE_DEFINE(133) + DPPI_NODE_DEFINE(134) + DPPI_NODE_DEFINE(135) + DPPI_NODE_DEFINE(136) + DPPI_NODE_DEFINE(120) + + /* PPIB nodes */ + NRFX_GPPI_PPIB_EXT_NODE_DEFINE(130, 132) + NRFX_GPPI_PPIB_EXT_NODE_DEFINE(130, 133) + NRFX_GPPI_PPIB_EXT_NODE_DEFINE(130, 134) + NRFX_GPPI_PPIB_EXT_NODE_DEFINE(130, 135) + NRFX_GPPI_PPIB_EXT_NODE_DEFINE(131, 136) + NRFX_GPPI_PPIB_EXT_NODE_DEFINE(131, 137) + NRFX_GPPI_PPIB_EXT_NODE_DEFINE(131, 121) +}; + +enum nrfx_gppi_route_id { + NRFX_GPPI_ROUTE_ID_130, + NRFX_GPPI_ROUTE_ID_131, + NRFX_GPPI_ROUTE_ID_132, + NRFX_GPPI_ROUTE_ID_133, + NRFX_GPPI_ROUTE_ID_134, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_ROUTE_ID_135,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_ROUTE_ID_136,)) + NRFX_GPPI_ROUTE_ID_120, + NRFX_GPPI_ROUTE_ID_130_131, + NRFX_GPPI_ROUTE_ID_130_132, + NRFX_GPPI_ROUTE_ID_130_133, + NRFX_GPPI_ROUTE_ID_130_134, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_ROUTE_ID_130_135,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_ROUTE_ID_130_136,)) + NRFX_GPPI_ROUTE_ID_130_120, + NRFX_GPPI_ROUTE_ID_131_132, + NRFX_GPPI_ROUTE_ID_131_133, + NRFX_GPPI_ROUTE_ID_131_134, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_ROUTE_ID_131_135,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_ROUTE_ID_131_136,)) + NRFX_GPPI_ROUTE_ID_131_120, + NRFX_GPPI_ROUTE_ID_132_133, + NRFX_GPPI_ROUTE_ID_132_134, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_ROUTE_ID_132_135,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_ROUTE_ID_132_136,)) + NRFX_GPPI_ROUTE_ID_132_120, + NRFX_GPPI_ROUTE_ID_133_134, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_ROUTE_ID_133_135,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_ROUTE_ID_133_136,)) + NRFX_GPPI_ROUTE_ID_133_120, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_ROUTE_ID_134_135,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_ROUTE_ID_134_136,)) + NRFX_GPPI_ROUTE_ID_134_120, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_ROUTE_ID_135_136,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_ROUTE_ID_135_120,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_ROUTE_ID_136_120,)) + NRFX_GPPI_ROUTE_ID_COUNT, }; static const nrfx_gppi_route_t routes[] = { - /* 0 */NRFX_GPPI_ROUTE_DEFINE("apb32", - (&nodes[NRFX_GPPI_NODE_DPPIC130])), - /* 1 */NRFX_GPPI_ROUTE_DEFINE("apb38", - (&nodes[NRFX_GPPI_NODE_DPPIC131])), - /* 2 */NRFX_GPPI_ROUTE_DEFINE("apb39", - (&nodes[NRFX_GPPI_NODE_DPPIC132])), - /* 3 */NRFX_GPPI_ROUTE_DEFINE("apb3a", - (&nodes[NRFX_GPPI_NODE_DPPIC133])), - /* 4 */NRFX_GPPI_ROUTE_DEFINE("apb3b", - (&nodes[NRFX_GPPI_NODE_DPPIC134])), - /* 5 */NRFX_GPPI_ROUTE_DEFINE("apb3c", - (&nodes[NRFX_GPPI_NODE_DPPIC135])), - /* 6 */NRFX_GPPI_ROUTE_DEFINE("apb3d", - (&nodes[NRFX_GPPI_NODE_DPPIC136])), - /* 7 */NRFX_GPPI_ROUTE_DEFINE("apb22", - (&nodes[NRFX_GPPI_NODE_DPPIC120])), - - /* 8 */NRFX_GPPI_ROUTE_DEFINE("apb32_apb38", - (&nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_132], - &nodes[NRFX_GPPI_NODE_DPPIC131])), - /* 9 */NRFX_GPPI_ROUTE_DEFINE("apb32_apb39", - (&nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_133], - &nodes[NRFX_GPPI_NODE_DPPIC132])), - /* 10 */NRFX_GPPI_ROUTE_DEFINE("apb32_apb3a", - (&nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_134], - &nodes[NRFX_GPPI_NODE_DPPIC133])), - /* 11 */NRFX_GPPI_ROUTE_DEFINE("apb32_apb3b", - (&nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_135], - &nodes[NRFX_GPPI_NODE_DPPIC134])), - /* 12 */NRFX_GPPI_ROUTE_DEFINE("apb32_apb3c", - (&nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_136], - &nodes[NRFX_GPPI_NODE_DPPIC135])), - /* 13 */NRFX_GPPI_ROUTE_DEFINE("apb32_apb3d", - (&nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_137], - &nodes[NRFX_GPPI_NODE_DPPIC136])), - /* 14 */NRFX_GPPI_ROUTE_DEFINE("apb32_apb22", - (&nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_121], - &nodes[NRFX_GPPI_NODE_DPPIC120])), - - /* 15 */NRFX_GPPI_ROUTE_DEFINE("apb38_apb39", - (&nodes[NRFX_GPPI_NODE_DPPIC131], - &nodes[NRFX_GPPI_NODE_PPIB130_132], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_133], - &nodes[NRFX_GPPI_NODE_DPPIC132])), - /* 16 */NRFX_GPPI_ROUTE_DEFINE("apb38_apb3a", - (&nodes[NRFX_GPPI_NODE_DPPIC131], - &nodes[NRFX_GPPI_NODE_PPIB130_132], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_134], - &nodes[NRFX_GPPI_NODE_DPPIC133])), - /* 17 */NRFX_GPPI_ROUTE_DEFINE("apb38_apb3b", - (&nodes[NRFX_GPPI_NODE_DPPIC131], - &nodes[NRFX_GPPI_NODE_PPIB130_132], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_135], - &nodes[NRFX_GPPI_NODE_DPPIC134])), - /* 18 */NRFX_GPPI_ROUTE_DEFINE("apb38_apb3c", - (&nodes[NRFX_GPPI_NODE_DPPIC131], - &nodes[NRFX_GPPI_NODE_PPIB130_132], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_136], - &nodes[NRFX_GPPI_NODE_DPPIC135])), - /* 19 */NRFX_GPPI_ROUTE_DEFINE("apb38_apb3d", - (&nodes[NRFX_GPPI_NODE_DPPIC131], - &nodes[NRFX_GPPI_NODE_PPIB130_132], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_137], - &nodes[NRFX_GPPI_NODE_DPPIC136])), - /* 20 */NRFX_GPPI_ROUTE_DEFINE("apb38_apb22", - (&nodes[NRFX_GPPI_NODE_DPPIC131], - &nodes[NRFX_GPPI_NODE_PPIB130_132], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_121], - &nodes[NRFX_GPPI_NODE_DPPIC120])), - - /* 21 */NRFX_GPPI_ROUTE_DEFINE("apb39_apb3a", - (&nodes[NRFX_GPPI_NODE_DPPIC132], - &nodes[NRFX_GPPI_NODE_PPIB130_133], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_134], - &nodes[NRFX_GPPI_NODE_DPPIC133])), - /* 22 */NRFX_GPPI_ROUTE_DEFINE("apb39_apb3b", - (&nodes[NRFX_GPPI_NODE_DPPIC132], - &nodes[NRFX_GPPI_NODE_PPIB130_133], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_135], - &nodes[NRFX_GPPI_NODE_DPPIC134])), - /* 23 */NRFX_GPPI_ROUTE_DEFINE("apb39_apb3c", - (&nodes[NRFX_GPPI_NODE_DPPIC132], - &nodes[NRFX_GPPI_NODE_PPIB130_133], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_136], - &nodes[NRFX_GPPI_NODE_DPPIC135])), - /* 24 */NRFX_GPPI_ROUTE_DEFINE("apb39_apb3d", - (&nodes[NRFX_GPPI_NODE_DPPIC132], - &nodes[NRFX_GPPI_NODE_PPIB130_133], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_137], - &nodes[NRFX_GPPI_NODE_DPPIC136])), - /* 25 */NRFX_GPPI_ROUTE_DEFINE("apb39_apb22", - (&nodes[NRFX_GPPI_NODE_DPPIC132], - &nodes[NRFX_GPPI_NODE_PPIB130_133], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_121], - &nodes[NRFX_GPPI_NODE_DPPIC120])), - - /* 26 */NRFX_GPPI_ROUTE_DEFINE("apb3a_apb3b", - (&nodes[NRFX_GPPI_NODE_DPPIC133], - &nodes[NRFX_GPPI_NODE_PPIB130_134], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB130_135], - &nodes[NRFX_GPPI_NODE_DPPIC134])), - /* 27 */NRFX_GPPI_ROUTE_DEFINE("apb3a_apb3c", - (&nodes[NRFX_GPPI_NODE_DPPIC133], - &nodes[NRFX_GPPI_NODE_PPIB130_134], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_136], - &nodes[NRFX_GPPI_NODE_DPPIC135])), - /* 28 */NRFX_GPPI_ROUTE_DEFINE("apb3a_apb3d", - (&nodes[NRFX_GPPI_NODE_DPPIC133], - &nodes[NRFX_GPPI_NODE_PPIB130_134], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_137], - &nodes[NRFX_GPPI_NODE_DPPIC136])), - /* 29 */NRFX_GPPI_ROUTE_DEFINE("apb3a_apb22", - (&nodes[NRFX_GPPI_NODE_DPPIC133], - &nodes[NRFX_GPPI_NODE_PPIB130_134], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_121], - &nodes[NRFX_GPPI_NODE_DPPIC120])), - - /* 30 */NRFX_GPPI_ROUTE_DEFINE("apb3b_apb3c", - (&nodes[NRFX_GPPI_NODE_DPPIC134], - &nodes[NRFX_GPPI_NODE_PPIB130_135], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_136], - &nodes[NRFX_GPPI_NODE_DPPIC135])), - /* 31 */NRFX_GPPI_ROUTE_DEFINE("apb3b_apb3d", - (&nodes[NRFX_GPPI_NODE_DPPIC134], - &nodes[NRFX_GPPI_NODE_PPIB130_135], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_137], - &nodes[NRFX_GPPI_NODE_DPPIC136])), - /* 32 */NRFX_GPPI_ROUTE_DEFINE("apb22_apb3b", - (&nodes[NRFX_GPPI_NODE_DPPIC134], - &nodes[NRFX_GPPI_NODE_PPIB130_135], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_121], - &nodes[NRFX_GPPI_NODE_DPPIC120])), - - /* 33 */NRFX_GPPI_ROUTE_DEFINE("apb3c_apb3d", - (&nodes[NRFX_GPPI_NODE_DPPIC135], - &nodes[NRFX_GPPI_NODE_PPIB131_136], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_137], - &nodes[NRFX_GPPI_NODE_DPPIC136])), - /* 34 */NRFX_GPPI_ROUTE_DEFINE("apb3c_apb22", - (&nodes[NRFX_GPPI_NODE_DPPIC135], - &nodes[NRFX_GPPI_NODE_PPIB131_136], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_121], - &nodes[NRFX_GPPI_NODE_DPPIC120])), - - /* 35 */NRFX_GPPI_ROUTE_DEFINE("apb3d_apb22", - (&nodes[NRFX_GPPI_NODE_DPPIC136], - &nodes[NRFX_GPPI_NODE_PPIB131_137], - &nodes[NRFX_GPPI_NODE_DPPIC130], - &nodes[NRFX_GPPI_NODE_PPIB131_121], - &nodes[NRFX_GPPI_NODE_DPPIC120])), + [NRFX_GPPI_ROUTE_ID_130] = + NRFX_GPPI_ROUTE_DEFINE("dppi130", (&nodes[NRFX_GPPI_NODE_DPPIC130])), + [NRFX_GPPI_ROUTE_ID_131] = + NRFX_GPPI_ROUTE_DEFINE("dppi131", (&nodes[NRFX_GPPI_NODE_DPPIC131])), + [NRFX_GPPI_ROUTE_ID_132] = + NRFX_GPPI_ROUTE_DEFINE("dppi132", (&nodes[NRFX_GPPI_NODE_DPPIC132])), + [NRFX_GPPI_ROUTE_ID_133] = + NRFX_GPPI_ROUTE_DEFINE("dppi133", (&nodes[NRFX_GPPI_NODE_DPPIC133])), + [NRFX_GPPI_ROUTE_ID_134] = + NRFX_GPPI_ROUTE_DEFINE("dppi134", (&nodes[NRFX_GPPI_NODE_DPPIC134])), +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) + [NRFX_GPPI_ROUTE_ID_135] = + NRFX_GPPI_ROUTE_DEFINE("dppi135", (&nodes[NRFX_GPPI_NODE_DPPIC135])), +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) + [NRFX_GPPI_ROUTE_ID_136] = + NRFX_GPPI_ROUTE_DEFINE("dppi136", (&nodes[NRFX_GPPI_NODE_DPPIC136])), +#endif + [NRFX_GPPI_ROUTE_ID_120] = + NRFX_GPPI_ROUTE_DEFINE("dppi120", (&nodes[NRFX_GPPI_NODE_DPPIC120])), + [NRFX_GPPI_ROUTE_ID_130_131] = + NRFX_GPPI_ROUTE_DEFINE("dppi130_dppi131", (&nodes[NRFX_GPPI_NODE_DPPIC130], + &nodes[NRFX_GPPI_NODE_PPIB130_132], + &nodes[NRFX_GPPI_NODE_DPPIC131])), + [NRFX_GPPI_ROUTE_ID_130_132] = + NRFX_GPPI_ROUTE_DEFINE("dppi130_dppi132", (&nodes[NRFX_GPPI_NODE_DPPIC130], + &nodes[NRFX_GPPI_NODE_PPIB130_133], + &nodes[NRFX_GPPI_NODE_DPPIC132])), + [NRFX_GPPI_ROUTE_ID_130_133] = + NRFX_GPPI_ROUTE_DEFINE("dppi130_dppi133", (&nodes[NRFX_GPPI_NODE_DPPIC130], + &nodes[NRFX_GPPI_NODE_PPIB130_134], + &nodes[NRFX_GPPI_NODE_DPPIC133])), + [NRFX_GPPI_ROUTE_ID_130_134] = + NRFX_GPPI_ROUTE_DEFINE("dppi130_dppi134", (&nodes[NRFX_GPPI_NODE_DPPIC130], + &nodes[NRFX_GPPI_NODE_PPIB130_135], + &nodes[NRFX_GPPI_NODE_DPPIC134])), +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) + [NRFX_GPPI_ROUTE_ID_130_135] = + NRFX_GPPI_ROUTE_DEFINE("dppi130_dppi135", (&nodes[NRFX_GPPI_NODE_DPPIC130], + &nodes[NRFX_GPPI_NODE_PPIB131_136], + &nodes[NRFX_GPPI_NODE_DPPIC135])), +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) + [NRFX_GPPI_ROUTE_ID_130_136] = + NRFX_GPPI_ROUTE_DEFINE("dppi130_dppi136", (&nodes[NRFX_GPPI_NODE_DPPIC130], + &nodes[NRFX_GPPI_NODE_PPIB131_137], + &nodes[NRFX_GPPI_NODE_DPPIC136])), +#endif + [NRFX_GPPI_ROUTE_ID_130_120] = + NRFX_GPPI_ROUTE_DEFINE("dppi130_dppi120", (&nodes[NRFX_GPPI_NODE_DPPIC130], + &nodes[NRFX_GPPI_NODE_PPIB131_121], + &nodes[NRFX_GPPI_NODE_DPPIC120])), + + [NRFX_GPPI_ROUTE_ID_131_132] = NRFX_GPPI_ROUTE_DEFINE( + "dppi131_dppi132", + (&nodes[NRFX_GPPI_NODE_DPPIC131], &nodes[NRFX_GPPI_NODE_PPIB130_132], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB130_133], + &nodes[NRFX_GPPI_NODE_DPPIC132])), + [NRFX_GPPI_ROUTE_ID_131_133] = NRFX_GPPI_ROUTE_DEFINE( + "dppi131_dppi133", + (&nodes[NRFX_GPPI_NODE_DPPIC131], &nodes[NRFX_GPPI_NODE_PPIB130_132], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB130_134], + &nodes[NRFX_GPPI_NODE_DPPIC133])), + [NRFX_GPPI_ROUTE_ID_131_134] = NRFX_GPPI_ROUTE_DEFINE( + "dppi131_dppi134", + (&nodes[NRFX_GPPI_NODE_DPPIC131], &nodes[NRFX_GPPI_NODE_PPIB130_132], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB130_135], + &nodes[NRFX_GPPI_NODE_DPPIC134])), +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) + [NRFX_GPPI_ROUTE_ID_131_135] = NRFX_GPPI_ROUTE_DEFINE( + "dppi131_dppi135", + (&nodes[NRFX_GPPI_NODE_DPPIC131], &nodes[NRFX_GPPI_NODE_PPIB130_132], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_136], + &nodes[NRFX_GPPI_NODE_DPPIC135])), +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) + [NRFX_GPPI_ROUTE_ID_131_136] = NRFX_GPPI_ROUTE_DEFINE( + "dppi131_dppi136", + (&nodes[NRFX_GPPI_NODE_DPPIC131], &nodes[NRFX_GPPI_NODE_PPIB130_132], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_137], + &nodes[NRFX_GPPI_NODE_DPPIC136])), +#endif + [NRFX_GPPI_ROUTE_ID_131_120] = NRFX_GPPI_ROUTE_DEFINE( + "dppi131_dppi120", + (&nodes[NRFX_GPPI_NODE_DPPIC131], &nodes[NRFX_GPPI_NODE_PPIB130_132], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_121], + &nodes[NRFX_GPPI_NODE_DPPIC120])), + + [NRFX_GPPI_ROUTE_ID_132_133] = NRFX_GPPI_ROUTE_DEFINE( + "dppi132_dppi133", + (&nodes[NRFX_GPPI_NODE_DPPIC132], &nodes[NRFX_GPPI_NODE_PPIB130_133], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB130_134], + &nodes[NRFX_GPPI_NODE_DPPIC133])), + [NRFX_GPPI_ROUTE_ID_132_134] = NRFX_GPPI_ROUTE_DEFINE( + "dppi132_dppi134", + (&nodes[NRFX_GPPI_NODE_DPPIC132], &nodes[NRFX_GPPI_NODE_PPIB130_133], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB130_135], + &nodes[NRFX_GPPI_NODE_DPPIC134])), +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) + [NRFX_GPPI_ROUTE_ID_132_135] = NRFX_GPPI_ROUTE_DEFINE( + "dppi132_dppi135", + (&nodes[NRFX_GPPI_NODE_DPPIC132], &nodes[NRFX_GPPI_NODE_PPIB130_133], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_136], + &nodes[NRFX_GPPI_NODE_DPPIC135])), +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) + [NRFX_GPPI_ROUTE_ID_132_136] = NRFX_GPPI_ROUTE_DEFINE( + "dppi132_dppi136", + (&nodes[NRFX_GPPI_NODE_DPPIC132], &nodes[NRFX_GPPI_NODE_PPIB130_133], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_137], + &nodes[NRFX_GPPI_NODE_DPPIC136])), +#endif + [NRFX_GPPI_ROUTE_ID_132_120] = NRFX_GPPI_ROUTE_DEFINE( + "dppi132_dppi120", + (&nodes[NRFX_GPPI_NODE_DPPIC132], &nodes[NRFX_GPPI_NODE_PPIB130_133], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_121], + &nodes[NRFX_GPPI_NODE_DPPIC120])), + + [NRFX_GPPI_ROUTE_ID_133_134] = NRFX_GPPI_ROUTE_DEFINE( + "dppi133_dppi134", + (&nodes[NRFX_GPPI_NODE_DPPIC133], &nodes[NRFX_GPPI_NODE_PPIB130_134], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB130_135], + &nodes[NRFX_GPPI_NODE_DPPIC134])), +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) + [NRFX_GPPI_ROUTE_ID_133_135] = NRFX_GPPI_ROUTE_DEFINE( + "dppi133_dppi135", + (&nodes[NRFX_GPPI_NODE_DPPIC133], &nodes[NRFX_GPPI_NODE_PPIB130_134], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_136], + &nodes[NRFX_GPPI_NODE_DPPIC135])), +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) + [NRFX_GPPI_ROUTE_ID_133_136] = NRFX_GPPI_ROUTE_DEFINE( + "dppi133_dppi136", + (&nodes[NRFX_GPPI_NODE_DPPIC133], &nodes[NRFX_GPPI_NODE_PPIB130_134], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_137], + &nodes[NRFX_GPPI_NODE_DPPIC136])), +#endif + [NRFX_GPPI_ROUTE_ID_133_120] = NRFX_GPPI_ROUTE_DEFINE( + "dppi133_dppi120", + (&nodes[NRFX_GPPI_NODE_DPPIC133], &nodes[NRFX_GPPI_NODE_PPIB130_134], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_121], + &nodes[NRFX_GPPI_NODE_DPPIC120])), +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) + [NRFX_GPPI_ROUTE_ID_134_135] = NRFX_GPPI_ROUTE_DEFINE( + "dppi134_dppi135", + (&nodes[NRFX_GPPI_NODE_DPPIC134], &nodes[NRFX_GPPI_NODE_PPIB130_135], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_136], + &nodes[NRFX_GPPI_NODE_DPPIC135])), +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) + [NRFX_GPPI_ROUTE_ID_134_136] = NRFX_GPPI_ROUTE_DEFINE( + "dppi134_dppi136", + (&nodes[NRFX_GPPI_NODE_DPPIC134], &nodes[NRFX_GPPI_NODE_PPIB130_135], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_137], + &nodes[NRFX_GPPI_NODE_DPPIC136])), +#endif + [NRFX_GPPI_ROUTE_ID_134_120] = NRFX_GPPI_ROUTE_DEFINE( + "dppi134_dppi120", + (&nodes[NRFX_GPPI_NODE_DPPIC134], &nodes[NRFX_GPPI_NODE_PPIB130_135], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_121], + &nodes[NRFX_GPPI_NODE_DPPIC120])), + +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) + [NRFX_GPPI_ROUTE_ID_135_136] = NRFX_GPPI_ROUTE_DEFINE( + "dppi135_dppi136", + (&nodes[NRFX_GPPI_NODE_DPPIC135], &nodes[NRFX_GPPI_NODE_PPIB131_136], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_137], + &nodes[NRFX_GPPI_NODE_DPPIC136])), +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) + [NRFX_GPPI_ROUTE_ID_135_120] = NRFX_GPPI_ROUTE_DEFINE( + "dppi135_dppi120", + (&nodes[NRFX_GPPI_NODE_DPPIC135], &nodes[NRFX_GPPI_NODE_PPIB131_136], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_121], + &nodes[NRFX_GPPI_NODE_DPPIC120])), +#endif +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) + [NRFX_GPPI_ROUTE_ID_136_120] = NRFX_GPPI_ROUTE_DEFINE( + "dppi136_dppi120", + (&nodes[NRFX_GPPI_NODE_DPPIC136], &nodes[NRFX_GPPI_NODE_PPIB131_137], + &nodes[NRFX_GPPI_NODE_DPPIC130], &nodes[NRFX_GPPI_NODE_PPIB131_121], + &nodes[NRFX_GPPI_NODE_DPPIC120])), +#endif }; -static const nrfx_gppi_route_t *apb32_routes[] = { - &routes[0], &routes[8], &routes[9], &routes[10], &routes[11], - &routes[12], &routes[13], &routes[14] +static const nrfx_gppi_route_t *dppi130_routes[] = { + &routes[NRFX_GPPI_ROUTE_ID_130], + &routes[NRFX_GPPI_ROUTE_ID_130_131], + &routes[NRFX_GPPI_ROUTE_ID_130_132], + &routes[NRFX_GPPI_ROUTE_ID_130_133], + &routes[NRFX_GPPI_ROUTE_ID_130_134], + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (&routes[NRFX_GPPI_ROUTE_ID_130_135],)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (&routes[NRFX_GPPI_ROUTE_ID_130_136],)) + &routes[NRFX_GPPI_ROUTE_ID_130_120] }; -static const nrfx_gppi_route_t *apb38_routes[] = { - &routes[1], &routes[15], &routes[16], &routes[17], &routes[18], &routes[19], &routes[20] + +static const nrfx_gppi_route_t *dppi131_routes[] = { + &routes[NRFX_GPPI_ROUTE_ID_131], + &routes[NRFX_GPPI_ROUTE_ID_131_132], + &routes[NRFX_GPPI_ROUTE_ID_131_133], + &routes[NRFX_GPPI_ROUTE_ID_131_134], + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (&routes[NRFX_GPPI_ROUTE_ID_131_135],)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (&routes[NRFX_GPPI_ROUTE_ID_131_136],)) + &routes[NRFX_GPPI_ROUTE_ID_131_120] }; -static const nrfx_gppi_route_t *apb39_routes[] = { - &routes[2], &routes[21], &routes[22], &routes[23], &routes[24], &routes[25] + +static const nrfx_gppi_route_t *dppi132_routes[] = { + &routes[NRFX_GPPI_ROUTE_ID_132], + &routes[NRFX_GPPI_ROUTE_ID_132_133], + &routes[NRFX_GPPI_ROUTE_ID_132_134], + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (&routes[NRFX_GPPI_ROUTE_ID_132_135],)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (&routes[NRFX_GPPI_ROUTE_ID_132_136],)) + &routes[NRFX_GPPI_ROUTE_ID_132_120] }; -static const nrfx_gppi_route_t *apb3a_routes[] = { - &routes[3], &routes[26], &routes[27], &routes[28], &routes[29] +static const nrfx_gppi_route_t *dppi133_routes[] = { + &routes[NRFX_GPPI_ROUTE_ID_133], + &routes[NRFX_GPPI_ROUTE_ID_133_134], + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (&routes[NRFX_GPPI_ROUTE_ID_133_135],)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (&routes[NRFX_GPPI_ROUTE_ID_133_136],)) + &routes[NRFX_GPPI_ROUTE_ID_133_120] }; -static const nrfx_gppi_route_t *apb3b_routes[] = { - &routes[4], &routes[30], &routes[31], &routes[32] +static const nrfx_gppi_route_t *dppi134_routes[] = { + &routes[NRFX_GPPI_ROUTE_ID_134], + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (&routes[NRFX_GPPI_ROUTE_ID_134_135],)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (&routes[NRFX_GPPI_ROUTE_ID_134_136],)) + &routes[NRFX_GPPI_ROUTE_ID_134_120] }; -static const nrfx_gppi_route_t *apb3c_routes[] = { - &routes[5], &routes[33], &routes[34] +#if DT_NODE_EXISTS(DT_NODELABEL(dppic135)) +static const nrfx_gppi_route_t *dppi135_routes[] = { + &routes[NRFX_GPPI_ROUTE_ID_135], + &routes[NRFX_GPPI_ROUTE_ID_135_136], + &routes[NRFX_GPPI_ROUTE_ID_135_120] }; +#endif -static const nrfx_gppi_route_t *apb3d_routes[] = { - &routes[6], &routes[35] +#if DT_NODE_EXISTS(DT_NODELABEL(dppic136)) +static const nrfx_gppi_route_t *dppi136_routes[] = { + &routes[NRFX_GPPI_ROUTE_ID_136], + &routes[NRFX_GPPI_ROUTE_ID_136_120] }; +#endif -static const nrfx_gppi_route_t *apb22_routes[] = { - &routes[7] +static const nrfx_gppi_route_t *dppi120_routes[] = { + &routes[NRFX_GPPI_ROUTE_ID_120] }; static const nrfx_gppi_route_t **dppi_route_map[] = { - apb32_routes, apb38_routes, apb39_routes, apb3a_routes, - apb3b_routes, apb3c_routes, apb3d_routes, apb22_routes + dppi130_routes, + dppi131_routes, + dppi132_routes, + dppi133_routes, + dppi134_routes, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (dppi135_routes,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (dppi136_routes,)) + dppi120_routes }; uint32_t nrfx_gppi_domain_id_get(uint32_t addr) @@ -310,8 +420,8 @@ static int actual_channel_mask(nrfx_gppi_node_id_t node_id, uint32_t *ch_mask, b NRF_SPU133, NRF_SPU134, NRF_SPU135, - NRF_SPU136, - NRF_SPU137, + IF_ENABLED(NRFX_INSTANCE_PRESENT(SPU136), (NRF_SPU136,)) + IF_ENABLED(NRFX_INSTANCE_PRESENT(SPU137), (NRF_SPU137,)) NRF_SPU122, }; uint32_t out_mask = 0; diff --git a/soc/nordic/common/nrfx_gppi_sd2ppi_global.h b/soc/nordic/common/nrfx_gppi_sd2ppi_global.h index 375209ccbe1a..b55ad58c805c 100644 --- a/soc/nordic/common/nrfx_gppi_sd2ppi_global.h +++ b/soc/nordic/common/nrfx_gppi_sd2ppi_global.h @@ -16,8 +16,8 @@ typedef enum { NRFX_GPPI_NODE_DPPIC132, NRFX_GPPI_NODE_DPPIC133, NRFX_GPPI_NODE_DPPIC134, - NRFX_GPPI_NODE_DPPIC135, - NRFX_GPPI_NODE_DPPIC136, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_NODE_DPPIC135,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_NODE_DPPIC136,)) NRFX_GPPI_NODE_DPPIC120, NRFX_GPPI_NODE_DPPI_COUNT, @@ -25,8 +25,8 @@ typedef enum { NRFX_GPPI_NODE_PPIB130_133, NRFX_GPPI_NODE_PPIB130_134, NRFX_GPPI_NODE_PPIB130_135, - NRFX_GPPI_NODE_PPIB131_136, - NRFX_GPPI_NODE_PPIB131_137, + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic135)), (NRFX_GPPI_NODE_PPIB131_136,)) + IF_ENABLED(DT_NODE_EXISTS(DT_NODELABEL(dppic136)), (NRFX_GPPI_NODE_PPIB131_137,)) NRFX_GPPI_NODE_PPIB131_121, NRFX_GPPI_NODE_COUNT, } nrfx_gppi_node_id_t; From dc86743c976091c799ab6030c4360e4eb19679d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 20 Apr 2026 11:41:35 +0200 Subject: [PATCH 3237/3334] [nrf fromtree] tests: boards: nrf: gppi: Add pdm0 node as test sink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test is using one of the peripherals as sink for PPI events. So far it supported LPCOMP or ECB on nrf54h20 cpurad. Some SoCs don't have LPCOMP and another peripheral need to be used. Extended test to use PDM in that case. nrf54h20 cpuapp configuration is changed to use PDM instead of LPCOMP. Signed-off-by: Krzysztof Chruściński (cherry picked from commit a4b69c5ba11fcd2eb6f48c7e3e3aea45b761e151) --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 2 +- tests/boards/nrf/gppi/src/main.c | 37 +++++++++++++++++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/tests/boards/nrf/gppi/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/gppi/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 7e59ee37c829..f9d9637019e4 100644 --- a/tests/boards/nrf/gppi/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/boards/nrf/gppi/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -16,6 +16,6 @@ dut_timer2: &timer134 { status = "reserved"; }; -&comp { +&pdm0 { status = "reserved"; }; diff --git a/tests/boards/nrf/gppi/src/main.c b/tests/boards/nrf/gppi/src/main.c index f8af6fbe12ef..5323c4dd6dfc 100644 --- a/tests/boards/nrf/gppi/src/main.c +++ b/tests/boards/nrf/gppi/src/main.c @@ -10,17 +10,46 @@ #include #include #include -#if defined(CONFIG_SOC_NRF54H20_CPURAD) +#include +#if DT_NODE_EXISTS(DT_NODELABEL(pdm0)) && DT_NODE_HAS_STATUS(DT_NODELABEL(pdm0), reserved) +#include +#elif DT_NODE_EXISTS(DT_NODELABEL(comp)) && DT_NODE_HAS_STATUS(DT_NODELABEL(comp), reserved) +#include +#elif defined(CONFIG_SOC_NRF54H20_CPURAD) #include #endif -#include -#include NRF_TIMER_Type *timer0 = (NRF_TIMER_Type *)DT_REG_ADDR(DT_NODELABEL(dut_timer0)); NRF_TIMER_Type *timer1 = (NRF_TIMER_Type *)DT_REG_ADDR(DT_NODELABEL(dut_timer1)); NRF_TIMER_Type *timer2 = (NRF_TIMER_Type *)DT_REG_ADDR(DT_NODELABEL(dut_timer2)); -#if DT_NODE_EXISTS(DT_NODELABEL(comp)) && DT_NODE_HAS_STATUS(DT_NODELABEL(comp), reserved) +#if DT_NODE_EXISTS(DT_NODELABEL(pdm0)) && DT_NODE_HAS_STATUS(DT_NODELABEL(pdm0), reserved) +NRF_PDM_Type *pdm = (NRF_PDM_Type *)DT_REG_ADDR(DT_NODELABEL(pdm0)); + +static void sink_setup(void) +{ + nrf_pdm_task_trigger(pdm, NRF_PDM_TASK_STOP); + nrf_pdm_event_clear(pdm, NRF_PDM_EVENT_STARTED); + nrf_pdm_enable(pdm); +} + +static void sink_cleanup(void) +{ + nrf_pdm_task_trigger(pdm, NRF_PDM_TASK_STOP); + nrf_pdm_disable(pdm); +} + +static bool sink_evt_check(void) +{ + return nrf_pdm_event_check(pdm, NRF_PDM_EVENT_STARTED); +} + +static uint32_t sink_tsk_addr(void) +{ + return nrf_pdm_task_address_get(pdm, NRF_PDM_TASK_START); +} + +#elif DT_NODE_EXISTS(DT_NODELABEL(comp)) && DT_NODE_HAS_STATUS(DT_NODELABEL(comp), reserved) NRF_LPCOMP_Type *lpcomp = (NRF_LPCOMP_Type *)DT_REG_ADDR(DT_NODELABEL(comp)); static void sink_setup(void) From af455c2db9fa71db33ec6619658498671ca8e898 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 7 Apr 2026 14:01:39 +0100 Subject: [PATCH 3238/3334] [nrf fromtree] cmake: modules: zephyr_default: Add init calls Allows calling an init function/macro inside of zephyr module files, this allows for making it easier to reuse/override module CMake code Signed-off-by: Jamie McCrae (cherry picked from commit 526f124f060310dcae10ba6f787178d559a3eea9) --- cmake/modules/zephyr_default.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/modules/zephyr_default.cmake b/cmake/modules/zephyr_default.cmake index 6cf27ebbde2a..fd05a1fb190c 100644 --- a/cmake/modules/zephyr_default.cmake +++ b/cmake/modules/zephyr_default.cmake @@ -128,6 +128,12 @@ foreach(module IN LISTS zephyr_cmake_modules) string(CONFIGURE "${module}" module) include(${module}) + if(NOT "${module}" MATCHES ";") + if(COMMAND ${module}_init) + cmake_language(CALL ${module}_init) + endif() + endif() + list(REMOVE_ITEM SUB_COMPONENTS ${module}) if(DEFINED SUB_COMPONENTS AND NOT SUB_COMPONENTS) # All requested Zephyr CMake modules have been loaded, so let's return. From ed67d87f7c2795147ae5b90b343074a61b94c3ff Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 24 Mar 2026 14:45:47 +0000 Subject: [PATCH 3239/3334] [nrf fromtree] cmake: modules: dts: Rework functions into module Reworks this to use modular code which can be used from other modules Signed-off-by: Jamie McCrae (cherry picked from commit 709e9e47094a939b57996f7e5106569ea25b77dc) --- cmake/modules/dts.cmake | 524 +++++++++++++++++++++------------------- 1 file changed, 278 insertions(+), 246 deletions(-) diff --git a/cmake/modules/dts.cmake b/cmake/modules/dts.cmake index f72bf4b7289f..9141a679035d 100644 --- a/cmake/modules/dts.cmake +++ b/cmake/modules/dts.cmake @@ -127,287 +127,319 @@ set(DTS_KCONFIG ${KCONFIG_BINARY_DIR}/Kconfig.dts) # modules. set(VENDOR_PREFIXES dts/bindings/vendor-prefixes.txt) -# Fetch variable from sysbuild which might be forcing a configuration (for variant build images) -zephyr_get(DTS_SOURCE SYSBUILD LOCAL) +function(dts_configuration_files) + # Fetch variable from sysbuild which might be forcing a configuration (for variant build images) + zephyr_get(DTS_SOURCE SYSBUILD LOCAL) -if(NOT DEFINED DTS_SOURCE) - zephyr_build_string(board_string SHORT shortened_board_string - BOARD ${BOARD} BOARD_QUALIFIERS ${BOARD_QUALIFIERS} - ) - foreach(dir ${BOARD_DIRECTORIES}) - if(EXISTS ${dir}/${shortened_board_string}.dts AND NOT BOARD_${BOARD}_SINGLE_SOC) - message(FATAL_ERROR "Board ${ZFILE_BOARD} defines multiple SoCs.\nShortened file name " - "(${shortened_board_string}.dts) not allowed, use '_.dts' naming" - ) + if(NOT DEFINED DTS_SOURCE) + zephyr_build_string(board_string SHORT shortened_board_string + BOARD ${BOARD} BOARD_QUALIFIERS ${BOARD_QUALIFIERS} + ) + foreach(dir ${BOARD_DIRECTORIES}) + if(EXISTS ${dir}/${shortened_board_string}.dts AND NOT BOARD_${BOARD}_SINGLE_SOC) + message(FATAL_ERROR "Board ${ZFILE_BOARD} defines multiple SoCs.\nShortened file name " + "(${shortened_board_string}.dts) not allowed, use '_.dts' naming" + ) elseif(EXISTS ${dir}/${board_string}.dts AND EXISTS ${dir}/${shortened_board_string}.dts) - message(FATAL_ERROR "Conflicting file names discovered. Cannot use both " - "${board_string}.dts and ${shortened_board_string}.dts. " - "Please choose one naming style, ${board_string}.dts is recommended." - ) - elseif(EXISTS ${dir}/${board_string}.dts) - set(DTS_SOURCE ${dir}/${board_string}.dts) - elseif(EXISTS ${dir}/${shortened_board_string}.dts) - set(DTS_SOURCE ${dir}/${shortened_board_string}.dts) - endif() - endforeach() -endif() + message(FATAL_ERROR "Conflicting file names discovered. Cannot use both " + "${board_string}.dts and ${shortened_board_string}.dts. " + "Please choose one naming style, ${board_string}.dts is recommended." + ) + elseif(EXISTS ${dir}/${board_string}.dts) + set(DTS_SOURCE ${dir}/${board_string}.dts) + elseif(EXISTS ${dir}/${shortened_board_string}.dts) + set(DTS_SOURCE ${dir}/${shortened_board_string}.dts) + endif() + endforeach() + endif() -if(EXISTS ${DTS_SOURCE}) - # We found a devicetree. Append all relevant dts overlays we can find... - zephyr_file(CONF_FILES ${BOARD_DIRECTORIES} DTS DTS_SOURCE) + if(EXISTS ${DTS_SOURCE}) + # We found a devicetree. Append all relevant dts overlays we can find... + zephyr_file(CONF_FILES ${BOARD_DIRECTORIES} DTS DTS_SOURCE) - zephyr_file( - CONF_FILES ${BOARD_DIRECTORIES} - DTS no_rev_suffix_dts_board_overlays - BOARD ${BOARD} - BOARD_QUALIFIERS ${BOARD_QUALIFIERS} - ) + zephyr_file( + CONF_FILES ${BOARD_DIRECTORIES} + DTS no_rev_suffix_dts_board_overlays + BOARD ${BOARD} + BOARD_QUALIFIERS ${BOARD_QUALIFIERS} + ) - # ...but remove the ones that do not include the revision suffix - list(REMOVE_ITEM DTS_SOURCE ${no_rev_suffix_dts_board_overlays}) -else() - # If we don't have a devicetree, provide an empty stub - set(DTS_SOURCE ${ZEPHYR_BASE}/boards/common/stub.dts) -endif() + # ...but remove the ones that do not include the revision suffix + list(REMOVE_ITEM DTS_SOURCE ${no_rev_suffix_dts_board_overlays}) + else() + # If we don't have a devicetree, provide an empty stub + set(DTS_SOURCE ${ZEPHYR_BASE}/boards/common/stub.dts) + endif() -# -# Find all the DTS files we need to concatenate and preprocess, as -# well as all the devicetree bindings and vendor prefixes associated -# with them. -# + # + # Find all the DTS files we need to concatenate and preprocess, as + # well as all the devicetree bindings and vendor prefixes associated + # with them. + # -zephyr_file(CONF_FILES ${BOARD_EXTENSION_DIRS} DTS board_extension_dts_files) + zephyr_file(CONF_FILES ${BOARD_EXTENSION_DIRS} DTS board_extension_dts_files) -set(dts_files - ${DTS_SOURCE} - ${board_extension_dts_files} - ${shield_dts_files} + set(dts_files + ${DTS_SOURCE} + ${board_extension_dts_files} + ${shield_dts_files} ) -if(DTC_OVERLAY_FILE) - zephyr_list(TRANSFORM DTC_OVERLAY_FILE NORMALIZE_PATHS - OUTPUT_VARIABLE DTC_OVERLAY_FILE_AS_LIST) - build_info(devicetree user-files PATH ${DTC_OVERLAY_FILE_AS_LIST}) - list(APPEND - dts_files - ${DTC_OVERLAY_FILE_AS_LIST} + if(DTC_OVERLAY_FILE) + zephyr_list(TRANSFORM DTC_OVERLAY_FILE NORMALIZE_PATHS + OUTPUT_VARIABLE DTC_OVERLAY_FILE_AS_LIST ) -endif() - -if(EXTRA_DTC_OVERLAY_FILE) - zephyr_list(TRANSFORM EXTRA_DTC_OVERLAY_FILE NORMALIZE_PATHS - OUTPUT_VARIABLE EXTRA_DTC_OVERLAY_FILE_AS_LIST) - build_info(devicetree extra-user-files PATH ${EXTRA_DTC_OVERLAY_FILE_AS_LIST}) - list(APPEND - dts_files - ${EXTRA_DTC_OVERLAY_FILE_AS_LIST} + build_info(devicetree user-files PATH ${DTC_OVERLAY_FILE_AS_LIST}) + list(APPEND + dts_files + ${DTC_OVERLAY_FILE_AS_LIST} ) -endif() - -set(i 0) -foreach(dts_file ${dts_files}) - if(i EQUAL 0) - message(STATUS "Found BOARD.dts: ${dts_file}") - else() - message(STATUS "Found devicetree overlay: ${dts_file}") endif() - math(EXPR i "${i}+1") -endforeach() - -unset(DTS_ROOT_BINDINGS) -foreach(dts_root ${DTS_ROOT}) - set(bindings_path ${dts_root}/dts/bindings) - if(EXISTS ${bindings_path}) + if(EXTRA_DTC_OVERLAY_FILE) + zephyr_list(TRANSFORM EXTRA_DTC_OVERLAY_FILE NORMALIZE_PATHS + OUTPUT_VARIABLE EXTRA_DTC_OVERLAY_FILE_AS_LIST + ) + build_info(devicetree extra-user-files PATH ${EXTRA_DTC_OVERLAY_FILE_AS_LIST}) list(APPEND - DTS_ROOT_BINDINGS - ${bindings_path} - ) - endif() - - set(vendor_prefixes ${dts_root}/${VENDOR_PREFIXES}) - if(EXISTS ${vendor_prefixes}) - list(APPEND EXTRA_GEN_EDT_ARGS --vendor-prefixes ${vendor_prefixes}) + dts_files + ${EXTRA_DTC_OVERLAY_FILE_AS_LIST} + ) endif() -endforeach() -# Cache the location of the root bindings so they can be used by -# scripts which use the build directory. -set(CACHED_DTS_ROOT_BINDINGS ${DTS_ROOT_BINDINGS} CACHE INTERNAL - "DT bindings root directories") - -# -# Run the C preprocessor on the devicetree source, so we can parse it -# (using the Python devicetree package) in later steps. -# + set(i 0) + foreach(dts_file ${dts_files}) + if(i EQUAL 0) + message(STATUS "Found BOARD.dts: ${dts_file}") + else() + message(STATUS "Found devicetree overlay: ${dts_file}") + endif() -# TODO: Cut down on CMake configuration time by avoiding -# regeneration of devicetree_generated.h on every configure. How -# challenging is this? Can we cache the dts dependencies? - -# Run the preprocessor on the DTS input files. -if(DEFINED CMAKE_DTS_PREPROCESSOR) - set(dts_preprocessor ${CMAKE_DTS_PREPROCESSOR}) -else() - set(dts_preprocessor ${CMAKE_C_COMPILER}) -endif() -zephyr_dt_preprocess( - CPP ${dts_preprocessor} - SOURCE_FILES ${dts_files} - OUT_FILE ${DTS_POST_CPP} - DEPS_FILE ${DTS_DEPS} - EXTRA_CPPFLAGS ${DTS_EXTRA_CPPFLAGS} - INCLUDE_DIRECTORIES ${DTS_ROOT_SYSTEM_INCLUDE_DIRS} - WORKING_DIRECTORY ${APPLICATION_SOURCE_DIR} - ) + math(EXPR i "${i}+1") + endforeach() -# Fetch variable from sysbuild which might be forcing a configuration (for variant build images) -zephyr_get(DTS_DEPS SYSBUILD LOCAL) + unset(DTS_ROOT_BINDINGS) + foreach(dts_root ${DTS_ROOT}) + set(bindings_path ${dts_root}/dts/bindings) + if(EXISTS ${bindings_path}) + list(APPEND + DTS_ROOT_BINDINGS + ${bindings_path} + ) + endif() -# -# Make sure we re-run CMake if any devicetree sources or transitive -# includes change. -# + set(vendor_prefixes ${dts_root}/${VENDOR_PREFIXES}) + if(EXISTS ${vendor_prefixes}) + list(APPEND EXTRA_GEN_EDT_ARGS --vendor-prefixes ${vendor_prefixes}) + endif() -# Parse the generated dependency file to find the DT sources that -# were included, including any transitive includes. -toolchain_parse_make_rule(${DTS_DEPS} - DTS_INCLUDE_FILES # Output parameter - ) + set(DTS_ROOT_BINDINGS ${DTS_ROOT_BINDINGS} PARENT_SCOPE) + endforeach() -# Add the results to the list of files that, when change, force the -# build system to re-run CMake. -set_property(DIRECTORY APPEND PROPERTY - CMAKE_CONFIGURE_DEPENDS - ${DTS_INCLUDE_FILES} - ${GEN_EDT_SCRIPT} - ${GEN_DEFINES_SCRIPT} - ${GEN_DRIVER_KCONFIG_SCRIPT} + # Cache the location of the root bindings so they can be used by + # scripts which use the build directory. + set(CACHED_DTS_ROOT_BINDINGS ${DTS_ROOT_BINDINGS} CACHE INTERNAL + "DT bindings root directories" ) - -# -# Run GEN_EDT_SCRIPT. -# - -if(WEST_TOPDIR) - set(GEN_EDT_WORKSPACE_DIR ${WEST_TOPDIR}) -else() - # If West is not available, define the parent directory of ZEPHYR_BASE as - # the workspace. This will create comments that reference the files in the - # Zephyr tree with a 'zephyr/' prefix. - set(GEN_EDT_WORKSPACE_DIR ${ZEPHYR_BASE}/..) -endif() - -string(REPLACE ";" " " EXTRA_DTC_FLAGS_RAW "${EXTRA_DTC_FLAGS}") -set(CMD_GEN_EDT ${PYTHON_EXECUTABLE} ${GEN_EDT_SCRIPT} ---dts ${DTS_POST_CPP} ---dtc-flags '${EXTRA_DTC_FLAGS_RAW}' ---bindings-dirs ${DTS_ROOT_BINDINGS} ---workspace-dir ${GEN_EDT_WORKSPACE_DIR} ---dts-out ${ZEPHYR_DTS}.new # for debugging and dtc ---edt-pickle-out ${EDT_PICKLE}.new -${EXTRA_GEN_EDT_ARGS} -) - -execute_process( - COMMAND ${CMD_GEN_EDT} - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMAND_ERROR_IS_FATAL ANY + set(dts_files ${dts_files} PARENT_SCOPE) + set(DTS_SOURCE ${DTS_SOURCE} PARENT_SCOPE) + set(EXTRA_GEN_EDT_ARGS ${EXTRA_GEN_EDT_ARGS} PARENT_SCOPE) +endfunction() + +function(dts_edt_pickle) + # + # Run the C preprocessor on the devicetree source, so we can parse it + # (using the Python devicetree package) in later steps. + # + + # TODO: Cut down on CMake configuration time by avoiding + # regeneration of devicetree_generated.h on every configure. How + # challenging is this? Can we cache the dts dependencies? + + # Run the preprocessor on the DTS input files. + if(DEFINED CMAKE_DTS_PREPROCESSOR) + set(dts_preprocessor ${CMAKE_DTS_PREPROCESSOR}) + else() + set(dts_preprocessor ${CMAKE_C_COMPILER}) + endif() + zephyr_dt_preprocess( + CPP ${dts_preprocessor} + SOURCE_FILES ${dts_files} + OUT_FILE ${DTS_POST_CPP} + DEPS_FILE ${DTS_DEPS} + EXTRA_CPPFLAGS ${DTS_EXTRA_CPPFLAGS} + INCLUDE_DIRECTORIES ${DTS_ROOT_SYSTEM_INCLUDE_DIRS} + WORKING_DIRECTORY ${APPLICATION_SOURCE_DIR} ) -zephyr_file_copy(${ZEPHYR_DTS}.new ${ZEPHYR_DTS} ONLY_IF_DIFFERENT) -zephyr_file_copy(${EDT_PICKLE}.new ${EDT_PICKLE} ONLY_IF_DIFFERENT) -file(REMOVE ${ZEPHYR_DTS}.new ${EDT_PICKLE}.new) -message(STATUS "Generated zephyr.dts: ${ZEPHYR_DTS}") -message(STATUS "Generated pickled edt: ${EDT_PICKLE}") -# -# Run GEN_DEFINES_SCRIPT. -# + # Fetch variable from sysbuild which might be forcing a configuration (for variant build images) + zephyr_get(DTS_DEPS SYSBUILD LOCAL) -set(CMD_GEN_DEFINES ${PYTHON_EXECUTABLE} ${GEN_DEFINES_SCRIPT} ---header-out ${DEVICETREE_GENERATED_H}.new ---edt-pickle ${EDT_PICKLE} -${EXTRA_GEN_DEFINES_ARGS} -) + # + # Make sure we re-run CMake if any devicetree sources or transitive + # includes change. + # -execute_process( - COMMAND ${CMD_GEN_DEFINES} - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMAND_ERROR_IS_FATAL ANY + # Parse the generated dependency file to find the DT sources that + # were included, including any transitive includes. + toolchain_parse_make_rule(${DTS_DEPS} + DTS_INCLUDE_FILES # Output parameter ) -zephyr_file_copy(${DEVICETREE_GENERATED_H}.new ${DEVICETREE_GENERATED_H} ONLY_IF_DIFFERENT) -file(REMOVE ${DEVICETREE_GENERATED_H}.new) -message(STATUS "Generated devicetree_generated.h: ${DEVICETREE_GENERATED_H}") -# -# Run GEN_DRIVER_KCONFIG_SCRIPT. -# + set(DTS_INCLUDE_FILES ${DTS_INCLUDE_FILES} PARENT_SCOPE) -execute_process( - COMMAND ${PYTHON_EXECUTABLE} ${GEN_DRIVER_KCONFIG_SCRIPT} - --kconfig-out ${DTS_KCONFIG} - --bindings-dirs ${DTS_ROOT_BINDINGS} - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - RESULT_VARIABLE ret + # Add the results to the list of files that, when change, force the + # build system to re-run CMake. + set_property(DIRECTORY APPEND PROPERTY + CMAKE_CONFIGURE_DEPENDS + ${DTS_INCLUDE_FILES} + ${GEN_EDT_SCRIPT} + ${GEN_DEFINES_SCRIPT} + ${GEN_DRIVER_KCONFIG_SCRIPT} ) -if(NOT "${ret}" STREQUAL "0") - message(FATAL_ERROR "gen_driver_kconfig_dts.py failed with return code: ${ret}") -endif() -# -# Import devicetree contents into CMake. -# This enables the CMake dt_* API. -# + # + # Run GEN_EDT_SCRIPT. + # -add_custom_target(devicetree_target) -zephyr_dt_import(EDT_PICKLE_FILE ${EDT_PICKLE} TARGET devicetree_target) + if(WEST_TOPDIR) + set(gen_edt_workspace_dir ${WEST_TOPDIR}) + else() + # If West is not available, define the parent directory of ZEPHYR_BASE as + # the workspace. This will create comments that reference the files in the + # Zephyr tree with a 'zephyr/' prefix. + set(gen_edt_workspace_dir ${ZEPHYR_BASE}/..) + endif() -# -# Run dtc if it was found. -# -# This is just to generate warnings and errors; we discard the output. -# + string(REPLACE ";" " " EXTRA_DTC_FLAGS_RAW "${EXTRA_DTC_FLAGS}") + set(cmd_gen_edt ${PYTHON_EXECUTABLE} ${GEN_EDT_SCRIPT} + --dts ${DTS_POST_CPP} + --dtc-flags '${EXTRA_DTC_FLAGS_RAW}' + --bindings-dirs ${CACHED_DTS_ROOT_BINDINGS} + --workspace-dir ${gen_edt_workspace_dir} + --dts-out ${ZEPHYR_DTS}.new # for debugging and dtc + --edt-pickle-out ${EDT_PICKLE}.new + ${EXTRA_GEN_EDT_ARGS} + ) -if(DTC) - -set(DTC_WARN_UNIT_ADDR_IF_ENABLED "") -check_dtc_flag("-Wunique_unit_address_if_enabled" check) -if(check) - set(DTC_WARN_UNIT_ADDR_IF_ENABLED "-Wunique_unit_address_if_enabled") -endif() - -set(DTC_NO_WARN_UNIT_ADDR "") -check_dtc_flag("-Wno-unique_unit_address" check) -if(check) - set(DTC_NO_WARN_UNIT_ADDR "-Wno-unique_unit_address") -endif() - -set(VALID_EXTRA_DTC_FLAGS "") -foreach(extra_opt ${EXTRA_DTC_FLAGS}) - check_dtc_flag(${extra_opt} check) - if(check) - list(APPEND VALID_EXTRA_DTC_FLAGS ${extra_opt}) - endif() -endforeach() -set(EXTRA_DTC_FLAGS ${VALID_EXTRA_DTC_FLAGS}) - -execute_process( - COMMAND ${DTC} - -O dts - -o - # Write output to stdout, which we discard below - -b 0 - -E unit_address_vs_reg - ${DTC_NO_WARN_UNIT_ADDR} - ${DTC_WARN_UNIT_ADDR_IF_ENABLED} - ${EXTRA_DTC_FLAGS} # User settable - ${ZEPHYR_DTS} - OUTPUT_QUIET # Discard stdout - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMAND_ERROR_IS_FATAL ANY + execute_process( + COMMAND ${cmd_gen_edt} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMAND_ERROR_IS_FATAL ANY + ) + zephyr_file_copy(${ZEPHYR_DTS}.new ${ZEPHYR_DTS} ONLY_IF_DIFFERENT) + zephyr_file_copy(${EDT_PICKLE}.new ${EDT_PICKLE} ONLY_IF_DIFFERENT) + file(REMOVE ${ZEPHYR_DTS}.new ${EDT_PICKLE}.new) + message(STATUS "Generated zephyr.dts: ${ZEPHYR_DTS}") + message(STATUS "Generated pickled edt: ${EDT_PICKLE}") +endfunction() + +function(dts_gen_defines) + # + # Run GEN_DEFINES_SCRIPT. + # + + set(cmd_gen_defines ${PYTHON_EXECUTABLE} ${GEN_DEFINES_SCRIPT} + --header-out ${DEVICETREE_GENERATED_H}.new + --edt-pickle ${EDT_PICKLE} + ${EXTRA_GEN_DEFINES_ARGS} ) -endif(DTC) + execute_process( + COMMAND ${cmd_gen_defines} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMAND_ERROR_IS_FATAL ANY + ) + zephyr_file_copy(${DEVICETREE_GENERATED_H}.new ${DEVICETREE_GENERATED_H} ONLY_IF_DIFFERENT) + file(REMOVE ${DEVICETREE_GENERATED_H}.new) + message(STATUS "Generated devicetree_generated.h: ${DEVICETREE_GENERATED_H}") +endfunction() + +function(dts_gen_driver_kconfig) + # + # Run GEN_DRIVER_KCONFIG_SCRIPT. + # + + execute_process( + COMMAND ${PYTHON_EXECUTABLE} ${GEN_DRIVER_KCONFIG_SCRIPT} + --kconfig-out ${DTS_KCONFIG} + --bindings-dirs ${CACHED_DTS_ROOT_BINDINGS} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + RESULT_VARIABLE ret + ) + if(NOT "${ret}" STREQUAL "0") + message(FATAL_ERROR "gen_driver_kconfig_dts.py failed with return code: ${ret}") + endif() +endfunction() + +function(dts_import) + # + # Import devicetree contents into CMake. + # This enables the CMake dt_* API. + # + + add_custom_target(devicetree_target) + zephyr_dt_import(EDT_PICKLE_FILE ${EDT_PICKLE} TARGET devicetree_target) +endfunction() + +function(dts_dtc) + # + # Run dtc if it was found. + # + # This is just to generate warnings and errors; we discard the output. + # + if(DTC) + set(DTC_WARN_UNIT_ADDR_IF_ENABLED "") + check_dtc_flag("-Wunique_unit_address_if_enabled" check) + if(check) + set(DTC_WARN_UNIT_ADDR_IF_ENABLED "-Wunique_unit_address_if_enabled") + endif() -build_info(devicetree files PATH ${dts_files}) -build_info(devicetree include-dirs PATH ${DTS_ROOT_SYSTEM_INCLUDE_DIRS}) -build_info(devicetree bindings-dirs PATH ${DTS_ROOT_BINDINGS}) + set(DTC_NO_WARN_UNIT_ADDR "") + check_dtc_flag("-Wno-unique_unit_address" check) + if(check) + set(DTC_NO_WARN_UNIT_ADDR "-Wno-unique_unit_address") + endif() + + set(VALID_EXTRA_DTC_FLAGS "") + foreach(extra_opt ${EXTRA_DTC_FLAGS}) + check_dtc_flag(${extra_opt} check) + if(check) + list(APPEND VALID_EXTRA_DTC_FLAGS ${extra_opt}) + endif() + endforeach() + set(EXTRA_DTC_FLAGS ${VALID_EXTRA_DTC_FLAGS}) + set(EXTRA_DTC_FLAGS ${EXTRA_DTC_FLAGS} PARENT_SCOPE) + + execute_process( + COMMAND ${DTC} + -O dts + -o - # Write output to stdout, which we discard below + -b 0 + -E unit_address_vs_reg + ${DTC_NO_WARN_UNIT_ADDR} + ${DTC_WARN_UNIT_ADDR_IF_ENABLED} + ${EXTRA_DTC_FLAGS} # User settable + ${ZEPHYR_DTS} + OUTPUT_QUIET # Discard stdout + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMAND_ERROR_IS_FATAL ANY + ) + endif(DTC) +endfunction() + +function(dts_build_info_output) + build_info(devicetree files PATH ${dts_files}) + build_info(devicetree include-dirs PATH ${DTS_ROOT_SYSTEM_INCLUDE_DIRS}) + build_info(devicetree bindings-dirs PATH ${CACHED_DTS_ROOT_BINDINGS}) +endfunction() + +macro(dts_init) + dts_configuration_files() + dts_edt_pickle() + dts_gen_defines() + dts_gen_driver_kconfig() + dts_import() + dts_dtc() + dts_build_info_output() +endmacro() From 00880f196b359c5bfb2cd9026cb5e4c5a4cd4166 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 7 Apr 2026 15:10:40 +0100 Subject: [PATCH 3240/3334] [nrf fromtree] share: zephyr-package: cmake: Append zephyr base module dir Changes prepend to append to allow for things to override modules e.g. sysbuild Signed-off-by: Jamie McCrae (cherry picked from commit dfa6c9562df751df0c86c5f0998f0054223dea5d) --- share/zephyr-package/cmake/ZephyrConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/zephyr-package/cmake/ZephyrConfig.cmake b/share/zephyr-package/cmake/ZephyrConfig.cmake index d7854e43cc82..a83cb266f970 100644 --- a/share/zephyr-package/cmake/ZephyrConfig.cmake +++ b/share/zephyr-package/cmake/ZephyrConfig.cmake @@ -29,7 +29,7 @@ macro(include_boilerplate location) set(Zephyr_DIR ${ZEPHYR_BASE}/share/zephyr-package/cmake CACHE PATH "The directory containing a CMake configuration file for Zephyr." FORCE ) - list(PREPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/cmake/modules) + list(APPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/cmake/modules) if(ZEPHYR_UNITTEST) zephyr_package_message(DEPRECATION "The ZephyrUnittest CMake package has been deprecated.\n" "ZephyrUnittest has been replaced with Zephyr CMake module 'unittest' \n" From 2aaa72d3e147ee0cf9f8d48cdce78d2905f45b3e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 7 Apr 2026 15:17:42 +0100 Subject: [PATCH 3241/3334] [nrf fromtree] sysbuild: Add variant image CMake module file Adds variant image handling CMake code which re-uses parts of the original dts CMake module code but applies variant-specific parts Signed-off-by: Jamie McCrae (cherry picked from commit 730b44f422272f86534497fa28245ac4f2f90224) --- cmake/modules/dts.cmake | 1 - .../cmake/modules/sysbuild_extensions.cmake | 5 ++ share/sysbuild/cmake/zephyr/variant/dts.cmake | 69 +++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 share/sysbuild/cmake/zephyr/variant/dts.cmake diff --git a/cmake/modules/dts.cmake b/cmake/modules/dts.cmake index 9141a679035d..0d8998235273 100644 --- a/cmake/modules/dts.cmake +++ b/cmake/modules/dts.cmake @@ -128,7 +128,6 @@ set(DTS_KCONFIG ${KCONFIG_BINARY_DIR}/Kconfig.dts) set(VENDOR_PREFIXES dts/bindings/vendor-prefixes.txt) function(dts_configuration_files) - # Fetch variable from sysbuild which might be forcing a configuration (for variant build images) zephyr_get(DTS_SOURCE SYSBUILD LOCAL) if(NOT DEFINED DTS_SOURCE) diff --git a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake index d19dcb2c74f2..0aa1c8b6cb2d 100644 --- a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake +++ b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake @@ -543,6 +543,11 @@ function(ExternalZephyrVariantProject_Add) endif() endforeach() + # Add the variant image CMake module path to replace the normal Zephyr module path + list(APPEND shared_cmake_vars_argument + "-DCMAKE_MODULE_PATH:PATH=${CMAKE_SOURCE_DIR}/cmake/zephyr/variant" + ) + set(list_separator ",") include(ExternalProject) diff --git a/share/sysbuild/cmake/zephyr/variant/dts.cmake b/share/sysbuild/cmake/zephyr/variant/dts.cmake new file mode 100644 index 000000000000..d99824190443 --- /dev/null +++ b/share/sysbuild/cmake/zephyr/variant/dts.cmake @@ -0,0 +1,69 @@ +# SPDX-License-Identifier: Apache-2.0 + +include_guard(GLOBAL) + +include(${ZEPHYR_BASE}/cmake/modules/dts.cmake) + +function(variant_dts_configuration_files) + zephyr_get(DTS_SOURCE SYSBUILD LOCAL) + set(dts_files ${DTS_SOURCE}) + + if(EXTRA_DTC_OVERLAY_FILE) + zephyr_list(TRANSFORM EXTRA_DTC_OVERLAY_FILE NORMALIZE_PATHS + OUTPUT_VARIABLE EXTRA_DTC_OVERLAY_FILE_AS_LIST + ) + build_info(devicetree extra-user-files PATH ${EXTRA_DTC_OVERLAY_FILE_AS_LIST}) + list(APPEND + dts_files + ${EXTRA_DTC_OVERLAY_FILE_AS_LIST} + ) + endif() + + set(i 0) + foreach(dts_file ${dts_files}) + if(i EQUAL 0) + message(STATUS "Found BOARD.dts: ${dts_file}") + else() + message(STATUS "Found devicetree overlay: ${dts_file}") + endif() + + math(EXPR i "${i}+1") + endforeach() + + unset(DTS_ROOT_BINDINGS) + foreach(dts_root ${DTS_ROOT}) + set(bindings_path ${dts_root}/dts/bindings) + if(EXISTS ${bindings_path}) + list(APPEND + DTS_ROOT_BINDINGS + ${bindings_path} + ) + endif() + + set(vendor_prefixes ${dts_root}/${VENDOR_PREFIXES}) + if(EXISTS ${vendor_prefixes}) + list(APPEND EXTRA_GEN_EDT_ARGS --vendor-prefixes ${vendor_prefixes}) + endif() + + set(DTS_ROOT_BINDINGS ${DTS_ROOT_BINDINGS} PARENT_SCOPE) + endforeach() + + # Cache the location of the root bindings so they can be used by + # scripts which use the build directory. + set(CACHED_DTS_ROOT_BINDINGS ${DTS_ROOT_BINDINGS} CACHE INTERNAL + "DT bindings root directories" + ) + set(dts_files ${dts_files} PARENT_SCOPE) + set(DTS_SOURCE ${DTS_SOURCE} PARENT_SCOPE) + set(EXTRA_GEN_EDT_ARGS ${EXTRA_GEN_EDT_ARGS} PARENT_SCOPE) +endfunction() + +macro(dts_init) + variant_dts_configuration_files() + dts_edt_pickle() + dts_gen_defines() + dts_gen_driver_kconfig() + dts_import() + dts_dtc() + dts_build_info_output() +endmacro() From e138ceb75a865d48204ba58a33ab386ce1b2d41a Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Fri, 10 Apr 2026 15:06:55 +0300 Subject: [PATCH 3242/3334] [nrf noup] Revert "secure_storage: do not manually specify TF-PSA-Crypto include directories" This reverts commit 2bedd65447494edacfcf7b39aa8dad04dab1c5f3. Signed-off-by: Tomi Fontanilles --- subsys/secure_storage/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/secure_storage/CMakeLists.txt b/subsys/secure_storage/CMakeLists.txt index 3d93e2d36b20..ed42684c2413 100644 --- a/subsys/secure_storage/CMakeLists.txt +++ b/subsys/secure_storage/CMakeLists.txt @@ -5,7 +5,8 @@ zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS) # Add some Mbed TLS' internal folders where there are files included from # "psa_crypto_driver_wrappers.h" in "src/its/transform/aead.c". if(CONFIG_SECURE_STORAGE_ITS_TRANSFORM_IMPLEMENTATION_AEAD) - zephyr_library_include_directories($) + zephyr_library_include_directories(${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/dispatch) + zephyr_library_include_directories(${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/src) endif() zephyr_library_include_directories(include/internal) # secure_storage headers From 25de4dbcb4ff2ceb54d8a2bf92140ed6c009628f Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Fri, 10 Apr 2026 15:07:01 +0300 Subject: [PATCH 3243/3334] [nrf noup] Revert "secure_storage: adapt build system for TF-PSA-Crypto" This reverts commit 44d35422aad8e3da9d6b68af149118fbb2aebc06. Signed-off-by: Tomi Fontanilles --- subsys/secure_storage/CMakeLists.txt | 7 ------- subsys/secure_storage/src/its/transform/aead.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/subsys/secure_storage/CMakeLists.txt b/subsys/secure_storage/CMakeLists.txt index ed42684c2413..2717994ebb08 100644 --- a/subsys/secure_storage/CMakeLists.txt +++ b/subsys/secure_storage/CMakeLists.txt @@ -2,13 +2,6 @@ zephyr_library() zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS) -# Add some Mbed TLS' internal folders where there are files included from -# "psa_crypto_driver_wrappers.h" in "src/its/transform/aead.c". -if(CONFIG_SECURE_STORAGE_ITS_TRANSFORM_IMPLEMENTATION_AEAD) - zephyr_library_include_directories(${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/dispatch) - zephyr_library_include_directories(${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/src) -endif() - zephyr_library_include_directories(include/internal) # secure_storage headers add_subdirectory(src) diff --git a/subsys/secure_storage/src/its/transform/aead.c b/subsys/secure_storage/src/its/transform/aead.c index a687d00c337b..75fed41c41ca 100644 --- a/subsys/secure_storage/src/its/transform/aead.c +++ b/subsys/secure_storage/src/its/transform/aead.c @@ -1,7 +1,7 @@ /* Copyright (c) 2024 Nordic Semiconductor * SPDX-License-Identifier: Apache-2.0 */ -#include <../core/psa_crypto_driver_wrappers.h> +#include <../library/psa_crypto_driver_wrappers.h> #include #include #include From 9ee6019afcac772551ddc6dee14948e35ace3b9a Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 13 Apr 2026 11:09:25 +0300 Subject: [PATCH 3244/3334] [nrf noup] revert update of MBEDTLS_BUILTIN CMake logic to Mbed TLS 4 Temporarily bring back the CMake logic that compiled Mbed TLS 3.6 before we actually update to Mbed TLS 4 in NCS. This is a revert of 393350fd65e66800861f2d45a11c37d8472c3efc and subsequent changes affecting the Mbed TLS integration. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/CMakeLists.txt | 277 +++++++++++++++++++++++++-------- modules/mbedtls/Kconfig | 6 - 2 files changed, 213 insertions(+), 70 deletions(-) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index 2c6cf0073325..20e1b0b7ac62 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -5,87 +5,236 @@ # if(CONFIG_MBEDTLS) + zephyr_interface_library_named(mbedTLS) if(CONFIG_MBEDTLS_BUILTIN) - # Create an interface library named "mbedTLS": - # - This is the library other modules/subsystems link against. - # - It contains some Mbed TLS configuration flags (ex: MBEDTLS_CONFIG_FILE - # and TF_PSA_CRYPTO_CONFIG_FILE) which are used in Mbed TLS build, but - # which must also be defined when Zephyr code includes headers - # from Mbed TLS. - # - It contains public include directories which are provided by Mbed TLS. - zephyr_interface_library_named(mbedTLS) - - # Explicitly link zephyr_interface to mbedTLS - zephyr_link_libraries(mbedTLS) + if(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR AND NOT CONFIG_ENTROPY_HAS_DRIVER) + message(WARNING "No entropy device on the system, using fake entropy source!") + endif() + + if(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) + if(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG OR + CONFIG_TEST_CSPRNG_GENERATOR) + message(WARNING " + Non cryptographycally secure sources are enabled for psa_generate_random(). + This is meant to be used only for tests, not in production!") + else() + if(NOT CONFIG_CSPRNG_ENABLED) + message(FATAL_ERROR " + MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG is set but there is + no CSPRNG enabled.") + endif() + endif() + endif() + # Add the config-file entry point target_compile_definitions(mbedTLS INTERFACE - MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CONFIG_FILE}" - TF_PSA_CRYPTO_CONFIG_FILE="${CONFIG_TF_PSA_CRYPTO_CONFIG_FILE}" + MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CONFIG_FILE}" ) - # Some CMake variables that are used in Mbed TLS build - set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) - set(MBEDTLS_AS_SUBPROJECT ON) - set(ENABLE_PROGRAMS OFF) - set(ENABLE_TESTING OFF) - set(GEN_FILES OFF) - # Workaround to get rid of a warning generated by the Mbed TLS build system. - set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "") - set(TF_PSA_CRYPTO_DIR ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}) - set(MLDSA_NATIVE_DIR ${ZEPHYR_MLDSA_NATIVE_MODULE_DIR}) - - # Add Mbed TLS (TF-PSA-Crypto is automatically included from there). - # This creates 3 libraries: mbedtls, mbedx509 and tfpsacrypto. - add_subdirectory(${ZEPHYR_MBEDTLS_MODULE_DIR} mbedtls) - - foreach(lib mbedtls mbedx509 tfpsacrypto builtin p256-m everest pqcp extras platform utilities) - # Mbed TLS libraries are normal CMake libraries. - # To ensure Mbed TLS libraries are including Zephyr include directories and - # Zephyr compile options we link those libraries with 'zephyr_interface'. - target_link_libraries(${lib} PRIVATE zephyr_interface) - # Mbed TLS libraries are external CMake targets (not zephyr_library()), - # so they miss the automatic add_dependencies on zephyr_generated_headers - # that zephyr_library() targets get. Without this, generated headers - # like heap_constants.h may not exist when Mbed TLS sources compile. - add_dependencies(${lib} zephyr_generated_headers) - endforeach() - - # Custom macro to tell that a TF-PSA-Crypto source file is being compiled. - # This is used by Secure Storage. - target_compile_definitions(tfpsacrypto PRIVATE BUILDING_MBEDTLS_CRYPTO) - - # Add Mbed TLS libraries ("tfpsacrypto" and "mbedx509" are linked to "mbedtls") - # to ZEPHYR_LIBS list. - zephyr_append_cmake_library(mbedtls) - - # Add Mbed TLS public include directories to the "mbedTLS" interface library. + if(CONFIG_BUILD_WITH_TFM) + target_include_directories(mbedTLS INTERFACE + $/api_ns/interface/include + ) + endif() + + # Add regular includes target_include_directories(mbedTLS INTERFACE - $ + ${ZEPHYR_CURRENT_MODULE_DIR}/include ${ZEPHYR_CURRENT_MODULE_DIR}/include/library ${ZEPHYR_CURRENT_MODULE_DIR}/library + configs + include ) - # Add local include directories to the "mbedTLS" interface library. - target_include_directories(mbedTLS INTERFACE - ${CMAKE_CURRENT_LIST_DIR}/configs - ${CMAKE_CURRENT_LIST_DIR}/include + if(CONFIG_MBEDTLS_PSA_P256M_DRIVER_RAW) + target_include_directories(mbedTLS INTERFACE + ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m + ) + endif() + + # Add base library with files required by all drivers/backends. + zephyr_library_named(mbedTLSBase) + + # Base mbed TLS files + list(APPEND mbedtls_base_src + ${ZEPHYR_CURRENT_MODULE_DIR}/library/aes.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/aesni.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/aria.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/asn1parse.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/asn1write.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/base64.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_core.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_mod_raw.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_mod.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/block_cipher.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/camellia.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ccm.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/chacha20.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/chachapoly.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/cipher_wrap.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/cipher.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/cmac.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/constant_time.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ctr_drbg.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/debug.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/des.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/dhm.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecdh.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecdsa.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecjpake.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp_curves_new.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp_curves.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/entropy_poll.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/entropy.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/error.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/gcm.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/hkdf.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/hmac_drbg.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/lmots.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/lms.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/md.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/md5.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/memory_buffer_alloc.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/mps_reader.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/mps_trace.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/nist_kw.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/oid.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/padlock.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/platform_util.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/platform.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/poly1305.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_util.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ripemd160.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/rsa_alt_helpers.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/rsa.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha1.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha256.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha512.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha3.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/threading.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/timing.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/version_features.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/version.c + zephyr_init.c + zephyr_entropy.c ) - # Add some support for legacy crypto that unfortunately is still required - # in some scenarios. - include(${CMAKE_CURRENT_LIST_DIR}/legacy_support.cmake) + zephyr_library_sources(${mbedtls_base_src}) - # Add another library to provide Zephyr-specific support - zephyr_library() - zephyr_library_sources( - ${CMAKE_CURRENT_LIST_DIR}/zephyr_init.c - ${CMAKE_CURRENT_LIST_DIR}/zephyr_entropy.c - $<$:${CMAKE_CURRENT_LIST_DIR}/debug.c> - $<$:${CMAKE_CURRENT_LIST_DIR}/shell.c> + zephyr_library_sources_ifdef(CONFIG_MBEDTLS_DEBUG debug.c) + zephyr_library_sources_ifdef(CONFIG_MBEDTLS_SHELL shell.c) + + zephyr_library_app_memory(k_mbedtls_partition) + if(CONFIG_ARCH_POSIX AND CONFIG_ASAN AND NOT CONFIG_64BIT AND NOT CONFIG_NO_OPTIMIZATIONS) + # i386 assembly code used in MBEDTLS does not compile with size optimization + # if address sanitizer is enabled, as such switch default optimization level + # to speed + set_property(SOURCE ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_core.c APPEND PROPERTY COMPILE_OPTIONS + "${COMPILER_OPTIMIZE_FOR_SPEED_FLAG}") + endif() + + zephyr_library_link_libraries(mbedTLS) + + zephyr_library_named(mbedTLSCrypto) + + if(CONFIG_MBEDTLS_PSA_CRYPTO_C) + list(APPEND crypto_source + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_aead.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_cipher.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_driver_wrappers_no_static.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_ecp.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_ffdh.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_hash.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_mac.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_pake.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_random.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_rsa.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_se.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_storage.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_its_file.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_client.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_slot_management.c + ) + endif() + + if(CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED) + list(APPEND crypto_source + ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m_driver_entrypoints.c + ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m/p256-m.c + ) + zephyr_library_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/library) + endif() + + list(APPEND crypto_source + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pem.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkcs12.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkcs5.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkparse.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkwrite.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk_ecc.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk_wrap.c + ) + + zephyr_library_sources(${crypto_source}) + + # Custom macro to tell that an mbedTLSCrypto source file is being compiled. + zephyr_library_compile_definitions(BUILDING_MBEDTLS_CRYPTO) + + zephyr_library_link_libraries(mbedTLS) + + zephyr_library_link_libraries_ifdef(CONFIG_BUILD_WITH_TFM tfm_api) + + zephyr_library_named(mbedTLSX509) + + list(APPEND x509_source + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_create.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_crl.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_crt.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_csr.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write_crt.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write_csr.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write.c ) + + zephyr_library_sources(${x509_source}) + zephyr_library_link_libraries(mbedTLS) + zephyr_library() + + list(APPEND mbedtls_source + ${ZEPHYR_CURRENT_MODULE_DIR}/library/net_sockets.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_cache.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_ciphersuites.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_client.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_cookie.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_debug_helpers_generated.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_msg.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_ticket.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls12_client.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls12_server.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_client.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_generic.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_keys.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_server.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls.c + ) + + zephyr_library_sources(${mbedtls_source}) + + zephyr_library_link_libraries( + mbedTLSX509 + mbedTLSCrypto + mbedTLSBase + mbedTLS + ) + elseif(CONFIG_MBEDTLS_LIBRARY) # NB: CONFIG_MBEDTLS_LIBRARY is not regression tested and is # therefore susceptible to bit rot diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index c6111e0f7c32..ea6bfecac519 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -14,12 +14,6 @@ config MBEDTLS_PROMPTLESS mbed TLS menu prompt and instead handle the selection of MBEDTLS from dependent sub-configurations and thus prevent stuck symbol behavior. -config MBEDTLS_VERSION_4_x - bool - default y - help - Hidden Kconfig symbol used internally to mark support for Mbed TLS 4.x. - rsource "Kconfig.psa.auto" rsource "Kconfig.psa.logic" From 82b58f3c5d2ca9b4230fe4c699ccef5fd226b6e5 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 13 Apr 2026 11:28:41 +0300 Subject: [PATCH 3245/3334] [nrf noup] Revert "net: lib: sockets: tls: do not specify random function to be used" This reverts commit e9b5feb7976af61c697091da89002cb403ed295f. Signed-off-by: Tomi Fontanilles --- subsys/net/lib/sockets/sockets_tls.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/subsys/net/lib/sockets/sockets_tls.c b/subsys/net/lib/sockets/sockets_tls.c index cc0d5c76fad5..1a0a73e7b556 100644 --- a/subsys/net/lib/sockets/sockets_tls.c +++ b/subsys/net/lib/sockets/sockets_tls.c @@ -331,6 +331,19 @@ bool net_socket_is_tls(void *obj) return PART_OF_ARRAY(tls_contexts, (struct tls_context *)obj); } +static int tls_ctr_drbg_random(void *ctx, unsigned char *buf, size_t len) +{ + ARG_UNUSED(ctx); + +#if defined(CONFIG_CSPRNG_ENABLED) + return sys_csrand_get(buf, len); +#else + sys_rand_get(buf, len); + + return 0; +#endif +} + #if defined(CONFIG_NET_SOCKETS_ENABLE_DTLS) /* mbedTLS-defined function for setting timer. */ static void dtls_timing_set_delay(void *data, uint32_t int_ms, uint32_t fin_ms) @@ -1428,7 +1441,8 @@ static int tls_set_private_key(struct tls_context *tls, int err; err = mbedtls_pk_parse_key(&tls->priv_key, priv_key->buf, - priv_key->len, NULL, 0); + priv_key->len, NULL, 0, + tls_ctr_drbg_random, NULL); if (err != 0) { return -EINVAL; } @@ -1814,7 +1828,9 @@ static int tls_mbedtls_init(struct tls_context *context, bool is_server) /* Configure cookie for DTLS server */ if (role == MBEDTLS_SSL_IS_SERVER) { - ret = mbedtls_ssl_cookie_setup(&context->cookie); + ret = mbedtls_ssl_cookie_setup(&context->cookie, + tls_ctr_drbg_random, + NULL); if (ret != 0) { return -ENOMEM; } @@ -1839,6 +1855,10 @@ static int tls_mbedtls_init(struct tls_context *context, bool is_server) context->options.verify_level); } + mbedtls_ssl_conf_rng(&context->config, + tls_ctr_drbg_random, + NULL); + ret = tls_mbedtls_set_credentials(context); if (ret != 0) { return ret; @@ -1935,7 +1955,8 @@ static int tls_check_priv_key(struct tls_credential *priv_key) mbedtls_pk_init(&key_ctx); err = mbedtls_pk_parse_key(&key_ctx, priv_key->buf, - priv_key->len, NULL, 0); + priv_key->len, NULL, 0, + tls_ctr_drbg_random, NULL); if (err != 0) { NET_ERR("Failed to parse %s on tag %d, err: -0x%x", "private key", priv_key->tag, -err); From 18c469ab6a435bdc7ad60d755eaf532c16bd53e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 13 Apr 2026 14:20:39 +0200 Subject: [PATCH 3246/3334] [nrf fromtree] debug: coresight: cs_trace_defmt: Fix uninitialized variable warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In certain configurations there could be a warning due to potential use of uninitialized variable. Add initialization. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 59da64a664e5167608699f9d4632d045e4b8b0b0) --- subsys/debug/coresight/cs_trace_defmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/debug/coresight/cs_trace_defmt.c b/subsys/debug/coresight/cs_trace_defmt.c index adae83207993..6a36f700eae0 100644 --- a/subsys/debug/coresight/cs_trace_defmt.c +++ b/subsys/debug/coresight/cs_trace_defmt.c @@ -25,7 +25,7 @@ int cs_trace_defmt_process(const uint8_t *data, size_t len) uint8_t aux = data[15]; uint8_t d_id; - uint8_t cb_id; + uint8_t cb_id = 0; bool do_cb = false; for (int i = 0; i < 8; i++) { From 41c7f0acea87bbb2389741b81f2b5e77022d5030 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 13 Apr 2026 15:24:30 +0300 Subject: [PATCH 3247/3334] [nrf noup] modules: mbedtls: revert removal of deprecated options This is a revert of 51325c4953c6e73f55ba4c9d37012c2a2ed337af with conflicts solved by hand (to avoid having to revert too many commits) and with the extra change that config-mbedtls.h includes config-tf-psa-crypto.h so that it contains the full Mbed TLS configuration as it used to. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/Kconfig.mbedtls | 27 +- modules/mbedtls/Kconfig.tf-psa-crypto | 249 ++++++++++++++++-- modules/mbedtls/configs/config-mbedtls.h | 16 ++ .../mbedtls/configs/config-tf-psa-crypto.h | 209 +++++++++++++++ samples/net/sockets/http_get/overlay-tls.conf | 2 +- 5 files changed, 475 insertions(+), 28 deletions(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index 9ed4768f3a46..f88ebee28292 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -97,9 +97,15 @@ comment "Supported key exchange modes" config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED bool "All available ciphersuite modes" select MBEDTLS_MD_C + select MBEDTLS_RSA_C + select MBEDTLS_PKCS1_V15 + select MBEDTLS_PKCS1_V21 select MBEDTLS_X509_CRT_PARSE_C select MBEDTLS_KEY_EXCHANGE_PSK_ENABLED + select MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED select MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED + select MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED + select MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED select MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED select MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED select MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED @@ -109,10 +115,18 @@ config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED config MBEDTLS_KEY_EXCHANGE_PSK_ENABLED bool "PSK based ciphersuite modes" +config MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED + bool "DHE-PSK based ciphersuite modes" + config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED bool "ECDHE-PSK based ciphersuite modes" depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC +config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED + bool "RSA-PSK based ciphersuite modes" + depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC + depends on MBEDTLS_X509_CRT_PARSE_C + config MBEDTLS_PSK_MAX_LEN int "Max size of TLS pre-shared keys" default 32 @@ -120,6 +134,11 @@ config MBEDTLS_PSK_MAX_LEN Max size of TLS pre-shared keys, in bytes. It has no effect if no PSK key exchange is used. +config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED + bool "DHE-RSA based ciphersuite modes" + depends on MBEDTLS_PKCS1_V15 || MBEDTLS_PKCS1_V21 + depends on MBEDTLS_X509_CRT_PARSE_C + config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED bool "ECDHE-RSA based ciphersuite modes" depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC @@ -128,22 +147,22 @@ config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED bool "ECDHE-ECDSA based ciphersuite modes" - depends on PSA_WANT_ALG_ECDH && PSA_WANT_ALG_ECDSA + depends on (MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C) || (PSA_WANT_ALG_ECDH && PSA_WANT_ALG_ECDSA) depends on MBEDTLS_X509_CRT_PARSE_C config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED bool "ECDH-ECDSA based ciphersuite modes" - depends on PSA_WANT_ALG_ECDH && PSA_WANT_ALG_ECDSA + depends on (MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C) || (PSA_WANT_ALG_ECDH && PSA_WANT_ALG_ECDSA) depends on MBEDTLS_X509_CRT_PARSE_C config MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED bool "ECDH-RSA based ciphersuite modes" - depends on PSA_WANT_ALG_ECDH + depends on MBEDTLS_ECDH_C depends on MBEDTLS_X509_CRT_PARSE_C config MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED bool "ECJPAKE based ciphersuite modes" - depends on PSA_WANT_ALG_JPAKE + depends on MBEDTLS_ECJPAKE_C || PSA_WANT_ALG_JPAKE if MBEDTLS_SSL_PROTO_TLS1_3 diff --git a/modules/mbedtls/Kconfig.tf-psa-crypto b/modules/mbedtls/Kconfig.tf-psa-crypto index aab9c1104ee8..f78a6688a703 100644 --- a/modules/mbedtls/Kconfig.tf-psa-crypto +++ b/modules/mbedtls/Kconfig.tf-psa-crypto @@ -18,39 +18,163 @@ config TF_PSA_CRYPTO_USER_CONFIG_FILE config TF_PSA_CRYPTO_USER_CONFIG def_bool TF_PSA_CRYPTO_USER_CONFIG_FILE != "" +config MBEDTLS_RSA_C + bool "RSA base support" + +if MBEDTLS_RSA_C + +config MBEDTLS_PKCS1_V15 + bool "RSA PKCS1 v1.5" + +config MBEDTLS_PKCS1_V21 + bool "RSA PKCS1 v2.1" + +config MBEDTLS_GENPRIME_ENABLED + bool "Prime number generation code" + +endif # MBEDTLS_RSA_C + +config MBEDTLS_RSA_ENABLE_LEGACY_APIS + bool + imply MBEDTLS_RSA_C + imply MBEDTLS_PKCS1_V15 + default y if MBEDTLS_CIPHERSUITE_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + help + Promptless Kconfig to automatically enable legacy RSA crypto support + when RSA based ciphersuites are enabled. + This is required because TLS/X.509 code still relies on these legacy + symbols to guard parts of the code. + In theory this fix is only necessary when TF-M is enabled, because + otherwise when Mbed TLS uses its own implementation of PSA Crypto + it automatically does this internally. On the other hand it doesn't hurt to + always enable it. + This fix is very likely to be removed with Mbed TLS 4.x. + +config MBEDTLS_ECDSA_DETERMINISTIC + bool "Deterministic ECDSA (RFC 6979)" + +config MBEDTLS_HKDF_C + bool "HMAC-based Extract-and-Expand Key Derivation Function" + +comment "Elliptic curve libraries" + +config MBEDTLS_ECDH_C + bool "Elliptic curve Diffie-Hellman library" + depends on MBEDTLS_ECP_C + +config MBEDTLS_ECDSA_C + bool "Elliptic curve DSA library" + depends on MBEDTLS_ECP_C + select MBEDTLS_ASN1_PARSE_C + +config MBEDTLS_ECJPAKE_C + bool "Elliptic curve J-PAKE library" + depends on MBEDTLS_ECP_C + +config MBEDTLS_ECP_C + bool "Elliptic curve over GF(p) library" + +if MBEDTLS_ECP_C + +comment "Supported elliptic curves" + +config MBEDTLS_ECP_ALL_ENABLED + bool "All available elliptic curves" + select MBEDTLS_ECP_DP_SECP192R1_ENABLED + select MBEDTLS_ECP_DP_SECP192R1_ENABLED + select MBEDTLS_ECP_DP_SECP224R1_ENABLED + select MBEDTLS_ECP_DP_SECP256R1_ENABLED + select MBEDTLS_ECP_DP_SECP384R1_ENABLED + select MBEDTLS_ECP_DP_SECP521R1_ENABLED + select MBEDTLS_ECP_DP_SECP192K1_ENABLED + select MBEDTLS_ECP_DP_SECP224K1_ENABLED + select MBEDTLS_ECP_DP_SECP256K1_ENABLED + select MBEDTLS_ECP_DP_BP256R1_ENABLED + select MBEDTLS_ECP_DP_BP384R1_ENABLED + select MBEDTLS_ECP_DP_BP512R1_ENABLED + select MBEDTLS_ECP_DP_CURVE25519_ENABLED + select MBEDTLS_ECP_DP_CURVE448_ENABLED + select MBEDTLS_ECP_NIST_OPTIM + +config MBEDTLS_ECP_DP_SECP192R1_ENABLED + bool "SECP192R1 elliptic curve" + +config MBEDTLS_ECP_DP_SECP224R1_ENABLED + bool "SECP224R1 elliptic curve" + +config MBEDTLS_ECP_DP_SECP256R1_ENABLED + bool "SECP256R1 elliptic curve" + +config MBEDTLS_ECP_DP_SECP384R1_ENABLED + bool "SECP384R1 elliptic curve" + +config MBEDTLS_ECP_DP_SECP521R1_ENABLED + bool "SECP521R1 elliptic curve" + +config MBEDTLS_ECP_DP_SECP192K1_ENABLED + bool "SECP192K1 elliptic curve" + +config MBEDTLS_ECP_DP_SECP224K1_ENABLED + bool "SECP224K1 elliptic curve" + +config MBEDTLS_ECP_DP_SECP256K1_ENABLED + bool "SECP256K1 elliptic curve" + +config MBEDTLS_ECP_DP_BP256R1_ENABLED + bool "BP256R1 elliptic curve" + +config MBEDTLS_ECP_DP_BP384R1_ENABLED + bool "BP384R1 elliptic curve" + +config MBEDTLS_ECP_DP_BP512R1_ENABLED + bool "BP512R1 elliptic curve" + +config MBEDTLS_ECP_DP_CURVE25519_ENABLED + bool "CURVE25519 elliptic curve" + +config MBEDTLS_ECP_DP_CURVE448_ENABLED + bool "CURVE448 elliptic curve" + config MBEDTLS_ECP_NIST_OPTIM bool "NIST curves optimization" - depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC + +endif comment "Supported ciphers and cipher modes" config MBEDTLS_CIPHER_ALL_ENABLED bool "All available ciphers and modes" - select PSA_WANT_KEY_TYPE_AES - select PSA_WANT_KEY_TYPE_CAMELLIA - select PSA_WANT_KEY_TYPE_CHACHA20 - select PSA_WANT_ALG_GCM - select PSA_WANT_ALG_CCM - select PSA_WANT_ALG_CBC_NO_PADDING - select PSA_WANT_ALG_CBC_PKCS7 - select PSA_WANT_ALG_CTR - select PSA_WANT_ALG_CHACHA20_POLY1305 + select MBEDTLS_CIPHER_AES_ENABLED + select MBEDTLS_CIPHER_CAMELLIA_ENABLED + select MBEDTLS_CIPHER_DES_ENABLED + select MBEDTLS_CIPHER_CHACHA20_ENABLED + select MBEDTLS_CIPHER_CCM_ENABLED + select MBEDTLS_CIPHER_GCM_ENABLED + select MBEDTLS_CIPHER_MODE_XTS_ENABLED + select MBEDTLS_CIPHER_MODE_CBC_ENABLED + select MBEDTLS_CIPHER_MODE_CTR_ENABLED + select MBEDTLS_CHACHAPOLY_AEAD_ENABLED config MBEDTLS_SOME_AEAD_CIPHER_ENABLED bool default y depends on \ - PSA_WANT_KEY_TYPE_AES || \ - PSA_WANT_KEY_TYPE_CAMELLIA + MBEDTLS_CIPHER_AES_ENABLED || \ + MBEDTLS_CIPHER_CAMELLIA_ENABLED config MBEDTLS_SOME_CIPHER_ENABLED bool default y depends on \ MBEDTLS_SOME_AEAD_CIPHER_ENABLED || \ - PSA_WANT_KEY_TYPE_CHACHA20 + MBEDTLS_CIPHER_DES_ENABLED || \ + MBEDTLS_CIPHER_CHACHA20_ENABLED -if PSA_WANT_KEY_TYPE_AES +config MBEDTLS_CIPHER_AES_ENABLED + bool "AES block cipher" + default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C + +if MBEDTLS_CIPHER_AES_ENABLED config MBEDTLS_AES_ROM_TABLES bool "Use precomputed AES tables stored in ROM" @@ -65,31 +189,96 @@ config MBEDTLS_AES_FEWER_TABLES lookups are converted to 1 table lookup, 3 additions and 6 bit shifts. -endif # PSA_WANT_KEY_TYPE_AES +config MBEDTLS_CIPHER_MODE_XTS_ENABLED + bool "Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES" + +endif # MBEDTLS_CIPHER_AES_ENABLED + +config MBEDTLS_CIPHER_CAMELLIA_ENABLED + bool "Camellia block cipher" + +config MBEDTLS_CIPHER_DES_ENABLED + bool "DES block cipher" + +config MBEDTLS_CIPHER_CHACHA20_ENABLED + bool "ChaCha20 stream cipher" + +if MBEDTLS_SOME_AEAD_CIPHER_ENABLED + +config MBEDTLS_CIPHER_CCM_ENABLED + bool "Counter with CBC-MAC (CCM) mode for 128-bit block cipher" + +config MBEDTLS_CIPHER_GCM_ENABLED + bool "Galois/Counter Mode (GCM) for symmetric ciphers" + +endif # MBEDTLS_SOME_AEAD_CIPHER_ENABLED + +if MBEDTLS_SOME_CIPHER_ENABLED + +config MBEDTLS_CIPHER_MODE_CBC_ENABLED + bool "Cipher Block Chaining mode (CBC) for symmetric ciphers" + default y if !NET_L2_OPENTHREAD + +config MBEDTLS_CIPHER_MODE_CTR_ENABLED + bool "Counter Block Cipher mode (CTR) for symmetric ciphers" + +endif # MBEDTLS_SOME_CIPHER_ENABLED + +config MBEDTLS_CHACHAPOLY_AEAD_ENABLED + bool "ChaCha20-Poly1305 AEAD algorithm" + depends on MBEDTLS_CIPHER_CHACHA20_ENABLED && MBEDTLS_POLY1305 + +config MBEDTLS_CMAC + bool "CMAC (Cipher-based Message Authentication Code) mode for block ciphers" + depends on MBEDTLS_CIPHER_AES_ENABLED || MBEDTLS_CIPHER_DES_ENABLED comment "Supported hash algorithms" config MBEDTLS_HASH_ALL_ENABLED bool "All available MAC methods" - select PSA_WANT_ALG_MD5 - select PSA_WANT_ALG_SHA_1 - select PSA_WANT_ALG_SHA_224 - select PSA_WANT_ALG_SHA_256 - select PSA_WANT_ALG_SHA_384 - select PSA_WANT_ALG_SHA_512 + select MBEDTLS_MD5 + select MBEDTLS_SHA1 + select MBEDTLS_SHA224 + select MBEDTLS_SHA256 + select MBEDTLS_SHA384 + select MBEDTLS_SHA512 + select MBEDTLS_POLY1305 + +config MBEDTLS_MD5 + bool "MD5 hash algorithm" + +config MBEDTLS_SHA1 + bool "SHA-1 hash algorithm" + +config MBEDTLS_SHA224 + bool "SHA-224 hash algorithm" + +config MBEDTLS_SHA256 + bool "SHA-256 hash algorithm" + default y config MBEDTLS_SHA256_SMALLER bool "Smaller SHA-256 implementation" - depends on PSA_WANT_ALG_SHA_256 + depends on MBEDTLS_SHA256 default y help Enable an implementation of SHA-256 that has a smaller ROM footprint but also lower performance. +config MBEDTLS_SHA384 + bool "SHA-384 hash algorithm" + +config MBEDTLS_SHA512 + bool "SHA-512 hash algorithm" + +config MBEDTLS_POLY1305 + bool "Poly1305 hash family" + comment "Random number generators" config MBEDTLS_CTR_DRBG_C bool "CTR_DRBG AES-256-based random generator" + depends on MBEDTLS_CIPHER_AES_ENABLED config MBEDTLS_HMAC_DRBG_C bool "HMAC_DRBG random generator" @@ -282,6 +471,13 @@ config MBEDTLS_PSA_CRYPTO_C depends on !BUILD_WITH_TFM select CSPRNG_NEEDED +config MBEDTLS_USE_PSA_CRYPTO + bool "Use PSA APIs instead of legacy MbedTLS when possible" + default y if MBEDTLS_PSA_CRYPTO_CLIENT + help + Use PSA APIs instead of legacy MbedTLS functions in TLS/DTLS and other + "intermediate" modules such as PK, MD and Cipher. + config MBEDTLS_PSA_CRYPTO_CLIENT bool default y @@ -291,6 +487,7 @@ config MBEDTLS_PSA_CRYPTO_CLIENT config MBEDTLS_LMS_C bool "Support LMS signature schemes" depends on MBEDTLS_PSA_CRYPTO_CLIENT + depends on MBEDTLS_SHA256 select PSA_WANT_ALG_SHA_256 if MBEDTLS_PSA_CRYPTO_C @@ -353,11 +550,17 @@ endif # MBEDTLS_PSA_CRYPTO_C config MBEDTLS_NIST_KW_C bool "NIST key wrap" - depends on PSA_WANT_KEY_TYPE_AES + depends on MBEDTLS_CIPHER_AES_ENABLED help Key Wrapping mode for 128-bit block ciphers, as defined in NIST SP 800-38F. +config MBEDTLS_DHM_C + bool "Diffie-Hellman-Merkle mode" + help + Used by the following key exchanges, + DHE-RSA, DHE-PSK + config MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS bool "Legacy crypto support (private)" help diff --git a/modules/mbedtls/configs/config-mbedtls.h b/modules/mbedtls/configs/config-mbedtls.h index 226c370efc6c..cc9884b0da81 100644 --- a/modules/mbedtls/configs/config-mbedtls.h +++ b/modules/mbedtls/configs/config-mbedtls.h @@ -11,10 +11,14 @@ #ifndef MBEDTLS_CONFIG_H #define MBEDTLS_CONFIG_H +#include CONFIG_TF_PSA_CRYPTO_CONFIG_FILE + #if defined(CONFIG_MBEDTLS_USER_CONFIG) #define MBEDTLS_USER_CONFIG_FILE CONFIG_MBEDTLS_USER_CONFIG_FILE #endif +/* System support */ + #if defined(CONFIG_MBEDTLS_VERSION_C) #define MBEDTLS_VERSION_C #endif @@ -70,14 +74,26 @@ #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED #endif +#if defined(CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) +#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED +#endif + #if defined(CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) #define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED #endif +#if defined(CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) +#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED +#endif + #if defined(CONFIG_MBEDTLS_PSK_MAX_LEN) #define MBEDTLS_PSK_MAX_LEN CONFIG_MBEDTLS_PSK_MAX_LEN #endif +#if defined(CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) +#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED +#endif + #if defined(CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED #endif diff --git a/modules/mbedtls/configs/config-tf-psa-crypto.h b/modules/mbedtls/configs/config-tf-psa-crypto.h index 8f423a301448..463cfa344cd8 100644 --- a/modules/mbedtls/configs/config-tf-psa-crypto.h +++ b/modules/mbedtls/configs/config-tf-psa-crypto.h @@ -56,6 +56,20 @@ #define MBEDTLS_PLATFORM_MS_TIME_ALT #endif +#if defined(CONFIG_MBEDTLS_ECDSA_DETERMINISTIC) +#define MBEDTLS_ECDSA_DETERMINISTIC +#endif + +#if defined(CONFIG_MBEDTLS_HKDF_C) +#define MBEDTLS_HKDF_C +#endif + +/* Supported cipher modes */ + +#if defined(CONFIG_MBEDTLS_CIPHER_AES_ENABLED) +#define MBEDTLS_AES_C +#endif + #if defined(CONFIG_MBEDTLS_AES_ROM_TABLES) #define MBEDTLS_AES_ROM_TABLES #endif @@ -64,14 +78,152 @@ #define MBEDTLS_AES_FEWER_TABLES #endif +#if defined(CONFIG_MBEDTLS_CIPHER_CAMELLIA_ENABLED) +#define MBEDTLS_CAMELLIA_C +#endif + +#if defined(CONFIG_MBEDTLS_CIPHER_DES_ENABLED) +#define MBEDTLS_DES_C +#endif + +#if defined(CONFIG_MBEDTLS_CIPHER_CHACHA20_ENABLED) +#define MBEDTLS_CHACHA20_C +#endif + +#if defined(CONFIG_MBEDTLS_CIPHER_CCM_ENABLED) +#define MBEDTLS_CCM_C +#endif + +#if defined(CONFIG_MBEDTLS_CIPHER_GCM_ENABLED) +#define MBEDTLS_GCM_C +#endif + +#if defined(CONFIG_MBEDTLS_CIPHER_MODE_XTS_ENABLED) +#define MBEDTLS_CIPHER_MODE_XTS +#endif + +#if defined(CONFIG_MBEDTLS_CIPHER_MODE_CBC_ENABLED) +#define MBEDTLS_CIPHER_MODE_CBC +#endif + +#if defined(CONFIG_MBEDTLS_CIPHER_MODE_CTR_ENABLED) +#define MBEDTLS_CIPHER_MODE_CTR +#endif + +/* Supported elliptic curve libraries */ + +#if defined(CONFIG_MBEDTLS_ECDH_C) +#define MBEDTLS_ECDH_C +#endif + +#if defined(CONFIG_MBEDTLS_ECDSA_C) +#define MBEDTLS_ECDSA_C +#endif + +#if defined(CONFIG_MBEDTLS_ECJPAKE_C) +#define MBEDTLS_ECJPAKE_C +#endif + +#if defined(CONFIG_MBEDTLS_ECP_C) +#define MBEDTLS_ECP_C +#endif + +/* Supported elliptic curves */ + +#if defined(CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED) +#define MBEDTLS_ECP_DP_SECP192R1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED) +#define MBEDTLS_ECP_DP_SECP224R1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED) +#define MBEDTLS_ECP_DP_SECP256R1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED) +#define MBEDTLS_ECP_DP_SECP384R1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED) +#define MBEDTLS_ECP_DP_SECP521R1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED) +#define MBEDTLS_ECP_DP_SECP192K1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED) +#define MBEDTLS_ECP_DP_SECP224K1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED) +#define MBEDTLS_ECP_DP_SECP256K1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED) +#define MBEDTLS_ECP_DP_BP256R1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED) +#define MBEDTLS_ECP_DP_BP384R1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED) +#define MBEDTLS_ECP_DP_BP512R1_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED) +#define MBEDTLS_ECP_DP_CURVE25519_ENABLED +#endif + +#if defined(CONFIG_MBEDTLS_ECP_DP_CURVE448_ENABLED) +#define MBEDTLS_ECP_DP_CURVE448_ENABLED +#endif + #if defined(CONFIG_MBEDTLS_ECP_NIST_OPTIM) #define MBEDTLS_ECP_NIST_OPTIM #endif +/* Supported hash algorithms */ + +#if defined(CONFIG_MBEDTLS_MD5) +#define MBEDTLS_MD5_C +#endif + +#if defined(CONFIG_MBEDTLS_SHA1) +#define MBEDTLS_SHA1_C +#endif + +#if defined(CONFIG_MBEDTLS_SHA224) +#define MBEDTLS_SHA224_C +#endif + +#if defined(CONFIG_MBEDTLS_SHA256) +#define MBEDTLS_SHA256_C +#endif + #if defined(CONFIG_MBEDTLS_SHA256_SMALLER) #define MBEDTLS_SHA256_SMALLER #endif +#if defined(CONFIG_MBEDTLS_SHA384) +#define MBEDTLS_SHA384_C +#endif + +#if defined(CONFIG_MBEDTLS_SHA512) +#define MBEDTLS_SHA512_C +#endif + +#if defined(CONFIG_MBEDTLS_POLY1305) +#define MBEDTLS_POLY1305_C +#endif + +#if defined(CONFIG_MBEDTLS_CMAC) +#define MBEDTLS_CMAC_C +#endif + #if defined(CONFIG_MBEDTLS_CTR_DRBG_C) #define MBEDTLS_CTR_DRBG_C #endif @@ -84,10 +236,43 @@ #define MBEDTLS_MEMORY_DEBUG #endif +#if defined(CONFIG_MBEDTLS_CHACHAPOLY_AEAD_ENABLED) +#define MBEDTLS_CHACHAPOLY_C +#endif + +#if defined(CONFIG_MBEDTLS_GENPRIME_ENABLED) +#define MBEDTLS_GENPRIME +#endif + +#if defined(CONFIG_MBEDTLS_ENTROPY_C) +#define MBEDTLS_ENTROPY_C +#endif + +#if defined(CONFIG_MBEDTLS_CIPHER) +#define MBEDTLS_CIPHER_C +#endif + #if defined(CONFIG_MBEDTLS_MD_C) #define MBEDTLS_MD_C #endif +#if defined(CONFIG_MBEDTLS_RSA_C) +#define MBEDTLS_RSA_C +#endif + +#if defined(CONFIG_MBEDTLS_PKCS1_V15) +#define MBEDTLS_PKCS1_V15 +#endif + +#if defined(CONFIG_MBEDTLS_PKCS1_V21) +#define MBEDTLS_PKCS1_V21 +#endif + +#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ + defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) +#define MBEDTLS_DHM_C +#endif + #if defined(CONFIG_MBEDTLS_BASE64_C) #define MBEDTLS_BASE64_C #endif @@ -100,6 +285,19 @@ #define MBEDTLS_PEM_WRITE_C #endif +#if defined(MBEDTLS_DHM_C) || \ + defined(MBEDTLS_ECP_C) || \ + defined(MBEDTLS_RSA_C) || \ + defined(MBEDTLS_X509_USE_C) || \ + defined(MBEDTLS_GENPRIME) +#define MBEDTLS_BIGNUM_C +#endif + +#if defined(CONFIG_MBEDTLS_RSA_C) || \ + defined(CONFIG_MBEDTLS_X509_USE_C) +#define MBEDTLS_OID_C +#endif + #if defined(CONFIG_MBEDTLS_PK_PARSE_C) #define MBEDTLS_PK_PARSE_C #endif @@ -129,6 +327,7 @@ #define MBEDTLS_MPI_MAX_SIZE 32 /**< Maximum number of bytes for usable MPIs. */ #define MBEDTLS_ECP_WINDOW_SIZE 2 /**< Maximum window size used */ #define MBEDTLS_ECP_FIXED_POINT_OPTIM 0 /**< Enable fixed-point speed-up */ +#define MBEDTLS_ENTROPY_MAX_SOURCES 1 /**< Maximum number of sources supported */ #endif #if defined(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) @@ -156,18 +355,28 @@ #define MBEDTLS_PSA_KEY_SLOT_COUNT CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT #endif +#if defined(CONFIG_MBEDTLS_USE_PSA_CRYPTO) +#define MBEDTLS_USE_PSA_CRYPTO +#endif + #if defined(CONFIG_MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) #define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS #endif #if defined(CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT) #define MBEDTLS_PSA_CRYPTO_CLIENT +#define MBEDTLS_PSA_CRYPTO_CONFIG +#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "config-psa.h" #endif #if defined(CONFIG_MBEDTLS_NIST_KW_C) #define MBEDTLS_NIST_KW_C #endif +#if defined(CONFIG_MBEDTLS_DHM_C) +#define MBEDTLS_DHM_C +#endif + #if defined(CONFIG_MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS) #define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS #endif diff --git a/samples/net/sockets/http_get/overlay-tls.conf b/samples/net/sockets/http_get/overlay-tls.conf index 4fa30f6f8797..7e2fefc09736 100644 --- a/samples/net/sockets/http_get/overlay-tls.conf +++ b/samples/net/sockets/http_get/overlay-tls.conf @@ -6,7 +6,7 @@ CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=60000 CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=7168 CONFIG_MBEDTLS_HASH_ALL_ENABLED=y -CONFIG_PSA_WANT_ALG_CMAC=y +CONFIG_MBEDTLS_CMAC=y CONFIG_NET_SOCKETS_SOCKOPT_TLS=y CONFIG_MBEDTLS_CIPHERSUITE_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256=y From 7dc750321677fd16e9893a043b93125f5f80705a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 10:48:30 +0100 Subject: [PATCH 3248/3334] [nrf noup] Revert "mbedtls: auto-select MBEDTLS_CIPHER_AES_ENABLED when built-in in PSA" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ac6d8342728c8a63f9fea965ce41610618aeed5a. Temporarily revert an upstream change that leads to a Kconfig dependency loop with MBEDTLS_CIPHER_AES_ENABLED. This is supposed to be replaced with a better fix later. Signed-off-by: Andrzej Głąbek Signed-off-by: Tomi Fontanilles (cherry picked from commit b1e5e0e36555f53543a7136e7a441e9697592d49) --- modules/mbedtls/Kconfig.tf-psa-crypto | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.tf-psa-crypto b/modules/mbedtls/Kconfig.tf-psa-crypto index f78a6688a703..00c63a1d2c4e 100644 --- a/modules/mbedtls/Kconfig.tf-psa-crypto +++ b/modules/mbedtls/Kconfig.tf-psa-crypto @@ -172,7 +172,6 @@ config MBEDTLS_SOME_CIPHER_ENABLED config MBEDTLS_CIPHER_AES_ENABLED bool "AES block cipher" - default y if PSA_WANT_KEY_TYPE_AES && MBEDTLS_PSA_CRYPTO_C if MBEDTLS_CIPHER_AES_ENABLED From d28bd8afda9ce6878c4ff3c605420591aa300614 Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Mon, 27 Apr 2026 12:34:02 +0200 Subject: [PATCH 3249/3334] [nrf fromlist] riscv: linker: Move __global_pointer$ anchor to .sdata section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream PR #: 107703 Move the RISC-V GP (global pointer) anchor from after __data_end to immediately after the .sdata section. This positions GP at an 0x800 offset from the start of .sdata, which optimizes the 4K signed addressing window to cover the most frequently accessed small-data sections in RAM. The 0x800 offset allows both positive and negative 12-bit signed immediate offsets, effectively providing a ±2K reachable window centered on small-data symbols. This placement ensures that constantly-accessed globals in .sdata/.sbss remain within the GP relative addressing range, reducing both code size and runtime overhead on RISC-V targets that enable CONFIG_RISCV_GP. Signed-off-by: Riadh Ghaddab --- include/zephyr/arch/riscv/common/linker.ld | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/zephyr/arch/riscv/common/linker.ld b/include/zephyr/arch/riscv/common/linker.ld index 2f87e4a828da..ac6015b88746 100644 --- a/include/zephyr/arch/riscv/common/linker.ld +++ b/include/zephyr/arch/riscv/common/linker.ld @@ -275,25 +275,22 @@ SECTIONS *(.data) *(".data.*") - -#ifdef CONFIG_RISCV_GP - /* - * RISC-V architecture has 12-bit signed immediate offsets in the + *(.sdata .sdata.* .gnu.linkonce.s.*) +#if defined(CONFIG_RISCV_GP) + /* RISC-V architecture has 12-bit signed immediate offsets in the * instructions. If we can put the most commonly accessed globals * in a special 4K span of memory addressed by the GP register, then * we can access those values in a single instruction, saving both * codespace and runtime. * * Since these immediate offsets are signed, place gp 0x800 past the - * beginning of .sdata so that we can use both positive and negative + * end of .sdata so that we can use both positive and negative * offsets. */ . = ALIGN(8); PROVIDE (__global_pointer$ = . + 0x800); #endif - *(.sdata .sdata.* .gnu.linkonce.s.*) - /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ From 1f56ca1f7ef294c9e749b80aa28fb6c0490f9782 Mon Sep 17 00:00:00 2001 From: Riadh Ghaddab Date: Wed, 29 Apr 2026 11:51:21 +0200 Subject: [PATCH 3250/3334] [nrf fromlist] tests: arch: disable small-data for nrf54h20 RISC-V cores Upstream PR #: 108188 On nrf54h20 RISC-V cores, large sw_isr_table growth can place small data outside the GP-relative 12-bit range and trigger linker errors like: "relocation truncated to fit: R_RISCV_GPREL_I against ..." Disable small-data generation for these tests by adding zephyr_compile_options(-msmall-data-limit=0) Signed-off-by: Riadh Ghaddab --- tests/arch/common/gen_isr_table/CMakeLists.txt | 4 ++++ tests/arch/common/interrupt/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/arch/common/gen_isr_table/CMakeLists.txt b/tests/arch/common/gen_isr_table/CMakeLists.txt index 8e26d28c835d..7b9b59e5c54a 100644 --- a/tests/arch/common/gen_isr_table/CMakeLists.txt +++ b/tests/arch/common/gen_isr_table/CMakeLists.txt @@ -10,3 +10,7 @@ target_sources(app PRIVATE ${app_sources}) target_sources_ifdef(CONFIG_MULTI_LEVEL_INTERRUPTS app PRIVATE src/multilevel_irq.c ) + +if(CONFIG_RISCV_CORE_NORDIC_VPR) + zephyr_compile_options(-msmall-data-limit=0) +endif() diff --git a/tests/arch/common/interrupt/CMakeLists.txt b/tests/arch/common/interrupt/CMakeLists.txt index 9068dc77b5cd..19250da6f3a6 100644 --- a/tests/arch/common/interrupt/CMakeLists.txt +++ b/tests/arch/common/interrupt/CMakeLists.txt @@ -20,6 +20,10 @@ if(CONFIG_ARM64) add_compile_options(-mgeneral-regs-only) endif() +if(CONFIG_RISCV_CORE_NORDIC_VPR) + zephyr_compile_options(-msmall-data-limit=0) +endif() + target_sources_ifdef(CONFIG_DYNAMIC_INTERRUPTS app PRIVATE src/dynamic_isr.c) target_sources_ifdef(CONFIG_X86 app PRIVATE src/regular_isr.c) target_sources_ifdef(CONFIG_SHARED_INTERRUPTS app PRIVATE src/static_shared_irq.c) From 0b51210671354b282a570c74a3dbc1203f87fd61 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 14 Apr 2026 11:20:16 +0300 Subject: [PATCH 3251/3334] [nrf noup] Revert "modules: mbedtls: improve entropy gathering" This reverts commit 2752c8c97f7289335a929c35920ed35a567ca6a6. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/Kconfig.tf-psa-crypto | 9 +++++---- modules/mbedtls/zephyr_entropy.c | 23 ++++++++--------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/modules/mbedtls/Kconfig.tf-psa-crypto b/modules/mbedtls/Kconfig.tf-psa-crypto index 00c63a1d2c4e..a9678a87b23c 100644 --- a/modules/mbedtls/Kconfig.tf-psa-crypto +++ b/modules/mbedtls/Kconfig.tf-psa-crypto @@ -414,7 +414,7 @@ config MBEDTLS_PKCS5_C choice MBEDTLS_PSA_CRYPTO_RNG_SOURCE prompt "PSA crypto random source" depends on MBEDTLS_PSA_CRYPTO_C - default MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG if CSPRNG_ENABLED && !ENTROPY_NEEDS_PRNG + default MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG if CSPRNG_ENABLED default MBEDTLS_PSA_CRYPTO_LEGACY_RNG config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG @@ -433,9 +433,10 @@ config MBEDTLS_PSA_CRYPTO_LEGACY_RNG bool "Mbed TLS legacy modules (ENTROPY + [CTR|HMAC]_DRBG)" select MBEDTLS_ENTROPY_C select MBEDTLS_HMAC_DRBG_C if !MBEDTLS_CTR_DRBG_C - # Enable test random generator only if there really is no entropy driver - # that can be used to gather data. - select TEST_RANDOM_GENERATOR if !ENTROPY_HAS_DRIVER + # If there is any entropy driver in the system, then the choice would be + # CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG. If we fall here, then the only + # way to get some random data is to enable CONFIG_TEST_RANDOM_GENERATOR. + select TEST_RANDOM_GENERATOR help Use legacy Mbed TLS modules to generate random data. In this configuration the entropy module is used to gather some data and then diff --git a/modules/mbedtls/zephyr_entropy.c b/modules/mbedtls/zephyr_entropy.c index 44d6a9687a2a..e55c7750722f 100644 --- a/modules/mbedtls/zephyr_entropy.c +++ b/modules/mbedtls/zephyr_entropy.c @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include #include #include #include @@ -12,30 +11,24 @@ #if defined(CONFIG_MBEDTLS_PSA_DRIVER_GET_ENTROPY) || \ defined(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) - static int get_random_data(uint8_t *output, size_t output_size, bool allow_non_cs) { int ret = -EINVAL; -#if defined(CONFIG_ENTROPY_HAS_DRIVER) - static const struct device *const entropy_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_entropy)); - - if (!device_is_ready(entropy_dev)) { - return -ENODEV; +#if defined(CONFIG_CSPRNG_ENABLED) + ret = sys_csrand_get(output, output_size); + if (ret == 0) { + return 0; } +#endif /* CONFIG_CSPRNG_ENABLED */ - ret = entropy_get_entropy(entropy_dev, output, output_size); -#endif /* CONFIG_ENTROPY_HAS_DRIVER */ - if (ret < 0) { - if (allow_non_cs) { - sys_rand_get(output, output_size); - ret = 0; - } + if (allow_non_cs) { + sys_rand_get(output, output_size); + ret = 0; } return ret; } - #endif /* CONFIG_MBEDTLS_PSA_DRIVER_GET_ENTROPY || CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ #if defined(CONFIG_MBEDTLS_PSA_DRIVER_GET_ENTROPY) From 730adba882e890f36c27702ac7539e995bcdf9ea Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 14 Apr 2026 11:20:26 +0300 Subject: [PATCH 3252/3334] [nrf noup] Revert "modules: mbedtls: fix entropy polling" This reverts commit 21ee8273c57563c8da0cfdf6c3573f54bba86e0d. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/Kconfig.tf-psa-crypto | 6 ++-- .../mbedtls/configs/config-tf-psa-crypto.h | 7 ++-- modules/mbedtls/zephyr_entropy.c | 34 +++++++++++-------- modules/mbedtls/zephyr_init.c | 2 -- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/modules/mbedtls/Kconfig.tf-psa-crypto b/modules/mbedtls/Kconfig.tf-psa-crypto index a9678a87b23c..2dd1166eeeaf 100644 --- a/modules/mbedtls/Kconfig.tf-psa-crypto +++ b/modules/mbedtls/Kconfig.tf-psa-crypto @@ -278,6 +278,7 @@ comment "Random number generators" config MBEDTLS_CTR_DRBG_C bool "CTR_DRBG AES-256-based random generator" depends on MBEDTLS_CIPHER_AES_ENABLED + default y config MBEDTLS_HMAC_DRBG_C bool "HMAC_DRBG random generator" @@ -357,14 +358,13 @@ config MBEDTLS_HAVE_ASM config MBEDTLS_ENTROPY_C bool "Mbed TLS entropy accumulator" - select PSA_WANT_ALG_SHA_256 if !PSA_WANT_ALG_SHA_512 + depends on MBEDTLS_SHA256 || MBEDTLS_SHA384 || MBEDTLS_SHA512 help This module gathers entropy data from enabled entropy sources. It's mostly used in conjunction with CTR_DRBG or HMAC_DRBG to create a deterministic random number generator. - It requires either PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_512. -config MBEDTLS_PSA_DRIVER_GET_ENTROPY +config MBEDTLS_ENTROPY_POLL_ZEPHYR bool "Provide entropy data to Mbed TLS through entropy driver or random generator" default y depends on MBEDTLS_ENTROPY_C diff --git a/modules/mbedtls/configs/config-tf-psa-crypto.h b/modules/mbedtls/configs/config-tf-psa-crypto.h index 463cfa344cd8..542ebb8d2c29 100644 --- a/modules/mbedtls/configs/config-tf-psa-crypto.h +++ b/modules/mbedtls/configs/config-tf-psa-crypto.h @@ -25,6 +25,7 @@ #define MBEDTLS_MEMORY_BUFFER_ALLOC_C #define MBEDTLS_MEMORY_ALIGN_MULTIPLE (sizeof(void *)) #define MBEDTLS_PLATFORM_EXIT_ALT +#define MBEDTLS_NO_PLATFORM_ENTROPY #if defined(CONFIG_MBEDTLS_ZEROIZE_ALT) #define MBEDTLS_PLATFORM_ZEROIZE_ALT @@ -38,8 +39,10 @@ #define MBEDTLS_PLATFORM_SNPRINTF_ALT #endif /* defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) */ -#if defined(CONFIG_MBEDTLS_PSA_DRIVER_GET_ENTROPY) -#define MBEDTLS_PSA_DRIVER_GET_ENTROPY +#if defined(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR) +#define MBEDTLS_ENTROPY_HARDWARE_ALT +#else +#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES #endif #if defined(CONFIG_MBEDTLS_HAVE_ASM) diff --git a/modules/mbedtls/zephyr_entropy.c b/modules/mbedtls/zephyr_entropy.c index e55c7750722f..9adc308bae5e 100644 --- a/modules/mbedtls/zephyr_entropy.c +++ b/modules/mbedtls/zephyr_entropy.c @@ -5,15 +5,14 @@ */ #include +#include #include -#include -#if defined(CONFIG_MBEDTLS_PSA_DRIVER_GET_ENTROPY) || \ - defined(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) +#if defined(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR) || defined(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) static int get_random_data(uint8_t *output, size_t output_size, bool allow_non_cs) { - int ret = -EINVAL; + int ret = MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED; #if defined(CONFIG_CSPRNG_ENABLED) ret = sys_csrand_get(output, output_size); @@ -29,24 +28,31 @@ static int get_random_data(uint8_t *output, size_t output_size, bool allow_non_c return ret; } -#endif /* CONFIG_MBEDTLS_PSA_DRIVER_GET_ENTROPY || CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ +#endif /* CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR || CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ -#if defined(CONFIG_MBEDTLS_PSA_DRIVER_GET_ENTROPY) -int mbedtls_platform_get_entropy(psa_driver_get_entropy_flags_t flags, - size_t *estimate_bits, - unsigned char *output, size_t output_size) +#if defined(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR) +int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len, + size_t *olen) { - ARG_UNUSED(flags); + int ret; + uint16_t request_len = len > UINT16_MAX ? UINT16_MAX : len; + + ARG_UNUSED(data); + + if (output == NULL || olen == NULL || len == 0) { + return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED; + } - if (get_random_data(output, output_size, true) < 0) { - return -EIO; + ret = get_random_data(output, len, true); + if (ret < 0) { + return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED; } - *estimate_bits = 8 * output_size; + *olen = request_len; return 0; } -#endif /* CONFIG_MBEDTLS_PSA_DRIVER_GET_ENTROPY */ +#endif /* CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR */ #if defined(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) psa_status_t mbedtls_psa_external_get_random( diff --git a/modules/mbedtls/zephyr_init.c b/modules/mbedtls/zephyr_init.c index a4abcd7969dd..9da886d155a3 100644 --- a/modules/mbedtls/zephyr_init.c +++ b/modules/mbedtls/zephyr_init.c @@ -12,10 +12,8 @@ */ #include -#include #include #include -#include #include From 7f5b4cf6ef5a5e8619a51d123984eb3744261528 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 16 Apr 2026 10:17:57 +0300 Subject: [PATCH 3253/3334] [nrf noup] Revert "tests: adjust Mbed TLS header file path" This reverts commit 1b9636e8b49447a6a4a7353a389bd09a0b6dec5d. Signed-off-by: Tomi Fontanilles --- tests/bluetooth/host/crypto/CMakeLists.txt | 3 +-- tests/bluetooth/mesh/brg/CMakeLists.txt | 3 +-- tests/bluetooth/mesh/delayable_msg/CMakeLists.txt | 3 +-- tests/bluetooth/mesh/net/CMakeLists.txt | 3 +-- tests/bluetooth/mesh/rpl/CMakeLists.txt | 3 +-- tests/net/lib/lwm2m/lwm2m_engine/CMakeLists.txt | 4 +--- tests/net/lib/wifi_credentials_backend_psa/CMakeLists.txt | 2 +- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/bluetooth/host/crypto/CMakeLists.txt b/tests/bluetooth/host/crypto/CMakeLists.txt index cb02bd50abff..b1edecf46073 100644 --- a/tests/bluetooth/host/crypto/CMakeLists.txt +++ b/tests/bluetooth/host/crypto/CMakeLists.txt @@ -25,8 +25,7 @@ target_include_directories(mocks PUBLIC ${ZEPHYR_BASE}/subsys/bluetooth/host ${ZEPHYR_BASE}/tests/bluetooth/host ${ZEPHYR_BASE}/tests/bluetooth/host/crypto/mocks - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/include - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/include/ + ${ZEPHYR_MBEDTLS_MODULE_DIR}/include ) target_link_libraries(mocks PRIVATE test_interface) diff --git a/tests/bluetooth/mesh/brg/CMakeLists.txt b/tests/bluetooth/mesh/brg/CMakeLists.txt index 809dddfd358b..039215c66f10 100644 --- a/tests/bluetooth/mesh/brg/CMakeLists.txt +++ b/tests/bluetooth/mesh/brg/CMakeLists.txt @@ -14,8 +14,7 @@ target_sources(app target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/bluetooth/mesh - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/include - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/include/ + ${ZEPHYR_MBEDTLS_MODULE_DIR}/include ) target_compile_options(app diff --git a/tests/bluetooth/mesh/delayable_msg/CMakeLists.txt b/tests/bluetooth/mesh/delayable_msg/CMakeLists.txt index 2729668dd01e..6b955369c437 100644 --- a/tests/bluetooth/mesh/delayable_msg/CMakeLists.txt +++ b/tests/bluetooth/mesh/delayable_msg/CMakeLists.txt @@ -14,8 +14,7 @@ target_sources(app target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/bluetooth/mesh - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/include - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/include/ + ${ZEPHYR_MBEDTLS_MODULE_DIR}/include ) target_compile_options(app diff --git a/tests/bluetooth/mesh/net/CMakeLists.txt b/tests/bluetooth/mesh/net/CMakeLists.txt index 284602e218de..dd68ac06bb20 100644 --- a/tests/bluetooth/mesh/net/CMakeLists.txt +++ b/tests/bluetooth/mesh/net/CMakeLists.txt @@ -15,8 +15,7 @@ target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/bluetooth/mesh ${ZEPHYR_BASE}/subsys/bluetooth - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/include - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/include/ + ${ZEPHYR_MBEDTLS_MODULE_DIR}/include ) target_compile_options(app diff --git a/tests/bluetooth/mesh/rpl/CMakeLists.txt b/tests/bluetooth/mesh/rpl/CMakeLists.txt index faa753540516..5a627ca0f4d2 100644 --- a/tests/bluetooth/mesh/rpl/CMakeLists.txt +++ b/tests/bluetooth/mesh/rpl/CMakeLists.txt @@ -14,8 +14,7 @@ target_sources(app target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/bluetooth/mesh - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/include - ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/include/ + ${ZEPHYR_MBEDTLS_MODULE_DIR}/include ) target_compile_options(app diff --git a/tests/net/lib/lwm2m/lwm2m_engine/CMakeLists.txt b/tests/net/lib/lwm2m/lwm2m_engine/CMakeLists.txt index 4643d758785e..42887cdd49c6 100644 --- a/tests/net/lib/lwm2m/lwm2m_engine/CMakeLists.txt +++ b/tests/net/lib/lwm2m/lwm2m_engine/CMakeLists.txt @@ -16,9 +16,7 @@ zephyr_linker_sources(SECTIONS ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/iterables.ld) target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) target_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/) target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/) -target_include_directories(app PRIVATE ${ZEPHYR_MBEDTLS_MODULE_DIR}/include/) -target_include_directories(app PRIVATE ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/include/) -target_include_directories(app PRIVATE ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}/drivers/builtin/include/) +target_include_directories(app PRIVATE ${ZEPHYR_BASE}/../modules/crypto/mbedtls/include/) add_compile_definitions(CONFIG_LWM2M_ENGINE_MAX_PENDING=2) add_compile_definitions(CONFIG_LWM2M_ENGINE_MAX_REPLIES=2) diff --git a/tests/net/lib/wifi_credentials_backend_psa/CMakeLists.txt b/tests/net/lib/wifi_credentials_backend_psa/CMakeLists.txt index 605a076569c8..9403f8d6325b 100644 --- a/tests/net/lib/wifi_credentials_backend_psa/CMakeLists.txt +++ b/tests/net/lib/wifi_credentials_backend_psa/CMakeLists.txt @@ -20,7 +20,7 @@ target_sources(app zephyr_include_directories(${ZEPHYR_BASE}/subsys/testsuite/include) zephyr_include_directories(${ZEPHYR_BASE}/subsys/net/lib/wifi_credentials/) zephyr_include_directories(${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/interface/include/) -zephyr_include_directories(${ZEPHYR_MBEDTLS_3_6_MODULE_DIR}/include/) +zephyr_include_directories(${ZEPHYR_BASE}/../modules/crypto/mbedtls/include/) target_compile_options(app PRIVATE From d036fcba213ed980615175958279654f5f9dd841 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 20 Apr 2026 12:13:05 +0300 Subject: [PATCH 3254/3334] [nrf fromtree] modules: mbedtls: remove default from CONFIG_MBEDTLS_USER_CONFIG_FILE It slipped in as part of e14946ec906a8e22301491a0e45c88c06ba9704e, but it's a mistake. Signed-off-by: Tomi Fontanilles (cherry picked from commit 7a793d1f4cbee33be8c44bcbd63700cc0db1658f) --- modules/mbedtls/Kconfig.mbedtls | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/mbedtls/Kconfig.mbedtls b/modules/mbedtls/Kconfig.mbedtls index f88ebee28292..c63a533d9524 100644 --- a/modules/mbedtls/Kconfig.mbedtls +++ b/modules/mbedtls/Kconfig.mbedtls @@ -21,7 +21,6 @@ config MBEDTLS_CONFIG_FILE config MBEDTLS_USER_CONFIG_FILE string "User configuration file for Mbed TLS" - default MBEDTLS_CFG_FILE if MBEDTLS_USER_CONFIG_ENABLE help If defined, this is a header which will be included after MBEDTLS_CONFIG_FILE. This allows you to modify the default configuration, From c2f7b6f8643391f3669b0596e3675913d73a50bf Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 16 Apr 2026 10:27:14 +0300 Subject: [PATCH 3255/3334] [nrf noup] modules: mbedtls: remove Y defaults Those Kconfig options have been removed upstream, but we are temporarily keeping them (reverted the change) as we have not yet updated to Mbed TLS 4. We now include this file even when NRF_SECURITY is in use and MBEDTLS_BUILTIN is disabled, so make sure that we don't inflate build sizes for nothing. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/Kconfig.tf-psa-crypto | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/mbedtls/Kconfig.tf-psa-crypto b/modules/mbedtls/Kconfig.tf-psa-crypto index 2dd1166eeeaf..23885e2c561f 100644 --- a/modules/mbedtls/Kconfig.tf-psa-crypto +++ b/modules/mbedtls/Kconfig.tf-psa-crypto @@ -216,7 +216,6 @@ if MBEDTLS_SOME_CIPHER_ENABLED config MBEDTLS_CIPHER_MODE_CBC_ENABLED bool "Cipher Block Chaining mode (CBC) for symmetric ciphers" - default y if !NET_L2_OPENTHREAD config MBEDTLS_CIPHER_MODE_CTR_ENABLED bool "Counter Block Cipher mode (CTR) for symmetric ciphers" @@ -254,7 +253,6 @@ config MBEDTLS_SHA224 config MBEDTLS_SHA256 bool "SHA-256 hash algorithm" - default y config MBEDTLS_SHA256_SMALLER bool "Smaller SHA-256 implementation" @@ -358,7 +356,7 @@ config MBEDTLS_HAVE_ASM config MBEDTLS_ENTROPY_C bool "Mbed TLS entropy accumulator" - depends on MBEDTLS_SHA256 || MBEDTLS_SHA384 || MBEDTLS_SHA512 + select MBEDTLS_SHA256 if !(MBEDTLS_SHA384 || MBEDTLS_SHA512) help This module gathers entropy data from enabled entropy sources. It's mostly used in conjunction with CTR_DRBG or HMAC_DRBG to create From 5d0cd69f0154423d5bc5f1dc0f7374d7e42f5ae0 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 21 Apr 2026 13:19:10 +0300 Subject: [PATCH 3256/3334] [nrf fromlist] modules: tf-m: introduce CONFIG_TFM_PS_ROLLBACK_PROTECTION Upstream PR #: 106660 To have a way to tell whether PS rollback protection is enabled and also possibly to turn it off. The Kconfig option is put in a new Kconfig file dedicated to the Protected Storage, just as we have for the Crypto modules. `if BUILD_WITH_TFM` is moved to the main Kconfig file so that we don't have it in every subfile. `Kconfig.tfm.crypto_modules` is renamed to `Kconfig.tfm.crypto` for consistency with the partition name. A CMake macro is introduced to more easily pass boolean Kconfig options to TF-M and is applied to relevant places. Signed-off-by: Tomi Fontanilles --- modules/trusted-firmware-m/CMakeLists.txt | 60 ++++++++---------- modules/trusted-firmware-m/Kconfig | 6 +- ....tfm.crypto_modules => Kconfig.tfm.crypto} | 4 -- .../trusted-firmware-m/Kconfig.tfm.partitions | 4 -- modules/trusted-firmware-m/Kconfig.tfm.ps | Bin 0 -> 308 bytes 5 files changed, 32 insertions(+), 42 deletions(-) rename modules/trusted-firmware-m/{Kconfig.tfm.crypto_modules => Kconfig.tfm.crypto} (98%) create mode 100644 modules/trusted-firmware-m/Kconfig.tfm.ps diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index c7fe3b0b67d2..cdf64bd5f733 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -3,19 +3,30 @@ # # SPDX-License-Identifier: Apache-2.0 -# List of all partitions supported by TF-M -# Name must match name in 'trusted-firmware-m/tools/tfm_manifest_list.yaml' -set(TFM_VALID_PARTITIONS - TFM_PARTITION_NS_AGENT_MAILBOX - TFM_PARTITION_PROTECTED_STORAGE - TFM_PARTITION_INTERNAL_TRUSTED_STORAGE - TFM_PARTITION_CRYPTO - TFM_PARTITION_PLATFORM - TFM_PARTITION_INITIAL_ATTESTATION - TFM_PARTITION_FIRMWARE_UPDATE - ) - if(CONFIG_BUILD_WITH_TFM) + + macro(kconfig_bool_to_tfm kconfig_option tfm_option) + if(${kconfig_option}) + set(value ON) + else() + set(value OFF) + endif() + list(APPEND TFM_CMAKE_ARGS -D${tfm_option}=${value}) + endmacro() + + kconfig_bool_to_tfm(CONFIG_TFM_PARTITION_PROTECTED_STORAGE + TFM_PARTITION_PROTECTED_STORAGE) + kconfig_bool_to_tfm(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE + TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) + kconfig_bool_to_tfm(CONFIG_TFM_PARTITION_CRYPTO + TFM_PARTITION_CRYPTO) + kconfig_bool_to_tfm(CONFIG_TFM_PARTITION_PLATFORM + TFM_PARTITION_PLATFORM) + kconfig_bool_to_tfm(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION + TFM_PARTITION_INITIAL_ATTESTATION) + kconfig_bool_to_tfm(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE + TFM_PARTITION_FIRMWARE_UPDATE) + # PSA API awareness for the Non-Secure application target_compile_definitions(app PRIVATE "TFM_PSA_API") @@ -97,17 +108,11 @@ if(CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_IMAGE_NUMBER=${CONFIG_TFM_MCUBOOT_IMAGE_NUMBER}) endif() - if(CONFIG_TFM_DUMMY_PROVISIONING) - list(APPEND TFM_CMAKE_ARGS -DTFM_DUMMY_PROVISIONING=ON) - else() - list(APPEND TFM_CMAKE_ARGS -DTFM_DUMMY_PROVISIONING=OFF) - endif() + kconfig_bool_to_tfm(CONFIG_TFM_DUMMY_PROVISIONING TFM_DUMMY_PROVISIONING) - if(CONFIG_TFM_EXCEPTION_INFO_DUMP) - list(APPEND TFM_CMAKE_ARGS -DTFM_EXCEPTION_INFO_DUMP=ON) - else() - list(APPEND TFM_CMAKE_ARGS -DTFM_EXCEPTION_INFO_DUMP=OFF) - endif() + kconfig_bool_to_tfm(CONFIG_TFM_EXCEPTION_INFO_DUMP TFM_EXCEPTION_INFO_DUMP) + + kconfig_bool_to_tfm(CONFIG_TFM_PS_ROLLBACK_PROTECTION PS_ROLLBACK_PROTECTION) if(CONFIG_TFM_BL2) if(CONFIG_TFM_BL2_LOG_LEVEL_DEBUG) @@ -162,17 +167,6 @@ if(CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DSECURE_UART1=0) endif() - # Enable TFM partitions as specified in Kconfig - foreach(partition ${TFM_VALID_PARTITIONS}) - if(CONFIG_${partition}) - # list(APPEND TFM_ENABLED_PARTITIONS_ARG ${partition}) - set(val "ON") - else() - set(val "OFF") - endif() - list(APPEND TFM_CMAKE_ARGS -D${partition}=${val}) - endforeach() - set(TFM_BINARY_DIR ${CMAKE_BINARY_DIR}/tfm) set(TFM_INTERFACE_SOURCE_DIR ${TFM_BINARY_DIR}/api_ns/interface/src) diff --git a/modules/trusted-firmware-m/Kconfig b/modules/trusted-firmware-m/Kconfig index 06835cfc0759..4392a3c9523e 100644 --- a/modules/trusted-firmware-m/Kconfig +++ b/modules/trusted-firmware-m/Kconfig @@ -5,5 +5,9 @@ # SPDX-License-Identifier: Apache-2.0 rsource "Kconfig.tfm" + +if BUILD_WITH_TFM rsource "Kconfig.tfm.partitions" -rsource "Kconfig.tfm.crypto_modules" +rsource "Kconfig.tfm.crypto" +rsource "Kconfig.tfm.ps" +endif diff --git a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules b/modules/trusted-firmware-m/Kconfig.tfm.crypto similarity index 98% rename from modules/trusted-firmware-m/Kconfig.tfm.crypto_modules rename to modules/trusted-firmware-m/Kconfig.tfm.crypto index 02d3580c22f3..e19b53559a8a 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules +++ b/modules/trusted-firmware-m/Kconfig.tfm.crypto @@ -3,8 +3,6 @@ # Copyright (c) 2021 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BUILD_WITH_TFM - if TFM_PARTITION_CRYPTO config TFM_CRYPTO_RNG_MODULE_ENABLED @@ -89,5 +87,3 @@ config TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED Note that key agreement is under key derivation in the current implementation. endif # TFM_PARTITION_CRYPTO - -endif # BUILD_WITH_TFM diff --git a/modules/trusted-firmware-m/Kconfig.tfm.partitions b/modules/trusted-firmware-m/Kconfig.tfm.partitions index d16ba86d8c21..eb4f8ee1d8ae 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.partitions +++ b/modules/trusted-firmware-m/Kconfig.tfm.partitions @@ -3,8 +3,6 @@ # Copyright (c) 2021 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BUILD_WITH_TFM - config TFM_PARTITION_PROTECTED_STORAGE bool "Secure partition 'Protected Storage'" depends on TFM_PARTITION_PLATFORM # Specifically TFM_SP_PLATFORM_NV_COUNTER service @@ -89,5 +87,3 @@ config TFM_PARTITION_LOG_LEVEL_ERROR config TFM_PARTITION_LOG_LEVEL_SILENCE bool "Off" endchoice - -endif # BUILD_WITH_TFM diff --git a/modules/trusted-firmware-m/Kconfig.tfm.ps b/modules/trusted-firmware-m/Kconfig.tfm.ps new file mode 100644 index 0000000000000000000000000000000000000000..cce2078b234eacdc9c0b272d3e15f33345b68ebb GIT binary patch literal 308 zcmaivv2KGf6h&v=S3HHK9f%@^4&7WrD^wZ~_RtL(`vF!Q8@bMqzptyPQ-|*79-W(G z<+ocf%Np@PJz{w%pYY^^HVQdijPg!jRrCQFXOJWBkDo8 zQSJ`_W=8S)G4^Z_jcB^l*bkkkD^VXuF1mre)c{F6o8`{&ap>Cig;nprWEw#>d2ewy zcxxxA&bS31Nk!w`4l+%%yxNF2$X2o&WQetslO+s)d7M*!TnYQTf;94UNiKw&4AJ~J N_W Date: Tue, 8 Oct 2024 11:00:28 +0200 Subject: [PATCH 3257/3334] [nrf fromlist] samples: tfm_integration: use Zephyr app to run NS regression tests Upstream PR #: 106660 "tfm_regression_test" sample used TF-M default testing method where an external OS (named RTX) is used to run non-secure regression tests. In this scenario Zephyr OS is completely ignored. This commit replaces RTX with Zephyr's app as container of the NS code. This pattern reflects what usually happens in Zephyr when a NS application is built. Signed-off-by: Valerio Setti Signed-off-by: Tomi Fontanilles --- .../tfm_regression_test/CMakeLists.txt | 306 +++++++++++++++--- .../tfm_regression_test/Kconfig | 169 ++++++++++ .../tfm_regression_test/README.rst | 3 - .../boards/max32657evkit_max32657_ns.conf | 14 - .../nucleo_l552ze_q_stm32l552xx_ns.overlay | 55 ---- .../tfm_regression_test/prj.conf | 1 - .../tfm_regression_test/sample.yaml | 42 +-- .../tfm_regression_test/src/main.c | 7 +- 8 files changed, 451 insertions(+), 146 deletions(-) create mode 100644 samples/tfm_integration/tfm_regression_test/Kconfig delete mode 100644 samples/tfm_integration/tfm_regression_test/boards/max32657evkit_max32657_ns.conf delete mode 100644 samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay diff --git a/samples/tfm_integration/tfm_regression_test/CMakeLists.txt b/samples/tfm_integration/tfm_regression_test/CMakeLists.txt index 26d97709929b..27a2148206f5 100644 --- a/samples/tfm_integration/tfm_regression_test/CMakeLists.txt +++ b/samples/tfm_integration/tfm_regression_test/CMakeLists.txt @@ -10,64 +10,274 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(tfm_regression_test) -target_sources(app PRIVATE src/main.c) +set(TFM_TEST_REG_TEST_PATH ${ZEPHYR_TF_M_TESTS_MODULE_DIR}/tests_reg/test) +set(TFM_TEST_LIB_PATH ${ZEPHYR_TF_M_TESTS_MODULE_DIR}/lib) +set(TFM_API_NS_PATH ${CMAKE_BINARY_DIR}/tfm/api_ns) -get_target_property(TFM_BINARY_DIR tfm TFM_BINARY_DIR) -get_target_property(TFM_NS_BIN_FILE tfm TFM_NS_BIN_FILE) -get_target_property(TFM_NS_HEX_FILE tfm TFM_NS_HEX_FILE) -get_target_property(TFM_NS_SIGNED_BIN_FILE tfm TFM_NS_SIGNED_BIN_FILE) +macro(add_inc_and_src_if_def) + cmake_parse_arguments( + ARG + "" # options - none here + "KCONFIG" # one_value_keywords + "INC;SRC;GLOB_SRC" # multi_value_keywords + ${ARGN} + ) -get_target_property(TFM_TOOLCHAIN_PATH tfm TFM_TOOLCHAIN_PATH) -get_target_property(TFM_TOOLCHAIN_PREFIX tfm TFM_TOOLCHAIN_PREFIX) -get_target_property(TFM_TOOLCHAIN_NS_FILE tfm TFM_TOOLCHAIN_NS_FILE) + if(${ARG_KCONFIG}) + # Append include directories + target_include_directories(app PRIVATE ${ARG_INC}) + # Append source files + file(GLOB new_sources ${ARG_GLOB_SRC}) + list(APPEND new_sources ${ARG_SRC}) + target_sources(app PRIVATE ${new_sources}) + endif() +endmacro() -set(TFM_TEST_REPO_PATH ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/../tf-m-tests) +message(STATUS "Enabled:") -set(TFM_TEST_DIR "${TFM_TEST_REPO_PATH}/tests_reg/test/secure_regression") -set(TFM_TEST_CONFIG_FILE "${TFM_TEST_REPO_PATH}/tests_reg/test/config/config.cmake") +macro(def_if_def kconfig build_flag) + if(${kconfig}) + target_compile_definitions(app PRIVATE -D${build_flag}) + message(STATUS " ${build_flag}") + endif() +endmacro() -set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS - -DCONFIG_TFM_TEST_DIR=${TFM_TEST_DIR} +target_sources(app PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/src/main.c ) -set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS - -DCONFIG_TFM_TEST_CONFIG_FILE=${TFM_TEST_CONFIG_FILE} +add_inc_and_src_if_def( + KCONFIG + TRUE # Not a real Kconfig, because we always need the following + GLOB_SRC + ${TFM_TEST_REG_TEST_PATH}/secure_regression/*.c + ${TFM_TEST_REG_TEST_PATH}/ns_regression/*.c + ${TFM_TEST_REG_TEST_PATH}/framework/*.c + SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/common/suites/client_api_tests.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/common/suites/irq_test.c + INC + ${TFM_TEST_LIB_PATH}/log + ${TFM_TEST_LIB_PATH}/os_wrapper/ + ${TFM_TEST_REG_TEST_PATH}/ns_regression + ${TFM_TEST_REG_TEST_PATH}/secure_regression + ${TFM_TEST_REG_TEST_PATH}/framework + ${TFM_TEST_REG_TEST_PATH}/secure_fw/common_test_services/tfm_secure_client_2 + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/common/suites + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/common/service + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/common + ${TFM_API_NS_PATH}/platform/include + ${TFM_API_NS_PATH}/interface/include ) -# Let TF-M install Mbed TLS (3.6.5) include files in the binary directory. -set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS - -DTFM_INSTALL_MBEDTLS_HEADERS=ON +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_PARTITION_CRYPTO + INC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/crypto + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/crypto/non_secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/crypto/secure + GLOB_SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/crypto/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/crypto/non_secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/crypto/secure/*.c ) +def_if_def(CONFIG_TFM_PARTITION_CRYPTO TEST_NS_CRYPTO) +def_if_def(CONFIG_TFM_PARTITION_CRYPTO TEST_S_CRYPTO) +def_if_def(CONFIG_TFM_PARTITION_CRYPTO TFM_CRYPTO_TEST_UNSUPPORTED_ALG) +def_if_def(CONFIG_TFM_PARTITION_CRYPTO TFM_CRYPTO_TEST_SINGLE_PART_FUNCS) +def_if_def(CONFIG_PSA_WANT_ALG_CBC_NO_PADDING TFM_CRYPTO_TEST_ALG_CBC) +def_if_def(CONFIG_PSA_WANT_ALG_CCM TFM_CRYPTO_TEST_ALG_CCM) +def_if_def(CONFIG_PSA_WANT_ALG_CFB TFM_CRYPTO_TEST_ALG_CFB) +def_if_def(CONFIG_PSA_WANT_ALG_CFB TFM_CRYPTO_TEST_ALG_CFB) +def_if_def(CONFIG_PSA_WANT_ALG_ECB_NO_PADDING TFM_CRYPTO_TEST_ALG_ECB) +def_if_def(CONFIG_PSA_WANT_ALG_CTR TFM_CRYPTO_TEST_ALG_CTR) +def_if_def(CONFIG_PSA_WANT_ALG_OFB TFM_CRYPTO_TEST_ALG_OFB) +def_if_def(CONFIG_PSA_WANT_ALG_OFB TFM_CRYPTO_TEST_ALG_OFB) +def_if_def(CONFIG_PSA_WANT_ALG_GCM TFM_CRYPTO_TEST_ALG_GCM) +def_if_def(CONFIG_PSA_WANT_ALG_SHA_224 TFM_CRYPTO_TEST_ALG_SHA_224) +def_if_def(CONFIG_PSA_WANT_ALG_SHA_384 TFM_CRYPTO_TEST_ALG_SHA_384) +def_if_def(CONFIG_PSA_WANT_ALG_SHA_512 TFM_CRYPTO_TEST_ALG_SHA_512) +def_if_def(CONFIG_PSA_WANT_ALG_HKDF TFM_CRYPTO_TEST_HKDF) +def_if_def(CONFIG_PSA_WANT_ALG_ECDH TFM_CRYPTO_TEST_ECDH) +def_if_def(CONFIG_PSA_WANT_ALG_RSA_PSS TFM_CRYPTO_TEST_ALG_RSASSA_PSS_VERIFICATION) +def_if_def(CONFIG_PSA_WANT_KEY_TYPE_CHACHA20 TFM_CRYPTO_TEST_CHACHA20) +def_if_def(CONFIG_PSA_WANT_ALG_CHACHA20_POLY1305 TFM_CRYPTO_TEST_ALG_CHACHA20_POLY1305) +def_if_def(CONFIG_PSA_WANT_ALG_DETERMINISTIC_ECDSA TFM_CRYPTO_TEST_ALG_DETERMINISTIC_ECDSA) +def_if_def(CONFIG_PSA_WANT_ALG_ECDSA TFM_CRYPTO_TEST_ALG_ECDSA) -include(ExternalProject) - -ExternalProject_Add(tfm_regression_test_app - SOURCE_DIR ${TFM_TEST_REPO_PATH}/tests_reg - BINARY_DIR ${PROJECT_BINARY_DIR}/tfm_ns - CONFIGURE_COMMAND - ${CMAKE_COMMAND} - -G ${CMAKE_GENERATOR} - -S ${TFM_TEST_REPO_PATH}/tests_reg - -B ${PROJECT_BINARY_DIR}/tfm_ns - -DPython3_EXECUTABLE=${PYTHON_EXECUTABLE} - -DCONFIG_SPE_PATH=${TFM_BINARY_DIR}/api_ns - -DTFM_TOOLCHAIN_FILE=cmake/${TFM_TOOLCHAIN_NS_FILE} - -DCROSS_COMPILE=${TFM_TOOLCHAIN_PATH}/${TFM_TOOLCHAIN_PREFIX} - -DQCBOR_PATH${QCBOR_PATH_TYPE}=${CONFIG_TFM_QCBOR_PATH} - -DCMAKE_BUILD_TYPE=RelWithDebInfo - BUILD_COMMAND ${CMAKE_COMMAND} --build . - INSTALL_COMMAND "" - BUILD_ALWAYS True - USES_TERMINAL_BUILD True - WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tfm_ns - DEPENDS tfm - BUILD_BYPRODUCTS - ${TFM_NS_HEX_FILE} - ${TFM_NS_BIN_FILE} - ${TFM_NS_SIGNED_BIN_FILE} +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_PARTITION_PROTECTED_STORAGE + INC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/ps/non_secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/ps/secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/ps/secure/nv_counters + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/ps/service/ + ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/secure_fw/partitions/protected_storage + GLOB_SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/ps/non_secure/*.c + SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/ps/secure/psa_ps_s_interface_testsuite.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/ps/secure/psa_ps_s_reliability_testsuite.c ) +def_if_def(CONFIG_TFM_PARTITION_PROTECTED_STORAGE TEST_NS_PS) +def_if_def(CONFIG_TFM_PARTITION_PROTECTED_STORAGE TEST_S_PS) -add_dependencies(app tfm_regression_test_app) +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_PS_ROLLBACK_PROTECTION + SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/ps/secure/ps_rollback_protection_testsuite.c +) +def_if_def(CONFIG_TFM_PS_ROLLBACK_PROTECTION PS_TEST_NV_COUNTERS) +def_if_def(CONFIG_TFM_PS_ROLLBACK_PROTECTION PLATFORM_DEFAULT_NV_COUNTERS) + +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE + INC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/its/non_secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/its/secure + GLOB_SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/its/non_secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/its/secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/its/*.c +) +def_if_def(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE TEST_NS_ITS) +def_if_def(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE TEST_S_ITS) +def_if_def(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) +def_if_def(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE TFM_INTERNAL_TRUSTED_STORAGE_SERVICE) + +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_PARTITION_PLATFORM + INC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/platform/non_secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/platform/secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/platform/ + GLOB_SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/platform/non_secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/platform/secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/platform/*.c +) +def_if_def(CONFIG_TFM_PARTITION_PLATFORM TEST_NS_PLATFORM) +def_if_def(CONFIG_TFM_PARTITION_PLATFORM TEST_S_PLATFORM) + +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_PARTITION_INITIAL_ATTESTATION + INC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation/non_secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation/secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation/ext/qcbor_util + ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/secure_fw/partitions/initial_attestation + ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/secure_fw/spm/include/boot + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/inc + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/inc + SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation/non_secure/attest_asymmetric_ns_interface_testsuite.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation/secure/attest_asymmetric_s_interface_testsuite.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation/attest_token_decode_asymmetric.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation/attest_token_decode_common.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/attestation/attest_token_test.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/ieee754.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/qcbor_decode.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/qcbor_encode.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/qcbor_err_to_str.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/UsefulBuf.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_encrypt_dec.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_encrypt_enc.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_key.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_mac_compute.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_mac_validate.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_parameters.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_qcbor_gap.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_recipient_dec_esdh.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_recipient_dec_keywrap.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_recipient_enc_esdh.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_recipient_enc_keywrap.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_sign1_sign.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_sign1_verify.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_sign_eddsa.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_sign_main.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_sign_restart.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_verify_eddsa.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_verify_main.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_sign_sign.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_sign_verify.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_util.c +) +set_source_files_properties( + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/ieee754.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/qcbor_decode.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/qcbor_encode.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/qcbor_err_to_str.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/qcbor-src/src/UsefulBuf.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_encrypt_dec.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_encrypt_enc.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_key.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_mac_compute.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_mac_validate.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_parameters.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_qcbor_gap.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_recipient_dec_esdh.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_recipient_dec_keywrap.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_recipient_enc_esdh.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_recipient_enc_keywrap.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_sign1_sign.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_sign1_verify.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_sign_eddsa.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_sign_main.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_sign_restart.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_verify_eddsa.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_signature_verify_main.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_sign_sign.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_sign_verify.c + ${CMAKE_BINARY_DIR}/tfm/lib/ext/t_cose-src/src/t_cose_util.c + PROPERTIES GENERATED TRUE +) +def_if_def(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION TEST_NS_ATTESTATION) +def_if_def(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION TEST_S_ATTESTATION) + +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_PARTITION_FIRMWARE_UPDATE + INC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/fwu/mcuboot/non_secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/fwu/mcuboot/secure + GLOB_SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/fwu/mcuboot/non_secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/fwu/mcuboot/secure/*.c +) +def_if_def(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE TEST_NS_FWU) +def_if_def(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE TEST_S_FWU) + +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_IPC + INC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/ipc/non_secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/ipc/secure + GLOB_SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/ipc/non_secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/ipc/secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/ipc/*.c +) +def_if_def(CONFIG_TFM_IPC TEST_NS_IPC) +def_if_def(CONFIG_TFM_IPC TEST_S_IPC) + +add_inc_and_src_if_def( + KCONFIG + CONFIG_TFM_SFN + INC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/sfn/non_secure + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/sfn/secure + GLOB_SRC + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/sfn/non_secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/sfn/secure/*.c + ${TFM_TEST_REG_TEST_PATH}/secure_fw/suites/spm/sfn/*.c +) +def_if_def(CONFIG_TFM_SFN TEST_NS_SFN_BACKEND) +def_if_def(CONFIG_TFM_SFN TEST_S_SFN_BACKEND) diff --git a/samples/tfm_integration/tfm_regression_test/Kconfig b/samples/tfm_integration/tfm_regression_test/Kconfig new file mode 100644 index 000000000000..ec7b991b864f --- /dev/null +++ b/samples/tfm_integration/tfm_regression_test/Kconfig @@ -0,0 +1,169 @@ +# Copyright (c) 2026, BayLibre SAS +# SPDX-License-Identifier: Apache-2.0 + +config TFM_PROFILE_TYPE_NOT_SET + imply PSA_WANT_ALG_CBC_NO_PADDING + imply PSA_WANT_ALG_CBC_PKCS7 + imply PSA_WANT_ALG_CCM + imply PSA_WANT_ALG_CMAC + imply PSA_WANT_ALG_CFB + imply PSA_WANT_ALG_CTR + imply PSA_WANT_ALG_DETERMINISTIC_ECDSA + imply PSA_WANT_ALG_ECB_NO_PADDING + imply PSA_WANT_ALG_ECDH + imply PSA_WANT_ALG_ECDSA + imply PSA_WANT_ALG_GCM + imply PSA_WANT_ALG_HKDF + imply PSA_WANT_ALG_HMAC + imply PSA_WANT_ALG_OFB + imply PSA_WANT_ALG_PBKDF2_HMAC + imply PSA_WANT_ALG_RSA_OAEP + imply PSA_WANT_ALG_RSA_PKCS1V15_CRYPT + imply PSA_WANT_ALG_RSA_PKCS1V15_SIGN + imply PSA_WANT_ALG_RSA_PSS + imply PSA_WANT_ALG_SHA_224 + imply PSA_WANT_ALG_SHA_256 + imply PSA_WANT_ALG_SHA_384 + imply PSA_WANT_ALG_SHA_512 + imply PSA_WANT_ALG_TLS12_PRF + imply PSA_WANT_ALG_TLS12_PSK_TO_MS + imply PSA_WANT_ECC_MONTGOMERY_255 + imply PSA_WANT_ECC_MONTGOMERY_448 + imply PSA_WANT_ECC_SECP_K1_256 + imply PSA_WANT_ECC_SECP_R1_256 + imply PSA_WANT_ECC_SECP_R1_384 + imply PSA_WANT_ECC_SECP_R1_521 + imply PSA_WANT_KEY_TYPE_DERIVE + imply PSA_WANT_KEY_TYPE_HMAC + imply PSA_WANT_KEY_TYPE_AES + imply PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + imply PSA_WANT_KEY_TYPE_RAW_DATA + imply PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + imply PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC + imply PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT + imply PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT + imply PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE + help + Automatically select crypto features which are enabled in TF-M when + no profile is specified. These are taken from + "lib/ext/mbedcrypto/crypto_config_default.h". + + +config TFM_PROFILE_TYPE_SMALL + imply PSA_WANT_ALG_CCM + imply PSA_WANT_ALG_HMAC + imply PSA_WANT_ALG_SHA_224 + imply PSA_WANT_ALG_SHA_256 + imply PSA_WANT_ALG_TLS12_PRF + imply PSA_WANT_ALG_TLS12_PSK_TO_MS + imply PSA_WANT_KEY_TYPE_DERIVE + imply PSA_WANT_KEY_TYPE_HMAC + imply PSA_WANT_KEY_TYPE_AES + imply PSA_WANT_KEY_TYPE_RAW_DATA + help + Automatically select crypto features which are enabled in TF-M when + small profile is specified. These are taken from + "lib/ext/mbedcrypto/crypto_config_profile_small.h". + +config TFM_PROFILE_TYPE_MEDIUM + imply PSA_WANT_ALG_CCM + imply PSA_WANT_ALG_ECDH + imply PSA_WANT_ALG_ECDSA + imply PSA_WANT_ALG_HKDF + imply PSA_WANT_ALG_HMAC + imply PSA_WANT_ALG_SHA_224 + imply PSA_WANT_ALG_SHA_256 + imply PSA_WANT_ALG_TLS12_PRF + imply PSA_WANT_ALG_TLS12_PSK_TO_MS + imply PSA_WANT_ECC_SECP_R1_256 + imply PSA_WANT_KEY_TYPE_DERIVE + imply PSA_WANT_KEY_TYPE_HMAC + imply PSA_WANT_KEY_TYPE_AES + imply PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + imply PSA_WANT_KEY_TYPE_RAW_DATA + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + help + Automatically select crypto features which are enabled in TF-M when + medium profile is specified. These are taken from + "lib/ext/mbedcrypto/crypto_config_profile_medium.h". + +config TFM_PROFILE_TYPE_AROTLESS + imply PSA_WANT_ALG_CCM + imply PSA_WANT_ALG_ECDH + imply PSA_WANT_ALG_ECDSA + imply PSA_WANT_ALG_HKDF + imply PSA_WANT_ALG_HMAC + imply PSA_WANT_ALG_SHA_224 + imply PSA_WANT_ALG_SHA_256 + imply PSA_WANT_ALG_TLS12_PRF + imply PSA_WANT_ALG_TLS12_PSK_TO_MS + imply PSA_WANT_ECC_SECP_R1_256 + imply PSA_WANT_KEY_TYPE_DERIVE + imply PSA_WANT_KEY_TYPE_HMAC + imply PSA_WANT_KEY_TYPE_AES + imply PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + imply PSA_WANT_KEY_TYPE_RAW_DATA + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + help + Automatically select crypto features which are enabled in TF-M when + medium-arotless profile is specified. These are taken from + "lib/ext/mbedcrypto/crypto_config_profile_medium.h". + +config TFM_PROFILE_TYPE_LARGE + imply PSA_WANT_ALG_CBC_NO_PADDING + imply PSA_WANT_ALG_CBC_PKCS7 + imply PSA_WANT_ALG_CCM + imply PSA_WANT_ALG_CMAC + imply PSA_WANT_ALG_CFB + imply PSA_WANT_ALG_CTR + imply PSA_WANT_ALG_DETERMINISTIC_ECDSA + imply PSA_WANT_ALG_ECDH + imply PSA_WANT_ALG_ECDSA + imply PSA_WANT_ALG_GCM + imply PSA_WANT_ALG_HKDF + imply PSA_WANT_ALG_HMAC + imply PSA_WANT_ALG_PBKDF2_HMAC + imply PSA_WANT_ALG_RSA_OAEP + imply PSA_WANT_ALG_RSA_PKCS1V15_CRYPT + imply PSA_WANT_ALG_RSA_PKCS1V15_SIGN + imply PSA_WANT_ALG_RSA_PSS + imply PSA_WANT_ALG_SHA_224 + imply PSA_WANT_ALG_SHA_256 + imply PSA_WANT_ALG_SHA_384 + imply PSA_WANT_ALG_SHA_512 + imply PSA_WANT_ALG_TLS12_PRF + imply PSA_WANT_ALG_TLS12_PSK_TO_MS + imply PSA_WANT_ECC_SECP_K1_256 + imply PSA_WANT_ECC_SECP_R1_256 + imply PSA_WANT_ECC_SECP_R1_384 + imply PSA_WANT_KEY_TYPE_DERIVE + imply PSA_WANT_KEY_TYPE_HMAC + imply PSA_WANT_KEY_TYPE_AES + imply PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + imply PSA_WANT_KEY_TYPE_RAW_DATA + imply PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + imply PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC + imply PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT + imply PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT + imply PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE + help + Automatically select crypto features which are enabled in TF-M when + large profile is specified. These are taken from + "lib/ext/mbedcrypto/crypto_config_profile_large.h". + +source "Kconfig.zephyr" diff --git a/samples/tfm_integration/tfm_regression_test/README.rst b/samples/tfm_integration/tfm_regression_test/README.rst index 047bd79b2216..3d6924c140ef 100644 --- a/samples/tfm_integration/tfm_regression_test/README.rst +++ b/samples/tfm_integration/tfm_regression_test/README.rst @@ -8,9 +8,6 @@ Overview Run both the Secure and Non-secure TF-M Regression tests using the Zephyr build system. -The build system will replace the Zephyr application with the Non-Secure TF-M test application, -while the Secure tests will be included in the TF-M build itself. - The TF-M regression tests are implemented in the tf-m-tests repo: https://git.trustedfirmware.org/TF-M/tf-m-tests.git/ This sample is available for platforms that are supported in the trusted-firmware-m repo: https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/ diff --git a/samples/tfm_integration/tfm_regression_test/boards/max32657evkit_max32657_ns.conf b/samples/tfm_integration/tfm_regression_test/boards/max32657evkit_max32657_ns.conf deleted file mode 100644 index 8d42e1c2c12c..000000000000 --- a/samples/tfm_integration/tfm_regression_test/boards/max32657evkit_max32657_ns.conf +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2025 Analog Devices, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -# MAX32657 only contains one UART. -# It is allocated to NS. -# Therefore, disable S side regression test. -CONFIG_TFM_REGRESSION_S=n - -# MAX32657 currently only supports SFN -# and isolation level 1 -CONFIG_TFM_SFN=y -CONFIG_TFM_ISOLATION_LEVEL=1 diff --git a/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay b/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay deleted file mode 100644 index 2760c3f22ca8..000000000000 --- a/samples/tfm_integration/tfm_regression_test/boards/nucleo_l552ze_q_stm32l552xx_ns.overlay +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2023 STMicroelectronics - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* This partition table could be used along with TFM configuration: - * - TEST_S=ON (REGRESSION) - * - TFM_PSA_API=ON (IPC) - * - */ - -/ { - chosen { - zephyr,code-partition = &slot0_ns_partition; - }; -}; - -/delete-node/ &slot1_partition; -/delete-node/ &slot1_ns_partition; - -&flash0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 DT_SIZE_K(80)>; - read-only; - }; - - /* Secure image primary slot */ - slot0_partition: partition@14000 { - label = "image-0"; - reg = <0x00014000 DT_SIZE_K(224)>; - }; - - /* Non-secure image primary slot */ - slot1_partition: partition@4c000 { - label = "image-1"; - reg = <0x0004c000 DT_SIZE_K(172)>; - }; - - /* - * The flash starting at 0x7F000 and ending at - * 0x80000 is reserved for the application. - */ - storage_partition: partition@77000 { - label = "storage"; - reg = <0x0007f000 DT_SIZE_K(40)>; - }; - }; -}; diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index 0a6573f811c7..0669c38a8f27 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -6,7 +6,6 @@ CONFIG_BUILD_WITH_TFM=y CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -CONFIG_TFM_USE_NS_APP=y CONFIG_TFM_REGRESSION_S=y CONFIG_TFM_REGRESSION_NS=y diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/samples/tfm_integration/tfm_regression_test/sample.yaml index e94a2d490aae..69f45bac257f 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/samples/tfm_integration/tfm_regression_test/sample.yaml @@ -4,26 +4,21 @@ common: - mcuboot modules: - tf-m-tests - platform_allow: - # Disabling this platform as there are currently build issues at link - # time with 'tfm_platform_gpio_pin_mcu_select'. Since NS app is the official - # one from TF-M the fix has to be sumbitted upstream. - # - nrf5340dk/nrf5340/cpuapp/ns - - nrf9160dk/nrf9160/ns - - nrf9161dk/nrf9161/ns - - v2m_musca_s1/musca_s1/ns - - stm32h573i_dk/stm32h573xx/ns - - frdm_mcxn947/mcxn947/cpu0/ns - - frdm_mcxa577/mcxa577/ns + filter: CONFIG_BUILD_WITH_TFM integration_platforms: - - nrf9161dk/nrf9161/ns + - mps2/an521/cpu0/ns harness: console harness_config: type: multi_line + ordered: true regex: - - "Non-Secure system starting..." - - "\\#\\#\\#\\# Execute test suites for the Non-secure area \\#\\#\\#\\#" - - "\\*\\*\\* End of Non-secure test suites \\*\\*\\*" + # There's an ANSI escape code between has and PASSED: \x1b[32m (green color). The log file + # strips ANSI sequences, which is why it looks clean there. But harness.handle() receives + # the raw line with ANSI codes — so has PASSED never matches as a literal string. + - "Test suite 'PSA protected storage NS interface tests.*' has.*PASSED" + - "Test suite 'PSA internal trusted storage NS interface tests.*' has.*PASSED" + - "Test suite 'Crypto non-secure interface test.*' has.*PASSED" + - "Test suite 'Platform Service Non-Secure interface tests.*' has.*PASSED" sample: name: "TFM Regression Test" @@ -33,15 +28,20 @@ tests: extra_args: - CONFIG_TFM_IPC=y - CONFIG_TFM_ISOLATION_LEVEL=1 - timeout: 200 + timeout: 30 sample.tfm.regression_ipc_lvl2: - timeout: 200 + timeout: 30 - sample.tfm.regression_sfn: - platform_allow: - - max32657evkit/max32657/ns + sample.tfm.regression_sfn.profile_not_set: extra_args: - CONFIG_TFM_SFN=y - CONFIG_TFM_ISOLATION_LEVEL=1 - timeout: 200 + timeout: 30 + + sample.tfm.regression_sfn.profile_small: + extra_args: + - CONFIG_TFM_SFN=y + - CONFIG_TFM_ISOLATION_LEVEL=1 + - CONFIG_TFM_PROFILE_TYPE_SMALL=y + timeout: 30 diff --git a/samples/tfm_integration/tfm_regression_test/src/main.c b/samples/tfm_integration/tfm_regression_test/src/main.c index 7241cf79472f..7979f41f7bed 100644 --- a/samples/tfm_integration/tfm_regression_test/src/main.c +++ b/samples/tfm_integration/tfm_regression_test/src/main.c @@ -5,12 +5,11 @@ */ #include +#include "non_secure_suites.h" int main(void) { - printk("Should not be printed, expected TF-M's NS application to be run instead.\n"); - k_panic(); + ns_reg_test_start(); - for (;;) { - } + return 0; } From e4976da9183005753763ff72284a44a45f6339dc Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 17 Apr 2026 11:48:59 +0200 Subject: [PATCH 3258/3334] [nrf fromlist] samples: tfm_integration: do not use isolation level 2 by default Upstream PR #: 106660 - Move selection of the isolation level to individual test cases. - Slightly reshape tests naming in "testcase.yaml". Signed-off-by: Valerio Setti --- samples/tfm_integration/tfm_regression_test/prj.conf | 4 ---- .../tfm_integration/tfm_regression_test/sample.yaml | 11 +++++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index 0669c38a8f27..14f63fa7fe2d 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -15,7 +15,3 @@ CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE=y CONFIG_TFM_PARTITION_CRYPTO=y CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=n CONFIG_TFM_PARTITION_PLATFORM=y - -# Enable IPC mode and isolation level 2 by default -CONFIG_TFM_IPC=y -CONFIG_TFM_ISOLATION_LEVEL=2 diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/samples/tfm_integration/tfm_regression_test/sample.yaml index 69f45bac257f..6639fb81d017 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/samples/tfm_integration/tfm_regression_test/sample.yaml @@ -24,22 +24,25 @@ sample: name: "TFM Regression Test" tests: - sample.tfm.regression_ipc_lvl1: + tf-m.regression.ipc.lvl1: extra_args: - CONFIG_TFM_IPC=y - CONFIG_TFM_ISOLATION_LEVEL=1 timeout: 30 - sample.tfm.regression_ipc_lvl2: + tf-m.regression.ipc.lvl2: + extra_args: + - CONFIG_TFM_IPC=y + - CONFIG_TFM_ISOLATION_LEVEL=2 timeout: 30 - sample.tfm.regression_sfn.profile_not_set: + tf-m.regression.sfn.profile.not_set: extra_args: - CONFIG_TFM_SFN=y - CONFIG_TFM_ISOLATION_LEVEL=1 timeout: 30 - sample.tfm.regression_sfn.profile_small: + tf-m.regression.sfn.profile.small: extra_args: - CONFIG_TFM_SFN=y - CONFIG_TFM_ISOLATION_LEVEL=1 From c70754074d94e2fffa8881d821b13eafa7f57803 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 17 Apr 2026 12:10:27 +0200 Subject: [PATCH 3259/3334] [nrf fromlist] samples: tfm_integration: minor cleanup Upstream PR #: 106660 remove unnecessary Kconfigs from the configuration file Signed-off-by: Valerio Setti Signed-off-by: Tomi Fontanilles --- samples/tfm_integration/tfm_regression_test/prj.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index 14f63fa7fe2d..f57edec4996f 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -4,8 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 # -CONFIG_BUILD_WITH_TFM=y -CONFIG_TFM_PROFILE_TYPE_NOT_SET=y CONFIG_TFM_REGRESSION_S=y CONFIG_TFM_REGRESSION_NS=y @@ -13,5 +11,4 @@ CONFIG_TFM_REGRESSION_NS=y CONFIG_TFM_PARTITION_PROTECTED_STORAGE=y CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE=y CONFIG_TFM_PARTITION_CRYPTO=y -CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=n CONFIG_TFM_PARTITION_PLATFORM=y From 2568d53abecfc7b855ded83140cae28e0e7cd1e0 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Mon, 20 Apr 2026 13:45:31 +0200 Subject: [PATCH 3260/3334] [nrf fromlist] modules: tf-m: add regression test related parameters to TF-M build Upstream PR #: 106660 In order to properly build non-regression tests for the TF-M secure side we need to pass 2 additional parameters: - tf-m-tests build folder - secure test configuration file Previously these values were added from 'samples/tfm_integration/tfm_regression_tests' sample. Signed-off-by: Valerio Setti --- modules/trusted-firmware-m/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index cdf64bd5f733..cfafbdae5922 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -50,6 +50,8 @@ if(CONFIG_BUILD_WITH_TFM) if(CONFIG_TFM_REGRESSION_S) list(APPEND TFM_CMAKE_ARGS -DTEST_S=ON) list(APPEND TFM_CMAKE_ARGS -DTFM_S_REG_TEST:BOOL=ON) + list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_TEST_DIR="${ZEPHYR_TF_M_TESTS_MODULE_DIR}/tests_reg/test/secure_regression") + list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_TEST_CONFIG_FILE="${ZEPHYR_TF_M_TESTS_MODULE_DIR}/tests_reg/test/config/config.cmake") endif() if(CONFIG_TFM_REGRESSION_NS) list(APPEND TFM_CMAKE_ARGS -DTEST_NS=ON) From 22a7853ba787eddb7c5aeec2c6a5ca449355ee9c Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Mon, 20 Apr 2026 15:38:37 +0200 Subject: [PATCH 3261/3334] [nrf fromlist] modules: tf-m: remove TFM_REGRESSION_[NS|S] Kconfigs Upstream PR #: 106660 These were only used in 'samples/tfm_integration/tfm_regression_test' and when that application is built they are both assumed to be enabled, so it's not really meaningful to have these Kconfigs. Extra parameters that need to be passed to the TF-M's CMake build are now added from 'samples/tfm_integration/tfm_regression_test/CMakeLists.txt'. In this way regression testing is self contained in that folder and it doesn't pollute the main TF-M build. Signed-off-by: Valerio Setti --- modules/trusted-firmware-m/CMakeLists.txt | 10 ---------- modules/trusted-firmware-m/Kconfig.tfm | 15 --------------- .../tfm_regression_test/CMakeLists.txt | 19 +++++++++++++++++++ .../tfm_regression_test/README.rst | 2 +- .../tfm_regression_test/prj.conf | 3 --- 5 files changed, 20 insertions(+), 29 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index cfafbdae5922..09376c2fa726 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -47,16 +47,6 @@ if(CONFIG_BUILD_WITH_TFM) else() # CONFIG_TFM_IPC list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="IPC") endif() - if(CONFIG_TFM_REGRESSION_S) - list(APPEND TFM_CMAKE_ARGS -DTEST_S=ON) - list(APPEND TFM_CMAKE_ARGS -DTFM_S_REG_TEST:BOOL=ON) - list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_TEST_DIR="${ZEPHYR_TF_M_TESTS_MODULE_DIR}/tests_reg/test/secure_regression") - list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_TEST_CONFIG_FILE="${ZEPHYR_TF_M_TESTS_MODULE_DIR}/tests_reg/test/config/config.cmake") - endif() - if(CONFIG_TFM_REGRESSION_NS) - list(APPEND TFM_CMAKE_ARGS -DTEST_NS=ON) - list(APPEND TFM_CMAKE_ARGS -DTFM_NS_REG_TEST:BOOL=ON) - endif() if(CONFIG_TFM_BL2) list(APPEND TFM_CMAKE_ARGS -DBL2=TRUE) list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_IMAGE_VERSION_S=${CONFIG_TFM_IMAGE_VERSION_S}) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 5ad74fba22be..1dc374a213cd 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -388,21 +388,6 @@ config TFM_SFN endchoice # TFM_MODEL -config TFM_REGRESSION_S - bool "TF-M Secure Regression tests" - help - When enabled, this option signifies that the TF-M build includes - the Secure domain regression tests. - The regression tests will be included in the TF-M secure firmware. - -config TFM_REGRESSION_NS - bool "TF-M Non-Secure Regression tests" - help - When enabled, this option signifies that the TF-M build includes - the Non-Secure domain regression tests. - The regression tests will be included in the TF-M non-secure - application. - choice TFM_PSA_TEST prompt "Enable a PSA test suite" default TFM_PSA_TEST_NONE diff --git a/samples/tfm_integration/tfm_regression_test/CMakeLists.txt b/samples/tfm_integration/tfm_regression_test/CMakeLists.txt index 27a2148206f5..aacd56cb5fef 100644 --- a/samples/tfm_integration/tfm_regression_test/CMakeLists.txt +++ b/samples/tfm_integration/tfm_regression_test/CMakeLists.txt @@ -14,6 +14,16 @@ set(TFM_TEST_REG_TEST_PATH ${ZEPHYR_TF_M_TESTS_MODULE_DIR}/tests_reg/test) set(TFM_TEST_LIB_PATH ${ZEPHYR_TF_M_TESTS_MODULE_DIR}/lib) set(TFM_API_NS_PATH ${CMAKE_BINARY_DIR}/tfm/api_ns) +# This is used to pass some extra build parameters to the TF-M build. +macro(add_tfm_build_params) + foreach(param ${ARGN}) + set_property(TARGET zephyr_property_target + APPEND PROPERTY TFM_CMAKE_OPTIONS + ${param} + ) + endforeach() +endmacro() + macro(add_inc_and_src_if_def) cmake_parse_arguments( ARG @@ -42,6 +52,15 @@ macro(def_if_def kconfig build_flag) endif() endmacro() +add_tfm_build_params( + -DTEST_S=ON + -DTEST_NS=ON + -DTFM_S_REG_TEST=ON + -DTFM_NS_REG_TEST=ON + -DCONFIG_TFM_TEST_DIR="${ZEPHYR_TF_M_TESTS_MODULE_DIR}/tests_reg/test/secure_regression" + -DCONFIG_TFM_TEST_CONFIG_FILE="${ZEPHYR_TF_M_TESTS_MODULE_DIR}/tests_reg/test/config/config.cmake" +) + target_sources(app PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/main.c ) diff --git a/samples/tfm_integration/tfm_regression_test/README.rst b/samples/tfm_integration/tfm_regression_test/README.rst index 3d6924c140ef..61e8b90f31c1 100644 --- a/samples/tfm_integration/tfm_regression_test/README.rst +++ b/samples/tfm_integration/tfm_regression_test/README.rst @@ -16,7 +16,7 @@ See sample.yaml for a list of supported platforms. Building and Running ******************** -Tests for both the secure and non-secure domain are enabled by default, controlled via the CONFIG_TFM_REGRESSION_S and CONFIG_TFM_REGRESSION_NS configs. +Tests for both the secure and non-secure domain are enabled by default. On Target ========= diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index f57edec4996f..a363f5d24687 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -4,9 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 # -CONFIG_TFM_REGRESSION_S=y -CONFIG_TFM_REGRESSION_NS=y - # Regression tests are included if a related secure partition is enabled. CONFIG_TFM_PARTITION_PROTECTED_STORAGE=y CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE=y From 99b2e7c0a2068ca0052a91e2699209dd58db2001 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Mon, 20 Apr 2026 17:57:13 +0200 Subject: [PATCH 3262/3334] [nrf fromlist] samples: tfm_integration: increase stack size Upstream PR #: 106660 Set stack size to 2048 bytes in order to allow all the tests to complete successfully on real hardware. Signed-off-by: Valerio Setti --- samples/tfm_integration/tfm_regression_test/prj.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/samples/tfm_integration/tfm_regression_test/prj.conf index a363f5d24687..01bd30057186 100644 --- a/samples/tfm_integration/tfm_regression_test/prj.conf +++ b/samples/tfm_integration/tfm_regression_test/prj.conf @@ -9,3 +9,5 @@ CONFIG_TFM_PARTITION_PROTECTED_STORAGE=y CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE=y CONFIG_TFM_PARTITION_CRYPTO=y CONFIG_TFM_PARTITION_PLATFORM=y + +CONFIG_MAIN_STACK_SIZE=2048 From b00f1e350e111256f5dbac5ae46ede428fbe6c62 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Wed, 22 Apr 2026 09:08:15 +0300 Subject: [PATCH 3263/3334] [nrf fromlist] tests: tf-m: regression: move from samples/tfm_integration Upstream PR #: 106660 This really is a test, so move it appropriately. The README file is deleted as there is no need for extra (outdated) documentation. Signed-off-by: Tomi Fontanilles --- doc/services/tfm/testsuites.rst | 3 +- .../tfm_regression_test/README.rst | 114 ------------------ .../modules/tf-m/regression}/CMakeLists.txt | 0 .../modules/tf-m/regression}/Kconfig | 0 .../modules/tf-m/regression}/prj.conf | 0 .../modules/tf-m/regression}/src/main.c | 0 .../modules/tf-m/regression/testcase.yaml | 3 - 7 files changed, 2 insertions(+), 118 deletions(-) delete mode 100644 samples/tfm_integration/tfm_regression_test/README.rst rename {samples/tfm_integration/tfm_regression_test => tests/modules/tf-m/regression}/CMakeLists.txt (100%) rename {samples/tfm_integration/tfm_regression_test => tests/modules/tf-m/regression}/Kconfig (100%) rename {samples/tfm_integration/tfm_regression_test => tests/modules/tf-m/regression}/prj.conf (100%) rename {samples/tfm_integration/tfm_regression_test => tests/modules/tf-m/regression}/src/main.c (100%) rename samples/tfm_integration/tfm_regression_test/sample.yaml => tests/modules/tf-m/regression/testcase.yaml (97%) diff --git a/doc/services/tfm/testsuites.rst b/doc/services/tfm/testsuites.rst index 35824adabd85..7db00da5a2b8 100644 --- a/doc/services/tfm/testsuites.rst +++ b/doc/services/tfm/testsuites.rst @@ -12,7 +12,8 @@ in the samples/tfm_integration folder. TF-M Regression Tests ********************* -The regression test suite can be run via the :ref:`tfm_regression_test` sample. +The regression test suite can be run via the +:zephyr_file:`tests/modules/tf-m/regression` test. This sample tests various services and communication mechanisms across the NS/S boundary via the PSA APIs. They provide a useful sanity check for proper diff --git a/samples/tfm_integration/tfm_regression_test/README.rst b/samples/tfm_integration/tfm_regression_test/README.rst deleted file mode 100644 index 61e8b90f31c1..000000000000 --- a/samples/tfm_integration/tfm_regression_test/README.rst +++ /dev/null @@ -1,114 +0,0 @@ -.. _tfm_regression_test: - -TF-M Regression Test Sample -########################### - -Overview -******** - -Run both the Secure and Non-secure TF-M Regression tests using the Zephyr build system. - -The TF-M regression tests are implemented in the tf-m-tests repo: https://git.trustedfirmware.org/TF-M/tf-m-tests.git/ - -This sample is available for platforms that are supported in the trusted-firmware-m repo: https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/ -See sample.yaml for a list of supported platforms. - -Building and Running -******************** - -Tests for both the secure and non-secure domain are enabled by default. - -On Target -========= - -Refer to :zephyr:code-sample:`tfm_ipc` for detailed instructions. - -On QEMU: -======== - -Refer to :zephyr:code-sample:`tfm_ipc` for detailed instructions. -Following is an example based on ``west build`` - - .. code-block:: bash - - $ west build samples/tfm_integration/tfm_regression_test/ -p -b mps2/an521/cpu0/ns -t run - -Sample Output -============= - - .. code-block:: console - - Non-Secure system starting... - - #### Execute test suites for the Secure area #### - - [...] - - Running Test Suite PS reliability tests (TFM_PS_TEST_3XXX)... - > Executing 'TFM_PS_TEST_3001' - Description: 'repetitive sets and gets in/from an asset' - > Iteration 15 of 15 - TEST: TFM_PS_TEST_3001 - PASSED! - > Executing 'TFM_PS_TEST_3002' - Description: 'repetitive sets, gets and removes' - > Iteration 15 of 15 - TEST: TFM_PS_TEST_3002 - PASSED! - TESTSUITE PASSED! - - [...] - - *** Secure test suites summary *** - Test suite 'PSA protected storage S interface tests (TFM_PS_TEST_2XXX)' has PASSED - Test suite 'PS reliability tests (TFM_PS_TEST_3XXX)' has PASSED - Test suite 'PS rollback protection tests (TFM_PS_TEST_4XXX)' has PASSED - Test suite 'PSA internal trusted storage S interface tests (TFM_ITS_TEST_2XXX)' has PASSED - Test suite 'ITS reliability tests (TFM_ITS_TEST_3XXX)' has PASSED - Test suite 'Crypto secure interface tests (TFM_CRYPTO_TEST_5XXX)' has PASSED - Test suite 'Initial Attestation Service secure interface tests(TFM_ATTEST_TEST_1XXX)' has PASSED - Test suite 'Platform Service Secure interface tests(TFM_PLATFORM_TEST_1XXX)' has PASSED - Test suite 'IPC secure interface test (TFM_IPC_TEST_1XXX)' has PASSED - - *** End of Secure test suites *** - - #### Execute test suites for the Non-secure area #### - - [...] - - Running Test Suite Core non-secure positive tests (TFM_CORE_TEST_1XXX)... - > Executing 'TFM_CORE_TEST_1001' - Description: 'Test service request from NS thread mode' - TEST: TFM_CORE_TEST_1001 - PASSED! - > Executing 'TFM_CORE_TEST_1003' - Description: 'Test the success of service init' - TEST: TFM_CORE_TEST_1003 - PASSED! - > Executing 'TFM_CORE_TEST_1007' - Description: 'Test secure service buffer accesses' - TEST: TFM_CORE_TEST_1007 - PASSED! - > Executing 'TFM_CORE_TEST_1008' - Description: 'Test secure service to service call' - TEST: TFM_CORE_TEST_1008 - PASSED! - > Executing 'TFM_CORE_TEST_1010' - Description: 'Test secure service to service call with buffer handling' - TEST: TFM_CORE_TEST_1010 - PASSED! - > Executing 'TFM_CORE_TEST_1015' - Description: 'Test service parameter sanitization' - TEST: TFM_CORE_TEST_1015 - PASSED! - > Executing 'TFM_CORE_TEST_1016' - Description: 'Test outvec write' - TEST: TFM_CORE_TEST_1016 - PASSED! - TESTSUITE PASSED! - - [...] - - *** Non-secure test suites summary *** - Test suite 'PSA protected storage NS interface tests (TFM_PS_TEST_1XXX)' has PASSED - Test suite 'PSA internal trusted storage NS interface tests (TFM_ITS_TEST_1XXX)' has PASSED - Test suite 'Crypto non-secure interface test (TFM_CRYPTO_TEST_6XXX)' has PASSED - Test suite 'Platform Service Non-Secure interface tests(TFM_PLATFORM_TEST_2XXX)' has PASSED - Test suite 'Initial Attestation Service non-secure interface tests(TFM_ATTEST_TEST_2XXX)' has PASSED - Test suite 'QCBOR regression test(TFM_QCBOR_TEST_7XXX)' has PASSED - Test suite 'T_COSE regression test(TFM_T_COSE_TEST_8XXX)' has PASSED - Test suite 'Core non-secure positive tests (TFM_CORE_TEST_1XXX)' has PASSED - Test suite 'IPC non-secure interface test (TFM_IPC_TEST_1XXX)' has PASSED - - *** End of Non-secure test suites *** diff --git a/samples/tfm_integration/tfm_regression_test/CMakeLists.txt b/tests/modules/tf-m/regression/CMakeLists.txt similarity index 100% rename from samples/tfm_integration/tfm_regression_test/CMakeLists.txt rename to tests/modules/tf-m/regression/CMakeLists.txt diff --git a/samples/tfm_integration/tfm_regression_test/Kconfig b/tests/modules/tf-m/regression/Kconfig similarity index 100% rename from samples/tfm_integration/tfm_regression_test/Kconfig rename to tests/modules/tf-m/regression/Kconfig diff --git a/samples/tfm_integration/tfm_regression_test/prj.conf b/tests/modules/tf-m/regression/prj.conf similarity index 100% rename from samples/tfm_integration/tfm_regression_test/prj.conf rename to tests/modules/tf-m/regression/prj.conf diff --git a/samples/tfm_integration/tfm_regression_test/src/main.c b/tests/modules/tf-m/regression/src/main.c similarity index 100% rename from samples/tfm_integration/tfm_regression_test/src/main.c rename to tests/modules/tf-m/regression/src/main.c diff --git a/samples/tfm_integration/tfm_regression_test/sample.yaml b/tests/modules/tf-m/regression/testcase.yaml similarity index 97% rename from samples/tfm_integration/tfm_regression_test/sample.yaml rename to tests/modules/tf-m/regression/testcase.yaml index 6639fb81d017..4e0ce4ac1b4a 100644 --- a/samples/tfm_integration/tfm_regression_test/sample.yaml +++ b/tests/modules/tf-m/regression/testcase.yaml @@ -20,9 +20,6 @@ common: - "Test suite 'Crypto non-secure interface test.*' has.*PASSED" - "Test suite 'Platform Service Non-Secure interface tests.*' has.*PASSED" -sample: - name: "TFM Regression Test" - tests: tf-m.regression.ipc.lvl1: extra_args: From 4cf96b95c7387ed1ad610b3b66ec64a1d8346afc Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Mon, 20 Apr 2026 12:51:02 +0200 Subject: [PATCH 3264/3334] [nrf fromtree] drivers: regulator: disable Nordic USB VBUS regulator interrupts Explicitly disable VBUSDETECTED and VBUSREMOVED regulator interrupts. Signed-off-by: Johann Fischer (cherry picked from commit 37010a39dc2b5aebef5d0b767ce133d4047cc790) --- drivers/regulator/regulator_nrf_vregusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regulator/regulator_nrf_vregusb.c b/drivers/regulator/regulator_nrf_vregusb.c index 2c7122e4609a..03eadf649934 100644 --- a/drivers/regulator/regulator_nrf_vregusb.c +++ b/drivers/regulator/regulator_nrf_vregusb.c @@ -69,6 +69,8 @@ static int vregusb_disable(const struct device *const dev) const struct vregusb_config *const config = dev->config; NRF_VREGUSB_Type *const base = config->base; + nrf_vregusb_int_disable(base, NRF_VREGUSB_INT_VBUS_DETECTED_MASK | + NRF_VREGUSB_INT_VBUS_REMOVED_MASK); config->irq_disable_func(dev); nrf_vregusb_task_trigger(base, NRF_VREGUSB_TASK_STOP); From 241f0ad7b014a3058fd58f10cd06b9cecdd864db Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 23 Apr 2026 14:07:54 +0300 Subject: [PATCH 3265/3334] [nrf fromtree] net: wireguard: link to `mbedTLS` when builtin version is used Without this we can have scenarios where PSA Crypto headers are not found under certain configurations. Signed-off-by: Tomi Fontanilles (cherry picked from commit e02ccae566f3f82252f438562cfe52f967237535) --- subsys/net/lib/wireguard/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/net/lib/wireguard/CMakeLists.txt b/subsys/net/lib/wireguard/CMakeLists.txt index 77c922957974..673a27f7d843 100644 --- a/subsys/net/lib/wireguard/CMakeLists.txt +++ b/subsys/net/lib/wireguard/CMakeLists.txt @@ -7,3 +7,5 @@ zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/net/ip) zephyr_library_sources(wg.c) zephyr_library_sources_ifdef(CONFIG_BOARD_NATIVE_SIM ns_rtc.c) + +zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS_BUILTIN mbedTLS) From a8a827c9efe2fca7c2f6815bb10688c700091415 Mon Sep 17 00:00:00 2001 From: Jacob Schloss Date: Wed, 8 Apr 2026 03:41:11 -0700 Subject: [PATCH 3266/3334] [nrf fromtree] net: l2: ethernet: Restore pointer cast in net_eth_get_hw_config Removing the pointer cast on dev->api breaks building C++ files that include ethernet.h Signed-off-by: Jacob Schloss (cherry picked from commit 493508086a033239dc2b57ae2094ea5342b7a975) --- include/zephyr/net/ethernet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/net/ethernet.h b/include/zephyr/net/ethernet.h index 2833bbb0c488..a852876debd1 100644 --- a/include/zephyr/net/ethernet.h +++ b/include/zephyr/net/ethernet.h @@ -946,7 +946,7 @@ int net_eth_get_hw_config(struct net_if *iface, enum ethernet_config_type type, struct ethernet_config *config) { const struct device *dev = net_if_get_device(iface); - const struct ethernet_api *eth = dev->api; + const struct ethernet_api *eth = (struct ethernet_api *)dev->api; if (!eth->get_config) { return -ENOTSUP; From 9264483cd04c28c7b8414ba77a6c1c6558cdb81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Fri, 24 Apr 2026 15:10:47 +0200 Subject: [PATCH 3267/3334] [nrf fromtree] tests: drivers: uart: uart_mix_fifo_poll: Use timer based RNG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test is using random API from interrupt context and some entropy drivers don't support it. It's a test so pseudo-rng is ok. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 12bffe6b872266e8ec5a7648d767a94dccdcb22b) --- tests/drivers/uart/uart_mix_fifo_poll/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/drivers/uart/uart_mix_fifo_poll/prj.conf b/tests/drivers/uart/uart_mix_fifo_poll/prj.conf index fa22b3a47b89..13234ab13d9a 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/prj.conf +++ b/tests/drivers/uart/uart_mix_fifo_poll/prj.conf @@ -5,6 +5,7 @@ CONFIG_ZTEST_THREAD_PRIORITY=5 CONFIG_MAIN_STACK_SIZE=2048 CONFIG_ZTEST_STACK_SIZE=2048 CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_TIMER_RANDOM_GENERATOR=y CONFIG_COUNTER=y # CONFIG_NO_OPTIMIZATIONS=y From 8baf74a9ea1f3e7ad2b58d9fdf7e08d6d1ef0a7b Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 27 Apr 2026 14:21:44 +0300 Subject: [PATCH 3268/3334] [nrf noup] Revert "modules: tf-m: build tfm_api lib only when !CONFIG_TFM_USE_NS_APP" This reverts commit 06dd00c340948455c30608c273e2a9bbd15f5543. This change is still causing undefined refernece to tfm_platform_gpio_pin_mcu_select from soc/nordic/common/soc_secure.c for the 5340. It's too central a place that cannot be disabled with a Kconfig option. Revert this commit until we update to Mbed TLS 4. Signed-off-by: Tomi Fontanilles --- modules/trusted-firmware-m/CMakeLists.txt | 74 +++++++++++------------ modules/trusted-firmware-m/Kconfig.tfm | 2 +- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 09376c2fa726..70266b2794d2 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -372,53 +372,51 @@ if(CONFIG_BUILD_WITH_TFM) TFM_S_NS_SIGNED_BIN_FILE ${TFM_S_NS_SIGNED_BIN_FILE} # Merged TFM Secure/Nonsecure FW (signed) ) - if(NOT CONFIG_TFM_USE_NS_APP) - zephyr_library_named(tfm_api) + zephyr_library_named(tfm_api) - zephyr_library_sources( - src/zephyr_tfm_log.c - interface/interface.c - ) + zephyr_library_sources( + src/zephyr_tfm_log.c + interface/interface.c + ) - # A dependency on tfm_s.hex for zephyr.elf will not cause a Zephyr re-link when - # tfm_s.hex is updated, as the hex is not a direct input on the executable. - # Instead we establish a source file dependency which ensures that tfm_api is - # updated when there are changes in tfm itself, this again will trigger an re-link - # of Zephyr.elf. - set_property(SOURCE interface/interface.c APPEND PROPERTY OBJECT_DEPENDS ${TFM_S_HEX_FILE}) + # A dependency on tfm_s.hex for zephyr.elf will not cause a Zephyr re-link when + # tfm_s.hex is updated, as the hex is not a direct input on the executable. + # Instead we establish a source file dependency which ensures that tfm_api is + # updated when there are changes in tfm itself, this again will trigger an re-link + # of Zephyr.elf. + set_property(SOURCE interface/interface.c APPEND PROPERTY OBJECT_DEPENDS ${TFM_S_HEX_FILE}) - # Non-Secure interface to request system reboot - if(CONFIG_TFM_PARTITION_PLATFORM AND NOT CONFIG_TFM_PARTITION_PLATFORM_CUSTOM_REBOOT) - zephyr_library_sources(src/reboot.c) - endif() + # Non-Secure interface to request system reboot + if(CONFIG_TFM_PARTITION_PLATFORM AND NOT CONFIG_TFM_PARTITION_PLATFORM_CUSTOM_REBOOT) + zephyr_library_sources(src/reboot.c) + endif() - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_attest_api.c) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_fwu_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_platform_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PROTECTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_ps_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ${TFM_INTERFACE_SOURCE_DIR}/tfm_its_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_CRYPTO ${TFM_INTERFACE_SOURCE_DIR}/tfm_crypto_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_INITIAL_ATTESTATION ${TFM_INTERFACE_SOURCE_DIR}/tfm_attest_api.c) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_FIRMWARE_UPDATE ${TFM_INTERFACE_SOURCE_DIR}/tfm_fwu_api.c) - zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_tz_psa_ns_api.c) + zephyr_library_sources(${TFM_INTERFACE_SOURCE_DIR}/tfm_tz_psa_ns_api.c) - if(CONFIG_SOC_FAMILY_NORDIC_NRF) - zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c) - endif() + if(CONFIG_SOC_FAMILY_NORDIC_NRF) + zephyr_library_sources_ifdef(CONFIG_TFM_PARTITION_PLATFORM ${TFM_INTERFACE_SOURCE_DIR}/tfm_ioctl_core_ns_api.c) + endif() - # TFM_INTERFACE_INCLUDE_DIR is already added to zephyr_interface below - zephyr_library_include_directories( - ${TFM_INTERFACE_INCLUDE_DIR}/crypto_keys - ) + # TFM_INTERFACE_INCLUDE_DIR is already added to zephyr_interface below + zephyr_library_include_directories( + ${TFM_INTERFACE_INCLUDE_DIR}/crypto_keys + ) - # Add interface include directory (exported by TF-M) to zephyr_interface - zephyr_include_directories( - ${TFM_INTERFACE_INCLUDE_DIR} - ) + # Add interface include directory (exported by TF-M) to zephyr_interface + zephyr_include_directories( + ${TFM_INTERFACE_INCLUDE_DIR} + ) - zephyr_library_link_libraries( - ${TFM_INTERFACE_LIB_DIR}/s_veneers.o - ) - endif(NOT CONFIG_TFM_USE_NS_APP) + zephyr_library_link_libraries( + ${TFM_INTERFACE_LIB_DIR}/s_veneers.o + ) # Ensure that the generated syscall include headers of Zephyr are available to TF-M # because some platforms might use the same source files for both builds. diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 1dc374a213cd..83a5067be440 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -52,7 +52,7 @@ menuconfig BUILD_WITH_TFM select PSA_CRYPTO_CLIENT imply INIT_ARCH_HW_AT_BOOT imply ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS - imply MBEDTLS if !TFM_USE_NS_APP + imply MBEDTLS help When enabled, this option instructs the Zephyr build process to additionally generate a TF-M image for the Secure Execution From c632b695026bfc4499b42ec278802211cca30264 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 27 Apr 2026 14:42:31 +0300 Subject: [PATCH 3269/3334] [nrf fromlist] modules: mbedtls: mark MD5 and SHA-1 hashes as weak Upstream PR #: 108017 Add a help text to their Kconfig options to warn about that. In addition, make CONFIG_PSA_WANT_ALG_MD5 select NOT_SECURE but not CONFIG_PSA_WANT_ALG_SHA_1 because for instance HMAC-SHA1 is still considered secure, which means SHA-1 usage might not necessarily be insecure. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/Kconfig.psa.auto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa.auto b/modules/mbedtls/Kconfig.psa.auto index 5528572497c7..c1b0c4377ba8 100644 --- a/modules/mbedtls/Kconfig.psa.auto +++ b/modules/mbedtls/Kconfig.psa.auto @@ -88,6 +88,9 @@ config PSA_WANT_ALG_HMAC config PSA_WANT_ALG_MD5 bool "PSA_WANT_ALG_MD5" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + select NOT_SECURE + help + The MD5 hash algorithm is weak and deprecated and should not be used. config PSA_WANT_ALG_PBKDF2_HMAC @@ -119,6 +122,8 @@ config PSA_WANT_ALG_RSA_PSS config PSA_WANT_ALG_SHA_1 bool "PSA_WANT_ALG_SHA_1" if !MBEDTLS_PROMPTLESS default y if PSA_CRYPTO_ENABLE_ALL + help + The SHA-1 hash is weak and deprecated and should not be used. config PSA_WANT_ALG_SHA_224 bool "PSA_WANT_ALG_SHA_224" if !MBEDTLS_PROMPTLESS From e88cd523ff4b9d7484dc875048a0f2f14dbf99f2 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 16 Mar 2026 11:36:29 +0100 Subject: [PATCH 3270/3334] [nrf fromlist] dts: nrf5340: cpunet: add hfxo and lfxo nodes to soc The hfxo and lfxo clocks are used by both cpuapp and cpunet cores, but the hfxo and lfxo nodes are only present in devicetree for the cpuapp core. This prevents the cpunet build from knowing if there is an hfxo and/or lfxo present. Therefore add the lfxo and hfxo clocks to nrf5340_cpunet.dtsi All boards in tree have both the hfxo and lfxo present. The only information that needs to be made available to cpunet is the hfxo's presence and startup time, and lfxo's presence. Upstream PR #: 105558 Signed-off-by: Bjarki Arge Andreasen Signed-off-by: Ivan Iushkov --- dts/arm/nordic/nrf5340_clocks.dtsi | 22 +++++++++++++++++++ dts/arm/nordic/nrf5340_cpuapp.dtsi | 1 + dts/arm/nordic/nrf5340_cpuapp_ns.dtsi | 1 + .../nordic/nrf5340_cpuapp_peripherals.dtsi | 13 ----------- dts/arm/nordic/nrf5340_cpunet.dtsi | 1 + 5 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 dts/arm/nordic/nrf5340_clocks.dtsi diff --git a/dts/arm/nordic/nrf5340_clocks.dtsi b/dts/arm/nordic/nrf5340_clocks.dtsi new file mode 100644 index 000000000000..d2be00a78ae3 --- /dev/null +++ b/dts/arm/nordic/nrf5340_clocks.dtsi @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + clocks { + lfxo: lfxo { + compatible = "nordic,nrf53-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf53-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + startup-time-us = <1400>; + }; + }; +}; diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index f0a7a6eeb301..c8fd20237f9c 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -7,6 +7,7 @@ #include #include #include +#include / { cpus { diff --git a/dts/arm/nordic/nrf5340_cpuapp_ns.dtsi b/dts/arm/nordic/nrf5340_cpuapp_ns.dtsi index 784a670fe03e..f41ea81e12a8 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_ns.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_ns.dtsi @@ -9,6 +9,7 @@ #include #include #include +#include / { cpus { diff --git a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi index 46e2a0364758..5617c5f0e467 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_peripherals.dtsi @@ -15,19 +15,6 @@ dcnf: dcnf@0 { oscillators: clock-controller@4000 { compatible = "nordic,nrf53-oscillators"; reg = <0x4000 0x1000>; - - lfxo: lfxo { - compatible = "nordic,nrf53-lfxo"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - - hfxo: hfxo { - compatible = "nordic,nrf53-hfxo"; - #clock-cells = <0>; - clock-frequency = ; - startup-time-us = <1400>; - }; }; regulators: regulator@4000 { diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 68c257a4b37a..bc8357d91c33 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { chosen { From 5699b0249228f643945b0d453f9fd9591f926e17 Mon Sep 17 00:00:00 2001 From: Artur Hadasz Date: Wed, 29 Apr 2026 12:05:04 +0200 Subject: [PATCH 3271/3334] [nrf fromtree] Bluetooth: UUID: Add defines for HID SCI Add defines for UUIDs used by the HID SCI (Shorter Connection Intervals) feature. Signed-off-by: Artur Hadasz (cherry picked from commit 76862fa478d2d1d499c48b0423333682695ab814) --- include/zephyr/bluetooth/uuid.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/zephyr/bluetooth/uuid.h b/include/zephyr/bluetooth/uuid.h index aefc02aa5e2c..4c3c00aaa774 100644 --- a/include/zephyr/bluetooth/uuid.h +++ b/include/zephyr/bluetooth/uuid.h @@ -5188,6 +5188,24 @@ struct bt_uuid_any { */ #define BT_UUID_GMAP_BGR_FEAT BT_UUID_DECLARE_16(BT_UUID_GMAP_BGR_FEAT_VAL) +/** + * @brief HID SCI (Shorter Connection Intervals) Mode UUID value + */ +#define BT_UUID_HIDS_SCI_MODE_VAL 0x2C39 +/** + * @brief HID SCI (Shorter Connection Intervals) Mode + */ +#define BT_UUID_HIDS_SCI_MODE BT_UUID_DECLARE_16(BT_UUID_HIDS_SCI_MODE_VAL) + +/** + * @brief HID SCI (Shorter Connection Intervals) Information UUID value + */ +#define BT_UUID_HIDS_SCI_INFO_VAL 0x2C3A +/** + * @brief HID SCI (Shorter Connection Intervals) Information + */ +#define BT_UUID_HIDS_SCI_INFO BT_UUID_DECLARE_16(BT_UUID_HIDS_SCI_INFO_VAL) + /* * Protocol UUIDs */ From 9cb454ccf22e139ee167876e96be4d7c1473c7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 1 Apr 2026 10:30:15 +0200 Subject: [PATCH 3272/3334] [nrf fromtree] tests: subsys: fs: Run fcb test on nrf54lm20b device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add nrf54lm20b target to the platform_allow list. Signed-off-by: Sebastian Głąb (cherry picked from commit 68ad2ab5edc3d23be9d2d4614dd73f19c17cffeb) --- tests/subsys/fs/fcb/testcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/subsys/fs/fcb/testcase.yaml b/tests/subsys/fs/fcb/testcase.yaml index 8c318e8dde76..228ea7afb3c3 100644 --- a/tests/subsys/fs/fcb/testcase.yaml +++ b/tests/subsys/fs/fcb/testcase.yaml @@ -17,6 +17,7 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp - ophelia4ev/nrf54l15/cpuapp - native_sim integration_platforms: From d0588d4af41b4ad46f36eed4660279fec6d18174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Wed, 1 Apr 2026 10:27:52 +0200 Subject: [PATCH 3273/3334] [nrf fromtree] samples: boards: nordic: Run nrf_sys_event on nrf54lm20b device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add overlay required to run the nrf_sys_event sample on nrf54lm20b device. Signed-off-by: Sebastian Głąb (cherry picked from commit 933e84faa4b2e1afe1d65c1e5243a73e5bcb79ed) --- .../boards/nrf54lm20dk_nrf54lm20_common.dtsi | 8 ++++++++ .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 4 +--- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 6 ++++++ samples/boards/nordic/nrf_sys_event/sample.yaml | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20_common.dtsi create mode 100644 samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20_common.dtsi b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20_common.dtsi new file mode 100644 index 000000000000..246efa029ede --- /dev/null +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20_common.dtsi @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +sample_counter: &timer20 { + status = "okay"; +}; diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 246efa029ede..a669ed1275a8 100644 --- a/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -3,6 +3,4 @@ * SPDX-License-Identifier: Apache-2.0 */ -sample_counter: &timer20 { - status = "okay"; -}; +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..a669ed1275a8 --- /dev/null +++ b/samples/boards/nordic/nrf_sys_event/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf54lm20dk_nrf54lm20_common.dtsi" diff --git a/samples/boards/nordic/nrf_sys_event/sample.yaml b/samples/boards/nordic/nrf_sys_event/sample.yaml index 6ac248d7fc3c..e3fd48ae3b9b 100644 --- a/samples/boards/nordic/nrf_sys_event/sample.yaml +++ b/samples/boards/nordic/nrf_sys_event/sample.yaml @@ -67,5 +67,6 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp + - nrf54lm20dk/nrf54lm20b/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp From 2fb58cb687c25e4e65014b98361e116c60338218 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 5 May 2026 12:58:12 +0300 Subject: [PATCH 3274/3334] Revert "[nrf noup] revert update of MBEDTLS_BUILTIN CMake logic to Mbed TLS 4" This reverts commit 9ee6019afcac772551ddc6dee14948e35ace3b9a. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/CMakeLists.txt | 277 ++++++++------------------------- modules/mbedtls/Kconfig | 6 + 2 files changed, 70 insertions(+), 213 deletions(-) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index 20e1b0b7ac62..2c6cf0073325 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -5,235 +5,86 @@ # if(CONFIG_MBEDTLS) - zephyr_interface_library_named(mbedTLS) if(CONFIG_MBEDTLS_BUILTIN) - if(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR AND NOT CONFIG_ENTROPY_HAS_DRIVER) - message(WARNING "No entropy device on the system, using fake entropy source!") - endif() - - if(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) - if(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG OR - CONFIG_TEST_CSPRNG_GENERATOR) - message(WARNING " - Non cryptographycally secure sources are enabled for psa_generate_random(). - This is meant to be used only for tests, not in production!") - else() - if(NOT CONFIG_CSPRNG_ENABLED) - message(FATAL_ERROR " - MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG is set but there is - no CSPRNG enabled.") - endif() - endif() - endif() + # Create an interface library named "mbedTLS": + # - This is the library other modules/subsystems link against. + # - It contains some Mbed TLS configuration flags (ex: MBEDTLS_CONFIG_FILE + # and TF_PSA_CRYPTO_CONFIG_FILE) which are used in Mbed TLS build, but + # which must also be defined when Zephyr code includes headers + # from Mbed TLS. + # - It contains public include directories which are provided by Mbed TLS. + zephyr_interface_library_named(mbedTLS) + + # Explicitly link zephyr_interface to mbedTLS + zephyr_link_libraries(mbedTLS) - # Add the config-file entry point target_compile_definitions(mbedTLS INTERFACE - MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CONFIG_FILE}" + MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CONFIG_FILE}" + TF_PSA_CRYPTO_CONFIG_FILE="${CONFIG_TF_PSA_CRYPTO_CONFIG_FILE}" ) - if(CONFIG_BUILD_WITH_TFM) - target_include_directories(mbedTLS INTERFACE - $/api_ns/interface/include - ) - endif() - - # Add regular includes + # Some CMake variables that are used in Mbed TLS build + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + set(MBEDTLS_AS_SUBPROJECT ON) + set(ENABLE_PROGRAMS OFF) + set(ENABLE_TESTING OFF) + set(GEN_FILES OFF) + # Workaround to get rid of a warning generated by the Mbed TLS build system. + set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "") + set(TF_PSA_CRYPTO_DIR ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}) + set(MLDSA_NATIVE_DIR ${ZEPHYR_MLDSA_NATIVE_MODULE_DIR}) + + # Add Mbed TLS (TF-PSA-Crypto is automatically included from there). + # This creates 3 libraries: mbedtls, mbedx509 and tfpsacrypto. + add_subdirectory(${ZEPHYR_MBEDTLS_MODULE_DIR} mbedtls) + + foreach(lib mbedtls mbedx509 tfpsacrypto builtin p256-m everest pqcp extras platform utilities) + # Mbed TLS libraries are normal CMake libraries. + # To ensure Mbed TLS libraries are including Zephyr include directories and + # Zephyr compile options we link those libraries with 'zephyr_interface'. + target_link_libraries(${lib} PRIVATE zephyr_interface) + # Mbed TLS libraries are external CMake targets (not zephyr_library()), + # so they miss the automatic add_dependencies on zephyr_generated_headers + # that zephyr_library() targets get. Without this, generated headers + # like heap_constants.h may not exist when Mbed TLS sources compile. + add_dependencies(${lib} zephyr_generated_headers) + endforeach() + + # Custom macro to tell that a TF-PSA-Crypto source file is being compiled. + # This is used by Secure Storage. + target_compile_definitions(tfpsacrypto PRIVATE BUILDING_MBEDTLS_CRYPTO) + + # Add Mbed TLS libraries ("tfpsacrypto" and "mbedx509" are linked to "mbedtls") + # to ZEPHYR_LIBS list. + zephyr_append_cmake_library(mbedtls) + + # Add Mbed TLS public include directories to the "mbedTLS" interface library. target_include_directories(mbedTLS INTERFACE - ${ZEPHYR_CURRENT_MODULE_DIR}/include + $ ${ZEPHYR_CURRENT_MODULE_DIR}/include/library ${ZEPHYR_CURRENT_MODULE_DIR}/library - configs - include ) - if(CONFIG_MBEDTLS_PSA_P256M_DRIVER_RAW) - target_include_directories(mbedTLS INTERFACE - ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m - ) - endif() - - # Add base library with files required by all drivers/backends. - zephyr_library_named(mbedTLSBase) - - # Base mbed TLS files - list(APPEND mbedtls_base_src - ${ZEPHYR_CURRENT_MODULE_DIR}/library/aes.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/aesni.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/aria.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/asn1parse.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/asn1write.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/base64.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_core.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_mod_raw.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_mod.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/block_cipher.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/camellia.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ccm.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/chacha20.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/chachapoly.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/cipher_wrap.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/cipher.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/cmac.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/constant_time.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ctr_drbg.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/debug.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/des.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/dhm.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecdh.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecdsa.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecjpake.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp_curves_new.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp_curves.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/entropy_poll.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/entropy.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/error.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/gcm.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/hkdf.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/hmac_drbg.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/lmots.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/lms.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/md.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/md5.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/memory_buffer_alloc.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/mps_reader.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/mps_trace.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/nist_kw.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/oid.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/padlock.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/platform_util.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/platform.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/poly1305.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_util.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ripemd160.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/rsa_alt_helpers.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/rsa.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha1.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha256.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha512.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha3.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/threading.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/timing.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/version_features.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/version.c - zephyr_init.c - zephyr_entropy.c - ) - - zephyr_library_sources(${mbedtls_base_src}) - - zephyr_library_sources_ifdef(CONFIG_MBEDTLS_DEBUG debug.c) - zephyr_library_sources_ifdef(CONFIG_MBEDTLS_SHELL shell.c) - - zephyr_library_app_memory(k_mbedtls_partition) - if(CONFIG_ARCH_POSIX AND CONFIG_ASAN AND NOT CONFIG_64BIT AND NOT CONFIG_NO_OPTIMIZATIONS) - # i386 assembly code used in MBEDTLS does not compile with size optimization - # if address sanitizer is enabled, as such switch default optimization level - # to speed - set_property(SOURCE ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_core.c APPEND PROPERTY COMPILE_OPTIONS - "${COMPILER_OPTIMIZE_FOR_SPEED_FLAG}") - endif() - - zephyr_library_link_libraries(mbedTLS) - - zephyr_library_named(mbedTLSCrypto) - - if(CONFIG_MBEDTLS_PSA_CRYPTO_C) - list(APPEND crypto_source - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_aead.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_cipher.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_driver_wrappers_no_static.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_ecp.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_ffdh.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_hash.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_mac.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_pake.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_random.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_rsa.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_se.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_storage.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_its_file.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_client.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_slot_management.c - ) - endif() - - if(CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED) - list(APPEND crypto_source - ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m_driver_entrypoints.c - ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m/p256-m.c - ) - zephyr_library_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/library) - endif() - - list(APPEND crypto_source - ${ZEPHYR_CURRENT_MODULE_DIR}/library/pem.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkcs12.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkcs5.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkparse.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkwrite.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk_ecc.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk_wrap.c - ) - - zephyr_library_sources(${crypto_source}) - - # Custom macro to tell that an mbedTLSCrypto source file is being compiled. - zephyr_library_compile_definitions(BUILDING_MBEDTLS_CRYPTO) - - zephyr_library_link_libraries(mbedTLS) - - zephyr_library_link_libraries_ifdef(CONFIG_BUILD_WITH_TFM tfm_api) - - zephyr_library_named(mbedTLSX509) - - list(APPEND x509_source - ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_create.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_crl.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_crt.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_csr.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write_crt.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write_csr.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write.c + # Add local include directories to the "mbedTLS" interface library. + target_include_directories(mbedTLS INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/configs + ${CMAKE_CURRENT_LIST_DIR}/include ) - zephyr_library_sources(${x509_source}) - - zephyr_library_link_libraries(mbedTLS) + # Add some support for legacy crypto that unfortunately is still required + # in some scenarios. + include(${CMAKE_CURRENT_LIST_DIR}/legacy_support.cmake) + # Add another library to provide Zephyr-specific support zephyr_library() - - list(APPEND mbedtls_source - ${ZEPHYR_CURRENT_MODULE_DIR}/library/net_sockets.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_cache.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_ciphersuites.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_client.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_cookie.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_debug_helpers_generated.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_msg.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_ticket.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls12_client.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls12_server.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_client.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_generic.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_keys.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_server.c - ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls.c - ) - - zephyr_library_sources(${mbedtls_source}) - - zephyr_library_link_libraries( - mbedTLSX509 - mbedTLSCrypto - mbedTLSBase - mbedTLS + zephyr_library_sources( + ${CMAKE_CURRENT_LIST_DIR}/zephyr_init.c + ${CMAKE_CURRENT_LIST_DIR}/zephyr_entropy.c + $<$:${CMAKE_CURRENT_LIST_DIR}/debug.c> + $<$:${CMAKE_CURRENT_LIST_DIR}/shell.c> ) + zephyr_library_link_libraries(mbedTLS) elseif(CONFIG_MBEDTLS_LIBRARY) # NB: CONFIG_MBEDTLS_LIBRARY is not regression tested and is diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index ea6bfecac519..c6111e0f7c32 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -14,6 +14,12 @@ config MBEDTLS_PROMPTLESS mbed TLS menu prompt and instead handle the selection of MBEDTLS from dependent sub-configurations and thus prevent stuck symbol behavior. +config MBEDTLS_VERSION_4_x + bool + default y + help + Hidden Kconfig symbol used internally to mark support for Mbed TLS 4.x. + rsource "Kconfig.psa.auto" rsource "Kconfig.psa.logic" From 90566f2b1c5cde57c02055ac4e6debfa5f790674 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Mon, 13 Apr 2026 11:09:25 +0300 Subject: [PATCH 3275/3334] [nrf noup] modules: mbedtls: revert update of CMake logic to Mbed TLS 4 Temporarily bring back the CMake logic that compiled Mbed TLS 3.6 before we actually update to Mbed TLS 4 in NCS. This is a revert of 393350fd65e66800861f2d45a11c37d8472c3efc and subsequent changes affecting the Mbed TLS integration. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/CMakeLists.txt | 277 +++++++++++++++++++++++++-------- modules/mbedtls/Kconfig | 6 - 2 files changed, 213 insertions(+), 70 deletions(-) diff --git a/modules/mbedtls/CMakeLists.txt b/modules/mbedtls/CMakeLists.txt index 2c6cf0073325..20e1b0b7ac62 100644 --- a/modules/mbedtls/CMakeLists.txt +++ b/modules/mbedtls/CMakeLists.txt @@ -5,87 +5,236 @@ # if(CONFIG_MBEDTLS) + zephyr_interface_library_named(mbedTLS) if(CONFIG_MBEDTLS_BUILTIN) - # Create an interface library named "mbedTLS": - # - This is the library other modules/subsystems link against. - # - It contains some Mbed TLS configuration flags (ex: MBEDTLS_CONFIG_FILE - # and TF_PSA_CRYPTO_CONFIG_FILE) which are used in Mbed TLS build, but - # which must also be defined when Zephyr code includes headers - # from Mbed TLS. - # - It contains public include directories which are provided by Mbed TLS. - zephyr_interface_library_named(mbedTLS) - - # Explicitly link zephyr_interface to mbedTLS - zephyr_link_libraries(mbedTLS) + if(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR AND NOT CONFIG_ENTROPY_HAS_DRIVER) + message(WARNING "No entropy device on the system, using fake entropy source!") + endif() + + if(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) + if(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG OR + CONFIG_TEST_CSPRNG_GENERATOR) + message(WARNING " + Non cryptographycally secure sources are enabled for psa_generate_random(). + This is meant to be used only for tests, not in production!") + else() + if(NOT CONFIG_CSPRNG_ENABLED) + message(FATAL_ERROR " + MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG is set but there is + no CSPRNG enabled.") + endif() + endif() + endif() + # Add the config-file entry point target_compile_definitions(mbedTLS INTERFACE - MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CONFIG_FILE}" - TF_PSA_CRYPTO_CONFIG_FILE="${CONFIG_TF_PSA_CRYPTO_CONFIG_FILE}" + MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CONFIG_FILE}" ) - # Some CMake variables that are used in Mbed TLS build - set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) - set(MBEDTLS_AS_SUBPROJECT ON) - set(ENABLE_PROGRAMS OFF) - set(ENABLE_TESTING OFF) - set(GEN_FILES OFF) - # Workaround to get rid of a warning generated by the Mbed TLS build system. - set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "") - set(TF_PSA_CRYPTO_DIR ${ZEPHYR_TF_PSA_CRYPTO_MODULE_DIR}) - set(MLDSA_NATIVE_DIR ${ZEPHYR_MLDSA_NATIVE_MODULE_DIR}) - - # Add Mbed TLS (TF-PSA-Crypto is automatically included from there). - # This creates 3 libraries: mbedtls, mbedx509 and tfpsacrypto. - add_subdirectory(${ZEPHYR_MBEDTLS_MODULE_DIR} mbedtls) - - foreach(lib mbedtls mbedx509 tfpsacrypto builtin p256-m everest pqcp extras platform utilities) - # Mbed TLS libraries are normal CMake libraries. - # To ensure Mbed TLS libraries are including Zephyr include directories and - # Zephyr compile options we link those libraries with 'zephyr_interface'. - target_link_libraries(${lib} PRIVATE zephyr_interface) - # Mbed TLS libraries are external CMake targets (not zephyr_library()), - # so they miss the automatic add_dependencies on zephyr_generated_headers - # that zephyr_library() targets get. Without this, generated headers - # like heap_constants.h may not exist when Mbed TLS sources compile. - add_dependencies(${lib} zephyr_generated_headers) - endforeach() - - # Custom macro to tell that a TF-PSA-Crypto source file is being compiled. - # This is used by Secure Storage. - target_compile_definitions(tfpsacrypto PRIVATE BUILDING_MBEDTLS_CRYPTO) - - # Add Mbed TLS libraries ("tfpsacrypto" and "mbedx509" are linked to "mbedtls") - # to ZEPHYR_LIBS list. - zephyr_append_cmake_library(mbedtls) - - # Add Mbed TLS public include directories to the "mbedTLS" interface library. + if(CONFIG_BUILD_WITH_TFM) + target_include_directories(mbedTLS INTERFACE + $/api_ns/interface/include + ) + endif() + + # Add regular includes target_include_directories(mbedTLS INTERFACE - $ + ${ZEPHYR_CURRENT_MODULE_DIR}/include ${ZEPHYR_CURRENT_MODULE_DIR}/include/library ${ZEPHYR_CURRENT_MODULE_DIR}/library + configs + include ) - # Add local include directories to the "mbedTLS" interface library. - target_include_directories(mbedTLS INTERFACE - ${CMAKE_CURRENT_LIST_DIR}/configs - ${CMAKE_CURRENT_LIST_DIR}/include + if(CONFIG_MBEDTLS_PSA_P256M_DRIVER_RAW) + target_include_directories(mbedTLS INTERFACE + ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m + ) + endif() + + # Add base library with files required by all drivers/backends. + zephyr_library_named(mbedTLSBase) + + # Base mbed TLS files + list(APPEND mbedtls_base_src + ${ZEPHYR_CURRENT_MODULE_DIR}/library/aes.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/aesni.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/aria.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/asn1parse.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/asn1write.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/base64.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_core.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_mod_raw.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_mod.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/block_cipher.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/camellia.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ccm.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/chacha20.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/chachapoly.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/cipher_wrap.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/cipher.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/cmac.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/constant_time.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ctr_drbg.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/debug.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/des.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/dhm.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecdh.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecdsa.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecjpake.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp_curves_new.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp_curves.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ecp.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/entropy_poll.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/entropy.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/error.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/gcm.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/hkdf.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/hmac_drbg.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/lmots.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/lms.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/md.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/md5.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/memory_buffer_alloc.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/mps_reader.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/mps_trace.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/nist_kw.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/oid.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/padlock.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/platform_util.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/platform.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/poly1305.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_util.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ripemd160.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/rsa_alt_helpers.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/rsa.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha1.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha256.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha512.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/sha3.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/threading.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/timing.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/version_features.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/version.c + zephyr_init.c + zephyr_entropy.c ) - # Add some support for legacy crypto that unfortunately is still required - # in some scenarios. - include(${CMAKE_CURRENT_LIST_DIR}/legacy_support.cmake) + zephyr_library_sources(${mbedtls_base_src}) - # Add another library to provide Zephyr-specific support - zephyr_library() - zephyr_library_sources( - ${CMAKE_CURRENT_LIST_DIR}/zephyr_init.c - ${CMAKE_CURRENT_LIST_DIR}/zephyr_entropy.c - $<$:${CMAKE_CURRENT_LIST_DIR}/debug.c> - $<$:${CMAKE_CURRENT_LIST_DIR}/shell.c> + zephyr_library_sources_ifdef(CONFIG_MBEDTLS_DEBUG debug.c) + zephyr_library_sources_ifdef(CONFIG_MBEDTLS_SHELL shell.c) + + zephyr_library_app_memory(k_mbedtls_partition) + if(CONFIG_ARCH_POSIX AND CONFIG_ASAN AND NOT CONFIG_64BIT AND NOT CONFIG_NO_OPTIMIZATIONS) + # i386 assembly code used in MBEDTLS does not compile with size optimization + # if address sanitizer is enabled, as such switch default optimization level + # to speed + set_property(SOURCE ${ZEPHYR_CURRENT_MODULE_DIR}/library/bignum_core.c APPEND PROPERTY COMPILE_OPTIONS + "${COMPILER_OPTIMIZE_FOR_SPEED_FLAG}") + endif() + + zephyr_library_link_libraries(mbedTLS) + + zephyr_library_named(mbedTLSCrypto) + + if(CONFIG_MBEDTLS_PSA_CRYPTO_C) + list(APPEND crypto_source + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_aead.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_cipher.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_driver_wrappers_no_static.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_ecp.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_ffdh.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_hash.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_mac.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_pake.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_random.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_rsa.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_se.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_storage.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_its_file.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_client.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_slot_management.c + ) + endif() + + if(CONFIG_MBEDTLS_PSA_P256M_DRIVER_ENABLED) + list(APPEND crypto_source + ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m_driver_entrypoints.c + ${ZEPHYR_CURRENT_MODULE_DIR}/3rdparty/p256-m/p256-m/p256-m.c + ) + zephyr_library_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/library) + endif() + + list(APPEND crypto_source + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pem.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkcs12.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkcs5.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkparse.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pkwrite.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk_ecc.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/pk_wrap.c + ) + + zephyr_library_sources(${crypto_source}) + + # Custom macro to tell that an mbedTLSCrypto source file is being compiled. + zephyr_library_compile_definitions(BUILDING_MBEDTLS_CRYPTO) + + zephyr_library_link_libraries(mbedTLS) + + zephyr_library_link_libraries_ifdef(CONFIG_BUILD_WITH_TFM tfm_api) + + zephyr_library_named(mbedTLSX509) + + list(APPEND x509_source + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_create.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_crl.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_crt.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509_csr.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write_crt.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write_csr.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/x509write.c ) + + zephyr_library_sources(${x509_source}) + zephyr_library_link_libraries(mbedTLS) + zephyr_library() + + list(APPEND mbedtls_source + ${ZEPHYR_CURRENT_MODULE_DIR}/library/net_sockets.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_cache.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_ciphersuites.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_client.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_cookie.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_debug_helpers_generated.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_msg.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_ticket.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls12_client.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls12_server.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_client.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_generic.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_keys.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls13_server.c + ${ZEPHYR_CURRENT_MODULE_DIR}/library/ssl_tls.c + ) + + zephyr_library_sources(${mbedtls_source}) + + zephyr_library_link_libraries( + mbedTLSX509 + mbedTLSCrypto + mbedTLSBase + mbedTLS + ) + elseif(CONFIG_MBEDTLS_LIBRARY) # NB: CONFIG_MBEDTLS_LIBRARY is not regression tested and is # therefore susceptible to bit rot diff --git a/modules/mbedtls/Kconfig b/modules/mbedtls/Kconfig index c6111e0f7c32..ea6bfecac519 100644 --- a/modules/mbedtls/Kconfig +++ b/modules/mbedtls/Kconfig @@ -14,12 +14,6 @@ config MBEDTLS_PROMPTLESS mbed TLS menu prompt and instead handle the selection of MBEDTLS from dependent sub-configurations and thus prevent stuck symbol behavior. -config MBEDTLS_VERSION_4_x - bool - default y - help - Hidden Kconfig symbol used internally to mark support for Mbed TLS 4.x. - rsource "Kconfig.psa.auto" rsource "Kconfig.psa.logic" From de6c192a8a0a42430f723b6081d08ea162b151fd Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 28 Apr 2026 11:16:42 +0200 Subject: [PATCH 3276/3334] [nrf fromtree] tests: net: socket: tls: Optimize mbed TLS configuration All handshakes within the test suite are PSK-based, therefore it's only needed to enable MBEDTLS_CIPHERSUITE_TLS_PSK_WITH_AES_256_CBC_SHA384, MBEDTLS_CIPHERSUITE_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 is not needed or used in tests so it only increases the overall image size. For the few tests verifying the certificate validation, it's enough to enable X509 certificate parsing and a few dependencies. Signed-off-by: Robert Lubos (cherry picked from commit 9f299bebbd1aefbceef1b8de6ddb381aaab63214) --- tests/net/socket/tls/prj.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/net/socket/tls/prj.conf b/tests/net/socket/tls/prj.conf index 4b5a4a8d1a8d..9302ed1659e1 100644 --- a/tests/net/socket/tls/prj.conf +++ b/tests/net/socket/tls/prj.conf @@ -52,4 +52,9 @@ CONFIG_MBEDTLS_HEAP_SIZE=30000 CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID=y CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=32 CONFIG_MBEDTLS_CIPHERSUITE_TLS_PSK_WITH_AES_256_CBC_SHA384=y -CONFIG_MBEDTLS_CIPHERSUITE_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256=y + +# For tests verifying certificate validation +CONFIG_MBEDTLS_X509_CRT_PARSE_C=y +CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y +CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT=y +CONFIG_PSA_WANT_ALG_RSA_PKCS1V15_SIGN=y From 05f2699619bf6e18029a51ccf3ae012f6b72b4ca Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 28 Apr 2026 13:06:42 +0200 Subject: [PATCH 3277/3334] [nrf fromtree] tests: net: socket: tls: Specify cipher suite to use Specify what cipher suite to use for TLS/DTLS at runtime for consistent results. Otherwise, in case additional mbed TLS features are enabled (for instance with TFM enabled), different cipher suite may be chosen for TLS/DTLS by mbed TLS, affecting the tests outcome. Signed-off-by: Robert Lubos (cherry picked from commit 9a2b66992d8deb4d3d6c9854f02224e244ed68a5) --- tests/net/socket/tls/src/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/net/socket/tls/src/main.c b/tests/net/socket/tls/src/main.c index 5db92a18ff36..f8b04900974e 100644 --- a/tests/net/socket/tls/src/main.c +++ b/tests/net/socket/tls/src/main.c @@ -66,6 +66,9 @@ static void test_config_psk(int s_sock, int c_sock) sec_tag_t sec_tag_list[] = { PSK_TAG }; + const int cipher_list[] = { + MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384, + }; (void)tls_credential_delete(PSK_TAG, TLS_CREDENTIAL_PSK); (void)tls_credential_delete(PSK_TAG, TLS_CREDENTIAL_PSK_ID); @@ -81,12 +84,18 @@ static void test_config_psk(int s_sock, int c_sock) zassert_equal(zsock_setsockopt(s_sock, ZSOCK_SOL_TLS, ZSOCK_TLS_SEC_TAG_LIST, sec_tag_list, sizeof(sec_tag_list)), 0, "Failed to set PSK on server socket"); + zassert_equal(zsock_setsockopt(s_sock, ZSOCK_SOL_TLS, ZSOCK_TLS_CIPHERSUITE_LIST, + cipher_list, sizeof(cipher_list)), + 0, "Failed to set ciphersuite list on server socket"); } if (c_sock >= 0) { zassert_equal(zsock_setsockopt(c_sock, ZSOCK_SOL_TLS, ZSOCK_TLS_SEC_TAG_LIST, sec_tag_list, sizeof(sec_tag_list)), 0, "Failed to set PSK on client socket"); + zassert_equal(zsock_setsockopt(c_sock, ZSOCK_SOL_TLS, ZSOCK_TLS_CIPHERSUITE_LIST, + cipher_list, sizeof(cipher_list)), + 0, "Failed to set ciphersuite list on client socket"); } } From b2c5a64699f6c1386aff08d207701a08f08278ac Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 30 Apr 2026 12:23:15 +0300 Subject: [PATCH 3278/3334] [nrf noup] modules: mbedtls: do not always enable entropy on MBEDTLS_PSA_CRYPTO_C This is actually a fromtree of upstream PR # 108256 (commit 21e55f26e244e7d95fd0a918090e01f1fcd69fc4) but the cherry-pick conflicts too badly. This will be reverted and cherry-picked properly from upstream in the Mbed TLS update PR. Signed-off-by: Tomi Fontanilles --- modules/mbedtls/Kconfig.tf-psa-crypto | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/mbedtls/Kconfig.tf-psa-crypto b/modules/mbedtls/Kconfig.tf-psa-crypto index 23885e2c561f..3fcf8c80faef 100644 --- a/modules/mbedtls/Kconfig.tf-psa-crypto +++ b/modules/mbedtls/Kconfig.tf-psa-crypto @@ -412,7 +412,8 @@ config MBEDTLS_PKCS5_C choice MBEDTLS_PSA_CRYPTO_RNG_SOURCE prompt "PSA crypto random source" depends on MBEDTLS_PSA_CRYPTO_C - default MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG if CSPRNG_ENABLED + default MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG if CSPRNG_ENABLED \ + || !PSA_CRYPTO_PROVIDER_MBEDTLS default MBEDTLS_PSA_CRYPTO_LEGACY_RNG config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG @@ -467,7 +468,7 @@ config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG config MBEDTLS_PSA_CRYPTO_C bool "Platform Security Architecture cryptography API" depends on !BUILD_WITH_TFM - select CSPRNG_NEEDED + select CSPRNG_NEEDED if PSA_CRYPTO_PROVIDER_MBEDTLS config MBEDTLS_USE_PSA_CRYPTO bool "Use PSA APIs instead of legacy MbedTLS when possible" From 0ff6e84881b0663e3696bbd4210700f860112d29 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 5 May 2026 09:32:52 +0300 Subject: [PATCH 3279/3334] [nrf fromlist] tests: lib: uuid: fix PSA Crypto configuration The standard way to enable PSA Crypto is to enable CONFIG_PSA_CRYPTO and not CONFIG_MBEDTLS_PSA_CRYPTO_C directly. Signed-off-by: Tomi Fontanilles Upstream PR #: 108469 --- tests/lib/uuid/testcase.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/lib/uuid/testcase.yaml b/tests/lib/uuid/testcase.yaml index 9bd172c96ece..6565ba9f3b22 100644 --- a/tests/lib/uuid/testcase.yaml +++ b/tests/lib/uuid/testcase.yaml @@ -7,8 +7,7 @@ tests: libraries.uuid.base: extra_configs: - CONFIG_UUID_V5=y - - CONFIG_MBEDTLS=y - - CONFIG_MBEDTLS_PSA_CRYPTO_C=y + - CONFIG_PSA_CRYPTO=y - CONFIG_PSA_WANT_ALG_SHA_1=y - CONFIG_UUID_BASE64=y - CONFIG_BASE64=y From 7d223e28080b1f964828ccbfd569bd9b1115e594 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 5 May 2026 09:36:21 +0300 Subject: [PATCH 3280/3334] [nrf fromlist] lib: uuid: fix prerequisites for CONFIG_UUID_V5 It should not depend on CONFIG_MBEDTLS nor CONFIG_MBEDTLS_PSA_CRYPTO_C as a PSA Crypto provider other than Mbed TLS may be enabled. In fact, it doesn't even need to depend on CONFIG_PSA_CRYPTO because CONFIG_PSA_WANT_ALG_SHA_1 is already guarded behind CONFIG_PSA_CRYPTO_CLIENT. At the same time, replace all the `depends on UUID` by a single if which is the standard way to do. Also turn CONFIG_UUID into a menuconfig instead of creating a menu manually. Signed-off-by: Tomi Fontanilles Upstream PR #: 108469 --- lib/uuid/Kconfig | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/uuid/Kconfig b/lib/uuid/Kconfig index 040b7c7768c5..189893ad3935 100644 --- a/lib/uuid/Kconfig +++ b/lib/uuid/Kconfig @@ -2,25 +2,21 @@ # # SPDX-License-Identifier: Apache-2.0 -menu "Universally Unique Identifier (UUID)" - -config UUID - bool "UUID support" +menuconfig UUID + bool "Universally Unique Identifier (UUID) library" help Enable use of the UUID library. +if UUID + config UUID_V4 bool "UUID version 4 generation support" - depends on UUID depends on ENTROPY_GENERATOR help Enable generation of UUID v4. config UUID_V5 bool "UUID version 5 generation support" - depends on UUID - depends on MBEDTLS - depends on MBEDTLS_PSA_CRYPTO_C depends on PSA_WANT_ALG_SHA_1 # When TF-M is enabled, Mbed TLS's MD module (which is used to generate # v5 UUIDs) will dispacth hash operations to TF-M. Unfortunately TF-M @@ -32,10 +28,9 @@ config UUID_V5 config UUID_BASE64 bool "UUID Base64 support" - depends on UUID depends on BASE64 help Enable conversion functions to write UUIDs in base 64 formats. -endmenu +endif From 2b3d25313ec3e7740d369f03ea86a4dbe83a6e19 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Tue, 5 May 2026 09:42:19 +0300 Subject: [PATCH 3281/3334] [nrf fromlist] lib: uuid: link to mbedTLS only when CONFIG_MBEDTLS_BUILTIN Otherwise the CMake library may not exist and the linker command would wrongfully get populated with `-lmbedTLS`. Signed-off-by: Tomi Fontanilles Upstream PR #: 108469 --- lib/uuid/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uuid/CMakeLists.txt b/lib/uuid/CMakeLists.txt index fa0b91ac5c5a..e0d58982e368 100644 --- a/lib/uuid/CMakeLists.txt +++ b/lib/uuid/CMakeLists.txt @@ -2,4 +2,4 @@ zephyr_sources_ifdef(CONFIG_UUID uuid.c) -zephyr_library_link_libraries_ifdef(CONFIG_UUID_V5 mbedTLS) +zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS_BUILTIN mbedTLS) From 3d219f30648b43390faef7920286a1b3a2dd7da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 25 Mar 2026 11:39:31 +0100 Subject: [PATCH 3282/3334] [nrf fromtree] drivers: serial: nrfx_uarte: Add support for variable frame size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nRF54x devices supports 4-9 bit frame size. Extend UART driver to support data sizes supported by the Zephyr UART API (5-9 bits). Signed-off-by: Krzysztof Chruściński (cherry picked from commit 67f1cee8979c04ae06cbf0e6b44ee185aa1d1218) --- drivers/serial/uart_nrfx_uarte.c | 38 ++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 60e8c23cd178..e35fbba89387 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -336,6 +336,14 @@ struct uarte_nrfx_data { (baudrate) == 921600 ? NRF_UARTE_BAUDRATE_921600 : \ (baudrate) == 1000000 ? NRF_UARTE_BAUDRATE_1000000 : 0) +/* Convert Zephyr data bits enum to HAL enum. Use 8 bit data size first as it is the most common. */ +#define DATABITS_TO_NRF_FRAMESIZE(data_bits) \ + ((data_bits) == UART_CFG_DATA_BITS_8 ? NRF_UARTE_FRAME_SIZE_8_BIT : \ + (data_bits) == UART_CFG_DATA_BITS_5 ? NRF_UARTE_FRAME_SIZE_5_BIT : \ + (data_bits) == UART_CFG_DATA_BITS_6 ? NRF_UARTE_FRAME_SIZE_6_BIT : \ + (data_bits) == UART_CFG_DATA_BITS_7 ? NRF_UARTE_FRAME_SIZE_7_BIT : \ + NRF_UARTE_FRAME_SIZE_9_BIT) + #define UARTE_MIN_BUF_SWAP_LEN 10 #define UARTE_US_TO_BYTES(baudrate) \ @@ -618,9 +626,11 @@ static int uarte_nrfx_configure(const struct device *dev, } #endif +#ifndef NRF_UARTE_HAS_FRAME_SIZE if (cfg->data_bits != UART_CFG_DATA_BITS_8) { return -ENOTSUP; } +#endif switch (cfg->flow_ctrl) { case UART_CFG_FLOW_CTRL_NONE: @@ -662,7 +672,7 @@ static int uarte_nrfx_configure(const struct device *dev, #endif #if NRF_UARTE_HAS_FRAME_SIZE - uarte_cfg.frame_size = NRF_UARTE_FRAME_SIZE_8_BIT; + uarte_cfg.frame_size = DATABITS_TO_NRF_FRAMESIZE(cfg->data_bits); uarte_cfg.endian = NRF_UARTE_ENDIAN_MSB; #endif @@ -3241,6 +3251,28 @@ static int uarte_instance_deinit(const struct device *dev) #define UARTE_DISABLE_RX_INIT(node_id) \ .disable_rx = DT_PROP(node_id, disable_rx) +#define _NRF_DT_FRAMESIZE(data_bits) ((data_bits) == 5 ? NRF_UARTE_FRAME_SIZE_5_BIT : \ + (data_bits) == 6 ? NRF_UARTE_FRAME_SIZE_6_BIT : \ + (data_bits) == 7 ? NRF_UARTE_FRAME_SIZE_7_BIT : \ + (data_bits) == 8 ? NRF_UARTE_FRAME_SIZE_8_BIT : NRF_UARTE_FRAME_SIZE_9_BIT) + +/* Convert DT numeric value to HAL enum. */ +#define NRF_DT_FRAMESIZE(idx) \ + COND_CODE_1(UARTE_HAS_PROP(idx, data_bits), \ + (_NRF_DT_FRAMESIZE(UARTE_PROP(idx, data_bits))), \ + (NRF_UARTE_FRAME_SIZE_8_BIT)) + +#define _CFG_DATA_BITS(data_bits) ((data_bits) == 5 ? UART_CFG_DATA_BITS_5 : \ + (data_bits) == 6 ? UART_CFG_DATA_BITS_6 : \ + (data_bits) == 7 ? UART_CFG_DATA_BITS_7 : \ + (data_bits) == 8 ? UART_CFG_DATA_BITS_8 : UART_CFG_DATA_BITS_9) + +/* Convert DT numeric value used for data bits to enum specified in the API. */ +#define CFG_DATA_BITS(idx) \ + COND_CODE_1(UTIL_AND(NRF_UARTE_HAS_FRAME_SIZE, UARTE_HAS_PROP(idx, data_bits)), \ + (_CFG_DATA_BITS(UARTE_PROP(idx, data_bits))), \ + (UART_CFG_DATA_BITS_8)) + /* Get frequency divider that is used to adjust the BAUDRATE value. */ #define UARTE_GET_BAUDRATE_DIV(f_pclk) (f_pclk / NRF_UARTE_BASE_FREQUENCY_16MHZ) @@ -3269,12 +3301,14 @@ static int uarte_instance_deinit(const struct device *dev) (.paritytype = NRF_UARTE_PARITYTYPE_EVEN,)) \ IF_ENABLED(UARTE_HAS_FRAME_TIMEOUT, \ (.frame_timeout = NRF_UARTE_FRAME_TIMEOUT_EN,)) \ + IF_ENABLED(NRF_UARTE_HAS_FRAME_SIZE, \ + (.frame_size = NRF_DT_FRAMESIZE(idx),)) \ } /* Macro for setting zephyr specific configuration structures. */ #define UARTE_CONFIG(idx) { \ .baudrate = UARTE_PROP(idx, current_speed), \ - .data_bits = UART_CFG_DATA_BITS_8, \ + .data_bits = CFG_DATA_BITS(idx), \ .stop_bits = UART_CFG_STOP_BITS_1, \ .parity = IS_ENABLED(CONFIG_UART_##idx##_NRF_PARITY_BIT) \ ? UART_CFG_PARITY_EVEN \ From 5b0c1eaa030936ca55f76451f3e77e7c7638f667 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 7 May 2026 16:04:32 +0200 Subject: [PATCH 3283/3334] [nrf fromlist] manifest: update hal_nordic to have nrfx 4.3.0 release New nrfx 4.3.0 contains MDK 8.75.3. Upstream PR #: 108683 Signed-off-by: Nikodem Kastelik --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index cadc129db3e8..daeca60e3fbc 100644 --- a/west.yml +++ b/west.yml @@ -203,7 +203,7 @@ manifest: groups: - hal - name: hal_nordic - revision: c8f0c2b6ecf66b0a4af24b5272d879c305868feb + revision: a820f00abfc2fe2f4d03ebdb3d185e21607e9006 path: modules/hal/nordic groups: - hal From 8a0b5c7c5f089609be59632d88648e0039e8038b Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Tue, 5 May 2026 07:40:38 +0200 Subject: [PATCH 3284/3334] Revert "[nrf noup] soc/nordic/nrf54h: Add extension to define custom s2ram implementation" This reverts commit 3397db3094781753a75f166c32cab272a05ecc2a. Signed-off-by: Jakub Zymelka --- soc/nordic/common/CMakeLists.txt | 4 +--- soc/nordic/nrf54h/Kconfig | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index c4042a73ffde..a2123ab884ab 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -23,9 +23,7 @@ if(CONFIG_NRF_PLATFORM_HALTIUM AND CONFIG_ARM) FILTER ".*\\.cache_retain_and_sleep" LOCATION PMLocalRamfunc_TEXT ) - if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) - zephyr_library_sources_ifdef(CONFIG_PM_S2RAM haltium_pm_s2ram.c) - endif() + zephyr_library_sources_ifdef(CONFIG_PM_S2RAM haltium_pm_s2ram.c) zephyr_library_sources_ifdef(CONFIG_CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS nrf54hx_nrf92x_mpu_regions.c) zephyr_library_sources(soc_lrcconf.c) endif() diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 95ef4d89b4a5..0e95b41556fb 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -106,11 +106,6 @@ config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND default y depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD -config SOC_NRF54H20_PM_S2RAM_OVERRIDE - bool "Override `pm_s2ram` implementation" - help - Override Nordic s2ram implementation. - config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON From 8df80565483a9145b1c256239a1103ca9647f59c Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Tue, 5 May 2026 07:40:40 +0200 Subject: [PATCH 3285/3334] Revert "[nrf noup] soc: nrf54h: work around missing power domain handling" This reverts commit 71d16fb8c1181b8e17ecddbd6f7cd07733cba34a. Signed-off-by: Jakub Zymelka --- soc/nordic/nrf54h/Kconfig | 5 ----- soc/nordic/nrf54h/soc.c | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 0e95b41556fb..c95b11528f4c 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -101,11 +101,6 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT endif # SOC_NRF54H20_CPURAD_ENABLE -config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND - bool "Disable all GPIO pin retention on boot" - default y - depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD - config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 740d58d5a339..e5cf9c34fc69 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -15,7 +15,6 @@ #include #endif -#include #include #include #include @@ -135,17 +134,6 @@ void soc_early_init_hook(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } - - /* This is a workaround for not yet having upstream patches for properly handling - * pin retention. It should be removed as part of the next upmerge. - */ - if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) { - NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST; - - for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) { - nrf_gpio_port_retain_set(gpio_regs[i], 0); - } - } } #if defined(CONFIG_SOC_LATE_INIT_HOOK) From 5169102eaededf2f0c8135663151c826246dd5d1 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 16 Apr 2026 11:34:47 +0200 Subject: [PATCH 3286/3334] [nrf fromtree] soc: nordic: remove haltium and lumos platform abstractions 1. Remove the NRF_PLATFORM_HALTIUM and NRF_PLATFORM_LUMOS Kconfig symbols and eliminate all "haltium"/"lumos" naming from the zephyr directory. 2. The shared haltium_power.c/h and haltium_pm_s2ram.c/h files from soc/nordic/common/ are duplicated into the per-SoC-series directories (nrf54h/ and nrf92/) as soc_power.c/h and soc_pm_s2ram.c/h. The corresponding build rules are moved from common/CMakeLists.txt to the per-series CMakeLists.txt files. 3. Kconfig guards that relied on the platform symbols are replaced with individual hardware feature checks derived from nrfx/MDK: - select NRFX_POWER if !NRF_PLATFORM_HALTIUM -> if HAS_HW_NRF_POWER - CLOCK_CONTROL default ... !NRF_PLATFORM_HALTIUM -> HAS_HW_NRF_CLOCK - depends on NRF_PLATFORM_LUMOS -> SOC_SERIES_NRF54L||SOC_SERIES_NRF71 4. C preprocessor guards using CONFIG_NRF_PLATFORM_HALTIUM are replaced with explicit SoC series checks (CONFIG_SOC_SERIES_NRF54H || CONFIG_SOC_SERIES_NRF92). 5. The sysbuild option NRF_HALTIUM_GENERATE_UICR is renamed to NRF_GENERATE_UICR. Signed-off-by: Jakub Zymelka (cherry picked from commit 91830dd575661312b28e26c9dccff5a230528ef9) --- drivers/hwinfo/hwinfo_nrf.c | 2 +- modules/hal_nordic/ironside/se/CMakeLists.txt | 4 +- soc/nordic/Kconfig | 16 +- soc/nordic/Kconfig.defconfig | 5 +- soc/nordic/common/CMakeLists.txt | 9 +- soc/nordic/common/Kconfig | 2 +- soc/nordic/common/poweroff.c | 6 +- soc/nordic/common/uicr/Kconfig.sysbuild | 2 +- soc/nordic/nrf54h/CMakeLists.txt | 7 + soc/nordic/nrf54h/Kconfig | 1 - soc/nordic/nrf54h/soc.c | 2 +- .../soc_pm_s2ram.c} | 4 +- soc/nordic/nrf54h/soc_pm_s2ram.h | 31 ++ .../haltium_power.c => nrf54h/soc_power.c} | 14 +- .../haltium_power.h => nrf54h/soc_power.h} | 8 +- soc/nordic/nrf54l/Kconfig | 1 - soc/nordic/nrf71/Kconfig | 1 - soc/nordic/nrf92/CMakeLists.txt | 7 + soc/nordic/nrf92/Kconfig | 1 - soc/nordic/nrf92/soc.c | 2 +- soc/nordic/nrf92/soc_pm_s2ram.c | 137 ++++++++ .../soc_pm_s2ram.h} | 8 +- soc/nordic/nrf92/soc_power.c | 316 ++++++++++++++++++ soc/nordic/nrf92/soc_power.h | 33 ++ soc/nordic/sysbuild.cmake | 2 +- soc/nordic/validate_base_addresses.c | 2 +- tests/lib/cpp/cxx/testcase.yaml | 5 +- 27 files changed, 566 insertions(+), 62 deletions(-) rename soc/nordic/{common/haltium_pm_s2ram.c => nrf54h/soc_pm_s2ram.c} (98%) create mode 100644 soc/nordic/nrf54h/soc_pm_s2ram.h rename soc/nordic/{common/haltium_power.c => nrf54h/soc_power.c} (95%) rename soc/nordic/{common/haltium_power.h => nrf54h/soc_power.h} (70%) create mode 100644 soc/nordic/nrf92/soc_pm_s2ram.c rename soc/nordic/{common/haltium_pm_s2ram.h => nrf92/soc_pm_s2ram.h} (82%) create mode 100644 soc/nordic/nrf92/soc_power.c create mode 100644 soc/nordic/nrf92/soc_power.h diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index df4b8e34bffa..c7803d19b3b6 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -9,7 +9,7 @@ #include #include #if defined(CONFIG_BOARD_QEMU_CORTEX_M0) || \ - (defined(CONFIG_NRF_PLATFORM_HALTIUM) && \ + ((defined(CONFIG_SOC_SERIES_NRF54H) || defined(CONFIG_SOC_SERIES_NRF92)) && \ defined(CONFIG_RISCV_CORE_NORDIC_VPR)) #define RESET_CAUSE_AVAILABLE 0 #else diff --git a/modules/hal_nordic/ironside/se/CMakeLists.txt b/modules/hal_nordic/ironside/se/CMakeLists.txt index ee5b2be8e2fa..771186cf24bc 100644 --- a/modules/hal_nordic/ironside/se/CMakeLists.txt +++ b/modules/hal_nordic/ironside/se/CMakeLists.txt @@ -48,7 +48,7 @@ if(CONFIG_NRF_PERIPHCONF_SECTION AND NOT SYSBUILD) message(WARNING "CONFIG_NRF_PERIPHCONF_SECTION is enabled, but Sysbuild is not being used. " "The global peripheral configuration will not be applied unless artifacts " "are generated manually/externally. To enable automatic generation, build with " - "Sysbuild and ensure that SB_CONFIG_NRF_HALTIUM_GENERATE_UICR=y." + "Sysbuild and ensure that SB_CONFIG_NRF_GENERATE_UICR=y." ) endif() @@ -56,6 +56,6 @@ if(CONFIG_NRF_MPCCONF_SECTION AND NOT SYSBUILD) message(WARNING "CONFIG_NRF_MPCCONF_SECTION is enabled, but Sysbuild is not being used. " "The MPC configuration will not be applied unless artifacts " "are generated manually/externally. To enable automatic generation, build with " - "Sysbuild and ensure that SB_CONFIG_NRF_HALTIUM_GENERATE_UICR=y." + "Sysbuild and ensure that SB_CONFIG_NRF_GENERATE_UICR=y." ) endif() diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 6a8b8a0810e4..14ad91f6b1a3 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -219,7 +219,7 @@ endchoice config NRF_SKIP_CLOCK_CONFIG bool prompt "Skip clock frequency configuration" if TRUSTED_EXECUTION_SECURE - depends on NRF_PLATFORM_LUMOS + depends on SOC_SERIES_NRF54L || SOC_SERIES_NRF71 default y if TRUSTED_EXECUTION_NONSECURE help With this option, the CPU clock frequency is not set during system initialization. @@ -233,18 +233,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. - -config NRF_PLATFORM_LUMOS - bool - help - SoC series based on the Nordic nRF Lumos platform such as nRF54Lx - series. This allows to easily enable common functionality on - SoCs based on the Lumos platform. - endif # SOC_FAMILY_NORDIC_NRF diff --git a/soc/nordic/Kconfig.defconfig b/soc/nordic/Kconfig.defconfig index b1490a2f338c..7972374e57c2 100644 --- a/soc/nordic/Kconfig.defconfig +++ b/soc/nordic/Kconfig.defconfig @@ -7,11 +7,8 @@ if SOC_FAMILY_NORDIC_NRF rsource "*/Kconfig.defconfig" -# If the kernel has timer support, enable clock control, except for SoCs -# based on the Haltium platform SoCs where clock control is not needed -# for the system timer config CLOCK_CONTROL - default y if SYS_CLOCK_EXISTS && !NRF_PLATFORM_HALTIUM && !RISCV_CORE_NORDIC_VPR + default y if SYS_CLOCK_EXISTS && !SOC_SERIES_NRF54H && !SOC_SERIES_NRF92 && !RISCV_CORE_NORDIC_VPR config SYS_CLOCK_TICKS_PER_SEC default 128 if !TICKLESS_KERNEL diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index a2123ab884ab..7d1feb04c76a 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -16,14 +16,7 @@ endif() zephyr_library_sources_ifdef(CONFIG_POWEROFF poweroff.c) -if(CONFIG_NRF_PLATFORM_HALTIUM AND CONFIG_ARM) - zephyr_library_sources(haltium_power.c) - zephyr_code_relocate( - FILES haltium_power.c - FILTER ".*\\.cache_retain_and_sleep" - LOCATION PMLocalRamfunc_TEXT - ) - zephyr_library_sources_ifdef(CONFIG_PM_S2RAM haltium_pm_s2ram.c) +if((CONFIG_SOC_SERIES_NRF54H OR CONFIG_SOC_SERIES_NRF92) AND CONFIG_ARM) zephyr_library_sources_ifdef(CONFIG_CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS nrf54hx_nrf92x_mpu_regions.c) zephyr_library_sources(soc_lrcconf.c) endif() diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index f1c31e46551b..7c522cc0ce69 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -19,7 +19,7 @@ config NRF_FORCE_RAM_ON_REBOOT config NRF_SYS_EVENT bool "nRF system event support" - select NRFX_POWER if !NRF_PLATFORM_HALTIUM + select NRFX_POWER if !SOC_SERIES_NRF54H && !SOC_SERIES_NRF92 if NRF_SYS_EVENT diff --git a/soc/nordic/common/poweroff.c b/soc/nordic/common/poweroff.c index bb64459bf82b..6bb2068abb35 100644 --- a/soc/nordic/common/poweroff.c +++ b/soc/nordic/common/poweroff.c @@ -11,8 +11,8 @@ #include "tfm_platform_api.h" #elif defined(CONFIG_SOC_SERIES_NRF51) || defined(CONFIG_SOC_SERIES_NRF52) #include -#elif defined(CONFIG_NRF_PLATFORM_HALTIUM) -#include +#elif defined(CONFIG_SOC_SERIES_NRF54H) || defined(CONFIG_SOC_SERIES_NRF92) +#include #else #include #endif @@ -78,7 +78,7 @@ void z_sys_poweroff(void) #endif #if defined(CONFIG_SOC_SERIES_NRF51) || defined(CONFIG_SOC_SERIES_NRF52) nrf_power_system_off(NRF_POWER); -#elif defined(CONFIG_NRF_PLATFORM_HALTIUM) +#elif defined(CONFIG_SOC_SERIES_NRF54H) || defined(CONFIG_SOC_SERIES_NRF92) nrf_poweroff(); #else nrf_regulators_system_off(NRF_REGULATORS); diff --git a/soc/nordic/common/uicr/Kconfig.sysbuild b/soc/nordic/common/uicr/Kconfig.sysbuild index df44dc0fcc99..b16c819aafd1 100644 --- a/soc/nordic/common/uicr/Kconfig.sysbuild +++ b/soc/nordic/common/uicr/Kconfig.sysbuild @@ -1,7 +1,7 @@ # Copyright (c) 2025 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config NRF_HALTIUM_GENERATE_UICR +config NRF_GENERATE_UICR bool "Generate UICR artifacts" depends on SOC_SERIES_NRF54H || SOC_SERIES_NRF92 default y diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 7099e79d2a41..2afd82ec13cc 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -3,6 +3,13 @@ if(CONFIG_ARM) zephyr_library_sources(soc.c) + zephyr_library_sources(soc_power.c) + zephyr_code_relocate( + FILES soc_power.c + FILTER ".*\\.cache_retain_and_sleep" + LOCATION PMLocalRamfunc_TEXT + ) + zephyr_library_sources_ifdef(CONFIG_PM_S2RAM soc_pm_s2ram.c) endif() if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index c95b11528f4c..bb2d2b954ee5 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -9,7 +9,6 @@ config SOC_SERIES_NRF54H select HAS_NRFX select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM - select NRF_PLATFORM_HALTIUM config SOC_SERIES_NRF54HX select DEPRECATED diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index e5cf9c34fc69..654c7151a016 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include "soc_power.h" #include #if defined(CONFIG_SOC_NRF54H20_CPURAD_ENABLE) diff --git a/soc/nordic/common/haltium_pm_s2ram.c b/soc/nordic/nrf54h/soc_pm_s2ram.c similarity index 98% rename from soc/nordic/common/haltium_pm_s2ram.c rename to soc/nordic/nrf54h/soc_pm_s2ram.c index 1910e0f8fe6d..054ad527f611 100644 --- a/soc/nordic/common/haltium_pm_s2ram.c +++ b/soc/nordic/nrf54h/soc_pm_s2ram.c @@ -11,8 +11,8 @@ #include #include #include -#include "haltium_pm_s2ram.h" -#include "haltium_power.h" +#include "soc_pm_s2ram.h" +#include "soc_power.h" #include diff --git a/soc/nordic/nrf54h/soc_pm_s2ram.h b/soc/nordic/nrf54h/soc_pm_s2ram.h new file mode 100644 index 000000000000..457bef4ff6e8 --- /dev/null +++ b/soc/nordic/nrf54h/soc_pm_s2ram.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file Common pm_s2ram.h include for Nordic nRF54H SoCs. + */ + +#ifndef ZEPHYR_SOC_NORDIC_NRF54H_SOC_PM_S2RAM_H_ +#define ZEPHYR_SOC_NORDIC_NRF54H_SOC_PM_S2RAM_H_ + +/** + * @brief Save CPU state on suspend + * + * This function is used on suspend-to-RAM (S2RAM) to save the CPU state in + * (retained) RAM before powering the system off using the provided function. + * This function is usually called from the PM subsystem / hooks. + * + * The CPU state consist of internal registers and peripherals like + * interrupt controller, memory controllers, etc. + * + * @param system_off Function to power off the system. + * + * @retval 0 The CPU context was successfully saved and restored. + * @retval -EBUSY The system is busy and cannot be suspended at this time. + * @retval -errno Negative errno code in case of failure. + */ +int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off); + +#endif /* ZEPHYR_SOC_NORDIC_NRF54H_SOC_PM_S2RAM_H_ */ diff --git a/soc/nordic/common/haltium_power.c b/soc/nordic/nrf54h/soc_power.c similarity index 95% rename from soc/nordic/common/haltium_power.c rename to soc/nordic/nrf54h/soc_power.c index aa4fcb1616e3..692a54ec7f53 100644 --- a/soc/nordic/common/haltium_power.c +++ b/soc/nordic/nrf54h/soc_power.c @@ -12,12 +12,12 @@ #include #include #include -#include +#include "soc_power.h" #include #include -#include "haltium_pm_s2ram.h" +#include "soc_pm_s2ram.h" -#if defined(CONFIG_SOC_NRF54H20_CPUAPP) || defined(CONFIG_SOC_NRF9280_CPUAPP) +#if defined(CONFIG_SOC_NRF54H20_CPUAPP) #define RAMBLOCK_CONTROL_BIT_ICACHE MEMCONF_POWER_CONTROL_MEM1_Pos #define RAMBLOCK_CONTROL_BIT_DCACHE MEMCONF_POWER_CONTROL_MEM2_Pos #define RAMBLOCK_POWER_ID 0 @@ -25,7 +25,7 @@ #define RAMBLOCK_RET_MASK (MEMCONF_POWER_RET_MEM0_Msk) #define RAMBLOCK_RET_BIT_ICACHE MEMCONF_POWER_RET_MEM1_Pos #define RAMBLOCK_RET_BIT_DCACHE MEMCONF_POWER_RET_MEM2_Pos -#elif defined(CONFIG_SOC_NRF54H20_CPURAD) || defined(CONFIG_SOC_NRF9280_CPURAD) +#elif defined(CONFIG_SOC_NRF54H20_CPURAD) #define RAMBLOCK_CONTROL_BIT_ICACHE MEMCONF_POWER_CONTROL_MEM6_Pos #define RAMBLOCK_CONTROL_BIT_DCACHE MEMCONF_POWER_CONTROL_MEM7_Pos #define RAMBLOCK_POWER_ID 0 @@ -250,7 +250,7 @@ static void s2ram_exit(void) /* Function called during local domain suspend to RAM. */ static int sys_suspend_to_ram(void) { - /* Set intormation which is used on domain wakeup to determine if resume from RAM shall + /* Set information which is used on domain wakeup to determine if resume from RAM shall * be performed. */ nrf_resetinfo_resetreas_local_set(NRF_RESETINFO, @@ -268,7 +268,7 @@ static int sys_suspend_to_ram(void) __DSB(); __WFI(); /* - * We might reach this point is k_cpu_idle returns (there is a pre sleep hook that + * We might reach this point if k_cpu_idle returns (there is a pre sleep hook that * can abort sleeping. */ return -EBUSY; @@ -277,7 +277,7 @@ static int sys_suspend_to_ram(void) static void s2ram_enter(void) { /* - * Save the CPU context (including the return address),set the SRAM + * Save the CPU context (including the return address), set the SRAM * marker and power off the system. */ if (soc_s2ram_suspend(sys_suspend_to_ram)) { diff --git a/soc/nordic/common/haltium_power.h b/soc/nordic/nrf54h/soc_power.h similarity index 70% rename from soc/nordic/common/haltium_power.h rename to soc/nordic/nrf54h/soc_power.h index e9bac733cf19..8d8ed8a8a8f2 100644 --- a/soc/nordic/common/haltium_power.h +++ b/soc/nordic/nrf54h/soc_power.h @@ -4,11 +4,11 @@ */ /** - * @file Common power.h include for Nordic Haltium SoCs. + * @file Common power management for Nordic nRF54H SoCs. */ -#ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_HALTIUM_POWER_H_ -#define _ZEPHYR_SOC_ARM_NORDIC_NRF_HALTIUM_POWER_H_ +#ifndef ZEPHYR_SOC_NORDIC_NRF54H_SOC_POWER_H_ +#define ZEPHYR_SOC_NORDIC_NRF54H_SOC_POWER_H_ /** * @brief Power domain early init. @@ -30,4 +30,4 @@ void nrf_poweroff(void); void nrf_power_up_cache(void); #endif /* defined(CONFIG_PM) || defined(CONFIG_POWEROFF) */ -#endif /* _ZEPHYR_SOC_ARM_NORDIC_NRF_HALTIUM_POWER_H_ */ +#endif /* ZEPHYR_SOC_NORDIC_NRF54H_SOC_POWER_H_ */ diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 94a76b03e919..86f44c615bec 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -8,7 +8,6 @@ config SOC_SERIES_NRF54L select HAS_NRFX select HAS_NORDIC_DRIVERS select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE - select NRF_PLATFORM_LUMOS config SOC_SERIES_NRF54LX select DEPRECATED diff --git a/soc/nordic/nrf71/Kconfig b/soc/nordic/nrf71/Kconfig index e58604ab3102..8f2ca6890e51 100644 --- a/soc/nordic/nrf71/Kconfig +++ b/soc/nordic/nrf71/Kconfig @@ -10,7 +10,6 @@ config SOC_SERIES_NRF71 select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select SOC_EARLY_INIT_HOOK select SOC_RESET_HOOK - select NRF_PLATFORM_LUMOS config SOC_NRF7120_ENGA_CPUAPP select ARM diff --git a/soc/nordic/nrf92/CMakeLists.txt b/soc/nordic/nrf92/CMakeLists.txt index 1aa4723814f5..a792b3e97167 100644 --- a/soc/nordic/nrf92/CMakeLists.txt +++ b/soc/nordic/nrf92/CMakeLists.txt @@ -3,6 +3,13 @@ if(CONFIG_ARM) zephyr_library_sources(soc.c) + zephyr_library_sources(soc_power.c) + zephyr_code_relocate( + FILES soc_power.c + FILTER ".*\\.cache_retain_and_sleep" + LOCATION PMLocalRamfunc_TEXT + ) + zephyr_library_sources_ifdef(CONFIG_PM_S2RAM soc_pm_s2ram.c) endif() zephyr_include_directories(.) diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index 251439d07706..3f87504fca13 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -9,7 +9,6 @@ config SOC_SERIES_NRF92 select HAS_NRFX select HAS_NORDIC_DRIVERS select SOC_EARLY_INIT_HOOK if ARM - select NRF_PLATFORM_HALTIUM select EXPERIMENTAL if MCUBOOT config SOC_SERIES_NRF92X diff --git a/soc/nordic/nrf92/soc.c b/soc/nordic/nrf92/soc.c index 46b831db4c07..07adae890a26 100644 --- a/soc/nordic/nrf92/soc.c +++ b/soc/nordic/nrf92/soc.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include "soc_power.h" #include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); diff --git a/soc/nordic/nrf92/soc_pm_s2ram.c b/soc/nordic/nrf92/soc_pm_s2ram.c new file mode 100644 index 000000000000..ac5fecd93b57 --- /dev/null +++ b/soc/nordic/nrf92/soc_pm_s2ram.c @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "soc_pm_s2ram.h" +#include "soc_power.h" + +#include + +#define NVIC_MEMBER_SIZE(member) ARRAY_SIZE(((NVIC_Type *)0)->member) + +/* Coprocessor Power Control Register Definitions */ +#define SCnSCB_CPPWR_SU11_Pos 22U /*!< CPPWR: SU11 Position */ +#define SCnSCB_CPPWR_SU11_Msk (1UL << SCnSCB_CPPWR_SU11_Pos) /*!< CPPWR: SU11 Mask */ + +#define SCnSCB_CPPWR_SU10_Pos 20U /*!< CPPWR: SU10 Position */ +#define SCnSCB_CPPWR_SU10_Msk (1UL << SCnSCB_CPPWR_SU10_Pos) /*!< CPPWR: SU10 Mask */ + +typedef struct { + /* NVIC components stored into RAM. */ + uint32_t ISER[NVIC_MEMBER_SIZE(ISER)]; + uint32_t ISPR[NVIC_MEMBER_SIZE(ISPR)]; + uint8_t IPR[NVIC_MEMBER_SIZE(IPR)]; +} _nvic_context_t; + +struct backup { + _nvic_context_t nvic_context; +#if defined(CONFIG_ARM_MPU) + struct z_mpu_context_retained mpu_context; +#endif + struct scb_context scb_context; +#if defined(CONFIG_FPU) && !defined(CONFIG_FPU_SHARING) + struct fpu_ctx_full fpu_context; +#endif +}; + +static __noinit struct backup backup_data; + +static void nvic_save(_nvic_context_t *backup) +{ + memcpy(backup->ISER, (uint32_t *)NVIC->ISER, sizeof(NVIC->ISER)); + memcpy(backup->ISPR, (uint32_t *)NVIC->ISPR, sizeof(NVIC->ISPR)); + memcpy(backup->IPR, (uint32_t *)NVIC->IPR, sizeof(NVIC->IPR)); +} + +static void nvic_restore(_nvic_context_t *backup) +{ + memcpy((uint32_t *)NVIC->ISER, backup->ISER, sizeof(NVIC->ISER)); + memcpy((uint32_t *)NVIC->ISPR, backup->ISPR, sizeof(NVIC->ISPR)); + memcpy((uint32_t *)NVIC->IPR, backup->IPR, sizeof(NVIC->IPR)); +} + +#if defined(CONFIG_FPU) +static void fpu_power_down(void) +{ + SCB->CPACR &= (~(CPACR_CP10_Msk | CPACR_CP11_Msk)); + SCnSCB->CPPWR |= (SCnSCB_CPPWR_SU11_Msk | SCnSCB_CPPWR_SU10_Msk); + __DSB(); + __ISB(); +} + +static void fpu_power_up(void) +{ + SCnSCB->CPPWR &= (~(SCnSCB_CPPWR_SU11_Msk | SCnSCB_CPPWR_SU10_Msk)); + SCB->CPACR |= (CPACR_CP10_Msk | CPACR_CP11_Msk); + __DSB(); + __ISB(); +} +#endif /* defined(CONFIG_FPU) */ + +int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) +{ + int ret; + + z_arm_save_scb_context(&backup_data.scb_context); +#if defined(CONFIG_FPU) +#if !defined(CONFIG_FPU_SHARING) + z_arm_save_fp_context(&backup_data.fpu_context); +#endif + fpu_power_down(); +#endif + nvic_save(&backup_data.nvic_context); +#if defined(CONFIG_ARM_MPU) + z_arm_save_mpu_context(&backup_data.mpu_context); +#endif + ret = arch_pm_s2ram_suspend(system_off); + /* Cache and FPU are powered down so power up is needed even if s2ram failed. */ + nrf_power_up_cache(); +#if defined(CONFIG_FPU) + fpu_power_up(); +#if !defined(CONFIG_FPU_SHARING) + /* Also the FPU content might be lost. */ + z_arm_restore_fp_context(&backup_data.fpu_context); +#endif +#endif + if (ret < 0) { + return ret; + } + +#if defined(CONFIG_ARM_MPU) + z_arm_restore_mpu_context(&backup_data.mpu_context); +#endif + nvic_restore(&backup_data.nvic_context); + z_arm_restore_scb_context(&backup_data.scb_context); + + return ret; +} + +void pm_s2ram_mark_set(void) +{ + /* empty */ +} + +bool pm_s2ram_mark_check_and_clear(void) +{ + bool restore_valid; + uint32_t reset_reason = nrf_resetinfo_resetreas_local_get(NRF_RESETINFO); + + if (reset_reason != NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK) { + return false; + } + nrf_resetinfo_resetreas_local_set(NRF_RESETINFO, 0); + + restore_valid = nrf_resetinfo_restore_valid_check(NRF_RESETINFO); + nrf_resetinfo_restore_valid_set(NRF_RESETINFO, false); + + return restore_valid; +} diff --git a/soc/nordic/common/haltium_pm_s2ram.h b/soc/nordic/nrf92/soc_pm_s2ram.h similarity index 82% rename from soc/nordic/common/haltium_pm_s2ram.h rename to soc/nordic/nrf92/soc_pm_s2ram.h index 01c098ea4310..235ebefa8d15 100644 --- a/soc/nordic/common/haltium_pm_s2ram.h +++ b/soc/nordic/nrf92/soc_pm_s2ram.h @@ -4,11 +4,11 @@ */ /** - * @file Common pm_s2ram.h include for Nordic SoCs. + * @file Common pm_s2ram.h include for Nordic nRF92 SoCs. */ -#ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ -#define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ +#ifndef ZEPHYR_SOC_NORDIC_NRF92_SOC_PM_S2RAM_H_ +#define ZEPHYR_SOC_NORDIC_NRF92_SOC_PM_S2RAM_H_ #define MCUBOOT_S2RAM_RESUME_MAGIC 0x75832419 @@ -35,4 +35,4 @@ struct mcuboot_resume_s { */ int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off); -#endif /* _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ */ +#endif /* ZEPHYR_SOC_NORDIC_NRF92_SOC_PM_S2RAM_H_ */ diff --git a/soc/nordic/nrf92/soc_power.c b/soc/nordic/nrf92/soc_power.c new file mode 100644 index 000000000000..fe96d9d8cbd8 --- /dev/null +++ b/soc/nordic/nrf92/soc_power.c @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "soc_power.h" +#include +#include +#include "soc_pm_s2ram.h" + +#if defined(CONFIG_SOC_NRF9280_CPUAPP) +#define RAMBLOCK_CONTROL_BIT_ICACHE MEMCONF_POWER_CONTROL_MEM1_Pos +#define RAMBLOCK_CONTROL_BIT_DCACHE MEMCONF_POWER_CONTROL_MEM2_Pos +#define RAMBLOCK_POWER_ID 0 +#define RAMBLOCK_CONTROL_OFF 0 +#define RAMBLOCK_RET_MASK (MEMCONF_POWER_RET_MEM0_Msk) +#define RAMBLOCK_RET_BIT_ICACHE MEMCONF_POWER_RET_MEM1_Pos +#define RAMBLOCK_RET_BIT_DCACHE MEMCONF_POWER_RET_MEM2_Pos +#elif defined(CONFIG_SOC_NRF9280_CPURAD) +#define RAMBLOCK_CONTROL_BIT_ICACHE MEMCONF_POWER_CONTROL_MEM6_Pos +#define RAMBLOCK_CONTROL_BIT_DCACHE MEMCONF_POWER_CONTROL_MEM7_Pos +#define RAMBLOCK_POWER_ID 0 +#define RAMBLOCK_CONTROL_OFF 0 +#define RAMBLOCK_RET_MASK \ + (MEMCONF_POWER_RET_MEM0_Msk | MEMCONF_POWER_RET_MEM1_Msk | MEMCONF_POWER_RET_MEM2_Msk | \ + MEMCONF_POWER_RET_MEM3_Msk | MEMCONF_POWER_RET_MEM4_Msk | MEMCONF_POWER_RET_MEM5_Msk | \ + MEMCONF_POWER_RET_MEM8_Msk) +#define RAMBLOCK_RET2_MASK \ + (MEMCONF_POWER_RET2_MEM0_Msk | MEMCONF_POWER_RET2_MEM1_Msk | MEMCONF_POWER_RET2_MEM2_Msk | \ + MEMCONF_POWER_RET2_MEM3_Msk | MEMCONF_POWER_RET2_MEM4_Msk | MEMCONF_POWER_RET2_MEM5_Msk | \ + MEMCONF_POWER_RET2_MEM8_Msk) +#define RAMBLOCK_RET_BIT_ICACHE MEMCONF_POWER_RET_MEM6_Pos +#define RAMBLOCK_RET_BIT_DCACHE MEMCONF_POWER_RET_MEM7_Pos +#define RAMBLOCK_RET2_BIT_ICACHE MEMCONF_POWER_RET2_MEM6_Pos +#define RAMBLOCK_RET2_BIT_DCACHE MEMCONF_POWER_RET2_MEM7_Pos +#endif + +static sys_snode_t soc_node; + +static void nrf_soc_memconf_retain_set(bool enable) +{ + uint32_t ret_mask = BIT(RAMBLOCK_RET_BIT_ICACHE) | BIT(RAMBLOCK_RET_BIT_DCACHE); + + nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, ret_mask, enable); + nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 1, ret_mask, enable); + +#if defined(RAMBLOCK_RET2_MASK) + ret_mask = 0; +#if defined(RAMBLOCK_RET2_BIT_ICACHE) + ret_mask |= BIT(RAMBLOCK_RET2_BIT_ICACHE); +#endif +#if defined(RAMBLOCK_RET2_BIT_DCACHE) + ret_mask |= BIT(RAMBLOCK_RET2_BIT_DCACHE); +#endif + nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, ret_mask, enable); + nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 1, ret_mask, enable); +#endif /* defined(RAMBLOCK_RET2_MASK) */ +} + +void nrf_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. + */ + + soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); + nrf_lrcconf_poweron_force_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_MAIN, false); + nrf_soc_memconf_retain_set(false); + nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET_MASK, true); + nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET_MASK, true); +#if defined(RAMBLOCK_RET2_MASK) + nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, RAMBLOCK_RET2_MASK, true); + nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 1, RAMBLOCK_RET2_MASK, true); +#endif +} + +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + +static void nrf_power_down_cache(void) +{ + static const uint32_t msk = + (IS_ENABLED(CONFIG_DCACHE) ? BIT(RAMBLOCK_CONTROL_BIT_DCACHE) : 0) | + (IS_ENABLED(CONFIG_ICACHE) ? BIT(RAMBLOCK_CONTROL_BIT_ICACHE) : 0); + + if (msk == 0) { + return; + } + + /* Functions are non-empty only if cache is enabled. + * Data cache disabling include flushing. + */ + sys_cache_data_disable(); + sys_cache_instr_disable(); + nrf_memconf_ramblock_control_mask_enable_set(NRF_MEMCONF, RAMBLOCK_POWER_ID, msk, false); +} + +void nrf_power_up_cache(void) +{ + static const uint32_t msk = + (IS_ENABLED(CONFIG_DCACHE) ? BIT(RAMBLOCK_CONTROL_BIT_DCACHE) : 0) | + (IS_ENABLED(CONFIG_ICACHE) ? BIT(RAMBLOCK_CONTROL_BIT_ICACHE) : 0); + + if (msk == 0) { + return; + } + + nrf_memconf_ramblock_control_mask_enable_set(NRF_MEMCONF, RAMBLOCK_POWER_ID, msk, true); + sys_cache_instr_enable(); + sys_cache_data_enable(); +} + +static void common_suspend(void) +{ + soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); + nrf_power_down_cache(); +} + +static void common_resume(void) +{ + /* Common part does not include cache enabling. In case of s2ram it is done + * as early as possible to speed up the process. + */ + soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); +} + +void nrf_poweroff(void) +{ + nrf_resetinfo_resetreas_local_set(NRF_RESETINFO, 0); + nrf_resetinfo_restore_valid_set(NRF_RESETINFO, false); + + /* Disable retention */ + nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_MAIN, false); + nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_0, false); + + common_suspend(); + + nrf_lrcconf_task_trigger(NRF_LRCCONF010, NRF_LRCCONF_TASK_SYSTEMOFFREADY); + + __set_BASEPRI(0); + __ISB(); + __DSB(); + __WFI(); + + CODE_UNREACHABLE; +} + +#if CONFIG_MCUBOOT +static __ramfunc +#else +static __attribute__((__used__, noinline)) +#endif +void cache_retain_and_sleep(void) +{ + nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_SAVE); + nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_SAVE); + while (nrf_cache_busy_check(NRF_DCACHE) || + nrf_cache_busy_check(NRF_ICACHE)) { + + } + + __set_BASEPRI(0); + __ISB(); + __DSB(); + __WFI(); + + nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_RESTORE); + nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_RESTORE); + while (nrf_cache_busy_check(NRF_DCACHE) || + nrf_cache_busy_check(NRF_ICACHE)) { + + } +} + +void s2idle_enter(uint8_t substate_id) +{ + soc_lrcconf_poweron_request(&soc_node, NRF_LRCCONF_POWER_MAIN); + + switch (substate_id) { + case 0: + /* Substate for idle with cache powered on - not implemented yet. */ + break; + case 1: /* Substate for idle with cache retained. */ + soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_DOMAIN_0); + nrf_soc_memconf_retain_set(true); + cache_retain_and_sleep(); + return; + case 2: /* Substate for idle with cache disabled. */ + common_suspend(); + break; + default: /* Unknown substate. */ + return; + } + + __set_BASEPRI(0); + __ISB(); + __DSB(); + __WFI(); +} + +static void s2idle_exit(uint8_t substate_id) +{ + switch (substate_id) { + case 0: + /* Substate for idle with cache powered on - not implemented yet. */ + break; + case 1: /* Substate for idle with cache retained. */ + nrf_soc_memconf_retain_set(false); + break; + case 2: /* Substate for idle with cache disabled. */ + nrf_power_up_cache(); + break; + default: /* Unknown substate. */ + return; + } + common_resume(); + + soc_lrcconf_poweron_release(&soc_node, NRF_LRCCONF_POWER_MAIN); +} + +#if defined(CONFIG_PM_S2RAM) +/* Resume domain after local suspend to RAM. */ +static void s2ram_exit(void) +{ + common_resume(); + + /* Re-enable domain retention. */ + nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_0, true); +} + +/* Function called during local domain suspend to RAM. */ +static int sys_suspend_to_ram(void) +{ + /* Set information which is used on domain wakeup to determine if resume from RAM shall + * be performed. + */ + nrf_resetinfo_resetreas_local_set(NRF_RESETINFO, + NRF_RESETINFO_RESETREAS_LOCAL_UNRETAINED_MASK); + nrf_resetinfo_restore_valid_set(NRF_RESETINFO, true); + + /* Disable retention */ + nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_0, false); + + common_suspend(); + + __set_BASEPRI(0); + __ISB(); + __DSB(); + __WFI(); + /* + * We might reach this point if k_cpu_idle returns (there is a pre sleep hook that + * can abort sleeping. + */ + return -EBUSY; +} + +static void s2ram_enter(void) +{ + /* + * Save the CPU context (including the return address), set the SRAM + * marker and power off the system. + */ + if (soc_s2ram_suspend(sys_suspend_to_ram)) { + return; + } +} +#endif /* defined(CONFIG_PM_S2RAM) */ + +void pm_state_set(enum pm_state state, uint8_t substate_id) +{ + if (state == PM_STATE_SUSPEND_TO_IDLE) { + __disable_irq(); + sys_trace_idle(); + s2idle_enter(substate_id); + /* Resume here. */ + s2idle_exit(substate_id); + sys_trace_idle_exit(); + __enable_irq(); + } +#if defined(CONFIG_PM_S2RAM) + else if (state == PM_STATE_SUSPEND_TO_RAM) { + __disable_irq(); + sys_trace_idle(); + s2ram_enter(); + /* On resuming or error we return exactly *HERE* */ + s2ram_exit(); + sys_trace_idle_exit(); + __enable_irq(); + } +#endif + else { + k_cpu_idle(); + } +} + +void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id) +{ + irq_unlock(0); +} + +#endif /* defined(CONFIG_PM) || defined(CONFIG_POWEROFF) */ diff --git a/soc/nordic/nrf92/soc_power.h b/soc/nordic/nrf92/soc_power.h new file mode 100644 index 000000000000..5c7d5abaf29a --- /dev/null +++ b/soc/nordic/nrf92/soc_power.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file Common power management for Nordic nRF92 SoCs. + */ + +#ifndef ZEPHYR_SOC_NORDIC_NRF92_SOC_POWER_H_ +#define ZEPHYR_SOC_NORDIC_NRF92_SOC_POWER_H_ + +/** + * @brief Power domain early init. + * + */ +void nrf_power_domain_init(void); + +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +/** + * @brief Perform a power off. + * + * This function performs a power off of the core. + */ +void nrf_poweroff(void); + +/** + * @brief Power up and enable instruction and data cache. + */ +void nrf_power_up_cache(void); +#endif /* defined(CONFIG_PM) || defined(CONFIG_POWEROFF) */ + +#endif /* ZEPHYR_SOC_NORDIC_NRF92_SOC_POWER_H_ */ diff --git a/soc/nordic/sysbuild.cmake b/soc/nordic/sysbuild.cmake index c20185c93f3b..0cc2bbe12659 100644 --- a/soc/nordic/sysbuild.cmake +++ b/soc/nordic/sysbuild.cmake @@ -30,6 +30,6 @@ if(SB_CONFIG_VPR_LAUNCHER) sysbuild_cache_set(VAR ${image}_SNIPPET APPEND REMOVE_DUPLICATES ${launcher_snippet}) endif() -if(SB_CONFIG_NRF_HALTIUM_GENERATE_UICR) +if(SB_CONFIG_NRF_GENERATE_UICR) include(${CMAKE_CURRENT_LIST_DIR}/common/uicr/sysbuild.cmake) endif() diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 321549cfb047..f92e77588936 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -373,7 +373,7 @@ CHECK_DT_REG(cpuflpr_clic, NRF_FLPR_VPRCLIC); CHECK_DT_REG(cpuppr_clic, NRF_PPR_VPRCLIC); #if defined(CONFIG_SOC_SERIES_NRF54L) CHECK_DT_REG(cpuflpr_vpr, NRF_VPR00); -#elif defined(CONFIG_NRF_PLATFORM_HALTIUM) +#elif defined(CONFIG_SOC_SERIES_NRF54H) || defined(CONFIG_SOC_SERIES_NRF92) CHECK_DT_REG(cpuflpr_vpr, NRF_VPR121); CHECK_DT_REG(cpuppr_vpr, NRF_VPR130); #endif diff --git a/tests/lib/cpp/cxx/testcase.yaml b/tests/lib/cpp/cxx/testcase.yaml index 14a6d64becbf..c3998b7ad6b2 100644 --- a/tests/lib/cpp/cxx/testcase.yaml +++ b/tests/lib/cpp/cxx/testcase.yaml @@ -43,8 +43,9 @@ tests: filter: not CONFIG_HAS_RENESAS_RA_FSP and not CONFIG_HAS_RENESAS_RZ_FSP and not CONFIG_HAS_SILABS_WISECONNECT and not CONFIG_SOC_FAMILY_AMBIQ and - not (CONFIG_CPU_CORTEX_M and (CONFIG_NRF_PLATFORM_HALTIUM or - CONFIG_SOC_SERIES_NRF54L or CONFIG_SOC_SERIES_NRF71)) + not (CONFIG_CPU_CORTEX_M and (CONFIG_SOC_SERIES_NRF54H or + CONFIG_SOC_SERIES_NRF92 or CONFIG_SOC_SERIES_NRF54L or + CONFIG_SOC_SERIES_NRF71)) build_only: true extra_configs: - CONFIG_STD_CPP98=y From 2e9f255b8247272c9d1cf8d254c60e6175823731 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 23 Apr 2026 13:42:17 +0200 Subject: [PATCH 3287/3334] [nrf fromtree] soc: nordic: nrf54h: Add Kconfig to define custom s2ram implementation Add Kconfig entries to allow compile own s2ram implementation. Signed-off-by: Andrzej Puzdrowski Signed-off-by: Jakub Zymelka (cherry picked from commit ef179eb5ddeb8ba12ffca0b83b78515979b4b7ff) --- soc/nordic/nrf54h/CMakeLists.txt | 4 +++- soc/nordic/nrf54h/Kconfig | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 2afd82ec13cc..2928c6916ea1 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -9,7 +9,9 @@ if(CONFIG_ARM) FILTER ".*\\.cache_retain_and_sleep" LOCATION PMLocalRamfunc_TEXT ) - zephyr_library_sources_ifdef(CONFIG_PM_S2RAM soc_pm_s2ram.c) + if(NOT CONFIG_SOC_NRF54H20_PM_S2RAM_OVERRIDE) + zephyr_library_sources_ifdef(CONFIG_PM_S2RAM soc_pm_s2ram.c) + endif() endif() if(CONFIG_NRFX_GPPI AND NOT CONFIG_NRFX_GPPI_V1) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index bb2d2b954ee5..bc08e45d20b8 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -100,6 +100,11 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT endif # SOC_NRF54H20_CPURAD_ENABLE +config SOC_NRF54H20_PM_S2RAM_OVERRIDE + bool "Override `pm_s2ram` implementation" + help + Override Nordic s2ram implementation. + config SOC_NRF54H20_CPURAD select SOC_NRF54H20_CPURAD_COMMON From d202145fd137e35c9503c5877bb50a241743a388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 14 Apr 2026 11:26:57 +0200 Subject: [PATCH 3288/3334] [nrf fromtree] soc: nordic: Add option to implement user hook for entering idle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some platforms (nrf53 and nrf54h) are using hook for entering idle to execute SoC specific code. There can only be one hook in the application so it was impossible for the user to add own code that is executed in the hook. Add CONFIG_NRF_CUSTOM_ON_ENTER_CPU_IDLE_HOOK option. If enabled, the Nordic hook is not implemented. The user implements own hook. It is the user's responsibility to include SoC specific part in that hook. Signed-off-by: Krzysztof Chruściński (cherry picked from commit 230f3a91aadfbe6719cb84c52ebb46227625d129) --- soc/nordic/Kconfig | 9 +++++++++ soc/nordic/nrf53/soc.c | 14 +++++++++++++- soc/nordic/nrf54h/soc.c | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 14ad91f6b1a3..45ae14bced3c 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -233,4 +233,13 @@ config NRF_TRACE_PORT Unit) for tracing using a hardware probe. If disabled, the trace pins will be used as GPIO. +config NRF_CUSTOM_ON_ENTER_CPU_IDLE_HOOK + bool "Custom on enter CPU idle hook" + depends on ARM_ON_ENTER_CPU_IDLE_HOOK + help + Select this option to use a custom on enter CPU idle hook. If enabled, + the hook is implemented by the user. It is the user's responsibility to + implement the SoC-specific code in the hook that is present in the default + implementation. + endif # SOC_FAMILY_NORDIC_NRF diff --git a/soc/nordic/nrf53/soc.c b/soc/nordic/nrf53/soc.c index 5887399c6ace..3a86f158cc3c 100644 --- a/soc/nordic/nrf53/soc.c +++ b/soc/nordic/nrf53/soc.c @@ -334,7 +334,7 @@ void z_arm_on_enter_cpu_idle_prepare(void) #if defined(CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND) || \ (defined(CONFIG_SOC_NRF53_RTC_PRETICK) && defined(CONFIG_SOC_NRF5340_CPUNET)) -bool z_arm_on_enter_cpu_idle(void) +bool z_nrf53_on_enter_cpu_idle(void) { bool ok_to_sleep = true; @@ -385,6 +385,18 @@ bool z_arm_on_enter_cpu_idle(void) * (CONFIG_SOC_NRF53_RTC_PRETICK && CONFIG_SOC_NRF5340_CPUNET) */ +#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK) && !defined(CONFIG_NRF_CUSTOM_ON_ENTER_CPU_IDLE_HOOK) +bool z_arm_on_enter_cpu_idle(void) +{ +#if defined(CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND) || \ + (defined(CONFIG_SOC_NRF53_RTC_PRETICK) && defined(CONFIG_SOC_NRF5340_CPUNET)) + return z_nrf53_on_enter_cpu_idle(); +#endif /* CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND || + * (CONFIG_SOC_NRF53_RTC_PRETICK && CONFIG_SOC_NRF5340_CPUNET) + */ +} +#endif + #if CONFIG_SOC_NRF53_RTC_PRETICK #ifdef CONFIG_SOC_NRF5340_CPUAPP /* RTC pretick - application core part. */ diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 654c7151a016..59e146bf997e 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -94,7 +94,7 @@ static int trim_hsfll(void) return 0; } -#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK) +#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK) && !defined(CONFIG_NRF_CUSTOM_ON_ENTER_CPU_IDLE_HOOK) bool z_arm_on_enter_cpu_idle(void) { #ifdef CONFIG_LOG_FRONTEND_STMESP From 704a71feb7b461e6c18d43d3adca799a50cb8223 Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Mon, 27 Apr 2026 15:45:24 +0200 Subject: [PATCH 3289/3334] [nrf fromlist] soc: nordic: add Haltium/Lumos backward-compatibility layer Following the removal of the internal Haltium and Lumos platform abstractions in favor of explicit SOC_SERIES_* checks, add backward-compatibility aliases so out-of-tree code that still references the old names keeps building during the deprecation period, with a clear warning pointing to the new names. All aliases are tagged [DEPRECATED] and slated for removal in a future release. Upstream PR #: 108041 Signed-off-by: Jakub Zymelka --- soc/nordic/Kconfig | 21 +++++++++++++++++++++ soc/nordic/common/haltium_pm_s2ram.h | 22 ++++++++++++++++++++++ soc/nordic/common/haltium_power.h | 22 ++++++++++++++++++++++ soc/nordic/common/uicr/Kconfig.sysbuild | 10 ++++++++++ 4 files changed, 75 insertions(+) create mode 100644 soc/nordic/common/haltium_pm_s2ram.h create mode 100644 soc/nordic/common/haltium_power.h diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 45ae14bced3c..683047042031 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -242,4 +242,25 @@ config NRF_CUSTOM_ON_ENTER_CPU_IDLE_HOOK implement the SoC-specific code in the hook that is present in the default implementation. +# Backward-compatibility aliases for symbols removed during the Haltium / Lumos +# Kconfig cleanup. Slated for removal in a future release. + +config NRF_PLATFORM_HALTIUM + bool "[DEPRECATED] Replaced by SOC_SERIES_NRF54H / SOC_SERIES_NRF92" + default y if SOC_SERIES_NRF54H || SOC_SERIES_NRF92 + select DEPRECATED + help + This option has been removed. Use SOC_SERIES_NRF54H or SOC_SERIES_NRF92 + directly. The symbol is kept temporarily so that out-of-tree code that + still references it continues to build, with a deprecation warning. + +config NRF_PLATFORM_LUMOS + bool "[DEPRECATED] Replaced by SOC_SERIES_NRF54L / SOC_SERIES_NRF71" + default y if SOC_SERIES_NRF54L || SOC_SERIES_NRF71 + select DEPRECATED + help + This option has been removed. Use SOC_SERIES_NRF54L or SOC_SERIES_NRF71 + directly. The symbol is kept temporarily so that out-of-tree code that + still references it continues to build, with a deprecation warning. + endif # SOC_FAMILY_NORDIC_NRF diff --git a/soc/nordic/common/haltium_pm_s2ram.h b/soc/nordic/common/haltium_pm_s2ram.h new file mode 100644 index 000000000000..c145b755058a --- /dev/null +++ b/soc/nordic/common/haltium_pm_s2ram.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @brief [DEPRECATED] Backward-compatibility layer for . + * + * This header has been renamed to . The file exists so that + * out-of-tree code using the old include path keeps building during the + * deprecation period. It will be removed in a future release. + */ + +#ifndef ZEPHYR_SOC_NORDIC_COMMON_HALTIUM_PM_S2RAM_H_ +#define ZEPHYR_SOC_NORDIC_COMMON_HALTIUM_PM_S2RAM_H_ + +#warning " is deprecated, include instead" + +#include + +#endif /* ZEPHYR_SOC_NORDIC_COMMON_HALTIUM_PM_S2RAM_H_ */ diff --git a/soc/nordic/common/haltium_power.h b/soc/nordic/common/haltium_power.h new file mode 100644 index 000000000000..7ed8644a0375 --- /dev/null +++ b/soc/nordic/common/haltium_power.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @brief [DEPRECATED] Backward-compatibility layer for . + * + * This header has been renamed to . The file exists so that + * out-of-tree code using the old include path keeps building during the + * deprecation period. It will be removed in a future release. + */ + +#ifndef ZEPHYR_SOC_NORDIC_COMMON_HALTIUM_POWER_H_ +#define ZEPHYR_SOC_NORDIC_COMMON_HALTIUM_POWER_H_ + +#warning " is deprecated, include instead" + +#include + +#endif /* ZEPHYR_SOC_NORDIC_COMMON_HALTIUM_POWER_H_ */ diff --git a/soc/nordic/common/uicr/Kconfig.sysbuild b/soc/nordic/common/uicr/Kconfig.sysbuild index b16c819aafd1..eab8e9b0bc74 100644 --- a/soc/nordic/common/uicr/Kconfig.sysbuild +++ b/soc/nordic/common/uicr/Kconfig.sysbuild @@ -9,3 +9,13 @@ config NRF_GENERATE_UICR When enabled, a UICR generator image is included in the build. This generates binary configuration artifacts based on the Kconfig and device tree of the UICR generator image. See the UICR generator options for further details. + +config NRF_HALTIUM_GENERATE_UICR + bool "[DEPRECATED] Renamed to NRF_GENERATE_UICR" + depends on SOC_SERIES_NRF54H || SOC_SERIES_NRF92 + select DEPRECATED + select NRF_GENERATE_UICR + help + This option has been renamed. Use NRF_GENERATE_UICR instead. + The old name is kept temporarily so that existing sysbuild.conf files + continue to build, with a deprecation warning. From 6bf83fb842f89ffb6c0c67abf47b7d7f2234133b Mon Sep 17 00:00:00 2001 From: Jakub Zymelka Date: Thu, 23 Apr 2026 16:46:29 +0200 Subject: [PATCH 3290/3334] [nrf fromtree] soc: nordic: nrf54h: pm_s2ram: S2RAM resume hardening MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for hardening decision on resume from S2RAM by MCUboot bootloader. Application sets additional variable to MCUBOOT_S2RAM_RESUME_MAGIC which allows the bootloader to doublecheck. Extended mcuboot_resume_s suture by slot_info field intended to be used by MCUboot for recognize proper boot slot in direct-xp mode. Signed-off-by: Andrzej Puzdrowski Signed-off-by: Tomasz Moń Signed-off-by: Jakub Zymelka (cherry picked from commit f1832174a0dd288550d6ae98cd6cddd5f2683cc2) --- soc/nordic/nrf54h/soc_pm_s2ram.h | 7 +++++++ soc/nordic/nrf92/soc_pm_s2ram.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/soc/nordic/nrf54h/soc_pm_s2ram.h b/soc/nordic/nrf54h/soc_pm_s2ram.h index 457bef4ff6e8..743c24a0ca7a 100644 --- a/soc/nordic/nrf54h/soc_pm_s2ram.h +++ b/soc/nordic/nrf54h/soc_pm_s2ram.h @@ -10,6 +10,13 @@ #ifndef ZEPHYR_SOC_NORDIC_NRF54H_SOC_PM_S2RAM_H_ #define ZEPHYR_SOC_NORDIC_NRF54H_SOC_PM_S2RAM_H_ +#define MCUBOOT_S2RAM_RESUME_MAGIC 0x75832419 + +struct mcuboot_resume_s { + uint32_t magic; /* magic value to identify valid structure */ + uint32_t slot_info; +}; + /** * @brief Save CPU state on suspend * diff --git a/soc/nordic/nrf92/soc_pm_s2ram.c b/soc/nordic/nrf92/soc_pm_s2ram.c index ac5fecd93b57..054ad527f611 100644 --- a/soc/nordic/nrf92/soc_pm_s2ram.c +++ b/soc/nordic/nrf92/soc_pm_s2ram.c @@ -77,10 +77,24 @@ static void fpu_power_up(void) } #endif /* defined(CONFIG_FPU) */ +#if DT_NODE_EXISTS(DT_NODELABEL(mcuboot_s2ram)) &&\ + DT_NODE_HAS_COMPAT(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region) +/* Linker section name is given by `zephyr,memory-region` property of + * `zephyr,memory-region` compatible DT node with nodelabel `mcuboot_s2ram`. + */ +__attribute__((section(DT_PROP(DT_NODELABEL(mcuboot_s2ram), zephyr_memory_region)))) +volatile struct mcuboot_resume_s _mcuboot_resume; + +#define SET_MCUBOOT_RESUME_MAGIC() _mcuboot_resume.magic = MCUBOOT_S2RAM_RESUME_MAGIC +#else +#define SET_MCUBOOT_RESUME_MAGIC() +#endif + int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off) { int ret; + SET_MCUBOOT_RESUME_MAGIC(); z_arm_save_scb_context(&backup_data.scb_context); #if defined(CONFIG_FPU) #if !defined(CONFIG_FPU_SHARING) From b30b5111baf00685cafc90331179f7c019289104 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 28 Apr 2026 08:07:55 +0100 Subject: [PATCH 3291/3334] [nrf fromtree] boards: holyiot: yj16019: Fix missing chosen SRAM node Adds the missing chosen node to specify the board's SRAM Signed-off-by: Jamie McCrae (cherry picked from commit 8176356de01b3b9c68b610ab8e6e93e8c9fa6944) --- boards/holyiot/yj16019/holyiot_yj16019.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/holyiot/yj16019/holyiot_yj16019.dts b/boards/holyiot/yj16019/holyiot_yj16019.dts index 561f394f1a10..d8a2adbcf8d3 100644 --- a/boards/holyiot/yj16019/holyiot_yj16019.dts +++ b/boards/holyiot/yj16019/holyiot_yj16019.dts @@ -13,6 +13,10 @@ model = "Holyiot YJ-16019"; compatible = "holyiot,yj-16019"; + chosen { + zephyr,sram = &sram0; + }; + leds { compatible = "gpio-leds"; From 9809e405ce317b59602f178fe87756a2c0b4bc40 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 27 Apr 2026 14:17:35 +0100 Subject: [PATCH 3292/3334] [nrf fromtree] boards: nordic: Rmove duplicate/invalid SRAM Kconfig defaults Some boards were setting variables that were never referenced, others were setting a default for a Kconfig that was already the default, this removes these Signed-off-by: Jamie McCrae (cherry picked from commit f8b81e914bdf5d1d91429f58304d4d3e84566165) --- boards/actinius/icarus/Kconfig.defconfig | 22 ++------------- boards/actinius/icarus_bee/Kconfig.defconfig | 22 ++------------- boards/actinius/icarus_som/Kconfig.defconfig | 22 ++------------- .../actinius/icarus_som_dk/Kconfig.defconfig | 22 ++------------- boards/circuitdojo/feather/Kconfig.defconfig | 22 ++------------- boards/ct/ctcc/Kconfig.defconfig | 22 ++------------- boards/ezurio/bl5340_dvk/Kconfig.defconfig | 24 ++-------------- boards/ezurio/bl54l15_dvk/Kconfig.defconfig | 13 ++------- boards/ezurio/bl54l15u_dvk/Kconfig.defconfig | 13 ++------- boards/innblue/innblue21/Kconfig.defconfig | 26 ++--------------- boards/innblue/innblue22/Kconfig.defconfig | 26 ++--------------- .../nordic/nrf5340_audio_dk/Kconfig.defconfig | 28 ++----------------- boards/nordic/nrf5340dk/Kconfig.defconfig | 10 ------- boards/nordic/thingy53/Kconfig.defconfig | 24 ++-------------- .../norik/octopus_io_board/Kconfig.defconfig | 22 ++------------- boards/norik/octopus_som/Kconfig.defconfig | 22 ++------------- boards/panasonic/panb611evb/Kconfig.defconfig | 13 ++------- boards/raytac/mdbt53_db_40/Kconfig.defconfig | 24 ++-------------- boards/raytac/mdbt53v_db_40/Kconfig.defconfig | 24 ++-------------- boards/sparkfun/thing_plus/Kconfig.defconfig | 22 ++------------- 20 files changed, 41 insertions(+), 382 deletions(-) diff --git a/boards/actinius/icarus/Kconfig.defconfig b/boards/actinius/icarus/Kconfig.defconfig index b5a635ca0d4c..bd3aab4e66f8 100644 --- a/boards/actinius/icarus/Kconfig.defconfig +++ b/boards/actinius/icarus/Kconfig.defconfig @@ -3,8 +3,6 @@ # Copyright (c) 2019 Actinius # SPDX-License-Identifier: Apache-2.0 -if BOARD_ACTINIUS_ICARUS - source "boards/actinius/common/Kconfig" # For the secure version of the board the firmware is linked at the beginning @@ -17,21 +15,5 @@ source "boards/actinius/common/Kconfig" # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_ACTINIUS_ICARUS_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_ACTINIUS_ICARUS_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_ACTINIUS_ICARUS_NRF9160_NS - -endif # BOARD_ACTINIUS_ICARUS +config BOARD_ACTINIUS_ICARUS + select USE_DT_CODE_PARTITION if BOARD_ACTINIUS_ICARUS_NRF9160_NS diff --git a/boards/actinius/icarus_bee/Kconfig.defconfig b/boards/actinius/icarus_bee/Kconfig.defconfig index 3c191e96cede..b97e9df4caa3 100644 --- a/boards/actinius/icarus_bee/Kconfig.defconfig +++ b/boards/actinius/icarus_bee/Kconfig.defconfig @@ -3,8 +3,6 @@ # Copyright (c) 2021 Actinius # SPDX-License-Identifier: Apache-2.0 -if BOARD_ACTINIUS_ICARUS_BEE - source "boards/actinius/common/Kconfig" # For the secure version of the board the firmware is linked at the beginning @@ -17,21 +15,5 @@ source "boards/actinius/common/Kconfig" # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_ACTINIUS_ICARUS_BEE_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_ACTINIUS_ICARUS_BEE_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_ACTINIUS_ICARUS_BEE_NRF9160_NS - -endif # BOARD_ACTINIUS_ICARUS_BEE +config BOARD_ACTINIUS_ICARUS_BEE + select USE_DT_CODE_PARTITION if BOARD_ACTINIUS_ICARUS_BEE_NRF9160_NS diff --git a/boards/actinius/icarus_som/Kconfig.defconfig b/boards/actinius/icarus_som/Kconfig.defconfig index 42d244ac763d..9c709b8e7179 100644 --- a/boards/actinius/icarus_som/Kconfig.defconfig +++ b/boards/actinius/icarus_som/Kconfig.defconfig @@ -3,8 +3,6 @@ # Copyright (c) 2021 Actinius # SPDX-License-Identifier: Apache-2.0 -if BOARD_ACTINIUS_ICARUS_SOM - source "boards/actinius/common/Kconfig" # For the secure version of the board the firmware is linked at the beginning @@ -17,21 +15,5 @@ source "boards/actinius/common/Kconfig" # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_ACTINIUS_ICARUS_SOM_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_ACTINIUS_ICARUS_SOM_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_ACTINIUS_ICARUS_SOM_NRF9160_NS - -endif # BOARD_ACTINIUS_ICARUS_SOM +config BOARD_ACTINIUS_ICARUS_SOM + select USE_DT_CODE_PARTITION if BOARD_ACTINIUS_ICARUS_SOM_NRF9160_NS diff --git a/boards/actinius/icarus_som_dk/Kconfig.defconfig b/boards/actinius/icarus_som_dk/Kconfig.defconfig index 3993f59dbf22..cd0c9885526c 100644 --- a/boards/actinius/icarus_som_dk/Kconfig.defconfig +++ b/boards/actinius/icarus_som_dk/Kconfig.defconfig @@ -3,8 +3,6 @@ # Copyright (c) 2022 Actinius # SPDX-License-Identifier: Apache-2.0 -if BOARD_ACTINIUS_ICARUS_SOM_DK - source "boards/actinius/common/Kconfig" # For the secure version of the board the firmware is linked at the beginning @@ -17,21 +15,5 @@ source "boards/actinius/common/Kconfig" # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_ACTINIUS_ICARUS_SOM_DK_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_ACTINIUS_ICARUS_SOM_DK_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_ACTINIUS_ICARUS_SOM_DK_NRF9160_NS - -endif # BOARD_ACTINIUS_ICARUS_SOM_DK +config BOARD_ACTINIUS_ICARUS_SOM_DK + select USE_DT_CODE_PARTITION if BOARD_ACTINIUS_ICARUS_SOM_DK_NRF9160_NS diff --git a/boards/circuitdojo/feather/Kconfig.defconfig b/boards/circuitdojo/feather/Kconfig.defconfig index f093911dc477..3a1dafc2ac3f 100644 --- a/boards/circuitdojo/feather/Kconfig.defconfig +++ b/boards/circuitdojo/feather/Kconfig.defconfig @@ -4,8 +4,6 @@ # Copyright (c) 2020 Circuit Dojo LLC # SPDX-License-Identifier: Apache-2.0 -if BOARD_CIRCUITDOJO_FEATHER - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- @@ -16,21 +14,5 @@ if BOARD_CIRCUITDOJO_FEATHER # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_CIRCUITDOJO_FEATHER_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS - -endif # BOARD_CIRCUITDOJO_FEATHER +config BOARD_CIRCUITDOJO_FEATHER + select USE_DT_CODE_PARTITION if BOARD_CIRCUITDOJO_FEATHER_NRF9160_NS diff --git a/boards/ct/ctcc/Kconfig.defconfig b/boards/ct/ctcc/Kconfig.defconfig index 298f3d2fe218..6087f4fd5dbd 100644 --- a/boards/ct/ctcc/Kconfig.defconfig +++ b/boards/ct/ctcc/Kconfig.defconfig @@ -9,23 +9,5 @@ source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig" endif # BOARD_CTCC_NRF52840 -if BOARD_CTCC_NRF9161 || BOARD_CTCC_NRF9161_NS - -# Workaround for not being able to have commas in macro arguments. -# For explanation please see: boards/nordic/nrf9161dk/Kconfig.defconfig -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_CTCC_NRF9161 && TRUSTED_EXECUTION_SECURE - -if BOARD_CTCC_NRF9161_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_CTCC_NRF9161_NS -endif # BOARD_CTCC_NRF9161 || BOARD_CTCC_NRF9161_NS +config BOARD_CTCC + select USE_DT_CODE_PARTITION if BOARD_CTCC_NRF9161_NS diff --git a/boards/ezurio/bl5340_dvk/Kconfig.defconfig b/boards/ezurio/bl5340_dvk/Kconfig.defconfig index b4ae23988e0b..b1284f731927 100644 --- a/boards/ezurio/bl5340_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl5340_dvk/Kconfig.defconfig @@ -33,29 +33,9 @@ config I2C # For the non-secure version of the board, the firmware image SRAM is # always restricted to the allocated non-secure SRAM partition. # -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_BL5340_DVK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif # BOARD_BL5340_DVK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -if BOARD_BL5340_DVK_NRF5340_CPUAPP_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_BL5340_DVK_NRF5340_CPUAPP_NS +config BOARD_BL5340_DVK + select USE_DT_CODE_PARTITION if BOARD_BL5340_DVK_NRF5340_CPUAPP_NS config BT_HCI_IPC default y if BT_HCI diff --git a/boards/ezurio/bl54l15_dvk/Kconfig.defconfig b/boards/ezurio/bl54l15_dvk/Kconfig.defconfig index 2ff8fe6e3027..6ea4cac9bba5 100644 --- a/boards/ezurio/bl54l15_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl54l15_dvk/Kconfig.defconfig @@ -2,21 +2,14 @@ # Copyright (c) 2025 Ezurio LLC # SPDX-License-Identifier: Apache-2.0 -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - if BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS +config BOARD_BL54L15_DVK + select USE_DT_CODE_PARTITION + config HAS_BT_CTLR default BT -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - # By default, if we build for a Non-Secure version of the board, # enable building with TF-M as the Secure Execution Environment. config BUILD_WITH_TFM diff --git a/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig b/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig index 1e706cb66dd2..b3f51eddb637 100644 --- a/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig @@ -2,21 +2,14 @@ # Copyright (c) 2025 Ezurio LLC # SPDX-License-Identifier: Apache-2.0 -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS +config BOARD_BL54L15U_DVK + select USE_DT_CODE_PARTITION + config HAS_BT_CTLR default BT -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - # By default, if we build for a Non-Secure version of the board, # enable building with TF-M as the Secure Execution Environment. config BUILD_WITH_TFM diff --git a/boards/innblue/innblue21/Kconfig.defconfig b/boards/innblue/innblue21/Kconfig.defconfig index abf57a46a11b..c7fc47f75e3b 100644 --- a/boards/innblue/innblue21/Kconfig.defconfig +++ b/boards/innblue/innblue21/Kconfig.defconfig @@ -3,8 +3,6 @@ # Copyright (c) 2020 InnBlue # SPDX-License-Identifier: Apache-2.0 -if BOARD_INNBLUE21 - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- @@ -15,31 +13,11 @@ if BOARD_INNBLUE21 # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. - -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -if BOARD_INNBLUE21_NRF9160 && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_INNBLUE21_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_INNBLUE21_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_INNBLUE21_NRF9160_NS +config BOARD_INNBLUE21 + select USE_DT_CODE_PARTITION if BOARD_INNBLUE21_NRF9160_NS config BT_HCI_VS default y if BT config REGULATOR default y if SENSOR - -endif # BOARD_INNBLUE21 diff --git a/boards/innblue/innblue22/Kconfig.defconfig b/boards/innblue/innblue22/Kconfig.defconfig index 540a784ec975..ee1d7a11e3eb 100644 --- a/boards/innblue/innblue22/Kconfig.defconfig +++ b/boards/innblue/innblue22/Kconfig.defconfig @@ -3,8 +3,6 @@ # Copyright (c) 2020 InnBlue # SPDX-License-Identifier: Apache-2.0 -if BOARD_INNBLUE22 - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- @@ -15,31 +13,11 @@ if BOARD_INNBLUE22 # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. - -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -if BOARD_INNBLUE22_NRF9160 && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_INNBLUE22_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_INNBLUE22_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_INNBLUE22_NRF9160_NS +config BOARD_INNBLUE22 + select USE_DT_CODE_PARTITION if BOARD_INNBLUE22_NRF9160_NS config BT_HCI_VS default y if BT config REGULATOR default y if SENSOR - -endif # BOARD_INNBLUE22 diff --git a/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig b/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig index de77a9846f82..58d37f48dfa5 100644 --- a/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig @@ -32,29 +32,9 @@ if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAP # For the non-secure version of the board, the firmware image SRAM is # always restricted to the allocated non-secure SRAM partition. # -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS +config BOARD_NRF5340_AUDIO_DK + select USE_DT_CODE_PARTITION if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS config BT_HCI_IPC default y if BT_HCI @@ -64,7 +44,3 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 4096 if BT_HCI_IPC endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS - -if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUNET - -endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUNET diff --git a/boards/nordic/nrf5340dk/Kconfig.defconfig b/boards/nordic/nrf5340dk/Kconfig.defconfig index c0ac00bcfe54..48e892a04fff 100644 --- a/boards/nordic/nrf5340dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340dk/Kconfig.defconfig @@ -40,16 +40,6 @@ if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS # always restricted to the allocated non-secure SRAM partition. # -if BOARD_NRF5340DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif # BOARD_NRF5340DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - config BOARD_NRF5340DK select USE_DT_CODE_PARTITION if BOARD_NRF5340DK_NRF5340_CPUAPP_NS diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index 4a478c8db254..a8ba0d17382c 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -53,29 +53,9 @@ endif # BUILD_WITH_TFM # For the non-secure version of the board, the firmware image SRAM is # always restricted to the allocated non-secure SRAM partition. # -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_THINGY53_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif # BOARD_THINGY53_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -if BOARD_THINGY53_NRF5340_CPUAPP_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_THINGY53_NRF5340_CPUAPP_NS +config BOARD_THINGY53 + select USE_DT_CODE_PARTITION if BOARD_THINGY53_NRF5340_CPUAPP_NS if !TRUSTED_EXECUTION_SECURE diff --git a/boards/norik/octopus_io_board/Kconfig.defconfig b/boards/norik/octopus_io_board/Kconfig.defconfig index 4c00ab52ab59..76c48f90db55 100644 --- a/boards/norik/octopus_io_board/Kconfig.defconfig +++ b/boards/norik/octopus_io_board/Kconfig.defconfig @@ -1,8 +1,6 @@ # Copyright (c) 2024 Norik Systems # SPDX-License-Identifier: Apache-2.0 -if BOARD_OCTOPUS_IO_BOARD - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- @@ -13,21 +11,5 @@ if BOARD_OCTOPUS_IO_BOARD # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_OCTOPUS_IO_BOARD && TRUSTED_EXECUTION_SECURE - -if BOARD_OCTOPUS_IO_BOARD_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_OCTOPUS_IO_BOARD_NRF9160_NS - -endif # BOARD_OCTOPUS_IO_BOARD +config BOARD_OCTOPUS_IO_BOARD + select USE_DT_CODE_PARTITION if BOARD_OCTOPUS_IO_BOARD_NRF9160_NS diff --git a/boards/norik/octopus_som/Kconfig.defconfig b/boards/norik/octopus_som/Kconfig.defconfig index 6fe9d1618a5b..35a31fd95c11 100644 --- a/boards/norik/octopus_som/Kconfig.defconfig +++ b/boards/norik/octopus_som/Kconfig.defconfig @@ -1,8 +1,6 @@ # Copyright (c) 2024 Norik Systems # SPDX-License-Identifier: Apache-2.0 -if BOARD_OCTOPUS_SOM - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- @@ -13,21 +11,5 @@ if BOARD_OCTOPUS_SOM # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_OCTOPUS_SOM && TRUSTED_EXECUTION_SECURE - -if BOARD_OCTOPUS_SOM_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_OCTOPUS_SOM_NRF9160_NS - -endif # BOARD_OCTOPUS_SOM +config BOARD_OCTOPUS_SOM + select USE_DT_CODE_PARTITION if BOARD_OCTOPUS_SOM_NRF9160_NS diff --git a/boards/panasonic/panb611evb/Kconfig.defconfig b/boards/panasonic/panb611evb/Kconfig.defconfig index 1b469232537f..5c1da70d2375 100644 --- a/boards/panasonic/panb611evb/Kconfig.defconfig +++ b/boards/panasonic/panb611evb/Kconfig.defconfig @@ -1,21 +1,14 @@ # Copyright (c) 2025 Panasonic Industrial Devices Europe GmbH # SPDX-License-Identifier: Apache-2.0 -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - if BOARD_PANB611EVB_NRF54L15_CPUAPP_NS +config BOARD_PANB611EVB + select USE_DT_CODE_PARTITION + config HAS_BT_CTLR default BT -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - # By default, if we build for a Non-Secure version of the board, # enable building with TF-M as the Secure Execution Environment. config BUILD_WITH_TFM diff --git a/boards/raytac/mdbt53_db_40/Kconfig.defconfig b/boards/raytac/mdbt53_db_40/Kconfig.defconfig index 128e5fc62dbc..780df72d1342 100644 --- a/boards/raytac/mdbt53_db_40/Kconfig.defconfig +++ b/boards/raytac/mdbt53_db_40/Kconfig.defconfig @@ -29,29 +29,9 @@ if BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53_DB_40_NRF5340 # For the non-secure version of the board, the firmware image SRAM is # always restricted to the allocated non-secure SRAM partition. # -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif # BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -if BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS +config BOARD_RAYTAC_MDBT53_DB_40 + select USE_DT_CODE_PARTITION if BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS config BT_HCI_IPC default y if BT_HCI diff --git a/boards/raytac/mdbt53v_db_40/Kconfig.defconfig b/boards/raytac/mdbt53v_db_40/Kconfig.defconfig index c30d57c073d0..63eaac0cac98 100644 --- a/boards/raytac/mdbt53v_db_40/Kconfig.defconfig +++ b/boards/raytac/mdbt53v_db_40/Kconfig.defconfig @@ -29,29 +29,9 @@ if BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53V_DB_40_NRF53 # For the non-secure version of the board, the firmware image SRAM is # always restricted to the allocated non-secure SRAM partition. # -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition -if BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif # BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -if BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS +config BOARD_RAYTAC_MDBT53V_DB_40 + select USE_DT_CODE_PARTITION if BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS config BT_HCI_IPC default y if BT_HCI diff --git a/boards/sparkfun/thing_plus/Kconfig.defconfig b/boards/sparkfun/thing_plus/Kconfig.defconfig index 5273768aa501..cb9ac1d590dc 100644 --- a/boards/sparkfun/thing_plus/Kconfig.defconfig +++ b/boards/sparkfun/thing_plus/Kconfig.defconfig @@ -4,8 +4,6 @@ # Copyright (c) 2020 Circuit Dojo LLC # SPDX-License-Identifier: Apache-2.0 -if BOARD_SPARKFUN_THING_PLUS - # For the secure version of the board the firmware is linked at the beginning # of the flash, or into the code-partition defined in DT if it is intended to # be loaded by MCUboot. If the secure firmware is to be combined with a non- @@ -16,21 +14,5 @@ if BOARD_SPARKFUN_THING_PLUS # Apply this configuration below by setting the Kconfig symbols used by # the linker according to the information extracted from DT partitions. -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - depends on BOARD_SPARKFUN_THING_PLUS_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_SPARKFUN_THING_PLUS_NRF9160 - -endif # BOARD_SPARKFUN_THING_PLUS +config BOARD_SPARKFUN_THING_PLUS + select USE_DT_CODE_PARTITION if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS From 2c01921a3e3e3c273b6b9c547e9c5e5f4b13ae24 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 1 May 2026 08:16:59 +0100 Subject: [PATCH 3293/3334] Revert "[nrf noup] drivers: flash: Update to support PM removal" This reverts commit 6995eb05922ddf6cf2bd1842748de220dfd26cca. Signed-off-by: Jamie McCrae --- drivers/flash/soc_flash_nrf.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 3e735a7edf78..27fda598be20 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -36,12 +36,10 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER #include -#if USE_PARTITION_MANAGER #include -#endif /* USE_PARTITION_MANAGER */ -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 @@ -172,17 +170,11 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif -#if CONFIG_TRUSTED_EXECUTION_NONSECURE -#if USE_PARTITION_MANAGER && PM_APP_ADDRESS +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS if (addr < PM_APP_ADDRESS) { return soc_secure_mem_read(data, (void *)addr, len); } -#elif !USE_PARTITION_MANAGER && DT_NODE_EXISTS(DT_NODELABEL(slot0_ns_partition)) - if ((uintptr_t)addr < DT_REG_ADDR(DT_NODELABEL(slot0_ns_partition))) { - return soc_secure_mem_read(data, (void *)addr, len); - } #endif -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ nrf_nvmc_buffer_read(data, (uint32_t)addr, len); From d375a6f54f690bec90d75dd4ae905a7c7a4b12b5 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 1 May 2026 08:17:03 +0100 Subject: [PATCH 3294/3334] Revert "[nrf noup] tree-wide: support NCS Partition Manager (PM) definitions" This reverts commit 9991882440b7100fbcbe81bec51c6ce73c2f7aeb. Signed-off-by: Jamie McCrae --- arch/arm/core/mpu/arm_mpu_regions.c | 13 ----- cmake/linker/ld/target.cmake | 1 - cmake/linker/lld/target.cmake | 1 - cmake/modules/kernel.cmake | 4 -- drivers/flash/soc_flash_nrf.c | 11 ---- drivers/flash/soc_flash_nrf_rram.c | 11 ---- .../arch/arm/cortex_m/scripts/linker.ld | 50 ------------------- include/zephyr/storage/flash_map.h | 6 --- lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 18 +------ subsys/dfu/boot/mcuboot_shell.c | 40 --------------- subsys/fs/littlefs_fs.c | 7 +-- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ---------- 13 files changed, 4 insertions(+), 187 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 71c0a9a2b739..4771c5914ce6 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,9 +8,6 @@ #include #include -#if USE_PARTITION_MANAGER -#include -#endif #ifdef CONFIG_ARM_MPU_SRAM_WRITE_THROUGH #define ARM_MPU_SRAM_REGION_ATTR REGION_RAM_WT_ATTR @@ -33,14 +30,6 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", -#if USE_PARTITION_MANAGER - PM_SRAM_ADDRESS, -#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) - REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), -#else - REGION_RAM_ATTR(REGION_SRAM_SIZE)), -#endif -#else CONFIG_SRAM_BASE_ADDRESS, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) ARM_MPU_SRAM_REGION_ATTR(CONFIG_SRAM_BASE_ADDRESS, @@ -48,8 +37,6 @@ static const struct arm_mpu_region mpu_regions[] = { #else ARM_MPU_SRAM_REGION_ATTR(REGION_SRAM_SIZE)), #endif - -#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index ccf6a1903162..592596576d11 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,7 +80,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} - -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index fe8aad62c73d..96df1c123796 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,7 +52,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} - -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 53aa705fdc9b..310a836eebcf 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -257,7 +257,3 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() - -if(ZEPHYR_NRF_MODULE_DIR) - include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) -endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 27fda598be20..f6b8a6f5eef3 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -36,11 +36,6 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -170,12 +165,6 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index cd217a5f2c2d..1f7f89b5509f 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,11 +54,6 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER -#include -#include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ - #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -297,12 +292,6 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS - if (addr < PM_APP_ADDRESS) { - return soc_secure_mem_read(data, (void *)addr, len); - } -#endif - memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index 7b5e9358af02..2f3d55412f06 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,39 +34,6 @@ #define ROMSTART_REGION ROMABLE_REGION #endif -#if USE_PARTITION_MANAGER - -#include - -#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) -/* We are linking against S1, create symbol containing the flash ID of S0. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S0_ID; - -#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ - -#ifdef PM_S1_ID -/* We are linking against S0, create symbol containing the flash ID of S1. - * This is used when writing code operating on the "other" slot. - */ -_image_1_primary_slot_id = PM_S1_ID; -#endif /* PM_S1_ID */ - -#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ - -#define ROM_ADDR PM_ADDRESS -#define ROM_SIZE PM_SIZE - -#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) -#define RAM_SIZE CONFIG_PM_SRAM_SIZE -#else -#define RAM_SIZE PM_SRAM_SIZE -#endif -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - #if defined(CONFIG_ROM_END_OFFSET) #define ROM_END_OFFSET CONFIG_ROM_END_OFFSET #else @@ -93,23 +60,6 @@ _image_1_primary_slot_id = PM_S1_ID; #define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) #define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS -#endif /* USE_PARTITION_MANAGER */ - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) -#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) -#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) -#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) -#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) -#endif - -#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) -#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) -#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) -#endif - #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 819f94182474..13f381e135fd 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -351,10 +351,6 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); -#if USE_PARTITION_MANAGER -#include -#else - /** * Returns non-0 value if partition of given DTS node label exists. * @@ -624,8 +620,6 @@ DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) #undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ -#endif /* USE_PARTITION_MANAGER */ - #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index f9f98db27c52..b9e6371fabff 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -160,7 +160,7 @@ source "subsys/logging/Kconfig.template.log_config" choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) && !PARTITION_MANAGER_ENABLED + default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 368342cc86de..74193fbdce48 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,20 +25,6 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); -#if USE_PARTITION_MANAGER - -#include - -#define RAM_SIZE PM_SRAM_SIZE -#define RAM_ADDR PM_SRAM_ADDRESS - -#else /* ! USE_PARTITION_MANAGER */ - -#define RAM_SIZE (KB((size_t) CONFIG_SRAM_SIZE)) -#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS - -#endif /* USE_PARTITION_MANAGER */ - #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -120,8 +106,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((RAM_SIZE - \ - ((size_t) HEAP_BASE - (size_t) RAM_ADDR)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ + ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index 06eb79baa92b..583bc4778362 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,16 +20,6 @@ #endif #endif -#if USE_PARTITION_MANAGER -#include - -#ifdef CONFIG_NCS_IS_VARIANT_IMAGE -#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID -#else -#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID -#endif -#endif - struct area_desc { const char *name; unsigned int id; @@ -103,35 +93,6 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ -#if USE_PARTITION_MANAGER -#ifdef PM_MCUBOOT_ID - if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { - shell_error(sh, "Cannot erase boot partition"); - return -EACCES; - } -#endif - -#ifdef PM_APP_ID - if (id == PM_APP_ID) { - shell_error(sh, "Cannot erase this area"); - return -EACCES; - } -#endif - -#ifdef PM_MCUBOOT_PRIMARY_APP_ID - if (id == PM_MCUBOOT_PRIMARY_APP_ID) { - shell_error(sh, "Cannot erase this area"); - return -EACCES; - } -#endif - -#ifdef ACTIVE_IMAGE_ID - if (id == ACTIVE_IMAGE_ID) { - shell_error(sh, "Cannot erase active partitions"); - return -EACCES; - } -#endif -#else #if PARTITION_EXISTS(boot_partition) if (id == PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -144,7 +105,6 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } -#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index 094cb761756b..e41287edf2f6 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1133,12 +1133,7 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = FSTAB_ENTRY_DT_INST_MOUNT_POINT(inst), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *) \ - COND_CODE_1(USE_PARTITION_MANAGER, \ - (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ - (FIXED_PARTITION_ID(littlefs_storage)), \ - (FIXED_PARTITION_ID(storage)))), \ - (DT_PARTITION_ID(FS_PARTITION(inst)))), \ + .storage_dev = (void *)DT_PARTITION_ID(FS_PARTITION(inst)), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index e7015d512d36..349eee664810 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,35 +13,8 @@ extern "C" { #endif -#if CONFIG_PARTITION_MANAGER_ENABLED - -#include "pm_config.h" - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) - -#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) -#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE -#else -/* The current image is a child image in a different domain than the image - * which defined the required values. To reach the values of the parent domain - * we use the 'PM__' variant of the define. - */ -#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS -#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ - -#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) -#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ - -#else - -#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) -#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) - -#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #ifdef CONFIG_OPENAMP_RSC_TABLE #define SHM_START_ADDR (VDEV_START_ADDR) From 0650f4deec67ce2e92f6a5ce15a6f7fafeb5a23b Mon Sep 17 00:00:00 2001 From: Carlo Caione Date: Wed, 15 Apr 2026 16:06:15 +0200 Subject: [PATCH 3295/3334] [nrf fromtree] arm64: mm: increase MAX_XLAT_TABLES for USERSPACE && TEST Since commit 0026a5610ac ("arm64: mm: use identity mapping for device MMIO"), device_map() creates identity mappings (VA = PA) instead of allocating virtual addresses from a contiguous pool. Each device at a distinct 2MB-aligned physical address now requires its own L3 page table, increasing the total number of translation tables needed. Bump the USERSPACE && TEST default from 24 to 28 to accommodate the additional tables required by identity-mapped device MMIO. Signed-off-by: Carlo Caione (cherry picked from commit acc53653b4707aa40c22aec8c33f1d733e5e670f) --- arch/arm64/core/Kconfig | 2 +- .../demand_paging/mem_map/boards/qemu_cortex_a53.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/core/Kconfig b/arch/arm64/core/Kconfig index 61021a9e35b7..d4d40fe86864 100644 --- a/arch/arm64/core/Kconfig +++ b/arch/arm64/core/Kconfig @@ -382,7 +382,7 @@ config ARM64_PA_BITS config MAX_XLAT_TABLES int "Maximum numbers of translation tables" default 32 if USERSPACE && TEST && SMP - default 24 if USERSPACE && TEST + default 28 if USERSPACE && TEST default 20 if USERSPACE && (ARM64_VA_BITS >= 40) default 16 if USERSPACE default 12 if (ARM64_VA_BITS >= 40) diff --git a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf index 91a28adf437d..6da2825758a4 100644 --- a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf +++ b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf @@ -3,4 +3,4 @@ CONFIG_BACKING_STORE_RAM=y CONFIG_BACKING_STORE_RAM_PAGES=24 -CONFIG_SRAM_SIZE=440 +CONFIG_SRAM_SIZE=456 From b06ed4c009bbf1a16e6a9bfbbc2dac8ddb7ce540 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:45:31 +0100 Subject: [PATCH 3296/3334] [nrf fromtree] arch: kconfig: Add Kconfig for deprecated SRAM configuration Adds a Kconfig which will be used to determine where the source of truth will be for RAM configuration for a board target, to allow moving to a pure DTS approach Signed-off-by: Jamie McCrae (cherry picked from commit 29b11f9e6998609eecfe23783c1af916a7f5f39d) --- arch/Kconfig | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 051d953f87cf..a4bcc2c5e85e 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -223,6 +223,13 @@ config 64BIT soc/**/Kconfig, or boards/**/Kconfig and the user should generally avoid modifying it. +config SRAM_DEPRECATED_KCONFIG_SET + bool + help + Indicates that either `CONFIG_SRAM_SIZE` or `CONFIG_SRAM_BASE_ADDRESS` have been + manually set, these Kconfigs are now deprecated and should be replaced by referencing + the devicetree `zephyr,sram` chosen node instead. + # Workaround for not being able to have commas in macro arguments DT_CHOSEN_Z_SRAM := zephyr,sram @@ -232,7 +239,8 @@ config SRAM_SIZE help The SRAM size in kB. The default value comes from /chosen/zephyr,sram in devicetree. The user should generally avoid changing it via menuconfig or - in configuration files. + in configuration files. This option is now deprecated and must be replaced by referencing + the devicetree `zephyr,sram` chosen node instead. config SRAM_BASE_ADDRESS hex "SRAM Base Address" @@ -240,7 +248,8 @@ config SRAM_BASE_ADDRESS help The SRAM base address. The default value comes from /chosen/zephyr,sram in devicetree. The user should generally avoid - changing it via menuconfig or in configuration files. + changing it via menuconfig or in configuration files. This option is now deprecated and + must be replaced by referencing the devicetree `zephyr,sram` chosen node instead. config XIP bool "Execute in place" From 68b42e4db71ed77c1da46c620ac6a76e43034ff7 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 6 May 2026 13:25:33 +0100 Subject: [PATCH 3297/3334] [nrf fromtree] include: devicetree: Add SRAM macros Adds macros to get the chosen SRAM node's address and size Signed-off-by: Jamie McCrae (cherry picked from commit ab077598094454b23d08f4a7abd01d333f750fa8) --- include/zephyr/devicetree.h | 1 + include/zephyr/devicetree/sram.h | 59 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 include/zephyr/devicetree/sram.h diff --git a/include/zephyr/devicetree.h b/include/zephyr/devicetree.h index 929af69a865a..bc981a1d4874 100644 --- a/include/zephyr/devicetree.h +++ b/include/zephyr/devicetree.h @@ -5911,5 +5911,6 @@ #include #include #include +#include #endif /* ZEPHYR_INCLUDE_DEVICETREE_H_ */ diff --git a/include/zephyr/devicetree/sram.h b/include/zephyr/devicetree/sram.h new file mode 100644 index 000000000000..bf83a14808aa --- /dev/null +++ b/include/zephyr/devicetree/sram.h @@ -0,0 +1,59 @@ +/** + * @file + * @brief Chosen SRAM Devicetree macro public API header file. + */ + +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_DEVICETREE_SRAM_H_ +#define ZEPHYR_INCLUDE_DEVICETREE_SRAM_H_ + +#ifdef CONFIG_SRAM_DEPRECATED_KCONFIG_SET +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup devicetree-chosen-sram Devicetree SRAM API + * @ingroup devicetree + * @{ + */ + +/** + * @brief Get chosen SRAM node address + * + * @return Absolute address of chosen SRAM node, if it exists + */ +#ifdef CONFIG_SRAM_DEPRECATED_KCONFIG_SET +#define DT_CHOSEN_SRAM_ADDR CONFIG_SRAM_BASE_ADDRESS +#else +#define DT_CHOSEN_SRAM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_sram)) +#endif + +/** + * @brief Get chosen SRAM node size + * + * @return Size of chosen SRAM node, if it exists + */ +#ifdef CONFIG_SRAM_DEPRECATED_KCONFIG_SET +#define DT_CHOSEN_SRAM_SIZE (CONFIG_SRAM_SIZE * 1024) +#else +#define DT_CHOSEN_SRAM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_sram)) +#endif + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_DEVICETREE_SRAM_H_ */ From 669cc03df75828bc47c0fedd0469b63dbe00ec6a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:47:10 +0100 Subject: [PATCH 3298/3334] [nrf fromtree] arch: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit 96d1142210e36b6985ccb3ffbbea7b3569809c0d) --- arch/arm/core/cortex_a_r/reboot.c | 2 +- arch/arm/core/cortex_m/prep_c.c | 2 +- arch/arm/core/mpu/arm_mpu_regions.c | 6 +++--- arch/arm64/core/CMakeLists.txt | 8 +++++++- arch/riscv/Kconfig | 7 +++++-- arch/x86/Kconfig | 5 ++++- arch/x86/core/x86_mmu.c | 4 ++-- arch/x86/gen_mmu.py | 18 ++++++++++++++++-- arch/xtensa/core/ptables.c | 2 +- 9 files changed, 40 insertions(+), 14 deletions(-) diff --git a/arch/arm/core/cortex_a_r/reboot.c b/arch/arm/core/cortex_a_r/reboot.c index e5e44e13cfd0..afe272cec20e 100644 --- a/arch/arm/core/cortex_a_r/reboot.c +++ b/arch/arm/core/cortex_a_r/reboot.c @@ -44,7 +44,7 @@ TOOLCHAIN_DISABLE_WARNING(TOOLCHAIN_WARNING_NONNULL) void __weak relocate_vector_table(void) { #if defined(CONFIG_XIP) && (CONFIG_FLASH_BASE_ADDRESS != 0) || \ - !defined(CONFIG_XIP) && (CONFIG_SRAM_BASE_ADDRESS != 0) + !defined(CONFIG_XIP) && (DT_CHOSEN_SRAM_ADDR != 0) write_sctlr(read_sctlr() & ~HIVECS); size_t vector_size = (size_t)_vector_end - (size_t)_vector_start; (void)arch_early_memcpy(VECTOR_ADDRESS, _vector_start, vector_size); diff --git a/arch/arm/core/cortex_m/prep_c.c b/arch/arm/core/cortex_m/prep_c.c index 6daa0ae250e0..5f5fde43f44d 100644 --- a/arch/arm/core/cortex_m/prep_c.c +++ b/arch/arm/core/cortex_m/prep_c.c @@ -74,7 +74,7 @@ void __weak relocate_vector_table(void) void __weak relocate_vector_table(void) { #if defined(CONFIG_XIP) && (CONFIG_FLASH_BASE_ADDRESS != 0) || \ - !defined(CONFIG_XIP) && (CONFIG_SRAM_BASE_ADDRESS != 0) + !defined(CONFIG_XIP) && (DT_CHOSEN_SRAM_ADDR != 0) size_t vector_size = (size_t)_vector_end - (size_t)_vector_start; (void)memcpy(VECTOR_ADDRESS, _vector_start, vector_size); #elif defined(CONFIG_SW_VECTOR_RELAY) || defined(CONFIG_SW_VECTOR_RELAY_CLIENT) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 4771c5914ce6..9a0970353277 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -30,10 +30,10 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", - CONFIG_SRAM_BASE_ADDRESS, + DT_CHOSEN_SRAM_ADDR, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) - ARM_MPU_SRAM_REGION_ATTR(CONFIG_SRAM_BASE_ADDRESS, - CONFIG_SRAM_SIZE * 1024)), + ARM_MPU_SRAM_REGION_ATTR(DT_CHOSEN_SRAM_ADDR, + DT_CHOSEN_SRAM_SIZE)), #else ARM_MPU_SRAM_REGION_ATTR(REGION_SRAM_SIZE)), #endif diff --git a/arch/arm64/core/CMakeLists.txt b/arch/arm64/core/CMakeLists.txt index d93cf61d88a8..4044de905cd4 100644 --- a/arch/arm64/core/CMakeLists.txt +++ b/arch/arm64/core/CMakeLists.txt @@ -22,7 +22,13 @@ zephyr_library_sources( # simple numeric comparison because these values may be # beyond the numeric range of integers for cmake. -string(LENGTH "x${CONFIG_SRAM_BASE_ADDRESS}" SRAM_LENGTH) +if(CONFIG_SRAM_DEPRECATED_KCONFIG_SET) + string(LENGTH "x${CONFIG_SRAM_BASE_ADDRESS}" SRAM_LENGTH) +else() + dt_chosen(chosen_sram_path PROPERTY "zephyr,sram") + dt_reg_addr(ram_addr PATH "${chosen_sram_path}") + string(LENGTH "x${ram_addr}" SRAM_LENGTH) +endif() string(LENGTH "x${CONFIG_KERNEL_VM_BASE}" KERNEL_VM_LENGTH) if(${SRAM_LENGTH} GREATER 11 OR ${KERNEL_VM_LENGTH} GREATER 11) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 0cf427b67180..0fcbb7f82208 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -67,10 +67,13 @@ config RISCV_ALWAYS_SWITCH_THROUGH_ECALL and most people should say n here to minimize context switching overhead. +DT_CHOSEN_Z_SRAM = zephyr,sram + choice RISCV_CMODEL prompt "RISC-V Code Model" - default RISCV_CMODEL_LARGE if (SRAM_BASE_ADDRESS > 0xffffffff) || \ - (KERNEL_VM_BASE > 0xffffffff) + default RISCV_CMODEL_LARGE if (SRAM_DEPRECATED_KCONFIG_SET && SRAM_BASE_ADDRESS > 0xffffffff) || \ + (!SRAM_DEPRECATED_KCONFIG_SET && $(dt_chosen_reg_addr_int,$(DT_CHOSEN_Z_SRAM),0) > 0xffffffff) || \ + (KERNEL_VM_BASE > 0xffffffff) default RISCV_CMODEL_MEDANY if 64BIT default RISCV_CMODEL_MEDLOW diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e014766f6344..a4bac28ec959 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -356,9 +356,12 @@ config X86_MAX_ADDITIONAL_MEM_DOMAINS Zephyr test cases assume 3 additional domains can be instantiated. +DT_CHOSEN_Z_SRAM = zephyr,sram + config X86_EXTRA_PAGE_TABLE_PAGES int "Reserve extra pages in page table" - default 1 if X86_PAE && (KERNEL_VM_BASE != SRAM_BASE_ADDRESS) + default 1 if X86_PAE && ((SRAM_DEPRECATED_KCONFIG_SET && KERNEL_VM_BASE != SRAM_BASE_ADDRESS) || \ + (!SRAM_DEPRECATED_KCONFIG_SET && KERNEL_VM_BASE != $(dt_chosen_reg_addr_int,$(DT_CHOSEN_Z_SRAM),0))) default 0 depends on X86_MMU help diff --git a/arch/x86/core/x86_mmu.c b/arch/x86/core/x86_mmu.c index 9bece5dd9f5c..eff5bdef4072 100644 --- a/arch/x86/core/x86_mmu.c +++ b/arch/x86/core/x86_mmu.c @@ -1325,8 +1325,8 @@ static void identity_map_remove(uint32_t level) pentry_t *entry_ptr; k_mem_region_align((uintptr_t *)&pos, &size, - (uintptr_t)CONFIG_SRAM_BASE_ADDRESS, - (size_t)CONFIG_SRAM_SIZE * 1024U, scope); + (uintptr_t)DT_CHOSEN_SRAM_ADDR, + (size_t)DT_CHOSEN_SRAM_SIZE, scope); while (size != 0U) { /* Need to get to the correct table */ diff --git a/arch/x86/gen_mmu.py b/arch/x86/gen_mmu.py index 827cfa9c38ca..444c9dfc9bdf 100755 --- a/arch/x86/gen_mmu.py +++ b/arch/x86/gen_mmu.py @@ -69,16 +69,21 @@ import array import ctypes import os +import pickle import re import struct import sys import textwrap +from pathlib import Path import elftools from elftools.elf.elffile import ELFFile from elftools.elf.sections import SymbolTableSection from packaging import version +sys.path.append(str(Path(__file__).parents[2] / "scripts" / "dts" / "python-devicetree" / "src")) +from devicetree import edtlib # noqa: F401 + if version.parse(elftools.__version__) < version.parse('0.24'): sys.exit("pyelftools is out of date, need version 0.24 or later") @@ -784,8 +789,17 @@ def main(): vm_size = syms["CONFIG_KERNEL_VM_SIZE"] vm_offset = syms["CONFIG_KERNEL_VM_OFFSET"] - sram_base = syms["CONFIG_SRAM_BASE_ADDRESS"] - sram_size = syms["CONFIG_SRAM_SIZE"] * 1024 + if isdef("CONFIG_SRAM_DEPRECATED_KCONFIG_SET"): + sram_base = syms["CONFIG_SRAM_BASE_ADDRESS"] + sram_size = syms["CONFIG_SRAM_SIZE"] * 1024 + else: + edt_pickle_path = str(Path(args.kernel).parents[1] / "zephyr" / 'edt.pickle') + with open(edt_pickle_path, "rb") as f: + edt = pickle.load(f) + chosen_sram = edt.chosen_node("zephyr,sram") + + sram_base = chosen_sram.regs[0].addr + sram_size = chosen_sram.regs[0].size mapped_kernel_base = syms["z_mapped_start"] mapped_kernel_size = syms["z_mapped_size"] diff --git a/arch/xtensa/core/ptables.c b/arch/xtensa/core/ptables.c index 2f6d17d8f43a..a23073880f17 100644 --- a/arch/xtensa/core/ptables.c +++ b/arch/xtensa/core/ptables.c @@ -570,7 +570,7 @@ __weak void arch_reserved_pages_update(void) uintptr_t page; int idx; - for (page = CONFIG_SRAM_BASE_ADDRESS, idx = 0; + for (page = DT_CHOSEN_SRAM_ADDR, idx = 0; page < (uintptr_t)z_mapped_start; page += CONFIG_MMU_PAGE_SIZE, idx++) { k_mem_page_frame_set(&k_mem_page_frames[idx], K_MEM_PAGE_FRAME_RESERVED); From ecfd7f9c71cf5b4a2fc8de74757e9e1c78a9c42b Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:48:01 +0100 Subject: [PATCH 3299/3334] [nrf fromtree] cmake: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit 1c65d60a40b0765450358842d9b88ea64300bae5) --- CMakeLists.txt | 21 ++++++++++++++++++--- cmake/linker_script/arm/linker.cmake | 10 ++++++++-- cmake/modules/extensions.cmake | 18 ++++++++++++++---- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0cbd8e59898..4bb3dc1fbcda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1880,12 +1880,27 @@ if(CONFIG_BUILD_OUTPUT_BIN AND CONFIG_BUILD_OUTPUT_UF2) # are typically loaded to RAM if(NOT CONFIG_XIP) if(CONFIG_BUILD_OUTPUT_ADJUST_LMA) - math(EXPR code_address + if(CONFIG_SRAM_DEPRECATED_KCONFIG_SET) + math(EXPR code_address "${CONFIG_SRAM_BASE_ADDRESS} + ${CONFIG_BUILD_OUTPUT_ADJUST_LMA} + 0" OUTPUT_FORMAT HEXADECIMAL - ) + ) + else() + dt_chosen(chosen_sram_path PROPERTY "zephyr,sram") + dt_reg_addr(ram_addr PATH "${chosen_sram_path}") + + math(EXPR code_address + "${ram_addr} + ${CONFIG_BUILD_OUTPUT_ADJUST_LMA} + 0" + OUTPUT_FORMAT HEXADECIMAL + ) + endif() else() - set(code_address "${CONFIG_SRAM_BASE_ADDRESS}") + if(CONFIG_SRAM_DEPRECATED_KCONFIG_SET) + set(code_address ${CONFIG_SRAM_BASE_ADDRESS}) + else() + dt_chosen(chosen_sram_path PROPERTY "zephyr,sram") + dt_reg_addr(code_address PATH "${chosen_sram_path}") + endif() endif() endif() diff --git a/cmake/linker_script/arm/linker.cmake b/cmake/linker_script/arm/linker.cmake index b6d2254911bd..a2b83ffb3149 100644 --- a/cmake/linker_script/arm/linker.cmake +++ b/cmake/linker_script/arm/linker.cmake @@ -63,8 +63,14 @@ else() endif() endif() -set(RAM_ADDR ${CONFIG_SRAM_BASE_ADDRESS}) -math(EXPR RAM_SIZE "(${CONFIG_SRAM_SIZE} + 0) * 1024" OUTPUT_FORMAT HEXADECIMAL) +if(CONFIG_SRAM_DEPRECATED_KCONFIG_SET) + set(RAM_ADDR ${CONFIG_SRAM_BASE_ADDRESS}) + math(EXPR RAM_SIZE "(${CONFIG_SRAM_SIZE} + 0) * 1024" OUTPUT_FORMAT HEXADECIMAL) +else() + dt_chosen(chosen_sram_path PROPERTY "zephyr,sram") + dt_reg_addr(RAM_ADDR PATH "${chosen_sram_path}") + dt_reg_size(RAM_SIZE PATH "${chosen_sram_path}") +endif() # ToDo: decide on the optimal location for this. # linker/ld/target.cmake based on arch, or directly in arch and scatter_script.cmake can ignore diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake index 845a89833836..093e830cd378 100644 --- a/cmake/modules/extensions.cmake +++ b/cmake/modules/extensions.cmake @@ -5308,10 +5308,20 @@ function(zephyr_linker_section) # If KVMA is set and the Kernel virtual memory settings reqs are met, we # substitute the VMA setting with the specified KVMA value. if(CONFIG_MMU) - math(EXPR KERNEL_MEM_VM_OFFSET - "(${CONFIG_KERNEL_VM_BASE} + ${CONFIG_KERNEL_VM_OFFSET})\ - - (${CONFIG_SRAM_BASE_ADDRESS} + ${CONFIG_SRAM_OFFSET})" - ) + if(CONFIG_SRAM_DEPRECATED_KCONFIG_SET) + math(EXPR KERNEL_MEM_VM_OFFSET + "(${CONFIG_KERNEL_VM_BASE} + ${CONFIG_KERNEL_VM_OFFSET}) \ + - (${CONFIG_SRAM_BASE_ADDRESS} + ${CONFIG_SRAM_OFFSET})" + ) + else() + dt_chosen(chosen_sram_path PROPERTY "zephyr,sram") + dt_reg_addr(ram_addr PATH "${chosen_sram_path}") + + math(EXPR KERNEL_MEM_VM_OFFSET + "(${CONFIG_KERNEL_VM_BASE} + ${CONFIG_KERNEL_VM_OFFSET}) \ + - (${ram_addr} + ${CONFIG_SRAM_OFFSET})" + ) + endif() if(NOT (${KERNEL_MEM_VM_OFFSET} EQUAL 0)) set(SECTION_VMA ${SECTION_KVMA}) From cf8852f9783b653e26d5824fe53b03c161f3cd01 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:48:21 +0100 Subject: [PATCH 3300/3334] [nrf fromtree] include: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit c17b8678c6a331336c0e0a3e3a22abf8477b1c77) --- .../arch/arm/cortex_a_r/scripts/linker.ld | 4 +- .../arch/arm/cortex_m/scripts/linker.ld | 4 +- include/zephyr/arch/arm/mpu/arm_mpu_mem_cfg.h | 42 ++++++++++--------- include/zephyr/arch/arm64/scripts/linker.ld | 4 +- include/zephyr/arch/mips/linker.ld | 11 +++-- include/zephyr/arch/openrisc/linker.ld | 10 ++--- include/zephyr/arch/riscv/common/linker.ld | 8 ++-- include/zephyr/arch/rx/linker.ld | 6 +-- include/zephyr/arch/x86/memory.ld | 2 +- include/zephyr/kernel/internal/mm.h | 17 ++++---- include/zephyr/linker/linker-tool-gcc.h | 2 +- include/zephyr/sys/mem_manage.h | 6 +-- 12 files changed, 61 insertions(+), 55 deletions(-) diff --git a/include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld b/include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld index 04cc147bf8b7..82af01208258 100644 --- a/include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld @@ -57,8 +57,8 @@ #endif #endif /* defined(CONFIG_FLASH_USES_MAPPED_PARTITION) */ -#define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) -#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS +#define RAM_ADDR DT_CHOSEN_SRAM_ADDR +#define RAM_SIZE DT_CHOSEN_SRAM_SIZE /* Set alignment to CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE * to make linker section alignment comply with MPU granularity. diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index 2f3d55412f06..3f8bfe9d5900 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -57,8 +57,8 @@ #endif #endif /* defined(CONFIG_FLASH_USES_MAPPED_PARTITION) */ -#define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) -#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS +#define RAM_ADDR DT_CHOSEN_SRAM_ADDR +#define RAM_SIZE DT_CHOSEN_SRAM_SIZE #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; diff --git a/include/zephyr/arch/arm/mpu/arm_mpu_mem_cfg.h b/include/zephyr/arch/arm/mpu/arm_mpu_mem_cfg.h index a99223262d64..7d3eb3797539 100644 --- a/include/zephyr/arch/arm/mpu/arm_mpu_mem_cfg.h +++ b/include/zephyr/arch/arm/mpu/arm_mpu_mem_cfg.h @@ -52,49 +52,53 @@ #error "Unsupported flash size configuration" #endif +#define Z_SRAM_SIZE (DT_CHOSEN_SRAM_SIZE / 1024) + /* SRAM Region Definitions */ -#if CONFIG_SRAM_SIZE <= 16 +#if Z_SRAM_SIZE <= 16 #define REGION_SRAM_SIZE REGION_16K -#elif CONFIG_SRAM_SIZE <= 32 +#elif Z_SRAM_SIZE <= 32 #define REGION_SRAM_SIZE REGION_32K -#elif CONFIG_SRAM_SIZE <= 64 +#elif Z_SRAM_SIZE <= 64 #define REGION_SRAM_SIZE REGION_64K -#elif CONFIG_SRAM_SIZE <= 128 +#elif Z_SRAM_SIZE <= 128 #define REGION_SRAM_SIZE REGION_128K -#elif CONFIG_SRAM_SIZE <= 256 +#elif Z_SRAM_SIZE <= 256 #define REGION_SRAM_SIZE REGION_256K -#elif CONFIG_SRAM_SIZE <= 512 +#elif Z_SRAM_SIZE <= 512 #define REGION_SRAM_SIZE REGION_512K -#elif CONFIG_SRAM_SIZE <= 1024 +#elif Z_SRAM_SIZE <= 1024 #define REGION_SRAM_SIZE REGION_1M -#elif CONFIG_SRAM_SIZE <= 2048 +#elif Z_SRAM_SIZE <= 2048 #define REGION_SRAM_SIZE REGION_2M -#elif CONFIG_SRAM_SIZE <= 4096 +#elif Z_SRAM_SIZE <= 4096 #define REGION_SRAM_SIZE REGION_4M -#elif CONFIG_SRAM_SIZE <= 8192 +#elif Z_SRAM_SIZE <= 8192 #define REGION_SRAM_SIZE REGION_8M -#elif CONFIG_SRAM_SIZE <= 16384 +#elif Z_SRAM_SIZE <= 16384 #define REGION_SRAM_SIZE REGION_16M -#elif CONFIG_SRAM_SIZE <= 32768 +#elif Z_SRAM_SIZE <= 32768 #define REGION_SRAM_SIZE REGION_32M -#elif CONFIG_SRAM_SIZE <= 65536 +#elif Z_SRAM_SIZE <= 65536 #define REGION_SRAM_SIZE REGION_64M -#elif CONFIG_SRAM_SIZE <= 131072 +#elif Z_SRAM_SIZE <= 131072 #define REGION_SRAM_SIZE REGION_128M -#elif CONFIG_SRAM_SIZE <= 262144 +#elif Z_SRAM_SIZE <= 262144 #define REGION_SRAM_SIZE REGION_256M -#elif CONFIG_SRAM_SIZE <= 524288 +#elif Z_SRAM_SIZE <= 524288 #define REGION_SRAM_SIZE REGION_512M -#elif CONFIG_SRAM_SIZE <= 1048576 +#elif Z_SRAM_SIZE <= 1048576 #define REGION_SRAM_SIZE REGION_1G -#elif CONFIG_SRAM_SIZE <= 2097152 +#elif Z_SRAM_SIZE <= 2097152 #define REGION_SRAM_SIZE REGION_2G -#elif CONFIG_SRAM_SIZE <= 4194304 +#elif Z_SRAM_SIZE <= 4194304 #define REGION_SRAM_SIZE REGION_4G #else #error "Unsupported sram size configuration" #endif +#undef Z_SRAM_SIZE + /* Define Wrong value */ #define REGION_SIZE_UNSUPPORTED -1 diff --git a/include/zephyr/arch/arm64/scripts/linker.ld b/include/zephyr/arch/arm64/scripts/linker.ld index 93c8b2f5db64..cc87826d4918 100644 --- a/include/zephyr/arch/arm64/scripts/linker.ld +++ b/include/zephyr/arch/arm64/scripts/linker.ld @@ -49,8 +49,8 @@ #endif #endif /* defined(CONFIG_FLASH_USES_MAPPED_PARTITION) */ -#define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) -#define RAM_ADDR CONFIG_SRAM_BASE_ADDRESS +#define RAM_ADDR DT_CHOSEN_SRAM_ADDR +#define RAM_SIZE DT_CHOSEN_SRAM_SIZE #if defined(CONFIG_ARM_MMU) _region_min_align = CONFIG_MMU_PAGE_SIZE; diff --git a/include/zephyr/arch/mips/linker.ld b/include/zephyr/arch/mips/linker.ld index e82d756bdee8..66e865b34799 100644 --- a/include/zephyr/arch/mips/linker.ld +++ b/include/zephyr/arch/mips/linker.ld @@ -22,9 +22,12 @@ #define _EXCEPTION_SECTION_NAME exceptions #define _RESET_SECTION_NAME reset +#define RAM_BASE DT_CHOSEN_SRAM_ADDR +#define RAM_SIZE DT_CHOSEN_SRAM_SIZE + MEMORY { - RAM (rwx) : ORIGIN = CONFIG_SRAM_BASE_ADDRESS, LENGTH = KB(CONFIG_SRAM_SIZE) + RAM (rwx) : ORIGIN = RAM_BASE, LENGTH = RAM_SIZE /* Used by and documented in include/linker/intlist.ld */ IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K } @@ -37,9 +40,9 @@ REGION_ALIAS("REGION_BSS", RAM); ENTRY(CONFIG_KERNEL_ENTRY) -PROVIDE (__memory_base = CONFIG_SRAM_BASE_ADDRESS); -PROVIDE (__memory_size = CONFIG_SRAM_SIZE * 1024); -PROVIDE (__stack = CONFIG_SRAM_BASE_ADDRESS + (CONFIG_SRAM_SIZE - 1) * 1024); +PROVIDE (__memory_base = RAM_BASE); +PROVIDE (__memory_size = RAM_SIZE); +PROVIDE (__stack = RAM_BASE + (RAM_SIZE - 1024)); SECTIONS { diff --git a/include/zephyr/arch/openrisc/linker.ld b/include/zephyr/arch/openrisc/linker.ld index 6b2357b02d61..e840dafde3dc 100644 --- a/include/zephyr/arch/openrisc/linker.ld +++ b/include/zephyr/arch/openrisc/linker.ld @@ -38,8 +38,8 @@ #define ROM_SIZE (CONFIG_FLASH_SIZE * 1024) #endif -#define RAM_SIZE (CONFIG_SRAM_SIZE * 1K) -#define RAM_BASE CONFIG_SRAM_BASE_ADDRESS +#define RAM_BASE DT_CHOSEN_SRAM_ADDR +#define RAM_SIZE DT_CHOSEN_SRAM_SIZE #define _EXCEPTION_SECTION_NAME exception @@ -57,9 +57,9 @@ MEMORY ENTRY(CONFIG_KERNEL_ENTRY) -PROVIDE (__memory_base = CONFIG_SRAM_BASE_ADDRESS); -PROVIDE (__memory_size = CONFIG_SRAM_SIZE * 1024); -PROVIDE (__stack = CONFIG_SRAM_BASE_ADDRESS + (CONFIG_SRAM_SIZE - 1) * 1024); +PROVIDE (__memory_base = RAM_BASE); +PROVIDE (__memory_size = RAM_SIZE); +PROVIDE (__stack = RAM_BASE + (RAM_SIZE - 1024)); SECTIONS { diff --git a/include/zephyr/arch/riscv/common/linker.ld b/include/zephyr/arch/riscv/common/linker.ld index ac6015b88746..d272f621be5f 100644 --- a/include/zephyr/arch/riscv/common/linker.ld +++ b/include/zephyr/arch/riscv/common/linker.ld @@ -82,13 +82,13 @@ #endif /* DT_NODE_HAS_COMPAT_STATUS */ #else /* CONFIG_XIP */ -#define ROM_BASE CONFIG_SRAM_BASE_ADDRESS -#define ROM_SIZE (KB(CONFIG_SRAM_SIZE) - ROM_END_OFFSET) +#define ROM_BASE DT_CHOSEN_SRAM_ADDR +#define ROM_SIZE (DT_CHOSEN_SRAM_SIZE - ROM_END_OFFSET) #endif /* CONFIG_XIP */ #endif /* defined(CONFIG_FLASH_USES_MAPPED_PARTITION) && defined(CONFIG_XIP) */ -#define RAM_BASE CONFIG_SRAM_BASE_ADDRESS -#define RAM_SIZE KB(CONFIG_SRAM_SIZE) +#define RAM_BASE DT_CHOSEN_SRAM_ADDR +#define RAM_SIZE DT_CHOSEN_SRAM_SIZE #ifdef CONFIG_RISCV_PMP #define MPU_MIN_SIZE CONFIG_PMP_GRANULARITY diff --git a/include/zephyr/arch/rx/linker.ld b/include/zephyr/arch/rx/linker.ld index 91d81612eb56..c09459a6eff1 100644 --- a/include/zephyr/arch/rx/linker.ld +++ b/include/zephyr/arch/rx/linker.ld @@ -45,8 +45,8 @@ #endif #endif -#define RAM_START (CONFIG_SRAM_BASE_ADDRESS) -#define RAM_SIZE (KB(CONFIG_SRAM_SIZE)) +#define RAM_START DT_CHOSEN_SRAM_ADDR +#define RAM_SIZE DT_CHOSEN_SRAM_SIZE _region_min_align = 4; @@ -230,7 +230,7 @@ SECTIONS _app_smem_rom_start = LOADADDR(_APP_SMEM_SECTION_NAME); #endif /* CONFIG_USERSPACE */ - #if CONFIG_SRAM_BASE_ADDRESS == 0 + #if DT_CHOSEN_SRAM_ADDR == 0 /* RX memory starts at address 0 which can be confused with NULL. To prevent this, block * the first memory page (16 Bytes). */ diff --git a/include/zephyr/arch/x86/memory.ld b/include/zephyr/arch/x86/memory.ld index 3e2c0b693527..8dfc636be511 100644 --- a/include/zephyr/arch/x86/memory.ld +++ b/include/zephyr/arch/x86/memory.ld @@ -37,7 +37,7 @@ /* Virtual base address for the kernel; with CONFIG_MMU this is not necessarily * the same as its physical location, although an identity mapping for RAM - * is still supported by setting CONFIG_KERNEL_VM_BASE=CONFIG_SRAM_BASE_ADDRESS. + * is still supported by setting CONFIG_KERNEL_VM_BASE=DT_CHOSEN_SRAM_ADDR. */ #ifdef K_MEM_IS_VM_KERNEL #define KERNEL_BASE_ADDR (CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_VM_OFFSET) diff --git a/include/zephyr/kernel/internal/mm.h b/include/zephyr/kernel/internal/mm.h index cd5927e1c062..7b7cc9a1b6bd 100644 --- a/include/zephyr/kernel/internal/mm.h +++ b/include/zephyr/kernel/internal/mm.h @@ -9,6 +9,7 @@ #include #include +#include /** * @defgroup kernel_mm_internal_apis Kernel Memory Management Internal APIs @@ -26,7 +27,7 @@ * virt_addr = phys_addr + K_MEM_VIRT_OFFSET * * This only works for virtual addresses within the interval - * [CONFIG_KERNEL_VM_BASE, CONFIG_KERNEL_VM_BASE + (CONFIG_SRAM_SIZE * 1024)). + * [CONFIG_KERNEL_VM_BASE, CONFIG_KERNEL_VM_BASE + DT_CHOSEN_SRAM_ADDR). * * These macros are intended for assembly, linker code, and static initializers. * Use with care. @@ -39,22 +40,20 @@ */ #ifdef CONFIG_MMU #define K_MEM_VIRT_OFFSET ((CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_VM_OFFSET) - \ - (CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_OFFSET)) + (DT_CHOSEN_SRAM_ADDR + CONFIG_SRAM_OFFSET)) #else #define K_MEM_VIRT_OFFSET 0 #endif /* CONFIG_MMU */ -#if CONFIG_SRAM_BASE_ADDRESS != 0 -#define IS_SRAM_ADDRESS_LOWER(ADDR) ((ADDR) >= CONFIG_SRAM_BASE_ADDRESS) +#if DT_CHOSEN_SRAM_ADDR != 0 +#define IS_SRAM_ADDRESS_LOWER(ADDR) ((ADDR) >= DT_CHOSEN_SRAM_ADDR) #else #define IS_SRAM_ADDRESS_LOWER(ADDR) true -#endif /* CONFIG_SRAM_BASE_ADDRESS != 0 */ +#endif /* DT_CHOSEN_SRAM_ADDR != 0 */ - -#if (CONFIG_SRAM_BASE_ADDRESS + (CONFIG_SRAM_SIZE * 1024UL)) != 0 +#if (DT_CHOSEN_SRAM_ADDR + DT_CHOSEN_SRAM_SIZE) != 0 #define IS_SRAM_ADDRESS_UPPER(ADDR) \ - ((ADDR) < (CONFIG_SRAM_BASE_ADDRESS + \ - (CONFIG_SRAM_SIZE * 1024UL))) + ((ADDR) < (DT_CHOSEN_SRAM_ADDR + DT_CHOSEN_SRAM_SIZE)) #else #define IS_SRAM_ADDRESS_UPPER(ADDR) false #endif diff --git a/include/zephyr/linker/linker-tool-gcc.h b/include/zephyr/linker/linker-tool-gcc.h index d21524bc5420..f5b972d67ac3 100644 --- a/include/zephyr/linker/linker-tool-gcc.h +++ b/include/zephyr/linker/linker-tool-gcc.h @@ -83,7 +83,7 @@ * the memory area specified by 'where' argument. * * This macro is intentionally undefined for CONFIG_MMU systems when - * CONFIG_KERNEL_VM_BASE is not the same as CONFIG_SRAM_BASE_ADDRESS, + * CONFIG_KERNEL_VM_BASE is not the same as DT_CHOSEN_SRAM_ADDR, * as both the LMA and VMA destinations must be known for all sections * as this corresponds to physical vs. virtual location. * diff --git a/include/zephyr/sys/mem_manage.h b/include/zephyr/sys/mem_manage.h index a05b72d3886e..ab55a1f9ede1 100644 --- a/include/zephyr/sys/mem_manage.h +++ b/include/zephyr/sys/mem_manage.h @@ -23,9 +23,9 @@ * * This checks if the physical address (@p virt) is within * permissible range, e.g. between - * :kconfig:option:`CONFIG_SRAM_BASE_ADDRESS` and - * (:kconfig:option:`CONFIG_SRAM_BASE_ADDRESS` + - * :kconfig:option:`CONFIG_SRAM_SIZE`). + * :c:macro:`DT_CHOSEN_SRAM_ADDR` and + * (:c:macro:`DT_CHOSEN_SRAM_ADDR` + + * :c:macro:`DT_CHOSEN_SRAM_SIZE`). * * @note Only used if * :kconfig:option:`CONFIG_KERNEL_VM_USE_CUSTOM_MEM_RANGE_CHECK` From 35ac2ce4ce0b6d6af19d5e57fed2851c524f650a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:48:42 +0100 Subject: [PATCH 3301/3334] [nrf fromtree] lib: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit a036c6ab5bb39c65c3e7408f6de9c61c27ab8906) --- lib/heap/Kconfig | 6 +++++- lib/libc/common/source/stdlib/malloc.c | 4 ++-- lib/libc/newlib/libc-hooks.c | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index b9e6371fabff..18976e4ffec7 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -157,10 +157,14 @@ module = SYS_HEAP module-str = sys_heap source "subsys/logging/Kconfig.template.log_config" +DT_CHOSEN_Z_SRAM = zephyr,sram +DT_SRAM_SIZE = $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K) + choice prompt "Supported heap sizes" depends on !64BIT - default SYS_HEAP_SMALL_ONLY if (SRAM_SIZE <= 256) + default SYS_HEAP_SMALL_ONLY if ((SRAM_DEPRECATED_KCONFIG_SET && SRAM_SIZE <= 256) || \ + (!SRAM_DEPRECATED_KCONFIG_SET && $(DT_SRAM_SIZE) <= 256)) default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 74193fbdce48..7cfeadd00b71 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -106,8 +106,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((KB((size_t) CONFIG_SRAM_SIZE) - \ - ((size_t) HEAP_BASE - (size_t) CONFIG_SRAM_BASE_ADDRESS)), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((size_t) DT_CHOSEN_SRAM_SIZE - \ + ((size_t) HEAP_BASE - (size_t) DT_CHOSEN_SRAM_ADDR), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/lib/libc/newlib/libc-hooks.c b/lib/libc/newlib/libc-hooks.c index 55c109d8fe84..f7cd15da0324 100644 --- a/lib/libc/newlib/libc-hooks.c +++ b/lib/libc/newlib/libc-hooks.c @@ -111,8 +111,8 @@ int _getpid(void); #define MAX_HEAP_SIZE (POINTER_TO_UINT(&_heap_sentry) - \ HEAP_BASE) #else - #define MAX_HEAP_SIZE (KB(CONFIG_SRAM_SIZE) - (HEAP_BASE - \ - CONFIG_SRAM_BASE_ADDRESS)) + #define MAX_HEAP_SIZE (DT_CHOSEN_SRAM_SIZE - (HEAP_BASE - \ + DT_CHOSEN_SRAM_ADDR)) #endif /* CONFIG_XTENSA */ #endif From 96d8095ea8775149dde7806da4e8e28ff775f8a3 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:49:01 +0100 Subject: [PATCH 3302/3334] [nrf fromtree] drivers: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit ceb26f67f0a0f66a317de89d2bf08a3d68d36ffc) --- drivers/cache/cache_aspeed.c | 4 ++-- drivers/spi/spi_egis_et171.c | 5 +++-- drivers/usb/device/usb_dc_smartbond.c | 2 +- drivers/usb/udc/udc_smartbond.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/cache/cache_aspeed.c b/drivers/cache/cache_aspeed.c index b8fe9a81880b..c8b68510cbb5 100644 --- a/drivers/cache/cache_aspeed.c +++ b/drivers/cache/cache_aspeed.c @@ -23,8 +23,8 @@ #define CACHE_INVALID_REG 0xa54 #define CACHE_FUNC_CTRL_REG 0xa58 -#define CACHED_SRAM_ADDR CONFIG_SRAM_BASE_ADDRESS -#define CACHED_SRAM_SIZE KB(CONFIG_SRAM_SIZE) +#define CACHED_SRAM_ADDR DT_CHOSEN_SRAM_ADDR +#define CACHED_SRAM_SIZE DT_CHOSEN_SRAM_SIZE #define CACHED_SRAM_END (CACHED_SRAM_ADDR + CACHED_SRAM_SIZE - 1) #define CACHE_AREA_SIZE_LOG2 15 diff --git a/drivers/spi/spi_egis_et171.c b/drivers/spi/spi_egis_et171.c index ab0d61520d01..0a12b5528ab2 100644 --- a/drivers/spi/spi_egis_et171.c +++ b/drivers/spi/spi_egis_et171.c @@ -16,8 +16,9 @@ typedef void (*et171_cfg_func_t)(void); #ifdef CONFIG_CACHE_MANAGEMENT #include #define IS_ALIGN(x) (((uintptr_t)(x) & (sys_cache_data_line_size_get() - 1)) == 0) -#define DRAM_START CONFIG_SRAM_BASE_ADDRESS -#define DRAM_SIZE KB(CONFIG_SRAM_SIZE) + +#define DRAM_START DT_CHOSEN_SRAM_ADDR +#define DRAM_SIZE DT_CHOSEN_SRAM_SIZE #define DRAM_END (DRAM_START + DRAM_SIZE - 1) #define IS_ADDR_IN_RAM(addr) (((addr) >= DRAM_START) && ((addr) <= DRAM_END)) #endif diff --git a/drivers/usb/device/usb_dc_smartbond.c b/drivers/usb/device/usb_dc_smartbond.c index 21a2f5fc8177..60990d00946f 100644 --- a/drivers/usb/device/usb_dc_smartbond.c +++ b/drivers/usb/device/usb_dc_smartbond.c @@ -505,7 +505,7 @@ static void start_tx_packet(struct smartbond_ep_state *ep_state) if (ep_state->ep_addr != EP0_IN && remaining > DMA_MIN_TRANSFER_SIZE && - (uint32_t)(ep_state->buffer) >= CONFIG_SRAM_BASE_ADDRESS && + (uint32_t)(ep_state->buffer) >= DT_CHOSEN_SRAM_ADDR && try_allocate_dma(ep_state, USB_EP_DIR_IN)) { /* * Whole packet will be put in FIFO by DMA. diff --git a/drivers/usb/udc/udc_smartbond.c b/drivers/usb/udc/udc_smartbond.c index 1e64470e02a4..3e7445e9c2bd 100644 --- a/drivers/usb/udc/udc_smartbond.c +++ b/drivers/usb/udc/udc_smartbond.c @@ -431,7 +431,7 @@ static void start_tx_packet(struct usb_smartbond_data *data, struct smartbond_ep } if (ep != USB_CONTROL_EP_IN && size > config->dma_min_transfer_size && - (uint32_t)(buf->data) >= CONFIG_SRAM_BASE_ADDRESS && try_allocate_dma(data, ep_state)) { + (uint32_t)(buf->data) >= DT_CHOSEN_SRAM_ADDR && try_allocate_dma(data, ep_state)) { start_tx_dma(&config->dma_cfg, (uintptr_t)buf->data, (uintptr_t)®s->txd, size); } else { fill_tx_fifo(ep_state); From 0e253034d9d627ade0275bed5e705301e4a2b231 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:49:11 +0100 Subject: [PATCH 3303/3334] [nrf fromtree] kernel: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit 1d935da7002997d8fd2eacd18af4c728d4869c7d) --- kernel/include/mmu.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kernel/include/mmu.h b/kernel/include/mmu.h index e4a9f84d334a..f3b4b5f370e9 100644 --- a/kernel/include/mmu.h +++ b/kernel/include/mmu.h @@ -14,12 +14,13 @@ #include #include #include +#include /** Start address of physical memory. */ -#define K_MEM_PHYS_RAM_START ((uintptr_t)CONFIG_SRAM_BASE_ADDRESS) +#define K_MEM_PHYS_RAM_START ((uintptr_t)DT_CHOSEN_SRAM_ADDR) /** Size of physical memory. */ -#define K_MEM_PHYS_RAM_SIZE (KB(CONFIG_SRAM_SIZE)) +#define K_MEM_PHYS_RAM_SIZE DT_CHOSEN_SRAM_SIZE /** End address (exclusive) of physical memory. */ #define K_MEM_PHYS_RAM_END (K_MEM_PHYS_RAM_START + K_MEM_PHYS_RAM_SIZE) @@ -49,7 +50,7 @@ */ #define K_MEM_VM_OFFSET \ ((CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_VM_OFFSET) - \ - (CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_OFFSET)) + (K_MEM_PHYS_RAM_START + CONFIG_SRAM_OFFSET)) /** * @brief Get physical address from virtual address for boot RAM mappings. @@ -87,7 +88,7 @@ * * - If it is enabled, which means all physical memory are mapped in virtual * memory address space, and it is the same as - * (CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE). + * (DT_CHOSEN_SRAM_ADDR + DT_CHOSEN_SRAM_SIZE). * * - If it is disabled, K_MEM_VM_FREE_START is the same K_MEM_KERNEL_VIRT_END which * is the end of the kernel image. @@ -113,8 +114,8 @@ * @brief Number of page frames. * * At present, page frame management is only done for main system RAM, - * and we generate paging structures based on CONFIG_SRAM_BASE_ADDRESS - * and CONFIG_SRAM_SIZE. + * and we generate paging structures based on DT_CHOSEN_SRAM_ADDR + * and DT_CHOSEN_SRAM_SIZE. * * If we have other RAM regions (DCCM, etc) these typically have special * properties and shouldn't be used generically for demand paging or From 6900011aa967b66f7cf79e0c4dd990f1f68f77f5 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:50:08 +0100 Subject: [PATCH 3304/3334] [nrf fromtree] soc: nordic: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit 831e1ea3a227d41ff6459751c786eb51f2ba5d40) --- soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c index 303fdf8ac8ae..62d4af22bbf8 100644 --- a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c +++ b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c @@ -22,6 +22,9 @@ #define SOFTPERIPH_BASE DT_REG_ADDR(DT_NODELABEL(softperiph_ram)) #define SOFTPERIPH_SIZE DT_REG_SIZE(DT_NODELABEL(softperiph_ram)) +#define RAM_BASE DT_REG_ADDR(DT_CHOSEN(zephyr_sram)) +#define RAM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_sram)) + static struct arm_mpu_region mpu_regions[] = { #ifdef CONFIG_XIP MPU_REGION_ENTRY("FLASH_0", @@ -30,9 +33,8 @@ static struct arm_mpu_region mpu_regions[] = { CONFIG_FLASH_SIZE * 1024)), #endif MPU_REGION_ENTRY("SRAM_0", - CONFIG_SRAM_BASE_ADDRESS, - REGION_RAM_ATTR(CONFIG_SRAM_BASE_ADDRESS, - CONFIG_SRAM_SIZE * 1024)), + RAM_BASE, + REGION_RAM_ATTR(RAM_BASE, RAM_SIZE)), #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(usbhs)) MPU_REGION_ENTRY("USBHS_CORE", USBHS_BASE, From a2ac1e96742fe47b55d02940bb37cc3ceec5973b Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:54:05 +0100 Subject: [PATCH 3305/3334] [nrf fromtree] boards: qemu: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit 387b9042302a64a50dd80da721b0e3342b94eeb1) --- boards/qemu/x86/board.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/boards/qemu/x86/board.cmake b/boards/qemu/x86/board.cmake index e8a4758f1303..b4a6530f3d5b 100644 --- a/boards/qemu/x86/board.cmake +++ b/boards/qemu/x86/board.cmake @@ -20,15 +20,23 @@ else() set(QEMU_CPU_TYPE_${ARCH} qemu32,+nx,+pae) endif() +if(CONFIG_SRAM_DEPRECATED_KCONFIG_SET) + math(EXPR RAM_SIZE "${CONFIG_SRAM_SIZE} / 1024" OUTPUT_FORMAT HEXADECIMAL) +else() + dt_chosen(chosen_sram_path PROPERTY "zephyr,sram") + dt_reg_size(RAM_SIZE PATH "${chosen_sram_path}") + math(EXPR RAM_SIZE "${RAM_SIZE} / 1024 / 1024" OUTPUT_FORMAT HEXADECIMAL) +endif() + if(CONFIG_XIP) # Extra 4MB to emulate flash area - math(EXPR QEMU_MEMORY_SIZE_MB "${CONFIG_SRAM_SIZE} / 1024 + 4") + math(EXPR QEMU_MEMORY_SIZE_MB "${RAM_SIZE} + 4") elseif(CONFIG_BOARD_QEMU_X86_TINY AND CONFIG_DEMAND_PAGING AND NOT CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT) # Flash is at 4MB-8MB, so need this to be large enough math(EXPR QEMU_MEMORY_SIZE_MB "8") else() - math(EXPR QEMU_MEMORY_SIZE_MB "${CONFIG_SRAM_SIZE} / 1024") + math(EXPR QEMU_MEMORY_SIZE_MB "${RAM_SIZE}") endif() set(QEMU_CPU_FLAGS "") From d486621d945eea823b7d815fb434b574cfd785cc Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:54:18 +0100 Subject: [PATCH 3306/3334] [nrf fromtree] tests: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit 46cde6837d77043be4558813406852f86afeb225) --- .../code_relocation/linker_arm_sram2.ld | 8 ++++--- .../linker_riscv_qemu_sram2.ld | 7 +++--- .../linker_xtensa_qemu_sram2.ld | 4 ++-- .../ram_context_for_isr/src/main.c | 16 ++++++------- .../vector_table_relocation/src/main.c | 4 ++-- .../arm64_high_addresses/high_address.overlay | 3 +++ .../arm64_high_addresses/low_address.overlay | 3 +++ .../arm64/arm64_high_addresses/testcase.yaml | 24 ++++++++++++------- tests/arch/x86/pagetables/src/main.c | 4 +++- tests/benchmarks/sys_kernel/src/syskernel.h | 4 +++- tests/boot/uefi/app.overlay | 3 +++ tests/boot/uefi/prj.conf | 1 - tests/drivers/disk/disk_access/src/main.c | 6 +++-- .../drivers/disk/disk_performance/src/main.c | 6 +++-- tests/drivers/tee/optee/app.overlay | 14 +++++++++++ .../tee/optee/boards/native_sim_64.overlay | 14 +++++++++++ tests/drivers/tee/optee/prj.conf | 1 - .../mem_map/boards/qemu_cortex_a53.conf | 1 - .../mem_map/boards/qemu_cortex_a53.overlay | 3 +++ .../mem_map/boards/qemu_cortex_a53_smp.conf | 1 - .../boards/qemu_cortex_a53_smp.overlay | 3 +++ .../src/test_priority_scheduling.c | 6 +++-- .../schedule_api/src/test_slice_scheduling.c | 4 ++-- tests/kernel/timer/timer_behavior/Kconfig | 17 +++++++++---- tests/lib/heap/src/main.c | 6 ++--- 25 files changed, 114 insertions(+), 49 deletions(-) create mode 100644 tests/arch/arm64/arm64_high_addresses/high_address.overlay create mode 100644 tests/arch/arm64/arm64_high_addresses/low_address.overlay create mode 100644 tests/boot/uefi/app.overlay create mode 100644 tests/drivers/tee/optee/app.overlay create mode 100644 tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.overlay create mode 100644 tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.overlay diff --git a/tests/application_development/code_relocation/linker_arm_sram2.ld b/tests/application_development/code_relocation/linker_arm_sram2.ld index deb2c6f5aca6..91fb21dd0db3 100644 --- a/tests/application_development/code_relocation/linker_arm_sram2.ld +++ b/tests/application_development/code_relocation/linker_arm_sram2.ld @@ -25,14 +25,16 @@ #define _SRAM2_DATA_SECTION_NAME .sram2_data #define _SRAM2_BSS_SECTION_NAME .sram2_bss #define _SRAM2_TEXT_SECTION_NAME .sram2_text - #define SRAM2_ADDR (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2) + + #define SRAM2_ADDR (DT_CHOSEN_SRAM_ADDR + RAM_SIZE2) #endif -#define RAM_SIZE2 (CONFIG_SRAM_SIZE * 512) +#define RAM_SIZE2 (DT_CHOSEN_SRAM_SIZE / 2) + MEMORY { #ifdef CONFIG_SRAM2 - SRAM2 (wx) : ORIGIN = (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2), LENGTH = RAM_SIZE2 + SRAM2 (wx) : ORIGIN = SRAM2_ADDR, LENGTH = RAM_SIZE2 #endif } diff --git a/tests/application_development/code_relocation/linker_riscv_qemu_sram2.ld b/tests/application_development/code_relocation/linker_riscv_qemu_sram2.ld index cf59a6aad69c..9c0e57c742a5 100644 --- a/tests/application_development/code_relocation/linker_riscv_qemu_sram2.ld +++ b/tests/application_development/code_relocation/linker_riscv_qemu_sram2.ld @@ -16,12 +16,13 @@ #define _SRAM2_DATA_SECTION_NAME .sram2_data #define _SRAM2_BSS_SECTION_NAME .sram2_bss #define _SRAM2_TEXT_SECTION_NAME .sram2_text -#define SRAM2_ADDR (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2) -#define RAM_SIZE2 (CONFIG_SRAM_SIZE * 512) +#define RAM_SIZE2 (DT_CHOSEN_SRAM_SIZE / 2) +#define RAM_BASE2 (DT_CHOSEN_SRAM_ADDR + RAM_SIZE2) + MEMORY { - SRAM2 (wx) : ORIGIN = (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2), LENGTH = RAM_SIZE2 + SRAM2 (wx) : ORIGIN = RAM_BASE2, LENGTH = RAM_SIZE2 } #include diff --git a/tests/application_development/code_relocation/linker_xtensa_qemu_sram2.ld b/tests/application_development/code_relocation/linker_xtensa_qemu_sram2.ld index 3fd33186a8f4..1526d2e580ae 100644 --- a/tests/application_development/code_relocation/linker_xtensa_qemu_sram2.ld +++ b/tests/application_development/code_relocation/linker_xtensa_qemu_sram2.ld @@ -10,12 +10,12 @@ #include #include -#define SRAM2_ADDR (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2) #define RAM_SIZE2 (0x4000000) +#define SRAM2_ADDR (DT_CHOSEN_SRAM_ADDR + RAM_SIZE2) MEMORY { - SRAM2 (wx) : ORIGIN = (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2), LENGTH = RAM_SIZE2 + SRAM2 (wx) : ORIGIN = SRAM2_ADDR, LENGTH = RAM_SIZE2 } PHDRS diff --git a/tests/application_development/ram_context_for_isr/src/main.c b/tests/application_development/ram_context_for_isr/src/main.c index 64955e7e2a2f..b06ea584ee69 100644 --- a/tests/application_development/ram_context_for_isr/src/main.c +++ b/tests/application_development/ram_context_for_isr/src/main.c @@ -37,17 +37,17 @@ static void test_irq_callback(const struct device *dev, void *user_data) driver_isr_addr = (uintptr_t)user_data; /* Check that the function and its call stack are in RAM */ - zassert_true(func_addr >= CONFIG_SRAM_BASE_ADDRESS && - func_addr <= CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE * 1024, + zassert_true(func_addr >= DT_CHOSEN_SRAM_ADDR && + func_addr <= DT_CHOSEN_SRAM_ADDR + DT_CHOSEN_SRAM_SIZE, "%s is not in RAM! Address: 0x%lx", __func__, func_addr); - zassert_true(driver_isr_addr >= CONFIG_SRAM_BASE_ADDRESS && - driver_isr_addr <= CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE * 1024, + zassert_true(driver_isr_addr >= DT_CHOSEN_SRAM_ADDR && + driver_isr_addr <= DT_CHOSEN_SRAM_ADDR + DT_CHOSEN_SRAM_SIZE, "fake_driver_isr is not in RAM! Address: 0x%lx", driver_isr_addr); - zassert_true(arch_isr_wrapper_addr >= CONFIG_SRAM_BASE_ADDRESS && + zassert_true(arch_isr_wrapper_addr >= DT_CHOSEN_SRAM_ADDR && arch_isr_wrapper_addr <= - CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE * 1024, + DT_CHOSEN_SRAM_ADDR + DT_CHOSEN_SRAM_SIZE, "arch_isr_wrapper_addr is not in RAM! Address: 0x%lx", arch_isr_wrapper_addr); TC_PRINT("Callback function address: 0x%lx\n", func_addr); @@ -61,8 +61,8 @@ ZTEST(ram_context_for_isr, test_fake_driver_in_ram) const struct fake_driver_api *api = DEVICE_API_GET(fake, dev); uintptr_t dev_addr = (uintptr_t)dev; - zassert_true(dev_addr >= CONFIG_SRAM_BASE_ADDRESS && - dev_addr <= CONFIG_SRAM_BASE_ADDRESS + CONFIG_SRAM_SIZE * 1024, + zassert_true(dev_addr >= DT_CHOSEN_SRAM_ADDR && + dev_addr <= DT_CHOSEN_SRAM_ADDR + DT_CHOSEN_SRAM_SIZE, "fake driver device is not in RAM! Address: 0x%lx", dev_addr); TC_PRINT("Fake driver device address: 0x%lx\n", dev_addr); diff --git a/tests/application_development/vector_table_relocation/src/main.c b/tests/application_development/vector_table_relocation/src/main.c index 5de58fcb43bf..c21bab03f145 100644 --- a/tests/application_development/vector_table_relocation/src/main.c +++ b/tests/application_development/vector_table_relocation/src/main.c @@ -22,8 +22,8 @@ #define SRAM_VT_BASE DT_REG_ADDR(ITCM_NODE) #define SRAM_VT_SIZE DT_REG_SIZE(ITCM_NODE) #else -#define SRAM_VT_BASE CONFIG_SRAM_BASE_ADDRESS -#define SRAM_VT_SIZE (CONFIG_SRAM_SIZE * 1024U) +#define SRAM_VT_BASE DT_CHOSEN_SRAM_ADDR +#define SRAM_VT_SIZE DT_CHOSEN_SRAM_SIZE #endif #ifdef SCB_VTOR_TBLBASE_Msk diff --git a/tests/arch/arm64/arm64_high_addresses/high_address.overlay b/tests/arch/arm64/arm64_high_addresses/high_address.overlay new file mode 100644 index 000000000000..21a335fe5708 --- /dev/null +++ b/tests/arch/arm64/arm64_high_addresses/high_address.overlay @@ -0,0 +1,3 @@ +&sram0 { + reg = <0x2 0x00880000 0x0 0x80000>; +}; diff --git a/tests/arch/arm64/arm64_high_addresses/low_address.overlay b/tests/arch/arm64/arm64_high_addresses/low_address.overlay new file mode 100644 index 000000000000..11e27cae9abf --- /dev/null +++ b/tests/arch/arm64/arm64_high_addresses/low_address.overlay @@ -0,0 +1,3 @@ +&sram0 { + reg = <0x0 0x400000 0x0 0x80000>; +}; diff --git a/tests/arch/arm64/arm64_high_addresses/testcase.yaml b/tests/arch/arm64/arm64_high_addresses/testcase.yaml index 9b09f9745a61..fe350f2f0261 100644 --- a/tests/arch/arm64/arm64_high_addresses/testcase.yaml +++ b/tests/arch/arm64/arm64_high_addresses/testcase.yaml @@ -10,48 +10,56 @@ common: tests: arch.arm64.high_addr.high_sram_low_vm: extra_configs: - - CONFIG_SRAM_BASE_ADDRESS=0x200880000 - CONFIG_KERNEL_VM_BASE=0x00400000 + extra_args: + - EXTRA_DTC_OVERLAY_FILE="high_address.overlay" arch.arm64.high_addr.low_sram_high_vm: extra_configs: - - CONFIG_SRAM_BASE_ADDRESS=0x00400000 - CONFIG_KERNEL_VM_BASE=0x200880000 + extra_args: + - EXTRA_DTC_OVERLAY_FILE="low_address.overlay" arch.arm64.high_addr.high_sram_equal_vm: extra_configs: - - CONFIG_SRAM_BASE_ADDRESS=0x200880000 - CONFIG_KERNEL_VM_BASE=0x200880000 + extra_args: + - EXTRA_DTC_OVERLAY_FILE="high_address.overlay" arch.arm64.high_addr.high_sram_high_vm: extra_configs: - - CONFIG_SRAM_BASE_ADDRESS=0x200880000 - CONFIG_KERNEL_VM_BASE=0x200800000 + extra_args: + - EXTRA_DTC_OVERLAY_FILE="high_address.overlay" arch.arm64.high_addr.high_sram_low_vm.picolibc: tags: picolibc extra_configs: - - CONFIG_SRAM_BASE_ADDRESS=0x200880000 - CONFIG_KERNEL_VM_BASE=0x00400000 - CONFIG_PICOLIBC=y + extra_args: + - EXTRA_DTC_OVERLAY_FILE="high_address.overlay" arch.arm64.high_addr.low_sram_high_vm.picolibc: tags: picolibc extra_configs: - - CONFIG_SRAM_BASE_ADDRESS=0x00400000 - CONFIG_KERNEL_VM_BASE=0x200880000 - CONFIG_PICOLIBC=y + extra_args: + - EXTRA_DTC_OVERLAY_FILE="low_address.overlay" arch.arm64.high_addr.high_sram_equal_vm.picolibc: tags: picolibc extra_configs: - - CONFIG_SRAM_BASE_ADDRESS=0x200880000 - CONFIG_KERNEL_VM_BASE=0x200880000 - CONFIG_PICOLIBC=y + extra_args: + - EXTRA_DTC_OVERLAY_FILE="high_address.overlay" arch.arm64.high_addr.high_sram_high_vm.picolibc: tags: picolibc extra_configs: - - CONFIG_SRAM_BASE_ADDRESS=0x200880000 - CONFIG_KERNEL_VM_BASE=0x200800000 - CONFIG_PICOLIBC=y + extra_args: + - EXTRA_DTC_OVERLAY_FILE="high_address.overlay" diff --git a/tests/arch/x86/pagetables/src/main.c b/tests/arch/x86/pagetables/src/main.c index c75c73bfbec4..c1f0d9cbffc6 100644 --- a/tests/arch/x86/pagetables/src/main.c +++ b/tests/arch/x86/pagetables/src/main.c @@ -242,9 +242,11 @@ void z_vrfy_dump_my_ptables(void) #include #endif /* CONFIG_USERSPACE */ +#define RAM_SIZE (DT_CHOSEN_SRAM_SIZE / 1024) + void dump_pagetables(void) { -#if CONFIG_SRAM_SIZE > (32 << 10) +#if RAM_SIZE > (32 << 10) /* * Takes too long to dump page table, so skip dumping * if memory size is larger than 32MB. diff --git a/tests/benchmarks/sys_kernel/src/syskernel.h b/tests/benchmarks/sys_kernel/src/syskernel.h index f12c2ea21d73..d8827ee60644 100644 --- a/tests/benchmarks/sys_kernel/src/syskernel.h +++ b/tests/benchmarks/sys_kernel/src/syskernel.h @@ -15,7 +15,9 @@ #include #define STACK_SIZE 2048 -#if CONFIG_SRAM_SIZE <= 32 +#define RAM_SIZE (DT_CHOSEN_SRAM_SIZE / 1024) + +#if RAM_SIZE <= 32 #define NUMBER_OF_LOOPS 100 #else #define NUMBER_OF_LOOPS 1000 diff --git a/tests/boot/uefi/app.overlay b/tests/boot/uefi/app.overlay new file mode 100644 index 000000000000..3867176dbcda --- /dev/null +++ b/tests/boot/uefi/app.overlay @@ -0,0 +1,3 @@ +&dram0 { + reg = <0x0 0xc800000>; +}; diff --git a/tests/boot/uefi/prj.conf b/tests/boot/uefi/prj.conf index 48ca509cdd56..5ba848d79bef 100644 --- a/tests/boot/uefi/prj.conf +++ b/tests/boot/uefi/prj.conf @@ -1,4 +1,3 @@ CONFIG_QEMU_UEFI_BOOT=y CONFIG_BUILD_OUTPUT_EFI=y -CONFIG_SRAM_SIZE=204800 CONFIG_ACPI=y diff --git a/tests/drivers/disk/disk_access/src/main.c b/tests/drivers/disk/disk_access/src/main.c index fa891e946829..bca4dc991cb8 100644 --- a/tests/drivers/disk/disk_access/src/main.c +++ b/tests/drivers/disk/disk_access/src/main.c @@ -37,7 +37,9 @@ #error "No disk device defined, is your board supported?" #endif -#if CONFIG_SRAM_SIZE >= 512 +#define RAM_SIZE (DT_CHOSEN_SRAM_SIZE / 1024) + +#if RAM_SIZE >= 512 /* Cap buffer size at 128 KiB */ #define MAX_TOTAL_BUF_SIZE 128 #elif CONFIG_SOC_POSIX @@ -45,7 +47,7 @@ #define MAX_TOTAL_BUF_SIZE 128 #else /* Use half of all SRAM */ -#define MAX_TOTAL_BUF_SIZE (CONFIG_SRAM_SIZE / 2) +#define MAX_TOTAL_BUF_SIZE (RAM_SIZE / 2) #endif #define BUF_SIZE ((MAX_TOTAL_BUF_SIZE * 1024) / 2) diff --git a/tests/drivers/disk/disk_performance/src/main.c b/tests/drivers/disk/disk_performance/src/main.c index d10968535f6d..3e79e4186900 100644 --- a/tests/drivers/disk/disk_performance/src/main.c +++ b/tests/drivers/disk/disk_performance/src/main.c @@ -24,7 +24,9 @@ #error "No disk device defined, is your board supported?" #endif -#if CONFIG_SRAM_SIZE >= 512 +#define RAM_SIZE (DT_CHOSEN_SRAM_SIZE / 1024) + +#if RAM_SIZE >= 512 /* Cap buffer size at 128 KiB */ #define MAX_TOTAL_BUF_SIZE 128 #elif CONFIG_SOC_POSIX @@ -32,7 +34,7 @@ #define MAX_TOTAL_BUF_SIZE 128 #else /* Use half of all SRAM */ -#define MAX_TOTAL_BUF_SIZE (CONFIG_SRAM_SIZE / 2) +#define MAX_TOTAL_BUF_SIZE (RAM_SIZE / 2) #endif #define BUF_SIZE ((MAX_TOTAL_BUF_SIZE * 1024) / 2) diff --git a/tests/drivers/tee/optee/app.overlay b/tests/drivers/tee/optee/app.overlay new file mode 100644 index 000000000000..0a472c90132e --- /dev/null +++ b/tests/drivers/tee/optee/app.overlay @@ -0,0 +1,14 @@ +/ { + chosen { + zephyr,sram = &sram0; + }; +}; + +&soc { + sram0: memory@0 { + compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x0 0x80000000>; + }; +}; diff --git a/tests/drivers/tee/optee/boards/native_sim_64.overlay b/tests/drivers/tee/optee/boards/native_sim_64.overlay index 65ceec3f5fb2..9276c56cfa53 100644 --- a/tests/drivers/tee/optee/boards/native_sim_64.overlay +++ b/tests/drivers/tee/optee/boards/native_sim_64.overlay @@ -10,4 +10,18 @@ status = "okay"; }; }; + + chosen { + zephyr,sram = &sram0; + }; + + soc { + #address-cells = <1>; + #size-cells = <2>; + + sram0: memory@0 { + compatible = "mmio-sram"; + reg = <0x0 0x20ffbe6 0xe4000000>; + }; + }; }; diff --git a/tests/drivers/tee/optee/prj.conf b/tests/drivers/tee/optee/prj.conf index 7550829f1dd3..6df8e7992066 100644 --- a/tests/drivers/tee/optee/prj.conf +++ b/tests/drivers/tee/optee/prj.conf @@ -3,4 +3,3 @@ CONFIG_BOOT_BANNER=n CONFIG_HEAP_MEM_POOL_SIZE=270044 CONFIG_TEE=y CONFIG_OPTEE=y -CONFIG_SRAM_SIZE=145131134582784 diff --git a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf index 6da2825758a4..a66a33df93c7 100644 --- a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf +++ b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.conf @@ -3,4 +3,3 @@ CONFIG_BACKING_STORE_RAM=y CONFIG_BACKING_STORE_RAM_PAGES=24 -CONFIG_SRAM_SIZE=456 diff --git a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.overlay b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.overlay new file mode 100644 index 000000000000..3ba24b9fb01b --- /dev/null +++ b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53.overlay @@ -0,0 +1,3 @@ +&sram0 { + reg = <0x0 0x40000000 0x0 0x72000>; +}; diff --git a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.conf b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.conf index 1ce923d0cbb9..bc16db15e462 100644 --- a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.conf +++ b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.conf @@ -3,5 +3,4 @@ CONFIG_BACKING_STORE_RAM=y CONFIG_BACKING_STORE_RAM_PAGES=24 -CONFIG_SRAM_SIZE=560 CONFIG_DEMAND_PAGING_ALLOW_IRQ=y diff --git a/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.overlay b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.overlay new file mode 100644 index 000000000000..df9069553ee6 --- /dev/null +++ b/tests/kernel/mem_protect/demand_paging/mem_map/boards/qemu_cortex_a53_smp.overlay @@ -0,0 +1,3 @@ +&sram0 { + reg = <0x0 0x40000000 0x0 0x8c000>; +}; diff --git a/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c b/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c index 7d72b54c0d6f..e0aebf988e17 100644 --- a/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c +++ b/tests/kernel/sched/schedule_api/src/test_priority_scheduling.c @@ -7,10 +7,12 @@ #include #include "test_sched.h" +#define RAM_SIZE (DT_CHOSEN_SRAM_SIZE / 1024) + /* nrf 51 has lower ram, so creating less number of threads */ -#if CONFIG_SRAM_SIZE <= 24 +#if RAM_SIZE <= 24 #define NUM_THREAD 2 -#elif (CONFIG_SRAM_SIZE <= 32) \ +#elif (RAM_SIZE <= 32) \ || defined(CONFIG_SOC_EMSK_EM7D) #define NUM_THREAD 3 #else diff --git a/tests/kernel/sched/schedule_api/src/test_slice_scheduling.c b/tests/kernel/sched/schedule_api/src/test_slice_scheduling.c index a65e7dcb3c7e..a301d07200b4 100644 --- a/tests/kernel/sched/schedule_api/src/test_slice_scheduling.c +++ b/tests/kernel/sched/schedule_api/src/test_slice_scheduling.c @@ -10,9 +10,9 @@ #ifdef CONFIG_TIMESLICING /* nrf 51 has lower ram, so creating less number of threads */ -#if CONFIG_SRAM_SIZE <= 24 +#if (DT_CHOSEN_SRAM_SIZE / 1024) <= 24 #define NUM_THREAD 2 -#elif (CONFIG_SRAM_SIZE <= 32) \ +#elif ((DT_CHOSEN_SRAM_SIZE / 1024) <= 32) \ || defined(CONFIG_SOC_EMSK_EM7D) #define NUM_THREAD 3 #else diff --git a/tests/kernel/timer/timer_behavior/Kconfig b/tests/kernel/timer/timer_behavior/Kconfig index 520354416762..cd4890c5d906 100644 --- a/tests/kernel/timer/timer_behavior/Kconfig +++ b/tests/kernel/timer/timer_behavior/Kconfig @@ -8,13 +8,20 @@ config SYS_CLOCK_TICKS_PER_SEC source "Kconfig.zephyr" +DT_CHOSEN_Z_SRAM = zephyr,sram + config TIMER_TEST_SAMPLES int "The number of timer samples to gather for statistics" - default 1000 if (SRAM_SIZE <= 24) - default 2000 if (SRAM_SIZE <= 32) - default 3000 if (SRAM_SIZE <= 48) - default 5000 if (SRAM_SIZE <= 64) - default 7000 if (SRAM_SIZE <= 96) + default 1000 if (SRAM_DEPRECATED_KCONFIG_SET && SRAM_SIZE <= 24) || \ + (!SRAM_DEPRECATED_KCONFIG_SET && $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K) <= 24) + default 2000 if (SRAM_DEPRECATED_KCONFIG_SET && SRAM_SIZE <= 32) || \ + (!SRAM_DEPRECATED_KCONFIG_SET && $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K) <= 32) + default 3000 if (SRAM_DEPRECATED_KCONFIG_SET && SRAM_SIZE <= 48) || \ + (!SRAM_DEPRECATED_KCONFIG_SET && $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K) <= 48) + default 5000 if (SRAM_DEPRECATED_KCONFIG_SET && SRAM_SIZE <= 64) || \ + (!SRAM_DEPRECATED_KCONFIG_SET && $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K) <= 64) + default 7000 if (SRAM_DEPRECATED_KCONFIG_SET && SRAM_SIZE <= 96) || \ + (!SRAM_DEPRECATED_KCONFIG_SET && $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K) <= 96) default 10000 config TIMER_TEST_PERIOD diff --git a/tests/lib/heap/src/main.c b/tests/lib/heap/src/main.c index 8804fb13cea0..87b4e53d69b4 100644 --- a/tests/lib/heap/src/main.c +++ b/tests/lib/heap/src/main.c @@ -21,7 +21,7 @@ */ # define MEMSZ (192 * 1024) #elif defined(CONFIG_ARCH_POSIX) -/* POSIX arch based targets don't support CONFIG_SRAM_SIZE at all (because +/* POSIX arch based targets don't support DT_CHOSEN_SRAM_SIZE at all (because * they can link anything big enough to fit on the host), so just use a * reasonable value. */ @@ -33,9 +33,7 @@ */ # define MEMSZ (16 * 1024) #else -/* Otherwise just trust CONFIG_SRAM_SIZE - */ -# define MEMSZ (1024 * (size_t) CONFIG_SRAM_SIZE) +# define MEMSZ DT_CHOSEN_SRAM_SIZE #endif #define BIG_HEAP_SZ MIN(256 * 1024, MEMSZ / 3) From e96973335536bcdb3a77a45703aadc31740ec20a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:54:32 +0100 Subject: [PATCH 3307/3334] [nrf fromtree] samples: Add support for dts RAM configuration Allows using the chosen SRAM node for RAM configuration without using Kconfig values Signed-off-by: Jamie McCrae (cherry picked from commit b06f9b011e3ad4008789a068ef36ea15c5005230) --- samples/arch/mpu/mpu_test/src/main.c | 5 +++-- samples/drivers/i2s/echo/src/main.c | 4 +++- samples/kernel/bootargs/app_efi.overlay | 3 +++ samples/kernel/bootargs/prj_efi.conf | 2 +- samples/kernel/bootargs/sample.yaml | 2 +- samples/subsys/demand_paging/app.overlay | 3 +++ samples/subsys/demand_paging/prj.conf | 1 - 7 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 samples/kernel/bootargs/app_efi.overlay create mode 100644 samples/subsys/demand_paging/app.overlay diff --git a/samples/arch/mpu/mpu_test/src/main.c b/samples/arch/mpu/mpu_test/src/main.c index c850a9dd9029..e5cb626dbaee 100644 --- a/samples/arch/mpu/mpu_test/src/main.c +++ b/samples/arch/mpu/mpu_test/src/main.c @@ -18,9 +18,10 @@ shell_fprintf(sh, SHELL_ERROR, fmt, ##__VA_ARGS__) /* Assumption: our devices have less than 64MB of memory */ -#define RESERVED_MEM_MAP (CONFIG_SRAM_BASE_ADDRESS + 0x4000000) +#define RESERVED_MEM_MAP (DT_CHOSEN_SRAM_ADDR + 0x4000000) +#define RAM_MEM DT_CHOSEN_SRAM_ADDR + #define FLASH_MEM CONFIG_FLASH_BASE_ADDRESS -#define RAM_MEM CONFIG_SRAM_BASE_ADDRESS /* MPU test command help texts */ #define READ_CMD_HELP "Read from a reserved address in the memory map" diff --git a/samples/drivers/i2s/echo/src/main.c b/samples/drivers/i2s/echo/src/main.c index 31b8cf1e8619..031bbae3d73a 100644 --- a/samples/drivers/i2s/echo/src/main.c +++ b/samples/drivers/i2s/echo/src/main.c @@ -21,8 +21,10 @@ #define I2S_TX_NODE DT_NODELABEL(i2s_tx) #endif +#define RAM_SIZE (DT_CHOSEN_SRAM_ADDR / 1024) + /* Reduce echo delay when running on low ram devices */ -#if CONFIG_SRAM_SIZE <= 48 +#if SRAM_SIZE <= 48 #define ECHO_DELAY 30 #else #define ECHO_DELAY 10 diff --git a/samples/kernel/bootargs/app_efi.overlay b/samples/kernel/bootargs/app_efi.overlay new file mode 100644 index 000000000000..3867176dbcda --- /dev/null +++ b/samples/kernel/bootargs/app_efi.overlay @@ -0,0 +1,3 @@ +&dram0 { + reg = <0x0 0xc800000>; +}; diff --git a/samples/kernel/bootargs/prj_efi.conf b/samples/kernel/bootargs/prj_efi.conf index 75a723633012..8b3416d3a6db 100644 --- a/samples/kernel/bootargs/prj_efi.conf +++ b/samples/kernel/bootargs/prj_efi.conf @@ -1,4 +1,4 @@ +CONFIG_BOOTARGS=y CONFIG_DYNAMIC_BOOTARGS=y CONFIG_QEMU_UEFI_BOOT=y CONFIG_BUILD_OUTPUT_EFI=y -CONFIG_SRAM_SIZE=204800 diff --git a/samples/kernel/bootargs/sample.yaml b/samples/kernel/bootargs/sample.yaml index 020f07188f68..8ff0d7cc2a44 100644 --- a/samples/kernel/bootargs/sample.yaml +++ b/samples/kernel/bootargs/sample.yaml @@ -12,7 +12,7 @@ tests: regex: - "argv\\[0\\] = .*/zephyr(-qemu-locore)?.elf" sample.kernel.bootargs.efi: - extra_args: EXTRA_CONF_FILE=prj_efi.conf + extra_args: FILE_SUFFIX=efi platform_allow: qemu_x86_64 harness: console harness_config: diff --git a/samples/subsys/demand_paging/app.overlay b/samples/subsys/demand_paging/app.overlay new file mode 100644 index 000000000000..9035cfd48e20 --- /dev/null +++ b/samples/subsys/demand_paging/app.overlay @@ -0,0 +1,3 @@ +&sram0 { + reg = <0x0 0x40000000 0x0 0x40000>; +}; diff --git a/samples/subsys/demand_paging/prj.conf b/samples/subsys/demand_paging/prj.conf index c1111f3b8348..f03ea52ffc4d 100644 --- a/samples/subsys/demand_paging/prj.conf +++ b/samples/subsys/demand_paging/prj.conf @@ -1,4 +1,3 @@ -CONFIG_SRAM_SIZE=256 CONFIG_DEMAND_PAGING=y CONFIG_DEMAND_PAGING_ALLOW_IRQ=y CONFIG_DEMAND_PAGING_STATS=y From 4a3c13aa8ea37488bc8fd8a106d1c547d119bd7c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 28 Apr 2026 08:09:07 +0100 Subject: [PATCH 3308/3334] [nrf fromtree] scripts: west_commands: runners: core: Add dts SRAM support Adds support for using the chosen SRAM node for getting the RAM start address instead of having to rely on Kconfigs Signed-off-by: Jamie McCrae (cherry picked from commit aada3b2f734123623978d1f179c894fd317bb269) --- scripts/west_commands/runners/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/west_commands/runners/core.py b/scripts/west_commands/runners/core.py index ef90eee4b3f9..f5389661563a 100644 --- a/scripts/west_commands/runners/core.py +++ b/scripts/west_commands/runners/core.py @@ -781,9 +781,13 @@ def flash_address_from_build_conf(build_conf: BuildConfiguration): @staticmethod def sram_address_from_build_conf(build_conf: BuildConfiguration): - '''return CONFIG_SRAM_BASE_ADDRESS. + '''return SRAM address. ''' - return build_conf['CONFIG_SRAM_BASE_ADDRESS'] + if build_conf.getboolean('CONFIG_SRAM_DEPRECATED_KCONFIG_SET'): + return build_conf['CONFIG_SRAM_BASE_ADDRESS'] + else: + sram_node = build_conf.edt.chosen_node('zephyr,sram') + return sram_node.regs[0].addr def run(self, command: str, **kwargs): '''Runs command ('flash', 'debug', 'debugserver', 'attach'). From 184d9a2d87cda09ec1f2e0cfcd3238dabb9182db Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 8 May 2026 13:17:11 +0100 Subject: [PATCH 3309/3334] [nrf fromtree] doc: Update Kconfig -> dts for RAM configuration Updates old Kconfig usage with C macros (which come from dts) Signed-off-by: Jamie McCrae (cherry picked from commit 02cfde161534e5cdcd2ccd1f553a578918d21128) --- boards/udoo/udoo_neo_full/doc/index.rst | 4 +--- doc/hardware/arch/x86.rst | 10 +++++----- doc/kernel/memory_management/virtual_memory.rst | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/boards/udoo/udoo_neo_full/doc/index.rst b/boards/udoo/udoo_neo_full/doc/index.rst index 020d43e33ac9..d3c75d84e4c5 100644 --- a/boards/udoo/udoo_neo_full/doc/index.rst +++ b/boards/udoo/udoo_neo_full/doc/index.rst @@ -179,9 +179,7 @@ DT_FLASH_SIZE macro to determine the region size and DT_FLASH_ADDR to determine the address where the region begins. If you want to have the data placed in the subregion of a memory, which will -likely be the case when using DDR, select "zephyr,sram = &sram", which sets the -CONFIG_SRAM_SIZE macro to determine the region size and -CONFIG_SRAM_BASE_ADDRESS to determine the address where the region begins. +likely be the case when using DDR, select "zephyr,sram = &sram". Otherwise set "zephyr,flash" and/or "zephyr,sram" to one of the predefined regions: diff --git a/doc/hardware/arch/x86.rst b/doc/hardware/arch/x86.rst index 1587efa38c34..668aee24c80a 100644 --- a/doc/hardware/arch/x86.rst +++ b/doc/hardware/arch/x86.rst @@ -16,8 +16,8 @@ During very early boot, page tables are loaded so technically the kernel is executing in virtual address space. By default, physical and virtual memory are identity mapped and thus giving the appearance of execution taking place in physical address space. The physical address space is -marked by kconfig :kconfig:option:`CONFIG_SRAM_BASE_ADDRESS` and -:kconfig:option:`CONFIG_SRAM_SIZE` while the virtual address space is marked by +marked by dts :c:macro:`DT_CHOSEN_SRAM_ADDR` and +:c:macro:`DT_CHOSEN_SRAM_SIZE` while the virtual address space is marked by :kconfig:option:`CONFIG_KERNEL_VM_BASE` and :kconfig:option:`CONFIG_KERNEL_VM_SIZE`. Note that :kconfig:option:`CONFIG_SRAM_OFFSET` controls where the Zephyr kernel is being placed in the memory, and its counterpart @@ -60,17 +60,17 @@ There are restrictions on where virtual address space can be: - Assuming ``CONFIG_SRAM_OFFSET`` and ``CONFIG_KERNEL_VM_OFFSET`` are both ``0x0``. - - ``CONFIG_SRAM_BASE_ADDRESS == 0x00000000`` and + - ``DT_CHOSEN_SRAM_ADDR == 0x00000000`` and ``CONFIG_KERNEL_VM_BASE = 0x40000000`` is valid, while - - ``CONFIG_SRAM_BASE_ADDRESS == 0x00000000`` and + - ``DT_CHOSEN_SRAM_ADDR == 0x00000000`` and ``CONFIG_KERNEL_VM_BASE = 0x20000000`` is not. - If :kconfig:option:`CONFIG_X86_PAE` is disabled (``=n``), each address space must reside in their own 4MB region, due to each entry of PD (Page Directory) covers 4MB of memory. - - Both ``CONFIG_SRAM_BASE_ADDRESS`` and ``CONFIG_KERNEL_VM_BASE`` + - Both ``DT_CHOSEN_SRAM_ADDR`` and ``CONFIG_KERNEL_VM_BASE`` must also align with the starting addresses of targeted regions. Specifying Additional Memory Mappings at Build Time diff --git a/doc/kernel/memory_management/virtual_memory.rst b/doc/kernel/memory_management/virtual_memory.rst index 4e2f11e90c7b..e566166d2e97 100644 --- a/doc/kernel/memory_management/virtual_memory.rst +++ b/doc/kernel/memory_management/virtual_memory.rst @@ -121,7 +121,7 @@ below. * If it is enabled, which means all physical memory are mapped in virtual memory address space, and it is the same as - (:kconfig:option:`CONFIG_SRAM_BASE_ADDRESS` + :kconfig:option:`CONFIG_SRAM_SIZE`). + (:c:macro:`DT_CHOSEN_SRAM_ADDR` + :c:macro:`DT_CHOSEN_SRAM_SIZE`). * If it is disabled, ``K_MEM_VM_FREE_START`` is the same ``K_MEM_KERNEL_VIRT_END`` which is the end of the kernel image. From eeab4d22e00b8be71bd0207f3d9497f43eda01d4 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 30 Apr 2026 12:58:14 +0100 Subject: [PATCH 3310/3334] [nrf fromtree] arch: kconfig: Deprecatee SRAM_SIZE and SRAM_BASE_ADDRESS Deprecates these Kconfigs and emits a deprecated warning when either of them are changed from their defaults (on a different symbol, due to Kconfig limitations) Signed-off-by: Jamie McCrae (cherry picked from commit 4476a811e87b8af65fff252240391c63b0a9a3e9) --- arch/Kconfig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index a4bcc2c5e85e..b4b668489a4d 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -225,6 +225,10 @@ config 64BIT config SRAM_DEPRECATED_KCONFIG_SET bool + default y if SRAM_SIZE != $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K) + default y if SRAM_BASE_ADDRESS != $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM)) + default n + select DEPRECATED help Indicates that either `CONFIG_SRAM_SIZE` or `CONFIG_SRAM_BASE_ADDRESS` have been manually set, these Kconfigs are now deprecated and should be replaced by referencing @@ -234,7 +238,7 @@ config SRAM_DEPRECATED_KCONFIG_SET DT_CHOSEN_Z_SRAM := zephyr,sram config SRAM_SIZE - int "SRAM Size in kB" + int "SRAM Size in kB [DEPRECATED]" default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K) help The SRAM size in kB. The default value comes from /chosen/zephyr,sram in @@ -243,7 +247,7 @@ config SRAM_SIZE the devicetree `zephyr,sram` chosen node instead. config SRAM_BASE_ADDRESS - hex "SRAM Base Address" + hex "SRAM Base Address [DEPRECATED]" default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM)) help The SRAM base address. The default value comes from From 972dfc3e97a87e5efe895392186ae137f411b54f Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 29 Apr 2026 10:11:50 +0100 Subject: [PATCH 3311/3334] [nrf fromtree] doc: release: migration_guide: 4.5: Add note on SRAM Kconfig change Adds details about this switching to Kconfig Signed-off-by: Jamie McCrae (cherry picked from commit e4af38d73e8b7f84804a31b19df45992f6735c3b) --- doc/releases/migration-guide-4.5.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/releases/migration-guide-4.5.rst b/doc/releases/migration-guide-4.5.rst index e928cb873858..a21a720ba5d1 100644 --- a/doc/releases/migration-guide-4.5.rst +++ b/doc/releases/migration-guide-4.5.rst @@ -32,6 +32,12 @@ Kernel Boards ****** +* The Kconfig options :kconfig:option:`CONFIG_SRAM_SIZE` and + :kconfig:option:`CONFIG_SRAM_BASE_ADDRESS` have been deprecated, boards should instead use the + devicetree ``zephyr.sram`` chosen node to specify the RAM node which will be used (whose values + populated the Kconfig values). If either option is manually adjusted, it will cause + :kconfig:option:`CONFIG_SRAM_DEPRECATED_KCONFIG_SET` to be set which indicates this deprecation. + Device Drivers and Devicetree ***************************** From d68ef956fec3f49db5c06f1ae750c14979f6699f Mon Sep 17 00:00:00 2001 From: Sigvart Hovland Date: Fri, 3 May 2019 14:21:52 +0200 Subject: [PATCH 3312/3334] [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition Manager (PM) is a component of the nRF Connect SDK (NCS) which uses yaml files to resolve flash partition placement with a holistic view of the entire device, including each firmware image present on the flash device, and various subsystems, such as settings and NFFS. When this NCS extension is used, various source files which would use partition information from devicetree in "vanilla" zephyr instead use defines generated by PM instead. This commit removes support for HEX_FILES_TO_MERGE, as it conflicts with PM. The settings subsystem pm.yml defines a partition 'settings_storage'. The nffs subsystem pm.yml defines 'nffs_storage'. Leverage label translation to avoid patching partition names. Refer to the NCS documentation page for this feature for more details. This is a long-running out of tree patch which has been worked on by several people. The following sign-offs are in alphabetical order by first name. Signed-off-by: Andrzej Głąbek Signed-off-by: Andrzej Puzdrowski Signed-off-by: Håkon Øye Amundsen Signed-off-by: Ioannis Glaropoulos Signed-off-by: Joakim Andersson Signed-off-by: Johann Fischer Signed-off-by: Martí Bolívar Signed-off-by: Ole Sæther Signed-off-by: Robert Lubos Signed-off-by: Sebastian Bøe Signed-off-by: Sigvart Hovland Signed-off-by: Thomas Stenersen Signed-off-by: Torsten Rasmussen Signed-off-by: Øyvind Rønningstad Signed-off-by: Trond Einar Snekvik Signed-off-by: Gerard Marull-Paretas Signed-off-by: Tomasz Moń Signed-off-by: Dominik Ermel Signed-off-by: Jamie McCrae (cherry picked from commit a8cb6e26828c238cb4f46f81c1f45215f6a83deb) --- arch/arm/core/mpu/arm_mpu_regions.c | 13 +++++ cmake/linker/ld/target.cmake | 1 + cmake/linker/lld/target.cmake | 1 + cmake/modules/kernel.cmake | 4 ++ drivers/flash/soc_flash_nrf.c | 11 ++++ drivers/flash/soc_flash_nrf_rram.c | 11 ++++ .../arch/arm/cortex_m/scripts/linker.ld | 50 +++++++++++++++++++ include/zephyr/storage/flash_map.h | 6 +++ lib/heap/Kconfig | 2 +- lib/libc/common/source/stdlib/malloc.c | 14 +++++- subsys/dfu/boot/mcuboot_shell.c | 40 +++++++++++++++ subsys/fs/littlefs_fs.c | 7 ++- subsys/ipc/rpmsg_service/rpmsg_backend.h | 27 ++++++++++ 13 files changed, 183 insertions(+), 4 deletions(-) diff --git a/arch/arm/core/mpu/arm_mpu_regions.c b/arch/arm/core/mpu/arm_mpu_regions.c index 9a0970353277..113b47ebcde9 100644 --- a/arch/arm/core/mpu/arm_mpu_regions.c +++ b/arch/arm/core/mpu/arm_mpu_regions.c @@ -8,6 +8,9 @@ #include #include +#if USE_PARTITION_MANAGER +#include +#endif #ifdef CONFIG_ARM_MPU_SRAM_WRITE_THROUGH #define ARM_MPU_SRAM_REGION_ATTR REGION_RAM_WT_ATTR @@ -30,6 +33,14 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 1 */ MPU_REGION_ENTRY("SRAM_0", +#if USE_PARTITION_MANAGER + PM_SRAM_ADDRESS, +#if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) + REGION_RAM_ATTR(PM_SRAM_ADDRESS, PM_SRAM_SIZE)), +#else + REGION_RAM_ATTR(REGION_SRAM_SIZE)), +#endif +#else DT_CHOSEN_SRAM_ADDR, #if defined(CONFIG_ARMV8_M_BASELINE) || defined(CONFIG_ARMV8_M_MAINLINE) ARM_MPU_SRAM_REGION_ATTR(DT_CHOSEN_SRAM_ADDR, @@ -37,6 +48,8 @@ static const struct arm_mpu_region mpu_regions[] = { #else ARM_MPU_SRAM_REGION_ATTR(REGION_SRAM_SIZE)), #endif + +#endif /* USE_PARTITION_MANAGER */ }; const struct arm_mpu_config mpu_config = { diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index 592596576d11..ccf6a1903162 100644 --- a/cmake/linker/ld/target.cmake +++ b/cmake/linker/ld/target.cmake @@ -80,6 +80,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) ${current_includes} ${soc_linker_script_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/linker/lld/target.cmake b/cmake/linker/lld/target.cmake index 96df1c123796..fe8aad62c73d 100644 --- a/cmake/linker/lld/target.cmake +++ b/cmake/linker/lld/target.cmake @@ -52,6 +52,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define) -imacros ${AUTOCONF_H} ${current_includes} ${template_script_defines} + -DUSE_PARTITION_MANAGER=$ -E ${LINKER_SCRIPT} -P # Prevent generation of debug `#line' directives. -o ${linker_script_gen} diff --git a/cmake/modules/kernel.cmake b/cmake/modules/kernel.cmake index 310a836eebcf..53aa705fdc9b 100644 --- a/cmake/modules/kernel.cmake +++ b/cmake/modules/kernel.cmake @@ -257,3 +257,7 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4") include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake) eclipse_cdt4_generator_amendment(1) endif() + +if(ZEPHYR_NRF_MODULE_DIR) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake) +endif() diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index f6b8a6f5eef3..27fda598be20 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -36,6 +36,11 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 #if defined(CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE) @@ -165,6 +170,12 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + nrf_nvmc_buffer_read(data, (uint32_t)addr, len); return 0; diff --git a/drivers/flash/soc_flash_nrf_rram.c b/drivers/flash/soc_flash_nrf_rram.c index 1f7f89b5509f..cd217a5f2c2d 100644 --- a/drivers/flash/soc_flash_nrf_rram.c +++ b/drivers/flash/soc_flash_nrf_rram.c @@ -54,6 +54,11 @@ LOG_MODULE_REGISTER(flash_nrf_rram, CONFIG_FLASH_LOG_LEVEL); #define WRITE_BLOCK_SIZE_FROM_DT DT_PROP(RRAM, write_block_size) #define ERASE_VALUE 0xFF +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#include +#include +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ + #ifdef CONFIG_MULTITHREADING static struct k_sem sem_lock; #define SYNC_INIT() k_sem_init(&sem_lock, 1, 1) @@ -292,6 +297,12 @@ static int nrf_rram_read(const struct device *dev, off_t addr, void *data, size_ } addr += RRAM_START; +#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS + if (addr < PM_APP_ADDRESS) { + return soc_secure_mem_read(data, (void *)addr, len); + } +#endif + memcpy(data, (void *)addr, len); return 0; diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index 3f8bfe9d5900..c05e6f4b5c80 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -34,6 +34,39 @@ #define ROMSTART_REGION ROMABLE_REGION #endif +#if USE_PARTITION_MANAGER + +#include + +#if CONFIG_NCS_IS_VARIANT_IMAGE && defined(PM_S0_ID) +/* We are linking against S1, create symbol containing the flash ID of S0. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S0_ID; + +#else /* ! CONFIG_NCS_IS_VARIANT_IMAGE */ + +#ifdef PM_S1_ID +/* We are linking against S0, create symbol containing the flash ID of S1. + * This is used when writing code operating on the "other" slot. + */ +_image_1_primary_slot_id = PM_S1_ID; +#endif /* PM_S1_ID */ + +#endif /* CONFIG_NCS_IS_VARIANT_IMAGE */ + +#define ROM_ADDR PM_ADDRESS +#define ROM_SIZE PM_SIZE + +#if defined(CONFIG_PM_USE_CONFIG_SRAM_SIZE) +#define RAM_SIZE CONFIG_PM_SRAM_SIZE +#else +#define RAM_SIZE PM_SRAM_SIZE +#endif +#define RAM_ADDR PM_SRAM_ADDRESS + +#else /* ! USE_PARTITION_MANAGER */ + #if defined(CONFIG_ROM_END_OFFSET) #define ROM_END_OFFSET CONFIG_ROM_END_OFFSET #else @@ -60,6 +93,23 @@ #define RAM_ADDR DT_CHOSEN_SRAM_ADDR #define RAM_SIZE DT_CHOSEN_SRAM_SIZE +#endif /* USE_PARTITION_MANAGER */ + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay) +#define CCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ccm)) +#define CCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) +#define ITCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) +#define ITCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) +#endif + +#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) +#define DTCM_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) +#define DTCM_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) +#endif + #if defined(CONFIG_CUSTOM_SECTION_ALIGN) _region_min_align = CONFIG_CUSTOM_SECTION_MIN_ALIGN_SIZE; #else diff --git a/include/zephyr/storage/flash_map.h b/include/zephyr/storage/flash_map.h index 13f381e135fd..819f94182474 100644 --- a/include/zephyr/storage/flash_map.h +++ b/include/zephyr/storage/flash_map.h @@ -351,6 +351,10 @@ const char *flash_area_label(const struct flash_area *fa); */ uint8_t flash_area_erased_val(const struct flash_area *fa); +#if USE_PARTITION_MANAGER +#include +#else + /** * Returns non-0 value if partition of given DTS node label exists. * @@ -620,6 +624,8 @@ DT_FOREACH_STATUS_OKAY(fixed_subpartitions, FOR_EACH_SUBPARTITION_TABLE) #undef FOR_EACH_SUBPARTITION_TABLE /** @endcond */ +#endif /* USE_PARTITION_MANAGER */ + #ifdef __cplusplus } #endif diff --git a/lib/heap/Kconfig b/lib/heap/Kconfig index 18976e4ffec7..b50427aeaa73 100644 --- a/lib/heap/Kconfig +++ b/lib/heap/Kconfig @@ -164,7 +164,7 @@ choice prompt "Supported heap sizes" depends on !64BIT default SYS_HEAP_SMALL_ONLY if ((SRAM_DEPRECATED_KCONFIG_SET && SRAM_SIZE <= 256) || \ - (!SRAM_DEPRECATED_KCONFIG_SET && $(DT_SRAM_SIZE) <= 256)) + (!SRAM_DEPRECATED_KCONFIG_SET && $(DT_SRAM_SIZE) <= 256)) && !PARTITION_MANAGER_ENABLED default SYS_HEAP_AUTO help Heaps using reduced-size chunk headers can accommodate so called diff --git a/lib/libc/common/source/stdlib/malloc.c b/lib/libc/common/source/stdlib/malloc.c index 7cfeadd00b71..f4d8be2671d9 100644 --- a/lib/libc/common/source/stdlib/malloc.c +++ b/lib/libc/common/source/stdlib/malloc.c @@ -25,6 +25,16 @@ #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); +#if USE_PARTITION_MANAGER +#include + +#define RAM_SIZE PM_SRAM_SIZE +#define RAM_ADDR PM_SRAM_ADDRESS +#else /* ! USE_PARTITION_MANAGER */ +#define RAM_ADDR DT_CHOSEN_SRAM_ADDR +#define RAM_SIZE DT_CHOSEN_SRAM_SIZE +#endif /* USE_PARTITION_MANAGER */ + #ifdef CONFIG_COMMON_LIBC_MALLOC #if (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE != 0) @@ -106,8 +116,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE]; extern char _heap_sentry[]; # define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN) # else -# define HEAP_SIZE ROUND_DOWN((size_t) DT_CHOSEN_SRAM_SIZE - \ - ((size_t) HEAP_BASE - (size_t) DT_CHOSEN_SRAM_ADDR), HEAP_ALIGN) +# define HEAP_SIZE ROUND_DOWN((size_t) RAM_SIZE - \ + ((size_t) HEAP_BASE - (size_t) RAM_ADDR), HEAP_ALIGN) # endif /* else CONFIG_XTENSA */ # endif /* else CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE > 0 */ diff --git a/subsys/dfu/boot/mcuboot_shell.c b/subsys/dfu/boot/mcuboot_shell.c index 583bc4778362..06eb79baa92b 100644 --- a/subsys/dfu/boot/mcuboot_shell.c +++ b/subsys/dfu/boot/mcuboot_shell.c @@ -20,6 +20,16 @@ #endif #endif +#if USE_PARTITION_MANAGER +#include + +#ifdef CONFIG_NCS_IS_VARIANT_IMAGE +#define ACTIVE_IMAGE_ID PM_MCUBOOT_SECONDARY_ID +#else +#define ACTIVE_IMAGE_ID PM_MCUBOOT_PRIMARY_ID +#endif +#endif + struct area_desc { const char *name; unsigned int id; @@ -93,6 +103,35 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, id = strtoul(argv[1], NULL, 0); /* Check if this is the parent (MCUboot) or own slot and if so, deny the request */ +#if USE_PARTITION_MANAGER +#ifdef PM_MCUBOOT_ID + if (id == PM_MCUBOOT_ID || id == PM_MCUBOOT_PAD_ID) { + shell_error(sh, "Cannot erase boot partition"); + return -EACCES; + } +#endif + +#ifdef PM_APP_ID + if (id == PM_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef PM_MCUBOOT_PRIMARY_APP_ID + if (id == PM_MCUBOOT_PRIMARY_APP_ID) { + shell_error(sh, "Cannot erase this area"); + return -EACCES; + } +#endif + +#ifdef ACTIVE_IMAGE_ID + if (id == ACTIVE_IMAGE_ID) { + shell_error(sh, "Cannot erase active partitions"); + return -EACCES; + } +#endif +#else #if PARTITION_EXISTS(boot_partition) if (id == PARTITION_ID(boot_partition)) { shell_error(sh, "Cannot erase boot partition"); @@ -105,6 +144,7 @@ static int cmd_mcuboot_erase(const struct shell *sh, size_t argc, shell_error(sh, "Cannot erase active partitions"); return -EACCES; } +#endif #endif err = boot_erase_img_bank(id); diff --git a/subsys/fs/littlefs_fs.c b/subsys/fs/littlefs_fs.c index e41287edf2f6..094cb761756b 100644 --- a/subsys/fs/littlefs_fs.c +++ b/subsys/fs/littlefs_fs.c @@ -1133,7 +1133,12 @@ struct fs_mount_t FS_FSTAB_ENTRY(DT_DRV_INST(inst)) = { \ .type = FS_LITTLEFS, \ .mnt_point = FSTAB_ENTRY_DT_INST_MOUNT_POINT(inst), \ .fs_data = &fs_data_##inst, \ - .storage_dev = (void *)DT_PARTITION_ID(FS_PARTITION(inst)), \ + .storage_dev = (void *) \ + COND_CODE_1(USE_PARTITION_MANAGER, \ + (COND_CODE_1(FIXED_PARTITION_EXISTS(littlefs_storage), \ + (FIXED_PARTITION_ID(littlefs_storage)), \ + (FIXED_PARTITION_ID(storage)))), \ + (DT_PARTITION_ID(FS_PARTITION(inst)))), \ .flags = FSTAB_ENTRY_DT_MOUNT_FLAGS(DT_DRV_INST(inst)), \ }; diff --git a/subsys/ipc/rpmsg_service/rpmsg_backend.h b/subsys/ipc/rpmsg_service/rpmsg_backend.h index 349eee664810..e7015d512d36 100644 --- a/subsys/ipc/rpmsg_service/rpmsg_backend.h +++ b/subsys/ipc/rpmsg_service/rpmsg_backend.h @@ -13,8 +13,35 @@ extern "C" { #endif +#if CONFIG_PARTITION_MANAGER_ENABLED + +#include "pm_config.h" + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) + +#if defined(PM_RPMSG_NRF53_SRAM_ADDRESS) +#define VDEV_START_ADDR PM_RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM_RPMSG_NRF53_SRAM_SIZE +#else +/* The current image is a child image in a different domain than the image + * which defined the required values. To reach the values of the parent domain + * we use the 'PM__' variant of the define. + */ +#define VDEV_START_ADDR PM__RPMSG_NRF53_SRAM_ADDRESS +#define VDEV_SIZE PM__RPMSG_NRF53_SRAM_SIZE +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) */ + +#else #define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) #define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) +#endif /* defined(PM_RPMSG_NRF53_SRAM_ADDRESS) || defined(PM__RPMSG_NRF53_SRAM_ADDRESS) */ + +#else + +#define VDEV_START_ADDR DT_REG_ADDR(DT_CHOSEN(zephyr_ipc_shm)) +#define VDEV_SIZE DT_REG_SIZE(DT_CHOSEN(zephyr_ipc_shm)) + +#endif /* CONFIG_PARTITION_MANAGER_ENABLED */ #ifdef CONFIG_OPENAMP_RSC_TABLE #define SHM_START_ADDR (VDEV_START_ADDR) From 9ed3b94cbdef3f694b68f116188feeb4100bb83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Wed, 8 Apr 2026 10:01:31 +0200 Subject: [PATCH 3313/3334] [nrf noup] drivers: flash: Update to support PM removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update conditions for soc_secure_mem_read to support Non-Secure builds without Partition Manager. noup as Partition Manager is a NCS construct. Signed-off-by: Dag Erik Gjørvad (cherry picked from commit b71134cf5d2186b50b78dcded1059f399591536c) --- drivers/flash/soc_flash_nrf.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 27fda598be20..3e735a7edf78 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -36,10 +36,12 @@ LOG_MODULE_REGISTER(flash_nrf); #define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash) -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER +#if CONFIG_TRUSTED_EXECUTION_NONSECURE #include +#if USE_PARTITION_MANAGER #include -#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER */ +#endif /* USE_PARTITION_MANAGER */ +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ #ifndef CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE #define FLASH_SLOT_WRITE 7500 @@ -170,11 +172,17 @@ static int flash_nrf_read(const struct device *dev, off_t addr, } #endif -#if CONFIG_TRUSTED_EXECUTION_NONSECURE && USE_PARTITION_MANAGER && PM_APP_ADDRESS +#if CONFIG_TRUSTED_EXECUTION_NONSECURE +#if USE_PARTITION_MANAGER && PM_APP_ADDRESS if (addr < PM_APP_ADDRESS) { return soc_secure_mem_read(data, (void *)addr, len); } +#elif !USE_PARTITION_MANAGER && DT_NODE_EXISTS(DT_NODELABEL(slot0_ns_partition)) + if ((uintptr_t)addr < DT_REG_ADDR(DT_NODELABEL(slot0_ns_partition))) { + return soc_secure_mem_read(data, (void *)addr, len); + } #endif +#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */ nrf_nvmc_buffer_read(data, (uint32_t)addr, len); From 13f918c835895850814855496ab9fcb5b06133cb Mon Sep 17 00:00:00 2001 From: Dhanoo Surasarang Date: Mon, 23 Mar 2026 18:41:37 +0000 Subject: [PATCH 3314/3334] [nrf fromtree] dts: bindings: arm: nordic: Add nRF71 series UICR binding Add UICR binding for nRF71 series to allow 1.8v supply to be configured from devicetree. Signed-off-by: Dhanoo Surasarang (cherry picked from commit fe44c5a5c3f9931712f55ee0144535cb60049c0c) --- dts/bindings/arm/nordic,nrf71-uicr.yaml | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 dts/bindings/arm/nordic,nrf71-uicr.yaml diff --git a/dts/bindings/arm/nordic,nrf71-uicr.yaml b/dts/bindings/arm/nordic,nrf71-uicr.yaml new file mode 100644 index 000000000000..d5597beba97f --- /dev/null +++ b/dts/bindings/arm/nordic,nrf71-uicr.yaml @@ -0,0 +1,33 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: Nordic nRF71 UICR (User Information Configuration Registers) + +compatible: "nordic,nrf71-uicr" + +include: base.yaml + +properties: + reg: + required: true + + supply-config1v8: + type: string + enum: + - "normal" + - "external" + - "high-load" + description: | + Configuration of the VDD_AO_1V8 supply rail. + + normal - Autonomous control by the internal power management block. + The LDO_VBAT_1V8 regulator operates in its default mode. + external - 1.8 V supplied externally on VDD_AO_1V8 pin. + Internal LDO_VBAT_1V8 regulator disabled to prevent + conflict with external supply. + high-load - Up to 10mA can be consumed from 1V8 supply for other + devices/IO. Keep LDO_VBAT_1V8 in high power mode at + all times (including system OFF). + + This setting, once applied, can only be unset by erasing the UICR + registers. Refer to the nRF7120 Product Specification for details. From 3c7e3692666faabdcb14e61882b734ab4efc594c Mon Sep 17 00:00:00 2001 From: Dhanoo Surasarang Date: Mon, 23 Mar 2026 18:52:12 +0000 Subject: [PATCH 3315/3334] [nrf fromtree] dts: vendor: nordic: Update nRF7120 to use specific UICR binding Use nordic,nrf71-uicr binding. Signed-off-by: Dhanoo Surasarang (cherry picked from commit 0d8c4b3cc21b79abe3bb0e7bb63e0c97afbdc317) --- dts/vendor/nordic/nrf7120_enga.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/vendor/nordic/nrf7120_enga.dtsi b/dts/vendor/nordic/nrf7120_enga.dtsi index 7468ff052be2..0ccd3fa62749 100644 --- a/dts/vendor/nordic/nrf7120_enga.dtsi +++ b/dts/vendor/nordic/nrf7120_enga.dtsi @@ -135,7 +135,7 @@ /* Intentionally empty because uicr is hardware fixed to Secure */ #else uicr: uicr@ffd000 { - compatible = "nordic,nrf-uicr"; + compatible = "nordic,nrf71-uicr"; reg = <0xffd000 0x1000>; ranges = <0x0 0xffd000 0x1000>; #address-cells = <1>; From ddcf8fdc67cb47b822ec6a932b8ac2d78d49df37 Mon Sep 17 00:00:00 2001 From: Dhanoo Surasarang Date: Mon, 23 Mar 2026 19:02:30 +0000 Subject: [PATCH 3316/3334] [nrf fromtree] soc: nordic: Add UICR generation tooling for nRF71 Add supporting scripts and build-system integration for UICR generation. Signed-off-by: Dhanoo Surasarang (cherry picked from commit 9d68b8a8aec888b0532287af612a143041ee24b0) --- soc/nordic/nrf71/Kconfig.sysbuild | 11 ++ soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt | 68 +++++++++++ soc/nordic/nrf71/uicr/gen_uicr/gen_uicr.py | 112 ++++++++++++++++++ soc/nordic/nrf71/uicr/sysbuild.cmake | 15 +++ soc/nordic/sysbuild.cmake | 4 + 5 files changed, 210 insertions(+) create mode 100644 soc/nordic/nrf71/Kconfig.sysbuild create mode 100644 soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt create mode 100644 soc/nordic/nrf71/uicr/gen_uicr/gen_uicr.py create mode 100644 soc/nordic/nrf71/uicr/sysbuild.cmake diff --git a/soc/nordic/nrf71/Kconfig.sysbuild b/soc/nordic/nrf71/Kconfig.sysbuild new file mode 100644 index 000000000000..3129615cd647 --- /dev/null +++ b/soc/nordic/nrf71/Kconfig.sysbuild @@ -0,0 +1,11 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config SOC_NRF71_GENERATE_UICR + bool "Generate nRF71 UICR hex" + depends on SOC_SERIES_NRF71 + default y + help + When enabled, a UICR generator image is included in the build. + This generates a standalone hex containing UICR values derived from + the devicetree (nordic,nrf71-uicr binding). diff --git a/soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt new file mode 100644 index 000000000000..262367ffbc05 --- /dev/null +++ b/soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt @@ -0,0 +1,68 @@ +# Copyright (c) 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr + COMPONENTS zephyr_default:boards + REQUIRED HINTS $ENV{ZEPHYR_BASE} +) + +project(uicr LANGUAGES NONE) + +# Override the runners.yaml path to use CMAKE_CURRENT_BINARY_DIR/zephyr +# instead of PROJECT_BINARY_DIR, this ensures runners.yaml is generated +# at /uicr/zephyr where west expects it +set(PROJECT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/zephyr) + +set(gen_script ${CMAKE_CURRENT_LIST_DIR}/gen_uicr.py) +set(uicr_hex ${PROJECT_BINARY_DIR}/zephyr.hex) + +zephyr_get(DEFAULT_IMAGE_EDT_PICKLE SYSBUILD GLOBAL) + +if(NOT DEFAULT_IMAGE_EDT_PICKLE) + message(FATAL_ERROR + "DEFAULT_IMAGE_EDT_PICKLE not found. " + "The UICR generator must be built via sysbuild." + ) +endif() + +add_custom_command( + OUTPUT ${uicr_hex} + COMMAND ${PYTHON_EXECUTABLE} ${gen_script} + --zephyr-base ${ZEPHYR_BASE} + --edt-pickle ${DEFAULT_IMAGE_EDT_PICKLE} + --output ${uicr_hex} + DEPENDS ${DEFAULT_IMAGE_EDT_PICKLE} ${gen_script} + COMMENT "Generating UICR hex: ${uicr_hex}" +) + +add_custom_target(gen_uicr ALL DEPENDS ${uicr_hex}) + +# Create the runners_yaml_props_target that flash system expects +add_custom_target(runners_yaml_props_target) +set_target_properties(runners_yaml_props_target PROPERTIES + hex_file "zephyr.hex" +) + +# Copy over Kconfig and dts files from the main image +get_filename_component(default_image_binary_dir ${DEFAULT_IMAGE_EDT_PICKLE} DIRECTORY) +zephyr_file_copy(${default_image_binary_dir}/.config ${PROJECT_BINARY_DIR}/.config + ONLY_IF_DIFFERENT +) +zephyr_file_copy(${default_image_binary_dir}/edt.pickle ${PROJECT_BINARY_DIR}/edt.pickle + ONLY_IF_DIFFERENT +) +import_kconfig(CONFIG_ ${default_image_binary_dir}/.config) + +# Manually include board configuration to enable automatic runners.yaml generation +foreach(dir ${BOARD_DIRECTORIES}) + include(${dir}/board.cmake OPTIONAL) +endforeach() + +# Include flash support to automatically generate runners.yaml +include(${ZEPHYR_BASE}/cmake/flash/CMakeLists.txt) + +# Silent unused variable warnings +set(EXTRA_KCONFIG_TARGETS) +set(FORCED_CONF_FILE) diff --git a/soc/nordic/nrf71/uicr/gen_uicr/gen_uicr.py b/soc/nordic/nrf71/uicr/gen_uicr/gen_uicr.py new file mode 100644 index 000000000000..c120f8fa91f2 --- /dev/null +++ b/soc/nordic/nrf71/uicr/gen_uicr/gen_uicr.py @@ -0,0 +1,112 @@ +# Copyright 2026 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +""" +Generate an Intel HEX file containing nRF71 UICR register values +read from a Zephyr edtlib.EDT pickle. +""" + +import argparse +import pickle +import struct +import sys +from pathlib import Path + +from intelhex import IntelHex + +UICR_COMPATIBLE = "nordic,nrf71-uicr" + +# ── Field table ────────────────────────────────────────────────────── +# +# Each entry describes one UICR register field configurable via DTS. +# +# property – DTS property name (must match the binding YAML) +# offset – byte offset from UICR base +# mask – bit mask of the field within the 32-bit register +# encoding – maps DTS string values to integer field values +# reset – 32-bit reset value +# +# The full register word is computed as: +# word = (reset & ~mask) | (encoding[value] & mask) +# + +UICR_FIELDS = [ + { + "property": "supply-config1v8", + "offset": 0x400, + "mask": 0x00000003, + "encoding": { + "normal": 0, + "external": 1, + "high-load": 2, + }, + "reset": 0xFFFFFFFF, + }, +] + + +def setup_devicetree_path(zephyr_base): + """Add the devicetree package to sys.path so EDT can be unpickled.""" + + devicetree_path = Path(zephyr_base) / "scripts/dts/python-devicetree/src" + if not devicetree_path.is_dir(): + sys.exit(f"Devicetree path does not exist: {devicetree_path}") + sys.path.insert(0, str(devicetree_path)) + + +def parse_uicr(args): + setup_devicetree_path(args.zephyr_base) + + with open(args.edt_pickle, "rb") as f: + edt = pickle.load(f) + + # Find the UICR node. + uicr_nodes = edt.compat2okay.get(UICR_COMPATIBLE, []) + if not uicr_nodes: + IntelHex().write_hex_file(args.output) + return + + uicr = uicr_nodes[0] + base = uicr.regs[0].addr + + ih = IntelHex() + + for field in UICR_FIELDS: + prop = uicr.props.get(field["property"]) + if prop is None: + continue + + val_str = prop.val + encoding = field["encoding"] + if val_str not in encoding: + valid = ", ".join(f'"{k}"' for k in encoding) + sys.exit(f"Unknown value '{val_str}' for '{field['property']}'. Expected: {valid}") + + mask = field["mask"] + word = (field["reset"] & ~mask) | (encoding[val_str] & mask) + addr = base + field["offset"] + ih.puts(addr, struct.pack(" Date: Mon, 20 Apr 2026 16:28:10 +0100 Subject: [PATCH 3317/3334] [nrf fromtree] soc: nordic: nrf71: uicr: Fix hex_file override from main image Move set_target_properties for runners_yaml_props_target below board.cmake include so that UICR image always flashes its own output regardless of the main image configuration. When the main image targets cpuapp/ns (TF-M), import_kconfig() pulls CONFIG_TFM_FLASH_MERGED_BINARY into the UICR image's CMake scope. This causes board.cmake to override hex_file with tfm_merged.hex, which does not exist in the UICR utility image, resulting in a flash failure. Signed-off-by: Dhanoo Surasarang (cherry picked from commit 16fe56ea59ac559ca8a24af94e5aaf04a712a0e3) --- soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt b/soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt index 262367ffbc05..8d1204b7059d 100644 --- a/soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt +++ b/soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt @@ -41,9 +41,6 @@ add_custom_target(gen_uicr ALL DEPENDS ${uicr_hex}) # Create the runners_yaml_props_target that flash system expects add_custom_target(runners_yaml_props_target) -set_target_properties(runners_yaml_props_target PROPERTIES - hex_file "zephyr.hex" -) # Copy over Kconfig and dts files from the main image get_filename_component(default_image_binary_dir ${DEFAULT_IMAGE_EDT_PICKLE} DIRECTORY) @@ -60,6 +57,11 @@ foreach(dir ${BOARD_DIRECTORIES}) include(${dir}/board.cmake OPTIONAL) endforeach() +# Override hex_file after board.cmake to ensure it always flash its own output +set_target_properties(runners_yaml_props_target PROPERTIES + hex_file "zephyr.hex" +) + # Include flash support to automatically generate runners.yaml include(${ZEPHYR_BASE}/cmake/flash/CMakeLists.txt) From b4fc04874589f1d7a5fd30aeb4bd6c6406901543 Mon Sep 17 00:00:00 2001 From: Dhanoo Surasarang Date: Thu, 16 Apr 2026 13:47:17 +0100 Subject: [PATCH 3318/3334] [nrf fromtree] soc: nordic: nrf71: Enable VPR launcher sysbuild Kconfig for cpuflpr Add missing Kconfig.sysbuild to enable VPR launcher image when building for the FLPR core. Signed-off-by: Dhanoo Surasarang (cherry picked from commit a03d8d09441960dc5157ab019de1b433059a2213) --- soc/nordic/nrf71/Kconfig.sysbuild | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/soc/nordic/nrf71/Kconfig.sysbuild b/soc/nordic/nrf71/Kconfig.sysbuild index 3129615cd647..f835ed6ab56c 100644 --- a/soc/nordic/nrf71/Kconfig.sysbuild +++ b/soc/nordic/nrf71/Kconfig.sysbuild @@ -1,6 +1,13 @@ # Copyright (c) 2026 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +if SOC_NRF7120_ENGA_CPUFLPR + +config HAS_NORDIC_VPR_LAUNCHER_IMAGE + default y + +endif + config SOC_NRF71_GENERATE_UICR bool "Generate nRF71 UICR hex" depends on SOC_SERIES_NRF71 From a0530834ef3ce1bac0eda1eee331d5a5c25ce4e4 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Thu, 7 May 2026 10:01:34 +0200 Subject: [PATCH 3319/3334] [nrf fromtree] bluetooth: mesh: fix BLOB IO flash write alignment for non-erase devices The wr_chunk function had a fast path for devices without explicit erase (e.g. nRF54L RRAM) that wrote chunk data directly without aligning the offset or size to the flash write block size. On RRAM with write-block-size=16, this caused -EINVAL from the flash driver for every chunk write since chunk_size (161) and most chunk offsets are not 16-byte aligned. The failed writes caused the BLOB server to never mark chunks as received, resulting in block_status_rsp always reporting all chunks missing. This led to infinite retransmission of block 0 and eventual DFU timeout. Fix by using a read-modify-write approach for non-erase devices: read existing data at the aligned boundaries, overlay the chunk data, and write back the full aligned buffer. This satisfies the driver's alignment requirements while preserving neighboring bytes. Signed-off-by: Aleksandr Khromykh (cherry picked from commit a9ad258c844928d59d48aeef94661a274357ced0) --- subsys/bluetooth/mesh/blob_io_flash.c | 38 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/subsys/bluetooth/mesh/blob_io_flash.c b/subsys/bluetooth/mesh/blob_io_flash.c index 792c53d4a0a6..58604d92f935 100644 --- a/subsys/bluetooth/mesh/blob_io_flash.c +++ b/subsys/bluetooth/mesh/blob_io_flash.c @@ -142,17 +142,6 @@ static int wr_chunk(const struct bt_mesh_blob_io *io, const struct flash_parameters *fparam = flash_get_parameters(fdev); - /* - * If device has no erase requirement then write directly. - * This is required since trick with padding using the erase value will - * not work in this case. - */ - if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { - return flash_area_write(flash->area, - flash->offset + block->offset + chunk->offset, - chunk->data, chunk->size); - } - /* * Allocate one additional write block for the case where a chunk will need * an extra write block on both sides to fit. @@ -162,6 +151,28 @@ static int wr_chunk(const struct bt_mesh_blob_io *io, uint32_t write_block_size = flash_area_align(flash->area); off_t area_offset = flash->offset + block->offset + chunk->offset; int start_pad = area_offset % write_block_size; + off_t aligned_offset = ROUND_DOWN(area_offset, write_block_size); + size_t write_size = ROUND_UP(start_pad + chunk->size, write_block_size); + + if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { + /* + * For devices without explicit erase (e.g. RRAM), read existing + * data at alignment boundaries to preserve bytes outside the + * chunk region, then overlay the chunk data and write back. + * The erase-value padding trick cannot be used here because + * writes are destructive regardless of the value written. + */ + int err; + + err = flash_area_read(flash->area, aligned_offset, buf, write_size); + if (err) { + return err; + } + + memcpy(&buf[start_pad], chunk->data, chunk->size); + + return flash_area_write(flash->area, aligned_offset, buf, write_size); + } /* * Fill buffer with erase value, to make sure only the part of the @@ -173,10 +184,7 @@ static int wr_chunk(const struct bt_mesh_blob_io *io, memcpy(&buf[start_pad], chunk->data, chunk->size); - return flash_area_write(flash->area, - ROUND_DOWN(area_offset, write_block_size), - buf, - ROUND_UP(start_pad + chunk->size, write_block_size)); + return flash_area_write(flash->area, aligned_offset, buf, write_size); } int bt_mesh_blob_io_flash_init(struct bt_mesh_blob_io_flash *flash, From dec3a197bf7ac3e5a54e04702e2def4860fc5916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Fri, 17 Apr 2026 16:17:33 +0200 Subject: [PATCH 3320/3334] [nrf fromtree] dts: arm: nordic: correct reg in mailbox nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unit address and first address now match. Signed-off-by: Michał Stasiak (cherry picked from commit f3ad737c258159e5562eda53081b8971712a274f) --- dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi | 2 +- dts/arm/nordic/nrf7120_enga_cpuapp.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi index b0fb95f76047..6f6e922f1520 100644 --- a/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54lm20_a_b_cpuapp.dtsi @@ -45,7 +45,7 @@ nvic: &cpuapp_nvic {}; &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; - reg = <0x0 0x1000>; + reg = <0x1 0x1000>; status = "disabled"; interrupts = <76 NRF_DEFAULT_IRQ_PRIORITY>; #mbox-cells = <1>; diff --git a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi index 256f2d8f43b8..9cdc8361cbad 100644 --- a/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi +++ b/dts/arm/nordic/nrf7120_enga_cpuapp.dtsi @@ -45,7 +45,7 @@ nvic: &cpuapp_nvic {}; &cpuflpr_vpr { cpuapp_vevif_rx: mailbox@1 { compatible = "nordic,nrf-vevif-event-rx"; - reg = <0x0 0x1000>; + reg = <0x1 0x1000>; status = "disabled"; interrupts = <76 NRF_DEFAULT_IRQ_PRIORITY>; #mbox-cells = <1>; From 196e6a04c676146cd2ceb100913b5ea2369ba467 Mon Sep 17 00:00:00 2001 From: Alperen Sener Date: Wed, 29 Apr 2026 12:47:17 +0200 Subject: [PATCH 3321/3334] [nrf fromtree] bluetooth: host: Add missing pending IRK update call for ext adv start Adds IRK update call to internal bt_le_adv_start_ext. And rename it to adv_start_ext to prevent confusion with public functions. There are two paths to start ext advertising: - bt_le_adv_start can start extended advertising if enabled by calling internal bt_le_adv_start_ext else it starts legacy advertisements. - bt_le_ext_adv_start specifically starts extended advertisements. This commit misses the first path for ext advertisement: 6d137ae015e9cebc8e48d05ca6ff4d0f0fe9fd03 Signed-off-by: Alperen Sener (cherry picked from commit 246050f7f920614227f2fc07e7da0a865187e944) --- subsys/bluetooth/host/adv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 283c2521dca4..22068c8d11d0 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1219,7 +1219,7 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv, return 0; } -int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, +static int adv_start_ext(struct bt_le_ext_adv *adv, const struct bt_le_adv_param *param, const struct bt_data *ad, size_t ad_len, const struct bt_data *sd, size_t sd_len) @@ -1244,6 +1244,10 @@ int bt_le_adv_start_ext(struct bt_le_ext_adv *adv, return -EALREADY; } + if (IS_ENABLED(CONFIG_BT_SMP) && atomic_test_bit(bt_dev.flags, BT_DEV_ID_PENDING)) { + bt_id_pending_keys_update(); + } + adv->id = param->id; if (IS_ENABLED(CONFIG_BT_ID_AUTO_SWAP_MATCHING_BONDS)) { @@ -1327,7 +1331,7 @@ int bt_le_adv_start(const struct bt_le_adv_param *param, if (IS_ENABLED(CONFIG_BT_EXT_ADV) && BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) { - err = bt_le_adv_start_ext(adv, param, ad, ad_len, sd, sd_len); + err = adv_start_ext(adv, param, ad, ad_len, sd, sd_len); } else { err = adv_start_legacy(adv, param, ad, ad_len, sd, sd_len); } From 54cb011dfd3a09ea6a4e87d06493f95fb7b27e8a Mon Sep 17 00:00:00 2001 From: Bartosz Miller Date: Tue, 5 May 2026 15:25:03 +0200 Subject: [PATCH 3322/3334] [nrf fromtree] tests: drivers: flash: Verify 'supply-gpios' for SPI nor flash driver Test SPI NOR flash driver ability to hande the 'supply-gpios' property. Signed-off-by: Bartosz Miller (cherry picked from commit 08250dc6671f6035570de503451a5ce97b5baa8d) --- .../common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 1 + .../common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay | 8 ++++++++ .../common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 5272bb8fdde3..7e2c58fc2b11 100644 --- a/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/flash/common/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -27,4 +27,5 @@ &mx25uw63 { status = "okay"; supply-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + t-reset-recovery = <10000>; }; diff --git a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay index 8a5afda2ab00..9d783d640f7a 100644 --- a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay +++ b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay @@ -4,6 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +/ { + zephyr,user { + test-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + }; +}; + &mx25r64 { status = "okay"; + supply-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + t-reset-recovery = <10000>; }; diff --git a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay index 3ab838329612..34983d6a4b5f 100644 --- a/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay +++ b/tests/drivers/flash/common/boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay @@ -4,6 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +/ { + zephyr,user { + test-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + }; +}; + &mx25r64 { status = "okay"; + supply-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + t-reset-recovery = <10000>; }; From a3b14f4590aa1b3617aa7d2a2eb01924906e5730 Mon Sep 17 00:00:00 2001 From: Anton Zyma Date: Tue, 21 Apr 2026 10:03:24 +0300 Subject: [PATCH 3323/3334] Revert "[nrf noup] tests: ram_context_for_isr: Disable KMU by default" This reverts commit e5618fec38e228854881ecc4ff9c993894a705d1. Configuration introduced by this commit to be moved to sdk-nrf. Signed-off-by: Anton Zyma --- .../boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20b_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n From 83612f5380c2dd83bcf3a29633b41d39e6543873 Mon Sep 17 00:00:00 2001 From: Anton Zyma Date: Tue, 21 Apr 2026 10:06:20 +0300 Subject: [PATCH 3324/3334] Revert "[nrf noup] tests: ram_context_for_isr: Disable KMU by default" This reverts commit 206c0efa9be0b49e1ab7bffb09978da18368ba40. Changes introduced by this commit to be moved to sdk-nrf. Signed-off-by: Anton Zyma --- .../boards/nrf54l05dk_nrf54l05_cpuapp.conf | 6 ------ .../boards/nrf54l15dk_nrf54l10_cpuapp.conf | 6 ------ .../boards/nrf54l15dk_nrf54l15_cpuapp.conf | 6 ------ .../boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf | 6 ------ .../boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf | 6 ------ .../boards/nrf7120pdk_nrf7120_cpuapp.conf | 6 ------ 6 files changed, 36 deletions(-) delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf delete mode 100644 tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l05dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l10_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf54lv10dk_nrf54lv10a_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n diff --git a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf b/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf deleted file mode 100644 index 963ba83325a4..000000000000 --- a/tests/application_development/ram_context_for_isr/boards/nrf7120pdk_nrf7120_cpuapp.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_CRACEN_LIB_KMU=n From ed72e71acbb3afc39e77b175cb814225c0e44dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Tue, 5 May 2026 12:42:57 +0200 Subject: [PATCH 3325/3334] Revert "[nrf noup] soc: nordic: nrf54l: Add ROM start offset PM override" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bc38fb0fbf634e139a6e3a58584b21a3a8be3bcd. Signed-off-by: Dag Erik Gjørvad --- soc/nordic/nrf54l/Kconfig.defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index bc7577b7c55e..2cd38dca0e95 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -33,7 +33,6 @@ choice NULL_POINTER_EXCEPTION_DETECTION endchoice config ROM_START_OFFSET - default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # ARM From a409cf85afaa38c654f456cf6beef3b5fcf8c9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Tue, 5 May 2026 10:58:38 +0200 Subject: [PATCH 3326/3334] [nrf fromtree] soc: nordic: Don't override offset when TF-m is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When TF-m is enabled on 54L the ROM_START_OFFSET should not be overridden, even if MCUboot is enabled. Signed-off-by: Dag Erik Gjørvad (cherry picked from commit 46d19345c0229c41339f7d494e3eb7fd3dab5ce8) --- soc/nordic/nrf54l/Kconfig.defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index 2cd38dca0e95..d78898ce258e 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -33,7 +33,7 @@ choice NULL_POINTER_EXCEPTION_DETECTION endchoice config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT + default 0x800 if BOOTLOADER_MCUBOOT && !BUILD_WITH_TFM endif # ARM From 97eb343e32e48608f969927c5817da539f995ddf Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 25 Sep 2025 09:44:35 +0100 Subject: [PATCH 3327/3334] [nrf noup] soc: nordic: nrf54l: Add ROM start offset PM override Adds an override to force this Kconfig to 0 when partition manager is enabled Signed-off-by: Jamie McCrae (cherry picked from commit cf7c4d33918ef1a43ba573ba6ba5bbc20c8c2a51) --- soc/nordic/nrf54l/Kconfig.defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/nordic/nrf54l/Kconfig.defconfig b/soc/nordic/nrf54l/Kconfig.defconfig index d78898ce258e..0f9b60762dcd 100644 --- a/soc/nordic/nrf54l/Kconfig.defconfig +++ b/soc/nordic/nrf54l/Kconfig.defconfig @@ -33,6 +33,7 @@ choice NULL_POINTER_EXCEPTION_DETECTION endchoice config ROM_START_OFFSET + default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT && !BUILD_WITH_TFM endif # ARM From f5ac77b66ce0340e2e439a89040b1f14ecd78e4d Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 13 May 2026 12:25:13 +0200 Subject: [PATCH 3328/3334] [nrf fromlist] Bluetooth: Host: Add definition and decoding for Bluetooth version 6.3 Add definition and decoding for version 6.3. Relates to https://github.com/zephyrproject-rtos/zephyr/pull/109050 Upstream PR #: 109050 Signed-off-by: Vinayak Kariappa Chettimada --- include/zephyr/bluetooth/hci_types.h | 1 + subsys/bluetooth/host/hci_core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index 0704e9f06780..b44fca16446c 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -967,6 +967,7 @@ struct bt_hci_rp_configure_data_path { #define BT_HCI_VERSION_6_0 14 #define BT_HCI_VERSION_6_1 15 #define BT_HCI_VERSION_6_2 16 +#define BT_HCI_VERSION_6_3 17 #define BT_HCI_OP_READ_LOCAL_VERSION_INFO BT_OP(BT_OGF_INFO, 0x0001) /* 0x1001 */ struct bt_hci_rp_read_local_version_info { diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 67d2eba5bf0a..c3b53d1af695 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4050,7 +4050,7 @@ const char *bt_hci_get_ver_str(uint8_t core_version) { const char * const str[] = { "1.0b", "1.1", "1.2", "2.0", "2.1", "3.0", "4.0", "4.1", "4.2", - "5.0", "5.1", "5.2", "5.3", "5.4", "6.0", "6.1", "6.2" + "5.0", "5.1", "5.2", "5.3", "5.4", "6.0", "6.1", "6.2", "6.3" }; if (core_version < ARRAY_SIZE(str)) { From 79ccd4ab16cfded9a26e29c4fcb92d2542c7a0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 17 Apr 2026 08:06:54 +0200 Subject: [PATCH 3329/3334] [nrf fromtree] tests: drivers: flash: Enable negative_tests on nrf92 family MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add handling of the nrf92 chip family to a conditional statement. The nrf92 family is similar to the nrf54h20 chip. Signed-off-by: Sebastian Głąb (cherry picked from commit 9702da9116d76a205846c9825f2946ea44cd03fc) --- tests/drivers/flash/negative_tests/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/flash/negative_tests/src/main.c b/tests/drivers/flash/negative_tests/src/main.c index 46a2d57eb067..b6dab05d69f5 100644 --- a/tests/drivers/flash/negative_tests/src/main.c +++ b/tests/drivers/flash/negative_tests/src/main.c @@ -29,7 +29,7 @@ #if defined(CONFIG_SOC_SERIES_NRF54L) || defined(CONFIG_SOC_FAMILY_MICROCHIP_SAM_D5X_E5X) #define TEST_FLASH_START (DT_REG_ADDR(DT_MEM_FROM_PARTITION(DT_NODELABEL(TEST_AREA)))) #define TEST_FLASH_SIZE (DT_REG_SIZE(DT_MEM_FROM_PARTITION(DT_NODELABEL(TEST_AREA)))) -#elif defined(CONFIG_SOC_NRF54H20) +#elif defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_SERIES_NRF92) #define TEST_FLASH_START (DT_REG_ADDR(DT_PARENT(DT_PARENT(DT_NODELABEL(TEST_AREA))))) #define TEST_FLASH_SIZE (DT_REG_SIZE(DT_PARENT(DT_PARENT(DT_NODELABEL(TEST_AREA))))) #elif defined(CONFIG_SOC_FAMILY_INFINEON_PSOC4) From 4fc5fb33e45fb30cc08eb5adab7844b951ce3cbf Mon Sep 17 00:00:00 2001 From: Travis Lam Date: Tue, 14 Apr 2026 15:44:43 +0200 Subject: [PATCH 3330/3334] [nrf fromtree] tests: driver: flash: Enable flash negative tests for nrf7120 Enable flash negative test for nrf7120. Enable sample soc_flash_nrf for nrf7120. Signed-off-by: Travis Lam (cherry picked from commit c171ef8220771eca19e876078d25384adafb1df7) --- samples/drivers/soc_flash_nrf/sample.yaml | 1 + tests/drivers/flash/negative_tests/src/main.c | 6 ++++++ tests/drivers/flash/negative_tests/testcase.yaml | 1 + 3 files changed, 8 insertions(+) diff --git a/samples/drivers/soc_flash_nrf/sample.yaml b/samples/drivers/soc_flash_nrf/sample.yaml index 02d90fb2e337..54e8285a0284 100644 --- a/samples/drivers/soc_flash_nrf/sample.yaml +++ b/samples/drivers/soc_flash_nrf/sample.yaml @@ -12,6 +12,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp + - nrf7120dk/nrf7120/cpuapp integration_platforms: - nrf52dk/nrf52832 - nrf52840dk/nrf52840 diff --git a/tests/drivers/flash/negative_tests/src/main.c b/tests/drivers/flash/negative_tests/src/main.c index b6dab05d69f5..311204253be5 100644 --- a/tests/drivers/flash/negative_tests/src/main.c +++ b/tests/drivers/flash/negative_tests/src/main.c @@ -32,6 +32,12 @@ #elif defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_SERIES_NRF92) #define TEST_FLASH_START (DT_REG_ADDR(DT_PARENT(DT_PARENT(DT_NODELABEL(TEST_AREA))))) #define TEST_FLASH_SIZE (DT_REG_SIZE(DT_PARENT(DT_PARENT(DT_NODELABEL(TEST_AREA))))) +#elif defined(CONFIG_SOC_NRF7120) +#undef TEST_AREA_DEVICE +#define DEVICE_NODE DT_PARENT(DT_PARENT(DT_PARENT(DT_NODELABEL(TEST_AREA)))) +#define TEST_AREA_DEVICE (DEVICE_DT_GET(DEVICE_NODE)) +#define TEST_FLASH_START (DT_REG_ADDR(DT_MEM_FROM_PARTITION(DT_NODELABEL(TEST_AREA)))) +#define TEST_FLASH_SIZE (DT_REG_SIZE(DT_MEM_FROM_PARTITION(DT_NODELABEL(TEST_AREA)))) #elif defined(CONFIG_SOC_FAMILY_INFINEON_PSOC4) /* For PSoC4, storage_partition is a child of partitions, which is a child of flash0 */ /* We need to go up two levels: storage_partition -> partitions -> flash0 */ diff --git a/tests/drivers/flash/negative_tests/testcase.yaml b/tests/drivers/flash/negative_tests/testcase.yaml index b6b4137c31a4..ac5517520ef5 100644 --- a/tests/drivers/flash/negative_tests/testcase.yaml +++ b/tests/drivers/flash/negative_tests/testcase.yaml @@ -10,4 +10,5 @@ tests: - nrf54lm20dk/nrf54lm20a/cpuapp - nrf54lm20dk/nrf54lm20b/cpuapp - ophelia4ev/nrf54l15/cpuapp + - nrf7120dk/nrf7120/cpuapp - sam_e54_xpro From 29080c03927913667d20d2865074cfa80413a762 Mon Sep 17 00:00:00 2001 From: Albort Xue Date: Thu, 30 Apr 2026 17:37:47 +0800 Subject: [PATCH 3331/3334] [nrf fromtree] linker: fix mapped-partition ROM_SIZE for non-XIP boot modes When FLASH_USES_MAPPED_PARTITION is enabled, Kconfig skips FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE. However, the linker scripts only used the DT-based ROM_ADDR/ROM_SIZE path when both FLASH_USES_MAPPED_PARTITION and CONFIG_XIP were set. For non-XIP modes (e.g. MCUboot ram_load), the code fell through to the else branch relying on the missing configs, causing ROM_SIZE to underflow to 0xFFFFFFFFFFFFFFFF and a linker overflow error. Fix by checking only FLASH_USES_MAPPED_PARTITION for ROM_SIZE, and handling ROM_ADDR separately for XIP (DT address) vs non-XIP (RAM_ADDR). Signed-off-by: Albort Xue (cherry picked from commit 1cf0cc2a5c63e52e34e25409534cab14b46272f3) --- include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld | 6 +++++- include/zephyr/arch/arm/cortex_m/scripts/linker.ld | 6 +++++- include/zephyr/arch/arm64/scripts/linker.ld | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld b/include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld index 82af01208258..fb3f14372670 100644 --- a/include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld @@ -40,8 +40,12 @@ #define ROM_END_OFFSET 0 #endif -#if defined(CONFIG_FLASH_USES_MAPPED_PARTITION) && defined(CONFIG_XIP) +#if defined(CONFIG_FLASH_USES_MAPPED_PARTITION) +#if defined(CONFIG_XIP) #define ROM_ADDR (DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition))) +#else +#define ROM_ADDR RAM_ADDR +#endif #define ROM_SIZE (DT_REG_SIZE(DT_CHOSEN(zephyr_code_partition)) - ROM_END_OFFSET) #else #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) diff --git a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld index c05e6f4b5c80..831f2a560f19 100644 --- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld @@ -73,8 +73,12 @@ _image_1_primary_slot_id = PM_S1_ID; #define ROM_END_OFFSET 0 #endif -#if defined(CONFIG_FLASH_USES_MAPPED_PARTITION) && defined(CONFIG_XIP) +#if defined(CONFIG_FLASH_USES_MAPPED_PARTITION) +#if defined(CONFIG_XIP) #define ROM_ADDR (DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition))) +#else +#define ROM_ADDR RAM_ADDR +#endif #define ROM_SIZE (DT_REG_SIZE(DT_CHOSEN(zephyr_code_partition)) - ROM_END_OFFSET) #else #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) diff --git a/include/zephyr/arch/arm64/scripts/linker.ld b/include/zephyr/arch/arm64/scripts/linker.ld index cc87826d4918..7a1d3751e108 100644 --- a/include/zephyr/arch/arm64/scripts/linker.ld +++ b/include/zephyr/arch/arm64/scripts/linker.ld @@ -32,8 +32,12 @@ #define ROM_END_OFFSET 0 #endif -#if defined(CONFIG_FLASH_USES_MAPPED_PARTITION) && defined(CONFIG_XIP) +#if defined(CONFIG_FLASH_USES_MAPPED_PARTITION) +#if defined(CONFIG_XIP) #define ROM_ADDR (DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition))) +#else +#define ROM_ADDR RAM_ADDR +#endif #define ROM_SIZE (DT_REG_SIZE(DT_CHOSEN(zephyr_code_partition)) - ROM_END_OFFSET) #else #if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0) From e2ef6ad7101c5093092b2aa2505adee54651ef0f Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 8 Apr 2026 09:59:59 +0300 Subject: [PATCH 3332/3334] [nrf fromtree] tests: net: dhcpv6: Increase net_mgmt thread stack space The current default stack space for net_mgmt thread is 800 bytes and it can be too small in some boards like nrf5340dk/nrf5340/cpuapp like shown in this log. Increase the stack to 1024 so that we avoid updating the value in near future. Running TESTSUITE dhcpv6_tests =================================================================== START - test_confirm_exchange_after_iface_down E: ***** USAGE FAULT ***** E: Stack overflow (context area not valid) E: r0/a1: 0x00010fc4 r1/a2: 0x01000000 r2/a3: 0x00000020 E: r3/a4: 0x200022a8 r12/ip: 0x00000020 r14/lr: 0x20003088 E: xpsr: 0x00011400 E: Faulting instruction address (r15/pc): 0x200030b8 E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0 E: Current thread: 0x20000d88 (net_mgmt) E: Halting system Signed-off-by: Jukka Rissanen (cherry picked from commit 46f59b07bc1d2fd35355bdbc6cbc8b7166861ad4) Signed-off-by: Robert Lubos --- tests/net/dhcpv6/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/net/dhcpv6/prj.conf b/tests/net/dhcpv6/prj.conf index 0c7e5c319eab..78a01aa5b295 100644 --- a/tests/net/dhcpv6/prj.conf +++ b/tests/net/dhcpv6/prj.conf @@ -15,3 +15,4 @@ CONFIG_NET_TC_TX_COUNT=1 CONFIG_NET_MGMT=y CONFIG_NET_MGMT_EVENT=y CONFIG_NET_MGMT_EVENT_INFO=y +CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024 From 94fe256680508229500faf3825dfc386fed73777 Mon Sep 17 00:00:00 2001 From: Timothy Keys Date: Tue, 5 May 2026 12:24:20 +0100 Subject: [PATCH 3333/3334] [nrf fromtree] bluetooth: host: Update doc for bt_conn_le_conn_rate_set_defaults The previous documentation was confusing. This adds much clearer language. Signed-off-by: Timothy Keys (cherry picked from commit 237dcf2aa494d6f3400422a1508fb1bb3b0675b7) --- include/zephyr/bluetooth/conn.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index a70eeae1e4c5..12cb779b1cf2 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1577,11 +1577,15 @@ int bt_conn_le_read_min_conn_interval(uint16_t *min_interval_us); /** @brief Set Default Connection Rate Parameters. * - * Set default connection rate parameters to be used for future connections. - * This command does not affect any existing connection. - * Parameters set for specific connection will always have precedence. + * Configure the range of Connection Rate values that this device will + * accept from a Peripheral initiating a Connection Rate Update procedure. * - * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS} + * The configured bounds: + * - Apply only to connections established after this call. + * - Are overridden on a given connection by any + * @ref bt_conn_le_conn_rate_request on that connection. + * + * @kconfig_dep{CONFIG_BT_SHORTER_CONNECTION_INTERVALS,CONFIG_BT_CENTRAL} * * @param params Connection rate parameters. * From f339661aa810f8884f431df2e2de9799c03c7355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 12 May 2026 15:19:25 +0200 Subject: [PATCH 3334/3334] [nrf fromlist] modules: hal_nordic: ironside: periphconf: Add support for CTRLSEL on P5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for CTRLSEL periphconf entries on nRF92 seriers P5 for spi120 and uart120. Signed-off-by: Krzysztof Chruściński Upstream PR #: 108976 --- .../ironside/se/scripts/gen_periphconf_entries.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py b/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py index f7b1537a7afc..5e7d137b8100 100644 --- a/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py +++ b/modules/hal_nordic/ironside/se/scripts/gen_periphconf_entries.py @@ -511,6 +511,11 @@ def lookup_tables_get(soc: Soc, family: Family) -> SocLookupTables: NrfPsel(fun=NrfFun.SPIM_MISO, port=2, pin=3): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MOSI, port=2, pin=4): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_SCK, port=2, pin=0): Ctrlsel.SERIAL0, + # SPIM P5 mappings + NrfPsel(fun=NrfFun.SPIM_CSN, port=5, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MISO, port=5, pin=4): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_MOSI, port=5, pin=2): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.SPIM_SCK, port=5, pin=1): Ctrlsel.SERIAL0, # SPIM P6 mappings NrfPsel(fun=NrfFun.SPIM_CSN, port=6, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.SPIM_MISO, port=6, pin=7): Ctrlsel.SERIAL0, @@ -521,6 +526,11 @@ def lookup_tables_get(soc: Soc, family: Family) -> SocLookupTables: NrfPsel(fun=NrfFun.UART_RTS, port=2, pin=5): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.UART_RX, port=2, pin=2): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.UART_TX, port=2, pin=4): Ctrlsel.SERIAL0, + # UARTE P5 mappings + NrfPsel(fun=NrfFun.UART_CTS, port=5, pin=4): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RTS, port=5, pin=5): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_RX, port=5, pin=3): Ctrlsel.SERIAL0, + NrfPsel(fun=NrfFun.UART_TX, port=5, pin=2): Ctrlsel.SERIAL0, # UARTE P6 mappings NrfPsel(fun=NrfFun.UART_CTS, port=6, pin=7): Ctrlsel.SERIAL0, NrfPsel(fun=NrfFun.UART_RTS, port=6, pin=5): Ctrlsel.SERIAL0,

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../modules/tee/tf-m/trusted-firmware-m/platform/ext/target/adi/max32657/partition/flash_layout.h file.` +If you would like to update flash region for your application you shall update related section in +these files. + +Additionally if firmware update feature requires slot1 and slot1_ns section need to be +defined. On default the section size set as 0 due to firmware update not requires on default. + + +Peripherals and Memory Ownership +-------------------------------- + +The ARM Security Extensions model allows system developers to partition device hardware and +software resources, so that they exist in either the Secure world for the security subsystem, +or the Normal world for everything else. Correct system design can ensure that no Secure world +assets can be accessed from the Normal world. A Secure design places all sensitive resources +in the Secure world, and ideally has robust software running that can protect assets against +a wide range of possible software attacks (`1`_). + +MPC (Memory Protection Controller) and PPC (Peripheral Protection Controller) are allow to +protect memory and peripheral. Incase of need peripheral and flash ownership can be updated in +../modules/tee/tf-m/trusted-firmware-m/platform/ext/target/adi/max32657/s_ns_access.cmake` +file by updating cmake flags to ON/OFF. + +As an example for below configuration TRNG, SRAM_0 and SRAM_1 is not going to be accessible +by non-secure. All others is going to be accessible by NS world. + +.. code-block:: + + set(ADI_NS_PRPH_GCR ON CACHE BOOL "") + set(ADI_NS_PRPH_SIR ON CACHE BOOL "") + set(ADI_NS_PRPH_FCR ON CACHE BOOL "") + set(ADI_NS_PRPH_WDT ON CACHE BOOL "") + set(ADI_NS_PRPH_AES OFF CACHE BOOL "") + set(ADI_NS_PRPH_AESKEY OFF CACHE BOOL "") + set(ADI_NS_PRPH_CRC ON CACHE BOOL "") + set(ADI_NS_PRPH_GPIO0 ON CACHE BOOL "") + set(ADI_NS_PRPH_TIMER0 ON CACHE BOOL "") + set(ADI_NS_PRPH_TIMER1 ON CACHE BOOL "") + set(ADI_NS_PRPH_TIMER2 ON CACHE BOOL "") + set(ADI_NS_PRPH_TIMER3 ON CACHE BOOL "") + set(ADI_NS_PRPH_TIMER4 ON CACHE BOOL "") + set(ADI_NS_PRPH_TIMER5 ON CACHE BOOL "") + set(ADI_NS_PRPH_I3C ON CACHE BOOL "") + set(ADI_NS_PRPH_UART ON CACHE BOOL "") + set(ADI_NS_PRPH_SPI ON CACHE BOOL "") + set(ADI_NS_PRPH_TRNG OFF CACHE BOOL "") + set(ADI_NS_PRPH_BTLE_DBB ON CACHE BOOL "") + set(ADI_NS_PRPH_BTLE_RFFE ON CACHE BOOL "") + set(ADI_NS_PRPH_RSTZ ON CACHE BOOL "") + set(ADI_NS_PRPH_BOOST ON CACHE BOOL "") + set(ADI_NS_PRPH_BBSIR ON CACHE BOOL "") + set(ADI_NS_PRPH_BBFCR ON CACHE BOOL "") + set(ADI_NS_PRPH_RTC ON CACHE BOOL "") + set(ADI_NS_PRPH_WUT0 ON CACHE BOOL "") + set(ADI_NS_PRPH_WUT1 ON CACHE BOOL "") + set(ADI_NS_PRPH_PWR ON CACHE BOOL "") + set(ADI_NS_PRPH_MCR ON CACHE BOOL "") + + # SRAMs + set(ADI_NS_SRAM_0 OFF CACHE BOOL "Size: 32KB") + set(ADI_NS_SRAM_1 OFF CACHE BOOL "Size: 32KB") + set(ADI_NS_SRAM_2 ON CACHE BOOL "Size: 64KB") + set(ADI_NS_SRAM_3 ON CACHE BOOL "Size: 64KB") + set(ADI_NS_SRAM_4 ON CACHE BOOL "Size: 64KB") + + # Ramfuncs section size + set(ADI_S_RAM_CODE_SIZE "0x800" CACHE STRING "Default: 2KB") + + # Flash: BL2, TFM and Zephyr are contiguous sections. + set(ADI_FLASH_AREA_BL2_SIZE "0x10000" CACHE STRING "Default: 64KB") + set(ADI_FLASH_S_PARTITION_SIZE "0x50000" CACHE STRING "Default: 320KB") + set(ADI_FLASH_NS_PARTITION_SIZE "0x90000" CACHE STRING "Default: 576KB") + set(ADI_FLASH_PS_AREA_SIZE "0x4000" CACHE STRING "Default: 16KB") + set(ADI_FLASH_ITS_AREA_SIZE "0x4000" CACHE STRING "Default: 16KB") + + # + # Allow user set S-NS resources ownership by overlay file + # + if(EXISTS "${CMAKE_BINARY_DIR}/../../s_ns_access_overlay.cmake") + include(${CMAKE_BINARY_DIR}/../../s_ns_access_overlay.cmake) + endif() + + +As an alternative method (which recommended) user can configurate ownership peripheral by +an cmake overlay file too without touching TF-M source files. For this path +create ``s_ns_access_overlay.cmake`` file under your project root folder and put peripheral/memory +you would like to be accessible by secure world. + +As an example if below configuration files been put in the ``s_ns_access_overlay.cmake`` file +TRNG, SRAM_0 and SRAM_1 will be accessible by secure world only. + +.. code-block:: + + set(ADI_NS_PRPH_TRNG OFF CACHE BOOL "") + set(ADI_NS_SRAM_0 OFF CACHE BOOL "Size: 32KB") + set(ADI_NS_SRAM_1 OFF CACHE BOOL "Size: 32KB") + + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Flashing +======== + +Here is an example for the :zephyr:code-sample:`hello_world` application. This example uses the +:ref:`jlink-debug-host-tools` as default. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: max32658evkit/max32658 + :goals: flash + +Open a serial terminal, reset the board (press the RESET button), and you should +see the following message in the terminal: + +.. code-block:: console + + ***** Booting Zephyr OS build v4.1.0 ***** + Hello World! max32658evkit/max32658 + +Building and flashing secure/non-secure with Arm |reg| TrustZone |reg| +---------------------------------------------------------------------- +The TF-M integration samples can be run using the +``max32658evkit/max32658/ns`` board target. To run we need to manually flash +the resulting image (``tfm_merged.hex``) with a J-Link as follows +(reset and erase are for recovering a locked core): + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: max32658evkit/max32658/ns + :goals: build + +.. code-block:: console + + west flash --hex-file build/zephyr/tfm_merged.hex + +.. code-block:: console + + [INF] Starting bootloader + [WRN] This device was provisioned with dummy keys. This device is NOT SECURE + [INF] PSA Crypto init done, sig_type: RSA-3072 + [WRN] Cannot upgrade: slots have non-compatible sectors + [WRN] Cannot upgrade: slots have non-compatible sectors + [INF] Bootloader chainload address offset: 0x10000 + [INF] Jumping to the first image slot + ***** Booting Zephyr OS build v4.2.0 ***** + Hello World! max32658evkit/max32658/ns + + +Debugging +========= + +Here is an example for the :zephyr:code-sample:`hello_world` application. This example uses the +:ref:`jlink-debug-host-tools` as default. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: max32658evkit/max32658 + :goals: debug + +Open a serial terminal, step through the application in your debugger, and you +should see the following message in the terminal: + +.. code-block:: console + + ***** Booting Zephyr OS build v4.2.0 ***** + Hello World! max32658evkit/max32658 + +References +********** + +.. _1: + https://developer.arm.com/documentation/100935/0100/The-TrustZone-hardware-architecture- + +.. _Trusted Firmware M: + https://tf-m-user-guide.trustedfirmware.org/building/tfm_build_instruction.html diff --git a/boards/adi/max32658evkit/max32658evkit_max32658.dts b/boards/adi/max32658evkit/max32658evkit_max32658.dts new file mode 100644 index 000000000000..20b52890f76b --- /dev/null +++ b/boards/adi/max32658evkit/max32658evkit_max32658.dts @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024-2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "max32658evkit_max32658_common.dtsi" + +/ { + chosen { + zephyr,sram = &secure_ram; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + secure_ram: partition@30000000 { + label = "secure-memory"; + reg = <0x30000000 DT_SIZE_K(256)>; + }; + }; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0 DT_SIZE_K(960)>; + read-only; + }; + + storage_partition: partition@f0000 { + label = "storage"; + reg = <0xf0000 DT_SIZE_K(64)>; + }; + }; +}; + +&trng { + status = "okay"; +}; diff --git a/boards/adi/max32658evkit/max32658evkit_max32658.yaml b/boards/adi/max32658evkit/max32658evkit_max32658.yaml new file mode 100644 index 000000000000..f4e7fdac7f8f --- /dev/null +++ b/boards/adi/max32658evkit/max32658evkit_max32658.yaml @@ -0,0 +1,21 @@ +identifier: max32658evkit/max32658 +name: max32658evkit-max32658 +vendor: adi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +supported: + - serial + - gpio + - trng + - watchdog + - dma + - counter + - pwm + - rtc_counter + - spi + - i3c +ram: 256 +flash: 960 diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_common.dtsi b/boards/adi/max32658evkit/max32658evkit_max32658_common.dtsi new file mode 100644 index 000000000000..9b65c7bffab6 --- /dev/null +++ b/boards/adi/max32658evkit/max32658evkit_max32658_common.dtsi @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024-2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include + +/ { + model = "Analog Devices MAX32658EVKIT"; + compatible = "adi,max32658evkit"; + + chosen { + zephyr,console = &uart0; + zephyr,cortex-m-idle-timer = &counter_wut1; + zephyr,shell-uart = &uart0; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + label = "Green LED"; + }; + }; + + buttons { + compatible = "gpio-keys"; + + pb1: pb1 { + gpios = <&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW2"; + zephyr,code = ; + }; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + accel0 = &adxl367; + led0 = &led1; + sw0 = &pb1; + watchdog0 = &wdt0; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_p0_9 &uart0_rx_p0_5>; + pinctrl-names = "default"; + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + status = "okay"; +}; + +&clk_ipo { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + pinctrl-0 = <&spi0_mosi_p0_2 &spi0_miso_p0_4 &spi0_sck_p0_6 &spi0_ss0_p0_3>; + pinctrl-names = "default"; +}; + +&rtc_counter { + status = "okay"; + clock-source = ; +}; + +&i3c0 { + status = "okay"; + pinctrl-0 = <&i3c_scl_p0_0 &i3c_sda_p0_1>; + pinctrl-names = "default"; + i2c-scl-hz = ; + i3c-scl-hz = ; + i3c-od-scl-hz = ; + + adxl367: adxl367@530000000000000000 { + compatible = "adi,adxl367"; + reg = <0x53 0x00 0x00>; + status = "okay"; + }; +}; + +&wut0 { + clock-source = ; +}; + +&wut1 { + status = "okay"; + clock-source = ; + wakeup-source; + counter_wut1: counter { + status = "okay"; + }; +}; diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_defconfig b/boards/adi/max32658evkit/max32658evkit_max32658_defconfig new file mode 100644 index 000000000000..25ef03ee5131 --- /dev/null +++ b/boards/adi/max32658evkit/max32658evkit_max32658_defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2024-2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +# Enable GPIO +CONFIG_GPIO=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable UART +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# It is secure fw, enable flags +CONFIG_TRUSTED_EXECUTION_SECURE=y diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_ns.dts b/boards/adi/max32658evkit/max32658evkit_max32658_ns.dts new file mode 100644 index 000000000000..0cc9f0880480 --- /dev/null +++ b/boards/adi/max32658evkit/max32658evkit_max32658_ns.dts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2024-2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "max32658evkit_max32658_common.dtsi" + +/ { + chosen { + zephyr,sram = &non_secure_ram; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* RAM split used by TFM */ + secure_ram: partition@20000000 { + label = "secure-memory"; + reg = <0x20000000 DT_SIZE_K(64)>; + }; + + non_secure_ram: partition@20010000 { + label = "non-secure-memory"; + reg = <0x20010000 DT_SIZE_K(192)>; + }; + }; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + read-only; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(320)>; + }; + + slot0_ns_partition: partition@60000 { + label = "image-0-nonsecure"; + reg = <0x60000 DT_SIZE_K(576)>; + }; + + /* + * slot1_partition: partition@f0000 { + * label = "image-1"; + * reg = <0xf0000 DT_SIZE_K(0)>; + * }; + * slot1_ns_partition: partition@f0000 { + * label = "image-1-nonsecure"; + * reg = <0xf0000 DT_SIZE_K(0)>; + * }; + */ + + storage_partition: partition@f0000 { + label = "storage"; + reg = <0xf0000 DT_SIZE_K(64)>; + }; + }; +}; diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_ns.yaml b/boards/adi/max32658evkit/max32658evkit_max32658_ns.yaml new file mode 100644 index 000000000000..9868c5bb8a71 --- /dev/null +++ b/boards/adi/max32658evkit/max32658evkit_max32658_ns.yaml @@ -0,0 +1,20 @@ +identifier: max32658evkit/max32658/ns +name: max32658evkit-max32658-Non-Secure +vendor: adi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +supported: + - serial + - gpio + - watchdog + - dma + - counter + - pwm + - rtc_counter + - spi + - i3c +ram: 192 +flash: 576 diff --git a/boards/adi/max32658evkit/max32658evkit_max32658_ns_defconfig b/boards/adi/max32658evkit/max32658evkit_max32658_ns_defconfig new file mode 100644 index 000000000000..d808f79c5459 --- /dev/null +++ b/boards/adi/max32658evkit/max32658evkit_max32658_ns_defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2024-2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +# Enable GPIO +CONFIG_GPIO=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable UART +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# It is non-secure fw, enable flags +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# Set TFM and Zephyr sign key +CONFIG_TFM_MCUBOOT_SIGNATURE_TYPE="RSA-3072" diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index a8d51666591e..4b730b4a342d 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -251,7 +251,7 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DTFM_PLATFORM_NXP_HAL_FILE_PATH=${TFM_PLATFORM_NXP_HAL_FILE_PATH}) endif() - if(CONFIG_BOARD_MAX32657EVKIT_MAX32657_NS) + if(CONFIG_BOARD_MAX32657EVKIT_MAX32657_NS OR CONFIG_BOARD_MAX32658EVKIT_MAX32658_NS) # Supply path to hal_adi for TF-M build list(APPEND TFM_CMAKE_ARGS -DHAL_ADI_PATH=${ZEPHYR_ADI_MODULE_DIR}) endif() diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 06c7221321ec..6c3ac64487f2 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -25,7 +25,7 @@ config TFM_BOARD default "stm/stm32wba65i_dk" if BOARD_NUCLEO_WBA65RI || BOARD_STM32WBA65I_DK1 default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 - default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS + default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS || BOARD_MAX32658EVKIT_MAX32658_NS default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9160" if SOC_NRF9160 default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9120" if SOC_NRF9120 default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP From 64285e292efe8be236a4e2bce681f6c1110a60a0 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 22 Oct 2025 11:24:37 +0100 Subject: [PATCH 0726/3334] [nrf fromtree] modules: tf-m: Remove some download Kconfigs Removes two Kconfig which seemed to indicate downloading of a project would happen automatically, which does not abide by how to get additional module code in Zephyr. Due to TF-M always setting these to "DOWNLOAD" in the repo, they are set even if the modules do not exist so that they do not download e.g. in CI. Unfortunately it seems that the qcbor one cannot be removed at this time due to being needed in some applications and is not apache licensed, though instructions should be provided to users instead describing how to add it to a module manifest instead, in a later task Signed-off-by: Jamie McCrae (cherry picked from commit 298a35b7140e36c9404feba2c13873d5cffa933f) --- modules/trusted-firmware-m/CMakeLists.txt | 11 +++---- modules/trusted-firmware-m/Kconfig.tfm | 37 ----------------------- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 4b730b4a342d..33c11d7145fd 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -67,6 +67,8 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_KEY_${SUFFIX}=${CONFIG_TFM_KEY_FILE_${SUFFIX}}) endforeach() + # Supply path to MCUboot for TF-M build + list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_PATH=${ZEPHYR_MCUBOOT_MODULE_DIR}) else() list(APPEND TFM_CMAKE_ARGS -DBL2=FALSE) endif() @@ -256,11 +258,6 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DHAL_ADI_PATH=${ZEPHYR_ADI_MODULE_DIR}) endif() - if(CONFIG_TFM_BL2 AND CONFIG_TFM_MCUBOOT_PATH_LOCAL) - # Supply path to MCUboot for TF-M build - list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_PATH=${ZEPHYR_MCUBOOT_MODULE_DIR}) - endif() - if(CONFIG_TFM_MCUBOOT_DATA_SHARING) list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_DATA_SHARING=ON) endif() @@ -277,8 +274,8 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DTFM_TESTS_REVISION_CHECKS=OFF) - if(CONFIG_TFM_ETHOS_DRIVER_PATH_LOCAL) - list(APPEND TFM_CMAKE_ARGS -DETHOS_DRIVER_PATH=${CONFIG_TFM_ETHOS_DRIVER_PATH_LOCAL}) + if(CONFIG_SOC_SERIES_MPS3 OR CONFIG_SOC_SERIES_MPS4) + list(APPEND TFM_CMAKE_ARGS -DETHOS_DRIVER_PATH=${ZEPHYR_HAL_ETHOS_U_MODULE_DIR}) endif() if(CONFIG_TFM_STM32_FLASH_LAYOUT_BEGIN_OFFSET) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 6c3ac64487f2..b8bc3831848b 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -310,43 +310,6 @@ config TFM_MCUBOOT_IMAGE_NUMBER updated in one atomic operation. When this is 2, they are split and can be updated independently if dependency requirements are met. -choice TFM_MCUBOOT_PATH - prompt "Path to MCUboot or DOWNLOAD to fetch automatically" - default TFM_MCUBOOT_PATH_LOCAL - help - Path to MCUboot for TF-M builds. The default option - is to use Zephyr's MCUboot module. As an alternative, - users may switch to the 'download' version; in that - case MCUboot will be fetched by the TF-M build during - build time. The default option ensures that Zephyr builds - with TF-M do not fetch external trees. - -config TFM_MCUBOOT_PATH_LOCAL - bool "TF-M to use Zephyr's MCUboot" - help - TF-M builds with BL2 will use the Zephyr's MCUboot version, - which is present in the MCUboot module. - -config TFM_MCUBOOT_PATH_DOWNLOAD - bool "TF-M to automatically download MCUboot during build" - help - TF-M builds with BL2 will let the TF-M build to automatically - fetch and check-out the MCUboot version to use in the build. - -endchoice - -config TFM_ETHOS_DRIVER_PATH_LOCAL - string "Path to a locally available Ethos-U driver or an empty string" - depends on SOC_SERIES_MPS3 || SOC_SERIES_MPS4 - default "$(ZEPHYR_HAL_ETHOS_U_MODULE_DIR)" - help - Path to a locally available Ethos-U driver to be used for TF-M builds or - an empty string to allow TF-M to automatically fetch the Ethos-U - driver from an external repository at build time. - By default Zephyr's Ethos-U driver will be used. It is present in - the hal_ethos_u module. - Alternatively, applications can point to their own paths for Ethos-U driver. - config TFM_QCBOR_PATH string prompt "Path to QCBOR or DOWNLOAD to fetch automatically" From af478590508fd9f47a301853d48100907f0e1f22 Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Mon, 18 Aug 2025 20:05:37 +0200 Subject: [PATCH 0727/3334] [nrf fromtree] modules: tf-m: Kconfig.tfm: Update TFM_BOARD Reorder TFM_BOARD entries by vendor name for improved clarity. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit 2697953876383ebbad8f3cd2a5ce4ddd90fd4b3f) --- modules/trusted-firmware-m/Kconfig.tfm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index b8bc3831848b..f587ea01e45f 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -10,7 +10,7 @@ config ZEPHYR_TRUSTED_FIRMWARE_M_MODULE config TFM_BOARD string - default "nxp/lpcxpresso55s69" if BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS + default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS || BOARD_MAX32658EVKIT_MAX32658_NS default "arm/mps2/an521" if BOARD_MPS2_AN521_CPU0_NS default "arm/mps3/corstone300/fvp" if BOARD_MPS3_CORSTONE300_FVP_NS default "arm/mps3/corstone300/an547" if BOARD_MPS3_CORSTONE300_AN547_NS @@ -19,13 +19,13 @@ config TFM_BOARD default "arm/mps3/corstone310/fvp" if BOARD_MPS3_CORSTONE310_FVP_NS default "arm/mps4/corstone315" if BOARD_MPS4_CORSTONE315_FVP_NS default "arm/mps4/corstone320" if BOARD_MPS4_CORSTONE320_FVP_NS + default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 + default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 + default "nxp/lpcxpresso55s69" if BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS default "stm/b_u585i_iot02a" if BOARD_B_U585I_IOT02A default "stm/nucleo_l552ze_q" if BOARD_NUCLEO_L552ZE_Q default "stm/stm32l562e_dk" if BOARD_STM32L562E_DK default "stm/stm32wba65i_dk" if BOARD_NUCLEO_WBA65RI || BOARD_STM32WBA65I_DK1 - default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 - default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 - default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS || BOARD_MAX32658EVKIT_MAX32658_NS default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9160" if SOC_NRF9160 default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9120" if SOC_NRF9120 default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP From 6f112f3607b725d1f412cd166b21ab758fa27b35 Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Mon, 21 Jul 2025 13:36:48 +0200 Subject: [PATCH 0728/3334] [nrf fromtree] trusted-firmware-m: Set --align when signing The current version of TF-M script that sign MCUboot image uses a default alignment of 1. This value varies between flash devices and not all accept the default 1. This improve the script picking the write-block-size property from the current flash controller and pass as the --align parameter when signing an image. Note: This solution works out-of-box for the vast majority of devices in the Zephyr tree and an exception will throw when a device is not supported. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit debb59830b7e8eb7f8a6470b29bbdcc9f291695a) --- modules/trusted-firmware-m/CMakeLists.txt | 35 ++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 33c11d7145fd..b958f94567fa 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -451,6 +451,39 @@ if (CONFIG_BUILD_WITH_TFM) set(HEX_ADDR_ARGS_NS "--hex-addr=${TFM_HEX_BASE_ADDRESS_NS}") endif() + if(CONFIG_TFM_BL2) + set(image_alignment 1) + set(flash_write_block_size 1) + + dt_chosen(chosen_flash PROPERTY "zephyr,flash") + if(DEFINED chosen_flash AND chosen_flash) + dt_prop(flash_write_block_size PATH ${chosen_flash} PROPERTY write-block-size) + else() + message(WARNING + "The 'zephyr,flash' chosen property is not defined! + Using flash_write_block_size default value possible differs from + TF-M board definitions resulting in improver sign." + ) + endif() + + # The alignment is determined by the minimal amount of bytes necessary to + # be written in the flash sector. Ex., assuming that the sector erase + # operation is 1KiB and, on that sector, the minimum amount of bytes that + # must be written is 8 bytes then the alignment is 8. + # + # Current MCUboot maximum alignment is 32 bytes. + if(flash_write_block_size GREATER 0) + if(flash_write_block_size GREATER 32) + message(WARNING + "imgtool max alignment is 32 and current value is ${flash_write_block_size}. + Keep default image alignment of 1." + ) + else() + set(image_alignment ${flash_write_block_size}) + endif() + endif() + endif() + function(tfm_sign OUT_ARG SUFFIX PAD INPUT_FILE OUTPUT_FILE) if(PAD) set(pad_args --pad --pad-header) @@ -470,7 +503,7 @@ if (CONFIG_BUILD_WITH_TFM) --layout ${layout_file} -k ${CONFIG_TFM_KEY_FILE_${SUFFIX}} --public-key-format ${TFM_PUBLIC_KEY_FORMAT} - --align 1 + --align ${image_alignment} -v ${CONFIG_TFM_IMAGE_VERSION_${SUFFIX}} ${pad_args} ${HEX_ADDR_ARGS_${SUFFIX}} From a1105bc7047b061ee5a0cfeaeffe99355b16222d Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Mon, 21 Jul 2025 15:58:47 +0200 Subject: [PATCH 0729/3334] [nrf fromtree] trusted-firmware-m: Set --max-sectors when signing The --max-sectors option helps catch problems with flash overlap when merging images. If there is a misalignment in flash partitions, the merge process usually fails. This uses information from Zephyr flash partitions and the flash controller to automatically determine the max sectors value and apply it when signing an image. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit 99a2e4931e574cfd8b0ee65b83756b6b09be59f8) --- modules/trusted-firmware-m/CMakeLists.txt | 35 ++++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index b958f94567fa..a6d645afb4c8 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -454,15 +454,17 @@ if (CONFIG_BUILD_WITH_TFM) if(CONFIG_TFM_BL2) set(image_alignment 1) set(flash_write_block_size 1) + set(flash_erase_block_size 1) dt_chosen(chosen_flash PROPERTY "zephyr,flash") if(DEFINED chosen_flash AND chosen_flash) dt_prop(flash_write_block_size PATH ${chosen_flash} PROPERTY write-block-size) + dt_prop(flash_erase_block_size PATH ${chosen_flash} PROPERTY erase-block-size) else() message(WARNING "The 'zephyr,flash' chosen property is not defined! - Using flash_write_block_size default value possible differs from - TF-M board definitions resulting in improver sign." + Using flash_write_block_size and flash_erase_block_size default values + that may differ from TF-M board definitions resulting in invalid signatures." ) endif() @@ -482,9 +484,26 @@ if (CONFIG_BUILD_WITH_TFM) set(image_alignment ${flash_write_block_size}) endif() endif() + + # Calculate the maximum number of sectors necessary to store the image. + dt_nodelabel(s_partition_node NODELABEL "slot0_partition" REQUIRED) + dt_nodelabel(ns_partition_node NODELABEL "slot0_ns_partition" REQUIRED) + dt_reg_size(s_partition_size PATH ${s_partition_node}) + dt_reg_size(ns_partition_size PATH ${ns_partition_node}) + math(EXPR S_MAX_SECTORS "${s_partition_size} / ${flash_erase_block_size}") + math(EXPR NS_MAX_SECTORS "${ns_partition_size} / ${flash_erase_block_size}") + if(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") + math(EXPR S_NS_MAX_SECTORS "${S_MAX_SECTORS} + ${NS_MAX_SECTORS}") + else() + if(${S_MAX_SECTORS} GREATER ${NS_MAX_SECTORS}) + set(S_NS_MAX_SECTORS ${S_MAX_SECTORS}) + else() + set(S_NS_MAX_SECTORS ${NS_MAX_SECTORS}) + endif() + endif() endif() - function(tfm_sign OUT_ARG SUFFIX PAD INPUT_FILE OUTPUT_FILE) + function(tfm_sign OUT_ARG SUFFIX PAD MAX_SECTORS INPUT_FILE OUTPUT_FILE) if(PAD) set(pad_args --pad --pad-header) endif() @@ -504,6 +523,7 @@ if (CONFIG_BUILD_WITH_TFM) -k ${CONFIG_TFM_KEY_FILE_${SUFFIX}} --public-key-format ${TFM_PUBLIC_KEY_FORMAT} --align ${image_alignment} + --max-sectors ${MAX_SECTORS} -v ${CONFIG_TFM_IMAGE_VERSION_${SUFFIX}} ${pad_args} ${HEX_ADDR_ARGS_${SUFFIX}} @@ -544,7 +564,7 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd S_NS TRUE ${S_NS_FILE} ${S_NS_SIGNED_FILE}) + tfm_sign(sign_cmd S_NS TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -569,12 +589,13 @@ if (CONFIG_BUILD_WITH_TFM) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns NS TRUE ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS FALSE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) endif() - tfm_sign(sign_cmd_s S TRUE $ ${S_SIGNED_FILE}) + tfm_sign(sign_cmd_s S TRUE ${S_NS_MAX_SECTORS} $ + ${S_SIGNED_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands From 5c0dccb158ae1a086fa5a997fd00706731fb0d6a Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Mon, 21 Jul 2025 16:18:31 +0200 Subject: [PATCH 0730/3334] [nrf fromtree] trusted-firmware-m: Define header and trailer options The current behavior when signing an image is to always set --pad and --pad-header for all images unless TFM_USE_NS_APP is set. This does not allow for easy creation of signed images for FOTA applications. Rewrite the PAD parameter as HEADER and TRAILER to simplify the setup of more signing options. Another important reason for this change is that the NS image, when signed without --pad, runs on the hardware but does not perform the MCUboot test, and the FWU never upgrades the image. This fixes the NS image signing process to correctly support TF-M FWU using the PSA API functions. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit b21ea79784d7f02dea8fec6ab33d51a61dd70a1f) --- modules/trusted-firmware-m/CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index a6d645afb4c8..93a04c0db9e2 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -503,9 +503,13 @@ if (CONFIG_BUILD_WITH_TFM) endif() endif() - function(tfm_sign OUT_ARG SUFFIX PAD MAX_SECTORS INPUT_FILE OUTPUT_FILE) - if(PAD) + function(tfm_sign OUT_ARG SUFFIX HEADER TRAILER MAX_SECTORS INPUT_FILE OUTPUT_FILE) + if(HEADER AND TRAILER) set(pad_args --pad --pad-header) + elseif(HEADER) + set(pad_args --pad-header) + elseif(TRAILER) + set(pad_args --pad) endif() # Secure + Non-secure images are signed the same way as a secure only # build, but with a different layout file. @@ -564,7 +568,7 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd S_NS TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) + tfm_sign(sign_cmd S_NS TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -589,12 +593,12 @@ if (CONFIG_BUILD_WITH_TFM) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns NS TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS FALSE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) endif() - tfm_sign(sign_cmd_s S TRUE ${S_NS_MAX_SECTORS} $ + tfm_sign(sign_cmd_s S TRUE TRUE ${S_NS_MAX_SECTORS} $ ${S_SIGNED_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 From c89cc0bc514707088e78380930bff7eb17d113a6 Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Mon, 21 Jul 2025 16:25:23 +0200 Subject: [PATCH 0731/3334] [nrf fromtree] trusted-firmware-m: Set --confirm when signing The current behavior when signing an image adds --pad but does not confirm the image. This appears to be a mistake, as the user should inspect the image status in the Firmware Upgrade software. If an image is not --confirmed, the FSM cannot infer the correct states. This sets the image as confirmed to resolve the issue. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit 6cee10c5b92639d18e35a7ff27e47a460c25cfc0) --- modules/trusted-firmware-m/CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 93a04c0db9e2..a738a49835b7 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -503,7 +503,7 @@ if (CONFIG_BUILD_WITH_TFM) endif() endif() - function(tfm_sign OUT_ARG SUFFIX HEADER TRAILER MAX_SECTORS INPUT_FILE OUTPUT_FILE) + function(tfm_sign OUT_ARG SUFFIX HEADER TRAILER CONFIRM MAX_SECTORS INPUT_FILE OUTPUT_FILE) if(HEADER AND TRAILER) set(pad_args --pad --pad-header) elseif(HEADER) @@ -511,6 +511,10 @@ if (CONFIG_BUILD_WITH_TFM) elseif(TRAILER) set(pad_args --pad) endif() + if(CONFIRM) + # --confirm imply PAD + set(confirm --confirm) + endif() # Secure + Non-secure images are signed the same way as a secure only # build, but with a different layout file. set(layout_file ${PREPROCESSED_FILE_${SUFFIX}}) @@ -530,6 +534,7 @@ if (CONFIG_BUILD_WITH_TFM) --max-sectors ${MAX_SECTORS} -v ${CONFIG_TFM_IMAGE_VERSION_${SUFFIX}} ${pad_args} + ${confirm} ${HEX_ADDR_ARGS_${SUFFIX}} ${ADD_${SUFFIX}_IMAGE_MIN_VER} -s ${CONFIG_TFM_IMAGE_SECURITY_COUNTER} @@ -568,7 +573,7 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd S_NS TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) + tfm_sign(sign_cmd S_NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -593,12 +598,12 @@ if (CONFIG_BUILD_WITH_TFM) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns NS TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) endif() - tfm_sign(sign_cmd_s S TRUE TRUE ${S_NS_MAX_SECTORS} $ + tfm_sign(sign_cmd_s S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} $ ${S_SIGNED_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 From dda50fe19bc7c781aa6dff1b72d5aea2a2e5f55e Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Mon, 21 Jul 2025 16:31:53 +0200 Subject: [PATCH 0732/3334] [nrf fromtree] trusted-firmware-m: Make hex files variables explicit Make variables that define output files explicitly include 'HEX' in the name. This refactoring step allows for the introduction of BIN file generation. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit 69f277cdcb02dbb1ebd2aeb8058dbaae2f4b477a) --- modules/trusted-firmware-m/CMakeLists.txt | 65 ++++++++++++----------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index a738a49835b7..b331b599743b 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -545,84 +545,87 @@ if (CONFIG_BUILD_WITH_TFM) PARENT_SCOPE) endfunction() - set(MERGED_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) - set(S_NS_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) - set(S_NS_SIGNED_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) - set(NS_SIGNED_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) - set(S_SIGNED_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) + set(MERGED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) + set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) + set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) + set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) + set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) if (CONFIG_TFM_USE_NS_APP) # Use the TF-M NS binary as the Non-Secure application firmware image - set(NS_APP_FILE $) + set(NS_HEX_APP_FILE $) else() # Use the Zephyr binary as the Non-Secure application firmware image - set(NS_APP_FILE ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_HEX_NAME}) + set(NS_HEX_APP_FILE ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_HEX_NAME}) endif() if (NOT CONFIG_TFM_BL2) # Merge tfm_s and zephyr (NS) image to a single binary. set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${MERGED_FILE} + -o ${MERGED_HEX_FILE} $ - ${NS_APP_FILE} + ${NS_HEX_APP_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${MERGED_FILE} + ${MERGED_HEX_FILE} ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd S_NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) + tfm_sign(sign_cmd_s_ns_hex S_NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_HEX_FILE} + ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${S_NS_FILE} + -o ${S_NS_HEX_FILE} $ - ${NS_APP_FILE} + ${NS_HEX_APP_FILE} - COMMAND ${sign_cmd} + COMMAND ${sign_cmd_s_ns_hex} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${MERGED_FILE} + -o ${MERGED_HEX_FILE} $<$:$> $<$>:$> - ${S_NS_SIGNED_FILE} + ${S_NS_SIGNED_HEX_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${S_NS_FILE} - ${S_NS_SIGNED_FILE} - ${MERGED_FILE} + ${S_NS_HEX_FILE} + ${S_NS_SIGNED_HEX_FILE} + ${MERGED_HEX_FILE} ) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns_hex NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} + ${NS_SIGNED_HEX_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} + ${NS_SIGNED_HEX_FILE}) endif() - tfm_sign(sign_cmd_s S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} $ - ${S_SIGNED_FILE}) + tfm_sign(sign_cmd_s_hex S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} + $ ${S_SIGNED_HEX_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands - COMMAND ${sign_cmd_ns} - COMMAND ${sign_cmd_s} + COMMAND ${sign_cmd_ns_hex} + COMMAND ${sign_cmd_s_hex} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${MERGED_FILE} + -o ${MERGED_HEX_FILE} $<$:$> $<$>:$> - ${S_SIGNED_FILE} - ${NS_SIGNED_FILE} + ${S_SIGNED_HEX_FILE} + ${NS_SIGNED_HEX_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${S_SIGNED_FILE} - ${NS_SIGNED_FILE} - ${MERGED_FILE} + ${S_SIGNED_HEX_FILE} + ${NS_SIGNED_HEX_FILE} + ${MERGED_HEX_FILE} ) endif() From 454fb7df91b8881be99518c5b595ddd2741432de Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Mon, 21 Jul 2025 18:02:25 +0200 Subject: [PATCH 0733/3334] [nrf fromtree] trusted-firmware-m: Create multi image bin files A fundamental use of Trusted Firmware-M is to provide security for IoT applications, where firmware upgrades (FOTA) are almost always mandatory. The current file signing process does not produce the necessary binaries for multi-image S/NS FWU, since hex images are not suitable for this use case. This introduces the missing signed binary files for use by the FWU partition. The changes were tested in multi-image FWU scenarios, and support for single-image scenarios can be easily added in the future. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit 5b4cd27f553438f89014e29d4e6cf30b47c33cfe) --- modules/trusted-firmware-m/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index b331b599743b..bad05a439730 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -185,7 +185,7 @@ if (CONFIG_BUILD_WITH_TFM) set(TFM_S_ELF_FILE ${TFM_BINARY_DIR}/bin/tfm_s.elf) set(TFM_S_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_s.bin) set(TFM_S_HEX_FILE ${TFM_BINARY_DIR}/bin/tfm_s.hex) - set(TFM_NS_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_ns.bin) + set(TFM_NS_BIN_FILE ${CMAKE_BINARY_DIR}/tfm_ns/bin/tfm_ns.bin) set(TFM_NS_HEX_FILE ${CMAKE_BINARY_DIR}/tfm_ns/bin/tfm_ns.hex) set(TFM_S_SIGNED_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_s_signed.bin) set(TFM_NS_SIGNED_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_ns_signed.bin) @@ -550,13 +550,17 @@ if (CONFIG_BUILD_WITH_TFM) set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) + set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin) + set(S_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.bin) if (CONFIG_TFM_USE_NS_APP) # Use the TF-M NS binary as the Non-Secure application firmware image set(NS_HEX_APP_FILE $) + set(NS_BIN_APP_FILE $) else() # Use the Zephyr binary as the Non-Secure application firmware image set(NS_HEX_APP_FILE ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_HEX_NAME}) + set(NS_BIN_APP_FILE ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_BIN_NAME}) endif() if (NOT CONFIG_TFM_BL2) @@ -601,18 +605,26 @@ if (CONFIG_BUILD_WITH_TFM) if (CONFIG_TFM_USE_NS_APP) tfm_sign(sign_cmd_ns_hex NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} ${NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_ns_bin NS TRUE TRUE FALSE ${S_NS_MAX_SECTORS} ${NS_BIN_APP_FILE} + ${NS_SIGNED_BIN_FILE}) else() tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} ${NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_ns_bin NS FALSE FALSE FALSE ${S_NS_MAX_SECTORS} ${NS_BIN_APP_FILE} + ${NS_SIGNED_BIN_FILE}) endif() tfm_sign(sign_cmd_s_hex S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} $ ${S_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_s_bin S TRUE TRUE FALSE ${S_NS_MAX_SECTORS} + $ ${S_SIGNED_BIN_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${sign_cmd_ns_hex} + COMMAND ${sign_cmd_ns_bin} COMMAND ${sign_cmd_s_hex} + COMMAND ${sign_cmd_s_bin} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py -o ${MERGED_HEX_FILE} @@ -624,7 +636,9 @@ if (CONFIG_BUILD_WITH_TFM) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts ${S_SIGNED_HEX_FILE} + ${S_SIGNED_BIN_FILE} ${NS_SIGNED_HEX_FILE} + ${NS_SIGNED_BIN_FILE} ${MERGED_HEX_FILE} ) endif() From 95f7f3d2db5edb7b12f76bbdeb95894aff88f29a Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Tue, 19 Aug 2025 11:42:16 +0200 Subject: [PATCH 0734/3334] [nrf fromtree] trusted-firmware-m: Use cmake_parse_arguments in tfm_sign Use cmake_parse_arguments() for more idiomatic code. This makes the code more readable and easier to extend with new options. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit 7fe5574fa22f10edd28006288742fef2e5405a1d) --- modules/trusted-firmware-m/CMakeLists.txt | 97 +++++++++++++++-------- 1 file changed, 66 insertions(+), 31 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index bad05a439730..df8843f48749 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -503,45 +503,67 @@ if (CONFIG_BUILD_WITH_TFM) endif() endif() - function(tfm_sign OUT_ARG SUFFIX HEADER TRAILER CONFIRM MAX_SECTORS INPUT_FILE OUTPUT_FILE) - if(HEADER AND TRAILER) + function(tfm_sign OUT_ARG) + set(options HEADER TRAILER CONFIRM) + set(oneValueArgs SUFFIX MAX_SECTORS INPUT_FILE OUTPUT_FILE) + set(multiValueArgs "") + + cmake_parse_arguments( + TFM_SIGN_ARG + "${options}" + "${oneValueArgs}" + "${multiValueArgs}" + ${ARGN} + ) + + if(NOT DEFINED TFM_SIGN_ARG_SUFFIX OR + NOT DEFINED TFM_SIGN_ARG_INPUT_FILE OR + NOT DEFINED TFM_SIGN_ARG_OUTPUT_FILE) + message(FATAL_ERROR "SUFFIX, INPUT_FILE and OUTPUT_FILE are required arguments") + endif() + + set(pad_args "") + if(TFM_SIGN_ARG_HEADER AND TFM_SIGN_ARG_TRAILER) set(pad_args --pad --pad-header) - elseif(HEADER) + elseif(TFM_SIGN_ARG_HEADER) set(pad_args --pad-header) - elseif(TRAILER) + elseif(TFM_SIGN_ARG_TRAILER) set(pad_args --pad) endif() - if(CONFIRM) - # --confirm imply PAD + + set(confirm "") + if(TFM_SIGN_ARG_CONFIRM) set(confirm --confirm) endif() + # Secure + Non-secure images are signed the same way as a secure only # build, but with a different layout file. - set(layout_file ${PREPROCESSED_FILE_${SUFFIX}}) - if(SUFFIX STREQUAL "S_NS") - set(SUFFIX "S") + set(layout_file ${PREPROCESSED_FILE_${TFM_SIGN_ARG_SUFFIX}}) + if(TFM_SIGN_ARG_SUFFIX STREQUAL "S_NS") + set(TFM_SIGN_ARG_SUFFIX "S") endif() - set (${OUT_ARG} + + set(${OUT_ARG} # Add the MCUBoot script to the path so that if there is a version of imgtool in there then # it gets used over the system imgtool. Used so that imgtool from upstream # mcuboot is preferred over system imgtool ${CMAKE_COMMAND} -E env PYTHONPATH=${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts ${PYTHON_EXECUTABLE} ${TFM_MCUBOOT_DIR}/scripts/wrapper/wrapper.py --layout ${layout_file} - -k ${CONFIG_TFM_KEY_FILE_${SUFFIX}} + -k ${CONFIG_TFM_KEY_FILE_${TFM_SIGN_ARG_SUFFIX}} --public-key-format ${TFM_PUBLIC_KEY_FORMAT} --align ${image_alignment} - --max-sectors ${MAX_SECTORS} - -v ${CONFIG_TFM_IMAGE_VERSION_${SUFFIX}} + --max-sectors ${TFM_SIGN_ARG_MAX_SECTORS} + -v ${CONFIG_TFM_IMAGE_VERSION_${TFM_SIGN_ARG_SUFFIX}} ${pad_args} ${confirm} - ${HEX_ADDR_ARGS_${SUFFIX}} - ${ADD_${SUFFIX}_IMAGE_MIN_VER} + ${HEX_ADDR_ARGS_${TFM_SIGN_ARG_SUFFIX}} + ${ADD_${TFM_SIGN_ARG_SUFFIX}_IMAGE_MIN_VER} -s ${CONFIG_TFM_IMAGE_SECURITY_COUNTER} --measured-boot-record -H ${CONFIG_ROM_START_OFFSET} - ${INPUT_FILE} - ${OUTPUT_FILE} + ${TFM_SIGN_ARG_INPUT_FILE} + ${TFM_SIGN_ARG_OUTPUT_FILE} PARENT_SCOPE) endfunction() @@ -577,8 +599,9 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd_s_ns_hex S_NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_HEX_FILE} - ${S_NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" + HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} + INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -603,21 +626,33 @@ if (CONFIG_BUILD_WITH_TFM) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns_hex NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} - ${NS_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_ns_bin NS TRUE TRUE FALSE ${S_NS_MAX_SECTORS} ${NS_BIN_APP_FILE} - ${NS_SIGNED_BIN_FILE}) + tfm_sign(sign_cmd_ns_hex SUFFIX "NS" + HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} + INPUT_FILE ${NS_HEX_APP_FILE} + OUTPUT_FILE ${NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_ns_bin SUFFIX "NS" + HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} + INPUT_FILE ${NS_BIN_APP_FILE} + OUTPUT_FILE ${NS_SIGNED_BIN_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} - ${NS_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_ns_bin NS FALSE FALSE FALSE ${S_NS_MAX_SECTORS} ${NS_BIN_APP_FILE} - ${NS_SIGNED_BIN_FILE}) + tfm_sign(sign_cmd_ns_hex SUFFIX "NS" + TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} + INPUT_FILE ${NS_HEX_APP_FILE} + OUTPUT_FILE ${NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_ns_bin SUFFIX "NS" + MAX_SECTORS ${S_NS_MAX_SECTORS} + INPUT_FILE ${NS_BIN_APP_FILE} + OUTPUT_FILE ${NS_SIGNED_BIN_FILE}) endif() - tfm_sign(sign_cmd_s_hex S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} - $ ${S_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_s_bin S TRUE TRUE FALSE ${S_NS_MAX_SECTORS} - $ ${S_SIGNED_BIN_FILE}) + tfm_sign(sign_cmd_s_hex SUFFIX "S" + HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} + INPUT_FILE $ + OUTPUT_FILE ${S_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_s_bin SUFFIX "S" + HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} + INPUT_FILE $ + OUTPUT_FILE ${S_SIGNED_BIN_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands From 16248e3f5ad717507f36859b6692f9ee3b7976a7 Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Tue, 23 Sep 2025 09:00:16 +0200 Subject: [PATCH 0735/3334] [nrf fromtree] trusted-firmware-m: Prepare to generate tfm_merged.bin When CONFIG_TFM_MCUBOOT_IMAGE_NUMBER is 1, the process to create the final tfm_merged.bin file is more complex. This prepares the content to introduce the generation of tfm_merged.bin for use in FOTA applications. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit d1534c539526d60f6c38140a8a253668c5c0f25b) --- modules/trusted-firmware-m/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index df8843f48749..bc5a847bac0c 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -568,8 +568,8 @@ if (CONFIG_BUILD_WITH_TFM) endfunction() set(MERGED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) - set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) - set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) + set(S_NS_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed.hex) + set(S_NS_SIGNED_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed_signed.hex) set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin) @@ -599,28 +599,28 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" + tfm_sign(sign_cmd_s_ns_confirm_hex SUFFIX "S_NS" HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) + INPUT_FILE ${S_NS_CONFIRMED_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${S_NS_HEX_FILE} + -o ${S_NS_CONFIRMED_HEX_FILE} $ ${NS_HEX_APP_FILE} - COMMAND ${sign_cmd_s_ns_hex} + COMMAND ${sign_cmd_s_ns_confirm_hex} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py -o ${MERGED_HEX_FILE} $<$:$> $<$>:$> - ${S_NS_SIGNED_HEX_FILE} + ${S_NS_SIGNED_CONFIRMED_HEX_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${S_NS_HEX_FILE} - ${S_NS_SIGNED_HEX_FILE} + ${S_NS_CONFIRMED_HEX_FILE} + ${S_NS_SIGNED_CONFIRMED_HEX_FILE} ${MERGED_HEX_FILE} ) From 4b3e3125029f3370087d172266c9ea527f4ef97e Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Tue, 23 Sep 2025 09:49:22 +0200 Subject: [PATCH 0736/3334] [nrf fromtree] trusted-firmware-m: Generate tfm_merged.bin When CONFIG_TFM_MCUBOOT_IMAGE_NUMBER is 1, all images are merged. Currently, there is no tfm_merged.bin file for use in FOTA. This adds file generation to fulfill that requirement. Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit bbc73af78f187b1daab0dd4a3cca92cb28a87999) --- modules/trusted-firmware-m/CMakeLists.txt | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index bc5a847bac0c..0e10598c9c75 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -568,8 +568,11 @@ if (CONFIG_BUILD_WITH_TFM) endfunction() set(MERGED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) + set(MERGED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.bin) set(S_NS_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed.hex) set(S_NS_SIGNED_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed_signed.hex) + set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) + set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin) @@ -602,6 +605,9 @@ if (CONFIG_BUILD_WITH_TFM) tfm_sign(sign_cmd_s_ns_confirm_hex SUFFIX "S_NS" HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} INPUT_FILE ${S_NS_CONFIRMED_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) + tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" + HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} + INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -618,10 +624,28 @@ if (CONFIG_BUILD_WITH_TFM) ${S_NS_SIGNED_CONFIRMED_HEX_FILE} ) + set_property(GLOBAL APPEND PROPERTY extra_post_build_commands + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py + -o ${S_NS_HEX_FILE} + $ + ${NS_HEX_APP_FILE} + + COMMAND ${sign_cmd_s_ns_hex} + + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py + -o ${MERGED_BIN_FILE} --output-bin + $<$:$> + $<$>:$> + ${S_NS_SIGNED_HEX_FILE} + ) + set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts ${S_NS_CONFIRMED_HEX_FILE} ${S_NS_SIGNED_CONFIRMED_HEX_FILE} + ${S_NS_HEX_FILE} + ${S_NS_SIGNED_HEX_FILE} ${MERGED_HEX_FILE} + ${MERGED_BIN_FILE} ) else() From dd0806832f39000cf61d30d2e7635015c1c0cf96 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sun, 2 Nov 2025 16:45:45 +1000 Subject: [PATCH 0737/3334] [nrf fromtree] modules: tf-m: fix CMake formatting Fix formatting errors that cause CI to complain. Signed-off-by: Jordan Yates (cherry picked from commit 2219a875b25093920768eda63ddc54ae5e7a925e) --- modules/trusted-firmware-m/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 0e10598c9c75..ff965457da42 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -319,8 +319,8 @@ if (CONFIG_BUILD_WITH_TFM) # number of parallel jobs to 1. set(PARALLEL_JOBS -j 1) else() - # Leave PARALLEL_JOBS unset and use the default number of - # threads. Which is num_cores+2 on Ninja and MAKEFLAGS with Make. + # Leave PARALLEL_JOBS unset and use the default number of + # threads. Which is num_cores+2 on Ninja and MAKEFLAGS with Make. endif() set(tfm_image_info MAP "name: tfm, source-dir: ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}") From e72f74202a801f7c3de683b0c3fb389af854a998 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sun, 2 Nov 2025 16:23:25 +1000 Subject: [PATCH 0738/3334] [nrf fromtree] modules: tf-m: remove `S_NS_CONFIRMED_HEX_FILE` `S_NS_CONFIRMED_HEX_FILE` was never generating a confirmed file, just the same file contents as `S_NS_HEX_FILE`. Since no logic needs a confirmed merge of `tfm_s.hex` and `zephyr.hex`, just remove the logic instead of fixing it. Signed-off-by: Jordan Yates (cherry picked from commit 15e8305ce9d3f131bae5dc46a1f1a410c7d82793) --- modules/trusted-firmware-m/CMakeLists.txt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index ff965457da42..6ffefd6b93c0 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -569,7 +569,6 @@ if (CONFIG_BUILD_WITH_TFM) set(MERGED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) set(MERGED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.bin) - set(S_NS_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed.hex) set(S_NS_SIGNED_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed_signed.hex) set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) @@ -604,14 +603,14 @@ if (CONFIG_BUILD_WITH_TFM) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") tfm_sign(sign_cmd_s_ns_confirm_hex SUFFIX "S_NS" HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${S_NS_CONFIRMED_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) + INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${S_NS_CONFIRMED_HEX_FILE} + -o ${S_NS_HEX_FILE} $ ${NS_HEX_APP_FILE} @@ -625,11 +624,6 @@ if (CONFIG_BUILD_WITH_TFM) ) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands - COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${S_NS_HEX_FILE} - $ - ${NS_HEX_APP_FILE} - COMMAND ${sign_cmd_s_ns_hex} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -640,7 +634,6 @@ if (CONFIG_BUILD_WITH_TFM) ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${S_NS_CONFIRMED_HEX_FILE} ${S_NS_SIGNED_CONFIRMED_HEX_FILE} ${S_NS_HEX_FILE} ${S_NS_SIGNED_HEX_FILE} From 4bef51034ff0d5b936a63c3fa28dcfad506c08c7 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sun, 2 Nov 2025 16:26:47 +1000 Subject: [PATCH 0739/3334] [nrf fromtree] modules: tf-m: generate `tfm_s_zephyr_ns_signed.bin` Generate a binary version of `tfm_s_zephyr_ns_signed.hex` with objcopy. This file is valid for performing OTA upgrades, unlike `tfm_merged.bin`, which contains BL2. Signed-off-by: Jordan Yates (cherry picked from commit db339e46b510af313267b3db2641e5fd2ecaff44) --- modules/trusted-firmware-m/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 6ffefd6b93c0..934dd47b06d2 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -572,6 +572,7 @@ if (CONFIG_BUILD_WITH_TFM) set(S_NS_SIGNED_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed_signed.hex) set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) + set(S_NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.bin) set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin) @@ -631,6 +632,8 @@ if (CONFIG_BUILD_WITH_TFM) $<$:$> $<$>:$> ${S_NS_SIGNED_HEX_FILE} + + COMMAND ${CMAKE_OBJCOPY} --input-target=ihex --output-target=binary ${S_NS_SIGNED_HEX_FILE} ${S_NS_SIGNED_BIN_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts From b2030949c3671dd07f0fa62057819b21efc7f9a5 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sun, 2 Nov 2025 16:28:37 +1000 Subject: [PATCH 0740/3334] [nrf fromtree] modules: tf-m: generate `tfm_merged.bin` from `tfm_merged.hex` Since `tfm_merged.bin` now contains BL2, it can only be used for the same purposes as `tfm_merged.hex` (intial firmware loading). Therefore it should be using the confirmed images that `tfm_merged.hex` does. Since the only difference between the two files with that change is now the output format, we can directly generate `tfm_merged.bin` from `tfm_merged.hex` with `objcopy` instead of going through `mergehex.py`. Signed-off-by: Jordan Yates (cherry picked from commit 74a23eacd540c4e16317d56bf0a8fd0a6088e935) --- modules/trusted-firmware-m/CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 934dd47b06d2..afebaaf0ea1e 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -622,17 +622,13 @@ if (CONFIG_BUILD_WITH_TFM) $<$:$> $<$>:$> ${S_NS_SIGNED_CONFIRMED_HEX_FILE} + + COMMAND ${CMAKE_OBJCOPY} --input-target=ihex --output-target=binary ${MERGED_HEX_FILE} ${MERGED_BIN_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${sign_cmd_s_ns_hex} - COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${MERGED_BIN_FILE} --output-bin - $<$:$> - $<$>:$> - ${S_NS_SIGNED_HEX_FILE} - COMMAND ${CMAKE_OBJCOPY} --input-target=ihex --output-target=binary ${S_NS_SIGNED_HEX_FILE} ${S_NS_SIGNED_BIN_FILE} ) @@ -640,6 +636,7 @@ if (CONFIG_BUILD_WITH_TFM) ${S_NS_SIGNED_CONFIRMED_HEX_FILE} ${S_NS_HEX_FILE} ${S_NS_SIGNED_HEX_FILE} + ${S_NS_SIGNED_BIN_FILE} ${MERGED_HEX_FILE} ${MERGED_BIN_FILE} ) From 7a7e6050499a7e34cfe5886dc2fa4bfc3726892a Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Wed, 14 Aug 2024 16:22:00 +1000 Subject: [PATCH 0741/3334] [nrf fromtree] modules: tfm: disable SECURE_UART when TFM_LOG_LEVEL_SILENCE Explicitly disable the SECURE_UART TFM define when `CONFIG_TFM_LOG_LEVEL_SILENCE=y`. The secure UART is only enabled by default on nRF platforms to match the current TF-M defaults. Signed-off-by: Jordan Yates (cherry picked from commit 9366e4a48eb9879ea9115c7eea424dc311b372a0) --- doc/releases/migration-guide-4.4.rst | 7 +++++++ modules/trusted-firmware-m/CMakeLists.txt | 6 ++++++ modules/trusted-firmware-m/Kconfig.tfm | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 762082635b1c..6919f84e875c 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -57,5 +57,12 @@ Other subsystems Modules ******* +Trusted Firmware-M +================== + +* The ``SECURE_UART1`` TF-M define is now controlled by Zephyr's + :kconfig:option:`CONFIG_TFM_SECURE_UART`. This option will override any platform values previously + specified in the TF-M repository. + Architectures ************* diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index afebaaf0ea1e..95e034f19532 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -156,6 +156,12 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DTFM_SPM_LOG_LEVEL=${TFM_SPM_LOG_LEVEL}) endif() + if(CONFIG_TFM_SECURE_UART) + list(APPEND TFM_CMAKE_ARGS -DSECURE_UART1=1) + else() + list(APPEND TFM_CMAKE_ARGS -DSECURE_UART1=0) + endif() + # Enable TFM partitions as specified in Kconfig foreach(partition ${TFM_VALID_PARTITIONS}) if (CONFIG_${partition}) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index f587ea01e45f..6a8140b23d5a 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -475,6 +475,15 @@ config TFM_SPM_LOG_LEVEL_SILENCE bool "Off" endchoice +config TFM_SECURE_UART + bool "TF-M configure UART instance as secure peripheral" + default y if SOC_FAMILY_NORDIC_NRF && !TFM_LOG_LEVEL_SILENCE + help + Configure the UART instance as a secure peripheral for TF-M logging. + This makes the UART instance unavailable to the non-secure application. + When this option is selected the device tree node for the UART instance + needs to be disabled for the non-secure application. + config TFM_EXCEPTION_INFO_DUMP bool "TF-M exception info dump" default y From 32c8db8cd8fbdb589d789b5ed07ee64019bb0a1b Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 4 Dec 2025 11:36:15 +1000 Subject: [PATCH 0742/3334] [nrf fromtree] modules: tfm: don't pad unconfirmed image If the image is not confirmed, there is no need to pad the entire flash slot with empty data. This reduces the size of `tfm_s_zephyr_ns.signed.bin` (the file actually sent for an OTA upgrade) from 100% of the slot size down to the size of the application. Signed-off-by: Jordan Yates (cherry picked from commit 6fe6a8bbb473a180299793d4be7d9443f36d441c) --- modules/trusted-firmware-m/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 95e034f19532..0fc884cf79fa 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -612,7 +612,7 @@ if (CONFIG_BUILD_WITH_TFM) HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" - HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} + HEADER MAX_SECTORS ${S_NS_MAX_SECTORS} INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands From 5f818fb49e0be65721e9510ca5f7617c762e2574 Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Thu, 28 Aug 2025 15:14:10 +0300 Subject: [PATCH 0743/3334] [nrf fromtree] manifest: psa-arch-tests: update to 24.03_API1.6_CRYPTO_1.1.0 Fixup to the TF-M 2.2.0 update. Signed-off-by: Tomi Fontanilles (cherry picked from commit b8aa511424c1850e41f9270711f18b2f5869c8ed) --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 57ad7affdd1c..724ab8d1fb30 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -23,7 +23,7 @@ manifest: groups: - optional - name: psa-arch-tests - revision: 2cadb02a72eacda7042505dcbdd492371e8ce024 + revision: 10fd24782323fc3faf6c787959f4a9d4130bedb8 path: modules/tee/tf-m/psa-arch-tests remote: upstream groups: From cbb84932bce92a3399c936a497185cb5cc6d3191 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 27 Jul 2025 18:44:24 -0700 Subject: [PATCH 0744/3334] [nrf fromtree] modules/psa-arch-tests: Add GCC 14.3 support patch psa-arch-tests includes device drivers that failed to mark registers with 'volatile'. GCC 14.3 cleverly optimized sequential register accesses using strd/ldrd instructions which caused the drivers to fail. Move the psa-arch-tests repository forward to the version which includes a fix for this. Signed-off-by: Keith Packard (cherry picked from commit 5505c0d7ad38ce053f9f589604f7ec01fff3ba94) --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 724ab8d1fb30..04accf4152c0 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -23,7 +23,7 @@ manifest: groups: - optional - name: psa-arch-tests - revision: 10fd24782323fc3faf6c787959f4a9d4130bedb8 + revision: 87b08682a111ebb085cd8b1ea41d603191d6d146 path: modules/tee/tf-m/psa-arch-tests remote: upstream groups: From 81746f3e0e16abd6f7c9197bf14077c895c89d1f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 24 Oct 2025 08:40:38 -0700 Subject: [PATCH 0745/3334] [nrf fromtree] west: Sync picolibc with SDK 0.17.4 This updates the version of picolibc to match that used by SDK 0.17.4. In the Zephyr picolibc fork, that's marked with the zephyr-sdk-0.17.4 tag now, which is on the zephyr-sdk-0.17 branch. Changes since the previous version which impact using the module: * machine/arm: Disable exception tables in ARM string asm code * cmake: Silence messages about core-isa.h * Correct return type of __non_atomic_*_ungetc functions * Delete obsoleted _syslist.h Signed-off-by: Keith Packard (cherry picked from commit 046232a6497463162fb846da4ba889ad1feff6cf) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index ad7e9a53ca14..3b0aa0870733 100644 --- a/west.yml +++ b/west.yml @@ -352,7 +352,7 @@ manifest: - debug - name: picolibc path: modules/lib/picolibc - revision: 560946f26db075c296beea5b39d99e6de43c9010 + revision: ca8b6ebba5226a75545e57a140443168a26ba664 - name: segger revision: cf56b1d9c80f81a26e2ac5727c9cf177116a4692 path: modules/debug/segger From aae5fd0e4608d7740f1a22a29550e1476b9ae038 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 20 Oct 2025 10:58:49 -0400 Subject: [PATCH 0746/3334] [nrf fromtree] manifest: optional: remove sof from optional manifest Nothing in Zephyr uses SOF, it is the other way round, SOF uses Zephyr, creating a cyclic dependency in some cases making it difficult to apply changes to areas used by SOF upstream. Part of #91061 Signed-off-by: Anas Nashif (cherry picked from commit 1a780f933e1da387a28bcfcca4038db6b6c13c5f) --- MAINTAINERS.yml | 14 -------------- modules/Kconfig | 1 - modules/Kconfig.sof | 11 ----------- submanifests/optional.yaml | 6 ------ 4 files changed, 32 deletions(-) delete mode 100644 modules/Kconfig.sof diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 2018a6ed356b..f689445af543 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -5803,20 +5803,6 @@ West: labels: - "area: Debugging" -"West project: sof": - status: maintained - maintainers: - - kv2019i - collaborators: - - andyross - - nashif - - lyakh - - lgirdwood - files: - - modules/Kconfig.sof - labels: - - "area: Audio" - "West project: tf-m-tests": status: maintained maintainers: diff --git a/modules/Kconfig b/modules/Kconfig index b66955981fa0..cd29dc3ccc88 100644 --- a/modules/Kconfig +++ b/modules/Kconfig @@ -36,7 +36,6 @@ source "modules/Kconfig.picolibc" source "modules/Kconfig.renesas" source "modules/Kconfig.rust" source "modules/Kconfig.simplelink" -source "modules/Kconfig.sof" source "modules/Kconfig.stm32" source "modules/Kconfig.syst" source "modules/Kconfig.telink" diff --git a/modules/Kconfig.sof b/modules/Kconfig.sof deleted file mode 100644 index 4a0b94186606..000000000000 --- a/modules/Kconfig.sof +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2020 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -config ZEPHYR_SOF_MODULE - bool - -config SOF - bool "Sound Open Firmware (SOF)" - depends on ZEPHYR_SOF_MODULE - help - Build Sound Open Firmware (SOF) support. diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 04accf4152c0..322a37871bc7 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -28,12 +28,6 @@ manifest: remote: upstream groups: - optional - - name: sof - revision: ba8de7551f88a4f8d4533791274fa85b37ec332e - path: modules/audio/sof - remote: upstream - groups: - - optional - name: tf-m-tests revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 path: modules/tee/tf-m/tf-m-tests From 0b4c20513d1a1439bb7aeb03725271178c83e982 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 22 Oct 2025 07:03:19 -0400 Subject: [PATCH 0747/3334] [nrf fromtree] intel_adsp: remove workaround for SOF setting core count During transition to HWMv2 this workaround was added, which should instead be in SOF and not in Zephyr, as CORE_COUNT is a SOF Kconfig. Remove this and instead set the CORE_COUNT in SOF to the MP_MAX_NUM_CPUS. Signed-off-by: Anas Nashif (cherry picked from commit 71ec5df8f31fd4b386d5f9582fd66403c861069c) --- soc/intel/intel_adsp/Kconfig.defconfig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/soc/intel/intel_adsp/Kconfig.defconfig b/soc/intel/intel_adsp/Kconfig.defconfig index 1d8312e7fb6c..f69bc31cd8c7 100644 --- a/soc/intel/intel_adsp/Kconfig.defconfig +++ b/soc/intel/intel_adsp/Kconfig.defconfig @@ -8,11 +8,6 @@ if SOC_FAMILY_INTEL_ADSP rsource "*/Kconfig.defconfig.series" # A workaround for HWMv2 to recover SOF arch/xtensa defaults overridden by arch/host. -if SOF -config CORE_COUNT - int - default MP_MAX_NUM_CPUS -endif config XTENSA_RPO_CACHE def_bool y From 7e6b3e0b3b2dd7ab62e1a2a38aff1610a4295254 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 22 Oct 2025 07:38:10 -0400 Subject: [PATCH 0748/3334] [nrf fromtree] west_commands: do not depend on CONFIG_SOF Do not depend on SOF config, use RIMAGE_SCHEMA instead, defined in SOF. Signed-off-by: Anas Nashif (cherry picked from commit 95b48cd5ba7af5b33f01568e9771d6868cf29d3e) --- scripts/west_commands/sign.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/west_commands/sign.py b/scripts/west_commands/sign.py index c6fa273138e5..c90361a1447b 100644 --- a/scripts/west_commands/sign.py +++ b/scripts/west_commands/sign.py @@ -585,8 +585,8 @@ def sign(self, command, build_dir, build_conf, formats): # Non-SOF build does not have extended manifest data for # rimage to process, which might result in rimage error. # So skip it when not doing SOF builds. - is_sof_build = build_conf.getboolean('CONFIG_SOF') - if not is_sof_build: + rimage_schema = build_conf.get('CONFIG_RIMAGE_SIGNING_SCHEMA', None) + if rimage_schema is None: no_manifest = True self.generate_uuid_registry() From 20624439864ce673025781c7e344a650319bde29 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 3 Jun 2025 10:19:20 -0700 Subject: [PATCH 0749/3334] [nrf fromtree] soc: intel_adsp: remove IDC dt default for CONFIG_INTEL_ADSP_IPC The SoC specific IPC driver is for host IPC, and not IDC (which is between CPUs). So there is no need to use the IDC devicetree binding to enable the kconfig. Signed-off-by: Daniel Leung (cherry picked from commit d910306fd00671a4e9df21131a723e4aa9a6d749) --- soc/intel/intel_adsp/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/soc/intel/intel_adsp/Kconfig b/soc/intel/intel_adsp/Kconfig index 27a8e838b67b..7e827efad522 100644 --- a/soc/intel/intel_adsp/Kconfig +++ b/soc/intel/intel_adsp/Kconfig @@ -33,12 +33,10 @@ config INTEL_ADSP_SIM_NO_SECONDARY_CORE_FLOW endif # INTEL_ADSP_SIM DT_COMPAT_INTEL_ADSP_HOST_IPC := intel,adsp-host-ipc -DT_COMPAT_INTEL_ADSP_IDC := intel,adsp-idc config INTEL_ADSP_IPC bool "Driver for the host IPC interrupt delivery" default $(dt_compat_enabled,$(DT_COMPAT_INTEL_ADSP_HOST_IPC)) if !SOF - default $(dt_compat_enabled,$(DT_COMPAT_INTEL_ADSP_IDC)) if !SOF help Driver for the host IPC interrupt delivery mechanism. Currently SOF has its own driver for this hardware. From 93b37e276b473dae8266e696f94ac823b51c0372 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 12 Sep 2025 15:22:56 -0700 Subject: [PATCH 0750/3334] [nrf fromtree] soc: intel_adsp: rework host IPC using IPC service This reworks the Intel audio DSP host IPC driver as a backend of the IPC service. This is the first step to rework IPC in SOF (Sound Open Firmware) into using a more generic IPC API instead of a SoC specific one. For now, it keeps the old interface to maintain usability as it is going to be a multiple process to rework IPC over there. Also, the structure of the new IPC backend resembles the SoC specific driver to make it easier to compare between them at this first iteration. Future optimizations will probably be needed once we start modifying the SOF side to utilize the IPC interface. Signed-off-by: Daniel Leung (cherry picked from commit cf7e2e63c17aab88289637ebc691003de1c8b628) --- .../zephyr/ipc/backends/intel_adsp_host_ipc.h | 213 ++++++++ soc/intel/intel_adsp/Kconfig | 17 +- soc/intel/intel_adsp/common/CMakeLists.txt | 2 +- .../common/include/intel_adsp_ipc.h | 117 +---- soc/intel/intel_adsp/common/ipc.c | 345 +++---------- .../ipc/ipc_service/backends/CMakeLists.txt | 1 + subsys/ipc/ipc_service/backends/Kconfig | 1 + .../ipc_service/backends/Kconfig.intel_adsp | 11 + .../backends/ipc_intel_adsp_host_ipc.c | 464 ++++++++++++++++++ 9 files changed, 789 insertions(+), 382 deletions(-) create mode 100644 include/zephyr/ipc/backends/intel_adsp_host_ipc.h create mode 100644 subsys/ipc/ipc_service/backends/Kconfig.intel_adsp create mode 100644 subsys/ipc/ipc_service/backends/ipc_intel_adsp_host_ipc.c diff --git a/include/zephyr/ipc/backends/intel_adsp_host_ipc.h b/include/zephyr/ipc/backends/intel_adsp_host_ipc.h new file mode 100644 index 000000000000..74938e53c86f --- /dev/null +++ b/include/zephyr/ipc/backends/intel_adsp_host_ipc.h @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2022, 2025 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_IPC_BACKEND_INTEL_ADSP_IPC_H +#define ZEPHYR_INCLUDE_IPC_BACKEND_INTEL_ADSP_IPC_H + +#include +#include +#include +#include + +#include + +/** Enum on IPC send length argument to indicate IPC message type. */ +enum intel_adsp_send_len { + /** Normal IPC message. */ + INTEL_ADSP_IPC_SEND_MSG, + + /** Synchronous IPC message. */ + INTEL_ADSP_IPC_SEND_MSG_SYNC, + + /** Emergency IPC message. */ + INTEL_ADSP_IPC_SEND_MSG_EMERGENCY, + + /** Send a DONE message. */ + INTEL_ADSP_IPC_SEND_DONE, + + /** Query backend to see if IPC is complete. */ + INTEL_ADSP_IPC_SEND_IS_COMPLETE, +}; + +/** Enum on callback return values. */ +enum intel_adsp_cb_ret { + /** Callback return to indicate no issue. Must be 0. */ + INTEL_ADSP_IPC_CB_RET_OKAY = 0, + + /** Callback return to signal needing external completion. */ + INTEL_ADSP_IPC_CB_RET_EXT_COMPLETE, +}; + +/** Enum on callback length argument to indicate which triggers the callback. */ +enum intel_adsp_cb_len { + /** Callback length to indicate this is an IPC message. */ + INTEL_ADSP_IPC_CB_MSG, + + /** Callback length to indicate this is a DONE message. */ + INTEL_ADSP_IPC_CB_DONE, +}; + +/** Struct for IPC message descriptor. */ +struct intel_adsp_ipc_msg { + /** Header specific to platform. */ + uint32_t data; + + /** Extension specific to platform. */ + uint32_t ext_data; + + /** Timeout for sending synchronuous message. */ + k_timeout_t timeout; +}; + +#ifdef CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE + +/** + * @brief Intel ADSP IPC Message Handler Callback. + * + * This function, once registered via intel_adsp_ipc_set_message_handler(), + * is invoked in interrupt context to service messages sent from the + * foreign/connected IPC context. The message contents of the TDR and + * TDD registers are provided in the data/ext_data argument. + * + * The function should return true if processing of the message is + * complete and return notification to the other side (via the TDA + * register) is desired immediately. Returning false means that no + * return "DONE" interrupt will occur until intel_adsp_ipc_complete() is + * called on this device at some point in the future. + * + * @note Further messages on the link will not be transmitted or + * received while an in-progress message remains incomplete! + * + * @param dev IPC device. + * @param arg Registered argument from intel_adsp_ipc_set_message_handler(). + * @param data Message data from other side (low bits of TDR register). + * @param ext_dat Extended message data (TDD register). + * @return true if the message is completely handled. + */ +typedef bool (*intel_adsp_ipc_handler_t)(const struct device *dev, void *arg, uint32_t data, + uint32_t ext_data); + +/** + * @brief Intel ADSP IPC Message Complete Callback. + * + * This function, once registered via intel_adsp_ipc_set_done_handler(), is + * invoked in interrupt context when a "DONE" return interrupt is + * received from the other side of the connection (indicating that a + * previously sent message is finished processing). + * + * @note On Intel ADSP hardware the DONE interrupt is transmitted + * synchronously with the interrupt being cleared on the remote + * device. It is not possible to delay processing. This callback + * will still occur, but protocols which rely on notification of + * asynchronous command processing will need modification. + * + * @param dev IPC device. + * @param arg Registered argument from intel_adsp_ipc_set_done_handler(). + * @return True if IPC completion will be done externally, otherwise false. + * @note Returning True will cause this API to skip writing IPC registers + * signalling IPC message completion and those actions should be done by + * external code manually. Returning false from the handler will perform + * writing to IPC registers signalling message completion normally by this API. + */ +typedef bool (*intel_adsp_ipc_done_t)(const struct device *dev, void *arg); + +#endif /* CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE */ + +#ifdef CONFIG_PM_DEVICE +typedef int (*intel_adsp_ipc_resume_handler_t)(const struct device *dev, void *arg); + +typedef int (*intel_adsp_ipc_suspend_handler_t)(const struct device *dev, void *arg); +#endif /* CONFIG_PM_DEVICE */ + +/** + * Intel Audio DSP IPC service backend config struct. + */ +struct intel_adsp_ipc_config { + /** Pointer to hardware register block. */ + volatile struct intel_adsp_ipc *regs; +}; + +/** + * Intel Audio DSP IPC service backend data struct. + */ +struct intel_adsp_ipc_data { + /** Semaphore used to wait for remote acknowledgment of sent message. */ + struct k_sem sem; + + /** General driver lock. */ + struct k_spinlock lock; + + /** Pending TX acknowlegement. */ + bool tx_ack_pending; + + /** Pointer to endpoint configuration. */ + const struct ipc_ept_cfg *ept_cfg; + +#ifdef CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE + /** Callback for message handler. */ + intel_adsp_ipc_handler_t handle_message; + + /** Argument for message handler callback. */ + void *handler_arg; + + /** Callback for done notification. */ + intel_adsp_ipc_done_t done_notify; + + /** Argument for done notification callback. */ + void *done_arg; +#endif /* CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE */ + +#ifdef CONFIG_PM_DEVICE + /** Pointer to resume handler. */ + intel_adsp_ipc_resume_handler_t resume_fn; + + /** Argument for resume handler. */ + void *resume_fn_args; + + /** Pointer to suspend handler. */ + intel_adsp_ipc_suspend_handler_t suspend_fn; + + /** Argument for suspend handler. */ + void *suspend_fn_args; +#endif /* CONFIG_PM_DEVICE */ +}; + +/** + * Endpoint private data struct. + */ +struct intel_adsp_ipc_ept_priv_data { + /** Callback return value (enum intel_adsp_cb_ret). */ + int cb_ret; + + /** Pointer to additional private data. */ + void *priv; +}; + +#ifdef CONFIG_PM_DEVICE + +/** + * @brief Registers resume callback handler used to resume Device from suspended state. + * + * @param dev IPC device. + * @param fn Callback function. + * @param arg Value to pass as the "arg" parameter to the function. + */ +void intel_adsp_ipc_set_resume_handler(const struct device *dev, intel_adsp_ipc_resume_handler_t fn, + void *arg); + +/** + * @brief Registers suspend callback handler used to suspend active Device. + * + * @param dev IPC device. + * @param fn Callback function. + * @param arg Value to pass as the "arg" parameter to the function. + */ +void intel_adsp_ipc_set_suspend_handler(const struct device *dev, + intel_adsp_ipc_suspend_handler_t fn, void *arg); + +#endif /* CONFIG_PM_DEVICE */ + +#endif /* ZEPHYR_INCLUDE_IPC_BACKEND_INTEL_ADSP_IPC_H */ diff --git a/soc/intel/intel_adsp/Kconfig b/soc/intel/intel_adsp/Kconfig index 7e827efad522..7523f167fad2 100644 --- a/soc/intel/intel_adsp/Kconfig +++ b/soc/intel/intel_adsp/Kconfig @@ -11,6 +11,7 @@ config SOC_FAMILY_INTEL_ADSP select ARCH_HAS_USERSPACE if XTENSA_MMU imply XTENSA_MMU_DOUBLE_MAP select CPU_CACHE_INCOHERENT + select IPC_SERVICE if DT_HAS_INTEL_ADSP_HOST_IPC_ENABLED if SOC_FAMILY_INTEL_ADSP @@ -32,14 +33,20 @@ config INTEL_ADSP_SIM_NO_SECONDARY_CORE_FLOW endif # INTEL_ADSP_SIM -DT_COMPAT_INTEL_ADSP_HOST_IPC := intel,adsp-host-ipc - config INTEL_ADSP_IPC bool "Driver for the host IPC interrupt delivery" - default $(dt_compat_enabled,$(DT_COMPAT_INTEL_ADSP_HOST_IPC)) if !SOF + select DEPRECATED + help + Deprecated config for IPC. Will be removed in the future. + +config INTEL_ADSP_IPC_OLD_INTERFACE + bool "Expose old interface for the IPC" + depends on IPC_SERVICE_BACKEND_INTEL_ADSP_HOST_IPC + default y + select INTEL_ADSP_IPC help - Driver for the host IPC interrupt delivery mechanism. - Currently SOF has its own driver for this hardware. + Expose the old IPC interface (intel_adsp_ipc_* functions) to + maintain backward compatibility. config MEMORY_WIN_0_SIZE int "Size of memory window 0" diff --git a/soc/intel/intel_adsp/common/CMakeLists.txt b/soc/intel/intel_adsp/common/CMakeLists.txt index a39e9ea98e77..9e49bd26eabe 100644 --- a/soc/intel/intel_adsp/common/CMakeLists.txt +++ b/soc/intel/intel_adsp/common/CMakeLists.txt @@ -9,7 +9,7 @@ zephyr_library_named(intel_adsp_common) zephyr_include_directories(include) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) -zephyr_library_sources_ifdef(CONFIG_INTEL_ADSP_IPC ipc.c) +zephyr_library_sources_ifdef(CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE ipc.c) zephyr_library_sources_ifdef(CONFIG_GDBSTUB gdbstub_backend_sram.c diff --git a/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h b/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h index 1f283466a735..30a8f81360e2 100644 --- a/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h +++ b/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h @@ -9,69 +9,9 @@ #include #include -struct intel_adsp_ipc_config { - volatile struct intel_adsp_ipc *regs; -}; +#include -/** - * @brief Intel ADSP IPC Message Handler Callback. - * - * This function, once registered via intel_adsp_ipc_set_message_handler(), - * is invoked in interrupt context to service messages sent from the - * foreign/connected IPC context. The message contents of the TDR and - * TDD registers are provided in the data/ext_data argument. - * - * The function should return true if processing of the message is - * complete and return notification to the other side (via the TDA - * register) is desired immediately. Returning false means that no - * return "DONE" interrupt will occur until intel_adsp_ipc_complete() is - * called on this device at some point in the future. - * - * @note Further messages on the link will not be transmitted or - * received while an in-progress message remains incomplete! - * - * @param dev IPC device. - * @param arg Registered argument from intel_adsp_ipc_set_message_handler(). - * @param data Message data from other side (low bits of TDR register). - * @param ext_dat Extended message data (TDD register). - * @return true if the message is completely handled. - */ -typedef bool (*intel_adsp_ipc_handler_t)(const struct device *dev, void *arg, - uint32_t data, uint32_t ext_data); - -/** - * @brief Intel ADSP IPC Message Complete Callback. - * - * This function, once registered via intel_adsp_ipc_set_done_handler(), is - * invoked in interrupt context when a "DONE" return interrupt is - * received from the other side of the connection (indicating that a - * previously sent message is finished processing). - * - * @note On Intel ADSP hardware the DONE interrupt is transmitted - * synchronously with the interrupt being cleared on the remote - * device. It is not possible to delay processing. This callback - * will still occur, but protocols which rely on notification of - * asynchronous command processing will need modification. - * - * @param dev IPC device. - * @param arg Registered argument from intel_adsp_ipc_set_done_handler(). - * @return True if IPC completion will be done externally, otherwise false. - * @note Returning True will cause this API to skip writing IPC registers - * signalling IPC message completion and those actions should be done by - * external code manually. Returning false from the handler will perform - * writing to IPC registers signalling message completion normally by this API. - */ -typedef bool (*intel_adsp_ipc_done_t)(const struct device *dev, void *arg); - -struct intel_adsp_ipc_data { - struct k_sem sem; - struct k_spinlock lock; - intel_adsp_ipc_handler_t handle_message; - void *handler_arg; - intel_adsp_ipc_done_t done_notify; - void *done_arg; - bool tx_ack_pending; -}; +#if defined(CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE) || defined(__DOXYGEN__) /** * @brief Register message callback handler. @@ -98,34 +38,27 @@ void intel_adsp_ipc_set_message_handler(const struct device *dev, void intel_adsp_ipc_set_done_handler(const struct device *dev, intel_adsp_ipc_done_t fn, void *arg); -/** @brief Initialize Intel ADSP IPC device. - * - * Initialize the device. Must be called before any API calls or - * interrupts can be serviced. - * - * @param dev IPC device. - * @return Zero on success, negative codes for error. - */ -int intel_adsp_ipc_init(const struct device *dev); - -/** @brief Complete an in-progress message. +/** + * @brief Complete an in-progress message. * * Notify the other side that the current in-progress message is * complete. This is a noop if no message is in progress. * * @note Further messages on the link will not be transmitted or - * received while an in-progress message remains incomplete! + * received while an in-progress message remains incomplete! * * @param dev IPC device. */ void intel_adsp_ipc_complete(const struct device *dev); -/** @brief Message-in-progress predicate. +/** + * @brief Message-in-progress predicate. * * Returns false if a message has been received but not yet completed * via intel_adsp_ipc_complete(), true otherwise. * * @param dev IPC device. + * * @return True if no message is in progress. */ bool intel_adsp_ipc_is_complete(const struct device *dev); @@ -175,38 +108,6 @@ int intel_adsp_ipc_send_message_sync(const struct device *dev, void intel_adsp_ipc_send_message_emergency(const struct device *dev, uint32_t data, uint32_t ext_data); -#ifdef CONFIG_PM_DEVICE - -typedef int (*intel_adsp_ipc_resume_handler_t)(const struct device *dev, void *arg); - -typedef int (*intel_adsp_ipc_suspend_handler_t)(const struct device *dev, void *arg); - -/** - * @brief Registers resume callback handler used to resume Device from suspended state. - * - * @param dev IPC device. - * @param fn Callback function. - * @param arg Value to pass as the "arg" parameter to the function. - */ -void intel_adsp_ipc_set_resume_handler(const struct device *dev, - intel_adsp_ipc_resume_handler_t fn, void *arg); - -/** - * @brief Registers suspend callback handler used to suspend active Device. - * - * @param dev IPC device. - * @param fn Callback function. - * @param arg Value to pass as the "arg" parameter to the function. - */ -void intel_adsp_ipc_set_suspend_handler(const struct device *dev, - intel_adsp_ipc_suspend_handler_t fn, void *arg); - -struct ipc_control_driver_api { - intel_adsp_ipc_resume_handler_t resume_fn; - void *resume_fn_args; - intel_adsp_ipc_suspend_handler_t suspend_fn; - void *suspend_fn_args; -}; +#endif /* CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE */ -#endif /* CONFIG_PM_DEVICE */ #endif /* ZEPHYR_INCLUDE_INTEL_ADSP_IPC_H */ diff --git a/soc/intel/intel_adsp/common/ipc.c b/soc/intel/intel_adsp/common/ipc.c index bceee1b7c2a2..aff2c2f70ee6 100644 --- a/soc/intel/intel_adsp/common/ipc.c +++ b/soc/intel/intel_adsp/common/ipc.c @@ -1,20 +1,23 @@ -/* Copyright (c) 2022 Intel Corporation +/* + * Copyright (c) 2022, 2025 Intel Corporation + * * SPDX-License-Identifier: Apache-2.0 */ - #include -#include -#include -#include -#include -#include -#include -#include -#include #include -void intel_adsp_ipc_set_message_handler(const struct device *dev, - intel_adsp_ipc_handler_t fn, void *arg) +#include +#include + +#include +#include + +static struct ipc_ept intel_adsp_ipc_ept; +static struct intel_adsp_ipc_ept_priv_data intel_adsp_ipc_priv_data; +static struct ipc_ept_cfg intel_adsp_ipc_ept_cfg; + +void intel_adsp_ipc_set_message_handler(const struct device *dev, intel_adsp_ipc_handler_t fn, + void *arg) { struct intel_adsp_ipc_data *devdata = dev->data; k_spinlock_key_t key = k_spin_lock(&devdata->lock); @@ -24,8 +27,7 @@ void intel_adsp_ipc_set_message_handler(const struct device *dev, k_spin_unlock(&devdata->lock, key); } -void intel_adsp_ipc_set_done_handler(const struct device *dev, - intel_adsp_ipc_done_t fn, void *arg) +void intel_adsp_ipc_set_done_handler(const struct device *dev, intel_adsp_ipc_done_t fn, void *arg) { struct intel_adsp_ipc_data *devdata = dev->data; k_spinlock_key_t key = k_spin_lock(&devdata->lock); @@ -35,314 +37,121 @@ void intel_adsp_ipc_set_done_handler(const struct device *dev, k_spin_unlock(&devdata->lock, key); } -static void intel_adsp_ipc_isr(const void *devarg) +static void intel_adsp_ipc_receive_cb(const void *data, size_t len, void *priv) { - const struct device *dev = devarg; - const struct intel_adsp_ipc_config *config = dev->config; + const struct device *dev = INTEL_ADSP_IPC_HOST_DEV; struct intel_adsp_ipc_data *devdata = dev->data; + struct intel_adsp_ipc_ept_priv_data *priv_data = + (struct intel_adsp_ipc_ept_priv_data *)priv; + bool done = true; - volatile struct intel_adsp_ipc *regs = config->regs; - k_spinlock_key_t key = k_spin_lock(&devdata->lock); - - if (regs->tdr & INTEL_ADSP_IPC_BUSY) { - bool done = true; + if (len == INTEL_ADSP_IPC_CB_MSG) { + const struct intel_adsp_ipc_msg *msg = (const struct intel_adsp_ipc_msg *)data; if (devdata->handle_message != NULL) { - uint32_t msg = regs->tdr & ~INTEL_ADSP_IPC_BUSY; - uint32_t ext = regs->tdd; - - done = devdata->handle_message(dev, devdata->handler_arg, msg, ext); + done = devdata->handle_message(dev, devdata->handler_arg, msg->data, + msg->ext_data); } - regs->tdr = INTEL_ADSP_IPC_BUSY; if (done) { -#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE - regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; -#else - regs->tda = INTEL_ADSP_IPC_DONE; -#endif + priv_data->cb_ret = INTEL_ADSP_IPC_CB_RET_OKAY; + } else { + priv_data->cb_ret = -EBADMSG; } - } - - /* Same signal, but on different bits in 1.5 */ - bool done = (regs->ida & INTEL_ADSP_IPC_DONE); - - if (done) { + } else if (len == INTEL_ADSP_IPC_CB_DONE) { bool external_completion = false; if (devdata->done_notify != NULL) { external_completion = devdata->done_notify(dev, devdata->done_arg); } - devdata->tx_ack_pending = false; - /* Allow the system to enter the runtime idle state after the IPC acknowledgment - * is received. - */ - pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); - k_sem_give(&devdata->sem); - - /* IPC completion registers will be set externally */ + if (external_completion) { - k_spin_unlock(&devdata->lock, key); - return; + priv_data->cb_ret = INTEL_ADSP_IPC_CB_RET_EXT_COMPLETE; + } else { + priv_data->cb_ret = INTEL_ADSP_IPC_CB_RET_OKAY; } - - regs->ida = INTEL_ADSP_IPC_DONE; } - - k_spin_unlock(&devdata->lock, key); -} - -int intel_adsp_ipc_init(const struct device *dev) -{ - pm_device_busy_set(dev); - struct intel_adsp_ipc_data *devdata = dev->data; - const struct intel_adsp_ipc_config *config = dev->config; - - memset(devdata, 0, sizeof(*devdata)); - - k_sem_init(&devdata->sem, 0, 1); - - /* ACK any latched interrupts (including TDA to clear IDA on - * the other side!), then enable. - */ - config->regs->tdr = INTEL_ADSP_IPC_BUSY; - config->regs->ida = INTEL_ADSP_IPC_DONE; -#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE - config->regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; -#else - config->regs->tda = INTEL_ADSP_IPC_DONE; -#endif - config->regs->ctl |= (INTEL_ADSP_IPC_CTL_IDIE | INTEL_ADSP_IPC_CTL_TBIE); - pm_device_busy_clear(dev); - - return 0; } void intel_adsp_ipc_complete(const struct device *dev) { - const struct intel_adsp_ipc_config *config = dev->config; + int ret; -#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE - config->regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; -#else - config->regs->tda = INTEL_ADSP_IPC_DONE; -#endif + ret = ipc_service_send(&intel_adsp_ipc_ept, NULL, INTEL_ADSP_IPC_SEND_DONE); + + ARG_UNUSED(ret); } bool intel_adsp_ipc_is_complete(const struct device *dev) { - const struct intel_adsp_ipc_config *config = dev->config; - const struct intel_adsp_ipc_data *devdata = dev->data; - bool not_busy = (config->regs->idr & INTEL_ADSP_IPC_BUSY) == 0; + int ret; + + ret = ipc_service_send(&intel_adsp_ipc_ept, NULL, INTEL_ADSP_IPC_SEND_IS_COMPLETE); - return not_busy && !devdata->tx_ack_pending; + return ret == 0; } -int intel_adsp_ipc_send_message(const struct device *dev, - uint32_t data, uint32_t ext_data) +int intel_adsp_ipc_send_message(const struct device *dev, uint32_t data, uint32_t ext_data) { -#ifdef CONFIG_PM_DEVICE - enum pm_device_state current_state; + struct intel_adsp_ipc_msg msg = {.data = data, .ext_data = ext_data}; + int ret; - if (pm_device_state_get(INTEL_ADSP_IPC_HOST_DEV, ¤t_state) != 0 || - current_state != PM_DEVICE_STATE_ACTIVE) { - return -ESHUTDOWN; - } -#endif + ret = ipc_service_send(&intel_adsp_ipc_ept, &msg, INTEL_ADSP_IPC_SEND_MSG); - pm_device_busy_set(dev); - const struct intel_adsp_ipc_config *config = dev->config; - struct intel_adsp_ipc_data *devdata = dev->data; - k_spinlock_key_t key = k_spin_lock(&devdata->lock); - - if ((config->regs->idr & INTEL_ADSP_IPC_BUSY) != 0 || devdata->tx_ack_pending) { - k_spin_unlock(&devdata->lock, key); - return -EBUSY; + if (ret < 0) { + return ret; } - k_sem_reset(&devdata->sem); - /* Prevent entering runtime idle state until IPC acknowledgment is received. */ - pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); - devdata->tx_ack_pending = true; - config->regs->idd = ext_data; - config->regs->idr = data | INTEL_ADSP_IPC_BUSY; - k_spin_unlock(&devdata->lock, key); - pm_device_busy_clear(dev); return 0; } -int intel_adsp_ipc_send_message_sync(const struct device *dev, - uint32_t data, uint32_t ext_data, - k_timeout_t timeout) +int intel_adsp_ipc_send_message_sync(const struct device *dev, uint32_t data, uint32_t ext_data, + k_timeout_t timeout) { - struct intel_adsp_ipc_data *devdata = dev->data; + struct intel_adsp_ipc_msg msg = { + .data = data, + .ext_data = ext_data, + .timeout = timeout, + }; + int ret; - int ret = intel_adsp_ipc_send_message(dev, data, ext_data); + ret = ipc_service_send(&intel_adsp_ipc_ept, &msg, INTEL_ADSP_IPC_SEND_MSG_SYNC); - if (!ret) { - k_sem_take(&devdata->sem, timeout); + if (ret < 0) { + return ret; } - return ret; + + return 0; } void intel_adsp_ipc_send_message_emergency(const struct device *dev, uint32_t data, uint32_t ext_data) { - const struct intel_adsp_ipc_config * const config = dev->config; - - volatile struct intel_adsp_ipc * const regs = config->regs; - bool done; - - /* check if host is processing message. */ - while (regs->idr & INTEL_ADSP_IPC_BUSY) { - k_busy_wait(1); - } - - /* check if host has pending acknowledge msg - * Same signal, but on different bits in 1.5 - */ - done = regs->ida & INTEL_ADSP_IPC_DONE; - if (done) { - /* IPC completion */ - regs->ida = INTEL_ADSP_IPC_DONE; - } - - regs->idd = ext_data; - regs->idr = data | INTEL_ADSP_IPC_BUSY; -} - -#if DT_NODE_EXISTS(INTEL_ADSP_IPC_HOST_DTNODE) - -#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) -static inline void ace_ipc_intc_unmask(void) -{ - ACE_DINT[0].ie[ACE_INTL_HIPC] = BIT(0); -} -#else -static inline void ace_ipc_intc_unmask(void) {} -#endif - -static int dt_init(const struct device *dev) -{ - IRQ_CONNECT(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE), 0, intel_adsp_ipc_isr, - INTEL_ADSP_IPC_HOST_DEV, 0); - irq_enable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); - - ace_ipc_intc_unmask(); - - return intel_adsp_ipc_init(dev); -} - -#ifdef CONFIG_PM_DEVICE - -void intel_adsp_ipc_set_resume_handler(const struct device *dev, - intel_adsp_ipc_resume_handler_t fn, void *arg) -{ - struct ipc_control_driver_api *api = - (struct ipc_control_driver_api *)dev->api; - struct intel_adsp_ipc_data *devdata = dev->data; - k_spinlock_key_t key = k_spin_lock(&devdata->lock); + struct intel_adsp_ipc_msg msg = {.data = data, .ext_data = ext_data}; + int ret; - api->resume_fn = fn; - api->resume_fn_args = arg; + ret = ipc_service_send(&intel_adsp_ipc_ept, &msg, INTEL_ADSP_IPC_SEND_MSG_EMERGENCY); - k_spin_unlock(&devdata->lock, key); + ARG_UNUSED(ret); } -void intel_adsp_ipc_set_suspend_handler(const struct device *dev, - intel_adsp_ipc_suspend_handler_t fn, void *arg) -{ - struct ipc_control_driver_api *api = - (struct ipc_control_driver_api *)dev->api; - struct intel_adsp_ipc_data *devdata = dev->data; - k_spinlock_key_t key = k_spin_lock(&devdata->lock); - - api->suspend_fn = fn; - api->suspend_fn_args = arg; - - k_spin_unlock(&devdata->lock, key); -} +static struct ipc_ept_cfg intel_adsp_ipc_ept_cfg = { + .name = "intel_adsp_ipc_ept", + .cb = { + .received = intel_adsp_ipc_receive_cb, + }, + .priv = (void *)&intel_adsp_ipc_priv_data, +}; -/** - * @brief Manages IPC driver power state change. - * - * @param dev IPC device. - * @param action Power state to be changed to. - * @return int Returns 0 on success or optionaly error code from the - * registered ipc_power_control_api callbacks. - * - * @note PM lock is taken at the start of each power transition to prevent concurrent calls - * to @ref pm_device_action_run function. - * If IPC Device performs hardware operation and device is busy (what should not happen) - * function returns failure. It is API user responsibility to make sure we are not entering - * device power transition while device is busy. - */ -static int ipc_pm_action(const struct device *dev, enum pm_device_action action) +static int intel_adsp_ipc_old_init(void) { - if (pm_device_is_busy(INTEL_ADSP_IPC_HOST_DEV)) { - return -EBUSY; - } - - const struct ipc_control_driver_api *api = - (const struct ipc_control_driver_api *)dev->api; + int ret; + const struct device *ipc_dev = INTEL_ADSP_IPC_HOST_DEV; - int ret = 0; - - switch (action) { - case PM_DEVICE_ACTION_SUSPEND: - if (api->suspend_fn) { - ret = api->suspend_fn(dev, api->suspend_fn_args); - if (!ret) { - irq_disable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); - } - } - break; - case PM_DEVICE_ACTION_RESUME: - irq_enable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); - if (!irq_is_enabled(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE))) { - ret = -EINTR; - break; - } - ace_ipc_intc_unmask(); - ret = intel_adsp_ipc_init(dev); - if (ret) { - break; - } - if (api->resume_fn) { - ret = api->resume_fn(dev, api->resume_fn_args); - } - break; - default: - /* Return as default value when given PM action is not supported */ - return -ENOTSUP; - } + ret = ipc_service_register_endpoint(ipc_dev, &intel_adsp_ipc_ept, &intel_adsp_ipc_ept_cfg); return ret; } -/** - * @brief Callback functions to be executed by Zephyr application - * during IPC device suspend and resume. - */ -static struct ipc_control_driver_api ipc_power_control_api = { - .resume_fn = NULL, - .resume_fn_args = NULL, - .suspend_fn = NULL, - .suspend_fn_args = NULL -}; - -PM_DEVICE_DT_DEFINE(INTEL_ADSP_IPC_HOST_DTNODE, ipc_pm_action); - -#endif /* CONFIG_PM_DEVICE */ - -static const struct intel_adsp_ipc_config ipc_host_config = { - .regs = (void *)INTEL_ADSP_IPC_REG_ADDRESS, -}; - -static struct intel_adsp_ipc_data ipc_host_data; - -DEVICE_DT_DEFINE(INTEL_ADSP_IPC_HOST_DTNODE, dt_init, PM_DEVICE_DT_GET(INTEL_ADSP_IPC_HOST_DTNODE), - &ipc_host_data, &ipc_host_config, PRE_KERNEL_2, 0, COND_CODE_1(CONFIG_PM_DEVICE, - (&ipc_power_control_api), (NULL))); - -#endif /* DT_NODE_EXISTS(INTEL_ADSP_IPC_HOST_DTNODE) */ +/* Backend is at PRE_KERNEL_2:0, so we need to init after that. */ +SYS_INIT(intel_adsp_ipc_old_init, PRE_KERNEL_2, 1); diff --git a/subsys/ipc/ipc_service/backends/CMakeLists.txt b/subsys/ipc/ipc_service/backends/CMakeLists.txt index d6ca8fb76c33..37c62b88e000 100644 --- a/subsys/ipc/ipc_service/backends/CMakeLists.txt +++ b/subsys/ipc/ipc_service/backends/CMakeLists.txt @@ -4,4 +4,5 @@ zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICMSG ipc_icmsg.c) zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICMSG_ME_INITIATOR ipc_icmsg_me_initiator.c) zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICMSG_ME_FOLLOWER ipc_icmsg_me_follower.c) zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICBMSG ipc_icbmsg.c) +zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_INTEL_ADSP_HOST_IPC ipc_intel_adsp_host_ipc.c) zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_RPMSG ipc_rpmsg_static_vrings.c) diff --git a/subsys/ipc/ipc_service/backends/Kconfig b/subsys/ipc/ipc_service/backends/Kconfig index bb8b444898f9..5677c609d410 100644 --- a/subsys/ipc/ipc_service/backends/Kconfig +++ b/subsys/ipc/ipc_service/backends/Kconfig @@ -50,4 +50,5 @@ config IPC_SERVICE_BACKEND_ICMSG_ME_FOLLOWER rsource "Kconfig.icmsg_me" rsource "Kconfig.icbmsg" +rsource "Kconfig.intel_adsp" rsource "Kconfig.rpmsg" diff --git a/subsys/ipc/ipc_service/backends/Kconfig.intel_adsp b/subsys/ipc/ipc_service/backends/Kconfig.intel_adsp new file mode 100644 index 000000000000..47a884310d7a --- /dev/null +++ b/subsys/ipc/ipc_service/backends/Kconfig.intel_adsp @@ -0,0 +1,11 @@ +# +# Copyright (c) 2025 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +config IPC_SERVICE_BACKEND_INTEL_ADSP_HOST_IPC + bool "Backend for the Intel Audio DSP Host IPC" + default DT_HAS_INTEL_ADSP_HOST_IPC_ENABLED + help + IPC Service Backend for Intel Audio DSP Host IPC. diff --git a/subsys/ipc/ipc_service/backends/ipc_intel_adsp_host_ipc.c b/subsys/ipc/ipc_service/backends/ipc_intel_adsp_host_ipc.c new file mode 100644 index 000000000000..274e13c9ea6d --- /dev/null +++ b/subsys/ipc/ipc_service/backends/ipc_intel_adsp_host_ipc.c @@ -0,0 +1,464 @@ +/* + * Copyright (c) 2022, 2025 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * + * @brief IPC service backend for Intel Audio DSP host IPC + * + * @note When declaring struct ipt_ept_cfg, the field priv must point to + * a struct intel_adsp_ipc_ept_priv_data. This is used for passing + * callback returns. + * + * @note For sending message and the received callback, the data and len + * arguments are not used to represent a byte array. Instead, + * the data argument points to the descriptor of data to be sent + * (of struct intel_adsp_ipc_msg). The len argument represents + * the type of message to be sent (enum intel_adsp_send_len) and + * the type of callback (enum intel_adsp_cb_len). + */ + +#define DT_DRV_COMPAT intel_adsp_host_ipc + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +static inline void ace_ipc_intc_mask(void) +{ +#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) + ACE_DINT[0].ie[ACE_INTL_HIPC] = ACE_DINT[0].ie[ACE_INTL_HIPC] & ~BIT(0); +#endif +} + +static inline void ace_ipc_intc_unmask(void) +{ +#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) + ACE_DINT[0].ie[ACE_INTL_HIPC] = BIT(0); +#endif +} + +static void intel_adsp_ipc_isr(const void *devarg) +{ + const struct device *dev = devarg; + const struct intel_adsp_ipc_config *config = dev->config; + struct intel_adsp_ipc_data *devdata = dev->data; + const struct ipc_ept_cfg *ept_cfg = devdata->ept_cfg; + + struct intel_adsp_ipc_ept_priv_data *priv_data = + (struct intel_adsp_ipc_ept_priv_data *)ept_cfg->priv; + + volatile struct intel_adsp_ipc *regs = config->regs; + k_spinlock_key_t key = k_spin_lock(&devdata->lock); + + if (regs->tdr & INTEL_ADSP_IPC_BUSY) { + bool done = true; + + if (ept_cfg->cb.received != NULL) { + struct intel_adsp_ipc_msg cb_msg = { + .data = regs->tdr & ~INTEL_ADSP_IPC_BUSY, + .ext_data = regs->tdd, + }; + + ept_cfg->cb.received(&cb_msg, INTEL_ADSP_IPC_CB_MSG, ept_cfg->priv); + + done = (priv_data->cb_ret == INTEL_ADSP_IPC_CB_RET_OKAY); + } + + regs->tdr = INTEL_ADSP_IPC_BUSY; + if (done) { +#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE + regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; +#else + regs->tda = INTEL_ADSP_IPC_DONE; +#endif + } + } + + /* Same signal, but on different bits in 1.5 */ + bool done = (regs->ida & INTEL_ADSP_IPC_DONE); + + if (done) { + bool external_completion = false; + + if (ept_cfg->cb.received != NULL) { + ept_cfg->cb.received(NULL, INTEL_ADSP_IPC_CB_DONE, ept_cfg->priv); + + if (priv_data->cb_ret == INTEL_ADSP_IPC_CB_RET_EXT_COMPLETE) { + external_completion = true; + } + } + + devdata->tx_ack_pending = false; + + /* + * Allow the system to enter the runtime idle state after the IPC acknowledgment + * is received. + */ + pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); + k_sem_give(&devdata->sem); + + /* IPC completion registers will be set externally. */ + if (external_completion) { + k_spin_unlock(&devdata->lock, key); + return; + } + + regs->ida = INTEL_ADSP_IPC_DONE; + } + + k_spin_unlock(&devdata->lock, key); +} + +int intel_adsp_ipc_init(const struct device *dev) +{ + pm_device_busy_set(dev); + struct intel_adsp_ipc_data *devdata = dev->data; + const struct intel_adsp_ipc_config *config = dev->config; + + k_sem_init(&devdata->sem, 0, 1); + + /* ACK any latched interrupts (including TDA to clear IDA on + * the other side!), then enable. + */ + config->regs->tdr = INTEL_ADSP_IPC_BUSY; + config->regs->ida = INTEL_ADSP_IPC_DONE; +#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE + config->regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; +#else + config->regs->tda = INTEL_ADSP_IPC_DONE; +#endif + config->regs->ctl |= (INTEL_ADSP_IPC_CTL_IDIE | INTEL_ADSP_IPC_CTL_TBIE); + pm_device_busy_clear(dev); + + return 0; +} + +static int intel_adsp_ipc_register_ept(const struct device *instance, void **token, + const struct ipc_ept_cfg *cfg) +{ + struct intel_adsp_ipc_data *data = instance->data; + + data->ept_cfg = cfg; + + irq_enable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); + ace_ipc_intc_unmask(); + + return 0; +} + +static int intel_adsp_ipc_deregister_ept(const struct device *instance, void *token) +{ + struct intel_adsp_ipc_data *data = instance->data; + + data->ept_cfg = NULL; + + ace_ipc_intc_mask(); + irq_disable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); + + return 0; +} + +static void ipc_complete(const struct device *dev) +{ + const struct intel_adsp_ipc_config *config = dev->config; + +#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE + config->regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; +#else + config->regs->tda = INTEL_ADSP_IPC_DONE; +#endif +} + +static bool ipc_is_complete(const struct device *dev) +{ + const struct intel_adsp_ipc_config *config = dev->config; + const struct intel_adsp_ipc_data *devdata = dev->data; + bool not_busy = (config->regs->idr & INTEL_ADSP_IPC_BUSY) == 0; + + return not_busy && !devdata->tx_ack_pending; +} + +static int ipc_send_message(const struct device *dev, uint32_t data, uint32_t ext_data) +{ +#ifdef CONFIG_PM_DEVICE + enum pm_device_state current_state; + + if (pm_device_state_get(INTEL_ADSP_IPC_HOST_DEV, ¤t_state) != 0 || + current_state != PM_DEVICE_STATE_ACTIVE) { + return -ESHUTDOWN; + } +#endif + + pm_device_busy_set(dev); + const struct intel_adsp_ipc_config *config = dev->config; + struct intel_adsp_ipc_data *devdata = dev->data; + k_spinlock_key_t key = k_spin_lock(&devdata->lock); + + if ((config->regs->idr & INTEL_ADSP_IPC_BUSY) != 0 || devdata->tx_ack_pending) { + k_spin_unlock(&devdata->lock, key); + return -EBUSY; + } + + k_sem_reset(&devdata->sem); + + /* Prevent entering runtime idle state until IPC acknowledgment is received. */ + pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); + + devdata->tx_ack_pending = true; + + config->regs->idd = ext_data; + config->regs->idr = data | INTEL_ADSP_IPC_BUSY; + + k_spin_unlock(&devdata->lock, key); + + pm_device_busy_clear(dev); + + return 0; +} + +static int ipc_send_message_sync(const struct device *dev, uint32_t data, uint32_t ext_data, + k_timeout_t timeout) +{ + struct intel_adsp_ipc_data *devdata = dev->data; + + int ret = ipc_send_message(dev, data, ext_data); + + if (ret == 0) { + k_sem_take(&devdata->sem, timeout); + } + + return ret; +} + +static int ipc_send_message_emergency(const struct device *dev, uint32_t data, uint32_t ext_data) +{ + const struct intel_adsp_ipc_config *const config = dev->config; + + volatile struct intel_adsp_ipc *const regs = config->regs; + bool done; + + /* check if host is processing message. */ + while (regs->idr & INTEL_ADSP_IPC_BUSY) { + k_busy_wait(1); + } + + /* check if host has pending acknowledge msg + * Same signal, but on different bits in 1.5 + */ + done = regs->ida & INTEL_ADSP_IPC_DONE; + if (done) { + /* IPC completion */ + regs->ida = INTEL_ADSP_IPC_DONE; + } + + regs->idd = ext_data; + regs->idr = data | INTEL_ADSP_IPC_BUSY; + + return 0; +} + +/** + * @brief Send an IPC message. + * + * This implements the inner working of ipc_service_send(). + * + * @note Arguments @a data and @a len are not used to point to a byte buffer of data + * to be sent. Instead, @a data must point to a descriptor of data to be sent, + * struct intel_adsp_ipc_msg. And @a len indicates what type of message to send + * as described in enum intel_adsp_send_len. + * + * Return values for various message types: + * - For INTEL_ADSP_IPC_SEND_MSG_*, returns 0 when message is sent. Negative errno if + * errors. + * - For INTEL_ADSP_IPC_SEND_DONE, always returns 0 for sending DONE message. + * - For INTEL_ADSP_IPC_SEND_IS_COMPLETE, returns 0 if host has processed the message. + * -EAGAIN if not. + * + * @param[in] dev Pointer to device struct. + * @param[in] token Backend-specific token. + * @param[in] data Descriptor of IPC message to be sent (as struct intel_adsp_ipc_msg). + * @param[in] len Type of message to be sent (described in enum intel_adsp_send_len). + * + * @return 0 if message is sent successfully or query returns okay. + * Negative errno otherwise. + */ +static int intel_adsp_ipc_send(const struct device *dev, void *token, const void *data, size_t len) +{ + int ret; + + const struct intel_adsp_ipc_msg *msg = (const struct intel_adsp_ipc_msg *)data; + + switch (len) { + case INTEL_ADSP_IPC_SEND_MSG: { + ret = ipc_send_message(dev, msg->data, msg->ext_data); + + break; + } + case INTEL_ADSP_IPC_SEND_MSG_SYNC: { + ret = ipc_send_message_sync(dev, msg->data, msg->ext_data, msg->timeout); + + break; + } + case INTEL_ADSP_IPC_SEND_MSG_EMERGENCY: { + ret = ipc_send_message_emergency(dev, msg->data, msg->ext_data); + + break; + } + case INTEL_ADSP_IPC_SEND_DONE: { + ipc_complete(dev); + + ret = 0; + + break; + } + case INTEL_ADSP_IPC_SEND_IS_COMPLETE: { + bool completed = ipc_is_complete(dev); + + if (completed) { + ret = 0; + } else { + ret = -EAGAIN; + } + + break; + } + default: + ret = -EBADMSG; + + break; + } + + return ret; +} + +static int intel_adsp_ipc_dt_init(const struct device *dev) +{ + struct intel_adsp_ipc_data *devdata = dev->data; + + memset(devdata, 0, sizeof(*devdata)); + + IRQ_CONNECT(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE), 0, intel_adsp_ipc_isr, + INTEL_ADSP_IPC_HOST_DEV, 0); + + return intel_adsp_ipc_init(dev); +} + +#ifdef CONFIG_PM_DEVICE + +void intel_adsp_ipc_set_resume_handler(const struct device *dev, intel_adsp_ipc_resume_handler_t fn, + void *arg) +{ + struct intel_adsp_ipc_data *devdata = dev->data; + k_spinlock_key_t key = k_spin_lock(&devdata->lock); + + devdata->resume_fn = fn; + devdata->resume_fn_args = arg; + + k_spin_unlock(&devdata->lock, key); +} + +void intel_adsp_ipc_set_suspend_handler(const struct device *dev, + intel_adsp_ipc_suspend_handler_t fn, void *arg) +{ + struct intel_adsp_ipc_data *devdata = dev->data; + k_spinlock_key_t key = k_spin_lock(&devdata->lock); + + devdata->suspend_fn = fn; + devdata->suspend_fn_args = arg; + + k_spin_unlock(&devdata->lock, key); +} + +/** + * @brief Manages IPC driver power state change. + * + * @param dev IPC device. + * @param action Power state to be changed to. + * + * @return int Returns 0 on success or optionaly error code from the + * registered ipc_power_control_api callbacks. + * + * @note PM lock is taken at the start of each power transition to prevent concurrent calls + * to @ref pm_device_action_run function. + * If IPC Device performs hardware operation and device is busy (what should not happen) + * function returns failure. It is API user responsibility to make sure we are not entering + * device power transition while device is busy. + */ +static int ipc_pm_action(const struct device *dev, enum pm_device_action action) +{ + if (pm_device_is_busy(INTEL_ADSP_IPC_HOST_DEV)) { + return -EBUSY; + } + + struct intel_adsp_ipc_data *devdata = dev->data; + + int ret = 0; + + switch (action) { + case PM_DEVICE_ACTION_SUSPEND: + if (devdata->suspend_fn) { + ret = devdata->suspend_fn(dev, devdata->suspend_fn_args); + if (!ret) { + irq_disable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); + } + } + break; + case PM_DEVICE_ACTION_RESUME: + irq_enable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); + if (!irq_is_enabled(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE))) { + ret = -EINTR; + break; + } + ace_ipc_intc_unmask(); + ret = intel_adsp_ipc_init(dev); + if (ret) { + break; + } + if (devdata->resume_fn) { + ret = devdata->resume_fn(dev, devdata->resume_fn_args); + } + break; + default: + /* Return as default value when given PM action is not supported */ + return -ENOTSUP; + } + + return ret; +} + +PM_DEVICE_DT_DEFINE(INTEL_ADSP_IPC_HOST_DTNODE, ipc_pm_action); + +#endif /* CONFIG_PM_DEVICE */ + +static const struct intel_adsp_ipc_config ipc_host_config = { + .regs = (void *)INTEL_ADSP_IPC_REG_ADDRESS, +}; + +static struct intel_adsp_ipc_data ipc_host_data; + +const static struct ipc_service_backend intel_adsp_ipc_backend_api = { + .send = intel_adsp_ipc_send, + .register_endpoint = intel_adsp_ipc_register_ept, + .deregister_endpoint = intel_adsp_ipc_deregister_ept, +}; + +DEVICE_DT_DEFINE(INTEL_ADSP_IPC_HOST_DTNODE, intel_adsp_ipc_dt_init, + PM_DEVICE_DT_GET(INTEL_ADSP_IPC_HOST_DTNODE), &ipc_host_data, &ipc_host_config, + PRE_KERNEL_2, 0, &intel_adsp_ipc_backend_api); From 2afa6471eb13a1f6b7f2e8a0c6f0686d9c6cae72 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 18 Jul 2025 13:31:21 -0400 Subject: [PATCH 0751/3334] [nrf fromtree] manifest: move tf-m-tests to main manifest Those tests are needed for verifying and testing tf-m. While not needed directly by zephyr, they are needed for testing and CI. Signed-off-by: Anas Nashif (cherry picked from commit a2ccf506bdae2445594b9661a7b2c1dfc83932b8) --- submanifests/optional.yaml | 6 ------ west.yml | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 322a37871bc7..1f49ad1485f1 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -28,12 +28,6 @@ manifest: remote: upstream groups: - optional - - name: tf-m-tests - revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 - path: modules/tee/tf-m/tf-m-tests - remote: upstream - groups: - - optional - name: tflite-micro revision: 8d404de73acf7687831e16d88e86e4f73cfddf8e path: optional/modules/lib/tflite-micro diff --git a/west.yml b/west.yml index 3b0aa0870733..1f27f2dc4de8 100644 --- a/west.yml +++ b/west.yml @@ -24,7 +24,7 @@ manifest: - name: babblesim url-base: https://github.com/BabbleSim - group-filter: [-babblesim, -optional] + group-filter: [-babblesim, -optional, -testing] # # Please add items below based on alphabetical order @@ -358,6 +358,11 @@ manifest: path: modules/debug/segger groups: - debug + - name: tf-m-tests + revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 + path: modules/tee/tf-m/tf-m-tests + groups: + - testing - name: trusted-firmware-a revision: 713ffbf96c5bcbdeab757423f10f73eb304eff07 path: modules/tee/tf-a/trusted-firmware-a From ecd1676ba468a6de86b3e09dbbd1ebf01d2c7138 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 18 Jul 2025 13:57:11 -0400 Subject: [PATCH 0752/3334] [nrf fromtree] manifest: move psa-arch-tests to main manifest Tests needed to verify tf-a module. Signed-off-by: Anas Nashif (cherry picked from commit a7c53391d5224f4a28c36198ddc86d8b43cba5e8) --- submanifests/optional.yaml | 6 ------ west.yml | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 1f49ad1485f1..a97aded1f717 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -22,12 +22,6 @@ manifest: remote: upstream groups: - optional - - name: psa-arch-tests - revision: 87b08682a111ebb085cd8b1ea41d603191d6d146 - path: modules/tee/tf-m/psa-arch-tests - remote: upstream - groups: - - optional - name: tflite-micro revision: 8d404de73acf7687831e16d88e86e4f73cfddf8e path: optional/modules/lib/tflite-micro diff --git a/west.yml b/west.yml index 1f27f2dc4de8..5f7fe5a6448c 100644 --- a/west.yml +++ b/west.yml @@ -353,6 +353,12 @@ manifest: - name: picolibc path: modules/lib/picolibc revision: ca8b6ebba5226a75545e57a140443168a26ba664 + - name: psa-arch-tests + revision: 87b08682a111ebb085cd8b1ea41d603191d6d146 + path: modules/tee/tf-m/psa-arch-tests + groups: + - testing + - tee - name: segger revision: cf56b1d9c80f81a26e2ac5727c9cf177116a4692 path: modules/debug/segger From 996773b3817e511889ee48e1d7a921c534ffeeef Mon Sep 17 00:00:00 2001 From: Tomi Fontanilles Date: Wed, 12 Nov 2025 12:55:08 +0200 Subject: [PATCH 0753/3334] [nrf fromtree] manifest: tf-m: update to 2.2.2 Update the TF-M repos to 2.2.2, from version 2.2.0. Signed-off-by: Tomi Fontanilles (cherry picked from commit ea3697bf886367b0cc6e402274c2054dbb1a8e89) --- west.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/west.yml b/west.yml index 5f7fe5a6448c..a5f6102779df 100644 --- a/west.yml +++ b/west.yml @@ -354,7 +354,7 @@ manifest: path: modules/lib/picolibc revision: ca8b6ebba5226a75545e57a140443168a26ba664 - name: psa-arch-tests - revision: 87b08682a111ebb085cd8b1ea41d603191d6d146 + revision: afeed6ed87146d9828e0ff862f3533790df8c421 path: modules/tee/tf-m/psa-arch-tests groups: - testing @@ -365,7 +365,7 @@ manifest: groups: - debug - name: tf-m-tests - revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 + revision: cde5b6ed540d3ff5a09564fded6b39b0a70ad3bf path: modules/tee/tf-m/tf-m-tests groups: - testing @@ -375,7 +375,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: c2f9edc77f72838e7d6f5f9c0b95e4318ddfced1 + revision: 9889df41022c6679b71da55d93f9e3693a804976 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 117d2df604c6c615316b71c6b2882793c8de9f37 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Mon, 1 Dec 2025 18:08:59 +0100 Subject: [PATCH 0754/3334] [nrf fromtree] manifest: psa-arch-tests: support for STM32U5 and STM32WBA65 Update PSA-Arch-tests to support testing STM32U585 and STM32WBA based boards. Signed-off-by: Etienne Carriere (cherry picked from commit 88cc16191b4950f8a9fa7d019a6a0be98085614e) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index a5f6102779df..6fbd593140d4 100644 --- a/west.yml +++ b/west.yml @@ -354,7 +354,7 @@ manifest: path: modules/lib/picolibc revision: ca8b6ebba5226a75545e57a140443168a26ba664 - name: psa-arch-tests - revision: afeed6ed87146d9828e0ff862f3533790df8c421 + revision: 941cd8436a2e0f1da9d8584b83a403930826899d path: modules/tee/tf-m/psa-arch-tests groups: - testing From a1d9a8db0ea4bbee2e69feec1140e6ce20e62f5e Mon Sep 17 00:00:00 2001 From: BUDKE Gerson Fernando Date: Wed, 3 Dec 2025 10:10:50 +0100 Subject: [PATCH 0755/3334] [nrf fromtree] west.yml: Bump TF-M with stm32u5a sram5 support Enable SRAM5 region in the Global TrustZone controller (GTZC). Signed-off-by: BUDKE Gerson Fernando (cherry picked from commit 5d6e4d9469db18abb1cbe85ae745ba6e192d4b06) --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 6fbd593140d4..a5ff59c44782 100644 --- a/west.yml +++ b/west.yml @@ -375,7 +375,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 9889df41022c6679b71da55d93f9e3693a804976 + revision: e295109067f71e1c8db76d02396baa050687b1df path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 3fa188c6bf471d851b57537e1433aa8a31e15821 Mon Sep 17 00:00:00 2001 From: Jorgen Kvalvaag Date: Fri, 9 Jan 2026 12:13:21 +0100 Subject: [PATCH 0756/3334] [nrf noup] test-spec: Reduce thingy91 scope Reduce thingy91 test scope. Signed-off-by: Jorgen Kvalvaag --- .github/test-spec.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index ecf8102649dc..fc74207ebd5f 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -149,14 +149,9 @@ - "drivers/net/**/*" - "drivers/serial/**/*" - "drivers/timer/**/*" - - "include/**/*" - - "kernel/**/*" - "lib/libc/common/source/stdlib/**/*" - "lib/libc/newlib/**/*" - "lib/libc/picolibc/**/*" - - "lib/os/**/*" - - "lib/posix/**/*" - - "misc/**/*" - "modules/mbedtls/**/*" - "soc/x86/ia32/**/*" - "subsys/fs/fcb/**/*" From 3510a6385d5f5ea4053b06a26cc8365b1e36ea6c Mon Sep 17 00:00:00 2001 From: Ivan Iushkov Date: Tue, 13 Jan 2026 13:14:11 +0100 Subject: [PATCH 0757/3334] [nrf fromlist] Bluetooth: fix potential unaligned access in CS HCI fields This commit fixes an issue reported by LLVM Clang compiler when building with -Wunaligned-access: ``` bluetooth/hci_types.h:4044:2: error: field within 'struct bt_hci_le_cs_step_data_mode_1' is less aligned than 'union bt_hci_le_cs_step_data_mode_1:: (include/zephyr/bluetooth/hci_types.h:4044:2)' and is usually due to 'struct bt_hci_le_cs_step_data_mode_1' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] ``` and similar issues for other CS-specific types containing unions Upstream PR #: 102180 Signed-off-by: Ivan Iushkov --- include/zephyr/bluetooth/hci_types.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index ebdbe5c926ce..37295f47766c 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -3959,7 +3959,7 @@ struct bt_hci_le_cs_step_data_mode_1 { union { int16_t toa_tod_initiator; int16_t tod_toa_reflector; - }; + } __packed; uint8_t packet_antenna; } __packed; @@ -3977,7 +3977,7 @@ struct bt_hci_le_cs_step_data_mode_1_ss_rtt { union { int16_t toa_tod_initiator; int16_t tod_toa_reflector; - }; + } __packed; uint8_t packet_antenna; uint8_t packet_pct1[4]; uint8_t packet_pct2[4]; @@ -4016,7 +4016,7 @@ struct bt_hci_le_cs_step_data_mode_3 { union { int16_t toa_tod_initiator; int16_t tod_toa_reflector; - }; + } __packed; uint8_t packet_antenna; uint8_t antenna_permutation_index; struct bt_hci_le_cs_step_data_tone_info tone_info[]; @@ -4036,7 +4036,7 @@ struct bt_hci_le_cs_step_data_mode_3_ss_rtt { union { int16_t toa_tod_initiator; int16_t tod_toa_reflector; - }; + } __packed; uint8_t packet_antenna; uint8_t packet_pct1[4]; uint8_t packet_pct2[4]; From ac08b3511a0171dc036def75a77175a7c88891a7 Mon Sep 17 00:00:00 2001 From: Aleksander Wasaznik Date: Thu, 9 Oct 2025 16:30:50 +0200 Subject: [PATCH 0758/3334] [nrf fromtree] Bluetooth: Host: Don't call user callback from TX thread ATT is invoking user callbacks in its net_buf destroy function. It is common practice that these callbacks can block on bt_hci_cmd_alloc(). This is a deadlock when the net_buf_unref() happens inside the HCI driver, invoked from tx_processor. Blocking callbacks like this appear in our own samples. See further down about how this problem was detected. tx_processor not protect against blocking callbacks so it is de-facto forbidden. The Host should not equip net_bufs with dangerous destroy callbacks. This commit makes ATT defer its net_buf destruction and user callback invocation to the system workqueue, so that net_buf_unref is safe to call from non-blocking threads. In the case of the deadlock, the net_buf_unref() was below the tx_processor in the call stack, which (at the time of this commit) is on the system work queue, so defering it to the system work queue is preserving the existing behavior. Future improvement may be to allow the user to provide their own workqueue for ATT callbacks. This deadlock was detected because the following test was failing while moving tx_processor to the bt_taskq: tests/bsim/bluetooth/ll/throughput/tests_scripts/gatt_write.sh The above test has an ATT callback `write_cmd_cb` invokes `bt_conn_le_param_update` can block waiting for `tx_processor`. The reason it was not failing while tx_processor was on the system work queue is that the GATT API has a special non-blocking behavior when called from the system work queue. Upstream PR #: 97913 Signed-off-by: Aleksander Wasaznik (cherry picked from commit 6889042d96a19dc714764e0faa945e4e61871a26) Signed-off-by: Kyra Lengfeld --- subsys/bluetooth/host/att.c | 81 +++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 644952f55257..1d6ded311174 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -248,10 +249,37 @@ const char *bt_att_err_to_str(uint8_t att_err) } #endif /* CONFIG_BT_ATT_ERR_TO_STR */ -static void att_tx_destroy(struct net_buf *buf) +static void att_tx_destroy_work_handler(struct k_work *work); +static K_WORK_DEFINE(att_tx_destroy_work, att_tx_destroy_work_handler); +static struct k_spinlock tx_destroy_queue_lock; +static sys_slist_t tx_destroy_queue = SYS_SLIST_STATIC_INIT(&tx_destroy_queue); + +static void att_tx_destroy_work_handler(struct k_work *work) { - struct bt_att_tx_meta_data *p_meta = att_get_tx_meta_data(buf); + struct net_buf *buf; + struct bt_att_tx_meta_data *p_meta; struct bt_att_tx_meta_data meta; + sys_snode_t *buf_node; + k_spinlock_key_t key; + bool resubmit; + + key = k_spin_lock(&tx_destroy_queue_lock); + buf_node = sys_slist_get(&tx_destroy_queue); + /* If there are more items in the queue, those likely have + * been there before this handler started running and + * coalesced into a single work submission, so we need to + * resubmit. + */ + resubmit = !sys_slist_is_empty(&tx_destroy_queue); + k_spin_unlock(&tx_destroy_queue_lock, key); + + /* Spurious wakeups can occur in with some thread interleavings. */ + if (buf_node == NULL) { + return; + } + + buf = CONTAINER_OF(buf_node, struct net_buf, node); + p_meta = att_get_tx_meta_data(buf); LOG_DBG("%p", buf); @@ -266,8 +294,8 @@ static void att_tx_destroy(struct net_buf *buf) */ memset(p_meta, 0x00, sizeof(*p_meta)); - /* After this point, p_meta doesn't belong to us. - * The user data will be memset to 0 on allocation. + /* After this point, p_meta doesn't belong to us. The user data will + * be memset to 0 on allocation. */ net_buf_destroy(buf); @@ -278,6 +306,51 @@ static void att_tx_destroy(struct net_buf *buf) if (meta.opcode != 0) { att_on_sent_cb(&meta); } + + /* We resubmit this work instead of looping to allow other work on + * the work queue to run. + */ + if (resubmit) { + int err = k_work_submit_to_queue(NULL, work); + + if (err < 0) { + LOG_ERR("Failed to re-submit %s: %d", __func__, err); + k_oops(); + } + } +} + +static void att_tx_destroy(struct net_buf *buf) +{ + int err; + k_spinlock_key_t key; + + /* We need to invoke att_on_sent_cb, which may block. We + * don't want to block in a net buf destroy callback, so we + * defer to a sensible workqueue. + * + * bt_workq cannot be used because it currently forms a + * deadlock with att_pool: bt_workq -> bt_att_recv -> + * send_err_rsp waits for att pool. + * + * We use the system work queue to preserve earlier + * behavior. The tx_processor used to run on the system work + * queue, and it could end up here: tx_processor -> + * bt_hci_send -> net_buf_unref. + * + * A possible alternative is tx_notify_workqueue_get() since + * this workqueue is processing similar "completion" events. + */ + key = k_spin_lock(&tx_destroy_queue_lock); + sys_slist_append(&tx_destroy_queue, &buf->node); + k_spin_unlock(&tx_destroy_queue_lock, key); + + err = k_work_submit(&att_tx_destroy_work); + if (err < 0) { + LOG_ERR("Failed to submit att_tx_destroy_work: %d", err); + k_oops(); + } + /* Continues in att_tx_destroy_work_handler() */ } NET_BUF_POOL_DEFINE(att_pool, CONFIG_BT_ATT_TX_COUNT, From 91308abed3c4be840e92443f88ba3749e6459c74 Mon Sep 17 00:00:00 2001 From: Aleksander Wasaznik Date: Fri, 10 Oct 2025 12:18:56 +0200 Subject: [PATCH 0759/3334] [nrf fromtree] Bluetooth: Samples: Reduce RAM requirement of peripheral_identity Reduce BT_MAX_CONN from 62 to 61 to make it build on integration platform qemu_cortex_m3/ti_lm3s6965 when we add bt_taskq in subsequent commit. The number 62 seems arbitrary here, so reducing it by one should not have any practical impact. Upstream PR #: 97913 Signed-off-by: Aleksander Wasaznik (cherry picked from commit 0ee5d70f385c13c2acf89b287bbf601093ec3a12) Signed-off-by: Kyra Lengfeld --- samples/bluetooth/peripheral_identity/prj.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/bluetooth/peripheral_identity/prj.conf b/samples/bluetooth/peripheral_identity/prj.conf index 8bd97851e368..d7847c0f7a32 100644 --- a/samples/bluetooth/peripheral_identity/prj.conf +++ b/samples/bluetooth/peripheral_identity/prj.conf @@ -6,8 +6,8 @@ CONFIG_BT_PRIVACY=y CONFIG_BT_DEVICE_NAME="Zephyr Peripheral" CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n -CONFIG_BT_MAX_CONN=62 -CONFIG_BT_ID_MAX=62 +CONFIG_BT_MAX_CONN=61 +CONFIG_BT_ID_MAX=61 # CONFIG_BT_SMP=y # CONFIG_BT_MAX_PAIRED=62 From ea777518147ec58ebb1c9bbc07d7ab4f72c8706a Mon Sep 17 00:00:00 2001 From: Aleksander Wasaznik Date: Thu, 6 Nov 2025 16:21:50 +0100 Subject: [PATCH 0760/3334] [nrf fromtree] Bluetooth: Host: Run tx processor on its own thread When thread that TX processor is used to send commands and data to Controller is also used for sync commands sending and command buffer allocation, a deadlock happens. This thread is used to avoid such deadlocks by moving TX processor to its own dedicated thread exclusively used by tx processor only. Upstream PR #: 97913 Co-authored-by: Pavel Vasilyev Signed-off-by: Pavel Vasilyev Signed-off-by: Aleksander Wasaznik (cherry picked from commit f101976e31fdaa461ed2f2494f3bc9cef84c9cff) Signed-off-by: Kyra Lengfeld --- subsys/bluetooth/host/Kconfig | 20 +++++++++ subsys/bluetooth/host/hci_core.c | 77 +++++++++++++++++++++++++++++++- 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index e4a381e9b05a..228a4ce58302 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -133,6 +133,26 @@ config BT_DRIVER_RX_HIGH_PRIO int default 6 +config BT_TX_PROCESSOR_THREAD + # This thread is used to send pending HCI Commands, ACL and ISO data to + # Controller. + bool + # This option is automatically selected for all platforms except nRF51 + # due to limited RAM on nRF51 devices. + default y if !SOC_SERIES_NRF51X + +if BT_TX_PROCESSOR_THREAD + +config BT_TX_PROCESSOR_THREAD_PRIO + int + default SYSTEM_WORKQUEUE_PRIORITY + +config BT_TX_PROCESSOR_STACK_SIZE + int + default 1024 + +endif + config BT_CONN_TX_NOTIFY_WQ bool "Use a separate workqueue for connection TX notify processing [EXPERIMENTAL]" depends on BT_CONN_TX diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 66ba610bee2b..9a29c2dde7d6 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -5098,24 +5098,99 @@ static bool process_pending_cmd(k_timeout_t timeout) static void tx_processor(struct k_work *item) { LOG_DBG("TX process start"); + + /* Historically, the code in process_pending_cmd() and + * bt_conn_tx_processor() has been invoked only from + * cooperative threads. For now, we assume their + * implementations rely on this and ensure the current + * thread is cooperative. + */ + k_sched_lock(); + 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; + goto exit; } /* Hand over control to conn to process pending data */ if (IS_ENABLED(CONFIG_BT_CONN_TX)) { bt_conn_tx_processor(); } + +exit: + k_sched_unlock(); } +/** + * This work item shall never be cancelled. + */ static K_WORK_DEFINE(tx_work, tx_processor); +#if defined(CONFIG_BT_TX_PROCESSOR_THREAD) +static K_THREAD_STACK_DEFINE(bt_tx_processor_stack, CONFIG_BT_TX_PROCESSOR_STACK_SIZE); + +/** + * This work queue shall never be stopped, drained or plugged. + */ +static struct k_work_q bt_tx_processor_workq; + +static int bt_tx_processor_init(void) +{ + struct k_work_queue_config cfg = {}; + + if (IS_ENABLED(CONFIG_THREAD_NAME)) { + cfg.name = "bt_tx_processor"; + } + + k_work_queue_start(&bt_tx_processor_workq, bt_tx_processor_stack, + K_THREAD_STACK_SIZEOF(bt_tx_processor_stack), + CONFIG_BT_TX_PROCESSOR_THREAD_PRIO, &cfg); + + return 0; +} + +/* Priority 999 is the last to run in POST_KERNEL. We don't actually + * care when it runs, so long as it's before APPLICATION, when + * `bt_enable()` can be called. Running it last will allow more urgent + * initializations competing for CPU time to complete first. + */ +SYS_INIT(bt_tx_processor_init, POST_KERNEL, 999); +#endif /* CONFIG_BT_TX_PROCESSOR_THREAD */ + +/** + * This function shall not be called before init level APPLICATION. + */ void bt_tx_irq_raise(void) { + int __maybe_unused err; LOG_DBG("kick TX"); +#if defined(CONFIG_BT_TX_PROCESSOR_THREAD) + err = k_work_submit_to_queue(&bt_tx_processor_workq, &tx_work); + __ASSERT(err >= 0, "%d", err); + /* Assertions: + * + * EBUSY shall not occur because `bt_tx_processor_workq` shall + * never be draining or plugged, and `tx_work` shall never be + * cancelled. + * + * EINVAL is not possible because taking address of variable + * cannot result in the null pointer. + * + * ENODEV shall not occur because `bt_tx_processor_workq` shall + * never be stopped, is started before init level APPLICATION, + * and this function shall not be called before init level + * APPLICATION. + * + * The above is an exhaustive list of the API errors. + * + * Defensive coding: If any error occurs and asserts are + * disabled, the program will recover if bt_tx_irq_raise is + * called again and is successful. No cleanup is needed. + */ +#else k_work_submit(&tx_work); +#endif } From fb15906863e8fff1b3f656817f1345352db96d62 Mon Sep 17 00:00:00 2001 From: Aleksander Wasaznik Date: Tue, 21 Oct 2025 16:50:58 +0200 Subject: [PATCH 0761/3334] [nrf fromtree] Bluetooth: Host: Disable bt_hci_cmd_send_sync workaround The workaround in bt_cmd_send_sync should no longer by needed when tx_processor is not on the system work queue. Upstream PR #: 97913 Signed-off-by: Aleksander Wasaznik (cherry picked from commit 04b8dbae4b758ac18d738acd6c67c8163c62e2bb) Signed-off-by: Kyra Lengfeld --- subsys/bluetooth/host/hci_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 9a29c2dde7d6..2d79870e3a0f 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -472,10 +472,11 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, /* 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. + /* If the commands are processed in the syswq and we are on the + * syswq, then we cannot suspend and wait. We have to send the + * command from the current context. */ - if (k_current_get() == &k_sys_work_q.thread) { + if (!IS_ENABLED(CONFIG_BT_TX_PROCESSOR_THREAD) && 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; From 144ea2e0c027392a3b3fb32a596268f521099850 Mon Sep 17 00:00:00 2001 From: Kyra Lengfeld Date: Fri, 16 Jan 2026 08:41:06 +0100 Subject: [PATCH 0762/3334] [nrf fromlist] Bluetooth: Host: Give option to disable TX processor thread It is not recommended to disable the tx processor thread as otherwise deadlocks may occur, but it has been observed that some boards and configurations may have too little RAM to accommodate the TX processor thread stack. As such BT_TX_PROCESSOR_THREAD gets a prompt. Upstream PR #: 102367 Signed-off-by: Kyra Lengfeld --- subsys/bluetooth/host/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 228a4ce58302..f87bc7beea87 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -136,7 +136,7 @@ config BT_DRIVER_RX_HIGH_PRIO config BT_TX_PROCESSOR_THREAD # This thread is used to send pending HCI Commands, ACL and ISO data to # Controller. - bool + bool "TX processor thread. Disabling may cause deadlocks." # This option is automatically selected for all platforms except nRF51 # due to limited RAM on nRF51 devices. default y if !SOC_SERIES_NRF51X From 9b4ea78809d3ef45b33585183f887c385a8eb9d1 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 14 Nov 2025 18:20:01 +0530 Subject: [PATCH 0763/3334] [nrf fromtree] drivers: nrf_wifi: Fix nRF71 build nRF71 uses a different data structure. Signed-off-by: Chaitanya Tata (cherry picked from commit de09399fa25d2e978978053a3905c4e6fb2c4295) --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 5a69676e47a1..e93e48063805 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -2914,7 +2914,19 @@ int nrf_wifi_wpa_supp_sta_add(void *if_priv, struct hostapd_sta_add_params *para sta_info.sta_flags2.nrf_wifi_set = nrf_wifi_sta_flags_to_nrf(params->flags); sta_info.sta_flags2.nrf_wifi_mask = sta_info.sta_flags2.nrf_wifi_set | nrf_wifi_sta_flags_to_nrf(params->flags_mask); +#ifdef CONFIG_NRF71_ON_IPC + if (params->ht_capabilities) { + memcpy(&sta_info.ht_capability, + params->ht_capabilities, + sizeof(sta_info.ht_capability)); + } + if (params->vht_capabilities) { + memcpy(&sta_info.vht_capability, + params->vht_capabilities, + sizeof(sta_info.vht_capability)); + } +#else if (params->ht_capabilities) { memcpy(sta_info.ht_capability, params->ht_capabilities, @@ -2926,6 +2938,7 @@ int nrf_wifi_wpa_supp_sta_add(void *if_priv, struct hostapd_sta_add_params *para params->vht_capabilities, sizeof(sta_info.vht_capability)); } +#endif memcpy(sta_info.mac_addr, params->addr, sizeof(sta_info.mac_addr)); From c2ea6bb946e4986109ae7326e2da92882b3f443e Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 12 Jan 2026 19:52:27 +0530 Subject: [PATCH 0764/3334] [nrf fromtree] drivers: nrf_wifi: Implement key installation for nRF71 For nRF71 series keys should be installed via PSA-APIs (KMU). Signed-off-by: Chaitanya Tata (cherry picked from commit 23efdfe30996a01134c8e9a15b49d543bd97455c) --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 131 +++++++++++++++++++++++- 1 file changed, 130 insertions(+), 1 deletion(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index e93e48063805..bcb160352178 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -19,6 +19,11 @@ #include "wpa_supp_if.h" #include +#ifdef CONFIG_NRF71_ON_IPC +#include +#include "wifi_keys.h" +#endif + LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); K_SEM_DEFINE(wait_for_event_sem, 0, 1); @@ -964,6 +969,113 @@ int nrf_wifi_wpa_supp_associate(void *if_priv, struct wpa_driver_associate_param return ret; } +#ifdef CONFIG_NRF71_ON_IPC +static bool is_mic_cipher_suite(unsigned int suite) +{ + return (suite == RSN_CIPHER_SUITE_AES_128_CMAC || + suite == RSN_CIPHER_SUITE_BIP_GMAC_128 || + suite == RSN_CIPHER_SUITE_BIP_GMAC_256 || + suite == RSN_CIPHER_SUITE_BIP_CMAC_256); +} + +/* Maximum number of keys we can track (unicast + group keys) */ +#define WIFI_CRYPTO_MAX_KEYS 8 + +/* Track installed keys: key_idx -> key_type mapping */ +static struct { + bool valid; + wifi_keys_key_type_t type; + uint32_t db_id; +} installed_keys[WIFI_CRYPTO_MAX_KEYS]; + +static int wifi_import_key_to_crypto(unsigned int suite, const unsigned char *key, size_t key_len, + const unsigned char *addr, int key_idx, uint32_t db_id) +{ + wifi_keys_key_type_t type; + psa_key_attributes_t attr; + psa_key_id_t key_id; + psa_status_t status; + uint32_t key_index; + bool is_broadcast = false; + + /* Determine if this is a broadcast/group key or unicast/pairwise key */ + if (addr && is_broadcast_ether_addr(addr)) { + is_broadcast = true; + } + + /* Determine key type based on cipher suite and address */ + if (is_mic_cipher_suite(suite)) { + type = is_broadcast ? PEER_BCST_MIC : PEER_UCST_MIC; + } else { + type = is_broadcast ? PEER_BCST_ENC : PEER_UCST_ENC; + } + + /* Convert key_idx to uint32_t, ensure it's within valid range */ + key_index = (key_idx < 0) ? 0 : (uint32_t)key_idx; + + /* Initialize PSA key attributes */ + attr = wifi_keys_key_attributes_init(type, db_id, key_index); + + LOG_DBG("%s: Importing key to PSA (suite: 0x%08x, type: %d, idx: %u, len: %zu)", + __func__, suite, type, key_index, key_len); + + /* Import key to PSA */ + status = psa_import_key(&attr, key, key_len, &key_id); + if (status != PSA_SUCCESS) { + LOG_ERR("%s: Failed to import key to PSA: %d", __func__, status); + return -EIO; + } + + /* Track installed key for later destruction */ + if (key_index < WIFI_CRYPTO_MAX_KEYS) { + installed_keys[key_index].valid = true; + installed_keys[key_index].type = type; + installed_keys[key_index].db_id = db_id; + } + + LOG_DBG("%s: Key imported successfully (type: %d, idx: %u)", __func__, type, key_index); + + return 0; +} + +static int wifi_destroy_key_from_crypto(int key_idx, uint32_t db_id) +{ + psa_key_attributes_t attr; + psa_key_id_t key_id; + psa_status_t status; + uint32_t key_index; + + /* Convert key_idx to uint32_t */ + key_index = (key_idx < 0) ? 0 : (uint32_t)key_idx; + + if (key_index >= WIFI_CRYPTO_MAX_KEYS || !installed_keys[key_index].valid) { + LOG_WRN("%s: No tracked key at index %u", __func__, key_index); + /* During init supplicant deletes all keys, so, suppress error */ + return 0; + } + + /* Get the key type that was used during import */ + attr = wifi_keys_key_attributes_init(installed_keys[key_index].type, + installed_keys[key_index].db_id, key_index); + key_id = psa_get_key_id(&attr); + + LOG_DBG("%s: Destroying key (type: %d, idx: %u, key_id: 0x%08x)", + __func__, installed_keys[key_index].type, key_index, key_id); + + status = psa_destroy_key(key_id); + if (status != PSA_SUCCESS) { + LOG_ERR("%s: Failed to destroy key: %d", __func__, status); + return -EIO; + } + + /* Clear tracking entry */ + installed_keys[key_index].valid = false; + + LOG_DBG("%s: Key destroyed successfully", __func__); + return 0; +} +#endif + int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum wpa_alg alg, const unsigned char *addr, int key_idx, int set_tx, const unsigned char *seq, size_t seq_len, const unsigned char *key, @@ -972,7 +1084,7 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct nrf_wifi_umac_key_info key_info; + struct nrf_wifi_umac_key_info key_info = {0}; const unsigned char *mac_addr = NULL; unsigned int suite; int ret = -1; @@ -1012,7 +1124,15 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w goto out; } +#ifdef CONFIG_NRF71_ON_IPC + ret = wifi_import_key_to_crypto(suite, key, key_len, addr, key_idx, 0); + if (ret) { + LOG_ERR("%s: Failed to import key to crypto: %d", __func__, ret); + goto out; + } +#else memcpy(key_info.key.nrf_wifi_key, key, key_len); +#endif key_info.key.nrf_wifi_key_len = key_len; key_info.cipher_suite = suite; @@ -1050,7 +1170,16 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_sys_fmac_del_key failed", __func__); } else { +#ifdef CONFIG_NRF71_ON_IPC + /* Destroy PSA key after successful del_key */ + ret = wifi_destroy_key_from_crypto(key_idx, 0); + if (ret) { + LOG_ERR("%s: Failed to destroy key from crypto: %d", + __func__, ret); + } +#else ret = 0; +#endif } } else { status = nrf_wifi_sys_fmac_add_key(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, From 758ca16fecb6635c6d2028b48b5c2727d177663c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0765/3334] Revert "[nrf fromtree] drivers: nrf_wifi: Implement key installation for nRF71" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c2ea6bb946e4986109ae7326e2da92882b3f443e. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 131 +----------------------- 1 file changed, 1 insertion(+), 130 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index bcb160352178..e93e48063805 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -19,11 +19,6 @@ #include "wpa_supp_if.h" #include -#ifdef CONFIG_NRF71_ON_IPC -#include -#include "wifi_keys.h" -#endif - LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); K_SEM_DEFINE(wait_for_event_sem, 0, 1); @@ -969,113 +964,6 @@ int nrf_wifi_wpa_supp_associate(void *if_priv, struct wpa_driver_associate_param return ret; } -#ifdef CONFIG_NRF71_ON_IPC -static bool is_mic_cipher_suite(unsigned int suite) -{ - return (suite == RSN_CIPHER_SUITE_AES_128_CMAC || - suite == RSN_CIPHER_SUITE_BIP_GMAC_128 || - suite == RSN_CIPHER_SUITE_BIP_GMAC_256 || - suite == RSN_CIPHER_SUITE_BIP_CMAC_256); -} - -/* Maximum number of keys we can track (unicast + group keys) */ -#define WIFI_CRYPTO_MAX_KEYS 8 - -/* Track installed keys: key_idx -> key_type mapping */ -static struct { - bool valid; - wifi_keys_key_type_t type; - uint32_t db_id; -} installed_keys[WIFI_CRYPTO_MAX_KEYS]; - -static int wifi_import_key_to_crypto(unsigned int suite, const unsigned char *key, size_t key_len, - const unsigned char *addr, int key_idx, uint32_t db_id) -{ - wifi_keys_key_type_t type; - psa_key_attributes_t attr; - psa_key_id_t key_id; - psa_status_t status; - uint32_t key_index; - bool is_broadcast = false; - - /* Determine if this is a broadcast/group key or unicast/pairwise key */ - if (addr && is_broadcast_ether_addr(addr)) { - is_broadcast = true; - } - - /* Determine key type based on cipher suite and address */ - if (is_mic_cipher_suite(suite)) { - type = is_broadcast ? PEER_BCST_MIC : PEER_UCST_MIC; - } else { - type = is_broadcast ? PEER_BCST_ENC : PEER_UCST_ENC; - } - - /* Convert key_idx to uint32_t, ensure it's within valid range */ - key_index = (key_idx < 0) ? 0 : (uint32_t)key_idx; - - /* Initialize PSA key attributes */ - attr = wifi_keys_key_attributes_init(type, db_id, key_index); - - LOG_DBG("%s: Importing key to PSA (suite: 0x%08x, type: %d, idx: %u, len: %zu)", - __func__, suite, type, key_index, key_len); - - /* Import key to PSA */ - status = psa_import_key(&attr, key, key_len, &key_id); - if (status != PSA_SUCCESS) { - LOG_ERR("%s: Failed to import key to PSA: %d", __func__, status); - return -EIO; - } - - /* Track installed key for later destruction */ - if (key_index < WIFI_CRYPTO_MAX_KEYS) { - installed_keys[key_index].valid = true; - installed_keys[key_index].type = type; - installed_keys[key_index].db_id = db_id; - } - - LOG_DBG("%s: Key imported successfully (type: %d, idx: %u)", __func__, type, key_index); - - return 0; -} - -static int wifi_destroy_key_from_crypto(int key_idx, uint32_t db_id) -{ - psa_key_attributes_t attr; - psa_key_id_t key_id; - psa_status_t status; - uint32_t key_index; - - /* Convert key_idx to uint32_t */ - key_index = (key_idx < 0) ? 0 : (uint32_t)key_idx; - - if (key_index >= WIFI_CRYPTO_MAX_KEYS || !installed_keys[key_index].valid) { - LOG_WRN("%s: No tracked key at index %u", __func__, key_index); - /* During init supplicant deletes all keys, so, suppress error */ - return 0; - } - - /* Get the key type that was used during import */ - attr = wifi_keys_key_attributes_init(installed_keys[key_index].type, - installed_keys[key_index].db_id, key_index); - key_id = psa_get_key_id(&attr); - - LOG_DBG("%s: Destroying key (type: %d, idx: %u, key_id: 0x%08x)", - __func__, installed_keys[key_index].type, key_index, key_id); - - status = psa_destroy_key(key_id); - if (status != PSA_SUCCESS) { - LOG_ERR("%s: Failed to destroy key: %d", __func__, status); - return -EIO; - } - - /* Clear tracking entry */ - installed_keys[key_index].valid = false; - - LOG_DBG("%s: Key destroyed successfully", __func__); - return 0; -} -#endif - int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum wpa_alg alg, const unsigned char *addr, int key_idx, int set_tx, const unsigned char *seq, size_t seq_len, const unsigned char *key, @@ -1084,7 +972,7 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; - struct nrf_wifi_umac_key_info key_info = {0}; + struct nrf_wifi_umac_key_info key_info; const unsigned char *mac_addr = NULL; unsigned int suite; int ret = -1; @@ -1124,15 +1012,7 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w goto out; } -#ifdef CONFIG_NRF71_ON_IPC - ret = wifi_import_key_to_crypto(suite, key, key_len, addr, key_idx, 0); - if (ret) { - LOG_ERR("%s: Failed to import key to crypto: %d", __func__, ret); - goto out; - } -#else memcpy(key_info.key.nrf_wifi_key, key, key_len); -#endif key_info.key.nrf_wifi_key_len = key_len; key_info.cipher_suite = suite; @@ -1170,16 +1050,7 @@ int nrf_wifi_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_sys_fmac_del_key failed", __func__); } else { -#ifdef CONFIG_NRF71_ON_IPC - /* Destroy PSA key after successful del_key */ - ret = wifi_destroy_key_from_crypto(key_idx, 0); - if (ret) { - LOG_ERR("%s: Failed to destroy key from crypto: %d", - __func__, ret); - } -#else ret = 0; -#endif } } else { status = nrf_wifi_sys_fmac_add_key(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, From 9d7c463b76e9bf406db494ce84fed856bf4a8427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0766/3334] Revert "[nrf fromtree] drivers: nrf_wifi: Fix nRF71 build" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9b4ea78809d3ef45b33585183f887c385a8eb9d1. Signed-off-by: Tomasz Moń --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index e93e48063805..5a69676e47a1 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -2914,19 +2914,7 @@ int nrf_wifi_wpa_supp_sta_add(void *if_priv, struct hostapd_sta_add_params *para sta_info.sta_flags2.nrf_wifi_set = nrf_wifi_sta_flags_to_nrf(params->flags); sta_info.sta_flags2.nrf_wifi_mask = sta_info.sta_flags2.nrf_wifi_set | nrf_wifi_sta_flags_to_nrf(params->flags_mask); -#ifdef CONFIG_NRF71_ON_IPC - if (params->ht_capabilities) { - memcpy(&sta_info.ht_capability, - params->ht_capabilities, - sizeof(sta_info.ht_capability)); - } - if (params->vht_capabilities) { - memcpy(&sta_info.vht_capability, - params->vht_capabilities, - sizeof(sta_info.vht_capability)); - } -#else if (params->ht_capabilities) { memcpy(sta_info.ht_capability, params->ht_capabilities, @@ -2938,7 +2926,6 @@ int nrf_wifi_wpa_supp_sta_add(void *if_priv, struct hostapd_sta_add_params *para params->vht_capabilities, sizeof(sta_info.vht_capability)); } -#endif memcpy(sta_info.mac_addr, params->addr, sizeof(sta_info.mac_addr)); From 646ad69ad59cd8182608c0aea06b038cf00c40c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0767/3334] Revert "[nrf fromlist] Bluetooth: Host: Give option to disable TX processor thread" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 144ea2e0c027392a3b3fb32a596268f521099850. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index f87bc7beea87..228a4ce58302 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -136,7 +136,7 @@ config BT_DRIVER_RX_HIGH_PRIO config BT_TX_PROCESSOR_THREAD # This thread is used to send pending HCI Commands, ACL and ISO data to # Controller. - bool "TX processor thread. Disabling may cause deadlocks." + bool # This option is automatically selected for all platforms except nRF51 # due to limited RAM on nRF51 devices. default y if !SOC_SERIES_NRF51X From fde523f7344d9b23b3904c6cce1182c246631253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0768/3334] Revert "[nrf fromtree] Bluetooth: Host: Disable bt_hci_cmd_send_sync workaround" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fb15906863e8fff1b3f656817f1345352db96d62. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/hci_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 2d79870e3a0f..9a29c2dde7d6 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -472,11 +472,10 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, /* TODO: disallow sending sync commands from syswq altogether */ - /* If the commands are processed in the syswq and we are on the - * syswq, then we cannot suspend and wait. We have to send the - * command from the current context. + /* Since the commands are now processed in the syswq, we cannot suspend + * and wait. We have to send the command from the current context. */ - if (!IS_ENABLED(CONFIG_BT_TX_PROCESSOR_THREAD) && k_current_get() == &k_sys_work_q.thread) { + 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; From c15cbff81d0e5c447f21c4f4eeb36e229cf63aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0769/3334] Revert "[nrf fromtree] Bluetooth: Host: Run tx processor on its own thread" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ea777518147ec58ebb1c9bbc07d7ab4f72c8706a. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/Kconfig | 20 --------- subsys/bluetooth/host/hci_core.c | 77 +------------------------------- 2 files changed, 1 insertion(+), 96 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 228a4ce58302..e4a381e9b05a 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -133,26 +133,6 @@ config BT_DRIVER_RX_HIGH_PRIO int default 6 -config BT_TX_PROCESSOR_THREAD - # This thread is used to send pending HCI Commands, ACL and ISO data to - # Controller. - bool - # This option is automatically selected for all platforms except nRF51 - # due to limited RAM on nRF51 devices. - default y if !SOC_SERIES_NRF51X - -if BT_TX_PROCESSOR_THREAD - -config BT_TX_PROCESSOR_THREAD_PRIO - int - default SYSTEM_WORKQUEUE_PRIORITY - -config BT_TX_PROCESSOR_STACK_SIZE - int - default 1024 - -endif - config BT_CONN_TX_NOTIFY_WQ bool "Use a separate workqueue for connection TX notify processing [EXPERIMENTAL]" depends on BT_CONN_TX diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 9a29c2dde7d6..66ba610bee2b 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -5098,99 +5098,24 @@ static bool process_pending_cmd(k_timeout_t timeout) static void tx_processor(struct k_work *item) { LOG_DBG("TX process start"); - - /* Historically, the code in process_pending_cmd() and - * bt_conn_tx_processor() has been invoked only from - * cooperative threads. For now, we assume their - * implementations rely on this and ensure the current - * thread is cooperative. - */ - k_sched_lock(); - 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(); - goto exit; + return; } /* Hand over control to conn to process pending data */ if (IS_ENABLED(CONFIG_BT_CONN_TX)) { bt_conn_tx_processor(); } - -exit: - k_sched_unlock(); } -/** - * This work item shall never be cancelled. - */ static K_WORK_DEFINE(tx_work, tx_processor); -#if defined(CONFIG_BT_TX_PROCESSOR_THREAD) -static K_THREAD_STACK_DEFINE(bt_tx_processor_stack, CONFIG_BT_TX_PROCESSOR_STACK_SIZE); - -/** - * This work queue shall never be stopped, drained or plugged. - */ -static struct k_work_q bt_tx_processor_workq; - -static int bt_tx_processor_init(void) -{ - struct k_work_queue_config cfg = {}; - - if (IS_ENABLED(CONFIG_THREAD_NAME)) { - cfg.name = "bt_tx_processor"; - } - - k_work_queue_start(&bt_tx_processor_workq, bt_tx_processor_stack, - K_THREAD_STACK_SIZEOF(bt_tx_processor_stack), - CONFIG_BT_TX_PROCESSOR_THREAD_PRIO, &cfg); - - return 0; -} - -/* Priority 999 is the last to run in POST_KERNEL. We don't actually - * care when it runs, so long as it's before APPLICATION, when - * `bt_enable()` can be called. Running it last will allow more urgent - * initializations competing for CPU time to complete first. - */ -SYS_INIT(bt_tx_processor_init, POST_KERNEL, 999); -#endif /* CONFIG_BT_TX_PROCESSOR_THREAD */ - -/** - * This function shall not be called before init level APPLICATION. - */ void bt_tx_irq_raise(void) { - int __maybe_unused err; LOG_DBG("kick TX"); -#if defined(CONFIG_BT_TX_PROCESSOR_THREAD) - err = k_work_submit_to_queue(&bt_tx_processor_workq, &tx_work); - __ASSERT(err >= 0, "%d", err); - /* Assertions: - * - * EBUSY shall not occur because `bt_tx_processor_workq` shall - * never be draining or plugged, and `tx_work` shall never be - * cancelled. - * - * EINVAL is not possible because taking address of variable - * cannot result in the null pointer. - * - * ENODEV shall not occur because `bt_tx_processor_workq` shall - * never be stopped, is started before init level APPLICATION, - * and this function shall not be called before init level - * APPLICATION. - * - * The above is an exhaustive list of the API errors. - * - * Defensive coding: If any error occurs and asserts are - * disabled, the program will recover if bt_tx_irq_raise is - * called again and is successful. No cleanup is needed. - */ -#else k_work_submit(&tx_work); -#endif } From d63a05ec39c63a43f43816c7438b0e9d72c5d6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0770/3334] Revert "[nrf fromtree] Bluetooth: Samples: Reduce RAM requirement of peripheral_identity" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 91308abed3c4be840e92443f88ba3749e6459c74. Signed-off-by: Tomasz Moń --- samples/bluetooth/peripheral_identity/prj.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/bluetooth/peripheral_identity/prj.conf b/samples/bluetooth/peripheral_identity/prj.conf index d7847c0f7a32..8bd97851e368 100644 --- a/samples/bluetooth/peripheral_identity/prj.conf +++ b/samples/bluetooth/peripheral_identity/prj.conf @@ -6,8 +6,8 @@ CONFIG_BT_PRIVACY=y CONFIG_BT_DEVICE_NAME="Zephyr Peripheral" CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n -CONFIG_BT_MAX_CONN=61 -CONFIG_BT_ID_MAX=61 +CONFIG_BT_MAX_CONN=62 +CONFIG_BT_ID_MAX=62 # CONFIG_BT_SMP=y # CONFIG_BT_MAX_PAIRED=62 From cfd4cc6fa9c72b461487a8e0ede62eac694187f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0771/3334] Revert "[nrf fromtree] Bluetooth: Host: Don't call user callback from TX thread" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ac08b3511a0171dc036def75a77175a7c88891a7. Signed-off-by: Tomasz Moń --- subsys/bluetooth/host/att.c | 81 ++----------------------------------- 1 file changed, 4 insertions(+), 77 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 1d6ded311174..644952f55257 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -249,37 +248,10 @@ const char *bt_att_err_to_str(uint8_t att_err) } #endif /* CONFIG_BT_ATT_ERR_TO_STR */ -static void att_tx_destroy_work_handler(struct k_work *work); -static K_WORK_DEFINE(att_tx_destroy_work, att_tx_destroy_work_handler); -static struct k_spinlock tx_destroy_queue_lock; -static sys_slist_t tx_destroy_queue = SYS_SLIST_STATIC_INIT(&tx_destroy_queue); - -static void att_tx_destroy_work_handler(struct k_work *work) +static void att_tx_destroy(struct net_buf *buf) { - struct net_buf *buf; - struct bt_att_tx_meta_data *p_meta; + struct bt_att_tx_meta_data *p_meta = att_get_tx_meta_data(buf); struct bt_att_tx_meta_data meta; - sys_snode_t *buf_node; - k_spinlock_key_t key; - bool resubmit; - - key = k_spin_lock(&tx_destroy_queue_lock); - buf_node = sys_slist_get(&tx_destroy_queue); - /* If there are more items in the queue, those likely have - * been there before this handler started running and - * coalesced into a single work submission, so we need to - * resubmit. - */ - resubmit = !sys_slist_is_empty(&tx_destroy_queue); - k_spin_unlock(&tx_destroy_queue_lock, key); - - /* Spurious wakeups can occur in with some thread interleavings. */ - if (buf_node == NULL) { - return; - } - - buf = CONTAINER_OF(buf_node, struct net_buf, node); - p_meta = att_get_tx_meta_data(buf); LOG_DBG("%p", buf); @@ -294,8 +266,8 @@ static void att_tx_destroy_work_handler(struct k_work *work) */ memset(p_meta, 0x00, sizeof(*p_meta)); - /* After this point, p_meta doesn't belong to us. The user data will - * be memset to 0 on allocation. + /* After this point, p_meta doesn't belong to us. + * The user data will be memset to 0 on allocation. */ net_buf_destroy(buf); @@ -306,51 +278,6 @@ static void att_tx_destroy_work_handler(struct k_work *work) if (meta.opcode != 0) { att_on_sent_cb(&meta); } - - /* We resubmit this work instead of looping to allow other work on - * the work queue to run. - */ - if (resubmit) { - int err = k_work_submit_to_queue(NULL, work); - - if (err < 0) { - LOG_ERR("Failed to re-submit %s: %d", __func__, err); - k_oops(); - } - } -} - -static void att_tx_destroy(struct net_buf *buf) -{ - int err; - k_spinlock_key_t key; - - /* We need to invoke att_on_sent_cb, which may block. We - * don't want to block in a net buf destroy callback, so we - * defer to a sensible workqueue. - * - * bt_workq cannot be used because it currently forms a - * deadlock with att_pool: bt_workq -> bt_att_recv -> - * send_err_rsp waits for att pool. - * - * We use the system work queue to preserve earlier - * behavior. The tx_processor used to run on the system work - * queue, and it could end up here: tx_processor -> - * bt_hci_send -> net_buf_unref. - * - * A possible alternative is tx_notify_workqueue_get() since - * this workqueue is processing similar "completion" events. - */ - key = k_spin_lock(&tx_destroy_queue_lock); - sys_slist_append(&tx_destroy_queue, &buf->node); - k_spin_unlock(&tx_destroy_queue_lock, key); - - err = k_work_submit(&att_tx_destroy_work); - if (err < 0) { - LOG_ERR("Failed to submit att_tx_destroy_work: %d", err); - k_oops(); - } - /* Continues in att_tx_destroy_work_handler() */ } NET_BUF_POOL_DEFINE(att_pool, CONFIG_BT_ATT_TX_COUNT, From 3e6964ff66913826ebbfd5ff8586d02d16b6ac27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0772/3334] Revert "[nrf fromlist] Bluetooth: fix potential unaligned access in CS HCI fields" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3510a6385d5f5ea4053b06a26cc8365b1e36ea6c. Signed-off-by: Tomasz Moń --- include/zephyr/bluetooth/hci_types.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index 37295f47766c..ebdbe5c926ce 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -3959,7 +3959,7 @@ struct bt_hci_le_cs_step_data_mode_1 { union { int16_t toa_tod_initiator; int16_t tod_toa_reflector; - } __packed; + }; uint8_t packet_antenna; } __packed; @@ -3977,7 +3977,7 @@ struct bt_hci_le_cs_step_data_mode_1_ss_rtt { union { int16_t toa_tod_initiator; int16_t tod_toa_reflector; - } __packed; + }; uint8_t packet_antenna; uint8_t packet_pct1[4]; uint8_t packet_pct2[4]; @@ -4016,7 +4016,7 @@ struct bt_hci_le_cs_step_data_mode_3 { union { int16_t toa_tod_initiator; int16_t tod_toa_reflector; - } __packed; + }; uint8_t packet_antenna; uint8_t antenna_permutation_index; struct bt_hci_le_cs_step_data_tone_info tone_info[]; @@ -4036,7 +4036,7 @@ struct bt_hci_le_cs_step_data_mode_3_ss_rtt { union { int16_t toa_tod_initiator; int16_t tod_toa_reflector; - } __packed; + }; uint8_t packet_antenna; uint8_t packet_pct1[4]; uint8_t packet_pct2[4]; From 9691403ad1f1aea323b4e96bbdf8c875ab6857b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:19 +0100 Subject: [PATCH 0773/3334] Revert "[nrf noup] test-spec: Reduce thingy91 scope" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3fa188c6bf471d851b57537e1433aa8a31e15821. Signed-off-by: Tomasz Moń --- .github/test-spec.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index fc74207ebd5f..ecf8102649dc 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -149,9 +149,14 @@ - "drivers/net/**/*" - "drivers/serial/**/*" - "drivers/timer/**/*" + - "include/**/*" + - "kernel/**/*" - "lib/libc/common/source/stdlib/**/*" - "lib/libc/newlib/**/*" - "lib/libc/picolibc/**/*" + - "lib/os/**/*" + - "lib/posix/**/*" + - "misc/**/*" - "modules/mbedtls/**/*" - "soc/x86/ia32/**/*" - "subsys/fs/fcb/**/*" From dd33e92fc4633c4f4d27793d9a486e3ecd1b5bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0774/3334] Revert "[nrf fromtree] west.yml: Bump TF-M with stm32u5a sram5 support" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a1d9a8db0ea4bbee2e69feec1140e6ce20e62f5e. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index a5ff59c44782..6fbd593140d4 100644 --- a/west.yml +++ b/west.yml @@ -375,7 +375,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: e295109067f71e1c8db76d02396baa050687b1df + revision: 9889df41022c6679b71da55d93f9e3693a804976 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 1ae256f926d81dcda562fe88d97e0066589b5f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0775/3334] Revert "[nrf fromtree] manifest: psa-arch-tests: support for STM32U5 and STM32WBA65" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 117d2df604c6c615316b71c6b2882793c8de9f37. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 6fbd593140d4..a5f6102779df 100644 --- a/west.yml +++ b/west.yml @@ -354,7 +354,7 @@ manifest: path: modules/lib/picolibc revision: ca8b6ebba5226a75545e57a140443168a26ba664 - name: psa-arch-tests - revision: 941cd8436a2e0f1da9d8584b83a403930826899d + revision: afeed6ed87146d9828e0ff862f3533790df8c421 path: modules/tee/tf-m/psa-arch-tests groups: - testing From 233333c6cc543096b34a7bc0ee3ad462cf425de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0776/3334] Revert "[nrf fromtree] manifest: tf-m: update to 2.2.2" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 996773b3817e511889ee48e1d7a921c534ffeeef. Signed-off-by: Tomasz Moń --- west.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/west.yml b/west.yml index a5f6102779df..5f7fe5a6448c 100644 --- a/west.yml +++ b/west.yml @@ -354,7 +354,7 @@ manifest: path: modules/lib/picolibc revision: ca8b6ebba5226a75545e57a140443168a26ba664 - name: psa-arch-tests - revision: afeed6ed87146d9828e0ff862f3533790df8c421 + revision: 87b08682a111ebb085cd8b1ea41d603191d6d146 path: modules/tee/tf-m/psa-arch-tests groups: - testing @@ -365,7 +365,7 @@ manifest: groups: - debug - name: tf-m-tests - revision: cde5b6ed540d3ff5a09564fded6b39b0a70ad3bf + revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 path: modules/tee/tf-m/tf-m-tests groups: - testing @@ -375,7 +375,7 @@ manifest: groups: - tee - name: trusted-firmware-m - revision: 9889df41022c6679b71da55d93f9e3693a804976 + revision: c2f9edc77f72838e7d6f5f9c0b95e4318ddfced1 path: modules/tee/tf-m/trusted-firmware-m groups: - tee From 539059dc5cb88e395b14f3f7c7158b2df557b922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0777/3334] Revert "[nrf fromtree] manifest: move psa-arch-tests to main manifest" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ecd1676ba468a6de86b3e09dbbd1ebf01d2c7138. Signed-off-by: Tomasz Moń --- submanifests/optional.yaml | 6 ++++++ west.yml | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index a97aded1f717..1f49ad1485f1 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -22,6 +22,12 @@ manifest: remote: upstream groups: - optional + - name: psa-arch-tests + revision: 87b08682a111ebb085cd8b1ea41d603191d6d146 + path: modules/tee/tf-m/psa-arch-tests + remote: upstream + groups: + - optional - name: tflite-micro revision: 8d404de73acf7687831e16d88e86e4f73cfddf8e path: optional/modules/lib/tflite-micro diff --git a/west.yml b/west.yml index 5f7fe5a6448c..1f27f2dc4de8 100644 --- a/west.yml +++ b/west.yml @@ -353,12 +353,6 @@ manifest: - name: picolibc path: modules/lib/picolibc revision: ca8b6ebba5226a75545e57a140443168a26ba664 - - name: psa-arch-tests - revision: 87b08682a111ebb085cd8b1ea41d603191d6d146 - path: modules/tee/tf-m/psa-arch-tests - groups: - - testing - - tee - name: segger revision: cf56b1d9c80f81a26e2ac5727c9cf177116a4692 path: modules/debug/segger From fabbe836e4db879650cfc67d76b750bae5a8563b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0778/3334] Revert "[nrf fromtree] manifest: move tf-m-tests to main manifest" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2afa6471eb13a1f6b7f2e8a0c6f0686d9c6cae72. Signed-off-by: Tomasz Moń --- submanifests/optional.yaml | 6 ++++++ west.yml | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 1f49ad1485f1..322a37871bc7 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -28,6 +28,12 @@ manifest: remote: upstream groups: - optional + - name: tf-m-tests + revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 + path: modules/tee/tf-m/tf-m-tests + remote: upstream + groups: + - optional - name: tflite-micro revision: 8d404de73acf7687831e16d88e86e4f73cfddf8e path: optional/modules/lib/tflite-micro diff --git a/west.yml b/west.yml index 1f27f2dc4de8..3b0aa0870733 100644 --- a/west.yml +++ b/west.yml @@ -24,7 +24,7 @@ manifest: - name: babblesim url-base: https://github.com/BabbleSim - group-filter: [-babblesim, -optional, -testing] + group-filter: [-babblesim, -optional] # # Please add items below based on alphabetical order @@ -358,11 +358,6 @@ manifest: path: modules/debug/segger groups: - debug - - name: tf-m-tests - revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 - path: modules/tee/tf-m/tf-m-tests - groups: - - testing - name: trusted-firmware-a revision: 713ffbf96c5bcbdeab757423f10f73eb304eff07 path: modules/tee/tf-a/trusted-firmware-a From 4e655891aba5057be2df371c70618f45df85b955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0779/3334] Revert "[nrf fromtree] soc: intel_adsp: rework host IPC using IPC service" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 93b37e276b473dae8266e696f94ac823b51c0372. Signed-off-by: Tomasz Moń --- .../zephyr/ipc/backends/intel_adsp_host_ipc.h | 213 -------- soc/intel/intel_adsp/Kconfig | 17 +- soc/intel/intel_adsp/common/CMakeLists.txt | 2 +- .../common/include/intel_adsp_ipc.h | 117 ++++- soc/intel/intel_adsp/common/ipc.c | 345 ++++++++++--- .../ipc/ipc_service/backends/CMakeLists.txt | 1 - subsys/ipc/ipc_service/backends/Kconfig | 1 - .../ipc_service/backends/Kconfig.intel_adsp | 11 - .../backends/ipc_intel_adsp_host_ipc.c | 464 ------------------ 9 files changed, 382 insertions(+), 789 deletions(-) delete mode 100644 include/zephyr/ipc/backends/intel_adsp_host_ipc.h delete mode 100644 subsys/ipc/ipc_service/backends/Kconfig.intel_adsp delete mode 100644 subsys/ipc/ipc_service/backends/ipc_intel_adsp_host_ipc.c diff --git a/include/zephyr/ipc/backends/intel_adsp_host_ipc.h b/include/zephyr/ipc/backends/intel_adsp_host_ipc.h deleted file mode 100644 index 74938e53c86f..000000000000 --- a/include/zephyr/ipc/backends/intel_adsp_host_ipc.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2022, 2025 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_IPC_BACKEND_INTEL_ADSP_IPC_H -#define ZEPHYR_INCLUDE_IPC_BACKEND_INTEL_ADSP_IPC_H - -#include -#include -#include -#include - -#include - -/** Enum on IPC send length argument to indicate IPC message type. */ -enum intel_adsp_send_len { - /** Normal IPC message. */ - INTEL_ADSP_IPC_SEND_MSG, - - /** Synchronous IPC message. */ - INTEL_ADSP_IPC_SEND_MSG_SYNC, - - /** Emergency IPC message. */ - INTEL_ADSP_IPC_SEND_MSG_EMERGENCY, - - /** Send a DONE message. */ - INTEL_ADSP_IPC_SEND_DONE, - - /** Query backend to see if IPC is complete. */ - INTEL_ADSP_IPC_SEND_IS_COMPLETE, -}; - -/** Enum on callback return values. */ -enum intel_adsp_cb_ret { - /** Callback return to indicate no issue. Must be 0. */ - INTEL_ADSP_IPC_CB_RET_OKAY = 0, - - /** Callback return to signal needing external completion. */ - INTEL_ADSP_IPC_CB_RET_EXT_COMPLETE, -}; - -/** Enum on callback length argument to indicate which triggers the callback. */ -enum intel_adsp_cb_len { - /** Callback length to indicate this is an IPC message. */ - INTEL_ADSP_IPC_CB_MSG, - - /** Callback length to indicate this is a DONE message. */ - INTEL_ADSP_IPC_CB_DONE, -}; - -/** Struct for IPC message descriptor. */ -struct intel_adsp_ipc_msg { - /** Header specific to platform. */ - uint32_t data; - - /** Extension specific to platform. */ - uint32_t ext_data; - - /** Timeout for sending synchronuous message. */ - k_timeout_t timeout; -}; - -#ifdef CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE - -/** - * @brief Intel ADSP IPC Message Handler Callback. - * - * This function, once registered via intel_adsp_ipc_set_message_handler(), - * is invoked in interrupt context to service messages sent from the - * foreign/connected IPC context. The message contents of the TDR and - * TDD registers are provided in the data/ext_data argument. - * - * The function should return true if processing of the message is - * complete and return notification to the other side (via the TDA - * register) is desired immediately. Returning false means that no - * return "DONE" interrupt will occur until intel_adsp_ipc_complete() is - * called on this device at some point in the future. - * - * @note Further messages on the link will not be transmitted or - * received while an in-progress message remains incomplete! - * - * @param dev IPC device. - * @param arg Registered argument from intel_adsp_ipc_set_message_handler(). - * @param data Message data from other side (low bits of TDR register). - * @param ext_dat Extended message data (TDD register). - * @return true if the message is completely handled. - */ -typedef bool (*intel_adsp_ipc_handler_t)(const struct device *dev, void *arg, uint32_t data, - uint32_t ext_data); - -/** - * @brief Intel ADSP IPC Message Complete Callback. - * - * This function, once registered via intel_adsp_ipc_set_done_handler(), is - * invoked in interrupt context when a "DONE" return interrupt is - * received from the other side of the connection (indicating that a - * previously sent message is finished processing). - * - * @note On Intel ADSP hardware the DONE interrupt is transmitted - * synchronously with the interrupt being cleared on the remote - * device. It is not possible to delay processing. This callback - * will still occur, but protocols which rely on notification of - * asynchronous command processing will need modification. - * - * @param dev IPC device. - * @param arg Registered argument from intel_adsp_ipc_set_done_handler(). - * @return True if IPC completion will be done externally, otherwise false. - * @note Returning True will cause this API to skip writing IPC registers - * signalling IPC message completion and those actions should be done by - * external code manually. Returning false from the handler will perform - * writing to IPC registers signalling message completion normally by this API. - */ -typedef bool (*intel_adsp_ipc_done_t)(const struct device *dev, void *arg); - -#endif /* CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE */ - -#ifdef CONFIG_PM_DEVICE -typedef int (*intel_adsp_ipc_resume_handler_t)(const struct device *dev, void *arg); - -typedef int (*intel_adsp_ipc_suspend_handler_t)(const struct device *dev, void *arg); -#endif /* CONFIG_PM_DEVICE */ - -/** - * Intel Audio DSP IPC service backend config struct. - */ -struct intel_adsp_ipc_config { - /** Pointer to hardware register block. */ - volatile struct intel_adsp_ipc *regs; -}; - -/** - * Intel Audio DSP IPC service backend data struct. - */ -struct intel_adsp_ipc_data { - /** Semaphore used to wait for remote acknowledgment of sent message. */ - struct k_sem sem; - - /** General driver lock. */ - struct k_spinlock lock; - - /** Pending TX acknowlegement. */ - bool tx_ack_pending; - - /** Pointer to endpoint configuration. */ - const struct ipc_ept_cfg *ept_cfg; - -#ifdef CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE - /** Callback for message handler. */ - intel_adsp_ipc_handler_t handle_message; - - /** Argument for message handler callback. */ - void *handler_arg; - - /** Callback for done notification. */ - intel_adsp_ipc_done_t done_notify; - - /** Argument for done notification callback. */ - void *done_arg; -#endif /* CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE */ - -#ifdef CONFIG_PM_DEVICE - /** Pointer to resume handler. */ - intel_adsp_ipc_resume_handler_t resume_fn; - - /** Argument for resume handler. */ - void *resume_fn_args; - - /** Pointer to suspend handler. */ - intel_adsp_ipc_suspend_handler_t suspend_fn; - - /** Argument for suspend handler. */ - void *suspend_fn_args; -#endif /* CONFIG_PM_DEVICE */ -}; - -/** - * Endpoint private data struct. - */ -struct intel_adsp_ipc_ept_priv_data { - /** Callback return value (enum intel_adsp_cb_ret). */ - int cb_ret; - - /** Pointer to additional private data. */ - void *priv; -}; - -#ifdef CONFIG_PM_DEVICE - -/** - * @brief Registers resume callback handler used to resume Device from suspended state. - * - * @param dev IPC device. - * @param fn Callback function. - * @param arg Value to pass as the "arg" parameter to the function. - */ -void intel_adsp_ipc_set_resume_handler(const struct device *dev, intel_adsp_ipc_resume_handler_t fn, - void *arg); - -/** - * @brief Registers suspend callback handler used to suspend active Device. - * - * @param dev IPC device. - * @param fn Callback function. - * @param arg Value to pass as the "arg" parameter to the function. - */ -void intel_adsp_ipc_set_suspend_handler(const struct device *dev, - intel_adsp_ipc_suspend_handler_t fn, void *arg); - -#endif /* CONFIG_PM_DEVICE */ - -#endif /* ZEPHYR_INCLUDE_IPC_BACKEND_INTEL_ADSP_IPC_H */ diff --git a/soc/intel/intel_adsp/Kconfig b/soc/intel/intel_adsp/Kconfig index 7523f167fad2..7e827efad522 100644 --- a/soc/intel/intel_adsp/Kconfig +++ b/soc/intel/intel_adsp/Kconfig @@ -11,7 +11,6 @@ config SOC_FAMILY_INTEL_ADSP select ARCH_HAS_USERSPACE if XTENSA_MMU imply XTENSA_MMU_DOUBLE_MAP select CPU_CACHE_INCOHERENT - select IPC_SERVICE if DT_HAS_INTEL_ADSP_HOST_IPC_ENABLED if SOC_FAMILY_INTEL_ADSP @@ -33,20 +32,14 @@ config INTEL_ADSP_SIM_NO_SECONDARY_CORE_FLOW endif # INTEL_ADSP_SIM +DT_COMPAT_INTEL_ADSP_HOST_IPC := intel,adsp-host-ipc + config INTEL_ADSP_IPC bool "Driver for the host IPC interrupt delivery" - select DEPRECATED - help - Deprecated config for IPC. Will be removed in the future. - -config INTEL_ADSP_IPC_OLD_INTERFACE - bool "Expose old interface for the IPC" - depends on IPC_SERVICE_BACKEND_INTEL_ADSP_HOST_IPC - default y - select INTEL_ADSP_IPC + default $(dt_compat_enabled,$(DT_COMPAT_INTEL_ADSP_HOST_IPC)) if !SOF help - Expose the old IPC interface (intel_adsp_ipc_* functions) to - maintain backward compatibility. + Driver for the host IPC interrupt delivery mechanism. + Currently SOF has its own driver for this hardware. config MEMORY_WIN_0_SIZE int "Size of memory window 0" diff --git a/soc/intel/intel_adsp/common/CMakeLists.txt b/soc/intel/intel_adsp/common/CMakeLists.txt index 9e49bd26eabe..a39e9ea98e77 100644 --- a/soc/intel/intel_adsp/common/CMakeLists.txt +++ b/soc/intel/intel_adsp/common/CMakeLists.txt @@ -9,7 +9,7 @@ zephyr_library_named(intel_adsp_common) zephyr_include_directories(include) zephyr_library_include_directories(${ZEPHYR_BASE}/drivers) -zephyr_library_sources_ifdef(CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE ipc.c) +zephyr_library_sources_ifdef(CONFIG_INTEL_ADSP_IPC ipc.c) zephyr_library_sources_ifdef(CONFIG_GDBSTUB gdbstub_backend_sram.c diff --git a/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h b/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h index 30a8f81360e2..1f283466a735 100644 --- a/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h +++ b/soc/intel/intel_adsp/common/include/intel_adsp_ipc.h @@ -9,9 +9,69 @@ #include #include -#include +struct intel_adsp_ipc_config { + volatile struct intel_adsp_ipc *regs; +}; -#if defined(CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE) || defined(__DOXYGEN__) +/** + * @brief Intel ADSP IPC Message Handler Callback. + * + * This function, once registered via intel_adsp_ipc_set_message_handler(), + * is invoked in interrupt context to service messages sent from the + * foreign/connected IPC context. The message contents of the TDR and + * TDD registers are provided in the data/ext_data argument. + * + * The function should return true if processing of the message is + * complete and return notification to the other side (via the TDA + * register) is desired immediately. Returning false means that no + * return "DONE" interrupt will occur until intel_adsp_ipc_complete() is + * called on this device at some point in the future. + * + * @note Further messages on the link will not be transmitted or + * received while an in-progress message remains incomplete! + * + * @param dev IPC device. + * @param arg Registered argument from intel_adsp_ipc_set_message_handler(). + * @param data Message data from other side (low bits of TDR register). + * @param ext_dat Extended message data (TDD register). + * @return true if the message is completely handled. + */ +typedef bool (*intel_adsp_ipc_handler_t)(const struct device *dev, void *arg, + uint32_t data, uint32_t ext_data); + +/** + * @brief Intel ADSP IPC Message Complete Callback. + * + * This function, once registered via intel_adsp_ipc_set_done_handler(), is + * invoked in interrupt context when a "DONE" return interrupt is + * received from the other side of the connection (indicating that a + * previously sent message is finished processing). + * + * @note On Intel ADSP hardware the DONE interrupt is transmitted + * synchronously with the interrupt being cleared on the remote + * device. It is not possible to delay processing. This callback + * will still occur, but protocols which rely on notification of + * asynchronous command processing will need modification. + * + * @param dev IPC device. + * @param arg Registered argument from intel_adsp_ipc_set_done_handler(). + * @return True if IPC completion will be done externally, otherwise false. + * @note Returning True will cause this API to skip writing IPC registers + * signalling IPC message completion and those actions should be done by + * external code manually. Returning false from the handler will perform + * writing to IPC registers signalling message completion normally by this API. + */ +typedef bool (*intel_adsp_ipc_done_t)(const struct device *dev, void *arg); + +struct intel_adsp_ipc_data { + struct k_sem sem; + struct k_spinlock lock; + intel_adsp_ipc_handler_t handle_message; + void *handler_arg; + intel_adsp_ipc_done_t done_notify; + void *done_arg; + bool tx_ack_pending; +}; /** * @brief Register message callback handler. @@ -38,27 +98,34 @@ void intel_adsp_ipc_set_message_handler(const struct device *dev, void intel_adsp_ipc_set_done_handler(const struct device *dev, intel_adsp_ipc_done_t fn, void *arg); -/** - * @brief Complete an in-progress message. +/** @brief Initialize Intel ADSP IPC device. + * + * Initialize the device. Must be called before any API calls or + * interrupts can be serviced. + * + * @param dev IPC device. + * @return Zero on success, negative codes for error. + */ +int intel_adsp_ipc_init(const struct device *dev); + +/** @brief Complete an in-progress message. * * Notify the other side that the current in-progress message is * complete. This is a noop if no message is in progress. * * @note Further messages on the link will not be transmitted or - * received while an in-progress message remains incomplete! + * received while an in-progress message remains incomplete! * * @param dev IPC device. */ void intel_adsp_ipc_complete(const struct device *dev); -/** - * @brief Message-in-progress predicate. +/** @brief Message-in-progress predicate. * * Returns false if a message has been received but not yet completed * via intel_adsp_ipc_complete(), true otherwise. * * @param dev IPC device. - * * @return True if no message is in progress. */ bool intel_adsp_ipc_is_complete(const struct device *dev); @@ -108,6 +175,38 @@ int intel_adsp_ipc_send_message_sync(const struct device *dev, void intel_adsp_ipc_send_message_emergency(const struct device *dev, uint32_t data, uint32_t ext_data); -#endif /* CONFIG_INTEL_ADSP_IPC_OLD_INTERFACE */ +#ifdef CONFIG_PM_DEVICE + +typedef int (*intel_adsp_ipc_resume_handler_t)(const struct device *dev, void *arg); + +typedef int (*intel_adsp_ipc_suspend_handler_t)(const struct device *dev, void *arg); + +/** + * @brief Registers resume callback handler used to resume Device from suspended state. + * + * @param dev IPC device. + * @param fn Callback function. + * @param arg Value to pass as the "arg" parameter to the function. + */ +void intel_adsp_ipc_set_resume_handler(const struct device *dev, + intel_adsp_ipc_resume_handler_t fn, void *arg); + +/** + * @brief Registers suspend callback handler used to suspend active Device. + * + * @param dev IPC device. + * @param fn Callback function. + * @param arg Value to pass as the "arg" parameter to the function. + */ +void intel_adsp_ipc_set_suspend_handler(const struct device *dev, + intel_adsp_ipc_suspend_handler_t fn, void *arg); + +struct ipc_control_driver_api { + intel_adsp_ipc_resume_handler_t resume_fn; + void *resume_fn_args; + intel_adsp_ipc_suspend_handler_t suspend_fn; + void *suspend_fn_args; +}; +#endif /* CONFIG_PM_DEVICE */ #endif /* ZEPHYR_INCLUDE_INTEL_ADSP_IPC_H */ diff --git a/soc/intel/intel_adsp/common/ipc.c b/soc/intel/intel_adsp/common/ipc.c index aff2c2f70ee6..bceee1b7c2a2 100644 --- a/soc/intel/intel_adsp/common/ipc.c +++ b/soc/intel/intel_adsp/common/ipc.c @@ -1,23 +1,20 @@ -/* - * Copyright (c) 2022, 2025 Intel Corporation - * +/* Copyright (c) 2022 Intel Corporation * SPDX-License-Identifier: Apache-2.0 */ - -#include - -#include -#include + #include #include -#include - -static struct ipc_ept intel_adsp_ipc_ept; -static struct intel_adsp_ipc_ept_priv_data intel_adsp_ipc_priv_data; -static struct ipc_ept_cfg intel_adsp_ipc_ept_cfg; +#include +#include +#include +#include +#include +#include +#include +#include -void intel_adsp_ipc_set_message_handler(const struct device *dev, intel_adsp_ipc_handler_t fn, - void *arg) +void intel_adsp_ipc_set_message_handler(const struct device *dev, + intel_adsp_ipc_handler_t fn, void *arg) { struct intel_adsp_ipc_data *devdata = dev->data; k_spinlock_key_t key = k_spin_lock(&devdata->lock); @@ -27,7 +24,8 @@ void intel_adsp_ipc_set_message_handler(const struct device *dev, intel_adsp_ipc k_spin_unlock(&devdata->lock, key); } -void intel_adsp_ipc_set_done_handler(const struct device *dev, intel_adsp_ipc_done_t fn, void *arg) +void intel_adsp_ipc_set_done_handler(const struct device *dev, + intel_adsp_ipc_done_t fn, void *arg) { struct intel_adsp_ipc_data *devdata = dev->data; k_spinlock_key_t key = k_spin_lock(&devdata->lock); @@ -37,121 +35,314 @@ void intel_adsp_ipc_set_done_handler(const struct device *dev, intel_adsp_ipc_do k_spin_unlock(&devdata->lock, key); } -static void intel_adsp_ipc_receive_cb(const void *data, size_t len, void *priv) +static void intel_adsp_ipc_isr(const void *devarg) { - const struct device *dev = INTEL_ADSP_IPC_HOST_DEV; + const struct device *dev = devarg; + const struct intel_adsp_ipc_config *config = dev->config; struct intel_adsp_ipc_data *devdata = dev->data; - struct intel_adsp_ipc_ept_priv_data *priv_data = - (struct intel_adsp_ipc_ept_priv_data *)priv; - bool done = true; - if (len == INTEL_ADSP_IPC_CB_MSG) { - const struct intel_adsp_ipc_msg *msg = (const struct intel_adsp_ipc_msg *)data; + volatile struct intel_adsp_ipc *regs = config->regs; + k_spinlock_key_t key = k_spin_lock(&devdata->lock); + + if (regs->tdr & INTEL_ADSP_IPC_BUSY) { + bool done = true; if (devdata->handle_message != NULL) { - done = devdata->handle_message(dev, devdata->handler_arg, msg->data, - msg->ext_data); + uint32_t msg = regs->tdr & ~INTEL_ADSP_IPC_BUSY; + uint32_t ext = regs->tdd; + + done = devdata->handle_message(dev, devdata->handler_arg, msg, ext); } + regs->tdr = INTEL_ADSP_IPC_BUSY; if (done) { - priv_data->cb_ret = INTEL_ADSP_IPC_CB_RET_OKAY; - } else { - priv_data->cb_ret = -EBADMSG; +#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE + regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; +#else + regs->tda = INTEL_ADSP_IPC_DONE; +#endif } - } else if (len == INTEL_ADSP_IPC_CB_DONE) { + } + + /* Same signal, but on different bits in 1.5 */ + bool done = (regs->ida & INTEL_ADSP_IPC_DONE); + + if (done) { bool external_completion = false; if (devdata->done_notify != NULL) { external_completion = devdata->done_notify(dev, devdata->done_arg); } - + devdata->tx_ack_pending = false; + /* Allow the system to enter the runtime idle state after the IPC acknowledgment + * is received. + */ + pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); + k_sem_give(&devdata->sem); + + /* IPC completion registers will be set externally */ if (external_completion) { - priv_data->cb_ret = INTEL_ADSP_IPC_CB_RET_EXT_COMPLETE; - } else { - priv_data->cb_ret = INTEL_ADSP_IPC_CB_RET_OKAY; + k_spin_unlock(&devdata->lock, key); + return; } + + regs->ida = INTEL_ADSP_IPC_DONE; } + + k_spin_unlock(&devdata->lock, key); } -void intel_adsp_ipc_complete(const struct device *dev) +int intel_adsp_ipc_init(const struct device *dev) { - int ret; + pm_device_busy_set(dev); + struct intel_adsp_ipc_data *devdata = dev->data; + const struct intel_adsp_ipc_config *config = dev->config; + + memset(devdata, 0, sizeof(*devdata)); + + k_sem_init(&devdata->sem, 0, 1); - ret = ipc_service_send(&intel_adsp_ipc_ept, NULL, INTEL_ADSP_IPC_SEND_DONE); + /* ACK any latched interrupts (including TDA to clear IDA on + * the other side!), then enable. + */ + config->regs->tdr = INTEL_ADSP_IPC_BUSY; + config->regs->ida = INTEL_ADSP_IPC_DONE; +#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE + config->regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; +#else + config->regs->tda = INTEL_ADSP_IPC_DONE; +#endif + config->regs->ctl |= (INTEL_ADSP_IPC_CTL_IDIE | INTEL_ADSP_IPC_CTL_TBIE); + pm_device_busy_clear(dev); - ARG_UNUSED(ret); + return 0; } -bool intel_adsp_ipc_is_complete(const struct device *dev) +void intel_adsp_ipc_complete(const struct device *dev) { - int ret; + const struct intel_adsp_ipc_config *config = dev->config; + +#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE + config->regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; +#else + config->regs->tda = INTEL_ADSP_IPC_DONE; +#endif +} - ret = ipc_service_send(&intel_adsp_ipc_ept, NULL, INTEL_ADSP_IPC_SEND_IS_COMPLETE); +bool intel_adsp_ipc_is_complete(const struct device *dev) +{ + const struct intel_adsp_ipc_config *config = dev->config; + const struct intel_adsp_ipc_data *devdata = dev->data; + bool not_busy = (config->regs->idr & INTEL_ADSP_IPC_BUSY) == 0; - return ret == 0; + return not_busy && !devdata->tx_ack_pending; } -int intel_adsp_ipc_send_message(const struct device *dev, uint32_t data, uint32_t ext_data) +int intel_adsp_ipc_send_message(const struct device *dev, + uint32_t data, uint32_t ext_data) { - struct intel_adsp_ipc_msg msg = {.data = data, .ext_data = ext_data}; - int ret; +#ifdef CONFIG_PM_DEVICE + enum pm_device_state current_state; - ret = ipc_service_send(&intel_adsp_ipc_ept, &msg, INTEL_ADSP_IPC_SEND_MSG); + if (pm_device_state_get(INTEL_ADSP_IPC_HOST_DEV, ¤t_state) != 0 || + current_state != PM_DEVICE_STATE_ACTIVE) { + return -ESHUTDOWN; + } +#endif - if (ret < 0) { - return ret; + pm_device_busy_set(dev); + const struct intel_adsp_ipc_config *config = dev->config; + struct intel_adsp_ipc_data *devdata = dev->data; + k_spinlock_key_t key = k_spin_lock(&devdata->lock); + + if ((config->regs->idr & INTEL_ADSP_IPC_BUSY) != 0 || devdata->tx_ack_pending) { + k_spin_unlock(&devdata->lock, key); + return -EBUSY; } + k_sem_reset(&devdata->sem); + /* Prevent entering runtime idle state until IPC acknowledgment is received. */ + pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); + devdata->tx_ack_pending = true; + config->regs->idd = ext_data; + config->regs->idr = data | INTEL_ADSP_IPC_BUSY; + k_spin_unlock(&devdata->lock, key); + pm_device_busy_clear(dev); return 0; } -int intel_adsp_ipc_send_message_sync(const struct device *dev, uint32_t data, uint32_t ext_data, - k_timeout_t timeout) +int intel_adsp_ipc_send_message_sync(const struct device *dev, + uint32_t data, uint32_t ext_data, + k_timeout_t timeout) { - struct intel_adsp_ipc_msg msg = { - .data = data, - .ext_data = ext_data, - .timeout = timeout, - }; - int ret; + struct intel_adsp_ipc_data *devdata = dev->data; - ret = ipc_service_send(&intel_adsp_ipc_ept, &msg, INTEL_ADSP_IPC_SEND_MSG_SYNC); + int ret = intel_adsp_ipc_send_message(dev, data, ext_data); - if (ret < 0) { - return ret; + if (!ret) { + k_sem_take(&devdata->sem, timeout); } - - return 0; + return ret; } void intel_adsp_ipc_send_message_emergency(const struct device *dev, uint32_t data, uint32_t ext_data) { - struct intel_adsp_ipc_msg msg = {.data = data, .ext_data = ext_data}; - int ret; + const struct intel_adsp_ipc_config * const config = dev->config; + + volatile struct intel_adsp_ipc * const regs = config->regs; + bool done; + + /* check if host is processing message. */ + while (regs->idr & INTEL_ADSP_IPC_BUSY) { + k_busy_wait(1); + } - ret = ipc_service_send(&intel_adsp_ipc_ept, &msg, INTEL_ADSP_IPC_SEND_MSG_EMERGENCY); + /* check if host has pending acknowledge msg + * Same signal, but on different bits in 1.5 + */ + done = regs->ida & INTEL_ADSP_IPC_DONE; + if (done) { + /* IPC completion */ + regs->ida = INTEL_ADSP_IPC_DONE; + } - ARG_UNUSED(ret); + regs->idd = ext_data; + regs->idr = data | INTEL_ADSP_IPC_BUSY; } -static struct ipc_ept_cfg intel_adsp_ipc_ept_cfg = { - .name = "intel_adsp_ipc_ept", - .cb = { - .received = intel_adsp_ipc_receive_cb, - }, - .priv = (void *)&intel_adsp_ipc_priv_data, -}; +#if DT_NODE_EXISTS(INTEL_ADSP_IPC_HOST_DTNODE) + +#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) +static inline void ace_ipc_intc_unmask(void) +{ + ACE_DINT[0].ie[ACE_INTL_HIPC] = BIT(0); +} +#else +static inline void ace_ipc_intc_unmask(void) {} +#endif + +static int dt_init(const struct device *dev) +{ + IRQ_CONNECT(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE), 0, intel_adsp_ipc_isr, + INTEL_ADSP_IPC_HOST_DEV, 0); + irq_enable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); + + ace_ipc_intc_unmask(); + + return intel_adsp_ipc_init(dev); +} + +#ifdef CONFIG_PM_DEVICE + +void intel_adsp_ipc_set_resume_handler(const struct device *dev, + intel_adsp_ipc_resume_handler_t fn, void *arg) +{ + struct ipc_control_driver_api *api = + (struct ipc_control_driver_api *)dev->api; + struct intel_adsp_ipc_data *devdata = dev->data; + k_spinlock_key_t key = k_spin_lock(&devdata->lock); -static int intel_adsp_ipc_old_init(void) + api->resume_fn = fn; + api->resume_fn_args = arg; + + k_spin_unlock(&devdata->lock, key); +} + +void intel_adsp_ipc_set_suspend_handler(const struct device *dev, + intel_adsp_ipc_suspend_handler_t fn, void *arg) { - int ret; - const struct device *ipc_dev = INTEL_ADSP_IPC_HOST_DEV; + struct ipc_control_driver_api *api = + (struct ipc_control_driver_api *)dev->api; + struct intel_adsp_ipc_data *devdata = dev->data; + k_spinlock_key_t key = k_spin_lock(&devdata->lock); - ret = ipc_service_register_endpoint(ipc_dev, &intel_adsp_ipc_ept, &intel_adsp_ipc_ept_cfg); + api->suspend_fn = fn; + api->suspend_fn_args = arg; + + k_spin_unlock(&devdata->lock, key); +} + +/** + * @brief Manages IPC driver power state change. + * + * @param dev IPC device. + * @param action Power state to be changed to. + * @return int Returns 0 on success or optionaly error code from the + * registered ipc_power_control_api callbacks. + * + * @note PM lock is taken at the start of each power transition to prevent concurrent calls + * to @ref pm_device_action_run function. + * If IPC Device performs hardware operation and device is busy (what should not happen) + * function returns failure. It is API user responsibility to make sure we are not entering + * device power transition while device is busy. + */ +static int ipc_pm_action(const struct device *dev, enum pm_device_action action) +{ + if (pm_device_is_busy(INTEL_ADSP_IPC_HOST_DEV)) { + return -EBUSY; + } + + const struct ipc_control_driver_api *api = + (const struct ipc_control_driver_api *)dev->api; + + int ret = 0; + + switch (action) { + case PM_DEVICE_ACTION_SUSPEND: + if (api->suspend_fn) { + ret = api->suspend_fn(dev, api->suspend_fn_args); + if (!ret) { + irq_disable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); + } + } + break; + case PM_DEVICE_ACTION_RESUME: + irq_enable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); + if (!irq_is_enabled(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE))) { + ret = -EINTR; + break; + } + ace_ipc_intc_unmask(); + ret = intel_adsp_ipc_init(dev); + if (ret) { + break; + } + if (api->resume_fn) { + ret = api->resume_fn(dev, api->resume_fn_args); + } + break; + default: + /* Return as default value when given PM action is not supported */ + return -ENOTSUP; + } return ret; } -/* Backend is at PRE_KERNEL_2:0, so we need to init after that. */ -SYS_INIT(intel_adsp_ipc_old_init, PRE_KERNEL_2, 1); +/** + * @brief Callback functions to be executed by Zephyr application + * during IPC device suspend and resume. + */ +static struct ipc_control_driver_api ipc_power_control_api = { + .resume_fn = NULL, + .resume_fn_args = NULL, + .suspend_fn = NULL, + .suspend_fn_args = NULL +}; + +PM_DEVICE_DT_DEFINE(INTEL_ADSP_IPC_HOST_DTNODE, ipc_pm_action); + +#endif /* CONFIG_PM_DEVICE */ + +static const struct intel_adsp_ipc_config ipc_host_config = { + .regs = (void *)INTEL_ADSP_IPC_REG_ADDRESS, +}; + +static struct intel_adsp_ipc_data ipc_host_data; + +DEVICE_DT_DEFINE(INTEL_ADSP_IPC_HOST_DTNODE, dt_init, PM_DEVICE_DT_GET(INTEL_ADSP_IPC_HOST_DTNODE), + &ipc_host_data, &ipc_host_config, PRE_KERNEL_2, 0, COND_CODE_1(CONFIG_PM_DEVICE, + (&ipc_power_control_api), (NULL))); + +#endif /* DT_NODE_EXISTS(INTEL_ADSP_IPC_HOST_DTNODE) */ diff --git a/subsys/ipc/ipc_service/backends/CMakeLists.txt b/subsys/ipc/ipc_service/backends/CMakeLists.txt index 37c62b88e000..d6ca8fb76c33 100644 --- a/subsys/ipc/ipc_service/backends/CMakeLists.txt +++ b/subsys/ipc/ipc_service/backends/CMakeLists.txt @@ -4,5 +4,4 @@ zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICMSG ipc_icmsg.c) zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICMSG_ME_INITIATOR ipc_icmsg_me_initiator.c) zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICMSG_ME_FOLLOWER ipc_icmsg_me_follower.c) zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICBMSG ipc_icbmsg.c) -zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_INTEL_ADSP_HOST_IPC ipc_intel_adsp_host_ipc.c) zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_RPMSG ipc_rpmsg_static_vrings.c) diff --git a/subsys/ipc/ipc_service/backends/Kconfig b/subsys/ipc/ipc_service/backends/Kconfig index 5677c609d410..bb8b444898f9 100644 --- a/subsys/ipc/ipc_service/backends/Kconfig +++ b/subsys/ipc/ipc_service/backends/Kconfig @@ -50,5 +50,4 @@ config IPC_SERVICE_BACKEND_ICMSG_ME_FOLLOWER rsource "Kconfig.icmsg_me" rsource "Kconfig.icbmsg" -rsource "Kconfig.intel_adsp" rsource "Kconfig.rpmsg" diff --git a/subsys/ipc/ipc_service/backends/Kconfig.intel_adsp b/subsys/ipc/ipc_service/backends/Kconfig.intel_adsp deleted file mode 100644 index 47a884310d7a..000000000000 --- a/subsys/ipc/ipc_service/backends/Kconfig.intel_adsp +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright (c) 2025 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 -# - -config IPC_SERVICE_BACKEND_INTEL_ADSP_HOST_IPC - bool "Backend for the Intel Audio DSP Host IPC" - default DT_HAS_INTEL_ADSP_HOST_IPC_ENABLED - help - IPC Service Backend for Intel Audio DSP Host IPC. diff --git a/subsys/ipc/ipc_service/backends/ipc_intel_adsp_host_ipc.c b/subsys/ipc/ipc_service/backends/ipc_intel_adsp_host_ipc.c deleted file mode 100644 index 274e13c9ea6d..000000000000 --- a/subsys/ipc/ipc_service/backends/ipc_intel_adsp_host_ipc.c +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright (c) 2022, 2025 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * - * @brief IPC service backend for Intel Audio DSP host IPC - * - * @note When declaring struct ipt_ept_cfg, the field priv must point to - * a struct intel_adsp_ipc_ept_priv_data. This is used for passing - * callback returns. - * - * @note For sending message and the received callback, the data and len - * arguments are not used to represent a byte array. Instead, - * the data argument points to the descriptor of data to be sent - * (of struct intel_adsp_ipc_msg). The len argument represents - * the type of message to be sent (enum intel_adsp_send_len) and - * the type of callback (enum intel_adsp_cb_len). - */ - -#define DT_DRV_COMPAT intel_adsp_host_ipc - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -static inline void ace_ipc_intc_mask(void) -{ -#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) - ACE_DINT[0].ie[ACE_INTL_HIPC] = ACE_DINT[0].ie[ACE_INTL_HIPC] & ~BIT(0); -#endif -} - -static inline void ace_ipc_intc_unmask(void) -{ -#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) - ACE_DINT[0].ie[ACE_INTL_HIPC] = BIT(0); -#endif -} - -static void intel_adsp_ipc_isr(const void *devarg) -{ - const struct device *dev = devarg; - const struct intel_adsp_ipc_config *config = dev->config; - struct intel_adsp_ipc_data *devdata = dev->data; - const struct ipc_ept_cfg *ept_cfg = devdata->ept_cfg; - - struct intel_adsp_ipc_ept_priv_data *priv_data = - (struct intel_adsp_ipc_ept_priv_data *)ept_cfg->priv; - - volatile struct intel_adsp_ipc *regs = config->regs; - k_spinlock_key_t key = k_spin_lock(&devdata->lock); - - if (regs->tdr & INTEL_ADSP_IPC_BUSY) { - bool done = true; - - if (ept_cfg->cb.received != NULL) { - struct intel_adsp_ipc_msg cb_msg = { - .data = regs->tdr & ~INTEL_ADSP_IPC_BUSY, - .ext_data = regs->tdd, - }; - - ept_cfg->cb.received(&cb_msg, INTEL_ADSP_IPC_CB_MSG, ept_cfg->priv); - - done = (priv_data->cb_ret == INTEL_ADSP_IPC_CB_RET_OKAY); - } - - regs->tdr = INTEL_ADSP_IPC_BUSY; - if (done) { -#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE - regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; -#else - regs->tda = INTEL_ADSP_IPC_DONE; -#endif - } - } - - /* Same signal, but on different bits in 1.5 */ - bool done = (regs->ida & INTEL_ADSP_IPC_DONE); - - if (done) { - bool external_completion = false; - - if (ept_cfg->cb.received != NULL) { - ept_cfg->cb.received(NULL, INTEL_ADSP_IPC_CB_DONE, ept_cfg->priv); - - if (priv_data->cb_ret == INTEL_ADSP_IPC_CB_RET_EXT_COMPLETE) { - external_completion = true; - } - } - - devdata->tx_ack_pending = false; - - /* - * Allow the system to enter the runtime idle state after the IPC acknowledgment - * is received. - */ - pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); - k_sem_give(&devdata->sem); - - /* IPC completion registers will be set externally. */ - if (external_completion) { - k_spin_unlock(&devdata->lock, key); - return; - } - - regs->ida = INTEL_ADSP_IPC_DONE; - } - - k_spin_unlock(&devdata->lock, key); -} - -int intel_adsp_ipc_init(const struct device *dev) -{ - pm_device_busy_set(dev); - struct intel_adsp_ipc_data *devdata = dev->data; - const struct intel_adsp_ipc_config *config = dev->config; - - k_sem_init(&devdata->sem, 0, 1); - - /* ACK any latched interrupts (including TDA to clear IDA on - * the other side!), then enable. - */ - config->regs->tdr = INTEL_ADSP_IPC_BUSY; - config->regs->ida = INTEL_ADSP_IPC_DONE; -#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE - config->regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; -#else - config->regs->tda = INTEL_ADSP_IPC_DONE; -#endif - config->regs->ctl |= (INTEL_ADSP_IPC_CTL_IDIE | INTEL_ADSP_IPC_CTL_TBIE); - pm_device_busy_clear(dev); - - return 0; -} - -static int intel_adsp_ipc_register_ept(const struct device *instance, void **token, - const struct ipc_ept_cfg *cfg) -{ - struct intel_adsp_ipc_data *data = instance->data; - - data->ept_cfg = cfg; - - irq_enable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); - ace_ipc_intc_unmask(); - - return 0; -} - -static int intel_adsp_ipc_deregister_ept(const struct device *instance, void *token) -{ - struct intel_adsp_ipc_data *data = instance->data; - - data->ept_cfg = NULL; - - ace_ipc_intc_mask(); - irq_disable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); - - return 0; -} - -static void ipc_complete(const struct device *dev) -{ - const struct intel_adsp_ipc_config *config = dev->config; - -#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE - config->regs->tda = INTEL_ADSP_IPC_ACE1X_TDA_DONE; -#else - config->regs->tda = INTEL_ADSP_IPC_DONE; -#endif -} - -static bool ipc_is_complete(const struct device *dev) -{ - const struct intel_adsp_ipc_config *config = dev->config; - const struct intel_adsp_ipc_data *devdata = dev->data; - bool not_busy = (config->regs->idr & INTEL_ADSP_IPC_BUSY) == 0; - - return not_busy && !devdata->tx_ack_pending; -} - -static int ipc_send_message(const struct device *dev, uint32_t data, uint32_t ext_data) -{ -#ifdef CONFIG_PM_DEVICE - enum pm_device_state current_state; - - if (pm_device_state_get(INTEL_ADSP_IPC_HOST_DEV, ¤t_state) != 0 || - current_state != PM_DEVICE_STATE_ACTIVE) { - return -ESHUTDOWN; - } -#endif - - pm_device_busy_set(dev); - const struct intel_adsp_ipc_config *config = dev->config; - struct intel_adsp_ipc_data *devdata = dev->data; - k_spinlock_key_t key = k_spin_lock(&devdata->lock); - - if ((config->regs->idr & INTEL_ADSP_IPC_BUSY) != 0 || devdata->tx_ack_pending) { - k_spin_unlock(&devdata->lock, key); - return -EBUSY; - } - - k_sem_reset(&devdata->sem); - - /* Prevent entering runtime idle state until IPC acknowledgment is received. */ - pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); - - devdata->tx_ack_pending = true; - - config->regs->idd = ext_data; - config->regs->idr = data | INTEL_ADSP_IPC_BUSY; - - k_spin_unlock(&devdata->lock, key); - - pm_device_busy_clear(dev); - - return 0; -} - -static int ipc_send_message_sync(const struct device *dev, uint32_t data, uint32_t ext_data, - k_timeout_t timeout) -{ - struct intel_adsp_ipc_data *devdata = dev->data; - - int ret = ipc_send_message(dev, data, ext_data); - - if (ret == 0) { - k_sem_take(&devdata->sem, timeout); - } - - return ret; -} - -static int ipc_send_message_emergency(const struct device *dev, uint32_t data, uint32_t ext_data) -{ - const struct intel_adsp_ipc_config *const config = dev->config; - - volatile struct intel_adsp_ipc *const regs = config->regs; - bool done; - - /* check if host is processing message. */ - while (regs->idr & INTEL_ADSP_IPC_BUSY) { - k_busy_wait(1); - } - - /* check if host has pending acknowledge msg - * Same signal, but on different bits in 1.5 - */ - done = regs->ida & INTEL_ADSP_IPC_DONE; - if (done) { - /* IPC completion */ - regs->ida = INTEL_ADSP_IPC_DONE; - } - - regs->idd = ext_data; - regs->idr = data | INTEL_ADSP_IPC_BUSY; - - return 0; -} - -/** - * @brief Send an IPC message. - * - * This implements the inner working of ipc_service_send(). - * - * @note Arguments @a data and @a len are not used to point to a byte buffer of data - * to be sent. Instead, @a data must point to a descriptor of data to be sent, - * struct intel_adsp_ipc_msg. And @a len indicates what type of message to send - * as described in enum intel_adsp_send_len. - * - * Return values for various message types: - * - For INTEL_ADSP_IPC_SEND_MSG_*, returns 0 when message is sent. Negative errno if - * errors. - * - For INTEL_ADSP_IPC_SEND_DONE, always returns 0 for sending DONE message. - * - For INTEL_ADSP_IPC_SEND_IS_COMPLETE, returns 0 if host has processed the message. - * -EAGAIN if not. - * - * @param[in] dev Pointer to device struct. - * @param[in] token Backend-specific token. - * @param[in] data Descriptor of IPC message to be sent (as struct intel_adsp_ipc_msg). - * @param[in] len Type of message to be sent (described in enum intel_adsp_send_len). - * - * @return 0 if message is sent successfully or query returns okay. - * Negative errno otherwise. - */ -static int intel_adsp_ipc_send(const struct device *dev, void *token, const void *data, size_t len) -{ - int ret; - - const struct intel_adsp_ipc_msg *msg = (const struct intel_adsp_ipc_msg *)data; - - switch (len) { - case INTEL_ADSP_IPC_SEND_MSG: { - ret = ipc_send_message(dev, msg->data, msg->ext_data); - - break; - } - case INTEL_ADSP_IPC_SEND_MSG_SYNC: { - ret = ipc_send_message_sync(dev, msg->data, msg->ext_data, msg->timeout); - - break; - } - case INTEL_ADSP_IPC_SEND_MSG_EMERGENCY: { - ret = ipc_send_message_emergency(dev, msg->data, msg->ext_data); - - break; - } - case INTEL_ADSP_IPC_SEND_DONE: { - ipc_complete(dev); - - ret = 0; - - break; - } - case INTEL_ADSP_IPC_SEND_IS_COMPLETE: { - bool completed = ipc_is_complete(dev); - - if (completed) { - ret = 0; - } else { - ret = -EAGAIN; - } - - break; - } - default: - ret = -EBADMSG; - - break; - } - - return ret; -} - -static int intel_adsp_ipc_dt_init(const struct device *dev) -{ - struct intel_adsp_ipc_data *devdata = dev->data; - - memset(devdata, 0, sizeof(*devdata)); - - IRQ_CONNECT(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE), 0, intel_adsp_ipc_isr, - INTEL_ADSP_IPC_HOST_DEV, 0); - - return intel_adsp_ipc_init(dev); -} - -#ifdef CONFIG_PM_DEVICE - -void intel_adsp_ipc_set_resume_handler(const struct device *dev, intel_adsp_ipc_resume_handler_t fn, - void *arg) -{ - struct intel_adsp_ipc_data *devdata = dev->data; - k_spinlock_key_t key = k_spin_lock(&devdata->lock); - - devdata->resume_fn = fn; - devdata->resume_fn_args = arg; - - k_spin_unlock(&devdata->lock, key); -} - -void intel_adsp_ipc_set_suspend_handler(const struct device *dev, - intel_adsp_ipc_suspend_handler_t fn, void *arg) -{ - struct intel_adsp_ipc_data *devdata = dev->data; - k_spinlock_key_t key = k_spin_lock(&devdata->lock); - - devdata->suspend_fn = fn; - devdata->suspend_fn_args = arg; - - k_spin_unlock(&devdata->lock, key); -} - -/** - * @brief Manages IPC driver power state change. - * - * @param dev IPC device. - * @param action Power state to be changed to. - * - * @return int Returns 0 on success or optionaly error code from the - * registered ipc_power_control_api callbacks. - * - * @note PM lock is taken at the start of each power transition to prevent concurrent calls - * to @ref pm_device_action_run function. - * If IPC Device performs hardware operation and device is busy (what should not happen) - * function returns failure. It is API user responsibility to make sure we are not entering - * device power transition while device is busy. - */ -static int ipc_pm_action(const struct device *dev, enum pm_device_action action) -{ - if (pm_device_is_busy(INTEL_ADSP_IPC_HOST_DEV)) { - return -EBUSY; - } - - struct intel_adsp_ipc_data *devdata = dev->data; - - int ret = 0; - - switch (action) { - case PM_DEVICE_ACTION_SUSPEND: - if (devdata->suspend_fn) { - ret = devdata->suspend_fn(dev, devdata->suspend_fn_args); - if (!ret) { - irq_disable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); - } - } - break; - case PM_DEVICE_ACTION_RESUME: - irq_enable(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE)); - if (!irq_is_enabled(DT_IRQN(INTEL_ADSP_IPC_HOST_DTNODE))) { - ret = -EINTR; - break; - } - ace_ipc_intc_unmask(); - ret = intel_adsp_ipc_init(dev); - if (ret) { - break; - } - if (devdata->resume_fn) { - ret = devdata->resume_fn(dev, devdata->resume_fn_args); - } - break; - default: - /* Return as default value when given PM action is not supported */ - return -ENOTSUP; - } - - return ret; -} - -PM_DEVICE_DT_DEFINE(INTEL_ADSP_IPC_HOST_DTNODE, ipc_pm_action); - -#endif /* CONFIG_PM_DEVICE */ - -static const struct intel_adsp_ipc_config ipc_host_config = { - .regs = (void *)INTEL_ADSP_IPC_REG_ADDRESS, -}; - -static struct intel_adsp_ipc_data ipc_host_data; - -const static struct ipc_service_backend intel_adsp_ipc_backend_api = { - .send = intel_adsp_ipc_send, - .register_endpoint = intel_adsp_ipc_register_ept, - .deregister_endpoint = intel_adsp_ipc_deregister_ept, -}; - -DEVICE_DT_DEFINE(INTEL_ADSP_IPC_HOST_DTNODE, intel_adsp_ipc_dt_init, - PM_DEVICE_DT_GET(INTEL_ADSP_IPC_HOST_DTNODE), &ipc_host_data, &ipc_host_config, - PRE_KERNEL_2, 0, &intel_adsp_ipc_backend_api); From b6555ca17ae5495b7f952284974a2a5ca1a0e22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0780/3334] Revert "[nrf fromtree] soc: intel_adsp: remove IDC dt default for CONFIG_INTEL_ADSP_IPC" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 20624439864ce673025781c7e344a650319bde29. Signed-off-by: Tomasz Moń --- soc/intel/intel_adsp/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/soc/intel/intel_adsp/Kconfig b/soc/intel/intel_adsp/Kconfig index 7e827efad522..27a8e838b67b 100644 --- a/soc/intel/intel_adsp/Kconfig +++ b/soc/intel/intel_adsp/Kconfig @@ -33,10 +33,12 @@ config INTEL_ADSP_SIM_NO_SECONDARY_CORE_FLOW endif # INTEL_ADSP_SIM DT_COMPAT_INTEL_ADSP_HOST_IPC := intel,adsp-host-ipc +DT_COMPAT_INTEL_ADSP_IDC := intel,adsp-idc config INTEL_ADSP_IPC bool "Driver for the host IPC interrupt delivery" default $(dt_compat_enabled,$(DT_COMPAT_INTEL_ADSP_HOST_IPC)) if !SOF + default $(dt_compat_enabled,$(DT_COMPAT_INTEL_ADSP_IDC)) if !SOF help Driver for the host IPC interrupt delivery mechanism. Currently SOF has its own driver for this hardware. From 0bb4be928f37baf6b8dd2531f6951f1d44e92fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0781/3334] Revert "[nrf fromtree] west_commands: do not depend on CONFIG_SOF" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e6b3e0b3b2dd7ab62e1a2a38aff1610a4295254. Signed-off-by: Tomasz Moń --- scripts/west_commands/sign.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/west_commands/sign.py b/scripts/west_commands/sign.py index c90361a1447b..c6fa273138e5 100644 --- a/scripts/west_commands/sign.py +++ b/scripts/west_commands/sign.py @@ -585,8 +585,8 @@ def sign(self, command, build_dir, build_conf, formats): # Non-SOF build does not have extended manifest data for # rimage to process, which might result in rimage error. # So skip it when not doing SOF builds. - rimage_schema = build_conf.get('CONFIG_RIMAGE_SIGNING_SCHEMA', None) - if rimage_schema is None: + is_sof_build = build_conf.getboolean('CONFIG_SOF') + if not is_sof_build: no_manifest = True self.generate_uuid_registry() From 5c63fea472e4f11fccdbf225a1b505054ccf2ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0782/3334] Revert "[nrf fromtree] intel_adsp: remove workaround for SOF setting core count" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0b4c20513d1a1439bb7aeb03725271178c83e982. Signed-off-by: Tomasz Moń --- soc/intel/intel_adsp/Kconfig.defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/soc/intel/intel_adsp/Kconfig.defconfig b/soc/intel/intel_adsp/Kconfig.defconfig index f69bc31cd8c7..1d8312e7fb6c 100644 --- a/soc/intel/intel_adsp/Kconfig.defconfig +++ b/soc/intel/intel_adsp/Kconfig.defconfig @@ -8,6 +8,11 @@ if SOC_FAMILY_INTEL_ADSP rsource "*/Kconfig.defconfig.series" # A workaround for HWMv2 to recover SOF arch/xtensa defaults overridden by arch/host. +if SOF +config CORE_COUNT + int + default MP_MAX_NUM_CPUS +endif config XTENSA_RPO_CACHE def_bool y From 77e92c43eafb6a04db1b2239a5f14cf73f7aba03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0783/3334] Revert "[nrf fromtree] manifest: optional: remove sof from optional manifest" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aae5fd0e4608d7740f1a22a29550e1476b9ae038. Signed-off-by: Tomasz Moń --- MAINTAINERS.yml | 14 ++++++++++++++ modules/Kconfig | 1 + modules/Kconfig.sof | 11 +++++++++++ submanifests/optional.yaml | 6 ++++++ 4 files changed, 32 insertions(+) create mode 100644 modules/Kconfig.sof diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index f689445af543..2018a6ed356b 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -5803,6 +5803,20 @@ West: labels: - "area: Debugging" +"West project: sof": + status: maintained + maintainers: + - kv2019i + collaborators: + - andyross + - nashif + - lyakh + - lgirdwood + files: + - modules/Kconfig.sof + labels: + - "area: Audio" + "West project: tf-m-tests": status: maintained maintainers: diff --git a/modules/Kconfig b/modules/Kconfig index cd29dc3ccc88..b66955981fa0 100644 --- a/modules/Kconfig +++ b/modules/Kconfig @@ -36,6 +36,7 @@ source "modules/Kconfig.picolibc" source "modules/Kconfig.renesas" source "modules/Kconfig.rust" source "modules/Kconfig.simplelink" +source "modules/Kconfig.sof" source "modules/Kconfig.stm32" source "modules/Kconfig.syst" source "modules/Kconfig.telink" diff --git a/modules/Kconfig.sof b/modules/Kconfig.sof new file mode 100644 index 000000000000..4a0b94186606 --- /dev/null +++ b/modules/Kconfig.sof @@ -0,0 +1,11 @@ +# Copyright (c) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +config ZEPHYR_SOF_MODULE + bool + +config SOF + bool "Sound Open Firmware (SOF)" + depends on ZEPHYR_SOF_MODULE + help + Build Sound Open Firmware (SOF) support. diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 322a37871bc7..04accf4152c0 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -28,6 +28,12 @@ manifest: remote: upstream groups: - optional + - name: sof + revision: ba8de7551f88a4f8d4533791274fa85b37ec332e + path: modules/audio/sof + remote: upstream + groups: + - optional - name: tf-m-tests revision: a90702bcb8fadb6f70daf0ffbb13888dfe63fc99 path: modules/tee/tf-m/tf-m-tests From 397aacad9a5cc0db90cd63fc6b38a1ee216d45c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0784/3334] Revert "[nrf fromtree] west: Sync picolibc with SDK 0.17.4" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 81746f3e0e16abd6f7c9197bf14077c895c89d1f. Signed-off-by: Tomasz Moń --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 3b0aa0870733..ad7e9a53ca14 100644 --- a/west.yml +++ b/west.yml @@ -352,7 +352,7 @@ manifest: - debug - name: picolibc path: modules/lib/picolibc - revision: ca8b6ebba5226a75545e57a140443168a26ba664 + revision: 560946f26db075c296beea5b39d99e6de43c9010 - name: segger revision: cf56b1d9c80f81a26e2ac5727c9cf177116a4692 path: modules/debug/segger From 3de43a99aab65c4bc1134abf1813bae5a7da27e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0785/3334] Revert "[nrf fromtree] modules/psa-arch-tests: Add GCC 14.3 support patch" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cbb84932bce92a3399c936a497185cb5cc6d3191. Signed-off-by: Tomasz Moń --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 04accf4152c0..724ab8d1fb30 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -23,7 +23,7 @@ manifest: groups: - optional - name: psa-arch-tests - revision: 87b08682a111ebb085cd8b1ea41d603191d6d146 + revision: 10fd24782323fc3faf6c787959f4a9d4130bedb8 path: modules/tee/tf-m/psa-arch-tests remote: upstream groups: From b5fe0bb3990fbe91de4000bc278c229daab97349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0786/3334] Revert "[nrf fromtree] manifest: psa-arch-tests: update to 24.03_API1.6_CRYPTO_1.1.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5f818fb49e0be65721e9510ca5f7617c762e2574. Signed-off-by: Tomasz Moń --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 724ab8d1fb30..57ad7affdd1c 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -23,7 +23,7 @@ manifest: groups: - optional - name: psa-arch-tests - revision: 10fd24782323fc3faf6c787959f4a9d4130bedb8 + revision: 2cadb02a72eacda7042505dcbdd492371e8ce024 path: modules/tee/tf-m/psa-arch-tests remote: upstream groups: From c408b29b89d011ce92f056449e43b96575c0d738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0787/3334] Revert "[nrf fromtree] modules: tfm: don't pad unconfirmed image" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 32c8db8cd8fbdb589d789b5ed07ee64019bb0a1b. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 0fc884cf79fa..95e034f19532 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -612,7 +612,7 @@ if (CONFIG_BUILD_WITH_TFM) HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" - HEADER MAX_SECTORS ${S_NS_MAX_SECTORS} + HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands From e032f0475f3a6eb4911d60980ad143f72dfca927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:20 +0100 Subject: [PATCH 0788/3334] Revert "[nrf fromtree] modules: tfm: disable SECURE_UART when TFM_LOG_LEVEL_SILENCE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7a7e6050499a7e34cfe5886dc2fa4bfc3726892a. Signed-off-by: Tomasz Moń --- doc/releases/migration-guide-4.4.rst | 7 ------- modules/trusted-firmware-m/CMakeLists.txt | 6 ------ modules/trusted-firmware-m/Kconfig.tfm | 9 --------- 3 files changed, 22 deletions(-) diff --git a/doc/releases/migration-guide-4.4.rst b/doc/releases/migration-guide-4.4.rst index 6919f84e875c..762082635b1c 100644 --- a/doc/releases/migration-guide-4.4.rst +++ b/doc/releases/migration-guide-4.4.rst @@ -57,12 +57,5 @@ Other subsystems Modules ******* -Trusted Firmware-M -================== - -* The ``SECURE_UART1`` TF-M define is now controlled by Zephyr's - :kconfig:option:`CONFIG_TFM_SECURE_UART`. This option will override any platform values previously - specified in the TF-M repository. - Architectures ************* diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 95e034f19532..afebaaf0ea1e 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -156,12 +156,6 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DTFM_SPM_LOG_LEVEL=${TFM_SPM_LOG_LEVEL}) endif() - if(CONFIG_TFM_SECURE_UART) - list(APPEND TFM_CMAKE_ARGS -DSECURE_UART1=1) - else() - list(APPEND TFM_CMAKE_ARGS -DSECURE_UART1=0) - endif() - # Enable TFM partitions as specified in Kconfig foreach(partition ${TFM_VALID_PARTITIONS}) if (CONFIG_${partition}) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index 6a8140b23d5a..f587ea01e45f 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -475,15 +475,6 @@ config TFM_SPM_LOG_LEVEL_SILENCE bool "Off" endchoice -config TFM_SECURE_UART - bool "TF-M configure UART instance as secure peripheral" - default y if SOC_FAMILY_NORDIC_NRF && !TFM_LOG_LEVEL_SILENCE - help - Configure the UART instance as a secure peripheral for TF-M logging. - This makes the UART instance unavailable to the non-secure application. - When this option is selected the device tree node for the UART instance - needs to be disabled for the non-secure application. - config TFM_EXCEPTION_INFO_DUMP bool "TF-M exception info dump" default y From 8b4a5101bc2bac7b7de91156c9047264380b410d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0789/3334] Revert "[nrf fromtree] modules: tf-m: generate `tfm_merged.bin` from `tfm_merged.hex`" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b2030949c3671dd07f0fa62057819b21efc7f9a5. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index afebaaf0ea1e..934dd47b06d2 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -622,13 +622,17 @@ if (CONFIG_BUILD_WITH_TFM) $<$:$> $<$>:$> ${S_NS_SIGNED_CONFIRMED_HEX_FILE} - - COMMAND ${CMAKE_OBJCOPY} --input-target=ihex --output-target=binary ${MERGED_HEX_FILE} ${MERGED_BIN_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${sign_cmd_s_ns_hex} + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py + -o ${MERGED_BIN_FILE} --output-bin + $<$:$> + $<$>:$> + ${S_NS_SIGNED_HEX_FILE} + COMMAND ${CMAKE_OBJCOPY} --input-target=ihex --output-target=binary ${S_NS_SIGNED_HEX_FILE} ${S_NS_SIGNED_BIN_FILE} ) @@ -636,7 +640,6 @@ if (CONFIG_BUILD_WITH_TFM) ${S_NS_SIGNED_CONFIRMED_HEX_FILE} ${S_NS_HEX_FILE} ${S_NS_SIGNED_HEX_FILE} - ${S_NS_SIGNED_BIN_FILE} ${MERGED_HEX_FILE} ${MERGED_BIN_FILE} ) From 979dffe49ccc981bcf867207a3621bf9b9a38414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0790/3334] Revert "[nrf fromtree] modules: tf-m: generate `tfm_s_zephyr_ns_signed.bin`" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4bef51034ff0d5b936a63c3fa28dcfad506c08c7. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 934dd47b06d2..6ffefd6b93c0 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -572,7 +572,6 @@ if (CONFIG_BUILD_WITH_TFM) set(S_NS_SIGNED_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed_signed.hex) set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) - set(S_NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.bin) set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin) @@ -632,8 +631,6 @@ if (CONFIG_BUILD_WITH_TFM) $<$:$> $<$>:$> ${S_NS_SIGNED_HEX_FILE} - - COMMAND ${CMAKE_OBJCOPY} --input-target=ihex --output-target=binary ${S_NS_SIGNED_HEX_FILE} ${S_NS_SIGNED_BIN_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts From 8820d9794d3b7c882fddff971afdb128556d02b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0791/3334] Revert "[nrf fromtree] modules: tf-m: remove `S_NS_CONFIRMED_HEX_FILE`" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e72f74202a801f7c3de683b0c3fb389af854a998. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 6ffefd6b93c0..ff965457da42 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -569,6 +569,7 @@ if (CONFIG_BUILD_WITH_TFM) set(MERGED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) set(MERGED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.bin) + set(S_NS_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed.hex) set(S_NS_SIGNED_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed_signed.hex) set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) @@ -603,14 +604,14 @@ if (CONFIG_BUILD_WITH_TFM) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") tfm_sign(sign_cmd_s_ns_confirm_hex SUFFIX "S_NS" HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) + INPUT_FILE ${S_NS_CONFIRMED_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${S_NS_HEX_FILE} + -o ${S_NS_CONFIRMED_HEX_FILE} $ ${NS_HEX_APP_FILE} @@ -624,6 +625,11 @@ if (CONFIG_BUILD_WITH_TFM) ) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py + -o ${S_NS_HEX_FILE} + $ + ${NS_HEX_APP_FILE} + COMMAND ${sign_cmd_s_ns_hex} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -634,6 +640,7 @@ if (CONFIG_BUILD_WITH_TFM) ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts + ${S_NS_CONFIRMED_HEX_FILE} ${S_NS_SIGNED_CONFIRMED_HEX_FILE} ${S_NS_HEX_FILE} ${S_NS_SIGNED_HEX_FILE} From 794f11549796ace335d31246669fc1590b4e2076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0792/3334] Revert "[nrf fromtree] modules: tf-m: fix CMake formatting" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd0806832f39000cf61d30d2e7635015c1c0cf96. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index ff965457da42..0e10598c9c75 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -319,8 +319,8 @@ if (CONFIG_BUILD_WITH_TFM) # number of parallel jobs to 1. set(PARALLEL_JOBS -j 1) else() - # Leave PARALLEL_JOBS unset and use the default number of - # threads. Which is num_cores+2 on Ninja and MAKEFLAGS with Make. + # Leave PARALLEL_JOBS unset and use the default number of + # threads. Which is num_cores+2 on Ninja and MAKEFLAGS with Make. endif() set(tfm_image_info MAP "name: tfm, source-dir: ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}") From 851dfa7fef98ca105f30d00912dac984413d4aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0793/3334] Revert "[nrf fromtree] trusted-firmware-m: Generate tfm_merged.bin" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4b3e3125029f3370087d172266c9ea527f4ef97e. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 24 ----------------------- 1 file changed, 24 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 0e10598c9c75..bc5a847bac0c 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -568,11 +568,8 @@ if (CONFIG_BUILD_WITH_TFM) endfunction() set(MERGED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) - set(MERGED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.bin) set(S_NS_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed.hex) set(S_NS_SIGNED_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed_signed.hex) - set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) - set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin) @@ -605,9 +602,6 @@ if (CONFIG_BUILD_WITH_TFM) tfm_sign(sign_cmd_s_ns_confirm_hex SUFFIX "S_NS" HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} INPUT_FILE ${S_NS_CONFIRMED_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) - tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" - HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -624,28 +618,10 @@ if (CONFIG_BUILD_WITH_TFM) ${S_NS_SIGNED_CONFIRMED_HEX_FILE} ) - set_property(GLOBAL APPEND PROPERTY extra_post_build_commands - COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${S_NS_HEX_FILE} - $ - ${NS_HEX_APP_FILE} - - COMMAND ${sign_cmd_s_ns_hex} - - COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${MERGED_BIN_FILE} --output-bin - $<$:$> - $<$>:$> - ${S_NS_SIGNED_HEX_FILE} - ) - set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts ${S_NS_CONFIRMED_HEX_FILE} ${S_NS_SIGNED_CONFIRMED_HEX_FILE} - ${S_NS_HEX_FILE} - ${S_NS_SIGNED_HEX_FILE} ${MERGED_HEX_FILE} - ${MERGED_BIN_FILE} ) else() From 6e7c946ffe9128240acbacf3aa04122d9b6e78af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0794/3334] Revert "[nrf fromtree] trusted-firmware-m: Prepare to generate tfm_merged.bin" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 16248e3f5ad717507f36859b6692f9ee3b7976a7. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index bc5a847bac0c..df8843f48749 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -568,8 +568,8 @@ if (CONFIG_BUILD_WITH_TFM) endfunction() set(MERGED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) - set(S_NS_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed.hex) - set(S_NS_SIGNED_CONFIRMED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_confirmed_signed.hex) + set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) + set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin) @@ -599,28 +599,28 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd_s_ns_confirm_hex SUFFIX "S_NS" + tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${S_NS_CONFIRMED_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_CONFIRMED_HEX_FILE}) + INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${S_NS_CONFIRMED_HEX_FILE} + -o ${S_NS_HEX_FILE} $ ${NS_HEX_APP_FILE} - COMMAND ${sign_cmd_s_ns_confirm_hex} + COMMAND ${sign_cmd_s_ns_hex} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py -o ${MERGED_HEX_FILE} $<$:$> $<$>:$> - ${S_NS_SIGNED_CONFIRMED_HEX_FILE} + ${S_NS_SIGNED_HEX_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${S_NS_CONFIRMED_HEX_FILE} - ${S_NS_SIGNED_CONFIRMED_HEX_FILE} + ${S_NS_HEX_FILE} + ${S_NS_SIGNED_HEX_FILE} ${MERGED_HEX_FILE} ) From 47c93418140d9a16a9637dc3763f44e4202d74d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0795/3334] Revert "[nrf fromtree] trusted-firmware-m: Use cmake_parse_arguments in tfm_sign" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 95f7f3d2db5edb7b12f76bbdeb95894aff88f29a. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 97 ++++++++--------------- 1 file changed, 31 insertions(+), 66 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index df8843f48749..bad05a439730 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -503,67 +503,45 @@ if (CONFIG_BUILD_WITH_TFM) endif() endif() - function(tfm_sign OUT_ARG) - set(options HEADER TRAILER CONFIRM) - set(oneValueArgs SUFFIX MAX_SECTORS INPUT_FILE OUTPUT_FILE) - set(multiValueArgs "") - - cmake_parse_arguments( - TFM_SIGN_ARG - "${options}" - "${oneValueArgs}" - "${multiValueArgs}" - ${ARGN} - ) - - if(NOT DEFINED TFM_SIGN_ARG_SUFFIX OR - NOT DEFINED TFM_SIGN_ARG_INPUT_FILE OR - NOT DEFINED TFM_SIGN_ARG_OUTPUT_FILE) - message(FATAL_ERROR "SUFFIX, INPUT_FILE and OUTPUT_FILE are required arguments") - endif() - - set(pad_args "") - if(TFM_SIGN_ARG_HEADER AND TFM_SIGN_ARG_TRAILER) + function(tfm_sign OUT_ARG SUFFIX HEADER TRAILER CONFIRM MAX_SECTORS INPUT_FILE OUTPUT_FILE) + if(HEADER AND TRAILER) set(pad_args --pad --pad-header) - elseif(TFM_SIGN_ARG_HEADER) + elseif(HEADER) set(pad_args --pad-header) - elseif(TFM_SIGN_ARG_TRAILER) + elseif(TRAILER) set(pad_args --pad) endif() - - set(confirm "") - if(TFM_SIGN_ARG_CONFIRM) + if(CONFIRM) + # --confirm imply PAD set(confirm --confirm) endif() - # Secure + Non-secure images are signed the same way as a secure only # build, but with a different layout file. - set(layout_file ${PREPROCESSED_FILE_${TFM_SIGN_ARG_SUFFIX}}) - if(TFM_SIGN_ARG_SUFFIX STREQUAL "S_NS") - set(TFM_SIGN_ARG_SUFFIX "S") + set(layout_file ${PREPROCESSED_FILE_${SUFFIX}}) + if(SUFFIX STREQUAL "S_NS") + set(SUFFIX "S") endif() - - set(${OUT_ARG} + set (${OUT_ARG} # Add the MCUBoot script to the path so that if there is a version of imgtool in there then # it gets used over the system imgtool. Used so that imgtool from upstream # mcuboot is preferred over system imgtool ${CMAKE_COMMAND} -E env PYTHONPATH=${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts ${PYTHON_EXECUTABLE} ${TFM_MCUBOOT_DIR}/scripts/wrapper/wrapper.py --layout ${layout_file} - -k ${CONFIG_TFM_KEY_FILE_${TFM_SIGN_ARG_SUFFIX}} + -k ${CONFIG_TFM_KEY_FILE_${SUFFIX}} --public-key-format ${TFM_PUBLIC_KEY_FORMAT} --align ${image_alignment} - --max-sectors ${TFM_SIGN_ARG_MAX_SECTORS} - -v ${CONFIG_TFM_IMAGE_VERSION_${TFM_SIGN_ARG_SUFFIX}} + --max-sectors ${MAX_SECTORS} + -v ${CONFIG_TFM_IMAGE_VERSION_${SUFFIX}} ${pad_args} ${confirm} - ${HEX_ADDR_ARGS_${TFM_SIGN_ARG_SUFFIX}} - ${ADD_${TFM_SIGN_ARG_SUFFIX}_IMAGE_MIN_VER} + ${HEX_ADDR_ARGS_${SUFFIX}} + ${ADD_${SUFFIX}_IMAGE_MIN_VER} -s ${CONFIG_TFM_IMAGE_SECURITY_COUNTER} --measured-boot-record -H ${CONFIG_ROM_START_OFFSET} - ${TFM_SIGN_ARG_INPUT_FILE} - ${TFM_SIGN_ARG_OUTPUT_FILE} + ${INPUT_FILE} + ${OUTPUT_FILE} PARENT_SCOPE) endfunction() @@ -599,9 +577,8 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd_s_ns_hex SUFFIX "S_NS" - HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${S_NS_HEX_FILE} OUTPUT_FILE ${S_NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_s_ns_hex S_NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_HEX_FILE} + ${S_NS_SIGNED_HEX_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -626,33 +603,21 @@ if (CONFIG_BUILD_WITH_TFM) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns_hex SUFFIX "NS" - HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${NS_HEX_APP_FILE} - OUTPUT_FILE ${NS_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_ns_bin SUFFIX "NS" - HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${NS_BIN_APP_FILE} - OUTPUT_FILE ${NS_SIGNED_BIN_FILE}) + tfm_sign(sign_cmd_ns_hex NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} + ${NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_ns_bin NS TRUE TRUE FALSE ${S_NS_MAX_SECTORS} ${NS_BIN_APP_FILE} + ${NS_SIGNED_BIN_FILE}) else() - tfm_sign(sign_cmd_ns_hex SUFFIX "NS" - TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${NS_HEX_APP_FILE} - OUTPUT_FILE ${NS_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_ns_bin SUFFIX "NS" - MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE ${NS_BIN_APP_FILE} - OUTPUT_FILE ${NS_SIGNED_BIN_FILE}) + tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} + ${NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_ns_bin NS FALSE FALSE FALSE ${S_NS_MAX_SECTORS} ${NS_BIN_APP_FILE} + ${NS_SIGNED_BIN_FILE}) endif() - tfm_sign(sign_cmd_s_hex SUFFIX "S" - HEADER TRAILER CONFIRM MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE $ - OUTPUT_FILE ${S_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_s_bin SUFFIX "S" - HEADER TRAILER MAX_SECTORS ${S_NS_MAX_SECTORS} - INPUT_FILE $ - OUTPUT_FILE ${S_SIGNED_BIN_FILE}) + tfm_sign(sign_cmd_s_hex S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} + $ ${S_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_s_bin S TRUE TRUE FALSE ${S_NS_MAX_SECTORS} + $ ${S_SIGNED_BIN_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands From a757ef824bb92ba6844eb0f0397a88e2bc81641f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0796/3334] Revert "[nrf fromtree] trusted-firmware-m: Create multi image bin files" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 454fb7df91b8881be99518c5b595ddd2741432de. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index bad05a439730..b331b599743b 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -185,7 +185,7 @@ if (CONFIG_BUILD_WITH_TFM) set(TFM_S_ELF_FILE ${TFM_BINARY_DIR}/bin/tfm_s.elf) set(TFM_S_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_s.bin) set(TFM_S_HEX_FILE ${TFM_BINARY_DIR}/bin/tfm_s.hex) - set(TFM_NS_BIN_FILE ${CMAKE_BINARY_DIR}/tfm_ns/bin/tfm_ns.bin) + set(TFM_NS_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_ns.bin) set(TFM_NS_HEX_FILE ${CMAKE_BINARY_DIR}/tfm_ns/bin/tfm_ns.hex) set(TFM_S_SIGNED_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_s_signed.bin) set(TFM_NS_SIGNED_BIN_FILE ${TFM_BINARY_DIR}/bin/tfm_ns_signed.bin) @@ -550,17 +550,13 @@ if (CONFIG_BUILD_WITH_TFM) set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) - set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin) - set(S_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.bin) if (CONFIG_TFM_USE_NS_APP) # Use the TF-M NS binary as the Non-Secure application firmware image set(NS_HEX_APP_FILE $) - set(NS_BIN_APP_FILE $) else() # Use the Zephyr binary as the Non-Secure application firmware image set(NS_HEX_APP_FILE ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_HEX_NAME}) - set(NS_BIN_APP_FILE ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_BIN_NAME}) endif() if (NOT CONFIG_TFM_BL2) @@ -605,26 +601,18 @@ if (CONFIG_BUILD_WITH_TFM) if (CONFIG_TFM_USE_NS_APP) tfm_sign(sign_cmd_ns_hex NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} ${NS_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_ns_bin NS TRUE TRUE FALSE ${S_NS_MAX_SECTORS} ${NS_BIN_APP_FILE} - ${NS_SIGNED_BIN_FILE}) else() tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} ${NS_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_ns_bin NS FALSE FALSE FALSE ${S_NS_MAX_SECTORS} ${NS_BIN_APP_FILE} - ${NS_SIGNED_BIN_FILE}) endif() tfm_sign(sign_cmd_s_hex S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} $ ${S_SIGNED_HEX_FILE}) - tfm_sign(sign_cmd_s_bin S TRUE TRUE FALSE ${S_NS_MAX_SECTORS} - $ ${S_SIGNED_BIN_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${sign_cmd_ns_hex} - COMMAND ${sign_cmd_ns_bin} COMMAND ${sign_cmd_s_hex} - COMMAND ${sign_cmd_s_bin} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py -o ${MERGED_HEX_FILE} @@ -636,9 +624,7 @@ if (CONFIG_BUILD_WITH_TFM) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts ${S_SIGNED_HEX_FILE} - ${S_SIGNED_BIN_FILE} ${NS_SIGNED_HEX_FILE} - ${NS_SIGNED_BIN_FILE} ${MERGED_HEX_FILE} ) endif() From f2ba53499549aff31b83615e79172301c4dc1121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0797/3334] Revert "[nrf fromtree] trusted-firmware-m: Make hex files variables explicit" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dda50fe19bc7c781aa6dff1b72d5aea2a2e5f55e. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 65 +++++++++++------------ 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index b331b599743b..a738a49835b7 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -545,87 +545,84 @@ if (CONFIG_BUILD_WITH_TFM) PARENT_SCOPE) endfunction() - set(MERGED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) - set(S_NS_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) - set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) - set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) - set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) + set(MERGED_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex) + set(S_NS_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns.hex) + set(S_NS_SIGNED_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex) + set(NS_SIGNED_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex) + set(S_SIGNED_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex) if (CONFIG_TFM_USE_NS_APP) # Use the TF-M NS binary as the Non-Secure application firmware image - set(NS_HEX_APP_FILE $) + set(NS_APP_FILE $) else() # Use the Zephyr binary as the Non-Secure application firmware image - set(NS_HEX_APP_FILE ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_HEX_NAME}) + set(NS_APP_FILE ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_HEX_NAME}) endif() if (NOT CONFIG_TFM_BL2) # Merge tfm_s and zephyr (NS) image to a single binary. set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${MERGED_HEX_FILE} + -o ${MERGED_FILE} $ - ${NS_HEX_APP_FILE} + ${NS_APP_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${MERGED_HEX_FILE} + ${MERGED_FILE} ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd_s_ns_hex S_NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_HEX_FILE} - ${S_NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd S_NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${S_NS_HEX_FILE} + -o ${S_NS_FILE} $ - ${NS_HEX_APP_FILE} + ${NS_APP_FILE} - COMMAND ${sign_cmd_s_ns_hex} + COMMAND ${sign_cmd} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${MERGED_HEX_FILE} + -o ${MERGED_FILE} $<$:$> $<$>:$> - ${S_NS_SIGNED_HEX_FILE} + ${S_NS_SIGNED_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${S_NS_HEX_FILE} - ${S_NS_SIGNED_HEX_FILE} - ${MERGED_HEX_FILE} + ${S_NS_FILE} + ${S_NS_SIGNED_FILE} + ${MERGED_FILE} ) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns_hex NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} - ${NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_ns NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_HEX_APP_FILE} - ${NS_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) endif() - tfm_sign(sign_cmd_s_hex S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} - $ ${S_SIGNED_HEX_FILE}) + tfm_sign(sign_cmd_s S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} $ + ${S_SIGNED_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands - COMMAND ${sign_cmd_ns_hex} - COMMAND ${sign_cmd_s_hex} + COMMAND ${sign_cmd_ns} + COMMAND ${sign_cmd_s} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py - -o ${MERGED_HEX_FILE} + -o ${MERGED_FILE} $<$:$> $<$>:$> - ${S_SIGNED_HEX_FILE} - ${NS_SIGNED_HEX_FILE} + ${S_SIGNED_FILE} + ${NS_SIGNED_FILE} ) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts - ${S_SIGNED_HEX_FILE} - ${NS_SIGNED_HEX_FILE} - ${MERGED_HEX_FILE} + ${S_SIGNED_FILE} + ${NS_SIGNED_FILE} + ${MERGED_FILE} ) endif() From 1f84a9a3e75e63df52a55ad1a64c0d687fe73afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0798/3334] Revert "[nrf fromtree] trusted-firmware-m: Set --confirm when signing" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c89cc0bc514707088e78380930bff7eb17d113a6. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index a738a49835b7..93a04c0db9e2 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -503,7 +503,7 @@ if (CONFIG_BUILD_WITH_TFM) endif() endif() - function(tfm_sign OUT_ARG SUFFIX HEADER TRAILER CONFIRM MAX_SECTORS INPUT_FILE OUTPUT_FILE) + function(tfm_sign OUT_ARG SUFFIX HEADER TRAILER MAX_SECTORS INPUT_FILE OUTPUT_FILE) if(HEADER AND TRAILER) set(pad_args --pad --pad-header) elseif(HEADER) @@ -511,10 +511,6 @@ if (CONFIG_BUILD_WITH_TFM) elseif(TRAILER) set(pad_args --pad) endif() - if(CONFIRM) - # --confirm imply PAD - set(confirm --confirm) - endif() # Secure + Non-secure images are signed the same way as a secure only # build, but with a different layout file. set(layout_file ${PREPROCESSED_FILE_${SUFFIX}}) @@ -534,7 +530,6 @@ if (CONFIG_BUILD_WITH_TFM) --max-sectors ${MAX_SECTORS} -v ${CONFIG_TFM_IMAGE_VERSION_${SUFFIX}} ${pad_args} - ${confirm} ${HEX_ADDR_ARGS_${SUFFIX}} ${ADD_${SUFFIX}_IMAGE_MIN_VER} -s ${CONFIG_TFM_IMAGE_SECURITY_COUNTER} @@ -573,7 +568,7 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd S_NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) + tfm_sign(sign_cmd S_NS TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -598,12 +593,12 @@ if (CONFIG_BUILD_WITH_TFM) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns NS TRUE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS FALSE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) endif() - tfm_sign(sign_cmd_s S TRUE TRUE TRUE ${S_NS_MAX_SECTORS} $ + tfm_sign(sign_cmd_s S TRUE TRUE ${S_NS_MAX_SECTORS} $ ${S_SIGNED_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 From f252a7331a331a08233e866efbfdd87b2ef94db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0799/3334] Revert "[nrf fromtree] trusted-firmware-m: Define header and trailer options" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5c0dccb158ae1a086fa5a997fd00706731fb0d6a. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 93a04c0db9e2..a6d645afb4c8 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -503,13 +503,9 @@ if (CONFIG_BUILD_WITH_TFM) endif() endif() - function(tfm_sign OUT_ARG SUFFIX HEADER TRAILER MAX_SECTORS INPUT_FILE OUTPUT_FILE) - if(HEADER AND TRAILER) + function(tfm_sign OUT_ARG SUFFIX PAD MAX_SECTORS INPUT_FILE OUTPUT_FILE) + if(PAD) set(pad_args --pad --pad-header) - elseif(HEADER) - set(pad_args --pad-header) - elseif(TRAILER) - set(pad_args --pad) endif() # Secure + Non-secure images are signed the same way as a secure only # build, but with a different layout file. @@ -568,7 +564,7 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd S_NS TRUE TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) + tfm_sign(sign_cmd S_NS TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -593,12 +589,12 @@ if (CONFIG_BUILD_WITH_TFM) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns NS TRUE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS FALSE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) endif() - tfm_sign(sign_cmd_s S TRUE TRUE ${S_NS_MAX_SECTORS} $ + tfm_sign(sign_cmd_s S TRUE ${S_NS_MAX_SECTORS} $ ${S_SIGNED_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 From 9754246513375d46ab21aded3877715634274894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0800/3334] Revert "[nrf fromtree] trusted-firmware-m: Set --max-sectors when signing" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a1105bc7047b061ee5a0cfeaeffe99355b16222d. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 35 +++++------------------ 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index a6d645afb4c8..b958f94567fa 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -454,17 +454,15 @@ if (CONFIG_BUILD_WITH_TFM) if(CONFIG_TFM_BL2) set(image_alignment 1) set(flash_write_block_size 1) - set(flash_erase_block_size 1) dt_chosen(chosen_flash PROPERTY "zephyr,flash") if(DEFINED chosen_flash AND chosen_flash) dt_prop(flash_write_block_size PATH ${chosen_flash} PROPERTY write-block-size) - dt_prop(flash_erase_block_size PATH ${chosen_flash} PROPERTY erase-block-size) else() message(WARNING "The 'zephyr,flash' chosen property is not defined! - Using flash_write_block_size and flash_erase_block_size default values - that may differ from TF-M board definitions resulting in invalid signatures." + Using flash_write_block_size default value possible differs from + TF-M board definitions resulting in improver sign." ) endif() @@ -484,26 +482,9 @@ if (CONFIG_BUILD_WITH_TFM) set(image_alignment ${flash_write_block_size}) endif() endif() - - # Calculate the maximum number of sectors necessary to store the image. - dt_nodelabel(s_partition_node NODELABEL "slot0_partition" REQUIRED) - dt_nodelabel(ns_partition_node NODELABEL "slot0_ns_partition" REQUIRED) - dt_reg_size(s_partition_size PATH ${s_partition_node}) - dt_reg_size(ns_partition_size PATH ${ns_partition_node}) - math(EXPR S_MAX_SECTORS "${s_partition_size} / ${flash_erase_block_size}") - math(EXPR NS_MAX_SECTORS "${ns_partition_size} / ${flash_erase_block_size}") - if(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - math(EXPR S_NS_MAX_SECTORS "${S_MAX_SECTORS} + ${NS_MAX_SECTORS}") - else() - if(${S_MAX_SECTORS} GREATER ${NS_MAX_SECTORS}) - set(S_NS_MAX_SECTORS ${S_MAX_SECTORS}) - else() - set(S_NS_MAX_SECTORS ${NS_MAX_SECTORS}) - endif() - endif() endif() - function(tfm_sign OUT_ARG SUFFIX PAD MAX_SECTORS INPUT_FILE OUTPUT_FILE) + function(tfm_sign OUT_ARG SUFFIX PAD INPUT_FILE OUTPUT_FILE) if(PAD) set(pad_args --pad --pad-header) endif() @@ -523,7 +504,6 @@ if (CONFIG_BUILD_WITH_TFM) -k ${CONFIG_TFM_KEY_FILE_${SUFFIX}} --public-key-format ${TFM_PUBLIC_KEY_FORMAT} --align ${image_alignment} - --max-sectors ${MAX_SECTORS} -v ${CONFIG_TFM_IMAGE_VERSION_${SUFFIX}} ${pad_args} ${HEX_ADDR_ARGS_${SUFFIX}} @@ -564,7 +544,7 @@ if (CONFIG_BUILD_WITH_TFM) ) elseif(CONFIG_TFM_MCUBOOT_IMAGE_NUMBER STREQUAL "1") - tfm_sign(sign_cmd S_NS TRUE ${S_NS_MAX_SECTORS} ${S_NS_FILE} ${S_NS_SIGNED_FILE}) + tfm_sign(sign_cmd S_NS TRUE ${S_NS_FILE} ${S_NS_SIGNED_FILE}) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py @@ -589,13 +569,12 @@ if (CONFIG_BUILD_WITH_TFM) else() if (CONFIG_TFM_USE_NS_APP) - tfm_sign(sign_cmd_ns NS TRUE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS TRUE ${NS_APP_FILE} ${NS_SIGNED_FILE}) else() - tfm_sign(sign_cmd_ns NS FALSE ${S_NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_FILE}) + tfm_sign(sign_cmd_ns NS FALSE ${NS_APP_FILE} ${NS_SIGNED_FILE}) endif() - tfm_sign(sign_cmd_s S TRUE ${S_NS_MAX_SECTORS} $ - ${S_SIGNED_FILE}) + tfm_sign(sign_cmd_s S TRUE $ ${S_SIGNED_FILE}) #Create and sign for concatenated binary image, should align with the TF-M BL2 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands From 7ef4ba52488606b9104ca0070d94c57506b59069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0801/3334] Revert "[nrf fromtree] trusted-firmware-m: Set --align when signing" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6f112f3607b725d1f412cd166b21ab758fa27b35. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 35 +---------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index b958f94567fa..33c11d7145fd 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -451,39 +451,6 @@ if (CONFIG_BUILD_WITH_TFM) set(HEX_ADDR_ARGS_NS "--hex-addr=${TFM_HEX_BASE_ADDRESS_NS}") endif() - if(CONFIG_TFM_BL2) - set(image_alignment 1) - set(flash_write_block_size 1) - - dt_chosen(chosen_flash PROPERTY "zephyr,flash") - if(DEFINED chosen_flash AND chosen_flash) - dt_prop(flash_write_block_size PATH ${chosen_flash} PROPERTY write-block-size) - else() - message(WARNING - "The 'zephyr,flash' chosen property is not defined! - Using flash_write_block_size default value possible differs from - TF-M board definitions resulting in improver sign." - ) - endif() - - # The alignment is determined by the minimal amount of bytes necessary to - # be written in the flash sector. Ex., assuming that the sector erase - # operation is 1KiB and, on that sector, the minimum amount of bytes that - # must be written is 8 bytes then the alignment is 8. - # - # Current MCUboot maximum alignment is 32 bytes. - if(flash_write_block_size GREATER 0) - if(flash_write_block_size GREATER 32) - message(WARNING - "imgtool max alignment is 32 and current value is ${flash_write_block_size}. - Keep default image alignment of 1." - ) - else() - set(image_alignment ${flash_write_block_size}) - endif() - endif() - endif() - function(tfm_sign OUT_ARG SUFFIX PAD INPUT_FILE OUTPUT_FILE) if(PAD) set(pad_args --pad --pad-header) @@ -503,7 +470,7 @@ if (CONFIG_BUILD_WITH_TFM) --layout ${layout_file} -k ${CONFIG_TFM_KEY_FILE_${SUFFIX}} --public-key-format ${TFM_PUBLIC_KEY_FORMAT} - --align ${image_alignment} + --align 1 -v ${CONFIG_TFM_IMAGE_VERSION_${SUFFIX}} ${pad_args} ${HEX_ADDR_ARGS_${SUFFIX}} From 29649817c75fde0384fc53daff7ecb21731a4edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0802/3334] Revert "[nrf fromtree] modules: tf-m: Kconfig.tfm: Update TFM_BOARD" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit af478590508fd9f47a301853d48100907f0e1f22. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/Kconfig.tfm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index f587ea01e45f..b8bc3831848b 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -10,7 +10,7 @@ config ZEPHYR_TRUSTED_FIRMWARE_M_MODULE config TFM_BOARD string - default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS || BOARD_MAX32658EVKIT_MAX32658_NS + default "nxp/lpcxpresso55s69" if BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS default "arm/mps2/an521" if BOARD_MPS2_AN521_CPU0_NS default "arm/mps3/corstone300/fvp" if BOARD_MPS3_CORSTONE300_FVP_NS default "arm/mps3/corstone300/an547" if BOARD_MPS3_CORSTONE300_AN547_NS @@ -19,13 +19,13 @@ config TFM_BOARD default "arm/mps3/corstone310/fvp" if BOARD_MPS3_CORSTONE310_FVP_NS default "arm/mps4/corstone315" if BOARD_MPS4_CORSTONE315_FVP_NS default "arm/mps4/corstone320" if BOARD_MPS4_CORSTONE320_FVP_NS - default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 - default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 - default "nxp/lpcxpresso55s69" if BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS default "stm/b_u585i_iot02a" if BOARD_B_U585I_IOT02A default "stm/nucleo_l552ze_q" if BOARD_NUCLEO_L552ZE_Q default "stm/stm32l562e_dk" if BOARD_STM32L562E_DK default "stm/stm32wba65i_dk" if BOARD_NUCLEO_WBA65RI || BOARD_STM32WBA65I_DK1 + default "arm/musca_b1" if BOARD_V2M_MUSCA_B1 + default "arm/musca_s1" if BOARD_V2M_MUSCA_S1 + default "adi/max32657" if BOARD_MAX32657EVKIT_MAX32657_NS || BOARD_MAX32658EVKIT_MAX32658_NS default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9160" if SOC_NRF9160 default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf9120" if SOC_NRF9120 default "$(ZEPHYR_BASE)/modules/trusted-firmware-m/nordic/nrf5340_cpuapp" if SOC_NRF5340_CPUAPP From 12175355df5b93abeae7bf63ea47888211b58c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0803/3334] Revert "[nrf fromtree] modules: tf-m: Remove some download Kconfigs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 64285e292efe8be236a4e2bce681f6c1110a60a0. Signed-off-by: Tomasz Moń --- modules/trusted-firmware-m/CMakeLists.txt | 11 ++++--- modules/trusted-firmware-m/Kconfig.tfm | 37 +++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 33c11d7145fd..4b730b4a342d 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -67,8 +67,6 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_KEY_${SUFFIX}=${CONFIG_TFM_KEY_FILE_${SUFFIX}}) endforeach() - # Supply path to MCUboot for TF-M build - list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_PATH=${ZEPHYR_MCUBOOT_MODULE_DIR}) else() list(APPEND TFM_CMAKE_ARGS -DBL2=FALSE) endif() @@ -258,6 +256,11 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DHAL_ADI_PATH=${ZEPHYR_ADI_MODULE_DIR}) endif() + if(CONFIG_TFM_BL2 AND CONFIG_TFM_MCUBOOT_PATH_LOCAL) + # Supply path to MCUboot for TF-M build + list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_PATH=${ZEPHYR_MCUBOOT_MODULE_DIR}) + endif() + if(CONFIG_TFM_MCUBOOT_DATA_SHARING) list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_DATA_SHARING=ON) endif() @@ -274,8 +277,8 @@ if (CONFIG_BUILD_WITH_TFM) list(APPEND TFM_CMAKE_ARGS -DTFM_TESTS_REVISION_CHECKS=OFF) - if(CONFIG_SOC_SERIES_MPS3 OR CONFIG_SOC_SERIES_MPS4) - list(APPEND TFM_CMAKE_ARGS -DETHOS_DRIVER_PATH=${ZEPHYR_HAL_ETHOS_U_MODULE_DIR}) + if(CONFIG_TFM_ETHOS_DRIVER_PATH_LOCAL) + list(APPEND TFM_CMAKE_ARGS -DETHOS_DRIVER_PATH=${CONFIG_TFM_ETHOS_DRIVER_PATH_LOCAL}) endif() if(CONFIG_TFM_STM32_FLASH_LAYOUT_BEGIN_OFFSET) diff --git a/modules/trusted-firmware-m/Kconfig.tfm b/modules/trusted-firmware-m/Kconfig.tfm index b8bc3831848b..6c3ac64487f2 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm +++ b/modules/trusted-firmware-m/Kconfig.tfm @@ -310,6 +310,43 @@ config TFM_MCUBOOT_IMAGE_NUMBER updated in one atomic operation. When this is 2, they are split and can be updated independently if dependency requirements are met. +choice TFM_MCUBOOT_PATH + prompt "Path to MCUboot or DOWNLOAD to fetch automatically" + default TFM_MCUBOOT_PATH_LOCAL + help + Path to MCUboot for TF-M builds. The default option + is to use Zephyr's MCUboot module. As an alternative, + users may switch to the 'download' version; in that + case MCUboot will be fetched by the TF-M build during + build time. The default option ensures that Zephyr builds + with TF-M do not fetch external trees. + +config TFM_MCUBOOT_PATH_LOCAL + bool "TF-M to use Zephyr's MCUboot" + help + TF-M builds with BL2 will use the Zephyr's MCUboot version, + which is present in the MCUboot module. + +config TFM_MCUBOOT_PATH_DOWNLOAD + bool "TF-M to automatically download MCUboot during build" + help + TF-M builds with BL2 will let the TF-M build to automatically + fetch and check-out the MCUboot version to use in the build. + +endchoice + +config TFM_ETHOS_DRIVER_PATH_LOCAL + string "Path to a locally available Ethos-U driver or an empty string" + depends on SOC_SERIES_MPS3 || SOC_SERIES_MPS4 + default "$(ZEPHYR_HAL_ETHOS_U_MODULE_DIR)" + help + Path to a locally available Ethos-U driver to be used for TF-M builds or + an empty string to allow TF-M to automatically fetch the Ethos-U + driver from an external repository at build time. + By default Zephyr's Ethos-U driver will be used. It is present in + the hal_ethos_u module. + Alternatively, applications can point to their own paths for Ethos-U driver. + config TFM_QCBOR_PATH string prompt "Path to QCBOR or DOWNLOAD to fetch automatically" From a94346ad2b84602adcf51b8c7e838840540288b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Fri, 23 Jan 2026 11:01:21 +0100 Subject: [PATCH 0804/3334] Revert "[nrf fromtree] boards: adi: Add MAX32658EVKIT secure and nonsecure boards" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 70f1acd17ce3be4226a1e7cbd81ecf79c831276e. Signed-off-by: Tomasz Moń --- boards/adi/max32658evkit/Kconfig.defconfig | 48 -- .../adi/max32658evkit/Kconfig.max32658evkit | 6 - boards/adi/max32658evkit/board.cmake | 12 - boards/adi/max32658evkit/board.yml | 10 - .../max32658evkit/doc/img/max32658evkit.webp | Bin 76448 -> 0 bytes boards/adi/max32658evkit/doc/index.rst | 571 ------------------ .../max32658evkit/max32658evkit_max32658.dts | 52 -- .../max32658evkit/max32658evkit_max32658.yaml | 21 - .../max32658evkit_max32658_common.dtsi | 108 ---- .../max32658evkit_max32658_defconfig | 16 - .../max32658evkit_max32658_ns.dts | 75 --- .../max32658evkit_max32658_ns.yaml | 20 - .../max32658evkit_max32658_ns_defconfig | 19 - modules/trusted-firmware-m/CMakeLists.txt | 2 +- modules/trusted-firmware-m/Kconfig.tfm | 2 +- 15 files changed, 2 insertions(+), 960 deletions(-) delete mode 100644 boards/adi/max32658evkit/Kconfig.defconfig delete mode 100644 boards/adi/max32658evkit/Kconfig.max32658evkit delete mode 100644 boards/adi/max32658evkit/board.cmake delete mode 100644 boards/adi/max32658evkit/board.yml delete mode 100644 boards/adi/max32658evkit/doc/img/max32658evkit.webp delete mode 100644 boards/adi/max32658evkit/doc/index.rst delete mode 100644 boards/adi/max32658evkit/max32658evkit_max32658.dts delete mode 100644 boards/adi/max32658evkit/max32658evkit_max32658.yaml delete mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_common.dtsi delete mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_defconfig delete mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_ns.dts delete mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_ns.yaml delete mode 100644 boards/adi/max32658evkit/max32658evkit_max32658_ns_defconfig diff --git a/boards/adi/max32658evkit/Kconfig.defconfig b/boards/adi/max32658evkit/Kconfig.defconfig deleted file mode 100644 index 8235ba516f2b..000000000000 --- a/boards/adi/max32658evkit/Kconfig.defconfig +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2024-2025 Analog Devices, Inc. -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_MAX32658EVKIT - -# Code Partition: -# -# For the secure version of the board the firmware is linked at the beginning -# of the flash, or into the code-partition defined in DT if it is intended to -# be loaded by MCUboot. If the secure firmware is to be combined with a non- -# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always -# be restricted to the size of its code partition. -# -# For the non-secure version of the board, the firmware -# must be linked into the code-partition (non-secure) defined in DT, regardless. -# Apply this configuration below by setting the Kconfig symbols used by -# the linker according to the information extracted from DT partitions. - -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -if BOARD_MAX32658EVKIT_MAX32658_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -# MAX32658 has one UART interface, -# It can be used either on TFM or Zephyr -# Enabling debug (TFM_SPM_LOG_LEVEL || TFM_PARTITION_LOG_LEVEL) will transfer it to the TFM side -# Disabling TFM debug will transfer it to the Zephyr side. - -choice TFM_SPM_LOG_LEVEL - default TFM_SPM_LOG_LEVEL_SILENCE -endchoice - -choice TFM_PARTITION_LOG_LEVEL - default TFM_PARTITION_LOG_LEVEL_SILENCE -endchoice - -endif # BOARD_MAX32658EVKIT_MAX32658_NS - -config I3C - default y if ADXL367 - -endif # BOARD_MAX32658EVKIT diff --git a/boards/adi/max32658evkit/Kconfig.max32658evkit b/boards/adi/max32658evkit/Kconfig.max32658evkit deleted file mode 100644 index d7b695e47587..000000000000 --- a/boards/adi/max32658evkit/Kconfig.max32658evkit +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2024-2025 Analog Devices, Inc. -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_MAX32658EVKIT - select SOC_MAX32658 if BOARD_MAX32658EVKIT_MAX32658 || \ - BOARD_MAX32658EVKIT_MAX32658_NS diff --git a/boards/adi/max32658evkit/board.cmake b/boards/adi/max32658evkit/board.cmake deleted file mode 100644 index 32e6669b7018..000000000000 --- a/boards/adi/max32658evkit/board.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024-2025 Analog Devices, Inc. -# SPDX-License-Identifier: Apache-2.0 - -if(CONFIG_BOARD_MAX32658EVKIT_MAX32658_NS) - set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) -endif() - -board_runner_args(jlink "--device=MAX32658" "--reset-after-load") - -include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) -include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/adi/max32658evkit/board.yml b/boards/adi/max32658evkit/board.yml deleted file mode 100644 index 07a2bd79226d..000000000000 --- a/boards/adi/max32658evkit/board.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2024-2025 Analog Devices, Inc. -# SPDX-License-Identifier: Apache-2.0 - -board: - name: max32658evkit - vendor: adi - socs: - - name: max32658 - variants: - - name: "ns" diff --git a/boards/adi/max32658evkit/doc/img/max32658evkit.webp b/boards/adi/max32658evkit/doc/img/max32658evkit.webp deleted file mode 100644 index 7bbf5b668eef641659656e1ba888ba53d0954131..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 76448 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